@yolk-sdk/agent 0.1.0-canary.113 → 0.1.0-canary.115

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (104) hide show
  1. package/README.md +62 -46
  2. package/dist/client/index.d.mts +2 -2
  3. package/dist/client/state.d.mts +89 -90
  4. package/dist/client/state.d.mts.map +1 -1
  5. package/dist/client/state.mjs +157 -169
  6. package/dist/client/state.mjs.map +1 -1
  7. package/dist/compaction/estimator.d.mts.map +1 -1
  8. package/dist/compaction/estimator.mjs +2 -2
  9. package/dist/compaction/estimator.mjs.map +1 -1
  10. package/dist/compaction/retry.d.mts +30 -30
  11. package/dist/compaction/retry.d.mts.map +1 -1
  12. package/dist/compaction/window.d.mts +39 -39
  13. package/dist/compaction/window.d.mts.map +1 -1
  14. package/dist/loop/error.d.mts.map +1 -1
  15. package/dist/loop/error.mjs +4 -7
  16. package/dist/loop/error.mjs.map +1 -1
  17. package/dist/loop/run.d.mts.map +1 -1
  18. package/dist/loop/run.mjs +3 -5
  19. package/dist/loop/run.mjs.map +1 -1
  20. package/dist/protocol/content.d.mts +28 -3
  21. package/dist/protocol/content.d.mts.map +1 -1
  22. package/dist/protocol/content.mjs +58 -5
  23. package/dist/protocol/content.mjs.map +1 -1
  24. package/dist/protocol/event.d.mts +13 -2
  25. package/dist/protocol/event.d.mts.map +1 -1
  26. package/dist/protocol/event.mjs +23 -2
  27. package/dist/protocol/event.mjs.map +1 -1
  28. package/dist/protocol/file.d.mts +38 -0
  29. package/dist/protocol/file.d.mts.map +1 -0
  30. package/dist/protocol/file.mjs +49 -0
  31. package/dist/protocol/file.mjs.map +1 -0
  32. package/dist/protocol/index.d.mts +5 -3
  33. package/dist/protocol/index.d.mts.map +1 -1
  34. package/dist/protocol/index.mjs +5 -3
  35. package/dist/protocol/message.d.mts +4 -4
  36. package/dist/protocol/status.d.mts +133 -0
  37. package/dist/protocol/status.d.mts.map +1 -0
  38. package/dist/protocol/status.mjs +198 -0
  39. package/dist/protocol/status.mjs.map +1 -0
  40. package/dist/protocol/tool.d.mts +7 -2
  41. package/dist/protocol/tool.d.mts.map +1 -1
  42. package/dist/protocol/tool.mjs +6 -1
  43. package/dist/protocol/tool.mjs.map +1 -1
  44. package/dist/providers/anthropic-provider-internal.d.mts.map +1 -1
  45. package/dist/providers/anthropic-provider-internal.mjs +6 -3
  46. package/dist/providers/anthropic-provider-internal.mjs.map +1 -1
  47. package/dist/providers/openai/provider.d.mts.map +1 -1
  48. package/dist/providers/openai/provider.mjs +8 -3
  49. package/dist/providers/openai/provider.mjs.map +1 -1
  50. package/dist/providers/openai-responses-provider-internal.d.mts.map +1 -1
  51. package/dist/providers/openai-responses-provider-internal.mjs +6 -3
  52. package/dist/providers/openai-responses-provider-internal.mjs.map +1 -1
  53. package/dist/react/chat-actions.d.mts +20 -20
  54. package/dist/react/chat-actions.d.mts.map +1 -1
  55. package/dist/react/chat-core.d.mts +4 -7
  56. package/dist/react/chat-core.d.mts.map +1 -1
  57. package/dist/react/chat-core.mjs +30 -87
  58. package/dist/react/chat-core.mjs.map +1 -1
  59. package/dist/react/chat-items.d.mts +88 -88
  60. package/dist/react/chat-items.d.mts.map +1 -1
  61. package/dist/react/chat-messages.d.mts +141 -141
  62. package/dist/react/chat-messages.d.mts.map +1 -1
  63. package/dist/react/chat-session-events.d.mts +1 -1
  64. package/dist/react/index.d.mts +2 -2
  65. package/dist/react/use-agent-chat.d.mts +10 -3
  66. package/dist/react/use-agent-chat.d.mts.map +1 -1
  67. package/dist/react/use-agent-chat.mjs +4 -4
  68. package/dist/react/use-agent-chat.mjs.map +1 -1
  69. package/dist/skillset/merge.d.mts +1 -1
  70. package/dist/tools/files.d.mts +57 -0
  71. package/dist/tools/files.d.mts.map +1 -0
  72. package/dist/tools/files.mjs +119 -0
  73. package/dist/tools/files.mjs.map +1 -0
  74. package/dist/tools/index.d.mts +2 -1
  75. package/dist/tools/index.mjs +2 -1
  76. package/dist/tools/ledger.d.mts.map +1 -1
  77. package/dist/tools/ledger.mjs +11 -3
  78. package/dist/tools/ledger.mjs.map +1 -1
  79. package/dist/tools/registry.d.mts +6 -0
  80. package/dist/tools/registry.d.mts.map +1 -1
  81. package/dist/tools/registry.mjs +24 -14
  82. package/dist/tools/registry.mjs.map +1 -1
  83. package/package.json +2 -2
  84. package/src/client/index.ts +0 -1
  85. package/src/client/state.ts +125 -127
  86. package/src/compaction/estimator.ts +2 -0
  87. package/src/loop/error.ts +9 -3
  88. package/src/loop/run.ts +11 -12
  89. package/src/protocol/content.ts +66 -1
  90. package/src/protocol/event.ts +34 -1
  91. package/src/protocol/file.ts +70 -0
  92. package/src/protocol/index.ts +51 -0
  93. package/src/protocol/status.ts +427 -0
  94. package/src/protocol/tool.ts +6 -1
  95. package/src/providers/anthropic-provider-internal.ts +5 -0
  96. package/src/providers/openai/provider.ts +12 -0
  97. package/src/providers/openai-responses-provider-internal.ts +5 -0
  98. package/src/react/chat-core.ts +143 -231
  99. package/src/react/index.ts +0 -1
  100. package/src/react/use-agent-chat.ts +4 -4
  101. package/src/tools/files.ts +260 -0
  102. package/src/tools/index.ts +4 -0
  103. package/src/tools/ledger.ts +28 -2
  104. package/src/tools/registry.ts +56 -16
