@pensar/apex 1.7.0 → 1.8.0-canary.1db2dac9
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/build/{agent-beywhvf3.js → agent-pzymaexc.js} +7 -7
- package/build/agent-rsvcxej9.js +19 -0
- package/build/{auth-wvh553ea.js → auth-z89eba1d.js} +4 -4
- package/build/{authentication-ec7trwb4.js → authentication-3tstyqna.js} +7 -7
- package/build/{blackboxAgent-ng2t2p2x.js → blackboxAgent-z5081b7k.js} +8 -8
- package/build/{blackboxPentest-rwyjy4kq.js → blackboxPentest-rkxe2mcn.js} +12 -12
- package/build/{cli-09prdch1.js → cli-0cgtn46q.js} +6 -6
- package/build/{cli-q2dty8g4.js → cli-1aswmqw0.js} +1 -1
- package/build/{cli-06zt0g1a.js → cli-3escpq81.js} +2 -2
- package/build/{cli-836bfgxg.js → cli-5d8gtwm9.js} +1 -1
- package/build/{cli-vvyq7ace.js → cli-6dzawz8t.js} +1 -1
- package/build/{cli-gr3zncst.js → cli-7zdq20ny.js} +1 -1
- package/build/{cli-x3k26g1t.js → cli-8e3jxvsa.js} +296 -181
- package/build/{cli-rc7hyq7e.js → cli-f55c0xh4.js} +92 -6
- package/build/{cli-5m0347h3.js → cli-h2geq3ft.js} +1 -1
- package/build/{cli-zr7sg2m2.js → cli-mnx6v52y.js} +2 -2
- package/build/{cli-r879p2yz.js → cli-mqp1725p.js} +1 -1
- package/build/{cli-xtqm11qt.js → cli-p8zdr5yc.js} +1 -1
- package/build/{cli-nqx9y9ds.js → cli-zhs8z3ay.js} +1 -1
- package/build/{cli-40ef01tb.js → cli-zvjf2zxh.js} +1 -1
- package/build/cli.js +50 -41
- package/build/{fixes-1z283wdz.js → fixes-073psn8y.js} +4 -4
- package/build/{index-j3hw6d4w.js → index-16m6v082.js} +133 -100
- package/build/{index-1p5bg26t.js → index-f6w6vdtj.js} +4 -4
- package/build/{index-py7gtxez.js → index-mn8a1ej3.js} +2 -2
- package/build/{index-a4ydz3dd.js → index-x7nnxbgg.js} +7 -7
- package/build/{index-5a173a2k.js → index-z2v0ck06.js} +6 -6
- package/build/{issues-trbzy8n0.js → issues-p52tvm5m.js} +4 -4
- package/build/{logs-c88md0h3.js → logs-v8sxy4aj.js} +4 -4
- package/build/{offesecAgent-ahcz5hcx.js → offesecAgent-a5vgdg3p.js} +7 -7
- package/build/{pentest-4932ke3a.js → pentest-277h4psc.js} +12 -12
- package/build/{pentests-re8dzxt9.js → pentests-wc7jv4w7.js} +4 -4
- package/build/{projects-dqp4m0ws.js → projects-wc1q31pd.js} +4 -4
- package/build/{targetedPentest-de8a67va.js → targetedPentest-x52as9qn.js} +8 -8
- package/build/{threatModel-waz866yk.js → threatModel-86tctt66.js} +8 -8
- package/build/{uninstall-0bwz7jdn.js → uninstall-7qq038qw.js} +1 -1
- package/package.json +1 -1
- package/build/agent-63cc9rpx.js +0 -19
|
@@ -3,14 +3,14 @@ import {
|
|
|
3
3
|
buildThreatModelPrompt,
|
|
4
4
|
createSkillsRegistry,
|
|
5
5
|
runOffensiveSecurityAgent
|
|
6
|
-
} from "./cli-
|
|
6
|
+
} from "./cli-5d8gtwm9.js";
|
|
7
7
|
import {
|
|
8
8
|
REPORT_FILENAME_MD,
|
|
9
9
|
convertModelMessagesToUI,
|
|
10
10
|
loadSubagents,
|
|
11
11
|
readExecutionMetrics,
|
|
12
12
|
writeExecutionMetrics
|
|
13
|
-
} from "./cli-
|
|
13
|
+
} from "./cli-7zdq20ny.js";
|
|
14
14
|
import {
|
|
15
15
|
createThreatModelPrompt
|
|
16
16
|
} from "./cli-fw5r7pfj.js";
|
|
@@ -27,6 +27,7 @@ import {
|
|
|
27
27
|
ASK_USER_QUESTIONS_TOOL_NAME,
|
|
28
28
|
AgentEventBus,
|
|
29
29
|
ApprovalGate,
|
|
30
|
+
INTERNAL_ID_PATTERN,
|
|
30
31
|
OPERATOR_MODES,
|
|
31
32
|
OPERATOR_MODE_CYCLE,
|
|
32
33
|
PLAN_MODE_TOOL_NAMES,
|
|
@@ -38,14 +39,14 @@ import {
|
|
|
38
39
|
planFilePath,
|
|
39
40
|
readPlan,
|
|
40
41
|
sessions
|
|
41
|
-
} from "./cli-
|
|
42
|
+
} from "./cli-8e3jxvsa.js";
|
|
42
43
|
import {
|
|
43
44
|
detectOSAndEnhancePrompt
|
|
44
45
|
} from "./cli-tp1tqn3k.js";
|
|
45
46
|
import {
|
|
46
47
|
read,
|
|
47
48
|
write
|
|
48
|
-
} from "./cli-
|
|
49
|
+
} from "./cli-zhs8z3ay.js";
|
|
49
50
|
import {
|
|
50
51
|
getAutoPopulatedHosts,
|
|
51
52
|
getAutoPopulatedPorts,
|
|
@@ -57,7 +58,7 @@ import {
|
|
|
57
58
|
init_toolset,
|
|
58
59
|
modelSupportsThinking,
|
|
59
60
|
stepCountIs
|
|
60
|
-
} from "./cli-
|
|
61
|
+
} from "./cli-f55c0xh4.js";
|
|
61
62
|
import"./cli-0ghkg3w6.js";
|
|
62
63
|
import {
|
|
63
64
|
disconnect,
|
|
@@ -69,19 +70,19 @@ import {
|
|
|
69
70
|
selectWorkspace,
|
|
70
71
|
startDeviceFlow,
|
|
71
72
|
validateGateway
|
|
72
|
-
} from "./cli-
|
|
73
|
+
} from "./cli-p8zdr5yc.js";
|
|
73
74
|
import {
|
|
74
75
|
config,
|
|
75
76
|
getPensarApiUrl,
|
|
76
77
|
getPensarConsoleUrl
|
|
77
|
-
} from "./cli-
|
|
78
|
+
} from "./cli-1aswmqw0.js";
|
|
78
79
|
import"./cli-gpnb45ck.js";
|
|
79
80
|
import {
|
|
80
81
|
update
|
|
81
|
-
} from "./cli-
|
|
82
|
+
} from "./cli-zvjf2zxh.js";
|
|
82
83
|
import {
|
|
83
84
|
checkForUpdate
|
|
84
|
-
} from "./cli-
|
|
85
|
+
} from "./cli-mqp1725p.js";
|
|
85
86
|
import {
|
|
86
87
|
AVAILABLE_MODELS,
|
|
87
88
|
init_models
|
|
@@ -49343,7 +49344,7 @@ var require_lib = __commonJS((exports, module) => {
|
|
|
49343
49344
|
|
|
49344
49345
|
// src/tui/index.tsx
|
|
49345
49346
|
import { createRoot } from "@opentui/react";
|
|
49346
|
-
import { useState as useState40, useEffect as
|
|
49347
|
+
import { useState as useState40, useEffect as useEffect28 } from "react";
|
|
49347
49348
|
|
|
49348
49349
|
// src/tui/components/footer.tsx
|
|
49349
49350
|
import os2 from "os";
|
|
@@ -53534,7 +53535,12 @@ function ApprovalInputArea({
|
|
|
53534
53535
|
lastDeclineNote
|
|
53535
53536
|
}) {
|
|
53536
53537
|
const { colors: colors2 } = useTheme();
|
|
53538
|
+
const { setExternalDialogOpen } = useDialog();
|
|
53537
53539
|
const [focusedElement, setFocusedElement] = useState15(0);
|
|
53540
|
+
useEffect7(() => {
|
|
53541
|
+
setExternalDialogOpen(focusedElement === 2);
|
|
53542
|
+
return () => setExternalDialogOpen(false);
|
|
53543
|
+
}, [focusedElement, setExternalDialogOpen]);
|
|
53538
53544
|
useKeyboard5((key) => {
|
|
53539
53545
|
if (key.name === "up") {
|
|
53540
53546
|
setFocusedElement((prev) => Math.max(0, prev - 1));
|
|
@@ -53558,6 +53564,11 @@ function ApprovalInputArea({
|
|
|
53558
53564
|
}
|
|
53559
53565
|
return;
|
|
53560
53566
|
}
|
|
53567
|
+
if (focusedElement === 2) {
|
|
53568
|
+
if (key.name === "y" || key.raw === "Y" || key.name === "a" || key.raw === "A") {
|
|
53569
|
+
return;
|
|
53570
|
+
}
|
|
53571
|
+
}
|
|
53561
53572
|
});
|
|
53562
53573
|
return /* @__PURE__ */ jsxDEV21("box", {
|
|
53563
53574
|
flexDirection: "column",
|
|
@@ -58716,8 +58727,8 @@ function KeybindingProvider({
|
|
|
58716
58727
|
// src/tui/components/operator-dashboard/index.tsx
|
|
58717
58728
|
import {
|
|
58718
58729
|
useState as useState37,
|
|
58719
|
-
useEffect as
|
|
58720
|
-
useRef as
|
|
58730
|
+
useEffect as useEffect24,
|
|
58731
|
+
useRef as useRef19,
|
|
58721
58732
|
useCallback as useCallback18,
|
|
58722
58733
|
useMemo as useMemo23,
|
|
58723
58734
|
useSyncExternalStore as useSyncExternalStore2
|
|
@@ -61960,8 +61971,22 @@ var MessageRenderer = memo3(function MessageRenderer2({
|
|
|
61960
61971
|
}, undefined, false, undefined, this);
|
|
61961
61972
|
});
|
|
61962
61973
|
// src/tui/components/shared/approval-prompt.tsx
|
|
61963
|
-
import { useState as useState32 } from "react";
|
|
61974
|
+
import { useState as useState32, useEffect as useEffect20 } from "react";
|
|
61964
61975
|
import { useKeyboard as useKeyboard21 } from "@opentui/react";
|
|
61976
|
+
|
|
61977
|
+
// src/tui/components/shared/action-label.ts
|
|
61978
|
+
function deriveActionLabel(toolName, args) {
|
|
61979
|
+
const description = args?.toolCallDescription;
|
|
61980
|
+
if (typeof description === "string" && description.trim().length > 0) {
|
|
61981
|
+
return description.trim();
|
|
61982
|
+
}
|
|
61983
|
+
return getToolSummary(toolName, args ?? {});
|
|
61984
|
+
}
|
|
61985
|
+
function deriveApprovedActionLabel(approval) {
|
|
61986
|
+
return deriveActionLabel(approval.toolName, approval.args);
|
|
61987
|
+
}
|
|
61988
|
+
|
|
61989
|
+
// src/tui/components/shared/approval-prompt.tsx
|
|
61965
61990
|
import { jsxDEV as jsxDEV49 } from "@opentui/react/jsx-dev-runtime";
|
|
61966
61991
|
// src/tui/components/shared/message-reducer.ts
|
|
61967
61992
|
import { useReducer, useCallback as useCallback17, useMemo as useMemo20 } from "react";
|
|
@@ -61969,8 +61994,9 @@ import { useReducer, useCallback as useCallback17, useMemo as useMemo20 } from "
|
|
|
61969
61994
|
import { jsxDEV as jsxDEV50 } from "@opentui/react/jsx-dev-runtime";
|
|
61970
61995
|
function InlineApprovalPrompt2({ approval }) {
|
|
61971
61996
|
const { colors: colors2 } = useTheme();
|
|
61972
|
-
const
|
|
61997
|
+
const label = deriveApprovedActionLabel(approval);
|
|
61973
61998
|
const summary = getToolSummary(approval.toolName, approval.args || {});
|
|
61999
|
+
const showSummaryLine = summary !== label;
|
|
61974
62000
|
return /* @__PURE__ */ jsxDEV50("box", {
|
|
61975
62001
|
flexDirection: "row",
|
|
61976
62002
|
marginTop: 1,
|
|
@@ -61982,15 +62008,15 @@ function InlineApprovalPrompt2({ approval }) {
|
|
|
61982
62008
|
/* @__PURE__ */ jsxDEV50("box", {
|
|
61983
62009
|
flexDirection: "column",
|
|
61984
62010
|
children: [
|
|
61985
|
-
|
|
62011
|
+
/* @__PURE__ */ jsxDEV50("box", {
|
|
61986
62012
|
flexDirection: "row",
|
|
61987
|
-
marginBottom: 1,
|
|
62013
|
+
marginBottom: showSummaryLine ? 1 : 0,
|
|
61988
62014
|
children: /* @__PURE__ */ jsxDEV50("text", {
|
|
61989
62015
|
fg: colors2.text,
|
|
61990
|
-
content:
|
|
62016
|
+
content: label
|
|
61991
62017
|
}, undefined, false, undefined, this)
|
|
61992
62018
|
}, undefined, false, undefined, this),
|
|
61993
|
-
/* @__PURE__ */ jsxDEV50("box", {
|
|
62019
|
+
showSummaryLine && /* @__PURE__ */ jsxDEV50("box", {
|
|
61994
62020
|
flexDirection: "row",
|
|
61995
62021
|
gap: 1,
|
|
61996
62022
|
children: [
|
|
@@ -62039,7 +62065,7 @@ function InlineApprovalPrompt2({ approval }) {
|
|
|
62039
62065
|
}
|
|
62040
62066
|
|
|
62041
62067
|
// src/tui/components/chat/loading-indicator.tsx
|
|
62042
|
-
import { useState as useState33, useEffect as
|
|
62068
|
+
import { useState as useState33, useEffect as useEffect21, useRef as useRef16 } from "react";
|
|
62043
62069
|
import { jsxDEV as jsxDEV51 } from "@opentui/react/jsx-dev-runtime";
|
|
62044
62070
|
var SPINNER_FRAMES2 = ["⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"];
|
|
62045
62071
|
var SPINNER_INTERVAL2 = 80;
|
|
@@ -62053,13 +62079,14 @@ function LoadingIndicator({
|
|
|
62053
62079
|
const { colors: colors2 } = useTheme();
|
|
62054
62080
|
const [spinnerFrame, setSpinnerFrame] = useState33(0);
|
|
62055
62081
|
const [dotsFrame, setDotsFrame] = useState33(0);
|
|
62056
|
-
|
|
62082
|
+
const warnedIdsRef = useRef16(new Set);
|
|
62083
|
+
useEffect21(() => {
|
|
62057
62084
|
const interval2 = setInterval(() => {
|
|
62058
62085
|
setSpinnerFrame((f) => (f + 1) % SPINNER_FRAMES2.length);
|
|
62059
62086
|
}, SPINNER_INTERVAL2);
|
|
62060
62087
|
return () => clearInterval(interval2);
|
|
62061
62088
|
}, []);
|
|
62062
|
-
|
|
62089
|
+
useEffect21(() => {
|
|
62063
62090
|
const interval2 = setInterval(() => {
|
|
62064
62091
|
setDotsFrame((f) => (f + 1) % DOTS_FRAMES.length);
|
|
62065
62092
|
}, DOTS_INTERVAL);
|
|
@@ -62076,9 +62103,13 @@ function LoadingIndicator({
|
|
|
62076
62103
|
case "waiting":
|
|
62077
62104
|
return `Waiting for agents${dots}`;
|
|
62078
62105
|
case "executing":
|
|
62079
|
-
if (action) {
|
|
62106
|
+
if (action && !INTERNAL_ID_PATTERN.test(action)) {
|
|
62080
62107
|
return action;
|
|
62081
62108
|
}
|
|
62109
|
+
if (action && true && !warnedIdsRef.current.has(action)) {
|
|
62110
|
+
warnedIdsRef.current.add(action);
|
|
62111
|
+
console.warn(`[LoadingIndicator] internal correlation ID leaked into action prop: ${action}`);
|
|
62112
|
+
}
|
|
62082
62113
|
if (toolName) {
|
|
62083
62114
|
return `Running ${toolName}${dots}`;
|
|
62084
62115
|
}
|
|
@@ -62140,11 +62171,11 @@ function getLoadingState(messages, hasPendingTool, isLastAssistant, pendingToolN
|
|
|
62140
62171
|
}
|
|
62141
62172
|
return "thinking";
|
|
62142
62173
|
}
|
|
62143
|
-
function
|
|
62174
|
+
function getPendingToolInfo(messages) {
|
|
62144
62175
|
const recentMessages = messages.slice(-5);
|
|
62145
62176
|
for (const msg of recentMessages.reverse()) {
|
|
62146
|
-
if (isToolMessage(msg) && (msg.status === "pending" || msg.status === "streaming")) {
|
|
62147
|
-
return msg.toolName
|
|
62177
|
+
if (isToolMessage(msg) && (msg.status === "pending" || msg.status === "streaming") && msg.toolName) {
|
|
62178
|
+
return { toolName: msg.toolName, args: msg.args ?? {} };
|
|
62148
62179
|
}
|
|
62149
62180
|
}
|
|
62150
62181
|
return null;
|
|
@@ -62345,12 +62376,13 @@ function MessageList({
|
|
|
62345
62376
|
username
|
|
62346
62377
|
}, getStableMessageKey(msg, variant), false, undefined, this)),
|
|
62347
62378
|
isRunning && !hasPendingApproval && hasMessages && (() => {
|
|
62348
|
-
const
|
|
62349
|
-
const
|
|
62379
|
+
const pendingToolInfo = getPendingToolInfo(messages);
|
|
62380
|
+
const pendingToolName = pendingToolInfo?.toolName ?? null;
|
|
62381
|
+
const liveLabel = pendingToolInfo ? deriveActionLabel(pendingToolInfo.toolName, pendingToolInfo.args) : null;
|
|
62350
62382
|
return /* @__PURE__ */ jsxDEV52(LoadingIndicator, {
|
|
62351
|
-
state: getLoadingState(messages,
|
|
62352
|
-
action: lastApprovedAction,
|
|
62353
|
-
toolName:
|
|
62383
|
+
state: getLoadingState(messages, hasPendingTool || pendingToolName !== null, isLastAssistant, pendingToolName),
|
|
62384
|
+
action: liveLabel ?? lastApprovedAction,
|
|
62385
|
+
toolName: pendingToolName
|
|
62354
62386
|
}, undefined, false, undefined, this);
|
|
62355
62387
|
})(),
|
|
62356
62388
|
hasPendingApproval && /* @__PURE__ */ jsxDEV52(InlineApprovalPrompt2, {
|
|
@@ -63593,15 +63625,15 @@ var SubagentStatusBar = memo4(function SubagentStatusBar2({
|
|
|
63593
63625
|
// src/tui/components/operator-dashboard/subagent-dialog.tsx
|
|
63594
63626
|
import {
|
|
63595
63627
|
useState as useState36,
|
|
63596
|
-
useEffect as
|
|
63628
|
+
useEffect as useEffect23,
|
|
63597
63629
|
useMemo as useMemo22,
|
|
63598
|
-
useRef as
|
|
63630
|
+
useRef as useRef18,
|
|
63599
63631
|
useSyncExternalStore
|
|
63600
63632
|
} from "react";
|
|
63601
63633
|
import { useKeyboard as useKeyboard25 } from "@opentui/react";
|
|
63602
63634
|
|
|
63603
63635
|
// src/tui/components/operator-dashboard/subagent-hub.tsx
|
|
63604
|
-
import { useState as useState35, useEffect as
|
|
63636
|
+
import { useState as useState35, useEffect as useEffect22, useRef as useRef17, memo as memo5 } from "react";
|
|
63605
63637
|
import { useKeyboard as useKeyboard23 } from "@opentui/react";
|
|
63606
63638
|
import { jsxDEV as jsxDEV56 } from "@opentui/react/jsx-dev-runtime";
|
|
63607
63639
|
function sortSessions(sessions2) {
|
|
@@ -63737,17 +63769,17 @@ var SubagentHub = memo5(function SubagentHub2({
|
|
|
63737
63769
|
}) {
|
|
63738
63770
|
const { colors: colors2 } = useTheme();
|
|
63739
63771
|
const [focusedIndex, setFocusedIndex] = useState35(0);
|
|
63740
|
-
const scrollboxRef =
|
|
63741
|
-
const sortedRef =
|
|
63772
|
+
const scrollboxRef = useRef17(null);
|
|
63773
|
+
const sortedRef = useRef17(sorted);
|
|
63742
63774
|
sortedRef.current = sorted;
|
|
63743
|
-
|
|
63775
|
+
useEffect22(() => {
|
|
63744
63776
|
if (sorted.length === 0) {
|
|
63745
63777
|
setFocusedIndex(0);
|
|
63746
63778
|
} else if (focusedIndex >= sorted.length) {
|
|
63747
63779
|
setFocusedIndex(sorted.length - 1);
|
|
63748
63780
|
}
|
|
63749
63781
|
}, [sorted.length, focusedIndex]);
|
|
63750
|
-
|
|
63782
|
+
useEffect22(() => {
|
|
63751
63783
|
scrollToIndex(scrollboxRef.current, focusedIndex, sortedRef.current, (s) => s.id);
|
|
63752
63784
|
}, [focusedIndex]);
|
|
63753
63785
|
useKeyboard23((key) => {
|
|
@@ -63873,10 +63905,10 @@ function SubagentDialog({ store }) {
|
|
|
63873
63905
|
const { colors: colors2 } = useTheme();
|
|
63874
63906
|
const { setSize, clear } = useDialog();
|
|
63875
63907
|
const [view, setView] = useState36({ type: "hub" });
|
|
63876
|
-
const viewRef =
|
|
63908
|
+
const viewRef = useRef18(view);
|
|
63877
63909
|
viewRef.current = view;
|
|
63878
63910
|
const sessions2 = useSyncExternalStore(store.subscribe, store.getSnapshot);
|
|
63879
|
-
|
|
63911
|
+
useEffect23(() => {
|
|
63880
63912
|
setSize(view.type === "detail" ? "xlarge" : "large");
|
|
63881
63913
|
}, [view.type, setSize]);
|
|
63882
63914
|
const sorted = useMemo22(() => sortSessions(Array.from(sessions2.values())), [sessions2]);
|
|
@@ -64032,24 +64064,24 @@ function OperatorDashboard({
|
|
|
64032
64064
|
return [...commandOptions, ...operatorOnlyOptions, ...skillOptions];
|
|
64033
64065
|
}, [allAutocompleteOptions, skillsRegistry, skillsVersion]);
|
|
64034
64066
|
const [session, setSession] = useState37(null);
|
|
64035
|
-
const sessionRef =
|
|
64067
|
+
const sessionRef = useRef19(null);
|
|
64036
64068
|
sessionRef.current = session;
|
|
64037
64069
|
const [loading, setLoading] = useState37(true);
|
|
64038
64070
|
const [error, setError] = useState37(null);
|
|
64039
|
-
const pendingNameRef =
|
|
64071
|
+
const pendingNameRef = useRef19(null);
|
|
64040
64072
|
const [status, setStatus] = useState37("idle");
|
|
64041
|
-
const abortControllerRef =
|
|
64042
|
-
const generationRef =
|
|
64043
|
-
const cancelHandleRef =
|
|
64073
|
+
const abortControllerRef = useRef19(null);
|
|
64074
|
+
const generationRef = useRef19(0);
|
|
64075
|
+
const cancelHandleRef = useRef19({
|
|
64044
64076
|
cancel: () => false
|
|
64045
64077
|
});
|
|
64046
|
-
const commandCancelledRef =
|
|
64078
|
+
const commandCancelledRef = useRef19(false);
|
|
64047
64079
|
const subagentStore = useMemo23(() => createSubagentStore(), []);
|
|
64048
64080
|
const subagentSessions = useSyncExternalStore2(subagentStore.subscribe, subagentStore.getSnapshot);
|
|
64049
64081
|
const subagentHelpers = useMemo23(() => createSubagentSessionHelpers(subagentStore.setState), [subagentStore]);
|
|
64050
|
-
const messageCountAtSubagentDoneRef =
|
|
64082
|
+
const messageCountAtSubagentDoneRef = useRef19(null);
|
|
64051
64083
|
const hasRunningSubagent = useMemo23(() => Array.from(subagentSessions.values()).some((s) => s.status === "running"), [subagentSessions]);
|
|
64052
|
-
|
|
64084
|
+
useEffect24(() => {
|
|
64053
64085
|
if (subagentSessions.size > 0 && !hasRunningSubagent) {
|
|
64054
64086
|
if (messageCountAtSubagentDoneRef.current === null) {
|
|
64055
64087
|
messageCountAtSubagentDoneRef.current = displayMessagesRef.current.length;
|
|
@@ -64067,15 +64099,15 @@ function OperatorDashboard({
|
|
|
64067
64099
|
});
|
|
64068
64100
|
}, [replaceDialog, subagentStore]);
|
|
64069
64101
|
const [messages, setMessages] = useState37([]);
|
|
64070
|
-
const displayMessagesRef =
|
|
64102
|
+
const displayMessagesRef = useRef19([]);
|
|
64071
64103
|
displayMessagesRef.current = messages;
|
|
64072
|
-
const textRef =
|
|
64073
|
-
const conversationRef =
|
|
64104
|
+
const textRef = useRef19("");
|
|
64105
|
+
const conversationRef = useRef19([]);
|
|
64074
64106
|
const [inputValue, setInputValue] = useState37("");
|
|
64075
64107
|
const [queuedMessages, setQueuedMessages] = useState37([]);
|
|
64076
64108
|
const [selectedQueueIndex, setSelectedQueueIndex] = useState37(-1);
|
|
64077
|
-
const queuedMessagesRef =
|
|
64078
|
-
|
|
64109
|
+
const queuedMessagesRef = useRef19([]);
|
|
64110
|
+
useEffect24(() => {
|
|
64079
64111
|
queuedMessagesRef.current = queuedMessages;
|
|
64080
64112
|
if (queuedMessages.length === 0) {
|
|
64081
64113
|
setSelectedQueueIndex(-1);
|
|
@@ -64084,7 +64116,7 @@ function OperatorDashboard({
|
|
|
64084
64116
|
}
|
|
64085
64117
|
}, [queuedMessages, selectedQueueIndex]);
|
|
64086
64118
|
const [operatorState, setOperatorState] = useState37(() => createInitialOperatorState("manual", true));
|
|
64087
|
-
const approvalGateRef =
|
|
64119
|
+
const approvalGateRef = useRef19(new ApprovalGate({
|
|
64088
64120
|
requireApproval: (initialConfig?.operatorMode ?? "manual") === "manual"
|
|
64089
64121
|
}));
|
|
64090
64122
|
const [pendingApprovals, setPendingApprovals] = useState37([]);
|
|
@@ -64096,35 +64128,36 @@ function OperatorDashboard({
|
|
|
64096
64128
|
const requireApproval = operatorMode === "manual";
|
|
64097
64129
|
const [approvedPlanContent, setApprovedPlanContent] = useState37(null);
|
|
64098
64130
|
const [showPlanReview, setShowPlanReview] = useState37(false);
|
|
64099
|
-
const planSubmittedRef =
|
|
64100
|
-
const planRejectedRef =
|
|
64101
|
-
const planApprovedPendingRunRef =
|
|
64131
|
+
const planSubmittedRef = useRef19(false);
|
|
64132
|
+
const planRejectedRef = useRef19(false);
|
|
64133
|
+
const planApprovedPendingRunRef = useRef19(false);
|
|
64102
64134
|
const [pendingQuestions, setPendingQuestions] = useState37(null);
|
|
64103
|
-
const pendingToolCallIdRef =
|
|
64104
|
-
const operatorModeRef =
|
|
64105
|
-
|
|
64135
|
+
const pendingToolCallIdRef = useRef19(null);
|
|
64136
|
+
const operatorModeRef = useRef19(operatorMode);
|
|
64137
|
+
useEffect24(() => {
|
|
64106
64138
|
operatorModeRef.current = operatorMode;
|
|
64107
64139
|
}, [operatorMode]);
|
|
64108
|
-
const approvedPlanRef =
|
|
64109
|
-
|
|
64140
|
+
const approvedPlanRef = useRef19(approvedPlanContent);
|
|
64141
|
+
useEffect24(() => {
|
|
64110
64142
|
approvedPlanRef.current = approvedPlanContent;
|
|
64111
64143
|
}, [approvedPlanContent]);
|
|
64112
|
-
const tokenUsageRef =
|
|
64113
|
-
|
|
64144
|
+
const tokenUsageRef = useRef19(tokenUsage);
|
|
64145
|
+
useEffect24(() => {
|
|
64114
64146
|
tokenUsageRef.current = tokenUsage;
|
|
64115
64147
|
}, [tokenUsage]);
|
|
64116
|
-
|
|
64148
|
+
useEffect24(() => {
|
|
64117
64149
|
const gate = approvalGateRef.current;
|
|
64118
64150
|
const onApprovalNeeded = () => {
|
|
64119
64151
|
setPendingApprovals(gate.getPendingApprovals());
|
|
64120
64152
|
setStatus("waiting");
|
|
64121
64153
|
};
|
|
64122
64154
|
const onApprovalResolved = (event) => {
|
|
64123
|
-
|
|
64155
|
+
const pending = gate.getPendingApprovals();
|
|
64156
|
+
setPendingApprovals(pending);
|
|
64124
64157
|
if (event.decision === "approved") {
|
|
64125
|
-
setLastApprovedAction(event.
|
|
64158
|
+
setLastApprovedAction(deriveApprovedActionLabel(event.approval));
|
|
64126
64159
|
}
|
|
64127
|
-
if (
|
|
64160
|
+
if (pending.length === 0) {
|
|
64128
64161
|
setStatus("running");
|
|
64129
64162
|
}
|
|
64130
64163
|
};
|
|
@@ -64135,7 +64168,7 @@ function OperatorDashboard({
|
|
|
64135
64168
|
gate.off("approval-resolved", onApprovalResolved);
|
|
64136
64169
|
};
|
|
64137
64170
|
}, []);
|
|
64138
|
-
|
|
64171
|
+
useEffect24(() => {
|
|
64139
64172
|
async function loadSession() {
|
|
64140
64173
|
try {
|
|
64141
64174
|
if (sessionId) {
|
|
@@ -64210,15 +64243,15 @@ function OperatorDashboard({
|
|
|
64210
64243
|
}
|
|
64211
64244
|
loadSession();
|
|
64212
64245
|
}, [sessionId]);
|
|
64213
|
-
|
|
64246
|
+
useEffect24(() => {
|
|
64214
64247
|
return () => setSessionCwd(null);
|
|
64215
64248
|
}, [setSessionCwd]);
|
|
64216
|
-
|
|
64249
|
+
useEffect24(() => {
|
|
64217
64250
|
if (!loading) {
|
|
64218
64251
|
refocusPrompt();
|
|
64219
64252
|
}
|
|
64220
64253
|
}, [loading, refocusPrompt]);
|
|
64221
|
-
|
|
64254
|
+
useEffect24(() => {
|
|
64222
64255
|
if (!session || !sessionId)
|
|
64223
64256
|
return;
|
|
64224
64257
|
resetTokenUsage();
|
|
@@ -64262,7 +64295,7 @@ function OperatorDashboard({
|
|
|
64262
64295
|
];
|
|
64263
64296
|
});
|
|
64264
64297
|
}, []);
|
|
64265
|
-
const toolArgsDeltaRef =
|
|
64298
|
+
const toolArgsDeltaRef = useRef19(new Map);
|
|
64266
64299
|
const addStreamingToolCall = useCallback18((toolCallId, toolName) => {
|
|
64267
64300
|
textRef.current = "";
|
|
64268
64301
|
toolArgsDeltaRef.current.set(toolCallId, {
|
|
@@ -64344,8 +64377,8 @@ function OperatorDashboard({
|
|
|
64344
64377
|
return updated;
|
|
64345
64378
|
});
|
|
64346
64379
|
}, []);
|
|
64347
|
-
const cmdOutputBufRef =
|
|
64348
|
-
const cmdFlushTimerRef =
|
|
64380
|
+
const cmdOutputBufRef = useRef19("");
|
|
64381
|
+
const cmdFlushTimerRef = useRef19(null);
|
|
64349
64382
|
const MAX_LOG_LINES = 200;
|
|
64350
64383
|
const flushCommandOutput = useCallback18(() => {
|
|
64351
64384
|
const buf = cmdOutputBufRef.current;
|
|
@@ -64385,7 +64418,7 @@ function OperatorDashboard({
|
|
|
64385
64418
|
}, 150);
|
|
64386
64419
|
}
|
|
64387
64420
|
}, [flushCommandOutput]);
|
|
64388
|
-
|
|
64421
|
+
useEffect24(() => {
|
|
64389
64422
|
return () => {
|
|
64390
64423
|
if (cmdFlushTimerRef.current) {
|
|
64391
64424
|
clearInterval(cmdFlushTimerRef.current);
|
|
@@ -64911,17 +64944,17 @@ Error: ${errMsg}
|
|
|
64911
64944
|
setInputValue("");
|
|
64912
64945
|
runAgent(result.prompt);
|
|
64913
64946
|
}, [status, runAgent]);
|
|
64914
|
-
const initialMessageSentRef =
|
|
64915
|
-
const runAgentRef =
|
|
64947
|
+
const initialMessageSentRef = useRef19(false);
|
|
64948
|
+
const runAgentRef = useRef19(runAgent);
|
|
64916
64949
|
runAgentRef.current = runAgent;
|
|
64917
|
-
|
|
64950
|
+
useEffect24(() => {
|
|
64918
64951
|
if (!loading && initialMessage && !initialMessageSentRef.current) {
|
|
64919
64952
|
initialMessageSentRef.current = true;
|
|
64920
64953
|
runAgentRef.current(initialMessage);
|
|
64921
64954
|
}
|
|
64922
64955
|
}, [loading, initialMessage]);
|
|
64923
|
-
const initialSkillSentRef =
|
|
64924
|
-
|
|
64956
|
+
const initialSkillSentRef = useRef19(false);
|
|
64957
|
+
useEffect24(() => {
|
|
64925
64958
|
if (loading || initialSkillSentRef.current)
|
|
64926
64959
|
return;
|
|
64927
64960
|
const routeData = route.data;
|
|
@@ -65009,7 +65042,7 @@ ${content}
|
|
|
65009
65042
|
}
|
|
65010
65043
|
})();
|
|
65011
65044
|
}, [loading, route.data, skillsRegistry]);
|
|
65012
|
-
|
|
65045
|
+
useEffect24(() => {
|
|
65013
65046
|
if (status !== "idle")
|
|
65014
65047
|
return;
|
|
65015
65048
|
const queue = queuedMessagesRef.current;
|
|
@@ -65020,7 +65053,7 @@ ${content}
|
|
|
65020
65053
|
setSelectedQueueIndex(-1);
|
|
65021
65054
|
runAgentRef.current(next);
|
|
65022
65055
|
}, [status]);
|
|
65023
|
-
|
|
65056
|
+
useEffect24(() => {
|
|
65024
65057
|
if (!planApprovedPendingRunRef.current)
|
|
65025
65058
|
return;
|
|
65026
65059
|
if (operatorMode === "plan")
|
|
@@ -65435,8 +65468,8 @@ ${planContent}` : "No plan exists yet. Switch to plan mode (Shift+Tab) to create
|
|
|
65435
65468
|
return;
|
|
65436
65469
|
}
|
|
65437
65470
|
});
|
|
65438
|
-
const planReviewInjectedRef =
|
|
65439
|
-
|
|
65471
|
+
const planReviewInjectedRef = useRef19(false);
|
|
65472
|
+
useEffect24(() => {
|
|
65440
65473
|
if (!showPlanReview) {
|
|
65441
65474
|
planReviewInjectedRef.current = false;
|
|
65442
65475
|
return;
|
|
@@ -65606,7 +65639,7 @@ ${planContent}` : "No plan exists yet. Switch to plan mode (Shift+Tab) to create
|
|
|
65606
65639
|
}
|
|
65607
65640
|
|
|
65608
65641
|
// src/tui/components/commands/theme-picker.tsx
|
|
65609
|
-
import { useState as useState38, useCallback as useCallback19, useRef as
|
|
65642
|
+
import { useState as useState38, useCallback as useCallback19, useRef as useRef20 } from "react";
|
|
65610
65643
|
import { useKeyboard as useKeyboard27 } from "@opentui/react";
|
|
65611
65644
|
import { jsxDEV as jsxDEV60 } from "@opentui/react/jsx-dev-runtime";
|
|
65612
65645
|
function ThemePicker({ onClose }) {
|
|
@@ -65621,8 +65654,8 @@ function ThemePicker({ onClose }) {
|
|
|
65621
65654
|
setMode
|
|
65622
65655
|
} = useTheme();
|
|
65623
65656
|
const [selectedIndex, setSelectedIndex] = useState38(() => Math.max(0, availableThemes.indexOf(theme.name)));
|
|
65624
|
-
const originalThemeRef =
|
|
65625
|
-
const originalModeRef =
|
|
65657
|
+
const originalThemeRef = useRef20(theme.name);
|
|
65658
|
+
const originalModeRef = useRef20(mode);
|
|
65626
65659
|
const handleClose = useCallback19(() => {
|
|
65627
65660
|
setTheme(originalThemeRef.current);
|
|
65628
65661
|
setMode(originalModeRef.current);
|
|
@@ -65744,7 +65777,7 @@ function ThemePicker({ onClose }) {
|
|
|
65744
65777
|
}
|
|
65745
65778
|
|
|
65746
65779
|
// src/tui/components/commands/skills-dialog.tsx
|
|
65747
|
-
import { useState as useState39, useMemo as useMemo24, useEffect as
|
|
65780
|
+
import { useState as useState39, useMemo as useMemo24, useEffect as useEffect25, useRef as useRef21 } from "react";
|
|
65748
65781
|
import { useKeyboard as useKeyboard28 } from "@opentui/react";
|
|
65749
65782
|
import { jsxDEV as jsxDEV61 } from "@opentui/react/jsx-dev-runtime";
|
|
65750
65783
|
function estimateTokens(text) {
|
|
@@ -65764,7 +65797,7 @@ function SkillsDialog({
|
|
|
65764
65797
|
const { skillsRegistry } = useCommand();
|
|
65765
65798
|
const { toast } = useToast();
|
|
65766
65799
|
const [selectedIndex, setSelectedIndex] = useState39(0);
|
|
65767
|
-
const scrollboxRef =
|
|
65800
|
+
const scrollboxRef = useRef21(null);
|
|
65768
65801
|
const [detailSkill, setDetailSkill] = useState39(() => {
|
|
65769
65802
|
if (initialSlug) {
|
|
65770
65803
|
const entry = skillsRegistry.get(initialSlug);
|
|
@@ -65773,7 +65806,7 @@ function SkillsDialog({
|
|
|
65773
65806
|
return null;
|
|
65774
65807
|
});
|
|
65775
65808
|
const [detailInstructions, setDetailInstructions] = useState39(null);
|
|
65776
|
-
|
|
65809
|
+
useEffect25(() => {
|
|
65777
65810
|
if (!detailSkill) {
|
|
65778
65811
|
setDetailInstructions(null);
|
|
65779
65812
|
return;
|
|
@@ -65844,7 +65877,7 @@ function SkillsDialog({
|
|
|
65844
65877
|
}
|
|
65845
65878
|
});
|
|
65846
65879
|
const safeIndex = Math.max(0, Math.min(selectedIndex, flatList.length - 1));
|
|
65847
|
-
|
|
65880
|
+
useEffect25(() => {
|
|
65848
65881
|
scrollToIndex(scrollboxRef.current, safeIndex, flatList, (skill) => skill.slug);
|
|
65849
65882
|
}, [safeIndex, flatList]);
|
|
65850
65883
|
const syntaxStyle = useMarkdownSyntaxStyle();
|
|
@@ -69083,7 +69116,7 @@ async function detectTerminalMode(timeoutMs = 1000) {
|
|
|
69083
69116
|
}
|
|
69084
69117
|
|
|
69085
69118
|
// src/tui/console-theme.ts
|
|
69086
|
-
import { useEffect as
|
|
69119
|
+
import { useEffect as useEffect26 } from "react";
|
|
69087
69120
|
import { useRenderer as useRenderer4 } from "@opentui/react";
|
|
69088
69121
|
import { RGBA as RGBA25 } from "@opentui/core";
|
|
69089
69122
|
var withAlpha2 = (rgba, a) => RGBA25.fromValues(rgba.r, rgba.g, rgba.b, a);
|
|
@@ -69108,7 +69141,7 @@ function buildConsoleOptions(themeColors) {
|
|
|
69108
69141
|
function ConsoleThemeSync() {
|
|
69109
69142
|
const { colors: colors2 } = useTheme();
|
|
69110
69143
|
const renderer = useRenderer4();
|
|
69111
|
-
|
|
69144
|
+
useEffect26(() => {
|
|
69112
69145
|
overlayThemeRef.current = colors2;
|
|
69113
69146
|
const c = renderer.console;
|
|
69114
69147
|
c.backgroundColor = withAlpha2(colors2.backgroundPanel, 0.85);
|
|
@@ -69195,12 +69228,12 @@ function setupAutoCopy(renderer, copyToClipboard) {
|
|
|
69195
69228
|
}
|
|
69196
69229
|
|
|
69197
69230
|
// src/tui/components/terminal-focus-handler.tsx
|
|
69198
|
-
import { useEffect as
|
|
69231
|
+
import { useEffect as useEffect27 } from "react";
|
|
69199
69232
|
import { useRenderer as useRenderer5 } from "@opentui/react";
|
|
69200
69233
|
function TerminalFocusHandler() {
|
|
69201
69234
|
const { refocusPrompt } = useFocus();
|
|
69202
69235
|
const renderer = useRenderer5();
|
|
69203
|
-
|
|
69236
|
+
useEffect27(() => {
|
|
69204
69237
|
const cleanup = setupTerminalFocusHandling(renderer, {
|
|
69205
69238
|
onTerminalFocus: refocusPrompt,
|
|
69206
69239
|
debug: false
|
|
@@ -69353,21 +69386,21 @@ function AppContent({
|
|
|
69353
69386
|
const { refocusPrompt } = useFocus();
|
|
69354
69387
|
const { setExternalDialogOpen } = useDialog();
|
|
69355
69388
|
const [returnToCredits, setReturnToCredits] = useState40(false);
|
|
69356
|
-
|
|
69389
|
+
useEffect28(() => {
|
|
69357
69390
|
checkForUpdate().then(({ updateAvailable, currentVersion, latestVersion }) => {
|
|
69358
69391
|
if (!updateAvailable)
|
|
69359
69392
|
return;
|
|
69360
69393
|
toast(`Update available: v${currentVersion} → v${latestVersion}. Run: pensar upgrade`, "warn", 8000);
|
|
69361
69394
|
});
|
|
69362
69395
|
const checkAuthToken = async () => {
|
|
69363
|
-
const { isTokenExpired, isConnected: isConnected2 } = await import("./index-
|
|
69396
|
+
const { isTokenExpired, isConnected: isConnected2 } = await import("./index-f6w6vdtj.js");
|
|
69364
69397
|
if (isConnected2(config2.data) && config2.data.accessToken && isTokenExpired(config2.data.accessToken, 60) && !config2.data.refreshToken && !config2.data.pensarAPIKey) {
|
|
69365
69398
|
toast("Your Pensar Console session has expired. Run /login to refresh.", "warn", 8000);
|
|
69366
69399
|
}
|
|
69367
69400
|
};
|
|
69368
69401
|
checkAuthToken();
|
|
69369
69402
|
}, []);
|
|
69370
|
-
|
|
69403
|
+
useEffect28(() => {
|
|
69371
69404
|
if (route.data.type !== "base")
|
|
69372
69405
|
return;
|
|
69373
69406
|
if (!config2.data.responsibleUseAccepted && route.data.path !== "disclosure") {
|
|
@@ -69377,7 +69410,7 @@ function AppContent({
|
|
|
69377
69410
|
}
|
|
69378
69411
|
}, [config2.data.responsibleUseAccepted, route.data]);
|
|
69379
69412
|
const anyExternalDialog = showThemeDialog || showModelDialog || showProvidersDialog || showCreditsDialog || showHelpDialog || showAuthDialog || showPentestDialog || showSkillsDialog;
|
|
69380
|
-
|
|
69413
|
+
useEffect28(() => {
|
|
69381
69414
|
if (anyExternalDialog) {
|
|
69382
69415
|
setExternalDialogOpen(true);
|
|
69383
69416
|
} else {
|
|
@@ -69385,7 +69418,7 @@ function AppContent({
|
|
|
69385
69418
|
return () => clearTimeout(timer);
|
|
69386
69419
|
}
|
|
69387
69420
|
}, [anyExternalDialog]);
|
|
69388
|
-
|
|
69421
|
+
useEffect28(() => {
|
|
69389
69422
|
if (showExitWarning) {
|
|
69390
69423
|
const timer = setTimeout(() => {
|
|
69391
69424
|
setShowExitWarning(false);
|
|
@@ -9,15 +9,15 @@ import {
|
|
|
9
9
|
signGatewayRequest,
|
|
10
10
|
startDeviceFlow,
|
|
11
11
|
validateGateway
|
|
12
|
-
} from "./cli-
|
|
12
|
+
} from "./cli-p8zdr5yc.js";
|
|
13
13
|
import {
|
|
14
14
|
ensureValidToken,
|
|
15
15
|
fetchWorkOSClientId,
|
|
16
16
|
isTokenExpired,
|
|
17
17
|
refreshAccessToken
|
|
18
|
-
} from "./cli-
|
|
19
|
-
import"./cli-
|
|
20
|
-
import"./cli-
|
|
18
|
+
} from "./cli-1aswmqw0.js";
|
|
19
|
+
import"./cli-zvjf2zxh.js";
|
|
20
|
+
import"./cli-mqp1725p.js";
|
|
21
21
|
import"./cli-8rxa073f.js";
|
|
22
22
|
export {
|
|
23
23
|
validateGateway,
|