@wayai/cli 0.3.373 → 0.3.374
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 +133 -121
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -17306,60 +17306,6 @@ var init_chunk_4LXDRTO4 = __esm({
|
|
|
17306
17306
|
}
|
|
17307
17307
|
});
|
|
17308
17308
|
|
|
17309
|
-
// ../../packages/core/dist/chunk-LBDH7LCG.js
|
|
17310
|
-
var CALL_OPENING_LANGUAGES, callOpeningLanguage, CALL_OPENING_MAX_DURATION_MS, CALL_OPENING_MAX_BYTES, CALL_OPENING_CAPTION_MAX_CHARS, CALL_OPENING_CONTENT_TYPES, callOpeningContentType, callOpeningHash, callOpeningCaption, storedCallOpening, MAX_CALL_OPENING_ENCODED_BYTES, MAX_CALL_OPENING_BODY_BYTES, agentCallOpeningParams, putAgentCallOpeningBody, deleteAgentCallOpeningQuery, callOpeningParam, callOpeningQuery;
|
|
17311
|
-
var init_chunk_LBDH7LCG = __esm({
|
|
17312
|
-
"../../packages/core/dist/chunk-LBDH7LCG.js"() {
|
|
17313
|
-
"use strict";
|
|
17314
|
-
init_chunk_4LXDRTO4();
|
|
17315
|
-
init_zod();
|
|
17316
|
-
CALL_OPENING_LANGUAGES = ["en", "pt", "es"];
|
|
17317
|
-
callOpeningLanguage = external_exports.enum(CALL_OPENING_LANGUAGES);
|
|
17318
|
-
CALL_OPENING_MAX_DURATION_MS = 15e3;
|
|
17319
|
-
CALL_OPENING_MAX_BYTES = 1024 * 1024;
|
|
17320
|
-
CALL_OPENING_CAPTION_MAX_CHARS = 500;
|
|
17321
|
-
CALL_OPENING_CONTENT_TYPES = ["audio/mpeg", "audio/mp4"];
|
|
17322
|
-
callOpeningContentType = external_exports.enum(CALL_OPENING_CONTENT_TYPES);
|
|
17323
|
-
callOpeningHash = external_exports.string().regex(CALL_OPENING_HASH_REGEX, "Expected a sha256 hex digest");
|
|
17324
|
-
callOpeningCaption = external_exports.string().trim().min(1).max(CALL_OPENING_CAPTION_MAX_CHARS);
|
|
17325
|
-
storedCallOpening = external_exports.object({
|
|
17326
|
-
hash: callOpeningHash,
|
|
17327
|
-
content_type: callOpeningContentType,
|
|
17328
|
-
duration_ms: external_exports.number().int().positive().max(CALL_OPENING_MAX_DURATION_MS),
|
|
17329
|
-
file_size: external_exports.number().int().positive().max(CALL_OPENING_MAX_BYTES),
|
|
17330
|
-
caption: callOpeningCaption
|
|
17331
|
-
});
|
|
17332
|
-
MAX_CALL_OPENING_ENCODED_BYTES = Math.ceil(CALL_OPENING_MAX_BYTES / 3) * 4 + 16;
|
|
17333
|
-
MAX_CALL_OPENING_BODY_BYTES = MAX_CALL_OPENING_ENCODED_BYTES + 16 * 1024;
|
|
17334
|
-
agentCallOpeningParams = external_exports.object({
|
|
17335
|
-
id: external_exports.string().uuid(),
|
|
17336
|
-
language: callOpeningLanguage
|
|
17337
|
-
});
|
|
17338
|
-
putAgentCallOpeningBody = external_exports.object({
|
|
17339
|
-
hub_id: external_exports.string().uuid(),
|
|
17340
|
-
caption: callOpeningCaption,
|
|
17341
|
-
/**
|
|
17342
|
-
* The audio, base64. Absent: the language's current audio stays and only the caption
|
|
17343
|
-
* changes, which needs an opening already set for the language.
|
|
17344
|
-
*/
|
|
17345
|
-
file_data: external_exports.string().min(1).max(MAX_CALL_OPENING_ENCODED_BYTES).optional()
|
|
17346
|
-
});
|
|
17347
|
-
deleteAgentCallOpeningQuery = external_exports.object({
|
|
17348
|
-
hub_id: external_exports.string().uuid()
|
|
17349
|
-
});
|
|
17350
|
-
callOpeningParam = external_exports.object({ language: callOpeningLanguage });
|
|
17351
|
-
callOpeningQuery = external_exports.object({
|
|
17352
|
-
hub_id: external_exports.string().uuid(),
|
|
17353
|
-
/**
|
|
17354
|
-
* The opening the caller's app was told of (`HubCallOpening.version`, `callOpeningVersion`).
|
|
17355
|
-
* Any other answers 404 — the audio or the caption changed since — and the app plays the
|
|
17356
|
-
* platform's opening, so a caption never shows over audio it does not describe.
|
|
17357
|
-
*/
|
|
17358
|
-
v: external_exports.string().regex(/^[a-f0-9]{64}\.[a-f0-9]{8}$/, "Expected a call opening version")
|
|
17359
|
-
});
|
|
17360
|
-
}
|
|
17361
|
-
});
|
|
17362
|
-
|
|
17363
17309
|
// ../../packages/core/dist/chunk-AMMLEB4T.js
|
|
17364
17310
|
function isIanaTimezone(timezone) {
|
|
17365
17311
|
try {
|
|
@@ -18157,6 +18103,60 @@ var init_chunk_NF2TUBZ4 = __esm({
|
|
|
18157
18103
|
}
|
|
18158
18104
|
});
|
|
18159
18105
|
|
|
18106
|
+
// ../../packages/core/dist/chunk-LBDH7LCG.js
|
|
18107
|
+
var CALL_OPENING_LANGUAGES, callOpeningLanguage, CALL_OPENING_MAX_DURATION_MS, CALL_OPENING_MAX_BYTES, CALL_OPENING_CAPTION_MAX_CHARS, CALL_OPENING_CONTENT_TYPES, callOpeningContentType, callOpeningHash, callOpeningCaption, storedCallOpening, MAX_CALL_OPENING_ENCODED_BYTES, MAX_CALL_OPENING_BODY_BYTES, agentCallOpeningParams, putAgentCallOpeningBody, deleteAgentCallOpeningQuery, callOpeningParam, callOpeningQuery;
|
|
18108
|
+
var init_chunk_LBDH7LCG = __esm({
|
|
18109
|
+
"../../packages/core/dist/chunk-LBDH7LCG.js"() {
|
|
18110
|
+
"use strict";
|
|
18111
|
+
init_chunk_4LXDRTO4();
|
|
18112
|
+
init_zod();
|
|
18113
|
+
CALL_OPENING_LANGUAGES = ["en", "pt", "es"];
|
|
18114
|
+
callOpeningLanguage = external_exports.enum(CALL_OPENING_LANGUAGES);
|
|
18115
|
+
CALL_OPENING_MAX_DURATION_MS = 15e3;
|
|
18116
|
+
CALL_OPENING_MAX_BYTES = 1024 * 1024;
|
|
18117
|
+
CALL_OPENING_CAPTION_MAX_CHARS = 500;
|
|
18118
|
+
CALL_OPENING_CONTENT_TYPES = ["audio/mpeg", "audio/mp4"];
|
|
18119
|
+
callOpeningContentType = external_exports.enum(CALL_OPENING_CONTENT_TYPES);
|
|
18120
|
+
callOpeningHash = external_exports.string().regex(CALL_OPENING_HASH_REGEX, "Expected a sha256 hex digest");
|
|
18121
|
+
callOpeningCaption = external_exports.string().trim().min(1).max(CALL_OPENING_CAPTION_MAX_CHARS);
|
|
18122
|
+
storedCallOpening = external_exports.object({
|
|
18123
|
+
hash: callOpeningHash,
|
|
18124
|
+
content_type: callOpeningContentType,
|
|
18125
|
+
duration_ms: external_exports.number().int().positive().max(CALL_OPENING_MAX_DURATION_MS),
|
|
18126
|
+
file_size: external_exports.number().int().positive().max(CALL_OPENING_MAX_BYTES),
|
|
18127
|
+
caption: callOpeningCaption
|
|
18128
|
+
});
|
|
18129
|
+
MAX_CALL_OPENING_ENCODED_BYTES = Math.ceil(CALL_OPENING_MAX_BYTES / 3) * 4 + 16;
|
|
18130
|
+
MAX_CALL_OPENING_BODY_BYTES = MAX_CALL_OPENING_ENCODED_BYTES + 16 * 1024;
|
|
18131
|
+
agentCallOpeningParams = external_exports.object({
|
|
18132
|
+
id: external_exports.string().uuid(),
|
|
18133
|
+
language: callOpeningLanguage
|
|
18134
|
+
});
|
|
18135
|
+
putAgentCallOpeningBody = external_exports.object({
|
|
18136
|
+
hub_id: external_exports.string().uuid(),
|
|
18137
|
+
caption: callOpeningCaption,
|
|
18138
|
+
/**
|
|
18139
|
+
* The audio, base64. Absent: the language's current audio stays and only the caption
|
|
18140
|
+
* changes, which needs an opening already set for the language.
|
|
18141
|
+
*/
|
|
18142
|
+
file_data: external_exports.string().min(1).max(MAX_CALL_OPENING_ENCODED_BYTES).optional()
|
|
18143
|
+
});
|
|
18144
|
+
deleteAgentCallOpeningQuery = external_exports.object({
|
|
18145
|
+
hub_id: external_exports.string().uuid()
|
|
18146
|
+
});
|
|
18147
|
+
callOpeningParam = external_exports.object({ language: callOpeningLanguage });
|
|
18148
|
+
callOpeningQuery = external_exports.object({
|
|
18149
|
+
hub_id: external_exports.string().uuid(),
|
|
18150
|
+
/**
|
|
18151
|
+
* The opening the caller's app was told of (`HubCallOpening.version`, `callOpeningVersion`).
|
|
18152
|
+
* Any other answers 404 — the audio or the caption changed since — and the app plays the
|
|
18153
|
+
* platform's opening, so a caption never shows over audio it does not describe.
|
|
18154
|
+
*/
|
|
18155
|
+
v: external_exports.string().regex(/^[a-f0-9]{64}\.[a-f0-9]{8}$/, "Expected a call opening version")
|
|
18156
|
+
});
|
|
18157
|
+
}
|
|
18158
|
+
});
|
|
18159
|
+
|
|
18160
18160
|
// ../../packages/core/dist/chunk-S4VDZ7PZ.js
|
|
18161
18161
|
function slugifySkillName(name) {
|
|
18162
18162
|
return slugifyKebab(name, 64);
|
|
@@ -18170,7 +18170,7 @@ var init_chunk_S4VDZ7PZ = __esm({
|
|
|
18170
18170
|
}
|
|
18171
18171
|
});
|
|
18172
18172
|
|
|
18173
|
-
// ../../packages/core/dist/chunk-
|
|
18173
|
+
// ../../packages/core/dist/chunk-3PD6DFFD.js
|
|
18174
18174
|
function declaresNoConnection(agent) {
|
|
18175
18175
|
return agent.connection === null && !agent.connection_id;
|
|
18176
18176
|
}
|
|
@@ -18902,12 +18902,11 @@ function skillSectionsAsResources(scope) {
|
|
|
18902
18902
|
};
|
|
18903
18903
|
}
|
|
18904
18904
|
var 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, hubAsCodeKanbanFollowupSchema, hubAsCodeKanbanOutcomeSchema, hubAsCodeKanbanStatusSchema, hubAsCodeLaneSchema, hubAsCodePageSchema, MAX_HUB_AS_CODE_PAGE_MANIFEST_CHARS, hubAsCodePagesSchema, hubAsCodeCallOpeningSchema, hubAsCodeCallOpeningFileSchema, MAX_CALL_OPENING_CARRIERS, MAX_CALL_OPENING_AGGREGATE_ENCODED_BYTES, hubAsCodeEvaluationVariableSchema, hubAsCodeNativeToolSchema, hubAsCodeMcpToolSchema, hubAsCodeCustomToolSchema, hubAsCodeStateSchema, hubAsCodeTeamSchema, hubAsCodeResourceFileSchema, hubAsCodeResourceSchema, hubAsCodeAgentResourceSchema, hubAsCodeDelegationToolSchema, hubAsCodeAgentSchema, HUB_AS_CODE_AGENT_KEYS, HUB_AS_CODE_AGENT_TOOL_KEYS, orgAsCodeResourceFolderSchema, orgAsCodeResourceSchema, orgResourcesPayloadSchema, hubAsCodeAutomationSchema, HUB_AS_CODE_AUTOMATION_KEYS, HUB_AS_CODE_AUTOMATION_TRIGGER_KEYS, HUB_AS_CODE_AUTOMATION_TARGET_KEYS, HUB_AS_CODE_AUTOMATION_ACTION_KEYS, HUB_AS_CODE_AUTOMATION_GATE_KEYS, hubAsCodeContactListSchema, HUB_AS_CODE_CONTACT_LIST_KEYS, HUB_AS_CODE_CONTACT_LIST_FILTER_KEYS, hubAsCodeEvalMessageFields, hubAsCodeHistoryTurnSchema, hubAsCodeEvalSchema, hubAsCodeEvalAttachmentFileSchema, hubAsCodeJourneyTurnSchema, hubAsCodeJourneyStepOverrideSchema, hubAsCodeJourneySchema, uuidPattern, ciUuidSchema, flagEntriesOf, boundedHubAsCodeResourcesSchema, isPlainObject, MIN_SKILLS_LAYOUT_CLI, MAX_HUB_AS_CODE_DEPTH, NAMED_DEPTH_SEGMENTS, NAMED_DEPTH_KEY_CHARS, fieldName, hubAsCodeConfigObjectSchema, hubAsCodeConfigSchema, hubAsCodeConnectionSchema, hubAsCodePayloadSchema, ciPullHubIdParam, ciBranchParam, ciPullQuery, ciHubsQuery, ciLookupQuery, ciBranchesQuery, ciDiffDirectionSchema, ciSyncBody, ciPushBody, ciDiffBody, ciPublishBody, ciPublishPreviewBody, ciSyncMcpBody, ciOrgResourcesParam, orgResourcesConfigSchema, ciOrgResourcesPushBody, ciOrgResourcesDiffBody, ciDiffHunkSectionSchema, ciDiffHunkSchema, PAGE_DESIGN_RULES, ciPageDesignFindingSchema, ciDiffResponseFields, ciDiffResponseSchema, ciOrgSkillsDiffResponseSchema, ciHubIdentitySchema, ciLookupResponseSchema, ciOrganizationsResponseSchema, ciCreateOrganizationResponseSchema, ciHubListItemSchema, ciHubListResponseSchema, CI_APPLY_ENTITY_KINDS, CI_APPLY_OPERATIONS, ciApplyErrorBaseSchema, ciApplyErrorSchema, ciSyncCountSchema, ciSyncChangesSchema, ciSyncWarningSchema, CI_SKIPPABLE_TOOL_GROUPS, ciSkippedEntrySchema, ciSyncResponseSchema, ciPublishResponseSchema, ciMcpDriftEntrySchema, ciSyncMcpResponseSchema, ciPublishPreviewResponseSchema, ciBranchInfoSchema, ciBranchListResponseSchema, ciBranchDeleteResponseSchema, ciOrgResourcesPullFileSchema, ciOrgResourcesPullFolderSchema, ciOrgResourcesPullResourceSchema, ciOrgResourcesPullResponseSchema, ciOrgResourcesPushResponseSchema;
|
|
18905
|
-
var
|
|
18906
|
-
"../../packages/core/dist/chunk-
|
|
18905
|
+
var init_chunk_3PD6DFFD = __esm({
|
|
18906
|
+
"../../packages/core/dist/chunk-3PD6DFFD.js"() {
|
|
18907
18907
|
"use strict";
|
|
18908
18908
|
init_chunk_QG3XMUEN();
|
|
18909
18909
|
init_chunk_EBUWHIFV();
|
|
18910
|
-
init_chunk_LBDH7LCG();
|
|
18911
18910
|
init_chunk_TIGPOH22();
|
|
18912
18911
|
init_chunk_QT7R3TGR();
|
|
18913
18912
|
init_chunk_ZANBA4K4();
|
|
@@ -18916,6 +18915,7 @@ var init_chunk_HTB6XZYH = __esm({
|
|
|
18916
18915
|
init_chunk_JP7XIMUA();
|
|
18917
18916
|
init_chunk_C2UEA2KW();
|
|
18918
18917
|
init_chunk_NF2TUBZ4();
|
|
18918
|
+
init_chunk_LBDH7LCG();
|
|
18919
18919
|
init_chunk_4LXDRTO4();
|
|
18920
18920
|
init_chunk_S4VDZ7PZ();
|
|
18921
18921
|
init_chunk_FBV7NLKO();
|
|
@@ -20274,10 +20274,9 @@ var init_contracts = __esm({
|
|
|
20274
20274
|
init_chunk_R6Y377AW();
|
|
20275
20275
|
init_chunk_UAOHHCW5();
|
|
20276
20276
|
init_chunk_ULQGJUXZ();
|
|
20277
|
-
|
|
20277
|
+
init_chunk_3PD6DFFD();
|
|
20278
20278
|
init_chunk_QG3XMUEN();
|
|
20279
20279
|
init_chunk_EBUWHIFV();
|
|
20280
|
-
init_chunk_LBDH7LCG();
|
|
20281
20280
|
init_chunk_TIGPOH22();
|
|
20282
20281
|
init_chunk_D3EP4TDU();
|
|
20283
20282
|
init_chunk_QT7R3TGR();
|
|
@@ -20300,6 +20299,7 @@ var init_contracts = __esm({
|
|
|
20300
20299
|
init_chunk_NF2TUBZ4();
|
|
20301
20300
|
init_chunk_2YEGUQR7();
|
|
20302
20301
|
init_chunk_AHISKXHA();
|
|
20302
|
+
init_chunk_LBDH7LCG();
|
|
20303
20303
|
init_chunk_4LXDRTO4();
|
|
20304
20304
|
init_chunk_AMMLEB4T();
|
|
20305
20305
|
init_chunk_S4VDZ7PZ();
|
|
@@ -20573,6 +20573,35 @@ function hubPayloadFromPull(wire) {
|
|
|
20573
20573
|
function orgPayloadFromPull(wire) {
|
|
20574
20574
|
return withSkillsSection(wire);
|
|
20575
20575
|
}
|
|
20576
|
+
function assertHubConfigIds(config, configFile) {
|
|
20577
|
+
if (!config.hub_id) {
|
|
20578
|
+
throw hubFolderRefusal(`Missing hub_id in ${configFile}`);
|
|
20579
|
+
}
|
|
20580
|
+
if (!config.hub_environment) {
|
|
20581
|
+
throw hubFolderRefusal(`Missing hub_environment in ${configFile}`);
|
|
20582
|
+
}
|
|
20583
|
+
}
|
|
20584
|
+
function assertOneSkillsSection(config, configFileName) {
|
|
20585
|
+
if ("skills" in config && "resources" in config) {
|
|
20586
|
+
throw hubFolderRefusal(`${configFileName} lists both \`skills:\` and \`resources:\`: name the skills under \`skills:\` only.`);
|
|
20587
|
+
}
|
|
20588
|
+
}
|
|
20589
|
+
function addUniqueEval(seen, evalEntry, setName, fileName) {
|
|
20590
|
+
const key = `${evalEntry.name}|${setName ?? ""}`;
|
|
20591
|
+
if (seen.has(key)) {
|
|
20592
|
+
const where = setName ? `scenario set "${setName}"` : "root";
|
|
20593
|
+
throw hubFolderRefusal(
|
|
20594
|
+
`Duplicate eval at ${where}: "${evalEntry.name}" (in ${fileName}). Each (name, scenario set) pair must be unique.`
|
|
20595
|
+
);
|
|
20596
|
+
}
|
|
20597
|
+
seen.add(key);
|
|
20598
|
+
}
|
|
20599
|
+
function addUniqueJourney(seen, journey, fileName) {
|
|
20600
|
+
if (seen.has(journey.name)) {
|
|
20601
|
+
throw hubFolderRefusal(`Duplicate journey: "${journey.name}" (in ${fileName}). Each journey name must be unique.`);
|
|
20602
|
+
}
|
|
20603
|
+
seen.add(journey.name);
|
|
20604
|
+
}
|
|
20576
20605
|
function hubPayloadHead(config) {
|
|
20577
20606
|
const payload = {
|
|
20578
20607
|
version: config.version || 1,
|
|
@@ -20769,7 +20798,27 @@ function pageFromFiles(folder, manifest, html) {
|
|
|
20769
20798
|
if (htmlIssue) throw hubFolderRefusal(`${rel}/${PAGE_HTML_FILE}: ${htmlIssue}.`);
|
|
20770
20799
|
return { manifest: { slug: folder, ...manifest }, html };
|
|
20771
20800
|
}
|
|
20772
|
-
|
|
20801
|
+
function rewriteCallOpeningsToLocalPaths(payload) {
|
|
20802
|
+
const byHash = new Map((payload.call_opening_files ?? []).map((file) => [file.hash, file]));
|
|
20803
|
+
const downloads = [];
|
|
20804
|
+
for (const agent of payload.agents ?? []) {
|
|
20805
|
+
const openings = agent.call_openings;
|
|
20806
|
+
if (!openings || typeof openings !== "object") continue;
|
|
20807
|
+
for (const language of CALL_OPENING_LANGUAGES) {
|
|
20808
|
+
const opening = openings[language];
|
|
20809
|
+
if (!opening || typeof opening.hash !== "string") continue;
|
|
20810
|
+
const carrier = byHash.get(opening.hash);
|
|
20811
|
+
const ext = carrier?.content_type === "audio/mp4" ? ".m4a" : ".mp3";
|
|
20812
|
+
const relPath = `${CALL_OPENINGS_DIR}/${slugifySkillName(agent.name)}-${language}${ext}`;
|
|
20813
|
+
const { hash: hash2, ...rest } = opening;
|
|
20814
|
+
openings[language] = { ...rest, file: relPath };
|
|
20815
|
+
if (carrier?.download_url) downloads.push({ relPath, url: carrier.download_url, hash: hash2 });
|
|
20816
|
+
}
|
|
20817
|
+
}
|
|
20818
|
+
delete payload.call_opening_files;
|
|
20819
|
+
return downloads;
|
|
20820
|
+
}
|
|
20821
|
+
var PAGES_DIR, PAGE_MANIFEST_FILE, PAGE_HTML_FILE, PAGE_MANIFEST_DEFAULTS, PAGE_TOOL_NOTIFY_DEFAULT, SKILLS_DIR, CALL_OPENINGS_DIR;
|
|
20773
20822
|
var init_hub_folder = __esm({
|
|
20774
20823
|
"../../packages/core/dist/hub-folder.js"() {
|
|
20775
20824
|
"use strict";
|
|
@@ -20777,6 +20826,7 @@ var init_hub_folder = __esm({
|
|
|
20777
20826
|
init_chunk_NF2TUBZ4();
|
|
20778
20827
|
init_chunk_2YEGUQR7();
|
|
20779
20828
|
init_chunk_AHISKXHA();
|
|
20829
|
+
init_chunk_LBDH7LCG();
|
|
20780
20830
|
init_chunk_4LXDRTO4();
|
|
20781
20831
|
init_chunk_AMMLEB4T();
|
|
20782
20832
|
init_chunk_S4VDZ7PZ();
|
|
@@ -20802,6 +20852,7 @@ var init_hub_folder = __esm({
|
|
|
20802
20852
|
tools: [{ connection: "x", tool: "x" }]
|
|
20803
20853
|
}).tools[0].notify;
|
|
20804
20854
|
SKILLS_DIR = SKILL_NAMESPACE;
|
|
20855
|
+
CALL_OPENINGS_DIR = "call-openings";
|
|
20805
20856
|
}
|
|
20806
20857
|
});
|
|
20807
20858
|
|
|
@@ -26329,26 +26380,6 @@ function applyCallOpeningFiles(hubFolder, payload) {
|
|
|
26329
26380
|
}
|
|
26330
26381
|
if (carriers.size > 0) payload.call_opening_files = [...carriers.values()];
|
|
26331
26382
|
}
|
|
26332
|
-
function rewriteCallOpeningsToLocalPaths(payload) {
|
|
26333
|
-
const byHash = new Map((payload.call_opening_files ?? []).map((file) => [file.hash, file]));
|
|
26334
|
-
const downloads = [];
|
|
26335
|
-
for (const agent of payload.agents ?? []) {
|
|
26336
|
-
const openings = agent.call_openings;
|
|
26337
|
-
if (!openings || typeof openings !== "object") continue;
|
|
26338
|
-
for (const language of CALL_OPENING_LANGUAGES) {
|
|
26339
|
-
const opening = openings[language];
|
|
26340
|
-
if (!opening || typeof opening.hash !== "string") continue;
|
|
26341
|
-
const carrier = byHash.get(opening.hash);
|
|
26342
|
-
const ext = carrier?.content_type === "audio/mp4" ? ".m4a" : ".mp3";
|
|
26343
|
-
const relPath = `${CALL_OPENINGS_DIR}/${slugify2(agent.name)}-${language}${ext}`;
|
|
26344
|
-
const { hash: hash2, ...rest } = opening;
|
|
26345
|
-
openings[language] = { ...rest, file: relPath };
|
|
26346
|
-
if (carrier?.download_url) downloads.push({ relPath, url: carrier.download_url, hash: hash2 });
|
|
26347
|
-
}
|
|
26348
|
-
}
|
|
26349
|
-
delete payload.call_opening_files;
|
|
26350
|
-
return downloads;
|
|
26351
|
-
}
|
|
26352
26383
|
async function downloadCallOpenings(hubFolder, downloads) {
|
|
26353
26384
|
const dir = path15.resolve(hubFolder, CALL_OPENINGS_DIR);
|
|
26354
26385
|
const result = { changed: [], removed: [] };
|
|
@@ -26388,16 +26419,15 @@ async function downloadCallOpenings(hubFolder, downloads) {
|
|
|
26388
26419
|
}
|
|
26389
26420
|
return result;
|
|
26390
26421
|
}
|
|
26391
|
-
var CALL_OPENINGS_DIR;
|
|
26392
26422
|
var init_call_openings = __esm({
|
|
26393
26423
|
"src/lib/call-openings.ts"() {
|
|
26394
26424
|
"use strict";
|
|
26395
26425
|
init_contracts();
|
|
26426
|
+
init_hub_folder();
|
|
26396
26427
|
init_resource_files();
|
|
26397
26428
|
init_fs_safety();
|
|
26398
26429
|
init_expected();
|
|
26399
|
-
|
|
26400
|
-
CALL_OPENINGS_DIR = "call-openings";
|
|
26430
|
+
init_hub_folder();
|
|
26401
26431
|
}
|
|
26402
26432
|
});
|
|
26403
26433
|
|
|
@@ -26481,14 +26511,7 @@ function parseHubFolder(hubFolder, opts) {
|
|
|
26481
26511
|
if (!config || typeof config !== "object") {
|
|
26482
26512
|
throw expected(`Invalid YAML in ${yamlPath}`);
|
|
26483
26513
|
}
|
|
26484
|
-
if (!opts?.allowNewHub)
|
|
26485
|
-
if (!config.hub_id) {
|
|
26486
|
-
throw expected(`Missing hub_id in ${yamlPath}`);
|
|
26487
|
-
}
|
|
26488
|
-
if (!config.hub_environment) {
|
|
26489
|
-
throw expected(`Missing hub_environment in ${yamlPath}`);
|
|
26490
|
-
}
|
|
26491
|
-
}
|
|
26514
|
+
if (!opts?.allowNewHub) assertHubConfigIds(config, yamlPath);
|
|
26492
26515
|
const unreadable = (relPath, reason3, unreadableOpts) => {
|
|
26493
26516
|
if (opts?.strict) throw expected(`${relPath}: ${reason3}`);
|
|
26494
26517
|
if (!unreadableOpts?.silent) console.warn(` Warning: skipping ${relPath} (${reason3})`);
|
|
@@ -26582,14 +26605,7 @@ function collectEval(evals, seen, filePath3, relPath, setName, hubFolder, bytesB
|
|
|
26582
26605
|
unreadable(relPath, NOT_A_YAML_OBJECT);
|
|
26583
26606
|
return;
|
|
26584
26607
|
}
|
|
26585
|
-
|
|
26586
|
-
if (seen.has(key)) {
|
|
26587
|
-
const where = setName ? `scenario set "${setName}"` : "root";
|
|
26588
|
-
throw expected(
|
|
26589
|
-
`Duplicate eval at ${where}: "${evalEntry.name}" (in ${path17.basename(filePath3)}). Each (name, scenario set) pair must be unique.`
|
|
26590
|
-
);
|
|
26591
|
-
}
|
|
26592
|
-
seen.add(key);
|
|
26608
|
+
addUniqueEval(seen, evalEntry, setName, path17.basename(filePath3));
|
|
26593
26609
|
evals.push(evalEntry);
|
|
26594
26610
|
}
|
|
26595
26611
|
function parseEvalYaml(filePath3, relPath, setName, hubFolder, bytesByHash) {
|
|
@@ -26629,12 +26645,7 @@ function scanJourneyYamlFiles(hubFolder, bytesByHash, unreadable) {
|
|
|
26629
26645
|
unreadable(`journeys/${entry.name}`, NOT_A_YAML_OBJECT);
|
|
26630
26646
|
continue;
|
|
26631
26647
|
}
|
|
26632
|
-
|
|
26633
|
-
throw expected(
|
|
26634
|
-
`Duplicate journey: "${journeyEntry.name}" (in ${entry.name}). Each journey name must be unique.`
|
|
26635
|
-
);
|
|
26636
|
-
}
|
|
26637
|
-
seen.add(journeyEntry.name);
|
|
26648
|
+
addUniqueJourney(seen, journeyEntry, entry.name);
|
|
26638
26649
|
journeys.push(journeyEntry);
|
|
26639
26650
|
}
|
|
26640
26651
|
return journeys;
|
|
@@ -26718,10 +26729,7 @@ function assertSkillsLayout(hubFolder) {
|
|
|
26718
26729
|
if (parts.length > 0) throw oldLayoutRefusal(hubFolder, parts);
|
|
26719
26730
|
}
|
|
26720
26731
|
function parseSkills(hubFolder, config, unreadable) {
|
|
26721
|
-
|
|
26722
|
-
const file = path17.basename(resolveHubYamlPath(hubFolder) ?? "hub.yaml");
|
|
26723
|
-
throw expected(`${file} lists both \`skills:\` and \`resources:\`: name the skills under \`skills:\` only.`);
|
|
26724
|
-
}
|
|
26732
|
+
assertOneSkillsSection(config, path17.basename(resolveHubYamlPath(hubFolder) ?? "hub.yaml"));
|
|
26725
26733
|
const old = !("skills" in config) && "resources" in config;
|
|
26726
26734
|
const entries = (old ? config.resources : config.skills) ?? [];
|
|
26727
26735
|
const root = path17.join(hubFolder, old ? OLD_RESOURCES_DIR : SKILLS_DIR);
|
|
@@ -27161,10 +27169,9 @@ var init_hub_materializer = __esm({
|
|
|
27161
27169
|
var init_ci = __esm({
|
|
27162
27170
|
"../../packages/core/dist/contracts/ci.js"() {
|
|
27163
27171
|
"use strict";
|
|
27164
|
-
|
|
27172
|
+
init_chunk_3PD6DFFD();
|
|
27165
27173
|
init_chunk_QG3XMUEN();
|
|
27166
27174
|
init_chunk_EBUWHIFV();
|
|
27167
|
-
init_chunk_LBDH7LCG();
|
|
27168
27175
|
init_chunk_TIGPOH22();
|
|
27169
27176
|
init_chunk_D3EP4TDU();
|
|
27170
27177
|
init_chunk_QT7R3TGR();
|
|
@@ -27179,6 +27186,7 @@ var init_ci = __esm({
|
|
|
27179
27186
|
init_chunk_NF2TUBZ4();
|
|
27180
27187
|
init_chunk_2YEGUQR7();
|
|
27181
27188
|
init_chunk_AHISKXHA();
|
|
27189
|
+
init_chunk_LBDH7LCG();
|
|
27182
27190
|
init_chunk_4LXDRTO4();
|
|
27183
27191
|
init_chunk_AMMLEB4T();
|
|
27184
27192
|
init_chunk_S4VDZ7PZ();
|
|
@@ -27692,10 +27700,9 @@ var nativeEntryName, SKIPPABLE_ENTRY_IDENTITY;
|
|
|
27692
27700
|
var init_skipped_tool_entries = __esm({
|
|
27693
27701
|
"../../packages/core/dist/skipped-tool-entries.js"() {
|
|
27694
27702
|
"use strict";
|
|
27695
|
-
|
|
27703
|
+
init_chunk_3PD6DFFD();
|
|
27696
27704
|
init_chunk_QG3XMUEN();
|
|
27697
27705
|
init_chunk_EBUWHIFV();
|
|
27698
|
-
init_chunk_LBDH7LCG();
|
|
27699
27706
|
init_chunk_TIGPOH22();
|
|
27700
27707
|
init_chunk_D3EP4TDU();
|
|
27701
27708
|
init_chunk_QT7R3TGR();
|
|
@@ -27710,6 +27717,7 @@ var init_skipped_tool_entries = __esm({
|
|
|
27710
27717
|
init_chunk_NF2TUBZ4();
|
|
27711
27718
|
init_chunk_2YEGUQR7();
|
|
27712
27719
|
init_chunk_AHISKXHA();
|
|
27720
|
+
init_chunk_LBDH7LCG();
|
|
27713
27721
|
init_chunk_4LXDRTO4();
|
|
27714
27722
|
init_chunk_AMMLEB4T();
|
|
27715
27723
|
init_chunk_S4VDZ7PZ();
|
|
@@ -41120,6 +41128,10 @@ function parseArgs17(args2) {
|
|
|
41120
41128
|
console.error("--set requires a value.");
|
|
41121
41129
|
process.exit(1);
|
|
41122
41130
|
}
|
|
41131
|
+
if (!setName.trim()) {
|
|
41132
|
+
console.error(`Invalid --set value "${setName}". A scenario set name cannot be blank.`);
|
|
41133
|
+
process.exit(1);
|
|
41134
|
+
}
|
|
41123
41135
|
if (!isValidSetName(setName)) {
|
|
41124
41136
|
console.error(`Invalid --set value "${setName}". Scenario set names must be a single folder name (no slashes, no '.', no '..', no leading dot).`);
|
|
41125
41137
|
process.exit(1);
|
|
@@ -41155,12 +41167,11 @@ async function evalCaptureCommand(args2) {
|
|
|
41155
41167
|
process.exit(1);
|
|
41156
41168
|
}
|
|
41157
41169
|
const targetSetName = parsed.setName ?? "Default";
|
|
41158
|
-
const setFolderName = targetSetName;
|
|
41159
41170
|
const scenarioName = parsed.evalName ?? `Capture ${parsed.conversationId.slice(0, 8)}`;
|
|
41160
|
-
const slug =
|
|
41171
|
+
const { slug, relPath: evalRelPath } = evalFileRelPath({ name: scenarioName, path: targetSetName });
|
|
41161
41172
|
const evalsDir = path47.join(hubFolder, "evals");
|
|
41162
|
-
const
|
|
41163
|
-
const
|
|
41173
|
+
const targetPath = path47.join(evalsDir, evalRelPath);
|
|
41174
|
+
const targetDir = path47.dirname(targetPath);
|
|
41164
41175
|
if (!targetPath.startsWith(evalsDir + path47.sep)) {
|
|
41165
41176
|
console.error(`Resolved path "${path47.relative(hubFolder, targetPath)}" escapes evals/. Aborting.`);
|
|
41166
41177
|
process.exit(1);
|
|
@@ -41201,7 +41212,7 @@ async function evalCaptureCommand(args2) {
|
|
|
41201
41212
|
name: scenarioName,
|
|
41202
41213
|
agent: captured.responder_agent_id,
|
|
41203
41214
|
agent_id: captured.responder_agent_id,
|
|
41204
|
-
path:
|
|
41215
|
+
path: targetSetName,
|
|
41205
41216
|
history: captured.message_history,
|
|
41206
41217
|
input: captured.message_text,
|
|
41207
41218
|
expected: captured.message_expected_response,
|
|
@@ -41228,6 +41239,7 @@ var init_eval_capture = __esm({
|
|
|
41228
41239
|
init_api_client();
|
|
41229
41240
|
init_workspace();
|
|
41230
41241
|
init_utils();
|
|
41242
|
+
init_hub_folder();
|
|
41231
41243
|
init_yaml_writer();
|
|
41232
41244
|
init_fs_safety();
|
|
41233
41245
|
}
|
|
@@ -54003,7 +54015,7 @@ init_utils();
|
|
|
54003
54015
|
init_registry();
|
|
54004
54016
|
import { readFileSync as readFileSync26 } from "fs";
|
|
54005
54017
|
import { fileURLToPath as fileURLToPath2 } from "url";
|
|
54006
|
-
import { dirname as
|
|
54018
|
+
import { dirname as dirname23, join as join49 } from "path";
|
|
54007
54019
|
|
|
54008
54020
|
// src/lib/version-refresh.ts
|
|
54009
54021
|
init_version_cache();
|
|
@@ -54158,7 +54170,7 @@ Run \`wayai admin skill install\` to update.`);
|
|
|
54158
54170
|
}
|
|
54159
54171
|
|
|
54160
54172
|
// src/index.ts
|
|
54161
|
-
var __dirname =
|
|
54173
|
+
var __dirname = dirname23(fileURLToPath2(import.meta.url));
|
|
54162
54174
|
var pkg = JSON.parse(readFileSync26(join49(__dirname, "..", "package.json"), "utf-8"));
|
|
54163
54175
|
var [, , command, ...args] = process.argv;
|
|
54164
54176
|
var isBackgroundRefresh = command === REFRESH_COMMAND;
|