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