@kodax-ai/kodax 0.7.48 → 0.7.49
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 +1741 -1720
- package/README.md +80 -27
- package/README_CN.md +60 -15
- package/dist/builtin/code-review/SKILL.md +1 -1
- package/dist/chunks/argument-completer-GDG5OHN7.js +2 -0
- package/dist/chunks/{chunk-LNJNRREL.js → chunk-67SWUEEN.js} +412 -280
- package/dist/chunks/chunk-C5PKZX5Z.js +291 -0
- package/dist/chunks/chunk-ISGHUKRY.js +428 -0
- package/dist/chunks/chunk-JTHMWRXM.js +566 -0
- package/dist/chunks/chunk-TYZAH3YP.js +2 -0
- package/dist/chunks/chunk-YACQ4OST.js +31 -0
- package/dist/chunks/{chunk-DEODZG6Q.js → chunk-YW4RQV7U.js} +1 -1
- package/dist/chunks/{compaction-config-YWCHOP2U.js → compaction-config-BQBYOWX2.js} +1 -1
- package/dist/chunks/{construction-bootstrap-AIWATBWW.js → construction-bootstrap-5TFGMSWQ.js} +1 -1
- package/dist/chunks/{dist-IDNOAB4M.js → dist-BL7IBQHD.js} +1 -1
- package/dist/chunks/dist-D7HOETCE.js +2 -0
- package/dist/chunks/{utils-OG57XTPC.js → utils-XWDT3W5X.js} +1 -1
- package/dist/index.d.ts +11 -11
- package/dist/index.js +2 -2
- package/dist/kodax_cli.js +1325 -892
- package/dist/provider-capabilities.json +193 -190
- package/dist/sdk-agent.d.ts +205 -103
- package/dist/sdk-agent.js +1 -1
- package/dist/sdk-coding.d.ts +534 -33
- package/dist/sdk-coding.js +1 -1
- package/dist/sdk-llm.d.ts +5 -5
- package/dist/sdk-llm.js +1 -1
- package/dist/sdk-mcp.js +1 -1
- package/dist/sdk-repl.d.ts +11 -10
- package/dist/sdk-repl.js +1 -1
- package/dist/sdk-session.d.ts +6 -3
- package/dist/sdk-session.js +1 -1
- package/dist/sdk-skills.js +1 -1
- package/dist/types-chunks/{base.d-BdJKSPO2.d.ts → base.d-C4jYVjJh.d.ts} +2 -1
- package/dist/types-chunks/{bash-prefix-extractor.d-DNO2-ycp.d.ts → bash-prefix-extractor.d-CI_xcPhn.d.ts} +68 -7
- package/dist/types-chunks/{file-tracker.d-D7L_SbRm.d.ts → capsule.d-DaPuhyyK.d.ts} +170 -5
- package/dist/types-chunks/{resolver.d-DkgJlEzr.d.ts → resolver.d-B_wm409c.d.ts} +2 -2
- package/dist/types-chunks/{storage.d-B1Jk6ryM.d.ts → storage.d-J2GqOgaX.d.ts} +4 -1
- package/dist/types-chunks/{types.d-BCnbYG_A.d.ts → types.d-BR9oNWup.d.ts} +363 -4
- package/dist/types-chunks/{types.d-B_MIIApc.d.ts → types.d-BnjX2Gn4.d.ts} +6 -1
- package/dist/types-chunks/{types.d-Cf-GCzac.d.ts → types.d-rPRl2LSB.d.ts} +4 -0
- package/dist/types-chunks/{utils.d-Dgy5SVrq.d.ts → utils.d-BJ_-y8gC.d.ts} +42 -8
- package/package.json +1 -1
- package/dist/chunks/chunk-66B6ZOU7.js +0 -31
- package/dist/chunks/chunk-6Z75SHX3.js +0 -2
- package/dist/chunks/chunk-EP46H5P3.js +0 -415
- package/dist/chunks/chunk-UHAP234X.js +0 -567
- package/dist/chunks/dist-4WABQRJU.js +0 -2
- package/dist/types-chunks/types.d-C5mHR87z.d.ts +0 -119
package/dist/sdk-agent.d.ts
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { s as KodaXSessionLineage, g as KodaXGoalState, f as KodaXGoalEventType, o as KodaXSessionEntry, q as KodaXSessionGoalEntry, k as KodaXSessionArtifactLedgerEntry, d as KodaXExtensionStore, e as KodaXExtensionStoreEntry, i as KodaXJsonValue } from './types-chunks/types.d-
|
|
2
|
-
export { K as KodaXCompactMemoryProgress, a as KodaXCompactMemorySeed, b as KodaXExtensionSessionRecord, c as KodaXExtensionSessionState, h as KodaXGoalStatus, j as KodaXSessionArchiveMarkerEntry, l as KodaXSessionBranchSummaryEntry, m as KodaXSessionCompactionEntry, n as KodaXSessionData, p as KodaXSessionEntryBase, r as KodaXSessionLabelEntry, t as KodaXSessionMessageEntry, u as KodaXSessionMeta, v as KodaXSessionNavigationOptions, w as KodaXSessionRuntimeInfo, x as KodaXSessionScope, y as KodaXSessionStorage, z as KodaXSessionTreeNode, A as KodaXSessionUiHistoryItem, B as KodaXSessionUiHistoryItemType, C as KodaXSessionWorkspaceKind, S as SessionErrorMetadata } from './types-chunks/types.d-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { s as KodaXSessionLineage, g as KodaXGoalState, f as KodaXGoalEventType, o as KodaXSessionEntry, q as KodaXSessionGoalEntry, k as KodaXSessionArtifactLedgerEntry, d as KodaXExtensionStore, e as KodaXExtensionStoreEntry, i as KodaXJsonValue } from './types-chunks/types.d-BnjX2Gn4.js';
|
|
2
|
+
export { K as KodaXCompactMemoryProgress, a as KodaXCompactMemorySeed, b as KodaXExtensionSessionRecord, c as KodaXExtensionSessionState, h as KodaXGoalStatus, j as KodaXSessionArchiveMarkerEntry, l as KodaXSessionBranchSummaryEntry, m as KodaXSessionCompactionEntry, n as KodaXSessionData, p as KodaXSessionEntryBase, r as KodaXSessionLabelEntry, t as KodaXSessionMessageEntry, u as KodaXSessionMeta, v as KodaXSessionNavigationOptions, w as KodaXSessionRuntimeInfo, x as KodaXSessionScope, y as KodaXSessionStorage, z as KodaXSessionTreeNode, A as KodaXSessionUiHistoryItem, B as KodaXSessionUiHistoryItemType, C as KodaXSessionWorkspaceKind, S as SessionErrorMetadata } from './types-chunks/types.d-BnjX2Gn4.js';
|
|
3
|
+
import { M as MessageQueue, H as WorkflowScriptManifest } from './types-chunks/capsule.d-DaPuhyyK.js';
|
|
4
|
+
export { C as CompactionContext, a as CompactionEntry, b as CompactionEntryPayload, c as CompactionPolicy, d as CreateWorkflowCapsuleInput, D as DefaultSummaryCompaction, e as DefaultSummaryCompactionOptions, K as KODAX_API_MIN_INTERVAL, f as KODAX_DEFAULT_TIMEOUT, g as KODAX_HARD_TIMEOUT, h as KODAX_MAX_INCOMPLETE_RETRIES, i as KODAX_MAX_MAXTOKENS_RETRIES, j as KODAX_MAX_RETRIES, k as KODAX_MAX_TOKENS, l as KODAX_RETRY_BASE_DELAY, m as KODAX_STAGGER_DELAY, L as LINEAGE_ENTRY_TYPES, n as LineageArtifactLedgerPayload, o as LineageCompaction, p as LineageCompactionDelegates, q as LineageEntryType, r as LineageExtension, s as LineageLabelPayload, t as LineageTreeNode, P as PROMISE_PATTERN, u as PolicyCompactionResult, W as WORKFLOW_CAPSULE_API_VERSION, v as WORKFLOW_CAPSULE_FORMAT, w as WORKFLOW_CAPSULE_VERSION, x as WORKFLOW_PATTERN_IDS, y as WorkflowCapsule, z as WorkflowCapsuleEnvironmentRequirement, A as WorkflowCapsuleInputs, B as WorkflowCapsuleIntent, E as WorkflowCapsuleProvenance, F as WorkflowCapsuleRequirements, G as WorkflowPatternId, _ as _resetMessageQueueForTests, I as appendSessionLineageLabel, J as applyLineageTruncation, N as applySessionCompaction, O as archiveOldIslands, Q as buildSessionTree, R as cleanupIncompleteToolCalls, S as countActiveLineageMessages, T as countTokens, U as createSessionLineage, V as createWorkflowCapsule, X as createWorkflowModuleFromCapsule, Y as estimateTokens, Z as extractArtifactLedger, $ as extractFileOps, a0 as extractTitleFromMessages, a1 as findPreviousUserEntryId, a2 as forkSessionLineage, a3 as generateSessionId, a4 as getAgentConfigHome, a5 as getAgentConfigPath, a6 as getAppDataDir, a7 as getMessageQueue, a8 as getSessionLineagePath, a9 as getSessionMessagesFromLineage, aa as mergeArtifactLedger, ab as mergeFileOps, ac as resolveSessionLineageTarget, ad as rewindSessionLineage, ae as setAgentConfigHome, af as setSessionLineageActiveEntry, ag as validateAndFixToolHistory, ah as validateWorkflowCapsule, ai as validateWorkflowScriptManifest } from './types-chunks/capsule.d-DaPuhyyK.js';
|
|
5
|
+
import { au as Span, aP as Trace, d as Agent, M as Handoff, aj as RunnerToolCall, am as RunnerToolResult, f as AgentMessage, e as AgentManifest, V as ManifestPatch, R as InvariantId, a2 as QualityInvariant, a4 as QueuedMessage, Y as MessagePriority, C as ChildTaskRegistry, X as MessageMode, w as DiscoveredInstance, as as SessionMeta, at as SessionStateSnapshot, aB as StateWriterFs, Q as InstanceDiscoveryFs, aA as StateWriter, aD as StopHookContext, aF as StopHookResult, aE as StopHookFn, p as CompactionDetails, o as CompactionConfig, q as CompactionResult, aV as WorkflowApi, b6 as WorkflowModule, aU as WorkflowAgentBackend, b2 as WorkflowLimits, a_ as WorkflowEvent, b3 as WorkflowLogEvent, b9 as WorkflowRunState } from './types-chunks/types.d-BR9oNWup.js';
|
|
6
|
+
export { A as AdmissionAuditOptions, a as AdmissionCtx, b as AdmissionVerdict, c as AdmittedHandle, g as AgentMiddlewareDeclaration, h as AgentReasoningProfile, i as AgentSpanData, j as AgentTool, k as AskUserMultiOptions, l as AskUserQuestionItem, m as AskUserQuestionOptions, n as CompactionAnchor, r as CompactionSpanData, s as CompactionUpdate, t as CurrentTodoSummary, D as DEFAULT_SYSTEM_CAP, u as Deliverable, v as DequeueFilter, x as DiscoveryOptions, E as EnqueueInput, y as EvidenceSpanData, F as FanoutSpanData, z as FileOperations, G as GenerationSpanData, B as Guardrail, H as GuardrailBlockedError, I as GuardrailContext, J as GuardrailEscalateError, K as GuardrailSpanData, L as GuardrailVerdict, N as HandoffSpanData, O as InMemorySessionOptions, P as InputGuardrail, S as InvariantResult, T as InvariantSession, U as MAX_TOOL_LOOP_ITERATIONS, W as MessageEntry, Z as ObserveCtx, _ as OutputGuardrail, $ as PersistedSessionState, a0 as PresetDispatcher, a1 as PresetTracingContext, a5 as ReadonlyMutationTracker, a6 as ReadonlyRecorder, a7 as ReasoningDepth, a8 as RecentlyModifiedFile, a9 as RequestTaskStopOptions, aa as RequestTaskStopResult, ab as RunEvent, ac as RunOptions, ad as RunResult, ae as RunnableTool, af as Runner, ag as RunnerEvent, ah as RunnerLlmResult, ai as RunnerLlmReturn, ak as RunnerToolContext, al as RunnerToolObserver, an as Session, ao as SessionDispatchResult, ap as SessionEntry, aq as SessionExtension, ar as SessionForkOptions, av as SpanData, aw as SpanError, ax as SpanImpl, ay as SpanImplOptions, az as StartTraceOptions, aC as StateWriterOptions, aG as StopHookSpanData, aH as SystemCap, aI as TaskAbortRegistry, aJ as TerminalCtx, aK as ToolBeforeOutcome, aL as ToolCallSpanData, aM as ToolCapability, aN as ToolGuardrail, aO as ToolPermission, aQ as TraceOptions, aR as Tracer, aS as TracerOptions, aT as UserInteraction, aW as WorkflowApproval, aX as WorkflowApprovalSummary, aY as WorkflowArtifactRef, aZ as WorkflowBudget, a$ as WorkflowEventRecorder, b0 as WorkflowEventType, b1 as WorkflowIsolation, b4 as WorkflowMeta, b5 as WorkflowModelHint, b7 as WorkflowParallelOptions, b8 as WorkflowRun, ba as WorkflowRunStatus, bb as WorkflowSpawnAgentInput, bc as WorkflowSynthesis, bd as WorkflowSynthesizeInput, be as WorkflowTaskHandle, bf as WorkflowTaskResult, bg as WorkflowTaskSnapshot, bh as WorkflowTaskStatus, bi as WorkflowTaskUsage, bj as WorkflowWaitOptions, bk as _resetAdmittedAgentBindings, bl as _resetPresetDispatchers, bm as buildAssistantMessageFromLlmResult, bn as buildSystemPrompt, bo as buildToolResultMessage, bp as collectGuardrails, bq as createAgent, br as createHandoff, bs as createInMemorySession, bt as createInvariantSessionForAgent, bu as createStateWriter, bv as createTrace, bw as defaultTracer, bx as detectInstructionsInjection, by as discoverInstances, bz as executeRunnerToolCall, bA as extractAssistantTextFromMessage, bB as getActiveUserInteraction, bC as getAdmittedAgentBindings, bD as isRunnableTool, bE as isRunnerLlmResult, bF as registerChildTask, bG as registerPresetDispatcher, bH as requestTaskStop, bI as runAdmissionAudit, bJ as runInputGuardrails, bK as runOutputGuardrails, bL as runToolAfterGuardrails, bM as runToolBeforeGuardrails, bN as setActiveUserInteraction, bO as setAdmittedAgentBindings } from './types-chunks/types.d-BR9oNWup.js';
|
|
7
|
+
import { n as KodaXMessage, Y as KodaXToolDefinition, a1 as KodaXToolUseBlock } from './types-chunks/types.d-rPRl2LSB.js';
|
|
8
|
+
export { e as KodaXAssuranceIntent, g as KodaXContentBlock, i as KodaXExecutionMode, j as KodaXExecutionPattern, l as KodaXImageBlock, p as KodaXMutationSurface, s as KodaXProviderConfig, A as KodaXProviderStreamOptions, D as KodaXReasoningCapability, E as KodaXReasoningMode, G as KodaXReasoningRequest, H as KodaXRedactedThinkingBlock, J as KodaXRiskLevel, L as KodaXStreamResult, M as KodaXTaskActionability, N as KodaXTaskBudgetOverrides, O as KodaXTaskComplexity, P as KodaXTaskFamily, Q as KodaXTaskRoutingDecision, R as KodaXTaskType, S as KodaXTaskWorkIntent, T as KodaXTextBlock, U as KodaXThinkingBlock, V as KodaXThinkingBudgetMap, W as KodaXThinkingDepth, X as KodaXTokenUsage, Z as KodaXToolResultBlock } from './types-chunks/types.d-rPRl2LSB.js';
|
|
8
9
|
export { C as CapabilityKind, a as CapabilityProvider, b as CapabilityResult } from './types-chunks/capability.d-3C62G8Eq.js';
|
|
9
10
|
import { ChildProcess } from 'node:child_process';
|
|
10
|
-
import {
|
|
11
|
+
import { K as KodaXBaseProvider } from './types-chunks/base.d-C4jYVjJh.js';
|
|
11
12
|
export { M as McpConnectMode, a as McpServerConfig, b as McpServersConfig, c as McpTransportKind } from './types-chunks/config.d-CJy1WENT.js';
|
|
12
13
|
export { A as AuthorizationServerMetadata, D as DiscoveredOAuthEndpoints, M as McpAuthRequiredError, a as McpCapabilityDescriptor, b as McpCapabilityKind, c as McpCapabilityProvider, d as McpCapabilityRisk, e as McpCatalogItem, f as McpElicitRequest, g as McpElicitResult, h as McpExpiredSessionError, i as McpIcon, j as McpManager, k as McpProviderOptions, l as McpReverseCapabilities, m as McpRoot, n as McpSamplingRequest, o as McpSamplingResult, p as McpServerCatalog, q as McpServerCatalogSnapshot, r as McpServerLogs, s as McpServerRuntime, t as McpServerRuntimeDiagnostics, u as McpServerStatus, v as McpServerToolList, w as McpToolTaskSupport, x as McpTransport, y as McpTransportEvents, O as OAuthClientInfo, z as OAuthLoginConsent, P as PerformOAuthLoginOptions, B as ProtectedResourceMetadata, W as WwwAuthenticateChallenge, C as buildInitializeCapabilities, E as createMcpCapabilityId, F as createMcpManager, G as createMcpTransport, H as defaultMcpCacheDir, I as discoverAuthorizationServerMetadata, J as discoverOAuthEndpoints, K as discoverProtectedResourceMetadata, L as extractInsufficientScope, N as extractResourceMetadataUrl, Q as getMcpCachePaths, R as loadValidToken, S as parseMcpCapabilityId, T as performOAuthLogin, U as registerOAuthClient, V as searchMcpCatalog } from './types-chunks/manager.d-DLmDhX3i.js';
|
|
13
14
|
export { createMcpTestServerFixture } from './sdk-mcp.js';
|
|
14
15
|
export { DiscoveryResult, ExecutionMode, ExecutionOptions, ISkillRegistry, IVariableResolver, Skill, SkillArtifact, SkillContext, SkillDynamicContextExecutor, SkillExecutor, SkillExpansionResult, SkillFile, SkillFrontmatter, SkillHook, SkillHooks, SkillMetadata, SkillPathsConfig, SkillRegistry, SkillResult, SkillSource, VariableResolver, clearPluginSkillPaths, createExecutor, createResolver, discoverSkills, discoverSkillsWithMonorepo, executeSkill, expandSkillForLLM, formatSkillActivationMessage, getDefaultSkillPaths, getNestedSkillPaths, getSkillPathsFlat, getSkillRegistry, initializeSkillRegistry, listPluginSkillPaths, loadFullSkill, loadSkillFileContent, loadSkillMetadata, parseArguments, parseSkillMarkdown, registerPluginSkillPath, resetSkillRegistry, resolveSkillContent, unregisterPluginSkillPath } from './sdk-skills.js';
|
|
15
|
-
import { K as KodaXBaseProvider } from './types-chunks/base.d-BdJKSPO2.js';
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
18
|
* TracingProcessor — sink for span/trace lifecycle events.
|
|
@@ -517,98 +517,6 @@ interface CleanupOptions {
|
|
|
517
517
|
declare function registerManagedChildProcess(child: ChildProcess, metadata: ManagedChildProcessMetadata): () => void;
|
|
518
518
|
declare function cleanupRegisteredManagedChildren(options?: CleanupOptions): Promise<ManagedChildCleanupSummary>;
|
|
519
519
|
|
|
520
|
-
/**
|
|
521
|
-
* @kodax-ai/agent/messaging/queue — 2-tier agentId-scoped FIFO message queue.
|
|
522
|
-
*
|
|
523
|
-
* FEATURE_115 (v0.7.36).
|
|
524
|
-
*
|
|
525
|
-
* Invariants:
|
|
526
|
-
* - In-priority FIFO: messages of the same priority drain in enqueue order.
|
|
527
|
-
* - Cross-priority precedence: 'user' drains before 'background', regardless
|
|
528
|
-
* of enqueue order.
|
|
529
|
-
* - agentId routing: messages addressed to agentId X are only visible to
|
|
530
|
-
* consumers filtering for that exact agentId. undefined ≠ "any agent" —
|
|
531
|
-
* it specifically matches main-thread messages.
|
|
532
|
-
* - Not persistent: process restart loses queue state, by design (matches
|
|
533
|
-
* TodoStore semantics).
|
|
534
|
-
*
|
|
535
|
-
* The queue is process-global by default (`getMessageQueue()`); the class is
|
|
536
|
-
* also exported for tests / isolated downstream use.
|
|
537
|
-
*/
|
|
538
|
-
|
|
539
|
-
declare class MessageQueue {
|
|
540
|
-
private messages;
|
|
541
|
-
private nextSeq;
|
|
542
|
-
/**
|
|
543
|
-
* FEATURE_159 (v0.7.40) — observable subscription set. Same pattern as
|
|
544
|
-
* Claude Code's `messageQueueManager.ts` `createSignal()` substrate,
|
|
545
|
-
* but the listener carries a structured `QueueEvent` so SDK
|
|
546
|
-
* observability consumers (logger, tracer, metrics) can react per-
|
|
547
|
-
* event without re-diffing snapshots. `useSyncExternalStore` consumers
|
|
548
|
-
* still work — they ignore the event argument.
|
|
549
|
-
*
|
|
550
|
-
* Cached `snapshotRef` keeps reference identity stable across reads
|
|
551
|
-
* when nothing changed — required by React 18's `useSyncExternalStore`
|
|
552
|
-
* to avoid render loops.
|
|
553
|
-
*/
|
|
554
|
-
private listeners;
|
|
555
|
-
private snapshotRef;
|
|
556
|
-
private notify;
|
|
557
|
-
/**
|
|
558
|
-
* Subscribe to queue mutations. Compatible with React 18's
|
|
559
|
-
* `useSyncExternalStore(subscribe, getSnapshot)` — the hook passes a
|
|
560
|
-
* `() => void` callback, which is structurally assignable to the
|
|
561
|
-
* `QueueEventListener` parameter because TypeScript treats
|
|
562
|
-
* callback parameter discards as compatible. SDK consumers that
|
|
563
|
-
* declare a typed `(event: QueueEvent) => void` listener see the
|
|
564
|
-
* structured event.
|
|
565
|
-
*
|
|
566
|
-
* Listener is called synchronously after every mutation; returns an
|
|
567
|
-
* unsubscribe function.
|
|
568
|
-
*/
|
|
569
|
-
subscribe: (listener: QueueEventListener) => (() => void);
|
|
570
|
-
/**
|
|
571
|
-
* Returns the current frozen queue snapshot. Reference identity is
|
|
572
|
-
* stable across reads when the queue has not mutated, which is the
|
|
573
|
-
* contract React's `useSyncExternalStore` relies on.
|
|
574
|
-
*/
|
|
575
|
-
getSnapshot: () => readonly QueuedMessage[];
|
|
576
|
-
/** Returns the assigned id of the enqueued message. */
|
|
577
|
-
enqueue(input: EnqueueInput): string;
|
|
578
|
-
/**
|
|
579
|
-
* Drain matching messages, ordered by priority (user > background) then
|
|
580
|
-
* FIFO within each priority. Removes drained messages from the queue.
|
|
581
|
-
*/
|
|
582
|
-
dequeue(filter: DequeueFilter): QueuedMessage[];
|
|
583
|
-
/**
|
|
584
|
-
* Peek at matching messages without removing them. Returns messages in
|
|
585
|
-
* the same priority + FIFO order that `dequeue(filter)` would return,
|
|
586
|
-
* so callers can inspect what the next drain would yield.
|
|
587
|
-
*/
|
|
588
|
-
peek(filter: DequeueFilter): QueuedMessage[];
|
|
589
|
-
/** Total queue size across all priorities / agents. */
|
|
590
|
-
size(): number;
|
|
591
|
-
/** Count of messages matching the filter. */
|
|
592
|
-
count(filter: DequeueFilter): number;
|
|
593
|
-
/** True iff at least one message matches the filter. */
|
|
594
|
-
has(filter: DequeueFilter): boolean;
|
|
595
|
-
/** Remove all queued messages — used in tests / process abort scenarios. */
|
|
596
|
-
clear(): void;
|
|
597
|
-
}
|
|
598
|
-
/**
|
|
599
|
-
* Returns the process-global MessageQueue singleton, creating it lazily on
|
|
600
|
-
* first call. Use this for production wiring; instantiate `MessageQueue`
|
|
601
|
-
* directly in tests / isolated subsystems where a shared instance would
|
|
602
|
-
* cause cross-test pollution.
|
|
603
|
-
*/
|
|
604
|
-
declare function getMessageQueue(): MessageQueue;
|
|
605
|
-
/**
|
|
606
|
-
* Test-only reset hook. Production code MUST NOT call this. Underscored
|
|
607
|
-
* prefix follows the same convention as `_resetInvariantRegistry` /
|
|
608
|
-
* `_resetAdmittedAgentBindings` / `_resetAdmissionMetrics`.
|
|
609
|
-
*/
|
|
610
|
-
declare function _resetMessageQueueForTests(): void;
|
|
611
|
-
|
|
612
520
|
/**
|
|
613
521
|
* @kodax-ai/agent/messaging/drain — mid-turn drain decision (FEATURE_115).
|
|
614
522
|
*
|
|
@@ -1544,6 +1452,118 @@ declare function getActiveTeamModeWriter(): StateWriter | null;
|
|
|
1544
1452
|
*/
|
|
1545
1453
|
declare function updateActiveTeamMode(patch: Partial<SessionStateSnapshot>): void;
|
|
1546
1454
|
|
|
1455
|
+
/**
|
|
1456
|
+
* FEATURE_215 (v0.7.49) — Generic LLM-judged stop-hook primitive.
|
|
1457
|
+
*
|
|
1458
|
+
* Domain-neutral kernel for the "second-pass LLM consult" pattern shared
|
|
1459
|
+
* by `@kodax-ai/coding`'s Sidecar Verifier (FEATURE_184) and Stall
|
|
1460
|
+
* Sidecar (FEATURE_178). Both consumers ran the identical skeleton:
|
|
1461
|
+
*
|
|
1462
|
+
* provider.stream (forced tool call) → fuzzy-match the report tool
|
|
1463
|
+
* → parse the verdict → race a timeout → fail-open on any failure
|
|
1464
|
+
*
|
|
1465
|
+
* This module lifts that skeleton to the agent layer as a reusable
|
|
1466
|
+
* primitive so external SDK consumers building on a bare `Runner` can
|
|
1467
|
+
* inject their own domain prompt + verdict parser and get the same
|
|
1468
|
+
* text-only-termination consult behavior — without dragging the coding
|
|
1469
|
+
* preset in or copy-pasting the 35-line stream/parse/timeout boilerplate.
|
|
1470
|
+
*
|
|
1471
|
+
* **ADR-030 boundary**: concrete LLM judging (domain prompt, file-edit
|
|
1472
|
+
* evidence, verdict landing) stays in `@kodax-ai/coding`. Only the
|
|
1473
|
+
* domain-neutral *invocation* kernel lives here. This is an application
|
|
1474
|
+
* of ADR-021 ("non-coding agents also need it → agent layer"), not a
|
|
1475
|
+
* contradiction of ADR-030's "do not generalize concrete judging".
|
|
1476
|
+
*
|
|
1477
|
+
* **Never throws.** Every internal failure mode (provider error, timeout,
|
|
1478
|
+
* no tool call, parse failure) resolves to the caller-supplied
|
|
1479
|
+
* `defaultVerdict(reason)` so the happy path is never blocked by a buggy
|
|
1480
|
+
* judge.
|
|
1481
|
+
*/
|
|
1482
|
+
|
|
1483
|
+
/**
|
|
1484
|
+
* Levenshtein edit distance between two strings. Short, no regex. Used
|
|
1485
|
+
* by `findFuzzyToolMatch` to absorb model tool-name typos (e.g.
|
|
1486
|
+
* `report_stall_jundgment` → `report_stall_judgment`) that surface in
|
|
1487
|
+
* production sidecar calls.
|
|
1488
|
+
*/
|
|
1489
|
+
declare function editDistance(a: string, b: string): number;
|
|
1490
|
+
/**
|
|
1491
|
+
* Find the tool_use block whose name matches `expectedToolName` exactly
|
|
1492
|
+
* or within edit distance 2 (picking the closest). Returns undefined
|
|
1493
|
+
* when no candidate is close enough. `exact` distinguishes an exact hit
|
|
1494
|
+
* from a fuzzy one so callers can tag their verdict trace accordingly.
|
|
1495
|
+
*/
|
|
1496
|
+
declare function findFuzzyToolMatch(toolBlocks: readonly KodaXToolUseBlock[], expectedToolName: string): {
|
|
1497
|
+
block: KodaXToolUseBlock;
|
|
1498
|
+
exact: boolean;
|
|
1499
|
+
} | undefined;
|
|
1500
|
+
/**
|
|
1501
|
+
* Why the kernel fell back to `defaultVerdict`. The consumer maps each
|
|
1502
|
+
* reason to its own domain verdict + diagnostic trace tag.
|
|
1503
|
+
*/
|
|
1504
|
+
type LlmJudgeFailureReason = 'provider_error' | 'timeout' | 'no_tool_call' | 'parse_failure';
|
|
1505
|
+
interface InvokeLlmJudgeOptions<TVerdict> {
|
|
1506
|
+
/** Provider used for the consult call. Often a stronger model than the
|
|
1507
|
+
* main agent's. Injection target = test fakes + production resolution. */
|
|
1508
|
+
readonly provider: KodaXBaseProvider;
|
|
1509
|
+
/** Specific model id on the provider. When omitted, the provider's
|
|
1510
|
+
* registered default model is used. */
|
|
1511
|
+
readonly model?: string;
|
|
1512
|
+
/** System prompt for the consult. Domain-specific — caller supplies. */
|
|
1513
|
+
readonly systemPrompt: string;
|
|
1514
|
+
/** Forced report tool definition. Domain-specific — caller supplies. */
|
|
1515
|
+
readonly reportTool: KodaXToolDefinition;
|
|
1516
|
+
/** Pre-rendered user-message body for the consult. */
|
|
1517
|
+
readonly userMessage: string;
|
|
1518
|
+
/** Canonical report tool name used for exact + fuzzy matching. */
|
|
1519
|
+
readonly reportToolName: string;
|
|
1520
|
+
/** Parse a matched tool_use block into a verdict. `exact` is false on
|
|
1521
|
+
* a fuzzy (edit-distance) match. Return undefined — or throw — to
|
|
1522
|
+
* signal a parse failure → `defaultVerdict('parse_failure')`. A
|
|
1523
|
+
* throwing parser never breaks the "never throws" contract. */
|
|
1524
|
+
readonly parseToolCall: (block: KodaXToolUseBlock, exact: boolean) => TVerdict | undefined;
|
|
1525
|
+
/** Safe-default verdict factory, keyed by the failure reason so the
|
|
1526
|
+
* caller can preserve distinct diagnostic traces. */
|
|
1527
|
+
readonly defaultVerdict: (reason: LlmJudgeFailureReason) => TVerdict;
|
|
1528
|
+
/** Timeout in ms. Default 15000. */
|
|
1529
|
+
readonly timeoutMs?: number;
|
|
1530
|
+
/** Caller cancellation signal; combined with the judge timeout signal. */
|
|
1531
|
+
readonly abortSignal?: AbortSignal;
|
|
1532
|
+
/** Short structured-call output cap. Default 1024. */
|
|
1533
|
+
readonly maxOutputTokens?: number;
|
|
1534
|
+
}
|
|
1535
|
+
/**
|
|
1536
|
+
* Run a one-shot LLM consult: a single forced tool call, fuzzy-matched,
|
|
1537
|
+
* parsed, raced against a timeout, failing open to `defaultVerdict` on
|
|
1538
|
+
* any error. Domain-neutral via the `TVerdict` generic. Never throws.
|
|
1539
|
+
*/
|
|
1540
|
+
declare function invokeLlmJudge<TVerdict>(options: InvokeLlmJudgeOptions<TVerdict>): Promise<TVerdict>;
|
|
1541
|
+
interface CreateLlmJudgedStopHookOptions<TVerdict> {
|
|
1542
|
+
readonly provider: KodaXBaseProvider;
|
|
1543
|
+
readonly model?: string;
|
|
1544
|
+
readonly systemPrompt: string;
|
|
1545
|
+
readonly reportTool: KodaXToolDefinition;
|
|
1546
|
+
readonly reportToolName: string;
|
|
1547
|
+
/** Build the consult's user message from the StopHook context. */
|
|
1548
|
+
readonly buildUserMessage: (ctx: StopHookContext) => string | Promise<string>;
|
|
1549
|
+
readonly parseToolCall: (block: KodaXToolUseBlock, exact: boolean) => TVerdict | undefined;
|
|
1550
|
+
readonly defaultVerdict: (reason: LlmJudgeFailureReason) => TVerdict;
|
|
1551
|
+
/** Map the resolved verdict to the agent-layer 3-state StopHookResult. */
|
|
1552
|
+
readonly mapVerdict: (verdict: TVerdict) => StopHookResult;
|
|
1553
|
+
/** Observability sink — called once per hook fire with the raw verdict. */
|
|
1554
|
+
readonly onVerdict?: (verdict: TVerdict) => void;
|
|
1555
|
+
readonly timeoutMs?: number;
|
|
1556
|
+
readonly maxOutputTokens?: number;
|
|
1557
|
+
}
|
|
1558
|
+
/**
|
|
1559
|
+
* Factory: returns a `StopHookFn` that runs `invokeLlmJudge` when the
|
|
1560
|
+
* main agent terminates a turn text-only, then maps the verdict to the
|
|
1561
|
+
* agent-layer 3-state result. The hook builds the consult user message
|
|
1562
|
+
* from the StopHook context via `buildUserMessage`, so callers stay in
|
|
1563
|
+
* control of what context the judge sees.
|
|
1564
|
+
*/
|
|
1565
|
+
declare function createLlmJudgedStopHook<TVerdict>(options: CreateLlmJudgedStopHookOptions<TVerdict>): StopHookFn;
|
|
1566
|
+
|
|
1547
1567
|
/**
|
|
1548
1568
|
* FEATURE_124 (v0.7.43) — Memory System Alignment: path resolver.
|
|
1549
1569
|
*
|
|
@@ -2309,5 +2329,87 @@ declare function gracefulCompactDegradation(messages: KodaXMessage[], contextWin
|
|
|
2309
2329
|
declare const DEFAULT_CONTEXT_WINDOW = 200000;
|
|
2310
2330
|
declare function resolveContextWindow(compactionConfig: CompactionConfig, provider: KodaXBaseProvider, modelOverride: string | undefined): number;
|
|
2311
2331
|
|
|
2312
|
-
|
|
2313
|
-
|
|
2332
|
+
declare class WorkflowScriptExecutionError extends Error {
|
|
2333
|
+
constructor(message: string);
|
|
2334
|
+
}
|
|
2335
|
+
interface RunRestrictedWorkflowScriptOptions {
|
|
2336
|
+
readonly source: string;
|
|
2337
|
+
readonly wf: WorkflowApi;
|
|
2338
|
+
readonly args?: unknown;
|
|
2339
|
+
readonly filename?: string;
|
|
2340
|
+
/** Optional explicit wall-clock cap. Default workflows are open-ended. */
|
|
2341
|
+
readonly timeoutMs?: number;
|
|
2342
|
+
}
|
|
2343
|
+
interface RestrictedWorkflowModuleInput {
|
|
2344
|
+
readonly manifest: WorkflowScriptManifest;
|
|
2345
|
+
readonly source: string;
|
|
2346
|
+
readonly timeoutMs?: number;
|
|
2347
|
+
}
|
|
2348
|
+
declare function runRestrictedWorkflowScript(opts: RunRestrictedWorkflowScriptOptions): Promise<unknown>;
|
|
2349
|
+
declare function createRestrictedWorkflowModule(input: RestrictedWorkflowModuleInput): WorkflowModule;
|
|
2350
|
+
|
|
2351
|
+
/**
|
|
2352
|
+
* FEATURE_217 (v0.7.49) — Workflow runtime: concurrency gate, agent cap,
|
|
2353
|
+
* budget accounting, event recording.
|
|
2354
|
+
*
|
|
2355
|
+
* The runtime is the orchestration engine. It wraps an injected
|
|
2356
|
+
* `WorkflowAgentBackend` with: a maxAgents lifetime cap, a maxConcurrency
|
|
2357
|
+
* in-flight gate (for spawnAgent / runAgent / parallel), token-budget accounting with
|
|
2358
|
+
* a hard stop before new spawns, abort handling, and an append-only event
|
|
2359
|
+
* log. It has zero `@kodax-ai/coding` dependency.
|
|
2360
|
+
*/
|
|
2361
|
+
|
|
2362
|
+
/** Thrown when the workflow's abort signal fires mid-run. */
|
|
2363
|
+
declare class WorkflowAbortError extends Error {
|
|
2364
|
+
constructor(message?: string);
|
|
2365
|
+
}
|
|
2366
|
+
/** Thrown when a spawn would exceed the run's maxAgents lifetime cap. */
|
|
2367
|
+
declare class WorkflowLimitError extends Error {
|
|
2368
|
+
constructor(message: string);
|
|
2369
|
+
}
|
|
2370
|
+
/** Thrown when a new spawn would start after the token budget is exhausted. */
|
|
2371
|
+
declare class WorkflowBudgetError extends Error {
|
|
2372
|
+
constructor(message: string);
|
|
2373
|
+
}
|
|
2374
|
+
/** Validate user-provided runtime limits for SDK consumers. */
|
|
2375
|
+
declare function normalizeWorkflowLimits(limits?: WorkflowLimits): WorkflowLimits;
|
|
2376
|
+
interface CreateWorkflowRuntimeOptions {
|
|
2377
|
+
readonly runId: string;
|
|
2378
|
+
readonly args?: unknown;
|
|
2379
|
+
readonly backend: WorkflowAgentBackend;
|
|
2380
|
+
readonly limits?: WorkflowLimits;
|
|
2381
|
+
readonly signal?: AbortSignal;
|
|
2382
|
+
/** Sink for every run-graph event (durable writer / UI subscribe here). */
|
|
2383
|
+
readonly onEvent?: (event: WorkflowEvent) => void;
|
|
2384
|
+
/** Sink for free-text `wf.log(...)` progress lines. */
|
|
2385
|
+
readonly onLog?: (event: WorkflowLogEvent) => void;
|
|
2386
|
+
}
|
|
2387
|
+
interface WorkflowRuntimeHandle {
|
|
2388
|
+
readonly api: WorkflowApi;
|
|
2389
|
+
getState(): WorkflowRunState;
|
|
2390
|
+
}
|
|
2391
|
+
/**
|
|
2392
|
+
* Build a workflow runtime. The returned `api` is handed to a workflow
|
|
2393
|
+
* script; `getState()` returns an immutable snapshot of accumulated run
|
|
2394
|
+
* state. For the full run lifecycle (workflow_started/completed/failed
|
|
2395
|
+
* envelope) use `runWorkflow`.
|
|
2396
|
+
*/
|
|
2397
|
+
declare function createWorkflowRuntime(opts: CreateWorkflowRuntimeOptions): WorkflowRuntimeHandle;
|
|
2398
|
+
type WorkflowRunOutcome<T> = {
|
|
2399
|
+
readonly ok: true;
|
|
2400
|
+
readonly result: T;
|
|
2401
|
+
readonly state: WorkflowRunState;
|
|
2402
|
+
} | {
|
|
2403
|
+
readonly ok: false;
|
|
2404
|
+
readonly error: Error;
|
|
2405
|
+
readonly state: WorkflowRunState;
|
|
2406
|
+
};
|
|
2407
|
+
/**
|
|
2408
|
+
* Run a workflow script end-to-end under a fresh runtime, wrapping it
|
|
2409
|
+
* with the workflow_started / workflow_completed|failed event envelope.
|
|
2410
|
+
* Never throws — failures surface as `{ ok: false, error }`.
|
|
2411
|
+
*/
|
|
2412
|
+
declare function runWorkflow<T>(opts: CreateWorkflowRuntimeOptions, script: (api: WorkflowApi, args: unknown) => Promise<T>): Promise<WorkflowRunOutcome<T>>;
|
|
2413
|
+
|
|
2414
|
+
export { Agent, AgentManifest, AgentMessage, COMPACTION_SUMMARY_PREFIX, CORE_INVARIANTS, ChildTaskRegistry, CompactionConfig, CompactionDetails, CompactionResult, ConsoleTracingProcessor, DEFAULT_CONTEXT_WINDOW, DEFAULT_IDLE_YIELD_MAX_ITERATIONS, DEFAULT_MICROCOMPACTION_CONFIG, DEFAULT_POST_COMPACT_CONFIG, DEFAULT_SUMMARY_PROMPT, DEFAULT_UPDATE_SUMMARY_PROMPT, DiscoveredInstance, FileExtensionStore, FileTracingProcessor, HARDENED_ENV_VARS, HARDENING_OPT_OUT_ENV, Handoff, InstanceDiscoveryFs, InvariantId, KodaXExtensionStore, KodaXExtensionStoreEntry, KodaXGoalEventType, KodaXGoalState, KodaXJsonValue, KodaXMessage, KodaXSessionArtifactLedgerEntry, KodaXSessionEntry, KodaXSessionGoalEntry, KodaXSessionLineage, KodaXToolDefinition, KodaXToolUseBlock, MAX_ENTRYPOINT_BYTES, MAX_ENTRYPOINT_LINES, ManifestPatch, MessageMode, MessagePriority, MessageQueue, POST_COMPACT_MAX_TOKENS_PER_FILE, POST_COMPACT_TOKEN_BUDGET, PROTECTED_TOOL_NAMES, QualityInvariant, QueuedMessage, RunnerToolCall, RunnerToolResult, SessionMeta, SessionStateSnapshot, Span, StateWriter, StateWriterFs, StopHookContext, StopHookFn, StopHookResult, Trace, WorkflowAbortError, WorkflowAgentBackend, WorkflowApi, WorkflowBudgetError, WorkflowEvent, WorkflowLimitError, WorkflowLimits, WorkflowLogEvent, WorkflowModule, WorkflowRunState, WorkflowScriptExecutionError, WorkflowScriptManifest, YIELD_TOOL_NAMES, _emitSpanEnd, _emitSpanStart, _emitTraceEnd, _getRegisteredProcessors, _resetAdmissionMetrics, _resetInvariantRegistry, addTracingProcessor, appendGoalEntry, applyManifestPatch, applyProcessHardening, bootstrapTeamMode, buildCompactionPromptSnapshot, buildFileContentMessages, buildOtherInstancesPromptBlock, buildPostCompactAttachments, cleanupRegisteredManagedChildren, compact, composeIdleYieldUserMessage, composePatches, countLastAssistantToolCalls, createExtensionStore, createLlmJudgedStopHook, createRestrictedWorkflowModule, createWorkflowRuntime, detectHandoffSignal, detectIdleYield, editDistance, emitHandoffSpan, enqueueChildTaskNotification, evidenceTrail, finalOwner, findFuzzyToolMatch, generateSummary, getActiveTeamModeWriter, getAdmissionMetricsSnapshot, getInvariant, gracefulCompactDegradation, handoffLegality, hashCwd, injectPostCompactAttachments, invokeLlmJudge, isAdmissionDebugEnabled, isAutoManagedMemoryFile, isChildProcessExited, isEmptyLikeSummary, isGoalEntry, isIdleYieldEnabled, killChildProcessTree, killChildProcessTreeSync, killPidTree, killPidTreeSync, listRegisteredInvariants, maybeDrainMidTurn, microcompact, midTurnDrainPriority, needsCompaction, normalizeWorkflowLimits, parseMemoryFile, parseMemoryType, parseMemoryTypeFromFilename, parseScalarFields, readLatestGoalFromBranch, readLatestGoalState, registerCoreInvariants, registerInvariant, registerManagedChildProcess, replaceSystemMessage, resolveContextWindow, resolveEffectiveInvariants, resolveMemoryEntrypoint, resolveMemoryRoot, resolveRequiredInvariants, routeMessage, runFanOut, runRestrictedWorkflowScript, runWithIdleYield, runWorkflow, sanitizeProjectKey, serializeConversation, setActiveTeamModeWriter, setTracingProcessors, shouldCompact, shutdownTracing, stripHardenedEnvVars, truncateEntrypointContent, tryGitRemote, updateActiveTeamMode, waitForChildProcessExit, waitForWakeEvent };
|
|
2415
|
+
export type { AdmissionMetricsSnapshot, ConsoleTracingProcessorOptions, CreateLlmJudgedStopHookOptions, CreateWorkflowRuntimeOptions, EnqueueChildTaskNotificationInput, EntrypointTruncation, EnvelopeAggregateEnforcer, FanOutOutcome, FanOutProgressEvent, FileTracingProcessorOptions, HandoffSignal, IdleYieldSnapshot, InvokeLlmJudgeOptions, KodaXCompactionPromptSection, KodaXCompactionPromptSnapshot, KodaXCompactionPromptVariant, LlmJudgeFailureReason, ManagedChildCleanupSummary, ManagedChildProcessMetadata, MaybeDrainMidTurnInput, MemoryFrontmatter, MemoryType, MicrocompactionConfig, ParsedMemoryFile, PostCompactAttachments, PostCompactConfig, ProcessTreeKillOptions, RenderOptions, RestrictedWorkflowModuleInput, RouteMessageOptions, RouteMessageResult, RunFanOutOptions, RunFanOutResult, RunRestrictedWorkflowScriptOptions, RunWithIdleYieldOptions, RunWithIdleYieldRunResult, ShouldCompactInput, TeamModeBootstrapOptions, TeamModeHandle, TracingProcessor, WaitForWakeEventOptions, WakeEvent, WorkflowRunOutcome, WorkflowRuntimeHandle };
|
package/dist/sdk-agent.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @kodax-ai/kodax — bundled distribution. See docs/ADR.md ADR-022 + ADR-024.
|
|
2
|
-
import{$,$a as or,$c as Ze,A,Aa as Bo,Ab as Br,Ac as ye,B,Ba as Co,Bb as Cr,Bc as ze,C,Ca as Do,Cb as Dr,Cc as Ae,D,Da as Eo,Db as Er,Dc as Be,E,Ea as Fo,Eb as Fr,Ec as Ce,F,Fa as Go,Fb as Gr,Fc as De,G,Ga as Ho,Gb as Hr,Gc as Ee,H,Ha as Io,Hb as Ir,Hc as Fe,I,Ia as Jo,Ib as Jr,Ic as Ge,J,Ja as Ko,Jb as Kr,Jc as He,K,Ka as Lo,Kb as Lr,Kc as Ie,L,La as Mo,Lb as Mr,Lc as Je,M,Ma as No,Mb as Nr,Mc as Ke,N,Na as Oo,Nb as Or,Nc as Le,O,Oa as Po,Ob as Pr,Oc as Me,P,Pa as Qo,Pb as Qr,Pc as Ne,Q,Qa as Ro,Qb as Rr,Qc as Oe,R,Ra as So,Rb as Sr,Rc as Pe,S,Sa as To,Sb as Tr,Sc as Qe,T,Ta as Uo,Tb as Ur,Tc as Re,U,Ua as Vo,Ub as Vr,Uc as Se,V,Va as Wo,Vb as Wr,Vc as Te,W,Wa as Xo,Wb as Xr,Wc as Ue,X,Xa as Yo,Xb as Yr,Xc as Ve,Y,Ya as Zo,Yb as Zr,Yc as We,Z,Za as _o,Zb as _r,Zc as Xe,_,_a as $o,_c as Ye,a as o,aa as oo,ab as rr,ad as _e,b as r,ba as ro,bb as er,bc as
|
|
2
|
+
import{$,$a as or,$b as oe,$c as Ze,A,Aa as Bo,Ab as Br,Ac as ye,Ad as zf,B,Ba as Co,Bb as Cr,Bc as ze,Bd as Af,C,Ca as Do,Cb as Dr,Cc as Ae,Cd as Bf,D,Da as Eo,Db as Er,Dc as Be,Dd as Cf,E,Ea as Fo,Eb as Fr,Ec as Ce,Ed as Df,F,Fa as Go,Fb as Gr,Fc as De,Fd as Ef,G,Ga as Ho,Gb as Hr,Gc as Ee,Gd as Ff,H,Ha as Io,Hb as Ir,Hc as Fe,Hd as Gf,I,Ia as Jo,Ib as Jr,Ic as Ge,Id as Hf,J,Ja as Ko,Jb as Kr,Jc as He,Jd as If,K,Ka as Lo,Kb as Lr,Kc as Ie,Kd as Jf,L,La as Mo,Lb as Mr,Lc as Je,Ld as Kf,M,Ma as No,Mb as Nr,Mc as Ke,Md as Lf,N,Na as Oo,Nb as Or,Nc as Le,Nd as Mf,O,Oa as Po,Ob as Pr,Oc as Me,P,Pa as Qo,Pb as Qr,Pc as Ne,Q,Qa as Ro,Qb as Rr,Qc as Oe,R,Ra as So,Rb as Sr,Rc as Pe,S,Sa as To,Sb as Tr,Sc as Qe,T,Ta as Uo,Tb as Ur,Tc as Re,U,Ua as Vo,Ub as Vr,Uc as Se,V,Va as Wo,Vb as Wr,Vc as Te,W,Wa as Xo,Wb as Xr,Wc as Ue,X,Xa as Yo,Xb as Yr,Xc as Ve,Y,Ya as Zo,Yb as Zr,Yc as We,Z,Za as _o,Zb as _r,Zc as Xe,_,_a as $o,_b as $r,_c as Ye,a as o,aa as oo,ab as rr,ac as re,ad as _e,b as r,ba as ro,bb as er,bc as ee,bd as $e,c as e,ca as eo,cb as fr,cd as of,d as f,da as fo,db as mr,dd as rf,e as m,ea as mo,eb as pr,ed as ef,f as p,fa as po,fb as tr,fc as fe,fd as ff,g as t,ga as to,gb as xr,gc as me,gd as mf,h as x,ha as xo,hb as ar,hc as pe,hd as pf,i as a,ia as ao,ib as br,ic as te,id as tf,j as b,ja as bo,jb as cr,jc as xe,jd as xf,k as c,ka as co,kb as dr,kc as ae,kd as af,l as d,la as go,lb as gr,lc as be,ld as bf,m as g,ma as ho,mb as hr,mc as ce,md as cf,n as h,na as io,nb as ir,nc as de,nd as df,o as i,oa as jo,ob as jr,oc as ge,od as gf,p as j,pa as ko,pb as kr,pc as he,pd as hf,q as k,qa as lo,qb as lr,qc as ie,qd as jf,r as l,ra as no,rb as nr,rc as je,rd as kf,s as n,sa as qo,sb as qr,sc as ke,sd as lf,t as q,ta as so,tb as sr,tc as le,td as nf,u as s,ua as uo,ub as ur,uc as ne,ud as qf,v as u,va as vo,vb as vr,vc as qe,vd as sf,w as v,wa as wo,wb as wr,wc as se,wd as uf,x as w,xa as yo,xb as yr,xc as ue,xd as vf,y,ya as zo,yb as zr,yc as ve,yd as wf,z,za as Ao,zb as Ar,zc as we,zd as yf}from"./chunks/chunk-JTHMWRXM.js";import"./chunks/chunk-V4WSBIXB.js";export{af as COMPACTION_SUMMARY_PREFIX,qo as CORE_INVARIANTS,B as ConsoleTracingProcessor,qf as DEFAULT_CONTEXT_WINDOW,_o as DEFAULT_IDLE_YIELD_MAX_ITERATIONS,gf as DEFAULT_MICROCOMPACTION_CONFIG,Ee as DEFAULT_POST_COMPACT_CONFIG,ff as DEFAULT_SUMMARY_PROMPT,O as DEFAULT_SYSTEM_CAP,mf as DEFAULT_UPDATE_SUMMARY_PROMPT,j as DefaultSummaryCompaction,jf as FileExtensionStore,C as FileTracingProcessor,oo as GuardrailBlockedError,ro as GuardrailEscalateError,zo as HARDENED_ENV_VARS,Ao as HARDENING_OPT_OUT_ENV,U as InvariantSession,a as KODAX_API_MIN_INTERVAL,r as KODAX_DEFAULT_TIMEOUT,e as KODAX_HARD_TIMEOUT,p as KODAX_MAX_INCOMPLETE_RETRIES,t as KODAX_MAX_MAXTOKENS_RETRIES,f as KODAX_MAX_RETRIES,o as KODAX_MAX_TOKENS,m as KODAX_RETRY_BASE_DELAY,x as KODAX_STAGGER_DELAY,we as LINEAGE_ENTRY_TYPES,ze as LineageCompaction,ye as LineageExtension,Br as MAX_ENTRYPOINT_BYTES,Ar as MAX_ENTRYPOINT_LINES,W as MAX_TOOL_LOOP_ITERATIONS,Jr as McpAuthRequiredError,Vr as McpCapabilityProvider,Ir as McpExpiredSessionError,Wr as McpManager,Ur as McpServerRuntime,No as MessageQueue,De as POST_COMPACT_MAX_TOKENS_PER_FILE,Ce as POST_COMPACT_TOKEN_BUDGET,b as PROMISE_PATTERN,xf as PROTECTED_TOOL_NAMES,io as Runner,ne as SkillExecutor,ie as SkillRegistry,k as SpanImpl,z as Tracer,de as VariableResolver,Df as WORKFLOW_CAPSULE_API_VERSION,Bf as WORKFLOW_CAPSULE_FORMAT,Cf as WORKFLOW_CAPSULE_VERSION,vf as WORKFLOW_PATTERN_IDS,Hf as WorkflowAbortError,Jf as WorkflowBudgetError,uf as WorkflowEventRecorder,If as WorkflowLimitError,yf as WorkflowScriptExecutionError,Qo as YIELD_TOOL_NAMES,v as _emitSpanEnd,u as _emitSpanStart,w as _emitTraceEnd,s as _getRegisteredProcessors,M as _resetAdmissionMetrics,T as _resetAdmittedAgentBindings,I as _resetInvariantRegistry,Po as _resetMessageQueueForTests,go as _resetPresetDispatchers,n as addTracingProcessor,Ye as appendGoalEntry,Ne as appendSessionLineageLabel,Pe as applyLineageTruncation,D as applyManifestPatch,Bo as applyProcessHardening,Oe as applySessionCompaction,Ve as archiveOldIslands,br as bootstrapTeamMode,_ as buildAssistantMessageFromLlmResult,pf as buildCompactionPromptSnapshot,He as buildFileContentMessages,Tr as buildInitializeCapabilities,pr as buildOtherInstancesPromptBlock,Fe as buildPostCompactAttachments,Te as buildSessionTree,ho as buildSystemPrompt,$ as buildToolResultMessage,dr as cleanupIncompleteToolCalls,Ko as cleanupRegisteredManagedChildren,oe as clearPluginSkillPaths,eo as collectGuardrails,df as compact,Zo as composeIdleYieldUserMessage,E as composePatches,Ue as countActiveLineageMessages,Wo as countLastAssistantToolCalls,d as countTokens,g as createAgent,qe as createExecutor,kf as createExtensionStore,h as createHandoff,i as createInMemorySession,V as createInvariantSessionForAgent,jr as createLlmJudgedStopHook,Er as createMcpCapabilityId,Xr as createMcpManager,Yr as createMcpTestServerFixture,Kr as createMcpTransport,ge as createResolver,Af as createRestrictedWorkflowModule,Ie as createSessionLineage,fr as createStateWriter,l as createTrace,Ff as createWorkflowCapsule,Gf as createWorkflowModuleFromCapsule,Lf as createWorkflowRuntime,Dr as defaultMcpCacheDir,A as defaultTracer,xo as detectHandoffSignal,Xo as detectIdleYield,P as detectInstructionsInjection,Or as discoverAuthorizationServerMetadata,mr as discoverInstances,Pr as discoverOAuthEndpoints,Nr as discoverProtectedResourceMetadata,xe as discoverSkills,be as discoverSkillsWithMonorepo,gr as editDistance,bo as emitHandoffSpan,To as enqueueChildTaskNotification,c as estimateTokens,ko as evidenceTrail,Z as executeRunnerToolCall,se as executeSkill,ue as expandSkillForLLM,of as extractArtifactLedger,jo as extractAssistantTextFromMessage,_e as extractFileOps,Mr as extractInsufficientScope,Lr as extractResourceMetadataUrl,Be as extractTitleFromMessages,lo as finalOwner,hr as findFuzzyToolMatch,Qe as findPreviousUserEntryId,Se as forkSessionLineage,ve as formatSkillActivationMessage,Ae as generateSessionId,tf as generateSummary,xr as getActiveTeamModeWriter,Mo as getActiveUserInteraction,L as getAdmissionMetricsSnapshot,S as getAdmittedAgentBindings,vo as getAgentConfigHome,wo as getAgentConfigPath,yo as getAppDataDir,re as getDefaultSkillPaths,G as getInvariant,Hr as getMcpCachePaths,Oo as getMessageQueue,ae as getNestedSkillPaths,Je as getSessionLineagePath,Ke as getSessionMessagesFromLineage,ee as getSkillPathsFlat,je as getSkillRegistry,nf as gracefulCompactDegradation,no as handoffLegality,lr as hashCwd,ke as initializeSkillRegistry,Ge as injectPostCompactAttachments,ir as invokeLlmJudge,N as isAdmissionDebugEnabled,ur as isAutoManagedMemoryFile,Do as isChildProcessExited,bf as isEmptyLikeSummary,Ze as isGoalEntry,Vo as isIdleYieldEnabled,X as isRunnableTool,Y as isRunnerLlmResult,Ho as killChildProcessTree,Io as killChildProcessTreeSync,Fo as killPidTree,Go as killPidTreeSync,$r as listPluginSkillPaths,H as listRegisteredInvariants,pe as loadFullSkill,te as loadSkillFileContent,me as loadSkillMetadata,Sr as loadValidToken,So as maybeDrainMidTurn,rf as mergeArtifactLedger,$e as mergeFileOps,hf as microcompact,Ro as midTurnDrainPriority,cf as needsCompaction,Kf as normalizeWorkflowLimits,ce as parseArguments,Fr as parseMcpCapabilityId,yr as parseMemoryFile,wr as parseMemoryType,vr as parseMemoryTypeFromFilename,zr as parseScalarFields,fe as parseSkillMarkdown,Rr as performOAuthLogin,We as readLatestGoalFromBranch,Xe as readLatestGoalState,Uo as registerChildTask,so as registerCoreInvariants,F as registerInvariant,Jo as registerManagedChildProcess,Qr as registerOAuthClient,Zr as registerPluginSkillPath,co as registerPresetDispatcher,ao as replaceSystemMessage,er as requestTaskStop,le as resetSkillRegistry,sf as resolveContextWindow,K as resolveEffectiveInvariants,sr as resolveMemoryEntrypoint,qr as resolveMemoryRoot,J as resolveRequiredInvariants,Le as resolveSessionLineageTarget,he as resolveSkillContent,Re as rewindSessionLineage,rr as routeMessage,Q as runAdmissionAudit,or as runFanOut,fo as runInputGuardrails,mo as runOutputGuardrails,zf as runRestrictedWorkflowScript,to as runToolAfterGuardrails,po as runToolBeforeGuardrails,$o as runWithIdleYield,Mf as runWorkflow,kr as sanitizeProjectKey,Gr as searchMcpCatalog,ef as serializeConversation,tr as setActiveTeamModeWriter,Lo as setActiveUserInteraction,R as setAdmittedAgentBindings,uo as setAgentConfigHome,Me as setSessionLineageActiveEntry,q as setTracingProcessors,lf as shouldCompact,y as shutdownTracing,Co as stripHardenedEnvVars,Cr as truncateEntrypointContent,nr as tryGitRemote,_r as unregisterPluginSkillPath,ar as updateActiveTeamMode,cr as validateAndFixToolHistory,Ef as validateWorkflowCapsule,wf as validateWorkflowScriptManifest,Eo as waitForChildProcessExit,Yo as waitForWakeEvent};
|