@pugi/cli 0.1.0-alpha.9 → 0.1.0-beta.1
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 +33 -0
- package/assets/pugi-mascot.ansi +41 -0
- package/dist/commands/deploy.js +439 -0
- package/dist/core/agents/loader.js +104 -0
- package/dist/core/agents/registry.js +1 -1
- package/dist/core/consensus/anvil-fanout.js +276 -0
- package/dist/core/consensus/diff-capture.js +382 -0
- package/dist/core/consensus/rubric.js +233 -0
- package/dist/core/context/index.js +21 -0
- package/dist/core/context/pugiignore.js +316 -0
- package/dist/core/context/repo-skeleton.js +533 -0
- package/dist/core/context/watcher.js +342 -0
- package/dist/core/context/working-set.js +165 -0
- package/dist/core/edits/dispatch.js +185 -0
- package/dist/core/edits/index.js +15 -0
- package/dist/core/edits/layer-a-apply.js +217 -0
- package/dist/core/edits/layer-b-apply.js +211 -0
- package/dist/core/edits/layer-c-apply.js +160 -0
- package/dist/core/edits/layer-d-ast.js +29 -0
- package/dist/core/edits/marker-parser.js +401 -0
- package/dist/core/edits/security-gate.js +223 -0
- package/dist/core/engine/native-pugi.js +6 -1
- package/dist/core/engine/tool-bridge.js +33 -1
- package/dist/core/repl/ask.js +512 -0
- package/dist/core/repl/cancellation.js +98 -0
- package/dist/core/repl/dispatch-fsm.js +220 -0
- package/dist/core/repl/privacy-banner.js +71 -0
- package/dist/core/repl/session.js +1882 -12
- package/dist/core/repl/slash-commands.js +59 -32
- package/dist/core/repl/store/index.js +12 -0
- package/dist/core/repl/store/jsonl-log.js +321 -0
- package/dist/core/repl/store/lockfile.js +155 -0
- package/dist/core/repl/store/session-store.js +792 -0
- package/dist/core/repl/store/types.js +44 -0
- package/dist/core/repl/store/uuid-v7.js +68 -0
- package/dist/core/repl/workspace-context.js +72 -1
- package/dist/core/skills/loader.js +454 -0
- package/dist/core/skills/sources.js +480 -0
- package/dist/core/skills/trust.js +172 -0
- package/dist/runtime/cli.js +721 -10
- package/dist/runtime/commands/agents.js +385 -0
- package/dist/runtime/commands/config.js +338 -8
- package/dist/runtime/commands/review-consensus.js +399 -0
- package/dist/runtime/commands/skills.js +401 -0
- package/dist/tools/file-tools.js +90 -0
- package/dist/tools/web-fetch.js +1 -1
- package/dist/tui/agent-tree-pane.js +9 -0
- package/dist/tui/ask-cli.js +52 -0
- package/dist/tui/ask-modal.js +211 -0
- package/dist/tui/conversation-pane.js +48 -3
- package/dist/tui/input-box.js +48 -5
- package/dist/tui/markdown-render.js +266 -0
- package/dist/tui/repl-render.js +157 -0
- package/dist/tui/repl-splash-mascot.js +130 -0
- package/dist/tui/repl-splash.js +7 -1
- package/dist/tui/repl.js +82 -11
- package/dist/tui/status-bar.js +63 -3
- package/dist/tui/tool-stream-pane.js +91 -0
- package/package.json +11 -5
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Box, Text } from 'ink';
|
|
3
|
+
const DEFAULT_COLLAPSE_THRESHOLD = 5;
|
|
4
|
+
const DEFAULT_MAX_ROWS = 8;
|
|
5
|
+
export function ToolStreamPane(props) {
|
|
6
|
+
const calls = props.calls;
|
|
7
|
+
const collapseThreshold = props.collapseThreshold ?? DEFAULT_COLLAPSE_THRESHOLD;
|
|
8
|
+
const maxRows = props.maxRows ?? DEFAULT_MAX_ROWS;
|
|
9
|
+
if (calls.length === 0) {
|
|
10
|
+
return (_jsxs(Box, { flexDirection: "column", children: [_jsx(PaneHeader, { count: 0, collapsed: props.collapsed }), _jsx(Text, { dimColor: true, children: "No tool calls yet. Dispatch a brief and watch tools land here." })] }));
|
|
11
|
+
}
|
|
12
|
+
if (props.collapsed === true) {
|
|
13
|
+
return (_jsx(Box, { flexDirection: "column", children: _jsx(PaneHeader, { count: calls.length, collapsed: true }) }));
|
|
14
|
+
}
|
|
15
|
+
// Tail-window the rows so a long-running session does not overflow
|
|
16
|
+
// the bottom half of the frame. Older rows stay in the session state
|
|
17
|
+
// for /jobs and /diff inspection.
|
|
18
|
+
const visible = calls.slice(-maxRows);
|
|
19
|
+
return (_jsxs(Box, { flexDirection: "column", children: [_jsx(PaneHeader, { count: calls.length, collapsed: false }), visible.map((call) => (_jsx(ToolCallRow, { call: call, collapseThreshold: collapseThreshold }, call.id)))] }));
|
|
20
|
+
}
|
|
21
|
+
function PaneHeader({ count, collapsed }) {
|
|
22
|
+
const verb = collapsed ? 'Ctrl+T to expand' : 'Ctrl+T to collapse';
|
|
23
|
+
return (_jsxs(Box, { children: [_jsx(Text, { bold: true, dimColor: true, children: '─ tools ' }), _jsx(Text, { dimColor: true, children: `(${count}) ` }), _jsx(Text, { dimColor: true, children: verb })] }));
|
|
24
|
+
}
|
|
25
|
+
function ToolCallRow({ call, collapseThreshold, }) {
|
|
26
|
+
const glyph = statusGlyph(call.status);
|
|
27
|
+
const color = statusColor(call.status);
|
|
28
|
+
const label = formatToolLabel(call.tool, call.args);
|
|
29
|
+
const summary = formatSummary(call);
|
|
30
|
+
const showHint = (call.resultLines ?? 0) > collapseThreshold;
|
|
31
|
+
return (_jsxs(Box, { children: [_jsx(Text, { color: color, children: glyph }), _jsx(Text, { children: ' ' }), _jsx(Text, { bold: true, children: label }), _jsx(Text, { dimColor: true, children: ` ${summary}` }), showHint ? (_jsx(Text, { dimColor: true, children: ` · ${call.resultLines} lines, Ctrl+O to expand` })) : null] }));
|
|
32
|
+
}
|
|
33
|
+
function statusGlyph(status) {
|
|
34
|
+
switch (status) {
|
|
35
|
+
case 'running':
|
|
36
|
+
return '→';
|
|
37
|
+
case 'ok':
|
|
38
|
+
return '✓';
|
|
39
|
+
case 'error':
|
|
40
|
+
return '✗';
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
function statusColor(status) {
|
|
44
|
+
switch (status) {
|
|
45
|
+
case 'running':
|
|
46
|
+
return 'cyan';
|
|
47
|
+
case 'ok':
|
|
48
|
+
return 'green';
|
|
49
|
+
case 'error':
|
|
50
|
+
return 'red';
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Render the canonical `Tool(args)` form. Tool names are capitalised
|
|
55
|
+
* the way Claude Code shows them; args are truncated to 60 chars so
|
|
56
|
+
* the row stays single-line even on 80-col terminals.
|
|
57
|
+
*/
|
|
58
|
+
function formatToolLabel(tool, args) {
|
|
59
|
+
const name = toolDisplayName(tool);
|
|
60
|
+
const trimmedArgs = args.length > 60 ? `${args.slice(0, 57)}…` : args;
|
|
61
|
+
return `${name}(${trimmedArgs})`;
|
|
62
|
+
}
|
|
63
|
+
function toolDisplayName(tool) {
|
|
64
|
+
switch (tool) {
|
|
65
|
+
case 'read':
|
|
66
|
+
return 'Read';
|
|
67
|
+
case 'edit':
|
|
68
|
+
return 'Edit';
|
|
69
|
+
case 'bash':
|
|
70
|
+
return 'Bash';
|
|
71
|
+
case 'grep':
|
|
72
|
+
return 'Grep';
|
|
73
|
+
case 'glob':
|
|
74
|
+
return 'Glob';
|
|
75
|
+
case 'web_fetch':
|
|
76
|
+
return 'WebFetch';
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
function formatSummary(call) {
|
|
80
|
+
if (call.status === 'running') {
|
|
81
|
+
return call.detail ?? 'running...';
|
|
82
|
+
}
|
|
83
|
+
if (call.status === 'error') {
|
|
84
|
+
return call.detail ?? 'error';
|
|
85
|
+
}
|
|
86
|
+
// ok
|
|
87
|
+
const duration = typeof call.durationMs === 'number' ? `${call.durationMs}ms` : '';
|
|
88
|
+
const detail = call.detail ?? 'OK';
|
|
89
|
+
return duration.length > 0 ? `${detail} ${duration}` : detail;
|
|
90
|
+
}
|
|
91
|
+
//# sourceMappingURL=tool-stream-pane.js.map
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pugi/cli",
|
|
3
|
-
"version": "0.1.0-
|
|
4
|
-
"description": "Pugi CLI
|
|
3
|
+
"version": "0.1.0-beta.1",
|
|
4
|
+
"description": "Pugi CLI - terminal-native software execution system",
|
|
5
5
|
"homepage": "https://pugi.io",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -28,30 +28,36 @@
|
|
|
28
28
|
"files": [
|
|
29
29
|
"bin/run.js",
|
|
30
30
|
"dist/**/*.js",
|
|
31
|
+
"assets/**/*.ansi",
|
|
31
32
|
"README.md",
|
|
32
33
|
"LICENSE"
|
|
33
34
|
],
|
|
34
35
|
"engines": {
|
|
35
|
-
"node": ">=
|
|
36
|
+
"node": ">=22.5.0"
|
|
36
37
|
},
|
|
38
|
+
"//publishConfig": "CEO sign-off 2026-05-23 alpha launch: @pugi/cli is the customer-facing CLI and ships PUBLIC so `npm i -g @pugi/cli` resolves anonymously. The HARD default-restricted memory rule (2026-05-25) applies to INTERNAL @pugi/* packages (db-client, telegram bot helpers, etc.) - those must ship access:restricted unless an additional CEO sign-off granted. @pugi/sdk + @pugi/personas were published public alongside the CLI under the same alpha-launch sign-off because the CLI's customer install pulls them as transitive deps; review before α7 GA.",
|
|
37
39
|
"publishConfig": {
|
|
38
40
|
"access": "public"
|
|
39
41
|
},
|
|
40
42
|
"dependencies": {
|
|
41
43
|
"@mozilla/readability": "^0.6.0",
|
|
44
|
+
"chokidar": "^3.6.0",
|
|
45
|
+
"ignore": "^5.3.2",
|
|
42
46
|
"ink": "^5.0.1",
|
|
43
47
|
"linkedom": "^0.18.12",
|
|
44
48
|
"react": "^18.3.1",
|
|
49
|
+
"tar": "^6.2.1",
|
|
45
50
|
"tinyglobby": "^0.2.16",
|
|
46
51
|
"turndown": "^7.2.4",
|
|
47
52
|
"undici": "^8.3.0",
|
|
48
53
|
"zod": "^3.23.0",
|
|
49
|
-
"@pugi/personas": "0.1.
|
|
50
|
-
"@pugi/sdk": "0.1.0-
|
|
54
|
+
"@pugi/personas": "0.1.1",
|
|
55
|
+
"@pugi/sdk": "0.1.0-beta.1"
|
|
51
56
|
},
|
|
52
57
|
"devDependencies": {
|
|
53
58
|
"@types/node": "^22.0.0",
|
|
54
59
|
"@types/react": "^18.3.3",
|
|
60
|
+
"@types/tar": "^6.1.13",
|
|
55
61
|
"@types/turndown": "^5.0.6",
|
|
56
62
|
"ink-testing-library": "^4.0.0",
|
|
57
63
|
"tsx": "^4.19.0",
|