sparkecoder 0.1.123 → 0.1.125

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 (142) hide show
  1. package/dist/agent/index.d.ts +3 -3
  2. package/dist/agent/index.js +145 -71
  3. package/dist/agent/index.js.map +1 -1
  4. package/dist/cli.js +265 -131
  5. package/dist/cli.js.map +1 -1
  6. package/dist/db/index.d.ts +2 -2
  7. package/dist/{index-Bcz0aCAR.d.ts → index-DczYH89U.d.ts} +104 -104
  8. package/dist/index.d.ts +5 -5
  9. package/dist/index.js +188 -89
  10. package/dist/index.js.map +1 -1
  11. package/dist/{schema-BWbWmfDQ.d.ts → schema-DxrKyetI.d.ts} +3 -3
  12. package/dist/{search-DOzC4ojH.d.ts → search-CVVfuBPZ.d.ts} +4 -4
  13. package/dist/server/index.js +188 -89
  14. package/dist/server/index.js.map +1 -1
  15. package/dist/skills/default/memory.md +49 -0
  16. package/dist/skills/default/recording.md +2 -2
  17. package/dist/skills/default/skill-authoring.md +96 -0
  18. package/dist/tools/index.d.ts +3 -3
  19. package/dist/tools/index.js +12 -4
  20. package/dist/tools/index.js.map +1 -1
  21. package/package.json +1 -1
  22. package/src/skills/default/memory.md +49 -0
  23. package/src/skills/default/recording.md +2 -2
  24. package/src/skills/default/skill-authoring.md +96 -0
  25. package/web/.next/BUILD_ID +1 -1
  26. package/web/.next/standalone/web/.next/BUILD_ID +1 -1
  27. package/web/.next/standalone/web/.next/build-manifest.json +2 -2
  28. package/web/.next/standalone/web/.next/prerender-manifest.json +3 -3
  29. package/web/.next/standalone/web/.next/server/app/(main)/agents/page_client-reference-manifest.js +1 -1
  30. package/web/.next/standalone/web/.next/server/app/(main)/page_client-reference-manifest.js +1 -1
  31. package/web/.next/standalone/web/.next/server/app/(main)/session/[id]/page.js.nft.json +1 -1
  32. package/web/.next/standalone/web/.next/server/app/(main)/session/[id]/page_client-reference-manifest.js +1 -1
  33. package/web/.next/standalone/web/.next/server/app/(main)/settings/page_client-reference-manifest.js +1 -1
  34. package/web/.next/standalone/web/.next/server/app/_global-error.html +2 -2
  35. package/web/.next/standalone/web/.next/server/app/_global-error.rsc +1 -1
  36. package/web/.next/standalone/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  37. package/web/.next/standalone/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  38. package/web/.next/standalone/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  39. package/web/.next/standalone/web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  40. package/web/.next/standalone/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  41. package/web/.next/standalone/web/.next/server/app/_not-found.html +1 -1
  42. package/web/.next/standalone/web/.next/server/app/_not-found.rsc +1 -1
  43. package/web/.next/standalone/web/.next/server/app/_not-found.segments/_full.segment.rsc +1 -1
  44. package/web/.next/standalone/web/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  45. package/web/.next/standalone/web/.next/server/app/_not-found.segments/_index.segment.rsc +1 -1
  46. package/web/.next/standalone/web/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  47. package/web/.next/standalone/web/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  48. package/web/.next/standalone/web/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  49. package/web/.next/standalone/web/.next/server/app/agents.html +1 -1
  50. package/web/.next/standalone/web/.next/server/app/agents.rsc +3 -3
  51. package/web/.next/standalone/web/.next/server/app/agents.segments/!KG1haW4p/agents/__PAGE__.segment.rsc +2 -2
  52. package/web/.next/standalone/web/.next/server/app/agents.segments/!KG1haW4p/agents.segment.rsc +1 -1
  53. package/web/.next/standalone/web/.next/server/app/agents.segments/!KG1haW4p.segment.rsc +2 -2
  54. package/web/.next/standalone/web/.next/server/app/agents.segments/_full.segment.rsc +3 -3
  55. package/web/.next/standalone/web/.next/server/app/agents.segments/_head.segment.rsc +1 -1
  56. package/web/.next/standalone/web/.next/server/app/agents.segments/_index.segment.rsc +1 -1
  57. package/web/.next/standalone/web/.next/server/app/agents.segments/_tree.segment.rsc +1 -1
  58. package/web/.next/standalone/web/.next/server/app/docs/installation.html +2 -2
  59. package/web/.next/standalone/web/.next/server/app/docs/installation.rsc +1 -1
  60. package/web/.next/standalone/web/.next/server/app/docs/installation.segments/_full.segment.rsc +1 -1
  61. package/web/.next/standalone/web/.next/server/app/docs/installation.segments/_head.segment.rsc +1 -1
  62. package/web/.next/standalone/web/.next/server/app/docs/installation.segments/_index.segment.rsc +1 -1
  63. package/web/.next/standalone/web/.next/server/app/docs/installation.segments/_tree.segment.rsc +1 -1
  64. package/web/.next/standalone/web/.next/server/app/docs/installation.segments/docs/installation/__PAGE__.segment.rsc +1 -1
  65. package/web/.next/standalone/web/.next/server/app/docs/installation.segments/docs/installation.segment.rsc +1 -1
  66. package/web/.next/standalone/web/.next/server/app/docs/installation.segments/docs.segment.rsc +1 -1
  67. package/web/.next/standalone/web/.next/server/app/docs/skills.html +2 -2
  68. package/web/.next/standalone/web/.next/server/app/docs/skills.rsc +1 -1
  69. package/web/.next/standalone/web/.next/server/app/docs/skills.segments/_full.segment.rsc +1 -1
  70. package/web/.next/standalone/web/.next/server/app/docs/skills.segments/_head.segment.rsc +1 -1
  71. package/web/.next/standalone/web/.next/server/app/docs/skills.segments/_index.segment.rsc +1 -1
  72. package/web/.next/standalone/web/.next/server/app/docs/skills.segments/_tree.segment.rsc +1 -1
  73. package/web/.next/standalone/web/.next/server/app/docs/skills.segments/docs/skills/__PAGE__.segment.rsc +1 -1
  74. package/web/.next/standalone/web/.next/server/app/docs/skills.segments/docs/skills.segment.rsc +1 -1
  75. package/web/.next/standalone/web/.next/server/app/docs/skills.segments/docs.segment.rsc +1 -1
  76. package/web/.next/standalone/web/.next/server/app/docs/tools.html +2 -2
  77. package/web/.next/standalone/web/.next/server/app/docs/tools.rsc +1 -1
  78. package/web/.next/standalone/web/.next/server/app/docs/tools.segments/_full.segment.rsc +1 -1
  79. package/web/.next/standalone/web/.next/server/app/docs/tools.segments/_head.segment.rsc +1 -1
  80. package/web/.next/standalone/web/.next/server/app/docs/tools.segments/_index.segment.rsc +1 -1
  81. package/web/.next/standalone/web/.next/server/app/docs/tools.segments/_tree.segment.rsc +1 -1
  82. package/web/.next/standalone/web/.next/server/app/docs/tools.segments/docs/tools/__PAGE__.segment.rsc +1 -1
  83. package/web/.next/standalone/web/.next/server/app/docs/tools.segments/docs/tools.segment.rsc +1 -1
  84. package/web/.next/standalone/web/.next/server/app/docs/tools.segments/docs.segment.rsc +1 -1
  85. package/web/.next/standalone/web/.next/server/app/docs.html +2 -2
  86. package/web/.next/standalone/web/.next/server/app/docs.rsc +1 -1
  87. package/web/.next/standalone/web/.next/server/app/docs.segments/_full.segment.rsc +1 -1
  88. package/web/.next/standalone/web/.next/server/app/docs.segments/_head.segment.rsc +1 -1
  89. package/web/.next/standalone/web/.next/server/app/docs.segments/_index.segment.rsc +1 -1
  90. package/web/.next/standalone/web/.next/server/app/docs.segments/_tree.segment.rsc +1 -1
  91. package/web/.next/standalone/web/.next/server/app/docs.segments/docs/__PAGE__.segment.rsc +1 -1
  92. package/web/.next/standalone/web/.next/server/app/docs.segments/docs.segment.rsc +1 -1
  93. package/web/.next/standalone/web/.next/server/app/index.html +1 -1
  94. package/web/.next/standalone/web/.next/server/app/index.rsc +3 -3
  95. package/web/.next/standalone/web/.next/server/app/index.segments/!KG1haW4p/__PAGE__.segment.rsc +2 -2
  96. package/web/.next/standalone/web/.next/server/app/index.segments/!KG1haW4p.segment.rsc +2 -2
  97. package/web/.next/standalone/web/.next/server/app/index.segments/_full.segment.rsc +3 -3
  98. package/web/.next/standalone/web/.next/server/app/index.segments/_head.segment.rsc +1 -1
  99. package/web/.next/standalone/web/.next/server/app/index.segments/_index.segment.rsc +1 -1
  100. package/web/.next/standalone/web/.next/server/app/index.segments/_tree.segment.rsc +1 -1
  101. package/web/.next/standalone/web/.next/server/app/settings.html +1 -1
  102. package/web/.next/standalone/web/.next/server/app/settings.rsc +3 -3
  103. package/web/.next/standalone/web/.next/server/app/settings.segments/!KG1haW4p/settings/__PAGE__.segment.rsc +2 -2
  104. package/web/.next/standalone/web/.next/server/app/settings.segments/!KG1haW4p/settings.segment.rsc +1 -1
  105. package/web/.next/standalone/web/.next/server/app/settings.segments/!KG1haW4p.segment.rsc +2 -2
  106. package/web/.next/standalone/web/.next/server/app/settings.segments/_full.segment.rsc +3 -3
  107. package/web/.next/standalone/web/.next/server/app/settings.segments/_head.segment.rsc +1 -1
  108. package/web/.next/standalone/web/.next/server/app/settings.segments/_index.segment.rsc +1 -1
  109. package/web/.next/standalone/web/.next/server/app/settings.segments/_tree.segment.rsc +1 -1
  110. package/web/.next/standalone/web/.next/server/chunks/ssr/{2374f_c87abaf4._.js → 2374f_12d55e68._.js} +1 -1
  111. package/web/.next/standalone/web/.next/server/chunks/ssr/{2374f_1f3f2d00._.js → 2374f_1c0639c2._.js} +1 -1
  112. package/web/.next/standalone/web/.next/server/chunks/ssr/{2374f_a0d5caeb._.js → 2374f_28cd6777._.js} +1 -1
  113. package/web/.next/standalone/web/.next/server/chunks/ssr/{2374f_570c34dc._.js → 2374f_5f47a9b7._.js} +1 -1
  114. package/web/.next/standalone/web/.next/server/chunks/ssr/{2374f_d8122230._.js → 2374f_aa218457._.js} +1 -1
  115. package/web/.next/standalone/web/.next/server/chunks/ssr/{2374f_9c560f3a._.js → 2374f_f678a96f._.js} +1 -1
  116. package/web/.next/standalone/web/.next/server/chunks/ssr/{2374f_38945fd9._.js → 2374f_fac4000d._.js} +1 -1
  117. package/web/.next/standalone/web/.next/server/chunks/ssr/{[root-of-the-server]__4de426bd._.js → [root-of-the-server]__e5911ea8._.js} +4 -4
  118. package/web/.next/standalone/web/.next/server/chunks/ssr/{web_62ca4286._.js → web_2966b3a3._.js} +2 -2
  119. package/web/.next/standalone/web/.next/server/chunks/ssr/web_4fe3c244._.js +1 -1
  120. package/web/.next/standalone/web/.next/server/pages/404.html +1 -1
  121. package/web/.next/standalone/web/.next/server/pages/500.html +2 -2
  122. package/web/.next/standalone/web/.next/server/server-reference-manifest.js +1 -1
  123. package/web/.next/standalone/web/.next/server/server-reference-manifest.json +1 -1
  124. package/web/.next/standalone/web/.next/static/chunks/{91988e253d5fa420.js → 4d95c15f712c9e06.js} +5 -5
  125. package/web/.next/standalone/web/.next/static/chunks/780c93257fac7d43.js +1 -0
  126. package/web/.next/standalone/web/.next/static/static/chunks/{91988e253d5fa420.js → 4d95c15f712c9e06.js} +5 -5
  127. package/web/.next/standalone/web/.next/static/static/chunks/780c93257fac7d43.js +1 -0
  128. package/web/.next/standalone/web/src/components/chat-interface.tsx +112 -1
  129. package/web/.next/static/chunks/{91988e253d5fa420.js → 4d95c15f712c9e06.js} +5 -5
  130. package/web/.next/static/chunks/780c93257fac7d43.js +1 -0
  131. package/web/.next/standalone/web/.next/static/chunks/f0f19357f3fb7cf8.js +0 -1
  132. package/web/.next/standalone/web/.next/static/static/chunks/f0f19357f3fb7cf8.js +0 -1
  133. package/web/.next/static/chunks/f0f19357f3fb7cf8.js +0 -1
  134. /package/web/.next/standalone/web/.next/static/{MP4p8_EldjbZ69dONoEcM → qtMOCCjmqN22PUb49g4j-}/_buildManifest.js +0 -0
  135. /package/web/.next/standalone/web/.next/static/{MP4p8_EldjbZ69dONoEcM → qtMOCCjmqN22PUb49g4j-}/_clientMiddlewareManifest.json +0 -0
  136. /package/web/.next/standalone/web/.next/static/{MP4p8_EldjbZ69dONoEcM → qtMOCCjmqN22PUb49g4j-}/_ssgManifest.js +0 -0
  137. /package/web/.next/standalone/web/.next/static/static/{MP4p8_EldjbZ69dONoEcM → qtMOCCjmqN22PUb49g4j-}/_buildManifest.js +0 -0
  138. /package/web/.next/standalone/web/.next/static/static/{MP4p8_EldjbZ69dONoEcM → qtMOCCjmqN22PUb49g4j-}/_clientMiddlewareManifest.json +0 -0
  139. /package/web/.next/standalone/web/.next/static/static/{MP4p8_EldjbZ69dONoEcM → qtMOCCjmqN22PUb49g4j-}/_ssgManifest.js +0 -0
  140. /package/web/.next/static/{MP4p8_EldjbZ69dONoEcM → qtMOCCjmqN22PUb49g4j-}/_buildManifest.js +0 -0
  141. /package/web/.next/static/{MP4p8_EldjbZ69dONoEcM → qtMOCCjmqN22PUb49g4j-}/_clientMiddlewareManifest.json +0 -0
  142. /package/web/.next/static/{MP4p8_EldjbZ69dONoEcM → qtMOCCjmqN22PUb49g4j-}/_ssgManifest.js +0 -0
