@kodax-ai/kodax 0.7.76 → 0.7.78

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 (130) hide show
  1. package/CHANGELOG.md +758 -371
  2. package/LICENSE +158 -158
  3. package/README.md +1702 -1508
  4. package/README_CN.md +1019 -869
  5. package/config-templates/config.example.jsonc +86 -4
  6. package/config-templates/integrations/a2a.example.jsonc +98 -98
  7. package/config-templates/integrations/extensions.example.jsonc +7 -7
  8. package/config-templates/integrations/mcp.example.jsonc +16 -16
  9. package/dist/builtin/code-review/SKILL.md +22 -22
  10. package/dist/builtin/skill-creator/scripts/aggregate-benchmark.d.ts +46 -46
  11. package/dist/builtin/skill-creator/scripts/analyze-benchmark.d.ts +46 -46
  12. package/dist/builtin/skill-creator/scripts/compare-runs.d.ts +62 -62
  13. package/dist/builtin/skill-creator/scripts/generate-review.d.ts +33 -33
  14. package/dist/builtin/skill-creator/scripts/grade-evals.d.ts +73 -73
  15. package/dist/builtin/skill-creator/scripts/improve-description.d.ts +23 -23
  16. package/dist/builtin/skill-creator/scripts/init-skill.d.ts +14 -14
  17. package/dist/builtin/skill-creator/scripts/install-skill.d.ts +29 -29
  18. package/dist/builtin/skill-creator/scripts/package-skill.d.ts +38 -38
  19. package/dist/builtin/skill-creator/scripts/quick-validate.d.ts +8 -8
  20. package/dist/builtin/skill-creator/scripts/run-eval.d.ts +66 -66
  21. package/dist/builtin/skill-creator/scripts/run-loop.d.ts +49 -49
  22. package/dist/builtin/skill-creator/scripts/run-trigger-eval.d.ts +58 -58
  23. package/dist/chunks/agent-ASP4MS3X.js +2 -0
  24. package/dist/chunks/argument-completer-JYQ7FX3W.js +2 -0
  25. package/dist/chunks/chunk-2CFHBKRE.js +5 -0
  26. package/dist/chunks/chunk-35PPHOQ2.js +292 -0
  27. package/dist/chunks/chunk-43QNNDHR.js +29 -0
  28. package/dist/chunks/chunk-5BNQXXGY.js +1 -0
  29. package/dist/chunks/chunk-5GO6FH7L.js +458 -0
  30. package/dist/chunks/chunk-5NDCSFOP.js +78 -0
  31. package/dist/chunks/chunk-6FOJVETH.js +22 -0
  32. package/dist/chunks/chunk-6XM4B6K2.js +48 -0
  33. package/dist/chunks/chunk-6YZUE6NC.js +240 -0
  34. package/dist/chunks/{chunk-RDXRM3UI.js → chunk-7OEBJGHK.js} +1 -1
  35. package/dist/chunks/chunk-KQLQYHWU.js +386 -0
  36. package/dist/chunks/chunk-NXO6GWSY.js +46 -0
  37. package/dist/chunks/chunk-T2XZTLYE.js +316 -0
  38. package/dist/chunks/chunk-TQDBTTIM.js +348 -0
  39. package/dist/chunks/{chunk-SMT2JSM3.js → chunk-UID7BLAB.js} +9 -9
  40. package/dist/chunks/chunk-VAT2QYXM.js +765 -0
  41. package/dist/chunks/chunk-YAZQTC2L.js +5 -0
  42. package/dist/chunks/chunk-YVRYHC4C.js +655 -0
  43. package/dist/chunks/{chunk-PXKSE54E.js → chunk-Z3KFRTSB.js} +1 -1
  44. package/dist/chunks/compaction-config-BQSSIWK5.js +2 -0
  45. package/dist/chunks/{construction-bootstrap-5F5KF2BZ.js → construction-bootstrap-VQLQGWPY.js} +1 -1
  46. package/dist/chunks/dist-BFT5YIGU.js +2 -0
  47. package/dist/chunks/dist-PCFE24YP.js +2 -0
  48. package/dist/chunks/host-UTFXCYYM.js +2 -0
  49. package/dist/chunks/run-manager-PJU3WIFJ.js +2 -0
  50. package/dist/chunks/utils-SID4HW2Q.js +2 -0
  51. package/dist/index.d.ts +21 -19
  52. package/dist/index.js +6 -6
  53. package/dist/kodax_bootstrap.js +25 -25
  54. package/dist/kodax_cli.js +1787 -1341
  55. package/dist/kodax_resume.js +17 -17
  56. package/dist/provider-capabilities.json +392 -362
  57. package/dist/runtime-worker.js +1707 -1279
  58. package/dist/sandbox-workspace-session.js +563 -0
  59. package/dist/sdk-a2a.d.ts +18 -17
  60. package/dist/sdk-a2a.js +8 -8
  61. package/dist/sdk-agent.d.ts +320 -70
  62. package/dist/sdk-agent.js +1 -1
  63. package/dist/sdk-coding.d.ts +135 -168
  64. package/dist/sdk-coding.js +1 -1
  65. package/dist/sdk-experimental-memory.d.ts +14 -597
  66. package/dist/sdk-experimental-memory.js +1 -1
  67. package/dist/sdk-llm.d.ts +219 -6
  68. package/dist/sdk-llm.js +1 -1
  69. package/dist/sdk-mcp.js +1 -1
  70. package/dist/sdk-media.d.ts +1 -1
  71. package/dist/sdk-media.js +1 -1
  72. package/dist/sdk-repl.d.ts +70 -27
  73. package/dist/sdk-repl.js +2 -2
  74. package/dist/sdk-runtime.d.ts +212 -149
  75. package/dist/sdk-runtime.js +1 -1
  76. package/dist/sdk-sandbox.d.ts +93 -0
  77. package/dist/sdk-sandbox.js +2 -0
  78. package/dist/sdk-session.d.ts +8 -8
  79. package/dist/sdk-session.js +1 -1
  80. package/dist/sdk-skills.d.ts +2 -2
  81. package/dist/sdk-skills.js +1 -1
  82. package/dist/semantic-worker.js +15 -15
  83. package/dist/types-chunks/{base.d-ChvpaKjZ.d.ts → base.d-4e74xDdy.d.ts} +13 -1
  84. package/dist/types-chunks/{bash-prefix-extractor.d-r1beOESM.d.ts → bash-prefix-extractor.d-uAe2Oqda.d.ts} +319 -9
  85. package/dist/types-chunks/{capability-learning.d-DPrYxRjF.d.ts → capability-learning.d-CVsdHw4j.d.ts} +1 -1
  86. package/dist/types-chunks/{capsule.d-zeqV4IQX.d.ts → capsule.d-BlSv9l3V.d.ts} +2 -2
  87. package/dist/types-chunks/{guardrail.d-CWYD1bdL.d.ts → guardrail.d-BRE_ErEj.d.ts} +1 -1
  88. package/dist/types-chunks/{guardrail.d-qjuKJZ31.d.ts → guardrail.d-CXDYRgZ3.d.ts} +201 -35
  89. package/dist/types-chunks/{history-retrieval.d-BKTJIrVd.d.ts → history-retrieval.d-DtCy7x64.d.ts} +2 -2
  90. package/dist/types-chunks/{integration-config.d-ojG4swOP.d.ts → integration-config.d-BNowXE8k.d.ts} +23 -8
  91. package/dist/types-chunks/{public-api.d-CX4B11qY.d.ts → public-api.d-B3AohsxN.d.ts} +37 -8
  92. package/dist/types-chunks/{commands.d-DUxnK2TU.d.ts → repl.d-Ie_ZXb_U.d.ts} +89 -78
  93. package/dist/types-chunks/{side-query.d-DWTMsndP.d.ts → resolver.d-iAQ9ocLB.d.ts} +23 -74
  94. package/dist/types-chunks/{run-manager.d-B9fEIjZk.d.ts → run-manager.d-D1twIhF9.d.ts} +1 -1
  95. package/dist/types-chunks/{sdk-session-B0fhAOPa.d.ts → sdk-session-DB9KksIx.d.ts} +3 -3
  96. package/dist/types-chunks/side-query.d-DTuLPcC5.d.ts +77 -0
  97. package/dist/types-chunks/types-D3g6XUQr.d.ts +662 -0
  98. package/dist/types-chunks/{types.d-sRLugmjy.d.ts → types.d-BA-Jwpfs.d.ts} +506 -11
  99. package/dist/types-chunks/{types.d-DEctY20M.d.ts → types.d-BH0ZkTGf.d.ts} +2 -2
  100. package/dist/types-chunks/{types.d-DCQVBqVn.d.ts → types.d-BbtGlKZu.d.ts} +25 -3
  101. package/dist/types-chunks/{types.d-CSmF0t0n.d.ts → types.d-DIpZJKUl.d.ts} +15 -0
  102. package/dist/types-chunks/{types.d-Bm_y6YuM.d.ts → types.d-DVDTIfB_.d.ts} +4 -4
  103. package/dist/types-chunks/{utils.d-D0wPxz8y.d.ts → utils.d-CVp6bFl9.d.ts} +23 -7
  104. package/docs/SDK_EMBEDDER_GUIDE.md +592 -119
  105. package/package.json +9 -1
  106. package/scripts/kodax-bin.cjs +28 -28
  107. package/scripts/production-env.cjs +25 -25
  108. package/dist/chunks/agent-7X5CFET2.js +0 -2
  109. package/dist/chunks/argument-completer-3NHIKB4N.js +0 -2
  110. package/dist/chunks/chunk-4PWPNCNK.js +0 -158
  111. package/dist/chunks/chunk-7FJNLJLF.js +0 -369
  112. package/dist/chunks/chunk-COQYLD4U.js +0 -5
  113. package/dist/chunks/chunk-D3T24FJW.js +0 -78
  114. package/dist/chunks/chunk-EI4JBQKL.js +0 -46
  115. package/dist/chunks/chunk-HGT6WQ24.js +0 -321
  116. package/dist/chunks/chunk-HS3XHF3R.js +0 -622
  117. package/dist/chunks/chunk-IDCGNQ4H.js +0 -5
  118. package/dist/chunks/chunk-KAY2XLCP.js +0 -74
  119. package/dist/chunks/chunk-OD6LVXU6.js +0 -329
  120. package/dist/chunks/chunk-OSF3H4RR.js +0 -22
  121. package/dist/chunks/chunk-TGMBHGZO.js +0 -427
  122. package/dist/chunks/chunk-VWSLC2WO.js +0 -770
  123. package/dist/chunks/chunk-Y3AMP22L.js +0 -37
  124. package/dist/chunks/compaction-config-7J2XE35D.js +0 -2
  125. package/dist/chunks/dist-2RA7LSH3.js +0 -2
  126. package/dist/chunks/dist-URKXBOC6.js +0 -2
  127. package/dist/chunks/host-RKZ2OGFT.js +0 -2
  128. package/dist/chunks/run-manager-7RM4HEH6.js +0 -2
  129. package/dist/chunks/utils-X3TEH6IO.js +0 -2
  130. package/dist/types-chunks/center-types.d-BBT122uJ.d.ts +0 -91
