@skrr-ai/cli 0.1.143 → 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 (88) hide show
  1. package/README.md +8 -0
  2. package/dist/commands/agenda/trigger/create.js +4 -2
  3. package/dist/commands/agenda/trigger/list.js +7 -7
  4. package/dist/commands/agent/message/approve.d.ts +17 -0
  5. package/dist/commands/agent/message/approve.js +72 -0
  6. package/dist/commands/agent/message/decline.d.ts +17 -0
  7. package/dist/commands/agent/message/decline.js +72 -0
  8. package/dist/commands/agent/message/pending.d.ts +18 -0
  9. package/dist/commands/agent/message/pending.js +79 -0
  10. package/dist/commands/agents/delete.d.ts +45 -0
  11. package/dist/commands/agents/delete.js +139 -2
  12. package/dist/commands/agents/plan-day.d.ts +39 -7
  13. package/dist/commands/agents/plan-day.js +254 -65
  14. package/dist/commands/agents/proactive-audit.d.ts +22 -0
  15. package/dist/commands/agents/proactive-audit.js +86 -0
  16. package/dist/commands/agents/schedule-overview.d.ts +7 -0
  17. package/dist/commands/agents/schedule-overview.js +43 -5
  18. package/dist/commands/agents/schedule-trace.js +30 -19
  19. package/dist/commands/agents/spawn.d.ts +42 -0
  20. package/dist/commands/agents/spawn.js +91 -4
  21. package/dist/commands/agents/todos/list.d.ts +5 -0
  22. package/dist/commands/agents/todos/list.js +19 -5
  23. package/dist/commands/agents/triggers/create.js +1 -1
  24. package/dist/commands/agents/triggers/update.js +1 -1
  25. package/dist/commands/commitments/create.js +13 -3
  26. package/dist/commands/commitments/preflight.js +14 -3
  27. package/dist/commands/initiatives/worker/deactivate.d.ts +23 -0
  28. package/dist/commands/initiatives/worker/deactivate.js +78 -0
  29. package/dist/commands/login.js +8 -2
  30. package/dist/commands/logout.d.ts +20 -0
  31. package/dist/commands/logout.js +110 -5
  32. package/dist/commands/memory/maintain.js +16 -2
  33. package/dist/commands/spaces/delete.js +6 -1
  34. package/dist/commands/spaces/workflows/archive.js +6 -1
  35. package/dist/commands/spaces/workflows/publish.js +3 -1
  36. package/dist/commands/spaces/workflows/run.d.ts +1 -0
  37. package/dist/commands/spaces/workflows/run.js +17 -1
  38. package/dist/commands/spaces/workflows/triggers/create.js +3 -1
  39. package/dist/commands/tasks/workflow-context.js +3 -1
  40. package/dist/commands/triggers/capabilities.js +17 -1
  41. package/dist/commands/triggers/create.d.ts +2 -0
  42. package/dist/commands/triggers/create.js +23 -7
  43. package/dist/commands/triggers/fire-detail.js +12 -3
  44. package/dist/commands/triggers/list.d.ts +1 -0
  45. package/dist/commands/triggers/list.js +13 -1
  46. package/dist/commands/triggers/preflight.js +18 -0
  47. package/dist/commands/triggers/prune.js +9 -5
  48. package/dist/commands/triggers/update.js +13 -4
  49. package/dist/generated/agent-guides.json +35 -35
  50. package/dist/lib/agent-proactive-baseline.js +7 -1
  51. package/dist/lib/commitments.d.ts +16 -9
  52. package/dist/lib/commitments.js +65 -4
  53. package/dist/lib/daemon-setup.js +9 -3
  54. package/dist/lib/daemonBroker.d.ts +7 -0
  55. package/dist/lib/daemonBroker.js +5 -0
  56. package/dist/lib/daemonHandoff.d.ts +2 -0
  57. package/dist/lib/daemonHandoff.js +10 -1
  58. package/dist/lib/daemonIslandProfile.d.ts +19 -0
  59. package/dist/lib/daemonIslandProfile.js +41 -0
  60. package/dist/lib/format.d.ts +32 -0
  61. package/dist/lib/format.js +105 -1
  62. package/dist/lib/initiatives-worker.d.ts +25 -0
  63. package/dist/lib/initiatives-worker.js +13 -0
  64. package/dist/lib/login.d.ts +7 -0
  65. package/dist/lib/login.js +5 -0
  66. package/dist/lib/proactive-audit.d.ts +52 -0
  67. package/dist/lib/proactive-audit.js +67 -0
  68. package/dist/lib/proactiveApi.d.ts +9 -0
  69. package/dist/lib/refresh.d.ts +20 -6
  70. package/dist/lib/refresh.js +27 -9
  71. package/dist/lib/roles.d.ts +1 -1
  72. package/dist/lib/schedule.d.ts +189 -9
  73. package/dist/lib/schedule.js +283 -22
  74. package/dist/lib/triggers.d.ts +134 -3
  75. package/dist/lib/triggers.js +370 -17
  76. package/dist/lib/workflow-node-control.js +8 -0
  77. package/dist/lib/workflow-run-view.js +9 -0
  78. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/index.d.ts +1 -1
  79. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/index.js +2 -0
  80. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/refresh.d.ts +22 -0
  81. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/refresh.js +15 -4
  82. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/index.d.ts +1 -1
  83. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/index.js +1 -1
  84. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/refresh.d.ts +22 -0
  85. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/refresh.js +22 -4
  86. package/dist/node_modules/@skrr-ai/data-provider/index.js +4779 -4741
  87. package/oclif.manifest.json +494 -26
  88. package/package.json +1 -1
