nolo-cli 0.183.0-alpha.1 → 0.185.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{_executeModel-YYVG3FYU.js → _executeModel-5SGPPCT6.js} +19 -19
- package/{accountResolver-HPVXZJYD.js → accountResolver-NQJ57BVU.js} +1 -1
- package/{agentDeleteCommand-EOU67KBO.js → agentDeleteCommand-BCCSKYLM.js} +23 -23
- package/{agentEmailCommands-HEQLXSP6.js → agentEmailCommands-W5QGS7GJ.js} +24 -24
- package/{agentListCommands-4QUON7JZ.js → agentListCommands-OCQ6JTT5.js} +12 -12
- package/{agentMachineCommands-53GH4CDQ.js → agentMachineCommands-QHBMZYFX.js} +8 -8
- package/{agentRecordCommands-XXN5V3AX.js → agentRecordCommands-UVPX52OJ.js} +23 -23
- package/{agentRunCommand-ZUM5E3UV.js → agentRunCommand-5UDWFHFQ.js} +24 -24
- package/{agentRuntimeLocal-ECGPI3CO.js → agentRuntimeLocal-CBDP2OYK.js} +5 -5
- package/{agentSlice-MS5G7UCC.js → agentSlice-2PEJP3NV.js} +1 -1
- package/{appDeleteCommands-UHH52BCJ.js → appDeleteCommands-ZHRMHUN2.js} +10 -10
- package/{appDeployCommands-Z42ILX24.js → appDeployCommands-KECT5OVJ.js} +10 -10
- package/{appDeployStatusCommands-COYNEUSI.js → appDeployStatusCommands-L6IUZHLH.js} +10 -10
- package/{appGetCommands-35XXIRZJ.js → appGetCommands-Z5SPTOED.js} +10 -10
- package/{appListCommands-CIUEMKRJ.js → appListCommands-JVET3ZQ4.js} +10 -10
- package/{authCommand-AX23Q2Q5.js → authCommand-QHIRCCHQ.js} +2 -2
- package/{builtinSkillRegistry-HJCSXMKS.js → builtinSkillRegistry-RR35BY57.js} +4 -4
- package/{chromeCommands-BGL6JZMB.js → chromeCommands-EXJZ5HH5.js} +2 -2
- package/{chromeOpsCommands-2KFQEE3H.js → chromeOpsCommands-DCIUHXOK.js} +27 -2
- package/{chunk-ONFC3RLP.js → chunk-3FHLLDI6.js} +10 -15
- package/{chunk-NCVSRB7F.js → chunk-3RL3CUVL.js} +12 -15
- package/{chunk-JWSHARJM.js → chunk-7DPEOMDL.js} +7 -7
- package/{chunk-NRYTWXXV.js → chunk-7XISFN2T.js} +1 -1
- package/{chunk-HWJZEUA6.js → chunk-7YW5OUQE.js} +3 -3
- package/{chunk-NHBJHDVW.js → chunk-AKE53VMW.js} +1 -1
- package/{chunk-C3BYVRTJ.js → chunk-BJPALUYR.js} +2 -2
- package/{chunk-G5LNJZJH.js → chunk-CVHB44VO.js} +2 -2
- package/{chunk-PS3GU7YU.js → chunk-CWLKTRCI.js} +560 -3
- package/{chunk-5ROGGWPM.js → chunk-D4JCY67U.js} +14 -14
- package/{chunk-MHC44FKA.js → chunk-DBEIHUCJ.js} +3 -3
- package/{chunk-WPWAD6NT.js → chunk-DWTNJZ63.js} +2 -2
- package/{chunk-J2EVUNED.js → chunk-EFPGYWIN.js} +2 -2
- package/{chunk-3FTJG5NU.js → chunk-FKOCI2WR.js} +1 -1
- package/{chunk-MMSZKZWA.js → chunk-FSIJK37C.js} +1 -1
- package/{chunk-7AVKDSWD.js → chunk-HRLKX6YP.js} +1 -1
- package/{chunk-GTQKUQGF.js → chunk-IHQ7RMRS.js} +1 -1
- package/{chunk-FO2BTDKY.js → chunk-IOQHM7ID.js} +4 -4
- package/{chunk-F2P6YUHC.js → chunk-K3TVMCV3.js} +1 -1
- package/{chunk-P7JNYLDW.js → chunk-KHMJI7GE.js} +1 -1
- package/{chunk-ORYQ2GDN.js → chunk-MIPGIRJJ.js} +3 -3
- package/{chunk-FAFNPFGS.js → chunk-MROMTEHV.js} +7 -7
- package/{chunk-5DVM4RIR.js → chunk-NCC2SYOD.js} +3 -3
- package/{chunk-ADF4RAQS.js → chunk-P54WWWQL.js} +2 -2
- package/{chunk-MO6NDG3O.js → chunk-QBJYZEXZ.js} +5 -5
- package/{chunk-TQU64H2A.js → chunk-QEGPFGKA.js} +2 -2
- package/{chunk-WGHIT2HH.js → chunk-VXCDYN6M.js} +8 -8
- package/{chunk-FUW33OOI.js → chunk-YDD6QMEG.js} +287 -16
- package/{chunk-53HMDUG6.js → chunk-YI75FYBS.js} +1 -1
- package/{chunk-AWFDDOVW.js → chunk-YVAERPCH.js} +3 -3
- package/{chunk-GKKIZRJ6.js → chunk-YXTMZQGX.js} +11 -2
- package/{chunk-3PVH6HJG.js → chunk-YXTQJ2QR.js} +3 -3
- package/{chunk-MPIAKYZ7.js → chunk-YYKHIX4X.js} +1 -1
- package/{chunk-JX5XVFVW.js → chunk-ZC3CMUKU.js} +27 -3
- package/{chunk-B3BTDNEC.js → chunk-ZU2BF6Q4.js} +5 -5
- package/{chunk-DHMXTEM4.js → chunk-ZYI6K46I.js} +2 -2
- package/{chunk-TXJZ7QXG.js → chunk-ZZE2IJ5U.js} +2 -2
- package/{commandRegistry-VVY2YPUI.js → commandRegistry-BMWJLKA4.js} +65 -61
- package/{contentThunks-EWOORWBS.js → contentThunks-BSCTL5G3.js} +3 -3
- package/{cooldownCommands-QFV3ERZX.js → cooldownCommands-PRIJS6OJ.js} +1 -1
- package/{createAgentAutomationAction-TRIAQUAK.js → createAgentAutomationAction-Y5W2FW3Y.js} +3 -3
- package/{createDialogAction-FXPXXDRR.js → createDialogAction-GIZ7QCRQ.js} +6 -6
- package/{createPageAction-HHFPJKBD.js → createPageAction-GFH4DXMX.js} +3 -3
- package/{dialogCommands-6Z27OC2B.js → dialogCommands-2UADPK7U.js} +11 -9
- package/{dialogSlice-4W7DJJC2.js → dialogSlice-U3X3CBR7.js} +2 -2
- package/{docCreateCommands-EBLE6KZA.js → docCreateCommands-QBPVKQ2I.js} +9 -9
- package/{docDeleteCommands-7JONZ5PW.js → docDeleteCommands-NWVGJUVN.js} +10 -10
- package/{docReadCommands-NI4LTXAV.js → docReadCommands-2LG22OYA.js} +9 -9
- package/{docStore-VBINJLRX.js → docStore-H2XCYODR.js} +1 -1
- package/{docUpdateCommands-QF4J5XQI.js → docUpdateCommands-2NXP2A2G.js} +9 -9
- package/{handleSendMessageAction-FJKTVMCA.js → handleSendMessageAction-MZKFIPYL.js} +11 -11
- package/index.js +6 -6
- package/{localRuntimeAdapter-QZNQNL2X.js → localRuntimeAdapter-FOP7DG3L.js} +21 -21
- package/{machineCommands-53PSUEW7.js → machineCommands-7M23LIZG.js} +22 -22
- package/{machineWsRunDispatch-JNNSLAOT.js → machineWsRunDispatch-SZY7GGSH.js} +22 -22
- package/package.json +1 -1
- package/{readlineWorkspace-46TGVQQ7.js → readlineWorkspace-7ENOVLKC.js} +242 -33
- package/{runAgentClientLoop-KV6R3FSU.js → runAgentClientLoop-JRW5EA5U.js} +17 -17
- package/{secretCommands-XEQLKDB4.js → secretCommands-S7IIU5Q3.js} +1 -1
- package/{spaceCommands-CIXBPVEY.js → spaceCommands-PHLKQ2AW.js} +8 -8
- package/{streamAgentChatTurn-RTQ2DU4K.js → streamAgentChatTurn-CBGAGRQL.js} +19 -19
- package/{tools-R6JLL5PS.js → tools-RVVZ2Y6V.js} +13 -13
- package/{updateCommands-KDYX32JR.js → updateCommands-QW27XJ6K.js} +3 -3
- package/{updateDialogTitleAction-2QNU4T4I.js → updateDialogTitleAction-2RKLYUPB.js} +3 -3
- package/{windowsSelfUpdate-IYQK4IDS.js → windowsSelfUpdate-G2A2JXXX.js} +2 -2
|
@@ -17,14 +17,14 @@ import {
|
|
|
17
17
|
createChromeConnectorClientResolver,
|
|
18
18
|
createVerifiedChromeConnectorClient,
|
|
19
19
|
executeChromeConnectorTool
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-YXTMZQGX.js";
|
|
21
21
|
import {
|
|
22
22
|
defaultLoopbackRequest
|
|
23
23
|
} from "./chunk-VP3BINY7.js";
|
|
24
24
|
import {
|
|
25
25
|
OAUTH_PROVIDER_REFS,
|
|
26
26
|
buildLocalAgentLookupKeys
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-YYKHIX4X.js";
|
|
28
28
|
import {
|
|
29
29
|
LOCAL_CODEX_AGENT_ID,
|
|
30
30
|
LOCAL_CODEX_AGENT_KEY,
|
|
@@ -60,7 +60,7 @@ import {
|
|
|
60
60
|
import {
|
|
61
61
|
inlineImageUrlsForCustomProvider,
|
|
62
62
|
prepareTools
|
|
63
|
-
} from "./chunk-
|
|
63
|
+
} from "./chunk-NCC2SYOD.js";
|
|
64
64
|
import {
|
|
65
65
|
getServerProviderSecret
|
|
66
66
|
} from "./chunk-HS7MLR74.js";
|
|
@@ -82,18 +82,18 @@ import {
|
|
|
82
82
|
resolveCliLocalRuntimeKeyCapability,
|
|
83
83
|
resolveCliLocalSpawnDispatch,
|
|
84
84
|
resolveStartAgentRunCwd
|
|
85
|
-
} from "./chunk-
|
|
85
|
+
} from "./chunk-D4JCY67U.js";
|
|
86
86
|
import {
|
|
87
87
|
deriveCredentialGroup,
|
|
88
88
|
deriveCustomProviderCredentialGroup
|
|
89
|
-
} from "./chunk-
|
|
89
|
+
} from "./chunk-KHMJI7GE.js";
|
|
90
90
|
import {
|
|
91
91
|
fetchWithTransientRetry,
|
|
92
92
|
isTransientFetchError
|
|
93
93
|
} from "./chunk-KFHREHUQ.js";
|
|
94
94
|
import {
|
|
95
95
|
resolveAgentRequiredPackIds
|
|
96
|
-
} from "./chunk-
|
|
96
|
+
} from "./chunk-7YW5OUQE.js";
|
|
97
97
|
import {
|
|
98
98
|
getDefaultCliLocalRuntimeDb
|
|
99
99
|
} from "./chunk-FDLDMJTM.js";
|
|
@@ -105,14 +105,14 @@ import {
|
|
|
105
105
|
resolveBuiltinPlatformAgentConfig,
|
|
106
106
|
runKeyed,
|
|
107
107
|
validateAskChoiceInput
|
|
108
|
-
} from "./chunk-
|
|
108
|
+
} from "./chunk-VXCDYN6M.js";
|
|
109
109
|
import {
|
|
110
110
|
BUILTIN_DIALOG_LLM_CHAT_FALLBACK_MODEL,
|
|
111
111
|
BUILTIN_TITLE_LLM_CONFIG
|
|
112
112
|
} from "./chunk-523DITKR.js";
|
|
113
113
|
import {
|
|
114
114
|
fetchServerSyncedCredential
|
|
115
|
-
} from "./chunk-
|
|
115
|
+
} from "./chunk-DBEIHUCJ.js";
|
|
116
116
|
import {
|
|
117
117
|
isTombstoneRecord
|
|
118
118
|
} from "./chunk-D2MDMY2M.js";
|
|
@@ -125,7 +125,7 @@ import {
|
|
|
125
125
|
applySystemBuiltinSkillFilter,
|
|
126
126
|
expandEnabledPacks,
|
|
127
127
|
resolveEffectiveEnabledPacks
|
|
128
|
-
} from "./chunk-
|
|
128
|
+
} from "./chunk-7XISFN2T.js";
|
|
129
129
|
import {
|
|
130
130
|
DEFAULT_HYBRID_READ_TIMEOUT_MS,
|
|
131
131
|
Duration_exports,
|
|
@@ -169,7 +169,7 @@ import {
|
|
|
169
169
|
runExecShellGates,
|
|
170
170
|
validateConfiguredRootExecutionLease,
|
|
171
171
|
verifyOwnerRouteAck
|
|
172
|
-
} from "./chunk-
|
|
172
|
+
} from "./chunk-IOQHM7ID.js";
|
|
173
173
|
import {
|
|
174
174
|
accumulateGeminiChunks,
|
|
175
175
|
buildGeminiGenerateContentRequest,
|
|
@@ -228,7 +228,7 @@ import {
|
|
|
228
228
|
parseNoloWorkspaceToolArguments,
|
|
229
229
|
resolveRequestToolSurface,
|
|
230
230
|
resolveRuntimeToolSurfaceForAgent
|
|
231
|
-
} from "./chunk-
|
|
231
|
+
} from "./chunk-FKOCI2WR.js";
|
|
232
232
|
import {
|
|
233
233
|
isCapacitySaturatedRateLimit,
|
|
234
234
|
mergeAvailabilityDeadline,
|
|
@@ -284,11 +284,11 @@ import {
|
|
|
284
284
|
} from "./chunk-ZWQUWF6W.js";
|
|
285
285
|
import {
|
|
286
286
|
canonicalizeToolNames
|
|
287
|
-
} from "./chunk-
|
|
287
|
+
} from "./chunk-AKE53VMW.js";
|
|
288
288
|
import {
|
|
289
289
|
CHROME_CONNECTOR_ACCEPTED_TOOL_NAMES,
|
|
290
290
|
canonicalizeChromeConnectorToolNames
|
|
291
|
-
} from "./chunk-
|
|
291
|
+
} from "./chunk-ZC3CMUKU.js";
|
|
292
292
|
import {
|
|
293
293
|
isSystemBuiltinTrustedAgentKey
|
|
294
294
|
} from "./chunk-LOEO7LRC.js";
|
|
@@ -358,7 +358,7 @@ import {
|
|
|
358
358
|
import {
|
|
359
359
|
agentRunCardLabels,
|
|
360
360
|
t
|
|
361
|
-
} from "./chunk-
|
|
361
|
+
} from "./chunk-CWLKTRCI.js";
|
|
362
362
|
import {
|
|
363
363
|
isAntigravityOAuthAgent
|
|
364
364
|
} from "./chunk-JOUFPRE4.js";
|
|
@@ -7754,7 +7754,262 @@ function createCliControlAgentRunExecutor(deps = {}) {
|
|
|
7754
7754
|
};
|
|
7755
7755
|
}
|
|
7756
7756
|
|
|
7757
|
+
// packages/cli/client/hostApprovalFlow.ts
|
|
7758
|
+
var HOST_APPROVAL_SUMMARY_LIMIT = 2500;
|
|
7759
|
+
function clipApprovalSummary(text, limit = HOST_APPROVAL_SUMMARY_LIMIT) {
|
|
7760
|
+
const value = String(text ?? "").replace(/\r\n?/g, "\n").trim();
|
|
7761
|
+
if (value.length <= limit) return value;
|
|
7762
|
+
const tailChars = Math.max(1, Math.round(limit * 0.3));
|
|
7763
|
+
const headChars = Math.max(1, limit - tailChars);
|
|
7764
|
+
const head = value.slice(0, headChars);
|
|
7765
|
+
const tail = value.slice(value.length - tailChars);
|
|
7766
|
+
const omitted = value.length - head.length - tail.length;
|
|
7767
|
+
return `${head}
|
|
7768
|
+
\u2026\uFF08\u4E2D\u95F4 ${omitted} \u5B57\u7B26\u672A\u663E\u793A\uFF0C\u4EE5\u4E0B\u662F\u7ED3\u5C3E\uFF1B\u5168\u6587 ${value.length} \u5B57\u7B26\uFF09\u2026
|
|
7769
|
+
${tail}`;
|
|
7770
|
+
}
|
|
7771
|
+
function toEpochMs2(value) {
|
|
7772
|
+
if (typeof value === "number" && Number.isFinite(value)) {
|
|
7773
|
+
return value < 1e11 ? Math.round(value * 1e3) : Math.round(value);
|
|
7774
|
+
}
|
|
7775
|
+
if (typeof value === "string" && value.trim()) {
|
|
7776
|
+
const asNumber = Number(value);
|
|
7777
|
+
if (Number.isFinite(asNumber)) return toEpochMs2(asNumber);
|
|
7778
|
+
const parsed = Date.parse(value);
|
|
7779
|
+
if (Number.isFinite(parsed)) return parsed;
|
|
7780
|
+
}
|
|
7781
|
+
return void 0;
|
|
7782
|
+
}
|
|
7783
|
+
function remainingApprovalMs(expiresAt, now) {
|
|
7784
|
+
return Math.max(0, expiresAt - now);
|
|
7785
|
+
}
|
|
7786
|
+
function formatApprovalRemaining(expiresAt, now) {
|
|
7787
|
+
const totalSeconds = Math.ceil(remainingApprovalMs(expiresAt, now) / 1e3);
|
|
7788
|
+
if (totalSeconds <= 0) return "0s";
|
|
7789
|
+
const minutes = Math.floor(totalSeconds / 60);
|
|
7790
|
+
const seconds = totalSeconds % 60;
|
|
7791
|
+
return minutes > 0 ? `${minutes}m${seconds}s` : `${seconds}s`;
|
|
7792
|
+
}
|
|
7793
|
+
function isRecordLike(value) {
|
|
7794
|
+
return typeof value === "object" && value !== null;
|
|
7795
|
+
}
|
|
7796
|
+
function asTrimmedString2(value) {
|
|
7797
|
+
return typeof value === "string" ? value.trim() : "";
|
|
7798
|
+
}
|
|
7799
|
+
function normalizePendingApproval(raw) {
|
|
7800
|
+
if (!isRecordLike(raw)) return null;
|
|
7801
|
+
const approvalId = asTrimmedString2(raw.approvalId);
|
|
7802
|
+
const expiresAt = toEpochMs2(raw.expiresAt ?? raw.expiresAtMs);
|
|
7803
|
+
if (!approvalId || expiresAt === void 0) return null;
|
|
7804
|
+
const tabId = asTrimmedString2(raw.tabId);
|
|
7805
|
+
return {
|
|
7806
|
+
approvalId,
|
|
7807
|
+
actionLabel: asTrimmedString2(raw.action) || "unknown",
|
|
7808
|
+
origin: asTrimmedString2(raw.origin),
|
|
7809
|
+
// Passed through verbatim (the connector's preview already has the identity line, the head and
|
|
7810
|
+
// the stated tail); only an upper-bound guard may touch it, see clipApprovalSummary.
|
|
7811
|
+
summary: clipApprovalSummary(asTrimmedString2(raw.summary)),
|
|
7812
|
+
expiresAt,
|
|
7813
|
+
...tabId ? { tabId } : {}
|
|
7814
|
+
};
|
|
7815
|
+
}
|
|
7816
|
+
function parsePendingApprovalResult(result) {
|
|
7817
|
+
let parsed;
|
|
7818
|
+
try {
|
|
7819
|
+
parsed = JSON.parse(result.content);
|
|
7820
|
+
} catch {
|
|
7821
|
+
return null;
|
|
7822
|
+
}
|
|
7823
|
+
if (!isRecordLike(parsed)) return null;
|
|
7824
|
+
const errorBlock = isRecordLike(parsed.error) ? parsed.error : void 0;
|
|
7825
|
+
const details = isRecordLike(errorBlock?.details) ? errorBlock.details : void 0;
|
|
7826
|
+
const verdict = isRecordLike(parsed.result) ? parsed.result : void 0;
|
|
7827
|
+
const candidates = [verdict, errorBlock, details].filter(isRecordLike);
|
|
7828
|
+
const pending = candidates.find((entry) => entry.code === "USER_APPROVAL_PENDING");
|
|
7829
|
+
if (!pending) return null;
|
|
7830
|
+
const ordered = [pending, details, verdict].filter(isRecordLike);
|
|
7831
|
+
const readField = (key) => {
|
|
7832
|
+
for (const entry of ordered) {
|
|
7833
|
+
const value = asTrimmedString2(entry[key]);
|
|
7834
|
+
if (value) return value;
|
|
7835
|
+
}
|
|
7836
|
+
return "";
|
|
7837
|
+
};
|
|
7838
|
+
const approvalId = readField("approvalId");
|
|
7839
|
+
if (!approvalId) return null;
|
|
7840
|
+
let expiresAt;
|
|
7841
|
+
for (const entry of ordered) {
|
|
7842
|
+
const candidate = toEpochMs2(entry.expiresAt ?? entry.expiresAtMs);
|
|
7843
|
+
if (candidate !== void 0) {
|
|
7844
|
+
expiresAt = candidate;
|
|
7845
|
+
break;
|
|
7846
|
+
}
|
|
7847
|
+
}
|
|
7848
|
+
const message = readField("message");
|
|
7849
|
+
return {
|
|
7850
|
+
approvalId,
|
|
7851
|
+
action: readField("action"),
|
|
7852
|
+
...expiresAt !== void 0 ? { expiresAt } : {},
|
|
7853
|
+
...message ? { message } : {}
|
|
7854
|
+
};
|
|
7855
|
+
}
|
|
7856
|
+
function withApprovalId(call, approvalId) {
|
|
7857
|
+
let payload;
|
|
7858
|
+
try {
|
|
7859
|
+
const parsed = JSON.parse(call.arguments || "{}");
|
|
7860
|
+
payload = isRecordLike(parsed) ? { ...parsed } : {};
|
|
7861
|
+
} catch {
|
|
7862
|
+
return call;
|
|
7863
|
+
}
|
|
7864
|
+
payload.approvalId = approvalId;
|
|
7865
|
+
return { ...call, arguments: JSON.stringify(payload) };
|
|
7866
|
+
}
|
|
7867
|
+
function withHostApprovalRequest(call) {
|
|
7868
|
+
let payload;
|
|
7869
|
+
try {
|
|
7870
|
+
const parsed = JSON.parse(call.arguments || "{}");
|
|
7871
|
+
payload = isRecordLike(parsed) ? { ...parsed } : {};
|
|
7872
|
+
} catch {
|
|
7873
|
+
return call;
|
|
7874
|
+
}
|
|
7875
|
+
payload.hostApproval = true;
|
|
7876
|
+
return { ...call, arguments: JSON.stringify(payload) };
|
|
7877
|
+
}
|
|
7878
|
+
function createConnectorApprovalPort(getClient) {
|
|
7879
|
+
return {
|
|
7880
|
+
async listPendingApprovals() {
|
|
7881
|
+
const raw = await getClient().request("list_pending_approvals", {});
|
|
7882
|
+
const list = isRecordLike(raw) && Array.isArray(raw.approvals) ? raw.approvals : [];
|
|
7883
|
+
return list.map(normalizePendingApproval).filter((entry) => entry !== null);
|
|
7884
|
+
},
|
|
7885
|
+
async submitApprovalDecision(approvalId, decision) {
|
|
7886
|
+
try {
|
|
7887
|
+
const raw = await getClient().request("submit_approval_decision", {
|
|
7888
|
+
approvalId,
|
|
7889
|
+
decision
|
|
7890
|
+
});
|
|
7891
|
+
if (isRecordLike(raw) && raw.ok === false) {
|
|
7892
|
+
return { failed: asTrimmedString2(raw.code) || "USER_APPROVAL_REJECTED" };
|
|
7893
|
+
}
|
|
7894
|
+
const status = isRecordLike(raw) && raw.status === "denied" ? "denied" : "allowed";
|
|
7895
|
+
return { status };
|
|
7896
|
+
} catch (error) {
|
|
7897
|
+
const code = asTrimmedString2(error?.code);
|
|
7898
|
+
return { failed: code || "CHROME_CONNECTOR_ERROR" };
|
|
7899
|
+
}
|
|
7900
|
+
}
|
|
7901
|
+
};
|
|
7902
|
+
}
|
|
7903
|
+
function approvalFailure(code, message, action, extra) {
|
|
7904
|
+
return {
|
|
7905
|
+
content: JSON.stringify({ ok: false, error: { code, message } }),
|
|
7906
|
+
metadata: { chromeConnector: true, error: true, code, action, ...extra ?? {} }
|
|
7907
|
+
};
|
|
7908
|
+
}
|
|
7909
|
+
async function runConnectorToolWithHostApproval(args) {
|
|
7910
|
+
const first = await args.execute(
|
|
7911
|
+
args.awaitHostApproval ? withHostApprovalRequest(args.call) : args.call
|
|
7912
|
+
);
|
|
7913
|
+
const pending = parsePendingApprovalResult(first);
|
|
7914
|
+
if (!pending || !args.awaitHostApproval) return first;
|
|
7915
|
+
const now = args.now ?? Date.now;
|
|
7916
|
+
let listed;
|
|
7917
|
+
try {
|
|
7918
|
+
listed = await args.connector.listPendingApprovals();
|
|
7919
|
+
} catch {
|
|
7920
|
+
return first;
|
|
7921
|
+
}
|
|
7922
|
+
const card = listed.find((entry) => entry.approvalId === pending.approvalId);
|
|
7923
|
+
if (!card) {
|
|
7924
|
+
return approvalFailure(
|
|
7925
|
+
"USER_APPROVAL_EXPIRED",
|
|
7926
|
+
"\u5BA1\u6279\u5DF2\u8FC7\u671F\u6216\u4E0D\u518D\u5F85\u6279\uFF0C\u52A8\u4F5C\u672A\u6267\u884C\u3002",
|
|
7927
|
+
args.call.name
|
|
7928
|
+
);
|
|
7929
|
+
}
|
|
7930
|
+
if (card.expiresAt <= now()) {
|
|
7931
|
+
return approvalFailure("USER_APPROVAL_EXPIRED", "\u5BA1\u6279\u5DF2\u8FC7\u671F\uFF0C\u52A8\u4F5C\u672A\u6267\u884C\u3002", args.call.name);
|
|
7932
|
+
}
|
|
7933
|
+
const decision = await args.awaitHostApproval(card);
|
|
7934
|
+
if (decision === "deny") {
|
|
7935
|
+
await args.connector.submitApprovalDecision(card.approvalId, "deny");
|
|
7936
|
+
return approvalFailure("USER_APPROVAL_DENIED", "\u7528\u6237\u5DF2\u62D2\u7EDD", args.call.name, {
|
|
7937
|
+
approvalId: card.approvalId
|
|
7938
|
+
});
|
|
7939
|
+
}
|
|
7940
|
+
const submitted = await args.connector.submitApprovalDecision(card.approvalId, "allow_once");
|
|
7941
|
+
if ("failed" in submitted) {
|
|
7942
|
+
return approvalFailure(
|
|
7943
|
+
submitted.failed,
|
|
7944
|
+
submitted.failed === "USER_APPROVAL_EXPIRED" ? "\u5BA1\u6279\u5DF2\u8FC7\u671F\uFF0C\u52A8\u4F5C\u672A\u6267\u884C\u3002" : "\u5BA1\u6279\u51B3\u5B9A\u672A\u88AB\u8FDE\u63A5\u5668\u63A5\u53D7\uFF0C\u52A8\u4F5C\u672A\u6267\u884C\u3002",
|
|
7945
|
+
args.call.name,
|
|
7946
|
+
{ approvalId: card.approvalId }
|
|
7947
|
+
);
|
|
7948
|
+
}
|
|
7949
|
+
if (submitted.status === "denied") {
|
|
7950
|
+
return approvalFailure("USER_APPROVAL_DENIED", "\u7528\u6237\u5DF2\u62D2\u7EDD", args.call.name, {
|
|
7951
|
+
approvalId: card.approvalId
|
|
7952
|
+
});
|
|
7953
|
+
}
|
|
7954
|
+
return args.execute(withApprovalId(args.call, card.approvalId));
|
|
7955
|
+
}
|
|
7956
|
+
function createHostApprovalCardQueue() {
|
|
7957
|
+
const waiting = [];
|
|
7958
|
+
let active = false;
|
|
7959
|
+
const drain = async () => {
|
|
7960
|
+
if (active) return;
|
|
7961
|
+
active = true;
|
|
7962
|
+
try {
|
|
7963
|
+
while (waiting.length > 0) {
|
|
7964
|
+
waiting.sort((a, b) => a.card.expiresAt - b.card.expiresAt);
|
|
7965
|
+
const entry = waiting.shift();
|
|
7966
|
+
let decision = "deny";
|
|
7967
|
+
try {
|
|
7968
|
+
decision = await entry.present(entry.card);
|
|
7969
|
+
} catch {
|
|
7970
|
+
decision = "deny";
|
|
7971
|
+
}
|
|
7972
|
+
entry.resolve(decision);
|
|
7973
|
+
}
|
|
7974
|
+
} finally {
|
|
7975
|
+
active = false;
|
|
7976
|
+
}
|
|
7977
|
+
};
|
|
7978
|
+
return {
|
|
7979
|
+
/** Resolves with the user's answer once this card reaches the head of the queue. */
|
|
7980
|
+
present(card, present) {
|
|
7981
|
+
return new Promise((resolve5) => {
|
|
7982
|
+
waiting.push({ card, present, resolve: resolve5 });
|
|
7983
|
+
void Promise.resolve().then(drain);
|
|
7984
|
+
});
|
|
7985
|
+
},
|
|
7986
|
+
/** Cards currently queued or being shown (tests/telemetry). */
|
|
7987
|
+
size: () => waiting.length + (active ? 1 : 0)
|
|
7988
|
+
};
|
|
7989
|
+
}
|
|
7990
|
+
var registeredRenderer = null;
|
|
7991
|
+
function registerHostApprovalRenderer(renderer) {
|
|
7992
|
+
registeredRenderer = renderer;
|
|
7993
|
+
return () => {
|
|
7994
|
+
if (registeredRenderer === renderer) registeredRenderer = null;
|
|
7995
|
+
};
|
|
7996
|
+
}
|
|
7997
|
+
function getHostApprovalRenderer() {
|
|
7998
|
+
return registeredRenderer ?? void 0;
|
|
7999
|
+
}
|
|
8000
|
+
|
|
7757
8001
|
// packages/cli/client/cliChromeConnectorToolExecutors.ts
|
|
8002
|
+
function approvalTargetForCall(call) {
|
|
8003
|
+
try {
|
|
8004
|
+
const parsed = JSON.parse(call.arguments || "{}");
|
|
8005
|
+
const raw = parsed?.target;
|
|
8006
|
+
if (typeof raw !== "string") return void 0;
|
|
8007
|
+
const trimmed = raw.trim().toLowerCase();
|
|
8008
|
+
return trimmed === "chrome" || trimmed === "firefox" ? trimmed : void 0;
|
|
8009
|
+
} catch {
|
|
8010
|
+
return void 0;
|
|
8011
|
+
}
|
|
8012
|
+
}
|
|
7758
8013
|
function buildCliChromeConnectorToolExecutors(args) {
|
|
7759
8014
|
const clientForTarget = createChromeConnectorClientResolver({
|
|
7760
8015
|
clients: {
|
|
@@ -7762,10 +8017,23 @@ function buildCliChromeConnectorToolExecutors(args) {
|
|
|
7762
8017
|
...args?.client ? { default: createVerifiedChromeConnectorClient({ client: args.client }) } : {}
|
|
7763
8018
|
}
|
|
7764
8019
|
});
|
|
8020
|
+
const injectedApprover = args?.awaitHostApproval;
|
|
7765
8021
|
return Object.fromEntries(
|
|
7766
8022
|
CHROME_CONNECTOR_ACCEPTED_TOOL_NAMES.map((toolName) => [
|
|
7767
8023
|
toolName,
|
|
7768
|
-
(call) =>
|
|
8024
|
+
(call) => {
|
|
8025
|
+
const target = approvalTargetForCall(call);
|
|
8026
|
+
const connector = createConnectorApprovalPort(() => clientForTarget(target));
|
|
8027
|
+
return runConnectorToolWithHostApproval({
|
|
8028
|
+
call,
|
|
8029
|
+
execute: (nextCall) => executeChromeConnectorTool({ clientForTarget, call: nextCall }),
|
|
8030
|
+
connector,
|
|
8031
|
+
// Read the registry per call so a TUI that installs its renderer after the table is
|
|
8032
|
+
// built still gets approvals in the conversation; no host approver ⇒ undefined ⇒ the
|
|
8033
|
+
// pending verdict is returned untouched.
|
|
8034
|
+
awaitHostApproval: injectedApprover ?? getHostApprovalRenderer()
|
|
8035
|
+
});
|
|
8036
|
+
}
|
|
7769
8037
|
])
|
|
7770
8038
|
);
|
|
7771
8039
|
}
|
|
@@ -9659,7 +9927,7 @@ async function createLocalDockerWorkload(args) {
|
|
|
9659
9927
|
const createLifecycle = args.createLifecycle ?? (async () => {
|
|
9660
9928
|
const [{ DockerWorkloadLifecycle, createDockerBindingAuthorizer }, accounts] = await Promise.all([
|
|
9661
9929
|
import("./workloadLifecycle-2F5YKFGW.js"),
|
|
9662
|
-
import("./accountResolver-
|
|
9930
|
+
import("./accountResolver-NQJ57BVU.js")
|
|
9663
9931
|
]);
|
|
9664
9932
|
const resolveAccount = args.resolveAccount ?? accounts.createDockerAccountResolver({
|
|
9665
9933
|
env: args.env,
|
|
@@ -13016,6 +13284,9 @@ export {
|
|
|
13016
13284
|
readTimestamp,
|
|
13017
13285
|
parseAgentRunEvent,
|
|
13018
13286
|
isLiveAgentRunObservation,
|
|
13287
|
+
formatApprovalRemaining,
|
|
13288
|
+
createHostApprovalCardQueue,
|
|
13289
|
+
registerHostApprovalRenderer,
|
|
13019
13290
|
isSubtaskRun,
|
|
13020
13291
|
RUN_WAKE_CHANNEL_ENV,
|
|
13021
13292
|
createOriginShellGrant,
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
listUserRecordsFromServers,
|
|
3
3
|
readLiveDbRecordAfterTombstoneMerge
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-K3TVMCV3.js";
|
|
5
5
|
import {
|
|
6
6
|
agentRecordHasConfiguredCredential
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-IHQ7RMRS.js";
|
|
8
8
|
import {
|
|
9
9
|
deriveCredentialGroup
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-KHMJI7GE.js";
|
|
11
11
|
import {
|
|
12
12
|
isTombstoneRecord
|
|
13
13
|
} from "./chunk-D2MDMY2M.js";
|
|
@@ -307,6 +307,10 @@ var CHROME_TOOL_ACTIONS = {
|
|
|
307
307
|
browser_screenshot: "screenshot",
|
|
308
308
|
browser_read_console: "read_console",
|
|
309
309
|
browser_read_network: "read_network",
|
|
310
|
+
// `eval_script` lives on the same table as the rest on purpose: the host's in-conversation approval
|
|
311
|
+
// card is installed over the browser tool table, so an eval reachable only through
|
|
312
|
+
// `nolo browser eval` would fall outside the card entirely.
|
|
313
|
+
browser_eval_script: "eval_script",
|
|
310
314
|
// Legacy aliases (kept for existing agents/tests).
|
|
311
315
|
chrome_list_tabs: "list_tabs",
|
|
312
316
|
chrome_open_tab: "open_tab",
|
|
@@ -320,6 +324,7 @@ var CHROME_TOOL_ACTIONS = {
|
|
|
320
324
|
chrome_screenshot: "screenshot",
|
|
321
325
|
chrome_read_console: "read_console",
|
|
322
326
|
chrome_read_network: "read_network",
|
|
327
|
+
chrome_eval_script: "eval_script",
|
|
323
328
|
chrome_set_files: "set_files",
|
|
324
329
|
chrome_upload_file: "set_files",
|
|
325
330
|
chrome_upload: "set_files"
|
|
@@ -365,7 +370,8 @@ var TAB_ID_REQUIRED_ACTIONS = /* @__PURE__ */ new Set([
|
|
|
365
370
|
"detach",
|
|
366
371
|
"set_files",
|
|
367
372
|
"set_select_value",
|
|
368
|
-
"prepare_browser_action"
|
|
373
|
+
"prepare_browser_action",
|
|
374
|
+
"eval_script"
|
|
369
375
|
]);
|
|
370
376
|
var ALLOWED_PREPARE_SUB_ACTIONS = /* @__PURE__ */ new Set(["click", "type", "press"]);
|
|
371
377
|
function validateChromeConnectorPayload(action, payload) {
|
|
@@ -537,7 +543,10 @@ var REQUIRED_CHROME_CONNECTOR_FEATURES = {
|
|
|
537
543
|
read_network: ["browser_debug"],
|
|
538
544
|
detach: ["browser_debug"],
|
|
539
545
|
set_files: ["compact_observation_v2", "file_upload"],
|
|
540
|
-
prepare_browser_action: ["prepare_browser_action"]
|
|
546
|
+
prepare_browser_action: ["prepare_browser_action"],
|
|
547
|
+
// debugger-backed (`chrome.debugger` → Runtime.evaluate), so the same feature name the extension
|
|
548
|
+
// publishes also says "Chrome would run this, Firefox cannot" — see FIREFOX_UNAVAILABLE_FEATURES.
|
|
549
|
+
eval_script: ["eval"]
|
|
541
550
|
};
|
|
542
551
|
function requiredFeaturesForConnectorAction(action) {
|
|
543
552
|
return [...REQUIRED_CHROME_CONNECTOR_FEATURES[action] ?? []];
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
addContentToSpace
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-HRLKX6YP.js";
|
|
4
4
|
import {
|
|
5
5
|
format,
|
|
6
6
|
prepareAndPersistMessage,
|
|
7
7
|
uiAskChoiceFunc,
|
|
8
8
|
uiAskChoiceFunctionSchema
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-VXCDYN6M.js";
|
|
10
10
|
import {
|
|
11
11
|
formatISO
|
|
12
12
|
} from "./chunk-ZRAU6T47.js";
|
|
@@ -25,7 +25,7 @@ import {
|
|
|
25
25
|
} from "./chunk-PXYBUFDB.js";
|
|
26
26
|
import {
|
|
27
27
|
buildBuiltinObjectSkillReference
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-7XISFN2T.js";
|
|
29
29
|
import {
|
|
30
30
|
extractCustomId
|
|
31
31
|
} from "./chunk-M2EJHDJP.js";
|
|
@@ -11,7 +11,8 @@ var CHROME_CONNECTOR_TOOL_NAMES = [
|
|
|
11
11
|
"browser_scroll",
|
|
12
12
|
"browser_screenshot",
|
|
13
13
|
"browser_read_console",
|
|
14
|
-
"browser_read_network"
|
|
14
|
+
"browser_read_network",
|
|
15
|
+
"browser_eval_script"
|
|
15
16
|
];
|
|
16
17
|
var CHROME_CONNECTOR_LEGACY_TOOL_ALIASES = {
|
|
17
18
|
chrome_list_tabs: "browser_list_tabs",
|
|
@@ -25,7 +26,8 @@ var CHROME_CONNECTOR_LEGACY_TOOL_ALIASES = {
|
|
|
25
26
|
chrome_scroll: "browser_scroll",
|
|
26
27
|
chrome_screenshot: "browser_screenshot",
|
|
27
28
|
chrome_read_console: "browser_read_console",
|
|
28
|
-
chrome_read_network: "browser_read_network"
|
|
29
|
+
chrome_read_network: "browser_read_network",
|
|
30
|
+
chrome_eval_script: "browser_eval_script"
|
|
29
31
|
};
|
|
30
32
|
var CHROME_CONNECTOR_LEGACY_TOOL_NAMES = Object.keys(
|
|
31
33
|
CHROME_CONNECTOR_LEGACY_TOOL_ALIASES
|
|
@@ -269,6 +271,27 @@ var chromeReadNetworkFunctionSchema = baseSchema(
|
|
|
269
271
|
},
|
|
270
272
|
["tabId"]
|
|
271
273
|
);
|
|
274
|
+
var chromeEvalScriptFunctionSchema = baseSchema(
|
|
275
|
+
"browser_eval_script",
|
|
276
|
+
"Run a JavaScript expression in a browser tab and get its value back. Chrome only (it needs chrome.debugger), and every call requires a fresh user approval: the connector answers USER_APPROVAL_PENDING with an approvalId while the user allows this exact script once, and only then may the same call be retried with that approvalId. The script is never rewritten before it runs, but the approval card cannot print all of a long script: it shows the script with its own line breaks, states how many characters were cut (the approval still covers the whole text), and prints the first 8 hex digits of the script's SHA-256 so the user can check that what they read is the text being approved. Results are capped at 100 000 characters: when the reply has truncated === true (and complete === false) the value is only a cut-down part of the result and you must say so \u2014 report it as truncated instead of presenting it as the complete value. A value that cannot be serialised answers ok: false with code EVAL_RESULT_NOT_SERIALIZABLE and no value. The value comes from the live page and may contain data the user did not mean to share \u2014 report it back to the user, do not send it anywhere else.",
|
|
277
|
+
{
|
|
278
|
+
tabId,
|
|
279
|
+
expression: {
|
|
280
|
+
type: "string",
|
|
281
|
+
description: "JavaScript source to evaluate in the tab. Sent verbatim; the approval card shows it with its own line breaks, states any part it had to cut, and prints the SHA-256 prefix of the full text."
|
|
282
|
+
},
|
|
283
|
+
awaitPromise: {
|
|
284
|
+
type: "boolean",
|
|
285
|
+
description: "Wait for the returned promise to settle before answering. Omit to hand back a pending promise unresolved."
|
|
286
|
+
},
|
|
287
|
+
timeoutMs: {
|
|
288
|
+
type: "number",
|
|
289
|
+
description: "Execution deadline in ms (100..60000). The connector clamps out-of-range values."
|
|
290
|
+
},
|
|
291
|
+
approvalId
|
|
292
|
+
},
|
|
293
|
+
["tabId", "expression"]
|
|
294
|
+
);
|
|
272
295
|
var chromeConnectorToolSchemas = [
|
|
273
296
|
chromeListTabsFunctionSchema,
|
|
274
297
|
chromeOpenTabFunctionSchema,
|
|
@@ -281,7 +304,8 @@ var chromeConnectorToolSchemas = [
|
|
|
281
304
|
chromeScrollFunctionSchema,
|
|
282
305
|
chromeScreenshotFunctionSchema,
|
|
283
306
|
chromeReadConsoleFunctionSchema,
|
|
284
|
-
chromeReadNetworkFunctionSchema
|
|
307
|
+
chromeReadNetworkFunctionSchema,
|
|
308
|
+
chromeEvalScriptFunctionSchema
|
|
285
309
|
];
|
|
286
310
|
async function chromeConnectorUnavailableFunc() {
|
|
287
311
|
throw new Error("Browser connector tools are only executable in the Nolo desktop local runtime.");
|
|
@@ -3,13 +3,13 @@ import {
|
|
|
3
3
|
} from "./chunk-HS7MLR74.js";
|
|
4
4
|
import {
|
|
5
5
|
performServerProxyFetchWithRetry
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-MIPGIRJJ.js";
|
|
7
7
|
import {
|
|
8
8
|
fetchServerSyncedCredential
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-DBEIHUCJ.js";
|
|
10
10
|
import {
|
|
11
11
|
buildSkillGuidancePromptBlock
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-ZZE2IJ5U.js";
|
|
13
13
|
import {
|
|
14
14
|
CREDENTIAL_HYGIENE_RULE,
|
|
15
15
|
DELETE_SAFETY_RED_LINE,
|
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
compileContextLayers,
|
|
24
24
|
detectDispatchIntentFromMessages,
|
|
25
25
|
resolveToolGuidedSections
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-QEGPFGKA.js";
|
|
27
27
|
import {
|
|
28
28
|
convertMessagesToResponsesInput,
|
|
29
29
|
getUsageRequestOptions,
|
|
@@ -47,7 +47,7 @@ import {
|
|
|
47
47
|
} from "./chunk-4VJAC32I.js";
|
|
48
48
|
import {
|
|
49
49
|
canonicalizeToolNames
|
|
50
|
-
} from "./chunk-
|
|
50
|
+
} from "./chunk-AKE53VMW.js";
|
|
51
51
|
import {
|
|
52
52
|
API_ENDPOINTS
|
|
53
53
|
} from "./chunk-LCBAMY2M.js";
|
|
@@ -5,10 +5,10 @@ import {
|
|
|
5
5
|
} from "./chunk-NBTY7YJF.js";
|
|
6
6
|
import {
|
|
7
7
|
resolveCliLocalRuntimeKeyCapability
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-D4JCY67U.js";
|
|
9
9
|
import {
|
|
10
10
|
HIGH_RISK_MUTATION_TOOL_NAMES
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-FKOCI2WR.js";
|
|
12
12
|
import {
|
|
13
13
|
DEFAULT_NOLO_SERVER_URL
|
|
14
14
|
} from "./chunk-OLZBQWZU.js";
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
buildBuiltinObjectSkillDbKey,
|
|
7
7
|
buildBuiltinObjectSkillPageContent,
|
|
8
8
|
buildCodeWorkDiscipline
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-7XISFN2T.js";
|
|
10
10
|
import {
|
|
11
11
|
buildSkillDocMarkdown,
|
|
12
12
|
resolvePageSkillMetadata
|
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
} from "./chunk-Y6ORVLSS.js";
|
|
17
17
|
import {
|
|
18
18
|
canonicalizeToolNames
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-AKE53VMW.js";
|
|
20
20
|
import {
|
|
21
21
|
asNonEmptyStringArray
|
|
22
22
|
} from "./chunk-I42VC5KR.js";
|