@kodax-ai/kodax 0.7.63 → 0.7.67

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 (84) hide show
  1. package/CHANGELOG.md +2390 -2189
  2. package/README.md +118 -16
  3. package/README_CN.md +78 -12
  4. package/dist/chunks/{agent-SL444XLN.js → agent-E4V5SLX6.js} +1 -1
  5. package/dist/chunks/argument-completer-N6RT5KYT.js +2 -0
  6. package/dist/chunks/{chunk-ARUWXX25.js → chunk-35P7QL2Q.js} +1 -1
  7. package/dist/chunks/chunk-AKMXJSGM.js +56 -0
  8. package/dist/chunks/{chunk-L3MF5V64.js → chunk-CW32NQFO.js} +1 -1
  9. package/dist/chunks/{chunk-KCFVGXVK.js → chunk-DEICMTHO.js} +9 -9
  10. package/dist/chunks/{chunk-7MPU7TP6.js → chunk-EN3O2C43.js} +270 -270
  11. package/dist/chunks/chunk-KBBGDRER.js +22 -0
  12. package/dist/chunks/chunk-NVDK375I.js +729 -0
  13. package/dist/chunks/{chunk-S4GVQO3W.js → chunk-O7N22GJ3.js} +1 -1
  14. package/dist/chunks/chunk-ONUPGMER.js +2 -0
  15. package/dist/chunks/{chunk-ZL5CEANW.js → chunk-PZTG2C33.js} +1 -1
  16. package/dist/chunks/chunk-QI6SQ2UQ.js +306 -0
  17. package/dist/chunks/{chunk-6OZ5KWG3.js → chunk-QJJKMNZF.js} +1 -1
  18. package/dist/chunks/chunk-RS2GAABJ.js +328 -0
  19. package/dist/chunks/chunk-W2XMNYLK.js +15 -0
  20. package/dist/chunks/chunk-WCSSXBHR.js +419 -0
  21. package/dist/chunks/chunk-YH5BTUQO.js +343 -0
  22. package/dist/chunks/{chunk-UA744TZM.js → chunk-YRBNXFHY.js} +1 -1
  23. package/dist/chunks/compaction-config-56NO42ZI.js +2 -0
  24. package/dist/chunks/{construction-bootstrap-EFZBONTK.js → construction-bootstrap-GLEHQ2KB.js} +1 -1
  25. package/dist/chunks/{devtools-4CRULTR2.js → devtools-CD6KSIHE.js} +1 -1
  26. package/dist/chunks/{devtools-YINBSZC7.js → devtools-XR5F2C6T.js} +1 -1
  27. package/dist/chunks/{dist-73L4OYPD.js → dist-4PXB7U22.js} +1 -1
  28. package/dist/chunks/dist-4UIRSSFS.js +2 -0
  29. package/dist/chunks/host-DMREFNSO.js +2 -0
  30. package/dist/chunks/{paste-FDYM7SZX.js → paste-C33GZQV5.js} +1 -1
  31. package/dist/chunks/run-manager-P5XMSGZ7.js +2 -0
  32. package/dist/chunks/utils-JENPFKAE.js +2 -0
  33. package/dist/constructed-handler-worker.js +2 -0
  34. package/dist/index.d.ts +25 -11
  35. package/dist/index.js +6 -6
  36. package/dist/kodax_cli.js +1282 -1232
  37. package/dist/runtime-worker.js +2872 -0
  38. package/dist/sdk-agent.d.ts +46 -10
  39. package/dist/sdk-agent.js +1 -1
  40. package/dist/sdk-coding.d.ts +337 -1020
  41. package/dist/sdk-coding.js +1 -1
  42. package/dist/sdk-llm.js +1 -1
  43. package/dist/sdk-mcp.d.ts +2 -1
  44. package/dist/sdk-mcp.js +1 -1
  45. package/dist/sdk-media.js +1 -1
  46. package/dist/sdk-repl.d.ts +208 -185
  47. package/dist/sdk-repl.js +2 -2
  48. package/dist/sdk-runtime.d.ts +1070 -0
  49. package/dist/sdk-runtime.js +2 -0
  50. package/dist/sdk-session.d.ts +4 -4
  51. package/dist/sdk-session.js +1 -1
  52. package/dist/sdk-skills.js +1 -1
  53. package/dist/semantic-worker.js +191 -10
  54. package/dist/types-chunks/{bash-prefix-extractor.d-CZW9fRoa.d.ts → bash-prefix-extractor.d-D57Gt6n8.d.ts} +186 -12
  55. package/dist/types-chunks/{run-manager.d-CYTnWhZY.d.ts → capsule.d-BZmqu_HL.d.ts} +5 -92
  56. package/dist/types-chunks/commands.d-Cg26ud-Y.d.ts +213 -0
  57. package/dist/types-chunks/{types.d-1CnTg7Sd.d.ts → guardrail.d-Ds7JHxR1.d.ts} +3 -128
  58. package/dist/types-chunks/{guardrail.d-MR6LwMB2.d.ts → guardrail.d-vSaBe64I.d.ts} +3 -3
  59. package/dist/types-chunks/{manager.d-DBD7SOTT.d.ts → manager.d-Zum9cGHU.d.ts} +3 -173
  60. package/dist/types-chunks/oauth-login.d-Bgb4rdLN.d.ts +174 -0
  61. package/dist/types-chunks/public-api.d-CPBMPDiU.d.ts +602 -0
  62. package/dist/types-chunks/run-manager.d-lnwnfyNC.d.ts +91 -0
  63. package/dist/types-chunks/{sdk-session-RBSBBKol.d.ts → sdk-session-ByoMLoUS.d.ts} +8 -306
  64. package/dist/types-chunks/{process.d-CY2g03Mb.d.ts → types.d-DG9B4SMm.d.ts} +369 -4
  65. package/dist/types-chunks/types.d-DU9lLkmE.d.ts +128 -0
  66. package/dist/types-chunks/types.d-DYv3a1ka.d.ts +975 -0
  67. package/dist/types-chunks/{utils.d-C14jZ9ZM.d.ts → utils.d-DMI-9GTR.d.ts} +88 -72
  68. package/docs/SDK_EMBEDDER_GUIDE.md +3079 -0
  69. package/package.json +8 -1
  70. package/dist/chunks/argument-completer-EN63ZVJK.js +0 -2
  71. package/dist/chunks/chunk-4MIHVNB7.js +0 -405
  72. package/dist/chunks/chunk-HP4FXMEM.js +0 -18
  73. package/dist/chunks/chunk-KHICMJIR.js +0 -310
  74. package/dist/chunks/chunk-LGR7ACBQ.js +0 -326
  75. package/dist/chunks/chunk-RR7W7UF6.js +0 -341
  76. package/dist/chunks/chunk-UGTK2JIJ.js +0 -731
  77. package/dist/chunks/chunk-V4WSBIXB.js +0 -2
  78. package/dist/chunks/chunk-VSWROENP.js +0 -52
  79. package/dist/chunks/compaction-config-4VIONMFB.js +0 -2
  80. package/dist/chunks/dist-EDF2YUF6.js +0 -2
  81. package/dist/chunks/host-J4HPDLFC.js +0 -2
  82. package/dist/chunks/run-manager-ZVSW2OWM.js +0 -2
  83. package/dist/chunks/utils-5HDLYTZJ.js +0 -2
  84. package/dist/types-chunks/storage.d-C6kkAEch.d.ts +0 -280
