@theokit/sdk 5.12.0 → 5.13.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.
Files changed (139) hide show
  1. package/CHANGELOG.md +68 -0
  2. package/dist/{agent-IG7BP6GN.js → agent-5DSDDH7K.js} +5 -5
  3. package/dist/{agent-IG7BP6GN.js.map → agent-5DSDDH7K.js.map} +1 -1
  4. package/dist/{agent-CVzDy_Oj.d.ts → agent-DSMuwADp.d.ts} +9 -2
  5. package/dist/{agent-BVKIUP7F.cjs → agent-WOMRT3KX.cjs} +6 -6
  6. package/dist/{agent-BVKIUP7F.cjs.map → agent-WOMRT3KX.cjs.map} +1 -1
  7. package/dist/{agent-Cn0sphpA.d.cts → agent-iW5kPpfT.d.cts} +9 -2
  8. package/dist/{chunk-XJ4C4NFX.js → chunk-2PRGRYEQ.js} +61 -47
  9. package/dist/chunk-2PRGRYEQ.js.map +1 -0
  10. package/dist/{chunk-HN4IKB6X.cjs → chunk-2XWAYCFM.cjs} +15 -13
  11. package/dist/chunk-2XWAYCFM.cjs.map +1 -0
  12. package/dist/{chunk-VVGFZQZC.js → chunk-3LMVJTNJ.js} +9 -5
  13. package/dist/chunk-3LMVJTNJ.js.map +1 -0
  14. package/dist/{chunk-IO4RI5ZJ.cjs → chunk-47EACDOC.cjs} +4 -4
  15. package/dist/{chunk-IO4RI5ZJ.cjs.map → chunk-47EACDOC.cjs.map} +1 -1
  16. package/dist/{chunk-LSWHDOCL.cjs → chunk-4UYHP6NF.cjs} +64 -48
  17. package/dist/chunk-4UYHP6NF.cjs.map +1 -0
  18. package/dist/{chunk-ZLFFDPXC.js → chunk-73IITAF7.js} +36 -14
  19. package/dist/chunk-73IITAF7.js.map +1 -0
  20. package/dist/{chunk-XRPMZ7TO.js → chunk-CYWOJA6B.js} +6 -4
  21. package/dist/chunk-CYWOJA6B.js.map +1 -0
  22. package/dist/{chunk-AQW54OWQ.js → chunk-DFBWYETS.js} +5 -3
  23. package/dist/chunk-DFBWYETS.js.map +1 -0
  24. package/dist/{chunk-YOVZMN4P.cjs → chunk-DVP3YMDA.cjs} +3 -3
  25. package/dist/{chunk-YOVZMN4P.cjs.map → chunk-DVP3YMDA.cjs.map} +1 -1
  26. package/dist/{chunk-BRWI4HLK.cjs → chunk-FLDHYF5C.cjs} +13 -3
  27. package/dist/chunk-FLDHYF5C.cjs.map +1 -0
  28. package/dist/{chunk-BJ7BPLQK.js → chunk-JX4LB6XO.js} +124 -13
  29. package/dist/chunk-JX4LB6XO.js.map +1 -0
  30. package/dist/{chunk-Q6WT5535.cjs → chunk-KL7ZUMK3.cjs} +161 -50
  31. package/dist/chunk-KL7ZUMK3.cjs.map +1 -0
  32. package/dist/{chunk-FEAWEBWN.cjs → chunk-PDOXYXWX.cjs} +6 -4
  33. package/dist/chunk-PDOXYXWX.cjs.map +1 -0
  34. package/dist/{chunk-EEK7S77K.js → chunk-QGDPMM3C.js} +13 -3
  35. package/dist/chunk-QGDPMM3C.js.map +1 -0
  36. package/dist/{chunk-ZWLFHSON.cjs → chunk-R35ZJAYT.cjs} +38 -15
  37. package/dist/chunk-R35ZJAYT.cjs.map +1 -0
  38. package/dist/{chunk-4YD2WI57.cjs → chunk-R427EOZE.cjs} +19 -15
  39. package/dist/chunk-R427EOZE.cjs.map +1 -0
  40. package/dist/{chunk-TLVI2OQK.cjs → chunk-SETHRLQS.cjs} +18 -2
  41. package/dist/chunk-SETHRLQS.cjs.map +1 -0
  42. package/dist/{chunk-BO3PV3OP.js → chunk-TDED5XES.js} +18 -3
  43. package/dist/chunk-TDED5XES.js.map +1 -0
  44. package/dist/{chunk-4GUFNDZR.js → chunk-XOYNB3YN.js} +3 -3
  45. package/dist/{chunk-4GUFNDZR.js.map → chunk-XOYNB3YN.js.map} +1 -1
  46. package/dist/{chunk-NJBJ3CUG.js → chunk-ZTP6ZACR.js} +3 -3
  47. package/dist/{chunk-NJBJ3CUG.js.map → chunk-ZTP6ZACR.js.map} +1 -1
  48. package/dist/{compact-session-3U2JYTVG.js → compact-session-5HMX6KYT.js} +3 -3
  49. package/dist/{compact-session-3U2JYTVG.js.map → compact-session-5HMX6KYT.js.map} +1 -1
  50. package/dist/{compact-session-NM56BREJ.cjs → compact-session-B7P6EU3Z.cjs} +12 -12
  51. package/dist/{compact-session-NM56BREJ.cjs.map → compact-session-B7P6EU3Z.cjs.map} +1 -1
  52. package/dist/{cron-BWDYetbq.d.cts → cron-BvxrLW5J.d.cts} +1 -1
  53. package/dist/{cron-CHn-F0fC.d.ts → cron-DdKzwJqK.d.ts} +1 -1
  54. package/dist/cron.cjs +5 -5
  55. package/dist/cron.d.cts +2 -2
  56. package/dist/cron.d.ts +2 -2
  57. package/dist/cron.js +4 -4
  58. package/dist/eval.cjs +9 -9
  59. package/dist/eval.js +4 -4
  60. package/dist/{executor-HKHT4CWS.cjs → executor-5QL5AXIZ.cjs} +18 -15
  61. package/dist/executor-5QL5AXIZ.cjs.map +1 -0
  62. package/dist/{executor-3D2UDJHW.js → executor-THUXNAFR.js} +6 -3
  63. package/dist/executor-THUXNAFR.js.map +1 -0
  64. package/dist/generate-object-A5F576IT.cjs +20 -0
  65. package/dist/{generate-object-XBWD2PU7.cjs.map → generate-object-A5F576IT.cjs.map} +1 -1
  66. package/dist/{generate-object-S7MNVF2V.js → generate-object-TBDOBBYW.js} +4 -4
  67. package/dist/{generate-object-S7MNVF2V.js.map → generate-object-TBDOBBYW.js.map} +1 -1
  68. package/dist/generate-object.d.ts +14 -1
  69. package/dist/index.cjs +43 -43
  70. package/dist/index.d.cts +30 -4
  71. package/dist/index.d.ts +30 -4
  72. package/dist/index.js +13 -13
  73. package/dist/{inject-session-THABTKJY.js → inject-session-75L3NCNL.js} +3 -3
  74. package/dist/{inject-session-THABTKJY.js.map → inject-session-75L3NCNL.js.map} +1 -1
  75. package/dist/{inject-session-JVTZNQF6.cjs → inject-session-WOH7TPDX.cjs} +4 -4
  76. package/dist/{inject-session-JVTZNQF6.cjs.map → inject-session-WOH7TPDX.cjs.map} +1 -1
  77. package/dist/internal/providers/discovery.d.ts +2 -2
  78. package/dist/internal/providers/trust-gate.d.ts +35 -0
  79. package/dist/internal/runtime/plugin-loader/manifest-entry-import.d.ts +17 -0
  80. package/dist/internal/runtime/plugin-loader/workspace-plugin-trust.d.ts +16 -0
  81. package/dist/internal/structured-output-helpers.d.ts +5 -2
  82. package/dist/sandbox/bwrap.d.cts +10 -8
  83. package/dist/sandbox/bwrap.d.ts +10 -8
  84. package/dist/sandbox/deny-read.d.cts +24 -0
  85. package/dist/sandbox/deny-read.d.ts +24 -0
  86. package/dist/sandbox/index.cjs +198 -46
  87. package/dist/sandbox/index.cjs.map +1 -1
  88. package/dist/sandbox/index.d.cts +2 -1
  89. package/dist/sandbox/index.d.ts +2 -1
  90. package/dist/sandbox/index.js +184 -36
  91. package/dist/sandbox/index.js.map +1 -1
  92. package/dist/sandbox/linux-sandbox.d.cts +40 -5
  93. package/dist/sandbox/linux-sandbox.d.ts +40 -5
  94. package/dist/sandbox/local-sandbox.d.cts +3 -1
  95. package/dist/sandbox/local-sandbox.d.ts +3 -1
  96. package/dist/sandbox/seccomp-delivery.d.cts +49 -0
  97. package/dist/sandbox/seccomp-delivery.d.ts +49 -0
  98. package/dist/sandbox/shell-escape.d.cts +14 -2
  99. package/dist/sandbox/shell-escape.d.ts +14 -2
  100. package/dist/sandbox/types.d.cts +45 -0
  101. package/dist/sandbox/types.d.ts +45 -0
  102. package/dist/stream-object-AS4YYM4B.cjs +20 -0
  103. package/dist/{stream-object-TEEK3CAX.cjs.map → stream-object-AS4YYM4B.cjs.map} +1 -1
  104. package/dist/stream-object-EKM4WGTI.js +7 -0
  105. package/dist/{stream-object-R6SMYV4R.js.map → stream-object-EKM4WGTI.js.map} +1 -1
  106. package/dist/stream-object.d.ts +14 -1
  107. package/dist/subagents-loader.d.cts +1 -1
  108. package/dist/subagents-loader.d.ts +1 -1
  109. package/dist/types/agent.d.ts +8 -1
  110. package/dist/workflow-as-tool.d.ts +39 -5
  111. package/dist/workflow-errors.d.ts +16 -0
  112. package/dist/workflow.cjs +31 -23
  113. package/dist/workflow.d.cts +54 -4
  114. package/dist/workflow.d.ts +54 -4
  115. package/dist/workflow.js +2 -2
  116. package/docs/error-codes.md +16 -13
  117. package/docs/harness-capability-map.md +51 -5
  118. package/package.json +1 -1
  119. package/dist/chunk-4YD2WI57.cjs.map +0 -1
  120. package/dist/chunk-AQW54OWQ.js.map +0 -1
  121. package/dist/chunk-BJ7BPLQK.js.map +0 -1
  122. package/dist/chunk-BO3PV3OP.js.map +0 -1
  123. package/dist/chunk-BRWI4HLK.cjs.map +0 -1
  124. package/dist/chunk-EEK7S77K.js.map +0 -1
  125. package/dist/chunk-FEAWEBWN.cjs.map +0 -1
  126. package/dist/chunk-HN4IKB6X.cjs.map +0 -1
  127. package/dist/chunk-LSWHDOCL.cjs.map +0 -1
  128. package/dist/chunk-Q6WT5535.cjs.map +0 -1
  129. package/dist/chunk-TLVI2OQK.cjs.map +0 -1
  130. package/dist/chunk-VVGFZQZC.js.map +0 -1
  131. package/dist/chunk-XJ4C4NFX.js.map +0 -1
  132. package/dist/chunk-XRPMZ7TO.js.map +0 -1
  133. package/dist/chunk-ZLFFDPXC.js.map +0 -1
  134. package/dist/chunk-ZWLFHSON.cjs.map +0 -1
  135. package/dist/executor-3D2UDJHW.js.map +0 -1
  136. package/dist/executor-HKHT4CWS.cjs.map +0 -1
  137. package/dist/generate-object-XBWD2PU7.cjs +0 -20
  138. package/dist/stream-object-R6SMYV4R.js +0 -7
  139. package/dist/stream-object-TEEK3CAX.cjs +0 -20
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { T as TheokitAgentError, E as ErrorMetadata } from './errors-base-B5g01neU.js';
2
2
  export { a as ErrorCode } from './errors-base-B5g01neU.js';