package/README.md CHANGED
@@ -20,47 +20,47 @@ Published package metadata requires Node.js 22+.
20
20
 
21
21
  ## Subpaths
22
22
 
23
- | Subpath | Purpose |
24
- | -------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- |
25
- | `@yolk-sdk/agent/protocol` | Wire messages, events, content, usage, tool schemas |
26
- | `@yolk-sdk/agent/loop` | Stateless LLM/tool loop, host instructions |
27
- | `@yolk-sdk/agent/loop/testing` | Faux provider and tool executor test helpers |
28
- | `@yolk-sdk/agent/runtime` | Transcript or append-backed runtime orchestration |
29
- | `@yolk-sdk/agent/client` | HTTP/NDJSON transport, HITL resume, retry/error state helpers |
30
- | `@yolk-sdk/agent/compaction` | Host-owned compaction budgets, checkpoints, formatting, retry |
31
- | `@yolk-sdk/agent/classification` | Classifier model contract: typed questions, answers, usage, errors |
32
- | `@yolk-sdk/agent/tools` | Tool registry, deferred loading (`tool_search`), typed inputs, interactions, subagents/questions, durable tool ledger, staged tool plans, tool change previews |
33
- | `@yolk-sdk/agent/react` | Headless React chat hook, reducer, selectors, and render model |
34
- | `@yolk-sdk/agent/oauth` | Provider-neutral OAuth token and broker contracts |
35
- | `@yolk-sdk/agent/providers/openai` | OpenAI/Codex OAuth and broker helpers |
36
- | `@yolk-sdk/agent/providers/openai/codex` | OpenAI Codex request and auth helpers |
37
- | `@yolk-sdk/agent/providers/openai/codex-usage` | Codex subscription-allowance snapshots |
38
- | `@yolk-sdk/agent/providers/openai/codex-provider` | Codex LLM provider factory |
39
- | `@yolk-sdk/agent/providers/openai/provider` | OpenAI-compatible LLM provider factory |
40
- | `@yolk-sdk/agent/providers/openai/conformance` | Synthetic OpenAI chat, Codex Responses, and Codex usage fixtures and conformance cases |
41
- | `@yolk-sdk/agent/providers/openai/realtime` | OpenAI Realtime session config and event codecs |
42
- | `@yolk-sdk/agent/providers/openai/speech` | OpenAI text-to-speech and transcription adapters |
43
- | `@yolk-sdk/agent/providers/vercel/ai-gateway-provider` | Vercel AI Gateway Chat Completions provider factory |
44
- | `@yolk-sdk/agent/providers/vercel/ai-gateway-classifier` | Vercel AI Gateway classifier (`POST /v1/evaluate`) layer |
45
- | `@yolk-sdk/agent/providers/vercel/conformance` | Verified Gateway chat fixtures, synthetic classifier fixtures, and conformance cases |
46
- | `@yolk-sdk/agent/providers/opencode/go-provider` | OpenCode Go Chat Completions, Messages, and Responses provider |
47
- | `@yolk-sdk/agent/providers/opencode/usage` | OpenCode Go subscription-allowance snapshots |
48
- | `@yolk-sdk/agent/providers/opencode/conformance` | Synthetic OpenCode Go (per protocol, commentary replay, usage) fixtures and conformance cases |
49
- | `@yolk-sdk/agent/providers/anthropic` | Anthropic/Claude OAuth and broker helpers |
50
- | `@yolk-sdk/agent/providers/anthropic/claude` | Claude request and auth helpers |
51
- | `@yolk-sdk/agent/providers/anthropic/usage` | Claude subscription-allowance snapshots |
52
- | `@yolk-sdk/agent/providers/anthropic/claude-provider` | Claude LLM provider factory, thinking config, and reasoning replay provider id |
53
- | `@yolk-sdk/agent/providers/anthropic/conformance` | Synthetic Anthropic Messages and Claude usage fixtures and conformance cases |
54
- | `@yolk-sdk/agent/providers/xai` | Grok subscription OAuth and token broker helpers |
55
- | `@yolk-sdk/agent/providers/xai/grok` | Grok subscription request and auth helpers |
56
- | `@yolk-sdk/agent/providers/xai/grok-provider` | Grok subscription LLM provider factory |
57
- | `@yolk-sdk/agent/providers/xai/usage` | Grok subscription-allowance snapshots |
58
- | `@yolk-sdk/agent/providers/xai/conformance` | Synthetic Grok Responses and Grok usage fixtures and conformance cases |
59
- | `@yolk-sdk/agent/providers/subscription-usage` | Shared allowance snapshot and safe error schemas |
60
- | `@yolk-sdk/agent/skillset` | Portable skill and slash-command parsing/catalogs |
61
- | `@yolk-sdk/agent/voice` | Voice protocol, controller, tool handler, projection, speech |
62
- | `@yolk-sdk/agent/voice/browser` | Browser WebRTC voice transport |
63
- | `@yolk-sdk/agent/voice/react` | Headless browser voice React hook |
23
+ | Subpath | Purpose |
24
+ | -------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
25
+ | `@yolk-sdk/agent/protocol` | Wire messages, events, content (including `FilePart`), usage, tool schemas |
26
+ | `@yolk-sdk/agent/loop` | Stateless LLM/tool loop, host instructions |
27
+ | `@yolk-sdk/agent/loop/testing` | Faux provider and tool executor test helpers |
28
+ | `@yolk-sdk/agent/runtime` | Transcript or append-backed runtime orchestration |
29
+ | `@yolk-sdk/agent/client` | HTTP/NDJSON transport, HITL resume, retry/error state helpers |
30
+ | `@yolk-sdk/agent/compaction` | Host-owned compaction budgets, checkpoints, formatting, retry |
31
+ | `@yolk-sdk/agent/classification` | Classifier model contract: typed questions, answers, usage, errors |
32
+ | `@yolk-sdk/agent/tools` | Tool registry, deferred loading (`tool_search`), typed inputs, interactions, subagents/questions, durable tool ledger, staged tool plans, tool change previews, file capture |
33
+ | `@yolk-sdk/agent/react` | Headless React chat hook, reducer, selectors, and render model |
34
+ | `@yolk-sdk/agent/oauth` | Provider-neutral OAuth token and broker contracts |
35
+ | `@yolk-sdk/agent/providers/openai` | OpenAI/Codex OAuth and broker helpers |
36
+ | `@yolk-sdk/agent/providers/openai/codex` | OpenAI Codex request and auth helpers |
37
+ | `@yolk-sdk/agent/providers/openai/codex-usage` | Codex subscription-allowance snapshots |
38
+ | `@yolk-sdk/agent/providers/openai/codex-provider` | Codex LLM provider factory |
39
+ | `@yolk-sdk/agent/providers/openai/provider` | OpenAI-compatible LLM provider factory |
40
+ | `@yolk-sdk/agent/providers/openai/conformance` | Synthetic OpenAI chat, Codex Responses, and Codex usage fixtures and conformance cases |
41
+ | `@yolk-sdk/agent/providers/openai/realtime` | OpenAI Realtime session config and event codecs |
42
+ | `@yolk-sdk/agent/providers/openai/speech` | OpenAI text-to-speech and transcription adapters |
43
+ | `@yolk-sdk/agent/providers/vercel/ai-gateway-provider` | Vercel AI Gateway Chat Completions provider factory |
44
+ | `@yolk-sdk/agent/providers/vercel/ai-gateway-classifier` | Vercel AI Gateway classifier (`POST /v1/evaluate`) layer |
45
+ | `@yolk-sdk/agent/providers/vercel/conformance` | Verified Gateway chat fixtures, synthetic classifier fixtures, and conformance cases |
46
+ | `@yolk-sdk/agent/providers/opencode/go-provider` | OpenCode Go Chat Completions, Messages, and Responses provider |
47
+ | `@yolk-sdk/agent/providers/opencode/usage` | OpenCode Go subscription-allowance snapshots |
48
+ | `@yolk-sdk/agent/providers/opencode/conformance` | Synthetic OpenCode Go (per protocol, commentary replay, usage) fixtures and conformance cases |
49
+ | `@yolk-sdk/agent/providers/anthropic` | Anthropic/Claude OAuth and broker helpers |
50
+ | `@yolk-sdk/agent/providers/anthropic/claude` | Claude request and auth helpers |
51
+ | `@yolk-sdk/agent/providers/anthropic/usage` | Claude subscription-allowance snapshots |
52
+ | `@yolk-sdk/agent/providers/anthropic/claude-provider` | Claude LLM provider factory, thinking config, and reasoning replay provider id |
53
+ | `@yolk-sdk/agent/providers/anthropic/conformance` | Synthetic Anthropic Messages and Claude usage fixtures and conformance cases |
54
+ | `@yolk-sdk/agent/providers/xai` | Grok subscription OAuth and token broker helpers |
55
+ | `@yolk-sdk/agent/providers/xai/grok` | Grok subscription request and auth helpers |
56
+ | `@yolk-sdk/agent/providers/xai/grok-provider` | Grok subscription LLM provider factory |
57
+ | `@yolk-sdk/agent/providers/xai/usage` | Grok subscription-allowance snapshots |
58
+ | `@yolk-sdk/agent/providers/xai/conformance` | Synthetic Grok Responses and Grok usage fixtures and conformance cases |
59
+ | `@yolk-sdk/agent/providers/subscription-usage` | Shared allowance snapshot and safe error schemas |
60
+ | `@yolk-sdk/agent/skillset` | Portable skill and slash-command parsing/catalogs |
61
+ | `@yolk-sdk/agent/voice` | Voice protocol, controller, tool handler, projection, speech |
62
+ | `@yolk-sdk/agent/voice/browser` | Browser WebRTC voice transport |
63
+ | `@yolk-sdk/agent/voice/react` | Headless browser voice React hook |
64
64
 
