@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.
- package/README.md +8 -0
- package/dist/base-command.d.ts +4 -2
- package/dist/base-command.js +46 -13
- package/dist/commands/agenda/trigger/create.js +4 -2
- package/dist/commands/agenda/trigger/list.js +7 -7
- package/dist/commands/agent/message/approve.d.ts +17 -0
- package/dist/commands/agent/message/approve.js +72 -0
- package/dist/commands/agent/message/decline.d.ts +17 -0
- package/dist/commands/agent/message/decline.js +72 -0
- package/dist/commands/agent/message/pending.d.ts +18 -0
- package/dist/commands/agent/message/pending.js +79 -0
- package/dist/commands/agents/always-on/disable.js +9 -1
- package/dist/commands/agents/always-on/enable.js +9 -1
- package/dist/commands/agents/always-on/status.js +14 -1
- package/dist/commands/agents/create.js +10 -1
- package/dist/commands/agents/delete.d.ts +51 -0
- package/dist/commands/agents/delete.js +163 -2
- package/dist/commands/agents/intuitions/list.js +1 -1
- package/dist/commands/agents/plan-day.d.ts +39 -7
- package/dist/commands/agents/plan-day.js +254 -65
- package/dist/commands/agents/proactive-audit.d.ts +22 -0
- package/dist/commands/agents/proactive-audit.js +86 -0
- package/dist/commands/agents/schedule-overview.d.ts +7 -0
- package/dist/commands/agents/schedule-overview.js +43 -5
- package/dist/commands/agents/schedule-trace.js +30 -19
- package/dist/commands/agents/spawn.d.ts +51 -0
- package/dist/commands/agents/spawn.js +212 -9
- package/dist/commands/agents/todos/cancel.js +3 -0
- package/dist/commands/agents/todos/edit.js +1 -1
- package/dist/commands/agents/todos/list.d.ts +5 -0
- package/dist/commands/agents/todos/list.js +19 -5
- package/dist/commands/agents/triggers/create.js +1 -1
- package/dist/commands/agents/triggers/policy.js +7 -0
- package/dist/commands/agents/triggers/update.js +1 -1
- package/dist/commands/commitments/create.js +13 -3
- package/dist/commands/commitments/preflight.js +31 -5
- package/dist/commands/daemon/index.js +1 -0
- package/dist/commands/daemon/logs.d.ts +8 -1
- package/dist/commands/daemon/logs.js +32 -22
- package/dist/commands/daemon/profile.d.ts +15 -0
- package/dist/commands/daemon/profile.js +51 -0
- package/dist/commands/goals/briefing/status.js +1 -1
- package/dist/commands/initiatives/worker/deactivate.d.ts +23 -0
- package/dist/commands/initiatives/worker/deactivate.js +78 -0
- package/dist/commands/login.js +8 -2
- package/dist/commands/logout.d.ts +20 -0
- package/dist/commands/logout.js +110 -5
- package/dist/commands/machines/profiles/disconnect.d.ts +23 -0
- package/dist/commands/machines/profiles/disconnect.js +102 -0
- package/dist/commands/machines/profiles/index.d.ts +15 -0
- package/dist/commands/machines/profiles/index.js +33 -0
- package/dist/commands/machines/profiles/label.d.ts +24 -0
- package/dist/commands/machines/profiles/label.js +85 -0
- package/dist/commands/machines/profiles/list.d.ts +16 -0
- package/dist/commands/machines/profiles/list.js +87 -0
- package/dist/commands/memory/maintain.js +16 -2
- package/dist/commands/profiles/list.js +17 -2
- package/dist/commands/spaces/delete.js +6 -1
- package/dist/commands/spaces/workflows/archive.js +6 -1
- package/dist/commands/spaces/workflows/publish.js +3 -1
- package/dist/commands/spaces/workflows/run.d.ts +1 -0
- package/dist/commands/spaces/workflows/run.js +17 -1
- package/dist/commands/spaces/workflows/triggers/create.js +3 -1
- package/dist/commands/tasks/workflow-context.js +3 -1
- package/dist/commands/triggers/authorization.js +1 -1
- package/dist/commands/triggers/capabilities.js +17 -1
- package/dist/commands/triggers/create.d.ts +2 -0
- package/dist/commands/triggers/create.js +23 -7
- package/dist/commands/triggers/fire-detail.js +12 -3
- package/dist/commands/triggers/list.d.ts +1 -0
- package/dist/commands/triggers/list.js +13 -1
- package/dist/commands/triggers/preflight.js +18 -0
- package/dist/commands/triggers/prune.js +9 -5
- package/dist/commands/triggers/update.js +13 -4
- package/dist/generated/agent-guides.json +35 -35
- package/dist/lib/agent-guides.js +1 -1
- package/dist/lib/agent-proactive-baseline.d.ts +6 -0
- package/dist/lib/agent-proactive-baseline.js +32 -3
- package/dist/lib/always-on-command-result.d.ts +18 -0
- package/dist/lib/always-on-command-result.js +52 -0
- package/dist/lib/always-on-runtime.d.ts +31 -0
- package/dist/lib/always-on-runtime.js +39 -0
- package/dist/lib/auth-diagnostics.d.ts +10 -1
- package/dist/lib/auth-diagnostics.js +16 -8
- package/dist/lib/commitments.d.ts +16 -9
- package/dist/lib/commitments.js +65 -4
- package/dist/lib/compasses.js +5 -0
- package/dist/lib/daemon-binding.js +6 -3
- package/dist/lib/daemon-command-hint.d.ts +10 -5
- package/dist/lib/daemon-command-hint.js +11 -6
- package/dist/lib/daemon-setup.js +9 -3
- package/dist/lib/daemonBroker.d.ts +7 -0
- package/dist/lib/daemonBroker.js +5 -0
- package/dist/lib/daemonHandoff.d.ts +2 -0
- package/dist/lib/daemonHandoff.js +16 -3
- package/dist/lib/daemonIslandProfile.d.ts +19 -0
- package/dist/lib/daemonIslandProfile.js +41 -0
- package/dist/lib/drain-stdio.d.ts +22 -0
- package/dist/lib/drain-stdio.js +46 -0
- package/dist/lib/format.d.ts +32 -0
- package/dist/lib/format.js +105 -1
- package/dist/lib/initiatives-worker.d.ts +25 -0
- package/dist/lib/initiatives-worker.js +13 -0
- package/dist/lib/keychain.d.ts +22 -1
- package/dist/lib/keychain.js +40 -1
- package/dist/lib/local-daemon-readiness.js +4 -6
- package/dist/lib/local-skills.js +4 -1
- package/dist/lib/login.d.ts +7 -0
- package/dist/lib/login.js +5 -0
- package/dist/lib/machines.d.ts +68 -0
- package/dist/lib/machines.js +67 -0
- package/dist/lib/proactive-audit.d.ts +52 -0
- package/dist/lib/proactive-audit.js +67 -0
- package/dist/lib/proactiveApi.d.ts +23 -0
- package/dist/lib/refresh.d.ts +20 -6
- package/dist/lib/refresh.js +27 -9
- package/dist/lib/roles.d.ts +1 -1
- package/dist/lib/runtime-start-verification.js +3 -6
- package/dist/lib/schedule.d.ts +189 -9
- package/dist/lib/schedule.js +283 -22
- package/dist/lib/triggers.d.ts +134 -3
- package/dist/lib/triggers.js +370 -17
- package/dist/lib/workflow-node-control.js +8 -0
- package/dist/lib/workflow-run-view.js +9 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/configRoot.d.ts +12 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/configRoot.js +10 -2
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/deviceIdentityBridge.d.ts +8 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/deviceIdentityBridge.js +22 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/executorStopReceiptV2.d.ts +133 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/executorStopReceiptV2.js +180 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/index.d.ts +5 -3
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/index.js +50 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/profilePorts.d.ts +137 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/profilePorts.js +328 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/profileSelection.d.ts +63 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/profileSelection.js +174 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/refresh.d.ts +22 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/refresh.js +15 -4
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/configRoot.d.ts +12 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/configRoot.js +14 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/deviceIdentityBridge.d.ts +8 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/deviceIdentityBridge.js +27 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/executorStopReceiptV2.d.ts +133 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/executorStopReceiptV2.js +183 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/index.d.ts +5 -3
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/index.js +11 -3
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/profilePorts.d.ts +137 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/profilePorts.js +333 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/profileSelection.d.ts +63 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/profileSelection.js +212 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/refresh.d.ts +22 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/refresh.js +22 -4
- package/dist/node_modules/@skrr-ai/auth-core/package.json +11 -1
- package/dist/node_modules/@skrr-ai/data-provider/index.js +7446 -7378
- package/oclif.manifest.json +844 -47
- 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
|
-
|
|
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
|
-
|
|
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(
|
|
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({
|
|
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({
|
|
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
|
-
//
|
|
38
|
-
// already be tomorrow while it is still evening for the reader
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
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
|
-
|
|
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:
|
|
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:
|
|
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,56 @@ 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;
|
|
52
|
+
/** A value as one POSIX shell word, so a printed command can be pasted as it is. */
|
|
53
|
+
export declare function shellQuote(value: string): string;
|
|
54
|
+
/**
|
|
55
|
+
* One line for the goals, tasks and jobs a spec seeded. The text receipt printed
|
|
56
|
+
* the worker and the orchestrator and nothing of these, though `--json` listed
|
|
57
|
+
* them, so a person reading the text never learned that work had been created
|
|
58
|
+
* for them (OSK-22358).
|
|
59
|
+
*/
|
|
60
|
+
export declare function initializeSummary(initialize: NonNullable<ApplyProactiveAgentResponse['installed']['initialize']> | undefined): string | null;
|
|
11
61
|
/**
|
|
12
62
|
* Agent identity creation is intentionally forward-only, but an Agent URL must
|
|
13
63
|
* not masquerade as a fully installed proactive service when a watcher or
|
|
@@ -44,6 +94,7 @@ export default class AgentsSpawn extends BaseCommand {
|
|
|
44
94
|
'apply-recommendation': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
45
95
|
'spec-hash': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
46
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>;
|
|
47
98
|
'agent-id': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
48
99
|
name: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
49
100
|
message: import("@oclif/core/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
@@ -1,7 +1,10 @@
|
|
|
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;
|
|
6
|
+
exports.shellQuote = shellQuote;
|
|
7
|
+
exports.initializeSummary = initializeSummary;
|
|
5
8
|
exports.proactiveInstallReadiness = proactiveInstallReadiness;
|
|
6
9
|
const core_1 = require("@oclif/core");
|
|
7
10
|
const base_command_1 = require("../../base-command");
|
|
@@ -43,6 +46,71 @@ function specWithEffectiveWindowFlags(spec) {
|
|
|
43
46
|
},
|
|
44
47
|
};
|
|
45
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');
|
|
87
|
+
/** A value as one POSIX shell word, so a printed command can be pasted as it is. */
|
|
88
|
+
function shellQuote(value) {
|
|
89
|
+
return `'${value.replace(/'/g, `'\\''`)}'`;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* One line for the goals, tasks and jobs a spec seeded. The text receipt printed
|
|
93
|
+
* the worker and the orchestrator and nothing of these, though `--json` listed
|
|
94
|
+
* them, so a person reading the text never learned that work had been created
|
|
95
|
+
* for them (OSK-22358).
|
|
96
|
+
*/
|
|
97
|
+
function initializeSummary(initialize) {
|
|
98
|
+
if (!initialize)
|
|
99
|
+
return null;
|
|
100
|
+
const noun = (count, word) => `${count} ${word}${count === 1 ? '' : 's'}`;
|
|
101
|
+
const goals = initialize.goals.filter((item) => item.ok);
|
|
102
|
+
const tasks = initialize.tasks.filter((item) => item.ok);
|
|
103
|
+
const jobs = initialize.jobs.filter((item) => item.ok);
|
|
104
|
+
const failed = initialize.goals.length + initialize.tasks.length + initialize.jobs.length -
|
|
105
|
+
goals.length - tasks.length - jobs.length;
|
|
106
|
+
if (!goals.length && !tasks.length && !jobs.length && !failed)
|
|
107
|
+
return null;
|
|
108
|
+
const parts = [noun(goals.length, 'goal'), noun(tasks.length, 'task'), noun(jobs.length, 'scheduled job')];
|
|
109
|
+
const existing = [...goals, ...tasks].filter((item) => item.existing).length;
|
|
110
|
+
return (parts.join(', ') +
|
|
111
|
+
(existing ? ` (${existing} already existed)` : '') +
|
|
112
|
+
(failed ? `; ${failed} could not be created` : ''));
|
|
113
|
+
}
|
|
46
114
|
/**
|
|
47
115
|
* Agent identity creation is intentionally forward-only, but an Agent URL must
|
|
48
116
|
* not masquerade as a fully installed proactive service when a watcher or
|
|
@@ -51,13 +119,53 @@ function specWithEffectiveWindowFlags(spec) {
|
|
|
51
119
|
*/
|
|
52
120
|
function proactiveInstallReadiness(result, bin) {
|
|
53
121
|
if (result.warnings.length === 0) {
|
|
54
|
-
|
|
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
|
+
};
|
|
55
133
|
}
|
|
56
134
|
if (result.warnings.some((warning) => warning.step.startsWith('commitment.'))) {
|
|
57
|
-
|
|
135
|
+
// A Commitment the owner deleted is reported, not repaired: it was not recreated on
|
|
136
|
+
// purpose, and a repair command that names its id is a dead end (OSK-22381).
|
|
137
|
+
const deleted = (result.installed.commitments || []).filter((commitment) => commitment.status === 'deleted');
|
|
138
|
+
const affected = (result.installed.commitments || []).filter((commitment) => commitment.status !== 'deleted' && (commitment.status !== 'active' || result.warnings.some((warning) => warning.step === `commitment.${commitment.title}`)));
|
|
139
|
+
if (deleted.length && !affected.length &&
|
|
140
|
+
result.warnings.every((warning) => warning.code === 'commitment_deleted_not_recreated')) {
|
|
141
|
+
return {
|
|
142
|
+
status: 'degraded',
|
|
143
|
+
message: `${deleted.length === 1 ? 'A Commitment' : `${deleted.length} Commitments`} from this spec ` +
|
|
144
|
+
`${deleted.length === 1 ? 'was' : 'were'} deleted earlier, so ${deleted.length === 1 ? 'it was' : 'they were'} not created again. ` +
|
|
145
|
+
'Change its title and apply the spec again if you want it back.',
|
|
146
|
+
};
|
|
147
|
+
}
|
|
58
148
|
const ids = [...new Set(affected.map((commitment) => commitment.id))]
|
|
59
149
|
.filter((id) => typeof id === 'string' && /^[A-Za-z0-9_-]+$/.test(id));
|
|
60
150
|
const safeAgentId = /^[A-Za-z0-9_-]+$/.test(result.agentId) ? result.agentId : null;
|
|
151
|
+
// Always-On was still starting when setup finished, so the only thing that
|
|
152
|
+
// stopped activation was a gate that clears by itself. Say so and name the
|
|
153
|
+
// command that finishes the job; `commitments preflight` is a dry run that
|
|
154
|
+
// never mentions resume (OSK-22351).
|
|
155
|
+
const stillStarting = affected.length > 0 && affected.every((commitment) => commitment.status === 'draft' &&
|
|
156
|
+
(commitment.activationBlockedBy || []).length > 0 &&
|
|
157
|
+
(commitment.activationBlockedBy || []).every((entry) => entry.gate === 'always_on' && entry.reason === 'reconcile_pending'));
|
|
158
|
+
if (stillStarting && ids.length) {
|
|
159
|
+
return {
|
|
160
|
+
status: 'degraded',
|
|
161
|
+
message: `Always-On was still starting when setup finished, so the Commitment${ids.length === 1 ? '' : 's'} ${ids.join(', ')} ` +
|
|
162
|
+
`${ids.length === 1 ? 'was' : 'were'} left as ${ids.length === 1 ? 'a draft' : 'drafts'}. ` +
|
|
163
|
+
'Nothing else is wrong; resume it in a moment.',
|
|
164
|
+
repairCommand: ids.length === 1
|
|
165
|
+
? `${bin} commitments resume ${ids[0]}`
|
|
166
|
+
: `${bin} commitments list --agent ${safeAgentId ?? '<agent-id>'} --status draft`,
|
|
167
|
+
};
|
|
168
|
+
}
|
|
61
169
|
return {
|
|
62
170
|
status: 'degraded',
|
|
63
171
|
message: ids.length
|
|
@@ -92,6 +200,23 @@ function proactiveInstallReadiness(result, bin) {
|
|
|
92
200
|
message: 'Some worker time windows are disabled because their enablement was not specified. Review the warnings.',
|
|
93
201
|
};
|
|
94
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
|
+
}
|
|
95
220
|
// A full trigger budget must not make a new persona-only Agent look broken
|
|
96
221
|
// when its core system commitments, local execution policy, and Always-On
|
|
97
222
|
// state installed successfully. The optional backlog watcher is deferred;
|
|
@@ -129,7 +254,7 @@ function proactiveInstallReadiness(result, bin) {
|
|
|
129
254
|
* `--from-spec` for an exact, reviewed install (which may carry higher autonomy).
|
|
130
255
|
*/
|
|
131
256
|
class AgentsSpawn extends base_command_1.BaseCommand {
|
|
132
|
-
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;
|
|
133
258
|
static examples = [
|
|
134
259
|
'<%= config.bin %> agents spawn "watch my Slack and flag urgent unanswered messages"',
|
|
135
260
|
'<%= config.bin %> agents spawn "plan my day every morning, working hours 9-6" --approve',
|
|
@@ -137,6 +262,7 @@ class AgentsSpawn extends base_command_1.BaseCommand {
|
|
|
137
262
|
'<%= config.bin %> agents spawn "watch launch blockers" --recommend',
|
|
138
263
|
'<%= config.bin %> agents spawn --approve-recommendation par_123 --spec-hash <reviewed-hash>',
|
|
139
264
|
'<%= config.bin %> agents spawn --apply-recommendation par_123 --spec-hash <reviewed-hash>',
|
|
265
|
+
'<%= config.bin %> agents spawn --print-spec-template > spec.json',
|
|
140
266
|
'<%= config.bin %> agents spawn --from-spec spec.json --approve',
|
|
141
267
|
];
|
|
142
268
|
static args = {
|
|
@@ -163,7 +289,10 @@ class AgentsSpawn extends base_command_1.BaseCommand {
|
|
|
163
289
|
description: 'Hash from the reviewed recommendation (required for apply; optional for approval)',
|
|
164
290
|
}),
|
|
165
291
|
'from-spec': core_1.Flags.string({
|
|
166
|
-
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)',
|
|
167
296
|
}),
|
|
168
297
|
'agent-id': core_1.Flags.string({
|
|
169
298
|
description: 'Apply onto an existing agent instead of creating a new one (convergent re-run)',
|
|
@@ -178,8 +307,13 @@ class AgentsSpawn extends base_command_1.BaseCommand {
|
|
|
178
307
|
timezone: core_1.Flags.string({ description: 'IANA timezone for working-hours defaults' }),
|
|
179
308
|
};
|
|
180
309
|
async run() {
|
|
181
|
-
this.requireAuth();
|
|
182
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();
|
|
183
317
|
if (flags.recommend && flags['from-spec']) {
|
|
184
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 });
|
|
185
319
|
}
|
|
@@ -272,14 +406,28 @@ class AgentsSpawn extends base_command_1.BaseCommand {
|
|
|
272
406
|
const spec = plan.spec;
|
|
273
407
|
if (!flags.approve) {
|
|
274
408
|
if (flags.json) {
|
|
275
|
-
this.
|
|
409
|
+
this.printJsonResult({ ...plan, spec: specWithEffectiveWindowFlags(spec) });
|
|
276
410
|
return;
|
|
277
411
|
}
|
|
412
|
+
// The planner's own sentence about the plan (and any note about a value it
|
|
413
|
+
// had to change) was only ever in `--json`.
|
|
414
|
+
if (plan.message) {
|
|
415
|
+
this.log(plan.message);
|
|
416
|
+
this.log('');
|
|
417
|
+
}
|
|
278
418
|
this.renderSpec(spec);
|
|
279
419
|
this.log('');
|
|
280
420
|
this.log('This is a draft — nothing has been created.');
|
|
281
|
-
|
|
282
|
-
|
|
421
|
+
const repeat = [
|
|
422
|
+
shellQuote(sentence),
|
|
423
|
+
...(flags.name ? ['--name', shellQuote(flags.name)] : []),
|
|
424
|
+
...(flags.timezone ? ['--timezone', shellQuote(flags.timezone)] : []),
|
|
425
|
+
'--approve',
|
|
426
|
+
].join(' ');
|
|
427
|
+
this.log(` Create it: ${this.config.bin} agents spawn ${repeat}`);
|
|
428
|
+
this.log(' (this plans again, so the Agent may differ a little from this draft)');
|
|
429
|
+
this.log(' Exactly this draft: save the `spec` from the same command with --json as spec.json, then:');
|
|
430
|
+
this.log(' --from-spec spec.json --approve');
|
|
283
431
|
return;
|
|
284
432
|
}
|
|
285
433
|
const result = await proactiveApi_1.proactiveApi.applyProactiveAgentSpec({
|
|
@@ -325,7 +473,9 @@ class AgentsSpawn extends base_command_1.BaseCommand {
|
|
|
325
473
|
this.log(`Agent: ${id.name} (${id.provider}/${id.model})`);
|
|
326
474
|
if (id.description)
|
|
327
475
|
this.log(` ${id.description}`);
|
|
328
|
-
|
|
476
|
+
// A plan that only creates work (goals, tasks, jobs) has no systems, and a
|
|
477
|
+
// blank line here read as if the plan did nothing (OSK-22349).
|
|
478
|
+
this.log(`Systems: ${spec.systems.length ? spec.systems.join(', ') : 'none (only the work listed below)'}`);
|
|
329
479
|
if (spec.worker) {
|
|
330
480
|
this.log('');
|
|
331
481
|
this.log(`Worker (event-reactive) — policy: ${spec.worker.policy?.mode ?? 'ask_first'}`);
|
|
@@ -351,6 +501,29 @@ class AgentsSpawn extends base_command_1.BaseCommand {
|
|
|
351
501
|
this.log('Commitments (as provided; subject to validation):');
|
|
352
502
|
this.log(JSON.stringify(spec.commitments, null, 2));
|
|
353
503
|
}
|
|
504
|
+
// What approval will create besides the systems above. `--json` always listed
|
|
505
|
+
// these; the text plan showed none of them, so "Create it" created a goal, tasks
|
|
506
|
+
// and a scheduled job the reader had never been shown (OSK-22349, OSK-22358).
|
|
507
|
+
const initialize = spec.initialize;
|
|
508
|
+
if (initialize && (initialize.goals?.length || initialize.tasks?.length || initialize.jobs?.length)) {
|
|
509
|
+
this.log('');
|
|
510
|
+
this.log('It will also create:');
|
|
511
|
+
for (const goal of initialize.goals || [])
|
|
512
|
+
this.log(` goal: ${goal.title}`);
|
|
513
|
+
for (const task of initialize.tasks || []) {
|
|
514
|
+
this.log(` task: ${task.title}${task.priority ? ` (${task.priority})` : ''}`);
|
|
515
|
+
}
|
|
516
|
+
for (const job of initialize.jobs || []) {
|
|
517
|
+
const when = job.cron
|
|
518
|
+
? `cron ${job.cron}`
|
|
519
|
+
: job.runAtIso ? `once at ${job.runAtIso}` : 'no schedule';
|
|
520
|
+
this.log(` job: ${job.label} — ${when}${job.timezone ? ` ${job.timezone}` : ''}`);
|
|
521
|
+
}
|
|
522
|
+
}
|
|
523
|
+
if (spec.compass?.purpose) {
|
|
524
|
+
this.log('');
|
|
525
|
+
this.log(`Standing direction: ${spec.compass.purpose}`);
|
|
526
|
+
}
|
|
354
527
|
}
|
|
355
528
|
renderApplyResult(result, json, existingAgent) {
|
|
356
529
|
const readiness = proactiveInstallReadiness(result, this.config.bin);
|
|
@@ -369,6 +542,14 @@ class AgentsSpawn extends base_command_1.BaseCommand {
|
|
|
369
542
|
if (w) {
|
|
370
543
|
const ok = w.watchers.filter((x) => x.ok).length;
|
|
371
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
|
+
}
|
|
372
553
|
}
|
|
373
554
|
const o = result.installed.orchestrator;
|
|
374
555
|
if (o) {
|
|
@@ -387,6 +568,28 @@ class AgentsSpawn extends base_command_1.BaseCommand {
|
|
|
387
568
|
this.log(` Preflight: ${this.config.bin} triggers preflight <trigger-id>`);
|
|
388
569
|
}
|
|
389
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
|
+
}
|
|
575
|
+
const alwaysOn = result.installed.alwaysOn;
|
|
576
|
+
if (alwaysOn) {
|
|
577
|
+
const state = alwaysOn.desiredEnabled === undefined
|
|
578
|
+
? alwaysOn.ok ? 'set' : 'failed'
|
|
579
|
+
: alwaysOn.desiredEnabled ? 'on' : 'off';
|
|
580
|
+
this.log(` always-on: ${state}${alwaysOn.operationalState ? ` (${alwaysOn.operationalState})` : ''}`);
|
|
581
|
+
}
|
|
582
|
+
const compass = result.installed.compass;
|
|
583
|
+
if (compass) {
|
|
584
|
+
this.log(` compass: ${compass.skipped ? `kept the existing one (${compass.skipped})` : compass.ok ? 'installed' : 'failed'}`);
|
|
585
|
+
}
|
|
586
|
+
const seeded = initializeSummary(result.installed.initialize);
|
|
587
|
+
if (seeded)
|
|
588
|
+
this.log(` seeded: ${seeded}`);
|
|
589
|
+
for (const commitment of result.installed.commitments || []) {
|
|
590
|
+
this.log(` commitment: ${commitment.title ?? commitment.id} — ${commitment.status ?? 'unknown'}` +
|
|
591
|
+
` (${commitment.id})${commitment.existing ? ', already existed' : ''}`);
|
|
592
|
+
}
|
|
390
593
|
for (const watcher of result.installed.defaultWatchers || []) {
|
|
391
594
|
if (!watcher.ok)
|
|
392
595
|
continue;
|
|
@@ -52,6 +52,9 @@ class AgentsTodosCancel extends base_command_1.BaseCommand {
|
|
|
52
52
|
return;
|
|
53
53
|
}
|
|
54
54
|
this.log(`Cancelled to-do ${args.id} (status: ${todo.status}).`);
|
|
55
|
+
const note = todo.note;
|
|
56
|
+
if (typeof note === 'string' && note)
|
|
57
|
+
this.log(`Note: ${note}`);
|
|
55
58
|
}
|
|
56
59
|
}
|
|
57
60
|
exports.default = AgentsTodosCancel;
|
|
@@ -35,7 +35,7 @@ class AgentsTodosEdit extends base_command_1.BaseCommand {
|
|
|
35
35
|
this.handleApiError(err);
|
|
36
36
|
}
|
|
37
37
|
if (flags.json)
|
|
38
|
-
this.
|
|
38
|
+
this.printJsonResult(todo);
|
|
39
39
|
else
|
|
40
40
|
this.log(`Updated to-do ${todo.id} — "${todo.name}" at ${todo.runAt}`);
|
|
41
41
|
}
|
|
@@ -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;
|