@theokit/sdk 4.42.1 → 4.44.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/CHANGELOG.md +79 -0
  2. package/dist/{agent-MVYGMWPM.js → agent-GKX5FE5K.js} +5 -5
  3. package/dist/{agent-MVYGMWPM.js.map → agent-GKX5FE5K.js.map} +1 -1
  4. package/dist/{agent-DRUORJTU.cjs → agent-JA4ILE5O.cjs} +6 -6
  5. package/dist/{agent-DRUORJTU.cjs.map → agent-JA4ILE5O.cjs.map} +1 -1
  6. package/dist/{chunk-ZZAAQOAZ.js → chunk-3NLOQEJR.js} +3 -3
  7. package/dist/{chunk-ZZAAQOAZ.js.map → chunk-3NLOQEJR.js.map} +1 -1
  8. package/dist/{chunk-UJ7IQJAG.js → chunk-4NAKHID5.js} +8 -21
  9. package/dist/chunk-4NAKHID5.js.map +1 -0
  10. package/dist/{chunk-HLGEXZZP.cjs → chunk-74VVGK7P.cjs} +5 -5
  11. package/dist/{chunk-HLGEXZZP.cjs.map → chunk-74VVGK7P.cjs.map} +1 -1
  12. package/dist/{chunk-YPEPCZHF.cjs → chunk-L5YO6PWL.cjs} +7 -20
  13. package/dist/chunk-L5YO6PWL.cjs.map +1 -0
  14. package/dist/{chunk-O67XODD5.js → chunk-MZQHVN7C.js} +3 -3
  15. package/dist/{chunk-O67XODD5.js.map → chunk-MZQHVN7C.js.map} +1 -1
  16. package/dist/{chunk-4OQXDCMN.cjs → chunk-TSK4VVBW.cjs} +9 -9
  17. package/dist/{chunk-4OQXDCMN.cjs.map → chunk-TSK4VVBW.cjs.map} +1 -1
  18. package/dist/{chunk-GAXYZXYY.cjs → chunk-UU7MAO2D.cjs} +8 -8
  19. package/dist/{chunk-GAXYZXYY.cjs.map → chunk-UU7MAO2D.cjs.map} +1 -1
  20. package/dist/{chunk-V5V5A6B7.js → chunk-XARLSCKA.js} +3 -3
  21. package/dist/{chunk-V5V5A6B7.js.map → chunk-XARLSCKA.js.map} +1 -1
  22. package/dist/context/index.cjs +7 -7
  23. package/dist/context/index.js +3 -3
  24. package/dist/cron.cjs +5 -5
  25. package/dist/cron.js +4 -4
  26. package/dist/eval.cjs +4 -4
  27. package/dist/eval.js +3 -3
  28. package/dist/index.cjs +55 -20
  29. package/dist/index.cjs.map +1 -1
  30. package/dist/index.d.cts +66 -1
  31. package/dist/index.d.ts +66 -1
  32. package/dist/index.js +40 -7
  33. package/dist/index.js.map +1 -1
  34. package/dist/project.cjs +3 -3
  35. package/dist/project.js +1 -1
  36. package/package.json +12 -13
  37. package/dist/chunk-UJ7IQJAG.js.map +0 -1
  38. package/dist/chunk-YPEPCZHF.cjs.map +0 -1
package/dist/index.d.cts CHANGED
@@ -1835,6 +1835,71 @@ declare class PermissionPlugin {
1835
1835
  static create(engine: PermissionEngine, opts?: PermissionPluginOptions): Plugin;
1836
1836
  }
1837
1837
 
