@kodax-ai/kodax 0.7.46 → 0.7.48
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 +37 -1
- package/dist/chunks/{chunk-2GEKCIIW.js → chunk-66B6ZOU7.js} +13 -13
- package/dist/chunks/{chunk-K4RBLNSY.js → chunk-6Z75SHX3.js} +1 -1
- package/dist/chunks/{chunk-Z4UT32NN.js → chunk-DEODZG6Q.js} +1 -1
- package/dist/chunks/chunk-EP46H5P3.js +415 -0
- package/dist/chunks/{chunk-XUEINS3X.js → chunk-LNJNRREL.js} +317 -263
- package/dist/chunks/{chunk-JRT447X5.js → chunk-UHAP234X.js} +244 -242
- package/dist/chunks/{compaction-config-PFTBIGQT.js → compaction-config-YWCHOP2U.js} +1 -1
- package/dist/chunks/{construction-bootstrap-2FKNOZZE.js → construction-bootstrap-AIWATBWW.js} +1 -1
- package/dist/chunks/dist-4WABQRJU.js +2 -0
- package/dist/chunks/{dist-QTV5M2JW.js → dist-IDNOAB4M.js} +1 -1
- package/dist/chunks/{utils-LY3LB65Z.js → utils-OG57XTPC.js} +1 -1
- package/dist/index.d.ts +10 -7
- package/dist/index.js +5 -5
- package/dist/kodax_cli.js +765 -719
- package/dist/provider-capabilities.json +3 -8
- package/dist/sdk-agent.d.ts +38 -7
- package/dist/sdk-agent.js +1 -1
- package/dist/sdk-coding.d.ts +102 -11
- package/dist/sdk-coding.js +1 -1
- package/dist/sdk-llm.js +1 -1
- package/dist/sdk-mcp.d.ts +3 -3
- package/dist/sdk-mcp.js +1 -1
- package/dist/sdk-repl.d.ts +10 -9
- package/dist/sdk-repl.js +1 -1
- package/dist/sdk-session.js +1 -1
- package/dist/sdk-skills.js +1 -1
- package/dist/types-chunks/{bash-prefix-extractor.d-BICYx8pt.d.ts → bash-prefix-extractor.d-DNO2-ycp.d.ts} +283 -31
- package/dist/types-chunks/{config.d-BfJUXxC0.d.ts → config.d-CJy1WENT.d.ts} +17 -7
- package/dist/types-chunks/{file-tracker.d-BNTIvsdb.d.ts → file-tracker.d-D7L_SbRm.d.ts} +1 -1
- package/dist/types-chunks/manager.d-DLmDhX3i.d.ts +696 -0
- package/dist/types-chunks/{types.d-D2RNa5Y7.d.ts → types.d-BCnbYG_A.d.ts} +68 -2
- package/dist/types-chunks/{utils.d-pzHPkrb8.d.ts → utils.d-Dgy5SVrq.d.ts} +1 -1
- package/package.json +2 -1
- package/dist/chunks/chunk-VBIVZOSD.js +0 -425
- package/dist/chunks/dist-JLMKDPEL.js +0 -2
- package/dist/types-chunks/manager.d-87belpiS.d.ts +0 -370
package/dist/sdk-session.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @kodax-ai/kodax — bundled distribution. See docs/ADR.md ADR-022 + ADR-024.
|
|
2
|
-
import{bc as s,cc as e,dc as n,ec as i,fc as o,gc as S,hc as t,ic as a,jc as r,kc as l,lc as c}from"./chunks/chunk-
|
|
2
|
+
import{bc as s,cc as e,dc as n,ec as i,fc as o,gc as S,hc as t,ic as a,jc as r,kc as l,lc as c}from"./chunks/chunk-UHAP234X.js";import"./chunks/chunk-6Z75SHX3.js";import"./chunks/chunk-DEODZG6Q.js";import"./chunks/chunk-EVIDQWMF.js";import"./chunks/chunk-LNJNRREL.js";import"./chunks/chunk-66B6ZOU7.js";import"./chunks/chunk-EP46H5P3.js";import"./chunks/chunk-V4WSBIXB.js";export{a as archiveSession,c as createSessionManager,t as deleteSession,n as forkSession,S as listRunningSessions,s as listSessions,e as loadSession,i as rewindSession,o as setActiveEntry,r as unarchiveSession,l as watchSessions};
|
package/dist/sdk-skills.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @kodax-ai/kodax — bundled distribution. See docs/ADR.md ADR-022 + ADR-024.
|
|
2
|
-
import{
|
|
2
|
+
import{Ub as l,Vb as e,Wb as i,Xb as t,Yb as a,Zb as o,bc as k,cc as r,dc as S,ec as s,fc as n,gc as g,hc as u,ic as c,jc as x,kc as d,lc as P,mc as R,nc as h,oc as p,pc as v,qc as y,rc as M,sc as f,tc as m,uc as E}from"./chunks/chunk-EP46H5P3.js";import"./chunks/chunk-V4WSBIXB.js";export{y as SkillExecutor,R as SkillRegistry,x as VariableResolver,t as clearPluginSkillPaths,M as createExecutor,d as createResolver,n as discoverSkills,u as discoverSkillsWithMonorepo,f as executeSkill,m as expandSkillForLLM,E as formatSkillActivationMessage,a as getDefaultSkillPaths,g as getNestedSkillPaths,o as getSkillPathsFlat,h as getSkillRegistry,p as initializeSkillRegistry,i as listPluginSkillPaths,S as loadFullSkill,s as loadSkillFileContent,r as loadSkillMetadata,c as parseArguments,k as parseSkillMarkdown,l as registerPluginSkillPath,v as resetSkillRegistry,P as resolveSkillContent,e as unregisterPluginSkillPath};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { M as McpConnectMode, a as McpServerConfig, b as McpServersConfig, c as McpTransportKind } from './config.d-
|
|
1
|
+
import { M as McpConnectMode, a as McpServerConfig, b as McpServersConfig, c as McpTransportKind } from './config.d-CJy1WENT.js';
|
|
2
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-B_MIIApc.js';
|
|
3
3
|
import { X as KodaXTokenUsage, n as KodaXMessage, E as KodaXReasoningMode, k as KodaXHarnessProfile, S as KodaXTaskWorkIntent, I as KodaXReviewScale, O as KodaXTaskComplexity, a as KodaXAmaFanoutClass, Q as KodaXTaskRoutingDecision, R as KodaXTaskType, J as KodaXRiskLevel, i as KodaXExecutionMode, c as KodaXAmaProfile, d as KodaXAmaTactic, b as KodaXAmaFanoutPolicy } from './types.d-Cf-GCzac.js';
|
|
4
|
-
import { f as AgentMessage,
|
|
4
|
+
import { f as AgentMessage, ay as StopHookFn, C as ChildTaskRegistry, s as CompactionUpdate, m as AskUserQuestionOptions, k as AskUserMultiOptions, y as Guardrail, v as DiscoveredInstance, aC as TaskAbortRegistry, ad as RunnerToolCall, aH as ToolGuardrail } from './types.d-BCnbYG_A.js';
|
|
5
|
+
import { Diagnostic, Position, Location, Hover, DocumentSymbol, SymbolInformation } from 'vscode-languageserver-protocol';
|
|
5
6
|
import { C as CapabilityKind, b as CapabilityResult } from './capability.d-3C62G8Eq.js';
|
|
6
7
|
import { K as KodaXBaseProvider } from './base.d-BdJKSPO2.js';
|
|
7
8
|
import { a as CostTracker } from './cost-tracker.d-wRtyEW9d.js';
|
|
@@ -391,6 +392,200 @@ interface TodoStore {
|
|
|
391
392
|
reset(): void;
|
|
392
393
|
}
|
|
393
394
|
|
|
395
|
+
/**
|
|
396
|
+
* FEATURE_132 — language-server registry + discovery (cascade step ①).
|
|
397
|
+
*
|
|
398
|
+
* Each `LspServerInfo` is data describing one server: which languageIds it
|
|
399
|
+
* serves, the project-root markers it should be rooted at, how to discover
|
|
400
|
+
* an installed binary, an optional opt-in `acquire()` (cascade step ②), and
|
|
401
|
+
* one line of actionable install guidance for when it is absent (step ③).
|
|
402
|
+
* Adding a language = appending one entry here (data-driven, LLM-First).
|
|
403
|
+
*
|
|
404
|
+
* Phase A: TypeScript/JavaScript. Phase B: Python (pyright) + Go (gopls).
|
|
405
|
+
* Phase C appends Rust, Java.
|
|
406
|
+
*/
|
|
407
|
+
|
|
408
|
+
/** A resolved server launch: program + args + optional init options. */
|
|
409
|
+
interface LspServerLaunch {
|
|
410
|
+
readonly command: string;
|
|
411
|
+
readonly args: readonly string[];
|
|
412
|
+
readonly initializationOptions?: Record<string, unknown>;
|
|
413
|
+
}
|
|
414
|
+
interface DiscoverContext {
|
|
415
|
+
/** Project root the server will be rooted at. */
|
|
416
|
+
readonly root: string;
|
|
417
|
+
/** `import.meta.url` of the LSP module, used for bundled-TypeScript fallback. */
|
|
418
|
+
readonly moduleUrl?: string;
|
|
419
|
+
}
|
|
420
|
+
interface AcquireContext {
|
|
421
|
+
readonly root: string;
|
|
422
|
+
readonly signal?: AbortSignal;
|
|
423
|
+
readonly onProgress?: (message: string) => void;
|
|
424
|
+
readonly debug?: (message: string) => void;
|
|
425
|
+
}
|
|
426
|
+
interface LspServerInfo {
|
|
427
|
+
readonly id: string;
|
|
428
|
+
readonly languageIds: readonly string[];
|
|
429
|
+
readonly rootMarkers: readonly string[];
|
|
430
|
+
/** Locate an installed server, or `undefined` if not installed. */
|
|
431
|
+
discover(ctx: DiscoverContext): LspServerLaunch | undefined;
|
|
432
|
+
/**
|
|
433
|
+
* Opt-in auto-install (only attempted when `KODAX_LSP_DOWNLOAD=1`). Installs
|
|
434
|
+
* the server, then returns its launch (typically by re-running discovery).
|
|
435
|
+
* Absent for servers KodaX won't auto-install.
|
|
436
|
+
*/
|
|
437
|
+
acquire?(ctx: AcquireContext): Promise<LspServerLaunch | undefined>;
|
|
438
|
+
/** One actionable line shown when discovery + acquire fail (step ③). */
|
|
439
|
+
readonly installGuidance: string;
|
|
440
|
+
}
|
|
441
|
+
/** All servers KodaX knows how to drive. */
|
|
442
|
+
declare const LSP_SERVERS: readonly LspServerInfo[];
|
|
443
|
+
|
|
444
|
+
/**
|
|
445
|
+
* FEATURE_132 — JSON-RPC LSP client (one spawned server, one project root).
|
|
446
|
+
*
|
|
447
|
+
* Push-diagnostics model: after `didOpen`/`didChange`, the server emits
|
|
448
|
+
* `textDocument/publishDiagnostics`; we cache the latest set per file and
|
|
449
|
+
* let callers wait (debounced) for a fresh publish. All five servers KodaX
|
|
450
|
+
* targets (typescript-language-server, pyright, gopls, rust-analyzer, jdtls)
|
|
451
|
+
* push diagnostics, so we deliberately do NOT port opencode's pull-diagnostic
|
|
452
|
+
* machinery (YAGNI — add it only if a future server requires it).
|
|
453
|
+
*
|
|
454
|
+
* Navigation requests (definition/hover/references/symbols) are added in
|
|
455
|
+
* Phase E.
|
|
456
|
+
*/
|
|
457
|
+
|
|
458
|
+
interface DiagnosticsWaitOptions {
|
|
459
|
+
/** Only a publish with timestamp ≥ this counts as fresh (set before notify). */
|
|
460
|
+
readonly afterMs: number;
|
|
461
|
+
/** Give up waiting after this long and return what we have. */
|
|
462
|
+
readonly timeoutMs: number;
|
|
463
|
+
}
|
|
464
|
+
interface LspClient {
|
|
465
|
+
readonly serverId: string;
|
|
466
|
+
readonly root: string;
|
|
467
|
+
/**
|
|
468
|
+
* Send didOpen (first touch) or didChange (subsequent) for a file, and
|
|
469
|
+
* return the timestamp the notification was sent — pass it as
|
|
470
|
+
* `waitForDiagnostics`'s `afterMs` so only a publish triggered by THIS
|
|
471
|
+
* change counts as fresh.
|
|
472
|
+
*/
|
|
473
|
+
notifyOpenOrChange(file: string): Promise<number>;
|
|
474
|
+
/** Resolve once a fresh diagnostics publish arrives for the file, or on timeout. */
|
|
475
|
+
waitForDiagnostics(file: string, options: DiagnosticsWaitOptions): Promise<void>;
|
|
476
|
+
/** Latest cached diagnostics for a file (empty when none/unknown). */
|
|
477
|
+
diagnostics(file: string): readonly Diagnostic[];
|
|
478
|
+
/** Resolve the definition site(s) of the symbol at a position. */
|
|
479
|
+
definition(file: string, position: Position): Promise<Location[]>;
|
|
480
|
+
/** Type/signature/doc hover for the symbol at a position (null if none). */
|
|
481
|
+
hover(file: string, position: Position): Promise<Hover | null>;
|
|
482
|
+
/** All references to the symbol at a position (incl. its declaration). */
|
|
483
|
+
references(file: string, position: Position): Promise<Location[]>;
|
|
484
|
+
/** The document's symbol outline. */
|
|
485
|
+
documentSymbols(file: string): Promise<Array<DocumentSymbol | SymbolInformation>>;
|
|
486
|
+
/** Graceful shutdown (await server exit so the OS releases handles). */
|
|
487
|
+
shutdown(): Promise<void>;
|
|
488
|
+
/** Synchronous best-effort kill, for a `process.on('exit')` last resort. */
|
|
489
|
+
killSync(): void;
|
|
490
|
+
}
|
|
491
|
+
interface CreateLspClientParams {
|
|
492
|
+
readonly serverId: string;
|
|
493
|
+
readonly root: string;
|
|
494
|
+
readonly launch: LspServerLaunch;
|
|
495
|
+
readonly initializeTimeoutMs?: number;
|
|
496
|
+
readonly debug?: (message: string) => void;
|
|
497
|
+
}
|
|
498
|
+
|
|
499
|
+
/**
|
|
500
|
+
* FEATURE_132 — LSP service: spawns/caches one client per (root, server) and
|
|
501
|
+
* exposes the post-edit diagnostics façade the write-family tools call.
|
|
502
|
+
*
|
|
503
|
+
* State machine mirrors opencode:
|
|
504
|
+
* - `clients` — live clients, keyed `root|serverId`.
|
|
505
|
+
* - `broken` — keys that failed discovery or startup; skipped forever
|
|
506
|
+
* (no retry storm — a one-shot blacklist).
|
|
507
|
+
* - `spawning` — in-flight startups, so concurrent edits never double-spawn.
|
|
508
|
+
*
|
|
509
|
+
* `getDiagnosticsBlock` is deliberately SILENT when no server is installed
|
|
510
|
+
* (returns `""`): nagging an install hint on every edit would be noise.
|
|
511
|
+
* Install guidance is surfaced on explicit, user-initiated surfaces instead
|
|
512
|
+
* (Phase E navigation tools / status), not the diagnostics reflux path.
|
|
513
|
+
*/
|
|
514
|
+
|
|
515
|
+
/** Per-edit hints the service needs to root + cancel work. */
|
|
516
|
+
interface DiagnosticsRequest {
|
|
517
|
+
/** Project root (git root) — bounds the upward root-marker search. */
|
|
518
|
+
readonly gitRoot?: string;
|
|
519
|
+
/** Cancels the work when the host aborts the turn. */
|
|
520
|
+
readonly signal?: AbortSignal;
|
|
521
|
+
/** Live progress line (e.g. "Starting typescript language server…"). */
|
|
522
|
+
readonly onProgress?: (message: string) => void;
|
|
523
|
+
}
|
|
524
|
+
interface LspServiceConfig {
|
|
525
|
+
/** `import.meta.url` used to resolve the bundled TypeScript fallback. */
|
|
526
|
+
readonly moduleUrl?: string;
|
|
527
|
+
/** How long to wait for a fresh diagnostics publish per file. Default 5s. */
|
|
528
|
+
readonly documentTimeoutMs?: number;
|
|
529
|
+
/** Server registry override (tests). Defaults to {@link LSP_SERVERS}. */
|
|
530
|
+
readonly servers?: readonly LspServerInfo[];
|
|
531
|
+
/** Client factory override (tests). Defaults to {@link createLspClient}. */
|
|
532
|
+
readonly createClient?: (params: CreateLspClientParams) => Promise<LspClient>;
|
|
533
|
+
/** Debug sink (off unless wired). */
|
|
534
|
+
readonly debug?: (message: string) => void;
|
|
535
|
+
}
|
|
536
|
+
declare class LspService {
|
|
537
|
+
private readonly config;
|
|
538
|
+
private readonly clients;
|
|
539
|
+
private readonly broken;
|
|
540
|
+
private readonly spawning;
|
|
541
|
+
private readonly servers;
|
|
542
|
+
private shuttingDown;
|
|
543
|
+
constructor(config?: LspServiceConfig);
|
|
544
|
+
/**
|
|
545
|
+
* Touch a just-written file and return an appendable diagnostics block
|
|
546
|
+
* (`"\n\n…"`) when the language server reports errors, or `""` when there
|
|
547
|
+
* are none / no server is available. Never throws.
|
|
548
|
+
*/
|
|
549
|
+
getDiagnosticsBlock(file: string, request?: DiagnosticsRequest): Promise<string>;
|
|
550
|
+
/** Definition site(s) of the symbol at `position` (0-based), as text. */
|
|
551
|
+
getDefinition(file: string, position: Position, request?: DiagnosticsRequest): Promise<string>;
|
|
552
|
+
/** Hover (type/signature/doc) for the symbol at `position` (0-based). */
|
|
553
|
+
getHover(file: string, position: Position, request?: DiagnosticsRequest): Promise<string>;
|
|
554
|
+
/** All references to the symbol at `position` (0-based), as text. */
|
|
555
|
+
getReferences(file: string, position: Position, request?: DiagnosticsRequest): Promise<string>;
|
|
556
|
+
/** The file's symbol outline, as indented text. */
|
|
557
|
+
getDocumentSymbols(file: string, request?: DiagnosticsRequest): Promise<string>;
|
|
558
|
+
/**
|
|
559
|
+
* Resolve the primary client for a navigation request, opening the file so
|
|
560
|
+
* the server has current content. Returns guidance text when no server is
|
|
561
|
+
* installed (navigation is user-initiated, so — unlike diagnostics — it is
|
|
562
|
+
* NOT silent), or an unsupported message for non-LSP file types.
|
|
563
|
+
*/
|
|
564
|
+
private navClient;
|
|
565
|
+
/** Shut down all spawned servers gracefully (call on session teardown). */
|
|
566
|
+
shutdownAll(): Promise<void>;
|
|
567
|
+
/** Synchronous best-effort kill of all servers — for `process.on('exit')`. */
|
|
568
|
+
killAllSync(): void;
|
|
569
|
+
/**
|
|
570
|
+
* Clear the broken blacklist so a server that failed earlier (e.g. installed
|
|
571
|
+
* mid-session, or a transient startup failure) can be retried. Pass a
|
|
572
|
+
* `root|serverId` key to clear one entry, or omit to clear all.
|
|
573
|
+
*/
|
|
574
|
+
resetBroken(key?: string): void;
|
|
575
|
+
private getClient;
|
|
576
|
+
private spawnClient;
|
|
577
|
+
/** Cascade step ②: opt-in auto-install, only when the user enabled it. */
|
|
578
|
+
private acquireIfEnabled;
|
|
579
|
+
}
|
|
580
|
+
/**
|
|
581
|
+
* Process-wide default service used by the write-family tools when the host
|
|
582
|
+
* does not inject one. `KODAX_LSP=0` disables it entirely (returns undefined,
|
|
583
|
+
* so tools no-op). `KODAX_DEBUG_LSP` routes internal logs to stderr.
|
|
584
|
+
*/
|
|
585
|
+
declare function getDefaultLspService(): LspService | undefined;
|
|
586
|
+
/** Gracefully shut down the process-wide default service (host teardown). */
|
|
587
|
+
declare function shutdownDefaultLspService(): Promise<void>;
|
|
588
|
+
|
|
394
589
|
/**
|
|
395
590
|
* FEATURE_192 v0.7.44 Phase B — Goal lifecycle hook composer.
|
|
396
591
|
*
|
|
@@ -630,6 +825,58 @@ interface GoalRuntimeBinding {
|
|
|
630
825
|
*/
|
|
631
826
|
declare function buildGoalRuntimeBinding(deps: GoalRuntimeBindingDeps): GoalRuntimeBinding;
|
|
632
827
|
|
|
828
|
+
/**
|
|
829
|
+
* FEATURE_218 — KodaX Self-Knowledge Manual types.
|
|
830
|
+
*
|
|
831
|
+
* A bundled, version-bound product manual that answers "how do I use /
|
|
832
|
+
* configure / install / troubleshoot KodaX?" questions. Pure data + a
|
|
833
|
+
* deterministic resolver — no RAG, no vector store, no network fetch.
|
|
834
|
+
*/
|
|
835
|
+
type KodaXManualTopicId = 'overview' | 'install' | 'quickstart' | 'providers' | 'custom-providers' | 'config' | 'permissions' | 'commands' | 'tools' | 'agents' | 'skills' | 'mcp' | 'repo-intelligence' | 'sessions' | 'doctor' | 'sdk' | 'troubleshooting';
|
|
836
|
+
/** A pointer to the code/doc the topic is derived from (for traceability). */
|
|
837
|
+
interface KodaXManualSource {
|
|
838
|
+
readonly label: string;
|
|
839
|
+
readonly path: string;
|
|
840
|
+
}
|
|
841
|
+
interface ResolveKodaXManualInput {
|
|
842
|
+
/** Exact topic id or alias. Takes precedence over `query`. */
|
|
843
|
+
readonly topic?: string;
|
|
844
|
+
/** Free-text question; resolved by alias + token overlap. */
|
|
845
|
+
readonly query?: string;
|
|
846
|
+
}
|
|
847
|
+
/**
|
|
848
|
+
* FEATURE_221 — a topic an SDK consumer (e.g. a product built on KodaX)
|
|
849
|
+
* injects via `KodaXOptions.selfManual.topics`. Same shape as a KodaX base
|
|
850
|
+
* topic but `id` is a free string (new id = add; existing base id = override),
|
|
851
|
+
* and aliases/nextTopics/sources are optional to lower the authoring burden.
|
|
852
|
+
* Bodies are still byte-capped by the resolver (no unbounded items).
|
|
853
|
+
*/
|
|
854
|
+
interface KodaXManualTopicInput {
|
|
855
|
+
readonly id: string;
|
|
856
|
+
readonly title: string;
|
|
857
|
+
readonly summary: string;
|
|
858
|
+
readonly body: string;
|
|
859
|
+
readonly aliases?: readonly string[];
|
|
860
|
+
readonly nextTopics?: readonly string[];
|
|
861
|
+
readonly sources?: readonly KodaXManualSource[];
|
|
862
|
+
}
|
|
863
|
+
/** Per-call resolver options — consumer topic injection + product re-branding. */
|
|
864
|
+
interface ResolveKodaXManualOptions {
|
|
865
|
+
/** Injected consumer topics, merged over the KodaX base (override by id). */
|
|
866
|
+
readonly extraTopics?: readonly KodaXManualTopicInput[];
|
|
867
|
+
/** Product name used in the scope anchor (default "KodaX"). */
|
|
868
|
+
readonly productName?: string;
|
|
869
|
+
}
|
|
870
|
+
interface ResolveKodaXManualResult {
|
|
871
|
+
/** A topic id (KodaX base or injected consumer topic), or 'index'. */
|
|
872
|
+
readonly matchedTopic: string;
|
|
873
|
+
readonly title: string;
|
|
874
|
+
/** Assembled, byte-capped content (scope anchor + body, or index list). */
|
|
875
|
+
readonly content: string;
|
|
876
|
+
readonly sources: readonly KodaXManualSource[];
|
|
877
|
+
readonly nextTopics: readonly string[];
|
|
878
|
+
}
|
|
879
|
+
|
|
633
880
|
/**
|
|
634
881
|
* FEATURE_093 (v0.7.24): minimal contract interface for the coding extension
|
|
635
882
|
* runtime. Extracted so `@kodax-ai/coding/src/types.ts` can reference the
|
|
@@ -1695,6 +1942,26 @@ interface KodaXContextOptions {
|
|
|
1695
1942
|
* the lifecycle hooks pass through unmodified.
|
|
1696
1943
|
*/
|
|
1697
1944
|
goalRuntime?: GoalRuntimeBinding;
|
|
1945
|
+
/**
|
|
1946
|
+
* FEATURE_132 (v0.7.47) — native LSP service for edit-time diagnostics
|
|
1947
|
+
* reflux. When omitted, `buildToolExecutionContext` falls back to the
|
|
1948
|
+
* process-wide default (`getDefaultLspService()`), so diagnostics work
|
|
1949
|
+
* out of the box; hosts/tests inject their own to control or disable it.
|
|
1950
|
+
*
|
|
1951
|
+
* See `packages/coding/src/lsp/service.ts`.
|
|
1952
|
+
*/
|
|
1953
|
+
lspService?: LspService;
|
|
1954
|
+
}
|
|
1955
|
+
/**
|
|
1956
|
+
* FEATURE_221 — an SDK consumer (a product built on KodaX, e.g. KodaX-Space)
|
|
1957
|
+
* injects its own product manual so that when ITS users ask "how do I use /
|
|
1958
|
+
* configure <product>?", the kodax_manual tool answers with the consumer's
|
|
1959
|
+
* topics. `topics` extend the KodaX base (override by id); `productName`
|
|
1960
|
+
* re-brands the routing rule + scope anchor. Topics are still byte-capped.
|
|
1961
|
+
*/
|
|
1962
|
+
interface KodaXSelfManualConfig {
|
|
1963
|
+
readonly productName?: string;
|
|
1964
|
+
readonly topics?: readonly KodaXManualTopicInput[];
|
|
1698
1965
|
}
|
|
1699
1966
|
interface KodaXOptions {
|
|
1700
1967
|
provider: string;
|
|
@@ -1708,6 +1975,8 @@ interface KodaXOptions {
|
|
|
1708
1975
|
context?: KodaXContextOptions;
|
|
1709
1976
|
events?: KodaXEvents;
|
|
1710
1977
|
extensionRuntime?: ExtensionRuntimeContract;
|
|
1978
|
+
/** FEATURE_221: SDK-consumer self-manual injection (product name + topics). */
|
|
1979
|
+
selfManual?: KodaXSelfManualConfig;
|
|
1711
1980
|
/**
|
|
1712
1981
|
* FEATURE_092 (v0.7.33): caller-supplied run-scoped guardrails forwarded
|
|
1713
1982
|
* to `Runner.run` via `RunOptions.guardrails`. Merged with the START
|
|
@@ -1969,38 +2238,14 @@ interface KodaXResult {
|
|
|
1969
2238
|
/** Error metadata for recovery - 错误元数据用于恢复 */
|
|
1970
2239
|
errorMetadata?: SessionErrorMetadata;
|
|
1971
2240
|
}
|
|
1972
|
-
|
|
1973
|
-
interface AskUserQuestionItem {
|
|
1974
|
-
question: string;
|
|
1975
|
-
header?: string;
|
|
1976
|
-
options: Array<{
|
|
1977
|
-
label: string;
|
|
1978
|
-
description?: string;
|
|
1979
|
-
value: string;
|
|
1980
|
-
}>;
|
|
1981
|
-
multiSelect?: boolean;
|
|
1982
|
-
}
|
|
1983
|
-
/** Options for multi-question mode — multiple independent questions in one tool call. */
|
|
1984
|
-
interface AskUserMultiOptions {
|
|
1985
|
-
questions: AskUserQuestionItem[];
|
|
1986
|
-
}
|
|
1987
|
-
interface AskUserQuestionOptions {
|
|
1988
|
-
question: string;
|
|
1989
|
-
kind?: "select" | "input";
|
|
1990
|
-
/** Required for kind="select", ignored for kind="input". */
|
|
1991
|
-
options?: Array<{
|
|
1992
|
-
label: string;
|
|
1993
|
-
description?: string;
|
|
1994
|
-
value: string;
|
|
1995
|
-
}>;
|
|
1996
|
-
multiSelect?: boolean;
|
|
1997
|
-
default?: string;
|
|
1998
|
-
}
|
|
2241
|
+
|
|
1999
2242
|
interface KodaXToolExecutionContext {
|
|
2000
2243
|
/** File backups for undo functionality - 文件备份用于撤销功能 */
|
|
2001
2244
|
backups: Map<string, string>;
|
|
2002
2245
|
/** Git root directory - Git 根目录 */
|
|
2003
2246
|
gitRoot?: string;
|
|
2247
|
+
/** FEATURE_221: SDK-consumer self-manual injection, forwarded from KodaXOptions. */
|
|
2248
|
+
selfManual?: KodaXSelfManualConfig;
|
|
2004
2249
|
/** Working directory used to resolve relative paths and execute shell commands. */
|
|
2005
2250
|
executionCwd?: string;
|
|
2006
2251
|
/** Shared extension capability runtime used by retrieval-family tools. */
|
|
@@ -2160,6 +2405,13 @@ interface KodaXToolExecutionContext {
|
|
|
2160
2405
|
* See `packages/coding/src/multi-instance/content-hash-cache.ts`.
|
|
2161
2406
|
*/
|
|
2162
2407
|
contentHashCache?: ContentHashCache;
|
|
2408
|
+
/**
|
|
2409
|
+
* FEATURE_132 (v0.7.47) — native LSP service. The write-family tools call
|
|
2410
|
+
* `getDiagnosticsBlock(filePath, …)` after a successful write to reflux any
|
|
2411
|
+
* type errors into the tool result. Forwarded by `buildToolExecutionContext`
|
|
2412
|
+
* from `options.context.lspService` or the process-wide default.
|
|
2413
|
+
*/
|
|
2414
|
+
lspService?: LspService;
|
|
2163
2415
|
/**
|
|
2164
2416
|
* FEATURE_177 v0.7.42 — per-task read-file-state cache (anti-loop).
|
|
2165
2417
|
*
|
|
@@ -2921,5 +3173,5 @@ interface CreateBashPrefixExtractorOptions {
|
|
|
2921
3173
|
*/
|
|
2922
3174
|
declare function createBashPrefixExtractor(opts: CreateBashPrefixExtractorOptions): BashPrefixExtractor;
|
|
2923
3175
|
|
|
2924
|
-
export { BASH_POLICY_SPEC as B, CONSECUTIVE_THRESHOLD as C, ERROR_THRESHOLD as E,
|
|
2925
|
-
export type { KodaXMcpTransport as $, AgentsFile as A, DenialTracker as D, FailureStage as F, GoalBlockedResult as G,
|
|
3176
|
+
export { BASH_POLICY_SPEC as B, CONSECUTIVE_THRESHOLD as C, ERROR_THRESHOLD as E, LSP_SERVERS as aB, LspService as aF, WINDOW_MS as b1, buildGoalRuntimeBinding as b2, collectAllSignals as b3, computeRulesFingerprint as b4, createAutoModeToolGuardrail as b5, createBashPrefixExtractor as b6, createCircuitBreaker as b7, createDenialTracker as b8, extractCommandPrefix as b9, formatAgentsForPrompt as ba, getDefaultLspService as bb, getKodaxGlobalDir as bc, loadAgentsFiles as bd, loadAutoRules as be, makeDisabledGoalToolsContext as bf, parseAutoRules as bg, readTrustState as bh, recordAllow as bi, recordBlock as bj, recordError as bk, shouldFallback$1 as bl, shouldFallback as bm, shutdownDefaultLspService as bn, trustProjectRules as bo, withGoalBeforeNextTurn as bp, withGoalStopHook as bq, CUMULATIVE_THRESHOLD as k };
|
|
3177
|
+
export type { KodaXMcpTransport as $, AgentsFile as A, DenialTracker as D, FailureStage as F, GoalBlockedResult as G, KodaXContextOptions as H, KodaXContextTokenSnapshot as I, KodaXEvents as J, KodaXAgentMode as K, KodaXFanoutBranchLifecycle as L, KodaXFanoutBranchRecord as M, KodaXFanoutBranchTransition as N, KodaXFanoutSchedulerInput as O, KodaXFanoutSchedulerPlan as P, KodaXInputArtifact as Q, KodaXManagedBudgetSnapshot as R, KodaXManagedProtocolPayload as S, KodaXManagedTask as T, KodaXManagedTaskRuntimeState as U, KodaXManagedTaskStatusEvent as V, KodaXManualTopicId as W, KodaXManualTopicInput as X, KodaXMcpConnectMode as Y, KodaXMcpServerConfig as Z, KodaXMcpServersConfig as _, AutoModeAskUser as a, ToolCallSignal 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, KodaXVerificationScorecardCriterion as aA, LoadAgentsOptions as aC, LoadedRulesSource as aD, LspServerInfo as aE, LspServiceConfig as aG, ProviderExecutionState as aH, ProviderRecoveryEvent as aI, ProviderResilienceConfig as aJ, ProviderResiliencePolicy as aK, RecoveryAction as aL, RecoveryDecision as aM, RecoveryLadderStep as aN, RecoveryResult as aO, ResilienceClassification as aP, ResilienceErrorClass as aQ, ResolveKodaXManualInput as aR, ResolveKodaXManualOptions as aS, ResolveKodaXManualResult as aT, RulesLoadError as aU, RulesLoadResult as aV, SignalCollector as aW, SkippedRulesSource as aX, TodoItem as aY, TodoList as aZ, TodoStatus as a_, KodaXRepoRoutingSignals as aa, KodaXResult as ab, KodaXRoleRoundSummary as ac, KodaXRuntimeVerificationContract as ad, KodaXSelfManualConfig as ae, KodaXSessionControl as af, KodaXSessionMutators as ag, KodaXSessionOptions as ah, KodaXSkillInvocationContext as ai, KodaXSkillMap as aj, KodaXSkillProjectionConfidence as ak, KodaXTaskCapabilityHint as al, KodaXTaskContract as am, KodaXTaskEvidenceArtifact as an, KodaXTaskEvidenceBundle as ao, KodaXTaskEvidenceEntry as ap, KodaXTaskRole as aq, KodaXTaskRoleAssignment as ar, KodaXTaskStatus as as, KodaXTaskSurface as at, KodaXTaskToolPolicy as au, KodaXTaskVerificationContract as av, KodaXTaskVerificationCriterion as aw, KodaXTaskWorkItem as ax, KodaXToolExecutionContext as ay, KodaXVerificationScorecard as az, AutoModeAskUserVerdict as b, TrustState as b0, AutoModeEngine as c, AutoModeGuardrailConfig as d, AutoModeSharedState as e, AutoModeStats as f, AutoModeToolGuardrail as g, AutoRules as h, BashPrefixExtractor as i, BashPrefixResult as j, CircuitBreaker as l, CreateBashPrefixExtractorOptions as m, DiagnosticsRequest as n, ExtensionRuntimeContract as o, ExtractCommandPrefixOptions as p, GoalCompleteResult as q, GoalCreateInput as r, GoalLifecycleContext as s, GoalRuntimeBinding as t, GoalRuntimeBindingDeps as u, GoalToolsContext as v, KodaXBudgetDisclosureZone as w, KodaXBudgetExtensionRequest as x, KodaXChildAgentResult as y, KodaXChildContextBundle as z };
|
|
@@ -5,7 +5,12 @@
|
|
|
5
5
|
* `Mcp*` names here; the `KodaXMcp*` aliases continue to re-export from
|
|
6
6
|
* `@kodax-ai/coding` for backward compatibility.
|
|
7
7
|
*/
|
|
8
|
-
|
|
8
|
+
/**
|
|
9
|
+
* Transport config kind. `http` is a compatibility alias used by other MCP
|
|
10
|
+
* clients' config files; KodaX auto-detects Streamable HTTP first, then falls
|
|
11
|
+
* back to the legacy HTTP+SSE transport. It is not a distinct wire protocol.
|
|
12
|
+
*/
|
|
13
|
+
type McpTransportKind = 'stdio' | 'sse' | 'streamable-http' | 'http';
|
|
9
14
|
type McpConnectMode = 'lazy' | 'prewarm' | 'disabled';
|
|
10
15
|
interface McpServerConfig {
|
|
11
16
|
/** Transport type. Defaults to 'stdio' when omitted. */
|
|
@@ -18,19 +23,24 @@ interface McpServerConfig {
|
|
|
18
23
|
cwd?: string;
|
|
19
24
|
/** stdio: extra environment variables for the spawned process. */
|
|
20
25
|
env?: Record<string, string>;
|
|
21
|
-
/** sse / streamable-http: server endpoint URL. */
|
|
26
|
+
/** sse / streamable-http / http(auto): server endpoint URL. */
|
|
22
27
|
url?: string;
|
|
23
|
-
/** sse / streamable-http: extra HTTP headers (e.g. Authorization). */
|
|
28
|
+
/** sse / streamable-http / http(auto): extra HTTP headers (e.g. Authorization). */
|
|
24
29
|
headers?: Record<string, string>;
|
|
25
30
|
connect?: McpConnectMode;
|
|
26
31
|
startupTimeoutMs?: number;
|
|
27
32
|
requestTimeoutMs?: number;
|
|
28
|
-
/**
|
|
33
|
+
/**
|
|
34
|
+
* OAuth 2.0 for authenticated MCP servers. All endpoint fields are optional:
|
|
35
|
+
* when omitted, KodaX discovers them at runtime (RFC 9728 → RFC 8414) and
|
|
36
|
+
* dynamically registers a client (RFC 7591). Provide them only to pin a
|
|
37
|
+
* pre-registered client / static endpoints.
|
|
38
|
+
*/
|
|
29
39
|
auth?: {
|
|
30
40
|
readonly type: 'oauth2';
|
|
31
|
-
readonly clientId
|
|
32
|
-
readonly authorizationUrl
|
|
33
|
-
readonly tokenUrl
|
|
41
|
+
readonly clientId?: string;
|
|
42
|
+
readonly authorizationUrl?: string;
|
|
43
|
+
readonly tokenUrl?: string;
|
|
34
44
|
readonly scopes?: readonly string[];
|
|
35
45
|
readonly redirectPort?: number;
|
|
36
46
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { n as KodaXMessage } from './types.d-Cf-GCzac.js';
|
|
2
|
-
import { f as AgentMessage,
|
|
2
|
+
import { f as AgentMessage, aj as SessionEntry, ah as Session, ak as SessionExtension, p as CompactionDetails, x as FileOperations } from './types.d-BCnbYG_A.js';
|
|
3
3
|
import { s as KodaXSessionLineage, i as KodaXJsonValue, a as KodaXCompactMemorySeed, o as KodaXSessionEntry, z as KodaXSessionTreeNode, r as KodaXSessionLabelEntry, q as KodaXSessionGoalEntry, v as KodaXSessionNavigationOptions, k as KodaXSessionArtifactLedgerEntry } from './types.d-B_MIIApc.js';
|
|
4
4
|
|
|
5
5
|
/**
|