3
- import { A as AgentOptions, L as LocalOptions, S as SystemPromptResolver, C as CloudOptions, M as MemorySettings, a as AgentDefinition, b as SkillsSettings, c as ListAgentsOptions, d as ListResult, e as SDKAgentInfo, G as GetAgentOptions, f as ListRunsOptions, g as GetRunOptions, h as AgentOperationOptions, i as AgentDescription, P as Plugin$1, j as ProviderProfile, I as InlineSkill, k as Skill, B as BudgetTracker, l as MemoryProvider, m as PreToolCallDecision } from './agent-CVzDy_Oj.js';
4
- export { n as ActiveMemoryPassArgs, o as ActiveMemoryPassResult, p as AgentSubagentDescription, q as AgentToolDescription, r as BudgetCheck, s as BudgetTotal, t as BudgetUsageEvent, u as BuiltinToolName, v as CloudEnv, w as CloudRepo, x as CompatSource, y as CompatSourceAdapter, z as CompatSurface, D as CreateSkillSpec, H as HookApprovalGate, E as HookApprovalRequest, F as HookName, J as LlmCallContext, K as MemoryProviderAgentRef, N as MemoryProviderFactory, O as MemoryProviderHandle, Q as MemoryProviderInitOptions, R as PluginContext, T as PluginHookDisposer, U as PostAssistantReplyContext, V as PostToolCallContext, W as PreToolCallContext, X as PreUserSendContext, Y as PreUserSendResult, Z as ProviderTransform, _ as ProviderTransformContext, $ as RecordSessionSummaryArgs, a0 as SessionLifecycleContext, a1 as SessionRecord, a2 as SessionStore, a3 as SettingSource, a4 as Skill, a5 as SkillsResolver, a6 as SkillsResolverContext, a7 as SystemPromptContext, a8 as SystemPromptMemoryFact, a9 as TelemetrySettings, aa as ToolCallSummary, ab as ToolContext, ac as ToolResultTransformContext, ad as TransformContext } from './agent-CVzDy_Oj.js';
3
+ import { A as AgentOptions, L as LocalOptions, B as BuiltinToolName, M as MemorySettings, S as SystemPromptResolver, C as CloudOptions, a as AgentDefinition, b as SkillsSettings, c as ListAgentsOptions, d as ListResult, e as SDKAgentInfo, G as GetAgentOptions, f as ListRunsOptions, g as GetRunOptions, h as AgentOperationOptions, i as AgentDescription, P as Plugin$1, j as ProviderProfile, I as InlineSkill, k as Skill, l as BudgetTracker, m as MemoryProvider, n as PreToolCallDecision } from './agent-DSMuwADp.js';
4
+ export { o as ActiveMemoryPassArgs, p as ActiveMemoryPassResult, q as AgentSubagentDescription, r as AgentToolDescription, s as BudgetCheck, t as BudgetTotal, u as BudgetUsageEvent, v as CloudEnv, w as CloudRepo, x as CompatSource, y as CompatSourceAdapter, z as CompatSurface, D as CreateSkillSpec, H as HookApprovalGate, E as HookApprovalRequest, F as HookName, J as LlmCallContext, K as MemoryProviderAgentRef, N as MemoryProviderFactory, O as MemoryProviderHandle, Q as MemoryProviderInitOptions, R as PluginContext, T as PluginHookDisposer, U as PostAssistantReplyContext, V as PostToolCallContext, W as PreToolCallContext, X as PreUserSendContext, Y as PreUserSendResult, Z as ProviderTransform, _ as ProviderTransformContext, $ as RecordSessionSummaryArgs, a0 as SessionLifecycleContext, a1 as SessionRecord, a2 as SessionStore, a3 as SettingSource, a4 as Skill, a5 as SkillsResolver, a6 as SkillsResolverContext, a7 as SystemPromptContext, a8 as SystemPromptMemoryFact, a9 as TelemetrySettings, aa as ToolCallSummary, ab as ToolContext, ac as ToolResultTransformContext, ad as TransformContext } from './agent-DSMuwADp.js';
5
5
  import { ab as RunEvent, v as CostBreakdown, a_ as TokenUsage, R as RunResult, P as ProviderRoutingSettings, S as SDKAgent, M as McpServerConfig, C as ContextSettings, a as PluginsSettings, b as Run, c as Processor, J as JudgeResult, G as GoalOptions, d as GoalEvent, e as GoalResult, f as MemoryId, g as RunEventSink$1, h as SDKProvider, i as SDKMessage } from './sdk-agent-CTOJlWA_.js';
