@wayai/cli 0.3.172 → 0.3.173
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +835 -490
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -447,11 +447,11 @@ function captureException2(error, context) {
|
|
|
447
447
|
Sentry.captureException(error);
|
|
448
448
|
});
|
|
449
449
|
}
|
|
450
|
-
function addApiBreadcrumb(method,
|
|
450
|
+
function addApiBreadcrumb(method, path36) {
|
|
451
451
|
if (!initialized) return;
|
|
452
452
|
Sentry.addBreadcrumb({
|
|
453
453
|
category: "http",
|
|
454
|
-
message: `${method} ${
|
|
454
|
+
message: `${method} ${path36}`,
|
|
455
455
|
level: "info"
|
|
456
456
|
});
|
|
457
457
|
}
|
|
@@ -905,8 +905,8 @@ var init_parseUtil = __esm({
|
|
|
905
905
|
init_errors();
|
|
906
906
|
init_en();
|
|
907
907
|
makeIssue = (params) => {
|
|
908
|
-
const { data, path:
|
|
909
|
-
const fullPath = [...
|
|
908
|
+
const { data, path: path36, errorMaps, issueData } = params;
|
|
909
|
+
const fullPath = [...path36, ...issueData.path || []];
|
|
910
910
|
const fullIssue = {
|
|
911
911
|
...issueData,
|
|
912
912
|
path: fullPath
|
|
@@ -1217,11 +1217,11 @@ var init_types = __esm({
|
|
|
1217
1217
|
init_parseUtil();
|
|
1218
1218
|
init_util();
|
|
1219
1219
|
ParseInputLazyPath = class {
|
|
1220
|
-
constructor(parent, value,
|
|
1220
|
+
constructor(parent, value, path36, key) {
|
|
1221
1221
|
this._cachedPath = [];
|
|
1222
1222
|
this.parent = parent;
|
|
1223
1223
|
this.data = value;
|
|
1224
|
-
this._path =
|
|
1224
|
+
this._path = path36;
|
|
1225
1225
|
this._key = key;
|
|
1226
1226
|
}
|
|
1227
1227
|
get path() {
|
|
@@ -4932,9 +4932,9 @@ function monitorRuleActions(monitorConfig) {
|
|
|
4932
4932
|
if (!monitorConfig || typeof monitorConfig !== "object") return [];
|
|
4933
4933
|
const config = monitorConfig;
|
|
4934
4934
|
const found = [];
|
|
4935
|
-
const visit = (action,
|
|
4935
|
+
const visit = (action, path36) => {
|
|
4936
4936
|
if (!action || typeof action !== "object" || Array.isArray(action)) return;
|
|
4937
|
-
found.push({ action, path:
|
|
4937
|
+
found.push({ action, path: path36 });
|
|
4938
4938
|
};
|
|
4939
4939
|
if (Array.isArray(config.rules)) {
|
|
4940
4940
|
config.rules.forEach((rule, index) => {
|
|
@@ -4951,25 +4951,25 @@ function collectMonitorRuleIssues(monitorConfig) {
|
|
|
4951
4951
|
const trigger = resolveMonitorTrigger(monitorConfig);
|
|
4952
4952
|
const kinds = monitorRuleActionKinds(trigger);
|
|
4953
4953
|
const issues = callUtteranceRuleIssues(monitorConfig);
|
|
4954
|
-
for (const { action, path:
|
|
4955
|
-
if (trigger === "call_utterance" &&
|
|
4954
|
+
for (const { action, path: path36 } of monitorRuleActions(monitorConfig)) {
|
|
4955
|
+
if (trigger === "call_utterance" && path36[0] === "fallback") continue;
|
|
4956
4956
|
const kind = action.kind;
|
|
4957
4957
|
if (typeof kind === "string" && !kinds.includes(kind)) {
|
|
4958
|
-
issues.push({ path: [...
|
|
4958
|
+
issues.push({ path: [...path36, "kind"], message: monitorActionKindMessage(kind, trigger) });
|
|
4959
4959
|
}
|
|
4960
4960
|
const toolName = action.tool_name;
|
|
4961
4961
|
if (kind === "call_tool" && typeof toolName === "string" && isRefusedNativeToolName(toolName, trigger)) {
|
|
4962
|
-
issues.push({ path: [...
|
|
4962
|
+
issues.push({ path: [...path36, "tool_name"], message: monitorRuleToolNotAllowedMessage(toolName, trigger) });
|
|
4963
4963
|
continue;
|
|
4964
4964
|
}
|
|
4965
4965
|
if (kind === "call_tool" && toolName === INSERT_NOTE_TOOL_NAME) {
|
|
4966
|
-
issues.push(...insertNoteArgumentIssues(action,
|
|
4966
|
+
issues.push(...insertNoteArgumentIssues(action, path36));
|
|
4967
4967
|
}
|
|
4968
4968
|
if (kind === "call_tool" && toolName === RUN_MONITOR_TOOL_NAME) {
|
|
4969
4969
|
const callee = readRunMonitorCallee(action);
|
|
4970
4970
|
if (!callee.ok) {
|
|
4971
4971
|
issues.push({
|
|
4972
|
-
path: [...
|
|
4972
|
+
path: [...path36, "args", "monitor_name"],
|
|
4973
4973
|
message: runMonitorCalleeMessage(callee.reason)
|
|
4974
4974
|
});
|
|
4975
4975
|
}
|
|
@@ -5029,11 +5029,11 @@ function insertNoteTemplateMessage(reason) {
|
|
|
5029
5029
|
return `insert_note's template is longer than the ${MONITOR_NOTE_TEMPLATE_MAX}-character limit.`;
|
|
5030
5030
|
}
|
|
5031
5031
|
}
|
|
5032
|
-
function insertNoteArgumentIssues(action,
|
|
5032
|
+
function insertNoteArgumentIssues(action, path36) {
|
|
5033
5033
|
const result = readInsertNoteTemplate(action);
|
|
5034
5034
|
if (result.ok) return [];
|
|
5035
5035
|
return [{
|
|
5036
|
-
path: [...
|
|
5036
|
+
path: [...path36, "args", "template"],
|
|
5037
5037
|
message: insertNoteTemplateMessage(result.reason)
|
|
5038
5038
|
}];
|
|
5039
5039
|
}
|
|
@@ -5063,12 +5063,12 @@ function validateFollowupLinks(followups, label, ctx) {
|
|
|
5063
5063
|
const linkTargets = /* @__PURE__ */ new Set();
|
|
5064
5064
|
followups.forEach((followup, i) => {
|
|
5065
5065
|
const ref = followup?.after_followup_id;
|
|
5066
|
-
const
|
|
5066
|
+
const path36 = ["followups", i, "after_followup_id"];
|
|
5067
5067
|
if (followup?.type !== "inactivity_after_before_event") {
|
|
5068
5068
|
if (ref !== void 0) {
|
|
5069
5069
|
ctx.addIssue({
|
|
5070
5070
|
code: external_exports.ZodIssueCode.custom,
|
|
5071
|
-
path:
|
|
5071
|
+
path: path36,
|
|
5072
5072
|
message: `kanban status ${label}: after_followup_id is only valid on inactivity_after_before_event followups (this one is ${followup?.type})`
|
|
5073
5073
|
});
|
|
5074
5074
|
}
|
|
@@ -5077,7 +5077,7 @@ function validateFollowupLinks(followups, label, ctx) {
|
|
|
5077
5077
|
if (ref === void 0) {
|
|
5078
5078
|
ctx.addIssue({
|
|
5079
5079
|
code: external_exports.ZodIssueCode.custom,
|
|
5080
|
-
path:
|
|
5080
|
+
path: path36,
|
|
5081
5081
|
message: `kanban status ${label}: inactivity_after_before_event requires after_followup_id naming the id of a before_event followup in the same status`
|
|
5082
5082
|
});
|
|
5083
5083
|
return;
|
|
@@ -5087,7 +5087,7 @@ function validateFollowupLinks(followups, label, ctx) {
|
|
|
5087
5087
|
if (matches.length > 1) {
|
|
5088
5088
|
ctx.addIssue({
|
|
5089
5089
|
code: external_exports.ZodIssueCode.custom,
|
|
5090
|
-
path:
|
|
5090
|
+
path: path36,
|
|
5091
5091
|
message: `kanban status ${label}: after_followup_id "${ref}" matches ${matches.length} followups \u2014 a link must name exactly one`
|
|
5092
5092
|
});
|
|
5093
5093
|
return;
|
|
@@ -5099,7 +5099,7 @@ function validateFollowupLinks(followups, label, ctx) {
|
|
|
5099
5099
|
);
|
|
5100
5100
|
ctx.addIssue({
|
|
5101
5101
|
code: external_exports.ZodIssueCode.custom,
|
|
5102
|
-
path:
|
|
5102
|
+
path: path36,
|
|
5103
5103
|
message: hasIdlessBeforeEvent ? `kanban status ${label}: after_followup_id "${ref}" matches no followup \u2014 a link target must declare an explicit id, and this status has before_event followups without one` : `kanban status ${label}: after_followup_id "${ref}" matches no followup in this status`
|
|
5104
5104
|
});
|
|
5105
5105
|
return;
|
|
@@ -5107,7 +5107,7 @@ function validateFollowupLinks(followups, label, ctx) {
|
|
|
5107
5107
|
if (target.type !== "before_event") {
|
|
5108
5108
|
ctx.addIssue({
|
|
5109
5109
|
code: external_exports.ZodIssueCode.custom,
|
|
5110
|
-
path:
|
|
5110
|
+
path: path36,
|
|
5111
5111
|
message: `kanban status ${label}: after_followup_id "${ref}" points at a ${target.type} followup \u2014 only before_event followups can anchor a chain`
|
|
5112
5112
|
});
|
|
5113
5113
|
}
|
|
@@ -5183,12 +5183,12 @@ function typeMatches(typeField, allowed) {
|
|
|
5183
5183
|
if (Array.isArray(typeField)) return typeField.every((t) => typeof t === "string" && allowed.has(t));
|
|
5184
5184
|
return false;
|
|
5185
5185
|
}
|
|
5186
|
-
function validateSchema(schema,
|
|
5186
|
+
function validateSchema(schema, path36, errors, opts = {}) {
|
|
5187
5187
|
if (typeof schema === "boolean") return;
|
|
5188
5188
|
const depth = opts.depth ?? 0;
|
|
5189
5189
|
if (depth > MAX_SCHEMA_DEPTH) {
|
|
5190
5190
|
errors.push({
|
|
5191
|
-
path:
|
|
5191
|
+
path: path36 || "<root>",
|
|
5192
5192
|
message: `schema nesting exceeds ${MAX_SCHEMA_DEPTH} levels`,
|
|
5193
5193
|
suggestion: "Flatten the schema; LLM providers reject deeply nested tool input_schemas."
|
|
5194
5194
|
});
|
|
@@ -5196,7 +5196,7 @@ function validateSchema(schema, path35, errors, opts = {}) {
|
|
|
5196
5196
|
}
|
|
5197
5197
|
if (!isRecord2(schema)) {
|
|
5198
5198
|
errors.push({
|
|
5199
|
-
path:
|
|
5199
|
+
path: path36,
|
|
5200
5200
|
message: `expected object, got ${schema === null ? "null" : typeof schema}`
|
|
5201
5201
|
});
|
|
5202
5202
|
return;
|
|
@@ -5204,14 +5204,14 @@ function validateSchema(schema, path35, errors, opts = {}) {
|
|
|
5204
5204
|
if (opts.isRoot) {
|
|
5205
5205
|
if ("type" in schema && schema.type !== "object") {
|
|
5206
5206
|
errors.push({
|
|
5207
|
-
path:
|
|
5207
|
+
path: path36 ? `${path36}.type` : "type",
|
|
5208
5208
|
message: `root type must be 'object', got ${JSON.stringify(schema.type)}`,
|
|
5209
5209
|
suggestion: "Tool parameters at the root must be an object: `{ type: 'object', properties: { ... } }`."
|
|
5210
5210
|
});
|
|
5211
5211
|
}
|
|
5212
5212
|
} else if ("type" in schema && !typeMatches(schema.type, ALLOWED_TYPES)) {
|
|
5213
5213
|
errors.push({
|
|
5214
|
-
path: `${
|
|
5214
|
+
path: `${path36}.type`,
|
|
5215
5215
|
message: `type must be one of ${[...ALLOWED_TYPES].join("/")} or an array of those, got ${JSON.stringify(schema.type)}`
|
|
5216
5216
|
});
|
|
5217
5217
|
}
|
|
@@ -5221,25 +5221,25 @@ function validateSchema(schema, path35, errors, opts = {}) {
|
|
|
5221
5221
|
const isPlaceholder = PLACEHOLDER_TOKENS.includes(e);
|
|
5222
5222
|
const isOutcomePlaceholder = e === "[KANBAN_OUTCOME_VALUES]";
|
|
5223
5223
|
errors.push({
|
|
5224
|
-
path: `${
|
|
5224
|
+
path: `${path36}.enum`,
|
|
5225
5225
|
message: `enum must be a non-empty array of primitives, got string ${JSON.stringify(e)}`,
|
|
5226
5226
|
suggestion: isOutcomePlaceholder ? "Declare `outcomes` on the hub's terminal kanban status so the platform can render the placeholder into a valid array; with none configured the platform drops the parameter instead." : isPlaceholder ? "Set `operation: 'update_kanban_status'` on the tool and ensure at least one hub.kanban_status has `allowsAgentUpdate: true` so the platform can render the placeholder into a valid array." : 'Wrap the value in an array: `enum: ["value"]`.'
|
|
5227
5227
|
});
|
|
5228
5228
|
} else if (!Array.isArray(e)) {
|
|
5229
5229
|
errors.push({
|
|
5230
|
-
path: `${
|
|
5230
|
+
path: `${path36}.enum`,
|
|
5231
5231
|
message: `enum must be a non-empty array of primitives, got ${typeof e}`
|
|
5232
5232
|
});
|
|
5233
5233
|
} else if (e.length === 0) {
|
|
5234
5234
|
errors.push({
|
|
5235
|
-
path: `${
|
|
5235
|
+
path: `${path36}.enum`,
|
|
5236
5236
|
message: "enum must not be empty"
|
|
5237
5237
|
});
|
|
5238
5238
|
} else {
|
|
5239
5239
|
for (let i = 0; i < e.length; i++) {
|
|
5240
5240
|
if (!isPrimitive(e[i])) {
|
|
5241
5241
|
errors.push({
|
|
5242
|
-
path: `${
|
|
5242
|
+
path: `${path36}.enum[${i}]`,
|
|
5243
5243
|
message: `enum entry must be a primitive (string/number/boolean/null), got ${typeof e[i]}`
|
|
5244
5244
|
});
|
|
5245
5245
|
}
|
|
@@ -5249,7 +5249,7 @@ function validateSchema(schema, path35, errors, opts = {}) {
|
|
|
5249
5249
|
for (const key of ["exclusiveMinimum", "exclusiveMaximum"]) {
|
|
5250
5250
|
if (key in schema && typeof schema[key] === "boolean") {
|
|
5251
5251
|
errors.push({
|
|
5252
|
-
path: `${
|
|
5252
|
+
path: `${path36}.${key}`,
|
|
5253
5253
|
message: `${key} as boolean is draft-04 syntax; draft 2020-12 requires a numeric value`,
|
|
5254
5254
|
suggestion: `Replace with the numeric bound, e.g. \`${key}: 0\`.`
|
|
5255
5255
|
});
|
|
@@ -5258,45 +5258,45 @@ function validateSchema(schema, path35, errors, opts = {}) {
|
|
|
5258
5258
|
if ("properties" in schema) {
|
|
5259
5259
|
if (!isRecord2(schema.properties)) {
|
|
5260
5260
|
errors.push({
|
|
5261
|
-
path: `${
|
|
5261
|
+
path: `${path36}.properties`,
|
|
5262
5262
|
message: `properties must be an object, got ${Array.isArray(schema.properties) ? "array" : typeof schema.properties}`
|
|
5263
5263
|
});
|
|
5264
5264
|
} else {
|
|
5265
5265
|
for (const [propName, propSchema] of Object.entries(schema.properties)) {
|
|
5266
|
-
validateSchema(propSchema, `${
|
|
5266
|
+
validateSchema(propSchema, `${path36}.properties.${propName}`, errors, { depth: depth + 1 });
|
|
5267
5267
|
}
|
|
5268
5268
|
}
|
|
5269
5269
|
}
|
|
5270
5270
|
if (schemaTypeIncludes(schema, "array") && "items" in schema) {
|
|
5271
5271
|
if (Array.isArray(schema.items)) {
|
|
5272
|
-
schema.items.forEach((sub, i) => validateSchema(sub, `${
|
|
5272
|
+
schema.items.forEach((sub, i) => validateSchema(sub, `${path36}.items[${i}]`, errors, { depth: depth + 1 }));
|
|
5273
5273
|
} else {
|
|
5274
|
-
validateSchema(schema.items, `${
|
|
5274
|
+
validateSchema(schema.items, `${path36}.items`, errors, { depth: depth + 1 });
|
|
5275
5275
|
}
|
|
5276
5276
|
}
|
|
5277
5277
|
for (const key of SUBSCHEMA_OBJECT_KEYWORDS) {
|
|
5278
5278
|
if (key in schema && isRecord2(schema[key])) {
|
|
5279
|
-
validateSchema(schema[key], `${
|
|
5279
|
+
validateSchema(schema[key], `${path36}.${key}`, errors, { depth: depth + 1 });
|
|
5280
5280
|
}
|
|
5281
5281
|
}
|
|
5282
5282
|
for (const key of SUBSCHEMA_LIST_KEYWORDS) {
|
|
5283
5283
|
const list = schema[key];
|
|
5284
5284
|
if (Array.isArray(list)) {
|
|
5285
|
-
list.forEach((sub, i) => validateSchema(sub, `${
|
|
5285
|
+
list.forEach((sub, i) => validateSchema(sub, `${path36}.${key}[${i}]`, errors, { depth: depth + 1 }));
|
|
5286
5286
|
}
|
|
5287
5287
|
}
|
|
5288
5288
|
for (const key of SUBSCHEMA_MAP_KEYWORDS) {
|
|
5289
5289
|
const map = schema[key];
|
|
5290
5290
|
if (isRecord2(map)) {
|
|
5291
5291
|
for (const [name, sub] of Object.entries(map)) {
|
|
5292
|
-
validateSchema(sub, `${
|
|
5292
|
+
validateSchema(sub, `${path36}.${key}.${name}`, errors, { depth: depth + 1 });
|
|
5293
5293
|
}
|
|
5294
5294
|
}
|
|
5295
5295
|
}
|
|
5296
5296
|
const reportedPaths = new Set(errors.map((e) => e.path));
|
|
5297
5297
|
for (const [k, v] of Object.entries(schema)) {
|
|
5298
5298
|
if (typeof v !== "string") continue;
|
|
5299
|
-
const fieldPath = `${
|
|
5299
|
+
const fieldPath = `${path36}.${k}`;
|
|
5300
5300
|
if (reportedPaths.has(fieldPath)) continue;
|
|
5301
5301
|
for (const token of PLACEHOLDER_TOKENS) {
|
|
5302
5302
|
if (v === token) {
|
|
@@ -5441,8 +5441,8 @@ function evalInitialStateError(input) {
|
|
|
5441
5441
|
const parsed = evalInitialStateEntry.safeParse(entries[i]);
|
|
5442
5442
|
if (!parsed.success) {
|
|
5443
5443
|
const issue = parsed.error.issues[0];
|
|
5444
|
-
const
|
|
5445
|
-
return `initial_state[${i}].${
|
|
5444
|
+
const path36 = issue?.path.join(".") || "?";
|
|
5445
|
+
return `initial_state[${i}].${path36} is invalid: ${issue?.message ?? "malformed"}`;
|
|
5446
5446
|
}
|
|
5447
5447
|
if (seenSlugs.has(parsed.data.slug)) {
|
|
5448
5448
|
return `initial_state[${i}].slug "${parsed.data.slug}" is declared more than once`;
|
|
@@ -5652,10 +5652,10 @@ function refineHubAsCodeEvals(config, ctx) {
|
|
|
5652
5652
|
function refineHubAsCodeEvalAttachments(config, ctx) {
|
|
5653
5653
|
const cfg = config;
|
|
5654
5654
|
const referencedHashes = /* @__PURE__ */ new Set();
|
|
5655
|
-
const addTurnIssue = (
|
|
5655
|
+
const addTurnIssue = (path36, turn, name) => {
|
|
5656
5656
|
const error = evalTurnAttachmentsError(turn);
|
|
5657
5657
|
if (error) {
|
|
5658
|
-
ctx.addIssue({ code: external_exports.ZodIssueCode.custom, path:
|
|
5658
|
+
ctx.addIssue({ code: external_exports.ZodIssueCode.custom, path: path36, message: `${name}: ${error}` });
|
|
5659
5659
|
return;
|
|
5660
5660
|
}
|
|
5661
5661
|
for (const hash of collectTurnAttachmentHashes(turn)) referencedHashes.add(hash);
|
|
@@ -5723,6 +5723,72 @@ function refineHubAsCodeEvalAttachments(config, ctx) {
|
|
|
5723
5723
|
}
|
|
5724
5724
|
}
|
|
5725
5725
|
}
|
|
5726
|
+
function refineHubAsCodeCallOpenings(config, ctx) {
|
|
5727
|
+
const cfg = config;
|
|
5728
|
+
if (Array.isArray(cfg.agents)) {
|
|
5729
|
+
cfg.agents.forEach((entry, a) => {
|
|
5730
|
+
const agent = entry;
|
|
5731
|
+
const openings = agent?.call_openings;
|
|
5732
|
+
if (openings === void 0 || openings === null) return;
|
|
5733
|
+
const path36 = ["agents", a, "call_openings"];
|
|
5734
|
+
const name = `agent "${typeof agent?.name === "string" ? agent.name : "<unnamed>"}"`;
|
|
5735
|
+
if (typeof openings !== "object" || Array.isArray(openings)) {
|
|
5736
|
+
ctx.addIssue({ code: external_exports.ZodIssueCode.custom, path: path36, message: `${name}: call_openings must map a language to an opening` });
|
|
5737
|
+
return;
|
|
5738
|
+
}
|
|
5739
|
+
if (agent?.role !== "pilot_voice" && Object.keys(openings).length > 0) {
|
|
5740
|
+
ctx.addIssue({ code: external_exports.ZodIssueCode.custom, path: path36, message: `${name}: only a pilot_voice agent has call_openings` });
|
|
5741
|
+
}
|
|
5742
|
+
for (const [language, raw] of Object.entries(openings)) {
|
|
5743
|
+
const at = [...path36, language];
|
|
5744
|
+
if (!callOpeningLanguage.safeParse(language).success) {
|
|
5745
|
+
ctx.addIssue({ code: external_exports.ZodIssueCode.custom, path: at, message: `${name}: call_openings language must be one of ${CALL_OPENING_LANGUAGES.join(", ")}` });
|
|
5746
|
+
continue;
|
|
5747
|
+
}
|
|
5748
|
+
const opening = raw;
|
|
5749
|
+
if (!callOpeningHash.safeParse(opening?.hash).success) {
|
|
5750
|
+
ctx.addIssue({ code: external_exports.ZodIssueCode.custom, path: [...at, "hash"], message: `${name}: call_openings.${language} names no audio file` });
|
|
5751
|
+
}
|
|
5752
|
+
if (!callOpeningCaption.safeParse(opening?.caption).success) {
|
|
5753
|
+
ctx.addIssue({
|
|
5754
|
+
code: external_exports.ZodIssueCode.custom,
|
|
5755
|
+
path: [...at, "caption"],
|
|
5756
|
+
message: `${name}: call_openings.${language}.caption must be 1\u2013${CALL_OPENING_CAPTION_MAX_CHARS} characters`
|
|
5757
|
+
});
|
|
5758
|
+
}
|
|
5759
|
+
}
|
|
5760
|
+
});
|
|
5761
|
+
}
|
|
5762
|
+
const files = cfg.call_opening_files;
|
|
5763
|
+
if (!Array.isArray(files)) return;
|
|
5764
|
+
if (files.length > MAX_CALL_OPENING_CARRIERS) {
|
|
5765
|
+
ctx.addIssue({
|
|
5766
|
+
code: external_exports.ZodIssueCode.custom,
|
|
5767
|
+
path: ["call_opening_files"],
|
|
5768
|
+
message: `too many call opening files (${files.length}); the maximum is ${MAX_CALL_OPENING_CARRIERS}`
|
|
5769
|
+
});
|
|
5770
|
+
}
|
|
5771
|
+
let aggregateEncoded = 0;
|
|
5772
|
+
files.forEach((f, i) => {
|
|
5773
|
+
const b64 = f?.content_base64;
|
|
5774
|
+
if (typeof b64 !== "string") return;
|
|
5775
|
+
aggregateEncoded += b64.length;
|
|
5776
|
+
if (b64.length > MAX_CALL_OPENING_ENCODED_BYTES) {
|
|
5777
|
+
ctx.addIssue({
|
|
5778
|
+
code: external_exports.ZodIssueCode.custom,
|
|
5779
|
+
path: ["call_opening_files", i, "content_base64"],
|
|
5780
|
+
message: "a call opening file exceeds the opening size limit"
|
|
5781
|
+
});
|
|
5782
|
+
}
|
|
5783
|
+
});
|
|
5784
|
+
if (aggregateEncoded > MAX_CALL_OPENING_AGGREGATE_ENCODED_BYTES) {
|
|
5785
|
+
ctx.addIssue({
|
|
5786
|
+
code: external_exports.ZodIssueCode.custom,
|
|
5787
|
+
path: ["call_opening_files"],
|
|
5788
|
+
message: `total call opening bytes exceed the ${MAX_CALL_OPENING_AGGREGATE_ENCODED_BYTES / 1024 / 1024}MB per-push limit`
|
|
5789
|
+
});
|
|
5790
|
+
}
|
|
5791
|
+
}
|
|
5726
5792
|
function utf8ByteLength(value) {
|
|
5727
5793
|
let bytes = 0;
|
|
5728
5794
|
for (let i = 0; i < value.length; i++) {
|
|
@@ -5801,11 +5867,11 @@ function refineHubAsCodeDelegation(config, ctx) {
|
|
|
5801
5867
|
}
|
|
5802
5868
|
}
|
|
5803
5869
|
if (del.context_boundary === void 0) return;
|
|
5804
|
-
const
|
|
5870
|
+
const path36 = ["agents", agentIndex, "tools", "delegation", delIndex, "context_boundary"];
|
|
5805
5871
|
if (del.type !== "hub") {
|
|
5806
5872
|
ctx.addIssue({
|
|
5807
5873
|
code: external_exports.ZodIssueCode.custom,
|
|
5808
|
-
path:
|
|
5874
|
+
path: path36,
|
|
5809
5875
|
message: `context_boundary applies only to \`type: hub\` delegations (got type "${String(del.type)}")`
|
|
5810
5876
|
});
|
|
5811
5877
|
return;
|
|
@@ -5813,7 +5879,7 @@ function refineHubAsCodeDelegation(config, ctx) {
|
|
|
5813
5879
|
if (!CONTEXT_BOUNDARIES.includes(del.context_boundary)) {
|
|
5814
5880
|
ctx.addIssue({
|
|
5815
5881
|
code: external_exports.ZodIssueCode.custom,
|
|
5816
|
-
path:
|
|
5882
|
+
path: path36,
|
|
5817
5883
|
message: `context_boundary must be one of: ${CONTEXT_BOUNDARIES.join(", ")}`
|
|
5818
5884
|
});
|
|
5819
5885
|
}
|
|
@@ -5956,7 +6022,7 @@ function refineHubAsCodeMonitorRulesOutput(config, ctx) {
|
|
|
5956
6022
|
}
|
|
5957
6023
|
});
|
|
5958
6024
|
}
|
|
5959
|
-
var uuidSchema, paginationSchema, timestampSchema, idParamSchema, clientOptionalString, clientOptionalBoolean, clientOptionalNumber, messageAttachment, MAX_MESSAGE_BODY_BYTES, MAX_ATTACHMENTS_PER_MESSAGE, MAX_AUDIO_FILE_BASE64_BYTES, primaryRegionSchema, placementSourceSchema, orgIdParam, orgAdminIdParam, createOrganizationBody, updateOrganizationBody, addOrgAdminBody, AUTH_TYPE, ORG_CREDENTIAL_AUTH_TYPES, AUTH_TYPE_DISPLAY, LEGACY_AUTH_TYPE_MAP, VALID_AUTH_TYPES, AGENT_ROLES, SAFE_USER_ID_REGEX, SUPPORTED_LOCALES, SUMMARIZATION_THRESHOLD_MIN, SUMMARIZATION_THRESHOLD_MAX, PREVIOUS_CONVERSATIONS_MAX, FLAG_CONDITION_OPERATORS, CONFIDENCE_VARIABLE_SUFFIX, DECISION_SCORE_MIN_LEVELS, DECISION_SCORE_MAX_LEVELS, DECISIONS_MODEL_PREFIXES, DECISION_CAPABLE_AGENT_ROLES, NATIVE_TOOL_SCHEMAS, WAYAI_CONNECTOR, BASE_NATIVE_TOOLS, NATIVE_TOOLS, CATALOG_SIDE_EFFECTS, NATIVE_TOOL_NAMES, previousConversationsCountField, summarizationThresholdField, flagConditionSchema, MONITOR_TRIGGERS, monitorTriggerSchema, MONITOR_FIRING_TRIGGERS, MONITOR_DELAY_SECONDS_MIN, MONITOR_IDLE_DELAY_REQUIRED_MESSAGE, MONITOR_HISTORY_MESSAGES_MAX, monitorHistoryMessagesSchema, monitorIncludeToolResultsSchema, MONITOR_INPUT_SHAPING_KEYS, MONITOR_INPUT_SHAPING_SCHEMAS, MONITOR_INPUT_SHAPING_IDLE_MESSAGE, monitorArgumentSourceSchema, MONITOR_NOTE_TEMPLATE_MAX, MONITOR_STEER_NOTE_MAX, monitorActionSchema, monitorRuleSchema, MONITOR_RULE_KEYS, MONITOR_RULE_SCHEMAS, MONITOR_RULE_TRIGGERS, MONITOR_RULE_TRIGGER_MESSAGE, CALL_UTTERANCE_SPEAKERS, callUtteranceSpeakerSchema, MONITOR_CALL_KEYS, MONITOR_CALL_SCHEMAS, MONITOR_CALL_KEY_MESSAGE, CALL_STEERING_MIN_CONFIDENCE, CALL_UTTERANCE_RULE_NOT_CONFIDENT_MESSAGE, CALL_UTTERANCE_FALLBACK_MESSAGE, CALL_UTTERANCE_FLAG_CONDITIONS_MESSAGE, CALL_STEER_NOTE_BLANK_MESSAGE, MONITOR_USER_MESSAGE_ACTION_KINDS, MONITOR_ASSISTANT_REPLY_ACTION_KINDS, MONITOR_CALL_UTTERANCE_ACTION_KINDS, INSERT_NOTE_TOOL_NAME, RUN_MONITOR_TOOL_NAME, MONITOR_RULE_ALLOWED_NATIVE_TOOLS, MONITOR_RULE_REENTRY_TOOLS, MONITOR_RULE_REENTRY_TRACKS, monitorConfigField, flagConditionsField, agentIdParam, listAgentsQuery, agentConnectionsQuery, createAgentBody, updateAgentBody, AGENT_PARAMETER_TYPES, AGENT_PARAMETER_NAME_REGEX, agentParameterCreateSchema, MAX_AGENT_PARAMETERS_PER_REQUEST, createAgentParametersBody, SLUG_REGEX, slugSchema, INVISIBLE_NAME_CHARS, MAX_KANBAN_STATUSES, MAX_FOLLOWUPS_PER_STATUS, MAX_LANES, MAX_ADDITIONAL_CONTEXT_SCHEMA_BYTES, RESERVED_TEMPLATE_DUMP_NAME, kanbanStatusSlugSchema, followupTypeSchema, EVENT_RELATIVE_FOLLOWUP_TYPES, followupTimeUnitSchema, followupIdSchema, SELECTABLE_FOLLOWUP_TYPES, MAX_LINKED_FOLLOWUP_TARGETS_PER_STATUS, followupSchema, MAX_OUTCOMES_PER_STATUS, kanbanOutcomeSchema, EXCLUSIVE_FLAG_PAIRS, kanbanStatusSchema, kanbanStatusesArraySchema, laneSchema, lanesArraySchema, hubIdParam, hubAdminIdParam, hubUserIdParam, hubIdentityIdParam, hubTeamIdParam, hubTeamUserDeleteParam, hubSchemaQuery, PREVIEW_LABEL_MAX_LENGTH, MAX_ENDED_INDEX_RETENTION_DAYS, MAX_EVAL_RETENTION_DAYS, previewLabelField, createHubBody, updateHubBody, addHubAdminBody, addHubIdentityAuthorizationBody, contactDecisionBody, approveContactBody, listContactAccessQuery, createHubTeamBody, updateHubTeamBody, addHubTeamUserBody, reassignHubUserBody, replicatePreviewBody, updateChannelTestIdentitiesBody, claimCodeChannelParam, claimCodeDeleteParam, connectionIdParam, connectorIdParam, listConnectionsQuery, deleteConnectionQuery, addConnectionBody, editConnectionBody, PRODUCTION_DIRECT_FIELDS, setProductionCredentialBody, registerWhatsappQuery, registerWhatsappBody, retryProvisioningQuery, resendDomainStatusQuery, PLACEHOLDER_TOKENS, ALLOWED_TYPES, SUBSCHEMA_OBJECT_KEYWORDS, SUBSCHEMA_LIST_KEYWORDS, SUBSCHEMA_MAP_KEYWORDS, MAX_SCHEMA_DEPTH, toolIdParam, listToolsQuery, toolAgentQuery, deleteToolQuery, toolConnectionsQuery, nativeToolIdSchema, CONTEXT_BOUNDARIES, contextBoundarySchema, addNativeToolBody, addMcpToolBody, createCustomToolBody, updateCustomToolBody, updateToolExecutionConfigBody, initialValueCreateSchema, initialValueUpdateSchema, stateIdParam, listStatesQuery, stateNameSchema, createStateBody, updateStateBody, reorderStatesBody, variantAiModeSchema, experimentStatusSchema, overlayUpdateSchema, experimentIdParam, variantIdParam, listExperimentsQuery, listVariantsQuery, listOverridesQuery, deleteOverrideQuery, createExperimentBody, updateExperimentBody, setExperimentStatusBody, createVariantBody, updateVariantBody, upsertOverrideBody, orgTagIdParam, listOrgTagsQuery, ORG_TAG_NAME_REGEX, ORG_TAG_NAME_MAX_LENGTH, createOrgTagBody, updateOrgTagBody, orgCredentialIdParam, listOrgCredentialsQuery, createOrgCredentialBody, updateOrgCredentialBody, BASE_CREDENTIAL_MANAGED_BY, BASE_CREDENTIAL_NAME_MAX, baseCredentialNameSchema, createBaseCredentialLinkBody, baseCredentialLinkParams, baseCredentialLinkQuery, orgResourceIdParam, orgResourceFileIdParam, orgResourceFolderIdParam, hubOrgResourceParam, listOrgResourcesQuery, orgIdQuery, createOrgResourceBody, updateOrgResourceBody, createOrgResourceFolderBody, updateOrgResourceFolderBody, uploadOrgResourceFileBody, updateOrgResourceFileBody, uploadOrgSkillZipBody, linkOrgResourceBody, resourceIdParam, listResourcesQuery, createResourceBody, updateResourceBody, syncSkillsBody, resourceFileIdParam, listResourceFilesQuery, createResourceFileBody, updateResourceFileBody, uploadResourceFileBody, uploadSkillZipBody, resourceFolderIdParam, listResourceFoldersQuery, createResourceFolderBody, updateResourceFolderBody, agentResourceQuery, hubResourceQuery, linkAgentResourceBody, updateAgentResourceBody, unlinkAgentResourceQuery, navItemSchema, hubCountResetBody, navItemCountResetBody, typingBody, analyticsHubIdParam, analyticsVariableIdParam, updateVariablePinBody, updateAnalyticsViewBody, NUMERIC_FILTER_OPS, TEXT_FILTER_OPS, CATEGORICAL_FILTER_OPS, VARIABLE_FILTER_OPS, STRUCTURED_QUERY_OPS, STRUCTURED_QUERY_AGGREGATIONS, filterValueSchema, conversationsBody, analyticsConversationIdParam, messagesQuery, conversationDetailDataQuery, analyticsDataBody, structuredQueryBody, analyticsSqlBody, analyticsSqlTable, analyticsSqlSchemaQuery, EVAL_PACING_PRESET_NAMES, PACING_INTERVAL_MIN_MS, PACING_INTERVAL_MAX_MS, EVAL_MAX_RUNS_PER_SCENARIO, EVAL_RUN_DEADLINE_MIN_MS, EVAL_RUN_DEADLINE_MAX_MS, ISO_UTC_RE, paginationSchema2, evalIdParam, sessionIdParam, scenarioSetIdParam, hubIdQuery, evalDateContextSchema, EVAL_FIXTURE_NAME_MAX_LENGTH, evalFixtureOverrideSchema, runSessionQuery, runJourneyQuery, EVAL_INPUT_ROLES, EVAL_INPUT_ROLE_LIST, ROLE_ECHO_MAX, EVAL_INITIAL_STATE_SCOPES, MAX_INITIAL_STATE_ENTRIES, evalInitialStateEntry, evalBody, EVAL_LIST_MAX_LIMIT, evalListLimit, getEvalsQuery, toggleEvalBody, bulkToggleEvalsBody, pacingConfigSchema, EVAL_MAX_SELECTED_SCENARIOS, evalScenarioSelectionEntrySchema, evalScenarioSelectionSchema, sessionConfigSchema, createSessionBody, getSessionsQuery, getSessionResultsQuery, getSessionRunsQuery, evalAnalyticsQuery, getSessionCostQuery, compareSessionsQuery, evalsSqlBody, evalsSqlSchemaQuery, exportResultsQuery, validateEvalBody, hubAgentsQuery, createScenarioSetBody, updateScenarioSetBody, scenarioSetsHubQuery, createScenarioFromConversationBody, createJourneyFromConversationBody, EVAL_ATTACHMENT_HASH_REGEX, evalAttachmentRef, turnMayCarryAttachments, ATTACHMENTS_USER_ONLY_MESSAGE, journeyIdParam, journeyToolCallSchema, journeyTurnSchema, journeyStepOverrideSchema, fixtureField, createJourneyBody, updateJourneyBody, evalSessionConfigResponseSchema, evalSessionResponseSchema, evalSessionListConfigSchema, evalSessionListItemSchema, seedReleaseStatusSchema, EVAL_SESSION_NOT_QUIESCENT, getConversationsQuery, getMessagesQuery, appMessageSenderType, appMessageReceiverType, apiChannelMessage, apiChannelMessageBody, appMessageBody, appMessageResponse, CALL_STATUSES, callStatus, CALL_END_REASONS, callEndReason, CALL_TRANSPORTS, callTransport, CALL_PARTICIPANT_TYPES, callParticipantType, callInstant, MAX_SDP_OFFER_LENGTH, sdpDescription, sdpOffer, MAX_CALL_REQUEST_BODY_BYTES, hubScoped, callSummaryFields, callSummary, callIdParam, createCallBody, createCallResponse, callReadyBody, callHangupBody, callStatusQuery, MAX_REPORTED_DELEGATION_IDS, callDelegationId, callDelegationsBody, callResponse, MAX_CALL_RECORDING_GAPS, callRecordingGap, callRecordingNoteMetadata, TTS_VOICE_REPLY_ENABLED_FIELD, COPILOT_TRIGGER_FIELD, AUDIO_LANGUAGE_OPTIONS, whatsapp, instagram, resend, telegram, API_CHANNEL_DELIVERY_EVENTS, apiChannel, OPENAI_REASONING_MODELS, openai, anthropic, googleAiStudio, openRouter, xai, groqStt, openaiStt, elevenLabsStt, openaiTts, groqTts, elevenLabsTts, GEMINI_TTS_VOICES, googleTts, wayai, externalResources, restApiTool, mcpServer, e2b, CLAUDE_HARNESS_MODELS, CLAUDE_HARNESS_MODEL_OPTIONS, HARNESS_MCP_SERVERS_FIELD, HARNESS_EGRESS_FIELDS, claudeAgentSdk, claudeManagedAgents, rekorMemory, SPOKEN_LINE_MAX_CHARS, gptLive, CONNECTORS, evalCallInstant, EVAL_CALL_MIN_SECONDS, EVAL_CALL_MAX_SECONDS, EVAL_CALL_SPOKEN_LINE_MAX_CHARS, hubScoped2, createEvalCallBody, createEvalCallResponse, evalCallConversationQuery, evalCallSpeaker, evalCallUtterance, evalCallTurn, evalCallRecordResponse, evalCallFinishResponse, updateUserBody, updateProfileBody, pathnameRegex, updatePreferencesBody, registerPushTokenBody, deletePushTokenQuery, activityQuery, deletionModeSchema, deletionRequestBody, archiveHubIdParam, archiveConversationParams, archiveListQuery, archiveMessageObservabilityParams, conversationIdParam, claimBody, releaseBody, transferBody, closeBody, additionalContextPayloadSchema, kanbanUpdateBody, annotateConversationBody, observabilityParams, observabilityListParams, deleteUserConversationsBody, deleteUserConversationsResponse, sendMessageBody, listConversationsQuery, flagSourceSchema, getConversationsResponse, getConversationDetailParams, getConversationDetailQuery, getConversationDetailResponse, listWhatsAppTemplatesQuery, sendWhatsAppTemplateBody, copilotSuggestBody, copilotSuggestResponse, CONSULT_THREAD_STATUSES, consultThreadStatus, CONSULT_THREAD_TITLE_MAX, consultThreadTitle, consultThreadSummary, listConsultThreadsQuery, listConsultThreadsResponse, createConsultThreadBody, createConsultThreadResponse, consultThreadIdParam, updateConsultThreadBody, updateConsultThreadResponse, CONSULT_AWAIT_TIMEOUT_MS, billingOrgIdParam, subscriptionItemParams, spendCapBody, growthPacksBody, portalSessionBody, checkoutSessionBody, updateBillingCurrencyBody, invoicesQuery, planKeySchema, billingStatusSchema, billingPlanTypeSchema, dataUsageCountersSchema, REKOR_ENTITLEMENT_CONTRACT_VERSION, entitlementProjectionSchema, rekorEntitlementRefreshMessageSchema, downloadBody, uploadQuery, signUrlBody, outboundSchemaQuery, templateIdParam, listTemplatesQuery, deleteTemplateQuery, templateStatusQuery, createTemplateBody, updateTemplateBody, submitTemplateBody, testTemplateBody, contactIdParam, listContactsQuery, createContactBody, updateContactBody, listIdParam, listListsQuery, listListContactsQuery, createListBody, updateListBody, addListContactsBody, removeListContactsBody, scheduleIdParam, listSchedulesQuery, listExecutionsQuery, createScheduleBody, updateScheduleBody, MAX_RESOURCE_FILE_SIZE, MAX_10MB_BASE64_ENCODED_BYTES, MAX_EVAL_ATTACHMENT_ENCODED_BYTES, MAX_EVAL_ATTACHMENT_CARRIERS, MAX_EVAL_ATTACHMENT_AGGREGATE_ENCODED_BYTES, MAX_RESOURCE_ENCODED_BYTES, MAX_HUB_AS_CODE_RESOURCES, MAX_HUB_AS_CODE_RESOURCE_FILES, MAX_RESOURCE_AGGREGATE_ENCODED_BYTES, MAX_CI_CONFIG_BODY_BYTES, hubAsCodeStateSchema, hubAsCodeResourceFileSchema, hubAsCodeResourceSchema, uuidPattern, ciUuidSchema, boundedHubAsCodeResourcesSchema, hubAsCodeConfigSchema, ciPullHubIdParam, ciBranchParam, ciPullQuery, ciHubsQuery, ciLookupQuery, ciBranchesQuery, ciSyncBody, ciPushBody, ciDiffBody, ciPublishBody, ciPublishPreviewBody, ciSyncMcpBody, ciOrgResourcesParam, orgResourcesConfigSchema, ciOrgResourcesPushBody, ciOrgResourcesDiffBody, CI_APPLY_ENTITY_KINDS, CI_APPLY_OPERATIONS, ciApplyErrorBaseSchema, ciApplyErrorSchema, ciSyncCountSchema, ciSyncChangesSchema, ciSyncWarningSchema, ciSyncResponseSchema, adminOrgIdParam, adminOrgAdminIdParam, adminUserIdParam, PRICING_PLAN_ID_RE, adminPlanIdParam, adminOrganizationsQuery, adminUserSearchQuery, kanbanSlugMigrationQuery, adjustQuotaBody, updatePlanBody, addAdminUserBody, MAX_VOICE_CALL_MINUTE_OPS, voiceCallMinuteOps, updatePlatformConfigBody, updateFreeOrgLimitBody, adminScopedTargetBody, adminRepairLegacyOrgGrantsBody, adminRepairCompedPlansBody, updatePricingPlanBody, dataExplorerSearchQuery, dataExplorerOrgIdParam, dataExplorerHubIdParam, dataExplorerConvIdParam, dataExplorerDoInstancesQuery, dataExplorerNsIdParam, dataExplorerKvKeysBody, dataExplorerKvKeyBody, uuidOrHexId, dataExplorerDeleteOrgParam, dataExplorerDeleteHubParam, dataExplorerDeleteConvParam, dataExplorerDeleteUserParam, dataExplorerDeleteQuery, dataExplorerKvDeleteBody, pitrDoNamespace, pitrBookmarkParam, pitrRestoreBody, healthSamplingTriggerBody, dataExplorerDebugDoType, DEBUG_READ_MAX_LIMIT, DEBUG_READ_DEFAULT_LIMIT, DEBUG_DO_HEX_PREFIX, debugDoEntityId, debugTableName, dataExplorerDebugTablesParam, dataExplorerDebugRowsParam, dataExplorerDebugRowsQuery, dataExplorerDebugAnalyticsTable, debugUuid, dataExplorerDebugAnalyticsRowsParam, dataExplorerDebugAnalyticsRowsQuery, debugHubConvParam, debugMessageIdQuery, sandboxEgressPolicy, SANDBOX_EXEC_MAX_CMD_LENGTH, SANDBOX_EXEC_MAX_ALLOWLIST, SANDBOX_EXEC_MAX_TIMEOUT_MS, adminSandboxExecBody, META_ENTITY_ID_PATTERN, metaEntityId, whatsappCallbackBody, authMeResponse, wsTicketResponse, sessionCheckResponse, logoutResponse, magicCodeSendBody, magicCodeSendResponse, magicCodeVerifyBody, magicCodeVerifyResponse, passwordLoginBody, browserParams, browserFoldersQuery, browserFilesQuery, stateOperationBody, conversationListResourcesQuery, conversationReadResourceQuery, listPendingSchedulesQuery, listHubAggregateSchedulesQuery, reportSourceSchema, intakeReportSourceSchema, reportClassificationSchema, reportStatusSchema, reportLocaleSchema, reportMessageAuthorRoleSchema, reportMessageSchema, sentryRefStatusSchema, createReportBody, editReportBody, reporterReportSummarySchema, reporterListResponseSchema, getReportResponseSchema, reporterTransitionResponseSchema, contestReportBody, reporterListQuery, listReportsQuery, GITHUB_ISSUE_URL_REGEX, githubIssueUrlSchema, transitionReportBody, groupReportsBody, holdReportBody, clickhouseReadyResponse, bootstrapQuery, requestSnapshotChunkMessage, MAX_NAME_LENGTH, MAX_VALUE_LENGTH, MAX_TAGS, MAX_TAG_LENGTH, MAX_SCOPE_HUBS, MAX_SCOPE_TAGS, vaultSecretScopeSchema, vaultCreateBody, vaultUpdateBody, PERMISSIONS, MAX_NAME_LENGTH2, MAX_HUBS_PER_GRANT, MAX_HUB_TAGS_PER_GRANT, MAX_GRANTS, permissionEnum, grantScopeSchema, grantSchema, createTokenBody, tokenOrgIdParam, tokenGrantScopeSchema, tokenGrantSchema, tokenMetadataSchema, listTokensResponse, createTokenResponse, orgTokenSummarySchema, listOrgTokensResponse, invitePreviewQuery, invitePreviewResponse, jsonSchemaSchema, hubUserIdentity, stateValueEntry, getHubUserContextResponse, updateHubUserBody, updateHubUserResponse, unlockHubUserNameResponse, stateResetParams, stateResetResponse, hubAlertsParam, hubAlertSeverity, hubAlert, hubAlertsListResponse, noticeSeveritySchema, noticeStatusSchema, NOTICE_SCOPE_REGEX, noticeScopeSchema, noticeLinkSchema, createNoticeBody, updateNoticeBody, listNoticesQuery, noticeIdParamSchema, ADMIN_SKILL_NAME_REGEX, adminSkillNameParam, REKOR_ACTOR_TYPE_HEADER, REKOR_ACTOR_ID_HEADER, REKOR_ACTOR_LABEL_HEADER, REKOR_ACTOR_ORG_HEADER, REKOR_ACTOR_ADMIN_HEADER, REKOR_CLIENT_HEADER, REKOR_TOOL_ID_HEADER, REKOR_CLIENTS, rekorClientSchema, MAX_REKOR_TOOL_ID_LENGTH, rekorToolIdSchema, DATA_PROXY_MOUNT, DATA_PROXY_PREFIX, REKOR_V1_PREFIX, DATA_PROXY_ORG_QUERY_PARAM, MAX_PROVISIONING_BODY_BYTES, dataProxyQuery, rekorAttestation, REQUIRED_REKOR_ATTESTATION_HEADERS, BASE_DESTRUCTION_MOUNT, BASE_DESTRUCTION_PREFIX, BASE_DESTRUCTION_CONFIRM_PATH, baseDestructionConfirmBody, BASE_DESTRUCTION_GRACE_MS, BASE_DESTRUCTION_CONFIRM_TTL_MS, BASE_DESTRUCTION_ORG_QUERY_PARAM, baseDestructionQuery, baseDestructionParam, baseDestructionInitiateBody, baseDestructionStatus, baseDestructionRequest, baseDestructionListResponse, baseDestructionInitiateResponse, baseDestructionConfirmResponse, baseDestructionCancelResponse, rekorBaseChangeMessageSchema;
|
|
6025
|
+
var uuidSchema, paginationSchema, timestampSchema, idParamSchema, clientOptionalString, clientOptionalBoolean, clientOptionalNumber, messageAttachment, MAX_MESSAGE_BODY_BYTES, MAX_ATTACHMENTS_PER_MESSAGE, MAX_AUDIO_FILE_BASE64_BYTES, primaryRegionSchema, placementSourceSchema, orgIdParam, orgAdminIdParam, createOrganizationBody, updateOrganizationBody, addOrgAdminBody, AUTH_TYPE, ORG_CREDENTIAL_AUTH_TYPES, AUTH_TYPE_DISPLAY, LEGACY_AUTH_TYPE_MAP, VALID_AUTH_TYPES, AGENT_ROLES, SAFE_USER_ID_REGEX, SUPPORTED_LOCALES, SUMMARIZATION_THRESHOLD_MIN, SUMMARIZATION_THRESHOLD_MAX, PREVIOUS_CONVERSATIONS_MAX, FLAG_CONDITION_OPERATORS, CONFIDENCE_VARIABLE_SUFFIX, DECISION_SCORE_MIN_LEVELS, DECISION_SCORE_MAX_LEVELS, DECISIONS_MODEL_PREFIXES, DECISION_CAPABLE_AGENT_ROLES, NATIVE_TOOL_SCHEMAS, WAYAI_CONNECTOR, BASE_NATIVE_TOOLS, NATIVE_TOOLS, CATALOG_SIDE_EFFECTS, NATIVE_TOOL_NAMES, previousConversationsCountField, summarizationThresholdField, flagConditionSchema, MONITOR_TRIGGERS, monitorTriggerSchema, MONITOR_FIRING_TRIGGERS, MONITOR_DELAY_SECONDS_MIN, MONITOR_IDLE_DELAY_REQUIRED_MESSAGE, MONITOR_HISTORY_MESSAGES_MAX, monitorHistoryMessagesSchema, monitorIncludeToolResultsSchema, MONITOR_INPUT_SHAPING_KEYS, MONITOR_INPUT_SHAPING_SCHEMAS, MONITOR_INPUT_SHAPING_IDLE_MESSAGE, monitorArgumentSourceSchema, MONITOR_NOTE_TEMPLATE_MAX, MONITOR_STEER_NOTE_MAX, monitorActionSchema, monitorRuleSchema, MONITOR_RULE_KEYS, MONITOR_RULE_SCHEMAS, MONITOR_RULE_TRIGGERS, MONITOR_RULE_TRIGGER_MESSAGE, CALL_UTTERANCE_SPEAKERS, callUtteranceSpeakerSchema, MONITOR_CALL_KEYS, MONITOR_CALL_SCHEMAS, MONITOR_CALL_KEY_MESSAGE, CALL_STEERING_MIN_CONFIDENCE, CALL_UTTERANCE_RULE_NOT_CONFIDENT_MESSAGE, CALL_UTTERANCE_FALLBACK_MESSAGE, CALL_UTTERANCE_FLAG_CONDITIONS_MESSAGE, CALL_STEER_NOTE_BLANK_MESSAGE, MONITOR_USER_MESSAGE_ACTION_KINDS, MONITOR_ASSISTANT_REPLY_ACTION_KINDS, MONITOR_CALL_UTTERANCE_ACTION_KINDS, INSERT_NOTE_TOOL_NAME, RUN_MONITOR_TOOL_NAME, MONITOR_RULE_ALLOWED_NATIVE_TOOLS, MONITOR_RULE_REENTRY_TOOLS, MONITOR_RULE_REENTRY_TRACKS, monitorConfigField, flagConditionsField, agentIdParam, listAgentsQuery, agentConnectionsQuery, createAgentBody, updateAgentBody, AGENT_PARAMETER_TYPES, AGENT_PARAMETER_NAME_REGEX, agentParameterCreateSchema, MAX_AGENT_PARAMETERS_PER_REQUEST, createAgentParametersBody, SLUG_REGEX, slugSchema, INVISIBLE_NAME_CHARS, MAX_KANBAN_STATUSES, MAX_FOLLOWUPS_PER_STATUS, MAX_LANES, MAX_ADDITIONAL_CONTEXT_SCHEMA_BYTES, RESERVED_TEMPLATE_DUMP_NAME, kanbanStatusSlugSchema, followupTypeSchema, EVENT_RELATIVE_FOLLOWUP_TYPES, followupTimeUnitSchema, followupIdSchema, SELECTABLE_FOLLOWUP_TYPES, MAX_LINKED_FOLLOWUP_TARGETS_PER_STATUS, followupSchema, MAX_OUTCOMES_PER_STATUS, kanbanOutcomeSchema, EXCLUSIVE_FLAG_PAIRS, kanbanStatusSchema, kanbanStatusesArraySchema, laneSchema, lanesArraySchema, hubIdParam, hubAdminIdParam, hubUserIdParam, hubIdentityIdParam, hubTeamIdParam, hubTeamUserDeleteParam, hubSchemaQuery, PREVIEW_LABEL_MAX_LENGTH, MAX_ENDED_INDEX_RETENTION_DAYS, MAX_EVAL_RETENTION_DAYS, previewLabelField, createHubBody, updateHubBody, addHubAdminBody, addHubIdentityAuthorizationBody, contactDecisionBody, approveContactBody, listContactAccessQuery, createHubTeamBody, updateHubTeamBody, addHubTeamUserBody, reassignHubUserBody, replicatePreviewBody, updateChannelTestIdentitiesBody, claimCodeChannelParam, claimCodeDeleteParam, connectionIdParam, connectorIdParam, listConnectionsQuery, deleteConnectionQuery, addConnectionBody, editConnectionBody, PRODUCTION_DIRECT_FIELDS, setProductionCredentialBody, registerWhatsappQuery, registerWhatsappBody, retryProvisioningQuery, resendDomainStatusQuery, PLACEHOLDER_TOKENS, ALLOWED_TYPES, SUBSCHEMA_OBJECT_KEYWORDS, SUBSCHEMA_LIST_KEYWORDS, SUBSCHEMA_MAP_KEYWORDS, MAX_SCHEMA_DEPTH, toolIdParam, listToolsQuery, toolAgentQuery, deleteToolQuery, toolConnectionsQuery, nativeToolIdSchema, CONTEXT_BOUNDARIES, contextBoundarySchema, addNativeToolBody, addMcpToolBody, createCustomToolBody, updateCustomToolBody, updateToolExecutionConfigBody, initialValueCreateSchema, initialValueUpdateSchema, stateIdParam, listStatesQuery, stateNameSchema, createStateBody, updateStateBody, reorderStatesBody, variantAiModeSchema, experimentStatusSchema, overlayUpdateSchema, experimentIdParam, variantIdParam, listExperimentsQuery, listVariantsQuery, listOverridesQuery, deleteOverrideQuery, createExperimentBody, updateExperimentBody, setExperimentStatusBody, createVariantBody, updateVariantBody, upsertOverrideBody, orgTagIdParam, listOrgTagsQuery, ORG_TAG_NAME_REGEX, ORG_TAG_NAME_MAX_LENGTH, createOrgTagBody, updateOrgTagBody, orgCredentialIdParam, listOrgCredentialsQuery, createOrgCredentialBody, updateOrgCredentialBody, BASE_CREDENTIAL_MANAGED_BY, BASE_CREDENTIAL_NAME_MAX, baseCredentialNameSchema, createBaseCredentialLinkBody, baseCredentialLinkParams, baseCredentialLinkQuery, orgResourceIdParam, orgResourceFileIdParam, orgResourceFolderIdParam, hubOrgResourceParam, listOrgResourcesQuery, orgIdQuery, createOrgResourceBody, updateOrgResourceBody, createOrgResourceFolderBody, updateOrgResourceFolderBody, uploadOrgResourceFileBody, updateOrgResourceFileBody, uploadOrgSkillZipBody, linkOrgResourceBody, resourceIdParam, listResourcesQuery, createResourceBody, updateResourceBody, syncSkillsBody, resourceFileIdParam, listResourceFilesQuery, createResourceFileBody, updateResourceFileBody, uploadResourceFileBody, uploadSkillZipBody, resourceFolderIdParam, listResourceFoldersQuery, createResourceFolderBody, updateResourceFolderBody, agentResourceQuery, hubResourceQuery, linkAgentResourceBody, updateAgentResourceBody, unlinkAgentResourceQuery, navItemSchema, hubCountResetBody, navItemCountResetBody, typingBody, analyticsHubIdParam, analyticsVariableIdParam, updateVariablePinBody, updateAnalyticsViewBody, NUMERIC_FILTER_OPS, TEXT_FILTER_OPS, CATEGORICAL_FILTER_OPS, VARIABLE_FILTER_OPS, STRUCTURED_QUERY_OPS, STRUCTURED_QUERY_AGGREGATIONS, filterValueSchema, conversationsBody, analyticsConversationIdParam, messagesQuery, conversationDetailDataQuery, analyticsDataBody, structuredQueryBody, analyticsSqlBody, analyticsSqlTable, analyticsSqlSchemaQuery, EVAL_PACING_PRESET_NAMES, PACING_INTERVAL_MIN_MS, PACING_INTERVAL_MAX_MS, EVAL_MAX_RUNS_PER_SCENARIO, EVAL_RUN_DEADLINE_MIN_MS, EVAL_RUN_DEADLINE_MAX_MS, ISO_UTC_RE, paginationSchema2, evalIdParam, sessionIdParam, scenarioSetIdParam, hubIdQuery, evalDateContextSchema, EVAL_FIXTURE_NAME_MAX_LENGTH, evalFixtureOverrideSchema, runSessionQuery, runJourneyQuery, EVAL_INPUT_ROLES, EVAL_INPUT_ROLE_LIST, ROLE_ECHO_MAX, EVAL_INITIAL_STATE_SCOPES, MAX_INITIAL_STATE_ENTRIES, evalInitialStateEntry, evalBody, EVAL_LIST_MAX_LIMIT, evalListLimit, getEvalsQuery, toggleEvalBody, bulkToggleEvalsBody, pacingConfigSchema, EVAL_MAX_SELECTED_SCENARIOS, evalScenarioSelectionEntrySchema, evalScenarioSelectionSchema, sessionConfigSchema, createSessionBody, getSessionsQuery, getSessionResultsQuery, getSessionRunsQuery, evalAnalyticsQuery, getSessionCostQuery, compareSessionsQuery, evalsSqlBody, evalsSqlSchemaQuery, exportResultsQuery, validateEvalBody, hubAgentsQuery, createScenarioSetBody, updateScenarioSetBody, scenarioSetsHubQuery, createScenarioFromConversationBody, createJourneyFromConversationBody, EVAL_ATTACHMENT_HASH_REGEX, evalAttachmentRef, turnMayCarryAttachments, ATTACHMENTS_USER_ONLY_MESSAGE, journeyIdParam, journeyToolCallSchema, journeyTurnSchema, journeyStepOverrideSchema, fixtureField, createJourneyBody, updateJourneyBody, evalSessionConfigResponseSchema, evalSessionResponseSchema, evalSessionListConfigSchema, evalSessionListItemSchema, seedReleaseStatusSchema, EVAL_SESSION_NOT_QUIESCENT, getConversationsQuery, getMessagesQuery, appMessageSenderType, appMessageReceiverType, apiChannelMessage, apiChannelMessageBody, appMessageBody, appMessageResponse, CALL_STATUSES, callStatus, CALL_END_REASONS, callEndReason, CALL_TRANSPORTS, callTransport, CALL_PARTICIPANT_TYPES, callParticipantType, callInstant, MAX_SDP_OFFER_LENGTH, sdpDescription, sdpOffer, MAX_CALL_REQUEST_BODY_BYTES, hubScoped, callSummaryFields, callSummary, callIdParam, createCallBody, createCallResponse, callReadyBody, callHangupBody, callStatusQuery, MAX_REPORTED_DELEGATION_IDS, callDelegationId, callDelegationsBody, callResponse, MAX_CALL_RECORDING_GAPS, callRecordingGap, callRecordingNoteMetadata, CALL_OPENING_LANGUAGES, callOpeningLanguage, CALL_OPENING_MAX_DURATION_MS, CALL_OPENING_MAX_BYTES, CALL_OPENING_CAPTION_MAX_CHARS, CALL_OPENING_CONTENT_TYPES, callOpeningContentType, CALL_OPENING_HASH_REGEX, callOpeningHash, callOpeningCaption, storedCallOpening, MAX_CALL_OPENING_ENCODED_BYTES, MAX_CALL_OPENING_BODY_BYTES, agentCallOpeningParams, putAgentCallOpeningBody, deleteAgentCallOpeningQuery, callOpeningParam, callOpeningQuery, TTS_VOICE_REPLY_ENABLED_FIELD, COPILOT_TRIGGER_FIELD, AUDIO_LANGUAGE_OPTIONS, whatsapp, instagram, resend, telegram, API_CHANNEL_DELIVERY_EVENTS, apiChannel, OPENAI_REASONING_MODELS, openai, anthropic, googleAiStudio, openRouter, xai, groqStt, openaiStt, elevenLabsStt, openaiTts, groqTts, elevenLabsTts, GEMINI_TTS_VOICES, googleTts, wayai, externalResources, restApiTool, mcpServer, e2b, CLAUDE_HARNESS_MODELS, CLAUDE_HARNESS_MODEL_OPTIONS, HARNESS_MCP_SERVERS_FIELD, HARNESS_EGRESS_FIELDS, claudeAgentSdk, claudeManagedAgents, rekorMemory, SPOKEN_LINE_MAX_CHARS, gptLive, CONNECTORS, evalCallInstant, EVAL_CALL_MIN_SECONDS, EVAL_CALL_MAX_SECONDS, EVAL_CALL_SPOKEN_LINE_MAX_CHARS, hubScoped2, createEvalCallBody, createEvalCallResponse, evalCallConversationQuery, evalCallSpeaker, evalCallUtterance, evalCallTurn, evalCallRecordResponse, evalCallFinishResponse, updateUserBody, updateProfileBody, pathnameRegex, updatePreferencesBody, registerPushTokenBody, deletePushTokenQuery, activityQuery, deletionModeSchema, deletionRequestBody, archiveHubIdParam, archiveConversationParams, archiveListQuery, archiveMessageObservabilityParams, conversationIdParam, claimBody, releaseBody, transferBody, closeBody, additionalContextPayloadSchema, kanbanUpdateBody, annotateConversationBody, observabilityParams, observabilityListParams, deleteUserConversationsBody, deleteUserConversationsResponse, sendMessageBody, listConversationsQuery, flagSourceSchema, getConversationsResponse, getConversationDetailParams, getConversationDetailQuery, getConversationDetailResponse, listWhatsAppTemplatesQuery, sendWhatsAppTemplateBody, copilotSuggestBody, copilotSuggestResponse, CONSULT_THREAD_STATUSES, consultThreadStatus, CONSULT_THREAD_TITLE_MAX, consultThreadTitle, consultThreadSummary, listConsultThreadsQuery, listConsultThreadsResponse, createConsultThreadBody, createConsultThreadResponse, consultThreadIdParam, updateConsultThreadBody, updateConsultThreadResponse, CONSULT_AWAIT_TIMEOUT_MS, billingOrgIdParam, subscriptionItemParams, spendCapBody, growthPacksBody, portalSessionBody, checkoutSessionBody, updateBillingCurrencyBody, invoicesQuery, planKeySchema, billingStatusSchema, billingPlanTypeSchema, dataUsageCountersSchema, REKOR_ENTITLEMENT_CONTRACT_VERSION, entitlementProjectionSchema, rekorEntitlementRefreshMessageSchema, downloadBody, uploadQuery, signUrlBody, outboundSchemaQuery, templateIdParam, listTemplatesQuery, deleteTemplateQuery, templateStatusQuery, createTemplateBody, updateTemplateBody, submitTemplateBody, testTemplateBody, contactIdParam, listContactsQuery, createContactBody, updateContactBody, listIdParam, listListsQuery, listListContactsQuery, createListBody, updateListBody, addListContactsBody, removeListContactsBody, scheduleIdParam, listSchedulesQuery, listExecutionsQuery, createScheduleBody, updateScheduleBody, MAX_RESOURCE_FILE_SIZE, MAX_10MB_BASE64_ENCODED_BYTES, MAX_EVAL_ATTACHMENT_ENCODED_BYTES, MAX_EVAL_ATTACHMENT_CARRIERS, MAX_EVAL_ATTACHMENT_AGGREGATE_ENCODED_BYTES, MAX_RESOURCE_ENCODED_BYTES, MAX_HUB_AS_CODE_RESOURCES, MAX_HUB_AS_CODE_RESOURCE_FILES, MAX_RESOURCE_AGGREGATE_ENCODED_BYTES, MAX_CI_CONFIG_BODY_BYTES, MAX_CALL_OPENING_CARRIERS, MAX_CALL_OPENING_AGGREGATE_ENCODED_BYTES, hubAsCodeStateSchema, hubAsCodeResourceFileSchema, hubAsCodeResourceSchema, uuidPattern, ciUuidSchema, boundedHubAsCodeResourcesSchema, hubAsCodeConfigSchema, ciPullHubIdParam, ciBranchParam, ciPullQuery, ciHubsQuery, ciLookupQuery, ciBranchesQuery, ciSyncBody, ciPushBody, ciDiffBody, ciPublishBody, ciPublishPreviewBody, ciSyncMcpBody, ciOrgResourcesParam, orgResourcesConfigSchema, ciOrgResourcesPushBody, ciOrgResourcesDiffBody, CI_APPLY_ENTITY_KINDS, CI_APPLY_OPERATIONS, ciApplyErrorBaseSchema, ciApplyErrorSchema, ciSyncCountSchema, ciSyncChangesSchema, ciSyncWarningSchema, ciSyncResponseSchema, adminOrgIdParam, adminOrgAdminIdParam, adminUserIdParam, PRICING_PLAN_ID_RE, adminPlanIdParam, adminOrganizationsQuery, adminUserSearchQuery, kanbanSlugMigrationQuery, adjustQuotaBody, updatePlanBody, addAdminUserBody, MAX_VOICE_CALL_MINUTE_OPS, voiceCallMinuteOps, updatePlatformConfigBody, updateFreeOrgLimitBody, adminScopedTargetBody, adminRepairLegacyOrgGrantsBody, adminRepairCompedPlansBody, updatePricingPlanBody, dataExplorerSearchQuery, dataExplorerOrgIdParam, dataExplorerHubIdParam, dataExplorerConvIdParam, dataExplorerDoInstancesQuery, dataExplorerNsIdParam, dataExplorerKvKeysBody, dataExplorerKvKeyBody, uuidOrHexId, dataExplorerDeleteOrgParam, dataExplorerDeleteHubParam, dataExplorerDeleteConvParam, dataExplorerDeleteUserParam, dataExplorerDeleteQuery, dataExplorerKvDeleteBody, pitrDoNamespace, pitrBookmarkParam, pitrRestoreBody, healthSamplingTriggerBody, dataExplorerDebugDoType, DEBUG_READ_MAX_LIMIT, DEBUG_READ_DEFAULT_LIMIT, DEBUG_DO_HEX_PREFIX, debugDoEntityId, debugTableName, dataExplorerDebugTablesParam, dataExplorerDebugRowsParam, dataExplorerDebugRowsQuery, dataExplorerDebugAnalyticsTable, debugUuid, dataExplorerDebugAnalyticsRowsParam, dataExplorerDebugAnalyticsRowsQuery, debugHubConvParam, debugMessageIdQuery, sandboxEgressPolicy, SANDBOX_EXEC_MAX_CMD_LENGTH, SANDBOX_EXEC_MAX_ALLOWLIST, SANDBOX_EXEC_MAX_TIMEOUT_MS, adminSandboxExecBody, META_ENTITY_ID_PATTERN, metaEntityId, whatsappCallbackBody, authMeResponse, wsTicketResponse, sessionCheckResponse, logoutResponse, magicCodeSendBody, magicCodeSendResponse, magicCodeVerifyBody, magicCodeVerifyResponse, passwordLoginBody, browserParams, browserFoldersQuery, browserFilesQuery, stateOperationBody, conversationListResourcesQuery, conversationReadResourceQuery, listPendingSchedulesQuery, listHubAggregateSchedulesQuery, reportSourceSchema, intakeReportSourceSchema, reportClassificationSchema, reportStatusSchema, reportLocaleSchema, reportMessageAuthorRoleSchema, reportMessageSchema, sentryRefStatusSchema, createReportBody, editReportBody, reporterReportSummarySchema, reporterListResponseSchema, getReportResponseSchema, reporterTransitionResponseSchema, contestReportBody, reporterListQuery, listReportsQuery, GITHUB_ISSUE_URL_REGEX, githubIssueUrlSchema, transitionReportBody, groupReportsBody, holdReportBody, clickhouseReadyResponse, bootstrapQuery, requestSnapshotChunkMessage, MAX_NAME_LENGTH, MAX_VALUE_LENGTH, MAX_TAGS, MAX_TAG_LENGTH, MAX_SCOPE_HUBS, MAX_SCOPE_TAGS, vaultSecretScopeSchema, vaultCreateBody, vaultUpdateBody, PERMISSIONS, MAX_NAME_LENGTH2, MAX_HUBS_PER_GRANT, MAX_HUB_TAGS_PER_GRANT, MAX_GRANTS, permissionEnum, grantScopeSchema, grantSchema, createTokenBody, tokenOrgIdParam, tokenGrantScopeSchema, tokenGrantSchema, tokenMetadataSchema, listTokensResponse, createTokenResponse, orgTokenSummarySchema, listOrgTokensResponse, invitePreviewQuery, invitePreviewResponse, jsonSchemaSchema, hubUserIdentity, stateValueEntry, getHubUserContextResponse, updateHubUserBody, updateHubUserResponse, unlockHubUserNameResponse, stateResetParams, stateResetResponse, hubAlertsParam, hubAlertSeverity, hubAlert, hubAlertsListResponse, noticeSeveritySchema, noticeStatusSchema, NOTICE_SCOPE_REGEX, noticeScopeSchema, noticeLinkSchema, createNoticeBody, updateNoticeBody, listNoticesQuery, noticeIdParamSchema, ADMIN_SKILL_NAME_REGEX, adminSkillNameParam, REKOR_ACTOR_TYPE_HEADER, REKOR_ACTOR_ID_HEADER, REKOR_ACTOR_LABEL_HEADER, REKOR_ACTOR_ORG_HEADER, REKOR_ACTOR_ADMIN_HEADER, REKOR_CLIENT_HEADER, REKOR_TOOL_ID_HEADER, REKOR_CLIENTS, rekorClientSchema, MAX_REKOR_TOOL_ID_LENGTH, rekorToolIdSchema, DATA_PROXY_MOUNT, DATA_PROXY_PREFIX, REKOR_V1_PREFIX, DATA_PROXY_ORG_QUERY_PARAM, MAX_PROVISIONING_BODY_BYTES, dataProxyQuery, rekorAttestation, REQUIRED_REKOR_ATTESTATION_HEADERS, BASE_DESTRUCTION_MOUNT, BASE_DESTRUCTION_PREFIX, BASE_DESTRUCTION_CONFIRM_PATH, baseDestructionConfirmBody, BASE_DESTRUCTION_GRACE_MS, BASE_DESTRUCTION_CONFIRM_TTL_MS, BASE_DESTRUCTION_ORG_QUERY_PARAM, baseDestructionQuery, baseDestructionParam, baseDestructionInitiateBody, baseDestructionStatus, baseDestructionRequest, baseDestructionListResponse, baseDestructionInitiateResponse, baseDestructionConfirmResponse, baseDestructionCancelResponse, rekorBaseChangeMessageSchema;
|
|
5960
6026
|
var init_contracts = __esm({
|
|
5961
6027
|
"../../packages/core/dist/contracts/index.js"() {
|
|
5962
6028
|
"use strict";
|
|
@@ -6014,6 +6080,7 @@ var init_contracts = __esm({
|
|
|
6014
6080
|
init_zod();
|
|
6015
6081
|
init_zod();
|
|
6016
6082
|
init_zod();
|
|
6083
|
+
init_zod();
|
|
6017
6084
|
uuidSchema = external_exports.string().uuid();
|
|
6018
6085
|
paginationSchema = external_exports.object({
|
|
6019
6086
|
limit: external_exports.coerce.number().int().min(1).max(100).default(50),
|
|
@@ -8890,6 +8957,51 @@ var init_contracts = __esm({
|
|
|
8890
8957
|
gaps: external_exports.array(callRecordingGap).max(MAX_CALL_RECORDING_GAPS)
|
|
8891
8958
|
})
|
|
8892
8959
|
});
|
|
8960
|
+
CALL_OPENING_LANGUAGES = ["en", "pt", "es"];
|
|
8961
|
+
callOpeningLanguage = external_exports.enum(CALL_OPENING_LANGUAGES);
|
|
8962
|
+
CALL_OPENING_MAX_DURATION_MS = 15e3;
|
|
8963
|
+
CALL_OPENING_MAX_BYTES = 1024 * 1024;
|
|
8964
|
+
CALL_OPENING_CAPTION_MAX_CHARS = 500;
|
|
8965
|
+
CALL_OPENING_CONTENT_TYPES = ["audio/mpeg", "audio/mp4"];
|
|
8966
|
+
callOpeningContentType = external_exports.enum(CALL_OPENING_CONTENT_TYPES);
|
|
8967
|
+
CALL_OPENING_HASH_REGEX = EVAL_ATTACHMENT_HASH_REGEX;
|
|
8968
|
+
callOpeningHash = external_exports.string().regex(CALL_OPENING_HASH_REGEX, "Expected a sha256 hex digest");
|
|
8969
|
+
callOpeningCaption = external_exports.string().trim().min(1).max(CALL_OPENING_CAPTION_MAX_CHARS);
|
|
8970
|
+
storedCallOpening = external_exports.object({
|
|
8971
|
+
hash: callOpeningHash,
|
|
8972
|
+
content_type: callOpeningContentType,
|
|
8973
|
+
duration_ms: external_exports.number().int().positive().max(CALL_OPENING_MAX_DURATION_MS),
|
|
8974
|
+
file_size: external_exports.number().int().positive().max(CALL_OPENING_MAX_BYTES),
|
|
8975
|
+
caption: callOpeningCaption
|
|
8976
|
+
});
|
|
8977
|
+
MAX_CALL_OPENING_ENCODED_BYTES = Math.ceil(CALL_OPENING_MAX_BYTES / 3) * 4 + 16;
|
|
8978
|
+
MAX_CALL_OPENING_BODY_BYTES = MAX_CALL_OPENING_ENCODED_BYTES + 16 * 1024;
|
|
8979
|
+
agentCallOpeningParams = external_exports.object({
|
|
8980
|
+
id: external_exports.string().uuid(),
|
|
8981
|
+
language: callOpeningLanguage
|
|
8982
|
+
});
|
|
8983
|
+
putAgentCallOpeningBody = external_exports.object({
|
|
8984
|
+
hub_id: external_exports.string().uuid(),
|
|
8985
|
+
caption: callOpeningCaption,
|
|
8986
|
+
/**
|
|
8987
|
+
* The audio, base64. Absent: the language's current audio stays and only the caption
|
|
8988
|
+
* changes, which needs an opening already set for the language.
|
|
8989
|
+
*/
|
|
8990
|
+
file_data: external_exports.string().min(1).max(MAX_CALL_OPENING_ENCODED_BYTES).optional()
|
|
8991
|
+
});
|
|
8992
|
+
deleteAgentCallOpeningQuery = external_exports.object({
|
|
8993
|
+
hub_id: external_exports.string().uuid()
|
|
8994
|
+
});
|
|
8995
|
+
callOpeningParam = external_exports.object({ language: callOpeningLanguage });
|
|
8996
|
+
callOpeningQuery = external_exports.object({
|
|
8997
|
+
hub_id: external_exports.string().uuid(),
|
|
8998
|
+
/**
|
|
8999
|
+
* The opening the caller's app was told of (`HubCallOpening.version`, `callOpeningVersion`).
|
|
9000
|
+
* Any other answers 404 — the audio or the caption changed since — and the app plays the
|
|
9001
|
+
* platform's opening, so a caption never shows over audio it does not describe.
|
|
9002
|
+
*/
|
|
9003
|
+
v: external_exports.string().regex(/^[a-f0-9]{64}\.[a-f0-9]{8}$/, "Expected a call opening version")
|
|
9004
|
+
});
|
|
8893
9005
|
TTS_VOICE_REPLY_ENABLED_FIELD = {
|
|
8894
9006
|
voice_reply_enabled: {
|
|
8895
9007
|
type: "toggle",
|
|
@@ -10673,6 +10785,8 @@ var init_contracts = __esm({
|
|
|
10673
10785
|
MAX_HUB_AS_CODE_RESOURCE_FILES = 5e3;
|
|
10674
10786
|
MAX_RESOURCE_AGGREGATE_ENCODED_BYTES = 32 * 1024 * 1024;
|
|
10675
10787
|
MAX_CI_CONFIG_BODY_BYTES = 64 * 1024 * 1024;
|
|
10788
|
+
MAX_CALL_OPENING_CARRIERS = 30;
|
|
10789
|
+
MAX_CALL_OPENING_AGGREGATE_ENCODED_BYTES = 8 * 1024 * 1024;
|
|
10676
10790
|
hubAsCodeStateSchema = external_exports.object({
|
|
10677
10791
|
id: external_exports.string().min(1).optional(),
|
|
10678
10792
|
slug: external_exports.string().optional(),
|
|
@@ -10751,6 +10865,7 @@ var init_contracts = __esm({
|
|
|
10751
10865
|
refineHubAsCodeLanes(config, ctx);
|
|
10752
10866
|
refineHubAsCodeEvals(config, ctx);
|
|
10753
10867
|
refineHubAsCodeEvalAttachments(config, ctx);
|
|
10868
|
+
refineHubAsCodeCallOpenings(config, ctx);
|
|
10754
10869
|
refineHubAsCodeResources(config, ctx);
|
|
10755
10870
|
refineHubAsCodeDelegation(config, ctx);
|
|
10756
10871
|
refineHubAsCodeFlagConditions(config, ctx);
|
|
@@ -11860,10 +11975,10 @@ function toDataProxyPath(v1Path) {
|
|
|
11860
11975
|
}
|
|
11861
11976
|
return `${DATA_PROXY_PREFIX}${v1Path.slice(REKOR_V1_PREFIX.length)}`;
|
|
11862
11977
|
}
|
|
11863
|
-
function withOrgSelector(
|
|
11864
|
-
if (!orgId) return
|
|
11865
|
-
const separator =
|
|
11866
|
-
return `${
|
|
11978
|
+
function withOrgSelector(path36, orgId) {
|
|
11979
|
+
if (!orgId) return path36;
|
|
11980
|
+
const separator = path36.includes("?") ? "&" : "?";
|
|
11981
|
+
return `${path36}${separator}${DATA_PROXY_ORG_QUERY_PARAM}=${encodeURIComponent(orgId)}`;
|
|
11867
11982
|
}
|
|
11868
11983
|
function dataErrorMessage(err) {
|
|
11869
11984
|
if (!(err instanceof ApiError)) return null;
|
|
@@ -11887,7 +12002,7 @@ var init_api_client = __esm({
|
|
|
11887
12002
|
init_sentry();
|
|
11888
12003
|
init_mask_secrets();
|
|
11889
12004
|
RETRYABLE_BACKOFF_MS = [500, 1e3, 2e3];
|
|
11890
|
-
delay = (ms) => new Promise((
|
|
12005
|
+
delay = (ms) => new Promise((resolve11) => setTimeout(resolve11, ms));
|
|
11891
12006
|
ApiError = class extends Error {
|
|
11892
12007
|
status;
|
|
11893
12008
|
body;
|
|
@@ -11897,13 +12012,13 @@ var init_api_client = __esm({
|
|
|
11897
12012
|
* telling them apart by body shape misreads one for the other.
|
|
11898
12013
|
*/
|
|
11899
12014
|
path;
|
|
11900
|
-
constructor(method,
|
|
12015
|
+
constructor(method, path36, status, body) {
|
|
11901
12016
|
const safeBody = maskSecretsInMessage(body);
|
|
11902
|
-
super(`API request failed: ${method} ${
|
|
12017
|
+
super(`API request failed: ${method} ${path36} (${status}): ${safeBody}`);
|
|
11903
12018
|
this.name = "ApiError";
|
|
11904
12019
|
this.status = status;
|
|
11905
12020
|
this.body = safeBody;
|
|
11906
|
-
this.path =
|
|
12021
|
+
this.path = path36;
|
|
11907
12022
|
}
|
|
11908
12023
|
/** True when the status code is a 4xx client error (expected user-facing condition, not a bug). */
|
|
11909
12024
|
get isExpected() {
|
|
@@ -12007,8 +12122,8 @@ var init_api_client = __esm({
|
|
|
12007
12122
|
...opts?.check && { check: true }
|
|
12008
12123
|
});
|
|
12009
12124
|
}
|
|
12010
|
-
async lookup(
|
|
12011
|
-
const params = new URLSearchParams({ path:
|
|
12125
|
+
async lookup(path36, opts) {
|
|
12126
|
+
const params = new URLSearchParams({ path: path36 });
|
|
12012
12127
|
if (opts?.organizationId) params.set("organization_id", opts.organizationId);
|
|
12013
12128
|
return this.request("GET", `/api/ci/lookup?${params.toString()}`);
|
|
12014
12129
|
}
|
|
@@ -12486,9 +12601,9 @@ var init_api_client = __esm({
|
|
|
12486
12601
|
* sandbox for this conversation, or the blob was purged).
|
|
12487
12602
|
*/
|
|
12488
12603
|
async downloadArchiveSandboxFs(hubId, conversationId) {
|
|
12489
|
-
const
|
|
12490
|
-
addApiBreadcrumb("GET",
|
|
12491
|
-
const url = `${this.apiUrl}${
|
|
12604
|
+
const path36 = `/api/archive/${encodeURIComponent(hubId)}/conversations/${encodeURIComponent(conversationId)}/sandbox`;
|
|
12605
|
+
addApiBreadcrumb("GET", path36);
|
|
12606
|
+
const url = `${this.apiUrl}${path36}`;
|
|
12492
12607
|
let response = await this.send(url, "GET");
|
|
12493
12608
|
if (response.status === 401 && this.onUnauthorized) {
|
|
12494
12609
|
let refreshed;
|
|
@@ -12502,7 +12617,7 @@ var init_api_client = __esm({
|
|
|
12502
12617
|
}
|
|
12503
12618
|
}
|
|
12504
12619
|
if (!response.ok) {
|
|
12505
|
-
throw new ApiError("GET",
|
|
12620
|
+
throw new ApiError("GET", path36, response.status, await response.text());
|
|
12506
12621
|
}
|
|
12507
12622
|
return new Uint8Array(await response.arrayBuffer());
|
|
12508
12623
|
}
|
|
@@ -12542,9 +12657,9 @@ var init_api_client = __esm({
|
|
|
12542
12657
|
`/api/admin/data-explorer/debug/observability/${encodeURIComponent(hubId)}/conversations/${encodeURIComponent(conversationId)}${qs}`
|
|
12543
12658
|
);
|
|
12544
12659
|
}
|
|
12545
|
-
async request(method,
|
|
12546
|
-
addApiBreadcrumb(method,
|
|
12547
|
-
const url = `${this.apiUrl}${
|
|
12660
|
+
async request(method, path36, body, extraHeaders, contentType) {
|
|
12661
|
+
addApiBreadcrumb(method, path36);
|
|
12662
|
+
const url = `${this.apiUrl}${path36}`;
|
|
12548
12663
|
let refreshedOn401 = false;
|
|
12549
12664
|
for (let retry = 0; ; retry++) {
|
|
12550
12665
|
let response = await this.send(url, method, body, extraHeaders, contentType);
|
|
@@ -12569,7 +12684,7 @@ var init_api_client = __esm({
|
|
|
12569
12684
|
await delay(RETRYABLE_BACKOFF_MS[retry]);
|
|
12570
12685
|
continue;
|
|
12571
12686
|
}
|
|
12572
|
-
throw new ApiError(method,
|
|
12687
|
+
throw new ApiError(method, path36, response.status, errorBody);
|
|
12573
12688
|
}
|
|
12574
12689
|
}
|
|
12575
12690
|
/**
|
|
@@ -12631,9 +12746,9 @@ var init_api_client = __esm({
|
|
|
12631
12746
|
* transient-retry loop — re-streaming a blob is not worth a cold-start probe.
|
|
12632
12747
|
*/
|
|
12633
12748
|
async dataDownload(v1Path, orgId) {
|
|
12634
|
-
const
|
|
12635
|
-
addApiBreadcrumb("GET",
|
|
12636
|
-
const url = `${this.apiUrl}${
|
|
12749
|
+
const path36 = withOrgSelector(toDataProxyPath(v1Path), orgId);
|
|
12750
|
+
addApiBreadcrumb("GET", path36);
|
|
12751
|
+
const url = `${this.apiUrl}${path36}`;
|
|
12637
12752
|
let response = await this.send(url, "GET");
|
|
12638
12753
|
if (response.status === 401 && this.onUnauthorized) {
|
|
12639
12754
|
let refreshed;
|
|
@@ -12647,7 +12762,7 @@ var init_api_client = __esm({
|
|
|
12647
12762
|
}
|
|
12648
12763
|
}
|
|
12649
12764
|
if (!response.ok) {
|
|
12650
|
-
throw new ApiError("GET",
|
|
12765
|
+
throw new ApiError("GET", path36, response.status, await response.text());
|
|
12651
12766
|
}
|
|
12652
12767
|
return {
|
|
12653
12768
|
bytes: new Uint8Array(await response.arrayBuffer()),
|
|
@@ -13097,9 +13212,9 @@ function monitorRuleActions2(monitorConfig) {
|
|
|
13097
13212
|
if (!monitorConfig || typeof monitorConfig !== "object") return [];
|
|
13098
13213
|
const config = monitorConfig;
|
|
13099
13214
|
const found = [];
|
|
13100
|
-
const visit = (action,
|
|
13215
|
+
const visit = (action, path36) => {
|
|
13101
13216
|
if (!action || typeof action !== "object" || Array.isArray(action)) return;
|
|
13102
|
-
found.push({ action, path:
|
|
13217
|
+
found.push({ action, path: path36 });
|
|
13103
13218
|
};
|
|
13104
13219
|
if (Array.isArray(config.rules)) {
|
|
13105
13220
|
config.rules.forEach((rule, index) => {
|
|
@@ -13116,25 +13231,25 @@ function collectMonitorRuleIssues2(monitorConfig) {
|
|
|
13116
13231
|
const trigger = resolveMonitorTrigger2(monitorConfig);
|
|
13117
13232
|
const kinds = monitorRuleActionKinds2(trigger);
|
|
13118
13233
|
const issues = callUtteranceRuleIssues2(monitorConfig);
|
|
13119
|
-
for (const { action, path:
|
|
13120
|
-
if (trigger === "call_utterance" &&
|
|
13234
|
+
for (const { action, path: path36 } of monitorRuleActions2(monitorConfig)) {
|
|
13235
|
+
if (trigger === "call_utterance" && path36[0] === "fallback") continue;
|
|
13121
13236
|
const kind = action.kind;
|
|
13122
13237
|
if (typeof kind === "string" && !kinds.includes(kind)) {
|
|
13123
|
-
issues.push({ path: [...
|
|
13238
|
+
issues.push({ path: [...path36, "kind"], message: monitorActionKindMessage2(kind, trigger) });
|
|
13124
13239
|
}
|
|
13125
13240
|
const toolName = action.tool_name;
|
|
13126
13241
|
if (kind === "call_tool" && typeof toolName === "string" && isRefusedNativeToolName2(toolName, trigger)) {
|
|
13127
|
-
issues.push({ path: [...
|
|
13242
|
+
issues.push({ path: [...path36, "tool_name"], message: monitorRuleToolNotAllowedMessage2(toolName, trigger) });
|
|
13128
13243
|
continue;
|
|
13129
13244
|
}
|
|
13130
13245
|
if (kind === "call_tool" && toolName === INSERT_NOTE_TOOL_NAME2) {
|
|
13131
|
-
issues.push(...insertNoteArgumentIssues2(action,
|
|
13246
|
+
issues.push(...insertNoteArgumentIssues2(action, path36));
|
|
13132
13247
|
}
|
|
13133
13248
|
if (kind === "call_tool" && toolName === RUN_MONITOR_TOOL_NAME2) {
|
|
13134
13249
|
const callee = readRunMonitorCallee2(action);
|
|
13135
13250
|
if (!callee.ok) {
|
|
13136
13251
|
issues.push({
|
|
13137
|
-
path: [...
|
|
13252
|
+
path: [...path36, "args", "monitor_name"],
|
|
13138
13253
|
message: runMonitorCalleeMessage2(callee.reason)
|
|
13139
13254
|
});
|
|
13140
13255
|
}
|
|
@@ -13194,11 +13309,11 @@ function insertNoteTemplateMessage2(reason) {
|
|
|
13194
13309
|
return `insert_note's template is longer than the ${MONITOR_NOTE_TEMPLATE_MAX2}-character limit.`;
|
|
13195
13310
|
}
|
|
13196
13311
|
}
|
|
13197
|
-
function insertNoteArgumentIssues2(action,
|
|
13312
|
+
function insertNoteArgumentIssues2(action, path36) {
|
|
13198
13313
|
const result = readInsertNoteTemplate2(action);
|
|
13199
13314
|
if (result.ok) return [];
|
|
13200
13315
|
return [{
|
|
13201
|
-
path: [...
|
|
13316
|
+
path: [...path36, "args", "template"],
|
|
13202
13317
|
message: insertNoteTemplateMessage2(result.reason)
|
|
13203
13318
|
}];
|
|
13204
13319
|
}
|
|
@@ -13228,12 +13343,12 @@ function validateFollowupLinks2(followups, label, ctx) {
|
|
|
13228
13343
|
const linkTargets = /* @__PURE__ */ new Set();
|
|
13229
13344
|
followups.forEach((followup, i) => {
|
|
13230
13345
|
const ref = followup?.after_followup_id;
|
|
13231
|
-
const
|
|
13346
|
+
const path36 = ["followups", i, "after_followup_id"];
|
|
13232
13347
|
if (followup?.type !== "inactivity_after_before_event") {
|
|
13233
13348
|
if (ref !== void 0) {
|
|
13234
13349
|
ctx.addIssue({
|
|
13235
13350
|
code: external_exports.ZodIssueCode.custom,
|
|
13236
|
-
path:
|
|
13351
|
+
path: path36,
|
|
13237
13352
|
message: `kanban status ${label}: after_followup_id is only valid on inactivity_after_before_event followups (this one is ${followup?.type})`
|
|
13238
13353
|
});
|
|
13239
13354
|
}
|
|
@@ -13242,7 +13357,7 @@ function validateFollowupLinks2(followups, label, ctx) {
|
|
|
13242
13357
|
if (ref === void 0) {
|
|
13243
13358
|
ctx.addIssue({
|
|
13244
13359
|
code: external_exports.ZodIssueCode.custom,
|
|
13245
|
-
path:
|
|
13360
|
+
path: path36,
|
|
13246
13361
|
message: `kanban status ${label}: inactivity_after_before_event requires after_followup_id naming the id of a before_event followup in the same status`
|
|
13247
13362
|
});
|
|
13248
13363
|
return;
|
|
@@ -13252,7 +13367,7 @@ function validateFollowupLinks2(followups, label, ctx) {
|
|
|
13252
13367
|
if (matches.length > 1) {
|
|
13253
13368
|
ctx.addIssue({
|
|
13254
13369
|
code: external_exports.ZodIssueCode.custom,
|
|
13255
|
-
path:
|
|
13370
|
+
path: path36,
|
|
13256
13371
|
message: `kanban status ${label}: after_followup_id "${ref}" matches ${matches.length} followups \u2014 a link must name exactly one`
|
|
13257
13372
|
});
|
|
13258
13373
|
return;
|
|
@@ -13264,7 +13379,7 @@ function validateFollowupLinks2(followups, label, ctx) {
|
|
|
13264
13379
|
);
|
|
13265
13380
|
ctx.addIssue({
|
|
13266
13381
|
code: external_exports.ZodIssueCode.custom,
|
|
13267
|
-
path:
|
|
13382
|
+
path: path36,
|
|
13268
13383
|
message: hasIdlessBeforeEvent ? `kanban status ${label}: after_followup_id "${ref}" matches no followup \u2014 a link target must declare an explicit id, and this status has before_event followups without one` : `kanban status ${label}: after_followup_id "${ref}" matches no followup in this status`
|
|
13269
13384
|
});
|
|
13270
13385
|
return;
|
|
@@ -13272,7 +13387,7 @@ function validateFollowupLinks2(followups, label, ctx) {
|
|
|
13272
13387
|
if (target.type !== "before_event") {
|
|
13273
13388
|
ctx.addIssue({
|
|
13274
13389
|
code: external_exports.ZodIssueCode.custom,
|
|
13275
|
-
path:
|
|
13390
|
+
path: path36,
|
|
13276
13391
|
message: `kanban status ${label}: after_followup_id "${ref}" points at a ${target.type} followup \u2014 only before_event followups can anchor a chain`
|
|
13277
13392
|
});
|
|
13278
13393
|
}
|
|
@@ -13348,12 +13463,12 @@ function typeMatches2(typeField, allowed) {
|
|
|
13348
13463
|
if (Array.isArray(typeField)) return typeField.every((t) => typeof t === "string" && allowed.has(t));
|
|
13349
13464
|
return false;
|
|
13350
13465
|
}
|
|
13351
|
-
function validateSchema2(schema,
|
|
13466
|
+
function validateSchema2(schema, path36, errors, opts = {}) {
|
|
13352
13467
|
if (typeof schema === "boolean") return;
|
|
13353
13468
|
const depth = opts.depth ?? 0;
|
|
13354
13469
|
if (depth > MAX_SCHEMA_DEPTH2) {
|
|
13355
13470
|
errors.push({
|
|
13356
|
-
path:
|
|
13471
|
+
path: path36 || "<root>",
|
|
13357
13472
|
message: `schema nesting exceeds ${MAX_SCHEMA_DEPTH2} levels`,
|
|
13358
13473
|
suggestion: "Flatten the schema; LLM providers reject deeply nested tool input_schemas."
|
|
13359
13474
|
});
|
|
@@ -13361,7 +13476,7 @@ function validateSchema2(schema, path35, errors, opts = {}) {
|
|
|
13361
13476
|
}
|
|
13362
13477
|
if (!isRecord22(schema)) {
|
|
13363
13478
|
errors.push({
|
|
13364
|
-
path:
|
|
13479
|
+
path: path36,
|
|
13365
13480
|
message: `expected object, got ${schema === null ? "null" : typeof schema}`
|
|
13366
13481
|
});
|
|
13367
13482
|
return;
|
|
@@ -13369,14 +13484,14 @@ function validateSchema2(schema, path35, errors, opts = {}) {
|
|
|
13369
13484
|
if (opts.isRoot) {
|
|
13370
13485
|
if ("type" in schema && schema.type !== "object") {
|
|
13371
13486
|
errors.push({
|
|
13372
|
-
path:
|
|
13487
|
+
path: path36 ? `${path36}.type` : "type",
|
|
13373
13488
|
message: `root type must be 'object', got ${JSON.stringify(schema.type)}`,
|
|
13374
13489
|
suggestion: "Tool parameters at the root must be an object: `{ type: 'object', properties: { ... } }`."
|
|
13375
13490
|
});
|
|
13376
13491
|
}
|
|
13377
13492
|
} else if ("type" in schema && !typeMatches2(schema.type, ALLOWED_TYPES2)) {
|
|
13378
13493
|
errors.push({
|
|
13379
|
-
path: `${
|
|
13494
|
+
path: `${path36}.type`,
|
|
13380
13495
|
message: `type must be one of ${[...ALLOWED_TYPES2].join("/")} or an array of those, got ${JSON.stringify(schema.type)}`
|
|
13381
13496
|
});
|
|
13382
13497
|
}
|
|
@@ -13386,25 +13501,25 @@ function validateSchema2(schema, path35, errors, opts = {}) {
|
|
|
13386
13501
|
const isPlaceholder = PLACEHOLDER_TOKENS2.includes(e);
|
|
13387
13502
|
const isOutcomePlaceholder = e === "[KANBAN_OUTCOME_VALUES]";
|
|
13388
13503
|
errors.push({
|
|
13389
|
-
path: `${
|
|
13504
|
+
path: `${path36}.enum`,
|
|
13390
13505
|
message: `enum must be a non-empty array of primitives, got string ${JSON.stringify(e)}`,
|
|
13391
13506
|
suggestion: isOutcomePlaceholder ? "Declare `outcomes` on the hub's terminal kanban status so the platform can render the placeholder into a valid array; with none configured the platform drops the parameter instead." : isPlaceholder ? "Set `operation: 'update_kanban_status'` on the tool and ensure at least one hub.kanban_status has `allowsAgentUpdate: true` so the platform can render the placeholder into a valid array." : 'Wrap the value in an array: `enum: ["value"]`.'
|
|
13392
13507
|
});
|
|
13393
13508
|
} else if (!Array.isArray(e)) {
|
|
13394
13509
|
errors.push({
|
|
13395
|
-
path: `${
|
|
13510
|
+
path: `${path36}.enum`,
|
|
13396
13511
|
message: `enum must be a non-empty array of primitives, got ${typeof e}`
|
|
13397
13512
|
});
|
|
13398
13513
|
} else if (e.length === 0) {
|
|
13399
13514
|
errors.push({
|
|
13400
|
-
path: `${
|
|
13515
|
+
path: `${path36}.enum`,
|
|
13401
13516
|
message: "enum must not be empty"
|
|
13402
13517
|
});
|
|
13403
13518
|
} else {
|
|
13404
13519
|
for (let i = 0; i < e.length; i++) {
|
|
13405
13520
|
if (!isPrimitive2(e[i])) {
|
|
13406
13521
|
errors.push({
|
|
13407
|
-
path: `${
|
|
13522
|
+
path: `${path36}.enum[${i}]`,
|
|
13408
13523
|
message: `enum entry must be a primitive (string/number/boolean/null), got ${typeof e[i]}`
|
|
13409
13524
|
});
|
|
13410
13525
|
}
|
|
@@ -13414,7 +13529,7 @@ function validateSchema2(schema, path35, errors, opts = {}) {
|
|
|
13414
13529
|
for (const key of ["exclusiveMinimum", "exclusiveMaximum"]) {
|
|
13415
13530
|
if (key in schema && typeof schema[key] === "boolean") {
|
|
13416
13531
|
errors.push({
|
|
13417
|
-
path: `${
|
|
13532
|
+
path: `${path36}.${key}`,
|
|
13418
13533
|
message: `${key} as boolean is draft-04 syntax; draft 2020-12 requires a numeric value`,
|
|
13419
13534
|
suggestion: `Replace with the numeric bound, e.g. \`${key}: 0\`.`
|
|
13420
13535
|
});
|
|
@@ -13423,45 +13538,45 @@ function validateSchema2(schema, path35, errors, opts = {}) {
|
|
|
13423
13538
|
if ("properties" in schema) {
|
|
13424
13539
|
if (!isRecord22(schema.properties)) {
|
|
13425
13540
|
errors.push({
|
|
13426
|
-
path: `${
|
|
13541
|
+
path: `${path36}.properties`,
|
|
13427
13542
|
message: `properties must be an object, got ${Array.isArray(schema.properties) ? "array" : typeof schema.properties}`
|
|
13428
13543
|
});
|
|
13429
13544
|
} else {
|
|
13430
13545
|
for (const [propName, propSchema] of Object.entries(schema.properties)) {
|
|
13431
|
-
validateSchema2(propSchema, `${
|
|
13546
|
+
validateSchema2(propSchema, `${path36}.properties.${propName}`, errors, { depth: depth + 1 });
|
|
13432
13547
|
}
|
|
13433
13548
|
}
|
|
13434
13549
|
}
|
|
13435
13550
|
if (schemaTypeIncludes2(schema, "array") && "items" in schema) {
|
|
13436
13551
|
if (Array.isArray(schema.items)) {
|
|
13437
|
-
schema.items.forEach((sub, i) => validateSchema2(sub, `${
|
|
13552
|
+
schema.items.forEach((sub, i) => validateSchema2(sub, `${path36}.items[${i}]`, errors, { depth: depth + 1 }));
|
|
13438
13553
|
} else {
|
|
13439
|
-
validateSchema2(schema.items, `${
|
|
13554
|
+
validateSchema2(schema.items, `${path36}.items`, errors, { depth: depth + 1 });
|
|
13440
13555
|
}
|
|
13441
13556
|
}
|
|
13442
13557
|
for (const key of SUBSCHEMA_OBJECT_KEYWORDS2) {
|
|
13443
13558
|
if (key in schema && isRecord22(schema[key])) {
|
|
13444
|
-
validateSchema2(schema[key], `${
|
|
13559
|
+
validateSchema2(schema[key], `${path36}.${key}`, errors, { depth: depth + 1 });
|
|
13445
13560
|
}
|
|
13446
13561
|
}
|
|
13447
13562
|
for (const key of SUBSCHEMA_LIST_KEYWORDS2) {
|
|
13448
13563
|
const list = schema[key];
|
|
13449
13564
|
if (Array.isArray(list)) {
|
|
13450
|
-
list.forEach((sub, i) => validateSchema2(sub, `${
|
|
13565
|
+
list.forEach((sub, i) => validateSchema2(sub, `${path36}.${key}[${i}]`, errors, { depth: depth + 1 }));
|
|
13451
13566
|
}
|
|
13452
13567
|
}
|
|
13453
13568
|
for (const key of SUBSCHEMA_MAP_KEYWORDS2) {
|
|
13454
13569
|
const map = schema[key];
|
|
13455
13570
|
if (isRecord22(map)) {
|
|
13456
13571
|
for (const [name, sub] of Object.entries(map)) {
|
|
13457
|
-
validateSchema2(sub, `${
|
|
13572
|
+
validateSchema2(sub, `${path36}.${key}.${name}`, errors, { depth: depth + 1 });
|
|
13458
13573
|
}
|
|
13459
13574
|
}
|
|
13460
13575
|
}
|
|
13461
13576
|
const reportedPaths = new Set(errors.map((e) => e.path));
|
|
13462
13577
|
for (const [k, v] of Object.entries(schema)) {
|
|
13463
13578
|
if (typeof v !== "string") continue;
|
|
13464
|
-
const fieldPath = `${
|
|
13579
|
+
const fieldPath = `${path36}.${k}`;
|
|
13465
13580
|
if (reportedPaths.has(fieldPath)) continue;
|
|
13466
13581
|
for (const token of PLACEHOLDER_TOKENS2) {
|
|
13467
13582
|
if (v === token) {
|
|
@@ -13612,8 +13727,8 @@ function evalInitialStateError2(input) {
|
|
|
13612
13727
|
const parsed = evalInitialStateEntry2.safeParse(entries[i]);
|
|
13613
13728
|
if (!parsed.success) {
|
|
13614
13729
|
const issue = parsed.error.issues[0];
|
|
13615
|
-
const
|
|
13616
|
-
return `initial_state[${i}].${
|
|
13730
|
+
const path36 = issue?.path.join(".") || "?";
|
|
13731
|
+
return `initial_state[${i}].${path36} is invalid: ${issue?.message ?? "malformed"}`;
|
|
13617
13732
|
}
|
|
13618
13733
|
if (seenSlugs.has(parsed.data.slug)) {
|
|
13619
13734
|
return `initial_state[${i}].slug "${parsed.data.slug}" is declared more than once`;
|
|
@@ -13840,10 +13955,10 @@ function refineHubAsCodeEvals2(config, ctx) {
|
|
|
13840
13955
|
function refineHubAsCodeEvalAttachments2(config, ctx) {
|
|
13841
13956
|
const cfg = config;
|
|
13842
13957
|
const referencedHashes = /* @__PURE__ */ new Set();
|
|
13843
|
-
const addTurnIssue = (
|
|
13958
|
+
const addTurnIssue = (path36, turn, name) => {
|
|
13844
13959
|
const error = evalTurnAttachmentsError2(turn);
|
|
13845
13960
|
if (error) {
|
|
13846
|
-
ctx.addIssue({ code: external_exports.ZodIssueCode.custom, path:
|
|
13961
|
+
ctx.addIssue({ code: external_exports.ZodIssueCode.custom, path: path36, message: `${name}: ${error}` });
|
|
13847
13962
|
return;
|
|
13848
13963
|
}
|
|
13849
13964
|
for (const hash of collectTurnAttachmentHashes2(turn)) referencedHashes.add(hash);
|
|
@@ -13911,6 +14026,72 @@ function refineHubAsCodeEvalAttachments2(config, ctx) {
|
|
|
13911
14026
|
}
|
|
13912
14027
|
}
|
|
13913
14028
|
}
|
|
14029
|
+
function refineHubAsCodeCallOpenings2(config, ctx) {
|
|
14030
|
+
const cfg = config;
|
|
14031
|
+
if (Array.isArray(cfg.agents)) {
|
|
14032
|
+
cfg.agents.forEach((entry, a) => {
|
|
14033
|
+
const agent = entry;
|
|
14034
|
+
const openings = agent?.call_openings;
|
|
14035
|
+
if (openings === void 0 || openings === null) return;
|
|
14036
|
+
const path36 = ["agents", a, "call_openings"];
|
|
14037
|
+
const name = `agent "${typeof agent?.name === "string" ? agent.name : "<unnamed>"}"`;
|
|
14038
|
+
if (typeof openings !== "object" || Array.isArray(openings)) {
|
|
14039
|
+
ctx.addIssue({ code: external_exports.ZodIssueCode.custom, path: path36, message: `${name}: call_openings must map a language to an opening` });
|
|
14040
|
+
return;
|
|
14041
|
+
}
|
|
14042
|
+
if (agent?.role !== "pilot_voice" && Object.keys(openings).length > 0) {
|
|
14043
|
+
ctx.addIssue({ code: external_exports.ZodIssueCode.custom, path: path36, message: `${name}: only a pilot_voice agent has call_openings` });
|
|
14044
|
+
}
|
|
14045
|
+
for (const [language, raw] of Object.entries(openings)) {
|
|
14046
|
+
const at = [...path36, language];
|
|
14047
|
+
if (!callOpeningLanguage2.safeParse(language).success) {
|
|
14048
|
+
ctx.addIssue({ code: external_exports.ZodIssueCode.custom, path: at, message: `${name}: call_openings language must be one of ${CALL_OPENING_LANGUAGES2.join(", ")}` });
|
|
14049
|
+
continue;
|
|
14050
|
+
}
|
|
14051
|
+
const opening = raw;
|
|
14052
|
+
if (!callOpeningHash2.safeParse(opening?.hash).success) {
|
|
14053
|
+
ctx.addIssue({ code: external_exports.ZodIssueCode.custom, path: [...at, "hash"], message: `${name}: call_openings.${language} names no audio file` });
|
|
14054
|
+
}
|
|
14055
|
+
if (!callOpeningCaption2.safeParse(opening?.caption).success) {
|
|
14056
|
+
ctx.addIssue({
|
|
14057
|
+
code: external_exports.ZodIssueCode.custom,
|
|
14058
|
+
path: [...at, "caption"],
|
|
14059
|
+
message: `${name}: call_openings.${language}.caption must be 1\u2013${CALL_OPENING_CAPTION_MAX_CHARS2} characters`
|
|
14060
|
+
});
|
|
14061
|
+
}
|
|
14062
|
+
}
|
|
14063
|
+
});
|
|
14064
|
+
}
|
|
14065
|
+
const files = cfg.call_opening_files;
|
|
14066
|
+
if (!Array.isArray(files)) return;
|
|
14067
|
+
if (files.length > MAX_CALL_OPENING_CARRIERS2) {
|
|
14068
|
+
ctx.addIssue({
|
|
14069
|
+
code: external_exports.ZodIssueCode.custom,
|
|
14070
|
+
path: ["call_opening_files"],
|
|
14071
|
+
message: `too many call opening files (${files.length}); the maximum is ${MAX_CALL_OPENING_CARRIERS2}`
|
|
14072
|
+
});
|
|
14073
|
+
}
|
|
14074
|
+
let aggregateEncoded = 0;
|
|
14075
|
+
files.forEach((f, i) => {
|
|
14076
|
+
const b64 = f?.content_base64;
|
|
14077
|
+
if (typeof b64 !== "string") return;
|
|
14078
|
+
aggregateEncoded += b64.length;
|
|
14079
|
+
if (b64.length > MAX_CALL_OPENING_ENCODED_BYTES2) {
|
|
14080
|
+
ctx.addIssue({
|
|
14081
|
+
code: external_exports.ZodIssueCode.custom,
|
|
14082
|
+
path: ["call_opening_files", i, "content_base64"],
|
|
14083
|
+
message: "a call opening file exceeds the opening size limit"
|
|
14084
|
+
});
|
|
14085
|
+
}
|
|
14086
|
+
});
|
|
14087
|
+
if (aggregateEncoded > MAX_CALL_OPENING_AGGREGATE_ENCODED_BYTES2) {
|
|
14088
|
+
ctx.addIssue({
|
|
14089
|
+
code: external_exports.ZodIssueCode.custom,
|
|
14090
|
+
path: ["call_opening_files"],
|
|
14091
|
+
message: `total call opening bytes exceed the ${MAX_CALL_OPENING_AGGREGATE_ENCODED_BYTES2 / 1024 / 1024}MB per-push limit`
|
|
14092
|
+
});
|
|
14093
|
+
}
|
|
14094
|
+
}
|
|
13914
14095
|
function utf8ByteLength2(value) {
|
|
13915
14096
|
let bytes = 0;
|
|
13916
14097
|
for (let i = 0; i < value.length; i++) {
|
|
@@ -13989,11 +14170,11 @@ function refineHubAsCodeDelegation2(config, ctx) {
|
|
|
13989
14170
|
}
|
|
13990
14171
|
}
|
|
13991
14172
|
if (del.context_boundary === void 0) return;
|
|
13992
|
-
const
|
|
14173
|
+
const path36 = ["agents", agentIndex, "tools", "delegation", delIndex, "context_boundary"];
|
|
13993
14174
|
if (del.type !== "hub") {
|
|
13994
14175
|
ctx.addIssue({
|
|
13995
14176
|
code: external_exports.ZodIssueCode.custom,
|
|
13996
|
-
path:
|
|
14177
|
+
path: path36,
|
|
13997
14178
|
message: `context_boundary applies only to \`type: hub\` delegations (got type "${String(del.type)}")`
|
|
13998
14179
|
});
|
|
13999
14180
|
return;
|
|
@@ -14001,7 +14182,7 @@ function refineHubAsCodeDelegation2(config, ctx) {
|
|
|
14001
14182
|
if (!CONTEXT_BOUNDARIES2.includes(del.context_boundary)) {
|
|
14002
14183
|
ctx.addIssue({
|
|
14003
14184
|
code: external_exports.ZodIssueCode.custom,
|
|
14004
|
-
path:
|
|
14185
|
+
path: path36,
|
|
14005
14186
|
message: `context_boundary must be one of: ${CONTEXT_BOUNDARIES2.join(", ")}`
|
|
14006
14187
|
});
|
|
14007
14188
|
}
|
|
@@ -14199,7 +14380,7 @@ function findStepBoundaries(transcript) {
|
|
|
14199
14380
|
}
|
|
14200
14381
|
return out;
|
|
14201
14382
|
}
|
|
14202
|
-
var UUID_RE, HEX_RE, WORKOS_ID_RE, OPAQUE_SECRET_RE, BASE64_SECRET_RE, BASE64_MARKER_RE, TOKEN_RE, SENSITIVE_FIELDS, SENSITIVE_KEY_ALTERNATION, SENSITIVE_KEY_PATTERN, JSON_CREDENTIAL_RE, QUERY_CREDENTIAL_RE, REDACTED, PROVIDER_TOKEN_RE, APP_ERROR_BRAND, AppError, LLM_RATE_LIMIT_BRAND, LlmRateLimitError, LLM_PROVIDER_HTTP_BRAND, LlmProviderHttpError, LLM_PROVIDER_CONTENT_BRAND, LlmProviderContentError, LLM_PROVIDER_TIMEOUT_BRAND, LlmProviderTimeoutError, ExternalServiceError, CHANNEL_PROVIDER_HTTP_BRAND, ChannelProviderHttpError, MEDIA_PROVIDER_HTTP_BRAND, MediaProviderHttpError, REKOR_ACTOR_TYPE_HEADER2, REKOR_ACTOR_ID_HEADER2, REKOR_ACTOR_LABEL_HEADER2, REKOR_ACTOR_ORG_HEADER2, REKOR_ACTOR_ADMIN_HEADER2, REKOR_CLIENT_HEADER2, REKOR_TOOL_ID_HEADER2, REKOR_CLIENTS2, rekorClientSchema2, MAX_REKOR_TOOL_ID_LENGTH2, rekorToolIdSchema2, DATA_PROXY_MOUNT2, DATA_PROXY_PREFIX2, DATA_PROXY_ORG_QUERY_PARAM2, MAX_PROVISIONING_BODY_BYTES2, dataProxyQuery2, rekorAttestation2, REQUIRED_REKOR_ATTESTATION_HEADERS2, BASE_DESTRUCTION_MOUNT2, BASE_DESTRUCTION_PREFIX2, BASE_DESTRUCTION_CONFIRM_PATH2, baseDestructionConfirmBody2, BASE_DESTRUCTION_GRACE_MS2, BASE_DESTRUCTION_CONFIRM_TTL_MS2, BASE_DESTRUCTION_ORG_QUERY_PARAM2, baseDestructionQuery2, baseDestructionParam2, baseDestructionInitiateBody2, baseDestructionStatus2, baseDestructionRequest2, baseDestructionListResponse2, baseDestructionInitiateResponse2, baseDestructionConfirmResponse2, baseDestructionCancelResponse2, ENDPOINT_CONFIGS, AUTH_TYPE2, ORG_CREDENTIAL_AUTH_TYPES2, AUTH_TYPE_DISPLAY2, LEGACY_AUTH_TYPE_MAP2, VALID_AUTH_TYPES2, AGENT_ROLES2, SAFE_USER_ID_REGEX2, SUPPORTED_LOCALES2, uuidSchema2, paginationSchema3, timestampSchema2, idParamSchema2, clientOptionalString2, clientOptionalBoolean2, clientOptionalNumber2, messageAttachment2, MAX_MESSAGE_BODY_BYTES2, MAX_ATTACHMENTS_PER_MESSAGE2, MAX_AUDIO_FILE_BASE64_BYTES2, primaryRegionSchema2, placementSourceSchema2, orgIdParam2, orgAdminIdParam2, createOrganizationBody2, updateOrganizationBody2, addOrgAdminBody2, SUMMARIZATION_THRESHOLD_MIN2, SUMMARIZATION_THRESHOLD_MAX2, PREVIOUS_CONVERSATIONS_MAX2, FLAG_CONDITION_OPERATORS2, CONFIDENCE_VARIABLE_SUFFIX2, DECISION_SCORE_MIN_LEVELS2, DECISION_SCORE_MAX_LEVELS2, DECISIONS_MODEL_PREFIXES2, DECISION_CAPABLE_AGENT_ROLES2, NATIVE_TOOL_SCHEMAS2, WAYAI_CONNECTOR2, BASE_NATIVE_TOOLS2, NATIVE_TOOLS2, CATALOG_SIDE_EFFECTS2, NATIVE_TOOL_NAMES2, previousConversationsCountField2, summarizationThresholdField2, flagConditionSchema2, MONITOR_TRIGGERS2, monitorTriggerSchema2, MONITOR_FIRING_TRIGGERS2, MONITOR_DELAY_SECONDS_MIN2, MONITOR_IDLE_DELAY_REQUIRED_MESSAGE2, MONITOR_HISTORY_MESSAGES_MAX2, monitorHistoryMessagesSchema2, monitorIncludeToolResultsSchema2, MONITOR_INPUT_SHAPING_KEYS2, MONITOR_INPUT_SHAPING_SCHEMAS2, MONITOR_INPUT_SHAPING_IDLE_MESSAGE2, monitorArgumentSourceSchema2, MONITOR_NOTE_TEMPLATE_MAX2, MONITOR_STEER_NOTE_MAX2, monitorActionSchema2, monitorRuleSchema2, MONITOR_RULE_KEYS2, MONITOR_RULE_SCHEMAS2, MONITOR_RULE_TRIGGERS2, MONITOR_RULE_TRIGGER_MESSAGE2, CALL_UTTERANCE_SPEAKERS2, callUtteranceSpeakerSchema2, MONITOR_CALL_KEYS2, MONITOR_CALL_SCHEMAS2, MONITOR_CALL_KEY_MESSAGE2, CALL_STEERING_MIN_CONFIDENCE2, CALL_UTTERANCE_RULE_NOT_CONFIDENT_MESSAGE2, CALL_UTTERANCE_FALLBACK_MESSAGE2, CALL_UTTERANCE_FLAG_CONDITIONS_MESSAGE2, CALL_STEER_NOTE_BLANK_MESSAGE2, MONITOR_USER_MESSAGE_ACTION_KINDS2, MONITOR_ASSISTANT_REPLY_ACTION_KINDS2, MONITOR_CALL_UTTERANCE_ACTION_KINDS2, INSERT_NOTE_TOOL_NAME2, RUN_MONITOR_TOOL_NAME2, MONITOR_RULE_ALLOWED_NATIVE_TOOLS2, MONITOR_RULE_REENTRY_TOOLS2, MONITOR_RULE_REENTRY_TRACKS2, monitorConfigField2, flagConditionsField2, agentIdParam2, listAgentsQuery2, agentConnectionsQuery2, createAgentBody2, updateAgentBody2, AGENT_PARAMETER_TYPES2, AGENT_PARAMETER_NAME_REGEX2, agentParameterCreateSchema2, MAX_AGENT_PARAMETERS_PER_REQUEST2, createAgentParametersBody2, SLUG_REGEX2, slugSchema2, INVISIBLE_NAME_CHARS2, MAX_KANBAN_STATUSES2, MAX_FOLLOWUPS_PER_STATUS2, MAX_LANES2, MAX_ADDITIONAL_CONTEXT_SCHEMA_BYTES2, RESERVED_TEMPLATE_DUMP_NAME2, kanbanStatusSlugSchema2, followupTypeSchema2, EVENT_RELATIVE_FOLLOWUP_TYPES2, followupTimeUnitSchema2, followupIdSchema2, SELECTABLE_FOLLOWUP_TYPES2, MAX_LINKED_FOLLOWUP_TARGETS_PER_STATUS2, followupSchema2, MAX_OUTCOMES_PER_STATUS2, kanbanOutcomeSchema2, EXCLUSIVE_FLAG_PAIRS2, kanbanStatusSchema2, kanbanStatusesArraySchema2, laneSchema2, lanesArraySchema2, hubIdParam2, hubAdminIdParam2, hubUserIdParam2, hubIdentityIdParam2, hubTeamIdParam2, hubTeamUserDeleteParam2, hubSchemaQuery2, PREVIEW_LABEL_MAX_LENGTH2, MAX_ENDED_INDEX_RETENTION_DAYS2, MAX_EVAL_RETENTION_DAYS2, previewLabelField2, createHubBody2, updateHubBody2, addHubAdminBody2, addHubIdentityAuthorizationBody2, contactDecisionBody2, approveContactBody2, listContactAccessQuery2, createHubTeamBody2, updateHubTeamBody2, addHubTeamUserBody2, reassignHubUserBody2, replicatePreviewBody2, updateChannelTestIdentitiesBody2, claimCodeChannelParam2, claimCodeDeleteParam2, connectionIdParam2, connectorIdParam2, listConnectionsQuery2, deleteConnectionQuery2, addConnectionBody2, editConnectionBody2, PRODUCTION_DIRECT_FIELDS2, setProductionCredentialBody2, registerWhatsappQuery2, registerWhatsappBody2, retryProvisioningQuery2, resendDomainStatusQuery2, PLACEHOLDER_TOKENS2, ALLOWED_TYPES2, SUBSCHEMA_OBJECT_KEYWORDS2, SUBSCHEMA_LIST_KEYWORDS2, SUBSCHEMA_MAP_KEYWORDS2, MAX_SCHEMA_DEPTH2, toolIdParam2, listToolsQuery2, toolAgentQuery2, deleteToolQuery2, toolConnectionsQuery2, nativeToolIdSchema2, CONTEXT_BOUNDARIES2, contextBoundarySchema2, addNativeToolBody2, addMcpToolBody2, createCustomToolBody2, updateCustomToolBody2, updateToolExecutionConfigBody2, initialValueCreateSchema2, initialValueUpdateSchema2, stateIdParam2, listStatesQuery2, stateNameSchema2, createStateBody2, updateStateBody2, reorderStatesBody2, variantAiModeSchema2, experimentStatusSchema2, overlayUpdateSchema2, experimentIdParam2, variantIdParam2, listExperimentsQuery2, listVariantsQuery2, listOverridesQuery2, deleteOverrideQuery2, createExperimentBody2, updateExperimentBody2, setExperimentStatusBody2, createVariantBody2, updateVariantBody2, upsertOverrideBody2, orgTagIdParam2, listOrgTagsQuery2, ORG_TAG_NAME_REGEX2, ORG_TAG_NAME_MAX_LENGTH2, createOrgTagBody2, updateOrgTagBody2, orgCredentialIdParam2, listOrgCredentialsQuery2, createOrgCredentialBody2, updateOrgCredentialBody2, BASE_CREDENTIAL_NAME_MAX2, baseCredentialNameSchema2, createBaseCredentialLinkBody2, baseCredentialLinkParams2, baseCredentialLinkQuery2, orgResourceIdParam2, orgResourceFileIdParam2, orgResourceFolderIdParam2, hubOrgResourceParam2, listOrgResourcesQuery2, orgIdQuery2, createOrgResourceBody2, updateOrgResourceBody2, createOrgResourceFolderBody2, updateOrgResourceFolderBody2, uploadOrgResourceFileBody2, updateOrgResourceFileBody2, uploadOrgSkillZipBody2, linkOrgResourceBody2, resourceIdParam2, listResourcesQuery2, createResourceBody2, updateResourceBody2, syncSkillsBody2, resourceFileIdParam2, listResourceFilesQuery2, createResourceFileBody2, updateResourceFileBody2, uploadResourceFileBody2, uploadSkillZipBody2, resourceFolderIdParam2, listResourceFoldersQuery2, createResourceFolderBody2, updateResourceFolderBody2, agentResourceQuery2, hubResourceQuery2, linkAgentResourceBody2, updateAgentResourceBody2, unlinkAgentResourceQuery2, navItemSchema2, hubCountResetBody2, navItemCountResetBody2, typingBody2, analyticsHubIdParam2, analyticsVariableIdParam2, updateVariablePinBody2, updateAnalyticsViewBody2, NUMERIC_FILTER_OPS2, TEXT_FILTER_OPS2, CATEGORICAL_FILTER_OPS2, VARIABLE_FILTER_OPS2, STRUCTURED_QUERY_OPS2, STRUCTURED_QUERY_AGGREGATIONS2, filterValueSchema2, conversationsBody2, analyticsConversationIdParam2, messagesQuery2, conversationDetailDataQuery2, analyticsDataBody2, structuredQueryBody2, analyticsSqlBody2, analyticsSqlTable2, analyticsSqlSchemaQuery2, EVAL_PACING_PRESET_NAMES2, PACING_INTERVAL_MIN_MS2, PACING_INTERVAL_MAX_MS2, EVAL_MAX_RUNS_PER_SCENARIO2, EVAL_RUN_DEADLINE_MIN_MS2, EVAL_RUN_DEADLINE_MAX_MS2, ISO_UTC_RE2, paginationSchema22, evalIdParam2, sessionIdParam2, scenarioSetIdParam2, hubIdQuery2, evalDateContextSchema2, EVAL_FIXTURE_NAME_MAX_LENGTH2, evalFixtureOverrideSchema2, runSessionQuery2, runJourneyQuery2, EVAL_INPUT_ROLES2, EVAL_INPUT_ROLE_LIST2, ROLE_ECHO_MAX2, EVAL_INITIAL_STATE_SCOPES2, MAX_INITIAL_STATE_ENTRIES2, evalInitialStateEntry2, evalBody2, EVAL_LIST_MAX_LIMIT2, evalListLimit2, getEvalsQuery2, toggleEvalBody2, bulkToggleEvalsBody2, pacingConfigSchema2, EVAL_MAX_SELECTED_SCENARIOS2, evalScenarioSelectionEntrySchema2, evalScenarioSelectionSchema2, sessionConfigSchema2, createSessionBody2, getSessionsQuery2, getSessionResultsQuery2, getSessionRunsQuery2, evalAnalyticsQuery2, getSessionCostQuery2, compareSessionsQuery2, evalsSqlBody2, evalsSqlSchemaQuery2, exportResultsQuery2, validateEvalBody2, hubAgentsQuery2, createScenarioSetBody2, updateScenarioSetBody2, scenarioSetsHubQuery2, createScenarioFromConversationBody2, createJourneyFromConversationBody2, EVAL_ATTACHMENT_HASH_REGEX2, evalAttachmentRef2, turnMayCarryAttachments2, ATTACHMENTS_USER_ONLY_MESSAGE2, journeyIdParam2, journeyToolCallSchema2, journeyTurnSchema2, journeyStepOverrideSchema2, fixtureField2, createJourneyBody2, updateJourneyBody2, evalSessionConfigResponseSchema2, evalSessionResponseSchema2, evalSessionListConfigSchema2, evalSessionListItemSchema2, seedReleaseStatusSchema2, getConversationsQuery2, getMessagesQuery2, appMessageSenderType2, appMessageReceiverType2, apiChannelMessage2, apiChannelMessageBody2, appMessageBody2, appMessageResponse2, CALL_STATUSES2, callStatus2, CALL_END_REASONS2, callEndReason2, CALL_TRANSPORTS2, callTransport2, CALL_PARTICIPANT_TYPES2, callParticipantType2, callInstant2, MAX_SDP_OFFER_LENGTH2, sdpDescription2, sdpOffer2, MAX_CALL_REQUEST_BODY_BYTES2, hubScoped3, callSummaryFields2, callSummary2, callIdParam2, createCallBody2, createCallResponse2, callReadyBody2, callHangupBody2, callStatusQuery2, MAX_REPORTED_DELEGATION_IDS2, callDelegationId2, callDelegationsBody2, callResponse2, MAX_CALL_RECORDING_GAPS2, callRecordingGap2, callRecordingNoteMetadata2, TTS_VOICE_REPLY_ENABLED_FIELD2, COPILOT_TRIGGER_FIELD2, AUDIO_LANGUAGE_OPTIONS2, whatsapp2, instagram2, resend2, telegram2, API_CHANNEL_DELIVERY_EVENTS2, apiChannel2, OPENAI_REASONING_MODELS2, openai2, anthropic2, googleAiStudio2, openRouter2, xai2, groqStt2, openaiStt2, elevenLabsStt2, openaiTts2, groqTts2, elevenLabsTts2, GEMINI_TTS_VOICES2, googleTts2, wayai2, externalResources2, restApiTool2, mcpServer2, e2b2, CLAUDE_HARNESS_MODELS2, CLAUDE_HARNESS_MODEL_OPTIONS2, HARNESS_MCP_SERVERS_FIELD2, HARNESS_EGRESS_FIELDS2, claudeAgentSdk2, claudeManagedAgents2, rekorMemory2, SPOKEN_LINE_MAX_CHARS2, gptLive2, CONNECTORS2, evalCallInstant2, EVAL_CALL_MIN_SECONDS2, EVAL_CALL_MAX_SECONDS2, EVAL_CALL_SPOKEN_LINE_MAX_CHARS2, hubScoped22, createEvalCallBody2, createEvalCallResponse2, evalCallConversationQuery2, evalCallSpeaker2, evalCallUtterance2, evalCallTurn2, evalCallRecordResponse2, evalCallFinishResponse2, updateUserBody2, updateProfileBody2, pathnameRegex2, updatePreferencesBody2, registerPushTokenBody2, deletePushTokenQuery2, activityQuery2, deletionModeSchema2, deletionRequestBody2, archiveHubIdParam2, archiveConversationParams2, archiveListQuery2, archiveMessageObservabilityParams2, conversationIdParam2, claimBody2, releaseBody2, transferBody2, closeBody2, additionalContextPayloadSchema2, kanbanUpdateBody2, annotateConversationBody2, observabilityParams2, observabilityListParams2, deleteUserConversationsBody2, deleteUserConversationsResponse2, sendMessageBody2, listConversationsQuery2, flagSourceSchema2, getConversationsResponse2, getConversationDetailParams2, getConversationDetailQuery2, getConversationDetailResponse2, listWhatsAppTemplatesQuery2, sendWhatsAppTemplateBody2, copilotSuggestBody2, copilotSuggestResponse2, CONSULT_THREAD_STATUSES2, consultThreadStatus2, CONSULT_THREAD_TITLE_MAX2, consultThreadTitle2, consultThreadSummary2, listConsultThreadsQuery2, listConsultThreadsResponse2, createConsultThreadBody2, createConsultThreadResponse2, consultThreadIdParam2, updateConsultThreadBody2, updateConsultThreadResponse2, CONSULT_AWAIT_TIMEOUT_MS2, billingOrgIdParam2, subscriptionItemParams2, spendCapBody2, growthPacksBody2, portalSessionBody2, checkoutSessionBody2, updateBillingCurrencyBody2, invoicesQuery2, planKeySchema2, billingStatusSchema2, billingPlanTypeSchema2, dataUsageCountersSchema2, REKOR_ENTITLEMENT_CONTRACT_VERSION2, entitlementProjectionSchema2, rekorEntitlementRefreshMessageSchema2, downloadBody2, uploadQuery2, signUrlBody2, outboundSchemaQuery2, templateIdParam2, listTemplatesQuery2, deleteTemplateQuery2, templateStatusQuery2, createTemplateBody2, updateTemplateBody2, submitTemplateBody2, testTemplateBody2, contactIdParam2, listContactsQuery2, createContactBody2, updateContactBody2, listIdParam2, listListsQuery2, listListContactsQuery2, createListBody2, updateListBody2, addListContactsBody2, removeListContactsBody2, scheduleIdParam2, listSchedulesQuery2, listExecutionsQuery2, createScheduleBody2, updateScheduleBody2, MAX_RESOURCE_FILE_SIZE2, MAX_10MB_BASE64_ENCODED_BYTES2, MAX_EVAL_ATTACHMENT_ENCODED_BYTES2, MAX_EVAL_ATTACHMENT_CARRIERS2, MAX_EVAL_ATTACHMENT_AGGREGATE_ENCODED_BYTES2, MAX_RESOURCE_ENCODED_BYTES2, MAX_HUB_AS_CODE_RESOURCES2, MAX_HUB_AS_CODE_RESOURCE_FILES2, MAX_RESOURCE_AGGREGATE_ENCODED_BYTES2, MAX_CI_CONFIG_BODY_BYTES2, hubAsCodeStateSchema2, hubAsCodeResourceFileSchema2, hubAsCodeResourceSchema2, uuidPattern2, ciUuidSchema2, boundedHubAsCodeResourcesSchema2, hubAsCodeConfigSchema2, ciPullHubIdParam2, ciBranchParam2, ciPullQuery2, ciHubsQuery2, ciLookupQuery2, ciBranchesQuery2, ciSyncBody2, ciPushBody2, ciDiffBody2, ciPublishBody2, ciPublishPreviewBody2, ciSyncMcpBody2, ciOrgResourcesParam2, orgResourcesConfigSchema2, ciOrgResourcesPushBody2, ciOrgResourcesDiffBody2, CI_APPLY_ENTITY_KINDS2, CI_APPLY_OPERATIONS2, ciApplyErrorBaseSchema2, ciApplyErrorSchema2, ciSyncCountSchema2, ciSyncChangesSchema2, ciSyncWarningSchema2, ciSyncResponseSchema2, adminOrgIdParam2, adminOrgAdminIdParam2, adminUserIdParam2, PRICING_PLAN_ID_RE2, adminPlanIdParam2, adminOrganizationsQuery2, adminUserSearchQuery2, kanbanSlugMigrationQuery2, adjustQuotaBody2, updatePlanBody2, addAdminUserBody2, MAX_VOICE_CALL_MINUTE_OPS2, voiceCallMinuteOps2, updatePlatformConfigBody2, updateFreeOrgLimitBody2, adminScopedTargetBody2, adminRepairLegacyOrgGrantsBody2, adminRepairCompedPlansBody2, updatePricingPlanBody2, dataExplorerSearchQuery2, dataExplorerOrgIdParam2, dataExplorerHubIdParam2, dataExplorerConvIdParam2, dataExplorerDoInstancesQuery2, dataExplorerNsIdParam2, dataExplorerKvKeysBody2, dataExplorerKvKeyBody2, uuidOrHexId2, dataExplorerDeleteOrgParam2, dataExplorerDeleteHubParam2, dataExplorerDeleteConvParam2, dataExplorerDeleteUserParam2, dataExplorerDeleteQuery2, dataExplorerKvDeleteBody2, pitrDoNamespace2, pitrBookmarkParam2, pitrRestoreBody2, healthSamplingTriggerBody2, dataExplorerDebugDoType2, DEBUG_READ_MAX_LIMIT2, DEBUG_READ_DEFAULT_LIMIT2, DEBUG_DO_HEX_PREFIX2, debugDoEntityId2, debugTableName2, dataExplorerDebugTablesParam2, dataExplorerDebugRowsParam2, dataExplorerDebugRowsQuery2, dataExplorerDebugAnalyticsTable2, debugUuid2, dataExplorerDebugAnalyticsRowsParam2, dataExplorerDebugAnalyticsRowsQuery2, debugHubConvParam2, debugMessageIdQuery2, sandboxEgressPolicy2, SANDBOX_EXEC_MAX_CMD_LENGTH2, SANDBOX_EXEC_MAX_ALLOWLIST2, SANDBOX_EXEC_MAX_TIMEOUT_MS2, adminSandboxExecBody2, META_ENTITY_ID_PATTERN2, metaEntityId2, whatsappCallbackBody2, authMeResponse2, wsTicketResponse2, sessionCheckResponse2, logoutResponse2, magicCodeSendBody2, magicCodeSendResponse2, magicCodeVerifyBody2, magicCodeVerifyResponse2, passwordLoginBody2, browserParams2, browserFoldersQuery2, browserFilesQuery2, stateOperationBody2, conversationListResourcesQuery2, conversationReadResourceQuery2, listPendingSchedulesQuery2, listHubAggregateSchedulesQuery2, reportSourceSchema2, intakeReportSourceSchema2, reportClassificationSchema2, reportStatusSchema2, reportLocaleSchema2, reportMessageAuthorRoleSchema2, reportMessageSchema2, sentryRefStatusSchema2, createReportBody2, editReportBody2, reporterReportSummarySchema2, reporterListResponseSchema2, getReportResponseSchema2, reporterTransitionResponseSchema2, contestReportBody2, reporterListQuery2, listReportsQuery2, GITHUB_ISSUE_URL_REGEX2, githubIssueUrlSchema2, transitionReportBody2, groupReportsBody2, holdReportBody2, clickhouseReadyResponse2, bootstrapQuery2, requestSnapshotChunkMessage2, MAX_NAME_LENGTH3, MAX_VALUE_LENGTH2, MAX_TAGS2, MAX_TAG_LENGTH2, MAX_SCOPE_HUBS2, MAX_SCOPE_TAGS2, vaultSecretScopeSchema2, vaultCreateBody2, vaultUpdateBody2, PERMISSIONS2, MAX_NAME_LENGTH22, MAX_HUBS_PER_GRANT2, MAX_HUB_TAGS_PER_GRANT2, MAX_GRANTS2, permissionEnum2, grantScopeSchema2, grantSchema2, createTokenBody2, tokenOrgIdParam2, tokenGrantScopeSchema2, tokenGrantSchema2, tokenMetadataSchema2, listTokensResponse2, createTokenResponse2, orgTokenSummarySchema2, listOrgTokensResponse2, invitePreviewQuery2, invitePreviewResponse2, jsonSchemaSchema2, hubUserIdentity2, stateValueEntry2, getHubUserContextResponse2, updateHubUserBody2, updateHubUserResponse2, unlockHubUserNameResponse2, stateResetParams2, stateResetResponse2, hubAlertsParam2, hubAlertSeverity2, hubAlert2, hubAlertsListResponse2, noticeSeveritySchema2, noticeStatusSchema2, NOTICE_SCOPE_REGEX2, noticeScopeSchema2, noticeLinkSchema2, createNoticeBody2, updateNoticeBody2, listNoticesQuery2, noticeIdParamSchema2, ADMIN_SKILL_NAME_REGEX2, adminSkillNameParam2, rekorBaseChangeMessageSchema2, WAYAI_WORKSPACE_LAYOUT, decisionAnswerSchema, decisionsResponseSchema;
|
|
14383
|
+
var UUID_RE, HEX_RE, WORKOS_ID_RE, OPAQUE_SECRET_RE, BASE64_SECRET_RE, BASE64_MARKER_RE, TOKEN_RE, SENSITIVE_FIELDS, SENSITIVE_KEY_ALTERNATION, SENSITIVE_KEY_PATTERN, JSON_CREDENTIAL_RE, QUERY_CREDENTIAL_RE, REDACTED, PROVIDER_TOKEN_RE, APP_ERROR_BRAND, AppError, LLM_RATE_LIMIT_BRAND, LlmRateLimitError, LLM_PROVIDER_HTTP_BRAND, LlmProviderHttpError, LLM_PROVIDER_CONTENT_BRAND, LlmProviderContentError, LLM_PROVIDER_TIMEOUT_BRAND, LlmProviderTimeoutError, ExternalServiceError, CHANNEL_PROVIDER_HTTP_BRAND, ChannelProviderHttpError, MEDIA_PROVIDER_HTTP_BRAND, MediaProviderHttpError, REKOR_ACTOR_TYPE_HEADER2, REKOR_ACTOR_ID_HEADER2, REKOR_ACTOR_LABEL_HEADER2, REKOR_ACTOR_ORG_HEADER2, REKOR_ACTOR_ADMIN_HEADER2, REKOR_CLIENT_HEADER2, REKOR_TOOL_ID_HEADER2, REKOR_CLIENTS2, rekorClientSchema2, MAX_REKOR_TOOL_ID_LENGTH2, rekorToolIdSchema2, DATA_PROXY_MOUNT2, DATA_PROXY_PREFIX2, DATA_PROXY_ORG_QUERY_PARAM2, MAX_PROVISIONING_BODY_BYTES2, dataProxyQuery2, rekorAttestation2, REQUIRED_REKOR_ATTESTATION_HEADERS2, BASE_DESTRUCTION_MOUNT2, BASE_DESTRUCTION_PREFIX2, BASE_DESTRUCTION_CONFIRM_PATH2, baseDestructionConfirmBody2, BASE_DESTRUCTION_GRACE_MS2, BASE_DESTRUCTION_CONFIRM_TTL_MS2, BASE_DESTRUCTION_ORG_QUERY_PARAM2, baseDestructionQuery2, baseDestructionParam2, baseDestructionInitiateBody2, baseDestructionStatus2, baseDestructionRequest2, baseDestructionListResponse2, baseDestructionInitiateResponse2, baseDestructionConfirmResponse2, baseDestructionCancelResponse2, ENDPOINT_CONFIGS, AUTH_TYPE2, ORG_CREDENTIAL_AUTH_TYPES2, AUTH_TYPE_DISPLAY2, LEGACY_AUTH_TYPE_MAP2, VALID_AUTH_TYPES2, AGENT_ROLES2, SAFE_USER_ID_REGEX2, SUPPORTED_LOCALES2, uuidSchema2, paginationSchema3, timestampSchema2, idParamSchema2, clientOptionalString2, clientOptionalBoolean2, clientOptionalNumber2, messageAttachment2, MAX_MESSAGE_BODY_BYTES2, MAX_ATTACHMENTS_PER_MESSAGE2, MAX_AUDIO_FILE_BASE64_BYTES2, primaryRegionSchema2, placementSourceSchema2, orgIdParam2, orgAdminIdParam2, createOrganizationBody2, updateOrganizationBody2, addOrgAdminBody2, SUMMARIZATION_THRESHOLD_MIN2, SUMMARIZATION_THRESHOLD_MAX2, PREVIOUS_CONVERSATIONS_MAX2, FLAG_CONDITION_OPERATORS2, CONFIDENCE_VARIABLE_SUFFIX2, DECISION_SCORE_MIN_LEVELS2, DECISION_SCORE_MAX_LEVELS2, DECISIONS_MODEL_PREFIXES2, DECISION_CAPABLE_AGENT_ROLES2, NATIVE_TOOL_SCHEMAS2, WAYAI_CONNECTOR2, BASE_NATIVE_TOOLS2, NATIVE_TOOLS2, CATALOG_SIDE_EFFECTS2, NATIVE_TOOL_NAMES2, previousConversationsCountField2, summarizationThresholdField2, flagConditionSchema2, MONITOR_TRIGGERS2, monitorTriggerSchema2, MONITOR_FIRING_TRIGGERS2, MONITOR_DELAY_SECONDS_MIN2, MONITOR_IDLE_DELAY_REQUIRED_MESSAGE2, MONITOR_HISTORY_MESSAGES_MAX2, monitorHistoryMessagesSchema2, monitorIncludeToolResultsSchema2, MONITOR_INPUT_SHAPING_KEYS2, MONITOR_INPUT_SHAPING_SCHEMAS2, MONITOR_INPUT_SHAPING_IDLE_MESSAGE2, monitorArgumentSourceSchema2, MONITOR_NOTE_TEMPLATE_MAX2, MONITOR_STEER_NOTE_MAX2, monitorActionSchema2, monitorRuleSchema2, MONITOR_RULE_KEYS2, MONITOR_RULE_SCHEMAS2, MONITOR_RULE_TRIGGERS2, MONITOR_RULE_TRIGGER_MESSAGE2, CALL_UTTERANCE_SPEAKERS2, callUtteranceSpeakerSchema2, MONITOR_CALL_KEYS2, MONITOR_CALL_SCHEMAS2, MONITOR_CALL_KEY_MESSAGE2, CALL_STEERING_MIN_CONFIDENCE2, CALL_UTTERANCE_RULE_NOT_CONFIDENT_MESSAGE2, CALL_UTTERANCE_FALLBACK_MESSAGE2, CALL_UTTERANCE_FLAG_CONDITIONS_MESSAGE2, CALL_STEER_NOTE_BLANK_MESSAGE2, MONITOR_USER_MESSAGE_ACTION_KINDS2, MONITOR_ASSISTANT_REPLY_ACTION_KINDS2, MONITOR_CALL_UTTERANCE_ACTION_KINDS2, INSERT_NOTE_TOOL_NAME2, RUN_MONITOR_TOOL_NAME2, MONITOR_RULE_ALLOWED_NATIVE_TOOLS2, MONITOR_RULE_REENTRY_TOOLS2, MONITOR_RULE_REENTRY_TRACKS2, monitorConfigField2, flagConditionsField2, agentIdParam2, listAgentsQuery2, agentConnectionsQuery2, createAgentBody2, updateAgentBody2, AGENT_PARAMETER_TYPES2, AGENT_PARAMETER_NAME_REGEX2, agentParameterCreateSchema2, MAX_AGENT_PARAMETERS_PER_REQUEST2, createAgentParametersBody2, SLUG_REGEX2, slugSchema2, INVISIBLE_NAME_CHARS2, MAX_KANBAN_STATUSES2, MAX_FOLLOWUPS_PER_STATUS2, MAX_LANES2, MAX_ADDITIONAL_CONTEXT_SCHEMA_BYTES2, RESERVED_TEMPLATE_DUMP_NAME2, kanbanStatusSlugSchema2, followupTypeSchema2, EVENT_RELATIVE_FOLLOWUP_TYPES2, followupTimeUnitSchema2, followupIdSchema2, SELECTABLE_FOLLOWUP_TYPES2, MAX_LINKED_FOLLOWUP_TARGETS_PER_STATUS2, followupSchema2, MAX_OUTCOMES_PER_STATUS2, kanbanOutcomeSchema2, EXCLUSIVE_FLAG_PAIRS2, kanbanStatusSchema2, kanbanStatusesArraySchema2, laneSchema2, lanesArraySchema2, hubIdParam2, hubAdminIdParam2, hubUserIdParam2, hubIdentityIdParam2, hubTeamIdParam2, hubTeamUserDeleteParam2, hubSchemaQuery2, PREVIEW_LABEL_MAX_LENGTH2, MAX_ENDED_INDEX_RETENTION_DAYS2, MAX_EVAL_RETENTION_DAYS2, previewLabelField2, createHubBody2, updateHubBody2, addHubAdminBody2, addHubIdentityAuthorizationBody2, contactDecisionBody2, approveContactBody2, listContactAccessQuery2, createHubTeamBody2, updateHubTeamBody2, addHubTeamUserBody2, reassignHubUserBody2, replicatePreviewBody2, updateChannelTestIdentitiesBody2, claimCodeChannelParam2, claimCodeDeleteParam2, connectionIdParam2, connectorIdParam2, listConnectionsQuery2, deleteConnectionQuery2, addConnectionBody2, editConnectionBody2, PRODUCTION_DIRECT_FIELDS2, setProductionCredentialBody2, registerWhatsappQuery2, registerWhatsappBody2, retryProvisioningQuery2, resendDomainStatusQuery2, PLACEHOLDER_TOKENS2, ALLOWED_TYPES2, SUBSCHEMA_OBJECT_KEYWORDS2, SUBSCHEMA_LIST_KEYWORDS2, SUBSCHEMA_MAP_KEYWORDS2, MAX_SCHEMA_DEPTH2, toolIdParam2, listToolsQuery2, toolAgentQuery2, deleteToolQuery2, toolConnectionsQuery2, nativeToolIdSchema2, CONTEXT_BOUNDARIES2, contextBoundarySchema2, addNativeToolBody2, addMcpToolBody2, createCustomToolBody2, updateCustomToolBody2, updateToolExecutionConfigBody2, initialValueCreateSchema2, initialValueUpdateSchema2, stateIdParam2, listStatesQuery2, stateNameSchema2, createStateBody2, updateStateBody2, reorderStatesBody2, variantAiModeSchema2, experimentStatusSchema2, overlayUpdateSchema2, experimentIdParam2, variantIdParam2, listExperimentsQuery2, listVariantsQuery2, listOverridesQuery2, deleteOverrideQuery2, createExperimentBody2, updateExperimentBody2, setExperimentStatusBody2, createVariantBody2, updateVariantBody2, upsertOverrideBody2, orgTagIdParam2, listOrgTagsQuery2, ORG_TAG_NAME_REGEX2, ORG_TAG_NAME_MAX_LENGTH2, createOrgTagBody2, updateOrgTagBody2, orgCredentialIdParam2, listOrgCredentialsQuery2, createOrgCredentialBody2, updateOrgCredentialBody2, BASE_CREDENTIAL_NAME_MAX2, baseCredentialNameSchema2, createBaseCredentialLinkBody2, baseCredentialLinkParams2, baseCredentialLinkQuery2, orgResourceIdParam2, orgResourceFileIdParam2, orgResourceFolderIdParam2, hubOrgResourceParam2, listOrgResourcesQuery2, orgIdQuery2, createOrgResourceBody2, updateOrgResourceBody2, createOrgResourceFolderBody2, updateOrgResourceFolderBody2, uploadOrgResourceFileBody2, updateOrgResourceFileBody2, uploadOrgSkillZipBody2, linkOrgResourceBody2, resourceIdParam2, listResourcesQuery2, createResourceBody2, updateResourceBody2, syncSkillsBody2, resourceFileIdParam2, listResourceFilesQuery2, createResourceFileBody2, updateResourceFileBody2, uploadResourceFileBody2, uploadSkillZipBody2, resourceFolderIdParam2, listResourceFoldersQuery2, createResourceFolderBody2, updateResourceFolderBody2, agentResourceQuery2, hubResourceQuery2, linkAgentResourceBody2, updateAgentResourceBody2, unlinkAgentResourceQuery2, navItemSchema2, hubCountResetBody2, navItemCountResetBody2, typingBody2, analyticsHubIdParam2, analyticsVariableIdParam2, updateVariablePinBody2, updateAnalyticsViewBody2, NUMERIC_FILTER_OPS2, TEXT_FILTER_OPS2, CATEGORICAL_FILTER_OPS2, VARIABLE_FILTER_OPS2, STRUCTURED_QUERY_OPS2, STRUCTURED_QUERY_AGGREGATIONS2, filterValueSchema2, conversationsBody2, analyticsConversationIdParam2, messagesQuery2, conversationDetailDataQuery2, analyticsDataBody2, structuredQueryBody2, analyticsSqlBody2, analyticsSqlTable2, analyticsSqlSchemaQuery2, EVAL_PACING_PRESET_NAMES2, PACING_INTERVAL_MIN_MS2, PACING_INTERVAL_MAX_MS2, EVAL_MAX_RUNS_PER_SCENARIO2, EVAL_RUN_DEADLINE_MIN_MS2, EVAL_RUN_DEADLINE_MAX_MS2, ISO_UTC_RE2, paginationSchema22, evalIdParam2, sessionIdParam2, scenarioSetIdParam2, hubIdQuery2, evalDateContextSchema2, EVAL_FIXTURE_NAME_MAX_LENGTH2, evalFixtureOverrideSchema2, runSessionQuery2, runJourneyQuery2, EVAL_INPUT_ROLES2, EVAL_INPUT_ROLE_LIST2, ROLE_ECHO_MAX2, EVAL_INITIAL_STATE_SCOPES2, MAX_INITIAL_STATE_ENTRIES2, evalInitialStateEntry2, evalBody2, EVAL_LIST_MAX_LIMIT2, evalListLimit2, getEvalsQuery2, toggleEvalBody2, bulkToggleEvalsBody2, pacingConfigSchema2, EVAL_MAX_SELECTED_SCENARIOS2, evalScenarioSelectionEntrySchema2, evalScenarioSelectionSchema2, sessionConfigSchema2, createSessionBody2, getSessionsQuery2, getSessionResultsQuery2, getSessionRunsQuery2, evalAnalyticsQuery2, getSessionCostQuery2, compareSessionsQuery2, evalsSqlBody2, evalsSqlSchemaQuery2, exportResultsQuery2, validateEvalBody2, hubAgentsQuery2, createScenarioSetBody2, updateScenarioSetBody2, scenarioSetsHubQuery2, createScenarioFromConversationBody2, createJourneyFromConversationBody2, EVAL_ATTACHMENT_HASH_REGEX2, evalAttachmentRef2, turnMayCarryAttachments2, ATTACHMENTS_USER_ONLY_MESSAGE2, journeyIdParam2, journeyToolCallSchema2, journeyTurnSchema2, journeyStepOverrideSchema2, fixtureField2, createJourneyBody2, updateJourneyBody2, evalSessionConfigResponseSchema2, evalSessionResponseSchema2, evalSessionListConfigSchema2, evalSessionListItemSchema2, seedReleaseStatusSchema2, getConversationsQuery2, getMessagesQuery2, appMessageSenderType2, appMessageReceiverType2, apiChannelMessage2, apiChannelMessageBody2, appMessageBody2, appMessageResponse2, CALL_STATUSES2, callStatus2, CALL_END_REASONS2, callEndReason2, CALL_TRANSPORTS2, callTransport2, CALL_PARTICIPANT_TYPES2, callParticipantType2, callInstant2, MAX_SDP_OFFER_LENGTH2, sdpDescription2, sdpOffer2, MAX_CALL_REQUEST_BODY_BYTES2, hubScoped3, callSummaryFields2, callSummary2, callIdParam2, createCallBody2, createCallResponse2, callReadyBody2, callHangupBody2, callStatusQuery2, MAX_REPORTED_DELEGATION_IDS2, callDelegationId2, callDelegationsBody2, callResponse2, MAX_CALL_RECORDING_GAPS2, callRecordingGap2, callRecordingNoteMetadata2, CALL_OPENING_LANGUAGES2, callOpeningLanguage2, CALL_OPENING_MAX_DURATION_MS2, CALL_OPENING_MAX_BYTES2, CALL_OPENING_CAPTION_MAX_CHARS2, CALL_OPENING_CONTENT_TYPES2, callOpeningContentType2, CALL_OPENING_HASH_REGEX2, callOpeningHash2, callOpeningCaption2, storedCallOpening2, MAX_CALL_OPENING_ENCODED_BYTES2, MAX_CALL_OPENING_BODY_BYTES2, agentCallOpeningParams2, putAgentCallOpeningBody2, deleteAgentCallOpeningQuery2, callOpeningParam2, callOpeningQuery2, TTS_VOICE_REPLY_ENABLED_FIELD2, COPILOT_TRIGGER_FIELD2, AUDIO_LANGUAGE_OPTIONS2, whatsapp2, instagram2, resend2, telegram2, API_CHANNEL_DELIVERY_EVENTS2, apiChannel2, OPENAI_REASONING_MODELS2, openai2, anthropic2, googleAiStudio2, openRouter2, xai2, groqStt2, openaiStt2, elevenLabsStt2, openaiTts2, groqTts2, elevenLabsTts2, GEMINI_TTS_VOICES2, googleTts2, wayai2, externalResources2, restApiTool2, mcpServer2, e2b2, CLAUDE_HARNESS_MODELS2, CLAUDE_HARNESS_MODEL_OPTIONS2, HARNESS_MCP_SERVERS_FIELD2, HARNESS_EGRESS_FIELDS2, claudeAgentSdk2, claudeManagedAgents2, rekorMemory2, SPOKEN_LINE_MAX_CHARS2, gptLive2, CONNECTORS2, evalCallInstant2, EVAL_CALL_MIN_SECONDS2, EVAL_CALL_MAX_SECONDS2, EVAL_CALL_SPOKEN_LINE_MAX_CHARS2, hubScoped22, createEvalCallBody2, createEvalCallResponse2, evalCallConversationQuery2, evalCallSpeaker2, evalCallUtterance2, evalCallTurn2, evalCallRecordResponse2, evalCallFinishResponse2, updateUserBody2, updateProfileBody2, pathnameRegex2, updatePreferencesBody2, registerPushTokenBody2, deletePushTokenQuery2, activityQuery2, deletionModeSchema2, deletionRequestBody2, archiveHubIdParam2, archiveConversationParams2, archiveListQuery2, archiveMessageObservabilityParams2, conversationIdParam2, claimBody2, releaseBody2, transferBody2, closeBody2, additionalContextPayloadSchema2, kanbanUpdateBody2, annotateConversationBody2, observabilityParams2, observabilityListParams2, deleteUserConversationsBody2, deleteUserConversationsResponse2, sendMessageBody2, listConversationsQuery2, flagSourceSchema2, getConversationsResponse2, getConversationDetailParams2, getConversationDetailQuery2, getConversationDetailResponse2, listWhatsAppTemplatesQuery2, sendWhatsAppTemplateBody2, copilotSuggestBody2, copilotSuggestResponse2, CONSULT_THREAD_STATUSES2, consultThreadStatus2, CONSULT_THREAD_TITLE_MAX2, consultThreadTitle2, consultThreadSummary2, listConsultThreadsQuery2, listConsultThreadsResponse2, createConsultThreadBody2, createConsultThreadResponse2, consultThreadIdParam2, updateConsultThreadBody2, updateConsultThreadResponse2, CONSULT_AWAIT_TIMEOUT_MS2, billingOrgIdParam2, subscriptionItemParams2, spendCapBody2, growthPacksBody2, portalSessionBody2, checkoutSessionBody2, updateBillingCurrencyBody2, invoicesQuery2, planKeySchema2, billingStatusSchema2, billingPlanTypeSchema2, dataUsageCountersSchema2, REKOR_ENTITLEMENT_CONTRACT_VERSION2, entitlementProjectionSchema2, rekorEntitlementRefreshMessageSchema2, downloadBody2, uploadQuery2, signUrlBody2, outboundSchemaQuery2, templateIdParam2, listTemplatesQuery2, deleteTemplateQuery2, templateStatusQuery2, createTemplateBody2, updateTemplateBody2, submitTemplateBody2, testTemplateBody2, contactIdParam2, listContactsQuery2, createContactBody2, updateContactBody2, listIdParam2, listListsQuery2, listListContactsQuery2, createListBody2, updateListBody2, addListContactsBody2, removeListContactsBody2, scheduleIdParam2, listSchedulesQuery2, listExecutionsQuery2, createScheduleBody2, updateScheduleBody2, MAX_RESOURCE_FILE_SIZE2, MAX_10MB_BASE64_ENCODED_BYTES2, MAX_EVAL_ATTACHMENT_ENCODED_BYTES2, MAX_EVAL_ATTACHMENT_CARRIERS2, MAX_EVAL_ATTACHMENT_AGGREGATE_ENCODED_BYTES2, MAX_RESOURCE_ENCODED_BYTES2, MAX_HUB_AS_CODE_RESOURCES2, MAX_HUB_AS_CODE_RESOURCE_FILES2, MAX_RESOURCE_AGGREGATE_ENCODED_BYTES2, MAX_CI_CONFIG_BODY_BYTES2, MAX_CALL_OPENING_CARRIERS2, MAX_CALL_OPENING_AGGREGATE_ENCODED_BYTES2, hubAsCodeStateSchema2, hubAsCodeResourceFileSchema2, hubAsCodeResourceSchema2, uuidPattern2, ciUuidSchema2, boundedHubAsCodeResourcesSchema2, hubAsCodeConfigSchema2, ciPullHubIdParam2, ciBranchParam2, ciPullQuery2, ciHubsQuery2, ciLookupQuery2, ciBranchesQuery2, ciSyncBody2, ciPushBody2, ciDiffBody2, ciPublishBody2, ciPublishPreviewBody2, ciSyncMcpBody2, ciOrgResourcesParam2, orgResourcesConfigSchema2, ciOrgResourcesPushBody2, ciOrgResourcesDiffBody2, CI_APPLY_ENTITY_KINDS2, CI_APPLY_OPERATIONS2, ciApplyErrorBaseSchema2, ciApplyErrorSchema2, ciSyncCountSchema2, ciSyncChangesSchema2, ciSyncWarningSchema2, ciSyncResponseSchema2, adminOrgIdParam2, adminOrgAdminIdParam2, adminUserIdParam2, PRICING_PLAN_ID_RE2, adminPlanIdParam2, adminOrganizationsQuery2, adminUserSearchQuery2, kanbanSlugMigrationQuery2, adjustQuotaBody2, updatePlanBody2, addAdminUserBody2, MAX_VOICE_CALL_MINUTE_OPS2, voiceCallMinuteOps2, updatePlatformConfigBody2, updateFreeOrgLimitBody2, adminScopedTargetBody2, adminRepairLegacyOrgGrantsBody2, adminRepairCompedPlansBody2, updatePricingPlanBody2, dataExplorerSearchQuery2, dataExplorerOrgIdParam2, dataExplorerHubIdParam2, dataExplorerConvIdParam2, dataExplorerDoInstancesQuery2, dataExplorerNsIdParam2, dataExplorerKvKeysBody2, dataExplorerKvKeyBody2, uuidOrHexId2, dataExplorerDeleteOrgParam2, dataExplorerDeleteHubParam2, dataExplorerDeleteConvParam2, dataExplorerDeleteUserParam2, dataExplorerDeleteQuery2, dataExplorerKvDeleteBody2, pitrDoNamespace2, pitrBookmarkParam2, pitrRestoreBody2, healthSamplingTriggerBody2, dataExplorerDebugDoType2, DEBUG_READ_MAX_LIMIT2, DEBUG_READ_DEFAULT_LIMIT2, DEBUG_DO_HEX_PREFIX2, debugDoEntityId2, debugTableName2, dataExplorerDebugTablesParam2, dataExplorerDebugRowsParam2, dataExplorerDebugRowsQuery2, dataExplorerDebugAnalyticsTable2, debugUuid2, dataExplorerDebugAnalyticsRowsParam2, dataExplorerDebugAnalyticsRowsQuery2, debugHubConvParam2, debugMessageIdQuery2, sandboxEgressPolicy2, SANDBOX_EXEC_MAX_CMD_LENGTH2, SANDBOX_EXEC_MAX_ALLOWLIST2, SANDBOX_EXEC_MAX_TIMEOUT_MS2, adminSandboxExecBody2, META_ENTITY_ID_PATTERN2, metaEntityId2, whatsappCallbackBody2, authMeResponse2, wsTicketResponse2, sessionCheckResponse2, logoutResponse2, magicCodeSendBody2, magicCodeSendResponse2, magicCodeVerifyBody2, magicCodeVerifyResponse2, passwordLoginBody2, browserParams2, browserFoldersQuery2, browserFilesQuery2, stateOperationBody2, conversationListResourcesQuery2, conversationReadResourceQuery2, listPendingSchedulesQuery2, listHubAggregateSchedulesQuery2, reportSourceSchema2, intakeReportSourceSchema2, reportClassificationSchema2, reportStatusSchema2, reportLocaleSchema2, reportMessageAuthorRoleSchema2, reportMessageSchema2, sentryRefStatusSchema2, createReportBody2, editReportBody2, reporterReportSummarySchema2, reporterListResponseSchema2, getReportResponseSchema2, reporterTransitionResponseSchema2, contestReportBody2, reporterListQuery2, listReportsQuery2, GITHUB_ISSUE_URL_REGEX2, githubIssueUrlSchema2, transitionReportBody2, groupReportsBody2, holdReportBody2, clickhouseReadyResponse2, bootstrapQuery2, requestSnapshotChunkMessage2, MAX_NAME_LENGTH3, MAX_VALUE_LENGTH2, MAX_TAGS2, MAX_TAG_LENGTH2, MAX_SCOPE_HUBS2, MAX_SCOPE_TAGS2, vaultSecretScopeSchema2, vaultCreateBody2, vaultUpdateBody2, PERMISSIONS2, MAX_NAME_LENGTH22, MAX_HUBS_PER_GRANT2, MAX_HUB_TAGS_PER_GRANT2, MAX_GRANTS2, permissionEnum2, grantScopeSchema2, grantSchema2, createTokenBody2, tokenOrgIdParam2, tokenGrantScopeSchema2, tokenGrantSchema2, tokenMetadataSchema2, listTokensResponse2, createTokenResponse2, orgTokenSummarySchema2, listOrgTokensResponse2, invitePreviewQuery2, invitePreviewResponse2, jsonSchemaSchema2, hubUserIdentity2, stateValueEntry2, getHubUserContextResponse2, updateHubUserBody2, updateHubUserResponse2, unlockHubUserNameResponse2, stateResetParams2, stateResetResponse2, hubAlertsParam2, hubAlertSeverity2, hubAlert2, hubAlertsListResponse2, noticeSeveritySchema2, noticeStatusSchema2, NOTICE_SCOPE_REGEX2, noticeScopeSchema2, noticeLinkSchema2, createNoticeBody2, updateNoticeBody2, listNoticesQuery2, noticeIdParamSchema2, ADMIN_SKILL_NAME_REGEX2, adminSkillNameParam2, rekorBaseChangeMessageSchema2, WAYAI_WORKSPACE_LAYOUT, decisionAnswerSchema, decisionsResponseSchema;
|
|
14203
14384
|
var init_dist = __esm({
|
|
14204
14385
|
"../../packages/core/dist/index.js"() {
|
|
14205
14386
|
"use strict";
|
|
@@ -14258,6 +14439,7 @@ var init_dist = __esm({
|
|
|
14258
14439
|
init_zod();
|
|
14259
14440
|
init_zod();
|
|
14260
14441
|
init_zod();
|
|
14442
|
+
init_zod();
|
|
14261
14443
|
UUID_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
14262
14444
|
HEX_RE = /^[0-9a-f]{16,}$/;
|
|
14263
14445
|
WORKOS_ID_RE = /^(?:user|org)_[0-9A-HJKMNP-TV-Z]{26}$/;
|
|
@@ -14712,7 +14894,8 @@ var init_dist = __esm({
|
|
|
14712
14894
|
skipAuthenticatedUsers: true,
|
|
14713
14895
|
userLimitKey: "/api/calls"
|
|
14714
14896
|
},
|
|
14715
|
-
// The routes on one call: `ready`, hang-up, the delegation report and the status read
|
|
14897
|
+
// The routes on one call: `ready`, hang-up, the delegation report and the status read; and
|
|
14898
|
+
// the opening read (`/api/calls/openings/:language`), one per call, before it exists.
|
|
14716
14899
|
// NEVER fail-closed: a refused hang-up leaves the call running, and billing, until a
|
|
14717
14900
|
// limit ends it. The 60 s budget runs on the native binding, which fails open. The key is
|
|
14718
14901
|
// pinned because the paths carry the call id, which would otherwise give every call a
|
|
@@ -17610,6 +17793,51 @@ var init_dist = __esm({
|
|
|
17610
17793
|
gaps: external_exports.array(callRecordingGap2).max(MAX_CALL_RECORDING_GAPS2)
|
|
17611
17794
|
})
|
|
17612
17795
|
});
|
|
17796
|
+
CALL_OPENING_LANGUAGES2 = ["en", "pt", "es"];
|
|
17797
|
+
callOpeningLanguage2 = external_exports.enum(CALL_OPENING_LANGUAGES2);
|
|
17798
|
+
CALL_OPENING_MAX_DURATION_MS2 = 15e3;
|
|
17799
|
+
CALL_OPENING_MAX_BYTES2 = 1024 * 1024;
|
|
17800
|
+
CALL_OPENING_CAPTION_MAX_CHARS2 = 500;
|
|
17801
|
+
CALL_OPENING_CONTENT_TYPES2 = ["audio/mpeg", "audio/mp4"];
|
|
17802
|
+
callOpeningContentType2 = external_exports.enum(CALL_OPENING_CONTENT_TYPES2);
|
|
17803
|
+
CALL_OPENING_HASH_REGEX2 = EVAL_ATTACHMENT_HASH_REGEX2;
|
|
17804
|
+
callOpeningHash2 = external_exports.string().regex(CALL_OPENING_HASH_REGEX2, "Expected a sha256 hex digest");
|
|
17805
|
+
callOpeningCaption2 = external_exports.string().trim().min(1).max(CALL_OPENING_CAPTION_MAX_CHARS2);
|
|
17806
|
+
storedCallOpening2 = external_exports.object({
|
|
17807
|
+
hash: callOpeningHash2,
|
|
17808
|
+
content_type: callOpeningContentType2,
|
|
17809
|
+
duration_ms: external_exports.number().int().positive().max(CALL_OPENING_MAX_DURATION_MS2),
|
|
17810
|
+
file_size: external_exports.number().int().positive().max(CALL_OPENING_MAX_BYTES2),
|
|
17811
|
+
caption: callOpeningCaption2
|
|
17812
|
+
});
|
|
17813
|
+
MAX_CALL_OPENING_ENCODED_BYTES2 = Math.ceil(CALL_OPENING_MAX_BYTES2 / 3) * 4 + 16;
|
|
17814
|
+
MAX_CALL_OPENING_BODY_BYTES2 = MAX_CALL_OPENING_ENCODED_BYTES2 + 16 * 1024;
|
|
17815
|
+
agentCallOpeningParams2 = external_exports.object({
|
|
17816
|
+
id: external_exports.string().uuid(),
|
|
17817
|
+
language: callOpeningLanguage2
|
|
17818
|
+
});
|
|
17819
|
+
putAgentCallOpeningBody2 = external_exports.object({
|
|
17820
|
+
hub_id: external_exports.string().uuid(),
|
|
17821
|
+
caption: callOpeningCaption2,
|
|
17822
|
+
/**
|
|
17823
|
+
* The audio, base64. Absent: the language's current audio stays and only the caption
|
|
17824
|
+
* changes, which needs an opening already set for the language.
|
|
17825
|
+
*/
|
|
17826
|
+
file_data: external_exports.string().min(1).max(MAX_CALL_OPENING_ENCODED_BYTES2).optional()
|
|
17827
|
+
});
|
|
17828
|
+
deleteAgentCallOpeningQuery2 = external_exports.object({
|
|
17829
|
+
hub_id: external_exports.string().uuid()
|
|
17830
|
+
});
|
|
17831
|
+
callOpeningParam2 = external_exports.object({ language: callOpeningLanguage2 });
|
|
17832
|
+
callOpeningQuery2 = external_exports.object({
|
|
17833
|
+
hub_id: external_exports.string().uuid(),
|
|
17834
|
+
/**
|
|
17835
|
+
* The opening the caller's app was told of (`HubCallOpening.version`, `callOpeningVersion`).
|
|
17836
|
+
* Any other answers 404 — the audio or the caption changed since — and the app plays the
|
|
17837
|
+
* platform's opening, so a caption never shows over audio it does not describe.
|
|
17838
|
+
*/
|
|
17839
|
+
v: external_exports.string().regex(/^[a-f0-9]{64}\.[a-f0-9]{8}$/, "Expected a call opening version")
|
|
17840
|
+
});
|
|
17613
17841
|
TTS_VOICE_REPLY_ENABLED_FIELD2 = {
|
|
17614
17842
|
voice_reply_enabled: {
|
|
17615
17843
|
type: "toggle",
|
|
@@ -19393,6 +19621,8 @@ var init_dist = __esm({
|
|
|
19393
19621
|
MAX_HUB_AS_CODE_RESOURCE_FILES2 = 5e3;
|
|
19394
19622
|
MAX_RESOURCE_AGGREGATE_ENCODED_BYTES2 = 32 * 1024 * 1024;
|
|
19395
19623
|
MAX_CI_CONFIG_BODY_BYTES2 = 64 * 1024 * 1024;
|
|
19624
|
+
MAX_CALL_OPENING_CARRIERS2 = 30;
|
|
19625
|
+
MAX_CALL_OPENING_AGGREGATE_ENCODED_BYTES2 = 8 * 1024 * 1024;
|
|
19396
19626
|
hubAsCodeStateSchema2 = external_exports.object({
|
|
19397
19627
|
id: external_exports.string().min(1).optional(),
|
|
19398
19628
|
slug: external_exports.string().optional(),
|
|
@@ -19471,6 +19701,7 @@ var init_dist = __esm({
|
|
|
19471
19701
|
refineHubAsCodeLanes2(config, ctx);
|
|
19472
19702
|
refineHubAsCodeEvals2(config, ctx);
|
|
19473
19703
|
refineHubAsCodeEvalAttachments2(config, ctx);
|
|
19704
|
+
refineHubAsCodeCallOpenings2(config, ctx);
|
|
19474
19705
|
refineHubAsCodeResources2(config, ctx);
|
|
19475
19706
|
refineHubAsCodeDelegation2(config, ctx);
|
|
19476
19707
|
refineHubAsCodeFlagConditions2(config, ctx);
|
|
@@ -20684,7 +20915,7 @@ var init_fs_safety = __esm({
|
|
|
20684
20915
|
"src/lib/fs-safety.ts"() {
|
|
20685
20916
|
"use strict";
|
|
20686
20917
|
init_expected();
|
|
20687
|
-
HUB_MANAGED_SUBDIRS = ["agents", "evals", "journeys", "resources", "attachments"];
|
|
20918
|
+
HUB_MANAGED_SUBDIRS = ["agents", "evals", "journeys", "resources", "attachments", "call-openings"];
|
|
20688
20919
|
HUB_CONFIG_FILES = ["hub.yaml", "wayai.yaml"];
|
|
20689
20920
|
}
|
|
20690
20921
|
});
|
|
@@ -21463,24 +21694,24 @@ import * as path6 from "path";
|
|
|
21463
21694
|
import * as readline from "readline";
|
|
21464
21695
|
function prompt(question) {
|
|
21465
21696
|
const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
|
|
21466
|
-
return new Promise((
|
|
21697
|
+
return new Promise((resolve11) => {
|
|
21467
21698
|
rl.question(question, (answer) => {
|
|
21468
21699
|
rl.close();
|
|
21469
|
-
|
|
21700
|
+
resolve11(answer.trim());
|
|
21470
21701
|
});
|
|
21471
21702
|
});
|
|
21472
21703
|
}
|
|
21473
21704
|
function confirm(question) {
|
|
21474
21705
|
const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
|
|
21475
|
-
return new Promise((
|
|
21706
|
+
return new Promise((resolve11) => {
|
|
21476
21707
|
rl.question(`${question} [y/N]: `, (answer) => {
|
|
21477
21708
|
rl.close();
|
|
21478
|
-
|
|
21709
|
+
resolve11(answer.trim().toLowerCase() === "y");
|
|
21479
21710
|
});
|
|
21480
21711
|
});
|
|
21481
21712
|
}
|
|
21482
21713
|
function promptSecret(question) {
|
|
21483
|
-
return new Promise((
|
|
21714
|
+
return new Promise((resolve11) => {
|
|
21484
21715
|
const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
|
|
21485
21716
|
const originalWrite = rl._writeToOutput;
|
|
21486
21717
|
let firstWrite = true;
|
|
@@ -21496,18 +21727,18 @@ function promptSecret(question) {
|
|
|
21496
21727
|
rl._writeToOutput = originalWrite;
|
|
21497
21728
|
process.stdout.write("\n");
|
|
21498
21729
|
rl.close();
|
|
21499
|
-
|
|
21730
|
+
resolve11(answer);
|
|
21500
21731
|
});
|
|
21501
21732
|
});
|
|
21502
21733
|
}
|
|
21503
21734
|
function readStdin() {
|
|
21504
|
-
return new Promise((
|
|
21735
|
+
return new Promise((resolve11, reject) => {
|
|
21505
21736
|
let data = "";
|
|
21506
21737
|
process.stdin.setEncoding("utf-8");
|
|
21507
21738
|
process.stdin.on("data", (chunk) => {
|
|
21508
21739
|
data += chunk;
|
|
21509
21740
|
});
|
|
21510
|
-
process.stdin.on("end", () =>
|
|
21741
|
+
process.stdin.on("end", () => resolve11(data.trim()));
|
|
21511
21742
|
process.stdin.on("error", reject);
|
|
21512
21743
|
});
|
|
21513
21744
|
}
|
|
@@ -21987,9 +22218,9 @@ function getVersionCachePath(filename = CLI_CACHE_FILE) {
|
|
|
21987
22218
|
}
|
|
21988
22219
|
function readVersionCache(filename = CLI_CACHE_FILE) {
|
|
21989
22220
|
try {
|
|
21990
|
-
const
|
|
21991
|
-
if (!existsSync3(
|
|
21992
|
-
const parsed = JSON.parse(readFileSync6(
|
|
22221
|
+
const path36 = getVersionCachePath(filename);
|
|
22222
|
+
if (!existsSync3(path36)) return null;
|
|
22223
|
+
const parsed = JSON.parse(readFileSync6(path36, "utf-8"));
|
|
21993
22224
|
if (typeof parsed.lastCheck !== "number") return null;
|
|
21994
22225
|
if (parsed.latest !== null && typeof parsed.latest !== "string") return null;
|
|
21995
22226
|
return parsed;
|
|
@@ -22009,10 +22240,10 @@ function isVersionCacheStale(filename = CLI_CACHE_FILE, maxAgeMs = MAX_AGE_24H_M
|
|
|
22009
22240
|
return Date.now() - cache.lastCheck > maxAgeMs;
|
|
22010
22241
|
}
|
|
22011
22242
|
function writeVersionCache(filename, cache) {
|
|
22012
|
-
const
|
|
22013
|
-
const dir = dirname6(
|
|
22243
|
+
const path36 = getVersionCachePath(filename);
|
|
22244
|
+
const dir = dirname6(path36);
|
|
22014
22245
|
if (!existsSync3(dir)) mkdirSync2(dir, { recursive: true });
|
|
22015
|
-
writeFileSync2(
|
|
22246
|
+
writeFileSync2(path36, JSON.stringify(cache));
|
|
22016
22247
|
}
|
|
22017
22248
|
function touchVersionCache(filename) {
|
|
22018
22249
|
writeVersionCache(filename, { lastCheck: Date.now(), latest: readVersionCache(filename)?.latest ?? null });
|
|
@@ -22051,14 +22282,14 @@ function parseFrontmatterVersion(content) {
|
|
|
22051
22282
|
function findInstalledSkills(projectRoot, paths = SKILL_INSTALL_PATHS) {
|
|
22052
22283
|
const found = [];
|
|
22053
22284
|
for (const rel of paths) {
|
|
22054
|
-
const
|
|
22055
|
-
if (!existsSync4(
|
|
22285
|
+
const path36 = join8(projectRoot, rel);
|
|
22286
|
+
if (!existsSync4(path36)) continue;
|
|
22056
22287
|
let version = null;
|
|
22057
22288
|
try {
|
|
22058
|
-
version = parseFrontmatterVersion(readFileSync7(
|
|
22289
|
+
version = parseFrontmatterVersion(readFileSync7(path36, "utf-8"));
|
|
22059
22290
|
} catch {
|
|
22060
22291
|
}
|
|
22061
|
-
found.push({ path:
|
|
22292
|
+
found.push({ path: path36, version });
|
|
22062
22293
|
}
|
|
22063
22294
|
return found;
|
|
22064
22295
|
}
|
|
@@ -22522,7 +22753,7 @@ async function validateToken(apiUrl, token) {
|
|
|
22522
22753
|
}
|
|
22523
22754
|
}
|
|
22524
22755
|
function startCallbackServer(port, expectedState, timeoutMs = 12e4) {
|
|
22525
|
-
return new Promise((
|
|
22756
|
+
return new Promise((resolve11, reject) => {
|
|
22526
22757
|
const server = http.createServer((req, res) => {
|
|
22527
22758
|
const url = new URL(req.url || "/", `http://127.0.0.1:${port}`);
|
|
22528
22759
|
if (url.pathname === "/callback") {
|
|
@@ -22548,7 +22779,7 @@ function startCallbackServer(port, expectedState, timeoutMs = 12e4) {
|
|
|
22548
22779
|
res.writeHead(200, { "Content-Type": "text/html" });
|
|
22549
22780
|
res.end("<html><body><h2>Login successful!</h2><p>You can close this tab and return to your terminal.</p></body></html>");
|
|
22550
22781
|
server.close();
|
|
22551
|
-
|
|
22782
|
+
resolve11({ code, port });
|
|
22552
22783
|
} else {
|
|
22553
22784
|
res.writeHead(400, { "Content-Type": "text/html" });
|
|
22554
22785
|
res.end("<html><body><h2>Login failed</h2><p>No authorization code received</p></body></html>");
|
|
@@ -22760,10 +22991,10 @@ import * as readline2 from "readline";
|
|
|
22760
22991
|
function prompt2(question, defaultValue) {
|
|
22761
22992
|
const rl = readline2.createInterface({ input: process.stdin, output: process.stdout });
|
|
22762
22993
|
const display = defaultValue ? `${question} [${defaultValue}]: ` : `${question}: `;
|
|
22763
|
-
return new Promise((
|
|
22994
|
+
return new Promise((resolve11) => {
|
|
22764
22995
|
rl.question(display, (answer) => {
|
|
22765
22996
|
rl.close();
|
|
22766
|
-
|
|
22997
|
+
resolve11(answer.trim() || defaultValue || "");
|
|
22767
22998
|
});
|
|
22768
22999
|
});
|
|
22769
23000
|
}
|
|
@@ -22891,8 +23122,8 @@ async function tryOpenBrowser(url) {
|
|
|
22891
23122
|
cmd = "xdg-open";
|
|
22892
23123
|
args2 = [url];
|
|
22893
23124
|
}
|
|
22894
|
-
return new Promise((
|
|
22895
|
-
execFile(cmd, args2, (err) =>
|
|
23125
|
+
return new Promise((resolve11) => {
|
|
23126
|
+
execFile(cmd, args2, (err) => resolve11(!err));
|
|
22896
23127
|
});
|
|
22897
23128
|
} catch {
|
|
22898
23129
|
return false;
|
|
@@ -24038,20 +24269,129 @@ var init_eval_attachments = __esm({
|
|
|
24038
24269
|
}
|
|
24039
24270
|
});
|
|
24040
24271
|
|
|
24041
|
-
// src/lib/
|
|
24272
|
+
// src/lib/call-openings.ts
|
|
24042
24273
|
import * as fs11 from "fs";
|
|
24043
24274
|
import * as path13 from "path";
|
|
24275
|
+
function applyCallOpeningFiles(hubFolder, payload) {
|
|
24276
|
+
const root = path13.resolve(hubFolder);
|
|
24277
|
+
const carriers = /* @__PURE__ */ new Map();
|
|
24278
|
+
for (const agent of payload.agents ?? []) {
|
|
24279
|
+
const openings = agent.call_openings;
|
|
24280
|
+
if (!openings || typeof openings !== "object") continue;
|
|
24281
|
+
for (const [language, opening] of Object.entries(openings)) {
|
|
24282
|
+
if (!opening || typeof opening !== "object" || typeof opening.file !== "string") continue;
|
|
24283
|
+
const label = `Agent "${agent.name}" call_openings.${language}`;
|
|
24284
|
+
const abs = path13.resolve(root, opening.file);
|
|
24285
|
+
if (!isUnder(root, abs)) {
|
|
24286
|
+
throw expected(`${label}: file "${opening.file}" escapes the hub folder.`);
|
|
24287
|
+
}
|
|
24288
|
+
let stat2;
|
|
24289
|
+
try {
|
|
24290
|
+
stat2 = fs11.statSync(abs);
|
|
24291
|
+
} catch {
|
|
24292
|
+
}
|
|
24293
|
+
if (!stat2?.isFile()) throw expected(`${label}: file "${opening.file}" not found.`);
|
|
24294
|
+
if (!realpathContained(root, abs)) {
|
|
24295
|
+
throw expected(`${label}: file "${opening.file}" resolves outside the hub folder (symlinks are not allowed).`);
|
|
24296
|
+
}
|
|
24297
|
+
if (stat2.size > CALL_OPENING_MAX_BYTES) {
|
|
24298
|
+
throw expected(`${label}: file "${opening.file}" is ${(stat2.size / 1024 / 1024).toFixed(1)} MB, over the ${CALL_OPENING_MAX_BYTES / 1024 / 1024} MB limit.`);
|
|
24299
|
+
}
|
|
24300
|
+
const bytes = fs11.readFileSync(abs);
|
|
24301
|
+
const hash = computeHash(bytes);
|
|
24302
|
+
const { file: _file, ...rest } = opening;
|
|
24303
|
+
openings[language] = { ...rest, hash };
|
|
24304
|
+
if (!carriers.has(hash)) carriers.set(hash, { hash, content_base64: bytes.toString("base64") });
|
|
24305
|
+
}
|
|
24306
|
+
}
|
|
24307
|
+
if (carriers.size > 0) payload.call_opening_files = [...carriers.values()];
|
|
24308
|
+
}
|
|
24309
|
+
function rewriteCallOpeningsToLocalPaths(payload) {
|
|
24310
|
+
const byHash = new Map((payload.call_opening_files ?? []).map((file) => [file.hash, file]));
|
|
24311
|
+
const downloads = [];
|
|
24312
|
+
for (const agent of payload.agents ?? []) {
|
|
24313
|
+
const openings = agent.call_openings;
|
|
24314
|
+
if (!openings || typeof openings !== "object") continue;
|
|
24315
|
+
for (const language of CALL_OPENING_LANGUAGES) {
|
|
24316
|
+
const opening = openings[language];
|
|
24317
|
+
if (!opening || typeof opening.hash !== "string") continue;
|
|
24318
|
+
const carrier = byHash.get(opening.hash);
|
|
24319
|
+
const ext = carrier?.content_type === "audio/mp4" ? ".m4a" : ".mp3";
|
|
24320
|
+
const relPath = `${CALL_OPENINGS_DIR}/${slugify(agent.name)}-${language}${ext}`;
|
|
24321
|
+
const { hash, ...rest } = opening;
|
|
24322
|
+
openings[language] = { ...rest, file: relPath };
|
|
24323
|
+
if (carrier?.download_url) downloads.push({ relPath, url: carrier.download_url, hash });
|
|
24324
|
+
}
|
|
24325
|
+
}
|
|
24326
|
+
delete payload.call_opening_files;
|
|
24327
|
+
return downloads;
|
|
24328
|
+
}
|
|
24329
|
+
async function downloadCallOpenings(hubFolder, downloads) {
|
|
24330
|
+
const dir = path13.resolve(hubFolder, CALL_OPENINGS_DIR);
|
|
24331
|
+
const result = { changed: [], removed: [] };
|
|
24332
|
+
if (!ensureRealSubdirNoSymlink(hubFolder, dir, downloads.length > 0)) {
|
|
24333
|
+
console.warn(` Warning: ${CALL_OPENINGS_DIR}/ is not reachable inside the hub folder without a symlink; skipping call opening sync.`);
|
|
24334
|
+
return result;
|
|
24335
|
+
}
|
|
24336
|
+
if (!fs11.existsSync(dir)) return result;
|
|
24337
|
+
for (const download of downloads) {
|
|
24338
|
+
const abs = path13.resolve(hubFolder, download.relPath);
|
|
24339
|
+
if (abs === dir || !isUnder(dir, abs)) continue;
|
|
24340
|
+
let existing;
|
|
24341
|
+
try {
|
|
24342
|
+
existing = fs11.lstatSync(abs);
|
|
24343
|
+
} catch {
|
|
24344
|
+
}
|
|
24345
|
+
if (existing?.isFile() && !existing.isSymbolicLink() && computeHash(fs11.readFileSync(abs)) === download.hash) continue;
|
|
24346
|
+
try {
|
|
24347
|
+
const res = await fetch(download.url);
|
|
24348
|
+
if (!res.ok) {
|
|
24349
|
+
console.warn(` Warning: failed to download ${download.relPath} (HTTP ${res.status})`);
|
|
24350
|
+
continue;
|
|
24351
|
+
}
|
|
24352
|
+
if (writeFileNoFollow(hubFolder, abs, Buffer.from(await res.arrayBuffer()))) result.changed.push(download.relPath);
|
|
24353
|
+
} catch (err) {
|
|
24354
|
+
console.warn(` Warning: failed to download ${download.relPath}: ${err instanceof Error ? err.message : String(err)}`);
|
|
24355
|
+
}
|
|
24356
|
+
}
|
|
24357
|
+
const keep = new Set(downloads.map((download) => path13.resolve(hubFolder, download.relPath)));
|
|
24358
|
+
for (const name of fs11.readdirSync(dir)) {
|
|
24359
|
+
const abs = path13.join(dir, name);
|
|
24360
|
+
const st = fs11.lstatSync(abs);
|
|
24361
|
+
if ((st.isFile() || st.isSymbolicLink()) && !keep.has(abs)) {
|
|
24362
|
+
fs11.rmSync(abs);
|
|
24363
|
+
result.removed.push(path13.relative(hubFolder, abs));
|
|
24364
|
+
}
|
|
24365
|
+
}
|
|
24366
|
+
return result;
|
|
24367
|
+
}
|
|
24368
|
+
var CALL_OPENINGS_DIR;
|
|
24369
|
+
var init_call_openings = __esm({
|
|
24370
|
+
"src/lib/call-openings.ts"() {
|
|
24371
|
+
"use strict";
|
|
24372
|
+
init_contracts();
|
|
24373
|
+
init_resource_files();
|
|
24374
|
+
init_fs_safety();
|
|
24375
|
+
init_expected();
|
|
24376
|
+
init_utils();
|
|
24377
|
+
CALL_OPENINGS_DIR = "call-openings";
|
|
24378
|
+
}
|
|
24379
|
+
});
|
|
24380
|
+
|
|
24381
|
+
// src/lib/parser.ts
|
|
24382
|
+
import * as fs12 from "fs";
|
|
24383
|
+
import * as path14 from "path";
|
|
24044
24384
|
import * as yaml6 from "js-yaml";
|
|
24045
24385
|
function refuseConsumedLink(hubFolder, dir, entry) {
|
|
24046
24386
|
if (!entry.isSymbolicLink()) return;
|
|
24047
|
-
const abs =
|
|
24387
|
+
const abs = path14.join(dir, entry.name);
|
|
24048
24388
|
let toDir = false;
|
|
24049
24389
|
try {
|
|
24050
|
-
toDir =
|
|
24390
|
+
toDir = fs12.statSync(abs).isDirectory();
|
|
24051
24391
|
} catch {
|
|
24052
24392
|
}
|
|
24053
24393
|
if (toDir || entry.name.endsWith(".yaml")) {
|
|
24054
|
-
throw symlinkRefusal(
|
|
24394
|
+
throw symlinkRefusal(path14.relative(hubFolder, abs), "file or folder");
|
|
24055
24395
|
}
|
|
24056
24396
|
}
|
|
24057
24397
|
function parseHubFolder(hubFolder, opts) {
|
|
@@ -24087,8 +24427,8 @@ function parseHubFolder(hubFolder, opts) {
|
|
|
24087
24427
|
const resolved = { ...agent };
|
|
24088
24428
|
if (typeof resolved.instructions === "string" && resolved.instructions.endsWith(".md")) {
|
|
24089
24429
|
const instrValue = resolved.instructions;
|
|
24090
|
-
const instructionsPath = instrValue.startsWith("agents/") ?
|
|
24091
|
-
if (!isUnder(
|
|
24430
|
+
const instructionsPath = instrValue.startsWith("agents/") ? path14.join(hubFolder, instrValue) : path14.join(hubFolder, "agents", instrValue);
|
|
24431
|
+
if (!isUnder(path14.join(hubFolder, "agents"), instructionsPath)) {
|
|
24092
24432
|
throw workspaceRefusal(
|
|
24093
24433
|
`Agent instructions path "${instrValue}" (agent "${agent.name}") must stay inside agents/.`
|
|
24094
24434
|
);
|
|
@@ -24102,7 +24442,7 @@ function parseHubFolder(hubFolder, opts) {
|
|
|
24102
24442
|
);
|
|
24103
24443
|
}
|
|
24104
24444
|
} else if (resolved.instructions === void 0 && typeof agent.name === "string") {
|
|
24105
|
-
const conventionPath =
|
|
24445
|
+
const conventionPath = path14.join(hubFolder, "agents", `${slugify(agent.name)}.md`);
|
|
24106
24446
|
const instructions = readRealFileOrThrow(hubFolder, conventionPath);
|
|
24107
24447
|
if (instructions !== null) resolved.instructions = instructions;
|
|
24108
24448
|
}
|
|
@@ -24120,6 +24460,7 @@ function parseHubFolder(hubFolder, opts) {
|
|
|
24120
24460
|
}
|
|
24121
24461
|
if (agents && agents.length > 0) {
|
|
24122
24462
|
payload.agents = agents;
|
|
24463
|
+
applyCallOpeningFiles(hubFolder, payload);
|
|
24123
24464
|
}
|
|
24124
24465
|
if (resources.length > 0) {
|
|
24125
24466
|
payload.resources = resources;
|
|
@@ -24157,28 +24498,28 @@ function parseHubFolder(hubFolder, opts) {
|
|
|
24157
24498
|
return payload;
|
|
24158
24499
|
}
|
|
24159
24500
|
function scanEvalYamlFiles(hubFolder, bytesByHash) {
|
|
24160
|
-
const evalsDir =
|
|
24161
|
-
if (!
|
|
24501
|
+
const evalsDir = path14.join(hubFolder, "evals");
|
|
24502
|
+
if (!fs12.existsSync(evalsDir)) return [];
|
|
24162
24503
|
const evals = [];
|
|
24163
24504
|
const seen = /* @__PURE__ */ new Set();
|
|
24164
|
-
const topEntries =
|
|
24505
|
+
const topEntries = fs12.readdirSync(evalsDir, { withFileTypes: true }).sort((a, b) => a.name.localeCompare(b.name));
|
|
24165
24506
|
for (const entry of topEntries) {
|
|
24166
24507
|
refuseConsumedLink(hubFolder, evalsDir, entry);
|
|
24167
24508
|
if (entry.isFile() && entry.name.endsWith(".yaml")) {
|
|
24168
|
-
collectEval(evals, seen,
|
|
24509
|
+
collectEval(evals, seen, path14.join(evalsDir, entry.name), `evals/${entry.name}`, null, hubFolder, bytesByHash);
|
|
24169
24510
|
} else if (entry.isDirectory()) {
|
|
24170
24511
|
const setName = entry.name;
|
|
24171
|
-
const setDir =
|
|
24172
|
-
const setEntries =
|
|
24512
|
+
const setDir = path14.join(evalsDir, setName);
|
|
24513
|
+
const setEntries = fs12.readdirSync(setDir, { withFileTypes: true }).sort((a, b) => a.name.localeCompare(b.name));
|
|
24173
24514
|
for (const sub of setEntries) {
|
|
24174
24515
|
refuseConsumedLink(hubFolder, setDir, sub);
|
|
24175
24516
|
if (sub.isDirectory()) {
|
|
24176
24517
|
throw expected(
|
|
24177
|
-
`Nested scenario sets are not supported: ${
|
|
24518
|
+
`Nested scenario sets are not supported: ${path14.relative(hubFolder, path14.join(setDir, sub.name))}. Move scenarios up to evals/${setName}/.`
|
|
24178
24519
|
);
|
|
24179
24520
|
}
|
|
24180
24521
|
if (sub.isFile() && sub.name.endsWith(".yaml")) {
|
|
24181
|
-
collectEval(evals, seen,
|
|
24522
|
+
collectEval(evals, seen, path14.join(setDir, sub.name), `evals/${setName}/${sub.name}`, setName, hubFolder, bytesByHash);
|
|
24182
24523
|
}
|
|
24183
24524
|
}
|
|
24184
24525
|
}
|
|
@@ -24192,14 +24533,14 @@ function collectEval(evals, seen, filePath, relPath, setName, hubFolder, bytesBy
|
|
|
24192
24533
|
if (seen.has(key)) {
|
|
24193
24534
|
const where = setName ? `scenario set "${setName}"` : "root";
|
|
24194
24535
|
throw expected(
|
|
24195
|
-
`Duplicate eval at ${where}: "${evalEntry.name}" (in ${
|
|
24536
|
+
`Duplicate eval at ${where}: "${evalEntry.name}" (in ${path14.basename(filePath)}). Each (name, scenario set) pair must be unique.`
|
|
24196
24537
|
);
|
|
24197
24538
|
}
|
|
24198
24539
|
seen.add(key);
|
|
24199
24540
|
evals.push(evalEntry);
|
|
24200
24541
|
}
|
|
24201
24542
|
function parseEvalYaml(filePath, relPath, setName, hubFolder, bytesByHash) {
|
|
24202
|
-
const content =
|
|
24543
|
+
const content = fs12.readFileSync(filePath, "utf-8");
|
|
24203
24544
|
let raw;
|
|
24204
24545
|
try {
|
|
24205
24546
|
raw = yaml6.load(content);
|
|
@@ -24214,7 +24555,7 @@ function parseEvalYaml(filePath, relPath, setName, hubFolder, bytesByHash) {
|
|
|
24214
24555
|
return null;
|
|
24215
24556
|
}
|
|
24216
24557
|
const data = raw;
|
|
24217
|
-
const fileSlug =
|
|
24558
|
+
const fileSlug = path14.basename(filePath, ".yaml");
|
|
24218
24559
|
const evalName = typeof data.name === "string" && data.name.trim().length > 0 ? data.name : fileSlug;
|
|
24219
24560
|
if (typeof data.agent !== "string" || data.agent.trim().length === 0) {
|
|
24220
24561
|
throw expected(`Eval "${evalName}" in ${relPath}: missing required field "agent" (string).`);
|
|
@@ -24301,20 +24642,20 @@ function parseFixtureField(raw, label, key) {
|
|
|
24301
24642
|
return trimmed.length > 0 ? trimmed : void 0;
|
|
24302
24643
|
}
|
|
24303
24644
|
function scanJourneyYamlFiles(hubFolder, bytesByHash) {
|
|
24304
|
-
const journeysDir =
|
|
24305
|
-
if (!
|
|
24645
|
+
const journeysDir = path14.join(hubFolder, "journeys");
|
|
24646
|
+
if (!fs12.existsSync(journeysDir)) return [];
|
|
24306
24647
|
const journeys = [];
|
|
24307
24648
|
const seen = /* @__PURE__ */ new Set();
|
|
24308
|
-
const entries =
|
|
24649
|
+
const entries = fs12.readdirSync(journeysDir, { withFileTypes: true }).sort((a, b) => a.name.localeCompare(b.name));
|
|
24309
24650
|
for (const entry of entries) {
|
|
24310
24651
|
refuseConsumedLink(hubFolder, journeysDir, entry);
|
|
24311
24652
|
if (entry.isDirectory()) {
|
|
24312
24653
|
throw expected(
|
|
24313
|
-
`Subfolders are not supported under journeys/: ${
|
|
24654
|
+
`Subfolders are not supported under journeys/: ${path14.relative(hubFolder, path14.join(journeysDir, entry.name))}. A journey owns its own managed scenario set \u2014 put each journey in a single journeys/<slug>.yaml file.`
|
|
24314
24655
|
);
|
|
24315
24656
|
}
|
|
24316
24657
|
if (!entry.isFile() || !entry.name.endsWith(".yaml")) continue;
|
|
24317
|
-
const journeyEntry = parseJourneyYaml(
|
|
24658
|
+
const journeyEntry = parseJourneyYaml(path14.join(journeysDir, entry.name), `journeys/${entry.name}`, hubFolder, bytesByHash);
|
|
24318
24659
|
if (!journeyEntry) continue;
|
|
24319
24660
|
if (seen.has(journeyEntry.name)) {
|
|
24320
24661
|
throw expected(
|
|
@@ -24327,7 +24668,7 @@ function scanJourneyYamlFiles(hubFolder, bytesByHash) {
|
|
|
24327
24668
|
return journeys;
|
|
24328
24669
|
}
|
|
24329
24670
|
function parseJourneyYaml(filePath, relPath, hubFolder, bytesByHash) {
|
|
24330
|
-
const content =
|
|
24671
|
+
const content = fs12.readFileSync(filePath, "utf-8");
|
|
24331
24672
|
let raw;
|
|
24332
24673
|
try {
|
|
24333
24674
|
raw = yaml6.load(content);
|
|
@@ -24342,7 +24683,7 @@ function parseJourneyYaml(filePath, relPath, hubFolder, bytesByHash) {
|
|
|
24342
24683
|
return null;
|
|
24343
24684
|
}
|
|
24344
24685
|
const data = raw;
|
|
24345
|
-
const fileSlug =
|
|
24686
|
+
const fileSlug = path14.basename(filePath, ".yaml");
|
|
24346
24687
|
const journeyName = typeof data.name === "string" && data.name.trim().length > 0 ? data.name : fileSlug;
|
|
24347
24688
|
if (typeof data.agent !== "string" || data.agent.trim().length === 0) {
|
|
24348
24689
|
throw expected(`Journey "${journeyName}" in ${relPath}: missing required field "agent" (string).`);
|
|
@@ -24382,13 +24723,13 @@ function parseJourneyYaml(filePath, relPath, hubFolder, bytesByHash) {
|
|
|
24382
24723
|
return journeyEntry;
|
|
24383
24724
|
}
|
|
24384
24725
|
function scanAgentYamlFiles(hubFolder) {
|
|
24385
|
-
const agentsDir =
|
|
24386
|
-
if (!
|
|
24387
|
-
const yamlFiles =
|
|
24726
|
+
const agentsDir = path14.join(hubFolder, "agents");
|
|
24727
|
+
if (!fs12.existsSync(agentsDir)) return [];
|
|
24728
|
+
const yamlFiles = fs12.readdirSync(agentsDir).filter((f) => f.endsWith(".yaml")).sort();
|
|
24388
24729
|
if (yamlFiles.length === 0) return [];
|
|
24389
24730
|
const agents = [];
|
|
24390
24731
|
for (const file of yamlFiles) {
|
|
24391
|
-
const filePath =
|
|
24732
|
+
const filePath = path14.join(agentsDir, file);
|
|
24392
24733
|
const content = readRealFileOrThrow(hubFolder, filePath) ?? "";
|
|
24393
24734
|
let agent;
|
|
24394
24735
|
try {
|
|
@@ -24409,7 +24750,7 @@ function scanAgentYamlFiles(hubFolder) {
|
|
|
24409
24750
|
return agents;
|
|
24410
24751
|
}
|
|
24411
24752
|
function parseResources(hubFolder, configResources) {
|
|
24412
|
-
const resourcesDir =
|
|
24753
|
+
const resourcesDir = path14.join(hubFolder, "resources");
|
|
24413
24754
|
const results = [];
|
|
24414
24755
|
for (const res of configResources) {
|
|
24415
24756
|
const resource = {
|
|
@@ -24423,9 +24764,9 @@ function parseResources(hubFolder, configResources) {
|
|
|
24423
24764
|
if (res.user_browsable) resource.user_browsable = res.user_browsable;
|
|
24424
24765
|
if (res.skill_name) resource.skill_name = res.skill_name;
|
|
24425
24766
|
const resSlug = slugify(resource.name);
|
|
24426
|
-
const resDir =
|
|
24767
|
+
const resDir = path14.join(resourcesDir, resSlug);
|
|
24427
24768
|
requireRealSubdirNoSymlink(hubFolder, resDir, false);
|
|
24428
|
-
if (
|
|
24769
|
+
if (fs12.existsSync(resDir)) {
|
|
24429
24770
|
const files = scanResourceFiles(resDir, "");
|
|
24430
24771
|
if (files.length > 0) {
|
|
24431
24772
|
resource.files = files;
|
|
@@ -24441,6 +24782,7 @@ var init_parser = __esm({
|
|
|
24441
24782
|
init_utils();
|
|
24442
24783
|
init_resource_files();
|
|
24443
24784
|
init_eval_attachments();
|
|
24785
|
+
init_call_openings();
|
|
24444
24786
|
init_expected();
|
|
24445
24787
|
init_fs_safety();
|
|
24446
24788
|
}
|
|
@@ -24474,7 +24816,7 @@ var init_diff_display = __esm({
|
|
|
24474
24816
|
});
|
|
24475
24817
|
|
|
24476
24818
|
// src/lib/workspace-files.ts
|
|
24477
|
-
import * as
|
|
24819
|
+
import * as path15 from "path";
|
|
24478
24820
|
function perHubAgentsMd(hubFolderName) {
|
|
24479
24821
|
return [
|
|
24480
24822
|
`# ${hubFolderName}`,
|
|
@@ -24490,7 +24832,7 @@ function perHubAgentsMd(hubFolderName) {
|
|
|
24490
24832
|
].join("\n");
|
|
24491
24833
|
}
|
|
24492
24834
|
function writeIfAbsent(root, filePath, content) {
|
|
24493
|
-
return createFileNoFollow(root, filePath, Buffer.from(content, "utf-8")) === "created" ?
|
|
24835
|
+
return createFileNoFollow(root, filePath, Buffer.from(content, "utf-8")) === "created" ? path15.basename(filePath) : null;
|
|
24494
24836
|
}
|
|
24495
24837
|
var init_workspace_files = __esm({
|
|
24496
24838
|
"src/lib/workspace-files.ts"() {
|
|
@@ -24500,16 +24842,16 @@ var init_workspace_files = __esm({
|
|
|
24500
24842
|
});
|
|
24501
24843
|
|
|
24502
24844
|
// src/lib/yaml-writer.ts
|
|
24503
|
-
import * as
|
|
24504
|
-
import * as
|
|
24845
|
+
import * as fs13 from "fs";
|
|
24846
|
+
import * as path16 from "path";
|
|
24505
24847
|
import * as yaml7 from "js-yaml";
|
|
24506
24848
|
function writeFileIfChanged(hubFolder, absPath, content, log) {
|
|
24507
24849
|
const buf = Buffer.from(content, "utf-8");
|
|
24508
24850
|
if (fileHasBytes(absPath, buf)) return;
|
|
24509
24851
|
if (writeFileNoFollow(hubFolder, absPath, buf)) {
|
|
24510
|
-
log.changed.push(
|
|
24852
|
+
log.changed.push(path16.relative(hubFolder, absPath));
|
|
24511
24853
|
} else {
|
|
24512
|
-
console.warn(` Warning: skipping ${
|
|
24854
|
+
console.warn(` Warning: skipping ${path16.relative(hubFolder, absPath)} (destination escapes the hub folder via a symlink)`);
|
|
24513
24855
|
}
|
|
24514
24856
|
}
|
|
24515
24857
|
function buildEvalYamlObject(evalEntry, slug) {
|
|
@@ -24550,51 +24892,51 @@ function buildEvalYamlObject(evalEntry, slug) {
|
|
|
24550
24892
|
}
|
|
24551
24893
|
function writeHubFolder(hubFolder, payload, options = {}) {
|
|
24552
24894
|
const log = { changed: [], removed: [] };
|
|
24553
|
-
const agentsDir =
|
|
24554
|
-
if (!
|
|
24555
|
-
|
|
24895
|
+
const agentsDir = path16.join(hubFolder, "agents");
|
|
24896
|
+
if (!fs13.existsSync(hubFolder)) {
|
|
24897
|
+
fs13.mkdirSync(hubFolder, { recursive: true });
|
|
24556
24898
|
}
|
|
24557
|
-
if (!
|
|
24558
|
-
|
|
24899
|
+
if (!fs13.existsSync(agentsDir)) {
|
|
24900
|
+
fs13.mkdirSync(agentsDir, { recursive: true });
|
|
24559
24901
|
}
|
|
24560
24902
|
const yamlPayload = buildYamlPayload(payload);
|
|
24561
24903
|
const agentFiles = extractAgentFiles(payload);
|
|
24562
24904
|
const yamlContent = yaml7.dump(yamlPayload, YAML_DUMP_OPTIONS);
|
|
24563
|
-
writeFileIfChanged(hubFolder,
|
|
24905
|
+
writeFileIfChanged(hubFolder, path16.join(hubFolder, "hub.yaml"), yamlContent, log);
|
|
24564
24906
|
if (options.seedAgentContext ?? true) {
|
|
24565
24907
|
const seeded = writeIfAbsent(
|
|
24566
24908
|
hubFolder,
|
|
24567
|
-
|
|
24568
|
-
perHubAgentsMd(
|
|
24909
|
+
path16.join(hubFolder, "AGENTS.md"),
|
|
24910
|
+
perHubAgentsMd(path16.basename(hubFolder))
|
|
24569
24911
|
);
|
|
24570
24912
|
if (seeded) log.changed.push(seeded);
|
|
24571
24913
|
}
|
|
24572
|
-
const oldYamlPath =
|
|
24573
|
-
if (
|
|
24574
|
-
|
|
24575
|
-
log.removed.push(
|
|
24914
|
+
const oldYamlPath = path16.join(hubFolder, "wayai.yaml");
|
|
24915
|
+
if (fs13.existsSync(oldYamlPath)) {
|
|
24916
|
+
fs13.unlinkSync(oldYamlPath);
|
|
24917
|
+
log.removed.push(path16.relative(hubFolder, oldYamlPath));
|
|
24576
24918
|
}
|
|
24577
24919
|
const yamlSlugs = writeAgentYamlFiles(hubFolder, agentsDir, payload.agents || [], log);
|
|
24578
24920
|
const mdSlugs = /* @__PURE__ */ new Set();
|
|
24579
24921
|
for (const { slug, content } of agentFiles) {
|
|
24580
24922
|
mdSlugs.add(slug);
|
|
24581
|
-
writeFileIfChanged(hubFolder,
|
|
24923
|
+
writeFileIfChanged(hubFolder, path16.join(agentsDir, `${slug}.md`), content, log);
|
|
24582
24924
|
}
|
|
24583
|
-
const existingFiles =
|
|
24925
|
+
const existingFiles = fs13.readdirSync(agentsDir);
|
|
24584
24926
|
for (const file of existingFiles) {
|
|
24585
24927
|
if (file.endsWith(".yaml")) {
|
|
24586
24928
|
const slug = file.slice(0, -5);
|
|
24587
24929
|
if (!yamlSlugs.has(slug)) {
|
|
24588
|
-
const orphan =
|
|
24589
|
-
|
|
24590
|
-
log.removed.push(
|
|
24930
|
+
const orphan = path16.join(agentsDir, file);
|
|
24931
|
+
fs13.unlinkSync(orphan);
|
|
24932
|
+
log.removed.push(path16.relative(hubFolder, orphan));
|
|
24591
24933
|
}
|
|
24592
24934
|
} else if (file.endsWith(".md")) {
|
|
24593
24935
|
const slug = file.slice(0, -3);
|
|
24594
24936
|
if (!mdSlugs.has(slug)) {
|
|
24595
|
-
const orphan =
|
|
24596
|
-
|
|
24597
|
-
log.removed.push(
|
|
24937
|
+
const orphan = path16.join(agentsDir, file);
|
|
24938
|
+
fs13.unlinkSync(orphan);
|
|
24939
|
+
log.removed.push(path16.relative(hubFolder, orphan));
|
|
24598
24940
|
}
|
|
24599
24941
|
}
|
|
24600
24942
|
}
|
|
@@ -24656,7 +24998,7 @@ function writeAgentYamlFiles(hubFolder, agentsDir, agents, log) {
|
|
|
24656
24998
|
const entry = { ...agent };
|
|
24657
24999
|
delete entry.instructions;
|
|
24658
25000
|
const yamlContent = yaml7.dump(entry, YAML_DUMP_OPTIONS);
|
|
24659
|
-
writeFileIfChanged(hubFolder,
|
|
25001
|
+
writeFileIfChanged(hubFolder, path16.join(agentsDir, `${slug}.yaml`), yamlContent, log);
|
|
24660
25002
|
}
|
|
24661
25003
|
return slugs;
|
|
24662
25004
|
}
|
|
@@ -24673,27 +25015,27 @@ function extractAgentFiles(payload) {
|
|
|
24673
25015
|
return files;
|
|
24674
25016
|
}
|
|
24675
25017
|
function writeEvalYamlFiles(hubFolder, evals, log) {
|
|
24676
|
-
const evalsDir =
|
|
25018
|
+
const evalsDir = path16.join(hubFolder, "evals");
|
|
24677
25019
|
if (evals.length === 0) {
|
|
24678
|
-
if (
|
|
25020
|
+
if (fs13.existsSync(evalsDir)) {
|
|
24679
25021
|
cleanEvalOrphans(hubFolder, evalsDir, /* @__PURE__ */ new Set(), log);
|
|
24680
25022
|
try {
|
|
24681
|
-
if (
|
|
25023
|
+
if (fs13.readdirSync(evalsDir).length === 0) fs13.rmdirSync(evalsDir);
|
|
24682
25024
|
} catch {
|
|
24683
25025
|
}
|
|
24684
25026
|
}
|
|
24685
25027
|
return;
|
|
24686
25028
|
}
|
|
24687
|
-
if (!
|
|
24688
|
-
|
|
25029
|
+
if (!fs13.existsSync(evalsDir)) {
|
|
25030
|
+
fs13.mkdirSync(evalsDir, { recursive: true });
|
|
24689
25031
|
}
|
|
24690
25032
|
const writtenRelPaths = /* @__PURE__ */ new Set();
|
|
24691
25033
|
for (const evalEntry of evals) {
|
|
24692
25034
|
const slug = slugify(evalEntry.name);
|
|
24693
25035
|
const setName = evalEntry.path && evalEntry.path.trim().length > 0 ? evalEntry.path : null;
|
|
24694
25036
|
const relPath = setName ? `${setName}/${slug}.yaml` : `${slug}.yaml`;
|
|
24695
|
-
const targetPath =
|
|
24696
|
-
if (!targetPath.startsWith(evalsDir +
|
|
25037
|
+
const targetPath = path16.join(evalsDir, relPath);
|
|
25038
|
+
if (!targetPath.startsWith(evalsDir + path16.sep)) {
|
|
24697
25039
|
console.warn(` Warning: skipping eval "${evalEntry.name}" (scenario set "${setName}" escapes evals/ \u2014 possible bad backend data)`);
|
|
24698
25040
|
continue;
|
|
24699
25041
|
}
|
|
@@ -24704,31 +25046,31 @@ function writeEvalYamlFiles(hubFolder, evals, log) {
|
|
|
24704
25046
|
cleanEvalOrphans(hubFolder, evalsDir, writtenRelPaths, log);
|
|
24705
25047
|
}
|
|
24706
25048
|
function cleanEvalOrphans(hubFolder, evalsDir, writtenRelPaths, log) {
|
|
24707
|
-
const entries =
|
|
25049
|
+
const entries = fs13.readdirSync(evalsDir, { withFileTypes: true });
|
|
24708
25050
|
for (const entry of entries) {
|
|
24709
|
-
const fullPath =
|
|
25051
|
+
const fullPath = path16.join(evalsDir, entry.name);
|
|
24710
25052
|
if (entry.isFile()) {
|
|
24711
25053
|
if (entry.name.endsWith(".yaml") && !writtenRelPaths.has(entry.name)) {
|
|
24712
|
-
|
|
24713
|
-
log.removed.push(
|
|
25054
|
+
fs13.unlinkSync(fullPath);
|
|
25055
|
+
log.removed.push(path16.relative(hubFolder, fullPath));
|
|
24714
25056
|
}
|
|
24715
25057
|
continue;
|
|
24716
25058
|
}
|
|
24717
25059
|
if (entry.isDirectory()) {
|
|
24718
25060
|
const setName = entry.name;
|
|
24719
|
-
const subEntries =
|
|
25061
|
+
const subEntries = fs13.readdirSync(fullPath, { withFileTypes: true });
|
|
24720
25062
|
for (const sub of subEntries) {
|
|
24721
25063
|
if (sub.isFile() && sub.name.endsWith(".yaml")) {
|
|
24722
25064
|
const relPath = `${setName}/${sub.name}`;
|
|
24723
25065
|
if (!writtenRelPaths.has(relPath)) {
|
|
24724
|
-
const orphan =
|
|
24725
|
-
|
|
24726
|
-
log.removed.push(
|
|
25066
|
+
const orphan = path16.join(fullPath, sub.name);
|
|
25067
|
+
fs13.unlinkSync(orphan);
|
|
25068
|
+
log.removed.push(path16.relative(hubFolder, orphan));
|
|
24727
25069
|
}
|
|
24728
25070
|
}
|
|
24729
25071
|
}
|
|
24730
25072
|
try {
|
|
24731
|
-
if (
|
|
25073
|
+
if (fs13.readdirSync(fullPath).length === 0) fs13.rmdirSync(fullPath);
|
|
24732
25074
|
} catch {
|
|
24733
25075
|
}
|
|
24734
25076
|
}
|
|
@@ -24765,19 +25107,19 @@ function buildJourneyYamlObject(journeyEntry, slug) {
|
|
|
24765
25107
|
return out;
|
|
24766
25108
|
}
|
|
24767
25109
|
function writeJourneyYamlFiles(hubFolder, journeys, log) {
|
|
24768
|
-
const journeysDir =
|
|
25110
|
+
const journeysDir = path16.join(hubFolder, "journeys");
|
|
24769
25111
|
if (journeys.length === 0) {
|
|
24770
|
-
if (
|
|
25112
|
+
if (fs13.existsSync(journeysDir)) {
|
|
24771
25113
|
cleanJourneyOrphans(hubFolder, journeysDir, /* @__PURE__ */ new Set(), log);
|
|
24772
25114
|
try {
|
|
24773
|
-
if (
|
|
25115
|
+
if (fs13.readdirSync(journeysDir).length === 0) fs13.rmdirSync(journeysDir);
|
|
24774
25116
|
} catch {
|
|
24775
25117
|
}
|
|
24776
25118
|
}
|
|
24777
25119
|
return;
|
|
24778
25120
|
}
|
|
24779
|
-
if (!
|
|
24780
|
-
|
|
25121
|
+
if (!fs13.existsSync(journeysDir)) {
|
|
25122
|
+
fs13.mkdirSync(journeysDir, { recursive: true });
|
|
24781
25123
|
}
|
|
24782
25124
|
const writtenFiles = /* @__PURE__ */ new Set();
|
|
24783
25125
|
const usedSlugs = /* @__PURE__ */ new Set();
|
|
@@ -24785,37 +25127,37 @@ function writeJourneyYamlFiles(hubFolder, journeys, log) {
|
|
|
24785
25127
|
const slug = ensureUniqueSlug(slugify(journeyEntry.name), usedSlugs);
|
|
24786
25128
|
const fileName = `${slug}.yaml`;
|
|
24787
25129
|
const yamlContent = yaml7.dump(buildJourneyYamlObject(journeyEntry, slug), YAML_DUMP_OPTIONS);
|
|
24788
|
-
writeFileIfChanged(hubFolder,
|
|
25130
|
+
writeFileIfChanged(hubFolder, path16.join(journeysDir, fileName), yamlContent, log);
|
|
24789
25131
|
writtenFiles.add(fileName);
|
|
24790
25132
|
}
|
|
24791
25133
|
cleanJourneyOrphans(hubFolder, journeysDir, writtenFiles, log);
|
|
24792
25134
|
}
|
|
24793
25135
|
function cleanJourneyOrphans(hubFolder, journeysDir, writtenFiles, log) {
|
|
24794
|
-
const entries =
|
|
25136
|
+
const entries = fs13.readdirSync(journeysDir, { withFileTypes: true });
|
|
24795
25137
|
for (const entry of entries) {
|
|
24796
25138
|
if (entry.isFile() && entry.name.endsWith(".yaml") && !writtenFiles.has(entry.name)) {
|
|
24797
|
-
const orphan =
|
|
24798
|
-
|
|
24799
|
-
log.removed.push(
|
|
25139
|
+
const orphan = path16.join(journeysDir, entry.name);
|
|
25140
|
+
fs13.unlinkSync(orphan);
|
|
25141
|
+
log.removed.push(path16.relative(hubFolder, orphan));
|
|
24800
25142
|
}
|
|
24801
25143
|
}
|
|
24802
25144
|
}
|
|
24803
25145
|
function writeResourceFiles(hubFolder, resources, log) {
|
|
24804
|
-
const resourcesDir =
|
|
25146
|
+
const resourcesDir = path16.join(hubFolder, "resources");
|
|
24805
25147
|
const currentSlugs = /* @__PURE__ */ new Set();
|
|
24806
25148
|
for (const resource of resources) {
|
|
24807
25149
|
const resSlug = slugify(resource.name);
|
|
24808
25150
|
currentSlugs.add(resSlug);
|
|
24809
|
-
const resDir =
|
|
25151
|
+
const resDir = path16.join(resourcesDir, resSlug);
|
|
24810
25152
|
writeResourceFileTree(resDir, resource.files || [], hubFolder, log);
|
|
24811
25153
|
}
|
|
24812
|
-
if (
|
|
24813
|
-
const existingDirs =
|
|
25154
|
+
if (fs13.existsSync(resourcesDir)) {
|
|
25155
|
+
const existingDirs = fs13.readdirSync(resourcesDir, { withFileTypes: true });
|
|
24814
25156
|
for (const entry of existingDirs) {
|
|
24815
25157
|
if (entry.isDirectory() && !currentSlugs.has(entry.name)) {
|
|
24816
|
-
const orphanDir =
|
|
24817
|
-
|
|
24818
|
-
log.removed.push(`${
|
|
25158
|
+
const orphanDir = path16.join(resourcesDir, entry.name);
|
|
25159
|
+
fs13.rmSync(orphanDir, { recursive: true, force: true });
|
|
25160
|
+
log.removed.push(`${path16.relative(hubFolder, orphanDir)}/`);
|
|
24819
25161
|
}
|
|
24820
25162
|
}
|
|
24821
25163
|
}
|
|
@@ -24843,7 +25185,7 @@ var init_yaml_writer = __esm({
|
|
|
24843
25185
|
});
|
|
24844
25186
|
|
|
24845
25187
|
// src/lib/hub-materializer.ts
|
|
24846
|
-
import * as
|
|
25188
|
+
import * as path17 from "path";
|
|
24847
25189
|
async function materializeHubFolder(hubFolder, payload, options = {}) {
|
|
24848
25190
|
if (materialized.has(payload)) {
|
|
24849
25191
|
throw new Error(
|
|
@@ -24853,13 +25195,15 @@ async function materializeHubFolder(hubFolder, payload, options = {}) {
|
|
|
24853
25195
|
materialized.add(payload);
|
|
24854
25196
|
requireRealHubFolder(hubFolder, true);
|
|
24855
25197
|
const attachmentDownloads = rewriteEvalAttachmentsToLocalPaths(payload);
|
|
25198
|
+
const openingDownloads = rewriteCallOpeningsToLocalPaths(payload);
|
|
24856
25199
|
const writeLog = writeHubFolder(hubFolder, payload, options);
|
|
24857
25200
|
const resourceDownloads = await downloadBinaryResourceFiles(hubFolder, payload);
|
|
24858
25201
|
const attachments = await downloadEvalAttachments(hubFolder, attachmentDownloads);
|
|
25202
|
+
const openings = await downloadCallOpenings(hubFolder, openingDownloads);
|
|
24859
25203
|
return {
|
|
24860
25204
|
attachmentsWritten: attachments.written,
|
|
24861
|
-
changed: [...writeLog.changed, ...resourceDownloads.changed, ...attachments.changed],
|
|
24862
|
-
removed: [...writeLog.removed, ...attachments.removed]
|
|
25205
|
+
changed: [...writeLog.changed, ...resourceDownloads.changed, ...attachments.changed, ...openings.changed],
|
|
25206
|
+
removed: [...writeLog.removed, ...attachments.removed, ...openings.removed]
|
|
24863
25207
|
};
|
|
24864
25208
|
}
|
|
24865
25209
|
async function downloadBinaryResourceFiles(hubFolder, payload) {
|
|
@@ -24868,7 +25212,7 @@ async function downloadBinaryResourceFiles(hubFolder, payload) {
|
|
|
24868
25212
|
let downloadCount = 0;
|
|
24869
25213
|
for (const resource of resources) {
|
|
24870
25214
|
if (!resource.files) continue;
|
|
24871
|
-
const resDir =
|
|
25215
|
+
const resDir = path17.join(hubFolder, "resources", slugify(resource.name));
|
|
24872
25216
|
downloadCount += await downloadBinaryFiles(resDir, resource.files, hubFolder, log);
|
|
24873
25217
|
}
|
|
24874
25218
|
if (downloadCount > 0) {
|
|
@@ -24882,6 +25226,7 @@ var init_hub_materializer = __esm({
|
|
|
24882
25226
|
"use strict";
|
|
24883
25227
|
init_yaml_writer();
|
|
24884
25228
|
init_eval_attachments();
|
|
25229
|
+
init_call_openings();
|
|
24885
25230
|
init_resource_files();
|
|
24886
25231
|
init_fs_safety();
|
|
24887
25232
|
init_utils();
|
|
@@ -24905,11 +25250,11 @@ var init_terminal_output = __esm({
|
|
|
24905
25250
|
});
|
|
24906
25251
|
|
|
24907
25252
|
// src/lib/base-workspace.ts
|
|
24908
|
-
import * as
|
|
24909
|
-
import * as
|
|
25253
|
+
import * as fs14 from "fs";
|
|
25254
|
+
import * as path18 from "path";
|
|
24910
25255
|
import * as yaml8 from "js-yaml";
|
|
24911
25256
|
function readBaseMeta(folder) {
|
|
24912
|
-
const bytes = readFileNoFollow(folder,
|
|
25257
|
+
const bytes = readFileNoFollow(folder, path18.join(folder, BASE_META_FILE));
|
|
24913
25258
|
if (bytes === null) return null;
|
|
24914
25259
|
let doc;
|
|
24915
25260
|
try {
|
|
@@ -24923,13 +25268,13 @@ function readBaseMeta(folder) {
|
|
|
24923
25268
|
function listBaseFolders(basesDir) {
|
|
24924
25269
|
let entries;
|
|
24925
25270
|
try {
|
|
24926
|
-
entries =
|
|
25271
|
+
entries = fs14.readdirSync(basesDir).filter((entry) => !entry.startsWith("."));
|
|
24927
25272
|
} catch {
|
|
24928
25273
|
return [];
|
|
24929
25274
|
}
|
|
24930
25275
|
const out = [];
|
|
24931
25276
|
for (const name of entries.sort()) {
|
|
24932
|
-
const folder =
|
|
25277
|
+
const folder = path18.join(basesDir, name);
|
|
24933
25278
|
if (!isDirectory(folder)) continue;
|
|
24934
25279
|
const meta = readBaseMeta(folder);
|
|
24935
25280
|
if (meta) out.push({ folder, meta });
|
|
@@ -24943,12 +25288,12 @@ function filterEditableBases(bases) {
|
|
|
24943
25288
|
return bases.filter((b) => !isProductionFolder(b.meta));
|
|
24944
25289
|
}
|
|
24945
25290
|
function findEnclosingBaseFolder(basesDir, cwd) {
|
|
24946
|
-
let dir =
|
|
24947
|
-
const stop =
|
|
25291
|
+
let dir = path18.resolve(cwd);
|
|
25292
|
+
const stop = path18.resolve(basesDir);
|
|
24948
25293
|
while (isUnder(stop, dir)) {
|
|
24949
25294
|
const meta = readBaseMeta(dir);
|
|
24950
25295
|
if (meta) return { folder: dir, meta };
|
|
24951
|
-
const parent =
|
|
25296
|
+
const parent = path18.dirname(dir);
|
|
24952
25297
|
if (parent === dir) break;
|
|
24953
25298
|
dir = parent;
|
|
24954
25299
|
}
|
|
@@ -24956,7 +25301,7 @@ function findEnclosingBaseFolder(basesDir, cwd) {
|
|
|
24956
25301
|
}
|
|
24957
25302
|
function folderForSelector(basesDir, selector) {
|
|
24958
25303
|
assertValidBaseSelector(selector);
|
|
24959
|
-
return
|
|
25304
|
+
return path18.join(basesDir, selector);
|
|
24960
25305
|
}
|
|
24961
25306
|
function assertValidBaseSelector(selector, source = "base") {
|
|
24962
25307
|
if (!isPathSafeId(selector)) {
|
|
@@ -24989,24 +25334,24 @@ function resolveBaseTarget(gitRoot, selector, cwd = process.cwd()) {
|
|
|
24989
25334
|
throw expected(
|
|
24990
25335
|
[
|
|
24991
25336
|
`Multiple bases found in ${label}/. Pass --base <id|folder-name> to choose, or run from inside a base folder:`,
|
|
24992
|
-
...editable.map((b) => ` ${
|
|
25337
|
+
...editable.map((b) => ` ${path18.basename(b.folder)} (${b.meta.base_id ?? "not created yet"})`)
|
|
24993
25338
|
].join("\n")
|
|
24994
25339
|
);
|
|
24995
25340
|
}
|
|
24996
25341
|
function targetBaseId(target, selector) {
|
|
24997
25342
|
if (target.meta?.base_id) return target.meta.base_id;
|
|
24998
|
-
if (selector && !selector.includes("/") && !selector.includes(
|
|
24999
|
-
return target.exists ? null :
|
|
25343
|
+
if (selector && !selector.includes("/") && !selector.includes(path18.sep)) return selector;
|
|
25344
|
+
return target.exists ? null : path18.basename(target.folder);
|
|
25000
25345
|
}
|
|
25001
25346
|
function resolveBaseSelectorToId(gitRoot, selector) {
|
|
25002
|
-
if (!gitRoot || selector.includes("/") || selector.includes(
|
|
25347
|
+
if (!gitRoot || selector.includes("/") || selector.includes(path18.sep)) return selector;
|
|
25003
25348
|
if (!isPathSafeId(selector)) return selector;
|
|
25004
|
-
const id = readBaseMeta(
|
|
25349
|
+
const id = readBaseMeta(path18.join(resolveBasesDir(gitRoot), selector))?.base_id;
|
|
25005
25350
|
return typeof id === "string" && isPathSafeId(id) ? id : selector;
|
|
25006
25351
|
}
|
|
25007
25352
|
function hasBaseMetaFile(folder) {
|
|
25008
25353
|
try {
|
|
25009
|
-
return
|
|
25354
|
+
return fs14.lstatSync(path18.join(folder, BASE_META_FILE)).isFile();
|
|
25010
25355
|
} catch {
|
|
25011
25356
|
return false;
|
|
25012
25357
|
}
|
|
@@ -25025,7 +25370,7 @@ var init_base_workspace = __esm({
|
|
|
25025
25370
|
});
|
|
25026
25371
|
|
|
25027
25372
|
// src/lib/subtree-routing.ts
|
|
25028
|
-
import * as
|
|
25373
|
+
import * as path19 from "path";
|
|
25029
25374
|
function readRepoDefaults(gitRoot) {
|
|
25030
25375
|
const load11 = loadWorkspaceManifest(gitRoot);
|
|
25031
25376
|
if (load11.kind !== "ok") return {};
|
|
@@ -25033,7 +25378,7 @@ function readRepoDefaults(gitRoot) {
|
|
|
25033
25378
|
const str = (v) => {
|
|
25034
25379
|
if (typeof v !== "string" || !v.trim()) return void 0;
|
|
25035
25380
|
const value = v.trim();
|
|
25036
|
-
if (value.includes("/") || value.includes(
|
|
25381
|
+
if (value.includes("/") || value.includes(path19.sep) || value === "." || value === "..") {
|
|
25037
25382
|
console.warn(
|
|
25038
25383
|
`Warning: ignoring ${JSON.stringify(value)} in ${WORKSPACE_MANIFEST_LABEL} \u2014 a default names a hub or base, not a path.`
|
|
25039
25384
|
);
|
|
@@ -25065,12 +25410,12 @@ function parseRoutingTokens(args2) {
|
|
|
25065
25410
|
return tokens2;
|
|
25066
25411
|
}
|
|
25067
25412
|
function firstSegment(p) {
|
|
25068
|
-
const normalized = p.split(
|
|
25413
|
+
const normalized = p.split(path19.sep).join("/");
|
|
25069
25414
|
const [head] = normalized.split("/").filter(Boolean);
|
|
25070
25415
|
return head ?? p;
|
|
25071
25416
|
}
|
|
25072
25417
|
function resolveSelectorSubtree(layout, selector, cwd) {
|
|
25073
|
-
const parts = selector.split(
|
|
25418
|
+
const parts = selector.split(path19.sep).join("/").split("/").filter(Boolean);
|
|
25074
25419
|
const qualified = parts[0] === WAYAI_LAYOUT.wsDir ? parts.slice(1) : parts;
|
|
25075
25420
|
if (qualified.length > 1) {
|
|
25076
25421
|
if (qualified[0] === WAYAI_LAYOUT.hubsSubdir) return { kind: "hubs", target: qualified[1] };
|
|
@@ -25078,14 +25423,14 @@ function resolveSelectorSubtree(layout, selector, cwd) {
|
|
|
25078
25423
|
}
|
|
25079
25424
|
if (!layout) return { kind: "unknown" };
|
|
25080
25425
|
const { hubsDir, basesDir } = layout;
|
|
25081
|
-
if (selector.includes("/") || selector.includes(
|
|
25082
|
-
const abs =
|
|
25083
|
-
if (isUnder(hubsDir, abs)) return { kind: "hubs", target: firstSegment(
|
|
25084
|
-
if (isUnder(basesDir, abs)) return { kind: "bases", target: firstSegment(
|
|
25426
|
+
if (selector.includes("/") || selector.includes(path19.sep)) {
|
|
25427
|
+
const abs = path19.resolve(cwd, selector);
|
|
25428
|
+
if (isUnder(hubsDir, abs)) return { kind: "hubs", target: firstSegment(path19.relative(hubsDir, abs)) };
|
|
25429
|
+
if (isUnder(basesDir, abs)) return { kind: "bases", target: firstSegment(path19.relative(basesDir, abs)) };
|
|
25085
25430
|
return { kind: "unknown" };
|
|
25086
25431
|
}
|
|
25087
|
-
const inHubs = isDirectory(
|
|
25088
|
-
const inBases = isDirectory(
|
|
25432
|
+
const inHubs = isDirectory(path19.join(hubsDir, selector));
|
|
25433
|
+
const inBases = isDirectory(path19.join(basesDir, selector));
|
|
25089
25434
|
if (inHubs && inBases) return { kind: "both", target: selector };
|
|
25090
25435
|
if (inHubs) return { kind: "hubs", target: selector };
|
|
25091
25436
|
if (inBases) return { kind: "bases", target: selector };
|
|
@@ -25098,8 +25443,8 @@ function listCandidates(layout) {
|
|
|
25098
25443
|
];
|
|
25099
25444
|
const bases = filterEditableBases(listBaseFolders(layout.basesDir)).map((b) => b.folder);
|
|
25100
25445
|
return [
|
|
25101
|
-
...hubs.map((folder) => ({ subtree: "hubs", name:
|
|
25102
|
-
...bases.map((folder) => ({ subtree: "bases", name:
|
|
25446
|
+
...hubs.map((folder) => ({ subtree: "hubs", name: path19.basename(folder) })),
|
|
25447
|
+
...bases.map((folder) => ({ subtree: "bases", name: path19.basename(folder) }))
|
|
25103
25448
|
];
|
|
25104
25449
|
}
|
|
25105
25450
|
function mixedInvocationRefusal(verb, hubTarget, baseTarget) {
|
|
@@ -25240,12 +25585,12 @@ async function createDataClient(orgId) {
|
|
|
25240
25585
|
return orgId2;
|
|
25241
25586
|
}
|
|
25242
25587
|
return {
|
|
25243
|
-
async request(method,
|
|
25244
|
-
const envelope = await api.dataRequest(method,
|
|
25588
|
+
async request(method, path36, body) {
|
|
25589
|
+
const envelope = await api.dataRequest(method, path36, body, org);
|
|
25245
25590
|
return envelope.data;
|
|
25246
25591
|
},
|
|
25247
|
-
async requestRaw(method,
|
|
25248
|
-
const body_ = await api.dataRequest(method,
|
|
25592
|
+
async requestRaw(method, path36, body) {
|
|
25593
|
+
const body_ = await api.dataRequest(method, path36, body, org);
|
|
25249
25594
|
return body_;
|
|
25250
25595
|
},
|
|
25251
25596
|
async collectPages(makePath) {
|
|
@@ -25320,7 +25665,7 @@ var init_client = __esm({
|
|
|
25320
25665
|
});
|
|
25321
25666
|
|
|
25322
25667
|
// src/data/helpers.ts
|
|
25323
|
-
import { readFileSync as
|
|
25668
|
+
import { readFileSync as readFileSync15 } from "fs";
|
|
25324
25669
|
function pathSegment(id, label = "id") {
|
|
25325
25670
|
if (!isPathSafeId(id)) {
|
|
25326
25671
|
throw expected(`Invalid ${label}: ${JSON.stringify(id)}. An id may use ${PATH_SAFE_ID_RULE}.`);
|
|
@@ -25348,7 +25693,7 @@ function parseData(data, flag) {
|
|
|
25348
25693
|
let text = data;
|
|
25349
25694
|
if (source !== void 0) {
|
|
25350
25695
|
try {
|
|
25351
|
-
text =
|
|
25696
|
+
text = readFileSync15(source, "utf-8");
|
|
25352
25697
|
} catch (e) {
|
|
25353
25698
|
throw expected(`${prefix}${source}: ${e instanceof Error ? e.message : "could not be read"}`);
|
|
25354
25699
|
}
|
|
@@ -25473,8 +25818,8 @@ var init_types2 = __esm({
|
|
|
25473
25818
|
});
|
|
25474
25819
|
|
|
25475
25820
|
// src/data/config-as-code/config-writer.ts
|
|
25476
|
-
import * as
|
|
25477
|
-
import * as
|
|
25821
|
+
import * as fs15 from "fs";
|
|
25822
|
+
import * as path20 from "path";
|
|
25478
25823
|
import * as yaml9 from "js-yaml";
|
|
25479
25824
|
function dump5(value) {
|
|
25480
25825
|
return yaml9.dump(value, YAML_DUMP_OPTIONS);
|
|
@@ -25508,15 +25853,15 @@ function pruneOrphans(folder, dir, keep, log) {
|
|
|
25508
25853
|
if (!ensureRealSubdirNoSymlink(folder, dir, false)) return;
|
|
25509
25854
|
let entries;
|
|
25510
25855
|
try {
|
|
25511
|
-
entries =
|
|
25856
|
+
entries = fs15.readdirSync(dir);
|
|
25512
25857
|
} catch {
|
|
25513
25858
|
return;
|
|
25514
25859
|
}
|
|
25515
25860
|
for (const file of entries) {
|
|
25516
25861
|
if (!file.endsWith(".yaml") || keep.has(file)) continue;
|
|
25517
|
-
const abs =
|
|
25518
|
-
|
|
25519
|
-
log.removed.push(
|
|
25862
|
+
const abs = path20.join(dir, file);
|
|
25863
|
+
fs15.rmSync(abs);
|
|
25864
|
+
log.removed.push(path20.relative(folder, abs));
|
|
25520
25865
|
}
|
|
25521
25866
|
}
|
|
25522
25867
|
function metaFileObject(meta) {
|
|
@@ -25528,16 +25873,16 @@ function metaFileObject(meta) {
|
|
|
25528
25873
|
}
|
|
25529
25874
|
function writeBaseFolder(folder, meta, config) {
|
|
25530
25875
|
const delta = { changed: [], removed: [] };
|
|
25531
|
-
const parent =
|
|
25532
|
-
|
|
25876
|
+
const parent = path20.dirname(folder);
|
|
25877
|
+
fs15.mkdirSync(parent, { recursive: true });
|
|
25533
25878
|
if (!ensureRealSubdirNoSymlink(parent, folder, true)) {
|
|
25534
25879
|
throw expected(
|
|
25535
25880
|
`Refusing to write ${folder}: the path crosses a symlink. Remove it and pull again.`
|
|
25536
25881
|
);
|
|
25537
25882
|
}
|
|
25538
|
-
writeFileIfChanged(folder,
|
|
25883
|
+
writeFileIfChanged(folder, path20.join(folder, BASE_META_FILE), dump5(metaFileObject(meta)), delta);
|
|
25539
25884
|
for (const kind of ENTITY_KINDS) {
|
|
25540
|
-
const dir =
|
|
25885
|
+
const dir = path20.join(folder, ENTITY_DIRS[kind]);
|
|
25541
25886
|
const entities = config[kind] ?? [];
|
|
25542
25887
|
const keep = /* @__PURE__ */ new Set();
|
|
25543
25888
|
for (const raw of entities) {
|
|
@@ -25549,20 +25894,20 @@ function writeBaseFolder(folder, meta, config) {
|
|
|
25549
25894
|
}
|
|
25550
25895
|
const file = `${id}.yaml`;
|
|
25551
25896
|
keep.add(file);
|
|
25552
|
-
writeFileIfChanged(folder,
|
|
25897
|
+
writeFileIfChanged(folder, path20.join(dir, file), dump5(toFileObject(kind, entity)), delta);
|
|
25553
25898
|
}
|
|
25554
25899
|
pruneOrphans(folder, dir, keep, delta);
|
|
25555
25900
|
}
|
|
25556
25901
|
for (const deprecated of DEPRECATED_ENTITY_DIRS) {
|
|
25557
|
-
const dir =
|
|
25902
|
+
const dir = path20.join(folder, deprecated);
|
|
25558
25903
|
if (ensureRealSubdirNoSymlink(folder, dir, false)) {
|
|
25559
|
-
|
|
25904
|
+
fs15.rmSync(dir, { recursive: true, force: true });
|
|
25560
25905
|
}
|
|
25561
25906
|
}
|
|
25562
25907
|
return delta;
|
|
25563
25908
|
}
|
|
25564
25909
|
function markProductionMirror(folder, baseId) {
|
|
25565
|
-
const file =
|
|
25910
|
+
const file = path20.join(folder, BASE_META_FILE);
|
|
25566
25911
|
try {
|
|
25567
25912
|
const body = readFileNoFollow(folder, file)?.toString("utf-8");
|
|
25568
25913
|
if (body === void 0 || body.startsWith(MIRROR_MARKER_PREFIX)) return;
|
|
@@ -25574,7 +25919,7 @@ function markProductionMirror(folder, baseId) {
|
|
|
25574
25919
|
}
|
|
25575
25920
|
function ensureMirrorIgnored(folder) {
|
|
25576
25921
|
try {
|
|
25577
|
-
writeFileNoFollow(folder,
|
|
25922
|
+
writeFileNoFollow(folder, path20.join(folder, ".gitignore"), Buffer.from(MIRROR_GITIGNORE, "utf-8"));
|
|
25578
25923
|
} catch {
|
|
25579
25924
|
}
|
|
25580
25925
|
}
|
|
@@ -25708,8 +26053,8 @@ var init_api = __esm({
|
|
|
25708
26053
|
});
|
|
25709
26054
|
|
|
25710
26055
|
// src/data/config-as-code/config-parser.ts
|
|
25711
|
-
import * as
|
|
25712
|
-
import * as
|
|
26056
|
+
import * as fs16 from "fs";
|
|
26057
|
+
import * as path21 from "path";
|
|
25713
26058
|
import * as yaml10 from "js-yaml";
|
|
25714
26059
|
function readEntityDir(folder, dir) {
|
|
25715
26060
|
if (!ensureRealSubdirNoSymlink(folder, dir, false)) {
|
|
@@ -25717,9 +26062,9 @@ function readEntityDir(folder, dir) {
|
|
|
25717
26062
|
}
|
|
25718
26063
|
if (!isDirectory(dir)) return [];
|
|
25719
26064
|
const out = [];
|
|
25720
|
-
for (const file of
|
|
26065
|
+
for (const file of fs16.readdirSync(dir).sort()) {
|
|
25721
26066
|
if (!file.endsWith(".yaml")) continue;
|
|
25722
|
-
const abs =
|
|
26067
|
+
const abs = path21.join(dir, file);
|
|
25723
26068
|
const bytes = readFileNoFollow(folder, abs);
|
|
25724
26069
|
if (bytes === null) {
|
|
25725
26070
|
throw expected(`Refusing to read ${abs}: it is a symlink, not a config file.`);
|
|
@@ -25734,7 +26079,7 @@ function readEntityDir(folder, dir) {
|
|
|
25734
26079
|
throw expected(`${abs} is empty or not a YAML object`);
|
|
25735
26080
|
}
|
|
25736
26081
|
const entity = parsed;
|
|
25737
|
-
const stem =
|
|
26082
|
+
const stem = path21.basename(file, ".yaml");
|
|
25738
26083
|
if (entity.id === void 0) entity.id = stem;
|
|
25739
26084
|
else if (String(entity.id) !== stem) {
|
|
25740
26085
|
throw expected(`${abs}: id "${String(entity.id)}" does not match filename "${stem}.yaml"`);
|
|
@@ -25747,10 +26092,10 @@ function parseBaseFolder(folder) {
|
|
|
25747
26092
|
const meta = readBaseMeta(folder);
|
|
25748
26093
|
if (!meta) {
|
|
25749
26094
|
throw expected(
|
|
25750
|
-
hasBaseMetaFile(folder) ? `${
|
|
26095
|
+
hasBaseMetaFile(folder) ? `${path21.join(folder, BASE_META_FILE)} could not be parsed as a YAML mapping. Fix it, or delete it and pull again.` : `No ${BASE_META_FILE} found in ${folder}`
|
|
25751
26096
|
);
|
|
25752
26097
|
}
|
|
25753
|
-
const read = (kind) => readEntityDir(folder,
|
|
26098
|
+
const read = (kind) => readEntityDir(folder, path21.join(folder, ENTITY_DIRS[kind]));
|
|
25754
26099
|
const config = {
|
|
25755
26100
|
record_types: read("record_types"),
|
|
25756
26101
|
relationship_types: read("relationship_types"),
|
|
@@ -25854,7 +26199,7 @@ __export(sync_exports, {
|
|
|
25854
26199
|
pullBase: () => pullBase,
|
|
25855
26200
|
pushBase: () => pushBase
|
|
25856
26201
|
});
|
|
25857
|
-
import * as
|
|
26202
|
+
import * as path22 from "path";
|
|
25858
26203
|
function parseArgs4(args2) {
|
|
25859
26204
|
return {
|
|
25860
26205
|
autoConfirm: args2.includes("--yes") || args2.includes("-y"),
|
|
@@ -25871,7 +26216,7 @@ async function writeProductionMirror(client, basesDir, prodId, record) {
|
|
|
25871
26216
|
throw expected(`Refusing to mirror base ${JSON.stringify(prodId)}: not a usable base id.`);
|
|
25872
26217
|
}
|
|
25873
26218
|
const config = await getConfig(client, prodId);
|
|
25874
|
-
const folder =
|
|
26219
|
+
const folder = path22.join(basesDir, prodId);
|
|
25875
26220
|
writeBaseFolder(folder, { ...metaFromRecord(record, prodId), environment: "production" }, config);
|
|
25876
26221
|
markProductionMirror(folder, prodId);
|
|
25877
26222
|
ensureMirrorIgnored(folder);
|
|
@@ -25911,7 +26256,7 @@ async function pullBase(gitRootOrNull, selector, args2) {
|
|
|
25911
26256
|
assertInScope("bases", baseId);
|
|
25912
26257
|
if (target.exists && !autoConfirm) {
|
|
25913
26258
|
const ok = await confirm(
|
|
25914
|
-
`Overwrite local files in ${
|
|
26259
|
+
`Overwrite local files in ${path22.relative(gitRoot, target.folder)} with the server config for "${sanitizeTerminalText(baseId)}"?`
|
|
25915
26260
|
);
|
|
25916
26261
|
if (!ok) {
|
|
25917
26262
|
console.log("Cancelled.");
|
|
@@ -25951,7 +26296,7 @@ async function createDeclaredPreview(client, target, parsed, autoConfirm) {
|
|
|
25951
26296
|
"base.yaml needs a base_id (an existing preview) or an origin_base_id (to create one)."
|
|
25952
26297
|
);
|
|
25953
26298
|
}
|
|
25954
|
-
const name = meta.name ??
|
|
26299
|
+
const name = meta.name ?? path22.basename(target.folder);
|
|
25955
26300
|
assertScopeAllowsCreation("bases", name);
|
|
25956
26301
|
if (!autoConfirm) {
|
|
25957
26302
|
const ok = await confirm(
|
|
@@ -25987,12 +26332,12 @@ async function pushBase(gitRootOrNull, selector, args2) {
|
|
|
25987
26332
|
const { meta, config } = parsed;
|
|
25988
26333
|
if (isProductionFolder(meta)) {
|
|
25989
26334
|
throw expected(
|
|
25990
|
-
`${
|
|
26335
|
+
`${path22.relative(gitRoot, target.folder)} is a read-only production mirror. Push operates on previews \u2014 edit the linked preview and promote with \`wayai bases promote\`.`
|
|
25991
26336
|
);
|
|
25992
26337
|
}
|
|
25993
26338
|
if (!meta.base_id && dryRun) {
|
|
25994
26339
|
console.log(
|
|
25995
|
-
`Dry run \u2014 nothing applied. ${
|
|
26340
|
+
`Dry run \u2014 nothing applied. ${path22.relative(gitRoot, target.folder)} has no base_id yet, so a real push would first create a preview from "${sanitizeTerminalText(meta.origin_base_id ?? "<origin_base_id>")}".`
|
|
25996
26341
|
);
|
|
25997
26342
|
return;
|
|
25998
26343
|
}
|
|
@@ -26104,8 +26449,8 @@ __export(push_exports, {
|
|
|
26104
26449
|
shouldWarnIgnoredPreviewLabel: () => shouldWarnIgnoredPreviewLabel,
|
|
26105
26450
|
syncAfterPush: () => syncAfterPush
|
|
26106
26451
|
});
|
|
26107
|
-
import * as
|
|
26108
|
-
import * as
|
|
26452
|
+
import * as fs17 from "fs";
|
|
26453
|
+
import * as path23 from "path";
|
|
26109
26454
|
import * as yaml11 from "js-yaml";
|
|
26110
26455
|
function parseArgs5(args2) {
|
|
26111
26456
|
let autoConfirm = false;
|
|
@@ -26214,12 +26559,12 @@ function printLocalFileChanges(delta) {
|
|
|
26214
26559
|
}
|
|
26215
26560
|
async function autoRenameAgentFiles(client, hubId, hubFolder, organizationId, remoteConfig) {
|
|
26216
26561
|
requireRealHubFolder(hubFolder, false);
|
|
26217
|
-
const agentsDir =
|
|
26562
|
+
const agentsDir = path23.join(hubFolder, "agents");
|
|
26218
26563
|
let agentsWithIds = [];
|
|
26219
|
-
if (
|
|
26220
|
-
const yamlFiles =
|
|
26564
|
+
if (fs17.existsSync(agentsDir)) {
|
|
26565
|
+
const yamlFiles = fs17.readdirSync(agentsDir).filter((f) => f.endsWith(".yaml"));
|
|
26221
26566
|
for (const file of yamlFiles) {
|
|
26222
|
-
const content = readRealFileOrThrow(hubFolder,
|
|
26567
|
+
const content = readRealFileOrThrow(hubFolder, path23.join(agentsDir, file)) ?? "";
|
|
26223
26568
|
try {
|
|
26224
26569
|
const agent = yaml11.load(content);
|
|
26225
26570
|
if (agent?.id && agent.name) {
|
|
@@ -26265,18 +26610,18 @@ async function autoRenameAgentFiles(client, hubId, hubFolder, organizationId, re
|
|
|
26265
26610
|
}
|
|
26266
26611
|
}
|
|
26267
26612
|
if (renames.length === 0) return;
|
|
26268
|
-
if (!
|
|
26269
|
-
for (const file of
|
|
26613
|
+
if (!fs17.existsSync(agentsDir)) return;
|
|
26614
|
+
for (const file of fs17.readdirSync(agentsDir)) {
|
|
26270
26615
|
if (file.startsWith("__rename_temp_") && (file.endsWith(".md") || file.endsWith(".yaml"))) {
|
|
26271
26616
|
console.warn(` Warning: removing orphaned temp file agents/${file}`);
|
|
26272
|
-
|
|
26617
|
+
fs17.unlinkSync(path23.join(agentsDir, file));
|
|
26273
26618
|
}
|
|
26274
26619
|
}
|
|
26275
26620
|
const renameFileIfExists = (dir, oldName, newName) => {
|
|
26276
|
-
const oldPath =
|
|
26277
|
-
const newPath =
|
|
26278
|
-
if (!
|
|
26279
|
-
|
|
26621
|
+
const oldPath = path23.join(dir, oldName);
|
|
26622
|
+
const newPath = path23.join(dir, newName);
|
|
26623
|
+
if (!fs17.existsSync(oldPath)) return false;
|
|
26624
|
+
fs17.renameSync(oldPath, newPath);
|
|
26280
26625
|
return true;
|
|
26281
26626
|
};
|
|
26282
26627
|
const oldSlugs = new Set(renames.map((r) => r.oldSlug));
|
|
@@ -26309,9 +26654,9 @@ async function autoRenameAgentFiles(client, hubId, hubFolder, organizationId, re
|
|
|
26309
26654
|
}
|
|
26310
26655
|
} else {
|
|
26311
26656
|
for (const { oldSlug, newSlug } of renames) {
|
|
26312
|
-
const hasOldFile = extensions.some((ext) =>
|
|
26657
|
+
const hasOldFile = extensions.some((ext) => fs17.existsSync(path23.join(agentsDir, `${oldSlug}${ext}`)));
|
|
26313
26658
|
if (!hasOldFile) continue;
|
|
26314
|
-
const hasNewFile = extensions.some((ext) =>
|
|
26659
|
+
const hasNewFile = extensions.some((ext) => fs17.existsSync(path23.join(agentsDir, `${newSlug}${ext}`)));
|
|
26315
26660
|
if (hasNewFile) {
|
|
26316
26661
|
console.warn(` Warning: skipping rename agents/${oldSlug}.* \u2192 agents/${newSlug}.* (target already exists)`);
|
|
26317
26662
|
continue;
|
|
@@ -26338,7 +26683,7 @@ async function autoRenameAgentFiles(client, hubId, hubFolder, organizationId, re
|
|
|
26338
26683
|
);
|
|
26339
26684
|
if (updatedYaml !== mainYamlContent) {
|
|
26340
26685
|
writeFileNoFollow(hubFolder, mainYamlPath, Buffer.from(updatedYaml, "utf-8"));
|
|
26341
|
-
console.log(` Updated instructions paths in ${
|
|
26686
|
+
console.log(` Updated instructions paths in ${path23.basename(mainYamlPath)}`);
|
|
26342
26687
|
}
|
|
26343
26688
|
}
|
|
26344
26689
|
}
|
|
@@ -26406,7 +26751,7 @@ async function pushSingleHub(client, hubId, hubFolder, autoConfirm, organization
|
|
|
26406
26751
|
function selectExistingHub(workspaceDir, allHubs, selector, wsLabel) {
|
|
26407
26752
|
if (selector) {
|
|
26408
26753
|
const match = allHubs.find(
|
|
26409
|
-
(h) => h.hubId === selector ||
|
|
26754
|
+
(h) => h.hubId === selector || path23.basename(h.hubFolder) === selector
|
|
26410
26755
|
);
|
|
26411
26756
|
if (!match) {
|
|
26412
26757
|
console.error(`No hub matching --hub ${selector} found in ${wsLabel}/.`);
|
|
@@ -26475,7 +26820,7 @@ function reportUnresolvedPushTarget(reason, existingHubs, newHubs, selector, wsL
|
|
|
26475
26820
|
if (existingHubs.length > 0) {
|
|
26476
26821
|
console.error(`No pushable hub found in ${wsLabel}/ \u2014 only read-only production mirror folder(s). Edit the linked preview hub, pull one, or create a new hub with \`wayai create\`:`);
|
|
26477
26822
|
for (const h of existingHubs) {
|
|
26478
|
-
console.error(` ${
|
|
26823
|
+
console.error(` ${path23.basename(h.hubFolder)} (${h.hubId}, production mirror)`);
|
|
26479
26824
|
}
|
|
26480
26825
|
} else {
|
|
26481
26826
|
console.error(`No hub folders found. Create hub files in ${wsLabel}/<hub>/hub.yaml with \`hub: { name: ... }\` and run \`wayai push\` (or \`wayai create\`).`);
|
|
@@ -26488,10 +26833,10 @@ function reportUnresolvedPushTarget(reason, existingHubs, newHubs, selector, wsL
|
|
|
26488
26833
|
console.error(`Multiple hub folders found in ${wsLabel}/. Pass --hub <uuid|folder-name> to choose, or run from inside a hub folder:`);
|
|
26489
26834
|
}
|
|
26490
26835
|
for (const h of existingHubs) {
|
|
26491
|
-
console.error(` ${
|
|
26836
|
+
console.error(` ${path23.basename(h.hubFolder)} (${h.hubId})`);
|
|
26492
26837
|
}
|
|
26493
26838
|
for (const h of newHubs) {
|
|
26494
|
-
console.error(` ${
|
|
26839
|
+
console.error(` ${path23.basename(h.hubFolder)} (new \u2014 "${h.hubName}")`);
|
|
26495
26840
|
}
|
|
26496
26841
|
process.exit(1);
|
|
26497
26842
|
}
|
|
@@ -26512,7 +26857,7 @@ async function pushCommand(args2) {
|
|
|
26512
26857
|
const client = new ApiClient({ apiUrl: config.api_url, accessToken });
|
|
26513
26858
|
const workspaceDir = resolveWorkspaceDir();
|
|
26514
26859
|
const wsLabel = hubsDirLabel(gitRoot);
|
|
26515
|
-
if (!
|
|
26860
|
+
if (!fs17.existsSync(workspaceDir)) {
|
|
26516
26861
|
console.error(`No ${wsLabel}/ directory found. Run \`wayai pull\` first or create hub files in ${wsLabel}/<hub>/hub.yaml.`);
|
|
26517
26862
|
process.exit(1);
|
|
26518
26863
|
}
|
|
@@ -26531,8 +26876,8 @@ async function pushCommand(args2) {
|
|
|
26531
26876
|
if (label) {
|
|
26532
26877
|
console.warn("Note: --label is only used when creating a new hub. To change an existing hub's label, use `wayai relabel`.");
|
|
26533
26878
|
}
|
|
26534
|
-
console.log(`Target hub: ${
|
|
26535
|
-
assertInScope("hubs", existing.hubId,
|
|
26879
|
+
console.log(`Target hub: ${path23.basename(existing.hubFolder)} (${existing.hubId})`);
|
|
26880
|
+
assertInScope("hubs", existing.hubId, path23.basename(existing.hubFolder));
|
|
26536
26881
|
await pushSingleHub(client, existing.hubId, existing.hubFolder, autoConfirm, organizationId);
|
|
26537
26882
|
return;
|
|
26538
26883
|
}
|
|
@@ -26569,8 +26914,8 @@ __export(pull_exports, {
|
|
|
26569
26914
|
resolveHubTarget: () => resolveHubTarget,
|
|
26570
26915
|
writeProductionMirror: () => writeProductionMirror2
|
|
26571
26916
|
});
|
|
26572
|
-
import * as
|
|
26573
|
-
import * as
|
|
26917
|
+
import * as fs18 from "fs";
|
|
26918
|
+
import * as path24 from "path";
|
|
26574
26919
|
function parseArgs6(args2) {
|
|
26575
26920
|
return { autoConfirm: args2.includes("--yes") || args2.includes("-y") };
|
|
26576
26921
|
}
|
|
@@ -26579,7 +26924,7 @@ function resolveHubTarget(workspaceDir, selector) {
|
|
|
26579
26924
|
const allHubs = scanWorkspaceHubs(workspaceDir);
|
|
26580
26925
|
if (selector) {
|
|
26581
26926
|
const match = allHubs.find(
|
|
26582
|
-
(h) => h.hubId === selector ||
|
|
26927
|
+
(h) => h.hubId === selector || path24.basename(h.hubFolder) === selector
|
|
26583
26928
|
);
|
|
26584
26929
|
if (match) return { hubId: match.hubId, hubFolder: match.hubFolder };
|
|
26585
26930
|
if (UUID_RE2.test(selector)) return { hubId: selector, hubFolder: null };
|
|
@@ -26596,7 +26941,7 @@ function resolveHubTarget(workspaceDir, selector) {
|
|
|
26596
26941
|
}
|
|
26597
26942
|
console.error(`Multiple hubs found in ${wsLabel}/. Pass --hub <uuid|folder-name> to choose, or run from inside a hub folder:`);
|
|
26598
26943
|
for (const h of previewHubs) {
|
|
26599
|
-
console.error(` ${
|
|
26944
|
+
console.error(` ${path24.basename(h.hubFolder)} (${h.hubId})`);
|
|
26600
26945
|
}
|
|
26601
26946
|
process.exit(1);
|
|
26602
26947
|
}
|
|
@@ -26636,7 +26981,7 @@ async function pullCommand(args2) {
|
|
|
26636
26981
|
payload.preview_label,
|
|
26637
26982
|
payload.branch_name
|
|
26638
26983
|
);
|
|
26639
|
-
|
|
26984
|
+
fs18.mkdirSync(path24.dirname(hubFolder), { recursive: true });
|
|
26640
26985
|
console.log("Writing hub configuration...");
|
|
26641
26986
|
await materializeHubFolder(hubFolder, payload);
|
|
26642
26987
|
const finalFolder = autoRenameHubFolder(hubFolder, payload.hub.name, payload.hub_environment, payload.hub_id, payload.preview_label, payload.branch_name);
|
|
@@ -26691,7 +27036,7 @@ async function pullCommand(args2) {
|
|
|
26691
27036
|
}
|
|
26692
27037
|
async function writeProductionMirror2(workspaceDir, prodPayload) {
|
|
26693
27038
|
const folder = resolveHubFolder(workspaceDir, prodPayload.hub_id, prodPayload.hub.name, "production", null, null);
|
|
26694
|
-
|
|
27039
|
+
fs18.mkdirSync(path24.dirname(folder), { recursive: true });
|
|
26695
27040
|
await materializeHubFolder(folder, prodPayload, { seedAgentContext: false });
|
|
26696
27041
|
const finalFolder = autoRenameHubFolder(folder, prodPayload.hub.name, "production", prodPayload.hub_id, null, null);
|
|
26697
27042
|
prependMirrorMarker(finalFolder, prodPayload.hub_id);
|
|
@@ -26707,13 +27052,13 @@ async function mirrorLinkedProduction2(client, workspaceDir, productionHubId, or
|
|
|
26707
27052
|
}
|
|
26708
27053
|
}
|
|
26709
27054
|
function prependMirrorMarker(hubFolder, productionHubId) {
|
|
26710
|
-
const hubYaml =
|
|
27055
|
+
const hubYaml = path24.join(hubFolder, "hub.yaml");
|
|
26711
27056
|
try {
|
|
26712
|
-
const content =
|
|
27057
|
+
const content = fs18.readFileSync(hubYaml, "utf-8");
|
|
26713
27058
|
if (content.startsWith(MIRROR_MARKER_PREFIX2)) return;
|
|
26714
27059
|
const marker = `${MIRROR_MARKER_PREFIX2} ${productionHubId}. Edits are ignored; push is blocked. Edit the linked preview hub instead.
|
|
26715
27060
|
`;
|
|
26716
|
-
|
|
27061
|
+
fs18.writeFileSync(hubYaml, marker + content, "utf-8");
|
|
26717
27062
|
} catch {
|
|
26718
27063
|
}
|
|
26719
27064
|
}
|
|
@@ -26757,8 +27102,8 @@ var create_exports = {};
|
|
|
26757
27102
|
__export(create_exports, {
|
|
26758
27103
|
createCommand: () => createCommand
|
|
26759
27104
|
});
|
|
26760
|
-
import * as
|
|
26761
|
-
import * as
|
|
27105
|
+
import * as path25 from "path";
|
|
27106
|
+
import * as fs19 from "fs";
|
|
26762
27107
|
function parseArgs7(args2) {
|
|
26763
27108
|
let autoConfirm = false;
|
|
26764
27109
|
let folderSelector;
|
|
@@ -26785,7 +27130,7 @@ async function createCommand(args2) {
|
|
|
26785
27130
|
const gitRoot = findGitRoot();
|
|
26786
27131
|
const wsLabel = hubsDirLabel(gitRoot);
|
|
26787
27132
|
if (gitRoot) warnLayoutOnce(gitRoot);
|
|
26788
|
-
if (!
|
|
27133
|
+
if (!fs19.existsSync(workspaceDir)) {
|
|
26789
27134
|
console.error(`No ${wsLabel}/ directory found. Create hub files in ${wsLabel}/<hub>/hub.yaml with \`hub: { name: ... }\` first.`);
|
|
26790
27135
|
process.exit(1);
|
|
26791
27136
|
}
|
|
@@ -26794,7 +27139,7 @@ async function createCommand(args2) {
|
|
|
26794
27139
|
const resolution = resolveNewHubForCreate(workspaceDir, existingHubs, newHubs, folderSelector);
|
|
26795
27140
|
if (!resolution.ok) {
|
|
26796
27141
|
if (resolution.reason === "exists") {
|
|
26797
|
-
const folder =
|
|
27142
|
+
const folder = path25.basename(resolution.existing.hubFolder);
|
|
26798
27143
|
console.error(`Hub "${folder}" already exists (${resolution.existing.hubId}). Use \`wayai push --hub ${folder}\` to update it.`);
|
|
26799
27144
|
process.exit(1);
|
|
26800
27145
|
}
|
|
@@ -26808,7 +27153,7 @@ async function createCommand(args2) {
|
|
|
26808
27153
|
}
|
|
26809
27154
|
console.error(`Multiple new hub folders found in ${wsLabel}/. Pass the folder name (\`wayai create <folder>\`) or run from inside one:`);
|
|
26810
27155
|
for (const h of newHubs) {
|
|
26811
|
-
console.error(` ${
|
|
27156
|
+
console.error(` ${path25.basename(h.hubFolder)} (new \u2014 "${h.hubName}")`);
|
|
26812
27157
|
}
|
|
26813
27158
|
process.exit(1);
|
|
26814
27159
|
}
|
|
@@ -26919,8 +27264,8 @@ var replicate_exports = {};
|
|
|
26919
27264
|
__export(replicate_exports, {
|
|
26920
27265
|
replicateCommand: () => replicateCommand
|
|
26921
27266
|
});
|
|
26922
|
-
import * as
|
|
26923
|
-
import * as
|
|
27267
|
+
import * as fs20 from "fs";
|
|
27268
|
+
import * as path26 from "path";
|
|
26924
27269
|
function parseArgs9(args2) {
|
|
26925
27270
|
let label;
|
|
26926
27271
|
let hubSelector;
|
|
@@ -26966,8 +27311,8 @@ async function replicateCommand(args2) {
|
|
|
26966
27311
|
payload.preview_label,
|
|
26967
27312
|
payload.branch_name
|
|
26968
27313
|
);
|
|
26969
|
-
const folderPreExisted =
|
|
26970
|
-
|
|
27314
|
+
const folderPreExisted = fs20.existsSync(hubFolder);
|
|
27315
|
+
fs20.mkdirSync(path26.dirname(hubFolder), { recursive: true });
|
|
26971
27316
|
const delta = await materializeHubFolder(hubFolder, payload);
|
|
26972
27317
|
hubFolder = autoRenameHubFolder(
|
|
26973
27318
|
hubFolder,
|
|
@@ -26979,8 +27324,8 @@ async function replicateCommand(args2) {
|
|
|
26979
27324
|
);
|
|
26980
27325
|
seedScopeIfEmpty("hubs", previewHubId);
|
|
26981
27326
|
if (folderPreExisted) printLocalFileChanges(delta);
|
|
26982
|
-
console.log(`Preview written to ${
|
|
26983
|
-
console.log(` Switch to it with: wayai use ${
|
|
27327
|
+
console.log(`Preview written to ${path26.basename(hubFolder)}`);
|
|
27328
|
+
console.log(` Switch to it with: wayai use ${path26.basename(hubFolder)}`);
|
|
26984
27329
|
}
|
|
26985
27330
|
var init_replicate = __esm({
|
|
26986
27331
|
"src/commands/replicate.ts"() {
|
|
@@ -27003,7 +27348,7 @@ var relabel_exports = {};
|
|
|
27003
27348
|
__export(relabel_exports, {
|
|
27004
27349
|
relabelCommand: () => relabelCommand
|
|
27005
27350
|
});
|
|
27006
|
-
import * as
|
|
27351
|
+
import * as path27 from "path";
|
|
27007
27352
|
function parseArgs10(args2) {
|
|
27008
27353
|
let label;
|
|
27009
27354
|
let clear = false;
|
|
@@ -27047,7 +27392,7 @@ async function relabelCommand(args2) {
|
|
|
27047
27392
|
} else {
|
|
27048
27393
|
console.error(`Multiple hubs found in ${wsLabel}/. Pass --hub <uuid|folder-name> to choose, or run from inside a hub folder:`);
|
|
27049
27394
|
for (const h of previewHubs) {
|
|
27050
|
-
console.error(` ${
|
|
27395
|
+
console.error(` ${path27.basename(h.hubFolder)} (${h.hubId})`);
|
|
27051
27396
|
}
|
|
27052
27397
|
}
|
|
27053
27398
|
process.exit(1);
|
|
@@ -27056,7 +27401,7 @@ async function relabelCommand(args2) {
|
|
|
27056
27401
|
console.log("This is a read-only production mirror \u2014 production hubs have no preview label. Relabel the linked preview hub instead.");
|
|
27057
27402
|
return;
|
|
27058
27403
|
}
|
|
27059
|
-
assertInScope("hubs", target.hubId,
|
|
27404
|
+
assertInScope("hubs", target.hubId, path27.basename(target.hubFolder));
|
|
27060
27405
|
console.log(normalizedLabel ? `Setting preview label to "${normalizedLabel}"...` : "Clearing preview label...");
|
|
27061
27406
|
const { data } = await client.relabelPreview(target.hubId, normalizedLabel);
|
|
27062
27407
|
const row = data[0];
|
|
@@ -27072,7 +27417,7 @@ async function relabelCommand(args2) {
|
|
|
27072
27417
|
);
|
|
27073
27418
|
console.log(serverLabel ? `Preview label set to "${serverLabel}".` : "Preview label cleared.");
|
|
27074
27419
|
if (finalFolder !== target.hubFolder) {
|
|
27075
|
-
console.log(`Hub folder is now ${
|
|
27420
|
+
console.log(`Hub folder is now ${path27.basename(finalFolder)}`);
|
|
27076
27421
|
}
|
|
27077
27422
|
}
|
|
27078
27423
|
var init_relabel = __esm({
|
|
@@ -27098,7 +27443,7 @@ __export(publish_exports, {
|
|
|
27098
27443
|
renderHubDiff: () => renderHubDiff,
|
|
27099
27444
|
runPublish: () => runPublish
|
|
27100
27445
|
});
|
|
27101
|
-
import * as
|
|
27446
|
+
import * as path28 from "path";
|
|
27102
27447
|
function parseArgs11(args2) {
|
|
27103
27448
|
let autoConfirm = false;
|
|
27104
27449
|
let hubSelector;
|
|
@@ -27212,7 +27557,7 @@ async function publishCommand(args2) {
|
|
|
27212
27557
|
return;
|
|
27213
27558
|
}
|
|
27214
27559
|
}
|
|
27215
|
-
assertInScope("hubs", hubId, hubFolder ?
|
|
27560
|
+
assertInScope("hubs", hubId, hubFolder ? path28.basename(hubFolder) : void 0);
|
|
27216
27561
|
await runPublish(client, { hubId, localConfig, organizationId, autoConfirm });
|
|
27217
27562
|
}
|
|
27218
27563
|
var STATUS_STYLE;
|
|
@@ -27241,7 +27586,7 @@ var init_publish = __esm({
|
|
|
27241
27586
|
});
|
|
27242
27587
|
|
|
27243
27588
|
// src/lib/scope-selector.ts
|
|
27244
|
-
import * as
|
|
27589
|
+
import * as path29 from "path";
|
|
27245
27590
|
function findAddFlag(args2) {
|
|
27246
27591
|
return args2.find((arg) => arg === "--add" || arg.startsWith("--add="));
|
|
27247
27592
|
}
|
|
@@ -27295,7 +27640,7 @@ function resolveHubSelectorToId(gitRoot, selector) {
|
|
|
27295
27640
|
const match = findHubByFolderName(workspaceDir, selector);
|
|
27296
27641
|
if (match) return match.hubId;
|
|
27297
27642
|
const newHubs = scanNewHubs(workspaceDir);
|
|
27298
|
-
const pending = newHubs.find((h) =>
|
|
27643
|
+
const pending = newHubs.find((h) => path29.basename(h.hubFolder) === selector);
|
|
27299
27644
|
if (pending) {
|
|
27300
27645
|
throw expected(
|
|
27301
27646
|
`"${selector}" is a new hub that hasn't been created on the platform yet, so it has no id to bind to.
|
|
@@ -27306,9 +27651,9 @@ Create it first \u2014 the worktree scope picks it up automatically afterward:
|
|
|
27306
27651
|
throw expected(
|
|
27307
27652
|
[
|
|
27308
27653
|
`No hub matching "${selector}" found in ${hubsDirLabel(gitRoot)}/. Pass a UUID or a folder name from:`,
|
|
27309
|
-
...scanWorkspaceHubs(workspaceDir).map((h) => ` ${
|
|
27654
|
+
...scanWorkspaceHubs(workspaceDir).map((h) => ` ${path29.basename(h.hubFolder)} (${h.hubId})`),
|
|
27310
27655
|
...newHubs.map(
|
|
27311
|
-
(h) => ` ${
|
|
27656
|
+
(h) => ` ${path29.basename(h.hubFolder)} (new \u2014 "${h.hubName}", run \`wayai create ${path29.basename(h.hubFolder)}\`)`
|
|
27312
27657
|
)
|
|
27313
27658
|
].join("\n")
|
|
27314
27659
|
);
|
|
@@ -27394,11 +27739,11 @@ __export(migrate_exports, {
|
|
|
27394
27739
|
migrateCommand: () => migrateCommand
|
|
27395
27740
|
});
|
|
27396
27741
|
import { execFileSync as execFileSync3 } from "child_process";
|
|
27397
|
-
import * as
|
|
27398
|
-
import * as
|
|
27742
|
+
import * as fs21 from "fs";
|
|
27743
|
+
import * as path30 from "path";
|
|
27399
27744
|
function isTracked(gitRoot, p) {
|
|
27400
27745
|
try {
|
|
27401
|
-
execFileSync3("git", ["ls-files", "--error-unmatch", "--",
|
|
27746
|
+
execFileSync3("git", ["ls-files", "--error-unmatch", "--", path30.relative(gitRoot, p)], {
|
|
27402
27747
|
cwd: gitRoot,
|
|
27403
27748
|
stdio: ["pipe", "pipe", "pipe"]
|
|
27404
27749
|
});
|
|
@@ -27408,10 +27753,10 @@ function isTracked(gitRoot, p) {
|
|
|
27408
27753
|
}
|
|
27409
27754
|
}
|
|
27410
27755
|
function moveDir(gitRoot, from, to) {
|
|
27411
|
-
|
|
27756
|
+
fs21.mkdirSync(path30.dirname(to), { recursive: true });
|
|
27412
27757
|
if (isTracked(gitRoot, from)) {
|
|
27413
27758
|
try {
|
|
27414
|
-
execFileSync3("git", ["mv",
|
|
27759
|
+
execFileSync3("git", ["mv", path30.relative(gitRoot, from), path30.relative(gitRoot, to)], {
|
|
27415
27760
|
cwd: gitRoot,
|
|
27416
27761
|
stdio: ["pipe", "pipe", "pipe"]
|
|
27417
27762
|
});
|
|
@@ -27419,7 +27764,7 @@ function moveDir(gitRoot, from, to) {
|
|
|
27419
27764
|
} catch {
|
|
27420
27765
|
}
|
|
27421
27766
|
}
|
|
27422
|
-
|
|
27767
|
+
fs21.renameSync(from, to);
|
|
27423
27768
|
return "fs";
|
|
27424
27769
|
}
|
|
27425
27770
|
async function migrateCommand(_args) {
|
|
@@ -27428,12 +27773,12 @@ async function migrateCommand(_args) {
|
|
|
27428
27773
|
console.error("Not inside a git repository.");
|
|
27429
27774
|
process.exit(1);
|
|
27430
27775
|
}
|
|
27431
|
-
const rel = (p) =>
|
|
27432
|
-
const newWs =
|
|
27433
|
-
const legacyWs =
|
|
27434
|
-
const legacyOrg =
|
|
27435
|
-
const newHubs =
|
|
27436
|
-
const newOrg =
|
|
27776
|
+
const rel = (p) => path30.relative(gitRoot, p);
|
|
27777
|
+
const newWs = path30.join(gitRoot, WAYAI_LAYOUT.wsDir);
|
|
27778
|
+
const legacyWs = path30.join(gitRoot, WAYAI_LAYOUT.legacy.wsDir);
|
|
27779
|
+
const legacyOrg = path30.join(gitRoot, WAYAI_LAYOUT.legacy.orgAtRoot);
|
|
27780
|
+
const newHubs = path30.join(newWs, WAYAI_LAYOUT.hubsSubdir);
|
|
27781
|
+
const newOrg = path30.join(newWs, WAYAI_LAYOUT.orgSubdir);
|
|
27437
27782
|
requireRealSubdirNoSymlink(gitRoot, newHubs, false);
|
|
27438
27783
|
requireRealSubdirNoSymlink(gitRoot, newOrg, false);
|
|
27439
27784
|
readRealFileOrThrow(gitRoot, workspaceManifestPath(gitRoot));
|
|
@@ -27586,12 +27931,12 @@ var send_message_exports = {};
|
|
|
27586
27931
|
__export(send_message_exports, {
|
|
27587
27932
|
sendMessageCommand: () => sendMessageCommand
|
|
27588
27933
|
});
|
|
27589
|
-
import * as
|
|
27590
|
-
import * as
|
|
27934
|
+
import * as fs22 from "fs";
|
|
27935
|
+
import * as path31 from "path";
|
|
27591
27936
|
function statAttachment(filePath) {
|
|
27592
27937
|
let stat2;
|
|
27593
27938
|
try {
|
|
27594
|
-
stat2 =
|
|
27939
|
+
stat2 = fs22.statSync(filePath);
|
|
27595
27940
|
} catch {
|
|
27596
27941
|
console.error(`Error: file not found: ${filePath}`);
|
|
27597
27942
|
process.exit(1);
|
|
@@ -27603,11 +27948,11 @@ function statAttachment(filePath) {
|
|
|
27603
27948
|
return { filePath, size: stat2.size };
|
|
27604
27949
|
}
|
|
27605
27950
|
function readAttachment(filePath, size) {
|
|
27606
|
-
const fileName =
|
|
27607
|
-
const ext =
|
|
27951
|
+
const fileName = path31.basename(filePath);
|
|
27952
|
+
const ext = path31.extname(fileName).replace(/^\./, "");
|
|
27608
27953
|
return {
|
|
27609
27954
|
file_name: fileName,
|
|
27610
|
-
file_binary:
|
|
27955
|
+
file_binary: fs22.readFileSync(filePath).toString("base64"),
|
|
27611
27956
|
file_size: size,
|
|
27612
27957
|
...ext && { file_extension: ext }
|
|
27613
27958
|
};
|
|
@@ -27654,7 +27999,7 @@ async function sendMessageCommand(args2) {
|
|
|
27654
27999
|
}
|
|
27655
28000
|
const stats = filePaths.map(statAttachment);
|
|
27656
28001
|
const filesTotal = stats.reduce((sum, s) => sum + base64Length(s.size), 0);
|
|
27657
|
-
const fileDetail = () => stats.map((s) => `${
|
|
28002
|
+
const fileDetail = () => stats.map((s) => `${path31.basename(s.filePath)} ${asMb(s.size)} MB`).join(", ");
|
|
27658
28003
|
if (filesTotal > MAX_MESSAGE_BODY_BYTES) {
|
|
27659
28004
|
console.error(
|
|
27660
28005
|
`Error: ${fileDetail()} encode to ~${asMb(filesTotal)} MB, over the ${asMb(MAX_MESSAGE_BODY_BYTES)} MB per-request limit.`
|
|
@@ -27662,10 +28007,10 @@ async function sendMessageCommand(args2) {
|
|
|
27662
28007
|
console.error("Base64 inflates a file by about a third, so ~7 MB of files is the practical ceiling.");
|
|
27663
28008
|
process.exit(1);
|
|
27664
28009
|
}
|
|
27665
|
-
const audioStats = stats.filter((s) => isAudioAttachmentFileName(
|
|
28010
|
+
const audioStats = stats.filter((s) => isAudioAttachmentFileName(path31.basename(s.filePath)));
|
|
27666
28011
|
if (audioStats.length > 1) {
|
|
27667
28012
|
console.error(
|
|
27668
|
-
`Error: at most one audio file per message (got ${audioStats.length}: ${audioStats.map((s) =>
|
|
28013
|
+
`Error: at most one audio file per message (got ${audioStats.length}: ${audioStats.map((s) => path31.basename(s.filePath)).join(", ")}).`
|
|
27669
28014
|
);
|
|
27670
28015
|
console.error("Audio is transcribed via the hub's STT connection, and only one file per message is transcribed.");
|
|
27671
28016
|
process.exit(1);
|
|
@@ -27673,7 +28018,7 @@ async function sendMessageCommand(args2) {
|
|
|
27673
28018
|
const oversizeAudio = audioStats.find((s) => base64Length(s.size) > MAX_AUDIO_FILE_BASE64_BYTES);
|
|
27674
28019
|
if (oversizeAudio) {
|
|
27675
28020
|
console.error(
|
|
27676
|
-
`Error: ${
|
|
28021
|
+
`Error: ${path31.basename(oversizeAudio.filePath)} (${asMb(oversizeAudio.size)} MB) is over the ~${asMb(MAX_AUDIO_FILE_BASE64_BYTES * 3 / 4)} MB audio limit for transcription.`
|
|
27677
28022
|
);
|
|
27678
28023
|
process.exit(1);
|
|
27679
28024
|
}
|
|
@@ -29185,8 +29530,8 @@ function installEvalSignalHandlers(input) {
|
|
|
29185
29530
|
let signalCount = 0;
|
|
29186
29531
|
let disposed = false;
|
|
29187
29532
|
let settle;
|
|
29188
|
-
const settled = new Promise((
|
|
29189
|
-
settle =
|
|
29533
|
+
const settled = new Promise((resolve11) => {
|
|
29534
|
+
settle = resolve11;
|
|
29190
29535
|
});
|
|
29191
29536
|
const listeners = /* @__PURE__ */ new Map();
|
|
29192
29537
|
const dispose = () => {
|
|
@@ -29540,7 +29885,7 @@ Timeout after ${timeoutSeconds}s${queuedSeconds > 0 ? ` (${queuedSeconds}s of it
|
|
|
29540
29885
|
process.exit(1);
|
|
29541
29886
|
}
|
|
29542
29887
|
function sleep(ms) {
|
|
29543
|
-
return new Promise((
|
|
29888
|
+
return new Promise((resolve11) => setTimeout(resolve11, ms));
|
|
29544
29889
|
}
|
|
29545
29890
|
function parseRunNumbers(raw) {
|
|
29546
29891
|
if (!raw || raw.startsWith("--")) {
|
|
@@ -29807,9 +30152,9 @@ var init_eval_results = __esm({
|
|
|
29807
30152
|
|
|
29808
30153
|
// src/lib/call-eval/caller-audio.ts
|
|
29809
30154
|
import { createHash as createHash3 } from "crypto";
|
|
29810
|
-
import { mkdirSync as mkdirSync12, readFileSync as
|
|
30155
|
+
import { mkdirSync as mkdirSync12, readFileSync as readFileSync18, renameSync as renameSync5, writeFileSync as writeFileSync7 } from "fs";
|
|
29811
30156
|
import { homedir as homedir5 } from "os";
|
|
29812
|
-
import { dirname as dirname12, isAbsolute as isAbsolute3, join as
|
|
30157
|
+
import { dirname as dirname12, isAbsolute as isAbsolute3, join as join27, resolve as resolve9 } from "path";
|
|
29813
30158
|
function parseWav(buf, name = "clip") {
|
|
29814
30159
|
if (buf.length < 12 || buf.toString("ascii", 0, 4) !== "RIFF" || buf.toString("ascii", 8, 12) !== "WAVE") {
|
|
29815
30160
|
throw new Error(`${name} is not a WAV file.`);
|
|
@@ -29848,7 +30193,7 @@ function parseWav(buf, name = "clip") {
|
|
|
29848
30193
|
throw new Error(`${name} holds no audio data.`);
|
|
29849
30194
|
}
|
|
29850
30195
|
function defaultClipCacheDir() {
|
|
29851
|
-
return
|
|
30196
|
+
return join27(homedir5(), ".wayai", "call-clips");
|
|
29852
30197
|
}
|
|
29853
30198
|
function pcmClip(buf) {
|
|
29854
30199
|
const samples = new Int16Array(Math.floor(buf.length / 2));
|
|
@@ -29880,15 +30225,15 @@ var init_caller_audio = __esm({
|
|
|
29880
30225
|
}
|
|
29881
30226
|
describe;
|
|
29882
30227
|
async clipFor(line) {
|
|
29883
|
-
const
|
|
29884
|
-
if (!
|
|
30228
|
+
const path36 = line.clip ? isAbsolute3(line.clip) ? line.clip : resolve9(this.planDir, line.clip) : this.dir ? join27(this.dir, `${line.n}.wav`) : null;
|
|
30229
|
+
if (!path36) throw new Error(`Line ${line.n} has no clip: give --clips <dir>, or a "clip" for it in the plan.`);
|
|
29885
30230
|
let buf;
|
|
29886
30231
|
try {
|
|
29887
|
-
buf =
|
|
30232
|
+
buf = readFileSync18(path36);
|
|
29888
30233
|
} catch {
|
|
29889
|
-
throw new Error(`Line ${line.n}'s clip ${
|
|
30234
|
+
throw new Error(`Line ${line.n}'s clip ${path36} cannot be read.`);
|
|
29890
30235
|
}
|
|
29891
|
-
return parseWav(buf,
|
|
30236
|
+
return parseWav(buf, path36);
|
|
29892
30237
|
}
|
|
29893
30238
|
};
|
|
29894
30239
|
OPENAI_PCM_SAMPLE_RATE = 24e3;
|
|
@@ -29915,20 +30260,20 @@ var init_caller_audio = __esm({
|
|
|
29915
30260
|
const key = createHash3("sha256").update(`${this.model}
|
|
29916
30261
|
${this.voice}
|
|
29917
30262
|
${text}`).digest("hex");
|
|
29918
|
-
return
|
|
30263
|
+
return join27(this.cacheDir, `${key}.pcm`);
|
|
29919
30264
|
}
|
|
29920
30265
|
clipFor(line) {
|
|
29921
|
-
const
|
|
29922
|
-
let pending = this.inFlight.get(
|
|
30266
|
+
const path36 = this.cachePath(line.say);
|
|
30267
|
+
let pending = this.inFlight.get(path36);
|
|
29923
30268
|
if (!pending) {
|
|
29924
|
-
pending = this.readOrSynthesize(line,
|
|
29925
|
-
this.inFlight.set(
|
|
30269
|
+
pending = this.readOrSynthesize(line, path36);
|
|
30270
|
+
this.inFlight.set(path36, pending);
|
|
29926
30271
|
}
|
|
29927
30272
|
return pending;
|
|
29928
30273
|
}
|
|
29929
|
-
async readOrSynthesize(line,
|
|
30274
|
+
async readOrSynthesize(line, path36) {
|
|
29930
30275
|
try {
|
|
29931
|
-
return pcmClip(
|
|
30276
|
+
return pcmClip(readFileSync18(path36));
|
|
29932
30277
|
} catch {
|
|
29933
30278
|
}
|
|
29934
30279
|
const res = await this.doFetch("https://api.openai.com/v1/audio/speech", {
|
|
@@ -29942,10 +30287,10 @@ ${text}`).digest("hex");
|
|
|
29942
30287
|
}
|
|
29943
30288
|
const buf = Buffer.from(await res.arrayBuffer());
|
|
29944
30289
|
if (buf.length < 2) throw new Error(`OpenAI speech synthesis returned no audio for line ${line.n}.`);
|
|
29945
|
-
mkdirSync12(dirname12(
|
|
29946
|
-
const tmp = `${
|
|
30290
|
+
mkdirSync12(dirname12(path36), { recursive: true });
|
|
30291
|
+
const tmp = `${path36}.${process.pid}.tmp`;
|
|
29947
30292
|
writeFileSync7(tmp, buf);
|
|
29948
|
-
renameSync5(tmp,
|
|
30293
|
+
renameSync5(tmp, path36);
|
|
29949
30294
|
return pcmClip(buf);
|
|
29950
30295
|
}
|
|
29951
30296
|
};
|
|
@@ -29972,14 +30317,14 @@ async function loadWrtcRuntime(importPackage = () => import(WRTC_PACKAGE)) {
|
|
|
29972
30317
|
function waitFor(ready, timeoutMs, clock = systemClock) {
|
|
29973
30318
|
if (ready()) return Promise.resolve(true);
|
|
29974
30319
|
const deadline = clock.now() + timeoutMs;
|
|
29975
|
-
return new Promise((
|
|
30320
|
+
return new Promise((resolve11) => {
|
|
29976
30321
|
const timer = setInterval(() => {
|
|
29977
30322
|
if (ready()) {
|
|
29978
30323
|
clearInterval(timer);
|
|
29979
|
-
|
|
30324
|
+
resolve11(true);
|
|
29980
30325
|
} else if (clock.now() >= deadline) {
|
|
29981
30326
|
clearInterval(timer);
|
|
29982
|
-
|
|
30327
|
+
resolve11(false);
|
|
29983
30328
|
}
|
|
29984
30329
|
}, WAIT_POLL_MS);
|
|
29985
30330
|
});
|
|
@@ -30088,8 +30433,8 @@ var init_call_media = __esm({
|
|
|
30088
30433
|
* asked before every frame, answers true — the rest of the clip is then dropped.
|
|
30089
30434
|
*/
|
|
30090
30435
|
play(clip, abort = () => false) {
|
|
30091
|
-
return new Promise((
|
|
30092
|
-
this.queue.push({ samples: resample(clip, PUMP_SAMPLE_RATE), offset: 0, startedAtMs: null, abort, resolve:
|
|
30436
|
+
return new Promise((resolve11) => {
|
|
30437
|
+
this.queue.push({ samples: resample(clip, PUMP_SAMPLE_RATE), offset: 0, startedAtMs: null, abort, resolve: resolve11 });
|
|
30093
30438
|
});
|
|
30094
30439
|
}
|
|
30095
30440
|
/** Send every frame the wall clock says is due. */
|
|
@@ -31272,7 +31617,7 @@ var init_runner = __esm({
|
|
|
31272
31617
|
init_score();
|
|
31273
31618
|
systemRunnerClock = {
|
|
31274
31619
|
now: () => Date.now(),
|
|
31275
|
-
sleep: (ms) => new Promise((
|
|
31620
|
+
sleep: (ms) => new Promise((resolve11) => setTimeout(resolve11, ms))
|
|
31276
31621
|
};
|
|
31277
31622
|
LONGEST_SPOKEN_LINE_MS = Math.ceil(EVAL_CALL_SPOKEN_LINE_MAX_CHARS / 15) * 1e3;
|
|
31278
31623
|
DEFAULT_RUNNER_TIMINGS = {
|
|
@@ -31394,8 +31739,8 @@ __export(eval_call_exports, {
|
|
|
31394
31739
|
printEvalCallHelp: () => printEvalCallHelp,
|
|
31395
31740
|
suiteExitCode: () => suiteExitCode
|
|
31396
31741
|
});
|
|
31397
|
-
import { accessSync, constants as fsConstants, existsSync as
|
|
31398
|
-
import { dirname as dirname13, resolve as
|
|
31742
|
+
import { accessSync, constants as fsConstants, existsSync as existsSync16, readFileSync as readFileSync19, statSync as statSync8, writeFileSync as writeFileSync8 } from "fs";
|
|
31743
|
+
import { dirname as dirname13, resolve as resolve10 } from "path";
|
|
31399
31744
|
function fail(message) {
|
|
31400
31745
|
throw new Error(message);
|
|
31401
31746
|
}
|
|
@@ -31470,26 +31815,26 @@ function parseEvalCallArgs(args2) {
|
|
|
31470
31815
|
if (parsed.jsonPath) checkReportPath(parsed.jsonPath);
|
|
31471
31816
|
return parsed;
|
|
31472
31817
|
}
|
|
31473
|
-
function checkReportPath(
|
|
31474
|
-
const target =
|
|
31818
|
+
function checkReportPath(path36) {
|
|
31819
|
+
const target = resolve10(path36);
|
|
31475
31820
|
const dir = dirname13(target);
|
|
31476
|
-
if (!
|
|
31477
|
-
if (
|
|
31821
|
+
if (!existsSync16(dir) || !statSync8(dir).isDirectory()) fail(`--json ${path36}: the folder ${dir} does not exist.`);
|
|
31822
|
+
if (existsSync16(target) && statSync8(target).isDirectory()) fail(`--json ${path36} is a folder; name a file.`);
|
|
31478
31823
|
try {
|
|
31479
|
-
accessSync(
|
|
31824
|
+
accessSync(existsSync16(target) ? target : dir, fsConstants.W_OK);
|
|
31480
31825
|
} catch {
|
|
31481
|
-
fail(`--json ${
|
|
31826
|
+
fail(`--json ${path36} cannot be written here.`);
|
|
31482
31827
|
}
|
|
31483
31828
|
}
|
|
31484
31829
|
function suiteExitCode(report2, runs, reportWritten) {
|
|
31485
31830
|
return report2.pass_rate.passed === runs && reportWritten ? 0 : 1;
|
|
31486
31831
|
}
|
|
31487
31832
|
function chooseAudioSource(options, plan, env = process.env) {
|
|
31488
|
-
const planDir = options.planPath ? dirname13(
|
|
31833
|
+
const planDir = options.planPath ? dirname13(resolve10(options.planPath)) : process.cwd();
|
|
31489
31834
|
const planHasClips = Object.values(plan.lines).some((line) => line.clip);
|
|
31490
31835
|
if (options.clipsDir || planHasClips) {
|
|
31491
|
-
if (options.clipsDir && !
|
|
31492
|
-
return new ClipDirectorySource(options.clipsDir ?
|
|
31836
|
+
if (options.clipsDir && !existsSync16(options.clipsDir)) fail(`--clips ${options.clipsDir} does not exist.`);
|
|
31837
|
+
return new ClipDirectorySource(options.clipsDir ? resolve10(options.clipsDir) : null, planDir);
|
|
31493
31838
|
}
|
|
31494
31839
|
const apiKey = env.OPENAI_API_KEY;
|
|
31495
31840
|
if (!apiKey) {
|
|
@@ -31548,7 +31893,7 @@ async function evalCallCommand(argv) {
|
|
|
31548
31893
|
let plan;
|
|
31549
31894
|
try {
|
|
31550
31895
|
options = parseEvalCallArgs(args2);
|
|
31551
|
-
plan = options.planPath ? parseCallPlan(JSON.parse(
|
|
31896
|
+
plan = options.planPath ? parseCallPlan(JSON.parse(readFileSync19(options.planPath, "utf8"))) : { lines: {} };
|
|
31552
31897
|
} catch (err) {
|
|
31553
31898
|
console.error(extractApiMessage(err));
|
|
31554
31899
|
process.exit(1);
|
|
@@ -31678,8 +32023,8 @@ var eval_capture_exports = {};
|
|
|
31678
32023
|
__export(eval_capture_exports, {
|
|
31679
32024
|
evalCaptureCommand: () => evalCaptureCommand
|
|
31680
32025
|
});
|
|
31681
|
-
import * as
|
|
31682
|
-
import * as
|
|
32026
|
+
import * as fs23 from "fs";
|
|
32027
|
+
import * as path32 from "path";
|
|
31683
32028
|
import * as yaml12 from "js-yaml";
|
|
31684
32029
|
function isValidSetName(name) {
|
|
31685
32030
|
if (name.length === 0 || name === "." || name === "..") return false;
|
|
@@ -31745,25 +32090,25 @@ async function evalCaptureCommand(args2) {
|
|
|
31745
32090
|
const setFolderName = targetSetName;
|
|
31746
32091
|
const scenarioName = parsed.evalName ?? `Capture ${parsed.conversationId.slice(0, 8)}`;
|
|
31747
32092
|
const slug = slugify(scenarioName);
|
|
31748
|
-
const evalsDir =
|
|
31749
|
-
const targetDir =
|
|
31750
|
-
const targetPath =
|
|
31751
|
-
if (!targetPath.startsWith(evalsDir +
|
|
31752
|
-
console.error(`Resolved path "${
|
|
32093
|
+
const evalsDir = path32.join(hubFolder, "evals");
|
|
32094
|
+
const targetDir = path32.join(evalsDir, setFolderName);
|
|
32095
|
+
const targetPath = path32.join(targetDir, `${slug}.yaml`);
|
|
32096
|
+
if (!targetPath.startsWith(evalsDir + path32.sep)) {
|
|
32097
|
+
console.error(`Resolved path "${path32.relative(hubFolder, targetPath)}" escapes evals/. Aborting.`);
|
|
31753
32098
|
process.exit(1);
|
|
31754
32099
|
}
|
|
31755
32100
|
if (!ensureRealSubdirNoSymlink(hubFolder, targetDir, false)) {
|
|
31756
|
-
console.error(`${
|
|
32101
|
+
console.error(`${path32.relative(hubFolder, targetDir)} is reached through a symlink. Aborting.`);
|
|
31757
32102
|
process.exit(1);
|
|
31758
32103
|
}
|
|
31759
32104
|
let targetTaken = true;
|
|
31760
32105
|
try {
|
|
31761
|
-
|
|
32106
|
+
fs23.lstatSync(targetPath);
|
|
31762
32107
|
} catch {
|
|
31763
32108
|
targetTaken = false;
|
|
31764
32109
|
}
|
|
31765
32110
|
if (targetTaken) {
|
|
31766
|
-
console.error(`File already exists: ${
|
|
32111
|
+
console.error(`File already exists: ${path32.relative(hubFolder, targetPath)}. Use --name to choose a different name.`);
|
|
31767
32112
|
process.exit(1);
|
|
31768
32113
|
}
|
|
31769
32114
|
console.log("Resolving scenario set...");
|
|
@@ -31798,11 +32143,11 @@ async function evalCaptureCommand(args2) {
|
|
|
31798
32143
|
const outcome = createFileNoFollow(hubFolder, targetPath, Buffer.from(yaml12.dump(yamlObj, YAML_DUMP_OPTIONS), "utf-8"));
|
|
31799
32144
|
if (outcome !== "created") {
|
|
31800
32145
|
console.error(
|
|
31801
|
-
`Could not write ${
|
|
32146
|
+
`Could not write ${path32.relative(hubFolder, targetPath)} (${outcome === "exists" ? "it appeared meanwhile" : "its folder is reached through a symlink"}). The scenario was created on the platform as ${captured.eval_id} \u2014 run \`wayai pull\` to fetch it.`
|
|
31802
32147
|
);
|
|
31803
32148
|
process.exit(1);
|
|
31804
32149
|
}
|
|
31805
|
-
const relPath =
|
|
32150
|
+
const relPath = path32.relative(process.cwd(), targetPath);
|
|
31806
32151
|
console.log(`
|
|
31807
32152
|
Wrote ${relPath}`);
|
|
31808
32153
|
console.log("Run `wayai pull` to refresh the agent display name, then commit. The scenario is already on the platform.");
|
|
@@ -33182,19 +33527,19 @@ var init_set_connection_credential = __esm({
|
|
|
33182
33527
|
});
|
|
33183
33528
|
|
|
33184
33529
|
// src/lib/org-workspace.ts
|
|
33185
|
-
import * as
|
|
33186
|
-
import * as
|
|
33530
|
+
import * as fs24 from "fs";
|
|
33531
|
+
import * as path33 from "path";
|
|
33187
33532
|
import * as yaml13 from "js-yaml";
|
|
33188
33533
|
function getOrgDir(gitRoot) {
|
|
33189
33534
|
return resolveLayout(gitRoot).orgDir;
|
|
33190
33535
|
}
|
|
33191
33536
|
function orgManifestExists(orgDir) {
|
|
33192
|
-
return
|
|
33537
|
+
return fs24.existsSync(path33.join(orgDir, ORG_MANIFEST_NAME));
|
|
33193
33538
|
}
|
|
33194
33539
|
function parseOrgResources(orgDir) {
|
|
33195
|
-
const resourcesDir =
|
|
33540
|
+
const resourcesDir = path33.join(orgDir, "resources");
|
|
33196
33541
|
requireRealSubdirNoSymlink(orgDir, resourcesDir, false);
|
|
33197
|
-
const manifestText = readRealFileOrThrow(orgDir,
|
|
33542
|
+
const manifestText = readRealFileOrThrow(orgDir, path33.join(orgDir, ORG_MANIFEST_NAME));
|
|
33198
33543
|
const manifest = (manifestText !== null ? yaml13.load(manifestText) : null) ?? {};
|
|
33199
33544
|
const rawResources = Array.isArray(manifest.resources) ? manifest.resources : [];
|
|
33200
33545
|
const resources = rawResources.map((res) => {
|
|
@@ -33208,9 +33553,9 @@ function parseOrgResources(orgDir) {
|
|
|
33208
33553
|
if (res.environment) resource.environment = res.environment;
|
|
33209
33554
|
if (Array.isArray(res.tags)) resource.tags = res.tags;
|
|
33210
33555
|
if (Array.isArray(res.folders)) resource.folders = res.folders;
|
|
33211
|
-
const resDir =
|
|
33556
|
+
const resDir = path33.join(resourcesDir, slugify(resource.name));
|
|
33212
33557
|
requireRealSubdirNoSymlink(orgDir, resDir, false);
|
|
33213
|
-
if (
|
|
33558
|
+
if (fs24.existsSync(resDir)) {
|
|
33214
33559
|
const files = scanResourceFiles(resDir, "");
|
|
33215
33560
|
if (files.length > 0) resource.files = files;
|
|
33216
33561
|
}
|
|
@@ -33219,8 +33564,8 @@ function parseOrgResources(orgDir) {
|
|
|
33219
33564
|
return { version: 1, resources };
|
|
33220
33565
|
}
|
|
33221
33566
|
function writeOrgResources(orgDir, payload) {
|
|
33222
|
-
|
|
33223
|
-
const resourcesDir =
|
|
33567
|
+
fs24.mkdirSync(orgDir, { recursive: true });
|
|
33568
|
+
const resourcesDir = path33.join(orgDir, "resources");
|
|
33224
33569
|
requireRealSubdirNoSymlink(orgDir, resourcesDir, false);
|
|
33225
33570
|
const resources = payload.resources ?? [];
|
|
33226
33571
|
const manifestResources = resources.map((r) => {
|
|
@@ -33229,19 +33574,19 @@ function writeOrgResources(orgDir, payload) {
|
|
|
33229
33574
|
});
|
|
33230
33575
|
writeFileNoFollow(
|
|
33231
33576
|
orgDir,
|
|
33232
|
-
|
|
33577
|
+
path33.join(orgDir, ORG_MANIFEST_NAME),
|
|
33233
33578
|
Buffer.from(yaml13.dump({ version: 1, resources: manifestResources }, YAML_DUMP_OPTIONS), "utf-8")
|
|
33234
33579
|
);
|
|
33235
33580
|
const currentSlugs = /* @__PURE__ */ new Set();
|
|
33236
33581
|
for (const resource of resources) {
|
|
33237
33582
|
const resSlug = slugify(resource.name);
|
|
33238
33583
|
currentSlugs.add(resSlug);
|
|
33239
|
-
writeResourceFileTree(
|
|
33584
|
+
writeResourceFileTree(path33.join(resourcesDir, resSlug), resource.files || [], orgDir);
|
|
33240
33585
|
}
|
|
33241
|
-
if (
|
|
33242
|
-
for (const entry of
|
|
33586
|
+
if (fs24.existsSync(resourcesDir)) {
|
|
33587
|
+
for (const entry of fs24.readdirSync(resourcesDir, { withFileTypes: true })) {
|
|
33243
33588
|
if (entry.isDirectory() && !currentSlugs.has(entry.name)) {
|
|
33244
|
-
|
|
33589
|
+
fs24.rmSync(path33.join(resourcesDir, entry.name), { recursive: true, force: true });
|
|
33245
33590
|
}
|
|
33246
33591
|
}
|
|
33247
33592
|
}
|
|
@@ -33250,7 +33595,7 @@ async function downloadOrgBinaryFiles(orgDir, payload) {
|
|
|
33250
33595
|
let count = 0;
|
|
33251
33596
|
for (const resource of payload.resources ?? []) {
|
|
33252
33597
|
if (!resource.files) continue;
|
|
33253
|
-
const resDir =
|
|
33598
|
+
const resDir = path33.join(orgDir, "resources", slugify(resource.name));
|
|
33254
33599
|
count += await downloadBinaryFiles(resDir, resource.files, orgDir);
|
|
33255
33600
|
}
|
|
33256
33601
|
if (count > 0) console.log(`Downloaded ${count} binary resource file(s).`);
|
|
@@ -33547,8 +33892,8 @@ var init_report_edit_args = __esm({
|
|
|
33547
33892
|
});
|
|
33548
33893
|
|
|
33549
33894
|
// src/lib/file-map.ts
|
|
33550
|
-
import * as
|
|
33551
|
-
import * as
|
|
33895
|
+
import * as fs25 from "fs";
|
|
33896
|
+
import * as path34 from "path";
|
|
33552
33897
|
function isSafeRelPath(rel) {
|
|
33553
33898
|
if (rel.length === 0 || rel.length > 300) return false;
|
|
33554
33899
|
if (rel.startsWith("/") || rel.includes("\\")) return false;
|
|
@@ -33563,9 +33908,9 @@ function writeFileMap(targetDir, files) {
|
|
|
33563
33908
|
if (!isSafeRelPath(rel)) {
|
|
33564
33909
|
throw new Error(`Refusing to write unsafe path: ${rel}`);
|
|
33565
33910
|
}
|
|
33566
|
-
const abs =
|
|
33567
|
-
|
|
33568
|
-
|
|
33911
|
+
const abs = path34.join(targetDir, rel);
|
|
33912
|
+
fs25.mkdirSync(path34.dirname(abs), { recursive: true });
|
|
33913
|
+
fs25.writeFileSync(abs, body, "utf-8");
|
|
33569
33914
|
written.push(rel);
|
|
33570
33915
|
}
|
|
33571
33916
|
return written;
|
|
@@ -33581,8 +33926,8 @@ var admin_exports = {};
|
|
|
33581
33926
|
__export(admin_exports, {
|
|
33582
33927
|
adminCommand: () => adminCommand
|
|
33583
33928
|
});
|
|
33584
|
-
import * as
|
|
33585
|
-
import * as
|
|
33929
|
+
import * as fs26 from "fs";
|
|
33930
|
+
import * as path35 from "path";
|
|
33586
33931
|
async function adminCommand(args2) {
|
|
33587
33932
|
const [group, ...afterGroup] = args2;
|
|
33588
33933
|
if (!group) {
|
|
@@ -33920,7 +34265,7 @@ async function runArchiveRead(positional, flagArgs) {
|
|
|
33920
34265
|
exitOnApiError(err);
|
|
33921
34266
|
throw err;
|
|
33922
34267
|
}
|
|
33923
|
-
|
|
34268
|
+
fs26.writeFileSync(outPath, zip);
|
|
33924
34269
|
console.log(`Wrote ${zip.byteLength} bytes to ${outPath}`);
|
|
33925
34270
|
return;
|
|
33926
34271
|
}
|
|
@@ -34062,13 +34407,13 @@ async function runSkillInstall(positional) {
|
|
|
34062
34407
|
throw err;
|
|
34063
34408
|
}
|
|
34064
34409
|
const root = findGitRoot() ?? process.cwd();
|
|
34065
|
-
const present = HARNESS_SKILL_DIRS.filter((dir) =>
|
|
34410
|
+
const present = HARNESS_SKILL_DIRS.filter((dir) => fs26.existsSync(path35.join(root, dir)));
|
|
34066
34411
|
const targets = present.length > 0 ? present : HARNESS_SKILL_DIRS;
|
|
34067
34412
|
const fileCount = Object.keys(res.files).length;
|
|
34068
34413
|
const relDirs = targets.map((harness) => {
|
|
34069
|
-
const targetDir =
|
|
34414
|
+
const targetDir = path35.join(root, harness, "skills", name);
|
|
34070
34415
|
writeFileMap(targetDir, res.files);
|
|
34071
|
-
return `${
|
|
34416
|
+
return `${path35.relative(root, targetDir)}/`;
|
|
34072
34417
|
});
|
|
34073
34418
|
console.log(`Installed skill "${name}" (${fileCount} file${fileCount === 1 ? "" : "s"}) \u2192 ${relDirs.join(", ")}`);
|
|
34074
34419
|
console.log("Reload your agent (e.g. restart Claude Code) to pick up the skill.");
|
|
@@ -35693,7 +36038,7 @@ var init_actions = __esm({
|
|
|
35693
36038
|
|
|
35694
36039
|
// src/data/commands/attachments.ts
|
|
35695
36040
|
import { Command as Command2 } from "commander";
|
|
35696
|
-
import { readFileSync as
|
|
36041
|
+
import { readFileSync as readFileSync20 } from "fs";
|
|
35697
36042
|
function findAttachmentByFilename(attachments, filename) {
|
|
35698
36043
|
return attachments.find((a) => a.key.endsWith(`/${filename}`)) ?? null;
|
|
35699
36044
|
}
|
|
@@ -35734,7 +36079,7 @@ function buildAttachmentsCommand() {
|
|
|
35734
36079
|
printOutput(data, outputFormat(this));
|
|
35735
36080
|
return;
|
|
35736
36081
|
}
|
|
35737
|
-
const body =
|
|
36082
|
+
const body = readFileSync20(opts.file);
|
|
35738
36083
|
await client.upload(uploadPathFrom(data?.upload_url), body, opts.contentType);
|
|
35739
36084
|
printOutput({ ...data, uploaded: true }, outputFormat(this));
|
|
35740
36085
|
});
|
|
@@ -36214,16 +36559,16 @@ var init_providers = __esm({
|
|
|
36214
36559
|
|
|
36215
36560
|
// src/data/commands/report.ts
|
|
36216
36561
|
import { Command as Command6 } from "commander";
|
|
36217
|
-
import { readFileSync as
|
|
36218
|
-
import { dirname as dirname15, join as
|
|
36562
|
+
import { readFileSync as readFileSync21 } from "fs";
|
|
36563
|
+
import { dirname as dirname15, join as join32 } from "path";
|
|
36219
36564
|
import { fileURLToPath as fileURLToPath2 } from "url";
|
|
36220
36565
|
function resolveCliVersion() {
|
|
36221
36566
|
for (const candidate of [
|
|
36222
|
-
|
|
36223
|
-
|
|
36567
|
+
join32(here, "..", "package.json"),
|
|
36568
|
+
join32(here, "..", "..", "..", "package.json")
|
|
36224
36569
|
]) {
|
|
36225
36570
|
try {
|
|
36226
|
-
const version = JSON.parse(
|
|
36571
|
+
const version = JSON.parse(readFileSync21(candidate, "utf-8")).version;
|
|
36227
36572
|
if (typeof version === "string" && version) return version;
|
|
36228
36573
|
} catch {
|
|
36229
36574
|
}
|
|
@@ -36425,7 +36770,7 @@ var init_report3 = __esm({
|
|
|
36425
36770
|
|
|
36426
36771
|
// src/data/commands/credentials.ts
|
|
36427
36772
|
import { Command as Command7 } from "commander";
|
|
36428
|
-
import { readFileSync as
|
|
36773
|
+
import { readFileSync as readFileSync22 } from "fs";
|
|
36429
36774
|
function withValueSourceOptions(cmd, what) {
|
|
36430
36775
|
return cmd.option(
|
|
36431
36776
|
"--file <path>",
|
|
@@ -36438,7 +36783,7 @@ async function resolveValue(opts, label) {
|
|
|
36438
36783
|
throw expected("--file cannot be combined with --value-stdin or --value-prompt \u2014 pass one.");
|
|
36439
36784
|
}
|
|
36440
36785
|
try {
|
|
36441
|
-
return
|
|
36786
|
+
return readFileSync22(opts.file).toString("base64");
|
|
36442
36787
|
} catch (e) {
|
|
36443
36788
|
throw expected(`--file ${opts.file}: ${e instanceof Error ? e.message : "could not be read"}`);
|
|
36444
36789
|
}
|
|
@@ -36587,7 +36932,7 @@ var init_credentials = __esm({
|
|
|
36587
36932
|
|
|
36588
36933
|
// src/data/commands/sql.ts
|
|
36589
36934
|
import { Command as Command8 } from "commander";
|
|
36590
|
-
import { readFileSync as
|
|
36935
|
+
import { readFileSync as readFileSync23 } from "fs";
|
|
36591
36936
|
function buildBasesSqlCommand() {
|
|
36592
36937
|
return withBaseOption(new Command8("sql")).description("Execute a read-only SQL query against base data").argument("[query]", "SQL query (SELECT only)").option("--file <path>", "Read SQL from a file instead of the argument").option(
|
|
36593
36938
|
"--param <kv...>",
|
|
@@ -36597,7 +36942,7 @@ function buildBasesSqlCommand() {
|
|
|
36597
36942
|
let query;
|
|
36598
36943
|
if (opts.file) {
|
|
36599
36944
|
try {
|
|
36600
|
-
query =
|
|
36945
|
+
query = readFileSync23(opts.file, "utf-8").trim();
|
|
36601
36946
|
} catch (e) {
|
|
36602
36947
|
throw expected(`--file ${opts.file}: ${e instanceof Error ? e.message : "could not be read"}`);
|
|
36603
36948
|
}
|
|
@@ -36732,16 +37077,16 @@ MCP URL: ${toolsetMcpUrl(slug)}`);
|
|
|
36732
37077
|
).option("--force", "Revoke even if the token appears to be in live use").action(async function(tokenId, opts) {
|
|
36733
37078
|
const client = await createDataClient();
|
|
36734
37079
|
const id = pathSegment(tokenId, "token id");
|
|
36735
|
-
const
|
|
37080
|
+
const path36 = (force) => `/v1/tokens/${id}${force ? "?force=true" : ""}`;
|
|
36736
37081
|
const format = outputFormat(this);
|
|
36737
37082
|
const revoked = (forced) => printOutput({ token_id: tokenId, revoked: true, forced }, format);
|
|
36738
37083
|
if (opts.force) {
|
|
36739
|
-
await client.request("DELETE",
|
|
37084
|
+
await client.request("DELETE", path36(true));
|
|
36740
37085
|
revoked(true);
|
|
36741
37086
|
return;
|
|
36742
37087
|
}
|
|
36743
37088
|
try {
|
|
36744
|
-
await client.request("DELETE",
|
|
37089
|
+
await client.request("DELETE", path36(false));
|
|
36745
37090
|
revoked(false);
|
|
36746
37091
|
} catch (err) {
|
|
36747
37092
|
if (!(err instanceof ApiError) || err.status !== 409 || dataErrorDetails(err)?.requires_force !== true) {
|
|
@@ -36756,7 +37101,7 @@ MCP URL: ${toolsetMcpUrl(slug)}`);
|
|
|
36756
37101
|
console.error("Aborted.");
|
|
36757
37102
|
return process.exit(1);
|
|
36758
37103
|
}
|
|
36759
|
-
await client.request("DELETE",
|
|
37104
|
+
await client.request("DELETE", path36(true));
|
|
36760
37105
|
revoked(true);
|
|
36761
37106
|
}
|
|
36762
37107
|
});
|
|
@@ -36904,9 +37249,9 @@ var init_base_tags = __esm({
|
|
|
36904
37249
|
|
|
36905
37250
|
// src/data/commands/bases.ts
|
|
36906
37251
|
import { Command as Command10 } from "commander";
|
|
36907
|
-
function pageOf(
|
|
36908
|
-
if (!cursor) return
|
|
36909
|
-
return `${
|
|
37252
|
+
function pageOf(path36, cursor) {
|
|
37253
|
+
if (!cursor) return path36;
|
|
37254
|
+
return `${path36}${path36.includes("?") ? "&" : "?"}cursor=${encodeURIComponent(cursor)}`;
|
|
36910
37255
|
}
|
|
36911
37256
|
function parseEnum(flag, value, allowed) {
|
|
36912
37257
|
if (value === void 0) return void 0;
|
|
@@ -37063,9 +37408,9 @@ function buildBasesCommand() {
|
|
|
37063
37408
|
});
|
|
37064
37409
|
bases.command("list-previews <origin-id>").description("List preview bases cloned from a base (production or preview)").action(async function(originId) {
|
|
37065
37410
|
const client = await createDataClient();
|
|
37066
|
-
const
|
|
37411
|
+
const path36 = `/v1/${pathSegment(originId, "origin base id")}/previews`;
|
|
37067
37412
|
printOutput(
|
|
37068
|
-
await client.collectPages((cursor) => pageOf(
|
|
37413
|
+
await client.collectPages((cursor) => pageOf(path36, cursor)),
|
|
37069
37414
|
outputFormat(this)
|
|
37070
37415
|
);
|
|
37071
37416
|
});
|
|
@@ -37112,9 +37457,9 @@ function buildBasesCommand() {
|
|
|
37112
37457
|
});
|
|
37113
37458
|
bases.command("promotions <production-id>").description("List promotion history for a production base").action(async function(productionId) {
|
|
37114
37459
|
const client = await createDataClient();
|
|
37115
|
-
const
|
|
37460
|
+
const path36 = `/v1/${pathSegment(productionId, "production base id")}/promotions`;
|
|
37116
37461
|
printOutput(
|
|
37117
|
-
await client.collectPages((cursor) => pageOf(
|
|
37462
|
+
await client.collectPages((cursor) => pageOf(path36, cursor)),
|
|
37118
37463
|
outputFormat(this)
|
|
37119
37464
|
);
|
|
37120
37465
|
});
|
|
@@ -37252,7 +37597,7 @@ var init_file_types = __esm({
|
|
|
37252
37597
|
|
|
37253
37598
|
// src/data/commands/files.ts
|
|
37254
37599
|
import { Command as Command12 } from "commander";
|
|
37255
|
-
import { readFileSync as
|
|
37600
|
+
import { readFileSync as readFileSync24, writeFileSync as writeFileSync12 } from "fs";
|
|
37256
37601
|
import { basename as basename20 } from "path";
|
|
37257
37602
|
function renderFileDiff(fileType, filePath, from, to, d) {
|
|
37258
37603
|
console.log(sanitizeTerminalText(`${fileType}/${filePath}: v${from} \u2192 v${to}`));
|
|
@@ -37301,7 +37646,7 @@ function buildFilesCommand() {
|
|
|
37301
37646
|
"Upload a local file to a path (e.g. wayai files put reports q3/summary.pdf --file ./summary.pdf)"
|
|
37302
37647
|
).requiredOption("--file <local>", "Local file to upload").option("--content-type <type>", "MIME type", "application/octet-stream").action(async function(fileType, filePath, opts) {
|
|
37303
37648
|
const base = pathSegment(requireBase(this), "--base");
|
|
37304
|
-
const body =
|
|
37649
|
+
const body = readFileSync24(opts.file);
|
|
37305
37650
|
const client = await createDataClient();
|
|
37306
37651
|
printOutput(
|
|
37307
37652
|
await client.upload(
|
|
@@ -37661,8 +38006,8 @@ function buildRecordsCommand() {
|
|
|
37661
38006
|
const body = { data: parseData(opts.data) };
|
|
37662
38007
|
if (opts.externalId) body.external_id = opts.externalId;
|
|
37663
38008
|
if (opts.externalSource) body.external_source = opts.externalSource;
|
|
37664
|
-
const
|
|
37665
|
-
printOutput(await client.request("PUT",
|
|
38009
|
+
const path36 = opts.id ? `/v1/${base}/records/${pathSegment(recordType2, "record_type")}/${pathSegment(opts.id, "--id")}` : `/v1/${base}/records/${pathSegment(recordType2, "record_type")}`;
|
|
38010
|
+
printOutput(await client.request("PUT", path36, body), outputFormat(this));
|
|
37666
38011
|
});
|
|
37667
38012
|
records.command("query <record_type>").description("List/search records: exact filters + fuzzy `search`, sorting, pagination").option(
|
|
37668
38013
|
"--external-source <source>",
|
|
@@ -37697,9 +38042,9 @@ function buildRecordsCommand() {
|
|
|
37697
38042
|
).action(async function(recordType2, id, opts) {
|
|
37698
38043
|
const base = pathSegment(requireBase(this), "--base");
|
|
37699
38044
|
const client = await createDataClient();
|
|
37700
|
-
let
|
|
37701
|
-
if (opts.externalSource)
|
|
37702
|
-
printOutput(await client.request("GET",
|
|
38045
|
+
let path36 = `/v1/${base}/records/${pathSegment(recordType2, "record_type")}/${recordKey(id, opts.externalSource)}`;
|
|
38046
|
+
if (opts.externalSource) path36 += `?external_source=${encodeURIComponent(opts.externalSource)}`;
|
|
38047
|
+
printOutput(await client.request("GET", path36), outputFormat(this));
|
|
37703
38048
|
});
|
|
37704
38049
|
records.command("delete <record_type> <id>").description(
|
|
37705
38050
|
"Delete a record by internal ID, or by external_id (pass --external-source to scope it)"
|
|
@@ -37713,11 +38058,11 @@ function buildRecordsCommand() {
|
|
|
37713
38058
|
}
|
|
37714
38059
|
const base = pathSegment(requireBase(this), "--base");
|
|
37715
38060
|
const client = await createDataClient();
|
|
37716
|
-
let
|
|
38061
|
+
let path36 = `/v1/${base}/records/${pathSegment(recordType2, "record_type")}/${recordKey(id, opts.externalSource)}`;
|
|
37717
38062
|
if (opts.externalSource) {
|
|
37718
|
-
|
|
38063
|
+
path36 += `?external_source=${encodeURIComponent(opts.externalSource)}&external_id=${encodeURIComponent(id)}`;
|
|
37719
38064
|
}
|
|
37720
|
-
await client.request("DELETE",
|
|
38065
|
+
await client.request("DELETE", path36);
|
|
37721
38066
|
console.log("Deleted");
|
|
37722
38067
|
});
|
|
37723
38068
|
records.command("history <id>").description(
|
|
@@ -37882,8 +38227,8 @@ function buildRelationshipsCommand() {
|
|
|
37882
38227
|
if (opts.data) body.data = parseData(opts.data);
|
|
37883
38228
|
const base = pathSegment(requireBase(this), "--base");
|
|
37884
38229
|
const client = await createDataClient();
|
|
37885
|
-
const
|
|
37886
|
-
printOutput(await client.request("PUT",
|
|
38230
|
+
const path36 = opts.id ? `/v1/${base}/relationships/${pathSegment(opts.id, "--id")}` : `/v1/${base}/relationships`;
|
|
38231
|
+
printOutput(await client.request("PUT", path36, body), outputFormat(this));
|
|
37887
38232
|
});
|
|
37888
38233
|
relationships.command("get <id>").description(
|
|
37889
38234
|
"Get a relationship by ID (or by its external key: pass the external_id with --rel-type)"
|
|
@@ -38116,8 +38461,8 @@ function buildToolsetsCommand() {
|
|
|
38116
38461
|
toolsets.command("get <slug>").description("Get a toolset").option("--resolved", "Include resolved record_type schemas").action(async function(slug, opts) {
|
|
38117
38462
|
const base = pathSegment(requireBase(this), "--base");
|
|
38118
38463
|
const client = await createDataClient();
|
|
38119
|
-
const
|
|
38120
|
-
printOutput(await client.request("GET",
|
|
38464
|
+
const path36 = opts.resolved ? `/v1/${base}/toolsets/${pathSegment(slug, "toolset slug")}/resolved` : `/v1/${base}/toolsets/${pathSegment(slug, "toolset slug")}`;
|
|
38465
|
+
printOutput(await client.request("GET", path36), outputFormat(this));
|
|
38121
38466
|
});
|
|
38122
38467
|
toolsets.command("list").description("List all toolsets").action(async function() {
|
|
38123
38468
|
const base = pathSegment(requireBase(this), "--base");
|
|
@@ -38350,9 +38695,9 @@ init_errors2();
|
|
|
38350
38695
|
init_mask_secrets();
|
|
38351
38696
|
init_utils();
|
|
38352
38697
|
init_registry();
|
|
38353
|
-
import { readFileSync as
|
|
38698
|
+
import { readFileSync as readFileSync25 } from "fs";
|
|
38354
38699
|
import { fileURLToPath as fileURLToPath3 } from "url";
|
|
38355
|
-
import { dirname as dirname16, join as
|
|
38700
|
+
import { dirname as dirname16, join as join33 } from "path";
|
|
38356
38701
|
|
|
38357
38702
|
// src/lib/version-refresh.ts
|
|
38358
38703
|
init_version_cache();
|
|
@@ -38360,7 +38705,7 @@ init_skill_version();
|
|
|
38360
38705
|
import { exec } from "child_process";
|
|
38361
38706
|
var REFRESH_TIMEOUT_MS = 1e4;
|
|
38362
38707
|
function refreshCliCache() {
|
|
38363
|
-
return new Promise((
|
|
38708
|
+
return new Promise((resolve11) => {
|
|
38364
38709
|
exec("npm view @wayai/cli version", { timeout: REFRESH_TIMEOUT_MS }, (err, stdout) => {
|
|
38365
38710
|
if (!err) {
|
|
38366
38711
|
const latest = stdout.trim();
|
|
@@ -38371,7 +38716,7 @@ function refreshCliCache() {
|
|
|
38371
38716
|
}
|
|
38372
38717
|
}
|
|
38373
38718
|
}
|
|
38374
|
-
|
|
38719
|
+
resolve11();
|
|
38375
38720
|
});
|
|
38376
38721
|
});
|
|
38377
38722
|
}
|
|
@@ -38397,8 +38742,8 @@ async function refreshSkillCache() {
|
|
|
38397
38742
|
}
|
|
38398
38743
|
async function refreshAdminSkillCache() {
|
|
38399
38744
|
let timer;
|
|
38400
|
-
const deadline = new Promise((
|
|
38401
|
-
timer = setTimeout(
|
|
38745
|
+
const deadline = new Promise((resolve11) => {
|
|
38746
|
+
timer = setTimeout(resolve11, REFRESH_TIMEOUT_MS);
|
|
38402
38747
|
});
|
|
38403
38748
|
await Promise.race([deadline, fetchAndCacheAdminSkillVersion().catch(() => {
|
|
38404
38749
|
})]);
|
|
@@ -38508,7 +38853,7 @@ Run \`wayai admin skill install\` to update.`);
|
|
|
38508
38853
|
|
|
38509
38854
|
// src/index.ts
|
|
38510
38855
|
var __dirname = dirname16(fileURLToPath3(import.meta.url));
|
|
38511
|
-
var pkg = JSON.parse(
|
|
38856
|
+
var pkg = JSON.parse(readFileSync25(join33(__dirname, "..", "package.json"), "utf-8"));
|
|
38512
38857
|
var [, , command, ...args] = process.argv;
|
|
38513
38858
|
var isBackgroundRefresh = command === REFRESH_COMMAND;
|
|
38514
38859
|
if (!isBackgroundRefresh) initSentry(command, pkg.version);
|