@@ -1,32 +1,11 @@
1
- import { R as KodaXOptions, w as KodaXContextTokenSnapshot, a7 as KodaXSkillDynamicContextPolicy, m as KodaXAgentMode, W as KodaXRepoIntelligenceMode, a8 as KodaXSkillInvocationContext } from './bash-prefix-extractor.d-CZW9fRoa.js';
2
- import { c as SessionStorage$1, b as PermissionMode } from './storage.d-C6kkAEch.js';
3
- import { ao as KodaXSessionUiHistoryItem, af as KodaXSessionLineage, a6 as KodaXSessionArtifactLedgerEntry, V as KodaXExtensionSessionState, U as KodaXExtensionSessionRecord, ak as KodaXSessionRuntimeInfo, am as KodaXSessionStorage, aa as KodaXSessionData, co as WorkflowProcessSource } from './process.d-CY2g03Mb.js';
4
- import { j as KodaXMessage, E as KodaXReasoningMode, o as KodaXProviderCapabilityProfile, d as KodaXCustomProviderConfig } from './types.d-Bp4Lm1jv.js';
5
- import { A as AgentsFile, f as AutoModeStats, l as KodaXMcpServersConfig } from './guardrail.d-MR6LwMB2.js';
1
+ import { j as KodaXMessage, E as KodaXReasoningMode, d as KodaXCustomProviderConfig, o as KodaXProviderCapabilityProfile } from './types.d-Bp4Lm1jv.js';
2
+ import { I as KodaXContextTokenSnapshot, ad as KodaXSkillDynamicContextPolicy, r as KodaXAgentMode, a0 as KodaXRepoIntelligenceMode, X as KodaXOptions, ae as KodaXSkillInvocationContext } from './bash-prefix-extractor.d-D57Gt6n8.js';
3
+ import { bb as KodaXSessionUiHistoryItem, b2 as KodaXSessionLineage, aV as KodaXSessionArtifactLedgerEntry, aI as KodaXExtensionSessionState, aH as KodaXExtensionSessionRecord, b7 as KodaXSessionRuntimeInfo, dd as WorkflowProcessSource } from './types.d-DG9B4SMm.js';
4
+ import { A as AgentsFile, f as AutoModeStats, l as KodaXMcpServersConfig } from './guardrail.d-vSaBe64I.js';
6
5
  import * as readline from 'readline';
