|
1426 | 1426 | ], |
1427 | 1427 | "methods": [] |
1428 | 1428 | }, |
| 1429 | + { |
| 1430 | + "name": "AgentError", |
| 1431 | + "kind": "class", |
| 1432 | + "description": "Structured, classified failure surfaced on `Agent.error`. Extends `Error`\n so existing `.message` / `instanceof Error` reads keep working.", |
| 1433 | + "params": [ |
| 1434 | + { |
| 1435 | + "name": "init", |
| 1436 | + "type": "object", |
| 1437 | + "description": "", |
| 1438 | + "optional": false |
| 1439 | + } |
| 1440 | + ], |
| 1441 | + "examples": [], |
| 1442 | + "properties": [ |
| 1443 | + { |
| 1444 | + "name": "cause", |
| 1445 | + "type": "unknown", |
| 1446 | + "description": "", |
| 1447 | + "optional": false |
| 1448 | + }, |
| 1449 | + { |
| 1450 | + "name": "kind", |
| 1451 | + "type": "AgentErrorKind", |
| 1452 | + "description": "", |
| 1453 | + "optional": false |
| 1454 | + }, |
| 1455 | + { |
| 1456 | + "name": "message", |
| 1457 | + "type": "string", |
| 1458 | + "description": "", |
| 1459 | + "optional": false |
| 1460 | + }, |
| 1461 | + { |
| 1462 | + "name": "name", |
| 1463 | + "type": "string", |
| 1464 | + "description": "", |
| 1465 | + "optional": false |
| 1466 | + }, |
| 1467 | + { |
| 1468 | + "name": "retryable", |
| 1469 | + "type": "boolean", |
| 1470 | + "description": "connection | server | interrupted → true; auth | aborted | non-auth-4xx → false.", |
| 1471 | + "optional": false |
| 1472 | + }, |
| 1473 | + { |
| 1474 | + "name": "stack", |
| 1475 | + "type": "string", |
| 1476 | + "description": "", |
| 1477 | + "optional": true |
| 1478 | + }, |
| 1479 | + { |
| 1480 | + "name": "status", |
| 1481 | + "type": "number", |
| 1482 | + "description": "", |
| 1483 | + "optional": true |
| 1484 | + } |
| 1485 | + ], |
| 1486 | + "methods": [] |
| 1487 | + }, |
1429 | 1488 | { |
1430 | 1489 | "name": "ChatApprovalCardComponent", |
1431 | 1490 | "kind": "class", |
|
2118 | 2177 | "type": "InputSignal<Agent>", |
2119 | 2178 | "description": "", |
2120 | 2179 | "optional": false |
2121 | | - }, |
2122 | | - { |
2123 | | - "name": "errorMessage", |
2124 | | - "type": "Signal<string | null>", |
2125 | | - "description": "", |
2126 | | - "optional": false |
2127 | 2180 | } |
2128 | 2181 | ], |
2129 | 2182 | "methods": [] |
|
5320 | 5373 | }, |
5321 | 5374 | { |
5322 | 5375 | "name": "error", |
5323 | | - "type": "Signal<unknown>", |
| 5376 | + "type": "Signal<AgentError<> | undefined>", |
5324 | 5377 | "description": "", |
5325 | 5378 | "optional": false |
5326 | 5379 | }, |
|
5354 | 5407 | "description": "Discards the assistant message at the given index AND all messages after\nit, then re-runs the agent against the trimmed conversation tail. The\npreceding user message (at index - 1) is preserved and re-submitted as\nthe agent's input. No new user message is added to the history.\n\nThrows if the message at `index` is not 'assistant' role, or if the\nagent is currently loading another response.", |
5355 | 5408 | "optional": false |
5356 | 5409 | }, |
| 5410 | + { |
| 5411 | + "name": "retry", |
| 5412 | + "type": "() => Promise<void>", |
| 5413 | + "description": "Re-run the last submitted input after a failure. No-op if a run is already\n in flight or there is nothing to retry. Clears `error` and sets loading.", |
| 5414 | + "optional": false |
| 5415 | + }, |
5357 | 5416 | { |
5358 | 5417 | "name": "state", |
5359 | 5418 | "type": "Signal<Record<string, unknown>>", |
|
5614 | 5673 | }, |
5615 | 5674 | { |
5616 | 5675 | "name": "error", |
5617 | | - "type": "Signal<unknown>", |
| 5676 | + "type": "Signal<AgentError<> | undefined>", |
5618 | 5677 | "description": "", |
5619 | 5678 | "optional": false |
5620 | 5679 | }, |
|
5660 | 5719 | "description": "Discards the assistant message at the given index AND all messages after\nit, then re-runs the agent against the trimmed conversation tail. The\npreceding user message (at index - 1) is preserved and re-submitted as\nthe agent's input. No new user message is added to the history.\n\nThrows if the message at `index` is not 'assistant' role, or if the\nagent is currently loading another response.", |
5661 | 5720 | "optional": false |
5662 | 5721 | }, |
| 5722 | + { |
| 5723 | + "name": "retry", |
| 5724 | + "type": "() => Promise<void>", |
| 5725 | + "description": "Re-run the last submitted input after a failure. No-op if a run is already\n in flight or there is nothing to retry. Clears `error` and sets loading.", |
| 5726 | + "optional": false |
| 5727 | + }, |
5663 | 5728 | { |
5664 | 5729 | "name": "state", |
5665 | 5730 | "type": "Signal<Record<string, unknown>>", |
|
6273 | 6338 | }, |
6274 | 6339 | { |
6275 | 6340 | "name": "error", |
6276 | | - "type": "WritableSignal<unknown>", |
| 6341 | + "type": "WritableSignal<AgentError<> | undefined>", |
6277 | 6342 | "description": "", |
6278 | 6343 | "optional": false |
6279 | 6344 | }, |
|
6319 | 6384 | "description": "Discards the assistant message at the given index AND all messages after\nit, then re-runs the agent against the trimmed conversation tail. The\npreceding user message (at index - 1) is preserved and re-submitted as\nthe agent's input. No new user message is added to the history.\n\nThrows if the message at `index` is not 'assistant' role, or if the\nagent is currently loading another response.", |
6320 | 6385 | "optional": false |
6321 | 6386 | }, |
| 6387 | + { |
| 6388 | + "name": "retry", |
| 6389 | + "type": "() => Promise<void>", |
| 6390 | + "description": "Re-run the last submitted input after a failure. No-op if a run is already\n in flight or there is nothing to retry. Clears `error` and sets loading.", |
| 6391 | + "optional": false |
| 6392 | + }, |
6322 | 6393 | { |
6323 | 6394 | "name": "state", |
6324 | 6395 | "type": "WritableSignal<Record<string, unknown>>", |
|
6377 | 6448 | "properties": [ |
6378 | 6449 | { |
6379 | 6450 | "name": "error", |
6380 | | - "type": "unknown", |
| 6451 | + "type": "AgentError<>", |
6381 | 6452 | "description": "", |
6382 | 6453 | "optional": true |
6383 | 6454 | }, |
|
6950 | 7021 | "signature": "Readonly<Record<string, Type<unknown> | A2uiViewEntry>>", |
6951 | 7022 | "examples": [] |
6952 | 7023 | }, |
| 7024 | + { |
| 7025 | + "name": "AgentErrorKind", |
| 7026 | + "kind": "type", |
| 7027 | + "description": "", |
| 7028 | + "signature": "\"connection\" | \"auth\" | \"server\" | \"interrupted\" | \"aborted\"", |
| 7029 | + "examples": [] |
| 7030 | + }, |
6953 | 7031 | { |
6954 | 7032 | "name": "AgentEvent", |
6955 | 7033 | "kind": "type", |
|
7104 | 7182 | "signature": "Readonly<Record<string, Type<unknown> | RenderViewEntry>>", |
7105 | 7183 | "examples": [] |
7106 | 7184 | }, |
| 7185 | + { |
| 7186 | + "name": "AGENT_ERROR_MESSAGES", |
| 7187 | + "kind": "const", |
| 7188 | + "description": "Default human-facing copy per kind.", |
| 7189 | + "signature": "Record<AgentErrorKind, string>", |
| 7190 | + "examples": [] |
| 7191 | + }, |
7107 | 7192 | { |
7108 | 7193 | "name": "cacheplaneMarkdownViews", |
7109 | 7194 | "kind": "const", |
|
7538 | 7623 | }, |
7539 | 7624 | "examples": [] |
7540 | 7625 | }, |
| 7626 | + { |
| 7627 | + "name": "isAbortError", |
| 7628 | + "kind": "function", |
| 7629 | + "description": "True when `raw` represents a user-requested abort. Shared by adapters + classifier.", |
| 7630 | + "signature": "isAbortError(raw: unknown): boolean", |
| 7631 | + "params": [ |
| 7632 | + { |
| 7633 | + "name": "raw", |
| 7634 | + "type": "unknown", |
| 7635 | + "description": "", |
| 7636 | + "optional": false |
| 7637 | + } |
| 7638 | + ], |
| 7639 | + "returns": { |
| 7640 | + "type": "boolean", |
| 7641 | + "description": "" |
| 7642 | + }, |
| 7643 | + "examples": [] |
| 7644 | + }, |
7541 | 7645 | { |
7542 | 7646 | "name": "isAssistantMessage", |
7543 | 7647 | "kind": "function", |
|
7841 | 7945 | }, |
7842 | 7946 | "examples": [] |
7843 | 7947 | }, |
| 7948 | + { |
| 7949 | + "name": "toAgentError", |
| 7950 | + "kind": "function", |
| 7951 | + "description": "Classify any raw error into a structured AgentError. Idempotent.", |
| 7952 | + "signature": "toAgentError(raw: unknown): AgentError<>", |
| 7953 | + "params": [ |
| 7954 | + { |
| 7955 | + "name": "raw", |
| 7956 | + "type": "unknown", |
| 7957 | + "description": "", |
| 7958 | + "optional": false |
| 7959 | + } |
| 7960 | + ], |
| 7961 | + "returns": { |
| 7962 | + "type": "AgentError<>", |
| 7963 | + "description": "" |
| 7964 | + }, |
| 7965 | + "examples": [] |
| 7966 | + }, |
7844 | 7967 | { |
7845 | 7968 | "name": "toClientToolSpecs", |
7846 | 7969 | "kind": "function", |
|
0 commit comments