@skrr-ai/cli 0.1.94 → 0.1.96

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 (298) hide show
  1. package/README.md +175 -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/agent/message/send.d.ts +2 -0
  8. package/dist/commands/agent/message/send.js +75 -5
  9. package/dist/commands/agents/chat.js +1 -1
  10. package/dist/commands/agents/create.d.ts +0 -3
  11. package/dist/commands/agents/create.js +0 -26
  12. package/dist/commands/agents/egress.d.ts +17 -0
  13. package/dist/commands/agents/egress.js +84 -0
  14. package/dist/commands/agents/mailbox/messages.d.ts +14 -0
  15. package/dist/commands/agents/mailbox/messages.js +52 -0
  16. package/dist/commands/agents/mailbox/show.d.ts +13 -0
  17. package/dist/commands/agents/mailbox/show.js +52 -0
  18. package/dist/commands/agents/operating-plan.js +8 -0
  19. package/dist/commands/agents/roles/capture.d.ts +16 -0
  20. package/dist/commands/agents/roles/capture.js +53 -0
  21. package/dist/commands/agents/roles/install.d.ts +1 -0
  22. package/dist/commands/agents/roles/install.js +8 -1
  23. package/dist/commands/agents/roles/preview.d.ts +2 -0
  24. package/dist/commands/agents/roles/preview.js +27 -3
  25. package/dist/commands/agents/update.d.ts +0 -3
  26. package/dist/commands/agents/update.js +1 -31
  27. package/dist/commands/agents/usage-cap.d.ts +4 -1
  28. package/dist/commands/agents/usage-cap.js +49 -10
  29. package/dist/commands/code/doctor.d.ts +1 -0
  30. package/dist/commands/code/doctor.js +6 -0
  31. package/dist/commands/code/index.js +4 -0
  32. package/dist/commands/code/install.d.ts +5 -62
  33. package/dist/commands/code/install.js +86 -279
  34. package/dist/commands/code/jobs/show.js +12 -0
  35. package/dist/commands/code/rollback.d.ts +8 -0
  36. package/dist/commands/code/rollback.js +20 -0
  37. package/dist/commands/code/update.d.ts +8 -37
  38. package/dist/commands/code/update.js +134 -213
  39. package/dist/commands/commitments/action-proposals/decide.d.ts +2 -0
  40. package/dist/commands/commitments/action-proposals/decide.js +12 -0
  41. package/dist/commands/commitments/action-proposals.js +7 -0
  42. package/dist/commands/commitments/create.d.ts +1 -0
  43. package/dist/commands/commitments/create.js +17 -1
  44. package/dist/commands/commitments/delivery.d.ts +1 -0
  45. package/dist/commands/commitments/delivery.js +11 -1
  46. package/dist/commands/commitments/doctor.js +4 -0
  47. package/dist/commands/commitments/effective-policy.js +26 -0
  48. package/dist/commands/commitments/endpoints/create.js +5 -2
  49. package/dist/commands/commitments/observations.d.ts +10 -0
  50. package/dist/commands/commitments/observations.js +88 -0
  51. package/dist/commands/commitments/pause.d.ts +1 -1
  52. package/dist/commands/commitments/pause.js +4 -3
  53. package/dist/commands/commitments/preflight.js +2 -1
  54. package/dist/commands/commitments/reports.d.ts +2 -0
  55. package/dist/commands/commitments/reports.js +22 -4
  56. package/dist/commands/commitments/update.d.ts +1 -0
  57. package/dist/commands/commitments/update.js +35 -5
  58. package/dist/commands/daemon/install.js +4 -0
  59. package/dist/commands/generate-recovery-code.d.ts +13 -1
  60. package/dist/commands/generate-recovery-code.js +146 -13
  61. package/dist/commands/grants/create.d.ts +1 -0
  62. package/dist/commands/grants/create.js +8 -0
  63. package/dist/commands/grants/rotate.d.ts +5 -0
  64. package/dist/commands/grants/rotate.js +13 -1
  65. package/dist/commands/grants/update.d.ts +12 -0
  66. package/dist/commands/grants/update.js +27 -0
  67. package/dist/commands/instructions/guide.d.ts +20 -0
  68. package/dist/commands/instructions/guide.js +84 -0
  69. package/dist/commands/instructions/install.js +57 -33
  70. package/dist/commands/instructions/setup.d.ts +14 -0
  71. package/dist/commands/instructions/setup.js +72 -0
  72. package/dist/commands/integrations/execute.js +1 -1
  73. package/dist/commands/login.d.ts +5 -6
  74. package/dist/commands/login.js +27 -11
  75. package/dist/commands/logout.js +7 -7
  76. package/dist/commands/machines/hosted/start.js +7 -1
  77. package/dist/commands/machines/list.js +4 -4
  78. package/dist/commands/measures/confirm.d.ts +1 -7
  79. package/dist/commands/measures/confirm.js +15 -14
  80. package/dist/commands/measures/list.d.ts +1 -7
  81. package/dist/commands/measures/list.js +1 -7
  82. package/dist/commands/measures/record.js +4 -4
  83. package/dist/commands/measures/show.d.ts +11 -0
  84. package/dist/commands/measures/show.js +26 -0
  85. package/dist/commands/northstars/governance/configure.d.ts +1 -0
  86. package/dist/commands/northstars/governance/configure.js +8 -1
  87. package/dist/commands/proposals/discard.d.ts +5 -0
  88. package/dist/commands/proposals/discard.js +8 -0
  89. package/dist/commands/proposals/keep.d.ts +5 -0
  90. package/dist/commands/proposals/keep.js +8 -0
  91. package/dist/commands/proposals/list.d.ts +15 -0
  92. package/dist/commands/proposals/list.js +74 -0
  93. package/dist/commands/proposals/show.d.ts +12 -0
  94. package/dist/commands/proposals/show.js +27 -0
  95. package/dist/commands/proposals/snooze.d.ts +5 -0
  96. package/dist/commands/proposals/snooze.js +8 -0
  97. package/dist/commands/security/overview.d.ts +11 -0
  98. package/dist/commands/security/overview.js +158 -0
  99. package/dist/commands/signals/monitors/create.d.ts +9 -0
  100. package/dist/commands/signals/monitors/create.js +29 -0
  101. package/dist/commands/signals/monitors/list.d.ts +8 -0
  102. package/dist/commands/signals/monitors/list.js +16 -0
  103. package/dist/commands/signals/monitors/pause.d.ts +11 -0
  104. package/dist/commands/signals/monitors/pause.js +17 -0
  105. package/dist/commands/signals/monitors/resume.d.ts +11 -0
  106. package/dist/commands/signals/monitors/resume.js +17 -0
  107. package/dist/commands/signals/monitors/revise.d.ts +12 -0
  108. package/dist/commands/signals/monitors/revise.js +25 -0
  109. package/dist/commands/signals/monitors/show.d.ts +11 -0
  110. package/dist/commands/signals/monitors/show.js +17 -0
  111. package/dist/commands/signals/monitors/test.d.ts +12 -0
  112. package/dist/commands/signals/monitors/test.js +25 -0
  113. package/dist/commands/signals/monitors/transitions.d.ts +11 -0
  114. package/dist/commands/signals/monitors/transitions.js +17 -0
  115. package/dist/commands/signals/monitors/validate.d.ts +9 -0
  116. package/dist/commands/signals/monitors/validate.js +24 -0
  117. package/dist/commands/signals/schemas/list.d.ts +8 -0
  118. package/dist/commands/signals/schemas/list.js +16 -0
  119. package/dist/commands/signals/schemas/show.d.ts +11 -0
  120. package/dist/commands/signals/schemas/show.js +17 -0
  121. package/dist/commands/signals/sources/list.d.ts +8 -0
  122. package/dist/commands/signals/sources/list.js +16 -0
  123. package/dist/commands/signals/sources/receipts.d.ts +11 -0
  124. package/dist/commands/signals/sources/receipts.js +17 -0
  125. package/dist/commands/signals/sources/show.d.ts +11 -0
  126. package/dist/commands/signals/sources/show.js +17 -0
  127. package/dist/commands/spaces/claim.d.ts +12 -0
  128. package/dist/commands/spaces/claim.js +42 -0
  129. package/dist/commands/spaces/ownership.d.ts +12 -0
  130. package/dist/commands/spaces/ownership.js +46 -0
  131. package/dist/commands/spaces/usage.d.ts +12 -0
  132. package/dist/commands/spaces/usage.js +28 -0
  133. package/dist/commands/spaces/workflows/run.js +3 -0
  134. package/dist/commands/spaces/workflows/runs.js +2 -1
  135. package/dist/commands/spaces/workflows/update.d.ts +6 -1
  136. package/dist/commands/spaces/workflows/update.js +34 -2
  137. package/dist/commands/tasks/cancel-cascade.js +1 -1
  138. package/dist/commands/tasks/cascade-status.d.ts +2 -0
  139. package/dist/commands/tasks/cascade-status.js +27 -1
  140. package/dist/commands/tasks/create-tree.d.ts +5 -1
  141. package/dist/commands/tasks/create-tree.js +35 -7
  142. package/dist/commands/tasks/create.d.ts +4 -0
  143. package/dist/commands/tasks/create.js +16 -0
  144. package/dist/commands/tasks/deliverable/add.js +12 -3
  145. package/dist/commands/tasks/economics-compare.d.ts +15 -0
  146. package/dist/commands/tasks/economics-compare.js +60 -0
  147. package/dist/commands/tasks/expectations/evaluate.d.ts +13 -0
  148. package/dist/commands/tasks/expectations/evaluate.js +43 -0
  149. package/dist/commands/tasks/interrupt.js +2 -2
  150. package/dist/commands/tasks/list.d.ts +1 -0
  151. package/dist/commands/tasks/list.js +44 -1
  152. package/dist/commands/tasks/pause-schedule.js +1 -1
  153. package/dist/commands/tasks/show.d.ts +5 -0
  154. package/dist/commands/tasks/show.js +17 -0
  155. package/dist/commands/tasks/update.d.ts +4 -0
  156. package/dist/commands/tasks/update.js +9 -0
  157. package/dist/commands/tasks/workflow-findings.js +2 -2
  158. package/dist/commands/token/list.d.ts +3 -5
  159. package/dist/commands/token/list.js +99 -57
  160. package/dist/commands/triggers/create.d.ts +2 -0
  161. package/dist/commands/triggers/create.js +15 -0
  162. package/dist/commands/update.d.ts +14 -0
  163. package/dist/commands/update.js +61 -0
  164. package/dist/commands/workspaces/grants.d.ts +12 -0
  165. package/dist/commands/workspaces/grants.js +31 -0
  166. package/dist/commands/workspaces/stewardship.d.ts +13 -0
  167. package/dist/commands/workspaces/stewardship.js +34 -0
  168. package/dist/generated/managed-instruction-guides.json +9 -0
  169. package/dist/hooks/init.d.ts +5 -0
  170. package/dist/hooks/init.js +27 -0
  171. package/dist/lib/agent-config.d.ts +0 -12
  172. package/dist/lib/agent-config.js +1 -27
  173. package/dist/lib/agent-mailbox.d.ts +35 -0
  174. package/dist/lib/agent-mailbox.js +55 -0
  175. package/dist/lib/commitment-endpoints.d.ts +2 -1
  176. package/dist/lib/commitment-endpoints.js +2 -5
  177. package/dist/lib/commitment-product.d.ts +3 -1
  178. package/dist/lib/commitment-product.js +10 -0
  179. package/dist/lib/commitment-terms.js +1 -1
  180. package/dist/lib/commitments.d.ts +17 -15
  181. package/dist/lib/commitments.js +173 -137
  182. package/dist/lib/compasses.d.ts +14 -0
  183. package/dist/lib/compasses.js +25 -11
  184. package/dist/lib/daemon-installer.d.ts +2 -0
  185. package/dist/lib/daemon-installer.js +100 -24
  186. package/dist/lib/first-party-harness-doctor.js +31 -1
  187. package/dist/lib/first-party-harness-remote-install.d.ts +71 -0
  188. package/dist/lib/first-party-harness-remote-install.js +310 -0
  189. package/dist/lib/first-party-harness-remote-update.d.ts +46 -0
  190. package/dist/lib/first-party-harness-remote-update.js +242 -0
  191. package/dist/lib/first-party-harness-startup-update.d.ts +26 -0
  192. package/dist/lib/first-party-harness-startup-update.js +166 -0
  193. package/dist/lib/first-party-harness-update.d.ts +46 -0
  194. package/dist/lib/first-party-harness-update.js +289 -0
  195. package/dist/lib/first-party-harness.js +7 -4
  196. package/dist/lib/grants.d.ts +5 -1
  197. package/dist/lib/grants.js +9 -1
  198. package/dist/lib/hosted-machines.d.ts +7 -0
  199. package/dist/lib/mailbox-human-command.d.ts +11 -0
  200. package/dist/lib/mailbox-human-command.js +41 -0
  201. package/dist/lib/managed-instruction-local.d.ts +12 -0
  202. package/dist/lib/managed-instruction-local.js +58 -0
  203. package/dist/lib/managed-instruction-setup.d.ts +35 -0
  204. package/dist/lib/managed-instruction-setup.js +306 -0
  205. package/dist/lib/measures.d.ts +28 -2
  206. package/dist/lib/measures.js +38 -14
  207. package/dist/lib/memory-sync.d.ts +1 -0
  208. package/dist/lib/memory-sync.js +279 -68
  209. package/dist/lib/message-intent.d.ts +6 -2
  210. package/dist/lib/message-intent.js +1 -0
  211. package/dist/lib/northstars.js +2 -1
  212. package/dist/lib/platform-update-local.d.ts +2 -0
  213. package/dist/lib/platform-update-local.js +113 -0
  214. package/dist/lib/platform-update.d.ts +39 -0
  215. package/dist/lib/platform-update.js +84 -0
  216. package/dist/lib/profile-machine-identity-guard.d.ts +2 -0
  217. package/dist/lib/profile-machine-identity-guard.js +13 -0
  218. package/dist/lib/prompt.d.ts +1 -0
  219. package/dist/lib/prompt.js +4 -3
  220. package/dist/lib/proposal-decision-command.d.ts +19 -0
  221. package/dist/lib/proposal-decision-command.js +64 -0
  222. package/dist/lib/proposals.d.ts +8 -0
  223. package/dist/lib/proposals.js +22 -0
  224. package/dist/lib/roles.d.ts +141 -6
  225. package/dist/lib/roles.js +8 -2
  226. package/dist/lib/signals.d.ts +20 -0
  227. package/dist/lib/signals.js +24 -0
  228. package/dist/lib/space-usage.d.ts +3 -0
  229. package/dist/lib/space-usage.js +17 -0
  230. package/dist/lib/stewardship-output.d.ts +4 -0
  231. package/dist/lib/stewardship-output.js +82 -0
  232. package/dist/lib/task-asset-upload.d.ts +3 -1
  233. package/dist/lib/task-asset-upload.js +1 -0
  234. package/dist/lib/task-batch.d.ts +9 -0
  235. package/dist/lib/task-batch.js +94 -17
  236. package/dist/lib/task-economics.d.ts +16 -0
  237. package/dist/lib/task-economics.js +22 -0
  238. package/dist/lib/task-instruction-offer.d.ts +1 -4
  239. package/dist/lib/task-instruction-offer.js +3 -129
  240. package/dist/lib/triggers.d.ts +11 -3
  241. package/dist/lib/triggers.js +58 -1
  242. package/dist/lib/update-check.d.ts +61 -53
  243. package/dist/lib/update-check.js +453 -314
  244. package/dist/lib/usage-discovery.d.ts +10 -0
  245. package/dist/lib/usage-discovery.js +24 -3
  246. package/dist/lib/workflow-run-budget.d.ts +12 -0
  247. package/dist/lib/workflow-run-budget.js +37 -0
  248. package/dist/lib/workspaces.d.ts +48 -0
  249. package/dist/lib/workspaces.js +8 -0
  250. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/cliHandoffWire.d.ts +4 -0
  251. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/cliHandoffWire.js +14 -1
  252. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/firstPartyHarnessChannels.d.ts +3 -4
  253. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/firstPartyHarnessChannels.js +3 -4
  254. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/firstPartyHarnessReleaseKeys.d.ts +82 -0
  255. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/firstPartyHarnessReleaseKeys.js +105 -0
  256. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/firstPartyHarnessUpdater.d.ts +110 -0
  257. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/firstPartyHarnessUpdater.js +945 -0
  258. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/githubPushRefusal.d.ts +9 -0
  259. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/githubPushRefusal.js +49 -0
  260. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/harnessPermissionControls.d.ts +32 -0
  261. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/harnessPermissionControls.js +62 -0
  262. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/index.d.ts +2 -0
  263. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/index.js +4 -1
  264. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/machineUuid.js +35 -5
  265. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/releasePolicy.d.ts +63 -0
  266. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/releasePolicy.js +169 -0
  267. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/releaseVersions.d.ts +2 -0
  268. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/releaseVersions.js +44 -0
  269. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/cliHandoffWire.d.ts +4 -0
  270. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/cliHandoffWire.js +12 -0
  271. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/firstPartyHarnessChannels.d.ts +3 -4
  272. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/firstPartyHarnessChannels.js +3 -4
  273. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/firstPartyHarnessReleaseKeys.d.ts +82 -0
  274. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/firstPartyHarnessReleaseKeys.js +102 -0
  275. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/firstPartyHarnessUpdater.d.ts +110 -0
  276. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/firstPartyHarnessUpdater.js +923 -0
  277. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/githubPushRefusal.d.ts +9 -0
  278. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/githubPushRefusal.js +44 -0
  279. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/harnessPermissionControls.d.ts +32 -0
  280. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/harnessPermissionControls.js +59 -0
  281. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/index.d.ts +2 -0
  282. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/index.js +2 -0
  283. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/machineUuid.js +35 -5
  284. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/releasePolicy.d.ts +63 -0
  285. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/releasePolicy.js +163 -0
  286. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/releaseVersions.d.ts +2 -0
  287. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/releaseVersions.js +41 -0
  288. package/dist/node_modules/@skrr-ai/auth-core/package.json +41 -1
  289. package/dist/node_modules/@skrr-ai/data-provider/index.js +8069 -7121
  290. package/docs/v1/README.md +28 -0
  291. package/docs/v1/api.md +55 -0
  292. package/docs/v1/changelog.md +16 -0
  293. package/docs/v1/check-examples.mjs +178 -0
  294. package/docs/v1/examples/api-readonly.mjs +144 -0
  295. package/docs/v1/operations.md +87 -0
  296. package/docs/v1/quickstart.md +71 -0
  297. package/oclif.manifest.json +49424 -46174
  298. package/package.json +34 -11
