@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
@@ -15,7 +15,7 @@
15
15
  * don't rotate; the caller is expected to `classifyTokenKind()` and
16
16
  * skip this module entirely when `kind === 'ci'`.
17
17
  */
18
- import { PermanentAuthFailure, TransientAuthFailure, type ResolvedCredential, type TokenPair } from '@skrr-ai/auth-core';
18
+ import { PermanentAuthFailure, TransientAuthFailure, type RefreshRevokeResult, type ResolvedCredential, type TokenPair } from '@skrr-ai/auth-core';
19
19
  export declare const CLI_REFRESH_EARLY_MS: number;
20
20
  /**
21
21
  * Stable origin header so the server's benign-grace matcher can identify
@@ -78,11 +78,25 @@ export declare function ensureFreshCliCredential(opts?: EnsureFreshCliCredential
78
78
  */
79
79
  export declare function refreshCliToken(): Promise<TokenPair>;
80
80
  /**
81
- * Best-effort revoke. Does NOT clear local backends — callers want to
82
- * stage the server revoke before nuking the local bundle so the server
83
- * accepts the request (revoke is authenticated by the refresh token
84
- * itself, which we're about to discard).
81
+ * What revoking this profile's CLI session came to. The server's three answers
82
+ * (`accepted`, `refused`, `unreachable`), or `not_sent` when there was nothing
83
+ * this computer could present: no sign-in stored for this server, one with no
84
+ * refresh half, or one that could not be read.
85
85
  */
86
- export declare function revokeCurrentRefreshToken(): Promise<void>;
86
+ export type CliSessionRevokeResult = RefreshRevokeResult | {
87
+ outcome: 'not_sent';
88
+ reason: 'no_credential' | 'no_refresh_token' | 'read_failed';
89
+ detail?: string;
90
+ };
91
+ /**
92
+ * Revoke this profile's CLI session on the server, and say what happened.
93
+ * Does NOT clear local backends: the revoke is authenticated by the refresh
94
+ * token itself, so the caller stages it before discarding the bundle.
95
+ *
96
+ * It used to return nothing and swallow every failure, so `skrr logout`
97
+ * printed "Signed out." over a session the server never heard about
98
+ * (OSK-22307). It never throws.
99
+ */
100
+ export declare function revokeCurrentRefreshToken(): Promise<CliSessionRevokeResult>;
87
101
  export { PermanentAuthFailure, TransientAuthFailure };
88
102
  export type { TokenPair };
@@ -255,15 +255,33 @@ async function refreshCliToken() {
255
255
  });
256
256
  }
257
257
  /**
258
- * Best-effort revoke. Does NOT clear local backends — callers want to
259
- * stage the server revoke before nuking the local bundle so the server
260
- * accepts the request (revoke is authenticated by the refresh token
261
- * itself, which we're about to discard).
258
+ * Revoke this profile's CLI session on the server, and say what happened.
259
+ * Does NOT clear local backends: the revoke is authenticated by the refresh
260
+ * token itself, so the caller stages it before discarding the bundle.
261
+ *
262
+ * It used to return nothing and swallow every failure, so `skrr logout`
263
+ * printed "Signed out." over a session the server never heard about
264
+ * (OSK-22307). It never throws.
262
265
  */
263
266
  async function revokeCurrentRefreshToken() {
264
- const cfg = (0, config_1.loadConfig)();
265
- const read = (0, auth_storage_1.readFromBackend)(cfg.baseURL);
266
- if (!read.bundle?.refreshToken)
267
- return;
268
- await (0, auth_core_1.revokeDaemonRefreshSession)(cfg.baseURL, read.bundle.refreshToken);
267
+ let serverUrl;
268
+ let refreshToken;
269
+ try {
270
+ const cfg = (0, config_1.loadConfig)();
271
+ serverUrl = cfg.baseURL;
272
+ const read = (0, auth_storage_1.readFromBackend)(cfg.baseURL);
273
+ if (!read.bundle)
274
+ return { outcome: 'not_sent', reason: 'no_credential' };
275
+ refreshToken = read.bundle.refreshToken;
276
+ }
277
+ catch (err) {
278
+ return {
279
+ outcome: 'not_sent',
280
+ reason: 'read_failed',
281
+ detail: err instanceof Error ? err.message : String(err),
282
+ };
283
+ }
284
+ if (!refreshToken)
285
+ return { outcome: 'not_sent', reason: 'no_refresh_token' };
286
+ return (0, auth_core_1.revokeDaemonRefreshSessionReported)(serverUrl, refreshToken);
269
287
  }
