@kodax-ai/kodax 0.7.63 → 0.7.66

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 (80) hide show
  1. package/CHANGELOG.md +2300 -2204
  2. package/README.md +79 -7
  3. package/README_CN.md +52 -3
  4. package/dist/chunks/{agent-SL444XLN.js → agent-KER4WDNO.js} +1 -1
  5. package/dist/chunks/argument-completer-HK3MHA3K.js +2 -0
  6. package/dist/chunks/{chunk-ARUWXX25.js → chunk-35P7QL2Q.js} +1 -1
  7. package/dist/chunks/chunk-3HKBBY74.js +339 -0
  8. package/dist/chunks/chunk-AKBH2EEE.js +8 -0
  9. package/dist/chunks/{chunk-KCFVGXVK.js → chunk-ALS32RNZ.js} +1 -1
  10. package/dist/chunks/chunk-MHRN2LQV.js +328 -0
  11. package/dist/chunks/{chunk-HP4FXMEM.js → chunk-NBQW7PNZ.js} +2 -2
  12. package/dist/chunks/{chunk-S4GVQO3W.js → chunk-O7N22GJ3.js} +1 -1
  13. package/dist/chunks/chunk-ONUPGMER.js +2 -0
  14. package/dist/chunks/{chunk-ZL5CEANW.js → chunk-PZTG2C33.js} +1 -1
  15. package/dist/chunks/{chunk-4MIHVNB7.js → chunk-QAQ2HNXD.js} +112 -112
  16. package/dist/chunks/{chunk-6OZ5KWG3.js → chunk-QJJKMNZF.js} +1 -1
  17. package/dist/chunks/chunk-QJVZZSEO.js +56 -0
  18. package/dist/chunks/chunk-TLJGOKBT.js +729 -0
  19. package/dist/chunks/{chunk-7MPU7TP6.js → chunk-VS4CDDEF.js} +243 -243
  20. package/dist/chunks/chunk-WBBEJIAY.js +306 -0
  21. package/dist/chunks/{chunk-L3MF5V64.js → chunk-WMIZCY2J.js} +1 -1
  22. package/dist/chunks/{chunk-UA744TZM.js → chunk-YRBNXFHY.js} +1 -1
  23. package/dist/chunks/compaction-config-7GMUFNPB.js +2 -0
  24. package/dist/chunks/{construction-bootstrap-EFZBONTK.js → construction-bootstrap-3XDS2D5K.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-4YAYT2TO.js +2 -0
  29. package/dist/chunks/host-KG3456QP.js +2 -0
  30. package/dist/chunks/{paste-FDYM7SZX.js → paste-C33GZQV5.js} +1 -1
  31. package/dist/chunks/run-manager-6CAH3KTA.js +2 -0
  32. package/dist/chunks/utils-OT5ENFUL.js +2 -0
  33. package/dist/constructed-handler-worker.js +2 -0
  34. package/dist/index.d.ts +21 -10
  35. package/dist/index.js +6 -6
  36. package/dist/kodax_cli.js +1116 -1089
  37. package/dist/runtime-worker.js +2843 -0
  38. package/dist/sdk-agent.d.ts +27 -8
  39. package/dist/sdk-agent.js +1 -1
  40. package/dist/sdk-coding.d.ts +76 -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 +197 -183
  47. package/dist/sdk-repl.js +2 -2
  48. package/dist/sdk-runtime.d.ts +982 -0
  49. package/dist/sdk-runtime.js +2 -0
  50. package/dist/sdk-session.d.ts +3 -3
  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-BjkITAva.d.ts} +142 -3
  55. package/dist/types-chunks/{run-manager.d-CYTnWhZY.d.ts → capsule.d-hVhPNkHd.d.ts} +5 -92
  56. package/dist/types-chunks/commands.d-C3B1TdGM.d.ts +213 -0
  57. package/dist/types-chunks/{types.d-1CnTg7Sd.d.ts → guardrail.d-C_Siraua.d.ts} +3 -128
  58. package/dist/types-chunks/{guardrail.d-MR6LwMB2.d.ts → guardrail.d-wk-s0psS.d.ts} +2 -2
  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-jtREVfEq.d.ts +596 -0
  62. package/dist/types-chunks/run-manager.d-CFknOfo1.d.ts +91 -0
  63. package/dist/types-chunks/{sdk-session-RBSBBKol.d.ts → sdk-session-CLqyfAmf.d.ts} +8 -306
  64. package/dist/types-chunks/types.d-BMLxKV69.d.ts +128 -0
  65. package/dist/types-chunks/types.d-CUN_bZU7.d.ts +975 -0
  66. package/dist/types-chunks/{utils.d-C14jZ9ZM.d.ts → utils.d-C1rpoeDh.d.ts} +84 -72
  67. package/package.json +7 -1
  68. package/dist/chunks/argument-completer-EN63ZVJK.js +0 -2
  69. package/dist/chunks/chunk-KHICMJIR.js +0 -310
  70. package/dist/chunks/chunk-LGR7ACBQ.js +0 -326
  71. package/dist/chunks/chunk-RR7W7UF6.js +0 -341
  72. package/dist/chunks/chunk-UGTK2JIJ.js +0 -731
  73. package/dist/chunks/chunk-V4WSBIXB.js +0 -2
  74. package/dist/chunks/chunk-VSWROENP.js +0 -52
  75. package/dist/chunks/compaction-config-4VIONMFB.js +0 -2
  76. package/dist/chunks/dist-EDF2YUF6.js +0 -2
  77. package/dist/chunks/host-J4HPDLFC.js +0 -2
  78. package/dist/chunks/run-manager-ZVSW2OWM.js +0 -2
  79. package/dist/chunks/utils-5HDLYTZJ.js +0 -2
  80. 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-BjkITAva.js';
