deepclause-sdk 0.0.60 → 0.0.62

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 (82) hide show
  1. package/README.md +346 -87
  2. package/dist/cli/compile.d.ts +10 -0
  3. package/dist/cli/compile.d.ts.map +1 -1
  4. package/dist/cli/compile.js +62 -11
  5. package/dist/cli/compile.js.map +1 -1
  6. package/dist/cli/config.d.ts +6 -0
  7. package/dist/cli/config.d.ts.map +1 -1
  8. package/dist/cli/config.js +72 -0
  9. package/dist/cli/config.js.map +1 -1
  10. package/dist/cli/default-skills.d.ts +9 -0
  11. package/dist/cli/default-skills.d.ts.map +1 -0
  12. package/dist/cli/default-skills.js +175 -0
  13. package/dist/cli/default-skills.js.map +1 -0
  14. package/dist/cli/index.js +134 -10
  15. package/dist/cli/index.js.map +1 -1
  16. package/dist/cli/run.d.ts +2 -0
  17. package/dist/cli/run.d.ts.map +1 -1
  18. package/dist/cli/run.js +19 -62
  19. package/dist/cli/run.js.map +1 -1
  20. package/dist/cli/tui.d.ts +52 -1
  21. package/dist/cli/tui.d.ts.map +1 -1
  22. package/dist/cli/tui.js +2326 -109
  23. package/dist/cli/tui.js.map +1 -1
  24. package/dist/compiler.d.ts +10 -0
  25. package/dist/compiler.d.ts.map +1 -1
  26. package/dist/compiler.js +27 -6
  27. package/dist/compiler.js.map +1 -1
  28. package/dist/prolog/bridge.js +1 -1
  29. package/dist/prolog/bridge.js.map +1 -1
  30. package/dist/runner.d.ts.map +1 -1
  31. package/dist/runner.js +26 -14
  32. package/dist/runner.js.map +1 -1
  33. package/dist/sdk.d.ts.map +1 -1
  34. package/dist/sdk.js +44 -0
  35. package/dist/sdk.js.map +1 -1
  36. package/dist/system/assets/docs/CONDUCTOR_PROMPT.md +30 -5
  37. package/dist/system/assets/docs/DML_COMPILER_PROMPT.md +16 -6
  38. package/dist/system/assets/docs/TUI.md +139 -0
  39. package/dist/system/assets/index.d.ts +11 -1
  40. package/dist/system/assets/index.d.ts.map +1 -1
  41. package/dist/system/assets/index.js +62 -7
  42. package/dist/system/assets/index.js.map +1 -1
  43. package/dist/system/assets/skills/skill-creator.dml +6 -2
  44. package/dist/system/runtime/agentvm-manager.d.ts +28 -1
  45. package/dist/system/runtime/agentvm-manager.d.ts.map +1 -1
  46. package/dist/system/runtime/agentvm-manager.js +18 -2
  47. package/dist/system/runtime/agentvm-manager.js.map +1 -1
  48. package/dist/system/runtime/catalog-skills.d.ts +45 -0
  49. package/dist/system/runtime/catalog-skills.d.ts.map +1 -0
  50. package/dist/system/runtime/catalog-skills.js +110 -0
  51. package/dist/system/runtime/catalog-skills.js.map +1 -0
  52. package/dist/system/runtime/conductor.d.ts +15 -1
  53. package/dist/system/runtime/conductor.d.ts.map +1 -1
  54. package/dist/system/runtime/conductor.js +19 -65
  55. package/dist/system/runtime/conductor.js.map +1 -1
  56. package/dist/system/runtime/dml-executor.d.ts +8 -0
  57. package/dist/system/runtime/dml-executor.d.ts.map +1 -1
  58. package/dist/system/runtime/dml-executor.js +106 -54
  59. package/dist/system/runtime/dml-executor.js.map +1 -1
  60. package/dist/system/runtime/dml-params.d.ts +11 -0
  61. package/dist/system/runtime/dml-params.d.ts.map +1 -0
  62. package/dist/system/runtime/dml-params.js +45 -0
  63. package/dist/system/runtime/dml-params.js.map +1 -0
  64. package/dist/system/runtime/runtime-tools.d.ts +6 -1
  65. package/dist/system/runtime/runtime-tools.d.ts.map +1 -1
  66. package/dist/system/runtime/runtime-tools.js +41 -2
  67. package/dist/system/runtime/runtime-tools.js.map +1 -1
  68. package/dist/system/runtime/shell-manager.d.ts +3 -3
  69. package/dist/system/runtime/shell-manager.d.ts.map +1 -1
  70. package/dist/system/runtime/shell-manager.js +31 -3
  71. package/dist/system/runtime/shell-manager.js.map +1 -1
  72. package/dist/system/runtime/shell-tool-events.d.ts +11 -0
  73. package/dist/system/runtime/shell-tool-events.d.ts.map +1 -0
  74. package/dist/system/runtime/shell-tool-events.js +139 -0
  75. package/dist/system/runtime/shell-tool-events.js.map +1 -0
  76. package/dist/system/runtime/skill-creator.d.ts +3 -0
  77. package/dist/system/runtime/skill-creator.d.ts.map +1 -1
  78. package/dist/system/runtime/skill-creator.js +90 -128
  79. package/dist/system/runtime/skill-creator.js.map +1 -1
  80. package/dist/types.d.ts +12 -0
  81. package/dist/types.d.ts.map +1 -1
  82. package/package.json +1 -1
