@skrr-ai/cli 0.1.142 → 0.1.144

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (156) hide show
  1. package/README.md +8 -0
  2. package/dist/base-command.d.ts +4 -2
  3. package/dist/base-command.js +46 -13
  4. package/dist/commands/agenda/trigger/create.js +4 -2
  5. package/dist/commands/agenda/trigger/list.js +7 -7
  6. package/dist/commands/agent/message/approve.d.ts +17 -0
  7. package/dist/commands/agent/message/approve.js +72 -0
  8. package/dist/commands/agent/message/decline.d.ts +17 -0
  9. package/dist/commands/agent/message/decline.js +72 -0
  10. package/dist/commands/agent/message/pending.d.ts +18 -0
  11. package/dist/commands/agent/message/pending.js +79 -0
  12. package/dist/commands/agents/always-on/disable.js +9 -1
  13. package/dist/commands/agents/always-on/enable.js +9 -1
  14. package/dist/commands/agents/always-on/status.js +14 -1
  15. package/dist/commands/agents/create.js +10 -1
  16. package/dist/commands/agents/delete.d.ts +51 -0
  17. package/dist/commands/agents/delete.js +163 -2
  18. package/dist/commands/agents/intuitions/list.js +1 -1
  19. package/dist/commands/agents/plan-day.d.ts +39 -7
  20. package/dist/commands/agents/plan-day.js +254 -65
  21. package/dist/commands/agents/proactive-audit.d.ts +22 -0
  22. package/dist/commands/agents/proactive-audit.js +86 -0
  23. package/dist/commands/agents/schedule-overview.d.ts +7 -0
  24. package/dist/commands/agents/schedule-overview.js +43 -5
  25. package/dist/commands/agents/schedule-trace.js +30 -19
  26. package/dist/commands/agents/spawn.d.ts +51 -0
  27. package/dist/commands/agents/spawn.js +212 -9
  28. package/dist/commands/agents/todos/cancel.js +3 -0
  29. package/dist/commands/agents/todos/edit.js +1 -1
  30. package/dist/commands/agents/todos/list.d.ts +5 -0
  31. package/dist/commands/agents/todos/list.js +19 -5
  32. package/dist/commands/agents/triggers/create.js +1 -1
  33. package/dist/commands/agents/triggers/policy.js +7 -0
  34. package/dist/commands/agents/triggers/update.js +1 -1
  35. package/dist/commands/commitments/create.js +13 -3
  36. package/dist/commands/commitments/preflight.js +31 -5
  37. package/dist/commands/daemon/index.js +1 -0
  38. package/dist/commands/daemon/logs.d.ts +8 -1
  39. package/dist/commands/daemon/logs.js +32 -22
  40. package/dist/commands/daemon/profile.d.ts +15 -0
  41. package/dist/commands/daemon/profile.js +51 -0
  42. package/dist/commands/goals/briefing/status.js +1 -1
  43. package/dist/commands/initiatives/worker/deactivate.d.ts +23 -0
  44. package/dist/commands/initiatives/worker/deactivate.js +78 -0
  45. package/dist/commands/login.js +8 -2
  46. package/dist/commands/logout.d.ts +20 -0
  47. package/dist/commands/logout.js +110 -5
  48. package/dist/commands/machines/profiles/disconnect.d.ts +23 -0
  49. package/dist/commands/machines/profiles/disconnect.js +102 -0
  50. package/dist/commands/machines/profiles/index.d.ts +15 -0
  51. package/dist/commands/machines/profiles/index.js +33 -0
  52. package/dist/commands/machines/profiles/label.d.ts +24 -0
  53. package/dist/commands/machines/profiles/label.js +85 -0
  54. package/dist/commands/machines/profiles/list.d.ts +16 -0
  55. package/dist/commands/machines/profiles/list.js +87 -0
  56. package/dist/commands/memory/maintain.js +16 -2
  57. package/dist/commands/profiles/list.js +17 -2
  58. package/dist/commands/spaces/delete.js +6 -1
  59. package/dist/commands/spaces/workflows/archive.js +6 -1
  60. package/dist/commands/spaces/workflows/publish.js +3 -1
  61. package/dist/commands/spaces/workflows/run.d.ts +1 -0
  62. package/dist/commands/spaces/workflows/run.js +17 -1
  63. package/dist/commands/spaces/workflows/triggers/create.js +3 -1
  64. package/dist/commands/tasks/workflow-context.js +3 -1
  65. package/dist/commands/triggers/authorization.js +1 -1
  66. package/dist/commands/triggers/capabilities.js +17 -1
  67. package/dist/commands/triggers/create.d.ts +2 -0
  68. package/dist/commands/triggers/create.js +23 -7
  69. package/dist/commands/triggers/fire-detail.js +12 -3
  70. package/dist/commands/triggers/list.d.ts +1 -0
  71. package/dist/commands/triggers/list.js +13 -1
  72. package/dist/commands/triggers/preflight.js +18 -0
  73. package/dist/commands/triggers/prune.js +9 -5
  74. package/dist/commands/triggers/update.js +13 -4
  75. package/dist/generated/agent-guides.json +35 -35
  76. package/dist/lib/agent-guides.js +1 -1
  77. package/dist/lib/agent-proactive-baseline.d.ts +6 -0
  78. package/dist/lib/agent-proactive-baseline.js +32 -3
  79. package/dist/lib/always-on-command-result.d.ts +18 -0
  80. package/dist/lib/always-on-command-result.js +52 -0
  81. package/dist/lib/always-on-runtime.d.ts +31 -0
  82. package/dist/lib/always-on-runtime.js +39 -0
  83. package/dist/lib/auth-diagnostics.d.ts +10 -1
  84. package/dist/lib/auth-diagnostics.js +16 -8
  85. package/dist/lib/commitments.d.ts +16 -9
  86. package/dist/lib/commitments.js +65 -4
  87. package/dist/lib/compasses.js +5 -0
  88. package/dist/lib/daemon-binding.js +6 -3
  89. package/dist/lib/daemon-command-hint.d.ts +10 -5
  90. package/dist/lib/daemon-command-hint.js +11 -6
  91. package/dist/lib/daemon-setup.js +9 -3
  92. package/dist/lib/daemonBroker.d.ts +7 -0
  93. package/dist/lib/daemonBroker.js +5 -0
  94. package/dist/lib/daemonHandoff.d.ts +2 -0
  95. package/dist/lib/daemonHandoff.js +16 -3
  96. package/dist/lib/daemonIslandProfile.d.ts +19 -0
  97. package/dist/lib/daemonIslandProfile.js +41 -0
  98. package/dist/lib/drain-stdio.d.ts +22 -0
  99. package/dist/lib/drain-stdio.js +46 -0
  100. package/dist/lib/format.d.ts +32 -0
  101. package/dist/lib/format.js +105 -1
  102. package/dist/lib/initiatives-worker.d.ts +25 -0
  103. package/dist/lib/initiatives-worker.js +13 -0
  104. package/dist/lib/keychain.d.ts +22 -1
  105. package/dist/lib/keychain.js +40 -1
  106. package/dist/lib/local-daemon-readiness.js +4 -6
  107. package/dist/lib/local-skills.js +4 -1
  108. package/dist/lib/login.d.ts +7 -0
  109. package/dist/lib/login.js +5 -0
  110. package/dist/lib/machines.d.ts +68 -0
  111. package/dist/lib/machines.js +67 -0
  112. package/dist/lib/proactive-audit.d.ts +52 -0
  113. package/dist/lib/proactive-audit.js +67 -0
  114. package/dist/lib/proactiveApi.d.ts +23 -0
  115. package/dist/lib/refresh.d.ts +20 -6
  116. package/dist/lib/refresh.js +27 -9
  117. package/dist/lib/roles.d.ts +1 -1
  118. package/dist/lib/runtime-start-verification.js +3 -6
  119. package/dist/lib/schedule.d.ts +189 -9
  120. package/dist/lib/schedule.js +283 -22
  121. package/dist/lib/triggers.d.ts +134 -3
  122. package/dist/lib/triggers.js +370 -17
  123. package/dist/lib/workflow-node-control.js +8 -0
  124. package/dist/lib/workflow-run-view.js +9 -0
  125. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/configRoot.d.ts +12 -0
  126. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/configRoot.js +10 -2
  127. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/deviceIdentityBridge.d.ts +8 -0
  128. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/deviceIdentityBridge.js +22 -0
  129. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/executorStopReceiptV2.d.ts +133 -0
  130. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/executorStopReceiptV2.js +180 -0
  131. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/index.d.ts +5 -3
  132. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/index.js +50 -0
  133. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/profilePorts.d.ts +137 -0
  134. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/profilePorts.js +328 -0
  135. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/profileSelection.d.ts +63 -0
  136. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/profileSelection.js +174 -0
  137. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/refresh.d.ts +22 -0
  138. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/refresh.js +15 -4
  139. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/configRoot.d.ts +12 -0
  140. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/configRoot.js +14 -0
  141. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/deviceIdentityBridge.d.ts +8 -0
  142. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/deviceIdentityBridge.js +27 -0
  143. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/executorStopReceiptV2.d.ts +133 -0
  144. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/executorStopReceiptV2.js +183 -0
  145. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/index.d.ts +5 -3
  146. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/index.js +11 -3
  147. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/profilePorts.d.ts +137 -0
  148. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/profilePorts.js +333 -0
  149. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/profileSelection.d.ts +63 -0
  150. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/profileSelection.js +212 -0
  151. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/refresh.d.ts +22 -0
  152. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/refresh.js +22 -4
  153. package/dist/node_modules/@skrr-ai/auth-core/package.json +11 -1
  154. package/dist/node_modules/@skrr-ai/data-provider/index.js +7446 -7378
  155. package/oclif.manifest.json +844 -47
  156. package/package.json +1 -1
