terminal-pilot 0.0.46 → 0.0.48
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/cli.d.ts +5 -0
- package/dist/cli.js +179 -28
- package/dist/cli.js.map +4 -4
- package/dist/commands/close-session.js.map +1 -1
- package/dist/commands/create-session.js.map +1 -1
- package/dist/commands/daemon-runtime.js.map +1 -1
- package/dist/commands/fill.js.map +1 -1
- package/dist/commands/get-session.js.map +1 -1
- package/dist/commands/index.js +17 -0
- package/dist/commands/index.js.map +3 -3
- package/dist/commands/install.js +17 -0
- package/dist/commands/install.js.map +3 -3
- package/dist/commands/installer.js +17 -0
- package/dist/commands/installer.js.map +3 -3
- package/dist/commands/list-sessions.js.map +1 -1
- package/dist/commands/press-key.js.map +1 -1
- package/dist/commands/read-history.js.map +1 -1
- package/dist/commands/read-screen.js.map +1 -1
- package/dist/commands/resize.js.map +1 -1
- package/dist/commands/runtime.js.map +1 -1
- package/dist/commands/screenshot.js.map +1 -1
- package/dist/commands/send-signal.js.map +1 -1
- package/dist/commands/type.js.map +1 -1
- package/dist/commands/uninstall.js +17 -0
- package/dist/commands/uninstall.js.map +3 -3
- package/dist/commands/wait-for-exit.js.map +1 -1
- package/dist/commands/wait-for.js.map +1 -1
- package/dist/composition.json +1 -1
- package/dist/testing/cli-repl.js +177 -27
- package/dist/testing/cli-repl.js.map +4 -4
- package/dist/testing/qa-cli.js +177 -27
- package/dist/testing/qa-cli.js.map +4 -4
- package/node_modules/@poe-code/agent-defs/README.md +1 -1
- package/node_modules/@poe-code/agent-defs/dist/agents/index.d.ts +1 -0
- package/node_modules/@poe-code/agent-defs/dist/agents/index.js +1 -0
- package/node_modules/@poe-code/agent-defs/dist/agents/pi.d.ts +2 -0
- package/node_modules/@poe-code/agent-defs/dist/agents/pi.js +14 -0
- package/node_modules/@poe-code/agent-defs/dist/index.d.ts +1 -1
- package/node_modules/@poe-code/agent-defs/dist/index.js +1 -1
- package/node_modules/@poe-code/agent-defs/dist/registry.js +2 -1
- package/node_modules/@poe-code/agent-defs/dist/types.d.ts +1 -1
- package/node_modules/@poe-code/agent-defs/package.json +0 -2
- package/node_modules/@poe-code/agent-skill-config/package.json +0 -2
- package/node_modules/@poe-code/config-mutations/package.json +0 -2
- package/node_modules/@poe-code/frontmatter/package.json +0 -2
- package/node_modules/toolcraft-design/dist/components/help-formatter-plain.js +1 -1
- package/node_modules/toolcraft-design/dist/components/help-formatter.d.ts +2 -0
- package/node_modules/toolcraft-design/dist/components/help-formatter.js +1 -1
- package/node_modules/toolcraft-design/dist/explorer/actions.d.ts +1 -0
- package/node_modules/toolcraft-design/dist/explorer/actions.js +1 -0
- package/node_modules/toolcraft-design/dist/explorer/reducer.js +1 -0
- package/node_modules/toolcraft-design/dist/explorer/runtime.js +21 -2
- package/node_modules/toolcraft-design/dist/explorer/state.d.ts +6 -0
- package/node_modules/toolcraft-design/dist/explorer/state.js +9 -6
- package/node_modules/toolcraft-design/package.json +0 -2
- package/package.json +3 -3
|
@@ -23,7 +23,7 @@ const codex = allAgents.find((agent) => agent.id === "codex");
|
|
|
23
23
|
- `parseAgentSpecifier(input)`: parses `agent` or `agent:model` input.
|
|
24
24
|
- `formatAgentSpecifier(specifier)`: formats an agent specifier.
|
|
25
25
|
- `normalizeAgentId(input)`: normalizes the agent part through the registry.
|
|
26
|
-
- Agent definition exports such as `codexAgent`, `claudeCodeAgent`, and `
|
|
26
|
+
- Agent definition exports such as `codexAgent`, `claudeCodeAgent`, `geminiCliAgent`, and `piAgent`.
|
|
27
27
|
|
|
28
28
|
## Config Options
|
|
29
29
|
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export const piAgent = {
|
|
2
|
+
id: "pi",
|
|
3
|
+
name: "pi",
|
|
4
|
+
aliases: ["pi-agent"],
|
|
5
|
+
label: "Pi",
|
|
6
|
+
summary: "Pi coding agent (spawn-only; uses local Pi auth/settings).",
|
|
7
|
+
binaryName: "pi",
|
|
8
|
+
branding: {
|
|
9
|
+
colors: {
|
|
10
|
+
dark: "#F2F2F2",
|
|
11
|
+
light: "#242424"
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export type { AgentDefinition, ApiShapeId, OtelCaptureDefinition } from "./types.js";
|
|
2
2
|
export type { AgentSpecifier } from "./specifier.js";
|
|
3
|
-
export { claudeCodeAgent, claudeDesktopAgent, codexAgent, cursorAgent, geminiCliAgent, openCodeAgent, kimiAgent, gooseAgent, poeAgentAgent } from "./agents/index.js";
|
|
3
|
+
export { claudeCodeAgent, claudeDesktopAgent, codexAgent, cursorAgent, geminiCliAgent, openCodeAgent, kimiAgent, gooseAgent, piAgent, poeAgentAgent } from "./agents/index.js";
|
|
4
4
|
export { allAgents, resolveAgentId } from "./registry.js";
|
|
5
5
|
export { parseAgentSpecifier, formatAgentSpecifier, normalizeAgentId } from "./specifier.js";
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { claudeCodeAgent, claudeDesktopAgent, codexAgent, cursorAgent, geminiCliAgent, openCodeAgent, kimiAgent, gooseAgent, poeAgentAgent } from "./agents/index.js";
|
|
1
|
+
export { claudeCodeAgent, claudeDesktopAgent, codexAgent, cursorAgent, geminiCliAgent, openCodeAgent, kimiAgent, gooseAgent, piAgent, poeAgentAgent } from "./agents/index.js";
|
|
2
2
|
export { allAgents, resolveAgentId } from "./registry.js";
|
|
3
3
|
export { parseAgentSpecifier, formatAgentSpecifier, normalizeAgentId } from "./specifier.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { claudeCodeAgent, claudeDesktopAgent, codexAgent, cursorAgent, geminiCliAgent, openCodeAgent, kimiAgent, gooseAgent, poeAgentAgent } from "./agents/index.js";
|
|
1
|
+
import { claudeCodeAgent, claudeDesktopAgent, codexAgent, cursorAgent, geminiCliAgent, openCodeAgent, kimiAgent, gooseAgent, piAgent, poeAgentAgent } from "./agents/index.js";
|
|
2
2
|
function freezeAgent(agent) {
|
|
3
3
|
if (agent.aliases !== undefined) {
|
|
4
4
|
Object.freeze(agent.aliases);
|
|
@@ -25,6 +25,7 @@ export const allAgents = Object.freeze([
|
|
|
25
25
|
freezeAgent(openCodeAgent),
|
|
26
26
|
freezeAgent(kimiAgent),
|
|
27
27
|
freezeAgent(gooseAgent),
|
|
28
|
+
freezeAgent(piAgent),
|
|
28
29
|
freezeAgent(poeAgentAgent)
|
|
29
30
|
]);
|
|
30
31
|
const lookup = new Map();
|
|
@@ -13,7 +13,7 @@ export interface AgentDefinition {
|
|
|
13
13
|
binaryName?: string;
|
|
14
14
|
readonly apiShapes?: readonly ApiShapeId[];
|
|
15
15
|
readonly otelCapture?: OtelCaptureDefinition;
|
|
16
|
-
configPath
|
|
16
|
+
configPath?: string;
|
|
17
17
|
readonly configPaths?: {
|
|
18
18
|
readonly darwin: string;
|
|
19
19
|
readonly linux: string;
|
|
@@ -117,7 +117,7 @@ export function formatColumns(opts) {
|
|
|
117
117
|
export function formatCommandList(commands) {
|
|
118
118
|
return formatColumns({
|
|
119
119
|
rows: commands.map((cmd) => ({
|
|
120
|
-
left: cmd.name
|
|
120
|
+
left: `${" ".repeat((cmd.depth ?? 0) * 2)}${cmd.name}`,
|
|
121
121
|
right: cmd.description
|
|
122
122
|
}))
|
|
123
123
|
});
|
|
@@ -190,7 +190,7 @@ export function formatOption(flags, description) {
|
|
|
190
190
|
export function formatCommandList(commands) {
|
|
191
191
|
return formatColumns({
|
|
192
192
|
rows: commands.map((cmd) => ({
|
|
193
|
-
left: text.command(cmd.name)
|
|
193
|
+
left: `${" ".repeat((cmd.depth ?? 0) * 2)}${text.command(cmd.name)}`,
|
|
194
194
|
right: cmd.description
|
|
195
195
|
}))
|
|
196
196
|
});
|
|
@@ -6,6 +6,7 @@ type ExplorerKeypressEvent = Extract<ExplorerEvent, {
|
|
|
6
6
|
}>["key"];
|
|
7
7
|
export type ActionRuntimeHandles = {
|
|
8
8
|
refresh: () => Promise<void>;
|
|
9
|
+
reloadDetail: (rowId?: string) => void;
|
|
9
10
|
suspendAnd: <T>(fn: () => Promise<T>) => Promise<T>;
|
|
10
11
|
openModal: (content: {
|
|
11
12
|
title: string;
|
|
@@ -19,6 +19,7 @@ export function buildActionContext(state, _action, source, runtimeHandles, rowsO
|
|
|
19
19
|
item: source === "detail" ? currentDetailItem(state) : undefined,
|
|
20
20
|
filter: state.filter,
|
|
21
21
|
refresh: runtimeHandles.refresh,
|
|
22
|
+
reloadDetail: runtimeHandles.reloadDetail,
|
|
22
23
|
suspendAnd: runtimeHandles.suspendAnd,
|
|
23
24
|
openModal: runtimeHandles.openModal,
|
|
24
25
|
toast: runtimeHandles.toast,
|
|
@@ -4,6 +4,7 @@ import { REGION_ALL, REGION_DETAIL, REGION_FOOTER, REGION_HEADER, REGION_LIST, R
|
|
|
4
4
|
const NO_EFFECTS = [];
|
|
5
5
|
const DEFAULT_ACTION_HANDLES = {
|
|
6
6
|
refresh: async () => undefined,
|
|
7
|
+
reloadDetail: () => undefined,
|
|
7
8
|
suspendAnd: async (fn) => fn(),
|
|
8
9
|
openModal: () => undefined,
|
|
9
10
|
toast: () => undefined,
|
|
@@ -44,6 +44,9 @@ class ExplorerRuntime {
|
|
|
44
44
|
refresh: async () => {
|
|
45
45
|
await this.refreshRowsFromSource();
|
|
46
46
|
},
|
|
47
|
+
reloadDetail: (rowId) => {
|
|
48
|
+
this.reloadFocusedDetail(rowId);
|
|
49
|
+
},
|
|
47
50
|
suspendAnd: async (fn) => this.suspendAnd(fn),
|
|
48
51
|
openModal: (content) => {
|
|
49
52
|
this.dispatch({ type: "modalOpened", title: content.title, content: content.content });
|
|
@@ -62,6 +65,10 @@ class ExplorerRuntime {
|
|
|
62
65
|
this.settle = { resolve, reject };
|
|
63
66
|
try {
|
|
64
67
|
this.startTerminal();
|
|
68
|
+
if (this.config.initialRows !== undefined && this.config.initialRows.length > 0) {
|
|
69
|
+
// Seed list/detail before first paint so callers with known rows avoid an empty flash.
|
|
70
|
+
this.dispatch({ type: "rowsLoaded", rows: this.config.initialRows });
|
|
71
|
+
}
|
|
65
72
|
this.render();
|
|
66
73
|
this.loadRows().catch((error) => {
|
|
67
74
|
this.fail(error);
|
|
@@ -145,13 +152,25 @@ class ExplorerRuntime {
|
|
|
145
152
|
rows: this.state.size.rows,
|
|
146
153
|
detailHidden: this.state.layout === "narrow-list-only" || this.state.layout === "too-narrow"
|
|
147
154
|
});
|
|
148
|
-
|
|
155
|
+
const reloadDetail = () => this.reloadFocusedDetail(rowId);
|
|
156
|
+
void this.detailJobs.schedule(rowId, (ctx) => this.config.detail.items(row, { ...ctx, reloadDetail }), {
|
|
149
157
|
width: layout.detail.width,
|
|
150
158
|
height: layout.detail.height,
|
|
151
159
|
row,
|
|
152
|
-
signal: new AbortController().signal
|
|
160
|
+
signal: new AbortController().signal,
|
|
161
|
+
reloadDetail
|
|
153
162
|
});
|
|
154
163
|
}
|
|
164
|
+
reloadFocusedDetail(rowId) {
|
|
165
|
+
const focusedId = this.state.detail.rowId;
|
|
166
|
+
if (focusedId === null) {
|
|
167
|
+
return;
|
|
168
|
+
}
|
|
169
|
+
if (rowId !== undefined && rowId !== focusedId) {
|
|
170
|
+
return;
|
|
171
|
+
}
|
|
172
|
+
this.renderDetail(focusedId);
|
|
173
|
+
}
|
|
155
174
|
loadDetailContent(rowId, token, items) {
|
|
156
175
|
const row = this.state.rows.find((candidate) => candidate.id === rowId);
|
|
157
176
|
if (row === undefined) {
|
|
@@ -30,6 +30,8 @@ export interface DetailCtx {
|
|
|
30
30
|
height: number;
|
|
31
31
|
signal: AbortSignal;
|
|
32
32
|
row: Row;
|
|
33
|
+
/** Re-run detail.items for the focused row and repaint the preview pane. */
|
|
34
|
+
reloadDetail?: () => void;
|
|
33
35
|
}
|
|
34
36
|
export interface Action<R> {
|
|
35
37
|
id: string;
|
|
@@ -47,6 +49,8 @@ export interface ActionContext<R> {
|
|
|
47
49
|
item?: DetailItem;
|
|
48
50
|
filter: string;
|
|
49
51
|
refresh: () => Promise<void>;
|
|
52
|
+
/** Re-run detail.items for the focused row and repaint the preview pane. */
|
|
53
|
+
reloadDetail: () => void;
|
|
50
54
|
suspendAnd: <T>(fn: () => Promise<T>) => Promise<T>;
|
|
51
55
|
openModal: (content: {
|
|
52
56
|
title: string;
|
|
@@ -73,6 +77,8 @@ export interface ExplorerConfig<R> {
|
|
|
73
77
|
keybindOverrides?: Record<string, string | string[]>;
|
|
74
78
|
emptyHint?: string;
|
|
75
79
|
initialFilter?: string;
|
|
80
|
+
/** Synchronous first paint rows; still refreshed via `rows()` after start. */
|
|
81
|
+
initialRows?: Row[];
|
|
76
82
|
}
|
|
77
83
|
export declare const REGION_HEADER: number;
|
|
78
84
|
export declare const REGION_LIST: number;
|
|
@@ -17,23 +17,26 @@ export function createInitialState(config, size) {
|
|
|
17
17
|
rows: normalizeSize(size.rows)
|
|
18
18
|
};
|
|
19
19
|
const multiSelect = config.multiSelect ?? true;
|
|
20
|
+
const initialRows = config.initialRows ?? [];
|
|
21
|
+
const initialFilter = config.initialFilter ?? "";
|
|
22
|
+
// Defer filtering to first rowsLoaded when empty; seed list immediately when provided.
|
|
20
23
|
return {
|
|
21
24
|
title: config.title,
|
|
22
25
|
emptyHint: config.emptyHint ?? "No detail",
|
|
23
|
-
rows:
|
|
24
|
-
filtered:
|
|
26
|
+
rows: initialRows,
|
|
27
|
+
filtered: initialRows.map((_, index) => index),
|
|
25
28
|
matchPositions: new Map(),
|
|
26
29
|
cursor: 0,
|
|
27
|
-
filter:
|
|
30
|
+
filter: initialFilter,
|
|
28
31
|
filterFocused: false,
|
|
29
32
|
focused: "list",
|
|
30
33
|
detail: {
|
|
31
|
-
rowId: null,
|
|
34
|
+
rowId: initialRows[0]?.id ?? null,
|
|
32
35
|
items: null,
|
|
33
36
|
cursor: 0,
|
|
34
37
|
scroll: 0,
|
|
35
|
-
token: 0,
|
|
36
|
-
loading:
|
|
38
|
+
token: initialRows.length > 0 ? 1 : 0,
|
|
39
|
+
loading: initialRows.length > 0
|
|
37
40
|
},
|
|
38
41
|
selected: new Set(),
|
|
39
42
|
multiSelect,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "terminal-pilot",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.48",
|
|
4
4
|
"description": "Playwright-like SDK and CLI for automating interactive CLI apps through a real PTY",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -64,6 +64,7 @@
|
|
|
64
64
|
"node-pty": "^1.1.0",
|
|
65
65
|
"sisteransi": "^1.0.5",
|
|
66
66
|
"smol-toml": "^1.6.0",
|
|
67
|
+
"terminal-png": "^0.1.0",
|
|
67
68
|
"toolcraft": "^0.0.51",
|
|
68
69
|
"yaml": "^2.8.2"
|
|
69
70
|
},
|
|
@@ -87,7 +88,6 @@
|
|
|
87
88
|
"@poe-code/frontmatter": "*"
|
|
88
89
|
},
|
|
89
90
|
"devDependencies": {
|
|
90
|
-
"toolcraft-schema": "*"
|
|
91
|
-
"terminal-png": "*"
|
|
91
|
+
"toolcraft-schema": "*"
|
|
92
92
|
}
|
|
93
93
|
}
|