@skrr-ai/cli 0.1.143 → 0.1.145

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 (102) hide show
  1. package/README.md +13 -0
  2. package/dist/commands/agenda/plan.d.ts +7 -0
  3. package/dist/commands/agenda/plan.js +17 -0
  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 +70 -0
  8. package/dist/commands/agent/message/decline.d.ts +17 -0
  9. package/dist/commands/agent/message/decline.js +70 -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/delete.d.ts +45 -0
  13. package/dist/commands/agents/delete.js +139 -2
  14. package/dist/commands/agents/plan-day.d.ts +50 -7
  15. package/dist/commands/agents/plan-day.js +293 -65
  16. package/dist/commands/agents/proactive-audit.d.ts +22 -0
  17. package/dist/commands/agents/proactive-audit.js +86 -0
  18. package/dist/commands/agents/schedule-overview.d.ts +7 -0
  19. package/dist/commands/agents/schedule-overview.js +49 -5
  20. package/dist/commands/agents/schedule-trace.js +42 -21
  21. package/dist/commands/agents/spawn.d.ts +78 -1
  22. package/dist/commands/agents/spawn.js +262 -6
  23. package/dist/commands/agents/todos/list.d.ts +5 -0
  24. package/dist/commands/agents/todos/list.js +19 -5
  25. package/dist/commands/agents/triggers/create.js +1 -1
  26. package/dist/commands/agents/triggers/update.js +1 -1
  27. package/dist/commands/agents/upcoming.d.ts +1 -0
  28. package/dist/commands/agents/upcoming.js +18 -7
  29. package/dist/commands/commitments/create.js +14 -4
  30. package/dist/commands/commitments/preflight.js +14 -3
  31. package/dist/commands/commitments/update.js +1 -1
  32. package/dist/commands/initiatives/worker/deactivate.d.ts +23 -0
  33. package/dist/commands/initiatives/worker/deactivate.js +78 -0
  34. package/dist/commands/login.js +8 -2
  35. package/dist/commands/logout.d.ts +20 -0
  36. package/dist/commands/logout.js +110 -5
  37. package/dist/commands/memory/maintain.js +16 -2
  38. package/dist/commands/spaces/delete.js +6 -1
  39. package/dist/commands/spaces/workflow-templates/insert.js +4 -0
  40. package/dist/commands/spaces/workflows/archive.js +6 -1
  41. package/dist/commands/spaces/workflows/publish.js +3 -1
  42. package/dist/commands/spaces/workflows/run.d.ts +1 -0
  43. package/dist/commands/spaces/workflows/run.js +17 -1
  44. package/dist/commands/spaces/workflows/triggers/create.js +3 -1
  45. package/dist/commands/store/show.js +22 -0
  46. package/dist/commands/tasks/workflow-context.js +3 -1
  47. package/dist/commands/triggers/capabilities.js +17 -1
  48. package/dist/commands/triggers/create.d.ts +2 -0
  49. package/dist/commands/triggers/create.js +23 -7
  50. package/dist/commands/triggers/fire-detail.js +12 -3
  51. package/dist/commands/triggers/list.d.ts +1 -0
  52. package/dist/commands/triggers/list.js +13 -1
  53. package/dist/commands/triggers/preflight.js +18 -0
  54. package/dist/commands/triggers/prune.js +9 -5
  55. package/dist/commands/triggers/update.js +13 -4
  56. package/dist/generated/agent-guides.json +35 -35
  57. package/dist/lib/agent-proactive-baseline.js +7 -1
  58. package/dist/lib/agentic-stream.d.ts +7 -0
  59. package/dist/lib/agentic-stream.js +22 -0
  60. package/dist/lib/commitments.d.ts +16 -9
  61. package/dist/lib/commitments.js +78 -5
  62. package/dist/lib/compasses.js +1 -1
  63. package/dist/lib/daemon-setup.js +9 -3
  64. package/dist/lib/daemonBroker.d.ts +7 -0
  65. package/dist/lib/daemonBroker.js +5 -0
  66. package/dist/lib/daemonHandoff.d.ts +2 -0
  67. package/dist/lib/daemonHandoff.js +10 -1
  68. package/dist/lib/daemonIslandProfile.d.ts +19 -0
  69. package/dist/lib/daemonIslandProfile.js +41 -0
  70. package/dist/lib/dedicated-power.js +10 -3
  71. package/dist/lib/format.d.ts +47 -0
  72. package/dist/lib/format.js +136 -1
  73. package/dist/lib/initiatives-worker.d.ts +25 -0
  74. package/dist/lib/initiatives-worker.js +13 -0
  75. package/dist/lib/login.d.ts +7 -0
  76. package/dist/lib/login.js +5 -0
  77. package/dist/lib/planOutcome.d.ts +51 -0
  78. package/dist/lib/planOutcome.js +88 -0
  79. package/dist/lib/proactive-audit.d.ts +52 -0
  80. package/dist/lib/proactive-audit.js +67 -0
  81. package/dist/lib/proactiveApi.d.ts +71 -0
  82. package/dist/lib/proactiveApi.js +10 -1
  83. package/dist/lib/refresh.d.ts +20 -6
  84. package/dist/lib/refresh.js +27 -9
  85. package/dist/lib/roles.d.ts +1 -1
  86. package/dist/lib/schedule.d.ts +214 -10
  87. package/dist/lib/schedule.js +317 -21
  88. package/dist/lib/triggers.d.ts +139 -3
  89. package/dist/lib/triggers.js +382 -18
  90. package/dist/lib/workflow-node-control.js +8 -0
  91. package/dist/lib/workflow-run-view.js +9 -0
  92. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/index.d.ts +1 -1
  93. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/index.js +2 -0
  94. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/refresh.d.ts +22 -0
  95. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/refresh.js +15 -4
  96. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/index.d.ts +1 -1
  97. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/index.js +1 -1
  98. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/refresh.d.ts +22 -0
  99. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/refresh.js +22 -4
  100. package/dist/node_modules/@skrr-ai/data-provider/index.js +5252 -5211
  101. package/oclif.manifest.json +526 -29
  102. package/package.json +1 -1
