@vm0/cli 9.145.3 → 9.145.5
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.
|
@@ -74083,7 +74083,7 @@ if (DSN) {
|
|
|
74083
74083
|
init2({
|
|
74084
74084
|
dsn: DSN,
|
|
74085
74085
|
environment: process.env.SENTRY_ENVIRONMENT ?? "production",
|
|
74086
|
-
release: "9.145.
|
|
74086
|
+
release: "9.145.5",
|
|
74087
74087
|
sendDefaultPii: false,
|
|
74088
74088
|
tracesSampleRate: 0,
|
|
74089
74089
|
shutdownTimeout: 500,
|
|
@@ -74102,7 +74102,7 @@ if (DSN) {
|
|
|
74102
74102
|
}
|
|
74103
74103
|
});
|
|
74104
74104
|
setContext("cli", {
|
|
74105
|
-
version: "9.145.
|
|
74105
|
+
version: "9.145.5",
|
|
74106
74106
|
command: process.argv.slice(2).join(" ")
|
|
74107
74107
|
});
|
|
74108
74108
|
setContext("runtime", {
|
|
@@ -100940,6 +100940,10 @@ var orgDefaultAgentContract = c8.router({
|
|
|
100940
100940
|
|
|
100941
100941
|
// ../../packages/api-contracts/src/contracts/runs.ts
|
|
100942
100942
|
var c9 = initContract();
|
|
100943
|
+
var MAX_EVENT_SEQUENCE_NUMBER = 2147483647;
|
|
100944
|
+
var eventSequenceNumberSchema = external_exports.number().int().nonnegative().max(MAX_EVENT_SEQUENCE_NUMBER);
|
|
100945
|
+
var eventSequenceCursorSchema = external_exports.number().int().min(-1).max(MAX_EVENT_SEQUENCE_NUMBER);
|
|
100946
|
+
var eventSequenceCursorQuerySchema = external_exports.coerce.number().int().min(-1).max(MAX_EVENT_SEQUENCE_NUMBER);
|
|
100943
100947
|
var ALL_RUN_STATUSES = [
|
|
100944
100948
|
"queued",
|
|
100945
100949
|
"pending",
|
|
@@ -101030,7 +101034,7 @@ var getRunResponseSchema = external_exports.object({
|
|
|
101030
101034
|
completedAt: external_exports.string().optional()
|
|
101031
101035
|
});
|
|
101032
101036
|
var runEventSchema = external_exports.object({
|
|
101033
|
-
sequenceNumber:
|
|
101037
|
+
sequenceNumber: eventSequenceNumberSchema,
|
|
101034
101038
|
eventType: external_exports.string(),
|
|
101035
101039
|
eventData: external_exports.unknown(),
|
|
101036
101040
|
createdAt: external_exports.string()
|
|
@@ -101046,12 +101050,13 @@ var runResultSchema = external_exports.object({
|
|
|
101046
101050
|
var runStateSchema = external_exports.object({
|
|
101047
101051
|
status: runStatusSchema,
|
|
101048
101052
|
result: runResultSchema.optional(),
|
|
101049
|
-
error: external_exports.string().optional()
|
|
101053
|
+
error: external_exports.string().optional(),
|
|
101054
|
+
lastEventSequence: eventSequenceNumberSchema.optional()
|
|
101050
101055
|
});
|
|
101051
101056
|
var eventsResponseSchema = external_exports.object({
|
|
101052
101057
|
events: external_exports.array(runEventSchema),
|
|
101053
101058
|
hasMore: external_exports.boolean(),
|
|
101054
|
-
nextSequence:
|
|
101059
|
+
nextSequence: eventSequenceCursorSchema,
|
|
101055
101060
|
run: runStateSchema,
|
|
101056
101061
|
framework: external_exports.string()
|
|
101057
101062
|
});
|
|
@@ -101179,11 +101184,12 @@ var runEventsContract = c9.router({
|
|
|
101179
101184
|
id: external_exports.uuid("Run ID must be a valid UUID")
|
|
101180
101185
|
}),
|
|
101181
101186
|
query: external_exports.object({
|
|
101182
|
-
since:
|
|
101183
|
-
limit: external_exports.coerce.number().default(100)
|
|
101187
|
+
since: eventSequenceCursorQuerySchema.default(-1),
|
|
101188
|
+
limit: external_exports.coerce.number().int().min(1).max(100).default(100)
|
|
101184
101189
|
}),
|
|
101185
101190
|
responses: {
|
|
101186
101191
|
200: eventsResponseSchema,
|
|
101192
|
+
400: apiErrorSchema,
|
|
101187
101193
|
401: apiErrorSchema,
|
|
101188
101194
|
404: apiErrorSchema
|
|
101189
101195
|
},
|
|
@@ -101695,7 +101701,7 @@ var sandboxReuseResultSchema = external_exports.enum([
|
|
|
101695
101701
|
]);
|
|
101696
101702
|
var agentEventSchema = external_exports.object({
|
|
101697
101703
|
type: external_exports.string(),
|
|
101698
|
-
sequenceNumber:
|
|
101704
|
+
sequenceNumber: eventSequenceNumberSchema
|
|
101699
101705
|
}).passthrough();
|
|
101700
101706
|
var artifactSnapshotsSchema = external_exports.array(
|
|
101701
101707
|
external_exports.object({
|
|
@@ -101747,7 +101753,7 @@ var webhookCompleteContract = c11.router({
|
|
|
101747
101753
|
runId: external_exports.string().min(1, "runId is required"),
|
|
101748
101754
|
exitCode: external_exports.number(),
|
|
101749
101755
|
error: external_exports.string().optional(),
|
|
101750
|
-
lastEventSequence:
|
|
101756
|
+
lastEventSequence: eventSequenceNumberSchema.optional(),
|
|
101751
101757
|
// Sandbox id the run executed against. Optional because a run that fails
|
|
101752
101758
|
// before VM creation has no sandbox. Persisted to agent_runs.sandbox_id;
|
|
101753
101759
|
// the 255-char cap matches the DB column (defense in depth).
|
|
@@ -102342,6 +102348,22 @@ init_esm_shims();
|
|
|
102342
102348
|
|
|
102343
102349
|
// ../../packages/api-contracts/src/contracts/model-providers.ts
|
|
102344
102350
|
init_esm_shims();
|
|
102351
|
+
var SUPPORTED_RUN_MODELS = [
|
|
102352
|
+
"claude-opus-4-7",
|
|
102353
|
+
"claude-opus-4-6",
|
|
102354
|
+
"claude-sonnet-4-6",
|
|
102355
|
+
"gpt-5.5",
|
|
102356
|
+
"gpt-5.4",
|
|
102357
|
+
"deepseek-v4-pro",
|
|
102358
|
+
"kimi-k2.6",
|
|
102359
|
+
"kimi-k2.5",
|
|
102360
|
+
"glm-5.1"
|
|
102361
|
+
];
|
|
102362
|
+
var supportedRunModelSchema = external_exports.enum(SUPPORTED_RUN_MODELS);
|
|
102363
|
+
var modelProviderCredentialScopeSchema = external_exports.enum(["org", "member"]);
|
|
102364
|
+
var SUPPORTED_RUN_MODEL_SET = new Set(
|
|
102365
|
+
SUPPORTED_RUN_MODELS
|
|
102366
|
+
);
|
|
102345
102367
|
var VM0_MODEL_TO_PROVIDER = {
|
|
102346
102368
|
"claude-opus-4-7": {
|
|
102347
102369
|
concreteType: "anthropic-api-key",
|
|
@@ -103214,6 +103236,8 @@ var chatThreadDetailSchema = external_exports.object({
|
|
|
103214
103236
|
* and org defaults) for the next run. Optional for back-compat.
|
|
103215
103237
|
*/
|
|
103216
103238
|
modelProviderId: external_exports.string().nullable().optional(),
|
|
103239
|
+
modelProviderType: modelProviderTypeSchema.nullable().optional(),
|
|
103240
|
+
modelProviderCredentialScope: modelProviderCredentialScopeSchema.nullable().optional(),
|
|
103217
103241
|
selectedModel: external_exports.string().nullable().optional(),
|
|
103218
103242
|
/**
|
|
103219
103243
|
* ISO timestamp at which the user manually renamed this thread. Null/undefined
|
|
@@ -119956,6 +119980,7 @@ var zeroVoiceChatContract = c54.router({
|
|
|
119956
119980
|
200: tokenResponseSchema,
|
|
119957
119981
|
400: apiErrorSchema,
|
|
119958
119982
|
401: apiErrorSchema,
|
|
119983
|
+
402: apiErrorSchema,
|
|
119959
119984
|
403: apiErrorSchema,
|
|
119960
119985
|
404: apiErrorSchema,
|
|
119961
119986
|
500: apiErrorSchema,
|
|
@@ -120623,6 +120648,17 @@ var FEATURE_SWITCHES = {
|
|
|
120623
120648
|
description: "Enable per-user (BYOK) model providers in addition to org-level. When off: Personal tab in Preferences is hidden; personal-tier API endpoints return 404; the prefer_personal_provider checkbox on agents/schedules is hidden; the resolver ignores the flag (treats as false). Staff-only during rollout; per-user toggle via Lab.",
|
|
120624
120649
|
enabled: false,
|
|
120625
120650
|
enabledOrgIdHashes: STAFF_ORG_ID_HASHES
|
|
120651
|
+
},
|
|
120652
|
+
["modelFirstModelProvider" /* ModelFirstModelProvider */]: {
|
|
120653
|
+
maintainer: "lancy@vm0.ai",
|
|
120654
|
+
description: "Gate the model-first model provider selection foundation. When off, all provider-first resolver, UI, CLI, and legacy model provider defaults remain unchanged. When on, follow-up work can use org model policies, canonical models, and member-scoped OAuth credentials. Default-off for every org, including staff; per-user toggle via Lab.",
|
|
120655
|
+
enabled: false
|
|
120656
|
+
},
|
|
120657
|
+
["voiceChatRealtimeBilling" /* VoiceChatRealtimeBilling */]: {
|
|
120658
|
+
maintainer: "lancy@vm0.ai",
|
|
120659
|
+
description: "Switch the voice-chat token endpoint to mint a VM0 relay-bootstrap instead of an OpenAI client_secret. When OFF, browsers receive the legacy ephemeral OpenAI token. When ON, the route runs credit + pricing admission and mints a short-lived HMAC relay token; the browser opens a WebSocket to /api/zero/voice-chat/relay (sub-issue #12139). Staff-only during rollout; operator flips per org via the feature-switch overrides API.",
|
|
120660
|
+
enabled: false,
|
|
120661
|
+
enabledOrgIdHashes: STAFF_ORG_ID_HASHES
|
|
120626
120662
|
}
|
|
120627
120663
|
};
|
|
120628
120664
|
function isFeatureEnabled(key, ctx) {
|
|
@@ -121684,57 +121720,164 @@ function renderRunCreated(response) {
|
|
|
121684
121720
|
});
|
|
121685
121721
|
}
|
|
121686
121722
|
}
|
|
121723
|
+
var TERMINAL_RUN_STATUSES = [
|
|
121724
|
+
"completed",
|
|
121725
|
+
"failed",
|
|
121726
|
+
"timeout",
|
|
121727
|
+
"cancelled"
|
|
121728
|
+
];
|
|
121729
|
+
var POLL_INTERVAL_MS = 1e3;
|
|
121730
|
+
var TERMINAL_DRAIN_POLL_INTERVAL_MS = 500;
|
|
121731
|
+
var TERMINAL_DRAIN_IDLE_MS = 1e3;
|
|
121732
|
+
var TERMINAL_DRAIN_MAX_MS = 3e3;
|
|
121733
|
+
function isTerminalRunState(run) {
|
|
121734
|
+
return TERMINAL_RUN_STATUSES.includes(run.status);
|
|
121735
|
+
}
|
|
121736
|
+
function shouldDrainNextEventPage(response, madeSequenceProgress) {
|
|
121737
|
+
return response.hasMore && response.events.length > 0 && madeSequenceProgress;
|
|
121738
|
+
}
|
|
121739
|
+
function isBlockedBySequenceGap(response, madeSequenceProgress) {
|
|
121740
|
+
return response.hasMore && !madeSequenceProgress;
|
|
121741
|
+
}
|
|
121742
|
+
function hasTerminalWatermark(run) {
|
|
121743
|
+
return run.lastEventSequence !== void 0;
|
|
121744
|
+
}
|
|
121745
|
+
function hasReachedTerminalWatermark(run, nextSequence) {
|
|
121746
|
+
return run.lastEventSequence !== void 0 && nextSequence >= run.lastEventSequence;
|
|
121747
|
+
}
|
|
121748
|
+
function shouldCompleteTerminalDrain(terminalSeenAt, lastTerminalProgressAt, blockedByGap) {
|
|
121749
|
+
const now = Date.now();
|
|
121750
|
+
const terminalElapsedMs = now - terminalSeenAt;
|
|
121751
|
+
const terminalIdleMs = now - lastTerminalProgressAt;
|
|
121752
|
+
return terminalElapsedMs >= TERMINAL_DRAIN_MAX_MS || !blockedByGap && terminalIdleMs >= TERMINAL_DRAIN_IDLE_MS;
|
|
121753
|
+
}
|
|
121754
|
+
function updateTerminalDrainState(state, run, madeSequenceProgress, now) {
|
|
121755
|
+
if (isTerminalRunState(run)) {
|
|
121756
|
+
if (!state.runState) {
|
|
121757
|
+
state.seenAt = now;
|
|
121758
|
+
state.lastProgressAt = now;
|
|
121759
|
+
} else if (madeSequenceProgress) {
|
|
121760
|
+
state.lastProgressAt = now;
|
|
121761
|
+
}
|
|
121762
|
+
state.runState = run;
|
|
121763
|
+
return;
|
|
121764
|
+
}
|
|
121765
|
+
if (state.runState && madeSequenceProgress) {
|
|
121766
|
+
state.lastProgressAt = now;
|
|
121767
|
+
}
|
|
121768
|
+
}
|
|
121769
|
+
function isBlockedByTerminalWatermark(run, nextSequence) {
|
|
121770
|
+
return hasTerminalWatermark(run) && !hasReachedTerminalWatermark(run, nextSequence);
|
|
121771
|
+
}
|
|
121772
|
+
function shouldReturnTerminalRunResult(state, response, nextSequence, madeSequenceProgress, seenResultEvent) {
|
|
121773
|
+
const run = state.runState;
|
|
121774
|
+
if (!run) {
|
|
121775
|
+
return false;
|
|
121776
|
+
}
|
|
121777
|
+
if (!hasTerminalWatermark(run) && run.status !== "completed") {
|
|
121778
|
+
if (run.status === "timeout" && shouldDrainNextEventPage(response, madeSequenceProgress)) {
|
|
121779
|
+
return false;
|
|
121780
|
+
}
|
|
121781
|
+
return true;
|
|
121782
|
+
}
|
|
121783
|
+
if (!hasTerminalWatermark(run) && seenResultEvent) {
|
|
121784
|
+
return true;
|
|
121785
|
+
}
|
|
121786
|
+
return shouldCompleteTerminalDrain(
|
|
121787
|
+
state.seenAt,
|
|
121788
|
+
state.lastProgressAt,
|
|
121789
|
+
isBlockedBySequenceGap(response, madeSequenceProgress) || isBlockedByTerminalWatermark(run, nextSequence)
|
|
121790
|
+
);
|
|
121791
|
+
}
|
|
121792
|
+
function renderTerminalRunResult(runId, run) {
|
|
121793
|
+
if (run.status === "completed") {
|
|
121794
|
+
EventRenderer.renderRunCompleted(run.result);
|
|
121795
|
+
return {
|
|
121796
|
+
succeeded: true,
|
|
121797
|
+
runId,
|
|
121798
|
+
sessionId: run.result?.agentSessionId,
|
|
121799
|
+
checkpointId: run.result?.checkpointId
|
|
121800
|
+
};
|
|
121801
|
+
}
|
|
121802
|
+
if (run.status === "failed") {
|
|
121803
|
+
EventRenderer.renderRunFailed(run.error, runId);
|
|
121804
|
+
return { succeeded: false, runId };
|
|
121805
|
+
}
|
|
121806
|
+
if (run.status === "timeout") {
|
|
121807
|
+
console.error(source_default.red("\n\u2717 Run timed out"));
|
|
121808
|
+
console.error(
|
|
121809
|
+
source_default.dim(` (use "vm0 logs ${runId} --system" to view system logs)`)
|
|
121810
|
+
);
|
|
121811
|
+
return { succeeded: false, runId };
|
|
121812
|
+
}
|
|
121813
|
+
console.error(source_default.yellow("\n\u2717 Run cancelled"));
|
|
121814
|
+
return { succeeded: false, runId };
|
|
121815
|
+
}
|
|
121816
|
+
function sleep(ms) {
|
|
121817
|
+
return new Promise((resolve2) => {
|
|
121818
|
+
return setTimeout(resolve2, ms);
|
|
121819
|
+
});
|
|
121820
|
+
}
|
|
121687
121821
|
async function pollEvents(runId, options) {
|
|
121688
121822
|
const renderer = new EventRenderer({ verbose: options?.verbose });
|
|
121689
121823
|
let nextSequence = -1;
|
|
121690
|
-
|
|
121691
|
-
|
|
121692
|
-
|
|
121693
|
-
|
|
121824
|
+
const terminalDrain = {
|
|
121825
|
+
seenAt: 0,
|
|
121826
|
+
lastProgressAt: 0
|
|
121827
|
+
};
|
|
121828
|
+
let seenResultEvent = false;
|
|
121829
|
+
for (; ; ) {
|
|
121830
|
+
const previousSequence = nextSequence;
|
|
121694
121831
|
const response = await getEvents(runId, {
|
|
121695
121832
|
since: nextSequence
|
|
121696
121833
|
});
|
|
121697
|
-
|
|
121698
|
-
|
|
121699
|
-
|
|
121700
|
-
|
|
121701
|
-
|
|
121702
|
-
|
|
121703
|
-
|
|
121704
|
-
|
|
121705
|
-
|
|
121706
|
-
|
|
121707
|
-
|
|
121708
|
-
|
|
121709
|
-
|
|
121710
|
-
|
|
121711
|
-
|
|
121712
|
-
|
|
121713
|
-
|
|
121714
|
-
|
|
121715
|
-
|
|
121716
|
-
|
|
121717
|
-
EventRenderer.renderRunFailed(response.run.error, runId);
|
|
121718
|
-
result = { succeeded: false, runId };
|
|
121719
|
-
} else if (runStatus === "timeout") {
|
|
121720
|
-
complete = true;
|
|
121721
|
-
console.error(source_default.red("\n\u2717 Run timed out"));
|
|
121722
|
-
console.error(
|
|
121723
|
-
source_default.dim(` (use "vm0 logs ${runId} --system" to view system logs)`)
|
|
121724
|
-
);
|
|
121725
|
-
result = { succeeded: false, runId };
|
|
121726
|
-
} else if (runStatus === "cancelled") {
|
|
121727
|
-
complete = true;
|
|
121728
|
-
console.error(source_default.yellow("\n\u2717 Run cancelled"));
|
|
121729
|
-
result = { succeeded: false, runId };
|
|
121730
|
-
}
|
|
121731
|
-
if (!complete) {
|
|
121732
|
-
await new Promise((resolve2) => {
|
|
121733
|
-
return setTimeout(resolve2, pollIntervalMs);
|
|
121734
|
-
});
|
|
121834
|
+
const now = Date.now();
|
|
121835
|
+
const madeSequenceProgress = response.nextSequence > previousSequence;
|
|
121836
|
+
let pageHasResultEvent = false;
|
|
121837
|
+
if (madeSequenceProgress) {
|
|
121838
|
+
for (const event of response.events) {
|
|
121839
|
+
const eventData = event.eventData;
|
|
121840
|
+
const parsed = parseEvent(eventData, response.framework);
|
|
121841
|
+
if (parsed) {
|
|
121842
|
+
renderer.render(parsed);
|
|
121843
|
+
if (parsed.type === "result") {
|
|
121844
|
+
pageHasResultEvent = true;
|
|
121845
|
+
}
|
|
121846
|
+
}
|
|
121847
|
+
}
|
|
121848
|
+
}
|
|
121849
|
+
if (madeSequenceProgress) {
|
|
121850
|
+
if (pageHasResultEvent) {
|
|
121851
|
+
seenResultEvent = true;
|
|
121852
|
+
}
|
|
121853
|
+
nextSequence = response.nextSequence;
|
|
121735
121854
|
}
|
|
121855
|
+
updateTerminalDrainState(
|
|
121856
|
+
terminalDrain,
|
|
121857
|
+
response.run,
|
|
121858
|
+
madeSequenceProgress,
|
|
121859
|
+
now
|
|
121860
|
+
);
|
|
121861
|
+
if (terminalDrain.runState && hasReachedTerminalWatermark(terminalDrain.runState, nextSequence)) {
|
|
121862
|
+
return renderTerminalRunResult(runId, terminalDrain.runState);
|
|
121863
|
+
}
|
|
121864
|
+
const terminalRunState = terminalDrain.runState;
|
|
121865
|
+
if (terminalRunState && shouldReturnTerminalRunResult(
|
|
121866
|
+
terminalDrain,
|
|
121867
|
+
response,
|
|
121868
|
+
nextSequence,
|
|
121869
|
+
madeSequenceProgress,
|
|
121870
|
+
seenResultEvent
|
|
121871
|
+
)) {
|
|
121872
|
+
return renderTerminalRunResult(runId, terminalRunState);
|
|
121873
|
+
}
|
|
121874
|
+
if (shouldDrainNextEventPage(response, madeSequenceProgress)) {
|
|
121875
|
+
continue;
|
|
121876
|
+
}
|
|
121877
|
+
await sleep(
|
|
121878
|
+
terminalDrain.runState ? TERMINAL_DRAIN_POLL_INTERVAL_MS : POLL_INTERVAL_MS
|
|
121879
|
+
);
|
|
121736
121880
|
}
|
|
121737
|
-
return result;
|
|
121738
121881
|
}
|
|
121739
121882
|
function showNextSteps(result) {
|
|
121740
121883
|
const { runId, sessionId, checkpointId } = result;
|
|
@@ -122003,4 +122146,4 @@ undici/lib/web/fetch/body.js:
|
|
|
122003
122146
|
undici/lib/web/websocket/frame.js:
|
|
122004
122147
|
(*! ws. MIT License. Einar Otto Stangvik <einaros@gmail.com> *)
|
|
122005
122148
|
*/
|
|
122006
|
-
//# sourceMappingURL=chunk-
|
|
122149
|
+
//# sourceMappingURL=chunk-5TO3NGXR.js.map
|