@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
@@ -0,0 +1,39 @@
1
+ /** One local update surface; each installation owner still applies its own bytes. */
2
+ export declare const UPDATE_COMPONENTS: readonly ["cli", "code", "daemon"];
3
+ export type UpdateComponent = (typeof UPDATE_COMPONENTS)[number];
4
+ export type UpdateMode = 'check' | 'status' | 'apply';
5
+ export interface ComponentUpdateStatus {
6
+ component: UpdateComponent;
7
+ state: string;
8
+ runningVersion: string | null;
9
+ installedVersion: string | null;
10
+ offeredVersion: string | null;
11
+ owner: string;
12
+ commands: string[];
13
+ autoUpdateEnabled: boolean | null;
14
+ lastAttempt: unknown | null;
15
+ detail: string | null;
16
+ /** The component's full status is retained for machine-readable diagnostics. */
17
+ status: Record<string, unknown>;
18
+ }
19
+ export interface PlatformUpdateOptions {
20
+ mode: UpdateMode;
21
+ component?: UpdateComponent | 'all';
22
+ currentVersion: string;
23
+ baseURL: string;
24
+ restart?: boolean;
25
+ env?: NodeJS.ProcessEnv;
26
+ }
27
+ export interface PlatformUpdateDependencies {
28
+ cli(mode: UpdateMode, options: PlatformUpdateOptions): Promise<unknown>;
29
+ code(mode: UpdateMode, options: PlatformUpdateOptions): Promise<unknown>;
30
+ daemon(mode: UpdateMode, options: PlatformUpdateOptions): Promise<unknown>;
31
+ }
32
+ export declare function normalizeComponentUpdateStatus(component: UpdateComponent, value: unknown): ComponentUpdateStatus;
33
+ export declare function runPlatformUpdate(options: PlatformUpdateOptions, dependencies: PlatformUpdateDependencies): Promise<{
34
+ schemaVersion: 1;
35
+ mode: UpdateMode;
36
+ components: ComponentUpdateStatus[];
37
+ ok: boolean;
38
+ }>;
39
+ export declare function describeComponentUpdate(status: ComponentUpdateStatus): string;
@@ -0,0 +1,84 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.UPDATE_COMPONENTS = void 0;
4
+ exports.normalizeComponentUpdateStatus = normalizeComponentUpdateStatus;
5
+ exports.runPlatformUpdate = runPlatformUpdate;
6
+ exports.describeComponentUpdate = describeComponentUpdate;
7
+ /** One local update surface; each installation owner still applies its own bytes. */
8
+ exports.UPDATE_COMPONENTS = ['cli', 'code', 'daemon'];
9
+ const optionalString = (value) => typeof value === 'string' && value.length > 0 ? value : null;
10
+ function normalizeComponentUpdateStatus(component, value) {
11
+ const raw = value && typeof value === 'object' && !Array.isArray(value)
12
+ ? value
13
+ : {};
14
+ const command = optionalString(raw.command);
15
+ const commands = Array.isArray(raw.commands)
16
+ ? raw.commands.filter((item) => typeof item === 'string')
17
+ : command
18
+ ? [command]
19
+ : [];
20
+ return {
21
+ component,
22
+ state: optionalString(raw.state) ?? 'unknown',
23
+ runningVersion: optionalString(raw.runningVersion),
24
+ installedVersion: optionalString(raw.installedVersion) ?? optionalString(raw.currentVersion),
25
+ offeredVersion: optionalString(raw.offeredVersion) ?? optionalString(raw.latestVersion),
26
+ owner: optionalString(raw.owner) ?? optionalString(raw.installMethod) ?? 'unknown',
27
+ commands,
28
+ autoUpdateEnabled: typeof raw.autoUpdateEnabled === 'boolean'
29
+ ? raw.autoUpdateEnabled
30
+ : typeof raw.autoUpdateAllowed === 'boolean'
31
+ ? raw.autoUpdateAllowed
32
+ : null,
33
+ lastAttempt: raw.lastAttempt ?? raw.transaction ?? null,
34
+ detail: optionalString(raw.detail) ?? optionalString(raw.message),
35
+ status: raw,
36
+ };
37
+ }
38
+ function failedStatus(component, error) {
39
+ return normalizeComponentUpdateStatus(component, {
40
+ state: 'failed',
41
+ message: error instanceof Error ? error.message : String(error),
42
+ });
43
+ }
44
+ async function runPlatformUpdate(options, dependencies) {
45
+ const components = options.component && options.component !== 'all' ? [options.component] : [...exports.UPDATE_COMPONENTS];
46
+ const run = async (component) => {
47
+ try {
48
+ return normalizeComponentUpdateStatus(component, await dependencies[component](options.mode, options));
49
+ }
50
+ catch (error) {
51
+ return failedStatus(component, error);
52
+ }
53
+ };
54
+ // Reads are independent. Writes remain sequential so their results and service
55
+ // restarts are observable, and a failed component never hides the others.
56
+ const statuses = [];
57
+ if (options.mode === 'apply') {
58
+ for (const component of components)
59
+ statuses.push(await run(component));
60
+ }
61
+ else {
62
+ statuses.push(...(await Promise.all(components.map(run))));
63
+ }
64
+ const failureStates = new Set(['failed', 'check-failed', 'update-failed', 'rollback-failed']);
65
+ return {
66
+ schemaVersion: 1,
67
+ mode: options.mode,
68
+ components: statuses,
69
+ ok: statuses.every((item) => !failureStates.has(item.state)),
70
+ };
71
+ }
72
+ function describeComponentUpdate(status) {
73
+ const versions = [
74
+ `running ${status.runningVersion ?? '—'}`,
75
+ `installed ${status.installedVersion ?? 'unknown'}`,
76
+ `offered ${status.offeredVersion ?? 'unknown'}`,
77
+ ].join(' · ');
78
+ return [
79
+ `${status.component}: ${status.state} (${status.owner})`,
80
+ ` ${versions}`,
81
+ ...(status.detail ? [` ${status.detail}`] : []),
82
+ ...status.commands.map((command) => ` ${command}`),
83
+ ].join('\n');
84
+ }
@@ -0,0 +1,2 @@
1
+ /** An old profile may still share the default machine row and its device pin. */
2
+ export declare function legacyProfileSharesDefaultMachine(): boolean;
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.legacyProfileSharesDefaultMachine = legacyProfileSharesDefaultMachine;
4
+ const machine_uuid_1 = require("@skrr-ai/auth-core/machine-uuid");
5
+ const keychain_1 = require("./keychain");
6
+ /** An old profile may still share the default machine row and its device pin. */
7
+ function legacyProfileSharesDefaultMachine() {
8
+ const profile = (0, keychain_1.getActiveProfile)();
9
+ return (!!profile &&
10
+ profile !== 'default' &&
11
+ !(0, machine_uuid_1.hostedRuntimeIdOverride)('OVERSKY_MACHINE_UUID') &&
12
+ (0, machine_uuid_1.getMachineUuid)() === (0, machine_uuid_1.getHardwareMachineUuid)());
13
+ }
@@ -7,6 +7,7 @@
7
7
  */
