@wayai/cli 0.3.237 → 0.3.239

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
@@ -5022,10 +5022,10 @@ var init_chunk_SXDX4GHS = __esm({
5022
5022
  }
5023
5023
  });
5024
5024
 
5025
- // ../../packages/core/dist/chunk-LSK5GWKT.js
5025
+ // ../../packages/core/dist/chunk-YVY2TZK2.js
5026
5026
  var orgResourceIdParam, orgResourceFileIdParam, orgResourceFolderIdParam, hubOrgResourceParam, listOrgResourcesQuery, orgIdQuery, createOrgResourceBody, updateOrgResourceBody, createOrgResourceFolderBody, updateOrgResourceFolderBody, uploadOrgResourceFileBody, updateOrgResourceFileBody, uploadOrgSkillZipBody, linkOrgResourceBody;
5027
- var init_chunk_LSK5GWKT = __esm({
5028
- "../../packages/core/dist/chunk-LSK5GWKT.js"() {
5027
+ var init_chunk_YVY2TZK2 = __esm({
5028
+ "../../packages/core/dist/chunk-YVY2TZK2.js"() {
5029
5029
  "use strict";
5030
5030
  init_zod();
5031
5031
  orgResourceIdParam = external_exports.object({
@@ -5206,10 +5206,10 @@ var init_chunk_HZ6CADSY = __esm({
5206
5206
  }
5207
5207
  });
5208
5208
 
5209
- // ../../packages/core/dist/chunk-DLT7IEAN.js
5209
+ // ../../packages/core/dist/chunk-RACEDHG6.js
5210
5210
  var resourceIdParam, listResourcesQuery, createResourceBody, updateResourceBody, syncSkillsBody, resourceFileIdParam, listResourceFilesQuery, createResourceFileBody, updateResourceFileBody, uploadResourceFileBody, uploadSkillZipBody, resourceFolderIdParam, listResourceFoldersQuery, createResourceFolderBody, updateResourceFolderBody, agentResourceQuery, hubResourceQuery, linkAgentResourceBody, updateAgentResourceBody, unlinkAgentResourceQuery;
5211
- var init_chunk_DLT7IEAN = __esm({
5212
- "../../packages/core/dist/chunk-DLT7IEAN.js"() {
5211
+ var init_chunk_RACEDHG6 = __esm({
5212
+ "../../packages/core/dist/chunk-RACEDHG6.js"() {
5213
5213
  "use strict";
5214
5214
  init_chunk_HZ6CADSY();
5215
5215
  init_zod();
@@ -12197,7 +12197,7 @@ var init_chunk_T4Q5COKJ = __esm({
12197
12197
  }
12198
12198
  });
12199
12199
 
12200
- // ../../packages/core/dist/chunk-KQZM7ANN.js
12200
+ // ../../packages/core/dist/chunk-RRRUNBRX.js
12201
12201
  function refineHubAsCodeCustomTools(config, ctx) {
12202
12202
  const agents = config.agents;
12203
12203
  if (!Array.isArray(agents)) return;
@@ -12527,7 +12527,7 @@ function refineHubAsCodeResources(config, ctx) {
12527
12527
  ctx.addIssue({
12528
12528
  code: external_exports.ZodIssueCode.custom,
12529
12529
  path: ["resources", resourceIndex, "files", fileIndex, "content_base64"],
12530
- message: `resource file ${typeof entry.path === "string" ? `"${entry.path}" ` : ""}exceeds the ${(MAX_RESOURCE_FILE_SIZE / 1024 / 1024).toFixed(0)}MB size limit`
12530
+ message: `skill file ${typeof entry.path === "string" ? `"${entry.path}" ` : ""}exceeds the ${(MAX_RESOURCE_FILE_SIZE / 1024 / 1024).toFixed(0)}MB size limit`
12531
12531
  });
12532
12532
  }
12533
12533
  }
@@ -12538,7 +12538,7 @@ function refineHubAsCodeResources(config, ctx) {
12538
12538
  ctx.addIssue({
12539
12539
  code: external_exports.ZodIssueCode.custom,
12540
12540
  path: ["resources", resourceIndex, "files", fileIndex, "content"],
12541
- message: `resource file ${typeof entry.path === "string" ? `"${entry.path}" ` : ""}exceeds the ${(MAX_RESOURCE_FILE_SIZE / 1024 / 1024).toFixed(0)}MB size limit`
12541
+ message: `skill file ${typeof entry.path === "string" ? `"${entry.path}" ` : ""}exceeds the ${(MAX_RESOURCE_FILE_SIZE / 1024 / 1024).toFixed(0)}MB size limit`
12542
12542
  });
12543
12543
  }
12544
12544
  }
@@ -12548,7 +12548,7 @@ function refineHubAsCodeResources(config, ctx) {
12548
12548
  ctx.addIssue({
12549
12549
  code: external_exports.ZodIssueCode.custom,
12550
12550
  path: ["resources"],
12551
- message: `total resource bytes exceed the ${(MAX_RESOURCE_AGGREGATE_ENCODED_BYTES / 1024 / 1024).toFixed(0)}MB per-push limit`
12551
+ message: `total skill file bytes exceed the ${(MAX_RESOURCE_AGGREGATE_ENCODED_BYTES / 1024 / 1024).toFixed(0)}MB per-push limit`
12552
12552
  });
12553
12553
  }
12554
12554
  }
@@ -12781,8 +12781,8 @@ function skillSectionsAsResources(scope) {
12781
12781
  };
12782
12782
  }
12783
12783
  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_CALL_OPENING_CARRIERS, MAX_CALL_OPENING_AGGREGATE_ENCODED_BYTES, hubAsCodeStateSchema, hubAsCodeResourceFileSchema, hubAsCodeResourceSchema, uuidPattern, ciUuidSchema, boundedHubAsCodeResourcesSchema, isPlainObject, MIN_SKILLS_LAYOUT_CLI, 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;
12784
- var init_chunk_KQZM7ANN = __esm({
12785
- "../../packages/core/dist/chunk-KQZM7ANN.js"() {
12784
+ var init_chunk_RRRUNBRX = __esm({
12785
+ "../../packages/core/dist/chunk-RRRUNBRX.js"() {
12786
12786
  "use strict";
12787
12787
  init_chunk_SK2X6UOC();
12788
12788
  init_chunk_EE5FYMSX();
@@ -12834,7 +12834,7 @@ var init_chunk_KQZM7ANN = __esm({
12834
12834
  // signed R2 URL (pull only)
12835
12835
  mime_type: external_exports.string().optional(),
12836
12836
  file_size: external_exports.number().int().nonnegative().optional(),
12837
- hash: external_exports.string().regex(EVAL_ATTACHMENT_HASH_REGEX, "resource file hash must be a lowercase SHA-256 hex digest").optional()
12837
+ hash: external_exports.string().regex(EVAL_ATTACHMENT_HASH_REGEX, "skill file hash must be a lowercase SHA-256 hex digest").optional()
12838
12838
  }).passthrough();
12839
12839
  hubAsCodeResourceSchema = external_exports.object({
12840
12840
  id: external_exports.string().min(1).optional(),
@@ -12857,7 +12857,7 @@ var init_chunk_KQZM7ANN = __esm({
12857
12857
  if (resources.length > MAX_HUB_AS_CODE_RESOURCES) {
12858
12858
  ctx.addIssue({
12859
12859
  code: external_exports.ZodIssueCode.custom,
12860
- message: `too many resources (${resources.length}); the maximum is ${MAX_HUB_AS_CODE_RESOURCES}`
12860
+ message: `too many skills (${resources.length}); the maximum is ${MAX_HUB_AS_CODE_RESOURCES}`
12861
12861
  });
12862
12862
  return;
12863
12863
  }
@@ -12869,7 +12869,7 @@ var init_chunk_KQZM7ANN = __esm({
12869
12869
  if (fileCount > MAX_HUB_AS_CODE_RESOURCE_FILES) {
12870
12870
  ctx.addIssue({
12871
12871
  code: external_exports.ZodIssueCode.custom,
12872
- message: `too many resource files; the maximum is ${MAX_HUB_AS_CODE_RESOURCE_FILES}`
12872
+ message: `too many skill files; the maximum is ${MAX_HUB_AS_CODE_RESOURCE_FILES}`
12873
12873
  });
12874
12874
  return;
12875
12875
  }
@@ -15059,9 +15059,9 @@ var init_contracts = __esm({
15059
15059
  "use strict";
15060
15060
  init_chunk_GK27ENTT();
15061
15061
  init_chunk_SXDX4GHS();
15062
- init_chunk_LSK5GWKT();
15062
+ init_chunk_YVY2TZK2();
15063
15063
  init_chunk_VXEAR36B();
15064
- init_chunk_DLT7IEAN();
15064
+ init_chunk_RACEDHG6();
15065
15065
  init_chunk_Q7KIQHAZ();
15066
15066
  init_chunk_WBFLPPDI();
15067
15067
  init_chunk_IPXBFWUU();
@@ -15092,7 +15092,7 @@ var init_contracts = __esm({
15092
15092
  init_chunk_KSTYTQ7I();
15093
15093
  init_chunk_LKBSHANA();
15094
15094
  init_chunk_BPCNB5RT();
15095
- init_chunk_KQZM7ANN();
15095
+ init_chunk_RRRUNBRX();
15096
15096
  init_chunk_SK2X6UOC();
15097
15097
  init_chunk_EE5FYMSX();
15098
15098
  init_chunk_JDJ4EUOL();
@@ -16763,7 +16763,7 @@ function assertResourcePayloadFitsWithoutPruning(payload, cause) {
16763
16763
  }
16764
16764
  function writeResourceFileTree(resDir, files, root, log) {
16765
16765
  if (!ensureRealSubdirNoSymlink(root, resDir, files.length > 0)) {
16766
- console.warn(` Warning: skipping resource dir (not reachable inside the workspace without a symlink)`);
16766
+ console.warn(` Warning: skipping skill folder (not reachable inside the workspace without a symlink)`);
16767
16767
  return;
16768
16768
  }
16769
16769
  if (files.length === 0) {
@@ -16784,7 +16784,7 @@ function writeResourceFileTree(resDir, files, root, log) {
16784
16784
  if (writeFileNoFollow(resDir, filePath2, buf)) {
16785
16785
  log?.changed.push(path7.relative(root, filePath2));
16786
16786
  } else {
16787
- console.warn(` Warning: skipping ${file.path} (destination escapes the resource folder via a symlink)`);
16787
+ console.warn(` Warning: skipping ${file.path} (destination escapes the skill folder via a symlink)`);
16788
16788
  writtenPaths.delete(file.path);
16789
16789
  }
16790
16790
  }
@@ -16806,7 +16806,7 @@ function cleanOrphanFiles(dir, prefix, writtenPaths, root, log) {
16806
16806
  }
16807
16807
  async function downloadBinaryFiles(resDir, files, root, log) {
16808
16808
  if (!ensureRealSubdirNoSymlink(root, resDir, true)) {
16809
- console.warn(` Warning: skipping resource downloads (dir not reachable inside the workspace without a symlink)`);
16809
+ console.warn(` Warning: skipping skill file downloads (folder not reachable inside the workspace without a symlink)`);
16810
16810
  return 0;
16811
16811
  }
16812
16812
  let count = 0;
@@ -16836,7 +16836,7 @@ async function downloadBinaryFiles(resDir, files, root, log) {
16836
16836
  count++;
16837
16837
  log?.changed.push(path7.relative(root, filePath2));
16838
16838
  } else {
16839
- console.warn(` Warning: skipping ${file.path} (destination escapes the resource folder via a symlink)`);
16839
+ console.warn(` Warning: skipping ${file.path} (destination escapes the skill folder via a symlink)`);
16840
16840
  }
16841
16841
  } catch (err) {
16842
16842
  console.warn(` Warning: failed to download ${file.path} (${err instanceof Error ? err.message : String(err)})`);
@@ -17961,7 +17961,7 @@ var init_registry = __esm({
17961
17961
  "src/data/registry.ts"() {
17962
17962
  "use strict";
17963
17963
  COMMAND_SURVIVAL = [
17964
- // --- Clause 1: deleted. One keyring login, one status, one CLI self-update. ---
17964
+ // --- Clause 1: deleted. One keyring login, one status, one CLI self-update, one report queue. ---
17965
17965
  {
17966
17966
  original: "login",
17967
17967
  disposition: "deleted",
@@ -18010,6 +18010,14 @@ var init_registry = __esm({
18010
18010
  shipped: true,
18011
18011
  reason: "One binary, one self-update."
18012
18012
  },
18013
+ {
18014
+ original: "report",
18015
+ disposition: "deleted",
18016
+ surviving: null,
18017
+ clause: 1,
18018
+ shipped: true,
18019
+ reason: "One report queue. WayAI's `report` is the survivor."
18020
+ },
18013
18021
  // --- Clause 2: top-level ontology entities WayAI owns no concept of. ---
18014
18022
  {
18015
18023
  original: "bases",
@@ -18218,14 +18226,6 @@ var init_registry = __esm({
18218
18226
  shipped: false,
18219
18227
  reason: "Clause 3's group exception: `wayai admin` is an existing group with its own gating and subgroups, so the operator surface joins it as a peer rather than sitting under `bases`. UNSHIPPED pending a transport: the Data backend's operator routes live at `/admin/*`, a SIBLING of `/v1/*`, and the merged CLI reaches Data only through WayAI's `/api/data` proxy, which contains every forwarded path under `/v1` by construction (`rekor/upstream-url.ts`). The standalone CLI could call them because it held a second `api_url` pointed straight at the Data backend \u2014 the thing the merge deliberately removed. Shipping needs a proxy channel for operator routes plus platform-admin gating on it, which is a backend change, not a CLI one."
18220
18228
  },
18221
- {
18222
- original: "report",
18223
- disposition: "namespaced",
18224
- surviving: "bases report",
18225
- clause: 3,
18226
- shipped: true,
18227
- reason: "Two report queues still exist, so the merged CLI must be able to file to either. The two collapse when the queues do."
18228
- },
18229
18229
  // --- Neither: one verb each, routing by workspace subtree. ---
18230
18230
  {
18231
18231
  original: "pull",
@@ -19899,8 +19899,8 @@ function resolveCommunityTarget(gitRoot, selector, cwd = process.cwd()) {
19899
19899
  const { communitiesDir } = resolveLayout(gitRoot);
19900
19900
  const label = communitiesDirLabel(gitRoot);
19901
19901
  if (selector === void 0) {
19902
- const here2 = path12.resolve(cwd);
19903
- const name = isUnder(communitiesDir, here2) ? path12.relative(communitiesDir, here2).split(path12.sep)[0] : "";
19902
+ const here = path12.resolve(cwd);
19903
+ const name = isUnder(communitiesDir, here) ? path12.relative(communitiesDir, here).split(path12.sep)[0] : "";
19904
19904
  if (!name) {
19905
19905
  const folders = listCommunityFolders(communitiesDir);
19906
19906
  throw expected(
@@ -33872,9 +33872,9 @@ function diskClash(dir, rel) {
33872
33872
  if (!names.includes(segments[i])) return void 0;
33873
33873
  abs = path39.join(abs, segments[i]);
33874
33874
  const isDir = fs28.lstatSync(abs).isDirectory();
33875
- const here2 = segments.slice(0, i + 1).join("/");
33876
- if (i < segments.length - 1 && !isDir) return { reason: "file_folder", other: here2 };
33877
- if (i === segments.length - 1 && isDir) return { reason: "file_folder", other: `${here2}/` };
33875
+ const here = segments.slice(0, i + 1).join("/");
33876
+ if (i < segments.length - 1 && !isDir) return { reason: "file_folder", other: here };
33877
+ if (i === segments.length - 1 && isDir) return { reason: "file_folder", other: `${here}/` };
33878
33878
  }
33879
33879
  return void 0;
33880
33880
  }
@@ -37831,220 +37831,9 @@ var init_providers = __esm({
37831
37831
  }
37832
37832
  });
37833
37833
 
37834
- // src/data/commands/report.ts
37834
+ // src/data/commands/credentials.ts
37835
37835
  import { Command as Command6 } from "commander";
37836
37836
  import { readFileSync as readFileSync20 } from "fs";
37837
- import { dirname as dirname16, join as join37 } from "path";
37838
- import { fileURLToPath as fileURLToPath2 } from "url";
37839
- function resolveCliVersion() {
37840
- for (const candidate of [
37841
- join37(here, "..", "package.json"),
37842
- join37(here, "..", "..", "..", "package.json")
37843
- ]) {
37844
- try {
37845
- const version = JSON.parse(readFileSync20(candidate, "utf-8")).version;
37846
- if (typeof version === "string" && version) return version;
37847
- } catch {
37848
- }
37849
- }
37850
- return "unknown";
37851
- }
37852
- function resolveReportClientVersions(projectRoot, cliVersion) {
37853
- const versions = { cli_version: cliVersion };
37854
- try {
37855
- const skillVersion = lowestInstalledVersion(findInstalledSkills(projectRoot));
37856
- if (skillVersion) versions.skill_version = skillVersion;
37857
- } catch {
37858
- }
37859
- return versions;
37860
- }
37861
- function reportActionError2(err) {
37862
- if (err instanceof ApiError) {
37863
- if (err.status === 404) {
37864
- console.error("Report not found, or it was not filed by you.");
37865
- } else if (err.status === 403) {
37866
- console.error("This report is agent-authored and can only be handled by a platform admin.");
37867
- } else if (err.status === 409) {
37868
- console.error(err.message);
37869
- } else if (err.status === 429) {
37870
- console.error("Rate limit exceeded. Please try again later.");
37871
- } else {
37872
- console.error(`Request failed: ${err.message}`);
37873
- }
37874
- return process.exit(1);
37875
- }
37876
- throw err;
37877
- }
37878
- function buildBasesReportCommand() {
37879
- const report2 = new Command6("report").description(
37880
- "File a report to the Data triage queue and verify the outcome"
37881
- );
37882
- report2.command("create").description("Submit a report to the Data triage queue (deduplicated)").requiredOption("--title <title>", "Short summary").requiredOption("--description <text>", "What happened").option("--source <source>", "Origin: cli_report (default) | review | security_audit").option("--classification <c>", "Nature: bug (default) | flaky_test | security | enhancement").option(
37883
- "--dedup-key <key>",
37884
- 'Stable dedup key (e.g. "<file>::<test>"); collapses repeat occurrences'
37885
- ).option("--severity <level>", "low | medium | high | critical").option("--steps <text>", "Steps to reproduce").option("--error-message <text>", "Exact error text if any").option("--context <text>", "Additional context (logs, request ids)").option("--locale <code>", "Notification locale (en | pt | es)", "en").option("--reporter-email <addr>", "Override reporter email (defaults to session email)").option("--base-id <id>", "Base the error relates to (defaults to the configured base)").option("--record-type <name>", "Record type the error relates to").option("--record-id <id>", "Record id (UUID) the error relates to").option("--external-id <id>", "External id of the related record").option("--external-source <src>", "External source of the related record").option("--relationship-id <id>", "Relationship id the error relates to").action(async function(opts) {
37886
- const body = {
37887
- title: opts.title,
37888
- description: opts.description,
37889
- locale: opts.locale
37890
- };
37891
- if (opts.source) body.source = opts.source;
37892
- if (opts.classification) body.classification = opts.classification;
37893
- if (opts.dedupKey) body.dedup_key = opts.dedupKey;
37894
- if (opts.severity) body.severity = opts.severity;
37895
- if (opts.steps) body.steps = opts.steps;
37896
- if (opts.errorMessage) body.error_message = opts.errorMessage;
37897
- if (opts.context) body.context = opts.context;
37898
- if (opts.reporterEmail) body.reporter_email = opts.reporterEmail;
37899
- const baseId2 = opts.baseId ?? findBase(this) ?? process.env.WAYAI_BASE;
37900
- if (baseId2) body.base_id = baseId2;
37901
- if (opts.recordType) body.record_type = opts.recordType;
37902
- if (opts.recordId) body.record_id = opts.recordId;
37903
- if (opts.externalId) body.external_id = opts.externalId;
37904
- if (opts.externalSource) body.external_source = opts.externalSource;
37905
- if (opts.relationshipId) body.relationship_id = opts.relationshipId;
37906
- const versions = resolveReportClientVersions(
37907
- findGitRoot() ?? process.cwd(),
37908
- resolveCliVersion()
37909
- );
37910
- body.cli_version = versions.cli_version;
37911
- if (versions.skill_version) body.skill_version = versions.skill_version;
37912
- const client = await createDataClient();
37913
- const data = await client.request("POST", "/v1/reports", body);
37914
- if (outputFormat(this) === "json") {
37915
- printOutput(data, "json");
37916
- return;
37917
- }
37918
- if (data.created) {
37919
- console.log(`Report submitted (id: ${data.report_id}).`);
37920
- console.log("Our team will review and follow up by email if you provided one.");
37921
- } else if (data.recurrence?.reopened) {
37922
- console.log(`Report reopened for another look (id: ${data.report_id}).`);
37923
- } else if (data.recurrence) {
37924
- console.log(
37925
- `A matching report remains closed (id: ${data.report_id}); this occurrence was recorded.`
37926
- );
37927
- } else {
37928
- console.log(
37929
- `A matching report already exists (id: ${data.report_id}) \u2014 your submission was merged into it.`
37930
- );
37931
- }
37932
- });
37933
- report2.command("list").description("List your reports, newest first").option("--status <s>", "Filter by status (e.g. shipped \u2014 awaiting your verification)").action(async function(opts) {
37934
- const client = await createDataClient();
37935
- const qs = opts.status ? `?status=${encodeURIComponent(opts.status)}` : "";
37936
- try {
37937
- const rows = await client.request("GET", `/v1/reports${qs}`);
37938
- if (outputFormat(this) === "json") {
37939
- printOutput(rows, "json");
37940
- return;
37941
- }
37942
- if (rows.length === 0) {
37943
- console.log("No reports found.");
37944
- return;
37945
- }
37946
- for (const r of rows) {
37947
- const title = sanitizeTerminalText(r.title?.replace(/\s+/g, " ").trim() || "(untitled)");
37948
- console.log(
37949
- `${r.report_id} ${r.status.padEnd(10)} ${(r.classification ?? "bug").padEnd(12)} ${title}`
37950
- );
37951
- }
37952
- } catch (err) {
37953
- reportActionError2(err);
37954
- }
37955
- });
37956
- report2.command("get <report_id>").description("Show one of your reports: status + the message thread").action(async function(reportId) {
37957
- const client = await createDataClient();
37958
- try {
37959
- const data = await client.request("GET", `/v1/reports/${pathSegment(reportId, "report id")}`);
37960
- if (outputFormat(this) === "json") {
37961
- printOutput(data, "json");
37962
- return;
37963
- }
37964
- const { report: row, messages } = data;
37965
- console.log(`Report ${row.report_id}`);
37966
- console.log(` title: ${sanitizeTerminalText(row.title ?? "(unavailable)")}`);
37967
- console.log(
37968
- ` description: ${sanitizeTerminalText(row.description ?? "(unavailable)")}`
37969
- );
37970
- console.log(` status: ${row.status}`);
37971
- console.log(` classification: ${row.classification ?? "bug"}`);
37972
- if (row.contest_count > 0) console.log(` contests: ${row.contest_count}`);
37973
- if (row.dismissal_final) console.log(" dismissal: final (non-contestable)");
37974
- if (messages.length > 0) {
37975
- console.log("\n Thread:");
37976
- for (const m of messages) {
37977
- console.log(` [${m.author_role}] ${sanitizeTerminalText(m.body)}`);
37978
- }
37979
- }
37980
- if (row.status === "shipped") {
37981
- console.log(
37982
- `
37983
- This fix is shipped. Run \`wayai bases report accept ${row.report_id}\` if it works,`
37984
- );
37985
- console.log(
37986
- ` or \`wayai bases report contest ${row.report_id} --reason "..."\` if it does not.`
37987
- );
37988
- }
37989
- } catch (err) {
37990
- reportActionError2(err);
37991
- }
37992
- });
37993
- report2.command("accept <report_id>").description("Accept a shipped fix (\u2192 addressed)").action(async function(reportId) {
37994
- const client = await createDataClient();
37995
- try {
37996
- const data = await client.request(
37997
- "POST",
37998
- `/v1/reports/${pathSegment(reportId, "report id")}/accept`
37999
- );
38000
- if (outputFormat(this) === "json") {
38001
- printOutput(data, "json");
38002
- return;
38003
- }
38004
- console.log(`Accepted. Report ${data.report.report_id} \u2192 ${data.report.status}.`);
38005
- } catch (err) {
38006
- reportActionError2(err);
38007
- }
38008
- });
38009
- report2.command("contest <report_id>").description("Contest a shipped fix or a dismissal (\u2192 back to triage)").requiredOption("--reason <text>", "Why the fix/dismissal is wrong").action(async function(reportId, opts) {
38010
- const client = await createDataClient();
38011
- try {
38012
- const data = await client.request(
38013
- "POST",
38014
- `/v1/reports/${pathSegment(reportId, "report id")}/contest`,
38015
- { reason: opts.reason }
38016
- );
38017
- if (outputFormat(this) === "json") {
38018
- printOutput(data, "json");
38019
- return;
38020
- }
38021
- console.log(
38022
- `Contested. Report ${data.report.report_id} \u2192 ${data.report.status} (back to triage).`
38023
- );
38024
- } catch (err) {
38025
- reportActionError2(err);
38026
- }
38027
- });
38028
- return report2;
38029
- }
38030
- var here;
38031
- var init_report3 = __esm({
38032
- "src/data/commands/report.ts"() {
38033
- "use strict";
38034
- init_client();
38035
- init_output();
38036
- init_helpers();
38037
- init_api_client();
38038
- init_terminal_output();
38039
- init_workspace();
38040
- init_skill_version();
38041
- here = dirname16(fileURLToPath2(import.meta.url));
38042
- }
38043
- });
38044
-
38045
- // src/data/commands/credentials.ts
38046
- import { Command as Command7 } from "commander";
38047
- import { readFileSync as readFileSync21 } from "fs";
38048
37837
  function withValueSourceOptions(cmd, what) {
38049
37838
  return cmd.option(
38050
37839
  "--file <path>",
@@ -38057,7 +37846,7 @@ async function resolveValue(opts, label) {
38057
37846
  throw expected("--file cannot be combined with --value-stdin or --value-prompt \u2014 pass one.");
38058
37847
  }
38059
37848
  try {
38060
- return readFileSync21(opts.file).toString("base64");
37849
+ return readFileSync20(opts.file).toString("base64");
38061
37850
  } catch (e) {
38062
37851
  throw expected(`--file ${opts.file}: ${e instanceof Error ? e.message : "could not be read"}`);
38063
37852
  }
@@ -38078,7 +37867,7 @@ function credentialPath(base, id) {
38078
37867
  }
38079
37868
  function buildBasesCredentialsCommand() {
38080
37869
  const credentials = withBaseOption(
38081
- new Command7("credentials").description("Manage a base's integration credentials")
37870
+ new Command6("credentials").description("Manage a base's integration credentials")
38082
37871
  );
38083
37872
  withValueSourceOptions(
38084
37873
  credentials.command("create").description("Store a credential on this base (value read from stdin, a masked prompt, or --file)").requiredOption("--name <name>", "Credential name \u2014 what a credential:<name> reference resolves").option("--content-type <mime>", "MIME type of the value (e.g. application/x-pkcs12)").option(
@@ -38205,10 +37994,10 @@ var init_credentials = __esm({
38205
37994
  });
38206
37995
 
38207
37996
  // src/data/commands/sql.ts
38208
- import { Command as Command8 } from "commander";
38209
- import { readFileSync as readFileSync22 } from "fs";
37997
+ import { Command as Command7 } from "commander";
37998
+ import { readFileSync as readFileSync21 } from "fs";
38210
37999
  function buildBasesSqlCommand() {
38211
- return withBaseOption(new Command8("sql")).description("Execute a read-only SQL query against base data").argument("[query]", "SQL query (SELECT only)").option("--file <path>", "Read SQL from a file instead of the argument").option(
38000
+ return withBaseOption(new Command7("sql")).description("Execute a read-only SQL query against base data").argument("[query]", "SQL query (SELECT only)").option("--file <path>", "Read SQL from a file instead of the argument").option(
38212
38001
  "--param <kv...>",
38213
38002
  "Named parameters as key=value pairs (e.g. --param status=issued)"
38214
38003
  ).action(async function(queryArg, opts) {
@@ -38216,7 +38005,7 @@ function buildBasesSqlCommand() {
38216
38005
  let query;
38217
38006
  if (opts.file) {
38218
38007
  try {
38219
- query = readFileSync22(opts.file, "utf-8").trim();
38008
+ query = readFileSync21(opts.file, "utf-8").trim();
38220
38009
  } catch (e) {
38221
38010
  throw expected(`--file ${opts.file}: ${e instanceof Error ? e.message : "could not be read"}`);
38222
38011
  }
@@ -38251,7 +38040,7 @@ var init_sql = __esm({
38251
38040
  });
38252
38041
 
38253
38042
  // src/data/commands/tokens.ts
38254
- import { Command as Command9 } from "commander";
38043
+ import { Command as Command8 } from "commander";
38255
38044
  function rawTokenFrom(data) {
38256
38045
  const token = typeof data === "object" && data !== null && "token" in data ? data.token : void 0;
38257
38046
  if (typeof token !== "string" || !RAW_TOKEN_PATTERN.test(token)) {
@@ -38304,7 +38093,7 @@ function pruneRow(t, reason) {
38304
38093
  };
38305
38094
  }
38306
38095
  function buildBasesTokensCommand() {
38307
- const tokens2 = new Command9("tokens").description("Manage API tokens");
38096
+ const tokens2 = new Command8("tokens").description("Manage API tokens");
38308
38097
  addTokenLifecycleOptions(
38309
38098
  tokens2.command("create").description("Create a scoped API token").requiredOption("--name <name>", "Token name").requiredOption("--grants <json>", "Grant definitions as JSON array").option(
38310
38099
  "--token-only",
@@ -38525,7 +38314,7 @@ var init_base_tags = __esm({
38525
38314
  });
38526
38315
 
38527
38316
  // src/data/commands/bases.ts
38528
- import { Command as Command10 } from "commander";
38317
+ import { Command as Command9 } from "commander";
38529
38318
  function pageOf(path42, cursor) {
38530
38319
  if (!cursor) return path42;
38531
38320
  return `${path42}${path42.includes("?") ? "&" : "?"}cursor=${encodeURIComponent(cursor)}`;
@@ -38538,7 +38327,7 @@ function parseEnum(flag, value, allowed) {
38538
38327
  return value;
38539
38328
  }
38540
38329
  function buildBasesCommand() {
38541
- const bases = new Command10("bases").description("Manage bases");
38330
+ const bases = new Command9("bases").description("Manage bases");
38542
38331
  bases.command("list").description("List all bases").option("--tag <tag>", "Filter by tag").action(async function(opts) {
38543
38332
  const client = await createDataClient();
38544
38333
  const qs = opts.tag ? `?tag=${encodeURIComponent(opts.tag)}` : "";
@@ -38789,7 +38578,6 @@ function buildBasesCommand() {
38789
38578
  bases.addCommand(buildBasesImportCommand());
38790
38579
  bases.addCommand(buildBasesBatchCommand());
38791
38580
  bases.addCommand(buildBasesProvidersCommand());
38792
- bases.addCommand(buildBasesReportCommand());
38793
38581
  return bases;
38794
38582
  }
38795
38583
  var init_bases = __esm({
@@ -38798,7 +38586,6 @@ var init_bases = __esm({
38798
38586
  init_batch();
38799
38587
  init_import();
38800
38588
  init_providers();
38801
- init_report3();
38802
38589
  init_credentials();
38803
38590
  init_sql();
38804
38591
  init_tokens();
@@ -38816,9 +38603,9 @@ var init_bases = __esm({
38816
38603
  });
38817
38604
 
38818
38605
  // src/data/commands/file-types.ts
38819
- import { Command as Command11 } from "commander";
38606
+ import { Command as Command10 } from "commander";
38820
38607
  function buildFileTypesCommand() {
38821
- const fileTypes = new Command11("file-types").description(
38608
+ const fileTypes = new Command10("file-types").description(
38822
38609
  "Manage file types (Buckets) \u2014 storage policy + optional metadata schema for files"
38823
38610
  );
38824
38611
  fileTypes.command("list").description("List all file types in a base").action(async function() {
@@ -38874,8 +38661,8 @@ var init_file_types = __esm({
38874
38661
  });
38875
38662
 
38876
38663
  // src/data/commands/files.ts
38877
- import { Command as Command12 } from "commander";
38878
- import { readFileSync as readFileSync23, writeFileSync as writeFileSync11 } from "fs";
38664
+ import { Command as Command11 } from "commander";
38665
+ import { readFileSync as readFileSync22, writeFileSync as writeFileSync11 } from "fs";
38879
38666
  import { basename as basename27 } from "path";
38880
38667
  function renderFileDiff(fileType, filePath2, from, to, d) {
38881
38668
  console.log(sanitizeTerminalText(`${fileType}/${filePath2}: v${from} \u2192 v${to}`));
@@ -38917,7 +38704,7 @@ function downloadTarget(remotePath2, to) {
38917
38704
  return derived;
38918
38705
  }
38919
38706
  function buildFilesCommand() {
38920
- const files = new Command12("files").description(
38707
+ const files = new Command11("files").description(
38921
38708
  "Manage files (path-addressed, versioned content) within a file type"
38922
38709
  );
38923
38710
  files.command("put <file_type> <path>").description(
@@ -38932,7 +38719,7 @@ function buildFilesCommand() {
38932
38719
  label: opts.label,
38933
38720
  metadata: opts.metadata === void 0 ? void 0 : parseData(opts.metadata, "--metadata")
38934
38721
  });
38935
- const body = readFileSync23(opts.file);
38722
+ const body = readFileSync22(opts.file);
38936
38723
  const client = await createDataClient();
38937
38724
  printOutput(
38938
38725
  await client.upload(
@@ -39125,9 +38912,9 @@ var init_files2 = __esm({
39125
38912
 
39126
38913
  // src/data/commands/inbound-webhooks.ts
39127
38914
  import { randomUUID as randomUUID2 } from "crypto";
39128
- import { Command as Command13 } from "commander";
38915
+ import { Command as Command12 } from "commander";
39129
38916
  function buildInboundWebhooksCommand() {
39130
- const inboundWebhooks = new Command13("inbound-webhooks").description(
38917
+ const inboundWebhooks = new Command12("inbound-webhooks").description(
39131
38918
  "Manage inbound webhook endpoints"
39132
38919
  );
39133
38920
  inboundWebhooks.command("create").description("Create a new inbound webhook").requiredOption("--name <name>", "Inbound webhook name").option("--secret-stdin", "Read the HMAC shared secret from stdin (recommended for CI)").option("--id <id>", "Inbound webhook ID (auto-generated if omitted)").option("--record-type-scope <record_types>", "Comma-separated record_type scope").option(
@@ -39225,9 +39012,9 @@ var init_inbound_webhooks = __esm({
39225
39012
  });
39226
39013
 
39227
39014
  // src/data/commands/query-relationships.ts
39228
- import { Command as Command14 } from "commander";
39015
+ import { Command as Command13 } from "commander";
39229
39016
  function buildQueryRelationshipsCommand() {
39230
- return new Command14("query-relationships").description("Query related records").argument("<record_type>", "RecordType of the source record").argument("<id>", "Source record ID").option("--type <type>", "Filter by relationship type").option("--direction <dir>", "Direction: outgoing, incoming, or both", "both").option("--limit <n>", "Max results", "50").option("--offset <n>", "Skip results", "0").action(async function(recordType2, id, opts) {
39017
+ return new Command13("query-relationships").description("Query related records").argument("<record_type>", "RecordType of the source record").argument("<id>", "Source record ID").option("--type <type>", "Filter by relationship type").option("--direction <dir>", "Direction: outgoing, incoming, or both", "both").option("--limit <n>", "Max results", "50").option("--offset <n>", "Skip results", "0").action(async function(recordType2, id, opts) {
39231
39018
  const base = pathSegment(requireBase(this), "--base");
39232
39019
  const client = await createDataClient();
39233
39020
  const params = new URLSearchParams();
@@ -39260,9 +39047,9 @@ var init_query_relationships = __esm({
39260
39047
  });
39261
39048
 
39262
39049
  // src/data/commands/record-types.ts
39263
- import { Command as Command15 } from "commander";
39050
+ import { Command as Command14 } from "commander";
39264
39051
  function buildRecordTypesCommand() {
39265
- const recordTypes = new Command15("record-types").description("Manage record_types");
39052
+ const recordTypes = new Command14("record-types").description("Manage record_types");
39266
39053
  recordTypes.command("list").description("List all record_types in a base").action(async function() {
39267
39054
  const base = pathSegment(requireBase(this), "--base");
39268
39055
  const client = await createDataClient();
@@ -39320,12 +39107,12 @@ var init_record_types = __esm({
39320
39107
  });
39321
39108
 
39322
39109
  // src/data/commands/records.ts
39323
- import { Command as Command16 } from "commander";
39110
+ import { Command as Command15 } from "commander";
39324
39111
  function recordKey(id, externalSource) {
39325
39112
  return externalSource ? foreignSegment(id, "external id") : pathSegment(id, "record id");
39326
39113
  }
39327
39114
  function buildRecordsCommand() {
39328
- const records = new Command16("records").description("Manage records");
39115
+ const records = new Command15("records").description("Manage records");
39329
39116
  records.command("upsert <record_type>").description("Create or update a record").requiredOption("--data <json>", "Record data (inline JSON or @filename)").option("--id <id>", "Internal record ID (UUID) to update a known record").option("--external-id <id>", "External/agent-supplied ID for idempotent upsert").option("--external-source <source>", "Source system for external_id (e.g. stripe)").action(async function(recordType2, opts) {
39330
39117
  const base = pathSegment(requireBase(this), "--base");
39331
39118
  const client = await createDataClient();
@@ -39414,9 +39201,9 @@ var init_records = __esm({
39414
39201
  });
39415
39202
 
39416
39203
  // src/data/commands/relationship-types.ts
39417
- import { Command as Command17 } from "commander";
39204
+ import { Command as Command16 } from "commander";
39418
39205
  function buildRelationshipTypesCommand() {
39419
- const relationshipTypes = new Command17("relationship-types").description(
39206
+ const relationshipTypes = new Command16("relationship-types").description(
39420
39207
  "Manage relationship types (the schema for a relationship's metadata)"
39421
39208
  );
39422
39209
  relationshipTypes.command("list").description("List all relationship types in a base").action(async function() {
@@ -39493,7 +39280,7 @@ var init_relationship_types = __esm({
39493
39280
  });
39494
39281
 
39495
39282
  // src/data/commands/relationships.ts
39496
- import { Command as Command18 } from "commander";
39283
+ import { Command as Command17 } from "commander";
39497
39284
  function relationshipKey(id, relType) {
39498
39285
  return relType ? foreignSegment(id, "external id") : pathSegment(id, "relationship id");
39499
39286
  }
@@ -39529,7 +39316,7 @@ function byKeyQuery(relType, externalSource) {
39529
39316
  return q ? `?${q}` : "";
39530
39317
  }
39531
39318
  function buildRelationshipsCommand() {
39532
- const relationships = new Command18("relationships").description(
39319
+ const relationships = new Command17("relationships").description(
39533
39320
  "Manage relationships between records"
39534
39321
  );
39535
39322
  relationships.command("upsert").description("Create or update a relationship").option("--source <record_type/id>", "Source record by internal id").option(
@@ -39614,9 +39401,9 @@ var init_relationships = __esm({
39614
39401
  });
39615
39402
 
39616
39403
  // src/data/commands/seed.ts
39617
- import { Command as Command19 } from "commander";
39404
+ import { Command as Command18 } from "commander";
39618
39405
  function buildSeedCommand() {
39619
- const seed = new Command19("seed").description(
39406
+ const seed = new Command18("seed").description(
39620
39407
  "Apply, reset, or clear a seed fixture on a preview base (hermetic eval data)"
39621
39408
  );
39622
39409
  seed.command("apply <name>").description(
@@ -39708,7 +39495,7 @@ var init_seed = __esm({
39708
39495
  });
39709
39496
 
39710
39497
  // src/data/commands/toolsets.ts
39711
- import { Command as Command20 } from "commander";
39498
+ import { Command as Command19 } from "commander";
39712
39499
  function collect(value, previous) {
39713
39500
  return [...previous, value];
39714
39501
  }
@@ -39731,7 +39518,7 @@ function parseRelSpec(spec) {
39731
39518
  return { rel_type: key, operations: ops };
39732
39519
  }
39733
39520
  function buildToolsetsCommand() {
39734
- const toolsets = new Command20("toolsets").description("Manage MCP toolsets");
39521
+ const toolsets = new Command19("toolsets").description("Manage MCP toolsets");
39735
39522
  toolsets.command("upsert <slug>").description("Create or update an MCP toolset").option("--name <name>", "Toolset display name (required unless using --config)").option("--description <desc>", "Toolset description").option(
39736
39523
  "--action <ref>",
39737
39524
  "Reference an Action by id, optionally renamed: <action_id> or <action_id>=<surface_name> (repeatable). Create Actions first with `wayai actions upsert`.",
@@ -39823,9 +39610,9 @@ var init_toolsets = __esm({
39823
39610
 
39824
39611
  // src/data/commands/triggers.ts
39825
39612
  import { randomUUID as randomUUID3 } from "crypto";
39826
- import { Command as Command21 } from "commander";
39613
+ import { Command as Command20 } from "commander";
39827
39614
  function buildTriggersCommand() {
39828
- const triggers = new Command21("triggers").description(
39615
+ const triggers = new Command20("triggers").description(
39829
39616
  "Manage triggers (outbound webhooks, internal writes, external writes)"
39830
39617
  );
39831
39618
  triggers.command("create").description(
@@ -39931,7 +39718,7 @@ __export(program_exports, {
39931
39718
  withBaseOption: () => withBaseOption,
39932
39719
  withDataGlobals: () => withDataGlobals
39933
39720
  });
39934
- import { Command as Command22 } from "commander";
39721
+ import { Command as Command21 } from "commander";
39935
39722
  function withDataGlobals(command2) {
39936
39723
  return command2.option("--org <uuid>", "Organization to operate against (overrides the repo's org binding)").option("--output <format>", "Output format: json or table", "table").option("--json", "Shorthand for --output json");
39937
39724
  }
@@ -39954,7 +39741,7 @@ function handleParserExit(err) {
39954
39741
  throw err;
39955
39742
  }
39956
39743
  function buildDataProgram() {
39957
- const program = new Command22("wayai");
39744
+ const program = new Command21("wayai");
39958
39745
  program.addCommand(withDataGlobals(buildBasesCommand()));
39959
39746
  for (const build of [
39960
39747
  buildRecordsCommand,
@@ -40021,9 +39808,9 @@ init_errors2();
40021
39808
  init_mask_secrets();
40022
39809
  init_utils();
40023
39810
  init_registry();
40024
- import { readFileSync as readFileSync24 } from "fs";
40025
- import { fileURLToPath as fileURLToPath3 } from "url";
40026
- import { dirname as dirname17, join as join38 } from "path";
39811
+ import { readFileSync as readFileSync23 } from "fs";
39812
+ import { fileURLToPath as fileURLToPath2 } from "url";
39813
+ import { dirname as dirname16, join as join37 } from "path";
40027
39814
 
40028
39815
  // src/lib/version-refresh.ts
40029
39816
  init_version_cache();
@@ -40178,8 +39965,8 @@ Run \`wayai admin skill install\` to update.`);
40178
39965
  }
40179
39966
 
40180
39967
  // src/index.ts
40181
- var __dirname = dirname17(fileURLToPath3(import.meta.url));
40182
- var pkg = JSON.parse(readFileSync24(join38(__dirname, "..", "package.json"), "utf-8"));
39968
+ var __dirname = dirname16(fileURLToPath2(import.meta.url));
39969
+ var pkg = JSON.parse(readFileSync23(join37(__dirname, "..", "package.json"), "utf-8"));
40183
39970
  var [, , command, ...args] = process.argv;
40184
39971
  var isBackgroundRefresh = command === REFRESH_COMMAND;
40185
39972
  if (!isBackgroundRefresh) initSentry(command, pkg.version);
@@ -40557,7 +40344,7 @@ async function runForeground() {
40557
40344
  try {
40558
40345
  await main();
40559
40346
  if (command && !SKIP_UPDATE_CHECK.includes(command) && !wantsHelp(args)) {
40560
- showUpdateNudges(pkg.version, fileURLToPath3(import.meta.url));
40347
+ showUpdateNudges(pkg.version, fileURLToPath2(import.meta.url));
40561
40348
  }
40562
40349
  await closeSentry();
40563
40350
  } catch (err) {