@@ -1,5 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.pausedTriggers = pausedTriggers;
4
+ exports.pausedTriggerLines = pausedTriggerLines;
3
5
  exports.reflectionSummary = reflectionSummary;
4
6
  exports.reflectionLine = reflectionLine;
5
7
  exports.reflectionNoteLine = reflectionNoteLine;
@@ -44,6 +46,7 @@ class AgentsScheduleOverview extends base_command_1.BaseCommand {
44
46
  this.requireAuth();
45
47
  const { args, flags } = await this.parse(AgentsScheduleOverview);
46
48
  const agentId = args.id;
49
+ const todayZone = (0, schedule_1.machineTimeZone)();
47
50
  const [upcomingR, firesR, triggersR, tasksR, todosR] = await Promise.allSettled([
48
51
  data_provider_1.dataService.getUpcoming({
49
52
  agentId,
@@ -55,15 +58,18 @@ class AgentsScheduleOverview extends base_command_1.BaseCommand {
55
58
  scope: 'agent',
56
59
  refEntity: (0, triggers_1.agentRefEntity)(agentId),
57
60
  limit: 200,
58
- // Whether the reflection loop's fires run: its row carries the verdict (OSK-21606).
59
- include: 'autonomy',
61
+ // Whether the reflection loop's fires run: its row carries the verdict (OSK-21606). And whether
62
+ // the scheduler would still claim a limited schedule's next slot (OSK-22526).
63
+ include: 'autonomy,limits',
60
64
  })),
61
65
  // Filter SERVER-side. Fetching an unfiltered page and filtering in memory
62
66
  // silently truncates the section for any user with more tasks than
63
67
  // --task-limit, and made this view disagree with its MCP mirror
64
68
  // (`self_schedule_overview`), which queries by assignee.
65
69
  data_provider_1.dataService.listTasks({ assigneeAgentId: agentId, limit: flags['task-limit'] }),
66
- schedule_1.scheduleApi.listTodos(agentId),
70
+ // "Today" is the reader's day, not UTC's: the same zone todos list,
71
+ // plan-day and schedule-trace use (OSK-22398).
72
+ schedule_1.scheduleApi.listTodos(agentId, (0, schedule_1.scheduleTraceToday)(new Date(), todayZone), todayZone),
67
73
  ]);
68
74
  const upcoming = settledValue(upcomingR)?.items ?? [];
69
75
  // Triggers the Always-On control fence refuses. The server withholds them
@@ -80,6 +86,7 @@ class AgentsScheduleOverview extends base_command_1.BaseCommand {
80
86
  agentId,
81
87
  reflection: reflection ? reflectionSummary(reflection) : null,
82
88
  upcoming,
89
+ pausedTriggers: pausedTriggers(triggers, reflection),
83
90
  recentFires: fires,
84
91
  openTasks,
85
92
  todos,
@@ -121,6 +128,15 @@ class AgentsScheduleOverview extends base_command_1.BaseCommand {
121
128
  { key: 'detail', header: 'DETAIL', maxWidth: 44 },
122
129
  ], (line) => this.log(line));
123
130
  }
