@wayai/cli 0.3.276 → 0.3.278

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 CHANGED
@@ -12598,7 +12598,7 @@ var init_chunk_BPCNB5RT = __esm({
12598
12598
  }
12599
12599
  });
12600
12600
 
12601
- // ../../packages/core/dist/chunk-6HXH56R4.js
12601
+ // ../../packages/core/dist/chunk-TXQWDP2F.js
12602
12602
  function toolParametersViolations(params) {
12603
12603
  try {
12604
12604
  if (containsKanbanPlaceholders(params)) return [];
@@ -12609,6 +12609,19 @@ function toolParametersViolations(params) {
12609
12609
  return [{ path: "", message: "parameters are nested too deeply to serialize" }];
12610
12610
  }
12611
12611
  }
12612
+ function configText(config, key) {
12613
+ return config !== null && typeof config === "object" ? nonBlank(config[key]) : void 0;
12614
+ }
12615
+ function statedToolDescription(text4) {
12616
+ const description2 = nonBlank(text4);
12617
+ return description2 === DEFAULT_TOOL_CONFIG_DESCRIPTION ? void 0 : description2;
12618
+ }
12619
+ function toolConfigDescription(config) {
12620
+ return statedToolDescription(configText(config, "description"));
12621
+ }
12622
+ function offeredToolDescription(config, toolDescription) {
12623
+ return toolConfigDescription(config) ?? nonBlank(toolDescription);
12624
+ }
12612
12625
  function refineToolConfig(value, ctx) {
12613
12626
  const raw = value.tool_config;
12614
12627
  if (raw == null) return;
@@ -12639,14 +12652,16 @@ function refineToolConfig(value, ctx) {
12639
12652
  });
12640
12653
  }
12641
12654
  }