@@ -1,7 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DECLINE_UNSUPPORTED_MESSAGE = exports.SPEC_FORMAT_HELP = exports.SPEC_TEMPLATE = void 0;
3
4
  exports.workerPolicyWindowLines = workerPolicyWindowLines;
4
5
  exports.specWithEffectiveWindowFlags = specWithEffectiveWindowFlags;
6
+ exports.installPlanLines = installPlanLines;
5
7
  exports.shellQuote = shellQuote;
6
8
  exports.initializeSummary = initializeSummary;
7
9
  exports.proactiveInstallReadiness = proactiveInstallReadiness;
@@ -9,6 +11,7 @@ const core_1 = require("@oclif/core");
9
11
  const base_command_1 = require("../../base-command");
10
12
  const prompt_1 = require("../../lib/prompt");
11
13
  const format_1 = require("../../lib/format");
14
+ const http_error_1 = require("../../lib/http-error");
12
15
  const web_url_1 = require("../../lib/web-url");
13
16
  const proactiveApi_1 = require("../../lib/proactiveApi");
14
17
  function workerPolicyWindowLines(policy) {
@@ -45,6 +48,77 @@ function specWithEffectiveWindowFlags(spec) {
45
48
  },
46
49
  };
47
50
  }
51
+ /**
52
+ * A spec that validates as it stands: what `--print-spec-template` prints and what `--from-spec`
53
+ * reads. The shape was discoverable only by running a plan-only spawn and copying the `spec` out of
54
+ * its JSON (OSK-22416). Every key here is one the server's strict schema accepts, and a key it does
55
+ * not know is refused, so the template stays minimal rather than listing every optional field.
56
+ */
57
+ exports.SPEC_TEMPLATE = {
58
+ identity: {
59
+ name: 'Overdue-work watcher',
60
+ description: 'Flags overdue tasks and stalled goals, and asks before acting.',
61
+ provider: 'agentic',
62
+ model: 'default',
63
+ },
64
+ systems: ['worker', 'orchestrator'],
65
+ worker: {
66
+ watchers: [{ source: 'task_goal_watcher', intervalMinutes: 60 }],
67
+ policy: {
68
+ mode: 'ask_first',
69
+ workingHours: { enabled: true, start: '09:00', end: '18:00', timezone: 'America/Los_Angeles' },
70
+ },
71
+ },
72
+ orchestrator: {
73
+ mode: 'review',
74
+ executePlan: false,
75
+ workingHours: { start: '09:00', end: '18:00', timezone: 'America/Los_Angeles' },
76
+ },
77
+ };
78
+ /** What the template's fields mean and which values they take, for `agents spawn --help`. */
79
+ exports.SPEC_FORMAT_HELP = [
80
+ 'SPEC FORMAT (--from-spec). --print-spec-template prints a valid spec; unknown keys are refused.',
81
+ '- identity: name, provider, model (required); description, instructions, category.',
82
+ '- systems: any of worker, orchestrator. An empty list installs neither and skips the baseline watchers.',
83
+ '- worker (installed when systems has worker): watchers (1-8) and policy.',
84
+ '- worker.watchers[].source: task_goal_watcher, initiative_follow_through, slack_watcher, memory_watcher, calendar_watcher, daemon_watcher, email_watcher, github_watcher, initiative_digest_watcher, rss_watcher. Optional intervalMinutes (15-1440) and limit (1-100).',
85
+ '- worker.policy.mode: suggestions_only, ask_first, auto_run_limited, auto_run. workingHours and quietHours: { enabled, start, end, timezone }, with times as "HH:MM".',
86
+ '- orchestrator (installed when systems has orchestrator): mode review or auto, executePlan true or false, workingHours { start, end, timezone }.',
87
+ '- Optional: commitments (at most 3), initialize { goals, tasks, jobs }, compass, autonomyPosture.',
88
+ ].join('\n');
89
+ /**
90
+ * The install plan as lines: every object a spec will install, marked `requested` (the spec names
91
+ * it) or `default` (the platform adds it, and why). A spec for one watcher installed ten systems and
92
+ * the plan and the receipt named one (OSK-22417). A default the target runtime cannot run is marked
93
+ * `will be blocked` with the reason, and a declined one `declined`, so what is NOT installed is as
94
+ * visible as what is.
95
+ */
96
+ function installPlanLines(items, bin) {
97
+ if (!items.length)
98
+ return [];
99
+ const lines = ['Will be installed:'];
100
+ for (const item of items) {
101
+ const mark = item.status === 'declined'
102
+ ? 'declined'
103
+ : item.status === 'will_be_blocked'
104
+ ? 'will be blocked'
105
+ : item.origin;
106
+ const note = item.status === 'declined'
107
+ ? item.reason ?? 'declined'
108
+ : item.status === 'will_be_blocked'
109
+ ? `${item.reason ?? 'blocked'}: ${item.detail ?? 'the runtime cannot run it'}`
110
+ : item.origin === 'default'
111
+ ? item.why
112
+ : '';
113
+ lines.push(` ${mark.padEnd(15)} ${item.label}${note ? ` - ${note}` : ''}`);
114
+ }
115
+ if (items.some((item) => item.origin === 'default' && item.status !== 'declined')) {
116
+ lines.push(`Decline defaults with \`${bin} agents spawn ... --without <name>\` (${proactiveApi_1.DECLINABLE_DEFAULTS.join(', ')}) or --minimal.`);
117
+ }
118
+ return lines;
119
+ }
120
+ /** What `--minimal` / `--without` say when the server cannot honour them. */
121
+ exports.DECLINE_UNSUPPORTED_MESSAGE = 'This server does not support --minimal/--without yet; nothing was opted out.';
48
122
  /** A value as one POSIX shell word, so a printed command can be pasted as it is. */
