@kodax-ai/kodax 0.7.43 → 0.7.45

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/CHANGELOG.md +80 -0
  2. package/README.md +6 -5
  3. package/README_CN.md +6 -5
  4. package/dist/chunks/chunk-CZHIUJQS.js +535 -0
  5. package/dist/chunks/{chunk-IYSK7LUK.js → chunk-FKB7BWQT.js} +1 -1
  6. package/dist/chunks/chunk-FT2XFFNP.js +2 -0
  7. package/dist/chunks/chunk-IJUB7QXG.js +425 -0
  8. package/dist/chunks/chunk-PGF5EZ7C.js +31 -0
  9. package/dist/chunks/chunk-X6EHEQWP.js +849 -0
  10. package/dist/chunks/{compaction-config-3E57ABCT.js → compaction-config-WCNGYWT3.js} +1 -1
  11. package/dist/chunks/{construction-bootstrap-JR63KI5N.js → construction-bootstrap-OB5SDNBD.js} +1 -1
  12. package/dist/chunks/dist-C2VOGY5Z.js +2 -0
  13. package/dist/chunks/{dist-XANXEVTU.js → dist-Q2PQM7U7.js} +1 -1
  14. package/dist/chunks/{utils-HQ2QCKJA.js → utils-CHXCBR3Q.js} +1 -1
  15. package/dist/index.d.ts +8 -8
  16. package/dist/index.js +2 -2
  17. package/dist/kodax_cli.js +764 -709
  18. package/dist/provider-capabilities.json +181 -0
  19. package/dist/sdk-agent.d.ts +108 -8
  20. package/dist/sdk-agent.js +1 -1
  21. package/dist/sdk-coding.d.ts +385 -13
  22. package/dist/sdk-coding.js +1 -1
  23. package/dist/sdk-llm.d.ts +1 -1
  24. package/dist/sdk-llm.js +1 -1
  25. package/dist/sdk-mcp.js +1 -1
  26. package/dist/sdk-repl.d.ts +7 -6
  27. package/dist/sdk-repl.js +1 -1
  28. package/dist/sdk-session.d.ts +2 -2
  29. package/dist/sdk-session.js +1 -1
  30. package/dist/sdk-skills.js +1 -1
  31. package/dist/types-chunks/{bash-prefix-extractor.d-DMrGImMl.d.ts → bash-prefix-extractor.d-HrTUwtV7.d.ts} +597 -142
  32. package/dist/types-chunks/file-tracker.d-DOfaoCbJ.d.ts +633 -0
  33. package/dist/types-chunks/{resolver.d-CA68_NeH.d.ts → resolver.d-OMwxURit.d.ts} +17 -14
  34. package/dist/types-chunks/{storage.d-DPAEX7zS.d.ts → storage.d-BvTdjYQF.d.ts} +13 -1
  35. package/dist/types-chunks/{file-tracker.d-zaLZeNBK.d.ts → types.d-DM8zEJgF.d.ts} +1029 -535
  36. package/dist/types-chunks/{types.d-mM8vqvhT.d.ts → types.d-HBbWT-iA.d.ts} +41 -3
  37. package/dist/types-chunks/{utils.d-DkLZD_wa.d.ts → utils.d-DSEX6Rq1.d.ts} +15 -3
  38. package/package.json +2 -2
  39. package/dist/chunks/chunk-7G5PSL6C.js +0 -830
  40. package/dist/chunks/chunk-K75O2CAE.js +0 -31
  41. package/dist/chunks/chunk-UG4262JI.js +0 -502
  42. package/dist/chunks/chunk-VHKAJDQD.js +0 -425
  43. package/dist/chunks/chunk-YMRZBS4G.js +0 -2
  44. package/dist/chunks/dist-KWHUKXEL.js +0 -2
  45. package/dist/types-chunks/types.d-CKJtjo-6.d.ts +0 -1127
@@ -1,11 +1,79 @@
1
- import { t as KodaXSessionScope, u as KodaXSessionStorage, f as KodaXJsonValue, h as KodaXSessionArtifactLedgerEntry, S as SessionErrorMetadata } from './types.d-mM8vqvhT.js';
2
- import { m as KodaXMessage, W as KodaXTokenUsage, D as KodaXReasoningMode, k as KodaXHarnessProfile, R as KodaXTaskWorkIntent, H as KodaXReviewScale, N as KodaXTaskComplexity, a as KodaXAmaFanoutClass, P as KodaXTaskRoutingDecision, Q as KodaXTaskType, I as KodaXRiskLevel, i as KodaXExecutionMode, c as KodaXAmaProfile, d as KodaXAmaTactic, b as KodaXAmaFanoutPolicy } from './types.d-B1uGoVTE.js';
3
- import { k as CompactionUpdate, o as Guardrail, D as DiscoveredInstance, C as ChildTaskRegistry, a1 as TaskAbortRegistry, K as RunnerToolCall, a4 as ToolGuardrail } from './types.d-CKJtjo-6.js';
4
1
  import { M as McpConnectMode, a as McpServerConfig, b as McpServersConfig, c as McpTransportKind } from './config.d-BfJUXxC0.js';
2
+ import { g as KodaXGoalState, s as KodaXSessionLineage, x as KodaXSessionScope, y as KodaXSessionStorage, i as KodaXJsonValue, k as KodaXSessionArtifactLedgerEntry, S as SessionErrorMetadata } from './types.d-HBbWT-iA.js';
3
+ import { W as KodaXTokenUsage, m as KodaXMessage, D as KodaXReasoningMode, k as KodaXHarnessProfile, R as KodaXTaskWorkIntent, H as KodaXReviewScale, N as KodaXTaskComplexity, a as KodaXAmaFanoutClass, P as KodaXTaskRoutingDecision, Q as KodaXTaskType, I as KodaXRiskLevel, i as KodaXExecutionMode, c as KodaXAmaProfile, d as KodaXAmaTactic, b as KodaXAmaFanoutPolicy } from './types.d-B1uGoVTE.js';
4
+ import { f as AgentMessage, av as StopHookFn, C as ChildTaskRegistry, p as CompactionUpdate, v as Guardrail, s as DiscoveredInstance, az as TaskAbortRegistry, aa as RunnerToolCall, aE as ToolGuardrail } from './types.d-DM8zEJgF.js';
5
5
  import { C as CapabilityKind, b as CapabilityResult } from './capability.d-3C62G8Eq.js';
6
6
  import { K as KodaXBaseProvider } from './base.d-FUJahC0i.js';
7
7
  import { a as CostTracker } from './cost-tracker.d-wRtyEW9d.js';
8
8
 