65
65
  ## Imports
66
66
 
@@ -121,9 +121,9 @@ import { FauxProvider, Reply, TestToolExecutor } from '@yolk-sdk/agent/loop/test
121
121
 
122
122
  ## Headless React chat
123
123
 
124
- `useAgentChat` exposes protocol messages, render-oriented chat messages, run/error/waiting state,
125
- and actions for submit, stop, edit, regenerate, delete, tool approval, question, and typed input responses. The
126
- package supplies no components, styling, auth, or route ownership, and React remains an optional
124
+ `useAgentChat` exposes protocol messages, render-oriented chat messages, the run `status`
125
+ (`AgentStatus`), per-subagent `subagents` statuses, running/waiting flags, and actions for submit,
126
+ stop, edit, regenerate, delete, tool approval, question, and typed input responses. The package supplies no components, styling, auth, or route ownership, and React remains an optional
127
127
  peer used only by React subpaths.
128
128
 
129
129
  Chat ADTs on `@yolk-sdk/agent/react` are value constructors: `AgentChatPart`, `ChatToolState`,
@@ -455,8 +455,9 @@ policy and emits protocol-visible retry/error state:
455
455
  - `AgentError.provider` preserves final terminal metadata.
456
456
  - `AgentErrorCode` includes `rate_limit`, `overloaded`, `context_overflow`, and generic