package/dist/sdk.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"sdk.js","sourceRoot":"","sources":["../src/sdk.ts"],"names":[],"mappings":"AAAA;;GAEG;AAaH,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AACpD,OAAO,KAAK,EAAE,MAAM,aAAa,CAAC;AAClC,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAE7B;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAAC,OAAsB;IAC3D,mDAAmD;IACnD,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,IAAI,cAAc,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IAEnE,yCAAyC;IACzC,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;QACnB,SAAS,CAAC,QAAQ,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;IACtC,CAAC;IAED,6BAA6B;IAC7B,MAAM,KAAK,GAAG,MAAM,UAAU,EAAE,CAAC;IAEjC,6BAA6B;IAC7B,MAAM,MAAM,GAAG,IAAI,SAAS,CAAC,KAAK,EAAE;QAClC,KAAK,EAAE,OAAO,CAAC,KAAK;QACpB,QAAQ;QACR,WAAW,EAAE,OAAO,CAAC,WAAW,IAAI,GAAG;QACvC,SAAS,EAAE,OAAO,CAAC,SAAS,IAAK,KAAK;QACtC,OAA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@ -1,6 +1,6 @@
1
- # Conductor
1
+ # Who you are
2
2
 
3
- You are **{ASSISTANT_NAME}**, the DeepClause conductor for this session. Complete the task described in your instructions autonomously and report the result clearly when you finish.
3
+ You are **{ASSISTANT_NAME}**, an agent build using the DeepClause framework. Complete the task described in your instructions autonomously and report the result clearly when you finish.
4
4
 
5
5
  ## What You Can Do
6
6
  - **Run skills** from the local catalog via `run_skill`
@@ -17,6 +17,8 @@ You run inside the local DeepClause runtime. The exact workspace path, skill cat
17
17
 
18
18
  Shell commands (`run_bash`) execute with the workspace as the current working directory. Prefer relative paths. Verify tool availability before relying on it, and install missing packages only when the task actually needs them.
19
19
 
20
+ If the user asks about the fullscreen CLI TUI, consult the local TUI guide in the docs directory appended below. It documents the pane layout, menus, slash commands, direct `!<command>` shell mode, skill execution, and session behavior.
21
+
20
22
  ## Decision Flow
21
23
 
22
24
  1. **Check your task instructions**.
@@ -29,7 +31,7 @@ Shell commands (`run_bash`) execute with the workspace as the current working di
29
31
 
30
32
  You manage **task memory**: technical learnings from task execution. After completing a task, use `save_memory` to record what worked, what failed, useful commands, error resolutions, or architectural insights that could help future runs.
31
33
 
32
- You also receive **assistant memory** maintained by the foreground assistant. Use it when relevant.
34
+ You may also receive optional **assistant memory** loaded from the session's `assistant-memory.md` file. It may be empty, and in the current CLI runtime it is not automatically maintained by a built-in conductor tool. Use it when relevant.
33
35
 
34
36
  ## Important Rules
35
37
  - Work autonomously, but ask the user clarifying questions when required.
@@ -41,6 +43,29 @@ You also receive **assistant memory** maintained by the foreground assistant. Us
41
43
  - Not every intermediate action is visible to the user.
42
44
  - Before you call any tool, briefly explain why you are using it.
43
45
 
44
- ## Scheduled Tasks
45
46
 
46
- If the task description mentions `[HEARTBEAT]`, it came from an automated schedule. Execute it directly unless the task itself requires user input.
47
+ ## Background on Skills
48
+
49
+ DeepClause skills are not just freeform prompts. They are executable **DML** programs in the local skill catalog.
50
+
51
+ - **DML** stands for DeepClause Meta Language.
52
+ - DML is a **Prolog-based DSL** used to express task logic, tool calls, branching, retries, recursion, and other agent workflows with more reliable execution semantics than plain prompt text.
53
+ - In this runtime, the **conductor** is the router and orchestrator. Normal compiled skills are the worker programs it delegates to.
54
+
55
+ When you decide a task should become a reusable capability, do **not** try to invent or hand-author raw DML in your own reply. Instead, use `create_new_skill` so the dedicated **skill creator** can compile a proper skill from a detailed spec, validate it, test it, and publish it into the local catalog.
56
+
57
+ Use this model:
58
+
59
+ - If a matching existing skill already exists, run it with `run_skill`.
60
+ - If the task is one-off and does not need reuse, solve it directly with the available tools.
61
+ - If the task should become a reusable automation, call `create_new_skill` with a strong specification.
62
+
63
+ When writing a spec for `create_new_skill`, make it concrete. Describe:
64
+
65
+ - the skill's purpose
66
+ - its inputs and expected outputs
67
+ - the tools it should use
68
+ - important workflow steps and decision points
69
+ - edge cases, failure handling, and constraints
70
+
71
+ Prefer creating skills through the skill creator over trying to simulate a reusable skill manually inside the conductor. The goal is to produce a real compiled DML worker that can be reused later, not just an ad hoc one-turn solution.
@@ -66,13 +66,10 @@ RULE 7: Every agent_main MUST have a fallback clause with NO LLM calls.
66
66
  RULE 8: Use output/1 before every long-running operation (task, exec).
67
67
  A skill that runs silently appears broken to the user.
68
68
 
69
- RULE 9: No curl or wget in bash. Use url_fetch for web content.
70
- bash is for local commands, package installation, and scripts only.
71
-
72
- RULE 10: Never mix {Variable} interpolation with format/3 ~w in the same string.
69
+ RULE 9: Never mix {Variable} interpolation with format/3 ~w in the same string.
73
70
  Use EITHER {Variable} OR format/3, not both.
