exponential-cli 1.25.0 → 1.27.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  // src/program.ts
4
- import { Command as Command28 } from "commander";
4
+ import { Command as Command29 } from "commander";
5
5
 
6
6
  // src/commands/auth.ts
7
7
  import { Command } from "commander";
@@ -2787,6 +2787,298 @@ CSV preview: ${preview.importable} of ${preview.total} row${preview.total === 1
2787
2787
  outputCsvSkipped(skipped);
2788
2788
  console.log(chalk3.gray("\n Nothing was created. Run again without --dry-run to import."));
2789
2789
  }
2790
+ function getOccurrenceStatusColor(status) {
2791
+ switch (status) {
2792
+ case "AGENDA_CIRCULATED":
2793
+ case "IN_PROGRESS":
2794
+ return "blue";
2795
+ case "CAPTURED":
2796
+ case "FOLLOWED_THROUGH":
2797
+ return "green";
2798
+ case "SKIPPED":
2799
+ return "yellow";
2800
+ default:
2801
+ return "gray";
2802
+ }
2803
+ }
2804
+ function formatInZone(value, timezone) {
2805
+ const date = new Date(value);
2806
+ try {
2807
+ return date.toLocaleString(void 0, {
2808
+ timeZone: timezone,
2809
+ weekday: "short",
2810
+ year: "numeric",
2811
+ month: "short",
2812
+ day: "numeric",
2813
+ hour: "2-digit",
2814
+ minute: "2-digit",
2815
+ timeZoneName: "short"
2816
+ });
2817
+ } catch {
2818
+ return date.toLocaleString();
2819
+ }
2820
+ }
2821
+ function outputCeremoniesJson(ceremonies, extra = {}) {
2822
+ console.log(JSON.stringify({ ceremonies, total: ceremonies.length, ...extra }, null, 2));
2823
+ }
2824
+ function outputCeremoniesPretty(ceremonies) {
2825
+ if (ceremonies.length === 0) {
2826
+ console.log(chalk3.gray("No ceremonies found."));
2827
+ return;
2828
+ }
2829
+ console.log(chalk3.bold(`
2830
+ Ceremonies (${ceremonies.length})`));
2831
+ console.log(chalk3.gray("\u2500".repeat(50)));
2832
+ for (const c of ceremonies) {
2833
+ const inactive = c.isActive ? "" : chalk3.red(" [inactive]");
2834
+ console.log(` ${chalk3.bold(c.name)} ${chalk3.gray(`(${c.slug})`)} ${chalk3.cyan(`[${c.kind}]`)}${inactive}`);
2835
+ console.log(chalk3.gray(` ID: ${c.id}`));
2836
+ console.log(
2837
+ chalk3.gray(
2838
+ ` ${c.cadenceRule ?? "one-off"} \xB7 ${c.timezone} \xB7 ${c.durationMinutes} min \xB7 owner ${c.owner?.name ?? c.ownerId} \xB7 ${c._count.participants} participants \xB7 ${c._count.occurrences} occurrences`
2839
+ )
2840
+ );
2841
+ }
2842
+ console.log();
2843
+ }
2844
+ function outputCeremonyJson(ceremony) {
2845
+ console.log(JSON.stringify(ceremony, null, 2));
2846
+ }
2847
+ function outputCeremonyPretty(c) {
2848
+ console.log(chalk3.gray("\u2500".repeat(50)));
2849
+ const inactive = c.isActive ? "" : chalk3.red(" [inactive]");
2850
+ console.log(`
2851
+ ${chalk3.bold(c.name)} ${chalk3.cyan(`[${c.kind}]`)}${inactive}`);
2852
+ console.log(chalk3.gray(` ID: ${c.id} \xB7 slug: ${c.slug}`));
2853
+ console.log(
2854
+ ` ${chalk3.gray("Cadence:")} ${c.isOneOff ? "one-off meeting" : c.cadenceRule ?? "none"} (${c.timezone}), ${c.durationMinutes} min, agenda ${c.leadTimeHours}h ahead`
2855
+ );
2856
+ if (c.meetingUrl) console.log(` ${chalk3.gray("Room:")} ${c.meetingUrl}`);
2857
+ if (c.autoExtractOutputs) console.log(` ${chalk3.gray("Outputs:")} extracted automatically from recordings`);
2858
+ console.log(` ${chalk3.gray("Owner:")} ${c.owner?.name ?? c.owner?.email ?? c.ownerId}`);
2859
+ if (c.participants.length > 0) {
2860
+ console.log(` ${chalk3.gray("Participants:")} ${c.participants.map((p) => p.user.name ?? p.user.email ?? p.userId).join(", ")}`);
2861
+ }
2862
+ if (c.product) console.log(` ${chalk3.gray("Product:")} ${c.product.name}`);
2863
+ if (c.team) console.log(` ${chalk3.gray("Team:")} ${c.team.name}`);
2864
+ if (c.projects.length > 0) {
2865
+ console.log(` ${chalk3.gray("Projects:")} ${c.projects.map((p) => p.project.name).join(", ")}`);
2866
+ }
2867
+ if (c.aliases.length > 0) console.log(` ${chalk3.gray("Aliases:")} ${c.aliases.join(", ")}`);
2868
+ for (const [label, body] of [
2869
+ ["Purpose", c.purpose],
2870
+ ["Not for", c.notFor],
2871
+ ["Inputs", c.inputs],
2872
+ ["Outputs", c.outputs]
2873
+ ]) {
2874
+ if (body) console.log(`
2875
+ ${chalk3.bold(label)}
2876
+ ${body}`);
2877
+ }
2878
+ if (c.agendaTemplate.length > 0) {
2879
+ console.log(`
2880
+ ${chalk3.bold("Agenda template")}`);
2881
+ for (const s of c.agendaTemplate) {
2882
+ console.log(` - ${s.title} ${chalk3.gray(`(${s.type}${s.minutes ? `, ${s.minutes} min` : ""})`)}`);
2883
+ }
2884
+ }
2885
+ if (c.occurrences.length > 0) {
2886
+ console.log(`
2887
+ ${chalk3.bold("Occurrences")} ${chalk3.gray("(newest first)")}`);
2888
+ for (const o of c.occurrences) {
2889
+ const color = getOccurrenceStatusColor(o.status);
2890
+ const moved = o.cadenceStart === null ? chalk3.gray(" \xB7 added off-cadence") : new Date(o.cadenceStart).getTime() !== new Date(o.scheduledStart).getTime() ? chalk3.gray(` \xB7 moved from ${formatInZone(o.cadenceStart, c.timezone)}`) : "";
2891
+ const recs = o.recordedMeetings.length > 0 ? chalk3.gray(` \xB7 ${o.recordedMeetings.length} recording${o.recordedMeetings.length === 1 ? "" : "s"}`) : "";
2892
+ console.log(` ${formatInZone(o.scheduledStart, c.timezone)} ${chalk3[color](`[${o.status}]`)}${moved}${recs}`);
2893
+ console.log(chalk3.gray(` ID: ${o.id}${o.skipReason ? ` \xB7 skipped: ${o.skipReason}` : ""}`));
2894
+ }
2895
+ }
2896
+ console.log();
2897
+ }
2898
+ function outputCeremonyTemplatesPretty(templates) {
2899
+ console.log(chalk3.bold(`
2900
+ Ceremony templates (${templates.length})`));
2901
+ console.log(chalk3.gray("\u2500".repeat(50)));
2902
+ for (const t of templates) {
2903
+ console.log(` ${chalk3.bold(t.name)} ${chalk3.gray(`(${t.slug})`)} ${chalk3.cyan(`[${t.kind}]`)}`);
2904
+ console.log(chalk3.gray(` ${t.cadenceRule} \xB7 ${t.durationMinutes} min \xB7 ${t.agendaTemplate.length} agenda sections`));
2905
+ if (t.purpose) console.log(chalk3.gray(` ${t.purpose}`));
2906
+ }
2907
+ console.log();
2908
+ }
2909
+ function outputCeremonyWritePretty(result, verb) {
2910
+ const c = result.ceremony;
2911
+ console.log(`\u2713 Ceremony ${verb}: ${chalk3.bold(c.name)} ${chalk3.gray(`(${c.slug})`)}`);
2912
+ console.log(chalk3.gray(` ID: ${c.id}`));
2913
+ if (result.occurrencesCreated > 0) {
2914
+ console.log(chalk3.gray(` ${result.occurrencesCreated} occurrence${result.occurrencesCreated === 1 ? "" : "s"} scheduled`));
2915
+ }
2916
+ }
2917
+ function outputOccurrencesJson(occurrences, extra = {}) {
2918
+ console.log(JSON.stringify({ occurrences, total: occurrences.length, ...extra }, null, 2));
2919
+ }
2920
+ function outputOccurrencesPretty(occurrences) {
2921
+ if (occurrences.length === 0) {
2922
+ console.log(chalk3.gray("No occurrences in this window."));
2923
+ return;
2924
+ }
2925
+ console.log(chalk3.bold(`
2926
+ Occurrences (${occurrences.length})`));
2927
+ console.log(chalk3.gray("\u2500".repeat(50)));
2928
+ for (const o of occurrences) {
2929
+ const color = getOccurrenceStatusColor(o.status);
2930
+ console.log(` ${formatInZone(o.scheduledStart)} ${chalk3.bold(o.ceremony.name)} ${chalk3[color](`[${o.status}]`)}`);
2931
+ console.log(chalk3.gray(` ID: ${o.id} \xB7 ceremony ${o.ceremonyId}`));
2932
+ }
2933
+ console.log();
2934
+ }
2935
+ function outputOccurrenceJson(occurrence, extras = {}) {
2936
+ console.log(JSON.stringify({ ...occurrence, ...extras }, null, 2));
2937
+ }
2938
+ function outputAgendaPretty(agenda) {
2939
+ if (!agenda) {
2940
+ console.log(chalk3.gray("\nNo agenda generated yet."));
2941
+ return;
2942
+ }
2943
+ console.log(`
2944
+ ${chalk3.bold("Agenda")} ${chalk3.gray(`(generated ${new Date(agenda.generatedAt).toLocaleString()})`)}`);
2945
+ for (const section of agenda.sections) {
2946
+ const minutes = section.minutes ? chalk3.gray(` \xB7 ${section.minutes} min`) : "";
2947
+ console.log(`
2948
+ ${chalk3.bold(section.title)}${minutes} ${chalk3.gray(`[${section.key}]`)}`);
2949
+ if (section.items.length === 0) {
2950
+ console.log(chalk3.gray(` ${section.emptyReason ?? "Nothing here."}`));
2951
+ }
2952
+ for (const item of section.items) {
2953
+ const box = item.resolvedAt ? chalk3.green("[x]") : "[ ]";
2954
+ const carried = item.carryCount ? chalk3.yellow(` \u21BB${item.carryCount}`) : "";
2955
+ console.log(` ${box} ${item.title}${carried}`);
2956
+ const meta = [item.detail, `${item.refType} \xB7 id ${item.id}`].filter(Boolean).join(" \xB7 ");
2957
+ console.log(chalk3.gray(` ${meta}`));
2958
+ }
2959
+ }
2960
+ if (agenda.narrative) {
2961
+ console.log(`
2962
+ ${chalk3.bold("Summary")}
2963
+ ${agenda.narrative}`);
2964
+ }
2965
+ }
2966
+ function outputOccurrenceUpdatesPretty(summary) {
2967
+ if (summary.questions.length === 0) {
2968
+ console.log(chalk3.gray("This ceremony kind has no async updates."));
2969
+ return;
2970
+ }
2971
+ console.log(
2972
+ chalk3.bold(`
2973
+ Async updates: ${summary.submittedCount} of ${summary.participants.length} submitted`) + (summary.blockedCount > 0 ? chalk3.red(` \xB7 ${summary.blockedCount} blocked`) : "")
2974
+ );
2975
+ for (const p of summary.participants) {
2976
+ const state = p.submittedAt ? chalk3.green("submitted") : chalk3.gray("not yet");
2977
+ const blocked = p.flaggedBlocker ? chalk3.red(" [blocked]") : "";
2978
+ console.log(`
2979
+ ${chalk3.bold(p.name ?? p.email ?? p.userId)} ${state}${blocked}`);
2980
+ for (const q of summary.questions) {
2981
+ const answer = p.answers[q.key];
2982
+ if (answer) console.log(` ${chalk3.gray(q.prompt)}
2983
+ ${answer.replace(/\n/g, "\n ")}`);
2984
+ }
2985
+ }
2986
+ console.log();
2987
+ }
2988
+ function outputMyOccurrenceUpdatePretty(update) {
2989
+ if (update.questions.length === 0) {
2990
+ console.log(chalk3.gray("This ceremony kind has no async updates."));
2991
+ return;
2992
+ }
2993
+ const state = update.submittedAt ? chalk3.green(`submitted ${new Date(update.submittedAt).toLocaleString()}`) : chalk3.gray("not submitted");
2994
+ console.log(`
2995
+ ${chalk3.bold("Your update")} ${state}${update.flaggedBlocker ? chalk3.red(" [blocked]") : ""}`);
2996
+ if (update.isParticipant === false) {
2997
+ console.log(chalk3.yellow(" You aren't a participant of this ceremony."));
2998
+ }
2999
+ for (const q of update.questions) {
3000
+ const answer = update.answers[q.key];
3001
+ const draft = update.draftAnswers[q.key];
3002
+ console.log(`
3003
+ ${chalk3.bold(q.prompt)} ${chalk3.gray(`[${q.key}]`)}`);
3004
+ if (answer) console.log(` ${answer.replace(/\n/g, "\n ")}`);
3005
+ else if (draft) console.log(chalk3.gray(` (draft) ${draft.replace(/\n/g, "\n ")}`));
3006
+ else console.log(chalk3.gray(" \u2014"));
3007
+ }
3008
+ console.log();
3009
+ }
3010
+ function outputOccurrencePretty(o, extras = {}) {
3011
+ const tz = o.ceremony.timezone;
3012
+ const color = getOccurrenceStatusColor(o.status);
3013
+ console.log(chalk3.gray("\u2500".repeat(50)));
3014
+ console.log(`
3015
+ ${chalk3.bold(o.ceremony.name)} \u2014 ${formatInZone(o.scheduledStart, tz)} ${chalk3[color](`[${o.status}]`)}`);
3016
+ console.log(chalk3.gray(` ID: ${o.id} \xB7 ceremony ${o.ceremonyId}`));
3017
+ console.log(` ${chalk3.gray("Owner:")} ${o.ceremony.owner?.name ?? o.ceremony.owner?.email ?? o.ceremony.ownerId}`);
3018
+ if (o.isOneOff) console.log(` ${chalk3.gray("One-off meeting")}${o.purpose ? `: ${o.purpose}` : ""}`);
3019
+ if (o.cadenceStart && new Date(o.cadenceStart).getTime() !== new Date(o.scheduledStart).getTime()) {
3020
+ console.log(` ${chalk3.gray("Moved from:")} ${formatInZone(o.cadenceStart, tz)}`);
3021
+ }
3022
+ if (o.scheduledMeeting) {
3023
+ const names = o.scheduledMeeting.attendees.map((a) => a.name ?? a.userId).filter(Boolean);
3024
+ console.log(
3025
+ ` ${chalk3.gray("Booking:")} ${o.scheduledMeeting.status}${names.length > 0 ? ` \xB7 ${names.join(", ")}` : ""}`
3026
+ );
3027
+ }
3028
+ if (o.skipReason) console.log(` ${chalk3.gray("Skipped:")} ${o.skipReason}`);
3029
+ if (o.agendaCirculatedAt) {
3030
+ console.log(` ${chalk3.gray("Agenda circulated:")} ${formatInZone(o.agendaCirculatedAt, tz)}`);
3031
+ }
3032
+ if (o.skipProposal?.proposed) {
3033
+ console.log(chalk3.yellow(" The agenda is empty \u2014 this occurrence is a candidate to skip."));
3034
+ }
3035
+ if (o.recordedMeetings.length > 0) {
3036
+ console.log(` ${chalk3.gray("Recordings:")}`);
3037
+ for (const m of o.recordedMeetings) {
3038
+ console.log(m.visible ? ` ${m.title ?? "(untitled)"} ${chalk3.gray(m.id)}` : chalk3.gray(` (a recording you cannot view) ${m.id}`));
3039
+ }
3040
+ }
3041
+ if (o.notesPageId && extras.notes === void 0) {
3042
+ console.log(` ${chalk3.gray("Notes page:")} ${o.notesPageId} ${chalk3.gray("(--notes to include)")}`);
3043
+ }
3044
+ outputAgendaPretty(o.agenda);
3045
+ if (extras.notes !== void 0 && !extras.extrasErrors?.notes) {
3046
+ console.log(`
3047
+ ${chalk3.bold("Notes")}`);
3048
+ console.log(extras.notes?.body ? extras.notes.body : chalk3.gray("No notes yet."));
3049
+ }
3050
+ if (extras.decisions) {
3051
+ console.log(`
3052
+ ${chalk3.bold("Decisions and open questions")}`);
3053
+ if (extras.decisions.length === 0) console.log(chalk3.gray("None logged against this occurrence."));
3054
+ for (const d of extras.decisions) {
3055
+ console.log(` ${chalk3.gray(d.label)} ${d.statement} ${chalk3[getDecisionStatusColor(d.status)](`[${d.status}]`)}`);
3056
+ }
3057
+ }
3058
+ if (extras.updates) outputOccurrenceUpdatesPretty(extras.updates);
3059
+ for (const [section, message] of Object.entries(extras.extrasErrors ?? {})) {
3060
+ console.log(chalk3.yellow(`
3061
+ Couldn't load ${section}: ${message}`));
3062
+ }
3063
+ console.log();
3064
+ }
3065
+ function outputProjectOccurrencesPretty(rows) {
3066
+ if (rows.length === 0) {
3067
+ console.log(chalk3.gray("No meetings in this window."));
3068
+ return;
3069
+ }
3070
+ console.log(chalk3.bold(`
3071
+ Project meetings (${rows.length})`));
3072
+ console.log(chalk3.gray("\u2500".repeat(50)));
3073
+ for (const r of rows) {
3074
+ const color = getOccurrenceStatusColor(r.status);
3075
+ const oneOff = r.isOneOff ? chalk3.cyan(" [one-off]") : "";
3076
+ console.log(` ${formatInZone(r.scheduledStart)} ${chalk3.bold(r.ceremonyName)}${oneOff} ${chalk3[color](`[${r.status}]`)}`);
3077
+ const meta = [`ID: ${r.occurrenceId}`, `${r.attendeeCount} attendee${r.attendeeCount === 1 ? "" : "s"}`, r.purpose].filter(Boolean);
3078
+ console.log(chalk3.gray(` ${meta.join(" \xB7 ")}`));
3079
+ }
3080
+ console.log();
3081
+ }
2790
3082
 
