@skrr-ai/cli 0.1.93 → 0.1.95

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 (174) hide show
  1. package/README.md +153 -165
  2. package/bin/run.js +32 -0
  3. package/bin/update-npm-runner.cjs +33 -0
  4. package/bin/update-session.cjs +194 -0
  5. package/bin/update-worker.cjs +208 -0
  6. package/dist/base-command.js +0 -15
  7. package/dist/commands/agents/operating-plan.d.ts +11 -0
  8. package/dist/commands/agents/operating-plan.js +54 -0
  9. package/dist/commands/agents/roles/example.d.ts +11 -0
  10. package/dist/commands/agents/roles/example.js +30 -0
  11. package/dist/commands/{commitments/mode.d.ts → agents/roles/export.d.ts} +5 -5
  12. package/dist/commands/agents/roles/export.js +81 -0
  13. package/dist/commands/agents/roles/install.d.ts +12 -0
  14. package/dist/commands/agents/roles/install.js +48 -0
  15. package/dist/commands/agents/roles/list.d.ts +11 -0
  16. package/dist/commands/agents/roles/list.js +36 -0
  17. package/dist/commands/agents/roles/preview.d.ts +14 -0
  18. package/dist/commands/agents/roles/preview.js +49 -0
  19. package/dist/commands/agents/roles/withdraw.d.ts +13 -0
  20. package/dist/commands/agents/roles/withdraw.js +43 -0
  21. package/dist/commands/code/doctor.d.ts +1 -0
  22. package/dist/commands/code/doctor.js +6 -0
  23. package/dist/commands/code/index.js +4 -0
  24. package/dist/commands/code/install.d.ts +5 -62
  25. package/dist/commands/code/install.js +86 -279
  26. package/dist/commands/code/rollback.d.ts +8 -0
  27. package/dist/commands/code/rollback.js +20 -0
  28. package/dist/commands/code/update.d.ts +8 -37
  29. package/dist/commands/code/update.js +134 -213
  30. package/dist/commands/commitments/{autonomy-requests → cadence-requests}/decide.d.ts +5 -7
  31. package/dist/commands/commitments/{autonomy-requests → cadence-requests}/decide.js +13 -15
  32. package/dist/commands/commitments/cost.d.ts +1 -1
  33. package/dist/commands/commitments/cost.js +1 -1
  34. package/dist/commands/commitments/create.d.ts +0 -7
  35. package/dist/commands/commitments/create.js +9 -98
  36. package/dist/commands/commitments/delivery.js +3 -21
  37. package/dist/commands/commitments/doctor.js +28 -27
  38. package/dist/commands/commitments/effective-policy.js +5 -36
  39. package/dist/commands/commitments/evaluations.d.ts +15 -0
  40. package/dist/commands/commitments/evaluations.js +54 -0
  41. package/dist/commands/commitments/pack/activate.d.ts +11 -0
  42. package/dist/commands/commitments/pack/activate.js +22 -0
  43. package/dist/commands/commitments/pack/bind.js +1 -1
  44. package/dist/commands/commitments/remediate.js +2 -5
  45. package/dist/commands/commitments/show.js +1 -1
  46. package/dist/commands/commitments/update.js +9 -9
  47. package/dist/commands/commitments/wake-capabilities.d.ts +1 -3
  48. package/dist/commands/commitments/wake-capabilities.js +5 -21
  49. package/dist/commands/daemon/install.js +4 -0
  50. package/dist/commands/generate-recovery-code.d.ts +13 -1
  51. package/dist/commands/generate-recovery-code.js +146 -13
  52. package/dist/commands/instructions/guide.d.ts +20 -0
  53. package/dist/commands/instructions/guide.js +84 -0
  54. package/dist/commands/instructions/install.js +57 -33
  55. package/dist/commands/instructions/setup.d.ts +14 -0
  56. package/dist/commands/instructions/setup.js +72 -0
  57. package/dist/commands/integrations/execute.js +1 -1
  58. package/dist/commands/login.d.ts +5 -6
  59. package/dist/commands/login.js +27 -11
  60. package/dist/commands/logout.js +7 -7
  61. package/dist/commands/security/overview.d.ts +11 -0
  62. package/dist/commands/security/overview.js +158 -0
  63. package/dist/commands/spaces/claim.d.ts +12 -0
  64. package/dist/commands/spaces/claim.js +42 -0
  65. package/dist/commands/spaces/ownership.d.ts +12 -0
  66. package/dist/commands/spaces/ownership.js +46 -0
  67. package/dist/commands/tasks/cancel-cascade.js +1 -1
  68. package/dist/commands/tasks/create-tree.d.ts +5 -1
  69. package/dist/commands/tasks/create-tree.js +35 -7
  70. package/dist/commands/tasks/interrupt.js +2 -2
  71. package/dist/commands/tasks/pause-schedule.js +1 -1
  72. package/dist/commands/token/list.d.ts +3 -5
  73. package/dist/commands/token/list.js +99 -57
  74. package/dist/commands/update.d.ts +14 -0
  75. package/dist/commands/update.js +61 -0
  76. package/dist/generated/managed-instruction-guides.json +9 -0
  77. package/dist/hooks/init.d.ts +5 -0
  78. package/dist/hooks/init.js +27 -0
  79. package/dist/lib/commitment-product.d.ts +0 -6
  80. package/dist/lib/commitment-product.js +1 -30
  81. package/dist/lib/commitments.d.ts +9 -53
  82. package/dist/lib/commitments.js +23 -146
  83. package/dist/lib/daemon-installer.d.ts +2 -0
  84. package/dist/lib/daemon-installer.js +100 -24
  85. package/dist/lib/first-party-harness-doctor.js +31 -1
  86. package/dist/lib/first-party-harness-remote-install.d.ts +71 -0
  87. package/dist/lib/first-party-harness-remote-install.js +310 -0
  88. package/dist/lib/first-party-harness-remote-update.d.ts +46 -0
  89. package/dist/lib/first-party-harness-remote-update.js +242 -0
  90. package/dist/lib/first-party-harness-startup-update.d.ts +26 -0
  91. package/dist/lib/first-party-harness-startup-update.js +166 -0
  92. package/dist/lib/first-party-harness-update.d.ts +46 -0
  93. package/dist/lib/first-party-harness-update.js +289 -0
  94. package/dist/lib/first-party-harness.js +7 -4
  95. package/dist/lib/managed-instruction-local.d.ts +12 -0
  96. package/dist/lib/managed-instruction-local.js +58 -0
  97. package/dist/lib/managed-instruction-setup.d.ts +35 -0
  98. package/dist/lib/managed-instruction-setup.js +306 -0
  99. package/dist/lib/memory-sync.d.ts +1 -0
  100. package/dist/lib/memory-sync.js +279 -68
  101. package/dist/lib/northstars.js +1 -1
  102. package/dist/lib/platform-update-local.d.ts +2 -0
  103. package/dist/lib/platform-update-local.js +113 -0
  104. package/dist/lib/platform-update.d.ts +39 -0
  105. package/dist/lib/platform-update.js +84 -0
  106. package/dist/lib/profile-machine-identity-guard.d.ts +2 -0
  107. package/dist/lib/profile-machine-identity-guard.js +13 -0
  108. package/dist/lib/prompt.d.ts +1 -0
  109. package/dist/lib/prompt.js +4 -3
  110. package/dist/lib/roles.d.ts +98 -0
  111. package/dist/lib/roles.js +45 -0
  112. package/dist/lib/task-batch.d.ts +9 -0
  113. package/dist/lib/task-batch.js +94 -17
  114. package/dist/lib/task-instruction-offer.d.ts +1 -4
  115. package/dist/lib/task-instruction-offer.js +3 -129
  116. package/dist/lib/update-check.d.ts +61 -53
  117. package/dist/lib/update-check.js +453 -314
  118. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/commitmentExecutionContract.d.ts +45 -0
  119. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/commitmentExecutionContract.js +550 -0
  120. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/firstPartyHarnessChannels.d.ts +3 -4
  121. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/firstPartyHarnessChannels.js +3 -4
  122. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/firstPartyHarnessReleaseKeys.d.ts +82 -0
  123. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/firstPartyHarnessReleaseKeys.js +105 -0
  124. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/firstPartyHarnessUpdater.d.ts +110 -0
  125. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/firstPartyHarnessUpdater.js +945 -0
  126. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/harnessPermissionControls.d.ts +32 -0
  127. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/harnessPermissionControls.js +62 -0
  128. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/index.d.ts +2 -0
  129. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/index.js +4 -1
  130. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/machineUuid.js +35 -5
  131. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/releasePolicy.d.ts +63 -0
  132. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/releasePolicy.js +169 -0
  133. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/releaseVersions.d.ts +2 -0
  134. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/releaseVersions.js +44 -0
  135. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/sessionPermissionAuthority.d.ts +7 -44
  136. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/sessionPermissionAuthority.js +8 -47
  137. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/commitmentExecutionContract.d.ts +45 -0
  138. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/commitmentExecutionContract.js +545 -0
  139. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/firstPartyHarnessChannels.d.ts +3 -4
  140. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/firstPartyHarnessChannels.js +3 -4
  141. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/firstPartyHarnessReleaseKeys.d.ts +82 -0
  142. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/firstPartyHarnessReleaseKeys.js +102 -0
  143. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/firstPartyHarnessUpdater.d.ts +110 -0
  144. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/firstPartyHarnessUpdater.js +923 -0
  145. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/harnessPermissionControls.d.ts +32 -0
  146. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/harnessPermissionControls.js +59 -0
  147. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/index.d.ts +2 -0
  148. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/index.js +2 -0
  149. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/machineUuid.js +35 -5
  150. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/releasePolicy.d.ts +63 -0
  151. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/releasePolicy.js +163 -0
  152. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/releaseVersions.d.ts +2 -0
  153. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/releaseVersions.js +41 -0
  154. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/sessionPermissionAuthority.d.ts +7 -44
  155. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/sessionPermissionAuthority.js +8 -47
  156. package/dist/node_modules/@skrr-ai/auth-core/package.json +41 -1
  157. package/dist/node_modules/@skrr-ai/data-provider/index.js +7362 -7232
  158. package/dist/node_modules/@skrr-ai/data-provider/package.json +2 -2
  159. package/docs/v1/README.md +28 -0
  160. package/docs/v1/api.md +55 -0
  161. package/docs/v1/changelog.md +16 -0
  162. package/docs/v1/check-examples.mjs +178 -0
  163. package/docs/v1/examples/api-readonly.mjs +144 -0
  164. package/docs/v1/operations.md +87 -0
  165. package/docs/v1/quickstart.md +71 -0
  166. package/oclif.manifest.json +46381 -45478
  167. package/package.json +16 -11
  168. package/dist/commands/commitments/autonomy.d.ts +0 -30
  169. package/dist/commands/commitments/autonomy.js +0 -67
  170. package/dist/commands/commitments/mode.js +0 -58
  171. package/dist/commands/commitments/pack/promote.d.ts +0 -19
  172. package/dist/commands/commitments/pack/promote.js +0 -46
  173. package/dist/commands/commitments/pack/shadow.d.ts +0 -20
  174. package/dist/commands/commitments/pack/shadow.js +0 -42
