@theokit/sdk 4.45.0 → 4.46.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 +22 -0
- package/dist/index.cjs +39 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +63 -1
- package/dist/index.d.ts +63 -1
- package/dist/index.js +38 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1578,6 +1578,68 @@ declare class JobQueue {
|
|
|
1578
1578
|
cancel(id: string): boolean;
|
|
1579
1579
|
}
|
|
1580
1580
|
|
|
1581
|
+
/**
|
|
1582
|
+
* Fold configuration layers in a declared order — later layers win, named keys accumulate.
|
|
1583
|
+
*
|
|
1584
|
+
* Every product that reads configuration from more than one place rebuilds these two rules, and the
|
|
1585
|
+
* second one is not a nicety. With plain last-wins, a project file DISPLACES the user's entries for
|
|
1586
|
+
* a list-valued key rather than adding to them — and for a key like `hooks`, which carries arbitrary
|
|
1587
|
+
* command execution, that is the difference between a repository adding a hook and a repository
|
|
1588
|
+
* removing yours.
|
|
1589
|
+
*
|
|
1590
|
+
* The layer NAMES are the caller's, supplied as data. One product's chain is
|
|
1591
|
+
* defaults/user/project/profile/env/cli; `profile` is that product's idea and does not belong here.
|
|
1592
|
+
* That is the same test the security floor passed: a vocabulary expressible as data generalises, an
|
|
1593
|
+
* open-ended interface shaped by one product does not.
|
|
1594
|
+
*
|
|
1595
|
+
* @public
|
|
1596
|
+
*/
|
|
1597
|
+
|
|
1598
|
+
/** Raised when a declared layer chain is not strictly ascending. @public */
|
|
1599
|
+
declare class LayerOrderError extends TheokitAgentError {
|
|
1600
|
+
readonly name = "LayerOrderError";
|
|
1601
|
+
}
|
|
1602
|
+
/** @public */
|
|
1603
|
+
interface DeclaredLayer {
|
|
1604
|
+
readonly layer: string;
|
|
1605
|
+
/** Higher wins. Optional — omit it to mean "this array is already the order". */
|
|
1606
|
+
readonly precedence?: number;
|
|
1607
|
+
}
|
|
1608
|
+
/** @public */
|
|
1609
|
+
interface LayerValues extends DeclaredLayer {
|
|
1610
|
+
readonly values: Readonly<Record<string, unknown>>;
|
|
1611
|
+
}
|
|
1612
|
+
/**
|
|
1613
|
+
* Assert that each layer strictly outranks the one before it.
|
|
1614
|
+
*
|
|
1615
|
+
* Entries without a `precedence` are skipped rather than treated as zero: omitting it means the
|
|
1616
|
+
* caller is expressing order by position, and inventing a number for them would manufacture a
|
|
1617
|
+
* conflict out of a legitimate usage.
|
|
1618
|
+
*
|
|
1619
|
+
* @throws LayerOrderError naming both layers and both precedences — a refusal that only says "out
|
|
1620
|
+
* of order" sends the reader to compare the whole list by hand.
|
|
1621
|
+
* @public
|
|
1622
|
+
*/
|
|
1623
|
+
declare function verifyLayerOrdering(layers: readonly DeclaredLayer[]): void;
|
|
1624
|
+
/**
|
|
1625
|
+
* Combine `entries` into one record.
|
|
1626
|
+
*
|
|
1627
|
+
* Later entries win. A value of `undefined` never overwrites — a layer that does not mention a key
|
|
1628
|
+
* must not erase it, because "said nothing" is overwhelmingly more common than "said nothing on
|
|
1629
|
+
* purpose".
|
|
1630
|
+
*
|
|
1631
|
+
* Keys in `accumulatingKeys` whose value is an array are CONCATENATED across layers instead of
|
|
1632
|
+
* replaced. A non-array value for such a key replaces, deliberately: a malformed config must not
|
|
1633
|
+
* corrupt the accumulator into a mixed list, and leaving the raw value visible lets the consumer's
|
|
1634
|
+
* own validation reject it with its own message.
|
|
1635
|
+
*
|
|
1636
|
+
* The accumulator is per-call and the inputs are never mutated, so folding twice yields the same
|
|
1637
|
+
* answer — which a consumer that folds once to display and once to apply depends on.
|
|
1638
|
+
*
|
|
1639
|
+
* @public
|
|
1640
|
+
*/
|
|
1641
|
+
declare function foldLayers(entries: readonly LayerValues[], accumulatingKeys?: readonly string[]): Record<string, unknown>;
|
|
1642
|
+
|
|
1581
1643
|
/**
|
|
1582
1644
|
* Public handle to an open memory index. Mirrors the internal `MemoryIndex`
|
|
1583
1645
|
* contract structurally; defined here (NOT re-exported from internal/) so
|
|
@@ -2633,4 +2695,4 @@ declare function toShareGptTrajectory(result: BatchResult, options?: {
|
|
|
2633
2695
|
model?: string;
|
|
2634
2696
|
}): ShareGptTrajectory | null;
|
|
2635
2697
|
|
|
2636
|
-
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 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, getPricingEntry, inferApiMode, isValidTaskId, loadProjectEnv, migrateSqliteToLance, mkMemoryId, normalizeSchema, normalizeUsage, preflightCheck, runGoalLoop, scopedConversationId, sessionScopePrefix, setDiagnosticsSink, toShareGptTrajectory, withCwdMutex };
|
|
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 };
|
package/dist/index.d.ts
CHANGED
|
@@ -1578,6 +1578,68 @@ declare class JobQueue {
|
|
|
1578
1578
|
cancel(id: string): boolean;
|
|
1579
1579
|
}
|
|
1580
1580
|
|
|
1581
|
+
/**
|
|
1582
|
+
* Fold configuration layers in a declared order — later layers win, named keys accumulate.
|
|
1583
|
+
*
|
|
1584
|
+
* Every product that reads configuration from more than one place rebuilds these two rules, and the
|
|
1585
|
+
* second one is not a nicety. With plain last-wins, a project file DISPLACES the user's entries for
|
|
1586
|
+
* a list-valued key rather than adding to them — and for a key like `hooks`, which carries arbitrary
|
|
1587
|
+
* command execution, that is the difference between a repository adding a hook and a repository
|
|
1588
|
+
* removing yours.
|
|
1589
|
+
*
|
|
1590
|
+
* The layer NAMES are the caller's, supplied as data. One product's chain is
|
|
1591
|
+
* defaults/user/project/profile/env/cli; `profile` is that product's idea and does not belong here.
|
|
1592
|
+
* That is the same test the security floor passed: a vocabulary expressible as data generalises, an
|
|
1593
|
+
* open-ended interface shaped by one product does not.
|
|
1594
|
+
*
|
|
1595
|
+
* @public
|
|
1596
|
+
*/
|
|
1597
|
+
|
|
1598
|
+
/** Raised when a declared layer chain is not strictly ascending. @public */
|
|
1599
|
+
declare class LayerOrderError extends TheokitAgentError {
|
|
1600
|
+
readonly name = "LayerOrderError";
|
|
1601
|
+
}
|
|
1602
|
+
/** @public */
|
|
1603
|
+
interface DeclaredLayer {
|
|
1604
|
+
readonly layer: string;
|
|
1605
|
+
/** Higher wins. Optional — omit it to mean "this array is already the order". */
|
|
1606
|
+
readonly precedence?: number;
|
|
1607
|
+
}
|
|
1608
|
+
/** @public */
|
|
1609
|
+
interface LayerValues extends DeclaredLayer {
|
|
1610
|
+
readonly values: Readonly<Record<string, unknown>>;
|
|
1611
|
+
}
|
|
1612
|
+
/**
|
|
1613
|
+
* Assert that each layer strictly outranks the one before it.
|
|
1614
|
+
*
|
|
1615
|
+
* Entries without a `precedence` are skipped rather than treated as zero: omitting it means the
|
|
1616
|
+
* caller is expressing order by position, and inventing a number for them would manufacture a
|
|
1617
|
+
* conflict out of a legitimate usage.
|
|
1618
|
+
*
|
|
1619
|
+
* @throws LayerOrderError naming both layers and both precedences — a refusal that only says "out
|
|
1620
|
+
* of order" sends the reader to compare the whole list by hand.
|
|
1621
|
+
* @public
|
|
1622
|
+
*/
|
|
1623
|
+
declare function verifyLayerOrdering(layers: readonly DeclaredLayer[]): void;
|
|
1624
|
+
/**
|
|
1625
|
+
* Combine `entries` into one record.
|
|
1626
|
+
*
|
|
1627
|
+
* Later entries win. A value of `undefined` never overwrites — a layer that does not mention a key
|
|
1628
|
+
* must not erase it, because "said nothing" is overwhelmingly more common than "said nothing on
|
|
1629
|
+
* purpose".
|
|
1630
|
+
*
|
|
1631
|
+
* Keys in `accumulatingKeys` whose value is an array are CONCATENATED across layers instead of
|
|
1632
|
+
* replaced. A non-array value for such a key replaces, deliberately: a malformed config must not
|
|
1633
|
+
* corrupt the accumulator into a mixed list, and leaving the raw value visible lets the consumer's
|
|
1634
|
+
* own validation reject it with its own message.
|
|
1635
|
+
*
|
|
1636
|
+
* The accumulator is per-call and the inputs are never mutated, so folding twice yields the same
|
|
1637
|
+
* answer — which a consumer that folds once to display and once to apply depends on.
|
|
1638
|
+
*
|
|
1639
|
+
* @public
|
|
1640
|
+
*/
|
|
1641
|
+
declare function foldLayers(entries: readonly LayerValues[], accumulatingKeys?: readonly string[]): Record<string, unknown>;
|
|
1642
|
+
|
|
1581
1643
|
/**
|
|
1582
1644
|
* Public handle to an open memory index. Mirrors the internal `MemoryIndex`
|
|
1583
1645
|
* contract structurally; defined here (NOT re-exported from internal/) so
|
|
@@ -2633,4 +2695,4 @@ declare function toShareGptTrajectory(result: BatchResult, options?: {
|
|
|
2633
2695
|
model?: string;
|
|
2634
2696
|
}): ShareGptTrajectory | null;
|
|
2635
2697
|
|
|
2636
|
-
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 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, getPricingEntry, inferApiMode, isValidTaskId, loadProjectEnv, migrateSqliteToLance, mkMemoryId, normalizeSchema, normalizeUsage, preflightCheck, runGoalLoop, scopedConversationId, sessionScopePrefix, setDiagnosticsSink, toShareGptTrajectory, withCwdMutex };
|
|
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 };
|
package/dist/index.js
CHANGED
|
@@ -53,7 +53,7 @@ import './chunk-5NBUH3NO.js';
|
|
|
53
53
|
import './chunk-2S6B5B2A.js';
|
|
54
54
|
import './chunk-6FSQ3CHQ.js';
|
|
55
55
|
import './chunk-OLLOUAUJ.js';
|
|
56
|
-
import { BudgetExceededError, MemoryAdapterError, AuthenticationError, ConfigurationError } from './chunk-MRKSSN36.js';
|
|
56
|
+
import { BudgetExceededError, TheokitAgentError, MemoryAdapterError, AuthenticationError, ConfigurationError } from './chunk-MRKSSN36.js';
|
|
57
57
|
export { AgentDisposedError, AgentRunError, AuthenticationError, BudgetExceededError, ConfigurationError, IntegrationNotConnectedError, InvalidTaskIdError, MemoryAdapterError, NetworkError, RateLimitError, TaskNotFoundError, TheokitAgentError, UnknownAgentError, UnsupportedBudgetOperationError, UnsupportedRunOperationError, UnsupportedTaskOperationError, isTransientError } from './chunk-MRKSSN36.js';
|
|
58
58
|
import { diag, redactSecrets, addPattern } from './chunk-PBML2FHN.js';
|
|
59
59
|
export { setDiagnosticsSink } from './chunk-PBML2FHN.js';
|
|
@@ -922,6 +922,42 @@ var JobQueue = class {
|
|
|
922
922
|
if (next !== void 0) next();
|
|
923
923
|
}
|
|
924
924
|
};
|
|
925
|
+
|
|
926
|
+
// src/layer-fold.ts
|
|
927
|
+
var LayerOrderError = class extends TheokitAgentError {
|
|
928
|
+
name = "LayerOrderError";
|
|
929
|
+
};
|
|
930
|
+
function verifyLayerOrdering(layers) {
|
|
931
|
+
let previous;
|
|
932
|
+
for (const current of layers) {
|
|
933
|
+
if (current.precedence === void 0) continue;
|
|
934
|
+
const declared = { layer: current.layer, precedence: current.precedence };
|
|
935
|
+
if (previous !== void 0 && declared.precedence <= previous.precedence) {
|
|
936
|
+
throw new LayerOrderError(
|
|
937
|
+
`layers out of order: \`${declared.layer}\` (precedence ${String(declared.precedence)}) comes after \`${previous.layer}\` (precedence ${String(previous.precedence)}) but does not outrank it`
|
|
938
|
+
);
|
|
939
|
+
}
|
|
940
|
+
previous = declared;
|
|
941
|
+
}
|
|
942
|
+
}
|
|
943
|
+
function foldLayers(entries, accumulatingKeys = []) {
|
|
944
|
+
verifyLayerOrdering(entries);
|
|
945
|
+
const accumulated = new Map(accumulatingKeys.map((k) => [k, []]));
|
|
946
|
+
const combined = {};
|
|
947
|
+
for (const { values } of entries) {
|
|
948
|
+
for (const [key, value] of Object.entries(values)) {
|
|
949
|
+
if (value === void 0) continue;
|
|
950
|
+
const stack = accumulated.get(key);
|
|
951
|
+
if (stack !== void 0 && Array.isArray(value)) {
|
|
952
|
+
stack.push(...value);
|
|
953
|
+
combined[key] = [...stack];
|
|
954
|
+
continue;
|
|
955
|
+
}
|
|
956
|
+
combined[key] = value;
|
|
957
|
+
}
|
|
958
|
+
}
|
|
959
|
+
return combined;
|
|
960
|
+
}
|
|
925
961
|
function diaryPath(cwd) {
|
|
926
962
|
return join(memoryDir(cwd), "dream-diary.md");
|
|
927
963
|
}
|
|
@@ -2155,6 +2191,6 @@ function safeStringify(v) {
|
|
|
2155
2191
|
}
|
|
2156
2192
|
}
|
|
2157
2193
|
|
|
2158
|
-
export { AgentFactory, Budget, EventBus, JobQueue, Memory, NoopMemoryProvider, PermissionEngine, PermissionPlugin, Plugin, Provider, SOVEREIGN_ENV_KEYS, Security, Skill, SkillReadTool, Squad, Task, Theokit, TokenLimiter, UnicodeNormalizer, applyMode, applySecurityFloor, chargeAndCheckThresholds, createCounterBudgetTracker, estimateTokens, extractRawId, inferApiMode, loadProjectEnv, migrateSqliteToLance2 as migrateSqliteToLance, mkMemoryId, normalizeSchema, normalizeUsage, preflightCheck, runGoalLoop, scopedConversationId, sessionScopePrefix, toShareGptTrajectory };
|
|
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 };
|
|
2159
2195
|
//# sourceMappingURL=index.js.map
|
|
2160
2196
|
//# sourceMappingURL=index.js.map
|