6
+ import { f as PermissionMode } from './public-api.d-CPBMPDiU.js';
7
7
  import { SpawnSyncReturns } from 'child_process';
8
8
 
9
- /**
10
- * InkREPL - Ink-based REPL Adapter
11
- *
12
- * Bridges Ink UI components with existing KodaX command processing logic.
13
- * Replaces the Node.js readline-based input with Ink's React components.
14
- *
15
- * Architecture based on Gemini CLI:
16
- * - Uses UIStateContext for global state
17
- * - Uses KeypressContext for priority-based keyboard handling
18
- * - Uses StreamingContext for streaming response management
19
- */
20
-
21
- interface InkREPLOptions extends KodaXOptions {
22
- storage?: SessionStorage$1;
23
- hardExitOnClose?: boolean;
24
- }
25
- /**
26
- * Run Ink-based interactive mode
27
- */
28
- declare function runInkInteractiveMode(options: InkREPLOptions): Promise<void>;
29
-
30
9
  /**
31
10
  * KodaX Interactive Context Management - 交互式上下文管理
32
11
  */
@@ -63,21 +42,6 @@ declare function createInteractiveContext(options: {
63
42
  }): Promise<InteractiveContext>;
64
43
  declare function touchContext(context: InteractiveContext): void;
65
44
 
66
- interface SessionStorage extends KodaXSessionStorage {
67
- list(gitRoot?: string): Promise<Array<{
68
- id: string;
69
- title: string;
70
- msgCount: number;
71
- tag?: string;
72
- runtimeInfo?: KodaXSessionData['runtimeInfo'];
73
- }>>;
74
- }
75
- interface RepLOptions extends KodaXOptions {
76
- storage?: SessionStorage;
77
- }
78
- declare function runInteractiveMode(options: RepLOptions): Promise<void>;
79
- declare function processSpecialSyntax(input: string): Promise<string>;
80
-
81
45
  /**
82
46
  * UI Context Interface - UI 交互上下文接口
83
47
  *
@@ -168,6 +132,21 @@ interface CurrentConfig {
168
132
  /** FEATURE_102 Phase 3 — cross-provider child fallback chain. */
169
133
  fallbackProviders?: string[];
170
134
  }
135
+ type RuntimeSurfaceMode = 'embedded' | 'daemon';
136
+ interface RuntimeSurfaceStatus {
137
+ readonly mode: RuntimeSurfaceMode;
138
+ readonly runtimeId: string;
139
+ readonly profile: string;
140
+ readonly startedAt?: string;
141
+ readonly endpoint?: string;
142
+ readonly health?: string;
143
+ readonly sessions?: number;
144
+ readonly runs?: number;
145
+ readonly activeRuns?: number;
146
+ readonly queuedRuns?: number;
147
+ readonly pendingPermissions?: number;
148
+ readonly workflows?: number;
149
+ }
171
150
  type SessionLoadStatus = 'loaded' | 'missing' | 'blocked';