6
6
  export { A as AgentConversationTurn, j as AgentMemory, k as AgentOperation, l as AssistantMessage, m as CompletionCheck, n as CompletionCheckResult, o as ContextBudget, p as ContextManagerKind, q as ContextSnapshot, r as ContextSource, s as ContextSourceStatus, t as ConversationStep, u as ConversationTurn, v as CostBreakdown, w as CostSource, x as CostStatus, D as DoomLoopThresholds, E as EnvPolicy, F as ForkOptions, y as ForkResult, z as GenerateOptions, B as GenerateRunResult, I as InputProcessorContext, H as InteractionUpdate, K as InvalidateCacheOptions, L as McpAuthConfig, N as McpHttpServerConfig, O as McpOAuthConfig, Q as McpStdioServerConfig, T as MemoryAdapter, U as MemoryAdapterCapabilities, V as MemoryContext, W as MemoryFact, X as MemoryRevision, Y as MemoryToolSchema, Z as MemoryTurnMessage, _ as MessageOrigin, $ as OutputProcessorContext, a0 as PartialToolCallUpdate, a1 as PersonalityPreset, a2 as ProcessorControls, a3 as ProcessorTripwire, a4 as ProcessorViolation, a5 as ProviderCapability, a6 as ProviderRoute, a7 as ResolvedProviderRoute, a8 as RunCompactBoundaryEvent, a9 as RunCompletionCheckEvent, aa as RunErrorDetail, ab as RunEvent, ac as RunGitInfo, ad as RunMemoryDegradedEvent, ae as RunPermissionDeniedEvent, af as RunRateLimitEvent, ag as RunStatus, ah as RunTaskCompletedEvent, ai as RunTaskStartedEvent, aj as RunTaskUpdatedEvent, ak as RunTimelineEvent, al as RunToCompletionOptions, am as RunToCompletionResult, an as RunToolProgressEvent, ao as RunTripwireEvent, ap as RunUntilIterator, aq as SDKAgentPlugins, ar as SDKAgentSkillDetail, as as SDKAgentSkills, at as SDKArtifact, au as SDKAssistantMessage, av as SDKContextManager, aw as SDKImage, ax as SDKImageDimension, ay as SDKObjectDelta, az as SDKPluginMetadata, aA as SDKProvidersManager, aB as SDKRequestMessage, aC as SDKStatusMessage, aD as SDKSystemMessage, aE as SDKTaskMessage, aF as SDKThinkingMessage, aG as SDKToolUseMessage, aH as SDKUserMessage, aI as SDKUserMessageEvent, aJ as SendOptions, aK as ShellCommand, aL as ShellConversationTurn, aM as ShellOutput, aN as ShellOutputDeltaUpdate, aO as StepCompletedUpdate, aP as StepStartedUpdate, aQ as StreamToCompletionResult, aR as SummaryCompletedUpdate, aS as SummaryStartedUpdate, aT as SummaryUpdate, aU as SystemPromptSkillRef, aV as TextDeltaUpdate, aW as ThinkingCompletedUpdate, aX as ThinkingDeltaUpdate, aY as ThinkingMessage, aZ as TokenDeltaUpdate, a_ as TokenUsage, a$ as ToolCall, b0 as ToolCallCompletedUpdate, b1 as ToolCallStartedUpdate, b2 as ToolResult, b3 as ToolResultGuardOptions, b4 as ToolUseBlock, b5 as TurnEndedUpdate, b6 as UserMessage, b7 as UserMessageAppendedUpdate, b8 as Verdict } from './sdk-agent-CTOJlWA_.js';
7
7
  import * as zod from 'zod';
@@ -10,7 +10,7 @@ import { S as StructuredOutputError, B as BudgetOptions, a as BudgetHandle, b as
10
10
  export { A as AgentDisposedError, c as AgentRunError, d as AgentRunErrorCode, e as AuthenticationError, f as BudgetExceedEvent, g as BudgetExceededError, h as BudgetLimit, i as BudgetMode, j as BudgetScope, k as BudgetThresholdEvent, l as BudgetWindow, C as ConfigurationError, I as IntegrationNotConnectedError, m as InvalidTaskIdError, M as MemoryAdapterError, n as MemoryAdapterErrorCode, N as NetworkError, R as RateLimitError, T as TaskNotFoundError, U as UnknownAgentError, o as UnsupportedBudgetOperationError, p as UnsupportedRunOperationError, q as UnsupportedTaskOperationError, r as isTransientError } from './errors-Pf22PJJ-.js';
11
11
  import { M as ModelSelection, C as CustomTool, T as ToolResultContentBlock, P as PermissionMode } from './agent-prims-CZyxfCmS.js';
12
12
  export { I as ImageBlock, a as ModelParameterValue, R as RunOperation, b as TextBlock, c as ToolContextMessage } from './agent-prims-CZyxfCmS.js';
13
- export { C as Cron, a as CronCreateOptions, b as CronGetOptions, c as CronJob, d as CronJobStatus, e as CronListOptions, f as CronOperationOptions, g as CronRunOptions, h as CronRuntime, i as CronSchedulerStatus, j as CronStartOptions } from './cron-CHn-F0fC.js';
13
+ export { C as Cron, a as CronCreateOptions, b as CronGetOptions, c as CronJob, d as CronJobStatus, e as CronListOptions, f as CronOperationOptions, g as CronRunOptions, h as CronRuntime, i as CronSchedulerStatus, j as CronStartOptions } from './cron-DdKzwJqK.js';
14
14
  import { StepResult } from './workflow.js';
15
15
  export { Workflow, agentStep, fn } from './workflow.js';
16
16
 
@@ -242,6 +242,19 @@ interface StreamObjectOptions<T extends ZodType> {
242
242
  * when the right env key is set under a different provider name.
243
243
  */
244
244
  providers?: ProviderRoutingSettings;
245
+ /**
246
+ * Builtin tools removed from the transient agent's catalogue, forwarded to
247
+ * {@link AgentOptions.withheldBuiltinTools}. Absent ⇒ unchanged default: the agent holds
248
+ * `shell`. Pass `["shell"]` for a step that must only produce JSON. The `output` tool is
249
+ * never withheld.
250
+ */
251
+ withheldBuiltinTools?: readonly BuiltinToolName[];
252
+ /**
253
+ * Memory settings for the transient agent, forwarded to {@link AgentOptions.memory}.
254
+ * Absent ⇒ unchanged default (a session transcript is written). Pass `{ enabled: false }`
255
+ * for a step that must leave no transcript.
256
+ */
257
+ memory?: MemorySettings;
245
258
  }
246
259
  /**
247
260
  * Recursive partial — `T` where every nested field becomes optional.
@@ -340,6 +353,19 @@ interface GenerateObjectOptions<T extends ZodType> {
340
353
  * to raw.
341
354
  */
342
355
  errorStrategy?: "throw" | "return-partial" | "return-raw";
356
+ /**
357
+ * Builtin tools removed from every transient agent's catalogue (the reasoning-phase agent of
358
+ * `structuringModel` included), forwarded to {@link AgentOptions.withheldBuiltinTools}.
359
+ * Absent ⇒ unchanged default: the agent holds `shell`. Pass `["shell"]` for a step that must
360
+ * only produce JSON. The `output` tool is never withheld.
361
+ */
362
+ withheldBuiltinTools?: readonly BuiltinToolName[];
363
+ /**
364
+ * Memory settings for every transient agent of the call, forwarded to {@link AgentOptions.memory}.
365
+ * Absent ⇒ unchanged default (a session transcript is written). Pass `{ enabled: false }`
366
+ * for a step that must leave no transcript.
367
+ */
368
+ memory?: MemorySettings;
343
369
  }
344
370
  /**
345
371
  * Successful return from {@link Agent.generateObject}.
@@ -4492,4 +4518,4 @@ interface WiringRecordInput<K extends string> {
4492
4518
  */
4493
4519
  declare function recordWiring<K extends string>(input: WiringRecordInput<K>): Readonly<Record<K, WiredEntity>>;
4494
4520
 