1838
+ /**
1839
+ * Load a project's `.env` without letting it move the credential store or switch off a trust
1840
+ * decision.
1841
+ *
1842
+ * `process.loadEnvFile()` reads the PROJECT's `.env` into `process.env`. For a provider key that is
1843
+ * exactly right and is the documented way to configure a scaffolded product. For the handful of
1844
+ * variables that decide WHERE credentials live and WHAT is trusted it is a hole: a cloned
1845
+ * repository is untrusted input, and a `.env` inside it is untrusted input the runtime is about to
1846
+ * treat as configuration.
1847
+ *
1848
+ * Concretely, without this guard a repository shipping
1849
+ *
1850
+ * ```
1851
+ * THEOKIT_AUTH_HOME=/tmp/attacker-store
1852
+ * ```
1853
+ *
1854
+ * redirects the credential store the moment the product starts in that directory — before any
1855
+ * trust prompt, because locating the store is what happens first.
1856
+ *
1857
+ * ## Why it lives here
1858
+ *
1859
+ * The scaffolding template (`create-theokit`, TUI surface) calls `process.loadEnvFile()` with no
1860
+ * guard, so every product generated from it starts exposed. One consumer found this and fixed it in
1861
+ * ~30 lines of its own. A defence each consumer has to rediscover is a defence most will not have,
1862
+ * and this one is invisible when missing: nothing fails, the store simply moves.
1863
+ *
1864
+ * ## Why the set is named
1865
+ *
1866
+ * A convention — "anything ending in `_HOME`", "anything with TRUST in it" — silently changes
1867
+ * meaning as variables are added, in the direction of accidentally sovereign or accidentally not.
1868
+ * The list is explicit so that making a variable sovereign is a deliberate act, and so a reader can
1869
+ * see the security boundary without grepping for it.
1870
+ *
1871
+ * @public
1872
+ */
1873
+ /**
1874
+ * Variables a project-scoped source may never set. Each either locates the credential store, names
1875
+ * the config directory that is read as configuration, or carries a trust decision.
1876
+ *
1877
+ * `THEOKIT_API_KEY` is deliberately ABSENT. A project supplying its own provider key through `.env`
1878
+ * is the documented, intended path — treating it as sovereign would break every scaffolded product
1879
+ * to defend nothing, since a key the project supplies is a key the project already has.
1880
+ *
1881
+ * @public
1882
+ */
1883
+ declare const SOVEREIGN_ENV_KEYS: readonly ["THEOKIT_HOME", "THEOKIT_AUTH_HOME", "THEOKIT_DIR_NAME", "THEOKIT_TRUSTED_PROVIDERS", "THEOKIT_REDACT_SECRETS", "THEOKIT_OAUTH_TX_SALT"];
1884
+ /** @public */
1885
+ type SovereignEnvKey = (typeof SOVEREIGN_ENV_KEYS)[number];
1886
+ /** The mutable shape of `process.env`, narrowed so a caller can pass a plain object in tests. */
1887
+ type MutableEnv = Record<string, string | undefined>;
1888
+ /**
1889
+ * Read the project's `.env` into `env`, then restore every {@link SOVEREIGN_ENV_KEYS} entry to the
1890
+ * value it had BEFORE the load — including restoring it to absent.
1891
+ *
1892
+ * Capture-then-restore rather than filtering the file: `process.loadEnvFile` offers no hook between
1893
+ * parsing and assignment, and reimplementing dotenv parsing to filter it would be a second parser
1894
+ * to keep in step with Node's. Restoring afterwards needs no parser and cannot disagree with one.
1895
+ *
1896
+ * @param env the environment to mutate. Defaults to `process.env`.
1897
+ * @param load performs the load. Defaults to `process.loadEnvFile` when the runtime has it, and to
1898
+ * `undefined` when it does not — in which case this is a no-op rather than a startup crash.
1899
+ * @public
1900
+ */
1901
+ declare function loadProjectEnv(env?: MutableEnv, load?: (() => void) | undefined): void;
1902
+
1838
1903
  /** The internal JSON-Schema shape the synthetic `output` tool consumes. */
1839
1904
  type NormalizedJsonSchema = Record<string, unknown>;
