@theokit/agents 7.4.2 → 7.6.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/LICENSE +201 -0
- package/dist/auth.d.ts +1 -1
- package/dist/auth.js +73 -74
- package/dist/auth.js.map +1 -1
- package/dist/{bridge-entry-Z8GjrwH4.d.ts → bridge-entry-CvmBrmc9.d.ts} +101 -5
- package/dist/bridge.d.ts +1 -1
- package/dist/bridge.js +6 -1
- package/dist/{chunk-PHUNONZT.js → chunk-22IPZFVT.js} +1007 -446
- package/dist/chunk-22IPZFVT.js.map +1 -0
- package/dist/{chunk-FJA4QQLZ.js → chunk-2BAFKRXT.js} +221 -165
- package/dist/chunk-2BAFKRXT.js.map +1 -0
- package/dist/chunk-Z4QWC7IK.js +7 -0
- package/dist/chunk-Z4QWC7IK.js.map +1 -0
- package/dist/client-react.js +9 -3
- package/dist/client-react.js.map +1 -1
- package/dist/client.js +2 -1
- package/dist/index.d.ts +18 -3
- package/dist/index.js +382 -129
- package/dist/index.js.map +1 -1
- package/dist/interactive.js +3 -6
- package/dist/interactive.js.map +1 -1
- package/dist/persistence.d.ts +1 -1
- package/dist/persistence.js +6 -0
- package/dist/persistence.js.map +1 -1
- package/dist/pty.js +3 -7
- package/dist/pty.js.map +1 -1
- package/dist/sandbox.d.ts +1 -1
- package/dist/sandbox.js +6 -2
- package/dist/sandbox.js.map +1 -1
- package/dist/testing.js +21 -3
- package/dist/testing.js.map +1 -1
- package/dist/tools.js +3 -55
- package/dist/tools.js.map +1 -1
- package/package.json +14 -21
- package/dist/chunk-FJA4QQLZ.js.map +0 -1
- package/dist/chunk-PHUNONZT.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"mappings":"","names":[]}
|
package/dist/client-react.js
CHANGED
|
@@ -2,7 +2,10 @@ import {
|
|
|
2
2
|
AgentClient,
|
|
3
3
|
HttpTransport,
|
|
4
4
|
isAgentHandle
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-2BAFKRXT.js";
|
|
6
|
+
import {
|
|
7
|
+
__name
|
|
8
|
+
} from "./chunk-Z4QWC7IK.js";
|
|
6
9
|
|
|
7
10
|
// src/client/use-agent.ts
|
|
8
11
|
import { useMemo, useRef, useSyncExternalStore } from "react";
|
|
@@ -17,7 +20,7 @@ function useAgent(binding, options = {}) {
|
|
|
17
20
|
() => new AgentClient(
|
|
18
21
|
api !== void 0 ? new HttpTransport({
|
|
19
22
|
api,
|
|
20
|
-
headers: () => optionsRef.current.headers,
|
|
23
|
+
headers: /* @__PURE__ */ __name(() => optionsRef.current.headers, "headers"),
|
|
21
24
|
fetch: optionsRef.current.fetch
|
|
22
25
|
}) : binding,
|
|
23
26
|
// M43 — resolve context live from the ref each send/reconnect (never stale). A value or a resolver.
|
|
@@ -28,7 +31,9 @@ function useAgent(binding, options = {}) {
|
|
|
28
31
|
),
|
|
29
32
|
// bindingIdentity captures api/binding; options resolve live via optionsRef (rebuild would drop messages).
|
|
30
33
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
31
|
-
[
|
|
34
|
+
[
|
|
35
|
+
bindingIdentity
|
|
36
|
+
]
|
|
32
37
|
);
|
|
33
38
|
const state = useSyncExternalStore(client.subscribe, client.getSnapshot, client.getSnapshot);
|
|
34
39
|
return {
|
|
@@ -43,6 +48,7 @@ function useAgent(binding, options = {}) {
|
|
|
43
48
|
reconnect: client.reconnect
|
|
44
49
|
};
|
|
45
50
|
}
|
|
51
|
+
__name(useAgent, "useAgent");
|
|
46
52
|
export {
|
|
47
53
|
useAgent
|
|
48
54
|
};
|
package/dist/client-react.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/client/use-agent.ts"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../src/client/use-agent.ts"],"mappings":";;;;;;;;;;AACA,SAASA,SAASC,QAAQC,4BAA4B;AAyE/C,SAASC,SACdC,SACAC,UAA2B,CAAC,GAAC;AAI7B,QAAMC,aAAaC,OAAOF,OAAAA;AAC1BC,aAAWE,UAAUH;AAIrB,MAAII;AACJ,MAAI,OAAOL,YAAY,SAAUK,OAAML;WAC9BM,cAAcN,OAAAA,EAAUK,OAAML,QAAQO;AAE/C,QAAMC,kBAAkBH,OAAOL;AAE/B,QAAMS,SAASC;IACb,MACE,IAAIC;MACFN,QAAQO,SACJ,IAAIC,cAAc;QAChBR;QACAS,SAAS,6BAAMZ,WAAWE,QAAQU,SAAzB;QACTC,OAAOb,WAAWE,QAAQW;MAC5B,CAAA,IACCf;;MAEL,MAAA;AACE,cAAMgB,MAAMd,WAAWE,QAAQa;AAC/B,eAAO,OAAOD,QAAQ,aAAaA,IAAAA,IAAQA;MAC7C;IAAA;;;IAIJ;MAACR;;EAAgB;AAGnB,QAAMU,QAAQC,qBAAqBV,OAAOW,WAAWX,OAAOY,aAAaZ,OAAOY,WAAW;AAE3F,SAAO;IACLC,UAAUJ,MAAMI;IAChBC,QAAQL,MAAMK;IACdC,QAAQN,MAAMM;IACdC,OAAOP,MAAMO;IACbC,MAAMjB,OAAOiB;IACbC,OAAOlB,OAAOkB;IACdC,OAAOnB,OAAOmB;IACdC,SAASpB,OAAOoB;IAChBC,WAAWrB,OAAOqB;EACpB;AACF;AAnDgB/B;","names":["useMemo","useRef","useSyncExternalStore","useAgent","binding","options","optionsRef","useRef","current","api","isAgentHandle","path","bindingIdentity","client","useMemo","AgentClient","undefined","HttpTransport","headers","fetch","ctx","context","state","useSyncExternalStore","subscribe","getSnapshot","messages","thread","status","error","send","abort","reset","approve","reconnect"]}
|
package/dist/client.js
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
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, GoalEvent, GoalLoopAgent, GoalOptions, GoalResult, JudgeCredentialError, JudgeResult, McpAuthConfig, McpHttpServerConfig, McpOAuthConfig, McpServerConfig, McpStdioServerConfig, Provider, SDKAgent, SessionRecord, Squad, Tool, Verdict, setDiagnosticsSink } from '@theokit/sdk';
|
|
3
|
-
import { G as Guardrail, L as LoopStrategy, R as ReflectionStrategy, C as CompiledAgentOptions, M as MainLoopMeta, a as CompiledTool, b as ReasoningEffort, c as RoundStreamFactory, S as StreamEvent, D as DelegationResult, d as ContextWindowOptions, e as SkillsOptions, T as ToolOptions, A as ApprovalOptions, H as HumanInTheLoopOptions, f as AgentManifestEntry, g as HitlDecision, s as streamAgentUIMessages, h as ApprovalPosture } from './bridge-entry-
|
|
4
|
-
export { i as AGENT_BRAND, j as AfterToolCallContext, k as AgentBuilder, l as AgentDefinition, m as AgentDefinitionError, n as AgentExecutionContext, o as AgentManifest, p as AgentManifestSource, q as AgentManifestTool, r as AgentOptions, t as AgentRoute, u as AgentRouteContext, v as AgentRunInfo, w as AgentStreamEvent, x as AgentTurnMetadata, y as AgentsPluginOptions, z as ApiErrorContext, B as ApiErrorDecision, E as ApiErrorPolicy, F as ApprovalRequiredEvent, I as ArtifactChunkEvent, J as ArtifactStartEvent, K as BackgroundDelegation, N as BeforeToolCallContext, O as BudgetExceededError, P as BudgetOptions, Q as CheckpointSavedEvent, U as CompiledContextWindow, V as ContextualTool, W as CostBudgetExceededError, X as DEFAULT_MAX_ITERATIONS, Y as DefineAgentConfig, Z as DefinitionOrThunk, _ as DelegateFn, $ as DelegateOptions, a0 as DelegationBudgetExceededError, a1 as DelegationError, a2 as DoneEvent, a3 as ErrorEvent, a4 as FileEditEvent, a5 as GuardrailAction, a6 as GuardrailPhase, a7 as GuardrailResult, a8 as GuardrailViolationError, a9 as HookHandlers, aa as InferAgentInput, ab as InferAgentToolNames, ac as IterationEvent, ad as LLMCallContext, ae as LoopFinishReason, af as LoopOutcome, ag as LoopStrategyConfig, ah as MainLoopOptions, ai as McpApprovalSpec, aj as McpFileError, ak as McpRegistryConfig, al as McpRequestContext, am as McpSelection, an as McpServersMap, ao as PartialToolCallEvent, ap as PolicyHandler, aq as ProcessInputContext, ar as
|
|
2
|
+
export { CustomTool, DiagnosticsSink, GenerateObjectError, GoalEvent, GoalLoopAgent, GoalOptions, GoalResult, JudgeCredentialError, JudgeResult, LayerOrderError, McpAuthConfig, McpHttpServerConfig, McpOAuthConfig, McpServerConfig, McpStdioServerConfig, Provider, SDKAgent, SessionRecord, Squad, StreamObjectError, Tool, ToolError, ToolResultContentBlock, TrustLevel, TrustPosture, TrustPostureInput, TrustSource, UngatedCapabilityError, Verdict, WiredEntity, applySecurityFloor, auditEnvReachability, foldLayers, recordWiring, resolveTrustPosture, setDiagnosticsSink, verifyLayerOrdering } from '@theokit/sdk';
|
|
3
|
+
import { G as Guardrail, L as LoopStrategy, R as ReflectionStrategy, C as CompiledAgentOptions, M as MainLoopMeta, a as CompiledTool, b as ReasoningEffort, c as RoundStreamFactory, S as StreamEvent, D as DelegationResult, d as ContextWindowOptions, e as SkillsOptions, T as ToolOptions, A as ApprovalOptions, H as HumanInTheLoopOptions, f as AgentManifestEntry, g as HitlDecision, s as streamAgentUIMessages, h as ApprovalPosture } from './bridge-entry-CvmBrmc9.js';
|
|
4
|
+
export { i as AGENT_BRAND, j as AfterToolCallContext, k as AgentBuilder, l as AgentDefinition, m as AgentDefinitionError, n as AgentExecutionContext, o as AgentManifest, p as AgentManifestSource, q as AgentManifestTool, r as AgentOptions, t as AgentRoute, u as AgentRouteContext, v as AgentRunInfo, w as AgentStreamEvent, x as AgentTurnMetadata, y as AgentsPluginOptions, z as ApiErrorContext, B as ApiErrorDecision, E as ApiErrorPolicy, F as ApprovalRequiredEvent, I as ArtifactChunkEvent, J as ArtifactStartEvent, K as BackgroundDelegation, N as BeforeToolCallContext, O as BudgetExceededError, P as BudgetOptions, Q as CheckpointSavedEvent, U as CompiledContextWindow, V as ContextualTool, W as CostBudgetExceededError, X as DEFAULT_MAX_ITERATIONS, Y as DefineAgentConfig, Z as DefinitionOrThunk, _ as DelegateFn, $ as DelegateOptions, a0 as DelegationBudgetExceededError, a1 as DelegationError, a2 as DoneEvent, a3 as ErrorEvent, a4 as FileEditEvent, a5 as GuardrailAction, a6 as GuardrailPhase, a7 as GuardrailResult, a8 as GuardrailViolationError, a9 as HookHandlers, aa as InferAgentInput, ab as InferAgentToolNames, ac as IterationEvent, ad as LLMCallContext, ae as LoopFinishReason, af as LoopOutcome, ag as LoopStrategyConfig, ah as MainLoopOptions, ai as McpApprovalSpec, aj as McpFileError, ak as McpRegistryConfig, al as McpRequestContext, am as McpSelection, an as McpServersMap, ao as PartialToolCallEvent, ap as PolicyHandler, aq as ProcessInputContext, ar as ProjectSettingsGrant, as as ReflectionContext, at as ReflectionResult, au as ReflectionStrategyConfig, av as RunStartedEvent, aw as ScoreVerdict, ax as ScoredDelegation, ay as Scorer, az as SdkAgentHandle, aA as SdkMessage, aB as SdkSendOptions, aC as SdkTurnHandle, aD as Segment, aE as SettingSourceCapability, aF as SettingSourcesSelection, aG as SkillsRequestContext, aH as SkillsSelection, aI as StateUpdateEvent, aJ as TextDeltaEvent, aK as ThinkingEvent, aL as TimeoutAction, aM as ToolCallEvent, aN as ToolCallVeto, aO as ToolHooks, aP as ToolHooksPlugin, aQ as ToolResultEvent, aR as ToolWalkResult, aS as ToolboxOptions, aT as ToolboxWalkResult, aU as UntrustedSettingSourceError, aV as agentsPlugin, aW as buildModelSelection, aX as compileAgentDefinition, aY as compileAgentModule, aZ as compileContextWindow, a_ as compileProjectContext, a$ as compileSkills, b0 as compileTools, b1 as createAgentExecutionContext, b2 as createApiErrorHandler, b3 as createSdkAgentStream, b4 as createThinkTagExtractor, b5 as createToolHooksPlugin, b6 as delegate, b7 as delegateBackground, b8 as delegateWithScoring, b9 as extractThinkTagStream, ba as generateAgentManifest, bb as generateAgentRoutes, bc as isAgentContext, bd as isAgentDefinition, be as isApprovalRequired, bf as isDone, bg as isError, bh as isPartialToolCall, bi as isTextDelta, bj as isToolCall, bk as isToolResult, bl as ladderReflectionStrategy, bm as loadMcpJson, bn as loopStrategyConfigSchema, bo as mcpRegistry, bp as mcpToolApprovals, bq as noopReflectionStrategy, br as presentUIMessageStream, bs as projectContextMetadataOnlyKnobs, bt as reasoningEffortOf, bu as reflectionStrategyConfigSchema, bv as resolveEnabledSkills, bw as resolveLoopStrategy, bx as resolveMcpServers, by as resolveSettingSources, bz as runWithApiErrorHandling, bA as streamAgentResponse, bB as toAgentFactory, bC as translateSdkEvent } from './bridge-entry-CvmBrmc9.js';
|
|
5
5
|
import { TheokitAgentError } from '@theokit/sdk/errors';
|
|
6
6
|
export * from '@theokit/sdk/errors';
|
|
7
7
|
export { ConfigurationError, BudgetExceededError as WindowBudgetExceededError } from '@theokit/sdk/errors';
|
|
@@ -1119,6 +1119,21 @@ interface StreamAgentTurnInProcessInput {
|
|
|
1119
1119
|
source?: string;
|
|
1120
1120
|
/** Abort signal forwarded to the SDK stream (client disconnect / window close). */
|
|
1121
1121
|
signal?: AbortSignal;
|
|
1122
|
+
/**
|
|
1123
|
+
* theokit#189 — observe the SDK's typed `RunEvent`s for this turn.
|
|
1124
|
+
*
|
|
1125
|
+
* `agent-endpoint.ts` already threaded this sink on the HTTP path (theokit#132); this entry point
|
|
1126
|
+
* — the one an EMBEDDED surface uses — declared no field for it, so the sink had no way in and
|
|
1127
|
+
* every `RunEvent` was unobservable in-process. `streamAgentUIMessages` accepted it at the far end
|
|
1128
|
+
* the whole time; the hop in between simply did not pass it.
|
|
1129
|
+
*
|
|
1130
|
+
* Nothing failed while it was missing, because a sink nobody can install emits nothing to compare
|
|
1131
|
+
* against. That is what made it survive: the absence had no observable consequence to test.
|
|
1132
|
+
*
|
|
1133
|
+
* Absent ⇒ the key is omitted from the SDK call entirely, so the stream is byte-identical to
|
|
1134
|
+
* before.
|
|
1135
|
+
*/
|
|
1136
|
+
onRunEvent?: Parameters<typeof streamAgentUIMessages>[2]['onRunEvent'];
|
|
1122
1137
|
}
|
|
1123
1138
|
/** Injectable stream fn (defaults to the real SDK bridge) — lets tests drive a deterministic stream. */
|
|
1124
1139
|
interface StreamAgentTurnDeps {
|