4495
- export { Agent, AgentBuilder, type AgentBuilderDeps, AgentDefinition, type AgentDescription, AgentFactory, AgentOperationOptions, AgentOptions, type AgentPromptResult, type AgentRegistryOptions, type ApprovalDecision, type ApprovalInput, type ApprovalMode, type ApprovalOutcome, type ApprovalReason, type BatchItem, type BatchOptions, type BatchProgress, type BatchResult, type BlastRadiusDecision, type BlastRadiusInput, type BlastRadiusOutcome, type BlastRadiusReason, Budget, BudgetHandle, BudgetOptions, BudgetSnapshot, type BudgetTracker, CloudOptions, ContextSettings, type CounterBudgetTrackerOptions, type CredentialInput, type CredentialReport, type CustomTool, type DeclaredAction, type DeclaredLayer, type DeepPartial, type DefineProviderOptions, type DefineToolSpec, type DiagnosticsSink, type DreamingSweepOptions, type DreamingSweepResult, type EffectiveToolCatalog, type EnvOptOut, type EnvReachabilityAudit, type EnvReachabilityInput, ErrorMetadata, EventBus, type EvictReason, GOAL_CONTINUATION_MARKER, GenerateObjectError, type GenerateObjectOptions, type GenerateObjectResult, GetAgentOptions, GetRunOptions, GoalEvent, type GoalLoopAgent, GoalOptions, GoalResult, InlineSkill, JobQueue, type JobQueueOptions, JudgeCredentialError, type JudgeResult, type KeepReason, type KeptArtifact, LayerOrderError, type LayerValues, ListAgentsOptions, ListResult, ListRunsOptions, type LiveAgentRegistry, LiveSessionError, type LiveSessionReason, LocalOptions, type ManagedSettings, McpServerConfig, Memory, MemoryId, type MemoryProvider, MemorySettings, type MigrateOptions, type MigrateResult, type ModelListItem, type ModelParameterDefinition, ModelSelection, type ModelVariant, NoopMemoryProvider, type NormalizedJsonSchema, type OTelSpan, type PermissionAction, PermissionEngine, type PermissionEngineOptions, type PermissionFloorContext, type PermissionGate, type PermissionGateContext, type PermissionGateDecision, PermissionMode, PermissionPlugin, type PermissionPluginOptions, type PermissionRule, type PermissionRuleSet, Plugin, PluginsSettings, PreToolCallDecision, type Processor, Provider, type ProviderProfile, ProviderRoutingSettings, type ReadSessionMessagesOptions, type ReapPlan, type ReapPlanInput, type ReapableArtifact, type RetentionPolicy, RetentionPolicyError, Run, RunEventSink$1 as RunEventSink, RunResult, type SDKAgent, SDKAgentInfo, SDKMessage, type SDKModel, SDKProvider, type SDKRepository, type SDKUser, SOVEREIGN_ENV_KEYS, Security, type SecurityFloorInput, type SessionMessage, type SessionMessagePart, type SessionScope, type ShareGptMessage, type ShareGptTrajectory, SkillReadTool, SkillsSettings, type SovereignEnvKey, Squad, type SquadOptions, type SquadRun, StreamObjectError, type StreamObjectEvent, type StreamObjectOptions, SystemPromptResolver, TASK_RESERVED_PREFIXES, Task, type TaskCancelResult, type TaskConfigureOptions, type TaskEvent, type TaskFilter, type TaskHandle, type TaskKind, type TaskState, type TaskStoreOptions, type TaskSubmitOptions, type TaskWorkContext, type TaskWorkFn, type TelemetryHandle, Theokit, TheokitAgentError, type TheokitRequestOptions, TokenLimiter, type TokenLimiterOptions, Tool, ToolError, type ToolResultContentBlock, type TrustLevel, type TrustPosture, type TrustPostureInput, type TrustSource, UngatedCapabilityError, UnicodeNormalizer, type UnicodeNormalizerOptions, type UnresolvedToolSource, UsageAccumulator, type WiredEntity, type WiringRecordInput, type WithBlastRadius, applyMode, applySecurityFloor, auditEnvReachability, chargeAndCheckThresholds, computeCost, createCounterBudgetTracker, createTokenLimiter, createUnicodeNormalizer, decideApproval, describeAction, describeCredential, effectiveToolNames, emitRunEvent, estimateTokens, evaluateBlastRadius, extractRawId, foldLayers, getPricingEntry, guardSessionDestruction, inferApiMode, isInside, isValidTaskId, loadProjectEnv, managedSettingsPathFor, migrateSqliteToLance, mkMemoryId, normalizeSchema, normalizeUsage, parsePermissionRules, permissionFloorReason, planReaping, preflightCheck, readManagedSettings, readSessionMessages, recordWiring, resolveTrustPosture, runGoalLoop, scopedConversationId, sessionScopePrefix, setDiagnosticsSink, toShareGptTrajectory, verifyLayerOrdering, withBlastRadius, withCwdMutex };
4521
+ export { Agent, AgentBuilder, type AgentBuilderDeps, AgentDefinition, type AgentDescription, AgentFactory, AgentOperationOptions, AgentOptions, type AgentPromptResult, type AgentRegistryOptions, type ApprovalDecision, type ApprovalInput, type ApprovalMode, type ApprovalOutcome, type ApprovalReason, type BatchItem, type BatchOptions, type BatchProgress, type BatchResult, type BlastRadiusDecision, type BlastRadiusInput, type BlastRadiusOutcome, type BlastRadiusReason, Budget, BudgetHandle, BudgetOptions, BudgetSnapshot, type BudgetTracker, BuiltinToolName, CloudOptions, ContextSettings, type CounterBudgetTrackerOptions, type CredentialInput, type CredentialReport, type CustomTool, type DeclaredAction, type DeclaredLayer, type DeepPartial, type DefineProviderOptions, type DefineToolSpec, type DiagnosticsSink, type DreamingSweepOptions, type DreamingSweepResult, type EffectiveToolCatalog, type EnvOptOut, type EnvReachabilityAudit, type EnvReachabilityInput, ErrorMetadata, EventBus, type EvictReason, GOAL_CONTINUATION_MARKER, GenerateObjectError, type GenerateObjectOptions, type GenerateObjectResult, GetAgentOptions, GetRunOptions, GoalEvent, type GoalLoopAgent, GoalOptions, GoalResult, InlineSkill, JobQueue, type JobQueueOptions, JudgeCredentialError, type JudgeResult, type KeepReason, type KeptArtifact, LayerOrderError, type LayerValues, ListAgentsOptions, ListResult, ListRunsOptions, type LiveAgentRegistry, LiveSessionError, type LiveSessionReason, LocalOptions, type ManagedSettings, McpServerConfig, Memory, MemoryId, type MemoryProvider, MemorySettings, type MigrateOptions, type MigrateResult, type ModelListItem, type ModelParameterDefinition, ModelSelection, type ModelVariant, NoopMemoryProvider, type NormalizedJsonSchema, type OTelSpan, type PermissionAction, PermissionEngine, type PermissionEngineOptions, type PermissionFloorContext, type PermissionGate, type PermissionGateContext, type PermissionGateDecision, PermissionMode, PermissionPlugin, type PermissionPluginOptions, type PermissionRule, type PermissionRuleSet, Plugin, PluginsSettings, PreToolCallDecision, type Processor, Provider, type ProviderProfile, ProviderRoutingSettings, type ReadSessionMessagesOptions, type ReapPlan, type ReapPlanInput, type ReapableArtifact, type RetentionPolicy, RetentionPolicyError, Run, RunEventSink$1 as RunEventSink, RunResult, type SDKAgent, SDKAgentInfo, SDKMessage, type SDKModel, SDKProvider, type SDKRepository, type SDKUser, SOVEREIGN_ENV_KEYS, Security, type SecurityFloorInput, type SessionMessage, type SessionMessagePart, type SessionScope, type ShareGptMessage, type ShareGptTrajectory, SkillReadTool, SkillsSettings, type SovereignEnvKey, Squad, type SquadOptions, type SquadRun, StreamObjectError, type StreamObjectEvent, type StreamObjectOptions, SystemPromptResolver, TASK_RESERVED_PREFIXES, Task, type TaskCancelResult, type TaskConfigureOptions, type TaskEvent, type TaskFilter, type TaskHandle, type TaskKind, type TaskState, type TaskStoreOptions, type TaskSubmitOptions, type TaskWorkContext, type TaskWorkFn, type TelemetryHandle, Theokit, TheokitAgentError, type TheokitRequestOptions, TokenLimiter, type TokenLimiterOptions, Tool, ToolError, type ToolResultContentBlock, type TrustLevel, type TrustPosture, type TrustPostureInput, type TrustSource, UngatedCapabilityError, UnicodeNormalizer, type UnicodeNormalizerOptions, type UnresolvedToolSource, UsageAccumulator, type WiredEntity, type WiringRecordInput, type WithBlastRadius, applyMode, applySecurityFloor, auditEnvReachability, chargeAndCheckThresholds, computeCost, createCounterBudgetTracker, createTokenLimiter, createUnicodeNormalizer, decideApproval, describeAction, describeCredential, effectiveToolNames, emitRunEvent, estimateTokens, evaluateBlastRadius, extractRawId, foldLayers, getPricingEntry, guardSessionDestruction, inferApiMode, isInside, isValidTaskId, loadProjectEnv, managedSettingsPathFor, migrateSqliteToLance, mkMemoryId, normalizeSchema, normalizeUsage, parsePermissionRules, permissionFloorReason, planReaping, preflightCheck, readManagedSettings, readSessionMessages, recordWiring, resolveTrustPosture, runGoalLoop, scopedConversationId, sessionScopePrefix, setDiagnosticsSink, toShareGptTrajectory, verifyLayerOrdering, withBlastRadius, withCwdMutex };
package/dist/index.js CHANGED
@@ -1,19 +1,19 @@
1
- export { StreamObjectError } from './chunk-XRPMZ7TO.js';
1
+ export { StreamObjectError } from './chunk-CYWOJA6B.js';
2
2
  export { GOAL_CONTINUATION_MARKER } from './chunk-PY2RQOA7.js';
3
3
  export { JudgeCredentialError } from './chunk-XZKIAENA.js';
4
4
  import { migrateSqliteToLance, appendDiaryEntry } from './chunk-MSEL5E5P.js';