9
+ /**
10
+ * FEATURE_192 v0.7.44 Phase C — Goal-tools execution context.
11
+ *
12
+ * The 3 goal tools (`get_goal`, `create_goal`, `update_goal`) read +
13
+ * mutate persistent goal state. The coding layer does NOT own that
14
+ * state — it lives in the REPL-side session lineage. Tools call into
15
+ * this interface, which the runner-driven adapter wires at task start.
16
+ *
17
+ * Why an interface (not direct lineage access from the tool):
18
+ * 1. Lineage mutations need to round-trip through session storage
19
+ * (persistence + UI events); the tool shouldn't know that pipe.
20
+ * 2. The Sidecar Verifier call for `update_goal({complete})` needs
21
+ * runtime provider + transcript snapshot — wired at the boundary
22
+ * where verifier-provider-resolver runs, not inside the tool.
23
+ * 3. The 3-turn blocker rule has process-lifetime state that lives
24
+ * with the goal runtime, not with the tool registration.
25
+ *
26
+ * All three methods are async — both reads (because they may touch
27
+ * the session storage) and writes (because they persist).
28
+ */
29
+
30
+ interface GoalCompleteResult {
31
+ readonly ok: boolean;
32
+ /** Present iff `!ok` — explains why complete was rejected. */
33
+ readonly reason?: string;
34
+ /** Optional one-line how-to-fix from the verifier. */
35
+ readonly suggestedFix?: string;
36
+ }
37
+ interface GoalBlockedResult {
38
+ readonly ok: boolean;
39
+ /** Status message: success summary or rejection reason. Always set. */
40
+ readonly statusMessage: string;
41
+ /** Counter snapshot for transparency / debugging. */
42
+ readonly counter: {
43
+ readonly current: number;
44
+ readonly required: number;
45
+ };
46
+ }
47
+ interface GoalCreateInput {
48
+ readonly objective: string;
49
+ readonly tokenBudget?: number | null;
50
+ }
51
+ interface GoalToolsContext {
52
+ /** Read current goal state from the session lineage. */
53
+ readonly readGoal: () => Promise<KodaXGoalState | null>;
54
+ /** Create a new goal. Throws if an active goal already exists. */
55
+ readonly createGoal: (input: GoalCreateInput) => Promise<KodaXGoalState>;
56
+ /**
57
+ * Request transition to `complete`. Implementation runs the Sidecar
58
+ * Verifier and returns `{ok:false, reason}` on non-accept. On accept
59
+ * the lineage gets a new goal entry with `status: 'complete'`.
60
+ */
61
+ readonly requestComplete: () => Promise<GoalCompleteResult>;
62
+ /**
63
+ * Request transition to `blocked`. Implementation applies the
64
+ * 3-turn rule via `recordBlockerAttempt` and persists the updated
65
+ * counter regardless of whether the transition was allowed.
66
+ */
67
+ readonly requestBlocked: (blockerKind: string) => Promise<GoalBlockedResult>;
68
+ }
69
+ /**
70
+ * Module-scoped fallback: when the tool runs without a goal context
71
+ * wired (e.g. dispatched from a non-REPL test harness), each method
72
+ * returns a uniform "feature disabled" error so the model gets a
73
+ * clear signal rather than a silent failure.
74
+ */
75
+ declare function makeDisabledGoalToolsContext(): GoalToolsContext;
76
+
9
77
  /** One tool-call breadcrumb. Captures only the name + a 60-char input
10
78
  * hint so the snapshot stays compact under fan-out. Mirrors the
11
79
  * `inputHint` extraction in `buildChildEvents.onToolUseStart`. */
@@ -323,6 +391,245 @@ interface TodoStore {
323
391
  reset(): void;
324
392
  }
325
393
 