2791
3083
  // src/commands/actions.ts
2792
3084
  var VALID_PRIORITIES = [
@@ -3224,140 +3516,895 @@ function createContactsCommand() {
3224
3516
  handleError(error, useJson);
3225
3517
  }
3226
3518
  });
3227
- contacts.command("update").description("Update an existing contact").requiredOption("--id <id>", "Contact ID").option("--first-name <name>", "First name").option("--last-name <name>", "Last name").option("--email <email>", 'Email (use "null" to clear)').option("--phone <phone>", 'Phone (use "null" to clear)').option("--linkedin <url>", 'LinkedIn URL (use "null" to clear)').option("--telegram <handle>", 'Telegram handle (use "null" to clear)').option("--twitter <handle>", 'Twitter/X handle (use "null" to clear)').option("--github <handle>", 'GitHub username (use "null" to clear)').option("--bluesky <handle>", 'Bluesky handle (use "null" to clear)').option("--about <text>", "About / bio").option("--profile-type <type>", "Profile type").option("--skills <skills>", "Skills (comma-separated)").option("--tags <tags>", "Tags (comma-separated)").option("--organization <id>", 'Organization ID (use "null" to clear)').option("--organization-name <name>", "Organization name (find-or-create; ignored if --organization is set)").action(async (options, cmd) => {
3519
+ contacts.command("update").description("Update an existing contact").requiredOption("--id <id>", "Contact ID").option("--first-name <name>", "First name").option("--last-name <name>", "Last name").option("--email <email>", 'Email (use "null" to clear)').option("--phone <phone>", 'Phone (use "null" to clear)').option("--linkedin <url>", 'LinkedIn URL (use "null" to clear)').option("--telegram <handle>", 'Telegram handle (use "null" to clear)').option("--twitter <handle>", 'Twitter/X handle (use "null" to clear)').option("--github <handle>", 'GitHub username (use "null" to clear)').option("--bluesky <handle>", 'Bluesky handle (use "null" to clear)').option("--about <text>", "About / bio").option("--profile-type <type>", "Profile type").option("--skills <skills>", "Skills (comma-separated)").option("--tags <tags>", "Tags (comma-separated)").option("--organization <id>", 'Organization ID (use "null" to clear)').option("--organization-name <name>", "Organization name (find-or-create; ignored if --organization is set)").action(async (options, cmd) => {
3520
+ const globalOpts = cmd.optsWithGlobals();
3521
+ const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);
3522
+ const nullable = (v) => v === "null" ? null : v;
3523
+ try {
3524
+ const client = getClient();
3525
+ const contact = await client.contacts.update({
3526
+ id: options.id,
3527
+ firstName: options.firstName,
3528
+ lastName: options.lastName,
3529
+ email: nullable(options.email),
3530
+ phone: nullable(options.phone),
3531
+ linkedIn: nullable(options.linkedin),
3532
+ telegram: nullable(options.telegram),
3533
+ twitter: nullable(options.twitter),
3534
+ github: nullable(options.github),
3535
+ bluesky: nullable(options.bluesky),
3536
+ about: options.about,
3537
+ profileType: options.profileType,
3538
+ skills: options.skills?.split(",").map((s) => s.trim()),
3539
+ tags: options.tags?.split(",").map((t) => t.trim()),
3540
+ organizationId: nullable(options.organization),
3541
+ organizationName: options.organizationName
3542
+ });
3543
+ if (useJson) {
3544
+ outputContactJson(contact);
3545
+ } else {
3546
+ console.log("\n\u2713 Contact updated successfully");
3547
+ outputContactPretty(contact);
3548
+ }
3549
+ } catch (error) {
3550
+ handleError(error, useJson);
3551
+ }
3552
+ });
3553
+ contacts.command("delete").description("Delete a contact").argument("<id>", "Contact ID").action(async (id, _options, cmd) => {
3554
+ const globalOpts = cmd.optsWithGlobals();
3555
+ const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);
3556
+ try {
3557
+ const client = getClient();
3558
+ await client.contacts.delete(id);
3559
+ if (useJson) {
3560
+ console.log(JSON.stringify({ deleted: true, id }, null, 2));
3561
+ } else {
3562
+ console.log(`
3563
+ \u2713 Contact ${id} deleted`);
3564
+ }
3565
+ } catch (error) {
3566
+ handleError(error, useJson);
3567
+ }
3568
+ });
3569
+ contacts.command("add-interaction").description("Add an interaction to a contact").requiredOption("--contact <id>", "Contact ID").requiredOption("--type <type>", `Interaction type (${VALID_INTERACTION_TYPES.join(", ")})`).requiredOption("--direction <dir>", `Direction (${VALID_INTERACTION_DIRECTIONS.join(", ")})`).option("--subject <text>", "Subject line").option("--notes <text>", "Notes").action(async (options, cmd) => {
3570
+ const globalOpts = cmd.optsWithGlobals();
3571
+ const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);
3572
+ try {
3573
+ if (!VALID_INTERACTION_TYPES.includes(options.type)) {
3574
+ throw new Error(`Invalid interaction type "${options.type}". Valid: ${VALID_INTERACTION_TYPES.join(", ")}`);
3575
+ }
3576
+ if (!VALID_INTERACTION_DIRECTIONS.includes(options.direction)) {
3577
+ throw new Error(`Invalid direction "${options.direction}". Valid: ${VALID_INTERACTION_DIRECTIONS.join(", ")}`);
3578
+ }
3579
+ const client = getClient();
3580
+ const interaction = await client.contacts.addInteraction({
3581
+ contactId: options.contact,
3582
+ type: options.type,
3583
+ direction: options.direction,
3584
+ subject: options.subject,
3585
+ notes: options.notes
3586
+ });
3587
+ if (useJson) {
3588
+ outputInteractionJson(interaction);
3589
+ } else {
3590
+ console.log("\n\u2713 Interaction added");
3591
+ outputInteractionPretty(interaction);
3592
+ }
3593
+ } catch (error) {
3594
+ handleError(error, useJson);
3595
+ }
3596
+ });
3597
+ contacts.command("enrich").description("Queue a web-search enrichment job for an existing contact (runs regardless of the workspace auto-enrich setting)").argument("<id>", "Contact ID").action(async (id, _options, cmd) => {
3598
+ const globalOpts = cmd.optsWithGlobals();
3599
+ const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);
3600
+ try {
3601
+ const client = getClient();
3602
+ const result = await client.contacts.enrich(id);
3603
+ if (useJson) {
3604
+ console.log(JSON.stringify(result, null, 2));
3605
+ } else if (result.enqueued) {
3606
+ console.log(`
3607
+ \u2713 Enrichment queued for contact ${id} (job ${result.enrichmentId})`);
3608
+ } else if (result.reason === "already-in-flight") {
3609
+ console.log(`
3610
+ \u2022 Enrichment already in progress for contact ${id} (job ${result.enrichmentId})`);
3611
+ } else {
3612
+ console.log(`
3613
+ \u2022 Not queued for contact ${id}${result.reason ? ` (${result.reason})` : ""}`);
3614
+ }
3615
+ } catch (error) {
3616
+ handleError(error, useJson);
3617
+ }
3618
+ });
3619
+ return contacts;
3620
+ }
3621
+
3622
+ // src/commands/ceremonies.ts
3623
+ import { Command as Command4 } from "commander";
3624
+ import chalk4 from "chalk";
3625
+
3626
+ // src/utils/input.ts
3627
+ import { readFileSync } from "fs";
3628
+ var stdinConsumed = false;
3629
+ function readText(inline, file) {
3630
+ if (inline !== void 0) return inline;
3631
+ if (file === void 0) return void 0;
3632
+ if (file === "-") {
3633
+ if (stdinConsumed) {
3634
+ throw new Error('stdin ("-") can only back one option per invocation.');
3635
+ }
3636
+ stdinConsumed = true;
3637
+ return readFileSync(0, "utf-8");
3638
+ }
3639
+ return readFileSync(file, "utf-8");
3640
+ }
3641
+ function parseDate(value) {
3642
+ if (value === void 0 || value === "") return void 0;
3643
+ const date = /^\d{4}-\d{2}-\d{2}$/.test(value) ? /* @__PURE__ */ new Date(`${value}T00:00:00`) : new Date(value);
3644
+ if (Number.isNaN(date.getTime())) {
3645
+ throw new Error(
3646
+ `Invalid date: "${value}". Use ISO format, e.g. 2026-08-25 or 2026-08-25T14:00.`
3647
+ );
3648
+ }
3649
+ return date;
3650
+ }
3651
+
3652
+ // src/commands/ceremonies.ts
3653
+ var KINDS = [
3654
+ "STANDUP",
3655
+ "PLANNING",
3656
+ "REVIEW",
3657
+ "RETROSPECTIVE",
3658
+ "PRIORITISATION",
3659
+ "ALL_HANDS",
3660
+ "ONE_ON_ONE",
3661
+ "CUSTOM"
3662
+ ];
3663
+ var DAY_MS = 24 * 60 * 60 * 1e3;
3664
+ var CUID = /^c[a-z0-9]{24}$/;
3665
+ var OCCURRENCE_LIST_CAP = 200;
3666
+ function parseKind(value) {
3667
+ const upper = value.toUpperCase().replace(/-/g, "_");
3668
+ if (!KINDS.includes(upper)) {
3669
+ throw new Error(`Invalid kind "${value}". Use one of: ${KINDS.join(", ")}`);
3670
+ }
3671
+ return upper;
3672
+ }
3673
+ function parseIntInRange(value, flag, min, max) {
3674
+ if (value === void 0) return void 0;
3675
+ const n = Number(value);
3676
+ if (!Number.isInteger(n) || n < min || n > max) {
3677
+ throw new Error(`${flag} must be an integer from ${min} to ${max} (got "${value}").`);
3678
+ }
3679
+ return n;
3680
+ }
3681
+ var collect = (value, previous) => [...previous, value];
3682
+ var DATE_ONLY = /^\d{4}-\d{2}-\d{2}$/;
3683
+ function parseCalendarDate(value) {
3684
+ const parsed = parseDate(value);
3685
+ return value !== void 0 && DATE_ONLY.test(value) ? /* @__PURE__ */ new Date(`${value}T00:00:00.000Z`) : parsed;
3686
+ }
3687
+ function parseWindowEnd(value) {
3688
+ const parsed = parseDate(value);
3689
+ return value !== void 0 && DATE_ONLY.test(value) ? /* @__PURE__ */ new Date(`${value}T23:59:59.999`) : parsed;
3690
+ }
3691
+ function parseCeremonyRef(value) {
3692
+ const match = value.match(/\/w\/([^/?#]+)\/ceremonies\/([^/?#]+)(?:\/([^/?#]+))?/);
3693
+ if (!match) return { id: value };
3694
+ const [, workspaceSlug, ceremonyId, occurrenceId] = match;
3695
+ return {
3696
+ workspaceSlug,
3697
+ ceremonyId,
3698
+ occurrenceId,
3699
+ id: occurrenceId ?? ceremonyId
3700
+ };
3701
+ }
3702
+ function parseOccurrenceRef(value) {
3703
+ const ref = parseCeremonyRef(value);
3704
+ if (ref.ceremonyId && !ref.occurrenceId) {
3705
+ throw new Error(
3706
+ "That URL is a ceremony, not one of its occurrences. List them with `ceremonies occurrences list --ceremony <url>`."
3707
+ );
3708
+ }
3709
+ return ref;
3710
+ }
3711
+ async function resolveCeremonyId(client, workspaceId, ref) {
3712
+ if (CUID.test(ref)) return ref;
3713
+ const all = await client.ceremonies.list(workspaceId, { includeInactive: true });
3714
+ const hit = all.find((c) => c.slug === ref || c.id === ref);
3715
+ if (!hit) {
3716
+ throw new Error(
3717
+ `No ceremony "${ref}" in this workspace. Run \`exponential ceremonies list\` to see slugs and ids.`
3718
+ );
3719
+ }
3720
+ return hit.id;
3721
+ }
3722
+ async function workspaceFor(client, ref, flag) {
3723
+ return resolveWorkspaceId(client, ref.workspaceSlug ?? flag);
3724
+ }
3725
+ function readAgendaTemplate(file) {
3726
+ const raw = readText(void 0, file);
3727
+ if (raw === void 0) return void 0;
3728
+ const parsed = JSON.parse(raw);
3729
+ if (!Array.isArray(parsed)) {
3730
+ throw new Error("--agenda-file must hold a JSON array of { key, type, title, minutes?, config? } sections.");
3731
+ }
3732
+ return parsed;
3733
+ }
3734
+ function parseSuppliedAnswers(pairs, file) {
3735
+ const answers = {};
3736
+ const raw = readText(void 0, file);
3737
+ if (raw !== void 0) {
3738
+ const parsed = JSON.parse(raw);
3739
+ if (typeof parsed !== "object" || parsed === null || Array.isArray(parsed)) {
3740
+ throw new Error("--answers-file must hold a JSON object of { questionKey: markdown }.");
3741
+ }
3742
+ for (const [key, value] of Object.entries(parsed)) {
3743
+ if (typeof value !== "string") {
3744
+ throw new Error(`--answers-file: the answer for "${key}" must be a string.`);
3745
+ }
3746
+ answers[key] = value;
3747
+ }
3748
+ }
3749
+ for (const pair of pairs) {
3750
+ const eq = pair.indexOf("=");
3751
+ if (eq <= 0) throw new Error(`--answer takes key=markdown (got "${pair}").`);
3752
+ answers[pair.slice(0, eq)] = pair.slice(eq + 1);
3753
+ }
3754
+ return answers;
3755
+ }
3756
+ function addDefinitionOptions(cmd) {
3757
+ return cmd.option("--name <name>", "Display name (max 120 chars)").option("--slug <slug>", "Workspace-unique slug (derived from the name when omitted)").option("--kind <kind>", `One of: ${KINDS.join(", ")}`).option(
3758
+ "--cadence <rrule>",
3759
+ 'RRULE body, e.g. "FREQ=WEEKLY;BYDAY=MO;BYHOUR=10;BYMINUTE=0"'
3760
+ ).option("--timezone <iana>", "IANA zone the cadence runs in, e.g. Europe/Madrid").option("--starts-on <date>", "Anchor date the cadence expands from (YYYY-MM-DD)").option("--duration <minutes>", "Length in minutes (5-1440)").option("--lead-time <hours>", "Hours before the start to generate and circulate the agenda (0-336)").option("--owner <userId>", "Owner user id (defaults to you on create)").option("--participant <userId>", "Participant user id (repeatable; replaces the set on update)", collect, []).option("--project <projectId>", "Reviewed project id (repeatable; replaces the set on update)", collect, []).option("--alias <title>", "Meeting-title alias for auto-attach (repeatable; replaces the set on update)", collect, []).option("--product <productId>", "Scope to a product id").option("--purpose <markdown>", "Purpose (Markdown)").option("--purpose-file <path>", 'Purpose from a file ("-" = stdin)').option("--not-for <markdown>", "What this ceremony is NOT for (Markdown)").option("--inputs <markdown>", "Required inputs (Markdown)").option("--outputs <markdown>", "Expected outputs (Markdown)").option("--agenda-file <path>", 'Agenda template: JSON array of { key, type, title, minutes? } ("-" = stdin)').option("--include-projects", "Append the linked-projects section to agendas").option("--no-include-projects", "Do not append the linked-projects section to agendas").option("--meeting-url <url>", 'Video room the ceremony meets in; recordings from it file themselves here ("" clears it)').option("--auto-extract-outputs", "Extract outputs from every recording attached to an occurrence").option("--no-auto-extract-outputs", "Stop extracting outputs automatically");
3761
+ }
3762
+ function definitionFields(options, cmd) {
3763
+ const fields = {};
3764
+ if (options.name !== void 0) fields.name = options.name;
3765
+ if (options.slug !== void 0) fields.slug = options.slug;
3766
+ if (options.kind !== void 0) fields.kind = parseKind(options.kind);
3767
+ if (options.cadence !== void 0) fields.cadenceRule = options.cadence;
3768
+ if (options.timezone !== void 0) fields.timezone = options.timezone;
3769
+ if (options.startsOn !== void 0) fields.startsOn = parseCalendarDate(options.startsOn);
3770
+ const duration = parseIntInRange(options.duration, "--duration", 5, 24 * 60);
3771
+ if (duration !== void 0) fields.durationMinutes = duration;
3772
+ const leadTime = parseIntInRange(options.leadTime, "--lead-time", 0, 24 * 14);
3773
+ if (leadTime !== void 0) fields.leadTimeHours = leadTime;
3774
+ if (options.owner !== void 0) fields.ownerId = options.owner;
3775
+ if (options.participant.length > 0) fields.participantUserIds = options.participant;
3776
+ if (options.project.length > 0) fields.projectIds = options.project;
3777
+ if (options.alias.length > 0) fields.aliases = options.alias;
3778
+ if (options.product !== void 0) fields.productId = options.product;
3779
+ const purpose = readText(options.purpose, options.purposeFile);
3780
+ if (purpose !== void 0) fields.purpose = purpose;
3781
+ if (options.notFor !== void 0) fields.notFor = options.notFor;
3782
+ if (options.inputs !== void 0) fields.inputs = options.inputs;
3783
+ if (options.outputs !== void 0) fields.outputs = options.outputs;
3784
+ const agenda = readAgendaTemplate(options.agendaFile);
3785
+ if (agenda !== void 0) fields.agendaTemplate = agenda;
3786
+ if (cmd.getOptionValueSource("includeProjects") === "cli") {
3787
+ fields.includeProjects = options.includeProjects;
3788
+ }
3789
+ if (options.meetingUrl !== void 0) fields.meetingUrl = options.meetingUrl;
3790
+ if (cmd.getOptionValueSource("autoExtractOutputs") === "cli") {
3791
+ fields.autoExtractOutputs = options.autoExtractOutputs;
3792
+ }
3793
+ return fields;
3794
+ }
3795
+ function parseDateTime(value, flag) {
3796
+ if (/^\d{4}-\d{2}-\d{2}$/.test(value)) {
3797
+ throw new Error(`${flag} needs a time too, e.g. 2026-11-04T10:00 (local) or 2026-11-04T09:00Z.`);
3798
+ }
3799
+ const date = parseDate(value);
3800
+ if (!date) throw new Error(`${flag} is required.`);
3801
+ return date;
3802
+ }
3803
+ function createOccurrencesCommand() {
3804
+ const occurrences = new Command4("occurrences").alias("occurrence").description(
3805
+ [
3806
+ "Scheduled instances of a ceremony \u2014 the page at /w/<slug>/ceremonies/<ceremonyId>/<occurrenceId>.",
3807
+ "Every <occurrence> argument takes the occurrence CUID or that full URL (the URL brings its own workspace)."
3808
+ ].join("\n")
3809
+ );
3810
+ occurrences.command("list").description(
3811
+ [
3812
+ "Occurrences starting in a window, oldest first (max 200). Default window: 14 days either side of now.",
3813
+ "--project <id> instead shows that project's Meetings timeline: newest first, one-offs included,",
3814
+ "two weeks back to one week ahead by default, at most --per-ceremony rows per recurring ceremony, and leaving",
3815
+ "out occurrences a recording on that project already captured."
3816
+ ].join(" ")
3817
+ ).option("--workspace <slug|id>", "Workspace (defaults to your default workspace)").option("--ceremony <slug|id>", "Only this ceremony").option("--project <id>", "A project's Meetings timeline (no workspace needed)").option("--per-ceremony <n>", "With --project: rows per recurring ceremony (1-20, default 5)").option("--from <date>", "Window start (YYYY-MM-DD or ISO)").option("--to <date>", "Window end (YYYY-MM-DD or ISO)").action(
3818
+ async (options, cmd) => {
3819
+ const globalOpts = cmd.optsWithGlobals();
3820
+ const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);
3821
+ try {
3822
+ const client = getClient();
3823
+ if (options.project) {
3824
+ if (options.ceremony) throw new Error("Pass --project or --ceremony, not both.");
3825
+ const rows2 = await client.ceremonies.listOccurrencesForProject({
3826
+ projectId: options.project,
3827
+ from: parseDate(options.from),
3828
+ to: parseWindowEnd(options.to),
3829
+ perCeremony: parseIntInRange(options.perCeremony, "--per-ceremony", 1, 20)
3830
+ });
3831
+ if (useJson) {
3832
+ console.log(
3833
+ JSON.stringify(
3834
+ {
3835
+ occurrences: rows2.map((row) => ({ id: row.occurrenceId, ...row })),
3836
+ total: rows2.length,
3837
+ projectId: options.project
3838
+ },
3839
+ null,
3840
+ 2
3841
+ )
3842
+ );
3843
+ } else {
3844
+ outputProjectOccurrencesPretty(rows2);
3845
+ }
3846
+ return;
3847
+ }
3848
+ const ref = options.ceremony ? parseCeremonyRef(options.ceremony) : void 0;
3849
+ const workspaceId = await workspaceFor(client, ref ?? {}, options.workspace);
3850
+ const now = Date.now();
3851
+ const from = parseDate(options.from) ?? new Date(now - 14 * DAY_MS);
3852
+ const to = parseWindowEnd(options.to) ?? new Date(now + 14 * DAY_MS);
3853
+ const ceremonyId = ref ? await resolveCeremonyId(client, workspaceId, ref.ceremonyId ?? ref.id) : void 0;
3854
+ const rows = await client.ceremonies.listOccurrences({ workspaceId, from, to, ceremonyId });
3855
+ if (useJson) {
3856
+ outputOccurrencesJson(rows, {
3857
+ workspaceId,
3858
+ from,
3859
+ to,
3860
+ ceremonyId: ceremonyId ?? null,
3861
+ // The server returns at most 200, oldest first, so a full page has lost the newest rows.
3862
+ truncated: rows.length >= OCCURRENCE_LIST_CAP
3863
+ });
3864
+ } else outputOccurrencesPretty(rows);
3865
+ } catch (error) {
3866
+ handleError(error, useJson);
3867
+ }
3868
+ }
3869
+ );
3870
+ occurrences.command("get <occurrence>").description(
3871
+ "One occurrence: status, agenda, recordings, notes page. --notes and --decisions pull in the rest of the meeting page."
3872
+ ).option("--workspace <slug|id>", "Workspace (not needed when you pass the URL)").option("--notes", "Include the occurrence's notes page body").option("--decisions", "Include decisions and open questions logged against this occurrence").option("--updates", "Include participants' async updates (standups)").action(
3873
+ async (value, options, cmd) => {
3874
+ const globalOpts = cmd.optsWithGlobals();
3875
+ const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);
3876
+ try {
3877
+ const client = getClient();
3878
+ const ref = parseOccurrenceRef(value);
3879
+ const workspaceId = await workspaceFor(client, ref, options.workspace);
3880
+ const occurrence = await client.ceremonies.getOccurrence(workspaceId, ref.id);
3881
+ const extrasErrors = {};
3882
+ const attempt = async (key, load) => {
3883
+ try {
3884
+ return await load();
3885
+ } catch (error) {
3886
+ extrasErrors[key] = error instanceof Error ? error.message : String(error);
3887
+ return null;
3888
+ }
3889
+ };
3890
+ const [notes, decisions, updates] = await Promise.all([
3891
+ options.notes ? attempt(
3892
+ "notes",
3893
+ async () => occurrence.notesPageId ? client.pages.get(occurrence.notesPageId) : null
3894
+ ) : void 0,
3895
+ // `decision.list` has no occurrence filter server-side, so this reads
3896
+ // the workspace's confirmed log and filters it here.
3897
+ options.decisions ? attempt(
3898
+ "decisions",
3899
+ async () => (await client.decisions.list({ workspaceId })).filter(
3900
+ (d) => d.occurrenceId === occurrence.id
3901
+ )
3902
+ ) : void 0,
3903
+ options.updates ? attempt("updates", () => client.ceremonies.updateSummary(workspaceId, occurrence.id)) : void 0
3904
+ ]);
3905
+ const extras = {
3906
+ ...options.notes ? { notes: notes ?? null } : {},
3907
+ ...options.decisions ? { decisions: decisions ?? null } : {},
3908
+ ...options.updates ? { updates: updates ?? null } : {},
3909
+ ...Object.keys(extrasErrors).length > 0 ? { extrasErrors } : {}
3910
+ };
3911
+ if (useJson) outputOccurrenceJson(occurrence, extras);
3912
+ else outputOccurrencePretty(occurrence, extras);
3913
+ } catch (error) {
3914
+ handleError(error, useJson);
3915
+ }
3916
+ }
3917
+ );
3918
+ occurrences.command("updates <occurrence>").description("Every participant's async update for an occurrence, and who hasn't answered").option("--workspace <slug|id>", "Workspace (not needed when you pass the URL)").action(async (value, options, cmd) => {
3919
+ const globalOpts = cmd.optsWithGlobals();
3920
+ const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);
3921
+ try {
3922
+ const client = getClient();
3923
+ const ref = parseOccurrenceRef(value);
3924
+ const workspaceId = await workspaceFor(client, ref, options.workspace);
3925
+ const summary = await client.ceremonies.updateSummary(workspaceId, ref.id);
3926
+ if (useJson) console.log(JSON.stringify(summary, null, 2));
3927
+ else outputOccurrenceUpdatesPretty(summary);
3928
+ } catch (error) {
3929
+ handleError(error, useJson);
3930
+ }
3931
+ });
3932
+ occurrences.command("my-update <occurrence>").description(
3933
+ [
3934
+ "Read, draft or write your own async update (standups ask: done, today, blockers).",
3935
+ "No flags: show it. --draft: fill a draft from your activity since the last occurrence.",
3936
+ "--answer key=markdown (repeatable) saves answers; --submit / --reopen changes its state."
3937
+ ].join(" ")
3938
+ ).option("--workspace <slug|id>", "Workspace (not needed when you pass the URL)").option("--draft", "Draft answers from your activity (leaves anything you wrote alone)").option("--answer <key=markdown>", "An answer by question key (repeatable)", collect, []).option("--answers-file <path>", 'Answers as a JSON object { key: markdown } ("-" = stdin)').option("--blocker", "Flag that something is blocking you").option("--no-blocker", "Clear the blocker flag").option("--submit", "Submit the update (refused if every answer is empty; see --allow-empty)").option("--allow-empty", "With --submit: submit even though every answer is empty").option("--reopen", "Reopen a submitted update").action(
3939
+ async (value, options, cmd) => {
3940
+ const globalOpts = cmd.optsWithGlobals();
3941
+ const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);
3942
+ try {
3943
+ if (options.submit && options.reopen) {
3944
+ throw new Error("Pass --submit or --reopen, not both.");
3945
+ }
3946
+ if (options.draft && (options.submit || options.reopen)) {
3947
+ throw new Error("Run --draft on its own, review it, then --submit. To re-draft a submitted update, --reopen first.");
3948
+ }
3949
+ const supplied = parseSuppliedAnswers(options.answer, options.answersFile);
3950
+ const client = getClient();
3951
+ const ref = parseOccurrenceRef(value);
3952
+ const workspaceId = await workspaceFor(client, ref, options.workspace);
3953
+ const blockerSet = cmd.getOptionValueSource("blocker") === "cli";
3954
+ const writing = Object.keys(supplied).length > 0 || blockerSet || options.submit || options.reopen;
3955
+ const current = await client.ceremonies.myUpdate(workspaceId, ref.id);
3956
+ const known = current.questions.map((q) => q.key);
3957
+ const unknown = Object.keys(supplied).filter((key) => !known.includes(key));
3958
+ if (unknown.length > 0) {
3959
+ throw new Error(
3960
+ `Unknown answer key${unknown.length === 1 ? "" : "s"}: ${unknown.join(", ")}. ` + (known.length > 0 ? `This ceremony asks: ${known.join(", ")}.` : "This ceremony kind has no async updates.")
3961
+ );
3962
+ }
3963
+ let update = options.draft ? await client.ceremonies.draftMyUpdate(workspaceId, ref.id) : current;
3964
+ if (writing) {
3965
+ const answers = { ...update.answers, ...supplied };
3966
+ if (options.submit && !options.allowEmpty && !Object.values(answers).some((answer) => answer.trim() !== "")) {
3967
+ throw new Error(
3968
+ `Nothing to submit: every answer is empty. Pass --answer <key=markdown> (${known.join(", ")}), or --allow-empty.`
3969
+ );
3970
+ }
3971
+ update = await client.ceremonies.saveMyUpdate({
3972
+ workspaceId,
3973
+ occurrenceId: ref.id,
3974
+ answers,
3975
+ ...blockerSet ? { flaggedBlocker: options.blocker } : {},
3976
+ ...options.submit ? { submit: true } : options.reopen ? { submit: false } : {}
3977
+ });
3978
+ }
3979
+ if (useJson) console.log(JSON.stringify(update, null, 2));
3980
+ else outputMyOccurrenceUpdatePretty(update);
3981
+ } catch (error) {
3982
+ handleError(error, useJson);
3983
+ }
3984
+ }
3985
+ );
3986
+ occurrences.command("generate-agenda <occurrence>").description("Generate or regenerate the agenda (ceremony owner, or workspace owner/admin)").option("--workspace <slug|id>", "Workspace (not needed when you pass the URL)").option(
3987
+ "--circulate",
3988
+ "Also notify participants and post to the ceremony's Matrix room. Re-sends both if already sent, so don't retry blindly"
3989
+ ).action(
3990
+ async (value, options, cmd) => {
3991
+ const globalOpts = cmd.optsWithGlobals();
3992
+ const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);
3993
+ try {
3994
+ const client = getClient();
3995
+ const ref = parseOccurrenceRef(value);
3996
+ const workspaceId = await workspaceFor(client, ref, options.workspace);
3997
+ const result = await client.ceremonies.generateAgenda(workspaceId, ref.id, {
3998
+ circulate: options.circulate
3999
+ });
4000
+ if (useJson) {
4001
+ console.log(JSON.stringify(result, null, 2));
4002
+ } else {
4003
+ console.log(
4004
+ `\u2713 Agenda generated: ${result.itemCount} item${result.itemCount === 1 ? "" : "s"}${result.circulated ? ", circulated" : ""}`
4005
+ );
4006
+ if (options.circulate && !result.circulated) {
4007
+ console.log(chalk4.yellow(" Not circulated: this occurrence is skipped."));
4008
+ }
4009
+ outputAgendaPretty(result.agenda);
4010
+ }
4011
+ } catch (error) {
4012
+ handleError(error, useJson);
4013
+ }
4014
+ }
4015
+ );
4016
+ occurrences.command("add").description("Add an occurrence off the cadence \u2014 a meeting that happened, or will, at another time (ceremony owner, or workspace owner/admin)").requiredOption("--ceremony <slug|id|url>", "The ceremony").requiredOption("--at <datetime>", "Start, e.g. 2026-11-04T10:00 (local) or 2026-11-04T09:00Z").option("--workspace <slug|id>", "Workspace (not needed when you pass the URL)").action(
4017
+ async (options, cmd) => {
4018
+ const globalOpts = cmd.optsWithGlobals();
4019
+ const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);
4020
+ try {
4021
+ const at = parseDateTime(options.at, "--at");
4022
+ const client = getClient();
4023
+ const ref = parseCeremonyRef(options.ceremony);
4024
+ const workspaceId = await workspaceFor(client, ref, options.workspace);
4025
+ const ceremonyId = await resolveCeremonyId(client, workspaceId, ref.ceremonyId ?? ref.id);
4026
+ const result = await client.ceremonies.addOccurrence(workspaceId, ceremonyId, at);
4027
+ if (useJson) console.log(JSON.stringify(result, null, 2));
4028
+ else console.log(`\u2713 Occurrence ${result.id} added for ${new Date(result.scheduledStart).toLocaleString()}`);
4029
+ } catch (error) {
4030
+ handleError(error, useJson);
4031
+ }
4032
+ }
4033
+ );
4034
+ occurrences.command("move <occurrence>").description("Move an occurrence that has not happened to another time; it keeps its agenda, notes and updates (ceremony owner, or workspace owner/admin)").requiredOption("--to <datetime>", "New start, e.g. 2026-11-04T10:00 (local) or 2026-11-04T09:00Z").option("--workspace <slug|id>", "Workspace (not needed when you pass the URL)").action(async (value, options, cmd) => {
4035
+ const globalOpts = cmd.optsWithGlobals();
4036
+ const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);
4037
+ try {
4038
+ const to = parseDateTime(options.to, "--to");
4039
+ const client = getClient();
4040
+ const ref = parseOccurrenceRef(value);
4041
+ const workspaceId = await workspaceFor(client, ref, options.workspace);
4042
+ const result = await client.ceremonies.rescheduleOccurrence(workspaceId, ref.id, to);
4043
+ if (useJson) console.log(JSON.stringify(result, null, 2));
4044
+ else if (!result.movedFrom) console.log(`Occurrence ${result.id} is already at that time.`);
4045
+ else {
4046
+ console.log(
4047
+ `\u2713 Occurrence ${result.id} moved from ${new Date(result.movedFrom).toLocaleString()} to ${new Date(result.scheduledStart).toLocaleString()}`
4048
+ );
4049
+ }
4050
+ } catch (error) {
4051
+ handleError(error, useJson);
4052
+ }
4053
+ });
4054
+ occurrences.command("skip <occurrence>").description(
4055
+ [
4056
+ "Skip an occurrence with a reason; participants are notified (ceremony owner, or workspace owner/admin).",
4057
+ "On a booked one-off this CANCELS the meeting: every attendee with an address, external ones included,",
4058
+ "gets a calendar cancellation, the ceremony is retired, and it cannot be unskipped."
4059
+ ].join(" ")
4060
+ ).requiredOption("--reason <text>", "Why it is skipped (1-500 chars)").option("--workspace <slug|id>", "Workspace (not needed when you pass the URL)").action(async (value, options, cmd) => {
4061
+ const globalOpts = cmd.optsWithGlobals();
4062
+ const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);
4063
+ try {
4064
+ const client = getClient();
4065
+ const ref = parseOccurrenceRef(value);
4066
+ const workspaceId = await workspaceFor(client, ref, options.workspace);
4067
+ const result = await client.ceremonies.skipOccurrence(workspaceId, ref.id, options.reason);
4068
+ if (useJson) console.log(JSON.stringify(result, null, 2));
4069
+ else console.log(`\u2713 Occurrence ${result.id} skipped`);
4070
+ } catch (error) {
4071
+ handleError(error, useJson);
4072
+ }
4073
+ });
4074
+ occurrences.command("unskip <occurrence>").description("Undo a skip (ceremony owner, or workspace owner/admin). A cancelled one-off cannot be unskipped.").option("--workspace <slug|id>", "Workspace (not needed when you pass the URL)").action(async (value, options, cmd) => {
4075
+ const globalOpts = cmd.optsWithGlobals();
4076
+ const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);
4077
+ try {
4078
+ const client = getClient();
4079
+ const ref = parseOccurrenceRef(value);
4080
+ const workspaceId = await workspaceFor(client, ref, options.workspace);
4081
+ const result = await client.ceremonies.unskipOccurrence(workspaceId, ref.id);
4082
+ if (useJson) console.log(JSON.stringify(result, null, 2));
4083
+ else console.log(`\u2713 Occurrence ${result.id} is back to ${result.status}`);
4084
+ } catch (error) {
4085
+ handleError(error, useJson);
4086
+ }
4087
+ });
4088
+ const agenda = new Command4("agenda").description("Edit an occurrence's agenda by hand");
4089
+ agenda.command("add <occurrence>").description("Add an item to an agenda section; kept across regeneration").requiredOption("--section <key>", "The section key (see `occurrences get`)").requiredOption("--title <text>", "Item title (max 300 chars)").option("--detail <text>", "One line of detail (max 500 chars)").option("--workspace <slug|id>", "Workspace (not needed when you pass the URL)").action(
4090
+ async (value, options, cmd) => {
4091
+ const globalOpts = cmd.optsWithGlobals();
4092
+ const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);
4093
+ try {
4094
+ const client = getClient();
4095
+ const ref = parseOccurrenceRef(value);
4096
+ const workspaceId = await workspaceFor(client, ref, options.workspace);
4097
+ const result = await client.ceremonies.addAgendaItem({
4098
+ workspaceId,
4099
+ occurrenceId: ref.id,
4100
+ sectionKey: options.section,
4101
+ title: options.title,
4102
+ detail: options.detail
4103
+ });
4104
+ if (useJson) console.log(JSON.stringify(result, null, 2));
4105
+ else {
4106
+ console.log("\u2713 Agenda item added");
4107
+ outputAgendaPretty(result.agenda);
4108
+ }
4109
+ } catch (error) {
4110
+ handleError(error, useJson);
4111
+ }
4112
+ }
4113
+ );
4114
+ agenda.command("resolve <occurrence> <itemId>").description("Mark an agenda item resolved (--reopen to undo)").option("--reopen", "Mark it unresolved again").option("--workspace <slug|id>", "Workspace (not needed when you pass the URL)").action(
4115
+ async (value, itemId, options, cmd) => {
4116
+ const globalOpts = cmd.optsWithGlobals();
4117
+ const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);
4118
+ try {
4119
+ const client = getClient();
4120
+ const ref = parseOccurrenceRef(value);
4121
+ const workspaceId = await workspaceFor(client, ref, options.workspace);
4122
+ const result = await client.ceremonies.resolveAgendaItem(
4123
+ workspaceId,
4124
+ ref.id,
4125
+ itemId,
4126
+ !options.reopen
4127
+ );
4128
+ if (useJson) console.log(JSON.stringify(result, null, 2));
4129
+ else console.log(options.reopen ? "\u2713 Agenda item reopened" : "\u2713 Agenda item resolved");
4130
+ } catch (error) {
4131
+ handleError(error, useJson);
4132
+ }
4133
+ }
4134
+ );
4135
+ occurrences.addCommand(agenda);
4136
+ occurrences.command("attach <occurrence>").description("Link a recorded meeting to the occurrence it captured (same workspace; you must be able to edit the meeting)").requiredOption("--meeting <id>", "Recorded meeting (transcription session) id").action(async (value, options, cmd) => {
4137
+ const globalOpts = cmd.optsWithGlobals();
4138
+ const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);
4139
+ try {
4140
+ const client = getClient();
4141
+ const ref = parseOccurrenceRef(value);
4142
+ const result = await client.ceremonies.attachMeeting(options.meeting, ref.id);
4143
+ if (useJson) console.log(JSON.stringify(result, null, 2));
4144
+ else console.log(`\u2713 Meeting ${result.meetingId} attached to occurrence ${result.occurrenceId}`);
4145
+ } catch (error) {
4146
+ handleError(error, useJson);
4147
+ }
4148
+ });
4149
+ occurrences.command("detach <meetingId>").description("Unlink a recorded meeting from its occurrence").action(async (meetingId, _options, cmd) => {
3228
4150
  const globalOpts = cmd.optsWithGlobals();
3229
4151
  const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);
3230
- const nullable = (v) => v === "null" ? null : v;
3231
4152
  try {
3232
4153
  const client = getClient();
3233
- const contact = await client.contacts.update({
3234
- id: options.id,
3235
- firstName: options.firstName,
3236
- lastName: options.lastName,
3237
- email: nullable(options.email),
3238
- phone: nullable(options.phone),
3239
- linkedIn: nullable(options.linkedin),
3240
- telegram: nullable(options.telegram),
3241
- twitter: nullable(options.twitter),
3242
- github: nullable(options.github),
3243
- bluesky: nullable(options.bluesky),
3244
- about: options.about,
3245
- profileType: options.profileType,
3246
- skills: options.skills?.split(",").map((s) => s.trim()),
3247
- tags: options.tags?.split(",").map((t) => t.trim()),
3248
- organizationId: nullable(options.organization),
3249
- organizationName: options.organizationName
4154
+ const result = await client.ceremonies.detachMeeting(meetingId);
4155
+ if (useJson) console.log(JSON.stringify(result, null, 2));
4156
+ else console.log(`\u2713 Meeting ${result.meetingId} detached`);
4157
+ } catch (error) {
4158
+ handleError(error, useJson);
4159
+ }
4160
+ });
4161
+ return occurrences;
4162
+ }
4163
+ function createCeremoniesCommand() {
4164
+ const ceremonies = new Command4("ceremonies").description(
4165
+ [
4166
+ "Recurring meeting definitions (Settings \u2192 Ceremonies) and their scheduled occurrences.",
4167
+ "",
4168
+ "A ceremony has a cadence (RRULE in a time zone), an owner, participants and an agenda template.",
4169
+ "Each scheduled instance is an occurrence \u2014 see `ceremonies occurrences --help`.",
4170
+ "Decisions logged in an occurrence live under `exponential decisions` (--occurrence).",
4171
+ "",
4172
+ "Some writes reach people or delete data. Read `<command> --help` first: update, occurrences skip,",
4173
+ "occurrences generate-agenda --circulate, import and backfill."
4174
+ ].join("\n")
4175
+ );
4176
+ ceremonies.command("list").description("Ceremonies in a workspace, active first").option("--workspace <slug|id>", "Workspace (defaults to your default workspace)").option("--include-inactive", "Also list retired ceremonies").action(async (options, cmd) => {
4177
+ const globalOpts = cmd.optsWithGlobals();
4178
+ const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);
4179
+ try {
4180
+ const client = getClient();
4181
+ const workspaceId = await resolveWorkspaceId(client, options.workspace);
4182
+ const rows = await client.ceremonies.list(workspaceId, {
4183
+ includeInactive: options.includeInactive
3250
4184
  });
3251
- if (useJson) {
3252
- outputContactJson(contact);
3253
- } else {
3254
- console.log("\n\u2713 Contact updated successfully");
3255
- outputContactPretty(contact);
3256
- }
4185
+ if (useJson) outputCeremoniesJson(rows, { workspaceId });
4186
+ else outputCeremoniesPretty(rows);
3257
4187
  } catch (error) {
3258
4188
  handleError(error, useJson);
3259
4189
  }
3260
4190
  });