1840
1905
  /**
@@ -2510,4 +2575,4 @@ declare function toShareGptTrajectory(result: BatchResult, options?: {
2510
2575
  model?: string;
2511
2576
  }): ShareGptTrajectory | null;
2512
2577
 
2513
- 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 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, 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, Security, type SessionMessage, type SessionMessagePart, type SessionScope, type ShareGptMessage, type ShareGptTrajectory, SkillReadTool, SkillsSettings, 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, chargeAndCheckThresholds, computeCost, createCounterBudgetTracker, estimateTokens, extractRawId, getPricingEntry, inferApiMode, isValidTaskId, migrateSqliteToLance, mkMemoryId, normalizeSchema, normalizeUsage, preflightCheck, runGoalLoop, scopedConversationId, sessionScopePrefix, setDiagnosticsSink, toShareGptTrajectory, withCwdMutex };
2578
+ 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 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, 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 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, chargeAndCheckThresholds, computeCost, createCounterBudgetTracker, estimateTokens, extractRawId, getPricingEntry, inferApiMode, isValidTaskId, loadProjectEnv, migrateSqliteToLance, mkMemoryId, normalizeSchema, normalizeUsage, preflightCheck, runGoalLoop, scopedConversationId, sessionScopePrefix, setDiagnosticsSink, toShareGptTrajectory, withCwdMutex };
package/dist/index.d.ts CHANGED
@@ -1835,6 +1835,71 @@ declare class PermissionPlugin {
1835
1835
  static create(engine: PermissionEngine, opts?: PermissionPluginOptions): Plugin;
1836
1836
  }
1837
1837
 
1838
+ /**
1839
+ * Load a project's `.env` without letting it move the credential store or switch off a trust
1840
+ * decision.
1841
+ *
1842
+ * `process.loadEnvFile()` reads the PROJECT's `.env` into `process.env`. For a provider key that is
1843
+ * exactly right and is the documented way to configure a scaffolded product. For the handful of
1844
+ * variables that decide WHERE credentials live and WHAT is trusted it is a hole: a cloned
1845
+ * repository is untrusted input, and a `.env` inside it is untrusted input the runtime is about to
1846
+ * treat as configuration.
1847
+ *
1848
+ * Concretely, without this guard a repository shipping
1849
+ *
1850
+ * ```
1851
+ * THEOKIT_AUTH_HOME=/tmp/attacker-store
1852
+ * ```
1853
+ *
1854
+ * redirects the credential store the moment the product starts in that directory — before any
1855
+ * trust prompt, because locating the store is what happens first.
1856
+ *
1857
+ * ## Why it lives here
1858
+ *
1859
+ * The scaffolding template (`create-theokit`, TUI surface) calls `process.loadEnvFile()` with no
1860
+ * guard, so every product generated from it starts exposed. One consumer found this and fixed it in
1861
+ * ~30 lines of its own. A defence each consumer has to rediscover is a defence most will not have,
1862
+ * and this one is invisible when missing: nothing fails, the store simply moves.
1863
+ *
1864
+ * ## Why the set is named
1865
+ *
1866
+ * A convention — "anything ending in `_HOME`", "anything with TRUST in it" — silently changes
1867
+ * meaning as variables are added, in the direction of accidentally sovereign or accidentally not.
1868
+ * The list is explicit so that making a variable sovereign is a deliberate act, and so a reader can
1869
+ * see the security boundary without grepping for it.
1870
+ *
1871
+ * @public
1872
+ */
1873
+ /**
1874
+ * Variables a project-scoped source may never set. Each either locates the credential store, names
1875
+ * the config directory that is read as configuration, or carries a trust decision.
1876
+ *
1877
+ * `THEOKIT_API_KEY` is deliberately ABSENT. A project supplying its own provider key through `.env`
1878
+ * is the documented, intended path — treating it as sovereign would break every scaffolded product
1879
+ * to defend nothing, since a key the project supplies is a key the project already has.
1880
+ *
1881
+ * @public
1882
+ */
1883
+ declare const SOVEREIGN_ENV_KEYS: readonly ["THEOKIT_HOME", "THEOKIT_AUTH_HOME", "THEOKIT_DIR_NAME", "THEOKIT_TRUSTED_PROVIDERS", "THEOKIT_REDACT_SECRETS", "THEOKIT_OAUTH_TX_SALT"];
1884
+ /** @public */
1885
+ type SovereignEnvKey = (typeof SOVEREIGN_ENV_KEYS)[number];
1886
+ /** The mutable shape of `process.env`, narrowed so a caller can pass a plain object in tests. */
1887
+ type MutableEnv = Record<string, string | undefined>;
1888
+ /**
1889
+ * Read the project's `.env` into `env`, then restore every {@link SOVEREIGN_ENV_KEYS} entry to the
1890
+ * value it had BEFORE the load — including restoring it to absent.
1891
+ *
1892
+ * Capture-then-restore rather than filtering the file: `process.loadEnvFile` offers no hook between
1893
+ * parsing and assignment, and reimplementing dotenv parsing to filter it would be a second parser
1894
+ * to keep in step with Node's. Restoring afterwards needs no parser and cannot disagree with one.
1895
+ *
1896
+ * @param env the environment to mutate. Defaults to `process.env`.
1897
+ * @param load performs the load. Defaults to `process.loadEnvFile` when the runtime has it, and to
1898
+ * `undefined` when it does not — in which case this is a no-op rather than a startup crash.
1899
+ * @public
1900
+ */
1901
+ declare function loadProjectEnv(env?: MutableEnv, load?: (() => void) | undefined): void;
1902
+
1838
1903
  /** The internal JSON-Schema shape the synthetic `output` tool consumes. */
