@wayai/cli 0.3.131 → 0.3.132
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 +134 -1076
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -441,11 +441,11 @@ function captureException2(error, context) {
|
|
|
441
441
|
Sentry.captureException(error);
|
|
442
442
|
});
|
|
443
443
|
}
|
|
444
|
-
function addApiBreadcrumb(method,
|
|
444
|
+
function addApiBreadcrumb(method, path30) {
|
|
445
445
|
if (!initialized) return;
|
|
446
446
|
Sentry.addBreadcrumb({
|
|
447
447
|
category: "http",
|
|
448
|
-
message: `${method} ${
|
|
448
|
+
message: `${method} ${path30}`,
|
|
449
449
|
level: "info"
|
|
450
450
|
});
|
|
451
451
|
}
|
|
@@ -899,8 +899,8 @@ var init_parseUtil = __esm({
|
|
|
899
899
|
init_errors();
|
|
900
900
|
init_en();
|
|
901
901
|
makeIssue = (params) => {
|
|
902
|
-
const { data, path:
|
|
903
|
-
const fullPath = [...
|
|
902
|
+
const { data, path: path30, errorMaps, issueData } = params;
|
|
903
|
+
const fullPath = [...path30, ...issueData.path || []];
|
|
904
904
|
const fullIssue = {
|
|
905
905
|
...issueData,
|
|
906
906
|
path: fullPath
|
|
@@ -1211,11 +1211,11 @@ var init_types = __esm({
|
|
|
1211
1211
|
init_parseUtil();
|
|
1212
1212
|
init_util();
|
|
1213
1213
|
ParseInputLazyPath = class {
|
|
1214
|
-
constructor(parent, value,
|
|
1214
|
+
constructor(parent, value, path30, key) {
|
|
1215
1215
|
this._cachedPath = [];
|
|
1216
1216
|
this.parent = parent;
|
|
1217
1217
|
this.data = value;
|
|
1218
|
-
this._path =
|
|
1218
|
+
this._path = path30;
|
|
1219
1219
|
this._key = key;
|
|
1220
1220
|
}
|
|
1221
1221
|
get path() {
|
|
@@ -4684,12 +4684,12 @@ function typeMatches(typeField, allowed) {
|
|
|
4684
4684
|
if (Array.isArray(typeField)) return typeField.every((t) => typeof t === "string" && allowed.has(t));
|
|
4685
4685
|
return false;
|
|
4686
4686
|
}
|
|
4687
|
-
function validateSchema(schema,
|
|
4687
|
+
function validateSchema(schema, path30, errors, opts = {}) {
|
|
4688
4688
|
if (typeof schema === "boolean") return;
|
|
4689
4689
|
const depth = opts.depth ?? 0;
|
|
4690
4690
|
if (depth > MAX_SCHEMA_DEPTH) {
|
|
4691
4691
|
errors.push({
|
|
4692
|
-
path:
|
|
4692
|
+
path: path30 || "<root>",
|
|
4693
4693
|
message: `schema nesting exceeds ${MAX_SCHEMA_DEPTH} levels`,
|
|
4694
4694
|
suggestion: "Flatten the schema; LLM providers reject deeply nested tool input_schemas."
|
|
4695
4695
|
});
|
|
@@ -4697,7 +4697,7 @@ function validateSchema(schema, path31, errors, opts = {}) {
|
|
|
4697
4697
|
}
|
|
4698
4698
|
if (!isRecord(schema)) {
|
|
4699
4699
|
errors.push({
|
|
4700
|
-
path:
|
|
4700
|
+
path: path30,
|
|
4701
4701
|
message: `expected object, got ${schema === null ? "null" : typeof schema}`
|
|
4702
4702
|
});
|
|
4703
4703
|
return;
|
|
@@ -4705,14 +4705,14 @@ function validateSchema(schema, path31, errors, opts = {}) {
|
|
|
4705
4705
|
if (opts.isRoot) {
|
|
4706
4706
|
if ("type" in schema && schema.type !== "object") {
|
|
4707
4707
|
errors.push({
|
|
4708
|
-
path:
|
|
4708
|
+
path: path30 ? `${path30}.type` : "type",
|
|
4709
4709
|
message: `root type must be 'object', got ${JSON.stringify(schema.type)}`,
|
|
4710
4710
|
suggestion: "Tool parameters at the root must be an object: `{ type: 'object', properties: { ... } }`."
|
|
4711
4711
|
});
|
|
4712
4712
|
}
|
|
4713
4713
|
} else if ("type" in schema && !typeMatches(schema.type, ALLOWED_TYPES)) {
|
|
4714
4714
|
errors.push({
|
|
4715
|
-
path: `${
|
|
4715
|
+
path: `${path30}.type`,
|
|
4716
4716
|
message: `type must be one of ${[...ALLOWED_TYPES].join("/")} or an array of those, got ${JSON.stringify(schema.type)}`
|
|
4717
4717
|
});
|
|
4718
4718
|
}
|
|
@@ -4722,25 +4722,25 @@ function validateSchema(schema, path31, errors, opts = {}) {
|
|
|
4722
4722
|
const isPlaceholder = PLACEHOLDER_TOKENS.includes(e);
|
|
4723
4723
|
const isOutcomePlaceholder = e === "[KANBAN_OUTCOME_VALUES]";
|
|
4724
4724
|
errors.push({
|
|
4725
|
-
path: `${
|
|
4725
|
+
path: `${path30}.enum`,
|
|
4726
4726
|
message: `enum must be a non-empty array of primitives, got string ${JSON.stringify(e)}`,
|
|
4727
4727
|
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"]`.'
|
|
4728
4728
|
});
|
|
4729
4729
|
} else if (!Array.isArray(e)) {
|
|
4730
4730
|
errors.push({
|
|
4731
|
-
path: `${
|
|
4731
|
+
path: `${path30}.enum`,
|
|
4732
4732
|
message: `enum must be a non-empty array of primitives, got ${typeof e}`
|
|
4733
4733
|
});
|
|
4734
4734
|
} else if (e.length === 0) {
|
|
4735
4735
|
errors.push({
|
|
4736
|
-
path: `${
|
|
4736
|
+
path: `${path30}.enum`,
|
|
4737
4737
|
message: "enum must not be empty"
|
|
4738
4738
|
});
|
|
4739
4739
|
} else {
|
|
4740
4740
|
for (let i = 0; i < e.length; i++) {
|
|
4741
4741
|
if (!isPrimitive(e[i])) {
|
|
4742
4742
|
errors.push({
|
|
4743
|
-
path: `${
|
|
4743
|
+
path: `${path30}.enum[${i}]`,
|
|
4744
4744
|
message: `enum entry must be a primitive (string/number/boolean/null), got ${typeof e[i]}`
|
|
4745
4745
|
});
|
|
4746
4746
|
}
|
|
@@ -4750,7 +4750,7 @@ function validateSchema(schema, path31, errors, opts = {}) {
|
|
|
4750
4750
|
for (const key of ["exclusiveMinimum", "exclusiveMaximum"]) {
|
|
4751
4751
|
if (key in schema && typeof schema[key] === "boolean") {
|
|
4752
4752
|
errors.push({
|
|
4753
|
-
path: `${
|
|
4753
|
+
path: `${path30}.${key}`,
|
|
4754
4754
|
message: `${key} as boolean is draft-04 syntax; draft 2020-12 requires a numeric value`,
|
|
4755
4755
|
suggestion: `Replace with the numeric bound, e.g. \`${key}: 0\`.`
|
|
4756
4756
|
});
|
|
@@ -4759,45 +4759,45 @@ function validateSchema(schema, path31, errors, opts = {}) {
|
|
|
4759
4759
|
if ("properties" in schema) {
|
|
4760
4760
|
if (!isRecord(schema.properties)) {
|
|
4761
4761
|
errors.push({
|
|
4762
|
-
path: `${
|
|
4762
|
+
path: `${path30}.properties`,
|
|
4763
4763
|
message: `properties must be an object, got ${Array.isArray(schema.properties) ? "array" : typeof schema.properties}`
|
|
4764
4764
|
});
|
|
4765
4765
|
} else {
|
|
4766
4766
|
for (const [propName, propSchema] of Object.entries(schema.properties)) {
|
|
4767
|
-
validateSchema(propSchema, `${
|
|
4767
|
+
validateSchema(propSchema, `${path30}.properties.${propName}`, errors, { depth: depth + 1 });
|
|
4768
4768
|
}
|
|
4769
4769
|
}
|
|
4770
4770
|
}
|
|
4771
4771
|
if (schemaTypeIncludes(schema, "array") && "items" in schema) {
|
|
4772
4772
|
if (Array.isArray(schema.items)) {
|
|
4773
|
-
schema.items.forEach((sub, i) => validateSchema(sub, `${
|
|
4773
|
+
schema.items.forEach((sub, i) => validateSchema(sub, `${path30}.items[${i}]`, errors, { depth: depth + 1 }));
|
|
4774
4774
|
} else {
|
|
4775
|
-
validateSchema(schema.items, `${
|
|
4775
|
+
validateSchema(schema.items, `${path30}.items`, errors, { depth: depth + 1 });
|
|
4776
4776
|
}
|
|
4777
4777
|
}
|
|
4778
4778
|
for (const key of SUBSCHEMA_OBJECT_KEYWORDS) {
|
|
4779
4779
|
if (key in schema && isRecord(schema[key])) {
|
|
4780
|
-
validateSchema(schema[key], `${
|
|
4780
|
+
validateSchema(schema[key], `${path30}.${key}`, errors, { depth: depth + 1 });
|
|
4781
4781
|
}
|
|
4782
4782
|
}
|
|
4783
4783
|
for (const key of SUBSCHEMA_LIST_KEYWORDS) {
|
|
4784
4784
|
const list = schema[key];
|
|
4785
4785
|
if (Array.isArray(list)) {
|
|
4786
|
-
list.forEach((sub, i) => validateSchema(sub, `${
|
|
4786
|
+
list.forEach((sub, i) => validateSchema(sub, `${path30}.${key}[${i}]`, errors, { depth: depth + 1 }));
|
|
4787
4787
|
}
|
|
4788
4788
|
}
|
|
4789
4789
|
for (const key of SUBSCHEMA_MAP_KEYWORDS) {
|
|
4790
4790
|
const map = schema[key];
|
|
4791
4791
|
if (isRecord(map)) {
|
|
4792
4792
|
for (const [name, sub] of Object.entries(map)) {
|
|
4793
|
-
validateSchema(sub, `${
|
|
4793
|
+
validateSchema(sub, `${path30}.${key}.${name}`, errors, { depth: depth + 1 });
|
|
4794
4794
|
}
|
|
4795
4795
|
}
|
|
4796
4796
|
}
|
|
4797
4797
|
const reportedPaths = new Set(errors.map((e) => e.path));
|
|
4798
4798
|
for (const [k, v] of Object.entries(schema)) {
|
|
4799
4799
|
if (typeof v !== "string") continue;
|
|
4800
|
-
const fieldPath = `${
|
|
4800
|
+
const fieldPath = `${path30}.${k}`;
|
|
4801
4801
|
if (reportedPaths.has(fieldPath)) continue;
|
|
4802
4802
|
for (const token of PLACEHOLDER_TOKENS) {
|
|
4803
4803
|
if (v === token) {
|
|
@@ -4942,8 +4942,8 @@ function evalInitialStateError(input) {
|
|
|
4942
4942
|
const parsed = evalInitialStateEntry.safeParse(entries[i]);
|
|
4943
4943
|
if (!parsed.success) {
|
|
4944
4944
|
const issue = parsed.error.issues[0];
|
|
4945
|
-
const
|
|
4946
|
-
return `initial_state[${i}].${
|
|
4945
|
+
const path30 = issue?.path.join(".") || "?";
|
|
4946
|
+
return `initial_state[${i}].${path30} is invalid: ${issue?.message ?? "malformed"}`;
|
|
4947
4947
|
}
|
|
4948
4948
|
if (seenSlugs.has(parsed.data.slug)) {
|
|
4949
4949
|
return `initial_state[${i}].slug "${parsed.data.slug}" is declared more than once`;
|
|
@@ -5131,10 +5131,10 @@ function refineHubAsCodeEvals(config, ctx) {
|
|
|
5131
5131
|
function refineHubAsCodeEvalAttachments(config, ctx) {
|
|
5132
5132
|
const cfg = config;
|
|
5133
5133
|
const referencedHashes = /* @__PURE__ */ new Set();
|
|
5134
|
-
const addTurnIssue = (
|
|
5134
|
+
const addTurnIssue = (path30, turn, name) => {
|
|
5135
5135
|
const error = evalTurnAttachmentsError(turn);
|
|
5136
5136
|
if (error) {
|
|
5137
|
-
ctx.addIssue({ code: external_exports.ZodIssueCode.custom, path:
|
|
5137
|
+
ctx.addIssue({ code: external_exports.ZodIssueCode.custom, path: path30, message: `${name}: ${error}` });
|
|
5138
5138
|
return;
|
|
5139
5139
|
}
|
|
5140
5140
|
for (const hash of collectTurnAttachmentHashes(turn)) referencedHashes.add(hash);
|
|
@@ -5280,11 +5280,11 @@ function refineHubAsCodeDelegation(config, ctx) {
|
|
|
5280
5280
|
}
|
|
5281
5281
|
}
|
|
5282
5282
|
if (del.context_boundary === void 0) return;
|
|
5283
|
-
const
|
|
5283
|
+
const path30 = ["agents", agentIndex, "tools", "delegation", delIndex, "context_boundary"];
|
|
5284
5284
|
if (del.type !== "hub") {
|
|
5285
5285
|
ctx.addIssue({
|
|
5286
5286
|
code: external_exports.ZodIssueCode.custom,
|
|
5287
|
-
path:
|
|
5287
|
+
path: path30,
|
|
5288
5288
|
message: `context_boundary applies only to \`type: hub\` delegations (got type "${String(del.type)}")`
|
|
5289
5289
|
});
|
|
5290
5290
|
return;
|
|
@@ -5292,52 +5292,14 @@ function refineHubAsCodeDelegation(config, ctx) {
|
|
|
5292
5292
|
if (!CONTEXT_BOUNDARIES.includes(del.context_boundary)) {
|
|
5293
5293
|
ctx.addIssue({
|
|
5294
5294
|
code: external_exports.ZodIssueCode.custom,
|
|
5295
|
-
path:
|
|
5295
|
+
path: path30,
|
|
5296
5296
|
message: `context_boundary must be one of: ${CONTEXT_BOUNDARIES.join(", ")}`
|
|
5297
5297
|
});
|
|
5298
5298
|
}
|
|
5299
5299
|
});
|
|
5300
5300
|
});
|
|
5301
5301
|
}
|
|
5302
|
-
function isSafeTemplatePath(path31) {
|
|
5303
|
-
if (path31.length === 0 || path31.length > 300) return false;
|
|
5304
|
-
if (path31.startsWith("/") || path31.includes("\\")) return false;
|
|
5305
|
-
const segments = path31.split("/");
|
|
5306
|
-
return segments.every(
|
|
5307
|
-
(seg) => seg.length > 0 && seg !== "." && seg !== ".." && /^[A-Za-z0-9._-]+$/.test(seg)
|
|
5308
|
-
);
|
|
5309
|
-
}
|
|
5310
|
-
function dropTemplateKeys(value, drop) {
|
|
5311
|
-
if (Array.isArray(value)) return value.map((v) => dropTemplateKeys(v, drop));
|
|
5312
|
-
if (isPlainObject(value)) {
|
|
5313
|
-
const out = {};
|
|
5314
|
-
for (const [key, child] of Object.entries(value)) {
|
|
5315
|
-
if (drop.has(key)) continue;
|
|
5316
|
-
out[key] = TEMPLATE_OPAQUE_BLOB_KEYS.has(key) ? child : dropTemplateKeys(child, drop);
|
|
5317
|
-
}
|
|
5318
|
-
return out;
|
|
5319
|
-
}
|
|
5320
|
-
return value;
|
|
5321
|
-
}
|
|
5322
|
-
function stripTemplateInstanceIds(value) {
|
|
5323
|
-
return dropTemplateKeys(value, TEMPLATE_INSTANCE_ID_KEYS);
|
|
5324
|
-
}
|
|
5325
|
-
function excludeTemplateAuthorData(value) {
|
|
5326
|
-
return dropTemplateKeys(value, TEMPLATE_AUTHOR_DATA_KEYS);
|
|
5327
|
-
}
|
|
5328
|
-
function isPlainObject(value) {
|
|
5329
|
-
if (value === null || typeof value !== "object") return false;
|
|
5330
|
-
const proto = Object.getPrototypeOf(value);
|
|
5331
|
-
return proto === Object.prototype || proto === null;
|
|
5332
|
-
}
|
|
5333
|
-
function isSanitizableSliceFile(path31) {
|
|
5334
|
-
if (!/\.ya?ml$/i.test(path31)) return false;
|
|
5335
|
-
return path31 !== "resources" && !path31.startsWith("resources/");
|
|
5336
|
-
}
|
|
5337
|
-
function distinctUsesBackends(uses) {
|
|
5338
|
-
return [...new Set((uses ?? []).map((u) => u.backend))];
|
|
5339
|
-
}
|
|
5340
|
-
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, previousConversationsCountField, summarizationThresholdField, monitorConfigField, 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, 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, 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, createOrgTagBody, updateOrgTagBody, orgCredentialIdParam, listOrgCredentialsQuery, createOrgCredentialBody, updateOrgCredentialBody, 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, EVAL_INPUT_ROLES, EVAL_INPUT_ROLE_LIST, ROLE_ECHO_MAX, EVAL_INITIAL_STATE_SCOPES, MAX_INITIAL_STATE_ENTRIES, evalInitialStateEntry, createEvalBody, updateEvalBody, 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, seedReleaseStatusSchema, EVAL_SESSION_NOT_QUIESCENT, getConversationsQuery, getMessagesQuery, appMessageSenderType, appMessageReceiverType, apiChannelMessage, apiChannelMessageBody, appMessageBody, appMessageResponse, 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, 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, adminPlanIdParam, adminOrganizationsQuery, adminUserSearchQuery, kanbanSlugMigrationQuery, adjustQuotaBody, updatePlanBody, addAdminUserBody, updatePlatformConfigBody, updateFreeOrgLimitBody, adminScopedTargetBody, 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, 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, discordTier, discordBillingCycle, discordMetadata, discordOAuthStartResponse, discordOAuthFinalizeBody, discordOAuthFinalizeResponse, discordDisconnectResponse, jsonSchemaSchema, hubUserIdentity, stateValueEntry, getHubUserContextResponse, updateHubUserBody, updateHubUserResponse, unlockHubUserNameResponse, stateResetParams, stateResetResponse, hubAlertsParam, hubAlertSeverity, hubAlert, hubAlertsListResponse, noticeSeveritySchema, noticeStatusSchema, NOTICE_SCOPE_REGEX, noticeScopeSchema, noticeLinkSchema, createNoticeBody, updateNoticeBody, listNoticesQuery, noticeIdParamSchema, templateLocaleSchema, TEMPLATE_SLUG_REGEX, templateSlugSchema, templateStatusSchema, templateFileMapSchema, TEMPLATE_INSTANCE_ID_KEYS, TEMPLATE_OPAQUE_BLOB_KEYS, TEMPLATE_AUTHOR_DATA_KEYS, templateTextSchema, templateUsesEntrySchema, templateUsesSchema, templateYamlLocaleEntry, templateYamlWayaiBlock, templateTagsSchema, templateYamlSchema, templateHeroSchema, templatePushLocaleSchema, templatePushBody, templateListQuery, templateSlugParam, templateDetailQuery, ADMIN_SKILL_NAME_REGEX, adminSkillNameParam;
|
|
5302
|
+
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, previousConversationsCountField, summarizationThresholdField, monitorConfigField, 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, 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, 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, createOrgTagBody, updateOrgTagBody, orgCredentialIdParam, listOrgCredentialsQuery, createOrgCredentialBody, updateOrgCredentialBody, 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, EVAL_INPUT_ROLES, EVAL_INPUT_ROLE_LIST, ROLE_ECHO_MAX, EVAL_INITIAL_STATE_SCOPES, MAX_INITIAL_STATE_ENTRIES, evalInitialStateEntry, createEvalBody, updateEvalBody, 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, seedReleaseStatusSchema, EVAL_SESSION_NOT_QUIESCENT, getConversationsQuery, getMessagesQuery, appMessageSenderType, appMessageReceiverType, apiChannelMessage, apiChannelMessageBody, appMessageBody, appMessageResponse, 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, 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, adminPlanIdParam, adminOrganizationsQuery, adminUserSearchQuery, kanbanSlugMigrationQuery, adjustQuotaBody, updatePlanBody, addAdminUserBody, updatePlatformConfigBody, updateFreeOrgLimitBody, adminScopedTargetBody, 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, 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;
|
|
5341
5303
|
var init_contracts = __esm({
|
|
5342
5304
|
"../../packages/core/dist/contracts/index.js"() {
|
|
5343
5305
|
"use strict";
|
|
@@ -5389,8 +5351,6 @@ var init_contracts = __esm({
|
|
|
5389
5351
|
init_zod();
|
|
5390
5352
|
init_zod();
|
|
5391
5353
|
init_zod();
|
|
5392
|
-
init_zod();
|
|
5393
|
-
init_zod();
|
|
5394
5354
|
uuidSchema = external_exports.string().uuid();
|
|
5395
5355
|
paginationSchema = external_exports.object({
|
|
5396
5356
|
limit: external_exports.coerce.number().int().min(1).max(100).default(50),
|
|
@@ -8428,35 +8388,6 @@ var init_contracts = __esm({
|
|
|
8428
8388
|
role: external_exports.enum(["org_admin", "admin", "team_user", "user"]),
|
|
8429
8389
|
expires_at: external_exports.string().datetime()
|
|
8430
8390
|
});
|
|
8431
|
-
discordTier = external_exports.enum(["free", "pro", "pro_plus"]);
|
|
8432
|
-
discordBillingCycle = external_exports.enum(["monthly", "annual"]);
|
|
8433
|
-
discordMetadata = external_exports.object({
|
|
8434
|
-
tier: discordTier,
|
|
8435
|
-
billing_cycle: discordBillingCycle,
|
|
8436
|
-
is_admin: external_exports.boolean()
|
|
8437
|
-
});
|
|
8438
|
-
discordOAuthStartResponse = external_exports.object({
|
|
8439
|
-
url: external_exports.string().url()
|
|
8440
|
-
});
|
|
8441
|
-
discordOAuthFinalizeBody = external_exports.object({
|
|
8442
|
-
code: external_exports.string().min(1, "code is required"),
|
|
8443
|
-
state: external_exports.string().min(1, "state is required")
|
|
8444
|
-
});
|
|
8445
|
-
discordOAuthFinalizeResponse = external_exports.discriminatedUnion("ok", [
|
|
8446
|
-
external_exports.object({
|
|
8447
|
-
ok: external_exports.literal(true),
|
|
8448
|
-
discord_user_id: external_exports.string(),
|
|
8449
|
-
metadata: discordMetadata
|
|
8450
|
-
}),
|
|
8451
|
-
external_exports.object({
|
|
8452
|
-
ok: external_exports.literal(false),
|
|
8453
|
-
push_error: external_exports.literal("discord_unreachable"),
|
|
8454
|
-
metadata: discordMetadata
|
|
8455
|
-
})
|
|
8456
|
-
]);
|
|
8457
|
-
discordDisconnectResponse = external_exports.object({
|
|
8458
|
-
ok: external_exports.literal(true)
|
|
8459
|
-
});
|
|
8460
8391
|
jsonSchemaSchema = external_exports.record(external_exports.unknown());
|
|
8461
8392
|
hubUserIdentity = external_exports.object({
|
|
8462
8393
|
user_id: external_exports.string().nullable(),
|
|
@@ -8566,135 +8497,6 @@ var init_contracts = __esm({
|
|
|
8566
8497
|
offset: external_exports.coerce.number().int().min(0).optional()
|
|
8567
8498
|
});
|
|
8568
8499
|
noticeIdParamSchema = external_exports.object({ id: external_exports.string().min(1) });
|
|
8569
|
-
templateLocaleSchema = external_exports.enum(SUPPORTED_LOCALES);
|
|
8570
|
-
TEMPLATE_SLUG_REGEX = /^[a-z0-9][a-z0-9-]{0,62}$/;
|
|
8571
|
-
templateSlugSchema = external_exports.string().regex(TEMPLATE_SLUG_REGEX, "slug must be lowercase alphanumeric with hyphens (max 63)");
|
|
8572
|
-
templateStatusSchema = external_exports.enum(["published", "draft", "internal"]);
|
|
8573
|
-
templateFileMapSchema = external_exports.record(external_exports.string()).refine((m) => Object.keys(m).every(isSafeTemplatePath), {
|
|
8574
|
-
message: 'file map contains an unsafe path (no absolute paths, "..", or backslashes)'
|
|
8575
|
-
});
|
|
8576
|
-
TEMPLATE_INSTANCE_ID_KEYS = /* @__PURE__ */ new Set([
|
|
8577
|
-
// Top-level hub instance metadata (hub.yaml) — set by `wayai pull`, never authored.
|
|
8578
|
-
"hub_id",
|
|
8579
|
-
"hub_environment",
|
|
8580
|
-
"preview_label",
|
|
8581
|
-
"branch_name",
|
|
8582
|
-
// Per-entity row id + cross-entity reference UUIDs (each has a portable name twin).
|
|
8583
|
-
"id",
|
|
8584
|
-
"connection_id",
|
|
8585
|
-
"target_id",
|
|
8586
|
-
"agent_id",
|
|
8587
|
-
"resource_id",
|
|
8588
|
-
"list_id",
|
|
8589
|
-
// Account-scoped Meta WhatsApp template id (name twin: `template_whatsapp`).
|
|
8590
|
-
"template_whatsapp_id"
|
|
8591
|
-
]);
|
|
8592
|
-
TEMPLATE_OPAQUE_BLOB_KEYS = /* @__PURE__ */ new Set([
|
|
8593
|
-
"settings",
|
|
8594
|
-
// agent + connection connector settings
|
|
8595
|
-
"schema_json",
|
|
8596
|
-
// agent response_format JSON Schema
|
|
8597
|
-
"json_schema",
|
|
8598
|
-
// state JSON Schema
|
|
8599
|
-
"initial_value",
|
|
8600
|
-
// state seed value
|
|
8601
|
-
"additional_context_schema",
|
|
8602
|
-
// kanban-status transition-form schema
|
|
8603
|
-
"config",
|
|
8604
|
-
// custom-tool OpenAI function schema
|
|
8605
|
-
"headers",
|
|
8606
|
-
"query_params",
|
|
8607
|
-
"body_params",
|
|
8608
|
-
// custom-tool HTTP shaping
|
|
8609
|
-
"mappings",
|
|
8610
|
-
// composed-tool argument mappings
|
|
8611
|
-
"input",
|
|
8612
|
-
"expected",
|
|
8613
|
-
"history",
|
|
8614
|
-
// eval message fixtures (tool_calls carry their own `id`)
|
|
8615
|
-
"transcript",
|
|
8616
|
-
"step_config"
|
|
8617
|
-
// journey fixtures (transcript carries `step_id`; step_config is keyed by it)
|
|
8618
|
-
]);
|
|
8619
|
-
TEMPLATE_AUTHOR_DATA_KEYS = /* @__PURE__ */ new Set([
|
|
8620
|
-
// Outbound campaign subsystem (hub.yaml top-level). `outbound_contacts` is the
|
|
8621
|
-
// author's real leads — `phone`/`email`/`instagram_sid` + the required `name` are
|
|
8622
|
-
// GDPR-grade PII. `outbound_lists` group those contacts by real name. `outbound_schedules`
|
|
8623
|
-
// bind to the (now-absent) lists and carry the author's campaign cadence + message
|
|
8624
|
-
// copy — operationally tied to the author's customers; a consumer builds their own.
|
|
8625
|
-
"outbound_contacts",
|
|
8626
|
-
"outbound_lists",
|
|
8627
|
-
"outbound_schedules",
|
|
8628
|
-
// Account-scoped channel identifier on a connection (Twilio SID / WhatsApp number /
|
|
8629
|
-
// IG username / from-email, per connector). The connection stays as portable
|
|
8630
|
-
// structure re-bound by name on push; this author-account value carries no blueprint
|
|
8631
|
-
// value. A dedicated top-level column — never nested in the `settings` opaque blob.
|
|
8632
|
-
"account_sid"
|
|
8633
|
-
]);
|
|
8634
|
-
templateTextSchema = external_exports.object({
|
|
8635
|
-
metaTitle: external_exports.string().min(1).max(200),
|
|
8636
|
-
metaDescription: external_exports.string().max(1e3).default("")
|
|
8637
|
-
});
|
|
8638
|
-
templateUsesEntrySchema = external_exports.object({
|
|
8639
|
-
backend: templateSlugSchema,
|
|
8640
|
-
endpoint: templateSlugSchema
|
|
8641
|
-
});
|
|
8642
|
-
templateUsesSchema = external_exports.array(templateUsesEntrySchema).max(24).default([]);
|
|
8643
|
-
templateYamlLocaleEntry = templateTextSchema.extend({ source: external_exports.string().min(1) });
|
|
8644
|
-
templateYamlWayaiBlock = external_exports.object({
|
|
8645
|
-
installCommand: external_exports.string().min(1).max(300),
|
|
8646
|
-
locales: external_exports.record(templateLocaleSchema, templateYamlLocaleEntry)
|
|
8647
|
-
});
|
|
8648
|
-
templateTagsSchema = external_exports.array(external_exports.string().min(1).max(30)).max(12).default([]).transform((tags) => [...new Set(tags.map((t) => t.trim().toLowerCase()).filter(Boolean))]);
|
|
8649
|
-
templateYamlSchema = external_exports.object({
|
|
8650
|
-
slug: templateSlugSchema,
|
|
8651
|
-
category: external_exports.string().min(1).max(60),
|
|
8652
|
-
tags: templateTagsSchema,
|
|
8653
|
-
status: templateStatusSchema.default("draft"),
|
|
8654
|
-
order: external_exports.number().int().min(0).max(1e5).optional(),
|
|
8655
|
-
defaultLocale: templateLocaleSchema,
|
|
8656
|
-
hero: external_exports.string().optional(),
|
|
8657
|
-
// relative path to a hero image inside the template folder
|
|
8658
|
-
// The Rekor backend(s) this channel runs on (gh #2955). Locale-agnostic. The
|
|
8659
|
-
// cross-link + MCP endpoint are derived from each entry's slugs, never authored.
|
|
8660
|
-
uses: templateUsesSchema,
|
|
8661
|
-
// A WayAI template IS a WayAI channel — the wayai slice is required. (The old
|
|
8662
|
-
// Rekor-only store entry is gone: a pure Rekor backend lives only in Rekor's store.)
|
|
8663
|
-
wayai: templateYamlWayaiBlock
|
|
8664
|
-
}).refine((c) => Boolean(c.wayai.locales[c.defaultLocale]), {
|
|
8665
|
-
message: "`wayai.locales` must include the defaultLocale"
|
|
8666
|
-
});
|
|
8667
|
-
templateHeroSchema = external_exports.object({
|
|
8668
|
-
filename: external_exports.string().min(1).max(200).regex(/\.(png|jpe?g|webp|gif)$/i, "hero must be a raster image (png/jpg/webp/gif)"),
|
|
8669
|
-
dataBase64: external_exports.string().min(1).max(8e6)
|
|
8670
|
-
});
|
|
8671
|
-
templatePushLocaleSchema = external_exports.object({
|
|
8672
|
-
wayai: templateTextSchema.optional(),
|
|
8673
|
-
readmeMarkdown: external_exports.string().default(""),
|
|
8674
|
-
wayaiFiles: templateFileMapSchema.optional()
|
|
8675
|
-
});
|
|
8676
|
-
templatePushBody = external_exports.object({
|
|
8677
|
-
slug: templateSlugSchema,
|
|
8678
|
-
defaultLocale: templateLocaleSchema,
|
|
8679
|
-
common: external_exports.object({
|
|
8680
|
-
category: external_exports.string().min(1).max(60),
|
|
8681
|
-
tags: templateTagsSchema,
|
|
8682
|
-
status: templateStatusSchema,
|
|
8683
|
-
order: external_exports.number().int().min(0).max(1e5).default(0),
|
|
8684
|
-
// The WayAI install command (a WayAI template always has a wayai side). Kept
|
|
8685
|
-
// optional on the wire so a malformed manifest 400s on the field, not the body.
|
|
8686
|
-
installCommand: external_exports.string().min(1).max(300).optional(),
|
|
8687
|
-
hero: templateHeroSchema.optional(),
|
|
8688
|
-
// The channel→backend edge (gh #2955), locale-agnostic.
|
|
8689
|
-
uses: templateUsesSchema
|
|
8690
|
-
}),
|
|
8691
|
-
locales: external_exports.record(templateLocaleSchema, templatePushLocaleSchema)
|
|
8692
|
-
}).refine((b) => Boolean(b.locales[b.defaultLocale]), {
|
|
8693
|
-
message: "`locales` must include the defaultLocale"
|
|
8694
|
-
});
|
|
8695
|
-
templateListQuery = external_exports.object({ locale: templateLocaleSchema.optional() });
|
|
8696
|
-
templateSlugParam = external_exports.object({ slug: templateSlugSchema });
|
|
8697
|
-
templateDetailQuery = external_exports.object({ locale: templateLocaleSchema.optional() });
|
|
8698
8500
|
ADMIN_SKILL_NAME_REGEX = /^[a-z0-9][a-z0-9-]{0,63}$/;
|
|
8699
8501
|
adminSkillNameParam = external_exports.object({
|
|
8700
8502
|
name: external_exports.string().regex(ADMIN_SKILL_NAME_REGEX, "invalid skill name")
|
|
@@ -8724,13 +8526,13 @@ var init_api_client = __esm({
|
|
|
8724
8526
|
init_sentry();
|
|
8725
8527
|
init_mask_secrets();
|
|
8726
8528
|
RETRYABLE_BACKOFF_MS = [500, 1e3, 2e3];
|
|
8727
|
-
delay = (ms) => new Promise((
|
|
8529
|
+
delay = (ms) => new Promise((resolve5) => setTimeout(resolve5, ms));
|
|
8728
8530
|
ApiError = class extends Error {
|
|
8729
8531
|
status;
|
|
8730
8532
|
body;
|
|
8731
|
-
constructor(method,
|
|
8533
|
+
constructor(method, path30, status, body) {
|
|
8732
8534
|
const safeBody = maskSecretsInMessage(body);
|
|
8733
|
-
super(`API request failed: ${method} ${
|
|
8535
|
+
super(`API request failed: ${method} ${path30} (${status}): ${safeBody}`);
|
|
8734
8536
|
this.name = "ApiError";
|
|
8735
8537
|
this.status = status;
|
|
8736
8538
|
this.body = safeBody;
|
|
@@ -8787,25 +8589,6 @@ var init_api_client = __esm({
|
|
|
8787
8589
|
commit_sha: commitSha
|
|
8788
8590
|
});
|
|
8789
8591
|
}
|
|
8790
|
-
// --- Templates gallery ---
|
|
8791
|
-
// Consumer (any authed user): list the joint template set + pull the wayai slice.
|
|
8792
|
-
// `locale` is optional — the server resolves to each template's defaultLocale when
|
|
8793
|
-
// omitted, and falls back to it (with a resolvedLocale signal) when unauthored.
|
|
8794
|
-
async templateList(locale) {
|
|
8795
|
-
const qs = locale ? `?${new URLSearchParams({ locale })}` : "";
|
|
8796
|
-
return this.request("GET", `/api/ci/templates${qs}`);
|
|
8797
|
-
}
|
|
8798
|
-
async templatePull(slug, locale) {
|
|
8799
|
-
const qs = locale ? `?${new URLSearchParams({ locale })}` : "";
|
|
8800
|
-
return this.request("GET", `/api/ci/templates/${encodeURIComponent(slug)}${qs}`);
|
|
8801
|
-
}
|
|
8802
|
-
// Author (platform-admin): push a template into the store / pull it for inspection.
|
|
8803
|
-
async adminTemplatePush(body) {
|
|
8804
|
-
return this.request("POST", "/api/admin/templates/push", body);
|
|
8805
|
-
}
|
|
8806
|
-
async adminTemplatePull(slug) {
|
|
8807
|
-
return this.request("GET", `/api/admin/templates/${encodeURIComponent(slug)}`);
|
|
8808
|
-
}
|
|
8809
8592
|
// Download a private operator skill (platform-admin gated) for local install.
|
|
8810
8593
|
async adminSkillInstall(name) {
|
|
8811
8594
|
return this.request("GET", `/api/admin/skills/${encodeURIComponent(name)}`);
|
|
@@ -8848,8 +8631,8 @@ var init_api_client = __esm({
|
|
|
8848
8631
|
...opts?.check && { check: true }
|
|
8849
8632
|
});
|
|
8850
8633
|
}
|
|
8851
|
-
async lookup(
|
|
8852
|
-
const params = new URLSearchParams({ path:
|
|
8634
|
+
async lookup(path30, opts) {
|
|
8635
|
+
const params = new URLSearchParams({ path: path30 });
|
|
8853
8636
|
if (opts?.organizationId) params.set("organization_id", opts.organizationId);
|
|
8854
8637
|
return this.request("GET", `/api/ci/lookup?${params.toString()}`);
|
|
8855
8638
|
}
|
|
@@ -9270,9 +9053,9 @@ var init_api_client = __esm({
|
|
|
9270
9053
|
* sandbox for this conversation, or the blob was purged).
|
|
9271
9054
|
*/
|
|
9272
9055
|
async downloadArchiveSandboxFs(hubId, conversationId) {
|
|
9273
|
-
const
|
|
9274
|
-
addApiBreadcrumb("GET",
|
|
9275
|
-
const url = `${this.apiUrl}${
|
|
9056
|
+
const path30 = `/api/archive/${encodeURIComponent(hubId)}/conversations/${encodeURIComponent(conversationId)}/sandbox`;
|
|
9057
|
+
addApiBreadcrumb("GET", path30);
|
|
9058
|
+
const url = `${this.apiUrl}${path30}`;
|
|
9276
9059
|
let response = await this.send(url, "GET");
|
|
9277
9060
|
if (response.status === 401 && this.onUnauthorized) {
|
|
9278
9061
|
let refreshed;
|
|
@@ -9286,7 +9069,7 @@ var init_api_client = __esm({
|
|
|
9286
9069
|
}
|
|
9287
9070
|
}
|
|
9288
9071
|
if (!response.ok) {
|
|
9289
|
-
throw new ApiError("GET",
|
|
9072
|
+
throw new ApiError("GET", path30, response.status, await response.text());
|
|
9290
9073
|
}
|
|
9291
9074
|
return new Uint8Array(await response.arrayBuffer());
|
|
9292
9075
|
}
|
|
@@ -9326,9 +9109,9 @@ var init_api_client = __esm({
|
|
|
9326
9109
|
`/api/admin/data-explorer/debug/observability/${encodeURIComponent(hubId)}/conversations/${encodeURIComponent(conversationId)}${qs}`
|
|
9327
9110
|
);
|
|
9328
9111
|
}
|
|
9329
|
-
async request(method,
|
|
9330
|
-
addApiBreadcrumb(method,
|
|
9331
|
-
const url = `${this.apiUrl}${
|
|
9112
|
+
async request(method, path30, body) {
|
|
9113
|
+
addApiBreadcrumb(method, path30);
|
|
9114
|
+
const url = `${this.apiUrl}${path30}`;
|
|
9332
9115
|
let refreshedOn401 = false;
|
|
9333
9116
|
for (let retry = 0; ; retry++) {
|
|
9334
9117
|
let response = await this.send(url, method, body);
|
|
@@ -9352,7 +9135,7 @@ var init_api_client = __esm({
|
|
|
9352
9135
|
await delay(RETRYABLE_BACKOFF_MS[retry]);
|
|
9353
9136
|
continue;
|
|
9354
9137
|
}
|
|
9355
|
-
throw new ApiError(method,
|
|
9138
|
+
throw new ApiError(method, path30, response.status, errorBody);
|
|
9356
9139
|
}
|
|
9357
9140
|
}
|
|
9358
9141
|
/** Issue a single authenticated request with the client's current token. */
|
|
@@ -9527,12 +9310,12 @@ function typeMatches2(typeField, allowed) {
|
|
|
9527
9310
|
if (Array.isArray(typeField)) return typeField.every((t) => typeof t === "string" && allowed.has(t));
|
|
9528
9311
|
return false;
|
|
9529
9312
|
}
|
|
9530
|
-
function validateSchema2(schema,
|
|
9313
|
+
function validateSchema2(schema, path30, errors, opts = {}) {
|
|
9531
9314
|
if (typeof schema === "boolean") return;
|
|
9532
9315
|
const depth = opts.depth ?? 0;
|
|
9533
9316
|
if (depth > MAX_SCHEMA_DEPTH2) {
|
|
9534
9317
|
errors.push({
|
|
9535
|
-
path:
|
|
9318
|
+
path: path30 || "<root>",
|
|
9536
9319
|
message: `schema nesting exceeds ${MAX_SCHEMA_DEPTH2} levels`,
|
|
9537
9320
|
suggestion: "Flatten the schema; LLM providers reject deeply nested tool input_schemas."
|
|
9538
9321
|
});
|
|
@@ -9540,7 +9323,7 @@ function validateSchema2(schema, path31, errors, opts = {}) {
|
|
|
9540
9323
|
}
|
|
9541
9324
|
if (!isRecord2(schema)) {
|
|
9542
9325
|
errors.push({
|
|
9543
|
-
path:
|
|
9326
|
+
path: path30,
|
|
9544
9327
|
message: `expected object, got ${schema === null ? "null" : typeof schema}`
|
|
9545
9328
|
});
|
|
9546
9329
|
return;
|
|
@@ -9548,14 +9331,14 @@ function validateSchema2(schema, path31, errors, opts = {}) {
|
|
|
9548
9331
|
if (opts.isRoot) {
|
|
9549
9332
|
if ("type" in schema && schema.type !== "object") {
|
|
9550
9333
|
errors.push({
|
|
9551
|
-
path:
|
|
9334
|
+
path: path30 ? `${path30}.type` : "type",
|
|
9552
9335
|
message: `root type must be 'object', got ${JSON.stringify(schema.type)}`,
|
|
9553
9336
|
suggestion: "Tool parameters at the root must be an object: `{ type: 'object', properties: { ... } }`."
|
|
9554
9337
|
});
|
|
9555
9338
|
}
|
|
9556
9339
|
} else if ("type" in schema && !typeMatches2(schema.type, ALLOWED_TYPES2)) {
|
|
9557
9340
|
errors.push({
|
|
9558
|
-
path: `${
|
|
9341
|
+
path: `${path30}.type`,
|
|
9559
9342
|
message: `type must be one of ${[...ALLOWED_TYPES2].join("/")} or an array of those, got ${JSON.stringify(schema.type)}`
|
|
9560
9343
|
});
|
|
9561
9344
|
}
|
|
@@ -9565,25 +9348,25 @@ function validateSchema2(schema, path31, errors, opts = {}) {
|
|
|
9565
9348
|
const isPlaceholder = PLACEHOLDER_TOKENS2.includes(e);
|
|
9566
9349
|
const isOutcomePlaceholder = e === "[KANBAN_OUTCOME_VALUES]";
|
|
9567
9350
|
errors.push({
|
|
9568
|
-
path: `${
|
|
9351
|
+
path: `${path30}.enum`,
|
|
9569
9352
|
message: `enum must be a non-empty array of primitives, got string ${JSON.stringify(e)}`,
|
|
9570
9353
|
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"]`.'
|
|
9571
9354
|
});
|
|
9572
9355
|
} else if (!Array.isArray(e)) {
|
|
9573
9356
|
errors.push({
|
|
9574
|
-
path: `${
|
|
9357
|
+
path: `${path30}.enum`,
|
|
9575
9358
|
message: `enum must be a non-empty array of primitives, got ${typeof e}`
|
|
9576
9359
|
});
|
|
9577
9360
|
} else if (e.length === 0) {
|
|
9578
9361
|
errors.push({
|
|
9579
|
-
path: `${
|
|
9362
|
+
path: `${path30}.enum`,
|
|
9580
9363
|
message: "enum must not be empty"
|
|
9581
9364
|
});
|
|
9582
9365
|
} else {
|
|
9583
9366
|
for (let i = 0; i < e.length; i++) {
|
|
9584
9367
|
if (!isPrimitive2(e[i])) {
|
|
9585
9368
|
errors.push({
|
|
9586
|
-
path: `${
|
|
9369
|
+
path: `${path30}.enum[${i}]`,
|
|
9587
9370
|
message: `enum entry must be a primitive (string/number/boolean/null), got ${typeof e[i]}`
|
|
9588
9371
|
});
|
|
9589
9372
|
}
|
|
@@ -9593,7 +9376,7 @@ function validateSchema2(schema, path31, errors, opts = {}) {
|
|
|
9593
9376
|
for (const key of ["exclusiveMinimum", "exclusiveMaximum"]) {
|
|
9594
9377
|
if (key in schema && typeof schema[key] === "boolean") {
|
|
9595
9378
|
errors.push({
|
|
9596
|
-
path: `${
|
|
9379
|
+
path: `${path30}.${key}`,
|
|
9597
9380
|
message: `${key} as boolean is draft-04 syntax; draft 2020-12 requires a numeric value`,
|
|
9598
9381
|
suggestion: `Replace with the numeric bound, e.g. \`${key}: 0\`.`
|
|
9599
9382
|
});
|
|
@@ -9602,45 +9385,45 @@ function validateSchema2(schema, path31, errors, opts = {}) {
|
|
|
9602
9385
|
if ("properties" in schema) {
|
|
9603
9386
|
if (!isRecord2(schema.properties)) {
|
|
9604
9387
|
errors.push({
|
|
9605
|
-
path: `${
|
|
9388
|
+
path: `${path30}.properties`,
|
|
9606
9389
|
message: `properties must be an object, got ${Array.isArray(schema.properties) ? "array" : typeof schema.properties}`
|
|
9607
9390
|
});
|
|
9608
9391
|
} else {
|
|
9609
9392
|
for (const [propName, propSchema] of Object.entries(schema.properties)) {
|
|
9610
|
-
validateSchema2(propSchema, `${
|
|
9393
|
+
validateSchema2(propSchema, `${path30}.properties.${propName}`, errors, { depth: depth + 1 });
|
|
9611
9394
|
}
|
|
9612
9395
|
}
|
|
9613
9396
|
}
|
|
9614
9397
|
if (schemaTypeIncludes2(schema, "array") && "items" in schema) {
|
|
9615
9398
|
if (Array.isArray(schema.items)) {
|
|
9616
|
-
schema.items.forEach((sub, i) => validateSchema2(sub, `${
|
|
9399
|
+
schema.items.forEach((sub, i) => validateSchema2(sub, `${path30}.items[${i}]`, errors, { depth: depth + 1 }));
|
|
9617
9400
|
} else {
|
|
9618
|
-
validateSchema2(schema.items, `${
|
|
9401
|
+
validateSchema2(schema.items, `${path30}.items`, errors, { depth: depth + 1 });
|
|
9619
9402
|
}
|
|
9620
9403
|
}
|
|
9621
9404
|
for (const key of SUBSCHEMA_OBJECT_KEYWORDS2) {
|
|
9622
9405
|
if (key in schema && isRecord2(schema[key])) {
|
|
9623
|
-
validateSchema2(schema[key], `${
|
|
9406
|
+
validateSchema2(schema[key], `${path30}.${key}`, errors, { depth: depth + 1 });
|
|
9624
9407
|
}
|
|
9625
9408
|
}
|
|
9626
9409
|
for (const key of SUBSCHEMA_LIST_KEYWORDS2) {
|
|
9627
9410
|
const list = schema[key];
|
|
9628
9411
|
if (Array.isArray(list)) {
|
|
9629
|
-
list.forEach((sub, i) => validateSchema2(sub, `${
|
|
9412
|
+
list.forEach((sub, i) => validateSchema2(sub, `${path30}.${key}[${i}]`, errors, { depth: depth + 1 }));
|
|
9630
9413
|
}
|
|
9631
9414
|
}
|
|
9632
9415
|
for (const key of SUBSCHEMA_MAP_KEYWORDS2) {
|
|
9633
9416
|
const map = schema[key];
|
|
9634
9417
|
if (isRecord2(map)) {
|
|
9635
9418
|
for (const [name, sub] of Object.entries(map)) {
|
|
9636
|
-
validateSchema2(sub, `${
|
|
9419
|
+
validateSchema2(sub, `${path30}.${key}.${name}`, errors, { depth: depth + 1 });
|
|
9637
9420
|
}
|
|
9638
9421
|
}
|
|
9639
9422
|
}
|
|
9640
9423
|
const reportedPaths = new Set(errors.map((e) => e.path));
|
|
9641
9424
|
for (const [k, v] of Object.entries(schema)) {
|
|
9642
9425
|
if (typeof v !== "string") continue;
|
|
9643
|
-
const fieldPath = `${
|
|
9426
|
+
const fieldPath = `${path30}.${k}`;
|
|
9644
9427
|
if (reportedPaths.has(fieldPath)) continue;
|
|
9645
9428
|
for (const token of PLACEHOLDER_TOKENS2) {
|
|
9646
9429
|
if (v === token) {
|
|
@@ -9785,8 +9568,8 @@ function evalInitialStateError2(input) {
|
|
|
9785
9568
|
const parsed = evalInitialStateEntry2.safeParse(entries[i]);
|
|
9786
9569
|
if (!parsed.success) {
|
|
9787
9570
|
const issue = parsed.error.issues[0];
|
|
9788
|
-
const
|
|
9789
|
-
return `initial_state[${i}].${
|
|
9571
|
+
const path30 = issue?.path.join(".") || "?";
|
|
9572
|
+
return `initial_state[${i}].${path30} is invalid: ${issue?.message ?? "malformed"}`;
|
|
9790
9573
|
}
|
|
9791
9574
|
if (seenSlugs.has(parsed.data.slug)) {
|
|
9792
9575
|
return `initial_state[${i}].slug "${parsed.data.slug}" is declared more than once`;
|
|
@@ -9991,10 +9774,10 @@ function refineHubAsCodeEvals2(config, ctx) {
|
|
|
9991
9774
|
function refineHubAsCodeEvalAttachments2(config, ctx) {
|
|
9992
9775
|
const cfg = config;
|
|
9993
9776
|
const referencedHashes = /* @__PURE__ */ new Set();
|
|
9994
|
-
const addTurnIssue = (
|
|
9777
|
+
const addTurnIssue = (path30, turn, name) => {
|
|
9995
9778
|
const error = evalTurnAttachmentsError2(turn);
|
|
9996
9779
|
if (error) {
|
|
9997
|
-
ctx.addIssue({ code: external_exports.ZodIssueCode.custom, path:
|
|
9780
|
+
ctx.addIssue({ code: external_exports.ZodIssueCode.custom, path: path30, message: `${name}: ${error}` });
|
|
9998
9781
|
return;
|
|
9999
9782
|
}
|
|
10000
9783
|
for (const hash of collectTurnAttachmentHashes2(turn)) referencedHashes.add(hash);
|
|
@@ -10140,11 +9923,11 @@ function refineHubAsCodeDelegation2(config, ctx) {
|
|
|
10140
9923
|
}
|
|
10141
9924
|
}
|
|
10142
9925
|
if (del.context_boundary === void 0) return;
|
|
10143
|
-
const
|
|
9926
|
+
const path30 = ["agents", agentIndex, "tools", "delegation", delIndex, "context_boundary"];
|
|
10144
9927
|
if (del.type !== "hub") {
|
|
10145
9928
|
ctx.addIssue({
|
|
10146
9929
|
code: external_exports.ZodIssueCode.custom,
|
|
10147
|
-
path:
|
|
9930
|
+
path: path30,
|
|
10148
9931
|
message: `context_boundary applies only to \`type: hub\` delegations (got type "${String(del.type)}")`
|
|
10149
9932
|
});
|
|
10150
9933
|
return;
|
|
@@ -10152,21 +9935,13 @@ function refineHubAsCodeDelegation2(config, ctx) {
|
|
|
10152
9935
|
if (!CONTEXT_BOUNDARIES2.includes(del.context_boundary)) {
|
|
10153
9936
|
ctx.addIssue({
|
|
10154
9937
|
code: external_exports.ZodIssueCode.custom,
|
|
10155
|
-
path:
|
|
9938
|
+
path: path30,
|
|
10156
9939
|
message: `context_boundary must be one of: ${CONTEXT_BOUNDARIES2.join(", ")}`
|
|
10157
9940
|
});
|
|
10158
9941
|
}
|
|
10159
9942
|
});
|
|
10160
9943
|
});
|
|
10161
9944
|
}
|
|
10162
|
-
function isSafeTemplatePath2(path31) {
|
|
10163
|
-
if (path31.length === 0 || path31.length > 300) return false;
|
|
10164
|
-
if (path31.startsWith("/") || path31.includes("\\")) return false;
|
|
10165
|
-
const segments = path31.split("/");
|
|
10166
|
-
return segments.every(
|
|
10167
|
-
(seg) => seg.length > 0 && seg !== "." && seg !== ".." && /^[A-Za-z0-9._-]+$/.test(seg)
|
|
10168
|
-
);
|
|
10169
|
-
}
|
|
10170
9945
|
function identifyTokenType(token) {
|
|
10171
9946
|
if (token.startsWith("way_")) return "way_token";
|
|
10172
9947
|
if (token.startsWith("eyJ")) return "jwt";
|
|
@@ -10206,7 +9981,7 @@ function findStepBoundaries(transcript) {
|
|
|
10206
9981
|
}
|
|
10207
9982
|
return out;
|
|
10208
9983
|
}
|
|
10209
|
-
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, 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, previousConversationsCountField2, summarizationThresholdField2, monitorConfigField2, 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, 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, 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, createOrgTagBody2, updateOrgTagBody2, orgCredentialIdParam2, listOrgCredentialsQuery2, createOrgCredentialBody2, updateOrgCredentialBody2, 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, EVAL_INPUT_ROLES2, EVAL_INPUT_ROLE_LIST2, ROLE_ECHO_MAX2, EVAL_INITIAL_STATE_SCOPES2, MAX_INITIAL_STATE_ENTRIES2, evalInitialStateEntry2, createEvalBody2, updateEvalBody2, 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, seedReleaseStatusSchema2, getConversationsQuery2, getMessagesQuery2, appMessageSenderType2, appMessageReceiverType2, apiChannelMessage2, apiChannelMessageBody2, appMessageBody2, appMessageResponse2, 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, 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, adminPlanIdParam2, adminOrganizationsQuery2, adminUserSearchQuery2, kanbanSlugMigrationQuery2, adjustQuotaBody2, updatePlanBody2, addAdminUserBody2, updatePlatformConfigBody2, updateFreeOrgLimitBody2, adminScopedTargetBody2, 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, 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, discordTier2, discordBillingCycle2, discordMetadata2, discordOAuthStartResponse2, discordOAuthFinalizeBody2, discordOAuthFinalizeResponse2, discordDisconnectResponse2, jsonSchemaSchema2, hubUserIdentity2, stateValueEntry2, getHubUserContextResponse2, updateHubUserBody2, updateHubUserResponse2, unlockHubUserNameResponse2, stateResetParams2, stateResetResponse2, hubAlertsParam2, hubAlertSeverity2, hubAlert2, hubAlertsListResponse2, noticeSeveritySchema2, noticeStatusSchema2, NOTICE_SCOPE_REGEX2, noticeScopeSchema2, noticeLinkSchema2, createNoticeBody2, updateNoticeBody2, listNoticesQuery2, noticeIdParamSchema2, templateLocaleSchema2, TEMPLATE_SLUG_REGEX2, templateSlugSchema2, templateStatusSchema2, templateFileMapSchema2, templateTextSchema2, templateUsesEntrySchema2, templateUsesSchema2, templateYamlLocaleEntry2, templateYamlWayaiBlock2, templateTagsSchema2, templateYamlSchema2, templateHeroSchema2, templatePushLocaleSchema2, templatePushBody2, templateListQuery2, templateSlugParam2, templateDetailQuery2, ADMIN_SKILL_NAME_REGEX2, adminSkillNameParam2, WAYAI_WORKSPACE_LAYOUT;
|
|
9984
|
+
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, 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, previousConversationsCountField2, summarizationThresholdField2, monitorConfigField2, 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, 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, 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, createOrgTagBody2, updateOrgTagBody2, orgCredentialIdParam2, listOrgCredentialsQuery2, createOrgCredentialBody2, updateOrgCredentialBody2, 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, EVAL_INPUT_ROLES2, EVAL_INPUT_ROLE_LIST2, ROLE_ECHO_MAX2, EVAL_INITIAL_STATE_SCOPES2, MAX_INITIAL_STATE_ENTRIES2, evalInitialStateEntry2, createEvalBody2, updateEvalBody2, 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, seedReleaseStatusSchema2, getConversationsQuery2, getMessagesQuery2, appMessageSenderType2, appMessageReceiverType2, apiChannelMessage2, apiChannelMessageBody2, appMessageBody2, appMessageResponse2, 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, 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, adminPlanIdParam2, adminOrganizationsQuery2, adminUserSearchQuery2, kanbanSlugMigrationQuery2, adjustQuotaBody2, updatePlanBody2, addAdminUserBody2, updatePlatformConfigBody2, updateFreeOrgLimitBody2, adminScopedTargetBody2, 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, 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, WAYAI_WORKSPACE_LAYOUT;
|
|
10210
9985
|
var init_dist = __esm({
|
|
10211
9986
|
"../../packages/core/dist/index.js"() {
|
|
10212
9987
|
"use strict";
|
|
@@ -10258,8 +10033,6 @@ var init_dist = __esm({
|
|
|
10258
10033
|
init_zod();
|
|
10259
10034
|
init_zod();
|
|
10260
10035
|
init_zod();
|
|
10261
|
-
init_zod();
|
|
10262
|
-
init_zod();
|
|
10263
10036
|
UUID_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
10264
10037
|
HEX_RE = /^[0-9a-f]{16,}$/;
|
|
10265
10038
|
WORKOS_ID_RE = /^(?:user|org)_[0-9A-HJKMNP-TV-Z]{26}$/;
|
|
@@ -13453,35 +13226,6 @@ var init_dist = __esm({
|
|
|
13453
13226
|
role: external_exports.enum(["org_admin", "admin", "team_user", "user"]),
|
|
13454
13227
|
expires_at: external_exports.string().datetime()
|
|
13455
13228
|
});
|
|
13456
|
-
discordTier2 = external_exports.enum(["free", "pro", "pro_plus"]);
|
|
13457
|
-
discordBillingCycle2 = external_exports.enum(["monthly", "annual"]);
|
|
13458
|
-
discordMetadata2 = external_exports.object({
|
|
13459
|
-
tier: discordTier2,
|
|
13460
|
-
billing_cycle: discordBillingCycle2,
|
|
13461
|
-
is_admin: external_exports.boolean()
|
|
13462
|
-
});
|
|
13463
|
-
discordOAuthStartResponse2 = external_exports.object({
|
|
13464
|
-
url: external_exports.string().url()
|
|
13465
|
-
});
|
|
13466
|
-
discordOAuthFinalizeBody2 = external_exports.object({
|
|
13467
|
-
code: external_exports.string().min(1, "code is required"),
|
|
13468
|
-
state: external_exports.string().min(1, "state is required")
|
|
13469
|
-
});
|
|
13470
|
-
discordOAuthFinalizeResponse2 = external_exports.discriminatedUnion("ok", [
|
|
13471
|
-
external_exports.object({
|
|
13472
|
-
ok: external_exports.literal(true),
|
|
13473
|
-
discord_user_id: external_exports.string(),
|
|
13474
|
-
metadata: discordMetadata2
|
|
13475
|
-
}),
|
|
13476
|
-
external_exports.object({
|
|
13477
|
-
ok: external_exports.literal(false),
|
|
13478
|
-
push_error: external_exports.literal("discord_unreachable"),
|
|
13479
|
-
metadata: discordMetadata2
|
|
13480
|
-
})
|
|
13481
|
-
]);
|
|
13482
|
-
discordDisconnectResponse2 = external_exports.object({
|
|
13483
|
-
ok: external_exports.literal(true)
|
|
13484
|
-
});
|
|
13485
13229
|
jsonSchemaSchema2 = external_exports.record(external_exports.unknown());
|
|
13486
13230
|
hubUserIdentity2 = external_exports.object({
|
|
13487
13231
|
user_id: external_exports.string().nullable(),
|
|
@@ -13591,77 +13335,6 @@ var init_dist = __esm({
|
|
|
13591
13335
|
offset: external_exports.coerce.number().int().min(0).optional()
|
|
13592
13336
|
});
|
|
13593
13337
|
noticeIdParamSchema2 = external_exports.object({ id: external_exports.string().min(1) });
|
|
13594
|
-
templateLocaleSchema2 = external_exports.enum(SUPPORTED_LOCALES2);
|
|
13595
|
-
TEMPLATE_SLUG_REGEX2 = /^[a-z0-9][a-z0-9-]{0,62}$/;
|
|
13596
|
-
templateSlugSchema2 = external_exports.string().regex(TEMPLATE_SLUG_REGEX2, "slug must be lowercase alphanumeric with hyphens (max 63)");
|
|
13597
|
-
templateStatusSchema2 = external_exports.enum(["published", "draft", "internal"]);
|
|
13598
|
-
templateFileMapSchema2 = external_exports.record(external_exports.string()).refine((m) => Object.keys(m).every(isSafeTemplatePath2), {
|
|
13599
|
-
message: 'file map contains an unsafe path (no absolute paths, "..", or backslashes)'
|
|
13600
|
-
});
|
|
13601
|
-
templateTextSchema2 = external_exports.object({
|
|
13602
|
-
metaTitle: external_exports.string().min(1).max(200),
|
|
13603
|
-
metaDescription: external_exports.string().max(1e3).default("")
|
|
13604
|
-
});
|
|
13605
|
-
templateUsesEntrySchema2 = external_exports.object({
|
|
13606
|
-
backend: templateSlugSchema2,
|
|
13607
|
-
endpoint: templateSlugSchema2
|
|
13608
|
-
});
|
|
13609
|
-
templateUsesSchema2 = external_exports.array(templateUsesEntrySchema2).max(24).default([]);
|
|
13610
|
-
templateYamlLocaleEntry2 = templateTextSchema2.extend({ source: external_exports.string().min(1) });
|
|
13611
|
-
templateYamlWayaiBlock2 = external_exports.object({
|
|
13612
|
-
installCommand: external_exports.string().min(1).max(300),
|
|
13613
|
-
locales: external_exports.record(templateLocaleSchema2, templateYamlLocaleEntry2)
|
|
13614
|
-
});
|
|
13615
|
-
templateTagsSchema2 = external_exports.array(external_exports.string().min(1).max(30)).max(12).default([]).transform((tags) => [...new Set(tags.map((t) => t.trim().toLowerCase()).filter(Boolean))]);
|
|
13616
|
-
templateYamlSchema2 = external_exports.object({
|
|
13617
|
-
slug: templateSlugSchema2,
|
|
13618
|
-
category: external_exports.string().min(1).max(60),
|
|
13619
|
-
tags: templateTagsSchema2,
|
|
13620
|
-
status: templateStatusSchema2.default("draft"),
|
|
13621
|
-
order: external_exports.number().int().min(0).max(1e5).optional(),
|
|
13622
|
-
defaultLocale: templateLocaleSchema2,
|
|
13623
|
-
hero: external_exports.string().optional(),
|
|
13624
|
-
// relative path to a hero image inside the template folder
|
|
13625
|
-
// The Rekor backend(s) this channel runs on (gh #2955). Locale-agnostic. The
|
|
13626
|
-
// cross-link + MCP endpoint are derived from each entry's slugs, never authored.
|
|
13627
|
-
uses: templateUsesSchema2,
|
|
13628
|
-
// A WayAI template IS a WayAI channel — the wayai slice is required. (The old
|
|
13629
|
-
// Rekor-only store entry is gone: a pure Rekor backend lives only in Rekor's store.)
|
|
13630
|
-
wayai: templateYamlWayaiBlock2
|
|
13631
|
-
}).refine((c) => Boolean(c.wayai.locales[c.defaultLocale]), {
|
|
13632
|
-
message: "`wayai.locales` must include the defaultLocale"
|
|
13633
|
-
});
|
|
13634
|
-
templateHeroSchema2 = external_exports.object({
|
|
13635
|
-
filename: external_exports.string().min(1).max(200).regex(/\.(png|jpe?g|webp|gif)$/i, "hero must be a raster image (png/jpg/webp/gif)"),
|
|
13636
|
-
dataBase64: external_exports.string().min(1).max(8e6)
|
|
13637
|
-
});
|
|
13638
|
-
templatePushLocaleSchema2 = external_exports.object({
|
|
13639
|
-
wayai: templateTextSchema2.optional(),
|
|
13640
|
-
readmeMarkdown: external_exports.string().default(""),
|
|
13641
|
-
wayaiFiles: templateFileMapSchema2.optional()
|
|
13642
|
-
});
|
|
13643
|
-
templatePushBody2 = external_exports.object({
|
|
13644
|
-
slug: templateSlugSchema2,
|
|
13645
|
-
defaultLocale: templateLocaleSchema2,
|
|
13646
|
-
common: external_exports.object({
|
|
13647
|
-
category: external_exports.string().min(1).max(60),
|
|
13648
|
-
tags: templateTagsSchema2,
|
|
13649
|
-
status: templateStatusSchema2,
|
|
13650
|
-
order: external_exports.number().int().min(0).max(1e5).default(0),
|
|
13651
|
-
// The WayAI install command (a WayAI template always has a wayai side). Kept
|
|
13652
|
-
// optional on the wire so a malformed manifest 400s on the field, not the body.
|
|
13653
|
-
installCommand: external_exports.string().min(1).max(300).optional(),
|
|
13654
|
-
hero: templateHeroSchema2.optional(),
|
|
13655
|
-
// The channel→backend edge (gh #2955), locale-agnostic.
|
|
13656
|
-
uses: templateUsesSchema2
|
|
13657
|
-
}),
|
|
13658
|
-
locales: external_exports.record(templateLocaleSchema2, templatePushLocaleSchema2)
|
|
13659
|
-
}).refine((b) => Boolean(b.locales[b.defaultLocale]), {
|
|
13660
|
-
message: "`locales` must include the defaultLocale"
|
|
13661
|
-
});
|
|
13662
|
-
templateListQuery2 = external_exports.object({ locale: templateLocaleSchema2.optional() });
|
|
13663
|
-
templateSlugParam2 = external_exports.object({ slug: templateSlugSchema2 });
|
|
13664
|
-
templateDetailQuery2 = external_exports.object({ locale: templateLocaleSchema2.optional() });
|
|
13665
13338
|
ADMIN_SKILL_NAME_REGEX2 = /^[a-z0-9][a-z0-9-]{0,63}$/;
|
|
13666
13339
|
adminSkillNameParam2 = external_exports.object({
|
|
13667
13340
|
name: external_exports.string().regex(ADMIN_SKILL_NAME_REGEX2, "invalid skill name")
|
|
@@ -13716,12 +13389,6 @@ function resolveLayout(gitRoot, layout = WAYAI_LAYOUT) {
|
|
|
13716
13389
|
legacyAlsoPresent: false
|
|
13717
13390
|
};
|
|
13718
13391
|
}
|
|
13719
|
-
function resolveHubsDir(gitRoot) {
|
|
13720
|
-
return resolveLayout(gitRoot).hubsDir;
|
|
13721
|
-
}
|
|
13722
|
-
function resolveTemplatesDir(gitRoot) {
|
|
13723
|
-
return path.join(gitRoot, TEMPLATES_AUTHORING_SUBDIR);
|
|
13724
|
-
}
|
|
13725
13392
|
function hubsDirLabel(gitRoot) {
|
|
13726
13393
|
if (!gitRoot) return path.join(WAYAI_LAYOUT.wsDir, WAYAI_LAYOUT.hubsSubdir);
|
|
13727
13394
|
return path.relative(gitRoot, resolveLayout(gitRoot).hubsDir);
|
|
@@ -13747,7 +13414,7 @@ function warnLayoutOnce(gitRoot) {
|
|
|
13747
13414
|
);
|
|
13748
13415
|
}
|
|
13749
13416
|
}
|
|
13750
|
-
var WAYAI_LAYOUT,
|
|
13417
|
+
var WAYAI_LAYOUT, _layoutWarned;
|
|
13751
13418
|
var init_layout = __esm({
|
|
13752
13419
|
"src/lib/layout.ts"() {
|
|
13753
13420
|
"use strict";
|
|
@@ -13756,7 +13423,6 @@ var init_layout = __esm({
|
|
|
13756
13423
|
...WAYAI_WORKSPACE_LAYOUT,
|
|
13757
13424
|
legacy: { wsDir: "workspace", orgAtRoot: "org" }
|
|
13758
13425
|
};
|
|
13759
|
-
TEMPLATES_AUTHORING_SUBDIR = "wayai-templates";
|
|
13760
13426
|
_layoutWarned = false;
|
|
13761
13427
|
}
|
|
13762
13428
|
});
|
|
@@ -13780,7 +13446,6 @@ __export(workspace_exports, {
|
|
|
13780
13446
|
resolveActiveHubId: () => resolveActiveHubId,
|
|
13781
13447
|
resolveExplicitHubPath: () => resolveExplicitHubPath,
|
|
13782
13448
|
resolveHubFolder: () => resolveHubFolder,
|
|
13783
|
-
resolveHubFolderBySelector: () => resolveHubFolderBySelector,
|
|
13784
13449
|
resolveNewHubForCreate: () => resolveNewHubForCreate,
|
|
13785
13450
|
resolvePushTarget: () => resolvePushTarget,
|
|
13786
13451
|
resolveWorkspaceDir: () => resolveWorkspaceDir,
|
|
@@ -13982,16 +13647,6 @@ function findHubByFolderName(workspaceDir, hubFolderName) {
|
|
|
13982
13647
|
const all = scanWorkspaceHubs(workspaceDir);
|
|
13983
13648
|
return all.find((h) => path2.basename(h.hubFolder) === hubFolderName) ?? null;
|
|
13984
13649
|
}
|
|
13985
|
-
function resolveHubFolderBySelector(hubsDir, selector) {
|
|
13986
|
-
const asPath = path2.resolve(selector);
|
|
13987
|
-
if (isDirectory(asPath) && fs2.existsSync(path2.join(asPath, "hub.yaml"))) return asPath;
|
|
13988
|
-
if (UUID_RE2.test(selector)) {
|
|
13989
|
-
const match = scanWorkspaceHubs(hubsDir).find((h) => h.hubId === selector);
|
|
13990
|
-
return match ? match.hubFolder : null;
|
|
13991
|
-
}
|
|
13992
|
-
const byName = findHubByFolderName(hubsDir, selector);
|
|
13993
|
-
return byName ? byName.hubFolder : null;
|
|
13994
|
-
}
|
|
13995
13650
|
function autoRenameHubFolder(currentFolder, hubName, hubEnvironment, hubId, previewLabel, branchName) {
|
|
13996
13651
|
const expectedSlug = getHubFolderSlug(hubName, hubEnvironment, hubId, previewLabel, branchName);
|
|
13997
13652
|
const currentSlug = path2.basename(currentFolder);
|
|
@@ -14229,24 +13884,24 @@ import * as path4 from "path";
|
|
|
14229
13884
|
import * as readline from "readline";
|
|
14230
13885
|
function prompt(question) {
|
|
14231
13886
|
const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
|
|
14232
|
-
return new Promise((
|
|
13887
|
+
return new Promise((resolve5) => {
|
|
14233
13888
|
rl.question(question, (answer) => {
|
|
14234
13889
|
rl.close();
|
|
14235
|
-
|
|
13890
|
+
resolve5(answer.trim());
|
|
14236
13891
|
});
|
|
14237
13892
|
});
|
|
14238
13893
|
}
|
|
14239
13894
|
function confirm(question) {
|
|
14240
13895
|
const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
|
|
14241
|
-
return new Promise((
|
|
13896
|
+
return new Promise((resolve5) => {
|
|
14242
13897
|
rl.question(`${question} [y/N]: `, (answer) => {
|
|
14243
13898
|
rl.close();
|
|
14244
|
-
|
|
13899
|
+
resolve5(answer.trim().toLowerCase() === "y");
|
|
14245
13900
|
});
|
|
14246
13901
|
});
|
|
14247
13902
|
}
|
|
14248
13903
|
function promptSecret(question) {
|
|
14249
|
-
return new Promise((
|
|
13904
|
+
return new Promise((resolve5) => {
|
|
14250
13905
|
const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
|
|
14251
13906
|
const originalWrite = rl._writeToOutput;
|
|
14252
13907
|
let firstWrite = true;
|
|
@@ -14262,18 +13917,18 @@ function promptSecret(question) {
|
|
|
14262
13917
|
rl._writeToOutput = originalWrite;
|
|
14263
13918
|
process.stdout.write("\n");
|
|
14264
13919
|
rl.close();
|
|
14265
|
-
|
|
13920
|
+
resolve5(answer);
|
|
14266
13921
|
});
|
|
14267
13922
|
});
|
|
14268
13923
|
}
|
|
14269
13924
|
function readStdin() {
|
|
14270
|
-
return new Promise((
|
|
13925
|
+
return new Promise((resolve5, reject) => {
|
|
14271
13926
|
let data = "";
|
|
14272
13927
|
process.stdin.setEncoding("utf-8");
|
|
14273
13928
|
process.stdin.on("data", (chunk) => {
|
|
14274
13929
|
data += chunk;
|
|
14275
13930
|
});
|
|
14276
|
-
process.stdin.on("end", () =>
|
|
13931
|
+
process.stdin.on("end", () => resolve5(data.trim()));
|
|
14277
13932
|
process.stdin.on("error", reject);
|
|
14278
13933
|
});
|
|
14279
13934
|
}
|
|
@@ -14435,9 +14090,9 @@ function getVersionCachePath(filename = CLI_CACHE_FILE) {
|
|
|
14435
14090
|
}
|
|
14436
14091
|
function readVersionCache(filename = CLI_CACHE_FILE) {
|
|
14437
14092
|
try {
|
|
14438
|
-
const
|
|
14439
|
-
if (!existsSync4(
|
|
14440
|
-
const parsed = JSON.parse(readFileSync5(
|
|
14093
|
+
const path30 = getVersionCachePath(filename);
|
|
14094
|
+
if (!existsSync4(path30)) return null;
|
|
14095
|
+
const parsed = JSON.parse(readFileSync5(path30, "utf-8"));
|
|
14441
14096
|
if (typeof parsed.lastCheck !== "number") return null;
|
|
14442
14097
|
if (parsed.latest !== null && typeof parsed.latest !== "string") return null;
|
|
14443
14098
|
return parsed;
|
|
@@ -14457,10 +14112,10 @@ function isVersionCacheStale(filename = CLI_CACHE_FILE, maxAgeMs = MAX_AGE_24H_M
|
|
|
14457
14112
|
return Date.now() - cache.lastCheck > maxAgeMs;
|
|
14458
14113
|
}
|
|
14459
14114
|
function writeVersionCache(filename, cache) {
|
|
14460
|
-
const
|
|
14461
|
-
const dir = dirname3(
|
|
14115
|
+
const path30 = getVersionCachePath(filename);
|
|
14116
|
+
const dir = dirname3(path30);
|
|
14462
14117
|
if (!existsSync4(dir)) mkdirSync(dir, { recursive: true });
|
|
14463
|
-
writeFileSync2(
|
|
14118
|
+
writeFileSync2(path30, JSON.stringify(cache));
|
|
14464
14119
|
}
|
|
14465
14120
|
function touchVersionCache(filename) {
|
|
14466
14121
|
writeVersionCache(filename, { lastCheck: Date.now(), latest: readVersionCache(filename)?.latest ?? null });
|
|
@@ -14499,14 +14154,14 @@ function parseFrontmatterVersion(content) {
|
|
|
14499
14154
|
function findInstalledSkills(projectRoot, paths = SKILL_INSTALL_PATHS) {
|
|
14500
14155
|
const found = [];
|
|
14501
14156
|
for (const rel of paths) {
|
|
14502
|
-
const
|
|
14503
|
-
if (!existsSync5(
|
|
14157
|
+
const path30 = join7(projectRoot, rel);
|
|
14158
|
+
if (!existsSync5(path30)) continue;
|
|
14504
14159
|
let version = null;
|
|
14505
14160
|
try {
|
|
14506
|
-
version = parseFrontmatterVersion(readFileSync6(
|
|
14161
|
+
version = parseFrontmatterVersion(readFileSync6(path30, "utf-8"));
|
|
14507
14162
|
} catch {
|
|
14508
14163
|
}
|
|
14509
|
-
found.push({ path:
|
|
14164
|
+
found.push({ path: path30, version });
|
|
14510
14165
|
}
|
|
14511
14166
|
return found;
|
|
14512
14167
|
}
|
|
@@ -14979,7 +14634,7 @@ async function validateToken(apiUrl, token) {
|
|
|
14979
14634
|
}
|
|
14980
14635
|
}
|
|
14981
14636
|
function startCallbackServer(port, expectedState, timeoutMs = 12e4) {
|
|
14982
|
-
return new Promise((
|
|
14637
|
+
return new Promise((resolve5, reject) => {
|
|
14983
14638
|
const server = http.createServer((req, res) => {
|
|
14984
14639
|
const url = new URL(req.url || "/", `http://127.0.0.1:${port}`);
|
|
14985
14640
|
if (url.pathname === "/callback") {
|
|
@@ -15005,7 +14660,7 @@ function startCallbackServer(port, expectedState, timeoutMs = 12e4) {
|
|
|
15005
14660
|
res.writeHead(200, { "Content-Type": "text/html" });
|
|
15006
14661
|
res.end("<html><body><h2>Login successful!</h2><p>You can close this tab and return to your terminal.</p></body></html>");
|
|
15007
14662
|
server.close();
|
|
15008
|
-
|
|
14663
|
+
resolve5({ code, port });
|
|
15009
14664
|
} else {
|
|
15010
14665
|
res.writeHead(400, { "Content-Type": "text/html" });
|
|
15011
14666
|
res.end("<html><body><h2>Login failed</h2><p>No authorization code received</p></body></html>");
|
|
@@ -15216,10 +14871,10 @@ import * as readline2 from "readline";
|
|
|
15216
14871
|
function prompt2(question, defaultValue) {
|
|
15217
14872
|
const rl = readline2.createInterface({ input: process.stdin, output: process.stdout });
|
|
15218
14873
|
const display = defaultValue ? `${question} [${defaultValue}]: ` : `${question}: `;
|
|
15219
|
-
return new Promise((
|
|
14874
|
+
return new Promise((resolve5) => {
|
|
15220
14875
|
rl.question(display, (answer) => {
|
|
15221
14876
|
rl.close();
|
|
15222
|
-
|
|
14877
|
+
resolve5(answer.trim() || defaultValue || "");
|
|
15223
14878
|
});
|
|
15224
14879
|
});
|
|
15225
14880
|
}
|
|
@@ -15337,8 +14992,8 @@ async function tryOpenBrowser(url) {
|
|
|
15337
14992
|
cmd = "xdg-open";
|
|
15338
14993
|
args2 = [url];
|
|
15339
14994
|
}
|
|
15340
|
-
return new Promise((
|
|
15341
|
-
execFile(cmd, args2, (err) =>
|
|
14995
|
+
return new Promise((resolve5) => {
|
|
14996
|
+
execFile(cmd, args2, (err) => resolve5(!err));
|
|
15342
14997
|
});
|
|
15343
14998
|
} catch {
|
|
15344
14999
|
return false;
|
|
@@ -19961,8 +19616,8 @@ function installEvalSignalHandlers(input) {
|
|
|
19961
19616
|
let signalCount = 0;
|
|
19962
19617
|
let disposed = false;
|
|
19963
19618
|
let settle;
|
|
19964
|
-
const settled = new Promise((
|
|
19965
|
-
settle =
|
|
19619
|
+
const settled = new Promise((resolve5) => {
|
|
19620
|
+
settle = resolve5;
|
|
19966
19621
|
});
|
|
19967
19622
|
const listeners = /* @__PURE__ */ new Map();
|
|
19968
19623
|
const dispose = () => {
|
|
@@ -20312,7 +19967,7 @@ Timeout after ${timeoutSeconds}s${queuedSeconds > 0 ? ` (${queuedSeconds}s of it
|
|
|
20312
19967
|
process.exit(1);
|
|
20313
19968
|
}
|
|
20314
19969
|
function sleep(ms) {
|
|
20315
|
-
return new Promise((
|
|
19970
|
+
return new Promise((resolve5) => setTimeout(resolve5, ms));
|
|
20316
19971
|
}
|
|
20317
19972
|
function parseRunNumbers(raw) {
|
|
20318
19973
|
if (!raw || raw.startsWith("--")) {
|
|
@@ -22358,276 +22013,6 @@ var init_list = __esm({
|
|
|
22358
22013
|
}
|
|
22359
22014
|
});
|
|
22360
22015
|
|
|
22361
|
-
// src/lib/template-files.ts
|
|
22362
|
-
import * as fs22 from "fs";
|
|
22363
|
-
import * as path28 from "path";
|
|
22364
|
-
function readDirToFileMap(rootDir) {
|
|
22365
|
-
const out = {};
|
|
22366
|
-
function walk(dir, prefix) {
|
|
22367
|
-
const entries = fs22.readdirSync(dir, { withFileTypes: true }).sort((a, b) => a.name.localeCompare(b.name));
|
|
22368
|
-
for (const entry of entries) {
|
|
22369
|
-
const abs = path28.join(dir, entry.name);
|
|
22370
|
-
const rel = prefix ? `${prefix}/${entry.name}` : entry.name;
|
|
22371
|
-
if (entry.isDirectory()) walk(abs, rel);
|
|
22372
|
-
else if (entry.isFile()) out[rel] = fs22.readFileSync(abs, "utf-8");
|
|
22373
|
-
}
|
|
22374
|
-
}
|
|
22375
|
-
if (fs22.existsSync(rootDir)) walk(rootDir, "");
|
|
22376
|
-
return out;
|
|
22377
|
-
}
|
|
22378
|
-
function detectCollisions(targetDir, files) {
|
|
22379
|
-
const collisions = [];
|
|
22380
|
-
for (const rel of Object.keys(files)) {
|
|
22381
|
-
if (!isSafeTemplatePath(rel)) {
|
|
22382
|
-
throw new Error(`Refusing to inspect unsafe template path: ${rel}`);
|
|
22383
|
-
}
|
|
22384
|
-
if (fs22.existsSync(path28.join(targetDir, rel))) collisions.push(rel);
|
|
22385
|
-
}
|
|
22386
|
-
return collisions.sort((a, b) => a.localeCompare(b));
|
|
22387
|
-
}
|
|
22388
|
-
function writeFileMap(targetDir, files) {
|
|
22389
|
-
const written = [];
|
|
22390
|
-
for (const [rel, body] of Object.entries(files)) {
|
|
22391
|
-
if (!isSafeTemplatePath(rel)) {
|
|
22392
|
-
throw new Error(`Refusing to write unsafe template path: ${rel}`);
|
|
22393
|
-
}
|
|
22394
|
-
const abs = path28.join(targetDir, rel);
|
|
22395
|
-
fs22.mkdirSync(path28.dirname(abs), { recursive: true });
|
|
22396
|
-
fs22.writeFileSync(abs, body, "utf-8");
|
|
22397
|
-
written.push(rel);
|
|
22398
|
-
}
|
|
22399
|
-
return written;
|
|
22400
|
-
}
|
|
22401
|
-
function listDirRelFiles(dir) {
|
|
22402
|
-
const out = [];
|
|
22403
|
-
function walk(d, prefix) {
|
|
22404
|
-
for (const entry of fs22.readdirSync(d, { withFileTypes: true })) {
|
|
22405
|
-
const rel = prefix ? `${prefix}/${entry.name}` : entry.name;
|
|
22406
|
-
if (entry.isDirectory()) walk(path28.join(d, entry.name), rel);
|
|
22407
|
-
else if (entry.isFile()) out.push(rel);
|
|
22408
|
-
}
|
|
22409
|
-
}
|
|
22410
|
-
if (fs22.existsSync(dir)) walk(dir, "");
|
|
22411
|
-
return out;
|
|
22412
|
-
}
|
|
22413
|
-
function writeSliceSnapshot(targetDir, files) {
|
|
22414
|
-
const keep = new Set(Object.keys(files));
|
|
22415
|
-
const removed = listDirRelFiles(targetDir).filter((rel) => !keep.has(rel)).sort((a, b) => a.localeCompare(b));
|
|
22416
|
-
const written = writeFileMap(targetDir, files).sort((a, b) => a.localeCompare(b));
|
|
22417
|
-
if (fs22.existsSync(targetDir)) cleanOrphanFiles(targetDir, "", keep);
|
|
22418
|
-
return { written, removed };
|
|
22419
|
-
}
|
|
22420
|
-
var init_template_files = __esm({
|
|
22421
|
-
"src/lib/template-files.ts"() {
|
|
22422
|
-
"use strict";
|
|
22423
|
-
init_contracts();
|
|
22424
|
-
init_resource_files();
|
|
22425
|
-
}
|
|
22426
|
-
});
|
|
22427
|
-
|
|
22428
|
-
// src/commands/templates.ts
|
|
22429
|
-
var templates_exports = {};
|
|
22430
|
-
__export(templates_exports, {
|
|
22431
|
-
templateCommand: () => templateCommand
|
|
22432
|
-
});
|
|
22433
|
-
import * as path29 from "path";
|
|
22434
|
-
async function templateCommand(args2) {
|
|
22435
|
-
const [sub, ...rest] = args2;
|
|
22436
|
-
switch (sub) {
|
|
22437
|
-
case "list":
|
|
22438
|
-
await runTemplateList();
|
|
22439
|
-
return;
|
|
22440
|
-
case "pull":
|
|
22441
|
-
await runTemplatePull(rest);
|
|
22442
|
-
return;
|
|
22443
|
-
case void 0:
|
|
22444
|
-
case "help":
|
|
22445
|
-
case "--help":
|
|
22446
|
-
case "-h":
|
|
22447
|
-
printTemplateHelp();
|
|
22448
|
-
return;
|
|
22449
|
-
default:
|
|
22450
|
-
console.error(`Unknown template subcommand: ${sub}`);
|
|
22451
|
-
printTemplateHelp();
|
|
22452
|
-
process.exit(1);
|
|
22453
|
-
}
|
|
22454
|
-
}
|
|
22455
|
-
function includesLabel(item) {
|
|
22456
|
-
const parts = [];
|
|
22457
|
-
if (item.includes.wayai) parts.push("wayai agent");
|
|
22458
|
-
if (item.uses?.length) parts.push("rekor backend");
|
|
22459
|
-
return parts.length ? parts.join(" + ") : "(none)";
|
|
22460
|
-
}
|
|
22461
|
-
async function runTemplateList() {
|
|
22462
|
-
const { config, accessToken } = await requireAuth();
|
|
22463
|
-
const client = new ApiClient({ apiUrl: config.api_url, accessToken });
|
|
22464
|
-
let response;
|
|
22465
|
-
try {
|
|
22466
|
-
response = await client.templateList();
|
|
22467
|
-
} catch (err) {
|
|
22468
|
-
exitOnTemplateApiError(err);
|
|
22469
|
-
throw err;
|
|
22470
|
-
}
|
|
22471
|
-
const { templates } = response;
|
|
22472
|
-
if (templates.length === 0) {
|
|
22473
|
-
console.log("(no templates published yet)");
|
|
22474
|
-
return;
|
|
22475
|
-
}
|
|
22476
|
-
const slugWidth = Math.max(4, ...templates.map((t) => t.slug.length));
|
|
22477
|
-
const catWidth = Math.max(8, ...templates.map((t) => t.category.length));
|
|
22478
|
-
console.log(`${"SLUG".padEnd(slugWidth)} ${"CATEGORY".padEnd(catWidth)} INCLUDES`);
|
|
22479
|
-
for (const t of templates) {
|
|
22480
|
-
console.log(`${t.slug.padEnd(slugWidth)} ${t.category.padEnd(catWidth)} ${includesLabel(t)}`);
|
|
22481
|
-
}
|
|
22482
|
-
}
|
|
22483
|
-
async function runTemplatePull(rest) {
|
|
22484
|
-
const positional = [];
|
|
22485
|
-
let lang;
|
|
22486
|
-
let force = false;
|
|
22487
|
-
let dryRun = false;
|
|
22488
|
-
for (let i = 0; i < rest.length; i++) {
|
|
22489
|
-
if (rest[i] === "--force") {
|
|
22490
|
-
force = true;
|
|
22491
|
-
continue;
|
|
22492
|
-
}
|
|
22493
|
-
if (rest[i] === "--dry-run") {
|
|
22494
|
-
dryRun = true;
|
|
22495
|
-
continue;
|
|
22496
|
-
}
|
|
22497
|
-
if (rest[i] === "--lang") {
|
|
22498
|
-
const v = rest[++i];
|
|
22499
|
-
if (!v) {
|
|
22500
|
-
console.error("--lang requires a value");
|
|
22501
|
-
process.exit(1);
|
|
22502
|
-
}
|
|
22503
|
-
const parsed = templateLocaleSchema.safeParse(v);
|
|
22504
|
-
if (!parsed.success) {
|
|
22505
|
-
console.error(`Invalid --lang "${v}": must be one of ${templateLocaleSchema.options.join(", ")}.`);
|
|
22506
|
-
process.exit(1);
|
|
22507
|
-
}
|
|
22508
|
-
lang = parsed.data;
|
|
22509
|
-
continue;
|
|
22510
|
-
}
|
|
22511
|
-
if (rest[i].startsWith("--")) {
|
|
22512
|
-
console.error(`Unknown flag: ${rest[i]}`);
|
|
22513
|
-
process.exit(1);
|
|
22514
|
-
}
|
|
22515
|
-
positional.push(rest[i]);
|
|
22516
|
-
}
|
|
22517
|
-
const slug = positional[0];
|
|
22518
|
-
if (!slug) {
|
|
22519
|
-
console.error("wayai template pull <slug> [--lang <locale>]");
|
|
22520
|
-
process.exit(1);
|
|
22521
|
-
}
|
|
22522
|
-
if (!TEMPLATE_SLUG_REGEX.test(slug)) {
|
|
22523
|
-
console.error(`Invalid template slug: ${slug}`);
|
|
22524
|
-
process.exit(1);
|
|
22525
|
-
}
|
|
22526
|
-
const gitRoot = findGitRoot();
|
|
22527
|
-
if (!gitRoot) {
|
|
22528
|
-
console.error("Not in a git repository. Run `wayai template pull` inside your project repo.");
|
|
22529
|
-
process.exit(1);
|
|
22530
|
-
}
|
|
22531
|
-
const { config, accessToken } = await requireAuth();
|
|
22532
|
-
const client = new ApiClient({ apiUrl: config.api_url, accessToken });
|
|
22533
|
-
let detail;
|
|
22534
|
-
try {
|
|
22535
|
-
detail = await client.templatePull(slug, lang);
|
|
22536
|
-
} catch (err) {
|
|
22537
|
-
exitOnTemplateApiError(err);
|
|
22538
|
-
throw err;
|
|
22539
|
-
}
|
|
22540
|
-
if (detail.resolvedLocale !== detail.requestedLocale) {
|
|
22541
|
-
console.log(`Note: "${detail.requestedLocale}" not translated yet \u2014 pulled "${detail.resolvedLocale}" instead.`);
|
|
22542
|
-
}
|
|
22543
|
-
if (!detail.includes.wayai) {
|
|
22544
|
-
const backends2 = distinctUsesBackends(detail.uses);
|
|
22545
|
-
const hint = backends2.length ? ` \u2014 run ${backends2.map((b) => `\`rekor template pull ${b}${langFlag(lang)}\``).join(" and ")} for its data layer.` : ".";
|
|
22546
|
-
console.log(`Template "${slug}" has no WayAI slice${hint}`);
|
|
22547
|
-
return;
|
|
22548
|
-
}
|
|
22549
|
-
const targetDir = path29.join(resolveLayout(gitRoot).hubsDir, slug);
|
|
22550
|
-
const relTarget = path29.relative(gitRoot, targetDir);
|
|
22551
|
-
const collisions = detectCollisions(targetDir, detail.files);
|
|
22552
|
-
if (dryRun) {
|
|
22553
|
-
const planned = Object.keys(detail.files).sort((a, b) => a.localeCompare(b));
|
|
22554
|
-
const collisionSet = new Set(collisions);
|
|
22555
|
-
console.log(`Dry run \u2014 would write ${planned.length} file${planned.length === 1 ? "" : "s"} into ${relTarget}/:`);
|
|
22556
|
-
for (const rel of planned) {
|
|
22557
|
-
console.log(` ${collisionSet.has(rel) ? "overwrite" : "create"} ${rel}`);
|
|
22558
|
-
}
|
|
22559
|
-
if (collisions.length > 0) {
|
|
22560
|
-
console.log(`
|
|
22561
|
-
${collisions.length} existing file${collisions.length === 1 ? "" : "s"} would be overwritten \u2014 re-run with --force to proceed.`);
|
|
22562
|
-
}
|
|
22563
|
-
return;
|
|
22564
|
-
}
|
|
22565
|
-
if (collisions.length > 0 && !force) {
|
|
22566
|
-
console.error(`Refusing to overwrite ${collisions.length} existing file${collisions.length === 1 ? "" : "s"} in ${relTarget}/:`);
|
|
22567
|
-
for (const rel of collisions) console.error(` ${rel}`);
|
|
22568
|
-
console.error(`
|
|
22569
|
-
Commit or move your changes and re-run with --force to overwrite, or pull into a fresh slug dir.`);
|
|
22570
|
-
console.error(`Preview the full file map first with --dry-run.`);
|
|
22571
|
-
process.exit(1);
|
|
22572
|
-
}
|
|
22573
|
-
const written = writeFileMap(targetDir, detail.files);
|
|
22574
|
-
console.log(`Pulled template "${slug}" \u2192 ${relTarget}/ (${written.length} file${written.length === 1 ? "" : "s"}).`);
|
|
22575
|
-
console.log(`Next: \`wayai push\` to deploy it into your own hub.`);
|
|
22576
|
-
const backends = distinctUsesBackends(detail.uses);
|
|
22577
|
-
if (backends.length) {
|
|
22578
|
-
const cmds = backends.map((b) => `\`rekor template pull ${b}${langFlag(lang)}\``).join(" and ");
|
|
22579
|
-
const noun = backends.length === 1 ? "a Rekor backend" : "Rekor backends";
|
|
22580
|
-
const obj = backends.length === 1 ? "it" : "them";
|
|
22581
|
-
console.log(`
|
|
22582
|
-
This channel runs on ${noun} \u2014 run ${cmds} to add ${obj}.`);
|
|
22583
|
-
}
|
|
22584
|
-
}
|
|
22585
|
-
function langFlag(lang) {
|
|
22586
|
-
return lang ? ` --lang ${lang}` : "";
|
|
22587
|
-
}
|
|
22588
|
-
function printTemplateHelp() {
|
|
22589
|
-
console.log(`wayai template \u2014 install ready-made hub templates
|
|
22590
|
-
|
|
22591
|
-
Usage:
|
|
22592
|
-
wayai template list List available templates
|
|
22593
|
-
wayai template pull <slug> [--lang <l>] [--force] [--dry-run]
|
|
22594
|
-
Write a template's WayAI slice into wayai-ws/hubs/<slug>/
|
|
22595
|
-
|
|
22596
|
-
--lang selects a localized variant (${templateLocaleSchema.options.join("|")}); omitted = the template's default
|
|
22597
|
-
language. An untranslated language falls back to the default (with a note).
|
|
22598
|
-
--dry-run previews the file map (marking files that would be overwritten) without writing.
|
|
22599
|
-
A pull refuses to overwrite existing files in the target dir; pass --force to overwrite them.
|
|
22600
|
-
|
|
22601
|
-
After pulling, run \`wayai push\` to deploy the template into your own hub.`);
|
|
22602
|
-
}
|
|
22603
|
-
function exitOnTemplateApiError(err) {
|
|
22604
|
-
if (err instanceof ApiError) {
|
|
22605
|
-
if (err.status === 401) {
|
|
22606
|
-
console.error("Authentication failed. Run `wayai login` again.");
|
|
22607
|
-
} else if (err.status === 404) {
|
|
22608
|
-
console.error("Template not found. Run `wayai template list` to see available templates.");
|
|
22609
|
-
} else if (err.status === 429) {
|
|
22610
|
-
console.error("Rate limited. Please retry in a moment.");
|
|
22611
|
-
} else {
|
|
22612
|
-
console.error(err.message);
|
|
22613
|
-
}
|
|
22614
|
-
process.exit(1);
|
|
22615
|
-
}
|
|
22616
|
-
console.error(err instanceof Error ? err.message : String(err));
|
|
22617
|
-
process.exit(1);
|
|
22618
|
-
}
|
|
22619
|
-
var init_templates = __esm({
|
|
22620
|
-
"src/commands/templates.ts"() {
|
|
22621
|
-
"use strict";
|
|
22622
|
-
init_auth();
|
|
22623
|
-
init_api_client();
|
|
22624
|
-
init_workspace();
|
|
22625
|
-
init_layout();
|
|
22626
|
-
init_template_files();
|
|
22627
|
-
init_contracts();
|
|
22628
|
-
}
|
|
22629
|
-
});
|
|
22630
|
-
|
|
22631
22016
|
// src/lib/report-edit-args.ts
|
|
22632
22017
|
function parseReportEditArgs(args2) {
|
|
22633
22018
|
const patch = {};
|
|
@@ -22668,66 +22053,32 @@ var init_report_edit_args = __esm({
|
|
|
22668
22053
|
}
|
|
22669
22054
|
});
|
|
22670
22055
|
|
|
22671
|
-
// src/lib/
|
|
22672
|
-
import * as
|
|
22673
|
-
|
|
22674
|
-
|
|
22675
|
-
|
|
22676
|
-
|
|
22677
|
-
|
|
22678
|
-
return
|
|
22679
|
-
|
|
22680
|
-
|
|
22681
|
-
let parsed;
|
|
22682
|
-
try {
|
|
22683
|
-
parsed = yaml9.load(body);
|
|
22684
|
-
} catch {
|
|
22685
|
-
return body;
|
|
22686
|
-
}
|
|
22687
|
-
const scrubbed = stripEvalAttachments(filePath, excludeTemplateAuthorData(stripTemplateInstanceIds(parsed)));
|
|
22688
|
-
if (JSON.stringify(parsed) === JSON.stringify(scrubbed)) return body;
|
|
22689
|
-
return yaml9.dump(scrubbed, YAML_DUMP_OPTIONS);
|
|
22690
|
-
}
|
|
22691
|
-
function stripEvalAttachments(filePath, value) {
|
|
22692
|
-
if (!value || typeof value !== "object" || Array.isArray(value)) return value;
|
|
22693
|
-
const doc = { ...value };
|
|
22694
|
-
const dropOnTurn = (turn) => {
|
|
22695
|
-
if (!turn || typeof turn !== "object" || Array.isArray(turn) || !("attachments" in turn)) return turn;
|
|
22696
|
-
const { attachments: _drop, ...rest } = turn;
|
|
22697
|
-
return rest;
|
|
22698
|
-
};
|
|
22699
|
-
if (/^evals\//.test(filePath)) {
|
|
22700
|
-
if ("input" in doc) doc.input = dropOnTurn(doc.input);
|
|
22701
|
-
if (Array.isArray(doc.history)) doc.history = doc.history.map(dropOnTurn);
|
|
22702
|
-
} else if (/^journeys\//.test(filePath)) {
|
|
22703
|
-
if (Array.isArray(doc.transcript)) doc.transcript = doc.transcript.map(dropOnTurn);
|
|
22704
|
-
}
|
|
22705
|
-
return doc;
|
|
22056
|
+
// src/lib/file-map.ts
|
|
22057
|
+
import * as fs22 from "fs";
|
|
22058
|
+
import * as path28 from "path";
|
|
22059
|
+
function isSafeRelPath(rel) {
|
|
22060
|
+
if (rel.length === 0 || rel.length > 300) return false;
|
|
22061
|
+
if (rel.startsWith("/") || rel.includes("\\")) return false;
|
|
22062
|
+
const segments = rel.split("/");
|
|
22063
|
+
return segments.every(
|
|
22064
|
+
(seg) => seg.length > 0 && seg !== "." && seg !== ".." && /^[A-Za-z0-9._-]+$/.test(seg)
|
|
22065
|
+
);
|
|
22706
22066
|
}
|
|
22707
|
-
|
|
22708
|
-
|
|
22709
|
-
|
|
22710
|
-
|
|
22711
|
-
|
|
22067
|
+
function writeFileMap(targetDir, files) {
|
|
22068
|
+
const written = [];
|
|
22069
|
+
for (const [rel, body] of Object.entries(files)) {
|
|
22070
|
+
if (!isSafeRelPath(rel)) {
|
|
22071
|
+
throw new Error(`Refusing to write unsafe path: ${rel}`);
|
|
22072
|
+
}
|
|
22073
|
+
const abs = path28.join(targetDir, rel);
|
|
22074
|
+
fs22.mkdirSync(path28.dirname(abs), { recursive: true });
|
|
22075
|
+
fs22.writeFileSync(abs, body, "utf-8");
|
|
22076
|
+
written.push(rel);
|
|
22712
22077
|
}
|
|
22713
|
-
|
|
22714
|
-
|
|
22715
|
-
// src/lib/template-manifest.ts
|
|
22716
|
-
function buildTemplatePushCommon(manifest, hero) {
|
|
22717
|
-
return {
|
|
22718
|
-
category: manifest.category,
|
|
22719
|
-
tags: manifest.tags,
|
|
22720
|
-
status: manifest.status,
|
|
22721
|
-
order: manifest.order ?? 0,
|
|
22722
|
-
installCommand: manifest.wayai.installCommand,
|
|
22723
|
-
...hero && { hero },
|
|
22724
|
-
// The channel→backend edge (locale-agnostic). The store persists it verbatim; the
|
|
22725
|
-
// website derives the "runs on backend X" cross-link + MCP endpoint from the slugs.
|
|
22726
|
-
uses: manifest.uses
|
|
22727
|
-
};
|
|
22078
|
+
return written;
|
|
22728
22079
|
}
|
|
22729
|
-
var
|
|
22730
|
-
"src/lib/
|
|
22080
|
+
var init_file_map = __esm({
|
|
22081
|
+
"src/lib/file-map.ts"() {
|
|
22731
22082
|
"use strict";
|
|
22732
22083
|
}
|
|
22733
22084
|
});
|
|
@@ -22738,8 +22089,7 @@ __export(admin_exports, {
|
|
|
22738
22089
|
adminCommand: () => adminCommand
|
|
22739
22090
|
});
|
|
22740
22091
|
import * as fs23 from "fs";
|
|
22741
|
-
import * as
|
|
22742
|
-
import * as yaml10 from "js-yaml";
|
|
22092
|
+
import * as path29 from "path";
|
|
22743
22093
|
async function adminCommand(args2) {
|
|
22744
22094
|
const [group, ...afterGroup] = args2;
|
|
22745
22095
|
if (!group) {
|
|
@@ -22853,26 +22203,6 @@ async function adminCommand(args2) {
|
|
|
22853
22203
|
process.exit(1);
|
|
22854
22204
|
}
|
|
22855
22205
|
}
|
|
22856
|
-
if (group === "template") {
|
|
22857
|
-
if (!sub) {
|
|
22858
|
-
printHelp2();
|
|
22859
|
-
process.exit(1);
|
|
22860
|
-
}
|
|
22861
|
-
switch (sub) {
|
|
22862
|
-
case "push":
|
|
22863
|
-
await runTemplatePush(positional);
|
|
22864
|
-
return;
|
|
22865
|
-
case "pull":
|
|
22866
|
-
await runTemplatePull2(positional, flagArgs);
|
|
22867
|
-
return;
|
|
22868
|
-
case "freeze":
|
|
22869
|
-
await runTemplateFreeze(positional, flagArgs);
|
|
22870
|
-
return;
|
|
22871
|
-
default:
|
|
22872
|
-
printHelp2();
|
|
22873
|
-
process.exit(1);
|
|
22874
|
-
}
|
|
22875
|
-
}
|
|
22876
22206
|
if (group === "skill") {
|
|
22877
22207
|
if (!sub) {
|
|
22878
22208
|
printHelp2();
|
|
@@ -23186,262 +22516,6 @@ function parseFlags2(flagArgs, allowed) {
|
|
|
23186
22516
|
}
|
|
23187
22517
|
return out;
|
|
23188
22518
|
}
|
|
23189
|
-
function loadTemplateManifest(slug) {
|
|
23190
|
-
const gitRoot = findGitRoot();
|
|
23191
|
-
if (!gitRoot) {
|
|
23192
|
-
console.error("Not in a git repository. Run from the templates authoring repo (wayai-pro/templates).");
|
|
23193
|
-
process.exit(1);
|
|
23194
|
-
}
|
|
23195
|
-
const templateDir = path30.join(resolveTemplatesDir(gitRoot), slug);
|
|
23196
|
-
const manifestPath = path30.join(templateDir, "template.yaml");
|
|
23197
|
-
if (!fs23.existsSync(manifestPath)) {
|
|
23198
|
-
console.error(`template.yaml not found at ${path30.relative(gitRoot, manifestPath)}`);
|
|
23199
|
-
process.exit(1);
|
|
23200
|
-
}
|
|
23201
|
-
let manifest;
|
|
23202
|
-
try {
|
|
23203
|
-
manifest = templateYamlSchema.parse(yaml10.load(fs23.readFileSync(manifestPath, "utf-8")));
|
|
23204
|
-
} catch (err) {
|
|
23205
|
-
console.error(`Invalid template.yaml: ${err instanceof Error ? err.message : String(err)}`);
|
|
23206
|
-
process.exit(1);
|
|
23207
|
-
}
|
|
23208
|
-
if (manifest.slug !== slug) {
|
|
23209
|
-
console.error(`template.yaml slug "${manifest.slug}" does not match folder "${slug}".`);
|
|
23210
|
-
process.exit(1);
|
|
23211
|
-
}
|
|
23212
|
-
return { gitRoot, templateDir, manifest };
|
|
23213
|
-
}
|
|
23214
|
-
async function runTemplatePush(positional) {
|
|
23215
|
-
const slug = positional[0];
|
|
23216
|
-
if (!slug) {
|
|
23217
|
-
console.error("wayai admin template push <slug>");
|
|
23218
|
-
process.exit(1);
|
|
23219
|
-
}
|
|
23220
|
-
if (!TEMPLATE_SLUG_REGEX.test(slug)) {
|
|
23221
|
-
console.error(`Invalid template slug: ${slug}`);
|
|
23222
|
-
process.exit(1);
|
|
23223
|
-
}
|
|
23224
|
-
const { templateDir, manifest } = loadTemplateManifest(slug);
|
|
23225
|
-
const authoredLocales = new Set(
|
|
23226
|
-
Object.keys(manifest.wayai.locales)
|
|
23227
|
-
);
|
|
23228
|
-
const locales = {};
|
|
23229
|
-
for (const locale of authoredLocales) {
|
|
23230
|
-
const wayaiEntry = manifest.wayai.locales[locale];
|
|
23231
|
-
let wayaiFiles;
|
|
23232
|
-
if (wayaiEntry) {
|
|
23233
|
-
const sliceDir = path30.resolve(templateDir, wayaiEntry.source);
|
|
23234
|
-
if (!fs23.existsSync(sliceDir)) {
|
|
23235
|
-
console.error(`wayai source not found for ${locale}: ${wayaiEntry.source} (resolved ${sliceDir})`);
|
|
23236
|
-
process.exit(1);
|
|
23237
|
-
}
|
|
23238
|
-
if (!isInsideTemplateDir(sliceDir, templateDir)) {
|
|
23239
|
-
console.warn(
|
|
23240
|
-
`Note: ${locale} source points at a live hub (${wayaiEntry.source}); it can go stale on a hub recreate. Run \`wayai admin template freeze ${slug} --locale ${locale} --from ${path30.basename(sliceDir)}\` to commit a stable frozen slice.`
|
|
23241
|
-
);
|
|
23242
|
-
}
|
|
23243
|
-
wayaiFiles = readDirToFileMap(sliceDir);
|
|
23244
|
-
}
|
|
23245
|
-
const readmePath = path30.join(templateDir, `README.${locale}.md`);
|
|
23246
|
-
const readmeMarkdown = fs23.existsSync(readmePath) ? fs23.readFileSync(readmePath, "utf-8") : "";
|
|
23247
|
-
locales[locale] = {
|
|
23248
|
-
readmeMarkdown,
|
|
23249
|
-
...wayaiFiles && { wayaiFiles },
|
|
23250
|
-
...wayaiEntry && {
|
|
23251
|
-
wayai: { metaTitle: wayaiEntry.metaTitle, metaDescription: wayaiEntry.metaDescription }
|
|
23252
|
-
}
|
|
23253
|
-
};
|
|
23254
|
-
}
|
|
23255
|
-
let hero;
|
|
23256
|
-
if (manifest.hero) {
|
|
23257
|
-
const heroPath = path30.resolve(templateDir, manifest.hero);
|
|
23258
|
-
if (fs23.existsSync(heroPath)) {
|
|
23259
|
-
hero = { filename: path30.basename(heroPath), dataBase64: fs23.readFileSync(heroPath).toString("base64") };
|
|
23260
|
-
} else {
|
|
23261
|
-
console.error(`Warning: hero not found at ${manifest.hero}; skipping.`);
|
|
23262
|
-
}
|
|
23263
|
-
}
|
|
23264
|
-
const body = {
|
|
23265
|
-
slug,
|
|
23266
|
-
defaultLocale: manifest.defaultLocale,
|
|
23267
|
-
common: buildTemplatePushCommon(manifest, hero),
|
|
23268
|
-
locales
|
|
23269
|
-
};
|
|
23270
|
-
const { config, accessToken } = await requireAuth();
|
|
23271
|
-
const client = new ApiClient({ apiUrl: config.api_url, accessToken });
|
|
23272
|
-
let result;
|
|
23273
|
-
try {
|
|
23274
|
-
result = await client.adminTemplatePush(body);
|
|
23275
|
-
} catch (err) {
|
|
23276
|
-
exitOnApiError(err);
|
|
23277
|
-
throw err;
|
|
23278
|
-
}
|
|
23279
|
-
console.log(`Template "${result.slug}": ${result.action} (${result.filesWritten} written, ${result.filesDeleted} deleted).`);
|
|
23280
|
-
if (manifest.status !== "published") {
|
|
23281
|
-
console.log(`(status=${manifest.status} \u2192 unpublished from the store)`);
|
|
23282
|
-
}
|
|
23283
|
-
}
|
|
23284
|
-
function isInsideTemplateDir(dest, templateDir) {
|
|
23285
|
-
return dest === templateDir || dest.startsWith(templateDir + path30.sep);
|
|
23286
|
-
}
|
|
23287
|
-
async function runTemplateFreeze(positional, flagArgs) {
|
|
23288
|
-
const slug = positional[0];
|
|
23289
|
-
if (!slug) {
|
|
23290
|
-
console.error("wayai admin template freeze <slug> [--locale <l>] [--from <hub>] [--dry-run]");
|
|
23291
|
-
process.exit(1);
|
|
23292
|
-
}
|
|
23293
|
-
if (!TEMPLATE_SLUG_REGEX.test(slug)) {
|
|
23294
|
-
console.error(`Invalid template slug: ${slug}`);
|
|
23295
|
-
process.exit(1);
|
|
23296
|
-
}
|
|
23297
|
-
let locale;
|
|
23298
|
-
let from;
|
|
23299
|
-
let dryRun = false;
|
|
23300
|
-
for (let i = 0; i < flagArgs.length; i++) {
|
|
23301
|
-
if (flagArgs[i] === "--dry-run") {
|
|
23302
|
-
dryRun = true;
|
|
23303
|
-
continue;
|
|
23304
|
-
}
|
|
23305
|
-
if (flagArgs[i] === "--locale") {
|
|
23306
|
-
const v = flagArgs[++i];
|
|
23307
|
-
if (!v) {
|
|
23308
|
-
console.error("--locale requires a value");
|
|
23309
|
-
process.exit(1);
|
|
23310
|
-
}
|
|
23311
|
-
const parsed = templateLocaleSchema.safeParse(v);
|
|
23312
|
-
if (!parsed.success) {
|
|
23313
|
-
console.error(`Invalid --locale "${v}": must be one of ${templateLocaleSchema.options.join(", ")}.`);
|
|
23314
|
-
process.exit(1);
|
|
23315
|
-
}
|
|
23316
|
-
locale = parsed.data;
|
|
23317
|
-
continue;
|
|
23318
|
-
}
|
|
23319
|
-
if (flagArgs[i] === "--from") {
|
|
23320
|
-
from = flagArgs[++i];
|
|
23321
|
-
if (!from) {
|
|
23322
|
-
console.error("--from requires a value");
|
|
23323
|
-
process.exit(1);
|
|
23324
|
-
}
|
|
23325
|
-
continue;
|
|
23326
|
-
}
|
|
23327
|
-
console.error(`Unknown flag: ${flagArgs[i]}`);
|
|
23328
|
-
process.exit(1);
|
|
23329
|
-
}
|
|
23330
|
-
const { gitRoot, templateDir, manifest } = loadTemplateManifest(slug);
|
|
23331
|
-
const authored = Object.keys(manifest.wayai.locales);
|
|
23332
|
-
let targetLocale;
|
|
23333
|
-
if (locale) {
|
|
23334
|
-
if (!manifest.wayai.locales[locale]) {
|
|
23335
|
-
console.error(`Locale "${locale}" is not authored in ${slug}/template.yaml (have: ${authored.join(", ")}).`);
|
|
23336
|
-
process.exit(1);
|
|
23337
|
-
}
|
|
23338
|
-
targetLocale = locale;
|
|
23339
|
-
} else if (authored.length === 1) {
|
|
23340
|
-
targetLocale = authored[0];
|
|
23341
|
-
} else {
|
|
23342
|
-
console.error(`Template "${slug}" authors ${authored.length} locales (${authored.join(", ")}). Pass --locale <l> \u2014 each freezes from its own hub.`);
|
|
23343
|
-
process.exit(1);
|
|
23344
|
-
}
|
|
23345
|
-
const entry = manifest.wayai.locales[targetLocale];
|
|
23346
|
-
const dest = path30.resolve(templateDir, entry.source);
|
|
23347
|
-
if (!isInsideTemplateDir(dest, templateDir) || dest === templateDir) {
|
|
23348
|
-
console.error(
|
|
23349
|
-
`source for "${targetLocale}" must be a committed path inside ${slug}/ (e.g. "./${targetLocale}/slice"), but resolved to:
|
|
23350
|
-
${entry.source} \u2192 ${dest}
|
|
23351
|
-
Set it to a subdir of the template folder and re-run freeze.`
|
|
23352
|
-
);
|
|
23353
|
-
process.exit(1);
|
|
23354
|
-
}
|
|
23355
|
-
const hubsDir = resolveHubsDir(gitRoot);
|
|
23356
|
-
const selector = from ?? readBinding();
|
|
23357
|
-
const hubFolder = selector ? resolveHubFolderBySelector(hubsDir, selector) : null;
|
|
23358
|
-
if (!hubFolder) {
|
|
23359
|
-
console.error(
|
|
23360
|
-
selector ? `Could not resolve a source hub matching "${selector}" in ${hubsDirLabel(gitRoot)}/.` : "No --from given and this worktree has no `wayai use` binding."
|
|
23361
|
-
);
|
|
23362
|
-
const hubs = scanWorkspaceHubs(hubsDir);
|
|
23363
|
-
if (hubs.length) {
|
|
23364
|
-
console.error("Available hubs:");
|
|
23365
|
-
for (const h of hubs) console.error(` ${path30.basename(h.hubFolder)} (${h.hubId})`);
|
|
23366
|
-
}
|
|
23367
|
-
console.error(`
|
|
23368
|
-
Pass --from <folder|uuid>${selector ? "." : " or run `wayai use <hub>` first."}`);
|
|
23369
|
-
process.exit(1);
|
|
23370
|
-
}
|
|
23371
|
-
const liveFiles = readDirToFileMap(hubFolder);
|
|
23372
|
-
if (Object.keys(liveFiles).length === 0) {
|
|
23373
|
-
console.error(`Source hub folder has no files to freeze: ${path30.relative(gitRoot, hubFolder)}`);
|
|
23374
|
-
process.exit(1);
|
|
23375
|
-
}
|
|
23376
|
-
const sanitized = sanitizeWayaiSliceFiles(liveFiles);
|
|
23377
|
-
const relDest = path30.relative(gitRoot, dest);
|
|
23378
|
-
const relSrc = path30.relative(gitRoot, hubFolder);
|
|
23379
|
-
if (dryRun) {
|
|
23380
|
-
const existing = new Set(listDirRelFiles(dest));
|
|
23381
|
-
const nextKeys = new Set(Object.keys(sanitized));
|
|
23382
|
-
console.log(`Dry run \u2014 would freeze ${relSrc}/ \u2192 ${relDest}/ (locale ${targetLocale}):`);
|
|
23383
|
-
for (const rel of Object.keys(sanitized).sort((a, b) => a.localeCompare(b))) {
|
|
23384
|
-
console.log(` ${existing.has(rel) ? "update" : "create"} ${rel}`);
|
|
23385
|
-
}
|
|
23386
|
-
for (const rel of [...existing].filter((k) => !nextKeys.has(k)).sort((a, b) => a.localeCompare(b))) {
|
|
23387
|
-
console.log(` remove ${rel}`);
|
|
23388
|
-
}
|
|
23389
|
-
return;
|
|
23390
|
-
}
|
|
23391
|
-
const { written, removed } = writeSliceSnapshot(dest, sanitized);
|
|
23392
|
-
console.log(
|
|
23393
|
-
`Froze ${relSrc}/ \u2192 ${relDest}/ (locale ${targetLocale}): ${written.length} file${written.length === 1 ? "" : "s"} written${removed.length ? `, ${removed.length} removed` : ""}.`
|
|
23394
|
-
);
|
|
23395
|
-
console.log(`The slice is committed \u2014 re-push is stable across hub recreates. Next: \`wayai admin template push ${slug}\`.`);
|
|
23396
|
-
}
|
|
23397
|
-
async function runTemplatePull2(positional, flagArgs) {
|
|
23398
|
-
const slug = positional[0];
|
|
23399
|
-
if (!slug) {
|
|
23400
|
-
console.error("wayai admin template pull <slug> [--out DIR] [--json]");
|
|
23401
|
-
process.exit(1);
|
|
23402
|
-
}
|
|
23403
|
-
if (!TEMPLATE_SLUG_REGEX.test(slug)) {
|
|
23404
|
-
console.error(`Invalid template slug: ${slug}`);
|
|
23405
|
-
process.exit(1);
|
|
23406
|
-
}
|
|
23407
|
-
let outDir;
|
|
23408
|
-
let jsonOutput = false;
|
|
23409
|
-
for (let i = 0; i < flagArgs.length; i++) {
|
|
23410
|
-
if (flagArgs[i] === "--json") {
|
|
23411
|
-
jsonOutput = true;
|
|
23412
|
-
continue;
|
|
23413
|
-
}
|
|
23414
|
-
if (flagArgs[i] === "--out") {
|
|
23415
|
-
outDir = flagArgs[++i];
|
|
23416
|
-
if (!outDir) {
|
|
23417
|
-
console.error("--out requires a value");
|
|
23418
|
-
process.exit(1);
|
|
23419
|
-
}
|
|
23420
|
-
continue;
|
|
23421
|
-
}
|
|
23422
|
-
console.error(`Unknown flag: ${flagArgs[i]}`);
|
|
23423
|
-
process.exit(1);
|
|
23424
|
-
}
|
|
23425
|
-
const { config, accessToken } = await requireAuth();
|
|
23426
|
-
const client = new ApiClient({ apiUrl: config.api_url, accessToken });
|
|
23427
|
-
let detail;
|
|
23428
|
-
try {
|
|
23429
|
-
detail = await client.adminTemplatePull(slug);
|
|
23430
|
-
} catch (err) {
|
|
23431
|
-
exitOnApiError(err);
|
|
23432
|
-
throw err;
|
|
23433
|
-
}
|
|
23434
|
-
if (jsonOutput) {
|
|
23435
|
-
console.log(JSON.stringify(detail, null, 2));
|
|
23436
|
-
return;
|
|
23437
|
-
}
|
|
23438
|
-
const target = outDir ? path30.resolve(outDir) : path30.join(process.cwd(), "template-store-pull", slug);
|
|
23439
|
-
const written = writeFileMap(target, detail.files);
|
|
23440
|
-
console.log(`Pulled "${slug}" from the store \u2192 ${target} (${written.length} file${written.length === 1 ? "" : "s"}).`);
|
|
23441
|
-
const uses = detail.uses ?? [];
|
|
23442
|
-
const usesLabel = uses.length ? uses.map((u) => `${u.backend}/${u.endpoint}`).join(", ") : "(none)";
|
|
23443
|
-
console.log(`includes: wayai=${detail.includes.wayai} | uses: ${usesLabel}`);
|
|
23444
|
-
}
|
|
23445
22519
|
async function runSkillInstall(positional) {
|
|
23446
22520
|
const name = positional[0] ?? "wayai-admin";
|
|
23447
22521
|
if (!ADMIN_SKILL_NAME_REGEX.test(name)) {
|
|
@@ -23458,13 +22532,13 @@ async function runSkillInstall(positional) {
|
|
|
23458
22532
|
throw err;
|
|
23459
22533
|
}
|
|
23460
22534
|
const root = findGitRoot() ?? process.cwd();
|
|
23461
|
-
const present = HARNESS_SKILL_DIRS.filter((dir) => fs23.existsSync(
|
|
22535
|
+
const present = HARNESS_SKILL_DIRS.filter((dir) => fs23.existsSync(path29.join(root, dir)));
|
|
23462
22536
|
const targets = present.length > 0 ? present : HARNESS_SKILL_DIRS;
|
|
23463
22537
|
const fileCount = Object.keys(res.files).length;
|
|
23464
22538
|
const relDirs = targets.map((harness) => {
|
|
23465
|
-
const targetDir =
|
|
22539
|
+
const targetDir = path29.join(root, harness, "skills", name);
|
|
23466
22540
|
writeFileMap(targetDir, res.files);
|
|
23467
|
-
return `${
|
|
22541
|
+
return `${path29.relative(root, targetDir)}/`;
|
|
23468
22542
|
});
|
|
23469
22543
|
console.log(`Installed skill "${name}" (${fileCount} file${fileCount === 1 ? "" : "s"}) \u2192 ${relDirs.join(", ")}`);
|
|
23470
22544
|
console.log("Reload your agent (e.g. restart Claude Code) to pick up the skill.");
|
|
@@ -24183,11 +23257,6 @@ Usage:
|
|
|
24183
23257
|
wayai admin notice list [--status active|resolved] [--limit N] [--offset N] [--json]
|
|
24184
23258
|
wayai admin notice resolve <notice_id>
|
|
24185
23259
|
|
|
24186
|
-
wayai admin template push <slug> Publish a template from wayai-templates/<slug>/ into the store
|
|
24187
|
-
wayai admin template pull <slug> [--out DIR] [--json] Pull a published template from the store for inspection
|
|
24188
|
-
wayai admin template freeze <slug> [--locale <l>] [--from <hub>] [--dry-run]
|
|
24189
|
-
Snapshot a live hub into the template's committed slice (id/PII-scrubbed)
|
|
24190
|
-
|
|
24191
23260
|
wayai admin skill install [name] Install a private operator skill (default: wayai-admin) into each present harness's skills/ dir
|
|
24192
23261
|
|
|
24193
23262
|
wayai admin sandbox exec [--cmd "<c>" | <c>] --hub <id> --connection <id> [--egress open|allowlist|isolated] [--allow <host> ...] [--timeout <ms>] [--json]
|
|
@@ -24289,12 +23358,8 @@ var init_admin = __esm({
|
|
|
24289
23358
|
init_observability();
|
|
24290
23359
|
init_report_edit_args();
|
|
24291
23360
|
init_workspace();
|
|
24292
|
-
init_hub_binding();
|
|
24293
23361
|
init_skill_version();
|
|
24294
|
-
|
|
24295
|
-
init_template_files();
|
|
24296
|
-
init_template_sanitize();
|
|
24297
|
-
init_template_manifest();
|
|
23362
|
+
init_file_map();
|
|
24298
23363
|
init_contracts();
|
|
24299
23364
|
VALID_TYPES = dataExplorerDebugDoType.options;
|
|
24300
23365
|
VALID_ANALYTICS_TABLES = dataExplorerDebugAnalyticsTable.options;
|
|
@@ -24784,9 +23849,9 @@ init_sentry();
|
|
|
24784
23849
|
init_errors2();
|
|
24785
23850
|
init_mask_secrets();
|
|
24786
23851
|
init_utils();
|
|
24787
|
-
import { readFileSync as
|
|
23852
|
+
import { readFileSync as readFileSync19 } from "fs";
|
|
24788
23853
|
import { fileURLToPath as fileURLToPath2 } from "url";
|
|
24789
|
-
import { dirname as dirname9, join as
|
|
23854
|
+
import { dirname as dirname9, join as join27 } from "path";
|
|
24790
23855
|
|
|
24791
23856
|
// src/lib/version-refresh.ts
|
|
24792
23857
|
init_version_cache();
|
|
@@ -24794,7 +23859,7 @@ init_skill_version();
|
|
|
24794
23859
|
import { exec } from "child_process";
|
|
24795
23860
|
var REFRESH_TIMEOUT_MS = 1e4;
|
|
24796
23861
|
function refreshCliCache() {
|
|
24797
|
-
return new Promise((
|
|
23862
|
+
return new Promise((resolve5) => {
|
|
24798
23863
|
exec("npm view @wayai/cli version", { timeout: REFRESH_TIMEOUT_MS }, (err, stdout) => {
|
|
24799
23864
|
if (!err) {
|
|
24800
23865
|
const latest = stdout.trim();
|
|
@@ -24805,7 +23870,7 @@ function refreshCliCache() {
|
|
|
24805
23870
|
}
|
|
24806
23871
|
}
|
|
24807
23872
|
}
|
|
24808
|
-
|
|
23873
|
+
resolve5();
|
|
24809
23874
|
});
|
|
24810
23875
|
});
|
|
24811
23876
|
}
|
|
@@ -24831,8 +23896,8 @@ async function refreshSkillCache() {
|
|
|
24831
23896
|
}
|
|
24832
23897
|
async function refreshAdminSkillCache() {
|
|
24833
23898
|
let timer;
|
|
24834
|
-
const deadline = new Promise((
|
|
24835
|
-
timer = setTimeout(
|
|
23899
|
+
const deadline = new Promise((resolve5) => {
|
|
23900
|
+
timer = setTimeout(resolve5, REFRESH_TIMEOUT_MS);
|
|
24836
23901
|
});
|
|
24837
23902
|
await Promise.race([deadline, fetchAndCacheAdminSkillVersion().catch(() => {
|
|
24838
23903
|
})]);
|
|
@@ -24942,7 +24007,7 @@ Run \`wayai admin skill install\` to update.`);
|
|
|
24942
24007
|
|
|
24943
24008
|
// src/index.ts
|
|
24944
24009
|
var __dirname = dirname9(fileURLToPath2(import.meta.url));
|
|
24945
|
-
var pkg = JSON.parse(
|
|
24010
|
+
var pkg = JSON.parse(readFileSync19(join27(__dirname, "..", "package.json"), "utf-8"));
|
|
24946
24011
|
var [, , command, ...args] = process.argv;
|
|
24947
24012
|
var isBackgroundRefresh = command === REFRESH_COMMAND;
|
|
24948
24013
|
if (!isBackgroundRefresh) initSentry(command, pkg.version);
|
|
@@ -25121,11 +24186,6 @@ async function main() {
|
|
|
25121
24186
|
await listCommand2(args);
|
|
25122
24187
|
break;
|
|
25123
24188
|
}
|
|
25124
|
-
case "template": {
|
|
25125
|
-
const { templateCommand: templateCommand2 } = await Promise.resolve().then(() => (init_templates(), templates_exports));
|
|
25126
|
-
await templateCommand2(args);
|
|
25127
|
-
break;
|
|
25128
|
-
}
|
|
25129
24189
|
case "admin": {
|
|
25130
24190
|
const { adminCommand: adminCommand2 } = await Promise.resolve().then(() => (init_admin(), admin_exports));
|
|
25131
24191
|
await adminCommand2(args);
|
|
@@ -25201,8 +24261,6 @@ Commands:
|
|
|
25201
24261
|
sync-skills Sync skills to Anthropic/OpenAI provider connections
|
|
25202
24262
|
sync-mcp Re-discover an MCP connection's tools (refresh stale schemas)
|
|
25203
24263
|
list List organizations and hubs
|
|
25204
|
-
template list List ready-made hub templates
|
|
25205
|
-
template pull Write a template's WayAI slice into wayai-ws/hubs/<slug>/
|
|
25206
24264
|
report create Report a platform bug (submits to the triage queue)
|
|
25207
24265
|
report edit Amend your own pending report (title/description/error/steps/context)
|
|
25208
24266
|
update Update CLI to the latest version
|