@@ -0,0 +1,49 @@
1
+ ---
2
+ name: Memory
3
+ description: Read, update, organize, or explain durable SparkECoder memory. Load when the user asks the agent to remember something, create memory files, edit its memory, or retrieve long-term context.
4
+ ---
5
+
6
+ # Memory
7
+
8
+ SparkECoder memory is filesystem-backed markdown. Agents can read and edit it with normal file tools.
9
+
10
+ ## Default Layout
11
+
12
+ - `.sparkecoder/rules/memory.md` - always-loaded memory index. Keep it short.
13
+ - `.sparkecoder/memory/` - detailed durable memory files.
14
+
15
+ The memory index can point to any deeper file. Create folders under `.sparkecoder/memory/` when a topic grows.
16
+
17
+ Suggested structure:
18
+
19
+ ```text
20
+ .sparkecoder/memory/
21
+ preferences.md
22
+ project.md
23
+ operations.md
24
+ decisions/
25
+ integrations/
26
+ runbooks/
27
+ ```
28
+
29
+ ## Rules
30
+
31
+ - Do not store secrets, credentials, API keys, private tokens, or sensitive personal data.
32
+ - Store durable facts, preferences, architecture decisions, runbooks, and pointers.
33
+ - Keep `.sparkecoder/rules/memory.md` as low-token as possible. It may have `contextBudgetTokens` frontmatter; if content exceeds that budget, SparkECoder truncates it in the system prompt. A large budget is a ceiling, not a target.
34
+ - Put long content in `.sparkecoder/memory/**/*.md` and leave a short pointer in the index.
35
+ - Read existing memory before editing it.
36
+ - Remove or update stale memory instead of appending contradictions.
37
+
38
+ ## Remember Something
39
+
40
+ 1. Decide whether it belongs in the always-loaded index or a detailed memory file.
41
+ 2. If it is short and should always be known, update `.sparkecoder/rules/memory.md`.
42
+ 3. If it is detailed, create or edit a file under `.sparkecoder/memory/` and add only a pointer to the index.
43
+ 4. Keep wording factual and timestamp-free unless the date is part of the durable fact.
44
+
45
+ ## Retrieve Memory
46
+
47
+ 1. Read `.sparkecoder/rules/memory.md`.
48
+ 2. Follow the relevant pointer into `.sparkecoder/memory/`.
49
+ 3. Search within `.sparkecoder/memory/` if the index points to a broad area.
@@ -51,7 +51,7 @@ sparkecoder record stop-all # stop everything (cleanup)
51
51
  sparkecoder record start --dir /custom/path --name my-task
