@kodax-ai/kodax 0.7.39 → 0.7.41

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 (61) hide show
  1. package/CHANGELOG.md +100 -0
  2. package/README.md +58 -0
  3. package/README_CN.md +31 -0
  4. package/dist/chunks/{chunk-SF7WD7E5.js → chunk-5TFLMGER.js} +1 -1
  5. package/dist/chunks/{chunk-HUAU4KB3.js → chunk-6OB4AJOM.js} +1 -1
  6. package/dist/chunks/chunk-6QO6HWGU.js +30 -0
  7. package/dist/chunks/{chunk-SONW6AC7.js → chunk-EQ5DGS2W.js} +1 -1
  8. package/dist/chunks/chunk-EVIDQWMF.js +5 -0
  9. package/dist/chunks/chunk-HYWVRTFA.js +1233 -0
  10. package/dist/chunks/chunk-SX2IS5JP.js +16 -0
  11. package/dist/chunks/chunk-V4WSBIXB.js +2 -0
  12. package/dist/chunks/chunk-ZPJPNLBK.js +462 -0
  13. package/dist/chunks/compaction-config-LT5PEXPT.js +2 -0
  14. package/dist/chunks/{construction-bootstrap-XSE7ZABG.js → construction-bootstrap-HBCWJFHC.js} +1 -1
  15. package/dist/chunks/{devtools-MOFU7YQF.js → devtools-EYGFOXEU.js} +1 -1
  16. package/dist/chunks/{dist-WKW4CBG6.js → dist-M57GIWR4.js} +1 -1
  17. package/dist/chunks/dist-V3BS2NKB.js +2 -0
  18. package/dist/chunks/paste-5DSTHQGK.js +2 -0
  19. package/dist/chunks/{utils-3HW4KOGE.js → utils-FAFUQJ2A.js} +1 -1
  20. package/dist/index.d.ts +232 -7
  21. package/dist/index.js +2 -2
  22. package/dist/kodax_cli.js +945 -923
  23. package/dist/sdk-agent.d.ts +1459 -10
  24. package/dist/sdk-agent.js +1 -1
  25. package/dist/sdk-coding.d.ts +4543 -14
  26. package/dist/sdk-coding.js +1 -1
  27. package/dist/sdk-llm.d.ts +209 -10
  28. package/dist/sdk-llm.js +1 -1
  29. package/dist/sdk-repl.d.ts +2694 -13
  30. package/dist/sdk-repl.js +1 -1
  31. package/dist/sdk-skills.d.ts +487 -11
  32. package/dist/sdk-skills.js +1 -1
  33. package/dist/types-chunks/bash-prefix-extractor.d-B2iliwdi.d.ts +2432 -0
  34. package/dist/types-chunks/capability.d-BxNgd1-c.d.ts +368 -0
  35. package/dist/types-chunks/cost-tracker.d-C4dMlQuV.d.ts +342 -0
  36. package/dist/types-chunks/history-cleanup.d-q1vAvCss.d.ts +1266 -0
  37. package/dist/types-chunks/instance-discovery.d-DZhp77vb.d.ts +1217 -0
  38. package/dist/types-chunks/resolver.d-BwD6TKz7.d.ts +262 -0
  39. package/dist/types-chunks/storage.d-Bv9T99Qu.d.ts +584 -0
  40. package/dist/types-chunks/types.d-C5mHR87z.d.ts +119 -0
  41. package/package.json +8 -2
  42. package/dist/acp_events.d.ts +0 -109
  43. package/dist/acp_logger.d.ts +0 -20
  44. package/dist/acp_server.d.ts +0 -92
  45. package/dist/chunks/chunk-4E76FLZ3.js +0 -2
  46. package/dist/chunks/chunk-7LQ2NCHF.js +0 -1221
  47. package/dist/chunks/chunk-N2VZ2MJF.js +0 -11
  48. package/dist/chunks/chunk-WEEQZYZS.js +0 -460
  49. package/dist/chunks/chunk-XI75LZIO.js +0 -30
  50. package/dist/chunks/compaction-config-YL4SWWII.js +0 -2
  51. package/dist/chunks/dist-AMUYI7R5.js +0 -2
  52. package/dist/cli_commands.d.ts +0 -17
  53. package/dist/cli_option_helpers.d.ts +0 -49
  54. package/dist/cli_option_helpers.test.d.ts +0 -1
  55. package/dist/constructed_cli.d.ts +0 -82
  56. package/dist/constructed_cli.test.d.ts +0 -1
  57. package/dist/kodax_cli.d.ts +0 -7
  58. package/dist/self_modify_cli.d.ts +0 -81
  59. package/dist/self_modify_cli.test.d.ts +0 -9
  60. package/dist/skill_cli.d.ts +0 -15
  61. package/dist/skill_cli.test.d.ts +0 -1
package/dist/sdk-repl.js CHANGED
@@ -1,2 +1,2 @@
1
1
  // @kodax-ai/kodax — bundled distribution. See docs/ADR.md ADR-022 + ADR-024.