1839
1904
  type NormalizedJsonSchema = Record<string, unknown>;
1840
1905
  /**
@@ -2510,4 +2575,4 @@ declare function toShareGptTrajectory(result: BatchResult, options?: {
2510
2575
  model?: string;
2511
2576
  }): ShareGptTrajectory | null;
2512
2577
 
2513
- 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 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, 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, Security, type SessionMessage, type SessionMessagePart, type SessionScope, type ShareGptMessage, type ShareGptTrajectory, SkillReadTool, SkillsSettings, 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, chargeAndCheckThresholds, computeCost, createCounterBudgetTracker, estimateTokens, extractRawId, getPricingEntry, inferApiMode, isValidTaskId, migrateSqliteToLance, mkMemoryId, normalizeSchema, normalizeUsage, preflightCheck, runGoalLoop, scopedConversationId, sessionScopePrefix, setDiagnosticsSink, toShareGptTrajectory, withCwdMutex };
2578
+ 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 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, 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 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, chargeAndCheckThresholds, computeCost, createCounterBudgetTracker, estimateTokens, extractRawId, getPricingEntry, inferApiMode, isValidTaskId, loadProjectEnv, migrateSqliteToLance, mkMemoryId, normalizeSchema, normalizeUsage, preflightCheck, runGoalLoop, scopedConversationId, sessionScopePrefix, setDiagnosticsSink, toShareGptTrajectory, withCwdMutex };
package/dist/index.js CHANGED
@@ -6,9 +6,9 @@ import './chunk-O3IZ7JEL.js';
6
6
  import { Workflow, agentStep } from './chunk-EON4YTR6.js';
7
7
  import './chunk-HK4HRLWE.js';
8
8
  import './chunk-CAH3G4IS.js';
9
- export { Cron } from './chunk-O67XODD5.js';
10
- import { MEMORY_EMBEDDING_ADAPTERS, resolveApiKey, DEFAULT_AGENTIC_MODEL_ID, Agent } from './chunk-V5V5A6B7.js';
11
- export { Agent, AgentBuilder, Tool, ToolError, UsageAccumulator, computeCost, getPricingEntry } from './chunk-V5V5A6B7.js';
9
+ export { Cron } from './chunk-MZQHVN7C.js';
10
+ import { MEMORY_EMBEDDING_ADAPTERS, resolveApiKey, DEFAULT_AGENTIC_MODEL_ID, Agent } from './chunk-XARLSCKA.js';
11
+ export { Agent, AgentBuilder, Tool, ToolError, UsageAccumulator, computeCost, getPricingEntry } from './chunk-XARLSCKA.js';
12
12
  import './chunk-UJ7HK7BX.js';
13
13
  import './chunk-2SFBB54R.js';
14
14
  import { configure, submit, list, get, cancel, subscribe } from './chunk-GNMPCZNN.js';
@@ -22,7 +22,7 @@ import './chunk-ZTEAJAE6.js';
22
22
  import { lanceStoragePath, LanceIndex, readFactsFromMarkdown, defaultIndexPath, openMemoryDb, memoryDir } from './chunk-RJBHWM6D.js';
23
23
  import './chunk-J5RW43IR.js';
24
24
  import './chunk-AM2CNBKE.js';
25
- import './chunk-ZZAAQOAZ.js';
25
+ import './chunk-3NLOQEJR.js';
26
26
  import './chunk-ZS6SLELQ.js';
27
27
  import './chunk-LLE7HPRI.js';
28
28
  import './chunk-SNKY3C2L.js';
@@ -31,7 +31,7 @@ import './chunk-FD2UT76F.js';
31
31
  import './chunk-U54XCYG3.js';
32
32
  import './chunk-RP5HQVLD.js';
33
33
  import './chunk-6X6ID4MO.js';
34
- import './chunk-UJ7IQJAG.js';
34
+ import './chunk-4NAKHID5.js';
35
35
  import './chunk-7AD3ZTZL.js';
36
36
  import './chunk-AZ6FKDQR.js';
37
37
  import './chunk-Q4DTGCSD.js';
@@ -1494,6 +1494,39 @@ var PermissionPlugin = class {
1494
1494
  }
1495
1495
  };
1496
1496
 
1497
+ // src/project-env.ts
1498
+ var SOVEREIGN_ENV_KEYS = [
1499
+ /** Locates the SDK home — sessions, and the credential store beneath it. */
1500
+ "THEOKIT_HOME",
1501
+ /** Locates the credential store explicitly, independently of `THEOKIT_HOME`. */
1502
+ "THEOKIT_AUTH_HOME",
1503
+ /** Names the project config directory, so it decides which files are READ as configuration. */
1504
+ "THEOKIT_DIR_NAME",
1505
+ /** A trust decision: which providers are honoured without further checks. */
1506
+ "THEOKIT_TRUSTED_PROVIDERS",
1507
+ /** Turning redaction off from a repository's `.env` would put secrets into logs. */
1508
+ "THEOKIT_REDACT_SECRETS",
1509
+ /** Cryptographic material for the OAuth transaction cookie. */
1510
+ "THEOKIT_OAUTH_TX_SALT"
1511
+ ];
1512
+ function loadProjectEnv(env = process.env, load = typeof process.loadEnvFile === "function" ? () => {
1513
+ process.loadEnvFile();
1514
+ } : void 0) {
1515
+ if (load === void 0) return;
1516
+ const sovereign = new Map(
1517
+ SOVEREIGN_ENV_KEYS.map((key) => [key, env[key]])
1518
+ );
1519
+ try {
1520
+ load();
1521
+ } catch {
1522
+ return;
1523
+ }
1524
+ for (const [key, original] of sovereign) {
1525
+ if (original === void 0) delete env[key];
1526
+ else env[key] = original;
1527
+ }
1528
+ }
1529
+
1497
1530
  // src/schema-normalizer.ts
