@theokit/sdk 4.47.0 → 4.49.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/dist/index.d.cts CHANGED
@@ -1263,6 +1263,63 @@ declare class Tool {
1263
1263
  static create<T extends ZodType, O extends ZodType = never>(spec: DefineToolSpec<T, O>): CustomTool;
1264
1264
  }
1265
1265
 
1266
+ /**
1267
+ * Audit whether every configuration key can be set from the environment, or says why not.
1268
+ *
1269
+ * A key settable only by editing a file cannot be set in CI, in a container, or for a single
1270
+ * invocation. That is usually an oversight rather than a decision, and it is invisible — nothing
1271
+ * fails, the key simply has no environment path, and nobody notices until someone needs one.
1272
+ *
1273
+ * The opposite failure rots more quietly. An opt-out written for a key that has since gained an
1274
+ * environment path, or for a key that no longer exists, still reads as a considered decision while
1275
+ * exempting nothing. Both questions are answered by one call so a consumer cannot check the gap and
1276
+ * forget the rot: they fail for opposite reasons, and a suite that asks only one looks complete.
1277
+ *
1278
+ * ## Why the framework owns the rule and not the keys
1279
+ *
1280
+ * A framework cannot enumerate a consumer's configuration keys, and should not try. Which keys exist
1281
+ * is that product's vocabulary — the same reason the security floor takes its permissiveness order
1282
+ * as data and the trust posture takes its capability list. So the consumer ranges over its own keys
1283
+ * with this, rather than registering them here.
1284
+ *
1285
+ * That is a narrower claim than "reachability is checked in the framework", and it is the honest
1286
+ * one: the failure still surfaces in the consumer's own suite. What the consumer no longer writes is
1287
+ * the detector, which is where the subtlety lives — the stale-opt-out half is the part everyone
1288
+ * forgets.
1289
+ *
1290
+ * @public
1291
+ */
1292
+ /** A key deliberately left off the environment, with the reason and what would reverse it. @public */
1293
+ interface EnvOptOut {
1294
+ readonly key: string;
1295
+ /** Why an environment variable is the wrong shape for this key. */
1296
+ readonly reason: string;
1297
+ /** What would make this opt-out obsolete. An opt-out with no exit is a permanent excuse. */
1298
+ readonly exitCriterion: string;
1299
+ }
1300
+ /** @public */
1301
+ interface EnvReachabilityInput {
1302
+ /** Every configuration key the product declares. */
1303
+ readonly keys: readonly string[];
1304
+ /** The subset that an environment variable can set. */
1305
+ readonly reachable: readonly string[];
1306
+ /** Documented exemptions for keys that deliberately have no environment path. */
1307
+ readonly optOuts: readonly EnvOptOut[];
1308
+ }
1309
+ /** @public */
1310
+ interface EnvReachabilityAudit {
1311
+ /** Keys with neither an environment path nor a documented opt-out. */
1312
+ readonly unreachable: readonly string[];
1313
+ /** Opt-outs that exempt nothing: the key gained an environment path, or no longer exists. */
1314
+ readonly staleOptOuts: readonly string[];
1315
+ }
1316
+ /**
1317
+ * @returns both axes, in the order the caller declared them — a stable order so a failure message
1318
+ * does not change between runs for reasons unrelated to the code.
1319
+ * @public
1320
+ */
1321
+ declare function auditEnvReachability(input: EnvReachabilityInput): EnvReachabilityAudit;
1322
+
1266
1323
  /**
1267
1324
  * `EventBus` — typed EventEmitter wrapper.
1268
1325
  *
@@ -2759,4 +2816,80 @@ interface TrustPosture<K extends string> {
2759
2816
  /** @public */
2760
2817
  declare function resolveTrustPosture<K extends string>(input: TrustPostureInput<K>): TrustPosture<K>;
2761
2818
 
