prompt-language-shell 0.7.6 → 0.8.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/dist/services/anthropic.js +1 -0
- package/dist/services/colors.js +70 -4
- package/dist/services/components.js +35 -6
- package/dist/services/router.js +2 -3
- package/dist/services/shell.js +1 -0
- package/dist/services/utils.js +6 -0
- package/dist/skills/execute.md +20 -8
- package/dist/skills/schedule.md +7 -3
- package/dist/tools/execute.tool.js +5 -1
- package/dist/ui/Answer.js +9 -1
- package/dist/ui/Command.js +7 -6
- package/dist/ui/Component.js +2 -2
- package/dist/ui/Config.js +31 -2
- package/dist/ui/Confirm.js +1 -1
- package/dist/ui/Execute.js +198 -202
- package/dist/ui/Feedback.js +1 -1
- package/dist/ui/Introspect.js +3 -1
- package/dist/ui/Label.js +1 -1
- package/dist/ui/List.js +2 -1
- package/dist/ui/Schedule.js +1 -1
- package/dist/ui/Spinner.js +2 -1
- package/dist/ui/Subtask.js +22 -0
- package/dist/ui/Task.js +85 -0
- package/dist/ui/Validate.js +26 -17
- package/dist/ui/Workflow.js +1 -1
- package/package.json +12 -12
package/dist/ui/Validate.js
CHANGED
|
@@ -4,18 +4,19 @@ import { Box, Text } from 'ink';
|
|
|
4
4
|
import { ComponentStatus } from '../types/components.js';
|
|
5
5
|
import { TaskType } from '../types/types.js';
|
|
6
6
|
import { Colors, getTextColor } from '../services/colors.js';
|
|
7
|
+
import { addDebugToTimeline, createConfigStepsFromSchema, } from '../services/components.js';
|
|
8
|
+
import { DebugLevel, saveConfig, unflattenConfig, } from '../services/configuration.js';
|
|
7
9
|
import { useInput } from '../services/keyboard.js';
|
|
8
10
|
import { formatErrorMessage } from '../services/messages.js';
|
|
9
11
|
import { ensureMinimumTime } from '../services/timing.js';
|
|
10
|
-
import {
|
|
11
|
-
import { Config, StepType } from './Config.js';
|
|
12
|
+
import { Config } from './Config.js';
|
|
12
13
|
import { Spinner } from './Spinner.js';
|
|
13
14
|
const MIN_PROCESSING_TIME = 1000;
|
|
14
15
|
export function Validate({ missingConfig, userRequest, state, status, service, children, debug = DebugLevel.None, onError, onComplete, onAborted, handlers, }) {
|
|
15
16
|
const isActive = status === ComponentStatus.Active;
|
|
16
|
-
const [error, setError] = useState(null);
|
|
17
|
-
const [completionMessage, setCompletionMessage] = useState(null);
|
|
18
|
-
const [configRequirements, setConfigRequirements] = useState(null);
|
|
17
|
+
const [error, setError] = useState(state?.error ?? null);
|
|
18
|
+
const [completionMessage, setCompletionMessage] = useState(state?.completionMessage ?? null);
|
|
19
|
+
const [configRequirements, setConfigRequirements] = useState(state?.configRequirements ?? null);
|
|
19
20
|
const [showConfig, setShowConfig] = useState(false);
|
|
20
21
|
useInput((_, key) => {
|
|
21
22
|
if (key.escape && isActive && !showConfig) {
|
|
@@ -42,6 +43,8 @@ export function Validate({ missingConfig, userRequest, state, status, service, c
|
|
|
42
43
|
const result = await svc.processWithTool(prompt, 'validate');
|
|
43
44
|
await ensureMinimumTime(startTime, MIN_PROCESSING_TIME);
|
|
44
45
|
if (mounted) {
|
|
46
|
+
// Add debug components to timeline if present
|
|
47
|
+
addDebugToTimeline(result.debug, handlers);
|
|
45
48
|
// Extract CONFIG tasks with descriptions from result
|
|
46
49
|
const configTasks = result.tasks.filter((task) => task.type === TaskType.Config);
|
|
47
50
|
// Build ConfigRequirements with descriptions
|
|
@@ -71,8 +74,10 @@ export function Validate({ missingConfig, userRequest, state, status, service, c
|
|
|
71
74
|
setConfigRequirements(withDescriptions);
|
|
72
75
|
// Save state after validation completes
|
|
73
76
|
handlers?.updateState({
|
|
77
|
+
completionMessage: message,
|
|
74
78
|
configRequirements: withDescriptions,
|
|
75
79
|
validated: true,
|
|
80
|
+
error: null,
|
|
76
81
|
});
|
|
77
82
|
}
|
|
78
83
|
}
|
|
@@ -80,16 +85,17 @@ export function Validate({ missingConfig, userRequest, state, status, service, c
|
|
|
80
85
|
await ensureMinimumTime(startTime, MIN_PROCESSING_TIME);
|
|
81
86
|
if (mounted) {
|
|
82
87
|
const errorMessage = formatErrorMessage(err);
|
|
88
|
+
setError(errorMessage);
|
|
83
89
|
// Save error state
|
|
84
90
|
handlers?.updateState({
|
|
85
91
|
error: errorMessage,
|
|
92
|
+
completionMessage: null,
|
|
93
|
+
configRequirements: null,
|
|
94
|
+
validated: false,
|
|
86
95
|
});
|
|
87
96
|
if (onError) {
|
|
88
97
|
onError(errorMessage);
|
|
89
98
|
}
|
|
90
|
-
else {
|
|
91
|
-
setError(errorMessage);
|
|
92
|
-
}
|
|
93
99
|
}
|
|
94
100
|
}
|
|
95
101
|
}
|
|
@@ -110,16 +116,19 @@ export function Validate({ missingConfig, userRequest, state, status, service, c
|
|
|
110
116
|
if (!isActive && !completionMessage && !error && !children) {
|
|
111
117
|
return null;
|
|
112
118
|
}
|
|
113
|
-
// Create ConfigSteps from requirements
|
|
119
|
+
// Create ConfigSteps from requirements using createConfigStepsFromSchema
|
|
120
|
+
// to load current values from config file, then override descriptions
|
|
114
121
|
const configSteps = configRequirements
|
|
115
|
-
?
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
122
|
+
? (() => {
|
|
123
|
+
const keys = configRequirements.map((req) => req.path);
|
|
124
|
+
const steps = createConfigStepsFromSchema(keys);
|
|
125
|
+
// Override descriptions with LLM-generated ones
|
|
126
|
+
return steps.map((step, index) => ({
|
|
127
|
+
...step,
|
|
128
|
+
description: configRequirements[index].description ||
|
|
129
|
+
configRequirements[index].path,
|
|
130
|
+
}));
|
|
131
|
+
})()
|
|
123
132
|
: null;
|
|
124
133
|
const handleConfigFinished = (config) => {
|
|
125
134
|
// Convert flat dotted keys to nested structure grouped by section
|
package/dist/ui/Workflow.js
CHANGED
|
@@ -5,8 +5,8 @@ import { ComponentStatus, } from '../types/components.js';
|
|
|
5
5
|
import { ComponentName, FeedbackType } from '../types/types.js';
|
|
6
6
|
import { createFeedback, isStateless, markAsDone, } from '../services/components.js';
|
|
7
7
|
import { DebugLevel } from '../services/configuration.js';
|
|
8
|
-
import { exitApp } from '../services/process.js';
|
|
9
8
|
import { getCancellationMessage } from '../services/messages.js';
|
|
9
|
+
import { exitApp } from '../services/process.js';
|
|
10
10
|
import { Component } from './Component.js';
|
|
11
11
|
export const Workflow = ({ initialQueue, debug }) => {
|
|
12
12
|
const [timeline, setTimeline] = useState([]);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "prompt-language-shell",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.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",
|
|
@@ -47,22 +47,22 @@
|
|
|
47
47
|
},
|
|
48
48
|
"homepage": "https://github.com/aswitalski/pls#readme",
|
|
49
49
|
"dependencies": {
|
|
50
|
-
"@anthropic-ai/sdk": "^0.
|
|
51
|
-
"ink": "^6.
|
|
50
|
+
"@anthropic-ai/sdk": "^0.71.2",
|
|
51
|
+
"ink": "^6.6.0",
|
|
52
52
|
"ink-text-input": "^6.0.0",
|
|
53
|
-
"react": "^19.2.
|
|
54
|
-
"yaml": "^2.8.
|
|
53
|
+
"react": "^19.2.3",
|
|
54
|
+
"yaml": "^2.8.2"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
|
-
"@types/node": "^
|
|
58
|
-
"@types/react": "^19.2.
|
|
59
|
-
"@vitest/coverage-v8": "^4.0.
|
|
60
|
-
"eslint": "^9.39.
|
|
57
|
+
"@types/node": "^25.0.3",
|
|
58
|
+
"@types/react": "^19.2.7",
|
|
59
|
+
"@vitest/coverage-v8": "^4.0.16",
|
|
60
|
+
"eslint": "^9.39.2",
|
|
61
61
|
"husky": "^9.1.7",
|
|
62
62
|
"ink-testing-library": "^4.0.0",
|
|
63
|
-
"prettier": "^3.
|
|
63
|
+
"prettier": "^3.7.4",
|
|
64
64
|
"typescript": "^5.9.3",
|
|
65
|
-
"typescript-eslint": "^8.
|
|
66
|
-
"vitest": "^4.0.
|
|
65
|
+
"typescript-eslint": "^8.50.1",
|
|
66
|
+
"vitest": "^4.0.16"
|
|
67
67
|
}
|
|
68
68
|
}
|