457
457
  `provider_error`.
458
- - Client and React state keep `error: string | null` for compatibility and add typed `errorInfo` /
459
- `retryInfo`.
458
+ - Client and React state carry an `AgentStatus` (ADR 0010): terminal errors are `Failed` (with the
459
+ `AgentError` when the stream sent one) and pending retries `Working(Retrying)`
460
+ (`agentStatusRetry`).
460
461
  - `buildAgentChatItems` can project active retry state as an `AgentChatItem` with `_tag: 'Retry'`.
461
462
  - Anthropic prompt-too-long responses become non-retryable `context_overflow`; the host-owned
462
463
  compaction wrapper may compact and retry once.
@@ -564,6 +565,21 @@ inside one source fail validation. Hosts own file discovery, storage, enablement
564
565
  - `ImagePart` with `InlineBase64`, `Url`, or host-owned `Ref` source
565
566
  - `DocumentPart` with `InlineBase64`, `Url`, or host-owned `Ref` source
566
567
  - `AudioPart` with `InlineBase64`, `Url`, or host-owned `Ref` source
568
+ - `FilePart`: bytes a tool yields for other tools to move, not for the model to view. Providers
569
+ render it as its label only (`filePartText`)
570
+
571
+ ### File capture
572
+
573
+ `resolveTools(modules, context, { files: { store, maxFileBytes? } })` stores the inline bytes of
574
+ every executed result (direct, code mode nested, staged and interaction calls) through the host
575
+ `FileStoreApi` before the ledger or transcript sees them
576
+ ([ADR 0009](https://github.com/magoz/yolk-sdk/blob/main/docs/adr/0009-file-claim-check.md)). A
577
+ `FilePart` becomes a `fileId` label (`[file file_…: name, mime, size]`), inline images, documents
578
+ and audio keep their source and gain a label, and `ToolResult.files` lists the descriptors
579
+ (`FileDescriptor`, not sent to providers). Without `files`, over `maxFileBytes` (default 100 MiB)
580
+ or when storing fails, inline `FilePart` bytes become a "file not captured" label. Tools build
581
+ file parts with `filePartFromBytes`. `@yolk-sdk/files` provides an object-storage store and tools
582
+ that move a `fileId` to upload URLs, links and the sandbox.
567
583
 
568
584
  Build sources with `inlineBase64AttachmentSource`, `urlAttachmentSource`, or
569
585
  `refAttachmentSource`. OpenAI-compatible Chat Completions providers support inline text documents;
@@ -1,4 +1,4 @@
1
1
  import { documentPartFromTextFile, textFromBlob } from "./attachments.mjs";
2
- import { AgentClientState, AgentRunStatus, AgentToolRun, AgentTranscript, ApplyAgentEventOptions, appendAgentMessage, applyAgentEvent, completedToolRuns, initialAgentClientState, isActiveToolRun, markAgentAborted, markAgentError, reduceAgentEvents, submitAgentUserMessage, toolRunsFromHitlRequests } from "./state.mjs";
2
+ import { AgentClientState, AgentToolRun, AgentTranscript, ApplyAgentEventOptions, appendAgentMessage, applyAgentEvent, completedToolRuns, initialAgentClientState, isActiveToolRun, markAgentAborted, markAgentError, reduceAgentEvents, submitAgentUserMessage, toolRunsFromHitlRequests } from "./state.mjs";
3
3
  import { AgentHttpResponseInfo, AgentRunContinuationOptions, AgentRunIdleReconnectOptions, AgentTransportError, CancelAgentRunRequest, StreamAgentEventHandler, StreamAgentEventsRequest, StreamAgentEventsUntilTerminalRequest, StreamAgentRunEventsRequest, StreamAgentRunEventsUntilTerminalRequest, StreamAgentRunHitlResponseEventsRequest, StreamAgentRunHitlResponseEventsUntilTerminalRequest, StreamCloudflareAgentEventsRequest, SubmitInputResponseRequest, SubmitInteractionResponseRequest, SubmitQuestionResponseRequest, SubmitToolApprovalResponseRequest, agentRunEndpointWithStartIndex, agentRunIdFromHeaders, agentRunStreamStartIndexFromHeaders, agentRunStreamTailIndexFromHeaders, cancelAgentRun, collectAgentEvents, streamAgentEventStream, streamAgentEventStreamUntilTerminal, streamAgentRunEventStream, streamAgentRunEventStreamUntilTerminal, streamAgentRunHitlResponseEventStream, streamAgentRunHitlResponseEventStreamUntilTerminal, streamCloudflareAgentEventStream, streamInputResponseEventStream, streamInteractionResponseEventStream, streamQuestionResponseEventStream, streamToolApprovalResponseEventStream } from "./transport.mjs";
4
- export { type AgentClientState, type AgentHttpResponseInfo, type AgentRunContinuationOptions, type AgentRunIdleReconnectOptions, type AgentRunStatus, type AgentToolRun, type AgentTranscript, AgentTransportError, type ApplyAgentEventOptions, type CancelAgentRunRequest, type StreamAgentEventHandler, type StreamAgentEventsRequest, type StreamAgentEventsUntilTerminalRequest, type StreamAgentRunEventsRequest, type StreamAgentRunEventsUntilTerminalRequest, type StreamAgentRunHitlResponseEventsRequest, type StreamAgentRunHitlResponseEventsUntilTerminalRequest, type StreamCloudflareAgentEventsRequest, type SubmitInputResponseRequest, type SubmitInteractionResponseRequest, type SubmitQuestionResponseRequest, type SubmitToolApprovalResponseRequest, agentRunEndpointWithStartIndex, agentRunIdFromHeaders, agentRunStreamStartIndexFromHeaders, agentRunStreamTailIndexFromHeaders, appendAgentMessage, applyAgentEvent, cancelAgentRun, collectAgentEvents, completedToolRuns, documentPartFromTextFile, initialAgentClientState, isActiveToolRun, markAgentAborted, markAgentError, reduceAgentEvents, streamAgentEventStream, streamAgentEventStreamUntilTerminal, streamAgentRunEventStream, streamAgentRunEventStreamUntilTerminal, streamAgentRunHitlResponseEventStream, streamAgentRunHitlResponseEventStreamUntilTerminal, streamCloudflareAgentEventStream, streamInputResponseEventStream, streamInteractionResponseEventStream, streamQuestionResponseEventStream, streamToolApprovalResponseEventStream, submitAgentUserMessage, textFromBlob, toolRunsFromHitlRequests };
4
+ export { type AgentClientState, type AgentHttpResponseInfo, type AgentRunContinuationOptions, type AgentRunIdleReconnectOptions, type AgentToolRun, type AgentTranscript, AgentTransportError, type ApplyAgentEventOptions, type CancelAgentRunRequest, type StreamAgentEventHandler, type StreamAgentEventsRequest, type StreamAgentEventsUntilTerminalRequest, type StreamAgentRunEventsRequest, type StreamAgentRunEventsUntilTerminalRequest, type StreamAgentRunHitlResponseEventsRequest, type StreamAgentRunHitlResponseEventsUntilTerminalRequest, type StreamCloudflareAgentEventsRequest, type SubmitInputResponseRequest, type SubmitInteractionResponseRequest, type SubmitQuestionResponseRequest, type SubmitToolApprovalResponseRequest, agentRunEndpointWithStartIndex, agentRunIdFromHeaders, agentRunStreamStartIndexFromHeaders, agentRunStreamTailIndexFromHeaders, appendAgentMessage, applyAgentEvent, cancelAgentRun, collectAgentEvents, completedToolRuns, documentPartFromTextFile, initialAgentClientState, isActiveToolRun, markAgentAborted, markAgentError, reduceAgentEvents, streamAgentEventStream, streamAgentEventStreamUntilTerminal, streamAgentRunEventStream, streamAgentRunEventStreamUntilTerminal, streamAgentRunHitlResponseEventStream, streamAgentRunHitlResponseEventStreamUntilTerminal, streamCloudflareAgentEventStream, streamInputResponseEventStream, streamInteractionResponseEventStream, streamQuestionResponseEventStream, streamToolApprovalResponseEventStream, submitAgentUserMessage, textFromBlob, toolRunsFromHitlRequests };
@@ -1,8 +1,7 @@
1
1
  import { Data } from "effect";
2
- import { AgentError, AgentEvent, AgentMessage, AgentRetry, HitlRequest, InputRequest, InputResponse, InteractionRequest, InteractionResponse, QuestionRequest, QuestionResponse, ToolApprovalRequest, ToolCall, ToolResult, UserMessage } from "@yolk-sdk/agent/protocol";
2
+ import { AgentError, AgentEvent, AgentMessage, AgentStatus, AgentStatusTree, HitlRequest, InputRequest, InputResponse, InteractionRequest, InteractionResponse, QuestionRequest, QuestionResponse, ToolApprovalRequest, ToolCall, ToolResult, UserMessage } from "@yolk-sdk/agent/protocol";
3
3
 
4
4
  //#region src/client/state.d.ts
5
- type AgentRunStatus = 'idle' | 'running' | 'waiting' | 'done' | 'error' | 'aborted';
6
5
  type AgentToolRun = {
7
6
  readonly _tag: 'InputStreaming';
8
7
  readonly id: string;
@@ -80,6 +79,26 @@ type AgentToolRun = {
80
79
  readonly result: ToolResult;
81
80
  };
82
81
  declare const AgentToolRun: {
82
+ readonly InputStreaming: Data.TaggedEnum.ConstructorFrom<{
83
+ readonly _tag: "InputStreaming";
84
+ readonly id: string;
85
+ readonly name?: string;
86
+ readonly input: string;
87
+ }, "_tag">;
88
+ readonly InputReady: Data.TaggedEnum.ConstructorFrom<{
89
+ readonly _tag: "InputReady";
90
+ readonly call: ToolCall;
91
+ }, "_tag">;
92
+ readonly ApprovalRequested: Data.TaggedEnum.ConstructorFrom<{
93
+ readonly _tag: "ApprovalRequested";
94
+ readonly call: ToolCall;
95
+ readonly request?: ToolApprovalRequest;
96
+ }, "_tag">;
97
+ readonly Denied: Data.TaggedEnum.ConstructorFrom<{
98
+ readonly _tag: "Denied";
99
+ readonly toolCallId: string;
100
+ readonly reason: string;
101
+ }, "_tag">;
83
102
  readonly QuestionRequested: Data.TaggedEnum.ConstructorFrom<{
84
103
  readonly _tag: "QuestionRequested";
85
104
  readonly request: QuestionRequest;
@@ -122,31 +141,21 @@ declare const AgentToolRun: {
122
141
  readonly response: InteractionResponse;
123
142
  readonly request?: InteractionRequest;
124
143
  }, "_tag">;
125
- readonly InputStreaming: Data.TaggedEnum.ConstructorFrom<{
126
- readonly _tag: "InputStreaming";
127
- readonly id: string;
128
- readonly name?: string;
129
- readonly input: string;
130
- }, "_tag">;
131
- readonly ApprovalRequested: Data.TaggedEnum.ConstructorFrom<{
132
- readonly _tag: "ApprovalRequested";
144
+ readonly Executing: Data.TaggedEnum.ConstructorFrom<{
145
+ readonly _tag: "Executing";
133
146
  readonly call: ToolCall;
134
- readonly request?: ToolApprovalRequest;
135
- }, "_tag">;
136
- readonly Denied: Data.TaggedEnum.ConstructorFrom<{
137
- readonly _tag: "Denied";
138
- readonly toolCallId: string;
139
- readonly reason: string;
147
+ readonly startedAtMs: number; /** Preserve witnessed interaction acceptance across transport interruptions. */
148
+ readonly interaction?: true;
140
149
  }, "_tag">;
141
- readonly Accepted: Data.TaggedEnum.ConstructorFrom<{
142
- readonly _tag: "Accepted";
150
+ readonly Completed: Data.TaggedEnum.ConstructorFrom<{
151
+ readonly _tag: "Completed";
143
152
  readonly call: ToolCall;
144
153
  readonly result: ToolResult;
145
154
  readonly startedAtMs: number;
146
155
  readonly endedAtMs: number;
147
156
  }, "_tag">;
148
- readonly Completed: Data.TaggedEnum.ConstructorFrom<{
149
- readonly _tag: "Completed";
157
+ readonly Accepted: Data.TaggedEnum.ConstructorFrom<{
158
+ readonly _tag: "Accepted";
150
159
  readonly call: ToolCall;
151
160
  readonly result: ToolResult;
152
161
  readonly startedAtMs: number;
@@ -163,17 +172,7 @@ declare const AgentToolRun: {
163
172
  readonly call: ToolCall;
164
173
  readonly result: ToolResult;
165
174
  }, "_tag">;
166
- readonly InputReady: Data.TaggedEnum.ConstructorFrom<{
167
- readonly _tag: "InputReady";
168
- readonly call: ToolCall;
169
- }, "_tag">;
170
- readonly Executing: Data.TaggedEnum.ConstructorFrom<{
171
- readonly _tag: "Executing";
172
- readonly call: ToolCall;
173
- readonly startedAtMs: number; /** Preserve witnessed interaction acceptance across transport interruptions. */
174
- readonly interaction?: true;
175
- }, "_tag">;
176
- readonly $is: <Tag extends "QuestionRequested" | "QuestionAnswered" | "QuestionCancelled" | "InputRequested" | "InputSubmitted" | "InputCancelled" | "InteractionRequested" | "InteractionSubmitted" | "InteractionCancelled" | "InputStreaming" | "ApprovalRequested" | "Denied" | "Accepted" | "Completed" | "Errored" | "ProviderCompleted" | "InputReady" | "Executing">(tag: Tag) => (u: unknown) => u is Extract<{
175
+ readonly $is: <Tag extends "InputStreaming" | "InputReady" | "ApprovalRequested" | "Denied" | "QuestionRequested" | "QuestionAnswered" | "QuestionCancelled" | "InputRequested" | "InputSubmitted" | "InputCancelled" | "InteractionRequested" | "InteractionSubmitted" | "InteractionCancelled" | "Executing" | "Completed" | "Accepted" | "Errored" | "ProviderCompleted">(tag: Tag) => (u: unknown) => u is Extract<{
177
176
  readonly _tag: "InputStreaming";
178
177
  readonly id: string;
179
178
  readonly name?: string;
@@ -287,6 +286,26 @@ declare const AgentToolRun: {
287
286
  }>;
288
287
  readonly $match: {
289
288
  <Cases extends {
289
+ readonly InputStreaming: (args: {
290
+ readonly _tag: "InputStreaming";
291
+ readonly id: string;
292
+ readonly name?: string;
293
+ readonly input: string;
294
+ }) => any;
295
+ readonly InputReady: (args: {
296
+ readonly _tag: "InputReady";
297
+ readonly call: ToolCall;
298
+ }) => any;
299
+ readonly ApprovalRequested: (args: {
300
+ readonly _tag: "ApprovalRequested";
301
+ readonly call: ToolCall;
302
+ readonly request?: ToolApprovalRequest;
303
+ }) => any;
304
+ readonly Denied: (args: {
305
+ readonly _tag: "Denied";
306
+ readonly toolCallId: string;
307
+ readonly reason: string;
308
+ }) => any;
290
309
  readonly QuestionRequested: (args: {
291
310
  readonly _tag: "QuestionRequested";
292
311
  readonly request: QuestionRequest;
@@ -329,31 +348,21 @@ declare const AgentToolRun: {
329
348
  readonly response: InteractionResponse;
330
349
  readonly request?: InteractionRequest;
331
350
  }) => any;
332
- readonly InputStreaming: (args: {
333
- readonly _tag: "InputStreaming";
334
- readonly id: string;
335
- readonly name?: string;
336
- readonly input: string;
337
- }) => any;
338
- readonly ApprovalRequested: (args: {
339
- readonly _tag: "ApprovalRequested";
351
+ readonly Executing: (args: {
352
+ readonly _tag: "Executing";
340
353
  readonly call: ToolCall;
341
- readonly request?: ToolApprovalRequest;
342
- }) => any;
343
- readonly Denied: (args: {
344
- readonly _tag: "Denied";
345
- readonly toolCallId: string;
346
- readonly reason: string;
354
+ readonly startedAtMs: number; /** Preserve witnessed interaction acceptance across transport interruptions. */
355
+ readonly interaction?: true;
347
356
  }) => any;
348
- readonly Accepted: (args: {
349
- readonly _tag: "Accepted";
357
+ readonly Completed: (args: {
358
+ readonly _tag: "Completed";
350
359
  readonly call: ToolCall;
351
360
  readonly result: ToolResult;
352
361
  readonly startedAtMs: number;
353
362
  readonly endedAtMs: number;
354
363
  }) => any;
355
- readonly Completed: (args: {
356
- readonly _tag: "Completed";
364
+ readonly Accepted: (args: {
365
+ readonly _tag: "Accepted";
357
366
  readonly call: ToolCall;
358
367
  readonly result: ToolResult;
359
368
  readonly startedAtMs: number;
@@ -370,18 +379,28 @@ declare const AgentToolRun: {
370
379
  readonly call: ToolCall;
371
380
  readonly result: ToolResult;
372
381
  }) => any;
382
+ }>(cases: Cases): (value: AgentToolRun) => import("effect/Unify").Unify<ReturnType<Cases["InputStreaming" | "InputReady" | "ApprovalRequested" | "Denied" | "QuestionRequested" | "QuestionAnswered" | "QuestionCancelled" | "InputRequested" | "InputSubmitted" | "InputCancelled" | "InteractionRequested" | "InteractionSubmitted" | "InteractionCancelled" | "Executing" | "Completed" | "Accepted" | "Errored" | "ProviderCompleted"]>>;
383
+ <Cases extends {
384
+ readonly InputStreaming: (args: {
385
+ readonly _tag: "InputStreaming";
386
+ readonly id: string;
387
+ readonly name?: string;
388
+ readonly input: string;
389
+ }) => any;
373
390
  readonly InputReady: (args: {
374
391
  readonly _tag: "InputReady";
375
392
  readonly call: ToolCall;
376
393
  }) => any;
377
- readonly Executing: (args: {
378
- readonly _tag: "Executing";
394
+ readonly ApprovalRequested: (args: {
395
+ readonly _tag: "ApprovalRequested";
379
396
  readonly call: ToolCall;
380
- readonly startedAtMs: number; /** Preserve witnessed interaction acceptance across transport interruptions. */
381
- readonly interaction?: true;
397
+ readonly request?: ToolApprovalRequest;
398
+ }) => any;
399
+ readonly Denied: (args: {
400
+ readonly _tag: "Denied";
401
+ readonly toolCallId: string;
402
+ readonly reason: string;
382
403
  }) => any;
383
- }>(cases: Cases): (value: AgentToolRun) => import("effect/Unify").Unify<ReturnType<Cases["QuestionRequested" | "QuestionAnswered" | "QuestionCancelled" | "InputRequested" | "InputSubmitted" | "InputCancelled" | "InteractionRequested" | "InteractionSubmitted" | "InteractionCancelled" | "InputStreaming" | "ApprovalRequested" | "Denied" | "Accepted" | "Completed" | "Errored" | "ProviderCompleted" | "InputReady" | "Executing"]>>;
384
- <Cases extends {
385
404
  readonly QuestionRequested: (args: {
386
405
  readonly _tag: "QuestionRequested";
387
406
  readonly request: QuestionRequest;
@@ -424,31 +443,21 @@ declare const AgentToolRun: {
424
443
  readonly response: InteractionResponse;
425
444
  readonly request?: InteractionRequest;
426
445
  }) => any;
427
- readonly InputStreaming: (args: {
428
- readonly _tag: "InputStreaming";
429
- readonly id: string;
430
- readonly name?: string;
431
- readonly input: string;
432
- }) => any;
433
- readonly ApprovalRequested: (args: {
434
- readonly _tag: "ApprovalRequested";
446
+ readonly Executing: (args: {
447
+ readonly _tag: "Executing";
435
448
  readonly call: ToolCall;
436
- readonly request?: ToolApprovalRequest;
437
- }) => any;
438
- readonly Denied: (args: {
439
- readonly _tag: "Denied";
440
- readonly toolCallId: string;
441
- readonly reason: string;
449
+ readonly startedAtMs: number; /** Preserve witnessed interaction acceptance across transport interruptions. */
450
+ readonly interaction?: true;
442
451
  }) => any;
443
- readonly Accepted: (args: {
444
- readonly _tag: "Accepted";
452
+ readonly Completed: (args: {
453
+ readonly _tag: "Completed";
445
454
  readonly call: ToolCall;
446
455
  readonly result: ToolResult;
447
456
  readonly startedAtMs: number;
448
457
  readonly endedAtMs: number;
449
458
  }) => any;
450
- readonly Completed: (args: {
451
- readonly _tag: "Completed";
459
+ readonly Accepted: (args: {
460
+ readonly _tag: "Accepted";
452
461
  readonly call: ToolCall;
453
462
  readonly result: ToolResult;
454
463
  readonly startedAtMs: number;
@@ -465,29 +474,17 @@ declare const AgentToolRun: {
465
474
  readonly call: ToolCall;
466
475
  readonly result: ToolResult;
467
476
  }) => any;
468
- readonly InputReady: (args: {
469
- readonly _tag: "InputReady";
470
- readonly call: ToolCall;
471
- }) => any;
472
- readonly Executing: (args: {
473
- readonly _tag: "Executing";
474
- readonly call: ToolCall;
475
- readonly startedAtMs: number; /** Preserve witnessed interaction acceptance across transport interruptions. */
476
- readonly interaction?: true;
477
- }) => any;
478
- }>(value: AgentToolRun, cases: Cases): import("effect/Unify").Unify<ReturnType<Cases["QuestionRequested" | "QuestionAnswered" | "QuestionCancelled" | "InputRequested" | "InputSubmitted" | "InputCancelled" | "InteractionRequested" | "InteractionSubmitted" | "InteractionCancelled" | "InputStreaming" | "ApprovalRequested" | "Denied" | "Accepted" | "Completed" | "Errored" | "ProviderCompleted" | "InputReady" | "Executing"]>>;
477
+ }>(value: AgentToolRun, cases: Cases): import("effect/Unify").Unify<ReturnType<Cases["InputStreaming" | "InputReady" | "ApprovalRequested" | "Denied" | "QuestionRequested" | "QuestionAnswered" | "QuestionCancelled" | "InputRequested" | "InputSubmitted" | "InputCancelled" | "InteractionRequested" | "InteractionSubmitted" | "InteractionCancelled" | "Executing" | "Completed" | "Accepted" | "Errored" | "ProviderCompleted"]>>;
479
478
  };
480
479
  };
481
480
  type AgentClientState = {
482
- readonly status: AgentRunStatus;
481
+ /** Run status; failures and pending retries live here (`Failed`, `Working(Retrying)`). */readonly status: AgentStatus;
482
+ readonly subagents: AgentStatusTree['subagents'];
483
483
  readonly messages: ReadonlyArray<AgentMessage>;
484
484
  readonly liveMessages: ReadonlyArray<AgentMessage>;
485
485
  readonly text: string;
486
486
  readonly reasoning: string;
487
487
  readonly toolRuns: ReadonlyArray<AgentToolRun>;
488
- readonly error: string | null;
489
- readonly errorInfo: AgentError | null;
490
- readonly retryInfo: AgentRetry | null;
491
488
  readonly seenEventIds: ReadonlyArray<string>;
492
489
  };
493
490
  type ApplyAgentEventOptions = {
@@ -538,9 +535,11 @@ declare const appendAgentMessage: (messages: ReadonlyArray<AgentMessage>, messag
538
535
  declare const applyAgentEvent: (state: AgentClientState, event: AgentEvent) => AgentClientState;
539
536
  declare const applyAgentEventWithOptions: (state: AgentClientState, event: AgentEvent, options?: ApplyAgentEventOptions) => AgentClientState;
540
537
  declare const submitAgentUserMessage: (state: AgentClientState, message: UserMessage) => AgentClientState;
541
- declare const markAgentError: (state: AgentClientState, message?: string, errorInfo?: AgentError | null) => AgentClientState;
538
+ /** Marks the run `Failed`, e.g. after a transport failure that produced no `AgentError` event. */
539
+ declare const markAgentError: (state: AgentClientState, message?: string, error?: AgentError) => AgentClientState;
540
+ /** The person stopped the run; per OSC 7501 a cancelled run is `Idle`. */
542
541
  declare const markAgentAborted: (state: AgentClientState) => AgentClientState;
543
542
  declare const reduceAgentEvents: (events: ReadonlyArray<AgentEvent>, initialState?: AgentClientState, options?: ApplyAgentEventOptions) => AgentClientState;
544
543
  //#endregion
545
- export { AgentClientState, AgentRunStatus, AgentToolRun, AgentTranscript, ApplyAgentEventOptions, appendAgentMessage, applyAgentEvent, applyAgentEventWithOptions, completedToolRuns, initialAgentClientState, isActiveToolRun, markAgentAborted, markAgentError, reduceAgentEvents, submitAgentUserMessage, toolRunsFromHitlRequests };
544
+ export { AgentClientState, AgentToolRun, AgentTranscript, ApplyAgentEventOptions, appendAgentMessage, applyAgentEvent, applyAgentEventWithOptions, completedToolRuns, initialAgentClientState, isActiveToolRun, markAgentAborted, markAgentError, reduceAgentEvents, submitAgentUserMessage, toolRunsFromHitlRequests };
546
545
  //# sourceMappingURL=state.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"state.d.mts","names":[],"sources":["../../src/client/state.ts"],"mappings":";;;;KAoBY,cAAA;AAAA,KAEA,YAAA;EAAA,SAEG,IAAA;EAAA,SACA,EAAA;EAAA,SACA,IAAA;EAAA,SACA,KAAA;AAAA;EAAA,SAEA,IAAA;EAAA,SAA6B,IAAA,EAAM,QAAA;AAAA;EAAA,SAEnC,IAAA;EAAA,SACA,IAAA,EAAM,QAAA;EAAA,SACN,OAAA,GAAU,mBAAA;AAAA;EAAA,SAEV,IAAA;EAAA,SAAyB,UAAA;EAAA,SAA6B,MAAA;AAAA;EAAA,SACtD,IAAA;EAAA,SAAoC,OAAA,EAAS,eAAA;AAAA;EAAA,SAE7C,IAAA;EAAA,SACA,QAAA,EAAU,gBAAA;EAAA,SACV,OAAA,GAAU,eAAA;AAAA;EAAA,SAGV,IAAA;EAAA,SACA,QAAA,EAAU,gBAAA;EAAA,SACV,OAAA,GAAU,eAAA;AAAA;EAAA,SAEV,IAAA;EAAA,SAAiC,OAAA,EAAS,YAAA;AAAA;EAAA,SAE1C,IAAA;EAAA,SACA,QAAA,EAAU,aAAA;EAAA,SACV,OAAA,GAAU,YAAA;AAAA;EAAA,SAGV,IAAA;EAAA,SACA,QAAA,EAAU,aAAA;EAAA,SACV,OAAA,GAAU,YAAA;AAAA;EAAA,SAEV,IAAA;EAAA,SAAuC,OAAA,EAAS,kBAAA;AAAA;E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