@theokit/sdk 4.46.0 → 4.48.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
@@ -2695,4 +2695,144 @@ declare function toShareGptTrajectory(result: BatchResult, options?: {
2695
2695
  model?: string;
2696
2696
  }): ShareGptTrajectory | null;
2697
2697
 
2698
- 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, UnicodeNormalizer, type UnicodeNormalizerOptions, UsageAccumulator, applySecurityFloor, chargeAndCheckThresholds, computeCost, createCounterBudgetTracker, estimateTokens, extractRawId, foldLayers, getPricingEntry, inferApiMode, isValidTaskId, loadProjectEnv, migrateSqliteToLance, mkMemoryId, normalizeSchema, normalizeUsage, preflightCheck, runGoalLoop, scopedConversationId, sessionScopePrefix, setDiagnosticsSink, toShareGptTrajectory, verifyLayerOrdering, withCwdMutex };
2698
+ /**
2699
+ * Decide what a project directory is allowed to switch on.
2700
+ *
2701
+ * A product that reads a repository has to answer this before it builds anything: are that
2702
+ * repository's hooks honoured, are its MCP servers started, do its instructions enter the persona?
2703
+ * The stakes are not configuration-shaped. A hook is arbitrary command execution on every tool
2704
+ * call, and an MCP server is an external process SPAWNED while the agent is built — before any
2705
+ * per-tool approval exists to refuse it. A product that gets this wrong grants local execution on
2706
+ * first build, in a directory the user only meant to open.
2707
+ *
2708
+ * ## What this is, and what it deliberately is not
2709
+ *
2710
+ * The arithmetic is small: pick a level, derive one boolean per capability. The value is the
2711
+ * INVARIANT — untrusted means EVERY declared capability is off, and `allows` is built FROM the
2712
+ * declared list, so a product that adds a ninth capability cannot forget to gate it. That failure
2713
+ * is invisible when it happens: the new capability simply works in a directory where it should not,
2714
+ * and nothing reports anything.
2715
+ *
2716
+ * It does NOT decide what "trusted" means. Where the record lives, what the environment variable is
2717
+ * called, whether a legacy alias is still honoured — all of that is the consumer's, because all of
2718
+ * it is that product's vocabulary. The framework owns the shape of the answer and the guarantee
2719
+ * that the answer covers everything declared.
2720
+ *
2721
+ * ## Why `source` is reported
2722
+ *
2723
+ * "Trusted because the operator recorded this directory" and "trusted because a blanket environment
2724
+ * switch is on" are different facts. A surface that only shows `trusted` cannot warn about the
2725
+ * second, which is the one that stays on across every directory the process ever opens.
2726
+ *
2727
+ * @public
2728
+ */
2729
+ /** @public */
2730
+ type TrustLevel = "trusted" | "untrusted";
2731
+ /** Where the decision came from. @public */
2732
+ type TrustSource = "env" | "store" | "default";
2733
+ /** @public */
2734
+ interface TrustPostureInput<K extends string> {
2735
+ /**
2736
+ * Every capability a repository could switch on. `allows` is built from exactly this list — the
2737
+ * guarantee that nothing is left ungated.
2738
+ */
2739
+ readonly capabilities: readonly K[];
2740
+ /**
2741
+ * Whether the operator has recorded this directory as trusted. Called at most once, and not at
2742
+ * all when `envOverride` already granted trust — it may touch the filesystem.
2743
+ */
2744
+ readonly isTrusted: () => boolean;
2745
+ /**
2746
+ * A blanket override from the consumer's own environment vocabulary. `true` grants trust;
2747
+ * `false` and `undefined` both mean "the operator did not switch it on" — NOT "switched it off",
2748
+ * because an unset variable must not override a trusted store.
2749
+ */
2750
+ readonly envOverride?: boolean;
2751
+ }
2752
+ /** @public */
2753
+ interface TrustPosture<K extends string> {
2754
+ readonly level: TrustLevel;
2755
+ readonly source: TrustSource;
2756
+ /** One entry per declared capability. Every value is `false` when the level is untrusted. */
2757
+ readonly allows: Readonly<Record<K, boolean>>;
2758
+ }
2759
+ /** @public */
2760
+ declare function resolveTrustPosture<K extends string>(input: TrustPostureInput<K>): TrustPosture<K>;
2761
+
2762
+ /**
2763
+ * Record what a build actually wired, as opposed to what configuration asked for.
2764
+ *
2765
+ * A product that reads a project directory decides, while building, which of that directory's
2766
+ * entities it will honour: MCP servers, skills, hook events, commands. When a trust posture withholds
2767
+ * them, the build simply proceeds with fewer — and every surface that later asks "what is loaded?"
2768
+ * sees an empty list. Empty because nothing was configured and empty because everything was withheld
2769
+ * are the same emptiness to the reader, and only one of them is something they can act on.
2770
+ *
2771
+ * ## Why this is not a re-read
2772
+ *
2773
+ * The obvious implementation of any "what is loaded?" listing is to read the configuration again.
2774
+ * That is the defect this exists to prevent: a re-read cannot detect a disagreement between what
2775
+ * config asked for and what the build did, because it IS the config. The two disagree exactly when
2776
+ * something suppressed an entity, which is the case worth reporting.
2777
+ *
2778
+ * So this function is pure and parameterized. It performs no I/O, which is what makes "no second
2779
+ * read" checkable rather than promised — the caller passes the values it handed to the builder, at
2780
+ * the moment it handed them over, and what comes back is an observation of that moment.
2781
+ *
2782
+ * ## What is generic here, and what is not
2783
+ *
2784
+ * The RULE is generic: for each capability, active is the request when allowed and empty when not,
2785
+ * and suppression is only claimed when something was actually removed. The VOCABULARY is not —
2786
+ * which capabilities exist and what the entities are called belong to the product, and arrive as
2787
+ * data.
2788
+ *
2789
+ * @public
2790
+ */
2791
+
2792
+ /** Raised when a recorded capability has no entry in the gate. @public */
2793
+ declare class UngatedCapabilityError extends TheokitAgentError {
2794
+ readonly name = "UngatedCapabilityError";
2795
+ }
2796
+ /** What one capability asked for, and what it got. @public */
2797
+ interface WiredEntity {
2798
+ /** The names actually handed to the builder. Empty when the capability was withheld. */
2799
+ readonly active: readonly string[];
2800
+ /**
2801
+ * The names configuration ASKED for. Equal to `active` when nothing was withheld; the difference
2802
+ * is exactly what the reader cannot otherwise see.
2803
+ */
2804
+ readonly requested: readonly string[];
2805
+ /**
2806
+ * True only when the gate is what emptied `active`.
2807
+ *
2808
+ * Deliberately false for a withheld capability that requested nothing: an untrusted directory with
2809
+ * no skills and a trusted one with no skills are the same emptiness, and a flag that fires when
2810
+ * nothing happened teaches the reader to ignore it.
2811
+ */
2812
+ readonly suppressedByTrust: boolean;
2813
+ }
2814
+ /** @public */
2815
+ interface WiringRecordInput<K extends string> {
2816
+ /**
2817
+ * The gate. Typically the output of `resolveTrustPosture`, which is what makes the name
2818
+ * `suppressedByTrust` accurate rather than decorative — a posture is the only thing in this
2819
+ * package that withholds a capability.
2820
+ *
2821
+ * It may gate MORE than `requested` covers: a posture also gates things that are not lists of
2822
+ * names, like durable memory. Those are not entities and do not appear in the record.
2823
+ */
2824
+ readonly posture: {
2825
+ readonly allows: Readonly<Record<string, boolean>>;
2826
+ };
2827
+ /** Per capability, the entity names the build was given. Drives which keys the record has. */
2828
+ readonly requested: Readonly<Record<K, readonly string[]>>;
2829
+ }
2830
+ /**
2831
+ * @returns one entry per key of `requested`, each a snapshot rather than a view of the caller's
2832
+ * arrays — the record is read long after the build, and aliasing would make it answer with what
2833
+ * the process holds now instead of with what was wired.
2834
+ * @public
2835
+ */
2836
+ declare function recordWiring<K extends string>(input: WiringRecordInput<K>): Readonly<Record<K, WiredEntity>>;
2837
+
2838
+ 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, UngatedCapabilityError, UnicodeNormalizer, type UnicodeNormalizerOptions, UsageAccumulator, type WiredEntity, type WiringRecordInput, applySecurityFloor, 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
@@ -2695,4 +2695,144 @@ declare function toShareGptTrajectory(result: BatchResult, options?: {
2695
2695
  model?: string;
2696
2696
  }): ShareGptTrajectory | null;