74
71
 
75
- RULE 11: {word} in ANY string triggers variable interpolation - including system(), output(), answer().
72
+ RULE 10: {word} in ANY string triggers variable interpolation - including system(), output(), answer().
76
73
  If the word matches an unbound Prolog variable, the clause FAILS silently.
77
74
  NEVER use {word} as a placeholder or template example inside strings.
78
75
  Use angle brackets <word> or plain text instead.
@@ -167,7 +164,6 @@ EXACT CALLING SYNTAX AND RETURN TYPES:
167
164
  Access: get_dict(stdout, Result, Output), get_dict(exitCode, Result, Code)
168
165
  NOTE: Working directory is workspace root. Use relative paths.
169
166
  ALLOWED: pip install, npm install, apt-get install
170
- BANNED: curl, wget (use url_fetch instead)
171
167
 
172
168
  5. ask_user - Ask user for input
173
169
  Call: exec(ask_user(prompt: "What is your name?"), Result)
@@ -402,6 +398,20 @@ DO NOT use Python for: simple file writing - use Prolog open/3, write/2, close/1
402
398
  DO NOT use Prolog for: complex data analysis - use Python via bash.
403
399
  </when_to_use_what>
404
400
 
401
+ <skill_reuse>
402
+ REUSING EXISTING SKILLS
403
+
404
+ - Call list_skills when the requested behavior may overlap with an existing local skill.
405
+ - Prefer narrow wrapper predicates that internally call exec(run_skill(...)) for one specific child skill.
406
+ - Do NOT expose a generic tool(run_skill(...)) predicate unless the user explicitly asked for a router or orchestration skill.
407
+
408
+ EXAMPLE WRAPPER:
409
+ tool(search_arxiv_via_skill(Query, Result),
410
+ "Search arXiv by delegating to the existing search-arxiv skill.") :-
411
+ exec(run_skill(slug: "search-arxiv", args: [Query]), Raw),
412
+ get_dict(answer, Raw, Result).
413
+ </skill_reuse>
414
+
405
415
  <runtime_environment>
406
416
  RUNTIME ENVIRONMENT - the skill runs inside the active DeepClause runtime shell.
407
417
 
@@ -0,0 +1,139 @@
1
+ # DeepClause TUI Guide
2
+
3
+ ## Overview
4
+
5
+ Running `deepclause` with no subcommand starts the fullscreen CLI TUI.
6
+
7
+ The TUI is the operator interface around a single built-in agent: the conductor.
8
+
9
+ - The left pane shows sessions.
10
+ - The center pane shows the conversation transcript.
11
+ - The upper-right pane shows live execution activity.
12
+ - The lower-right pane shows context, token usage, system asset sources, and shell execution details.
13
+
14
+ ## Command Bar
15
+
16
+ The command bar accepts three main input styles plus direct skill execution:
17
+
18
+ - Plain text sends a normal request to the conductor.
19
+ - `/...` runs a built-in slash command.
20
+ - `/<skill> [args]` runs a compiled local skill directly.
21
+ - `!<command>` runs a shell command directly in the configured workspace shell.
22
+
23
+ Examples:
24
+
25
+ ```text
26
+ summarize the latest test failures
27
+ /sessions
28
+ /set-model openai:gpt-4.1 --slot run
29
+ /compile create a skill that reviews changelogs
30
+ /deep-research transformers scaling laws
31
+ !git status
32
+ !npm test
33
+ ```
34
+
35
+ Use `\!text` if you need to send a normal conductor prompt that starts with a literal `!`.
36
+
37
+ ## Slash Commands
38
+
39
+ Common built-in slash commands:
40
+
41
+ - `/new [title]` creates a new conductor session.
42
+ - `/sessions` refreshes or switches sessions.
43
+ - `/set-model <model> [--slot <slot>]` updates the configured model for all slots or one slot.
44
+ - `/compile <spec>` runs the skill creator.
45
+ - `/skill-creator <spec>` is an alias for `/compile`.
46
+ - `/cancel` aborts the current running task, skill, or shell command.
47
+ - `/help` prints command help into the execution pane.
48
+ - `/quit` or `/exit` closes the TUI.
49
+
50
+ Any other `/name` is treated as a compiled skill invocation if that skill exists in the local catalog.
51
+
52
+ ## Direct Shell Mode
53
+
54
+ `!<command>` is a TUI-local execution mode. It does not go through the conductor.
55
+
56
+ - The shell command runs immediately.
57
+ - Output streams live into the execution pane.
58
+ - The process pane shows running state, PID when available, and host vs sandbox backend.
59
+ - `/cancel` and `Ctrl+C` stop the running shell command.
60
+ - The skill catalog refreshes after the shell command finishes, so newly created skills can appear without restarting the TUI.
61
+
62
+ If the TUI is running with sandbox mode enabled, shell commands use the AgentVM sandbox instead of the host shell.
63
+
64
+ ## Menus and Palette
65
+
66
+ The TUI includes a Borland-style menu bar and an action palette.
67
+
68
+ - `F10` or `Ctrl+G` opens the menu bar.
69
+ - `Ctrl+P` opens the action palette.
70
+ - The Run menu includes prompt execution, shell command entry, repeat last command, cancellation, and skill catalog refresh.
71
+ - The View menu can move focus between panes.
72
+ - The Files and Skills menus open searchable pickers.
73
+
74
+ ## Navigation and Keys
75
+
76
+ Important keys:
77
+
78
+ - `Left` and `Right` switch the focused pane when the command bar is empty.
79
+ - `Up` and `Down` select sessions or scroll the focused pane.
80
+ - `PgUp` and `PgDn` page-scroll the focused pane.
81
+ - `End` jumps back to the newest visible content.
82
+ - `Tab` autocompletes slash commands and skill names.
83
+ - `Ctrl+W` cycles focus across panes.
84
+
85
+ ## Execution Pane
86
+
87
+ The execution pane is the main observability surface.
88
+
89
+ It can show:
90
+
91
+ - conductor streaming output
92
+ - child-skill activity
93
+ - tool lifecycle events
94
+ - live shell stdout and stderr
95
+ - active tool status, including PID when available
96
+
97
+ This is where to look when a task seems stuck, is waiting for clarification, or is running shell or tool-heavy work.
98
+
99
+ ## Context Pane
100
+
101
+ The context pane shows session and runtime state, including:
102
+
103
+ - approximate context and token usage
104
+ - resolved source paths for conductor and skill-creator DML/prompt assets
105
+ - the active shell backend and shell working directory
106
+
107
+ Changes to `.deepclause/system/` overrides are picked up on the next conductor turn or skill-creator run. A dedicated reload action is not required.
108
+
109
+ ## Sessions and Storage
110
+
111
+ Each session lives under `.deepclause/sessions/<session-id>/`.
112
+
113
+ Typical files include:
114
+
115
+ - `metadata.json`
116
+ - `messages.jsonl`
117
+ - `assistant-memory.md`
118
+ - `task-memory.md`
119
+ - `usage.json`
120
+
121
+ The TUI loads these sessions into the session list and shows their messages in the transcript pane.
122
+
123
+ ## Relationship to Skills
124
+
125
+ The conductor is not the same thing as a compiled skill.
126
+
127
+ - The conductor handles freeform user requests and orchestration.
128
+ - Compiled skills are reusable DML workers in `.deepclause/tools/`.
129
+ - `/set-model` updates the configured gateway, run, and compile model selection for future turns, or only one slot when `--slot` is provided.
130
+ - `/compile` and `/skill-creator` use the skill creator to turn a spec into a validated local skill.
131
+
132
+ If a user asks how to automate something repeatedly, the right TUI workflow is usually to use `/compile <spec>` rather than repeating the same one-off prompt manually.
133
+
134
+ ## Troubleshooting
135
+
136
+ - If a command appears to be stuck, check the execution pane for active tool status or a clarification request.
137
+ - If shell commands do not behave as expected, check the context pane for the current shell backend and working directory.
138
+ - If a newly created skill does not appear, refresh the skill catalog or run a new turn after the command completes.
139
+ - If a system prompt or system DML change does not seem active, verify the source paths shown in the context pane.
@@ -1,9 +1,19 @@
1
1
  export type SystemSkillAssetName = 'conductor' | 'skill-creator';