49
123
  function shellQuote(value) {
50
124
  return `'${value.replace(/'/g, `'\\''`)}'`;
@@ -80,7 +154,17 @@ function initializeSummary(initialize) {
80
154
  */
81
155
  function proactiveInstallReadiness(result, bin) {
82
156
  if (result.warnings.length === 0) {
83
- return { status: 'ready', message: 'All requested setup steps completed.' };
157
+ // READY describes setup, not what the Agent does next. A new Agent with Always-On on starts its
158
+ // first runs in the background, and one that fails shows up in the operating review, not here:
159
+ // a spawned Agent read READY while its first run had already failed (OSK-22359).
160
+ const safeAgent = /^[A-Za-z0-9_-]+$/.test(result.agentId) ? result.agentId : null;
161
+ const firstRuns = result.installed.alwaysOn?.desiredEnabled === true && safeAgent;
162
+ return {
163
+ status: 'ready',
164
+ message: firstRuns
165
+ ? `All requested setup steps completed. Its first runs start in the background: read \`${bin} commitments operating-review ${safeAgent}\` in a few minutes to see whether they worked.`
166
+ : 'All requested setup steps completed.',
167
+ };
84
168
  }
85
169
  if (result.warnings.some((warning) => warning.step.startsWith('commitment.'))) {
86
170
  // A Commitment the owner deleted is reported, not repaired: it was not recreated on
@@ -151,6 +235,23 @@ function proactiveInstallReadiness(result, bin) {
151
235
  message: 'Some worker time windows are disabled because their enablement was not specified. Review the warnings.',
152
236
  };
153
237
  }
238
+ // The only thing that went wrong is the new Agent's own creation-time setup (for example its
239
+ // first-day question could not be queued because it runs on the cloud Agent Worker). Re-running
240
+ // the spec cannot fix that, and the old generic message and repair command (the command just run)
241
+ // said neither what degraded nor where to look (OSK-22416).
242
+ const provisioningOnly = result.warnings.length > 0 &&
243
+ result.warnings.every((warning) => warning.code === 'proactive_provisioning_incomplete');
244
+ if (provisioningOnly) {
245
+ const inspectAgent = /^[A-Za-z0-9_-]+$/.test(result.agentId) ? result.agentId : null;
246
+ return {
247
+ status: 'degraded',
248
+ message: 'What the spec asked for is installed. Part of the new Agent\u2019s own setup did not finish; ' +
249
+ 'the warning below says which part and why. Re-running the spec does not change that.',
250
+ ...(inspectAgent
251
+ ? { repairCommand: `${bin} commitments operating-review ${inspectAgent}` }
252
+ : {}),
253
+ };
254
+ }
154
255
  // A full trigger budget must not make a new persona-only Agent look broken
155
256
  // when its core system commitments, local execution policy, and Always-On
156
257
  // state installed successfully. The optional backlog watcher is deferred;
