prompt-language-shell 0.9.6 → 1.0.0
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.
- package/README.md +134 -46
- package/dist/components/Component.js +5 -3
- package/dist/components/controllers/Command.js +3 -19
- package/dist/components/controllers/Config.js +109 -75
- package/dist/components/controllers/Execute.js +17 -14
- package/dist/components/controllers/Introspect.js +2 -4
- package/dist/components/controllers/Validate.js +3 -2
- package/dist/components/views/Execute.js +1 -1
- package/dist/components/views/Output.js +89 -35
- package/dist/components/views/Subtask.js +12 -7
- package/dist/components/views/Task.js +4 -5
- package/dist/components/views/Upcoming.js +1 -1
- package/dist/configuration/io.js +10 -0
- package/dist/configuration/schema.js +6 -0
- package/dist/configuration/validation.js +5 -0
- package/dist/execution/processing.js +45 -14
- package/dist/execution/runner.js +46 -30
- package/dist/index.js +2 -0
- package/dist/services/anthropic.js +5 -4
- package/dist/services/filesystem.js +13 -1
- package/dist/services/logger.js +176 -28
- package/dist/services/messages.js +7 -4
- package/dist/services/monitor.js +304 -0
- package/dist/services/performance.js +14 -0
- package/dist/services/refinement.js +7 -16
- package/dist/services/router.js +223 -95
- package/dist/services/shell.js +49 -16
- package/dist/services/utils.js +11 -0
- package/dist/skills/execute.md +82 -3
- package/dist/skills/schedule.md +7 -0
- package/package.json +11 -10
package/dist/skills/execute.md
CHANGED
|
@@ -100,14 +100,28 @@ position.
|
|
|
100
100
|
|
|
101
101
|
### How to Generate Commands from Skills
|
|
102
102
|
|
|
103
|
+
**CRITICAL - ONE TASK = ONE COMMAND**: Each input task maps to exactly
|
|
104
|
+
ONE command in your response. The task's action tells you WHICH specific
|
|
105
|
+
step from the skill to use. Do NOT expand an entire skill workflow for
|
|
106
|
+
a single task - only generate the command for that specific step.
|
|
107
|
+
|
|
103
108
|
1. **Identify skill tasks**: Check if tasks have params.skill
|
|
104
109
|
2. **Find the skill**: Look up the skill in "Available Skills" section
|
|
105
110
|
below (REQUIRED - must exist)
|
|
106
|
-
3. **Match
|
|
107
|
-
|
|
108
|
-
|
|
111
|
+
3. **Match task action to skill step**: The task action describes which
|
|
112
|
+
step from the skill's Steps section this task represents. Find the
|
|
113
|
+
matching step by semantic meaning (e.g., "Export results" matches
|
|
114
|
+
"Export the results to {FORMAT}", NOT all three steps of the skill)
|
|
115
|
+
4. **Use corresponding Execution line**: Once you identify which step
|
|
116
|
+
the task represents, use ONLY that step's corresponding Execution line
|
|
117
|
+
5. **Substitute parameters**: Replace {PARAM} placeholders with actual
|
|
109
118
|
values from task params
|
|
110
119
|
|
|
120
|
+
**IMPORTANT**: If the schedule contains separate tasks for different
|
|
121
|
+
steps of the same skill (e.g., one task for fetching data, another for
|
|
122
|
+
exporting), each task produces its own single command. Do NOT combine
|
|
123
|
+
them or add steps that weren't scheduled.
|
|
124
|
+
|
|
111
125
|
### Example Skill
|
|
112
126
|
|
|
113
127
|
```markdown
|
|
@@ -151,6 +165,28 @@ steps 1 and 3 (with step 2 skipped), use Execution lines 1 and 3
|
|
|
151
165
|
which Execution line to use - always match by original position, never
|
|
152
166
|
by sequential task index.
|
|
153
167
|
|
|
168
|
+
### Expanding Skill References in Execution Lines
|
|
169
|
+
|
|
170
|
+
Execution lines may contain **skill references** in the format
|
|
171
|
+
`[ Skill Name ]`. These are references to other skills that must be
|
|
172
|
+
expanded to actual commands before execution.
|
|
173
|
+
|
|
174
|
+
**Format**: `[ Skill Name ]` with spaces inside the brackets
|
|
175
|
+
|
|
176
|
+
**How to expand**:
|
|
177
|
+
1. When an Execution line contains `[ Skill Name ]`, look up that skill
|
|
178
|
+
in the "Available Skills" section
|
|
179
|
+
2. Get the referenced skill's Execution command
|
|
180
|
+
3. Replace the `[ Skill Name ]` reference with the actual command
|
|
181
|
+
|
|
182
|
+
**IMPORTANT**: Skill references are the ONLY exception to the verbatim
|
|
183
|
+
execution rule below. You MUST expand them - never output `[ ... ]`
|
|
184
|
+
syntax in the final command.
|
|
185
|
+
|
|
186
|
+
**Note**: Use the `skill:` field from task metadata to find the skill
|
|
187
|
+
definition. If that skill's Execution line contains `[ Other Skill ]`,
|
|
188
|
+
look up "Other Skill" and replace the reference with its command.
|
|
189
|
+
|
|
154
190
|
**CRITICAL - VERBATIM EXECUTION**: Run shell commands EXACTLY as written in
|
|
155
191
|
the ### Execution section. Do NOT:
|
|
156
192
|
- Modify the command string in any way
|
|
@@ -371,6 +407,41 @@ commands:
|
|
|
371
407
|
command: "df -h"
|
|
372
408
|
```
|
|
373
409
|
|
|
410
|
+
### Example 8: Partial skill execution (specific steps only)
|
|
411
|
+
|
|
412
|
+
When the schedule breaks a multi-step skill into separate tasks, each
|
|
413
|
+
task produces exactly ONE command for its specific step:
|
|
414
|
+
|
|
415
|
+
Skill "Prepare Report" has 3 steps:
|
|
416
|
+
- Steps: Fetch source data | Transform data | Export results
|
|
417
|
+
- Execution: curl {url} | python3 process.py | cat output.csv
|
|
418
|
+
|
|
419
|
+
Tasks (schedule requested only steps 1 and 3, skipping transform):
|
|
420
|
+
- { action: "Fetch source data", params: { skill: "Prepare Report" } }
|
|
421
|
+
- { action: "Export results", params: { skill: "Prepare Report" } }
|
|
422
|
+
|
|
423
|
+
Response (2 tasks = 2 commands, NOT 3):
|
|
424
|
+
```
|
|
425
|
+
message: "Prepare report:"
|
|
426
|
+
summary: "Report prepared"
|
|
427
|
+
commands:
|
|
428
|
+
- description: "Fetch source data"
|
|
429
|
+
command: "curl {url}"
|
|
430
|
+
- description: "Export results"
|
|
431
|
+
command: "cat output.csv"
|
|
432
|
+
```
|
|
433
|
+
|
|
434
|
+
**WRONG** response (adding unscheduled transform step):
|
|
435
|
+
```
|
|
436
|
+
commands:
|
|
437
|
+
- description: "Fetch source data"
|
|
438
|
+
command: "curl {url}"
|
|
439
|
+
- description: "Transform data" ← NOT IN SCHEDULE - DO NOT ADD
|
|
440
|
+
command: "python3 process.py"
|
|
441
|
+
- description: "Export results"
|
|
442
|
+
command: "cat output.csv"
|
|
443
|
+
```
|
|
444
|
+
|
|
374
445
|
## Handling Complex Operations
|
|
375
446
|
|
|
376
447
|
For complex multi-step operations:
|
|
@@ -420,6 +491,10 @@ Example:
|
|
|
420
491
|
- **CRITICAL: Assume what commands to run when skill is missing**
|
|
421
492
|
- **CRITICAL: Replace unknown placeholders with `<UNKNOWN>` - this breaks
|
|
422
493
|
shell syntax**
|
|
494
|
+
- **CRITICAL: Add steps that weren't in the scheduled tasks** - if the
|
|
495
|
+
schedule has 2 tasks, you MUST return exactly 2 commands
|
|
496
|
+
- **CRITICAL: Expand entire skill workflows** when only specific steps
|
|
497
|
+
were scheduled - match task actions to individual skill steps
|
|
423
498
|
|
|
424
499
|
**DO:**
|
|
425
500
|
- Match commands precisely to task descriptions
|
|
@@ -434,6 +509,10 @@ Example:
|
|
|
434
509
|
commands**
|
|
435
510
|
- Always use skill's Execution section when params.skill is present
|
|
436
511
|
- Replace all {PARAM} placeholders with values from task params
|
|
512
|
+
- **CRITICAL: Count input tasks and ensure output has same count** -
|
|
513
|
+
N tasks in = N commands out, no exceptions
|
|
514
|
+
- **CRITICAL: Match each task action to its specific skill step** -
|
|
515
|
+
use only that step's Execution line for the command
|
|
437
516
|
|
|
438
517
|
## Final Validation
|
|
439
518
|
|
package/dist/skills/schedule.md
CHANGED
|
@@ -129,6 +129,13 @@ Before creating tasks, evaluate the request type:
|
|
|
129
129
|
capabilities", "show skills"
|
|
130
130
|
- Example: "flex" → introspect type
|
|
131
131
|
|
|
132
|
+
**CRITICAL - Introspection is ALWAYS a single task:**
|
|
133
|
+
- Introspection requests MUST result in exactly ONE introspect leaf task
|
|
134
|
+
- NEVER create multiple introspect tasks for a single request
|
|
135
|
+
- NEVER nest introspect tasks within groups
|
|
136
|
+
- NEVER break down capabilities into separate introspect tasks
|
|
137
|
+
- The single introspect task will list ALL capabilities
|
|
138
|
+
|
|
132
139
|
2. **Information requests** (questions) - Use question keywords:
|
|
133
140
|
- "explain", "describe", "tell me", "what is", "how does", "find",
|
|
134
141
|
"search"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "prompt-language-shell",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"description": "Your personal command-line concierge. Ask politely, and it gets things done.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -17,9 +17,10 @@
|
|
|
17
17
|
"dev": "npm run build && tsc --watch",
|
|
18
18
|
"prepare": "husky",
|
|
19
19
|
"prepublishOnly": "npm run check",
|
|
20
|
-
"test": "vitest run --exclude 'tests/tools/
|
|
21
|
-
"test:watch": "vitest --exclude 'tests/tools/
|
|
20
|
+
"test": "vitest run --exclude 'tests/tools/' --exclude 'tests/shell/'",
|
|
21
|
+
"test:watch": "vitest --exclude 'tests/tools/' --exclude 'tests/shell/'",
|
|
22
22
|
"test:llm": "vitest run tests/tools/schedule/*.test.tsx",
|
|
23
|
+
"test:shell": "vitest run tests/shell/*.test.ts",
|
|
23
24
|
"format": "prettier --write '**/*.{ts,tsx}'",
|
|
24
25
|
"format:check": "prettier --check '**/*.{ts,tsx}'",
|
|
25
26
|
"lint": "eslint .",
|
|
@@ -52,18 +53,18 @@
|
|
|
52
53
|
"ink-text-input": "^6.0.0",
|
|
53
54
|
"react": "^19.2.3",
|
|
54
55
|
"yaml": "^2.8.2",
|
|
55
|
-
"zod": "^4.
|
|
56
|
+
"zod": "^4.3.6"
|
|
56
57
|
},
|
|
57
58
|
"devDependencies": {
|
|
58
|
-
"@types/node": "^25.0.
|
|
59
|
-
"@types/react": "^19.2.
|
|
60
|
-
"@vitest/coverage-v8": "^4.0.
|
|
59
|
+
"@types/node": "^25.0.10",
|
|
60
|
+
"@types/react": "^19.2.9",
|
|
61
|
+
"@vitest/coverage-v8": "^4.0.18",
|
|
61
62
|
"eslint": "^9.39.2",
|
|
62
63
|
"husky": "^9.1.7",
|
|
63
64
|
"ink-testing-library": "^4.0.0",
|
|
64
|
-
"prettier": "^3.
|
|
65
|
+
"prettier": "^3.8.1",
|
|
65
66
|
"typescript": "^5.9.3",
|
|
66
|
-
"typescript-eslint": "^8.
|
|
67
|
-
"vitest": "^4.0.
|
|
67
|
+
"typescript-eslint": "^8.53.1",
|
|
68
|
+
"vitest": "^4.0.18"
|
|
68
69
|
}
|
|
69
70
|
}
|