2697
2697
 
2698
- 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, UnicodeNormalizer, type UnicodeNormalizerOptions, UsageAccumulator, applySecurityFloor, chargeAndCheckThresholds, computeCost, createCounterBudgetTracker, estimateTokens, extractRawId, foldLayers, getPricingEntry, inferApiMode, isValidTaskId, loadProjectEnv, migrateSqliteToLance, mkMemoryId, normalizeSchema, normalizeUsage, preflightCheck, runGoalLoop, scopedConversationId, sessionScopePrefix, setDiagnosticsSink, toShareGptTrajectory, verifyLayerOrdering, withCwdMutex };
2698
+ /**
2699
+ * Decide what a project directory is allowed to switch on.
2700
+ *
2701
+ * A product that reads a repository has to answer this before it builds anything: are that
2702
+ * repository's hooks honoured, are its MCP servers started, do its instructions enter the persona?
2703
+ * The stakes are not configuration-shaped. A hook is arbitrary command execution on every tool
2704
+ * call, and an MCP server is an external process SPAWNED while the agent is built — before any
2705
+ * per-tool approval exists to refuse it. A product that gets this wrong grants local execution on
2706
+ * first build, in a directory the user only meant to open.
2707
+ *
2708
+ * ## What this is, and what it deliberately is not
2709
+ *
2710
+ * The arithmetic is small: pick a level, derive one boolean per capability. The value is the
2711
+ * INVARIANT — untrusted means EVERY declared capability is off, and `allows` is built FROM the
2712
+ * declared list, so a product that adds a ninth capability cannot forget to gate it. That failure
2713
+ * is invisible when it happens: the new capability simply works in a directory where it should not,
2714
+ * and nothing reports anything.
2715
+ *
2716
+ * It does NOT decide what "trusted" means. Where the record lives, what the environment variable is
2717
+ * called, whether a legacy alias is still honoured — all of that is the consumer's, because all of
2718
+ * it is that product's vocabulary. The framework owns the shape of the answer and the guarantee
2719
+ * that the answer covers everything declared.
2720
+ *
2721
+ * ## Why `source` is reported
2722
+ *
2723
+ * "Trusted because the operator recorded this directory" and "trusted because a blanket environment
2724
+ * switch is on" are different facts. A surface that only shows `trusted` cannot warn about the
2725
+ * second, which is the one that stays on across every directory the process ever opens.
2726
+ *
2727
+ * @public
2728
+ */
2729
+ /** @public */
2730
+ type TrustLevel = "trusted" | "untrusted";
2731
+ /** Where the decision came from. @public */
2732
+ type TrustSource = "env" | "store" | "default";
2733
+ /** @public */
2734
+ interface TrustPostureInput<K extends string> {
2735
+ /**
2736
+ * Every capability a repository could switch on. `allows` is built from exactly this list — the
2737
+ * guarantee that nothing is left ungated.
2738
+ */
2739
+ readonly capabilities: readonly K[];
2740
+ /**
2741
+ * Whether the operator has recorded this directory as trusted. Called at most once, and not at
2742
+ * all when `envOverride` already granted trust — it may touch the filesystem.
2743
+ */
2744
+ readonly isTrusted: () => boolean;
2745
+ /**
2746
+ * A blanket override from the consumer's own environment vocabulary. `true` grants trust;
2747
+ * `false` and `undefined` both mean "the operator did not switch it on" — NOT "switched it off",
2748
+ * because an unset variable must not override a trusted store.
2749
+ */
2750
+ readonly envOverride?: boolean;
2751
+ }
2752
+ /** @public */
2753
+ interface TrustPosture<K extends string> {
2754
+ readonly level: TrustLevel;
2755
+ readonly source: TrustSource;
2756
+ /** One entry per declared capability. Every value is `false` when the level is untrusted. */
2757
+ readonly allows: Readonly<Record<K, boolean>>;
2758
+ }
2759
+ /** @public */
2760
+ declare function resolveTrustPosture<K extends string>(input: TrustPostureInput<K>): TrustPosture<K>;
2761
+
2762
+ /**
2763
+ * Record what a build actually wired, as opposed to what configuration asked for.
2764
+ *
2765
+ * A product that reads a project directory decides, while building, which of that directory's
2766
+ * entities it will honour: MCP servers, skills, hook events, commands. When a trust posture withholds
2767
+ * them, the build simply proceeds with fewer — and every surface that later asks "what is loaded?"
2768
+ * sees an empty list. Empty because nothing was configured and empty because everything was withheld
2769
+ * are the same emptiness to the reader, and only one of them is something they can act on.
2770
+ *
2771
+ * ## Why this is not a re-read
2772
+ *
2773
+ * The obvious implementation of any "what is loaded?" listing is to read the configuration again.
2774
+ * That is the defect this exists to prevent: a re-read cannot detect a disagreement between what
2775
+ * config asked for and what the build did, because it IS the config. The two disagree exactly when
2776
+ * something suppressed an entity, which is the case worth reporting.
2777
+ *
2778
+ * So this function is pure and parameterized. It performs no I/O, which is what makes "no second
2779
+ * read" checkable rather than promised — the caller passes the values it handed to the builder, at
2780
+ * the moment it handed them over, and what comes back is an observation of that moment.
2781
+ *
2782
+ * ## What is generic here, and what is not
2783
+ *
2784
+ * The RULE is generic: for each capability, active is the request when allowed and empty when not,
2785
+ * and suppression is only claimed when something was actually removed. The VOCABULARY is not —
2786
+ * which capabilities exist and what the entities are called belong to the product, and arrive as
2787
+ * data.
2788
+ *
2789
+ * @public
2790
+ */
2791
+
2792
+ /** Raised when a recorded capability has no entry in the gate. @public */
2793
+ declare class UngatedCapabilityError extends TheokitAgentError {
2794
+ readonly name = "UngatedCapabilityError";
2795
+ }
2796
+ /** What one capability asked for, and what it got. @public */
2797
+ interface WiredEntity {
2798
+ /** The names actually handed to the builder. Empty when the capability was withheld. */
2799
+ readonly active: readonly string[];
2800
+ /**
2801
+ * The names configuration ASKED for. Equal to `active` when nothing was withheld; the difference
2802
+ * is exactly what the reader cannot otherwise see.
2803
+ */
2804
+ readonly requested: readonly string[];
2805
+ /**
2806
+ * True only when the gate is what emptied `active`.
2807
+ *
2808
+ * Deliberately false for a withheld capability that requested nothing: an untrusted directory with
2809
+ * no skills and a trusted one with no skills are the same emptiness, and a flag that fires when
2810
+ * nothing happened teaches the reader to ignore it.
2811
+ */
2812
+ readonly suppressedByTrust: boolean;
2813
+ }
2814
+ /** @public */
2815
+ interface WiringRecordInput<K extends string> {
2816
+ /**
2817
+ * The gate. Typically the output of `resolveTrustPosture`, which is what makes the name
2818
+ * `suppressedByTrust` accurate rather than decorative — a posture is the only thing in this
2819
+ * package that withholds a capability.
2820
+ *
2821
+ * It may gate MORE than `requested` covers: a posture also gates things that are not lists of
2822
+ * names, like durable memory. Those are not entities and do not appear in the record.
2823
+ */
2824
+ readonly posture: {
2825
+ readonly allows: Readonly<Record<string, boolean>>;
2826
+ };
2827
+ /** Per capability, the entity names the build was given. Drives which keys the record has. */
2828
+ readonly requested: Readonly<Record<K, readonly string[]>>;
2829
+ }
2830
+ /**
2831
+ * @returns one entry per key of `requested`, each a snapshot rather than a view of the caller's
2832
+ * arrays — the record is read long after the build, and aliasing would make it answer with what
2833
+ * the process holds now instead of with what was wired.
2834
+ * @public
2835
+ */
2836
+ declare function recordWiring<K extends string>(input: WiringRecordInput<K>): Readonly<Record<K, WiredEntity>>;
2837
+
2838
+ 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, UngatedCapabilityError, UnicodeNormalizer, type UnicodeNormalizerOptions, UsageAccumulator, type WiredEntity, type WiringRecordInput, applySecurityFloor, 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
@@ -2191,6 +2191,38 @@ function safeStringify(v) {
2191
2191
  }