2762
- export { Agent, AgentBuilder, AgentDefinition, AgentDescription, AgentFactory, AgentOperationOptions, AgentOptions, type AgentPromptResult, type AgentRegistryOptions, type BatchItem, type BatchOptions, type BatchProgress, type BatchResult, Budget, BudgetHandle, BudgetOptions, BudgetSnapshot, BudgetTracker, CloudOptions, ContextSettings, type CounterBudgetTrackerOptions, CustomTool, type DeclaredLayer, type DeepPartial, type DefineProviderOptions, type DefineToolSpec, type DiagnosticsSink, type DreamingSweepOptions, type DreamingSweepResult, ErrorMetadata, EventBus, type EvictReason, GOAL_CONTINUATION_MARKER, GenerateObjectError, type GenerateObjectOptions, type GenerateObjectResult, GetAgentOptions, GetRunOptions, GoalEvent, type GoalLoopAgent, GoalOptions, GoalResult, InlineSkill, JobQueue, type JobQueueOptions, JudgeCredentialError, JudgeResult, LayerOrderError, type LayerValues, ListAgentsOptions, ListResult, ListRunsOptions, LiveAgentRegistry, LocalOptions, McpServerConfig, Memory, MemoryId, MemoryProvider, MemorySettings, type MigrateOptions, type MigrateResult, type ModelListItem, type ModelParameterDefinition, ModelSelection, type ModelVariant, NoopMemoryProvider, type NormalizedJsonSchema, PermissionEngine, type PermissionGate, type PermissionGateContext, type PermissionGateDecision, PermissionMode, PermissionPlugin, type PermissionPluginOptions, Plugin, PluginsSettings, PreToolCallDecision, Processor, Provider, ProviderProfile, ProviderRoutingSettings, Run, RunEventSink, RunResult, 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, Theokit, TheokitAgentError, type TheokitRequestOptions, TokenLimiter, type TokenLimiterOptions, Tool, ToolError, ToolResultContentBlock, type TrustLevel, type TrustPosture, type TrustPostureInput, type TrustSource, UnicodeNormalizer, type UnicodeNormalizerOptions, UsageAccumulator, applySecurityFloor, chargeAndCheckThresholds, computeCost, createCounterBudgetTracker, estimateTokens, extractRawId, foldLayers, getPricingEntry, inferApiMode, isValidTaskId, loadProjectEnv, migrateSqliteToLance, mkMemoryId, normalizeSchema, normalizeUsage, preflightCheck, resolveTrustPosture, runGoalLoop, scopedConversationId, sessionScopePrefix, setDiagnosticsSink, toShareGptTrajectory, verifyLayerOrdering, withCwdMutex };
2819
+ /**
2820
+ * Record what a build actually wired, as opposed to what configuration asked for.
2821
+ *
2822
+ * A product that reads a project directory decides, while building, which of that directory's
2823
+ * entities it will honour: MCP servers, skills, hook events, commands. When a trust posture withholds
2824
+ * them, the build simply proceeds with fewer — and every surface that later asks "what is loaded?"
2825
+ * sees an empty list. Empty because nothing was configured and empty because everything was withheld
2826
+ * are the same emptiness to the reader, and only one of them is something they can act on.
2827
+ *
2828
+ * ## Why this is not a re-read
2829
+ *
2830
+ * The obvious implementation of any "what is loaded?" listing is to read the configuration again.
2831
+ * That is the defect this exists to prevent: a re-read cannot detect a disagreement between what
2832
+ * config asked for and what the build did, because it IS the config. The two disagree exactly when
2833
+ * something suppressed an entity, which is the case worth reporting.
2834
+ *
2835
+ * So this function is pure and parameterized. It performs no I/O, which is what makes "no second
2836
+ * read" checkable rather than promised — the caller passes the values it handed to the builder, at
2837
+ * the moment it handed them over, and what comes back is an observation of that moment.
2838
+ *
2839
+ * ## What is generic here, and what is not
2840
+ *
2841
+ * The RULE is generic: for each capability, active is the request when allowed and empty when not,
2842
+ * and suppression is only claimed when something was actually removed. The VOCABULARY is not —
2843
+ * which capabilities exist and what the entities are called belong to the product, and arrive as
2844
+ * data.
2845
+ *
2846
+ * @public
2847
+ */
2848
+
2849
+ /** Raised when a recorded capability has no entry in the gate. @public */
2850
+ declare class UngatedCapabilityError extends TheokitAgentError {
2851
+ readonly name = "UngatedCapabilityError";
2852
+ }
2853
+ /** What one capability asked for, and what it got. @public */
2854
+ interface WiredEntity {
2855
+ /** The names actually handed to the builder. Empty when the capability was withheld. */
2856
+ readonly active: readonly string[];
2857
+ /**
2858
+ * The names configuration ASKED for. Equal to `active` when nothing was withheld; the difference
2859
+ * is exactly what the reader cannot otherwise see.
2860
+ */
2861
+ readonly requested: readonly string[];
2862
+ /**
2863
+ * True only when the gate is what emptied `active`.
2864
+ *
2865
+ * Deliberately false for a withheld capability that requested nothing: an untrusted directory with
2866
+ * no skills and a trusted one with no skills are the same emptiness, and a flag that fires when
2867
+ * nothing happened teaches the reader to ignore it.
2868
+ */
2869
+ readonly suppressedByTrust: boolean;
2870
+ }
2871
+ /** @public */
2872
+ interface WiringRecordInput<K extends string> {
2873
+ /**
2874
+ * The gate. Typically the output of `resolveTrustPosture`, which is what makes the name
2875
+ * `suppressedByTrust` accurate rather than decorative — a posture is the only thing in this
2876
+ * package that withholds a capability.
2877
+ *
2878
+ * It may gate MORE than `requested` covers: a posture also gates things that are not lists of
2879
+ * names, like durable memory. Those are not entities and do not appear in the record.
2880
+ */
2881
+ readonly posture: {
2882
+ readonly allows: Readonly<Record<string, boolean>>;
2883
+ };
2884
+ /** Per capability, the entity names the build was given. Drives which keys the record has. */
2885
+ readonly requested: Readonly<Record<K, readonly string[]>>;
2886
+ }
2887
+ /**
2888
+ * @returns one entry per key of `requested`, each a snapshot rather than a view of the caller's
2889
+ * arrays — the record is read long after the build, and aliasing would make it answer with what
2890
+ * the process holds now instead of with what was wired.
2891
+ * @public
2892
+ */
2893
+ declare function recordWiring<K extends string>(input: WiringRecordInput<K>): Readonly<Record<K, WiredEntity>>;
2894
+
2895
+ export { Agent, AgentBuilder, AgentDefinition, AgentDescription, AgentFactory, AgentOperationOptions, AgentOptions, type AgentPromptResult, type AgentRegistryOptions, type BatchItem, type BatchOptions, type BatchProgress, type BatchResult, Budget, BudgetHandle, BudgetOptions, BudgetSnapshot, BudgetTracker, CloudOptions, ContextSettings, type CounterBudgetTrackerOptions, CustomTool, 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, JudgeResult, LayerOrderError, type LayerValues, ListAgentsOptions, ListResult, ListRunsOptions, LiveAgentRegistry, LocalOptions, McpServerConfig, Memory, MemoryId, MemoryProvider, MemorySettings, type MigrateOptions, type MigrateResult, type ModelListItem, type ModelParameterDefinition, ModelSelection, type ModelVariant, NoopMemoryProvider, type NormalizedJsonSchema, PermissionEngine, type PermissionGate, type PermissionGateContext, type PermissionGateDecision, PermissionMode, PermissionPlugin, type PermissionPluginOptions, Plugin, PluginsSettings, PreToolCallDecision, Processor, Provider, ProviderProfile, ProviderRoutingSettings, Run, RunEventSink, RunResult, 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, Theokit, TheokitAgentError, type TheokitRequestOptions, TokenLimiter, type TokenLimiterOptions, Tool, ToolError, ToolResultContentBlock, type TrustLevel, type TrustPosture, type TrustPostureInput, type TrustSource, UngatedCapabilityError, UnicodeNormalizer, type UnicodeNormalizerOptions, UsageAccumulator, type WiredEntity, type WiringRecordInput, applySecurityFloor, auditEnvReachability, chargeAndCheckThresholds, computeCost, createCounterBudgetTracker, estimateTokens, extractRawId, foldLayers, getPricingEntry, inferApiMode, isValidTaskId, loadProjectEnv, migrateSqliteToLance, mkMemoryId, normalizeSchema, normalizeUsage, preflightCheck, recordWiring, resolveTrustPosture, runGoalLoop, scopedConversationId, sessionScopePrefix, setDiagnosticsSink, toShareGptTrajectory, verifyLayerOrdering, withCwdMutex };
package/dist/index.d.ts CHANGED
@@ -1263,6 +1263,63 @@ declare class Tool {
1263
1263
  static create<T extends ZodType, O extends ZodType = never>(spec: DefineToolSpec<T, O>): CustomTool;
1264
1264
  }