@@ -1,5 +1,5 @@
1
- import { bw as KodaXInputArtifact } from './types.d-sRLugmjy.js';
2
- import { S as KodaXTaskResultMetadata } from './types.d-CSmF0t0n.js';
1
+ import { bD as KodaXInputArtifact } from './types.d-BA-Jwpfs.js';
2
+ import { S as KodaXTaskResultMetadata } from './types.d-DIpZJKUl.js';
3
3
 
4
4
  /**
5
5
  * @kodax-ai/agent/messaging — Message queue types
@@ -56,6 +56,11 @@ interface SkillMetadata {
56
56
  argumentHint?: string;
57
57
  path: string;
58
58
  source: ResolvedSkillSource;
59
+ readonly learned?: {
60
+ readonly capabilityId: string;
61
+ readonly revision: number;
62
+ readonly fingerprint: string;
63
+ };
59
64
  /** If true, exclude from system prompt; still invokable by explicit slash forms. */
60
65
  disableModelInvocation: boolean;
61
66
  }
@@ -204,7 +209,22 @@ interface SkillPathsConfig {
204
209
  userPaths: string[];
205
210
  pluginPaths: string[];
206
211
  builtinPath: string;
212
+ /**
213
+ * Deprecated loose-file path. It remains in the public shape for source
214
+ * compatibility but is intentionally not discovered without a manifest.
215
+ */
207
216
  learnedPath?: string;
217
+ learnedArea?: LearnedSkillDiscoveryConfig;
218
+ }
219
+ interface LearnedSkillDiscoveryConfig {
220
+ readonly rootDir: string;
221
+ readonly expectedScope: {
222
+ readonly configHomeHash: string;
223
+ readonly tenantHash: string;
224
+ readonly projectHash: string;
225
+ };
226
+ readonly testingBindings?: Readonly<Record<string, string>>;
227
+ readonly now?: string;
208
228
  }