5
- export { GenerateObjectError } from './chunk-VVGFZQZC.js';
6
- import './chunk-AQW54OWQ.js';
7
- import { Workflow, agentStep } from './chunk-ZLFFDPXC.js';
8
- export { Workflow, agentStep, fn } from './chunk-ZLFFDPXC.js';
9
- import './chunk-BO3PV3OP.js';
5
+ export { GenerateObjectError } from './chunk-3LMVJTNJ.js';
6
+ import './chunk-DFBWYETS.js';
7
+ import { Workflow, agentStep } from './chunk-73IITAF7.js';
8
+ export { Workflow, agentStep, fn } from './chunk-73IITAF7.js';
9
+ import './chunk-TDED5XES.js';
10
10
  import './chunk-HY66GLM6.js';
11
- export { Cron } from './chunk-NJBJ3CUG.js';
12
- import { MEMORY_EMBEDDING_ADAPTERS, resolveSessionDir, DEFAULT_AGENTIC_MODEL_ID, Agent } from './chunk-BJ7BPLQK.js';
13
- export { Agent, AgentBuilder, Tool, ToolError, UsageAccumulator, computeCost, getPricingEntry, managedSettingsPathFor, readManagedSettings } from './chunk-BJ7BPLQK.js';
11
+ export { Cron } from './chunk-ZTP6ZACR.js';
12
+ import { MEMORY_EMBEDDING_ADAPTERS, resolveSessionDir, DEFAULT_AGENTIC_MODEL_ID, Agent } from './chunk-JX4LB6XO.js';
13
+ export { Agent, AgentBuilder, Tool, ToolError, UsageAccumulator, computeCost, getPricingEntry, managedSettingsPathFor, readManagedSettings } from './chunk-JX4LB6XO.js';
14
14
  import { configure, submit, list, get, cancel, subscribe } from './chunk-HWMGR3HA.js';
15
15
  export { emitRunEvent } from './chunk-HWMGR3HA.js';
16
- import './chunk-4GUFNDZR.js';
16
+ import './chunk-XOYNB3YN.js';
17
17
  import './chunk-K2BQQ445.js';
18
18
  import './chunk-2C24NSNV.js';
19
19
  import './chunk-HJ2LV464.js';
@@ -23,8 +23,8 @@ import './chunk-H73MEMQB.js';
23
23
  import './chunk-QK2ERTO3.js';
24
24
  import { resolveMemoryRoot, readFactsFromMarkdown } from './chunk-DF77RBF4.js';
25
25
  import { FsSessionStore } from './chunk-AB4OPJLD.js';
26
- import { discoverProviderPlugins, shouldUseFixtureMode, isFixtureApiKey, httpRequest, mapOllamaTransportError, readErrorResponseBody, mapOllamaHttpError } from './chunk-XJ4C4NFX.js';
27
- export { inferApiMode, normalizeUsage } from './chunk-XJ4C4NFX.js';
26
+ import { discoverProviderPlugins, shouldUseFixtureMode, isFixtureApiKey, httpRequest, mapOllamaTransportError, readErrorResponseBody, mapOllamaHttpError } from './chunk-2PRGRYEQ.js';
27
+ export { inferApiMode, normalizeUsage } from './chunk-2PRGRYEQ.js';
28
28
  import './chunk-5AR6O7GW.js';
29
29
  import './chunk-2XC6KDJM.js';
30
30
  import './chunk-ZJAYFSVI.js';
@@ -1929,7 +1929,7 @@ function isBuiltAgent(m) {
1929
1929
  return typeof m.send === "function";
1930
1930
  }