3
+ import { ao as KodaXSessionUiHistoryItem, af as KodaXSessionLineage, a6 as KodaXSessionArtifactLedgerEntry, V as KodaXExtensionSessionState, U as KodaXExtensionSessionRecord, ak as KodaXSessionRuntimeInfo, co as WorkflowProcessSource } from './process.d-CY2g03Mb.js';
4
+ import { A as AgentsFile, f as AutoModeStats, l as KodaXMcpServersConfig } from './guardrail.d-wk-s0psS.js';
6
5
  import * as readline from 'readline';
6
+ import { f as PermissionMode } from './public-api.d-jtREVfEq.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
@@ -293,12 +273,50 @@ interface CommandWorkflowInvocationRequest {
293
273
  displayName: string;
294
274
  processSource?: WorkflowProcessSource;
295
275
  }
296
- type CommandResult$1 = boolean | CommandResultData;
297
- type CommandHandler = (args: string[], context: InteractiveContext, callbacks: CommandCallbacks, currentConfig: CurrentConfig) => Promise<CommandResult$1 | void>;
276
+ type CommandResult = boolean | CommandResultData;
277
+ type CommandHandler = (args: string[], context: InteractiveContext, callbacks: CommandCallbacks, currentConfig: CurrentConfig) => Promise<CommandResult | void>;
278
+ interface CommandDefinition {
279
+ name: string;
280
+ aliases?: string[];
281
+ description: string;
282
+ usage?: string;
283
+ detailedHelp?: () => void;
284
+ handler: CommandHandler;
285
+ source?: CommandSource;
286
+ priority?: CommandPriority;
287
+ location?: 'user' | 'project' | 'path';
288
+ path?: string;
289
+ userInvocable?: boolean;
290
+ disableModelInvocation?: boolean;
291
+ allowedTools?: string;
292
+ context?: 'fork';
293
+ agent?: string;
294
+ argumentHint?: string;
295
+ model?: string;
296
+ hooks?: CommandHooks;
297
+ frontmatter?: Record<string, unknown>;
298
+ }
299
+ interface CommandInfo {
300
+ name: string;
301
+ aliases?: string[];
302
+ description: string;
303
+ source: CommandSource;
304
+ usage?: string;
305
+ priority?: CommandPriority;
306
+ location?: 'user' | 'project' | 'path';
307
+ path?: string;
308
+ userInvocable?: boolean;
309
+ disableModelInvocation?: boolean;
310
+ allowedTools?: string;
311
+ context?: 'fork';
312
+ agent?: string;
313
+ argumentHint?: string;
314
+ model?: string;
315
+ }
298
316
  /**
299
317
  * Legacy command shape used by the existing REPL command table.
300
318
  */