209
229
  /**
210
230
  * Get default skill discovery paths
@@ -215,13 +235,15 @@ interface SkillPathsConfig {
215
235
  * 3. User - ~/.agents/skills/ (AgentSkills standard)
216
236
  * 4. Plugin - (dynamic)
217
237
  * 5. Builtin - packages/skills/src/builtin/
218
- * 6. Learned - ~/.kodax/learned/skills/ (never shadows a formal source)
238
+ * Learned Skills are supplied separately through a record-gated Learned Area
239
+ * and never through a loose directory.
219
240
  */
220
241
  declare function getDefaultSkillPaths(projectRoot?: string): SkillPathsConfig;
221
242
  /**
222
243
  * All skill paths in priority order (highest to lowest)
223
244
  *
224
- * Priority: Project > User > Plugin > Builtin > Learned
245
+ * Priority: Project > User > Plugin > Builtin. Record-gated Learned Skills
246
+ * are appended by discovery after these formal sources.
225
247
  * - Project: Project-specific skills override everything else
226
248
  * - User: User preferences (~/.kodax/ and ~/.agents/)
227
249
  * - Plugin: Third-party plugins
@@ -234,4 +256,4 @@ declare function getSkillPathsFlat(config: SkillPathsConfig): Array<{
234
256
  }>;
235
257
 
236
258
  export { getDefaultSkillPaths as m, getSkillPathsFlat as n };
237
- export type { ISkillRegistry as I, ResolvedSkillSource as R, Skill as S, IVariableResolver as a, SkillArtifact as b, SkillContext as c, SkillDynamicContextExecutor as d, SkillFile as e, SkillFrontmatter as f, SkillHook as g, SkillHooks as h, SkillMetadata as i, SkillPathsConfig as j, SkillResult as k, SkillSource as l };
259
+ export type { ISkillRegistry as I, LearnedSkillDiscoveryConfig as L, ResolvedSkillSource as R, Skill as S, IVariableResolver as a, SkillArtifact as b, SkillContext as c, SkillDynamicContextExecutor as d, SkillFile as e, SkillFrontmatter as f, SkillHook as g, SkillHooks as h, SkillMetadata as i, SkillPathsConfig as j, SkillResult as k, SkillSource as l };
@@ -473,6 +473,14 @@ interface KodaXCustomProviderConfig {
473
473
  contextWindow?: number;
474
474
  maxOutputTokens?: number;
475
475
  thinkingBudgetCap?: number;
476
+ /**
477
+ * Opt in only when this exact endpoint is known to accept the protocol's
478
+ * cache-affinity field. Anthropic-compatible providers lower it to
479
+ * `metadata.user_id`; OpenAI-compatible providers lower it to
480
+ * `prompt_cache_key`. Disabled by default because strict compatibility
481
+ * gateways may reject unknown request fields.
482
+ */
483
+ promptCacheAffinity?: boolean;
476
484
  /**
477
485
  * Provider-level default for OpenAI-compat `reasoning_content` echo.
478
486
  * Required by DeepSeek V4 thinking mode (replay 400s without it).
@@ -523,6 +531,8 @@ interface KodaXProviderConfig {
523
531
  maxOutputTokens?: number;
524
532
  /** Provider thinking budget 上限 */