2
2
  export type SystemPromptAssetName = 'conductor' | 'skill-creator';
3
+ export type WorkspaceDocAssetName = 'tui';
3
4
  export declare function getSystemSkillAssetPath(name: SystemSkillAssetName): string;
4
5
  export declare function getSystemPromptAssetPath(name: SystemPromptAssetName): string;
6
+ export declare function getWorkspaceDocAssetPath(name: WorkspaceDocAssetName): string;
7
+ export declare function getSystemAssetSourcePaths(workspaceRoot?: string): {
8
+ conductorDml: string;
9
+ conductorPrompt: string;
10
+ skillCreatorDml: string;
11
+ skillCreatorPrompt: string;
12
+ };
5
13
  export declare function readSystemSkillAsset(name: SystemSkillAssetName, options?: {
6
14
  workspaceRoot?: string;
7
15
  }): Promise<string>;
8
- export declare function readSystemPromptAsset(name: SystemPromptAssetName): Promise<string>;
16
+ export declare function readSystemPromptAsset(name: SystemPromptAssetName, options?: {
17
+ workspaceRoot?: string;
18
+ }): Promise<string>;
9
19
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/system/assets/index.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,oBAAoB,GAAG,WAAW,GAAG,eAAe,CAAC;AACjE,MAAM,MAAM,qBAAqB,GAAG,WAAW,GAAG,eAAe,CAAC;AAiBlE,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,oBAAoB,GAAG,MAAM,CAE1E;AAED,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,qBAAqB,GAAG,MAAM,CAO5E;AAmBD,wBAAsB,oBAAoB,CACxC,IAAI,EAAE,oBAAoB,EAC1B,OAAO,GAAE;IAAE,aAAa,CAAC,EAAE,MAAM,CAAA;CAAO,GACvC,OAAO,CAAC,MAAM,CAAC,CAEjB;AAED,wBAAsB,qBAAqB,CAAC,IAAI,EAAE,qBAAqB,GAAG,OAAO,CAAC,MAAM,CAAC,CAExF"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/system/assets/index.ts"],"names":[],"mappings":"AAKA,MAAM,MAAM,oBAAoB,GAAG,WAAW,GAAG,eAAe,CAAC;AACjE,MAAM,MAAM,qBAAqB,GAAG,WAAW,GAAG,eAAe,CAAC;AAClE,MAAM,MAAM,qBAAqB,GAAG,KAAK,CAAC;AA0B1C,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,oBAAoB,GAAG,MAAM,CAE1E;AAED,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,qBAAqB,GAAG,MAAM,CAE5E;AASD,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,qBAAqB,GAAG,MAAM,CAE5E;AAoED,wBAAgB,yBAAyB,CAAC,aAAa,CAAC,EAAE,MAAM,GAAG;IACjE,YAAY,EAAE,MAAM,CAAC;IACrB,eAAe,EAAE,MAAM,CAAC;IACxB,eAAe,EAAE,MAAM,CAAC;IACxB,kBAAkB,EAAE,MAAM,CAAC;CAC5B,CAOA;AAED,wBAAsB,oBAAoB,CACxC,IAAI,EAAE,oBAAoB,EAC1B,OAAO,GAAE;IAAE,aAAa,CAAC,EAAE,MAAM,CAAA;CAAO,GACvC,OAAO,CAAC,MAAM,CAAC,CAEjB;AAED,wBAAsB,qBAAqB,CACzC,IAAI,EAAE,qBAAqB,EAC3B,OAAO,GAAE;IAAE,aAAa,CAAC,EAAE,MAAM,CAAA;CAAO,GACvC,OAAO,CAAC,MAAM,CAAC,CAEjB"}
@@ -1,3 +1,4 @@
1
+ import { existsSync } from 'fs';
1
2
  import { access, readFile } from 'fs/promises';