@@ -23,6 +23,14 @@ import type { CommandManifest } from './command-manifest';
23
23
  * only then whether the bound is still the right size.
24
24
  */
25
25
  export declare const USAGE_OVERVIEW_TOKEN_BUDGET = 240;
26
+ /**
27
+ * Topics listed under another domain instead of as their own overview line.
28
+ * Every command keeps its own id (`skrr proposals list`); only the discovery
29
+ * grouping changes, and `skrr usage <folded>` resolves to the host page, which
30
+ * names the folded topic in an `Includes:` line so it stays reachable.
31
+ * `proposals` is the unified proposal inbox, so it reads as part of `inbox`.
32
+ */
33
+ export declare const USAGE_DOMAIN_FOLDS: Readonly<Record<string, string>>;
26
34
  export declare const USAGE_DOMAIN_TOKEN_BUDGET = 500;
27
35
  export type UsageCommand = {
28
36
  command: string;
@@ -46,6 +54,8 @@ export type UsageReference = {
46
54
  object: 'sky_usage_reference';
47
55
  generatedFrom: 'oclif.manifest.json';
48
56
  domain: string;
57
+ /** Topics folded into this domain (see `USAGE_DOMAIN_FOLDS`). */
58
+ includes?: string[];
49
59
  tokenBudget: number;
50
60
  estimatedTokens: number;
51
61
  page: number;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.USAGE_DOMAIN_TOKEN_BUDGET = exports.USAGE_OVERVIEW_TOKEN_BUDGET = void 0;
3
+ exports.USAGE_DOMAIN_TOKEN_BUDGET = exports.USAGE_DOMAIN_FOLDS = exports.USAGE_OVERVIEW_TOKEN_BUDGET = void 0;
4
4
  exports.estimateUsageTokens = estimateUsageTokens;
5
5
  exports.usageDomains = usageDomains;
6
6
  exports.buildUsageOverview = buildUsageOverview;
@@ -34,6 +34,14 @@ const command_manifest_1 = require("./command-manifest");
34
34
  * only then whether the bound is still the right size.
35
35
  */
36
36
  exports.USAGE_OVERVIEW_TOKEN_BUDGET = 240;
37
+ /**
38
+ * Topics listed under another domain instead of as their own overview line.
39
+ * Every command keeps its own id (`skrr proposals list`); only the discovery
40
+ * grouping changes, and `skrr usage <folded>` resolves to the host page, which
41
+ * names the folded topic in an `Includes:` line so it stays reachable.
42
+ * `proposals` is the unified proposal inbox, so it reads as part of `inbox`.
43
+ */
44
+ exports.USAGE_DOMAIN_FOLDS = { proposals: 'inbox' };
37
45
  exports.USAGE_DOMAIN_TOKEN_BUDGET = 500;
38
46
  const GENERIC_FLAGS = new Set(['bare', 'help', 'json', 'token', 'workspace']);
39
47
  /**
@@ -74,7 +82,8 @@ function buildUsageOverview(manifest, bin = 'skrr') {
74
82
  }
75
83
  /** Return case-insensitive manifest domain names without inventing aliases. */
76
84
  function resolveUsageDomain(manifest, value) {
77
- const needle = value.trim().toLowerCase();
85
+ const trimmed = value.trim().toLowerCase();
86
+ const needle = exports.USAGE_DOMAIN_FOLDS[trimmed] ?? trimmed;
78
87
  return usageDomains(manifest).find(({ domain }) => domain.toLowerCase() === needle)?.domain;
79
88
  }
80
89
  /**
@@ -95,10 +104,12 @@ function buildUsageReference(manifest, domainInput, options = {}) {
95
104
  if (!Number.isInteger(requested) || index < 0 || index >= pages.length)
96
105
  return undefined;
97
106
  const data = pages[index];
107
+ const includes = foldedTopics(manifest, domain);
98
108
  const draft = {
99
109
  object: 'sky_usage_reference',
100
110
  generatedFrom: 'oclif.manifest.json',
101
111
  domain,
112
+ ...(includes.length > 0 ? { includes } : {}),
102
113
  tokenBudget: exports.USAGE_DOMAIN_TOKEN_BUDGET,
103
114
  estimatedTokens: 0,
104
115
  page: requested,
@@ -122,6 +133,8 @@ function renderUsageReference(reference, bin = 'skrr') {
122
133
  `${reference.domain} commands — page ${reference.page}/${reference.pages} ` +
123
134
  `(${reference.commandCount} total; manifest-derived).`,
124
135
  ];
136
+ if (reference.includes?.length)
137
+ lines.push(`Includes: ${reference.includes.join(', ')}.`);
125
138
  for (const command of reference.data) {
126
139
  const flags = command.keyFlags.length > 0 ? ` Flags: ${command.keyFlags.join(', ')}.` : '';
127
140
  lines.push(`${bin} ${command.command} — ${command.description}.${flags} Example: ${command.example}`);
@@ -167,13 +180,21 @@ function auditUsageBudgets(manifest, bin = 'skrr') {
167
180
  function groupEntries(manifest) {
168
181
  const grouped = new Map();
169
182
  for (const entry of (0, command_manifest_1.visibleCommandEntries)(manifest)) {
170
- const domain = entry.id.split(':')[0];
183
+ const topic = entry.id.split(':')[0];
184
+ const domain = exports.USAGE_DOMAIN_FOLDS[topic] ?? topic;
171
185
  const existing = grouped.get(domain) ?? [];
172
186
  existing.push(entry);
173
187
  grouped.set(domain, existing);
174
188
  }
175
189
  return grouped;
176
190
  }
191
+ function foldedTopics(manifest, domain) {
192
+ const present = new Set((0, command_manifest_1.visibleCommandEntries)(manifest).map((entry) => entry.id.split(':')[0]));
193
+ return Object.entries(exports.USAGE_DOMAIN_FOLDS)
194
+ .filter(([topic, host]) => host === domain && present.has(topic))
195
+ .map(([topic]) => topic)
196
+ .sort();
197
+ }
177
198
  function usageCommand(entry, bin) {
178
199
  const flags = Object.entries(entry.flags)
179
200
  .filter(([, value]) => !value.hidden)
@@ -0,0 +1,12 @@
1
+ type RunLike = Record<string, unknown>;
2
+ /**
3
+ * Human lines for a run's duration budget and for a run the budget stopped.
4
+ *
5
+ * The server derives `budget` per read and stamps `error.code =
6
+ * WORKFLOW_RUN_DEADLINE` on a run it cancelled; this only words them. A run with
7
+ * neither prints nothing: no budget is not "0 minutes left".
8
+ */
9
+ export declare function describeRunBudget(run: RunLike): string[];
10
+ /** The status cell, naming a time-limit stop where the plain status would hide it. */
11
+ export declare function runStatusLabel(run: RunLike): string;
12
+ export {};
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.describeRunBudget = describeRunBudget;
4
+ exports.runStatusLabel = runStatusLabel;
5
+ const data_provider_1 = require("@skrr-ai/data-provider");
6
+ /**
7
+ * Human lines for a run's duration budget and for a run the budget stopped.
8
+ *
9
+ * The server derives `budget` per read and stamps `error.code =
10
+ * WORKFLOW_RUN_DEADLINE` on a run it cancelled; this only words them. A run with
11
+ * neither prints nothing: no budget is not "0 minutes left".
12
+ */
13
+ function describeRunBudget(run) {
14
+ const lines = [];
15
+ const error = run.error;
16
+ if (error?.code === data_provider_1.WORKFLOW_RUN_DEADLINE) {
17
+ lines.push(`Stopped: ${error.code}${error.message ? ` - ${error.message}` : ''}`);
18
+ }
19
+ const budget = run.budget;
20
+ if (budget && Number.isFinite(budget.maxDurationMs)) {
21
+ const limit = (0, data_provider_1.describeWorkflowDuration)(budget.maxDurationMs);
22
+ if (budget.exceeded)
23
+ lines.push(`Time limit: ${limit}, exceeded (deadline ${budget.deadlineAt})`);
24
+ else if (budget.remainingMs > 0)
25
+ lines.push(`Time limit: ${limit}, ${(0, data_provider_1.describeWorkflowDuration)(budget.remainingMs)} left (deadline ${budget.deadlineAt})`);
26
+ else
27
+ lines.push(`Time limit: ${limit} (deadline ${budget.deadlineAt})`);
28
+ }
29
+ return lines;
30
+ }
31
+ /** The status cell, naming a time-limit stop where the plain status would hide it. */
32
+ function runStatusLabel(run) {
33
+ const status = String(run.status ?? '-');
34
+ return run.error?.code === data_provider_1.WORKFLOW_RUN_DEADLINE
35
+ ? `${status} (time limit)`
36
+ : status;
37
+ }
@@ -1,3 +1,51 @@
1
+ import type { GrantPublic } from '@skrr-ai/data-schemas';
2
+ export interface StewardshipSource {
3
+ name: string;
4
+ status: 'available' | 'unavailable';
5
+ truncated: boolean;
6
+ code?: string;
7
+ }
8
+ export interface StewardshipCoverage {
9
+ complete: boolean;
10
+ truncated: boolean;
11
+ sources: StewardshipSource[];
12
+ }
13
+ export type WorkspaceGrantMetadata = Omit<GrantPublic, 'credential' | 'createdAt' | 'updatedAt'> & {
14
+ ownerUserId: string;
15
+ credential: (NonNullable<GrantPublic['credential']> & {
16
+ fingerprint?: string;
17
+ }) | null;
18
+ createdAt?: string;
19
+ updatedAt?: string;
20
+ referencedBy: string[] | null;
21
+ referencesTruncated: boolean;
22
+ };
23
+ export interface WorkspaceGrantReport {
24
+ workspaceId: string;
25
+ grants: WorkspaceGrantMetadata[] | null;
26
+ coverage: StewardshipCoverage;
27
+ }
28
+ export interface StewardshipCommitmentMetadata {
29
+ id: string;
30
+ title?: string;
31
+ status?: string;
32
+ agentId?: string;
33
+ }
34
+ export interface WorkspaceStewardshipReport extends WorkspaceGrantReport {
35
+ memberUserId: string;
36
+ membership: {
37
+ status: 'active' | 'absent' | 'unavailable';
38
+ role?: string;
39
+ };
40
+ commitments: StewardshipCommitmentMetadata[] | null;
41
+ approverSeats: StewardshipCommitmentMetadata[] | null;
42
+ agents: Array<{
43
+ id: string;
44
+ name?: string;
45
+ }> | null;
46
+ }
47
+ export declare function getWorkspaceStewardship(workspaceId: string, memberUserId: string): Promise<WorkspaceStewardshipReport>;
48
+ export declare function listWorkspaceGrants(workspaceId: string): Promise<WorkspaceGrantReport>;
1
49
  /**
2
50
  * The workspaces this account belongs to.
3
51
  *
@@ -1,5 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getWorkspaceStewardship = getWorkspaceStewardship;
4
+ exports.listWorkspaceGrants = listWorkspaceGrants;
3
5
  exports.describeUnselectedWorkspace = describeUnselectedWorkspace;
4
6
  exports.listWorkspaces = listWorkspaces;
5
7
  exports.ambientWorkspaceId = ambientWorkspaceId;
@@ -10,6 +12,12 @@ exports.getWorkspace = getWorkspace;
10
12
  exports.matchWorkspace = matchWorkspace;
11
13
  const api_fetch_1 = require("./api-fetch");
12
14
  const triggers_1 = require("./triggers");
15
+ async function getWorkspaceStewardship(workspaceId, memberUserId) {
16
+ return (0, api_fetch_1.apiFetch)(`/api/workspaces/${encodeURIComponent(workspaceId)}/stewardship/members/${encodeURIComponent(memberUserId)}`);
17
+ }
18
+ async function listWorkspaceGrants(workspaceId) {
19
+ return (0, api_fetch_1.apiFetch)(`/api/workspaces/${encodeURIComponent(workspaceId)}/stewardship/grants`);
20
+ }
13
21
  /**
14
22
  * The server's workspace document can include presentation metadata such as an
15
23
  * avatar source. This CLI surface is a selector, not a workspace export: keep
@@ -129,3 +129,7 @@ export interface CliHandoffDpopProofResponse {
129
129
  proof: string;
130
130
  }
131
131
  export declare function parseCliHandoffDpopProofResponse(value: unknown): CliHandoffDpopProofResponse | null;
132
+ /** Persisted credential families; deployed values must not change. */
133
+ export declare const DELEGATED_AGENT_CLI_ID_PREFIX = "oversky-daemon-agent-cli-";
134
+ export declare const WORKLOAD_CLI_ID_PREFIX = "oversky-daemon-workload-cli-";
135
+ export declare function classifyCliFamilyId(id: unknown): 'agent' | 'workload' | 'person';
@@ -18,7 +18,7 @@
18
18
  * must produce the full shape.
19
19
  */
20
20
  Object.defineProperty(exports, "__esModule", { value: true });
21
- exports.CLI_HANDOFF_ERROR_DPOP_UNAVAILABLE = exports.CLI_HANDOFF_ERROR_DPOP_PROOF_REFUSED = exports.CLI_HANDOFF_DPOP_PROOF_PATH = exports.CLI_HANDOFF_ERROR_DPOP_REQUIRED = exports.CLI_HANDOFF_ERROR_BROKER_ONLY = exports.CLI_HANDOFF_TOKEN_ERROR_UNAVAILABLE = exports.CLI_HANDOFF_TOKEN_PATH = exports.CLI_HANDOFF_MODES = void 0;
21
+ exports.WORKLOAD_CLI_ID_PREFIX = exports.DELEGATED_AGENT_CLI_ID_PREFIX = exports.CLI_HANDOFF_ERROR_DPOP_UNAVAILABLE = exports.CLI_HANDOFF_ERROR_DPOP_PROOF_REFUSED = exports.CLI_HANDOFF_DPOP_PROOF_PATH = exports.CLI_HANDOFF_ERROR_DPOP_REQUIRED = exports.CLI_HANDOFF_ERROR_BROKER_ONLY = exports.CLI_HANDOFF_TOKEN_ERROR_UNAVAILABLE = exports.CLI_HANDOFF_TOKEN_PATH = exports.CLI_HANDOFF_MODES = void 0;
22
22
  exports.parseCliHandoffDescriptor = parseCliHandoffDescriptor;
23
23
  exports.normalizeHandoffModes = normalizeHandoffModes;
24
24
  exports.advertisedHandoffModes = advertisedHandoffModes;
@@ -26,6 +26,7 @@ exports.descriptorOffersAccessToken = descriptorOffersAccessToken;
26
26
  exports.descriptorOffersDpop = descriptorOffersDpop;
27
27
  exports.parseCliHandoffTokenResponse = parseCliHandoffTokenResponse;
28
28
  exports.parseCliHandoffDpopProofResponse = parseCliHandoffDpopProofResponse;
29
+ exports.classifyCliFamilyId = classifyCliFamilyId;
29
30
  /**
30
31
  * What a caller may redeem the descriptor secret for.
31
32
  * - `refresh_family`: the legacy durable mint (90-day cli-scope family).
@@ -143,3 +144,15 @@ function parseCliHandoffDpopProofResponse(value) {
143
144
  return null;
144
145
  return { proof: v.proof };
145
146
  }
147
+ /** Persisted credential families; deployed values must not change. */
148
+ exports.DELEGATED_AGENT_CLI_ID_PREFIX = 'oversky-daemon-agent-cli-';
149
+ exports.WORKLOAD_CLI_ID_PREFIX = 'oversky-daemon-workload-cli-';
150
+ function classifyCliFamilyId(id) {
151
+ if (typeof id !== 'string')
152
+ return 'person';
153
+ if (id.startsWith(exports.DELEGATED_AGENT_CLI_ID_PREFIX))
154
+ return 'agent';
155
+ if (id.startsWith(exports.WORKLOAD_CLI_ID_PREFIX))
156
+ return 'workload';
157
+ return 'person';
158
+ }
@@ -18,10 +18,9 @@
18
18
  * quietly redeclaring. This follows that road rather than reopening the one it
19
19
  * replaced.
20
20
  *
21
- * Only the VOCABULARY lives here — channel names, the env var, the default, the
22
- * URL shape and the feed candidates. The installer, the signature verification
23
- * and the promotion machinery stay in the daemon, which is the only process that
24
- * performs them.
21
+ * Channel vocabulary stays here. The shared signed installer lives beside it
22
+ * in firstPartyHarnessUpdater.ts, used by CLI, Daemon and Desktop so updating
23
+ * a local engine needs neither a running daemon nor an account.
25
24
  *
26
25
  * Every product-named value comes from `firstPartyHarness.ts`; nothing in this
27
26
  * file spells the product.
@@ -19,10 +19,9 @@
19
19
  * quietly redeclaring. This follows that road rather than reopening the one it
20
20
  * replaced.
21
21
  *
22
- * Only the VOCABULARY lives here — channel names, the env var, the default, the
23
- * URL shape and the feed candidates. The installer, the signature verification
24
- * and the promotion machinery stay in the daemon, which is the only process that
25
- * performs them.
22
+ * Channel vocabulary stays here. The shared signed installer lives beside it
23
+ * in firstPartyHarnessUpdater.ts, used by CLI, Daemon and Desktop so updating
24
+ * a local engine needs neither a running daemon nor an account.
26
25
  *
27
26
  * Every product-named value comes from `firstPartyHarness.ts`; nothing in this
28
27
  * file spells the product.
@@ -0,0 +1,82 @@
1
+ /**
2
+ * WL-6.8 — ed25519 public keys that vouch for a **first-party harness binary**.
3
+ *
4
+ * ── Why this is not `daemon/src/release-keys.ts` ───────────────────────────
5
+ *
6
+ * `verifyHarnessProvenance` originally defaulted to the daemon's own
7
+ * self-update keys. That is convenient and wrong. Those two keys answer
8
+ * different questions and protect different things:
9
+ *
10
+ * `OVERSKY_RELEASE_PUBLIC_KEYS` — "may this binary REPLACE the daemon?"
11
+ * `FIRST_PARTY_HARNESS_RELEASE_PUBLIC_KEYS` — "may this binary receive a
12
+ * platform credential?"
13
+ *
14
+ * Sharing one key means a compromise of the harness signing identity is also a
15
+ * forged-daemon-self-update primitive: an attacker who can sign a harness can
16
+ * sign a manifest that the daemon installs over itself. That is a strictly
17
+ * larger blast radius than the harness key needs to carry, and it is
18
+ * unnecessary — the two artifacts have different release cadences and
19
+ * different publishers, so they were always going to want independent
20
+ * rotation.
21
+ *
22
+ * Separating them costs one more secret to provision and removes an
23
+ * escalation path. That trade is not close.
24
+ *
25
+ * ── Fail-closed, and in the direction that matters ─────────────────────────
26
+ *
27
+ * EMPTY means provenance can never be established. Until 2026-08-11 that also
28
+ * meant the first-party harness was held at Tier 2 on a scoped gateway token; that
29
+ * floor has since been removed, and it is DECLARED Tier 1, so an empty list no
30
+ * longer withholds the credential privilege from it. What an empty list still
31
+ * costs is the ability to say WHICH BYTES held the credential — the verdict
32
+ * becomes `unverifiable`, and the record is silent about the binary on disk.
33
+ *
34
+ * The fail-closed direction below still governs every OTHER
35
+ * OverSky-distributed harness, and remains the correct posture for this one if
36
+ * the floor is ever restored.
37
+ *
38
+ * Note this is the OPPOSITE posture to the daemon's own `../release-keys.ts`
39
+ * (same basename, different module), deliberately. There,
40
+ * an empty list disables verification and the updater proceeds, because a fleet
41
+ * that cannot update is its own outage. Here, an empty list withholds a
42
+ * privilege, because absence of evidence must never grant one. Getting these
43
+ * two backwards would mean provisioning a key *reduces* what the daemon trusts.
44
+ *
45
+ * ── Provisioning ──────────────────────────────────────────────────────────
46
+ *
47
+ * 1. Mint: node scripts/first-party-harness/generate-signing-key.mjs (in the fork)
48
+ * 2. Store the PRIVATE half as the GH Actions secret
49
+ * `FIRST_PARTY_HARNESS_ENV.signingKey.name` (the only name the publish
50
+ * workflow reads) + AWS Secrets Manager. It must never be committed and
51
+ * never leave CI.
52
+ * 3. Paste the PUBLIC half below, newest first.
53
+ * 4. Ship a daemon build carrying it BEFORE the first signed harness
54
+ * release, so the fleet can verify what it is about to be handed.
55
+ *
56
+ * Rotation is the same shape as the daemon's: add the next key ABOVE the
57
+ * current one, ship that build, then start dual-signing. Verification accepts
58
+ * any pinned key, so an overlap window has no gap.
59
+ */
60
+ import type { ReleaseKey } from './releaseKeys.js';
61
+ export type { ReleaseKey };
62
+ /**
63
+ * Pinned first-party harness signing public keys, newest first.
64
+ *
65
+ * Provisioned 2026-08-07 (WL-6.8). The private half lives in the GitHub secret
66
+ * named by `FIRST_PARTY_HARNESS_ENV.signingKey` and in AWS Secrets Manager — a
67
+ * HARNESS key, deliberately a different trust domain from the daemon
68
+ * self-update key in `../release-keys.ts`.
69
+ *
70
+ * ── Two literals that must NOT follow a rename (contract §6) ────────────────
71
+ * The `keyId` below and the AWS secret path `oversky/sky-code/signing-key` are
72
+ * historical identifiers, not the product name. A key id is inside every
73
+ * signature ever issued and every provenance sidecar ever written, so changing
74
+ * it would make every existing release unverifiable; the secret is stateful
75
+ * infrastructure. Both move only at the next key ROTATION.
76
+ *
77
+ * ORDER OF OPERATIONS, and it only works one way round: this pinned build must
78
+ * SHIP before any harness release is signed. Backwards, the fleet receives an
79
+ * artifact it cannot verify and every daemon reports `invalid-signature` —
80
+ * which from the outside is indistinguishable from a real attack.
81
+ */
82
+ export declare const FIRST_PARTY_HARNESS_RELEASE_PUBLIC_KEYS: ReleaseKey[];
@@ -0,0 +1,105 @@
1
+ "use strict";
2
+ /**
3
+ * WL-6.8 — ed25519 public keys that vouch for a **first-party harness binary**.
4
+ *
5
+ * ── Why this is not `daemon/src/release-keys.ts` ───────────────────────────
6
+ *
7
+ * `verifyHarnessProvenance` originally defaulted to the daemon's own
8
+ * self-update keys. That is convenient and wrong. Those two keys answer
9
+ * different questions and protect different things:
10
+ *
11
+ * `OVERSKY_RELEASE_PUBLIC_KEYS` — "may this binary REPLACE the daemon?"
12
+ * `FIRST_PARTY_HARNESS_RELEASE_PUBLIC_KEYS` — "may this binary receive a
13
+ * platform credential?"
14
+ *
15
+ * Sharing one key means a compromise of the harness signing identity is also a
16
+ * forged-daemon-self-update primitive: an attacker who can sign a harness can
17
+ * sign a manifest that the daemon installs over itself. That is a strictly
18
+ * larger blast radius than the harness key needs to carry, and it is
19
+ * unnecessary — the two artifacts have different release cadences and
20
+ * different publishers, so they were always going to want independent
21
+ * rotation.
22
+ *
23
+ * Separating them costs one more secret to provision and removes an
24
+ * escalation path. That trade is not close.
25
+ *
26
+ * ── Fail-closed, and in the direction that matters ─────────────────────────
27
+ *
28
+ * EMPTY means provenance can never be established. Until 2026-08-11 that also
29
+ * meant the first-party harness was held at Tier 2 on a scoped gateway token; that
30
+ * floor has since been removed, and it is DECLARED Tier 1, so an empty list no
31
+ * longer withholds the credential privilege from it. What an empty list still
32
+ * costs is the ability to say WHICH BYTES held the credential — the verdict
33
+ * becomes `unverifiable`, and the record is silent about the binary on disk.
34
+ *
35
+ * The fail-closed direction below still governs every OTHER
36
+ * OverSky-distributed harness, and remains the correct posture for this one if
37
+ * the floor is ever restored.
38
+ *
39
+ * Note this is the OPPOSITE posture to the daemon's own `../release-keys.ts`
40
+ * (same basename, different module), deliberately. There,
41
+ * an empty list disables verification and the updater proceeds, because a fleet
42
+ * that cannot update is its own outage. Here, an empty list withholds a
43
+ * privilege, because absence of evidence must never grant one. Getting these
44
+ * two backwards would mean provisioning a key *reduces* what the daemon trusts.
45
+ *
46
+ * ── Provisioning ──────────────────────────────────────────────────────────
47
+ *
48
+ * 1. Mint: node scripts/first-party-harness/generate-signing-key.mjs (in the fork)
49
+ * 2. Store the PRIVATE half as the GH Actions secret
50
+ * `FIRST_PARTY_HARNESS_ENV.signingKey.name` (the only name the publish
51
+ * workflow reads) + AWS Secrets Manager. It must never be committed and
52
+ * never leave CI.
53
+ * 3. Paste the PUBLIC half below, newest first.
54
+ * 4. Ship a daemon build carrying it BEFORE the first signed harness
55
+ * release, so the fleet can verify what it is about to be handed.
56
+ *
57
+ * Rotation is the same shape as the daemon's: add the next key ABOVE the
58
+ * current one, ship that build, then start dual-signing. Verification accepts
59
+ * any pinned key, so an overlap window has no gap.
60
+ */
61
+ Object.defineProperty(exports, "__esModule", { value: true });
62
+ exports.FIRST_PARTY_HARNESS_RELEASE_PUBLIC_KEYS = void 0;
63
+ /**
64
+ * Pinned first-party harness signing public keys, newest first.
65
+ *
66
+ * Provisioned 2026-08-07 (WL-6.8). The private half lives in the GitHub secret
67
+ * named by `FIRST_PARTY_HARNESS_ENV.signingKey` and in AWS Secrets Manager — a
68
+ * HARNESS key, deliberately a different trust domain from the daemon
69
+ * self-update key in `../release-keys.ts`.
70
+ *
71
+ * ── Two literals that must NOT follow a rename (contract §6) ────────────────
72
+ * The `keyId` below and the AWS secret path `oversky/sky-code/signing-key` are
73
+ * historical identifiers, not the product name. A key id is inside every
74
+ * signature ever issued and every provenance sidecar ever written, so changing
75
+ * it would make every existing release unverifiable; the secret is stateful
76
+ * infrastructure. Both move only at the next key ROTATION.
77
+ *
78
+ * ORDER OF OPERATIONS, and it only works one way round: this pinned build must
79
+ * SHIP before any harness release is signed. Backwards, the fleet receives an
80
+ * artifact it cannot verify and every daemon reports `invalid-signature` —
81
+ * which from the outside is indistinguishable from a real attack.
82
+ */
83
+ exports.FIRST_PARTY_HARNESS_RELEASE_PUBLIC_KEYS = [
84
+ // ── NEXT key goes ABOVE this line during a rotation (newest first). ──
85
+ {
86
+ // Literal on purpose: a key id is inside every signature issued (contract §6).
87
+ keyId: 'sky-code-2026-08',
88
+ publicKeySpkiB64: 'MCowBQYDK2VwAyEAO/5glF6bICuz5MGYgG1PJaDEgXJZkUuv2cLzguVZCvY=',
89
+ },
90
+ ];
91
+ /*
92
+ * Dev/test escape hatch: an absolute path to a JSON file holding
93
+ * `[{ keyId, publicKeySpkiB64 }]`, named by `FIRST_PARTY_HARNESS_ENV.devKeys` and
94
+ * read in `./provenance.ts` with `readFirstPartyHarnessEnv(env, 'devKeys')` — its
95
+ * brand-neutral name, the only one read.
96
+ *
97
+ * Exists so a developer can build, sign, and verify a local harness end to end
98
+ * without minting a production key — the alternative is that the whole trust
99
+ * chain is only ever exercised in CI, which is how it rots.
100
+ *
101
+ * Deliberately NOT a way to weaken production: it can only ADD keys a local
102
+ * operator explicitly pointed at, it is read from an absolute path (a relative
103
+ * one would be attacker-influenced via cwd), and a build that ships with an
104
+ * empty pinned list still refuses to elevate without it.
105
+ */
@@ -0,0 +1,110 @@
1
+ import { type FirstPartyHarnessChannel } from './firstPartyHarnessChannels.js';
2
+ import { type DaemonVersionManifest, type PlatformArtifact, type ReleaseKey } from './releaseManifest.js';
3
+ export { FIRST_PARTY_HARNESS_RELEASE_PUBLIC_KEYS } from './firstPartyHarnessReleaseKeys.js';
4
+ export { firstPartyHarnessFeedBase, firstPartyHarnessFeedCandidates, } from './firstPartyHarnessChannels.js';
5
+ export { firstPartyHarnessManifestFile } from './firstPartyHarness.js';
6
+ export type { ReleaseKey } from './releaseManifest.js';
7
+ export declare const PREVIOUS_SUFFIX = ".previous";
8
+ export declare const PROVENANCE_SUFFIX = ".oversky-provenance.json";
9
+ export declare const MAX_ARTIFACT_BYTES: number;
10
+ export type InstallFailureCode = 'unsupported-platform' | 'feed-unreachable' | 'manifest-malformed' | 'manifest-unverified' | 'artifact-missing' | 'artifact-unverified' | 'download-failed' | 'hash-mismatch' | 'too-large' | 'install-failed' | 'no-pinned-keys' | 'downgrade-refused' | 'version-invalid' | 'lock-busy' | 'minimum-version' | 'policy-rejected';
11
+ export interface InstallResult {
12
+ ok: boolean;
13
+ version?: string;
14
+ platform?: string;
15
+ binaryPath?: string;
16
+ replaced?: boolean;
17
+ changed?: boolean;
18
+ reason?: string;
19
+ code?: InstallFailureCode;
20
+ error?: string;
21
+ }
22
+ export interface InstallOptions {
23
+ env?: NodeJS.ProcessEnv;
24
+ keys?: readonly ReleaseKey[];
25
+ fetchImpl?: typeof fetch;
26
+ platform?: NodeJS.Platform;
27
+ arch?: string;
28
+ onProgress?: (message: string) => void;
29
+ version?: string;
30
+ allowDowngrade?: boolean;
31
+ signal?: AbortSignal;
32
+ manifestTimeoutMs?: number;
33
+ autonomous?: boolean;
34
+ cohortSubject?: string;
35
+ contracts?: Record<string, number>;
36
+ now?: Date;
37
+ }
38
+ export interface HarnessProvenanceRecord {
39
+ version: string;
40
+ platform: string;
41
+ sha256: string;
42
+ url: string;
43
+ sig: string;
44
+ sigs?: PlatformArtifact['sigs'];
45
+ keyId?: string;
46
+ }
47
+ export interface FirstPartyHarnessUpdateState {
48
+ operation: 'install' | 'rollback';
49
+ status: 'running' | 'succeeded' | 'failed';
50
+ attemptedAt: number;
51
+ completedAt?: number;
52
+ targetVersion?: string;
53
+ installedVersion?: string;
54
+ code?: InstallFailureCode;
55
+ error?: string;
56
+ changed?: boolean;
57
+ }
58
+ type InstallFailure = InstallResult & {
59
+ ok: false;
60
+ };
61
+ export declare function firstPartyHarnessInstallDir(env?: NodeJS.ProcessEnv): string;
62
+ export declare function firstPartyHarnessBinaryPath(env?: NodeJS.ProcessEnv): string;
63
+ export declare function firstPartyHarnessPlatformKey(platform?: NodeJS.Platform, arch?: string): string | null;
64
+ export declare function fetchVerifiedManifest(options?: InstallOptions): Promise<{
65
+ ok: true;
66
+ manifest: DaemonVersionManifest;
67
+ } | InstallFailure>;
68
+ export declare function isManagedFirstPartyHarnessReleasePath(binaryPath: string, env?: NodeJS.ProcessEnv): boolean;
69
+ /** Read a single immutable binary/sidecar pair, never two different `current` targets. */
70
+ export declare function getVerifiedInstalledFirstPartyHarness(options?: Pick<InstallOptions, 'env' | 'keys' | 'platform' | 'arch'>): {
71
+ binaryPath: string;
72
+ version: string | null;
73
+ verified: boolean;
74
+ exists: boolean;
75
+ provenance: HarnessProvenanceRecord | null;
76
+ };
77
+ export declare function readFirstPartyHarnessUpdateState(env?: NodeJS.ProcessEnv): FirstPartyHarnessUpdateState | null;
78
+ export interface ActivateFirstPartyHarnessOptions {
79
+ binary: Buffer;
80
+ provenance: HarnessProvenanceRecord;
81
+ env?: NodeJS.ProcessEnv;
82
+ keys?: readonly ReleaseKey[];
83
+ platform?: NodeJS.Platform;
84
+ arch?: string;
85
+ allowDowngrade?: boolean;
86
+ onProgress?: (message: string) => void;
87
+ preserveUnknownInstalled?: boolean;
88
+ preserveExternalLink?: boolean;
89
+ /** Optional already verified signed manifest; retained as minimum-floor evidence. */
90
+ manifest?: DaemonVersionManifest;
91
+ }
92
+ /** Desktop's already-downloaded signed artifact uses the exact same transaction. */
93
+ export declare function activateVerifiedFirstPartyHarnessArtifact(options: ActivateFirstPartyHarnessOptions): InstallResult;
94
+ /** Signed-manifest check reads only; no lock, migration, state writes or login. */
95
+ export declare function checkFirstPartyHarnessUpdate(options?: InstallOptions): Promise<{
96
+ ok: true;
97
+ installedVersion: string | null;
98
+ latestVersion: string;
99
+ channel: FirstPartyHarnessChannel;
100
+ updateAvailable: boolean;
101
+ binaryPath: string;
102
+ owner: 'managed' | 'external';
103
+ installedVerified: boolean;
104
+ minimumVersion: string;
105
+ lastUpdate: FirstPartyHarnessUpdateState | null;
106
+ } | InstallFailure>;
107
+ export declare function installFirstPartyHarness(options?: InstallOptions): Promise<InstallResult>;
108
+ /** Rollback validates the retained immutable release and preserves its signature. */
109
+ export declare function rollbackFirstPartyHarness(env?: NodeJS.ProcessEnv, options?: Pick<InstallOptions, 'keys'>): InstallResult;
110
+ export declare function installedFirstPartyHarnessSize(env?: NodeJS.ProcessEnv): number | null;