2
- import{$ as ko,$a as kr,A,Aa as Ro,Ab as Rr,B,Ba as So,Bb as Sr,C,Ca as To,Cb as Tr,D,Da as Uo,Db as Ur,E,Ea as Vo,Eb as Vr,F,Fa as Wo,Fb as Wr,G,Ga as Xo,Gb as Xr,H,Ha as Yo,Hb as Yr,I,Ia as Zo,Ib as Zr,J,Ja as _o,Jb as _r,K,Ka as $o,Kb as $r,L,La as or,Lb as oe,M,Ma as rr,Mb as re,N,Na as er,Nb as ee,O,Oa as fr,Ob as fe,P,Pa as mr,Pb as me,Q,Qa as pr,R,Ra as tr,S,Sa as xr,T,Ta as ar,U,Ua as br,V,Va as cr,W,Wa as dr,X,Xa as gr,Y,Ya as hr,Z,Za as ir,_ as jo,_a as jr,a as o,aa as lo,ab as lr,b as r,ba as no,bb as nr,c as e,ca as qo,cb as qr,d as f,da as so,db as sr,e as m,ea as uo,eb as ur,f as p,fa as vo,fb as vr,g as t,ga as wo,gb as wr,h as x,ha as yo,hb as yr,i as a,ia as zo,ib as zr,j as b,ja as Ao,jb as Ar,k as c,ka as Bo,kb as Br,l as d,la as Co,lb as Cr,m as g,ma as Do,mb as Dr,n as h,na as Eo,nb as Er,o as i,oa as Fo,ob as Fr,p as j,pa as Go,pb as Gr,q as k,qa as Ho,qb as Hr,r as l,ra as Io,rb as Ir,s as n,sa as Jo,sb as Jr,t as q,ta as Ko,tb as Kr,u as s,ua as Lo,ub as Lr,v as u,va as Mo,vb as Mr,w as v,wa as No,wb as Nr,x as w,xa as Oo,xb as Or,y,ya as Po,yb as Pr,z,za as Qo,zb as Qr}from"./chunks/chunk-WEEQZYZS.js";import{D as io,b as _,c as $,d as oo,e as ro,f as eo,h as fo,i as mo,j as po,k as to,u as xo,v as ao,w as bo,x as co,y as go,z as ho}from"./chunks/chunk-SF7WD7E5.js";import"./chunks/chunk-HUAU4KB3.js";import"./chunks/chunk-7LQ2NCHF.js";import"./chunks/chunk-N2VZ2MJF.js";import"./chunks/chunk-SONW6AC7.js";import"./chunks/chunk-XI75LZIO.js";import"./chunks/chunk-4E76FLZ3.js";export{Wo as App,Eo as AutocompleteContextProvider,Bo as BUILTIN_COMMANDS,qr as BackgroundTaskBar,$r as ConsoleCapturer,Q as DEFAULT_UI_STATE,ir as DialogSurface,No as DotsIndicator,me as FileSessionStorage,Yo as FullscreenTranscriptLayout,Ro as HistoryItemRenderer,Ko as InputPrompt,oo as KODAX_CONFIG_FILE,_ as KODAX_DIR,$ as KODAX_SESSIONS_DIR,po as KODAX_VERSION,U as KeyMatchers,P as KeypressHandlerPriority,I as KeypressParser,S as KeypressProvider,j as LRUCache,Qo as LoadingIndicator,Dr as MemorySessionStorage,Zo as MessageActions,So as MessageList,_o as MessageSelector,kr as NotificationsSurface,V as PERMISSION_MODES,ro as PREVIEW_MAX_LENGTH,Tr as PendingInputsIndicator,Oo as ProgressIndicator,or as PromptComposer,fr as PromptFooter,rr as PromptFooterLeftSide,er as PromptFooterRightSide,mr as PromptHelpMenu,hr as PromptSuggestionsSurface,jr as QueuedCommandsSurface,Xo as SimpleApp,Lo as SimpleInputPrompt,To as SimpleMessageDisplay,Vo as SimpleStatusBar,G as SingleLineTextInput,Mo as Spinner,nr as StashNotice,Uo as StatusBar,lr as StatusNoticesSurface,ur as StreamingProvider,M as StreamingState,gr as SuggestionsDisplay,O as TOOL_STATUS_ICONS,Io as TextBuffer,F as TextInput,Po as ThinkingIndicator,Rr as ToolCallDisplay,N as ToolCallStatus,Sr as ToolGroup,Qr as ToolProgressBar,Pr as ToolStatusBadge,$o as TranscriptViewport,ar as UIStateProvider,z as calculateVisualCursorFromLayout,y as calculateVisualLayout,uo as collectBashWriteTargets,X as computeConfirmTools,Nr as createCliEvents,tr as createHistoryItem,Br as createInteractiveContext,Or as createJsonEvents,Ar as createKeyMatcher,R as createKeypressManager,Er as createMemorySessionStorage,Kr as createRecoveryHistoryItem,Ir as createRetryHistoryItem,sr as createStreamingManager,xr as createToolCall,A as darkTheme,_r as detectTerminalCapabilities,x as detectTerminalHostProfile,t as detectTerminalRenderHost,Lr as emitRecoveryHistoryItem,Jr as emitRetryHistoryItem,Do as executeCommand,Fr as executeShellCommand,yo as extractTextContent,zo as extractTitle,Ao as formatMessagePreview,pr as generateId,no as generateSavePattern,vo as getBashOutsideProjectWriteRisk,q as getCharAtCodePoint,k as getCodePointLength,ho as getGitRoot,L as getKeyDisplayName,wo as getPlanModeBlockReason,xo as getProviderList,to as getProviderModel,g as getTerminalHostCapabilities,Yr as getTerminalWidth,D as getTheme,E as getThemeNames,mo as getVersion,n as getVisualWidth,w as getVisualWidthCached,r as hasCursorUpViewportYankRisk,f as hasMainScreenRenderScrollRisk,eo as hydrateProcessEnvFromShell,qo as isAlwaysConfirmPath,jo as isBashReadCommand,ko as isBashWriteCommand,i as isClassicReplForced,J as isFunctionKey,h as isOwnedRendererPreferred,so as isPathInsideProject,Y as isPermissionMode,K as isPrintable,ao as isProviderConfigured,e as isRemoteConptyHost,Zr as isScreenReader,Gr as isShellCommand,Hr as isShellCommandSuccess,m as isTmuxControlMode,lo as isToolCallAllowed,o as isVsCodeTerminalHostEnv,l as isWideChar,bo as loadConfig,B as minimalTheme,Z as normalizePermissionMode,Co as parseCommand,H as parseKeypress,W as permissionModeDisplayName,co as prepareRuntimeConfig,fe as processSpecialSyntax,io as rateLimitedCall,fo as registerConfiguredCustomProviders,p as resetTmuxControlModeProbeForTesting,a as resolveConfiguredTuiRendererMode,b as resolveEffectiveTuiRendererMode,d as resolveFullscreenPolicy,c as resolveInteractiveSurfacePreference,Mr as runInkInteractiveMode,ee as runInteractiveMode,go as saveConfig,s as splitByCodePoints,Vr as supports256Colors,Xr as supportsEmoji,Ur as supportsTrueColor,Wr as supportsUnicode,C as themes,Cr as touchContext,u as truncateByVisualWidth,Go as useAutocomplete,Fo as useAutocompleteContext,Ho as useInputHistory,zr as useKeypress,T as useKeypressManager,yr as useStreaming,wr as useStreamingActions,vr as useStreamingState,Jo as useTextBuffer,dr as useUI,cr as useUIActions,br as useUIState,v as visualWidthCache,oe as withCapture,re as withCaptureSync};
2
+ import{$ as ko,$a as kr,A,Aa as Ro,Ab as Rr,B,Ba as So,Bb as Sr,C,Ca as To,Cb as Tr,D,Da as Uo,Db as Ur,E,Ea as Vo,Eb as Vr,F,Fa as Wo,Fb as Wr,G,Ga as Xo,Gb as Xr,H,Ha as Yo,Hb as Yr,I,Ia as Zo,Ib as Zr,J,Ja as _o,Jb as _r,K,Ka as $o,Kb as $r,L,La as or,Lb as oe,M,Ma as rr,Mb as re,N,Na as er,Nb as ee,O,Oa as fr,Ob as fe,P,Pa as mr,Pb as me,Q,Qa as pr,Qb as pe,R,Ra as tr,Rb as te,S,Sa as xr,Sb as xe,T,Ta as ar,U,Ua as br,V,Va as cr,W,Wa as dr,X,Xa as gr,Y,Ya as hr,Z,Za as ir,_ as jo,_a as jr,a as o,aa as lo,ab as lr,b as r,ba as no,bb as nr,c as e,ca as qo,cb as qr,d as f,da as so,db as sr,e as m,ea as uo,eb as ur,f as p,fa as vo,fb as vr,g as t,ga as wo,gb as wr,h as x,ha as yo,hb as yr,i as a,ia as zo,ib as zr,j as b,ja as Ao,jb as Ar,k as c,ka as Bo,kb as Br,l as d,la as Co,lb as Cr,m as g,ma as Do,mb as Dr,n as h,na as Eo,nb as Er,o as i,oa as Fo,ob as Fr,p as j,pa as Go,pb as Gr,q as k,qa as Ho,qb as Hr,r as l,ra as Io,rb as Ir,s as n,sa as Jo,sb as Jr,t as q,ta as Ko,tb as Kr,u as s,ua as Lo,ub as Lr,v as u,va as Mo,vb as Mr,w as v,wa as No,wb as Nr,x as w,xa as Oo,xb as Or,y,ya as Po,yb as Pr,z,za as Qo,zb as Qr}from"./chunks/chunk-ZPJPNLBK.js";import{D as io,b as _,c as $,d as oo,e as ro,f as eo,h as fo,i as mo,j as po,k as to,u as xo,v as ao,w as bo,x as co,y as go,z as ho}from"./chunks/chunk-5TFLMGER.js";import"./chunks/chunk-6OB4AJOM.js";import"./chunks/chunk-EVIDQWMF.js";import"./chunks/chunk-HYWVRTFA.js";import"./chunks/chunk-SX2IS5JP.js";import"./chunks/chunk-EQ5DGS2W.js";import"./chunks/chunk-6QO6HWGU.js";import"./chunks/chunk-V4WSBIXB.js";export{Wo as App,Eo as AutocompleteContextProvider,Bo as BUILTIN_COMMANDS,qr as BackgroundTaskBar,ee as ConsoleCapturer,Q as DEFAULT_UI_STATE,ir as DialogSurface,No as DotsIndicator,xe as FileSessionStorage,Yo as FullscreenTranscriptLayout,Ro as HistoryItemRenderer,Ko as InputPrompt,oo as KODAX_CONFIG_FILE,_ as KODAX_DIR,$ as KODAX_SESSIONS_DIR,po as KODAX_VERSION,U as KeyMatchers,P as KeypressHandlerPriority,I as KeypressParser,S as KeypressProvider,j as LRUCache,Qo as LoadingIndicator,Gr as MemorySessionStorage,Zo as MessageActions,So as MessageList,_o as MessageSelector,kr as NotificationsSurface,V as PERMISSION_MODES,ro as PREVIEW_MAX_LENGTH,Wr as PendingInputsIndicator,Oo as ProgressIndicator,or as PromptComposer,fr as PromptFooter,rr as PromptFooterLeftSide,er as PromptFooterRightSide,mr as PromptHelpMenu,hr as PromptSuggestionsSurface,jr as QueuedCommandsSurface,Xo as SimpleApp,Lo as SimpleInputPrompt,To as SimpleMessageDisplay,Vo as SimpleStatusBar,G as SingleLineTextInput,Mo as Spinner,nr as StashNotice,Uo as StatusBar,lr as StatusNoticesSurface,ur as StreamingProvider,M as StreamingState,gr as SuggestionsDisplay,O as TOOL_STATUS_ICONS,Io as TextBuffer,F as TextInput,Po as ThinkingIndicator,Ur as ToolCallDisplay,N as ToolCallStatus,Vr as ToolGroup,Tr as ToolProgressBar,Sr as ToolStatusBadge,$o as TranscriptViewport,ar as UIStateProvider,Dr as _resetQueuedPromptsCacheForTests,z as calculateVisualCursorFromLayout,y as calculateVisualLayout,uo as collectBashWriteTargets,X as computeConfirmTools,Qr as createCliEvents,tr as createHistoryItem,Er as createInteractiveContext,Rr as createJsonEvents,Ar as createKeyMatcher,R as createKeypressManager,Hr as createMemorySessionStorage,Nr as createRecoveryHistoryItem,Lr as createRetryHistoryItem,sr as createStreamingManager,xr as createToolCall,A as darkTheme,re as detectTerminalCapabilities,x as detectTerminalHostProfile,t as detectTerminalRenderHost,Or as emitRecoveryHistoryItem,Mr as emitRetryHistoryItem,Do as executeCommand,Ir as executeShellCommand,yo as extractTextContent,zo as extractTitle,Ao as formatMessagePreview,pr as generateId,no as generateSavePattern,vo as getBashOutsideProjectWriteRisk,q as getCharAtCodePoint,k as getCodePointLength,ho as getGitRoot,L as getKeyDisplayName,wo as getPlanModeBlockReason,xo as getProviderList,to as getProviderModel,g as getTerminalHostCapabilities,$r as getTerminalWidth,D as getTheme,E as getThemeNames,mo as getVersion,n as getVisualWidth,w as getVisualWidthCached,r as hasCursorUpViewportYankRisk,f as hasMainScreenRenderScrollRisk,eo as hydrateProcessEnvFromShell,qo as isAlwaysConfirmPath,jo as isBashReadCommand,ko as isBashWriteCommand,i as isClassicReplForced,J as isFunctionKey,h as isOwnedRendererPreferred,so as isPathInsideProject,Y as isPermissionMode,K as isPrintable,ao as isProviderConfigured,e as isRemoteConptyHost,oe as isScreenReader,Jr as isShellCommand,Kr as isShellCommandSuccess,m as isTmuxControlMode,lo as isToolCallAllowed,o as isVsCodeTerminalHostEnv,l as isWideChar,bo as loadConfig,B as minimalTheme,Z as normalizePermissionMode,Co as parseCommand,H as parseKeypress,W as permissionModeDisplayName,co as prepareRuntimeConfig,te as processSpecialSyntax,io as rateLimitedCall,fo as registerConfiguredCustomProviders,p as resetTmuxControlModeProbeForTesting,a as resolveConfiguredTuiRendererMode,b as resolveEffectiveTuiRendererMode,d as resolveFullscreenPolicy,c as resolveInteractiveSurfacePreference,Pr as runInkInteractiveMode,pe as runInteractiveMode,go as saveConfig,s as splitByCodePoints,Yr as supports256Colors,_r as supportsEmoji,Xr as supportsTrueColor,Zr as supportsUnicode,C as themes,Fr as touchContext,u as truncateByVisualWidth,Go as useAutocomplete,Fo as useAutocompleteContext,Ho as useInputHistory,zr as useKeypress,T as useKeypressManager,Cr as useQueuedPromptContents,Br as useQueuedPrompts,yr as useStreaming,wr as useStreamingActions,vr as useStreamingState,Jo as useTextBuffer,dr as useUI,cr as useUIActions,br as useUIState,v as visualWidthCache,fe as withCapture,me as withCaptureSync};
@@ -1,16 +1,492 @@
1
1
  /**
2
- * SDK subpath entry `@kodax-ai/kodax/skills`
2
+ * Agent Skills Standard Type Definitions
3
+ * Compliant with https://agentskills.io/ specification
3
4
  *
4
- * Re-exports the entire `@kodax-ai/skills` public API skill loader,
5
- * resolver, registry, frontmatter parser, etc. The `@kodax-ai/skills`
6
- * package has zero external dependencies, making it the cheapest
7
- * subpath for SDK consumers to pull in.
5
+ * Also supports Claude Code extension fields for compatibility
6
+ */
7
+ /**
8
+ * Skill frontmatter as defined in SKILL.md YAML header
9
+ */
10
+ interface SkillFrontmatter {
11
+ /** Skill name in kebab-case, max 64 characters */
12
+ name: string;
13
+ /** Skill description, max 1024 characters, should include trigger conditions */
14
+ description: string;
15
+ /** Whether to disable automatic model invocation (default: false) */
16
+ disableModelInvocation?: boolean;
17
+ /** Whether skill appears in / menu (default: true) */
18
+ userInvocable?: boolean;
19
+ /** Tool restrictions, e.g., "Read, Grep, Bash(python:*)" */
20
+ allowedTools?: string;
21
+ /** Execution context - 'fork' for sub-agent execution */
22
+ context?: 'fork';
23
+ /** Sub-agent type: Explore, Plan, general-purpose, etc. */
24
+ agent?: string;
25
+ /** Argument hint for UI, e.g., "[file] [format]" */
26
+ argumentHint?: string;
27
+ /** Model preference: haiku, sonnet, opus, or a provider-specific model id */
28
+ model?: string;
29
+ /** Hooks scoped to this skill's lifecycle */
30
+ hooks?: SkillHooks;
31
+ license?: string;
32
+ compatibility?: string;
33
+ metadata?: Record<string, unknown>;
34
+ }
35
+ interface SkillHook {
36
+ matcher?: string;
37
+ command: string;
38
+ }
39
+ interface SkillHooks {
40
+ SessionStart?: SkillHook[];
41
+ UserPromptSubmit?: SkillHook[];
42
+ PreToolUse?: SkillHook[];
43
+ PostToolUse?: SkillHook[];
44
+ Stop?: SkillHook[];
45
+ SubagentStop?: SkillHook[];
46
+ Notification?: SkillHook[];
47
+ }
48
+ /**
49
+ * Lightweight skill metadata for system prompt injection
50
+ * Loaded at startup for progressive disclosure
51
+ */
52
+ interface SkillMetadata {
53
+ name: string;
54
+ description: string;
55
+ userInvocable: boolean;
56
+ argumentHint?: string;
57
+ path: string;
58
+ source: SkillSource;
59
+ /** If true, exclude from system prompt (only invokable via /skill:name) */
60
+ disableModelInvocation: boolean;
61
+ }
62
+ /**
63
+ * Complete skill definition with all content loaded
64
+ */
65
+ interface Skill extends SkillFrontmatter {
66
+ /** Skill directory absolute path */
67
+ path: string;
68
+ /** SKILL.md absolute path */
69
+ skillFilePath: string;
70
+ /** Markdown content (with variables resolved) */
71
+ content: string;
72
+ /** Raw markdown content (before variable resolution) */
73
+ rawContent: string;
74
+ /** Support files */
75
+ scripts?: SkillFile[];
76
+ references?: SkillFile[];
77
+ assets?: SkillFile[];
78
+ templates?: SkillFile[];
79
+ resources?: SkillFile[];
80
+ /** Runtime state */
81
+ loaded: boolean;
82
+ source: SkillSource;
83
+ }
84
+ /**
85
+ * File within a skill directory
86
+ */
87
+ interface SkillFile {
88
+ name: string;
89
+ path: string;
90
+ relativePath: string;
91
+ content?: string;
92
+ }
93
+ type SkillSource = 'project' | 'user' | 'plugin' | 'builtin';
94
+ /**
95
+ * Skill registry interface for managing discovered skills
96
+ */
97
+ interface ISkillRegistry {
98
+ /** Read-only view of discovered skill metadata */
99
+ readonly skills: ReadonlyMap<string, SkillMetadata>;
100
+ /** Discover skills from all configured paths */
101
+ discover(): Promise<void>;
102
+ /** Get skill metadata by name */
103
+ get(name: string): SkillMetadata | undefined;
104
+ /** Load full skill content */
105
+ loadFull(name: string): Promise<Skill>;
106
+ /** Invoke a skill with arguments */
107
+ invoke(name: string, args: string, context: SkillContext): Promise<SkillResult>;
108
+ /** Reload skills from disk */
109
+ reload(): Promise<void>;
110
+ /** List all discovered skills */
111
+ list(): ReadonlyArray<SkillMetadata>;
112
+ /** List skills that can be invoked directly by users */
113
+ listUserInvocable(): ReadonlyArray<SkillMetadata>;
114
+ /** Check whether a skill exists */
115
+ has(name: string): boolean;
116
+ /** Number of discovered skills */
117
+ readonly size: number;
118
+ }
119
+ interface SkillContext {
120
+ workingDirectory: string;
121
+ projectRoot?: string;
122
+ sessionId: string;
123
+ environment?: Record<string, string>;
124
+ messages?: unknown[];
125
+ }
126
+ interface SkillResult {
127
+ success: boolean;
128
+ /** Processed prompt content */
129
+ content: string;
130
+ /** Generated artifacts */
131
+ artifacts?: SkillArtifact[];
132
+ error?: string;
133
+ }
134
+ interface SkillArtifact {
135
+ type: 'file' | 'code' | 'text';
136
+ name: string;
137
+ content: string;
138
+ path?: string;
139
+ }
140
+ interface IVariableResolver {
141
+ /** Resolve all variables in content */
142
+ resolve(content: string, args: string, context: SkillContext): Promise<string>;
143
+ }
144
+ interface SkillPathsConfig {
145
+ projectPaths: string[];
146
+ userPaths: string[];
147
+ pluginPaths: string[];
148
+ builtinPath: string;
149
+ }
150
+ /**
151
+ * Get default skill discovery paths
152
+ *
153
+ * Priority order (highest first):
154
+ * 1. Project - <projectRoot>/.kodax/skills/
155
+ * 2. User - ~/.kodax/skills/
156
+ * 3. User - ~/.agents/skills/ (AgentSkills standard)
157
+ * 4. Plugin - (dynamic)
158
+ * 5. Builtin - packages/skills/src/builtin/
159
+ */
160
+ declare function getDefaultSkillPaths(projectRoot?: string): SkillPathsConfig;
161
+ /**
162
+ * All skill paths in priority order (highest to lowest)
163
+ *
164
+ * Priority: Project > User > Plugin > Builtin
165
+ * - Project: Project-specific skills override everything else
166
+ * - User: User preferences (~/.kodax/ and ~/.agents/)
167
+ * - Plugin: Third-party plugins
168
+ * - Builtin: Default skills shipped with KodaX
169
+ */
170
+ declare function getSkillPathsFlat(config: SkillPathsConfig): Array<{
171
+ path: string;
172
+ source: SkillSource;
173
+ }>;
174
+
175
+ declare function registerPluginSkillPath(skillPath: string): () => void;
176
+ declare function unregisterPluginSkillPath(skillPath: string): boolean;
177
+ declare function listPluginSkillPaths(): string[];
178
+ declare function clearPluginSkillPaths(): void;
179
+
180
+ /**
181
+ * Skill Loader - YAML Frontmatter Parsing and Skill Loading
182
+ *
183
+ * Parses SKILL.md files with YAML frontmatter and loads skill content.
184
+ * Implements fallback sanitization for non-standard YAML formats.
185
+ */
186
+
187
+ /**
188
+ * Parse SKILL.md file with YAML frontmatter
189
+ */
190
+ declare function parseSkillMarkdown(content: string): {
191
+ frontmatter: SkillFrontmatter;
192
+ body: string;
193
+ };
194
+ /**
195
+ * Load skill metadata from SKILL.md file
196
+ */
197
+ declare function loadSkillMetadata(skillDir: string, source: SkillSource): Promise<SkillMetadata | null>;
198
+ /**
199
+ * Load full skill content
200
+ */
201
+ declare function loadFullSkill(skillDir: string, source: SkillSource): Promise<Skill | null>;
202
+ /**
203
+ * Load a specific support file's content
204
+ */
205
+ declare function loadSkillFileContent(file: SkillFile): Promise<string>;
206
+
207
+ /**
208
+ * Skill Discovery - Multi-path skill scanning
209
+ *
210
+ * Discovers skills from multiple paths with priority handling.
211
+ * Supports nested directory discovery for monorepos.
212
+ */
213
+
214
+ /**
215
+ * Result of skill discovery
216
+ */
217
+ interface DiscoveryResult {
218
+ skills: Map<string, SkillMetadata>;
219
+ errors: Array<{
220
+ path: string;
221
+ error: string;
222
+ }>;
223
+ }
224
+ /**
225
+ * Discover all skills from configured paths
226
+ */
227
+ declare function discoverSkills(projectRoot?: string, customPaths?: Partial<SkillPathsConfig>): Promise<DiscoveryResult>;
228
+ /**
229
+ * Get nested skill paths for monorepo support
230
+ * When in a subdirectory, also check parent directories for skills
231
+ */
232
+ declare function getNestedSkillPaths(currentDir: string, projectRoot: string): string[];
233
+ /**
234
+ * Discover skills with monorepo support
235
+ */
236
+ declare function discoverSkillsWithMonorepo(currentDir: string, projectRoot: string): Promise<DiscoveryResult>;
237
+
238
+ /**
239
+ * Skill Resolver - Variable Replacement System
240
+ *
241
+ * Handles variable replacement in skill content:
242
+ * - $ARGUMENTS - All arguments
243
+ * - $0, $1, $2... - Positional arguments
244
+ * - ${VAR_NAME} - Environment variables
245
+ * - !`command` - Dynamic context injection
246
+ */
247
+
248
+ /**
249
+ * Split arguments string into positional arguments
250
+ * Handles quoted strings correctly
251
+ */
252
+ declare function parseArguments(args: string): string[];
253
+ /**
254
+ * Variable resolver implementation
255
+ */
256
+ declare class VariableResolver implements IVariableResolver {
257
+ private context;
258
+ constructor(context: SkillContext);
259
+ /**
260
+ * Resolve all variables in content
261
+ */
262
+ resolve(content: string, args: string): Promise<string>;
263
+ /**
264
+ * Replace $0, $1, $2... with positional arguments
265
+ */
266
+ private resolvePositionalArgs;
267
+ /**
268
+ * Replace $ARGUMENTS with all arguments
269
+ */
270
+ private resolveArguments;
271
+ /**
272
+ * Replace ${VAR_NAME} with environment variables
273
+ */
274
+ private resolveEnvVars;
275
+ /**
276
+ * Replace !`command` with command output (dynamic context)
277
+ */
278
+ private resolveDynamicContext;
279
+ /**
280
+ * Execute a dynamic context command
281
+ */
282
+ private executeDynamicCommand;
283
+ }
284
+ /**
285
+ * Create a variable resolver for a given context
286
+ */
287
+ declare function createResolver(context: SkillContext): IVariableResolver;
288
+ /**
289
+ * Resolve skill content with arguments and context
290
+ */
291
+ declare function resolveSkillContent(content: string, args: string, context: SkillContext): Promise<string>;
292
+
293
+ /**
294
+ * Skill Registry - Progressive Disclosure and Skill Management
295
+ *
296
+ * Manages skill discovery, loading, and invocation with progressive disclosure:
297
+ * - Level 1: Metadata preloaded at startup (name, description)
298
+ * - Level 2: Full content loaded on invoke
299
+ * - Level 3: Support files loaded on demand
300
+ */
301
+
302
+ /**
303
+ * Skill Registry implementation
304
+ */
305
+ declare class SkillRegistry implements ISkillRegistry {
306
+ private readonly skillsByName;
307
+ private readonly fullSkillsByName;
308
+ private readonly projectRoot?;
309
+ private readonly customPaths?;
310
+ constructor(projectRoot?: string, customPaths?: Partial<SkillPathsConfig>);
311
+ /**
312
+ * Discover skills from all configured paths
313
+ */
314
+ discover(): Promise<void>;
315
+ /**
316
+ * Get skill metadata by name
317
+ */
318
+ get skills(): ReadonlyMap<string, SkillMetadata>;
319
+ /**
320
+ * Get skill metadata by name
321
+ */
322
+ get(name: string): SkillMetadata | undefined;
323
+ /**
324
+ * Load full skill content
325
+ */
326
+ loadFull(name: string): Promise<Skill>;
327
+ /**
328
+ * Invoke a skill with arguments
329
+ */
330
+ invoke(name: string, args: string, context: SkillContext): Promise<SkillResult>;
331
+ /**
332
+ * Reload skills from disk
333
+ */
334
+ reload(): Promise<void>;
335
+ /**
336
+ * List all available skills
337
+ */
338
+ list(): SkillMetadata[];
339
+ /**
340
+ * List user-invocable skills (for / menu)
341
+ */
342
+ listUserInvocable(): SkillMetadata[];
343
+ /**
344
+ * Get skills formatted for system prompt injection.
345
+ *
346
+ * FEATURE_143 (v0.7.36): manifest wording hardened toward Claude
347
+ * Code-style strong constraints. The previous wording ("when a user
348
+ * request matches a skill description, use read to load the skill")
349
+ * was too soft — the LLM treated skill invocation as one option among
350
+ * many and frequently authored its own answer instead of loading the
351
+ * SKILL.md instructions. Aligns with the
352
+ * `c:/Works/claudecode/src/tools/SkillTool/prompt.ts` ruleset:
353
+ * BLOCKING REQUIREMENT to load the relevant skill BEFORE generating
354
+ * any other response when a skill matches.
355
+ *
356
+ * Filters out skills with disableModelInvocation=true (Issue 056).
357
+ */
358
+ getSystemPromptSnippet(): string;
359
+ /**
360
+ * Check if a name is a valid skill
361
+ */
362
+ has(name: string): boolean;
363
+ /**
364
+ * Get the count of discovered skills
365
+ */
366
+ get size(): number;
367
+ }
368
+ /**
369
+ * Get the global skill registry instance
370
+ *
371
+ * IMPORTANT: If projectRoot is undefined, returns existing instance without reset.
372
+ * This prevents accidental singleton reset when called without arguments.
373
+ */
374
+ declare function getSkillRegistry(projectRoot?: string, customPaths?: Partial<SkillPathsConfig>): SkillRegistry;
375
+ /**
376
+ * Initialize the skill registry and discover skills
377
+ */
378
+ declare function initializeSkillRegistry(projectRoot?: string, customPaths?: Partial<SkillPathsConfig>): Promise<SkillRegistry>;
379
+ /**
380
+ * Reset the global registry (for testing or hot reload)
381
+ */
382
+ declare function resetSkillRegistry(): void;
383
+
384
+ /**
385
+ * Skill Executor - Execution Engine
8
386
  *
9
- * Usage:
10
- * ```ts
11
- * import { loadSkill, SkillRegistry } from '@kodax-ai/kodax/skills';
12
- * ```
387
+ * Handles skill execution with support for:
388
+ * - Inline execution (default)
389
+ * - Fork execution (sub-agent)
390
+ * - Tool restrictions
391
+ */
392
+
393
+ /**
394
+ * Execution mode
395
+ */
396
+ type ExecutionMode = 'inline' | 'fork';
397
+ /**
398
+ * Execution options
399
+ */
400
+ interface ExecutionOptions {
401
+ /** Force a specific execution mode */
402
+ mode?: ExecutionMode;
403
+ /** Override model */
404
+ model?: string;
405
+ /** Override agent type (for fork mode) */
406
+ agent?: string;
407
+ /** Override allowed tools */
408
+ allowedTools?: string[];
409
+ /** Callback for inline execution */
410
+ onExecute?: (content: string, skill: Skill) => Promise<string>;
411
+ }
412
+ /**
413
+ * Skill executor class
414
+ */
415
+ declare class SkillExecutor {
416
+ private context;
417
+ constructor(context: SkillContext);
418
+ /**
419
+ * Execute a skill
420
+ */
421
+ execute(skillName: string, args: string, options?: ExecutionOptions): Promise<SkillResult>;
422
+ /**
423
+ * Execute skill inline (in current context)
424
+ */
425
+ private executeInline;
426
+ /**
427
+ * Execute skill in fork mode (sub-agent)
428
+ */
429
+ private executeFork;
430
+ /**
431
+ * Build the execution prompt
432
+ */
433
+ private buildPrompt;
434
+ /**
435
+ * Parse allowed tools string into array
436
+ */
437
+ private parseAllowedTools;
438
+ }
439
+ /**
440
+ * Create a skill executor
441
+ */
442
+ declare function createExecutor(context: SkillContext): SkillExecutor;
443
+ /**
444
+ * Execute a skill with default context
445
+ */
446
+ declare function executeSkill(skillName: string, args: string, context: SkillContext, options?: ExecutionOptions): Promise<SkillResult>;
447
+
448
+ /**
449
+ * Skill Expander - Expand skill commands for LLM context injection
450
+ *
451
+ * Takes a skill invocation and produces content that can be injected
452
+ * into the user message for LLM execution.
453
+ *
454
+ * Design based on pi-mono's _expandSkillCommand:
455
+ * - Wraps content in XML blocks for clear context
456
+ * - Includes skill metadata (name, location)
457
+ * - Resolves all variables ($ARGUMENTS, $0, etc.)
458
+ * - Handles dynamic context (!`command`)
459
+ */
460
+
461
+ /**
462
+ * Result of skill expansion
463
+ */
464
+ interface SkillExpansionResult {
465
+ /** The expanded skill content ready for LLM injection */
466
+ content: string;
467
+ /** Whether the skill has model invocation disabled */
468
+ disableModelInvocation: boolean;
469
+ /** Original skill metadata */
470
+ skill: Skill;
471
+ }
472
+ /**
473
+ * Expand a skill into LLM-ready content
474
+ *
475
+ * This function:
476
+ * 1. Resolves all variables in the skill content ($ARGUMENTS, $0, $1, etc.)
477
+ * 2. Executes dynamic context commands (!`command`)
478
+ * 3. Wraps the content in an XML block for clear context boundaries
13
479
  *
14
- * See docs/ADR.md ADR-024 for the SDK formalization decision.
480
+ * @param skill - The full skill object with content
481
+ * @param args - Raw arguments string from user input
482
+ * @param context - Execution context (working directory, session ID, etc.)
483
+ * @returns Expansion result with content ready for LLM injection
484
+ */
485
+ declare function expandSkillForLLM(skill: Skill, args: string, context: SkillContext): Promise<SkillExpansionResult>;
486
+ /**
487
+ * Format skill activation message for user display
15
488
  */