1265
1265
 
1266
+ /**
1267
+ * Audit whether every configuration key can be set from the environment, or says why not.
1268
+ *
1269
+ * A key settable only by editing a file cannot be set in CI, in a container, or for a single
1270
+ * invocation. That is usually an oversight rather than a decision, and it is invisible — nothing
1271
+ * fails, the key simply has no environment path, and nobody notices until someone needs one.
1272
+ *
1273
+ * The opposite failure rots more quietly. An opt-out written for a key that has since gained an
1274
+ * environment path, or for a key that no longer exists, still reads as a considered decision while
1275
+ * exempting nothing. Both questions are answered by one call so a consumer cannot check the gap and
1276
+ * forget the rot: they fail for opposite reasons, and a suite that asks only one looks complete.
1277
+ *
1278
+ * ## Why the framework owns the rule and not the keys
1279
+ *
1280
+ * A framework cannot enumerate a consumer's configuration keys, and should not try. Which keys exist
1281
+ * is that product's vocabulary — the same reason the security floor takes its permissiveness order
1282
+ * as data and the trust posture takes its capability list. So the consumer ranges over its own keys
1283
+ * with this, rather than registering them here.
1284
+ *
1285
+ * That is a narrower claim than "reachability is checked in the framework", and it is the honest
1286
+ * one: the failure still surfaces in the consumer's own suite. What the consumer no longer writes is
1287
+ * the detector, which is where the subtlety lives — the stale-opt-out half is the part everyone
1288
+ * forgets.
1289
+ *
1290
+ * @public
1291
+ */
1292
+ /** A key deliberately left off the environment, with the reason and what would reverse it. @public */
1293
+ interface EnvOptOut {
1294
+ readonly key: string;
1295
+ /** Why an environment variable is the wrong shape for this key. */
1296
+ readonly reason: string;
1297
+ /** What would make this opt-out obsolete. An opt-out with no exit is a permanent excuse. */
1298
+ readonly exitCriterion: string;
1299
+ }
1300
+ /** @public */
1301
+ interface EnvReachabilityInput {
1302
+ /** Every configuration key the product declares. */
1303
+ readonly keys: readonly string[];
1304
+ /** The subset that an environment variable can set. */
1305
+ readonly reachable: readonly string[];
1306
+ /** Documented exemptions for keys that deliberately have no environment path. */
1307
+ readonly optOuts: readonly EnvOptOut[];
1308
+ }
1309
+ /** @public */
1310
+ interface EnvReachabilityAudit {
1311
+ /** Keys with neither an environment path nor a documented opt-out. */
1312
+ readonly unreachable: readonly string[];
1313
+ /** Opt-outs that exempt nothing: the key gained an environment path, or no longer exists. */
1314
+ readonly staleOptOuts: readonly string[];
1315
+ }
1316
+ /**
1317
+ * @returns both axes, in the order the caller declared them — a stable order so a failure message
1318
+ * does not change between runs for reasons unrelated to the code.
1319
+ * @public
1320
+ */
1321
+ declare function auditEnvReachability(input: EnvReachabilityInput): EnvReachabilityAudit;
1322
+
1266
1323
  /**
1267
1324
  * `EventBus` — typed EventEmitter wrapper.
1268
1325
  *
@@ -2759,4 +2816,80 @@ interface TrustPosture<K extends string> {
2759
2816
  /** @public */