2192
2192
  }
2193
2193
 
2194
- 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, runGoalLoop, scopedConversationId, sessionScopePrefix, toShareGptTrajectory, verifyLayerOrdering };
2194
+ // src/trust-posture.ts
2195
+ function resolveTrustPosture(input) {
2196
+ const source = input.envOverride === true ? "env" : input.isTrusted() ? "store" : "default";
2197
+ const level = source === "default" ? "untrusted" : "trusted";
2198
+ const granted = level === "trusted";
2199
+ const allows = Object.fromEntries(input.capabilities.map((key) => [key, granted]));
2200
+ return { level, source, allows };
2201
+ }
2202
+
2203
+ // src/wiring-record.ts
2204
+ var UngatedCapabilityError = class extends TheokitAgentError {
2205
+ name = "UngatedCapabilityError";
2206
+ };
2207
+ function recordWiring(input) {
2208
+ const record = {};
2209
+ for (const [capability, requested] of Object.entries(input.requested)) {
2210
+ const allowed = input.posture.allows[capability];
2211
+ if (allowed === void 0) {
2212
+ throw new UngatedCapabilityError(
2213
+ `capability \`${capability}\` was recorded as wired but the posture does not gate it; gated capabilities are: ${Object.keys(input.posture.allows).join(", ") || "(none)"}`
2214
+ );
2215
+ }
2216
+ record[capability] = {
2217
+ // Copied, not aliased. See the @returns note.
2218
+ active: allowed ? [...requested] : [],
2219
+ requested: [...requested],
2220
+ suppressedByTrust: !allowed && requested.length > 0
2221
+ };
2222
+ }
2223
+ return record;
2224
+ }
2225
+
2226
+ 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, chargeAndCheckThresholds, createCounterBudgetTracker, estimateTokens, extractRawId, foldLayers, inferApiMode, loadProjectEnv, migrateSqliteToLance2 as migrateSqliteToLance, mkMemoryId, normalizeSchema, normalizeUsage, preflightCheck, recordWiring, resolveTrustPosture, runGoalLoop, scopedConversationId, sessionScopePrefix, toShareGptTrajectory, verifyLayerOrdering };
2195
2227
  //# sourceMappingURL=index.js.map
2196
2228
  //# sourceMappingURL=index.js.map