16
- export * from '@kodax-ai/skills';
489
+ declare function formatSkillActivationMessage(skillName: string, args: string): string;
490
+
491
+ export { SkillExecutor, SkillRegistry, VariableResolver, clearPluginSkillPaths, createExecutor, createResolver, discoverSkills, discoverSkillsWithMonorepo, executeSkill, expandSkillForLLM, formatSkillActivationMessage, getDefaultSkillPaths, getNestedSkillPaths, getSkillPathsFlat, getSkillRegistry, initializeSkillRegistry, listPluginSkillPaths, loadFullSkill, loadSkillFileContent, loadSkillMetadata, parseArguments, parseSkillMarkdown, registerPluginSkillPath, resetSkillRegistry, resolveSkillContent, unregisterPluginSkillPath };
492
+ export type { DiscoveryResult, ExecutionMode, ExecutionOptions, ISkillRegistry, IVariableResolver, Skill, SkillArtifact, SkillContext, SkillExpansionResult, SkillFile, SkillFrontmatter, SkillHook, SkillHooks, SkillMetadata, SkillPathsConfig, SkillResult, SkillSource };
@@ -1,2 +1,2 @@
1
1
  // @kodax-ai/kodax — bundled distribution. See docs/ADR.md ADR-022 + ADR-024.
