@stigmer/ink 3.1.2 → 3.1.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/app/SessionView.d.ts.map +1 -1
- package/app/SessionView.js +2 -1
- package/app/SessionView.js.map +1 -1
- package/components/ApprovalPrompt.d.ts +15 -1
- package/components/ApprovalPrompt.d.ts.map +1 -1
- package/components/ApprovalPrompt.js +9 -3
- package/components/ApprovalPrompt.js.map +1 -1
- package/components/FileChangeProgressBar.d.ts +46 -0
- package/components/FileChangeProgressBar.d.ts.map +1 -0
- package/components/FileChangeProgressBar.js +40 -0
- package/components/FileChangeProgressBar.js.map +1 -0
- package/components/FileDiffBody.d.ts +30 -0
- package/components/FileDiffBody.d.ts.map +1 -0
- package/components/FileDiffBody.js +106 -0
- package/components/FileDiffBody.js.map +1 -0
- package/components/FileReviewAtoms.d.ts +23 -0
- package/components/FileReviewAtoms.d.ts.map +1 -0
- package/components/FileReviewAtoms.js +26 -0
- package/components/FileReviewAtoms.js.map +1 -0
- package/components/FileReviewPrompt.d.ts.map +1 -1
- package/components/FileReviewPrompt.js +16 -5
- package/components/FileReviewPrompt.js.map +1 -1
- package/components/FileReviewRecord.d.ts.map +1 -1
- package/components/FileReviewRecord.js +5 -3
- package/components/FileReviewRecord.js.map +1 -1
- package/components/MessageThread.d.ts.map +1 -1
- package/components/MessageThread.js +11 -3
- package/components/MessageThread.js.map +1 -1
- package/file-review.d.ts +27 -3
- package/file-review.d.ts.map +1 -1
- package/file-review.js +43 -6
- package/file-review.js.map +1 -1
- package/index.d.ts +4 -1
- package/index.d.ts.map +1 -1
- package/index.js +4 -1
- package/index.js.map +1 -1
- package/package.json +4 -4
- package/src/__tests__/components.test.tsx +65 -0
- package/src/__tests__/data-pickers.test.tsx +1 -6
- package/src/__tests__/file-change-progress.test.tsx +295 -0
- package/src/__tests__/file-review.test.tsx +318 -3
- package/src/__tests__/test-support.tsx +25 -0
- package/src/app/SessionView.tsx +12 -0
- package/src/components/ApprovalPrompt.tsx +33 -11
- package/src/components/FileChangeProgressBar.tsx +96 -0
- package/src/components/FileDiffBody.tsx +164 -0
- package/src/components/FileReviewAtoms.tsx +37 -0
- package/src/components/FileReviewPrompt.tsx +34 -2
- package/src/components/FileReviewRecord.tsx +11 -0
- package/src/components/MessageThread.tsx +15 -2
- package/src/file-review.ts +59 -6
- package/src/index.ts +9 -0
package/app/SessionView.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SessionView.d.ts","sourceRoot":"","sources":["../../src/app/SessionView.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SessionView.d.ts","sourceRoot":"","sources":["../../src/app/SessionView.tsx"],"names":[],"mappings":"AAYA,2DAA2D;AAC3D,MAAM,MAAM,eAAe,GAAG,OAAO,GAAG,MAAM,CAAC;AAE/C,qCAAqC;AACrC,MAAM,WAAW,gBAAgB;IAC/B,6CAA6C;IAC7C,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,2DAA2D;IAC3D,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB;;;;;;;;;OASG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,eAAe,CAAC;CACjC;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,WAAW,CAAC,EAAE,SAAS,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE,gBAAgB,2CAyLrE"}
|
package/app/SessionView.js
CHANGED
|
@@ -8,6 +8,7 @@ import { TodoList } from "../components/TodoList.js";
|
|
|
8
8
|
import { FollowUpInput } from "../components/FollowUpInput.js";
|
|
9
9
|
import { UsageWidget } from "../components/UsageWidget.js";
|
|
10
10
|
import { ExecutionProgress } from "../components/ExecutionProgress.js";
|
|
11
|
+
import { FileChangeProgressBar } from "../components/FileChangeProgressBar.js";
|
|
11
12
|
import { FileReviewPrompt } from "../components/FileReviewPrompt.js";
|
|
12
13
|
/**
|
|
13
14
|
* Full-featured session conversation view for the terminal.
|
|
@@ -67,7 +68,7 @@ export function SessionView({ sessionId, org, mode }) {
|
|
|
67
68
|
// for review (it lives on FileChangeSet.status), so the phase would
|
|
68
69
|
// otherwise read as an active "Running" spinner while the agent is
|
|
69
70
|
// idle awaiting the reviewer — the FileReviewPrompt is the honest cue.
|
|
70
|
-
_jsx(ExecutionProgress, { phase: conv.activePhase })), _jsx(MessageThread, { executions: conv.completedExecutions, activeStreamExecution: conv.activeStreamExecution, pendingUserMessage: conv.pendingUserMessage, onApprovalSubmit: conv.submitApproval, submittingApprovalIds: conv.submittingApprovalIds, expandToolCalls: expandTools, showFileReviewRecords: true }), activeTodos && Object.keys(activeTodos).length > 0 && (_jsx(Box, { marginTop: 1, paddingLeft: 1, children: _jsx(TodoList, { todos: activeTodos }) })), conv.approvalError && (_jsx(Box, { paddingLeft: 1, children: _jsxs(Text, { color: "red", children: ["Approval error: ", conv.approvalError.message] }) })), conv.sendError && (_jsx(Box, { paddingLeft: 1, children: _jsxs(Text, { color: "red", children: ["Send error: ", conv.sendError.message] }) })), _jsx(UsageWidget, { executions: allExecutions }), conv.fileChangeSets.length > 0 && (_jsxs(Box, { flexDirection: "column", children: [_jsx(FileReviewPrompt, { changeSet: conv.fileChangeSets[0], onSubmit: conv.submitFileDecision, submittingDecisionKeys: conv.submittingFileDecisionKeys, decisionErrors: conv.fileDecisionErrors,
|
|
71
|
+
_jsx(ExecutionProgress, { phase: conv.activePhase })), _jsx(MessageThread, { executions: conv.completedExecutions, activeStreamExecution: conv.activeStreamExecution, pendingUserMessage: conv.pendingUserMessage, onApprovalSubmit: conv.submitApproval, submittingApprovalIds: conv.submittingApprovalIds, expandToolCalls: expandTools, showFileReviewRecords: true }), activeTodos && Object.keys(activeTodos).length > 0 && (_jsx(Box, { marginTop: 1, paddingLeft: 1, children: _jsx(TodoList, { todos: activeTodos }) })), conv.approvalError && (_jsx(Box, { paddingLeft: 1, children: _jsxs(Text, { color: "red", children: ["Approval error: ", conv.approvalError.message] }) })), conv.sendError && (_jsx(Box, { paddingLeft: 1, children: _jsxs(Text, { color: "red", children: ["Send error: ", conv.sendError.message] }) })), _jsx(UsageWidget, { executions: allExecutions }), _jsx(FileChangeProgressBar, { progress: conv.fileChangeProgress, expanded: expandTools }), conv.fileChangeSets.length > 0 && (_jsxs(Box, { flexDirection: "column", children: [_jsx(FileReviewPrompt, { changeSet: conv.fileChangeSets[0], onSubmit: conv.submitFileDecision, submittingDecisionKeys: conv.submittingFileDecisionKeys, decisionErrors: conv.fileDecisionErrors,
|
|
71
72
|
// Single active decision surface: yield to a pending tool approval.
|
|
72
73
|
isActive: conv.pendingApprovals.length === 0 }), conv.fileChangeSets.length > 1 && (_jsx(Box, { paddingLeft: 2, children: _jsxs(Text, { dimColor: true, children: [conv.fileChangeSets.length - 1, " more awaiting review"] }) }))] })), conv.fileReviewError && (_jsx(Box, { paddingLeft: 1, children: _jsxs(Text, { color: "red", children: ["File review error: ", conv.fileReviewError.message] }) })), conv.canSendFollowUp && (_jsx(Box, { paddingLeft: 1, children: _jsx(Text, { color: activeMode === "plan" ? "yellow" : "cyan", dimColor: true, children: activeMode === "plan"
|
|
73
74
|
? "Plan mode — read-only analysis, no file mutations"
|
package/app/SessionView.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SessionView.js","sourceRoot":"","sources":["../../src/app/SessionView.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,KAAK,CAAC;AAC1C,OAAO,OAAO,MAAM,aAAa,CAAC;AAClC,OAAO,EAAE,sBAAsB,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAC1F,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAC/D,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC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AC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,EAAE,QAAQ,kBAC7D,UAAU,KAAK,MAAM;wBACpB,CAAC,CAAC,mDAAmD;wBACrD,CAAC,CAAC,+BAA+B,GAC9B,GACH,CACP,EAED,KAAC,aAAa,IACZ,QAAQ,EAAE,CAAC,OAAO,EAAE,EAAE,CACpB,IAAI,CAAC,YAAY,CAAC,OAAO,EAAE,EAAE,eAAe,EAAE,UAAU,EAAE,CAAC,EAE7D,YAAY,EAAE,IAAI,CAAC,SAAS,EAC5B,QAAQ,EAAE,CAAC,IAAI,CAAC,eAAe,EAC/B,IAAI,EAAE,UAAU,GAChB,IACE,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -8,6 +8,20 @@ export interface ApprovalPromptProps {
|
|
|
8
8
|
readonly onSubmit: (action: ApprovalAction) => void;
|
|
9
9
|
/** Disables input while an approval submission is in flight. */
|
|
10
10
|
readonly isSubmitting?: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Whether this prompt owns the keyboard. Defaults to `true`. When `false` the
|
|
13
|
+
* prompt renders inert (no `useInput`, no selection cursor, options dimmed) so
|
|
14
|
+
* exactly one decision surface is interactive at a time.
|
|
15
|
+
*
|
|
16
|
+
* This is the terminal's single-active-decision-surface rule: stdin is
|
|
17
|
+
* delivered to *every* mounted `useInput`, so several live `ApprovalPrompt`s
|
|
18
|
+
* would each consume the same keystroke and settle at once. The caller
|
|
19
|
+
* ({@link MessageThread}) marks only the first pending approval active; the
|
|
20
|
+
* file-review prompt in turn yields to any pending approval
|
|
21
|
+
* (`FileReviewPrompt.isActive = pendingApprovals.length === 0` in `SessionView`),
|
|
22
|
+
* so the order is: first approval → else the file-review prompt.
|
|
23
|
+
*/
|
|
24
|
+
readonly isActive?: boolean;
|
|
11
25
|
}
|
|
12
26
|
/**
|
|
13
27
|
* HITL approval prompt for tool call authorization.
|
|
@@ -20,5 +34,5 @@ export interface ApprovalPromptProps {
|
|
|
20
34
|
* file edit / delete / shell category) — other classes keep prompting. The
|
|
21
35
|
* option label names that class so the scope is never a surprise.
|
|
22
36
|
*/
|
|
23
|
-
export declare function ApprovalPrompt({ pendingApproval, onSubmit, isSubmitting, }: ApprovalPromptProps): import("react/jsx-runtime").JSX.Element;
|
|
37
|
+
export declare function ApprovalPrompt({ pendingApproval, onSubmit, isSubmitting, isActive, }: ApprovalPromptProps): import("react/jsx-runtime").JSX.Element;
|
|
24
38
|
//# sourceMappingURL=ApprovalPrompt.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ApprovalPrompt.d.ts","sourceRoot":"","sources":["../../src/components/ApprovalPrompt.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kEAAkE,CAAC;AACxG,OAAO,EAAE,cAAc,EAAE,MAAM,8DAA8D,CAAC;AAO9F,wCAAwC;AACxC,MAAM,WAAW,mBAAmB;IAClC,8CAA8C;IAC9C,QAAQ,CAAC,eAAe,EAAE,eAAe,CAAC;IAC1C,8CAA8C;IAC9C,QAAQ,CAAC,QAAQ,EAAE,CAAC,MAAM,EAAE,cAAc,KAAK,IAAI,CAAC;IACpD,gEAAgE;IAChE,QAAQ,CAAC,YAAY,CAAC,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"ApprovalPrompt.d.ts","sourceRoot":"","sources":["../../src/components/ApprovalPrompt.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kEAAkE,CAAC;AACxG,OAAO,EAAE,cAAc,EAAE,MAAM,8DAA8D,CAAC;AAO9F,wCAAwC;AACxC,MAAM,WAAW,mBAAmB;IAClC,8CAA8C;IAC9C,QAAQ,CAAC,eAAe,EAAE,eAAe,CAAC;IAC1C,8CAA8C;IAC9C,QAAQ,CAAC,QAAQ,EAAE,CAAC,MAAM,EAAE,cAAc,KAAK,IAAI,CAAC;IACpD,gEAAgE;IAChE,QAAQ,CAAC,YAAY,CAAC,EAAE,OAAO,CAAC;IAChC;;;;;;;;;;;;OAYG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;CAC7B;AAuCD;;;;;;;;;;GAUG;AACH,wBAAgB,cAAc,CAAC,EAC7B,eAAe,EACf,QAAQ,EACR,YAAoB,EACpB,QAAe,GAChB,EAAE,mBAAmB,2CA0IrB"}
|
|
@@ -40,7 +40,7 @@ function buildApproveAllLabel(toolName, mcpServerSlug) {
|
|
|
40
40
|
* file edit / delete / shell category) — other classes keep prompting. The
|
|
41
41
|
* option label names that class so the scope is never a surprise.
|
|
42
42
|
*/
|
|
43
|
-
export function ApprovalPrompt({ pendingApproval, onSubmit, isSubmitting = false, }) {
|
|
43
|
+
export function ApprovalPrompt({ pendingApproval, onSubmit, isSubmitting = false, isActive = true, }) {
|
|
44
44
|
const [selectedIndex, setSelectedIndex] = useState(0);
|
|
45
45
|
const options = useMemo(() => [
|
|
46
46
|
{
|
|
@@ -86,7 +86,7 @@ export function ApprovalPrompt({ pendingApproval, onSubmit, isSubmitting = false
|
|
|
86
86
|
onSubmit(options[shortcutMatch].action);
|
|
87
87
|
}
|
|
88
88
|
}
|
|
89
|
-
});
|
|
89
|
+
}, { isActive: isActive && !isSubmitting });
|
|
90
90
|
const serverSlug = pendingApproval.mcpServerSlug;
|
|
91
91
|
const toolLabel = serverSlug
|
|
92
92
|
? `${serverSlug}/${pendingApproval.toolName}`
|
|
@@ -95,6 +95,12 @@ export function ApprovalPrompt({ pendingApproval, onSubmit, isSubmitting = false
|
|
|
95
95
|
// PendingApproval. Mirrors the React card's gate-reason line so the terminal
|
|
96
96
|
// surface explains the gate at parity. Empty for legacy executions.
|
|
97
97
|
const gateReason = describeApprovalPolicySource(pendingApproval.approvalPolicySource);
|
|
98
|
-
return (_jsxs(Box, { flexDirection: "column", paddingLeft: 2, paddingTop: 1, paddingBottom: 1, borderStyle: "round", borderColor: "yellow", children: [_jsxs(Box, { gap: 1, children: [_jsx(Text, { color: "yellow", bold: true, children: "\u26A0 Approval required" }), pendingApproval.fromSubAgent && (_jsxs(Text, { dimColor: true, children: ["via ", pendingApproval.subAgentSubject || pendingApproval.subAgentName] }))] }), _jsxs(Box, { paddingLeft: 2, marginTop: 1, flexDirection: "column", children: [_jsxs(Box, { gap: 1, children: [_jsx(Text, { dimColor: true, children: "Tool:" }), _jsx(Text, { bold: true, children: toolLabel })] }), pendingApproval.argsPreview && (_jsxs(Box, { gap: 1, children: [_jsx(Text, { dimColor: true, children: "Args:" }), _jsx(Text, { wrap: "truncate-end", children: pendingApproval.argsPreview })] })), gateReason && (_jsxs(Box, { gap: 1, children: [_jsx(Text, { dimColor: true, children: "Why:" }), _jsx(Text, { dimColor: true, italic: true, children: gateReason })] }))] }), _jsx(Box, { gap: 2, marginTop: 1, paddingLeft: 2, children: options.map((opt, idx) =>
|
|
98
|
+
return (_jsxs(Box, { flexDirection: "column", paddingLeft: 2, paddingTop: 1, paddingBottom: 1, borderStyle: "round", borderColor: "yellow", children: [_jsxs(Box, { gap: 1, children: [_jsx(Text, { color: "yellow", bold: true, children: "\u26A0 Approval required" }), pendingApproval.fromSubAgent && (_jsxs(Text, { dimColor: true, children: ["via ", pendingApproval.subAgentSubject || pendingApproval.subAgentName] }))] }), _jsxs(Box, { paddingLeft: 2, marginTop: 1, flexDirection: "column", children: [_jsxs(Box, { gap: 1, children: [_jsx(Text, { dimColor: true, children: "Tool:" }), _jsx(Text, { bold: true, children: toolLabel })] }), pendingApproval.argsPreview && (_jsxs(Box, { gap: 1, children: [_jsx(Text, { dimColor: true, children: "Args:" }), _jsx(Text, { wrap: "truncate-end", children: pendingApproval.argsPreview })] })), gateReason && (_jsxs(Box, { gap: 1, children: [_jsx(Text, { dimColor: true, children: "Why:" }), _jsx(Text, { dimColor: true, italic: true, children: gateReason })] }))] }), _jsx(Box, { gap: 2, marginTop: 1, paddingLeft: 2, children: options.map((opt, idx) => {
|
|
99
|
+
// When inactive, no option is selected and all read dim — the active
|
|
100
|
+
// prompt's highlight (vs. these dimmed rows) is the cue for which
|
|
101
|
+
// approval owns the keyboard, so no per-prompt hint is needed.
|
|
102
|
+
const selected = isActive && idx === selectedIndex;
|
|
103
|
+
return (_jsxs(Text, { color: selected ? opt.color : undefined, dimColor: !selected, bold: selected, children: [selected ? "▸ " : " ", "[", opt.shortcut, "] ", opt.label] }, opt.shortcut));
|
|
104
|
+
}) }), isSubmitting && (_jsx(Box, { paddingLeft: 2, marginTop: 1, children: _jsx(Text, { dimColor: true, children: "Submitting..." }) }))] }));
|
|
99
105
|
}
|
|
100
106
|
//# sourceMappingURL=ApprovalPrompt.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ApprovalPrompt.js","sourceRoot":"","sources":["../../src/components/ApprovalPrompt.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjD,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,KAAK,CAAC;AAE1C,OAAO,EAAE,cAAc,EAAE,MAAM,8DAA8D,CAAC;AAC9F,OAAO,EACL,QAAQ,EACR,qBAAqB,EACrB,4BAA4B,GAC7B,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"ApprovalPrompt.js","sourceRoot":"","sources":["../../src/components/ApprovalPrompt.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjD,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,KAAK,CAAC;AAE1C,OAAO,EAAE,cAAc,EAAE,MAAM,8DAA8D,CAAC;AAC9F,OAAO,EACL,QAAQ,EACR,qBAAqB,EACrB,4BAA4B,GAC7B,MAAM,cAAc,CAAC;AAiCtB;;;;;;;;;GASG;AACH,SAAS,oBAAoB,CAC3B,QAAgB,EAChB,aAAqB;IAErB,IAAI,aAAa,EAAE,CAAC;QAClB,OAAO,eAAe,aAA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AAE,CAAC,YACtC,OAAO,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;oBACxB,qEAAqE;oBACrE,kEAAkE;oBAClE,+DAA+D;oBAC/D,MAAM,QAAQ,GAAG,QAAQ,IAAI,GAAG,KAAK,aAAa,CAAC;oBACnD,OAAO,CACL,MAAC,IAAI,IAEH,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,EACvC,QAAQ,EAAE,CAAC,QAAQ,EACnB,IAAI,EAAE,QAAQ,aAEb,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,OACrB,GAAG,CAAC,QAAQ,QAAI,GAAG,CAAC,KAAK,KANtB,GAAG,CAAC,QAAQ,CAOZ,CACR,CAAC;gBACJ,CAAC,CAAC,GACE,EAEL,YAAY,IAAI,CACf,KAAC,GAAG,IAAC,WAAW,EAAE,CAAC,EAAE,SAAS,EAAE,CAAC,YAC/B,KAAC,IAAI,IAAC,QAAQ,oCAAqB,GAC/B,CACP,IACG,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { FileChangeProgress } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/filereview_pb";
|
|
2
|
+
/** Props for {@link FileChangeProgressBar}. */
|
|
3
|
+
export interface FileChangeProgressBarProps {
|
|
4
|
+
/**
|
|
5
|
+
* The transient mid-run progress snapshot for the active turn (DD-32). Feed
|
|
6
|
+
* this from `useSessionConversation().fileChangeProgress`. Renders nothing when
|
|
7
|
+
* undefined or when no files have changed yet — the server clears it once the
|
|
8
|
+
* turn's change set leaves CAPTURING, so the strip disappears exactly when the
|
|
9
|
+
* decision surface (`FileReviewPrompt`) takes over.
|
|
10
|
+
*/
|
|
11
|
+
readonly progress: FileChangeProgress | undefined;
|
|
12
|
+
/**
|
|
13
|
+
* Whether to reveal the per-file list. The compact one-line summary always
|
|
14
|
+
* shows; the list is progressive disclosure. `SessionView` binds this to its
|
|
15
|
+
* existing Ctrl+O "expand" toggle so no new keybinding is introduced. Defaults
|
|
16
|
+
* to `false`.
|
|
17
|
+
*/
|
|
18
|
+
readonly expanded?: boolean;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* The terminal analogue of the web's non-interactive "N files changing…" strip
|
|
22
|
+
* (`@stigmer/react` `FileChangeProgressBar`), for a turn that is still running.
|
|
23
|
+
*
|
|
24
|
+
* WHY IT EXISTS. The transcript streams per-edit tool rows, but a change made by
|
|
25
|
+
* a shell command (a `sed`, a build step) has no tool row, and there is no
|
|
26
|
+
* running net-of-many-edits rollup until the turn ends. This strip fills that
|
|
27
|
+
* gap: a compact, non-interactive count of the workspace delta accumulating
|
|
28
|
+
* during the turn, sitting where the `FileReviewPrompt` will later appear. The
|
|
29
|
+
* two are mutually exclusive per turn (progress shows while CAPTURING; the prompt
|
|
30
|
+
* once AWAITING_REVIEW), so the strip hands off cleanly to the prompt.
|
|
31
|
+
*
|
|
32
|
+
* NEVER A DECISION SURFACE. Progress is non-authoritative and carries no file
|
|
33
|
+
* bodies — it is never reviewable or decidable, and it owns no keyboard input.
|
|
34
|
+
* The reviewed diff is the turn-boundary candidate (`FileReviewPrompt`). A
|
|
35
|
+
* secret-like path is surfaced by name with its counts withheld (zeroed), so the
|
|
36
|
+
* `+N −M` stat renders nothing for it. The quiet/dim register (no border)
|
|
37
|
+
* distinguishes it from the loud, bordered decision prompt.
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* ```tsx
|
|
41
|
+
* const conv = useSessionConversation(sessionId, org);
|
|
42
|
+
* <FileChangeProgressBar progress={conv.fileChangeProgress} expanded={expandTools} />
|
|
43
|
+
* ```
|
|
44
|
+
*/
|
|
45
|
+
export declare function FileChangeProgressBar({ progress, expanded, }: FileChangeProgressBarProps): import("react/jsx-runtime").JSX.Element | null;
|
|
46
|
+
//# sourceMappingURL=FileChangeProgressBar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FileChangeProgressBar.d.ts","sourceRoot":"","sources":["../../src/components/FileChangeProgressBar.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oEAAoE,CAAC;AAI7G,+CAA+C;AAC/C,MAAM,WAAW,0BAA0B;IACzC;;;;;;OAMG;IACH,QAAQ,CAAC,QAAQ,EAAE,kBAAkB,GAAG,SAAS,CAAC;IAClD;;;;;OAKG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;CAC7B;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,qBAAqB,CAAC,EACpC,QAAQ,EACR,QAAgB,GACjB,EAAE,0BAA0B,kDA0C5B"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Box, Text } from "ink";
|
|
3
|
+
import { kindLetter, progressEntryDisplayPath } from "../file-review.js";
|
|
4
|
+
import { FileLineStats } from "./FileReviewAtoms.js";
|
|
5
|
+
/**
|
|
6
|
+
* The terminal analogue of the web's non-interactive "N files changing…" strip
|
|
7
|
+
* (`@stigmer/react` `FileChangeProgressBar`), for a turn that is still running.
|
|
8
|
+
*
|
|
9
|
+
* WHY IT EXISTS. The transcript streams per-edit tool rows, but a change made by
|
|
10
|
+
* a shell command (a `sed`, a build step) has no tool row, and there is no
|
|
11
|
+
* running net-of-many-edits rollup until the turn ends. This strip fills that
|
|
12
|
+
* gap: a compact, non-interactive count of the workspace delta accumulating
|
|
13
|
+
* during the turn, sitting where the `FileReviewPrompt` will later appear. The
|
|
14
|
+
* two are mutually exclusive per turn (progress shows while CAPTURING; the prompt
|
|
15
|
+
* once AWAITING_REVIEW), so the strip hands off cleanly to the prompt.
|
|
16
|
+
*
|
|
17
|
+
* NEVER A DECISION SURFACE. Progress is non-authoritative and carries no file
|
|
18
|
+
* bodies — it is never reviewable or decidable, and it owns no keyboard input.
|
|
19
|
+
* The reviewed diff is the turn-boundary candidate (`FileReviewPrompt`). A
|
|
20
|
+
* secret-like path is surfaced by name with its counts withheld (zeroed), so the
|
|
21
|
+
* `+N −M` stat renders nothing for it. The quiet/dim register (no border)
|
|
22
|
+
* distinguishes it from the loud, bordered decision prompt.
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```tsx
|
|
26
|
+
* const conv = useSessionConversation(sessionId, org);
|
|
27
|
+
* <FileChangeProgressBar progress={conv.fileChangeProgress} expanded={expandTools} />
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
export function FileChangeProgressBar({ progress, expanded = false, }) {
|
|
31
|
+
if (!progress || progress.filesChanged === 0)
|
|
32
|
+
return null;
|
|
33
|
+
const { filesChanged, linesAdded, linesRemoved, entries } = progress;
|
|
34
|
+
const hiddenCount = filesChanged - entries.length;
|
|
35
|
+
return (_jsxs(Box, { flexDirection: "column", paddingLeft: 1, children: [_jsxs(Box, { gap: 1, children: [_jsx(Text, { dimColor: true, children: "\u270E" }), _jsxs(Text, { dimColor: true, children: [filesChanged, " file", filesChanged === 1 ? "" : "s", " changing\u2026"] }), _jsx(FileLineStats, { linesAdded: linesAdded, linesRemoved: linesRemoved })] }), expanded && (_jsxs(Box, { flexDirection: "column", paddingLeft: 2, children: [entries.map((entry, idx) => {
|
|
36
|
+
const path = progressEntryDisplayPath(entry);
|
|
37
|
+
return (_jsxs(Box, { gap: 1, children: [_jsx(Text, { dimColor: true, children: kindLetter(entry.kind) }), _jsx(Text, { dimColor: true, wrap: "truncate-end", children: path }), _jsx(FileLineStats, { linesAdded: entry.linesAdded, linesRemoved: entry.linesRemoved })] }, `${path}-${idx}`));
|
|
38
|
+
}), hiddenCount > 0 && (_jsx(Box, { children: _jsxs(Text, { dimColor: true, children: ["\u2026 and ", hiddenCount, " more"] }) }))] }))] }));
|
|
39
|
+
}
|
|
40
|
+
//# sourceMapping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AAC;wBAC7C,OAAO,CACL,MAAC,GAAG,IAAwB,GAAG,EAAE,CAAC,aAChC,KAAC,IAAI,IAAC,QAAQ,kBAAE,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,GAAQ,EAC9C,KAAC,IAAI,IAAC,QAAQ,QAAC,IAAI,EAAC,cAAc,YAC/B,IAAI,GACA,EACP,KAAC,aAAa,IACZ,UAAU,EAAE,KAAK,CAAC,UAAU,EAC5B,YAAY,EAAE,KAAK,CAAC,YAAY,GAChC,KARM,GAAG,IAAI,IAAI,GAAG,EAAE,CASpB,CACP,CAAC;oBACJ,CAAC,CAAC,EACD,WAAW,GAAG,CAAC,IAAI,CAClB,KAAC,GAAG,cACF,MAAC,IAAI,IAAC,QAAQ,kCAAQ,WAAW,aAAa,GAC1C,CACP,IACG,CACP,IACG,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { CapturedFileChange } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/filereview_pb";
|
|
2
|
+
/** Props for {@link FileDiffBody}. */
|
|
3
|
+
export interface FileDiffBodyProps {
|
|
4
|
+
/** The captured file change whose before/after diff to render. */
|
|
5
|
+
readonly change: CapturedFileChange;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* The terminal analogue of `@stigmer/react`'s `FileChangeDiff` — the whole-file
|
|
9
|
+
* branch. Renders a single `CapturedFileChange`'s unified diff for review in the
|
|
10
|
+
* terminal.
|
|
11
|
+
*
|
|
12
|
+
* A capture is always whole-file (`toDisplayFileChange` emits
|
|
13
|
+
* `captureLevel = WHOLE_FILE`), so this deliberately handles only that case: it
|
|
14
|
+
* resolves the before/after text via the shared `useFileChangeContent` behavior
|
|
15
|
+
* hook (inline bodies cost nothing; offloaded bodies are fetched lazily through
|
|
16
|
+
* the server proxy) and diffs them with the shared pure `computeDiff` — the SAME
|
|
17
|
+
* engine the web renders, so the terminal and web diffs are line-for-line
|
|
18
|
+
* identical and cannot drift.
|
|
19
|
+
*
|
|
20
|
+
* Renders body-only (no filename caption): the caller's selected row already
|
|
21
|
+
* names the file and shows its `+N −M`, so a header here would just repeat what
|
|
22
|
+
* the reviewer read one line up.
|
|
23
|
+
*
|
|
24
|
+
* **Requires an `InkStigmerProvider` ancestor.** `useFileChangeContent` reads the
|
|
25
|
+
* Stigmer client via `useStigmer()` (to dereference offloaded diff bytes), which
|
|
26
|
+
* throws outside a provider. In a live session this always holds — `SessionView`
|
|
27
|
+
* renders under `InkStigmerProvider`.
|
|
28
|
+
*/
|
|
29
|
+
export declare function FileDiffBody({ change }: FileDiffBodyProps): import("react/jsx-runtime").JSX.Element;
|
|
30
|
+
//# sourceMappingURL=FileDiffBody.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FileDiffBody.d.ts","sourceRoot":"","sources":["../../src/components/FileDiffBody.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oEAAoE,CAAC;AAiB7G,sCAAsC;AACtC,MAAM,WAAW,iBAAiB;IAChC,kEAAkE;IAClE,QAAQ,CAAC,MAAM,EAAE,kBAAkB,CAAC;CACrC;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,YAAY,CAAC,EAAE,MAAM,EAAE,EAAE,iBAAiB,2CA6CzD"}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo } from "react";
|
|
3
|
+
import { Box, Text } from "ink";
|
|
4
|
+
import { FileChangeType } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/enum_pb";
|
|
5
|
+
import { computeDiff, useFileChangeContent, } from "@stigmer/react";
|
|
6
|
+
import { toDisplayFileChange } from "@stigmer/sdk";
|
|
7
|
+
/**
|
|
8
|
+
* The most diff lines a single file's body renders before it is capped. A
|
|
9
|
+
* terminal has no scroll-within-region, so an unbounded diff would flood the
|
|
10
|
+
* scrollback; beyond this the remainder is summarized in a `… K more lines`
|
|
11
|
+
* footer (the terminal analogue of the web's `BoundedContent` clamp).
|
|
12
|
+
*/
|
|
13
|
+
const DIFF_MAX_LINES = 200;
|
|
14
|
+
/**
|
|
15
|
+
* The terminal analogue of `@stigmer/react`'s `FileChangeDiff` — the whole-file
|
|
16
|
+
* branch. Renders a single `CapturedFileChange`'s unified diff for review in the
|
|
17
|
+
* terminal.
|
|
18
|
+
*
|
|
19
|
+
* A capture is always whole-file (`toDisplayFileChange` emits
|
|
20
|
+
* `captureLevel = WHOLE_FILE`), so this deliberately handles only that case: it
|
|
21
|
+
* resolves the before/after text via the shared `useFileChangeContent` behavior
|
|
22
|
+
* hook (inline bodies cost nothing; offloaded bodies are fetched lazily through
|
|
23
|
+
* the server proxy) and diffs them with the shared pure `computeDiff` — the SAME
|
|
24
|
+
* engine the web renders, so the terminal and web diffs are line-for-line
|
|
25
|
+
* identical and cannot drift.
|
|
26
|
+
*
|
|
27
|
+
* Renders body-only (no filename caption): the caller's selected row already
|
|
28
|
+
* names the file and shows its `+N −M`, so a header here would just repeat what
|
|
29
|
+
* the reviewer read one line up.
|
|
30
|
+
*
|
|
31
|
+
* **Requires an `InkStigmerProvider` ancestor.** `useFileChangeContent` reads the
|
|
32
|
+
* Stigmer client via `useStigmer()` (to dereference offloaded diff bytes), which
|
|
33
|
+
* throws outside a provider. In a live session this always holds — `SessionView`
|
|
34
|
+
* renders under `InkStigmerProvider`.
|
|
35
|
+
*/
|
|
36
|
+
export function FileDiffBody({ change }) {
|
|
37
|
+
const displayChange = useMemo(() => toDisplayFileChange(change), [change]);
|
|
38
|
+
const { beforeText, afterText, isBinary, isLoading, error, isTruncated, downloadUrl } = useFileChangeContent(displayChange);
|
|
39
|
+
const hunks = useMemo(() => {
|
|
40
|
+
if (beforeText === null || afterText === null)
|
|
41
|
+
return [];
|
|
42
|
+
return computeDiff(beforeText, afterText);
|
|
43
|
+
}, [beforeText, afterText]);
|
|
44
|
+
// Honest state precedence, mirroring the web FileChangeBody's whole-file arm:
|
|
45
|
+
// a binary has no text diff; a server-truncated body cannot be diffed inline;
|
|
46
|
+
// an offloaded body may still be loading or have failed; only then do we trust
|
|
47
|
+
// an empty hunk list to mean the file genuinely has no visible change.
|
|
48
|
+
if (isBinary) {
|
|
49
|
+
return _jsx(Notice, { children: "Binary file changed." });
|
|
50
|
+
}
|
|
51
|
+
if (isTruncated) {
|
|
52
|
+
return (_jsxs(Notice, { children: ["This file is too large to diff inline.", downloadUrl ? ` Download the full file: ${downloadUrl}` : ""] }));
|
|
53
|
+
}
|
|
54
|
+
if (isLoading) {
|
|
55
|
+
return _jsx(Notice, { children: "Loading diff\u2026" });
|
|
56
|
+
}
|
|
57
|
+
if (error) {
|
|
58
|
+
return _jsx(Notice, { tone: "error", children: "Could not load this file's contents." });
|
|
59
|
+
}
|
|
60
|
+
if (hunks.length === 0) {
|
|
61
|
+
// A CREATE with nothing to show is a genuinely empty new file; anything else
|
|
62
|
+
// with no renderable diff is the non-committal "no preview" — we never claim
|
|
63
|
+
// emptiness we cannot prove from the capture.
|
|
64
|
+
return (_jsx(Notice, { children: displayChange.changeType === FileChangeType.CREATE
|
|
65
|
+
? "Empty new file."
|
|
66
|
+
: "No preview available." }));
|
|
67
|
+
}
|
|
68
|
+
return _jsx(DiffHunks, { hunks: hunks });
|
|
69
|
+
}
|
|
70
|
+
/** Flattens hunks into a single row stream so the line cap spans the whole diff. */
|
|
71
|
+
function flattenHunks(hunks) {
|
|
72
|
+
const rows = [];
|
|
73
|
+
for (const hunk of hunks) {
|
|
74
|
+
rows.push({
|
|
75
|
+
kind: "header",
|
|
76
|
+
text: `@@ -${hunk.oldStart},${hunk.oldLines} +${hunk.newStart},${hunk.newLines} @@`,
|
|
77
|
+
});
|
|
78
|
+
for (const line of hunk.lines) {
|
|
79
|
+
rows.push({ kind: "line", type: line.type, content: line.content });
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
return rows;
|
|
83
|
+
}
|
|
84
|
+
function DiffHunks({ hunks }) {
|
|
85
|
+
const rows = useMemo(() => flattenHunks(hunks), [hunks]);
|
|
86
|
+
const shown = rows.slice(0, DIFF_MAX_LINES);
|
|
87
|
+
const overflow = rows.length - shown.length;
|
|
88
|
+
return (_jsxs(Box, { flexDirection: "column", marginTop: 1, children: [shown.map((row, i) => (_jsx(DiffRowText, { row: row }, i))), overflow > 0 && (_jsxs(Text, { dimColor: true, children: ["\u2026 ", overflow, " more line", overflow === 1 ? "" : "s"] }))] }));
|
|
89
|
+
}
|
|
90
|
+
function DiffRowText({ row }) {
|
|
91
|
+
if (row.kind === "header") {
|
|
92
|
+
return _jsx(Text, { dimColor: true, children: row.text });
|
|
93
|
+
}
|
|
94
|
+
if (row.type === "added") {
|
|
95
|
+
return _jsxs(Text, { color: "green", children: ["+", row.content] });
|
|
96
|
+
}
|
|
97
|
+
if (row.type === "removed") {
|
|
98
|
+
return _jsxs(Text, { color: "red", children: ["-", row.content] });
|
|
99
|
+
}
|
|
100
|
+
return _jsxs(Text, { dimColor: true, children: [" ", row.content] });
|
|
101
|
+
}
|
|
102
|
+
/** A short status line for a non-renderable diff (binary / truncated / loading / error / empty). */
|
|
103
|
+
function Notice({ children, tone = "muted", }) {
|
|
104
|
+
return (_jsx(Box, { marginTop: 1, children: _jsx(Text, { color: tone === "error" ? "red" : undefined, dimColor: tone !== "error", children: children }) }));
|
|
105
|
+
}
|
|
106
|
+
//# sourceMappingURL=FileDiffBody.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FileDiffBody.js","sourceRoot":"","sources":["../../src/components/FileDiffBody.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAEhC,OAAO,EAAE,cAAc,EAAE,MAAM,8DAA8D,CAAC;AAC9F,OAAO,EACL,WAAW,EACX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AE,IAAI,KAAK,OAAO,YAC1E,QAAQ,GACJ,GACH,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared presentational atoms for the terminal file-review surfaces — the single
|
|
3
|
+
* source for the `+N −M` line stat, so the decision prompt, the settled record,
|
|
4
|
+
* and the mid-run progress bar can never drift in how they render a file's (or a
|
|
5
|
+
* set's) magnitude. The terminal analogue of `@stigmer/react`'s `FileReviewAtoms`.
|
|
6
|
+
*
|
|
7
|
+
* The change-kind marker is deliberately NOT here: the terminal renders kind via
|
|
8
|
+
* the pure `kindLetter` helper (in `file-review.ts`), already shared across every
|
|
9
|
+
* surface. The web needs a `FileKindBadge` component because its marker carries
|
|
10
|
+
* per-kind color tokens and a11y labels; a plain letter needs neither.
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* The `+N −M` stat for one file (or a whole set), in the diff colour vocabulary.
|
|
14
|
+
* Renders nothing when both counts are zero — the honest signal that no count
|
|
15
|
+
* exists (binary or secret-withheld changes, or records captured before the
|
|
16
|
+
* counts were stamped) — rather than a misleading `+0 -0`, matching the web
|
|
17
|
+
* `FileLineStats` contract.
|
|
18
|
+
*/
|
|
19
|
+
export declare function FileLineStats({ linesAdded, linesRemoved, }: {
|
|
20
|
+
readonly linesAdded: number;
|
|
21
|
+
readonly linesRemoved: number;
|
|
22
|
+
}): import("react/jsx-runtime").JSX.Element | null;
|
|
23
|
+
//# sourceMappingURL=FileReviewAtoms.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FileReviewAtoms.d.ts","sourceRoot":"","sources":["../../src/components/FileReviewAtoms.tsx"],"names":[],"mappings":"AAGA;;;;;;;;;;GAUG;AAEH;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,EAC5B,UAAU,EACV,YAAY,GACb,EAAE;IACD,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;CAC/B,kDAQA"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Text } from "ink";
|
|
3
|
+
/**
|
|
4
|
+
* Shared presentational atoms for the terminal file-review surfaces — the single
|
|
5
|
+
* source for the `+N −M` line stat, so the decision prompt, the settled record,
|
|
6
|
+
* and the mid-run progress bar can never drift in how they render a file's (or a
|
|
7
|
+
* set's) magnitude. The terminal analogue of `@stigmer/react`'s `FileReviewAtoms`.
|
|
8
|
+
*
|
|
9
|
+
* The change-kind marker is deliberately NOT here: the terminal renders kind via
|
|
10
|
+
* the pure `kindLetter` helper (in `file-review.ts`), already shared across every
|
|
11
|
+
* surface. The web needs a `FileKindBadge` component because its marker carries
|
|
12
|
+
* per-kind color tokens and a11y labels; a plain letter needs neither.
|
|
13
|
+
*/
|
|
14
|
+
/**
|
|
15
|
+
* The `+N −M` stat for one file (or a whole set), in the diff colour vocabulary.
|
|
16
|
+
* Renders nothing when both counts are zero — the honest signal that no count
|
|
17
|
+
* exists (binary or secret-withheld changes, or records captured before the
|
|
18
|
+
* counts were stamped) — rather than a misleading `+0 -0`, matching the web
|
|
19
|
+
* `FileLineStats` contract.
|
|
20
|
+
*/
|
|
21
|
+
export function FileLineStats({ linesAdded, linesRemoved, }) {
|
|
22
|
+
if (linesAdded === 0 && linesRemoved === 0)
|
|
23
|
+
return null;
|
|
24
|
+
return (_jsxs(Text, { children: [_jsxs(Text, { color: "green", children: ["+", linesAdded] }), _jsxs(Text, { color: "red", children: [" -", linesRemoved] })] }));
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=FileReviewAtoms.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FileReviewAtoms.js","sourceRoot":"","sources":["../../src/components/FileReviewAtoms.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAE3B;;;;;;;;;;GAUG;AAEH;;;;;;GAMG;AACH,MAAM,UAAU,aAAa,CAAC,EAC5B,UAAU,EACV,YAAY,GAIb;IACC,IAAI,UAAU,KAAK,CAAC,IAAI,YAAY,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IACxD,OAAO,CACL,MAAC,IAAI,eACH,MAAC,IAAI,IAAC,KAAK,EAAC,OAAO,kBAAG,UAAU,IAAQ,EACxC,MAAC,IAAI,IAAC,KAAK,EAAC,KAAK,mBAAI,YAAY,IAAQ,IACpC,CACR,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileReviewPrompt.d.ts","sourceRoot":"","sources":["../../src/components/FileReviewPrompt.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAEV,aAAa,EACd,MAAM,oEAAoE,CAAC;AAC5E,OAAO,EACL,kBAAkB,EAEnB,MAAM,8DAA8D,CAAC;AACtE,OAAO,EAKL,KAAK,mBAAmB,EACzB,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"FileReviewPrompt.d.ts","sourceRoot":"","sources":["../../src/components/FileReviewPrompt.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAEV,aAAa,EACd,MAAM,oEAAoE,CAAC;AAC5E,OAAO,EACL,kBAAkB,EAEnB,MAAM,8DAA8D,CAAC;AACtE,OAAO,EAKL,KAAK,mBAAmB,EACzB,MAAM,gBAAgB,CAAC;AAUxB,0CAA0C;AAC1C,MAAM,WAAW,qBAAqB;IACpC,0DAA0D;IAC1D,QAAQ,CAAC,SAAS,EAAE,aAAa,CAAC;IAClC;;;;OAIG;IACH,QAAQ,CAAC,QAAQ,EAAE,CACjB,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,kBAAkB,EAC1B,OAAO,CAAC,EAAE,mBAAmB,KAC1B,IAAI,CAAC;IACV,kFAAkF;IAClF,QAAQ,CAAC,sBAAsB,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IACtD,0DAA0D;IAC1D,QAAQ,CAAC,cAAc,CAAC,EAAE,WAAW,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;IACrD;;;;OAIG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;CAC7B;AA2BD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,gBAAgB,CAAC,EAC/B,SAAS,EACT,QAAQ,EACR,sBAAsB,EACtB,cAAc,EACd,QAAe,GAChB,EAAE,qBAAqB,2CA2LvB"}
|
|
@@ -3,7 +3,9 @@ import { useMemo, useState } from "react";
|
|
|
3
3
|
import { Box, Text, useInput } from "ink";
|
|
4
4
|
import { FileDecisionAction, FileDecisionScope, } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/enum_pb";
|
|
5
5
|
import { changeSetReviewability, fileReviewability, deriveEffectiveVerdicts, } from "@stigmer/react";
|
|
6
|
-
import { blockReasonNote, changeDisplayPath, kindLetter } from "../file-review.js";
|
|
6
|
+
import { blockReasonNote, changeDisplayPath, changeSetLineStats, kindLetter, } from "../file-review.js";
|
|
7
|
+
import { FileLineStats } from "./FileReviewAtoms.js";
|
|
8
|
+
import { FileDiffBody } from "./FileDiffBody.js";
|
|
7
9
|
/**
|
|
8
10
|
* The bulk approve/reject verb labels for a set, mirroring the web card's
|
|
9
11
|
* `bulkLabels`: "Keep" for a binary-only set (its bytes are applied as-is),
|
|
@@ -51,6 +53,9 @@ export function FileReviewPrompt({ changeSet, onSubmit, submittingDecisionKeys,
|
|
|
51
53
|
n++;
|
|
52
54
|
return n;
|
|
53
55
|
}, [changes, verdicts]);
|
|
56
|
+
// The set's aggregate +N −M, shown beside the header so the bar carries the
|
|
57
|
+
// magnitude of what is being decided, not just the file count (web parity).
|
|
58
|
+
const lineStats = useMemo(() => changeSetLineStats(changeSet), [changeSet]);
|
|
54
59
|
const labels = bulkLabels(total, decidedCount, binaryOnly);
|
|
55
60
|
// Busy while any decision for THIS set is in flight (whole-set key or any
|
|
56
61
|
// per-file key). Blocks input to avoid a double-submit mid-request.
|
|
@@ -151,10 +156,16 @@ export function FileReviewPrompt({ changeSet, onSubmit, submittingDecisionKeys,
|
|
|
151
156
|
if (match)
|
|
152
157
|
match.run();
|
|
153
158
|
}, { isActive: isActive && !busy });
|
|
154
|
-
return (_jsxs(Box, { flexDirection: "column", paddingLeft: 2, paddingTop: 1, paddingBottom: 1, borderStyle: "round", borderColor: "cyan", children: [
|
|
159
|
+
return (_jsxs(Box, { flexDirection: "column", paddingLeft: 2, paddingTop: 1, paddingBottom: 1, borderStyle: "round", borderColor: "cyan", children: [_jsxs(Box, { gap: 1, children: [_jsxs(Text, { color: "cyan", bold: true, children: ["\u270E ", total, " file", total === 1 ? "" : "s", " awaiting review"] }), _jsx(FileLineStats, { linesAdded: lineStats.linesAdded, linesRemoved: lineStats.linesRemoved })] }), perFile ? (_jsx(PerFileList, { changes: changes, verdicts: verdicts, selectedIndex: selectedIndex, interactive: isActive && !busy })) : (_jsx(Box, { gap: 2, marginTop: 1, paddingLeft: 2, children: bulkOptions.map((opt) => (_jsxs(Text, { color: opt.color, children: ["[", opt.shortcut, "] ", opt.label] }, opt.shortcut))) })), busy && (_jsx(Box, { paddingLeft: 2, marginTop: 1, children: _jsx(Text, { dimColor: true, children: "Submitting..." }) })), errorText && (_jsx(Box, { paddingLeft: 2, marginTop: 1, children: _jsxs(Text, { color: "red", children: ["Decision failed: ", errorText] }) })), !isActive && !perFile && (_jsx(Box, { paddingLeft: 2, marginTop: 1, children: _jsx(Text, { dimColor: true, italic: true, children: "Resolve the pending approval first" }) }))] }));
|
|
155
160
|
}
|
|
156
|
-
/**
|
|
161
|
+
/**
|
|
162
|
+
* The per-file review list: kind letter, path, verdict/keepability, and a hint,
|
|
163
|
+
* followed by a master-detail diff pane for the selected file. The list itself
|
|
164
|
+
* stays stable as the selection moves (the diff renders in a fixed pane below,
|
|
165
|
+
* not inline between rows), so navigating never reflows the rows above.
|
|
166
|
+
*/
|
|
157
167
|
function PerFileList({ changes, verdicts, selectedIndex, interactive, }) {
|
|
168
|
+
const selectedChange = changes[selectedIndex];
|
|
158
169
|
return (_jsxs(Box, { flexDirection: "column", marginTop: 1, paddingLeft: 2, children: [changes.map((change, idx) => {
|
|
159
170
|
const selected = idx === selectedIndex;
|
|
160
171
|
const verdict = verdicts.get(change.id);
|
|
@@ -164,9 +175,9 @@ function PerFileList({ changes, verdicts, selectedIndex, interactive, }) {
|
|
|
164
175
|
: verdict === FileDecisionAction.REJECT
|
|
165
176
|
? "discarded"
|
|
166
177
|
: null;
|
|
167
|
-
return (_jsxs(Box, { gap: 1, children: [_jsx(Text, { color: selected ? "cyan" : undefined, children: selected ? "▸" : " " }), _jsx(Text, { dimColor: true, children: kindLetter(change.kind) }), _jsx(Text, { color: selected ? "cyan" : undefined, bold: selected, wrap: "truncate-end", children: changeDisplayPath(change) }), decided && _jsxs(Text, { dimColor: true, children: ["(", decided, ")"] }), !decided && note && _jsxs(Text, { color: "yellow", children: ["\u2014 ", note] })] }, change.id));
|
|
178
|
+
return (_jsxs(Box, { gap: 1, children: [_jsx(Text, { color: selected ? "cyan" : undefined, children: selected ? "▸" : " " }), _jsx(Text, { dimColor: true, children: kindLetter(change.kind) }), _jsx(Text, { color: selected ? "cyan" : undefined, bold: selected, wrap: "truncate-end", children: changeDisplayPath(change) }), _jsx(FileLineStats, { linesAdded: change.linesAdded, linesRemoved: change.linesRemoved }), decided && _jsxs(Text, { dimColor: true, children: ["(", decided, ")"] }), !decided && note && _jsxs(Text, { color: "yellow", children: ["\u2014 ", note] })] }, change.id));
|
|
168
179
|
}), _jsx(Box, { marginTop: 1, children: _jsx(Text, { dimColor: true, children: interactive
|
|
169
180
|
? "↑/↓ move · [k] keep · [d] discard · [esc] back"
|
|
170
|
-
: "read-only" }) })] }));
|
|
181
|
+
: "read-only" }) }), selectedChange && (_jsx(FileDiffBody, { change: selectedChange }, selectedChange.id))] }));
|
|
171
182
|
}
|
|
172
183
|
//# sourceMappingURL=FileReviewPrompt.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileReviewPrompt.js","sourceRoot":"","sources":["../../src/components/FileReviewPrompt.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjD,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,KAAK,CAAC;AAK1C,OAAO,EACL,kBAAkB,EAClB,iBAAiB,GAClB,MAAM,8DAA8D,CAAC;AACtE,OAAO,EACL,sBAAsB,EACtB,iBAAiB,EACjB,uBAAuB,GAGxB,MAAM,gBAAgB,CAAC;AACxB,OAAO,
|
|
1
|
+
{"version":3,"file":"FileReviewPrompt.js","sourceRoot":"","sources":["../../src/components/FileReviewPrompt.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjD,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,KAAK,CAAC;AAK1C,OAAO,EACL,kBAAkB,EAClB,iBAAiB,GAClB,MAAM,8DAA8D,CAAC;AACtE,OAAO,EACL,sBAAsB,EACtB,iBAAiB,EACjB,uBAAuB,GAGxB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,eAAe,EACf,iBAAiB,EACjB,kBAAkB,EAClB,UAAU,GACX,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AA4BjD;;;;GAIG;AACH,SAAS,UAAU,CACjB,KAAa,EACb,OAAe,EACf,UAAmB;IAEnB,MAAM,IAAI,GAAG,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;IAC7C,IAAI,KAAK,IAAI,CAAC;QAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE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AAC,IAAI,IAAC,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,YACvC,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,GAChB,EACP,KAAC,IAAI,IAAC,QAAQ,kBAAE,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,GAAQ,EAC/C,KAAC,IAAI,IACH,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,EACpC,IAAI,EAAE,QAAQ,EACd,IAAI,EAAC,cAAc,YAElB,iBAAiB,CAAC,MAAM,CAAC,GACrB,EACP,KAAC,aAAa,IACZ,UAAU,EAAE,MAAM,CAAC,UAAU,EAC7B,YAAY,EAAE,MAAM,CAAC,YAAY,GACjC,EACD,OAAO,IAAI,MAAC,IAAI,IAAC,QAAQ,wBAAG,OAAO,SAAS,EAC5C,CAAC,OAAO,IAAI,IAAI,IAAI,MAAC,IAAI,IAAC,KAAK,EAAC,QAAQ,wBAAI,IAAI,IAAQ,KAjBjD,MAAM,CAAC,EAAE,CAkBb,CACP,CAAC;YACJ,CAAC,CAAC,EACF,KAAC,GAAG,IAAC,SAAS,EAAE,CAAC,YACf,KAAC,IAAI,IAAC,QAAQ,kBACX,WAAW;wBACV,CAAC,CAAC,gDAAgD;wBAClD,CAAC,CAAC,WAAW,GACV,GACH,EAKL,cAAc,IAAI,CACjB,KAAC,YAAY,IAAyB,MAAM,EAAE,cAAc,IAAzC,cAAc,CAAC,EAAE,CAA4B,CACjE,IACG,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileReviewRecord.d.ts","sourceRoot":"","sources":["../../src/components/FileReviewRecord.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oEAAoE,CAAC;
|
|
1
|
+
{"version":3,"file":"FileReviewRecord.d.ts","sourceRoot":"","sources":["../../src/components/FileReviewRecord.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oEAAoE,CAAC;AAcxG,0CAA0C;AAC1C,MAAM,WAAW,qBAAqB;IACpC,sEAAsE;IACtE,QAAQ,CAAC,aAAa,EAAE,aAAa,CAAC;CACvC;AAED;;;;;;;;;GASG;AACH,wBAAgB,gBAAgB,CAAC,EAAE,aAAa,EAAE,EAAE,qBAAqB,2CAyCxE"}
|
|
@@ -2,7 +2,8 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { Box, Text } from "ink";
|
|
3
3
|
import { FileChangeSetStatus, FileDecisionAction, } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/enum_pb";
|
|
4
4
|
import { deriveEffectiveVerdicts } from "@stigmer/react";
|
|
5
|
-
import { changeDisplayPath, kindLetter, settledSummary, } from "../file-review.js";
|
|
5
|
+
import { changeDisplayPath, changeSetLineStats, kindLetter, settledSummary, } from "../file-review.js";
|
|
6
|
+
import { FileLineStats } from "./FileReviewAtoms.js";
|
|
6
7
|
/**
|
|
7
8
|
* A read-only, append-only record of a SETTLED file-review change set — the
|
|
8
9
|
* terminal analogue of the web's in-thread `FileReviewRecordRow` (DD-27 D2).
|
|
@@ -17,7 +18,8 @@ export function FileReviewRecord({ fileChangeSet }) {
|
|
|
17
18
|
const failed = fileChangeSet.status === FileChangeSetStatus.FAILED;
|
|
18
19
|
const verdicts = deriveEffectiveVerdicts(fileChangeSet);
|
|
19
20
|
const summary = failed ? "review failed" : settledSummary(fileChangeSet);
|
|
20
|
-
|
|
21
|
+
const lineStats = changeSetLineStats(fileChangeSet);
|
|
22
|
+
return (_jsxs(Box, { flexDirection: "column", paddingLeft: 2, children: [_jsxs(Box, { gap: 1, children: [_jsx(Text, { dimColor: true, children: "\u270E" }), _jsxs(Text, { dimColor: true, children: ["File review \u2014 ", summary] }), _jsx(FileLineStats, { linesAdded: lineStats.linesAdded, linesRemoved: lineStats.linesRemoved })] }), fileChangeSet.changes.map((change) => {
|
|
21
23
|
const verdict = verdicts.get(change.id);
|
|
22
24
|
const label = failed
|
|
23
25
|
? null
|
|
@@ -26,7 +28,7 @@ export function FileReviewRecord({ fileChangeSet }) {
|
|
|
26
28
|
: verdict === FileDecisionAction.REJECT
|
|
27
29
|
? "discarded"
|
|
28
30
|
: "not reviewed";
|
|
29
|
-
return (_jsxs(Box, { paddingLeft: 2, gap: 1, children: [_jsx(Text, { dimColor: true, children: kindLetter(change.kind) }), _jsx(Text, { dimColor: true, wrap: "truncate-end", children: changeDisplayPath(change) }), label && _jsxs(Text, { dimColor: true, children: ["(", label, ")"] })] }, change.id));
|
|
31
|
+
return (_jsxs(Box, { paddingLeft: 2, gap: 1, children: [_jsx(Text, { dimColor: true, children: kindLetter(change.kind) }), _jsx(Text, { dimColor: true, wrap: "truncate-end", children: changeDisplayPath(change) }), _jsx(FileLineStats, { linesAdded: change.linesAdded, linesRemoved: change.linesRemoved }), label && _jsxs(Text, { dimColor: true, children: ["(", label, ")"] })] }, change.id));
|
|
30
32
|
})] }));
|
|
31
33
|
}
|
|
32
34
|
//# sourceMappingURL=FileReviewRecord.js.map
|