12642
- var toolIdParam, listToolsQuery, toolAgentQuery, deleteToolQuery, toolConnectionsQuery, nativeToolIdSchema, CONTEXT_BOUNDARIES, contextBoundarySchema, addNativeToolBody, addMcpToolBody, toolReplaySettingsFields, toolReplaySettingsSchema, createCustomToolBody, updateCustomToolBody, updateToolExecutionConfigBody;
12643
- var init_chunk_6HXH56R4 = __esm({
12644
- "../../packages/core/dist/chunk-6HXH56R4.js"() {
12655
+ var nonBlank, DEFAULT_TOOL_CONFIG_DESCRIPTION, toolIdParam, listToolsQuery, toolAgentQuery, deleteToolQuery, toolConnectionsQuery, nativeToolIdSchema, CONTEXT_BOUNDARIES, contextBoundarySchema, addNativeToolBody, addMcpToolBody, toolReplaySettingsFields, toolReplaySettingsSchema, createCustomToolBody, updateCustomToolBody, updateToolExecutionConfigBody;
12656
+ var init_chunk_TXQWDP2F = __esm({
12657
+ "../../packages/core/dist/chunk-TXQWDP2F.js"() {
12645
12658
  "use strict";
12646
12659
  init_chunk_WEXVYJ5H();
12647
12660
  init_chunk_HZ6CADSY();
12648
12661
  init_chunk_EVXGKOJV();
12649
12662
  init_zod();
12663
+ nonBlank = (text4) => typeof text4 === "string" && text4.trim() !== "" ? text4 : void 0;
12664
+ DEFAULT_TOOL_CONFIG_DESCRIPTION = "Function description";
12650
12665
  toolIdParam = external_exports.object({ id: uuidSchema });
12651
12666
  listToolsQuery = external_exports.object({ agent_id: uuidSchema, hub_id: uuidSchema });
12652
12667
  toolAgentQuery = external_exports.object({ agent_id: uuidSchema, hub_id: uuidSchema });
@@ -14009,7 +14024,41 @@ var init_chunk_7NQZRSSJ = __esm({
14009
14024
  }
14010
14025
  });
14011
14026
 
14012
- // ../../packages/core/dist/chunk-VNGEV62J.js
14027
+ // ../../packages/core/dist/chunk-NAW4LACQ.js
14028
+ function declaresNoConnection(agent) {
14029
+ return agent.connection === null && !agent.connection_id;
14030
+ }
14031
+ function agentConnectionRefusal(agent) {
14032
+ if (agent.connection || declaresNoConnection(agent)) return null;
14033
+ const heldNot = agent.connection_id ? ` Its connection_id "${agent.connection_id}" is not one of this hub's.` : "";
14034
+ return `Agent "${agent.name}": connection is required. Name one of the hub's connections, or write \`connection: null\` for an agent with none.${heldNot}`;
14035
+ }
14036
+ function customToolConnectionRefusal(agentName, tool) {
14037
+ if (tool.connection || tool.connection_id) return null;
14038
+ return `Agent "${agentName}", tool "${tool.name}": connection is required. A custom tool calls through one of the hub's connections: name it.`;
14039
+ }
14040
+ function customToolDescriptionAfterPush(entry, row, writtenConfig) {
14041
+ const written = row ? writtenConfig : entry.config;
14042
+ const stated = toolConfigDescription(written);
14043
+ if (stated !== void 0 && stated !== toolConfigDescription(row?.tool_config)) return { description: stated };
14044
+ const keepsNoText = row !== void 0 && offeredToolDescription(row.tool_config, row.tool_description) === void 0;
14045
+ const sent = entry.description === null ? "" : entry.description;
14046
+ const fieldCanMove = !row || entry.id === row.tool_id || toolConfigDescription(entry.config) === void 0;
14047
+ if (fieldCanMove && sent !== void 0 && sent !== (row?.tool_description ?? "")) {
14048
+ const text4 = statedToolDescription(sent);
14049
+ if (text4 !== void 0) return { description: text4 };
14050
+ return keepsNoText ? {} : { refused: "description" };
14051
+ }
14052
+ if (row && written === void 0) return {};
14053
+ const kept = stated ?? offeredToolDescription(void 0, row?.tool_description);
14054
+ if (kept !== void 0) return { description: kept };
14055
+ if (keepsNoText) return {};
14056
+ return { refused: row ? "config.description" : "description" };
14057
+ }
14058
+ function customToolDescriptionRefusal(agentName, entry, row, writtenConfig) {
14059
+ const field = customToolDescriptionAfterPush(entry, row, writtenConfig).refused;
14060
+ return field ? `Agent "${agentName}", tool "${entry.name}": ${field} is required. An agent is not offered a tool with no description: say what the tool does in ${field}.` : null;
14061
+ }
14013
14062
  function refineHubAsCodeCustomTools(config, ctx) {
14014
14063
  const agents = config.agents;
14015
14064
  if (!Array.isArray(agents)) return;
@@ -14723,10 +14772,10 @@ function skillSectionsAsResources(scope) {
14723
14772
  };
14724
14773
  }
14725
14774
  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, MAX_HUB_AS_CODE_PAGE_MANIFEST_CHARS, hubAsCodePagesSchema, MAX_CALL_OPENING_CARRIERS, MAX_CALL_OPENING_AGGREGATE_ENCODED_BYTES, HUB_AS_CODE_AGENT_TOOL_KEYS, hubAsCodeStateSchema, hubAsCodeResourceFileSchema, hubAsCodeResourceSchema, uuidPattern, ciUuidSchema, flagEntriesOf, boundedHubAsCodeResourcesSchema, isPlainObject, MIN_SKILLS_LAYOUT_CLI, MAX_HUB_AS_CODE_DEPTH, NAMED_DEPTH_SEGMENTS, NAMED_DEPTH_KEY_CHARS, fieldName, 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;
14726
- var init_chunk_VNGEV62J = __esm({
14727
- "../../packages/core/dist/chunk-VNGEV62J.js"() {
14775
+ var init_chunk_NAW4LACQ = __esm({
14776
+ "../../packages/core/dist/chunk-NAW4LACQ.js"() {
14728
14777
  "use strict";
14729
- init_chunk_6HXH56R4();
14778
+ init_chunk_TXQWDP2F();
14730
14779
  init_chunk_HRKVCI5A();
14731
14780
  init_chunk_IW7D2QOD();
14732
14781
  init_chunk_LBDH7LCG();
@@ -16332,8 +16381,8 @@ var init_contracts = __esm({
16332
16381
  init_chunk_E4DIIOOE();
16333
16382
  init_chunk_7CYHPF35();
16334
16383
  init_chunk_BPCNB5RT();
16335
- init_chunk_VNGEV62J();
16336
- init_chunk_6HXH56R4();
16384
+ init_chunk_NAW4LACQ();
16385
+ init_chunk_TXQWDP2F();
16337
16386
  init_chunk_HRKVCI5A();
16338
16387
  init_chunk_IW7D2QOD();
16339
16388
  init_chunk_2YEGUQR7();
@@ -22684,6 +22733,46 @@ var init_hub_materializer = __esm({
22684
22733
  }
22685
22734
  });
22686
22735
 
22736
+ // ../../packages/core/dist/contracts/ci.js
22737
+ var init_ci = __esm({
22738
+ "../../packages/core/dist/contracts/ci.js"() {
22739
+ "use strict";
22740
+ init_chunk_NAW4LACQ();
22741
+ init_chunk_TXQWDP2F();
22742
+ init_chunk_HRKVCI5A();
22743
+ init_chunk_IW7D2QOD();
22744
+ init_chunk_2YEGUQR7();
22745
+ init_chunk_4D6K4P4K();
22746
+ init_chunk_LBDH7LCG();
22747
+ init_chunk_4LXDRTO4();
22748
+ init_chunk_7NQZRSSJ();
22749
+ init_chunk_D3EP4TDU();
22750
+ init_chunk_X5PZZVTS();
22751
+ init_chunk_K5UAZWFF();
22752
+ init_chunk_MBXNS7SI();
22753
+ init_chunk_WTOA3ANF();
22754
+ init_chunk_IBL7FANV();
22755
+ init_chunk_S4VDZ7PZ();
22756
+ init_chunk_KB5RK3RP();
22757
+ init_chunk_CJ3L46X6();
22758
+ init_chunk_2ISUBJG7();
22759
+ init_chunk_C2UEA2KW();
22760
+ init_chunk_FBV7NLKO();
22761
+ init_chunk_WEXVYJ5H();
22762
+ init_chunk_6TSQ5HXC();
22763
+ init_chunk_HZ6CADSY();
22764
+ init_chunk_G4HTKQCL();
22765
+ init_chunk_ZUKC6A2W();
22766
+ init_chunk_EVXGKOJV();
22767
+ init_chunk_I42QJGJF();
22768
+ init_chunk_MIWZOSPI();
22769
+ init_chunk_YROEDMVZ();
22770
+ init_chunk_L5F7ZOUJ();
22771
+ init_chunk_EV3MAOEX();
22772
+ init_chunk_WFQDSQJK();
22773
+ }
22774
+ });
22775
+
22687
22776
  // src/lib/eval-format.ts
22688
22777
  function runNotes(unproven, inProgress) {
22689
22778
  return [
@@ -27709,7 +27798,12 @@ New hub: "${newHub.hubName}" (${hubType})`);
27709
27798
  }
27710
27799
  const content = readRealFileOrThrow(newHub.hubFolder, hubYamlPath) ?? "";
27711
27800
  assertSkillsLayout(newHub.hubFolder);
27712
- parseHubFolder(newHub.hubFolder, { allowNewHub: true });
27801
+ const parsed = parseHubFolder(newHub.hubFolder, { allowNewHub: true });
27802
+ const refusals = (parsed.agents ?? []).flatMap((agent) => [
27803
+ agentConnectionRefusal(agent),
27804
+ ...(agent.tools?.custom ?? []).flatMap((tool) => [customToolConnectionRefusal(agent.name, tool), customToolDescriptionRefusal(agent.name, tool)])
27805
+ ]).filter((refusal2) => refusal2 !== null);
27806
+ if (refusals.length > 0) throw expected(refusals.join("\n"));
27713
27807
  console.log("Creating hub...");
27714
27808
  const createResult = await client.createHub(opts.organizationId, {
27715
27809
  hubName: newHub.hubName,
@@ -27825,6 +27919,7 @@ var LOCAL_CHANGE_LIST_CAP;
27825
27919
  var init_push = __esm({
27826
27920
  "src/commands/push.ts"() {
27827
27921
  "use strict";
27922
+ init_ci();
27828
27923
  init_auth();
27829
27924
  init_api_client();
27830
27925
  init_expected();