394
+ /**
395
+ * FEATURE_192 v0.7.44 Phase B — Goal lifecycle hook composer.
396
+ *
397
+ * Wraps the existing `Runner.run` lifecycle hooks (`beforeNextTurn`,
398
+ * `stopHook`) with goal-aware behaviour. Does NOT modify substrate —
399
+ * the agent runtime exposes `beforeNextTurn` (FEATURE_164 v0.7.41) and
400
+ * `stopHook` (FEATURE_184 v0.7.42) as already-stable hook surfaces;
401
+ * this module is a thin composer the caller (REPL / driver) opts into.
402
+ *
403
+ * Wiring:
404
+ * - turn-end accounting → `beforeNextTurn` (fires after each tool
405
+ * execution, before the next LLM call)
406
+ * - agent_end continuation → `stopHook` (fires on text-only
407
+ * termination, can return a continuation prompt to reanimate)
408
+ *
409
+ * `enabled: false` returns pass-through wrappers — useful for hosts
410
+ * that build the binding eagerly but want to no-op when no goal is
411
+ * active. Goal feature ships default ON in v0.7.44; the `enabled`
412
+ * knob is for embedders, not user-facing gating.
413
+ */
414
+
415
+ /**
416
+ * Caller-supplied accessors for the goal lifecycle context. The
417
+ * composer does NOT own goal state — it reads via getters and writes
418
+ * via the persist callback. This keeps the composer reentrant and
419
+ * test-friendly (no global mutable cache).
420
+ */
421
+ interface GoalLifecycleContext {
422
+ /** Returns the current goal state, or null when no active goal. */
423
+ readonly getGoal: () => KodaXGoalState | null;
424
+ /**
425
+ * Returns the latest LLM token usage from the just-completed turn.
426
+ * Returns undefined when usage is unavailable (e.g. mid-turn
427
+ * before any LLM call). Optional — accounting is skipped when null.
428
+ */
429
+ readonly getLatestUsage?: () => KodaXTokenUsage | undefined;
430
+ /**
431
+ * Returns the wall-clock timestamp (Date.now() ms) at the start of
432
+ * the turn just completed. The composer pairs this with Date.now()
433
+ * at hook fire time to derive `timeUsedSeconds` delta. Optional —
434
+ * when unset, wall-time is not charged (mirror legacy behaviour;
435
+ * callers without a per-turn clock anchor get token accounting only).
436
+ */
437
+ readonly getTurnStartMs?: () => number | undefined;
438
+ /**
439
+ * Returns the current permission mode. When `'plan'`, accounting is
440
+ * skipped (plan mode runs are not charged against the goal budget).
441
+ * Optional — when not provided, accounting always runs on active goals.
442
+ */
443
+ readonly getPermissionMode?: () => string | undefined;
444
+ /**
445
+ * Persist a goal state transition. Caller wires this to
446
+ * `appendGoalEntry` + session storage. The composer awaits — failures
447
+ * propagate to the runner (deliberate: a broken persist is a real
448
+ * bug worth surfacing, not silently swallowing).
449
+ */
450
+ readonly persistEvent: (state: KodaXGoalState | null, event: 'updated' | 'budget_limited' | 'complete' | 'blocked') => Promise<void>;
451
+ /**
452
+ * Build the continuation prompt body the stop-hook returns when the
453
+ * active goal should resume. Caller controls the prompt content so
454
+ * the same composer works for both Codex-parity literal continuation
455
+ * and any future variants.
456
+ */
457
+ readonly buildContinuationPrompt: (goal: KodaXGoalState) => string;
458
+ /**
459
+ * Returns true when the queue has pending user-priority messages.
460
+ * When pending messages exist, the goal SHOULD NOT autonomously
461
+ * continue — the user is steering and the next turn will pick up
462
+ * their input naturally. Optional — defaults to "no pending".
463
+ */
464
+ readonly hasPendingUserInput?: () => boolean;
465
+ }
466
+ interface BeforeNextTurnFnCtx {
467
+ readonly transcript: readonly AgentMessage[];
468
+ readonly iteration: number;
469
+ }
470
+ type BeforeNextTurnFn = (ctx: BeforeNextTurnFnCtx) => Promise<readonly AgentMessage[]>;
471
+ /**
472
+ * Wrap an existing `beforeNextTurn` callback with goal accounting.
473
+ * Returned hook:
474
+ * 1. Calls into the goal lifecycle ctx FIRST (read latest usage,
475
+ * apply token delta, persist on budget cross)
476
+ * 2. Delegates to the inner hook for the original behaviour
477
+ * (mid-turn user-prompt injection, etc.)
478
+ *
479
+ * Errors thrown by `persistEvent` propagate. Errors from `inner` also
480
+ * propagate. We don't swallow either — goal lifecycle bugs are real.
481
+ */
482
+ declare function withGoalBeforeNextTurn(ctx: GoalLifecycleContext, inner: BeforeNextTurnFn, options?: {
483
+ enabled: boolean;
484
+ }): BeforeNextTurnFn;
485
+ /**
486
+ * Wrap an existing `stopHook` with goal-driven continuation.
487
+ *
488
+ * Returned hook fires the inner hook FIRST (sidecar verifier wins on
489
+ * `revise` / `blocked`). If the inner hook returns `undefined` AND
490
+ * there's an active goal AND no pending user input, the wrapper
491
+ * returns a continuation string so the Runner reanimates the loop —
492
+ * Codex `/goal` parity.
493
+ *
494
+ * Budget exhaustion semantics: when the active goal has already
495
+ * flipped to `budget_limited`, the wrapper does NOT continue. The user
496
+ * must explicitly resume (`/goal resume`) or set a new budget.
497
+ *
498
+ * Reanimate budget: the Runner caps reanimate via
499
+ * `stopHookReanimateBudget` (default 2). The composer does not need to
500
+ * track its own budget — exceeding the budget is converted by the
501
+ * Runner to an abort with reason "reanimate budget exhausted", which
502
+ * surfaces to the user.
503
+ */
504
+ declare function withGoalStopHook(ctx: GoalLifecycleContext, inner: StopHookFn | undefined, options?: {
505
+ enabled: boolean;
506
+ }): StopHookFn;
507
+
508
+ /**
509
+ * FEATURE_192 v0.7.44 Phase F — Goal runtime binding factory.
510
+ *
511
+ * REPL (or any host that owns a `KodaXSessionLineage`) calls
512
+ * `buildGoalRuntimeBinding(deps)` once per `runManagedTask` invocation
513
+ * and passes the returned binding via
514
+ * `KodaXOptions.context.goalRuntime`. The runner-driven adapter wires:
515
+ * - `binding.goalContext` onto the tool-execution context (so the
516
+ * 3 goal tools can read/mutate state),
517
+ * - `binding.lifecycleCtx` into `withGoalBeforeNextTurn` /
518
+ * `withGoalStopHook` (turn-end accounting + continuation reanimate).
519
+ *
520
+ * Why a factory instead of host-side ad-hoc wiring:
521
+ * - Pulls the lineage-read + persist + sidecar-verifier-call wiring
522
+ * into one well-tested entry point so the host (REPL today; any
523
+ * future SDK consumer) doesn't have to re-implement the same glue.
524
+ * - The factory is the seam where v0.7.45+ extensions (e.g.
525
+ * objective-updated steering, multi-goal across forks) land
526
+ * without breaking the runner-driven contract.
527
+ *
528
+ * The factory does NOT own state — every accessor is a function the
529
+ * caller wires (`getLineage` reads from REPL's `context.lineage`,
530
+ * `saveSession` flushes to disk, etc.). This keeps the binding
531
+ * reentrant and test-friendly.
532
+ *
533
+ * Codex parity: the default `buildContinuationPrompt` mirrors codex's
534
+ * `core/templates/goals/continuation.md` verbatim in structure and
535
+ * intent — Continuation behavior / Budget / Work from evidence /
536
+ * Progress visibility / Fidelity / Completion audit / Blocked audit —
537
+ * with 6 documented KodaX-specific deviations (see the function
538
+ * JSDoc below for the full list). Two of the six are trailing
539
+ * "Runtime enforcement" paragraphs that make the KodaX runtime gates
540
+ * legible to the model (Sidecar Verifier on Completion audit + 3-turn
541
+ * counter on Blocked audit) so the model does not waste a turn being
542
+ * rejected; they do not replace the Codex teaching, they complement it.
543
+ *
544
+ * The earlier v0.7.44 draft trimmed this prompt aggressively under
545
+ * ADR-033 §4 ("no enumerated taxonomies"). That was a mechanical
546
+ * misapplication — Codex's Completion-audit enumerated list
547
+ * ("requirements / artifacts / commands / tests / gates / invariants /
548
+ * deliverables") names AUDIT DIMENSIONS, not the classification
549
+ * taxonomies §4 was written against ("RULE A/B/C/D" labels). The
550
+ * trim correlated with a Layer 2 C1 simple-continuation panel rate
551
+ * of 53% on the canonical 3-active-alias panel; restoring the Codex-
552
+ * faithful sections is the v0.7.44 follow-up before tagging.
553
+ * See: [[feedback_adr_033_scope_clarification_new_feature]].
554
+ *
555
+ * Progress visibility cites KodaX's `todo_*` tools (FEATURE_170 v0.7.41
556
+ * todo V2) rather than Codex's `update_plan`, since KodaX does not have
557
+ * `update_plan` but the equivalent multi-step planning surface lives
558
+ * in `todo_create` / `todo_update` / `todo_list` / `todo_get`.
559
+ */
560
+
561
+ /**
562
+ * Dependencies the host (REPL) wires into the binding. Everything is
563
+ * a callback because the binding has no opinion on storage — the host
564
+ * owns the lineage handle + flush pipe.
565
+ */
566
+ interface GoalRuntimeBindingDeps {
567
+ /** Returns the current session lineage. May throw if no lineage. */
568
+ readonly getLineage: () => KodaXSessionLineage;
569
+ /** Replace the host's lineage handle after a goal entry is appended. */
570
+ readonly setLineage: (next: KodaXSessionLineage) => void;
571
+ /** Flush the host's session storage. Awaited by the binding. */
572
+ readonly saveSession: () => Promise<void>;
573
+ /**
574
+ * Returns the latest LLM token usage from the just-completed turn.
575
+ * Wired by the host to the runner-driven `tokenStateRef.current.lastUsage`.
576
+ * Returns undefined before the first LLM call.
577
+ */
578
+ readonly getLatestUsage: () => KodaXTokenUsage | undefined;
579
+ /**
580
+ * Returns the wall-clock `Date.now()` ms at the start of the
581
+ * just-completed turn. The binding pairs it with `Date.now()` at
582
+ * hook fire time to derive `timeUsedSeconds` delta.
583
+ */
584
+ readonly getTurnStartMs: () => number | undefined;
585
+ /**
586
+ * Returns the current permission mode (`'plan'` skips accounting).
587
+ * Optional — host may omit if it never enters plan mode.
588
+ */
589
+ readonly getPermissionMode?: () => string | undefined;
590
+ /**
591
+ * Returns true when user-priority messages are pending on the main
592
+ * queue. When pending, the binding does NOT autonomously continue —
593
+ * the next turn's drain handles user input naturally.
594
+ */
595
+ readonly hasPendingUserInput: () => boolean;
596
+ /**
597
+ * Verifier hook for `update_goal({complete})`. Implemented by the
598
+ * coding layer's sidecar-verifier-bind helper; host passes the same
599
+ * function through.
600
+ */
601
+ readonly verifyComplete: (goal: KodaXGoalState) => Promise<GoalCompleteResult>;
602
+ }
603
+ interface GoalRuntimeBinding {
604
+ readonly goalContext: GoalToolsContext;
605
+ readonly lifecycleCtx: GoalLifecycleContext;
606
+ /**
607
+ * Replace the verifyComplete implementation at runtime.
608
+ *
609
+ * The REPL constructs the binding eagerly (before the runner exists)
610
+ * and supplies a stub verifyComplete. The runner-driven adapter
611
+ * then has access to runner-local context the REPL doesn't
612
+ * (transcript ref, mutation tracker, resolved verifier provider/
613
+ * model) and installs a real F184-backed verifier via this method.
614
+ *
615
+ * Idempotent: calling more than once just replaces the slot. The
616
+ * `goalContext.requestComplete` closure reads the slot fresh on
617
+ * every invocation, so any later swap is observed immediately.
618
+ *
619
+ * Called only from `buildRunnerGoalAdapter` in production; tests
620
+ * may also call it directly when exercising the goal-complete
621
+ * verifier path without a full runner harness.
622
+ */
623
+ readonly installVerifyComplete: (fn: GoalRuntimeBindingDeps['verifyComplete']) => void;
624
+ }
625
+ /**
626
+ * Build the binding. Pure factory — no global state, no side effects
627
+ * at construction; effects happen when the runner-driven adapter
628
+ * invokes the wrapped hooks or when a tool calls
629
+ * `goalContext.{readGoal,createGoal,requestComplete,requestBlocked}`.
630
+ */
631
+ declare function buildGoalRuntimeBinding(deps: GoalRuntimeBindingDeps): GoalRuntimeBinding;
632
+
326
633
  /**
327
634
  * FEATURE_093 (v0.7.24): minimal contract interface for the coding extension
328
635
  * runtime. Extracted so `@kodax-ai/coding/src/types.ts` can reference the
@@ -483,6 +790,162 @@ interface ProviderResiliencePolicy extends ProviderResilienceConfig {
483
790
  provider: string;
484
791
  }
485
792
 
793
+ /**
794
+ * FEATURE_200 Phase F (v0.7.45) — MCP domain types extracted from types.ts.
795
+ * Thin KodaX-facing aliases over the @kodax-ai/agent MCP types. Re-exported
796
+ * from ../types.ts so all `../types` importers are unaffected.
797
+ */
798
+
799
+ type KodaXMcpTransport = McpTransportKind;
800
+ type KodaXMcpConnectMode = McpConnectMode;
801
+ type KodaXMcpServerConfig = McpServerConfig;
802
+ /** Flat map of MCP server configs, keyed under `mcpServers` in config.json. */
803
+ type KodaXMcpServersConfig = McpServersConfig;
804
+
805
+ /**
806
+ * FEATURE_200 Phase F (v0.7.45) — Todo domain types extracted from types.ts.
807
+ * Self-contained (no other coding-type deps); re-exported from ../types.ts
808
+ * so all `../types` importers are unaffected.
809
+ */
810
+ /**
811
+ * Status of a planned todo item. Lifecycle: pending → in_progress →
812
+ * (completed | failed | skipped). Failed items are reset to pending
813
+ * when the next iteration begins (Evaluator revise verdict). Skipped
814
+ * is for Planner-side merging of two obligations into one.
815
+ */
816
+ type TodoStatus = 'pending' | 'in_progress' | 'completed' | 'failed' | 'skipped' | 'cancelled';
817
+ /**
818
+ * FEATURE_114 v0.7.36: Per-step deterministic evaluator hint. When a
819
+ * todo item carries an `evaluator`, the runner runs the corresponding
820
+ * deterministic check (build / test / lint) at the moment its status
821
+ * transitions to `completed`. Failure surfaces stderr in the next
822
+ * tool result so the Worker can self-correct. No LLM-as-judge
823
+ * variant — Phase 0.7 industry survey said 4/4 codebases reject
824
+ * per-step LLM verification.
825
+ */
826
+ type TodoEvaluatorHint = 'build' | 'test' | 'lint';
827
+ /**
828
+ * One row in the planner-produced todo list. Subject is the short
829
+ * imperative title (shown in the UI row + throttle reminder); the
830
+ * optional description carries fuller context for downstream consumers
831
+ * that need the full work instruction. Sourced from Scout's existing
832
+ * `executionObligations: string[]` payload (each string becomes the
833
+ * `subject` of one seed item, no `description`). Status is advanced
834
+ * via the `todo_update` tool by Scout (H0 path) / Worker / Generator /
835
+ * Planner.
836
+ *
837
+ * v0.7.42 — `content` field renamed to `subject` to match claudecode V2
838
+ * `TaskSchema` (TaskCreateTool's required `subject` + `description`
839
+ * pair). KodaX makes `description` optional because trivial single-line
840
+ * steps don't need it; weaker models reach the API more easily without
841
+ * the forced second-string burden.
842
+ *
843
+ * `owner` partitions the list when child agents run in parallel under
844
+ * `dispatch_child_task`; "main" is the parent thread.
845
+ */
846
+ interface TodoItem {
847
+ readonly id: string;
848
+ /** Brief imperative title — the row label users see in the plan list. */
849
+ readonly subject: string;
850
+ /**
851
+ * Optional fuller description / context. Read by the executing role
852
+ * when picking up an item (claudecode V2 `TaskGet`-style detail view).
853
+ * Not rendered in the compact plan-list row.
854
+ */
855
+ readonly description?: string;
856
+ readonly status: TodoStatus;
857
+ readonly owner?: string;
858
+ /** Index into the originating `executionObligations: string[]` array (0-based). */
859
+ readonly sourceObligationIndex?: number;
860
+ /** Optional note attached on a status transition (e.g. failure reason). */
861
+ readonly note?: string;
862
+ /**
863
+ * FEATURE_114 v0.7.36: per-step deterministic evaluator hint. When
864
+ * present, the runner runs the corresponding deterministic check on
865
+ * `pending → completed` and surfaces stderr / exit code in the next
866
+ * tool result on failure.
867
+ */
868
+ readonly evaluator?: TodoEvaluatorHint;
869
+ /**
870
+ * FEATURE_149 v0.7.38 (Slice C4) — present-continuous form of `content`,
871
+ * used by the spinner status line while this item is `in_progress`.
872
+ * Mirrors Claude Code's [`Spinner.tsx:169`](c:/Works/claudecode/src/components/Spinner.tsx#L169)
873
+ * `currentTodo?.activeForm` lookup. Examples:
874
+ * content: "Run failing test" → activeForm: "Running failing test"
875
+ * content: "Refactor auth" → activeForm: "Refactoring auth"
876
+ * content: "Verify build" → activeForm: "Verifying build"
877
+ *
878
+ * Optional. When absent, the spinner falls back to a generic verb (no
879
+ * regression vs pre-FEATURE_149 behavior). When the LLM provides
880
+ * activeForm via `todo_update`, the spinner picks it up live without
881
+ * waiting for the round to end — that's the user-visible "working on X
882
+ * now" feel CC achieves.
883
+ */
884
+ readonly activeForm?: string;
885
+ /**
886
+ * FEATURE_170 v0.7.41 — opaque per-task metadata bag carried alongside
887
+ * the item. Surface for downstream consumers (extension hooks, eval
888
+ * harnesses, future swarm features) to attach arbitrary structured
889
+ * context without forcing a schema change. UI does NOT render this.
890
+ * Empty / undefined when the LLM does not supply it.
891
+ */
892
+ readonly metadata?: Record<string, unknown>;
893
+ }
894
+ type TodoList = readonly TodoItem[];
895
+
896
+ /**
897
+ * FEATURE_200 Phase F (v0.7.45) — repo-intelligence domain types extracted
898
+ * from types.ts. Self-contained; re-exported from ../types.ts (and 4 members
899
+ * re-imported there for internal use). `../types` importers unaffected.
900
+ */
901
+ type KodaXRepoIntelligenceMode = 'auto' | 'off' | 'oss' | 'premium-shared' | 'premium-native';
902
+ type KodaXRepoIntelligenceResolvedMode = 'off' | 'oss' | 'premium-shared' | 'premium-native';
903
+ interface KodaXRepoIntelligenceCapability {
904
+ mode: KodaXRepoIntelligenceResolvedMode;
905
+ engine: 'oss' | 'premium';
906
+ bridge: 'none' | 'shared' | 'native';
907
+ level: 'basic' | 'enhanced';
908
+ status: 'ok' | 'limited' | 'unavailable' | 'warming';
909
+ warnings: string[];
910
+ contractVersion?: number;
911
+ }
912
+ interface KodaXRepoIntelligenceTrace {
913
+ mode: KodaXRepoIntelligenceResolvedMode;
914
+ engine: 'oss' | 'premium';
915
+ bridge: 'none' | 'shared' | 'native';
916
+ triggeredAt: string;
917
+ source: 'fallback' | 'premium';
918
+ daemonLatencyMs?: number;
919
+ cliLatencyMs?: number;
920
+ cacheHit?: boolean;
921
+ capsuleBytes?: number;
922
+ capsuleEstimatedTokens?: number;
923
+ }
924
+ /**
925
+ * Repo-intelligence retrieval trace event. Emitted by agent / managed-task
926
+ * pipelines (`emitRepoIntelligenceTrace` / `emitManagedRepoIntelligenceTrace`)
927
+ * at `routing` / `preturn` / `module` / `impact` / `task-snapshot` stages,
928
+ * consumed by REPL `json-events` (stdout JSONL contract), `cli-events`
929
+ * (interactive REPL), and `acp_server`.
930
+ *
931
+ * Note: FEATURE_083 (v0.7.24) initially marked this as superseded by
932
+ * `EvidenceSpan` in `@kodax-ai/agent`. **FEATURE_086 (v0.7.27) re-evaluated
933
+ * and retained it**: `EvidenceSpanData` is a generic
934
+ * `{ source, queryPreview?, resultCount?, cacheHit?, error? }` abstraction
935
+ * that does not carry the repo-intelligence-specific `stage` enum,
936
+ * `capability`, or `trace` bundle. The `stage` enum in particular is a
937
+ * typed contract that UI consumers (json-events schema) depend on;
938
+ * flattening it into a bag of attributes would drop type safety and break
939
+ * downstream script compatibility. This type is therefore a product
940
+ * feature of repo-intelligence, not legacy trace plumbing.
941
+ */
942
+ interface KodaXRepoIntelligenceTraceEvent {
943
+ stage: 'routing' | 'preturn' | 'module' | 'impact' | 'task-snapshot';
944
+ summary: string;
945
+ capability?: KodaXRepoIntelligenceCapability;
946
+ trace?: KodaXRepoIntelligenceTrace;
947
+ }
948
+
486
949
  interface KodaXEvents {
487
950
  onTextDelta?: (text: string) => void;
488
951
  onThinkingDelta?: (text: string) => void;
@@ -701,6 +1164,22 @@ interface KodaXSessionOptions {
701
1164
  scope?: KodaXSessionScope;
702
1165
  storage?: KodaXSessionStorage;
703
1166
  initialMessages?: KodaXMessage[];
1167
+ /**
1168
+ * Persistence ownership signal (FEATURE_173 dual-writer fix).
1169
+ *
1170
+ * When `true`, a higher-level host (the interactive REPL) owns writing
1171
+ * this session to `storage` — it persists the full lineage / uiHistory /
1172
+ * artifactLedger incrementally via `appendSessionDelta`. The runner MUST
1173
+ * NOT also snapshot the session: `saveSessionSnapshot` early-returns so
1174
+ * the runner's flat full-rewrite `storage.save` can never race / clobber
1175
+ * the host's richer incremental writes (which regressed `activeEntryId`
1176
+ * to the first round on resume).
1177
+ *
1178
+ * `storage` is still consulted for LOAD (resume / `resolveInitialMessages`
1179
+ * tier 2). When absent (print CLI, ACP, SDK headless), the runner remains
1180
+ * the sole writer — unchanged behaviour, fail-safe default.
1181
+ */
1182
+ persistedByHost?: boolean;
704
1183
  }
705
1184
  interface KodaXContextTokenSnapshot {
706
1185
  /** Current best-known token count for the full conversation context. */
@@ -723,143 +1202,6 @@ interface KodaXProviderPolicyHints {
723
1202
  workIntent?: KodaXTaskWorkIntent;
724
1203
  }
725
1204
 
726
- type KodaXMcpTransport = McpTransportKind;
727
- type KodaXMcpConnectMode = McpConnectMode;
728
- type KodaXMcpServerConfig = McpServerConfig;
729
- /** Flat map of MCP server configs, keyed under `mcpServers` in config.json. */
730
- type KodaXMcpServersConfig = McpServersConfig;
731
- type KodaXRepoIntelligenceMode = 'auto' | 'off' | 'oss' | 'premium-shared' | 'premium-native';
732
- type KodaXRepoIntelligenceResolvedMode = 'off' | 'oss' | 'premium-shared' | 'premium-native';
733
- interface KodaXRepoIntelligenceCapability {
734
- mode: KodaXRepoIntelligenceResolvedMode;
735
- engine: 'oss' | 'premium';
736
- bridge: 'none' | 'shared' | 'native';
737
- level: 'basic' | 'enhanced';
738
- status: 'ok' | 'limited' | 'unavailable' | 'warming';
739
- warnings: string[];
740
- contractVersion?: number;
741
- }
742
- interface KodaXRepoIntelligenceTrace {
743
- mode: KodaXRepoIntelligenceResolvedMode;
744
- engine: 'oss' | 'premium';
745
- bridge: 'none' | 'shared' | 'native';
746
- triggeredAt: string;
747
- source: 'fallback' | 'premium';
748
- daemonLatencyMs?: number;
749
- cliLatencyMs?: number;
750
- cacheHit?: boolean;
751
- capsuleBytes?: number;
752
- capsuleEstimatedTokens?: number;
753
- }
754
- /**
755
- * Repo-intelligence retrieval trace event. Emitted by agent / managed-task
756
- * pipelines (`emitRepoIntelligenceTrace` / `emitManagedRepoIntelligenceTrace`)
757
- * at `routing` / `preturn` / `module` / `impact` / `task-snapshot` stages,
758
- * consumed by REPL `json-events` (stdout JSONL contract), `cli-events`
759
- * (interactive REPL), and `acp_server`.
760
- *
761
- * Note: FEATURE_083 (v0.7.24) initially marked this as superseded by
762
- * `EvidenceSpan` in `@kodax-ai/agent`. **FEATURE_086 (v0.7.27) re-evaluated
763
- * and retained it**: `EvidenceSpanData` is a generic
764
- * `{ source, queryPreview?, resultCount?, cacheHit?, error? }` abstraction
765
- * that does not carry the repo-intelligence-specific `stage` enum,
766
- * `capability`, or `trace` bundle. The `stage` enum in particular is a
767
- * typed contract that UI consumers (json-events schema) depend on;
768
- * flattening it into a bag of attributes would drop type safety and break
769
- * downstream script compatibility. This type is therefore a product
770
- * feature of repo-intelligence, not legacy trace plumbing.
771
- */
772
- interface KodaXRepoIntelligenceTraceEvent {
773
- stage: 'routing' | 'preturn' | 'module' | 'impact' | 'task-snapshot';
774
- summary: string;
775
- capability?: KodaXRepoIntelligenceCapability;
776
- trace?: KodaXRepoIntelligenceTrace;
777
- }
778
- /**
779
- * Status of a planned todo item. Lifecycle: pending → in_progress →
780
- * (completed | failed | skipped). Failed items are reset to pending
781
- * when the next iteration begins (Evaluator revise verdict). Skipped
782
- * is for Planner-side merging of two obligations into one.
783
- */
784
- type TodoStatus = 'pending' | 'in_progress' | 'completed' | 'failed' | 'skipped' | 'cancelled';
785
- /**
786
- * FEATURE_114 v0.7.36: Per-step deterministic evaluator hint. When a
787
- * todo item carries an `evaluator`, the runner runs the corresponding
788
- * deterministic check (build / test / lint) at the moment its status
789
- * transitions to `completed`. Failure surfaces stderr in the next
790
- * tool result so the Worker can self-correct. No LLM-as-judge
791
- * variant — Phase 0.7 industry survey said 4/4 codebases reject
792
- * per-step LLM verification.
793
- */
794
- type TodoEvaluatorHint = 'build' | 'test' | 'lint';
795
- /**
796
- * One row in the planner-produced todo list. Subject is the short
797
- * imperative title (shown in the UI row + throttle reminder); the
798
- * optional description carries fuller context for downstream consumers
799
- * that need the full work instruction. Sourced from Scout's existing
800
- * `executionObligations: string[]` payload (each string becomes the
801
- * `subject` of one seed item, no `description`). Status is advanced
802
- * via the `todo_update` tool by Scout (H0 path) / Worker / Generator /
803
- * Planner.
804
- *
805
- * v0.7.42 — `content` field renamed to `subject` to match claudecode V2
806
- * `TaskSchema` (TaskCreateTool's required `subject` + `description`
807
- * pair). KodaX makes `description` optional because trivial single-line
808
- * steps don't need it; weaker models reach the API more easily without
809
- * the forced second-string burden.
810
- *
811
- * `owner` partitions the list when child agents run in parallel under
812
- * `dispatch_child_task`; "main" is the parent thread.
813
- */
814
- interface TodoItem {
815
- readonly id: string;
816
- /** Brief imperative title — the row label users see in the plan list. */
817
- readonly subject: string;
818
- /**
819
- * Optional fuller description / context. Read by the executing role
820
- * when picking up an item (claudecode V2 `TaskGet`-style detail view).
821
- * Not rendered in the compact plan-list row.
822
- */
823
- readonly description?: string;
824
- readonly status: TodoStatus;
825
- readonly owner?: string;
826
- /** Index into the originating `executionObligations: string[]` array (0-based). */
827
- readonly sourceObligationIndex?: number;
828
- /** Optional note attached on a status transition (e.g. failure reason). */
829
- readonly note?: string;
830
- /**
831
- * FEATURE_114 v0.7.36: per-step deterministic evaluator hint. When
832
- * present, the runner runs the corresponding deterministic check on
833
- * `pending → completed` and surfaces stderr / exit code in the next
834
- * tool result on failure.
835
- */
836
- readonly evaluator?: TodoEvaluatorHint;
837
- /**
838
- * FEATURE_149 v0.7.38 (Slice C4) — present-continuous form of `content`,
839
- * used by the spinner status line while this item is `in_progress`.
840
- * Mirrors Claude Code's [`Spinner.tsx:169`](c:/Works/claudecode/src/components/Spinner.tsx#L169)
841
- * `currentTodo?.activeForm` lookup. Examples:
842
- * content: "Run failing test" → activeForm: "Running failing test"
843
- * content: "Refactor auth" → activeForm: "Refactoring auth"
844
- * content: "Verify build" → activeForm: "Verifying build"
845
- *
846
- * Optional. When absent, the spinner falls back to a generic verb (no
847
- * regression vs pre-FEATURE_149 behavior). When the LLM provides
848
- * activeForm via `todo_update`, the spinner picks it up live without
849
- * waiting for the round to end — that's the user-visible "working on X
850
- * now" feel CC achieves.
851
- */
852
- readonly activeForm?: string;
853
- /**
854
- * FEATURE_170 v0.7.41 — opaque per-task metadata bag carried alongside
855
- * the item. Surface for downstream consumers (extension hooks, eval
856
- * harnesses, future swarm features) to attach arbitrary structured
857
- * context without forcing a schema change. UI does NOT render this.
858
- * Empty / undefined when the LLM does not supply it.
859
- */
860
- readonly metadata?: Record<string, unknown>;
861
- }
862
- type TodoList = readonly TodoItem[];
863
1205
  interface KodaXRepoRoutingSignals {
864
1206
  workspaceRoot?: string;
865
1207
  changedFileCount: number;
@@ -983,6 +1325,14 @@ interface KodaXChildContextBundle {
983
1325
  * preserves byte-identical v0.7.42 baseline dispatch behavior.
984
1326
  */
985
1327
  specialistName?: string;
1328
+ /**
1329
+ * FEATURE_102 Phase 2 (v0.7.45) — explicit per-dispatch provider/model the
1330
+ * dispatching agent chose for this child (e.g. a cross-family second review).
1331
+ * Priority in child-executor: `bundle.provider/model` > specialist's declared
1332
+ * model > parent default. Omitting both inherits the parent (byte-identical).
1333
+ */
1334
+ provider?: string;
1335
+ model?: string;
986
1336
  }
987
1337
  /**
988
1338
  * FEATURE_120 v0.7.39 Phase 4 — model tier hint. Tier semantics:
@@ -1302,6 +1652,49 @@ interface KodaXContextOptions {
1302
1652
  * plan-mode enforcement.
1303
1653
  */
1304
1654
  planModeBlockCheck?: (tool: string, input: Record<string, unknown>) => string | null;
1655
+ /**
1656
+ * FEATURE_123 v0.7.44 — propagate the current agent's id into the
1657
+ * spawned runtime so its tools can self-identify (and so peer
1658
+ * `send_message` calls can stamp a `from=...` framing tag + reject
1659
+ * self-targeted sends).
1660
+ */
1661
+ currentAgentId?: string;
1662
+ /**
1663
+ * FEATURE_123 v0.7.44 — propagate the dispatching agent's id (the
1664
+ * parent of the soon-to-be-spawned runtime) so `send_message(to:
1665
+ * "worker")` from a grand-child routes to its direct parent rather
1666
+ * than the top-level Worker.
1667
+ */
1668
+ parentAgentId?: string;
1669
+ /**
1670
+ * FEATURE_123 v0.7.44 — when set, the spawned runtime's
1671
+ * `ctx.childTaskRegistry` reuses this Map instead of allocating a
1672
+ * fresh one. Children pass the parent's registry through so peer
1673
+ * routing (`send_message` to a sibling task_id) finds the target.
1674
+ * Children remain unable to mutate the registry because
1675
+ * `dispatch_child_task` stays in `CHILD_EXCLUDE_TOOLS_BASE`.
1676
+ */
1677
+ inheritedChildTaskRegistry?: ChildTaskRegistry<KodaXChildExecutionResult>;
1678
+ /**
1679
+ * FEATURE_192 v0.7.44 Phase F — `/goal` runtime binding.
1680
+ *
1681
+ * When set, the runner-driven adapter:
1682
+ * 1. Wires `binding.goalContext` onto the tool-execution context
1683
+ * so the 3 goal tools (get_goal / create_goal / update_goal)
1684
+ * read + mutate live state.
1685
+ * 2. Wraps the `beforeNextTurn` hook with `withGoalBeforeNextTurn`
1686
+ * for turn-end token + wall-time accounting and budget-limit
1687
+ * transitions.
1688
+ * 3. Wraps the `stopHook` with `withGoalStopHook` so a Worker
1689
+ * text-only termination with an active goal returns a
1690
+ * continuation prompt (auto-continue on goal).
1691
+ *
1692
+ * Constructed by the REPL via `buildGoalRuntimeBinding(deps)` from
1693
+ * `packages/coding/src/goal/runtime-wiring.ts`. When undefined, the
1694
+ * tool context falls back to `makeDisabledGoalToolsContext()` and
1695
+ * the lifecycle hooks pass through unmodified.
1696
+ */
1697
+ goalRuntime?: GoalRuntimeBinding;
1305
1698
  }
1306
1699
  interface KodaXOptions {
1307
1700
  provider: string;
@@ -1657,6 +2050,56 @@ interface KodaXToolExecutionContext {
1657
2050
  readonly model?: string;
1658
2051
  readonly reasoningMode?: KodaXReasoningMode;
1659
2052
  };
2053
+ /**
2054
+ * FEATURE_123 v0.7.44 — agentId of the agent whose tool call this
2055
+ * context backs. `undefined` for the top-level Worker (main runtime
2056
+ * loop); set to the child's `bundle.id` for sub-agent runtimes.
2057
+ *
2058
+ * Consumed by `send_message` to:
2059
+ * - know who "self" is for broadcast self-exclusion and for the
2060
+ * `from=...` framing tag,
2061
+ * - reject self-targeted sends as a single-hop cycle guard.
2062
+ *
2063
+ * Wired by `child-executor.executeReadChild` / `executeWriteChild`
2064
+ * via `options.context.currentAgentId`.
2065
+ */
2066
+ currentAgentId?: string;
2067
+ /**
2068
+ * FEATURE_123 v0.7.44 — agentId of the agent that dispatched the one
2069
+ * owning this context. `undefined` for the Worker (top of the tree)
2070
+ * and for first-tier children (parent == Worker; routing uses the
2071
+ * `'worker'` sentinel rather than an agentId). Set for grand-child
2072
+ * runtimes whose parent is itself a child.
2073
+ *
2074
+ * Consumed by `send_message` when `to === 'worker'`:
2075
+ * - If `parentAgentId` is set, route to that specific id.
2076
+ * - If `parentAgentId` is undefined, route to `agentId: undefined`
2077
+ * (the main loop / top Worker).
2078
+ */
2079
+ parentAgentId?: string;
2080
+ /**
2081
+ * FEATURE_123 v0.7.44 — per-turn `send_message` flood throttle counter.
2082
+ *
2083
+ * Mutable ref that the `send_message` tool increments on every
2084
+ * outbound enqueue (broadcast counts as N — one per recipient).
2085
+ * `runner-driven.ts`' `beforeNextTurn` resets `count = 0` at every
2086
+ * turn boundary so the limit is "per LLM turn", matching the
2087
+ * design's "≤5 per child-turn / ≤20 per Worker-turn".
2088
+ *
2089
+ * The cap chosen by `send_message` is per-call:
2090
+ * - Worker (`currentAgentId === undefined`): 20 outbound enqueues
2091
+ * per turn — Worker is the coordinator + has the higher fan-out
2092
+ * budget.
2093
+ * - Child (`currentAgentId !== undefined`): 5 outbound enqueues
2094
+ * per turn — peer chatter that goes over this is almost always
2095
+ * a misfire (storm vs coordination).
2096
+ *
2097
+ * When undefined (sync-mode dispatch, no async substrate), the
2098
+ * throttle is bypassed.
2099
+ */
2100
+ sendMessageTurnCounter?: {
2101
+ count: number;
2102
+ };
1660
2103
  /**
1661
2104
  * @deprecated FEATURE_067: Removed — use reportToolProgress instead.
1662
2105
  * Previously fired onManagedTaskStatus with activeWorkerId='child',
@@ -1817,6 +2260,18 @@ interface KodaXToolExecutionContext {
1817
2260
  * it into child `runKodaX` calls).
1818
2261
  */
1819
2262
  childProgressSnapshots?: Map<string, ChildProgressSnapshot>;
2263
+ /**
2264
+ * FEATURE_192 v0.7.44 — `/goal` Persistent Goal runtime hook.
2265
+ *
2266
+ * Wired by the REPL adapter for every session with a lineage. When
2267
+ * undefined (sync-dispatch / isolated test harness), the 3 goal
2268
+ * tools (`get_goal` / `create_goal` / `update_goal`) fall back to a
2269
+ * uniform-error context (`makeDisabledGoalToolsContext`) so the
2270
+ * model gets a clear signal rather than a silent failure.
2271
+ *
2272
+ * See `packages/coding/src/goal/tools-context.ts`.
2273
+ */
2274
+ goalContext?: GoalToolsContext;
1820
2275
  }
1821
2276
 
1822
2277
  /**
@@ -2466,5 +2921,5 @@ interface CreateBashPrefixExtractorOptions {
2466
2921
  */
2467
2922
  declare function createBashPrefixExtractor(opts: CreateBashPrefixExtractorOptions): BashPrefixExtractor;
2468
2923
 
2469
- export { BASH_POLICY_SPEC as B, CONSECUTIVE_THRESHOLD as C, ERROR_THRESHOLD as E, readTrustState as a$, WINDOW_MS as aO, collectAllSignals as aP, computeRulesFingerprint as aQ, createAutoModeToolGuardrail as aR, createBashPrefixExtractor as aS, createCircuitBreaker as aT, createDenialTracker as aU, extractCommandPrefix as aV, formatAgentsForPrompt as aW, getKodaxGlobalDir as aX, loadAgentsFiles as aY, loadAutoRules as aZ, parseAutoRules as a_, recordAllow as b0, recordBlock as b1, recordError as b2, shouldFallback$1 as b3, shouldFallback as b4, trustProjectRules as b5, CUMULATIVE_THRESHOLD as n };
2470
- export type { KodaXRepoIntelligenceMode as $, AgentsFile as A, DenialTracker as D, FailureStage as F, KodaXFanoutBranchRecord as G, KodaXFanoutBranchTransition as H, KodaXFanoutSchedulerInput as I, KodaXFanoutSchedulerPlan as J, KodaXAgentMode as K, KodaXInputArtifact as L, KodaXManagedBudgetSnapshot as M, KodaXManagedProtocolPayload as N, KodaXManagedTask as O, KodaXManagedTaskRuntimeState as P, KodaXManagedTaskStatusEvent as Q, KodaXMcpConnectMode as R, KodaXMcpServerConfig as S, KodaXMcpServersConfig as T, KodaXMcpTransport as U, KodaXMemoryStrategy as V, KodaXOptions as W, KodaXOrchestrationVerdict as X, KodaXParentReductionContract as Y, KodaXProviderPolicyHints as Z, KodaXRepoIntelligenceCapability as _, AskUserMultiOptions as a, KodaXRepoIntelligenceResolvedMode as a0, KodaXRepoIntelligenceTrace as a1, KodaXRepoIntelligenceTraceEvent as a2, KodaXRepoRoutingSignals as a3, KodaXResult as a4, KodaXRoleRoundSummary as a5, KodaXRuntimeVerificationContract as a6, KodaXSessionControl as a7, KodaXSessionMutators as a8, KodaXSessionOptions as a9, RecoveryDecision as aA, RecoveryLadderStep as aB, RecoveryResult as aC, ResilienceClassification as aD, ResilienceErrorClass as aE, RulesLoadError as aF, RulesLoadResult as aG, SignalCollector as aH, SkippedRulesSource as aI, TodoItem as aJ, TodoList as aK, TodoStatus as aL, ToolCallSignal as aM, TrustState as aN, KodaXSkillInvocationContext as aa, KodaXSkillMap as ab, KodaXSkillProjectionConfidence as ac, KodaXTaskCapabilityHint as ad, KodaXTaskContract as ae, KodaXTaskEvidenceArtifact as af, KodaXTaskEvidenceBundle as ag, KodaXTaskEvidenceEntry as ah, KodaXTaskRole as ai, KodaXTaskRoleAssignment as aj, KodaXTaskStatus as ak, KodaXTaskSurface as al, KodaXTaskToolPolicy as am, KodaXTaskVerificationContract as an, KodaXTaskVerificationCriterion as ao, KodaXTaskWorkItem as ap, KodaXToolExecutionContext as aq, KodaXVerificationScorecard as ar, KodaXVerificationScorecardCriterion as as, LoadAgentsOptions as at, LoadedRulesSource as au, ProviderExecutionState as av, ProviderRecoveryEvent as aw, ProviderResilienceConfig as ax, ProviderResiliencePolicy as ay, RecoveryAction as az, AskUserQuestionItem as b, AskUserQuestionOptions as c, AutoModeAskUser as d, AutoModeAskUserVerdict as e, AutoModeEngine as f, AutoModeGuardrailConfig as g, AutoModeSharedState as h, AutoModeStats as i, AutoModeToolGuardrail as j, AutoRules as k, BashPrefixExtractor as l, BashPrefixResult as m, CircuitBreaker as o, CreateBashPrefixExtractorOptions as p, ExtensionRuntimeContract as q, ExtractCommandPrefixOptions as r, KodaXBudgetDisclosureZone as s, KodaXBudgetExtensionRequest as t, KodaXChildAgentResult as u, KodaXChildContextBundle as v, KodaXContextOptions as w, KodaXContextTokenSnapshot as x, KodaXEvents as y, KodaXFanoutBranchLifecycle as z };
2924
+ export { BASH_POLICY_SPEC as B, CONSECUTIVE_THRESHOLD as C, ERROR_THRESHOLD as E, createCircuitBreaker as a$, WINDOW_MS as aV, buildGoalRuntimeBinding as aW, collectAllSignals as aX, computeRulesFingerprint as aY, createAutoModeToolGuardrail as aZ, createBashPrefixExtractor as a_, createDenialTracker as b0, extractCommandPrefix as b1, formatAgentsForPrompt as b2, getKodaxGlobalDir as b3, loadAgentsFiles as b4, loadAutoRules as b5, makeDisabledGoalToolsContext as b6, parseAutoRules as b7, readTrustState as b8, recordAllow as b9, recordBlock as ba, recordError as bb, shouldFallback$1 as bc, shouldFallback as bd, trustProjectRules as be, withGoalBeforeNextTurn as bf, withGoalStopHook as bg, CUMULATIVE_THRESHOLD as n };
2925
+ export type { KodaXMcpTransport as $, AgentsFile as A, DenialTracker as D, FailureStage as F, GoalBlockedResult as G, KodaXChildAgentResult as H, KodaXChildContextBundle as I, KodaXContextOptions as J, KodaXAgentMode as K, KodaXContextTokenSnapshot as L, KodaXEvents as M, KodaXFanoutBranchLifecycle as N, KodaXFanoutBranchRecord as O, KodaXFanoutBranchTransition as P, KodaXFanoutSchedulerInput as Q, KodaXFanoutSchedulerPlan as R, KodaXInputArtifact as S, KodaXManagedBudgetSnapshot as T, KodaXManagedProtocolPayload as U, KodaXManagedTask as V, KodaXManagedTaskRuntimeState as W, KodaXManagedTaskStatusEvent as X, KodaXMcpConnectMode as Y, KodaXMcpServerConfig as Z, KodaXMcpServersConfig as _, AskUserMultiOptions as a, KodaXMemoryStrategy as a0, KodaXOptions as a1, KodaXOrchestrationVerdict as a2, KodaXParentReductionContract as a3, KodaXProviderPolicyHints as a4, KodaXRepoIntelligenceCapability as a5, KodaXRepoIntelligenceMode as a6, KodaXRepoIntelligenceResolvedMode as a7, KodaXRepoIntelligenceTrace as a8, KodaXRepoIntelligenceTraceEvent as a9, LoadAgentsOptions as aA, LoadedRulesSource as aB, ProviderExecutionState as aC, ProviderRecoveryEvent as aD, ProviderResilienceConfig as aE, ProviderResiliencePolicy as aF, RecoveryAction as aG, RecoveryDecision as aH, RecoveryLadderStep as aI, RecoveryResult as aJ, ResilienceClassification as aK, ResilienceErrorClass as aL, RulesLoadError as aM, RulesLoadResult as aN, SignalCollector as aO, SkippedRulesSource as aP, TodoItem as aQ, TodoList as aR, TodoStatus as aS, ToolCallSignal as aT, TrustState as aU, KodaXRepoRoutingSignals as aa, KodaXResult as ab, KodaXRoleRoundSummary as ac, KodaXRuntimeVerificationContract as ad, KodaXSessionControl as ae, KodaXSessionMutators as af, KodaXSessionOptions as ag, KodaXSkillInvocationContext as ah, KodaXSkillMap as ai, KodaXSkillProjectionConfidence as aj, KodaXTaskCapabilityHint as ak, KodaXTaskContract as al, KodaXTaskEvidenceArtifact as am, KodaXTaskEvidenceBundle as an, KodaXTaskEvidenceEntry as ao, KodaXTaskRole as ap, KodaXTaskRoleAssignment as aq, KodaXTaskStatus as ar, KodaXTaskSurface as as, KodaXTaskToolPolicy as at, KodaXTaskVerificationContract as au, KodaXTaskVerificationCriterion as av, KodaXTaskWorkItem as aw, KodaXToolExecutionContext as ax, KodaXVerificationScorecard as ay, KodaXVerificationScorecardCriterion as az, AskUserQuestionItem as b, AskUserQuestionOptions as c, AutoModeAskUser as d, AutoModeAskUserVerdict as e, AutoModeEngine as f, AutoModeGuardrailConfig as g, AutoModeSharedState as h, AutoModeStats as i, AutoModeToolGuardrail as j, AutoRules as k, BashPrefixExtractor as l, BashPrefixResult as m, CircuitBreaker as o, CreateBashPrefixExtractorOptions as p, ExtensionRuntimeContract as q, ExtractCommandPrefixOptions as r, GoalCompleteResult as s, GoalCreateInput as t, GoalLifecycleContext as u, GoalRuntimeBinding as v, GoalRuntimeBindingDeps as w, GoalToolsContext as x, KodaXBudgetDisclosureZone as y, KodaXBudgetExtensionRequest as z };