@vm0/cli 9.219.0 → 9.219.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/{agent-4SQZDYYN.js → agent-6TGGHCAT.js} +4 -4
- package/{automation-WPG4IYVE.js → automation-UPVMYME3.js} +21 -11
- package/automation-UPVMYME3.js.map +1 -0
- package/{banking-S7GOP6WI.js → banking-K4E2GBY7.js} +2 -2
- package/{chat-6E34QZHI.js → chat-3JUQFSSY.js} +2 -2
- package/{chunk-PTXI3X6L.js → chunk-5AIMJ6O5.js} +2 -2
- package/{chunk-NUCGXUQW.js → chunk-APCV4ZUL.js} +2 -2
- package/{chunk-Q47FRJVT.js → chunk-CWBLSKVL.js} +45 -176
- package/chunk-CWBLSKVL.js.map +1 -0
- package/{chunk-RYGMBENC.js → chunk-DF3WVSZY.js} +2 -2
- package/{chunk-B33JIZI2.js → chunk-DLB4B2NY.js} +3 -3
- package/chunk-H63W4KQL.js +160 -0
- package/chunk-H63W4KQL.js.map +1 -0
- package/{chunk-UQBJX5J5.js → chunk-MY2ZR6YU.js} +7 -7
- package/{chunk-7DWLR3AY.js → chunk-NI3BDNLY.js} +9 -7
- package/{chunk-7DWLR3AY.js.map → chunk-NI3BDNLY.js.map} +1 -1
- package/{chunk-O5WIIYWN.js → chunk-VLGMCLXQ.js} +2 -2
- package/{chunk-C3NCF7AC.js → chunk-YY7SV2BZ.js} +19 -18
- package/chunk-YY7SV2BZ.js.map +1 -0
- package/clerk.generated-ERU55NQP.js +402 -0
- package/clerk.generated-ERU55NQP.js.map +1 -0
- package/{computer-use-P5NZISFJ.js → computer-use-RFTIT5ZT.js} +2 -2
- package/{connector-BF7GN5KJ.js → connector-6VGK6J4L.js} +3 -3
- package/{credit-MUMH2AFQ.js → credit-AFPBXBIU.js} +2 -2
- package/{developer-support-YRODRFDP.js → developer-support-HATEQ7AD.js} +2 -2
- package/{doctor-SYQVWI4X.js → doctor-IAOTOO4G.js} +5 -5
- package/dropbox.generated-ZZKEVL5X.js +140 -0
- package/dropbox.generated-ZZKEVL5X.js.map +1 -0
- package/{generate-SOTMY5L2.js → generate-TXO7YLT3.js} +3 -3
- package/{github-M5QMAGUR.js → github-WAXJU2GY.js} +2 -2
- package/{goal-UCWUNBDX.js → goal-UIJNFLUD.js} +2 -2
- package/{host-FBIUSQM5.js → host-JN3SWFZN.js} +2 -2
- package/index.js +20 -18
- package/index.js.map +1 -1
- package/{logs-2WS7C3NG.js → logs-5LLAN46D.js} +13 -11
- package/{logs-2WS7C3NG.js.map → logs-5LLAN46D.js.map} +1 -1
- package/{maps-F6HS3TX3.js → maps-U6U7CVN4.js} +2 -2
- package/{model-WVSFDOUB.js → model-JQGMSCEW.js} +3 -3
- package/{model-provider-RW5KSE2A.js → model-provider-HPULHQCP.js} +3 -3
- package/{org-HG7QC6H2.js → org-P64YC3X4.js} +2 -2
- package/package.json +1 -1
- package/{phone-Y53A3YR6.js → phone-DQ642OPH.js} +2 -2
- package/{preference-PDDNKSID.js → preference-BYLQWJJH.js} +2 -2
- package/{resource-4RXH7SID.js → resource-HON6W7BP.js} +2 -2
- package/{schedule-XUGLVIVF.js → schedule-MTI5OP23.js} +2 -2
- package/schedule-MTI5OP23.js.map +1 -0
- package/{search-NRX5C4BZ.js → search-NDBJJPWS.js} +10 -8
- package/{search-NRX5C4BZ.js.map → search-NDBJJPWS.js.map} +1 -1
- package/{secret-G6ZROM3S.js → secret-AC6UW4DJ.js} +3 -3
- package/sentry.generated-Y3V3MFG5.js +112 -0
- package/sentry.generated-Y3V3MFG5.js.map +1 -0
- package/{slack-UE7PHE5Q.js → slack-S6KJLE6R.js} +2 -2
- package/strava.generated-FDURULCZ.js +76 -0
- package/strava.generated-FDURULCZ.js.map +1 -0
- package/{telegram-FMO5JNQL.js → telegram-SD6TEM2P.js} +2 -2
- package/{variable-3QU5KSPD.js → variable-7O57XR74.js} +2 -2
- package/{web-NUS7HONQ.js → web-3MQWFUZU.js} +2 -2
- package/{whoami-BVBVPCEX.js → whoami-U6VBDTX5.js} +4 -4
- package/{workflow-KFXYP54E.js → workflow-GGH4WU2J.js} +2 -2
- package/xero.generated-NPSQE6GC.js +164 -0
- package/xero.generated-NPSQE6GC.js.map +1 -0
- package/zero.js +32 -32
- package/automation-WPG4IYVE.js.map +0 -1
- package/chunk-C3NCF7AC.js.map +0 -1
- package/chunk-Q47FRJVT.js.map +0 -1
- package/clerk.generated-CUIJPEBA.js +0 -335
- package/clerk.generated-CUIJPEBA.js.map +0 -1
- package/dropbox.generated-SM45XNZI.js +0 -111
- package/dropbox.generated-SM45XNZI.js.map +0 -1
- package/schedule-XUGLVIVF.js.map +0 -1
- package/sentry.generated-TQZTJGQ4.js +0 -90
- package/sentry.generated-TQZTJGQ4.js.map +0 -1
- package/strava.generated-FK4SMYR7.js +0 -63
- package/strava.generated-FK4SMYR7.js.map +0 -1
- package/xero.generated-UVAXXS6Q.js +0 -129
- package/xero.generated-UVAXXS6Q.js.map +0 -1
- /package/{agent-4SQZDYYN.js.map → agent-6TGGHCAT.js.map} +0 -0
- /package/{banking-S7GOP6WI.js.map → banking-K4E2GBY7.js.map} +0 -0
- /package/{chat-6E34QZHI.js.map → chat-3JUQFSSY.js.map} +0 -0
- /package/{chunk-PTXI3X6L.js.map → chunk-5AIMJ6O5.js.map} +0 -0
- /package/{chunk-NUCGXUQW.js.map → chunk-APCV4ZUL.js.map} +0 -0
- /package/{chunk-RYGMBENC.js.map → chunk-DF3WVSZY.js.map} +0 -0
- /package/{chunk-B33JIZI2.js.map → chunk-DLB4B2NY.js.map} +0 -0
- /package/{chunk-UQBJX5J5.js.map → chunk-MY2ZR6YU.js.map} +0 -0
- /package/{chunk-O5WIIYWN.js.map → chunk-VLGMCLXQ.js.map} +0 -0
- /package/{computer-use-P5NZISFJ.js.map → computer-use-RFTIT5ZT.js.map} +0 -0
- /package/{connector-BF7GN5KJ.js.map → connector-6VGK6J4L.js.map} +0 -0
- /package/{credit-MUMH2AFQ.js.map → credit-AFPBXBIU.js.map} +0 -0
- /package/{developer-support-YRODRFDP.js.map → developer-support-HATEQ7AD.js.map} +0 -0
- /package/{doctor-SYQVWI4X.js.map → doctor-IAOTOO4G.js.map} +0 -0
- /package/{generate-SOTMY5L2.js.map → generate-TXO7YLT3.js.map} +0 -0
- /package/{github-M5QMAGUR.js.map → github-WAXJU2GY.js.map} +0 -0
- /package/{goal-UCWUNBDX.js.map → goal-UIJNFLUD.js.map} +0 -0
- /package/{host-FBIUSQM5.js.map → host-JN3SWFZN.js.map} +0 -0
- /package/{maps-F6HS3TX3.js.map → maps-U6U7CVN4.js.map} +0 -0
- /package/{model-WVSFDOUB.js.map → model-JQGMSCEW.js.map} +0 -0
- /package/{model-provider-RW5KSE2A.js.map → model-provider-HPULHQCP.js.map} +0 -0
- /package/{org-HG7QC6H2.js.map → org-P64YC3X4.js.map} +0 -0
- /package/{phone-Y53A3YR6.js.map → phone-DQ642OPH.js.map} +0 -0
- /package/{preference-PDDNKSID.js.map → preference-BYLQWJJH.js.map} +0 -0
- /package/{resource-4RXH7SID.js.map → resource-HON6W7BP.js.map} +0 -0
- /package/{secret-G6ZROM3S.js.map → secret-AC6UW4DJ.js.map} +0 -0
- /package/{slack-UE7PHE5Q.js.map → slack-S6KJLE6R.js.map} +0 -0
- /package/{telegram-FMO5JNQL.js.map → telegram-SD6TEM2P.js.map} +0 -0
- /package/{variable-3QU5KSPD.js.map → variable-7O57XR74.js.map} +0 -0
- /package/{web-NUS7HONQ.js.map → web-3MQWFUZU.js.map} +0 -0
- /package/{whoami-BVBVPCEX.js.map → whoami-U6VBDTX5.js.map} +0 -0
- /package/{workflow-KFXYP54E.js.map → workflow-GGH4WU2J.js.map} +0 -0
|
@@ -4,10 +4,10 @@ const require = __createRequire(import.meta.url);
|
|
|
4
4
|
import {
|
|
5
5
|
loadConnectorPermissionInfos,
|
|
6
6
|
policyIcon
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-APCV4ZUL.js";
|
|
8
8
|
import {
|
|
9
9
|
permissionGrantsToFirewallPolicies
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-MY2ZR6YU.js";
|
|
11
11
|
import {
|
|
12
12
|
isInteractive,
|
|
13
13
|
promptConfirm
|
|
@@ -24,7 +24,7 @@ import {
|
|
|
24
24
|
listZeroUserPermissionGrants,
|
|
25
25
|
updateZeroAgent,
|
|
26
26
|
updateZeroAgentInstructions
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-YY7SV2BZ.js";
|
|
28
28
|
import {
|
|
29
29
|
withErrorHandler
|
|
30
30
|
} from "./chunk-3F4RFLPX.js";
|
|
@@ -595,4 +595,4 @@ Notes:
|
|
|
595
595
|
export {
|
|
596
596
|
zeroAgentCommand
|
|
597
597
|
};
|
|
598
|
-
//# sourceMappingURL=agent-
|
|
598
|
+
//# sourceMappingURL=agent-6TGGHCAT.js.map
|
|
@@ -8,6 +8,12 @@ import {
|
|
|
8
8
|
import {
|
|
9
9
|
formatRelativeTime
|
|
10
10
|
} from "./chunk-RGP625TN.js";
|
|
11
|
+
import {
|
|
12
|
+
isUUID
|
|
13
|
+
} from "./chunk-CWBLSKVL.js";
|
|
14
|
+
import "./chunk-7HZXC5CL.js";
|
|
15
|
+
import "./chunk-5AIMJ6O5.js";
|
|
16
|
+
import "./chunk-VLGMCLXQ.js";
|
|
11
17
|
import {
|
|
12
18
|
isInteractive,
|
|
13
19
|
promptConfirm
|
|
@@ -18,13 +24,13 @@ import {
|
|
|
18
24
|
deleteAutomation,
|
|
19
25
|
disableAutomation,
|
|
20
26
|
enableAutomation,
|
|
27
|
+
getComposeById,
|
|
21
28
|
listAutomations,
|
|
22
|
-
resolveCompose,
|
|
23
29
|
runAutomation,
|
|
24
30
|
showAutomation,
|
|
25
31
|
updateAutomation,
|
|
26
32
|
updateAutomationTrigger
|
|
27
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-YY7SV2BZ.js";
|
|
28
34
|
import {
|
|
29
35
|
withErrorHandler
|
|
30
36
|
} from "./chunk-3F4RFLPX.js";
|
|
@@ -154,7 +160,7 @@ function buildInlineTrigger(options) {
|
|
|
154
160
|
}
|
|
155
161
|
throw new Error("Use exactly one of --cron, --once, --loop");
|
|
156
162
|
}
|
|
157
|
-
var createCommand = new Command().name("create").description("Create an automation with a schedule trigger").requiredOption("-n, --name <name>", "Automation name").requiredOption("--agent <id>", "Agent ID
|
|
163
|
+
var createCommand = new Command().name("create").description("Create an automation with a schedule trigger").requiredOption("-n, --name <name>", "Automation name").requiredOption("--agent <agent-id>", "Agent ID to run").requiredOption(
|
|
158
164
|
"-p, --prompt <instruction>",
|
|
159
165
|
"Instruction the agent runs when the automation fires"
|
|
160
166
|
).option("--description <text>", "Optional description").option("--cron <expression>", 'Add a cron trigger (e.g. "0 9 * * *")').option(
|
|
@@ -164,19 +170,23 @@ var createCommand = new Command().name("create").description("Create an automati
|
|
|
164
170
|
"after",
|
|
165
171
|
`
|
|
166
172
|
Examples:
|
|
167
|
-
Daily at 9am: zero automation create -n alerts --agent
|
|
168
|
-
One-time: zero automation create -n alerts --agent
|
|
169
|
-
Every 15 min: zero automation create -n alerts --agent
|
|
173
|
+
Daily at 9am: zero automation create -n alerts --agent 550e8400-e29b-41d4-a716-446655440000 -p "..." --cron "0 9 * * *"
|
|
174
|
+
One-time: zero automation create -n alerts --agent 550e8400-e29b-41d4-a716-446655440000 -p "..." --once "2026-06-10T09:00" -z UTC
|
|
175
|
+
Every 15 min: zero automation create -n alerts --agent 550e8400-e29b-41d4-a716-446655440000 -p "..." --loop 15m
|
|
170
176
|
|
|
171
177
|
Notes:
|
|
172
178
|
- Exactly one of --cron, --once, --loop is required`
|
|
173
179
|
).action(
|
|
174
180
|
withErrorHandler(async (options) => {
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
181
|
+
if (!isUUID(options.agent)) {
|
|
182
|
+
console.error(
|
|
183
|
+
source_default.red(`\u2717 Invalid agent ID "${options.agent}" \u2014 expected a UUID`)
|
|
184
|
+
);
|
|
185
|
+
console.error(source_default.dim(" Run: zero agent list to find agent IDs"));
|
|
186
|
+
process.exit(1);
|
|
179
187
|
}
|
|
188
|
+
const trigger = buildInlineTrigger(options);
|
|
189
|
+
const compose = await getComposeById(options.agent);
|
|
180
190
|
const { automation } = await createAutomation({
|
|
181
191
|
name: options.name,
|
|
182
192
|
agentId: compose.id,
|
|
@@ -490,4 +500,4 @@ Examples:
|
|
|
490
500
|
export {
|
|
491
501
|
zeroAutomationCommand
|
|
492
502
|
};
|
|
493
|
-
//# sourceMappingURL=automation-
|
|
503
|
+
//# sourceMappingURL=automation-UPVMYME3.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/commands/zero/automation/index.ts","../src/commands/zero/automation/create.ts","../src/commands/zero/automation/at-time-input.ts","../src/commands/zero/automation/trigger-display.ts","../src/commands/zero/automation/list.ts","../src/commands/zero/automation/show.ts","../src/commands/zero/automation/update.ts","../src/commands/zero/automation/delete.ts","../src/commands/zero/automation/enable.ts","../src/commands/zero/automation/disable.ts","../src/commands/zero/automation/run.ts"],"sourcesContent":["import { Command } from \"commander\";\nimport { createCommand } from \"./create\";\nimport { listCommand } from \"./list\";\nimport { showCommand } from \"./show\";\nimport { updateCommand } from \"./update\";\nimport { deleteCommand } from \"./delete\";\nimport { enableCommand } from \"./enable\";\nimport { disableCommand } from \"./disable\";\nimport { runCommand } from \"./run\";\n\nexport const zeroAutomationCommand = new Command()\n .name(\"automation\")\n .description(\"Create or manage scheduled automations\")\n .addCommand(createCommand)\n .addCommand(listCommand)\n .addCommand(showCommand)\n .addCommand(updateCommand)\n .addCommand(deleteCommand)\n .addCommand(enableCommand)\n .addCommand(disableCommand)\n .addCommand(runCommand)\n // Deprecated aliases — fully functional, but print a stderr notice pointing\n // at the replacement command.\n .addHelpText(\n \"after\",\n `\nExamples:\n Create an automation: zero automation create -n alerts --agent <agent-id> -p \"Summarize alerts\" --cron \"0 9 * * *\"\n List automations: zero automation list\n Inspect one: zero automation show alerts\n Fire manually: zero automation run alerts\n Pause an automation: zero automation disable alerts\n Resume an automation: zero automation enable alerts\n Delete an automation: zero automation delete alerts`,\n );\n","import { Command } from \"commander\";\nimport chalk from \"chalk\";\nimport type { CreateTriggerRequest } from \"@vm0/api-contracts/contracts/automations\";\nimport { createAutomation, getComposeById } from \"../../../lib/api\";\nimport { withErrorHandler } from \"../../../lib/command\";\nimport { isUUID } from \"../../run/shared\";\nimport { requireTimezoneForLocalAtTime } from \"./at-time-input\";\nimport { parseDurationSeconds } from \"./duration\";\nimport { formatTriggerConfig } from \"./trigger-display\";\n\ninterface CreateOptions {\n name: string;\n agent: string;\n prompt: string;\n description?: string;\n cron?: string;\n once?: string;\n loop?: string;\n timezone?: string;\n}\n\n/**\n * Build the automation schedule trigger from exactly one inline flag\n * (--cron / --once / --loop, with optional --timezone).\n */\nfunction buildInlineTrigger(options: CreateOptions): CreateTriggerRequest {\n const sugarCount = [options.cron, options.once, options.loop].filter(\n (value) => {\n return value !== undefined;\n },\n ).length;\n\n if (sugarCount !== 1) {\n throw new Error(\"Use exactly one of --cron, --once, --loop\");\n }\n\n if (options.timezone && !options.cron && !options.once) {\n throw new Error(\"--timezone requires --cron or --once\");\n }\n\n if (options.cron) {\n return {\n kind: \"cron\",\n cronExpression: options.cron,\n timezone: options.timezone,\n };\n }\n if (options.once) {\n requireTimezoneForLocalAtTime(options.once, options.timezone, \"--once\");\n return { kind: \"once\", atTime: options.once, timezone: options.timezone };\n }\n if (options.loop) {\n return {\n kind: \"loop\",\n intervalSeconds: parseDurationSeconds(options.loop),\n };\n }\n throw new Error(\"Use exactly one of --cron, --once, --loop\");\n}\n\nexport const createCommand = new Command()\n .name(\"create\")\n .description(\"Create an automation with a schedule trigger\")\n .requiredOption(\"-n, --name <name>\", \"Automation name\")\n .requiredOption(\"--agent <agent-id>\", \"Agent ID to run\")\n .requiredOption(\n \"-p, --prompt <instruction>\",\n \"Instruction the agent runs when the automation fires\",\n )\n .option(\"--description <text>\", \"Optional description\")\n .option(\"--cron <expression>\", 'Add a cron trigger (e.g. \"0 9 * * *\")')\n .option(\n \"--once <iso-time>\",\n 'Add a one-time trigger (e.g. \"2026-06-10T09:00\")',\n )\n .option(\"--loop <duration>\", \"Add a loop trigger (e.g. 15m, 1h, 90s)\")\n .option(\"-z, --timezone <tz>\", \"IANA timezone for --cron / --once\")\n .addHelpText(\n \"after\",\n `\nExamples:\n Daily at 9am: zero automation create -n alerts --agent 550e8400-e29b-41d4-a716-446655440000 -p \"...\" --cron \"0 9 * * *\"\n One-time: zero automation create -n alerts --agent 550e8400-e29b-41d4-a716-446655440000 -p \"...\" --once \"2026-06-10T09:00\" -z UTC\n Every 15 min: zero automation create -n alerts --agent 550e8400-e29b-41d4-a716-446655440000 -p \"...\" --loop 15m\n\nNotes:\n - Exactly one of --cron, --once, --loop is required`,\n )\n .action(\n withErrorHandler(async (options: CreateOptions) => {\n if (!isUUID(options.agent)) {\n console.error(\n chalk.red(`✗ Invalid agent ID \"${options.agent}\" — expected a UUID`),\n );\n console.error(chalk.dim(\" Run: zero agent list to find agent IDs\"));\n process.exit(1);\n }\n\n const trigger = buildInlineTrigger(options);\n\n const compose = await getComposeById(options.agent);\n\n const { automation } = await createAutomation({\n name: options.name,\n agentId: compose.id,\n instruction: options.prompt,\n description: options.description,\n chatThreadId: process.env.ZERO_CHAT_THREAD_ID,\n trigger,\n });\n\n console.log(chalk.green(`✓ Automation \"${automation.name}\" created`));\n console.log(chalk.dim(` ID: ${automation.id}`));\n console.log(chalk.dim(` Agent: ${compose.name}`));\n console.log(chalk.dim(` Thread: ${automation.chatThreadId}`));\n\n const createdTrigger = automation.triggers[0];\n if (createdTrigger) {\n console.log(\n chalk.dim(\n ` Trigger: ${createdTrigger.kind} ${formatTriggerConfig(createdTrigger)} (${createdTrigger.id})`,\n ),\n );\n }\n\n console.log();\n console.log(\n ` Run manually: ${chalk.cyan(`zero automation run ${automation.name}`)}`,\n );\n }),\n );\n","const EXPLICIT_OFFSET_RE = /(?:[zZ]|[+-]\\d{2}:?\\d{2})$/u;\n\nfunction hasExplicitAtTimeOffset(atTime: string): boolean {\n return EXPLICIT_OFFSET_RE.test(atTime.trim());\n}\n\nexport function requireTimezoneForLocalAtTime(\n atTime: string,\n timezone: string | undefined,\n flagName: \"--at\" | \"--once\",\n): void {\n if (timezone || hasExplicitAtTimeOffset(atTime)) {\n return;\n }\n throw new Error(\n `${flagName} without Z or an explicit offset requires --timezone (e.g. ${flagName} \"2026-06-10T09:00\" --timezone Asia/Shanghai)`,\n );\n}\n","import chalk from \"chalk\";\nimport type { AutomationTriggerResponse } from \"@vm0/api-contracts/contracts/automations\";\nimport { formatRelativeTime } from \"../../../lib/domain/schedule-utils\";\nimport { formatDurationSeconds } from \"./duration\";\n\n/**\n * Shared rendering for an automation's schedule trigger.\n */\n\n/** One-line config summary per trigger kind. */\nexport function formatTriggerConfig(\n trigger: AutomationTriggerResponse,\n): string {\n switch (trigger.kind) {\n case \"cron\":\n return `${trigger.cronExpression} (${trigger.timezone})`;\n case \"once\":\n return `at ${trigger.atTime} (${trigger.timezone})`;\n case \"loop\":\n return `every ${formatDurationSeconds(trigger.intervalSeconds)}`;\n }\n}\n\nfunction formatNextRun(trigger: AutomationTriggerResponse): string {\n if (!trigger.nextRunAt) {\n return chalk.dim(\"-\");\n }\n return formatRelativeTime(trigger.nextRunAt);\n}\n\n/**\n * Print the triggers table: KIND, ID, STATUS, CONFIG, NEXT RUN\n */\nexport function printTriggersTable(\n triggers: readonly AutomationTriggerResponse[],\n): void {\n const kindWidth = Math.max(\n 4,\n ...triggers.map((t) => {\n return t.kind.length;\n }),\n );\n const idWidth = Math.max(\n 2,\n ...triggers.map((t) => {\n return t.id.length;\n }),\n );\n const configWidth = Math.max(\n 6,\n ...triggers.map((t) => {\n return formatTriggerConfig(t).length;\n }),\n );\n\n console.log(\n chalk.dim(\n [\n \"KIND\".padEnd(kindWidth),\n \"ID\".padEnd(idWidth),\n \"STATUS\".padEnd(8),\n \"CONFIG\".padEnd(configWidth),\n \"NEXT RUN\",\n ].join(\" \"),\n ),\n );\n\n for (const trigger of triggers) {\n const status = trigger.enabled\n ? chalk.green(\"enabled\")\n : chalk.yellow(\"disabled\");\n console.log(\n [\n trigger.kind.padEnd(kindWidth),\n trigger.id.padEnd(idWidth),\n status.padEnd(8 + (trigger.enabled ? 0 : 2)),\n formatTriggerConfig(trigger).padEnd(configWidth),\n formatNextRun(trigger),\n ].join(\" \"),\n );\n }\n}\n","import { Command } from \"commander\";\nimport chalk from \"chalk\";\nimport type { AutomationResponse } from \"@vm0/api-contracts/contracts/automations\";\nimport { listAutomations } from \"../../../lib/api\";\nimport { withErrorHandler } from \"../../../lib/command\";\n\nfunction formatTriggerSummary(automation: AutomationResponse): string {\n const [trigger] = automation.triggers;\n if (!trigger) {\n return chalk.dim(\"-\");\n }\n return trigger.kind;\n}\n\nexport const listCommand = new Command()\n .name(\"list\")\n .alias(\"ls\")\n .description(\"List automations with their schedule trigger\")\n .addHelpText(\n \"after\",\n `\nExamples:\n zero automation list`,\n )\n .action(\n withErrorHandler(async () => {\n const { automations } = await listAutomations();\n\n if (automations.length === 0) {\n console.log(chalk.dim(\"No automations found\"));\n console.log(\n chalk.dim(\n ' Create one with: zero automation create -n <name> --agent <agent-id> -p \"<instruction>\"',\n ),\n );\n return;\n }\n\n const nameWidth = Math.max(\n 4,\n ...automations.map((a) => {\n return a.name.length;\n }),\n );\n const idWidth = Math.max(\n 2,\n ...automations.map((a) => {\n return a.id.length;\n }),\n );\n const agentWidth = Math.max(\n 5,\n ...automations.map((a) => {\n return (a.displayName ?? a.agentId).length;\n }),\n );\n\n console.log(\n chalk.dim(\n [\n \"NAME\".padEnd(nameWidth),\n \"ID\".padEnd(idWidth),\n \"AGENT\".padEnd(agentWidth),\n \"STATUS\".padEnd(8),\n \"TRIGGER\",\n ].join(\" \"),\n ),\n );\n\n for (const automation of automations) {\n const status = automation.enabled\n ? chalk.green(\"enabled\")\n : chalk.yellow(\"disabled\");\n console.log(\n [\n automation.name.padEnd(nameWidth),\n automation.id.padEnd(idWidth),\n (automation.displayName ?? automation.agentId).padEnd(agentWidth),\n status.padEnd(8 + (automation.enabled ? 0 : 2)),\n formatTriggerSummary(automation),\n ].join(\" \"),\n );\n }\n\n console.log();\n console.log(\n chalk.dim(` Details: zero automation show <automation-name-or-id>`),\n );\n }),\n );\n","import { Command } from \"commander\";\nimport chalk from \"chalk\";\nimport { showAutomation } from \"../../../lib/api\";\nimport { withErrorHandler } from \"../../../lib/command\";\nimport { printTriggersTable } from \"./trigger-display\";\n\nexport const showCommand = new Command()\n .name(\"show\")\n .description(\"Show an automation and its schedule\")\n .argument(\"<automation>\", \"Automation ID or name\")\n .addHelpText(\n \"after\",\n `\nExamples:\n zero automation show alerts\n zero automation show 11111111-1111-4111-8111-111111111111\n\nNotes:\n - When the same name exists on multiple agents, the API rejects it as ambiguous — use the ID`,\n )\n .action(\n withErrorHandler(async (ref: string) => {\n const automation = await showAutomation(ref);\n\n const status = automation.enabled\n ? chalk.green(\"enabled\")\n : chalk.yellow(\"disabled\");\n const agent = automation.displayName\n ? `${automation.displayName} ${chalk.dim(`(${automation.agentId})`)}`\n : automation.agentId;\n\n console.log(`${\"Name:\".padEnd(14)}${automation.name}`);\n console.log(`${\"ID:\".padEnd(14)}${automation.id}`);\n console.log(`${\"Agent:\".padEnd(14)}${agent}`);\n console.log(`${\"Status:\".padEnd(14)}${status}`);\n if (automation.description) {\n console.log(`${\"Description:\".padEnd(14)}${automation.description}`);\n }\n console.log(\n `${\"Instruction:\".padEnd(14)}${chalk.dim(automation.instruction)}`,\n );\n console.log(`${\"Thread:\".padEnd(14)}${automation.chatThreadId}`);\n\n console.log();\n const [trigger] = automation.triggers;\n if (!trigger) {\n console.log(chalk.dim(\"No schedule trigger\"));\n return;\n }\n\n printTriggersTable([trigger]);\n }),\n );\n","import { Command } from \"commander\";\nimport chalk from \"chalk\";\nimport type { UpdateTriggerRequest } from \"@vm0/api-contracts/contracts/automations\";\nimport {\n showAutomation,\n updateAutomation,\n updateAutomationTrigger,\n} from \"../../../lib/api\";\nimport { withErrorHandler } from \"../../../lib/command\";\nimport { requireTimezoneForLocalAtTime } from \"./at-time-input\";\nimport { parseDurationSeconds } from \"./duration\";\nimport { formatTriggerConfig } from \"./trigger-display\";\n\ninterface UpdateOptions {\n name?: string;\n prompt?: string;\n description?: string;\n cron?: string;\n once?: string;\n loop?: string;\n timezone?: string;\n}\n\n/**\n * Build the optional schedule replacement from the timing sugar flags\n * (--cron / --once / --loop, with optional --timezone). The automation's\n * single time trigger is updated in place; its kind switches to match the\n * flag.\n */\nfunction buildTimingUpdate(\n options: UpdateOptions,\n): UpdateTriggerRequest | undefined {\n const sugarCount = [options.cron, options.once, options.loop].filter(\n (value) => {\n return value !== undefined;\n },\n ).length;\n\n if (sugarCount > 1) {\n throw new Error(\"Use at most one of --cron, --once, --loop\");\n }\n\n if (options.timezone && !options.cron && !options.once) {\n throw new Error(\"--timezone requires --cron or --once\");\n }\n\n if (options.cron) {\n return {\n kind: \"cron\",\n cronExpression: options.cron,\n timezone: options.timezone,\n };\n }\n if (options.once) {\n requireTimezoneForLocalAtTime(options.once, options.timezone, \"--once\");\n return { kind: \"once\", atTime: options.once, timezone: options.timezone };\n }\n if (options.loop) {\n return {\n kind: \"loop\",\n intervalSeconds: parseDurationSeconds(options.loop),\n };\n }\n return undefined;\n}\n\nexport const updateCommand = new Command()\n .name(\"update\")\n .description(\n \"Update an automation's name, instruction, description, or schedule\",\n )\n .argument(\"<automation>\", \"Automation ID or name\")\n .option(\"-n, --name <name>\", \"New automation name\")\n .option(\"-p, --prompt <instruction>\", \"New instruction\")\n .option(\"--description <text>\", \"New description\")\n .option(\"--cron <expression>\", 'New cron schedule (e.g. \"0 9 * * *\")')\n .option(\"--once <iso-time>\", 'New one-time fire (e.g. \"2026-06-10T09:00\")')\n .option(\"--loop <duration>\", \"New loop interval (e.g. 15m, 1h, 90s)\")\n .option(\"-z, --timezone <tz>\", \"IANA timezone for --cron / --once\")\n .addHelpText(\n \"after\",\n `\nExamples:\n zero automation update alerts -p \"Summarize alerts and post to Slack\"\n zero automation update alerts -n alerts-v2 --description \"Daily alert digest\"\n zero automation update alerts --cron \"0 18 * * 5\" -z Asia/Shanghai\n zero automation update alerts --loop 10m\n\nNotes:\n - At most one of --cron, --once, --loop; it replaces the automation's schedule trigger in place (the kind may switch, run history is kept)`,\n )\n .action(\n withErrorHandler(async (ref: string, options: UpdateOptions) => {\n const timing = buildTimingUpdate(options);\n const hasIdentityUpdate =\n options.name !== undefined ||\n options.prompt !== undefined ||\n options.description !== undefined;\n\n if (!hasIdentityUpdate && !timing) {\n throw new Error(\n \"Nothing to update: provide --name, --prompt, --description, --cron, --once, or --loop\",\n );\n }\n\n // Resolve the single trigger up front so a missing/ambiguous trigger\n // fails before any field is patched.\n let timeTriggerId: string | undefined;\n if (timing) {\n const automation = await showAutomation(ref);\n const timeTriggers = automation.triggers;\n const [first] = timeTriggers;\n if (!first) {\n throw new Error(`Automation ${ref} has no schedule trigger`);\n }\n timeTriggerId = first.id;\n }\n\n if (hasIdentityUpdate) {\n const automation = await updateAutomation(ref, {\n name: options.name,\n instruction: options.prompt,\n description: options.description,\n });\n console.log(chalk.green(`✓ Automation \"${automation.name}\" updated`));\n }\n\n if (timing && timeTriggerId) {\n const trigger = await updateAutomationTrigger(timeTriggerId, timing);\n console.log(chalk.green(`✓ Trigger ${trigger.id} updated`));\n console.log(\n chalk.dim(\n ` Schedule: ${trigger.kind} ${formatTriggerConfig(trigger)}`,\n ),\n );\n }\n }),\n );\n","import { Command } from \"commander\";\nimport chalk from \"chalk\";\nimport { deleteAutomation } from \"../../../lib/api\";\nimport { isInteractive, promptConfirm } from \"../../../lib/utils/prompt-utils\";\nimport { withErrorHandler } from \"../../../lib/command\";\n\nexport const deleteCommand = new Command()\n .name(\"delete\")\n .alias(\"rm\")\n .description(\"Delete an automation (its triggers are removed too)\")\n .argument(\"<automation>\", \"Automation ID or name\")\n .option(\"-y, --yes\", \"Skip confirmation prompt\")\n .addHelpText(\n \"after\",\n `\nExamples:\n zero automation delete alerts\n zero automation delete alerts -y\n\nNotes:\n - Use -y to skip confirmation in non-interactive mode`,\n )\n .action(\n withErrorHandler(async (ref: string, options: { yes?: boolean }) => {\n if (!options.yes) {\n if (!isInteractive()) {\n throw new Error(\"--yes flag is required in non-interactive mode\");\n }\n const confirmed = await promptConfirm(\n `Delete automation ${chalk.cyan(ref)} and its schedule trigger?`,\n false,\n );\n if (!confirmed) {\n console.log(chalk.dim(\"Cancelled\"));\n return;\n }\n }\n\n await deleteAutomation(ref);\n\n console.log(chalk.green(`✓ Automation \"${ref}\" deleted`));\n }),\n );\n","import { Command } from \"commander\";\nimport chalk from \"chalk\";\nimport { enableAutomation } from \"../../../lib/api\";\nimport { withErrorHandler } from \"../../../lib/command\";\n\nexport const enableCommand = new Command()\n .name(\"enable\")\n .description(\"Enable an automation\")\n .argument(\"<automation>\", \"Automation ID or name\")\n .addHelpText(\n \"after\",\n `\nExamples:\n zero automation enable alerts`,\n )\n .action(\n withErrorHandler(async (ref: string) => {\n const automation = await enableAutomation(ref);\n\n console.log(chalk.green(`✓ Automation \"${automation.name}\" enabled`));\n }),\n );\n","import { Command } from \"commander\";\nimport chalk from \"chalk\";\nimport { disableAutomation } from \"../../../lib/api\";\nimport { withErrorHandler } from \"../../../lib/command\";\n\nexport const disableCommand = new Command()\n .name(\"disable\")\n .description(\"Disable an automation\")\n .argument(\"<automation>\", \"Automation ID or name\")\n .addHelpText(\n \"after\",\n `\nExamples:\n zero automation disable alerts`,\n )\n .action(\n withErrorHandler(async (ref: string) => {\n const automation = await disableAutomation(ref);\n\n console.log(chalk.green(`✓ Automation \"${automation.name}\" disabled`));\n }),\n );\n","import { Command } from \"commander\";\nimport chalk from \"chalk\";\nimport { runAutomation } from \"../../../lib/api\";\nimport { withErrorHandler } from \"../../../lib/command\";\n\nexport const runCommand = new Command()\n .name(\"run\")\n .description(\"Manually fire an automation (runs its instruction once)\")\n .argument(\"<automation>\", \"Automation ID or name\")\n .addHelpText(\n \"after\",\n `\nExamples:\n zero automation run alerts`,\n )\n .action(\n withErrorHandler(async (ref: string) => {\n const { runId } = await runAutomation(ref);\n\n console.log(chalk.green(`✓ Automation \"${ref}\" fired`));\n console.log(chalk.dim(` Run ID: ${runId}`));\n }),\n );\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;ACAA;;;ACAA;AAAA,IAAM,qBAAqB;AAE3B,SAAS,wBAAwB,QAAyB;AACxD,SAAO,mBAAmB,KAAK,OAAO,KAAK,CAAC;AAC9C;AAEO,SAAS,8BACd,QACA,UACA,UACM;AACN,MAAI,YAAY,wBAAwB,MAAM,GAAG;AAC/C;AAAA,EACF;AACA,QAAM,IAAI;AAAA,IACR,GAAG,QAAQ,8DAA8D,QAAQ;AAAA,EACnF;AACF;;;ACjBA;AAUO,SAAS,oBACd,SACQ;AACR,UAAQ,QAAQ,MAAM;AAAA,IACpB,KAAK;AACH,aAAO,GAAG,QAAQ,cAAc,KAAK,QAAQ,QAAQ;AAAA,IACvD,KAAK;AACH,aAAO,MAAM,QAAQ,MAAM,KAAK,QAAQ,QAAQ;AAAA,IAClD,KAAK;AACH,aAAO,SAAS,sBAAsB,QAAQ,eAAe,CAAC;AAAA,EAClE;AACF;AAEA,SAAS,cAAc,SAA4C;AACjE,MAAI,CAAC,QAAQ,WAAW;AACtB,WAAO,eAAM,IAAI,GAAG;AAAA,EACtB;AACA,SAAO,mBAAmB,QAAQ,SAAS;AAC7C;AAKO,SAAS,mBACd,UACM;AACN,QAAM,YAAY,KAAK;AAAA,IACrB;AAAA,IACA,GAAG,SAAS,IAAI,CAAC,MAAM;AACrB,aAAO,EAAE,KAAK;AAAA,IAChB,CAAC;AAAA,EACH;AACA,QAAM,UAAU,KAAK;AAAA,IACnB;AAAA,IACA,GAAG,SAAS,IAAI,CAAC,MAA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AW,WAAW,EACtB,WAAW,aAAa,EACxB,WAAW,aAAa,EACxB,WAAW,aAAa,EACxB,WAAW,cAAc,EACzB,WAAW,UAAU,EAGrB;AAAA,EACC;AAAA,EACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASF;","names":[]}
|
|
@@ -4,7 +4,7 @@ const require = __createRequire(import.meta.url);
|
|
|
4
4
|
import "./chunk-LTDQISD7.js";
|
|
5
5
|
import {
|
|
6
6
|
callZeroBanking
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-YY7SV2BZ.js";
|
|
8
8
|
import {
|
|
9
9
|
withErrorHandler
|
|
10
10
|
} from "./chunk-3F4RFLPX.js";
|
|
@@ -115,4 +115,4 @@ Notes:
|
|
|
115
115
|
export {
|
|
116
116
|
zeroBankingCommand
|
|
117
117
|
};
|
|
118
|
-
//# sourceMappingURL=banking-
|
|
118
|
+
//# sourceMappingURL=banking-K4E2GBY7.js.map
|
|
@@ -5,7 +5,7 @@ import "./chunk-LTDQISD7.js";
|
|
|
5
5
|
import {
|
|
6
6
|
getZeroChatThread,
|
|
7
7
|
renameZeroChatThread
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-YY7SV2BZ.js";
|
|
9
9
|
import {
|
|
10
10
|
withErrorHandler
|
|
11
11
|
} from "./chunk-3F4RFLPX.js";
|
|
@@ -120,4 +120,4 @@ Examples:
|
|
|
120
120
|
export {
|
|
121
121
|
zeroChatCommand
|
|
122
122
|
};
|
|
123
|
-
//# sourceMappingURL=chat-
|
|
123
|
+
//# sourceMappingURL=chat-3JUQFSSY.js.map
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
parseSegment,
|
|
9
9
|
splitPathSegments,
|
|
10
10
|
validateBaseUrl
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-YY7SV2BZ.js";
|
|
12
12
|
import {
|
|
13
13
|
init_esm_shims
|
|
14
14
|
} from "./chunk-DIRAZ3YX.js";
|
|
@@ -609,4 +609,4 @@ export {
|
|
|
609
609
|
matchFirewallBaseUrl,
|
|
610
610
|
findMatchingRoutingPermissions
|
|
611
611
|
};
|
|
612
|
-
//# sourceMappingURL=chunk-
|
|
612
|
+
//# sourceMappingURL=chunk-5AIMJ6O5.js.map
|
|
@@ -4,7 +4,7 @@ const require = __createRequire(import.meta.url);
|
|
|
4
4
|
import {
|
|
5
5
|
loadFirewallPermissionMetadata,
|
|
6
6
|
resolveFirewallMetadataPolicies
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-MY2ZR6YU.js";
|
|
8
8
|
import {
|
|
9
9
|
source_default
|
|
10
10
|
} from "./chunk-JUTUEPIR.js";
|
|
@@ -87,4 +87,4 @@ export {
|
|
|
87
87
|
policyIcon,
|
|
88
88
|
loadConnectorPermissionInfos
|
|
89
89
|
};
|
|
90
|
-
//# sourceMappingURL=chunk-
|
|
90
|
+
//# sourceMappingURL=chunk-APCV4ZUL.js.map
|
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
authHeadersSchema,
|
|
9
9
|
composeListItemSchema,
|
|
10
10
|
composeResponseSchema,
|
|
11
|
+
connectorReconnectReasonSchema,
|
|
11
12
|
connectorTypeSchema,
|
|
12
13
|
firewallPoliciesSchema,
|
|
13
14
|
getEvents,
|
|
@@ -21,7 +22,7 @@ import {
|
|
|
21
22
|
upsertModelProviderRequestSchema,
|
|
22
23
|
upsertModelProviderResponseSchema,
|
|
23
24
|
zeroAgentVisibilitySchema
|
|
24
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-YY7SV2BZ.js";
|
|
25
26
|
import {
|
|
26
27
|
apiErrorSchema,
|
|
27
28
|
external_exports
|
|
@@ -13349,6 +13350,31 @@ var publicConnectorCatalogListResponseSchema = external_exports.object({
|
|
|
13349
13350
|
var publicConnectorCatalogDetailResponseSchema = external_exports.object({
|
|
13350
13351
|
connector: publicConnectorCatalogDetailSchema
|
|
13351
13352
|
});
|
|
13353
|
+
var publicConnectorCatalogConnectionStatusSchema = external_exports.enum([
|
|
13354
|
+
"not-connected",
|
|
13355
|
+
"connected",
|
|
13356
|
+
"scope-mismatch",
|
|
13357
|
+
"reconnect-required"
|
|
13358
|
+
]);
|
|
13359
|
+
var publicConnectorCatalogConnectionSchema = external_exports.object({
|
|
13360
|
+
authMethod: external_exports.string(),
|
|
13361
|
+
externalUsername: external_exports.string().nullable(),
|
|
13362
|
+
externalEmail: external_exports.string().nullable(),
|
|
13363
|
+
reconnectReason: connectorReconnectReasonSchema.nullable()
|
|
13364
|
+
});
|
|
13365
|
+
var publicConnectorCatalogStatusItemSchema = publicConnectorCatalogDetailSchema.extend({
|
|
13366
|
+
connection: publicConnectorCatalogConnectionSchema.nullable(),
|
|
13367
|
+
connected: external_exports.boolean(),
|
|
13368
|
+
connectionStatus: publicConnectorCatalogConnectionStatusSchema,
|
|
13369
|
+
scopeMismatch: external_exports.boolean(),
|
|
13370
|
+
authMethodSupportsRefresh: external_exports.boolean(),
|
|
13371
|
+
tokenExpiresAt: external_exports.string().nullable(),
|
|
13372
|
+
singleAuthCodeAuthMethodId: external_exports.string().nullable(),
|
|
13373
|
+
connectNotice: external_exports.enum(["google-security-warning"]).nullable()
|
|
13374
|
+
});
|
|
13375
|
+
var publicConnectorCatalogStatusResponseSchema = external_exports.object({
|
|
13376
|
+
connectors: external_exports.array(publicConnectorCatalogStatusItemSchema)
|
|
13377
|
+
});
|
|
13352
13378
|
var publicFirewallPolicyValueSchema = external_exports.enum(["allow", "deny", "ask"]);
|
|
13353
13379
|
var publicConnectorCatalogPermissionSchema = external_exports.object({
|
|
13354
13380
|
name: external_exports.string(),
|
|
@@ -13389,6 +13415,17 @@ var zeroConnectorCatalogContract = c45.router({
|
|
|
13389
13415
|
},
|
|
13390
13416
|
summary: "List public connector catalog metadata"
|
|
13391
13417
|
},
|
|
13418
|
+
status: {
|
|
13419
|
+
method: "GET",
|
|
13420
|
+
path: "/api/zero/connector-catalog/status",
|
|
13421
|
+
headers: authHeadersSchema,
|
|
13422
|
+
responses: {
|
|
13423
|
+
200: publicConnectorCatalogStatusResponseSchema,
|
|
13424
|
+
401: apiErrorSchema,
|
|
13425
|
+
403: apiErrorSchema
|
|
13426
|
+
},
|
|
13427
|
+
summary: "List public connector catalog metadata with connection status"
|
|
13428
|
+
},
|
|
13392
13429
|
get: {
|
|
13393
13430
|
method: "GET",
|
|
13394
13431
|
path: "/api/zero/connector-catalog/:connectorRef",
|
|
@@ -13629,23 +13666,6 @@ var zeroComposesByIdContract = c49.router({
|
|
|
13629
13666
|
404: apiErrorSchema
|
|
13630
13667
|
},
|
|
13631
13668
|
summary: "Get agent compose by ID (zero proxy)"
|
|
13632
|
-
},
|
|
13633
|
-
delete: {
|
|
13634
|
-
method: "DELETE",
|
|
13635
|
-
path: "/api/zero/composes/:id",
|
|
13636
|
-
headers: authHeadersSchema,
|
|
13637
|
-
pathParams: external_exports.object({
|
|
13638
|
-
id: external_exports.string().uuid("Compose ID is required")
|
|
13639
|
-
}),
|
|
13640
|
-
body: c49.noBody(),
|
|
13641
|
-
responses: {
|
|
13642
|
-
204: c49.noBody(),
|
|
13643
|
-
401: apiErrorSchema,
|
|
13644
|
-
403: apiErrorSchema,
|
|
13645
|
-
404: apiErrorSchema,
|
|
13646
|
-
409: apiErrorSchema
|
|
13647
|
-
},
|
|
13648
|
-
summary: "Delete agent compose (zero proxy)"
|
|
13649
13669
|
}
|
|
13650
13670
|
});
|
|
13651
13671
|
var zeroComposesMetadataContract = c49.router({
|
|
@@ -16266,12 +16286,6 @@ var FEATURE_SWITCHES = {
|
|
|
16266
16286
|
enabled: false,
|
|
16267
16287
|
enabledOrgIdHashes: STAFF_ORG_ID_HASHES
|
|
16268
16288
|
},
|
|
16269
|
-
["memoryDevRefresh" /* MemoryDevRefresh */]: {
|
|
16270
|
-
maintainer: "lancy@vm0.ai",
|
|
16271
|
-
description: "Show the internal Memory page dev refresh action for staff prompt iteration.",
|
|
16272
|
-
enabled: false,
|
|
16273
|
-
enabledOrgIdHashes: STAFF_ORG_ID_HASHES
|
|
16274
|
-
},
|
|
16275
16289
|
["htmlArtifactCommentEditing" /* HtmlArtifactCommentEditing */]: {
|
|
16276
16290
|
maintainer: "bingjie@vm0.ai",
|
|
16277
16291
|
description: "Enable the HTML artifact comment-editing workflow for collecting DOM comments and preparing instrumented working-copy edits.",
|
|
@@ -16299,6 +16313,11 @@ var FEATURE_SWITCHES = {
|
|
|
16299
16313
|
maintainer: "ethan@vm0.ai",
|
|
16300
16314
|
description: "Show chat unread indicators in sidebar pinned agent lists and the conversation picker.",
|
|
16301
16315
|
enabled: false
|
|
16316
|
+
},
|
|
16317
|
+
["agentsPageRedesign" /* AgentsPageRedesign */]: {
|
|
16318
|
+
maintainer: "ming@vm0.ai",
|
|
16319
|
+
description: "New Agents page with Public/Private tabs, a public-slot indicator, a Created by footer on every card, a name-first create dialog with a visibility select, and a private empty state.",
|
|
16320
|
+
enabled: false
|
|
16302
16321
|
}
|
|
16303
16322
|
};
|
|
16304
16323
|
|
|
@@ -18447,151 +18466,6 @@ function showNextSteps(result) {
|
|
|
18447
18466
|
}
|
|
18448
18467
|
}
|
|
18449
18468
|
|
|
18450
|
-
// src/lib/utils/time-parser.ts
|
|
18451
|
-
init_esm_shims();
|
|
18452
|
-
var ISO_8601_PATTERN = /^(\d{4})-(\d{2})-(\d{2})(?:[Tt](\d{2}):(\d{2})(?::(\d{2})(?:\.\d{1,9})?)?(?:[Zz]|[+-]\d{2}:?\d{2})?)?$/;
|
|
18453
|
-
var DAYS_BY_MONTH = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
|
|
18454
|
-
var MAX_DATE_TIMESTAMP_MS = 864e13;
|
|
18455
|
-
function parseTime(timeStr) {
|
|
18456
|
-
const relativeMatch = timeStr.match(/^(\d+)([smhdw])$/);
|
|
18457
|
-
if (relativeMatch) {
|
|
18458
|
-
const value = Number(relativeMatch[1]);
|
|
18459
|
-
const unit = relativeMatch[2];
|
|
18460
|
-
const timestamp2 = parseRelativeTime(value, unit);
|
|
18461
|
-
if (timestamp2 !== void 0) {
|
|
18462
|
-
return timestamp2;
|
|
18463
|
-
}
|
|
18464
|
-
}
|
|
18465
|
-
if (/^\d+$/.test(timeStr)) {
|
|
18466
|
-
const rawTimestamp = Number(timeStr);
|
|
18467
|
-
const timestamp2 = rawTimestamp < 1e10 ? rawTimestamp * 1e3 : rawTimestamp;
|
|
18468
|
-
if (isValidTimestamp(timestamp2)) {
|
|
18469
|
-
return timestamp2;
|
|
18470
|
-
}
|
|
18471
|
-
}
|
|
18472
|
-
const timestamp = parseIsoTime(timeStr);
|
|
18473
|
-
if (timestamp !== void 0) {
|
|
18474
|
-
return timestamp;
|
|
18475
|
-
}
|
|
18476
|
-
throw new Error(
|
|
18477
|
-
`Invalid time format: "${timeStr}". Supported formats: relative (5m, 2h, 1d), ISO 8601 (2024-01-15T10:30:00Z), Unix timestamp`
|
|
18478
|
-
);
|
|
18479
|
-
}
|
|
18480
|
-
function parseIsoTime(timeStr) {
|
|
18481
|
-
const match = ISO_8601_PATTERN.exec(timeStr);
|
|
18482
|
-
if (!match) {
|
|
18483
|
-
return void 0;
|
|
18484
|
-
}
|
|
18485
|
-
const year = Number(match[1]);
|
|
18486
|
-
const month = Number(match[2]);
|
|
18487
|
-
const day = Number(match[3]);
|
|
18488
|
-
const hour = match[4] ? Number(match[4]) : 0;
|
|
18489
|
-
const minute = match[5] ? Number(match[5]) : 0;
|
|
18490
|
-
const second = match[6] ? Number(match[6]) : 0;
|
|
18491
|
-
if (!Number.isInteger(year) || !Number.isInteger(month) || !Number.isInteger(day) || !Number.isInteger(hour) || !Number.isInteger(minute) || !Number.isInteger(second) || month < 1 || month > 12 || day < 1 || day > daysInMonth(year, month) || hour > 23 || minute > 59 || second > 59) {
|
|
18492
|
-
return void 0;
|
|
18493
|
-
}
|
|
18494
|
-
const timestamp = new Date(timeStr).getTime();
|
|
18495
|
-
return isValidTimestamp(timestamp) ? timestamp : void 0;
|
|
18496
|
-
}
|
|
18497
|
-
function daysInMonth(year, month) {
|
|
18498
|
-
if (month === 2) {
|
|
18499
|
-
return isLeapYear(year) ? 29 : 28;
|
|
18500
|
-
}
|
|
18501
|
-
return DAYS_BY_MONTH[month - 1] ?? 0;
|
|
18502
|
-
}
|
|
18503
|
-
function isLeapYear(year) {
|
|
18504
|
-
return year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0);
|
|
18505
|
-
}
|
|
18506
|
-
function parseRelativeTime(value, unit) {
|
|
18507
|
-
if (!Number.isSafeInteger(value)) {
|
|
18508
|
-
return void 0;
|
|
18509
|
-
}
|
|
18510
|
-
const now = Date.now();
|
|
18511
|
-
const multipliers = {
|
|
18512
|
-
s: 1e3,
|
|
18513
|
-
// seconds
|
|
18514
|
-
m: 60 * 1e3,
|
|
18515
|
-
// minutes
|
|
18516
|
-
h: 60 * 60 * 1e3,
|
|
18517
|
-
// hours
|
|
18518
|
-
d: 24 * 60 * 60 * 1e3,
|
|
18519
|
-
// days
|
|
18520
|
-
w: 7 * 24 * 60 * 60 * 1e3
|
|
18521
|
-
// weeks
|
|
18522
|
-
};
|
|
18523
|
-
const multiplier = multipliers[unit];
|
|
18524
|
-
if (!multiplier) {
|
|
18525
|
-
throw new Error(`Unknown time unit: ${unit}`);
|
|
18526
|
-
}
|
|
18527
|
-
const timestamp = now - value * multiplier;
|
|
18528
|
-
return isValidTimestamp(timestamp) ? timestamp : void 0;
|
|
18529
|
-
}
|
|
18530
|
-
function isValidTimestamp(timestamp) {
|
|
18531
|
-
return Number.isSafeInteger(timestamp) && Math.abs(timestamp) <= MAX_DATE_TIMESTAMP_MS;
|
|
18532
|
-
}
|
|
18533
|
-
|
|
18534
|
-
// src/lib/utils/log-pagination.ts
|
|
18535
|
-
init_esm_shims();
|
|
18536
|
-
function parsePositiveLogCount(value, optionName) {
|
|
18537
|
-
const trimmed = value.trim();
|
|
18538
|
-
if (!/^0*[1-9]\d*$/.test(trimmed)) {
|
|
18539
|
-
throw new Error(`Option ${optionName} must be a positive integer`);
|
|
18540
|
-
}
|
|
18541
|
-
const count = Number(trimmed);
|
|
18542
|
-
if (!Number.isSafeInteger(count)) {
|
|
18543
|
-
throw new Error(`Option ${optionName} must be a positive integer`);
|
|
18544
|
-
}
|
|
18545
|
-
return count;
|
|
18546
|
-
}
|
|
18547
|
-
function parseBoundedLogCount(value, optionName, min, max) {
|
|
18548
|
-
const trimmed = value.trim();
|
|
18549
|
-
if (!/^\d+$/.test(trimmed)) {
|
|
18550
|
-
throw new Error(`${optionName} must be between ${min} and ${max}`);
|
|
18551
|
-
}
|
|
18552
|
-
const count = Number(trimmed);
|
|
18553
|
-
if (!Number.isSafeInteger(count) || count < min || count > max) {
|
|
18554
|
-
throw new Error(`${optionName} must be between ${min} and ${max}`);
|
|
18555
|
-
}
|
|
18556
|
-
return count;
|
|
18557
|
-
}
|
|
18558
|
-
async function collectLogItems(options) {
|
|
18559
|
-
const collected = [];
|
|
18560
|
-
const seenCursors = /* @__PURE__ */ new Set();
|
|
18561
|
-
let cursor;
|
|
18562
|
-
while (true) {
|
|
18563
|
-
const requestLimit = options.targetCount === "all" ? options.pageLimit : Math.min(options.pageLimit, options.targetCount - collected.length);
|
|
18564
|
-
const page = await options.fetchPage({
|
|
18565
|
-
sinceTime: options.sinceTime,
|
|
18566
|
-
cursor,
|
|
18567
|
-
limit: requestLimit,
|
|
18568
|
-
order: options.order
|
|
18569
|
-
});
|
|
18570
|
-
collected.push(...page.items);
|
|
18571
|
-
if (options.targetCount !== "all" && collected.length >= options.targetCount) {
|
|
18572
|
-
break;
|
|
18573
|
-
}
|
|
18574
|
-
const nextCursor = page.nextCursor ?? null;
|
|
18575
|
-
if (!page.hasMore || !nextCursor || seenCursors.has(nextCursor)) {
|
|
18576
|
-
break;
|
|
18577
|
-
}
|
|
18578
|
-
seenCursors.add(nextCursor);
|
|
18579
|
-
cursor = nextCursor;
|
|
18580
|
-
}
|
|
18581
|
-
const entries = options.targetCount === "all" ? collected : collected.slice(0, options.targetCount);
|
|
18582
|
-
return options.order === "desc" ? entries.reverse() : entries;
|
|
18583
|
-
}
|
|
18584
|
-
|
|
18585
|
-
// src/lib/utils/search-query.ts
|
|
18586
|
-
init_esm_shims();
|
|
18587
|
-
function parseSearchQuery(value, label) {
|
|
18588
|
-
const trimmed = value.trim();
|
|
18589
|
-
if (!trimmed) {
|
|
18590
|
-
throw new Error(`${label} cannot be empty.`);
|
|
18591
|
-
}
|
|
18592
|
-
return trimmed;
|
|
18593
|
-
}
|
|
18594
|
-
|
|
18595
18469
|
export {
|
|
18596
18470
|
require_dist,
|
|
18597
18471
|
extractAndGroupVariables,
|
|
@@ -18613,11 +18487,6 @@ export {
|
|
|
18613
18487
|
parseIdentifier,
|
|
18614
18488
|
renderRunCreated,
|
|
18615
18489
|
pollEvents,
|
|
18616
|
-
showNextSteps
|
|
18617
|
-
parseTime,
|
|
18618
|
-
parsePositiveLogCount,
|
|
18619
|
-
parseBoundedLogCount,
|
|
18620
|
-
collectLogItems,
|
|
18621
|
-
parseSearchQuery
|
|
18490
|
+
showNextSteps
|
|
18622
18491
|
};
|
|
18623
|
-
//# sourceMappingURL=chunk-
|
|
18492
|
+
//# sourceMappingURL=chunk-CWBLSKVL.js.map
|