@@ -53,7 +53,7 @@ export declare const roleApi: {
53
53
  config?: Record<string, unknown> | undefined;
54
54
  }[];
55
55
  sources: {
56
- source: "space" | "tasks" | "memory" | "daemon" | "email" | "goal" | "files" | "local" | "browser" | "conversations" | "slack" | "github" | "messages" | "calendar" | "docs" | "metrics" | "agent_run" | "agent_initiatives" | "documents" | "product_metrics" | "business_metrics" | "state_monitor" | "monitor";
56
+ source: "space" | "tasks" | "memory" | "daemon" | "email" | "goal" | "files" | "local" | "browser" | "conversations" | "slack" | "agent_initiatives" | "github" | "messages" | "calendar" | "docs" | "metrics" | "agent_run" | "documents" | "product_metrics" | "business_metrics" | "state_monitor" | "monitor";
57
57
  enabled: boolean;
58
58
  config?: Record<string, unknown> | undefined;
59
59
  }[];
@@ -6,6 +6,17 @@ export interface TodoTaskRef {
6
6
  titleSnapshot: string;
7
7
  statusSnapshot: string;
8
8
  }
9
+ /**
10
+ * A direct Commitment block (Smart Schedule only). The server revalidates it at
11
+ * approval, so the CLI carries the draft's reference through untouched.
12
+ */
13
+ export interface TodoCommitmentRef {
14
+ commitmentId: string;
15
+ titleSnapshot?: string;
16
+ kindSnapshot?: string;
17
+ versionSnapshot: number;
18
+ actionReason?: string;
19
+ }
9
20
  export interface Todo {
10
21
  id: string;
11
22
  agentId: string;
@@ -48,6 +59,24 @@ export interface ProposedTodo {
48
59
  confidence?: TodoConfidence;
49
60
  dropped?: boolean;
50
61
  taskRefs?: TodoTaskRef[];
62
+ commitmentRefs?: TodoCommitmentRef[];
63
+ }
64
+ /**
65
+ * A block from the previously approved plan that approving this draft cancels
66
+ * without the draft listing it (OSK-22419). Absent when approval retires nothing.
67
+ */
68
+ export interface ReplacementPreview {
69
+ fromVersion?: number;
70
+ blocks: Array<{
71
+ todoId: string;
72
+ name: string;
73
+ runAt: string;
74
+ durationMinutes?: number;
75
+ taskRefs?: Array<{
76
+ taskId: string;
77
+ titleSnapshot?: string;
78
+ }>;
79
+ }>;
51
80
  }
52
81
  export interface WorkingHoursWindow {
53
82
  start: string;
@@ -57,7 +86,10 @@ export interface WorkingHoursWindow {
57
86
  export interface SmartScheduleProposal {
58
87
  proposalId: string;
59
88
  agentId: string;
60
- status?: 'pending' | 'approved' | 'dismissed' | 'superseded' | 'expired';
89
+ status?: 'pending' | 'approving' | 'approved' | 'dismissed' | 'superseded' | 'expired';
90
+ /** The local calendar day (YYYY-MM-DD, in `timezone`) this plan covers. */
91
+ planDate?: string;
92
+ version?: number;
61
93
  generatedAt: string;
62
94
  expiresAt?: string;
63
95
  timezone: string;
@@ -70,6 +102,7 @@ export interface SmartScheduleProposal {
70
102
  truncated: boolean;
71
103
  };
72
104
  todos: ProposedTodo[];
105
+ replacementPreview?: ReplacementPreview;
73
106
  nextRunSuggestion?: {
74
107
  runAt: string;
75
108
  reason?: string;
@@ -87,9 +120,58 @@ export interface TriggerCapacity {
87
120
  scopeKind: string;
88
121
  active: number;
89
122
  limit: number;
123
+ /** True when the owner has no cap of their own; `limit` is then the platform ceiling. */
124
+ unlimited?: boolean;
90
125
  remaining: number;
91
126
  reclaimable: number;
127
+ /** Whether approving would find the schedule-check watcher already installed. */
128
+ deltaWatcherInstalled?: boolean | null;
129
+ }
130
+ /**
131
+ * The server's record of whether a plan is being generated for one agent-day.
132
+ *
133
+ * `holds` is the single answer to "may I approve, dismiss or regenerate": it is
134
+ * true only while a request is `running` and inside its expiry. `unknown` is a
135
+ * `running` request that has gone quiet past the longest a planner may run — a
136
+ * statement about silence, not proof that anything stopped.
137
+ */
138
+ export type PlanRequestState = 'running' | 'unknown' | 'succeeded' | 'failed';
139
+ export interface SmartSchedulePlanRequest {
140
+ requestId: string;
141
+ agentId: string;
142
+ planDate: string;
143
+ state: PlanRequestState;
144
+ holds: boolean;
145
+ origin?: 'requested' | 'automatic';
146
+ startedAt?: string;
147
+ expiresAt?: string;
148
+ finishedAt?: string;
149
+ proposalId?: string;
150
+ failure?: {
151
+ code: string;
152
+ message: string;
153
+ };
92
154
  }
155
+ /**
156
+ * The `202` answer to a propose that sent `Prefer: respond-async`: the plan day was
157
+ * claimed and the planner keeps running on the server. NOT a plan. A plan takes
158
+ * 35-66 s and the edge gives up at 60 s, so a command that asks this way is handed
159
+ * the request to follow instead of a 502/504 for a plan that is still running.
160
+ */
161
+ export interface SmartSchedulePlanAccepted {
162
+ accepted: true;
163
+ planRequest: SmartSchedulePlanRequest | null;
164
+ message?: string;
165
+ }
166
+ export declare function isPlanAccepted(value: unknown): value is SmartSchedulePlanAccepted;
167
+ /**
168
+ * Has the request a `202` named finished, judged from a read of the day's record?
169
+ *
170
+ * A read with no record, or with an older request than ours, predates the claim (a
171
+ * poll already in flight when the 202 arrived), so it settles nothing. The same id
172
+ * settles when it is no longer holding; a NEWER request means ours is over.
173
+ */
174
+ export declare function acceptedPlanVerdict(record: SmartSchedulePlanRequest | null | undefined, accepted: SmartSchedulePlanRequest | null | undefined): 'waiting' | 'settled';
93
175
  export interface ApproveTodoInput {
94
176
  tempId?: string;
95
177
  name: string;
@@ -97,6 +179,8 @@ export interface ApproveTodoInput {
97
179
  runAt: string;
98
180
  timezone?: string;
99
181
  durationMinutes?: number;
182
+ taskRefs?: TodoTaskRef[];
183
+ commitmentRefs?: TodoCommitmentRef[];
100
184
  rationale?: string;
101
185
  confidence?: TodoConfidence;
102
186
  }
@@ -115,9 +199,40 @@ export interface ApproveSmartScheduleResponse {
115
199
  scheduledNextRun?: {
116
200
  created?: boolean;
117
201
  triggerId?: string;
202
+ runAt?: string;
118
203
  skippedReason?: string;
119
204
  message?: string;
120
205
  } | null;
206
+ /** Blocks of the previously approved plan this approval cancelled or kept. */
207
+ replaced?: {
208
+ cancelled?: string[];
209
+ kept?: string[];
210
+ };
211
+ /**
212
+ * The recurring schedule watcher an approval keeps on. `created` when this
213
+ * approval armed it, `skippedReason` when it was already there, switched off
214
+ * (`disabled_delta_watcher`), or could not be made. Absent on older servers
215
+ * and when an approval was only partly applied.
216
+ */
217
+ scheduledDeltaWatcher?: DeltaWatcherOutcome | null;
218
+ }
219
+ export interface DeltaWatcherOutcome {
220
+ created?: boolean;
221
+ updated?: boolean;
222
+ triggerId?: string;
223
+ skippedReason?: string;
224
+ /** Wall-clock fire times (HH:MM) in `timezone`. */
225
+ times?: string[];
226
+ previousTimes?: string[];
227
+ timezone?: string;
228
+ message?: string;
229
+ /** Set when feedback from this very approval moved `times` after the watcher was ensured. */
230
+ cadenceUpdated?: boolean;
231
+ }
232
+ export interface DismissSmartScheduleResponse {
233
+ proposal: SmartScheduleProposal;
234
+ /** Present when dismissing the plan also moved the watcher's check times. */
235
+ deltaWatcher?: DeltaWatcherOutcome;
121
236
  }
122
237
  /**
123
238
  * The self-schedule TRACE — why the agent's day looks the way it does.
@@ -140,7 +255,11 @@ export interface ScheduleTraceEvent {
140
255
  status?: string;
141
256
  summary?: string;
142
257
  source?: string;
258
+ /** A sentence for a person. The machine code behind it is `detail.reasonCode` (OSK-22558). */
143
259
  reason?: string;
260
+ detail?: {
261
+ reasonCode?: string;
262
+ };
144
263
  }
145
264
  export interface ScheduleTrace {
146
265
  object?: string;
@@ -155,11 +274,32 @@ export interface ScheduleTrace {
155
274
  };
156
275
  sourcePolicy?: Record<string, string>;
157
276
  events?: ScheduleTraceEvent[];
277
+ /** Whether a plan is being generated for this day, failed, or went quiet. */
278
+ planRequest?: SmartSchedulePlanRequest | null;
158
279
  has_more?: boolean;
159
280
  next_cursor?: string | null;
160
281
  }
161
282
  /** Calendar day at an instant in the zone used for the schedule query. */
162
283
  export declare function scheduleTraceToday(now: Date, timezone: string): string;
284
+ /**
285
+ * This machine's IANA zone — the "viewer" zone the web client also sends
286
+ * (`browserTimeZone()` on propose, list and trace). `UTC` only when the runtime
287
+ * cannot say.
288
+ */
289
+ export declare function machineTimeZone(): string;
290
+ export declare function isValidTimeZone(timeZone: string): boolean;
291
+ /** `America/Vancouver (PST)` — a zone name plus what it is called right now. */
292
+ export declare function describeTimeZone(timeZone: string, at?: Date): string;
293
+ /**
294
+ * One zone for one agent-day, for every Smart Schedule command that names a
295
+ * "today": `--timezone` when given, otherwise this machine's. `plan-day`,
296
+ * `schedule-trace`, `schedule-overview` and `todos list` used to default to
297
+ * three different zones (the server's last-seen browser zone, this machine, and
298
+ * UTC), so the same minute was a different day depending on the command
299
+ * (OSK-22397, OSK-22398). Returns `null` for an invalid explicit zone so the
300
+ * caller can fail with its own message.
301
+ */
302
+ export declare function resolveDayTimeZone(flag?: string): string | null;
163
303
  export declare function scheduleTracePath(params: {
164
304
  agentId: string;
165
305
  date: string;
@@ -193,9 +333,11 @@ export declare const scheduleApi: {
193
333
  workingHoursOverride?: WorkingHoursWindow;
194
334
  timezone?: string;
195
335
  regenerateHint?: string;
196
- }) => Promise<SmartScheduleProposal>;
336
+ }) => Promise<SmartScheduleProposal | SmartSchedulePlanAccepted>;
197
337
  pendingProposal: (agentId: string) => Promise<{
198
338
  proposal: SmartScheduleProposal | null;
339
+ /** Absent from older servers; null when no request is on record. */
340
+ planRequest?: SmartSchedulePlanRequest | null;
199
341
  }>;
200
342
  approveSmartSchedule: (input: {
201
343
  agentId: string;
@@ -205,9 +347,7 @@ export declare const scheduleApi: {
205
347
  saveHoursAsDefault?: boolean;
206
348
  workingHours?: WorkingHoursWindow;
207
349
  }) => Promise<ApproveSmartScheduleResponse>;
208
- dismissProposal: (proposalId: string, agentId?: string) => Promise<{
209
- proposal: SmartScheduleProposal;
210
- }>;
350
+ dismissProposal: (proposalId: string, agentId?: string) => Promise<DismissSmartScheduleResponse>;
211
351
  };
212
352
  /**
213
353
  * Is this actually a proposal?
@@ -228,22 +368,86 @@ export declare function isSmartScheduleProposal(value: unknown): value is SmartS
228
368
  * HTML error page, and dumping it into the user's terminal helps nobody.
229
369
  */
230
370
  export declare function describeNonProposal(value: unknown): string;
371
+ /**
372
+ * One sentence for a plan request a person should know about, or null when
373
+ * there is nothing to say (no record, or a plan that simply succeeded).
374
+ *
375
+ * The same four states the web panel shows, worded for a terminal. `unknown`
376
+ * says what is true — the request stopped reporting — and does not claim the
377
+ * planner stopped.
378
+ */
379
+ export declare function describePlanRequest(request: SmartSchedulePlanRequest | null | undefined, now?: Date): string | null;
231
380
  /** Explain terminal policy outcomes without changing the machine-readable status. */
232
381
  export declare function todoPolicyBlockMessage(reason?: string): string | undefined;
233
382
  /** Print explanations alongside the trace rows that recorded policy blocks. */
234
383
  export declare function renderTodoPolicyTraceDetails(events: ScheduleTraceEvent[], log: (line: string) => void): void;
235
- /** Render a To-Do list as a table. */
236
- export declare function renderTodoList(todos: Todo[], log: (line: string) => void): void;
384
+ /**
385
+ * Render a To-Do list as a table. `timeZone` names the zone the WHEN column is
386
+ * shown in (and is labelled on every row); omitted, rows keep the raw UTC
387
+ * instant the older output printed.
388
+ */
389
+ export declare function renderTodoList(todos: Todo[], log: (line: string) => void, timeZone?: string): void;
237
390
  /**
238
391
  * Warn at REVIEW time when approving this plan is likely to hit the wall.
239
392
  *
240
393
  * Silent when there is comfortable headroom — a budget line on every plan is
241
394
  * noise, and noise is how a real warning gets ignored. It speaks up only when
242
395
  * the budget is exhausted or nearly so, and always names the remediation
243
- * rather than just the number.
396
+ * rather than just the number. An owner with no cap of their own never sees it.
397
+ *
398
+ * `agentId` makes the remedy a command that can be pasted; without it the
399
+ * command keeps a placeholder, which is only right when the caller cannot know.
400
+ */
401
+ export declare function renderCapacityWarning(capacity: TriggerCapacity | undefined, log: (line: string) => void, agentId?: string, phase?: 'review' | 'approved'): void;
402
+ /**
403
+ * Name the earlier blocks approval will cancel BEFORE the reviewer approves.
404
+ * The draft lists only what it adds, so without this the cancellation is only
405
+ * discoverable afterwards in the schedule trace (OSK-22419).
406
+ */
407
+ export declare function renderReplacementPreview(preview: ReplacementPreview | undefined, zone: string, log: (line: string) => void): void;
408
+ /** The proposed to-dos a person would be approving (dropped ones are not). */
409
+ export declare function liveProposedTodos(proposal: SmartScheduleProposal): ProposedTodo[];
410
+ /**
411
+ * Render a Smart Schedule proposal: header + the proposed (non-dropped) to-dos.
412
+ *
413
+ * Every instant is shown in the PLAN's zone and says which: a draft that "stays
414
+ * until midnight" is only readable as `00:00 PST`, not as `08:00Z` (OSK-22397).
415
+ * `--json` keeps the raw UTC instants.
244
416
  */
245
- export declare function renderCapacityWarning(capacity: TriggerCapacity | undefined, log: (line: string) => void): void;
246
- /** Render a Smart Schedule proposal: header + the proposed (non-dropped) to-dos. */
247
417
  export declare function renderProposal(proposal: SmartScheduleProposal, log: (line: string) => void): void;
418
+ /**
419
+ * The commands that can succeed for THIS draft, in the order a person would
420
+ * reach for them.
421
+ *
422
+ * The footer used to be one generic three-line block, so an EMPTY draft led with
423
+ * `--approve`, which the same command refuses ("no schedulable to-dos"): the
424
+ * very first suggestion failed (OSK-22396). An empty draft can only be accepted
425
+ * together with its suggested next run, so that is the one accept command it
426
+ * prints; with no next run to schedule there is nothing to accept and the only
427
+ * move left is to discard it.
428
+ */
429
+ export declare function proposalNextSteps(proposal: SmartScheduleProposal, bin: string, agentId: string): string[];
430
+ /**
431
+ * What an approval left behind besides To-Dos: the next planning run and the
432
+ * recurring watcher. The server always did both; only the next run was ever
433
+ * printed, so `upcoming` was the one place a person found the watcher
434
+ * (OSK-22403). Wording follows the web's approval notice.
435
+ */
436
+ export declare function approvalEffectLines(result: ApproveSmartScheduleResponse, options: {
437
+ approvedNextRun: boolean;
438
+ timeZone: string;
439
+ bin: string;
440
+ agentId: string;
441
+ }): string[];
442
+ /**
443
+ * Dismissing is plan feedback, and feedback may move the watcher's check times.
444
+ * Say which happened, so "why did the watcher fire at 11:00 and not 02:00" is
445
+ * never answerable only by diffing triggers before and after (OSK-22407).
446
+ */
447
+ export declare function dismissEffectLines(result: DismissSmartScheduleResponse): string[];
248
448
  /** Map a proposal's live todos into the approve-payload shape (approve all). */
249
449
  export declare function proposalToApproveTodos(proposal: SmartScheduleProposal): ApproveTodoInput[];
450
+ /** An instant for a person: in `timeZone` with the zone named; raw UTC when none is given. */
451
+ export declare function formatStamp(value: string | undefined, timeZone?: string, options?: {
452
+ seconds?: boolean;
453
+ }): string;