@theokit/sdk 5.6.0 → 5.7.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 +66 -0
- package/dist/{agent-G6g-uwcB.d.ts → agent-Bqzdhkqr.d.ts} +1 -1
- package/dist/{agent-82d_DrCL.d.cts → agent-Dya5SmhY.d.cts} +1 -1
- package/dist/{agent-JJZM2VIK.js → agent-EQ5HKTWV.js} +11 -10
- package/dist/{agent-JJZM2VIK.js.map → agent-EQ5HKTWV.js.map} +1 -1
- package/dist/{agent-47NS6ZVL.cjs → agent-KA63WDQH.cjs} +12 -11
- package/dist/{agent-47NS6ZVL.cjs.map → agent-KA63WDQH.cjs.map} +1 -1
- package/dist/agent.d.ts +11 -0
- package/dist/{chunk-VUHXC74Q.cjs → chunk-33A27NFX.cjs} +15 -15
- package/dist/{chunk-VUHXC74Q.cjs.map → chunk-33A27NFX.cjs.map} +1 -1
- package/dist/{chunk-HUDNLFY4.js → chunk-3VXQEQE4.js} +13 -4
- package/dist/chunk-3VXQEQE4.js.map +1 -0
- package/dist/{chunk-DZG77WU7.cjs → chunk-3XSWF5AP.cjs} +3 -3
- package/dist/{chunk-DZG77WU7.cjs.map → chunk-3XSWF5AP.cjs.map} +1 -1
- package/dist/{chunk-FPIY5CLV.js → chunk-6JG2RFGK.js} +3 -3
- package/dist/{chunk-FPIY5CLV.js.map → chunk-6JG2RFGK.js.map} +1 -1
- package/dist/{chunk-N2KAIZ5D.js → chunk-7C3HWGCW.js} +3 -19
- package/dist/chunk-7C3HWGCW.js.map +1 -0
- package/dist/{chunk-LD6HASA5.cjs → chunk-7KBNBPFK.cjs} +12 -2
- package/dist/chunk-7KBNBPFK.cjs.map +1 -0
- package/dist/{chunk-GCHZMH42.cjs → chunk-A575WPBL.cjs} +88 -84
- package/dist/chunk-A575WPBL.cjs.map +1 -0
- package/dist/{chunk-5NELQ6LB.js → chunk-A6PDYH55.js} +12 -3
- package/dist/chunk-A6PDYH55.js.map +1 -0
- package/dist/{chunk-2QKV4CGK.js → chunk-CZWN4C6A.js} +3 -3
- package/dist/{chunk-2QKV4CGK.js.map → chunk-CZWN4C6A.js.map} +1 -1
- package/dist/chunk-DQNI52VV.js +20 -0
- package/dist/chunk-DQNI52VV.js.map +1 -0
- package/dist/{chunk-52FDUJSV.cjs → chunk-E6QXZZKE.cjs} +8 -8
- package/dist/{chunk-52FDUJSV.cjs.map → chunk-E6QXZZKE.cjs.map} +1 -1
- package/dist/{chunk-EIOMN5VA.cjs → chunk-EFETPSJZ.cjs} +17 -8
- package/dist/chunk-EFETPSJZ.cjs.map +1 -0
- package/dist/{chunk-HG4UN4MN.cjs → chunk-ER5BOIYD.cjs} +4 -4
- package/dist/{chunk-HG4UN4MN.cjs.map → chunk-ER5BOIYD.cjs.map} +1 -1
- package/dist/{chunk-2UXQASTX.js → chunk-FUUSIT2T.js} +16 -12
- package/dist/chunk-FUUSIT2T.js.map +1 -0
- package/dist/{chunk-7IZKTQ5G.cjs → chunk-GK3UG7YQ.cjs} +2 -21
- package/dist/chunk-GK3UG7YQ.cjs.map +1 -0
- package/dist/{chunk-GFFBXSQT.cjs → chunk-HNAYCTX4.cjs} +5 -5
- package/dist/{chunk-GFFBXSQT.cjs.map → chunk-HNAYCTX4.cjs.map} +1 -1
- package/dist/{chunk-KZSKIUXZ.js → chunk-N7VAE6DZ.js} +31 -3
- package/dist/chunk-N7VAE6DZ.js.map +1 -0
- package/dist/{chunk-7MMTZBTT.js → chunk-P5S3WCSZ.js} +3 -3
- package/dist/{chunk-7MMTZBTT.js.map → chunk-P5S3WCSZ.js.map} +1 -1
- package/dist/{chunk-BZ3YMAMP.js → chunk-R3LBRQAN.js} +3 -3
- package/dist/{chunk-BZ3YMAMP.js.map → chunk-R3LBRQAN.js.map} +1 -1
- package/dist/{chunk-STGSMJMJ.js → chunk-YRLI5DVC.js} +3 -3
- package/dist/{chunk-STGSMJMJ.js.map → chunk-YRLI5DVC.js.map} +1 -1
- package/dist/chunk-YYN6BB7R.cjs +24 -0
- package/dist/chunk-YYN6BB7R.cjs.map +1 -0
- package/dist/{chunk-C4ZQPWXJ.cjs → chunk-ZLMU5EU3.cjs} +33 -4
- package/dist/chunk-ZLMU5EU3.cjs.map +1 -0
- package/dist/{compact-session-7FMYJXQ7.cjs → compact-session-75KD2FCM.cjs} +15 -11
- package/dist/{compact-session-7FMYJXQ7.cjs.map → compact-session-75KD2FCM.cjs.map} +1 -1
- package/dist/{compact-session-YSEK7NQF.js → compact-session-QT6RJOKO.js} +3 -3
- package/dist/{compact-session-YSEK7NQF.js.map → compact-session-QT6RJOKO.js.map} +1 -1
- package/dist/context/index.cjs +11 -7
- package/dist/context/index.cjs.map +1 -1
- package/dist/context/index.js +7 -3
- package/dist/context/index.js.map +1 -1
- package/dist/{context-HR4KMXMA.cjs → context-7RP5JXGM.cjs} +7 -6
- package/dist/{context-HR4KMXMA.cjs.map → context-7RP5JXGM.cjs.map} +1 -1
- package/dist/context-OJIIXJCV.js +7 -0
- package/dist/{context-J5BJ3LBS.js.map → context-OJIIXJCV.js.map} +1 -1
- package/dist/{cron-DWv69ZSD.d.cts → cron-BwxDUscv.d.cts} +1 -1
- package/dist/{cron-GynWtAax.d.ts → cron-D8uB1Xh5.d.ts} +1 -1
- package/dist/cron.cjs +11 -10
- package/dist/cron.d.cts +2 -2
- package/dist/cron.d.ts +2 -2
- package/dist/cron.js +10 -9
- package/dist/eval.cjs +10 -9
- package/dist/eval.cjs.map +1 -1
- package/dist/eval.js +9 -8
- package/dist/eval.js.map +1 -1
- package/dist/{index-manager-BBHDKMQS.cjs → index-manager-W7RHSL6G.cjs} +6 -6
- package/dist/{index-manager-BBHDKMQS.cjs.map → index-manager-W7RHSL6G.cjs.map} +1 -1
- package/dist/{index-manager-27WLNQEE.js → index-manager-Z4XMRVWQ.js} +5 -5
- package/dist/{index-manager-27WLNQEE.js.map → index-manager-Z4XMRVWQ.js.map} +1 -1
- package/dist/index.cjs +42 -41
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +32 -3
- package/dist/index.d.ts +32 -3
- package/dist/index.js +14 -13
- package/dist/index.js.map +1 -1
- package/dist/{inject-session-PC73TMP2.cjs → inject-session-L6MIIELT.cjs} +4 -4
- package/dist/{inject-session-PC73TMP2.cjs.map → inject-session-L6MIIELT.cjs.map} +1 -1
- package/dist/{inject-session-J4LBWAPH.js → inject-session-XWWN4DAA.js} +3 -3
- package/dist/{inject-session-J4LBWAPH.js.map → inject-session-XWWN4DAA.js.map} +1 -1
- package/dist/internal/memory/storage/index.cjs +32 -32
- package/dist/internal/memory/storage/index.js +3 -3
- package/dist/internal/runtime/context/context-discovery.d.ts +27 -0
- package/dist/internal/session/compact-session.d.ts +36 -0
- package/dist/project.cjs +3 -3
- package/dist/project.js +1 -1
- package/dist/subagents-loader.d.cts +1 -1
- package/dist/subagents-loader.d.ts +1 -1
- package/dist/types/agent.d.ts +1 -1
- package/package.json +1 -1
- package/dist/chunk-2UXQASTX.js.map +0 -1
- package/dist/chunk-5NELQ6LB.js.map +0 -1
- package/dist/chunk-7IZKTQ5G.cjs.map +0 -1
- package/dist/chunk-C4ZQPWXJ.cjs.map +0 -1
- package/dist/chunk-EIOMN5VA.cjs.map +0 -1
- package/dist/chunk-GCHZMH42.cjs.map +0 -1
- package/dist/chunk-HUDNLFY4.js.map +0 -1
- package/dist/chunk-KZSKIUXZ.js.map +0 -1
- package/dist/chunk-LD6HASA5.cjs.map +0 -1
- package/dist/chunk-N2KAIZ5D.js.map +0 -1
- package/dist/context-J5BJ3LBS.js +0 -6
package/dist/index.d.cts
CHANGED
|
@@ -2,15 +2,15 @@ import { T as TheokitAgentError, E as ErrorMetadata } from './errors-base-B5g01n
|
|
|
2
2
|
export { a as ErrorCode } from './errors-base-B5g01neU.cjs';
|
|
3
3
|
import { F as RunEvent, j as CostBreakdown, at as TokenUsage, R as RunResult, M as ModelSelection, C as CustomTool, a as McpServerConfig, T as ToolResultContentBlock, b as Run, P as Processor, c as PermissionMode, d as RunEventSink$1, S as SDKMessage } from './run-CTAdRU3U.cjs';
|
|
4
4
|
export { A as AgentConversationTurn, e as AssistantMessage, f as CompletionCheck, g as CompletionCheckResult, h as ConversationStep, i as ConversationTurn, j as CostBreakdown, k as CostSource, l as CostStatus, D as DoomLoopThresholds, G as GenerateOptions, m as GenerateRunResult, I as ImageBlock, n as InputProcessorContext, o as InteractionUpdate, p as McpAuthConfig, q as McpHttpServerConfig, r as McpOAuthConfig, s as McpStdioServerConfig, t as MessageOrigin, u as ModelParameterValue, O as OutputProcessorContext, v as PartialToolCallUpdate, w as ProcessorControls, x as ProcessorTripwire, y as ProcessorViolation, z as RunCompactBoundaryEvent, B as RunCompletionCheckEvent, E as RunErrorDetail, F as RunEvent, H as RunGitInfo, J as RunMemoryDegradedEvent, K as RunOperation, L as RunPermissionDeniedEvent, N as RunRateLimitEvent, Q as RunStatus, U as RunTaskCompletedEvent, V as RunTaskStartedEvent, W as RunTaskUpdatedEvent, X as RunTimelineEvent, Y as RunToCompletionOptions, Z as RunToCompletionResult, _ as RunToolProgressEvent, $ as RunTripwireEvent, a0 as SDKAssistantMessage, a1 as SDKImage, a2 as SDKImageDimension, a3 as SDKObjectDelta, a4 as SDKRequestMessage, a5 as SDKStatusMessage, a6 as SDKSystemMessage, a7 as SDKTaskMessage, a8 as SDKThinkingMessage, a9 as SDKToolUseMessage, aa as SDKUserMessage, ab as SDKUserMessageEvent, ac as SendOptions, ad as ShellCommand, ae as ShellConversationTurn, af as ShellOutput, ag as ShellOutputDeltaUpdate, ah as StepCompletedUpdate, ai as StepStartedUpdate, aj as StreamToCompletionResult, ak as SummaryCompletedUpdate, al as SummaryStartedUpdate, am as SummaryUpdate, an as TextBlock, ao as TextDeltaUpdate, ap as ThinkingCompletedUpdate, aq as ThinkingDeltaUpdate, ar as ThinkingMessage, as as TokenDeltaUpdate, at as TokenUsage, au as ToolCall, av as ToolCallCompletedUpdate, aw as ToolCallStartedUpdate, ax as ToolContextMessage, ay as ToolResult, az as ToolResultGuardOptions, aA as ToolUseBlock, aB as TurnEndedUpdate, aC as UserMessage, aD as UserMessageAppendedUpdate } from './run-CTAdRU3U.cjs';
|
|
5
|
-
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-
|
|
6
|
-
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 HookName, E as MemoryProviderAgentRef, F as MemoryProviderFactory, J as MemoryProviderHandle, K as MemoryProviderInitOptions, N as PluginContext, O as PluginHookDisposer, Q as PostAssistantReplyContext, R as PostToolCallContext, T as PreToolCallContext, U as PreUserSendContext, V as PreUserSendResult, W as ProviderTransform, X as ProviderTransformContext, Y as RecordSessionSummaryArgs, Z as SessionLifecycleContext, _ as SessionRecord, $ as SessionStore, a0 as SettingSource, a1 as Skill, a2 as SkillsResolver, a3 as SkillsResolverContext, a4 as SystemPromptContext, a5 as SystemPromptMemoryFact, a6 as TelemetrySettings, a7 as ToolCallSummary, a8 as ToolResultTransformContext, a9 as TransformContext } from './agent-
|
|
5
|
+
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-Dya5SmhY.cjs';
|
|
6
|
+
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 HookName, E as MemoryProviderAgentRef, F as MemoryProviderFactory, J as MemoryProviderHandle, K as MemoryProviderInitOptions, N as PluginContext, O as PluginHookDisposer, Q as PostAssistantReplyContext, R as PostToolCallContext, T as PreToolCallContext, U as PreUserSendContext, V as PreUserSendResult, W as ProviderTransform, X as ProviderTransformContext, Y as RecordSessionSummaryArgs, Z as SessionLifecycleContext, _ as SessionRecord, $ as SessionStore, a0 as SettingSource, a1 as Skill, a2 as SkillsResolver, a3 as SkillsResolverContext, a4 as SystemPromptContext, a5 as SystemPromptMemoryFact, a6 as TelemetrySettings, a7 as ToolCallSummary, a8 as ToolResultTransformContext, a9 as TransformContext } from './agent-Dya5SmhY.cjs';
|
|
7
7
|
import * as zod from 'zod';
|
|
8
8
|
import { ZodType, z } from 'zod';
|
|
9
9
|
import { S as StructuredOutputError, B as BudgetOptions, a as BudgetHandle, b as BudgetSnapshot } from './errors-DrDEgyz1.cjs';
|
|
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-DrDEgyz1.cjs';
|
|
11
11
|
import { P as ProviderRoutingSettings, S as SDKAgent, C as ContextSettings, a as PluginsSettings, J as JudgeResult, G as GoalOptions, b as GoalEvent, c as GoalResult, M as MemoryId, d as SDKProvider } from './sdk-agent-BOiKqOgL.cjs';
|
|
12
12
|
export { A as AgentMemory, e as AgentOperation, f as ContextBudget, g as ContextManagerKind, h as ContextSnapshot, i as ContextSource, j as ContextSourceStatus, I as InvalidateCacheOptions, k as MemoryAdapter, l as MemoryAdapterCapabilities, m as MemoryContext, n as MemoryFact, o as MemoryRevision, p as MemoryToolSchema, q as MemoryTurnMessage, r as PersonalityPreset, s as ProviderCapability, t as ProviderRoute, R as ResolvedProviderRoute, u as RunUntilIterator, v as SDKAgentPlugins, w as SDKAgentSkillDetail, x as SDKAgentSkills, y as SDKArtifact, z as SDKContextManager, B as SDKPluginMetadata, D as SDKProvidersManager, E as SystemPromptSkillRef, V as Verdict } from './sdk-agent-BOiKqOgL.cjs';
|
|
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-
|
|
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-BwxDUscv.cjs';
|
|
14
14
|
import { StepResult } from './workflow.cjs';
|
|
15
15
|
export { Workflow, agentStep, fn } from './workflow.cjs';
|
|
16
16
|
|
|
@@ -79,6 +79,24 @@ interface CompactResult {
|
|
|
79
79
|
preTokens: number;
|
|
80
80
|
postTokens: number;
|
|
81
81
|
}
|
|
82
|
+
/**
|
|
83
|
+
* What a pre-compaction handler is told, and what it is given to bail out with.
|
|
84
|
+
*
|
|
85
|
+
* `trigger` is READ from the compaction that is happening, never inferred from the call site: the
|
|
86
|
+
* inference would be right today and silently wrong the first time a third caller appears.
|
|
87
|
+
*
|
|
88
|
+
* @public
|
|
89
|
+
*/
|
|
90
|
+
interface PreCompactContext {
|
|
91
|
+
/** The messages about to be summarised — what the handler gets a last look at. */
|
|
92
|
+
readonly messages: readonly CompressibleMessage[];
|
|
93
|
+
/** `manual` when a person asked, `auto` when a usage threshold did. */
|
|
94
|
+
readonly trigger: "manual" | "auto";
|
|
95
|
+
/** Aborted when the bound fires, so a long handler can stop rather than be merely ignored. */
|
|
96
|
+
readonly signal: AbortSignal;
|
|
97
|
+
}
|
|
98
|
+
/** @public */
|
|
99
|
+
type PreCompactHandler = (ctx: PreCompactContext) => void | Promise<void>;
|
|
82
100
|
|
|
83
101
|
/**
|
|
84
102
|
* Owner: `src/` (2 of 5 importers). Derived from the import graph, not declared —
|
|
@@ -822,6 +840,17 @@ declare class Agent {
|
|
|
822
840
|
static compact(agentId: string, options?: {
|
|
823
841
|
trigger?: "manual" | "auto";
|
|
824
842
|
summarize?: (messages: readonly CompressibleMessage[]) => Promise<string>;
|
|
843
|
+
/**
|
|
844
|
+
* B-082 — work to run before the transcript is rewritten, on THIS path.
|
|
845
|
+
*
|
|
846
|
+
* `/compact` reaches here, and before this option the seam existed only on the agents-layer
|
|
847
|
+
* strategy, which this path never touches. The handler is awaited, bounded, and its failure is
|
|
848
|
+
* reported without stopping compaction — the same contract `withPreCompaction` carries, not a
|
|
849
|
+
* second one.
|
|
850
|
+
*/
|
|
851
|
+
onPreCompact?: PreCompactHandler;
|
|
852
|
+
onPreCompactError?: (error: unknown) => void;
|
|
853
|
+
preCompactTimeoutMs?: number;
|
|
825
854
|
}): Promise<CompactResult>;
|
|
826
855
|
/**
|
|
827
856
|
* M51 — inject a SYNTHETIC user+assistant pair into a LOCAL session's persisted transcript WITHOUT
|
package/dist/index.d.ts
CHANGED
|
@@ -2,15 +2,15 @@ import { T as TheokitAgentError, E as ErrorMetadata } from './errors-base-B5g01n
|
|
|
2
2
|
export { a as ErrorCode } from './errors-base-B5g01neU.js';
|
|
3
3
|
import { F as RunEvent, j as CostBreakdown, at as TokenUsage, R as RunResult, M as ModelSelection, C as CustomTool, a as McpServerConfig, T as ToolResultContentBlock, b as Run, P as Processor, c as PermissionMode, d as RunEventSink$1, S as SDKMessage } from './run-CTAdRU3U.js';
|
|
4
4
|
export { A as AgentConversationTurn, e as AssistantMessage, f as CompletionCheck, g as CompletionCheckResult, h as ConversationStep, i as ConversationTurn, j as CostBreakdown, k as CostSource, l as CostStatus, D as DoomLoopThresholds, G as GenerateOptions, m as GenerateRunResult, I as ImageBlock, n as InputProcessorContext, o as InteractionUpdate, p as McpAuthConfig, q as McpHttpServerConfig, r as McpOAuthConfig, s as McpStdioServerConfig, t as MessageOrigin, u as ModelParameterValue, O as OutputProcessorContext, v as PartialToolCallUpdate, w as ProcessorControls, x as ProcessorTripwire, y as ProcessorViolation, z as RunCompactBoundaryEvent, B as RunCompletionCheckEvent, E as RunErrorDetail, F as RunEvent, H as RunGitInfo, J as RunMemoryDegradedEvent, K as RunOperation, L as RunPermissionDeniedEvent, N as RunRateLimitEvent, Q as RunStatus, U as RunTaskCompletedEvent, V as RunTaskStartedEvent, W as RunTaskUpdatedEvent, X as RunTimelineEvent, Y as RunToCompletionOptions, Z as RunToCompletionResult, _ as RunToolProgressEvent, $ as RunTripwireEvent, a0 as SDKAssistantMessage, a1 as SDKImage, a2 as SDKImageDimension, a3 as SDKObjectDelta, a4 as SDKRequestMessage, a5 as SDKStatusMessage, a6 as SDKSystemMessage, a7 as SDKTaskMessage, a8 as SDKThinkingMessage, a9 as SDKToolUseMessage, aa as SDKUserMessage, ab as SDKUserMessageEvent, ac as SendOptions, ad as ShellCommand, ae as ShellConversationTurn, af as ShellOutput, ag as ShellOutputDeltaUpdate, ah as StepCompletedUpdate, ai as StepStartedUpdate, aj as StreamToCompletionResult, ak as SummaryCompletedUpdate, al as SummaryStartedUpdate, am as SummaryUpdate, an as TextBlock, ao as TextDeltaUpdate, ap as ThinkingCompletedUpdate, aq as ThinkingDeltaUpdate, ar as ThinkingMessage, as as TokenDeltaUpdate, at as TokenUsage, au as ToolCall, av as ToolCallCompletedUpdate, aw as ToolCallStartedUpdate, ax as ToolContextMessage, ay as ToolResult, az as ToolResultGuardOptions, aA as ToolUseBlock, aB as TurnEndedUpdate, aC as UserMessage, aD as UserMessageAppendedUpdate } from './run-CTAdRU3U.js';
|
|
5
|
-
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-
|
|
6
|
-
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 HookName, E as MemoryProviderAgentRef, F as MemoryProviderFactory, J as MemoryProviderHandle, K as MemoryProviderInitOptions, N as PluginContext, O as PluginHookDisposer, Q as PostAssistantReplyContext, R as PostToolCallContext, T as PreToolCallContext, U as PreUserSendContext, V as PreUserSendResult, W as ProviderTransform, X as ProviderTransformContext, Y as RecordSessionSummaryArgs, Z as SessionLifecycleContext, _ as SessionRecord, $ as SessionStore, a0 as SettingSource, a1 as Skill, a2 as SkillsResolver, a3 as SkillsResolverContext, a4 as SystemPromptContext, a5 as SystemPromptMemoryFact, a6 as TelemetrySettings, a7 as ToolCallSummary, a8 as ToolResultTransformContext, a9 as TransformContext } from './agent-
|
|
5
|
+
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-Bqzdhkqr.js';
|
|
6
|
+
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 HookName, E as MemoryProviderAgentRef, F as MemoryProviderFactory, J as MemoryProviderHandle, K as MemoryProviderInitOptions, N as PluginContext, O as PluginHookDisposer, Q as PostAssistantReplyContext, R as PostToolCallContext, T as PreToolCallContext, U as PreUserSendContext, V as PreUserSendResult, W as ProviderTransform, X as ProviderTransformContext, Y as RecordSessionSummaryArgs, Z as SessionLifecycleContext, _ as SessionRecord, $ as SessionStore, a0 as SettingSource, a1 as Skill, a2 as SkillsResolver, a3 as SkillsResolverContext, a4 as SystemPromptContext, a5 as SystemPromptMemoryFact, a6 as TelemetrySettings, a7 as ToolCallSummary, a8 as ToolResultTransformContext, a9 as TransformContext } from './agent-Bqzdhkqr.js';
|
|
7
7
|
import * as zod from 'zod';
|
|
8
8
|
import { ZodType, z } from 'zod';
|
|
9
9
|
import { S as StructuredOutputError, B as BudgetOptions, a as BudgetHandle, b as BudgetSnapshot } from './errors-CLOAyuiv.js';
|
|
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-CLOAyuiv.js';
|
|
11
11
|
import { P as ProviderRoutingSettings, S as SDKAgent, C as ContextSettings, a as PluginsSettings, J as JudgeResult, G as GoalOptions, b as GoalEvent, c as GoalResult, M as MemoryId, d as SDKProvider } from './sdk-agent-D4a_BR_6.js';
|
|
12
12
|
export { A as AgentMemory, e as AgentOperation, f as ContextBudget, g as ContextManagerKind, h as ContextSnapshot, i as ContextSource, j as ContextSourceStatus, I as InvalidateCacheOptions, k as MemoryAdapter, l as MemoryAdapterCapabilities, m as MemoryContext, n as MemoryFact, o as MemoryRevision, p as MemoryToolSchema, q as MemoryTurnMessage, r as PersonalityPreset, s as ProviderCapability, t as ProviderRoute, R as ResolvedProviderRoute, u as RunUntilIterator, v as SDKAgentPlugins, w as SDKAgentSkillDetail, x as SDKAgentSkills, y as SDKArtifact, z as SDKContextManager, B as SDKPluginMetadata, D as SDKProvidersManager, E as SystemPromptSkillRef, V as Verdict } from './sdk-agent-D4a_BR_6.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-
|
|
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-D8uB1Xh5.js';
|
|
14
14
|
import { StepResult } from './workflow.js';
|
|
15
15
|
export { Workflow, agentStep, fn } from './workflow.js';
|
|
16
16
|
|
|
@@ -79,6 +79,24 @@ interface CompactResult {
|
|
|
79
79
|
preTokens: number;
|
|
80
80
|
postTokens: number;
|
|
81
81
|
}
|
|
82
|
+
/**
|
|
83
|
+
* What a pre-compaction handler is told, and what it is given to bail out with.
|
|
84
|
+
*
|
|
85
|
+
* `trigger` is READ from the compaction that is happening, never inferred from the call site: the
|
|
86
|
+
* inference would be right today and silently wrong the first time a third caller appears.
|
|
87
|
+
*
|
|
88
|
+
* @public
|
|
89
|
+
*/
|
|
90
|
+
interface PreCompactContext {
|
|
91
|
+
/** The messages about to be summarised — what the handler gets a last look at. */
|
|
92
|
+
readonly messages: readonly CompressibleMessage[];
|
|
93
|
+
/** `manual` when a person asked, `auto` when a usage threshold did. */
|
|
94
|
+
readonly trigger: "manual" | "auto";
|
|
95
|
+
/** Aborted when the bound fires, so a long handler can stop rather than be merely ignored. */
|
|
96
|
+
readonly signal: AbortSignal;
|
|
97
|
+
}
|
|
98
|
+
/** @public */
|
|
99
|
+
type PreCompactHandler = (ctx: PreCompactContext) => void | Promise<void>;
|
|
82
100
|
|
|
83
101
|
/**
|
|
84
102
|
* Owner: `src/` (2 of 5 importers). Derived from the import graph, not declared —
|
|
@@ -822,6 +840,17 @@ declare class Agent {
|
|
|
822
840
|
static compact(agentId: string, options?: {
|
|
823
841
|
trigger?: "manual" | "auto";
|
|
824
842
|
summarize?: (messages: readonly CompressibleMessage[]) => Promise<string>;
|
|
843
|
+
/**
|
|
844
|
+
* B-082 — work to run before the transcript is rewritten, on THIS path.
|
|
845
|
+
*
|
|
846
|
+
* `/compact` reaches here, and before this option the seam existed only on the agents-layer
|
|
847
|
+
* strategy, which this path never touches. The handler is awaited, bounded, and its failure is
|
|
848
|
+
* reported without stopping compaction — the same contract `withPreCompaction` carries, not a
|
|
849
|
+
* second one.
|
|
850
|
+
*/
|
|
851
|
+
onPreCompact?: PreCompactHandler;
|
|
852
|
+
onPreCompactError?: (error: unknown) => void;
|
|
853
|
+
preCompactTimeoutMs?: number;
|
|
825
854
|
}): Promise<CompactResult>;
|
|
826
855
|
/**
|
|
827
856
|
* M51 — inject a SYNTHETIC user+assistant pair into a LOCAL session's persisted transcript WITHOUT
|
package/dist/index.js
CHANGED
|
@@ -1,36 +1,37 @@
|
|
|
1
1
|
export { StreamObjectError } from './chunk-5WKQDIGO.js';
|
|
2
2
|
export { GOAL_CONTINUATION_MARKER } from './chunk-PY2RQOA7.js';
|
|
3
3
|
export { JudgeCredentialError } from './chunk-IUMAQURF.js';
|
|
4
|
-
import { migrateSqliteToLance, appendDiaryEntry } from './chunk-
|
|
4
|
+
import { migrateSqliteToLance, appendDiaryEntry } from './chunk-YRLI5DVC.js';
|
|
5
5
|
export { GenerateObjectError } from './chunk-44I6UYVH.js';
|
|
6
6
|
import './chunk-47TF32NQ.js';
|
|
7
7
|
import { Workflow, agentStep } from './chunk-HFEJE7AC.js';
|
|
8
8
|
export { Workflow, agentStep, fn } from './chunk-HFEJE7AC.js';
|
|
9
9
|
import './chunk-GBCVPKHE.js';
|
|
10
10
|
import './chunk-HY66GLM6.js';
|
|
11
|
-
export { Cron } from './chunk-
|
|
12
|
-
import { MEMORY_EMBEDDING_ADAPTERS, resolveSessionDir, DEFAULT_AGENTIC_MODEL_ID, Agent } from './chunk-
|
|
13
|
-
export { Agent, AgentBuilder, Tool, ToolError, UsageAccumulator, computeCost, getPricingEntry, managedSettingsPathFor, readManagedSettings } from './chunk-
|
|
11
|
+
export { Cron } from './chunk-6JG2RFGK.js';
|
|
12
|
+
import { MEMORY_EMBEDDING_ADAPTERS, resolveSessionDir, DEFAULT_AGENTIC_MODEL_ID, Agent } from './chunk-FUUSIT2T.js';
|
|
13
|
+
export { Agent, AgentBuilder, Tool, ToolError, UsageAccumulator, computeCost, getPricingEntry, managedSettingsPathFor, readManagedSettings } from './chunk-FUUSIT2T.js';
|
|
14
14
|
import { configure, submit, list, get, cancel, subscribe } from './chunk-K2VMFZQ5.js';
|
|
15
15
|
export { emitRunEvent } from './chunk-K2VMFZQ5.js';
|
|
16
|
-
import './chunk-
|
|
16
|
+
import './chunk-CZWN4C6A.js';
|
|
17
17
|
import './chunk-K2BQQ445.js';
|
|
18
|
-
import './chunk-
|
|
19
|
-
import './chunk-
|
|
18
|
+
import './chunk-P5S3WCSZ.js';
|
|
19
|
+
import './chunk-DQNI52VV.js';
|
|
20
20
|
import './chunk-2SFBB54R.js';
|
|
21
21
|
import './chunk-55GB6JYQ.js';
|
|
22
22
|
import './chunk-H73MEMQB.js';
|
|
23
23
|
import './chunk-OR6XIWLB.js';
|
|
24
|
-
import { resolveMemoryRoot, readFactsFromMarkdown } from './chunk-
|
|
24
|
+
import { resolveMemoryRoot, readFactsFromMarkdown } from './chunk-R3LBRQAN.js';
|
|
25
25
|
import { FsSessionStore } from './chunk-AAEZSPTC.js';
|
|
26
|
-
import { discoverProviderPlugins, shouldUseFixtureMode, isFixtureApiKey, httpRequest, mapOllamaTransportError, readErrorResponseBody, mapOllamaHttpError } from './chunk-
|
|
26
|
+
import { discoverProviderPlugins, shouldUseFixtureMode, isFixtureApiKey, httpRequest, mapOllamaTransportError, readErrorResponseBody, mapOllamaHttpError } from './chunk-N7VAE6DZ.js';
|
|
27
27
|
import './chunk-UBR5PWD7.js';
|
|
28
28
|
import './chunk-2XC6KDJM.js';
|
|
29
29
|
import './chunk-XB4GI5RZ.js';
|
|
30
30
|
import './chunk-24MGQDK3.js';
|
|
31
31
|
import { readSessionMessages } from './chunk-2WXHA33T.js';
|
|
32
32
|
import './chunk-HKCKOAIO.js';
|
|
33
|
-
import './chunk-
|
|
33
|
+
import './chunk-3VXQEQE4.js';
|
|
34
|
+
import './chunk-7C3HWGCW.js';
|
|
34
35
|
import './chunk-KVNWIAO4.js';
|
|
35
36
|
import './chunk-SVQIW5RJ.js';
|
|
36
37
|
import './chunk-FD2UT76F.js';
|
|
@@ -40,7 +41,7 @@ import './chunk-NAF4L3T6.js';
|
|
|
40
41
|
import './chunk-CFE6QF2Q.js';
|
|
41
42
|
import './chunk-6X6ID4MO.js';
|
|
42
43
|
import { stripSkillFrontmatter } from './chunk-CA5VUAP3.js';
|
|
43
|
-
import './chunk-
|
|
44
|
+
import './chunk-A6PDYH55.js';
|
|
44
45
|
import './chunk-SAGRF4IB.js';
|
|
45
46
|
import './chunk-EH6XD3FY.js';
|
|
46
47
|
import './chunk-UKMBRMGT.js';
|
|
@@ -1376,7 +1377,7 @@ var Memory = {
|
|
|
1376
1377
|
openArgs.embedding = await resolveEmbedding(opts.embedding, peer.MEMORY_EMBEDDING_ADAPTERS);
|
|
1377
1378
|
return await peer.IndexManager.open(openArgs);
|
|
1378
1379
|
}
|
|
1379
|
-
const { IndexManager } = await import('./index-manager-
|
|
1380
|
+
const { IndexManager } = await import('./index-manager-Z4XMRVWQ.js');
|
|
1380
1381
|
openArgs.embedding = await resolveEmbedding(opts.embedding, MEMORY_EMBEDDING_ADAPTERS);
|
|
1381
1382
|
return await IndexManager.open(openArgs);
|
|
1382
1383
|
},
|
|
@@ -2015,7 +2016,7 @@ function isBuiltAgent(m) {
|
|
|
2015
2016
|
return typeof m.send === "function";
|
|
2016
2017
|
}
|
|
2017
2018
|
async function materialize(def, index) {
|
|
2018
|
-
const { Agent: Agent2 } = await import('./agent-
|
|
2019
|
+
const { Agent: Agent2 } = await import('./agent-EQ5HKTWV.js');
|
|
2019
2020
|
return Agent2.create({
|
|
2020
2021
|
// `AgentDefinition.model` admits the sentinel `'inherit'`, which is not a model id. Inheriting
|
|
2021
2022
|
// here means "declare nothing and let the default apply" — forwarding the literal would create
|