131
+ // A trigger made disabled (the safe way to author one) is not "upcoming", and used to appear
132
+ // nowhere in this view, so a person could not tell their create had worked (OSK-22493).
133
+ const paused = pausedTriggers(triggers, reflection);
134
+ if (paused.length > 0) {
135
+ this.log('');
136
+ this.log(`■ Paused triggers (${paused.length}, not in Upcoming until enabled)`);
137
+ for (const line of pausedTriggerLines(paused, agentId, this.config.bin))
138
+ this.log(line);
139
+ }
124
140
  if (blockedUpcoming.length > 0) {
125
141
  const definite = blockedUpcoming.filter((b) => !b.indeterminate);
126
142
  const unknown = blockedUpcoming.length - definite.length;
@@ -165,9 +181,9 @@ class AgentsScheduleOverview extends base_command_1.BaseCommand {
165
181
  }
166
182
  // Today's to-dos.
167
183
  this.log('');
168
- this.log("■ Today's to-dos");
184
+ this.log(`■ Today's to-dos (${(0, schedule_1.scheduleTraceToday)(new Date(), todayZone)} in ${(0, schedule_1.describeTimeZone)(todayZone)})`);
169
185
  reportError(todosR, (line) => this.log(` ${line}`));
170
- (0, schedule_1.renderTodoList)(todos, (line) => this.log(line));
186
+ (0, schedule_1.renderTodoList)(todos, (line) => this.log(line), todayZone);
171
187
  }
172
188
  }
173
189
  exports.default = AgentsScheduleOverview;
@@ -188,6 +204,28 @@ function filterAgentOpenTasks(response, agentId) {
188
204
  return av - bv;
189
205
  });
190
206
  }
