@theokit/agents 13.0.0-next.8 → 13.0.0
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.
- package/CHANGELOG.md +1707 -0
- package/README.md +31 -0
- package/dist/{agent-compiler-C2jIZ4CZ.d.ts → agent-compiler-B0hb6HCo.d.ts} +182 -26
- package/dist/ask.d.ts +1 -0
- package/dist/auth.d.ts +148 -1
- package/dist/auth.js +36 -0
- package/dist/auth.js.map +1 -1
- package/dist/{bridge-entry-BJ86tO6e.d.ts → bridge-entry-DBkqwe6b.d.ts} +72 -6
- package/dist/bridge.d.ts +6 -4
- package/dist/bridge.js +9 -4
- package/dist/{chunk-3GQJ2BHT.js → chunk-G7QBDGZ4.js} +93 -18
- package/dist/chunk-G7QBDGZ4.js.map +1 -0
- package/dist/chunk-HGVT4VCE.js +97 -0
- package/dist/chunk-HGVT4VCE.js.map +1 -0
- package/dist/{chunk-NZTLBLHB.js → chunk-KTQID5V3.js} +560 -342
- package/dist/chunk-KTQID5V3.js.map +1 -0
- package/dist/chunk-M5J3Q6YC.js +17 -0
- package/dist/chunk-M5J3Q6YC.js.map +1 -0
- package/dist/{chunk-RKWCXVYG.js → chunk-MJ6FRILJ.js} +67 -5
- package/dist/chunk-MJ6FRILJ.js.map +1 -0
- package/dist/{chunk-X4IGZHOV.js → chunk-PMMOOXR6.js} +43 -8
- package/dist/chunk-PMMOOXR6.js.map +1 -0
- package/dist/chunk-U72XTMYB.js +7 -0
- package/dist/chunk-U72XTMYB.js.map +1 -0
- package/dist/client-react.d.ts +1 -0
- package/dist/client.d.ts +1 -0
- package/dist/config.d.ts +163 -36
- package/dist/config.js +119 -7
- package/dist/config.js.map +1 -1
- package/dist/{define-agent-WYnUlWaH.d.ts → define-agent-DhwNmdej.d.ts} +28 -153
- package/dist/{delegation-scoring-BrBQXvIp.d.ts → delegation-scoring-BzJEheml.d.ts} +1 -1
- package/dist/hooks.d.ts +0 -32
- package/dist/hooks.js +42 -14
- package/dist/hooks.js.map +1 -1
- package/dist/index.d.ts +191 -17
- package/dist/index.js +43 -5
- package/dist/index.js.map +1 -1
- package/dist/sandbox.js.map +1 -1
- package/dist/setting-sources-gate-DFu51i50.d.ts +278 -0
- package/dist/testing.d.ts +5 -2
- package/dist/testing.js +1 -1
- package/dist/tools.d.ts +4 -2
- package/dist/tools.js +22 -4
- package/dist/tools.js.map +1 -1
- package/dist/usage.d.ts +30 -0
- package/dist/usage.js +3 -0
- package/dist/usage.js.map +1 -1
- package/package.json +3 -3
- package/dist/chunk-3GQJ2BHT.js.map +0 -1
- package/dist/chunk-NZTLBLHB.js.map +0 -1
- package/dist/chunk-RKWCXVYG.js.map +0 -1
- package/dist/chunk-X4IGZHOV.js.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,20 +1,22 @@
|
|
|
1
1
|
import { PluginsSettings, Plugin, ProviderRoutingSettings, AgentDefinition, BudgetTracker, CustomTool, GoalLoopAgent, GoalOptions, runGoalLoop, GoalEvent, GoalResult, InlineSkill, Agent as Agent$1, ListAgentsOptions, ListResult, SDKAgentInfo } from '@theokit/sdk';
|
|
2
|
-
export { CustomTool, DiagnosticsSink, GenerateObjectError, GoalEvent, GoalLoopAgent, GoalOptions, GoalResult, JudgeCredentialError, JudgeResult, LayerOrderError, McpAuthConfig, McpHttpServerConfig, McpOAuthConfig, McpServerConfig, McpStdioServerConfig, Provider, RunEvent, SDKAgent, SessionRecord, Squad, StreamObjectError, Tool, ToolError, ToolResultContentBlock, TrustLevel, TrustPosture, TrustPostureInput, TrustSource, UngatedCapabilityError, Verdict, WiredEntity, applySecurityFloor, auditEnvReachability, foldLayers, recordWiring, resolveTrustPosture, setDiagnosticsSink, verifyLayerOrdering } from '@theokit/sdk';
|
|
2
|
+
export { BudgetTracker, CustomTool, DiagnosticsSink, GenerateObjectError, GoalEvent, GoalLoopAgent, GoalOptions, GoalResult, InlineSkill, JudgeCredentialError, JudgeResult, LayerOrderError, McpAuthConfig, McpHttpServerConfig, McpOAuthConfig, McpServerConfig, McpStdioServerConfig, Plugin, PluginsSettings, Provider, ProviderRoutingSettings, RunEvent, SDKAgent, SessionRecord, SessionStore, Squad, StreamObjectError, Tool, ToolError, ToolResultContentBlock, TrustLevel, TrustPosture, TrustPostureInput, TrustSource, UngatedCapabilityError, Verdict, WiredEntity, applySecurityFloor, auditEnvReachability, foldLayers, recordWiring, resolveTrustPosture, setDiagnosticsSink, verifyLayerOrdering } from '@theokit/sdk';
|
|
3
3
|
import { b as MainLoopMeta, R as ReasoningEffort, T as ToolOptions, A as ApprovalOptions, H as HumanInTheLoopOptions } from './types-C16Wuh9E.js';
|
|
4
4
|
export { c as AgentOptions, B as BudgetOptions, d as MainLoopOptions, M as McpServersMap, e as PolicyHandler, f as TimeoutAction, g as ToolboxOptions } from './types-C16Wuh9E.js';
|
|
5
|
-
import { C as ContextWindowOptions, S as SkillsOptions, A as AgentManifestEntry, H as HitlDecision, s as streamAgentUIMessages, a as ApprovalPosture, b as AgentModule } from './bridge-entry-
|
|
6
|
-
export { c as APPROVAL_MODES, d as AfterToolCallContext, e as AgentBuilder, f as AgentDefinitionError, g as AgentExecutionContext, h as AgentManifest, i as AgentManifestSource, j as AgentManifestTool, k as AgentRoute, l as AgentRouteContext, m as AgentRunInfo, n as AgentsPluginOptions, o as ApiErrorContext, p as ApiErrorDecision, q as ApiErrorPolicy, r as ApprovalMode, t as ApprovalRequest, B as BeforeToolCallContext, u as CompiledContextWindow, v as ContextualTool, D as DefinitionOrThunk, w as DelegationTimeoutError, E as EphemeralAgent, L as LLMCallContext, M as McpApprovalSpec, x as McpFileError, y as McpRegistryConfig, z as McpRequestContext, F as McpSelection, P as ProcessInputContext, G as SdkAgentHandle, I as SdkMessage, J as SdkSendOptions, K as SdkTurnHandle, N as Segment, O as ShouldAutoApproveOptions, T as ToolCallVeto, Q as ToolHooks,
|
|
5
|
+
import { C as ContextWindowOptions, S as SkillsOptions, A as AgentManifestEntry, H as HitlDecision, s as streamAgentUIMessages, a as ApprovalPosture, b as AgentModule } from './bridge-entry-DBkqwe6b.js';
|
|
6
|
+
export { c as APPROVAL_MODES, d as AfterToolCallContext, e as AgentBuilder, f as AgentDefinitionError, g as AgentExecutionContext, h as AgentManifest, i as AgentManifestSource, j as AgentManifestTool, k as AgentRoute, l as AgentRouteContext, m as AgentRunInfo, n as AgentsPluginOptions, o as ApiErrorContext, p as ApiErrorDecision, q as ApiErrorPolicy, r as ApprovalMode, t as ApprovalRequest, B as BeforeToolCallContext, u as CompiledContextWindow, v as ContextualTool, D as DefinitionOrThunk, w as DelegationTimeoutError, E as EphemeralAgent, L as LLMCallContext, M as McpApprovalSpec, x as McpFileError, y as McpRegistryConfig, z as McpRequestContext, F as McpSelection, P as ProcessInputContext, R as RuntimeOverrides, G as SdkAgentHandle, I as SdkMessage, J as SdkSendOptions, K as SdkTurnHandle, N as Segment, O as ShouldAutoApproveOptions, T as ToolCallVeto, Q as ToolHooks, U as ToolHooksPlugin, W as WRITE_SCOPED_TOOLS, V as agentsPlugin, X as applyPosture, Y as buildModelSelection, Z as compileAgentModule, _ as compileContextWindow, $ as compileLoadedAgentModule, a0 as compileProjectContext, a1 as compileSkills, a2 as createAgentExecutionContext, a3 as createApiErrorHandler, a4 as createSdkAgentStream, a5 as createThinkTagExtractor, a6 as createToolHooksPlugin, a7 as extractThinkTagStream, a8 as generateAgentManifest, a9 as generateAgentRoutes, aa as isAgentContext, ab as loadMcpJson, ac as mcpRegistry, ad as mcpToolApprovals, ae as projectContextMetadataOnlyKnobs, af as reasoningEffortOf, ag as resolveMcpServers, ah as runWithApiErrorHandling, ai as shouldAutoApprove, aj as toAgentFactory, ak as translateSdkEvent, al as withClockCap, am as withEphemeralAgent } from './bridge-entry-DBkqwe6b.js';
|
|
7
7
|
import { TheokitAgentError } from '@theokit/sdk/errors';
|
|
8
8
|
export * from '@theokit/sdk/errors';
|
|
9
9
|
export { ConfigurationError, BudgetExceededError as WindowBudgetExceededError } from '@theokit/sdk/errors';
|
|
10
|
-
import { G as Guardrail,
|
|
11
|
-
export {
|
|
12
|
-
import { S as SettingSourcesSelection } from './
|
|
13
|
-
export {
|
|
14
|
-
import { L as LoopStrategy, R as ReflectionStrategy, b as RoundStreamFactory, S as StreamEvent, c as DelegationResult } from './delegation-scoring-
|
|
15
|
-
export { A as AgentStopReason, d as AgentStreamEvent, e as AgentTurnMetadata, f as ApprovalRequiredEvent, g as ArtifactChunkEvent, h as ArtifactStartEvent, B as BackgroundDelegation, i as BudgetExceededError, C as CheckpointSavedEvent, j as DEFAULT_MAX_ITERATIONS, k as DelegateFn, a as DelegateOptions, l as DelegationBudgetExceededError, m as DelegationError, n as DelegationPort, D as DelegationTarget, o as DoneEvent, E as ErrorEvent, F as FileEditEvent, I as IterationEvent, p as LoopFinishReason, q as LoopOutcome, r as LoopStrategyConfig, P as PartialToolCallEvent, s as ReflectionContext, t as ReflectionResult, u as ReflectionStrategyConfig, v as RunStartedEvent, w as ScoreVerdict, x as ScoredDelegation, y as Scorer, z as StateUpdateEvent, T as TextDeltaEvent, G as ThinkingEvent, H as ToolCallEvent, J as ToolResultEvent, K as delegate, M as delegateBackground, N as delegateWithScoring, O as isApprovalRequired, Q as isDone, U as isError, V as isPartialToolCall, W as isTextDelta, X as isToolCall, Y as isToolResult, Z as ladderReflectionStrategy, _ as loopStrategyConfigSchema, $ as noopReflectionStrategy, a0 as presentUIMessageStream, a1 as reflectionStrategyConfigSchema, a2 as resolveLoopStrategy, a3 as streamAgentResponse } from './delegation-scoring-
|
|
10
|
+
import { G as Guardrail, a as CompiledAgentOptions, b as CompiledTool } from './agent-compiler-B0hb6HCo.js';
|
|
11
|
+
export { c as CompatImportUnsupportedError, d as CostBudgetExceededError, e as GuardrailAction, f as GuardrailError, g as GuardrailPhase, h as GuardrailResult, i as GuardrailViolationError, H as HookApprovalGate, j as HookApprovalRequest, k as HookGateUnsupportedError, M as MalformedGuardrailResultError, l as SkillsRequestContext, S as SkillsSelection, T as ToolWalkResult, m as ToolboxWalkResult, U as UnreadableTextPayloadError, n as compileTools, r as resolveEnabledSkills } from './agent-compiler-B0hb6HCo.js';
|
|
12
|
+
import { S as SettingSourcesSelection } from './setting-sources-gate-DFu51i50.js';
|
|
13
|
+
export { C as CompatSurface, a as GatedCompatSource, G as GatedSettingSource, P as ProjectSettingsGrant, R as ResolvedCompatSource, b as SettingSourceCapability, U as UntrustedSettingSourceError, r as resolveCompatSources, c as resolveSettingSources } from './setting-sources-gate-DFu51i50.js';
|
|
14
|
+
import { L as LoopStrategy, R as ReflectionStrategy, b as RoundStreamFactory, S as StreamEvent, c as DelegationResult } from './delegation-scoring-BzJEheml.js';
|
|
15
|
+
export { A as AgentStopReason, d as AgentStreamEvent, e as AgentTurnMetadata, f as ApprovalRequiredEvent, g as ArtifactChunkEvent, h as ArtifactStartEvent, B as BackgroundDelegation, i as BudgetExceededError, C as CheckpointSavedEvent, j as DEFAULT_MAX_ITERATIONS, k as DelegateFn, a as DelegateOptions, l as DelegationBudgetExceededError, m as DelegationError, n as DelegationPort, D as DelegationTarget, o as DoneEvent, E as ErrorEvent, F as FileEditEvent, I as IterationEvent, p as LoopFinishReason, q as LoopOutcome, r as LoopStrategyConfig, P as PartialToolCallEvent, s as ReflectionContext, t as ReflectionResult, u as ReflectionStrategyConfig, v as RunStartedEvent, w as ScoreVerdict, x as ScoredDelegation, y as Scorer, z as StateUpdateEvent, T as TextDeltaEvent, G as ThinkingEvent, H as ToolCallEvent, J as ToolResultEvent, K as delegate, M as delegateBackground, N as delegateWithScoring, O as isApprovalRequired, Q as isDone, U as isError, V as isPartialToolCall, W as isTextDelta, X as isToolCall, Y as isToolResult, Z as ladderReflectionStrategy, _ as loopStrategyConfigSchema, $ as noopReflectionStrategy, a0 as presentUIMessageStream, a1 as reflectionStrategyConfigSchema, a2 as resolveLoopStrategy, a3 as streamAgentResponse } from './delegation-scoring-BzJEheml.js';
|
|
16
|
+
export { a as AGENT_BRAND, A as AgentDefinition, D as DefineAgentConfig, I as InferAgentInput, b as InferAgentToolNames, c as compileAgentDefinition, i as isAgentDefinition } from './define-agent-DhwNmdej.js';
|
|
16
17
|
import { RetryOptions } from '@theokit/sdk/retry';
|
|
17
18
|
export * from '@theokit/sdk/retry';
|
|
19
|
+
export { RetryOptions } from '@theokit/sdk/retry';
|
|
18
20
|
import { CompressibleMessage } from '@theokit/sdk/compaction';
|
|
19
21
|
export { CONTEXT_WINDOW_FLOOR, CONTEXT_WINDOW_MARGIN, CompressibleMessage, ContextWindowMarginError, ContextWindowSource, EffectiveContextWindow, resolveEffectiveContextWindow } from '@theokit/sdk/compaction';
|
|
20
22
|
import { z } from 'zod';
|
|
@@ -24,7 +26,7 @@ export * from '@theokit/sdk/concurrency';
|
|
|
24
26
|
export * from '@theokit/sdk/messages';
|
|
25
27
|
export * from '@theokit/sdk/models';
|
|
26
28
|
import { DiscoverSubagentsOptions } from '@theokit/sdk/subagents-loader';
|
|
27
|
-
export { AgentDefinition as SubagentDefinition, discoverSubagents, loadSubagentDefinition } from '@theokit/sdk/subagents-loader';
|
|
29
|
+
export { DiscoverSubagentsOptions, AgentDefinition as SubagentDefinition, discoverSubagents, loadSubagentDefinition } from '@theokit/sdk/subagents-loader';
|
|
28
30
|
export { H as HookHandlers } from './hook-handlers-Cw2FsnE5.js';
|
|
29
31
|
import { WireChunk } from '@theokit/presenter/wire';
|
|
30
32
|
export { WireChunk, WireDataPart } from '@theokit/presenter/wire';
|
|
@@ -81,19 +83,22 @@ declare function outputModeration(options: OutputModerationOptions): Guardrail;
|
|
|
81
83
|
/**
|
|
82
84
|
* M9 (theokit-ai-first) — the guardrail pipeline: apply guards in order at a boundary phase.
|
|
83
85
|
*
|
|
84
|
-
* Fail-fast (error-handling.md): a `block` throws {@link GuardrailViolationError} immediately
|
|
85
|
-
*
|
|
86
|
-
*
|
|
86
|
+
* Fail-fast (error-handling.md): a `block` throws {@link GuardrailViolationError} immediately, and a
|
|
87
|
+
* `redact` with no replacement throws {@link MalformedGuardrailResultError} — B-008, where that case
|
|
88
|
+
* used to pass the original text through in silence. A well-formed `redact` threads its replacement
|
|
89
|
+
* into the next guard. Independent of the SDK runtime — this runs at the framework boundary.
|
|
87
90
|
*/
|
|
88
91
|
|
|
89
92
|
/**
|
|
90
93
|
* Run every guard's `checkInput` in order against `text`. Returns the (possibly redacted) text.
|
|
91
|
-
* Throws
|
|
94
|
+
* Throws on the first `block`, or on a `redact` that supplies no replacement. Guards without
|
|
95
|
+
* `checkInput` are skipped.
|
|
92
96
|
*/
|
|
93
97
|
declare function runInputGuards(text: string, guards: readonly Guardrail[]): Promise<string>;
|
|
94
98
|
/**
|
|
95
99
|
* Run every guard's `checkOutput` in order against `text`. Returns the (possibly redacted) text.
|
|
96
|
-
* Throws
|
|
100
|
+
* Throws on the first `block`, or on a `redact` that supplies no replacement. Guards without
|
|
101
|
+
* `checkOutput` are skipped.
|
|
97
102
|
*/
|
|
98
103
|
declare function runOutputGuards(text: string, guards: readonly Guardrail[]): Promise<string>;
|
|
99
104
|
|
|
@@ -103,8 +108,104 @@ declare function runOutputGuards(text: string, guards: readonly Guardrail[]): Pr
|
|
|
103
108
|
* @param inner the source stream (yields events, returns a result).
|
|
104
109
|
* @param guards the guardrails; only those with `checkOutput` participate.
|
|
105
110
|
* @param extractText pulls the human-visible text out of an event (return `undefined` for non-text).
|
|
111
|
+
* @param rebuildText builds ONE event carrying the moderated text, GIVEN the text-carrying event it
|
|
112
|
+
* replaces. Required, not optional (B-012): optional would let this function
|
|
113
|
+
* compute a redaction it cannot apply, which is the defect it was added to remove.
|
|
114
|
+
*
|
|
115
|
+
* **`extractText` MUST match exactly one event kind.** This is the parameter's
|
|
116
|
+
* real contract and it is a constraint, not a convenience.
|
|
117
|
+
*
|
|
118
|
+
* When it matches several, they COLLAPSE INTO ONE. Measured against the built
|
|
119
|
+
* artifact: `[thinking('CoT: the key is sk-abc'), message(' Here you go.')]`
|
|
120
|
+
* yields a single `message` reading `"CoT: the key is [R] Here you go."` — the
|
|
121
|
+
* model's private reasoning inside a visible event, and no `thinking` event
|
|
122
|
+
* survives. Reverse the order and the visible answer is swallowed into a
|
|
123
|
+
* `thinking` event instead.
|
|
124
|
+
*
|
|
125
|
+
* `replaced` does NOT prevent that, and an earlier version of this docblock, of
|
|
126
|
+
* the changeset and of a test comment all said it did. What it buys is narrower
|
|
127
|
+
* and worth having: the surviving event keeps the KIND and the metadata of the
|
|
128
|
+
* text-carrying event it replaces, instead of being rebuilt from the text alone.
|
|
129
|
+
* Without it, `[thinking, message]` collapsed into whatever kind `rebuildText`
|
|
130
|
+
* hard-coded; with it, the caller chooses. The collapse itself is unchanged.
|
|
131
|
+
*
|
|
132
|
+
* So a consumer who wants reasoning moderated must run a SECOND
|
|
133
|
+
* `moderateOutputStream` over that kind, not widen one `extractText` to cover
|
|
134
|
+
* both.
|
|
135
|
+
*
|
|
136
|
+
* `replaced` is ALWAYS an event, and used to be typed `E | undefined` for a case
|
|
137
|
+
* that cannot happen. The absence check below returns before `runOutputGuards` is
|
|
138
|
+
* ever called when no event carried text, so by the time `rebuildText` runs there
|
|
139
|
+
* is always a text-carrying event to replace. Proof, from the accumulation loop:
|
|
140
|
+
* `accumulated` grows only inside `if (text !== undefined)`, and `textAt` records
|
|
141
|
+
* that same predicate — so `!textAt.includes(true)` implies `accumulated === ''`,
|
|
142
|
+
* the absence check fires, and everything after it has `textAt.includes(true)`.
|
|
143
|
+
* The package's own test already pinned the opposite of the old wording
|
|
144
|
+
* (`rebuildText is never called for a channel that is not there`), and three
|
|
145
|
+
* shipping artifacts described the unreachable case as a live one.
|
|
146
|
+
*
|
|
147
|
+
* Note the boundary that IS real — an event whose extracted text is the EMPTY
|
|
148
|
+
* STRING is still text-carrying, and can be the one replaced. For
|
|
149
|
+
* `[text('secret'), text('')]` the moderated string lands on the trailing empty
|
|
150
|
+
* delta, so a `{ ...replaced }` caller inherits the terminator's metadata rather
|
|
151
|
+
* than the content-bearing event's.
|
|
152
|
+
* @param rebuildResult applies the moderated text to the generator's RETURN value.
|
|
153
|
+
*
|
|
154
|
+
* A stream has two channels and this function moderated one of them for a
|
|
155
|
+
* release. The events were redacted; `step.value` — the aggregate a caller
|
|
156
|
+
* reads from `run()`, or from the generator's return — was accumulated
|
|
157
|
+
* upstream from the PRE-moderation events and carried the original text.
|
|
158
|
+
* Measured against the built artifact: the guard computed `"the key is [R]"`
|
|
159
|
+
* and `run().response` was `"the key is sk-abc123"`.
|
|
160
|
+
*
|
|
161
|
+
* That is this function's own defect, verbatim, one channel over: the
|
|
162
|
+
* redaction was computed and not applied. Required for the same reason
|
|
163
|
+
* `rebuildText` is — optional would restore it under a nicer name — and
|
|
164
|
+
* passed rather than re-derived, because re-running `runOutputGuards` on the
|
|
165
|
+
* aggregate would apply a non-idempotent guard twice (a disclaimer appender
|
|
166
|
+
* would append two disclaimers).
|
|
167
|
+
*
|
|
168
|
+
* Return `result` unchanged when it carries no moderated text. That is
|
|
169
|
+
* correct and not a no-op only in that case; when it DOES carry the text,
|
|
170
|
+
* returning it unchanged drops the redaction, and no type can tell the two
|
|
171
|
+
* apart.
|
|
172
|
+
*
|
|
106
173
|
*/
|
|
107
|
-
declare function moderateOutputStream<E, R>(inner: AsyncGenerator<E, R>, guards: readonly Guardrail[], extractText: (event: E) => string | undefined): AsyncGenerator<E, R>;
|
|
174
|
+
declare function moderateOutputStream<E, R>(inner: AsyncGenerator<E, R>, guards: readonly Guardrail[], extractText: (event: E) => string | undefined, rebuildText: (text: string, replaced: E) => E, rebuildResult: (text: string, result: R) => R): AsyncGenerator<E, R>;
|
|
175
|
+
/**
|
|
176
|
+
* The `extractText` for an event kind that announces itself as text — one implementation, used by
|
|
177
|
+
* every seam that moderates a stream.
|
|
178
|
+
*
|
|
179
|
+
* B-021 existed because there were two hand-written copies of `typeof e.content === 'string'`, in
|
|
180
|
+
* `AgentRunner.stream()` and in the served endpoint, and both returned `undefined` for a non-string.
|
|
181
|
+
* `moderateOutputStream` reads `undefined` as "this event carries no text", so the payload was never
|
|
182
|
+
* accumulated, never shown to a guard, and yielded verbatim — the DELIVER direction, with a guard
|
|
183
|
+
* declared to stop exactly that.
|
|
184
|
+
*
|
|
185
|
+
* Two different questions were collapsed into one answer:
|
|
186
|
+
*
|
|
187
|
+
* | The event | What the extractor must say |
|
|
188
|
+
* |---|---|
|
|
189
|
+
* | another kind entirely | `undefined` — not this channel |
|
|
190
|
+
* | this kind, content readable | the text |
|
|
191
|
+
* | this kind, content unreadable | **throw** — a guard cannot examine it |
|
|
192
|
+
*
|
|
193
|
+
* The third row is the one that was missing, and it cannot be expressed by a return value that also
|
|
194
|
+
* means "not this kind". Refused rather than coerced: coercing would moderate `"[object Object]"`,
|
|
195
|
+
* consulting a guard about a string the model never produced while the real payload rides along
|
|
196
|
+
* underneath.
|
|
197
|
+
*
|
|
198
|
+
* Reachable in practice rather than in theory — `StreamEvent` is `{ type: string; [key: string]:
|
|
199
|
+
* unknown }`, `event-translator.ts` casts an unvalidated provider content block to `{ text?: string
|
|
200
|
+
* }`, and a consumer-supplied `streamFactory` is a public option.
|
|
201
|
+
*
|
|
202
|
+
* Only consulted when a guard defines `checkOutput`: {@link moderateOutputStream} is a transparent
|
|
203
|
+
* pass-through otherwise, so an agent that declared no guard never meets this error however
|
|
204
|
+
* malformed the stream is.
|
|
205
|
+
*/
|
|
206
|
+
declare function textPayloadExtractor<E extends {
|
|
207
|
+
type?: unknown;
|
|
208
|
+
}>(kind: string, read: (event: E) => unknown): (event: E) => string | undefined;
|
|
108
209
|
|
|
109
210
|
/**
|
|
110
211
|
* TranscriptCompactionStrategy — a named, callable transcript-compaction authoring layer
|
|
@@ -691,6 +792,24 @@ declare class GuardrailsCapability extends FieldCapability<'guardrails'> {
|
|
|
691
792
|
* `'filesystem'` selects the SDK's durable store, so any other storage cannot resume across
|
|
692
793
|
* requests. The warning moves WITH the feature — a declared checkpoint that silently cannot resume
|
|
693
794
|
* is exactly the kind of no-op this project refuses to ship.
|
|
795
|
+
*
|
|
796
|
+
* ## This is RUN-STATE checkpointing. It is not file undo, and the name is shared (B-059)
|
|
797
|
+
*
|
|
798
|
+
* What this saves is the conversation: enough to RESUME a run. It does not snapshot the files an
|
|
799
|
+
* agent edited and cannot restore one.
|
|
800
|
+
*
|
|
801
|
+
* The distinction is written here because the word is the whole problem. Measured 2026-09-11:
|
|
802
|
+
* `rewindFiles`, `rewind_files`, `restoreFile` and `backup` return 0 files in this package, 0 in the
|
|
803
|
+
* SDK's `.d.ts` and 0 in `@theokit/sdk-tools`, while `checkpoint` returns six — all of them this
|
|
804
|
+
* subject. **Any parity checklist that greps for `checkpoint` is satisfied by the wrong one**, and
|
|
805
|
+
* reports a capability that does not exist.
|
|
806
|
+
*
|
|
807
|
+
* So a consumer building an interactive coding agent implements snapshot and restore themselves.
|
|
808
|
+
* There is no pre-write seam on the edit tools to hang it on either, which is the part that makes it
|
|
809
|
+
* a feature rather than a wiring job — and the reason it is stated here instead of half-built.
|
|
810
|
+
*
|
|
811
|
+
* Pinned by `tests/unit/run-state-checkpointing-is-not-file-undo.test.ts`, which goes red if a file
|
|
812
|
+
* surface ever appears — at which point this section should go with it.
|
|
694
813
|
*/
|
|
695
814
|
declare class CheckpointCapability implements Capability {
|
|
696
815
|
private readonly options;
|
|
@@ -712,6 +831,25 @@ declare class HumanInTheLoopCapability extends FieldCapability<'hitl'> {
|
|
|
712
831
|
* draft (`createDraft` gives it `{}`), so a `setOnce` would conflict against the seed itself — the
|
|
713
832
|
* same trap the pre-seeded `stream` sprang in M52. Merging also lets a preset declare a baseline
|
|
714
833
|
* child set that a call site extends.
|
|
834
|
+
*
|
|
835
|
+
* ## How far this reaches
|
|
836
|
+
*
|
|
837
|
+
* **What it populates IS projected into `Agent.create`.** `assembleM8CreateOptions` forwards
|
|
838
|
+
* `compiled.agents` to `Agent.create({ agents })`, so declaring a sub-agent through this capability
|
|
839
|
+
* spawns one.
|
|
840
|
+
*
|
|
841
|
+
* That was not true until B-034. `M8CreateOptions` had no `agents` field, `agent-compiler.ts`
|
|
842
|
+
* recorded the gap as ADR D3 — "a resolver here is carried, not invoked" — and declaring a sub-agent
|
|
843
|
+
* through this capability compiled cleanly and spawned nothing, while the class crossed the public
|
|
844
|
+
* barrel alongside `SubagentDefinition`, `discoverSubagents`, `loadSubagentDefinition` and
|
|
845
|
+
* `listSubagentNames`. A consumer read the barrel, assembled the authoring chain and met silence:
|
|
846
|
+
* the "the type crossed, the capability did not" shape `bridge/index.ts` names four times by issue
|
|
847
|
+
* number. The deferral was a decision; the consumer discovering it at runtime was not.
|
|
848
|
+
*
|
|
849
|
+
* The children are SDK `AgentDefinition`s (`SubagentDefinition` on the barrel), the same shape the
|
|
850
|
+
* per-run door `RuntimeOverrides.agents` always took. A per-run value still WINS over this one —
|
|
851
|
+
* `sdk-adapter.ts` spreads `...m8, ...extra`, and a per-run override that lost to a compile-time
|
|
852
|
+
* value would be the opposite of what "override" promises.
|
|
715
853
|
*/
|
|
716
854
|
declare class SubAgentsCapability implements Capability {
|
|
717
855
|
private readonly children;
|
|
@@ -755,6 +893,42 @@ declare class HookApprovalCapability extends FieldCapability<'hookApproval'> {
|
|
|
755
893
|
readonly name = "hook-approval";
|
|
756
894
|
protected readonly field: "hookApproval";
|
|
757
895
|
}
|
|
896
|
+
/**
|
|
897
|
+
* B-060 — `sessionStore`, the store the SDK resumes from.
|
|
898
|
+
*
|
|
899
|
+
* A `FieldCapability` like its neighbours: one field, set once. There is nothing to merge — two
|
|
900
|
+
* declared stores is a contradiction about where history lives, not a composition.
|
|
901
|
+
*/
|
|
902
|
+
declare class SessionStoreCapability extends FieldCapability<'sessionStore'> {
|
|
903
|
+
readonly name = "session-store";
|
|
904
|
+
protected readonly field: "sessionStore";
|
|
905
|
+
}
|
|
906
|
+
/**
|
|
907
|
+
* B-056 — `canUseTool`, the seam that sees an `ask` verdict.
|
|
908
|
+
*
|
|
909
|
+
* A `FieldCapability`: one gate, set once. Two gates would be two answers to one question, and
|
|
910
|
+
* composing them would mean inventing a precedence nobody declared.
|
|
911
|
+
*/
|
|
912
|
+
declare class CanUseToolCapability extends FieldCapability<'canUseTool'> {
|
|
913
|
+
readonly name = "can-use-tool";
|
|
914
|
+
protected readonly field: "canUseTool";
|
|
915
|
+
}
|
|
916
|
+
/**
|
|
917
|
+
* B-072 — OpenTelemetry settings, the door onto a tracer the SDK already runs.
|
|
918
|
+
*
|
|
919
|
+
* A `FieldCapability` because telemetry is one setting block set once: two of them would be two
|
|
920
|
+
* answers to "which service name do these spans carry", and composing them would mean inventing a
|
|
921
|
+
* precedence nobody declared — the same reasoning `CanUseToolCapability` records above.
|
|
922
|
+
*
|
|
923
|
+
* It exists because the waist gained `telemetry` and `capability-zero-behavior.test.ts` refuses to
|
|
924
|
+
* compile while a waist field has no capability expressing it. That gate is the reason this is a
|
|
925
|
+
* whole door rather than half of one: the projection alone would have let `defineAgent` reach the
|
|
926
|
+
* SDK while the capability path could not, and the two paths are asserted deep-equal.
|
|
927
|
+
*/
|
|
928
|
+
declare class TelemetryCapability extends FieldCapability<'telemetry'> {
|
|
929
|
+
readonly name = "telemetry";
|
|
930
|
+
protected readonly field: "telemetry";
|
|
931
|
+
}
|
|
758
932
|
declare class PluginsCapability extends FieldCapability<'plugins'> {
|
|
759
933
|
readonly name = "plugins";
|
|
760
934
|
protected readonly field: "plugins";
|
|
@@ -1376,4 +1550,4 @@ type AgentWithNarrowedList = Omit<typeof Agent$1, 'list'> & {
|
|
|
1376
1550
|
type AgentWithNarrowedListAlias = AgentWithNarrowedList;
|
|
1377
1551
|
declare const Agent: AgentWithNarrowedList;
|
|
1378
1552
|
|
|
1379
|
-
export { type A2AAuth, type A2ACapabilities, type A2ASkill, type A2AToolConfig, AcpClient, AcpMessageDecoder, type AcpTransport, Agent, type AgentCard, type AgentConfig, AgentConfigCapability, AgentManifestEntry, AgentModule, AgentRunner, AgentRunnerBuilder, type AgentRunnerRunOptions, type AgentShape, type AgentWithNarrowedListAlias, ApprovalOptions, ApprovalPosture, type BuildAgentCardOptions, type Capability, CapabilityConflictError, CapabilityPreset, CapabilityRegistry, CheckpointCapability, type CompactionCallOptions, type CompactionStrategyConfig, CompiledAgentOptions, type CompiledAgentOptionsDraft, CompiledTool, ContextWindowCapability, type CostGuardOptions, DEFAULT_KEEP_TOKENS, DelegationResult, FieldCapability, type FinalizedDraft, GoalRunner, type GoalRunnerDeps, Guardrail, GuardrailsCapability, HitlDecision, HookApprovalCapability, HumanInTheLoopCapability, HumanInTheLoopOptions, type InProcessApprovalRequest, InProcessApprovalRequiredError, type InProcessAwaitApproval, type ListOptionsWithoutPaginationAlias, LoopStrategy, MCP_PROTOCOL_VERSION, MainLoopCapability, MainLoopMeta, type McpJsonSchema, type McpServerInfo, McpServersCapability, type McpToolDescriptor, MemoryCapability, ModelCapability, type NamedTool, type OutputModerationOptions, type PiiOptions, PluginsCapability, ProjectContextCapability, type PromptInjectionOptions, type ProvenanceEntry, ReasoningEffort, ReflectionStrategy, RoundStreamFactory, RunContextCapability, SettingSourcesCapability, SettingSourcesSelection, SkillsCapability, SkillsOptionsCapability, SkillsResolverCapability, type StreamAgentTurnDeps, type StreamAgentTurnInProcessInput, StreamEvent, SubAgentsCapability, type Summarize, type ToolComNome, type ToolDeclaration, ToolOptions, ToolboxCapability, type ToolboxSource, ToolsCapability, Toolset, ToolsetError, type TranscriptCompactionStrategy, UnknownCapabilityError, applyCapabilities, buildAgentCard, buildMcpToolDescriptors, compactionStrategyConfigSchema, costGuard, createA2ATool, createDraft, declareAgentShape, deriveConversationId, encodeAcpMessage, estimateTokens, formatGoalEvent, listSubagentNames, mcpServerInfo, moderateOutputStream, outputModeration, parseConversationId, piiDetector, promptInjectionDetector, resolveCompactionStrategy, runInputGuards, runOutputGuards, setOnce, streamAgentTurnInProcess, streamAgentUIMessages, tokenBudgetCompactionStrategy, unicodeNormalizer, wellKnownCardPath };
|
|
1553
|
+
export { type A2AAuth, type A2ACapabilities, type A2ASkill, type A2AToolConfig, AcpClient, AcpMessageDecoder, type AcpTransport, Agent, type AgentCard, type AgentConfig, AgentConfigCapability, AgentManifestEntry, AgentModule, AgentRunner, AgentRunnerBuilder, type AgentRunnerRunOptions, type AgentShape, type AgentWithNarrowedListAlias, ApprovalOptions, ApprovalPosture, type BuildAgentCardOptions, CanUseToolCapability, type Capability, CapabilityConflictError, CapabilityPreset, CapabilityRegistry, CheckpointCapability, type CompactionCallOptions, type CompactionStrategyConfig, CompiledAgentOptions, type CompiledAgentOptionsDraft, CompiledTool, ContextWindowCapability, ContextWindowOptions, type CostGuardOptions, DEFAULT_KEEP_TOKENS, DelegationResult, FieldCapability, type FinalizedDraft, GoalRunner, type GoalRunnerDeps, Guardrail, GuardrailsCapability, HitlDecision, HookApprovalCapability, HumanInTheLoopCapability, HumanInTheLoopOptions, type InProcessApprovalRequest, InProcessApprovalRequiredError, type InProcessAwaitApproval, type ListOptionsWithoutPaginationAlias, LoopStrategy, MCP_PROTOCOL_VERSION, MainLoopCapability, MainLoopMeta, type McpJsonSchema, type McpServerInfo, McpServersCapability, type McpToolDescriptor, MemoryCapability, ModelCapability, type NamedTool, type OutputModerationOptions, type PiiOptions, PluginsCapability, ProjectContextCapability, type PromptInjectionOptions, type ProvenanceEntry, ReasoningEffort, ReflectionStrategy, RoundStreamFactory, RunContextCapability, SessionStoreCapability, SettingSourcesCapability, SettingSourcesSelection, SkillsCapability, SkillsOptions, SkillsOptionsCapability, SkillsResolverCapability, type StreamAgentTurnDeps, type StreamAgentTurnInProcessInput, StreamEvent, SubAgentsCapability, type Summarize, TelemetryCapability, type ToolComNome, type ToolDeclaration, ToolOptions, ToolboxCapability, type ToolboxSource, ToolsCapability, Toolset, ToolsetError, type TranscriptCompactionStrategy, UnknownCapabilityError, applyCapabilities, buildAgentCard, buildMcpToolDescriptors, compactionStrategyConfigSchema, costGuard, createA2ATool, createDraft, declareAgentShape, deriveConversationId, encodeAcpMessage, estimateTokens, formatGoalEvent, listSubagentNames, mcpServerInfo, moderateOutputStream, outputModeration, parseConversationId, piiDetector, promptInjectionDetector, resolveCompactionStrategy, runInputGuards, runOutputGuards, setOnce, streamAgentTurnInProcess, streamAgentUIMessages, textPayloadExtractor, tokenBudgetCompactionStrategy, unicodeNormalizer, wellKnownCardPath };
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
AgentBuilder,
|
|
3
3
|
AgentDefinitionError,
|
|
4
|
-
ConfigurationError,
|
|
5
4
|
ContextualTool,
|
|
6
5
|
McpFileError,
|
|
7
6
|
agentsPlugin,
|
|
@@ -32,12 +31,14 @@ import {
|
|
|
32
31
|
streamAgentResponse,
|
|
33
32
|
streamAgentUIMessages,
|
|
34
33
|
toolRuntimeName
|
|
35
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-G7QBDGZ4.js";
|
|
35
|
+
import "./chunk-HGVT4VCE.js";
|
|
36
36
|
import {
|
|
37
37
|
APPROVAL_MODES,
|
|
38
38
|
AgentRunner,
|
|
39
39
|
AgentRunnerBuilder,
|
|
40
40
|
BudgetExceededError,
|
|
41
|
+
CompatImportUnsupportedError,
|
|
41
42
|
CostBudgetExceededError,
|
|
42
43
|
DEFAULT_KEEP_TOKENS,
|
|
43
44
|
DEFAULT_MAX_ITERATIONS,
|
|
@@ -45,9 +46,12 @@ import {
|
|
|
45
46
|
DelegationError,
|
|
46
47
|
DelegationTimeoutError,
|
|
47
48
|
GoalRunner,
|
|
49
|
+
GuardrailError,
|
|
48
50
|
GuardrailViolationError,
|
|
49
51
|
HookGateUnsupportedError,
|
|
50
52
|
JudgeCredentialError,
|
|
53
|
+
MalformedGuardrailResultError,
|
|
54
|
+
UnreadableTextPayloadError,
|
|
51
55
|
WRITE_SCOPED_TOOLS,
|
|
52
56
|
applyPosture,
|
|
53
57
|
buildModelSelection,
|
|
@@ -78,14 +82,15 @@ import {
|
|
|
78
82
|
runInputGuards,
|
|
79
83
|
runOutputGuards,
|
|
80
84
|
shouldAutoApprove,
|
|
85
|
+
textPayloadExtractor,
|
|
81
86
|
toAgentFactory,
|
|
82
87
|
tokenBudgetCompactionStrategy,
|
|
83
88
|
translateSdkEvent,
|
|
84
89
|
unicodeNormalizer,
|
|
85
90
|
withClockCap,
|
|
86
91
|
withEphemeralAgent
|
|
87
|
-
} from "./chunk-
|
|
88
|
-
import "./chunk-
|
|
92
|
+
} from "./chunk-KTQID5V3.js";
|
|
93
|
+
import "./chunk-MJ6FRILJ.js";
|
|
89
94
|
import {
|
|
90
95
|
AGENT_BRAND,
|
|
91
96
|
UntrustedSettingSourceError,
|
|
@@ -94,7 +99,11 @@ import {
|
|
|
94
99
|
isAgentDefinition,
|
|
95
100
|
resolveCompatSources,
|
|
96
101
|
resolveSettingSources
|
|
97
|
-
} from "./chunk-
|
|
102
|
+
} from "./chunk-PMMOOXR6.js";
|
|
103
|
+
import "./chunk-M5J3Q6YC.js";
|
|
104
|
+
import {
|
|
105
|
+
ConfigurationError
|
|
106
|
+
} from "./chunk-U72XTMYB.js";
|
|
98
107
|
import "./chunk-OXNDJSAJ.js";
|
|
99
108
|
import {
|
|
100
109
|
__name
|
|
@@ -467,6 +476,27 @@ var HookApprovalCapability = class extends FieldCapability {
|
|
|
467
476
|
name = "hook-approval";
|
|
468
477
|
field = "hookApproval";
|
|
469
478
|
};
|
|
479
|
+
var SessionStoreCapability = class extends FieldCapability {
|
|
480
|
+
static {
|
|
481
|
+
__name(this, "SessionStoreCapability");
|
|
482
|
+
}
|
|
483
|
+
name = "session-store";
|
|
484
|
+
field = "sessionStore";
|
|
485
|
+
};
|
|
486
|
+
var CanUseToolCapability = class extends FieldCapability {
|
|
487
|
+
static {
|
|
488
|
+
__name(this, "CanUseToolCapability");
|
|
489
|
+
}
|
|
490
|
+
name = "can-use-tool";
|
|
491
|
+
field = "canUseTool";
|
|
492
|
+
};
|
|
493
|
+
var TelemetryCapability = class extends FieldCapability {
|
|
494
|
+
static {
|
|
495
|
+
__name(this, "TelemetryCapability");
|
|
496
|
+
}
|
|
497
|
+
name = "telemetry";
|
|
498
|
+
field = "telemetry";
|
|
499
|
+
};
|
|
470
500
|
var PluginsCapability = class extends FieldCapability {
|
|
471
501
|
static {
|
|
472
502
|
__name(this, "PluginsCapability");
|
|
@@ -1146,10 +1176,12 @@ export {
|
|
|
1146
1176
|
BudgetExceededError,
|
|
1147
1177
|
CONTEXT_WINDOW_FLOOR,
|
|
1148
1178
|
CONTEXT_WINDOW_MARGIN,
|
|
1179
|
+
CanUseToolCapability,
|
|
1149
1180
|
CapabilityConflictError,
|
|
1150
1181
|
CapabilityPreset,
|
|
1151
1182
|
CapabilityRegistry,
|
|
1152
1183
|
CheckpointCapability,
|
|
1184
|
+
CompatImportUnsupportedError,
|
|
1153
1185
|
ConfigurationError,
|
|
1154
1186
|
ContextWindowCapability,
|
|
1155
1187
|
ContextWindowMarginError,
|
|
@@ -1163,6 +1195,7 @@ export {
|
|
|
1163
1195
|
FieldCapability,
|
|
1164
1196
|
GenerateObjectError,
|
|
1165
1197
|
GoalRunner,
|
|
1198
|
+
GuardrailError,
|
|
1166
1199
|
GuardrailViolationError,
|
|
1167
1200
|
GuardrailsCapability,
|
|
1168
1201
|
HookApprovalCapability,
|
|
@@ -1173,6 +1206,7 @@ export {
|
|
|
1173
1206
|
LayerOrderError,
|
|
1174
1207
|
MCP_PROTOCOL_VERSION,
|
|
1175
1208
|
MainLoopCapability,
|
|
1209
|
+
MalformedGuardrailResultError,
|
|
1176
1210
|
McpFileError,
|
|
1177
1211
|
McpServersCapability,
|
|
1178
1212
|
MemoryCapability,
|
|
@@ -1181,6 +1215,7 @@ export {
|
|
|
1181
1215
|
ProjectContextCapability,
|
|
1182
1216
|
Provider,
|
|
1183
1217
|
RunContextCapability,
|
|
1218
|
+
SessionStoreCapability,
|
|
1184
1219
|
SettingSourcesCapability,
|
|
1185
1220
|
SkillsCapability,
|
|
1186
1221
|
SkillsOptionsCapability,
|
|
@@ -1189,6 +1224,7 @@ export {
|
|
|
1189
1224
|
StreamObjectError,
|
|
1190
1225
|
SubAgent,
|
|
1191
1226
|
SubAgentsCapability,
|
|
1227
|
+
TelemetryCapability,
|
|
1192
1228
|
Tool,
|
|
1193
1229
|
ToolError,
|
|
1194
1230
|
ToolboxCapability,
|
|
@@ -1197,6 +1233,7 @@ export {
|
|
|
1197
1233
|
ToolsetError,
|
|
1198
1234
|
UngatedCapabilityError,
|
|
1199
1235
|
UnknownCapabilityError,
|
|
1236
|
+
UnreadableTextPayloadError,
|
|
1200
1237
|
UntrustedSettingSourceError,
|
|
1201
1238
|
WRITE_SCOPED_TOOLS,
|
|
1202
1239
|
BudgetExceededError2 as WindowBudgetExceededError,
|
|
@@ -1286,6 +1323,7 @@ export {
|
|
|
1286
1323
|
streamAgentResponse,
|
|
1287
1324
|
streamAgentTurnInProcess,
|
|
1288
1325
|
streamAgentUIMessages,
|
|
1326
|
+
textPayloadExtractor,
|
|
1289
1327
|
toAgentFactory,
|
|
1290
1328
|
tokenBudgetCompactionStrategy,
|
|
1291
1329
|
translateSdkEvent,
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts","../src/capability/capability.ts","../src/capability/capabilities.ts","../src/capability/registry.ts","../src/capability/agent-capabilities.ts","../src/capability/agent-shape.ts","../src/capability/toolbox.ts","../src/capability/toolset.ts","../src/a2a/agent-card.ts","../src/a2a/mcp-server-manifest.ts","../src/a2a/a2a-client.ts","../src/conversation-scope.ts","../src/skills-resolver.ts","../src/acp/protocol.ts","../src/acp/client.ts","../src/bridge/subagent-inventory.ts","../src/in-process-turn.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOA,SAASA,SAASC,kBAAkB;;;ACPpC,SAASC,yBAAyB;AAElC,SAASC,yBAAyB;AA6C3B,IAAMC,0BAAN,cAAsCC,kBAAAA;EA/C7C,OA+C6CA;;;EACzBC,OAAO;EACzB,YAAYC,OAAeC,UAAmBC,MAAeC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M6B,UAAUvC,SAAY;QAAEuC,OAAO7B,MAAM6B;MAAM,IAAI,CAAC;MAC1D,GAAI7B,MAAM8B,uBAAuBxC,SAC7B;QAAEwC,oBAAoB9B,MAAM8B;MAAmB,IAC/C,CAAC;;;MAGL,GAAI9B,MAAM+B,YAAYzC,SAAY;QAAEyC,SAAS/B,MAAM+B;MAAQ,IAAI,CAAC;IAClE,CAAA;EACF,GAAA;AACF;AA7DgBlC;;;AhB4GhB,SACEmC,oBACAC,sBACAC,YACAC,cACAC,qBACAC,2BACK;AAkBP,SACEC,qBACAC,iBACAC,mBACAC,WACAC,8BACK;AAuBP,SAASC,yBAAyB;AAxO3B,IAAMC,QAA+BC;","names":["Agent","AgentDoSdk","isDeepStrictEqual","TheokitAgentError","CapabilityConflictError","TheokitAgentError","name","field","previous","next","capability","shapeOf","code","isRetryable","value","Array","isArray","length","Object","keys","sort","a","b","localeCompare","join","createDraft","tools","agents","provenance","applyCapabilities","capabilities","draft","c","apply","stream","setOnce","undefined","isDeepStrictEqual","push","contributed","describe","value","Array","isArray","ModelCapability","name","id","reasoningEffort","ConfigurationError","trim","length","apply","draft","setOnce","undefined","ToolsCapability","tools","push","provenance","capability","contributed","SkillsCapability","entries","e","field","compiled","compileSkillsSelection","slice","skills","previous","enabled","inline","TheokitAgentError","UnknownCapabilityError","TheokitAgentError","name","requested","known","join","code","isRetryable","CapabilityRegistry","Map","register","factory","set","has","names","keys","resolve","arg","get","undefined","CapabilityPreset","members","apply","draft","member","FieldCapability","value","apply","draft","setOnce","field","name","MemoryCapability","ContextWindowCapability","options","compileContextWindow","context","ProjectContextCapability","McpServersCapability","GuardrailsCapability","CheckpointCapability","undefined","storage","console","warn","HumanInTheLoopCapability","SubAgentsCapability","children","child","Object","entries","agents","ConfigurationError","provenance","push","capability","contributed","SkillsOptionsCapability","compileSkills","SettingSourcesCapability","selection","resolveSettingSources","claudeCode","resolveCompatSources","HookApprovalCapability","PluginsCapability","RunContextCapability","SkillsResolverCapability","AgentConfigCapability","config","Number","isFinite","claimedByMainLoop","some","p","includes","maxIterations","timeoutMs","systemPrompt","parseThinkTags","stripToolDialect","recoverLeakedToolCalls","stream","MainLoopCapability","length","declareAgentShape","name","members","draft","applyCapabilities","shape","tools","Object","freeze","provenance","model","undefined","reasoningEffort","ToolboxCapability","name","instance","options","ConfigurationError","declared","tools","undefined","length","tool","method","namespace","toolRuntimeName","class","guards","map","propertyKey","config","approval","trace","audit","hitl","apply","draft","walk","push","compileTools","Map","provenance","capability","contributed","gates","compileHitlGates","size","key","set","TheokitAgentError","ToolsetError","TheokitAgentError","name","message","code","Toolset","byName","Object","freeze","from","tools","Map","tool","has","set","get","undefined","resolve","names","seen","Set","map","add","keys","all","values","trimTrailingSlash","url","endsWith","slice","buildAgentCard","entry","options","base","baseUrl","name","description","route","version","capabilities","streaming","stream","pushNotifications","stateTransitionHistory","defaultInputModes","defaultOutputModes","skills","tools","map","t","id","wellKnownCardPath","agentName","MCP_PROTOCOL_VERSION","buildMcpToolDescriptors","entry","tools","map","t","name","description","inputSchema","type","properties","mcpServerInfo","version","protocolVersion","buildHeaders","config","headers","auth","bearer","authorization","apiKey","header","value","createA2ATool","doFetch","fetchImpl","fetch","name","description","inputSchema","type","properties","message","required","handler","input","res","url","method","body","JSON","stringify","ok","Error","status","statusText","data","json","response","text","SEPARATOR","deriveConversationId","resource","thread","Error","encodeURIComponent","parseConversationId","id","idx","indexOf","length","decodeURIComponent","slice","resolveEnabledSkills","selection","ctx","undefined","filter","s","resolved","Array","isArray","Error","names","every","n","trim","length","encodeAcpMessage","message","JSON","stringify","AcpMessageDecoder","buffer","push","chunk","messages","newlineIndex","indexOf","line","slice","trim","length","parse","cause","Error","isResponse","m","id","isServerRequest","method","AcpClient","nextId","pending","Map","handlers","decoder","AcpMessageDecoder","transport","subscribe","chunk","message","push","dispatch","request","params","Promise","resolve","reject","set","send","encodeAcpMessage","jsonrpc","onRequest","handler","entry","get","delete","error","Error","result","handleServerRequest","req","code","err","Squad","Tool","Provider","setDiagnosticsSink","SubAgent","assertNoSymlinkEscape","isForbiddenPath","safePathJoin","CONTEXT_WINDOW_FLOOR","CONTEXT_WINDOW_MARGIN","ContextWindowMarginError","resolveEffectiveContextWindow","discoverSubagents","loadSubagentDefinition","discoverSubagents","listSubagentNames","cwd","options","discovered","discoverSubagents","Object","keys","sort","a","b","localeCompare","WindowBudgetExceededError","BudgetExceededError","TheokitAgentError","InProcessApprovalRequiredError","TheokitAgentError","name","toolNames","join","code","isRetryable","postureResolver","posturePolicy","undefined","kind","awaitApproval","Promise","resolve","approved","reason","streamAgentTurnInProcess","mod","apiKey","input","deps","stream","streamAgentUIMessages","compiled","compileAgentModule","source","gated","hitl","size","approvals","keys","approvalResolver","approvalId","opts","toolName","sessionId","crypto","randomUUID","skillsResolver","enabled","resolveEnabledSkills","runContext","skills","autoInject","message","images","signal","onRunEvent","retry","exposeUsageToTools","onError","applySecurityFloor","auditEnvReachability","foldLayers","recordWiring","resolveTrustPosture","verifyLayerOrdering","GenerateObjectError","LayerOrderError","StreamObjectError","ToolError","UngatedCapabilityError","foldTurnLifecycle","Agent","AgentDoSdk"]}
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/capability/capability.ts","../src/capability/capabilities.ts","../src/capability/registry.ts","../src/capability/agent-capabilities.ts","../src/capability/agent-shape.ts","../src/capability/toolbox.ts","../src/capability/toolset.ts","../src/a2a/agent-card.ts","../src/a2a/mcp-server-manifest.ts","../src/a2a/a2a-client.ts","../src/conversation-scope.ts","../src/skills-resolver.ts","../src/acp/protocol.ts","../src/acp/client.ts","../src/bridge/subagent-inventory.ts","../src/in-process-turn.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOA,SAASA,SAASC,kBAAkB;;;ACPpC,SAASC,yBAAyB;AAElC,SAASC,yBAAyB;AA6C3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ASkB,cAAc,CAAC,CAAA;AAC5F,UAAIF,YAAY9B,OAAWc,UAASmB,SAAS;QAAEH;QAASI,YAAY;MAAK;IAC3E;AACA,WAAOvB,KAAKC,OAAOE,UAAUL,QAAQ;MACnC0B,SAASzB,MAAMyB;;MAEf,GAAIzB,MAAM0B,WAAWpC,SAAY;QAAEoC,QAAQ1B,MAAM0B;MAAO,IAAI,CAAC;MAC7DV;MACAR;MACAmB,QAAQ3B,MAAM2B;MACd,GAAI3B,MAAM4B,eAAetC,SAAY;QAAEsC,YAAY5B,MAAM4B;MAAW,IAAI,CAAC;;;MAGzE,GAAI5B,MAAM6B,UAAUvC,SAAY;QAAEuC,OAAO7B,MAAM6B;MAAM,IAAI,CAAC;MAC1D,GAAI7B,MAAM8B,uBAAuBxC,SAC7B;QAAEwC,oBAAoB9B,MAAM8B;MAAmB,IAC/C,CAAC;;;MAGL,GAAI9B,MAAM+B,YAAYzC,SAAY;QAAEyC,SAAS/B,MAAM+B;MAAQ,IAAI,CAAC;IAClE,CAAA;EACF,GAAA;AACF;AA7DgBlC;;;AhBwHhB,SACEmC,oBACAC,sBACAC,YACAC,cACAC,qBACAC,2BACK;AAkBP,SACEC,qBACAC,iBACAC,mBACAC,WACAC,8BACK;AAuBP,SAASC,yBAAyB;AApP3B,IAAMC,QAA+BC;","names":["Agent","AgentDoSdk","isDeepStrictEqual","TheokitAgentError","CapabilityConflictError","TheokitAgentError","name","field","previous","next","capability","shapeOf","code","isRetryable","value","Array","isArray","length","Object","keys","sort","a","b","localeCompare","join","createDraft","tools","agents","provenance","applyCapabilities","capabilities","draft","c","apply","stream","setOnce","undefined","isDeepStrictEqual","push","contributed","describe","value","Array","isArray","ModelCapability","name","id","reasoningEffort","ConfigurationError","trim","length","apply","draft","setOnce","undefined","ToolsCapability","tools","push","provenance","capability","contributed","SkillsCapability","entries","e","field","compiled","compileSkillsSelection","slice","skills","previous","enabled","inline","TheokitAgentError","UnknownCapabilityError","TheokitAgentError","name","requested","known","join","code","isRetryable","CapabilityRegistry","Map","register","factory","set","has","names","keys","resolve","arg","get","undefined","CapabilityPreset","members","apply","draft","member","FieldCapability","value","apply","draft","setOnce","field","name","MemoryCapability","ContextWindowCapability","options","compileContextWindow","context","ProjectContextCapability","McpServersCapability","GuardrailsCapability","CheckpointCapability","undefined","storage","console","warn","HumanInTheLoopCapability","SubAgentsCapability","children","child","Object","entries","agents","ConfigurationError","provenance","push","capability","contributed","SkillsOptionsCapability","compileSkills","SettingSourcesCapability","selection","resolveSettingSources","claudeCode","resolveCompatSources","HookApprovalCapability","SessionStoreCapability","CanUseToolCapability","TelemetryCapability","PluginsCapability","RunContextCapability","SkillsResolverCapability","AgentConfigCapability","config","Number","isFinite","claimedByMainLoop","some","p","includes","maxIterations","timeoutMs","systemPrompt","parseThinkTags","stripToolDialect","recoverLeakedToolCalls","stream","MainLoopCapability","length","declareAgentShape","name","members","draft","applyCapabilities","shape","tools","Object","freeze","provenance","model","undefined","reasoningEffort","ToolboxCapability","name","instance","options","ConfigurationError","declared","tools","undefined","length","tool","method","namespace","toolRuntimeName","class","guards","map","propertyKey","config","approval","trace","audit","hitl","apply","draft","walk","push","compileTools","Map","provenance","capability","contributed","gates","compileHitlGates","size","key","set","TheokitAgentError","ToolsetError","TheokitAgentError","name","message","code","Toolset","byName","Object","freeze","from","tools","Map","tool","has","set","get","undefined","resolve","names","seen","Set","map","add","keys","all","values","trimTrailingSlash","url","endsWith","slice","buildAgentCard","entry","options","base","baseUrl","name","description","route","version","capabilities","streaming","stream","pushNotifications","stateTransitionHistory","defaultInputModes","defaultOutputModes","skills","tools","map","t","id","wellKnownCardPath","agentName","MCP_PROTOCOL_VERSION","buildMcpToolDescriptors","entry","tools","map","t","name","description","inputSchema","type","properties","mcpServerInfo","version","protocolVersion","buildHeaders","config","headers","auth","bearer","authorization","apiKey","header","value","createA2ATool","doFetch","fetchImpl","fetch","name","description","inputSchema","type","properties","message","required","handler","input","res","url","method","body","JSON","stringify","ok","Error","status","statusText","data","json","response","text","SEPARATOR","deriveConversationId","resource","thread","Error","encodeURIComponent","parseConversationId","id","idx","indexOf","length","decodeURIComponent","slice","resolveEnabledSkills","selection","ctx","undefined","filter","s","resolved","Array","isArray","Error","names","every","n","trim","length","encodeAcpMessage","message","JSON","stringify","AcpMessageDecoder","buffer","push","chunk","messages","newlineIndex","indexOf","line","slice","trim","length","parse","cause","Error","isResponse","m","id","isServerRequest","method","AcpClient","nextId","pending","Map","handlers","decoder","AcpMessageDecoder","transport","subscribe","chunk","message","push","dispatch","request","params","Promise","resolve","reject","set","send","encodeAcpMessage","jsonrpc","onRequest","handler","entry","get","delete","error","Error","result","handleServerRequest","req","code","err","Squad","Tool","Provider","setDiagnosticsSink","SubAgent","assertNoSymlinkEscape","isForbiddenPath","safePathJoin","CONTEXT_WINDOW_FLOOR","CONTEXT_WINDOW_MARGIN","ContextWindowMarginError","resolveEffectiveContextWindow","discoverSubagents","loadSubagentDefinition","discoverSubagents","listSubagentNames","cwd","options","discovered","discoverSubagents","Object","keys","sort","a","b","localeCompare","WindowBudgetExceededError","BudgetExceededError","TheokitAgentError","InProcessApprovalRequiredError","TheokitAgentError","name","toolNames","join","code","isRetryable","postureResolver","posturePolicy","undefined","kind","awaitApproval","Promise","resolve","approved","reason","streamAgentTurnInProcess","mod","apiKey","input","deps","stream","streamAgentUIMessages","compiled","compileAgentModule","source","gated","hitl","size","approvals","keys","approvalResolver","approvalId","opts","toolName","sessionId","crypto","randomUUID","skillsResolver","enabled","resolveEnabledSkills","runContext","skills","autoInject","message","images","signal","onRunEvent","retry","exposeUsageToTools","onError","applySecurityFloor","auditEnvReachability","foldLayers","recordWiring","resolveTrustPosture","verifyLayerOrdering","GenerateObjectError","LayerOrderError","StreamObjectError","ToolError","UngatedCapabilityError","foldTurnLifecycle","Agent","AgentDoSdk"]}
|
package/dist/sandbox.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/sandbox-entry.ts"],"mappings":";;;
|
|
1
|
+
{"version":3,"sources":["../src/sandbox-entry.ts"],"mappings":";;;AA2CA;EACEA;EACAC;EACAC;EACAC;EACAC;EACAC;EACAC;EACAC;EACAC;EACAC;EACAC;EACAC;EACAC;EACAC;EACAC;EACAC;EACAC;EACAC;EACAC;EACAC;EACAC;EACAC;EACAC;EACAC;EAIAC;OACK;","names":["allowlistedEnv","buildBwrapArgv","buildSeccompFilter","createSandboxBackend","detectBwrap","detectBwrapMemoized","interactiveWrapCommand","LinuxSandbox","LocalSandbox","provisionRepo","realProbeCount","realProbes","RepoProvisionError","resetBwrapMemo","resetInteractiveWarnLatch","resetSandboxWarnLatch","resolveSandbox","resolveSandboxPosture","restrictedSeccompPath","SandboxBackend","SandboxNotAvailableError","SandboxSecurityError","seccompPathForArch","wrapCommandForSandbox","writableRootsFor"]}
|