lua-cli 3.39.1 → 3.39.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1586,6 +1586,7 @@ function utf8Bytes(value3) {
1586
1586
  }
1587
1587
  function isPlainFieldKey(key) {
1588
1588
  if (!LOG_FIELD_KEY_PATTERN.test(key)) return false;
1589
+ if (key === LOG_FIELDS_CLAMPED_KEY) return false;
1589
1590
  return !LOG_FIELD_SECRET_SHAPED_KEY_PATTERNS.some((pattern) => pattern.test(key));
1590
1591
  }
1591
1592
  function describeAgentLogFieldsViolation(value3) {
@@ -50379,7 +50380,7 @@ function wantsContent(options, sources) {
50379
50380
  return (sources ?? []).some((source) => LOG_DRAIN_CONTENT_SOURCES.includes(source));
50380
50381
  }
50381
50382
  __name(wantsContent, "wantsContent");
50382
- async function acknowledgeContent(options) {
50383
+ async function acknowledgeContent(options, becauseOfFlag = true, nothingHint = "Nothing was created") {
50383
50384
  emitAside("", options.json);
50384
50385
  emitAside(CONTENT_WARNING_TEXT, options.json);
50385
50386
  emitAside("", options.json);
@@ -50387,7 +50388,7 @@ async function acknowledgeContent(options) {
50387
50388
  emitAside("", options.json);
50388
50389
  if (options.yes) return true;
50389
50390
  if (isCiModeEnabled()) {
50390
- throw CliError.usage("--include-content needs the acknowledgement above; pass --yes to give it non-interactively.", "Nothing was created");
50391
+ throw CliError.usage(becauseOfFlag ? "--include-content needs the acknowledgement above; pass --yes to give it non-interactively." : "Selecting user_message or agent_response needs the acknowledgement above; pass --yes to give it non-interactively. (Content bodies stay OFF unless you also pass --include-content.)", nothingHint);
50391
50392
  }
50392
50393
  const answer = await safePrompt([
50393
50394
  {
@@ -50398,7 +50399,7 @@ async function acknowledgeContent(options) {
50398
50399
  }
50399
50400
  ]);
50400
50401
  if (!answer?.acknowledged) {
50401
- throw CliError.usage("Content was not enabled: the acknowledgement was declined.", "Nothing was created");
50402
+ throw CliError.usage("Content was not enabled: the acknowledgement was declined.", nothingHint);
50402
50403
  }
50403
50404
  return true;
50404
50405
  }
@@ -50675,8 +50676,9 @@ async function createDrainCore(context, options) {
50675
50676
  const agents = parseAgents(options.agents) ?? (context.agentId ? [
50676
50677
  context.agentId
50677
50678
  ] : "*");
50678
- const includeContent = wantsContent(options, sources);
50679
- const includeContentAck = includeContent ? await acknowledgeContent(options) : void 0;
50679
+ const touchesContent = wantsContent(options, sources);
50680
+ const includeContent = options.includeContent === true;
50681
+ const includeContentAck = touchesContent ? await acknowledgeContent(options, includeContent) : void 0;
50680
50682
  const input = {
50681
50683
  name,
50682
50684
  type,
@@ -50789,8 +50791,12 @@ async function updateDrainCore(context, drainId, options) {
50789
50791
  }
50790
50792
  patch.includeContent = false;
50791
50793
  } else if (wantsContent(options, sources)) {
50792
- patch.includeContent = true;
50793
- patch.includeContentAck = await acknowledgeContent(options);
50794
+ const includeContent = options.includeContent === true;
50795
+ const ack = await acknowledgeContent(options, includeContent);
50796
+ if (includeContent) {
50797
+ patch.includeContent = true;
50798
+ patch.includeContentAck = ack;
50799
+ }
50794
50800
  }
50795
50801
  if (Object.keys(patch).length === 0) {
50796
50802
  throw CliError.usage("Nothing to update \u2014 no field flags were given.", listHint("Changeable", [
@@ -51705,6 +51711,8 @@ var LOG_EXPORT_DOWNLOAD = {
51705
51711
  };
51706
51712
  var ALREADY_RUNNING = "EXPORT_ALREADY_RUNNING";
51707
51713
  var MISSING_EXPORT_SCOPE_MESSAGE = "Missing scope: logs:read. Create a key with that scope (lua auth key) or ask an org admin.";
51714
+ var EXPORT_CONTENT_FORBIDDEN = "EXPORT_CONTENT_FORBIDDEN";
51715
+ var MISSING_EXPORT_CONTENT_SCOPE_MESSAGE = "Missing scope: logs:manage. Create a key with that scope (lua auth key) or ask an org admin.";
51708
51716
  var TERMINAL2 = /* @__PURE__ */ new Set([
51709
51717
  "succeeded",
51710
51718
  "failed",
@@ -51721,6 +51729,10 @@ async function logsExportCommand(cmdObj) {
51721
51729
  }
51722
51730
  const sources = parseTypeFlag(options.type);
51723
51731
  const outDir = options.out ? resolveOutDir(String(options.out)) : void 0;
51732
+ const includeContent = options.includeContent === true;
51733
+ if (includeContent) {
51734
+ await acknowledgeContent(options, true, "Nothing was exported");
51735
+ }
51724
51736
  const context = await resolveDrainsContext(options);
51725
51737
  const api = new LogExportApi(BASE_URLS.API, context.apiKey, context.orgId);
51726
51738
  const say = /* @__PURE__ */ __name((line) => {
@@ -51729,7 +51741,8 @@ async function logsExportCommand(cmdObj) {
51729
51741
  const jobId = await startOrAttach(api, {
51730
51742
  from: since,
51731
51743
  to: until ?? (/* @__PURE__ */ new Date()).toISOString(),
51732
- sources
51744
+ sources,
51745
+ includeContent
51733
51746
  }, say);
51734
51747
  if (options.noWait || options.wait === false) {
51735
51748
  emit2(options, {
@@ -51740,7 +51753,8 @@ async function logsExportCommand(cmdObj) {
51740
51753
  trackEvent("cli_logs_export", {
51741
51754
  waited: false,
51742
51755
  json_output: !!options.json,
51743
- downloaded: 0
51756
+ downloaded: 0,
51757
+ include_content: includeContent
51744
51758
  });
51745
51759
  return;
51746
51760
  }
@@ -51781,7 +51795,8 @@ async function logsExportCommand(cmdObj) {
51781
51795
  waited: true,
51782
51796
  json_output: !!options.json,
51783
51797
  downloaded: written.length,
51784
- truncated: !!job.truncated
51798
+ truncated: !!job.truncated,
51799
+ include_content: includeContent
51785
51800
  });
51786
51801
  },
51787
51802
  "logs export",
@@ -51815,6 +51830,11 @@ async function startOrAttach(api, input, say) {
51815
51830
  to: input.to,
51816
51831
  ...input.sources ? {
51817
51832
  sources: input.sources
51833
+ } : {},
51834
+ // Only ever sent as `true` — PRO-2182. `false`/absent both mean "no content", and the
51835
+ // server's own default is `false`, so there is nothing an omitted key would lose.
51836
+ ...input.includeContent ? {
51837
+ includeContent: true
51818
51838
  } : {}
51819
51839
  };
51820
51840
  const started = await callExport(() => api.startExport(body));
@@ -51869,7 +51889,7 @@ async function callExport(call) {
51869
51889
  return await call();
51870
51890
  } catch (error) {
51871
51891
  if (CliError.isCliError(error) && error.statusCode === 403) {
51872
- throw CliError.forbidden(MISSING_EXPORT_SCOPE_MESSAGE);
51892
+ throw CliError.forbidden(error.serverCode === EXPORT_CONTENT_FORBIDDEN ? MISSING_EXPORT_CONTENT_SCOPE_MESSAGE : MISSING_EXPORT_SCOPE_MESSAGE);
51873
51893
  }
51874
51894
  throw error;
51875
51895
  }
@@ -57641,7 +57661,8 @@ async function resumeCore(ctx, runId, o) {
57641
57661
  };
57642
57662
  } else if (status === 409 && (code === "approval_requires_human" || code === "APPROVAL_REQUIRES_HUMAN")) {
57643
57663
  detail = {
57644
- message: `step "${o.step}" is an approval \u2014 resolve it with: lua workflows approve ${runId} --approval ${o.step} --decision approve`
57664
+ // BAC-504: approve takes the approval's wfa_… id, never the step id (the 409 envelope carries no approvalId)
57665
+ message: `step "${o.step}" is an approval \u2014 resolve it with the pending approval's wfa_\u2026 id: lua workflows approve ${runId} --approval <wfa_\u2026> --decision approve|deny (lua workflows status ${runId} --steps --json shows it as the suspended step's suspend.approvalId)`
57645
57666
  };
57646
57667
  } else if (status === 409 && (code === "use_signal_route" || code === "USE_SIGNAL_ROUTE")) {
57647
57668
  detail = {
@@ -65789,6 +65810,56 @@ var CALLBACK_HOST = "127.0.0.1";
65789
65810
  var CALLBACK_URL = `http://${CALLBACK_HOST}:${CALLBACK_PORT}/callback`;
65790
65811
  var AGENT_WEBHOOK_URL = `${BASE_URLS.API}/webhook/unifiedto/data`;
65791
65812
  var DEFAULT_VIRTUAL_WEBHOOK_INTERVAL = 1;
65813
+ var VIRTUAL_WEBHOOK_INTERVAL_CHOICES = [
65814
+ {
65815
+ name: "1 minute",
65816
+ value: 1
65817
+ },
65818
+ {
65819
+ name: "5 minutes",
65820
+ value: 5
65821
+ },
65822
+ {
65823
+ name: "10 minutes",
65824
+ value: 10
65825
+ },
65826
+ {
65827
+ name: "15 minutes",
65828
+ value: 15
65829
+ },
65830
+ {
65831
+ name: "30 minutes",
65832
+ value: 30
65833
+ },
65834
+ {
65835
+ name: "1 hour",
65836
+ value: 60
65837
+ },
65838
+ {
65839
+ name: "2 hours",
65840
+ value: 120
65841
+ },
65842
+ {
65843
+ name: "4 hours",
65844
+ value: 240
65845
+ },
65846
+ {
65847
+ name: "8 hours",
65848
+ value: 480
65849
+ },
65850
+ {
65851
+ name: "12 hours",
65852
+ value: 720
65853
+ },
65854
+ {
65855
+ name: "24 hours (1 day)",
65856
+ value: 1440
65857
+ },
65858
+ {
65859
+ name: "48 hours (2 days)",
65860
+ value: 2880
65861
+ }
65862
+ ];
65792
65863
  async function fetchAvailableIntegrations(unifiedToApi, agentId) {
65793
65864
  const result = await unifiedToApi.getAvailableIntegrations(agentId);
65794
65865
  if (!result.success || !result.data) {
@@ -68122,56 +68193,6 @@ Available trigger events for ${selectedConnection.integrationName || selectedCon
68122
68193
  }
68123
68194
  }
68124
68195
  let interval;
68125
- const intervalOptions = [
68126
- {
68127
- name: "1 minute",
68128
- value: 1
68129
- },
68130
- {
68131
- name: "5 minutes",
68132
- value: 5
68133
- },
68134
- {
68135
- name: "10 minutes",
68136
- value: 10
68137
- },
68138
- {
68139
- name: "15 minutes",
68140
- value: 15
68141
- },
68142
- {
68143
- name: "30 minutes",
68144
- value: 30
68145
- },
68146
- {
68147
- name: "1 hour",
68148
- value: 60
68149
- },
68150
- {
68151
- name: "2 hours",
68152
- value: 120
68153
- },
68154
- {
68155
- name: "4 hours",
68156
- value: 240
68157
- },
68158
- {
68159
- name: "8 hours",
68160
- value: 480
68161
- },
68162
- {
68163
- name: "12 hours",
68164
- value: 720
68165
- },
68166
- {
68167
- name: "24 hours (1 day)",
68168
- value: 1440
68169
- },
68170
- {
68171
- name: "48 hours (2 days)",
68172
- value: 2880
68173
- }
68174
- ];
68175
68196
  if (selectedEvent.webhookType === "virtual") {
68176
68197
  if (options.interval !== void 0) {
68177
68198
  interval = options.interval;
@@ -68181,8 +68202,10 @@ Available trigger events for ${selectedConnection.integrationName || selectedCon
68181
68202
  type: "list",
68182
68203
  name: "interval",
68183
68204
  message: "Select polling interval:",
68184
- choices: intervalOptions,
68185
- default: 1
68205
+ choices: [
68206
+ ...VIRTUAL_WEBHOOK_INTERVAL_CHOICES
68207
+ ],
68208
+ default: DEFAULT_VIRTUAL_WEBHOOK_INTERVAL
68186
68209
  }
68187
68210
  ]);
68188
68211
  if (!intervalAnswer) return;
@@ -68190,7 +68213,7 @@ Available trigger events for ${selectedConnection.integrationName || selectedCon
68190
68213
  }
68191
68214
  }
68192
68215
  const formatInterval = /* @__PURE__ */ __name((minutes) => {
68193
- const option = intervalOptions.find((o) => o.value === minutes);
68216
+ const option = VIRTUAL_WEBHOOK_INTERVAL_CHOICES.find((o) => o.value === minutes);
68194
68217
  return option ? option.name : `${minutes} minutes`;
68195
68218
  }, "formatInterval");
68196
68219
  if (!options.connectionId) {
@@ -71696,7 +71719,7 @@ Notes:
71696
71719
  shift the window. --type calls reads voice calls and ignores --since/--until/--environment
71697
71720
  /--follow. --since is INCLUSIVE; the boundary row is de-duplicated by id while following.
71698
71721
  `).action(logsCommand);
71699
- logsGroup.command("export").description("\u{1F4E6} Export this organization's logs as gzip NDJSON (asynchronous job)").option("--since <when>", "Inclusive lower bound (REQUIRED): an ISO 8601 instant, or 24h | 7d").option("--until <when>", "Inclusive upper bound; same formats (default: now)").option("--type <type>", "Comma-separated log sources, or all (default: all)").option("--out <dir>", "Download the parts into this directory (created if missing)").option("--org <id>", "The organization to export (default: the project, or the key when it reaches one org)").option("--no-wait", "Start the export and print the job id without polling it").option("--json", "Output as JSON").addHelpText("after", `
71722
+ logsGroup.command("export").description("\u{1F4E6} Export this organization's logs as gzip NDJSON (asynchronous job)").option("--since <when>", "Inclusive lower bound (REQUIRED): an ISO 8601 instant, or 24h | 7d").option("--until <when>", "Inclusive upper bound; same formats (default: now)").option("--type <type>", "Comma-separated log sources, or all (default: all)").option("--out <dir>", "Download the parts into this directory (created if missing)").option("--org <id>", "The organization to export (default: the project, or the key when it reaches one org)").option("--no-wait", "Start the export and print the job id without polling it").option("--include-content", "Include user_message / agent_response bodies (requires logs:manage; prints an acknowledgement)").option("-y, --yes", "Give the --include-content acknowledgement non-interactively").option("--json", "Output as JSON").addHelpText("after", `
71700
71723
  Options:
71701
71724
  --since <when> REQUIRED. Inclusive lower bound: an ISO 8601 instant, or 24h | 7d
71702
71725
  --until <when> Inclusive upper bound, same formats (default: now)
@@ -71704,19 +71727,26 @@ Options:
71704
71727
  --out <dir> Download every part into this local directory
71705
71728
  --org <id> The organization, when the key reaches more than one
71706
71729
  --no-wait Start it and print the job id; poll later
71730
+ --include-content Include user_message / agent_response bodies. Requires logs:manage;
71731
+ prints the same content warning and acknowledgement as
71732
+ lua drains create --include-content
71733
+ -y, --yes Give that acknowledgement non-interactively
71707
71734
  --json Output as JSON for scripting
71708
71735
 
71709
71736
  Examples:
71710
71737
  $ lua logs export --since 7d --out ./export A week, downloaded
71711
71738
  $ lua logs export --since 30d --type skill,job A month, two sources
71712
71739
  $ lua logs export --since 24h --no-wait --json Start it and return
71740
+ $ lua logs export --since 24h --include-content --yes Include message bodies (logs:manage)
71713
71741
 
71714
71742
  Notes:
71715
71743
  The window is at most 31 days and the job at most 10 000 000 records; narrow the window
71716
71744
  or the sources rather than raising either. One export runs per organization at a time \u2014
71717
71745
  a second invocation FOLLOWS the running one instead of refusing. Download links expire
71718
- 24 h after the export finishes and the files are removed after 7 days. Message bodies
71719
- are excluded unless the export was started with the logs:manage scope.
71746
+ 24 h after the export finishes and the files are removed after 7 days. Message bodies are
71747
+ EXCLUDED BY DEFAULT and only ever included when --include-content is passed AND the
71748
+ acknowledgement is given AND the credential holds logs:manage \u2014 the scope alone is not
71749
+ enough, the flag is required too.
71720
71750
  `).action((options, command) => logsExportCommand(withGroupOptions(options ?? {}, command)));
71721
71751
  program2.command("skills [actionOrEnv] [action]").description("\u2699\uFE0F Manage and view skills").option("--skill-name <name>", "Skill name").option("--skill-version <version>", "Version for deploy action (or 'latest')").addHelpText("after", `
71722
71752
  Arguments:
@@ -71840,7 +71870,7 @@ Examples:
71840
71870
  $ lua jobs versions -i myJob View job versions
71841
71871
  $ lua jobs history -i myJob View execution history
71842
71872
  `).action(jobsCommand);
71843
- program2.command("workflows [action] [target] [extra]").description("\u{1F9ED} Manage workflows and their runs (list, start, watch, cancel, resume, retry-step, resolve-step, raise-budget, approve, signal, replay, export, schedules)").option("-i, --workflow-name <name>", "Workflow name (or id)").option("-r, --run-id <id>", "Run id").option("-v, --workflow-version <ver>", "deploy/start/export/goals create/schedules create: a semver, 'latest' (newest push) or a version id").option("--json", "Print the raw {success,data} envelope").option("--all", "list: include dynamic workflows").option("--input <json|@file>", "start/run/goals create/schedules create: run input").option("--idempotency-key <key>", "start: idempotency key").option("--correlation-key <key>", "start/runs: correlation key").option("--tag <tag>", "start/runs/schedules create: tag (repeatable, \u2264 10)", collect, []).option("--budget-credits <n>", "start/schedules create: run budget (credits)").option("--wait <s>", "start: server long-poll \u2264 55 s").option("--follow", "start/logs: attach watch").option("--status <status>", "runs/goals list: filter by status").option("--workflow <name>", "runs: filter by workflow").option("--limit <n>", "runs/goals list/approval-payload --path: page size").option("--cursor <c>", "runs/goals list/approval-payload --path: page cursor").option("--sort <field>", "runs: -createdAt|createdAt|-durationMs|durationMs").option("--steps", "status: per-step table").option("--strict", "status: exit 4/5 by terminal status, 6 for a gated run").option("--compose <on|off>", "policy models set: may the composer be shown the model menu").option("--max-class <fast|balanced|strong>", "policy models set: ceiling for class requests and the class map").option("--consent-actions <n>", "policy models set: estimated actions above which a composed run shows the card").option("--allow <codes>", "policy models set: comma-separated approved codes to narrow the set to").option("--class-fast <codes>", "policy models set: ordered overrides of the fast class (comma-separated)").option("--class-balanced <codes>", "policy models set: ordered overrides of the balanced class (comma-separated)").option("--class-strong <codes>", "policy models set: ordered overrides of the strong class (comma-separated)").option("--class-map <pairs>", "policy models set: comma-separated <taskClass>=<modelClass> pairs").option("--pins <class-only|allowed>", "policy models set: may a composed definition pin a concrete code").option("--fallback <same-class|same-provider>", "policy models set: where a failed leg may hop to").option("--enabled <on|off>", "policy autonomy set: may a start inside the envelope skip the consent card").option("--max-duration <seconds>", "policy autonomy set: the envelope\u2019s duration bound, in seconds").option("--max-actions <n>", "policy autonomy set: the envelope\u2019s estimated-actions bound").option("--max-runs-per-hour <n>", "policy autonomy set: autonomous starts per hour, per agent").option("--forms <list>", "policy autonomy set: comma-separated forms the envelope admits (graph,script,static)").option("--clear <keys>", "policy autonomy set: comma-separated members to clear back to the platform default").option("--agent <agentId>", "policy autonomy: not supported \u2014 no route writes a per-agent envelope (see the refusal)").option("--kind <kind>", "clear-gate: the gate kind to clear (e.g. model_policy)").option("--after <seq>", "watch: replay from seq").option("--timeout <s>", "watch / start --follow: give up after s seconds while the run is still live (exit 7)").option("--events", "watch: print raw frames").option("--wait-for-human", "watch / start --follow: keep following through a human boundary (approval, input, signal, park) instead of exiting 8").option("--reason <text>", "cancel: reason").option("--step <id>", "resume/retry-step/resolve-step/logs: step id").option("--outcome <skip|complete|fail>", "resolve-step: the decision on the parked step (--action is accepted too)").option("--action <skip|complete|fail>", "resolve-step: alias of --outcome").option("--output <json|@file>", "resolve-step: the output a completed step would have produced (required with --outcome complete)").option("--credits <n>", "raise-budget: the new priced cap of a budget-parked run, in the run's own budget unit \u2014 credits, or actions on a seat plan (above the current one)").option("--max-steps <n>", "raise-budget: the new step cap").option("--max-job-seconds <n>", "raise-budget: the new Job-tier seconds cap").option("--max-duration-seconds <n>", "raise-budget: the new wall-clock cap").option("--data <json|@file>", "resume: resumeData").option("--approval <id>", "approve/approval-payload: approval id").option("--path <array.path>", "approval-payload: page one array of a large payload (--cursor / --limit inside it)").option("--decision <approve|deny>", "approve: decision (default approve)").option("--note <text>", "approve/retry-step/resolve-step/raise-budget/goals close: note").option("--edit <json|@file>", "approve: edited payload (small inline edits)").option("--fingerprint <f>", "approve: payloadFingerprint (mandatory with --edit)").option("--payload <json|@file>", "signal: payload").option("--dedupe-key <key>", "signal: dedupe key").option("--local", "replay: replay locally against the compiled artifact").option("--since <dur>", "logs: window").option("--yes", "delete/delete-run/schedules delete: skip confirmation").option("--force", "delete: cancel in-flight runs first \xB7 run: seed from a changed graph \xB7 export: overwrite files").option("--step-output <id=json>", "run: complete a step with this output (repeatable)", collect, []).option("--approve <id[=@payload]>", "run: pre-answer an approval (repeatable)", collect, []).option("--deny <id[=@reason]>", "run: pre-deny an approval (repeatable)", collect, []).option("--signal <name=json>", "run: pre-supply a waitForSignal payload (repeatable)", collect, []).option("--from-run <runId>", "run: seed completed steps from a real run").option("--record <dir>", "run: record agent/tool outputs as fixtures").option("--fixtures <dir>", "run: replay recorded fixtures").option("--step-wall <s>", "run: per-step wall in seconds (default 600)").option("--job-wall <s>", "run: virtual wall for tier:'job' steps \u2014 splits at 14400 s segments, > 86400 is exit 2").option("--ledger-out <file>", "run: write the in-memory ledger as JSON").option("--agents <fake|live>", "run: fake agent steps (default) or call the dev API").option("--now <iso>", "run: virtual clock start").option("--park <id>", "run: simulate a platform-fault park of this step (repeatable)", collect, []).option("--fast-retries", "run: collapse retry backoff waits to 0").option("--real-time", "run: actually wait on sleeps/backoffs instead of fast-forwarding").option("--artefacts-dir <dir>", "run: back ctx.artefacts.* on disk").option("--workspace <dir>", "run: the checkout Job-tier code steps run in (ctx.workspace + ctx.exec / ctx.$)").option("--env <KEY=value>", "run: local env.template() overlay (repeatable; missing key \u21D2 exit 2)", collect, []).option("--max-ticks <n>", "run (script form): tick cap before SCRIPT_TICK_LIMIT (default 64)").option("--until <iso>", "archive-runs: window end").option("--out <dir>", "archive-runs: destination dir (archive-index.ndjson + <runId>.zip) \xB7 export: target dir").option("--concurrency <n>", "archive-runs: parallel exports (default 2, max 5)").option("--no-inputs", "archive-runs: exclude run inputs from the bundle").option("--no-artefacts", "archive-runs: exclude artefacts from the bundle").option("--retention-days <n>", "archive-runs: org run retention (default 90) \u2014 --since must fit retention \u2212 7 d").option("--connection <id>", "archive-runs: org storage connection for s3:// / gs:// sinks").option("--release", "workspace: release the run workspace (R42)").option("--attempt <n>", "job-logs: attempt (default latest)").option("--tail <n>", "job-logs: log lines (1..2000, default 200)").option("--objective <text>", "goals create: the objective (\u2264 2000 chars)").option("--judge-predicate <spec>", "goals create: deterministic judge \u2014 '<path> <op> [value]' (e.g. 'output.done truthy'), JSON or @file").option("--judge-agent <agentId|'$self'>", "goals create: judge agent \u2014 write '$self' quoted (or self); it needs --judge-role").option("--judge-role <json|@file>", "goals create: D25 role {name,instructions,tools} for a '$self' judge").option("--schema <json|@file>", "goals create: judge output JsonSchema (must declare a boolean `done`)").option("--cadence <cron|json|@file>", "goals create/schedules create: cadence entry (repeatable, \u2264 5); goals: none \u21D2 immediate", collect, []).option("--timezone <tz>", "goals create/edit/schedules create: IANA timezone for bare cron cadences").option("--notify <emailApp|email|app|off>", "schedules create: where each fire notifies").option("--backfill-on-enable <n|none>", "schedules create/patch/resume: replay \u2264 n missed fires on re-enable (patch: none clears it)").option("--backfill-now", "schedules resume (or patch --paused false): one-shot backfill on THIS re-enable").option("--paused <true|false>", "schedules patch: pause (true) or re-enable (false) the schedule").option("--max-runs <n>", "goals create/edit/raise: iteration cap (1..100)").option("--max-total-credits <n>", "goals create: lineage-wide credit gate").option("--max-credits <n|none>", "goals edit/raise: lineage-wide credit gate (edit: none clears it)").option("--every <interval>", "goals edit/schedules create: interval cadence \u2014 900, 15m, 2h (whole minutes, \u2265 60s)").option("--if-match <updatedAt>", "goals edit/raise: refuse the write if the goal changed since this updatedAt").addHelpText("after", `
71873
+ program2.command("workflows [action] [target] [extra]").description("\u{1F9ED} Manage workflows and their runs (list, start, watch, cancel, resume, retry-step, resolve-step, raise-budget, approve, signal, replay, export, schedules)").option("-i, --workflow-name <name>", "Workflow name (or id)").option("-r, --run-id <id>", "Run id").option("-v, --workflow-version <ver>", "deploy/start/export/goals create/schedules create: a semver, 'latest' (newest push) or a version id").option("--json", "Print the raw {success,data} envelope").option("--all", "list: include dynamic workflows").option("--input <json|@file>", "start/run/goals create/schedules create: run input").option("--idempotency-key <key>", "start: idempotency key").option("--correlation-key <key>", "start/runs: correlation key").option("--tag <tag>", "start/runs/schedules create: tag (repeatable, \u2264 10)", collect, []).option("--budget-credits <n>", "start/schedules create: run budget (credits)").option("--wait <s>", "start: server long-poll \u2264 55 s").option("--follow", "start/logs: attach watch").option("--status <status>", "runs/goals list: filter by status").option("--workflow <name>", "runs: filter by workflow").option("--limit <n>", "runs/goals list/approval-payload --path: page size").option("--cursor <c>", "runs/goals list/approval-payload --path: page cursor").option("--sort <field>", "runs: -createdAt|createdAt|-durationMs|durationMs").option("--steps", "status: per-step table").option("--strict", "status: exit 4/5 by terminal status, 6 for a gated run").option("--compose <on|off>", "policy models set: may the composer be shown the model menu").option("--max-class <fast|balanced|strong>", "policy models set: ceiling for class requests and the class map").option("--consent-actions <n>", "policy models set: estimated actions above which a composed run shows the card").option("--allow <codes>", "policy models set: comma-separated approved codes to narrow the set to").option("--class-fast <codes>", "policy models set: ordered overrides of the fast class (comma-separated)").option("--class-balanced <codes>", "policy models set: ordered overrides of the balanced class (comma-separated)").option("--class-strong <codes>", "policy models set: ordered overrides of the strong class (comma-separated)").option("--class-map <pairs>", "policy models set: comma-separated <taskClass>=<modelClass> pairs").option("--pins <class-only|allowed>", "policy models set: may a composed definition pin a concrete code").option("--fallback <same-class|same-provider>", "policy models set: where a failed leg may hop to").option("--enabled <on|off>", "policy autonomy set: may a start inside the envelope skip the consent card").option("--max-duration <seconds>", "policy autonomy set: the envelope\u2019s duration bound, in seconds").option("--max-actions <n>", "policy autonomy set: the envelope\u2019s estimated-actions bound").option("--max-runs-per-hour <n>", "policy autonomy set: autonomous starts per hour, per agent").option("--forms <list>", "policy autonomy set: comma-separated forms the envelope admits (graph,script,static)").option("--clear <keys>", "policy autonomy set: comma-separated members to clear back to the platform default").option("--agent <agentId>", "policy autonomy: not supported \u2014 no route writes a per-agent envelope (see the refusal)").option("--kind <kind>", "clear-gate: the gate kind to clear (e.g. model_policy)").option("--after <seq>", "watch: replay from seq").option("--timeout <s>", "watch / start --follow: give up after s seconds while the run is still live (exit 7)").option("--events", "watch: print raw frames").option("--wait-for-human", "watch / start --follow: keep following through a human boundary (approval, input, signal, park) instead of exiting 8").option("--reason <text>", "cancel: reason").option("--step <id>", "resume/retry-step/resolve-step/logs: step id").option("--outcome <skip|complete|fail>", "resolve-step: the decision on the parked step (--action is accepted too)").option("--action <skip|complete|fail>", "resolve-step: alias of --outcome").option("--output <json|@file>", "resolve-step: the output a completed step would have produced (required with --outcome complete)").option("--credits <n>", "raise-budget: the new priced cap of a budget-parked run, in the run's own budget unit \u2014 credits, or actions on a seat plan (above the current one)").option("--max-steps <n>", "raise-budget: the new step cap").option("--max-job-seconds <n>", "raise-budget: the new Job-tier seconds cap").option("--max-duration-seconds <n>", "raise-budget: the new wall-clock cap").option("--data <json|@file>", "resume: resumeData").option("--approval <id>", "approve/approval-payload: the wfa_\u2026 approval id (lua workflows status <runId> --steps --json \u2192 suspend.approvalId), not the step id").option("--path <array.path>", "approval-payload: page one array of a large payload (--cursor / --limit inside it)").option("--decision <approve|deny>", "approve: decision (default approve)").option("--note <text>", "approve/retry-step/resolve-step/raise-budget/goals close: note").option("--edit <json|@file>", "approve: edited payload (small inline edits)").option("--fingerprint <f>", "approve: payloadFingerprint (mandatory with --edit)").option("--payload <json|@file>", "signal: payload").option("--dedupe-key <key>", "signal: dedupe key").option("--local", "replay: replay locally against the compiled artifact").option("--since <dur>", "logs: window").option("--yes", "delete/delete-run/schedules delete: skip confirmation").option("--force", "delete: cancel in-flight runs first \xB7 run: seed from a changed graph \xB7 export: overwrite files").option("--step-output <id=json>", "run: complete a step with this output (repeatable)", collect, []).option("--approve <id[=@payload]>", "run: pre-answer an approval (repeatable)", collect, []).option("--deny <id[=@reason]>", "run: pre-deny an approval (repeatable)", collect, []).option("--signal <name=json>", "run: pre-supply a waitForSignal payload (repeatable)", collect, []).option("--from-run <runId>", "run: seed completed steps from a real run").option("--record <dir>", "run: record agent/tool outputs as fixtures").option("--fixtures <dir>", "run: replay recorded fixtures").option("--step-wall <s>", "run: per-step wall in seconds (default 600)").option("--job-wall <s>", "run: virtual wall for tier:'job' steps \u2014 splits at 14400 s segments, > 86400 is exit 2").option("--ledger-out <file>", "run: write the in-memory ledger as JSON").option("--agents <fake|live>", "run: fake agent steps (default) or call the dev API").option("--now <iso>", "run: virtual clock start").option("--park <id>", "run: simulate a platform-fault park of this step (repeatable)", collect, []).option("--fast-retries", "run: collapse retry backoff waits to 0").option("--real-time", "run: actually wait on sleeps/backoffs instead of fast-forwarding").option("--artefacts-dir <dir>", "run: back ctx.artefacts.* on disk").option("--workspace <dir>", "run: the checkout Job-tier code steps run in (ctx.workspace + ctx.exec / ctx.$)").option("--env <KEY=value>", "run: local env.template() overlay (repeatable; missing key \u21D2 exit 2)", collect, []).option("--max-ticks <n>", "run (script form): tick cap before SCRIPT_TICK_LIMIT (default 64)").option("--until <iso>", "archive-runs: window end").option("--out <dir>", "archive-runs: destination dir (archive-index.ndjson + <runId>.zip) \xB7 export: target dir").option("--concurrency <n>", "archive-runs: parallel exports (default 2, max 5)").option("--no-inputs", "archive-runs: exclude run inputs from the bundle").option("--no-artefacts", "archive-runs: exclude artefacts from the bundle").option("--retention-days <n>", "archive-runs: org run retention (default 90) \u2014 --since must fit retention \u2212 7 d").option("--connection <id>", "archive-runs: org storage connection for s3:// / gs:// sinks").option("--release", "workspace: release the run workspace (R42)").option("--attempt <n>", "job-logs: attempt (default latest)").option("--tail <n>", "job-logs: log lines (1..2000, default 200)").option("--objective <text>", "goals create: the objective (\u2264 2000 chars)").option("--judge-predicate <spec>", "goals create: deterministic judge \u2014 '<path> <op> [value]' (e.g. 'output.done truthy'), JSON or @file").option("--judge-agent <agentId|'$self'>", "goals create: judge agent \u2014 write '$self' quoted (or self); it needs --judge-role").option("--judge-role <json|@file>", "goals create: D25 role {name,instructions,tools} for a '$self' judge").option("--schema <json|@file>", "goals create: judge output JsonSchema (must declare a boolean `done`)").option("--cadence <cron|json|@file>", "goals create/schedules create: cadence entry (repeatable, \u2264 5); goals: none \u21D2 immediate", collect, []).option("--timezone <tz>", "goals create/edit/schedules create: IANA timezone for bare cron cadences").option("--notify <emailApp|email|app|off>", "schedules create: where each fire notifies").option("--backfill-on-enable <n|none>", "schedules create/patch/resume: replay \u2264 n missed fires on re-enable (patch: none clears it)").option("--backfill-now", "schedules resume (or patch --paused false): one-shot backfill on THIS re-enable").option("--paused <true|false>", "schedules patch: pause (true) or re-enable (false) the schedule").option("--max-runs <n>", "goals create/edit/raise: iteration cap (1..100)").option("--max-total-credits <n>", "goals create: lineage-wide credit gate").option("--max-credits <n|none>", "goals edit/raise: lineage-wide credit gate (edit: none clears it)").option("--every <interval>", "goals edit/schedules create: interval cadence \u2014 900, 15m, 2h (whole minutes, \u2265 60s)").option("--if-match <updatedAt>", "goals edit/raise: refuse the write if the goal changed since this updatedAt").addHelpText("after", `
71844
71874
  Arguments:
71845
71875
  action list \xB7 view \xB7 versions \xB7 deploy \xB7 activate \xB7 deactivate \xB7 start \xB7 run \xB7 runs \xB7 status \xB7
71846
71876
  watch \xB7 cancel \xB7 resume \xB7 retry-step \xB7 resolve-step \xB7 raise-budget \xB7 approve \xB7 approval-payload \xB7
@@ -71880,7 +71910,7 @@ Examples:
71880
71910
  $ lua workflows resolve-step <runId> --step sendEmails --outcome complete --output '{"sent":0}'
71881
71911
  $ lua workflows raise-budget <runId> --credits 20
71882
71912
  $ lua workflows approval-payload <runId> --approval wfa_1234
71883
- $ lua workflows approve <runId> --approval reviewDrafts --decision approve
71913
+ $ lua workflows approve <runId> --approval wfa_1234 --decision approve
71884
71914
  $ lua workflows signal <runId> review --payload '{"ok":true}'
71885
71915
  $ lua workflows replay <runId> --local
71886
71916
  $ lua workflows deploy outreach -v latest
@@ -71975,7 +72005,7 @@ Examples:
71975
72005
  $ lua mcp deactivate --server-name api-server Deactivate a server
71976
72006
  $ lua mcp delete --server-name old-server Delete a server
71977
72007
  `).action(mcpCommand);
71978
- program2.command("integrations [action] [subaction]").description("\u{1F517} Connect third-party integrations via Unified.to").option("--integration <type>", "Integration type (e.g., linear, googlecalendar)").option("--auth-method <method>", "Authentication method: 'oauth' or 'token'").option("--scopes <scopes>", "Comma-separated OAuth scopes (or 'all' for all scopes)").option("--hide-sensitive <bool>", "Hide sensitive data from MCP tools (default: true)").option("--account-label <label>", "Account label used to distinguish multiple connected accounts").option("--scope <scope>", "Who owns the connection: 'agent' (default) or 'user'").option("--force", "Skip the confirmation prompt (for convert)").option("--connection-id <id>", "Exact connection ID to update, disconnect, convert or pause/resume").option("--connection <id>", "Connection ID for trigger").option("--webhook-id <id>", "Trigger ID to delete/pause/resume").option("--object <type>", "Object type for webhook (e.g., task_task, calendar_event)").option("--event <type>", "Event type for webhook: created, updated, or deleted").option("--hook-url <url>", "Custom webhook URL (default: agent trigger)").option("--interval <minutes>", "Polling interval for virtual webhooks (60, 120, 240, 480, 720, 1440, 2880)").option("--triggers <events>", "Comma-separated triggers (e.g., task_task.created,task_task.updated)").option("--custom-webhook", "Use custom webhook URL instead of agent trigger").option("--json", "Output as JSON (for info and webhooks events commands)").option("--reason <text>", "Optional reason for pausing a trigger").addHelpText("after", `
72008
+ program2.command("integrations [action] [subaction]").description("\u{1F517} Connect third-party integrations via Unified.to").option("--integration <type>", "Integration type (e.g., linear, googlecalendar)").option("--auth-method <method>", "Authentication method: 'oauth' or 'token'").option("--scopes <scopes>", "Comma-separated OAuth scopes (or 'all' for all scopes)").option("--hide-sensitive <bool>", "Hide sensitive data from MCP tools (default: true)").option("--account-label <label>", "Account label used to distinguish multiple connected accounts").option("--scope <scope>", "Who owns the connection: 'agent' (default) or 'user'").option("--force", "Skip the confirmation prompt (for convert)").option("--connection-id <id>", "Exact connection ID to update, disconnect, convert or pause/resume").option("--connection <id>", "Connection ID for trigger").option("--webhook-id <id>", "Trigger ID to delete/pause/resume").option("--object <type>", "Object type for webhook (e.g., task_task, calendar_event)").option("--event <type>", "Event type for webhook: created, updated, or deleted").option("--hook-url <url>", "Custom webhook URL (default: agent trigger)").option("--interval <minutes>", "Polling interval in minutes for virtual webhooks, 1-2880 (default 1; e.g. 1, 5, 15, 60, 1440, 2880)").option("--triggers <events>", "Comma-separated triggers (e.g., task_task.created,task_task.updated)").option("--custom-webhook", "Use custom webhook URL instead of agent trigger").option("--json", "Output as JSON (for info and webhooks events commands)").option("--reason <text>", "Optional reason for pausing a trigger").addHelpText("after", `
71979
72009
  Arguments:
71980
72010
  action Optional: 'connect', 'update', 'list', 'available', 'info', 'disconnect',
71981
72011
  'convert', 'webhooks' (alias: 'triggers'), or 'mcp'
@@ -72002,7 +72032,7 @@ Webhook/Trigger Options:
72002
72032
  --webhook-id <id> Trigger ID to delete
72003
72033
  --object <type> Object type (task_task, calendar_event, messaging_message, etc.)
72004
72034
  --event <type> Event type: created, updated, or deleted
72005
- --interval <minutes> Polling interval for virtual webhooks (60=1h, 120=2h, etc.)
72035
+ --interval <minutes> Polling interval in minutes for virtual webhooks, 1-2880 (default 1; e.g. 1, 5, 15, 60, 1440, 2880)
72006
72036
 
72007
72037
  Note: Multiple accounts of one integration are supported; use --connection-id when updating one.
72008
72038
  Note: Triggers, account labels and --hide-sensitive are agent-scoped; they don't apply to --scope user.
@@ -72031,6 +72061,7 @@ Webhook/Trigger Examples ('triggers' is an alias for 'webhooks'):
72031
72061
  $ lua integrations triggers list Same, via the 'triggers' alias
72032
72062
  $ lua integrations webhooks events --integration linear List available events
72033
72063
  $ lua integrations webhooks create Create trigger (interactive)
72064
+ $ lua integrations webhooks create --connection abc123 --object task_task --event created --interval 5
72034
72065
  $ lua integrations webhooks delete --webhook-id wh_xyz789
72035
72066
  $ lua integrations webhooks pause --webhook-id wh_xyz789
72036
72067
  $ lua integrations webhooks pause --connection-id abc123 Pause all triggers for a connection