@getmagical/cli 0.11.0 → 0.12.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/README.md +28 -0
- package/dist/index.js +1501 -878
- package/dist/index.js.map +4 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2056,13 +2056,13 @@ var require_ast = __commonJS({
|
|
|
2056
2056
|
helperExpression: function helperExpression(node) {
|
|
2057
2057
|
return node.type === "SubExpression" || (node.type === "MustacheStatement" || node.type === "BlockStatement") && !!(node.params && node.params.length || node.hash);
|
|
2058
2058
|
},
|
|
2059
|
-
scopedId: function scopedId(
|
|
2060
|
-
return /^\.|this\b/.test(
|
|
2059
|
+
scopedId: function scopedId(path23) {
|
|
2060
|
+
return /^\.|this\b/.test(path23.original);
|
|
2061
2061
|
},
|
|
2062
2062
|
// an ID is simple if it only has one part, and that part is not
|
|
2063
2063
|
// `..` or `this`.
|
|
2064
|
-
simpleId: function simpleId(
|
|
2065
|
-
return
|
|
2064
|
+
simpleId: function simpleId(path23) {
|
|
2065
|
+
return path23.parts.length === 1 && !AST.helpers.scopedId(path23) && !path23.depth;
|
|
2066
2066
|
}
|
|
2067
2067
|
}
|
|
2068
2068
|
};
|
|
@@ -3132,12 +3132,12 @@ var require_helpers2 = __commonJS({
|
|
|
3132
3132
|
loc
|
|
3133
3133
|
};
|
|
3134
3134
|
}
|
|
3135
|
-
function prepareMustache(
|
|
3135
|
+
function prepareMustache(path23, params, hash, open2, strip, locInfo) {
|
|
3136
3136
|
var escapeFlag = open2.charAt(3) || open2.charAt(2), escaped = escapeFlag !== "{" && escapeFlag !== "&";
|
|
3137
3137
|
var decorator = /\*/.test(open2);
|
|
3138
3138
|
return {
|
|
3139
3139
|
type: decorator ? "Decorator" : "MustacheStatement",
|
|
3140
|
-
path:
|
|
3140
|
+
path: path23,
|
|
3141
3141
|
params,
|
|
3142
3142
|
hash,
|
|
3143
3143
|
escaped,
|
|
@@ -3455,9 +3455,9 @@ var require_compiler = __commonJS({
|
|
|
3455
3455
|
},
|
|
3456
3456
|
DecoratorBlock: function DecoratorBlock(decorator) {
|
|
3457
3457
|
var program2 = decorator.program && this.compileProgram(decorator.program);
|
|
3458
|
-
var params = this.setupFullMustacheParams(decorator, program2, void 0),
|
|
3458
|
+
var params = this.setupFullMustacheParams(decorator, program2, void 0), path23 = decorator.path;
|
|
3459
3459
|
this.useDecorators = true;
|
|
3460
|
-
this.opcode("registerDecorator", params.length,
|
|
3460
|
+
this.opcode("registerDecorator", params.length, path23.original);
|
|
3461
3461
|
},
|
|
3462
3462
|
PartialStatement: function PartialStatement(partial) {
|
|
3463
3463
|
this.usePartial = true;
|
|
@@ -3521,46 +3521,46 @@ var require_compiler = __commonJS({
|
|
|
3521
3521
|
}
|
|
3522
3522
|
},
|
|
3523
3523
|
ambiguousSexpr: function ambiguousSexpr(sexpr, program2, inverse) {
|
|
3524
|
-
var
|
|
3525
|
-
this.opcode("getContext",
|
|
3524
|
+
var path23 = sexpr.path, name = path23.parts[0], isBlock = program2 != null || inverse != null;
|
|
3525
|
+
this.opcode("getContext", path23.depth);
|
|
3526
3526
|
this.opcode("pushProgram", program2);
|
|
3527
3527
|
this.opcode("pushProgram", inverse);
|
|
3528
|
-
|
|
3529
|
-
this.accept(
|
|
3528
|
+
path23.strict = true;
|
|
3529
|
+
this.accept(path23);
|
|
3530
3530
|
this.opcode("invokeAmbiguous", name, isBlock);
|
|
3531
3531
|
},
|
|
3532
3532
|
simpleSexpr: function simpleSexpr(sexpr) {
|
|
3533
|
-
var
|
|
3534
|
-
|
|
3535
|
-
this.accept(
|
|
3533
|
+
var path23 = sexpr.path;
|
|
3534
|
+
path23.strict = true;
|
|
3535
|
+
this.accept(path23);
|
|
3536
3536
|
this.opcode("resolvePossibleLambda");
|
|
3537
3537
|
},
|
|
3538
3538
|
helperSexpr: function helperSexpr(sexpr, program2, inverse) {
|
|
3539
|
-
var params = this.setupFullMustacheParams(sexpr, program2, inverse),
|
|
3539
|
+
var params = this.setupFullMustacheParams(sexpr, program2, inverse), path23 = sexpr.path, name = path23.parts[0];
|
|
3540
3540
|
if (this.options.knownHelpers[name]) {
|
|
3541
3541
|
this.opcode("invokeKnownHelper", params.length, name);
|
|
3542
3542
|
} else if (this.options.knownHelpersOnly) {
|
|
3543
3543
|
throw new _exception2["default"]("You specified knownHelpersOnly, but used the unknown helper " + name, sexpr);
|
|
3544
3544
|
} else {
|
|
3545
|
-
|
|
3546
|
-
|
|
3547
|
-
this.accept(
|
|
3548
|
-
this.opcode("invokeHelper", params.length,
|
|
3545
|
+
path23.strict = true;
|
|
3546
|
+
path23.falsy = true;
|
|
3547
|
+
this.accept(path23);
|
|
3548
|
+
this.opcode("invokeHelper", params.length, path23.original, _ast2["default"].helpers.simpleId(path23));
|
|
3549
3549
|
}
|
|
3550
3550
|
},
|
|
3551
|
-
PathExpression: function PathExpression(
|
|
3552
|
-
this.addDepth(
|
|
3553
|
-
this.opcode("getContext",
|
|
3554
|
-
var name =
|
|
3551
|
+
PathExpression: function PathExpression(path23) {
|
|
3552
|
+
this.addDepth(path23.depth);
|
|
3553
|
+
this.opcode("getContext", path23.depth);
|
|
3554
|
+
var name = path23.parts[0], scoped = _ast2["default"].helpers.scopedId(path23), blockParamId = !path23.depth && !scoped && this.blockParamIndex(name);
|
|
3555
3555
|
if (blockParamId) {
|
|
3556
|
-
this.opcode("lookupBlockParam", blockParamId,
|
|
3556
|
+
this.opcode("lookupBlockParam", blockParamId, path23.parts);
|
|
3557
3557
|
} else if (!name) {
|
|
3558
3558
|
this.opcode("pushContext");
|
|
3559
|
-
} else if (
|
|
3559
|
+
} else if (path23.data) {
|
|
3560
3560
|
this.options.data = true;
|
|
3561
|
-
this.opcode("lookupData",
|
|
3561
|
+
this.opcode("lookupData", path23.depth, path23.parts, path23.strict);
|
|
3562
3562
|
} else {
|
|
3563
|
-
this.opcode("lookupOnContext",
|
|
3563
|
+
this.opcode("lookupOnContext", path23.parts, path23.falsy, path23.strict, scoped);
|
|
3564
3564
|
}
|
|
3565
3565
|
},
|
|
3566
3566
|
StringLiteral: function StringLiteral(string) {
|
|
@@ -3910,16 +3910,16 @@ var require_util2 = __commonJS({
|
|
|
3910
3910
|
}
|
|
3911
3911
|
exports.urlGenerate = urlGenerate;
|
|
3912
3912
|
function normalize(aPath) {
|
|
3913
|
-
var
|
|
3913
|
+
var path23 = aPath;
|
|
3914
3914
|
var url = urlParse(aPath);
|
|
3915
3915
|
if (url) {
|
|
3916
3916
|
if (!url.path) {
|
|
3917
3917
|
return aPath;
|
|
3918
3918
|
}
|
|
3919
|
-
|
|
3919
|
+
path23 = url.path;
|
|
3920
3920
|
}
|
|
3921
|
-
var isAbsolute = exports.isAbsolute(
|
|
3922
|
-
var parts =
|
|
3921
|
+
var isAbsolute = exports.isAbsolute(path23);
|
|
3922
|
+
var parts = path23.split(/\/+/);
|
|
3923
3923
|
for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {
|
|
3924
3924
|
part = parts[i];
|
|
3925
3925
|
if (part === ".") {
|
|
@@ -3936,15 +3936,15 @@ var require_util2 = __commonJS({
|
|
|
3936
3936
|
}
|
|
3937
3937
|
}
|
|
3938
3938
|
}
|
|
3939
|
-
|
|
3940
|
-
if (
|
|
3941
|
-
|
|
3939
|
+
path23 = parts.join("/");
|
|
3940
|
+
if (path23 === "") {
|
|
3941
|
+
path23 = isAbsolute ? "/" : ".";
|
|
3942
3942
|
}
|
|
3943
3943
|
if (url) {
|
|
3944
|
-
url.path =
|
|
3944
|
+
url.path = path23;
|
|
3945
3945
|
return urlGenerate(url);
|
|
3946
3946
|
}
|
|
3947
|
-
return
|
|
3947
|
+
return path23;
|
|
3948
3948
|
}
|
|
3949
3949
|
exports.normalize = normalize;
|
|
3950
3950
|
function join(aRoot, aPath) {
|
|
@@ -6727,8 +6727,8 @@ var require_printer = __commonJS({
|
|
|
6727
6727
|
return this.accept(sexpr.path) + " " + params + hash;
|
|
6728
6728
|
};
|
|
6729
6729
|
PrintVisitor.prototype.PathExpression = function(id) {
|
|
6730
|
-
var
|
|
6731
|
-
return (id.data ? "@" : "") + "PATH:" +
|
|
6730
|
+
var path23 = id.parts.join("/");
|
|
6731
|
+
return (id.data ? "@" : "") + "PATH:" + path23;
|
|
6732
6732
|
};
|
|
6733
6733
|
PrintVisitor.prototype.StringLiteral = function(string) {
|
|
6734
6734
|
return '"' + string.value + '"';
|
|
@@ -7219,7 +7219,7 @@ function getErrorMessage(error) {
|
|
|
7219
7219
|
|
|
7220
7220
|
// src/program.ts
|
|
7221
7221
|
import { randomUUID as randomUUID7 } from "node:crypto";
|
|
7222
|
-
import
|
|
7222
|
+
import path22 from "node:path";
|
|
7223
7223
|
import { setTimeout as sleep2 } from "node:timers/promises";
|
|
7224
7224
|
|
|
7225
7225
|
// ../common/dist/src/stdlib/json.util.js
|
|
@@ -12979,8 +12979,8 @@ var RENDER_TEMPLATE_ERROR_REASON_CATALOG = defineErrorReasonCatalog()([
|
|
|
12979
12979
|
]);
|
|
12980
12980
|
var storeReferencePathPattern = String.raw`store(?:\.[$A-Z_a-z][\w$]*)*`;
|
|
12981
12981
|
var storeReferenceMarkdownLinkTemplateRegex = new RegExp(String.raw`(?<open>\{\{\{?)\s*\[(?<path>${storeReferencePathPattern})\]\(\s*<?https?:\/\/\k<path>>?\s*\)\s*(?<close>\}\}\}?)`, "gu");
|
|
12982
|
-
function normalizeAutomationStoreTemplateLinkMatch([_match, open2,
|
|
12983
|
-
return open2 === "{{{" ? `{{{${
|
|
12982
|
+
function normalizeAutomationStoreTemplateLinkMatch([_match, open2, path23]) {
|
|
12983
|
+
return open2 === "{{{" ? `{{{${path23}}}}` : `{{${path23}}}`;
|
|
12984
12984
|
}
|
|
12985
12985
|
function normalizeAutomationStoreTemplateLinks(template) {
|
|
12986
12986
|
return template.replaceAll(storeReferenceMarkdownLinkTemplateRegex, (...args) => normalizeAutomationStoreTemplateLinkMatch(args));
|
|
@@ -14173,18 +14173,18 @@ var specialCommands = {
|
|
|
14173
14173
|
// ../common/dist/src/utils/automation-store-path.util.js
|
|
14174
14174
|
var AUTOMATION_STORE_ROOT_PATH = "store";
|
|
14175
14175
|
var relativeStorePathRegex = /^[$A-Z_a-z][\w$]*(?:\.[$A-Z_a-z][\w$]*)*$/u;
|
|
14176
|
-
function normalizeStoreMutationPath(
|
|
14177
|
-
const trimmedPath =
|
|
14176
|
+
function normalizeStoreMutationPath(path23) {
|
|
14177
|
+
const trimmedPath = path23.trim();
|
|
14178
14178
|
const rootPrefix = `${AUTOMATION_STORE_ROOT_PATH}.`;
|
|
14179
14179
|
const relativePath = trimmedPath.startsWith(rootPrefix) ? trimmedPath.slice(rootPrefix.length) : trimmedPath;
|
|
14180
14180
|
if (!relativeStorePathRegex.test(relativePath)) {
|
|
14181
14181
|
return Err({
|
|
14182
14182
|
type: "invalid-automation-store-path",
|
|
14183
|
-
path:
|
|
14183
|
+
path: path23,
|
|
14184
14184
|
categories: ["customer_usage"],
|
|
14185
14185
|
statusCode: 400,
|
|
14186
14186
|
nonRetryable: true,
|
|
14187
|
-
message: `Automation store path "${
|
|
14187
|
+
message: `Automation store path "${path23}" is invalid.`,
|
|
14188
14188
|
suggestedAction: "Use a dot path relative to the automation store, such as patient.name or provider.clinic."
|
|
14189
14189
|
});
|
|
14190
14190
|
}
|
|
@@ -14197,16 +14197,16 @@ function findAutomationStorePathOverlap(paths) {
|
|
|
14197
14197
|
...new Set(paths.map(getCanonicalAutomationStoreMutationPath))
|
|
14198
14198
|
].toSorted((left, right) => (left === AUTOMATION_STORE_ROOT_PATH ? 0 : left.split(".").length) - (right === AUTOMATION_STORE_ROOT_PATH ? 0 : right.split(".").length));
|
|
14199
14199
|
for (const [index, ancestorPath] of canonicalPaths.entries()) {
|
|
14200
|
-
const descendantPath = canonicalPaths.slice(index + 1).find((
|
|
14200
|
+
const descendantPath = canonicalPaths.slice(index + 1).find((path23) => ancestorPath === AUTOMATION_STORE_ROOT_PATH || path23.startsWith(`${ancestorPath}.`));
|
|
14201
14201
|
if (descendantPath !== void 0) {
|
|
14202
14202
|
return { ancestorPath, descendantPath };
|
|
14203
14203
|
}
|
|
14204
14204
|
}
|
|
14205
14205
|
return void 0;
|
|
14206
14206
|
}
|
|
14207
|
-
function getCanonicalAutomationStoreMutationPath(
|
|
14208
|
-
const normalizedPath = normalizeStoreMutationPath(
|
|
14209
|
-
return normalizedPath._tag === "Ok" ? normalizedPath.value :
|
|
14207
|
+
function getCanonicalAutomationStoreMutationPath(path23) {
|
|
14208
|
+
const normalizedPath = normalizeStoreMutationPath(path23);
|
|
14209
|
+
return normalizedPath._tag === "Ok" ? normalizedPath.value : path23.trim();
|
|
14210
14210
|
}
|
|
14211
14211
|
|
|
14212
14212
|
// ../common/dist/src/utils/automation-store-mapping-path.util.js
|
|
@@ -14253,7 +14253,7 @@ var mappingDefinitionV1Schema = z14.object({
|
|
|
14253
14253
|
|
|
14254
14254
|
// ../common/dist/src/zod-schemas/queue-work-item.schema.js
|
|
14255
14255
|
var queueWorkItemEntrySchema = z15.object({
|
|
14256
|
-
targetAutomationId: brandedStringValidator("
|
|
14256
|
+
targetAutomationId: brandedStringValidator("automationId").describe("The configured target automation. Its version is resolved from the saved caller configuration."),
|
|
14257
14257
|
agentId: brandedStringValidator("agentId").describe("The configured root agent to start."),
|
|
14258
14258
|
seedMappingId: brandedStringValidator("storeMappingId").optional().describe("The saved send mapping to initialize the target Store. Omit only when target defaults satisfy required fields."),
|
|
14259
14259
|
delegatedValues: z15.array(z15.object({
|
|
@@ -14799,9 +14799,9 @@ var baseToolDeclarations = {
|
|
|
14799
14799
|
path: []
|
|
14800
14800
|
});
|
|
14801
14801
|
}
|
|
14802
|
-
const canonicalUpdatePaths = updates.map(({ path:
|
|
14802
|
+
const canonicalUpdatePaths = updates.map(({ path: path23 }) => getCanonicalAutomationStoreMutationPath(path23));
|
|
14803
14803
|
const canonicalClearPathSet = new Set(clears.map(getCanonicalAutomationStoreMutationPath));
|
|
14804
|
-
const conflictedUpdatePath = canonicalUpdatePaths.find((
|
|
14804
|
+
const conflictedUpdatePath = canonicalUpdatePaths.find((path23) => canonicalClearPathSet.has(path23));
|
|
14805
14805
|
if (conflictedUpdatePath !== void 0) {
|
|
14806
14806
|
context.addIssue({
|
|
14807
14807
|
code: "custom",
|
|
@@ -15341,9 +15341,9 @@ var magicalApiKeyPermissionPresets = [
|
|
|
15341
15341
|
import { z as z28 } from "zod";
|
|
15342
15342
|
|
|
15343
15343
|
// ../common/dist/src/utils/agent-knowledge-base-assets.util.js
|
|
15344
|
-
function getIsKnowledgeBaseAssetPathAllowed(
|
|
15345
|
-
const pathSegments =
|
|
15346
|
-
if (
|
|
15344
|
+
function getIsKnowledgeBaseAssetPathAllowed(path23) {
|
|
15345
|
+
const pathSegments = path23.split("/");
|
|
15346
|
+
if (path23.length === 0 || pathSegments.some((segment) => segment.length === 0)) {
|
|
15347
15347
|
return false;
|
|
15348
15348
|
}
|
|
15349
15349
|
const isTopLevelAssetPath = pathSegments[0] === "assets";
|
|
@@ -15398,29 +15398,29 @@ var ApiEmbeddedFileContentTypes = [
|
|
|
15398
15398
|
];
|
|
15399
15399
|
var API_EMBEDDED_FILE_PATH_PATTERN = /^(?:\[\*\]|[A-Za-z_$][\w$-]*)(?:\[\*\]|\.[A-Za-z_$][\w$-]*)*$/u;
|
|
15400
15400
|
var API_EMBEDDED_FILE_PATH_SEGMENT_PATTERN = /\[\*\]|[A-Za-z_$][\w$-]*/gu;
|
|
15401
|
-
function parseApiEmbeddedFilePath(
|
|
15402
|
-
if (!API_EMBEDDED_FILE_PATH_PATTERN.test(
|
|
15401
|
+
function parseApiEmbeddedFilePath(path23) {
|
|
15402
|
+
if (!API_EMBEDDED_FILE_PATH_PATTERN.test(path23)) {
|
|
15403
15403
|
return void 0;
|
|
15404
15404
|
}
|
|
15405
|
-
return [...
|
|
15405
|
+
return [...path23.matchAll(API_EMBEDDED_FILE_PATH_SEGMENT_PATTERN)].map(([segment]) => segment === "[*]" ? { type: "arrayWildcard" } : { key: segment, type: "property" });
|
|
15406
15406
|
}
|
|
15407
15407
|
var apiAgentEmbeddedFileSchema = z20.object({
|
|
15408
|
-
path: z20.string().trim().min(1, "Embedded file path is required.").refine((
|
|
15408
|
+
path: z20.string().trim().min(1, "Embedded file path is required.").refine((path23) => parseApiEmbeddedFilePath(path23) !== void 0, {
|
|
15409
15409
|
message: "Embedded file path must use object properties and [*] array wildcards."
|
|
15410
15410
|
}).describe("Path to a Base64 value relative to the projected API response. Supports object properties and [*] array wildcards."),
|
|
15411
15411
|
contentType: z20.enum(ApiEmbeddedFileContentTypes).describe("File type of the decoded Base64 value. Use auto to detect PDF, PNG, or JPEG from each file\u2019s contents. Unrecognized files are skipped.")
|
|
15412
15412
|
}).strict();
|
|
15413
15413
|
var apiAgentEmbeddedFilesSchema = z20.array(apiAgentEmbeddedFileSchema).superRefine((embeddedFiles, context) => {
|
|
15414
15414
|
const paths = /* @__PURE__ */ new Set();
|
|
15415
|
-
for (const [index, { path:
|
|
15416
|
-
if (paths.has(
|
|
15415
|
+
for (const [index, { path: path23 }] of embeddedFiles.entries()) {
|
|
15416
|
+
if (paths.has(path23)) {
|
|
15417
15417
|
context.addIssue({
|
|
15418
15418
|
code: z20.ZodIssueCode.custom,
|
|
15419
|
-
message: `Embedded file path "${
|
|
15419
|
+
message: `Embedded file path "${path23}" can only be configured once.`,
|
|
15420
15420
|
path: [index, "path"]
|
|
15421
15421
|
});
|
|
15422
15422
|
}
|
|
15423
|
-
paths.add(
|
|
15423
|
+
paths.add(path23);
|
|
15424
15424
|
}
|
|
15425
15425
|
}).describe("Base64 values to decode, upload as permanent files, and replace with file references in the projected API response.");
|
|
15426
15426
|
|
|
@@ -15430,13 +15430,13 @@ var API_REQUEST_FILE_PATH_PATTERN = /^[A-Za-z_$][\w$-]*(?:\.[A-Za-z_$][\w$-]*)*$
|
|
|
15430
15430
|
var API_REQUEST_BASE64_FILE_HELPER_PATTERN = /^\s*\{\{\s*base64File\s+(?<sourceInput>[^{}\s]+)\s*\}\}\s*$/u;
|
|
15431
15431
|
var API_REQUEST_BASE64_FILE_HELPER_USAGE_PATTERN = /\{\{\s*base64File\b/u;
|
|
15432
15432
|
var API_REQUEST_BASE64_FILE_HELPER_EXAMPLE = "{{base64File fileInput}}";
|
|
15433
|
-
function parseApiRequestFilePath(
|
|
15434
|
-
if (!API_REQUEST_FILE_PATH_PATTERN.test(
|
|
15433
|
+
function parseApiRequestFilePath(path23) {
|
|
15434
|
+
if (!API_REQUEST_FILE_PATH_PATTERN.test(path23)) {
|
|
15435
15435
|
return void 0;
|
|
15436
15436
|
}
|
|
15437
|
-
return
|
|
15437
|
+
return path23.split(".");
|
|
15438
15438
|
}
|
|
15439
|
-
function inspectApiRequestBase64FileHelperValue({ path:
|
|
15439
|
+
function inspectApiRequestBase64FileHelperValue({ path: path23, value }) {
|
|
15440
15440
|
const match = API_REQUEST_BASE64_FILE_HELPER_PATTERN.exec(value);
|
|
15441
15441
|
if (match === null) {
|
|
15442
15442
|
return API_REQUEST_BASE64_FILE_HELPER_USAGE_PATTERN.test(value) ? {
|
|
@@ -15444,7 +15444,7 @@ function inspectApiRequestBase64FileHelperValue({ path: path22, value }) {
|
|
|
15444
15444
|
issues: [
|
|
15445
15445
|
{
|
|
15446
15446
|
message: `Use ${API_REQUEST_BASE64_FILE_HELPER_EXAMPLE} as the entire JSON field value.`,
|
|
15447
|
-
path:
|
|
15447
|
+
path: path23
|
|
15448
15448
|
}
|
|
15449
15449
|
]
|
|
15450
15450
|
} : { helpers: [], issues: [] };
|
|
@@ -15456,24 +15456,24 @@ function inspectApiRequestBase64FileHelperValue({ path: path22, value }) {
|
|
|
15456
15456
|
issues: [
|
|
15457
15457
|
{
|
|
15458
15458
|
message: "Base64 file helper input must use an object property path.",
|
|
15459
|
-
path:
|
|
15459
|
+
path: path23
|
|
15460
15460
|
}
|
|
15461
15461
|
]
|
|
15462
15462
|
};
|
|
15463
15463
|
}
|
|
15464
15464
|
return {
|
|
15465
|
-
helpers: [{ destinationPath:
|
|
15465
|
+
helpers: [{ destinationPath: path23, sourceInput }],
|
|
15466
15466
|
issues: []
|
|
15467
15467
|
};
|
|
15468
15468
|
}
|
|
15469
|
-
function inspectApiRequestBase64FileHelpers(body,
|
|
15469
|
+
function inspectApiRequestBase64FileHelpers(body, path23 = []) {
|
|
15470
15470
|
if (typeof body === "string") {
|
|
15471
|
-
return inspectApiRequestBase64FileHelperValue({ path:
|
|
15471
|
+
return inspectApiRequestBase64FileHelperValue({ path: path23, value: body });
|
|
15472
15472
|
}
|
|
15473
15473
|
if (Array.isArray(body)) {
|
|
15474
15474
|
return body.reduce((inspection, value, index) => {
|
|
15475
15475
|
const nestedInspection = inspectApiRequestBase64FileHelpers(value, [
|
|
15476
|
-
...
|
|
15476
|
+
...path23,
|
|
15477
15477
|
index
|
|
15478
15478
|
]);
|
|
15479
15479
|
return {
|
|
@@ -15487,7 +15487,7 @@ function inspectApiRequestBase64FileHelpers(body, path22 = []) {
|
|
|
15487
15487
|
}
|
|
15488
15488
|
return Object.entries(body).reduce((inspection, [key, value]) => {
|
|
15489
15489
|
const nestedInspection = inspectApiRequestBase64FileHelpers(value, [
|
|
15490
|
-
...
|
|
15490
|
+
...path23,
|
|
15491
15491
|
key
|
|
15492
15492
|
]);
|
|
15493
15493
|
return {
|
|
@@ -15531,10 +15531,10 @@ function validateApiRequestBase64FileHelpers({ body, bodyType, context, supports
|
|
|
15531
15531
|
}
|
|
15532
15532
|
}
|
|
15533
15533
|
var apiAgentRequestFileEncodingSchema = z21.object({
|
|
15534
|
-
sourceInput: z21.string().trim().min(1, "File input is required.").refine((
|
|
15534
|
+
sourceInput: z21.string().trim().min(1, "File input is required.").refine((path23) => parseApiRequestFilePath(path23) !== void 0, {
|
|
15535
15535
|
message: "File input must use an object property path."
|
|
15536
15536
|
}).describe("API Agent input containing the file reference to encode."),
|
|
15537
|
-
destinationPath: z21.string().trim().min(1, "Request field is required.").refine((
|
|
15537
|
+
destinationPath: z21.string().trim().min(1, "Request field is required.").refine((path23) => parseApiRequestFilePath(path23) !== void 0, {
|
|
15538
15538
|
message: "Request field must use an object property path."
|
|
15539
15539
|
}).describe("JSON request body path where the encoded value is inserted."),
|
|
15540
15540
|
encoding: z21.literal("base64").describe("Encoding applied to the source file before insertion.")
|
|
@@ -15894,30 +15894,30 @@ function hasControlCharacter(value) {
|
|
|
15894
15894
|
}
|
|
15895
15895
|
return false;
|
|
15896
15896
|
}
|
|
15897
|
-
function isNormalizedRepoPath(
|
|
15898
|
-
if (
|
|
15897
|
+
function isNormalizedRepoPath(path23) {
|
|
15898
|
+
if (path23 === "/") {
|
|
15899
15899
|
return true;
|
|
15900
15900
|
}
|
|
15901
|
-
if (
|
|
15901
|
+
if (path23.length === 0 || path23.startsWith("/") || path23.startsWith("\\") || path23.includes("\\") || hasControlCharacter(path23) || windowsAbsolutePathPattern.test(path23)) {
|
|
15902
15902
|
return false;
|
|
15903
15903
|
}
|
|
15904
|
-
return
|
|
15904
|
+
return path23.split("/").every((segment) => segment.length > 0 && segment !== "." && segment !== ".." && segment !== ".git");
|
|
15905
15905
|
}
|
|
15906
|
-
function normalizeRepoPath(
|
|
15907
|
-
if (
|
|
15908
|
-
return
|
|
15906
|
+
function normalizeRepoPath(path23) {
|
|
15907
|
+
if (path23 === "/") {
|
|
15908
|
+
return path23;
|
|
15909
15909
|
}
|
|
15910
|
-
return
|
|
15910
|
+
return path23.replaceAll(/\/+$/gu, "");
|
|
15911
15911
|
}
|
|
15912
15912
|
var skillPathPattern = /^(?:skills\/.+|automations\/[^/]+\/skills\/.+|automations\/[^/]+\/agents\/[^/]+\/skills\/.+)$/u;
|
|
15913
15913
|
var skillRootPathPattern = /^(?:skills\/[^/]+|automations\/[^/]+\/skills\/[^/]+|automations\/[^/]+\/agents\/[^/]+\/skills\/[^/]+)$/u;
|
|
15914
15914
|
var repoPathSchema = z28.string().min(1).transform(normalizeRepoPath).refine(isNormalizedRepoPath, {
|
|
15915
15915
|
message: "Path must be a normalized repository-relative path."
|
|
15916
15916
|
});
|
|
15917
|
-
var registeredSkillPathSchema = repoPathSchema.refine((
|
|
15917
|
+
var registeredSkillPathSchema = repoPathSchema.refine((path23) => skillPathPattern.test(path23), {
|
|
15918
15918
|
message: "Skill paths must be under root, automation, or automation-agent skills."
|
|
15919
15919
|
});
|
|
15920
|
-
var registeredSkillRootPathSchema = registeredSkillPathSchema.refine((
|
|
15920
|
+
var registeredSkillRootPathSchema = registeredSkillPathSchema.refine((path23) => skillRootPathPattern.test(path23) && !path23.endsWith("/SKILL.md"), {
|
|
15921
15921
|
message: "Registered skill paths must identify a skill root directory."
|
|
15922
15922
|
});
|
|
15923
15923
|
var knowledgeBasePluginPermissionSchema = z28.object({
|
|
@@ -16354,6 +16354,364 @@ var automationRunStartConfigSchema = automationRunConfigBaseSchema.omit({
|
|
|
16354
16354
|
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.")
|
|
16355
16355
|
});
|
|
16356
16356
|
|
|
16357
|
+
// ../common/dist/src/zod-schemas/verification-records/verification-record-enums.schema.js
|
|
16358
|
+
import { z as z31 } from "zod";
|
|
16359
|
+
var verificationCheckKindSchema = z31.enum([
|
|
16360
|
+
"automated_check",
|
|
16361
|
+
"human_review"
|
|
16362
|
+
]);
|
|
16363
|
+
var verificationBatchKindSchema = z31.enum(["automated_batch"]);
|
|
16364
|
+
var automatedVerificationRecordKindSchema = z31.enum([
|
|
16365
|
+
"automated_check",
|
|
16366
|
+
"automated_batch"
|
|
16367
|
+
]);
|
|
16368
|
+
var verificationRecordStatusSchema = z31.enum([
|
|
16369
|
+
"started",
|
|
16370
|
+
"completed",
|
|
16371
|
+
"failed"
|
|
16372
|
+
]);
|
|
16373
|
+
var verificationFailureCodeSchema = z31.enum([
|
|
16374
|
+
"credential",
|
|
16375
|
+
"fetch_incomplete",
|
|
16376
|
+
"run_not_judgeable",
|
|
16377
|
+
"answer_invalid",
|
|
16378
|
+
"answer_missing",
|
|
16379
|
+
"worker_lost",
|
|
16380
|
+
"sampling_failed",
|
|
16381
|
+
"grouping_failed",
|
|
16382
|
+
"reporting_failed",
|
|
16383
|
+
"agent_error",
|
|
16384
|
+
"other"
|
|
16385
|
+
]);
|
|
16386
|
+
var verificationVerdictSchema = z31.enum([
|
|
16387
|
+
"verified",
|
|
16388
|
+
"issues_found",
|
|
16389
|
+
"unverifiable_only",
|
|
16390
|
+
"partial_clean",
|
|
16391
|
+
"partial_issues_found",
|
|
16392
|
+
"partial_unverifiable"
|
|
16393
|
+
]);
|
|
16394
|
+
var verificationRunCompletionSchema = z31.enum([
|
|
16395
|
+
"complete",
|
|
16396
|
+
"incomplete"
|
|
16397
|
+
]);
|
|
16398
|
+
var verificationAccuracyEligibilitySchema = z31.enum([
|
|
16399
|
+
"included",
|
|
16400
|
+
"excluded",
|
|
16401
|
+
"unresolved"
|
|
16402
|
+
]);
|
|
16403
|
+
var principalTypeSchema = z31.enum([
|
|
16404
|
+
"otto",
|
|
16405
|
+
"session",
|
|
16406
|
+
"workos-oauth",
|
|
16407
|
+
"workos-user-api-key"
|
|
16408
|
+
]);
|
|
16409
|
+
|
|
16410
|
+
// ../common/dist/src/zod-schemas/verification-records/verification-record.schema.js
|
|
16411
|
+
import { z as z32 } from "zod";
|
|
16412
|
+
var VERIFICATION_RECORD_SCHEMA_VERSION = 1;
|
|
16413
|
+
var VERIFICATION_RECORD_UPLOAD_MAX_ITEMS = 50;
|
|
16414
|
+
var safeCountSchema = z32.number().int().min(0).max(Number.MAX_SAFE_INTEGER);
|
|
16415
|
+
var nullableCountSchema = safeCountSchema.nullable();
|
|
16416
|
+
var utcDateTimeSchema = z32.iso.datetime({ offset: false });
|
|
16417
|
+
function uniqueStringArraySchema(elementSchema) {
|
|
16418
|
+
return z32.array(elementSchema).refine((items) => new Set(items).size === items.length, {
|
|
16419
|
+
message: "Array items must be unique."
|
|
16420
|
+
});
|
|
16421
|
+
}
|
|
16422
|
+
var phaseNameSchema = z32.enum([
|
|
16423
|
+
"sampling",
|
|
16424
|
+
"shared_preparation",
|
|
16425
|
+
"preparation",
|
|
16426
|
+
"review",
|
|
16427
|
+
"checks",
|
|
16428
|
+
"combining",
|
|
16429
|
+
"grouping",
|
|
16430
|
+
"reporting"
|
|
16431
|
+
]);
|
|
16432
|
+
var measuredPhaseSplitSchema = z32.strictObject({
|
|
16433
|
+
model_ms: safeCountSchema,
|
|
16434
|
+
tool_ms: safeCountSchema,
|
|
16435
|
+
idle_ms: safeCountSchema,
|
|
16436
|
+
tool_calls: safeCountSchema
|
|
16437
|
+
});
|
|
16438
|
+
var unavailablePhaseSplitSchema = z32.strictObject({
|
|
16439
|
+
model_ms: z32.null(),
|
|
16440
|
+
tool_ms: z32.null(),
|
|
16441
|
+
idle_ms: z32.null(),
|
|
16442
|
+
tool_calls: z32.null()
|
|
16443
|
+
});
|
|
16444
|
+
var phaseBaseShape = {
|
|
16445
|
+
name: phaseNameSchema,
|
|
16446
|
+
started_at: utcDateTimeSchema.nullable(),
|
|
16447
|
+
ended_at: utcDateTimeSchema.nullable(),
|
|
16448
|
+
ms: nullableCountSchema,
|
|
16449
|
+
after_finish: z32.boolean()
|
|
16450
|
+
};
|
|
16451
|
+
var verificationPhaseSchema = z32.union([
|
|
16452
|
+
z32.strictObject({
|
|
16453
|
+
...phaseBaseShape,
|
|
16454
|
+
ms: safeCountSchema,
|
|
16455
|
+
...measuredPhaseSplitSchema.shape
|
|
16456
|
+
}),
|
|
16457
|
+
z32.strictObject({ ...phaseBaseShape, ...unavailablePhaseSplitSchema.shape })
|
|
16458
|
+
]);
|
|
16459
|
+
var verificationTimingSchema = z32.strictObject({
|
|
16460
|
+
started_at: utcDateTimeSchema,
|
|
16461
|
+
finished_at: utcDateTimeSchema.nullable(),
|
|
16462
|
+
elapsed_ms: nullableCountSchema,
|
|
16463
|
+
phases: z32.array(verificationPhaseSchema),
|
|
16464
|
+
flags: uniqueStringArraySchema(z32.enum(["mark_missing", "finished_by_coordinator", "idle_gap"])),
|
|
16465
|
+
preparation_detail_ms: z32.record(z32.string(), safeCountSchema).nullable()
|
|
16466
|
+
});
|
|
16467
|
+
var verificationRuntimeSchema = z32.strictObject({
|
|
16468
|
+
harness: z32.enum(["claude-code", "codex", "unsupported"]),
|
|
16469
|
+
configured_model: z32.string().nullable(),
|
|
16470
|
+
session_id: z32.string().nullable(),
|
|
16471
|
+
agent_id: z32.string().nullable(),
|
|
16472
|
+
invocation: z32.enum(["interactive", "scheduled", "worker", "unknown"]),
|
|
16473
|
+
scheduled_task_id: z32.string().nullable(),
|
|
16474
|
+
auth_mode: z32.enum(["saved_login", "api_key", "unknown"]),
|
|
16475
|
+
credential_ref: z32.string().nullable()
|
|
16476
|
+
});
|
|
16477
|
+
var nativeUsageSchema = z32.strictObject({
|
|
16478
|
+
cache_creation_input_tokens: safeCountSchema.optional(),
|
|
16479
|
+
cache_creation: z32.strictObject({
|
|
16480
|
+
ephemeral_5m_input_tokens: safeCountSchema.optional(),
|
|
16481
|
+
ephemeral_1h_input_tokens: safeCountSchema.optional()
|
|
16482
|
+
}).optional(),
|
|
16483
|
+
cache_write_input_tokens: safeCountSchema.optional(),
|
|
16484
|
+
service_tier: z32.string().nullable().optional()
|
|
16485
|
+
}).nullable();
|
|
16486
|
+
var verificationUsageEntrySchema = z32.strictObject({
|
|
16487
|
+
phase: phaseNameSchema,
|
|
16488
|
+
model: z32.string().nullable(),
|
|
16489
|
+
inputTokens: nullableCountSchema,
|
|
16490
|
+
outputTokens: nullableCountSchema,
|
|
16491
|
+
cachedInputTokens: nullableCountSchema,
|
|
16492
|
+
reasoningTokens: nullableCountSchema.optional(),
|
|
16493
|
+
totalTokens: nullableCountSchema,
|
|
16494
|
+
native: nativeUsageSchema,
|
|
16495
|
+
note: z32.string().max(64).regex(/^[\d_a-z]+$/u).nullable()
|
|
16496
|
+
});
|
|
16497
|
+
var verificationFailureSchema = z32.strictObject({
|
|
16498
|
+
phase: z32.enum([...phaseNameSchema.options, "unknown"]),
|
|
16499
|
+
code: z32.string(),
|
|
16500
|
+
message: z32.string().max(200)
|
|
16501
|
+
}).nullable();
|
|
16502
|
+
var linearIssueRefSchema = z32.strictObject({
|
|
16503
|
+
id: z32.string().min(1),
|
|
16504
|
+
identifier: z32.string().min(1),
|
|
16505
|
+
url: z32.string().min(1),
|
|
16506
|
+
action: z32.enum(["created", "bumped", "reopened"]),
|
|
16507
|
+
fingerprint: z32.string().nullable()
|
|
16508
|
+
});
|
|
16509
|
+
var coverageSchema = z32.strictObject({
|
|
16510
|
+
critical_steps: z32.strictObject({
|
|
16511
|
+
checked: nullableCountSchema,
|
|
16512
|
+
identified: nullableCountSchema,
|
|
16513
|
+
identified_is_lower_bound: z32.boolean().nullable()
|
|
16514
|
+
}),
|
|
16515
|
+
screenshots: z32.strictObject({
|
|
16516
|
+
reviewed: nullableCountSchema,
|
|
16517
|
+
inventory: nullableCountSchema,
|
|
16518
|
+
blank: nullableCountSchema,
|
|
16519
|
+
unavailable: nullableCountSchema
|
|
16520
|
+
}),
|
|
16521
|
+
instructions: z32.strictObject({
|
|
16522
|
+
read: nullableCountSchema,
|
|
16523
|
+
agent_runs: nullableCountSchema
|
|
16524
|
+
}),
|
|
16525
|
+
unsupported_outcomes: nullableCountSchema
|
|
16526
|
+
}).nullable();
|
|
16527
|
+
var trackingSchema = z32.strictObject({
|
|
16528
|
+
destination: z32.enum(["linear", "none"]),
|
|
16529
|
+
mode: z32.enum(["off", "dry-run", "live"]),
|
|
16530
|
+
status: z32.enum([
|
|
16531
|
+
"not-configured",
|
|
16532
|
+
"disabled",
|
|
16533
|
+
"previewed",
|
|
16534
|
+
"applied",
|
|
16535
|
+
"blocked",
|
|
16536
|
+
"partial"
|
|
16537
|
+
]),
|
|
16538
|
+
project_id: z32.string().nullable(),
|
|
16539
|
+
findings_in: nullableCountSchema,
|
|
16540
|
+
groups_out: nullableCountSchema,
|
|
16541
|
+
failures: z32.array(z32.strictObject({
|
|
16542
|
+
code: z32.string().min(1).max(64).regex(/^[\d_a-z]+$/u),
|
|
16543
|
+
message: z32.string().max(200),
|
|
16544
|
+
action: z32.string().max(64).nullable(),
|
|
16545
|
+
issue_refs: uniqueStringArraySchema(z32.string().min(1))
|
|
16546
|
+
}))
|
|
16547
|
+
}).nullable();
|
|
16548
|
+
var reportingSchema = z32.strictObject({
|
|
16549
|
+
surface: z32.enum(["markdown", "slack", "linear", "none", "unknown"]),
|
|
16550
|
+
delivered: z32.boolean().nullable(),
|
|
16551
|
+
permalink: z32.string().nullable()
|
|
16552
|
+
}).nullable();
|
|
16553
|
+
var recordBaseShape = {
|
|
16554
|
+
schema_version: z32.literal(VERIFICATION_RECORD_SCHEMA_VERSION),
|
|
16555
|
+
idempotency_key: z32.uuid(),
|
|
16556
|
+
organization_id: z32.string().min(1),
|
|
16557
|
+
deployment: z32.enum(["us", "uk", "stg"]),
|
|
16558
|
+
runtime: verificationRuntimeSchema,
|
|
16559
|
+
timing: verificationTimingSchema,
|
|
16560
|
+
usage: z32.array(verificationUsageEntrySchema),
|
|
16561
|
+
linear_issue_refs: z32.array(linearIssueRefSchema),
|
|
16562
|
+
revision: z32.number().int().min(1)
|
|
16563
|
+
};
|
|
16564
|
+
var checkShape = {
|
|
16565
|
+
...recordBaseShape,
|
|
16566
|
+
kind: z32.literal(verificationCheckKindSchema.enum.automated_check),
|
|
16567
|
+
automation_id: z32.string().nullable(),
|
|
16568
|
+
batch_id: z32.uuid().nullable(),
|
|
16569
|
+
run_id: z32.uuid(),
|
|
16570
|
+
work_item_id: z32.string().nullable(),
|
|
16571
|
+
coverage: coverageSchema,
|
|
16572
|
+
tracking: trackingSchema,
|
|
16573
|
+
reporting: reportingSchema
|
|
16574
|
+
};
|
|
16575
|
+
var automatedCheckRecordSchema = z32.discriminatedUnion("status", [
|
|
16576
|
+
z32.strictObject({
|
|
16577
|
+
...checkShape,
|
|
16578
|
+
status: z32.literal(verificationRecordStatusSchema.enum.started),
|
|
16579
|
+
failure: z32.null(),
|
|
16580
|
+
output: z32.null(),
|
|
16581
|
+
output_valid: z32.null()
|
|
16582
|
+
}),
|
|
16583
|
+
z32.strictObject({
|
|
16584
|
+
...checkShape,
|
|
16585
|
+
status: z32.literal(verificationRecordStatusSchema.enum.completed),
|
|
16586
|
+
failure: z32.null(),
|
|
16587
|
+
output: z32.json().refine((output) => output !== null),
|
|
16588
|
+
output_valid: z32.literal(true)
|
|
16589
|
+
}),
|
|
16590
|
+
z32.strictObject({
|
|
16591
|
+
...checkShape,
|
|
16592
|
+
status: z32.literal(verificationRecordStatusSchema.enum.failed),
|
|
16593
|
+
failure: verificationFailureSchema.unwrap(),
|
|
16594
|
+
output: z32.json(),
|
|
16595
|
+
output_valid: z32.boolean().nullable()
|
|
16596
|
+
}).superRefine((record, context) => {
|
|
16597
|
+
const answerInvalid = record.failure.code === "answer_invalid";
|
|
16598
|
+
const knownFailureCode = verificationFailureCodeSchema.safeParse(record.failure.code).success;
|
|
16599
|
+
if (answerInvalid && record.output_valid !== false) {
|
|
16600
|
+
context.addIssue({
|
|
16601
|
+
code: "custom",
|
|
16602
|
+
path: ["output_valid"],
|
|
16603
|
+
message: "Invalid answers require output_valid false."
|
|
16604
|
+
});
|
|
16605
|
+
}
|
|
16606
|
+
if (knownFailureCode && !answerInvalid && (record.output !== null || record.output_valid !== null)) {
|
|
16607
|
+
context.addIssue({
|
|
16608
|
+
code: "custom",
|
|
16609
|
+
path: ["output"],
|
|
16610
|
+
message: "Non-answer failures cannot include output."
|
|
16611
|
+
});
|
|
16612
|
+
}
|
|
16613
|
+
})
|
|
16614
|
+
]).superRefine((record, context) => {
|
|
16615
|
+
const isStarted = record.status === "started";
|
|
16616
|
+
const hasStartedTiming = record.timing.finished_at === null && record.timing.elapsed_ms === null;
|
|
16617
|
+
const hasTerminalTiming = record.timing.finished_at !== null && record.timing.elapsed_ms !== null;
|
|
16618
|
+
if (isStarted ? !hasStartedTiming : !hasTerminalTiming) {
|
|
16619
|
+
context.addIssue({
|
|
16620
|
+
code: "custom",
|
|
16621
|
+
path: ["timing"],
|
|
16622
|
+
message: "Started records require unfinished timing; terminal records require finished timing."
|
|
16623
|
+
});
|
|
16624
|
+
}
|
|
16625
|
+
if (record.batch_id !== null && (record.tracking !== null || record.reporting !== null)) {
|
|
16626
|
+
context.addIssue({
|
|
16627
|
+
code: "custom",
|
|
16628
|
+
path: ["batch_id"],
|
|
16629
|
+
message: "Batch children cannot include tracking or reporting results."
|
|
16630
|
+
});
|
|
16631
|
+
}
|
|
16632
|
+
});
|
|
16633
|
+
var batchShape = {
|
|
16634
|
+
...recordBaseShape,
|
|
16635
|
+
kind: z32.literal(verificationBatchKindSchema.enum.automated_batch),
|
|
16636
|
+
automation_id: z32.string().min(1),
|
|
16637
|
+
scope: z32.strictObject({
|
|
16638
|
+
from: utcDateTimeSchema,
|
|
16639
|
+
to: utcDateTimeSchema,
|
|
16640
|
+
filters: z32.strictObject({
|
|
16641
|
+
status: uniqueStringArraySchema(z32.string().min(1)),
|
|
16642
|
+
invocation_type: uniqueStringArraySchema(z32.string().min(1))
|
|
16643
|
+
}),
|
|
16644
|
+
phrasing: z32.string().nullable()
|
|
16645
|
+
}),
|
|
16646
|
+
sampling: z32.strictObject({
|
|
16647
|
+
requested: z32.string().min(1),
|
|
16648
|
+
method: z32.enum(["random", "all", "explicit", "unknown"]),
|
|
16649
|
+
pool: z32.strictObject({
|
|
16650
|
+
total: nullableCountSchema,
|
|
16651
|
+
published_total: nullableCountSchema,
|
|
16652
|
+
paused: nullableCountSchema,
|
|
16653
|
+
active: nullableCountSchema,
|
|
16654
|
+
truncated: z32.boolean().nullable()
|
|
16655
|
+
}),
|
|
16656
|
+
selected: nullableCountSchema,
|
|
16657
|
+
target: nullableCountSchema,
|
|
16658
|
+
note: z32.string().nullable()
|
|
16659
|
+
}).nullable(),
|
|
16660
|
+
checks: z32.array(z32.strictObject({
|
|
16661
|
+
run_id: z32.string().min(1),
|
|
16662
|
+
check_keys: uniqueStringArraySchema(z32.uuid())
|
|
16663
|
+
})).nullable(),
|
|
16664
|
+
summary: z32.strictObject({
|
|
16665
|
+
analyzed: nullableCountSchema,
|
|
16666
|
+
eligible: nullableCountSchema,
|
|
16667
|
+
verified: nullableCountSchema,
|
|
16668
|
+
incomplete_by_category: z32.strictObject({
|
|
16669
|
+
platform: nullableCountSchema.optional(),
|
|
16670
|
+
agent: nullableCountSchema.optional(),
|
|
16671
|
+
instructed: nullableCountSchema.optional(),
|
|
16672
|
+
human: nullableCountSchema.optional(),
|
|
16673
|
+
expected: nullableCountSchema.optional(),
|
|
16674
|
+
unknown: nullableCountSchema.optional()
|
|
16675
|
+
}).nullable(),
|
|
16676
|
+
failed_checks: nullableCountSchema
|
|
16677
|
+
}).nullable(),
|
|
16678
|
+
tracking: trackingSchema,
|
|
16679
|
+
reporting: reportingSchema
|
|
16680
|
+
};
|
|
16681
|
+
var automatedBatchRecordSchema = z32.discriminatedUnion("status", [
|
|
16682
|
+
z32.strictObject({
|
|
16683
|
+
...batchShape,
|
|
16684
|
+
status: z32.literal(verificationRecordStatusSchema.enum.started),
|
|
16685
|
+
failure: z32.null()
|
|
16686
|
+
}),
|
|
16687
|
+
z32.strictObject({
|
|
16688
|
+
...batchShape,
|
|
16689
|
+
status: z32.literal(verificationRecordStatusSchema.enum.completed),
|
|
16690
|
+
failure: z32.null()
|
|
16691
|
+
}),
|
|
16692
|
+
z32.strictObject({
|
|
16693
|
+
...batchShape,
|
|
16694
|
+
status: z32.literal(verificationRecordStatusSchema.enum.failed),
|
|
16695
|
+
failure: verificationFailureSchema.unwrap()
|
|
16696
|
+
})
|
|
16697
|
+
]).superRefine((record, context) => {
|
|
16698
|
+
const isStarted = record.status === "started";
|
|
16699
|
+
const hasStartedTiming = record.timing.finished_at === null && record.timing.elapsed_ms === null;
|
|
16700
|
+
const hasTerminalTiming = record.timing.finished_at !== null && record.timing.elapsed_ms !== null;
|
|
16701
|
+
if (isStarted ? !hasStartedTiming : !hasTerminalTiming) {
|
|
16702
|
+
context.addIssue({
|
|
16703
|
+
code: "custom",
|
|
16704
|
+
path: ["timing"],
|
|
16705
|
+
message: "Started records require unfinished timing; terminal records require finished timing."
|
|
16706
|
+
});
|
|
16707
|
+
}
|
|
16708
|
+
});
|
|
16709
|
+
var verificationRecordSchema = z32.union([
|
|
16710
|
+
automatedCheckRecordSchema,
|
|
16711
|
+
automatedBatchRecordSchema
|
|
16712
|
+
]);
|
|
16713
|
+
var verificationRecordPayloadSchema = z32.custom((value) => verificationRecordSchema.safeParse(value).success, { message: "Invalid verification record payload." });
|
|
16714
|
+
|
|
16357
16715
|
// ../common/dist/src/utils/automation-run-evidence.util.js
|
|
16358
16716
|
var PORTAL_FILE_EXTENSIONS = [".csv", ".pdf"];
|
|
16359
16717
|
var MAX_SCAN_DEPTH = 8;
|
|
@@ -16570,13 +16928,13 @@ function getMentionedStandardCommand(instructions) {
|
|
|
16570
16928
|
const normalizedInstructions = instructions.toLowerCase();
|
|
16571
16929
|
return STANDARD_COMMAND_NAMES.find((commandName) => normalizedInstructions.includes(commandName.toLowerCase())) ?? null;
|
|
16572
16930
|
}
|
|
16573
|
-
function assertCustomInstructionsCommand({ commands, path:
|
|
16574
|
-
const customCommands = commands.flatMap((command, commandIndex) => command["commandName"] === "custom" ? [{ command, path: `${
|
|
16931
|
+
function assertCustomInstructionsCommand({ commands, path: path23 }) {
|
|
16932
|
+
const customCommands = commands.flatMap((command, commandIndex) => command["commandName"] === "custom" ? [{ command, path: `${path23}[${commandIndex.toString()}]` }] : []);
|
|
16575
16933
|
if (customCommands.length === 0) {
|
|
16576
16934
|
return;
|
|
16577
16935
|
}
|
|
16578
16936
|
if (customCommands.length > MAX_CUSTOM_COMMAND_COUNT) {
|
|
16579
|
-
throw createInvalidValueError(`${
|
|
16937
|
+
throw createInvalidValueError(`${path23} contains ${customCommands.length.toString()} custom commands. Use at most ${MAX_CUSTOM_COMMAND_COUNT.toString()} short custom commands per agent. Split policy, decision, outreach, and multi-step work into catalog commands or child agents instead.`);
|
|
16580
16938
|
}
|
|
16581
16939
|
for (const customCommand of customCommands) {
|
|
16582
16940
|
const instructions = getCustomInstructions(customCommand.command);
|
|
@@ -16634,7 +16992,7 @@ function encodeS3Crc32Checksum(checksum) {
|
|
|
16634
16992
|
}
|
|
16635
16993
|
|
|
16636
16994
|
// ../mcp-registry/src/operation-specs.ts
|
|
16637
|
-
import { z as
|
|
16995
|
+
import { z as z33 } from "zod";
|
|
16638
16996
|
|
|
16639
16997
|
// ../mcp-registry/src/operation-spec.ts
|
|
16640
16998
|
function stripLeadingGraphqlComments(document) {
|
|
@@ -16885,26 +17243,26 @@ function jsonOption({
|
|
|
16885
17243
|
valueType: "json"
|
|
16886
17244
|
};
|
|
16887
17245
|
}
|
|
16888
|
-
var jsonObjectSchema =
|
|
16889
|
-
var evalRunStatusSchema =
|
|
17246
|
+
var jsonObjectSchema = z33.record(z33.string(), z33.unknown());
|
|
17247
|
+
var evalRunStatusSchema = z33.enum([
|
|
16890
17248
|
"QUEUED",
|
|
16891
17249
|
"RUNNING",
|
|
16892
17250
|
"COMPLETE",
|
|
16893
17251
|
"FAILED",
|
|
16894
17252
|
"CANCELLED"
|
|
16895
17253
|
]);
|
|
16896
|
-
var evalInputChoicesSchema =
|
|
16897
|
-
|
|
16898
|
-
|
|
17254
|
+
var evalInputChoicesSchema = z33.record(
|
|
17255
|
+
z33.string(),
|
|
17256
|
+
z33.array(z33.unknown()).min(1)
|
|
16899
17257
|
);
|
|
16900
|
-
var registeredEvalRunInputSchema =
|
|
16901
|
-
description:
|
|
17258
|
+
var registeredEvalRunInputSchema = z33.object({
|
|
17259
|
+
description: z33.string().min(1).optional(),
|
|
16902
17260
|
input: evalInputChoicesSchema,
|
|
16903
|
-
maxConcurrency:
|
|
16904
|
-
name:
|
|
16905
|
-
repeatCount:
|
|
16906
|
-
slug:
|
|
16907
|
-
tags:
|
|
17261
|
+
maxConcurrency: z33.number().int().positive().default(1),
|
|
17262
|
+
name: z33.string().min(1).optional(),
|
|
17263
|
+
repeatCount: z33.number().int().positive().default(1),
|
|
17264
|
+
slug: z33.string().min(1),
|
|
17265
|
+
tags: z33.array(z33.string().min(1)).default([])
|
|
16908
17266
|
});
|
|
16909
17267
|
var registeredEvalSelection = ` slug
|
|
16910
17268
|
name
|
|
@@ -16958,7 +17316,7 @@ function isRecord3(value) {
|
|
|
16958
17316
|
function validateCustomInstructionsCommands({
|
|
16959
17317
|
commands,
|
|
16960
17318
|
ctx,
|
|
16961
|
-
path:
|
|
17319
|
+
path: path23
|
|
16962
17320
|
}) {
|
|
16963
17321
|
if (!Array.isArray(commands)) {
|
|
16964
17322
|
return;
|
|
@@ -16966,18 +17324,18 @@ function validateCustomInstructionsCommands({
|
|
|
16966
17324
|
const validationResult = fromThrowable(() => {
|
|
16967
17325
|
assertCustomInstructionsCommand({
|
|
16968
17326
|
commands: commands.map((command) => isRecord3(command) ? command : {}),
|
|
16969
|
-
path:
|
|
17327
|
+
path: path23.join(".").replaceAll(/\.(?<index>\d+)/gu, "[$<index>]")
|
|
16970
17328
|
});
|
|
16971
17329
|
}, "invalid-custom-instructions-command");
|
|
16972
17330
|
if (isErr(validationResult)) {
|
|
16973
17331
|
ctx.addIssue({
|
|
16974
17332
|
code: "custom",
|
|
16975
17333
|
message: `${getErrorMessage2(validationResult.error.cause)} Run mgcl catalog commands to find the standard command for this work.`,
|
|
16976
|
-
path:
|
|
17334
|
+
path: path23
|
|
16977
17335
|
});
|
|
16978
17336
|
}
|
|
16979
17337
|
}
|
|
16980
|
-
var automationPatchOperationsSchema =
|
|
17338
|
+
var automationPatchOperationsSchema = z33.array(z33.unknown()).min(1).superRefine((operations, ctx) => {
|
|
16981
17339
|
for (const [operationIndex, operation] of operations.entries()) {
|
|
16982
17340
|
if (!isRecord3(operation)) {
|
|
16983
17341
|
continue;
|
|
@@ -17023,10 +17381,10 @@ var updateAutomationInputSchema = automationInputSchema([
|
|
|
17023
17381
|
"newAgents",
|
|
17024
17382
|
"updatedAgents"
|
|
17025
17383
|
]);
|
|
17026
|
-
var runDraftNetworkTrafficCaptureInputSchema =
|
|
17027
|
-
record:
|
|
17028
|
-
recordMode:
|
|
17029
|
-
replay:
|
|
17384
|
+
var runDraftNetworkTrafficCaptureInputSchema = z33.object({
|
|
17385
|
+
record: z33.boolean().nullable().optional(),
|
|
17386
|
+
recordMode: z33.enum(NETWORK_TRAFFIC_CAPTURE_RECORD_MODES).nullable().optional(),
|
|
17387
|
+
replay: z33.object({ recordingId: z33.uuid() }).strict().nullable().optional()
|
|
17030
17388
|
}).strict().superRefine((value, ctx) => {
|
|
17031
17389
|
const hasRecord = value.record !== null && value.record !== void 0;
|
|
17032
17390
|
const hasRecordMode = value.recordMode !== null && value.recordMode !== void 0;
|
|
@@ -17125,6 +17483,10 @@ var apiKeyAccessPolicies = {
|
|
|
17125
17483
|
type: "denied",
|
|
17126
17484
|
reason: "Shared library operations do not have a public API-key permission."
|
|
17127
17485
|
},
|
|
17486
|
+
verificationRecordUploadDenied: {
|
|
17487
|
+
type: "denied",
|
|
17488
|
+
reason: "Verification-record uploads do not have a public API-key write permission."
|
|
17489
|
+
},
|
|
17128
17490
|
skillsRead: {
|
|
17129
17491
|
type: "allOf",
|
|
17130
17492
|
permissions: ["skills:read"]
|
|
@@ -17295,21 +17657,29 @@ var agentPluginsSelection = ` plugins {
|
|
|
17295
17657
|
canEdit
|
|
17296
17658
|
}
|
|
17297
17659
|
}`;
|
|
17298
|
-
var automationRunsInputSchema =
|
|
17299
|
-
automationId:
|
|
17300
|
-
|
|
17301
|
-
|
|
17302
|
-
|
|
17303
|
-
|
|
17304
|
-
|
|
17305
|
-
|
|
17306
|
-
|
|
17307
|
-
|
|
17308
|
-
|
|
17660
|
+
var automationRunsInputSchema = z33.object({
|
|
17661
|
+
automationId: z33.string().min(1).optional(),
|
|
17662
|
+
search: z33.string().refine((value) => !value.includes("\0"), {
|
|
17663
|
+
message: "Search cannot contain NUL characters."
|
|
17664
|
+
}).optional(),
|
|
17665
|
+
from: z33.string().min(1).optional(),
|
|
17666
|
+
status: z33.array(z33.string().min(1)).optional(),
|
|
17667
|
+
invocationType: z33.array(z33.string().min(1)).optional(),
|
|
17668
|
+
limit: z33.number().int().positive().optional(),
|
|
17669
|
+
orderBy: z33.enum(["createdAtAsc", "createdAtDesc", "random"]).optional(),
|
|
17670
|
+
page: z33.number().int().nonnegative().optional(),
|
|
17671
|
+
to: z33.string().min(1).optional(),
|
|
17672
|
+
workflowIds: z33.array(z33.string().min(1)).optional(),
|
|
17673
|
+
workItemId: z33.string().min(1).optional()
|
|
17309
17674
|
}).refine(({ orderBy, page }) => orderBy !== "random" || (page ?? 0) === 0, {
|
|
17310
17675
|
message: "Random ordering reshuffles on every call, so --page cannot be combined with --order-by random."
|
|
17311
17676
|
});
|
|
17312
17677
|
var automationRunsCliOptions = [
|
|
17678
|
+
stringOption({
|
|
17679
|
+
inputKey: "search",
|
|
17680
|
+
flagName: "search",
|
|
17681
|
+
description: "Case-insensitive substring search of run inputs, Data Store values, run IDs, and automation names. Outer whitespace is ignored; % and _ are SQL wildcards."
|
|
17682
|
+
}),
|
|
17313
17683
|
stringOption({
|
|
17314
17684
|
inputKey: "automationId",
|
|
17315
17685
|
flagName: "automation-id",
|
|
@@ -17362,11 +17732,170 @@ var automationRunsCliOptions = [
|
|
|
17362
17732
|
})
|
|
17363
17733
|
];
|
|
17364
17734
|
var operationSpecs = [
|
|
17735
|
+
createOperationSpec({
|
|
17736
|
+
operationName: "VerificationRecordUpload",
|
|
17737
|
+
apiKeyAccess: apiKeyAccessPolicies.verificationRecordUploadDenied,
|
|
17738
|
+
kind: "mutation",
|
|
17739
|
+
inputSchema: z33.object({
|
|
17740
|
+
records: z33.array(jsonObjectSchema).min(1).max(VERIFICATION_RECORD_UPLOAD_MAX_ITEMS)
|
|
17741
|
+
}),
|
|
17742
|
+
cli: {
|
|
17743
|
+
name: "upload-verification-records",
|
|
17744
|
+
path: ["verification-records", "upload"],
|
|
17745
|
+
description: `Upload one to ${VERIFICATION_RECORD_UPLOAD_MAX_ITEMS} verification records from JSON.`,
|
|
17746
|
+
resultKey: "verificationRecordUpload",
|
|
17747
|
+
options: [
|
|
17748
|
+
stringOption({
|
|
17749
|
+
clientOnly: true,
|
|
17750
|
+
description: "Path to a JSON array, or - to read stdin.",
|
|
17751
|
+
flagName: "input-file",
|
|
17752
|
+
inputKey: "inputFile",
|
|
17753
|
+
required: true
|
|
17754
|
+
})
|
|
17755
|
+
]
|
|
17756
|
+
},
|
|
17757
|
+
mcp: { exposed: false, fileName: "verificationRecordUpload.graphql" },
|
|
17758
|
+
scope: "organization",
|
|
17759
|
+
document: `# Upload verification records and return one result per input record
|
|
17760
|
+
mutation VerificationRecordUpload($records: [JSON!]!) {
|
|
17761
|
+
verificationRecordUpload(records: $records)
|
|
17762
|
+
}`
|
|
17763
|
+
}),
|
|
17764
|
+
createOperationSpec({
|
|
17765
|
+
operationName: "VerificationRecordGet",
|
|
17766
|
+
apiKeyAccess: apiKeyAccessPolicies.runRead,
|
|
17767
|
+
kind: "query",
|
|
17768
|
+
inputSchema: z33.object({
|
|
17769
|
+
id: z33.string().min(1),
|
|
17770
|
+
kind: z33.enum(["automated_check", "automated_batch"])
|
|
17771
|
+
}),
|
|
17772
|
+
cli: {
|
|
17773
|
+
name: "get-verification-record",
|
|
17774
|
+
path: ["verification-records", "get"],
|
|
17775
|
+
description: "Get one verification record by ID and kind.",
|
|
17776
|
+
resultKey: "verificationRecordGet",
|
|
17777
|
+
options: [
|
|
17778
|
+
stringOption({
|
|
17779
|
+
description: "Verification record ID.",
|
|
17780
|
+
flagName: "id",
|
|
17781
|
+
inputKey: "id",
|
|
17782
|
+
required: true
|
|
17783
|
+
}),
|
|
17784
|
+
stringOption({
|
|
17785
|
+
description: "Record kind: automated_check or automated_batch.",
|
|
17786
|
+
flagName: "kind",
|
|
17787
|
+
inputKey: "kind",
|
|
17788
|
+
required: true
|
|
17789
|
+
})
|
|
17790
|
+
]
|
|
17791
|
+
},
|
|
17792
|
+
mcp: { exposed: false, fileName: "verificationRecordGet.graphql" },
|
|
17793
|
+
scope: "organization",
|
|
17794
|
+
document: `# Get one verification record by its table-disambiguated identity
|
|
17795
|
+
query VerificationRecordGet($id: ID!, $kind: String!) {
|
|
17796
|
+
verificationRecordGet(id: $id, kind: $kind)
|
|
17797
|
+
}`
|
|
17798
|
+
}),
|
|
17799
|
+
createOperationSpec({
|
|
17800
|
+
operationName: "VerificationRecordList",
|
|
17801
|
+
apiKeyAccess: apiKeyAccessPolicies.runRead,
|
|
17802
|
+
kind: "query",
|
|
17803
|
+
inputSchema: z33.object({
|
|
17804
|
+
automationId: z33.string().min(1).optional(),
|
|
17805
|
+
automationRunId: z33.string().min(1).optional(),
|
|
17806
|
+
batchId: z33.string().min(1).optional(),
|
|
17807
|
+
subjectCheckId: z33.string().min(1).optional(),
|
|
17808
|
+
kind: z33.enum(["automated_check", "automated_batch"]).optional(),
|
|
17809
|
+
from: z33.string().min(1).optional(),
|
|
17810
|
+
to: z33.string().min(1).optional(),
|
|
17811
|
+
limit: z33.number().int().min(1).max(100).default(20),
|
|
17812
|
+
cursor: z33.string().min(1).optional()
|
|
17813
|
+
}),
|
|
17814
|
+
cli: {
|
|
17815
|
+
name: "list-verification-records",
|
|
17816
|
+
path: ["verification-records", "list"],
|
|
17817
|
+
description: "List verification records with filters and pagination.",
|
|
17818
|
+
resultKey: "verificationRecordList",
|
|
17819
|
+
options: [
|
|
17820
|
+
stringOption({
|
|
17821
|
+
description: "Filter by automation ID.",
|
|
17822
|
+
flagName: "automation-id",
|
|
17823
|
+
inputKey: "automationId"
|
|
17824
|
+
}),
|
|
17825
|
+
stringOption({
|
|
17826
|
+
description: "Filter by automation run ID.",
|
|
17827
|
+
flagName: "automation-run-id",
|
|
17828
|
+
inputKey: "automationRunId"
|
|
17829
|
+
}),
|
|
17830
|
+
stringOption({
|
|
17831
|
+
description: "Filter checks by parent batch record ID.",
|
|
17832
|
+
flagName: "batch-id",
|
|
17833
|
+
inputKey: "batchId"
|
|
17834
|
+
}),
|
|
17835
|
+
stringOption({
|
|
17836
|
+
description: "Reserved for future human reviews. Current automated records have no subject check and do not match this filter.",
|
|
17837
|
+
flagName: "subject-check-id",
|
|
17838
|
+
inputKey: "subjectCheckId"
|
|
17839
|
+
}),
|
|
17840
|
+
stringOption({
|
|
17841
|
+
description: "Record kind: automated_check or automated_batch.",
|
|
17842
|
+
flagName: "kind",
|
|
17843
|
+
inputKey: "kind"
|
|
17844
|
+
}),
|
|
17845
|
+
stringOption({
|
|
17846
|
+
description: "Inclusive started-at lower bound as an ISO timestamp.",
|
|
17847
|
+
flagName: "from",
|
|
17848
|
+
inputKey: "from"
|
|
17849
|
+
}),
|
|
17850
|
+
stringOption({
|
|
17851
|
+
description: "Inclusive started-at upper bound as an ISO timestamp.",
|
|
17852
|
+
flagName: "to",
|
|
17853
|
+
inputKey: "to"
|
|
17854
|
+
}),
|
|
17855
|
+
numberOption({
|
|
17856
|
+
description: "Maximum records to return. Defaults to 20; maximum 100.",
|
|
17857
|
+
flagName: "limit",
|
|
17858
|
+
inputKey: "limit"
|
|
17859
|
+
}),
|
|
17860
|
+
stringOption({
|
|
17861
|
+
description: "Opaque pagination cursor from a previous response.",
|
|
17862
|
+
flagName: "cursor",
|
|
17863
|
+
inputKey: "cursor"
|
|
17864
|
+
})
|
|
17865
|
+
]
|
|
17866
|
+
},
|
|
17867
|
+
mcp: { exposed: false, fileName: "verificationRecordList.graphql" },
|
|
17868
|
+
scope: "organization",
|
|
17869
|
+
document: `# List verification records with optional filters and cursor pagination
|
|
17870
|
+
query VerificationRecordList(
|
|
17871
|
+
$automationId: ID
|
|
17872
|
+
$automationRunId: ID
|
|
17873
|
+
$batchId: ID
|
|
17874
|
+
$subjectCheckId: ID
|
|
17875
|
+
$kind: String
|
|
17876
|
+
$from: String
|
|
17877
|
+
$to: String
|
|
17878
|
+
$limit: Int
|
|
17879
|
+
$cursor: String
|
|
17880
|
+
) {
|
|
17881
|
+
verificationRecordList(
|
|
17882
|
+
automationId: $automationId
|
|
17883
|
+
automationRunId: $automationRunId
|
|
17884
|
+
batchId: $batchId
|
|
17885
|
+
subjectCheckId: $subjectCheckId
|
|
17886
|
+
kind: $kind
|
|
17887
|
+
from: $from
|
|
17888
|
+
to: $to
|
|
17889
|
+
limit: $limit
|
|
17890
|
+
cursor: $cursor
|
|
17891
|
+
)
|
|
17892
|
+
}`
|
|
17893
|
+
}),
|
|
17365
17894
|
createOperationSpec({
|
|
17366
17895
|
operationName: "Classify",
|
|
17367
17896
|
apiKeyAccess: apiKeyAccessPolicies.baseline,
|
|
17368
17897
|
kind: "query",
|
|
17369
|
-
inputSchema:
|
|
17898
|
+
inputSchema: z33.object({ input: jsonObjectSchema }),
|
|
17370
17899
|
cli: {
|
|
17371
17900
|
name: "classify",
|
|
17372
17901
|
path: ["classify"],
|
|
@@ -17405,9 +17934,9 @@ query Classify($input: JSON!) {
|
|
|
17405
17934
|
operationName: "KnowledgeFiles",
|
|
17406
17935
|
apiKeyAccess: apiKeyAccessPolicies.knowledgeRead,
|
|
17407
17936
|
kind: "query",
|
|
17408
|
-
inputSchema:
|
|
17409
|
-
path:
|
|
17410
|
-
ref:
|
|
17937
|
+
inputSchema: z33.object({
|
|
17938
|
+
path: z33.string().min(1).optional(),
|
|
17939
|
+
ref: z33.string().min(1).optional()
|
|
17411
17940
|
}),
|
|
17412
17941
|
cli: {
|
|
17413
17942
|
name: "list-knowledge-files",
|
|
@@ -17450,10 +17979,10 @@ query KnowledgeFiles($path: String, $ref: String) {
|
|
|
17450
17979
|
operationName: "KnowledgeFileHistory",
|
|
17451
17980
|
apiKeyAccess: apiKeyAccessPolicies.knowledgeRead,
|
|
17452
17981
|
kind: "query",
|
|
17453
|
-
inputSchema:
|
|
17454
|
-
limit:
|
|
17455
|
-
path:
|
|
17456
|
-
ref:
|
|
17982
|
+
inputSchema: z33.object({
|
|
17983
|
+
limit: z33.number().int().positive().max(100).optional(),
|
|
17984
|
+
path: z33.string().min(1),
|
|
17985
|
+
ref: z33.string().min(1).optional()
|
|
17457
17986
|
}),
|
|
17458
17987
|
cli: {
|
|
17459
17988
|
name: "knowledge-file-history",
|
|
@@ -17497,7 +18026,7 @@ query KnowledgeFileHistory($path: String!, $ref: String, $limit: Int) {
|
|
|
17497
18026
|
operationName: "KnowledgeFile",
|
|
17498
18027
|
apiKeyAccess: apiKeyAccessPolicies.knowledgeRead,
|
|
17499
18028
|
kind: "query",
|
|
17500
|
-
inputSchema:
|
|
18029
|
+
inputSchema: z33.object({ key: z33.string().min(1) }),
|
|
17501
18030
|
cli: {
|
|
17502
18031
|
name: "read-knowledge-file",
|
|
17503
18032
|
path: ["knowledge", "read"],
|
|
@@ -17536,9 +18065,9 @@ query KnowledgeFile($key: String!) {
|
|
|
17536
18065
|
operationName: "MemoryFiles",
|
|
17537
18066
|
apiKeyAccess: apiKeyAccessPolicies.memoryRead,
|
|
17538
18067
|
kind: "query",
|
|
17539
|
-
inputSchema:
|
|
17540
|
-
path:
|
|
17541
|
-
ref:
|
|
18068
|
+
inputSchema: z33.object({
|
|
18069
|
+
path: z33.string().min(1).optional(),
|
|
18070
|
+
ref: z33.string().min(1).optional()
|
|
17542
18071
|
}),
|
|
17543
18072
|
cli: {
|
|
17544
18073
|
name: "list-memory-files",
|
|
@@ -17572,10 +18101,10 @@ query MemoryFiles($path: String, $ref: String) {
|
|
|
17572
18101
|
operationName: "MemoryFileHistory",
|
|
17573
18102
|
apiKeyAccess: apiKeyAccessPolicies.memoryRead,
|
|
17574
18103
|
kind: "query",
|
|
17575
|
-
inputSchema:
|
|
17576
|
-
limit:
|
|
17577
|
-
path:
|
|
17578
|
-
ref:
|
|
18104
|
+
inputSchema: z33.object({
|
|
18105
|
+
limit: z33.number().int().positive().max(100).optional(),
|
|
18106
|
+
path: z33.string().min(1),
|
|
18107
|
+
ref: z33.string().min(1).optional()
|
|
17579
18108
|
}),
|
|
17580
18109
|
cli: {
|
|
17581
18110
|
name: "memory-file-history",
|
|
@@ -17619,7 +18148,7 @@ query MemoryFileHistory($path: String!, $ref: String, $limit: Int) {
|
|
|
17619
18148
|
operationName: "MemoryFile",
|
|
17620
18149
|
apiKeyAccess: apiKeyAccessPolicies.memoryRead,
|
|
17621
18150
|
kind: "query",
|
|
17622
|
-
inputSchema:
|
|
18151
|
+
inputSchema: z33.object({ key: z33.string().min(1) }),
|
|
17623
18152
|
cli: {
|
|
17624
18153
|
name: "read-memory-file",
|
|
17625
18154
|
path: ["memories", "read"],
|
|
@@ -17658,11 +18187,11 @@ query MemoryFile($key: String!) {
|
|
|
17658
18187
|
operationName: "CreateFileUpload",
|
|
17659
18188
|
apiKeyAccess: apiKeyAccessPolicies.filesWrite,
|
|
17660
18189
|
kind: "mutation",
|
|
17661
|
-
inputSchema:
|
|
17662
|
-
checksum:
|
|
17663
|
-
mimeType:
|
|
17664
|
-
name:
|
|
17665
|
-
sizeBytes:
|
|
18190
|
+
inputSchema: z33.object({
|
|
18191
|
+
checksum: z33.string().min(1),
|
|
18192
|
+
mimeType: z33.string().min(1),
|
|
18193
|
+
name: z33.string().min(1),
|
|
18194
|
+
sizeBytes: z33.number().int().nonnegative()
|
|
17666
18195
|
}),
|
|
17667
18196
|
cli: {
|
|
17668
18197
|
name: "upload",
|
|
@@ -17693,9 +18222,9 @@ mutation CreateFileUpload($checksum: String!, $mimeType: String!, $name: String!
|
|
|
17693
18222
|
operationName: "GetCaptureContext",
|
|
17694
18223
|
apiKeyAccess: apiKeyAccessPolicies.captureRead,
|
|
17695
18224
|
kind: "query",
|
|
17696
|
-
inputSchema:
|
|
17697
|
-
automationId:
|
|
17698
|
-
recordingId:
|
|
18225
|
+
inputSchema: z33.object({
|
|
18226
|
+
automationId: z33.string().min(1).optional(),
|
|
18227
|
+
recordingId: z33.string().min(1).optional()
|
|
17699
18228
|
}).refine(
|
|
17700
18229
|
({ automationId, recordingId }) => [automationId, recordingId].some((value) => value !== void 0),
|
|
17701
18230
|
{ message: "Provide --automation-id or --recording-id." }
|
|
@@ -17737,10 +18266,10 @@ query GetCaptureContext($automationId: ID, $recordingId: ID) {
|
|
|
17737
18266
|
reason: "Agent transfer requires user login; shared library access has no API-key permission."
|
|
17738
18267
|
},
|
|
17739
18268
|
kind: "query",
|
|
17740
|
-
inputSchema:
|
|
17741
|
-
ids:
|
|
17742
|
-
libraryEntityId:
|
|
17743
|
-
automationVersionId:
|
|
18269
|
+
inputSchema: z33.object({
|
|
18270
|
+
ids: z33.array(z33.string().min(1)).min(1),
|
|
18271
|
+
libraryEntityId: z33.string().min(1).optional(),
|
|
18272
|
+
automationVersionId: z33.string().min(1).optional()
|
|
17744
18273
|
}).refine(
|
|
17745
18274
|
(input) => Boolean(input.libraryEntityId) !== Boolean(input.automationVersionId),
|
|
17746
18275
|
{
|
|
@@ -17783,10 +18312,10 @@ query GetCaptureContext($automationId: ID, $recordingId: ID) {
|
|
|
17783
18312
|
reason: "Agent transfer requires user login; shared library access has no API-key permission."
|
|
17784
18313
|
},
|
|
17785
18314
|
kind: "mutation",
|
|
17786
|
-
inputSchema:
|
|
17787
|
-
automationId:
|
|
17788
|
-
baseVersionId:
|
|
17789
|
-
data:
|
|
18315
|
+
inputSchema: z33.object({
|
|
18316
|
+
automationId: z33.string().min(1),
|
|
18317
|
+
baseVersionId: z33.string().min(1),
|
|
18318
|
+
data: z33.unknown().refine((value) => value !== void 0, {
|
|
17790
18319
|
message: "Agent export data is required."
|
|
17791
18320
|
})
|
|
17792
18321
|
}),
|
|
@@ -17826,9 +18355,9 @@ query GetCaptureContext($automationId: ID, $recordingId: ID) {
|
|
|
17826
18355
|
operationName: "LibraryAssetSearch",
|
|
17827
18356
|
apiKeyAccess: apiKeyAccessPolicies.libraryDenied,
|
|
17828
18357
|
kind: "query",
|
|
17829
|
-
inputSchema:
|
|
17830
|
-
query:
|
|
17831
|
-
limit:
|
|
18358
|
+
inputSchema: z33.object({
|
|
18359
|
+
query: z33.string().min(1).optional(),
|
|
18360
|
+
limit: z33.number().int().min(1).max(50).optional()
|
|
17832
18361
|
}),
|
|
17833
18362
|
cli: {
|
|
17834
18363
|
name: "library-asset-search",
|
|
@@ -17864,8 +18393,8 @@ query GetCaptureContext($automationId: ID, $recordingId: ID) {
|
|
|
17864
18393
|
operationName: "LibraryAssetWorkbench",
|
|
17865
18394
|
apiKeyAccess: apiKeyAccessPolicies.libraryDenied,
|
|
17866
18395
|
kind: "query",
|
|
17867
|
-
inputSchema:
|
|
17868
|
-
libraryEntityId:
|
|
18396
|
+
inputSchema: z33.object({
|
|
18397
|
+
libraryEntityId: z33.string().min(1)
|
|
17869
18398
|
}),
|
|
17870
18399
|
cli: {
|
|
17871
18400
|
name: "library-asset-get",
|
|
@@ -17892,8 +18421,8 @@ query GetCaptureContext($automationId: ID, $recordingId: ID) {
|
|
|
17892
18421
|
operationName: "CreateLibraryAsset",
|
|
17893
18422
|
apiKeyAccess: apiKeyAccessPolicies.libraryDenied,
|
|
17894
18423
|
kind: "mutation",
|
|
17895
|
-
inputSchema:
|
|
17896
|
-
assetName:
|
|
18424
|
+
inputSchema: z33.object({
|
|
18425
|
+
assetName: z33.string().trim().min(1).optional()
|
|
17897
18426
|
}),
|
|
17898
18427
|
cli: {
|
|
17899
18428
|
name: "create-library-asset",
|
|
@@ -17919,11 +18448,11 @@ query GetCaptureContext($automationId: ID, $recordingId: ID) {
|
|
|
17919
18448
|
operationName: "ConvertAutomationSubtreeToLibraryAsset",
|
|
17920
18449
|
apiKeyAccess: apiKeyAccessPolicies.libraryDenied,
|
|
17921
18450
|
kind: "mutation",
|
|
17922
|
-
inputSchema:
|
|
17923
|
-
draftAutomationId:
|
|
17924
|
-
rootAgentId:
|
|
17925
|
-
baseVersionId:
|
|
17926
|
-
assetName:
|
|
18451
|
+
inputSchema: z33.object({
|
|
18452
|
+
draftAutomationId: z33.string().min(1),
|
|
18453
|
+
rootAgentId: z33.string().min(1),
|
|
18454
|
+
baseVersionId: z33.string().min(1),
|
|
18455
|
+
assetName: z33.string().trim().min(1).optional()
|
|
17927
18456
|
}),
|
|
17928
18457
|
cli: {
|
|
17929
18458
|
name: "convert-to-library-asset",
|
|
@@ -17983,11 +18512,11 @@ query GetCaptureContext($automationId: ID, $recordingId: ID) {
|
|
|
17983
18512
|
operationName: "ImportLibraryAssetToAutomation",
|
|
17984
18513
|
apiKeyAccess: apiKeyAccessPolicies.libraryDenied,
|
|
17985
18514
|
kind: "mutation",
|
|
17986
|
-
inputSchema:
|
|
17987
|
-
draftAutomationId:
|
|
17988
|
-
libraryEntityId:
|
|
17989
|
-
baseVersionId:
|
|
17990
|
-
parentAgentId:
|
|
18515
|
+
inputSchema: z33.object({
|
|
18516
|
+
draftAutomationId: z33.string().min(1),
|
|
18517
|
+
libraryEntityId: z33.string().min(1),
|
|
18518
|
+
baseVersionId: z33.string().min(1),
|
|
18519
|
+
parentAgentId: z33.string().min(1).optional()
|
|
17991
18520
|
}),
|
|
17992
18521
|
cli: {
|
|
17993
18522
|
name: "import-library-asset",
|
|
@@ -18048,8 +18577,8 @@ query GetCaptureContext($automationId: ID, $recordingId: ID) {
|
|
|
18048
18577
|
operationName: "GetAgents",
|
|
18049
18578
|
apiKeyAccess: apiKeyAccessPolicies.automationRead,
|
|
18050
18579
|
kind: "query",
|
|
18051
|
-
inputSchema:
|
|
18052
|
-
ids:
|
|
18580
|
+
inputSchema: z33.object({
|
|
18581
|
+
ids: z33.array(z33.string().min(1)).min(1)
|
|
18053
18582
|
}),
|
|
18054
18583
|
cli: {
|
|
18055
18584
|
name: "get-agents",
|
|
@@ -18113,10 +18642,10 @@ ${agentPluginsSelection}
|
|
|
18113
18642
|
operationName: "GetAgentVersion",
|
|
18114
18643
|
apiKeyAccess: apiKeyAccessPolicies.automationRead,
|
|
18115
18644
|
kind: "query",
|
|
18116
|
-
inputSchema:
|
|
18117
|
-
draftAutomationId:
|
|
18118
|
-
agentId:
|
|
18119
|
-
versionId:
|
|
18645
|
+
inputSchema: z33.object({
|
|
18646
|
+
draftAutomationId: z33.string().min(1),
|
|
18647
|
+
agentId: z33.string().min(1),
|
|
18648
|
+
versionId: z33.string().min(1)
|
|
18120
18649
|
}),
|
|
18121
18650
|
cli: {
|
|
18122
18651
|
name: "get-agent-version",
|
|
@@ -18193,9 +18722,9 @@ ${agentPluginsSelection}
|
|
|
18193
18722
|
operationName: "GetAgentVersions",
|
|
18194
18723
|
apiKeyAccess: apiKeyAccessPolicies.automationRead,
|
|
18195
18724
|
kind: "query",
|
|
18196
|
-
inputSchema:
|
|
18197
|
-
draftAutomationId:
|
|
18198
|
-
agentId:
|
|
18725
|
+
inputSchema: z33.object({
|
|
18726
|
+
draftAutomationId: z33.string().min(1),
|
|
18727
|
+
agentId: z33.string().min(1)
|
|
18199
18728
|
}),
|
|
18200
18729
|
cli: {
|
|
18201
18730
|
name: "get-agent-versions",
|
|
@@ -18236,11 +18765,11 @@ query GetAgentVersions($draftAutomationId: ID!, $agentId: ID!) {
|
|
|
18236
18765
|
operationName: "DiffAgentVersion",
|
|
18237
18766
|
apiKeyAccess: apiKeyAccessPolicies.automationRead,
|
|
18238
18767
|
kind: "query",
|
|
18239
|
-
inputSchema:
|
|
18240
|
-
draftAutomationId:
|
|
18241
|
-
agentId:
|
|
18242
|
-
versionId:
|
|
18243
|
-
compareVersionId:
|
|
18768
|
+
inputSchema: z33.object({
|
|
18769
|
+
draftAutomationId: z33.string().min(1),
|
|
18770
|
+
agentId: z33.string().min(1),
|
|
18771
|
+
versionId: z33.string().min(1),
|
|
18772
|
+
compareVersionId: z33.string().min(1).optional()
|
|
18244
18773
|
}),
|
|
18245
18774
|
cli: {
|
|
18246
18775
|
name: "diff-agent-version",
|
|
@@ -18303,8 +18832,8 @@ query DiffAgentVersion(
|
|
|
18303
18832
|
operationName: "GetAgentRun",
|
|
18304
18833
|
apiKeyAccess: apiKeyAccessPolicies.runRead,
|
|
18305
18834
|
kind: "query",
|
|
18306
|
-
inputSchema:
|
|
18307
|
-
id:
|
|
18835
|
+
inputSchema: z33.object({
|
|
18836
|
+
id: z33.string().min(1)
|
|
18308
18837
|
}),
|
|
18309
18838
|
cli: {
|
|
18310
18839
|
name: "get-agent-run",
|
|
@@ -18342,8 +18871,8 @@ query GetAgentRun($id: ID!) {
|
|
|
18342
18871
|
operationName: "GetAutomationAgents",
|
|
18343
18872
|
apiKeyAccess: apiKeyAccessPolicies.automationRead,
|
|
18344
18873
|
kind: "query",
|
|
18345
|
-
inputSchema:
|
|
18346
|
-
ids:
|
|
18874
|
+
inputSchema: z33.object({
|
|
18875
|
+
ids: z33.array(z33.string().min(1)).min(1)
|
|
18347
18876
|
}),
|
|
18348
18877
|
cli: {
|
|
18349
18878
|
name: "get-automation-agents",
|
|
@@ -18387,9 +18916,9 @@ query GetAutomationAgents($ids: [ID!]!) {
|
|
|
18387
18916
|
operationName: "GetAutomationDiffFromPublished",
|
|
18388
18917
|
apiKeyAccess: apiKeyAccessPolicies.automationRead,
|
|
18389
18918
|
kind: "query",
|
|
18390
|
-
inputSchema:
|
|
18391
|
-
automationId:
|
|
18392
|
-
branchId:
|
|
18919
|
+
inputSchema: z33.object({
|
|
18920
|
+
automationId: z33.uuid("--automation-id must be a UUID."),
|
|
18921
|
+
branchId: z33.uuid("--branch-id must be a UUID.").optional()
|
|
18393
18922
|
}),
|
|
18394
18923
|
cli: {
|
|
18395
18924
|
branchContext: "optional",
|
|
@@ -18425,9 +18954,9 @@ query GetAutomationDiffFromPublished($automationId: ID!, $branchId: ID) {
|
|
|
18425
18954
|
operationName: "GetAutomationDiffVersions",
|
|
18426
18955
|
apiKeyAccess: apiKeyAccessPolicies.automationRead,
|
|
18427
18956
|
kind: "query",
|
|
18428
|
-
inputSchema:
|
|
18429
|
-
baseVersionId:
|
|
18430
|
-
targetVersionId:
|
|
18957
|
+
inputSchema: z33.object({
|
|
18958
|
+
baseVersionId: z33.string().min(1),
|
|
18959
|
+
targetVersionId: z33.string().min(1)
|
|
18431
18960
|
}),
|
|
18432
18961
|
cli: {
|
|
18433
18962
|
name: "get-automation-diff-versions",
|
|
@@ -18469,10 +18998,10 @@ query GetAutomationDiffVersions($baseVersionId: ID!, $targetVersionId: ID!) {
|
|
|
18469
18998
|
operationName: "GetAutomationVersionJson",
|
|
18470
18999
|
apiKeyAccess: apiKeyAccessPolicies.automationRead,
|
|
18471
19000
|
kind: "query",
|
|
18472
|
-
inputSchema:
|
|
18473
|
-
versionId:
|
|
18474
|
-
paths:
|
|
18475
|
-
format:
|
|
19001
|
+
inputSchema: z33.object({
|
|
19002
|
+
versionId: z33.string().min(1),
|
|
19003
|
+
paths: z33.array(z33.string().min(1)).optional(),
|
|
19004
|
+
format: z33.enum(["normalized", "full", "export"]).optional()
|
|
18476
19005
|
}),
|
|
18477
19006
|
cli: {
|
|
18478
19007
|
name: "get-automation-version-json",
|
|
@@ -18508,8 +19037,8 @@ query GetAutomationVersionJson($versionId: ID!, $paths: [String!], $format: Stri
|
|
|
18508
19037
|
operationName: "GetAutomationVersionJsonSkeleton",
|
|
18509
19038
|
apiKeyAccess: apiKeyAccessPolicies.automationRead,
|
|
18510
19039
|
kind: "query",
|
|
18511
|
-
inputSchema:
|
|
18512
|
-
versionId:
|
|
19040
|
+
inputSchema: z33.object({
|
|
19041
|
+
versionId: z33.string().min(1)
|
|
18513
19042
|
}),
|
|
18514
19043
|
cli: {
|
|
18515
19044
|
name: "get-automation-version-json-skeleton",
|
|
@@ -18535,8 +19064,8 @@ query GetAutomationVersionJsonSkeleton($versionId: ID!) {
|
|
|
18535
19064
|
operationName: "GetAutomationRun",
|
|
18536
19065
|
apiKeyAccess: apiKeyAccessPolicies.runStoreRead,
|
|
18537
19066
|
kind: "query",
|
|
18538
|
-
inputSchema:
|
|
18539
|
-
id:
|
|
19067
|
+
inputSchema: z33.object({
|
|
19068
|
+
id: z33.string().min(1)
|
|
18540
19069
|
}),
|
|
18541
19070
|
cli: {
|
|
18542
19071
|
name: "get-automation-run",
|
|
@@ -18581,8 +19110,8 @@ query GetAutomationRun($id: ID!) {
|
|
|
18581
19110
|
operationName: "GetAutomationRunAgentRuns",
|
|
18582
19111
|
apiKeyAccess: apiKeyAccessPolicies.runRead,
|
|
18583
19112
|
kind: "query",
|
|
18584
|
-
inputSchema:
|
|
18585
|
-
automationRunId:
|
|
19113
|
+
inputSchema: z33.object({
|
|
19114
|
+
automationRunId: z33.string().min(1)
|
|
18586
19115
|
}),
|
|
18587
19116
|
cli: {
|
|
18588
19117
|
name: "get-automation-run-agent-runs",
|
|
@@ -18620,12 +19149,12 @@ query GetAutomationRunAgentRuns($automationRunId: ID!) {
|
|
|
18620
19149
|
operationName: "GetAutomationRunIterations",
|
|
18621
19150
|
apiKeyAccess: apiKeyAccessPolicies.runStoreRead,
|
|
18622
19151
|
kind: "query",
|
|
18623
|
-
inputSchema:
|
|
18624
|
-
automationRunId:
|
|
18625
|
-
agentRunId:
|
|
18626
|
-
limit:
|
|
18627
|
-
page:
|
|
18628
|
-
reverse:
|
|
19152
|
+
inputSchema: z33.object({
|
|
19153
|
+
automationRunId: z33.string().min(1),
|
|
19154
|
+
agentRunId: z33.string().min(1).optional(),
|
|
19155
|
+
limit: z33.number().int().positive().optional(),
|
|
19156
|
+
page: z33.number().int().nonnegative().optional(),
|
|
19157
|
+
reverse: z33.boolean().optional()
|
|
18629
19158
|
}),
|
|
18630
19159
|
cli: {
|
|
18631
19160
|
name: "get-automation-run-iterations",
|
|
@@ -18704,8 +19233,8 @@ query GetAutomationRunIterations(
|
|
|
18704
19233
|
operationName: "GetFileAsset",
|
|
18705
19234
|
apiKeyAccess: apiKeyAccessPolicies.runRead,
|
|
18706
19235
|
kind: "query",
|
|
18707
|
-
inputSchema:
|
|
18708
|
-
key:
|
|
19236
|
+
inputSchema: z33.object({
|
|
19237
|
+
key: z33.string().min(1)
|
|
18709
19238
|
}),
|
|
18710
19239
|
cli: {
|
|
18711
19240
|
name: "get-file",
|
|
@@ -18746,9 +19275,9 @@ query GetFileAsset($key: String!) {
|
|
|
18746
19275
|
operationName: "GetIterationScreenshot",
|
|
18747
19276
|
apiKeyAccess: apiKeyAccessPolicies.runRead,
|
|
18748
19277
|
kind: "query",
|
|
18749
|
-
inputSchema:
|
|
18750
|
-
iterationId:
|
|
18751
|
-
hasMarks:
|
|
19278
|
+
inputSchema: z33.object({
|
|
19279
|
+
iterationId: z33.string().min(1),
|
|
19280
|
+
hasMarks: z33.boolean().default(false)
|
|
18752
19281
|
}),
|
|
18753
19282
|
cli: {
|
|
18754
19283
|
name: "get-iteration-screenshot",
|
|
@@ -18783,9 +19312,9 @@ query GetIterationScreenshot($iterationId: ID!, $hasMarks: Boolean = false) {
|
|
|
18783
19312
|
operationName: "GetIterationToolResultMedia",
|
|
18784
19313
|
apiKeyAccess: apiKeyAccessPolicies.runRead,
|
|
18785
19314
|
kind: "query",
|
|
18786
|
-
inputSchema:
|
|
18787
|
-
iterationId:
|
|
18788
|
-
mediaId:
|
|
19315
|
+
inputSchema: z33.object({
|
|
19316
|
+
iterationId: z33.uuid(),
|
|
19317
|
+
mediaId: z33.uuid()
|
|
18789
19318
|
}),
|
|
18790
19319
|
cli: {
|
|
18791
19320
|
name: "get-iteration-tool-result-media",
|
|
@@ -18832,8 +19361,8 @@ query GetIterationToolResultMedia($iterationId: ID!, $mediaId: ID!) {
|
|
|
18832
19361
|
operationName: "InspectPausedAutomationStep",
|
|
18833
19362
|
apiKeyAccess: apiKeyAccessPolicies.runRead,
|
|
18834
19363
|
kind: "query",
|
|
18835
|
-
inputSchema:
|
|
18836
|
-
runId:
|
|
19364
|
+
inputSchema: z33.object({
|
|
19365
|
+
runId: z33.string().min(1)
|
|
18837
19366
|
}),
|
|
18838
19367
|
cli: {
|
|
18839
19368
|
name: "inspect-paused-automation-step",
|
|
@@ -18896,6 +19425,7 @@ query InspectPausedAutomationStep($runId: ID!) {
|
|
|
18896
19425
|
document: `# Query automation run history with optional automation, workflow, and time-window filters
|
|
18897
19426
|
query GetAutomationRuns(
|
|
18898
19427
|
$automationId: ID
|
|
19428
|
+
$search: String
|
|
18899
19429
|
$from: String
|
|
18900
19430
|
$status: [RunStatus!]
|
|
18901
19431
|
$invocationType: [InvocationType!]
|
|
@@ -18908,6 +19438,7 @@ query GetAutomationRuns(
|
|
|
18908
19438
|
) {
|
|
18909
19439
|
automationRuns(
|
|
18910
19440
|
automationId: $automationId
|
|
19441
|
+
search: $search
|
|
18911
19442
|
from: $from
|
|
18912
19443
|
status: $status
|
|
18913
19444
|
invocationType: $invocationType
|
|
@@ -18950,6 +19481,7 @@ query GetAutomationRuns(
|
|
|
18950
19481
|
document: `# Query automation run history with optional filters and a bounded total
|
|
18951
19482
|
query GetAutomationRunsPage(
|
|
18952
19483
|
$automationId: ID
|
|
19484
|
+
$search: String
|
|
18953
19485
|
$from: String
|
|
18954
19486
|
$status: [RunStatus!]
|
|
18955
19487
|
$invocationType: [InvocationType!]
|
|
@@ -18962,6 +19494,7 @@ query GetAutomationRunsPage(
|
|
|
18962
19494
|
) {
|
|
18963
19495
|
automationRunsPage(
|
|
18964
19496
|
automationId: $automationId
|
|
19497
|
+
search: $search
|
|
18965
19498
|
from: $from
|
|
18966
19499
|
status: $status
|
|
18967
19500
|
invocationType: $invocationType
|
|
@@ -18991,6 +19524,7 @@ query GetAutomationRunsPage(
|
|
|
18991
19524
|
page
|
|
18992
19525
|
pageSize
|
|
18993
19526
|
isTotalTruncated
|
|
19527
|
+
hasMore
|
|
18994
19528
|
}
|
|
18995
19529
|
}`
|
|
18996
19530
|
}),
|
|
@@ -18998,8 +19532,8 @@ query GetAutomationRunsPage(
|
|
|
18998
19532
|
operationName: "GetWorkItem",
|
|
18999
19533
|
apiKeyAccess: apiKeyAccessPolicies.runRead,
|
|
19000
19534
|
kind: "query",
|
|
19001
|
-
inputSchema:
|
|
19002
|
-
id:
|
|
19535
|
+
inputSchema: z33.object({
|
|
19536
|
+
id: z33.string().min(1)
|
|
19003
19537
|
}),
|
|
19004
19538
|
cli: {
|
|
19005
19539
|
name: "get-work-item",
|
|
@@ -19036,12 +19570,12 @@ query GetWorkItem($id: ID!) {
|
|
|
19036
19570
|
operationName: "GetWorkItems",
|
|
19037
19571
|
apiKeyAccess: apiKeyAccessPolicies.runRead,
|
|
19038
19572
|
kind: "query",
|
|
19039
|
-
inputSchema:
|
|
19040
|
-
automationId:
|
|
19041
|
-
parentWorkItemId:
|
|
19042
|
-
status:
|
|
19043
|
-
limit:
|
|
19044
|
-
page:
|
|
19573
|
+
inputSchema: z33.object({
|
|
19574
|
+
automationId: z33.string().min(1).optional(),
|
|
19575
|
+
parentWorkItemId: z33.string().min(1).optional(),
|
|
19576
|
+
status: z33.array(z33.string().min(1)).optional(),
|
|
19577
|
+
limit: z33.number().int().positive().optional(),
|
|
19578
|
+
page: z33.number().int().nonnegative().optional()
|
|
19045
19579
|
}),
|
|
19046
19580
|
cli: {
|
|
19047
19581
|
name: "get-work-items",
|
|
@@ -19109,7 +19643,7 @@ query GetWorkItems(
|
|
|
19109
19643
|
operationName: "ListWorkflows",
|
|
19110
19644
|
apiKeyAccess: apiKeyAccessPolicies.automationRead,
|
|
19111
19645
|
kind: "query",
|
|
19112
|
-
inputSchema:
|
|
19646
|
+
inputSchema: z33.object({}),
|
|
19113
19647
|
cli: {
|
|
19114
19648
|
name: "list-workflows",
|
|
19115
19649
|
path: ["workflows", "list"],
|
|
@@ -19130,8 +19664,8 @@ query ListWorkflows {
|
|
|
19130
19664
|
operationName: "ListAutomations",
|
|
19131
19665
|
apiKeyAccess: apiKeyAccessPolicies.automationRead,
|
|
19132
19666
|
kind: "query",
|
|
19133
|
-
inputSchema:
|
|
19134
|
-
limit:
|
|
19667
|
+
inputSchema: z33.object({
|
|
19668
|
+
limit: z33.number().int().positive().optional(),
|
|
19135
19669
|
order: jsonObjectSchema.optional(),
|
|
19136
19670
|
where: jsonObjectSchema.optional()
|
|
19137
19671
|
}),
|
|
@@ -19187,8 +19721,8 @@ query ListAutomations(
|
|
|
19187
19721
|
operationName: "GetAutomations",
|
|
19188
19722
|
apiKeyAccess: apiKeyAccessPolicies.automationRead,
|
|
19189
19723
|
kind: "query",
|
|
19190
|
-
inputSchema:
|
|
19191
|
-
ids:
|
|
19724
|
+
inputSchema: z33.object({
|
|
19725
|
+
ids: z33.array(z33.string().min(1)).min(1)
|
|
19192
19726
|
}),
|
|
19193
19727
|
cli: {
|
|
19194
19728
|
name: "get-automations",
|
|
@@ -19241,8 +19775,8 @@ query GetAutomations($ids: [ID!]!) {
|
|
|
19241
19775
|
operationName: "ViewAutomationReview",
|
|
19242
19776
|
apiKeyAccess: apiKeyAccessPolicies.automationRead,
|
|
19243
19777
|
kind: "query",
|
|
19244
|
-
inputSchema:
|
|
19245
|
-
automationId:
|
|
19778
|
+
inputSchema: z33.object({
|
|
19779
|
+
automationId: z33.string().min(1)
|
|
19246
19780
|
}),
|
|
19247
19781
|
cli: {
|
|
19248
19782
|
name: "view-automation-review",
|
|
@@ -19277,8 +19811,8 @@ query ViewAutomationReview($automationId: ID!) {
|
|
|
19277
19811
|
operationName: "ListAutomationBranches",
|
|
19278
19812
|
apiKeyAccess: apiKeyAccessPolicies.automationRead,
|
|
19279
19813
|
kind: "query",
|
|
19280
|
-
inputSchema:
|
|
19281
|
-
automationId:
|
|
19814
|
+
inputSchema: z33.object({
|
|
19815
|
+
automationId: z33.uuid("--automation-id must be a UUID.")
|
|
19282
19816
|
}),
|
|
19283
19817
|
cli: {
|
|
19284
19818
|
name: "list-automation-branches",
|
|
@@ -19313,14 +19847,14 @@ query ListAutomationBranches($automationId: ID!) {
|
|
|
19313
19847
|
operationName: "CreateAutomationBranch",
|
|
19314
19848
|
apiKeyAccess: apiKeyAccessPolicies.automationWrite,
|
|
19315
19849
|
kind: "mutation",
|
|
19316
|
-
inputSchema:
|
|
19317
|
-
automationId:
|
|
19318
|
-
name:
|
|
19850
|
+
inputSchema: z33.object({
|
|
19851
|
+
automationId: z33.uuid("--automation-id must be a UUID."),
|
|
19852
|
+
name: z33.string().regex(AUTOMATION_BRANCH_NAME_PATTERN, AUTOMATION_BRANCH_NAME_MESSAGE).max(
|
|
19319
19853
|
AUTOMATION_BRANCH_NAME_MAX_LENGTH,
|
|
19320
19854
|
AUTOMATION_BRANCH_NAME_MAX_LENGTH_MESSAGE
|
|
19321
19855
|
),
|
|
19322
|
-
sourceBranchId:
|
|
19323
|
-
sourceVersionId:
|
|
19856
|
+
sourceBranchId: z33.uuid("--source-branch-id must be a UUID.").optional(),
|
|
19857
|
+
sourceVersionId: z33.uuid("--source-version-id must be a UUID.").optional()
|
|
19324
19858
|
}),
|
|
19325
19859
|
cli: {
|
|
19326
19860
|
name: "create-automation-branch",
|
|
@@ -19381,9 +19915,9 @@ mutation CreateAutomationBranch(
|
|
|
19381
19915
|
operationName: "GetAutomationBranch",
|
|
19382
19916
|
apiKeyAccess: apiKeyAccessPolicies.automationRead,
|
|
19383
19917
|
kind: "query",
|
|
19384
|
-
inputSchema:
|
|
19385
|
-
automationId:
|
|
19386
|
-
branchId:
|
|
19918
|
+
inputSchema: z33.object({
|
|
19919
|
+
automationId: z33.uuid("--automation-id must be a UUID."),
|
|
19920
|
+
branchId: z33.uuid("--branch-id must be a UUID.")
|
|
19387
19921
|
}),
|
|
19388
19922
|
cli: {
|
|
19389
19923
|
branchContext: "required",
|
|
@@ -19414,9 +19948,9 @@ query GetAutomationBranch($automationId: ID!, $branchId: ID!) {
|
|
|
19414
19948
|
operationName: "MergeAutomationBranch",
|
|
19415
19949
|
apiKeyAccess: apiKeyAccessPolicies.automationWrite,
|
|
19416
19950
|
kind: "mutation",
|
|
19417
|
-
inputSchema:
|
|
19418
|
-
automationId:
|
|
19419
|
-
branchId:
|
|
19951
|
+
inputSchema: z33.object({
|
|
19952
|
+
automationId: z33.uuid("--automation-id must be a UUID."),
|
|
19953
|
+
branchId: z33.uuid("--branch-id must be a UUID.")
|
|
19420
19954
|
}),
|
|
19421
19955
|
cli: {
|
|
19422
19956
|
branchContext: "required",
|
|
@@ -19491,9 +20025,9 @@ mutation MergeAutomationBranch($automationId: ID!, $branchId: ID!) {
|
|
|
19491
20025
|
operationName: "PreviewAutomationBranchMerge",
|
|
19492
20026
|
apiKeyAccess: apiKeyAccessPolicies.automationRead,
|
|
19493
20027
|
kind: "query",
|
|
19494
|
-
inputSchema:
|
|
19495
|
-
automationId:
|
|
19496
|
-
branchId:
|
|
20028
|
+
inputSchema: z33.object({
|
|
20029
|
+
automationId: z33.uuid("--automation-id must be a UUID."),
|
|
20030
|
+
branchId: z33.uuid("--branch-id must be a UUID.")
|
|
19497
20031
|
}),
|
|
19498
20032
|
cli: {
|
|
19499
20033
|
branchContext: "required",
|
|
@@ -19540,11 +20074,11 @@ query PreviewAutomationBranchMerge($automationId: ID!, $branchId: ID!) {
|
|
|
19540
20074
|
operationName: "DiscardAutomationBranchChanges",
|
|
19541
20075
|
apiKeyAccess: apiKeyAccessPolicies.automationWrite,
|
|
19542
20076
|
kind: "mutation",
|
|
19543
|
-
inputSchema:
|
|
19544
|
-
automationId:
|
|
19545
|
-
branchId:
|
|
19546
|
-
changeIds:
|
|
19547
|
-
|
|
20077
|
+
inputSchema: z33.object({
|
|
20078
|
+
automationId: z33.uuid("--automation-id must be a UUID."),
|
|
20079
|
+
branchId: z33.uuid("--branch-id must be a UUID."),
|
|
20080
|
+
changeIds: z33.array(
|
|
20081
|
+
z33.string().min(1).max(
|
|
19548
20082
|
AUTOMATION_BRANCH_CHANGE_ID_MAX_LENGTH,
|
|
19549
20083
|
`--change-ids entries must be at most ${AUTOMATION_BRANCH_CHANGE_ID_MAX_LENGTH} characters.`
|
|
19550
20084
|
)
|
|
@@ -19552,8 +20086,8 @@ query PreviewAutomationBranchMerge($automationId: ID!, $branchId: ID!) {
|
|
|
19552
20086
|
AUTOMATION_BRANCH_DISCARD_MAX_CHANGE_IDS,
|
|
19553
20087
|
`--change-ids can name at most ${AUTOMATION_BRANCH_DISCARD_MAX_CHANGE_IDS} preview change ids per run.`
|
|
19554
20088
|
),
|
|
19555
|
-
sourceVersionId:
|
|
19556
|
-
targetVersionId:
|
|
20089
|
+
sourceVersionId: z33.uuid("--source-version-id must be a UUID."),
|
|
20090
|
+
targetVersionId: z33.uuid("--target-version-id must be a UUID.")
|
|
19557
20091
|
}),
|
|
19558
20092
|
cli: {
|
|
19559
20093
|
branchContext: "required",
|
|
@@ -19708,8 +20242,8 @@ query AnalyzeAutomationStoreMigration(
|
|
|
19708
20242
|
operationName: "GetAvailableCommands",
|
|
19709
20243
|
apiKeyAccess: apiKeyAccessPolicies.baseline,
|
|
19710
20244
|
kind: "query",
|
|
19711
|
-
inputSchema:
|
|
19712
|
-
env:
|
|
20245
|
+
inputSchema: z33.object({
|
|
20246
|
+
env: z33.string().min(1)
|
|
19713
20247
|
}),
|
|
19714
20248
|
cli: {
|
|
19715
20249
|
name: "get-available-commands",
|
|
@@ -19743,9 +20277,9 @@ query GetAvailableCommands($env: AvailableCommandsEnv!) {
|
|
|
19743
20277
|
operationName: "GetAvailableModels",
|
|
19744
20278
|
apiKeyAccess: apiKeyAccessPolicies.automationRead,
|
|
19745
20279
|
kind: "query",
|
|
19746
|
-
inputSchema:
|
|
19747
|
-
agentId:
|
|
19748
|
-
automationId:
|
|
20280
|
+
inputSchema: z33.object({
|
|
20281
|
+
agentId: z33.string().min(1),
|
|
20282
|
+
automationId: z33.string().min(1)
|
|
19749
20283
|
}),
|
|
19750
20284
|
cli: {
|
|
19751
20285
|
name: "get-available-models",
|
|
@@ -19797,9 +20331,9 @@ query GetAvailableModels($agentId: String!, $automationId: String!) {
|
|
|
19797
20331
|
operationName: "GetAvailableTools",
|
|
19798
20332
|
apiKeyAccess: apiKeyAccessPolicies.availableTools,
|
|
19799
20333
|
kind: "query",
|
|
19800
|
-
inputSchema:
|
|
19801
|
-
env:
|
|
19802
|
-
automationId:
|
|
20334
|
+
inputSchema: z33.object({
|
|
20335
|
+
env: z33.string().min(1),
|
|
20336
|
+
automationId: z33.string().min(1).optional()
|
|
19803
20337
|
}),
|
|
19804
20338
|
cli: {
|
|
19805
20339
|
name: "get-available-tools",
|
|
@@ -19834,8 +20368,8 @@ query GetAvailableTools($env: AvailableCommandsEnv!, $automationId: String) {
|
|
|
19834
20368
|
operationName: "GetFeatureFlagsContext",
|
|
19835
20369
|
apiKeyAccess: apiKeyAccessPolicies.featureFlagsDenied,
|
|
19836
20370
|
kind: "query",
|
|
19837
|
-
inputSchema:
|
|
19838
|
-
flagKeys:
|
|
20371
|
+
inputSchema: z33.object({
|
|
20372
|
+
flagKeys: z33.array(z33.string().min(1)).min(1).max(100).optional()
|
|
19839
20373
|
}),
|
|
19840
20374
|
cli: {
|
|
19841
20375
|
name: "get-feature-flags-context",
|
|
@@ -19873,7 +20407,7 @@ query GetFeatureFlagsContext($flagKeys: [String!]) {
|
|
|
19873
20407
|
operationName: "GetAutomationWorkbenchCredentials",
|
|
19874
20408
|
apiKeyAccess: apiKeyAccessPolicies.credentialsRead,
|
|
19875
20409
|
kind: "query",
|
|
19876
|
-
inputSchema:
|
|
20410
|
+
inputSchema: z33.object({}),
|
|
19877
20411
|
cli: {
|
|
19878
20412
|
name: "get-automation-workbench-credentials",
|
|
19879
20413
|
path: ["workbench", "credentials"],
|
|
@@ -19899,9 +20433,9 @@ query GetAutomationWorkbenchCredentials {
|
|
|
19899
20433
|
operationName: "GetAutomationWorkbenchDiagnostics",
|
|
19900
20434
|
apiKeyAccess: apiKeyAccessPolicies.automationRead,
|
|
19901
20435
|
kind: "query",
|
|
19902
|
-
inputSchema:
|
|
19903
|
-
draftAutomationId:
|
|
19904
|
-
branchId:
|
|
20436
|
+
inputSchema: z33.object({
|
|
20437
|
+
draftAutomationId: z33.string().min(1),
|
|
20438
|
+
branchId: z33.string().min(1).optional()
|
|
19905
20439
|
}),
|
|
19906
20440
|
cli: {
|
|
19907
20441
|
branchContext: "optional",
|
|
@@ -19970,11 +20504,11 @@ query GetAutomationWorkbenchDiagnostics($draftAutomationId: ID!, $branchId: ID)
|
|
|
19970
20504
|
operationName: "GetAutomationWorkbenchRunTrace",
|
|
19971
20505
|
apiKeyAccess: apiKeyAccessPolicies.runRead,
|
|
19972
20506
|
kind: "query",
|
|
19973
|
-
inputSchema:
|
|
19974
|
-
automationRunId:
|
|
19975
|
-
agentRunId:
|
|
19976
|
-
limit:
|
|
19977
|
-
reverse:
|
|
20507
|
+
inputSchema: z33.object({
|
|
20508
|
+
automationRunId: z33.string().min(1),
|
|
20509
|
+
agentRunId: z33.string().min(1).optional(),
|
|
20510
|
+
limit: z33.number().int().positive().optional(),
|
|
20511
|
+
reverse: z33.boolean().optional()
|
|
19978
20512
|
}),
|
|
19979
20513
|
cli: {
|
|
19980
20514
|
name: "get-automation-workbench-run-trace",
|
|
@@ -20107,13 +20641,13 @@ query GetAutomationWorkbenchRunTrace(
|
|
|
20107
20641
|
operationName: "GetAutomationWorkbenchAwaitRunCompletion",
|
|
20108
20642
|
apiKeyAccess: apiKeyAccessPolicies.runRead,
|
|
20109
20643
|
kind: "query",
|
|
20110
|
-
inputSchema:
|
|
20111
|
-
automationRunId:
|
|
20112
|
-
timeoutMs:
|
|
20113
|
-
sinceSequence:
|
|
20114
|
-
agentRunId:
|
|
20115
|
-
limit:
|
|
20116
|
-
reverse:
|
|
20644
|
+
inputSchema: z33.object({
|
|
20645
|
+
automationRunId: z33.string().min(1),
|
|
20646
|
+
timeoutMs: z33.number().int().min(1e3).max(6e4).optional(),
|
|
20647
|
+
sinceSequence: z33.number().int().min(0).optional(),
|
|
20648
|
+
agentRunId: z33.string().min(1).optional(),
|
|
20649
|
+
limit: z33.number().int().positive().optional(),
|
|
20650
|
+
reverse: z33.boolean().optional()
|
|
20117
20651
|
}),
|
|
20118
20652
|
cli: {
|
|
20119
20653
|
name: "await-automation-workbench-run-completion",
|
|
@@ -20268,16 +20802,16 @@ query GetAutomationWorkbenchAwaitRunCompletion(
|
|
|
20268
20802
|
operationName: "GetAutomationWorkbenchSchemaSuggestions",
|
|
20269
20803
|
apiKeyAccess: apiKeyAccessPolicies.workbenchSchemaSuggestionsRead,
|
|
20270
20804
|
kind: "query",
|
|
20271
|
-
inputSchema:
|
|
20272
|
-
automationRunId:
|
|
20273
|
-
draftAutomationId:
|
|
20274
|
-
branchId:
|
|
20275
|
-
minConfidence:
|
|
20276
|
-
includeSensitive:
|
|
20805
|
+
inputSchema: z33.object({
|
|
20806
|
+
automationRunId: z33.string().min(1),
|
|
20807
|
+
draftAutomationId: z33.string().min(1).optional(),
|
|
20808
|
+
branchId: z33.string().min(1).optional(),
|
|
20809
|
+
minConfidence: z33.number().min(0).max(1).optional(),
|
|
20810
|
+
includeSensitive: z33.boolean().optional()
|
|
20277
20811
|
}).superRefine((input, ctx) => {
|
|
20278
20812
|
if (input.branchId && !input.draftAutomationId) {
|
|
20279
20813
|
ctx.addIssue({
|
|
20280
|
-
code:
|
|
20814
|
+
code: z33.ZodIssueCode.custom,
|
|
20281
20815
|
message: "--branch-id requires --draft-automation-id."
|
|
20282
20816
|
});
|
|
20283
20817
|
}
|
|
@@ -20354,8 +20888,8 @@ query GetAutomationWorkbenchSchemaSuggestions(
|
|
|
20354
20888
|
operationName: "skills_list",
|
|
20355
20889
|
apiKeyAccess: apiKeyAccessPolicies.skillsRead,
|
|
20356
20890
|
kind: "query",
|
|
20357
|
-
inputSchema:
|
|
20358
|
-
ref:
|
|
20891
|
+
inputSchema: z33.object({
|
|
20892
|
+
ref: z33.string().min(1).optional()
|
|
20359
20893
|
}),
|
|
20360
20894
|
cli: {
|
|
20361
20895
|
name: "list-skills",
|
|
@@ -20387,9 +20921,9 @@ query skills_list($ref: String) {
|
|
|
20387
20921
|
operationName: "skills_read",
|
|
20388
20922
|
apiKeyAccess: apiKeyAccessPolicies.skillsRead,
|
|
20389
20923
|
kind: "query",
|
|
20390
|
-
inputSchema:
|
|
20391
|
-
skill:
|
|
20392
|
-
ref:
|
|
20924
|
+
inputSchema: z33.object({
|
|
20925
|
+
skill: z33.string().min(1),
|
|
20926
|
+
ref: z33.string().min(1).optional()
|
|
20393
20927
|
}),
|
|
20394
20928
|
cli: {
|
|
20395
20929
|
name: "read-skill",
|
|
@@ -20429,10 +20963,10 @@ query skills_read($skill: String!, $ref: String) {
|
|
|
20429
20963
|
operationName: "skills_history",
|
|
20430
20964
|
apiKeyAccess: apiKeyAccessPolicies.skillsRead,
|
|
20431
20965
|
kind: "query",
|
|
20432
|
-
inputSchema:
|
|
20433
|
-
skill:
|
|
20434
|
-
ref:
|
|
20435
|
-
limit:
|
|
20966
|
+
inputSchema: z33.object({
|
|
20967
|
+
skill: z33.string().min(1),
|
|
20968
|
+
ref: z33.string().min(1).optional(),
|
|
20969
|
+
limit: z33.number().int().min(1).max(100).optional()
|
|
20436
20970
|
}),
|
|
20437
20971
|
cli: {
|
|
20438
20972
|
name: "get-skill-history",
|
|
@@ -20481,11 +21015,11 @@ query skills_history($skill: String!, $ref: String, $limit: Int) {
|
|
|
20481
21015
|
operationName: "skills_apply_patch",
|
|
20482
21016
|
apiKeyAccess: apiKeyAccessPolicies.skillsWrite,
|
|
20483
21017
|
kind: "mutation",
|
|
20484
|
-
inputSchema:
|
|
20485
|
-
patch:
|
|
20486
|
-
message:
|
|
20487
|
-
idempotencyKey:
|
|
20488
|
-
ref:
|
|
21018
|
+
inputSchema: z33.object({
|
|
21019
|
+
patch: z33.string().min(1),
|
|
21020
|
+
message: z33.string().min(1),
|
|
21021
|
+
idempotencyKey: z33.string().min(1).optional(),
|
|
21022
|
+
ref: z33.string().min(1).optional()
|
|
20489
21023
|
}),
|
|
20490
21024
|
cli: {
|
|
20491
21025
|
name: "apply-skills-patch",
|
|
@@ -20545,7 +21079,7 @@ mutation skills_apply_patch(
|
|
|
20545
21079
|
operationName: "CreateAutomation",
|
|
20546
21080
|
apiKeyAccess: apiKeyAccessPolicies.automationWrite,
|
|
20547
21081
|
kind: "mutation",
|
|
20548
|
-
inputSchema:
|
|
21082
|
+
inputSchema: z33.object({
|
|
20549
21083
|
input: createAutomationInputSchema
|
|
20550
21084
|
}),
|
|
20551
21085
|
cli: {
|
|
@@ -20585,7 +21119,7 @@ mutation CreateAutomation($input: CreateAutomationInput!) {
|
|
|
20585
21119
|
operationName: "GetGraphqlSchema",
|
|
20586
21120
|
apiKeyAccess: apiKeyAccessPolicies.baseline,
|
|
20587
21121
|
kind: "query",
|
|
20588
|
-
inputSchema:
|
|
21122
|
+
inputSchema: z33.object({}),
|
|
20589
21123
|
cli: {
|
|
20590
21124
|
name: "get-graphql-schema",
|
|
20591
21125
|
path: ["graphql", "schema"],
|
|
@@ -20607,8 +21141,8 @@ query GetGraphqlSchema {
|
|
|
20607
21141
|
operationName: "ApproveAutomationStep",
|
|
20608
21142
|
apiKeyAccess: apiKeyAccessPolicies.runControl,
|
|
20609
21143
|
kind: "mutation",
|
|
20610
|
-
inputSchema:
|
|
20611
|
-
runId:
|
|
21144
|
+
inputSchema: z33.object({
|
|
21145
|
+
runId: z33.string().min(1)
|
|
20612
21146
|
}),
|
|
20613
21147
|
cli: {
|
|
20614
21148
|
name: "approve-automation-step",
|
|
@@ -20634,8 +21168,8 @@ mutation ApproveAutomationStep($runId: ID!) {
|
|
|
20634
21168
|
operationName: "RetryAutomationStep",
|
|
20635
21169
|
apiKeyAccess: apiKeyAccessPolicies.runControl,
|
|
20636
21170
|
kind: "mutation",
|
|
20637
|
-
inputSchema:
|
|
20638
|
-
runId:
|
|
21171
|
+
inputSchema: z33.object({
|
|
21172
|
+
runId: z33.string().min(1)
|
|
20639
21173
|
}),
|
|
20640
21174
|
cli: {
|
|
20641
21175
|
name: "retry-automation-step",
|
|
@@ -20661,8 +21195,8 @@ mutation RetryAutomationStep($runId: ID!) {
|
|
|
20661
21195
|
operationName: "PauseAutomationRun",
|
|
20662
21196
|
apiKeyAccess: apiKeyAccessPolicies.runControl,
|
|
20663
21197
|
kind: "mutation",
|
|
20664
|
-
inputSchema:
|
|
20665
|
-
automationRunId:
|
|
21198
|
+
inputSchema: z33.object({
|
|
21199
|
+
automationRunId: z33.string().min(1)
|
|
20666
21200
|
}),
|
|
20667
21201
|
cli: {
|
|
20668
21202
|
name: "pause-automation-run",
|
|
@@ -20688,11 +21222,11 @@ mutation PauseAutomationRun($automationRunId: ID!) {
|
|
|
20688
21222
|
operationName: "RerunAutomation",
|
|
20689
21223
|
apiKeyAccess: apiKeyAccessPolicies.rerun,
|
|
20690
21224
|
kind: "mutation",
|
|
20691
|
-
inputSchema:
|
|
20692
|
-
automationRunId:
|
|
20693
|
-
additionalPrompt:
|
|
20694
|
-
idempotencyKey:
|
|
20695
|
-
allowPointOfNoReturnOverride:
|
|
21225
|
+
inputSchema: z33.object({
|
|
21226
|
+
automationRunId: z33.string().min(1),
|
|
21227
|
+
additionalPrompt: z33.string().min(1).optional(),
|
|
21228
|
+
idempotencyKey: z33.string().min(1),
|
|
21229
|
+
allowPointOfNoReturnOverride: z33.boolean().optional()
|
|
20696
21230
|
}),
|
|
20697
21231
|
cli: {
|
|
20698
21232
|
name: "rerun-automation",
|
|
@@ -20748,9 +21282,9 @@ mutation RerunAutomation(
|
|
|
20748
21282
|
operationName: "ResumeAutomationRun",
|
|
20749
21283
|
apiKeyAccess: apiKeyAccessPolicies.runControl,
|
|
20750
21284
|
kind: "mutation",
|
|
20751
|
-
inputSchema:
|
|
20752
|
-
automationRunId:
|
|
20753
|
-
message:
|
|
21285
|
+
inputSchema: z33.object({
|
|
21286
|
+
automationRunId: z33.string().min(1),
|
|
21287
|
+
message: z33.string().min(1).optional()
|
|
20754
21288
|
}),
|
|
20755
21289
|
cli: {
|
|
20756
21290
|
name: "resume-automation-run",
|
|
@@ -20781,16 +21315,16 @@ mutation ResumeAutomationRun($automationRunId: ID!, $message: String) {
|
|
|
20781
21315
|
operationName: "RunDraftAutomation",
|
|
20782
21316
|
apiKeyAccess: apiKeyAccessPolicies.runDraft,
|
|
20783
21317
|
kind: "mutation",
|
|
20784
|
-
inputSchema:
|
|
20785
|
-
draftAutomationId:
|
|
20786
|
-
branchId:
|
|
20787
|
-
agentId:
|
|
20788
|
-
idempotencyKey:
|
|
20789
|
-
input:
|
|
20790
|
-
initialStore:
|
|
21318
|
+
inputSchema: z33.object({
|
|
21319
|
+
draftAutomationId: z33.string().min(1),
|
|
21320
|
+
branchId: z33.string().min(1).optional(),
|
|
21321
|
+
agentId: z33.string().min(1),
|
|
21322
|
+
idempotencyKey: z33.string().min(1),
|
|
21323
|
+
input: z33.unknown().optional(),
|
|
21324
|
+
initialStore: z33.record(z33.string(), z33.unknown()).optional(),
|
|
20791
21325
|
config: runDraftConfigInputSchema.optional(),
|
|
20792
|
-
additionalPrompt:
|
|
20793
|
-
consistencyCheckCount:
|
|
21326
|
+
additionalPrompt: z33.string().min(1).optional(),
|
|
21327
|
+
consistencyCheckCount: z33.number().int().optional()
|
|
20794
21328
|
}),
|
|
20795
21329
|
cli: {
|
|
20796
21330
|
branchContext: "optional",
|
|
@@ -20882,8 +21416,8 @@ mutation RunDraftAutomation(
|
|
|
20882
21416
|
operationName: "PublishDraftAutomation",
|
|
20883
21417
|
apiKeyAccess: apiKeyAccessPolicies.publishDenied,
|
|
20884
21418
|
kind: "mutation",
|
|
20885
|
-
inputSchema:
|
|
20886
|
-
draftAutomationId:
|
|
21419
|
+
inputSchema: z33.object({
|
|
21420
|
+
draftAutomationId: z33.string().min(1)
|
|
20887
21421
|
}),
|
|
20888
21422
|
cli: {
|
|
20889
21423
|
name: "publish-draft-automation",
|
|
@@ -20917,8 +21451,8 @@ mutation PublishDraftAutomation($draftAutomationId: ID!) {
|
|
|
20917
21451
|
operationName: "StopAutomationRun",
|
|
20918
21452
|
apiKeyAccess: apiKeyAccessPolicies.runControl,
|
|
20919
21453
|
kind: "mutation",
|
|
20920
|
-
inputSchema:
|
|
20921
|
-
automationRunId:
|
|
21454
|
+
inputSchema: z33.object({
|
|
21455
|
+
automationRunId: z33.string().min(1)
|
|
20922
21456
|
}),
|
|
20923
21457
|
cli: {
|
|
20924
21458
|
name: "stop-automation-run",
|
|
@@ -20944,10 +21478,10 @@ mutation StopAutomationRun($automationRunId: ID!) {
|
|
|
20944
21478
|
operationName: "PreviewAutomationPatch",
|
|
20945
21479
|
apiKeyAccess: apiKeyAccessPolicies.workbenchPreviewRead,
|
|
20946
21480
|
kind: "mutation",
|
|
20947
|
-
inputSchema:
|
|
20948
|
-
draftAutomationId:
|
|
20949
|
-
branchId:
|
|
20950
|
-
expectedLastSavedAt:
|
|
21481
|
+
inputSchema: z33.object({
|
|
21482
|
+
draftAutomationId: z33.string().min(1),
|
|
21483
|
+
branchId: z33.string().min(1).optional(),
|
|
21484
|
+
expectedLastSavedAt: z33.string().optional(),
|
|
20951
21485
|
operations: automationPatchOperationsSchema
|
|
20952
21486
|
}),
|
|
20953
21487
|
cli: {
|
|
@@ -21063,15 +21597,15 @@ mutation PreviewAutomationPatch(
|
|
|
21063
21597
|
operationName: "ValidateAutomationPatchReadiness",
|
|
21064
21598
|
apiKeyAccess: apiKeyAccessPolicies.workbenchPreviewRead,
|
|
21065
21599
|
kind: "mutation",
|
|
21066
|
-
inputSchema:
|
|
21067
|
-
targetDraftAutomationId:
|
|
21068
|
-
newAutomationName:
|
|
21069
|
-
branchId:
|
|
21600
|
+
inputSchema: z33.object({
|
|
21601
|
+
targetDraftAutomationId: z33.string().min(1).optional(),
|
|
21602
|
+
newAutomationName: z33.string().min(1).optional(),
|
|
21603
|
+
branchId: z33.string().min(1).optional(),
|
|
21070
21604
|
operations: automationPatchOperationsSchema
|
|
21071
21605
|
}).superRefine((input, ctx) => {
|
|
21072
21606
|
if (input.branchId && !input.targetDraftAutomationId) {
|
|
21073
21607
|
ctx.addIssue({
|
|
21074
|
-
code:
|
|
21608
|
+
code: z33.ZodIssueCode.custom,
|
|
21075
21609
|
message: "--branch-id requires --target-draft-automation-id."
|
|
21076
21610
|
});
|
|
21077
21611
|
}
|
|
@@ -21141,10 +21675,10 @@ mutation ValidateAutomationPatchReadiness(
|
|
|
21141
21675
|
operationName: "ApplyAutomationPatch",
|
|
21142
21676
|
apiKeyAccess: apiKeyAccessPolicies.applyAutomationPatch,
|
|
21143
21677
|
kind: "mutation",
|
|
21144
|
-
inputSchema:
|
|
21145
|
-
draftAutomationId:
|
|
21146
|
-
branchId:
|
|
21147
|
-
expectedLastSavedAt:
|
|
21678
|
+
inputSchema: z33.object({
|
|
21679
|
+
draftAutomationId: z33.string().min(1),
|
|
21680
|
+
branchId: z33.string().min(1).optional(),
|
|
21681
|
+
expectedLastSavedAt: z33.string().optional(),
|
|
21148
21682
|
operations: automationPatchOperationsSchema
|
|
21149
21683
|
}),
|
|
21150
21684
|
cli: {
|
|
@@ -21269,9 +21803,9 @@ mutation ApplyAutomationPatch(
|
|
|
21269
21803
|
operationName: "UpdateAutomationById",
|
|
21270
21804
|
apiKeyAccess: apiKeyAccessPolicies.updateAutomation,
|
|
21271
21805
|
kind: "mutation",
|
|
21272
|
-
inputSchema:
|
|
21273
|
-
id:
|
|
21274
|
-
branchId:
|
|
21806
|
+
inputSchema: z33.object({
|
|
21807
|
+
id: z33.string().min(1),
|
|
21808
|
+
branchId: z33.string().min(1).optional(),
|
|
21275
21809
|
input: updateAutomationInputSchema
|
|
21276
21810
|
}),
|
|
21277
21811
|
cli: {
|
|
@@ -21316,7 +21850,7 @@ mutation UpdateAutomationById($id: ID!, $branchId: ID, $input: UpdateAutomationI
|
|
|
21316
21850
|
operationName: "ListRegisteredEvals",
|
|
21317
21851
|
apiKeyAccess: apiKeyAccessPolicies.evalsDenied,
|
|
21318
21852
|
kind: "query",
|
|
21319
|
-
inputSchema:
|
|
21853
|
+
inputSchema: z33.object({}),
|
|
21320
21854
|
cli: {
|
|
21321
21855
|
name: "list-registered-evals",
|
|
21322
21856
|
path: ["evals", "list"],
|
|
@@ -21337,7 +21871,7 @@ ${registeredEvalSelection}
|
|
|
21337
21871
|
operationName: "GetRegisteredEval",
|
|
21338
21872
|
apiKeyAccess: apiKeyAccessPolicies.evalsDenied,
|
|
21339
21873
|
kind: "query",
|
|
21340
|
-
inputSchema:
|
|
21874
|
+
inputSchema: z33.object({ slug: z33.string().min(1) }),
|
|
21341
21875
|
cli: {
|
|
21342
21876
|
name: "get-registered-eval",
|
|
21343
21877
|
path: ["evals", "get"],
|
|
@@ -21365,9 +21899,9 @@ ${registeredEvalSelection}
|
|
|
21365
21899
|
operationName: "TestRegisteredEval",
|
|
21366
21900
|
apiKeyAccess: apiKeyAccessPolicies.evalsDenied,
|
|
21367
21901
|
kind: "mutation",
|
|
21368
|
-
inputSchema:
|
|
21902
|
+
inputSchema: z33.object({
|
|
21369
21903
|
input: jsonObjectSchema,
|
|
21370
|
-
slug:
|
|
21904
|
+
slug: z33.string().min(1)
|
|
21371
21905
|
}),
|
|
21372
21906
|
cli: {
|
|
21373
21907
|
name: "test-registered-eval",
|
|
@@ -21500,8 +22034,8 @@ query PlanRegisteredEvalRun(
|
|
|
21500
22034
|
apiKeyAccess: apiKeyAccessPolicies.evalsDenied,
|
|
21501
22035
|
kind: "mutation",
|
|
21502
22036
|
inputSchema: registeredEvalRunInputSchema.extend({
|
|
21503
|
-
expectedTrialCount:
|
|
21504
|
-
idempotencyKey:
|
|
22037
|
+
expectedTrialCount: z33.number().int().positive(),
|
|
22038
|
+
idempotencyKey: z33.string().trim().min(1)
|
|
21505
22039
|
}),
|
|
21506
22040
|
cli: {
|
|
21507
22041
|
name: "start-registered-eval-run",
|
|
@@ -21609,10 +22143,10 @@ mutation StartRegisteredEvalRun(
|
|
|
21609
22143
|
operationName: "ListEvalRuns",
|
|
21610
22144
|
apiKeyAccess: apiKeyAccessPolicies.evalsDenied,
|
|
21611
22145
|
kind: "query",
|
|
21612
|
-
inputSchema:
|
|
21613
|
-
page:
|
|
21614
|
-
pageSize:
|
|
21615
|
-
slug:
|
|
22146
|
+
inputSchema: z33.object({
|
|
22147
|
+
page: z33.number().int().nonnegative().default(0),
|
|
22148
|
+
pageSize: z33.number().int().min(1).max(100).default(20),
|
|
22149
|
+
slug: z33.string().min(1).optional(),
|
|
21616
22150
|
status: evalRunStatusSchema.optional()
|
|
21617
22151
|
}),
|
|
21618
22152
|
cli: {
|
|
@@ -21666,7 +22200,7 @@ ${evalRunSelection}
|
|
|
21666
22200
|
operationName: "GetEvalRun",
|
|
21667
22201
|
apiKeyAccess: apiKeyAccessPolicies.evalsDenied,
|
|
21668
22202
|
kind: "query",
|
|
21669
|
-
inputSchema:
|
|
22203
|
+
inputSchema: z33.object({ id: z33.string().min(1) }),
|
|
21670
22204
|
cli: {
|
|
21671
22205
|
name: "get-eval-run",
|
|
21672
22206
|
path: ["evals", "runs", "get"],
|
|
@@ -21694,9 +22228,9 @@ ${evalRunSelection}
|
|
|
21694
22228
|
operationName: "AwaitEvalRun",
|
|
21695
22229
|
apiKeyAccess: apiKeyAccessPolicies.evalsDenied,
|
|
21696
22230
|
kind: "query",
|
|
21697
|
-
inputSchema:
|
|
21698
|
-
id:
|
|
21699
|
-
timeoutMs:
|
|
22231
|
+
inputSchema: z33.object({
|
|
22232
|
+
id: z33.string().min(1),
|
|
22233
|
+
timeoutMs: z33.number().int().min(1e3).max(6e4).default(3e4)
|
|
21700
22234
|
}),
|
|
21701
22235
|
cli: {
|
|
21702
22236
|
name: "await-eval-run",
|
|
@@ -21738,10 +22272,10 @@ ${evalRunSelection}
|
|
|
21738
22272
|
operationName: "ListEvalRunTrials",
|
|
21739
22273
|
apiKeyAccess: apiKeyAccessPolicies.evalsDenied,
|
|
21740
22274
|
kind: "query",
|
|
21741
|
-
inputSchema:
|
|
21742
|
-
cursor:
|
|
21743
|
-
id:
|
|
21744
|
-
limit:
|
|
22275
|
+
inputSchema: z33.object({
|
|
22276
|
+
cursor: z33.string().min(1).optional(),
|
|
22277
|
+
id: z33.string().min(1),
|
|
22278
|
+
limit: z33.number().int().min(1).max(1e3).default(100)
|
|
21745
22279
|
}),
|
|
21746
22280
|
cli: {
|
|
21747
22281
|
name: "list-eval-run-trials",
|
|
@@ -21795,7 +22329,7 @@ query ListEvalRunTrials($id: String!, $limit: Int, $cursor: String) {
|
|
|
21795
22329
|
operationName: "CancelEvalRun",
|
|
21796
22330
|
apiKeyAccess: apiKeyAccessPolicies.evalsDenied,
|
|
21797
22331
|
kind: "mutation",
|
|
21798
|
-
inputSchema:
|
|
22332
|
+
inputSchema: z33.object({ id: z33.string().min(1) }),
|
|
21799
22333
|
cli: {
|
|
21800
22334
|
name: "cancel-eval-run",
|
|
21801
22335
|
path: ["evals", "runs", "cancel"],
|
|
@@ -21825,7 +22359,7 @@ mutation CancelEvalRun($id: String!) {
|
|
|
21825
22359
|
operationName: "RequestEvalRunExport",
|
|
21826
22360
|
apiKeyAccess: apiKeyAccessPolicies.evalsDenied,
|
|
21827
22361
|
kind: "mutation",
|
|
21828
|
-
inputSchema:
|
|
22362
|
+
inputSchema: z33.object({ id: z33.string().min(1) }),
|
|
21829
22363
|
cli: {
|
|
21830
22364
|
name: "request-eval-run-export",
|
|
21831
22365
|
path: ["evals", "runs", "export"],
|
|
@@ -21872,7 +22406,7 @@ ${evalRunExportSelection}
|
|
|
21872
22406
|
operationName: "GetEvalRunExport",
|
|
21873
22407
|
apiKeyAccess: apiKeyAccessPolicies.evalsDenied,
|
|
21874
22408
|
kind: "query",
|
|
21875
|
-
inputSchema:
|
|
22409
|
+
inputSchema: z33.object({ exportId: z33.string().min(1) }),
|
|
21876
22410
|
cli: {
|
|
21877
22411
|
hidden: true,
|
|
21878
22412
|
name: "get-eval-run-export",
|
|
@@ -21909,7 +22443,7 @@ import { access, link, rename, rm } from "node:fs/promises";
|
|
|
21909
22443
|
import nodePath from "node:path";
|
|
21910
22444
|
import { Readable, Transform } from "node:stream";
|
|
21911
22445
|
import { pipeline } from "node:stream/promises";
|
|
21912
|
-
import { z as
|
|
22446
|
+
import { z as z34 } from "zod";
|
|
21913
22447
|
|
|
21914
22448
|
// src/version.ts
|
|
21915
22449
|
import fs from "node:fs";
|
|
@@ -21939,137 +22473,137 @@ var OTTO_AUTHORIZATION_ISSUER = "magical:otto";
|
|
|
21939
22473
|
var WORKOS_API_KEY_PREFIX = "sk_";
|
|
21940
22474
|
var FILE_UPLOAD_TIMEOUT_MS = 10 * 60 * 1e3;
|
|
21941
22475
|
var NETWORK_RECORDING_METADATA_TIMEOUT_MS = 3e4;
|
|
21942
|
-
var workosOrganizationsResponseSchema =
|
|
21943
|
-
organizations:
|
|
21944
|
-
|
|
21945
|
-
id:
|
|
21946
|
-
name:
|
|
21947
|
-
primaryDomain:
|
|
22476
|
+
var workosOrganizationsResponseSchema = z34.object({
|
|
22477
|
+
organizations: z34.array(
|
|
22478
|
+
z34.object({
|
|
22479
|
+
id: z34.string().min(1),
|
|
22480
|
+
name: z34.string().min(1),
|
|
22481
|
+
primaryDomain: z34.string().nullable().optional()
|
|
21948
22482
|
})
|
|
21949
22483
|
),
|
|
21950
|
-
success:
|
|
22484
|
+
success: z34.boolean()
|
|
21951
22485
|
});
|
|
21952
|
-
var workosUserSchema =
|
|
21953
|
-
email:
|
|
21954
|
-
id:
|
|
22486
|
+
var workosUserSchema = z34.object({
|
|
22487
|
+
email: z34.string().nullable(),
|
|
22488
|
+
id: z34.string().min(1)
|
|
21955
22489
|
});
|
|
21956
|
-
var magicalApiKeyPermissionSchema =
|
|
22490
|
+
var magicalApiKeyPermissionSchema = z34.custom(
|
|
21957
22491
|
isMagicalApiKeyPermission,
|
|
21958
22492
|
"Unknown Magical API key permission."
|
|
21959
22493
|
);
|
|
21960
|
-
var apiKeyOrganizationSchema =
|
|
21961
|
-
id:
|
|
21962
|
-
name:
|
|
21963
|
-
});
|
|
21964
|
-
var sanitizedUserApiKeySchema =
|
|
21965
|
-
createdAt:
|
|
21966
|
-
expiresAt:
|
|
21967
|
-
id:
|
|
21968
|
-
lastUsedAt:
|
|
21969
|
-
name:
|
|
21970
|
-
obfuscatedValue:
|
|
21971
|
-
organizationId:
|
|
21972
|
-
ownerUserId:
|
|
21973
|
-
permissions:
|
|
21974
|
-
updatedAt:
|
|
21975
|
-
});
|
|
21976
|
-
var apiKeyIdentityResponseSchema =
|
|
22494
|
+
var apiKeyOrganizationSchema = z34.object({
|
|
22495
|
+
id: z34.string().min(1),
|
|
22496
|
+
name: z34.string().min(1)
|
|
22497
|
+
});
|
|
22498
|
+
var sanitizedUserApiKeySchema = z34.object({
|
|
22499
|
+
createdAt: z34.string().datetime(),
|
|
22500
|
+
expiresAt: z34.string().datetime().nullable(),
|
|
22501
|
+
id: z34.string().min(1),
|
|
22502
|
+
lastUsedAt: z34.string().datetime().nullable(),
|
|
22503
|
+
name: z34.string(),
|
|
22504
|
+
obfuscatedValue: z34.string().min(1),
|
|
22505
|
+
organizationId: z34.string().min(1),
|
|
22506
|
+
ownerUserId: z34.string().min(1),
|
|
22507
|
+
permissions: z34.array(magicalApiKeyPermissionSchema),
|
|
22508
|
+
updatedAt: z34.string().datetime()
|
|
22509
|
+
});
|
|
22510
|
+
var apiKeyIdentityResponseSchema = z34.object({
|
|
21977
22511
|
apiKey: sanitizedUserApiKeySchema,
|
|
21978
|
-
effectivePermissions:
|
|
22512
|
+
effectivePermissions: z34.array(magicalApiKeyPermissionSchema),
|
|
21979
22513
|
organization: apiKeyOrganizationSchema
|
|
21980
22514
|
});
|
|
21981
|
-
var apiKeyOrganizationsResponseSchema =
|
|
21982
|
-
organizations:
|
|
22515
|
+
var apiKeyOrganizationsResponseSchema = z34.object({
|
|
22516
|
+
organizations: z34.array(apiKeyOrganizationSchema)
|
|
21983
22517
|
});
|
|
21984
|
-
var apiKeyPreflightResponseSchema =
|
|
21985
|
-
targets:
|
|
21986
|
-
|
|
21987
|
-
availablePermissions:
|
|
22518
|
+
var apiKeyPreflightResponseSchema = z34.object({
|
|
22519
|
+
targets: z34.array(
|
|
22520
|
+
z34.object({
|
|
22521
|
+
availablePermissions: z34.array(magicalApiKeyPermissionSchema),
|
|
21988
22522
|
organization: apiKeyOrganizationSchema,
|
|
21989
|
-
requestedPermissions:
|
|
22523
|
+
requestedPermissions: z34.array(magicalApiKeyPermissionSchema)
|
|
21990
22524
|
})
|
|
21991
22525
|
)
|
|
21992
22526
|
});
|
|
21993
|
-
var createUserApiKeyResponseSchema =
|
|
21994
|
-
apiKey: sanitizedUserApiKeySchema.extend({ value:
|
|
22527
|
+
var createUserApiKeyResponseSchema = z34.object({
|
|
22528
|
+
apiKey: sanitizedUserApiKeySchema.extend({ value: z34.string().min(1) })
|
|
21995
22529
|
});
|
|
21996
|
-
var listUserApiKeysResponseSchema =
|
|
21997
|
-
apiKeys:
|
|
22530
|
+
var listUserApiKeysResponseSchema = z34.object({
|
|
22531
|
+
apiKeys: z34.array(sanitizedUserApiKeySchema),
|
|
21998
22532
|
organization: apiKeyOrganizationSchema
|
|
21999
22533
|
});
|
|
22000
|
-
var revokeUserApiKeyResponseSchema =
|
|
22001
|
-
alreadyRevoked:
|
|
22002
|
-
revoked:
|
|
22003
|
-
});
|
|
22004
|
-
var networkRecordingMetadataSchema =
|
|
22005
|
-
archiveType:
|
|
22006
|
-
automationRunId:
|
|
22007
|
-
contentType:
|
|
22008
|
-
downloadPath:
|
|
22009
|
-
limits:
|
|
22010
|
-
organizationId:
|
|
22011
|
-
recordingId:
|
|
22012
|
-
sizeBytes:
|
|
22013
|
-
sourceMode:
|
|
22014
|
-
status:
|
|
22015
|
-
});
|
|
22016
|
-
var nangoIntegrationWireSchema =
|
|
22534
|
+
var revokeUserApiKeyResponseSchema = z34.object({
|
|
22535
|
+
alreadyRevoked: z34.boolean(),
|
|
22536
|
+
revoked: z34.boolean()
|
|
22537
|
+
});
|
|
22538
|
+
var networkRecordingMetadataSchema = z34.object({
|
|
22539
|
+
archiveType: z34.literal("MITMPROXY"),
|
|
22540
|
+
automationRunId: z34.string().min(1),
|
|
22541
|
+
contentType: z34.literal("application/octet-stream"),
|
|
22542
|
+
downloadPath: z34.string().min(1).nullable(),
|
|
22543
|
+
limits: z34.object({ maxArchiveBytes: z34.number().int().positive() }),
|
|
22544
|
+
organizationId: z34.string().min(1),
|
|
22545
|
+
recordingId: z34.string().min(1).nullable(),
|
|
22546
|
+
sizeBytes: z34.number().int().nonnegative().nullable(),
|
|
22547
|
+
sourceMode: z34.enum(["record", "replay"]).nullable(),
|
|
22548
|
+
status: z34.enum(["NOT_CONFIGURED", "MISSING", "AVAILABLE", "TOO_LARGE"])
|
|
22549
|
+
});
|
|
22550
|
+
var nangoIntegrationWireSchema = z34.object({
|
|
22017
22551
|
// eslint-disable-next-line @typescript-eslint/naming-convention -- mirrors Nango REST payload
|
|
22018
|
-
unique_key:
|
|
22552
|
+
unique_key: z34.string().min(1)
|
|
22019
22553
|
}).passthrough().transform((data) => ({
|
|
22020
22554
|
...data,
|
|
22021
22555
|
uniqueKey: data.unique_key
|
|
22022
22556
|
}));
|
|
22023
|
-
var nangoIntegrationsResponseSchema =
|
|
22024
|
-
var organizationAuthenticationSchema =
|
|
22025
|
-
id:
|
|
22026
|
-
type:
|
|
22027
|
-
connectionId:
|
|
22028
|
-
providerConfigKey:
|
|
22029
|
-
description:
|
|
22030
|
-
hostname:
|
|
22557
|
+
var nangoIntegrationsResponseSchema = z34.array(nangoIntegrationWireSchema);
|
|
22558
|
+
var organizationAuthenticationSchema = z34.object({
|
|
22559
|
+
id: z34.string().min(1),
|
|
22560
|
+
type: z34.string().min(1),
|
|
22561
|
+
connectionId: z34.string().nullable().optional(),
|
|
22562
|
+
providerConfigKey: z34.string().nullable().optional(),
|
|
22563
|
+
description: z34.string().nullable().optional(),
|
|
22564
|
+
hostname: z34.string().nullable().optional()
|
|
22031
22565
|
}).passthrough();
|
|
22032
|
-
var organizationAuthenticationsResponseSchema =
|
|
22033
|
-
authentications:
|
|
22034
|
-
success:
|
|
22566
|
+
var organizationAuthenticationsResponseSchema = z34.object({
|
|
22567
|
+
authentications: z34.array(organizationAuthenticationSchema),
|
|
22568
|
+
success: z34.boolean()
|
|
22035
22569
|
});
|
|
22036
|
-
var missingAgentRunPathwaySignatureResponseSchema =
|
|
22037
|
-
signature:
|
|
22038
|
-
status:
|
|
22570
|
+
var missingAgentRunPathwaySignatureResponseSchema = z34.object({
|
|
22571
|
+
signature: z34.null(),
|
|
22572
|
+
status: z34.literal("missing")
|
|
22039
22573
|
});
|
|
22040
|
-
var agentRunPathwaySignatureStatusSchema =
|
|
22574
|
+
var agentRunPathwaySignatureStatusSchema = z34.enum([
|
|
22041
22575
|
"failed",
|
|
22042
22576
|
"queued",
|
|
22043
22577
|
"running",
|
|
22044
22578
|
"succeeded"
|
|
22045
22579
|
]);
|
|
22046
|
-
var agentRunPathwaySignatureRecordSchema =
|
|
22047
|
-
agentRunId:
|
|
22048
|
-
agentVersionId:
|
|
22049
|
-
automationRunId:
|
|
22050
|
-
contractEdgeIds:
|
|
22051
|
-
contractHash:
|
|
22052
|
-
contractId:
|
|
22053
|
-
contractNodeIds:
|
|
22054
|
-
contractPathHash:
|
|
22055
|
-
createdAt:
|
|
22056
|
-
deviationTokens:
|
|
22057
|
-
finishedAt:
|
|
22058
|
-
generatorVersion:
|
|
22059
|
-
id:
|
|
22060
|
-
observedPathHash:
|
|
22061
|
-
organizationId:
|
|
22062
|
-
pathTokens:
|
|
22063
|
-
schemaVersion:
|
|
22064
|
-
sourceMemoryCount:
|
|
22065
|
-
sourceMemoryFirstSequence:
|
|
22066
|
-
sourceMemoryLastSequence:
|
|
22580
|
+
var agentRunPathwaySignatureRecordSchema = z34.object({
|
|
22581
|
+
agentRunId: z34.string().min(1),
|
|
22582
|
+
agentVersionId: z34.string().min(1),
|
|
22583
|
+
automationRunId: z34.string().min(1),
|
|
22584
|
+
contractEdgeIds: z34.array(z34.string()).nullable(),
|
|
22585
|
+
contractHash: z34.string().nullable(),
|
|
22586
|
+
contractId: z34.string().nullable(),
|
|
22587
|
+
contractNodeIds: z34.array(z34.string()).nullable(),
|
|
22588
|
+
contractPathHash: z34.string().nullable(),
|
|
22589
|
+
createdAt: z34.string().min(1),
|
|
22590
|
+
deviationTokens: z34.array(z34.string()).nullable(),
|
|
22591
|
+
finishedAt: z34.string().nullable(),
|
|
22592
|
+
generatorVersion: z34.string().min(1),
|
|
22593
|
+
id: z34.string().min(1),
|
|
22594
|
+
observedPathHash: z34.string().nullable(),
|
|
22595
|
+
organizationId: z34.string().min(1),
|
|
22596
|
+
pathTokens: z34.array(z34.string()).nullable(),
|
|
22597
|
+
schemaVersion: z34.string().min(1),
|
|
22598
|
+
sourceMemoryCount: z34.number().int().nonnegative().nullable(),
|
|
22599
|
+
sourceMemoryFirstSequence: z34.number().int().nonnegative().nullable(),
|
|
22600
|
+
sourceMemoryLastSequence: z34.number().int().nonnegative().nullable(),
|
|
22067
22601
|
status: agentRunPathwaySignatureStatusSchema,
|
|
22068
|
-
stepCount:
|
|
22069
|
-
steps:
|
|
22070
|
-
|
|
22071
|
-
contractNodeId:
|
|
22072
|
-
contractStatus:
|
|
22602
|
+
stepCount: z34.number().int().nonnegative().nullable(),
|
|
22603
|
+
steps: z34.array(
|
|
22604
|
+
z34.object({
|
|
22605
|
+
contractNodeId: z34.string().nullable(),
|
|
22606
|
+
contractStatus: z34.enum([
|
|
22073
22607
|
"expected",
|
|
22074
22608
|
"ambient",
|
|
22075
22609
|
"observed-only",
|
|
@@ -22077,23 +22611,23 @@ var agentRunPathwaySignatureRecordSchema = z32.object({
|
|
|
22077
22611
|
"out-of-flow",
|
|
22078
22612
|
"rule-mismatch"
|
|
22079
22613
|
]),
|
|
22080
|
-
sequence:
|
|
22081
|
-
token:
|
|
22082
|
-
toolName:
|
|
22614
|
+
sequence: z34.number().int().nonnegative(),
|
|
22615
|
+
token: z34.string().min(1),
|
|
22616
|
+
toolName: z34.string().nullable()
|
|
22083
22617
|
}).passthrough()
|
|
22084
22618
|
).nullable(),
|
|
22085
|
-
updatedAt:
|
|
22086
|
-
workflowId:
|
|
22619
|
+
updatedAt: z34.string().min(1),
|
|
22620
|
+
workflowId: z34.string().nullable()
|
|
22087
22621
|
});
|
|
22088
|
-
var persistedAgentRunPathwaySignatureResponseSchema =
|
|
22622
|
+
var persistedAgentRunPathwaySignatureResponseSchema = z34.object({
|
|
22089
22623
|
signature: agentRunPathwaySignatureRecordSchema,
|
|
22090
22624
|
status: agentRunPathwaySignatureStatusSchema
|
|
22091
22625
|
});
|
|
22092
|
-
var agentRunPathwaySignatureResponseSchema =
|
|
22626
|
+
var agentRunPathwaySignatureResponseSchema = z34.union([
|
|
22093
22627
|
missingAgentRunPathwaySignatureResponseSchema,
|
|
22094
22628
|
persistedAgentRunPathwaySignatureResponseSchema
|
|
22095
22629
|
]);
|
|
22096
|
-
var regressionTestPathwayStatusSchema =
|
|
22630
|
+
var regressionTestPathwayStatusSchema = z34.enum([
|
|
22097
22631
|
"new_pathway",
|
|
22098
22632
|
"missing_after_change",
|
|
22099
22633
|
"historical_path_missing_after_change",
|
|
@@ -22105,7 +22639,7 @@ var regressionTestPathwayStatusSchema = z32.enum([
|
|
|
22105
22639
|
"inconclusive",
|
|
22106
22640
|
"errored"
|
|
22107
22641
|
]);
|
|
22108
|
-
var regressionTestStatusSchema =
|
|
22642
|
+
var regressionTestStatusSchema = z34.enum([
|
|
22109
22643
|
"queued",
|
|
22110
22644
|
"running",
|
|
22111
22645
|
"matched",
|
|
@@ -22113,98 +22647,98 @@ var regressionTestStatusSchema = z32.enum([
|
|
|
22113
22647
|
"inconclusive",
|
|
22114
22648
|
"errored"
|
|
22115
22649
|
]);
|
|
22116
|
-
var regressionTestKickoffPathwaySchema =
|
|
22117
|
-
baselineContractPathId:
|
|
22118
|
-
baselineLabel:
|
|
22119
|
-
candidateContractPathId:
|
|
22120
|
-
candidateLabel:
|
|
22121
|
-
id:
|
|
22122
|
-
pathwayKey:
|
|
22650
|
+
var regressionTestKickoffPathwaySchema = z34.object({
|
|
22651
|
+
baselineContractPathId: z34.string().min(1).nullable(),
|
|
22652
|
+
baselineLabel: z34.string().nullable(),
|
|
22653
|
+
candidateContractPathId: z34.string().min(1).nullable(),
|
|
22654
|
+
candidateLabel: z34.string().nullable(),
|
|
22655
|
+
id: z34.string().min(1),
|
|
22656
|
+
pathwayKey: z34.string().min(1),
|
|
22123
22657
|
status: regressionTestPathwayStatusSchema
|
|
22124
22658
|
});
|
|
22125
|
-
var regressionTestKickoffResponseSchema =
|
|
22126
|
-
pathways:
|
|
22127
|
-
regressionTestId:
|
|
22659
|
+
var regressionTestKickoffResponseSchema = z34.object({
|
|
22660
|
+
pathways: z34.array(regressionTestKickoffPathwaySchema),
|
|
22661
|
+
regressionTestId: z34.string().min(1),
|
|
22128
22662
|
status: regressionTestStatusSchema
|
|
22129
22663
|
});
|
|
22130
|
-
var regressionTestIterationCountsSchema =
|
|
22131
|
-
deviated:
|
|
22132
|
-
errored:
|
|
22133
|
-
matched:
|
|
22134
|
-
total:
|
|
22664
|
+
var regressionTestIterationCountsSchema = z34.object({
|
|
22665
|
+
deviated: z34.number(),
|
|
22666
|
+
errored: z34.number(),
|
|
22667
|
+
matched: z34.number(),
|
|
22668
|
+
total: z34.number()
|
|
22135
22669
|
});
|
|
22136
|
-
var regressionTestBaselineRunSummarySchema =
|
|
22137
|
-
id:
|
|
22670
|
+
var regressionTestBaselineRunSummarySchema = z34.object({
|
|
22671
|
+
id: z34.string().min(1),
|
|
22138
22672
|
iterationCounts: regressionTestIterationCountsSchema
|
|
22139
22673
|
});
|
|
22140
|
-
var regressionTestPathwaySummarySchema =
|
|
22141
|
-
baselineLabel:
|
|
22142
|
-
baselineRuns:
|
|
22143
|
-
candidateLabel:
|
|
22144
|
-
id:
|
|
22145
|
-
pathwayKey:
|
|
22674
|
+
var regressionTestPathwaySummarySchema = z34.object({
|
|
22675
|
+
baselineLabel: z34.string().nullable(),
|
|
22676
|
+
baselineRuns: z34.array(regressionTestBaselineRunSummarySchema),
|
|
22677
|
+
candidateLabel: z34.string().nullable(),
|
|
22678
|
+
id: z34.string().min(1),
|
|
22679
|
+
pathwayKey: z34.string().min(1),
|
|
22146
22680
|
status: regressionTestPathwayStatusSchema
|
|
22147
22681
|
});
|
|
22148
|
-
var regressionTestResultResponseSchema =
|
|
22149
|
-
pathways:
|
|
22150
|
-
regressionTest:
|
|
22151
|
-
finishedAt:
|
|
22152
|
-
id:
|
|
22153
|
-
startedAt:
|
|
22682
|
+
var regressionTestResultResponseSchema = z34.object({
|
|
22683
|
+
pathways: z34.array(regressionTestPathwaySummarySchema),
|
|
22684
|
+
regressionTest: z34.object({
|
|
22685
|
+
finishedAt: z34.string().nullable(),
|
|
22686
|
+
id: z34.string().min(1),
|
|
22687
|
+
startedAt: z34.string().nullable(),
|
|
22154
22688
|
status: regressionTestStatusSchema
|
|
22155
22689
|
})
|
|
22156
22690
|
});
|
|
22157
|
-
var regressionTestBaselineStepSchema =
|
|
22158
|
-
expectedToolCall:
|
|
22159
|
-
id:
|
|
22160
|
-
iterationIndex:
|
|
22691
|
+
var regressionTestBaselineStepSchema = z34.object({
|
|
22692
|
+
expectedToolCall: z34.unknown().nullable(),
|
|
22693
|
+
id: z34.string().min(1),
|
|
22694
|
+
iterationIndex: z34.number()
|
|
22161
22695
|
});
|
|
22162
|
-
var regressionTestDeviatedToolCallSchema =
|
|
22163
|
-
count:
|
|
22164
|
-
observedToolCall:
|
|
22696
|
+
var regressionTestDeviatedToolCallSchema = z34.object({
|
|
22697
|
+
count: z34.number(),
|
|
22698
|
+
observedToolCall: z34.unknown()
|
|
22165
22699
|
});
|
|
22166
|
-
var regressionTestDeviatedIterationSchema =
|
|
22167
|
-
baselineIterationId:
|
|
22168
|
-
deviatedToolCalls:
|
|
22700
|
+
var regressionTestDeviatedIterationSchema = z34.object({
|
|
22701
|
+
baselineIterationId: z34.string().min(1),
|
|
22702
|
+
deviatedToolCalls: z34.array(regressionTestDeviatedToolCallSchema)
|
|
22169
22703
|
});
|
|
22170
|
-
var regressionTestReplayCountsSchema =
|
|
22171
|
-
deviated:
|
|
22172
|
-
errored:
|
|
22173
|
-
matched:
|
|
22704
|
+
var regressionTestReplayCountsSchema = z34.object({
|
|
22705
|
+
deviated: z34.number(),
|
|
22706
|
+
errored: z34.number(),
|
|
22707
|
+
matched: z34.number()
|
|
22174
22708
|
});
|
|
22175
|
-
var regressionTestBaselineRunSchema =
|
|
22176
|
-
baselineAgentRunId:
|
|
22177
|
-
baselineIterations:
|
|
22178
|
-
deviatedIterations:
|
|
22709
|
+
var regressionTestBaselineRunSchema = z34.object({
|
|
22710
|
+
baselineAgentRunId: z34.string().min(1),
|
|
22711
|
+
baselineIterations: z34.array(regressionTestBaselineStepSchema),
|
|
22712
|
+
deviatedIterations: z34.array(regressionTestDeviatedIterationSchema),
|
|
22179
22713
|
replayCounts: regressionTestReplayCountsSchema
|
|
22180
22714
|
});
|
|
22181
|
-
var regressionTestPathwayDetailSchema =
|
|
22182
|
-
baselineLabel:
|
|
22183
|
-
baselineRuns:
|
|
22184
|
-
candidateLabel:
|
|
22185
|
-
id:
|
|
22186
|
-
pathwayKey:
|
|
22715
|
+
var regressionTestPathwayDetailSchema = z34.object({
|
|
22716
|
+
baselineLabel: z34.string().nullable(),
|
|
22717
|
+
baselineRuns: z34.array(regressionTestBaselineRunSchema),
|
|
22718
|
+
candidateLabel: z34.string().nullable(),
|
|
22719
|
+
id: z34.string().min(1),
|
|
22720
|
+
pathwayKey: z34.string().min(1),
|
|
22187
22721
|
status: regressionTestPathwayStatusSchema
|
|
22188
22722
|
});
|
|
22189
|
-
var regressionTestPathwayResultResponseSchema =
|
|
22723
|
+
var regressionTestPathwayResultResponseSchema = z34.object({
|
|
22190
22724
|
pathway: regressionTestPathwayDetailSchema,
|
|
22191
|
-
regressionTest:
|
|
22192
|
-
finishedAt:
|
|
22193
|
-
id:
|
|
22194
|
-
startedAt:
|
|
22725
|
+
regressionTest: z34.object({
|
|
22726
|
+
finishedAt: z34.string().nullable(),
|
|
22727
|
+
id: z34.string().min(1),
|
|
22728
|
+
startedAt: z34.string().nullable(),
|
|
22195
22729
|
status: regressionTestStatusSchema
|
|
22196
22730
|
})
|
|
22197
22731
|
});
|
|
22198
|
-
var graphQlResponseSchema =
|
|
22199
|
-
data:
|
|
22200
|
-
errors:
|
|
22201
|
-
|
|
22202
|
-
extensions:
|
|
22203
|
-
appErrorType:
|
|
22204
|
-
code:
|
|
22205
|
-
http:
|
|
22732
|
+
var graphQlResponseSchema = z34.object({
|
|
22733
|
+
data: z34.record(z34.string(), z34.unknown()).nullable().optional(),
|
|
22734
|
+
errors: z34.array(
|
|
22735
|
+
z34.object({
|
|
22736
|
+
extensions: z34.object({
|
|
22737
|
+
appErrorType: z34.string().optional(),
|
|
22738
|
+
code: z34.string().min(1).optional(),
|
|
22739
|
+
http: z34.object({ status: z34.number() }).optional()
|
|
22206
22740
|
}).passthrough().optional(),
|
|
22207
|
-
message:
|
|
22741
|
+
message: z34.string().min(1)
|
|
22208
22742
|
})
|
|
22209
22743
|
).optional()
|
|
22210
22744
|
});
|
|
@@ -22235,14 +22769,14 @@ function getGraphQlErrorStatus(error) {
|
|
|
22235
22769
|
}
|
|
22236
22770
|
return error.extensions?.appErrorType?.includes("not-found") ? 404 : void 0;
|
|
22237
22771
|
}
|
|
22238
|
-
var apiErrorResponseSchema =
|
|
22239
|
-
code:
|
|
22240
|
-
errors:
|
|
22241
|
-
|
|
22242
|
-
message:
|
|
22772
|
+
var apiErrorResponseSchema = z34.object({
|
|
22773
|
+
code: z34.string().min(1).optional(),
|
|
22774
|
+
errors: z34.array(
|
|
22775
|
+
z34.object({
|
|
22776
|
+
message: z34.string().min(1)
|
|
22243
22777
|
})
|
|
22244
22778
|
).optional(),
|
|
22245
|
-
message:
|
|
22779
|
+
message: z34.string().min(1).optional()
|
|
22246
22780
|
});
|
|
22247
22781
|
function getApiErrorDetail(responseBody) {
|
|
22248
22782
|
const parsedResponse = apiErrorResponseSchema.safeParse(responseBody);
|
|
@@ -22465,18 +22999,18 @@ async function downloadAuthenticatedFileFromApi({
|
|
|
22465
22999
|
organizationId,
|
|
22466
23000
|
outputPath,
|
|
22467
23001
|
overwrite = false,
|
|
22468
|
-
path:
|
|
23002
|
+
path: path23,
|
|
22469
23003
|
resolveApiBaseUrl,
|
|
22470
23004
|
timeoutMs
|
|
22471
23005
|
}) {
|
|
22472
|
-
if (!
|
|
23006
|
+
if (!path23.startsWith("/") || path23.startsWith("//")) {
|
|
22473
23007
|
throw new CliError(
|
|
22474
23008
|
"Authenticated file download path must be relative to the configured Magical API."
|
|
22475
23009
|
);
|
|
22476
23010
|
}
|
|
22477
23011
|
const normalizedApiBaseUrl = trimTrailingSlash(await resolveApiBaseUrl());
|
|
22478
23012
|
const apiBaseResult = safeUrlConstructor(`${normalizedApiBaseUrl}/`);
|
|
22479
|
-
const urlResult = safeUrlConstructor(`${normalizedApiBaseUrl}${
|
|
23013
|
+
const urlResult = safeUrlConstructor(`${normalizedApiBaseUrl}${path23}`);
|
|
22480
23014
|
if (isErr(apiBaseResult) || isErr(urlResult) || urlResult.value.origin !== apiBaseResult.value.origin || !urlResult.value.pathname.startsWith(apiBaseResult.value.pathname)) {
|
|
22481
23015
|
throw new CliError(
|
|
22482
23016
|
"Authenticated file download path must stay within the configured Magical API."
|
|
@@ -22601,11 +23135,11 @@ function createFetchJson({
|
|
|
22601
23135
|
accessToken,
|
|
22602
23136
|
impersonatedOrganizationId,
|
|
22603
23137
|
allowOttoAuthorization,
|
|
22604
|
-
path:
|
|
23138
|
+
path: path23,
|
|
22605
23139
|
init,
|
|
22606
23140
|
organizationId
|
|
22607
23141
|
}) {
|
|
22608
|
-
const url = `${trimTrailingSlash(await resolveApiBaseUrl())}${
|
|
23142
|
+
const url = `${trimTrailingSlash(await resolveApiBaseUrl())}${path23}`;
|
|
22609
23143
|
const usesWorkOSApiKey = isWorkOSApiKey(accessToken);
|
|
22610
23144
|
const headers = new Headers(init?.headers);
|
|
22611
23145
|
applyAuthenticationHeaders({
|
|
@@ -22805,7 +23339,7 @@ function createMagicalApiClient({
|
|
|
22805
23339
|
organizationId,
|
|
22806
23340
|
outputPath,
|
|
22807
23341
|
overwrite = false,
|
|
22808
|
-
path:
|
|
23342
|
+
path: path23,
|
|
22809
23343
|
timeoutMs
|
|
22810
23344
|
}) {
|
|
22811
23345
|
await downloadAuthenticatedFileFromApi({
|
|
@@ -22818,7 +23352,7 @@ function createMagicalApiClient({
|
|
|
22818
23352
|
...maxSizeBytes === void 0 ? {} : { maxSizeBytes },
|
|
22819
23353
|
outputPath,
|
|
22820
23354
|
overwrite,
|
|
22821
|
-
path:
|
|
23355
|
+
path: path23,
|
|
22822
23356
|
resolveApiBaseUrl,
|
|
22823
23357
|
...timeoutMs === void 0 ? {} : { timeoutMs }
|
|
22824
23358
|
});
|
|
@@ -23096,14 +23630,14 @@ function createMagicalApiClient({
|
|
|
23096
23630
|
import { Command, Option } from "commander";
|
|
23097
23631
|
|
|
23098
23632
|
// src/deployment-target.ts
|
|
23099
|
-
import { z as
|
|
23100
|
-
var deploymentPresetSchema =
|
|
23101
|
-
var resolvedDeploymentTargetSchema =
|
|
23102
|
-
apiUrl:
|
|
23103
|
-
platformUrl:
|
|
23633
|
+
import { z as z35 } from "zod";
|
|
23634
|
+
var deploymentPresetSchema = z35.enum(["us", "uk", "stg"]);
|
|
23635
|
+
var resolvedDeploymentTargetSchema = z35.object({
|
|
23636
|
+
apiUrl: z35.url(),
|
|
23637
|
+
platformUrl: z35.url().optional(),
|
|
23104
23638
|
preset: deploymentPresetSchema.optional(),
|
|
23105
|
-
workosApiUrl:
|
|
23106
|
-
workosClientId:
|
|
23639
|
+
workosApiUrl: z35.url(),
|
|
23640
|
+
workosClientId: z35.string().min(1)
|
|
23107
23641
|
});
|
|
23108
23642
|
var WORKOS_API_URL = "https://api.workos.com";
|
|
23109
23643
|
var DEPLOYMENT_PRESETS = {
|
|
@@ -23143,7 +23677,7 @@ function parsePreset(value) {
|
|
|
23143
23677
|
return parsed.data;
|
|
23144
23678
|
}
|
|
23145
23679
|
function normalizeOrigin(value, label) {
|
|
23146
|
-
const parsed =
|
|
23680
|
+
const parsed = z35.url().safeParse(value);
|
|
23147
23681
|
if (!parsed.success) {
|
|
23148
23682
|
throw new CliError(`${label} must be a valid URL.`);
|
|
23149
23683
|
}
|
|
@@ -23919,7 +24453,7 @@ import { createHash, randomUUID as randomUUID2 } from "node:crypto";
|
|
|
23919
24453
|
import path2 from "node:path";
|
|
23920
24454
|
|
|
23921
24455
|
// src/api-key-environment.ts
|
|
23922
|
-
import { z as
|
|
24456
|
+
import { z as z36 } from "zod";
|
|
23923
24457
|
var DEFAULT_API_KEY_ENVIRONMENT_VARIABLE = "MAGICAL_API_KEY";
|
|
23924
24458
|
var ORGANIZATION_API_KEY_ENVIRONMENT_VARIABLE_PREFIX = "MAGICAL_API_KEY_ORG_";
|
|
23925
24459
|
var API_KEY_COMMAND_OPTION_SOURCE = "--api-key";
|
|
@@ -23928,7 +24462,7 @@ var ORGANIZATION_API_KEY_ENVIRONMENT_VARIABLE_PATTERN = new RegExp(
|
|
|
23928
24462
|
`^${ORGANIZATION_API_KEY_ENVIRONMENT_VARIABLE_PREFIX}(${CANONICAL_ULID_PATTERN})$`,
|
|
23929
24463
|
"u"
|
|
23930
24464
|
);
|
|
23931
|
-
var canonicalOrganizationIdSchema =
|
|
24465
|
+
var canonicalOrganizationIdSchema = z36.string().regex(new RegExp(`^org_${CANONICAL_ULID_PATTERN}$`, "u")).brand();
|
|
23932
24466
|
var ParsedApiKeyEnvironmentResult = class {
|
|
23933
24467
|
#defaultCredential;
|
|
23934
24468
|
#organizationCredentials;
|
|
@@ -25111,48 +25645,48 @@ import {
|
|
|
25111
25645
|
unlink
|
|
25112
25646
|
} from "node:fs/promises";
|
|
25113
25647
|
import path3 from "node:path";
|
|
25114
|
-
import { z as
|
|
25648
|
+
import { z as z37 } from "zod";
|
|
25115
25649
|
var OWNER_ONLY_FILE_MODE = 384;
|
|
25116
25650
|
var OWNER_ONLY_DIRECTORY_MODE = 448;
|
|
25117
25651
|
var CHECKPOINT_VERSION2 = 1;
|
|
25118
|
-
var permissionSchema =
|
|
25652
|
+
var permissionSchema = z37.custom(
|
|
25119
25653
|
isMagicalApiKeyPermission
|
|
25120
25654
|
);
|
|
25121
|
-
var checkpointAttemptSchema =
|
|
25122
|
-
attemptId:
|
|
25123
|
-
failureCode:
|
|
25124
|
-
idempotencyKey:
|
|
25125
|
-
keyId:
|
|
25126
|
-
keyOrganizationId:
|
|
25127
|
-
obfuscatedValue:
|
|
25128
|
-
providerName:
|
|
25129
|
-
status:
|
|
25655
|
+
var checkpointAttemptSchema = z37.object({
|
|
25656
|
+
attemptId: z37.string().min(1),
|
|
25657
|
+
failureCode: z37.string().min(1).nullable(),
|
|
25658
|
+
idempotencyKey: z37.string().min(1),
|
|
25659
|
+
keyId: z37.string().min(1).nullable(),
|
|
25660
|
+
keyOrganizationId: z37.string().min(1).nullable().default(null),
|
|
25661
|
+
obfuscatedValue: z37.string().min(1).nullable(),
|
|
25662
|
+
providerName: z37.string().min(1),
|
|
25663
|
+
status: z37.enum(["creating", "exported", "failed", "revoked", "uncertain"])
|
|
25130
25664
|
}).strict();
|
|
25131
|
-
var checkpointTargetSchema =
|
|
25132
|
-
attempts:
|
|
25133
|
-
organizationId:
|
|
25134
|
-
organizationName:
|
|
25135
|
-
outputVariableInitiallyPresent:
|
|
25665
|
+
var checkpointTargetSchema = z37.object({
|
|
25666
|
+
attempts: z37.array(checkpointAttemptSchema),
|
|
25667
|
+
organizationId: z37.string().min(1),
|
|
25668
|
+
organizationName: z37.string().min(1),
|
|
25669
|
+
outputVariableInitiallyPresent: z37.boolean()
|
|
25136
25670
|
}).strict();
|
|
25137
|
-
var cloudSetupCheckpointSchema =
|
|
25138
|
-
allowOverwrite:
|
|
25139
|
-
apiOrigin:
|
|
25140
|
-
checkpointPath:
|
|
25141
|
-
createdAt:
|
|
25142
|
-
defaultAliasInitiallyPresent:
|
|
25143
|
-
defaultOrganizationId:
|
|
25144
|
-
environment:
|
|
25145
|
-
expiresAt:
|
|
25146
|
-
keyName:
|
|
25147
|
-
outputPath:
|
|
25148
|
-
ownerUserId:
|
|
25149
|
-
permissions:
|
|
25150
|
-
purpose:
|
|
25151
|
-
setupId:
|
|
25152
|
-
status:
|
|
25153
|
-
targets:
|
|
25154
|
-
updatedAt:
|
|
25155
|
-
version:
|
|
25671
|
+
var cloudSetupCheckpointSchema = z37.object({
|
|
25672
|
+
allowOverwrite: z37.boolean(),
|
|
25673
|
+
apiOrigin: z37.string().url(),
|
|
25674
|
+
checkpointPath: z37.string().min(1),
|
|
25675
|
+
createdAt: z37.string().datetime(),
|
|
25676
|
+
defaultAliasInitiallyPresent: z37.boolean(),
|
|
25677
|
+
defaultOrganizationId: z37.string().min(1).nullable(),
|
|
25678
|
+
environment: z37.string().min(1),
|
|
25679
|
+
expiresAt: z37.string().datetime().nullable(),
|
|
25680
|
+
keyName: z37.string().min(1),
|
|
25681
|
+
outputPath: z37.string().min(1),
|
|
25682
|
+
ownerUserId: z37.string().min(1),
|
|
25683
|
+
permissions: z37.array(permissionSchema).min(1),
|
|
25684
|
+
purpose: z37.string().min(1),
|
|
25685
|
+
setupId: z37.string().min(1),
|
|
25686
|
+
status: z37.enum(["incomplete", "complete"]),
|
|
25687
|
+
targets: z37.array(checkpointTargetSchema).min(1),
|
|
25688
|
+
updatedAt: z37.string().datetime(),
|
|
25689
|
+
version: z37.literal(CHECKPOINT_VERSION2)
|
|
25156
25690
|
}).strict();
|
|
25157
25691
|
function createCloudSetupFileStorage({
|
|
25158
25692
|
checkpointPath,
|
|
@@ -25556,12 +26090,12 @@ function hasGroupOrWorldWritePermission(mode) {
|
|
|
25556
26090
|
import { createHash as createHash2, randomUUID as randomUUID3 } from "node:crypto";
|
|
25557
26091
|
import { mkdir as mkdir2, readFile as readFile2, rename as rename3, writeFile } from "node:fs/promises";
|
|
25558
26092
|
import path4 from "node:path";
|
|
25559
|
-
import { z as
|
|
25560
|
-
var normalizedApiOriginSchema =
|
|
25561
|
-
var orgPreferencesFileSchema =
|
|
26093
|
+
import { z as z38 } from "zod";
|
|
26094
|
+
var normalizedApiOriginSchema = z38.string().refine(isNormalizedApiOrigin);
|
|
26095
|
+
var orgPreferencesFileSchema = z38.object({
|
|
25562
26096
|
apiOrigin: normalizedApiOriginSchema,
|
|
25563
26097
|
preferredOrganizationId: canonicalOrganizationIdSchema,
|
|
25564
|
-
version:
|
|
26098
|
+
version: z38.literal(1)
|
|
25565
26099
|
}).strict();
|
|
25566
26100
|
function normalizeApiOrigin2(apiBaseUrl) {
|
|
25567
26101
|
const parsedUrl = safeUrlConstructor(apiBaseUrl);
|
|
@@ -26847,7 +27381,7 @@ function getRuntimeConfig() {
|
|
|
26847
27381
|
}
|
|
26848
27382
|
|
|
26849
27383
|
// src/credential-resolver.ts
|
|
26850
|
-
import { z as
|
|
27384
|
+
import { z as z39 } from "zod";
|
|
26851
27385
|
function getRequiredApiKeyPermissions({
|
|
26852
27386
|
policy,
|
|
26853
27387
|
variables
|
|
@@ -26883,7 +27417,7 @@ function getRequiredApiKeyPermissions({
|
|
|
26883
27417
|
}
|
|
26884
27418
|
}
|
|
26885
27419
|
}
|
|
26886
|
-
var recordingIdSchema =
|
|
27420
|
+
var recordingIdSchema = z39.uuid();
|
|
26887
27421
|
var draftRunConfigFieldNames = new Set(
|
|
26888
27422
|
Object.keys(automationRunStartConfigSchema.shape)
|
|
26889
27423
|
);
|
|
@@ -27939,7 +28473,7 @@ function addCaptureCommands({
|
|
|
27939
28473
|
}
|
|
27940
28474
|
|
|
27941
28475
|
// src/capture-operations.ts
|
|
27942
|
-
import { z as
|
|
28476
|
+
import { z as z40 } from "zod";
|
|
27943
28477
|
var START_CAPTURE_SESSION_DOCUMENT = `
|
|
27944
28478
|
mutation MgclStartCaptureSession($automationId: ID!, $idempotencyKey: String!) {
|
|
27945
28479
|
startCaptureSession(automationId: $automationId, idempotencyKey: $idempotencyKey) {
|
|
@@ -27987,7 +28521,7 @@ var CAPTURE_RECORDINGS_DOCUMENT = `
|
|
|
27987
28521
|
}
|
|
27988
28522
|
}
|
|
27989
28523
|
`;
|
|
27990
|
-
var captureRecordingStatusSchema =
|
|
28524
|
+
var captureRecordingStatusSchema = z40.enum([
|
|
27991
28525
|
"recording",
|
|
27992
28526
|
"processing",
|
|
27993
28527
|
"finished",
|
|
@@ -27995,27 +28529,27 @@ var captureRecordingStatusSchema = z38.enum([
|
|
|
27995
28529
|
"failed",
|
|
27996
28530
|
"expired"
|
|
27997
28531
|
]);
|
|
27998
|
-
var optionalTimestampSchema =
|
|
27999
|
-
var captureRecordingMetadataSchema =
|
|
28000
|
-
automationId:
|
|
28532
|
+
var optionalTimestampSchema = z40.string().nullable().optional();
|
|
28533
|
+
var captureRecordingMetadataSchema = z40.object({
|
|
28534
|
+
automationId: z40.string().nullable(),
|
|
28001
28535
|
canceledAt: optionalTimestampSchema,
|
|
28002
|
-
createdAt:
|
|
28003
|
-
createdByUserId:
|
|
28536
|
+
createdAt: z40.string().optional(),
|
|
28537
|
+
createdByUserId: z40.string().nullable().optional(),
|
|
28004
28538
|
expiresAt: optionalTimestampSchema,
|
|
28005
28539
|
finishedAt: optionalTimestampSchema,
|
|
28006
28540
|
processingStartedAt: optionalTimestampSchema,
|
|
28007
|
-
recordingId:
|
|
28008
|
-
startedAt:
|
|
28541
|
+
recordingId: z40.string().min(1),
|
|
28542
|
+
startedAt: z40.string().optional(),
|
|
28009
28543
|
status: captureRecordingStatusSchema,
|
|
28010
28544
|
stoppedAt: optionalTimestampSchema,
|
|
28011
|
-
updatedAt:
|
|
28545
|
+
updatedAt: z40.string().optional()
|
|
28012
28546
|
});
|
|
28013
|
-
var startCaptureSessionSchema =
|
|
28014
|
-
automationId:
|
|
28015
|
-
automationRunId:
|
|
28016
|
-
initialPortalUrl:
|
|
28017
|
-
recordingId:
|
|
28018
|
-
recordingPortalUrl:
|
|
28547
|
+
var startCaptureSessionSchema = z40.object({
|
|
28548
|
+
automationId: z40.string().min(1),
|
|
28549
|
+
automationRunId: z40.string().min(1),
|
|
28550
|
+
initialPortalUrl: z40.url(),
|
|
28551
|
+
recordingId: z40.string().min(1),
|
|
28552
|
+
recordingPortalUrl: z40.url()
|
|
28019
28553
|
});
|
|
28020
28554
|
function parseOrThrow(schema, value, description) {
|
|
28021
28555
|
const result = schema.safeParse(value);
|
|
@@ -28035,7 +28569,7 @@ function parseCaptureRecording(value) {
|
|
|
28035
28569
|
}
|
|
28036
28570
|
function parseCaptureRecordings(value) {
|
|
28037
28571
|
return parseOrThrow(
|
|
28038
|
-
|
|
28572
|
+
z40.array(captureRecordingMetadataSchema),
|
|
28039
28573
|
value,
|
|
28040
28574
|
"Capture recordings"
|
|
28041
28575
|
);
|
|
@@ -28151,19 +28685,19 @@ async function pollCaptureRecording({
|
|
|
28151
28685
|
// src/classify-command.ts
|
|
28152
28686
|
import { readFile as readFile3 } from "node:fs/promises";
|
|
28153
28687
|
import path8 from "node:path";
|
|
28154
|
-
import { z as
|
|
28688
|
+
import { z as z41 } from "zod";
|
|
28155
28689
|
var CLASSIFY_PROVIDERS = ["openai", "typesafe"];
|
|
28156
|
-
var providerSchema =
|
|
28690
|
+
var providerSchema = z41.enum(CLASSIFY_PROVIDERS, {
|
|
28157
28691
|
error: "Provider must be one of openai or typesafe."
|
|
28158
28692
|
});
|
|
28159
|
-
var classifyRequestSchema =
|
|
28160
|
-
model:
|
|
28693
|
+
var classifyRequestSchema = z41.object({
|
|
28694
|
+
model: z41.string().refine((model) => model.trim().length > 0, "Model must not be empty.").optional(),
|
|
28161
28695
|
provider: providerSchema.optional(),
|
|
28162
|
-
questions:
|
|
28696
|
+
questions: z41.record(z41.string(), z41.unknown()).refine(
|
|
28163
28697
|
(questions) => Object.keys(questions).length > 0,
|
|
28164
28698
|
"Questions must contain at least one named question."
|
|
28165
28699
|
),
|
|
28166
|
-
context:
|
|
28700
|
+
context: z41.unknown()
|
|
28167
28701
|
}).passthrough().refine((input) => Object.hasOwn(input, "context"), {
|
|
28168
28702
|
message: "Classify input must include context.",
|
|
28169
28703
|
path: ["context"]
|
|
@@ -28323,50 +28857,50 @@ import { randomUUID as randomUUID4 } from "node:crypto";
|
|
|
28323
28857
|
import { access as access2, readFile as readFile4 } from "node:fs/promises";
|
|
28324
28858
|
import path9 from "node:path";
|
|
28325
28859
|
import { createInterface } from "node:readline/promises";
|
|
28326
|
-
import { z as
|
|
28860
|
+
import { z as z42 } from "zod";
|
|
28327
28861
|
var MAX_AWAIT_REQUEST_MS = 6e4;
|
|
28328
28862
|
var MIN_AWAIT_REQUEST_MS = 1e3;
|
|
28329
28863
|
var EXPORT_POLL_INTERVAL_MS = 1e3;
|
|
28330
|
-
var evalRunStatusSchema2 =
|
|
28864
|
+
var evalRunStatusSchema2 = z42.enum([
|
|
28331
28865
|
"QUEUED",
|
|
28332
28866
|
"RUNNING",
|
|
28333
28867
|
"COMPLETE",
|
|
28334
28868
|
"FAILED",
|
|
28335
28869
|
"CANCELLED"
|
|
28336
28870
|
]);
|
|
28337
|
-
var awaitResultSchema =
|
|
28338
|
-
elapsedMs:
|
|
28339
|
-
evalRun:
|
|
28340
|
-
id:
|
|
28871
|
+
var awaitResultSchema = z42.object({
|
|
28872
|
+
elapsedMs: z42.number().nonnegative(),
|
|
28873
|
+
evalRun: z42.object({
|
|
28874
|
+
id: z42.string().min(1),
|
|
28341
28875
|
status: evalRunStatusSchema2
|
|
28342
28876
|
}).passthrough(),
|
|
28343
|
-
pollCount:
|
|
28344
|
-
reachedTerminal:
|
|
28877
|
+
pollCount: z42.number().int().nonnegative(),
|
|
28878
|
+
reachedTerminal: z42.boolean()
|
|
28345
28879
|
}).passthrough();
|
|
28346
|
-
var planResultSchema =
|
|
28347
|
-
var startResultSchema =
|
|
28348
|
-
evalRunId:
|
|
28349
|
-
idempotencyKey:
|
|
28350
|
-
workflowId:
|
|
28351
|
-
workflowRunId:
|
|
28880
|
+
var planResultSchema = z42.object({ trialCount: z42.number().int().nonnegative() }).passthrough();
|
|
28881
|
+
var startResultSchema = z42.object({
|
|
28882
|
+
evalRunId: z42.string().min(1),
|
|
28883
|
+
idempotencyKey: z42.string().min(1),
|
|
28884
|
+
workflowId: z42.string().min(1),
|
|
28885
|
+
workflowRunId: z42.string().min(1)
|
|
28352
28886
|
}).passthrough();
|
|
28353
|
-
var exportResultSchema =
|
|
28354
|
-
downloadUrl:
|
|
28355
|
-
evalRunId:
|
|
28356
|
-
exportId:
|
|
28357
|
-
status:
|
|
28887
|
+
var exportResultSchema = z42.object({
|
|
28888
|
+
downloadUrl: z42.string().min(1).nullable().optional(),
|
|
28889
|
+
evalRunId: z42.string().min(1),
|
|
28890
|
+
exportId: z42.string().min(1),
|
|
28891
|
+
status: z42.enum(["QUEUED", "RUNNING", "COMPLETE", "FAILED"])
|
|
28358
28892
|
}).passthrough();
|
|
28359
|
-
var inputOptionsSchema =
|
|
28360
|
-
inputFile:
|
|
28361
|
-
inputJson:
|
|
28893
|
+
var inputOptionsSchema = z42.object({
|
|
28894
|
+
inputFile: z42.string().min(1).optional(),
|
|
28895
|
+
inputJson: z42.unknown().optional()
|
|
28362
28896
|
});
|
|
28363
28897
|
var commonRunOptionsSchema = inputOptionsSchema.extend({
|
|
28364
|
-
description:
|
|
28365
|
-
maxConcurrency:
|
|
28366
|
-
name:
|
|
28367
|
-
repeatCount:
|
|
28368
|
-
slug:
|
|
28369
|
-
tags:
|
|
28898
|
+
description: z42.string().min(1).optional(),
|
|
28899
|
+
maxConcurrency: z42.number().int().positive().optional(),
|
|
28900
|
+
name: z42.string().min(1).optional(),
|
|
28901
|
+
repeatCount: z42.number().int().positive().optional(),
|
|
28902
|
+
slug: z42.string().min(1),
|
|
28903
|
+
tags: z42.array(z42.string().min(1)).optional()
|
|
28370
28904
|
});
|
|
28371
28905
|
function parseApiResult(value, schema, label) {
|
|
28372
28906
|
const parsedResult = schema.safeParse(value);
|
|
@@ -28408,7 +28942,7 @@ async function resolveEvalInput({
|
|
|
28408
28942
|
);
|
|
28409
28943
|
}
|
|
28410
28944
|
const input = inputFile === void 0 ? inputJson : await parseInputFile({ inputFile, workingDirectory });
|
|
28411
|
-
const parsedInput =
|
|
28945
|
+
const parsedInput = z42.record(z42.string(), z42.unknown()).safeParse(input);
|
|
28412
28946
|
if (!parsedInput.success) {
|
|
28413
28947
|
throw new CliError("Eval input must be a JSON object.");
|
|
28414
28948
|
}
|
|
@@ -28445,7 +28979,7 @@ function parseDurationMs(value) {
|
|
|
28445
28979
|
);
|
|
28446
28980
|
const amount = Number(match?.groups?.["amount"]);
|
|
28447
28981
|
const multiplierByUnit = { h: 36e5, m: 6e4, ms: 1, s: 1e3 };
|
|
28448
|
-
const parsedUnit =
|
|
28982
|
+
const parsedUnit = z42.enum(["h", "m", "ms", "s"]).safeParse(match?.groups?.["unit"]?.toLowerCase());
|
|
28449
28983
|
const durationMs = parsedUnit.success ? amount * multiplierByUnit[parsedUnit.data] : Number.NaN;
|
|
28450
28984
|
if (!Number.isSafeInteger(durationMs) || durationMs < MIN_AWAIT_REQUEST_MS) {
|
|
28451
28985
|
throw new CliError(
|
|
@@ -28654,10 +29188,10 @@ async function executeStartRegisteredEvalRun({
|
|
|
28654
29188
|
workingDirectory
|
|
28655
29189
|
}) {
|
|
28656
29190
|
const parsedOptions = commonRunOptionsSchema.extend({
|
|
28657
|
-
confirmTrials:
|
|
28658
|
-
idempotencyKey:
|
|
28659
|
-
json:
|
|
28660
|
-
wait:
|
|
29191
|
+
confirmTrials: z42.number().int().positive().optional(),
|
|
29192
|
+
idempotencyKey: z42.string().trim().min(1).optional(),
|
|
29193
|
+
json: z42.boolean().optional(),
|
|
29194
|
+
wait: z42.boolean().optional()
|
|
28661
29195
|
}).parse(options);
|
|
28662
29196
|
const input = await resolveEvalInputFromOptions({
|
|
28663
29197
|
...parsedOptions,
|
|
@@ -28717,7 +29251,7 @@ async function executeAwaitEvalRun({
|
|
|
28717
29251
|
options,
|
|
28718
29252
|
runtime
|
|
28719
29253
|
}) {
|
|
28720
|
-
const parsedOptions =
|
|
29254
|
+
const parsedOptions = z42.object({ id: z42.string().min(1), timeout: z42.string().optional() }).parse(options);
|
|
28721
29255
|
return await awaitEvalRun({
|
|
28722
29256
|
evalRunId: parsedOptions.id,
|
|
28723
29257
|
executeOperation,
|
|
@@ -28736,11 +29270,11 @@ async function executeRequestEvalRunExport({
|
|
|
28736
29270
|
runtime,
|
|
28737
29271
|
workingDirectory
|
|
28738
29272
|
}) {
|
|
28739
|
-
const parsedOptions =
|
|
28740
|
-
force:
|
|
28741
|
-
id:
|
|
28742
|
-
output:
|
|
28743
|
-
wait:
|
|
29273
|
+
const parsedOptions = z42.object({
|
|
29274
|
+
force: z42.boolean().optional(),
|
|
29275
|
+
id: z42.string().min(1),
|
|
29276
|
+
output: z42.string().min(1),
|
|
29277
|
+
wait: z42.boolean().optional()
|
|
28744
29278
|
}).parse(options);
|
|
28745
29279
|
const outputPath = path9.resolve(workingDirectory, parsedOptions.output);
|
|
28746
29280
|
const force = parsedOptions.force === true;
|
|
@@ -28810,22 +29344,22 @@ import { createReadStream as createReadStream2 } from "node:fs";
|
|
|
28810
29344
|
import { stat as stat2 } from "node:fs/promises";
|
|
28811
29345
|
import path10 from "node:path";
|
|
28812
29346
|
import mimeTypes from "mime-types";
|
|
28813
|
-
import { z as
|
|
28814
|
-
var fileUploadIntentSchema =
|
|
28815
|
-
file:
|
|
28816
|
-
checksum:
|
|
28817
|
-
algorithm:
|
|
28818
|
-
value:
|
|
29347
|
+
import { z as z43 } from "zod";
|
|
29348
|
+
var fileUploadIntentSchema = z43.object({
|
|
29349
|
+
file: z43.object({
|
|
29350
|
+
checksum: z43.object({
|
|
29351
|
+
algorithm: z43.literal("CRC32"),
|
|
29352
|
+
value: z43.string().min(1)
|
|
28819
29353
|
}),
|
|
28820
|
-
key:
|
|
28821
|
-
mimeType:
|
|
28822
|
-
name:
|
|
28823
|
-
sizeBytes:
|
|
29354
|
+
key: z43.string().startsWith("s3://"),
|
|
29355
|
+
mimeType: z43.string().min(1),
|
|
29356
|
+
name: z43.string().min(1),
|
|
29357
|
+
sizeBytes: z43.number().int().nonnegative()
|
|
28824
29358
|
}),
|
|
28825
|
-
upload:
|
|
28826
|
-
headers:
|
|
28827
|
-
method:
|
|
28828
|
-
url:
|
|
29359
|
+
upload: z43.object({
|
|
29360
|
+
headers: z43.record(z43.string(), z43.string()),
|
|
29361
|
+
method: z43.literal("PUT"),
|
|
29362
|
+
url: z43.url()
|
|
28829
29363
|
})
|
|
28830
29364
|
});
|
|
28831
29365
|
async function prepareFileUpload(inputPath, workingDirectory) {
|
|
@@ -28915,19 +29449,19 @@ async function handleFileUploadCliOperation(apiClient, intent, prepared) {
|
|
|
28915
29449
|
|
|
28916
29450
|
// src/iteration-media-commands.ts
|
|
28917
29451
|
import path13 from "node:path";
|
|
28918
|
-
import { z as
|
|
29452
|
+
import { z as z46 } from "zod";
|
|
28919
29453
|
|
|
28920
29454
|
// src/file-commands.ts
|
|
28921
29455
|
import path11 from "node:path";
|
|
28922
|
-
import { z as
|
|
28923
|
-
var fileAssetAccessSchema =
|
|
28924
|
-
status:
|
|
29456
|
+
import { z as z44 } from "zod";
|
|
29457
|
+
var fileAssetAccessSchema = z44.object({
|
|
29458
|
+
status: z44.enum([
|
|
28925
29459
|
"AVAILABLE",
|
|
28926
29460
|
"INVALID_KEY",
|
|
28927
29461
|
"NOT_FOUND",
|
|
28928
29462
|
"URL_UNAVAILABLE"
|
|
28929
29463
|
]),
|
|
28930
|
-
url:
|
|
29464
|
+
url: z44.string().url().nullable()
|
|
28931
29465
|
}).superRefine((value, ctx) => {
|
|
28932
29466
|
if (value.status === "AVAILABLE" && value.url === null) {
|
|
28933
29467
|
ctx.addIssue({
|
|
@@ -28937,10 +29471,10 @@ var fileAssetAccessSchema = z42.object({
|
|
|
28937
29471
|
});
|
|
28938
29472
|
}
|
|
28939
29473
|
});
|
|
28940
|
-
var fileCommandOptionsSchema =
|
|
28941
|
-
download:
|
|
28942
|
-
force:
|
|
28943
|
-
key:
|
|
29474
|
+
var fileCommandOptionsSchema = z44.object({
|
|
29475
|
+
download: z44.string().min(1).optional(),
|
|
29476
|
+
force: z44.boolean().optional(),
|
|
29477
|
+
key: z44.string().min(1)
|
|
28944
29478
|
});
|
|
28945
29479
|
function sanitizeDownloadFileName(fileName, fallback = "magical-file.bin") {
|
|
28946
29480
|
const sanitizedFileName = path11.basename(fileName).replaceAll(/[^\p{L}\p{N}._-]/gu, "_").slice(0, 160);
|
|
@@ -29012,18 +29546,18 @@ async function handleFileCliOperation({
|
|
|
29012
29546
|
|
|
29013
29547
|
// src/repository-file-commands.ts
|
|
29014
29548
|
import path12 from "node:path";
|
|
29015
|
-
import { z as
|
|
29549
|
+
import { z as z45 } from "zod";
|
|
29016
29550
|
var repositoryFileOperationNames = /* @__PURE__ */ new Set(["KnowledgeFile", "MemoryFile"]);
|
|
29017
|
-
var repositoryFileOptionsSchema =
|
|
29018
|
-
download:
|
|
29019
|
-
force:
|
|
29020
|
-
key:
|
|
29021
|
-
});
|
|
29022
|
-
var repositoryFileAccessSchema =
|
|
29023
|
-
commit:
|
|
29024
|
-
path:
|
|
29025
|
-
status:
|
|
29026
|
-
url:
|
|
29551
|
+
var repositoryFileOptionsSchema = z45.object({
|
|
29552
|
+
download: z45.string().min(1),
|
|
29553
|
+
force: z45.boolean().optional(),
|
|
29554
|
+
key: z45.string().min(1)
|
|
29555
|
+
});
|
|
29556
|
+
var repositoryFileAccessSchema = z45.object({
|
|
29557
|
+
commit: z45.string().regex(/^[\da-f]{40}$/u).nullable(),
|
|
29558
|
+
path: z45.string().min(1).nullable(),
|
|
29559
|
+
status: z45.enum(["AVAILABLE", "INVALID_KEY", "NOT_FOUND", "UNAVAILABLE"]),
|
|
29560
|
+
url: z45.url().nullable()
|
|
29027
29561
|
}).superRefine((value, ctx) => {
|
|
29028
29562
|
if (value.status === "AVAILABLE" && (value.url === null || value.path === null || value.commit === null)) {
|
|
29029
29563
|
ctx.addIssue({
|
|
@@ -29075,14 +29609,14 @@ async function handleRepositoryFileCliOperation({
|
|
|
29075
29609
|
}
|
|
29076
29610
|
|
|
29077
29611
|
// src/iteration-media-commands.ts
|
|
29078
|
-
var iterationMediaOptionsSchema =
|
|
29079
|
-
download:
|
|
29080
|
-
force:
|
|
29081
|
-
iterationId:
|
|
29082
|
-
mediaId:
|
|
29612
|
+
var iterationMediaOptionsSchema = z46.object({
|
|
29613
|
+
download: z46.string().min(1),
|
|
29614
|
+
force: z46.boolean().optional(),
|
|
29615
|
+
iterationId: z46.uuid(),
|
|
29616
|
+
mediaId: z46.uuid()
|
|
29083
29617
|
});
|
|
29084
|
-
var iterationMediaAccessSchema =
|
|
29085
|
-
downloadPath:
|
|
29618
|
+
var iterationMediaAccessSchema = z46.object({
|
|
29619
|
+
downloadPath: z46.string().min(1)
|
|
29086
29620
|
});
|
|
29087
29621
|
async function handleIterationMediaCliOperation({
|
|
29088
29622
|
accessToken,
|
|
@@ -29236,7 +29770,7 @@ import { spawn } from "node:child_process";
|
|
|
29236
29770
|
import { existsSync } from "node:fs";
|
|
29237
29771
|
import path14 from "node:path";
|
|
29238
29772
|
import { fileURLToPath as fileURLToPath2 } from "node:url";
|
|
29239
|
-
import { z as
|
|
29773
|
+
import { z as z47 } from "zod";
|
|
29240
29774
|
var NETWORK_RECORDING_ARCHIVE_MAX_BYTES = 256 * 1024 * 1024;
|
|
29241
29775
|
var NETWORK_RECORDING_MAX_FLOWS = 2e4;
|
|
29242
29776
|
var NETWORK_RECORDING_MAX_ENCODED_BODY_BYTES = 32 * 1024 * 1024;
|
|
@@ -29248,57 +29782,57 @@ var DEFAULT_MAX_EXCHANGES = 100;
|
|
|
29248
29782
|
var MAX_EXCHANGES = 1e3;
|
|
29249
29783
|
var MAX_HELPER_OUTPUT_BYTES = 1024 * 1024;
|
|
29250
29784
|
var PYTHON_ENVIRONMENT_VARIABLE = "MGCL_MITMPROXY_PYTHON";
|
|
29251
|
-
var archiveIdentitySchema =
|
|
29252
|
-
sha256:
|
|
29253
|
-
sizeBytes:
|
|
29254
|
-
});
|
|
29255
|
-
var bodyMetadataSchema =
|
|
29256
|
-
state:
|
|
29257
|
-
encodedSizeBytes:
|
|
29258
|
-
});
|
|
29259
|
-
var exchangeSchema =
|
|
29260
|
-
exchange:
|
|
29261
|
-
index:
|
|
29262
|
-
method:
|
|
29263
|
-
origin:
|
|
29264
|
-
timestamp:
|
|
29265
|
-
response:
|
|
29266
|
-
status:
|
|
29267
|
-
contentType:
|
|
29785
|
+
var archiveIdentitySchema = z47.object({
|
|
29786
|
+
sha256: z47.string().regex(/^[0-9a-f]{64}$/u),
|
|
29787
|
+
sizeBytes: z47.number().int().nonnegative()
|
|
29788
|
+
});
|
|
29789
|
+
var bodyMetadataSchema = z47.object({
|
|
29790
|
+
state: z47.enum(["PRESENT", "EMPTY", "MISSING"]),
|
|
29791
|
+
encodedSizeBytes: z47.number().int().nonnegative().nullable()
|
|
29792
|
+
});
|
|
29793
|
+
var exchangeSchema = z47.object({
|
|
29794
|
+
exchange: z47.string().regex(/^mitm-v1:[0-9a-f]{64}:[0-9]+$/u),
|
|
29795
|
+
index: z47.number().int().nonnegative(),
|
|
29796
|
+
method: z47.string().min(1),
|
|
29797
|
+
origin: z47.string().min(1),
|
|
29798
|
+
timestamp: z47.string().nullable(),
|
|
29799
|
+
response: z47.object({
|
|
29800
|
+
status: z47.number().int(),
|
|
29801
|
+
contentType: z47.string().nullable(),
|
|
29268
29802
|
body: bodyMetadataSchema
|
|
29269
29803
|
}).nullable()
|
|
29270
29804
|
});
|
|
29271
|
-
var inspectionResultSchema =
|
|
29805
|
+
var inspectionResultSchema = z47.object({
|
|
29272
29806
|
archive: archiveIdentitySchema,
|
|
29273
|
-
exchanges:
|
|
29274
|
-
scan:
|
|
29275
|
-
scannedFlowCount:
|
|
29276
|
-
returnedExchangeCount:
|
|
29277
|
-
complete:
|
|
29278
|
-
resultLimit:
|
|
29279
|
-
flowLimit:
|
|
29280
|
-
truncationReason:
|
|
29807
|
+
exchanges: z47.array(exchangeSchema),
|
|
29808
|
+
scan: z47.object({
|
|
29809
|
+
scannedFlowCount: z47.number().int().nonnegative(),
|
|
29810
|
+
returnedExchangeCount: z47.number().int().nonnegative(),
|
|
29811
|
+
complete: z47.boolean(),
|
|
29812
|
+
resultLimit: z47.number().int().positive(),
|
|
29813
|
+
flowLimit: z47.number().int().positive(),
|
|
29814
|
+
truncationReason: z47.enum(["RESULT_LIMIT", "FLOW_LIMIT"]).nullable()
|
|
29281
29815
|
})
|
|
29282
29816
|
});
|
|
29283
|
-
var extractionResultSchema =
|
|
29817
|
+
var extractionResultSchema = z47.object({
|
|
29284
29818
|
archive: archiveIdentitySchema,
|
|
29285
|
-
exchange:
|
|
29286
|
-
index:
|
|
29287
|
-
response:
|
|
29288
|
-
contentType:
|
|
29289
|
-
sourceContentEncoding:
|
|
29290
|
-
representation:
|
|
29291
|
-
encodedSizeBytes:
|
|
29292
|
-
sizeBytes:
|
|
29293
|
-
sha256:
|
|
29819
|
+
exchange: z47.string().regex(/^mitm-v1:[0-9a-f]{64}:[0-9]+$/u),
|
|
29820
|
+
index: z47.number().int().nonnegative(),
|
|
29821
|
+
response: z47.object({
|
|
29822
|
+
contentType: z47.string().nullable(),
|
|
29823
|
+
sourceContentEncoding: z47.string().nullable(),
|
|
29824
|
+
representation: z47.literal("decoded-entity-body"),
|
|
29825
|
+
encodedSizeBytes: z47.number().int().nonnegative(),
|
|
29826
|
+
sizeBytes: z47.number().int().nonnegative(),
|
|
29827
|
+
sha256: z47.string().regex(/^[0-9a-f]{64}$/u)
|
|
29294
29828
|
}),
|
|
29295
|
-
outputPath:
|
|
29829
|
+
outputPath: z47.string().min(1)
|
|
29296
29830
|
});
|
|
29297
|
-
var helperResponseSchema =
|
|
29298
|
-
|
|
29299
|
-
|
|
29300
|
-
ok:
|
|
29301
|
-
error:
|
|
29831
|
+
var helperResponseSchema = z47.union([
|
|
29832
|
+
z47.object({ ok: z47.literal(true), result: z47.unknown() }),
|
|
29833
|
+
z47.object({
|
|
29834
|
+
ok: z47.literal(false),
|
|
29835
|
+
error: z47.object({ code: z47.string().min(1), message: z47.string().min(1) })
|
|
29302
29836
|
})
|
|
29303
29837
|
]);
|
|
29304
29838
|
var NetworkRecordingParserError = class extends CliError {
|
|
@@ -30206,29 +30740,29 @@ ${formatExamples("Examples", [
|
|
|
30206
30740
|
|
|
30207
30741
|
// src/run-evidence-commands.ts
|
|
30208
30742
|
import { Option as Option5 } from "commander";
|
|
30209
|
-
import { z as
|
|
30743
|
+
import { z as z48 } from "zod";
|
|
30210
30744
|
var ITERATION_PAGE_SIZE = 100;
|
|
30211
30745
|
var MAX_SCANNED_ITERATIONS = 1e4;
|
|
30212
|
-
var automationRunSchema =
|
|
30213
|
-
id:
|
|
30214
|
-
input:
|
|
30746
|
+
var automationRunSchema = z48.object({
|
|
30747
|
+
id: z48.string().min(1),
|
|
30748
|
+
input: z48.unknown().nullable()
|
|
30215
30749
|
}).passthrough();
|
|
30216
|
-
var agentRunSchema =
|
|
30217
|
-
id:
|
|
30218
|
-
input:
|
|
30219
|
-
parentAgentRunId:
|
|
30750
|
+
var agentRunSchema = z48.object({
|
|
30751
|
+
id: z48.string().min(1),
|
|
30752
|
+
input: z48.unknown().nullable(),
|
|
30753
|
+
parentAgentRunId: z48.string().nullable()
|
|
30220
30754
|
}).passthrough();
|
|
30221
|
-
var memorySchema =
|
|
30222
|
-
id:
|
|
30223
|
-
sequence:
|
|
30224
|
-
type:
|
|
30225
|
-
value:
|
|
30755
|
+
var memorySchema = z48.object({
|
|
30756
|
+
id: z48.string().min(1),
|
|
30757
|
+
sequence: z48.number().int(),
|
|
30758
|
+
type: z48.string(),
|
|
30759
|
+
value: z48.unknown()
|
|
30226
30760
|
}).passthrough();
|
|
30227
|
-
var iterationSchema =
|
|
30228
|
-
agentRunId:
|
|
30229
|
-
id:
|
|
30230
|
-
memories:
|
|
30231
|
-
sequence:
|
|
30761
|
+
var iterationSchema = z48.object({
|
|
30762
|
+
agentRunId: z48.string().min(1),
|
|
30763
|
+
id: z48.string().min(1),
|
|
30764
|
+
memories: z48.array(memorySchema),
|
|
30765
|
+
sequence: z48.number().int()
|
|
30232
30766
|
}).passthrough();
|
|
30233
30767
|
var latestIterationSchema = iterationSchema.nullable();
|
|
30234
30768
|
var GET_AUTOMATION_RUN_FILE_INPUT_DOCUMENT = `
|
|
@@ -30383,21 +30917,21 @@ function collectIterationOccurrences(iteration) {
|
|
|
30383
30917
|
function formatRunFiles(result) {
|
|
30384
30918
|
const parsed = parseOperationResult(
|
|
30385
30919
|
result,
|
|
30386
|
-
|
|
30387
|
-
automationRunId:
|
|
30388
|
-
files:
|
|
30389
|
-
|
|
30390
|
-
agentRunId:
|
|
30391
|
-
fieldPath:
|
|
30392
|
-
iterationId:
|
|
30393
|
-
key:
|
|
30394
|
-
role:
|
|
30395
|
-
source:
|
|
30396
|
-
toolName:
|
|
30920
|
+
z48.object({
|
|
30921
|
+
automationRunId: z48.string(),
|
|
30922
|
+
files: z48.array(
|
|
30923
|
+
z48.object({
|
|
30924
|
+
agentRunId: z48.string().nullable(),
|
|
30925
|
+
fieldPath: z48.string(),
|
|
30926
|
+
iterationId: z48.string().nullable(),
|
|
30927
|
+
key: z48.string(),
|
|
30928
|
+
role: z48.string(),
|
|
30929
|
+
source: z48.string(),
|
|
30930
|
+
toolName: z48.string().nullable()
|
|
30397
30931
|
})
|
|
30398
30932
|
),
|
|
30399
|
-
scannedIterationCount:
|
|
30400
|
-
truncated:
|
|
30933
|
+
scannedIterationCount: z48.number(),
|
|
30934
|
+
truncated: z48.boolean()
|
|
30401
30935
|
}),
|
|
30402
30936
|
"Run file inventory"
|
|
30403
30937
|
);
|
|
@@ -30422,9 +30956,9 @@ function formatRunFiles(result) {
|
|
|
30422
30956
|
function formatAgentRunOutput(result) {
|
|
30423
30957
|
const parsed = parseOperationResult(
|
|
30424
30958
|
result,
|
|
30425
|
-
|
|
30426
|
-
output:
|
|
30427
|
-
status:
|
|
30959
|
+
z48.object({
|
|
30960
|
+
output: z48.unknown(),
|
|
30961
|
+
status: z48.enum(["AVAILABLE", "NOT_FOUND"])
|
|
30428
30962
|
}),
|
|
30429
30963
|
"Agent run output"
|
|
30430
30964
|
);
|
|
@@ -30483,7 +31017,7 @@ async function handleAutomationRunFiles({
|
|
|
30483
31017
|
);
|
|
30484
31018
|
const agentRuns = parseOperationResult(
|
|
30485
31019
|
agentRunsResult,
|
|
30486
|
-
|
|
31020
|
+
z48.array(agentRunSchema),
|
|
30487
31021
|
"Automation run agent runs"
|
|
30488
31022
|
);
|
|
30489
31023
|
const iterations = [];
|
|
@@ -30502,7 +31036,7 @@ async function handleAutomationRunFiles({
|
|
|
30502
31036
|
});
|
|
30503
31037
|
const parsedPage = parseOperationResult(
|
|
30504
31038
|
pageResult,
|
|
30505
|
-
|
|
31039
|
+
z48.array(iterationSchema),
|
|
30506
31040
|
"Automation run iterations"
|
|
30507
31041
|
);
|
|
30508
31042
|
iterations.push(...parsedPage);
|
|
@@ -30523,7 +31057,7 @@ async function handleAutomationRunFiles({
|
|
|
30523
31057
|
});
|
|
30524
31058
|
truncated = parseOperationResult(
|
|
30525
31059
|
peekResult,
|
|
30526
|
-
|
|
31060
|
+
z48.array(iterationSchema),
|
|
30527
31061
|
"Automation run iterations"
|
|
30528
31062
|
).length > 0;
|
|
30529
31063
|
}
|
|
@@ -30819,13 +31353,13 @@ async function selfUpdateInstalledCli({
|
|
|
30819
31353
|
// src/settings.ts
|
|
30820
31354
|
import { mkdir as mkdir4, readFile as readFile6, rm as rm4, writeFile as writeFile2 } from "node:fs/promises";
|
|
30821
31355
|
import path18 from "node:path";
|
|
30822
|
-
import { z as
|
|
30823
|
-
var cliSettingsSchema =
|
|
30824
|
-
env:
|
|
30825
|
-
baseUrl:
|
|
30826
|
-
domain:
|
|
30827
|
-
env:
|
|
30828
|
-
workosEnv:
|
|
31356
|
+
import { z as z49 } from "zod";
|
|
31357
|
+
var cliSettingsSchema = z49.object({
|
|
31358
|
+
env: z49.object({
|
|
31359
|
+
baseUrl: z49.url().optional(),
|
|
31360
|
+
domain: z49.url().optional(),
|
|
31361
|
+
env: z49.enum(["us", "uk", "stg"]).optional(),
|
|
31362
|
+
workosEnv: z49.string().min(1).optional()
|
|
30829
31363
|
}).default({})
|
|
30830
31364
|
});
|
|
30831
31365
|
function createEmptyCliSettings() {
|
|
@@ -31049,7 +31583,7 @@ import {
|
|
|
31049
31583
|
} from "node:fs/promises";
|
|
31050
31584
|
import os3 from "node:os";
|
|
31051
31585
|
import path19 from "node:path";
|
|
31052
|
-
import { z as
|
|
31586
|
+
import { z as z50 } from "zod";
|
|
31053
31587
|
var SKILLS_ROOT_PATH = "skills";
|
|
31054
31588
|
var METADATA_DIRECTORY_NAME = "skill-working-copies";
|
|
31055
31589
|
var MAX_GIT_OUTPUT_BYTES = 10 * 1024 * 1024;
|
|
@@ -31058,40 +31592,40 @@ var FULL_COMMIT_SHA_PATTERN = /^[\dA-Fa-f]{40}$/u;
|
|
|
31058
31592
|
var UTF8_ENCODER = new TextEncoder();
|
|
31059
31593
|
var WINDOWS_RESERVED_PATH_CHARACTER_PATTERN = /[<>:"|?*]/u;
|
|
31060
31594
|
var WINDOWS_RESERVED_PATH_NAME_PATTERN = /^(?:AUX|CON|NUL|PRN|COM[1-9]|LPT[1-9])(?:\..*)?$/iu;
|
|
31061
|
-
var skillBundleSchema =
|
|
31062
|
-
files:
|
|
31063
|
-
|
|
31064
|
-
content:
|
|
31065
|
-
encoding:
|
|
31066
|
-
path:
|
|
31067
|
-
size:
|
|
31595
|
+
var skillBundleSchema = z50.object({
|
|
31596
|
+
files: z50.array(
|
|
31597
|
+
z50.object({
|
|
31598
|
+
content: z50.string(),
|
|
31599
|
+
encoding: z50.literal("base64"),
|
|
31600
|
+
path: z50.string().min(1),
|
|
31601
|
+
size: z50.number().int().nonnegative()
|
|
31068
31602
|
})
|
|
31069
31603
|
),
|
|
31070
|
-
path:
|
|
31071
|
-
ref:
|
|
31604
|
+
path: z50.string().min(1),
|
|
31605
|
+
ref: z50.string().regex(FULL_COMMIT_SHA_PATTERN)
|
|
31072
31606
|
});
|
|
31073
|
-
var skillsApplyPatchResultSchema =
|
|
31074
|
-
changedFiles:
|
|
31075
|
-
|
|
31607
|
+
var skillsApplyPatchResultSchema = z50.object({
|
|
31608
|
+
changedFiles: z50.array(
|
|
31609
|
+
z50.object({ path: z50.string().min(1), status: z50.string().min(1) })
|
|
31076
31610
|
),
|
|
31077
|
-
commit:
|
|
31078
|
-
ok:
|
|
31079
|
-
ref:
|
|
31611
|
+
commit: z50.string().regex(FULL_COMMIT_SHA_PATTERN),
|
|
31612
|
+
ok: z50.boolean(),
|
|
31613
|
+
ref: z50.string().min(1)
|
|
31080
31614
|
}).refine((result) => result.ok, {
|
|
31081
31615
|
message: "Skills patch result was not successful."
|
|
31082
31616
|
});
|
|
31083
|
-
var workingCopyMetadataSchema =
|
|
31084
|
-
version:
|
|
31085
|
-
files:
|
|
31086
|
-
|
|
31087
|
-
content:
|
|
31088
|
-
path:
|
|
31617
|
+
var workingCopyMetadataSchema = z50.object({
|
|
31618
|
+
version: z50.literal(1),
|
|
31619
|
+
files: z50.array(
|
|
31620
|
+
z50.object({
|
|
31621
|
+
content: z50.string(),
|
|
31622
|
+
path: z50.string().min(1)
|
|
31089
31623
|
})
|
|
31090
31624
|
),
|
|
31091
|
-
organizationId:
|
|
31092
|
-
requestedRef:
|
|
31093
|
-
skillPath:
|
|
31094
|
-
workingCopyPath:
|
|
31625
|
+
organizationId: z50.string().min(1),
|
|
31626
|
+
requestedRef: z50.string().min(1).nullable(),
|
|
31627
|
+
skillPath: z50.string().min(1),
|
|
31628
|
+
workingCopyPath: z50.string().min(1)
|
|
31095
31629
|
});
|
|
31096
31630
|
function hasControlCharacter2(value) {
|
|
31097
31631
|
return UTF8_ENCODER.encode(value).some((byte) => byte <= 31 || byte === 127);
|
|
@@ -31710,25 +32244,25 @@ async function pushSkillWorkingCopy({
|
|
|
31710
32244
|
// src/state.ts
|
|
31711
32245
|
import { mkdir as mkdir6, readFile as readFile8, rm as rm6, writeFile as writeFile4 } from "node:fs/promises";
|
|
31712
32246
|
import path20 from "node:path";
|
|
31713
|
-
import { z as
|
|
31714
|
-
var cliAccountSchema =
|
|
31715
|
-
clientId:
|
|
31716
|
-
email:
|
|
31717
|
-
userId:
|
|
31718
|
-
});
|
|
31719
|
-
var cliOrganizationSchema =
|
|
31720
|
-
id:
|
|
31721
|
-
name:
|
|
31722
|
-
primaryDomain:
|
|
31723
|
-
});
|
|
31724
|
-
var cliStateSchema =
|
|
32247
|
+
import { z as z51 } from "zod";
|
|
32248
|
+
var cliAccountSchema = z51.object({
|
|
32249
|
+
clientId: z51.string().min(1),
|
|
32250
|
+
email: z51.string().nullable(),
|
|
32251
|
+
userId: z51.string().min(1)
|
|
32252
|
+
});
|
|
32253
|
+
var cliOrganizationSchema = z51.object({
|
|
32254
|
+
id: z51.string().min(1),
|
|
32255
|
+
name: z51.string().min(1),
|
|
32256
|
+
primaryDomain: z51.string().nullable().default(null)
|
|
32257
|
+
});
|
|
32258
|
+
var cliStateSchema = z51.object({
|
|
31725
32259
|
account: cliAccountSchema,
|
|
31726
32260
|
deploymentTarget: resolvedDeploymentTargetSchema.optional(),
|
|
31727
|
-
defaultOrgId:
|
|
31728
|
-
lastUsedOrgId:
|
|
31729
|
-
organizations:
|
|
32261
|
+
defaultOrgId: z51.string().nullable(),
|
|
32262
|
+
lastUsedOrgId: z51.string().nullable(),
|
|
32263
|
+
organizations: z51.array(cliOrganizationSchema)
|
|
31730
32264
|
});
|
|
31731
|
-
var refreshTokenFileSchema =
|
|
32265
|
+
var refreshTokenFileSchema = z51.record(z51.string(), z51.string());
|
|
31732
32266
|
function createFileStateStore(stateFilePath) {
|
|
31733
32267
|
return {
|
|
31734
32268
|
async clear() {
|
|
@@ -31818,38 +32352,120 @@ function buildRefreshTokenKey(account) {
|
|
|
31818
32352
|
return `${account.clientId}:${account.userId}`;
|
|
31819
32353
|
}
|
|
31820
32354
|
|
|
32355
|
+
// src/verification-record-commands.ts
|
|
32356
|
+
import { readFile as readFile9 } from "node:fs/promises";
|
|
32357
|
+
import path21 from "node:path";
|
|
32358
|
+
import { z as z52 } from "zod";
|
|
32359
|
+
var VERIFICATION_RECORD_UPLOAD_OPERATION_NAME = "VerificationRecordUpload";
|
|
32360
|
+
var verificationRecordsSchema = z52.array(z52.record(z52.string(), z52.unknown())).min(1, "Verification record upload must contain at least one record.").max(
|
|
32361
|
+
VERIFICATION_RECORD_UPLOAD_MAX_ITEMS,
|
|
32362
|
+
`Verification record upload must contain at most ${VERIFICATION_RECORD_UPLOAD_MAX_ITEMS} records.`
|
|
32363
|
+
);
|
|
32364
|
+
async function readStdin2() {
|
|
32365
|
+
process.stdin.setEncoding("utf8");
|
|
32366
|
+
let contents = "";
|
|
32367
|
+
for await (const chunk of process.stdin) {
|
|
32368
|
+
if (typeof chunk !== "string") {
|
|
32369
|
+
throw new CliError("Verification record stdin must be UTF-8 text.");
|
|
32370
|
+
}
|
|
32371
|
+
contents += chunk;
|
|
32372
|
+
}
|
|
32373
|
+
return contents;
|
|
32374
|
+
}
|
|
32375
|
+
async function readUploadInput({
|
|
32376
|
+
inputFile,
|
|
32377
|
+
runtime
|
|
32378
|
+
}) {
|
|
32379
|
+
if (inputFile === "-") {
|
|
32380
|
+
return await (runtime.readStdin ?? readStdin2)().catch(
|
|
32381
|
+
(error) => {
|
|
32382
|
+
throw new CliError("Failed to read verification records from stdin.", {
|
|
32383
|
+
cause: error
|
|
32384
|
+
});
|
|
32385
|
+
}
|
|
32386
|
+
);
|
|
32387
|
+
}
|
|
32388
|
+
const inputPath = path21.resolve(
|
|
32389
|
+
runtime.workingDirectory ?? process.cwd(),
|
|
32390
|
+
inputFile
|
|
32391
|
+
);
|
|
32392
|
+
return await readFile9(inputPath, "utf8").catch((error) => {
|
|
32393
|
+
throw new CliError(
|
|
32394
|
+
`Failed to read verification record input file "${inputPath}".`,
|
|
32395
|
+
{ cause: error }
|
|
32396
|
+
);
|
|
32397
|
+
});
|
|
32398
|
+
}
|
|
32399
|
+
async function resolveVerificationRecordOperationVariables({
|
|
32400
|
+
defaultVariables,
|
|
32401
|
+
operationName,
|
|
32402
|
+
options,
|
|
32403
|
+
runtime = {},
|
|
32404
|
+
workingDirectory
|
|
32405
|
+
}) {
|
|
32406
|
+
if (operationName !== VERIFICATION_RECORD_UPLOAD_OPERATION_NAME) {
|
|
32407
|
+
return defaultVariables;
|
|
32408
|
+
}
|
|
32409
|
+
const { inputFile } = options;
|
|
32410
|
+
if (typeof inputFile !== "string" || inputFile.length === 0) {
|
|
32411
|
+
throw new CliError("--input-file must name a JSON file or - for stdin.");
|
|
32412
|
+
}
|
|
32413
|
+
const contents = await readUploadInput({
|
|
32414
|
+
inputFile,
|
|
32415
|
+
runtime: {
|
|
32416
|
+
...runtime,
|
|
32417
|
+
workingDirectory: runtime.workingDirectory ?? workingDirectory
|
|
32418
|
+
}
|
|
32419
|
+
});
|
|
32420
|
+
const parsedJson = safeJsonParseWithoutLogging(contents);
|
|
32421
|
+
if (isErr(parsedJson)) {
|
|
32422
|
+
const source = inputFile === "-" ? "stdin" : `file "${inputFile}"`;
|
|
32423
|
+
throw new CliError(
|
|
32424
|
+
`Verification record input from ${source} must be valid JSON.`,
|
|
32425
|
+
{ cause: parsedJson.error }
|
|
32426
|
+
);
|
|
32427
|
+
}
|
|
32428
|
+
const parsedRecords = verificationRecordsSchema.safeParse(parsedJson.value);
|
|
32429
|
+
if (!parsedRecords.success) {
|
|
32430
|
+
throw new CliError(
|
|
32431
|
+
parsedRecords.error.issues[0]?.message ?? "Verification record input must be a JSON array."
|
|
32432
|
+
);
|
|
32433
|
+
}
|
|
32434
|
+
return { ...defaultVariables, records: parsedRecords.data };
|
|
32435
|
+
}
|
|
32436
|
+
|
|
31821
32437
|
// src/workos-auth.ts
|
|
31822
|
-
import { z as
|
|
32438
|
+
import { z as z53 } from "zod";
|
|
31823
32439
|
var DEFAULT_DEVICE_POLL_INTERVAL_SECONDS = 5;
|
|
31824
32440
|
function buildFormHeaders() {
|
|
31825
32441
|
const headers = new Headers();
|
|
31826
32442
|
headers.set("content-type", "application/x-www-form-urlencoded");
|
|
31827
32443
|
return headers;
|
|
31828
32444
|
}
|
|
31829
|
-
var deviceAuthorizationSchema =
|
|
31830
|
-
device_code:
|
|
31831
|
-
expires_in:
|
|
31832
|
-
interval:
|
|
31833
|
-
user_code:
|
|
31834
|
-
verification_uri:
|
|
31835
|
-
verification_uri_complete:
|
|
31836
|
-
});
|
|
31837
|
-
var tokenResponseSchema =
|
|
31838
|
-
access_token:
|
|
31839
|
-
expires_in:
|
|
31840
|
-
refresh_token:
|
|
31841
|
-
token_type:
|
|
31842
|
-
});
|
|
31843
|
-
var tokenErrorSchema =
|
|
31844
|
-
error:
|
|
31845
|
-
error_description:
|
|
31846
|
-
});
|
|
31847
|
-
var accessTokenClaimsSchema =
|
|
31848
|
-
exp:
|
|
31849
|
-
iss:
|
|
31850
|
-
org_id:
|
|
31851
|
-
sid:
|
|
31852
|
-
sub:
|
|
32445
|
+
var deviceAuthorizationSchema = z53.object({
|
|
32446
|
+
device_code: z53.string().min(1),
|
|
32447
|
+
expires_in: z53.number().int().positive().optional(),
|
|
32448
|
+
interval: z53.number().int().positive().optional(),
|
|
32449
|
+
user_code: z53.string().min(1),
|
|
32450
|
+
verification_uri: z53.url(),
|
|
32451
|
+
verification_uri_complete: z53.url().optional()
|
|
32452
|
+
});
|
|
32453
|
+
var tokenResponseSchema = z53.object({
|
|
32454
|
+
access_token: z53.string().min(1),
|
|
32455
|
+
expires_in: z53.number().int().positive().optional(),
|
|
32456
|
+
refresh_token: z53.string().min(1),
|
|
32457
|
+
token_type: z53.string().optional()
|
|
32458
|
+
});
|
|
32459
|
+
var tokenErrorSchema = z53.object({
|
|
32460
|
+
error: z53.string().min(1),
|
|
32461
|
+
error_description: z53.string().optional()
|
|
32462
|
+
});
|
|
32463
|
+
var accessTokenClaimsSchema = z53.object({
|
|
32464
|
+
exp: z53.number().int().positive().optional(),
|
|
32465
|
+
iss: z53.string().min(1).optional(),
|
|
32466
|
+
org_id: z53.string().min(1).optional(),
|
|
32467
|
+
sid: z53.string().min(1).optional(),
|
|
32468
|
+
sub: z53.string().min(1)
|
|
31853
32469
|
});
|
|
31854
32470
|
function createWorkosAuthClient({
|
|
31855
32471
|
fetchFn = fetch,
|
|
@@ -32140,7 +32756,7 @@ async function handleOperationCommand(dependencies, operationSpec, commandOption
|
|
|
32140
32756
|
commandOptions,
|
|
32141
32757
|
dependencies.workingDirectory ?? process.cwd()
|
|
32142
32758
|
);
|
|
32143
|
-
const
|
|
32759
|
+
const classifiedOperationVariables = await resolveClassifyOperationVariables({
|
|
32144
32760
|
defaultVariables: getFileUploadOperationVariables(
|
|
32145
32761
|
collectOperationVariableInput(operationSpec, commandOptions),
|
|
32146
32762
|
preparedUpload
|
|
@@ -32150,6 +32766,13 @@ async function handleOperationCommand(dependencies, operationSpec, commandOption
|
|
|
32150
32766
|
runtime: dependencies.classifyCommandRuntime,
|
|
32151
32767
|
workingDirectory: dependencies.workingDirectory ?? process.cwd()
|
|
32152
32768
|
});
|
|
32769
|
+
const operationVariables = await resolveVerificationRecordOperationVariables({
|
|
32770
|
+
defaultVariables: classifiedOperationVariables,
|
|
32771
|
+
operationName: operationSpec.operationName,
|
|
32772
|
+
options: commandOptions,
|
|
32773
|
+
runtime: dependencies.verificationRecordCommandRuntime,
|
|
32774
|
+
workingDirectory: dependencies.workingDirectory ?? process.cwd()
|
|
32775
|
+
});
|
|
32153
32776
|
const variables = await resolveOperationVariables({
|
|
32154
32777
|
operationSpec,
|
|
32155
32778
|
variables: operationVariables,
|
|
@@ -32945,12 +33568,12 @@ function createDefaultDependencies() {
|
|
|
32945
33568
|
return resolveDeploymentTarget({ savedEnv: settings.env, selectors });
|
|
32946
33569
|
};
|
|
32947
33570
|
const resolveApiBaseUrl = () => deploymentTargetContext.get().apiUrl;
|
|
32948
|
-
const accessTokenFilePath = runtimeConfig.accessTokenFilePath ??
|
|
32949
|
-
|
|
33571
|
+
const accessTokenFilePath = runtimeConfig.accessTokenFilePath ?? path22.join(
|
|
33572
|
+
path22.dirname(runtimeConfig.stateFilePath),
|
|
32950
33573
|
CLI_ACCESS_TOKEN_FILE_NAME
|
|
32951
33574
|
);
|
|
32952
|
-
const refreshTokenFilePath = runtimeConfig.refreshTokenFilePath ??
|
|
32953
|
-
|
|
33575
|
+
const refreshTokenFilePath = runtimeConfig.refreshTokenFilePath ?? path22.join(
|
|
33576
|
+
path22.dirname(runtimeConfig.stateFilePath),
|
|
32954
33577
|
CLI_REFRESH_TOKEN_FILE_NAME
|
|
32955
33578
|
);
|
|
32956
33579
|
const selfUpdateOptions = {
|
|
@@ -32968,8 +33591,8 @@ function createDefaultDependencies() {
|
|
|
32968
33591
|
io: createConsoleIo(),
|
|
32969
33592
|
openExternalUrl,
|
|
32970
33593
|
orgPreferencesStore: createFileOrgPreferencesStore(
|
|
32971
|
-
|
|
32972
|
-
|
|
33594
|
+
path22.join(
|
|
33595
|
+
path22.dirname(runtimeConfig.stateFilePath),
|
|
32973
33596
|
"organization-preferences"
|
|
32974
33597
|
)
|
|
32975
33598
|
),
|