@@ -22,7 +22,7 @@ class SpacesDelete extends base_command_1.BaseCommand {
22
22
  const spaceRef = await this.resolveEntityRef('space', args.id);
23
23
  let confirmed;
24
24
  try {
25
- confirmed = await (0, prompt_1.confirmDestructive)(`Delete space ${spaceRef}? This cannot be undone.`, flags.yes);
25
+ confirmed = await (0, prompt_1.confirmDestructive)(`Delete space ${spaceRef}? This cannot be undone. Tasks in the space are not deleted: they stay as your own tasks outside any space.`, flags.yes);
26
26
  }
27
27
  catch (err) {
28
28
  if (err.exit === 7) {
@@ -41,6 +41,11 @@ class SpacesDelete extends base_command_1.BaseCommand {
41
41
  this.handleApiError(err);
42
42
  }
43
43
  this.log(`Deleted space ${spaceRef}`);
44
+ // The server unlinks a deleted Space's tasks rather than deleting them: they are the owner's
45
+ // own work. Until now the receipt said nothing, and they surfaced later in task lists with no
46
+ // Space (OSK-22519).
47
+ this.log('Its tasks were not deleted. They stay as your own tasks outside any space; find them with ' +
48
+ `\`${this.config.bin} tasks list\` and delete or move any you do not want.`);
44
49
  }
45
50
  }
46
51
  exports.default = SpacesDelete;
@@ -34,8 +34,13 @@ class SpacesWorkflowsArchive extends base_command_1.BaseCommand {
34
34
  const result = await data_provider_1.dataService.archiveSpaceWorkflow(args.spaceId, args.workflowId);
35
35
  if (flags.json)
36
36
  this.log(JSON.stringify(result, null, 2));
37
- else
37
+ else {
38
38
  this.log(`Archived workflow ${result.id}.`);
39
+ const paused = result.pausedTriggers ?? 0;
40
+ // Its triggers are hidden once it is archived, so say what became of the active ones.
41
+ if (paused > 0)
42
+ this.log(`Paused ${paused} active trigger${paused === 1 ? '' : 's'} (schedule timers retired); none will fire.`);
43
+ }
39
44
  }
40
45
  catch (error) {
41
46
  this.handleApiError(error);
@@ -35,7 +35,9 @@ class SpacesWorkflowsPublish extends base_command_1.BaseCommand {
35
35
  // Published, not refused (owner decision 2026-10-15) — so the warning has to be loud here.
36
36
  const warnings = version.warnings ?? [];
37
37
  if (warnings.length) {
38
- this.warn(`Published with ${warnings.length} warning${warnings.length === 1 ? '' : 's'} — runs of this version will hit ${warnings.length === 1 ? 'it' : 'them'}:`);
38
+ // Not every warning is something a run hits (an unrouted outcome, an unconnected branch are
39
+ // facts about the graph), so the line says only that the publish carried them.
40
+ this.warn(`Published with ${warnings.length} warning${warnings.length === 1 ? '' : 's'} — the version is live; check ${warnings.length === 1 ? 'it' : 'them'}:`);
39
41
  for (const line of (0, workflow_issues_1.formatWorkflowIssues)(warnings))
40
42
  this.log(line);
41
43
  }
@@ -15,6 +15,7 @@ export declare function describeNodeAttention(node: {
15
15
  error?: {
16
16
  message?: string;
17
17
  } | null;
18
+ blockedReason?: string | null;
18
19
  }): string;
19
20
  export declare function describeLoopItemsNote(node: {
20
21
  nodeKey?: unknown;
@@ -23,7 +23,12 @@ function describeNodeAttention(node) {
23
23
  if (node.lane !== 'attention')
24
24
  return '';
25
25
  const reason = typeof node.attentionReason === 'string' ? node.attentionReason : '';
26
- const message = typeof node.error?.message === 'string' ? node.error.message : '';
26
+ // A blocked node's reason is its Task's blocker, which is not an `error` (OSK-21738).
27
+ const message = typeof node.error?.message === 'string'
28
+ ? node.error.message
29
+ : reason === 'blocked' && typeof node.blockedReason === 'string'
30
+ ? node.blockedReason
31
+ : '';
27
32
  if (reason && message)
28
33
  return `${reason}: ${message}`;
29
34
  return reason || message || 'needs attention';
@@ -95,6 +100,17 @@ class SpacesWorkflowsRun extends base_command_1.BaseCommand {
95
100
  }), null, 2));
96
101
  this.log(`Run: ${run.id}`);
97
102
  this.log(`Status: ${run.status}`);
103
+ // Why a failed run failed, when it was an outcome with nowhere to go (OSK-21658).
104
+ const failureCause = run.failureCause;
105
+ if (typeof failureCause?.message === 'string')
106
+ this.log(`Why: ${oneLine(failureCause.message)}`);
107
+ // A run is `paused` only when no other branch can make progress. With a paused step and a
108
+ // successor still pending it stays `running`, which read as though the pause had not taken
109
+ // (OSK-22459), so say how many steps are paused and why the run is not.
110
+ const pausedSteps = (run.nodes || []).filter((node) => node.status === 'paused').length;
111
+ if (pausedSteps > 0 && run.status !== 'paused') {
112
+ this.log(`Paused steps: ${pausedSteps} (the run is not \`paused\` while other work could still be dispatched).`);
113
+ }
98
114
  for (const line of (0, workflow_run_budget_1.describeRunBudget)(run))
99
115
  this.log(line);
100
116
  if (runUrl)
@@ -33,7 +33,9 @@ class SpacesWorkflowsTriggersCreate extends base_command_1.BaseCommand {
33
33
  default: 'paused',
34
34
  description: 'Initial trigger status',
35
35
  }),
36
- config: core_1.Flags.string({ description: 'Trigger config as JSON' }),
36
+ config: core_1.Flags.string({
37
+ description: 'Trigger config as JSON. schedule: {"intervalMs":60000} (milliseconds, 60000 to 2678400000) plus an optional "input" object; webhook takes none.',
38
+ }),
37
39
  'config-file': core_1.Flags.string({ description: 'Path to JSON trigger config, or "-" for stdin' }),
38
40
  json: core_1.Flags.boolean({ description: 'Output as JSON' }),
39
41
  };
@@ -98,7 +98,9 @@ class TasksWorkflowContext extends base_command_1.BaseCommand {
98
98
  }
99
99
  }
