strands-darwin 0.0.49 → 0.0.52
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 +6 -1
- package/README.zh-CN.md +6 -1
- package/dist/src/agent/instructions.d.ts +9 -4
- package/dist/src/agent/instructions.js +18 -8
- package/dist/src/agent/instructions.js.map +1 -1
- package/dist/src/agent/runtime.js +4 -2
- package/dist/src/agent/runtime.js.map +1 -1
- package/dist/src/cli-doctor.js +12 -8
- package/dist/src/cli-doctor.js.map +1 -1
- package/dist/src/collaboration/hub-wire.d.ts +6 -1
- package/dist/src/collaboration/hub-wire.js +6 -1
- package/dist/src/collaboration/hub-wire.js.map +1 -1
- package/dist/src/collaboration/local.d.ts +15 -1
- package/dist/src/collaboration/local.js +42 -6
- package/dist/src/collaboration/local.js.map +1 -1
- package/dist/src/collaboration/protocol.d.ts +9 -0
- package/dist/src/collaboration/protocol.js +9 -0
- package/dist/src/collaboration/protocol.js.map +1 -1
- package/dist/src/collaboration/tools.js +2 -2
- package/dist/src/collaboration/tools.js.map +1 -1
- package/dist/src/commands/custom-commands.d.ts +1 -1
- package/dist/src/commands/custom-commands.js +2 -1
- package/dist/src/commands/custom-commands.js.map +1 -1
- package/dist/src/commands/init-command.d.ts +3 -1
- package/dist/src/commands/init-command.js +6 -6
- package/dist/src/commands/init-command.js.map +1 -1
- package/dist/src/config.d.ts +3 -1
- package/dist/src/config.js +5 -0
- package/dist/src/config.js.map +1 -1
- package/dist/src/import-claude.js +18 -3
- package/dist/src/import-claude.js.map +1 -1
- package/dist/src/skills/builtin/developer/SKILL.md +1 -1
- package/dist/src/tui/App.js +111 -13
- package/dist/src/tui/App.js.map +1 -1
- package/dist/src/tui/InputBox.d.ts +1 -1
- package/dist/src/tui/InputBox.js +1 -1
- package/dist/src/tui/git-diff.d.ts +19 -0
- package/dist/src/tui/git-diff.js +147 -0
- package/dist/src/tui/git-diff.js.map +1 -0
- package/dist/src/tui/help-format.d.ts +1 -1
- package/dist/src/tui/help-format.js +2 -2
- package/dist/src/tui/help-format.js.map +1 -1
- package/dist/src/tui/instructions-format.js +2 -2
- package/dist/src/tui/instructions-format.js.map +1 -1
- package/package.json +1 -1
|
@@ -14,7 +14,7 @@ import type { EditorLayout } from './prompt-editor.js';
|
|
|
14
14
|
* "… n more" row — a workspace has more paths than any menu could hold, so for them
|
|
15
15
|
* that row is the normal case rather than the overflow one.
|
|
16
16
|
*/
|
|
17
|
-
export declare const MAX_COMPLETIONS =
|
|
17
|
+
export declare const MAX_COMPLETIONS = 31;
|
|
18
18
|
/**
|
|
19
19
|
* Which source the offered rows came from.
|
|
20
20
|
*
|
package/dist/src/tui/InputBox.js
CHANGED
|
@@ -18,7 +18,7 @@ import { visualColor, visualMarker } from './visual-language.js';
|
|
|
18
18
|
* "… n more" row — a workspace has more paths than any menu could hold, so for them
|
|
19
19
|
* that row is the normal case rather than the overflow one.
|
|
20
20
|
*/
|
|
21
|
-
export const MAX_COMPLETIONS =
|
|
21
|
+
export const MAX_COMPLETIONS = 31;
|
|
22
22
|
/** The selected full-list index, with stale state falling back to the first row. */
|
|
23
23
|
export function completionSelection(selected, total) {
|
|
24
24
|
return Number.isInteger(selected) && selected >= 0 && selected < total ? selected : 0;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/** User-only inspection: deliberately not a tool or a shell-command report. */
|
|
2
|
+
export declare const DIFF_USAGE = "Usage: /diff or /diff --staged (TUI only; no paths or other flags)";
|
|
3
|
+
export type DiffScope = 'unstaged' | 'staged';
|
|
4
|
+
export declare function parseDiffCommand(input: string): DiffScope | 'usage' | undefined;
|
|
5
|
+
export declare const DIFF_MAX_BYTES: number;
|
|
6
|
+
export declare const DIFF_MAX_LINES = 200;
|
|
7
|
+
export declare const DIFF_MAX_LINE_POINTS = 500;
|
|
8
|
+
export declare const DIFF_TIMEOUT_MS = 5000;
|
|
9
|
+
export interface RunningGitDiff {
|
|
10
|
+
readonly result: Promise<string>;
|
|
11
|
+
cancel(): void;
|
|
12
|
+
}
|
|
13
|
+
/** One shared time/storage budget across the safety preflight and the diff. No disk writes. */
|
|
14
|
+
export declare function runGitDiff(options: {
|
|
15
|
+
projectRoot: string;
|
|
16
|
+
scope: DiffScope;
|
|
17
|
+
/** Caller applies the existing shell-env scrub/passthrough policy. */
|
|
18
|
+
env: NodeJS.ProcessEnv;
|
|
19
|
+
}): RunningGitDiff;
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import { spawn } from 'node:child_process';
|
|
2
|
+
import { withDarwinMarker } from '../tools/shell-env.js';
|
|
3
|
+
/** User-only inspection: deliberately not a tool or a shell-command report. */
|
|
4
|
+
export const DIFF_USAGE = 'Usage: /diff or /diff --staged (TUI only; no paths or other flags)';
|
|
5
|
+
export function parseDiffCommand(input) {
|
|
6
|
+
const match = /^\/diff(?:\s+([\s\S]*))?$/i.exec(input.trim());
|
|
7
|
+
if (match === null)
|
|
8
|
+
return undefined;
|
|
9
|
+
const argument = (match[1] ?? '').trim();
|
|
10
|
+
return argument === '' ? 'unstaged' : argument === '--staged' ? 'staged' : 'usage';
|
|
11
|
+
}
|
|
12
|
+
export const DIFF_MAX_BYTES = 64 * 1024;
|
|
13
|
+
export const DIFF_MAX_LINES = 200;
|
|
14
|
+
export const DIFF_MAX_LINE_POINTS = 500;
|
|
15
|
+
export const DIFF_TIMEOUT_MS = 5_000;
|
|
16
|
+
/** Escape rather than interpret terminal controls, including Unicode bidi controls. */
|
|
17
|
+
function safeText(text) {
|
|
18
|
+
return text.replace(/[\u0000-\u0009\u000b-\u001f\u007f-\u009f\u2028-\u202e\u2066-\u2069\ufeff]/g, (char) => `\\u${char.charCodeAt(0).toString(16).padStart(4, '0')}`);
|
|
19
|
+
}
|
|
20
|
+
function projection(text) {
|
|
21
|
+
const lines = safeText(text).trimEnd().split('\n');
|
|
22
|
+
let truncated = lines.length > DIFF_MAX_LINES;
|
|
23
|
+
const bounded = lines.slice(0, DIFF_MAX_LINES).map((line) => {
|
|
24
|
+
const points = [...line];
|
|
25
|
+
if (points.length <= DIFF_MAX_LINE_POINTS)
|
|
26
|
+
return line;
|
|
27
|
+
truncated = true;
|
|
28
|
+
return `${points.slice(0, DIFF_MAX_LINE_POINTS - 1).join('')}…`;
|
|
29
|
+
}).join('\n');
|
|
30
|
+
return { text: bounded, truncated };
|
|
31
|
+
}
|
|
32
|
+
// Fixed commands only. No option/path/revision is derived from user or repository text.
|
|
33
|
+
const GIT_PREFIX = ['--no-pager', '--no-optional-locks', '-c', 'core.fsmonitor=false'];
|
|
34
|
+
const PREFLIGHT = ['config', '--null', '--get-regexp', '^(filter\\..*\\.(clean|process)|remote\\..*\\.promisor|extensions\\.partialclone)$'];
|
|
35
|
+
const DIFF_ARGS = [
|
|
36
|
+
'-c', 'submodule.recurse=false', '-c', 'diff.autoRefreshIndex=false',
|
|
37
|
+
'-c', 'core.quotePath=true', '-c', 'diff.noprefix=false', '-c', 'diff.mnemonicPrefix=false',
|
|
38
|
+
'diff', '--no-color', '--no-ext-diff', '--no-textconv', '--ignore-submodules=all',
|
|
39
|
+
'--no-renames', '--no-relative', '--src-prefix=a/', '--dst-prefix=b/', '--unified=3',
|
|
40
|
+
];
|
|
41
|
+
/** One shared time/storage budget across the safety preflight and the diff. No disk writes. */
|
|
42
|
+
export function runGitDiff(options) {
|
|
43
|
+
// Git-specific inherited overrides must not redirect this project, inject configuration,
|
|
44
|
+
// write trace files, or enable a helper. All other scrubbed environment values survive.
|
|
45
|
+
const env = withDarwinMarker(Object.fromEntries(Object.entries(options.env)
|
|
46
|
+
.filter(([key, value]) => value !== undefined && !/^GIT_/i.test(key))));
|
|
47
|
+
env['GIT_OPTIONAL_LOCKS'] = '0';
|
|
48
|
+
env['GIT_TERMINAL_PROMPT'] = '0';
|
|
49
|
+
env['GIT_NO_LAZY_FETCH'] = '1';
|
|
50
|
+
env['LC_ALL'] = 'C';
|
|
51
|
+
let stop;
|
|
52
|
+
let kill;
|
|
53
|
+
let remaining = DIFF_MAX_BYTES;
|
|
54
|
+
const halt = (reason) => {
|
|
55
|
+
stop ??= reason;
|
|
56
|
+
kill?.();
|
|
57
|
+
};
|
|
58
|
+
const timer = setTimeout(() => halt('timed out'), DIFF_TIMEOUT_MS);
|
|
59
|
+
const capture = (args) => new Promise((resolve) => {
|
|
60
|
+
if (stop !== undefined) {
|
|
61
|
+
resolve({ code: null, output: '', error: '', truncated: false, spawnFailed: false });
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
const stdout = [];
|
|
65
|
+
const stderr = [];
|
|
66
|
+
let truncated = false;
|
|
67
|
+
let spawnFailed = false;
|
|
68
|
+
const child = spawn('git', [...GIT_PREFIX, ...args], {
|
|
69
|
+
cwd: options.projectRoot, env, shell: false, detached: process.platform !== 'win32',
|
|
70
|
+
stdio: ['ignore', 'pipe', 'pipe'],
|
|
71
|
+
});
|
|
72
|
+
kill = () => {
|
|
73
|
+
if (child.pid === undefined)
|
|
74
|
+
return;
|
|
75
|
+
try {
|
|
76
|
+
if (process.platform === 'win32')
|
|
77
|
+
child.kill('SIGKILL');
|
|
78
|
+
else
|
|
79
|
+
process.kill(-child.pid, 'SIGKILL');
|
|
80
|
+
}
|
|
81
|
+
catch { /* Already reaped. */ }
|
|
82
|
+
};
|
|
83
|
+
const collect = (buffers, chunk) => {
|
|
84
|
+
const kept = chunk.subarray(0, remaining);
|
|
85
|
+
// Copy the bounded prefix, never retain an oversized backing buffer.
|
|
86
|
+
if (kept.length > 0)
|
|
87
|
+
buffers.push(Buffer.from(kept));
|
|
88
|
+
remaining -= kept.length;
|
|
89
|
+
if (kept.length < chunk.length) {
|
|
90
|
+
truncated = true;
|
|
91
|
+
halt('output limit reached');
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
child.stdout.on('data', (chunk) => collect(stdout, chunk));
|
|
95
|
+
child.stderr.on('data', (chunk) => collect(stderr, chunk));
|
|
96
|
+
child.on('error', () => { spawnFailed = true; });
|
|
97
|
+
child.on('close', (code) => {
|
|
98
|
+
kill = undefined;
|
|
99
|
+
resolve({ code, output: Buffer.concat(stdout).toString('utf8'), error: Buffer.concat(stderr).toString('utf8'), truncated, spawnFailed });
|
|
100
|
+
});
|
|
101
|
+
});
|
|
102
|
+
const label = options.scope === 'staged'
|
|
103
|
+
? 'diff — staged: index versus HEAD (empty tree when unborn)'
|
|
104
|
+
: 'diff — unstaged: worktree versus index (tracked files)';
|
|
105
|
+
const heading = `${label}\nUntracked contents and submodule contents excluded.\n`;
|
|
106
|
+
const failure = (captured) => {
|
|
107
|
+
if (stop !== undefined)
|
|
108
|
+
return `${stop}; capture incomplete — not a clean result`;
|
|
109
|
+
if (captured.spawnFailed)
|
|
110
|
+
return 'could not start Git (missing Git or inaccessible project directory)';
|
|
111
|
+
return undefined;
|
|
112
|
+
};
|
|
113
|
+
const result = (async () => {
|
|
114
|
+
try {
|
|
115
|
+
// --no-textconv does NOT disable clean/process filters. Refuse them before diff;
|
|
116
|
+
// likewise refuse promisor remotes rather than permitting an implicit fetch.
|
|
117
|
+
const preflight = await capture(PREFLIGHT);
|
|
118
|
+
const problem = failure(preflight);
|
|
119
|
+
if (problem !== undefined)
|
|
120
|
+
return heading + problem;
|
|
121
|
+
if (preflight.code === 0)
|
|
122
|
+
return heading + 'unavailable: configured clean/process filters or promisor remotes are not supported (helpers must not run)';
|
|
123
|
+
if (preflight.code !== 1)
|
|
124
|
+
return heading + 'Git safety preflight failed; no diff was run';
|
|
125
|
+
const captured = await capture([...DIFF_ARGS, ...(options.scope === 'staged' ? ['--cached'] : []), '--']);
|
|
126
|
+
const view = projection([captured.output, captured.error].filter(Boolean).join('\n'));
|
|
127
|
+
const stopped = failure(captured);
|
|
128
|
+
const status = stopped ?? (captured.code !== 0
|
|
129
|
+
? `Git failed (exit ${captured.code ?? 'signal'}); not a clean result`
|
|
130
|
+
: captured.output === '' && captured.error === ''
|
|
131
|
+
? 'No changes in this selected scope; this does not mean the whole tree is clean.'
|
|
132
|
+
: '');
|
|
133
|
+
return heading + [status, view.text,
|
|
134
|
+
captured.truncated || view.truncated ? '… truncated; capture incomplete (64 KiB / 200 lines / 500 code points per line)' : '',
|
|
135
|
+
].filter(Boolean).join('\n');
|
|
136
|
+
}
|
|
137
|
+
catch {
|
|
138
|
+
return heading + 'Git inspection failed; not a clean result';
|
|
139
|
+
}
|
|
140
|
+
finally {
|
|
141
|
+
clearTimeout(timer);
|
|
142
|
+
kill?.();
|
|
143
|
+
}
|
|
144
|
+
})();
|
|
145
|
+
return { result, cancel: () => halt('cancelled') };
|
|
146
|
+
}
|
|
147
|
+
//# sourceMappingURL=git-diff.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"git-diff.js","sourceRoot":"","sources":["../../../src/tui/git-diff.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAEzD,+EAA+E;AAC/E,MAAM,CAAC,MAAM,UAAU,GAAG,oEAAoE,CAAC;AAE/F,MAAM,UAAU,gBAAgB,CAAC,KAAa;IAC5C,MAAM,KAAK,GAAG,4BAA4B,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC;IAC9D,IAAI,KAAK,KAAK,IAAI;QAAE,OAAO,SAAS,CAAC;IACrC,MAAM,QAAQ,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;IACzC,OAAO,QAAQ,KAAK,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,QAAQ,KAAK,UAAU,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC;AACrF,CAAC;AAED,MAAM,CAAC,MAAM,cAAc,GAAG,EAAE,GAAG,IAAI,CAAC;AACxC,MAAM,CAAC,MAAM,cAAc,GAAG,GAAG,CAAC;AAClC,MAAM,CAAC,MAAM,oBAAoB,GA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AI,QAAQ,uBAAuB;gBACtE,CAAC,CAAC,QAAQ,CAAC,MAAM,KAAK,EAAE,IAAI,QAAQ,CAAC,KAAK,KAAK,EAAE;oBAC/C,CAAC,CAAC,gFAAgF;oBAClF,CAAC,CAAC,EAAE,CAAC,CAAC;YACV,OAAO,OAAO,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC,IAAI;gBACjC,QAAQ,CAAC,SAAS,IAAI,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,iFAAiF,CAAC,CAAC,CAAC,EAAE;aAC9H,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC/B,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,OAAO,GAAG,2CAA2C,CAAC;QAC/D,CAAC;gBAAS,CAAC;YACT,YAAY,CAAC,KAAK,CAAC,CAAC;YACpB,IAAI,EAAE,EAAE,CAAC;QACX,CAAC;IACH,CAAC,CAAC,EAAE,CAAC;IACL,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE,CAAC;AACrD,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** Hard report bounds: help is transcript history, never an unbounded catalogue dump. */
|
|
2
|
-
export declare const MAX_HELP_COMMANDS =
|
|
2
|
+
export declare const MAX_HELP_COMMANDS = 31;
|
|
3
3
|
/**
|
|
4
4
|
* Fixed rows `formatHelpReport()` always emits: the title, the command-section header,
|
|
5
5
|
* the "prompt and completion" block and the "editing and session" block, plus the
|
|
@@ -2,7 +2,7 @@ import { BUILTIN_COMMAND_DESCRIPTIONS, BUILTIN_COMMAND_NAMES, } from '../command
|
|
|
2
2
|
import { COLLABORATION_GRAMMAR } from '../collaboration/grammar.js';
|
|
3
3
|
import { ESCAPE_REWIND_CHORD_MS } from './rewind-search.js';
|
|
4
4
|
/** Hard report bounds: help is transcript history, never an unbounded catalogue dump. */
|
|
5
|
-
export const MAX_HELP_COMMANDS =
|
|
5
|
+
export const MAX_HELP_COMMANDS = 31;
|
|
6
6
|
/**
|
|
7
7
|
* Fixed rows `formatHelpReport()` always emits: the title, the command-section header,
|
|
8
8
|
* the "prompt and completion" block and the "editing and session" block, plus the
|
|
@@ -33,7 +33,7 @@ export function formatHelpReport() {
|
|
|
33
33
|
if (commandNames.length < BUILTIN_COMMAND_NAMES.length) {
|
|
34
34
|
lines.push(` … ${BUILTIN_COMMAND_NAMES.length - commandNames.length} more commands not shown`);
|
|
35
35
|
}
|
|
36
|
-
lines.push('prompt and completion:', ...COLLABORATION_GRAMMAR.map(grammar => ` collaboration: ${grammar}`), ' / opens commands and skills · Up/Down select · Tab/Enter completes the selected row', ' /mcp__<server>__<prompt> [args] fetches an MCP server prompt and sends it (listed last; /mcp shows counts)', ' @ completes a workspace path · acceptance inserts path text only, never file content', ' !<command> runs your shell command locally (not as a model tool call)', ' Enter sends · Ctrl+J or trailing \\ + Enter inserts a newline · multiline paste never submits', ' Ctrl+O attaches one clipboard image to the next prompt; Ctrl+O again removes it', ' Ctrl+R searches this project’s prompt history · type to filter · Ctrl+R/Up/Down navigate · Tab/Enter accepts', ' Up/Down precedence: completion · Up queued-message take-back · prompt recall · cursor movement', ' Esc closes completion, cancels history search to its exact draft/cursor, or ends prompt recall', ` Esc Esc (within ${ESCAPE_REWIND_CHORD_MS} ms) on an empty idle composer opens the /rewind chooser; one Esc there does nothing`, 'editing and session:', ' Home/End or Ctrl+A/E moves to the visible row edge', ' Ctrl+K/U deletes to the row end/start · Ctrl+W deletes the previous word', ' Alt/Ctrl+Left/Right or Alt+B/F moves by word · Alt+Backspace/Alt+D deletes the word before/after', ' Ctrl+_ (or Ctrl+-) undoes the last Ctrl+K/U, Ctrl+W or Alt word deletion in the draft', ' Ctrl+Y yanks the last cut at the cursor, repeatably in this draft only (65,536 code points max; not the clipboard)', ' Ctrl+S stashes/restores one draft + cursor/image (65,536 code points max); empty composer to restore, never overwrites or sends', ' Ctrl+G edits the draft in $VISUAL (else $EDITOR) while idle; the result replaces the draft unsent — Enter sends it', ' /rewind branches conversation only; it never rolls back workspace files or side effects', ' /copy puts the last completed answer on the clipboard via OSC 52 (plus wl-copy/xclip/pbcopy when a display is present)', ' Ctrl+B toggles compact/expanded tool details', ' Ctrl+C cancels busy work; press again within 2s to exit (while idle, the first press only arms)', ' Ctrl+D or /exit or /quit exits');
|
|
36
|
+
lines.push('prompt and completion:', ...COLLABORATION_GRAMMAR.map(grammar => ` collaboration: ${grammar}`), ' / opens commands and skills · Up/Down select · Tab/Enter completes the selected row', ' /mcp__<server>__<prompt> [args] fetches an MCP server prompt and sends it (listed last; /mcp shows counts)', ' @ completes a workspace path · acceptance inserts path text only, never file content', ' !<command> runs your shell command locally (not as a model tool call)', ' Enter sends · Ctrl+J or trailing \\ + Enter inserts a newline · multiline paste never submits', ' Ctrl+O attaches one clipboard image to the next prompt; Ctrl+O again removes it', ' Ctrl+R searches this project’s prompt history · type to filter · Ctrl+R/Up/Down navigate · Tab/Enter accepts', ' Up/Down precedence: completion · Up queued-message take-back · prompt recall · cursor movement', ' Esc closes completion, cancels history search to its exact draft/cursor, or ends prompt recall', ` Esc Esc (within ${ESCAPE_REWIND_CHORD_MS} ms) on an empty idle composer opens the /rewind chooser; one Esc there does nothing`, 'editing and session:', ' Home/End or Ctrl+A/E moves to the visible row edge', ' Ctrl+K/U deletes to the row end/start · Ctrl+W deletes the previous word', ' Alt/Ctrl+Left/Right or Alt+B/F moves by word · Alt+Backspace/Alt+D deletes the word before/after', ' Ctrl+_ (or Ctrl+-) undoes the last Ctrl+K/U, Ctrl+W or Alt word deletion in the draft', ' Ctrl+Y yanks the last cut at the cursor, repeatably in this draft only (65,536 code points max; not the clipboard)', ' Ctrl+S stashes/restores one draft + cursor/image (65,536 code points max); empty composer to restore, never overwrites or sends', ' Ctrl+G or Ctrl+X Ctrl+E edits the draft in $VISUAL (else $EDITOR) while idle; the result replaces the draft unsent — Enter sends it', ' /rewind branches conversation only; it never rolls back workspace files or side effects', ' /copy puts the last completed answer on the clipboard via OSC 52 (plus wl-copy/xclip/pbcopy when a display is present)', ' Ctrl+B toggles compact/expanded tool details', ' Ctrl+C cancels busy work; press again within 2s to exit (while idle, the first press only arms)', ' Ctrl+D or /exit or /quit exits');
|
|
37
37
|
return lines.slice(0, MAX_HELP_LINES).map(boundedLine).join('\n');
|
|
38
38
|
}
|
|
39
39
|
//# sourceMappingURL=help-format.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"help-format.js","sourceRoot":"","sources":["../../../src/tui/help-format.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,4BAA4B,EAC5B,qBAAqB,GACtB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AACpE,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAE5D,yFAAyF;AACzF,MAAM,CAAC,MAAM,iBAAiB,GAAG,EAAE,CAAC;AACpC;;;;GAIG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,EAAE,GAAG,qBAAqB,CAAC,MAAM,CAAC;AAClE;;;;GAIG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,iBAAiB,GAAG,gBAAgB,CAAC;AACnE,MAAM,CAAC,MAAM,yBAAyB,GAAG,GAAG,CAAC;AAE7C,SAAS,WAAW,CAAC,KAAa;IAChC,MAAM,MAAM,GAAG,CAAC,GAAG,KAAK,CAAC,CAAC;IAC1B,IAAI,MAAM,CAAC,MAAM,IAAI,yBAAyB;QAAE,OAAO,KAAK,CAAC;IAC7D,OAAO,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,yBAAyB,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,GAAG,CAAC;AACvE,CAAC;AAED,2FAA2F;AAC3F,MAAM,UAAU,gBAAgB;IAC9B,MAAM,YAAY,GAAG,qBAAqB,CAAC,KAAK,CAAC,CAAC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kGAAkG,EAClG,qBAAqB,sBAAsB,sFAAsF,EACjI,sBAAsB,EACtB,sDAAsD,EACtD,4EAA4E,EAC5E,oGAAoG,EACpG,yFAAyF,EACzF,sHAAsH,EACtH,mIAAmI,EACnI,uIAAuI,EACvI,2FAA2F,EAC3F,0HAA0H,EAC1H,gDAAgD,EAChD,mGAAmG,EACnG,kCAAkC,CACnC,CAAC;IAEF,OAAO,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,cAAc,CAAC,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACpE,CAAC"}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* actually loaded (AGENTS.md or its CLAUDE.md fallback) rather than a hard-coded
|
|
6
6
|
* name, and so the wording can be checked without rendering the header.
|
|
7
7
|
*/
|
|
8
|
-
import {
|
|
8
|
+
import {} from '../agent/instructions.js';
|
|
9
9
|
/** Sizes are shown so an accidentally huge instructions file is visible at a glance. */
|
|
10
10
|
export function formatBytes(bytes) {
|
|
11
11
|
return bytes < 1024 ? `${bytes} B` : `${(bytes / 1024).toFixed(1)} KB`;
|
|
@@ -14,7 +14,7 @@ export function formatBytes(bytes) {
|
|
|
14
14
|
export function formatInstructionsLoadedRow(instructions) {
|
|
15
15
|
const size = formatBytes(instructions.bytes);
|
|
16
16
|
return instructions.truncated
|
|
17
|
-
? `${instructions.filename}: loaded (${size}, truncated to ${
|
|
17
|
+
? `${instructions.filename}: loaded (${size}, truncated to ${instructions.maxBytes / 1024} KiB)`
|
|
18
18
|
: `${instructions.filename}: loaded (${size})`;
|
|
19
19
|
}
|
|
20
20
|
/** `CLAUDE.md: skipped — EISDIR: …` — the file that was present but unusable. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"instructions-format.js","sourceRoot":"","sources":["../../../src/tui/instructions-format.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,
|
|
1
|
+
{"version":3,"file":"instructions-format.js","sourceRoot":"","sources":["../../../src/tui/instructions-format.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAGN,MAAM,0BAA0B,CAAC;AAElC,wFAAwF;AACxF,MAAM,UAAU,WAAW,CAAC,KAAa;IACvC,OAAO,KAAK,GAAG,IAAI,CAAC,CAAC,CAAC,GAAG,KAAK,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,GAAG,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC;AACzE,CAAC;AAED,+EAA+E;AAC/E,MAAM,UAAU,2BAA2B,CAAC,YAAwC;IAClF,MAAM,IAAI,GAAG,WAAW,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;IAC7C,OAAO,YAAY,CAAC,SAAS;QAC3B,CAAC,CAAC,GAAG,YAAY,CAAC,QAAQ,aAAa,IAAI,kBAAkB,YAAY,CAAC,QAAQ,GAAG,IAAI,OAAO;QAChG,CAAC,CAAC,GAAG,YAAY,CAAC,QAAQ,aAAa,IAAI,GAAG,CAAC;AACnD,CAAC;AAED,iFAAiF;AACjF,MAAM,UAAU,4BAA4B,CAAC,IAA0B,EAAE,OAAe;IACtF,OAAO,GAAG,IAAI,eAAe,OAAO,EAAE,CAAC;AACzC,CAAC"}
|