@kodax-ai/kodax 0.7.48 → 0.7.50
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 +1773 -1720
- package/README.md +91 -35
- package/README_CN.md +70 -23
- package/dist/builtin/code-review/SKILL.md +1 -1
- package/dist/chunks/argument-completer-3WX5B42G.js +2 -0
- package/dist/chunks/chunk-5UJQ2GKJ.js +574 -0
- package/dist/chunks/chunk-HR64F32V.js +2 -0
- package/dist/chunks/chunk-MFOMFMSK.js +1056 -0
- package/dist/chunks/{chunk-DEODZG6Q.js → chunk-SK4HOYT2.js} +1 -1
- package/dist/chunks/chunk-UB5IAZHF.js +476 -0
- package/dist/chunks/chunk-XZY4CIDV.js +31 -0
- package/dist/chunks/chunk-YJLRBIEW.js +301 -0
- package/dist/chunks/{compaction-config-YWCHOP2U.js → compaction-config-DDJSQ4OT.js} +1 -1
- package/dist/chunks/{construction-bootstrap-AIWATBWW.js → construction-bootstrap-4QNM2BVM.js} +1 -1
- package/dist/chunks/{dist-IDNOAB4M.js → dist-OJSNNI7P.js} +1 -1
- package/dist/chunks/dist-T256OSDI.js +2 -0
- package/dist/chunks/{utils-OG57XTPC.js → utils-JHIEOX6Z.js} +1 -1
- package/dist/index.d.ts +11 -11
- package/dist/index.js +2 -2
- package/dist/kodax_cli.js +1406 -892
- package/dist/provider-capabilities.json +193 -190
- package/dist/sdk-agent.d.ts +213 -103
- package/dist/sdk-agent.js +1 -1
- package/dist/sdk-coding.d.ts +644 -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 +36 -13
- package/dist/sdk-repl.js +2 -2
- package/dist/sdk-session.d.ts +32 -5
- 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-B0CIb0N3.d.ts} +137 -23
- package/dist/types-chunks/{file-tracker.d-D7L_SbRm.d.ts → capsule.d-CwBEm6M-.d.ts} +173 -5
- package/dist/types-chunks/{types.d-BCnbYG_A.d.ts → process.d-BbiXD24v.d.ts} +502 -4
- package/dist/types-chunks/{resolver.d-DkgJlEzr.d.ts → resolver.d-CQfaJbht.d.ts} +24 -6
- package/dist/types-chunks/{storage.d-B1Jk6ryM.d.ts → storage.d-J2GqOgaX.d.ts} +4 -1
- 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-D_-jrRku.d.ts} +44 -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-LNJNRREL.js +0 -903
- 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
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Y as KodaXToolDefinition, n as KodaXMessage, E as KodaXReasoningMode, _ as KodaXToolResultContentItem, U as KodaXThinkingBlock, H as KodaXRedactedThinkingBlock } from './types.d-
|
|
2
|
-
import { a as KodaXCompactMemorySeed, k as KodaXSessionArtifactLedgerEntry } from './types.d-
|
|
1
|
+
import { Y as KodaXToolDefinition, n as KodaXMessage, E as KodaXReasoningMode, _ as KodaXToolResultContentItem, U as KodaXThinkingBlock, H as KodaXRedactedThinkingBlock } from './types.d-rPRl2LSB.js';
|
|
2
|
+
import { a as KodaXCompactMemorySeed, k as KodaXSessionArtifactLedgerEntry } from './types.d-BnjX2Gn4.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Layer A Primitive: Agent / Handoff / Guardrail / AgentReasoningProfile
|
|
@@ -1535,6 +1535,8 @@ interface StopHookContext {
|
|
|
1535
1535
|
/** Total reanimate budget for this run (`stopHookReanimateBudget`
|
|
1536
1536
|
* or default 2). Exposed for transparency. */
|
|
1537
1537
|
readonly reanimateBudget: number;
|
|
1538
|
+
/** Caller cancellation signal, forwarded so stop hooks can cancel I/O. */
|
|
1539
|
+
readonly abortSignal?: AbortSignal;
|
|
1538
1540
|
}
|
|
1539
1541
|
/**
|
|
1540
1542
|
* FEATURE_184 (v0.7.45) — Stop hook return surface.
|
|
@@ -1882,6 +1884,124 @@ declare function setActiveUserInteraction(interaction: UserInteraction | undefin
|
|
|
1882
1884
|
/** The live user-interaction surface, or undefined when none is active. */
|
|
1883
1885
|
declare function getActiveUserInteraction(): UserInteraction | undefined;
|
|
1884
1886
|
|
|
1887
|
+
/**
|
|
1888
|
+
* @kodax-ai/agent/messaging — Message queue types
|
|
1889
|
+
*
|
|
1890
|
+
* FEATURE_115 (v0.7.36): agentId-scoped 2-tier priority queue infrastructure.
|
|
1891
|
+
*
|
|
1892
|
+
* Per ADR-021: messaging is a generic agent-platform primitive (not coding-
|
|
1893
|
+
* specific). Downstream consumers:
|
|
1894
|
+
* - @kodax-ai/coding runner-driven mid-turn drain
|
|
1895
|
+
* - @kodax-ai/repl InkREPL ESC soft-pause + text injection (FEATURE_111 absorbed)
|
|
1896
|
+
* - subagent task-notification routing (FEATURE_155 idle-yield wakeup)
|
|
1897
|
+
*
|
|
1898
|
+
* Phase 0.6 study (`c:/tmp/claude-code-actual-usage.md`): Claude Code's
|
|
1899
|
+
* `'now'` priority has zero production usage; KodaX simplifies to 2 tiers.
|
|
1900
|
+
*/
|
|
1901
|
+
type MessagePriority = 'user' | 'background';
|
|
1902
|
+
type MessageMode = 'prompt' | 'task-notification' | 'system-reminder';
|
|
1903
|
+
interface QueuedMessage {
|
|
1904
|
+
/** Stable id for tracing / dedup. Format: `msg-<sequence>`. */
|
|
1905
|
+
readonly id: string;
|
|
1906
|
+
readonly priority: MessagePriority;
|
|
1907
|
+
/**
|
|
1908
|
+
* Routing key:
|
|
1909
|
+
* undefined = main thread / coordinator agent
|
|
1910
|
+
* 'agent-id-XYZ' = subagent / specific consumer
|
|
1911
|
+
*
|
|
1912
|
+
* Drain consumers MUST filter by agentId match — undefined matches only
|
|
1913
|
+
* undefined-agentId messages, not "any agent".
|
|
1914
|
+
*/
|
|
1915
|
+
readonly agentId?: string;
|
|
1916
|
+
readonly mode: MessageMode;
|
|
1917
|
+
readonly content: string;
|
|
1918
|
+
/** Wall-clock timestamp (`Date.now()`) for tracing only — not used for ordering. */
|
|
1919
|
+
readonly enqueuedAt: number;
|
|
1920
|
+
}
|
|
1921
|
+
interface DequeueFilter {
|
|
1922
|
+
/**
|
|
1923
|
+
* Only return messages with this agentId.
|
|
1924
|
+
* undefined matches messages with no agentId (main-thread messages only).
|
|
1925
|
+
*/
|
|
1926
|
+
readonly agentId?: string;
|
|
1927
|
+
/**
|
|
1928
|
+
* Highest priority level included in the drain.
|
|
1929
|
+
* 'user' → only user priority drained, background stays queued
|
|
1930
|
+
* 'background' → both user + background drained (Sleep-gated case)
|
|
1931
|
+
*/
|
|
1932
|
+
readonly maxPriority: MessagePriority;
|
|
1933
|
+
/**
|
|
1934
|
+
* Optional cap on number of messages drained in this call.
|
|
1935
|
+
* Defaults to unlimited (drains all matching).
|
|
1936
|
+
*/
|
|
1937
|
+
readonly limit?: number;
|
|
1938
|
+
/**
|
|
1939
|
+
* FEATURE_159 (v0.7.40) — optional mode filter. Lets REPL split the
|
|
1940
|
+
* single queue into mode-typed views (e.g. `mode:'prompt'` for user
|
|
1941
|
+
* input vs `mode:'task-notification'` for child completion banners)
|
|
1942
|
+
* without separate queues. When omitted, all modes match.
|
|
1943
|
+
*/
|
|
1944
|
+
readonly mode?: MessageMode;
|
|
1945
|
+
/**
|
|
1946
|
+
* FEATURE_159 (v0.7.40) — optional precise-id filter. Single-message
|
|
1947
|
+
* targeted removal — drives Esc-pop-this-uuid in REPL. When set, all
|
|
1948
|
+
* other filters still apply (agentId / priority / mode mismatches still
|
|
1949
|
+
* skip the message), so callers can't accidentally remove a message
|
|
1950
|
+
* outside their scope.
|
|
1951
|
+
*/
|
|
1952
|
+
readonly id?: string;
|
|
1953
|
+
/**
|
|
1954
|
+
* FEATURE_159 (v0.7.40) — optional escape-hatch predicate, AND-ed with
|
|
1955
|
+
* the structured filters. Lets SDK consumers express conditions the
|
|
1956
|
+
* typed fields don't cover (e.g. timestamp ranges, content-match) without
|
|
1957
|
+
* forcing every new use case to extend `DequeueFilter`. KodaX-internal
|
|
1958
|
+
* code should prefer the typed fields for readability; this is the
|
|
1959
|
+
* "data-driven main path + predicate escape" pattern.
|
|
1960
|
+
*
|
|
1961
|
+
* Evaluated AFTER the typed filters succeed — so a `predicate` that
|
|
1962
|
+
* inspects `message.content` never runs on messages outside the
|
|
1963
|
+
* caller's `agentId` / `mode` / `id` scope.
|
|
1964
|
+
*/
|
|
1965
|
+
readonly predicate?: (message: QueuedMessage) => boolean;
|
|
1966
|
+
}
|
|
1967
|
+
/**
|
|
1968
|
+
* FEATURE_159 (v0.7.40) — structured queue event emitted to subscribers.
|
|
1969
|
+
*
|
|
1970
|
+
* Replaces the prior `() => void` bare-notify signal. Carries the kind +
|
|
1971
|
+
* affected messages so SDK observability consumers (logging, tracing,
|
|
1972
|
+
* metrics) can react per-event without re-diffing snapshots.
|
|
1973
|
+
*
|
|
1974
|
+
* Event granularity rules:
|
|
1975
|
+
* - `enqueued` fires ONCE per `enqueue()` call (always 1 message).
|
|
1976
|
+
* - `dequeued` fires ONCE per `dequeue()` call that removed ≥1 message,
|
|
1977
|
+
* carrying ALL drained messages in priority+FIFO order. No-op drains
|
|
1978
|
+
* (filter matched nothing) fire no event — quiet by design so the
|
|
1979
|
+
* `waitForWakeEvent` 100ms poll doesn't spam idle subscribers.
|
|
1980
|
+
* - `cleared` fires ONCE per `clear()` call that removed ≥1 message,
|
|
1981
|
+
* carrying the pre-clear messages. Empty-queue clear fires nothing.
|
|
1982
|
+
*
|
|
1983
|
+
* The `useSyncExternalStore` React hook ignores the event payload (it
|
|
1984
|
+
* only needs the change signal); SDK / tracer consumers read the event.
|
|
1985
|
+
*/
|
|
1986
|
+
type QueueEvent = {
|
|
1987
|
+
readonly kind: 'enqueued';
|
|
1988
|
+
readonly message: QueuedMessage;
|
|
1989
|
+
} | {
|
|
1990
|
+
readonly kind: 'dequeued';
|
|
1991
|
+
readonly messages: readonly QueuedMessage[];
|
|
1992
|
+
} | {
|
|
1993
|
+
readonly kind: 'cleared';
|
|
1994
|
+
readonly messages: readonly QueuedMessage[];
|
|
1995
|
+
};
|
|
1996
|
+
/** FEATURE_159 — `MessageQueue.subscribe` listener signature. */
|
|
1997
|
+
type QueueEventListener = (event: QueueEvent) => void;
|
|
1998
|
+
interface EnqueueInput {
|
|
1999
|
+
readonly priority: MessagePriority;
|
|
2000
|
+
readonly mode: MessageMode;
|
|
2001
|
+
readonly content: string;
|
|
2002
|
+
readonly agentId?: string;
|
|
2003
|
+
}
|
|
2004
|
+
|
|
1885
2005
|
/**
|
|
1886
2006
|
* Child task registry primitive — generic fan-out tracking.
|
|
1887
2007
|
*
|
|
@@ -2339,5 +2459,383 @@ interface FileOperations {
|
|
|
2339
2459
|
modifiedFiles: string[];
|
|
2340
2460
|
}
|
|
2341
2461
|
|
|
2342
|
-
|
|
2343
|
-
|
|
2462
|
+
/**
|
|
2463
|
+
* FEATURE_217 (v0.7.49) — Workflow run-graph events.
|
|
2464
|
+
*
|
|
2465
|
+
* Append-only event stream for a workflow run. Each event carries a
|
|
2466
|
+
* monotonic `seq` so ordering is stable and verifiable regardless of
|
|
2467
|
+
* wall-clock (the durable writer in Phase D adds timestamps via an
|
|
2468
|
+
* injected clock). The run graph models agent relationships as a
|
|
2469
|
+
* thread/edge/event stream, not just a final summary blob.
|
|
2470
|
+
*/
|
|
2471
|
+
type WorkflowEventType = 'workflow_started' | 'phase_started' | 'phase_finished' | 'agent_spawned' | 'agent_message_sent' | 'agent_completed' | 'agent_summary_updated' | 'agent_stopped' | 'workflow_log' | 'artifact_written' | 'synthesis_completed' | 'workflow_completed' | 'workflow_stopped' | 'workflow_failed';
|
|
2472
|
+
interface WorkflowEvent {
|
|
2473
|
+
/** Monotonic sequence number — stable append ordering. */
|
|
2474
|
+
readonly seq: number;
|
|
2475
|
+
readonly type: WorkflowEventType;
|
|
2476
|
+
/** Structured payload (agent name/id, phase name, error message, …). */
|
|
2477
|
+
readonly data?: Record<string, unknown>;
|
|
2478
|
+
}
|
|
2479
|
+
/**
|
|
2480
|
+
* Append-only event recorder. Assigns sequential `seq` and fans each
|
|
2481
|
+
* event out to an optional sink (the durable JSONL writer / UI consumer
|
|
2482
|
+
* subscribes here in Phase D).
|
|
2483
|
+
*/
|
|
2484
|
+
declare class WorkflowEventRecorder {
|
|
2485
|
+
private readonly sink?;
|
|
2486
|
+
private seq;
|
|
2487
|
+
private readonly events;
|
|
2488
|
+
constructor(sink?: ((event: WorkflowEvent) => void) | undefined);
|
|
2489
|
+
/** Append an event, returning the materialized record. */
|
|
2490
|
+
emit(type: WorkflowEventType, data?: Record<string, unknown>): WorkflowEvent;
|
|
2491
|
+
/** Immutable snapshot of all events emitted so far. */
|
|
2492
|
+
snapshot(): readonly WorkflowEvent[];
|
|
2493
|
+
}
|
|
2494
|
+
|
|
2495
|
+
/**
|
|
2496
|
+
* FEATURE_217 (v0.7.49) — Dynamic Workflow Harness Runtime: public types.
|
|
2497
|
+
*
|
|
2498
|
+
* Domain-neutral workflow orchestration surface. A workflow *script*
|
|
2499
|
+
* coordinates (decompose / fan-out / loop / wait / stop / verify /
|
|
2500
|
+
* synthesize); it never touches files or shell directly. The actual
|
|
2501
|
+
* agent execution is delegated to an injected `WorkflowAgentBackend`
|
|
2502
|
+
* (the coding layer provides the real one in Phase B; tests inject a
|
|
2503
|
+
* fake). This keeps `@kodax-ai/agent` free of any `@kodax-ai/coding`
|
|
2504
|
+
* dependency (ADR-021 layer independence).
|
|
2505
|
+
*/
|
|
2506
|
+
/** Lifecycle status of a single workflow-spawned agent. */
|
|
2507
|
+
type WorkflowTaskStatus = 'running' | 'completed' | 'failed' | 'stopped';
|
|
2508
|
+
/** Routing hint for which provider/model tier the child should use. */
|
|
2509
|
+
type WorkflowModelHint = 'fast' | 'balanced' | 'deep';
|
|
2510
|
+
/** Isolation policy for a spawned agent. `shared-cwd` is the default
|
|
2511
|
+
* (FEATURE_188); `worktree` is opt-in for high-risk parallel writes. */
|
|
2512
|
+
type WorkflowIsolation = 'shared-cwd' | 'worktree';
|
|
2513
|
+
interface WorkflowSpawnAgentInput {
|
|
2514
|
+
/** Human-readable label for the agent — surfaces in events / UI. */
|
|
2515
|
+
readonly name: string;
|
|
2516
|
+
/** The task prompt handed to the child agent. */
|
|
2517
|
+
readonly prompt: string;
|
|
2518
|
+
/** When true, the child runs with a read-only tool whitelist. */
|
|
2519
|
+
readonly readOnly?: boolean;
|
|
2520
|
+
/** Route to a registered specialist agent (FEATURE_191). */
|
|
2521
|
+
readonly subagentType?: string;
|
|
2522
|
+
/** Provider/model tier hint (FEATURE_120 model_hint → env tier). */
|
|
2523
|
+
readonly modelHint?: WorkflowModelHint;
|
|
2524
|
+
/** Isolation policy; defaults to `shared-cwd`. */
|
|
2525
|
+
readonly isolation?: WorkflowIsolation;
|
|
2526
|
+
/** Evidence refs (`task_id:<id>` etc.) seeded into the child context. */
|
|
2527
|
+
readonly evidenceRefs?: readonly string[];
|
|
2528
|
+
}
|
|
2529
|
+
/** Returned by `spawnAgent` — the child is in-flight, not yet complete. */
|
|
2530
|
+
interface WorkflowTaskHandle {
|
|
2531
|
+
readonly taskId: string;
|
|
2532
|
+
readonly name: string;
|
|
2533
|
+
}
|
|
2534
|
+
interface WorkflowTaskUsage {
|
|
2535
|
+
readonly inputTokens?: number;
|
|
2536
|
+
readonly outputTokens?: number;
|
|
2537
|
+
readonly totalTokens?: number;
|
|
2538
|
+
}
|
|
2539
|
+
type WorkflowTaskSummaryKind = 'digest' | 'excerpt' | 'digest-failed' | 'pending';
|
|
2540
|
+
interface WorkflowTaskSummaryEventUpdate {
|
|
2541
|
+
readonly summary?: string;
|
|
2542
|
+
readonly summaryKind: WorkflowTaskSummaryKind;
|
|
2543
|
+
readonly usage?: WorkflowTaskUsage;
|
|
2544
|
+
}
|
|
2545
|
+
/** Terminal result of a spawned agent (from `wait` / `runAgent`). */
|
|
2546
|
+
interface WorkflowTaskResult {
|
|
2547
|
+
readonly taskId: string;
|
|
2548
|
+
readonly name: string;
|
|
2549
|
+
readonly status: WorkflowTaskStatus;
|
|
2550
|
+
readonly finalText: string;
|
|
2551
|
+
/** Short user-facing digest, separate from the full finalText used for synthesis/audit. */
|
|
2552
|
+
readonly digest?: string;
|
|
2553
|
+
/** True when a digest was attempted but failed (error/timeout/empty); the UI then labels the excerpt fallback. */
|
|
2554
|
+
readonly digestFailed?: boolean;
|
|
2555
|
+
/** True when a digest was scheduled asynchronously and may arrive via `agent_summary_updated`. */
|
|
2556
|
+
readonly digestPending?: boolean;
|
|
2557
|
+
/** Best-known provider/model used by the child, for host correlation only. */
|
|
2558
|
+
readonly provider?: string;
|
|
2559
|
+
readonly model?: string;
|
|
2560
|
+
readonly usage?: WorkflowTaskUsage;
|
|
2561
|
+
}
|
|
2562
|
+
/** Point-in-time snapshot of a (possibly still-running) agent. */
|
|
2563
|
+
interface WorkflowTaskSnapshot {
|
|
2564
|
+
readonly taskId: string;
|
|
2565
|
+
readonly name: string;
|
|
2566
|
+
readonly status: WorkflowTaskStatus;
|
|
2567
|
+
readonly lastText?: string;
|
|
2568
|
+
}
|
|
2569
|
+
interface WorkflowWaitOptions {
|
|
2570
|
+
readonly timeoutMs?: number;
|
|
2571
|
+
}
|
|
2572
|
+
interface WorkflowParallelOptions {
|
|
2573
|
+
/** In-flight cap for this parallel block; clamped by workflow
|
|
2574
|
+
* maxConcurrency. */
|
|
2575
|
+
readonly concurrency?: number;
|
|
2576
|
+
}
|
|
2577
|
+
interface WorkflowSynthesizeInput {
|
|
2578
|
+
readonly inputs: readonly unknown[] | string | Record<string, unknown>;
|
|
2579
|
+
readonly rubric: string;
|
|
2580
|
+
}
|
|
2581
|
+
interface WorkflowSynthesis {
|
|
2582
|
+
readonly text: string;
|
|
2583
|
+
}
|
|
2584
|
+
interface WorkflowArtifactRef {
|
|
2585
|
+
readonly name: string;
|
|
2586
|
+
readonly path?: string;
|
|
2587
|
+
}
|
|
2588
|
+
interface WorkflowLogEvent {
|
|
2589
|
+
readonly message: string;
|
|
2590
|
+
readonly data?: unknown;
|
|
2591
|
+
}
|
|
2592
|
+
/**
|
|
2593
|
+
* Token budget accounting. The runtime hard-stops before launching a new
|
|
2594
|
+
* agent once completed children have exhausted the configured budget.
|
|
2595
|
+
*/
|
|
2596
|
+
interface WorkflowBudget {
|
|
2597
|
+
/** Configured token budget, or null when unbounded. */
|
|
2598
|
+
readonly total: number | null;
|
|
2599
|
+
/** Tokens accounted across completed agents so far. */
|
|
2600
|
+
spent(): number;
|
|
2601
|
+
/** `max(0, total - spent())`, or Infinity when unbounded. */
|
|
2602
|
+
remaining(): number;
|
|
2603
|
+
}
|
|
2604
|
+
interface WorkflowLimits {
|
|
2605
|
+
/** Total agents spawnable across the whole run lifetime. */
|
|
2606
|
+
readonly maxAgents?: number;
|
|
2607
|
+
/** Maximum simultaneously in-flight agents (via runAgent / parallel). */
|
|
2608
|
+
readonly maxConcurrency?: number;
|
|
2609
|
+
/** Token budget. New spawns stop once completed usage exhausts it. */
|
|
2610
|
+
readonly tokenBudget?: number;
|
|
2611
|
+
}
|
|
2612
|
+
/**
|
|
2613
|
+
* The surface a workflow script consumes. The script never gets raw
|
|
2614
|
+
* fs/shell — all effects route through agent tools behind the backend.
|
|
2615
|
+
*/
|
|
2616
|
+
interface WorkflowApi {
|
|
2617
|
+
readonly runId: string;
|
|
2618
|
+
readonly args: unknown;
|
|
2619
|
+
readonly budget: WorkflowBudget;
|
|
2620
|
+
/** Group operations under a named phase (emits phase_started/finished). */
|
|
2621
|
+
phase<T>(name: string, fn: () => Promise<T>): Promise<T>;
|
|
2622
|
+
/** Start a child agent; returns immediately with a handle. */
|
|
2623
|
+
spawnAgent(input: WorkflowSpawnAgentInput): Promise<WorkflowTaskHandle>;
|
|
2624
|
+
/** spawnAgent + wait convenience; returns the terminal result. */
|
|
2625
|
+
runAgent(input: WorkflowSpawnAgentInput): Promise<WorkflowTaskResult>;
|
|
2626
|
+
/** Await a spawned agent's terminal result. */
|
|
2627
|
+
wait(taskId: string, opts?: WorkflowWaitOptions): Promise<WorkflowTaskResult>;
|
|
2628
|
+
/** Snapshot a (possibly running) agent. */
|
|
2629
|
+
snapshot(taskId: string): Promise<WorkflowTaskSnapshot>;
|
|
2630
|
+
/** Snapshot a (possibly running) agent.
|
|
2631
|
+
* @deprecated Prefer `snapshot(taskId)`; `output` is kept as a compatibility alias. */
|
|
2632
|
+
output(taskId: string): Promise<WorkflowTaskSnapshot>;
|
|
2633
|
+
/** Send a message to a running agent (via MessageQueue routing). */
|
|
2634
|
+
send(taskId: string, content: string): Promise<void>;
|
|
2635
|
+
/** Stop a running agent (graceful abort). */
|
|
2636
|
+
stop(taskId: string, reason: string): Promise<void>;
|
|
2637
|
+
/** Run lazy thunks concurrently under the concurrency gate. Thunks
|
|
2638
|
+
* MUST be `() => Promise<T>` (not already-started promises) so the
|
|
2639
|
+
* runtime can bound concurrency. */
|
|
2640
|
+
parallel<T>(items: readonly (() => Promise<T>)[], opts?: WorkflowParallelOptions): Promise<T[]>;
|
|
2641
|
+
/** Synthesize across inputs. Runs as a gated agent through the runtime
|
|
2642
|
+
* (spawn → wait), so it counts toward maxAgents / concurrency / budget
|
|
2643
|
+
* and emits run-graph events — it is NOT a backend side-channel. */
|
|
2644
|
+
synthesize(input: WorkflowSynthesizeInput): Promise<WorkflowSynthesis>;
|
|
2645
|
+
/** Persist a named artifact. */
|
|
2646
|
+
artifact(name: string, value: unknown): Promise<WorkflowArtifactRef>;
|
|
2647
|
+
/** Emit a free-text progress log event. */
|
|
2648
|
+
log(event: WorkflowLogEvent): void;
|
|
2649
|
+
}
|
|
2650
|
+
/** Metadata a workflow declares (name, description, default caps). */
|
|
2651
|
+
interface WorkflowMeta {
|
|
2652
|
+
readonly name: string;
|
|
2653
|
+
readonly description: string;
|
|
2654
|
+
/** Best-effort expected child-agent count for progress UI; not a hard cap. */
|
|
2655
|
+
readonly plannedAgents?: number;
|
|
2656
|
+
readonly maxAgents?: number;
|
|
2657
|
+
readonly maxConcurrency?: number;
|
|
2658
|
+
readonly tokenBudget?: number;
|
|
2659
|
+
/** True when the workflow only ever spawns read-only agents (no file
|
|
2660
|
+
* writes) — surfaced in the approval prompt. */
|
|
2661
|
+
readonly readOnly?: boolean;
|
|
2662
|
+
/** Declared phase names, for the approval prompt preview. */
|
|
2663
|
+
readonly phases?: readonly string[];
|
|
2664
|
+
}
|
|
2665
|
+
/** Summary shown to the user before a workflow's first run. */
|
|
2666
|
+
interface WorkflowApprovalSummary {
|
|
2667
|
+
readonly name: string;
|
|
2668
|
+
readonly description: string;
|
|
2669
|
+
readonly phases: readonly string[];
|
|
2670
|
+
readonly plannedAgents?: number;
|
|
2671
|
+
readonly maxAgents: number | null;
|
|
2672
|
+
readonly maxConcurrency: number | null;
|
|
2673
|
+
readonly tokenBudget: number | null;
|
|
2674
|
+
/** Whether the workflow may write files (false for read-only workflows). */
|
|
2675
|
+
readonly writesFiles: boolean;
|
|
2676
|
+
}
|
|
2677
|
+
/** Approval gate — returns true to proceed, false to cancel the run. */
|
|
2678
|
+
type WorkflowApproval = (summary: WorkflowApprovalSummary) => boolean | Promise<boolean>;
|
|
2679
|
+
/** A workflow's entry function: coordinates agents via the `WorkflowApi`. */
|
|
2680
|
+
type WorkflowRun<TArgs = unknown, TResult = unknown> = (wf: WorkflowApi, args: TArgs) => Promise<TResult>;
|
|
2681
|
+
/** A self-contained workflow: metadata + entry function. Built-in
|
|
2682
|
+
* workflows (Phase C) and saved `.kodax/workflows/*.ts` (Phase E) both
|
|
2683
|
+
* materialize to this shape. */
|
|
2684
|
+
interface WorkflowModule<TArgs = unknown, TResult = unknown> {
|
|
2685
|
+
readonly meta: WorkflowMeta;
|
|
2686
|
+
readonly run: WorkflowRun<TArgs, TResult>;
|
|
2687
|
+
}
|
|
2688
|
+
/**
|
|
2689
|
+
* Injected execution backend. The coding layer implements this over its
|
|
2690
|
+
* child-dispatch substrate (ChildTaskRegistry / childProgressSnapshots /
|
|
2691
|
+
* MessageQueue / executeChildAgents); tests inject a fake. The agent
|
|
2692
|
+
* runtime depends ONLY on this interface — never on coding.
|
|
2693
|
+
*/
|
|
2694
|
+
interface WorkflowAgentBackend {
|
|
2695
|
+
spawn(input: WorkflowSpawnAgentInput): Promise<WorkflowTaskHandle>;
|
|
2696
|
+
wait(taskId: string, opts?: WorkflowWaitOptions): Promise<WorkflowTaskResult>;
|
|
2697
|
+
output(taskId: string): Promise<WorkflowTaskSnapshot>;
|
|
2698
|
+
send(taskId: string, content: string): Promise<void>;
|
|
2699
|
+
stop(taskId: string, reason: string): Promise<void>;
|
|
2700
|
+
/** Optional late summary stream for presentation-only async digests. */
|
|
2701
|
+
subscribeTaskSummaryUpdates?(listener: (taskId: string, update: WorkflowTaskSummaryEventUpdate) => void): () => void;
|
|
2702
|
+
/** Optional durable artifact writer (Phase D wires the run graph).
|
|
2703
|
+
* `wf.synthesize` is NOT a backend method — it runs as a gated agent
|
|
2704
|
+
* through `spawn`/`wait` so it counts toward the runtime's caps. */
|
|
2705
|
+
writeArtifact?(name: string, value: unknown): Promise<WorkflowArtifactRef>;
|
|
2706
|
+
}
|
|
2707
|
+
type WorkflowRunStatus = 'running' | 'completed' | 'failed' | 'stopped';
|
|
2708
|
+
/** Immutable snapshot of a workflow run's accumulated state. */
|
|
2709
|
+
interface WorkflowRunState {
|
|
2710
|
+
readonly runId: string;
|
|
2711
|
+
readonly status: WorkflowRunStatus;
|
|
2712
|
+
readonly totalSpawned: number;
|
|
2713
|
+
readonly events: readonly WorkflowEvent[];
|
|
2714
|
+
readonly artifacts: readonly WorkflowArtifactRef[];
|
|
2715
|
+
}
|
|
2716
|
+
|
|
2717
|
+
type WorkflowProcessStatus = 'running' | 'paused' | 'completed' | 'failed' | 'cancelled';
|
|
2718
|
+
type WorkflowProcessItemStatus = 'pending' | 'running' | 'completed' | 'failed' | 'cancelled' | 'skipped';
|
|
2719
|
+
type WorkflowProcessItemKind = 'phase' | 'agent' | 'step' | 'artifact';
|
|
2720
|
+
type WorkflowProcessSummaryStatus = 'pending' | 'result' | 'notice' | 'unavailable';
|
|
2721
|
+
type WorkflowProcessSource = 'command' | 'amaw' | 'review' | 'sdk' | 'capsule' | 'extension' | 'automation';
|
|
2722
|
+
interface WorkflowProcessItem {
|
|
2723
|
+
readonly id: string;
|
|
2724
|
+
readonly title: string;
|
|
2725
|
+
readonly kind: WorkflowProcessItemKind;
|
|
2726
|
+
readonly status: WorkflowProcessItemStatus;
|
|
2727
|
+
readonly phaseId?: string;
|
|
2728
|
+
readonly parentId?: string;
|
|
2729
|
+
readonly agentId?: string;
|
|
2730
|
+
readonly childAgentId?: string;
|
|
2731
|
+
readonly provider?: string;
|
|
2732
|
+
readonly model?: string;
|
|
2733
|
+
readonly startedAt?: string;
|
|
2734
|
+
readonly endedAt?: string;
|
|
2735
|
+
readonly summary?: string;
|
|
2736
|
+
readonly summaryStatus?: WorkflowProcessSummaryStatus;
|
|
2737
|
+
readonly error?: string;
|
|
2738
|
+
}
|
|
2739
|
+
interface WorkflowEventCorrelation {
|
|
2740
|
+
readonly workflowRunId: string;
|
|
2741
|
+
readonly childAgentId?: string;
|
|
2742
|
+
readonly phaseId?: string;
|
|
2743
|
+
readonly itemId?: string;
|
|
2744
|
+
}
|
|
2745
|
+
interface WorkflowProcessCounts {
|
|
2746
|
+
readonly pending: number;
|
|
2747
|
+
readonly running: number;
|
|
2748
|
+
readonly completed: number;
|
|
2749
|
+
readonly failed: number;
|
|
2750
|
+
readonly cancelled: number;
|
|
2751
|
+
readonly skipped: number;
|
|
2752
|
+
}
|
|
2753
|
+
interface WorkflowProcessProgress {
|
|
2754
|
+
readonly spawnedAgents: number;
|
|
2755
|
+
readonly finishedAgents: number;
|
|
2756
|
+
readonly activeAgents: number;
|
|
2757
|
+
readonly failedAgents: number;
|
|
2758
|
+
readonly stoppedAgents: number;
|
|
2759
|
+
readonly agentCap?: number;
|
|
2760
|
+
readonly plannedItems?: number;
|
|
2761
|
+
}
|
|
2762
|
+
interface WorkflowProcessTokenUsage {
|
|
2763
|
+
readonly spent: number;
|
|
2764
|
+
readonly total?: number;
|
|
2765
|
+
}
|
|
2766
|
+
interface WorkflowProcessArtifact {
|
|
2767
|
+
readonly name: string;
|
|
2768
|
+
readonly path?: string;
|
|
2769
|
+
readonly description?: string;
|
|
2770
|
+
}
|
|
2771
|
+
interface WorkflowProcessSnapshot {
|
|
2772
|
+
readonly runId: string;
|
|
2773
|
+
readonly workflowName: string;
|
|
2774
|
+
readonly displayName?: string;
|
|
2775
|
+
readonly status: WorkflowProcessStatus;
|
|
2776
|
+
readonly startedAt: string;
|
|
2777
|
+
readonly updatedAt: string;
|
|
2778
|
+
readonly elapsedMs?: number;
|
|
2779
|
+
readonly goal?: string;
|
|
2780
|
+
readonly source?: WorkflowProcessSource;
|
|
2781
|
+
readonly savedWorkflowName?: string;
|
|
2782
|
+
readonly sourceRunId?: string;
|
|
2783
|
+
readonly sourceWorkflowName?: string;
|
|
2784
|
+
readonly revisionOf?: string;
|
|
2785
|
+
readonly activePhaseId?: string;
|
|
2786
|
+
readonly activePhaseIndex?: number;
|
|
2787
|
+
readonly phaseCount?: number;
|
|
2788
|
+
readonly items: readonly WorkflowProcessItem[];
|
|
2789
|
+
readonly counts: WorkflowProcessCounts;
|
|
2790
|
+
readonly progress: WorkflowProcessProgress;
|
|
2791
|
+
readonly tokens?: WorkflowProcessTokenUsage;
|
|
2792
|
+
readonly latestMessage?: string;
|
|
2793
|
+
readonly resultSummary?: string;
|
|
2794
|
+
readonly error?: string;
|
|
2795
|
+
readonly artifacts?: readonly WorkflowProcessArtifact[];
|
|
2796
|
+
}
|
|
2797
|
+
type WorkflowProcessEvent = {
|
|
2798
|
+
readonly type: 'workflow_started';
|
|
2799
|
+
readonly snapshot: WorkflowProcessSnapshot;
|
|
2800
|
+
} | {
|
|
2801
|
+
readonly type: 'workflow_updated';
|
|
2802
|
+
readonly snapshot: WorkflowProcessSnapshot;
|
|
2803
|
+
readonly message?: string;
|
|
2804
|
+
} | {
|
|
2805
|
+
readonly type: 'workflow_finished';
|
|
2806
|
+
readonly snapshot: WorkflowProcessSnapshot;
|
|
2807
|
+
};
|
|
2808
|
+
interface WorkflowProcessTrackerOptions {
|
|
2809
|
+
readonly runId: string;
|
|
2810
|
+
readonly workflowName: string;
|
|
2811
|
+
readonly displayName?: string;
|
|
2812
|
+
readonly goal?: string;
|
|
2813
|
+
readonly source?: WorkflowProcessSource;
|
|
2814
|
+
readonly savedWorkflowName?: string;
|
|
2815
|
+
readonly sourceRunId?: string;
|
|
2816
|
+
readonly sourceWorkflowName?: string;
|
|
2817
|
+
readonly revisionOf?: string;
|
|
2818
|
+
readonly phases?: readonly string[];
|
|
2819
|
+
readonly maxAgents?: number;
|
|
2820
|
+
readonly plannedAgents?: number;
|
|
2821
|
+
readonly tokenBudget?: number;
|
|
2822
|
+
readonly resultSummary?: string;
|
|
2823
|
+
readonly artifacts?: readonly WorkflowArtifactRef[];
|
|
2824
|
+
readonly now?: () => string;
|
|
2825
|
+
}
|
|
2826
|
+
interface WorkflowTaskSummaryUpdate {
|
|
2827
|
+
readonly summary?: string;
|
|
2828
|
+
readonly summaryStatus: WorkflowProcessSummaryStatus;
|
|
2829
|
+
}
|
|
2830
|
+
interface WorkflowProcessTracker {
|
|
2831
|
+
applyEvent(event: WorkflowEvent): WorkflowProcessEvent;
|
|
2832
|
+
updateTaskSummary(taskId: string, update: WorkflowTaskSummaryUpdate): WorkflowProcessEvent | undefined;
|
|
2833
|
+
setStatus(status: WorkflowProcessStatus, message?: string): WorkflowProcessEvent;
|
|
2834
|
+
setResultSummary(resultSummary: string | undefined): WorkflowProcessEvent;
|
|
2835
|
+
getSnapshot(): WorkflowProcessSnapshot;
|
|
2836
|
+
}
|
|
2837
|
+
declare function isFinalWorkflowProcessStatus(status: WorkflowProcessStatus): boolean;
|
|
2838
|
+
declare function createWorkflowProcessTracker(options: WorkflowProcessTrackerOptions): WorkflowProcessTracker;
|
|
2839
|
+
|
|
2840
|
+
export { DEFAULT_SYSTEM_CAP as D, GuardrailBlockedError as H, GuardrailEscalateError as J, InvariantSession as T, MAX_TOOL_LOOP_ITERATIONS as U, Tracer as aR, Runner as af, SpanImpl as ax, requestTaskStop as b$, WorkflowEventRecorder as b0, _resetAdmittedAgentBindings as bC, _resetPresetDispatchers as bD, buildAssistantMessageFromLlmResult as bE, buildSystemPrompt as bF, buildToolResultMessage as bG, collectGuardrails as bH, createAgent as bI, createHandoff as bJ, createInMemorySession as bK, createInvariantSessionForAgent as bL, createStateWriter as bM, createTrace as bN, createWorkflowProcessTracker as bO, defaultTracer as bP, detectInstructionsInjection as bQ, discoverInstances as bR, executeRunnerToolCall as bS, extractAssistantTextFromMessage as bT, getActiveUserInteraction as bU, getAdmittedAgentBindings as bV, isFinalWorkflowProcessStatus as bW, isRunnableTool as bX, isRunnerLlmResult as bY, registerChildTask as bZ, registerPresetDispatcher as b_, runAdmissionAudit as c0, runInputGuardrails as c1, runOutputGuardrails as c2, runToolAfterGuardrails as c3, runToolBeforeGuardrails as c4, setActiveUserInteraction as c5, setAdmittedAgentBindings as c6 };
|
|
2841
|
+
export type { PersistedSessionState as $, AdmissionAuditOptions as A, Guardrail as B, ChildTaskRegistry as C, EnqueueInput as E, FanoutSpanData as F, GenerationSpanData as G, GuardrailContext as I, GuardrailSpanData as K, GuardrailVerdict as L, Handoff as M, HandoffSpanData as N, InMemorySessionOptions as O, InputGuardrail as P, InstanceDiscoveryFs as Q, InvariantId as R, InvariantResult as S, ManifestPatch as V, MessageEntry as W, MessageMode as X, MessagePriority as Y, ObserveCtx as Z, OutputGuardrail as _, AdmissionCtx as a, WorkflowEventCorrelation as a$, PresetDispatcher as a0, PresetTracingContext as a1, QualityInvariant as a2, QueueEventListener as a3, QueuedMessage as a4, ReadonlyMutationTracker as a5, ReadonlyRecorder as a6, ReasoningDepth as a7, RecentlyModifiedFile as a8, RequestTaskStopOptions as a9, StateWriter as aA, StateWriterFs as aB, StateWriterOptions as aC, StopHookContext as aD, StopHookFn as aE, StopHookResult as aF, StopHookSpanData as aG, SystemCap as aH, TaskAbortRegistry as aI, TerminalCtx as aJ, ToolBeforeOutcome as aK, ToolCallSpanData as aL, ToolCapability as aM, ToolGuardrail as aN, ToolPermission as aO, Trace as aP, TraceOptions as aQ, TracerOptions as aS, UserInteraction as aT, WorkflowAgentBackend as aU, WorkflowApi as aV, WorkflowApproval as aW, WorkflowApprovalSummary as aX, WorkflowArtifactRef as aY, WorkflowBudget as aZ, WorkflowEvent as a_, RequestTaskStopResult as aa, RunEvent as ab, RunOptions as ac, RunResult as ad, RunnableTool as ae, RunnerEvent as ag, RunnerLlmResult as ah, RunnerLlmReturn as ai, RunnerToolCall as aj, RunnerToolContext as ak, RunnerToolObserver as al, RunnerToolResult as am, Session as an, SessionDispatchResult as ao, SessionEntry as ap, SessionExtension as aq, SessionForkOptions as ar, SessionMeta as as, SessionStateSnapshot as at, Span as au, SpanData as av, SpanError as aw, SpanImplOptions as ay, StartTraceOptions as az, AdmissionVerdict as b, WorkflowEventType as b1, WorkflowIsolation as b2, WorkflowLimits as b3, WorkflowLogEvent as b4, WorkflowMeta as b5, WorkflowModelHint as b6, WorkflowModule as b7, WorkflowParallelOptions as b8, WorkflowProcessArtifact as b9, WorkflowTaskUsage as bA, WorkflowWaitOptions as bB, WorkflowProcessCounts as ba, WorkflowProcessEvent as bb, WorkflowProcessItem as bc, WorkflowProcessItemKind as bd, WorkflowProcessItemStatus as be, WorkflowProcessProgress as bf, WorkflowProcessSnapshot as bg, WorkflowProcessSource as bh, WorkflowProcessStatus as bi, WorkflowProcessSummaryStatus as bj, WorkflowProcessTokenUsage as bk, WorkflowProcessTracker as bl, WorkflowProcessTrackerOptions as bm, WorkflowRun as bn, WorkflowRunState as bo, WorkflowRunStatus as bp, WorkflowSpawnAgentInput as bq, WorkflowSynthesis as br, WorkflowSynthesizeInput as bs, WorkflowTaskHandle as bt, WorkflowTaskResult as bu, WorkflowTaskSnapshot as bv, WorkflowTaskStatus as bw, WorkflowTaskSummaryEventUpdate as bx, WorkflowTaskSummaryKind as by, WorkflowTaskSummaryUpdate as bz, AdmittedHandle as c, Agent as d, AgentManifest as e, AgentMessage as f, AgentMiddlewareDeclaration as g, AgentReasoningProfile as h, AgentSpanData as i, AgentTool as j, AskUserMultiOptions as k, AskUserQuestionItem as l, AskUserQuestionOptions as m, CompactionAnchor as n, CompactionConfig as o, CompactionDetails as p, CompactionResult as q, CompactionSpanData as r, CompactionUpdate as s, CurrentTodoSummary as t, Deliverable as u, DequeueFilter as v, DiscoveredInstance as w, DiscoveryOptions as x, EvidenceSpanData as y, FileOperations as z };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { E as KodaXReasoningMode, V as KodaXThinkingBudgetMap, W as KodaXThinkingDepth, s as KodaXProviderConfig, D as KodaXReasoningCapability, G as KodaXReasoningRequest, R as KodaXTaskType, F as KodaXReasoningOverride, a2 as KodaXVerifyCredentialResult, Y as KodaXToolDefinition, n as KodaXMessage, A as KodaXProviderStreamOptions, L as KodaXStreamResult, o as KodaXModelDescriptor, r as KodaXProviderCapabilityProfile, a3 as KodaXVerifyStrategy, h as KodaXCustomProviderConfig, m as KodaXListModelsResult } from './types.d-
|
|
1
|
+
import { E as KodaXReasoningMode, V as KodaXThinkingBudgetMap, W as KodaXThinkingDepth, s as KodaXProviderConfig, D as KodaXReasoningCapability, G as KodaXReasoningRequest, R as KodaXTaskType, F as KodaXReasoningOverride, a2 as KodaXVerifyCredentialResult, Y as KodaXToolDefinition, n as KodaXMessage, A as KodaXProviderStreamOptions, L as KodaXStreamResult, o as KodaXModelDescriptor, r as KodaXProviderCapabilityProfile, a3 as KodaXVerifyStrategy, h as KodaXCustomProviderConfig, m as KodaXListModelsResult } from './types.d-rPRl2LSB.js';
|
|
2
2
|
import Anthropic from '@anthropic-ai/sdk';
|
|
3
|
-
import { K as KodaXBaseProvider } from './base.d-
|
|
3
|
+
import { K as KodaXBaseProvider } from './base.d-C4jYVjJh.js';
|
|
4
4
|
import OpenAI from 'openai';
|
|
5
5
|
|
|
6
6
|
/**
|
|
@@ -61,8 +61,17 @@ declare abstract class KodaXAnthropicCompatProvider extends KodaXBaseProvider {
|
|
|
61
61
|
abstract readonly name: string;
|
|
62
62
|
readonly supportsThinking = true;
|
|
63
63
|
protected abstract readonly config: KodaXProviderConfig;
|
|
64
|
-
|
|
65
|
-
|
|
64
|
+
private _client?;
|
|
65
|
+
/**
|
|
66
|
+
* The SDK client is built lazily on first use. Constructing it requires the
|
|
67
|
+
* API key (`getApiKey()` throws when the env var is unset), so deferring it
|
|
68
|
+
* lets callers construct a provider and read static metadata (context
|
|
69
|
+
* window, model descriptors) without a key. This also keeps key-less unit
|
|
70
|
+
* tests (which mock the actual LLM calls) from failing at construction time.
|
|
71
|
+
*/
|
|
72
|
+
protected get client(): Anthropic;
|
|
73
|
+
protected set client(client: Anthropic);
|
|
74
|
+
protected buildClient(): Anthropic;
|
|
66
75
|
protected onStaleConnection(): void;
|
|
67
76
|
/**
|
|
68
77
|
* FEATURE_216 v0.7.45 — Lightweight credential verification.
|
|
@@ -122,8 +131,17 @@ declare abstract class KodaXOpenAICompatProvider extends KodaXBaseProvider {
|
|
|
122
131
|
abstract readonly name: string;
|
|
123
132
|
readonly supportsThinking = true;
|
|
124
133
|
protected abstract readonly config: KodaXProviderConfig;
|
|
125
|
-
|
|
126
|
-
|
|
134
|
+
private _client?;
|
|
135
|
+
/**
|
|
136
|
+
* The SDK client is built lazily on first use. Constructing it requires the
|
|
137
|
+
* API key (`getApiKey()` throws when the env var is unset), so deferring it
|
|
138
|
+
* lets callers construct a provider and read static metadata (context
|
|
139
|
+
* window, model descriptors) without a key. This also keeps key-less unit
|
|
140
|
+
* tests (which mock the actual LLM calls) from failing at construction time.
|
|
141
|
+
*/
|
|
142
|
+
protected get client(): OpenAI;
|
|
143
|
+
protected set client(client: OpenAI);
|
|
144
|
+
protected buildClient(): OpenAI;
|
|
127
145
|
protected onStaleConnection(): void;
|
|
128
146
|
/**
|
|
129
147
|
* FEATURE_216 v0.7.45 — Lightweight credential verification.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as KodaXSessionData, s as KodaXSessionLineage, v as KodaXSessionNavigationOptions, w as KodaXSessionRuntimeInfo, y as KodaXSessionStorage } from './types.d-
|
|
1
|
+
import { n as KodaXSessionData, s as KodaXSessionLineage, v as KodaXSessionNavigationOptions, w as KodaXSessionRuntimeInfo, y as KodaXSessionStorage } from './types.d-BnjX2Gn4.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Session Storage - Session storage abstraction layer
|
|
@@ -31,6 +31,7 @@ interface SessionStorage {
|
|
|
31
31
|
id: string;
|
|
32
32
|
title: string;
|
|
33
33
|
msgCount: number;
|
|
34
|
+
tag?: string;
|
|
34
35
|
runtimeInfo?: KodaXSessionRuntimeInfo;
|
|
35
36
|
}>>;
|
|
36
37
|
delete?(id: string): Promise<void>;
|
|
@@ -58,6 +59,7 @@ declare class MemorySessionStorage implements SessionStorage {
|
|
|
58
59
|
id: string;
|
|
59
60
|
title: string;
|
|
60
61
|
msgCount: number;
|
|
62
|
+
tag?: string;
|
|
61
63
|
}>>;
|
|
62
64
|
delete(id: string): Promise<void>;
|
|
63
65
|
deleteAll(_gitRoot?: string): Promise<void>;
|
|
@@ -164,6 +166,7 @@ declare class FileSessionStorage implements KodaXSessionStorage {
|
|
|
164
166
|
id: string;
|
|
165
167
|
title: string;
|
|
166
168
|
msgCount: number;
|
|
169
|
+
tag?: string;
|
|
167
170
|
runtimeInfo?: KodaXSessionRuntimeInfo;
|
|
168
171
|
archived?: boolean;
|
|
169
172
|
createdAt?: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as KodaXMessage } from './types.d-
|
|
1
|
+
import { n as KodaXMessage } from './types.d-rPRl2LSB.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* @kodax-ai/agent Types
|
|
@@ -182,6 +182,8 @@ interface KodaXSessionData {
|
|
|
182
182
|
messages: KodaXMessage[];
|
|
183
183
|
title: string;
|
|
184
184
|
gitRoot: string;
|
|
185
|
+
/** Consumer-owned private string persisted with the session. */
|
|
186
|
+
tag?: string;
|
|
185
187
|
runtimeInfo?: KodaXSessionRuntimeInfo;
|
|
186
188
|
scope?: KodaXSessionScope;
|
|
187
189
|
uiHistory?: KodaXSessionUiHistoryItem[];
|
|
@@ -196,6 +198,8 @@ interface KodaXSessionMeta {
|
|
|
196
198
|
title: string;
|
|
197
199
|
id: string;
|
|
198
200
|
gitRoot: string;
|
|
201
|
+
/** Consumer-owned private string persisted with the session. */
|
|
202
|
+
tag?: string;
|
|
199
203
|
runtimeInfo?: KodaXSessionRuntimeInfo;
|
|
200
204
|
createdAt: string;
|
|
201
205
|
scope?: KodaXSessionScope;
|
|
@@ -283,6 +287,7 @@ interface KodaXSessionStorage {
|
|
|
283
287
|
id: string;
|
|
284
288
|
title: string;
|
|
285
289
|
msgCount: number;
|
|
290
|
+
tag?: string;
|
|
286
291
|
runtimeInfo?: KodaXSessionRuntimeInfo;
|
|
287
292
|
}>>;
|
|
288
293
|
delete?(id: string): Promise<void>;
|
|
@@ -474,6 +474,10 @@ interface KodaXProviderStreamOptions {
|
|
|
474
474
|
sessionId?: string;
|
|
475
475
|
/** Override the provider's default model for a single request */
|
|
476
476
|
modelOverride?: string;
|
|
477
|
+
/** Force a single tool call for one-shot judge/sidecar requests. */
|
|
478
|
+
forcedToolName?: string;
|
|
479
|
+
/** Per-request output budget override for short structured calls. */
|
|
480
|
+
maxOutputTokensOverride?: number;
|
|
477
481
|
/** AbortSignal for cancelling the stream request */
|
|
478
482
|
signal?: AbortSignal;
|
|
479
483
|
}
|