207
+ /** How many paused triggers the overview lists before pointing at the full list. */
208
+ const PAUSED_TRIGGER_LIMIT = 10;
209
+ /**
210
+ * Disabled triggers the person (or an agent on their behalf) authored. Not the reflection loop, which has
211
+ * its own section, and not a row a platform producer maintains, which nobody paused on purpose.
212
+ */
213
+ function pausedTriggers(triggers, reflection) {
214
+ return triggers
215
+ .filter((t) => t.enabled === false && t.producerOwned !== true && t.id !== reflection?.id)
216
+ .sort((a, b) => String(b.createdAt ?? '').localeCompare(String(a.createdAt ?? '')));
217
+ }
218
+ /** The paused triggers as the text view prints them: newest first, capped, with where to see the rest. */
219
+ function pausedTriggerLines(paused, agentId, bin) {
220
+ const lines = paused.slice(0, PAUSED_TRIGGER_LIMIT).map((t) => {
221
+ const when = (0, triggers_1.scheduleSummaryLine)(t);
222
+ return ` ${t.id ?? '-'} ${t.kind ?? '-'} ${t.label ?? '(unlabeled)'}${when ? ` — ${when}` : ''}`;
223
+ });
224
+ if (paused.length > PAUSED_TRIGGER_LIMIT) {
225
+ lines.push(` … and ${paused.length - PAUSED_TRIGGER_LIMIT} more: ${bin} agents triggers list ${agentId}`);
226
+ }
227
+ return lines;
228
+ }
191
229
  function describeCadence(trigger) {
192
230
  const minutes = (0, reflection_1.reflectionCadenceMinutes)(trigger);
193
231
  return minutes ? (0, reflection_1.describeCadenceMinutes)(minutes) : 'unknown';
@@ -25,27 +25,28 @@ class AgentsScheduleTrace extends base_command_1.BaseCommand {
25
25
  };
26
26
  static flags = {
27
27
  json: core_1.Flags.boolean({ description: 'Output as JSON' }),
28
- date: core_1.Flags.string({ description: 'Plan date (YYYY-MM-DD). Defaults to today in the plan timezone.' }),
28
+ date: core_1.Flags.string({
29
+ description: 'Plan date (YYYY-MM-DD). Defaults to today in the plan timezone.',
30
+ }),
29
31
  todo: core_1.Flags.string({ description: 'Scope the trace to one to-do' }),
30
- timezone: core_1.Flags.string({ description: 'IANA timezone for the plan day' }),
32
+ timezone: core_1.Flags.string({
33
+ description: "IANA timezone for the plan day and for the times shown (defaults to this machine's timezone, as in plan-day and todos list)",
34
+ }),
31
35
  limit: core_1.Flags.integer({ description: 'Events to return (1-200)' }),
32
36
  cursor: core_1.Flags.string({ description: 'Cursor from a previous page' }),
33
37
  };
34
38
  async run() {
35
39
  this.requireAuth();
36
40
  const { args, flags } = await this.parse(AgentsScheduleTrace);
37
- // Use the same zone for choosing the day and querying its events. UTC can
38
- // already be tomorrow while it is still evening for the reader.
39
- const timezone = flags.timezone ?? (flags.date ? undefined : Intl.DateTimeFormat().resolvedOptions().timeZone);
40
- let date = flags.date;
41
- if (!date) {
42
- try {
43
- date = (0, schedule_1.scheduleTraceToday)(new Date(), timezone);
44
- }
45
- catch {
46
- this.error(`Invalid IANA timezone: ${timezone}`, { exit: 1 });
47
- }
41
+ // One zone chooses the day, queries its events and renders them. UTC can
42
+ // already be tomorrow while it is still evening for the reader, and a
43
+ // `--date` with no zone used to fall through to whatever zone the server
44
+ // last saw, which is not the one the plan-day command proposed in.
45
+ const timezone = (0, schedule_1.resolveDayTimeZone)(flags.timezone);
46
+ if (!timezone) {
47
+ this.error(`Invalid IANA timezone: ${flags.timezone}`, { exit: 1 });
48
48
  }
49
+ const date = flags.date ?? (0, schedule_1.scheduleTraceToday)(new Date(), timezone);
49
50
  let trace;
50
51
  try {
51
52
  trace = await schedule_1.scheduleApi.scheduleTrace({
@@ -67,20 +68,30 @@ class AgentsScheduleTrace extends base_command_1.BaseCommand {
67
68
  if (!trace) {
68
69
  this.error('No trace returned.', { exit: 1 });
69
70
  }
71
+ // Every time below is shown in the trace's own zone, named once here and
72
+ // on each row: the WHEN column was unlabelled UTC under a header naming the
73
+ // local day, so an evening event read as tomorrow's (OSK-22397). `--json`
74
+ // keeps the raw UTC instants.
75
+ const zone = trace.timezone || timezone;
70
76
  this.log(`Schedule trace — ${trace.agentId ?? args.agent} · ${trace.planDate ?? date}`);
71
- if (trace.timezone) {
72
- this.log(` timezone ${trace.timezone}`);
73
- }
77
+ this.log(` timezone ${(0, schedule_1.describeTimeZone)(zone)} — times below are in this zone`);
74
78
  const summary = trace.summary;
75
79
  if (summary) {
76
80
  this.log(` changes ${summary.changeCount ?? 0}`);
77
81
  if (summary.latestChangeAt) {
78
- this.log(` last change ${summary.latestChangeAt}`);
82
+ this.log(` last change ${(0, format_1.zonedTime)(summary.latestChangeAt, zone)}`);
79
83
  }
80
84
  if (summary.latestChangeSummary) {
81
85
  this.log(` latest ${summary.latestChangeSummary}`);
82
86
  }
83
87
  }
88
+ // Whether a plan is being generated for this day, or the last attempt failed
89
+ // or went quiet. Said before the events because it explains why the day may
90
+ // look unplanned, and nothing in the event stream would.
91
+ const planning = (0, schedule_1.describePlanRequest)(trace.planRequest);
92
+ if (planning) {
93
+ this.log(` planning ${planning}`);
94
+ }
84
95
  const events = trace.events ?? [];
85
96
  this.log('');
86
97
  if (events.length === 0) {
@@ -101,7 +112,7 @@ class AgentsScheduleTrace extends base_command_1.BaseCommand {
101
112
  return;
102
113
  }
103
114
  (0, format_1.renderTable)(events.map((e) => ({
104
- when: e.occurredAt ? String(e.occurredAt).slice(0, 19).replace('T', ' ') : '-',
115
+ when: (0, format_1.zonedTime)(e.occurredAt, zone),
105
116
  source: (0, format_1.formatCell)(e.source),
106
117
  type: (0, format_1.formatCell)(e.type),
107
118
  status: (0, format_1.formatCell)(e.status),
@@ -109,7 +120,7 @@ class AgentsScheduleTrace extends base_command_1.BaseCommand {
109
120
  })), [
110
121
  { key: 'when', header: 'WHEN' },
111
122
  { key: 'source', header: 'SOURCE' },
112
- { key: 'type', header: 'TYPE', maxWidth: 26 },
123
+ { key: 'type', header: 'TYPE', maxWidth: 32 },
113
124
  { key: 'status', header: 'STATUS' },
114
125
  { key: 'summary', header: 'SUMMARY', maxWidth: 48 },
115
126
  ], (line) => this.log(line));
@@ -8,6 +8,47 @@ export type ProactiveInstallReadiness = {
8
8
  export declare function workerPolicyWindowLines(policy: NonNullable<ProactiveAgentSpec['worker']>['policy']): string[];
9
9
  /** JSON previews show the effective disabled state without mutating the input spec. */
10
10
  export declare function specWithEffectiveWindowFlags(spec: ProactiveAgentSpec): ProactiveAgentSpec;
11
+ /**
12
+ * A spec that validates as it stands: what `--print-spec-template` prints and what `--from-spec`
13
+ * reads. The shape was discoverable only by running a plan-only spawn and copying the `spec` out of
14
+ * its JSON (OSK-22416). Every key here is one the server's strict schema accepts, and a key it does
15
+ * not know is refused, so the template stays minimal rather than listing every optional field.
16
+ */
17
+ export declare const SPEC_TEMPLATE: {
18
+ readonly identity: {
19
+ readonly name: "Overdue-work watcher";
20
+ readonly description: "Flags overdue tasks and stalled goals, and asks before acting.";
21
+ readonly provider: "agentic";
22
+ readonly model: "default";
23
+ };
24
+ readonly systems: readonly ["worker", "orchestrator"];
25
+ readonly worker: {
26
+ readonly watchers: readonly [{
27
+ readonly source: "task_goal_watcher";
28
+ readonly intervalMinutes: 60;
29
+ }];
30
+ readonly policy: {
31
+ readonly mode: "ask_first";
32
+ readonly workingHours: {
33
+ readonly enabled: true;
34
+ readonly start: "09:00";
35
+ readonly end: "18:00";
36
+ readonly timezone: "America/Los_Angeles";
37
+ };
38
+ };
39
+ };
40
+ readonly orchestrator: {
41
+ readonly mode: "review";
42
+ readonly executePlan: false;
43
+ readonly workingHours: {
44
+ readonly start: "09:00";
45
+ readonly end: "18:00";
46
+ readonly timezone: "America/Los_Angeles";
47
+ };
48
+ };
49
+ };
50
+ /** What the template's fields mean and which values they take, for `agents spawn --help`. */
51
+ export declare const SPEC_FORMAT_HELP: string;
11
52
  /** A value as one POSIX shell word, so a printed command can be pasted as it is. */
12
53
  export declare function shellQuote(value: string): string;
13
54
  /**
@@ -53,6 +94,7 @@ export default class AgentsSpawn extends BaseCommand {
53
94
  'apply-recommendation': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
54
95
  'spec-hash': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
55
96
  'from-spec': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
97
+ 'print-spec-template': import("@oclif/core/interfaces").BooleanFlag<boolean>;
56
98
  'agent-id': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
57
99
  name: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
58
100
  message: import("@oclif/core/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SPEC_FORMAT_HELP = exports.SPEC_TEMPLATE = void 0;
3
4
  exports.workerPolicyWindowLines = workerPolicyWindowLines;
4
5
  exports.specWithEffectiveWindowFlags = specWithEffectiveWindowFlags;
5
6
  exports.shellQuote = shellQuote;
@@ -45,6 +46,44 @@ function specWithEffectiveWindowFlags(spec) {
45
46
  },
46
47
  };
47
48
  }
49
+ /**
50
+ * A spec that validates as it stands: what `--print-spec-template` prints and what `--from-spec`
51
+ * reads. The shape was discoverable only by running a plan-only spawn and copying the `spec` out of
52
+ * its JSON (OSK-22416). Every key here is one the server's strict schema accepts, and a key it does
53
+ * not know is refused, so the template stays minimal rather than listing every optional field.
54
+ */
55
+ exports.SPEC_TEMPLATE = {
56
+ identity: {
57
+ name: 'Overdue-work watcher',
58
+ description: 'Flags overdue tasks and stalled goals, and asks before acting.',
59
+ provider: 'agentic',
60
+ model: 'default',
61
+ },
62
+ systems: ['worker', 'orchestrator'],
63
+ worker: {
64
+ watchers: [{ source: 'task_goal_watcher', intervalMinutes: 60 }],
65
+ policy: {
66
+ mode: 'ask_first',
67
+ workingHours: { enabled: true, start: '09:00', end: '18:00', timezone: 'America/Los_Angeles' },
68
+ },
69
+ },
70
+ orchestrator: {
71
+ mode: 'review',
72
+ executePlan: false,
73
+ workingHours: { start: '09:00', end: '18:00', timezone: 'America/Los_Angeles' },
74
+ },
75
+ };
76
+ /** What the template's fields mean and which values they take, for `agents spawn --help`. */
77
+ exports.SPEC_FORMAT_HELP = [
78
+ 'SPEC FORMAT (--from-spec). --print-spec-template prints a valid spec; unknown keys are refused.',
79
+ '- identity: name, provider, model (required); description, instructions, category.',
80
+ '- systems: any of worker, orchestrator. An empty list installs neither and skips the baseline watchers.',
81
+ '- worker (installed when systems has worker): watchers (1-8) and policy.',
82
+ '- 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).',
83
+ '- worker.policy.mode: suggestions_only, ask_first, auto_run_limited, auto_run. workingHours and quietHours: { enabled, start, end, timezone }, with times as "HH:MM".',
84
+ '- orchestrator (installed when systems has orchestrator): mode review or auto, executePlan true or false, workingHours { start, end, timezone }.',
85
+ '- Optional: commitments (at most 3), initialize { goals, tasks, jobs }, compass, autonomyPosture.',
86
+ ].join('\n');
48
87
  /** A value as one POSIX shell word, so a printed command can be pasted as it is. */
49
88
  function shellQuote(value) {
50
89
  return `'${value.replace(/'/g, `'\\''`)}'`;
@@ -80,7 +119,17 @@ function initializeSummary(initialize) {
80
119
  */
81
120
  function proactiveInstallReadiness(result, bin) {
82
121
  if (result.warnings.length === 0) {
83
- return { status: 'ready', message: 'All requested setup steps completed.' };
122
+ // READY describes setup, not what the Agent does next. A new Agent with Always-On on starts its
123
+ // first runs in the background, and one that fails shows up in the operating review, not here:
124
+ // a spawned Agent read READY while its first run had already failed (OSK-22359).
125
+ const safeAgent = /^[A-Za-z0-9_-]+$/.test(result.agentId) ? result.agentId : null;
126
+ const firstRuns = result.installed.alwaysOn?.desiredEnabled === true && safeAgent;
127
+ return {
128
+ status: 'ready',
129
+ message: firstRuns
130
+ ? `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.`
131
+ : 'All requested setup steps completed.',
132
+ };
84
133
  }
85
134
  if (result.warnings.some((warning) => warning.step.startsWith('commitment.'))) {
86
135
  // A Commitment the owner deleted is reported, not repaired: it was not recreated on
@@ -151,6 +200,23 @@ function proactiveInstallReadiness(result, bin) {
151
200
  message: 'Some worker time windows are disabled because their enablement was not specified. Review the warnings.',
152
201
  };
153
202
  }
203
+ // The only thing that went wrong is the new Agent's own creation-time setup (for example its
204
+ // first-day question could not be queued because it runs on the cloud Agent Worker). Re-running
205
+ // the spec cannot fix that, and the old generic message and repair command (the command just run)
206
+ // said neither what degraded nor where to look (OSK-22416).
207
+ const provisioningOnly = result.warnings.length > 0 &&
208
+ result.warnings.every((warning) => warning.code === 'proactive_provisioning_incomplete');
209
+ if (provisioningOnly) {
210
+ const inspectAgent = /^[A-Za-z0-9_-]+$/.test(result.agentId) ? result.agentId : null;
211
+ return {
212
+ status: 'degraded',
213
+ message: 'What the spec asked for is installed. Part of the new Agent\u2019s own setup did not finish; ' +
214
+ 'the warning below says which part and why. Re-running the spec does not change that.',
215
+ ...(inspectAgent
216
+ ? { repairCommand: `${bin} commitments operating-review ${inspectAgent}` }
217
+ : {}),
218
+ };
219
+ }
154
220
  // A full trigger budget must not make a new persona-only Agent look broken
155
221
  // when its core system commitments, local execution policy, and Always-On
156
222
  // state installed successfully. The optional backlog watcher is deferred;
@@ -188,7 +254,7 @@ function proactiveInstallReadiness(result, bin) {
188
254
  * `--from-spec` for an exact, reviewed install (which may carry higher autonomy).
189
255
  */
190
256
  class AgentsSpawn extends base_command_1.BaseCommand {
191
- static description = 'Spawn a complete proactive agent from one sentence (plan → review → approve)';
257
+ static description = 'Spawn a complete proactive agent from one sentence (plan → review → approve)\n\n' + exports.SPEC_FORMAT_HELP;
192
258
  static examples = [
193
259
  '<%= config.bin %> agents spawn "watch my Slack and flag urgent unanswered messages"',
194
260
  '<%= config.bin %> agents spawn "plan my day every morning, working hours 9-6" --approve',
@@ -196,6 +262,7 @@ class AgentsSpawn extends base_command_1.BaseCommand {
196
262
  '<%= config.bin %> agents spawn "watch launch blockers" --recommend',
197
263
  '<%= config.bin %> agents spawn --approve-recommendation par_123 --spec-hash <reviewed-hash>',
198
264
  '<%= config.bin %> agents spawn --apply-recommendation par_123 --spec-hash <reviewed-hash>',
265
+ '<%= config.bin %> agents spawn --print-spec-template > spec.json',
199
266
  '<%= config.bin %> agents spawn --from-spec spec.json --approve',
200
267
  ];
201
268
  static args = {
@@ -222,7 +289,10 @@ class AgentsSpawn extends base_command_1.BaseCommand {
222
289
  description: 'Hash from the reviewed recommendation (required for apply; optional for approval)',
223
290
  }),
224
291
  '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.',
292
+ 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.',
293
+ }),
294
+ 'print-spec-template': core_1.Flags.boolean({
295
+ description: 'Print a valid spec JSON to edit and pass to --from-spec, and exit (creates nothing)',
226
296
  }),
227
297
  'agent-id': core_1.Flags.string({
228
298
  description: 'Apply onto an existing agent instead of creating a new one (convergent re-run)',
@@ -237,8 +307,13 @@ class AgentsSpawn extends base_command_1.BaseCommand {
237
307
  timezone: core_1.Flags.string({ description: 'IANA timezone for working-hours defaults' }),
238
308
  };
239
309
  async run() {
240
- this.requireAuth();
241
310
  const { args, flags } = await this.parse(AgentsSpawn);
311
+ // Reads nothing and creates nothing, so it needs no sign-in.
312
+ if (flags['print-spec-template']) {
313
+ this.log(JSON.stringify(exports.SPEC_TEMPLATE, null, 2));
314
+ return;
315
+ }
316
+ this.requireAuth();
242
317
  if (flags.recommend && flags['from-spec']) {
243
318
  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
319
  }
@@ -467,6 +542,14 @@ class AgentsSpawn extends base_command_1.BaseCommand {
467
542
  if (w) {
468
543
  const ok = w.watchers.filter((x) => x.ok).length;
469
544
  this.log(` worker: policy ${w.policy ? 'set' : 'failed'}, watchers ${ok}/${w.watchers.length}`);
545
+ // Each watcher by its trigger id, as the baseline ones below already are: the id used to be
546
+ // findable only by listing the agent's triggers (OSK-22416).
547
+ for (const watcher of w.watchers) {
548
+ if (!watcher.ok)
549
+ continue;
550
+ const state = watcher.enabled == null ? '' : watcher.enabled ? ' enabled' : ' disabled';
551
+ this.log(` ${watcher.source}:${state}${watcher.triggerId ? ` (${watcher.triggerId})` : ''}`);
552
+ }
470
553
  }
471
554
  const o = result.installed.orchestrator;
472
555
  if (o) {
@@ -485,6 +568,10 @@ class AgentsSpawn extends base_command_1.BaseCommand {
485
568
  this.log(` Preflight: ${this.config.bin} triggers preflight <trigger-id>`);
486
569
  }
487
570
  }
571
+ const runsOn = result.installed.runsOn;
572
+ if (runsOn?.label) {
573
+ this.log(` runs on: ${runsOn.label}${runsOn.kind === 'local_codex_harness' ? ' (your own machine, so its runs use that computer)' : ''}`);
574
+ }
488
575
  const alwaysOn = result.installed.alwaysOn;
489
576
  if (alwaysOn) {
490
577
  const state = alwaysOn.desiredEnabled === undefined
@@ -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',
@@ -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
  ];
@@ -338,7 +348,7 @@ JSON
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.',
@@ -234,7 +234,7 @@ class CommitmentsPreflight extends base_command_1.BaseCommand {
234
234
  description: 'Unsaved Commitment create body file, or - for stdin',
235
235
  }),
236
236
  'event-fixture': core_1.Flags.string({
237
- description: 'Optional event fixture JSON file, or - for stdin',
237
+ description: 'Event context JSON file, or - for stdin; previews context, not event matching',
238
238
  }),
239
239
  };
240
240
  async run() {
@@ -251,7 +251,10 @@ class CommitmentsPreflight extends base_command_1.BaseCommand {
251
251
  let policy = null;
252
252
  try {
253
253
  if (args.id) {
254
- report = await commitments_1.commitmentApi.preflight(args.id, flags.next);
254
+ const eventFixture = flags['event-fixture']
255
+ ? await (0, prompt_1.readJsonBody)(flags['event-fixture'])
256
+ : undefined;
257
+ report = await commitments_1.commitmentApi.preflight(args.id, flags.next, eventFixture);
255
258
  try {
256
259
  policy =
257
260
  (await commitments_1.commitmentApi.get(args.id))?.commitment?.policy ?? null;
@@ -283,11 +286,19 @@ class CommitmentsPreflight extends base_command_1.BaseCommand {
283
286
  this.handleApiError(err);
284
287
  return;
285
288
  }
289
+ const fixtureContext = report.renderedPlan?.eventContext;
290
+ const fixtureNote = flags['event-fixture']
291
+ ? fixtureContext?.fixtureNote || (fixtureContext?.available
292
+ ? 'The fixture appears in preview context; event matching was not verified.'
293
+ : 'The server did not confirm that it used the supplied fixture; event matching was not verified.')
294
+ : undefined;
286
295
  if (flags.json) {
287
- this.log(JSON.stringify(report, null, 2));
296
+ this.log(JSON.stringify(fixtureNote ? { ...report, eventFixturePreview: fixtureNote } : report, null, 2));
288
297
  return;
289
298
  }
290
299
  this.log(preflightHeadline(report, Boolean(args.id)));
300
+ if (fixtureNote)
301
+ this.log(`Event fixture: ${fixtureNote}`);
291
302
  for (const line of (0, commitments_1.activationRefusalLines)(report.activation))
292
303
  this.log(line);
293
304
  // Whose permissions the run will use (OSK-11975), before the gates, so an
@@ -0,0 +1,23 @@
1
+ import { BaseCommand } from '../../../base-command';
2
+ /**
3
+ * `skrr initiatives worker deactivate <agent-id>` — stop the agent's WORKER: every one of its
4
+ * worker watchers (task/goal, follow-through, memory, ...) is disabled and its initiative policy
5
+ * goes to `off`. The agent itself is kept.
6
+ *
7
+ * A worker watcher is owned by the platform, so `agents triggers delete` refuses one with
8
+ * PRODUCER_OWNED_TRIGGER; this is the command that refusal names (OSK-22423).
9
+ */
10
+ export default class InitiativesWorkerDeactivate extends BaseCommand {
11
+ static description: string;
12
+ static examples: string[];
13
+ static args: {
14
+ agent: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
15
+ };
16
+ static flags: {
17
+ json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
18
+ yes: import("@oclif/core/interfaces").BooleanFlag<boolean>;
19
+ 'keep-initiatives': import("@oclif/core/interfaces").BooleanFlag<boolean>;
20
+ reason: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
21
+ };
22
+ run(): Promise<void>;
23
+ }