pentesting 0.70.11 → 0.70.12
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/main.js +326 -383
- package/package.json +1 -1
package/dist/main.js
CHANGED
|
@@ -793,7 +793,7 @@ var INPUT_PROMPT_PATTERNS = [
|
|
|
793
793
|
|
|
794
794
|
// src/shared/constants/agent.ts
|
|
795
795
|
var APP_NAME = "Pentest AI";
|
|
796
|
-
var APP_VERSION = "0.70.
|
|
796
|
+
var APP_VERSION = "0.70.12";
|
|
797
797
|
var APP_DESCRIPTION = "Autonomous Penetration Testing AI Agent";
|
|
798
798
|
var LLM_ROLES = {
|
|
799
799
|
SYSTEM: "system",
|
|
@@ -853,7 +853,7 @@ import { render } from "ink";
|
|
|
853
853
|
import chalk from "chalk";
|
|
854
854
|
|
|
855
855
|
// src/platform/tui/app.tsx
|
|
856
|
-
import { Box as
|
|
856
|
+
import { Box as Box20 } from "ink";
|
|
857
857
|
|
|
858
858
|
// src/platform/tui/hooks/useAgent.ts
|
|
859
859
|
import { useState as useState2, useEffect as useEffect3, useCallback as useCallback2, useRef as useRef3 } from "react";
|
|
@@ -14327,16 +14327,16 @@ function extractHypothesizedReason(failureLine) {
|
|
|
14327
14327
|
}
|
|
14328
14328
|
|
|
14329
14329
|
// src/shared/utils/context-digest/formatters.ts
|
|
14330
|
-
function formatContextForLLM(
|
|
14330
|
+
function formatContextForLLM(memo14) {
|
|
14331
14331
|
const compact = {};
|
|
14332
|
-
if (
|
|
14333
|
-
if (
|
|
14334
|
-
if (
|
|
14335
|
-
if (
|
|
14336
|
-
if (
|
|
14337
|
-
if (
|
|
14338
|
-
compact.attackValue =
|
|
14339
|
-
if (
|
|
14332
|
+
if (memo14.keyFindings.length > 0) compact.findings = memo14.keyFindings;
|
|
14333
|
+
if (memo14.credentials.length > 0) compact.credentials = memo14.credentials;
|
|
14334
|
+
if (memo14.attackVectors.length > 0) compact.attackVectors = memo14.attackVectors;
|
|
14335
|
+
if (memo14.failures.length > 0) compact.failures = memo14.failures;
|
|
14336
|
+
if (memo14.suspicions.length > 0) compact.suspicions = memo14.suspicions;
|
|
14337
|
+
if (memo14.nextSteps.length > 0) compact.nextSteps = memo14.nextSteps;
|
|
14338
|
+
compact.attackValue = memo14.attackValue;
|
|
14339
|
+
if (memo14.reflection) compact.reflection = memo14.reflection;
|
|
14340
14340
|
return JSON.stringify(compact);
|
|
14341
14341
|
}
|
|
14342
14342
|
function formatAnalystDigest(digest, filePath, originalChars) {
|
|
@@ -14394,15 +14394,15 @@ async function digestToolOutput(output, toolName, toolInput, analystFn) {
|
|
|
14394
14394
|
try {
|
|
14395
14395
|
const context = `Tool: ${toolName}${toolInput ? ` | Input: ${toolInput}` : ""}`;
|
|
14396
14396
|
const rawAnalystResponse = await analystFn(preprocessed, context);
|
|
14397
|
-
const
|
|
14397
|
+
const memo14 = parseAnalystMemo(rawAnalystResponse);
|
|
14398
14398
|
const formatted = formatAnalystDigest(rawAnalystResponse, savedOutputPath, originalLength);
|
|
14399
|
-
const contextForLLM = formatContextForLLM(
|
|
14399
|
+
const contextForLLM = formatContextForLLM(memo14);
|
|
14400
14400
|
return {
|
|
14401
14401
|
digestedOutput: formatted,
|
|
14402
14402
|
contextForLLM,
|
|
14403
14403
|
fullOutputPath: savedOutputPath,
|
|
14404
14404
|
analystUsed: true,
|
|
14405
|
-
memo:
|
|
14405
|
+
memo: memo14,
|
|
14406
14406
|
originalLength,
|
|
14407
14407
|
digestedLength: formatted.length,
|
|
14408
14408
|
compressionRatio: formatted.length / originalLength
|
|
@@ -15401,7 +15401,7 @@ function buildSummaryFromEntries(entries) {
|
|
|
15401
15401
|
|
|
15402
15402
|
// src/shared/utils/journal/formatters/record.ts
|
|
15403
15403
|
function formatTurnRecord(input) {
|
|
15404
|
-
const { turn, timestamp, phase, tools, memo:
|
|
15404
|
+
const { turn, timestamp, phase, tools, memo: memo14, reflection } = input;
|
|
15405
15405
|
const time = timestamp.slice(0, 19).replace("T", " ");
|
|
15406
15406
|
const sections = [];
|
|
15407
15407
|
sections.push(`# Turn ${turn} | ${time} | Phase: ${phase}`);
|
|
@@ -15418,25 +15418,25 @@ function formatTurnRecord(input) {
|
|
|
15418
15418
|
}
|
|
15419
15419
|
sections.push("");
|
|
15420
15420
|
sections.push(`## ${TURN_SECTIONS.KEY_INSIGHTS}`);
|
|
15421
|
-
if (
|
|
15422
|
-
for (const f of
|
|
15421
|
+
if (memo14.keyFindings.length > 0) {
|
|
15422
|
+
for (const f of memo14.keyFindings) sections.push(`- ${INSIGHT_TAGS.DISCOVERED}: ${f}`);
|
|
15423
15423
|
}
|
|
15424
|
-
if (
|
|
15425
|
-
for (const c of
|
|
15424
|
+
if (memo14.credentials.length > 0) {
|
|
15425
|
+
for (const c of memo14.credentials) sections.push(`- ${INSIGHT_TAGS.CREDENTIAL}: ${c}`);
|
|
15426
15426
|
}
|
|
15427
|
-
if (
|
|
15428
|
-
for (const v of
|
|
15427
|
+
if (memo14.attackVectors.length > 0) {
|
|
15428
|
+
for (const v of memo14.attackVectors) sections.push(`- ${INSIGHT_TAGS.CONFIRMED}: ${v}`);
|
|
15429
15429
|
}
|
|
15430
|
-
if (
|
|
15431
|
-
for (const f of
|
|
15430
|
+
if (memo14.failures.length > 0) {
|
|
15431
|
+
for (const f of memo14.failures) sections.push(`- ${INSIGHT_TAGS.DEAD_END}: ${f}`);
|
|
15432
15432
|
}
|
|
15433
|
-
if (
|
|
15434
|
-
for (const s of
|
|
15433
|
+
if (memo14.suspicions.length > 0) {
|
|
15434
|
+
for (const s of memo14.suspicions) sections.push(`- ${INSIGHT_TAGS.SUSPICIOUS}: ${s}`);
|
|
15435
15435
|
}
|
|
15436
|
-
if (
|
|
15437
|
-
for (const n of
|
|
15436
|
+
if (memo14.nextSteps.length > 0) {
|
|
15437
|
+
for (const n of memo14.nextSteps) sections.push(`- ${INSIGHT_TAGS.NEXT}: ${n}`);
|
|
15438
15438
|
}
|
|
15439
|
-
if (
|
|
15439
|
+
if (memo14.keyFindings.length === 0 && memo14.failures.length === 0 && memo14.credentials.length === 0) {
|
|
15440
15440
|
sections.push(`- ${TURN_EMPTY_MESSAGES.NO_INSIGHTS}`);
|
|
15441
15441
|
}
|
|
15442
15442
|
sections.push("");
|
|
@@ -16095,18 +16095,18 @@ async function recordTurn(context) {
|
|
|
16095
16095
|
return turnCounter + 1;
|
|
16096
16096
|
}
|
|
16097
16097
|
function createJournalEntry(context) {
|
|
16098
|
-
const { turnCounter, phase, toolJournal, memo:
|
|
16098
|
+
const { turnCounter, phase, toolJournal, memo: memo14, reflections } = context;
|
|
16099
16099
|
return {
|
|
16100
16100
|
turn: turnCounter,
|
|
16101
16101
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
16102
16102
|
phase,
|
|
16103
16103
|
tools: toolJournal,
|
|
16104
|
-
memo:
|
|
16105
|
-
reflection: reflections.length > 0 ? reflections.join(" | ") :
|
|
16104
|
+
memo: memo14,
|
|
16105
|
+
reflection: reflections.length > 0 ? reflections.join(" | ") : memo14.nextSteps.join("; ")
|
|
16106
16106
|
};
|
|
16107
16107
|
}
|
|
16108
16108
|
async function createTurnArchive(turnCounter, ctx) {
|
|
16109
|
-
const { entry, journalTools, memo:
|
|
16109
|
+
const { entry, journalTools, memo: memo14, phase } = ctx;
|
|
16110
16110
|
try {
|
|
16111
16111
|
const turnDir = WORKSPACE.turnPath(turnCounter);
|
|
16112
16112
|
ensureDirExists(turnDir);
|
|
@@ -16116,23 +16116,23 @@ async function createTurnArchive(turnCounter, ctx) {
|
|
|
16116
16116
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
16117
16117
|
phase,
|
|
16118
16118
|
tools: journalTools,
|
|
16119
|
-
memo:
|
|
16119
|
+
memo: memo14,
|
|
16120
16120
|
reflection: entry.reflection
|
|
16121
16121
|
});
|
|
16122
16122
|
writeFileSync11(join17(turnDir, TURN_FILES.RECORD), turnContent, "utf-8");
|
|
16123
16123
|
writeFileSync11(join17(turnDir, TURN_FILES.STRUCTURED), JSON.stringify(entry, null, 2), "utf-8");
|
|
16124
|
-
writeAnalystFile(turnDir,
|
|
16124
|
+
writeAnalystFile(turnDir, memo14);
|
|
16125
16125
|
} catch {
|
|
16126
16126
|
}
|
|
16127
16127
|
}
|
|
16128
|
-
function writeAnalystFile(turnDir,
|
|
16128
|
+
function writeAnalystFile(turnDir, memo14) {
|
|
16129
16129
|
const sections = [
|
|
16130
|
-
{ title: "Key Findings", items:
|
|
16131
|
-
{ title: "Credentials", items:
|
|
16132
|
-
{ title: "Attack Vectors", items:
|
|
16133
|
-
{ title: "Failures", items:
|
|
16134
|
-
{ title: "Suspicious", items:
|
|
16135
|
-
{ title: "Next Steps", items:
|
|
16130
|
+
{ title: "Key Findings", items: memo14.keyFindings },
|
|
16131
|
+
{ title: "Credentials", items: memo14.credentials },
|
|
16132
|
+
{ title: "Attack Vectors", items: memo14.attackVectors },
|
|
16133
|
+
{ title: "Failures", items: memo14.failures },
|
|
16134
|
+
{ title: "Suspicious", items: memo14.suspicions },
|
|
16135
|
+
{ title: "Next Steps", items: memo14.nextSteps }
|
|
16136
16136
|
];
|
|
16137
16137
|
const memoLines = [];
|
|
16138
16138
|
for (const section of sections) {
|
|
@@ -16146,12 +16146,12 @@ function writeAnalystFile(turnDir, memo15) {
|
|
|
16146
16146
|
"\u2462Analyst",
|
|
16147
16147
|
"\u2192",
|
|
16148
16148
|
`archive/turn-${turnDir.split("/").pop()}/analyst.md`,
|
|
16149
|
-
`findings:${
|
|
16149
|
+
`findings:${memo14.keyFindings.length} creds:${memo14.credentials.length} vectors:${memo14.attackVectors.length} failures:${memo14.failures.length}`
|
|
16150
16150
|
);
|
|
16151
16151
|
}
|
|
16152
16152
|
}
|
|
16153
16153
|
async function regenerateSummary(turnCounter, summaryRegenerator, ctx) {
|
|
16154
|
-
const { entry, journalTools, memo:
|
|
16154
|
+
const { entry, journalTools, memo: memo14, phase } = ctx;
|
|
16155
16155
|
try {
|
|
16156
16156
|
const turnDir = WORKSPACE.turnPath(turnCounter);
|
|
16157
16157
|
const existingSummary = getPreviousSummary(turnCounter);
|
|
@@ -16160,7 +16160,7 @@ async function regenerateSummary(turnCounter, summaryRegenerator, ctx) {
|
|
|
16160
16160
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
16161
16161
|
phase,
|
|
16162
16162
|
tools: journalTools,
|
|
16163
|
-
memo:
|
|
16163
|
+
memo: memo14,
|
|
16164
16164
|
reflection: entry.reflection
|
|
16165
16165
|
});
|
|
16166
16166
|
const summaryResult = await summaryRegenerator.execute({ existingSummary, turnData });
|
|
@@ -16351,12 +16351,12 @@ var MainAgent = class extends CoreAgent {
|
|
|
16351
16351
|
/**
|
|
16352
16352
|
* Records the turn data to Disk.
|
|
16353
16353
|
*/
|
|
16354
|
-
async recordTurnData(toolJournal,
|
|
16354
|
+
async recordTurnData(toolJournal, memo14) {
|
|
16355
16355
|
return await recordTurn({
|
|
16356
16356
|
turnCounter: this.turnCounter,
|
|
16357
16357
|
phase: this.state.getPhase(),
|
|
16358
16358
|
toolJournal,
|
|
16359
|
-
memo:
|
|
16359
|
+
memo: memo14,
|
|
16360
16360
|
reflections: [],
|
|
16361
16361
|
summaryRegenerator: this.summaryRegenerator
|
|
16362
16362
|
});
|
|
@@ -16526,8 +16526,6 @@ var useAgentState = (isTyping = false) => {
|
|
|
16526
16526
|
const [inputRequest, setInputRequest] = useState({ status: "inactive" });
|
|
16527
16527
|
const [stats, setStats] = useState({ phase: DEFAULTS.INIT_PHASE, targets: 0, findings: 0, todo: 0 });
|
|
16528
16528
|
const [turnCount, setTurnCount] = useState(0);
|
|
16529
|
-
const [liveReasoning, setLiveReasoning] = useState("");
|
|
16530
|
-
const [isReasoning, setIsReasoning] = useState(false);
|
|
16531
16529
|
const startTimeRef = useRef(0);
|
|
16532
16530
|
const timerRef = useRef(null);
|
|
16533
16531
|
const retryCountdownRef = useRef(null);
|
|
@@ -16604,10 +16602,6 @@ var useAgentState = (isTyping = false) => {
|
|
|
16604
16602
|
setStats,
|
|
16605
16603
|
turnCount,
|
|
16606
16604
|
setTurnCount,
|
|
16607
|
-
liveReasoning,
|
|
16608
|
-
setLiveReasoning,
|
|
16609
|
-
isReasoning,
|
|
16610
|
-
setIsReasoning,
|
|
16611
16605
|
// Refs (external consumers only)
|
|
16612
16606
|
retryCountdownRef,
|
|
16613
16607
|
retryCountRef,
|
|
@@ -16872,17 +16866,14 @@ function createLifecycleHandlers(agent, state, _reasoningBufferRef, isTyping = f
|
|
|
16872
16866
|
|
|
16873
16867
|
// src/platform/tui/hooks/useAgentEvents/handlers/reasoning.ts
|
|
16874
16868
|
function createReasoningHandlers(state, reasoningBufferRef, isTyping = false) {
|
|
16875
|
-
const { addMessage, setCurrentStatus
|
|
16869
|
+
const { addMessage, setCurrentStatus } = state;
|
|
16876
16870
|
const onStart = () => {
|
|
16877
16871
|
reasoningBufferRef.current = "";
|
|
16878
|
-
setLiveReasoning("");
|
|
16879
|
-
setIsReasoning(true);
|
|
16880
16872
|
setCurrentStatus("Reasoning\u2026");
|
|
16881
16873
|
};
|
|
16882
16874
|
const onDelta = (e) => {
|
|
16883
16875
|
reasoningBufferRef.current += e.data.content;
|
|
16884
16876
|
if (isTyping) return;
|
|
16885
|
-
setLiveReasoning(reasoningBufferRef.current);
|
|
16886
16877
|
const chars = reasoningBufferRef.current.length;
|
|
16887
16878
|
const estTokens = Math.round(chars / LLM_LIMITS.charsPerTokenEstimate);
|
|
16888
16879
|
const firstLine = reasoningBufferRef.current.split("\n")[0]?.slice(0, TUI_DISPLAY_LIMITS.reasoningPreviewChars) || "";
|
|
@@ -16892,8 +16883,6 @@ ${firstLine}`);
|
|
|
16892
16883
|
const onEnd = () => {
|
|
16893
16884
|
const text = reasoningBufferRef.current.trim();
|
|
16894
16885
|
reasoningBufferRef.current = "";
|
|
16895
|
-
setIsReasoning(false);
|
|
16896
|
-
setLiveReasoning("");
|
|
16897
16886
|
setCurrentStatus("");
|
|
16898
16887
|
if (text) {
|
|
16899
16888
|
addMessage("thinking", text);
|
|
@@ -16987,9 +16976,7 @@ var useAgentEvents = (agent, eventsRef, state, isTyping = false) => {
|
|
|
16987
16976
|
retryCountRef,
|
|
16988
16977
|
tokenAccumRef,
|
|
16989
16978
|
lastStepTokensRef,
|
|
16990
|
-
setCurrentTokens
|
|
16991
|
-
setLiveReasoning,
|
|
16992
|
-
setIsReasoning
|
|
16979
|
+
setCurrentTokens
|
|
16993
16980
|
} = state;
|
|
16994
16981
|
const reasoningBufferRef = useRef2("");
|
|
16995
16982
|
useEffect2(() => {
|
|
@@ -17007,7 +16994,7 @@ var useAgentEvents = (agent, eventsRef, state, isTyping = false) => {
|
|
|
17007
16994
|
lastStepTokensRef
|
|
17008
16995
|
}, reasoningBufferRef, isTyping);
|
|
17009
16996
|
const reasoningHandlers = createReasoningHandlers(
|
|
17010
|
-
{ addMessage, setCurrentStatus
|
|
16997
|
+
{ addMessage, setCurrentStatus },
|
|
17011
16998
|
reasoningBufferRef,
|
|
17012
16999
|
isTyping
|
|
17013
17000
|
);
|
|
@@ -17062,8 +17049,6 @@ var useAgentEvents = (agent, eventsRef, state, isTyping = false) => {
|
|
|
17062
17049
|
clearAllTimers,
|
|
17063
17050
|
toolStartedAtRef,
|
|
17064
17051
|
eventsRef,
|
|
17065
|
-
setLiveReasoning,
|
|
17066
|
-
setIsReasoning,
|
|
17067
17052
|
isTyping
|
|
17068
17053
|
]);
|
|
17069
17054
|
};
|
|
@@ -17092,9 +17077,7 @@ var useAgent = (shouldAutoApprove, target, isTyping = false) => {
|
|
|
17092
17077
|
manageTimer,
|
|
17093
17078
|
resetCumulativeCounters,
|
|
17094
17079
|
turnCount,
|
|
17095
|
-
setTurnCount
|
|
17096
|
-
liveReasoning,
|
|
17097
|
-
isReasoning
|
|
17080
|
+
setTurnCount
|
|
17098
17081
|
} = state;
|
|
17099
17082
|
useEffect3(() => {
|
|
17100
17083
|
if (target) {
|
|
@@ -17191,9 +17174,7 @@ var useAgent = (shouldAutoApprove, target, isTyping = false) => {
|
|
|
17191
17174
|
abort,
|
|
17192
17175
|
cancelInputRequest,
|
|
17193
17176
|
addMessage,
|
|
17194
|
-
refreshStats
|
|
17195
|
-
liveReasoning,
|
|
17196
|
-
isReasoning
|
|
17177
|
+
refreshStats
|
|
17197
17178
|
};
|
|
17198
17179
|
};
|
|
17199
17180
|
|
|
@@ -17916,9 +17897,7 @@ var useAppLogic = ({ autoApprove = false, target }) => {
|
|
|
17916
17897
|
abort,
|
|
17917
17898
|
cancelInputRequest,
|
|
17918
17899
|
addMessage,
|
|
17919
|
-
refreshStats
|
|
17920
|
-
liveReasoning,
|
|
17921
|
-
isReasoning
|
|
17900
|
+
refreshStats
|
|
17922
17901
|
} = useAgent(autoApproveMode, target, isTyping);
|
|
17923
17902
|
const isProcessingRef = useRef5(isProcessing);
|
|
17924
17903
|
isProcessingRef.current = isProcessing;
|
|
@@ -18029,9 +18008,7 @@ var useAppLogic = ({ autoApprove = false, target }) => {
|
|
|
18029
18008
|
currentTokens,
|
|
18030
18009
|
inputRequest,
|
|
18031
18010
|
stats,
|
|
18032
|
-
turnCount
|
|
18033
|
-
liveReasoning,
|
|
18034
|
-
isReasoning
|
|
18011
|
+
turnCount
|
|
18035
18012
|
};
|
|
18036
18013
|
};
|
|
18037
18014
|
|
|
@@ -18053,8 +18030,8 @@ var AnimationProvider = ({ children }) => {
|
|
|
18053
18030
|
var useAnimationTick = () => useContext(AnimationContext);
|
|
18054
18031
|
|
|
18055
18032
|
// src/platform/tui/components/MessageList.tsx
|
|
18056
|
-
import { memo as
|
|
18057
|
-
import { Box as
|
|
18033
|
+
import { memo as memo7 } from "react";
|
|
18034
|
+
import { Box as Box8, Static } from "ink";
|
|
18058
18035
|
|
|
18059
18036
|
// src/platform/tui/components/messages/ThinkingBlock.tsx
|
|
18060
18037
|
import { memo } from "react";
|
|
@@ -18077,38 +18054,13 @@ var ThinkingBlock = memo(({ msg }) => {
|
|
|
18077
18054
|
] });
|
|
18078
18055
|
});
|
|
18079
18056
|
|
|
18080
|
-
// src/platform/tui/components/messages/LiveReasoningPanel.tsx
|
|
18081
|
-
import { memo as memo2 } from "react";
|
|
18082
|
-
import { Box as Box2, Text as Text2 } from "ink";
|
|
18083
|
-
import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
18084
|
-
var LiveReasoningPanel = memo2(({ content, isReasoning }) => {
|
|
18085
|
-
if (!isReasoning) return null;
|
|
18086
|
-
const lines = content.split("\n");
|
|
18087
|
-
const estTokens = Math.round(content.length / LLM_LIMITS.charsPerTokenEstimate);
|
|
18088
|
-
return /* @__PURE__ */ jsxs2(Box2, { flexDirection: "column", marginY: 0, children: [
|
|
18089
|
-
/* @__PURE__ */ jsxs2(Box2, { children: [
|
|
18090
|
-
/* @__PURE__ */ jsx3(Text2, { color: THEME.yellow, children: "\u27F3 " }),
|
|
18091
|
-
/* @__PURE__ */ jsx3(Text2, { color: THEME.yellow, bold: true, children: "Reasoning" }),
|
|
18092
|
-
/* @__PURE__ */ jsx3(Text2, { color: THEME.dimGray, children: ` ~${estTokens} tok ${lines.length} lines streaming\u2026` })
|
|
18093
|
-
] }),
|
|
18094
|
-
lines.map((line, i) => /* @__PURE__ */ jsxs2(Box2, { children: [
|
|
18095
|
-
/* @__PURE__ */ jsx3(Text2, { color: THEME.dimGray, children: "\u2502 " }),
|
|
18096
|
-
/* @__PURE__ */ jsx3(Text2, { color: THEME.gray, wrap: "truncate", children: line || " " })
|
|
18097
|
-
] }, i)),
|
|
18098
|
-
/* @__PURE__ */ jsxs2(Box2, { children: [
|
|
18099
|
-
/* @__PURE__ */ jsx3(Text2, { color: THEME.dimGray, children: "\u2502 " }),
|
|
18100
|
-
/* @__PURE__ */ jsx3(Text2, { color: THEME.yellow, children: "\u258C" })
|
|
18101
|
-
] })
|
|
18102
|
-
] });
|
|
18103
|
-
});
|
|
18104
|
-
|
|
18105
18057
|
// src/platform/tui/components/messages/MessageRow.tsx
|
|
18106
|
-
import { memo as
|
|
18107
|
-
import { Box as
|
|
18058
|
+
import { memo as memo4 } from "react";
|
|
18059
|
+
import { Box as Box5, Text as Text5 } from "ink";
|
|
18108
18060
|
|
|
18109
18061
|
// src/platform/tui/components/inline-status.tsx
|
|
18110
|
-
import { Box as
|
|
18111
|
-
import { Fragment, jsx as
|
|
18062
|
+
import { Box as Box2, Text as Text2 } from "ink";
|
|
18063
|
+
import { Fragment, jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
18112
18064
|
function formatDuration3(ms) {
|
|
18113
18065
|
const seconds = Math.floor(ms / 1e3);
|
|
18114
18066
|
if (seconds < 60) return `${seconds}s`;
|
|
@@ -18134,18 +18086,18 @@ function getRoleColor(role) {
|
|
|
18134
18086
|
}
|
|
18135
18087
|
function StatusIndicator({ isRunning, exitCode }) {
|
|
18136
18088
|
if (isRunning) {
|
|
18137
|
-
return /* @__PURE__ */
|
|
18089
|
+
return /* @__PURE__ */ jsxs2(Text2, { color: THEME.primary, children: [
|
|
18138
18090
|
ICONS.running,
|
|
18139
18091
|
" "
|
|
18140
18092
|
] });
|
|
18141
18093
|
}
|
|
18142
18094
|
if (exitCode === 0) {
|
|
18143
|
-
return /* @__PURE__ */
|
|
18095
|
+
return /* @__PURE__ */ jsxs2(Text2, { color: THEME.gray, children: [
|
|
18144
18096
|
ICONS.success,
|
|
18145
18097
|
" "
|
|
18146
18098
|
] });
|
|
18147
18099
|
}
|
|
18148
|
-
return /* @__PURE__ */
|
|
18100
|
+
return /* @__PURE__ */ jsxs2(Text2, { color: THEME.red, children: [
|
|
18149
18101
|
ICONS.error,
|
|
18150
18102
|
" "
|
|
18151
18103
|
] });
|
|
@@ -18155,26 +18107,26 @@ function ProcessRow({ proc, isCompact }) {
|
|
|
18155
18107
|
const port = proc.listeningPort ? `:${proc.listeningPort}` : "";
|
|
18156
18108
|
const purpose = proc.purpose || proc.description || "";
|
|
18157
18109
|
const truncatedPurpose = isCompact && purpose.length > TUI_DISPLAY_LIMITS.purposeMaxLength ? purpose.slice(0, TUI_DISPLAY_LIMITS.purposeTruncated) + "..." : purpose;
|
|
18158
|
-
return /* @__PURE__ */
|
|
18159
|
-
/* @__PURE__ */
|
|
18160
|
-
/* @__PURE__ */
|
|
18110
|
+
return /* @__PURE__ */ jsxs2(Box2, { children: [
|
|
18111
|
+
/* @__PURE__ */ jsx3(StatusIndicator, { isRunning: proc.isRunning, exitCode: proc.exitCode }),
|
|
18112
|
+
/* @__PURE__ */ jsxs2(Text2, { color: THEME.gray, children: [
|
|
18161
18113
|
"[",
|
|
18162
18114
|
proc.id,
|
|
18163
18115
|
"]"
|
|
18164
18116
|
] }),
|
|
18165
|
-
/* @__PURE__ */
|
|
18166
|
-
/* @__PURE__ */
|
|
18117
|
+
/* @__PURE__ */ jsx3(Text2, { children: " " }),
|
|
18118
|
+
/* @__PURE__ */ jsxs2(Text2, { color: getRoleColor(proc.role), bold: true, children: [
|
|
18167
18119
|
proc.role,
|
|
18168
18120
|
port
|
|
18169
18121
|
] }),
|
|
18170
|
-
/* @__PURE__ */
|
|
18122
|
+
/* @__PURE__ */ jsxs2(Text2, { color: THEME.gray, children: [
|
|
18171
18123
|
" (",
|
|
18172
18124
|
duration,
|
|
18173
18125
|
")"
|
|
18174
18126
|
] }),
|
|
18175
|
-
truncatedPurpose && /* @__PURE__ */
|
|
18176
|
-
/* @__PURE__ */
|
|
18177
|
-
/* @__PURE__ */
|
|
18127
|
+
truncatedPurpose && /* @__PURE__ */ jsxs2(Fragment, { children: [
|
|
18128
|
+
/* @__PURE__ */ jsx3(Text2, { color: THEME.gray, children: " - " }),
|
|
18129
|
+
/* @__PURE__ */ jsx3(Text2, { color: THEME.gray, children: truncatedPurpose })
|
|
18178
18130
|
] })
|
|
18179
18131
|
] });
|
|
18180
18132
|
}
|
|
@@ -18185,7 +18137,7 @@ var InlineStatus = ({
|
|
|
18185
18137
|
isCompact = true
|
|
18186
18138
|
}) => {
|
|
18187
18139
|
if (processes.length === 0 && zombies.length === 0) {
|
|
18188
|
-
return /* @__PURE__ */
|
|
18140
|
+
return /* @__PURE__ */ jsx3(Box2, { flexDirection: "column", marginBottom: 1, children: /* @__PURE__ */ jsx3(Text2, { color: THEME.gray, children: "\u2022 No active background processes" }) });
|
|
18189
18141
|
}
|
|
18190
18142
|
const running = processes.filter((p) => p.isRunning);
|
|
18191
18143
|
const stopped = processes.filter((p) => !p.isRunning);
|
|
@@ -18194,66 +18146,66 @@ var InlineStatus = ({
|
|
|
18194
18146
|
warning: THEME.yellow,
|
|
18195
18147
|
critical: THEME.red
|
|
18196
18148
|
}[health];
|
|
18197
|
-
return /* @__PURE__ */
|
|
18198
|
-
running.length > 0 && /* @__PURE__ */
|
|
18199
|
-
/* @__PURE__ */
|
|
18149
|
+
return /* @__PURE__ */ jsxs2(Box2, { flexDirection: "column", marginBottom: 1, children: [
|
|
18150
|
+
running.length > 0 && /* @__PURE__ */ jsxs2(Box2, { flexDirection: "column", children: [
|
|
18151
|
+
/* @__PURE__ */ jsxs2(Text2, { color: THEME.gray, bold: true, children: [
|
|
18200
18152
|
ICONS.running,
|
|
18201
18153
|
" Active (",
|
|
18202
18154
|
running.length,
|
|
18203
18155
|
")"
|
|
18204
18156
|
] }),
|
|
18205
|
-
running.map((proc) => /* @__PURE__ */
|
|
18157
|
+
running.map((proc) => /* @__PURE__ */ jsx3(ProcessRow, { proc, isCompact }, proc.id))
|
|
18206
18158
|
] }),
|
|
18207
|
-
stopped.length > 0 && !isCompact && /* @__PURE__ */
|
|
18208
|
-
/* @__PURE__ */
|
|
18159
|
+
stopped.length > 0 && !isCompact && /* @__PURE__ */ jsxs2(Box2, { flexDirection: "column", marginTop: running.length > 0 ? 1 : 0, children: [
|
|
18160
|
+
/* @__PURE__ */ jsxs2(Text2, { color: THEME.gray, children: [
|
|
18209
18161
|
ICONS.completed,
|
|
18210
18162
|
" Completed (",
|
|
18211
18163
|
stopped.length,
|
|
18212
18164
|
")"
|
|
18213
18165
|
] }),
|
|
18214
|
-
stopped.slice(0, TUI_DISPLAY_LIMITS.maxStoppedProcesses).map((proc) => /* @__PURE__ */
|
|
18215
|
-
stopped.length > TUI_DISPLAY_LIMITS.maxStoppedProcesses && /* @__PURE__ */
|
|
18166
|
+
stopped.slice(0, TUI_DISPLAY_LIMITS.maxStoppedProcesses).map((proc) => /* @__PURE__ */ jsx3(ProcessRow, { proc, isCompact }, proc.id)),
|
|
18167
|
+
stopped.length > TUI_DISPLAY_LIMITS.maxStoppedProcesses && /* @__PURE__ */ jsxs2(Text2, { color: THEME.gray, children: [
|
|
18216
18168
|
" ... and ",
|
|
18217
18169
|
stopped.length - TUI_DISPLAY_LIMITS.maxStoppedProcesses,
|
|
18218
18170
|
" more"
|
|
18219
18171
|
] })
|
|
18220
18172
|
] }),
|
|
18221
|
-
zombies.length > 0 && /* @__PURE__ */
|
|
18222
|
-
/* @__PURE__ */
|
|
18173
|
+
zombies.length > 0 && /* @__PURE__ */ jsxs2(Box2, { flexDirection: "column", marginTop: 1, children: [
|
|
18174
|
+
/* @__PURE__ */ jsxs2(Text2, { color: THEME.yellow, children: [
|
|
18223
18175
|
ICONS.warning,
|
|
18224
18176
|
" Zombie Processes (",
|
|
18225
18177
|
zombies.length,
|
|
18226
18178
|
")"
|
|
18227
18179
|
] }),
|
|
18228
|
-
zombies.map((z) => /* @__PURE__ */
|
|
18229
|
-
/* @__PURE__ */
|
|
18180
|
+
zombies.map((z) => /* @__PURE__ */ jsxs2(Box2, { children: [
|
|
18181
|
+
/* @__PURE__ */ jsxs2(Text2, { color: THEME.red, children: [
|
|
18230
18182
|
" ",
|
|
18231
18183
|
ICONS.error,
|
|
18232
18184
|
" "
|
|
18233
18185
|
] }),
|
|
18234
|
-
/* @__PURE__ */
|
|
18186
|
+
/* @__PURE__ */ jsxs2(Text2, { color: THEME.gray, children: [
|
|
18235
18187
|
"[",
|
|
18236
18188
|
z.processId,
|
|
18237
18189
|
"] "
|
|
18238
18190
|
] }),
|
|
18239
|
-
/* @__PURE__ */
|
|
18191
|
+
/* @__PURE__ */ jsxs2(Text2, { color: THEME.yellow, children: [
|
|
18240
18192
|
z.orphanedChildren.length,
|
|
18241
18193
|
" orphaned children"
|
|
18242
18194
|
] })
|
|
18243
18195
|
] }, z.processId)),
|
|
18244
|
-
/* @__PURE__ */
|
|
18196
|
+
/* @__PURE__ */ jsx3(Text2, { color: THEME.gray, children: " Run /cleanup to terminate" })
|
|
18245
18197
|
] }),
|
|
18246
|
-
/* @__PURE__ */
|
|
18247
|
-
/* @__PURE__ */
|
|
18248
|
-
/* @__PURE__ */
|
|
18198
|
+
/* @__PURE__ */ jsxs2(Box2, { marginTop: running.length > 0 ? 1 : 0, children: [
|
|
18199
|
+
/* @__PURE__ */ jsx3(Text2, { color: THEME.gray, children: "Health: " }),
|
|
18200
|
+
/* @__PURE__ */ jsx3(Text2, { color: healthColor, bold: true, children: health.toUpperCase() })
|
|
18249
18201
|
] })
|
|
18250
18202
|
] });
|
|
18251
18203
|
};
|
|
18252
18204
|
|
|
18253
18205
|
// src/platform/tui/components/ToolCard.tsx
|
|
18254
|
-
import { memo as
|
|
18255
|
-
import { Box as
|
|
18256
|
-
import { Fragment as Fragment2, jsx as
|
|
18206
|
+
import { memo as memo2 } from "react";
|
|
18207
|
+
import { Box as Box3, Text as Text3 } from "ink";
|
|
18208
|
+
import { Fragment as Fragment2, jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
18257
18209
|
var ARGS_MAX = 72;
|
|
18258
18210
|
function truncate(s, max) {
|
|
18259
18211
|
return s.length > max ? s.slice(0, max - 1) + "\u2026" : s;
|
|
@@ -18295,22 +18247,22 @@ function parseToolContent(content) {
|
|
|
18295
18247
|
}
|
|
18296
18248
|
return { name: content.trim(), args: "" };
|
|
18297
18249
|
}
|
|
18298
|
-
var ToolCard =
|
|
18250
|
+
var ToolCard = memo2(({ content }) => {
|
|
18299
18251
|
const { name, args } = parseToolContent(content);
|
|
18300
|
-
return /* @__PURE__ */
|
|
18301
|
-
/* @__PURE__ */
|
|
18302
|
-
args && /* @__PURE__ */
|
|
18303
|
-
/* @__PURE__ */
|
|
18304
|
-
/* @__PURE__ */
|
|
18305
|
-
/* @__PURE__ */
|
|
18252
|
+
return /* @__PURE__ */ jsxs3(Box3, { children: [
|
|
18253
|
+
/* @__PURE__ */ jsx4(Text3, { color: THEME.white, bold: true, children: name }),
|
|
18254
|
+
args && /* @__PURE__ */ jsxs3(Fragment2, { children: [
|
|
18255
|
+
/* @__PURE__ */ jsx4(Text3, { color: THEME.dimGray, children: "(" }),
|
|
18256
|
+
/* @__PURE__ */ jsx4(Text3, { color: THEME.gray, children: args }),
|
|
18257
|
+
/* @__PURE__ */ jsx4(Text3, { color: THEME.dimGray, children: ")" })
|
|
18306
18258
|
] })
|
|
18307
18259
|
] });
|
|
18308
18260
|
});
|
|
18309
18261
|
|
|
18310
18262
|
// src/platform/tui/components/MarkdownText.tsx
|
|
18311
|
-
import { memo as
|
|
18312
|
-
import { Box as
|
|
18313
|
-
import { Fragment as Fragment3, jsx as
|
|
18263
|
+
import { memo as memo3 } from "react";
|
|
18264
|
+
import { Box as Box4, Text as Text4 } from "ink";
|
|
18265
|
+
import { Fragment as Fragment3, jsx as jsx5, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
18314
18266
|
function tokenizeLine(line) {
|
|
18315
18267
|
const tokens = [];
|
|
18316
18268
|
let i = 0;
|
|
@@ -18334,14 +18286,14 @@ function tokenizeLine(line) {
|
|
|
18334
18286
|
}
|
|
18335
18287
|
return tokens;
|
|
18336
18288
|
}
|
|
18337
|
-
var InlineContent = ({ tokens }) => /* @__PURE__ */
|
|
18289
|
+
var InlineContent = ({ tokens }) => /* @__PURE__ */ jsx5(Fragment3, { children: tokens.map((tok, i) => {
|
|
18338
18290
|
if (tok.type === "bold") {
|
|
18339
|
-
return /* @__PURE__ */
|
|
18291
|
+
return /* @__PURE__ */ jsx5(Text4, { bold: true, color: THEME.white, children: tok.value }, i);
|
|
18340
18292
|
}
|
|
18341
18293
|
if (tok.type === "code") {
|
|
18342
|
-
return /* @__PURE__ */
|
|
18294
|
+
return /* @__PURE__ */ jsx5(Text4, { color: THEME.cyan, children: `\`${tok.value}\`` }, i);
|
|
18343
18295
|
}
|
|
18344
|
-
return /* @__PURE__ */
|
|
18296
|
+
return /* @__PURE__ */ jsx5(Text4, { color: THEME.white, children: tok.value }, i);
|
|
18345
18297
|
}) });
|
|
18346
18298
|
function parseBlocks(lines) {
|
|
18347
18299
|
const blocks = [];
|
|
@@ -18391,29 +18343,29 @@ function parseBlocks(lines) {
|
|
|
18391
18343
|
}
|
|
18392
18344
|
var BlockRenderer = ({ block, blockIdx }) => {
|
|
18393
18345
|
if (block.type === "blank") {
|
|
18394
|
-
return /* @__PURE__ */
|
|
18346
|
+
return /* @__PURE__ */ jsx5(Text4, { children: " " }, blockIdx);
|
|
18395
18347
|
}
|
|
18396
18348
|
if (block.type === "heading") {
|
|
18397
18349
|
const prefixes = { 1: "\u25B8 ", 2: " \u25B9 ", 3: " \xB7 " };
|
|
18398
18350
|
const colors = { 1: THEME.primary, 2: THEME.cyan, 3: THEME.white };
|
|
18399
|
-
return /* @__PURE__ */
|
|
18351
|
+
return /* @__PURE__ */ jsx5(Box4, { children: /* @__PURE__ */ jsxs4(Text4, { color: colors[block.level], bold: true, children: [
|
|
18400
18352
|
prefixes[block.level],
|
|
18401
18353
|
block.content
|
|
18402
18354
|
] }) }, blockIdx);
|
|
18403
18355
|
}
|
|
18404
18356
|
if (block.type === "listItem") {
|
|
18405
18357
|
const bullet = block.ordered ? `${block.index}.` : "\u2022";
|
|
18406
|
-
return /* @__PURE__ */
|
|
18407
|
-
/* @__PURE__ */
|
|
18358
|
+
return /* @__PURE__ */ jsxs4(Box4, { paddingLeft: 1, children: [
|
|
18359
|
+
/* @__PURE__ */ jsxs4(Text4, { color: THEME.dimGray, children: [
|
|
18408
18360
|
bullet,
|
|
18409
18361
|
" "
|
|
18410
18362
|
] }),
|
|
18411
|
-
/* @__PURE__ */
|
|
18363
|
+
/* @__PURE__ */ jsx5(InlineContent, { tokens: tokenizeLine(block.content) })
|
|
18412
18364
|
] }, blockIdx);
|
|
18413
18365
|
}
|
|
18414
18366
|
if (block.type === "codeBlock") {
|
|
18415
|
-
return /* @__PURE__ */
|
|
18416
|
-
|
|
18367
|
+
return /* @__PURE__ */ jsxs4(
|
|
18368
|
+
Box4,
|
|
18417
18369
|
{
|
|
18418
18370
|
flexDirection: "column",
|
|
18419
18371
|
borderStyle: "single",
|
|
@@ -18421,19 +18373,19 @@ var BlockRenderer = ({ block, blockIdx }) => {
|
|
|
18421
18373
|
paddingX: 1,
|
|
18422
18374
|
marginY: 0,
|
|
18423
18375
|
children: [
|
|
18424
|
-
block.lang && /* @__PURE__ */
|
|
18425
|
-
block.lines.map((l, li) => /* @__PURE__ */
|
|
18376
|
+
block.lang && /* @__PURE__ */ jsx5(Text4, { color: THEME.dimGray, children: block.lang }),
|
|
18377
|
+
block.lines.map((l, li) => /* @__PURE__ */ jsx5(Text4, { color: THEME.cyan, children: l }, li))
|
|
18426
18378
|
]
|
|
18427
18379
|
},
|
|
18428
18380
|
blockIdx
|
|
18429
18381
|
);
|
|
18430
18382
|
}
|
|
18431
|
-
return /* @__PURE__ */
|
|
18383
|
+
return /* @__PURE__ */ jsx5(Box4, { children: /* @__PURE__ */ jsx5(InlineContent, { tokens: tokenizeLine(block.content) }) }, blockIdx);
|
|
18432
18384
|
};
|
|
18433
|
-
var MarkdownText =
|
|
18385
|
+
var MarkdownText = memo3(({ content }) => {
|
|
18434
18386
|
const lines = content.split("\n");
|
|
18435
18387
|
const blocks = parseBlocks(lines);
|
|
18436
|
-
return /* @__PURE__ */
|
|
18388
|
+
return /* @__PURE__ */ jsx5(Box4, { flexDirection: "column", children: blocks.map((block, i) => /* @__PURE__ */ jsx5(BlockRenderer, { block, blockIdx: i }, i)) });
|
|
18437
18389
|
});
|
|
18438
18390
|
|
|
18439
18391
|
// src/platform/tui/components/messages/parseStatusContent.ts
|
|
@@ -18480,7 +18432,7 @@ function computeResultDisplay(content) {
|
|
|
18480
18432
|
}
|
|
18481
18433
|
|
|
18482
18434
|
// src/platform/tui/components/messages/MessageRow.tsx
|
|
18483
|
-
import { jsx as
|
|
18435
|
+
import { jsx as jsx6, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
18484
18436
|
var RAIL_TOOL = " \u22A2 ";
|
|
18485
18437
|
var RAIL_RESULT = " \u2514 ";
|
|
18486
18438
|
var RAIL_INDENT = " ";
|
|
@@ -18493,11 +18445,11 @@ function resultColor(kind) {
|
|
|
18493
18445
|
if (kind === "warning") return THEME.yellow;
|
|
18494
18446
|
return THEME.gray;
|
|
18495
18447
|
}
|
|
18496
|
-
var MessageRow =
|
|
18448
|
+
var MessageRow = memo4(({ msg }) => {
|
|
18497
18449
|
if (msg.type === "status") {
|
|
18498
18450
|
const statusData = parseStatusContent(msg.content);
|
|
18499
18451
|
if (statusData) {
|
|
18500
|
-
return /* @__PURE__ */
|
|
18452
|
+
return /* @__PURE__ */ jsx6(Box5, { flexDirection: "column", children: /* @__PURE__ */ jsx6(
|
|
18501
18453
|
InlineStatus,
|
|
18502
18454
|
{
|
|
18503
18455
|
processes: statusData.processes,
|
|
@@ -18506,129 +18458,129 @@ var MessageRow = memo5(({ msg }) => {
|
|
|
18506
18458
|
}
|
|
18507
18459
|
) }, msg.id);
|
|
18508
18460
|
}
|
|
18509
|
-
return /* @__PURE__ */
|
|
18510
|
-
/* @__PURE__ */
|
|
18511
|
-
/* @__PURE__ */
|
|
18461
|
+
return /* @__PURE__ */ jsxs5(Box5, { children: [
|
|
18462
|
+
/* @__PURE__ */ jsx6(Text5, { dimColor: true, color: THEME.dimGray, children: RAIL_SYSTEM }),
|
|
18463
|
+
/* @__PURE__ */ jsx6(Text5, { dimColor: true, color: THEME.gray, children: msg.content })
|
|
18512
18464
|
] }, msg.id);
|
|
18513
18465
|
}
|
|
18514
18466
|
if (msg.type === "thinking") {
|
|
18515
|
-
return /* @__PURE__ */
|
|
18467
|
+
return /* @__PURE__ */ jsx6(ThinkingBlock, { msg });
|
|
18516
18468
|
}
|
|
18517
18469
|
if (msg.type === "tool") {
|
|
18518
|
-
return /* @__PURE__ */
|
|
18519
|
-
/* @__PURE__ */
|
|
18520
|
-
/* @__PURE__ */
|
|
18470
|
+
return /* @__PURE__ */ jsxs5(Box5, { children: [
|
|
18471
|
+
/* @__PURE__ */ jsx6(Text5, { color: THEME.primary, children: RAIL_TOOL }),
|
|
18472
|
+
/* @__PURE__ */ jsx6(ToolCard, { content: msg.content })
|
|
18521
18473
|
] }, msg.id);
|
|
18522
18474
|
}
|
|
18523
18475
|
if (msg.type === "result") {
|
|
18524
18476
|
const kind = classifyResult(msg.content);
|
|
18525
18477
|
const color = resultColor(kind);
|
|
18526
18478
|
const { firstLine, visibleRest, hasMore, hiddenCount } = computeResultDisplay(msg.content);
|
|
18527
|
-
return /* @__PURE__ */
|
|
18528
|
-
/* @__PURE__ */
|
|
18529
|
-
/* @__PURE__ */
|
|
18530
|
-
/* @__PURE__ */
|
|
18531
|
-
hasMore && /* @__PURE__ */
|
|
18479
|
+
return /* @__PURE__ */ jsxs5(Box5, { flexDirection: "column", children: [
|
|
18480
|
+
/* @__PURE__ */ jsxs5(Box5, { children: [
|
|
18481
|
+
/* @__PURE__ */ jsx6(Text5, { color: THEME.dimGray, children: RAIL_RESULT }),
|
|
18482
|
+
/* @__PURE__ */ jsx6(Text5, { color, children: firstLine }),
|
|
18483
|
+
hasMore && /* @__PURE__ */ jsx6(Text5, { dimColor: true, color: THEME.dimGray, children: ` [+${hiddenCount} more]` })
|
|
18532
18484
|
] }),
|
|
18533
|
-
visibleRest.map((line, i) => /* @__PURE__ */
|
|
18534
|
-
/* @__PURE__ */
|
|
18535
|
-
/* @__PURE__ */
|
|
18485
|
+
visibleRest.map((line, i) => /* @__PURE__ */ jsxs5(Box5, { children: [
|
|
18486
|
+
/* @__PURE__ */ jsx6(Text5, { color: THEME.dimGray, children: RAIL_INDENT }),
|
|
18487
|
+
/* @__PURE__ */ jsx6(Text5, { dimColor: true, color: THEME.gray, children: line })
|
|
18536
18488
|
] }, i))
|
|
18537
18489
|
] }, msg.id);
|
|
18538
18490
|
}
|
|
18539
18491
|
if (msg.type === "ai" || msg.type === "assistant") {
|
|
18540
|
-
return /* @__PURE__ */
|
|
18492
|
+
return /* @__PURE__ */ jsx6(Box5, { paddingLeft: 2, children: /* @__PURE__ */ jsx6(MarkdownText, { content: msg.content }) }, msg.id);
|
|
18541
18493
|
}
|
|
18542
18494
|
if (msg.type === "error") {
|
|
18543
18495
|
const lines = msg.content.split("\n");
|
|
18544
18496
|
const first = lines[0] || msg.content;
|
|
18545
18497
|
const hidden = lines.length - 1;
|
|
18546
|
-
return /* @__PURE__ */
|
|
18547
|
-
/* @__PURE__ */
|
|
18548
|
-
/* @__PURE__ */
|
|
18549
|
-
hidden > 0 && /* @__PURE__ */
|
|
18498
|
+
return /* @__PURE__ */ jsxs5(Box5, { children: [
|
|
18499
|
+
/* @__PURE__ */ jsx6(Text5, { color: THEME.red, children: RAIL_ERROR }),
|
|
18500
|
+
/* @__PURE__ */ jsx6(Text5, { color: THEME.red, children: first }),
|
|
18501
|
+
hidden > 0 && /* @__PURE__ */ jsx6(Text5, { dimColor: true, color: THEME.dimGray, children: ` [+${hidden}]` })
|
|
18550
18502
|
] }, msg.id);
|
|
18551
18503
|
}
|
|
18552
18504
|
if (msg.type === "user") {
|
|
18553
|
-
return /* @__PURE__ */
|
|
18554
|
-
/* @__PURE__ */
|
|
18555
|
-
/* @__PURE__ */
|
|
18505
|
+
return /* @__PURE__ */ jsxs5(Box5, { children: [
|
|
18506
|
+
/* @__PURE__ */ jsx6(Text5, { color: THEME.primary, children: RAIL_USER }),
|
|
18507
|
+
/* @__PURE__ */ jsx6(Text5, { color: THEME.white, bold: true, children: msg.content })
|
|
18556
18508
|
] }, msg.id);
|
|
18557
18509
|
}
|
|
18558
18510
|
if (msg.type === "system") {
|
|
18559
|
-
return /* @__PURE__ */
|
|
18560
|
-
/* @__PURE__ */
|
|
18561
|
-
/* @__PURE__ */
|
|
18511
|
+
return /* @__PURE__ */ jsxs5(Box5, { children: [
|
|
18512
|
+
/* @__PURE__ */ jsx6(Text5, { dimColor: true, color: THEME.dimGray, children: RAIL_SYSTEM }),
|
|
18513
|
+
/* @__PURE__ */ jsx6(Text5, { dimColor: true, color: THEME.gray, children: msg.content })
|
|
18562
18514
|
] }, msg.id);
|
|
18563
18515
|
}
|
|
18564
|
-
return /* @__PURE__ */
|
|
18565
|
-
/* @__PURE__ */
|
|
18566
|
-
/* @__PURE__ */
|
|
18516
|
+
return /* @__PURE__ */ jsxs5(Box5, { children: [
|
|
18517
|
+
/* @__PURE__ */ jsx6(Text5, { dimColor: true, color: THEME.dimGray, children: RAIL_SYSTEM }),
|
|
18518
|
+
/* @__PURE__ */ jsx6(Text5, { color: MESSAGE_STYLES.colors[msg.type] ?? THEME.gray, children: msg.content })
|
|
18567
18519
|
] }, msg.id);
|
|
18568
18520
|
});
|
|
18569
18521
|
|
|
18570
18522
|
// src/platform/tui/components/messages/BrandingHeader.tsx
|
|
18571
|
-
import { memo as memo7 } from "react";
|
|
18572
|
-
import { Box as Box8, Text as Text8 } from "ink";
|
|
18573
|
-
|
|
18574
|
-
// src/platform/tui/components/ShimmerBanner.tsx
|
|
18575
18523
|
import { memo as memo6 } from "react";
|
|
18576
18524
|
import { Box as Box7, Text as Text7 } from "ink";
|
|
18577
|
-
|
|
18578
|
-
|
|
18525
|
+
|
|
18526
|
+
// src/platform/tui/components/ShimmerBanner.tsx
|
|
18527
|
+
import { memo as memo5 } from "react";
|
|
18528
|
+
import { Box as Box6, Text as Text6 } from "ink";
|
|
18529
|
+
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
18530
|
+
var ShimmerBanner = memo5(({ banner }) => {
|
|
18579
18531
|
const lines = banner.split("\n").filter((l) => l.length > 0);
|
|
18580
|
-
return /* @__PURE__ */
|
|
18532
|
+
return /* @__PURE__ */ jsx7(Box6, { flexDirection: "column", children: lines.map((line, row) => /* @__PURE__ */ jsx7(Text6, { color: HEX.primary, children: line }, row)) });
|
|
18581
18533
|
});
|
|
18582
18534
|
|
|
18583
18535
|
// src/platform/tui/components/messages/BrandingHeader.tsx
|
|
18584
|
-
import { Fragment as Fragment4, jsx as
|
|
18585
|
-
var BrandingHeader =
|
|
18536
|
+
import { Fragment as Fragment4, jsx as jsx8, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
18537
|
+
var BrandingHeader = memo6(({ modelName, autoApproveMode, version, showGuide = false }) => {
|
|
18586
18538
|
const autoLabel = autoApproveMode ? "ON" : "OFF";
|
|
18587
18539
|
const autoColor = autoApproveMode ? THEME.primary : THEME.dimGray;
|
|
18588
|
-
return /* @__PURE__ */
|
|
18589
|
-
/* @__PURE__ */
|
|
18590
|
-
/* @__PURE__ */
|
|
18591
|
-
version && /* @__PURE__ */
|
|
18592
|
-
modelName && /* @__PURE__ */
|
|
18593
|
-
/* @__PURE__ */
|
|
18594
|
-
/* @__PURE__ */
|
|
18540
|
+
return /* @__PURE__ */ jsxs6(Box7, { flexDirection: "column", paddingBottom: 1, children: [
|
|
18541
|
+
/* @__PURE__ */ jsx8(ShimmerBanner, { banner: ASCII_BANNER }),
|
|
18542
|
+
/* @__PURE__ */ jsxs6(Box7, { gap: 1, paddingLeft: 1, children: [
|
|
18543
|
+
version && /* @__PURE__ */ jsx8(Text7, { color: THEME.dimGray, children: `v${version}` }),
|
|
18544
|
+
modelName && /* @__PURE__ */ jsxs6(Fragment4, { children: [
|
|
18545
|
+
/* @__PURE__ */ jsx8(Text7, { color: THEME.dimGray, children: "\xB7" }),
|
|
18546
|
+
/* @__PURE__ */ jsx8(Text7, { color: THEME.gray, children: modelName })
|
|
18595
18547
|
] }),
|
|
18596
|
-
/* @__PURE__ */
|
|
18597
|
-
/* @__PURE__ */
|
|
18598
|
-
/* @__PURE__ */
|
|
18548
|
+
/* @__PURE__ */ jsx8(Text7, { color: THEME.dimGray, children: "\xB7" }),
|
|
18549
|
+
/* @__PURE__ */ jsx8(Text7, { color: THEME.dimGray, children: "Auto:" }),
|
|
18550
|
+
/* @__PURE__ */ jsx8(Text7, { color: autoColor, bold: !!autoApproveMode, children: autoLabel })
|
|
18599
18551
|
] }),
|
|
18600
|
-
showGuide && /* @__PURE__ */
|
|
18601
|
-
/* @__PURE__ */
|
|
18602
|
-
/* @__PURE__ */
|
|
18603
|
-
/* @__PURE__ */
|
|
18604
|
-
/* @__PURE__ */
|
|
18605
|
-
/* @__PURE__ */
|
|
18606
|
-
/* @__PURE__ */
|
|
18552
|
+
showGuide && /* @__PURE__ */ jsxs6(Box7, { flexDirection: "column", paddingTop: 1, paddingLeft: 1, children: [
|
|
18553
|
+
/* @__PURE__ */ jsx8(Text7, { color: THEME.dimGray, children: "\u2500".repeat(40) }),
|
|
18554
|
+
/* @__PURE__ */ jsxs6(Box7, { flexDirection: "column", paddingTop: 0, children: [
|
|
18555
|
+
/* @__PURE__ */ jsxs6(Box7, { gap: 2, children: [
|
|
18556
|
+
/* @__PURE__ */ jsx8(Text7, { color: THEME.primary, children: "\u276F" }),
|
|
18557
|
+
/* @__PURE__ */ jsx8(Text7, { color: THEME.white, children: "/target <ip>" }),
|
|
18558
|
+
/* @__PURE__ */ jsx8(Text7, { color: THEME.dimGray, children: "Set a network target" })
|
|
18607
18559
|
] }),
|
|
18608
|
-
/* @__PURE__ */
|
|
18609
|
-
/* @__PURE__ */
|
|
18610
|
-
/* @__PURE__ */
|
|
18611
|
-
/* @__PURE__ */
|
|
18560
|
+
/* @__PURE__ */ jsxs6(Box7, { gap: 2, children: [
|
|
18561
|
+
/* @__PURE__ */ jsx8(Text7, { color: THEME.primary, children: "\u276F" }),
|
|
18562
|
+
/* @__PURE__ */ jsx8(Text7, { color: THEME.white, children: "/start" }),
|
|
18563
|
+
/* @__PURE__ */ jsx8(Text7, { color: THEME.dimGray, children: " Begin autonomous pentest" })
|
|
18612
18564
|
] }),
|
|
18613
|
-
/* @__PURE__ */
|
|
18614
|
-
/* @__PURE__ */
|
|
18615
|
-
/* @__PURE__ */
|
|
18616
|
-
/* @__PURE__ */
|
|
18565
|
+
/* @__PURE__ */ jsxs6(Box7, { gap: 2, children: [
|
|
18566
|
+
/* @__PURE__ */ jsx8(Text7, { color: THEME.primary, children: "\u276F" }),
|
|
18567
|
+
/* @__PURE__ */ jsx8(Text7, { color: THEME.white, children: "/help" }),
|
|
18568
|
+
/* @__PURE__ */ jsx8(Text7, { color: THEME.dimGray, children: " Show all commands" })
|
|
18617
18569
|
] }),
|
|
18618
|
-
/* @__PURE__ */
|
|
18570
|
+
/* @__PURE__ */ jsx8(Box7, { paddingTop: 1, children: /* @__PURE__ */ jsx8(Text7, { color: THEME.gray, children: 'Or type an objective (e.g. "Solve this python script").' }) })
|
|
18619
18571
|
] })
|
|
18620
18572
|
] })
|
|
18621
18573
|
] });
|
|
18622
18574
|
});
|
|
18623
18575
|
|
|
18624
18576
|
// src/platform/tui/components/MessageList.tsx
|
|
18625
|
-
import { jsx as
|
|
18577
|
+
import { jsx as jsx9 } from "react/jsx-runtime";
|
|
18626
18578
|
var HEADER_ITEM = { id: "__header__", type: "header" };
|
|
18627
|
-
var MessageList =
|
|
18579
|
+
var MessageList = memo7(({ messages, modelName, autoApproveMode, version }) => {
|
|
18628
18580
|
const staticItems = [HEADER_ITEM, ...messages];
|
|
18629
|
-
return /* @__PURE__ */
|
|
18581
|
+
return /* @__PURE__ */ jsx9(Box8, { flexDirection: "column", children: /* @__PURE__ */ jsx9(Static, { items: staticItems, children: (item) => {
|
|
18630
18582
|
if (item.type === "header") {
|
|
18631
|
-
return /* @__PURE__ */
|
|
18583
|
+
return /* @__PURE__ */ jsx9(
|
|
18632
18584
|
BrandingHeader,
|
|
18633
18585
|
{
|
|
18634
18586
|
modelName,
|
|
@@ -18639,13 +18591,13 @@ var MessageList = memo8(({ messages, modelName, autoApproveMode, version }) => {
|
|
|
18639
18591
|
"__header__"
|
|
18640
18592
|
);
|
|
18641
18593
|
}
|
|
18642
|
-
return /* @__PURE__ */
|
|
18594
|
+
return /* @__PURE__ */ jsx9(MessageRow, { msg: item }, item.id);
|
|
18643
18595
|
} }) });
|
|
18644
18596
|
});
|
|
18645
18597
|
|
|
18646
18598
|
// src/platform/tui/components/StatusDisplay.tsx
|
|
18647
|
-
import { memo as
|
|
18648
|
-
import { Box as
|
|
18599
|
+
import { memo as memo10 } from "react";
|
|
18600
|
+
import { Box as Box11, Text as Text12 } from "ink";
|
|
18649
18601
|
|
|
18650
18602
|
// src/platform/tui/hooks/useStatusTimer.ts
|
|
18651
18603
|
import { useState as useState5, useEffect as useEffect7, useRef as useRef6 } from "react";
|
|
@@ -18673,12 +18625,12 @@ var useStatusTimer = (currentStatus, isProcessing) => {
|
|
|
18673
18625
|
};
|
|
18674
18626
|
|
|
18675
18627
|
// src/platform/tui/components/status/RetryView.tsx
|
|
18676
|
-
import { Box as
|
|
18628
|
+
import { Box as Box9, Text as Text9 } from "ink";
|
|
18677
18629
|
|
|
18678
18630
|
// src/platform/tui/components/StarSpinner.tsx
|
|
18679
|
-
import { memo as
|
|
18680
|
-
import { Text as
|
|
18681
|
-
import { jsx as
|
|
18631
|
+
import { memo as memo8 } from "react";
|
|
18632
|
+
import { Text as Text8 } from "ink";
|
|
18633
|
+
import { jsx as jsx10 } from "react/jsx-runtime";
|
|
18682
18634
|
var FRAMES = [
|
|
18683
18635
|
"\xB7",
|
|
18684
18636
|
"\u2726",
|
|
@@ -18695,34 +18647,34 @@ var FRAMES = [
|
|
|
18695
18647
|
"\u2727",
|
|
18696
18648
|
"\u2726"
|
|
18697
18649
|
];
|
|
18698
|
-
var StarSpinner =
|
|
18650
|
+
var StarSpinner = memo8(({ color }) => {
|
|
18699
18651
|
const tick = useAnimationTick();
|
|
18700
18652
|
const index = tick % FRAMES.length;
|
|
18701
|
-
return /* @__PURE__ */
|
|
18653
|
+
return /* @__PURE__ */ jsx10(Text8, { color: color || "yellow", children: FRAMES[index] });
|
|
18702
18654
|
});
|
|
18703
18655
|
|
|
18704
18656
|
// src/platform/tui/components/status/RetryView.tsx
|
|
18705
|
-
import { jsx as
|
|
18657
|
+
import { jsx as jsx11, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
18706
18658
|
var RetryView = ({ retryState }) => {
|
|
18707
18659
|
const truncateError = (err) => {
|
|
18708
18660
|
return err.length > DISPLAY_LIMITS.RETRY_ERROR_PREVIEW ? err.substring(0, DISPLAY_LIMITS.RETRY_ERROR_TRUNCATED) + "..." : err;
|
|
18709
18661
|
};
|
|
18710
|
-
return /* @__PURE__ */
|
|
18711
|
-
/* @__PURE__ */
|
|
18712
|
-
/* @__PURE__ */
|
|
18713
|
-
/* @__PURE__ */
|
|
18662
|
+
return /* @__PURE__ */ jsxs7(Box9, { flexDirection: "column", height: 2, children: [
|
|
18663
|
+
/* @__PURE__ */ jsxs7(Box9, { children: [
|
|
18664
|
+
/* @__PURE__ */ jsx11(Text9, { color: THEME.yellow, wrap: "truncate", children: /* @__PURE__ */ jsx11(StarSpinner, { color: THEME.yellow }) }),
|
|
18665
|
+
/* @__PURE__ */ jsxs7(Text9, { color: THEME.yellow, bold: true, wrap: "truncate", children: [
|
|
18714
18666
|
" \u29F3 Retry #",
|
|
18715
18667
|
retryState.attempt,
|
|
18716
18668
|
"/",
|
|
18717
18669
|
retryState.maxRetries
|
|
18718
18670
|
] }),
|
|
18719
|
-
/* @__PURE__ */
|
|
18671
|
+
/* @__PURE__ */ jsxs7(Text9, { color: THEME.gray, wrap: "truncate", children: [
|
|
18720
18672
|
" \u2014 ",
|
|
18721
18673
|
retryState.countdown,
|
|
18722
18674
|
"s"
|
|
18723
18675
|
] })
|
|
18724
18676
|
] }),
|
|
18725
|
-
/* @__PURE__ */
|
|
18677
|
+
/* @__PURE__ */ jsx11(Box9, { children: /* @__PURE__ */ jsxs7(Text9, { color: THEME.gray, wrap: "truncate", children: [
|
|
18726
18678
|
" ",
|
|
18727
18679
|
truncateError(retryState.error)
|
|
18728
18680
|
] }) })
|
|
@@ -18730,12 +18682,12 @@ var RetryView = ({ retryState }) => {
|
|
|
18730
18682
|
};
|
|
18731
18683
|
|
|
18732
18684
|
// src/platform/tui/components/status/ProcessingView.tsx
|
|
18733
|
-
import { Box as
|
|
18685
|
+
import { Box as Box10, Text as Text11 } from "ink";
|
|
18734
18686
|
|
|
18735
18687
|
// src/platform/tui/components/ShimmerText.tsx
|
|
18736
|
-
import { memo as
|
|
18737
|
-
import { Text as
|
|
18738
|
-
import { jsx as
|
|
18688
|
+
import { memo as memo9 } from "react";
|
|
18689
|
+
import { Text as Text10 } from "ink";
|
|
18690
|
+
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
18739
18691
|
var WAVE_SPEED = 0.25 * (120 / ANIM_TICK_MS);
|
|
18740
18692
|
var CHAR_PHASE_GAP = 0.55;
|
|
18741
18693
|
function sinToColor(sin) {
|
|
@@ -18744,19 +18696,19 @@ function sinToColor(sin) {
|
|
|
18744
18696
|
const hex = brightness.toString(16).padStart(2, "0");
|
|
18745
18697
|
return `#${hex}${hex}${hex}`;
|
|
18746
18698
|
}
|
|
18747
|
-
var ShimmerText =
|
|
18699
|
+
var ShimmerText = memo9(({ children, bold, phase = 0 }) => {
|
|
18748
18700
|
const tick = useAnimationTick();
|
|
18749
18701
|
const globalPhase = tick * WAVE_SPEED + phase;
|
|
18750
|
-
return /* @__PURE__ */
|
|
18702
|
+
return /* @__PURE__ */ jsx12(Text10, { bold, children: Array.from(children).map((char, i) => {
|
|
18751
18703
|
const charPhase = globalPhase - i * CHAR_PHASE_GAP;
|
|
18752
18704
|
const sin = Math.sin(charPhase);
|
|
18753
18705
|
const color = sinToColor(sin);
|
|
18754
|
-
return /* @__PURE__ */
|
|
18706
|
+
return /* @__PURE__ */ jsx12(Text10, { color, children: char }, i);
|
|
18755
18707
|
}) });
|
|
18756
18708
|
});
|
|
18757
18709
|
|
|
18758
18710
|
// src/platform/tui/components/status/ProcessingView.tsx
|
|
18759
|
-
import { jsx as
|
|
18711
|
+
import { jsx as jsx13, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
18760
18712
|
var ProcessingView = ({
|
|
18761
18713
|
statusMain,
|
|
18762
18714
|
detailText,
|
|
@@ -18775,27 +18727,27 @@ var ProcessingView = ({
|
|
|
18775
18727
|
const parenIdx = statusMain.indexOf("(");
|
|
18776
18728
|
const shimmerPart = parenIdx > -1 ? statusMain.slice(0, parenIdx).trimEnd() : statusMain;
|
|
18777
18729
|
const staticSuffix = parenIdx > -1 ? " " + statusMain.slice(parenIdx) : "";
|
|
18778
|
-
return /* @__PURE__ */
|
|
18779
|
-
/* @__PURE__ */
|
|
18780
|
-
/* @__PURE__ */
|
|
18781
|
-
/* @__PURE__ */
|
|
18782
|
-
/* @__PURE__ */
|
|
18783
|
-
staticSuffix ? /* @__PURE__ */
|
|
18784
|
-
/* @__PURE__ */
|
|
18730
|
+
return /* @__PURE__ */ jsxs8(Box10, { flexDirection: "column", height: 2, children: [
|
|
18731
|
+
/* @__PURE__ */ jsxs8(Box10, { children: [
|
|
18732
|
+
/* @__PURE__ */ jsx13(Text11, { color, wrap: "truncate", children: /* @__PURE__ */ jsx13(StarSpinner, { color }) }),
|
|
18733
|
+
/* @__PURE__ */ jsx13(Text11, { children: " " }),
|
|
18734
|
+
/* @__PURE__ */ jsx13(ShimmerText, { bold: true, phase: 0, children: shimmerPart }),
|
|
18735
|
+
staticSuffix ? /* @__PURE__ */ jsx13(Text11, { color: THEME.dimGray, wrap: "truncate", children: staticSuffix }) : null,
|
|
18736
|
+
/* @__PURE__ */ jsxs8(Text11, { color: THEME.dimGray, wrap: "truncate", children: [
|
|
18785
18737
|
" ",
|
|
18786
18738
|
meta
|
|
18787
18739
|
] })
|
|
18788
18740
|
] }),
|
|
18789
|
-
/* @__PURE__ */
|
|
18741
|
+
/* @__PURE__ */ jsx13(Box10, { children: detailText ? /* @__PURE__ */ jsxs8(Text11, { color: THEME.dimGray, wrap: "truncate", children: [
|
|
18790
18742
|
" ",
|
|
18791
18743
|
detailText
|
|
18792
|
-
] }) : /* @__PURE__ */
|
|
18744
|
+
] }) : /* @__PURE__ */ jsx13(Text11, { children: " " }) })
|
|
18793
18745
|
] });
|
|
18794
18746
|
};
|
|
18795
18747
|
|
|
18796
18748
|
// src/platform/tui/components/StatusDisplay.tsx
|
|
18797
|
-
import { jsx as
|
|
18798
|
-
var StatusDisplay =
|
|
18749
|
+
import { jsx as jsx14, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
18750
|
+
var StatusDisplay = memo10(({
|
|
18799
18751
|
retryState,
|
|
18800
18752
|
isProcessing,
|
|
18801
18753
|
currentStatus,
|
|
@@ -18805,12 +18757,12 @@ var StatusDisplay = memo11(({
|
|
|
18805
18757
|
const isWaitingForInput = inputRequest?.status === "active";
|
|
18806
18758
|
const statusElapsed = useStatusTimer(currentStatus, isProcessing && !isWaitingForInput);
|
|
18807
18759
|
if (retryState && retryState.status === "retrying") {
|
|
18808
|
-
return /* @__PURE__ */
|
|
18760
|
+
return /* @__PURE__ */ jsx14(RetryView, { retryState });
|
|
18809
18761
|
}
|
|
18810
18762
|
if (isProcessing && isWaitingForInput) {
|
|
18811
|
-
return /* @__PURE__ */
|
|
18812
|
-
/* @__PURE__ */
|
|
18813
|
-
/* @__PURE__ */
|
|
18763
|
+
return /* @__PURE__ */ jsxs9(Box11, { flexDirection: "column", height: 2, children: [
|
|
18764
|
+
/* @__PURE__ */ jsx14(Text12, { children: " " }),
|
|
18765
|
+
/* @__PURE__ */ jsx14(Text12, { children: " " })
|
|
18814
18766
|
] });
|
|
18815
18767
|
}
|
|
18816
18768
|
if (isProcessing) {
|
|
@@ -18818,7 +18770,7 @@ var StatusDisplay = memo11(({
|
|
|
18818
18770
|
const statusLines = currentStatus ? currentStatus.split("\n").filter(Boolean) : [];
|
|
18819
18771
|
const statusMain = statusLines[0] || "Processing...";
|
|
18820
18772
|
const detailText = isThinkingStatus && statusLines.length > 1 ? statusLines[statusLines.length - 1].slice(0, 120) : "";
|
|
18821
|
-
return /* @__PURE__ */
|
|
18773
|
+
return /* @__PURE__ */ jsx14(
|
|
18822
18774
|
ProcessingView,
|
|
18823
18775
|
{
|
|
18824
18776
|
statusMain,
|
|
@@ -18829,49 +18781,49 @@ var StatusDisplay = memo11(({
|
|
|
18829
18781
|
}
|
|
18830
18782
|
);
|
|
18831
18783
|
}
|
|
18832
|
-
return /* @__PURE__ */
|
|
18833
|
-
/* @__PURE__ */
|
|
18834
|
-
/* @__PURE__ */
|
|
18784
|
+
return /* @__PURE__ */ jsxs9(Box11, { flexDirection: "column", height: 2, children: [
|
|
18785
|
+
/* @__PURE__ */ jsx14(Text12, { children: " " }),
|
|
18786
|
+
/* @__PURE__ */ jsx14(Text12, { children: " " })
|
|
18835
18787
|
] });
|
|
18836
18788
|
});
|
|
18837
18789
|
|
|
18838
18790
|
// src/platform/tui/components/ChatInput.tsx
|
|
18839
|
-
import { useMemo as useMemo3, useCallback as useCallback8, useRef as useRef8, memo as
|
|
18840
|
-
import { Box as
|
|
18791
|
+
import { useMemo as useMemo3, useCallback as useCallback8, useRef as useRef8, memo as memo11, useState as useState7 } from "react";
|
|
18792
|
+
import { Box as Box16, useInput as useInput3 } from "ink";
|
|
18841
18793
|
|
|
18842
18794
|
// src/platform/tui/components/input/AutocompletePreview.tsx
|
|
18843
|
-
import { Box as
|
|
18844
|
-
import { jsx as
|
|
18795
|
+
import { Box as Box12, Text as Text13 } from "ink";
|
|
18796
|
+
import { jsx as jsx15, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
18845
18797
|
var AutocompletePreview = ({
|
|
18846
18798
|
suggestions,
|
|
18847
18799
|
clampedIdx
|
|
18848
18800
|
}) => {
|
|
18849
|
-
return /* @__PURE__ */
|
|
18801
|
+
return /* @__PURE__ */ jsx15(Box12, { flexDirection: "column", paddingX: 1, children: suggestions.map((cmd, i) => {
|
|
18850
18802
|
const isSelected = i === clampedIdx;
|
|
18851
18803
|
const argsText = cmd.args ? ` ${cmd.args}` : "";
|
|
18852
|
-
return /* @__PURE__ */
|
|
18853
|
-
/* @__PURE__ */
|
|
18854
|
-
/* @__PURE__ */
|
|
18804
|
+
return /* @__PURE__ */ jsxs10(Box12, { children: [
|
|
18805
|
+
/* @__PURE__ */ jsx15(Text13, { color: isSelected ? THEME.primary : THEME.dimGray, children: isSelected ? " \u276F " : " " }),
|
|
18806
|
+
/* @__PURE__ */ jsxs10(Text13, { color: isSelected ? THEME.white : THEME.gray, bold: isSelected, children: [
|
|
18855
18807
|
"/",
|
|
18856
18808
|
cmd.name
|
|
18857
18809
|
] }),
|
|
18858
|
-
/* @__PURE__ */
|
|
18859
|
-
/* @__PURE__ */
|
|
18810
|
+
/* @__PURE__ */ jsx15(Text13, { dimColor: true, color: THEME.gray, children: argsText }),
|
|
18811
|
+
/* @__PURE__ */ jsxs10(Text13, { dimColor: true, color: THEME.dimGray, children: [
|
|
18860
18812
|
" \u2014 ",
|
|
18861
18813
|
cmd.description
|
|
18862
18814
|
] }),
|
|
18863
|
-
isSelected && cmd.alias && /* @__PURE__ */
|
|
18815
|
+
isSelected && cmd.alias && /* @__PURE__ */ jsx15(Text13, { dimColor: true, color: THEME.dimGray, children: ` (/${cmd.alias})` })
|
|
18864
18816
|
] }, cmd.name);
|
|
18865
18817
|
}) });
|
|
18866
18818
|
};
|
|
18867
18819
|
|
|
18868
18820
|
// src/platform/tui/components/input/SecretInputArea.tsx
|
|
18869
|
-
import { Box as
|
|
18821
|
+
import { Box as Box14, Text as Text15, useStdout as useStdout3 } from "ink";
|
|
18870
18822
|
|
|
18871
18823
|
// src/platform/tui/components/input/SimpleTextInput.tsx
|
|
18872
18824
|
import { useState as useState6, useEffect as useEffect8, useRef as useRef7, useMemo as useMemo2 } from "react";
|
|
18873
|
-
import { Box as
|
|
18874
|
-
import { jsx as
|
|
18825
|
+
import { Box as Box13, Text as Text14, useInput as useInput2, useStdout as useStdout2 } from "ink";
|
|
18826
|
+
import { jsx as jsx16, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
18875
18827
|
var SimpleTextInput = ({
|
|
18876
18828
|
value,
|
|
18877
18829
|
onChange,
|
|
@@ -18943,24 +18895,24 @@ var SimpleTextInput = ({
|
|
|
18943
18895
|
const displayValue = isPassword ? "\u2022".repeat(chars.length) : value;
|
|
18944
18896
|
const displayChars = Array.from(displayValue);
|
|
18945
18897
|
if (displayChars.length === 0) {
|
|
18946
|
-
return /* @__PURE__ */
|
|
18947
|
-
/* @__PURE__ */
|
|
18948
|
-
placeholder ? /* @__PURE__ */
|
|
18898
|
+
return /* @__PURE__ */ jsxs11(Box13, { children: [
|
|
18899
|
+
/* @__PURE__ */ jsx16(Text14, { inverse: true, children: " " }),
|
|
18900
|
+
placeholder ? /* @__PURE__ */ jsx16(Box13, { marginLeft: 1, children: /* @__PURE__ */ jsx16(Text14, { color: "gray", children: placeholder }) }) : null
|
|
18949
18901
|
] });
|
|
18950
18902
|
}
|
|
18951
18903
|
const c = Math.min(cursorRef.current, displayChars.length);
|
|
18952
18904
|
const before = displayChars.slice(0, c).join("");
|
|
18953
18905
|
const charAtCursor = c < displayChars.length ? displayChars[c] : " ";
|
|
18954
18906
|
const after = displayChars.slice(c + 1).join("");
|
|
18955
|
-
return /* @__PURE__ */
|
|
18956
|
-
/* @__PURE__ */
|
|
18957
|
-
/* @__PURE__ */
|
|
18958
|
-
/* @__PURE__ */
|
|
18907
|
+
return /* @__PURE__ */ jsxs11(Box13, { children: [
|
|
18908
|
+
/* @__PURE__ */ jsx16(Text14, { children: before }),
|
|
18909
|
+
/* @__PURE__ */ jsx16(Text14, { inverse: true, children: charAtCursor }),
|
|
18910
|
+
/* @__PURE__ */ jsx16(Text14, { children: after })
|
|
18959
18911
|
] });
|
|
18960
18912
|
};
|
|
18961
18913
|
|
|
18962
18914
|
// src/platform/tui/components/input/SecretInputArea.tsx
|
|
18963
|
-
import { jsx as
|
|
18915
|
+
import { jsx as jsx17, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
18964
18916
|
var OUTER_PADDING = 2;
|
|
18965
18917
|
var SecretInputArea = ({
|
|
18966
18918
|
inputRequest,
|
|
@@ -18971,11 +18923,11 @@ var SecretInputArea = ({
|
|
|
18971
18923
|
const { stdout } = useStdout3();
|
|
18972
18924
|
const borderWidth = Math.max(10, (stdout?.columns ?? 80) - OUTER_PADDING);
|
|
18973
18925
|
const borderLine = "\u2500".repeat(borderWidth);
|
|
18974
|
-
return /* @__PURE__ */
|
|
18975
|
-
/* @__PURE__ */
|
|
18976
|
-
/* @__PURE__ */
|
|
18977
|
-
/* @__PURE__ */
|
|
18978
|
-
/* @__PURE__ */
|
|
18926
|
+
return /* @__PURE__ */ jsxs12(Box14, { flexDirection: "column", children: [
|
|
18927
|
+
/* @__PURE__ */ jsx17(Box14, { children: /* @__PURE__ */ jsx17(Text15, { color: THEME.yellow, children: borderLine }) }),
|
|
18928
|
+
/* @__PURE__ */ jsxs12(Box14, { paddingX: 1, children: [
|
|
18929
|
+
/* @__PURE__ */ jsx17(Text15, { color: THEME.yellow, bold: true, children: "\u25B8 " }),
|
|
18930
|
+
/* @__PURE__ */ jsx17(
|
|
18979
18931
|
SimpleTextInput,
|
|
18980
18932
|
{
|
|
18981
18933
|
value: secretInput,
|
|
@@ -18986,13 +18938,13 @@ var SecretInputArea = ({
|
|
|
18986
18938
|
}
|
|
18987
18939
|
)
|
|
18988
18940
|
] }),
|
|
18989
|
-
/* @__PURE__ */
|
|
18941
|
+
/* @__PURE__ */ jsx17(Box14, { children: /* @__PURE__ */ jsx17(Text15, { color: THEME.yellow, children: borderLine }) })
|
|
18990
18942
|
] });
|
|
18991
18943
|
};
|
|
18992
18944
|
|
|
18993
18945
|
// src/platform/tui/components/input/NormalInputArea.tsx
|
|
18994
|
-
import { Box as
|
|
18995
|
-
import { jsx as
|
|
18946
|
+
import { Box as Box15, Text as Text16, useStdout as useStdout4 } from "ink";
|
|
18947
|
+
import { jsx as jsx18, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
18996
18948
|
var OUTER_PADDING2 = 2;
|
|
18997
18949
|
var NormalInputArea = ({
|
|
18998
18950
|
inputKey,
|
|
@@ -19004,11 +18956,11 @@ var NormalInputArea = ({
|
|
|
19004
18956
|
const { stdout } = useStdout4();
|
|
19005
18957
|
const borderWidth = Math.max(10, (stdout?.columns ?? 80) - OUTER_PADDING2);
|
|
19006
18958
|
const borderLine = "\u2500".repeat(borderWidth);
|
|
19007
|
-
return /* @__PURE__ */
|
|
19008
|
-
/* @__PURE__ */
|
|
19009
|
-
/* @__PURE__ */
|
|
19010
|
-
/* @__PURE__ */
|
|
19011
|
-
/* @__PURE__ */
|
|
18959
|
+
return /* @__PURE__ */ jsxs13(Box15, { flexDirection: "column", children: [
|
|
18960
|
+
/* @__PURE__ */ jsx18(Box15, { children: /* @__PURE__ */ jsx18(Text16, { dimColor: true, color: THEME.dimGray, children: borderLine }) }),
|
|
18961
|
+
/* @__PURE__ */ jsxs13(Box15, { paddingX: 1, children: [
|
|
18962
|
+
/* @__PURE__ */ jsx18(Text16, { color: THEME.primary, children: "\u276F " }),
|
|
18963
|
+
/* @__PURE__ */ jsx18(
|
|
19012
18964
|
SimpleTextInput,
|
|
19013
18965
|
{
|
|
19014
18966
|
value,
|
|
@@ -19019,14 +18971,14 @@ var NormalInputArea = ({
|
|
|
19019
18971
|
inputKey
|
|
19020
18972
|
)
|
|
19021
18973
|
] }),
|
|
19022
|
-
/* @__PURE__ */
|
|
18974
|
+
/* @__PURE__ */ jsx18(Box15, { children: /* @__PURE__ */ jsx18(Text16, { dimColor: true, color: THEME.dimGray, children: borderLine }) })
|
|
19023
18975
|
] });
|
|
19024
18976
|
};
|
|
19025
18977
|
|
|
19026
18978
|
// src/platform/tui/components/ChatInput.tsx
|
|
19027
|
-
import { jsx as
|
|
18979
|
+
import { jsx as jsx19, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
19028
18980
|
var MAX_SUGGESTIONS = 6;
|
|
19029
|
-
var ChatInput =
|
|
18981
|
+
var ChatInput = memo11(({
|
|
19030
18982
|
value,
|
|
19031
18983
|
onChange,
|
|
19032
18984
|
onSubmit,
|
|
@@ -19126,8 +19078,8 @@ var ChatInput = memo12(({
|
|
|
19126
19078
|
completeCommand(selectedIdxRef.current);
|
|
19127
19079
|
}
|
|
19128
19080
|
}, [completeCommand]));
|
|
19129
|
-
return /* @__PURE__ */
|
|
19130
|
-
showPreview && /* @__PURE__ */
|
|
19081
|
+
return /* @__PURE__ */ jsxs14(Box16, { flexDirection: "column", children: [
|
|
19082
|
+
showPreview && /* @__PURE__ */ jsx19(
|
|
19131
19083
|
AutocompletePreview,
|
|
19132
19084
|
{
|
|
19133
19085
|
suggestions,
|
|
@@ -19136,7 +19088,7 @@ var ChatInput = memo12(({
|
|
|
19136
19088
|
),
|
|
19137
19089
|
inputRequest.status === "active" ? (
|
|
19138
19090
|
/* Active input request — yellow top/bottom border */
|
|
19139
|
-
/* @__PURE__ */
|
|
19091
|
+
/* @__PURE__ */ jsx19(
|
|
19140
19092
|
SecretInputArea,
|
|
19141
19093
|
{
|
|
19142
19094
|
inputRequest,
|
|
@@ -19147,7 +19099,7 @@ var ChatInput = memo12(({
|
|
|
19147
19099
|
)
|
|
19148
19100
|
) : (
|
|
19149
19101
|
/* Normal input — dim top/bottom border */
|
|
19150
|
-
/* @__PURE__ */
|
|
19102
|
+
/* @__PURE__ */ jsx19(
|
|
19151
19103
|
NormalInputArea,
|
|
19152
19104
|
{
|
|
19153
19105
|
inputKey,
|
|
@@ -19162,9 +19114,9 @@ var ChatInput = memo12(({
|
|
|
19162
19114
|
});
|
|
19163
19115
|
|
|
19164
19116
|
// src/platform/tui/components/footer.tsx
|
|
19165
|
-
import { memo as
|
|
19166
|
-
import { Box as
|
|
19167
|
-
import { jsx as
|
|
19117
|
+
import { memo as memo12 } from "react";
|
|
19118
|
+
import { Box as Box17, Text as Text17 } from "ink";
|
|
19119
|
+
import { jsx as jsx20, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
19168
19120
|
var SECS_PER_HOUR = 3600;
|
|
19169
19121
|
var SECS_PER_MINUTE = 60;
|
|
19170
19122
|
var CTX_WARN_PCT = 80;
|
|
@@ -19175,7 +19127,7 @@ function fmtTime(s) {
|
|
|
19175
19127
|
const pad = (n) => String(n).padStart(2, "0");
|
|
19176
19128
|
return h > 0 ? `${h}:${pad(m)}:${pad(sec)}` : `${m}:${pad(sec)}`;
|
|
19177
19129
|
}
|
|
19178
|
-
var Footer =
|
|
19130
|
+
var Footer = memo12(({
|
|
19179
19131
|
phase,
|
|
19180
19132
|
targets,
|
|
19181
19133
|
findings,
|
|
@@ -19187,56 +19139,56 @@ var Footer = memo13(({
|
|
|
19187
19139
|
}) => {
|
|
19188
19140
|
const ctxPct = totalTokens > 0 ? Math.round(totalTokens / LLM_LIMITS.streamMaxTokens * 100) : 0;
|
|
19189
19141
|
const ctxColor = ctxPct >= CTX_WARN_PCT ? THEME.yellow : THEME.dimGray;
|
|
19190
|
-
return /* @__PURE__ */
|
|
19191
|
-
/* @__PURE__ */
|
|
19192
|
-
/* @__PURE__ */
|
|
19142
|
+
return /* @__PURE__ */ jsxs15(Box17, { width: "100%", paddingX: 1, justifyContent: "space-between", children: [
|
|
19143
|
+
/* @__PURE__ */ jsxs15(Box17, { gap: 2, children: [
|
|
19144
|
+
/* @__PURE__ */ jsxs15(Text17, { color: THEME.dimGray, children: [
|
|
19193
19145
|
"phase ",
|
|
19194
|
-
/* @__PURE__ */
|
|
19146
|
+
/* @__PURE__ */ jsx20(Text17, { color: THEME.white, bold: true, children: phase })
|
|
19195
19147
|
] }),
|
|
19196
|
-
/* @__PURE__ */
|
|
19148
|
+
/* @__PURE__ */ jsxs15(Text17, { color: THEME.dimGray, children: [
|
|
19197
19149
|
"targets ",
|
|
19198
|
-
/* @__PURE__ */
|
|
19150
|
+
/* @__PURE__ */ jsx20(Text17, { color: THEME.white, children: targets })
|
|
19199
19151
|
] }),
|
|
19200
|
-
/* @__PURE__ */
|
|
19152
|
+
/* @__PURE__ */ jsxs15(Text17, { color: THEME.dimGray, children: [
|
|
19201
19153
|
"finds ",
|
|
19202
|
-
/* @__PURE__ */
|
|
19154
|
+
/* @__PURE__ */ jsx20(Text17, { color: findings > 0 ? THEME.yellow : THEME.white, children: findings })
|
|
19203
19155
|
] }),
|
|
19204
|
-
/* @__PURE__ */
|
|
19156
|
+
/* @__PURE__ */ jsxs15(Text17, { color: THEME.dimGray, children: [
|
|
19205
19157
|
"tasks ",
|
|
19206
|
-
/* @__PURE__ */
|
|
19158
|
+
/* @__PURE__ */ jsx20(Text17, { color: THEME.white, children: todo })
|
|
19207
19159
|
] })
|
|
19208
19160
|
] }),
|
|
19209
|
-
/* @__PURE__ */
|
|
19210
|
-
/* @__PURE__ */
|
|
19211
|
-
turnCount > 0 && /* @__PURE__ */
|
|
19161
|
+
/* @__PURE__ */ jsxs15(Box17, { gap: 2, children: [
|
|
19162
|
+
/* @__PURE__ */ jsx20(Text17, { color: isProcessing ? THEME.primary : THEME.dimGray, children: isProcessing ? "\u25CF run" : "\u25CB idle" }),
|
|
19163
|
+
turnCount > 0 && /* @__PURE__ */ jsxs15(Text17, { color: THEME.dimGray, children: [
|
|
19212
19164
|
"t",
|
|
19213
19165
|
turnCount
|
|
19214
19166
|
] }),
|
|
19215
|
-
ctxPct > 0 && /* @__PURE__ */
|
|
19167
|
+
ctxPct > 0 && /* @__PURE__ */ jsxs15(Text17, { color: ctxColor, children: [
|
|
19216
19168
|
ctxPct,
|
|
19217
19169
|
"%"
|
|
19218
19170
|
] }),
|
|
19219
|
-
totalTokens > 0 && /* @__PURE__ */
|
|
19171
|
+
totalTokens > 0 && /* @__PURE__ */ jsxs15(Text17, { color: THEME.dimGray, children: [
|
|
19220
19172
|
"\u2191",
|
|
19221
19173
|
formatTokens(totalTokens)
|
|
19222
19174
|
] }),
|
|
19223
|
-
/* @__PURE__ */
|
|
19224
|
-
/* @__PURE__ */
|
|
19175
|
+
/* @__PURE__ */ jsx20(Text17, { color: THEME.gray, children: fmtTime(elapsedTime) }),
|
|
19176
|
+
/* @__PURE__ */ jsx20(Text17, { color: THEME.dimGray, children: isProcessing ? "[ESC]" : "[/help]" })
|
|
19225
19177
|
] })
|
|
19226
19178
|
] });
|
|
19227
19179
|
});
|
|
19228
19180
|
var footer_default = Footer;
|
|
19229
19181
|
|
|
19230
19182
|
// src/platform/tui/components/Modal.tsx
|
|
19231
|
-
import { useMemo as useMemo4, memo as
|
|
19232
|
-
import { Box as
|
|
19233
|
-
import { jsx as
|
|
19183
|
+
import { useMemo as useMemo4, memo as memo13, useCallback as useCallback9, useRef as useRef9 } from "react";
|
|
19184
|
+
import { Box as Box18, Text as Text18, useStdout as useStdout5, useInput as useInput4 } from "ink";
|
|
19185
|
+
import { jsx as jsx21, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
19234
19186
|
var MODAL_TITLES = {
|
|
19235
19187
|
findings: "\u25C8 FINDINGS \u25C8",
|
|
19236
19188
|
graph: "\u25C8 ATTACK GRAPH \u25C8",
|
|
19237
19189
|
help: "\u25C8 COMMANDS \u25C8"
|
|
19238
19190
|
};
|
|
19239
|
-
var Modal =
|
|
19191
|
+
var Modal = memo13(({
|
|
19240
19192
|
type,
|
|
19241
19193
|
content,
|
|
19242
19194
|
scrollOffset,
|
|
@@ -19274,20 +19226,20 @@ var Modal = memo14(({
|
|
|
19274
19226
|
const endLine = Math.min(scrollOffset + maxHeight, totalLines);
|
|
19275
19227
|
const scrollbarHeight = Math.max(1, Math.floor(maxHeight * (maxHeight / Math.max(totalLines, 1))));
|
|
19276
19228
|
const scrollbarPosition = totalLines > maxHeight ? Math.floor(scrollOffset / (totalLines - maxHeight) * (maxHeight - scrollbarHeight)) : 0;
|
|
19277
|
-
return /* @__PURE__ */
|
|
19278
|
-
|
|
19229
|
+
return /* @__PURE__ */ jsxs16(
|
|
19230
|
+
Box18,
|
|
19279
19231
|
{
|
|
19280
19232
|
flexDirection: "column",
|
|
19281
19233
|
width: terminalWidth,
|
|
19282
19234
|
height: terminalHeight,
|
|
19283
19235
|
children: [
|
|
19284
|
-
/* @__PURE__ */
|
|
19236
|
+
/* @__PURE__ */ jsx21(Box18, { justifyContent: "center", marginBottom: 0, children: /* @__PURE__ */ jsx21(Text18, { color: THEME.cyan, bold: true, children: (() => {
|
|
19285
19237
|
const title = MODAL_TITLES[type];
|
|
19286
19238
|
const sideWidth = Math.max(3, Math.floor((terminalWidth - title.length - 2) / 2));
|
|
19287
19239
|
return `${"\u2500".repeat(sideWidth)} ${title} ${"\u2500".repeat(sideWidth)}`;
|
|
19288
19240
|
})() }) }),
|
|
19289
|
-
/* @__PURE__ */
|
|
19290
|
-
|
|
19241
|
+
/* @__PURE__ */ jsx21(
|
|
19242
|
+
Box18,
|
|
19291
19243
|
{
|
|
19292
19244
|
flexDirection: "column",
|
|
19293
19245
|
borderStyle: "round",
|
|
@@ -19296,17 +19248,17 @@ var Modal = memo14(({
|
|
|
19296
19248
|
flexGrow: 1,
|
|
19297
19249
|
children: visibleLines.map((line, i) => {
|
|
19298
19250
|
const showScrollbar = totalLines > maxHeight && i >= scrollbarPosition && i < scrollbarPosition + scrollbarHeight;
|
|
19299
|
-
return /* @__PURE__ */
|
|
19300
|
-
/* @__PURE__ */
|
|
19301
|
-
/* @__PURE__ */
|
|
19302
|
-
totalLines > maxHeight && /* @__PURE__ */
|
|
19251
|
+
return /* @__PURE__ */ jsxs16(Box18, { children: [
|
|
19252
|
+
/* @__PURE__ */ jsx21(Text18, { color: THEME.white, wrap: "truncate", children: line }),
|
|
19253
|
+
/* @__PURE__ */ jsx21(Box18, { flexGrow: 1 }),
|
|
19254
|
+
totalLines > maxHeight && /* @__PURE__ */ jsx21(Text18, { color: showScrollbar ? THEME.cyan : THEME.dimGray, children: showScrollbar ? "\u2588" : "\u2502" })
|
|
19303
19255
|
] }, i);
|
|
19304
19256
|
})
|
|
19305
19257
|
}
|
|
19306
19258
|
),
|
|
19307
|
-
/* @__PURE__ */
|
|
19308
|
-
/* @__PURE__ */
|
|
19309
|
-
/* @__PURE__ */
|
|
19259
|
+
/* @__PURE__ */ jsxs16(Box18, { justifyContent: "space-between", paddingX: 1, children: [
|
|
19260
|
+
/* @__PURE__ */ jsx21(Text18, { dimColor: true, color: THEME.gray, children: "\u2191\u2193/jk: scroll | g/G: top/bottom | ESC/q: close" }),
|
|
19261
|
+
/* @__PURE__ */ jsxs16(Text18, { dimColor: true, color: THEME.cyan, children: [
|
|
19310
19262
|
startLine,
|
|
19311
19263
|
"-",
|
|
19312
19264
|
endLine,
|
|
@@ -19320,8 +19272,8 @@ var Modal = memo14(({
|
|
|
19320
19272
|
});
|
|
19321
19273
|
|
|
19322
19274
|
// src/platform/tui/components/app/bottom-region.tsx
|
|
19323
|
-
import { Box as
|
|
19324
|
-
import { jsx as
|
|
19275
|
+
import { Box as Box19 } from "ink";
|
|
19276
|
+
import { jsx as jsx22, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
19325
19277
|
var BottomRegion = ({
|
|
19326
19278
|
input,
|
|
19327
19279
|
setInput,
|
|
@@ -19345,8 +19297,8 @@ var BottomRegion = ({
|
|
|
19345
19297
|
const suggestionCount = isSlashMode && !hasArgs && inputRequest.status !== "active" ? Math.min(getMatchingCommands(partialCmd).length, MAX_SUGGESTIONS) : 0;
|
|
19346
19298
|
const previewHeight = suggestionCount;
|
|
19347
19299
|
const bottomMinHeight = 7;
|
|
19348
|
-
return /* @__PURE__ */
|
|
19349
|
-
/* @__PURE__ */
|
|
19300
|
+
return /* @__PURE__ */ jsxs17(Box19, { flexDirection: "column", minHeight: bottomMinHeight, children: [
|
|
19301
|
+
/* @__PURE__ */ jsx22(
|
|
19350
19302
|
StatusDisplay,
|
|
19351
19303
|
{
|
|
19352
19304
|
retryState,
|
|
@@ -19356,7 +19308,7 @@ var BottomRegion = ({
|
|
|
19356
19308
|
inputRequest
|
|
19357
19309
|
}
|
|
19358
19310
|
),
|
|
19359
|
-
/* @__PURE__ */
|
|
19311
|
+
/* @__PURE__ */ jsx22(
|
|
19360
19312
|
ChatInput,
|
|
19361
19313
|
{
|
|
19362
19314
|
value: input,
|
|
@@ -19369,7 +19321,7 @@ var BottomRegion = ({
|
|
|
19369
19321
|
onSecretSubmit: handleSecretSubmit
|
|
19370
19322
|
}
|
|
19371
19323
|
),
|
|
19372
|
-
/* @__PURE__ */
|
|
19324
|
+
/* @__PURE__ */ jsx22(Box19, { marginTop: 1, children: /* @__PURE__ */ jsx22(
|
|
19373
19325
|
footer_default,
|
|
19374
19326
|
{
|
|
19375
19327
|
phase: stats.phase,
|
|
@@ -19386,7 +19338,7 @@ var BottomRegion = ({
|
|
|
19386
19338
|
};
|
|
19387
19339
|
|
|
19388
19340
|
// src/platform/tui/app.tsx
|
|
19389
|
-
import { jsx as
|
|
19341
|
+
import { jsx as jsx23, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
19390
19342
|
var MODEL_NAME = getModel() || DEFAULT_MODEL;
|
|
19391
19343
|
var App = ({ autoApprove = false, target }) => {
|
|
19392
19344
|
const {
|
|
@@ -19409,12 +19361,10 @@ var App = ({ autoApprove = false, target }) => {
|
|
|
19409
19361
|
currentTokens,
|
|
19410
19362
|
inputRequest,
|
|
19411
19363
|
stats,
|
|
19412
|
-
turnCount
|
|
19413
|
-
liveReasoning,
|
|
19414
|
-
isReasoning
|
|
19364
|
+
turnCount
|
|
19415
19365
|
} = useAppLogic({ autoApprove, target });
|
|
19416
19366
|
if (modal.type) {
|
|
19417
|
-
return /* @__PURE__ */
|
|
19367
|
+
return /* @__PURE__ */ jsx23(Box20, { flexDirection: "column", paddingX: 1, width: terminalWidth, children: /* @__PURE__ */ jsx23(
|
|
19418
19368
|
Modal,
|
|
19419
19369
|
{
|
|
19420
19370
|
type: modal.type,
|
|
@@ -19425,8 +19375,8 @@ var App = ({ autoApprove = false, target }) => {
|
|
|
19425
19375
|
}
|
|
19426
19376
|
) });
|
|
19427
19377
|
}
|
|
19428
|
-
return /* @__PURE__ */
|
|
19429
|
-
/* @__PURE__ */
|
|
19378
|
+
return /* @__PURE__ */ jsxs18(Box20, { flexDirection: "column", width: terminalWidth, children: [
|
|
19379
|
+
/* @__PURE__ */ jsx23(Box20, { flexDirection: "column", children: /* @__PURE__ */ jsx23(
|
|
19430
19380
|
MessageList,
|
|
19431
19381
|
{
|
|
19432
19382
|
messages,
|
|
@@ -19435,14 +19385,7 @@ var App = ({ autoApprove = false, target }) => {
|
|
|
19435
19385
|
version: APP_VERSION
|
|
19436
19386
|
}
|
|
19437
19387
|
) }),
|
|
19438
|
-
/* @__PURE__ */
|
|
19439
|
-
LiveReasoningPanel,
|
|
19440
|
-
{
|
|
19441
|
-
content: liveReasoning,
|
|
19442
|
-
isReasoning
|
|
19443
|
-
}
|
|
19444
|
-
),
|
|
19445
|
-
/* @__PURE__ */ jsx24(AnimationProvider, { children: /* @__PURE__ */ jsx24(
|
|
19388
|
+
/* @__PURE__ */ jsx23(AnimationProvider, { children: /* @__PURE__ */ jsx23(
|
|
19446
19389
|
BottomRegion,
|
|
19447
19390
|
{
|
|
19448
19391
|
input,
|
|
@@ -19467,7 +19410,7 @@ var App = ({ autoApprove = false, target }) => {
|
|
|
19467
19410
|
var app_default = App;
|
|
19468
19411
|
|
|
19469
19412
|
// src/platform/tui/cli/commands/interactive.tsx
|
|
19470
|
-
import { jsx as
|
|
19413
|
+
import { jsx as jsx24 } from "react/jsx-runtime";
|
|
19471
19414
|
async function interactiveAction(options) {
|
|
19472
19415
|
const { dangerouslySkipPermissions: skipPermissions = false, target } = options;
|
|
19473
19416
|
console.clear();
|
|
@@ -19476,7 +19419,7 @@ async function interactiveAction(options) {
|
|
|
19476
19419
|
console.log(chalk.hex(HEX.red)("[!] All tool executions will be auto-approved!\n"));
|
|
19477
19420
|
}
|
|
19478
19421
|
const { waitUntilExit } = render(
|
|
19479
|
-
/* @__PURE__ */
|
|
19422
|
+
/* @__PURE__ */ jsx24(
|
|
19480
19423
|
app_default,
|
|
19481
19424
|
{
|
|
19482
19425
|
autoApprove: skipPermissions,
|