2
3
  import { dirname, join } from 'path';
3
4
  import { fileURLToPath } from 'url';
@@ -14,20 +15,48 @@ function getSystemSkillFileName(name) {
14
15
  return 'skill-creator.dml';
15
16
  }
16
17
  }
18
+ function getSystemPromptFileName(name) {
19
+ switch (name) {
20
+ case 'conductor':
21
+ return 'CONDUCTOR_PROMPT.md';
22
+ case 'skill-creator':
23
+ return 'DML_COMPILER_PROMPT.md';
24
+ }
25
+ }
17
26
  export function getSystemSkillAssetPath(name) {
18
27
  return join(SKILLS_DIR, getSystemSkillFileName(name));
19
28
  }
20
29
  export function getSystemPromptAssetPath(name) {
30
+ return join(DOCS_DIR, getSystemPromptFileName(name));
31
+ }
32
+ function getWorkspaceDocFileName(name) {
21
33
  switch (name) {
22
- case 'conductor':
23
- return join(DOCS_DIR, 'CONDUCTOR_PROMPT.md');
24
- case 'skill-creator':
25
- return join(DOCS_DIR, 'DML_COMPILER_PROMPT.md');
34
+ case 'tui':
35
+ return 'TUI.md';
26
36
  }
27
37
  }
