@theokit/sdk 5.1.0 → 5.2.1
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 +122 -0
- package/dist/{agent-ARLOD4JX.cjs → agent-GACKKINM.cjs} +7 -7
- package/dist/{agent-ARLOD4JX.cjs.map → agent-GACKKINM.cjs.map} +1 -1
- package/dist/{agent-N6WJ54ML.js → agent-VUNM33WJ.js} +6 -6
- package/dist/{agent-N6WJ54ML.js.map → agent-VUNM33WJ.js.map} +1 -1
- package/dist/{chunk-OYD3U3LY.js → chunk-43H4EBS2.js} +7 -7
- package/dist/{chunk-OYD3U3LY.js.map → chunk-43H4EBS2.js.map} +1 -1
- package/dist/{chunk-AW6F6HZR.js → chunk-AI4MXACC.js} +3 -3
- package/dist/{chunk-AW6F6HZR.js.map → chunk-AI4MXACC.js.map} +1 -1
- package/dist/{chunk-D3CCY3A2.cjs → chunk-DEJCKB65.cjs} +39 -39
- package/dist/{chunk-D3CCY3A2.cjs.map → chunk-DEJCKB65.cjs.map} +1 -1
- package/dist/{chunk-OQRGVTQF.js → chunk-DLFWMJE3.js} +3 -3
- package/dist/{chunk-OQRGVTQF.js.map → chunk-DLFWMJE3.js.map} +1 -1
- package/dist/{chunk-NYQ3IS7K.cjs → chunk-DWB3CN46.cjs} +8 -3
- package/dist/chunk-DWB3CN46.cjs.map +1 -0
- package/dist/{chunk-QYLZQ43D.cjs → chunk-IQBDR5YZ.cjs} +5 -5
- package/dist/{chunk-QYLZQ43D.cjs.map → chunk-IQBDR5YZ.cjs.map} +1 -1
- package/dist/{chunk-67SBTGMA.cjs → chunk-PEAOQMWE.cjs} +4 -4
- package/dist/{chunk-67SBTGMA.cjs.map → chunk-PEAOQMWE.cjs.map} +1 -1
- package/dist/{chunk-WMWEI3NS.js → chunk-RP3VXJMA.js} +8 -3
- package/dist/chunk-RP3VXJMA.js.map +1 -0
- package/dist/{chunk-KGANQYP7.cjs → chunk-SSIRPWWD.cjs} +5 -5
- package/dist/{chunk-KGANQYP7.cjs.map → chunk-SSIRPWWD.cjs.map} +1 -1
- package/dist/{chunk-XU6MLSC6.js → chunk-WHTMFN4Q.js} +3 -3
- package/dist/{chunk-XU6MLSC6.js.map → chunk-WHTMFN4Q.js.map} +1 -1
- package/dist/{context-4QOEWRDF.cjs → context-3YMZDEX5.cjs} +7 -7
- package/dist/{context-4QOEWRDF.cjs.map → context-3YMZDEX5.cjs.map} +1 -1
- package/dist/context-XNREEC7M.js +6 -0
- package/dist/{context-Z3CFTT3H.js.map → context-XNREEC7M.js.map} +1 -1
- package/dist/cron.cjs +6 -6
- package/dist/cron.js +5 -5
- package/dist/eval.cjs +5 -5
- package/dist/eval.js +4 -4
- package/dist/index.cjs +64 -21
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +66 -1
- package/dist/index.d.ts +66 -1
- package/dist/index.js +51 -9
- package/dist/index.js.map +1 -1
- package/dist/internal/persistence/index.cjs +4 -4
- package/dist/internal/persistence/index.js +1 -1
- package/dist/internal/runtime/compat/foreign-config-sources.d.ts +16 -6
- package/dist/subagents-loader-7G76XOZU.cjs +16 -0
- package/dist/{subagents-loader-GEHYCMEX.cjs.map → subagents-loader-7G76XOZU.cjs.map} +1 -1
- package/dist/subagents-loader-PAZVOZHI.js +7 -0
- package/dist/{subagents-loader-DOBTTICM.js.map → subagents-loader-PAZVOZHI.js.map} +1 -1
- package/dist/subagents-loader.cjs +3 -3
- package/dist/subagents-loader.js +2 -2
- package/docs/error-codes.md +2 -1
- package/docs/harness-capability-map.md +4 -1
- package/package.json +1 -1
- package/dist/chunk-NYQ3IS7K.cjs.map +0 -1
- package/dist/chunk-WMWEI3NS.js.map +0 -1
- package/dist/context-Z3CFTT3H.js +0 -6
- package/dist/subagents-loader-DOBTTICM.js +0 -7
- package/dist/subagents-loader-GEHYCMEX.cjs +0 -16
package/dist/index.d.cts
CHANGED
|
@@ -2125,6 +2125,71 @@ declare class NoopMemoryProvider {
|
|
|
2125
2125
|
static create(): MemoryProvider;
|
|
2126
2126
|
}
|
|
2127
2127
|
|
|
2128
|
+
/**
|
|
2129
|
+
* #583 — what tool names an agent built from these options will actually offer the model.
|
|
2130
|
+
*
|
|
2131
|
+
* ## The gap this closes
|
|
2132
|
+
*
|
|
2133
|
+
* `Agent.describe()` was the only reflection surface, and it builds its catalog as
|
|
2134
|
+
* `(agent.options.tools ?? [])` — literally the array the caller passed. The SDK's own builtins were
|
|
2135
|
+
* never in it. So the two states that matter most were indistinguishable:
|
|
2136
|
+
*
|
|
2137
|
+
* Agent.create({ tools: [] }) describe().tools = [] (holds a shell)
|
|
2138
|
+
* the same, withheldBuiltinTools: ["shell"] describe().tools = [] (holds nothing)
|
|
2139
|
+
*
|
|
2140
|
+
* A consumer trying to confirm that a role declared read-only really is one had no instrument. What
|
|
2141
|
+
* they had to do instead — measured, in a real session — was ask the agent to enumerate its own
|
|
2142
|
+
* catalog: needs a credential, needs the network, and returns the list the MODEL decided to write
|
|
2143
|
+
* rather than the one the runtime holds. The same session recorded a subagent answering *"I can't
|
|
2144
|
+
* run shell commands in this environment"* while its catalog listed `shell`. An attempt measures the
|
|
2145
|
+
* model's disposition; the catalog measures its authority.
|
|
2146
|
+
*
|
|
2147
|
+
* ## Why it takes options rather than an agent id
|
|
2148
|
+
*
|
|
2149
|
+
* The asked-for shape, and it is the right one: synchronous, credential-free, and answerable BEFORE
|
|
2150
|
+
* the agent runs — so a test can compare what it declared against what the runtime will declare.
|
|
2151
|
+
* `describe()` needs a registered agent and answers too late for that.
|
|
2152
|
+
*
|
|
2153
|
+
* ## Why it does not return a bare array
|
|
2154
|
+
*
|
|
2155
|
+
* Because a bare array reads as complete, and completeness is exactly what this cannot promise: MCP
|
|
2156
|
+
* tools need a live connection, plugin tools and the reasoning `think` tool are assembled per run.
|
|
2157
|
+
* Returning `string[]` would rebuild the defect one function over. `unresolved` names the sources
|
|
2158
|
+
* that were configured and could not be enumerated — and is EMPTY when none were, which is when the
|
|
2159
|
+
* list is genuinely the whole catalog.
|
|
2160
|
+
*
|
|
2161
|
+
* @public
|
|
2162
|
+
*/
|
|
2163
|
+
|
|
2164
|
+
/** A tool source that is configured but cannot be enumerated without running the agent. */
|
|
2165
|
+
type UnresolvedToolSource = "mcp" | "plugins" | "reasoning";
|
|
2166
|
+
/** The result of {@link effectiveToolNames}. */
|
|
2167
|
+
interface EffectiveToolCatalog {
|
|
2168
|
+
/**
|
|
2169
|
+
* Every tool name resolvable from the options alone: the builtins still registered after
|
|
2170
|
+
* withholding, plus the names of the custom tools declared.
|
|
2171
|
+
*/
|
|
2172
|
+
readonly names: readonly string[];
|
|
2173
|
+
/**
|
|
2174
|
+
* Sources that ARE configured and could not be enumerated here. Empty means `names` is the
|
|
2175
|
+
* complete catalog — which is the only condition under which it may be read as one.
|
|
2176
|
+
*/
|
|
2177
|
+
readonly unresolved: readonly UnresolvedToolSource[];
|
|
2178
|
+
}
|
|
2179
|
+
/**
|
|
2180
|
+
* The tool names an agent created with `options` will offer the model, as far as the options can say.
|
|
2181
|
+
*
|
|
2182
|
+
* Pure and synchronous: no credential, no network, no registration. Intended for a test that asserts
|
|
2183
|
+
* a role is as narrow as it claims.
|
|
2184
|
+
*
|
|
2185
|
+
* ```ts
|
|
2186
|
+
* const { names, unresolved } = effectiveToolNames({ tools: [], withheldBuiltinTools: ["shell"] });
|
|
2187
|
+
* expect(names).toEqual([]); // and `shell` is genuinely gone
|
|
2188
|
+
* expect(unresolved).toEqual([]); // nothing else could contribute, so [] is the whole catalog
|
|
2189
|
+
* ```
|
|
2190
|
+
*/
|
|
2191
|
+
declare function effectiveToolNames(options: AgentOptions): EffectiveToolCatalog;
|
|
2192
|
+
|
|
2128
2193
|
/**
|
|
2129
2194
|
* Task-id grammar (D368) — runtime, deliberately NOT in `types/`.
|
|
2130
2195
|
*
|
|
@@ -4163,4 +4228,4 @@ interface WiringRecordInput<K extends string> {
|
|
|
4163
4228
|
*/
|
|
4164
4229
|
declare function recordWiring<K extends string>(input: WiringRecordInput<K>): Readonly<Record<K, WiredEntity>>;
|
|
4165
4230
|
|
|
4166
|
-
export { Agent, AgentBuilder, 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 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, 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 PermissionGate, type PermissionGateContext, type PermissionGateDecision, PermissionMode, PermissionPlugin, type PermissionPluginOptions, type PermissionRule, 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, UsageAccumulator, type WiredEntity, type WiringRecordInput, type WithBlastRadius, applyMode, applySecurityFloor, auditEnvReachability, chargeAndCheckThresholds, computeCost, createCounterBudgetTracker, decideApproval, describeAction, describeCredential, emitRunEvent, estimateTokens, evaluateBlastRadius, extractRawId, foldLayers, getPricingEntry, guardSessionDestruction, inferApiMode, isValidTaskId, loadProjectEnv, migrateSqliteToLance, mkMemoryId, normalizeSchema, normalizeUsage, planReaping, preflightCheck, readSessionMessages, recordWiring, resolveTrustPosture, runGoalLoop, scopedConversationId, sessionScopePrefix, setDiagnosticsSink, toShareGptTrajectory, verifyLayerOrdering, withBlastRadius, withCwdMutex };
|
|
4231
|
+
export { Agent, AgentBuilder, 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, 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 PermissionGate, type PermissionGateContext, type PermissionGateDecision, PermissionMode, PermissionPlugin, type PermissionPluginOptions, type PermissionRule, 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, decideApproval, describeAction, describeCredential, effectiveToolNames, emitRunEvent, estimateTokens, evaluateBlastRadius, extractRawId, foldLayers, getPricingEntry, guardSessionDestruction, inferApiMode, isValidTaskId, loadProjectEnv, migrateSqliteToLance, mkMemoryId, normalizeSchema, normalizeUsage, planReaping, preflightCheck, readSessionMessages, recordWiring, resolveTrustPosture, runGoalLoop, scopedConversationId, sessionScopePrefix, setDiagnosticsSink, toShareGptTrajectory, verifyLayerOrdering, withBlastRadius, withCwdMutex };
|
package/dist/index.d.ts
CHANGED
|
@@ -2125,6 +2125,71 @@ declare class NoopMemoryProvider {
|
|
|
2125
2125
|
static create(): MemoryProvider;
|
|
2126
2126
|
}
|
|
2127
2127
|
|
|
2128
|
+
/**
|
|
2129
|
+
* #583 — what tool names an agent built from these options will actually offer the model.
|
|
2130
|
+
*
|
|
2131
|
+
* ## The gap this closes
|
|
2132
|
+
*
|
|
2133
|
+
* `Agent.describe()` was the only reflection surface, and it builds its catalog as
|
|
2134
|
+
* `(agent.options.tools ?? [])` — literally the array the caller passed. The SDK's own builtins were
|
|
2135
|
+
* never in it. So the two states that matter most were indistinguishable:
|
|
2136
|
+
*
|
|
2137
|
+
* Agent.create({ tools: [] }) describe().tools = [] (holds a shell)
|
|
2138
|
+
* the same, withheldBuiltinTools: ["shell"] describe().tools = [] (holds nothing)
|
|
2139
|
+
*
|
|
2140
|
+
* A consumer trying to confirm that a role declared read-only really is one had no instrument. What
|
|
2141
|
+
* they had to do instead — measured, in a real session — was ask the agent to enumerate its own
|
|
2142
|
+
* catalog: needs a credential, needs the network, and returns the list the MODEL decided to write
|
|
2143
|
+
* rather than the one the runtime holds. The same session recorded a subagent answering *"I can't
|
|
2144
|
+
* run shell commands in this environment"* while its catalog listed `shell`. An attempt measures the
|
|
2145
|
+
* model's disposition; the catalog measures its authority.
|
|
2146
|
+
*
|
|
2147
|
+
* ## Why it takes options rather than an agent id
|
|
2148
|
+
*
|
|
2149
|
+
* The asked-for shape, and it is the right one: synchronous, credential-free, and answerable BEFORE
|
|
2150
|
+
* the agent runs — so a test can compare what it declared against what the runtime will declare.
|
|
2151
|
+
* `describe()` needs a registered agent and answers too late for that.
|
|
2152
|
+
*
|
|
2153
|
+
* ## Why it does not return a bare array
|
|
2154
|
+
*
|
|
2155
|
+
* Because a bare array reads as complete, and completeness is exactly what this cannot promise: MCP
|
|
2156
|
+
* tools need a live connection, plugin tools and the reasoning `think` tool are assembled per run.
|
|
2157
|
+
* Returning `string[]` would rebuild the defect one function over. `unresolved` names the sources
|
|
2158
|
+
* that were configured and could not be enumerated — and is EMPTY when none were, which is when the
|
|
2159
|
+
* list is genuinely the whole catalog.
|
|
2160
|
+
*
|
|
2161
|
+
* @public
|
|
2162
|
+
*/
|
|
2163
|
+
|
|
2164
|
+
/** A tool source that is configured but cannot be enumerated without running the agent. */
|
|
2165
|
+
type UnresolvedToolSource = "mcp" | "plugins" | "reasoning";
|
|
2166
|
+
/** The result of {@link effectiveToolNames}. */
|
|
2167
|
+
interface EffectiveToolCatalog {
|
|
2168
|
+
/**
|
|
2169
|
+
* Every tool name resolvable from the options alone: the builtins still registered after
|
|
2170
|
+
* withholding, plus the names of the custom tools declared.
|
|
2171
|
+
*/
|
|
2172
|
+
readonly names: readonly string[];
|
|
2173
|
+
/**
|
|
2174
|
+
* Sources that ARE configured and could not be enumerated here. Empty means `names` is the
|
|
2175
|
+
* complete catalog — which is the only condition under which it may be read as one.
|
|
2176
|
+
*/
|
|
2177
|
+
readonly unresolved: readonly UnresolvedToolSource[];
|
|
2178
|
+
}
|
|
2179
|
+
/**
|
|
2180
|
+
* The tool names an agent created with `options` will offer the model, as far as the options can say.
|
|
2181
|
+
*
|
|
2182
|
+
* Pure and synchronous: no credential, no network, no registration. Intended for a test that asserts
|
|
2183
|
+
* a role is as narrow as it claims.
|
|
2184
|
+
*
|
|
2185
|
+
* ```ts
|
|
2186
|
+
* const { names, unresolved } = effectiveToolNames({ tools: [], withheldBuiltinTools: ["shell"] });
|
|
2187
|
+
* expect(names).toEqual([]); // and `shell` is genuinely gone
|
|
2188
|
+
* expect(unresolved).toEqual([]); // nothing else could contribute, so [] is the whole catalog
|
|
2189
|
+
* ```
|
|
2190
|
+
*/
|
|
2191
|
+
declare function effectiveToolNames(options: AgentOptions): EffectiveToolCatalog;
|
|
2192
|
+
|
|
2128
2193
|
/**
|
|
2129
2194
|
* Task-id grammar (D368) — runtime, deliberately NOT in `types/`.
|
|
2130
2195
|
*
|
|
@@ -4163,4 +4228,4 @@ interface WiringRecordInput<K extends string> {
|
|
|
4163
4228
|
*/
|
|
4164
4229
|
declare function recordWiring<K extends string>(input: WiringRecordInput<K>): Readonly<Record<K, WiredEntity>>;
|
|
4165
4230
|
|
|
4166
|
-
export { Agent, AgentBuilder, 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 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, 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 PermissionGate, type PermissionGateContext, type PermissionGateDecision, PermissionMode, PermissionPlugin, type PermissionPluginOptions, type PermissionRule, 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, UsageAccumulator, type WiredEntity, type WiringRecordInput, type WithBlastRadius, applyMode, applySecurityFloor, auditEnvReachability, chargeAndCheckThresholds, computeCost, createCounterBudgetTracker, decideApproval, describeAction, describeCredential, emitRunEvent, estimateTokens, evaluateBlastRadius, extractRawId, foldLayers, getPricingEntry, guardSessionDestruction, inferApiMode, isValidTaskId, loadProjectEnv, migrateSqliteToLance, mkMemoryId, normalizeSchema, normalizeUsage, planReaping, preflightCheck, readSessionMessages, recordWiring, resolveTrustPosture, runGoalLoop, scopedConversationId, sessionScopePrefix, setDiagnosticsSink, toShareGptTrajectory, verifyLayerOrdering, withBlastRadius, withCwdMutex };
|
|
4231
|
+
export { Agent, AgentBuilder, 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, 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 PermissionGate, type PermissionGateContext, type PermissionGateDecision, PermissionMode, PermissionPlugin, type PermissionPluginOptions, type PermissionRule, 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, decideApproval, describeAction, describeCredential, effectiveToolNames, emitRunEvent, estimateTokens, evaluateBlastRadius, extractRawId, foldLayers, getPricingEntry, guardSessionDestruction, inferApiMode, isValidTaskId, loadProjectEnv, migrateSqliteToLance, mkMemoryId, normalizeSchema, normalizeUsage, planReaping, preflightCheck, readSessionMessages, recordWiring, resolveTrustPosture, runGoalLoop, scopedConversationId, sessionScopePrefix, setDiagnosticsSink, toShareGptTrajectory, verifyLayerOrdering, withBlastRadius, withCwdMutex };
|
package/dist/index.js
CHANGED
|
@@ -8,15 +8,15 @@ 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 } from './chunk-
|
|
11
|
+
export { Cron } from './chunk-WHTMFN4Q.js';
|
|
12
|
+
import { MEMORY_EMBEDDING_ADAPTERS, resolveSessionDir, DEFAULT_AGENTIC_MODEL_ID, Agent } from './chunk-43H4EBS2.js';
|
|
13
|
+
export { Agent, AgentBuilder, Tool, ToolError, UsageAccumulator, computeCost, getPricingEntry } from './chunk-43H4EBS2.js';
|
|
14
14
|
import { configure, submit, list, get, cancel, subscribe } from './chunk-K2VMFZQ5.js';
|
|
15
15
|
export { emitRunEvent } from './chunk-K2VMFZQ5.js';
|
|
16
16
|
import './chunk-AWINL3ZC.js';
|
|
17
17
|
import './chunk-K2BQQ445.js';
|
|
18
18
|
import './chunk-7SZAV6QG.js';
|
|
19
|
-
import './chunk-
|
|
19
|
+
import './chunk-AI4MXACC.js';
|
|
20
20
|
import './chunk-2SFBB54R.js';
|
|
21
21
|
import './chunk-55GB6JYQ.js';
|
|
22
22
|
import './chunk-H73MEMQB.js';
|
|
@@ -55,8 +55,8 @@ import { withCwdMutex } from './chunk-Q5EWJPRY.js';
|
|
|
55
55
|
export { withCwdMutex } from './chunk-Q5EWJPRY.js';
|
|
56
56
|
export { TASK_RESERVED_PREFIXES, isValidTaskId } from './chunk-EIQFAOFD.js';
|
|
57
57
|
import { replaceFileAtomic } from './chunk-3JHIFQ4I.js';
|
|
58
|
-
import './chunk-
|
|
59
|
-
import './chunk-
|
|
58
|
+
import './chunk-DLFWMJE3.js';
|
|
59
|
+
import './chunk-RP3VXJMA.js';
|
|
60
60
|
import './chunk-JNAA4G4H.js';
|
|
61
61
|
import { estimateTokens, CHARS_PER_TOKEN } from './chunk-6M2OIS4Y.js';
|
|
62
62
|
export { estimateTokens } from './chunk-6M2OIS4Y.js';
|
|
@@ -67,7 +67,7 @@ import './chunk-AGACYRJ2.js';
|
|
|
67
67
|
import './chunk-JMDDYA22.js';
|
|
68
68
|
import './chunk-V22DZIXO.js';
|
|
69
69
|
import './chunk-NJWYQWDL.js';
|
|
70
|
-
import { BudgetExceededError, TheokitAgentError, MemoryAdapterError,
|
|
70
|
+
import { BudgetExceededError, ConfigurationError, TheokitAgentError, MemoryAdapterError, AuthenticationError } from './chunk-ALUN2B4W.js';
|
|
71
71
|
export { AgentDisposedError, AgentRunError, AuthenticationError, BudgetExceededError, ConfigurationError, IntegrationNotConnectedError, InvalidTaskIdError, MemoryAdapterError, NetworkError, RateLimitError, TaskNotFoundError, TheokitAgentError, UnknownAgentError, UnsupportedBudgetOperationError, UnsupportedRunOperationError, UnsupportedTaskOperationError, isTransientError } from './chunk-ALUN2B4W.js';
|
|
72
72
|
import { diag, redactSecrets, addPattern, resolveApiKey } from './chunk-CZJ6Q7CW.js';
|
|
73
73
|
export { setDiagnosticsSink } from './chunk-CZJ6Q7CW.js';
|
|
@@ -919,6 +919,48 @@ var NoopMemoryProvider = class {
|
|
|
919
919
|
return createNoopMemoryProvider();
|
|
920
920
|
}
|
|
921
921
|
};
|
|
922
|
+
|
|
923
|
+
// src/internal/runtime/validation/effective-tools.ts
|
|
924
|
+
var ALWAYS_REGISTERED = ["shell"];
|
|
925
|
+
var MEMORY_BUILTINS = ["memory_search", "memory_get"];
|
|
926
|
+
function effectiveToolNames(options) {
|
|
927
|
+
refuseCreatedTool(options);
|
|
928
|
+
return { names: resolvableNames(options), unresolved: unresolvableSources(options) };
|
|
929
|
+
}
|
|
930
|
+
function refuseCreatedTool(options) {
|
|
931
|
+
const candidate = options;
|
|
932
|
+
if (candidate.handler === void 0 || candidate.inputSchema === void 0) return;
|
|
933
|
+
throw new ConfigurationError(
|
|
934
|
+
`effectiveToolNames received a created tool${typeof candidate.name === "string" ? ` ("${candidate.name}")` : ""}, not AgentOptions. \`SubAgent.create()\` returns a CustomTool and closes its spec inside the handler, so the spec cannot be recovered from it. Pass the spec you built it from \u2014 keep it in a variable, or extract it into a function the test can call.`,
|
|
935
|
+
{ code: "effective_tools_expected_options" }
|
|
936
|
+
);
|
|
937
|
+
}
|
|
938
|
+
function resolvableNames(options) {
|
|
939
|
+
const withheld = new Set(options.withheldBuiltinTools ?? []);
|
|
940
|
+
const builtins = [
|
|
941
|
+
...ALWAYS_REGISTERED,
|
|
942
|
+
...options.memory?.enabled === true ? MEMORY_BUILTINS : []
|
|
943
|
+
];
|
|
944
|
+
return [
|
|
945
|
+
...builtins.filter((builtin) => !withheld.has(builtin)),
|
|
946
|
+
...(options.tools ?? []).map((tool) => tool.name)
|
|
947
|
+
];
|
|
948
|
+
}
|
|
949
|
+
function unresolvableSources(options) {
|
|
950
|
+
const unresolved = [];
|
|
951
|
+
if (options.mcpServers !== void 0 && Object.keys(options.mcpServers).length > 0) {
|
|
952
|
+
unresolved.push("mcp");
|
|
953
|
+
}
|
|
954
|
+
if (hasPlugins(options.plugins)) unresolved.push("plugins");
|
|
955
|
+
if (options.reasoning === true) unresolved.push("reasoning");
|
|
956
|
+
return unresolved;
|
|
957
|
+
}
|
|
958
|
+
function hasPlugins(plugins) {
|
|
959
|
+
if (plugins === void 0) return false;
|
|
960
|
+
if (Array.isArray(plugins)) return plugins.length > 0;
|
|
961
|
+
const enabled = plugins.enabled;
|
|
962
|
+
return enabled === void 0 || enabled.length > 0;
|
|
963
|
+
}
|
|
922
964
|
var JobQueue = class {
|
|
923
965
|
jobs = /* @__PURE__ */ new Map();
|
|
924
966
|
controllers = /* @__PURE__ */ new Map();
|
|
@@ -1750,7 +1792,7 @@ function isBuiltAgent(m) {
|
|
|
1750
1792
|
return typeof m.send === "function";
|
|
1751
1793
|
}
|
|
1752
1794
|
async function materialize(def, index) {
|
|
1753
|
-
const { Agent: Agent2 } = await import('./agent-
|
|
1795
|
+
const { Agent: Agent2 } = await import('./agent-VUNM33WJ.js');
|
|
1754
1796
|
return Agent2.create({
|
|
1755
1797
|
// `AgentDefinition.model` admits the sentinel `'inherit'`, which is not a model id. Inheriting
|
|
1756
1798
|
// here means "declare nothing and let the default apply" — forwarding the literal would create
|
|
@@ -2284,6 +2326,6 @@ function recordWiring(input) {
|
|
|
2284
2326
|
return record;
|
|
2285
2327
|
}
|
|
2286
2328
|
|
|
2287
|
-
export { AgentFactory, Budget, EventBus, JobQueue, LayerOrderError, LiveSessionError, Memory, NoopMemoryProvider, PermissionEngine, PermissionPlugin, Plugin, Provider, RetentionPolicyError, SOVEREIGN_ENV_KEYS, Security, Skill, SkillReadTool, Squad, Task, Theokit, TokenLimiter, UngatedCapabilityError, UnicodeNormalizer, applyMode, applySecurityFloor, auditEnvReachability, chargeAndCheckThresholds, createCounterBudgetTracker, decideApproval, describeAction, describeCredential, evaluateBlastRadius, extractRawId, foldLayers, guardSessionDestruction, inferApiMode, loadProjectEnv, migrateSqliteToLance2 as migrateSqliteToLance, mkMemoryId, normalizeSchema, normalizeUsage, planReaping, preflightCheck, readSessionMessages2 as readSessionMessages, recordWiring, resolveTrustPosture, runGoalLoop, scopedConversationId, sessionScopePrefix, toShareGptTrajectory, verifyLayerOrdering, withBlastRadius };
|
|
2329
|
+
export { AgentFactory, Budget, EventBus, JobQueue, LayerOrderError, LiveSessionError, Memory, NoopMemoryProvider, PermissionEngine, PermissionPlugin, Plugin, Provider, RetentionPolicyError, SOVEREIGN_ENV_KEYS, Security, Skill, SkillReadTool, Squad, Task, Theokit, TokenLimiter, UngatedCapabilityError, UnicodeNormalizer, applyMode, applySecurityFloor, auditEnvReachability, chargeAndCheckThresholds, createCounterBudgetTracker, decideApproval, describeAction, describeCredential, effectiveToolNames, evaluateBlastRadius, extractRawId, foldLayers, guardSessionDestruction, inferApiMode, loadProjectEnv, migrateSqliteToLance2 as migrateSqliteToLance, mkMemoryId, normalizeSchema, normalizeUsage, planReaping, preflightCheck, readSessionMessages2 as readSessionMessages, recordWiring, resolveTrustPosture, runGoalLoop, scopedConversationId, sessionScopePrefix, toShareGptTrajectory, verifyLayerOrdering, withBlastRadius };
|
|
2288
2330
|
//# sourceMappingURL=index.js.map
|
|
2289
2331
|
//# sourceMappingURL=index.js.map
|