1498
1531
  function isJsonSchemaObject(s) {
1499
1532
  if (typeof s !== "object" || s === null) return false;
@@ -1604,7 +1637,7 @@ function isBuiltAgent(m) {
1604
1637
  return typeof m.send === "function";
1605
1638
  }
1606
1639
  async function materialize(def, index) {
1607
- const { Agent: Agent2 } = await import('./agent-MVYGMWPM.js');
1640
+ const { Agent: Agent2 } = await import('./agent-GKX5FE5K.js');
1608
1641
  return Agent2.create({
1609
1642
  // `AgentDefinition.model` admits the sentinel `'inherit'`, which is not a model id. Inheriting
1610
1643
  // here means "declare nothing and let the default apply" — forwarding the literal would create
@@ -2089,6 +2122,6 @@ function safeStringify(v) {
2089
2122
  }
2090
2123
  }
2091
2124
 
2092
- export { AgentFactory, Budget, EventBus, JobQueue, Memory, NoopMemoryProvider, PermissionEngine, PermissionPlugin, Plugin, Provider, Security, Skill, SkillReadTool, Squad, Task, Theokit, TokenLimiter, UnicodeNormalizer, applyMode, chargeAndCheckThresholds, createCounterBudgetTracker, estimateTokens, extractRawId, inferApiMode, migrateSqliteToLance2 as migrateSqliteToLance, mkMemoryId, normalizeSchema, normalizeUsage, preflightCheck, runGoalLoop, scopedConversationId, sessionScopePrefix, toShareGptTrajectory };
2125
+ export { AgentFactory, Budget, EventBus, JobQueue, Memory, NoopMemoryProvider, PermissionEngine, PermissionPlugin, Plugin, Provider, SOVEREIGN_ENV_KEYS, Security, Skill, SkillReadTool, Squad, Task, Theokit, TokenLimiter, UnicodeNormalizer, applyMode, chargeAndCheckThresholds, createCounterBudgetTracker, estimateTokens, extractRawId, inferApiMode, loadProjectEnv, migrateSqliteToLance2 as migrateSqliteToLance, mkMemoryId, normalizeSchema, normalizeUsage, preflightCheck, runGoalLoop, scopedConversationId, sessionScopePrefix, toShareGptTrajectory };
2093
2126
  //# sourceMappingURL=index.js.map
2094
2127
  //# sourceMappingURL=index.js.map