2760
2817
  declare function resolveTrustPosture<K extends string>(input: TrustPostureInput<K>): TrustPosture<K>;
2761
2818
 
2762
- export { Agent, AgentBuilder, AgentDefinition, AgentDescription, AgentFactory, AgentOperationOptions, AgentOptions, type AgentPromptResult, type AgentRegistryOptions, type BatchItem, type BatchOptions, type BatchProgress, type BatchResult, Budget, BudgetHandle, BudgetOptions, BudgetSnapshot, BudgetTracker, CloudOptions, ContextSettings, type CounterBudgetTrackerOptions, CustomTool, type DeclaredLayer, type DeepPartial, type DefineProviderOptions, type DefineToolSpec, type DiagnosticsSink, type DreamingSweepOptions, type DreamingSweepResult, ErrorMetadata, EventBus, type EvictReason, GOAL_CONTINUATION_MARKER, GenerateObjectError, type GenerateObjectOptions, type GenerateObjectResult, GetAgentOptions, GetRunOptions, GoalEvent, type GoalLoopAgent, GoalOptions, GoalResult, InlineSkill, JobQueue, type JobQueueOptions, JudgeCredentialError, JudgeResult, LayerOrderError, type LayerValues, ListAgentsOptions, ListResult, ListRunsOptions, LiveAgentRegistry, LocalOptions, McpServerConfig, Memory, MemoryId, MemoryProvider, MemorySettings, type MigrateOptions, type MigrateResult, type ModelListItem, type ModelParameterDefinition, ModelSelection, type ModelVariant, NoopMemoryProvider, type NormalizedJsonSchema, PermissionEngine, type PermissionGate, type PermissionGateContext, type PermissionGateDecision, PermissionMode, PermissionPlugin, type PermissionPluginOptions, Plugin, PluginsSettings, PreToolCallDecision, Processor, Provider, ProviderProfile, ProviderRoutingSettings, Run, RunEventSink, RunResult, 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, Theokit, TheokitAgentError, type TheokitRequestOptions, TokenLimiter, type TokenLimiterOptions, Tool, ToolError, ToolResultContentBlock, type TrustLevel, type TrustPosture, type TrustPostureInput, type TrustSource, UnicodeNormalizer, type UnicodeNormalizerOptions, UsageAccumulator, applySecurityFloor, chargeAndCheckThresholds, computeCost, createCounterBudgetTracker, estimateTokens, extractRawId, foldLayers, getPricingEntry, inferApiMode, isValidTaskId, loadProjectEnv, migrateSqliteToLance, mkMemoryId, normalizeSchema, normalizeUsage, preflightCheck, resolveTrustPosture, runGoalLoop, scopedConversationId, sessionScopePrefix, setDiagnosticsSink, toShareGptTrajectory, verifyLayerOrdering, withCwdMutex };
2819
+ /**
2820
+ * Record what a build actually wired, as opposed to what configuration asked for.
2821
+ *
2822
+ * A product that reads a project directory decides, while building, which of that directory's
2823
+ * entities it will honour: MCP servers, skills, hook events, commands. When a trust posture withholds
2824
+ * them, the build simply proceeds with fewer — and every surface that later asks "what is loaded?"
2825
+ * sees an empty list. Empty because nothing was configured and empty because everything was withheld
2826
+ * are the same emptiness to the reader, and only one of them is something they can act on.
2827
+ *
2828
+ * ## Why this is not a re-read
2829
+ *
2830
+ * The obvious implementation of any "what is loaded?" listing is to read the configuration again.
2831
+ * That is the defect this exists to prevent: a re-read cannot detect a disagreement between what
2832
+ * config asked for and what the build did, because it IS the config. The two disagree exactly when
2833
+ * something suppressed an entity, which is the case worth reporting.
2834
+ *
2835
+ * So this function is pure and parameterized. It performs no I/O, which is what makes "no second
2836
+ * read" checkable rather than promised — the caller passes the values it handed to the builder, at
2837
+ * the moment it handed them over, and what comes back is an observation of that moment.
2838
+ *
2839
+ * ## What is generic here, and what is not
2840
+ *
2841
+ * The RULE is generic: for each capability, active is the request when allowed and empty when not,
2842
+ * and suppression is only claimed when something was actually removed. The VOCABULARY is not —
2843
+ * which capabilities exist and what the entities are called belong to the product, and arrive as
2844
+ * data.
2845
+ *
2846
+ * @public
2847
+ */
2848
+
2849
+ /** Raised when a recorded capability has no entry in the gate. @public */
2850
+ declare class UngatedCapabilityError extends TheokitAgentError {
2851
+ readonly name = "UngatedCapabilityError";
2852
+ }
2853
+ /** What one capability asked for, and what it got. @public */
2854
+ interface WiredEntity {
2855
+ /** The names actually handed to the builder. Empty when the capability was withheld. */
2856
+ readonly active: readonly string[];
2857
+ /**
2858
+ * The names configuration ASKED for. Equal to `active` when nothing was withheld; the difference
2859
+ * is exactly what the reader cannot otherwise see.
2860
+ */
2861
+ readonly requested: readonly string[];
2862
+ /**
2863
+ * True only when the gate is what emptied `active`.
2864
+ *
2865
+ * Deliberately false for a withheld capability that requested nothing: an untrusted directory with
2866
+ * no skills and a trusted one with no skills are the same emptiness, and a flag that fires when
2867
+ * nothing happened teaches the reader to ignore it.
2868
+ */
2869
+ readonly suppressedByTrust: boolean;
2870
+ }
2871
+ /** @public */
2872
+ interface WiringRecordInput<K extends string> {
2873
+ /**
2874
+ * The gate. Typically the output of `resolveTrustPosture`, which is what makes the name
2875
+ * `suppressedByTrust` accurate rather than decorative — a posture is the only thing in this
2876
+ * package that withholds a capability.
2877
+ *
2878
+ * It may gate MORE than `requested` covers: a posture also gates things that are not lists of
2879
+ * names, like durable memory. Those are not entities and do not appear in the record.
2880
+ */
2881
+ readonly posture: {
2882
+ readonly allows: Readonly<Record<string, boolean>>;
2883
+ };
2884
+ /** Per capability, the entity names the build was given. Drives which keys the record has. */
2885
+ readonly requested: Readonly<Record<K, readonly string[]>>;
2886
+ }
2887
+ /**
2888
+ * @returns one entry per key of `requested`, each a snapshot rather than a view of the caller's
2889
+ * arrays — the record is read long after the build, and aliasing would make it answer with what
2890
+ * the process holds now instead of with what was wired.
2891
+ * @public
2892
+ */
2893
+ declare function recordWiring<K extends string>(input: WiringRecordInput<K>): Readonly<Record<K, WiredEntity>>;
2894
+
2895
+ export { Agent, AgentBuilder, AgentDefinition, AgentDescription, AgentFactory, AgentOperationOptions, AgentOptions, type AgentPromptResult, type AgentRegistryOptions, type BatchItem, type BatchOptions, type BatchProgress, type BatchResult, Budget, BudgetHandle, BudgetOptions, BudgetSnapshot, BudgetTracker, CloudOptions, ContextSettings, type CounterBudgetTrackerOptions, CustomTool, 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, JudgeResult, LayerOrderError, type LayerValues, ListAgentsOptions, ListResult, ListRunsOptions, LiveAgentRegistry, LocalOptions, McpServerConfig, Memory, MemoryId, MemoryProvider, MemorySettings, type MigrateOptions, type MigrateResult, type ModelListItem, type ModelParameterDefinition, ModelSelection, type ModelVariant, NoopMemoryProvider, type NormalizedJsonSchema, PermissionEngine, type PermissionGate, type PermissionGateContext, type PermissionGateDecision, PermissionMode, PermissionPlugin, type PermissionPluginOptions, Plugin, PluginsSettings, PreToolCallDecision, Processor, Provider, ProviderProfile, ProviderRoutingSettings, Run, RunEventSink, RunResult, 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, Theokit, TheokitAgentError, type TheokitRequestOptions, TokenLimiter, type TokenLimiterOptions, Tool, ToolError, ToolResultContentBlock, type TrustLevel, type TrustPosture, type TrustPostureInput, type TrustSource, UngatedCapabilityError, UnicodeNormalizer, type UnicodeNormalizerOptions, UsageAccumulator, type WiredEntity, type WiringRecordInput, applySecurityFloor, auditEnvReachability, chargeAndCheckThresholds, computeCost, createCounterBudgetTracker, estimateTokens, extractRawId, foldLayers, getPricingEntry, inferApiMode, isValidTaskId, loadProjectEnv, migrateSqliteToLance, mkMemoryId, normalizeSchema, normalizeUsage, preflightCheck, recordWiring, resolveTrustPosture, runGoalLoop, scopedConversationId, sessionScopePrefix, setDiagnosticsSink, toShareGptTrajectory, verifyLayerOrdering, withCwdMutex };
package/dist/index.js CHANGED
@@ -664,6 +664,17 @@ var SkillReadTool = class {
664
664
  }