8
8
  export declare function prompt(question: string, opts?: {
9
9
  hidden?: boolean;
10
+ output?: NodeJS.WritableStream;
10
11
  }): Promise<string>;
11
12
  /**
12
13
  * Ask a yes/no question and return the user's answer.
@@ -52,10 +52,11 @@ const readline = __importStar(require("node:readline"));
52
52
  */
53
53
  function prompt(question, opts = {}) {
54
54
  const hidden = opts.hidden ?? false;
55
+ const output = opts.output ?? process.stdout;
55
56
  return new Promise((resolve) => {
56
57
  const rl = readline.createInterface({
57
58
  input: process.stdin,
58
- output: process.stdout,
59
+ output,
59
60
  });
60
61
  if (hidden) {
61
62
  const rlAny = rl;
@@ -65,12 +66,12 @@ function prompt(question, opts = {}) {
65
66
  rlAny.output.write(char);
66
67
  }
67
68
  };
68
- process.stdout.write(question);
69
+ output.write(question);
69
70
  }
70
71
  rl.question(hidden ? '' : question, (answer) => {
71
72
  rl.close();
72
73
  if (hidden)
73
- process.stdout.write('\n');
74
+ output.write('\n');
74
75
  resolve(answer.trim());
75
76
  });
76
77
  });
