@getmagical/cli 0.2.3 → 0.2.4
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/dist/index.js +352 -26
- package/dist/index.js.map +4 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -7088,6 +7088,56 @@ var import_ts_essentials = __toESM(require_dist(), 1);
|
|
|
7088
7088
|
// ../common/dist/src/stdlib/result.util.js
|
|
7089
7089
|
import { z } from "zod";
|
|
7090
7090
|
|
|
7091
|
+
// ../common/dist/src/stdlib/error-temporal.js
|
|
7092
|
+
function isErrorLike(obj) {
|
|
7093
|
+
return typeof obj === "object" && obj !== null && "name" in obj && "message" in obj && typeof obj.name === "string" && typeof obj.message === "string";
|
|
7094
|
+
}
|
|
7095
|
+
function isTemporalApplicationFailure(error) {
|
|
7096
|
+
if (!isErrorLike(error)) {
|
|
7097
|
+
return false;
|
|
7098
|
+
}
|
|
7099
|
+
return error.name === "ApplicationFailure" || !!error.stack?.startsWith("ApplicationFailure");
|
|
7100
|
+
}
|
|
7101
|
+
function isTemporalActivityFailure(error) {
|
|
7102
|
+
if (!isErrorLike(error)) {
|
|
7103
|
+
return false;
|
|
7104
|
+
}
|
|
7105
|
+
return error.name === "ActivityFailure" || error.message === "Activity task failed";
|
|
7106
|
+
}
|
|
7107
|
+
function isTemporalChildWorkflowFailure(error) {
|
|
7108
|
+
if (!isErrorLike(error)) {
|
|
7109
|
+
return false;
|
|
7110
|
+
}
|
|
7111
|
+
return error.name === "ChildWorkflowFailure" || error.message === "Child Workflow execution failed";
|
|
7112
|
+
}
|
|
7113
|
+
function isTemporalFailure(error) {
|
|
7114
|
+
if (!isErrorLike(error)) {
|
|
7115
|
+
return false;
|
|
7116
|
+
}
|
|
7117
|
+
return isTemporalApplicationFailure(error) || isTemporalActivityFailure(error) || isTemporalChildWorkflowFailure(error);
|
|
7118
|
+
}
|
|
7119
|
+
|
|
7120
|
+
// ../common/dist/src/stdlib/error-serialization.js
|
|
7121
|
+
function getErrorMessage2(error, maxDepth = 10) {
|
|
7122
|
+
if (error instanceof Error || isErrorLike2(error)) {
|
|
7123
|
+
if (error.cause && maxDepth > 0) {
|
|
7124
|
+
if (isTemporalFailure(error)) {
|
|
7125
|
+
return getErrorMessage2(error.cause, maxDepth - 1);
|
|
7126
|
+
}
|
|
7127
|
+
return `${error.message}
|
|
7128
|
+
${getErrorMessage2(error.cause, maxDepth - 1)}`;
|
|
7129
|
+
}
|
|
7130
|
+
return error.message;
|
|
7131
|
+
}
|
|
7132
|
+
if (typeof error === "string" || typeof error === "number" || typeof error === "boolean" || error === void 0) {
|
|
7133
|
+
return String(error);
|
|
7134
|
+
}
|
|
7135
|
+
return JSON.stringify(error);
|
|
7136
|
+
}
|
|
7137
|
+
function isErrorLike2(obj) {
|
|
7138
|
+
return typeof obj === "object" && obj !== null && "name" in obj && "message" in obj && typeof obj.name === "string" && typeof obj.message === "string";
|
|
7139
|
+
}
|
|
7140
|
+
|
|
7091
7141
|
// ../common/dist/src/stdlib/error-user-facing.js
|
|
7092
7142
|
var USER_FACING_STATUS_MESSAGES = /* @__PURE__ */ new Map([
|
|
7093
7143
|
[400, "Bad Request"],
|
|
@@ -12206,6 +12256,16 @@ function replaceHandlebarsTemplates(value) {
|
|
|
12206
12256
|
return value.replaceAll(HANDLEBARS_TEMPLATE_GLOBAL_REGEX, URL_TEMPLATE_PLACEHOLDER_VALUE);
|
|
12207
12257
|
}
|
|
12208
12258
|
|
|
12259
|
+
// ../common/dist/src/stdlib/unsafe-object-key.util.js
|
|
12260
|
+
var UNSAFE_OBJECT_KEYS = /* @__PURE__ */ new Set([
|
|
12261
|
+
"__proto__",
|
|
12262
|
+
"constructor",
|
|
12263
|
+
"prototype"
|
|
12264
|
+
]);
|
|
12265
|
+
function isUnsafeObjectKey(value) {
|
|
12266
|
+
return UNSAFE_OBJECT_KEYS.has(value);
|
|
12267
|
+
}
|
|
12268
|
+
|
|
12209
12269
|
// ../common/dist/src/models/websocket/actions/scroll.js
|
|
12210
12270
|
import { z as z9 } from "zod";
|
|
12211
12271
|
var scrollDataSchema = z9.object({
|
|
@@ -13373,25 +13433,12 @@ function getIsKnowledgeBaseAssetPathAllowed(path7) {
|
|
|
13373
13433
|
return isTopLevelAssetPath || isAutomationAssetPath || isAutomationAgentAssetPath;
|
|
13374
13434
|
}
|
|
13375
13435
|
|
|
13376
|
-
// ../common/dist/src/utils/automation-variable-path.util.js
|
|
13377
|
-
var AUTOMATION_VARIABLE_PATH_SEGMENT_PATTERN = String.raw`[A-Za-z_][A-Za-z0-9_-]*`;
|
|
13378
|
-
var AUTOMATION_VARIABLE_PATH_PATTERN = String.raw`${AUTOMATION_VARIABLE_PATH_SEGMENT_PATTERN}(?:\.${AUTOMATION_VARIABLE_PATH_SEGMENT_PATTERN})*`;
|
|
13379
|
-
var DANGEROUS_AUTOMATION_VARIABLE_OBJECT_KEYS = /* @__PURE__ */ new Set([
|
|
13380
|
-
"__proto__",
|
|
13381
|
-
"constructor",
|
|
13382
|
-
"prototype"
|
|
13383
|
-
]);
|
|
13384
|
-
var AUTOMATION_VARIABLE_PATH_SEGMENT_REGEX = new RegExp(`^${AUTOMATION_VARIABLE_PATH_SEGMENT_PATTERN}$`, "u");
|
|
13385
|
-
function isDangerousAutomationVariableObjectKey(value) {
|
|
13386
|
-
return DANGEROUS_AUTOMATION_VARIABLE_OBJECT_KEYS.has(value);
|
|
13387
|
-
}
|
|
13388
|
-
|
|
13389
13436
|
// ../common/dist/src/utils/ponr-key-field-path.util.js
|
|
13390
13437
|
var POINT_OF_NO_RETURN_KEY_FIELD_ROOTS = /* @__PURE__ */ new Set(["input", "store"]);
|
|
13391
13438
|
function parsePointOfNoReturnKeyFieldPath(keyField) {
|
|
13392
13439
|
const segments = keyField.split(".");
|
|
13393
13440
|
const [root, ...pathSegments] = segments;
|
|
13394
|
-
if (root === void 0 || !POINT_OF_NO_RETURN_KEY_FIELD_ROOTS.has(root) || pathSegments.length === 0 || pathSegments.some((segment) => segment.length === 0 ||
|
|
13441
|
+
if (root === void 0 || !POINT_OF_NO_RETURN_KEY_FIELD_ROOTS.has(root) || pathSegments.length === 0 || pathSegments.some((segment) => segment.length === 0 || isUnsafeObjectKey(segment))) {
|
|
13395
13442
|
return void 0;
|
|
13396
13443
|
}
|
|
13397
13444
|
return segments;
|
|
@@ -14133,6 +14180,67 @@ var automationRunStartConfigSchema = automationRunConfigBaseSchema.omit({
|
|
|
14133
14180
|
networkTrafficCapture: networkTrafficCaptureSchema.nullable().optional().describe("Network traffic capture preference for this run. Omit to apply the implicit recording policy, pass null to explicitly disable capture, or pass a record/replay config to explicitly enable capture.")
|
|
14134
14181
|
});
|
|
14135
14182
|
|
|
14183
|
+
// ../common/dist/src/utils/custom-instructions-command.util.js
|
|
14184
|
+
var MAX_CUSTOM_COMMAND_COUNT = 1;
|
|
14185
|
+
var MAX_CUSTOM_INSTRUCTIONS_LENGTH = 280;
|
|
14186
|
+
var STANDARD_COMMAND_NAMES = [
|
|
14187
|
+
"callSpecializedAgent",
|
|
14188
|
+
"checkpoint",
|
|
14189
|
+
"click",
|
|
14190
|
+
"clickFill",
|
|
14191
|
+
"ifElse",
|
|
14192
|
+
"loop",
|
|
14193
|
+
"navigateTo",
|
|
14194
|
+
"pressKeys",
|
|
14195
|
+
"queueAgents",
|
|
14196
|
+
"reportStop",
|
|
14197
|
+
"somFilter"
|
|
14198
|
+
];
|
|
14199
|
+
function createInvalidValueError(message) {
|
|
14200
|
+
const error = new Error(`INVALID_VALUE: ${message}`);
|
|
14201
|
+
error.name = "INVALID_VALUE";
|
|
14202
|
+
return error;
|
|
14203
|
+
}
|
|
14204
|
+
function isRecord2(value) {
|
|
14205
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
14206
|
+
}
|
|
14207
|
+
function getCustomInstructions(command) {
|
|
14208
|
+
const commandArguments = command["arguments"];
|
|
14209
|
+
if (!isRecord2(commandArguments)) {
|
|
14210
|
+
return "";
|
|
14211
|
+
}
|
|
14212
|
+
const { instructions } = commandArguments;
|
|
14213
|
+
return typeof instructions === "string" ? instructions.trim() : "";
|
|
14214
|
+
}
|
|
14215
|
+
function getMentionedStandardCommand(instructions) {
|
|
14216
|
+
const normalizedInstructions = instructions.toLowerCase();
|
|
14217
|
+
return STANDARD_COMMAND_NAMES.find((commandName) => normalizedInstructions.includes(commandName.toLowerCase())) ?? null;
|
|
14218
|
+
}
|
|
14219
|
+
function assertCustomInstructionsCommand({ commands, path: path7 }) {
|
|
14220
|
+
const customCommands = commands.flatMap((command, commandIndex) => command["commandName"] === "custom" ? [{ command, path: `${path7}[${commandIndex.toString()}]` }] : []);
|
|
14221
|
+
if (customCommands.length === 0) {
|
|
14222
|
+
return;
|
|
14223
|
+
}
|
|
14224
|
+
if (customCommands.length > MAX_CUSTOM_COMMAND_COUNT) {
|
|
14225
|
+
throw createInvalidValueError(`${path7} contains ${customCommands.length.toString()} custom commands. Use at most one short custom command per agent. Split policy, decision, outreach, and multi-step work into catalog commands or child agents instead.`);
|
|
14226
|
+
}
|
|
14227
|
+
const [customCommand] = customCommands;
|
|
14228
|
+
if (!customCommand) {
|
|
14229
|
+
return;
|
|
14230
|
+
}
|
|
14231
|
+
const instructions = getCustomInstructions(customCommand.command);
|
|
14232
|
+
if (instructions.length === 0) {
|
|
14233
|
+
throw createInvalidValueError(`${customCommand.path}.arguments.instructions must be a non-empty string for custom commands.`);
|
|
14234
|
+
}
|
|
14235
|
+
if (instructions.length > MAX_CUSTOM_INSTRUCTIONS_LENGTH) {
|
|
14236
|
+
throw createInvalidValueError(`${customCommand.path}.arguments.instructions is ${instructions.length.toString()} characters. Custom commands must be short single-action instructions (max ${MAX_CUSTOM_INSTRUCTIONS_LENGTH.toString()} chars). Move policy/template/context text into description, inputSchema, or child agents, and express executable work with catalog commands.`);
|
|
14237
|
+
}
|
|
14238
|
+
const mentionedCommand = getMentionedStandardCommand(instructions);
|
|
14239
|
+
if (mentionedCommand !== null) {
|
|
14240
|
+
throw createInvalidValueError(`${customCommand.path}.arguments.instructions mentions "${mentionedCommand}". Use the "${mentionedCommand}" catalog command directly instead of wrapping it in custom prose.`);
|
|
14241
|
+
}
|
|
14242
|
+
}
|
|
14243
|
+
|
|
14136
14244
|
// ../mcp-registry/src/operation-specs.ts
|
|
14137
14245
|
import { z as z23 } from "zod";
|
|
14138
14246
|
|
|
@@ -14239,6 +14347,78 @@ function jsonOption({
|
|
|
14239
14347
|
};
|
|
14240
14348
|
}
|
|
14241
14349
|
var jsonObjectSchema = z23.record(z23.string(), z23.unknown());
|
|
14350
|
+
function isRecord3(value) {
|
|
14351
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
14352
|
+
}
|
|
14353
|
+
function validateCustomInstructionsCommands({
|
|
14354
|
+
commands,
|
|
14355
|
+
ctx,
|
|
14356
|
+
path: path7
|
|
14357
|
+
}) {
|
|
14358
|
+
if (!Array.isArray(commands)) {
|
|
14359
|
+
return;
|
|
14360
|
+
}
|
|
14361
|
+
const validationResult = fromThrowable(() => {
|
|
14362
|
+
assertCustomInstructionsCommand({
|
|
14363
|
+
commands: commands.map((command) => isRecord3(command) ? command : {}),
|
|
14364
|
+
path: path7.join(".").replaceAll(/\.(?<index>\d+)/gu, "[$<index>]")
|
|
14365
|
+
});
|
|
14366
|
+
}, "invalid-custom-instructions-command");
|
|
14367
|
+
if (isErr(validationResult)) {
|
|
14368
|
+
ctx.addIssue({
|
|
14369
|
+
code: "custom",
|
|
14370
|
+
message: `${getErrorMessage2(validationResult.error.cause)} Run mgcl catalog commands to find the standard command for this work.`,
|
|
14371
|
+
path: path7
|
|
14372
|
+
});
|
|
14373
|
+
}
|
|
14374
|
+
}
|
|
14375
|
+
var automationPatchOperationsSchema = z23.array(z23.unknown()).min(1).superRefine((operations, ctx) => {
|
|
14376
|
+
for (const [operationIndex, operation] of operations.entries()) {
|
|
14377
|
+
if (!isRecord3(operation)) {
|
|
14378
|
+
continue;
|
|
14379
|
+
}
|
|
14380
|
+
const setCommands = operation["setAgentInstructionsCommands"];
|
|
14381
|
+
if (!isRecord3(setCommands)) {
|
|
14382
|
+
continue;
|
|
14383
|
+
}
|
|
14384
|
+
validateCustomInstructionsCommands({
|
|
14385
|
+
commands: setCommands["instructionsCommands"],
|
|
14386
|
+
ctx,
|
|
14387
|
+
path: [
|
|
14388
|
+
"operations",
|
|
14389
|
+
operationIndex,
|
|
14390
|
+
"setAgentInstructionsCommands",
|
|
14391
|
+
"instructionsCommands"
|
|
14392
|
+
]
|
|
14393
|
+
});
|
|
14394
|
+
}
|
|
14395
|
+
});
|
|
14396
|
+
function automationInputSchema(agentKeys) {
|
|
14397
|
+
return jsonObjectSchema.superRefine((input, ctx) => {
|
|
14398
|
+
for (const agentKey of agentKeys) {
|
|
14399
|
+
const agents = input[agentKey];
|
|
14400
|
+
if (!Array.isArray(agents)) {
|
|
14401
|
+
continue;
|
|
14402
|
+
}
|
|
14403
|
+
for (const [agentIndex, agent] of agents.entries()) {
|
|
14404
|
+
if (!isRecord3(agent)) {
|
|
14405
|
+
continue;
|
|
14406
|
+
}
|
|
14407
|
+
validateCustomInstructionsCommands({
|
|
14408
|
+
commands: agent["instructionsCommands"],
|
|
14409
|
+
ctx,
|
|
14410
|
+
path: [agentKey, agentIndex, "instructionsCommands"]
|
|
14411
|
+
});
|
|
14412
|
+
}
|
|
14413
|
+
}
|
|
14414
|
+
});
|
|
14415
|
+
}
|
|
14416
|
+
var createAutomationInputSchema = automationInputSchema(["newAgents"]);
|
|
14417
|
+
var updateAutomationInputSchema = automationInputSchema([
|
|
14418
|
+
"newAgents",
|
|
14419
|
+
"updatedAgents"
|
|
14420
|
+
]);
|
|
14421
|
+
var COMMAND_CATALOG_HELP = "When authoring raw instructionsCommands, run mgcl catalog commands and prefer a standard command.";
|
|
14242
14422
|
var agentBrowserProviderOptionsSelection = ` browserbase {
|
|
14243
14423
|
advancedStealth
|
|
14244
14424
|
contextId
|
|
@@ -14331,6 +14511,46 @@ var agentLimitationsSelection = ` limitations {
|
|
|
14331
14511
|
allowedUrlRegexes
|
|
14332
14512
|
}`;
|
|
14333
14513
|
var operationSpecs = [
|
|
14514
|
+
createOperationSpec({
|
|
14515
|
+
operationName: "GetCaptureContext",
|
|
14516
|
+
kind: "query",
|
|
14517
|
+
inputSchema: z23.object({
|
|
14518
|
+
automationId: z23.string().min(1).optional(),
|
|
14519
|
+
recordingId: z23.string().min(1).optional()
|
|
14520
|
+
}).refine(
|
|
14521
|
+
({ automationId, recordingId }) => [automationId, recordingId].some((value) => value !== void 0),
|
|
14522
|
+
{ message: "Provide --automation-id or --recording-id." }
|
|
14523
|
+
),
|
|
14524
|
+
cli: {
|
|
14525
|
+
name: "get-capture-context",
|
|
14526
|
+
path: ["capture-context", "get"],
|
|
14527
|
+
description: "Fetch raw browser events and screenshots from a Capture Mode recording.",
|
|
14528
|
+
resultKey: "captureContext",
|
|
14529
|
+
options: [
|
|
14530
|
+
stringOption({
|
|
14531
|
+
inputKey: "automationId",
|
|
14532
|
+
flagName: "automation-id",
|
|
14533
|
+
description: "Automation ID whose newest usable Capture Mode recording to fetch."
|
|
14534
|
+
}),
|
|
14535
|
+
stringOption({
|
|
14536
|
+
inputKey: "recordingId",
|
|
14537
|
+
flagName: "recording-id",
|
|
14538
|
+
description: "Exact Capture Mode recording ID to fetch."
|
|
14539
|
+
})
|
|
14540
|
+
]
|
|
14541
|
+
},
|
|
14542
|
+
mcp: { fileName: "captureContext.graphql" },
|
|
14543
|
+
document: `# Fetch raw Capture Mode context with inline screenshots
|
|
14544
|
+
query GetCaptureContext($automationId: ID, $recordingId: ID) {
|
|
14545
|
+
captureContext(
|
|
14546
|
+
automationId: $automationId
|
|
14547
|
+
recordingId: $recordingId
|
|
14548
|
+
) {
|
|
14549
|
+
metadata
|
|
14550
|
+
rawEvents
|
|
14551
|
+
}
|
|
14552
|
+
}`
|
|
14553
|
+
}),
|
|
14334
14554
|
createOperationSpec({
|
|
14335
14555
|
operationName: "GetAgents",
|
|
14336
14556
|
kind: "query",
|
|
@@ -14921,6 +15141,57 @@ query GetAutomationRunIterations(
|
|
|
14921
15141
|
screenshotMimeType
|
|
14922
15142
|
}
|
|
14923
15143
|
}
|
|
15144
|
+
}`
|
|
15145
|
+
}),
|
|
15146
|
+
createOperationSpec({
|
|
15147
|
+
operationName: "InspectPausedAutomationStep",
|
|
15148
|
+
kind: "query",
|
|
15149
|
+
inputSchema: z23.object({
|
|
15150
|
+
runId: z23.string().min(1)
|
|
15151
|
+
}),
|
|
15152
|
+
cli: {
|
|
15153
|
+
name: "inspect-paused-automation-step",
|
|
15154
|
+
path: ["automation-runs", "inspect-paused-step"],
|
|
15155
|
+
description: "Inspect the latest persisted iteration for a paused manual-mode run.",
|
|
15156
|
+
resultKey: "automationRunIterations",
|
|
15157
|
+
options: [
|
|
15158
|
+
stringOption({
|
|
15159
|
+
inputKey: "runId",
|
|
15160
|
+
flagName: "run-id",
|
|
15161
|
+
description: "Automation run ID.",
|
|
15162
|
+
required: true
|
|
15163
|
+
})
|
|
15164
|
+
]
|
|
15165
|
+
},
|
|
15166
|
+
mcp: { fileName: "inspectPausedAutomationStep.graphql" },
|
|
15167
|
+
document: `# Inspect the latest persisted iteration for a paused manual-mode run
|
|
15168
|
+
query InspectPausedAutomationStep($runId: ID!) {
|
|
15169
|
+
automationRunIterations(
|
|
15170
|
+
automationRunId: $runId
|
|
15171
|
+
limit: 1
|
|
15172
|
+
reverse: true
|
|
15173
|
+
) {
|
|
15174
|
+
id
|
|
15175
|
+
sequence
|
|
15176
|
+
agentRunId
|
|
15177
|
+
metadata
|
|
15178
|
+
startedAt
|
|
15179
|
+
finishedAt
|
|
15180
|
+
totalDurationMs
|
|
15181
|
+
llmResponseDurationMs
|
|
15182
|
+
iterationContext
|
|
15183
|
+
verificationResults
|
|
15184
|
+
withMarksScreenshotUrl
|
|
15185
|
+
withMarksMimeType
|
|
15186
|
+
memories {
|
|
15187
|
+
id
|
|
15188
|
+
type
|
|
15189
|
+
value
|
|
15190
|
+
sequence
|
|
15191
|
+
screenshotUrl
|
|
15192
|
+
screenshotMimeType
|
|
15193
|
+
}
|
|
15194
|
+
}
|
|
14924
15195
|
}`
|
|
14925
15196
|
}),
|
|
14926
15197
|
createOperationSpec({
|
|
@@ -15208,7 +15479,10 @@ query AnalyzeAutomationStoreMigration(
|
|
|
15208
15479
|
query GetAvailableCommands($env: AvailableCommandsEnv!) {
|
|
15209
15480
|
availableCommands(env: $env) {
|
|
15210
15481
|
id
|
|
15482
|
+
category
|
|
15211
15483
|
description
|
|
15484
|
+
template
|
|
15485
|
+
whenToUse
|
|
15212
15486
|
requiredTool
|
|
15213
15487
|
inputSchema
|
|
15214
15488
|
}
|
|
@@ -15796,7 +16070,7 @@ query GetAutomationWorkbenchSchemaSuggestions(
|
|
|
15796
16070
|
operationName: "CreateAutomation",
|
|
15797
16071
|
kind: "mutation",
|
|
15798
16072
|
inputSchema: z23.object({
|
|
15799
|
-
input:
|
|
16073
|
+
input: createAutomationInputSchema
|
|
15800
16074
|
}),
|
|
15801
16075
|
cli: {
|
|
15802
16076
|
name: "create-automation",
|
|
@@ -15807,7 +16081,7 @@ query GetAutomationWorkbenchSchemaSuggestions(
|
|
|
15807
16081
|
jsonOption({
|
|
15808
16082
|
inputKey: "input",
|
|
15809
16083
|
flagName: "input-json",
|
|
15810
|
-
description:
|
|
16084
|
+
description: `CreateAutomationInput payload. ${COMMAND_CATALOG_HELP}`,
|
|
15811
16085
|
required: true
|
|
15812
16086
|
})
|
|
15813
16087
|
]
|
|
@@ -15848,6 +16122,58 @@ mutation CreateAutomation($input: CreateAutomationInput!) {
|
|
|
15848
16122
|
# reuse cached results.
|
|
15849
16123
|
query GetGraphqlSchema {
|
|
15850
16124
|
graphqlSchema
|
|
16125
|
+
}`
|
|
16126
|
+
}),
|
|
16127
|
+
createOperationSpec({
|
|
16128
|
+
operationName: "ApproveAutomationStep",
|
|
16129
|
+
kind: "mutation",
|
|
16130
|
+
inputSchema: z23.object({
|
|
16131
|
+
runId: z23.string().min(1)
|
|
16132
|
+
}),
|
|
16133
|
+
cli: {
|
|
16134
|
+
name: "approve-automation-step",
|
|
16135
|
+
path: ["automation-runs", "approve-step"],
|
|
16136
|
+
description: "Approve the proposed step for a paused manual-mode run.",
|
|
16137
|
+
resultKey: "approveAutomationStep",
|
|
16138
|
+
options: [
|
|
16139
|
+
stringOption({
|
|
16140
|
+
inputKey: "runId",
|
|
16141
|
+
flagName: "run-id",
|
|
16142
|
+
description: "Automation run ID.",
|
|
16143
|
+
required: true
|
|
16144
|
+
})
|
|
16145
|
+
]
|
|
16146
|
+
},
|
|
16147
|
+
mcp: { fileName: "approveAutomationStep.graphql" },
|
|
16148
|
+
document: `# Approve the proposed step for a paused manual-mode run
|
|
16149
|
+
mutation ApproveAutomationStep($runId: ID!) {
|
|
16150
|
+
approveAutomationStep(automationRunId: $runId, retry: false)
|
|
16151
|
+
}`
|
|
16152
|
+
}),
|
|
16153
|
+
createOperationSpec({
|
|
16154
|
+
operationName: "RetryAutomationStep",
|
|
16155
|
+
kind: "mutation",
|
|
16156
|
+
inputSchema: z23.object({
|
|
16157
|
+
runId: z23.string().min(1)
|
|
16158
|
+
}),
|
|
16159
|
+
cli: {
|
|
16160
|
+
name: "retry-automation-step",
|
|
16161
|
+
path: ["automation-runs", "retry-step"],
|
|
16162
|
+
description: "Retry the proposed step after saving a material change to its agent.",
|
|
16163
|
+
resultKey: "approveAutomationStep",
|
|
16164
|
+
options: [
|
|
16165
|
+
stringOption({
|
|
16166
|
+
inputKey: "runId",
|
|
16167
|
+
flagName: "run-id",
|
|
16168
|
+
description: "Automation run ID.",
|
|
16169
|
+
required: true
|
|
16170
|
+
})
|
|
16171
|
+
]
|
|
16172
|
+
},
|
|
16173
|
+
mcp: { fileName: "retryAutomationStep.graphql" },
|
|
16174
|
+
document: `# Retry the proposed step after saving a material change to its agent
|
|
16175
|
+
mutation RetryAutomationStep($runId: ID!) {
|
|
16176
|
+
approveAutomationStep(automationRunId: $runId, retry: true)
|
|
15851
16177
|
}`
|
|
15852
16178
|
}),
|
|
15853
16179
|
createOperationSpec({
|
|
@@ -16092,7 +16418,7 @@ mutation StopAutomationRun($automationRunId: ID!) {
|
|
|
16092
16418
|
inputSchema: z23.object({
|
|
16093
16419
|
draftAutomationId: z23.string().min(1),
|
|
16094
16420
|
expectedLastSavedAt: z23.string().optional(),
|
|
16095
|
-
operations:
|
|
16421
|
+
operations: automationPatchOperationsSchema
|
|
16096
16422
|
}),
|
|
16097
16423
|
cli: {
|
|
16098
16424
|
name: "preview-automation-patch",
|
|
@@ -16109,7 +16435,7 @@ mutation StopAutomationRun($automationRunId: ID!) {
|
|
|
16109
16435
|
jsonOption({
|
|
16110
16436
|
inputKey: "operations",
|
|
16111
16437
|
flagName: "operations-json",
|
|
16112
|
-
description:
|
|
16438
|
+
description: `Automation patch operations array using AutomationWorkbenchPatchOperationInput oneOf shape. ${COMMAND_CATALOG_HELP}`,
|
|
16113
16439
|
required: true
|
|
16114
16440
|
})
|
|
16115
16441
|
]
|
|
@@ -16203,7 +16529,7 @@ mutation PreviewAutomationPatch(
|
|
|
16203
16529
|
kind: "mutation",
|
|
16204
16530
|
inputSchema: z23.object({
|
|
16205
16531
|
draftAutomationId: z23.string().min(1),
|
|
16206
|
-
operations:
|
|
16532
|
+
operations: automationPatchOperationsSchema
|
|
16207
16533
|
}),
|
|
16208
16534
|
cli: {
|
|
16209
16535
|
name: "apply-automation-patch",
|
|
@@ -16220,7 +16546,7 @@ mutation PreviewAutomationPatch(
|
|
|
16220
16546
|
jsonOption({
|
|
16221
16547
|
inputKey: "operations",
|
|
16222
16548
|
flagName: "operations-json",
|
|
16223
|
-
description:
|
|
16549
|
+
description: `Automation patch operations array using AutomationWorkbenchPatchOperationInput oneOf shape. ${COMMAND_CATALOG_HELP}`,
|
|
16224
16550
|
required: true
|
|
16225
16551
|
}),
|
|
16226
16552
|
stringOption({
|
|
@@ -16321,7 +16647,7 @@ mutation ApplyAutomationPatch(
|
|
|
16321
16647
|
kind: "mutation",
|
|
16322
16648
|
inputSchema: z23.object({
|
|
16323
16649
|
id: z23.string().min(1),
|
|
16324
|
-
input:
|
|
16650
|
+
input: updateAutomationInputSchema
|
|
16325
16651
|
}),
|
|
16326
16652
|
cli: {
|
|
16327
16653
|
name: "update-automation-by-id",
|
|
@@ -16338,7 +16664,7 @@ mutation ApplyAutomationPatch(
|
|
|
16338
16664
|
jsonOption({
|
|
16339
16665
|
inputKey: "input",
|
|
16340
16666
|
flagName: "input-json",
|
|
16341
|
-
description:
|
|
16667
|
+
description: `UpdateAutomationInput payload. Must include baseVersionId from a fresh read. Store schema writes are additive under config.storeSchema; use removeStoreSchemaPaths for explicit deletion or replaceStoreSchema for exact replacement. ${COMMAND_CATALOG_HELP}`,
|
|
16342
16668
|
required: true
|
|
16343
16669
|
})
|
|
16344
16670
|
]
|
|
@@ -16456,7 +16782,7 @@ function getApiErrorDetail(responseBody) {
|
|
|
16456
16782
|
function trimTrailingSlash(value) {
|
|
16457
16783
|
return value.replace(/\/+$/u, "");
|
|
16458
16784
|
}
|
|
16459
|
-
function
|
|
16785
|
+
function isRecord4(value) {
|
|
16460
16786
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
16461
16787
|
}
|
|
16462
16788
|
function decodeJwtPayload(token) {
|
|
@@ -16470,7 +16796,7 @@ function decodeJwtPayload(token) {
|
|
|
16470
16796
|
if (isErr(payloadResult)) {
|
|
16471
16797
|
return null;
|
|
16472
16798
|
}
|
|
16473
|
-
return
|
|
16799
|
+
return isRecord4(payloadResult.value) ? payloadResult.value : null;
|
|
16474
16800
|
}
|
|
16475
16801
|
function isOttoAuthorizationToken(token) {
|
|
16476
16802
|
return decodeJwtPayload(token)?.["iss"] === OTTO_AUTHORIZATION_ISSUER;
|
|
@@ -17669,7 +17995,7 @@ function createCliCommanderOption(optionSpec, helpGroup) {
|
|
|
17669
17995
|
}
|
|
17670
17996
|
return nextOption;
|
|
17671
17997
|
}
|
|
17672
|
-
function
|
|
17998
|
+
function isRecord5(value) {
|
|
17673
17999
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
17674
18000
|
}
|
|
17675
18001
|
function resolveOrganizationBySelector({
|
|
@@ -17736,7 +18062,7 @@ function collectOperationVariables(operationSpec, options) {
|
|
|
17736
18062
|
parsedVariables.error.issues[0]?.message ?? "Invalid command input."
|
|
17737
18063
|
);
|
|
17738
18064
|
}
|
|
17739
|
-
if (!
|
|
18065
|
+
if (!isRecord5(parsedVariables.data)) {
|
|
17740
18066
|
throw new CliError("Invalid command input.");
|
|
17741
18067
|
}
|
|
17742
18068
|
return parsedVariables.data;
|