301
- interface Command$1 {
319
+ interface Command {
302
320
  name: string;
303
321
  aliases?: string[];
304
322
  description: string;
@@ -320,32 +338,6 @@ interface Command$1 {
320
338
  frontmatter?: Record<string, unknown>;
321
339
  }
322
340
 
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
341
  /**
350
342
  * KodaX CLI Utilities
351
343
  * CLI 灞傚伐鍏峰嚱鏁?
@@ -420,6 +412,7 @@ declare function isProviderConfigured(name: string): boolean;
420
412
  declare function loadConfig(): {
421
413
  provider?: string;
422
414
  model?: string;
415
+ runtimeMode?: 'embedded' | 'daemon';
423
416
  effort?: string;
424
417
  planModeEffort?: string;
425
418
  thinking?: boolean;
@@ -520,6 +513,7 @@ declare function prepareRuntimeConfig(): ReturnType<typeof loadConfig>;
520
513
  declare function saveConfig(config: {
521
514
  provider?: string;
522
515
  model?: string;
516
+ runtimeMode?: 'embedded' | 'daemon';
523
517
  effort?: string;
524
518
  planModeEffort?: string;
525
519
  thinking?: boolean;
@@ -561,6 +555,24 @@ declare function saveConfig(config: {
561
555
  maxConcurrency?: number;
562
556
  };
563
557
  }): void;
558
+ declare function resolveRuntimeProviderSelection(input: {
559
+ explicitProvider?: string;
560
+ environmentProvider?: string;
561
+ configuredProvider?: string;
562
+ defaultProvider: string;
563
+ }): string;
564
+ declare function resolveRuntimeModelSelection(input: {
565
+ explicitProvider?: string;
566
+ environmentProvider?: string;
567
+ explicitModel?: string;
568
+ configuredProvider?: string;
569
+ configuredModel?: string;
570
+ }): string | undefined;
571
+ declare function resolveRuntimeEffortSelection(input: {
572
+ explicitEffort?: string;
573
+ environmentEffort?: string;
574
+ configuredEffort?: string;
575
+ }): string | undefined;
564
576
  /**
565
577
  * Get git root directory.
566
578
  *
@@ -578,5 +590,5 @@ declare function saveConfig(config: {
578
590
  declare function getGitRoot(cwd?: string): Promise<string | null>;
579
591
  declare function rateLimitedCall<T>(fn: () => Promise<T>): Promise<T>;
580
592
 
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 };
593
+ 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 };
594
+ 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 };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kodax-ai/kodax",
3
- "version": "0.7.63",
3
+ "version": "0.7.66",
4
4
  "description": "KodaX lightweight coding agent - TypeScript implementation with 15 built-in LLM provider aliases, published as a Node-free single-file CLI and SDK",
5
5
  "type": "module",
6
6
  "private": false,
@@ -52,6 +52,10 @@
52
52
  "types": "./dist/sdk-session.d.ts",
53
53
  "import": "./dist/sdk-session.js"
54
54
  },
55
+ "./runtime": {
56
+ "types": "./dist/sdk-runtime.d.ts",
57
+ "import": "./dist/sdk-runtime.js"
58
+ },
55
59
  "./package.json": "./package.json"
56
60
  },
57
61
  "scripts": {
@@ -157,6 +161,8 @@
157
161
  "dist/chunks",
158
162
  "dist/provider-capabilities.json",
159
163
  "dist/semantic-worker.js",
164
+ "dist/runtime-worker.js",
165
+ "dist/constructed-handler-worker.js",
160
166
  "dist/types-chunks",
161
167
  "scripts/kodax-bin.cjs",
162
168
  "scripts/production-env.cjs",
@@ -1,2 +0,0 @@
1
- // @kodax-ai/kodax — bundled distribution. See docs/ADR.md ADR-022 + ADR-024.
2
- import{Aa as b,za as a}from"./chunk-7MPU7TP6.js";import"./chunk-L3MF5V64.js";import"./chunk-VSWROENP.js";import"./chunk-4MIHVNB7.js";import"./chunk-KCFVGXVK.js";import"./chunk-HP4FXMEM.js";import"./chunk-LGR7ACBQ.js";import"./chunk-D6QVXQNI.js";import"./chunk-UA744TZM.js";import"./chunk-RR7W7UF6.js";import"./chunk-S4GVQO3W.js";import"./chunk-UGTK2JIJ.js";import"./chunk-ZL5CEANW.js";import"./chunk-V4WSBIXB.js";export{a as ArgumentCompleter,b as createArgumentCompleter};