prompt-language-shell 0.4.2 → 0.4.4
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/config/ANSWER.md +119 -0
- package/dist/config/PLAN.md +26 -5
- package/dist/handlers/answer.js +28 -0
- package/dist/handlers/command.js +38 -0
- package/dist/handlers/config.js +39 -0
- package/dist/handlers/execution.js +68 -0
- package/dist/handlers/introspect.js +28 -0
- package/dist/handlers/plan.js +82 -0
- package/dist/services/anthropic.js +18 -2
- package/dist/{types → services}/colors.js +58 -6
- package/dist/services/components.js +27 -1
- package/dist/services/queue.js +52 -0
- package/dist/services/tool-registry.js +5 -0
- package/dist/tools/answer.tool.js +18 -0
- package/dist/types/types.js +2 -0
- package/dist/ui/Answer.js +71 -0
- package/dist/ui/AnswerDisplay.js +8 -0
- package/dist/ui/Command.js +3 -1
- package/dist/ui/Component.js +14 -2
- package/dist/ui/Config.js +1 -1
- package/dist/ui/Confirm.js +4 -3
- package/dist/ui/Feedback.js +2 -2
- package/dist/ui/Introspect.js +3 -1
- package/dist/ui/Label.js +4 -2
- package/dist/ui/List.js +3 -3
- package/dist/ui/Main.js +35 -232
- package/dist/ui/Plan.js +13 -10
- package/dist/ui/Separator.js +1 -1
- package/package.json +1 -1
- /package/dist/services/{config.js → configuration.js} +0 -0
package/dist/ui/Plan.js
CHANGED
|
@@ -1,23 +1,24 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useEffect, useState } from 'react';
|
|
3
3
|
import { Box, useInput } from 'ink';
|
|
4
|
-
import { TaskColors } from '../types/colors.js';
|
|
5
4
|
import { TaskType } from '../types/types.js';
|
|
5
|
+
import { getTaskColors } from '../services/colors.js';
|
|
6
6
|
import { Label } from './Label.js';
|
|
7
7
|
import { List } from './List.js';
|
|
8
|
-
function taskToListItem(task, highlightedChildIndex = null, isDefineTaskWithoutSelection = false) {
|
|
8
|
+
function taskToListItem(task, highlightedChildIndex = null, isDefineTaskWithoutSelection = false, isCurrent = false) {
|
|
9
|
+
const taskColors = getTaskColors(task.type, isCurrent);
|
|
9
10
|
const item = {
|
|
10
11
|
description: {
|
|
11
12
|
text: task.action,
|
|
12
|
-
color:
|
|
13
|
+
color: taskColors.description,
|
|
13
14
|
},
|
|
14
|
-
type: { text: task.type, color:
|
|
15
|
+
type: { text: task.type, color: taskColors.type },
|
|
15
16
|
children: [],
|
|
16
17
|
};
|
|
17
18
|
// Mark define tasks with right arrow when no selection has been made
|
|
18
19
|
if (isDefineTaskWithoutSelection) {
|
|
19
20
|
item.marker = ' → ';
|
|
20
|
-
item.markerColor =
|
|
21
|
+
item.markerColor = getTaskColors(TaskType.Plan, isCurrent).type;
|
|
21
22
|
}
|
|
22
23
|
// Add children for Define tasks with options
|
|
23
24
|
if (task.type === TaskType.Define && Array.isArray(task.params?.options)) {
|
|
@@ -29,17 +30,18 @@ function taskToListItem(task, highlightedChildIndex = null, isDefineTaskWithoutS
|
|
|
29
30
|
childType =
|
|
30
31
|
index === highlightedChildIndex ? TaskType.Execute : TaskType.Discard;
|
|
31
32
|
}
|
|
32
|
-
const colors =
|
|
33
|
+
const colors = getTaskColors(childType, isCurrent);
|
|
34
|
+
const planColors = getTaskColors(TaskType.Plan, isCurrent);
|
|
33
35
|
return {
|
|
34
36
|
description: {
|
|
35
37
|
text: String(option),
|
|
36
38
|
color: colors.description,
|
|
37
|
-
highlightedColor:
|
|
39
|
+
highlightedColor: planColors.description,
|
|
38
40
|
},
|
|
39
41
|
type: {
|
|
40
42
|
text: childType,
|
|
41
43
|
color: colors.type,
|
|
42
|
-
highlightedColor:
|
|
44
|
+
highlightedColor: planColors.type,
|
|
43
45
|
},
|
|
44
46
|
};
|
|
45
47
|
});
|
|
@@ -143,6 +145,7 @@ export function Plan({ message, tasks, state, debug = false, onSelectionConfirme
|
|
|
143
145
|
isDone,
|
|
144
146
|
state,
|
|
145
147
|
]);
|
|
148
|
+
const isCurrent = isDone === false;
|
|
146
149
|
const listItems = tasks.map((task, idx) => {
|
|
147
150
|
// Find which define group this task belongs to (if any)
|
|
148
151
|
const defineGroupIndex = defineTaskIndices.indexOf(idx);
|
|
@@ -170,7 +173,7 @@ export function Plan({ message, tasks, state, debug = false, onSelectionConfirme
|
|
|
170
173
|
defineGroupIndex === currentDefineGroupIndex &&
|
|
171
174
|
highlightedIndex === null &&
|
|
172
175
|
!isDone;
|
|
173
|
-
return taskToListItem(task, childIndex, isDefineWithoutSelection);
|
|
176
|
+
return taskToListItem(task, childIndex, isDefineWithoutSelection, isCurrent);
|
|
174
177
|
});
|
|
175
|
-
return (_jsxs(Box, { flexDirection: "column", children: [message && (_jsx(Box, { marginBottom: 1, children: _jsx(Label, { description: message,
|
|
178
|
+
return (_jsxs(Box, { flexDirection: "column", children: [message && (_jsx(Box, { marginBottom: 1, children: _jsx(Label, { description: message, taskType: TaskType.Plan, showType: debug, isCurrent: isCurrent }) })), _jsx(List, { items: listItems, highlightedIndex: currentDefineTaskIndex >= 0 ? highlightedIndex : null, highlightedParentIndex: currentDefineTaskIndex, showType: debug })] }));
|
|
176
179
|
}
|
package/dist/ui/Separator.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Text } from 'ink';
|
|
3
|
-
import { Colors } from '../
|
|
3
|
+
import { Colors } from '../services/colors.js';
|
|
4
4
|
export const Separator = ({ color = Colors.Label.Discarded, spaces = 1, }) => {
|
|
5
5
|
const spacing = ' '.repeat(spaces);
|
|
6
6
|
return (_jsxs(Text, { color: color, children: [spacing, "\u203A", spacing] }));
|
package/package.json
CHANGED
|
File without changes
|