665
665
  };
666
666
 
667
+ // src/env-reachability.ts
668
+ function auditEnvReachability(input) {
669
+ const reachable = new Set(input.reachable);
670
+ const exempt = new Set(input.optOuts.map((o) => o.key));
671
+ const declared = new Set(input.keys);
672
+ return {
673
+ unreachable: input.keys.filter((k) => !reachable.has(k) && !exempt.has(k)),
674
+ staleOptOuts: input.optOuts.filter((o) => !declared.has(o.key) || reachable.has(o.key)).map((o) => o.key)
675
+ };
676
+ }
677
+
667
678
  // src/event-bus.ts
668
679
  var EventBus = class {
669
680
  handlers = /* @__PURE__ */ new Map();
@@ -2200,6 +2211,29 @@ function resolveTrustPosture(input) {
2200
2211
  return { level, source, allows };
2201
2212
  }
2202
2213
 
2203
- export { AgentFactory, Budget, EventBus, JobQueue, LayerOrderError, Memory, NoopMemoryProvider, PermissionEngine, PermissionPlugin, Plugin, Provider, SOVEREIGN_ENV_KEYS, Security, Skill, SkillReadTool, Squad, Task, Theokit, TokenLimiter, UnicodeNormalizer, applyMode, applySecurityFloor, chargeAndCheckThresholds, createCounterBudgetTracker, estimateTokens, extractRawId, foldLayers, inferApiMode, loadProjectEnv, migrateSqliteToLance2 as migrateSqliteToLance, mkMemoryId, normalizeSchema, normalizeUsage, preflightCheck, resolveTrustPosture, runGoalLoop, scopedConversationId, sessionScopePrefix, toShareGptTrajectory, verifyLayerOrdering };
2214
+ // src/wiring-record.ts
2215
+ var UngatedCapabilityError = class extends TheokitAgentError {
2216
+ name = "UngatedCapabilityError";
2217
+ };
2218
+ function recordWiring(input) {
2219
+ const record = {};
2220
+ for (const [capability, requested] of Object.entries(input.requested)) {
2221
+ const allowed = input.posture.allows[capability];
2222
+ if (allowed === void 0) {
2223
+ throw new UngatedCapabilityError(
2224
+ `capability \`${capability}\` was recorded as wired but the posture does not gate it; gated capabilities are: ${Object.keys(input.posture.allows).join(", ") || "(none)"}`
2225
+ );
2226
+ }
2227
+ record[capability] = {
2228
+ // Copied, not aliased. See the @returns note.
2229
+ active: allowed ? [...requested] : [],
2230
+ requested: [...requested],
2231
+ suppressedByTrust: !allowed && requested.length > 0
2232
+ };
2233
+ }
2234
+ return record;
2235
+ }
2236
+
2237
+ export { AgentFactory, Budget, EventBus, JobQueue, LayerOrderError, Memory, NoopMemoryProvider, PermissionEngine, PermissionPlugin, Plugin, Provider, SOVEREIGN_ENV_KEYS, Security, Skill, SkillReadTool, Squad, Task, Theokit, TokenLimiter, UngatedCapabilityError, UnicodeNormalizer, applyMode, applySecurityFloor, auditEnvReachability, chargeAndCheckThresholds, createCounterBudgetTracker, estimateTokens, extractRawId, foldLayers, inferApiMode, loadProjectEnv, migrateSqliteToLance2 as migrateSqliteToLance, mkMemoryId, normalizeSchema, normalizeUsage, preflightCheck, recordWiring, resolveTrustPosture, runGoalLoop, scopedConversationId, sessionScopePrefix, toShareGptTrajectory, verifyLayerOrdering };
2204
2238
  //# sourceMappingURL=index.js.map
2205
2239
  //# sourceMappingURL=index.js.map