3261
- contacts.command("delete").description("Delete a contact").argument("<id>", "Contact ID").action(async (id, _options, cmd) => {
4191
+ ceremonies.command("get <ceremony>").description("One ceremony with participants, projects and its recent + upcoming occurrences. Takes an id, slug or URL.").option("--workspace <slug|id>", "Workspace (not needed when you pass the URL)").action(async (value, options, cmd) => {
3262
4192
  const globalOpts = cmd.optsWithGlobals();
3263
4193
  const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);
3264
4194
  try {
3265
4195
  const client = getClient();
3266
- await client.contacts.delete(id);
3267
- if (useJson) {
3268
- console.log(JSON.stringify({ deleted: true, id }, null, 2));
3269
- } else {
3270
- console.log(`
3271
- \u2713 Contact ${id} deleted`);
3272
- }
4196
+ const ref = parseCeremonyRef(value);
4197
+ const workspaceId = await workspaceFor(client, ref, options.workspace);
4198
+ const id = await resolveCeremonyId(client, workspaceId, ref.ceremonyId ?? ref.id);
4199
+ const ceremony = await client.ceremonies.get(workspaceId, id);
4200
+ if (useJson) outputCeremonyJson(ceremony);
4201
+ else outputCeremonyPretty(ceremony);
3273
4202
  } catch (error) {
3274
4203
  handleError(error, useJson);
3275
4204
  }
3276
4205
  });
3277
- contacts.command("add-interaction").description("Add an interaction to a contact").requiredOption("--contact <id>", "Contact ID").requiredOption("--type <type>", `Interaction type (${VALID_INTERACTION_TYPES.join(", ")})`).requiredOption("--direction <dir>", `Direction (${VALID_INTERACTION_DIRECTIONS.join(", ")})`).option("--subject <text>", "Subject line").option("--notes <text>", "Notes").action(async (options, cmd) => {
4206
+ ceremonies.command("templates").description('Built-in ceremony templates, one per kind (the "Add from template" list)').action(async (_options, cmd) => {
3278
4207
  const globalOpts = cmd.optsWithGlobals();
3279
4208
  const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);
3280
4209
  try {
3281
- if (!VALID_INTERACTION_TYPES.includes(options.type)) {
3282
- throw new Error(`Invalid interaction type "${options.type}". Valid: ${VALID_INTERACTION_TYPES.join(", ")}`);
4210
+ const templates = await getClient().ceremonies.templates();
4211
+ if (useJson) console.log(JSON.stringify({ templates, total: templates.length }, null, 2));
4212
+ else outputCeremonyTemplatesPretty(templates);
4213
+ } catch (error) {
4214
+ handleError(error, useJson);
4215
+ }
4216
+ });
4217
+ const create = addDefinitionOptions(
4218
+ ceremonies.command("create").description(
4219
+ "Create a ceremony and schedule its first occurrences. Needs --name, --cadence, --timezone and --starts-on."
4220
+ ).option("--workspace <slug|id>", "Workspace (defaults to your default workspace)").option("--template <slug>", "Start from a built-in template (see `ceremonies templates`); flags override it")
4221
+ );
4222
+ create.action(
4223
+ async (options, cmd) => {
4224
+ const globalOpts = cmd.optsWithGlobals();
4225
+ const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);
4226
+ try {
4227
+ const client = getClient();
4228
+ const workspaceId = await resolveWorkspaceId(client, options.workspace);
4229
+ let base = {};
4230
+ if (options.template) {
4231
+ const templates = await client.ceremonies.templates();
4232
+ const t = templates.find((x) => x.slug === options.template);
4233
+ if (!t) {
4234
+ throw new Error(
4235
+ `No template "${options.template}". One of: ${templates.map((x) => x.slug).join(", ")}`
4236
+ );
4237
+ }
4238
+ const { slug: _slug, ...fields } = t;
4239
+ base = fields;
4240
+ }
4241
+ const input = { ...base, ...definitionFields(options, cmd), workspaceId };
4242
+ const missing = ["name", "cadenceRule", "timezone", "startsOn"].filter(
4243
+ (k) => input[k] === void 0
4244
+ );
4245
+ if (missing.length > 0) {
4246
+ const flags = {
4247
+ name: "--name",
4248
+ cadenceRule: "--cadence",
4249
+ timezone: "--timezone",
4250
+ startsOn: "--starts-on"
4251
+ };
4252
+ throw new Error(`Missing ${missing.map((k) => flags[k]).join(", ")}.`);
4253
+ }
4254
+ const result = await client.ceremonies.create(input);
4255
+ if (useJson) console.log(JSON.stringify(result, null, 2));
4256
+ else outputCeremonyWritePretty(result, "created");
4257
+ } catch (error) {
4258
+ handleError(error, useJson);
3283
4259
  }
3284
- if (!VALID_INTERACTION_DIRECTIONS.includes(options.direction)) {
3285
- throw new Error(`Invalid direction "${options.direction}". Valid: ${VALID_INTERACTION_DIRECTIONS.join(", ")}`);
4260
+ }
4261
+ );
4262
+ const update = addDefinitionOptions(
4263
+ ceremonies.command("update <ceremony>").description(
4264
+ [
4265
+ "Edit a ceremony (id, slug or URL). Only the flags you pass change.",
4266
+ "Changing --cadence, --timezone, --starts-on or --duration DELETES future PLANNED occurrences that have no",
4267
+ "booking or recording, along with any agenda, notes link and async updates on them, and recreates them with",
4268
+ "new ids. Occurrences moved or added by hand stay."
4269
+ ].join(" ")
4270
+ ).option("--workspace <slug|id>", "Workspace (not needed when you pass the URL)").option("--active", "Re-activate a retired ceremony").option("--inactive", "Retire the ceremony (stops scheduling)")
4271
+ );
4272
+ update.action(
4273
+ async (value, options, cmd) => {
4274
+ const globalOpts = cmd.optsWithGlobals();
4275
+ const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);
4276
+ try {
4277
+ if (options.active && options.inactive) throw new Error("Pass --active or --inactive, not both.");
4278
+ const client = getClient();
4279
+ const ref = parseCeremonyRef(value);
4280
+ const workspaceId = await workspaceFor(client, ref, options.workspace);
4281
+ const id = await resolveCeremonyId(client, workspaceId, ref.ceremonyId ?? ref.id);
4282
+ const input = {
4283
+ ...definitionFields(options, cmd),
4284
+ workspaceId,
4285
+ id,
4286
+ ...options.active ? { isActive: true } : options.inactive ? { isActive: false } : {}
4287
+ };
4288
+ if (Object.keys(input).length === 2) {
4289
+ throw new Error("Nothing to update \u2014 pass at least one field flag.");
4290
+ }
4291
+ const result = await client.ceremonies.update(input);
4292
+ if (useJson) console.log(JSON.stringify(result, null, 2));
4293
+ else outputCeremonyWritePretty(result, "updated");
4294
+ } catch (error) {
4295
+ handleError(error, useJson);
4296
+ }
4297
+ }
4298
+ );
4299
+ ceremonies.command("import <file>").description(
4300
+ [
4301
+ 'Upsert ceremonies from a JSON array keyed by slug ("-" = stdin). Workspace owner/admin only.',
4302
+ "People go by name or email: participantNames REPLACES the whole set, and a name that matches nobody is dropped",
4303
+ "and reported as unresolved. Not atomic: a failure partway leaves the earlier definitions written."
4304
+ ].join(" ")
4305
+ ).option("--workspace <slug|id>", "Workspace (defaults to your default workspace)").option("--timezone <iana>", "Default zone for definitions without one").option("--starts-on <date>", "Default anchor date for definitions without one").action(
4306
+ async (file, options, cmd) => {
4307
+ const globalOpts = cmd.optsWithGlobals();
4308
+ const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);
4309
+ try {
4310
+ const raw = readText(void 0, file);
4311
+ const parsed = JSON.parse(raw ?? "");
4312
+ if (!Array.isArray(parsed)) throw new Error("The import file must hold a JSON array of definitions.");
4313
+ const client = getClient();
4314
+ const workspaceId = await resolveWorkspaceId(client, options.workspace);
4315
+ const results = await client.ceremonies.importDefinitions({
4316
+ workspaceId,
4317
+ definitions: parsed,
4318
+ timezone: options.timezone,
4319
+ startsOn: parseCalendarDate(options.startsOn)
4320
+ });
4321
+ if (useJson) {
4322
+ console.log(JSON.stringify({ results, total: results.length }, null, 2));
4323
+ } else {
4324
+ for (const r of results) {
4325
+ console.log(
4326
+ `\u2713 ${r.slug} ${r.action} (${r.occurrencesCreated} occurrence${r.occurrencesCreated === 1 ? "" : "s"} scheduled)`
4327
+ );
4328
+ if (r.unresolved.length > 0) {
4329
+ console.log(chalk4.yellow(` Unresolved people: ${r.unresolved.join(", ")}`));
4330
+ }
4331
+ }
4332
+ }
4333
+ } catch (error) {
4334
+ handleError(error, useJson);
3286
4335
  }
4336
+ }
4337
+ );
4338
+ ceremonies.command("backfill").description(
4339
+ "Attach unattached recorded meetings to occurrences by alias. Dry run unless --apply, but even a dry run schedules any missing occurrences of active ceremonies. Workspace owner/admin only."
4340
+ ).option("--workspace <slug|id>", "Workspace (defaults to your default workspace)").option("--apply", "Write the attachments (default is a dry-run report)").action(async (options, cmd) => {
4341
+ const globalOpts = cmd.optsWithGlobals();
4342
+ const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);
4343
+ try {
3287
4344
  const client = getClient();
3288
- const interaction = await client.contacts.addInteraction({
3289
- contactId: options.contact,
3290
- type: options.type,
3291
- direction: options.direction,
3292
- subject: options.subject,
3293
- notes: options.notes
4345
+ const workspaceId = await resolveWorkspaceId(client, options.workspace);
4346
+ const result = await client.ceremonies.backfillAttachments(workspaceId, {
4347
+ dryRun: !options.apply
3294
4348
  });
3295
4349
  if (useJson) {
3296
- outputInteractionJson(interaction);
4350
+ console.log(JSON.stringify(result, null, 2));
3297
4351
  } else {
3298
- console.log("\n\u2713 Interaction added");
3299
- outputInteractionPretty(interaction);
4352
+ console.log(
4353
+ chalk4.bold(
4354
+ `
4355
+ ${result.dryRun ? "Dry run" : "Applied"}: ${result.matched} of ${result.scanned} meetings matched`
4356
+ )
4357
+ );
4358
+ if (result.occurrencesCreated > 0) {
4359
+ console.log(chalk4.gray(` Scheduled ${result.occurrencesCreated} missing occurrences (this happens even on a dry run).`));
4360
+ }
4361
+ for (const row of result.rows) {
4362
+ const target = row.occurrenceId ? chalk4.green(`\u2192 ${row.ceremonyName} ${row.scheduledStart ? new Date(row.scheduledStart).toLocaleString() : ""}`) : chalk4.gray(`\u2014 ${row.reason}`);
4363
+ console.log(` ${row.title ?? row.meetingId} ${target}`);
4364
+ }
4365
+ if (result.dryRun && result.matched > 0) {
4366
+ console.log(chalk4.gray("\nRe-run with --apply to write these attachments."));
4367
+ }
3300
4368
  }
3301
4369
  } catch (error) {
3302
4370
  handleError(error, useJson);
3303
4371
  }
3304
4372
  });
3305
- contacts.command("enrich").description("Queue a web-search enrichment job for an existing contact (runs regardless of the workspace auto-enrich setting)").argument("<id>", "Contact ID").action(async (id, _options, cmd) => {
4373
+ ceremonies.command("match-url <url>").description(
4374
+ "Which ceremony meets in this video room, and the occurrence on now (or --at). Searches all your workspaces unless --workspace."
4375
+ ).option("--at <datetime>", "Match the occurrence on at this time instead of now").option("--workspace <slug|id>", "Only look in this workspace").action(async (url, options, cmd) => {
3306
4376
  const globalOpts = cmd.optsWithGlobals();
3307
4377
  const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);
3308
4378
  try {
3309
4379
  const client = getClient();
3310
- const result = await client.contacts.enrich(id);
4380
+ const workspaceId = options.workspace ? await resolveWorkspaceId(client, options.workspace) : void 0;
4381
+ const match = await client.ceremonies.matchMeetingUrl({
4382
+ url,
4383
+ at: options.at ? parseDateTime(options.at, "--at") : void 0,
4384
+ workspaceId
4385
+ });
3311
4386
  if (useJson) {
3312
- console.log(JSON.stringify(result, null, 2));
3313
- } else if (result.enqueued) {
3314
- console.log(`
3315
- \u2713 Enrichment queued for contact ${id} (job ${result.enrichmentId})`);
3316
- } else if (result.reason === "already-in-flight") {
3317
- console.log(`
3318
- \u2022 Enrichment already in progress for contact ${id} (job ${result.enrichmentId})`);
4387
+ console.log(JSON.stringify({ match }, null, 2));
4388
+ } else if (!match) {
4389
+ console.log(chalk4.gray("No ceremony meets in this room (or several do and none is on now)."));
3319
4390
  } else {
3320
- console.log(`
3321
- \u2022 Not queued for contact ${id}${result.reason ? ` (${result.reason})` : ""}`);
4391
+ console.log(`${chalk4.bold(match.ceremony.name)} ${chalk4.gray(`in ${match.workspace.name} \xB7 ${match.ceremony.id}`)}`);
4392
+ if (match.project) console.log(` ${chalk4.gray("Project:")} ${match.project.name}`);
4393
+ console.log(
4394
+ match.occurrence ? ` ${chalk4.gray("Occurrence:")} ${new Date(match.occurrence.scheduledStart).toLocaleString()} ${chalk4.gray(match.occurrence.id)}` : chalk4.gray(" No occurrence on at that time.")
4395
+ );
3322
4396
  }
3323
4397
  } catch (error) {
3324
4398
  handleError(error, useJson);
3325
4399
  }
3326
4400
  });
3327
- return contacts;
3328
- }
3329
-
3330
- // src/commands/databases.ts
3331
- import { Command as Command4 } from "commander";
3332
- import chalk4 from "chalk";
3333
-
3334
- // src/utils/input.ts
3335
- import { readFileSync } from "fs";
3336
- var stdinConsumed = false;
3337
- function readText(inline, file) {
3338
- if (inline !== void 0) return inline;
3339
- if (file === void 0) return void 0;
3340
- if (file === "-") {
3341
- if (stdinConsumed) {
3342
- throw new Error('stdin ("-") can only back one option per invocation.');
3343
- }
3344
- stdinConsumed = true;
3345
- return readFileSync(0, "utf-8");
3346
- }
3347
- return readFileSync(file, "utf-8");
3348
- }
3349
- function parseDate(value) {
3350
- if (value === void 0 || value === "") return void 0;
3351
- const date = /^\d{4}-\d{2}-\d{2}$/.test(value) ? /* @__PURE__ */ new Date(`${value}T00:00:00`) : new Date(value);
3352
- if (Number.isNaN(date.getTime())) {
3353
- throw new Error(
3354
- `Invalid date: "${value}". Use ISO format, e.g. 2026-08-25 or 2026-08-25T14:00.`
3355
- );
3356
- }
3357
- return date;
4401
+ ceremonies.addCommand(createOccurrencesCommand());
4402
+ return ceremonies;
3358
4403
  }
3359
4404
 
3360
4405
  // src/commands/databases.ts
4406
+ import { Command as Command5 } from "commander";
4407
+ import chalk5 from "chalk";
3361
4408
  var ADDABLE_TYPES = [
3362
4409
  "text",
3363
4410
  "number",
@@ -3371,7 +4418,7 @@ var ADDABLE_TYPES = [
3371
4418
  "lastEditedTime",
3372
4419
  "createdBy"
3373
4420
  ];
3374
- function collect(value, previous) {
4421
+ function collect2(value, previous) {
3375
4422
  return [...previous, value];
3376
4423
  }
3377
4424
  function parseLimit(value) {
@@ -3488,7 +4535,7 @@ function buildListView(database, filters, sort) {
3488
4535
  };
3489
4536
  }
3490
4537
  function createDatabasesCommand() {
3491
- const databases = new Command4("databases").description(
4538
+ const databases = new Command5("databases").description(
3492
4539
  'Databases: typed tables inside pages. A database is a block in a page body, owned by that page; each row is a page of its own (read it with "pages get <rowId>"). Writes are typed per property \u2014 a bad value is refused naming the property. Not a work tracker: use tickets, actions and projects for work.'
3493
4540
  );
3494
4541
  databases.command("create").description(
@@ -3520,7 +4567,7 @@ ${database.marker}` : database.marker,
3520
4567
  \u2713 Database created${placed ? ` and placed in "${database.page.title}"` : ""}`);
3521
4568
  outputDatabasePretty(database);
3522
4569
  if (!placed && database.marker) {
3523
- console.log(chalk4.gray(` Put this line in the page body to show it: ${database.marker}
4570
+ console.log(chalk5.gray(` Put this line in the page body to show it: ${database.marker}
3524
4571
  `));
3525
4572
  }
3526
4573
  }
@@ -3587,7 +4634,7 @@ ${database.marker}` : database.marker,
3587
4634
  return databases;
3588
4635
  }
3589
4636
  function createPropertiesCommand() {
3590
- const properties = new Command4("properties").description(
4637
+ const properties = new Command5("properties").description(
3591
4638
  "The schema: add, rename, retype, re-option, remove or reorder properties. Ids are stable \u2014 renaming never rewrites a row. A property is named by id or by name."
3592
4639
  );
3593
4640
  properties.command("add <databaseId>").description(`Add a property. Types: ${ADDABLE_TYPES.join(", ")} (title exists from creation; relation arrives with V3).`).requiredOption("--name <name>", "Property name").requiredOption("--type <type>", "Property type").option("--options <list>", 'select/multiSelect options, comma-separated; "Name:color" picks a palette colour').option("--description <text>", "What the property means").action(
@@ -3673,12 +4720,12 @@ function createPropertiesCommand() {
3673
4720
  return properties;
3674
4721
  }
3675
4722
  function createRowsCommand() {
3676
- const rows = new Command4("rows").description(
4723
+ const rows = new Command5("rows").description(
3677
4724
  `Rows: each is a page of the database. Write values with repeatable --set Property=value; read a row's body and history with "pages get <rowId>" / "pages history <rowId>".`
3678
4725
  );
3679
4726
  rows.command("list <databaseId>").description(
3680
4727
  'Rows through the saved view, or with your own --filter/--sort: "Status=Tracked", "Score>5", "Owner!=", "Name~latency", "Status in Tracked,Instrumenting".'
3681
- ).option("--filter <expr>", "Filter (repeatable); replaces the saved filters", collect, []).option("--sort <prop[:asc|desc]>", "Sort; replaces the saved sort").option("-l, --limit <n>", "Rows per page (1-200, default 50)").option("--cursor <cursor>", "Continue from a previous page (nextCursor)").action(
4728
+ ).option("--filter <expr>", "Filter (repeatable); replaces the saved filters", collect2, []).option("--sort <prop[:asc|desc]>", "Sort; replaces the saved sort").option("-l, --limit <n>", "Rows per page (1-200, default 50)").option("--cursor <cursor>", "Continue from a previous page (nextCursor)").action(
3682
4729
  async (databaseId, options, cmd) => {
3683
4730
  const globalOpts = cmd.optsWithGlobals();
3684
4731
  const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);
@@ -3699,7 +4746,7 @@ function createRowsCommand() {
3699
4746
  );
3700
4747
  rows.command("add <databaseId>").description(
3701
4748
  'Add a row. --set Name="Alert latency" --set Status=Tracked (repeatable; property by name or id; a select by option name, lists comma-separated, dates ISO, checkboxes yes/no).'
3702
- ).option("--set <Property=value>", "A cell value (repeatable)", collect, []).option("-n, --note <text>", "Why: recorded on the row page's first revision").action(async (databaseId, options, cmd) => {
4749
+ ).option("--set <Property=value>", "A cell value (repeatable)", collect2, []).option("-n, --note <text>", "Why: recorded on the row page's first revision").action(async (databaseId, options, cmd) => {
3703
4750
  const globalOpts = cmd.optsWithGlobals();
3704
4751
  const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);
3705
4752
  try {
@@ -3716,7 +4763,7 @@ function createRowsCommand() {
3716
4763
  });
3717
4764
  rows.command("import <databaseId>").description(
3718
4765
  'Import a CSV: --csv file (or - for stdin). Columns map to properties by header name; --map "Col=Property", --new "Col=type" (or "Col=Name:type") and --skip Col override. --dry-run shows the typed preview and creates nothing. Rows with a cell that does not fit are reported and left out.'
3719
- ).requiredOption("--csv <file>", "The CSV file, or - for stdin").option("--map <Col=Property>", "Send a column to an existing property (repeatable)", collect, []).option("--new <Col=type>", "Create a property for a column (repeatable)", collect, []).option("--skip <Col>", "Leave a column out (repeatable)", collect, []).option("--dry-run", "Preview only: type every row, create nothing").option("-n, --note <text>", "Why: recorded on each new row's first revision").action(
4766
+ ).requiredOption("--csv <file>", "The CSV file, or - for stdin").option("--map <Col=Property>", "Send a column to an existing property (repeatable)", collect2, []).option("--new <Col=type>", "Create a property for a column (repeatable)", collect2, []).option("--skip <Col>", "Leave a column out (repeatable)", collect2, []).option("--dry-run", "Preview only: type every row, create nothing").option("-n, --note <text>", "Why: recorded on each new row's first revision").action(
3720
4767
  async (databaseId, options, cmd) => {
3721
4768
  const globalOpts = cmd.optsWithGlobals();
3722
4769
  const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);
@@ -3747,7 +4794,7 @@ function createRowsCommand() {
3747
4794
  }
3748
4795
  }
3749
4796
  );
3750
- rows.command("update <rowId>").description("Write some of a row's cells: --set Property=value (repeatable), --clear Property to empty one. Other cells are kept. Recorded in the row page's history.").option("--set <Property=value>", "A cell value (repeatable)", collect, []).option("--clear <Property>", "Empty a cell (repeatable)", collect, []).option("-n, --note <text>", "Why: shown in the row page's history").action(
4797
+ rows.command("update <rowId>").description("Write some of a row's cells: --set Property=value (repeatable), --clear Property to empty one. Other cells are kept. Recorded in the row page's history.").option("--set <Property=value>", "A cell value (repeatable)", collect2, []).option("--clear <Property>", "Empty a cell (repeatable)", collect2, []).option("-n, --note <text>", "Why: shown in the row page's history").action(
3751
4798
  async (rowId, options, cmd) => {
3752
4799
  const globalOpts = cmd.optsWithGlobals();
3753
4800
  const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);
@@ -3785,8 +4832,8 @@ function createRowsCommand() {
3785
4832
  }
3786
4833
 
3787
4834
  // src/commands/decisions.ts
3788
- import { Command as Command5 } from "commander";
3789
- import chalk5 from "chalk";
4835
+ import { Command as Command6 } from "commander";
4836
+ import chalk6 from "chalk";
3790
4837
  var STATUSES = [
3791
4838
  "OPEN",
3792
4839
  "PROPOSED",
@@ -4034,7 +5081,7 @@ function addConfirmCommand(parent) {
4034
5081
  );
4035
5082
  }
4036
5083
  function createDecisionsCommand() {
4037
- const decisions = new Command5("decisions").description(
5084
+ const decisions = new Command6("decisions").description(
4038
5085
  [
4039
5086
  "Log and manage decisions and open questions (the workspace Decision Log).",
4040
5087
  "",
@@ -4060,11 +5107,15 @@ function createDecisionsCommand() {
4060
5107
  "Filter by source (repeatable): MEETING, MANUAL, AGENT",
4061
5108
  (value, previous) => [...previous, parseSource(value)],
4062
5109
  []
4063
- ).option("--product <slug|id>", 'Filter by product, or "workspace" for decisions with no product').option("--include-workspace-wide", "With --product: also include decisions that have no product").option("--project <id>", "Filter by project CUID").option("--search <text>", "Free-text over statement and body").option("--number <n>", "One decision by its workspace sequence number (D-0003 is 3)").option("--limit <n>", "Cap the rows returned (1-500)").option("--adr <id>", "Decisions formalised as this ADR document").action(
5110
+ ).option("--product <slug|id>", 'Filter by product, or "workspace" for decisions with no product').option("--include-workspace-wide", "With --product: also include decisions that have no product").option("--project <id>", "Filter by project CUID").option("--search <text>", "Free-text over statement and body").option("--number <n>", "One decision by its workspace sequence number (D-0003 is 3)").option("--limit <n>", "Cap the rows returned (1-500)").option("--adr <id>", "Decisions formalised as this ADR document").option("--occurrence <id|url>", "Only decisions logged in this ceremony occurrence (the URL brings its own workspace)").action(
4064
5111
  async (options, cmd) => {
4065
5112
  const globalOpts = cmd.optsWithGlobals();
4066
5113
  const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);
4067
5114
  try {
5115
+ if (options.meeting && options.occurrence) {
5116
+ throw new Error("Pass --meeting or --occurrence, not both.");
5117
+ }
5118
+ const occurrence = options.occurrence ? parseOccurrenceRef(options.occurrence) : void 0;
4068
5119
  const client = getClient();
4069
5120
  if (options.meeting) {
4070
5121
  const result = await client.decisions.listForMeeting(options.meeting);
@@ -4085,7 +5136,7 @@ function createDecisionsCommand() {
4085
5136
  outputDecisionsPretty(rows2);
4086
5137
  if (!result.canLogDecision) {
4087
5138
  console.log(
4088
- chalk5.yellow(
5139
+ chalk6.yellow(
4089
5140
  "You cannot log decisions on this meeting (no edit access, or it has no workspace)."
4090
5141
  )
4091
5142
  );
@@ -4093,8 +5144,9 @@ function createDecisionsCommand() {
4093
5144
  }
4094
5145
  return;
4095
5146
  }
4096
- const workspaceId = await resolveWorkspaceId(client, options.workspace);
4097
- const rows = options.adr ? await client.decisions.listForAdr(workspaceId, options.adr) : await client.decisions.list({
5147
+ const workspaceId = await resolveWorkspaceId(client, occurrence?.workspaceSlug ?? options.workspace);
5148
+ const limit = parsePositiveInt(options.limit, "--limit");
5149
+ const all = options.adr ? await client.decisions.listForAdr(workspaceId, options.adr) : await client.decisions.list({
4098
5150
  workspaceId,
4099
5151
  statuses: options.status.length > 0 ? options.status : void 0,
4100
5152
  sources: options.source.length > 0 ? options.source : void 0,
@@ -4103,10 +5155,16 @@ function createDecisionsCommand() {
4103
5155
  projectId: options.project,
4104
5156
  search: options.search,
4105
5157
  number: parsePositiveInt(options.number, "--number"),
4106
- limit: parsePositiveInt(options.limit, "--limit")
5158
+ // With --occurrence the cap applies after filtering, below.
5159
+ limit: occurrence ? void 0 : limit
4107
5160
  });
4108
- if (useJson) outputDecisionsJson(rows, { workspaceId });
4109
- else outputDecisionsPretty(rows);
5161
+ const rows = occurrence ? all.filter((d) => d.occurrenceId === occurrence.id).slice(0, limit) : all;
5162
+ if (useJson) {
5163
+ outputDecisionsJson(
5164
+ rows,
5165
+ occurrence ? { workspaceId, occurrenceId: occurrence.id } : { workspaceId }
5166
+ );
5167
+ } else outputDecisionsPretty(rows);
4110
5168
  } catch (error) {
4111
5169
  handleError(error, useJson);
4112
5170
  }
@@ -4285,7 +5343,7 @@ function createDecisionsCommand() {
4285
5343
  \u2713 ${decision.status === "OPEN" ? "Open question" : "Decision"} logged`
4286
5344
  );
4287
5345
  outputDecisionPretty(decision);
4288
- if (featureLink) console.log(chalk5.gray(` Linked to feature ${options.feature}`));
5346
+ if (featureLink) console.log(chalk6.gray(` Linked to feature ${options.feature}`));
4289
5347
  }
4290
5348
  } catch (error) {
4291
5349
  handleError(error, useJson);
@@ -4394,9 +5452,9 @@ function createDecisionsCommand() {
4394
5452
  const link = options.ticket ? await client.decisions.linkTicket(workspaceId, decisionId, options.ticket) : await client.decisions.linkFeature(workspaceId, decisionId, options.feature);
4395
5453
  if (useJson) console.log(JSON.stringify(link, null, 2));
4396
5454
  else {
4397
- console.log(`\u2713 Linked ${chalk5.gray(`(link id ${link.id})`)}`);
5455
+ console.log(`\u2713 Linked ${chalk6.gray(`(link id ${link.id})`)}`);
4398
5456
  console.log(
4399
- chalk5.gray(" Remove it with: exponential decisions unlink --link " + link.id)
5457
+ chalk6.gray(" Remove it with: exponential decisions unlink --link " + link.id)
4400
5458
  );
4401
5459
  }
4402
5460
  } catch (error) {
@@ -4419,7 +5477,7 @@ function createDecisionsCommand() {
4419
5477
  handleError(error, useJson);
4420
5478
  }
4421
5479
  });
4422
- const drafts = new Command5("draft").description(
5480
+ const drafts = new Command6("draft").description(
4423
5481
  "Review decisions an agent proposed but nobody has confirmed yet (visible only on their source meeting)"
4424
5482
  );
4425
5483
  drafts.command("extract").description(
@@ -4434,22 +5492,22 @@ function createDecisionsCommand() {
4434
5492
  else {
4435
5493
  if (result.alreadyPublished) {
4436
5494
  console.log(
4437
- chalk5.gray("This meeting already has confirmed decisions \u2014 nothing was extracted.")
5495
+ chalk6.gray("This meeting already has confirmed decisions \u2014 nothing was extracted.")
4438
5496
  );
4439
5497
  } else if (result.alreadyDrafted) {
4440
- console.log(chalk5.gray("Returning the drafts this meeting already had."));
5498
+ console.log(chalk6.gray("Returning the drafts this meeting already had."));
4441
5499
  }
4442
5500
  console.log(
4443
5501
  `\u2713 ${result.draftCount} draft${result.draftCount === 1 ? "" : "s"} awaiting review (${result.draftsCreated} new)`
4444
5502
  );
4445
5503
  if (result.discardedWithoutEvidence > 0) {
4446
5504
  console.log(
4447
- chalk5.gray(
5505
+ chalk6.gray(
4448
5506
  ` ${result.discardedWithoutEvidence} candidate(s) dropped \u2014 no transcript turn supported them.`
4449
5507
  )
4450
5508
  );
4451
5509
  }
4452
- for (const message of result.errors) console.log(chalk5.yellow(` ${message}`));
5510
+ for (const message of result.errors) console.log(chalk6.yellow(` ${message}`));
4453
5511
  }
4454
5512
  } catch (error) {
4455
5513
  handleError(error, useJson);
@@ -4506,9 +5564,9 @@ function createDecisionsCommand() {
4506
5564
  }
4507
5565
 
4508
5566
  // src/commands/deals.ts
4509
- import { Command as Command6 } from "commander";
5567
+ import { Command as Command7 } from "commander";
4510
5568
  function createDealsCommand() {
4511
- const deals = new Command6("deals").description("Manage pipeline deals");
5569
+ const deals = new Command7("deals").description("Manage pipeline deals");
4512
5570
  deals.command("pipeline").description("Get pipeline overview with stages").requiredOption("--workspace <id>", "Workspace ID").action(async (options, cmd) => {
4513
5571
  const globalOpts = cmd.optsWithGlobals();
4514
5572
  const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);
@@ -4693,7 +5751,7 @@ function createDealsCommand() {
4693
5751
  }
4694
5752
 
4695
5753
  // src/commands/epics.ts
4696
- import { Command as Command7 } from "commander";
5754
+ import { Command as Command8 } from "commander";
4697
5755
  var EPIC_STATUSES = ["OPEN", "IN_PROGRESS", "DONE", "CANCELLED"];
4698
5756
  var EPIC_PRIORITIES = ["HIGH", "MEDIUM", "LOW", "NONE"];
4699
5757
  function validateEpicStatus(value) {
@@ -4721,7 +5779,7 @@ function parseDate2(value) {
4721
5779
  return d;
4722
5780
  }
4723
5781
  function createEpicsCommand() {
4724
- const epics = new Command7("epics").description(
5782
+ const epics = new Command8("epics").description(
4725
5783
  "Manage epics. Epics are workspace-scoped and group actions and tickets across products."
4726
5784
  );
4727
5785
  epics.command("list").description("List epics in a workspace").option("--workspace <slug|id>", "Workspace slug or CUID").option("--status <status>", `Filter by status: ${EPIC_STATUSES.join(", ")}`).action(
@@ -4838,10 +5896,10 @@ function createEpicsCommand() {
4838
5896
  }
4839
5897
 
4840
5898
  // src/commands/features.ts
4841
- import { Command as Command13 } from "commander";
5899
+ import { Command as Command14 } from "commander";
4842
5900
 
4843
5901
  // src/commands/stories.ts
4844
- import { Command as Command8 } from "commander";
5902
+ import { Command as Command9 } from "commander";
4845
5903
  async function readStdin() {
4846
5904
  const chunks = [];
4847
5905
  for await (const chunk of process.stdin) {
@@ -4850,7 +5908,7 @@ async function readStdin() {
4850
5908
  return Buffer.concat(chunks).toString("utf-8");
4851
5909
  }
4852
5910
  function createStoriesCommand() {
4853
- const stories = new Command8("stories").description(
5911
+ const stories = new Command9("stories").description(
4854
5912
  "Manage a feature's native, structured user stories (As a / I want / So that)."
4855
5913
  );
4856
5914
  stories.command("add").description(
@@ -4984,7 +6042,7 @@ function createStoriesCommand() {
4984
6042
  }
4985
6043
 
4986
6044
  // src/commands/scopes.ts
4987
- import { Command as Command9 } from "commander";
6045
+ import { Command as Command10 } from "commander";
4988
6046
  var SCOPE_STATUSES = [
4989
6047
  "PLANNED",
4990
6048
  "IN_PROGRESS",
@@ -5001,7 +6059,7 @@ function validateScopeStatus(value) {
5001
6059
  return value;
5002
6060
  }
5003
6061
  function createScopesCommand() {
5004
- const scopes = new Command9("scopes").description(
6062
+ const scopes = new Command10("scopes").description(
5005
6063
  `Manage a feature's scopes: shippable increments ("V1", "V2"), each with its own lifecycle.`
5006
6064
  );
5007
6065
  scopes.command("list").description("List a feature's scopes").requiredOption("--feature <id>", "Feature CUID").action(
@@ -5080,7 +6138,7 @@ function createScopesCommand() {
5080
6138
  }
5081
6139
 
5082
6140
  // src/commands/requirements.ts
5083
- import { Command as Command10 } from "commander";
6141
+ import { Command as Command11 } from "commander";
5084
6142
  var REQUIREMENT_KINDS = [
5085
6143
  "FUNCTIONAL",
5086
6144
  "NON_FUNCTIONAL",
@@ -5103,7 +6161,7 @@ async function readStdin2() {
5103
6161
  return Buffer.concat(chunks).toString("utf-8");
5104
6162
  }
5105
6163
  function createRequirementsCommand() {
5106
- const requirements = new Command10("requirements").description(
6164
+ const requirements = new Command11("requirements").description(
5107
6165
  `Manage a feature's requirements: atomic, testable EARS-style "shall" statements, checkable met/unmet.`
5108
6166
  );
5109
6167
  requirements.command("add").description(
@@ -5234,25 +6292,25 @@ function createRequirementsCommand() {
5234
6292
  }
5235
6293
 
5236
6294
  // src/commands/areas.ts
5237
- import { Command as Command11 } from "commander";
5238
- import chalk6 from "chalk";
6295
+ import { Command as Command12 } from "commander";
6296
+ import chalk7 from "chalk";
5239
6297
  function outputAreasPretty(areas) {
5240
6298
  if (areas.length === 0) {
5241
- console.log(chalk6.gray("No areas found."));
6299
+ console.log(chalk7.gray("No areas found."));
5242
6300
  return;
5243
6301
  }
5244
- console.log(chalk6.bold(`
6302
+ console.log(chalk7.bold(`
5245
6303
  Areas (${areas.length} total)`));
5246
- console.log(chalk6.gray("\u2500".repeat(50)));
6304
+ console.log(chalk7.gray("\u2500".repeat(50)));
5247
6305
  for (const a of areas) {
5248
- const count = a._count?.features != null ? chalk6.gray(` (${a._count.features} features)`) : "";
5249
- console.log(` ${chalk6.bold(a.name)}${count}`);
5250
- console.log(chalk6.gray(` ID: ${a.id}`));
6306
+ const count = a._count?.features != null ? chalk7.gray(` (${a._count.features} features)`) : "";
6307
+ console.log(` ${chalk7.bold(a.name)}${count}`);
6308
+ console.log(chalk7.gray(` ID: ${a.id}`));
5251
6309
  }
5252
6310
  console.log();
5253
6311
  }
5254
6312
  function createAreasCommand() {
5255
- const areas = new Command11("areas").description(
6313
+ const areas = new Command12("areas").description(
5256
6314
  "Manage a product's areas: the buckets features are filed under (a feature has exactly one or none)."
5257
6315
  );
5258
6316
  areas.command("list").description("List a product's areas").requiredOption("--product <slug|id>", "Product slug or CUID").option("--workspace <slug|id>", "Workspace (required when --product is a slug)").action(
@@ -5296,7 +6354,7 @@ function createAreasCommand() {
5296
6354
  }
5297
6355
 
5298
6356
  // src/commands/featureComments.ts
5299
- import { Command as Command12 } from "commander";
6357
+ import { Command as Command13 } from "commander";
5300
6358
 
5301
6359
  // src/utils/mentions.ts
5302
6360
  function candidateLabels(member) {
@@ -5369,7 +6427,7 @@ function collectMention(value, previous) {
5369
6427
 
5370
6428
  // src/commands/featureComments.ts
5371
6429
  function createFeatureCommentsCommand() {
5372
- const comment = new Command12("comment").description(
6430
+ const comment = new Command13("comment").description(
5373
6431
  "Read and post comments on a feature. Mention teammates with --mention."
5374
6432
  );
5375
6433
  comment.command("list").description("List comments on a feature").requiredOption("--feature <id>", "Feature ID").action(async (options, cmd) => {
@@ -5570,7 +6628,7 @@ function validateFeatureStatus(value) {
5570
6628
  return value;
5571
6629
  }
5572
6630
  function createFeaturesCommand() {
5573
- const features = new Command13("features").description(
6631
+ const features = new Command14("features").description(
5574
6632
  "Manage features. A feature lives under a product and groups user stories, scopes, and tickets."
5575
6633
  );
5576
6634
  features.command("list").description("List features in a product").requiredOption("--product <slug|id>", "Product slug or CUID").option("--workspace <slug|id>", "Workspace (required when --product is a slug)").option("--status <status>", `Filter by status: ${FEATURE_STATUSES.join(", ")}`).action(
@@ -5827,8 +6885,8 @@ Aborted: ${reason}. Feature "${feature.name}" was NOT deleted.`);
5827
6885
  }
5828
6886
 
5829
6887
  // src/commands/labels.ts
5830
- import { Command as Command14 } from "commander";
5831
- import chalk7 from "chalk";
6888
+ import { Command as Command15 } from "commander";
6889
+ import chalk8 from "chalk";
5832
6890
  var TRIAGE_LABELS = [
5833
6891
  { slug: "needs-triage", name: "needs-triage", color: "avatar-orange" },
5834
6892
  { slug: "needs-info", name: "needs-info", color: "avatar-yellow" },
@@ -5842,22 +6900,22 @@ function looksLikeCuid(value) {
5842
6900
  }
5843
6901
  function outputTagsPretty(tags) {
5844
6902
  if (tags.length === 0) {
5845
- console.log(chalk7.dim("No labels found."));
6903
+ console.log(chalk8.dim("No labels found."));
5846
6904
  return;
5847
6905
  }
5848
6906
  console.log();
5849
6907
  for (const tag of tags) {
5850
- const scope = tag.workspaceId === null ? chalk7.cyan("global") : chalk7.magenta("workspace");
5851
- const category = tag.category === null ? chalk7.dim("(label)") : chalk7.dim(`(${tag.category})`);
6908
+ const scope = tag.workspaceId === null ? chalk8.cyan("global") : chalk8.magenta("workspace");
6909
+ const category = tag.category === null ? chalk8.dim("(label)") : chalk8.dim(`(${tag.category})`);
5852
6910
  console.log(
5853
- ` ${chalk7.bold(tag.slug)} ${tag.name} ${chalk7.gray(tag.color)} ${scope} ${category}`
6911
+ ` ${chalk8.bold(tag.slug)} ${tag.name} ${chalk8.gray(tag.color)} ${scope} ${category}`
5854
6912
  );
5855
6913
  }
5856
6914
  console.log();
5857
6915
  }
5858
6916
  function outputTagPretty(tag, prefix) {
5859
6917
  if (prefix) console.log(prefix);
5860
- console.log(` ${chalk7.bold(tag.slug)} ${tag.name} ${chalk7.gray(tag.color)}`);
6918
+ console.log(` ${chalk8.bold(tag.slug)} ${tag.name} ${chalk8.gray(tag.color)}`);
5861
6919
  }
5862
6920
  async function resolveLabelIds(client, workspaceId, values) {
5863
6921
  if (values.length === 0) return [];
@@ -5881,7 +6939,7 @@ async function resolveLabelIds(client, workspaceId, values) {
5881
6939
  return [...byId, ...resolvedFromSlugs];
5882
6940
  }
5883
6941
  function createLabelsCommand() {
5884
- const labels = new Command14("labels").description(
6942
+ const labels = new Command15("labels").description(
5885
6943
  "Manage labels (orthogonal tags applied to actions, tickets, features, and epics)."
5886
6944
  );
5887
6945
  labels.command("list").description("List labels visible in a workspace").option("--workspace <slug|id>", "Workspace slug or CUID").option(
@@ -5929,7 +6987,7 @@ function createLabelsCommand() {
5929
6987
  if (useJson) {
5930
6988
  console.log(JSON.stringify(tag, null, 2));
5931
6989
  } else {
5932
- outputTagPretty(tag, chalk7.green("\n\u2713 Label created"));
6990
+ outputTagPretty(tag, chalk8.green("\n\u2713 Label created"));
5933
6991
  }
5934
6992
  } catch (error) {
5935
6993
  handleError(error, useJson);
@@ -5967,10 +7025,10 @@ function createLabelsCommand() {
5967
7025
  console.log(JSON.stringify(results, null, 2));
5968
7026
  } else {
5969
7027
  console.log();
5970
- console.log(chalk7.bold("Triage labels:"));
7028
+ console.log(chalk8.bold("Triage labels:"));
5971
7029
  for (const r of results) {
5972
- const tag = chalk7.bold(r.slug);
5973
- const status = r.status === "created" ? chalk7.green("created") : chalk7.dim("existed");
7030
+ const tag = chalk8.bold(r.slug);
7031
+ const status = r.status === "created" ? chalk8.green("created") : chalk8.dim("existed");
5974
7032
  console.log(` ${tag} ${status}`);
5975
7033
  }
5976
7034
  console.log();
@@ -5984,10 +7042,10 @@ function createLabelsCommand() {
5984
7042
  }
5985
7043
 
5986
7044
  // src/commands/meetings.ts
5987
- import { Command as Command15 } from "commander";
5988
- import chalk8 from "chalk";
7045
+ import { Command as Command16 } from "commander";
7046
+ import chalk9 from "chalk";
5989
7047
  function createMeetingsCommand() {
5990
- const meetings = new Command15("meetings").description(
7048
+ const meetings = new Command16("meetings").description(
5991
7049
  "Manage meetings and their notes (recorded, imported, or manually created)"
5992
7050
  );
5993
7051
  meetings.command("list").description(
@@ -6148,7 +7206,7 @@ function createMeetingsCommand() {
6148
7206
  console.log(`\u2713 Deleted ${count} of ${ids.length} meeting${ids.length === 1 ? "" : "s"}`);
6149
7207
  if (skipped > 0) {
6150
7208
  console.log(
6151
- chalk8.yellow(
7209
+ chalk9.yellow(
6152
7210
  `${skipped} id(s) were skipped \u2014 not found, or not owned by you.`
6153
7211
  )
6154
7212
  );
@@ -6159,7 +7217,7 @@ function createMeetingsCommand() {
6159
7217
  }
6160
7218
  }
6161
7219
  );
6162
- const notes = new Command15("notes").description(
7220
+ const notes = new Command16("notes").description(
6163
7221
  "Read and write a meeting's notes"
6164
7222
  );
6165
7223
  notes.command("get <id>").description(
@@ -6175,7 +7233,7 @@ function createMeetingsCommand() {
6175
7233
  process.stdout.write(body.endsWith("\n") ? body : `${body}
6176
7234
  `);
6177
7235
  } else if (process.stdout.isTTY) {
6178
- console.log(chalk8.gray("No notes yet."));
7236
+ console.log(chalk9.gray("No notes yet."));
6179
7237
  }
6180
7238
  } catch (error) {
6181
7239
  handleError(error, shouldUseJson(globalOpts.json, globalOpts.pretty));
@@ -6224,7 +7282,7 @@ function createMeetingsCommand() {
6224
7282
  }
6225
7283
 
6226
7284
  // src/commands/organizations.ts
6227
- import { Command as Command16 } from "commander";
7285
+ import { Command as Command17 } from "commander";
6228
7286
  var VALID_SIZES = [
6229
7287
  "1-10",
6230
7288
  "11-50",
@@ -6234,7 +7292,7 @@ var VALID_SIZES = [
6234
7292
  "1000+"
6235
7293
  ];
6236
7294
  function createOrganizationsCommand() {
6237
- const organizations = new Command16("organizations").alias("orgs").description("Manage CRM organizations");
7295
+ const organizations = new Command17("organizations").alias("orgs").description("Manage CRM organizations");
6238
7296
  organizations.command("list").description("List organizations").requiredOption("--workspace <id>", "Workspace ID").option("--search <query>", "Search by name or description").option("--industry <industry>", "Filter by industry").option("--limit <n>", "Max results to return", parseInt).option("--cursor <cursor>", "Pagination cursor").action(async (options, cmd) => {
6239
7297
  const globalOpts = cmd.optsWithGlobals();
6240
7298
  const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);
@@ -6302,13 +7360,13 @@ function createOrganizationsCommand() {
6302
7360
  }
6303
7361
 
6304
7362
  // src/commands/pages.ts
6305
- import { Command as Command18 } from "commander";
6306
- import chalk9 from "chalk";
7363
+ import { Command as Command19 } from "commander";
7364
+ import chalk10 from "chalk";
6307
7365
 
6308
7366
  // src/commands/pageComments.ts
6309
- import { Command as Command17 } from "commander";
7367
+ import { Command as Command18 } from "commander";
6310
7368
  function createPageCommentsCommand() {
6311
- const comment = new Command17("comment").description(
7369
+ const comment = new Command18("comment").description(
6312
7370
  "Read and post comments on a page. Mention teammates with --mention."
6313
7371
  );
6314
7372
  comment.command("list").description("List comments on a page").requiredOption("--page <id>", "Page ID").action(async (options, cmd) => {
@@ -6411,7 +7469,7 @@ function parseLimit2(value) {
6411
7469
  return n;
6412
7470
  }
6413
7471
  function createPagesCommand() {
6414
- const pages = new Command18("pages").description(
7472
+ const pages = new Command19("pages").description(
6415
7473
  `Manage Knowledge pages (PRDs, research, technical specs). Reads are Markdown-only by default; every write is recorded in the page's history. Link one to a feature with "features link-page".`
6416
7474
  );
6417
7475
  pages.command("list").description("List pages in a workspace (metadata only, no bodies)").option("--workspace <slug|id>", "Workspace (defaults to the configured default)").option(
@@ -6560,13 +7618,13 @@ function createPagesCommand() {
6560
7618
  const revision = await client.pages.revision(id, revisionId);
6561
7619
  if (useJson) console.log(JSON.stringify(revision, null, 2));
6562
7620
  else {
6563
- console.log(chalk9.gray("\u2500".repeat(50)));
7621
+ console.log(chalk10.gray("\u2500".repeat(50)));
6564
7622
  console.log(
6565
7623
  `
6566
- ${chalk9.bold(revision.title)} ${chalk9.gray(`v${revision.docVersion} \xB7 ${revision.kind}`)}`
7624
+ ${chalk10.bold(revision.title)} ${chalk10.gray(`v${revision.docVersion} \xB7 ${revision.kind}`)}`
6567
7625
  );
6568
- console.log(chalk9.gray(` Revision: ${revision.id}`));
6569
- if (revision.note) console.log(` ${chalk9.gray("Note:")} ${revision.note}`);
7626
+ console.log(chalk10.gray(` Revision: ${revision.id}`));
7627
+ if (revision.note) console.log(` ${chalk10.gray("Note:")} ${revision.note}`);
6570
7628
  if (revision.body) console.log(`
6571
7629
  ${revision.body}
6572
7630
  `);
@@ -6638,9 +7696,9 @@ ${revision.body}
6638
7696
  }
6639
7697
 
6640
7698
  // src/commands/products.ts
6641
- import { Command as Command19 } from "commander";
7699
+ import { Command as Command20 } from "commander";
6642
7700
  function createProductsCommand() {
6643
- const products = new Command19("products").description(
7701
+ const products = new Command20("products").description(
6644
7702
  "Manage products. A workspace contains products; a product holds features and tickets."
6645
7703
  );
6646
7704
  products.command("list").description("List products in a workspace").option("--workspace <slug|id>", "Workspace slug or CUID (defaults to configured workspace)").action(async (options, cmd) => {
@@ -6781,7 +7839,7 @@ Re-run with --force to delete it anyway.`
6781
7839
  }
6782
7840
 
6783
7841
  // src/commands/projects.ts
6784
- import { Command as Command20 } from "commander";
7842
+ import { Command as Command21 } from "commander";
6785
7843
  var PROJECT_STATUSES = [
6786
7844
  "ACTIVE",
6787
7845
  "ON_HOLD",
@@ -6808,7 +7866,7 @@ function validateProjectPriority(value) {
6808
7866
  return value;
6809
7867
  }
6810
7868
  function createProjectsCommand() {
6811
- const projects = new Command20("projects").description("Manage projects");
7869
+ const projects = new Command21("projects").description("Manage projects");
6812
7870
  projects.command("list").description("List all projects").option("--workspace <slug|id>", "Workspace slug or CUID").option("--include-actions", "Include actions in output").action(async (options, cmd) => {
6813
7871
  const globalOpts = cmd.optsWithGlobals();
6814
7872
  const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);
@@ -6927,7 +7985,7 @@ Re-run with --force to delete it anyway.`
6927
7985
  }
6928
7986
 
6929
7987
  // src/commands/resources.ts
6930
- import { Command as Command21 } from "commander";
7988
+ import { Command as Command22 } from "commander";
6931
7989
  var STATUS_FILTERS = ["unread", "to_read", "reading", "read", "all"];
6932
7990
  function validateStatus(value) {
6933
7991
  const v = value ?? "unread";
@@ -6942,7 +8000,7 @@ function collectTags(value, previous) {
6942
8000
  }
6943
8001
  var TAG_OPTION = "--tag <tag>";
6944
8002
  function createResourcesCommand() {
6945
- const resources = new Command21("resources").description(
8003
+ const resources = new Command22("resources").description(
6946
8004
  "Saved links and reference material. `list` defaults to the Reading list (unread); `create --url` saves a link to read later."
6947
8005
  );
6948
8006
  resources.command("list").description("List resources. Defaults to the Reading list (unread); --status read for what you finished, all for everything.").option("--workspace <slug|id>", "Workspace (defaults to the configured default)").option("--status <status>", `One of: ${STATUS_FILTERS.join(", ")} (default: unread)`).option("--search <text>", "Filter by title/description").option(TAG_OPTION, "Only resources with this tag (repeatable or comma-separated; matches any)", collectTags, []).option("--limit <n>", "Max rows (default 50)", "50").action(
@@ -7049,7 +8107,7 @@ function createResourcesCommand() {
7049
8107
  }
7050
8108
 
7051
8109
  // src/commands/runner.ts
7052
- import { Command as Command22 } from "commander";
8110
+ import { Command as Command23 } from "commander";
7053
8111
  import { hostname, homedir as homedir2, tmpdir as tmpdir2 } from "os";
7054
8112
  import { execFileSync } from "child_process";
7055
8113
  import { mkdirSync as mkdirSync3 } from "fs";
@@ -7501,7 +8559,7 @@ function removeServiceFile(plan) {
7501
8559
 
7502
8560
  // src/commands/runner.ts
7503
8561
  function createRunnerCommand() {
7504
- const cmd = new Command22("runner").description(
8562
+ const cmd = new Command23("runner").description(
7505
8563
  "Run your Assistant locally: claim its queued runs and work them with Claude Code on this machine"
7506
8564
  );
7507
8565
  cmd.command("start").description("Poll for queued runs and work them until stopped (Ctrl-C)").option("--runner-id <id>", "Name of this runner, recorded on each run", hostname()).option("--cwd <dir>", "Working directory for the spawned CLI (overrides runner config; never from the server)").option("--interval <seconds>", "Seconds between polls when nothing is queued", "15").option("--once", "Claim at most one run, work it, and exit").option("--no-mcp", "Spawn without the Exponential MCP run tools (progress still streams; the session cannot ask the owner)").action(async (opts) => {
@@ -7612,8 +8670,8 @@ ${plan.contents}
7612
8670
  }
7613
8671
 
7614
8672
  // src/commands/search.ts
7615
- import { Command as Command23 } from "commander";
7616
- import chalk10 from "chalk";
8673
+ import { Command as Command24 } from "commander";
8674
+ import chalk11 from "chalk";
7617
8675
  var KNOWLEDGE_TYPES = ["transcription", "resource", "document", "page"];
7618
8676
  function parseTypes(value) {
7619
8677
  if (!value) return void 0;
@@ -7642,7 +8700,7 @@ var TYPE_LABELS = {
7642
8700
  product: "Products"
7643
8701
  };
7644
8702
  function createSearchCommand() {
7645
- const search = new Command23("search").description(
8703
+ const search = new Command24("search").description(
7646
8704
  "Global search across projects, actions, goals, workspaces and more \u2014 same coverage as the app's Cmd+K palette. Matches titles; add --semantic to search meetings, resources, documents and pages by meaning."
7647
8705
  ).argument("<query>", "Text to search for").option("-w, --workspace <slug>", "Restrict results to one workspace (slug or ID; required with --semantic)").option("-l, --limit <n>", "Max results per entity type (1-25, default 10; 1-20 with --semantic)").option("--semantic", "Search the Knowledge index by meaning instead of matching titles").option("--types <list>", "With --semantic: comma-separated source kinds (transcription,resource,document,page)").action(async (query, options, cmd) => {
7648
8706
  const globalOpts = cmd.optsWithGlobals();
@@ -7656,10 +8714,10 @@ function createSearchCommand() {
7656
8714
  (w) => w.slug === options.workspace || w.id === options.workspace
7657
8715
  );
7658
8716
  if (!match) {
7659
- console.error(chalk10.red(`Workspace "${options.workspace}" not found.`));
7660
- console.log(chalk10.gray("Available workspaces:"));
8717
+ console.error(chalk11.red(`Workspace "${options.workspace}" not found.`));
8718
+ console.log(chalk11.gray("Available workspaces:"));
7661
8719
  workspaces.forEach((w) => {
7662
- console.log(chalk10.gray(` - ${w.slug} (${w.name})`));
8720
+ console.log(chalk11.gray(` - ${w.slug} (${w.name})`));
7663
8721
  });
7664
8722
  process.exit(1);
7665
8723
  }
@@ -7681,16 +8739,16 @@ function createSearchCommand() {
7681
8739
  return;
7682
8740
  }
7683
8741
  if (knowledge.results.length === 0) {
7684
- console.log(chalk10.gray(`Nothing about "${knowledge.query}" in the Knowledge index.`));
8742
+ console.log(chalk11.gray(`Nothing about "${knowledge.query}" in the Knowledge index.`));
7685
8743
  return;
7686
8744
  }
7687
- console.log(chalk10.bold(`
8745
+ console.log(chalk11.bold(`
7688
8746
  About "${knowledge.query}"`));
7689
8747
  for (const row of knowledge.results) {
7690
8748
  console.log(
7691
- ` ${chalk10.white(row.title)} ${chalk10.gray(`\xB7 ${row.sourceType} \xB7 ${Math.round(row.similarity * 100)}%`)}`
8749
+ ` ${chalk11.white(row.title)} ${chalk11.gray(`\xB7 ${row.sourceType} \xB7 ${Math.round(row.similarity * 100)}%`)}`
7692
8750
  );
7693
- console.log(chalk10.gray(` ${row.sourceId} ${row.url}`));
8751
+ console.log(chalk11.gray(` ${row.sourceId} ${row.url}`));
7694
8752
  if (row.snippet) console.log(` ${row.snippet}`);
7695
8753
  }
7696
8754
  console.log();
@@ -7702,7 +8760,7 @@ About "${knowledge.query}"`));
7702
8760
  return;
7703
8761
  }
7704
8762
  if (result.results.length === 0) {
7705
- console.log(chalk10.gray(`No matches for "${result.query}".`));
8763
+ console.log(chalk11.gray(`No matches for "${result.query}".`));
7706
8764
  return;
7707
8765
  }
7708
8766
  const byType = /* @__PURE__ */ new Map();
@@ -7712,14 +8770,14 @@ About "${knowledge.query}"`));
7712
8770
  byType.set(r.type, bucket);
7713
8771
  }
7714
8772
  for (const [type, rows] of byType) {
7715
- console.log(chalk10.bold(`
8773
+ console.log(chalk11.bold(`
7716
8774
  ${TYPE_LABELS[type] ?? type}`));
7717
8775
  for (const row of rows) {
7718
- const parts = [chalk10.white(row.title)];
7719
- if (row.subtitle) parts.push(chalk10.gray(row.subtitle));
7720
- if (row.workspace) parts.push(chalk10.cyan(`@${row.workspace.slug}`));
7721
- console.log(` ${parts.join(chalk10.gray(" \xB7 "))}`);
7722
- console.log(chalk10.gray(` ${row.id}${row.url ? ` ${row.url}` : ""}`));
8776
+ const parts = [chalk11.white(row.title)];
8777
+ if (row.subtitle) parts.push(chalk11.gray(row.subtitle));
8778
+ if (row.workspace) parts.push(chalk11.cyan(`@${row.workspace.slug}`));
8779
+ console.log(` ${parts.join(chalk11.gray(" \xB7 "))}`);
8780
+ console.log(chalk11.gray(` ${row.id}${row.url ? ` ${row.url}` : ""}`));
7723
8781
  }
7724
8782
  }
7725
8783
  console.log();
@@ -7731,7 +8789,7 @@ ${TYPE_LABELS[type] ?? type}`));
7731
8789
  }
7732
8790
 
7733
8791
  // src/commands/tickets.ts
7734
- import { Command as Command24 } from "commander";
8792
+ import { Command as Command25 } from "commander";
7735
8793
  function collectRepeatable(value, previous) {
7736
8794
  return [...previous, value];
7737
8795
  }
@@ -7774,7 +8832,7 @@ function validateTicketType(value) {
7774
8832
  return value;
7775
8833
  }
7776
8834
  function createTicketsCommand() {
7777
- const tickets = new Command24("tickets").description(
8835
+ const tickets = new Command25("tickets").description(
7778
8836
  "Manage product backlog tickets. Tickets live under a product, link to features/epics, depend on each other, and can be implemented via actions."
7779
8837
  );
7780
8838
  tickets.command("list").description(
@@ -8143,7 +9201,7 @@ function createTicketsCommand() {
8143
9201
  handleError(error, useJson);
8144
9202
  }
8145
9203
  });
8146
- const comment = new Command24("comment").description("Manage comments on a ticket");
9204
+ const comment = new Command25("comment").description("Manage comments on a ticket");
8147
9205
  comment.command("list").description("List comments on a ticket").requiredOption("--id <id>", "Ticket CUID").action(async (options, cmd) => {
8148
9206
  const globalOpts = cmd.optsWithGlobals();
8149
9207
  const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);
@@ -8235,7 +9293,7 @@ function createTicketsCommand() {
8235
9293
  }
8236
9294
 
8237
9295
  // src/commands/time.ts
8238
- import { Command as Command25 } from "commander";
9296
+ import { Command as Command26 } from "commander";
8239
9297
  import { segmentConversation } from "exponential-sdk";
8240
9298
  var SOURCES2 = ["manual", "claude-desktop", "agent-run"];
8241
9299
  var STATUSES2 = ["PROPOSED", "CONFIRMED"];
@@ -8325,7 +9383,7 @@ function batchItemToInput(item, index, defaults) {
8325
9383
  };
8326
9384
  }
8327
9385
  function createTimeCommand() {
8328
- const time = new Command25("time").description(
9386
+ const time = new Command26("time").description(
8329
9387
  `Time entries \u2014 log the day's work and list it. ${OWNERSHIP_NOTE}`
8330
9388
  );
8331
9389
  time.command("log").description(
@@ -8495,10 +9553,10 @@ function parseMessagesFile(raw) {
8495
9553
  }
8496
9554
 
8497
9555
  // src/commands/workspaces.ts
8498
- import { Command as Command26 } from "commander";
8499
- import chalk11 from "chalk";
9556
+ import { Command as Command27 } from "commander";
9557
+ import chalk12 from "chalk";
8500
9558
  function createWorkspacesCommand() {
8501
- const workspaces = new Command26("workspaces").description("Manage workspaces");
9559
+ const workspaces = new Command27("workspaces").description("Manage workspaces");
8502
9560
  workspaces.command("list").description("List all workspaces").action(async (_options, cmd) => {
8503
9561
  const globalOpts = cmd.optsWithGlobals();
8504
9562
  const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);
@@ -8511,7 +9569,7 @@ function createWorkspacesCommand() {
8511
9569
  const config = getConfig();
8512
9570
  outputWorkspacesPretty(workspaces2);
8513
9571
  if (config.defaultWorkspaceSlug) {
8514
- console.log(chalk11.gray(`Default workspace: ${config.defaultWorkspaceSlug}`));
9572
+ console.log(chalk12.gray(`Default workspace: ${config.defaultWorkspaceSlug}`));
8515
9573
  }
8516
9574
  }
8517
9575
  } catch (error) {
@@ -8524,10 +9582,10 @@ function createWorkspacesCommand() {
8524
9582
  const workspaces2 = await client.workspaces.list();
8525
9583
  const workspace = workspaces2.find((w) => w.slug === slug);
8526
9584
  if (!workspace) {
8527
- console.error(chalk11.red(`Workspace with slug "${slug}" not found.`));
8528
- console.log(chalk11.gray("Available workspaces:"));
9585
+ console.error(chalk12.red(`Workspace with slug "${slug}" not found.`));
9586
+ console.log(chalk12.gray("Available workspaces:"));
8529
9587
  workspaces2.forEach((w) => {
8530
- console.log(chalk11.gray(` - ${w.slug} (${w.name})`));
9588
+ console.log(chalk12.gray(` - ${w.slug} (${w.name})`));
8531
9589
  });
8532
9590
  process.exit(1);
8533
9591
  }
@@ -8535,7 +9593,7 @@ function createWorkspacesCommand() {
8535
9593
  defaultWorkspaceId: workspace.id,
8536
9594
  defaultWorkspaceSlug: workspace.slug
8537
9595
  });
8538
- console.log(chalk11.green(`Default workspace set to: ${workspace.name} (${workspace.slug})`));
9596
+ console.log(chalk12.green(`Default workspace set to: ${workspace.name} (${workspace.slug})`));
8539
9597
  } catch (error) {
8540
9598
  handleError(error);
8541
9599
  }
@@ -8563,20 +9621,20 @@ function createWorkspacesCommand() {
8563
9621
  return;
8564
9622
  }
8565
9623
  if (members.length === 0) {
8566
- console.log(chalk11.gray("No members found."));
9624
+ console.log(chalk12.gray("No members found."));
8567
9625
  return;
8568
9626
  }
8569
- console.log(chalk11.bold(`
9627
+ console.log(chalk12.bold(`
8570
9628
  Members (${members.length})
8571
9629
  `));
8572
9630
  for (const m of members) {
8573
9631
  const label = m.name ?? m.email ?? m.id;
8574
- const via = m.source === "team" ? chalk11.gray(
9632
+ const via = m.source === "team" ? chalk12.gray(
8575
9633
  ` via team${m.teams.length ? `: ${m.teams.map((t) => t.name).join(", ")}` : ""}` + (m.teamRole ? ` [team ${m.teamRole}]` : "")
8576
9634
  ) : "";
8577
- console.log(`${chalk11.bold(label)} ${chalk11.gray(`(${m.role})`)}${via}`);
8578
- if (m.email) console.log(chalk11.gray(` ${m.email}`));
8579
- console.log(chalk11.gray(` mention: ${m.mentionSyntax}`));
9635
+ console.log(`${chalk12.bold(label)} ${chalk12.gray(`(${m.role})`)}${via}`);
9636
+ if (m.email) console.log(chalk12.gray(` ${m.email}`));
9637
+ console.log(chalk12.gray(` mention: ${m.mentionSyntax}`));
8580
9638
  console.log();
8581
9639
  }
8582
9640
  } catch (error) {
@@ -8588,7 +9646,7 @@ Members (${members.length})
8588
9646
  }
8589
9647
 
8590
9648
  // src/commands/goals.ts
8591
- import { Command as Command27 } from "commander";
9649
+ import { Command as Command28 } from "commander";
8592
9650
  var GOAL_STATUSES = [
8593
9651
  "planned",
8594
9652
  "active",
@@ -8700,7 +9758,7 @@ function validateKeyResultUnit(value) {
8700
9758
  return value;
8701
9759
  }
8702
9760
  function createKeyResultsCommand() {
8703
- const kr = new Command27("kr").description(
9761
+ const kr = new Command28("kr").description(
8704
9762
  "Key results on an objective. Ids are CUIDs; --goal takes the objective's integer id."
8705
9763
  );
8706
9764
  kr.command("list").description("List key results").option("--goal <id>", "Objective ID (a number)").option("-w, --workspace <slug|id>", "Workspace (workspace-wide: every member's KRs)").option("--period <period>", "Period, e.g. Q3-2026").option("--status <status>", `Filter by status: ${KEY_RESULT_STATUSES.join(", ")}`).option("--mine", "Narrow a workspace list to key results you own").action(
@@ -8903,7 +9961,7 @@ function createKeyResultsCommand() {
8903
9961
  return kr;
8904
9962
  }
8905
9963
  function createGoalCommentsCommand() {
8906
- const comment = new Command27("comment").description(
9964
+ const comment = new Command28("comment").description(
8907
9965
  "Read and post comments on a goal. Mention teammates with --mention."
8908
9966
  );
8909
9967
  comment.command("list").description("List comments on a goal").requiredOption("--goal <id>", "Goal ID (a number)").action(async (options, cmd) => {
@@ -8998,7 +10056,7 @@ function createGoalCommentsCommand() {
8998
10056
  return comment;
8999
10057
  }
9000
10058
  function createGoalsCommand() {
9001
- const goals = new Command27("goals").description(
10059
+ const goals = new Command28("goals").description(
9002
10060
  "Manage goals (objectives) and their key results. Objectives have integer ids; key results are CUIDs."
9003
10061
  );
9004
10062
  goals.command("list").description(
@@ -9285,7 +10343,7 @@ Re-run with --with-key-results to go ahead, or move them with \`goals kr update
9285
10343
  return goals;
9286
10344
  }
9287
10345
  function createOkrsCommand() {
9288
- const okrs = new Command27("okrs").description(
10346
+ const okrs = new Command28("okrs").description(
9289
10347
  "OKRs \u2014 objectives with their key results nested. Manage the parts with `goals` and `goals kr`."
9290
10348
  );
9291
10349
  okrs.command("list").description(
@@ -9374,7 +10432,7 @@ function isBareVersionRequest(args) {
9374
10432
  return args.includes("--version") && args.every((arg) => arg.startsWith("-"));
9375
10433
  }
9376
10434
  function buildProgram() {
9377
- const program = new Command28();
10435
+ const program = new Command29();
9378
10436
  program.name("exponential").description(
9379
10437
  [
9380
10438
  "CLI to interact with Exponential productivity app.",
@@ -9387,6 +10445,7 @@ function buildProgram() {
9387
10445
  program.addCommand(createAuthCommand());
9388
10446
  program.addCommand(createActionsCommand());
9389
10447
  program.addCommand(createContactsCommand());
10448
+ program.addCommand(createCeremoniesCommand());
9390
10449
  program.addCommand(createDatabasesCommand());
9391
10450
  program.addCommand(createDecisionsCommand());
9392
10451
  program.addCommand(createDealsCommand());