525
533
  thinkingBudgetCap?: number;
534
+ /** Whether this verified endpoint accepts the protocol cache-affinity field. */
535
+ promptCacheAffinity?: boolean;
526
536
  /** Provider 默认 thinking budget 映射 */
527
537
  defaultThinkingBudgets?: Partial<KodaXThinkingBudgetMap>;
528
538
  /** 按任务类型覆盖默认 budget */
@@ -580,6 +590,11 @@ interface KodaXProviderConfig {
580
590
  interface KodaXProviderStreamOptions {
581
591
  /** Request-only tail context. Providers must not mutate persisted messages. */
582
592
  ephemeralSuffix?: KodaXEphemeralSuffix;
593
+ /**
594
+ * Opaque stable logical-context key used only for Provider cache routing.
595
+ * Protocol adapters lower it only when their endpoint explicitly opts in.
596
+ */
597
+ promptCacheKey?: string;
583
598
  onTextDelta?: (text: string) => void;
584
599
  onThinkingDelta?: (text: string) => void;
585
600
  onThinkingEnd?: (thinking: string) => void;
@@ -1,8 +1,8 @@
1
- import { a9 as KodaXWireReasoningEffort, a1 as KodaXToolDefinition, a3 as KodaXToolResultContentItem, k as KodaXMessage } from './types.d-CSmF0t0n.js';
2
- import { K as KodaXBaseProvider } from './base.d-ChvpaKjZ.js';
1
+ import { a9 as KodaXWireReasoningEffort, a1 as KodaXToolDefinition, a3 as KodaXToolResultContentItem, k as KodaXMessage } from './types.d-DIpZJKUl.js';
2
+ import { K as KodaXBaseProvider } from './base.d-4e74xDdy.js';
3
3
  import { C as CapabilityKind, a as CapabilityProvider } from './capability.d-K664nHOS.js';
4
- import { by as KodaXJsonValue, bm as KodaXExtensionSessionRecord, bo as KodaXExtensionStore } from './types.d-sRLugmjy.js';
5
- import { aG as KodaXToolExecutionContext, bn as ToolSideEffect } from './bash-prefix-extractor.d-r1beOESM.js';
4
+ import { bF as KodaXJsonValue, bt as KodaXExtensionSessionRecord, bv as KodaXExtensionStore } from './types.d-BA-Jwpfs.js';
5
+ import { aP as KodaXToolExecutionContext, bx as ToolSideEffect } from './bash-prefix-extractor.d-uAe2Oqda.js';
6
6
 
7
7
  /**
8
8
  * KodaX Constructed-World types (FEATURE_087, v0.7.28).
@@ -1,9 +1,9 @@
1
- import { k as KodaXMessage, F as KodaXReasoningMode, d as KodaXCustomProviderConfig, p as KodaXProviderCapabilityProfile } from './types.d-CSmF0t0n.js';
2
- import { O as KodaXContextTokenSnapshot, aj as KodaXSkillDynamicContextPolicy, t as KodaXAgentMode, a6 as KodaXRepoIntelligenceMode, a1 as KodaXOptions, ak as KodaXSkillInvocationContext } from './bash-prefix-extractor.d-r1beOESM.js';
3
- import { bX as KodaXSessionUiHistoryItem, bM as KodaXSessionLineage, bD as KodaXSessionArtifactLedgerEntry, bn as KodaXExtensionSessionState, bm as KodaXExtensionSessionRecord, bT as KodaXSessionRuntimeInfo, eb as WorkflowProcessSource } from './types.d-sRLugmjy.js';
4
- import { d as AgentsFile, r as AutoModeStats, x as KodaXMcpServersConfig } from './guardrail.d-qjuKJZ31.js';
1
+ import { k as KodaXMessage, F as KodaXReasoningMode, d as KodaXCustomProviderConfig, p as KodaXProviderCapabilityProfile } from './types.d-DIpZJKUl.js';
2
+ import { c3 as KodaXSessionUiHistoryItem, bU as KodaXSessionLineage, bL as KodaXSessionArtifactLedgerEntry, bu as KodaXExtensionSessionState, bt as KodaXExtensionSessionRecord, b$ as KodaXSessionRuntimeInfo, e$ as WorkflowProcessSource } from './types.d-BA-Jwpfs.js';
3
+ import { O as KodaXContextTokenSnapshot, as as KodaXSkillDynamicContextPolicy, t as KodaXAgentMode, a8 as KodaXRepoIntelligenceMode, a1 as KodaXOptions, at as KodaXSkillInvocationContext } from './bash-prefix-extractor.d-uAe2Oqda.js';
4
+ import { d as AgentsFile, s as AutoModeStats, J as KodaXMcpServersConfig } from './guardrail.d-CXDYRgZ3.js';
5
5
  import * as readline from 'readline';
6
- import { R as PermissionMode, L as LearningBinding, E as LearningSurfaceSnapshot } from './public-api.d-CX4B11qY.js';
6
+ import { R as PermissionMode, L as LearningBinding, E as LearningSurfaceSnapshot } from './public-api.d-B3AohsxN.js';
7
7
  import { SpawnSyncReturns } from 'child_process';
8
8
 
9
9
  /**
@@ -310,6 +310,22 @@ interface CommandCallbacks {
310
310
  rewindSession?: (selector?: string) => Promise<SessionRewindStatus>;
311
311
  getCostReport?: () => string | null;
312
312
  getRuntimeStatus?: () => Promise<RuntimeSurfaceStatus | undefined>;
313
+ /** Canonical host parser used by `/setup` for the root-owned A2A schema. */
314
+ validateSetupA2AConfig?: (value: unknown) => unknown;
315
+ /** Root-owned sandbox activation because ASRT is distributed by the host package. */
316
+ prepareSetupSandbox?: () => Promise<{
317
+ readonly status: 'ready' | 'cancelled' | 'unavailable';
318
+ readonly lines: readonly string[];
319
+ }>;
320
+ /** Explicit read-only `/sandbox` probe. Ordinary startup never calls it. */
321
+ inspectSandbox?: () => Promise<{
322
+ readonly ready: boolean;
323
+ readonly platform: string;
324
+ readonly version: string;
325
+ readonly backend: string;
326
+ readonly diagnostics: readonly string[];
327
+ readonly guidance: readonly string[];
328
+ }>;
313
329
  learning?: LearningBinding;
314
330
  getLearningSummary?: () => Promise<LearningSurfaceSnapshot>;
315
331
  openLearningCenter?: (nameOrSlug?: string) => Promise<void>;
@@ -364,7 +380,7 @@ interface CommandDefinition {
364
380
  aliases?: string[];
365
381
  description: string;
366
382
  usage?: string;
367
- detailedHelp?: () => void;
383
+ detailedHelp?: (args?: readonly string[]) => void;
368
384
  handler: CommandHandler;
369
385
  source?: CommandSource;
370
386
  priority?: CommandPriority;
@@ -406,7 +422,7 @@ interface Command {
406
422
  description: string;
407
423
  usage?: string;
408
424
  handler: CommandHandler;
409
- detailedHelp?: () => void;
425
+ detailedHelp?: (args?: readonly string[]) => void;
410
426
  source?: CommandSource;
411
427
  priority?: CommandPriority;
412
428
  location?: 'user' | 'project' | 'path';