52
52
  ```
53
53
 
54
- Storage: defaults to `~/recordings/`. Files are named `rec-<id>[-<name>].<mov|mp4>`.
54
+ Storage: defaults to `~/recordings/`. Files are named `rec-<id>[-<name>].mp4`. On macOS the helper captures a temporary `.mov` and converts it to `.mp4` when stopped.
55
55
 
56
56
  ### Why not `screencapture -V N` or raw `ffmpeg` backgrounded?
57
57
 
@@ -190,7 +190,7 @@ For a **task worker** that captured a recording, include the structured fields b
190
190
  {
191
191
  "summary": "Opened Calculator, typed 2+2, hit Return. Got 4.",
192
192
  "recording": {
193
- "path": "/Users/me/recordings/rec-abc123-calculator-demo.mov",
193
+ "path": "/Users/me/recordings/rec-abc123-calculator-demo.mp4",
194
194
  "durationSec": 42,
195
195
  "sizeMb": 18.4,
196
196
  "description": "Full screen recording of the Calculator interaction"
@@ -0,0 +1,96 @@
1
+ ---
2
+ name: Skill Authoring
3
+ description: Create, edit, debug, or explain SparkECoder skills and rules. Load when the user asks to add a skill, edit a skill, teach agents a workflow, update skill discovery, or explain where skill files live.
4
+ ---
5
+
6
+ # Skill Authoring
7
+
8
+ SparkECoder skills are filesystem-backed markdown files. Use normal file tools (`read_file`, `write_file`, `bash`) to inspect, create, edit, and verify them.
9
+
10
+ ## Skill Locations
11
+
12
+ Discovery starts from the configured working directory. Higher priority wins when two skills share the same name.
13
+
14
+ 1. `.sparkecoder/rules/` - always loaded into every agent turn.
15
+ 2. `.sparkecoder/skills/` - on-demand skills for this project.
16
+ 3. `.cursor/rules/` - Cursor-style rule files; frontmatter can make them always loaded.
17
+ 4. `.claude/skills/` - Claude/Cursor skill directories with `SKILL.md`.
18
+ 5. `skills/` - legacy project skills.
19
+ 6. `src/skills/default/` - built-in SparkECoder skills shipped with this package.
20
+
21
+ Configured `skills.additionalDirectories` in `sparkecoder.config.json` are also loaded after these discovered directories.
22
+
23
+ ## Preferred Placement
24
+
25
+ - Project-specific behavior: create `.sparkecoder/skills/<skill-name>.md` or `.sparkecoder/skills/<skill-name>/SKILL.md`.
26
+ - Always-on project guidance: create `.sparkecoder/rules/<rule-name>.md`.
27
+ - Built-in behavior for all SparkECoder installs: edit or add `src/skills/default/<skill-name>.md`.
28
+ - Legacy compatibility only: use `skills/`.
29
+
30
+ Do not create skills in Cursor's internal `~/.cursor/skills-cursor/` directory.
31
+
32
+ ## File Formats
33
+
34
+ Flat markdown skill:
35
+
36
+ ```markdown
37
+ ---
38
+ name: Skill Name
39
+ description: What this skill does and when to load it.
40
+ ---
41
+
42
+ # Skill Name
43
+
44
+ Instructions...
45
+ ```
46
+
47
+ Directory skill:
48
+
49
+ ```text
50
+ .sparkecoder/skills/skill-name/
51
+ SKILL.md
52
+ reference.md
53
+ examples.md
54
+ ```
55
+
56
+ Keep `SKILL.md` concise. Put long references or examples in sibling files and link to them by relative path.
57
+
58
+ ## Frontmatter
59
+
60
+ Supported fields:
61
+
62
+ - `name`: Display/load name. Matching is case-insensitive.
63
+ - `description`: Appears in the available-skills list; include trigger terms.
64
+ - `alwaysApply: true`: Always inject this skill.
65
+ - `globs`: Auto-load when active files match patterns.
66
+ - `platforms`: Optional process platforms (`darwin`, `linux`, `win32`).
67
+
68
+ Example:
69
+
70
+ ```markdown
71
+ ---
72
+ name: React Doctor
73
+ description: Check React code for common bugs after UI edits. Load after changing React components, hooks, or client state.
74
+ globs: ["*.tsx", "*.jsx", "web/src/**"]
75
+ ---
76
+ ```
77
+
78
+ ## Workflow
79
+
80
+ 1. Inspect existing skills with `ls` or file search before adding a new one.
81
+ 2. Prefer editing an existing skill if it already owns the workflow.
82
+ 3. Use a clear lowercase filename such as `skill-authoring.md`.
83
+ 4. Write a specific description that says both what the skill does and when to load it.
84
+ 5. Keep instructions action-oriented and repo-specific.
85
+ 6. Verify discovery by running the focused skills tests or loading the skill by name.
86
+
87
+ ## Verification
88
+
89
+ Useful checks:
90
+
91
+ ```bash
92
+ pnpm vitest run tests/skills.test.ts
93
+ pnpm run typecheck
94
+ ```
95
+
96
+ If you edited built-in skills, rebuild before expecting installed CLIs to see the change.
@@ -1,7 +1,7 @@
1
1
  import * as ai from 'ai';
2
2
  import { ToolSet } from 'ai';
3
- import { B as BashToolProgress, W as WriteFileProgress, S as SearchToolProgress } from '../search-DOzC4ojH.js';
4
- export { b as BashToolOptions, d as SearchToolOptions, e as WriteFileToolOptions, c as createBashTool, f as createSearchTool, a as createWriteFileTool } from '../search-DOzC4ojH.js';
3
+ import { B as BashToolProgress, W as WriteFileProgress, S as SearchToolProgress } from '../search-CVVfuBPZ.js';
4
+ export { b as BashToolOptions, d as SearchToolOptions, e as WriteFileToolOptions, c as createBashTool, f as createSearchTool, a as createWriteFileTool } from '../search-CVVfuBPZ.js';
5
5
 
6
6
  interface TaskCompletionSignal {
7
7
  status: 'completed' | 'failed';
@@ -110,7 +110,7 @@ interface TodoToolOptions {
110
110
  workingDirectory: string;
111
111
  }
112
112
  declare function createTodoTool(options: TodoToolOptions): ai.Tool<{
113
- action: "list" | "add" | "mark" | "clear" | "save_plan" | "list_plans" | "get_plan" | "delete_plan";
113
+ action: "clear" | "add" | "list" | "mark" | "save_plan" | "list_plans" | "get_plan" | "delete_plan";
114
114
  status?: "completed" | "pending" | "in_progress" | "cancelled" | undefined;
115
115
  items?: {
116
116
  content: string;
@@ -32,7 +32,10 @@ var init_types = __esm({
32
32
  // not listed here. Values match `process.platform`
33
33
  // (darwin, linux, win32, freebsd, ...). If omitted or empty, the skill is
34
34
  // available on all platforms.
35
- platforms: z.array(z.string()).optional().default([])
35
+ platforms: z.array(z.string()).optional().default([]),
36
+ // Optional approximate token budget for always-loaded content. If set,
37
+ // the prompt builder truncates this skill/rule before injecting it.
38
+ contextBudgetTokens: z.number().int().positive().optional()
36
39
  });
37
40
  TaskConfigSchema = z.object({
38
41
  enabled: z.boolean(),
@@ -3270,6 +3273,8 @@ function parseSkillFrontmatter(content) {
3270
3273
  data[key] = true;
3271
3274
  } else if (value === "false") {
3272
3275
  data[key] = false;
3276
+ } else if (/^\d+$/.test(value)) {
3277
+ data[key] = Number(value);
3273
3278
  } else {
3274
3279
  data[key] = value;
3275
3280
  }
@@ -3329,7 +3334,8 @@ async function loadSkillsFromDirectory(directory, options = {}) {
3329
3334
  loadType,
3330
3335
  priority,
3331
3336
  sourceDir: directory,
3332
- platforms: parsed.metadata.platforms
3337
+ platforms: parsed.metadata.platforms,
3338
+ contextBudgetTokens: parsed.metadata.contextBudgetTokens
3333
3339
  });
3334
3340
  } else {
3335
3341
  const name = getSkillNameFromPath(filePath);
@@ -3343,7 +3349,8 @@ async function loadSkillsFromDirectory(directory, options = {}) {
3343
3349
  loadType: forceAlwaysApply ? "always" : defaultLoadType,
3344
3350
  priority,
3345
3351
  sourceDir: directory,
3346
- platforms: []
3352
+ platforms: [],
3353
+ contextBudgetTokens: void 0
3347
3354
  });
3348
3355
  }
3349
3356
  }
@@ -3385,11 +3392,12 @@ function formatSkillsForContext(skills) {
3385
3392
  if (onDemandSkills.length === 0) {
3386
3393
  return "No on-demand skills available.";
3387
3394
  }
3388
- const lines = ["Available skills (use load_skill tool to load into context):"];
3395
+ const lines = ["<available_skills>", "Use the load_skill tool to load one of these into context:"];
3389
3396
  for (const skill of onDemandSkills) {
3390
3397
  const globInfo = skill.globs?.length ? ` [auto-loads for: ${skill.globs.join(", ")}]` : "";
3391
3398
  lines.push(`- ${skill.name}: ${skill.description}${globInfo}`);
3392
3399
  }
3400
+ lines.push("</available_skills>");
3393
3401
  return lines.join("\n");
3394
3402
  }
3395
3403