1931
1931
  async function materialize(def, index) {
1932
- const { Agent: Agent2 } = await import('./agent-IG7BP6GN.js');
1932
+ const { Agent: Agent2 } = await import('./agent-5DSDDH7K.js');
1933
1933
  return Agent2.create({
1934
1934
  // `AgentDefinition.model` admits the sentinel `'inherit'`, which is not a model id. Inheriting
1935
1935
  // here means "declare nothing and let the default apply" — forwarding the literal would create
@@ -1,4 +1,4 @@
1
- import { enqueueSessionWrite } from './chunk-4GUFNDZR.js';
1
+ import { enqueueSessionWrite } from './chunk-XOYNB3YN.js';
2
2
  import { invalidateSessionCache } from './chunk-2XC6KDJM.js';
3
3
  import './chunk-AGO5S5WD.js';
4
4
  import { SessionTranscript } from './chunk-XESYJ4JC.js';
@@ -23,5 +23,5 @@ async function injectSessionTurn(opts) {
23
23
  }
24
24
 
25
25
  export { injectSessionTurn };
26
- //# sourceMappingURL=inject-session-THABTKJY.js.map
27
- //# sourceMappingURL=inject-session-THABTKJY.js.map
26
+ //# sourceMappingURL=inject-session-75L3NCNL.js.map
27
+ //# sourceMappingURL=inject-session-75L3NCNL.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/internal/session/inject-session.ts"],"names":[],"mappings":";;;;;;;;;AAWA,eAAsB,kBAAkB,IAAA,EAMtB;AAChB,EAAA,MAAM,oBAAoB,IAAA,CAAK,GAAA,CAAI,KAAK,IAAA,CAAK,GAAA,CAAI,SAAS,YAAY;AACpE,IAAA,MAAM,QAAQ,MAAM,IAAA,CAAK,MAAM,WAAA,CAAY,IAAA,CAAK,IAAI,OAAO,CAAA;AAC3D,IAAA,MAAM,UAAA,GAAa,iBAAA,CAAkB,WAAA,CAAY,KAAA,EAAO;AAAA,MACtD,GAAA,EAAK,KAAK,GAAA,CAAI,GAAA;AAAA,MACd,WAAW,IAAA,CAAK,SAAA;AAAA,MAChB,KAAA,EAAO,IAAA,CAAK,GAAA,CAAI,KAAA,IAAS;AAAA,KAC1B,CAAA;AACD,IAAA,UAAA,CAAW,cAAA,CAAe,KAAK,QAAQ,CAAA;AACvC,IAAA,UAAA,CAAW,mBAAA,CAAoB,EAAE,IAAA,EAAM,IAAA,CAAK,eAAe,CAAA;AAC3D,IAAA,MAAM,IAAA,CAAK,KAAA,CAAM,aAAA,CAAc,IAAA,CAAK,GAAA,CAAI,OAAA,EAAS,UAAA,CAAW,OAAA,EAAQ,CAAE,KAAA,CAAM,KAAA,CAAM,MAAM,CAAC,CAAA;AACzF,IAAA,sBAAA,CAAuB,IAAA,CAAK,GAAA,CAAI,GAAA,EAAK,IAAA,CAAK,IAAI,OAAO,CAAA;AAAA,EACvD,CAAC,CAAA;AACH","file":"inject-session-THABTKJY.js","sourcesContent":["/**\n * M51 (agent-builder) — inject a SYNTHETIC user+assistant pair into a session's persisted transcript\n * WITHOUT running an LLM turn. This is the Codex review-exit mechanism (`exit_success.xml` appended to\n * the parent thread history so follow-ups like \"fix finding 2\" work): the pair chains onto the DAG\n * leaf (M50 pattern) and the in-memory cache is invalidated so the NEXT send re-hydrates with it.\n */\nimport type { SessionStore } from \"../../types/session-store.js\";\nimport { SessionTranscript } from \"../persistence/session-transcript.js\";\nimport { enqueueSessionWrite, invalidateSessionCache } from \"./agent-session.js\";\nimport type { CompactLocation } from \"./compact-session.js\";\n\nexport async function injectSessionTurn(opts: {\n store: SessionStore;\n loc: CompactLocation;\n sessionId: string;\n userText: string;\n assistantText: string;\n}): Promise<void> {\n await enqueueSessionWrite(opts.loc.cwd, opts.loc.agentId, async () => {\n const prior = await opts.store.readRecords(opts.loc.agentId);\n const transcript = SessionTranscript.fromRecords(prior, {\n cwd: opts.loc.cwd,\n sessionId: opts.sessionId,\n model: opts.loc.model ?? \"unknown\",\n });\n transcript.appendUserTurn(opts.userText);\n transcript.appendAssistantTurn({ text: opts.assistantText });\n await opts.store.appendRecords(opts.loc.agentId, transcript.records().slice(prior.length));\n invalidateSessionCache(opts.loc.cwd, opts.loc.agentId);\n });\n}\n"]}
1
+ {"version":3,"sources":["../src/internal/session/inject-session.ts"],"names":[],"mappings":";;;;;;;;;AAWA,eAAsB,kBAAkB,IAAA,EAMtB;AAChB,EAAA,MAAM,oBAAoB,IAAA,CAAK,GAAA,CAAI,KAAK,IAAA,CAAK,GAAA,CAAI,SAAS,YAAY;AACpE,IAAA,MAAM,QAAQ,MAAM,IAAA,CAAK,MAAM,WAAA,CAAY,IAAA,CAAK,IAAI,OAAO,CAAA;AAC3D,IAAA,MAAM,UAAA,GAAa,iBAAA,CAAkB,WAAA,CAAY,KAAA,EAAO;AAAA,MACtD,GAAA,EAAK,KAAK,GAAA,CAAI,GAAA;AAAA,MACd,WAAW,IAAA,CAAK,SAAA;AAAA,MAChB,KAAA,EAAO,IAAA,CAAK,GAAA,CAAI,KAAA,IAAS;AAAA,KAC1B,CAAA;AACD,IAAA,UAAA,CAAW,cAAA,CAAe,KAAK,QAAQ,CAAA;AACvC,IAAA,UAAA,CAAW,mBAAA,CAAoB,EAAE,IAAA,EAAM,IAAA,CAAK,eAAe,CAAA;AAC3D,IAAA,MAAM,IAAA,CAAK,KAAA,CAAM,aAAA,CAAc,IAAA,CAAK,GAAA,CAAI,OAAA,EAAS,UAAA,CAAW,OAAA,EAAQ,CAAE,KAAA,CAAM,KAAA,CAAM,MAAM,CAAC,CAAA;AACzF,IAAA,sBAAA,CAAuB,IAAA,CAAK,GAAA,CAAI,GAAA,EAAK,IAAA,CAAK,IAAI,OAAO,CAAA;AAAA,EACvD,CAAC,CAAA;AACH","file":"inject-session-75L3NCNL.js","sourcesContent":["/**\n * M51 (agent-builder) — inject a SYNTHETIC user+assistant pair into a session's persisted transcript\n * WITHOUT running an LLM turn. This is the Codex review-exit mechanism (`exit_success.xml` appended to\n * the parent thread history so follow-ups like \"fix finding 2\" work): the pair chains onto the DAG\n * leaf (M50 pattern) and the in-memory cache is invalidated so the NEXT send re-hydrates with it.\n */\nimport type { SessionStore } from \"../../types/session-store.js\";\nimport { SessionTranscript } from \"../persistence/session-transcript.js\";\nimport { enqueueSessionWrite, invalidateSessionCache } from \"./agent-session.js\";\nimport type { CompactLocation } from \"./compact-session.js\";\n\nexport async function injectSessionTurn(opts: {\n store: SessionStore;\n loc: CompactLocation;\n sessionId: string;\n userText: string;\n assistantText: string;\n}): Promise<void> {\n await enqueueSessionWrite(opts.loc.cwd, opts.loc.agentId, async () => {\n const prior = await opts.store.readRecords(opts.loc.agentId);\n const transcript = SessionTranscript.fromRecords(prior, {\n cwd: opts.loc.cwd,\n sessionId: opts.sessionId,\n model: opts.loc.model ?? \"unknown\",\n });\n transcript.appendUserTurn(opts.userText);\n transcript.appendAssistantTurn({ text: opts.assistantText });\n await opts.store.appendRecords(opts.loc.agentId, transcript.records().slice(prior.length));\n invalidateSessionCache(opts.loc.cwd, opts.loc.agentId);\n });\n}\n"]}
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkYOVZMN4P_cjs = require('./chunk-YOVZMN4P.cjs');
3
+ var chunkDVP3YMDA_cjs = require('./chunk-DVP3YMDA.cjs');
4
4
  var chunkYJNYDJ2T_cjs = require('./chunk-YJNYDJ2T.cjs');
5
5
  require('./chunk-MSW7LB2V.cjs');
6
6
  var chunk3WKWBYPO_cjs = require('./chunk-3WKWBYPO.cjs');
@@ -10,7 +10,7 @@ require('./chunk-RNXXYF22.cjs');
10
10
 
11
11
  // src/internal/session/inject-session.ts
12
12
  async function injectSessionTurn(opts) {
13
- await chunkYOVZMN4P_cjs.enqueueSessionWrite(opts.loc.cwd, opts.loc.agentId, async () => {
13
+ await chunkDVP3YMDA_cjs.enqueueSessionWrite(opts.loc.cwd, opts.loc.agentId, async () => {
14
14
  const prior = await opts.store.readRecords(opts.loc.agentId);
15
15
  const transcript = chunk3WKWBYPO_cjs.SessionTranscript.fromRecords(prior, {
16
16
  cwd: opts.loc.cwd,
@@ -25,5 +25,5 @@ async function injectSessionTurn(opts) {
25
25
  }
26
26
 
27
27
  exports.injectSessionTurn = injectSessionTurn;
28
- //# sourceMappingURL=inject-session-JVTZNQF6.cjs.map
29
- //# sourceMappingURL=inject-session-JVTZNQF6.cjs.map
28
+ //# sourceMappingURL=inject-session-WOH7TPDX.cjs.map
29
+ //# sourceMappingURL=inject-session-WOH7TPDX.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/internal/session/inject-session.ts"],"names":["enqueueSessionWrite","SessionTranscript","invalidateSessionCache"],"mappings":";;;;;;;;;;;AAWA,eAAsB,kBAAkB,IAAA,EAMtB;AAChB,EAAA,MAAMA,sCAAoB,IAAA,CAAK,GAAA,CAAI,KAAK,IAAA,CAAK,GAAA,CAAI,SAAS,YAAY;AACpE,IAAA,MAAM,QAAQ,MAAM,IAAA,CAAK,MAAM,WAAA,CAAY,IAAA,CAAK,IAAI,OAAO,CAAA;AAC3D,IAAA,MAAM,UAAA,GAAaC,mCAAA,CAAkB,WAAA,CAAY,KAAA,EAAO;AAAA,MACtD,GAAA,EAAK,KAAK,GAAA,CAAI,GAAA;AAAA,MACd,WAAW,IAAA,CAAK,SAAA;AAAA,MAChB,KAAA,EAAO,IAAA,CAAK,GAAA,CAAI,KAAA,IAAS;AAAA,KAC1B,CAAA;AACD,IAAA,UAAA,CAAW,cAAA,CAAe,KAAK,QAAQ,CAAA;AACvC,IAAA,UAAA,CAAW,mBAAA,CAAoB,EAAE,IAAA,EAAM,IAAA,CAAK,eAAe,CAAA;AAC3D,IAAA,MAAM,IAAA,CAAK,KAAA,CAAM,aAAA,CAAc,IAAA,CAAK,GAAA,CAAI,OAAA,EAAS,UAAA,CAAW,OAAA,EAAQ,CAAE,KAAA,CAAM,KAAA,CAAM,MAAM,CAAC,CAAA;AACzF,IAAAC,wCAAA,CAAuB,IAAA,CAAK,GAAA,CAAI,GAAA,EAAK,IAAA,CAAK,IAAI,OAAO,CAAA;AAAA,EACvD,CAAC,CAAA;AACH","file":"inject-session-JVTZNQF6.cjs","sourcesContent":["/**\n * M51 (agent-builder) — inject a SYNTHETIC user+assistant pair into a session's persisted transcript\n * WITHOUT running an LLM turn. This is the Codex review-exit mechanism (`exit_success.xml` appended to\n * the parent thread history so follow-ups like \"fix finding 2\" work): the pair chains onto the DAG\n * leaf (M50 pattern) and the in-memory cache is invalidated so the NEXT send re-hydrates with it.\n */\nimport type { SessionStore } from \"../../types/session-store.js\";\nimport { SessionTranscript } from \"../persistence/session-transcript.js\";\nimport { enqueueSessionWrite, invalidateSessionCache } from \"./agent-session.js\";\nimport type { CompactLocation } from \"./compact-session.js\";\n\nexport async function injectSessionTurn(opts: {\n store: SessionStore;\n loc: CompactLocation;\n sessionId: string;\n userText: string;\n assistantText: string;\n}): Promise<void> {\n await enqueueSessionWrite(opts.loc.cwd, opts.loc.agentId, async () => {\n const prior = await opts.store.readRecords(opts.loc.agentId);\n const transcript = SessionTranscript.fromRecords(prior, {\n cwd: opts.loc.cwd,\n sessionId: opts.sessionId,\n model: opts.loc.model ?? \"unknown\",\n });\n transcript.appendUserTurn(opts.userText);\n transcript.appendAssistantTurn({ text: opts.assistantText });\n await opts.store.appendRecords(opts.loc.agentId, transcript.records().slice(prior.length));\n invalidateSessionCache(opts.loc.cwd, opts.loc.agentId);\n });\n}\n"]}
1
+ {"version":3,"sources":["../src/internal/session/inject-session.ts"],"names":["enqueueSessionWrite","SessionTranscript","invalidateSessionCache"],"mappings":";;;;;;;;;;;AAWA,eAAsB,kBAAkB,IAAA,EAMtB;AAChB,EAAA,MAAMA,sCAAoB,IAAA,CAAK,GAAA,CAAI,KAAK,IAAA,CAAK,GAAA,CAAI,SAAS,YAAY;AACpE,IAAA,MAAM,QAAQ,MAAM,IAAA,CAAK,MAAM,WAAA,CAAY,IAAA,CAAK,IAAI,OAAO,CAAA;AAC3D,IAAA,MAAM,UAAA,GAAaC,mCAAA,CAAkB,WAAA,CAAY,KAAA,EAAO;AAAA,MACtD,GAAA,EAAK,KAAK,GAAA,CAAI,GAAA;AAAA,MACd,WAAW,IAAA,CAAK,SAAA;AAAA,MAChB,KAAA,EAAO,IAAA,CAAK,GAAA,CAAI,KAAA,IAAS;AAAA,KAC1B,CAAA;AACD,IAAA,UAAA,CAAW,cAAA,CAAe,KAAK,QAAQ,CAAA;AACvC,IAAA,UAAA,CAAW,mBAAA,CAAoB,EAAE,IAAA,EAAM,IAAA,CAAK,eAAe,CAAA;AAC3D,IAAA,MAAM,IAAA,CAAK,KAAA,CAAM,aAAA,CAAc,IAAA,CAAK,GAAA,CAAI,OAAA,EAAS,UAAA,CAAW,OAAA,EAAQ,CAAE,KAAA,CAAM,KAAA,CAAM,MAAM,CAAC,CAAA;AACzF,IAAAC,wCAAA,CAAuB,IAAA,CAAK,GAAA,CAAI,GAAA,EAAK,IAAA,CAAK,IAAI,OAAO,CAAA;AAAA,EACvD,CAAC,CAAA;AACH","file":"inject-session-WOH7TPDX.cjs","sourcesContent":["/**\n * M51 (agent-builder) — inject a SYNTHETIC user+assistant pair into a session's persisted transcript\n * WITHOUT running an LLM turn. This is the Codex review-exit mechanism (`exit_success.xml` appended to\n * the parent thread history so follow-ups like \"fix finding 2\" work): the pair chains onto the DAG\n * leaf (M50 pattern) and the in-memory cache is invalidated so the NEXT send re-hydrates with it.\n */\nimport type { SessionStore } from \"../../types/session-store.js\";\nimport { SessionTranscript } from \"../persistence/session-transcript.js\";\nimport { enqueueSessionWrite, invalidateSessionCache } from \"./agent-session.js\";\nimport type { CompactLocation } from \"./compact-session.js\";\n\nexport async function injectSessionTurn(opts: {\n store: SessionStore;\n loc: CompactLocation;\n sessionId: string;\n userText: string;\n assistantText: string;\n}): Promise<void> {\n await enqueueSessionWrite(opts.loc.cwd, opts.loc.agentId, async () => {\n const prior = await opts.store.readRecords(opts.loc.agentId);\n const transcript = SessionTranscript.fromRecords(prior, {\n cwd: opts.loc.cwd,\n sessionId: opts.sessionId,\n model: opts.loc.model ?? \"unknown\",\n });\n transcript.appendUserTurn(opts.userText);\n transcript.appendAssistantTurn({ text: opts.assistantText });\n await opts.store.appendRecords(opts.loc.agentId, transcript.records().slice(prior.length));\n invalidateSessionCache(opts.loc.cwd, opts.loc.agentId);\n });\n}\n"]}
@@ -3,8 +3,8 @@
3
3
  *
4
4
  * Scans `~/.theokit/plugins/model-providers/<name>/index.{js,mjs}` and
5
5
  * imports each as a Plugin. Plugins with `kind: "model-provider"` register
6
- * their profile. Errors per plugin are logged + skipped. Idempotent per
7
- * process.
6
+ * their profile. Errors per plugin are logged + skipped. Each plugin is
7
+ * imported at most once per process; the trust gate is read on every call.
8
8
  *
9
9
  * EC-9: dynamic `import()` in Node 22 needs `file://` URL for absolute
10
10
  * paths in ESM contexts. `pathToFileURL` handles both.
@@ -0,0 +1,35 @@
1
+ /**
2
+ * The trust gate for provider plugins loaded from disk (M47, B-686).
3
+ *
4
+ * Provider discovery (`discovery.ts`) reads this list of NAMES; it authorizes only
5
+ * `~/.theokit/plugins/model-providers/<name>/`, a folder in the operator's own home. Workspace
6
+ * manifest plugins never consult it: a cloned workspace chooses its folder names, so they are
7
+ * trusted by realpath in a record of their own (`runtime/plugin-loader/workspace-plugin-trust.ts`),
8
+ * which shares the fail-closed file reader below. Both are read on every call and never cached, so
9
+ * an entry the operator adds takes effect on the next `Agent.create` rather than after a restart.
10
+ *
11
+ * @internal
12
+ */
13
+ /** The explicit trust allowlist the human edits (M47). Fail-closed: missing/malformed ⇒ empty. */
14
+ export declare function trustFilePath(): string;
15
+ /**
16
+ * M47 — the trust gate for the dynamic-import surface. A plugin's entry executes arbitrary code
17
+ * at import time, so NOTHING is imported unless the human explicitly trusted the name: either in
18
+ * `~/.theokit/plugins/trusted-providers.json` (a JSON string array — the auditable primary, mirroring the
19
+ * approved-hooks posture) or the additive `THEOKIT_TRUSTED_PROVIDERS` env (comma-separated convenience).
20
+ * Fail-closed: a missing or malformed trust file trusts NOTHING (a malformed file WARNs).
21
+ */
22
+ export declare function readTrustedNames(): Set<string>;
23
+ /** What a trust file holds, as its fail-closed warnings name it. */
24
+ export interface TrustArrayShape {
25
+ /** What a malformed file leaves untrusted, e.g. "provider plugins". */
26
+ readonly subject: string;
27
+ /** What each entry must be, e.g. "plugin-name strings". */
28
+ readonly entries: string;
29
+ }
30
+ /**
31
+ * The non-empty strings in a JSON-array trust file. Fail-closed: a missing file is empty, and a
32
+ * malformed one (not JSON, not an array) is empty with a WARN; non-string entries are discarded
33
+ * with a WARN.
34
+ */
35
+ export declare function readTrustArray(path: string, shape: TrustArrayShape): string[];
@@ -0,0 +1,17 @@
1
+ /**
2
+ * B-686 — import the `entry` of each trusted workspace manifest plugin.
3
+ *
4
+ * `PluginsManager` lists a folder under `<cwd>/.theokit/plugins/<folder>/` whose `PLUGIN.md` names an
5
+ * `entry`; this step decides whether that code runs. The folder's realpath is checked against the
6
+ * workspace trust record (`workspace-plugin-trust.ts`) before any `import()`, never its name: a
7
+ * cloned workspace chooses its folder names, so a name in the provider trust list authorizes
8
+ * nothing here (review round 1, CWE-829). An untrusted folder's code is never evaluated, and it is
9
+ * diagnosed once per folder per process. A trusted entry whose import throws,
10
+ * or whose default export is not a general plugin, fails `Agent.create` with a typed error rather
11
+ * than being skipped: the operator trusted that code, so dropping it silently would hide a bug.
12
+ *
13
+ * @internal
14
+ */
15
+ import type { Plugin } from "../../plugins/types.js";
16
+ import type { ManifestEntryCandidate } from "./plugins-manager.js";
17
+ export declare function importTrustedManifestPlugins(candidates: ReadonlyArray<ManifestEntryCandidate>, trustedFolders: ReadonlySet<string>): Promise<Plugin[]>;
@@ -0,0 +1,16 @@
1
+ /**
2
+ * B-686 — the trust record for workspace manifest plugins.
3
+ *
4
+ * A folder under `<cwd>/.theokit/plugins/<folder>/` is code a cloned repository ships, and the
5
+ * repository chooses the folder's name. So the record is keyed on what the workspace cannot
6
+ * choose: the folder's absolute realpath, in `~/.theokit/plugins/trusted-workspace-plugins.json`
7
+ * (a JSON array). It is a record of its own: a name in the provider trust list
8
+ * (`providers/trust-gate.ts`) authorizes no workspace folder. Read on every call, never cached;
9
+ * fail-closed like the provider list, whose reader it shares.
10
+ *
11
+ * @internal
12
+ */
13
+ /** Beside the provider trust file, in `~/.theokit/plugins/`. */
14
+ export declare function workspaceTrustRecordPath(): string;
15
+ /** The folder realpaths the operator trusted; a relative entry is discarded with a WARN. */
16
+ export declare function readTrustedWorkspaceFolders(): Set<string>;
@@ -1,5 +1,5 @@
1
1
  import type { z as ZodNamespace, ZodType } from "zod";
2
- import type { AgentOptions, CustomTool, LocalOptions, ModelSelection } from "../types/agent.js";
2
+ import type { AgentOptions, BuiltinToolName, CustomTool, LocalOptions, MemorySettings, ModelSelection } from "../types/agent.js";
3
3
  import type { ProviderRoutingSettings } from "../types/providers.js";
4
4
  /**
5
5
  * Load Zod via createRequire (it's an optional peer dep). Throws a typed
@@ -15,7 +15,8 @@ export declare function requireZod(): typeof ZodNamespace;
15
15
  export declare function makeOutputTool(jsonSchema: Record<string, unknown>, onCapture: (input: unknown) => string | Promise<string> | undefined): CustomTool;
16
16
  /**
17
17
  * Assemble the AgentOptions for the transient agent. Shared shape:
18
- * model + local + tools[output] + systemPrompt + apiKey.
18
+ * model + local + tools[output] + systemPrompt + apiKey, plus the caller's withheld builtins
19
+ * and memory settings when supplied (B-678).
19
20
  */
20
21
  export declare function buildTransientAgentOptions(params: {
21
22
  model: string | ModelSelection;
@@ -24,6 +25,8 @@ export declare function buildTransientAgentOptions(params: {
24
25
  systemPrompt?: string;
25
26
  apiKey?: string;
26
27
  providers?: ProviderRoutingSettings;
28
+ withheldBuiltinTools?: readonly BuiltinToolName[];
29
+ memory?: MemorySettings;
27
30
  }): AgentOptions;
28
31
  /**
29
32
  * Best-effort extraction of token usage from a run result. Local runtimes
@@ -1,9 +1,10 @@
1
+ import type { BwrapDetection, SandboxMode } from "./types.js";
1
2
  /**
2
3
  * Codex's three canonical modes. Defined HERE because they are sandbox vocabulary, not consumer
3
4
  * configuration: `danger-full-access` means "do not wrap", and that is a decision belonging to the
4
5
  * confinement subsystem.
5
6
  */
6
- export type SandboxMode = "read-only" | "workspace-write" | "danger-full-access";
7
+ export type { SandboxMode } from "./types.js";
7
8
  /**
8
9
  * U-6 — the roots a mode may write to, answerable WITHOUT spawning anything.
9
10
  *
@@ -40,6 +41,13 @@ export interface BwrapArgvOptions {
40
41
  * sandboxed child. Omitted ⇒ inherit the parent env (backward-compatible; SDK scrub still applies).
41
42
  */
42
43
  env?: Record<string, string>;
44
+ /**
45
+ * Absolute paths the confined command must not read. Each is resolved through symlinks and masked
46
+ * after the writable binds: a directory becomes empty, a file reads as permission denied. A masked
47
+ * file still shows in the listing of its directory. Throws `TypeError` for a relative or missing
48
+ * path, one that contains the workspace, `/tmp` or `/`, and any list under `danger-full-access`.
49
+ */
50
+ denyReadPaths?: readonly string[];
43
51
  }
44
52
  /**
45
53
  * Pure argv builder. Returns the bwrap flags ending in `--` (caller appends `/bin/sh -c <cmd>`),
@@ -73,13 +81,7 @@ export interface BwrapProbes {
73
81
  * `try`/`catch` catches nothing; callers warn and fall back to an unconfined
74
82
  * `LocalSandbox`.
75
83
  */
76
- export type BwrapDetection = {
77
- ok: true;
78
- bin: string;
79
- } | {
80
- ok: false;
81
- reason: string;
82
- };
84
+ export type { BwrapDetection } from "./types.js";
83
85
  /** Honest detection — fail-closed on every probe; NEVER throws (callers WARN + fall back). */
84
86
  export declare function detectBwrap(probes?: BwrapProbes): BwrapDetection;
85
87
  /** How many real probes ran. TEST seam — the performance gate counts this. */
@@ -1,9 +1,10 @@
1
+ import type { BwrapDetection, SandboxMode } from "./types.js";
1
2
  /**
2
3
  * Codex's three canonical modes. Defined HERE because they are sandbox vocabulary, not consumer
3
4
  * configuration: `danger-full-access` means "do not wrap", and that is a decision belonging to the
4
5
  * confinement subsystem.
5
6
  */
6
- export type SandboxMode = "read-only" | "workspace-write" | "danger-full-access";
7
+ export type { SandboxMode } from "./types.js";
7
8
  /**
8
9
  * U-6 — the roots a mode may write to, answerable WITHOUT spawning anything.
9
10
  *
@@ -40,6 +41,13 @@ export interface BwrapArgvOptions {
40
41
  * sandboxed child. Omitted ⇒ inherit the parent env (backward-compatible; SDK scrub still applies).
41
42
  */
42
43
  env?: Record<string, string>;
44
+ /**
45
+ * Absolute paths the confined command must not read. Each is resolved through symlinks and masked
46
+ * after the writable binds: a directory becomes empty, a file reads as permission denied. A masked
47
+ * file still shows in the listing of its directory. Throws `TypeError` for a relative or missing
48
+ * path, one that contains the workspace, `/tmp` or `/`, and any list under `danger-full-access`.
49
+ */
50
+ denyReadPaths?: readonly string[];
43
51
  }
44
52
  /**
45
53
  * Pure argv builder. Returns the bwrap flags ending in `--` (caller appends `/bin/sh -c <cmd>`),
@@ -73,13 +81,7 @@ export interface BwrapProbes {
73
81
  * `try`/`catch` catches nothing; callers warn and fall back to an unconfined
74
82
  * `LocalSandbox`.
75
83
  */
76
- export type BwrapDetection = {
77
- ok: true;
78
- bin: string;
79
- } | {
80
- ok: false;
81
- reason: string;
82
- };
84
+ export type { BwrapDetection } from "./types.js";
83
85
  /** Honest detection — fail-closed on every probe; NEVER throws (callers WARN + fall back). */
84
86
  export declare function detectBwrap(probes?: BwrapProbes): BwrapDetection;
85
87
  /** How many real probes ran. TEST seam — the performance gate counts this. */
@@ -0,0 +1,24 @@
1
+ import type { BwrapDetection, SandboxMode } from "./types.js";
2
+ /**
3
+ * The bwrap flags that make each path in `paths` unreadable inside the sandbox: `--tmpfs` for a
4
+ * directory, `--ro-bind /dev/null` for a file. Callers place them after the writable binds so the
5
+ * mask wins over a path inside the workspace or `/tmp`.
6
+ *
7
+ * Every entry is resolved through symlinks first, so reading through a link is denied too, and
8
+ * duplicates collapse in list order. A masked file is still listed in its directory; only reading it
9
+ * fails.
10
+ *
11
+ * Throws `TypeError` (never skips) for a relative or missing entry, an entry that equals or contains
12
+ * the working directory, `/tmp` or `/`, and any non-empty list under `danger-full-access`, where no
13
+ * mask can be applied.
14
+ */
15
+ export declare function denyReadFlags(paths: readonly string[] | undefined, policy: {
16
+ mode: SandboxMode;
17
+ cwd: string;
18
+ }): string[];
19
+ /**
20
+ * Refuses a non-empty deny list that no confinement can honour, before a backend or a wrap exists:
21
+ * `danger-full-access` applies no sandbox (`TypeError`), and an undetected bubblewrap would fall back
22
+ * to an unconfined run, which is the leak the list exists to stop (`SandboxNotAvailableError`).
23
+ */
24
+ export declare function refuseUnhonourableDenyRead(paths: readonly string[] | undefined, mode: SandboxMode, detect: () => BwrapDetection): void;
@@ -0,0 +1,24 @@
1
+ import type { BwrapDetection, SandboxMode } from "./types.js";
2
+ /**
3
+ * The bwrap flags that make each path in `paths` unreadable inside the sandbox: `--tmpfs` for a
4
+ * directory, `--ro-bind /dev/null` for a file. Callers place them after the writable binds so the
5
+ * mask wins over a path inside the workspace or `/tmp`.
6
+ *
7
+ * Every entry is resolved through symlinks first, so reading through a link is denied too, and
8
+ * duplicates collapse in list order. A masked file is still listed in its directory; only reading it
9
+ * fails.
10
+ *
11
+ * Throws `TypeError` (never skips) for a relative or missing entry, an entry that equals or contains
12
+ * the working directory, `/tmp` or `/`, and any non-empty list under `danger-full-access`, where no
13
+ * mask can be applied.
14
+ */
15
+ export declare function denyReadFlags(paths: readonly string[] | undefined, policy: {
16
+ mode: SandboxMode;
17
+ cwd: string;
18
+ }): string[];
19
+ /**
20
+ * Refuses a non-empty deny list that no confinement can honour, before a backend or a wrap exists:
21
+ * `danger-full-access` applies no sandbox (`TypeError`), and an undetected bubblewrap would fall back
22
+ * to an unconfined run, which is the leak the list exists to stop (`SandboxNotAvailableError`).
23
+ */
24
+ export declare function refuseUnhonourableDenyRead(paths: readonly string[] | undefined, mode: SandboxMode, detect: () => BwrapDetection): void;