2
- import{A as w,B as y,C as z,a as o,b as r,c as e,d as f,e as m,f as p,j as t,k as x,l as a,m as b,n as c,o as d,p as g,q as h,r as i,s as j,t as k,u as l,v as n,w as q,x as s,y as u,z as v}from"./chunks/chunk-SONW6AC7.js";import"./chunks/chunk-4E76FLZ3.js";export{u as SkillExecutor,l as SkillRegistry,i as VariableResolver,f as clearPluginSkillPaths,v as createExecutor,j as createResolver,c as discoverSkills,g as discoverSkillsWithMonorepo,w as executeSkill,y as expandSkillForLLM,z as formatSkillActivationMessage,m as getDefaultSkillPaths,d as getNestedSkillPaths,p as getSkillPathsFlat,n as getSkillRegistry,q as initializeSkillRegistry,e as listPluginSkillPaths,a as loadFullSkill,b as loadSkillFileContent,x as loadSkillMetadata,h as parseArguments,t as parseSkillMarkdown,o as registerPluginSkillPath,s as resetSkillRegistry,k as resolveSkillContent,r as unregisterPluginSkillPath};
2
+ import{A as w,B as y,C as z,a as o,b as r,c as e,d as f,e as m,f as p,j as t,k as x,l as a,m as b,n as c,o as d,p as g,q as h,r as i,s as j,t as k,u as l,v as n,w as q,x as s,y as u,z as v}from"./chunks/chunk-EQ5DGS2W.js";import"./chunks/chunk-V4WSBIXB.js";export{u as SkillExecutor,l as SkillRegistry,i as VariableResolver,f as clearPluginSkillPaths,v as createExecutor,j as createResolver,c as discoverSkills,g as discoverSkillsWithMonorepo,w as executeSkill,y as expandSkillForLLM,z as formatSkillActivationMessage,m as getDefaultSkillPaths,d as getNestedSkillPaths,p as getSkillPathsFlat,n as getSkillRegistry,q as initializeSkillRegistry,e as listPluginSkillPaths,a as loadFullSkill,b as loadSkillFileContent,x as loadSkillMetadata,h as parseArguments,t as parseSkillMarkdown,o as registerPluginSkillPath,s as resetSkillRegistry,k as resolveSkillContent,r as unregisterPluginSkillPath};