exponential-cli 1.30.0 → 1.31.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/README.md CHANGED
@@ -78,6 +78,15 @@ exponential actions update --id <action-id> -n "New name" --priority "2nd Priori
78
78
  exponential actions update --id <action-id> --scheduled-start 2026-08-05T09:00
79
79
  exponential actions update --id <action-id> --scheduled-start null # clear it
80
80
 
81
+ # Assign people (user id or email; repeat the flag or comma-separate).
82
+ # On create the assignees land with the action. On update --assignee is additive:
83
+ # existing assignees stay. --unassign removes; --clear-assignees removes everyone,
84
+ # and runs first, so --clear-assignees --assignee <x> leaves exactly <x>.
85
+ exponential actions create -n "Follow up" -p <project-id> --assignee ada@example.com
86
+ exponential actions update --id <action-id> --assignee <user-id> --assignee bob@example.com
87
+ exponential actions update --id <action-id> --unassign bob@example.com
88
+ exponential actions update --id <action-id> --clear-assignees
89
+
81
90
  # What's actually on your plate: overdue + today + inbox
82
91
  exponential actions today
83
92
 
package/dist/index.js CHANGED
@@ -3207,6 +3207,7 @@ function createAuthCommand() {
3207
3207
 
3208
3208
  // src/commands/actions.ts
3209
3209
  import { Command as Command3 } from "commander";
3210
+ import { splitAssigneeRefs } from "exponential-sdk";
3210
3211
  var VALID_PRIORITIES = [
3211
3212
  "Quick",
3212
3213
  "Scheduled",
@@ -3236,6 +3237,10 @@ function parseIds(raw) {
3236
3237
  }
3237
3238
  return ids;
3238
3239
  }
3240
+ function collect(value, previous = []) {
3241
+ return [...previous, value];
3242
+ }
3243
+ var ASSIGNEE_REF_HELP = "user id or email; repeat the flag or comma-separate values";
3239
3244
  function createActionsCommand() {
3240
3245
  const actions = new Command3("actions").description("Manage actions/tasks");
3241
3246
  actions.command("list").description("List all actions").option("--project <id>", "Filter by project ID").option("--status <status>", "Filter by kanban status (BACKLOG, TODO, IN_PROGRESS, IN_REVIEW, DONE)").option("--assignee <id>", "Filter by assignee ID").action(async (options, cmd) => {
@@ -3379,7 +3384,7 @@ function createActionsCommand() {
3379
3384
  handleError(error, useJson);
3380
3385
  }
3381
3386
  });
3382
- actions.command("update").description("Update an existing action").requiredOption("--id <id>", "Action ID to update").option("-n, --name <name>", "New action name").option("-d, --description <text>", "New description").option("-p, --project <id>", "Move to project ID").option("--priority <priority>", "Priority (Quick, Scheduled, 1st Priority, etc.)").option("--status <status>", "Status (ACTIVE, COMPLETED, CANCELLED)").option("--kanban <status>", "Kanban status (BACKLOG, TODO, IN_PROGRESS, IN_REVIEW, DONE)").option("--due <date>", 'Due date (YYYY-MM-DD or "null" to clear)').option("--scheduled-start <datetime>", 'Do-date: when you plan to work on it (YYYY-MM-DD, ISO datetime, or "null" to clear). This is what /today partitions on.').option("--scheduled-end <datetime>", 'End of the time block (YYYY-MM-DD, ISO datetime, or "null" to clear)').action(async (options, cmd) => {
3387
+ actions.command("update").description("Update an existing action").requiredOption("--id <id>", "Action ID to update").option("-n, --name <name>", "New action name").option("-d, --description <text>", "New description").option("-p, --project <id>", "Move to project ID").option("--priority <priority>", "Priority (Quick, Scheduled, 1st Priority, etc.)").option("--status <status>", "Status (ACTIVE, COMPLETED, CANCELLED)").option("--kanban <status>", "Kanban status (BACKLOG, TODO, IN_PROGRESS, IN_REVIEW, DONE)").option("--due <date>", 'Due date (YYYY-MM-DD or "null" to clear)').option("--scheduled-start <datetime>", 'Do-date: when you plan to work on it (YYYY-MM-DD, ISO datetime, or "null" to clear). This is what /today partitions on.').option("--scheduled-end <datetime>", 'End of the time block (YYYY-MM-DD, ISO datetime, or "null" to clear)').option("--assignee <ref>", `Add an assignee (${ASSIGNEE_REF_HELP}). Additive: existing assignees stay. Must be assignable in the action's project or workspace`, collect).option("--unassign <ref>", `Remove an assignee (${ASSIGNEE_REF_HELP}). Users not assigned are ignored`, collect).option("--clear-assignees", "Remove every assignee (runs before --assignee, so the two together replace the set)").action(async (options, cmd) => {
3383
3388
  const globalOpts = cmd.optsWithGlobals();
3384
3389
  const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);
3385
3390
  try {
@@ -3398,8 +3403,7 @@ function createActionsCommand() {
3398
3403
  const scheduledStart = parseNullableDate(options.scheduledStart, "scheduled-start");
3399
3404
  const scheduledEnd = parseNullableDate(options.scheduledEnd, "scheduled-end");
3400
3405
  const client = getClient();
3401
- const action = await client.actions.update({
3402
- id: options.id,
3406
+ const fieldPatch = {
3403
3407
  name: options.name,
3404
3408
  description: options.description,
3405
3409
  projectId: options.project,
@@ -3409,18 +3413,26 @@ function createActionsCommand() {
3409
3413
  dueDate,
3410
3414
  scheduledStart,
3411
3415
  scheduledEnd
3412
- });
3416
+ };
3417
+ const hasFieldChanges = Object.values(fieldPatch).some((v) => v !== void 0);
3418
+ const hasAssigneeChanges = Boolean(options.clearAssignees || options.unassign?.length || options.assignee?.length);
3419
+ let action;
3420
+ if (hasFieldChanges || !hasAssigneeChanges) {
3421
+ action = await client.actions.update({ id: options.id, ...fieldPatch });
3422
+ }
3423
+ const assigned = await applyAssigneeChanges(client, options.id, options);
3424
+ const result = assigned ?? action;
3413
3425
  if (useJson) {
3414
- outputActionJson(action);
3426
+ outputActionJson(result);
3415
3427
  } else {
3416
3428
  console.log("\n\u2713 Action updated successfully");
3417
- outputActionPretty(action);
3429
+ outputActionPretty(result);
3418
3430
  }
3419
3431
  } catch (error) {
3420
3432
  handleError(error, useJson);
3421
3433
  }
3422
3434
  });
3423
- actions.command("create").description("Create a new action").requiredOption("-n, --name <name>", "Action name/title").option("-d, --description <text>", "Action description").option("-p, --project <id>", "Project ID to assign the action to").option("--priority <priority>", "Priority (Quick, Scheduled, 1st Priority, etc.)").option("--due <date>", "Due date (YYYY-MM-DD)").option("--effort <minutes>", "Effort estimate in minutes", parseInt).option("--ticket <id>", "Link action to a product ticket (CUID) after creation").option("--epic <id>", "Epic CUID to attach the action to").action(async (options, cmd) => {
3435
+ actions.command("create").description("Create a new action").requiredOption("-n, --name <name>", "Action name/title").option("-d, --description <text>", "Action description").option("-p, --project <id>", "Project ID to assign the action to").option("--priority <priority>", "Priority (Quick, Scheduled, 1st Priority, etc.)").option("--due <date>", "Due date (YYYY-MM-DD)").option("--effort <minutes>", "Effort estimate in minutes", parseInt).option("--ticket <id>", "Link action to a product ticket (CUID) after creation").option("--epic <id>", "Epic CUID to attach the action to").option("--assignee <ref>", `Assign the new action (${ASSIGNEE_REF_HELP}). Each must be assignable in the project or workspace, or nothing is created`, collect).action(async (options, cmd) => {
3424
3436
  const globalOpts = cmd.optsWithGlobals();
3425
3437
  const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);
3426
3438
  try {
@@ -3442,7 +3454,8 @@ function createActionsCommand() {
3442
3454
  priority: options.priority,
3443
3455
  dueDate,
3444
3456
  effortEstimate: options.effort,
3445
- epicId: options.epic
3457
+ epicId: options.epic,
3458
+ ...assigneesForCreate(options.assignee)
3446
3459
  });
3447
3460
  if (options.ticket) {
3448
3461
  action = await client.tickets.linkAction(options.ticket, action.id);
@@ -3555,6 +3568,27 @@ function createActionsCommand() {
3555
3568
  actions.addCommand(comment);
3556
3569
  return actions;
3557
3570
  }
3571
+ function assigneesForCreate(refs) {
3572
+ if (!refs?.length) return {};
3573
+ const { userIds, emails } = splitAssigneeRefs(refs);
3574
+ return {
3575
+ ...userIds.length ? { assigneeIds: userIds } : {},
3576
+ ...emails.length ? { assigneeEmails: emails } : {}
3577
+ };
3578
+ }
3579
+ async function applyAssigneeChanges(client, actionId, options) {
3580
+ let result;
3581
+ if (options.clearAssignees) {
3582
+ result = await client.actions.unassign(actionId, { all: true });
3583
+ }
3584
+ if (options.unassign?.length) {
3585
+ result = await client.actions.unassign(actionId, splitAssigneeRefs(options.unassign));
3586
+ }
3587
+ if (options.assignee?.length) {
3588
+ result = await client.actions.assign(actionId, splitAssigneeRefs(options.assignee));
3589
+ }
3590
+ return result;
3591
+ }
3558
3592
 
3559
3593
  // src/commands/contacts.ts
3560
3594
  import { Command as Command4 } from "commander";
@@ -3804,7 +3838,7 @@ function parseIntInRange(value, flag, min, max) {
3804
3838
  }
3805
3839
  return n;
3806
3840
  }
3807
- var collect = (value, previous) => [...previous, value];
3841
+ var collect2 = (value, previous) => [...previous, value];
3808
3842
  var DATE_ONLY = /^\d{4}-\d{2}-\d{2}$/;
3809
3843
  function parseCalendarDate(value) {
3810
3844
  const parsed = parseDate(value);
@@ -3883,7 +3917,7 @@ function addDefinitionOptions(cmd) {
3883
3917
  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(
3884
3918
  "--cadence <rrule>",
3885
3919
  'RRULE body, e.g. "FREQ=WEEKLY;BYDAY=MO;BYHOUR=10;BYMINUTE=0"'
3886
- ).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");
3920
+ ).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)", collect2, []).option("--project <projectId>", "Reviewed project id (repeatable; replaces the set on update)", collect2, []).option("--alias <title>", "Meeting-title alias for auto-attach (repeatable; replaces the set on update)", collect2, []).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");
3887
3921
  }
3888
3922
  function definitionFields(options, cmd) {
3889
3923
  const fields = {};
@@ -4061,7 +4095,7 @@ function createOccurrencesCommand() {
4061
4095
  "No flags: show it. --draft: fill a draft from your activity since the last occurrence.",
4062
4096
  "--answer key=markdown (repeatable) saves answers; --submit / --reopen changes its state."
4063
4097
  ].join(" ")
4064
- ).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(
4098
+ ).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)", collect2, []).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(
4065
4099
  async (value, options, cmd) => {
4066
4100
  const globalOpts = cmd.optsWithGlobals();
4067
4101
  const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);
@@ -4544,7 +4578,7 @@ var ADDABLE_TYPES = [
4544
4578
  "lastEditedTime",
4545
4579
  "createdBy"
4546
4580
  ];
4547
- function collect2(value, previous) {
4581
+ function collect3(value, previous) {
4548
4582
  return [...previous, value];
4549
4583
  }
4550
4584
  function parseLimit(value) {
@@ -4851,7 +4885,7 @@ function createRowsCommand() {
4851
4885
  );
4852
4886
  rows.command("list <databaseId>").description(
4853
4887
  'Rows through the saved view, or with your own --filter/--sort: "Status=Tracked", "Score>5", "Owner!=", "Name~latency", "Status in Tracked,Instrumenting".'
4854
- ).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(
4888
+ ).option("--filter <expr>", "Filter (repeatable); replaces the saved filters", collect3, []).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(
4855
4889
  async (databaseId, options, cmd) => {
4856
4890
  const globalOpts = cmd.optsWithGlobals();
4857
4891
  const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);
@@ -4872,7 +4906,7 @@ function createRowsCommand() {
4872
4906
  );
4873
4907
  rows.command("add <databaseId>").description(
4874
4908
  '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).'
4875
- ).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) => {
4909
+ ).option("--set <Property=value>", "A cell value (repeatable)", collect3, []).option("-n, --note <text>", "Why: recorded on the row page's first revision").action(async (databaseId, options, cmd) => {
4876
4910
  const globalOpts = cmd.optsWithGlobals();
4877
4911
  const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);
4878
4912
  try {
@@ -4889,7 +4923,7 @@ function createRowsCommand() {
4889
4923
  });
4890
4924
  rows.command("import <databaseId>").description(
4891
4925
  '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.'
4892
- ).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(
4926
+ ).requiredOption("--csv <file>", "The CSV file, or - for stdin").option("--map <Col=Property>", "Send a column to an existing property (repeatable)", collect3, []).option("--new <Col=type>", "Create a property for a column (repeatable)", collect3, []).option("--skip <Col>", "Leave a column out (repeatable)", collect3, []).option("--dry-run", "Preview only: type every row, create nothing").option("-n, --note <text>", "Why: recorded on each new row's first revision").action(
4893
4927
  async (databaseId, options, cmd) => {
4894
4928
  const globalOpts = cmd.optsWithGlobals();
4895
4929
  const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);
@@ -4920,7 +4954,7 @@ function createRowsCommand() {
4920
4954
  }
4921
4955
  }
4922
4956
  );
4923
- 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(
4957
+ 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)", collect3, []).option("--clear <Property>", "Empty a cell (repeatable)", collect3, []).option("-n, --note <text>", "Why: shown in the row page's history").action(
4924
4958
  async (rowId, options, cmd) => {
4925
4959
  const globalOpts = cmd.optsWithGlobals();
4926
4960
  const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);