100
100
  if (downstream.length) {
101
- this.log('Waiting on this:');
101
+ // Only steps that can still run are waiting; a finished run's downstream steps are listed
102
+ // under a neutral heading instead of claiming they wait on a completed step (OSK-22284).
103
+ this.log(context.hasLiveDownstream ? 'Waiting on this:' : 'Downstream:');
102
104
  for (const entry of downstream) {
103
105
  // A pruned edge means "decided against", not "not yet" — the two lead
104
106
  // to opposite decisions about whether to keep working on this step.
@@ -36,7 +36,7 @@ class TriggersAuthorization extends base_command_1.BaseCommand {
36
36
  this.handleApiError(err);
37
37
  }
38
38
  if (flags.json) {
39
- this.log(JSON.stringify(result, null, 2));
39
+ this.printJsonResult(result);
40
40
  return;
41
41
  }
42
42
  this.log(flags.revoke ? 'Authorization revoked.' : 'Authorization restored.');
@@ -32,7 +32,23 @@ class TriggersCapabilities extends base_command_1.BaseCommand {
32
32
  }
33
33
  this.log(`Scope: ${String(capabilities.scopeKind ?? args.scope)}`);
34
34
  this.log(`Kinds: ${Array.isArray(capabilities.allowedKinds) ? capabilities.allowedKinds.join(', ') : '-'}`);
35
- this.log(`Modes: ${Array.isArray(capabilities.allowedExecutorModes) ? capabilities.allowedExecutorModes.join(', ') : '-'}`);
35
+ // The modes `triggers create --mode` will accept. `allowedExecutorModes` is longer: it keeps the
36
+ // modes only an internal producer may mint, which create refuses, so listing it here offered
37
+ // choices that fail on submit (OSK-22489). A server that predates the field only has the long
38
+ // list, and a person on it may be offered one refused choice.
39
+ const authorable = Array.isArray(capabilities.authorableExecutorModes)
40
+ ? capabilities.authorableExecutorModes
41
+ : capabilities.allowedExecutorModes;
42
+ this.log(`Modes: ${Array.isArray(authorable) ? authorable.join(', ') : '-'}`);
43
+ // The mode names say nothing about side effects; describe the ones an author usually picks
44
+ // between (OSK-21766).
45
+ if (Array.isArray(authorable)) {
46
+ for (const mode of authorable) {
47
+ const effect = (0, triggers_1.executorModeEffect)(mode);
48
+ if (effect)
49
+ this.log(` ${String(mode)}: ${effect}`);
50
+ }
51
+ }
36
52
  const vars = Array.isArray(capabilities.templateVariables)
37
53
  ? capabilities.templateVariables.map((v) => typeof v === 'object' && v !== null ? String(v.name) : String(v))
38
54
  : capabilities.templateVariableNames;
@@ -78,6 +78,8 @@ export default class TriggersCreate extends BaseCommand {
78
78
  'allow-unknown-event': import("@oclif/core/interfaces").BooleanFlag<boolean>;
79
79
  };
80
80
  run(): Promise<void>;
81
+ /** How a saved working / quiet window will be read, when that is not what it looks like (OSK-22530). */
82
+ private warnWindowAdvice;
81
83
  private warnMissingSelfSchedule;
82
84
  /**
83
85
  * The server creates the trigger and then says whether something already
@@ -40,7 +40,10 @@ class TriggersCreate extends base_command_1.BaseCommand {
40
40
  description: 'Create enabled or disabled (default: enabled; pass --no-enabled to author it inert)',
41
41
  allowNo: true,
42
42
  }),
43
- mode: core_1.Flags.string({ description: 'Execution mode', options: [...triggers_1.TRIGGER_EXECUTOR_MODES] }),
43
+ mode: core_1.Flags.string({
44
+ description: triggers_1.TRIGGER_MODE_FLAG_DESCRIPTION,
45
+ options: [...triggers_1.TRIGGER_EXECUTOR_MODES],
46
+ }),
44
47
  prompt: core_1.Flags.string({ description: 'Prompt template sent when the trigger fires' }),
45
48
  'builtin-action': core_1.Flags.string({
46
49
  description: 'Typed builtinAction JSON object for mode=builtin_action',
@@ -81,8 +84,12 @@ class TriggersCreate extends base_command_1.BaseCommand {
81
84
  multiple: true,
82
85
  }),
83
86
  references: core_1.Flags.string({ description: 'Execution references JSON array' }),
84
- 'working-hours': core_1.Flags.string({ description: 'Execution workingHours JSON object' }),
85
- 'quiet-hours': core_1.Flags.string({ description: 'Execution quietHours JSON object' }),
87
+ 'working-hours': core_1.Flags.string({
88
+ description: `Execution workingHours: only fires inside the window run. ${triggers_1.TRIGGER_WINDOW_FLAG_HELP}`,
89
+ }),
90
+ 'quiet-hours': core_1.Flags.string({
91
+ description: `Execution quietHours: fires inside the window are skipped. ${triggers_1.TRIGGER_WINDOW_FLAG_HELP}`,
92
+ }),
86
93
  cron: core_1.Flags.string({ description: 'Cron expression for schedule triggers' }),
87
94
  'interval-ms': core_1.Flags.integer({ description: 'Interval schedule period in milliseconds' }),
88
95
  'interval-minutes': core_1.Flags.integer({ description: 'Interval schedule period in minutes' }),
@@ -90,7 +97,9 @@ class TriggersCreate extends base_command_1.BaseCommand {
90
97
  description: 'Daily HH:MM fire time for schedule triggers (repeatable or comma-separated)',
91
98
  multiple: true,
92
99
  }),
93
- timezone: core_1.Flags.string({ description: 'IANA timezone for schedule triggers' }),
100
+ timezone: core_1.Flags.string({
101
+ description: 'IANA timezone for schedule triggers, for example America/Los_Angeles. Defaults to UTC: without it --daily-time 09:30 or a cron runs at 09:30 UTC, not at 09:30 where you are.',
102
+ }),
94
103
  'max-fires-per-day': core_1.Flags.integer({
95
104
  description: 'Daily fire cap (schedule, stochastic and self_scheduled triggers only)',
96
105
  }),
@@ -325,6 +334,7 @@ class TriggersCreate extends base_command_1.BaseCommand {
325
334
  if (trigger.dryRun) {
326
335
  this.log('Trigger accepted by dry run.');
327
336
  this.warnMissingSelfSchedule(trigger);
337
+ this.warnWindowAdvice(trigger);
328
338
  return;
329
339
  }
330
340
  this.log('Created trigger:');
@@ -333,6 +343,12 @@ class TriggersCreate extends base_command_1.BaseCommand {
333
343
  this.log(`View it at ${url}`);
334
344
  this.warnDuplicateSubscriptions(trigger);
335
345
  this.warnMissingSelfSchedule(trigger);
346
+ this.warnWindowAdvice(trigger);
347
+ }
348
+ /** How a saved working / quiet window will be read, when that is not what it looks like (OSK-22530). */
349
+ warnWindowAdvice(trigger) {
350
+ for (const advice of (0, triggers_1.windowAuthoringAdvice)(trigger))
351
+ this.warn(advice);
336
352
  }
337
353
  warnMissingSelfSchedule(trigger) {
338
354
  const warnings = trigger?.warnings;
@@ -381,9 +397,9 @@ class TriggersCreate extends base_command_1.BaseCommand {
381
397
  if (execution.mode === 'builtin_action') {
382
398
  const builtinAction = execution.builtinAction;
383
399
  if (!builtinAction || typeof builtinAction.builtinType !== 'string') {
384
- this.error('mode=builtin_action requires --builtin-type (and --builtin-config).', {
385
- exit: 1,
386
- });
400
+ this.error('mode=builtin_action runs a deterministic action with no model turn, so it needs an action and no prompt: ' +
401
+ 'pass --builtin-type and --builtin-config, or execution.builtinAction { builtinType, config } in --from-json. ' +
402
+ `\`${this.config.bin} triggers actions\` lists the types and their config.`, { exit: 1 });
387
403
  }
388
404
  const { ok, missing } = (0, builtinActions_1.validateBuiltinConfig)(builtinAction.builtinType, builtinAction.config);
389
405
  if (!ok) {
@@ -25,14 +25,23 @@ function describeFireAuditDetail(detail, fireId, triggerId) {
25
25
  lines.push(`Reason: ${reason}`);
26
26
  if (message && message !== reason)
27
27
  lines.push(`${reason ? 'Detail:' : 'Reason:'} ${message}`);
28
- const quietHours = (0, triggers_1.quietHoursAuditExplanation)(detail);
29
- if (quietHours) {
30
- lines.push(`Explanation: ${quietHours.summary}. ${quietHours.detail}`);
28
+ const clockSkip = (0, triggers_1.clockSkipAuditExplanation)(detail);
29
+ if (clockSkip) {
30
+ lines.push(`Explanation: ${clockSkip.summary}. ${clockSkip.detail}`);
31
31
  }
32
32
  const policy = (0, triggers_1.policyAuditExplanation)(detail);
33
33
  if (policy) {
34
34
  lines.push(`Explanation: ${policy.summary}. ${policy.detail}`);
35
35
  }
36
+ const coalesced = (0, triggers_1.coalescedAuditExplanation)(detail);
37
+ if (coalesced) {
38
+ lines.push(`Explanation: ${coalesced.summary}. ${coalesced.detail}`);
39
+ }
40
+ // Any fire whose receipt was offered as a card says what came of it, whatever skipped it (ask-first,
41
+ // quiet hours, a cap), not only the suggestions-only case explained above.
42
+ const policyCard = (0, triggers_1.policyCardSentence)(detail.metadata?.policyCard);
43
+ if (policyCard && !policy)
44
+ lines.push(`Inbox card: ${policyCard}`);
36
45
  if (detail.durationMs !== undefined)
37
46
  lines.push(`Duration: ${String(detail.durationMs)}ms`);
38
47
  if (detail.conversationId)
@@ -7,6 +7,7 @@ export default class TriggersList extends BaseCommand {
7
7
  scope: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
8
8
  kind: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
9
9
  enabled: import("@oclif/core/interfaces").BooleanFlag<boolean>;
10
+ ref: import("@oclif/core/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
10
11
  'ref-entity': import("@oclif/core/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
11
12
  limit: import("@oclif/core/interfaces").OptionFlag<number, import("@oclif/core/interfaces").CustomOptions>;
12
13
  before: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
@@ -9,6 +9,7 @@ class TriggersList extends base_command_1.BaseCommand {
9
9
  static examples = [
10
10
  '<%= config.bin %> triggers list',
11
11
  '<%= config.bin %> triggers list --scope agent --kind schedule --enabled',
12
+ '<%= config.bin %> triggers list --ref agentId=<agent-id> --json',
12
13
  '<%= config.bin %> triggers list --ref-entity agent:<agent-id> --json',
13
14
  ];
14
15
  static flags = {
@@ -16,6 +17,10 @@ class TriggersList extends base_command_1.BaseCommand {
16
17
  scope: core_1.Flags.string({ description: 'Filter by scope kind', options: [...triggers_1.TRIGGER_SCOPE_KINDS] }),
17
18
  kind: core_1.Flags.string({ description: 'Filter by trigger kind', options: [...triggers_1.TRIGGER_KINDS] }),
18
19
  enabled: core_1.Flags.boolean({ description: 'Filter by enabled state', allowNo: true }),
20
+ ref: core_1.Flags.string({
21
+ description: 'Filter by a scope ref as key=value (repeatable), the same spelling `triggers create` takes, for example --ref agentId=abc',
22
+ multiple: true,
23
+ }),
19
24
  'ref-entity': core_1.Flags.string({
20
25
  description: 'Filter by ref entity as kind:id (repeatable), e.g. --ref-entity agent:abc',
21
26
  multiple: true,
@@ -26,11 +31,18 @@ class TriggersList extends base_command_1.BaseCommand {
26
31
  async run() {
27
32
  this.requireAuth();
28
33
  const { flags } = await this.parse(TriggersList);
34
+ let refEntity;
35
+ try {
36
+ refEntity = [...(flags['ref-entity'] ?? []), ...(0, triggers_1.refEntitiesFromRefFlags)(flags.ref)];
37
+ }
38
+ catch (err) {
39
+ this.error(err.message, { exit: 2 });
40
+ }
29
41
  const path = (0, triggers_1.withQuery)('/api/triggers', {
30
42
  scope: flags.scope,
31
43
  kind: flags.kind,
32
44
  enabled: flags.enabled,
33
- refEntity: flags['ref-entity'],
45
+ refEntity: refEntity.length > 0 ? refEntity : undefined,
34
46
  limit: flags.limit,
35
47
  before: flags.before,
36
48
  });
@@ -97,6 +97,11 @@ class TriggersPreflight extends base_command_1.BaseCommand {
97
97
  : '';
98
98
  this.log(`${verdict}${because}`);
99
99
  this.log(`kind=${report.kind ?? '-'} mode=${report.executorMode ?? '-'} enabled=${String(report.enabled ?? '-')}`);
100
+ // `mode=run_only` is a name, not a consequence. Say whether firing starts an Agent turn so a
101
+ // person can decide before enabling it (OSK-21766).
102
+ const effect = (0, triggers_1.executorModeEffect)(report.executorMode);
103
+ if (effect)
104
+ this.log(`mode ${String(report.executorMode)}: ${effect}`);
100
105
  this.log('\nGates:');
101
106
  for (const gate of report.gates) {
102
107
  const mark = gate.verdict === 'pass'
@@ -109,6 +114,19 @@ class TriggersPreflight extends base_command_1.BaseCommand {
109
114
  ? '?? '
110
115
  : '- ';
111
116
  this.log(` ${mark} ${gate.name}${gate.reason ? ` — ${gate.reason}` : ''}`);
117
+ // The debounce gate is a bare `ok` otherwise, and what the window means (trigger-wide, skipped
118
+ // not queued) was readable only from the implementation (OSK-21756). The working-hours gate
119
+ // says which instant it judged when that is not the moment preflight ran (OSK-22527).
120
+ const note = gate.name === 'debounce' || gate.name === 'concurrency' || gate.name === 'working_hours'
121
+ ? gate.detail?.note
122
+ : undefined;
123
+ if (typeof note === 'string' && note)
124
+ this.log(` ${note}`);
125
+ // The lane a fire takes is what decides whether two triggers can drop each other; it was in the
126
+ // JSON only, beside a bare `requires_live_lease` (OSK-22510).
127
+ const lane = gate.name === 'concurrency' ? gate.detail?.concurrencyKey : undefined;
128
+ if (typeof lane === 'string' && lane)
129
+ this.log(` lane: ${lane}`);
112
130
  }
113
131
  if (report.notes?.length) {
114
132
  this.log('\nNotes:');
@@ -96,17 +96,21 @@ class TriggersPrune extends base_command_1.BaseCommand {
96
96
  }
97
97
  if (ownerWide) {
98
98
  this.log('Scope: all (every scope you own)');
99
- this.log(`Owner quota${quota.counterWorkspaceId ? ` (workspace ${quota.counterWorkspaceId})` : quota.counterWorkspaceId === null ? ' (no workspace)' : ''}: ${quota.perUser} / ${quota.perUserLimit} (${quota.perUserRemaining} free)`);
99
+ this.log(`Owner quota${quota.counterWorkspaceId ? ` (workspace ${quota.counterWorkspaceId})` : quota.counterWorkspaceId === null ? ' (no workspace)' : ''}: ${(0, triggers_1.describeTriggerBudget)({ used: quota.perUser, limit: quota.perUserLimit, free: quota.perUserRemaining, unlimited: quota.perUserUnlimited })}`);
100
100
  }
101
101
  else {
102
102
  this.log(`Scope: ${quota.scopeKind}`);
103
- this.log(`Active: ${quota.active} / ${quota.limit} (${quota.remaining} free)`);
103
+ this.log(`Active: ${(0, triggers_1.describeTriggerBudget)({ used: quota.active, limit: quota.limit, free: quota.remaining, unlimited: quota.unlimited })}`);
104
104
  if (quota.counterWorkspaceId !== undefined) {
105
105
  this.log(`Quota workspace: ${quota.counterWorkspaceId || 'none'}`);
106
106
  }
107
107
  }
108
108
  if (quota.reclaimableScope === 'owner_all_workspaces') {
109
- this.log('Prune candidates span all workspaces you own.');
109
+ // The candidate filter is the scope you named, across every workspace you
110
+ // own; it is not the quota counter's workspace, which is printed above.
111
+ this.log(ownerWide
112
+ ? 'Prune candidates span all workspaces you own.'
113
+ : `Prune candidates are only this ${scope}'s disabled triggers, across all workspaces you own.`);
110
114
  }
111
115
  this.log(`Would delete: ${preview.wouldDelete} disabled trigger(s)`);
112
116
  for (const id of preview.ids)
@@ -155,8 +159,8 @@ class TriggersPrune extends base_command_1.BaseCommand {
155
159
  }
156
160
  this.log(`Deleted ${result.deleted} disabled trigger(s).`);
157
161
  this.log(ownerWide
158
- ? `Budget now: ${result.quota.perUser} / ${result.quota.perUserLimit} (${result.quota.perUserRemaining} free)`
159
- : `Budget now: ${result.quota.active} / ${result.quota.limit} (${result.quota.remaining} free)`);
162
+ ? `Budget now: ${(0, triggers_1.describeTriggerBudget)({ used: result.quota.perUser, limit: result.quota.perUserLimit, free: result.quota.perUserRemaining, unlimited: result.quota.perUserUnlimited })}`
163
+ : `Budget now: ${(0, triggers_1.describeTriggerBudget)({ used: result.quota.active, limit: result.quota.limit, free: result.quota.remaining, unlimited: result.quota.unlimited })}`);
160
164
  if (ownerWide && result.deleted === (flags.limit ?? 200)) {
161
165
  this.log('Hit the per-call limit — run it again to continue.');
162
166
  }
@@ -21,7 +21,7 @@ class TriggersUpdate extends base_command_1.BaseCommand {
21
21
  }),
22
22
  label: core_1.Flags.string({ description: 'Human-readable trigger label' }),
23
23
  enabled: core_1.Flags.boolean({ description: 'Enable or disable the trigger', allowNo: true }),
24
- mode: core_1.Flags.string({ description: 'Execution mode', options: [...triggers_1.TRIGGER_EXECUTOR_MODES] }),
24
+ mode: core_1.Flags.string({ description: triggers_1.TRIGGER_MODE_FLAG_DESCRIPTION, options: [...triggers_1.TRIGGER_EXECUTOR_MODES] }),
25
25
  prompt: core_1.Flags.string({ description: 'Prompt template sent when the trigger fires' }),
26
26
  'builtin-action': core_1.Flags.string({
27
27
  description: 'Typed builtinAction JSON object for mode=builtin_action',
@@ -38,8 +38,12 @@ class TriggersUpdate extends base_command_1.BaseCommand {
38
38
  multiple: true,
39
39
  }),
40
40
  references: core_1.Flags.string({ description: 'Execution references JSON array' }),
41
- 'working-hours': core_1.Flags.string({ description: 'Execution workingHours JSON object' }),
42
- 'quiet-hours': core_1.Flags.string({ description: 'Execution quietHours JSON object' }),
41
+ 'working-hours': core_1.Flags.string({
42
+ description: `Execution workingHours: only fires inside the window run. ${triggers_1.TRIGGER_WINDOW_FLAG_HELP}`,
43
+ }),
44
+ 'quiet-hours': core_1.Flags.string({
45
+ description: `Execution quietHours: fires inside the window are skipped. ${triggers_1.TRIGGER_WINDOW_FLAG_HELP}`,
46
+ }),
43
47
  cron: core_1.Flags.string({ description: 'Cron expression for schedule triggers' }),
44
48
  'interval-ms': core_1.Flags.integer({ description: 'Interval schedule period in milliseconds' }),
45
49
  'interval-minutes': core_1.Flags.integer({ description: 'Interval schedule period in minutes' }),
@@ -47,7 +51,9 @@ class TriggersUpdate extends base_command_1.BaseCommand {
47
51
  description: 'Daily HH:MM fire time for schedule triggers (repeatable or comma-separated)',
48
52
  multiple: true,
49
53
  }),
50
- timezone: core_1.Flags.string({ description: 'IANA timezone for schedule triggers' }),
54
+ timezone: core_1.Flags.string({
55
+ description: 'IANA timezone for schedule triggers, for example America/Los_Angeles. Defaults to UTC: without it --daily-time 09:30 or a cron runs at 09:30 UTC, not at 09:30 where you are.',
56
+ }),
51
57
  'max-fires-per-day': core_1.Flags.integer({
52
58
  description: 'Daily fire cap (schedule, stochastic and self_scheduled triggers only)',
53
59
  }),
@@ -266,6 +272,9 @@ class TriggersUpdate extends base_command_1.BaseCommand {
266
272
  }
267
273
  this.log('Updated trigger:');
268
274
  (0, triggers_1.renderTriggerSummary)(trigger, (line) => this.log(line));
275
+ // How a window this update saved will be read, when that is not what it looks like (OSK-22530).
276
+ for (const advice of (0, triggers_1.windowAuthoringAdvice)(trigger))
277
+ this.warn(advice);
269
278
  }
270
279
  }
271
280
  exports.default = TriggersUpdate;