@theokit/sdk 4.43.0 → 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.
- package/CHANGELOG.md +26 -0
- package/dist/index.cjs +35 -0
- 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 +34 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -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
|
@@ -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;
|
|
@@ -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
|