nolo-cli 0.184.0-alpha.1 → 0.185.0-alpha.2
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-WAVA6O3U.js → agentDeleteCommand-RUBWHUMZ.js} +22 -22
- package/{agentEmailCommands-T5RB2RKP.js → agentEmailCommands-RXCDWZDW.js} +23 -23
- package/{agentListCommands-QZN5WVJ5.js → agentListCommands-IIVWUN2H.js} +11 -11
- package/{agentMachineCommands-BBADUZ7U.js → agentMachineCommands-SPQ3CCYU.js} +8 -8
- package/{agentRecordCommands-N4YEVYKR.js → agentRecordCommands-AKAQ7BRK.js} +22 -22
- package/{agentRunCommand-G7H745CP.js → agentRunCommand-S3VSGTS4.js} +23 -23
- package/{agentRuntimeLocal-ECGPI3CO.js → agentRuntimeLocal-CBDP2OYK.js} +5 -5
- package/{agentSlice-MS5G7UCC.js → agentSlice-2PEJP3NV.js} +1 -1
- package/{appDeleteCommands-BY2QK4FR.js → appDeleteCommands-OP4GGXEJ.js} +10 -10
- package/{appDeployCommands-UH2W6LPJ.js → appDeployCommands-LHTVLNL5.js} +10 -10
- package/{appDeployStatusCommands-I5DZQFKA.js → appDeployStatusCommands-BSDDQU7S.js} +10 -10
- package/{appGetCommands-ZBCBTEO3.js → appGetCommands-LNHGUJKF.js} +10 -10
- package/{appListCommands-ZA6NXKV3.js → appListCommands-RGOFZV5M.js} +10 -10
- package/{authCommand-RGOCQCQT.js → authCommand-NR6NELQ7.js} +1 -1
- package/{builtinSkillRegistry-HJCSXMKS.js → builtinSkillRegistry-RR35BY57.js} +4 -4
- package/{chromeCommands-BGL6JZMB.js → chromeCommands-EXJZ5HH5.js} +2 -2
- package/{chromeOpsCommands-MVGJZUOQ.js → chromeOpsCommands-ITBZEFBX.js} +27 -2
- 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-PZ7LKLIV.js → chunk-AA5GKA2X.js} +2 -2
- package/{chunk-NHBJHDVW.js → chunk-AKE53VMW.js} +1 -1
- package/{chunk-C3BYVRTJ.js → chunk-BJPALUYR.js} +2 -2
- package/{chunk-2FY2HA4R.js → chunk-CN6T5QKA.js} +5 -5
- 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-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-JJWQ737H.js → chunk-IIGDVODZ.js} +1 -1
- package/{chunk-FO2BTDKY.js → chunk-IOQHM7ID.js} +4 -4
- package/{chunk-GDQ5KO2J.js → chunk-JJU5FBYH.js} +287 -16
- package/{chunk-F2P6YUHC.js → chunk-K3TVMCV3.js} +1 -1
- package/{chunk-P7JNYLDW.js → chunk-KHMJI7GE.js} +1 -1
- package/{chunk-PW5CM76N.js → chunk-KVUMIWLL.js} +3 -3
- package/{chunk-R2EDHCTI.js → chunk-M4JDIVIS.js} +2 -2
- 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-TQU64H2A.js → chunk-QEGPFGKA.js} +2 -2
- package/{chunk-3GMGSUU2.js → chunk-SJGHZTLV.js} +2 -2
- package/{chunk-WGHIT2HH.js → chunk-VXCDYN6M.js} +8 -8
- package/{chunk-IR5IH6LH.js → chunk-WVIBJBDF.js} +10 -10
- package/{chunk-LPV7KKTB.js → chunk-YO3O7H2X.js} +530 -2
- 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-XDGDMYU6.js → commandRegistry-IP34O6Y2.js} +70 -65
- package/{contentThunks-EWOORWBS.js → contentThunks-BSCTL5G3.js} +3 -3
- package/{cooldownCommands-5KIQ2FDU.js → cooldownCommands-IUU3ZH3L.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-2M5NWSY2.js → dialogCommands-6MR232CJ.js} +10 -10
- package/{dialogSlice-4W7DJJC2.js → dialogSlice-U3X3CBR7.js} +2 -2
- package/{docCreateCommands-PKUJVJ5N.js → docCreateCommands-DAZJ2Y5E.js} +9 -9
- package/{docDeleteCommands-C3RNBHIH.js → docDeleteCommands-XO26LNIO.js} +10 -10
- package/{docReadCommands-JS4W26DI.js → docReadCommands-77XGRLD6.js} +9 -9
- package/{docStore-VBINJLRX.js → docStore-H2XCYODR.js} +1 -1
- package/{docUpdateCommands-NZWDQFDD.js → docUpdateCommands-QXN3MJAJ.js} +9 -9
- package/{handleSendMessageAction-FJKTVMCA.js → handleSendMessageAction-MZKFIPYL.js} +11 -11
- package/index.js +6 -6
- package/{localRuntimeAdapter-5ANB7V6J.js → localRuntimeAdapter-E2QDYFTW.js} +20 -20
- package/{machineCommands-A2NAILV6.js → machineCommands-SQELO6HH.js} +21 -21
- package/{machineWsRunDispatch-AWIGTEF6.js → machineWsRunDispatch-E33LUXWG.js} +21 -21
- package/package.json +1 -1
- package/{readlineWorkspace-GFKEHEXB.js → readlineWorkspace-V6GVWGIZ.js} +241 -32
- package/{runAgentClientLoop-KV6R3FSU.js → runAgentClientLoop-JRW5EA5U.js} +17 -17
- package/{secretCommands-Q65QRUI2.js → secretCommands-UZV7CPJY.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-WBGORNRR.js → updateCommands-MZCY6FXK.js} +3 -3
- package/{updateDialogTitleAction-2QNU4T4I.js → updateDialogTitleAction-2RKLYUPB.js} +3 -3
- package/{windowsSelfUpdate-EELBE4KH.js → windowsSelfUpdate-XV2MMQAC.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-YO3O7H2X.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,
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
listUserRecordsFromServers,
|
|
8
8
|
readDbRecordFromServers,
|
|
9
9
|
readLiveDbRecordAfterTombstoneMerge
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-K3TVMCV3.js";
|
|
11
11
|
import {
|
|
12
12
|
parsePositiveFiniteNumberOrFallback
|
|
13
13
|
} from "./chunk-Y5GCAMGP.js";
|
|
@@ -32,7 +32,7 @@ import {
|
|
|
32
32
|
boundSummaryText,
|
|
33
33
|
buildDialogReadEnvelope,
|
|
34
34
|
projectDialogReadForAgent
|
|
35
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-FKOCI2WR.js";
|
|
36
36
|
import {
|
|
37
37
|
asRecordOrEmpty
|
|
38
38
|
} from "./chunk-KX6YBIHG.js";
|
|
@@ -64,7 +64,7 @@ import {
|
|
|
64
64
|
} from "./chunk-WACI5I6V.js";
|
|
65
65
|
import {
|
|
66
66
|
t
|
|
67
|
-
} from "./chunk-
|
|
67
|
+
} from "./chunk-YO3O7H2X.js";
|
|
68
68
|
import {
|
|
69
69
|
isRecord
|
|
70
70
|
} from "./chunk-KUG52IAP.js";
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
} from "./chunk-62TBKWTV.js";
|
|
7
7
|
import {
|
|
8
8
|
clearCliLocalRuntimePreparedAgentCache
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-JJU5FBYH.js";
|
|
10
10
|
import {
|
|
11
11
|
readCredentialAvailability
|
|
12
12
|
} from "./chunk-R4BMKAR5.js";
|
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
resolveAgentRecordFromHybridStore,
|
|
20
20
|
sanitizeAgentRecordForCliOutput,
|
|
21
21
|
writeAgentRecord
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-IHQ7RMRS.js";
|
|
23
23
|
import {
|
|
24
24
|
resolveCliAgentKeyInput
|
|
25
25
|
} from "./chunk-NBTY7YJF.js";
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
clipMultilineText,
|
|
3
3
|
fetchAndSerializeTable,
|
|
4
4
|
waitForAbortableDelay
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-7YW5OUQE.js";
|
|
6
6
|
import {
|
|
7
7
|
isGatewayHttpStatus
|
|
8
8
|
} from "./chunk-NF64D32W.js";
|
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
} from "./chunk-AGIM7IMJ.js";
|
|
22
22
|
import {
|
|
23
23
|
fetchAndCacheMessages
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-VXCDYN6M.js";
|
|
25
25
|
import {
|
|
26
26
|
createSpaceKey
|
|
27
27
|
} from "./chunk-UAD2WT54.js";
|
|
@@ -35,7 +35,7 @@ import {
|
|
|
35
35
|
extractRuntimePageCapabilities,
|
|
36
36
|
resolveBuiltinSkillPage,
|
|
37
37
|
resolveSkillGraphFromRoots
|
|
38
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-ZZE2IJ5U.js";
|
|
39
39
|
import {
|
|
40
40
|
isAbortError
|
|
41
41
|
} from "./chunk-7DPNBQSV.js";
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
mergeReferences,
|
|
8
8
|
resolveReferenceAssets,
|
|
9
9
|
resolveToolsFromKeys
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-MIPGIRJJ.js";
|
|
11
11
|
import {
|
|
12
12
|
UI_CARD_ENVELOPE_MAX_BYTES,
|
|
13
13
|
getAllToolRuns,
|
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
selectSpaceContextLevel,
|
|
21
21
|
selectUserTonePreset,
|
|
22
22
|
uiCardFallback
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-7YW5OUQE.js";
|
|
24
24
|
import {
|
|
25
25
|
resolveToolBaseUrl
|
|
26
26
|
} from "./chunk-MYOH447Z.js";
|
|
@@ -32,10 +32,10 @@ import {
|
|
|
32
32
|
} from "./chunk-TDNAAXUQ.js";
|
|
33
33
|
import {
|
|
34
34
|
getDocState
|
|
35
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-BJPALUYR.js";
|
|
36
36
|
import {
|
|
37
37
|
getTableState
|
|
38
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-HRLKX6YP.js";
|
|
39
39
|
import {
|
|
40
40
|
getCurrentSpaceIdRaw,
|
|
41
41
|
getViewMode
|
|
@@ -44,7 +44,7 @@ import {
|
|
|
44
44
|
PERSONALIZATION_DIALOG_CATEGORY,
|
|
45
45
|
buildPersonalizationDialogPolicyContext,
|
|
46
46
|
selectAllMsgs
|
|
47
|
-
} from "./chunk-
|
|
47
|
+
} from "./chunk-VXCDYN6M.js";
|
|
48
48
|
import {
|
|
49
49
|
selectPendingFiles
|
|
50
50
|
} from "./chunk-OWYYDMGJ.js";
|
|
@@ -66,7 +66,7 @@ import {
|
|
|
66
66
|
expandEnabledPackPromptPatches,
|
|
67
67
|
expandEnabledPacks,
|
|
68
68
|
resolveEffectiveEnabledPacks
|
|
69
|
-
} from "./chunk-
|
|
69
|
+
} from "./chunk-7XISFN2T.js";
|
|
70
70
|
import {
|
|
71
71
|
projectToolMessageContent
|
|
72
72
|
} from "./chunk-2WZXXAQD.js";
|
|
@@ -94,7 +94,7 @@ import {
|
|
|
94
94
|
import {
|
|
95
95
|
canonicalizeToolNames,
|
|
96
96
|
prioritizeToolNames
|
|
97
|
-
} from "./chunk-
|
|
97
|
+
} from "./chunk-AKE53VMW.js";
|
|
98
98
|
import {
|
|
99
99
|
extractCustomId
|
|
100
100
|
} from "./chunk-M2EJHDJP.js";
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
toolRegistry
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-D4JCY67U.js";
|
|
4
4
|
import {
|
|
5
5
|
runtime_default
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-VXCDYN6M.js";
|
|
7
7
|
import {
|
|
8
8
|
canonicalizeToolNames
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-AKE53VMW.js";
|
|
10
10
|
import {
|
|
11
11
|
isRecord
|
|
12
12
|
} from "./chunk-KUG52IAP.js";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
AGENT_SELECTION_PRIORITY_INSTRUCTIONS
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-FKOCI2WR.js";
|
|
4
4
|
import {
|
|
5
5
|
canonicalizeToolNames
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-AKE53VMW.js";
|
|
7
7
|
import {
|
|
8
8
|
BUILTIN_AGENT_CATALOG
|
|
9
9
|
} from "./chunk-LOEO7LRC.js";
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
requireTokenUser
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-FSIJK37C.js";
|
|
4
4
|
import {
|
|
5
5
|
resolveServerUrl
|
|
6
6
|
} from "./chunk-WACI5I6V.js";
|
|
7
7
|
import {
|
|
8
8
|
t
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-YO3O7H2X.js";
|
|
10
10
|
|
|
11
11
|
// packages/cli/cliApiClient.ts
|
|
12
12
|
var CliApiError = class extends Error {
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
} from "./chunk-QYPE3TS3.js";
|
|
15
15
|
import {
|
|
16
16
|
runLlm
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-DBEIHUCJ.js";
|
|
18
18
|
import {
|
|
19
19
|
getApproxPricePerImage
|
|
20
20
|
} from "./chunk-4JH2UMJR.js";
|
|
@@ -11067,7 +11067,7 @@ var messageSlice = createSliceWithThunks({
|
|
|
11067
11067
|
runtimeOptions: args.runtimeOptions
|
|
11068
11068
|
});
|
|
11069
11069
|
if (agentKeyToUse) {
|
|
11070
|
-
const { streamAgentChatTurn } = await import("./agentSlice-
|
|
11070
|
+
const { streamAgentChatTurn } = await import("./agentSlice-2PEJP3NV.js");
|
|
11071
11071
|
await dispatch(
|
|
11072
11072
|
streamAgentChatTurn({
|
|
11073
11073
|
agentKey: agentKeyToUse,
|
|
@@ -13881,7 +13881,7 @@ var deleteDialogThunk = async (payload, thunkApi) => {
|
|
|
13881
13881
|
}
|
|
13882
13882
|
if (isCurrentDialog) {
|
|
13883
13883
|
await thunkApi.dispatch(resetMsgs());
|
|
13884
|
-
const { clearPendingAttachments: clearPendingAttachments2 } = await import("./dialogSlice-
|
|
13884
|
+
const { clearPendingAttachments: clearPendingAttachments2 } = await import("./dialogSlice-U3X3CBR7.js");
|
|
13885
13885
|
dispatch(clearPendingAttachments2());
|
|
13886
13886
|
}
|
|
13887
13887
|
return { dialogKey, isCurrentDialog, attachmentPlan };
|
|
@@ -13889,15 +13889,15 @@ var deleteDialogThunk = async (payload, thunkApi) => {
|
|
|
13889
13889
|
|
|
13890
13890
|
// packages/chat/dialog/dialogSlice.ts
|
|
13891
13891
|
var runCreateDialogAction = async (args, thunkApi) => {
|
|
13892
|
-
const { createDialogAction } = await import("./createDialogAction-
|
|
13892
|
+
const { createDialogAction } = await import("./createDialogAction-GIZ7QCRQ.js");
|
|
13893
13893
|
return createDialogAction(args, thunkApi);
|
|
13894
13894
|
};
|
|
13895
13895
|
var runCreateAgentAutomationAction = async (args, thunkApi) => {
|
|
13896
|
-
const { createAgentAutomationAction } = await import("./createAgentAutomationAction-
|
|
13896
|
+
const { createAgentAutomationAction } = await import("./createAgentAutomationAction-Y5W2FW3Y.js");
|
|
13897
13897
|
return createAgentAutomationAction(args, thunkApi);
|
|
13898
13898
|
};
|
|
13899
13899
|
var runUpdateDialogTitleAction = async (args, thunkApi) => {
|
|
13900
|
-
const { updateDialogTitleAction } = await import("./updateDialogTitleAction-
|
|
13900
|
+
const { updateDialogTitleAction } = await import("./updateDialogTitleAction-2RKLYUPB.js");
|
|
13901
13901
|
return updateDialogTitleAction(args, thunkApi);
|
|
13902
13902
|
};
|
|
13903
13903
|
var runAddDialogAgentAction = async (args, thunkApi) => {
|
|
@@ -13921,7 +13921,7 @@ var runSetDialogExtraReferencesAction = async (args, thunkApi) => {
|
|
|
13921
13921
|
return setDialogExtraReferencesAction(args, thunkApi);
|
|
13922
13922
|
};
|
|
13923
13923
|
var runHandleSendMessageAction = async (args, thunkApi) => {
|
|
13924
|
-
const { handleSendMessageAction } = await import("./handleSendMessageAction-
|
|
13924
|
+
const { handleSendMessageAction } = await import("./handleSendMessageAction-MZKFIPYL.js");
|
|
13925
13925
|
return handleSendMessageAction(args, thunkApi);
|
|
13926
13926
|
};
|
|
13927
13927
|
function clearDialogState() {
|
|
@@ -13934,7 +13934,7 @@ var createPageAndAddReference = createAsyncThunk(
|
|
|
13934
13934
|
async (payload, { dispatch, getState, rejectWithValue }) => {
|
|
13935
13935
|
const { slateData, jsonData, title, type, fileId, groupId, dialogKey } = payload;
|
|
13936
13936
|
try {
|
|
13937
|
-
const { createDocState } = await import("./docStore-
|
|
13937
|
+
const { createDocState } = await import("./docStore-H2XCYODR.js");
|
|
13938
13938
|
const pageKey = await createDocState(
|
|
13939
13939
|
{ slateData, title },
|
|
13940
13940
|
{ dispatch, getState }
|