172
151
  type SessionBranchSwitchStatus = 'switched' | 'missing' | 'blocked';
173
152
  type SessionForkStatus = 'forked' | 'failed' | 'blocked';
@@ -247,6 +226,7 @@ interface CommandCallbacks {
247
226
  recoverSession?: (prompt?: string) => Promise<SessionRecoverStatus>;
248
227
  rewindSession?: (selector?: string) => Promise<SessionRewindStatus>;
249
228
  getCostReport?: () => string | null;
229
+ getRuntimeStatus?: () => Promise<RuntimeSurfaceStatus | undefined>;
250
230
  /**
251
231
  * FEATURE_092 phase 2b.8: read-only stats accessor for the auto-mode
252
232
  * classifier guardrail. Returns undefined when the guardrail hasn't been
@@ -292,13 +272,55 @@ interface CommandWorkflowInvocationRequest {
292
272
  source: 'command' | 'natural-language';
293
273
  displayName: string;
294
274
  processSource?: WorkflowProcessSource;
275
+ builtin?: {
276
+ name: string;
277
+ args: unknown;
278
+ };
279
+ }
280
+ type CommandResult = boolean | CommandResultData;
281
+ type CommandHandler = (args: string[], context: InteractiveContext, callbacks: CommandCallbacks, currentConfig: CurrentConfig) => Promise<CommandResult | void>;
282
+ interface CommandDefinition {
283
+ name: string;
284
+ aliases?: string[];
285
+ description: string;
286
+ usage?: string;
287
+ detailedHelp?: () => void;
288
+ handler: CommandHandler;
289
+ source?: CommandSource;
290
+ priority?: CommandPriority;
291
+ location?: 'user' | 'project' | 'path';
292
+ path?: string;
293
+ userInvocable?: boolean;
294
+ disableModelInvocation?: boolean;
295
+ allowedTools?: string;
296
+ context?: 'fork';
297
+ agent?: string;
298
+ argumentHint?: string;
299
+ model?: string;
300
+ hooks?: CommandHooks;
301
+ frontmatter?: Record<string, unknown>;
302
+ }
303
+ interface CommandInfo {
304
+ name: string;
305
+ aliases?: string[];
306
+ description: string;
307
+ source: CommandSource;
308
+ usage?: string;
309
+ priority?: CommandPriority;
310
+ location?: 'user' | 'project' | 'path';
311
+ path?: string;
312
+ userInvocable?: boolean;
313
+ disableModelInvocation?: boolean;
314
+ allowedTools?: string;
315
+ context?: 'fork';
316
+ agent?: string;
317
+ argumentHint?: string;
318
+ model?: string;
295
319
  }
296
- type CommandResult$1 = boolean | CommandResultData;
297
- type CommandHandler = (args: string[], context: InteractiveContext, callbacks: CommandCallbacks, currentConfig: CurrentConfig) => Promise<CommandResult$1 | void>;
298
320
  /**
299
321
  * Legacy command shape used by the existing REPL command table.
300
322
  */
301
- interface Command$1 {
323
+ interface Command {
302
324
  name: string;
303
325
  aliases?: string[];
304
326
  description: string;
@@ -320,32 +342,6 @@ interface Command$1 {
320
342
  frontmatter?: Record<string, unknown>;
321
343
  }
322
344
 
323
- /**
324
- * KodaX Interactive Command System
325
- */
326
-
327
- type Command = Command$1;
328
- declare const BUILTIN_COMMANDS: Command[];
329
- declare function parseCommand(input: string): {
330
- command: string;
331
- args: string[];
332
- skillInvocation?: {
333
- name: string;
334
- };
335
- } | null;
336
- type CommandResult = boolean | {
337
- skillContent?: string;
338
- invocation?: CommandInvocationRequest;
339
- workflow?: CommandWorkflowInvocationRequest;
340
- };
341
- declare function executeCommand(parsed: {
342
- command: string;
343
- args: string[];
344
- skillInvocation?: {
345
- name: string;
346
- };
347
- }, context: InteractiveContext, callbacks: CommandCallbacks, currentConfig: CurrentConfig): Promise<CommandResult>;
348
-
349
345
  /**
350
346
  * KodaX CLI Utilities
351
347
  * CLI 灞傚伐鍏峰嚱鏁?
@@ -420,6 +416,7 @@ declare function isProviderConfigured(name: string): boolean;
420
416
  declare function loadConfig(): {
421
417
  provider?: string;
422
418
  model?: string;
419
+ runtimeMode?: 'embedded' | 'daemon';
423
420
  effort?: string;
424
421
  planModeEffort?: string;
425
422
  thinking?: boolean;
@@ -520,6 +517,7 @@ declare function prepareRuntimeConfig(): ReturnType<typeof loadConfig>;
520
517
  declare function saveConfig(config: {
521
518
  provider?: string;
522
519
  model?: string;
520
+ runtimeMode?: 'embedded' | 'daemon';
523
521
  effort?: string;
524
522
  planModeEffort?: string;
525
523
  thinking?: boolean;
@@ -561,6 +559,24 @@ declare function saveConfig(config: {
561
559
  maxConcurrency?: number;
562
560
  };
563
561
  }): void;
562
+ declare function resolveRuntimeProviderSelection(input: {
563
+ explicitProvider?: string;
564
+ environmentProvider?: string;
565
+ configuredProvider?: string;
566
+ defaultProvider: string;
567
+ }): string;
568
+ declare function resolveRuntimeModelSelection(input: {
569
+ explicitProvider?: string;
570
+ environmentProvider?: string;
571
+ explicitModel?: string;
572
+ configuredProvider?: string;
573
+ configuredModel?: string;
574
+ }): string | undefined;
575
+ declare function resolveRuntimeEffortSelection(input: {
576
+ explicitEffort?: string;
577
+ environmentEffort?: string;
578
+ configuredEffort?: string;
579
+ }): string | undefined;
564
580
  /**
565
581
  * Get git root directory.
566
582
  *
@@ -578,5 +594,5 @@ declare function saveConfig(config: {
578
594
  declare function getGitRoot(cwd?: string): Promise<string | null>;
579
595
  declare function rateLimitedCall<T>(fn: () => Promise<T>): Promise<T>;
580
596
 
581
- export { touchContext as A, BUILTIN_COMMANDS as B, KODAX_CONFIG_FILE as K, PREVIEW_MAX_LENGTH as P, KODAX_DIR as e, KODAX_EXAMPLE_CONFIG_FILE as f, KODAX_SESSIONS_DIR as g, KODAX_VERSION as h, createInteractiveContext as i, ensureExampleConfigFile as j, executeCommand as k, getGitRoot as l, getProviderList as m, getProviderModel as n, getVersion as o, hydrateProcessEnvFromShell as p, isProviderConfigured as q, loadConfig as r, parseCommand as s, prepareRuntimeConfig as t, processSpecialSyntax as u, rateLimitedCall as v, registerConfiguredCustomProviders as w, runInkInteractiveMode as x, runInteractiveMode as y, saveConfig as z };
582
- export type { Command as C, InkREPLOptions as I, RepLOptions as R, CommandCallbacks as a, CurrentConfig as b, InteractiveContext as c, InteractiveMode as d };
597
+ export { resolveRuntimeModelSelection as A, resolveRuntimeProviderSelection as B, saveConfig as D, touchContext as E, KODAX_CONFIG_FILE as K, PREVIEW_MAX_LENGTH as P, KODAX_DIR as i, KODAX_EXAMPLE_CONFIG_FILE as j, KODAX_SESSIONS_DIR as k, KODAX_VERSION as l, createInteractiveContext as n, ensureExampleConfigFile as o, getGitRoot as p, getProviderList as q, getProviderModel as r, getVersion as s, hydrateProcessEnvFromShell as t, isProviderConfigured as u, loadConfig as v, prepareRuntimeConfig as w, rateLimitedCall as x, registerConfiguredCustomProviders as y, resolveRuntimeEffortSelection as z };
598
+ export type { Command as C, InteractiveContext as I, RuntimeSurfaceMode as R, CommandCallbacks as a, CommandDefinition as b, CommandInfo as c, CommandInvocationRequest as d, CommandSource as e, CommandWorkflowInvocationRequest as f, CurrentConfig as g, InteractiveMode as h, RuntimeSurfaceStatus as m };