@kodax-ai/kodax 0.7.83 → 0.7.85
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 +154 -4
- package/README.md +48 -26
- package/README_CN.md +26 -21
- package/dist/chunks/agent-OQ37XUWF.js +2 -0
- package/dist/chunks/argument-completer-IMRSIF2N.js +2 -0
- package/dist/chunks/chunk-2XJQNFVR.js +379 -0
- package/dist/chunks/chunk-3E4OSFP2.js +1279 -0
- package/dist/chunks/chunk-CDWYKVZC.js +482 -0
- package/dist/chunks/chunk-CZCEFGQG.js +412 -0
- package/dist/chunks/chunk-IA246OAN.js +679 -0
- package/dist/chunks/chunk-IWRNGH4M.js +319 -0
- package/dist/chunks/chunk-MJ4G5ZCW.js +2 -0
- package/dist/chunks/{chunk-RAQGGVIF.js → chunk-ODRLFQQH.js} +1 -1
- package/dist/chunks/chunk-RSOAHVUR.js +5 -0
- package/dist/chunks/chunk-RTFVMEF6.js +415 -0
- package/dist/chunks/{chunk-XB2JNLXH.js → chunk-SR4E5FQK.js} +2 -2
- package/dist/chunks/{chunk-HI6RCW5Y.js → chunk-TBBY2DKE.js} +2 -2
- package/dist/chunks/chunk-UH5WNJXF.js +92 -0
- package/dist/chunks/{chunk-6QILIBOU.js → chunk-ZVOXWLT6.js} +214 -201
- package/dist/chunks/compaction-config-3WLLNN57.js +2 -0
- package/dist/chunks/{construction-bootstrap-E4M3CY3N.js → construction-bootstrap-CZ6NWEWQ.js} +1 -1
- package/dist/chunks/dist-NFLLOZWF.js +2 -0
- package/dist/chunks/host-LWUSSCWH.js +2 -0
- package/dist/chunks/run-manager-PBMOVP7A.js +2 -0
- package/dist/chunks/utils-KFLK3EHJ.js +2 -0
- package/dist/index.d.ts +17 -15
- package/dist/index.js +2 -2
- package/dist/kodax_bootstrap.js +1 -1
- package/dist/kodax_cli.js +1975 -1564
- package/dist/kodax_resume.js +269 -90
- package/dist/runtime-worker.js +1824 -1419
- package/dist/sandbox-workspace-session.js +979 -66
- package/dist/sdk-a2a.d.ts +11 -10
- package/dist/sdk-a2a.js +9 -8
- package/dist/sdk-agent.d.ts +39 -299
- package/dist/sdk-agent.js +1 -1
- package/dist/sdk-coding.d.ts +103 -16
- package/dist/sdk-coding.js +1 -1
- package/dist/sdk-experimental-memory.d.ts +7 -20
- package/dist/sdk-experimental-memory.js +1 -1
- package/dist/sdk-mcp.js +1 -1
- package/dist/sdk-media.js +1 -1
- package/dist/sdk-repl.d.ts +14 -13
- package/dist/sdk-repl.js +2 -2
- package/dist/sdk-runtime.d.ts +64 -23
- package/dist/sdk-runtime.js +1 -1
- package/dist/sdk-sandbox.js +1 -1
- package/dist/sdk-session.d.ts +7 -6
- package/dist/sdk-session.js +1 -1
- package/dist/sdk-skills.d.ts +2 -2
- package/dist/sdk-skills.js +1 -1
- package/dist/semantic-worker.js +251 -64
- package/dist/types-chunks/{bash-prefix-extractor.d-CJM7OY-L.d.ts → bash-prefix-extractor.d-BnZQDirs.d.ts} +130 -13
- package/dist/types-chunks/{capsule.d-B7yoH4dM.d.ts → capsule.d-CN_iMqAS.d.ts} +2 -1
- package/dist/types-chunks/controller.d-A73Kf6tH.d.ts +105 -0
- package/dist/types-chunks/{controller.d-CYNuR2n9.d.ts → controller.d-Dzxz22X-.d.ts} +28 -1020
- package/dist/types-chunks/{guardrail.d-fM3mn4Op.d.ts → guardrail.d-BCkgaWT1.d.ts} +25 -19
- package/dist/types-chunks/{history-retrieval.d-BDI-ZMvY.d.ts → history-retrieval.d-Debbzn1z.d.ts} +1 -1
- package/dist/types-chunks/{public-api.d-i10kvYFs.d.ts → public-api.d-N6G6Jw8X.d.ts} +3 -2
- package/dist/types-chunks/{repl.d-Cs3eqGVT.d.ts → repl.d-BkTIOkJD.d.ts} +5 -5
- package/dist/types-chunks/review-inbox.d-DuZqFX-z.d.ts +221 -0
- package/dist/types-chunks/{run-manager.d-CodHf6rw.d.ts → run-manager.d-BS4lJfL3.d.ts} +1 -1
- package/dist/types-chunks/{sdk-session-CRXu5xNs.d.ts → sdk-session-DLkZTOc-.d.ts} +2 -2
- package/dist/types-chunks/{shell-command-sets.d-DfeSUjjM.d.ts → shell-command-sets.d-BrLw-WN9.d.ts} +3 -2
- package/dist/types-chunks/{types-Bf3Y3mW-.d.ts → types-PHjfwebT.d.ts} +62 -190
- package/dist/types-chunks/{types.d-BbtGlKZu.d.ts → types.d-BSPlmJqf.d.ts} +25 -6
- package/dist/types-chunks/{types.d-DIXZFauU.d.ts → types.d-Bo4fyMLu.d.ts} +1 -1
- package/dist/types-chunks/{types.d-DKs4tfSd.d.ts → types.d-Ch3BD97c.d.ts} +2 -2
- package/dist/types-chunks/types.d-DlLBRqZ9.d.ts +1057 -0
- package/dist/types-chunks/{utils.d-CgITiLyc.d.ts → utils.d-BI-kjuev.d.ts} +7 -4
- package/package.json +4 -2
- package/dist/chunks/agent-S7LMMTG7.js +0 -2
- package/dist/chunks/argument-completer-SQHG2LYE.js +0 -2
- package/dist/chunks/chunk-37RT45HT.js +0 -379
- package/dist/chunks/chunk-3DKQC7A2.js +0 -479
- package/dist/chunks/chunk-45E23YJI.js +0 -885
- package/dist/chunks/chunk-6UENDY33.js +0 -89
- package/dist/chunks/chunk-DSFHIUHZ.js +0 -655
- package/dist/chunks/chunk-DZUMH6GJ.js +0 -2
- package/dist/chunks/chunk-E7C4DRD2.js +0 -5
- package/dist/chunks/chunk-EVXIJPZ6.js +0 -218
- package/dist/chunks/chunk-KHEFUT6O.js +0 -5
- package/dist/chunks/chunk-LF2JBTBG.js +0 -319
- package/dist/chunks/chunk-TC2VHPG5.js +0 -348
- package/dist/chunks/chunk-URCS6CVP.js +0 -292
- package/dist/chunks/compaction-config-SSQ5NXUP.js +0 -2
- package/dist/chunks/dist-MIXP4ULB.js +0 -2
- package/dist/chunks/host-ZCPI7SMC.js +0 -2
- package/dist/chunks/run-manager-4RYG7HSP.js +0 -2
- package/dist/chunks/utils-7DKE2EKT.js +0 -2
- package/docs/SDK_EMBEDDER_GUIDE.md +0 -5735
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { b as McpServersConfig, M as McpConnectMode, a as McpServerConfig, c as McpTransportKind } from './config.d-CJy1WENT.js';
|
|
2
2
|
import { K as KodaXBaseProvider } from './base.d-DxG0m09Z.js';
|
|
3
3
|
import { a as CostTracker } from './cost-tracker.d-BeaenODW.js';
|
|
4
|
-
import {
|
|
4
|
+
import { c5 as RunnerToolCall, cB as ToolGuardrail } from './controller.d-Dzxz22X-.js';
|
|
5
5
|
import { k as KodaXMessage } from './types.d-CgrXrFrq.js';
|
|
6
6
|
import { S as SideQueryDiagnostics } from './side-query.d-CP1LiRiH.js';
|
|
7
|
-
import {
|
|
7
|
+
import { bB as ToolSideEffect } from './bash-prefix-extractor.d-BnZQDirs.js';
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* FEATURE_200 Phase F (v0.7.45) — MCP domain types extracted from types.ts.
|
|
@@ -476,18 +476,14 @@ declare function classify(opts: ClassifyOptions): Promise<ClassifyDecision>;
|
|
|
476
476
|
* `dd of=test.bin` (file write — reaches LLM as
|
|
477
477
|
* dangerous_pattern signal).
|
|
478
478
|
* 4. fork_bomb — `:(){ :|:& };:` — denial of service.
|
|
479
|
-
* 5. user_kodax_write — write/edit to
|
|
480
|
-
*
|
|
481
|
-
*
|
|
482
|
-
*
|
|
483
|
-
*
|
|
484
|
-
* Layer note: bash-level `~/.kodax/` writes
|
|
485
|
-
*
|
|
486
|
-
* `
|
|
487
|
-
* Tier 0 by emitting a synthetic `user_kodax_write` match via the same
|
|
488
|
-
* `AbsoluteDenyResult` shape. This module handles the file-tool path
|
|
489
|
-
* directly (the most common attack vector) and the four command-string
|
|
490
|
-
* patterns that don't need path extraction.
|
|
479
|
+
* 5. user_kodax_write — write/edit/bash-write to protected agent-home paths
|
|
480
|
+
* under `~/.kodax/`: the home root, Runtime control
|
|
481
|
+
* plane, credentials, security config, and generic
|
|
482
|
+
* sensitive files. Ordinary working data stays open.
|
|
483
|
+
*
|
|
484
|
+
* Layer note: bash-level `~/.kodax/` writes are detected via AST
|
|
485
|
+
* path-extraction (`collectDeterministicBashWriteTargets`) in
|
|
486
|
+
* `checkUserKodaxBashWrite`, covering both file-tool and bash paths.
|
|
491
487
|
*/
|
|
492
488
|
|
|
493
489
|
type TierZeroPatternId = 'rm_rf_root' | 'mkfs_or_format' | 'dd_disk_write' | 'fork_bomb' | 'user_kodax_write';
|
|
@@ -513,8 +509,8 @@ type AbsoluteDenyCheck = (call: RunnerToolCall, projectRoot: string, executionCw
|
|
|
513
509
|
* classifier and the reason string is one-shot.
|
|
514
510
|
*
|
|
515
511
|
* **Pure**: deterministic given (call, projectRoot, stable env).
|
|
516
|
-
* **Fast**: ~5 regex tests + 1-2 string ops;
|
|
517
|
-
* non-Tier-1 call
|
|
512
|
+
* **Fast**: ~5 regex tests + 1-2 string ops (file-tools); bash calls add
|
|
513
|
+
* AST path-extraction. Safe to run on every non-Tier-1 call.
|
|
518
514
|
*/
|
|
519
515
|
declare function checkAbsoluteDeny(call: RunnerToolCall, projectRoot: string, executionCwd?: string): AbsoluteDenyResult;
|
|
520
516
|
|
|
@@ -659,7 +655,7 @@ interface AutoModeRulesContext {
|
|
|
659
655
|
/** Trusted host metadata used when a tool has no path-specific analyzer. */
|
|
660
656
|
readonly toolSideEffect?: ToolSideEffect;
|
|
661
657
|
}
|
|
662
|
-
type AutoModePermissionBoundary = 'workspace' | 'system-temp' | 'outside-workspace' | 'protected' | 'unresolved';
|
|
658
|
+
type AutoModePermissionBoundary = 'workspace' | 'system-temp' | 'agent-home' | 'agent-home-readonly' | 'outside-workspace' | 'protected' | 'unresolved';
|
|
663
659
|
interface AutoModePermissionTarget {
|
|
664
660
|
readonly path: string;
|
|
665
661
|
readonly boundary: AutoModePermissionBoundary;
|
|
@@ -733,6 +729,8 @@ interface AutoModeGuardrailConfig {
|
|
|
733
729
|
readonly allowOnClassifierFailure?: (call: RunnerToolCall) => boolean | Promise<boolean>;
|
|
734
730
|
/** Whether ordinary bash calls can be enforced by an OS workspace sandbox. */
|
|
735
731
|
readonly workspaceShellSandboxAvailable?: boolean;
|
|
732
|
+
/** Host invariant: every allowed Bash call must receive exact fail-closed admission. */
|
|
733
|
+
readonly requireWorkspaceShellSandbox?: boolean;
|
|
736
734
|
/** Mint one exact bash call for workspace-sandboxed execution. */
|
|
737
735
|
readonly admitWorkspaceSandboxCall?: (call: RunnerToolCall, review: AutoModePermissionReview) => void;
|
|
738
736
|
/**
|
|
@@ -874,6 +872,13 @@ interface AutoModeGuardrailConfig {
|
|
|
874
872
|
*/
|
|
875
873
|
readonly speculativeWindowMs?: number;
|
|
876
874
|
}
|
|
875
|
+
interface AgentHomeShellBoundaryGuardrailOptions {
|
|
876
|
+
readonly projectRoot: string;
|
|
877
|
+
readonly executionCwd: string;
|
|
878
|
+
readonly failClosedShellSandbox: boolean;
|
|
879
|
+
readonly effectTreeContainmentAvailable?: boolean;
|
|
880
|
+
readonly protectedReadReviewAvailable?: boolean;
|
|
881
|
+
}
|
|
877
882
|
/**
|
|
878
883
|
* Snapshot of the auto-mode guardrail's session-scoped state. Returned by
|
|
879
884
|
* `getStats()` for diagnostic surfaces (`/auto-denials`) and the status bar
|
|
@@ -905,7 +910,8 @@ interface AutoModeToolGuardrail extends ToolGuardrail {
|
|
|
905
910
|
/** Test-only override: swap the provider mid-test. */
|
|
906
911
|
setProviderForTest(provider: KodaXBaseProvider): void;
|
|
907
912
|
}
|
|
913
|
+
declare function createAgentHomeShellBoundaryGuardrail(options: AgentHomeShellBoundaryGuardrailOptions): ToolGuardrail;
|
|
908
914
|
declare function createAutoModeToolGuardrail(config: AutoModeGuardrailConfig): AutoModeToolGuardrail;
|
|
909
915
|
|
|
910
|
-
export { CLASSIFIER_MAX_OUTPUT_TOKENS as C, DEFAULT_CLASSIFIER_RETRY_TIMEOUT_MS as
|
|
911
|
-
export type {
|
|
916
|
+
export { CLASSIFIER_MAX_OUTPUT_TOKENS as C, DEFAULT_CLASSIFIER_RETRY_TIMEOUT_MS as N, DEFAULT_CLASSIFIER_TIMEOUT_MS as O, ERROR_THRESHOLD as Q, WINDOW_MS as a3, checkAbsoluteDeny as a4, classify as a5, collectAllSignals as a6, computeRulesFingerprint as a7, createAgentHomeShellBoundaryGuardrail as a8, createAutoModeToolGuardrail as a9, createCircuitBreaker as aa, createDenialTracker as ab, formatAgentsForPrompt as ac, getKodaxGlobalDir as ad, loadAgentsFiles as ae, loadAutoRules as af, parseAutoRules as ag, parseClassifierOutput as ah, readTrustState as ai, recordAllow as aj, recordBlock as ak, recordError as al, shouldFallback as am, shouldFallback$1 as an, trustProjectRules as ao, CONSECUTIVE_THRESHOLD as w, CUMULATIVE_THRESHOLD as x };
|
|
917
|
+
export type { SkippedRulesSource as $, AbsoluteDenyCheck as A, ClassifierAttemptOutcome as B, ClassifierDecision as D, ClassifierFailureKind as E, ClassifierHazard as F, ClassifierObservedProtocol as G, ClassifierOutputWarningCode as H, ClassifierParseFailureCode as I, ClassifierProtocol as J, ClassifierToolProjectionResolver as K, ClassifyDecision as L, ClassifyOptions as M, DenialTracker as P, KodaXMcpConnectMode as R, KodaXMcpServerConfig as S, KodaXMcpServersConfig as T, KodaXMcpTransport as U, LoadAgentsOptions as V, LoadedRulesSource as W, PermissionIntentEvidence as X, RulesLoadError as Y, RulesLoadResult as Z, SignalCollector as _, AbsoluteDenyMatch as a, TierZeroPatternId as a0, ToolCallSignal as a1, TrustState as a2, AbsoluteDenyMiss as b, AbsoluteDenyResult as c, AgentHomeShellBoundaryGuardrailOptions as d, AgentsFile as e, AutoModeAskUser as f, AutoModeAskUserVerdict as g, AutoModeCallAnalyzer as h, AutoModeDecisionDiagnostics as i, AutoModeEngine as j, AutoModeGuardrailConfig as k, AutoModePermissionBoundary as l, AutoModePermissionOperation as m, AutoModePermissionReview as n, AutoModePermissionTarget as o, AutoModeRulesContext as p, AutoModeRulesDecision as q, AutoModeRulesEvaluator as r, AutoModeSharedState as s, AutoModeStats as t, AutoModeToolGuardrail as u, AutoRules as v, CircuitBreaker as y, ClassifierAttemptDiagnostics as z };
|
package/dist/types-chunks/{history-retrieval.d-BDI-ZMvY.d.ts → history-retrieval.d-Debbzn1z.d.ts}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { k as KodaXMessage } from './types.d-CgrXrFrq.js';
|
|
2
|
-
import {
|
|
2
|
+
import { ab as KodaXSessionLineage } from './types.d-DlLBRqZ9.js';
|
|
3
3
|
|
|
4
4
|
type KodaXSessionHistoryScope = 'compacted' | 'all';
|
|
5
5
|
type KodaXSessionHistorySource = 'user' | 'assistant' | 'system' | 'tool' | 'child_task';
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { a as BashPrefixExtractor, t as KodaXAgentMode } from './bash-prefix-extractor.d-
|
|
1
|
+
import { a as BashPrefixExtractor, t as KodaXAgentMode } from './bash-prefix-extractor.d-BnZQDirs.js';
|
|
2
2
|
import { G as KodaXReasoningMode, k as KodaXMessage, T as KodaXTaskResultMetadata } from './types.d-CgrXrFrq.js';
|
|
3
|
-
import {
|
|
3
|
+
import { bF as LearningSurfaceSnapshot$1, bA as LearningQuery, bz as LearningPage, bc as LearnedCapabilityRecord, bv as LearningEvent, bE as LearningSubscribeOptions, aj as CompactionReport } from './controller.d-Dzxz22X-.js';
|
|
4
|
+
import { a6 as KodaXSessionData, ab as KodaXSessionLineage, ag as KodaXSessionNavigationOptions, ai as KodaXSessionRuntimeInfo, ak as KodaXSessionStorage, a7 as KodaXSessionEntry, a2 as KodaXSessionArtifactLedgerEntry, Q as KodaXExtensionSessionRecord, am as KodaXSessionUiHistoryItem, aj as KodaXSessionScope, c as AgentActorSnapshot, Y as KodaXJsonValue } from './types.d-DlLBRqZ9.js';
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
7
|
* TextBuffer - Text buffer management class - 文本缓冲区管理类
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { n as ResolvedAutoModeSettings, b as CommandDefinition, e as CommandSource, c as CommandInfo, C as Command$1, I as InteractiveContext, a as CommandCallbacks, g as CurrentConfig, d as CommandInvocationRequest, f as CommandWorkflowInvocationRequest, p as RuntimeSurfaceStatus } from './utils.d-
|
|
2
|
-
import { ae as SessionStorage$1, S as PermissionMode, L as LearningBinding } from './public-api.d-
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
1
|
+
import { n as ResolvedAutoModeSettings, b as CommandDefinition, e as CommandSource, c as CommandInfo, C as Command$1, I as InteractiveContext, a as CommandCallbacks, g as CurrentConfig, d as CommandInvocationRequest, f as CommandWorkflowInvocationRequest, p as RuntimeSurfaceStatus } from './utils.d-BI-kjuev.js';
|
|
2
|
+
import { ae as SessionStorage$1, S as PermissionMode, L as LearningBinding } from './public-api.d-N6G6Jw8X.js';
|
|
3
|
+
import { a4 as KodaXOptions, ag as KodaXResult } from './bash-prefix-extractor.d-BnZQDirs.js';
|
|
4
|
+
import { ak as KodaXSessionStorage, a6 as KodaXSessionData } from './types.d-DlLBRqZ9.js';
|
|
5
|
+
import { t as AutoModeStats } from './guardrail.d-BCkgaWT1.js';
|
|
6
6
|
|
|
7
7
|
interface ReplRuntimePermissionGrantSuggestion {
|
|
8
8
|
readonly id: string;
|
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
import { $ as KodaXMemoryOutcomeDigest, aE as MemoryContextIdentity } from './types.d-DlLBRqZ9.js';
|
|
2
|
+
|
|
3
|
+
interface PendingEpisodeReviewV1 {
|
|
4
|
+
readonly version: 1;
|
|
5
|
+
readonly reviewKey: string;
|
|
6
|
+
readonly digest: KodaXMemoryOutcomeDigest;
|
|
7
|
+
readonly ownerSessionRef: string;
|
|
8
|
+
readonly ownerAgentHash: string;
|
|
9
|
+
readonly ownerProjectHash?: string;
|
|
10
|
+
readonly createdAt: string;
|
|
11
|
+
}
|
|
12
|
+
interface PendingEpisodeReviewV2 {
|
|
13
|
+
readonly version: 2;
|
|
14
|
+
readonly jobId: string;
|
|
15
|
+
readonly reviewKey: string;
|
|
16
|
+
readonly digest: KodaXMemoryOutcomeDigest;
|
|
17
|
+
readonly ownerSessionRef: string;
|
|
18
|
+
readonly ownerAgentHash: string;
|
|
19
|
+
readonly ownerProjectHash?: string;
|
|
20
|
+
readonly branchId: string;
|
|
21
|
+
readonly branchEpoch: number;
|
|
22
|
+
readonly authorityCeiling: 'memory_and_project_skill';
|
|
23
|
+
readonly createdAt: string;
|
|
24
|
+
}
|
|
25
|
+
type PendingEpisodeReview = PendingEpisodeReviewV1 | PendingEpisodeReviewV2;
|
|
26
|
+
interface PendingEpisodeReviewFilter {
|
|
27
|
+
readonly configHome?: string;
|
|
28
|
+
readonly tenantId: string;
|
|
29
|
+
readonly agentId?: string;
|
|
30
|
+
/** Omit for every project; pass null for ownerless reviews only. */
|
|
31
|
+
readonly projectId?: string | null;
|
|
32
|
+
}
|
|
33
|
+
type EpisodeReviewJobStatus = 'pending' | 'processing' | 'decided' | 'completed' | 'attention';
|
|
34
|
+
interface EpisodeReviewJobState {
|
|
35
|
+
readonly schemaVersion: 1;
|
|
36
|
+
readonly jobId: string;
|
|
37
|
+
readonly status: EpisodeReviewJobStatus;
|
|
38
|
+
readonly claimEpoch: number;
|
|
39
|
+
readonly claimToken?: string;
|
|
40
|
+
readonly leaseDeadline?: string;
|
|
41
|
+
readonly providerAttempts: number;
|
|
42
|
+
readonly applyAttempts: number;
|
|
43
|
+
readonly applyAttemptsByCarrier: {
|
|
44
|
+
readonly memory: number;
|
|
45
|
+
readonly skill: number;
|
|
46
|
+
};
|
|
47
|
+
readonly completionAttempts: number;
|
|
48
|
+
readonly nextAttemptAt?: string;
|
|
49
|
+
readonly nextApplyAttemptAt?: string;
|
|
50
|
+
readonly nextCompletionAttemptAt?: string;
|
|
51
|
+
readonly lastError?: string;
|
|
52
|
+
readonly updatedAt: string;
|
|
53
|
+
}
|
|
54
|
+
interface PendingEpisodeReviewSummary {
|
|
55
|
+
readonly version: 1 | 2;
|
|
56
|
+
readonly jobId?: string;
|
|
57
|
+
readonly reviewKey: string;
|
|
58
|
+
readonly ownerSessionRef: string;
|
|
59
|
+
readonly createdAt: string;
|
|
60
|
+
readonly status: EpisodeReviewJobStatus | 'unknown';
|
|
61
|
+
readonly providerAttempts?: number;
|
|
62
|
+
readonly applyAttempts?: number;
|
|
63
|
+
readonly completionAttempts?: number;
|
|
64
|
+
readonly nextAttemptAt?: string;
|
|
65
|
+
readonly nextApplyAttemptAt?: string;
|
|
66
|
+
readonly nextCompletionAttemptAt?: string;
|
|
67
|
+
readonly lastError?: string;
|
|
68
|
+
}
|
|
69
|
+
interface EpisodeReviewClaim {
|
|
70
|
+
readonly jobId: string;
|
|
71
|
+
readonly reviewKey: string;
|
|
72
|
+
readonly ownerSessionRef: string;
|
|
73
|
+
readonly branchId: string;
|
|
74
|
+
readonly branchEpoch: number;
|
|
75
|
+
readonly epoch: number;
|
|
76
|
+
readonly token: string;
|
|
77
|
+
readonly leaseDeadline: string;
|
|
78
|
+
}
|
|
79
|
+
interface EpisodeReviewInputSpec {
|
|
80
|
+
readonly evidence: unknown;
|
|
81
|
+
readonly promptRevision: string;
|
|
82
|
+
readonly schemaRevision: string;
|
|
83
|
+
readonly policyRevision: string;
|
|
84
|
+
readonly providerRevision: string;
|
|
85
|
+
}
|
|
86
|
+
interface EpisodeReviewInputCheckpoint extends EpisodeReviewInputSpec {
|
|
87
|
+
readonly version: 1;
|
|
88
|
+
readonly jobId: string;
|
|
89
|
+
readonly evidenceBytes: string;
|
|
90
|
+
readonly evidenceHash: string;
|
|
91
|
+
readonly createdAt: string;
|
|
92
|
+
}
|
|
93
|
+
interface EpisodeReviewDecisionInput {
|
|
94
|
+
readonly inputHash: string;
|
|
95
|
+
readonly memoryProposalIds: readonly string[];
|
|
96
|
+
readonly requiredCarriers?: readonly ('memory' | 'skill')[];
|
|
97
|
+
readonly memoryPlan?: unknown;
|
|
98
|
+
readonly capabilityDecision?: unknown;
|
|
99
|
+
}
|
|
100
|
+
interface EpisodeReviewDecision extends EpisodeReviewDecisionInput {
|
|
101
|
+
readonly version: 1;
|
|
102
|
+
readonly jobId: string;
|
|
103
|
+
readonly decisionId: string;
|
|
104
|
+
readonly committedAt: string;
|
|
105
|
+
}
|
|
106
|
+
interface EpisodeReviewActionInput {
|
|
107
|
+
readonly actionId: string;
|
|
108
|
+
readonly decisionId: string;
|
|
109
|
+
readonly carrier: 'memory' | 'skill';
|
|
110
|
+
readonly resultRefs: readonly string[];
|
|
111
|
+
}
|
|
112
|
+
interface EpisodeReviewActionReceipt extends EpisodeReviewActionInput {
|
|
113
|
+
readonly version: 1;
|
|
114
|
+
readonly jobId: string;
|
|
115
|
+
readonly committedAt: string;
|
|
116
|
+
}
|
|
117
|
+
type EpisodeReviewFailureKind = 'provider_timeout' | 'provider_error' | 'malformed_response' | 'shutdown' | 'budget_unavailable' | 'provider_unavailable';
|
|
118
|
+
declare class EpisodeReviewFailure extends Error {
|
|
119
|
+
readonly kind: EpisodeReviewFailureKind;
|
|
120
|
+
constructor(kind: EpisodeReviewFailureKind, message: string);
|
|
121
|
+
}
|
|
122
|
+
interface EpisodeReviewJobSnapshot {
|
|
123
|
+
readonly envelope: PendingEpisodeReviewV2;
|
|
124
|
+
readonly state: EpisodeReviewJobState;
|
|
125
|
+
readonly input?: EpisodeReviewInputCheckpoint;
|
|
126
|
+
readonly decision?: EpisodeReviewDecision;
|
|
127
|
+
readonly actions: readonly EpisodeReviewActionReceipt[];
|
|
128
|
+
}
|
|
129
|
+
interface EpisodeReviewReceipt {
|
|
130
|
+
readonly version: 1;
|
|
131
|
+
readonly jobId?: string;
|
|
132
|
+
readonly reviewKey: string;
|
|
133
|
+
readonly ownerAgentHash?: string;
|
|
134
|
+
readonly ownerProjectHash?: string;
|
|
135
|
+
readonly proposalIds: readonly string[];
|
|
136
|
+
readonly completedAt: string;
|
|
137
|
+
}
|
|
138
|
+
type EpisodeReviewDrainEligibility = 'eligible' | 'discard' | 'defer';
|
|
139
|
+
interface EpisodeReviewDrainOptions {
|
|
140
|
+
readonly maxEntries?: number;
|
|
141
|
+
/** Process this just-persisted job before bounded backlog work. */
|
|
142
|
+
readonly preferredJobId?: string;
|
|
143
|
+
/** Skip unrelated backlog when searching across alternate project identities. */
|
|
144
|
+
readonly onlyPreferred?: boolean;
|
|
145
|
+
/** Epoch-ms deadline: stop claiming new jobs once passed and release an
|
|
146
|
+
* in-flight claim instead of committing a decision. */
|
|
147
|
+
readonly deadlineAtMs?: number;
|
|
148
|
+
readonly revalidate: (entry: PendingEpisodeReview) => Promise<EpisodeReviewDrainEligibility>;
|
|
149
|
+
readonly review: (entry: PendingEpisodeReview) => Promise<readonly string[]>;
|
|
150
|
+
readonly prepareV2Input?: (entry: PendingEpisodeReviewV2) => Promise<EpisodeReviewInputSpec>;
|
|
151
|
+
readonly decideV2?: (entry: PendingEpisodeReviewV2, input: EpisodeReviewInputCheckpoint, signal: AbortSignal) => Promise<EpisodeReviewDecisionInput>;
|
|
152
|
+
readonly listV2Actions?: (entry: PendingEpisodeReviewV2, decision: EpisodeReviewDecision) => readonly ('memory' | 'skill')[];
|
|
153
|
+
readonly applyV2Action?: (entry: PendingEpisodeReviewV2, decision: EpisodeReviewDecision, carrier: 'memory' | 'skill', claim: EpisodeReviewClaim, commitWithAuthority: (effect: (revalidateAuthority: () => Promise<void>) => Promise<readonly string[]>) => Promise<readonly string[]>) => Promise<readonly string[]>;
|
|
154
|
+
readonly onV2Completed?: (entry: PendingEpisodeReviewV2, decision: EpisodeReviewDecision, proposalIds: readonly string[]) => Promise<void>;
|
|
155
|
+
}
|
|
156
|
+
interface EpisodeReviewDrainResult {
|
|
157
|
+
readonly reviewed: number;
|
|
158
|
+
readonly discarded: number;
|
|
159
|
+
readonly deferred: number;
|
|
160
|
+
readonly failed: number;
|
|
161
|
+
readonly failures: readonly {
|
|
162
|
+
readonly reviewKey: string;
|
|
163
|
+
readonly error: string;
|
|
164
|
+
}[];
|
|
165
|
+
}
|
|
166
|
+
declare class EpisodeReviewBranchChangedError extends Error {
|
|
167
|
+
constructor();
|
|
168
|
+
}
|
|
169
|
+
declare function captureEpisodeReviewBranchEpoch(identity: MemoryContextIdentity): Promise<number>;
|
|
170
|
+
declare function persistPendingEpisodeReview(identity: MemoryContextIdentity, digest: KodaXMemoryOutcomeDigest, options?: {
|
|
171
|
+
readonly expectedBranchEpoch?: number;
|
|
172
|
+
readonly persistOwner?: (entry: PendingEpisodeReviewV2) => Promise<void>;
|
|
173
|
+
}): Promise<{
|
|
174
|
+
readonly path: string;
|
|
175
|
+
readonly entry: PendingEpisodeReviewV2;
|
|
176
|
+
}>;
|
|
177
|
+
declare function claimEpisodeReview(identity: MemoryContextIdentity, reviewKeyOrJobId: string, options?: {
|
|
178
|
+
readonly now?: Date;
|
|
179
|
+
readonly leaseMs?: number;
|
|
180
|
+
}): Promise<EpisodeReviewClaim | undefined>;
|
|
181
|
+
declare function freezeEpisodeReviewInput(identity: MemoryContextIdentity, claim: EpisodeReviewClaim, spec: EpisodeReviewInputSpec, now?: Date): Promise<EpisodeReviewInputCheckpoint>;
|
|
182
|
+
declare function commitEpisodeReviewDecision(identity: MemoryContextIdentity, claim: EpisodeReviewClaim, input: EpisodeReviewDecisionInput, now?: Date): Promise<EpisodeReviewDecision>;
|
|
183
|
+
declare function commitEpisodeReviewAction(identity: MemoryContextIdentity, claim: EpisodeReviewClaim, input: EpisodeReviewActionInput, now?: Date): Promise<EpisodeReviewActionReceipt>;
|
|
184
|
+
declare function withEpisodeReviewClaimAuthority<T>(identity: MemoryContextIdentity, claim: EpisodeReviewClaim, operation: (revalidateAuthority: () => Promise<void>) => Promise<T>): Promise<T>;
|
|
185
|
+
declare function failEpisodeReviewAttempt(identity: MemoryContextIdentity, claim: EpisodeReviewClaim, failure: {
|
|
186
|
+
readonly kind: EpisodeReviewFailureKind;
|
|
187
|
+
readonly message: string;
|
|
188
|
+
}, now?: Date): Promise<EpisodeReviewJobState>;
|
|
189
|
+
declare function failEpisodeReviewApply(identity: MemoryContextIdentity, claim: EpisodeReviewClaim, failure: {
|
|
190
|
+
readonly carrier: 'memory' | 'skill';
|
|
191
|
+
readonly message: string;
|
|
192
|
+
}, now?: Date): Promise<EpisodeReviewJobState>;
|
|
193
|
+
declare function deferEpisodeReview(identity: MemoryContextIdentity, claim: EpisodeReviewClaim, reason: string, now?: Date): Promise<EpisodeReviewJobState>;
|
|
194
|
+
declare function completeFencedEpisodeReview(identity: MemoryContextIdentity, claim: EpisodeReviewClaim, proposalIds: readonly string[], now?: Date): Promise<{
|
|
195
|
+
readonly acknowledged: boolean;
|
|
196
|
+
readonly receiptPath: string;
|
|
197
|
+
}>;
|
|
198
|
+
declare function discardFencedEpisodeReview(identity: MemoryContextIdentity, claim: EpisodeReviewClaim, reason: string, now?: Date): Promise<void>;
|
|
199
|
+
declare function inspectEpisodeReviewJob(identity: MemoryContextIdentity, reviewKeyOrJobId: string): Promise<EpisodeReviewJobSnapshot | undefined>;
|
|
200
|
+
declare function listPendingEpisodeReviews(filter: PendingEpisodeReviewFilter): Promise<readonly PendingEpisodeReview[]>;
|
|
201
|
+
declare function listPendingEpisodeReviewSummaries(filter: PendingEpisodeReviewFilter): Promise<readonly PendingEpisodeReviewSummary[]>;
|
|
202
|
+
declare function completeEpisodeReview(identity: MemoryContextIdentity, reviewKey: string, proposalIds: readonly string[]): Promise<{
|
|
203
|
+
readonly acknowledged: boolean;
|
|
204
|
+
readonly receiptPath: string;
|
|
205
|
+
}>;
|
|
206
|
+
/**
|
|
207
|
+
* Establishes the lock order used by both review completion and Session branch
|
|
208
|
+
* mutation: the Session root registry first, every sorted tenant branch fence
|
|
209
|
+
* next, then the caller-owned Session transaction. The supplied fence operation
|
|
210
|
+
* runs without reacquiring those locks, so a mutation can fence its prospective
|
|
211
|
+
* lineage and persist that exact lineage atomically with respect to review
|
|
212
|
+
* effects, new tenant registration and completion delivery.
|
|
213
|
+
*/
|
|
214
|
+
declare function withPendingEpisodeReviewSessionFence<T>(input: {
|
|
215
|
+
readonly configHome?: string;
|
|
216
|
+
readonly sessionId: string;
|
|
217
|
+
}, operation: (fence: (activeReviewIds: readonly string[]) => Promise<number>) => Promise<T>): Promise<T>;
|
|
218
|
+
declare function drainPendingEpisodeReviews(identity: MemoryContextIdentity, options: EpisodeReviewDrainOptions): Promise<EpisodeReviewDrainResult>;
|
|
219
|
+
|
|
220
|
+
export { deferEpisodeReview as A, discardFencedEpisodeReview as B, drainPendingEpisodeReviews as C, failEpisodeReviewApply as D, failEpisodeReviewAttempt as F, freezeEpisodeReviewInput as G, inspectEpisodeReviewJob as H, listPendingEpisodeReviewSummaries as I, listPendingEpisodeReviews as J, persistPendingEpisodeReview as K, withEpisodeReviewClaimAuthority as L, withPendingEpisodeReviewSessionFence as M, EpisodeReviewBranchChangedError as b, EpisodeReviewFailure as i, captureEpisodeReviewBranchEpoch as u, claimEpisodeReview as v, commitEpisodeReviewAction as w, commitEpisodeReviewDecision as x, completeEpisodeReview as y, completeFencedEpisodeReview as z };
|
|
221
|
+
export type { EpisodeReviewActionInput as E, PendingEpisodeReview as P, EpisodeReviewActionReceipt as a, EpisodeReviewClaim as c, EpisodeReviewDecision as d, EpisodeReviewDecisionInput as e, EpisodeReviewDrainEligibility as f, EpisodeReviewDrainOptions as g, EpisodeReviewDrainResult as h, EpisodeReviewFailureKind as j, EpisodeReviewInputCheckpoint as k, EpisodeReviewInputSpec as l, EpisodeReviewJobSnapshot as m, EpisodeReviewJobState as n, EpisodeReviewJobStatus as o, EpisodeReviewReceipt as p, PendingEpisodeReviewFilter as q, PendingEpisodeReviewSummary as r, PendingEpisodeReviewV1 as s, PendingEpisodeReviewV2 as t };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { dj as WorkflowProcessTrackerOptions, cR as WorkflowEvent, dd as WorkflowProcessSnapshot, d7 as WorkflowProcessEvent } from './controller.d-Dzxz22X-.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* FEATURE_246 Part A0 (ADR-046) — neutral workflow run lifecycle manager.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { h as CreatableHistoryItem, ar as ToolCall } from './public-api.d-
|
|
1
|
+
import { h as CreatableHistoryItem, ar as ToolCall } from './public-api.d-N6G6Jw8X.js';
|
|
2
2
|
import { k as KodaXMessage, c as KodaXContentBlock } from './types.d-CgrXrFrq.js';
|
|
3
|
-
import {
|
|
3
|
+
import { am as KodaXSessionUiHistoryItem, aq as KodaXSessionUiToolCall } from './types.d-DlLBRqZ9.js';
|
|
4
4
|
|
|
5
5
|
interface RestoreHistoryItemsFromSessionInput {
|
|
6
6
|
messages: readonly KodaXMessage[];
|
package/dist/types-chunks/{shell-command-sets.d-DfeSUjjM.d.ts → shell-command-sets.d-BrLw-WN9.d.ts}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as BashPrefixExtractor } from './bash-prefix-extractor.d-
|
|
1
|
+
import { a as BashPrefixExtractor } from './bash-prefix-extractor.d-BnZQDirs.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Permission Utilities
|
|
@@ -219,6 +219,7 @@ declare function extractPathsFromCommand(command: string): string[];
|
|
|
219
219
|
* Issue 052: Prevent "always" option for bash commands on protected paths
|
|
220
220
|
*/
|
|
221
221
|
declare function isCommandOnProtectedPath(command: string, projectRoot: string, executionCwd?: string): boolean;
|
|
222
|
+
declare function isBashReadCommandAutoAllowed(command: string, projectRoot: string, executionCwd?: string): boolean;
|
|
222
223
|
/**
|
|
223
224
|
* Check whether a path stays inside the project root after resolution.
|
|
224
225
|
*/
|
|
@@ -293,5 +294,5 @@ declare const MODIFICATION_TOOLS: Set<string>;
|
|
|
293
294
|
declare const BASH_WRITE_COMMANDS: Set<string>;
|
|
294
295
|
declare const BASH_SAFE_READ_COMMANDS: Set<string>;
|
|
295
296
|
|
|
296
|
-
export { BASH_SAFE_READ_COMMANDS as B, FILE_MODIFICATION_TOOLS as F, MODIFICATION_TOOLS as M, BASH_WRITE_COMMANDS as a, collectDeterministicBashWriteTargets as b, collectBashWriteTargets as c, getBashOutsideProjectWriteRisk as d, extractPathsFromCommand as e, findGitSubcommandIndex as f, generateSavePattern as g, getDirectShellBypassBlockReason as h, getPlanModeAllowedWritablePaths as i, getPlanModeBlockReason as j, gitSignatureInspectionMayExecute as k, inferPermissionMode as l, isAlwaysConfirmPath as m, isBashReadCommand as n,
|
|
297
|
+
export { BASH_SAFE_READ_COMMANDS as B, FILE_MODIFICATION_TOOLS as F, MODIFICATION_TOOLS as M, BASH_WRITE_COMMANDS as a, collectDeterministicBashWriteTargets as b, collectBashWriteTargets as c, getBashOutsideProjectWriteRisk as d, extractPathsFromCommand as e, findGitSubcommandIndex as f, generateSavePattern as g, getDirectShellBypassBlockReason as h, getPlanModeAllowedWritablePaths as i, getPlanModeBlockReason as j, gitSignatureInspectionMayExecute as k, inferPermissionMode as l, isAlwaysConfirmPath as m, isBashReadCommand as n, isBashReadCommandAutoAllowed as o, isBashWriteCommand as p, isCommandOnProtectedPath as q, isHelpCommand as r, isPathInsideProject as s, isPlanModeAllowedPath as t, isShellReadOnlyArgv as u, isToolCallAllowed as v, parseAllowedToolPattern as w, parseGitGrepShortOption as x, tokenizeRawCommandStages as y };
|
|
297
298
|
export type { GitGrepShortOption as G, PermissionMode as P, RawCommandWord as R };
|