@wave-ai-os/wave-cli 0.2.1 → 0.2.3

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.
Files changed (3) hide show
  1. package/dist/index.cjs +846 -583
  2. package/dist/index.js +840 -577
  3. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -5,7 +5,7 @@ import { CommanderError, InvalidArgumentError } from "commander";
5
5
  import { ZodError } from "zod";
6
6
 
7
7
  // src/cli.ts
8
- import { Command, Option as Option7 } from "commander";
8
+ import { Command, Option as Option8 } from "commander";
9
9
 
10
10
  // src/authStorage.ts
11
11
  import { execFile } from "child_process";
@@ -656,17 +656,17 @@ function inferStatusFromGraphqlErrors(errors) {
656
656
  if (codes.includes("INVALID_SCOPE") || codes.includes("UNSUPPORTED_BRANCH")) {
657
657
  return 400;
658
658
  }
659
- const text5 = JSON.stringify(errors).toLowerCase();
660
- if (text5.includes("unauthorized") || text5.includes("not authenticated")) {
659
+ const text6 = JSON.stringify(errors).toLowerCase();
660
+ if (text6.includes("unauthorized") || text6.includes("not authenticated")) {
661
661
  return 401;
662
662
  }
663
- if (text5.includes("forbidden")) {
663
+ if (text6.includes("forbidden")) {
664
664
  return 403;
665
665
  }
666
- if (text5.includes("not found")) {
666
+ if (text6.includes("not found")) {
667
667
  return 404;
668
668
  }
669
- if (text5.includes("validation")) {
669
+ if (text6.includes("validation")) {
670
670
  return 422;
671
671
  }
672
672
  return 400;
@@ -819,9 +819,9 @@ async function requestGraphqlHttp(params) {
819
819
  signal: params.controller.signal
820
820
  });
821
821
  const responseRequestId = response.headers.get("x-request-id") ?? params.requestId;
822
- const text5 = await response.text();
823
- const payload = text5 ? parseJsonSafely(text5) : null;
824
- const body3 = payload ?? (text5.length > 0 ? text5 : null);
822
+ const text6 = await response.text();
823
+ const payload = text6 ? parseJsonSafely(text6) : null;
824
+ const body3 = payload ?? (text6.length > 0 ? text6 : null);
825
825
  const graph = payload && typeof payload === "object" ? payload : {};
826
826
  return {
827
827
  status: response.status,
@@ -1139,9 +1139,9 @@ function sleepBriefly(ms) {
1139
1139
  const lock = new Int32Array(new SharedArrayBuffer(4));
1140
1140
  Atomics.wait(lock, 0, 0, ms);
1141
1141
  }
1142
- function writeStdoutFully(text5) {
1142
+ function writeStdoutFully(text6) {
1143
1143
  const fd = typeof process.stdout.fd === "number" ? process.stdout.fd : 1;
1144
- const buffer = Buffer.from(text5, "utf8");
1144
+ const buffer = Buffer.from(text6, "utf8");
1145
1145
  let offset = 0;
1146
1146
  while (offset < buffer.length) {
1147
1147
  try {
@@ -2028,8 +2028,8 @@ async function authGraphqlRequest(params) {
2028
2028
  signal: controller.signal
2029
2029
  });
2030
2030
  const responseRequestId = response.headers.get("x-request-id") ?? requestId;
2031
- const text5 = await response.text();
2032
- const payload = text5 ? parseJsonSafely2(text5) : null;
2031
+ const text6 = await response.text();
2032
+ const payload = text6 ? parseJsonSafely2(text6) : null;
2033
2033
  const graph = payload && typeof payload === "object" && !Array.isArray(payload) ? payload : {};
2034
2034
  const gqlError = graphqlErrors(graph, knownSecrets);
2035
2035
  if (gqlError) {
@@ -3721,7 +3721,7 @@ var BROADCAST_OPERATIONS = [
3721
3721
  mutation("newsletter.campaigns.create", "create_newsletter_campaign", "Create one approved Newsletter draft using the existing nested editor inputs", {}, newsletterPayloads.campaignCreate, "NewsletterCampaignCreateInput!"),
3722
3722
  mutation("newsletter.campaigns.update", "update_newsletter_campaign", "Update one approved Newsletter campaign at its saved revision", campaignId, newsletterPayloads.campaignUpdate, "NewsletterCampaignUpdateInput!"),
3723
3723
  mutation("newsletter.campaigns.duplicate", "duplicate_newsletter_campaign", "Duplicate one approved Newsletter campaign", campaignId, newsletterPayloads.duplicate, "NewsletterCampaignDuplicateInput"),
3724
- ...["archive", "restore", "delete"].map((action) => mutation(`newsletter.campaigns.${action}`, `${action === "delete" ? "destroy" : action}_newsletter_campaign`, action === "delete" ? "Delete one approved draft-only Newsletter campaign" : `${action} one approved Newsletter campaign; archive is not delivery cancellation`, campaignId, void 0, void 0, action !== "restore")),
3724
+ ...["archive", "restore", "delete"].map((action2) => mutation(`newsletter.campaigns.${action2}`, `${action2 === "delete" ? "destroy" : action2}_newsletter_campaign`, action2 === "delete" ? "Delete one approved draft-only Newsletter campaign" : `${action2} one approved Newsletter campaign; archive is not delivery cancellation`, campaignId, void 0, void 0, action2 !== "restore")),
3725
3725
  mutation("newsletter.campaigns.schedule", "schedule_newsletter_campaign", "Schedule/send an approved Newsletter draft using supplied rendered HTML/text and managed audience", campaignId, newsletterPayloads.schedule, "NewsletterCampaignScheduleInput!"),
3726
3726
  mutation("newsletter.campaigns.send", "schedule_newsletter_campaign", "Send an approved Newsletter draft immediately; accepted/publishing is not delivered", campaignId, newsletterPayloads.send, "NewsletterCampaignScheduleInput!"),
3727
3727
  mutation("newsletter.campaigns.test-send", "test_send_newsletter_campaign", "Send a real approved revision-bound test email to one to five explicit recipients", campaignId, newsletterPayloads.testSend, "NewsletterCampaignTestSendInput!"),
@@ -4320,8 +4320,8 @@ function registerEntityCrudCommands(program, config) {
4320
4320
  });
4321
4321
  });
4322
4322
  const update = entityCommand.command("update").requiredOption("--id <id>").requiredOption("--data-json <dataJson>", updateHelp5);
4323
- for (const option2 of config.updatePreconditions?.options ?? []) {
4324
- update.option(option2.flags, option2.description);
4323
+ for (const option3 of config.updatePreconditions?.options ?? []) {
4324
+ update.option(option3.flags, option3.description);
4325
4325
  }
4326
4326
  update.action(async (opts, cmd) => {
4327
4327
  const preconditions = config.updatePreconditions?.parse(opts);
@@ -7777,9 +7777,9 @@ function parseToolFromGraphqlError(errorBody) {
7777
7777
  return null;
7778
7778
  }
7779
7779
  function toolHintFromPathLike(value) {
7780
- const text5 = toDisplay(value);
7781
- if (text5 === "") return null;
7782
- const [first] = text5.split("/");
7780
+ const text6 = toDisplay(value);
7781
+ if (text6 === "") return null;
7782
+ const [first] = text6.split("/");
7783
7783
  return first ? first.trim() : null;
7784
7784
  }
7785
7785
  function unsupportedToolFromHints(params) {
@@ -8422,14 +8422,14 @@ function registerMutationCapabilityCommands(program) {
8422
8422
  // src/commands/osmd.ts
8423
8423
  import { readFile as readFile3 } from "fs/promises";
8424
8424
  import { basename } from "path";
8425
- import { z as z27 } from "zod";
8425
+ import { z as z28 } from "zod";
8426
8426
  import { Option } from "commander";
8427
8427
 
8428
8428
  // src/operationManifest.ts
8429
8429
  import { createHash } from "crypto";
8430
8430
 
8431
8431
  // src/version.ts
8432
- var CLI_VERSION = "0.2.1";
8432
+ var CLI_VERSION = "0.2.3";
8433
8433
 
8434
8434
  // src/commands/phoneOperationCatalog.ts
8435
8435
  import { z as z24 } from "zod";
@@ -8522,9 +8522,9 @@ var PHONE_OPERATIONS = [
8522
8522
  write("devices.rotate-credential", "rotate_phone_device_credential", [deviceId, key2], { sensitiveReceipt: true }),
8523
8523
  read("voice.availability", "phone_voice_availability", [], "{ available phoneNumberId }", { description: "Check browser voice calling availability for this member: eligible owned Phone line phoneNumberId. Does not issue tokens or place calls." })
8524
8524
  ];
8525
- var phoneArgument = (option2) => option2.argument ?? option2.name.replace(/[A-Z]/g, (letter) => `_${letter.toLowerCase()}`);
8525
+ var phoneArgument = (option3) => option3.argument ?? option3.name.replace(/[A-Z]/g, (letter) => `_${letter.toLowerCase()}`);
8526
8526
  function parsePhoneInput(operation, value) {
8527
- const shape = Object.fromEntries(operation.options.map((option2) => [option2.name, option2.required ? option2.schema : option2.schema.optional()]));
8527
+ const shape = Object.fromEntries(operation.options.map((option3) => [option3.name, option3.required ? option3.schema : option3.schema.optional()]));
8528
8528
  return z24.object(shape).strict().superRefine((parsed, context) => {
8529
8529
  for (const [operationId2, first, second] of [
8530
8530
  ["phone.devices.show", "id", "slug"],
@@ -8555,7 +8555,7 @@ function phoneExampleInput(id6) {
8555
8555
  const operation = PHONE_OPERATIONS.find((operation2) => operation2.id === id6);
8556
8556
  if (!operation) return void 0;
8557
8557
  const examples = { e164: "+16235550123", number: "+16235550123", body: "Approved test message", idempotencyKey: "phone-example-1", approvedMonthlyPrice: "1.00", currency: "USD", term: "623", detailsJson: "{}", phoneNumberIds: "1", macAddress: "24:9A:D8:53:0F:7D", expectedRevision: "1", displayName: "Wave", status: "open" };
8558
- const input = Object.fromEntries(operation.options.filter((option2) => option2.required).map((option2) => [option2.name, examples[option2.name] ?? (option2.type === "ID" ? "1" : "Example")]));
8558
+ const input = Object.fromEntries(operation.options.filter((option3) => option3.required).map((option3) => [option3.name, examples[option3.name] ?? (option3.type === "ID" ? "1" : "Example")]));
8559
8559
  if (id6 === "phone.devices.show") input.id = "1";
8560
8560
  if (id6 === "phone.conversations.create") input.number = "+16235550123";
8561
8561
  if (id6 === "phone.conversations.set-contact") input.contactId = "1";
@@ -8689,7 +8689,7 @@ var CHAT_OPERATIONS = [
8689
8689
  "search",
8690
8690
  "chats",
8691
8691
  listOptions.map(
8692
- (option2) => option2.name === "search" ? { ...option2, required: true } : option2
8692
+ (option3) => option3.name === "search" ? { ...option3, required: true } : option3
8693
8693
  ),
8694
8694
  collection(metadata)
8695
8695
  ),
@@ -8807,12 +8807,12 @@ var CHAT_OPERATIONS = [
8807
8807
  ]),
8808
8808
  rest("huddles.thread", "POST", "huddle/thread", [chatId])
8809
8809
  ];
8810
- var chatArgument = (option2) => option2.argument ?? option2.name.replace(/[A-Z]/g, (letter) => `_${letter.toLowerCase()}`);
8810
+ var chatArgument = (option3) => option3.argument ?? option3.name.replace(/[A-Z]/g, (letter) => `_${letter.toLowerCase()}`);
8811
8811
  function parseChatInput(operation, value) {
8812
8812
  const shape = Object.fromEntries(
8813
- operation.options.map((option2) => [
8814
- option2.name,
8815
- option2.required ? option2.schema : option2.schema.optional()
8813
+ operation.options.map((option3) => [
8814
+ option3.name,
8815
+ option3.required ? option3.schema : option3.schema.optional()
8816
8816
  ])
8817
8817
  );
8818
8818
  return z25.object(shape).strict().superRefine((input, context) => {
@@ -8828,7 +8828,7 @@ function parseChatInput(operation, value) {
8828
8828
  code: "custom",
8829
8829
  message: "New messages cannot remove an existing resource"
8830
8830
  });
8831
- if (operation.id === "chats.update" && !edits.some((option2) => input[option2.name] !== void 0))
8831
+ if (operation.id === "chats.update" && !edits.some((option3) => input[option3.name] !== void 0))
8832
8832
  context.addIssue({ code: "custom", message: "At least one Chat edit is required" });
8833
8833
  if (input["starredOnly"] && input["excludeStarred"])
8834
8834
  context.addIssue({ code: "custom", message: "Star filters are mutually exclusive" });
@@ -8866,7 +8866,7 @@ function chatExampleInput(id6) {
8866
8866
  attachmentsJson: "[]"
8867
8867
  };
8868
8868
  const input = Object.fromEntries(
8869
- operation.options.filter((option2) => option2.required).map((option2) => [option2.name, values[option2.name] ?? "1"])
8869
+ operation.options.filter((option3) => option3.required).map((option3) => [option3.name, values[option3.name] ?? "1"])
8870
8870
  );
8871
8871
  if (id6 === "chats.update") input["name"] = "Renamed test Chat";
8872
8872
  if (["chats.messages.send", "chats.messages.reply", "chats.messages.update"].includes(id6))
@@ -8975,7 +8975,9 @@ var write3 = (name, field, payload, target2 = false) => ({
8975
8975
  });
8976
8976
  var FLOW_OPERATIONS = [
8977
8977
  read3("workspace", "flow_workspace"),
8978
- read3("setup.show", "flow_workspace"),
8978
+ read3("setup.show", "flow_workspace", [], {
8979
+ description: "Read saved Flow settings: QuickBooks and Stripe connection status, recorded verification timestamps and capabilities; no Verify, Sync or reconnect."
8980
+ }),
8979
8981
  ...FLOW_COLLECTIONS.flatMap((collection2) => {
8980
8982
  const name = collection2.replaceAll("_", "-");
8981
8983
  const filters = [
@@ -8991,7 +8993,9 @@ var FLOW_OPERATIONS = [
8991
8993
  read3("selectors", "flow_workspace", [choice2("collection", FLOW_COLLECTIONS, true), option("ids", z26.string().transform((raw) => raw.split(",").map((value) => value.trim())).pipe(z26.array(identifier3).min(1).max(50))), ...page2]),
8992
8994
  read3("approvals.review", "flow_approval_review", [id4]),
8993
8995
  read3("payments.details", "flow_payment_details", [id4]),
8994
- read3("invoicing.setup", "flow_invoicing_setup"),
8996
+ read3("invoicing.setup", "flow_invoicing_setup", [], {
8997
+ description: "Read QuickBooks company name and supported invoice items, with the selected invoice accounting item; provider reads only, no Verify, Sync or configuration writes."
8998
+ }),
8995
8999
  read3("reports.show", "flow_report", [
8996
9000
  choice2("reportType", ["profit_and_loss", "cash_flow", "balance_sheet", "accounts_receivable", "accounts_payable"], true),
8997
9001
  option("startDate", date2),
@@ -9097,6 +9101,203 @@ function flowExampleInput(id6) {
9097
9101
  };
9098
9102
  }
9099
9103
 
9104
+ // src/commands/prospectingOperationCatalog.ts
9105
+ import { z as z27 } from "zod";
9106
+ var identifier4 = z27.string().trim().regex(/^[A-Za-z0-9_-]{1,128}$/);
9107
+ var text5 = z27.string().trim().min(1).max(4e3);
9108
+ var page3 = z27.coerce.number().int().min(1).max(1e5);
9109
+ var jsonObject = z27.string().max(256e3).transform((value, context) => {
9110
+ try {
9111
+ const parsed = JSON.parse(value);
9112
+ return z27.record(z27.string(), z27.unknown()).parse(parsed);
9113
+ } catch {
9114
+ context.addIssue({ code: "custom", message: "dataJson must be a JSON object" });
9115
+ return z27.NEVER;
9116
+ }
9117
+ });
9118
+ var option2 = (name, type, schema = text5, required = false, choices) => ({ name, type, schema, required, ...choices ? { choices } : {} });
9119
+ var runIds = option2(
9120
+ "runIds",
9121
+ "[ID!]!",
9122
+ z27.string().transform((value) => value.split(",").map((id6) => id6.trim())).pipe(z27.array(identifier4).min(1).max(100)),
9123
+ true
9124
+ );
9125
+ var PROSPECTING_ACTIONS = [
9126
+ "select_list_records",
9127
+ "copy_list_members",
9128
+ "move_list_members",
9129
+ "promote_list_members",
9130
+ "save_profile",
9131
+ "create_list",
9132
+ "update_list",
9133
+ "load_prospect_sheet",
9134
+ "preview_import",
9135
+ "import_candidates",
9136
+ "assess_members",
9137
+ "remove_members",
9138
+ "promote_candidate",
9139
+ "configure_list_dropdown",
9140
+ "add_list_column",
9141
+ "edit_custom_list_field",
9142
+ "update_list_column",
9143
+ "duplicate_list_column",
9144
+ "delete_list_column",
9145
+ "edit_list_field",
9146
+ "save_search",
9147
+ "archive_search",
9148
+ "build_search_filters",
9149
+ "composer_leads",
9150
+ "preview_email",
9151
+ "send_test_email",
9152
+ "check_email_deliverability",
9153
+ "assist_email",
9154
+ "list_email_templates",
9155
+ "save_email_template",
9156
+ "update_outreach_draft",
9157
+ "send_outreach_draft",
9158
+ "reply_to_outreach",
9159
+ "set_unibox_status",
9160
+ "restart_campaign_refill",
9161
+ "campaign_audience_suggestions",
9162
+ "add_campaign_lead_column",
9163
+ "set_campaign_lead_status",
9164
+ "campaign_lead_action",
9165
+ "update_campaign_lead",
9166
+ "create_campaign",
9167
+ "update_campaign",
9168
+ "save_campaign_draft",
9169
+ "save_campaign_settings",
9170
+ "delete_campaign",
9171
+ "preview_campaign",
9172
+ "prepare_campaign",
9173
+ "launch_campaign",
9174
+ "pause_campaign",
9175
+ "save_campaign_report_access",
9176
+ "save_campaign_lead_view",
9177
+ "export_campaign_activity",
9178
+ "manage_campaign_leads",
9179
+ "save_analytics_preferences",
9180
+ "stop_enrollment",
9181
+ "classify_reply",
9182
+ "create_opportunity",
9183
+ "preview_campaign_enrichment",
9184
+ "run_campaign_enrichment",
9185
+ "cancel_campaign_enrichment",
9186
+ "save_campaign_enrichment_template",
9187
+ "preview_list_enrichment",
9188
+ "run_list_enrichment",
9189
+ "cancel_list_enrichment",
9190
+ "search_companies",
9191
+ "add_companies",
9192
+ "search_people",
9193
+ "add_people",
9194
+ "enrich_members",
9195
+ "verify_members",
9196
+ "cancel_provider_run",
9197
+ "resume_provider_run",
9198
+ "retry_provider_run",
9199
+ "create_workflow",
9200
+ "update_workflow"
9201
+ ];
9202
+ var action = option2(
9203
+ "action",
9204
+ "String",
9205
+ z27.enum(PROSPECTING_ACTIONS),
9206
+ true,
9207
+ PROSPECTING_ACTIONS
9208
+ );
9209
+ var idempotencyKey2 = option2(
9210
+ "idempotencyKey",
9211
+ "String",
9212
+ z27.string().regex(/^[\w-]{8,128}$/),
9213
+ true
9214
+ );
9215
+ var read4 = (name, field, options) => ({
9216
+ id: `prospecting.${name}`,
9217
+ field,
9218
+ options,
9219
+ classification: "read",
9220
+ description: `Read bounded authorized Prospecting ${name.replaceAll("-", " ")}; no provider run, campaign, outreach, or record write.`
9221
+ });
9222
+ var PROSPECTING_OPERATIONS = [
9223
+ read4("workspace", "prospecting_workspace", [
9224
+ option2("activityPage", "Int", page3),
9225
+ option2("bouncePage", "Int", page3),
9226
+ option2("activitySearch", "String"),
9227
+ option2("activityKind", "String"),
9228
+ option2("rangeStart", "String"),
9229
+ option2("rangeEnd", "String"),
9230
+ option2("leadStatus", "String"),
9231
+ option2("period", "String"),
9232
+ option2("listId", "ID", identifier4),
9233
+ option2("campaignId", "ID", identifier4),
9234
+ option2("page", "Int", page3),
9235
+ option2("search", "String"),
9236
+ option2("qualification", "String"),
9237
+ option2("fieldFilters", "String"),
9238
+ option2("sort", "String")
9239
+ ]),
9240
+ read4("people-search-runs", "prospecting_people_search_runs", [runIds]),
9241
+ read4("company-search-runs", "prospecting_company_search_runs", [runIds]),
9242
+ read4("campaign-report", "prospecting_campaign_report", [
9243
+ option2("campaignId", "ID", identifier4, true),
9244
+ option2("period", "String"),
9245
+ option2("rangeStart", "String"),
9246
+ option2("rangeEnd", "String")
9247
+ ]),
9248
+ read4("mail", "prospecting_mail", [
9249
+ option2("campaignId", "ID", identifier4),
9250
+ option2("folder", "String"),
9251
+ option2("page", "Int", page3),
9252
+ option2("search", "String")
9253
+ ]),
9254
+ {
9255
+ id: "prospecting.command",
9256
+ field: "execute_prospecting_command",
9257
+ classification: "write",
9258
+ description: "Apply one exact approved Prospecting action with validated JSON input and an idempotency key.",
9259
+ options: [action, option2("dataJson", "JSON!", jsonObject, true), idempotencyKey2]
9260
+ }
9261
+ ];
9262
+ function parseProspectingInput(operation, raw) {
9263
+ const shape = Object.fromEntries(
9264
+ operation.options.map((definition) => [
9265
+ definition.name,
9266
+ definition.required ? definition.schema : definition.schema.optional()
9267
+ ])
9268
+ );
9269
+ return z27.object(shape).strict().parse(raw);
9270
+ }
9271
+ function validateProspectingInput(id6, input) {
9272
+ const operation = PROSPECTING_OPERATIONS.find((candidate) => candidate.id === id6);
9273
+ if (!operation) return [];
9274
+ try {
9275
+ parseProspectingInput(operation, input);
9276
+ return [];
9277
+ } catch (error) {
9278
+ return [error instanceof Error ? error.message : "Invalid Prospecting input"];
9279
+ }
9280
+ }
9281
+ function prospectingArgument(name) {
9282
+ return name.replace(/[A-Z]/g, (letter) => `_${letter.toLowerCase()}`);
9283
+ }
9284
+ function prospectingExampleInput(id6) {
9285
+ const operation = PROSPECTING_OPERATIONS.find((candidate) => candidate.id === id6);
9286
+ if (!operation) return void 0;
9287
+ if (id6 === "prospecting.people-search-runs" || id6 === "prospecting.company-search-runs") {
9288
+ return { runIds: "1" };
9289
+ }
9290
+ if (id6 === "prospecting.campaign-report") return { campaignId: "1" };
9291
+ if (id6 === "prospecting.command") {
9292
+ return {
9293
+ action: "create_campaign",
9294
+ dataJson: JSON.stringify({ name: "Draft campaign", list_id: "1" }),
9295
+ idempotencyKey: "prospecting-example-1"
9296
+ };
9297
+ }
9298
+ return {};
9299
+ }
9300
+
9100
9301
  // src/operationMetadata.ts
9101
9302
  var DISCOVERY_OPERATION_IDS = [
9102
9303
  "flow.schema",
@@ -9221,6 +9422,7 @@ var DISCOVERY_OPERATION_IDS = [
9221
9422
  ];
9222
9423
  var READ_OPERATION_IDS = [
9223
9424
  ...FLOW_OPERATIONS.filter((operation) => operation.classification === "read").map((operation) => operation.id),
9425
+ ...PROSPECTING_OPERATIONS.filter((operation) => operation.classification === "read").map((operation) => operation.id),
9224
9426
  ...CHAT_OPERATIONS.filter((operation) => operation.classification === "read").map((operation) => operation.id),
9225
9427
  ...PHONE_OPERATIONS.filter((operation) => operation.classification === "read").map((operation) => operation.id),
9226
9428
  "broadcast.channels.list",
@@ -9473,6 +9675,7 @@ var READ_OPERATION_IDS = [
9473
9675
  ];
9474
9676
  var WRITE_OPERATION_IDS = [
9475
9677
  ...FLOW_OPERATIONS.filter((operation) => operation.classification === "write").map((operation) => operation.id),
9678
+ ...PROSPECTING_OPERATIONS.filter((operation) => operation.classification === "write").map((operation) => operation.id),
9476
9679
  ...CHAT_OPERATIONS.filter((operation) => operation.classification === "write").map((operation) => operation.id),
9477
9680
  ...PHONE_OPERATIONS.filter((operation) => operation.classification === "write").map((operation) => operation.id),
9478
9681
  "broadcast.drafts.create",
@@ -9758,13 +9961,13 @@ function registeredOperationMetadata(id6) {
9758
9961
  // src/operationManifest.ts
9759
9962
  var MANIFEST_ENUM_CHOICES = /* @__PURE__ */ Symbol("waveManifestEnumChoices");
9760
9963
  var MACHINE_PRESENTATION_OPTIONS = /* @__PURE__ */ new Set(["json", "readable"]);
9761
- function withManifestEnumChoices(option2, choices) {
9762
- option2[MANIFEST_ENUM_CHOICES] = [...choices];
9763
- return option2;
9964
+ function withManifestEnumChoices(option3, choices) {
9965
+ option3[MANIFEST_ENUM_CHOICES] = [...choices];
9966
+ return option3;
9764
9967
  }
9765
- function manifestEnumChoices(option2) {
9968
+ function manifestEnumChoices(option3) {
9766
9969
  return [
9767
- ...option2[MANIFEST_ENUM_CHOICES] ?? option2.argChoices ?? []
9970
+ ...option3[MANIFEST_ENUM_CHOICES] ?? option3.argChoices ?? []
9768
9971
  ];
9769
9972
  }
9770
9973
  function isMachinePresentationOption(key3) {
@@ -9801,17 +10004,17 @@ function inputSchemaFor(command, id6) {
9801
10004
  };
9802
10005
  if (argument.required) required.push(key3);
9803
10006
  }
9804
- for (const option2 of command.options) {
9805
- const key3 = option2.attributeName();
10007
+ for (const option3 of command.options) {
10008
+ const key3 = option3.attributeName();
9806
10009
  if (isMachinePresentationOption(key3)) continue;
9807
- const payloadSchema = key3 === "dataJson" ? dataJsonSchemaPropertyForOperation(id6, option2.description) : null;
9808
- const enumChoices = manifestEnumChoices(option2);
10010
+ const payloadSchema = key3 === "dataJson" ? dataJsonSchemaPropertyForOperation(id6, option3.description) : null;
10011
+ const enumChoices = manifestEnumChoices(option3);
9809
10012
  properties[key3] = payloadSchema ?? {
9810
- type: option2.required ? "string" : option2.optional ? ["boolean", "string"] : "boolean",
9811
- ...option2.description ? { description: option2.description } : {},
10013
+ type: option3.required ? "string" : option3.optional ? ["boolean", "string"] : "boolean",
10014
+ ...option3.description ? { description: option3.description } : {},
9812
10015
  ...enumChoices.length ? { enum: enumChoices } : {}
9813
10016
  };
9814
- if (option2.mandatory) required.push(key3);
10017
+ if (option3.mandatory) required.push(key3);
9815
10018
  }
9816
10019
  return {
9817
10020
  type: "object",
@@ -9827,6 +10030,8 @@ function exampleFor(inputSchema, id6) {
9827
10030
  if (phoneInput) return [{ name: "minimal valid Phone input", input: phoneInput }];
9828
10031
  const chatInput = chatExampleInput(id6);
9829
10032
  if (chatInput) return [{ name: "minimal valid member Chat input", input: chatInput }];
10033
+ const prospectingInput = prospectingExampleInput(id6);
10034
+ if (prospectingInput) return [{ name: "minimal valid Prospecting input", input: prospectingInput }];
9830
10035
  const input = {};
9831
10036
  for (const key3 of inputSchema.required) {
9832
10037
  const broadcastExample = broadcastArgumentExample(id6, key3);
@@ -9922,15 +10127,15 @@ function buildOperationManifest(program) {
9922
10127
  }
9923
10128
 
9924
10129
  // src/commands/osmd.ts
9925
- var sourceSchema = z27.enum([
10130
+ var sourceSchema = z28.enum([
9926
10131
  "canonical_osmd",
9927
10132
  "agent_overlay",
9928
10133
  "agent_wiki",
9929
10134
  "thread_workspace"
9930
10135
  ]);
9931
- var accessSchema = z27.enum(["read_only", "read_write", "append_only"]).catch("read_write");
9932
- var ownerSchema = z27.enum(["system", "atlas"]);
9933
- var suggestedActionSchema = z27.enum([
10136
+ var accessSchema = z28.enum(["read_only", "read_write", "append_only"]).catch("read_write");
10137
+ var ownerSchema = z28.enum(["system", "atlas"]);
10138
+ var suggestedActionSchema = z28.enum([
9934
10139
  "read",
9935
10140
  "create",
9936
10141
  "init",
@@ -9939,7 +10144,7 @@ var suggestedActionSchema = z27.enum([
9939
10144
  "forbidden",
9940
10145
  "invalid_parent"
9941
10146
  ]).catch("update");
9942
- var agentMarkdownErrorCodeSchema = z27.enum([
10147
+ var agentMarkdownErrorCodeSchema = z28.enum([
9943
10148
  "canonical_osmd_read_only",
9944
10149
  "agent_parent_not_found",
9945
10150
  "agent_file_not_found",
@@ -9950,9 +10155,9 @@ var agentMarkdownErrorCodeSchema = z27.enum([
9950
10155
  "invalid_agent_wiki_path"
9951
10156
  ]);
9952
10157
  var agentMarkdownErrorCodeFieldSchema = agentMarkdownErrorCodeSchema.nullable().catch(null);
9953
- var nonEmptyString3 = z27.string().min(1);
9954
- var nonNegativeInt3 = z27.coerce.number().int().min(0);
9955
- var positiveInt = z27.coerce.number().int().min(1);
10158
+ var nonEmptyString3 = z28.string().min(1);
10159
+ var nonNegativeInt3 = z28.coerce.number().int().min(0);
10160
+ var positiveInt = z28.coerce.number().int().min(1);
9956
10161
  var supportedAgentOverlaySystemFiles = ["notes.md", "summary.md"];
9957
10162
  var supportedWikiIndexFile = "index.md";
9958
10163
  var supportedWikiLogFile = "log.md";
@@ -9968,20 +10173,20 @@ var supportedWikiControlledPatterns = supportedWikiControlledFolders.map(
9968
10173
  );
9969
10174
  var controlledWikiSlugPattern = /^[a-z0-9][a-z0-9-]*$/;
9970
10175
  var agentMarkdownSlugPattern = /^[a-z0-9][a-z0-9-]*$/;
9971
- var osmdSearchScopeSchema = z27.enum([
10176
+ var osmdSearchScopeSchema = z28.enum([
9972
10177
  "os-only",
9973
10178
  "agent-overlay-only",
9974
10179
  "agent-wiki-only",
9975
10180
  "combined"
9976
10181
  ]);
9977
- var osmdLintScopeSchema = z27.enum([
10182
+ var osmdLintScopeSchema = z28.enum([
9978
10183
  "combined",
9979
10184
  "agent-overlay-only",
9980
10185
  "agent-wiki-only"
9981
10186
  ]);
9982
- var osmdMemoryQualityScopeSchema = z27.enum(["agent-overlay-only"]);
9983
- var osmdIngestKindSchema = z27.enum(["text", "file", "url", "transcript"]);
9984
- var osmdRawSourceTypeSchema = z27.enum([
10187
+ var osmdMemoryQualityScopeSchema = z28.enum(["agent-overlay-only"]);
10188
+ var osmdIngestKindSchema = z28.enum(["text", "file", "url", "transcript"]);
10189
+ var osmdRawSourceTypeSchema = z28.enum([
9985
10190
  "pasted_text",
9986
10191
  "uploaded_markdown",
9987
10192
  "uploaded_text",
@@ -9990,37 +10195,37 @@ var osmdRawSourceTypeSchema = z27.enum([
9990
10195
  "meeting_transcript",
9991
10196
  "url"
9992
10197
  ]);
9993
- var agentMarkdownFileSchema = z27.preprocess(
10198
+ var agentMarkdownFileSchema = z28.preprocess(
9994
10199
  normalizeAgentMarkdownJsonKeys,
9995
- z27.object({
9996
- path: z27.string(),
10200
+ z28.object({
10201
+ path: z28.string(),
9997
10202
  source: sourceSchema,
9998
10203
  access: accessSchema,
9999
10204
  owner: ownerSchema,
10000
- exists: z27.boolean(),
10001
- canCreate: z27.boolean(),
10002
- canUpdate: z27.boolean(),
10003
- canAppend: z27.boolean(),
10004
- wikiRole: z27.string().nullable().optional(),
10005
- formatVersion: z27.string().nullable().optional(),
10006
- createdAt: z27.string().nullable().optional(),
10007
- updatedAt: z27.string().nullable().optional(),
10008
- ingestedAt: z27.string().nullable().optional(),
10009
- lastSeenAt: z27.string().nullable().optional(),
10010
- canonicalParentUpdatedAt: z27.string().nullable().optional(),
10011
- parentRef: z27.string().nullable().optional(),
10012
- agentChildrenAllowed: z27.boolean(),
10205
+ exists: z28.boolean(),
10206
+ canCreate: z28.boolean(),
10207
+ canUpdate: z28.boolean(),
10208
+ canAppend: z28.boolean(),
10209
+ wikiRole: z28.string().nullable().optional(),
10210
+ formatVersion: z28.string().nullable().optional(),
10211
+ createdAt: z28.string().nullable().optional(),
10212
+ updatedAt: z28.string().nullable().optional(),
10213
+ ingestedAt: z28.string().nullable().optional(),
10214
+ lastSeenAt: z28.string().nullable().optional(),
10215
+ canonicalParentUpdatedAt: z28.string().nullable().optional(),
10216
+ parentRef: z28.string().nullable().optional(),
10217
+ agentChildrenAllowed: z28.boolean(),
10013
10218
  suggestedAction: suggestedActionSchema,
10014
10219
  errorCode: agentMarkdownErrorCodeFieldSchema.optional(),
10015
- content: z27.string().nullable().optional(),
10016
- url: z27.string().nullable().optional(),
10017
- workspaceId: z27.string().nullable().optional(),
10018
- fileId: z27.string().nullable().optional(),
10019
- name: z27.string().nullable().optional(),
10020
- displayName: z27.string().nullable().optional(),
10021
- contentSha: z27.string().nullable().optional(),
10022
- versionSha: z27.string().nullable().optional(),
10023
- mediaType: z27.string().nullable().optional()
10220
+ content: z28.string().nullable().optional(),
10221
+ url: z28.string().nullable().optional(),
10222
+ workspaceId: z28.string().nullable().optional(),
10223
+ fileId: z28.string().nullable().optional(),
10224
+ name: z28.string().nullable().optional(),
10225
+ displayName: z28.string().nullable().optional(),
10226
+ contentSha: z28.string().nullable().optional(),
10227
+ versionSha: z28.string().nullable().optional(),
10228
+ mediaType: z28.string().nullable().optional()
10024
10229
  }).transform((value) => ({
10025
10230
  ...value,
10026
10231
  wikiRole: value.wikiRole ?? null,
@@ -10043,31 +10248,31 @@ var agentMarkdownFileSchema = z27.preprocess(
10043
10248
  mediaType: value.mediaType ?? null
10044
10249
  }))
10045
10250
  );
10046
- var agentMarkdownFilesSchema = z27.array(agentMarkdownFileSchema);
10047
- var agentMarkdownMutationDataSchema = z27.union([
10251
+ var agentMarkdownFilesSchema = z28.array(agentMarkdownFileSchema);
10252
+ var agentMarkdownMutationDataSchema = z28.union([
10048
10253
  agentMarkdownFileSchema,
10049
- z27.object({ files: agentMarkdownFilesSchema })
10254
+ z28.object({ files: agentMarkdownFilesSchema })
10050
10255
  ]);
10051
- var osmdSearchCandidateSchema = z27.preprocess(
10256
+ var osmdSearchCandidateSchema = z28.preprocess(
10052
10257
  normalizeAgentMarkdownJsonKeys,
10053
- z27.object({
10054
- path: z27.string(),
10258
+ z28.object({
10259
+ path: z28.string(),
10055
10260
  source: sourceSchema,
10056
10261
  access: accessSchema,
10057
10262
  owner: ownerSchema,
10058
- wikiRole: z27.string().nullable().optional(),
10059
- formatVersion: z27.string().nullable().optional(),
10060
- parentRef: z27.string().nullable().optional(),
10061
- exists: z27.boolean(),
10062
- agentChildrenAllowed: z27.boolean(),
10063
- title: z27.string(),
10064
- label: z27.string(),
10065
- snippet: z27.string().nullable().optional(),
10066
- rank: z27.number().int(),
10067
- matchReason: z27.string().nullable().optional(),
10068
- toolKey: z27.string().nullable().optional(),
10069
- nodeKey: z27.string().nullable().optional(),
10070
- nodeKind: z27.string().nullable().optional()
10263
+ wikiRole: z28.string().nullable().optional(),
10264
+ formatVersion: z28.string().nullable().optional(),
10265
+ parentRef: z28.string().nullable().optional(),
10266
+ exists: z28.boolean(),
10267
+ agentChildrenAllowed: z28.boolean(),
10268
+ title: z28.string(),
10269
+ label: z28.string(),
10270
+ snippet: z28.string().nullable().optional(),
10271
+ rank: z28.number().int(),
10272
+ matchReason: z28.string().nullable().optional(),
10273
+ toolKey: z28.string().nullable().optional(),
10274
+ nodeKey: z28.string().nullable().optional(),
10275
+ nodeKind: z28.string().nullable().optional()
10071
10276
  }).transform((value) => ({
10072
10277
  ...value,
10073
10278
  wikiRole: value.wikiRole ?? null,
@@ -10080,26 +10285,26 @@ var osmdSearchCandidateSchema = z27.preprocess(
10080
10285
  nodeKind: value.nodeKind ?? null
10081
10286
  }))
10082
10287
  );
10083
- var osmdSearchResultSchema = z27.preprocess(
10288
+ var osmdSearchResultSchema = z28.preprocess(
10084
10289
  normalizeAgentMarkdownJsonKeys,
10085
- z27.object({
10086
- query: z27.string(),
10087
- scope: z27.string(),
10088
- count: z27.number().int().min(0),
10089
- candidates: z27.array(osmdSearchCandidateSchema)
10290
+ z28.object({
10291
+ query: z28.string(),
10292
+ scope: z28.string(),
10293
+ count: z28.number().int().min(0),
10294
+ candidates: z28.array(osmdSearchCandidateSchema)
10090
10295
  })
10091
10296
  );
10092
- var osmdWikiLintIssueSchema = z27.preprocess(
10297
+ var osmdWikiLintIssueSchema = z28.preprocess(
10093
10298
  normalizeAgentMarkdownJsonKeys,
10094
- z27.object({
10095
- code: z27.string(),
10096
- severity: z27.string(),
10097
- path: z27.string(),
10098
- source: z27.string().nullable().optional(),
10099
- parentRef: z27.string().nullable().optional(),
10100
- message: z27.string(),
10101
- suggestedAction: z27.string().nullable().optional(),
10102
- canAutoFix: z27.boolean()
10299
+ z28.object({
10300
+ code: z28.string(),
10301
+ severity: z28.string(),
10302
+ path: z28.string(),
10303
+ source: z28.string().nullable().optional(),
10304
+ parentRef: z28.string().nullable().optional(),
10305
+ message: z28.string(),
10306
+ suggestedAction: z28.string().nullable().optional(),
10307
+ canAutoFix: z28.boolean()
10103
10308
  }).transform((value) => ({
10104
10309
  ...value,
10105
10310
  source: value.source ?? null,
@@ -10107,37 +10312,37 @@ var osmdWikiLintIssueSchema = z27.preprocess(
10107
10312
  suggestedAction: value.suggestedAction ?? null
10108
10313
  }))
10109
10314
  );
10110
- var osmdWikiLintResultSchema = z27.preprocess(
10315
+ var osmdWikiLintResultSchema = z28.preprocess(
10111
10316
  normalizeAgentMarkdownJsonKeys,
10112
- z27.object({
10113
- status: z27.string(),
10114
- summary: z27.object({
10115
- totalIssues: z27.number().int().min(0),
10116
- errors: z27.number().int().min(0),
10117
- warnings: z27.number().int().min(0),
10118
- suggestions: z27.number().int().min(0)
10317
+ z28.object({
10318
+ status: z28.string(),
10319
+ summary: z28.object({
10320
+ totalIssues: z28.number().int().min(0),
10321
+ errors: z28.number().int().min(0),
10322
+ warnings: z28.number().int().min(0),
10323
+ suggestions: z28.number().int().min(0)
10119
10324
  }),
10120
- issues: z27.array(osmdWikiLintIssueSchema)
10325
+ issues: z28.array(osmdWikiLintIssueSchema)
10121
10326
  })
10122
10327
  );
10123
- var nullableCountSchema = z27.preprocess(
10328
+ var nullableCountSchema = z28.preprocess(
10124
10329
  (value) => value === void 0 || value === null || value === "" ? null : value,
10125
- z27.coerce.number().int().min(0).nullable()
10330
+ z28.coerce.number().int().min(0).nullable()
10126
10331
  ).catch(null);
10127
- var osmdMemoryQualityIssueSchema = z27.preprocess(
10332
+ var osmdMemoryQualityIssueSchema = z28.preprocess(
10128
10333
  normalizeAgentMarkdownJsonKeys,
10129
- z27.object({
10130
- code: z27.string().nullable().optional(),
10131
- issueCode: z27.string().nullable().optional(),
10132
- path: z27.string().nullable().optional(),
10133
- parentRef: z27.string().nullable().optional(),
10134
- dimension: z27.string().nullable().optional(),
10135
- evidence: z27.string().nullable().optional(),
10136
- evidenceSnippet: z27.string().nullable().optional(),
10137
- message: z27.string().nullable().optional(),
10138
- severity: z27.string().nullable().optional(),
10139
- suggestedAction: z27.string().nullable().optional(),
10140
- canAutoFix: z27.boolean().nullable().optional()
10334
+ z28.object({
10335
+ code: z28.string().nullable().optional(),
10336
+ issueCode: z28.string().nullable().optional(),
10337
+ path: z28.string().nullable().optional(),
10338
+ parentRef: z28.string().nullable().optional(),
10339
+ dimension: z28.string().nullable().optional(),
10340
+ evidence: z28.string().nullable().optional(),
10341
+ evidenceSnippet: z28.string().nullable().optional(),
10342
+ message: z28.string().nullable().optional(),
10343
+ severity: z28.string().nullable().optional(),
10344
+ suggestedAction: z28.string().nullable().optional(),
10345
+ canAutoFix: z28.boolean().nullable().optional()
10141
10346
  }).passthrough().transform((value) => ({
10142
10347
  ...value,
10143
10348
  code: value.code ?? value.issueCode ?? "unknown_issue",
@@ -10152,16 +10357,16 @@ var osmdMemoryQualityIssueSchema = z27.preprocess(
10152
10357
  canAutoFix: value.canAutoFix === true ? true : false
10153
10358
  }))
10154
10359
  );
10155
- var osmdMemoryQualityOverlaySchema = z27.preprocess(
10360
+ var osmdMemoryQualityOverlaySchema = z28.preprocess(
10156
10361
  normalizeAgentMarkdownJsonKeys,
10157
- z27.object({
10158
- path: z27.string().nullable().optional(),
10159
- parentRef: z27.string().nullable().optional(),
10160
- status: z27.string().nullable().optional(),
10161
- score: z27.union([z27.number(), z27.string()]).nullable().optional(),
10162
- overallScore: z27.union([z27.number(), z27.string()]).nullable().optional(),
10163
- dimensions: z27.unknown().nullable().optional(),
10164
- issues: z27.array(osmdMemoryQualityIssueSchema).optional()
10362
+ z28.object({
10363
+ path: z28.string().nullable().optional(),
10364
+ parentRef: z28.string().nullable().optional(),
10365
+ status: z28.string().nullable().optional(),
10366
+ score: z28.union([z28.number(), z28.string()]).nullable().optional(),
10367
+ overallScore: z28.union([z28.number(), z28.string()]).nullable().optional(),
10368
+ dimensions: z28.unknown().nullable().optional(),
10369
+ issues: z28.array(osmdMemoryQualityIssueSchema).optional()
10165
10370
  }).passthrough().transform((value) => ({
10166
10371
  ...value,
10167
10372
  path: value.path ?? null,
@@ -10173,9 +10378,9 @@ var osmdMemoryQualityOverlaySchema = z27.preprocess(
10173
10378
  issues: value.issues ?? []
10174
10379
  }))
10175
10380
  );
10176
- var osmdMemoryQualitySummarySchema = z27.preprocess(
10381
+ var osmdMemoryQualitySummarySchema = z28.preprocess(
10177
10382
  normalizeAgentMarkdownJsonKeys,
10178
- z27.object({
10383
+ z28.object({
10179
10384
  evaluatedCount: nullableCountSchema.optional(),
10180
10385
  passCount: nullableCountSchema.optional(),
10181
10386
  warnCount: nullableCountSchema.optional(),
@@ -10193,19 +10398,19 @@ var osmdMemoryQualitySummarySchema = z27.preprocess(
10193
10398
  failCount: value.failCount ?? value.failures ?? null
10194
10399
  }))
10195
10400
  );
10196
- var osmdMemoryQualityResultSchema = z27.preprocess(
10401
+ var osmdMemoryQualityResultSchema = z28.preprocess(
10197
10402
  normalizeAgentMarkdownJsonKeys,
10198
- z27.object({
10199
- status: z27.string(),
10200
- scope: z27.string().nullable().optional(),
10403
+ z28.object({
10404
+ status: z28.string(),
10405
+ scope: z28.string().nullable().optional(),
10201
10406
  evaluatedCount: nullableCountSchema.optional(),
10202
10407
  passCount: nullableCountSchema.optional(),
10203
10408
  warnCount: nullableCountSchema.optional(),
10204
10409
  failCount: nullableCountSchema.optional(),
10205
10410
  summary: osmdMemoryQualitySummarySchema.optional(),
10206
- weakestOverlays: z27.array(osmdMemoryQualityOverlaySchema).optional(),
10207
- issues: z27.array(osmdMemoryQualityIssueSchema).optional(),
10208
- scores: z27.array(osmdMemoryQualityOverlaySchema).optional()
10411
+ weakestOverlays: z28.array(osmdMemoryQualityOverlaySchema).optional(),
10412
+ issues: z28.array(osmdMemoryQualityIssueSchema).optional(),
10413
+ scores: z28.array(osmdMemoryQualityOverlaySchema).optional()
10209
10414
  }).passthrough().transform((value) => {
10210
10415
  const summary = isRecord5(value.summary) ? value.summary : null;
10211
10416
  return {
@@ -10229,24 +10434,24 @@ function normalizeOsmdIngestFileRecordInput(value) {
10229
10434
  }
10230
10435
  return normalized;
10231
10436
  }
10232
- var osmdIngestFileRecordSchema = z27.preprocess(
10437
+ var osmdIngestFileRecordSchema = z28.preprocess(
10233
10438
  normalizeOsmdIngestFileRecordInput,
10234
- z27.object({
10235
- path: z27.string(),
10236
- source: z27.string().nullable().optional(),
10237
- access: z27.string().nullable().optional(),
10238
- owner: z27.string().nullable().optional(),
10239
- parentRef: z27.string().nullable().optional(),
10240
- exists: z27.boolean().nullable().optional(),
10241
- canCreate: z27.boolean().nullable().optional(),
10242
- canUpdate: z27.boolean().nullable().optional(),
10243
- canAppend: z27.boolean().nullable().optional(),
10244
- wikiRole: z27.string().nullable().optional(),
10245
- formatVersion: z27.string().nullable().optional(),
10246
- createdAt: z27.string().nullable().optional(),
10247
- updatedAt: z27.string().nullable().optional(),
10248
- suggestedAction: z27.string().nullable().optional(),
10249
- errorCode: z27.string().nullable().optional()
10439
+ z28.object({
10440
+ path: z28.string(),
10441
+ source: z28.string().nullable().optional(),
10442
+ access: z28.string().nullable().optional(),
10443
+ owner: z28.string().nullable().optional(),
10444
+ parentRef: z28.string().nullable().optional(),
10445
+ exists: z28.boolean().nullable().optional(),
10446
+ canCreate: z28.boolean().nullable().optional(),
10447
+ canUpdate: z28.boolean().nullable().optional(),
10448
+ canAppend: z28.boolean().nullable().optional(),
10449
+ wikiRole: z28.string().nullable().optional(),
10450
+ formatVersion: z28.string().nullable().optional(),
10451
+ createdAt: z28.string().nullable().optional(),
10452
+ updatedAt: z28.string().nullable().optional(),
10453
+ suggestedAction: z28.string().nullable().optional(),
10454
+ errorCode: z28.string().nullable().optional()
10250
10455
  }).passthrough().transform((value) => ({
10251
10456
  ...value,
10252
10457
  source: value.source ?? null,
@@ -10265,17 +10470,17 @@ var osmdIngestFileRecordSchema = z27.preprocess(
10265
10470
  errorCode: value.errorCode ?? null
10266
10471
  }))
10267
10472
  );
10268
- var osmdIngestResultSchema = z27.preprocess(
10473
+ var osmdIngestResultSchema = z28.preprocess(
10269
10474
  normalizeAgentMarkdownJsonKeys,
10270
- z27.object({
10271
- rawSourceId: z27.union([z27.string(), z27.number()]).nullable().optional(),
10272
- sourceSummaryPath: z27.string().nullable().optional(),
10475
+ z28.object({
10476
+ rawSourceId: z28.union([z28.string(), z28.number()]).nullable().optional(),
10477
+ sourceSummaryPath: z28.string().nullable().optional(),
10273
10478
  sourceSummaryFile: osmdIngestFileRecordSchema.nullable().optional(),
10274
- slug: z27.string().nullable().optional(),
10275
- runLint: z27.boolean().nullable().optional(),
10276
- createdFiles: z27.array(osmdIngestFileRecordSchema).optional(),
10277
- updatedFiles: z27.array(osmdIngestFileRecordSchema).optional(),
10278
- skippedUpdates: z27.array(z27.unknown()).optional(),
10479
+ slug: z28.string().nullable().optional(),
10480
+ runLint: z28.boolean().nullable().optional(),
10481
+ createdFiles: z28.array(osmdIngestFileRecordSchema).optional(),
10482
+ updatedFiles: z28.array(osmdIngestFileRecordSchema).optional(),
10483
+ skippedUpdates: z28.array(z28.unknown()).optional(),
10279
10484
  lintResult: osmdWikiLintResultSchema.nullable().optional()
10280
10485
  }).passthrough().transform((value) => ({
10281
10486
  ...value,
@@ -10290,37 +10495,37 @@ var osmdIngestResultSchema = z27.preprocess(
10290
10495
  lintResult: value.lintResult ?? null
10291
10496
  }))
10292
10497
  );
10293
- var mutationPayloadSchema = z27.object({
10294
- ok: z27.boolean(),
10295
- status: z27.number(),
10296
- errorCode: z27.string().nullable().optional(),
10297
- data: z27.unknown().nullable().optional(),
10298
- errors: z27.unknown().nullable().optional()
10498
+ var mutationPayloadSchema = z28.object({
10499
+ ok: z28.boolean(),
10500
+ status: z28.number(),
10501
+ errorCode: z28.string().nullable().optional(),
10502
+ data: z28.unknown().nullable().optional(),
10503
+ errors: z28.unknown().nullable().optional()
10299
10504
  });
10300
- var markdownTreeNodeSchema = z27.lazy(
10301
- () => z27.object({
10302
- toolKey: z27.string(),
10303
- nodeKey: z27.string(),
10304
- nodeKind: z27.string(),
10305
- runtimeLabel: z27.string(),
10306
- path: z27.string().nullable().optional().transform((value) => value ?? null),
10505
+ var markdownTreeNodeSchema = z28.lazy(
10506
+ () => z28.object({
10507
+ toolKey: z28.string(),
10508
+ nodeKey: z28.string(),
10509
+ nodeKind: z28.string(),
10510
+ runtimeLabel: z28.string(),
10511
+ path: z28.string().nullable().optional().transform((value) => value ?? null),
10307
10512
  source: sourceSchema,
10308
10513
  access: accessSchema,
10309
10514
  owner: ownerSchema,
10310
- parentRef: z27.string().nullable().optional().transform((value) => value ?? null),
10311
- agentChildrenAllowed: z27.boolean(),
10312
- exists: z27.boolean(),
10313
- resolvedScope: z27.object({
10314
- parentId: z27.string().nullable().optional().transform((value) => value ?? null),
10315
- recordId: z27.string().nullable().optional().transform((value) => value ?? null),
10316
- memberId: z27.string().nullable().optional().transform((value) => value ?? null),
10317
- teamId: z27.string().nullable().optional().transform((value) => value ?? null),
10318
- contentType: z27.string().nullable().optional().transform((value) => value ?? null)
10515
+ parentRef: z28.string().nullable().optional().transform((value) => value ?? null),
10516
+ agentChildrenAllowed: z28.boolean(),
10517
+ exists: z28.boolean(),
10518
+ resolvedScope: z28.object({
10519
+ parentId: z28.string().nullable().optional().transform((value) => value ?? null),
10520
+ recordId: z28.string().nullable().optional().transform((value) => value ?? null),
10521
+ memberId: z28.string().nullable().optional().transform((value) => value ?? null),
10522
+ teamId: z28.string().nullable().optional().transform((value) => value ?? null),
10523
+ contentType: z28.string().nullable().optional().transform((value) => value ?? null)
10319
10524
  }),
10320
- isLeaf: z27.boolean(),
10321
- treeView: z27.boolean(),
10322
- details: z27.unknown().nullable(),
10323
- children: z27.array(markdownTreeNodeSchema).optional().transform((value) => value ?? [])
10525
+ isLeaf: z28.boolean(),
10526
+ treeView: z28.boolean(),
10527
+ details: z28.unknown().nullable(),
10528
+ children: z28.array(markdownTreeNodeSchema).optional().transform((value) => value ?? [])
10324
10529
  })
10325
10530
  );
10326
10531
  var AGENT_MARKDOWN_FILE_SELECTION = `{
@@ -11422,8 +11627,8 @@ function formatIngestFileList(files) {
11422
11627
  }
11423
11628
  return files.map((file) => {
11424
11629
  const path = typeof file.path === "string" ? file.path : "-";
11425
- const action = typeof file.suggestedAction === "string" && file.suggestedAction.trim() !== "" ? ` (${file.suggestedAction})` : "";
11426
- return `- ${path}${action}`;
11630
+ const action2 = typeof file.suggestedAction === "string" && file.suggestedAction.trim() !== "" ? ` (${file.suggestedAction})` : "";
11631
+ return `- ${path}${action2}`;
11427
11632
  });
11428
11633
  }
11429
11634
  function formatSkippedUpdateList(skippedUpdates) {
@@ -11550,7 +11755,7 @@ async function resolveContentInput(opts, globals) {
11550
11755
  }
11551
11756
  return stdin;
11552
11757
  }
11553
- function writePreflightError(status2, action) {
11758
+ function writePreflightError(status2, action2) {
11554
11759
  if (status2.errorCode) {
11555
11760
  return {
11556
11761
  code: status2.errorCode,
@@ -11567,7 +11772,7 @@ function writePreflightError(status2, action) {
11567
11772
  status: 403
11568
11773
  };
11569
11774
  }
11570
- if (status2.access === "append_only" && action !== "append") {
11775
+ if (status2.access === "append_only" && action2 !== "append") {
11571
11776
  return {
11572
11777
  code: "append_only_violation",
11573
11778
  message: `Agent markdown file is append-only and cannot be overwritten: ${status2.path}`,
@@ -11575,7 +11780,7 @@ function writePreflightError(status2, action) {
11575
11780
  status: 403
11576
11781
  };
11577
11782
  }
11578
- if (action === "create") {
11783
+ if (action2 === "create") {
11579
11784
  if (status2.exists) {
11580
11785
  return {
11581
11786
  code: "agent_file_already_exists",
@@ -11593,7 +11798,7 @@ function writePreflightError(status2, action) {
11593
11798
  };
11594
11799
  }
11595
11800
  }
11596
- if (action === "update") {
11801
+ if (action2 === "update") {
11597
11802
  if (!status2.exists) {
11598
11803
  return {
11599
11804
  code: "agent_file_not_found",
@@ -11611,7 +11816,7 @@ function writePreflightError(status2, action) {
11611
11816
  };
11612
11817
  }
11613
11818
  }
11614
- if (action === "append") {
11819
+ if (action2 === "append") {
11615
11820
  if (!status2.exists) {
11616
11821
  return {
11617
11822
  code: "agent_file_not_found",
@@ -11643,7 +11848,7 @@ function statusCodeForAgentError(code) {
11643
11848
  }
11644
11849
  return 403;
11645
11850
  }
11646
- function suggestedCommandsForWritePreflight(status2, action, suggestedAction) {
11851
+ function suggestedCommandsForWritePreflight(status2, action2, suggestedAction) {
11647
11852
  const parentRef = status2.parentRef ?? status2.path;
11648
11853
  const file = basename(status2.path);
11649
11854
  if (status2.source === "canonical_osmd" || status2.access === "read_only") {
@@ -11652,7 +11857,7 @@ function suggestedCommandsForWritePreflight(status2, action, suggestedAction) {
11652
11857
  `wave osmd agent create "${status2.path}" notes.md --content "# Notes"`
11653
11858
  ];
11654
11859
  }
11655
- if (status2.access === "append_only" || action === "append") {
11860
+ if (status2.access === "append_only" || action2 === "append") {
11656
11861
  return [
11657
11862
  "wave osmd wiki status log.md",
11658
11863
  'wave osmd wiki append-log --content "<markdown>"'
@@ -11744,7 +11949,7 @@ function addContentOptions(command) {
11744
11949
  return command.option("--content <content>", "Markdown content").option("--file <file>", "Read markdown content from a local file");
11745
11950
  }
11746
11951
  function parseExpectedWorkspaceContentSha(options) {
11747
- const value = z27.object({ expectedContentSha: z27.unknown().optional() }).parse(options).expectedContentSha;
11952
+ const value = z28.object({ expectedContentSha: z28.unknown().optional() }).parse(options).expectedContentSha;
11748
11953
  if (value === void 0) return void 0;
11749
11954
  if (typeof value === "string" && /^[a-f0-9]{64}$/.test(value)) return value;
11750
11955
  return printLocalError({
@@ -12145,14 +12350,14 @@ function registerOsmdCommands(program) {
12145
12350
  addIngestOptions(
12146
12351
  ingest.command("text [text]").description("Ingest raw text through the backend source ingestion planner")
12147
12352
  )
12148
- ).action(async (text5, opts, cmd) => {
12353
+ ).action(async (text6, opts, cmd) => {
12149
12354
  const command = "osmd.ingest.text";
12150
12355
  try {
12151
12356
  rejectUnsupportedIngestOptions(command, opts);
12152
12357
  const globals = cmd.optsWithGlobals();
12153
12358
  const content = await resolveInlineIngestContent({
12154
12359
  command,
12155
- positional: text5,
12360
+ positional: text6,
12156
12361
  opts,
12157
12362
  globals
12158
12363
  });
@@ -13561,7 +13766,7 @@ function getRecentToolSupport(input) {
13561
13766
 
13562
13767
  // src/commands/broadcastOperations.ts
13563
13768
  import { Option as Option2 } from "commander";
13564
- import { z as z28 } from "zod";
13769
+ import { z as z29 } from "zod";
13565
13770
  var FLAT_INPUT_TYPES = {
13566
13771
  text: "String!",
13567
13772
  community_post_id: "ID",
@@ -13594,11 +13799,11 @@ function registerBroadcastOperations(broadcast) {
13594
13799
  const command = parent2.command(leaf).description(operation.summary).option("--json", "Emit the stable JSON envelope");
13595
13800
  for (const [name, definition] of Object.entries(operation.arguments)) {
13596
13801
  const flag2 = `--${kebab(name)}${definition.type === "Boolean" ? "" : ` <${name}>`}`;
13597
- const option2 = new Option2(flag2, definition.variable);
13598
- if (definition.required) option2.makeOptionMandatory();
13599
- if (definition.default) option2.default(definition.default);
13600
- if (definition.choices) option2.choices([...definition.choices]);
13601
- command.addOption(option2);
13802
+ const option3 = new Option2(flag2, definition.variable);
13803
+ if (definition.required) option3.makeOptionMandatory();
13804
+ if (definition.default) option3.default(definition.default);
13805
+ if (definition.choices) option3.choices([...definition.choices]);
13806
+ command.addOption(option3);
13602
13807
  }
13603
13808
  if (operation.payload) command.requiredOption("--data-json <dataJson>", "Exact existing GraphQL input object with snake_case fields; see schema");
13604
13809
  command.action(async (opts, cmd) => {
@@ -13637,7 +13842,7 @@ function registerBroadcastOperations(broadcast) {
13637
13842
  selectionSet: operation.selection ?? "",
13638
13843
  ...operation.path.startsWith("community.") && operation.path !== "community.posts.list" ? {
13639
13844
  transformData: (value) => {
13640
- const record3 = z28.record(z28.string(), z28.unknown()).parse(value);
13845
+ const record3 = z29.record(z29.string(), z29.unknown()).parse(value);
13641
13846
  if (!record3["selectedPost"]) throw new CliError({ message: "Requested community post is unavailable", kind: "not_found", status: 404, exitCode: EXIT_CODES.notFound });
13642
13847
  return value;
13643
13848
  }
@@ -13758,15 +13963,15 @@ function registerBroadcastCommands(program) {
13758
13963
 
13759
13964
  // src/commands/supportOperations.ts
13760
13965
  import { Option as Option3 } from "commander";
13761
- import { z as z29 } from "zod";
13966
+ import { z as z30 } from "zod";
13762
13967
  var SUPPORT_OPERATION_COMMANDS = ["conversation", "messages", "ticket", "article", "reply", "note", "triage"];
13763
13968
  var SUPPORT_TRIAGE_ACTIONS = ["assign", "unassign", "close", "reopen", "snooze", "unsnooze", "star", "unstar", "add-label", "remove-label"];
13764
- var id5 = z29.string().trim().regex(/^[A-Za-z0-9_-]+$/);
13765
- var body2 = z29.string().trim().min(1).max(64e3);
13766
- var page3 = z29.coerce.number().int().min(1);
13767
- var per = page3.max(100);
13768
- var record = z29.record(z29.string(), z29.unknown());
13769
- var triageSchema = z29.object({ conversationId: id5, action: z29.enum(SUPPORT_TRIAGE_ACTIONS), memberId: id5.optional(), labelId: id5.optional(), snoozedUntil: z29.string().datetime({ offset: true }).optional() }).superRefine((value, context) => {
13969
+ var id5 = z30.string().trim().regex(/^[A-Za-z0-9_-]+$/);
13970
+ var body2 = z30.string().trim().min(1).max(64e3);
13971
+ var page4 = z30.coerce.number().int().min(1);
13972
+ var per = page4.max(100);
13973
+ var record = z30.record(z30.string(), z30.unknown());
13974
+ var triageSchema = z30.object({ conversationId: id5, action: z30.enum(SUPPORT_TRIAGE_ACTIONS), memberId: id5.optional(), labelId: id5.optional(), snoozedUntil: z30.string().datetime({ offset: true }).optional() }).superRefine((value, context) => {
13770
13975
  for (const [name, required] of Object.entries({ memberId: value.action === "assign", labelId: value.action === "add-label" || value.action === "remove-label", snoozedUntil: value.action === "snooze" })) {
13771
13976
  if (value[name] !== void 0 !== required)
13772
13977
  context.addIssue({ code: "custom", message: `${name} ${required ? "is required" : "is not allowed"} for ${value.action}` });
@@ -13792,7 +13997,7 @@ function registerSupportOperationCommands(support) {
13792
13997
  runtimeOptions: context.runtimeOptions,
13793
13998
  field: "support_conversation_messages",
13794
13999
  variableTypes: { organization_id: "ID!", conversation_id: "ID!", page: "Int", per: "Int" },
13795
- variables: { organization_id: resolveOrganizationId(context.organizationId), conversation_id: id5.parse(opts.conversationId), page: page3.parse(opts.page), per: per.parse(opts.per) },
14000
+ variables: { organization_id: resolveOrganizationId(context.organizationId), conversation_id: id5.parse(opts.conversationId), page: page4.parse(opts.page), per: per.parse(opts.per) },
13796
14001
  isList: true,
13797
14002
  selectionSet: "{ count currentPage totalPages nextPage totalCount data { id supportConversationId direction senderMemberId senderIdentity emailSubject body sentAt receivedAt createdAt } }"
13798
14003
  });
@@ -14166,21 +14371,21 @@ function registerPhoneCommands(program) {
14166
14371
  const phone = program.command("phone").description("Authorized Phone workspace reads and exact approved subactions");
14167
14372
  const groups = /* @__PURE__ */ new Map();
14168
14373
  for (const operation of PHONE_OPERATIONS) {
14169
- const [, groupName, action] = operation.id.split(".");
14170
- if (!groupName || !action) throw new Error(`Invalid Phone operation ${operation.id}`);
14374
+ const [, groupName, action2] = operation.id.split(".");
14375
+ if (!groupName || !action2) throw new Error(`Invalid Phone operation ${operation.id}`);
14171
14376
  let group = groups.get(groupName);
14172
14377
  if (!group) {
14173
14378
  group = phone.command(groupName);
14174
14379
  groups.set(groupName, group);
14175
14380
  }
14176
- const command = group.command(action).description(operation.description ?? `${operation.classification === "read" ? "Read" : "Apply one approved"} Phone ${groupName} ${action}${operation.sensitiveReceipt ? "; human-owned credential flow, non-secret receipt only" : ""}`);
14381
+ const command = group.command(action2).description(operation.description ?? `${operation.classification === "read" ? "Read" : "Apply one approved"} Phone ${groupName} ${action2}${operation.sensitiveReceipt ? "; human-owned credential flow, non-secret receipt only" : ""}`);
14177
14382
  for (const definition of operation.options) {
14178
14383
  const kebab2 = definition.name.replace(/[A-Z]/g, (value) => `-${value.toLowerCase()}`);
14179
- const option2 = new Option4(`--${kebab2}${definition.flag ? " [boolean]" : ` <${definition.name}>`}`, `Phone ${definition.name}`);
14180
- if (definition.required) option2.makeOptionMandatory();
14181
- if (definition.choices) option2.choices([...definition.choices]);
14182
- if (definition.defaultValue) option2.default(definition.defaultValue);
14183
- command.addOption(option2);
14384
+ const option3 = new Option4(`--${kebab2}${definition.flag ? " [boolean]" : ` <${definition.name}>`}`, `Phone ${definition.name}`);
14385
+ if (definition.required) option3.makeOptionMandatory();
14386
+ if (definition.choices) option3.choices([...definition.choices]);
14387
+ if (definition.defaultValue) option3.default(definition.defaultValue);
14388
+ command.addOption(option3);
14184
14389
  }
14185
14390
  command.option("--json", "Emit the JSON envelope").action(async (raw, cmd) => {
14186
14391
  const { json: _json, ...values } = raw;
@@ -14214,9 +14419,9 @@ function registerPhoneCommands(program) {
14214
14419
  ...operation.show !== void 0 ? { isShow: operation.show } : {},
14215
14420
  ...operation.id === "phone.voicemail.list" ? { transformData: (value) => {
14216
14421
  if (!value || typeof value !== "object" || Array.isArray(value)) throw new Error("Malformed Phone call page");
14217
- const page4 = value;
14218
- if (!Array.isArray(page4.data)) throw new Error("Malformed Phone call page");
14219
- return { ...page4, data: page4.data.filter((row) => row && typeof row === "object" && !Array.isArray(row) && (row.voicemailRecordingStatus ?? row.attributes?.voicemailRecordingStatus)) };
14422
+ const page5 = value;
14423
+ if (!Array.isArray(page5.data)) throw new Error("Malformed Phone call page");
14424
+ return { ...page5, data: page5.data.filter((row) => row && typeof row === "object" && !Array.isArray(row) && (row.voicemailRecordingStatus ?? row.attributes?.voicemailRecordingStatus)) };
14220
14425
  } } : {}
14221
14426
  });
14222
14427
  }
@@ -14228,24 +14433,24 @@ function registerPhoneCommands(program) {
14228
14433
  import { Option as Option5 } from "commander";
14229
14434
 
14230
14435
  // src/commands/flowProjection.ts
14231
- import { z as z30 } from "zod";
14436
+ import { z as z31 } from "zod";
14232
14437
  function fieldSchema2(key3) {
14233
- if (key3.endsWith("_cents") || key3.endsWith("_count") || ["quantity", "tax_rate_bps", "approval_round", "sequence", "tax_year", "depth"].includes(key3)) return z30.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER).nullable();
14234
- if (["available", "authorized", "configured", "connected", "can_decide", "has_file", "publish_requested", "collection_paused", "cancel_at_period_end", "is_current", "empty"].includes(key3)) return z30.boolean().nullable();
14235
- return z30.string().nullable();
14438
+ if (key3.endsWith("_cents") || key3.endsWith("_count") || ["quantity", "tax_rate_bps", "approval_round", "sequence", "tax_year", "depth"].includes(key3)) return z31.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER).nullable();
14439
+ if (["available", "authorized", "configured", "connected", "can_decide", "has_file", "publish_requested", "collection_paused", "cancel_at_period_end", "is_current", "empty"].includes(key3)) return z31.boolean().nullable();
14440
+ return z31.string().nullable();
14236
14441
  }
14237
14442
  function fields(names) {
14238
- return z30.object(Object.fromEntries(names.split(" ").map((key3) => [key3, fieldSchema2(key3).optional()])));
14443
+ return z31.object(Object.fromEntries(names.split(" ").map((key3) => [key3, fieldSchema2(key3).optional()])));
14239
14444
  }
14240
14445
  var connection2 = fields("provider configured connected status action_required configured_at last_verified_at").extend({
14241
- provider: z30.string(),
14242
- configured: z30.boolean(),
14243
- connected: z30.boolean(),
14244
- status: z30.string()
14446
+ provider: z31.string(),
14447
+ configured: z31.boolean(),
14448
+ connected: z31.boolean(),
14449
+ status: z31.string()
14245
14450
  });
14246
- var capability = fields("available authorized reason").extend({ methods: z30.array(z30.string()).optional() });
14247
- var capabilities = z30.object({
14248
- permissions: z30.object({ can_view: z30.boolean(), can_view_financials: z30.boolean(), can_manage: z30.boolean(), can_decide_approvals: z30.boolean() }),
14451
+ var capability = fields("available authorized reason").extend({ methods: z31.array(z31.string()).optional() });
14452
+ var capabilities = z31.object({
14453
+ permissions: z31.object({ can_view: z31.boolean(), can_view_financials: z31.boolean(), can_manage: z31.boolean(), can_decide_approvals: z31.boolean() }),
14249
14454
  vendor_management: capability,
14250
14455
  bill_management: capability,
14251
14456
  expense_submission: capability,
@@ -14253,34 +14458,34 @@ var capabilities = z30.object({
14253
14458
  accounting_sync: capability,
14254
14459
  stripe_invoicing: capability,
14255
14460
  subscription_sync: capability,
14256
- connection_verification: capability.extend({ providers: z30.array(z30.enum(["quickbooks", "stripe"])) }),
14461
+ connection_verification: capability.extend({ providers: z31.array(z31.enum(["quickbooks", "stripe"])) }),
14257
14462
  bill_payments: capability
14258
14463
  });
14259
14464
  var line = fields("description amount_cents quantity unit_amount_cents tax_rate_bps tax_cents");
14260
14465
  var core = "id public_id status created_at updated_at";
14261
- var record2 = (extra) => fields(`${core} ${extra}`).extend({ id: z30.string(), status: z30.string() });
14466
+ var record2 = (extra) => fields(`${core} ${extra}`).extend({ id: z31.string(), status: z31.string() });
14262
14467
  var approval = record2("bill_id bill_invoice_number vendor_name amount_cents currency resource_type resource_id resource_public_id resource_name expense_id submitter_member_id submitter_name merchant_name expense_date expense_category spend_method approval_round sequence requested_by_member_id approver_member_id note can_decide decided_at");
14263
14468
  var rows = {
14264
14469
  vendors: record2("name email phone"),
14265
- bills: record2("source_kind vendor_id vendor_name amount_cents currency invoice_number payment_frequency invoice_date due_date note attachment_count sync_status").extend({ line_items: z30.array(line).optional() }),
14470
+ bills: record2("source_kind vendor_id vendor_name amount_cents currency invoice_number payment_frequency invoice_date due_date note attachment_count sync_status").extend({ line_items: z31.array(line).optional() }),
14266
14471
  expenses: record2("source_kind approval_status latest_approval_id merchant_name expense_date expense_category spend_method amount_cents currency receipt_number description attachment_count sync_status submitted_by_member_id submitted_by_name"),
14267
14472
  approvals: approval,
14268
- invoices: record2("customer_id customer_name customer_email invoice_number invoice_frequency due_terms issue_date due_date note subtotal_cents discount_cents service_charge_cents tax_cents total_cents currency attachment_count publish_requested sync_status").extend({ line_items: z30.array(line).optional() }),
14473
+ invoices: record2("customer_id customer_name customer_email invoice_number invoice_frequency due_terms issue_date due_date note subtotal_cents discount_cents service_charge_cents tax_cents total_cents currency attachment_count publish_requested sync_status").extend({ line_items: z31.array(line).optional() }),
14269
14474
  payments: record2("direction provider payment_method amount_cents currency bill_id invoice_id counterparty_name scheduled_at processed_at failure_code"),
14270
14475
  tax_documents: record2("vendor_id vendor_name document_type tax_year has_file"),
14271
14476
  subscriptions: record2("customer_name customer_email description amount_cents currency interval current_period_end collection_paused cancel_at_period_end"),
14272
- customers: fields("id name email").extend({ id: z30.string() }),
14273
- eligible_approvers: fields("id name email is_current").extend({ id: z30.string() })
14477
+ customers: fields("id name email").extend({ id: z31.string() }),
14478
+ eligible_approvers: fields("id name email is_current").extend({ id: z31.string() })
14274
14479
  };
14275
- var pagination4 = z30.object({ loaded: z30.boolean(), count: z30.number().int().nonnegative(), current_page: z30.number().int().positive(), per_page: z30.number().int().min(1).max(100), total_count: z30.number().int().nonnegative(), total_pages: z30.number().int().positive(), next_page: z30.number().nullable(), previous_page: z30.number().nullable(), query: z30.string() });
14480
+ var pagination4 = z31.object({ loaded: z31.boolean(), count: z31.number().int().nonnegative(), current_page: z31.number().int().positive(), per_page: z31.number().int().min(1).max(100), total_count: z31.number().int().nonnegative(), total_pages: z31.number().int().positive(), next_page: z31.number().nullable(), previous_page: z31.number().nullable(), query: z31.string() });
14276
14481
  var report = fields("report_type title source currency accounting_method start_date end_date generated_at empty").extend({
14277
- report_type: z30.string(),
14278
- empty: z30.boolean(),
14279
- columns: z30.array(fields("key label type")),
14280
- rows: z30.array(fields("id kind depth").extend({ values: z30.array(z30.string()) }))
14482
+ report_type: z31.string(),
14483
+ empty: z31.boolean(),
14484
+ columns: z31.array(fields("key label type")),
14485
+ rows: z31.array(fields("id kind depth").extend({ values: z31.array(z31.string()) }))
14281
14486
  });
14282
- var setup = z30.object({ items: z30.array(z30.object({ id: z30.string(), name: z30.string() })), sales_item_id: z30.string().nullable() });
14283
- var syncReceipt = z30.object({ accepted: z30.literal(true), provider: z30.enum(["stripe", "quickbooks"]) });
14487
+ var setup = z31.object({ items: z31.array(z31.object({ id: z31.string(), name: z31.string() })), sales_item_id: z31.string().nullable(), company_name: z31.string().nullable().optional() });
14488
+ var syncReceipt = z31.object({ accepted: z31.literal(true), provider: z31.enum(["stripe", "quickbooks"]) });
14284
14489
  function parse(schema, value) {
14285
14490
  const result = schema.safeParse(value);
14286
14491
  if (!result.success) throw new CliError({ message: "Malformed Flow response; no authoritative result available.", kind: "malformed_response", status: 502, exitCode: EXIT_CODES.networkOrUpstream });
@@ -14288,15 +14493,15 @@ function parse(schema, value) {
14288
14493
  }
14289
14494
  function projectFlowRead(operation, input, value) {
14290
14495
  if (operation.field === "flow_workspace") {
14291
- const root = parse(z30.object({ connections: z30.object({ quickbooks: connection2, stripe: connection2 }), capabilities }), value);
14496
+ const root = parse(z31.object({ connections: z31.object({ quickbooks: connection2, stripe: connection2 }), capabilities }), value);
14292
14497
  const collection2 = operation.collection ?? input.collection;
14293
14498
  if (!collection2) return root;
14294
14499
  const key3 = String(collection2);
14295
14500
  const schema = rows[key3];
14296
14501
  if (!schema) throw new Error("Unknown Flow collection");
14297
- const page4 = parse(z30.object({ pagination: z30.object({ [key3]: pagination4 }), [key3]: z30.array(schema).max(100) }), value);
14298
- const meta = parse(pagination4, page4.pagination[key3]);
14299
- const data = page4[key3];
14502
+ const page5 = parse(z31.object({ pagination: z31.object({ [key3]: pagination4 }), [key3]: z31.array(schema).max(100) }), value);
14503
+ const meta = parse(pagination4, page5.pagination[key3]);
14504
+ const data = page5[key3];
14300
14505
  if (data.length > Number(input.per ?? (operation.show ? 1 : 25)) || !meta.loaded && data.length > 0) throw new CliError({ message: "Flow page exceeded its requested bounds.", kind: "malformed_response", status: 502, exitCode: EXIT_CODES.networkOrUpstream });
14301
14506
  if (meta.count !== data.length) throw new CliError({ message: "Inconsistent Flow page count.", kind: "malformed_response", status: 502, exitCode: EXIT_CODES.networkOrUpstream });
14302
14507
  if (operation.show) {
@@ -14308,13 +14513,13 @@ function projectFlowRead(operation, input, value) {
14308
14513
  }
14309
14514
  if (operation.field === "flow_report") return parse(report, value);
14310
14515
  if (operation.field === "flow_invoicing_setup") return parse(setup, value);
14311
- if (operation.field === "flow_approval_review") return parse(z30.object({ approval, resource_version: z30.string(), description: z30.string().nullable(), due_date: z30.string().nullable(), line_items: z30.array(line), decisions: z30.array(approval) }), value);
14312
- return parse(rows.payments.extend({ refundable_amount_cents: z30.number().nullable(), provider_details_status: z30.string(), can_retry: z30.boolean().optional(), can_confirm_payout: z30.boolean().optional(), payout_status: z30.string().optional() }), value);
14516
+ if (operation.field === "flow_approval_review") return parse(z31.object({ approval, resource_version: z31.string(), description: z31.string().nullable(), due_date: z31.string().nullable(), line_items: z31.array(line), decisions: z31.array(approval) }), value);
14517
+ return parse(rows.payments.extend({ refundable_amount_cents: z31.number().nullable(), provider_details_status: z31.string(), can_retry: z31.boolean().optional(), can_confirm_payout: z31.boolean().optional(), payout_status: z31.string().optional() }), value);
14313
14518
  }
14314
14519
  function projectFlowMutation(operation, value) {
14315
- const envelope2 = parse(z30.object({ ok: z30.literal(true), status: z30.number(), data: z30.unknown(), errorCode: z30.string().nullable().optional(), errors: z30.unknown().optional() }), value);
14520
+ const envelope2 = parse(z31.object({ ok: z31.literal(true), status: z31.number(), data: z31.unknown(), errorCode: z31.string().nullable().optional(), errors: z31.unknown().optional() }), value);
14316
14521
  const group = operation.id.split(".")[1];
14317
- const schema = operation.id === "flow.sync.request" ? syncReceipt : (group ? rows[group] : void 0) ?? (operation.id === "flow.connections.verify" ? z30.object({ provider: z30.string(), connection: connection2 }) : fields("accepted provider sales_item_id"));
14522
+ const schema = operation.id === "flow.sync.request" ? syncReceipt : (group ? rows[group] : void 0) ?? (operation.id === "flow.connections.verify" ? z31.object({ provider: z31.string(), connection: connection2 }) : fields("accepted provider sales_item_id"));
14318
14523
  return { ok: true, status: envelope2.status, data: parse(schema, envelope2.data) };
14319
14524
  }
14320
14525
 
@@ -14339,11 +14544,11 @@ function registerFlowCommands(program) {
14339
14544
  const command = parent2.command(parts.at(-1)).description(operation.description);
14340
14545
  for (const definition of operation.options) {
14341
14546
  const flag2 = definition.name.replace(/[A-Z]/g, (letter) => `-${letter.toLowerCase()}`);
14342
- const option2 = new Option5(`--${flag2} <${definition.name}>`, `Flow ${definition.name}`);
14343
- if (definition.required) option2.makeOptionMandatory();
14344
- if (definition.choices) option2.choices([...definition.choices]);
14345
- if (definition.defaultValue) option2.default(definition.defaultValue);
14346
- command.addOption(option2);
14547
+ const option3 = new Option5(`--${flag2} <${definition.name}>`, `Flow ${definition.name}`);
14548
+ if (definition.required) option3.makeOptionMandatory();
14549
+ if (definition.choices) option3.choices([...definition.choices]);
14550
+ if (definition.defaultValue) option3.default(definition.defaultValue);
14551
+ command.addOption(option3);
14347
14552
  }
14348
14553
  command.option("--json").action(async (raw, cmd) => {
14349
14554
  const { json: _json, ...values } = raw;
@@ -14366,11 +14571,11 @@ function registerFlowCommands(program) {
14366
14571
 
14367
14572
  // src/commands/chats.ts
14368
14573
  import { Option as Option6 } from "commander";
14369
- import { z as z32 } from "zod";
14574
+ import { z as z33 } from "zod";
14370
14575
 
14371
14576
  // src/commands/chatCollaboration.ts
14372
14577
  import { randomUUID as randomUUID3 } from "crypto";
14373
- import { z as z31 } from "zod";
14578
+ import { z as z32 } from "zod";
14374
14579
  function redactCredential(value, credential) {
14375
14580
  if (typeof value === "string")
14376
14581
  return credential ? value.replaceAll(credential, "[redacted]") : value;
@@ -14381,17 +14586,17 @@ function redactCredential(value, credential) {
14381
14586
  );
14382
14587
  return value;
14383
14588
  }
14384
- var target = z31.object({
14385
- id: z31.string().regex(/^[1-9]\d*$/),
14386
- organizationId: z31.string(),
14387
- chatType: z31.string()
14589
+ var target = z32.object({
14590
+ id: z32.string().regex(/^[1-9]\d*$/),
14591
+ organizationId: z32.string(),
14592
+ chatType: z32.string()
14388
14593
  });
14389
- var note = z31.object({
14390
- attributes: z31.object({
14391
- id: z31.string(),
14392
- organizationId: z31.string(),
14393
- contentableId: z31.string(),
14394
- contentableType: z31.literal("Chat")
14594
+ var note = z32.object({
14595
+ attributes: z32.object({
14596
+ id: z32.string(),
14597
+ organizationId: z32.string(),
14598
+ contentableId: z32.string(),
14599
+ contentableType: z32.literal("Chat")
14395
14600
  })
14396
14601
  });
14397
14602
  async function resolveChatCollaborationTarget(options, organizationId, chatId2, contentId) {
@@ -14407,7 +14612,7 @@ async function resolveChatCollaborationTarget(options, organizationId, chatId2,
14407
14612
  variables: { organizationId, chatId: chatId2, ...contentId === void 0 ? {} : { contentId } }
14408
14613
  });
14409
14614
  if (!response.ok) {
14410
- const codes = z31.array(z31.object({ extensions: z31.object({ code: z31.string() }).optional() })).safeParse(response.error.details["errors"]);
14615
+ const codes = z32.array(z32.object({ extensions: z32.object({ code: z32.string() }).optional() })).safeParse(response.error.details["errors"]);
14411
14616
  const code = codes.success ? codes.data.map((error) => error.extensions?.code).find((code2) => ["UNAUTHORIZED", "FORBIDDEN", "NOT_FOUND"].includes(code2 ?? "")) : void 0;
14412
14617
  const status2 = code === "UNAUTHORIZED" ? 401 : code === "FORBIDDEN" ? 403 : code === "NOT_FOUND" ? 404 : response.error.status;
14413
14618
  throw new CliError({
@@ -14417,7 +14622,7 @@ async function resolveChatCollaborationTarget(options, organizationId, chatId2,
14417
14622
  exitCode: mapStatusToExitCode(status2)
14418
14623
  });
14419
14624
  }
14420
- const parsed = z31.object({ chat: target, content: note.optional() }).safeParse(response.result.data);
14625
+ const parsed = z32.object({ chat: target, content: note.optional() }).safeParse(response.result.data);
14421
14626
  if (!parsed.success)
14422
14627
  throw new CliError({
14423
14628
  message: "Chat target lookup returned invalid evidence",
@@ -14448,63 +14653,63 @@ async function resolveChatCollaborationTarget(options, organizationId, chatId2,
14448
14653
  });
14449
14654
  return parsed.data.chat.id;
14450
14655
  }
14451
- var attachment = z31.object({
14452
- id: z31.string().optional(),
14453
- name: z31.string().optional(),
14454
- filename: z31.string().optional(),
14455
- size: z31.number().optional(),
14456
- type: z31.string().optional()
14656
+ var attachment = z32.object({
14657
+ id: z32.string().optional(),
14658
+ name: z32.string().optional(),
14659
+ filename: z32.string().optional(),
14660
+ size: z32.number().optional(),
14661
+ type: z32.string().optional()
14457
14662
  });
14458
14663
  var projections = {
14459
- draft: z31.object({
14460
- payload: z31.object({
14461
- message: z31.string().max(256e3).optional(),
14462
- attachments: z31.array(attachment).max(20).optional()
14664
+ draft: z32.object({
14665
+ payload: z32.object({
14666
+ message: z32.string().max(256e3).optional(),
14667
+ attachments: z32.array(attachment).max(20).optional()
14463
14668
  }),
14464
- version: z31.number().int().min(0),
14465
- updatedAt: z31.string().nullable()
14669
+ version: z32.number().int().min(0),
14670
+ updatedAt: z32.string().nullable()
14466
14671
  }),
14467
- huddle: z31.object({
14468
- enabled: z31.boolean(),
14469
- provider: z31.string(),
14470
- id: z31.string().nullable(),
14471
- participants: z31.array(z31.object({ memberId: z31.string(), name: z31.string(), mode: z31.string() })).max(50)
14672
+ huddle: z32.object({
14673
+ enabled: z32.boolean(),
14674
+ provider: z32.string(),
14675
+ id: z32.string().nullable(),
14676
+ participants: z32.array(z32.object({ memberId: z32.string(), name: z32.string(), mode: z32.string() })).max(50)
14472
14677
  }),
14473
- "huddle/workspace": z31.object({
14474
- title: z31.string(),
14475
- content: z31.string().max(256e3),
14476
- version: z31.number().int().min(0),
14477
- threadId: z31.string().nullable(),
14478
- updatedAt: z31.string().nullable()
14678
+ "huddle/workspace": z32.object({
14679
+ title: z32.string(),
14680
+ content: z32.string().max(256e3),
14681
+ version: z32.number().int().min(0),
14682
+ threadId: z32.string().nullable(),
14683
+ updatedAt: z32.string().nullable()
14479
14684
  }),
14480
- "huddle/thread": z31.object({ threadId: z31.string() }),
14481
- "huddle/messages": z31.object({
14482
- messages: z31.array(
14483
- z31.object({
14484
- id: z31.string(),
14485
- memberId: z31.string().nullable(),
14486
- name: z31.string(),
14487
- text: z31.string().max(256e3),
14488
- createdAt: z31.string(),
14489
- attachments: z31.array(attachment)
14685
+ "huddle/thread": z32.object({ threadId: z32.string() }),
14686
+ "huddle/messages": z32.object({
14687
+ messages: z32.array(
14688
+ z32.object({
14689
+ id: z32.string(),
14690
+ memberId: z32.string().nullable(),
14691
+ name: z32.string(),
14692
+ text: z32.string().max(256e3),
14693
+ createdAt: z32.string(),
14694
+ attachments: z32.array(attachment)
14490
14695
  })
14491
14696
  ).max(50),
14492
- hasMore: z31.boolean()
14697
+ hasMore: z32.boolean()
14493
14698
  }),
14494
- "huddle/artifacts": z31.object({
14495
- huddleId: z31.string().nullable(),
14496
- contentId: z31.string().nullable(),
14497
- contentSlug: z31.string().nullable(),
14498
- huddleStatus: z31.string().nullable(),
14499
- summaryStatus: z31.string(),
14500
- traceId: z31.string().nullable(),
14501
- transcripts: z31.array(z31.object({ id: z31.string().optional(), status: z31.string().optional() })).max(100),
14502
- sessions: z31.array(
14503
- z31.object({
14504
- id: z31.string(),
14505
- status: z31.string(),
14506
- startedAt: z31.string(),
14507
- endedAt: z31.string().nullable()
14699
+ "huddle/artifacts": z32.object({
14700
+ huddleId: z32.string().nullable(),
14701
+ contentId: z32.string().nullable(),
14702
+ contentSlug: z32.string().nullable(),
14703
+ huddleStatus: z32.string().nullable(),
14704
+ summaryStatus: z32.string(),
14705
+ traceId: z32.string().nullable(),
14706
+ transcripts: z32.array(z32.object({ id: z32.string().optional(), status: z32.string().optional() })).max(100),
14707
+ sessions: z32.array(
14708
+ z32.object({
14709
+ id: z32.string(),
14710
+ status: z32.string(),
14711
+ startedAt: z32.string(),
14712
+ endedAt: z32.string().nullable()
14508
14713
  })
14509
14714
  ).max(20)
14510
14715
  })
@@ -14554,7 +14759,7 @@ async function runChatRestCommand(operation, input, options, organizationId, mem
14554
14759
  });
14555
14760
  const identity = response.headers.get("x-request-id") ?? requestId;
14556
14761
  const raw = await response.json();
14557
- const errorBody = z31.object({ error: z31.object({ code: z31.string(), message: z31.string() }).optional() }).safeParse(raw);
14762
+ const errorBody = z32.object({ error: z32.object({ code: z32.string(), message: z32.string() }).optional() }).safeParse(raw);
14558
14763
  if (!response.ok)
14559
14764
  return printEnvelopeAndExit({
14560
14765
  envelope: {
@@ -14571,7 +14776,7 @@ async function runChatRestCommand(operation, input, options, organizationId, mem
14571
14776
  },
14572
14777
  exitCode: mapStatusToExitCode(response.status)
14573
14778
  });
14574
- const envelope2 = z31.object({ data: z31.unknown() }).parse(raw);
14779
+ const envelope2 = z32.object({ data: z32.unknown() }).parse(raw);
14575
14780
  const projector = projections[rest2.section];
14576
14781
  if (!projector) throw new Error("Missing saved Chat projection");
14577
14782
  const data = redactCredential(projector.parse(envelope2.data), config.token);
@@ -14599,20 +14804,20 @@ async function runChatRestCommand(operation, input, options, organizationId, mem
14599
14804
  }
14600
14805
 
14601
14806
  // src/commands/chats.ts
14602
- var tabWorkspace = z32.object({
14603
- toolTabs: z32.array(z32.object({ id: z32.uuid(), toolKey: z32.string() })),
14604
- activeTab: z32.string(),
14605
- tabOrder: z32.array(z32.string()),
14606
- toolLocations: z32.array(
14607
- z32.object({
14608
- tabId: z32.uuid(),
14609
- location: z32.string(),
14610
- title: z32.string().nullable().optional(),
14611
- emoji: z32.string().nullable().optional()
14807
+ var tabWorkspace = z33.object({
14808
+ toolTabs: z33.array(z33.object({ id: z33.uuid(), toolKey: z33.string() })),
14809
+ activeTab: z33.string(),
14810
+ tabOrder: z33.array(z33.string()),
14811
+ toolLocations: z33.array(
14812
+ z33.object({
14813
+ tabId: z33.uuid(),
14814
+ location: z33.string(),
14815
+ title: z33.string().nullable().optional(),
14816
+ emoji: z33.string().nullable().optional()
14612
14817
  })
14613
14818
  ),
14614
- version: z32.number().int().min(0),
14615
- canEdit: z32.boolean()
14819
+ version: z33.number().int().min(0),
14820
+ canEdit: z33.boolean()
14616
14821
  });
14617
14822
  var tabSelection = "{ toolTabs { id toolKey } activeTab tabOrder toolLocations { tabId location title emoji } version canEdit }";
14618
14823
  function normalizeChatTabMutation(payload) {
@@ -14635,11 +14840,11 @@ async function actorId(options, organizationId) {
14635
14840
  query: "query ChatActor($organizationId: ID!) { cliAuthStatus(organizationId: $organizationId) { authenticated member { id } organization { id } } }",
14636
14841
  variables: { organizationId }
14637
14842
  });
14638
- const identity = z32.object({
14639
- cliAuthStatus: z32.object({
14640
- authenticated: z32.literal(true),
14641
- member: z32.object({ id: z32.string().regex(/^[1-9]\d*$/) }),
14642
- organization: z32.object({ id: z32.literal(organizationId) })
14843
+ const identity = z33.object({
14844
+ cliAuthStatus: z33.object({
14845
+ authenticated: z33.literal(true),
14846
+ member: z33.object({ id: z33.string().regex(/^[1-9]\d*$/) }),
14847
+ organization: z33.object({ id: z33.literal(organizationId) })
14643
14848
  })
14644
14849
  }).safeParse(result.ok ? result.result.data : void 0);
14645
14850
  if (!identity.success)
@@ -14665,15 +14870,15 @@ function registerChatCommands(program) {
14665
14870
  const command = group.command(leaf).description(
14666
14871
  operation.description ?? `${operation.classification === "read" ? "Read" : "Apply one approved"} member Chat ${parts.join(" ")} ${leaf}`
14667
14872
  ).option("--json", "Emit the stable JSON envelope");
14668
- for (const option2 of operation.options) {
14669
- const kebab2 = option2.name.replace(/[A-Z]/g, (letter) => `-${letter.toLowerCase()}`);
14873
+ for (const option3 of operation.options) {
14874
+ const kebab2 = option3.name.replace(/[A-Z]/g, (letter) => `-${letter.toLowerCase()}`);
14670
14875
  const flag2 = new Option6(
14671
- `--${kebab2}${option2.flag ? "" : ` <${option2.name}>`}`,
14672
- `Chat ${option2.name}`
14876
+ `--${kebab2}${option3.flag ? "" : ` <${option3.name}>`}`,
14877
+ `Chat ${option3.name}`
14673
14878
  );
14674
- if (option2.required) flag2.makeOptionMandatory();
14675
- if (option2.choices) flag2.choices([...option2.choices]);
14676
- if (option2.defaultValue) flag2.default(option2.defaultValue);
14879
+ if (option3.required) flag2.makeOptionMandatory();
14880
+ if (option3.choices) flag2.choices([...option3.choices]);
14881
+ if (option3.defaultValue) flag2.default(option3.defaultValue);
14677
14882
  command.addOption(flag2);
14678
14883
  }
14679
14884
  command.action(async (raw, cmd) => {
@@ -14698,11 +14903,11 @@ function registerChatCommands(program) {
14698
14903
  );
14699
14904
  const variables = { organization_id: organizationId };
14700
14905
  const variableTypes = { organization_id: "ID!" };
14701
- for (const option2 of operation.options) {
14702
- if (input[option2.name] === void 0) continue;
14703
- const name = chatArgument(option2);
14704
- variables[name] = input[option2.name];
14705
- variableTypes[name] = `${option2.type}${option2.required ? "!" : ""}`;
14906
+ for (const option3 of operation.options) {
14907
+ if (input[option3.name] === void 0) continue;
14908
+ const name = chatArgument(option3);
14909
+ variables[name] = input[option3.name];
14910
+ variableTypes[name] = `${option3.type}${option3.required ? "!" : ""}`;
14706
14911
  }
14707
14912
  if (targetId) variables[operation.field === "chat" ? "id" : "chat_id"] = targetId;
14708
14913
  if (operation.id.startsWith("chats.notes.")) {
@@ -14742,7 +14947,7 @@ function registerChatCommands(program) {
14742
14947
  variableTypes["open"] = "Boolean!";
14743
14948
  }
14744
14949
  if (operation.id === "chats.tabs.save-state") {
14745
- const patch = z32.record(z32.string(), z32.unknown()).parse(input["payloadJson"]);
14950
+ const patch = z33.record(z33.string(), z33.unknown()).parse(input["payloadJson"]);
14746
14951
  const types = {
14747
14952
  active_tab: "String",
14748
14953
  tab_order: "[String!]",
@@ -14765,10 +14970,10 @@ function registerChatCommands(program) {
14765
14970
  }
14766
14971
  if (["chats.create", "chats.update"].includes(operation.id)) {
14767
14972
  const payload = {};
14768
- for (const option2 of operation.options) {
14769
- if (option2.name === "chatId" || input[option2.name] === void 0) continue;
14770
- const name = chatArgument(option2);
14771
- payload[name] = input[option2.name];
14973
+ for (const option3 of operation.options) {
14974
+ if (option3.name === "chatId" || input[option3.name] === void 0) continue;
14975
+ const name = chatArgument(option3);
14976
+ payload[name] = input[option3.name];
14772
14977
  delete variables[name];
14773
14978
  delete variableTypes[name];
14774
14979
  }
@@ -14834,11 +15039,11 @@ function registerChatCommands(program) {
14834
15039
  isShow: true,
14835
15040
  ...operation.id === "chats.open" ? {
14836
15041
  transformData: (raw2) => {
14837
- const record3 = z32.object({
14838
- id: z32.string(),
14839
- slug: z32.string().regex(/^CHT-[0-9A-F-]{36}$/),
14840
- organizationId: z32.literal(organizationId),
14841
- chatType: z32.enum(["default", "direct", "team"])
15042
+ const record3 = z33.object({
15043
+ id: z33.string(),
15044
+ slug: z33.string().regex(/^CHT-[0-9A-F-]{36}$/),
15045
+ organizationId: z33.literal(organizationId),
15046
+ chatType: z33.enum(["default", "direct", "team"])
14842
15047
  }).parse(raw2);
14843
15048
  return { id: record3.id, slug: record3.slug, route: `/chat/${record3.slug}` };
14844
15049
  }
@@ -16400,14 +16605,14 @@ function registerMailCommands(program) {
16400
16605
  }
16401
16606
 
16402
16607
  // src/commands/phantom.ts
16403
- import { z as z33 } from "zod";
16404
- var nonNegativeInt4 = z33.coerce.number().int().min(0);
16405
- var nullableString = z33.string().nullable().optional().transform((value) => value ?? null);
16406
- var idString = z33.union([z33.string(), z33.number()]).transform((value) => String(value));
16407
- var nullableIdString = z33.union([z33.string(), z33.number()]).nullable().optional().transform(
16608
+ import { z as z34 } from "zod";
16609
+ var nonNegativeInt4 = z34.coerce.number().int().min(0);
16610
+ var nullableString = z34.string().nullable().optional().transform((value) => value ?? null);
16611
+ var idString = z34.union([z34.string(), z34.number()]).transform((value) => String(value));
16612
+ var nullableIdString = z34.union([z34.string(), z34.number()]).nullable().optional().transform(
16408
16613
  (value) => value === void 0 || value === null ? null : String(value)
16409
16614
  );
16410
- var jsonObject = z33.record(z33.string(), z33.unknown());
16615
+ var jsonObject2 = z34.record(z34.string(), z34.unknown());
16411
16616
  var PHANTOM_LEDGER_INVENTORY_SELECTION = `{
16412
16617
  schemaVersion
16413
16618
  runsCount
@@ -16620,10 +16825,10 @@ var PHANTOM_LEDGER_KEY_ALIASES = {
16620
16825
  content_hash: "contentHash",
16621
16826
  observed_at: "observedAt"
16622
16827
  };
16623
- var phantomLedgerInventorySchema = z33.preprocess(
16828
+ var phantomLedgerInventorySchema = z34.preprocess(
16624
16829
  normalizePhantomLedgerKeys,
16625
- z33.object({
16626
- schemaVersion: z33.string(),
16830
+ z34.object({
16831
+ schemaVersion: z34.string(),
16627
16832
  runsCount: nonNegativeInt4,
16628
16833
  observationsCount: nonNegativeInt4,
16629
16834
  candidatesCount: nonNegativeInt4,
@@ -16633,16 +16838,16 @@ var phantomLedgerInventorySchema = z33.preprocess(
16633
16838
  reportsCount: nonNegativeInt4
16634
16839
  })
16635
16840
  );
16636
- var phantomRunSchema = z33.preprocess(
16841
+ var phantomRunSchema = z34.preprocess(
16637
16842
  normalizePhantomLedgerKeys,
16638
- z33.object({
16843
+ z34.object({
16639
16844
  id: idString,
16640
16845
  organizationId: idString,
16641
- notificationId: z33.union([z33.string(), z33.number()]).nullable().optional().transform(
16846
+ notificationId: z34.union([z34.string(), z34.number()]).nullable().optional().transform(
16642
16847
  (value) => value === void 0 || value === null ? null : String(value)
16643
16848
  ),
16644
- status: z33.string(),
16645
- triggerType: z33.string(),
16849
+ status: z34.string(),
16850
+ triggerType: z34.string(),
16646
16851
  startedAt: nullableString,
16647
16852
  completedAt: nullableString,
16648
16853
  scannedFileCount: nonNegativeInt4,
@@ -16652,163 +16857,163 @@ var phantomRunSchema = z33.preprocess(
16652
16857
  errorCount: nonNegativeInt4,
16653
16858
  warningCount: nonNegativeInt4,
16654
16859
  errorMessage: nullableString,
16655
- dryRun: z33.boolean(),
16656
- schemaVersion: z33.string(),
16860
+ dryRun: z34.boolean(),
16861
+ schemaVersion: z34.string(),
16657
16862
  testRunId: nullableString,
16658
16863
  idempotencyKey: nullableString,
16659
- ledgerMetadata: jsonObject.catch({}),
16660
- createdAt: z33.string(),
16661
- updatedAt: z33.string()
16864
+ ledgerMetadata: jsonObject2.catch({}),
16865
+ createdAt: z34.string(),
16866
+ updatedAt: z34.string()
16662
16867
  })
16663
16868
  );
16664
- var phantomRunListItemSchema = z33.preprocess(
16869
+ var phantomRunListItemSchema = z34.preprocess(
16665
16870
  normalizePhantomLedgerKeys,
16666
- z33.object({
16871
+ z34.object({
16667
16872
  id: idString,
16668
16873
  organizationId: idString,
16669
- status: z33.string(),
16670
- triggerType: z33.string(),
16671
- dryRun: z33.boolean(),
16672
- schemaVersion: z33.string(),
16874
+ status: z34.string(),
16875
+ triggerType: z34.string(),
16876
+ dryRun: z34.boolean(),
16877
+ schemaVersion: z34.string(),
16673
16878
  testRunId: nullableString,
16674
- createdAt: z33.string(),
16675
- updatedAt: z33.string()
16879
+ createdAt: z34.string(),
16880
+ updatedAt: z34.string()
16676
16881
  })
16677
16882
  );
16678
- var phantomReportSchema = z33.preprocess(
16883
+ var phantomReportSchema = z34.preprocess(
16679
16884
  normalizePhantomLedgerKeys,
16680
- z33.object({
16885
+ z34.object({
16681
16886
  id: idString,
16682
16887
  organizationId: idString,
16683
16888
  phantomRunId: idString,
16684
- status: z33.string(),
16685
- reportType: z33.string(),
16686
- schemaVersion: z33.string(),
16889
+ status: z34.string(),
16890
+ reportType: z34.string(),
16891
+ schemaVersion: z34.string(),
16687
16892
  markdownPath: nullableString,
16688
- payload: jsonObject.catch({}),
16893
+ payload: jsonObject2.catch({}),
16689
16894
  testRunId: nullableString,
16690
- idempotencyKey: z33.string(),
16691
- createdAt: z33.string(),
16692
- updatedAt: z33.string()
16895
+ idempotencyKey: z34.string(),
16896
+ createdAt: z34.string(),
16897
+ updatedAt: z34.string()
16693
16898
  })
16694
16899
  );
16695
- var phantomObservationSchema = z33.preprocess(
16900
+ var phantomObservationSchema = z34.preprocess(
16696
16901
  normalizePhantomLedgerKeys,
16697
- z33.object({
16902
+ z34.object({
16698
16903
  id: idString,
16699
16904
  organizationId: idString,
16700
16905
  phantomRunId: idString,
16701
- status: z33.string(),
16702
- observationType: z33.string(),
16906
+ status: z34.string(),
16907
+ observationType: z34.string(),
16703
16908
  targetType: nullableString,
16704
16909
  targetId: nullableString,
16705
16910
  sourceTable: nullableString,
16706
16911
  sourceRecordId: nullableString,
16707
16912
  sourceEventId: nullableString,
16708
16913
  contentHash: nullableString,
16709
- observedAt: z33.string(),
16710
- confidence: z33.coerce.number(),
16711
- payload: jsonObject.catch({}),
16712
- schemaVersion: z33.string(),
16914
+ observedAt: z34.string(),
16915
+ confidence: z34.coerce.number(),
16916
+ payload: jsonObject2.catch({}),
16917
+ schemaVersion: z34.string(),
16713
16918
  testRunId: nullableString,
16714
- idempotencyKey: z33.string(),
16715
- createdAt: z33.string(),
16716
- updatedAt: z33.string()
16919
+ idempotencyKey: z34.string(),
16920
+ createdAt: z34.string(),
16921
+ updatedAt: z34.string()
16717
16922
  })
16718
16923
  );
16719
- var phantomCandidateSchema = z33.preprocess(
16924
+ var phantomCandidateSchema = z34.preprocess(
16720
16925
  normalizePhantomLedgerKeys,
16721
- z33.object({
16926
+ z34.object({
16722
16927
  id: idString,
16723
16928
  organizationId: idString,
16724
16929
  phantomRunId: idString,
16725
16930
  phantomObservationId: nullableString,
16726
- status: z33.string(),
16727
- candidateType: z33.string(),
16931
+ status: z34.string(),
16932
+ candidateType: z34.string(),
16728
16933
  targetType: nullableString,
16729
16934
  targetId: nullableString,
16730
16935
  title: nullableString,
16731
- dryRun: z33.boolean(),
16732
- payload: jsonObject.catch({}),
16733
- approvalStatus: z33.string(),
16936
+ dryRun: z34.boolean(),
16937
+ payload: jsonObject2.catch({}),
16938
+ approvalStatus: z34.string(),
16734
16939
  approvedById: nullableIdString,
16735
16940
  approvedAt: nullableString,
16736
16941
  approvalSource: nullableString,
16737
16942
  approvalReason: nullableString,
16738
- approvalMetadata: jsonObject.catch({}),
16739
- schemaVersion: z33.string(),
16943
+ approvalMetadata: jsonObject2.catch({}),
16944
+ schemaVersion: z34.string(),
16740
16945
  testRunId: nullableString,
16741
- idempotencyKey: z33.string(),
16742
- createdAt: z33.string(),
16743
- updatedAt: z33.string()
16946
+ idempotencyKey: z34.string(),
16947
+ createdAt: z34.string(),
16948
+ updatedAt: z34.string()
16744
16949
  })
16745
16950
  );
16746
- var phantomCandidateEvidenceSchema = z33.preprocess(
16951
+ var phantomCandidateEvidenceSchema = z34.preprocess(
16747
16952
  normalizePhantomLedgerKeys,
16748
- z33.object({
16953
+ z34.object({
16749
16954
  id: idString,
16750
16955
  organizationId: idString,
16751
16956
  phantomCandidateId: idString,
16752
16957
  phantomObservationId: nullableString,
16753
- evidenceType: z33.string(),
16958
+ evidenceType: z34.string(),
16754
16959
  sourceType: nullableString,
16755
16960
  sourceId: nullableString,
16756
16961
  contentHash: nullableString,
16757
- payload: jsonObject.catch({}),
16758
- schemaVersion: z33.string(),
16962
+ payload: jsonObject2.catch({}),
16963
+ schemaVersion: z34.string(),
16759
16964
  testRunId: nullableString,
16760
- idempotencyKey: z33.string(),
16761
- createdAt: z33.string(),
16762
- updatedAt: z33.string()
16965
+ idempotencyKey: z34.string(),
16966
+ createdAt: z34.string(),
16967
+ updatedAt: z34.string()
16763
16968
  })
16764
16969
  );
16765
- var phantomValidationSchema = z33.preprocess(
16970
+ var phantomValidationSchema = z34.preprocess(
16766
16971
  normalizePhantomLedgerKeys,
16767
- z33.object({
16972
+ z34.object({
16768
16973
  id: idString,
16769
16974
  organizationId: idString,
16770
16975
  phantomRunId: idString,
16771
16976
  phantomCandidateId: idString,
16772
- status: z33.string(),
16773
- validationType: z33.string(),
16774
- dryRun: z33.boolean(),
16775
- payload: jsonObject.catch({}),
16776
- resultPayload: jsonObject.catch({}),
16777
- schemaVersion: z33.string(),
16977
+ status: z34.string(),
16978
+ validationType: z34.string(),
16979
+ dryRun: z34.boolean(),
16980
+ payload: jsonObject2.catch({}),
16981
+ resultPayload: jsonObject2.catch({}),
16982
+ schemaVersion: z34.string(),
16778
16983
  testRunId: nullableString,
16779
- idempotencyKey: z33.string(),
16780
- createdAt: z33.string(),
16781
- updatedAt: z33.string()
16984
+ idempotencyKey: z34.string(),
16985
+ createdAt: z34.string(),
16986
+ updatedAt: z34.string()
16782
16987
  })
16783
16988
  );
16784
- var phantomApplyOperationSchema = z33.preprocess(
16989
+ var phantomApplyOperationSchema = z34.preprocess(
16785
16990
  normalizePhantomLedgerKeys,
16786
- z33.object({
16991
+ z34.object({
16787
16992
  id: idString,
16788
16993
  organizationId: idString,
16789
16994
  phantomRunId: idString,
16790
16995
  phantomCandidateId: idString,
16791
- status: z33.string(),
16792
- operationType: z33.string(),
16793
- dryRun: z33.boolean(),
16996
+ status: z34.string(),
16997
+ operationType: z34.string(),
16998
+ dryRun: z34.boolean(),
16794
16999
  targetType: nullableString,
16795
17000
  targetId: nullableString,
16796
- payload: jsonObject.catch({}),
16797
- resultPayload: jsonObject.catch({}),
16798
- schemaVersion: z33.string(),
17001
+ payload: jsonObject2.catch({}),
17002
+ resultPayload: jsonObject2.catch({}),
17003
+ schemaVersion: z34.string(),
16799
17004
  testRunId: nullableString,
16800
- idempotencyKey: z33.string(),
16801
- createdAt: z33.string(),
16802
- updatedAt: z33.string()
17005
+ idempotencyKey: z34.string(),
17006
+ createdAt: z34.string(),
17007
+ updatedAt: z34.string()
16803
17008
  })
16804
17009
  );
16805
- var phantomRunsSchema = z33.array(phantomRunListItemSchema);
16806
- var phantomReportsSchema = z33.array(phantomReportSchema);
16807
- var phantomObservationsSchema = z33.array(phantomObservationSchema);
16808
- var phantomCandidatesSchema = z33.array(phantomCandidateSchema);
16809
- var phantomCandidateEvidencesSchema = z33.array(phantomCandidateEvidenceSchema);
16810
- var phantomValidationsSchema = z33.array(phantomValidationSchema);
16811
- var phantomApplyOperationsSchema = z33.array(phantomApplyOperationSchema);
17010
+ var phantomRunsSchema = z34.array(phantomRunListItemSchema);
17011
+ var phantomReportsSchema = z34.array(phantomReportSchema);
17012
+ var phantomObservationsSchema = z34.array(phantomObservationSchema);
17013
+ var phantomCandidatesSchema = z34.array(phantomCandidateSchema);
17014
+ var phantomCandidateEvidencesSchema = z34.array(phantomCandidateEvidenceSchema);
17015
+ var phantomValidationsSchema = z34.array(phantomValidationSchema);
17016
+ var phantomApplyOperationsSchema = z34.array(phantomApplyOperationSchema);
16812
17017
  function isRecord6(value) {
16813
17018
  return Boolean(value) && typeof value === "object" && !Array.isArray(value);
16814
17019
  }
@@ -18103,12 +18308,12 @@ function registerDatasheetsCommands(program) {
18103
18308
  dataJson: "required"
18104
18309
  }
18105
18310
  );
18106
- for (const action of ["archive", "delete"]) {
18311
+ for (const action2 of ["archive", "delete"]) {
18107
18312
  registerMutation(
18108
- column.command(action).requiredOption("--id <id>").requiredOption("--datasheet-id <datasheetId>"),
18313
+ column.command(action2).requiredOption("--id <id>").requiredOption("--datasheet-id <datasheetId>"),
18109
18314
  {
18110
- command: `datasheets.column.${action}`,
18111
- field: `${action}_datasheet_column`,
18315
+ command: `datasheets.column.${action2}`,
18316
+ field: `${action2}_datasheet_column`,
18112
18317
  requiredIds: [
18113
18318
  { option: "datasheetId", variable: "datasheet_id", label: "--datasheet-id" },
18114
18319
  { option: "id", variable: "id", label: "--id" }
@@ -18142,12 +18347,12 @@ function registerDatasheetsCommands(program) {
18142
18347
  dataJson: "required"
18143
18348
  }
18144
18349
  );
18145
- for (const action of ["archive", "delete"]) {
18350
+ for (const action2 of ["archive", "delete"]) {
18146
18351
  registerMutation(
18147
- row.command(action).requiredOption("--id <id>").requiredOption("--datasheet-id <datasheetId>"),
18352
+ row.command(action2).requiredOption("--id <id>").requiredOption("--datasheet-id <datasheetId>"),
18148
18353
  {
18149
- command: `datasheets.row.${action}`,
18150
- field: `${action}_datasheet_row`,
18354
+ command: `datasheets.row.${action2}`,
18355
+ field: `${action2}_datasheet_row`,
18151
18356
  requiredIds: [
18152
18357
  { option: "datasheetId", variable: "datasheet_id", label: "--datasheet-id" },
18153
18358
  { option: "id", variable: "id", label: "--id" }
@@ -18188,12 +18393,12 @@ function registerDatasheetsCommands(program) {
18188
18393
  dataJson: "required"
18189
18394
  }
18190
18395
  );
18191
- for (const action of ["archive", "delete"]) {
18396
+ for (const action2 of ["archive", "delete"]) {
18192
18397
  registerMutation(
18193
- view.command(action).requiredOption("--id <id>").requiredOption("--datasheet-id <datasheetId>"),
18398
+ view.command(action2).requiredOption("--id <id>").requiredOption("--datasheet-id <datasheetId>"),
18194
18399
  {
18195
- command: `datasheets.view.${action}`,
18196
- field: `${action}_datasheet_view`,
18400
+ command: `datasheets.view.${action2}`,
18401
+ field: `${action2}_datasheet_view`,
18197
18402
  requiredIds: [
18198
18403
  { option: "datasheetId", variable: "datasheet_id", label: "--datasheet-id" },
18199
18404
  { option: "id", variable: "id", label: "--id" }
@@ -18227,12 +18432,12 @@ function registerDatasheetsCommands(program) {
18227
18432
  dataJson: "required"
18228
18433
  }
18229
18434
  );
18230
- for (const action of ["publish", "close", "archive", "delete"]) {
18435
+ for (const action2 of ["publish", "close", "archive", "delete"]) {
18231
18436
  registerMutation(
18232
- form.command(action).requiredOption("--id <id>").requiredOption("--datasheet-id <datasheetId>"),
18437
+ form.command(action2).requiredOption("--id <id>").requiredOption("--datasheet-id <datasheetId>"),
18233
18438
  {
18234
- command: `datasheets.form.${action}`,
18235
- field: `${action}_datasheet_form`,
18439
+ command: `datasheets.form.${action2}`,
18440
+ field: `${action2}_datasheet_form`,
18236
18441
  requiredIds: [
18237
18442
  { option: "datasheetId", variable: "datasheet_id", label: "--datasheet-id" },
18238
18443
  { option: "id", variable: "id", label: "--id" }
@@ -18767,7 +18972,7 @@ function registerSignatureCommands(program) {
18767
18972
  }
18768
18973
 
18769
18974
  // src/commands/atlasAuthoring.ts
18770
- import { z as z34 } from "zod";
18975
+ import { z as z35 } from "zod";
18771
18976
 
18772
18977
  // src/commands/atlasAuthoringAgentSelection.ts
18773
18978
  var ATLAS_AUTHORING_AGENT_SELECTION = `{
@@ -18822,71 +19027,71 @@ var ATLAS_AUTHORING_AGENT_SELECTION = `{
18822
19027
  }`;
18823
19028
 
18824
19029
  // src/commands/atlasAuthoring.ts
18825
- var idSchema15 = z34.string().trim().min(1);
18826
- var idempotencyKeySchema = z34.string().min(1).refine((value) => value.trim() === value, "Idempotency key must not have leading or trailing whitespace.");
18827
- var skillScopeSchema = z34.enum(["ADMIN_GLOBAL", "MEMBER_PERSONAL"]);
18828
- var isoDateSchema = z34.iso.date();
18829
- var nonEmptyStringSchema = z34.string().trim().min(1);
19030
+ var idSchema15 = z35.string().trim().min(1);
19031
+ var idempotencyKeySchema = z35.string().min(1).refine((value) => value.trim() === value, "Idempotency key must not have leading or trailing whitespace.");
19032
+ var skillScopeSchema = z35.enum(["ADMIN_GLOBAL", "MEMBER_PERSONAL"]);
19033
+ var isoDateSchema = z35.iso.date();
19034
+ var nonEmptyStringSchema = z35.string().trim().min(1);
18830
19035
  var AUTOMATION_RUN_HTTP_TIMEOUT_MS = 6e4;
18831
- var agentToolAccessSchema = z34.array(
18832
- z34.object({
19036
+ var agentToolAccessSchema = z35.array(
19037
+ z35.object({
18833
19038
  tool_key: nonEmptyStringSchema,
18834
19039
  scope_value: nonEmptyStringSchema
18835
19040
  }).strict()
18836
19041
  ).min(1);
18837
19042
  var agentToolAccessUpdateSchema = agentToolAccessSchema.min(0);
18838
- var agentPluginConnectionsSchema = z34.array(
18839
- z34.object({
19043
+ var agentPluginConnectionsSchema = z35.array(
19044
+ z35.object({
18840
19045
  external_tool_connection_id: nonEmptyStringSchema,
18841
19046
  tool_key: nonEmptyStringSchema,
18842
19047
  scope_value: nonEmptyStringSchema.optional(),
18843
- allowed_tools: z34.array(nonEmptyStringSchema).optional(),
18844
- allowed_scopes: z34.array(nonEmptyStringSchema).optional(),
18845
- requires_confirmation: z34.boolean().optional(),
18846
- enabled: z34.boolean().optional()
19048
+ allowed_tools: z35.array(nonEmptyStringSchema).optional(),
19049
+ allowed_scopes: z35.array(nonEmptyStringSchema).optional(),
19050
+ requires_confirmation: z35.boolean().optional(),
19051
+ enabled: z35.boolean().optional()
18847
19052
  }).strict()
18848
19053
  ).min(1);
18849
- var agentPluginConnectionUpdateSchema = z34.array(
18850
- z34.union([
18851
- z34.object({
19054
+ var agentPluginConnectionUpdateSchema = z35.array(
19055
+ z35.union([
19056
+ z35.object({
18852
19057
  id: nonEmptyStringSchema,
18853
- _destroy: z34.literal(true)
19058
+ _destroy: z35.literal(true)
18854
19059
  }).strict(),
18855
- z34.object({
19060
+ z35.object({
18856
19061
  id: nonEmptyStringSchema.optional(),
18857
19062
  external_tool_connection_id: nonEmptyStringSchema.optional(),
18858
19063
  tool_key: nonEmptyStringSchema.optional(),
18859
19064
  scope_value: nonEmptyStringSchema.optional(),
18860
- allowed_tools: z34.array(nonEmptyStringSchema).optional(),
18861
- allowed_scopes: z34.array(nonEmptyStringSchema).optional(),
18862
- requires_confirmation: z34.boolean().optional(),
18863
- enabled: z34.boolean().optional()
19065
+ allowed_tools: z35.array(nonEmptyStringSchema).optional(),
19066
+ allowed_scopes: z35.array(nonEmptyStringSchema).optional(),
19067
+ requires_confirmation: z35.boolean().optional(),
19068
+ enabled: z35.boolean().optional()
18864
19069
  }).strict().superRefine((value, context) => {
18865
19070
  if (value.id || value.external_tool_connection_id && value.tool_key) return;
18866
19071
  context.addIssue({
18867
- code: z34.ZodIssueCode.custom,
19072
+ code: z35.ZodIssueCode.custom,
18868
19073
  message: "Plugin updates require an id, or both external_tool_connection_id and tool_key for a new grant."
18869
19074
  });
18870
19075
  })
18871
19076
  ])
18872
19077
  );
18873
- var agentTriggerSchema = z34.object({
18874
- trigger_type: z34.literal("cron"),
19078
+ var agentTriggerSchema = z35.object({
19079
+ trigger_type: z35.literal("cron"),
18875
19080
  cron_expression: nonEmptyStringSchema,
18876
19081
  timezone: nonEmptyStringSchema,
18877
- starts_at: z34.iso.datetime({ offset: true }).nullable().optional(),
18878
- ends_at: z34.iso.datetime({ offset: true }).nullable().optional(),
18879
- max_runs: z34.number().int().positive().nullable().optional(),
18880
- enabled: z34.boolean().optional()
19082
+ starts_at: z35.iso.datetime({ offset: true }).nullable().optional(),
19083
+ ends_at: z35.iso.datetime({ offset: true }).nullable().optional(),
19084
+ max_runs: z35.number().int().positive().nullable().optional(),
19085
+ enabled: z35.boolean().optional()
18881
19086
  }).strict();
18882
- var agentTriggerUpdateSchema = z34.union([
19087
+ var agentTriggerUpdateSchema = z35.union([
18883
19088
  agentTriggerSchema.extend({ id: nonEmptyStringSchema.optional() }).strict(),
18884
- z34.object({
19089
+ z35.object({
18885
19090
  id: nonEmptyStringSchema,
18886
- _destroy: z34.literal(true)
19091
+ _destroy: z35.literal(true)
18887
19092
  }).strict()
18888
19093
  ]);
18889
- var automationConfigSchema = z34.record(z34.string(), z34.unknown());
19094
+ var automationConfigSchema = z35.record(z35.string(), z35.unknown());
18890
19095
  var AGENT_DETAILS_SELECTION = `{
18891
19096
  count
18892
19097
  currentPage
@@ -19039,8 +19244,8 @@ function requirePaginationInteger(value, key3, minimum) {
19039
19244
  });
19040
19245
  }
19041
19246
  function normalizeAutomationList(payload) {
19042
- const page4 = asRecord6(payload);
19043
- if (!page4 || !Array.isArray(page4.data)) {
19247
+ const page5 = asRecord6(payload);
19248
+ if (!page5 || !Array.isArray(page5.data)) {
19044
19249
  throw new CliError({
19045
19250
  message: "Automation list response did not include a paginated data collection.",
19046
19251
  kind: "malformed_response",
@@ -19048,7 +19253,7 @@ function normalizeAutomationList(payload) {
19048
19253
  exitCode: EXIT_CODES.networkOrUpstream
19049
19254
  });
19050
19255
  }
19051
- const rows2 = page4.data;
19256
+ const rows2 = page5.data;
19052
19257
  const data = rows2.map((value) => {
19053
19258
  const row = asRecord6(value);
19054
19259
  const attributes = asRecord6(row?.attributes);
@@ -19090,9 +19295,9 @@ function normalizeAutomationList(payload) {
19090
19295
  });
19091
19296
  return {
19092
19297
  data,
19093
- count: requirePaginationInteger(page4.count, "count", 0),
19094
- currentPage: requirePaginationInteger(page4.currentPage, "currentPage", 1),
19095
- totalPages: requirePaginationInteger(page4.totalPages, "totalPages", 1)
19298
+ count: requirePaginationInteger(page5.count, "count", 0),
19299
+ currentPage: requirePaginationInteger(page5.currentPage, "currentPage", 1),
19300
+ totalPages: requirePaginationInteger(page5.totalPages, "totalPages", 1)
19096
19301
  };
19097
19302
  }
19098
19303
  function parseBooleanOption(value, optionName) {
@@ -19340,7 +19545,7 @@ function registerAtlasAuthoringCommands(program) {
19340
19545
  "--plugin-connections <json>",
19341
19546
  "JSON array of persisted Agent connector grants"
19342
19547
  ).option("--trigger <json>", "Canonical cron Agent trigger JSON").action(async (opts, cmd) => {
19343
- const idempotencyKey2 = idempotencyKeySchema.parse(opts.idempotencyKey);
19548
+ const idempotencyKey3 = idempotencyKeySchema.parse(opts.idempotencyKey);
19344
19549
  const runWhenMentioned = parseBooleanOption(opts.runWhenMentioned, "--run-when-mentioned");
19345
19550
  const webAccessEnabled = parseBooleanOption(opts.webAccessEnabled, "--web-access-enabled");
19346
19551
  const webFetchEnabled = parseBooleanOption(opts.webFetchEnabled, "--web-fetch-enabled");
@@ -19408,7 +19613,7 @@ function registerAtlasAuthoringCommands(program) {
19408
19613
  ...trigger !== void 0 ? { trigger_attributes: trigger } : {}
19409
19614
  }
19410
19615
  },
19411
- idempotency_key: idempotencyKey2
19616
+ idempotency_key: idempotencyKey3
19412
19617
  },
19413
19618
  transformMutationPayload: normalizePersistedCreatePayload
19414
19619
  });
@@ -19550,7 +19755,7 @@ function registerAtlasAuthoringCommands(program) {
19550
19755
  "--service <service>",
19551
19756
  "Supported service: gmail, calendar, outlook_calendar, outlook_mail, slack, or stripe"
19552
19757
  ).action(async (opts, cmd) => {
19553
- const service = z34.enum([
19758
+ const service = z35.enum([
19554
19759
  "gmail",
19555
19760
  "calendar",
19556
19761
  "outlook_calendar",
@@ -19597,7 +19802,7 @@ function registerAtlasAuthoringCommands(program) {
19597
19802
  });
19598
19803
  });
19599
19804
  automations.command("create").description("Create a Backlog Automation through the API-owned createAutomation contract").requiredOption("--summary <summary>").requiredOption("--ai-task-config <json>", "Valid JSON for the API-owned ai_task_config field").requiredOption("--idempotency-key <key>", "Required create idempotency key").option("--description <description>").option("--notes <notes>").option("--member-id <memberId>").requiredOption("--agent-id <agentId>", "Required executor Agent id").option("--priority <priority>").option("--due-date <date>", "ISO-8601 date (YYYY-MM-DD)").action(async (opts, cmd) => {
19600
- const idempotencyKey2 = idempotencyKeySchema.parse(opts.idempotencyKey);
19805
+ const idempotencyKey3 = idempotencyKeySchema.parse(opts.idempotencyKey);
19601
19806
  const context = await resolveCommandContext(cmd.optsWithGlobals());
19602
19807
  const organizationId = resolveOrganizationId(context.organizationId);
19603
19808
  await runGraphqlMutationCommand({
@@ -19622,7 +19827,7 @@ function registerAtlasAuthoringCommands(program) {
19622
19827
  ...opts.priority !== void 0 ? { priority: String(opts.priority) } : {},
19623
19828
  ...opts.dueDate !== void 0 ? { due_date: isoDateSchema.parse(opts.dueDate) } : {}
19624
19829
  },
19625
- idempotency_key: idempotencyKey2
19830
+ idempotency_key: idempotencyKey3
19626
19831
  },
19627
19832
  transformMutationPayload: normalizePersistedCreatePayload
19628
19833
  });
@@ -19768,7 +19973,7 @@ function registerAtlasAuthoringCommands(program) {
19768
19973
  throw new Error("Skills command must be registered before Atlas authoring commands.");
19769
19974
  }
19770
19975
  skills.command("create").description("Create a Skill through the API-owned createSkill contract").requiredOption("--name <name>").requiredOption("--scope <scope>", "ADMIN_GLOBAL or MEMBER_PERSONAL").requiredOption("--idempotency-key <key>", "Required create idempotency key").option("--emoji <emoji>").option("--description <description>").action(async (opts, cmd) => {
19771
- const idempotencyKey2 = idempotencyKeySchema.parse(opts.idempotencyKey);
19976
+ const idempotencyKey3 = idempotencyKeySchema.parse(opts.idempotencyKey);
19772
19977
  const context = await resolveCommandContext(cmd.optsWithGlobals());
19773
19978
  const organizationId = resolveOrganizationId(context.organizationId);
19774
19979
  await runGraphqlMutationCommand({
@@ -19789,7 +19994,7 @@ function registerAtlasAuthoringCommands(program) {
19789
19994
  ...opts.emoji !== void 0 ? { emoji: String(opts.emoji) } : {},
19790
19995
  ...opts.description !== void 0 ? { description: String(opts.description) } : {}
19791
19996
  },
19792
- idempotency_key: idempotencyKey2
19997
+ idempotency_key: idempotencyKey3
19793
19998
  },
19794
19999
  transformMutationPayload: normalizePersistedCreatePayload
19795
20000
  });
@@ -20180,8 +20385,8 @@ function transformSourceActions(value) {
20180
20385
  exitCode: EXIT_CODES.networkOrUpstream
20181
20386
  });
20182
20387
  }
20183
- for (const action of value) {
20184
- if (!isJsonRecord(action) || typeof action.key !== "string") {
20388
+ for (const action2 of value) {
20389
+ if (!isJsonRecord(action2) || typeof action2.key !== "string") {
20185
20390
  throw new CliError({
20186
20391
  message: "Data Pipeline source action discovery returned a malformed action",
20187
20392
  kind: "malformed_response",
@@ -20189,16 +20394,16 @@ function transformSourceActions(value) {
20189
20394
  exitCode: EXIT_CODES.networkOrUpstream
20190
20395
  });
20191
20396
  }
20192
- if (action.safetyClass !== "read_only" || action.requiresApproval !== false) {
20397
+ if (action2.safetyClass !== "read_only" || action2.requiresApproval !== false) {
20193
20398
  throw new CliError({
20194
- message: `Data Pipeline source action discovery returned a non-read-only action: ${action.key}`,
20399
+ message: `Data Pipeline source action discovery returned a non-read-only action: ${action2.key}`,
20195
20400
  kind: "malformed_response",
20196
20401
  status: 502,
20197
20402
  exitCode: EXIT_CODES.networkOrUpstream,
20198
20403
  details: {
20199
- actionKey: action.key,
20200
- safetyClass: action.safetyClass,
20201
- requiresApproval: action.requiresApproval
20404
+ actionKey: action2.key,
20405
+ safetyClass: action2.safetyClass,
20406
+ requiresApproval: action2.requiresApproval
20202
20407
  }
20203
20408
  });
20204
20409
  }
@@ -20307,10 +20512,66 @@ function registerDataPipelineCommands(program) {
20307
20512
  });
20308
20513
  }
20309
20514
 
20515
+ // src/commands/prospecting.ts
20516
+ import { Option as Option7 } from "commander";
20517
+ function registerProspectingCommands(program) {
20518
+ const prospecting = program.command("prospecting").description("Authorized Prospecting reads and exact approved actions");
20519
+ for (const operation of PROSPECTING_OPERATIONS) {
20520
+ const command = prospecting.command(operation.id.split(".")[1]).description(operation.description).option("--json", "Emit the stable JSON envelope");
20521
+ for (const definition of operation.options) {
20522
+ const kebab2 = definition.name.replace(/[A-Z]/g, (letter) => `-${letter.toLowerCase()}`);
20523
+ const option3 = new Option7(`--${kebab2} <${definition.name}>`, `Prospecting ${definition.name}`);
20524
+ if (definition.required) option3.makeOptionMandatory();
20525
+ if (definition.choices) option3.choices([...definition.choices]);
20526
+ command.addOption(option3);
20527
+ }
20528
+ command.action(async (raw, cmd) => {
20529
+ const { json: _json, ...values } = raw;
20530
+ const input = parseProspectingInput(operation, values);
20531
+ const context = await resolveCommandContext(cmd.optsWithGlobals());
20532
+ const variables = {
20533
+ organization_id: resolveOrganizationId(context.organizationId)
20534
+ };
20535
+ const variableTypes = { organization_id: "ID!" };
20536
+ if (operation.id === "prospecting.command") {
20537
+ variables.action = input.action;
20538
+ variables.input = input.dataJson;
20539
+ variables.idempotency_key = input.idempotencyKey;
20540
+ variableTypes.action = "String!";
20541
+ variableTypes.input = "JSON!";
20542
+ variableTypes.idempotency_key = "String!";
20543
+ await runGraphqlMutationCommand({
20544
+ command: operation.id,
20545
+ field: operation.field,
20546
+ runtimeOptions: context.runtimeOptions,
20547
+ variables,
20548
+ variableTypes,
20549
+ selectionSet: "{ ok status errorCode errors data }"
20550
+ });
20551
+ return;
20552
+ }
20553
+ for (const definition of operation.options) {
20554
+ if (input[definition.name] === void 0) continue;
20555
+ const argument = prospectingArgument(definition.name);
20556
+ variables[argument] = input[definition.name];
20557
+ variableTypes[argument] = definition.type;
20558
+ }
20559
+ await runGraphqlQueryCommand({
20560
+ command: operation.id,
20561
+ field: operation.field,
20562
+ runtimeOptions: context.runtimeOptions,
20563
+ variables,
20564
+ variableTypes,
20565
+ selectionSet: ""
20566
+ });
20567
+ });
20568
+ }
20569
+ }
20570
+
20310
20571
  // src/commands/discovery.ts
20311
20572
  import { existsSync as existsSync3, readFileSync } from "fs";
20312
20573
  import { join as join3 } from "path";
20313
- import { z as z35 } from "zod";
20574
+ import { z as z36 } from "zod";
20314
20575
  var PRIMARY_NAMESPACES = [
20315
20576
  "flow",
20316
20577
  "chats",
@@ -21031,9 +21292,9 @@ function commandSummary(command) {
21031
21292
  description: child.description(),
21032
21293
  usage: child.usage()
21033
21294
  })),
21034
- options: command.options.map((option2) => ({
21035
- flags: option2.flags,
21036
- description: option2.description
21295
+ options: command.options.map((option3) => ({
21296
+ flags: option3.flags,
21297
+ description: option3.description
21037
21298
  }))
21038
21299
  };
21039
21300
  }
@@ -21327,7 +21588,7 @@ function attachNamespaceDiscovery(program) {
21327
21588
  } : {},
21328
21589
  ...command.name() === "flow" ? {
21329
21590
  humanHandoffOnly: FLOW_HANDOFFS,
21330
- payloadSchemas: Object.fromEntries(FLOW_OPERATIONS.filter((operation) => operation.payload).map((operation) => [operation.id, z35.toJSONSchema(operation.payload)]))
21591
+ payloadSchemas: Object.fromEntries(FLOW_OPERATIONS.filter((operation) => operation.payload).map((operation) => [operation.id, z36.toJSONSchema(operation.payload)]))
21331
21592
  } : {}
21332
21593
  };
21333
21594
  if (opts.readable && !opts.json) {
@@ -21388,9 +21649,9 @@ function attachDiscoveryHelp(program) {
21388
21649
  ["doctor", "\nExamples:\n wave doctor\n wave doctor --readable\n"]
21389
21650
  ]);
21390
21651
  for (const command of program.commands) {
21391
- const text5 = helpByName.get(command.name());
21392
- if (text5) {
21393
- command.addHelpText("after", text5);
21652
+ const text6 = helpByName.get(command.name());
21653
+ if (text6) {
21654
+ command.addHelpText("after", text6);
21394
21655
  }
21395
21656
  }
21396
21657
  }
@@ -21411,9 +21672,9 @@ function buildCli(options) {
21411
21672
  "--config <configPath>",
21412
21673
  "Optional JSON config file (default: ~/.wave/config.json when present)"
21413
21674
  ).addOption(
21414
- new Option7("--auth-home <path>", "Credential storage directory (default: ~/.wave)")
21675
+ new Option8("--auth-home <path>", "Credential storage directory (default: ~/.wave)")
21415
21676
  ).addOption(
21416
- new Option7("--auth-storage <mode>", "Credential storage mode").choices(["auto", "keychain", "file", "disabled"]).default("auto")
21677
+ new Option8("--auth-storage <mode>", "Credential storage mode").choices(["auto", "keychain", "file", "disabled"]).default("auto")
21417
21678
  ).option("--timeout-ms <timeoutMs>", "HTTP timeout in milliseconds").option("--agent-name <agentName>", "Agent name for tracing").option("--agent-run-id <agentRunId>", "Agent run identifier for tracing").option("--request-id <requestId>", "Request identifier").option(
21418
21679
  "--atlas-member-id <memberId>",
21419
21680
  "Atlas ledger member ID (prefer WAVE_ATLAS_MEMBER_ID env var)"
@@ -21489,6 +21750,7 @@ function buildCli(options) {
21489
21750
  registerSignatureCommands(program);
21490
21751
  registerDesktopContextCommands(program);
21491
21752
  registerDataPipelineCommands(program);
21753
+ registerProspectingCommands(program);
21492
21754
  registerAuthCommands(program);
21493
21755
  registerDiscoveryCommands(program);
21494
21756
  attachNamespaceDiscovery(program);
@@ -21588,14 +21850,14 @@ async function readMachineInput(location) {
21588
21850
  let bytes = 0;
21589
21851
  process.stdin.setEncoding("utf8");
21590
21852
  for await (const chunk of process.stdin) {
21591
- const text5 = String(chunk);
21592
- bytes += Buffer.byteLength(text5, "utf8");
21853
+ const text6 = String(chunk);
21854
+ bytes += Buffer.byteLength(text6, "utf8");
21593
21855
  if (bytes > MAX_MACHINE_INPUT_BYTES) {
21594
21856
  throw new Error(
21595
21857
  `Machine input exceeds the maximum size of ${MAX_MACHINE_INPUT_BYTES} bytes.`
21596
21858
  );
21597
21859
  }
21598
- raw += text5;
21860
+ raw += text6;
21599
21861
  }
21600
21862
  if (!raw.trim()) throw new Error("Machine input JSON is required.");
21601
21863
  const parsed = JSON.parse(raw);
@@ -21624,11 +21886,11 @@ function parseTrustedJsonFromFd(fd, predicate) {
21624
21886
  const buffer = Buffer.allocUnsafe(8 * 1024);
21625
21887
  let bytes = 0;
21626
21888
  while (true) {
21627
- const read4 = readSync(fd, buffer, 0, buffer.length, null);
21628
- if (read4 === 0) break;
21629
- bytes += read4;
21889
+ const read5 = readSync(fd, buffer, 0, buffer.length, null);
21890
+ if (read5 === 0) break;
21891
+ bytes += read5;
21630
21892
  if (bytes > MAX_MACHINE_SECRET_BYTES) return null;
21631
- chunks.push(Buffer.from(buffer.subarray(0, read4)));
21893
+ chunks.push(Buffer.from(buffer.subarray(0, read5)));
21632
21894
  }
21633
21895
  const parsed = JSON.parse(Buffer.concat(chunks).toString("utf8"));
21634
21896
  return predicate(parsed) ? parsed : null;
@@ -21695,6 +21957,7 @@ function validateInput(operation, input) {
21695
21957
  ...validateBroadcastInput(operation.id, input),
21696
21958
  ...validatePhoneInput(operation.id, input),
21697
21959
  ...validateFlowInput(operation.id, input),
21960
+ ...validateProspectingInput(operation.id, input),
21698
21961
  ...validateChatInput(operation.id, input),
21699
21962
  ...orderedRangeErrors(input)
21700
21963
  ];
@@ -21727,9 +21990,9 @@ function commandArgs(command, input) {
21727
21990
  if (Array.isArray(value)) args.push(...value.map(optionValue));
21728
21991
  else args.push(optionValue(value));
21729
21992
  }
21730
- for (const option2 of command.options) {
21731
- const key3 = option2.attributeName();
21732
- const long = option2.long;
21993
+ for (const option3 of command.options) {
21994
+ const key3 = option3.attributeName();
21995
+ const long = option3.long;
21733
21996
  if (!long) continue;
21734
21997
  if (isMachinePresentationOption(key3)) {
21735
21998
  if (key3 === "json") args.push(long);