@@ -18,18 +18,16 @@ const SESSION_KINDS = ['web', 'daemon', 'cli', 'ci'];
18
18
  * `GET /api/auth/sessions/refresh` has served exactly this list all along; it
19
19
  * was simply not reachable from the CLI.
20
20
  *
21
- * The server returns at most `--limit` rows and says whether it left any out.
22
- * It used to stop at 100 without saying so, and the session somebody went
23
- * looking for — an old daemon's, still holding the login a purge refusal named
24
- * — was exactly the one past the cut (OSK-9980). So a partial list says it is
25
- * partial, and `--kind daemon` is the short way to the row that matters.
21
+ * The server returns at most 500 rows per page; this command follows cursors
22
+ * until its total `--limit` is reached. The default stays at 100. Older servers
23
+ * without cursors can only return their first page, which is disclosed.
26
24
  */
27
25
  class TokenList extends base_command_1.BaseCommand {
28
26
  static description = 'List the active sessions a minted token belongs to — the other half of `token mint`';
29
27
  static examples = [
30
28
  '<%= config.bin %> token list',
31
29
  '<%= config.bin %> token list --kind daemon',
32
- '<%= config.bin %> token list --kind cli --limit 500 --json',
30
+ '<%= config.bin %> token list --kind cli --limit 1000 --json',
33
31
  ];
34
32
  static flags = {
35
33
  kind: core_1.Flags.string({
@@ -37,75 +35,119 @@ class TokenList extends base_command_1.BaseCommand {
37
35
  options: [...SESSION_KINDS],
38
36
  }),
39
37
  limit: core_1.Flags.integer({
40
- description: 'Most sessions to list (server maximum 500)',
38
+ description: 'Most sessions to list (default 100; up to 5000 across pages)',
41
39
  min: 1,
42
- max: 500,
40
+ max: 5000,
43
41
  }),
44
42
  json: core_1.Flags.boolean({ description: 'Output JSON' }),
45
43
  };
46
44
  async run() {
47
45
  this.requireAuth();
48
46
  const { flags } = await this.parse(TokenList);
49
- const query = new URLSearchParams();
50
- if (flags.kind)
51
- query.set('kind', flags.kind);
52
- if (flags.limit)
53
- query.set('limit', String(flags.limit));
54
- const suffix = query.toString() ? `?${query.toString()}` : '';
55
- let data = null;
56
- try {
57
- data = await (0, api_fetch_1.apiFetch)(`/api/auth/sessions/refresh${suffix}`, {
58
- method: 'GET',
59
- credential: this.resolvedCredential,
60
- });
61
- }
62
- catch (err) {
63
- this.handleApiError(err);
47
+ const requestedLimit = flags.limit ?? 100;
48
+ const allSessions = [];
49
+ const seenCursors = new Set();
50
+ let cursor = null;
51
+ let olderServer = false;
52
+ let cannotPage = false;
53
+ let hasMore = false;
54
+ let pageCount = 0;
55
+ while (allSessions.length < requestedLimit) {
56
+ const pageLimit = Math.min(500, requestedLimit - allSessions.length);
57
+ const query = new URLSearchParams({ limit: String(pageLimit) });
58
+ if (flags.kind)
59
+ query.set('kind', flags.kind);
60
+ if (cursor)
61
+ query.set('cursor', cursor);
62
+ let page = null;
63
+ try {
64
+ page = await (0, api_fetch_1.apiFetch)(`/api/auth/sessions/refresh?${query.toString()}`, {
65
+ method: 'GET',
66
+ credential: this.resolvedCredential,
67
+ });
68
+ }
69
+ catch (err) {
70
+ this.handleApiError(err);
71
+ return;
72
+ }
73
+ pageCount += 1;
74
+ const rows = Array.isArray(page?.sessions) ? page.sessions : [];
75
+ allSessions.push(...rows.slice(0, pageLimit));
76
+ // Old servers did not send hasMore and could silently stop at 100.
77
+ olderServer = page?.hasMore === undefined;
78
+ hasMore = olderServer
79
+ ? rows.length >= Math.min(100, pageLimit)
80
+ : page?.hasMore === true || rows.length > pageLimit;
81
+ if (!hasMore || olderServer)
82
+ break;
83
+ const next = page?.nextCursor;
84
+ if (typeof next !== 'string' ||
85
+ !/^[a-fA-F0-9]{24}$/.test(next) ||
86
+ seenCursors.has(next) ||
87
+ rows.length === 0) {
88
+ cannotPage = true;
89
+ break;
90
+ }
91
+ if (allSessions.length >= requestedLimit)
92
+ break;
93
+ if (pageCount >= 20) {
94
+ cannotPage = true;
95
+ break;
96
+ }
97
+ seenCursors.add(next);
98
+ cursor = next;
64
99
  }
65
100
  // Filtered here as well: a server from before `kind` existed ignores the
66
101
  // parameter and returns every kind, and `--kind daemon` must never list a
67
102
  // web session as if it were one.
68
- const sessions = (data?.sessions || []).filter((session) => !flags.kind || session.kind === flags.kind);
69
- // A server from before `hasMore` stopped at 100 and said nothing about it,
70
- // and ignores `--limit` too — so it gets its own, weaker statement.
71
- const olderServer = data?.hasMore === undefined;
72
- const hasMore = olderServer ? (data?.sessions?.length ?? 0) >= 100 : data?.hasMore === true;
103
+ const sessions = allSessions.filter((session) => !flags.kind || session.kind === flags.kind);
73
104
  if (flags.json) {
74
105
  return this.log(JSON.stringify({ sessions, count: sessions.length, hasMore }, null, 2));
75
106
  }
76
- if (!sessions.length)
77
- return this.log('No active sessions.');
78
- (0, format_1.renderTable)(sessions.map((session) => ({
79
- id: session.id,
80
- kind: session.kind,
81
- // The operator's own name for the credential wins over a derived
82
- // device string — it is what they would search by.
83
- device: session.label || session.device || '-',
84
- // What `instructions`, `machines` and a purge refusal call it.
85
- daemon: session.daemonId || '-',
86
- ip: session.ip || '-',
87
- lastActive: session.lastActiveAt || session.createdAt || '-',
88
- // The session you are typing in. Revoking it signs THIS machine out,
89
- // which is the one outcome nobody means when they revoke a credential.
90
- current: session.current ? 'yes' : '',
91
- })), [
92
- { key: 'id', header: 'ID' },
93
- { key: 'kind', header: 'KIND' },
94
- { key: 'device', header: 'DEVICE', maxWidth: 34 },
95
- { key: 'daemon', header: 'DAEMON', maxWidth: 40 },
96
- { key: 'ip', header: 'IP' },
97
- { key: 'lastActive', header: 'LAST ACTIVE' },
98
- { key: 'current', header: 'CURRENT' },
99
- ], (line) => this.log(line));
107
+ if (!sessions.length && !hasMore) {
108
+ return this.log(flags.kind ? 'No matching active sessions.' : 'No active sessions.');
109
+ }
110
+ if (!sessions.length) {
111
+ this.log('No matching sessions in the returned page. More may be available.');
112
+ }
113
+ else {
114
+ (0, format_1.renderTable)(sessions.map((session) => ({
115
+ id: session.id,
116
+ kind: session.kind,
117
+ // The operator's own name for the credential wins over a derived
118
+ // device string — it is what they would search by.
119
+ device: session.label || session.device || '-',
120
+ // What `instructions`, `machines` and a purge refusal call it.
121
+ daemon: session.daemonId || '-',
122
+ ip: session.ip || '-',
123
+ lastActive: session.lastActiveAt || session.createdAt || '-',
124
+ // The session you are typing in. Revoking it signs THIS machine out,
125
+ // which is the one outcome nobody means when they revoke a credential.
126
+ current: session.current ? 'yes' : '',
127
+ })), [
128
+ { key: 'id', header: 'ID' },
129
+ { key: 'kind', header: 'KIND' },
130
+ { key: 'device', header: 'DEVICE', maxWidth: 34 },
131
+ { key: 'daemon', header: 'DAEMON', maxWidth: 40 },
132
+ { key: 'ip', header: 'IP' },
133
+ { key: 'lastActive', header: 'LAST ACTIVE' },
134
+ { key: 'current', header: 'CURRENT' },
135
+ ], (line) => this.log(line));
136
+ }
100
137
  this.log('');
101
138
  if (hasMore && olderServer) {
102
- this.log('This server lists at most 100 sessions and does not say whether it left any out, so older ones may be missing.');
139
+ this.log('This server did not say whether more sessions exist or provide a cursor. The list may be incomplete.');
140
+ }
141
+ else if (hasMore && cannotPage) {
142
+ this.log('This server reported more sessions but did not provide a usable next page. Retry after the server updates, or narrow with --kind.');
103
143
  }
104
144
  else if (hasMore) {
105
- const remedy = flags.kind
106
- ? 'Raise --limit (up to 500) to see them.'
107
- : 'Narrow the list with --kind, or raise --limit (up to 500).';
108
- this.log(`Showing the ${sessions.length} most recently active sessions; older ones were left out. ${remedy}`);
145
+ const remedy = requestedLimit >= 5000
146
+ ? 'Narrow the list with --kind.'
147
+ : flags.kind
148
+ ? 'Raise --limit (up to 5000) to see more.'
149
+ : 'Narrow the list with --kind, or raise --limit (up to 5000).';
150
+ this.log(`Showing ${sessions.length} sessions in creation order; more were left out. ${remedy}`);
109
151
  }
110
152
  this.log('Retire one with: skrr token revoke <id>');
111
153
  }
@@ -0,0 +1,14 @@
1
+ import { Command } from '@oclif/core';
2
+ export default class Update extends Command {
3
+ static summary: string;
4
+ static description: string;
5
+ static examples: string[];
6
+ static flags: {
7
+ check: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
8
+ status: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
9
+ component: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
10
+ json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
11
+ restart: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
12
+ };
13
+ run(): Promise<void>;
14
+ }
@@ -0,0 +1,61 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const core_1 = require("@oclif/core");
4
+ const config_1 = require("../lib/config");
5
+ const cli_runtime_1 = require("../lib/cli-runtime");
6
+ const platform_update_1 = require("../lib/platform-update");
7
+ const platform_update_local_1 = require("../lib/platform-update-local");
8
+ class Update extends core_1.Command {
9
+ static summary = 'Check or update the CLI, Code engine and daemon on this computer';
10
+ static description = 'Uses each component’s existing installer and signed update policy. No cloud login is required. ' +
11
+ 'Updates installed components; use `skrr code install` or `skrr daemon install` to add missing components. ' +
12
+ 'Code updates apply to new sessions. npm CLI updates wait for active commands to finish. ' +
13
+ 'App, image and source installations show the command for their owner.';
14
+ static examples = [
15
+ '<%= config.bin %> update --check',
16
+ '<%= config.bin %> update --status --json',
17
+ '<%= config.bin %> update',
18
+ '<%= config.bin %> update --component code',
19
+ '<%= config.bin %> update --component daemon --restart',
20
+ ];
21
+ static flags = {
22
+ check: core_1.Flags.boolean({
23
+ description: 'Check offered versions without downloading or installing binaries',
24
+ exclusive: ['status'],
25
+ }),
26
+ status: core_1.Flags.boolean({
27
+ description: 'Show installed versions and recorded update results without network requests',
28
+ exclusive: ['check'],
29
+ }),
30
+ component: core_1.Flags.string({
31
+ options: ['all', 'cli', 'code', 'daemon'],
32
+ default: 'all',
33
+ description: 'Which installed component to inspect or update',
34
+ }),
35
+ json: core_1.Flags.boolean({ description: 'Emit one structured result for every selected component' }),
36
+ restart: core_1.Flags.boolean({
37
+ description: 'Request daemon restart after applying its update',
38
+ exclusive: ['check', 'status'],
39
+ }),
40
+ };
41
+ async run() {
42
+ const { flags } = await this.parse(Update);
43
+ if (flags.restart && !['all', 'daemon'].includes(flags.component)) {
44
+ this.error('--restart applies to the daemon; select --component daemon or all.');
45
+ }
46
+ const result = await (0, platform_update_1.runPlatformUpdate)({
47
+ mode: flags.check ? 'check' : flags.status ? 'status' : 'apply',
48
+ component: flags.component,
49
+ currentVersion: (0, cli_runtime_1.getCliVersion)(this.config.root),
50
+ baseURL: (0, config_1.loadConfig)().baseURL,
51
+ restart: flags.restart,
52
+ }, platform_update_local_1.localPlatformUpdateDependencies);
53
+ if (flags.json)
54
+ this.log(JSON.stringify(result, null, 2));
55
+ else
56
+ this.log(result.components.map(platform_update_1.describeComponentUpdate).join('\n\n'));
57
+ if (!result.ok)
58
+ this.exit(1);
59
+ }
60
+ }
61
+ exports.default = Update;
@@ -0,0 +1,9 @@
1
+ {
2
+ "oversky-task-management": {
3
+ "key": "oversky-task-management",
4
+ "name": "skrr Task Management",
5
+ "templateVersion": 20,
6
+ "body": "## OverSky Task Management\n\nUse `skrr` as the durable record for work that must outlive this conversation.\n\n### One concept, one record\n\n- **Task** says what is owed and where it stands.\n- **Expectation** says what must be true before the Task can close.\n- **Update** says what meaningfully changed during execution.\n- **Resume Point** says where one Run can safely continue after interruption.\n- **Result** says what the work concluded or returned.\n- **Deliverable** identifies a concrete Resource version produced by the work.\n- **Review** says whether another actor accepted one exact Result.\n- **Comment** is replyable collaboration.\n- **Activity** is the immutable audit projection. A Run transcript is detailed telemetry, not Activity.\n\nDo not put a Result in a Comment, use an Update as a transcript, or use review words such as\n“approved” for a domain conclusion such as NO-SHIP.\n\nThe platform derives Human, Agent, Run, session, and recording provenance from the authenticated\nruntime. Never supply or invent an Agent identity. An Update has one author; a multi-Agent summary\nmay cite contributors and their source Runs or Updates.\n\n### During execution: write Updates at meaningful boundaries\n\nDo not log routine reads, tool calls, heartbeats, token counts, or repeated “still working” narration.\nRecord an Update only when a future reader or replacement Run needs to know that shared state changed:\n\nEach type has a REQUIRED `--data` shape, and the array fields are required even when empty.\nOptional fields are marked `?`. The server rejects a missing required field, so guessing from the\nprose costs a round trip:\n\n- `progress`: a material part is complete.\n `{completedSinceLast: string[], nextActions: string[], currentFocus?}`\n- `finding`: a newly discovered fact. `impact` is optional; the evidence references are not.\n `{finding, evidenceRefs: [], impact?, severity?}`\n- `decision`: a choice now constrains the work.\n `{decision, rationale, alternativesConsidered?: string[]}`\n- `blocker`: work cannot continue. `nextOwner` is a principal OBJECT, not a name.\n `{cause, requiredAction, nextOwner: {kind: \"human\", userId}}`\n- `verification`: a claim was checked. `result` is one of `passed`, `failed`, `inconclusive`.\n `{claim, result, evidenceRefs: []}`\n- `ready_for_review`: created by Result submission; do not author it separately.\n\n`--reference <kind>:<id>` sets the Update's OWN references. It does not populate\n`data.evidenceRefs`, which belongs inside `--data`.\n\nUse one stable idempotency key only for retries of the identical write. Reusing it for different\ncontent is rejected.\n\nExample:\n\n```bash\nskrr tasks updates add <task-id> \\\n --type progress \\\n --summary \"Migration review complete\" \\\n --data '{\"completedSinceLast\":[\"Checked migrations 001-014\"],\"currentFocus\":\"Authorization review\",\"nextActions\":[\"Inspect legacy adapters\"]}' \\\n --idempotency-key \"<task-id>:migration-review\"\n```\n\nFor a decision:\n\n```bash\nskrr tasks updates add <task-id> \\\n --type decision \\\n --summary \"Use a first-class Resource identity\" \\\n --data '{\"decision\":\"Use WorkResource plus immutable versions\",\"rationale\":\"A URL can move and cannot identify the version a reviewer accepted\"}' \\\n --idempotency-key \"<task-id>:resource-model\"\n```\n\nFor a finding — `evidenceRefs` is required and may be empty:\n\n```bash\nskrr tasks updates add <task-id> \\\n --type finding \\\n --summary \"The closure gate reads assessments by exact specVersion\" \\\n --data '{\"finding\":\"A cosmetic title edit bumps specVersion, so every prior assessment stops counting\",\"impact\":\"A task with expectations cannot be closed after a rename\",\"evidenceRefs\":[{\"kind\":\"code\",\"uri\":\"api/server/services/TaskClosurePolicy/index.js\"}]}' \\\n --idempotency-key \"<task-id>:spec-bump-revocation\"\n```\n\nFor a blocker — `nextOwner` is a principal object:\n\n```bash\nskrr tasks updates add <task-id> \\\n --type blocker \\\n --summary \"Waiting on production database credentials\" \\\n --data '{\"cause\":\"The migration needs write access to the prod cluster\",\"requiredAction\":\"Grant the deploy role write access, or run the migration yourself\",\"nextOwner\":{\"kind\":\"human\",\"userId\":\"<user-id>\"}}' \\\n --idempotency-key \"<task-id>:needs-prod-credentials\"\n```\n\nFor a verification:\n\n```bash\nskrr tasks updates add <task-id> \\\n --type verification \\\n --summary \"Re-ran the closure flow end to end after the fix\" \\\n --data '{\"claim\":\"A renamed task with one assessed expectation can close\",\"result\":\"passed\",\"evidenceRefs\":[{\"kind\":\"task\",\"id\":\"<task-id>\"}]}' \\\n --idempotency-key \"<task-id>:closure-reverify\"\n```\n\n### Media: screenshots and recordings\n\n`--attach <path>` (repeatable) on `updates add`, `result submit`, `complete`, or `comments add`\nuploads a file as a Task asset and cites it; identical bytes dedupe. In-run proof goes on a\n`verification` or `progress` Update, the final before/after on the Result, never the description.\nAn upload is `self_reported` evidence and counts toward the storage quota. Images keep full\nresolution minus metadata (Runs get a model-sized copy); undecodable bytes get 422, a type the bytes\ncontradict 415, and SVG downloads as a file. An agent uploads evidence (the default) or\n`--role deliverable`; `input` is refused (403): ask a person to run `attachments set-role`. Cite a\ndeliverable as `--evidence task_attachment:<asset-id>` when you assess its Expectation.\n\n### Recovery: Update delta and Resume Point snapshot\n\nWhen a semantic boundary should also be resumable, add `--run-id` and `--resume` to the same Update\ncommand. The server commits the visible Update and the Run-bound Resume Point together. The snapshot\nmust be self-contained enough for another capable Agent to continue without replaying the transcript:\ncompleted work, current focus, next actions, open questions, and references to decisions, evidence,\nDeliverables, and durable workspace state.\n\nThe runtime may save a silent crash-safety snapshot with:\n\n```bash\nskrr tasks resume save <task-id> --run-id <run-id> --snapshot '<resume-json>'\n```\n\nNever put credentials, secrets, permission grants, bearer tokens, or leases in a Resume Point. A\nresumed Run reloads the current Task Revision, re-authorizes, validates referenced files/commits, and\nreads Updates recorded after the snapshot:\n\n```bash\nskrr tasks resume show <task-id> --run-id <run-id>\n```\n\n### Deliverables: lightweight input, first-class identity\n\nA user may provide one coordinate, but the platform records a WorkResource, its exact version, the\nTask relationship, and an evidence-backed availability observation. External reference is the\ndefault; OverSky-managed content is used only when retention, stable access, preview/search, or\npolicy requires a copy.\n\n```bash\nskrr tasks deliverable add <task-id> \\\n file/markdown:docs/reviews/report.md@docs/reviews/report.md \\\n --status in_review\n```\n\nA recording made by its producer is always self-reported; the caller cannot promote itself to a\nHuman confirmation, system observation, or provider receipt. A local path is only local availability. A commit, provider revision, digest, or managed object\nfreezes the exact version. Do not call “in the conversation” a Deliverable.\n\nA Human confirms the exact linked version, not a retyped URL or name:\n\n```bash\nskrr tasks deliverable confirm <task-id> <task-resource-link-id> --reason \"Opened and checked this exact version\"\n```\n\n### Result and Review are separate\n\nSubmit the finished answer once:\n\n```bash\nskrr tasks result submit <task-id> \\\n --summary \"NO-SHIP until remediation Gates A-D pass\" \\\n --conclusion-type release_recommendation \\\n --conclusion-json '{\"posture\":\"no_ship\"}' \\\n --deliverable <task-resource-link-id>\n```\n\nAn amendment creates a new Result version and explicitly supersedes the previous one. There is one\ncurrent Result; old versions remain in Activity and are not ordinary Updates.\n\nOnly another actor records acceptance, against that exact Result:\n\n```bash\nskrr tasks review <task-id> --result-id <result-id> --decision accepted --rationale \"Evidence checked\"\n```\n\n“Accepted” means the submitted work was accepted. NO-SHIP, BUY, REJECT, root cause, experiment\ndecision, and similar subject-matter conclusions belong in `Result.conclusion`, never in Review.\n\nUse `skrr tasks complete` only when submitting the Result and advancing workflow in one closeout.\nDo not call `tasks report` before or after it; `tasks complete` already creates the canonical Result.\n\nSubmitting a Result is not the same as closing the Task, and being an Agent is not by itself a\nreason to stop. Closing is always the closer's call — unmet Expectations or a Changes-requested\nReview do not prevent it; they are RECORDED on the close (`resolution.closure`), so closing over\nthem hides nothing and settles nothing. The one exception is an owner-declared required Review\n(`--review-policy required`): a non-owner cannot close without it — unless they close with\n`--force`, which records the override on the resolution — and the owner always can.\n\nSo do not predict the outcome. `result submit` reports where the Task stands after the write —\nread that, and if you need to ask again later:\n\n```bash\nskrr tasks expectations <task-id> # what is owed, and why the Result cannot be accepted yet\n```\n\nSay “ready for review” only when something you read actually said so.\n\n### Expectations\n\nExpectations are free text first. A typed check explains how the statement can be assessed; it never\nreplaces the sentence.\n\nAn Expectation is an obligation, not a lock: it does not stop a close, it is recorded on one — and\nclosing over it settles nothing. Write each one so it can\nbe judged — say what would satisfy it and how that could be checked — because an Expectation authored\nwithout a thought about verification is one you will later be unable to settle honestly. When you\ncreate several across several Tasks, say how many you created and who they fall to; a set of gates\nnobody was told about is work assigned by accident. A Deliverable requirement is one typed Expectation, not a second\n`requiredDeliverables` list. Actual Deliverables are recorded only after something exists.\n\nRead what is owed, then settle it — never rewrite the declaration to make it settleable:\n\n```bash\nskrr tasks expectations <task-id> # what is owed, and how far each one got\nskrr tasks expectations assess <task-id> <expectation-id> \\\n --decision met \\\n --reason \"Ran the suite named in the statement; 49/49 pass\" \\\n --evidence code:<commit>\nskrr tasks expectations assess <task-id> --all \\\n --decision met --reason \"...\" # every one still awaiting a judgement\n```\n\n**You may assess any Expectation that takes a judgement.** A `deliverable` Expectation is not one —\nit settles through its linked Resource and evidence, so record the Deliverable rather than\nassessing it. The assessment is recorded as YOURS — every surface shows `met (agent)` against\n`met (person)` — and a human can override it. The control is attribution, not permission, so what\nyou owe is not restraint but evidence: cite what you actually checked, and prefer `--evidence` and\n`--resource-link-id` over prose.\n\nAssess what you VERIFIED. Not what you intended, not what you inferred from having finished the\nwork. “I could not check this” is a real and useful answer — record it `unmet` with the reason\nrather than leaving it silent, because an unassessed Expectation and one you tried and failed to\nverify send the next reader to different places.\n\nA waiver is a judgement about scope — that this is no longer owed — and it stays a person's call:\nif the honest answer is \"this should be waived,\" say so in an Update or Comment and let a person\nrecord it. Do not delete the Expectation to hide that it was owed.\n\nChanging an Expectation's wording advances the Task specification and **revokes every assessment\nalready recorded** — fix the statement before people start settling it, not after.\n\n### Labels — say what PROGRAM this belongs to\n\nA label is cross-cutting classification: which recurring program a Space or Task\nbelongs to (`dogfood`, `incident`, `experiment`, `migration`), not what state it\nis in. Status, priority and assignee are first-class fields and already answer\ntheir own questions — a label that restates one is noise that will drift out of\nsync with the field it copies.\n\nThe vocabulary is DECLARED, not invented. Read it before you use it:\n\n```bash\nskrr labels list\n```\n\nAttach from that list, never a name you made up. A second spelling of an\nexisting label (`dog-food` beside `dogfood`) is worse than no label at all,\nbecause the whole value of one is that filtering on it returns everything:\n\n```bash\nskrr spaces labels add <space-id> --label <label-id>\nskrr tasks labels attach <task-id> --label <label-id>\n```\n\nCreate a label only when the program it names is real and recurring, and say\nwhich entities it applies to — a label created without `--applicable-to space`\ncannot be attached to a Space, which is how a vocabulary comes to exist that\nnothing can use:\n\n```bash\nskrr labels create --name <name> --applicable-to space --applicable-to task\n```\n\nWhen you create a Space or Task for a recurring program, label it as you create\nit (`--label <id>` on `spaces`, `tasks` and `goals create`). The create\nresponse carries a `_labelGuidance` hint naming the applicable vocabulary WITH\nITS IDS when you attached none — read it, and attach in one follow-up call if\none of them fits. It may also carry `suggested` — a proposal, not a decision;\nattach is your call. `skrr tasks labels suggest <task-id>` asks it of a Task.\n\nIf nothing in the vocabulary fits, attach nothing. \"No label\" is a correct\nanswer and a wrong label is not.\n\n### Comments and blockers\n\nUse a Comment only for a question, answer, or review discussion where a reply is useful. For a\nblocker, first record the typed blocker Update, then move the Task to blocked. Add a Comment only if\nsomeone actually needs to respond.\n\n### Creating and placing Tasks\n\nCreate a Task without asking when work needs tracking across meaningful steps, sessions, or\nfollow-up. Avoid duplicates and do not create Tasks for trivial actions that finish immediately.\n\n```bash\nskrr tasks list --q \"<relevant title>\"\nskrr tasks create --title \"<concise requested result>\" --description \"<scope and constraints>\" --json\nskrr tasks move <task-id> --status in_progress\n```\n\nA Space is a durable ownership, collaboration, and authorization boundary. Use an identified Space\nwhen the work clearly belongs there; otherwise create the Task unscoped. Ask before creating a new\nSpace. An Agent works a Task in a Space only as a Space member, or when it is shared with no one\nelse and its owner assigns and starts it; anything else is refused. Do not widen Agent membership\nmerely to force one task assignment.\n\n### Closing a Task out\n\nThe model above says what each record IS. This is the order they go in, and what each step can\nrefuse:\n\n1. **Record what exists** — `skrr tasks deliverable add`, binding it to the Expectation it answers\n with `--expectation <id>` whenever one applies. Evidence that arrives bound is evidence the next\n reader does not have to reconstruct.\n2. **Submit the answer** — `skrr tasks result submit`. This does not close the Task. Read what it\n reports back.\n3. **Read what is still owed** — `skrr tasks expectations <task-id>`.\n4. **Settle what you verified** — `skrr tasks expectations assess`, citing evidence. `--all` covers\n every Expectation still awaiting a judgement.\n5. **Read the Task state again and report THAT** — not what you intended it to be.\n\nTwo things still matter regardless of how complete the work is: an unmet Expectation, and a\n`changes_requested` Review. Neither blocks a close — but both are stamped onto it\n(`resolution.closure`), so closing over them is a recorded choice, not a clean finish. Neither is\na failure state; both are somebody's turn.\n\nStep 5 is the one that goes wrong quietly, and not only here: before reporting a check as passed,\nconfirm you measured what you think you measured. A pipeline's exit status is the LAST command's, so\n`cmd | tail` reports on `tail`. A filter may match something other than what you meant — a path\npattern can match the directory you are working in. When a result will be reported to a person as\nfact, re-run it in the simplest form that can only mean one thing.\n\nAcross a whole Space, `skrr tasks review-queue --space <space-id>` names every outstanding\njudgement at once, with its evidence and the command that settles it.\n\n### Share readable links and close the loop\n\nShare clickable Task, Space, Goal, and Commitment URLs, never bare IDs. Use the URL returned by the\nCLI; do not construct one. If needed:\n\n```bash\nskrr tasks show <task-id> --json\nskrr spaces show <space-id> --json\nskrr goals show <goal-id> --json\nskrr commitments show <commitment-id> --json\n```\n\nBefore your final response, verify every Task you created or touched reflects reality. If work is\nready for independent review, leave it in review. If blocked, record the blocker and required action.\nIf genuinely complete and accepted under the Task's policy, close it. Include the Task URL in the\nfinal handoff. Never claim a write succeeded unless the CLI returned success.\n\n### Coming back later\n\nYou can arrange to return to something. Four shapes, and picking the right one\nmatters more than the wording:\n\n**Reminder** — the user asked to be reminded. Keep their words; a reminder you\nhave rephrased into your own voice is no longer the thing they asked for.\n\n**Watch** — something has an asynchronous tail: CI, a review, an approval, a\nlong job, a metric. If the condition is machine-checkable (an endpoint plus a\npredicate), say so — that costs nothing and is guaranteed to terminate. Only\nwrite a prose check recipe when the check genuinely needs your judgement or your\ntools, because that one burns a full turn every time it runs. Always give it an\nabort condition: a watch that cannot stop is a leak.\n\n**Check-in** — you decided the conversation is worth returning to. This is\npermission AND restraint. Come back when you will have something worth saying —\na result that will have arrived, a decision that will be ripe, a thread you left\ngenuinely open. When you see one, arrange the return yourself and say in one\nline when you will look again. Do not ask whether you should: that hands the\nperson a decision they did not come to make. Do not come back to ask how it is\ngoing. One conversation holds at most one pending check-in, and when you wake,\nsaying nothing is a legitimate outcome and often the right one.\n\n**Act** — a specific action you already know how to take and the user has already\nagreed to. Not for anything you would still need to ask about.\n\nSettle what you arranged. When you wake and the thing resolved, say so and close\nit out; when it did not, either come back once more with a reason or hand it to\nthe person. Leaving one armed forever is the failure mode here.\n\nFrom a local session, arrange these with `skrr followups` —\n`remind`, `watch`, `checkin`, `act` — and settle them with\n`skrr followups resolve <id> --outcome resolved`.\n\n## OverSky Identity\n\n{{OVERSKY_AGENT_IDENTITY}}\n",
7
+ "hash": "516df90a15e3ced2bcdb9976aec9f9b433478f2886df7cc04276d6ad44ffcde2"
8
+ }
9
+ }
@@ -0,0 +1,5 @@
1
+ import { Hook } from '@oclif/core';
2
+ /** All commands pass through this hook, including the local code/daemon
3
+ * commands that intentionally do not use authenticated BaseCommand. */
4
+ declare const hook: Hook<'init'>;
5
+ export default hook;
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const config_1 = require("../lib/config");
4
+ const update_check_1 = require("../lib/update-check");
5
+ /** All commands pass through this hook, including the local code/daemon
6
+ * commands that intentionally do not use authenticated BaseCommand. */
7
+ const hook = async function (options) {
8
+ const argv = [
9
+ ...(options.id ?? '').split(':').filter(Boolean),
10
+ ...(options.argv ?? process.argv.slice(2)),
11
+ ];
12
+ if (!(0, update_check_1.shouldCheckCliUpdateAtStartup)(argv, !!process.stderr.isTTY && !!process.stdin.isTTY))
13
+ return;
14
+ try {
15
+ const baseFlag = argv.findIndex((arg) => arg === '--base-url');
16
+ const suppliedBase = argv.find((arg) => arg.startsWith('--base-url='))?.slice('--base-url='.length) ??
17
+ (baseFlag >= 0 ? argv[baseFlag + 1] : undefined);
18
+ await (0, update_check_1.maybeWarnOutdatedCli)({
19
+ currentVersion: this.config.version,
20
+ baseURL: suppliedBase || (0, config_1.loadConfig)().baseURL,
21
+ });
22
+ }
23
+ catch {
24
+ /* update discovery must not prevent command startup */
25
+ }
26
+ };
27
+ exports.default = hook;
@@ -1,16 +1,10 @@
1
1
  import type { CommitmentDeliveryIntent, CommitmentExecutionReceipt, CommitmentExecutionReceiptQuarterlyMetricsResponse } from '@skrr-ai/data-provider';
2
- export declare const COMMITMENT_PRODUCT_MODES: readonly ["monitor", "prepare", "execute"];
3
2
  export declare const COMMITMENT_DELIVERY_CHOICES: readonly ["report-only", "local-patch", "draft-pr", "push-branch", "direct-branch"];
4
- /** Compatibility is accepted at the input boundary; everyday output uses the product contract. */
5
- export declare function productMode(value?: string): 'monitor' | 'prepare' | 'execute';
6
- export declare function productModeLabel(value?: string): string;
7
3
  export declare function deliveryLabel(mode?: string): string;
8
4
  export declare function deliveryInput(mode: string, options?: {
9
5
  repo?: string;
10
6
  base?: string;
11
7
  }): CommitmentDeliveryIntent;
12
- /** Monitor is observation-only; retain report expectations, never repo coordinates. */
13
- export declare function deliveryForProductMode(mode: string | undefined, delivery?: CommitmentDeliveryIntent): CommitmentDeliveryIntent | undefined;
14
8
  export declare function renderExecutionReceipt(receipt: CommitmentExecutionReceipt, log: (line: string) => void, verbose?: boolean): void;
15
9
  /**
16
10
  * `skrr commitments receipt-metrics <id>` — the closed-quarter rollup.
@@ -1,14 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.COMMITMENT_DELIVERY_CHOICES = exports.COMMITMENT_PRODUCT_MODES = void 0;
4
- exports.productMode = productMode;
5
- exports.productModeLabel = productModeLabel;
3
+ exports.COMMITMENT_DELIVERY_CHOICES = void 0;
6
4
  exports.deliveryLabel = deliveryLabel;
7
5
  exports.deliveryInput = deliveryInput;
8
- exports.deliveryForProductMode = deliveryForProductMode;
9
6
  exports.renderExecutionReceipt = renderExecutionReceipt;
10
7
  exports.renderExecutionReceiptQuarterlyMetrics = renderExecutionReceiptQuarterlyMetrics;
11
- exports.COMMITMENT_PRODUCT_MODES = ['monitor', 'prepare', 'execute'];
12
8
  exports.COMMITMENT_DELIVERY_CHOICES = [
13
9
  'report-only',
14
10
  'local-patch',
@@ -16,20 +12,6 @@ exports.COMMITMENT_DELIVERY_CHOICES = [
16
12
  'push-branch',
17
13
  'direct-branch',
18
14
  ];
19
- /** Compatibility is accepted at the input boundary; everyday output uses the product contract. */
20
- function productMode(value) {
21
- if (value === 'prepare' || value === 'ask_first')
22
- return 'prepare';
23
- if (['execute', 'auto_run', 'auto_run_limited'].includes(value || ''))
24
- return 'execute';
25
- return 'monitor';
26
- }
27
- function productModeLabel(value) {
28
- if (value === 'off')
29
- return 'Not running';
30
- const mode = productMode(value);
31
- return mode[0].toUpperCase() + mode.slice(1);
32
- }
33
15
  function deliveryLabel(mode) {
34
16
  return ({
35
17
  report_only: 'Report only',
@@ -51,19 +33,8 @@ function deliveryInput(mode, options = {}) {
51
33
  ...(options.base ? { baseBranch: options.base } : {}),
52
34
  };
53
35
  }
54
- /** Monitor is observation-only; retain report expectations, never repo coordinates. */
55
- function deliveryForProductMode(mode, delivery) {
56
- if (productMode(mode) !== 'monitor')
57
- return delivery;
58
- return {
59
- version: 1,
60
- mode: 'report_only',
61
- ...(delivery?.expectations ? { expectations: delivery.expectations } : {}),
62
- };
63
- }
64
36
  function renderExecutionReceipt(receipt, log, verbose = false) {
65
37
  log(receipt.summary);
66
- log(`Mode: ${productModeLabel(receipt.mode)}`);
67
38
  if (receipt.runtime) {
68
39
  const identity = receipt.runtime.name || receipt.runtime.id || 'the selected runtime';
69
40
  log(`Runtime: ${identity}${receipt.runtime.kind ? ` · ${receipt.runtime.kind}` : ''}${receipt.runtime.provider ? ` · ${receipt.runtime.provider}` : ''}`);
@@ -16,7 +16,7 @@
16
16
  * Two `kind`s: `achieve` (bounded, deadline-bearing) and `maintain` (perpetual
17
17
  * "hold this state", derived from a Compass invariant — not authored here).
18
18
  */
19
- import { COMMITMENT_WATCHED_SOURCES, COMMITMENT_TEMPLATE_IDS, COMMITMENT_CADENCE_MODES, COMMITMENT_CADENCE_TIME_PATTERN, COMMITMENT_CADENCE_MAX_TIMES, COMMITMENT_AUTONOMY_MODES, COMMITMENT_EXECUTION_ISOLATION_MODES, COMMITMENT_STATUSES, COMMITMENT_KIND_VALUES } from '@skrr-ai/data-provider';
19
+ import { COMMITMENT_WATCHED_SOURCES, COMMITMENT_TEMPLATE_IDS, COMMITMENT_CADENCE_MODES, COMMITMENT_CADENCE_TIME_PATTERN, COMMITMENT_CADENCE_MAX_TIMES, COMMITMENT_EXECUTION_ISOLATION_MODES, COMMITMENT_STATUSES, COMMITMENT_KIND_VALUES } from '@skrr-ai/data-provider';
20
20
  import type { CommitmentCheck, CommitmentChecksResponse, Commitment, CommitmentActionProposal, CommitmentListResponse, CommitmentPlanResponse, CommitmentStatusResponse, CommitmentWorkLink, CommitmentExecutionReceiptListResponse, CommitmentExecutionReceiptQuarterlyMetricsResponse, CommitmentCapabilitySource, CommitmentDeliveryPatchResponse, CommitmentDeliveryBundleResponse, CommitmentCyclesResponse, CommitmentExplanationResponse, CommitmentRunPermissions } from '@skrr-ai/data-provider';
21
21
  import { withQuery } from './triggers';
22
22
  export { COMMITMENT_WATCHED_SOURCES, COMMITMENT_TEMPLATE_IDS, COMMITMENT_CADENCE_MODES, COMMITMENT_CADENCE_TIME_PATTERN, COMMITMENT_CADENCE_MAX_TIMES, COMMITMENT_STATUSES, COMMITMENT_KIND_VALUES, };
@@ -24,19 +24,6 @@ export type { CommitmentCheck, CommitmentChecksResponse, Commitment, CommitmentA
24
24
  /** Derived from the installed compatibility vocabulary so the CLI remains
25
25
  * safe even while data-provider and CLI packages roll out separately. */
26
26
  export declare const COMMITMENT_AUTHORABLE_CADENCE_MODES: ("manual" | "daily" | "interval" | "event_plus_interval")[];
27
- /**
28
- * Autonomy ladder — how much the commitment may act without asking.
29
- *
30
- * Re-exported, not restated: `@skrr-ai/data-provider` owns the vocabulary, and
31
- * a second literal here is how the CLI would silently drift from the server
32
- * that rejects its values.
33
- */
34
- export { COMMITMENT_AUTONOMY_MODES };
35
- export declare const COMMITMENT_AUTHORABLE_AUTONOMY_MODES: readonly ["monitor", "prepare", "execute"];
36
- export type CommitmentAuthorableAutonomyMode = (typeof COMMITMENT_AUTHORABLE_AUTONOMY_MODES)[number];
37
- export declare function storedAutonomyModeForAuthoring(mode: CommitmentAuthorableAutonomyMode | string): 'suggestions_only' | 'ask_first' | 'auto_run';
38
- export declare function authoringAutonomyModeForStored(mode?: string | null): CommitmentAuthorableAutonomyMode;
39
- export declare function commitmentAutonomyLabel(mode?: string | null): string;
40
27
  /**
41
28
  * Where a Commitment's autonomous runs do their work. Re-exported for the same
42
29
  * reason as the ladder above: the vocabulary is the server's, and a picker that
@@ -212,8 +199,7 @@ export declare const commitmentPackApi: {
212
199
  plan: (body: Record<string, unknown>) => Promise<CommitmentPackPlanResponse>;
213
200
  bind: (body: Record<string, unknown>) => Promise<CommitmentPackBindResponse>;
214
201
  preflight: (id: string, nextRunCount?: number) => Promise<CommitmentPackPreflightResponse>;
215
- shadow: (id: string) => Promise<CommitmentPackLifecycleResponse>;
216
- promote: (id: string) => Promise<CommitmentPackLifecycleResponse>;
202
+ activate: (id: string) => Promise<CommitmentPackLifecycleResponse>;
217
203
  };
218
204
  export declare const commitmentApi: {
219
205
  /**
@@ -320,8 +306,6 @@ export declare const commitmentApi: {
320
306
  pause: (id: string) => Promise<Commitment>;
321
307
  resume: (id: string) => Promise<Commitment>;
322
308
  complete: (id: string) => Promise<Commitment>;
323
- autonomy: (id: string, body: Record<string, unknown>) => Promise<Commitment>;
324
- mode: (id: string, body: Record<string, unknown>) => Promise<Commitment>;
325
309
  delivery: (id: string, body: Record<string, unknown>) => Promise<Commitment>;
326
310
  receipts: (id: string, query?: {
327
311
  limit?: number;
@@ -445,6 +429,11 @@ export declare const commitmentApi: {
445
429
  status?: string;
446
430
  cursor?: string;
447
431
  }) => Promise<CommitmentListPage>;
432
+ evaluations: (id: string, query?: {
433
+ limit?: number;
434
+ }) => Promise<CommitmentListPage>;
435
+ createEvaluation: (id: string, body: Record<string, unknown>) => Promise<Record<string, unknown>>;
436
+ retryEvaluationLearning: (id: string, scheduleId: string) => Promise<Record<string, unknown>>;
448
437
  observations: (id: string, query?: {
449
438
  limit?: number;
450
439
  declaredOnly?: boolean;
@@ -457,7 +446,7 @@ export declare const commitmentApi: {
457
446
  /** Bounded, named corrections — never a free-form contract edit. */
458
447
  remediate: (id: string, body: Record<string, unknown>) => Promise<Record<string, unknown>>;
459
448
  /** Approve/reject an Agent-proposed cadence change the server parked. */
460
- decideAutonomyRequest: (id: string, requestId: string, approved: boolean) => Promise<Record<string, unknown>>;
449
+ decideCadenceRequest: (id: string, requestId: string, approved: boolean) => Promise<Record<string, unknown>>;
461
450
  linkGoal: (id: string, goalId: string) => Promise<Record<string, unknown>>;
462
451
  unlinkGoal: (id: string, goalId: string) => Promise<Record<string, unknown>>;
463
452
  };
@@ -550,9 +539,6 @@ export interface CommitmentCostWindow {
550
539
  }
551
540
  /** Shape of `GET /:id/wake-capabilities`. */
552
541
  export interface CommitmentWakeCapabilities {
553
- workPromotionModel?: 'monitor_prepare_execute_v1';
554
- mode: string;
555
- selectedCapabilityIds?: string[];
556
542
  eligibleCapabilities: Array<{
557
543
  id: string;
558
544
  kind?: string;
@@ -571,7 +557,7 @@ export declare const COMMITMENT_FEEDBACK_KINDS: readonly ["useful", "noisy", "wr
571
557
  * the "this commitment is misbehaving, calm it down" lever, and a free-form
572
558
  * contract edit would defeat the point of having one.
573
559
  */
574
- export declare const COMMITMENT_REMEDIATION_ACTIONS: readonly ["pause_commitment", "mute_user_nudges", "reduce_nudge_frequency", "tighten_policy", "mark_noop"];
560
+ export declare const COMMITMENT_REMEDIATION_ACTIONS: readonly ["pause_commitment", "mute_user_nudges", "reduce_nudge_frequency", "mark_noop"];
575
561
  /** The only keys `createBodySchema` (a `z.strictObject`) accepts. */
576
562
  export declare const COMMITMENT_CREATE_KEYS: readonly ["mode", "agentId", "kind", "compassId", "compassOrigin", "goalId", "title", "description", "agentDirective", "status", "target", "watchedSources", "policy", "delivery", "cadence", "subject", "sensors", "grants", "reports", "createdVia"];
577
563
  /**
@@ -646,14 +632,6 @@ export type EvidenceHealthView = {
646
632
  * is noise in a summary someone reads to find what is wrong.
647
633
  */
648
634
  export declare function describeEvidenceHealth(health?: EvidenceHealthView | null, criteriaCount?: number): string | undefined;
649
- /**
650
- * `stalled` is a verdict, not a reason. Printed bare it reads like `unknown`
651
- * with a harsher word, and the operator's next move is to go and read run
652
- * history to find what the reconciler had already decided. Returns undefined
653
- * for every other health value, including `unknown` — "nobody has judged" has
654
- * no diagnosis to name.
655
- */
656
- export declare function describeStalledHealth(commitment: CommitmentView): string | undefined;
657
635
  /** Render an interval back as a compact human string. */
658
636
  export declare function describeIntervalMs(ms: number | undefined): string;
659
637
  /**
@@ -690,23 +668,6 @@ export declare function buildSuccessCriteria(labels: string[], opts?: {
690
668
  }): SuccessCriterionInput[];
691
669
  export declare function cadenceLabel(commitment: CommitmentView): string;
692
670
  export declare function renderCommitmentList(commitments: CommitmentView[], log: (line: string) => void): void;
693
- /**
694
- * The autonomy mode a check ACTUALLY ran at, read from its policy trace
695
- * (OSK-4881).
696
- *
697
- * A check records the Mode it actually used in `decision.policyTrace`. For the
698
- * v2 product contract, only an explicit Workspace-admin constraint may lower
699
- * the declared Mode; legacy checks may still carry older effective-mode traces.
700
- * Either `autonomyMode` or `effectiveAutonomyMode` answers what governed that
701
- * particular run. Returns undefined when the trace carries neither.
702
- *
703
- * Exported for tests.
704
- */
705
- export declare function effectiveAutonomyMode(check?: {
706
- decision?: {
707
- policyTrace?: Array<Record<string, unknown>>;
708
- } | null;
709
- } | null): string | undefined;
710
671
  /**
711
672
  * A `commitment_standstill` policyTrace entry, extracted from the latest
712
673
  * check's decision. The arbiter appends it whenever a quiet posture is the
@@ -737,11 +698,6 @@ export declare function extractStandstillFromCheck(check?: {
737
698
  *
738
699
  * Exported for tests.
739
700
  */
740
- export declare function describeAutonomyLine(commitment: CommitmentView, latestCheck?: {
741
- decision?: {
742
- policyTrace?: Array<Record<string, unknown>>;
743
- } | null;
744
- } | null): string;
745
701
  /**
746
702
  * One-line rendering of `commitment.executorBlocked` — the B4/A7 signal that
747
703
  * the executor's targets are all unusable: `{reason:'quota'|'offline'|'waiting_for_machine', until?,