@@ -0,0 +1,19 @@
1
+ import type { ProposalDecision } from '@skrr-ai/data-provider';
2
+ import { BaseCommand } from '../base-command';
3
+ /** The caller supplies the revision from show/list. Fetching a NEW card just
4
+ * before an old decision would approve content the caller never reviewed. */
5
+ export declare abstract class ProposalDecisionCommand extends BaseCommand {
6
+ static decision: ProposalDecision;
7
+ static args: {
8
+ kind: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
9
+ id: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
10
+ };
11
+ static flags: {
12
+ json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
13
+ expected: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
14
+ reason: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
15
+ 'reason-code': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
16
+ until: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
17
+ };
18
+ run(): Promise<void>;
19
+ }
@@ -0,0 +1,64 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ProposalDecisionCommand = void 0;
4
+ const core_1 = require("@oclif/core");
5
+ const data_provider_1 = require("@skrr-ai/data-provider");
6
+ const base_command_1 = require("../base-command");
7
+ const proposals_1 = require("./proposals");
8
+ /** The caller supplies the revision from show/list. Fetching a NEW card just
9
+ * before an old decision would approve content the caller never reviewed. */
10
+ class ProposalDecisionCommand extends base_command_1.BaseCommand {
11
+ static decision;
12
+ static args = {
13
+ kind: core_1.Args.string({ required: true, options: [...data_provider_1.PROPOSAL_KINDS], ignoreStdin: true }),
14
+ id: core_1.Args.string({ required: true, ignoreStdin: true }),
15
+ };
16
+ static flags = {
17
+ json: core_1.Flags.boolean(),
18
+ expected: core_1.Flags.string({
19
+ required: true,
20
+ description: 'Exact revision JSON from proposals show/list',
21
+ }),
22
+ reason: core_1.Flags.string(),
23
+ 'reason-code': core_1.Flags.string({ options: [...data_provider_1.PROPOSAL_DISCARD_REASON_CODES] }),
24
+ until: core_1.Flags.string({ description: 'Snooze-until ISO timestamp' }),
25
+ };
26
+ async run() {
27
+ this.requireAuth();
28
+ const { args, flags } = await this.parse(this.constructor);
29
+ let expected;
30
+ try {
31
+ expected = JSON.parse(flags.expected);
32
+ }
33
+ catch {
34
+ this.error('--expected must be revision JSON from the reviewed proposal.');
35
+ }
36
+ const decision = this.constructor.decision;
37
+ if (decision === 'snooze' && !flags.until)
38
+ this.error('Snooze requires --until.');
39
+ if (decision === 'snooze') {
40
+ const until = Date.parse(flags.until);
41
+ if (Number.isNaN(until))
42
+ this.error('--until must be an ISO timestamp.');
43
+ if (until < Date.now() + data_provider_1.PROPOSAL_SNOOZE_MIN_SECONDS * 1000)
44
+ this.error('--until must be at least a minute from now.');
45
+ if (until > Date.now() + data_provider_1.PROPOSAL_SNOOZE_MAX_DAYS * 86400000)
46
+ this.error(`--until may be at most ${data_provider_1.PROPOSAL_SNOOZE_MAX_DAYS} days ahead.`);
47
+ }
48
+ let result;
49
+ try {
50
+ result = await proposals_1.proposalApi.decide(args.kind, args.id, {
51
+ decision,
52
+ expected,
53
+ reason: flags.reason,
54
+ reasonCode: flags['reason-code'],
55
+ snoozedUntil: flags.until,
56
+ });
57
+ }
58
+ catch (error) {
59
+ this.handleApiError(error);
60
+ }
61
+ this.log(flags.json ? JSON.stringify(result, null, 2) : `Proposal ${decision} decision recorded.`);
62
+ }
63
+ }
64
+ exports.ProposalDecisionCommand = ProposalDecisionCommand;
@@ -0,0 +1,8 @@
1
+ import type { ProposalDecisionParams, ProposalDecisionResponse, ProposalKind, ProposalListParams, ProposalListResponse, ProposalView } from '@skrr-ai/data-provider';
2
+ /** The unified, read-time proposal inbox. Decisions are routed by the server to
3
+ * each family's own writer; the CLI never writes a source row. */
4
+ export declare const proposalApi: {
5
+ list(params?: ProposalListParams): Promise<ProposalListResponse>;
6
+ show(kind: ProposalKind, id: string): Promise<ProposalView>;
7
+ decide(kind: ProposalKind, id: string, input: ProposalDecisionParams): Promise<ProposalDecisionResponse>;
8
+ };
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.proposalApi = void 0;
4
+ const data_provider_1 = require("@skrr-ai/data-provider");
5
+ const triggers_1 = require("./triggers");
6
+ const MOUNT = '/api/proposals';
7
+ /** The unified, read-time proposal inbox. Decisions are routed by the server to
8
+ * each family's own writer; the CLI never writes a source row. */
9
+ exports.proposalApi = {
10
+ list(params = {}) {
11
+ return data_provider_1.request.get((0, triggers_1.withQuery)(MOUNT, { ...params }));
12
+ },
13
+ show(kind, id) {
14
+ return data_provider_1.request.get(`${MOUNT}/${encodeURIComponent(kind)}/${encodeURIComponent(id)}`);
15
+ },
16
+ decide(kind, id, input) {
17
+ return data_provider_1.request.post(`${MOUNT}/${encodeURIComponent(kind)}/${encodeURIComponent(id)}/decision`, {
18
+ ...input,
19
+ via: 'cli',
20
+ });
21
+ },
22
+ };
@@ -1,4 +1,4 @@
1
- import type { InstalledRole, RolePlanPreview, RoleInstallation, AgentOperatingPlan } from '@skrr-ai/data-provider';
1
+ import type { InstalledRole, RoleOperatingSpec, RolePlanPreview, RoleInstallation, AgentOperatingPlan } from '@skrr-ai/data-provider';
2
2
  export declare const roleBase: (agentId: string) => string;