38
+ export function getWorkspaceDocAssetPath(name) {
39
+ return join(DOCS_DIR, getWorkspaceDocFileName(name));
40
+ }
41
+ function getWorkspaceOverridePath(workspaceRoot, fileName) {
42
+ return join(workspaceRoot, SYSTEM_OVERRIDE_DIR, fileName);
43
+ }
28
44
  async function resolveSystemSkillAssetPath(name, workspaceRoot) {
29
45
  if (workspaceRoot) {
30
- const overridePath = join(workspaceRoot, SYSTEM_OVERRIDE_DIR, getSystemSkillFileName(name));
46
+ const overridePath = getWorkspaceOverridePath(workspaceRoot, getSystemSkillFileName(name));
47
+ try {
48
+ await access(overridePath);
49
+ return overridePath;
50
+ }
51
+ catch {
52
+ // Fall back to the packaged asset when no workspace override exists.
53
+ }
54
+ }
55
+ return getSystemSkillAssetPath(name);
56
+ }
57
+ async function resolveSystemPromptAssetPath(name, workspaceRoot) {
58
+ if (workspaceRoot) {
59
+ const overridePath = getWorkspaceOverridePath(workspaceRoot, getSystemPromptFileName(name));
31
60
  try {
32
61
  await access(overridePath);
33
62
  return overridePath;
@@ -36,12 +65,38 @@ async function resolveSystemSkillAssetPath(name, workspaceRoot) {
36
65
  // Fall back to the packaged asset when no workspace override exists.
37
66
  }
38
67
  }
68
+ return getSystemPromptAssetPath(name);
69
+ }
70
+ function resolveSystemSkillAssetPathSync(name, workspaceRoot) {
71
+ if (workspaceRoot) {
72
+ const overridePath = getWorkspaceOverridePath(workspaceRoot, getSystemSkillFileName(name));
73
+ if (existsSync(overridePath)) {
74
+ return overridePath;
75
+ }
76
+ }
39
77
  return getSystemSkillAssetPath(name);
40
78
  }
79
+ function resolveSystemPromptAssetPathSync(name, workspaceRoot) {
80
+ if (workspaceRoot) {
81
+ const overridePath = getWorkspaceOverridePath(workspaceRoot, getSystemPromptFileName(name));
82
+ if (existsSync(overridePath)) {
83
+ return overridePath;
84
+ }
85
+ }
86
+ return getSystemPromptAssetPath(name);
87
+ }
88
+ export function getSystemAssetSourcePaths(workspaceRoot) {
89
+ return {
90
+ conductorDml: resolveSystemSkillAssetPathSync('conductor', workspaceRoot),
91
+ conductorPrompt: resolveSystemPromptAssetPathSync('conductor', workspaceRoot),
92
+ skillCreatorDml: resolveSystemSkillAssetPathSync('skill-creator', workspaceRoot),
93
+ skillCreatorPrompt: resolveSystemPromptAssetPathSync('skill-creator', workspaceRoot),
94
+ };
95
+ }
41
96
  export async function readSystemSkillAsset(name, options = {}) {
42
97
  return readFile(await resolveSystemSkillAssetPath(name, options.workspaceRoot), 'utf8');
43
98
  }
44
- export async function readSystemPromptAsset(name) {
45
- return readFile(getSystemPromptAssetPath(name), 'utf8');
99
+ export async function readSystemPromptAsset(name, options = {}) {
100
+ return readFile(await resolveSystemPromptAssetPath(name, options.workspaceRoot), 'utf8');
46
101
  }
47
102
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/system/assets/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AACrC,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AAKpC,MAAM,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAClD,MAAM,SAAS,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AACtC,MAAM,UAAU,GAAG,IAAI,CAAC,SAAS,EAAE,QAAQ,C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sC,EAAE;IAExC,OAAO,QAAQ,CAAC,MAAM,4BAA4B,CAAC,IAAI,EAAE,OAAO,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC,CAAC;AAC3F,CAAC"}
@@ -34,6 +34,10 @@ tool(fetch(Url, Content),
34
34
  exec(url_fetch(url: Url), Result),
35
35
  get_dict(body, Result, Content).
36
36
 
37
+ tool(list_skills(Skills),
38
+ "List reusable local skills in the current workspace catalog. Use this before re-implementing a capability that might already exist.") :-
39
+ exec(list_skills, Skills).
40
+
37
41
  tool(shell(Command, Result),
38
42
  "Run a shell command on the VM. Returns dict with: success (boolean), stdout (string), stderr (string), exitCode (integer), summary (string). Use for package installation, environment checks, and helper script creation/testing. Always check the 'success' field.") :-
39
43
  exec(bash(command: Command), Result).
@@ -73,7 +77,7 @@ agent_main(SpecMarkdown) :-
73
77
  % -- Phase 1: Understand & Research --------------------------------------
74
78
  output("Phase 1/4: Understanding requirements and researching dependencies..."),
75
79
  format(string(ResearchTask),
76
- "You are starting to build a DML skill from the specification below.\n\nYour job in this phase:\n1. Read the specification carefully. If anything is ambiguous or missing, use ask_user to clarify before proceeding.\n2. Identify all external dependencies (Python packages, Node modules, system tools, APIs, CLI tools).\n3. For each dependency, use search or fetch to look up installation instructions, API docs, or usage examples if you are not already familiar with them.\n4. Summarise: what the skill does, its inputs/outputs, all dependencies found, and any tricky parts.\n\nSpecification:\n---\n~w\n---\n\nStore your findings in ResearchSummary.",
80
+ "You are starting to build a DML skill from the specification below.\n\nYour job in this phase:\n1. Read the specification carefully. If anything is ambiguous or missing, use ask_user to clarify before proceeding.\n2. Call list_skills if an existing local skill might already cover part of the requested functionality.\n3. Identify all external dependencies (Python packages, Node modules, system tools, APIs, CLI tools).\n4. For each dependency, use search or fetch to look up installation instructions, API docs, or usage examples if you are not already familiar with them.\n5. Summarise: what the skill does, whether any existing skills should be reused, its inputs/outputs, all dependencies found, and any tricky parts.\n\nSpecification:\n---\n~w\n---\n\nStore your findings in ResearchSummary.",
77
81
  [SpecMarkdown]),
78
82
  task(ResearchTask, string(ResearchSummary)),
79
83
  output(ResearchSummary),
@@ -89,7 +93,7 @@ agent_main(SpecMarkdown) :-
89
93
  % -- Phase 3: Implement, Validate, Test ----------------------------------
90
94
  output("Phase 3/4: Writing DML, validating, and testing..."),
91
95
  format(string(ImplTask),
92
- "Write, validate, and test the DML skill.\n\nBackground:\n- Research: ~w\n- Environment: ~w\n- Original specification: ~w\n\nYour job in this phase:\n1. Write a complete DML implementation plan (tool definitions, agent_main structure, fallback clause).\n2. Write the full DML code to a .dml file using write(). NEVER use bash heredocs for DML - they mangle backslashes and special Prolog characters. NEVER pass DML as an inline string to validate or test_run.\n3. Call validate('my-skill.dml') - if there are syntax errors, fix the code using write() and re-validate until valid.\n4. Call test_run('my-skill.dml', ...) with a realistic test input - if it fails, analyse the error/trace, fix the code with write(), and re-test until passing.\n5. Keep iterating on validate -> test until the skill works correctly.\n\nStore the final .dml file path in FinalDML.",
96
+ "Write, validate, and test the DML skill.\n\nBackground:\n- Research: ~w\n- Environment: ~w\n- Original specification: ~w\n\nYour job in this phase:\n1. Write a complete DML implementation plan (tool definitions, agent_main structure, fallback clause).\n2. If you reuse an existing local skill, prefer a narrow wrapper tool predicate that internally calls exec(run_skill(...)) for that specific child skill. Do NOT expose a generic tool(run_skill(...)) predicate unless the user explicitly asked for an orchestration skill.\n3. Write the full DML code to a .dml file using write(). NEVER use bash heredocs for DML - they mangle backslashes and special Prolog characters. NEVER pass DML as an inline string to validate or test_run.\n4. Call validate('my-skill.dml') - if there are syntax errors, fix the code using write() and re-validate until valid.\n5. Call test_run('my-skill.dml', ...) with a realistic test input - if it fails, analyse the error/trace, fix the code with write(), and re-test until passing.\n6. Keep iterating on validate -> test until the skill works correctly.\n\nStore the final .dml file path in FinalDML.",
93
97
  [ResearchSummary, EnvSummary, SpecMarkdown]),
94
98
  task(ImplTask, string(FinalDML)),
95
99
  output("✅ DML implementation ready."),
@@ -4,6 +4,33 @@ export interface ShellExecResult {
4
4
  stderr: string;
5
5
  exitCode: number;
6
6
  summary: string;
7
+ pid?: number;
8
+ backend: 'host' | 'sandbox';
9
+ }
10
+ export interface ShellExecStartEvent {
11
+ command: string;
12
+ pid?: number;
13
+ backend: 'host' | 'sandbox';
14
+ }
15
+ export interface ShellExecChunkEvent {
16
+ command: string;
17
+ chunk: string;
18
+ pid?: number;
19
+ backend: 'host' | 'sandbox';
20
+ }
21
+ export interface ShellExecExitEvent {
22
+ command: string;
23
+ pid?: number;
24
+ backend: 'host' | 'sandbox';
25
+ success: boolean;
26
+ exitCode: number;
27
+ summary: string;
28
+ }
29
+ export interface ShellExecObserver {
30
+ onStart?: (event: ShellExecStartEvent) => void;
31
+ onStdout?: (event: ShellExecChunkEvent) => void;
32
+ onStderr?: (event: ShellExecChunkEvent) => void;
33
+ onExit?: (event: ShellExecExitEvent) => void;
7
34
  }
8
35
  export declare class AgentVMManager {
9
36
  private readonly workspacePath;
@@ -11,7 +38,7 @@ export declare class AgentVMManager {
11
38
  private vm;
12
39
  readonly kind: "sandbox";
13
40
  constructor(workspacePath: string, network: boolean);
14
- exec(command: string, signal?: AbortSignal): Promise<ShellExecResult>;
41
+ exec(command: string, signal?: AbortSignal, observer?: ShellExecObserver): Promise<ShellExecResult>;
15
42
  dispose(): Promise<void>;
16
43
  private getVM;
17
44
  }
@@ -1 +1 @@
1
- {"version":3,"file":"agentvm-manager.d.ts","sourceRoot":"","sources":["../../../src/system/runtime/agentvm-manager.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,qBAAa,cAAc;IAKvB,OAAO,CAAC,QAAQ,CAAC,aAAa;IAC9B,OAAO,CAAC,QAAQ,CAAC,OAAO;IAL1B,OAAO,CAAC,EAAE,CAA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I,CAAC;IAC/C,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,mBAAmB,KAAK,IAAI,CAAC;IAChD,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,mBAAmB,KAAK,IAAI,CAAC;IAChD,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,kBAAkB,KAAK,IAAI,CAAC;CAC9C;AAED,qBAAa,cAAc;IAKvB,OAAO,CAAC,QAAQ,CAAC,aAAa;IAC9B,OAAO,CAAC,QAAQ,CAAC,OAAO;IAL1B,OAAO,CAAC,EAAE,CAAwB;IAClC,QAAQ,CAAC,IAAI,EAAG,SAAS,CAAU;gBAGhB,aAAa,EAAE,MAAM,EACrB,OAAO,EAAE,OAAO;IAG7B,IAAI,CACR,OAAO,EAAE,MAAM,EACf,MAAM,CAAC,EAAE,WAAW,EACpB,QAAQ,CAAC,EAAE,iBAAiB,GAC3B,OAAO,CAAC,eAAe,CAAC;IAkFrB,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;YAOhB,KAAK;CAepB"}
@@ -8,11 +8,12 @@ export class AgentVMManager {
8
8
  this.workspacePath = workspacePath;
9
9
  this.network = network;
10
10
  }
11
- async exec(command, signal) {
11
+ async exec(command, signal, observer) {
12
12
  if (signal?.aborted) {
13
13
  throw abortError(signal.reason);
14
14
  }
15
15
  const vm = await this.getVM();
16
+ observer?.onStart?.({ command, backend: this.kind });
16
17
  const result = signal
17
18
  ? await new Promise((resolve, reject) => {
18
19
  let settled = false;
@@ -60,13 +61,28 @@ export class AgentVMManager {
60
61
  const stdout = result.stdout ?? '';
61
62
  const stderr = result.stderr ?? '';
62
63
  const exitCode = result.exitCode ?? 0;
63
- return {
64
+ const execResult = {
64
65
  success: exitCode === 0,
65
66
  stdout,
66
67
  stderr,
67
68
  exitCode,
69
+ backend: this.kind,
68
70
  summary: exitCode === 0 ? 'Command completed successfully' : (stderr || `Command failed with exit code ${exitCode}`),
69
71
  };
72
+ if (stdout) {
73
+ observer?.onStdout?.({ command, chunk: stdout, backend: this.kind });
74
+ }
75
+ if (stderr) {
76
+ observer?.onStderr?.({ command, chunk: stderr, backend: this.kind });
77
+ }
78
+ observer?.onExit?.({
79
+ command,
80
+ backend: this.kind,
81
+ success: execResult.success,
82
+ exitCode,
83
+ summary: execResult.summary,
84
+ });
85
+ return execResult;
70
86
  }
71
87
  async dispose() {
72
88
  if (this.vm) {
@@ -1 +1 @@
1
- {"version":3,"file":"agentvm-manager.js","sourceRoot":"","sources":["../../../src/system/runtime/agentvm-manager.ts"],"names":[],"mappings":"AAEA,IAAI,YAAY,GAA+F,IAAI,CAAC;AAUpH,MAAM,OAAO,cAAc;IAKN;IACA;IALX,EAAE,GAAmB,IAAI,CAAC;IACzB,IAAI,GAAG,SAAkB,CAAC;IAEnC,YACmB,aAAqB,EACrB,OAAgB;QADhB,kBAAa,GAAb,aAAa,CAAQ;QACrB,YAAO,GAAP,OAAO,CAAS;IAChC,CAAC;IAEJ,KAAK,CAAC,IAAI,CAAC,OAAe,EAAE,MAAoB;QAC9C,IAAI,MAAM,EAAE,OAAO,EAAE,CAAC;YACpB,MAAM,UAAU,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QAClC,CAAC;QAED,MAAM,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,EAAE,CAAC;QAC9B,MAAM,MAAM,GAAG,MAAM;YACnB,CAAC,CAAC,MAAM,IAAI,OAAO,CAAuC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;gBAC1E,IAAI,OAAO,GAAG,KAAK,CAAC;gBACpB,MAAM,aAAa,GAAG,CAAC,KAA2C,EAAE,EAAE;oBACpE,IAAI,OAAO,EAAE,CAAC;wBACZ,OAAO;oBACT,CAAC;oBACD,OAAO,GAAG,IAAI,CAAC;oBACf,OAAO,EAAE,CAAC;oBACV,OAAO,CAAC,KAAK,CAAC,CAAC;gBACjB,CAAC,CAAC;gBACF,MAAM,YAAY,GAAG,CAAC,KAAc,EAAE,EAAE;oBACtC,IAAI,OAAO,E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M,CAAC,oBAAoB,CAAC,CAAC;YAC/C,YAAY,GAAG,GAAG,CAAC,OAAO,CAAC;QAC7B,CAAC;QACD,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC;YACb,IAAI,CAAC,EAAE,GAAG,IAAI,YAAa,CAAC;gBAC1B,OAAO,EAAE,IAAI,CAAC,OAAO;gBACrB,MAAM,EAAE,EAAE,YAAY,EAAE,IAAI,CAAC,aAAa,EAAE;aAC7C,CAAC,CAAC;YACH,MAAM,IAAI,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC;YACtB,MAAM,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;QACtC,CAAC;QACD,OAAO,IAAI,CAAC,EAAE,CAAC;IACjB,CAAC;CACF;AAED,SAAS,UAAU,CAAC,MAAe;IACjC,OAAO,MAAM,YAAY,KAAK;QAC5B,CAAC,CAAC,MAAM;QACR,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,4BAA4B,CAAC,EAAE,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC,CAAC;AACrF,CAAC"}
@@ -0,0 +1,45 @@
1
+ import { type Config, type ResolvedModelConfig } from '../../cli/config.js';
2
+ export declare const DEFAULT_MAX_SKILL_DEPTH = 3;
3
+ export interface LocalSkillCatalogEntry {
4
+ slug: string;
5
+ description: string;
6
+ parameters?: unknown[];
7
+ tools?: string[];
8
+ compiled_at?: string;
9
+ model?: string;
10
+ }
11
+ export interface ExecuteNestedSkillRequest {
12
+ slug: string;
13
+ dmlCode: string;
14
+ args: string[];
15
+ params: Record<string, unknown>;
16
+ currentSkillSlug: string;
17
+ invocationStack: string[];
18
+ }
19
+ export interface ExecuteNestedSkillResult {
20
+ output: string[];
21
+ answer?: string;
22
+ error?: string;
23
+ trace?: object;
24
+ }
25
+ export interface LocalSkillCatalogRuntime {
26
+ listSkills(): Promise<LocalSkillCatalogEntry[]>;
27
+ runSkill(args: Record<string, unknown>): Promise<Record<string, unknown>>;
28
+ }
29
+ export interface LocalSkillCatalogRuntimeOptions {
30
+ workspaceRoot: string;
31
+ workspacePath: string;
32
+ config: Config;
33
+ selection: ResolvedModelConfig;
34
+ currentSkillSlug?: string;
35
+ invocationStack?: string[];
36
+ maxDepth?: number;
37
+ includeSystemSkillsInList?: boolean;
38
+ executeNestedSkill(request: ExecuteNestedSkillRequest): Promise<ExecuteNestedSkillResult>;
39
+ }
40
+ export declare function listLocalSkillCatalog(workspaceRoot: string, options?: {
41
+ detailed?: boolean;
42
+ includeSystemSkills?: boolean;
43
+ }): Promise<LocalSkillCatalogEntry[]>;
44
+ export declare function createLocalSkillCatalogRuntime(options: LocalSkillCatalogRuntimeOptions): LocalSkillCatalogRuntime;
45
+ //# sourceMappingURL=catalog-skills.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"catalog-skills.d.ts","sourceRoot":"","sources":["../../../src/system/runtime/catalog-skills.ts"],"names":[],"mappings":"AAGA,OAAO,EAAe,KAAK,MAAM,EAAE,KAAK,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAIzF,eAAO,MAAM,uBAAuB,IAAI,CAAC;AAYzC,MAAM,WAAW,sBAAsB;IACrC,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,EAAE,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,yBAAyB;IACxC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChC,gBAAgB,EAAE,MAAM,CAAC;IACzB,eAAe,EAAE,MAAM,EAAE,CAAC;CAC3B;AAED,MAAM,W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