@@ -188,7 +289,7 @@ function proactiveInstallReadiness(result, bin) {
188
289
  * `--from-spec` for an exact, reviewed install (which may carry higher autonomy).
189
290
  */
190
291
  class AgentsSpawn extends base_command_1.BaseCommand {
191
- static description = 'Spawn a complete proactive agent from one sentence (plan → review → approve)';
292
+ static description = 'Spawn a complete proactive agent from one sentence (plan → review → approve)\n\n' + exports.SPEC_FORMAT_HELP;
192
293
  static examples = [
193
294
  '<%= config.bin %> agents spawn "watch my Slack and flag urgent unanswered messages"',
194
295
  '<%= config.bin %> agents spawn "plan my day every morning, working hours 9-6" --approve',
@@ -196,7 +297,10 @@ class AgentsSpawn extends base_command_1.BaseCommand {
196
297
  '<%= config.bin %> agents spawn "watch launch blockers" --recommend',
197
298
  '<%= config.bin %> agents spawn --approve-recommendation par_123 --spec-hash <reviewed-hash>',
198
299
  '<%= config.bin %> agents spawn --apply-recommendation par_123 --spec-hash <reviewed-hash>',
300
+ '<%= config.bin %> agents spawn --print-spec-template > spec.json',
199
301
  '<%= config.bin %> agents spawn --from-spec spec.json --approve',
302
+ '<%= config.bin %> agents spawn --from-spec spec.json --minimal --approve',
303
+ '<%= config.bin %> agents spawn --from-spec spec.json --without memory_watcher --without relationship_loops --approve',
200
304
  ];
201
305
  static args = {
202
306
  sentence: core_1.Args.string({
@@ -222,7 +326,18 @@ class AgentsSpawn extends base_command_1.BaseCommand {
222
326
  description: 'Hash from the reviewed recommendation (required for apply; optional for approval)',
223
327
  }),
224
328
  'from-spec': core_1.Flags.string({
225
- description: 'Path to a spec JSON (or "-" for stdin) to apply directly (requires --approve). An explicit empty systems list skips implicit baseline watchers.',
329
+ description: 'Path to a spec JSON (or "-" for stdin) to apply directly (requires --approve). Its shape is under SPEC FORMAT below; --print-spec-template prints a valid one. An explicit empty systems list skips implicit baseline watchers.',
330
+ }),
331
+ 'print-spec-template': core_1.Flags.boolean({
332
+ description: 'Print a valid spec JSON to edit and pass to --from-spec, and exit (creates nothing)',
333
+ }),
334
+ minimal: core_1.Flags.boolean({
335
+ description: 'Install only what the spec asks for: decline every default the platform would add (the memory and task/goal scans, the initiative follow-through loop, the four relationship loops). The plan lists each default first',
336
+ }),
337
+ without: core_1.Flags.string({
338
+ description: `Decline one default by name; repeatable. One of: ${proactiveApi_1.DECLINABLE_DEFAULTS.join(', ')}. Refused when the spec itself asks for it`,
339
+ options: [...proactiveApi_1.DECLINABLE_DEFAULTS],
340
+ multiple: true,
226
341
  }),
227
342
  'agent-id': core_1.Flags.string({
228
343
  description: 'Apply onto an existing agent instead of creating a new one (convergent re-run)',
@@ -237,8 +352,19 @@ class AgentsSpawn extends base_command_1.BaseCommand {
237
352
  timezone: core_1.Flags.string({ description: 'IANA timezone for working-hours defaults' }),
238
353
  };
239
354
  async run() {
240
- this.requireAuth();
241
355
  const { args, flags } = await this.parse(AgentsSpawn);
356
+ // Reads nothing and creates nothing, so it needs no sign-in.
357
+ if (flags['print-spec-template']) {
358
+ this.log(JSON.stringify(exports.SPEC_TEMPLATE, null, 2));
359
+ return;
360
+ }
361
+ this.requireAuth();
362
+ // A recommendation is approved and applied as reviewed, with no way to decline a default;
363
+ // refusing here is better than a --minimal that silently installs everything.
364
+ if ((flags.minimal || (flags.without ?? []).length > 0) &&
365
+ (flags['approve-recommendation'] || flags['apply-recommendation'] || flags.recommend)) {
366
+ this.error('--minimal and --without apply to --from-spec and to a sentence, not to a recommendation. Apply the spec directly instead.', { exit: 1 });
367
+ }
242
368
  if (flags.recommend && flags['from-spec']) {
243
369
  this.error('--recommend cannot be combined with --from-spec. Use a sentence with --recommend, or review the spec and apply it with --from-spec and --approve.', { exit: 1 });
244
370
  }
@@ -262,6 +388,86 @@ class AgentsSpawn extends base_command_1.BaseCommand {
262
388
  this.handleApiError(err);
263
389
  }
264
390
  }
391
+ /** `--minimal` / `--without`, as the request body carries them. */
392
+ declineOptions(flags) {
393
+ return {
394
+ ...(flags.minimal ? { minimal: true } : {}),
395
+ ...((flags.without ?? []).length > 0 ? { without: flags.without } : {}),
396
+ };
397
+ }
398
+ /**
399
+ * The install plan for a spec, or null when this server cannot answer. The preview is a read; an
400
+ * older server has no such route, and the spec preview beside it still stands. A 400 is the
401
+ * answer (a refused option or spec), not a missing plan, so it is rethrown.
402
+ */
403
+ async readInstallPlan(spec, flags, fromReviewedSpec) {
404
+ try {
405
+ const preview = await proactiveApi_1.proactiveApi.previewProactiveAgentSpec({
406
+ spec,
407
+ ...(flags['agent-id'] ? { agentId: flags['agent-id'] } : {}),
408
+ ...(flags.timezone ? { timezone: flags.timezone } : {}),
409
+ fromReviewedSpec,
410
+ ...this.declineOptions(flags),
411
+ });
412
+ return preview.items;
413
+ }
414
+ catch (err) {
415
+ if ((0, http_error_1.httpStatusOf)(err) === 400)
416
+ throw err;
417
+ return null;
418
+ }
419
+ }
420
+ async printInstallPlan(spec, flags, fromReviewedSpec) {
421
+ const items = await this.readInstallPlan(spec, flags, fromReviewedSpec);
422
+ this.log('');
423
+ if (!items) {
424
+ this.log('(The install plan could not be read from this server; the spec above is what you reviewed.)');
425
+ return;
426
+ }
427
+ for (const line of installPlanLines(items, this.config.bin))
428
+ this.log(line);
429
+ }
430
+ /**
431
+ * Refuse BEFORE creating anything when `--minimal` / `--without` were asked for and this server
432
+ * cannot honour them. A server that predates the options ignores them, applies every default and
433
+ * answers 200, which looked exactly like a successful opt-out (OSK-22586). The preview route is
434
+ * read-only and arrived with the options, so a server that answers it also applies them; a 404
435
+ * means it does not. Any other failure is thrown as it is: the apply is not attempted either way.
436
+ */
437
+ async assertServerDeclinesDefaults(spec, flags, fromReviewedSpec) {
438
+ if (!flags.minimal && (flags.without ?? []).length === 0)
439
+ return;
440
+ try {
441
+ const preview = await proactiveApi_1.proactiveApi.previewProactiveAgentSpec({
442
+ spec,
443
+ ...(flags['agent-id'] ? { agentId: flags['agent-id'] } : {}),
444
+ ...(flags.timezone ? { timezone: flags.timezone } : {}),
445
+ fromReviewedSpec,
446
+ ...this.declineOptions(flags),
447
+ });
448
+ if (preview && Array.isArray(preview.items) && preview.options)
449
+ return;
450
+ }
451
+ catch (err) {
452
+ const status = (0, http_error_1.httpStatusOf)(err);
453
+ if (status !== 404 && status !== 405 && status !== 501)
454
+ throw err;
455
+ }
456
+ this.error(exports.DECLINE_UNSUPPORTED_MESSAGE, { exit: 1 });
457
+ }
458
+ /**
459
+ * After the apply: the server must say it applied the options. Covers a rolling deploy where the
460
+ * preview was answered by a new instance and the apply by an old one. The Agent then exists with
461
+ * every default, so the error names it.
462
+ */
463
+ assertDeclinesApplied(result, flags) {
464
+ if (!flags.minimal && (flags.without ?? []).length === 0)
465
+ return;
466
+ if (result.installOptions)
467
+ return;
468
+ this.error(`${exports.DECLINE_UNSUPPORTED_MESSAGE} The Agent ${result.agentId} was created with every default; ` +
469
+ `see what it holds with \`${this.config.bin} agents triggers list ${result.agentId}\`.`, { exit: 1 });
470
+ }
265
471
  async runFromSpec(flags) {
266
472
  const body = await (0, prompt_1.readJsonBody)(flags['from-spec']);
267
473
  const spec = (body.spec ?? body);
@@ -271,17 +477,21 @@ class AgentsSpawn extends base_command_1.BaseCommand {
271
477
  return;
272
478
  }
273
479
  this.renderSpec(spec);
480
+ await this.printInstallPlan(spec, flags, true);
274
481
  this.log('');
275
482
  this.log('This is a spec preview — re-run with --approve to create the agent.');
276
483
  return;
277
484
  }
485
+ await this.assertServerDeclinesDefaults(spec, flags, true);
278
486
  const result = await proactiveApi_1.proactiveApi.applyProactiveAgentSpec({
279
487
  spec,
280
488
  ...(flags['agent-id'] ? { agentId: flags['agent-id'] } : {}),
281
489
  ...(flags.timezone ? { timezone: flags.timezone } : {}),
282
490
  fromReviewedSpec: true,
491
+ ...this.declineOptions(flags),
283
492
  });
284
493
  this.renderApplyResult(result, flags.json, Boolean(flags['agent-id']));
494
+ this.assertDeclinesApplied(result, flags);
285
495
  }
286
496
  async runFromSentence(sentence, flags) {
287
497
  const history = (flags.message ?? []).map((content) => ({
@@ -331,7 +541,12 @@ class AgentsSpawn extends base_command_1.BaseCommand {
331
541
  const spec = plan.spec;
332
542
  if (!flags.approve) {
333
543
  if (flags.json) {
334
- this.printJsonResult({ ...plan, spec: specWithEffectiveWindowFlags(spec) });
544
+ const installPlan = await this.readInstallPlan(spec, flags, false);
545
+ this.printJsonResult({
546
+ ...plan,
547
+ spec: specWithEffectiveWindowFlags(spec),
548
+ ...(installPlan ? { installPlan } : {}),
549
+ });
335
550
  return;
336
551
  }
337
552
  // The planner's own sentence about the plan (and any note about a value it
@@ -341,12 +556,15 @@ class AgentsSpawn extends base_command_1.BaseCommand {
341
556
  this.log('');
342
557
  }
343
558
  this.renderSpec(spec);
559
+ await this.printInstallPlan(spec, flags, false);
344
560
  this.log('');
345
561
  this.log('This is a draft — nothing has been created.');
346
562
  const repeat = [
347
563
  shellQuote(sentence),
348
564
  ...(flags.name ? ['--name', shellQuote(flags.name)] : []),
349
565
  ...(flags.timezone ? ['--timezone', shellQuote(flags.timezone)] : []),
566
+ ...(flags.minimal ? ['--minimal'] : []),
567
+ ...(flags.without ?? []).flatMap((name) => ['--without', name]),
350
568
  '--approve',
351
569
  ].join(' ');
352
570
  this.log(` Create it: ${this.config.bin} agents spawn ${repeat}`);
@@ -355,13 +573,16 @@ class AgentsSpawn extends base_command_1.BaseCommand {
355
573
  this.log(' --from-spec spec.json --approve');
356
574
  return;
357
575
  }
576
+ await this.assertServerDeclinesDefaults(spec, flags, false);
358
577
  const result = await proactiveApi_1.proactiveApi.applyProactiveAgentSpec({
359
578
  spec,
360
579
  ...(flags['agent-id'] ? { agentId: flags['agent-id'] } : {}),
361
580
  ...(flags.timezone ? { timezone: flags.timezone } : {}),
362
581
  fromReviewedSpec: false,
582
+ ...this.declineOptions(flags),
363
583
  });
364
584
  this.renderApplyResult(result, flags.json, Boolean(flags['agent-id']));
585
+ this.assertDeclinesApplied(result, flags);
365
586
  }
366
587
  async runRecommendationAction(flags) {
367
588
  if (flags['apply-recommendation'] && !flags['spec-hash']?.trim()) {
@@ -467,6 +688,14 @@ class AgentsSpawn extends base_command_1.BaseCommand {
467
688
  if (w) {
468
689
  const ok = w.watchers.filter((x) => x.ok).length;
469
690
  this.log(` worker: policy ${w.policy ? 'set' : 'failed'}, watchers ${ok}/${w.watchers.length}`);
691
+ // Each watcher by its trigger id, as the baseline ones below already are: the id used to be
692
+ // findable only by listing the agent's triggers (OSK-22416).
693
+ for (const watcher of w.watchers) {
694
+ if (!watcher.ok)
695
+ continue;
696
+ const state = watcher.enabled == null ? '' : watcher.enabled ? ' enabled' : ' disabled';
697
+ this.log(` ${watcher.source}:${state}${watcher.triggerId ? ` (${watcher.triggerId})` : ''}`);
698
+ }
470
699
  }
471
700
  const o = result.installed.orchestrator;
472
701
  if (o) {
@@ -485,6 +714,10 @@ class AgentsSpawn extends base_command_1.BaseCommand {
485
714
  this.log(` Preflight: ${this.config.bin} triggers preflight <trigger-id>`);
486
715
  }
487
716
  }
717
+ const runsOn = result.installed.runsOn;
718
+ if (runsOn?.label) {
719
+ this.log(` runs on: ${runsOn.label}${runsOn.kind === 'local_codex_harness' ? ' (your own machine, so its runs use that computer)' : ''}`);
720
+ }
488
721
  const alwaysOn = result.installed.alwaysOn;
489
722
  if (alwaysOn) {
490
723
  const state = alwaysOn.desiredEnabled === undefined
@@ -494,7 +727,13 @@ class AgentsSpawn extends base_command_1.BaseCommand {
494
727
  }
495
728
  const compass = result.installed.compass;
496
729
  if (compass) {
497
- this.log(` compass: ${compass.skipped ? `kept the existing one (${compass.skipped})` : compass.ok ? 'installed' : 'failed'}`);
730
+ this.log(` compass: ${compass.skipped === 'compass_unchanged'
731
+ ? 'already in place (unchanged)'
732
+ : compass.skipped
733
+ ? `kept the existing one (${compass.skipped})`
734
+ : compass.ok
735
+ ? 'installed'
736
+ : 'failed'}`);
498
737
  }
499
738
  const seeded = initializeSummary(result.installed.initialize);
500
739
  if (seeded)
@@ -509,6 +748,23 @@ class AgentsSpawn extends base_command_1.BaseCommand {
509
748
  const state = watcher.enabled == null ? 'unknown' : watcher.enabled ? 'enabled' : 'disabled';
510
749
  this.log(` ${watcher.source}: ${state}` + (watcher.triggerId ? ` (${watcher.triggerId})` : ''));
511
750
  }
751
+ // Everything that now exists on the Agent, read back: the creation-time seed and the baseline
752
+ // watchers are not in the lines above, which is how a one-watcher spec read as one (OSK-22417).
753
+ const inventory = result.installed.inventory;
754
+ if (inventory?.triggers?.length) {
755
+ this.log(' triggers on this agent:');
756
+ for (const trigger of inventory.triggers) {
757
+ this.log(` ${trigger.origin.padEnd(9)} ${trigger.label ?? trigger.source ?? '(unnamed)'}` +
758
+ ` - ${trigger.enabled ? 'enabled' : 'disabled'} (${trigger.id})`);
759
+ }
760
+ }
761
+ if (inventory?.commitments?.length) {
762
+ this.log(' system commitments on this agent:');
763
+ for (const commitment of inventory.commitments) {
764
+ this.log(` ${commitment.systemRole ?? commitment.title ?? '(unnamed)'}` +
765
+ ` - ${commitment.status ?? 'unknown'} (${commitment.id})`);
766
+ }
767
+ }
512
768
  if (result.warnings.length > 0) {
513
769
  this.log(' warnings:');
514
770
  for (const warning of result.warnings) {
@@ -3,6 +3,11 @@ import { BaseCommand } from '../../../base-command';
3
3
  * `skrr agents todos list <agent-id>` — the agent's To-Do day plan (the
4
4
  * ToDoPanel feed). To-Dos are time-boxed work blocks (manual or Smart-Schedule
5
5
  * generated). Defaults to today; `--date` steps to another day.
6
+ *
7
+ * "Today" and the day's edges are in ONE named timezone: `--timezone`, or this
8
+ * machine's, the same default `plan-day` and `schedule-trace` use. It used to be
9
+ * UTC, so at 17:15 in Vancouver `--date 2026-11-02` listed a UTC day that ended
10
+ * at 16:00 local and printed "No to-dos." for tonight's to-do (OSK-22398).
6
11
  */
7
12
  export default class AgentsTodosList extends BaseCommand {
8
13
  static description: string;
@@ -8,6 +8,11 @@ const schedule_1 = require("../../../lib/schedule");
8
8
  * `skrr agents todos list <agent-id>` — the agent's To-Do day plan (the
9
9
  * ToDoPanel feed). To-Dos are time-boxed work blocks (manual or Smart-Schedule
10
10
  * generated). Defaults to today; `--date` steps to another day.
11
+ *
12
+ * "Today" and the day's edges are in ONE named timezone: `--timezone`, or this
13
+ * machine's, the same default `plan-day` and `schedule-trace` use. It used to be
14
+ * UTC, so at 17:15 in Vancouver `--date 2026-11-02` listed a UTC day that ended
15
+ * at 16:00 local and printed "No to-dos." for tonight's to-do (OSK-22398).
11
16
  */
12
17
  class AgentsTodosList extends base_command_1.BaseCommand {
13
18
  static description = "List an agent's to-dos for a day";
@@ -21,15 +26,24 @@ class AgentsTodosList extends base_command_1.BaseCommand {
21
26
  };
22
27
  static flags = {
23
28
  json: core_1.Flags.boolean({ description: 'Output as JSON' }),
24
- date: core_1.Flags.string({ description: 'Day to list (YYYY-MM-DD). Defaults to today in the selected timezone.' }),
25
- timezone: core_1.Flags.string({ description: 'IANA timezone for the day (defaults to UTC)' }),
29
+ date: core_1.Flags.string({
30
+ description: 'Day to list (YYYY-MM-DD). Defaults to today in the selected timezone.',
31
+ }),
32
+ timezone: core_1.Flags.string({
33
+ description: "IANA timezone for the day and for the times shown (defaults to this machine's timezone, as in plan-day and schedule-trace)",
34
+ }),
26
35
  };
27
36
  async run() {
28
37
  this.requireAuth();
29
38
  const { args, flags } = await this.parse(AgentsTodosList);
39
+ const timezone = (0, schedule_1.resolveDayTimeZone)(flags.timezone);
40
+ if (!timezone) {
41
+ this.error(`Invalid IANA timezone: ${flags.timezone}`, { exit: 1 });
42
+ }
43
+ const date = flags.date ?? (0, schedule_1.scheduleTraceToday)(new Date(), timezone);
30
44
  let response;
31
45
  try {
32
- response = await schedule_1.scheduleApi.listTodos(args.id, flags.date, flags.timezone);
46
+ response = await schedule_1.scheduleApi.listTodos(args.id, date, timezone);
33
47
  }
34
48
  catch (err) {
35
49
  this.handleApiError(err);
@@ -38,8 +52,8 @@ class AgentsTodosList extends base_command_1.BaseCommand {
38
52
  this.printJsonResult((0, list_output_1.listResult)(response, 'todos'));
39
53
  return;
40
54
  }
41
- this.log(`Day timezone: ${flags.timezone || 'UTC'}`);
42
- (0, schedule_1.renderTodoList)(response.todos ?? [], (line) => this.log(line));
55
+ this.log(`Day: ${date} in ${(0, schedule_1.describeTimeZone)(timezone)}`);
56
+ (0, schedule_1.renderTodoList)(response.todos ?? [], (line) => this.log(line), timezone);
43
57
  }
44
58
  }
45
59
  exports.default = AgentsTodosList;
@@ -36,7 +36,7 @@ class AgentsTriggersCreate extends base_command_1.BaseCommand {
36
36
  label: core_1.Flags.string({ description: 'Human-readable trigger label' }),
37
37
  enabled: core_1.Flags.boolean({ description: 'Create enabled or disabled', allowNo: true }),
38
38
  mode: core_1.Flags.string({
39
- description: 'Execution mode (default send_message)',
39
+ description: `${triggers_1.TRIGGER_MODE_FLAG_DESCRIPTION} Default: send_message.`,
40
40
  options: [...triggers_1.TRIGGER_EXECUTOR_MODES],
41
41
  }),
42
42
  prompt: core_1.Flags.string({ description: 'Prompt template sent when the trigger fires' }),
@@ -28,7 +28,7 @@ class AgentsTriggersUpdate extends base_command_1.BaseCommand {
28
28
  }),
29
29
  label: core_1.Flags.string({ description: 'Human-readable trigger label' }),
30
30
  enabled: core_1.Flags.boolean({ description: 'Enable or disable the trigger', allowNo: true }),
31
- mode: core_1.Flags.string({ description: 'Execution mode', options: [...triggers_1.TRIGGER_EXECUTOR_MODES] }),
31
+ mode: core_1.Flags.string({ description: triggers_1.TRIGGER_MODE_FLAG_DESCRIPTION, options: [...triggers_1.TRIGGER_EXECUTOR_MODES] }),
32
32
  prompt: core_1.Flags.string({ description: 'Prompt template sent when the trigger fires' }),
33
33
  'builtin-action': core_1.Flags.string({
34
34
  description: 'Typed builtinAction JSON object for mode=builtin_action',
@@ -31,6 +31,7 @@ export default class AgentsUpcoming extends BaseCommand {
31
31
  kinds: import("@oclif/core/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
32
32
  expand: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
33
33
  cursor: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
34
+ timezone: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
34
35
  };
35
36
  run(): Promise<void>;
36
37
  }
@@ -4,6 +4,7 @@ const core_1 = require("@oclif/core");
4
4
  const data_provider_1 = require("@skrr-ai/data-provider");
5
5
  const base_command_1 = require("../../base-command");
6
6
  const format_1 = require("../../lib/format");
7
+ const schedule_1 = require("../../lib/schedule");
7
8
  const triggers_1 = require("../../lib/triggers");
8
9
  const UPCOMING_KINDS = ['message', 'agent_trigger'];
9
10
  /**
@@ -51,11 +52,18 @@ class AgentsUpcoming extends base_command_1.BaseCommand {
51
52
  options: ['first', 'all'],
52
53
  }),
53
54
  cursor: core_1.Flags.string({ description: 'Pagination cursor (nextCursor from a previous page)' }),
55
+ timezone: core_1.Flags.string({
56
+ description: "IANA timezone the times are shown in (defaults to this machine's timezone, as in schedule-trace and plan-day). --json keeps UTC.",
57
+ }),
54
58
  };
55
59
  async run() {
56
60
  this.requireAuth();
57
61
  const { args, flags } = await this.parse(AgentsUpcoming);
58
62
  const kinds = (0, triggers_1.splitRepeated)(flags.kinds);
63
+ const zone = (0, schedule_1.resolveDayTimeZone)(flags.timezone);
64
+ if (!zone) {
65
+ this.error(`Invalid IANA timezone: ${flags.timezone}`, { exit: 1 });
66
+ }
59
67
  let response;
60
68
  try {
61
69
  response = await data_provider_1.dataService.getUpcoming({
@@ -82,13 +90,17 @@ class AgentsUpcoming extends base_command_1.BaseCommand {
82
90
  : `Nothing upcoming for agent ${args.id}.`);
83
91
  return;
84
92
  }
93
+ // Times are shown in one named zone, like the rest of the schedule output;
94
+ // server-written text (a prompt preview, a fallback caption) can still embed
95
+ // a UTC instant, so those are rewritten into the same zone (OSK-22588).
96
+ this.log(`Times in ${(0, schedule_1.describeTimeZone)(zone)}`);
85
97
  (0, format_1.renderTable)(items.map((item) => ({
86
- when: formatFireAt(item.fireAt),
98
+ when: formatFireAt(item.fireAt, zone),
87
99
  kind: item.kind,
88
- title: titleOf(item),
89
- detail: detailOf(item),
100
+ title: (0, format_1.localizeIsoInstants)(titleOf(item), zone),
101
+ detail: (0, format_1.localizeIsoInstants)(detailOf(item), zone),
90
102
  })), [
91
- { key: 'when', header: 'WHEN', maxWidth: 26 },
103
+ { key: 'when', header: 'WHEN', maxWidth: 28 },
92
104
  { key: 'kind', header: 'KIND', maxWidth: 14 },
93
105
  { key: 'title', header: 'TITLE', maxWidth: 36 },
94
106
  { key: 'detail', header: 'DETAIL', maxWidth: 48 },
@@ -100,9 +112,8 @@ class AgentsUpcoming extends base_command_1.BaseCommand {
100
112
  }
101
113
  }
102
114
  exports.default = AgentsUpcoming;
103
- function formatFireAt(iso) {
104
- const d = new Date(iso);
105
- return Number.isNaN(d.getTime()) ? iso : d.toISOString();
115
+ function formatFireAt(iso, zone) {
116
+ return (0, format_1.zonedTime)(iso, zone, { seconds: false });
106
117
  }
107
118
  /** A human title for either upcoming-item shape. */
108
119
  function titleOf(item) {
@@ -17,12 +17,22 @@ const commitment_product_1 = require("../../lib/commitment-product");
17
17
  const commitments_1 = require("../../lib/commitments");
18
18
  const DEFAULT_EVENT_DRIVEN_BACKSTOP_MS = 24 * 60 * 60 * 1000;
19
19
  const DEFAULT_EVENT_SOURCES = new Set(['github', 'slack', 'email', 'calendar']);
20
+ /**
21
+ * Every GitHub event a Commitment's watched source can receive: the server's own list
22
+ * (`GITHUB_EVENT_DELIVERY_PERMISSION` in CommitmentTriggerBindings). The selector offered seven of
23
+ * the ten, so `workflow_run_failed`, `workflow_run_succeeded` and `pull_request_synchronized` —
24
+ * all in the event catalog — were refused locally with no word on whether Commitments support them
25
+ * (OSK-21683). They do.
26
+ */
20
27
  const GITHUB_EVENT_OPTIONS = [
21
28
  'pull_request_opened',
22
29
  'pull_request_merged',
30
+ 'pull_request_synchronized',
23
31
  'review_requested',
24
32
  'check_run_failed',
25
33
  'check_run_succeeded',
34
+ 'workflow_run_failed',
35
+ 'workflow_run_succeeded',
26
36
  'issue_opened',
27
37
  'comment_created',
28
38
  ];
@@ -333,12 +343,12 @@ JSON
333
343
  description: 'Watched source the criterion reads (implies --evaluator source_state), e.g. github',
334
344
  }),
335
345
  watch: core_1.Flags.string({
336
- description: `Watched source (repeatable). One of: ${commitments_1.COMMITMENT_WATCHED_SOURCES.join(', ')}. Some sources need companion flags: --watch-space, --watch-monitor, --metric-key.`,
346
+ description: `Watched source (repeatable). One of: ${commitments_1.COMMITMENT_WATCHED_SOURCES.join(', ')}. Some sources need companion flags: --watch-space, --watch-monitor, --metric-key. conversations and messages need an id (config.conversationId, config.groupChatId) that only --from-json can set.`,
337
347
  multiple: true,
338
348
  options: [...commitments_1.COMMITMENT_WATCHED_SOURCES],
339
349
  }),
340
350
  'github-event': core_1.Flags.string({
341
- description: 'GitHub event to watch (repeatable; implies --watch github). Use check_run_failed for CI remediation.',
351
+ description: 'GitHub event to watch (repeatable; implies --watch github). Use check_run_failed for one failing check, workflow_run_failed or workflow_run_succeeded for a whole workflow.',
342
352
  multiple: true,
343
353
  options: [...GITHUB_EVENT_OPTIONS],
344
354
  }),
@@ -361,10 +371,10 @@ JSON
361
371
  multiple: true,
362
372
  }),
363
373
  cadence: core_1.Flags.string({
364
- description: 'Check interval, e.g. "15m", "6h", "30d" (1m..365d). Defaults to interval mode; with --event-driven, this is the timed backstop.',
374
+ description: 'Check interval, e.g. "15m", "6h", "30d" (1m..365d). Defaults to interval mode; with --event-driven, this is the recovery interval: a missed event is not replayed, the next interval re-checks current state.',
365
375
  }),
366
376
  'event-driven': core_1.Flags.boolean({
367
- description: 'Wake on matching watched-source events, with a timed backstop from --cadence (default 24h). Requires an event-capable watched source and cannot be combined with a different --cadence-mode.',
377
+ description: 'Wake on matching watched-source events, so checks come sooner than --cadence (default 24h). An event can be missed and is not replayed; every interval the Commitment re-checks current state instead. Requires an event-capable watched source and cannot be combined with a different --cadence-mode.',
368
378
  }),
369
379
  'cadence-mode': core_1.Flags.string({
370
380
  description: 'Advanced cadence mode (default: interval when --cadence is set, else manual). Prefer --event-driven for event_plus_interval with a 24h default backstop.',