@vm0/cli 9.148.1 → 9.148.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/{chunk-WSZTOGEW.js → chunk-KAN2DFAY.js} +95 -33
- package/{chunk-WSZTOGEW.js.map → chunk-KAN2DFAY.js.map} +1 -1
- package/index.js +22 -15
- package/index.js.map +1 -1
- package/package.json +1 -1
- package/zero.js +27 -11
- package/zero.js.map +1 -1
package/package.json
CHANGED
package/zero.js
CHANGED
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
CONNECTOR_TYPES,
|
|
7
7
|
Command,
|
|
8
8
|
EventRenderer,
|
|
9
|
+
EventStreamNormalizer,
|
|
9
10
|
MODEL_PROVIDER_TYPES,
|
|
10
11
|
Option,
|
|
11
12
|
completePhoneFileUpload,
|
|
@@ -126,7 +127,7 @@ import {
|
|
|
126
127
|
withErrorHandler,
|
|
127
128
|
zeroAgentCustomSkillNameSchema,
|
|
128
129
|
zeroRemoteAgentCommand
|
|
129
|
-
} from "./chunk-
|
|
130
|
+
} from "./chunk-KAN2DFAY.js";
|
|
130
131
|
import {
|
|
131
132
|
__toESM,
|
|
132
133
|
init_esm_shims
|
|
@@ -3215,12 +3216,18 @@ function sleep(ms) {
|
|
|
3215
3216
|
}
|
|
3216
3217
|
async function pollZeroEvents(runId, options) {
|
|
3217
3218
|
const renderer = new EventRenderer({ verbose: options?.verbose });
|
|
3219
|
+
const normalizer = new EventStreamNormalizer();
|
|
3218
3220
|
let lastSequence = -1;
|
|
3219
3221
|
let complete = false;
|
|
3220
3222
|
let result = { succeeded: true, runId };
|
|
3221
3223
|
let terminalRunResponse;
|
|
3222
3224
|
let terminalSeenAt = 0;
|
|
3223
3225
|
let lastTerminalProgressAt = 0;
|
|
3226
|
+
const flushPendingEvents = () => {
|
|
3227
|
+
for (const parsed of normalizer.flush()) {
|
|
3228
|
+
renderer.render(parsed);
|
|
3229
|
+
}
|
|
3230
|
+
};
|
|
3224
3231
|
while (!complete) {
|
|
3225
3232
|
const eventsResponse = await getZeroRunAgentEvents(runId, {
|
|
3226
3233
|
since: lastSequence,
|
|
@@ -3232,9 +3239,11 @@ async function pollZeroEvents(runId, options) {
|
|
|
3232
3239
|
lastSequence
|
|
3233
3240
|
);
|
|
3234
3241
|
for (const event of contiguousEvents) {
|
|
3235
|
-
const
|
|
3236
|
-
|
|
3237
|
-
|
|
3242
|
+
const parsedEvents = normalizer.process(
|
|
3243
|
+
event.eventData,
|
|
3244
|
+
eventsResponse.framework
|
|
3245
|
+
);
|
|
3246
|
+
for (const parsed of parsedEvents) {
|
|
3238
3247
|
renderer.render(parsed);
|
|
3239
3248
|
}
|
|
3240
3249
|
}
|
|
@@ -3262,6 +3271,7 @@ async function pollZeroEvents(runId, options) {
|
|
|
3262
3271
|
lastTerminalProgressAt,
|
|
3263
3272
|
blockedByGap
|
|
3264
3273
|
)) {
|
|
3274
|
+
flushPendingEvents();
|
|
3265
3275
|
result = renderTerminalRunResult(runId, terminalRunResponse);
|
|
3266
3276
|
complete = true;
|
|
3267
3277
|
}
|
|
@@ -5734,11 +5744,13 @@ Examples:
|
|
|
5734
5744
|
|
|
5735
5745
|
// src/commands/zero/logs/index.ts
|
|
5736
5746
|
var PAGE_LIMIT = 100;
|
|
5737
|
-
function renderAgentEvent(event, renderer, framework) {
|
|
5738
|
-
const
|
|
5739
|
-
|
|
5740
|
-
|
|
5741
|
-
|
|
5747
|
+
function renderAgentEvent(event, renderer, normalizer, framework) {
|
|
5748
|
+
const parsedEvents = normalizer.process(
|
|
5749
|
+
event.eventData,
|
|
5750
|
+
framework,
|
|
5751
|
+
new Date(event.createdAt)
|
|
5752
|
+
);
|
|
5753
|
+
for (const parsed of parsedEvents) {
|
|
5742
5754
|
renderer.render(parsed);
|
|
5743
5755
|
}
|
|
5744
5756
|
}
|
|
@@ -5783,9 +5795,13 @@ async function showAgentEvents(runId, options) {
|
|
|
5783
5795
|
showTimestamp: true,
|
|
5784
5796
|
verbose: true
|
|
5785
5797
|
});
|
|
5798
|
+
const normalizer = new EventStreamNormalizer();
|
|
5786
5799
|
const framework = firstResponse.framework;
|
|
5787
5800
|
for (const event of events) {
|
|
5788
|
-
renderAgentEvent(event, renderer, framework);
|
|
5801
|
+
renderAgentEvent(event, renderer, normalizer, framework);
|
|
5802
|
+
}
|
|
5803
|
+
for (const parsed of normalizer.flush()) {
|
|
5804
|
+
renderer.render(parsed);
|
|
5789
5805
|
}
|
|
5790
5806
|
}
|
|
5791
5807
|
var zeroLogsCommand = new Command().name("logs").description("View and search agent run logs").argument("[runId]", "Run ID to view agent events for").addCommand(listCommand12).addCommand(searchCommand2).option(
|
|
@@ -7419,7 +7435,7 @@ function registerZeroCommands(prog, commands) {
|
|
|
7419
7435
|
var program = new Command();
|
|
7420
7436
|
program.name("zero").description(
|
|
7421
7437
|
"Zero CLI \u2014 interact with the zero platform from inside the sandbox"
|
|
7422
|
-
).version("9.148.
|
|
7438
|
+
).version("9.148.2").addHelpText(
|
|
7423
7439
|
"after",
|
|
7424
7440
|
`
|
|
7425
7441
|
Examples:
|