3
3
  export declare const roleApi: {
4
4
  list: (id: string) => Promise<{
@@ -13,10 +13,10 @@ export declare const roleApi: {
13
13
  }>;
14
14
  };
15
15
  }>;
16
- preview: (id: string, spec: unknown, contextBindings?: unknown) => Promise<RolePlanPreview>;
17
- install: (id: string, preview: RolePlanPreview) => Promise<RoleInstallation>;
16
+ preview: (id: string, spec: unknown, contextBindings?: unknown, parameterValues?: unknown, endpointBindings?: unknown) => Promise<RolePlanPreview>;
17
+ install: (id: string, preview: RolePlanPreview, confirmRuleConflicts?: string[]) => Promise<RoleInstallation>;
18
18
  export: (id: string, key: string) => Promise<{
19
- kind: "oversky.role-operating-spec";
19
+ kind: "role-operating-spec" | "oversky.role-operating-spec";
20
20
  schemaVersion: 1;
21
21
  key: string;
22
22
  revision: number;
@@ -49,11 +49,11 @@ export declare const roleApi: {
49
49
  successCriteria: {
50
50
  id: string;
51
51
  label: string;
52
- evaluator?: "manual" | "metric" | "source_state" | "task_state" | "goal_state" | "llm_review" | undefined;
52
+ evaluator?: "manual" | "task_state" | "goal_state" | "metric" | "llm_review" | "source_state" | undefined;
53
53
  config?: Record<string, unknown> | undefined;
54
54
  }[];
55
55
  sources: {
56
- source: "space" | "tasks" | "email" | "goal" | "files" | "local" | "daemon" | "browser" | "conversations" | "memory" | "slack" | "github" | "messages" | "metrics" | "monitor" | "agent_initiatives" | "docs" | "documents" | "calendar" | "product_metrics" | "business_metrics" | "state_monitor" | "agent_run";
56
+ source: "space" | "tasks" | "email" | "goal" | "files" | "local" | "daemon" | "browser" | "conversations" | "slack" | "memory" | "github" | "messages" | "calendar" | "docs" | "metrics" | "agent_run" | "agent_initiatives" | "documents" | "product_metrics" | "business_metrics" | "state_monitor" | "monitor";
57
57
  enabled: boolean;
58
58
  config?: Record<string, unknown> | undefined;
59
59
  }[];
@@ -81,7 +81,47 @@ export declare const roleApi: {
81
81
  roles: ("home" | "delivery" | "watch" | "advance")[];
82
82
  }[];
83
83
  directive?: string | undefined;
84
+ subject?: {
85
+ type: string;
86
+ externalKey: string;
87
+ label?: string | undefined;
88
+ } | undefined;
89
+ governance?: {
90
+ quietHours?: {
91
+ enabled: boolean;
92
+ start?: string | undefined;
93
+ end?: string | undefined;
94
+ timezone?: string | undefined;
95
+ } | undefined;
96
+ nudges?: {
97
+ maxPerDay?: number | null | undefined;
98
+ minIntervalMs?: number | undefined;
99
+ } | undefined;
100
+ attention?: {
101
+ severityLoudness?: {
102
+ low?: "standard" | "quiet" | "loud" | undefined;
103
+ medium?: "standard" | "quiet" | "loud" | undefined;
104
+ high?: "standard" | "quiet" | "loud" | undefined;
105
+ } | undefined;
106
+ escalation?: {
107
+ minimumSeverity?: "low" | "medium" | "high" | undefined;
108
+ channel?: "push" | "none" | "email" | "cli" | "app" | "slack" | undefined;
109
+ } | undefined;
110
+ noReply?: {
111
+ enabled?: boolean | undefined;
112
+ afterNudges?: number | undefined;
113
+ } | undefined;
114
+ } | undefined;
115
+ proactiveMessaging?: {
116
+ posture: "quiet" | "agent_discretion" | "first_material_blocker" | "high_visibility";
117
+ } | undefined;
118
+ } | undefined;
119
+ reports?: {
120
+ slot: string;
121
+ on: "completion" | "escalation" | "material_change" | "every_check";
122
+ }[] | undefined;
84
123
  deadlineAt?: string | undefined;
124
+ taskReviewPolicy?: "none" | "required" | undefined;
85
125
  freshness?: {
86
126
  staleAfterMs?: number | undefined;
87
127
  blockedAfterMs?: number | undefined;
@@ -90,9 +130,104 @@ export declare const roleApi: {
90
130
  evaluationPolicy?: Record<string, unknown> | undefined;
91
131
  learningPolicy?: Record<string, unknown> | undefined;
92
132
  }[];
133
+ rules?: ({
134
+ kind: "text_required";
135
+ text: string;
136
+ effect: "append";
137
+ id: string;
138
+ status: "active" | "proposed" | "retired";
139
+ reason?: string | undefined;
140
+ source?: {
141
+ kind: "owner" | "role_spec" | "correction";
142
+ ref?: {
143
+ conversationId: string;
144
+ messageId: string;
145
+ } | undefined;
146
+ } | undefined;
147
+ createdAt?: string | undefined;
148
+ createdBy?: string | undefined;
149
+ } | {
150
+ kind: "text_forbidden";
151
+ phrases: string[];
152
+ effect: "refuse" | "require_approval";
153
+ id: string;
154
+ status: "active" | "proposed" | "retired";
155
+ reason?: string | undefined;
156
+ source?: {
157
+ kind: "owner" | "role_spec" | "correction";
158
+ ref?: {
159
+ conversationId: string;
160
+ messageId: string;
161
+ } | undefined;
162
+ } | undefined;
163
+ createdAt?: string | undefined;
164
+ createdBy?: string | undefined;
165
+ })[] | undefined;
166
+ governance?: {
167
+ quietHours?: {
168
+ enabled: boolean;
169
+ start?: string | undefined;
170
+ end?: string | undefined;
171
+ timezone?: string | undefined;
172
+ } | undefined;
173
+ nudges?: {
174
+ maxPerDay?: number | null | undefined;
175
+ minIntervalMs?: number | undefined;
176
+ } | undefined;
177
+ attention?: {
178
+ severityLoudness?: {
179
+ low?: "standard" | "quiet" | "loud" | undefined;
180
+ medium?: "standard" | "quiet" | "loud" | undefined;
181
+ high?: "standard" | "quiet" | "loud" | undefined;
182
+ } | undefined;
183
+ escalation?: {
184
+ minimumSeverity?: "low" | "medium" | "high" | undefined;
185
+ channel?: "push" | "none" | "email" | "cli" | "app" | "slack" | undefined;
186
+ } | undefined;
187
+ noReply?: {
188
+ enabled?: boolean | undefined;
189
+ afterNudges?: number | undefined;
190
+ } | undefined;
191
+ } | undefined;
192
+ proactiveMessaging?: {
193
+ posture: "quiet" | "agent_discretion" | "first_material_blocker" | "high_visibility";
194
+ } | undefined;
195
+ } | undefined;
196
+ parameters?: {
197
+ key: string;
198
+ label: string;
199
+ type: "string" | "number" | "boolean" | "enum" | "string_list";
200
+ required: boolean;
201
+ default?: unknown;
202
+ options?: string[] | undefined;
203
+ maxLength?: number | undefined;
204
+ min?: number | undefined;
205
+ max?: number | undefined;
206
+ maxItems?: number | undefined;
207
+ }[] | undefined;
208
+ endpointSlots?: {
209
+ key: string;
210
+ label: string;
211
+ required: boolean;
212
+ destinations: ("app_owner_dm" | "slack_owner_dm" | "slack_channel")[];
213
+ }[] | undefined;
93
214
  }>;
94
215
  withdraw: (id: string, key: string, expectedCompassVersion: number) => Promise<RoleInstallation>;
95
216
  plan: (id: string) => Promise<AgentOperatingPlan>;
217
+ capture: (id: string, input: {
218
+ key: string;
219
+ title: string;
220
+ compassId?: string;
221
+ commitmentIds: string[];
222
+ }) => Promise<{
223
+ spec: RoleOperatingSpec;
224
+ omitted: Array<{
225
+ responsibilityKey?: string;
226
+ field: string;
227
+ reason: string;
228
+ }>;
229
+ prerequisites: string[];
230
+ }>;
96
231
  };
97
232
  export declare function readRoleJson(file: string): unknown;
98
233
  export declare function assertRolePreview(value: unknown): asserts value is RolePlanPreview;
package/dist/lib/roles.js CHANGED
@@ -9,23 +9,29 @@ const roleBase = (agentId) => `/api/agents/${encodeURIComponent(agentId)}`;
9
9
  exports.roleBase = roleBase;
10
10
  exports.roleApi = {
11
11
  list: (id) => data_provider_1.request.get(`${(0, exports.roleBase)(id)}/roles`),
12
- preview: (id, spec, contextBindings = {}) => data_provider_1.request.post(`${(0, exports.roleBase)(id)}/roles/preview`, {
12
+ preview: (id, spec, contextBindings = {}, parameterValues = {}, endpointBindings = {}) => data_provider_1.request.post(`${(0, exports.roleBase)(id)}/roles/preview`, {
13
13
  spec,
14
14
  contextBindings,
15
+ parameterValues,
16
+ endpointBindings,
15
17
  }),
16
- install: (id, preview) => data_provider_1.request.post(`${(0, exports.roleBase)(id)}/roles/install`, {
18
+ install: (id, preview, confirmRuleConflicts = []) => data_provider_1.request.post(`${(0, exports.roleBase)(id)}/roles/install`, {
17
19
  spec: preview.spec,
18
20
  fingerprint: preview.fingerprint,
19
21
  reviewFingerprint: preview.reviewFingerprint,
20
22
  expectedCompassVersion: preview.expectedCompassVersion,
21
23
  expectedVersions: preview.expectedVersions,
22
24
  contextBindings: preview.contextBindings || {},
25
+ parameterValues: preview.parameterValues || {},
26
+ endpointBindings: preview.endpointBindings || {},
27
+ ...(confirmRuleConflicts.length ? { confirmRuleConflicts } : {}),
23
28
  }),
24
29
  export: (id, key) => data_provider_1.request.get(`${(0, exports.roleBase)(id)}/roles/${encodeURIComponent(key)}/export`),
25
30
  withdraw: (id, key, expectedCompassVersion) => data_provider_1.request.post(`${(0, exports.roleBase)(id)}/roles/${encodeURIComponent(key)}/withdraw`, {
26
31
  expectedCompassVersion,
27
32
  }),
28
33
  plan: (id) => data_provider_1.request.get(`${(0, exports.roleBase)(id)}/operating-plan`),
34
+ capture: (id, input) => data_provider_1.request.post(`${(0, exports.roleBase)(id)}/roles/capture`, input),
29
35
  };
30
36
  function readRoleJson(file) {
31
37
  return JSON.parse((0, node_fs_1.readFileSync)(file, 'utf8'));
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Secret-free Signal lifecycle (`/api/signal-monitors`, read-only sources and schemas).
3
+ * Source creation, credentials and schema review hand out one-display secrets and stay
4
+ * in the reviewed UI until a headless secret-display contract is approved.
5
+ */
6
+ export declare const signalsApi: {
7
+ listMonitors: () => Promise<unknown>;
8
+ showMonitor: (id: string) => Promise<unknown>;
9
+ validateMonitor: (body: unknown) => Promise<any>;
10
+ createMonitor: (body: unknown) => Promise<any>;
11
+ testMonitor: (id: string, body: unknown) => Promise<any>;
12
+ reviseMonitor: (id: string, body: unknown) => Promise<any>;
13
+ setMonitorStatus: (id: string, status: "active" | "paused") => Promise<any>;
14
+ monitorTransitions: (id: string) => Promise<unknown>;
15
+ listSources: () => Promise<unknown>;
16
+ showSource: (id: string) => Promise<unknown>;
17
+ sourceReceipts: (id: string) => Promise<unknown>;
18
+ listSchemas: () => Promise<unknown>;
19
+ showSchema: (id: string) => Promise<unknown>;
20
+ };
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.signalsApi = void 0;
4
+ const data_provider_1 = require("@skrr-ai/data-provider");
5
+ /**
6
+ * Secret-free Signal lifecycle (`/api/signal-monitors`, read-only sources and schemas).
7
+ * Source creation, credentials and schema review hand out one-display secrets and stay
8
+ * in the reviewed UI until a headless secret-display contract is approved.
9
+ */
10
+ exports.signalsApi = {
11
+ listMonitors: () => data_provider_1.request.get('/api/signal-monitors'),
12
+ showMonitor: (id) => data_provider_1.request.get(`/api/signal-monitors/${encodeURIComponent(id)}`),
13
+ validateMonitor: (body) => data_provider_1.request.post('/api/signal-monitors/validate', body),
14
+ createMonitor: (body) => data_provider_1.request.post('/api/signal-monitors', body),
15
+ testMonitor: (id, body) => data_provider_1.request.post(`/api/signal-monitors/${encodeURIComponent(id)}/test`, body),
16
+ reviseMonitor: (id, body) => data_provider_1.request.post(`/api/signal-monitors/${encodeURIComponent(id)}/revisions`, body),
17
+ setMonitorStatus: (id, status) => data_provider_1.request.patch(`/api/signal-monitors/${encodeURIComponent(id)}`, { status }),
18
+ monitorTransitions: (id) => data_provider_1.request.get(`/api/signal-monitors/${encodeURIComponent(id)}/transitions`),
19
+ listSources: () => data_provider_1.request.get('/api/signal-sources'),
20
+ showSource: (id) => data_provider_1.request.get(`/api/signal-sources/${encodeURIComponent(id)}`),
21
+ sourceReceipts: (id) => data_provider_1.request.get(`/api/signal-sources/${encodeURIComponent(id)}/receipts`),
22
+ listSchemas: () => data_provider_1.request.get('/api/signal-schemas'),
23
+ showSchema: (id) => data_provider_1.request.get(`/api/signal-schemas/${encodeURIComponent(id)}`),
24
+ };
@@ -0,0 +1,3 @@
1
+ import { type SpendSummary } from '@skrr-ai/data-provider';
2
+ export declare const getSpaceUsage: (spaceId: string, window?: string) => Promise<SpendSummary>;
3
+ export declare function formatSpaceSpend(summary: SpendSummary): string;
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getSpaceUsage = void 0;
4
+ exports.formatSpaceSpend = formatSpaceSpend;
5
+ const data_provider_1 = require("@skrr-ai/data-provider");
6
+ const getSpaceUsage = (spaceId, window = '30d') => data_provider_1.dataService.getSpaceUsage(spaceId, window);
7
+ exports.getSpaceUsage = getSpaceUsage;
8
+ /** A positive amount under one cent must not print as $0.00; a measured zero stays $0.00. */
9
+ const usd = (amount) => amount > 0 && amount < 0.01 ? '<$0.01' : `$${amount.toFixed(2)}`;
10
+ function formatSpaceSpend(summary) {
11
+ const attribution = `Attribution since: ${summary.coverage.attributionSince || 'not certified'}; not attributed: ${summary.coverage.notAttributed.join(', ')}`;
12
+ if (summary.runCount === 0)
13
+ return `No runs in window\n${attribution}`;
14
+ const cost = summary.costUsd === null ? 'Not fully attributed' : usd(summary.costUsd);
15
+ const known = summary.knownCostUsd === null ? 'unavailable' : usd(summary.knownCostUsd);
16
+ return `${cost}; known subtotal ${known}; ${summary.runCount} cost records; ${summary.byCostStatus.unavailable} unavailable, ${summary.byCostStatus.partial} partial\n${attribution}`;
17
+ }
@@ -0,0 +1,4 @@
1
+ import type { WorkspaceGrantReport, WorkspaceStewardshipReport } from './workspaces';
2
+ export declare function printStewardshipCoverage(report: WorkspaceGrantReport, log: (line: string) => void): void;
3
+ export declare function printWorkspaceGrants(report: WorkspaceGrantReport, log: (line: string) => void): void;
4
+ export declare function printWorkspaceStewardship(report: WorkspaceStewardshipReport, log: (line: string) => void): void;