nolo-cli 0.139.0-alpha.1 → 0.140.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-HXIPDI7Q.js → _executeModel-GJGGE6JX.js} +10 -10
- package/{agentEmailCommands-7QB2RPWW.js → agentEmailCommands-BTUG55AL.js} +9 -9
- package/{agentMachineCommands-DL53ZAIR.js → agentMachineCommands-5NBFFTBT.js} +1 -1
- package/{agentRecordCommands-HVRESCTP.js → agentRecordCommands-GFA7RVTG.js} +9 -9
- package/{agentRunCommand-ETERBOFG.js → agentRunCommand-NXT7TWBS.js} +9 -9
- package/{agentSlice-EO7LL6VT.js → agentSlice-WQVGFRLD.js} +1 -1
- package/{chatQueueReduxAdapter-27524QLC.js → chatQueueReduxAdapter-FUXS7NRR.js} +2 -2
- package/{chunk-6SFO23NA.js → chunk-44YE37DR.js} +4 -4
- package/{chunk-L5HM63XP.js → chunk-AA2TX625.js} +2 -2
- package/{chunk-EUND6AAM.js → chunk-AR7XM7CQ.js} +1 -1
- package/{chunk-ISZR4Z6A.js → chunk-C6EZXUCB.js} +2 -2
- package/{chunk-D3LZLKAK.js → chunk-CZNXUKLA.js} +4 -4
- package/{chunk-JZEK4KCJ.js → chunk-ENU52AJZ.js} +1 -1
- package/{chunk-PARMU7Z2.js → chunk-KFMLZ3B5.js} +8 -8
- package/{chunk-XSSTHNXQ.js → chunk-LJVUX3LF.js} +1 -1
- package/{chunk-TW6MNSWL.js → chunk-NRXXVGOQ.js} +2 -2
- package/{chunk-MPRCVW4J.js → chunk-QFDNAM7T.js} +3 -3
- package/{chunk-MS4ZBOMR.js → chunk-RY3FI23Y.js} +8 -8
- package/{chunk-TZU6NT4E.js → chunk-TJUQIJQR.js} +5 -5
- package/{chunk-COTFAI7O.js → chunk-UOCZAVYF.js} +2 -2
- package/{chunk-WZYWLD6H.js → chunk-ZOOAFELH.js} +3 -3
- package/{commandRegistry-EKKQFWXE.js → commandRegistry-XMFDAEN3.js} +14 -14
- package/{contentThunks-HY5AO3KY.js → contentThunks-CDGRYZSO.js} +3 -3
- package/{createAgentAutomationAction-JHE3IIMX.js → createAgentAutomationAction-HJZH45UP.js} +3 -3
- package/{createDialogAction-GE4SGFZE.js → createDialogAction-W2U3KOFN.js} +4 -4
- package/{createPageAction-5W7SP33M.js → createPageAction-4VGPW4AZ.js} +3 -3
- package/{dialogSlice-6CW6J5FW.js → dialogSlice-MGEPXTGX.js} +2 -2
- package/{docStore-3RP3DE4Q.js → docStore-P6JMWIVK.js} +1 -1
- package/{handleSendMessageAction-TFHLM7KU.js → handleSendMessageAction-HAVG5ANU.js} +139 -16
- package/index.js +2 -2
- package/{machineCommands-NSYLVEE7.js → machineCommands-WDAQIYYL.js} +9 -9
- package/{machineWsRunDispatch-N2VXL5QL.js → machineWsRunDispatch-Y3MHLPCI.js} +9 -9
- package/package.json +1 -1
- package/{readlineWorkspace-MP5KA4H4.js → readlineWorkspace-AGIDALGO.js} +9 -9
- package/{runAgentClientLoop-DQ2JSJBW.js → runAgentClientLoop-7RNZVACU.js} +8 -8
- package/{streamAgentChatTurn-T6F23DOK.js → streamAgentChatTurn-T3WC62NT.js} +9 -9
- package/{tools-YCF5PGD5.js → tools-UHCAPZ22.js} +6 -6
- package/{updateDialogTitleAction-5IKSGO4I.js → updateDialogTitleAction-WBIR5A4A.js} +3 -3
|
@@ -103,7 +103,7 @@ function createDaemonShortcutCommand(path, description, command) {
|
|
|
103
103
|
// packages/cli/agentInternalCommandEntries.ts
|
|
104
104
|
function getAgentInternalCommandEntries() {
|
|
105
105
|
const createAgentRunCommand = (path, description) => createContextCommand(path, description, async (args, ctx) => {
|
|
106
|
-
const { runAgentRunCommand } = await import("./agentRunCommand-
|
|
106
|
+
const { runAgentRunCommand } = await import("./agentRunCommand-NXT7TWBS.js");
|
|
107
107
|
return runAgentRunCommand(args, {
|
|
108
108
|
env: ctx.env,
|
|
109
109
|
scriptDir: ctx.scriptDir,
|
|
@@ -119,7 +119,7 @@ function getAgentInternalCommandEntries() {
|
|
|
119
119
|
return runAgentListCommand(args, deps);
|
|
120
120
|
}),
|
|
121
121
|
createEnvCommand(["agent", "create"], "Create a new agent", async (args, deps) => {
|
|
122
|
-
const { runAgentCreateCommand } = await import("./agentRecordCommands-
|
|
122
|
+
const { runAgentCreateCommand } = await import("./agentRecordCommands-GFA7RVTG.js");
|
|
123
123
|
return runAgentCreateCommand(args, deps);
|
|
124
124
|
}),
|
|
125
125
|
createEnvCommand(["agent", "models"], "List models available on an OpenAI-compatible provider", async (args, deps) => {
|
|
@@ -135,7 +135,7 @@ function getAgentInternalCommandEntries() {
|
|
|
135
135
|
return runAgentPullCommand(args, deps);
|
|
136
136
|
}),
|
|
137
137
|
createEnvCommand(["agent", "read"], "Read a single agent", async (args, deps) => {
|
|
138
|
-
const { runAgentReadCommand } = await import("./agentRecordCommands-
|
|
138
|
+
const { runAgentReadCommand } = await import("./agentRecordCommands-GFA7RVTG.js");
|
|
139
139
|
return runAgentReadCommand(args, deps);
|
|
140
140
|
}),
|
|
141
141
|
createAgentRunCommand(["agent", "run"], "Run an agent"),
|
|
@@ -164,26 +164,26 @@ function getAgentInternalCommandEntries() {
|
|
|
164
164
|
return runSetupOfflineMarxistsAgentCommand(args, deps);
|
|
165
165
|
}),
|
|
166
166
|
createEnvCommand(["agent", "update"], "Update agent fields", async (args, deps) => {
|
|
167
|
-
const { runAgentUpdateCommand } = await import("./agentRecordCommands-
|
|
167
|
+
const { runAgentUpdateCommand } = await import("./agentRecordCommands-GFA7RVTG.js");
|
|
168
168
|
return runAgentUpdateCommand(args, deps);
|
|
169
169
|
}),
|
|
170
170
|
createEnvCommand(["agent", "email", "provision"], "Provision a controlled inbox for an agent", async (args, deps) => {
|
|
171
|
-
const { runAgentEmailProvisionCommand } = await import("./agentEmailCommands-
|
|
171
|
+
const { runAgentEmailProvisionCommand } = await import("./agentEmailCommands-BTUG55AL.js");
|
|
172
172
|
return runAgentEmailProvisionCommand(args, deps);
|
|
173
173
|
}),
|
|
174
174
|
createEnvCommand(["agent", "email", "bind"], "Bind an existing email address to an agent", async (args, deps) => {
|
|
175
|
-
const { runAgentEmailBindCommand } = await import("./agentEmailCommands-
|
|
175
|
+
const { runAgentEmailBindCommand } = await import("./agentEmailCommands-BTUG55AL.js");
|
|
176
176
|
return runAgentEmailBindCommand(args, deps);
|
|
177
177
|
}),
|
|
178
178
|
createEnvCommand(["agent", "email", "transfer"], "Transfer an email identity from one agent to another (cross-account)", async (args, deps) => {
|
|
179
|
-
const { runAgentEmailTransferCommand } = await import("./agentEmailCommands-
|
|
179
|
+
const { runAgentEmailTransferCommand } = await import("./agentEmailCommands-BTUG55AL.js");
|
|
180
180
|
return runAgentEmailTransferCommand(args, deps);
|
|
181
181
|
}),
|
|
182
182
|
createEnvCommand(
|
|
183
183
|
["agent", "email", "create-and-provision"],
|
|
184
184
|
"Create an agent and provision its controlled inbox",
|
|
185
185
|
async (args, deps) => {
|
|
186
|
-
const { runAgentEmailCreateAndProvisionCommand } = await import("./agentEmailCommands-
|
|
186
|
+
const { runAgentEmailCreateAndProvisionCommand } = await import("./agentEmailCommands-BTUG55AL.js");
|
|
187
187
|
return runAgentEmailCreateAndProvisionCommand(args, deps);
|
|
188
188
|
}
|
|
189
189
|
),
|
|
@@ -204,15 +204,15 @@ function getAgentInternalCommandEntries() {
|
|
|
204
204
|
return runAgentRevokeGrantCommand(args, deps);
|
|
205
205
|
}),
|
|
206
206
|
createEnvCommand(["agent", "bind-current"], "Bind an agent to this machine", async (args, deps) => {
|
|
207
|
-
const { runAgentBindCurrentCommand } = await import("./agentMachineCommands-
|
|
207
|
+
const { runAgentBindCurrentCommand } = await import("./agentMachineCommands-5NBFFTBT.js");
|
|
208
208
|
return runAgentBindCurrentCommand(args, deps);
|
|
209
209
|
}),
|
|
210
210
|
createEnvCommand(["agent", "smoke-current"], "Smoke test a bound agent through this machine", async (args, deps) => {
|
|
211
|
-
const { runAgentSmokeCurrentCommand } = await import("./agentMachineCommands-
|
|
211
|
+
const { runAgentSmokeCurrentCommand } = await import("./agentMachineCommands-5NBFFTBT.js");
|
|
212
212
|
return runAgentSmokeCurrentCommand(args, deps);
|
|
213
213
|
}),
|
|
214
214
|
createEnvCommand(["agent", "runtime-doctor"], "Diagnose current machine runtime compatibility", async (args, deps) => {
|
|
215
|
-
const { runAgentRuntimeDoctorCommand } = await import("./agentMachineCommands-
|
|
215
|
+
const { runAgentRuntimeDoctorCommand } = await import("./agentMachineCommands-5NBFFTBT.js");
|
|
216
216
|
return runAgentRuntimeDoctorCommand(args, deps);
|
|
217
217
|
}),
|
|
218
218
|
createAgentRunCommand(["agent", "chat"], "Chat with an agent")
|
|
@@ -464,15 +464,15 @@ function getSystemInternalCommandEntries(renderHelpText2) {
|
|
|
464
464
|
return runWhoamiCommand({ args, env: ctx.env });
|
|
465
465
|
}),
|
|
466
466
|
createEntrypointEnvCommand(["connect"], "Send machine heartbeats or hold a connector websocket", async (args, deps) => {
|
|
467
|
-
const { runMachineConnectCommand } = await import("./machineCommands-
|
|
467
|
+
const { runMachineConnectCommand } = await import("./machineCommands-WDAQIYYL.js");
|
|
468
468
|
return runMachineConnectCommand(args, deps);
|
|
469
469
|
}),
|
|
470
470
|
createDaemonShortcutCommand(["daemon"], "Run the connector daemon shortcut", async (args, deps) => {
|
|
471
|
-
const { runMachineConnectCommand } = await import("./machineCommands-
|
|
471
|
+
const { runMachineConnectCommand } = await import("./machineCommands-WDAQIYYL.js");
|
|
472
472
|
return runMachineConnectCommand(args, deps);
|
|
473
473
|
}),
|
|
474
474
|
createEnvCommand(["machine", "status"], "List machines registered to the current profile", async (args, deps) => {
|
|
475
|
-
const { runMachineStatusCommand } = await import("./machineCommands-
|
|
475
|
+
const { runMachineStatusCommand } = await import("./machineCommands-WDAQIYYL.js");
|
|
476
476
|
return runMachineStatusCommand(args, deps);
|
|
477
477
|
}),
|
|
478
478
|
createEnvCommand(["doctor", "runtime"], "Diagnose local-first agent runtime selection", async (args, deps) => {
|
|
@@ -7,13 +7,13 @@ import {
|
|
|
7
7
|
updateContentPinned,
|
|
8
8
|
updateContentTitle,
|
|
9
9
|
uploadAndAddFileToSpace
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-AR7XM7CQ.js";
|
|
11
11
|
import "./chunk-ZJ7UHBJS.js";
|
|
12
|
-
import "./chunk-
|
|
12
|
+
import "./chunk-KFMLZ3B5.js";
|
|
13
13
|
import "./chunk-MC4XLIJ7.js";
|
|
14
14
|
import "./chunk-YYLHWIW6.js";
|
|
15
15
|
import "./chunk-6O4IK4V2.js";
|
|
16
|
-
import "./chunk-
|
|
16
|
+
import "./chunk-QFDNAM7T.js";
|
|
17
17
|
import "./chunk-D76D3RTR.js";
|
|
18
18
|
import "./chunk-5RGU3J7P.js";
|
|
19
19
|
import "./chunk-M76ECQRD.js";
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
addContentToSpace
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-AR7XM7CQ.js";
|
|
4
4
|
import "./chunk-ZJ7UHBJS.js";
|
|
5
|
-
import "./chunk-
|
|
5
|
+
import "./chunk-KFMLZ3B5.js";
|
|
6
6
|
import "./chunk-MC4XLIJ7.js";
|
|
7
7
|
import "./chunk-YYLHWIW6.js";
|
|
8
8
|
import "./chunk-6O4IK4V2.js";
|
|
9
|
-
import "./chunk-
|
|
9
|
+
import "./chunk-QFDNAM7T.js";
|
|
10
10
|
import "./chunk-D76D3RTR.js";
|
|
11
11
|
import "./chunk-5RGU3J7P.js";
|
|
12
12
|
import "./chunk-M76ECQRD.js";
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createDialogAction,
|
|
3
3
|
isLocalOwnerDialogAgents
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-NRXXVGOQ.js";
|
|
5
|
+
import "./chunk-AR7XM7CQ.js";
|
|
6
6
|
import "./chunk-ZJ7UHBJS.js";
|
|
7
|
-
import "./chunk-
|
|
7
|
+
import "./chunk-KFMLZ3B5.js";
|
|
8
8
|
import "./chunk-MC4XLIJ7.js";
|
|
9
9
|
import "./chunk-YYLHWIW6.js";
|
|
10
10
|
import "./chunk-6O4IK4V2.js";
|
|
11
|
-
import "./chunk-
|
|
11
|
+
import "./chunk-QFDNAM7T.js";
|
|
12
12
|
import "./chunk-D76D3RTR.js";
|
|
13
13
|
import "./chunk-5RGU3J7P.js";
|
|
14
14
|
import "./chunk-M76ECQRD.js";
|
|
@@ -14,15 +14,15 @@ import {
|
|
|
14
14
|
import {
|
|
15
15
|
addContentToSpace,
|
|
16
16
|
client_default
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-AR7XM7CQ.js";
|
|
18
18
|
import {
|
|
19
19
|
getCurrentSpaceId
|
|
20
20
|
} from "./chunk-ZJ7UHBJS.js";
|
|
21
|
-
import "./chunk-
|
|
21
|
+
import "./chunk-KFMLZ3B5.js";
|
|
22
22
|
import "./chunk-MC4XLIJ7.js";
|
|
23
23
|
import "./chunk-YYLHWIW6.js";
|
|
24
24
|
import "./chunk-6O4IK4V2.js";
|
|
25
|
-
import "./chunk-
|
|
25
|
+
import "./chunk-QFDNAM7T.js";
|
|
26
26
|
import "./chunk-D76D3RTR.js";
|
|
27
27
|
import "./chunk-5RGU3J7P.js";
|
|
28
28
|
import "./chunk-M76ECQRD.js";
|
|
@@ -20,11 +20,11 @@ import {
|
|
|
20
20
|
switchDialogAgent,
|
|
21
21
|
updateDialogTitle,
|
|
22
22
|
updateTokens
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-KFMLZ3B5.js";
|
|
24
24
|
import "./chunk-MC4XLIJ7.js";
|
|
25
25
|
import "./chunk-YYLHWIW6.js";
|
|
26
26
|
import "./chunk-6O4IK4V2.js";
|
|
27
|
-
import "./chunk-
|
|
27
|
+
import "./chunk-QFDNAM7T.js";
|
|
28
28
|
import "./chunk-D76D3RTR.js";
|
|
29
29
|
import {
|
|
30
30
|
getActiveDialogAgentId
|
|
@@ -27,13 +27,13 @@ import {
|
|
|
27
27
|
removeTransientMessage,
|
|
28
28
|
resolveHandleSendMessageContext,
|
|
29
29
|
selectAllMsgs
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-KFMLZ3B5.js";
|
|
31
31
|
import "./chunk-MC4XLIJ7.js";
|
|
32
32
|
import "./chunk-YYLHWIW6.js";
|
|
33
33
|
import "./chunk-6O4IK4V2.js";
|
|
34
34
|
import {
|
|
35
35
|
streamAgentChatTurn
|
|
36
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-QFDNAM7T.js";
|
|
37
37
|
import "./chunk-D76D3RTR.js";
|
|
38
38
|
import "./chunk-5RGU3J7P.js";
|
|
39
39
|
import "./chunk-M76ECQRD.js";
|
|
@@ -58,6 +58,9 @@ import "./chunk-W7XHHYWM.js";
|
|
|
58
58
|
import "./chunk-B7ANJQWZ.js";
|
|
59
59
|
import "./chunk-UAD2WT54.js";
|
|
60
60
|
import "./chunk-HNGRBWYF.js";
|
|
61
|
+
import {
|
|
62
|
+
canonicalizeToolName
|
|
63
|
+
} from "./chunk-O6OSWFZQ.js";
|
|
61
64
|
import "./chunk-ACTMNVHM.js";
|
|
62
65
|
import "./chunk-Q67DOFOO.js";
|
|
63
66
|
import {
|
|
@@ -101,22 +104,47 @@ import "./chunk-G3SUCT4W.js";
|
|
|
101
104
|
import "./chunk-4VNS5WPM.js";
|
|
102
105
|
|
|
103
106
|
// packages/ai/agent/serverOwnedWebForegroundEligibility.ts
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
if (
|
|
107
|
+
var FIRST_DURABLE_WEB_TOOL = "ask_user";
|
|
108
|
+
function readToolName(value) {
|
|
109
|
+
if (typeof value === "string") {
|
|
110
|
+
const name2 = value.trim();
|
|
111
|
+
return name2 || null;
|
|
112
|
+
}
|
|
113
|
+
if (!value || typeof value !== "object") return null;
|
|
114
|
+
const record = value;
|
|
115
|
+
const candidate = typeof record.name === "string" && record.name || typeof record.toolName === "string" && record.toolName || typeof record.function?.name === "string" && record.function.name || "";
|
|
116
|
+
const name = candidate.trim();
|
|
117
|
+
return name || null;
|
|
118
|
+
}
|
|
119
|
+
function configuredToolNames(agent) {
|
|
120
|
+
const values = [];
|
|
121
|
+
if (Array.isArray(agent.tools)) values.push(...agent.tools);
|
|
122
|
+
if (Array.isArray(agent.toolNames)) values.push(...agent.toolNames);
|
|
107
123
|
const policies = [
|
|
108
124
|
agent.runtimeToolPolicy,
|
|
109
125
|
agent.runtimeBinding?.runtimeToolPolicy,
|
|
110
126
|
agent.runtimeBinding?.runtimeToolPolicySnapshot
|
|
111
127
|
];
|
|
112
|
-
|
|
113
|
-
if (!policy || typeof policy !== "object")
|
|
114
|
-
if (Array.isArray(policy.agentTools)
|
|
115
|
-
if (Array.isArray(policy.runtimeTools)
|
|
116
|
-
|
|
117
|
-
|
|
128
|
+
for (const policy of policies) {
|
|
129
|
+
if (!policy || typeof policy !== "object") continue;
|
|
130
|
+
if (Array.isArray(policy.agentTools)) values.push(...policy.agentTools);
|
|
131
|
+
if (Array.isArray(policy.runtimeTools)) values.push(...policy.runtimeTools);
|
|
132
|
+
}
|
|
133
|
+
return [...new Set(values.map(readToolName).filter((name) => !!name))];
|
|
134
|
+
}
|
|
135
|
+
function hasSupportedDurableToolSurface(agent) {
|
|
136
|
+
const policies = [
|
|
137
|
+
agent.runtimeToolPolicy,
|
|
138
|
+
agent.runtimeBinding?.runtimeToolPolicy,
|
|
139
|
+
agent.runtimeBinding?.runtimeToolPolicySnapshot
|
|
140
|
+
];
|
|
141
|
+
if (policies.some(
|
|
142
|
+
(policy) => policy && typeof policy === "object" && (policy.shell?.enabled === true || policy.workspace?.mode === "lease")
|
|
143
|
+
)) {
|
|
118
144
|
return false;
|
|
119
|
-
}
|
|
145
|
+
}
|
|
146
|
+
const names = configuredToolNames(agent);
|
|
147
|
+
return names.length === 0 || names.every((name) => name === FIRST_DURABLE_WEB_TOOL);
|
|
120
148
|
}
|
|
121
149
|
function shouldUseServerOwnedWebForegroundTurn(input) {
|
|
122
150
|
if (input.isDesktopApp) return false;
|
|
@@ -127,7 +155,7 @@ function shouldUseServerOwnedWebForegroundTurn(input) {
|
|
|
127
155
|
if (agent.useServerProxy === false) return false;
|
|
128
156
|
if (agent.apiSource === "cli") return false;
|
|
129
157
|
if (agent.runtimeBinding?.machineId) return false;
|
|
130
|
-
if (
|
|
158
|
+
if (!hasSupportedDurableToolSurface(agent)) return false;
|
|
131
159
|
const runtimeOptions = input.runtimeOptions;
|
|
132
160
|
if (runtimeOptions?.extraTools?.length) return false;
|
|
133
161
|
if (runtimeOptions?.editingTarget) return false;
|
|
@@ -139,6 +167,87 @@ function shouldUseServerOwnedWebForegroundTurn(input) {
|
|
|
139
167
|
return true;
|
|
140
168
|
}
|
|
141
169
|
|
|
170
|
+
// packages/ai/agent/serverOwnedAskUserProjection.ts
|
|
171
|
+
function parseToolArgs(raw) {
|
|
172
|
+
if (typeof raw !== "string" || !raw.trim()) return {};
|
|
173
|
+
try {
|
|
174
|
+
const parsed = JSON.parse(raw);
|
|
175
|
+
return parsed && typeof parsed === "object" && !Array.isArray(parsed) ? parsed : {};
|
|
176
|
+
} catch {
|
|
177
|
+
return {};
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
function createServerOwnedAskUserProjection(args) {
|
|
181
|
+
const transientByCallId = /* @__PURE__ */ new Map();
|
|
182
|
+
const handlePayload = (payload) => {
|
|
183
|
+
if (!payload || typeof payload !== "object") return;
|
|
184
|
+
if (payload.type === "assistant_tool_calls") {
|
|
185
|
+
const calls = Array.isArray(payload.tool_calls) ? payload.tool_calls : [];
|
|
186
|
+
for (const call of calls) {
|
|
187
|
+
const callId = typeof call?.id === "string" ? call.id : "";
|
|
188
|
+
const toolName = canonicalizeToolName(call?.function?.name ?? "");
|
|
189
|
+
if (!callId || toolName !== "ask_user") continue;
|
|
190
|
+
if (transientByCallId.has(callId)) continue;
|
|
191
|
+
const { key, messageId } = createDialogMessageKeyAndId(args.dialogId);
|
|
192
|
+
const input = parseToolArgs(call?.function?.arguments);
|
|
193
|
+
const message = {
|
|
194
|
+
id: messageId,
|
|
195
|
+
dialogId: args.dialogId,
|
|
196
|
+
dbKey: key,
|
|
197
|
+
role: "tool",
|
|
198
|
+
// Pending args, not a tool result: the panel renders the question card
|
|
199
|
+
// from `content`, so a single-question call (question + choices, no
|
|
200
|
+
// `questions`) would otherwise render as an empty row until the
|
|
201
|
+
// tool_result arrives. The canonical payload replaces this on done.
|
|
202
|
+
content: JSON.stringify({ type: "ask_user", ...input }),
|
|
203
|
+
isStreaming: true,
|
|
204
|
+
toolName: "ask_user",
|
|
205
|
+
toolCallId: callId,
|
|
206
|
+
toolPayload: {
|
|
207
|
+
toolName: "ask_user",
|
|
208
|
+
status: "running",
|
|
209
|
+
input,
|
|
210
|
+
rawToolCall: call,
|
|
211
|
+
summary: ""
|
|
212
|
+
},
|
|
213
|
+
...args.messageMetadata
|
|
214
|
+
};
|
|
215
|
+
transientByCallId.set(callId, message);
|
|
216
|
+
args.dispatch(messageStreaming(message));
|
|
217
|
+
}
|
|
218
|
+
return;
|
|
219
|
+
}
|
|
220
|
+
if (payload.type === "tool_result") {
|
|
221
|
+
const callId = typeof payload.toolCallId === "string" ? payload.toolCallId : "";
|
|
222
|
+
const existing = transientByCallId.get(callId);
|
|
223
|
+
if (!existing || canonicalizeToolName(payload.toolName ?? existing.toolName) !== "ask_user") {
|
|
224
|
+
return;
|
|
225
|
+
}
|
|
226
|
+
const message = {
|
|
227
|
+
...existing,
|
|
228
|
+
content: typeof payload.content === "string" ? payload.content : "",
|
|
229
|
+
// Keep read-only until canonical server persistence is reloaded.
|
|
230
|
+
isStreaming: true,
|
|
231
|
+
toolPayload: {
|
|
232
|
+
...existing.toolPayload ?? {},
|
|
233
|
+
status: "running"
|
|
234
|
+
}
|
|
235
|
+
};
|
|
236
|
+
transientByCallId.set(callId, message);
|
|
237
|
+
args.dispatch(messageStreaming(message));
|
|
238
|
+
}
|
|
239
|
+
};
|
|
240
|
+
const cleanup = () => {
|
|
241
|
+
for (const message of transientByCallId.values()) {
|
|
242
|
+
args.dispatch(
|
|
243
|
+
removeTransientMessage({ id: message.id, dialogId: args.dialogId })
|
|
244
|
+
);
|
|
245
|
+
}
|
|
246
|
+
transientByCallId.clear();
|
|
247
|
+
};
|
|
248
|
+
return { handlePayload, cleanup, transientByCallId };
|
|
249
|
+
}
|
|
250
|
+
|
|
142
251
|
// packages/ai/agent/serverOwnedWebForegroundTurn.ts
|
|
143
252
|
async function canRunServerOwnedWebForegroundTurn(args, thunk) {
|
|
144
253
|
let agentConfig = args.agentConfig ?? void 0;
|
|
@@ -181,10 +290,20 @@ async function runServerOwnedWebForegroundTurn(args, thunk) {
|
|
|
181
290
|
if (!userInput.trim()) {
|
|
182
291
|
throw new Error("Server-owned foreground turn requires text input");
|
|
183
292
|
}
|
|
293
|
+
const userId = selectIdentityUserId(thunk.getState());
|
|
184
294
|
const { key: transientKey, messageId: transientId } = createDialogMessageKeyAndId(dialogId);
|
|
185
295
|
const controller = new AbortController();
|
|
186
296
|
const loopKey = `server-owned:${dialogId}:${transientId}`;
|
|
187
297
|
let accumulated = "";
|
|
298
|
+
const askUserProjection = createServerOwnedAskUserProjection({
|
|
299
|
+
dialogId,
|
|
300
|
+
dispatch: thunk.dispatch,
|
|
301
|
+
messageMetadata: {
|
|
302
|
+
cybotKey: args.agentKey,
|
|
303
|
+
agentKey: args.agentKey,
|
|
304
|
+
userId
|
|
305
|
+
}
|
|
306
|
+
});
|
|
188
307
|
thunk.dispatch(
|
|
189
308
|
addActiveController({
|
|
190
309
|
messageId: loopKey,
|
|
@@ -201,7 +320,7 @@ async function runServerOwnedWebForegroundTurn(args, thunk) {
|
|
|
201
320
|
content: "",
|
|
202
321
|
cybotKey: args.agentKey,
|
|
203
322
|
agentKey: args.agentKey,
|
|
204
|
-
userId
|
|
323
|
+
userId
|
|
205
324
|
})
|
|
206
325
|
);
|
|
207
326
|
const body = JSON.stringify({
|
|
@@ -219,7 +338,8 @@ async function runServerOwnedWebForegroundTurn(args, thunk) {
|
|
|
219
338
|
"streaming",
|
|
220
339
|
"dialog-ui",
|
|
221
340
|
"durable-foreground",
|
|
222
|
-
"client-user-prepersisted"
|
|
341
|
+
"client-user-prepersisted",
|
|
342
|
+
"ask-user-tool-card"
|
|
223
343
|
],
|
|
224
344
|
...args.dialogConfig.agentMode === "auto" ? { dialogAgentMode: "auto" } : { dialogAgentMode: "fixed" }
|
|
225
345
|
},
|
|
@@ -278,6 +398,7 @@ async function runServerOwnedWebForegroundTurn(args, thunk) {
|
|
|
278
398
|
if (payload?.type === "error") {
|
|
279
399
|
return { reject: payload.message || "Agent execution failed" };
|
|
280
400
|
}
|
|
401
|
+
askUserProjection.handlePayload(payload);
|
|
281
402
|
if (payload?.type === "text" && typeof payload.content === "string") {
|
|
282
403
|
accumulated += payload.content;
|
|
283
404
|
thunk.dispatch(
|
|
@@ -289,7 +410,7 @@ async function runServerOwnedWebForegroundTurn(args, thunk) {
|
|
|
289
410
|
content: accumulated,
|
|
290
411
|
cybotKey: args.agentKey,
|
|
291
412
|
agentKey: args.agentKey,
|
|
292
|
-
userId
|
|
413
|
+
userId
|
|
293
414
|
})
|
|
294
415
|
);
|
|
295
416
|
}
|
|
@@ -304,6 +425,7 @@ async function runServerOwnedWebForegroundTurn(args, thunk) {
|
|
|
304
425
|
if (!outcome.sawDone) {
|
|
305
426
|
return { serverOwned: true, detached: true };
|
|
306
427
|
}
|
|
428
|
+
askUserProjection.cleanup();
|
|
307
429
|
thunk.dispatch(removeTransientMessage({ id: transientId, dialogId }));
|
|
308
430
|
await thunk.dispatch(initMsgs({ dialogId })).unwrap();
|
|
309
431
|
return { serverOwned: true };
|
|
@@ -314,6 +436,7 @@ async function runServerOwnedWebForegroundTurn(args, thunk) {
|
|
|
314
436
|
dialogKey
|
|
315
437
|
})
|
|
316
438
|
);
|
|
439
|
+
askUserProjection.cleanup();
|
|
317
440
|
thunk.dispatch(removeTransientMessage({ id: transientId, dialogId }));
|
|
318
441
|
}
|
|
319
442
|
}
|
package/index.js
CHANGED
|
@@ -71,7 +71,7 @@ async function runScript(script, forwardedArgs, env) {
|
|
|
71
71
|
return proc.exited;
|
|
72
72
|
}
|
|
73
73
|
async function launchTuiWorkspace(args2) {
|
|
74
|
-
const { startTuiWorkspace } = await import("./readlineWorkspace-
|
|
74
|
+
const { startTuiWorkspace } = await import("./readlineWorkspace-AGIDALGO.js");
|
|
75
75
|
const { createTuiSummaryLlmCaller } = await import("./tuiSummaryLlmCaller-W36LJRZU.js");
|
|
76
76
|
return startTuiWorkspace({
|
|
77
77
|
...args2,
|
|
@@ -81,7 +81,7 @@ async function launchTuiWorkspace(args2) {
|
|
|
81
81
|
});
|
|
82
82
|
}
|
|
83
83
|
async function main() {
|
|
84
|
-
const { createCliRuntimeContext, looksLikeDaemonShortcut, renderHelpText, resolveCommand, runResolvedCommand } = await import("./commandRegistry-
|
|
84
|
+
const { createCliRuntimeContext, looksLikeDaemonShortcut, renderHelpText, resolveCommand, runResolvedCommand } = await import("./commandRegistry-XMFDAEN3.js");
|
|
85
85
|
const { buildCliRuntimeEnv, loadProfileConfig } = await import("./profileConfig-ZGOFORWV.js");
|
|
86
86
|
const { resolveTuiLaunchMode } = await import("./runtimeModeArgs-2Y7BALTO.js");
|
|
87
87
|
const runtimeEnv = {
|
|
@@ -2,13 +2,13 @@ import {
|
|
|
2
2
|
buildMachinePermissionPromptBlock,
|
|
3
3
|
handleConnectorRunMessage,
|
|
4
4
|
resolveMachineRunPermissionPolicy
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-C6EZXUCB.js";
|
|
6
6
|
import {
|
|
7
7
|
isConnectorWebSocketAuthError,
|
|
8
8
|
isConnectorWebSocketRetryableError,
|
|
9
9
|
resolveConnectorWebSocketTarget
|
|
10
10
|
} from "./chunk-ALXHV7NK.js";
|
|
11
|
-
import "./chunk-
|
|
11
|
+
import "./chunk-44YE37DR.js";
|
|
12
12
|
import "./chunk-XSW2IKJM.js";
|
|
13
13
|
import "./chunk-OY5IJI2N.js";
|
|
14
14
|
import "./chunk-62IL3KQV.js";
|
|
@@ -25,9 +25,9 @@ import "./chunk-4XEYAFLY.js";
|
|
|
25
25
|
import "./chunk-JBTJAPUF.js";
|
|
26
26
|
import "./chunk-QJLEMM2V.js";
|
|
27
27
|
import "./chunk-ATNTHIZI.js";
|
|
28
|
-
import "./chunk-
|
|
28
|
+
import "./chunk-UOCZAVYF.js";
|
|
29
29
|
import "./chunk-HS7MLR74.js";
|
|
30
|
-
import "./chunk-
|
|
30
|
+
import "./chunk-RY3FI23Y.js";
|
|
31
31
|
import "./chunk-YSC3EI23.js";
|
|
32
32
|
import "./chunk-5UTFL4QJ.js";
|
|
33
33
|
import "./chunk-KQHGZWSV.js";
|
|
@@ -37,23 +37,23 @@ import {
|
|
|
37
37
|
CORE_DRAIN_REASON
|
|
38
38
|
} from "./chunk-3L2WKC3W.js";
|
|
39
39
|
import "./chunk-3VNWWVKB.js";
|
|
40
|
-
import "./chunk-
|
|
40
|
+
import "./chunk-NRXXVGOQ.js";
|
|
41
41
|
import "./chunk-HNRASX3X.js";
|
|
42
42
|
import "./chunk-YRRASA5Q.js";
|
|
43
43
|
import "./chunk-63W5N6P3.js";
|
|
44
44
|
import "./chunk-VF4K2QE6.js";
|
|
45
|
-
import "./chunk-
|
|
45
|
+
import "./chunk-AA2TX625.js";
|
|
46
46
|
import "./chunk-Z7IZQF56.js";
|
|
47
47
|
import "./chunk-XPRWFQQK.js";
|
|
48
48
|
import "./chunk-BJUDYFV5.js";
|
|
49
49
|
import "./chunk-MEYIRKDN.js";
|
|
50
|
-
import "./chunk-
|
|
50
|
+
import "./chunk-AR7XM7CQ.js";
|
|
51
51
|
import "./chunk-ZJ7UHBJS.js";
|
|
52
|
-
import "./chunk-
|
|
52
|
+
import "./chunk-KFMLZ3B5.js";
|
|
53
53
|
import "./chunk-MC4XLIJ7.js";
|
|
54
54
|
import "./chunk-YYLHWIW6.js";
|
|
55
55
|
import "./chunk-6O4IK4V2.js";
|
|
56
|
-
import "./chunk-
|
|
56
|
+
import "./chunk-QFDNAM7T.js";
|
|
57
57
|
import "./chunk-D76D3RTR.js";
|
|
58
58
|
import "./chunk-5RGU3J7P.js";
|
|
59
59
|
import "./chunk-M76ECQRD.js";
|
|
@@ -11,8 +11,8 @@ import {
|
|
|
11
11
|
runtimeWorkspacePermissionPolicy,
|
|
12
12
|
scopePermissionPolicyToRuntimeWorkspace,
|
|
13
13
|
summarizeAgentConfigForLogs
|
|
14
|
-
} from "./chunk-
|
|
15
|
-
import "./chunk-
|
|
14
|
+
} from "./chunk-C6EZXUCB.js";
|
|
15
|
+
import "./chunk-44YE37DR.js";
|
|
16
16
|
import "./chunk-XSW2IKJM.js";
|
|
17
17
|
import "./chunk-OY5IJI2N.js";
|
|
18
18
|
import "./chunk-62IL3KQV.js";
|
|
@@ -26,9 +26,9 @@ import "./chunk-4XEYAFLY.js";
|
|
|
26
26
|
import "./chunk-JBTJAPUF.js";
|
|
27
27
|
import "./chunk-QJLEMM2V.js";
|
|
28
28
|
import "./chunk-ATNTHIZI.js";
|
|
29
|
-
import "./chunk-
|
|
29
|
+
import "./chunk-UOCZAVYF.js";
|
|
30
30
|
import "./chunk-HS7MLR74.js";
|
|
31
|
-
import "./chunk-
|
|
31
|
+
import "./chunk-RY3FI23Y.js";
|
|
32
32
|
import "./chunk-YSC3EI23.js";
|
|
33
33
|
import "./chunk-5UTFL4QJ.js";
|
|
34
34
|
import "./chunk-KQHGZWSV.js";
|
|
@@ -36,23 +36,23 @@ import "./chunk-GOMR6S5Z.js";
|
|
|
36
36
|
import "./chunk-NF64D32W.js";
|
|
37
37
|
import "./chunk-3L2WKC3W.js";
|
|
38
38
|
import "./chunk-3VNWWVKB.js";
|
|
39
|
-
import "./chunk-
|
|
39
|
+
import "./chunk-NRXXVGOQ.js";
|
|
40
40
|
import "./chunk-HNRASX3X.js";
|
|
41
41
|
import "./chunk-YRRASA5Q.js";
|
|
42
42
|
import "./chunk-63W5N6P3.js";
|
|
43
43
|
import "./chunk-VF4K2QE6.js";
|
|
44
|
-
import "./chunk-
|
|
44
|
+
import "./chunk-AA2TX625.js";
|
|
45
45
|
import "./chunk-Z7IZQF56.js";
|
|
46
46
|
import "./chunk-XPRWFQQK.js";
|
|
47
47
|
import "./chunk-BJUDYFV5.js";
|
|
48
48
|
import "./chunk-MEYIRKDN.js";
|
|
49
|
-
import "./chunk-
|
|
49
|
+
import "./chunk-AR7XM7CQ.js";
|
|
50
50
|
import "./chunk-ZJ7UHBJS.js";
|
|
51
|
-
import "./chunk-
|
|
51
|
+
import "./chunk-KFMLZ3B5.js";
|
|
52
52
|
import "./chunk-MC4XLIJ7.js";
|
|
53
53
|
import "./chunk-YYLHWIW6.js";
|
|
54
54
|
import "./chunk-6O4IK4V2.js";
|
|
55
|
-
import "./chunk-
|
|
55
|
+
import "./chunk-QFDNAM7T.js";
|
|
56
56
|
import "./chunk-D76D3RTR.js";
|
|
57
57
|
import "./chunk-5RGU3J7P.js";
|
|
58
58
|
import "./chunk-M76ECQRD.js";
|
package/package.json
CHANGED
|
@@ -70,7 +70,7 @@ import {
|
|
|
70
70
|
wrapTextToLines,
|
|
71
71
|
wrapTranscriptLine,
|
|
72
72
|
wrapTranscriptLineWithLayout
|
|
73
|
-
} from "./chunk-
|
|
73
|
+
} from "./chunk-CZNXUKLA.js";
|
|
74
74
|
import "./chunk-VJVNU77E.js";
|
|
75
75
|
import "./chunk-BIDGLJQ3.js";
|
|
76
76
|
import {
|
|
@@ -82,7 +82,7 @@ import {
|
|
|
82
82
|
readTimestamp,
|
|
83
83
|
setCliLocale,
|
|
84
84
|
t
|
|
85
|
-
} from "./chunk-
|
|
85
|
+
} from "./chunk-44YE37DR.js";
|
|
86
86
|
import "./chunk-XSW2IKJM.js";
|
|
87
87
|
import "./chunk-OY5IJI2N.js";
|
|
88
88
|
import "./chunk-62IL3KQV.js";
|
|
@@ -136,12 +136,12 @@ import "./chunk-ATNTHIZI.js";
|
|
|
136
136
|
import "./chunk-JEXVIMYZ.js";
|
|
137
137
|
import {
|
|
138
138
|
prepareTools
|
|
139
|
-
} from "./chunk-
|
|
139
|
+
} from "./chunk-UOCZAVYF.js";
|
|
140
140
|
import {
|
|
141
141
|
buildResponseGuidelines
|
|
142
142
|
} from "./chunk-EOARMOVD.js";
|
|
143
143
|
import "./chunk-HS7MLR74.js";
|
|
144
|
-
import "./chunk-
|
|
144
|
+
import "./chunk-RY3FI23Y.js";
|
|
145
145
|
import "./chunk-YSC3EI23.js";
|
|
146
146
|
import "./chunk-5UTFL4QJ.js";
|
|
147
147
|
import "./chunk-KQHGZWSV.js";
|
|
@@ -159,12 +159,12 @@ import {
|
|
|
159
159
|
runShowsLogTail,
|
|
160
160
|
shortRunId
|
|
161
161
|
} from "./chunk-3VNWWVKB.js";
|
|
162
|
-
import "./chunk-
|
|
162
|
+
import "./chunk-NRXXVGOQ.js";
|
|
163
163
|
import "./chunk-HNRASX3X.js";
|
|
164
164
|
import "./chunk-YRRASA5Q.js";
|
|
165
165
|
import "./chunk-63W5N6P3.js";
|
|
166
166
|
import "./chunk-VF4K2QE6.js";
|
|
167
|
-
import "./chunk-
|
|
167
|
+
import "./chunk-AA2TX625.js";
|
|
168
168
|
import "./chunk-Z7IZQF56.js";
|
|
169
169
|
import "./chunk-XPRWFQQK.js";
|
|
170
170
|
import {
|
|
@@ -174,15 +174,15 @@ import {
|
|
|
174
174
|
} from "./chunk-YPREESF4.js";
|
|
175
175
|
import "./chunk-BJUDYFV5.js";
|
|
176
176
|
import "./chunk-MEYIRKDN.js";
|
|
177
|
-
import "./chunk-
|
|
177
|
+
import "./chunk-AR7XM7CQ.js";
|
|
178
178
|
import "./chunk-ZJ7UHBJS.js";
|
|
179
179
|
import {
|
|
180
180
|
extractReferenceKeysFromMessage
|
|
181
|
-
} from "./chunk-
|
|
181
|
+
} from "./chunk-KFMLZ3B5.js";
|
|
182
182
|
import "./chunk-MC4XLIJ7.js";
|
|
183
183
|
import "./chunk-YYLHWIW6.js";
|
|
184
184
|
import "./chunk-6O4IK4V2.js";
|
|
185
|
-
import "./chunk-
|
|
185
|
+
import "./chunk-QFDNAM7T.js";
|
|
186
186
|
import "./chunk-D76D3RTR.js";
|
|
187
187
|
import "./chunk-5RGU3J7P.js";
|
|
188
188
|
import "./chunk-M76ECQRD.js";
|