@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
@@ -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
@@ -120,7 +120,7 @@ JSON
120
120
  description: 'Watched source the criterion reads (implies --evaluator source_state), e.g. github',
121
121
  }),
122
122
  watch: core_1.Flags.string({
123
- description: 'Watched source (repeatable). Replaces the selected set and retains config for matching bindings. Some sources need companion flags: --watch-space, --watch-monitor.',
123
+ description: 'Watched source (repeatable). Replaces the selected set and retains config for matching bindings. Some sources need companion flags: --watch-space, --watch-monitor. conversations and messages need an id (config.conversationId, config.groupChatId) that only --from-json can set.',
124
124
  multiple: true,
125
125
  options: [...commitments_1.COMMITMENT_WATCHED_SOURCES],
126
126
  }),
@@ -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
+ }
@@ -0,0 +1,78 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const core_1 = require("@oclif/core");
4
+ const base_command_1 = require("../../../base-command");
5
+ const prompt_1 = require("../../../lib/prompt");
6
+ const initiatives_worker_1 = require("../../../lib/initiatives-worker");
7
+ /**
8
+ * `skrr initiatives worker deactivate <agent-id>` — stop the agent's WORKER: every one of its
9
+ * worker watchers (task/goal, follow-through, memory, ...) is disabled and its initiative policy
10
+ * goes to `off`. The agent itself is kept.
11
+ *
12
+ * A worker watcher is owned by the platform, so `agents triggers delete` refuses one with
13
+ * PRODUCER_OWNED_TRIGGER; this is the command that refusal names (OSK-22423).
14
+ */
15
+ class InitiativesWorkerDeactivate extends base_command_1.BaseCommand {
16
+ static description = "Stop an agent's worker: disable all its worker watchers and turn its initiative policy off (the agent is kept)";
17
+ static examples = [
18
+ '<%= config.bin %> initiatives worker deactivate <agent-id>',
19
+ '<%= config.bin %> initiatives worker deactivate <agent-id> --keep-initiatives --yes',
20
+ ];
21
+ static args = {
22
+ agent: core_1.Args.string({ ignoreStdin: true, description: 'Agent ID', required: true }),
23
+ };
24
+ static flags = {
25
+ json: core_1.Flags.boolean({ description: 'Output as JSON' }),
26
+ yes: core_1.Flags.boolean({ char: 'y', description: 'Skip the confirmation prompt' }),
27
+ 'keep-initiatives': core_1.Flags.boolean({
28
+ description: 'Leave the agent\'s open initiatives as they are (by default they are closed)',
29
+ }),
30
+ reason: core_1.Flags.string({ description: 'Why (recorded on the change)' }),
31
+ };
32
+ async run() {
33
+ this.requireAuth();
34
+ const { args, flags } = await this.parse(InitiativesWorkerDeactivate);
35
+ let confirmed;
36
+ try {
37
+ confirmed = await (0, prompt_1.confirmDestructive)(`Disable every worker watcher of ${args.agent} and turn its initiative policy off` +
38
+ `${flags['keep-initiatives'] ? '' : ', closing its open initiatives'}?`, flags.yes);
39
+ }
40
+ catch (err) {
41
+ if (err.exit === 7)
42
+ this.error(err.message, { exit: 7 });
43
+ throw err;
44
+ }
45
+ if (!confirmed) {
46
+ this.log('Cancelled.');
47
+ return;
48
+ }
49
+ let result;
50
+ try {
51
+ result = await initiatives_worker_1.initiativesWorkerApi.deactivate({
52
+ agentId: args.agent,
53
+ ...(flags.reason ? { reason: flags.reason } : {}),
54
+ ...(flags['keep-initiatives'] ? { closeOpenInitiatives: false } : {}),
55
+ });
56
+ }
57
+ catch (err) {
58
+ this.handleApiError(err);
59
+ }
60
+ if (flags.json) {
61
+ this.printJsonResult(result);
62
+ return;
63
+ }
64
+ this.log(`Worker stopped for ${result.agentId}.`);
65
+ for (const item of result.schedules ?? []) {
66
+ if (item.skipped || !item.schedule)
67
+ continue;
68
+ this.log(` ${item.kind}: ${item.schedule.enabled === false ? 'disabled' : 'unchanged'}` +
69
+ `${item.schedule.triggerId ? ` (${item.schedule.triggerId})` : ''}`);
70
+ }
71
+ const closure = result.initiativeClosure;
72
+ if (closure && !closure.skipped) {
73
+ this.log(` initiatives closed: ${closure.modified ?? 0} of ${closure.matched ?? 0}`);
74
+ }
75
+ this.log('The watchers stay listed, disabled. They are not deleted.');
76
+ }
77
+ }
78
+ exports.default = InitiativesWorkerDeactivate;
@@ -248,7 +248,10 @@ class Login extends base_command_1.BaseCommand {
248
248
  // and a failure here must not fail it or discard what the user just earned.
249
249
  // It degrades to exactly the old behaviour, with a hint naming the command
250
250
  // that finishes the job.
251
- let handoff = await (0, daemonHandoff_1.handOffToLocalDaemon)(process.env, { loginFlow: result.flow });
251
+ let handoff = await (0, daemonHandoff_1.handOffToLocalDaemon)(process.env, {
252
+ loginFlow: result.flow,
253
+ brokerProfile: result.brokerProfile,
254
+ });
252
255
  // Nothing to hand a credential TO. This is the first moment we can fix
253
256
  // that correctly — installing the daemon binds it to a deployment and a
254
257
  // profile, and until this login there was no session to take them from.
@@ -264,7 +267,10 @@ class Login extends base_command_1.BaseCommand {
264
267
  if (setup.status === 'installed') {
265
268
  // Re-run rather than duplicating the mint here: it is the same act
266
269
  // it always was, and now it has somewhere to land.
267
- handoff = await (0, daemonHandoff_1.handOffToLocalDaemon)(process.env, { loginFlow: result.flow });
270
+ handoff = await (0, daemonHandoff_1.handOffToLocalDaemon)(process.env, {
271
+ loginFlow: result.flow,
272
+ brokerProfile: result.brokerProfile,
273
+ });
268
274
  }
269
275
  else if (setup.status === 'failed') {
270
276
  this.log(`Could not set up the background service: ${setup.detail}.`);
@@ -1,15 +1,35 @@
1
1
  import { BaseCommand } from '../base-command';
2
+ import { type CliSessionRevokeResult } from '../lib/refresh';
2
3
  export declare function shouldSkipLocalLogout(input: {
3
4
  hasAnyStoredToken: boolean;
4
5
  hasUsableLocalToken: boolean;
5
6
  hasUnreadableEncryptedToken: boolean;
6
7
  allDevices: boolean;
7
8
  }): boolean;
9
+ /**
10
+ * Why the sign-in this logout removed is still a live session on the server,
11
+ * or null when the server took the revoke, or there was no session to revoke.
12
+ *
13
+ * Logout clears the local credential whatever the server says, so a person can
14
+ * always sign out of a computer. It used to say "Signed out." either way, and a
15
+ * session the server never heard about stayed usable with nothing to show for
16
+ * it (OSK-22307: a profile whose files `skrrd profile remove` had moved could
17
+ * not decrypt its CLI credential, so nothing was sent).
18
+ */
19
+ export declare function unrevokedSessionReason(input: {
20
+ revoke: CliSessionRevokeResult;
21
+ hasUnreadableEncryptedToken: boolean;
22
+ hasAnyStoredToken: boolean;
23
+ serverUrl: string;
24
+ }): string | null;
25
+ /** How to end a session this computer could not revoke, from a profile still signed in. */
26
+ export declare function unrevokedSessionRemedy(cliId: string | undefined): string;
8
27
  export default class Logout extends BaseCommand {
9
28
  static description: string;
10
29
  static flags: {
11
30
  'all-devices': import("@oclif/core/interfaces").BooleanFlag<boolean>;
12
31
  yes: import("@oclif/core/interfaces").BooleanFlag<boolean>;
32
+ json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
13
33
  };
14
34
  run(): Promise<void>;
15
35
  /**
@@ -34,6 +34,8 @@ var __importStar = (this && this.__importStar) || (function () {
34
34
  })();
35
35
  Object.defineProperty(exports, "__esModule", { value: true });
36
36
  exports.shouldSkipLocalLogout = shouldSkipLocalLogout;
37
+ exports.unrevokedSessionReason = unrevokedSessionReason;
38
+ exports.unrevokedSessionRemedy = unrevokedSessionRemedy;
37
39
  const core_1 = require("@oclif/core");
38
40
  const base_command_1 = require("../base-command");
39
41
  const config_1 = require("../lib/config");
@@ -42,6 +44,7 @@ const auth_storage_1 = require("../lib/auth-storage");
42
44
  const daemonBroker_1 = require("../lib/daemonBroker");
43
45
  const dedicated_service_1 = require("../lib/dedicated-service");
44
46
  const refresh_1 = require("../lib/refresh");
47
+ const cli_id_1 = require("../lib/cli-id");
45
48
  const api_fetch_1 = require("../lib/api-fetch");
46
49
  const cred_envelope_1 = require("../lib/cred-envelope");
47
50
  const device_identity_1 = require("../lib/device-identity");
@@ -52,6 +55,54 @@ function shouldSkipLocalLogout(input) {
52
55
  !input.hasUnreadableEncryptedToken &&
53
56
  !input.allDevices);
54
57
  }
58
+ function hostOf(serverUrl) {
59
+ try {
60
+ return new URL(serverUrl).host || serverUrl;
61
+ }
62
+ catch {
63
+ return serverUrl;
64
+ }
65
+ }
66
+ /**
67
+ * Why the sign-in this logout removed is still a live session on the server,
68
+ * or null when the server took the revoke, or there was no session to revoke.
69
+ *
70
+ * Logout clears the local credential whatever the server says, so a person can
71
+ * always sign out of a computer. It used to say "Signed out." either way, and a
72
+ * session the server never heard about stayed usable with nothing to show for
73
+ * it (OSK-22307: a profile whose files `skrrd profile remove` had moved could
74
+ * not decrypt its CLI credential, so nothing was sent).
75
+ */
76
+ function unrevokedSessionReason(input) {
77
+ const { revoke } = input;
78
+ const host = hostOf(input.serverUrl);
79
+ switch (revoke.outcome) {
80
+ case 'accepted':
81
+ return null;
82
+ case 'refused':
83
+ return `${host} answered HTTP ${revoke.status}`;
84
+ case 'unreachable':
85
+ return `${host} could not be reached (${revoke.detail})`;
86
+ case 'not_sent':
87
+ if (input.hasUnreadableEncryptedToken) {
88
+ return 'the stored sign-in could not be decrypted on this computer, so there was nothing to present to the server';
89
+ }
90
+ if (revoke.reason === 'read_failed') {
91
+ return `the stored sign-in could not be read (${revoke.detail ?? 'unknown error'})`;
92
+ }
93
+ if (revoke.reason === 'no_credential' && input.hasAnyStoredToken) {
94
+ return `the stored sign-in is not bound to ${host}, so it was not sent there`;
95
+ }
96
+ // Nothing stored, or a token with no session behind it to end here.
97
+ return null;
98
+ }
99
+ }
100
+ /** How to end a session this computer could not revoke, from a profile still signed in. */
101
+ function unrevokedSessionRemedy(cliId) {
102
+ const which = cliId ? `the row whose DAEMON is ${cliId}` : "this computer's CLI session";
103
+ return ('It stays usable until it expires. To end it now, run `skrr token list --kind cli` ' +
104
+ `from a profile that is still signed in, find ${which}, and run \`skrr token revoke <id>\`.`);
105
+ }
55
106
  /**
56
107
  * `skrr logout` / `skrr logout --all-devices`
57
108
  *
@@ -125,6 +176,12 @@ class Logout extends base_command_1.BaseCommand {
125
176
  description: 'Skip the --all-devices confirmation prompt (CI / scripting).',
126
177
  default: false,
127
178
  }),
179
+ json: core_1.Flags.boolean({
180
+ description: 'Print the outcome as JSON: whether a local sign-in was removed and whether its ' +
181
+ 'server session was revoked. `ok` is false when a session was left live.',
182
+ default: false,
183
+ exclusive: ['all-devices'],
184
+ }),
128
185
  };
129
186
  async run() {
130
187
  const { flags } = await this.parse(Logout);
@@ -147,6 +204,14 @@ class Logout extends base_command_1.BaseCommand {
147
204
  // `access_token`) there IS no local credential to clear — the CLI holds
148
205
  // a per-process token redeemed over loopback and nothing is persisted.
149
206
  // Say that honestly rather than reporting a logout that did not happen.
207
+ if (flags.json) {
208
+ this.printJsonResult({
209
+ signedOut: false,
210
+ profile: keychain.getActiveProfile(),
211
+ serverSession: 'none',
212
+ });
213
+ return;
214
+ }
150
215
  if (platformManagedHandoff()) {
151
216
  this.log("This machine is signed in through the platform's managed hand-off; " +
152
217
  'there is no local credential to clear.');
@@ -186,13 +251,29 @@ class Logout extends base_command_1.BaseCommand {
186
251
  // every daemon-scope refresh session, but the CLI's OWN refresh
187
252
  // session is a `scope='cli'` row without a Daemon FK and was NOT
188
253
  // touched by the iteration. This call gets it.
254
+ //
255
+ // Its outcome is reported, never a reason to stop: logout must succeed
256
+ // locally even when the API host is unreachable.
257
+ let revoke;
189
258
  try {
190
- await (0, refresh_1.revokeCurrentRefreshToken)();
259
+ revoke = await (0, refresh_1.revokeCurrentRefreshToken)();
191
260
  }
192
- catch {
193
- // intentionally swallowed — logout must succeed locally even
194
- // when the API host is unreachable.
261
+ catch (err) {
262
+ revoke = {
263
+ outcome: 'not_sent',
264
+ reason: 'read_failed',
265
+ detail: err instanceof Error ? err.message : String(err),
266
+ };
195
267
  }
268
+ // Read before the config is rewritten below, which keeps it anyway.
269
+ const configBefore = (0, config_1.loadConfig)();
270
+ const unrevoked = unrevokedSessionReason({
271
+ revoke,
272
+ hasUnreadableEncryptedToken,
273
+ hasAnyStoredToken,
274
+ serverUrl: configBefore.baseURL,
275
+ });
276
+ const cliId = (0, cli_id_1.resolveCliId)(configBefore);
196
277
  (0, auth_storage_1.clearAllBackends)();
197
278
  // Sweep the credentials this product wrote under its PREVIOUS brand.
198
279
  //
@@ -265,12 +346,36 @@ class Logout extends base_command_1.BaseCommand {
265
346
  // below); `skrr login` clears the flag.
266
347
  adoptDaemonSession: false,
267
348
  });
349
+ if (flags.json) {
350
+ this.printJsonResult({
351
+ signedOut: true,
352
+ profile: keychain.getActiveProfile(),
353
+ server: configBefore.baseURL,
354
+ cliId: cliId ?? null,
355
+ serverSession: unrevoked
356
+ ? 'not_revoked'
357
+ : revoke.outcome === 'accepted'
358
+ ? 'revoked'
359
+ : 'none',
360
+ ...(unrevoked ? { reason: unrevoked } : {}),
361
+ ...(sweptLegacy.length > 0 ? { removedLegacyCredentials: sweptLegacy } : {}),
362
+ }, { ok: !unrevoked });
363
+ return;
364
+ }
268
365
  const finalMessage = flags['all-devices']
269
366
  ? allDevicesError
270
367
  ? 'Signed out locally. Remote daemons NOT revoked (see warning above).'
271
368
  : 'Signed out from all devices.'
272
- : 'Signed out.';
369
+ : unrevoked
370
+ ? `Signed out on this computer, but its session was NOT revoked: ${unrevoked}.`
371
+ : 'Signed out.';
273
372
  this.log(finalMessage);
373
+ if (unrevoked) {
374
+ if (flags['all-devices']) {
375
+ this.log(`This computer's own CLI session was NOT revoked: ${unrevoked}.`);
376
+ }
377
+ this.log(unrevokedSessionRemedy(cliId));
378
+ }
274
379
  // On a brokered Dedicated guest the sign-in just removed was the person's
275
380
  // OWN (an explicit `skrr login`); the machine's platform-managed access is
276
381
  // untouched and skrr keeps working through it. Say both, so "Signed out."
@@ -39,9 +39,12 @@ class MemoryMaintain extends base_command_1.BaseCommand {
39
39
  }
40
40
  let result;
41
41
  // Keep stdout machine-readable for --json; progress goes only to stderr.
42
+ // A plain remember takes about 4 to 5 seconds, so the notice waits past that: shown on
43
+ // every ordinary save it carried no information (OSK-22394). Only a save that is
44
+ // actually slow gets it.
42
45
  const waiting = args.operation === 'remember' ? setTimeout(() => {
43
46
  process.stderr.write('Still waiting for the memory save; the result is not confirmed yet.\n');
44
- }, 4000) : null;
47
+ }, 10_000) : null;
45
48
  waiting?.unref();
46
49
  try {
47
50
  if (args.operation === 'remember')
@@ -55,7 +58,18 @@ class MemoryMaintain extends base_command_1.BaseCommand {
55
58
  const transportLost = ['ECONNABORTED', 'ETIMEDOUT', 'ECONNRESET', 'EPIPE', 'ERR_NETWORK', 'ECONNREFUSED', 'EAI_AGAIN'].includes(e?.code || '') ||
56
59
  e?.name === 'TimeoutError' || /fetch failed|socket hang up|network error|timed out|timeout/i.test(e?.message || '');
57
60
  if (args.operation === 'remember' && ((status !== undefined && status >= 500) || (!status && transportLost))) {
58
- this.error('The memory save was not confirmed. It may have succeeded; check the Agent’s Memory or retry the exact same command.', { code: 'MEMORY_OUTCOME_UNKNOWN' });
61
+ // The save may have landed, and an identical retry is an idempotent replay (the
62
+ // server answers `idempotentReplay`), so the error is retryable and names the
63
+ // exact read that settles it, as `memory topics create` does (OSK-22393).
64
+ const check = `${this.config.bin} memory topics list --agent ${flags.agent} --scope agent:${flags.agent}`;
65
+ this.failWithCliError({
66
+ message: `The memory save was not confirmed. It may have succeeded. Check with \`${check}\`, ` +
67
+ 'or run the exact same command again: an identical retry is safe and is answered as an idempotent replay if the first save landed.',
68
+ code: 'MEMORY_OUTCOME_UNKNOWN',
69
+ exit: 1,
70
+ retryable: true,
71
+ details: { outcome: 'unknown', operation: 'remember', agentId: flags.agent, check },
72
+ });
59
73
  }
60
74
  this.handleApiError(error);
61
75
  }
@@ -22,7 +22,7 @@ class SpacesDelete extends base_command_1.BaseCommand {
22
22
  const spaceRef = await this.resolveEntityRef('space', args.id);
23
23
  let confirmed;
24
24
  try {
25
- confirmed = await (0, prompt_1.confirmDestructive)(`Delete space ${spaceRef}? This cannot be undone.`, flags.yes);
25
+ confirmed = await (0, prompt_1.confirmDestructive)(`Delete space ${spaceRef}? This cannot be undone. Tasks in the space are not deleted: they stay as your own tasks outside any space.`, flags.yes);
26
26
  }
27
27
  catch (err) {
28
28
  if (err.exit === 7) {
@@ -41,6 +41,11 @@ class SpacesDelete extends base_command_1.BaseCommand {
41
41
  this.handleApiError(err);
42
42
  }
43
43
  this.log(`Deleted space ${spaceRef}`);
44
+ // The server unlinks a deleted Space's tasks rather than deleting them: they are the owner's
45
+ // own work. Until now the receipt said nothing, and they surfaced later in task lists with no
46
+ // Space (OSK-22519).
47
+ this.log('Its tasks were not deleted. They stay as your own tasks outside any space; find them with ' +
48
+ `\`${this.config.bin} tasks list\` and delete or move any you do not want.`);
44
49
  }
45
50
  }
46
51
  exports.default = SpacesDelete;
@@ -98,6 +98,10 @@ class SpacesWorkflowTemplatesInsert extends base_command_1.BaseCommand {
98
98
  }
99
99
  // Someone saved between the read and the write. Only the revision pair
100
100
  // was stale, so one re-read makes the identical request valid again.
101
+ // Say so on stderr (stdout and --json stay parseable): the server answered
102
+ // 409, and a person who never hears that cannot tell their insert was
103
+ // judged against a canvas someone else had just changed (OSK-22622).
104
+ this.warn('The draft changed while inserting (409 WORKFLOW_DRAFT_CONFLICT); re-read it and inserted again.');
101
105
  try {
102
106
  result = await attempt();
103
107
  }
@@ -34,8 +34,13 @@ class SpacesWorkflowsArchive extends base_command_1.BaseCommand {
34
34
  const result = await data_provider_1.dataService.archiveSpaceWorkflow(args.spaceId, args.workflowId);
35
35
  if (flags.json)
36
36
  this.log(JSON.stringify(result, null, 2));
37
- else
37
+ else {
38
38
  this.log(`Archived workflow ${result.id}.`);
39
+ const paused = result.pausedTriggers ?? 0;
40
+ // Its triggers are hidden once it is archived, so say what became of the active ones.
41
+ if (paused > 0)
42
+ this.log(`Paused ${paused} active trigger${paused === 1 ? '' : 's'} (schedule timers retired); none will fire.`);
43
+ }
39
44
  }
40
45
  catch (error) {
41
46
  this.handleApiError(error);
@@ -35,7 +35,9 @@ class SpacesWorkflowsPublish extends base_command_1.BaseCommand {
35
35
  // Published, not refused (owner decision 2026-10-15) — so the warning has to be loud here.
36
36
  const warnings = version.warnings ?? [];
37
37
  if (warnings.length) {
38
- this.warn(`Published with ${warnings.length} warning${warnings.length === 1 ? '' : 's'} — runs of this version will hit ${warnings.length === 1 ? 'it' : 'them'}:`);
38
+ // Not every warning is something a run hits (an unrouted outcome, an unconnected branch are
39
+ // facts about the graph), so the line says only that the publish carried them.
40
+ this.warn(`Published with ${warnings.length} warning${warnings.length === 1 ? '' : 's'} — the version is live; check ${warnings.length === 1 ? 'it' : 'them'}:`);
39
41
  for (const line of (0, workflow_issues_1.formatWorkflowIssues)(warnings))
40
42
  this.log(line);
41
43
  }
@@ -15,6 +15,7 @@ export declare function describeNodeAttention(node: {
15
15
  error?: {
16
16
  message?: string;
17
17
  } | null;
18
+ blockedReason?: string | null;
18
19
  }): string;
19
20
  export declare function describeLoopItemsNote(node: {
20
21
  nodeKey?: unknown;
@@ -23,7 +23,12 @@ function describeNodeAttention(node) {
23
23
  if (node.lane !== 'attention')
24
24
  return '';
25
25
  const reason = typeof node.attentionReason === 'string' ? node.attentionReason : '';
26
- const message = typeof node.error?.message === 'string' ? node.error.message : '';
26
+ // A blocked node's reason is its Task's blocker, which is not an `error` (OSK-21738).
27
+ const message = typeof node.error?.message === 'string'
28
+ ? node.error.message
29
+ : reason === 'blocked' && typeof node.blockedReason === 'string'
30
+ ? node.blockedReason
31
+ : '';
27
32
  if (reason && message)
28
33
  return `${reason}: ${message}`;
29
34
  return reason || message || 'needs attention';
@@ -95,6 +100,17 @@ class SpacesWorkflowsRun extends base_command_1.BaseCommand {
95
100
  }), null, 2));
96
101
  this.log(`Run: ${run.id}`);
97
102
  this.log(`Status: ${run.status}`);
103
+ // Why a failed run failed, when it was an outcome with nowhere to go (OSK-21658).
104
+ const failureCause = run.failureCause;
105
+ if (typeof failureCause?.message === 'string')
106
+ this.log(`Why: ${oneLine(failureCause.message)}`);
107
+ // A run is `paused` only when no other branch can make progress. With a paused step and a
108
+ // successor still pending it stays `running`, which read as though the pause had not taken
109
+ // (OSK-22459), so say how many steps are paused and why the run is not.
110
+ const pausedSteps = (run.nodes || []).filter((node) => node.status === 'paused').length;
111
+ if (pausedSteps > 0 && run.status !== 'paused') {
112
+ this.log(`Paused steps: ${pausedSteps} (the run is not \`paused\` while other work could still be dispatched).`);
113
+ }
98
114
  for (const line of (0, workflow_run_budget_1.describeRunBudget)(run))
99
115
  this.log(line);
100
116
  if (runUrl)
@@ -33,7 +33,9 @@ class SpacesWorkflowsTriggersCreate extends base_command_1.BaseCommand {
33
33
  default: 'paused',
34
34
  description: 'Initial trigger status',
35
35
  }),
36
- config: core_1.Flags.string({ description: 'Trigger config as JSON' }),
36
+ config: core_1.Flags.string({
37
+ description: 'Trigger config as JSON. schedule: {"intervalMs":60000} (milliseconds, 60000 to 2678400000) plus an optional "input" object; webhook takes none.',
38
+ }),
37
39
  'config-file': core_1.Flags.string({ description: 'Path to JSON trigger config, or "-" for stdin' }),
38
40
  json: core_1.Flags.boolean({ description: 'Output as JSON' }),
39
41
  };
@@ -156,6 +156,28 @@ class StoreShow extends base_command_1.BaseCommand {
156
156
  this.log(line);
157
157
  }
158
158
  this.log(` ${store_listing_1.CAPABILITY_DISCLOSURE_FOOTNOTE}`);
159
+ // ── Skills it needs ──
160
+ // The install is refused until the required ones are installed, and the disclosure above names
161
+ // them only as ids, so say it here, by name, with the command (OSK-22547).
162
+ const currentRelease = (releases.value?.data ?? []).find((r) => r.id === listing.latestReleaseId) ??
163
+ releases.value?.data?.[0];
164
+ const skillDependencies = (currentRelease?.dependencies ?? []).filter((dependency) => dependency.entityType === 'skill');
165
+ const skillLabel = (dependency) => dependency.name ? `${dependency.name} (${dependency.entityId})` : dependency.entityId;
166
+ const requiredSkills = skillDependencies.filter((dependency) => dependency.required);
167
+ const optionalSkills = skillDependencies.filter((dependency) => !dependency.required);
168
+ if (requiredSkills.length > 0) {
169
+ this.log('');
170
+ this.log(`Requires ${requiredSkills.length} Skill${requiredSkills.length === 1 ? '' : 's'}: ` +
171
+ `${requiredSkills.map(skillLabel).join(', ')}`);
172
+ this.log(' The install is refused until you have them. Install each first:');
173
+ for (const dependency of requiredSkills) {
174
+ this.log(` ${this.config.bin} skills install ${dependency.entityId}`);
175
+ }
176
+ }
177
+ if (optionalSkills.length > 0) {
178
+ this.log('');
179
+ this.log(`Works better with: ${optionalSkills.map(skillLabel).join(', ')}`);
180
+ }
159
181
  // ── Releases ──
160
182
  this.log('');
161
183
  this.log(`Current release: ${version}${listing.releaseNumber ? ` (release ${listing.releaseNumber})` : ''}` +
@@ -98,7 +98,9 @@ class TasksWorkflowContext extends base_command_1.BaseCommand {
98
98
  }
99
99
  }
100
100
  if (downstream.length) {
101
- this.log('Waiting on this:');
101
+ // Only steps that can still run are waiting; a finished run's downstream steps are listed
102
+ // under a neutral heading instead of claiming they wait on a completed step (OSK-22284).
103
+ this.log(context.hasLiveDownstream ? 'Waiting on this:' : 'Downstream:');
102
104
  for (const entry of downstream) {
103
105
  // A pruned edge means "decided against", not "not yet" — the two lead
104
106
  // to opposite decisions about whether to keep working on this step.
@@ -32,7 +32,23 @@ class TriggersCapabilities extends base_command_1.BaseCommand {
32
32
  }
33
33
  this.log(`Scope: ${String(capabilities.scopeKind ?? args.scope)}`);
34
34
  this.log(`Kinds: ${Array.isArray(capabilities.allowedKinds) ? capabilities.allowedKinds.join(', ') : '-'}`);
35
- this.log(`Modes: ${Array.isArray(capabilities.allowedExecutorModes) ? capabilities.allowedExecutorModes.join(', ') : '-'}`);
35
+ // The modes `triggers create --mode` will accept. `allowedExecutorModes` is longer: it keeps the
36
+ // modes only an internal producer may mint, which create refuses, so listing it here offered
37
+ // choices that fail on submit (OSK-22489). A server that predates the field only has the long
38
+ // list, and a person on it may be offered one refused choice.
39
+ const authorable = Array.isArray(capabilities.authorableExecutorModes)
40
+ ? capabilities.authorableExecutorModes
41
+ : capabilities.allowedExecutorModes;
42
+ this.log(`Modes: ${Array.isArray(authorable) ? authorable.join(', ') : '-'}`);
43
+ // The mode names say nothing about side effects; describe the ones an author usually picks
44
+ // between (OSK-21766).
45
+ if (Array.isArray(authorable)) {
46
+ for (const mode of authorable) {
47
+ const effect = (0, triggers_1.executorModeEffect)(mode);
48
+ if (effect)
49
+ this.log(` ${String(mode)}: ${effect}`);
50
+ }
51
+ }
36
52
  const vars = Array.isArray(capabilities.templateVariables)
37
53
  ? capabilities.templateVariables.map((v) => typeof v === 'object' && v !== null ? String(v.name) : String(v))
38
54
  : capabilities.templateVariableNames;
@@ -78,6 +78,8 @@ export default class TriggersCreate extends BaseCommand {
78
78
  'allow-unknown-event': import("@oclif/core/interfaces").BooleanFlag<boolean>;
79
79
  };
80
80
  run(): Promise<void>;
81
+ /** How a saved working / quiet window will be read, when that is not what it looks like (OSK-22530). */
82
+ private warnWindowAdvice;
81
83
  private warnMissingSelfSchedule;
82
84
  /**
83
85
  * The server creates the trigger and then says whether something already