@skrr-ai/cli 0.1.47 → 0.1.48

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 (274) hide show
  1. package/README.md +1 -1
  2. package/dist/base-command.d.ts +18 -0
  3. package/dist/base-command.js +61 -1
  4. package/dist/commands/agents/chat.d.ts +21 -0
  5. package/dist/commands/agents/chat.js +26 -9
  6. package/dist/commands/balance/usage/breakdown.d.ts +14 -0
  7. package/dist/commands/balance/usage/breakdown.js +68 -0
  8. package/dist/commands/balance/usage.js +24 -0
  9. package/dist/commands/commerce/entitlements/explain.d.ts +22 -0
  10. package/dist/commands/commerce/entitlements/explain.js +40 -0
  11. package/dist/commands/commerce/incidents/audit.d.ts +20 -0
  12. package/dist/commands/commerce/incidents/audit.js +37 -0
  13. package/dist/commands/commerce/incidents/list.d.ts +22 -0
  14. package/dist/commands/commerce/incidents/list.js +49 -0
  15. package/dist/commands/commerce/incidents/resolve.d.ts +23 -0
  16. package/dist/commands/commerce/incidents/resolve.js +45 -0
  17. package/dist/commands/commerce/incidents/retry.d.ts +22 -0
  18. package/dist/commands/commerce/incidents/retry.js +45 -0
  19. package/dist/commands/commerce/incidents/show.d.ts +13 -0
  20. package/dist/commands/commerce/incidents/show.js +30 -0
  21. package/dist/commands/commerce/offers/approve.d.ts +17 -0
  22. package/dist/commands/commerce/offers/approve.js +33 -0
  23. package/dist/commands/commerce/offers/create.d.ts +18 -0
  24. package/dist/commands/commerce/offers/create.js +34 -0
  25. package/dist/commands/commerce/offers/publish.d.ts +13 -0
  26. package/dist/commands/commerce/offers/publish.js +28 -0
  27. package/dist/commands/commerce/offers/retire.d.ts +17 -0
  28. package/dist/commands/commerce/offers/retire.js +32 -0
  29. package/dist/commands/commerce/offers/validate.d.ts +18 -0
  30. package/dist/commands/commerce/offers/validate.js +33 -0
  31. package/dist/commands/commerce/products/create.d.ts +10 -0
  32. package/dist/commands/commerce/products/create.js +25 -0
  33. package/dist/commands/commerce/promotions/redeem.d.ts +13 -0
  34. package/dist/commands/commerce/promotions/redeem.js +32 -0
  35. package/dist/commands/commerce/terms/accept.d.ts +18 -0
  36. package/dist/commands/commerce/terms/accept.js +39 -0
  37. package/dist/commands/commerce/terms/show.d.ts +10 -0
  38. package/dist/commands/commerce/terms/show.js +34 -0
  39. package/dist/commands/commerce/trials/conversion-preview.d.ts +18 -0
  40. package/dist/commands/commerce/trials/conversion-preview.js +39 -0
  41. package/dist/commands/commerce/trials/start.d.ts +23 -0
  42. package/dist/commands/commerce/trials/start.js +58 -0
  43. package/dist/commands/commitments/accounting.d.ts +39 -0
  44. package/dist/commands/commitments/accounting.js +116 -0
  45. package/dist/commands/commitments/action-history.d.ts +1 -0
  46. package/dist/commands/commitments/action-history.js +8 -1
  47. package/dist/commands/commitments/case.d.ts +1 -0
  48. package/dist/commands/commitments/case.js +19 -3
  49. package/dist/commands/commitments/cases.d.ts +1 -0
  50. package/dist/commands/commitments/cases.js +11 -1
  51. package/dist/commands/commitments/checks.d.ts +1 -0
  52. package/dist/commands/commitments/checks.js +5 -1
  53. package/dist/commands/commitments/cost.d.ts +62 -0
  54. package/dist/commands/commitments/cost.js +130 -0
  55. package/dist/commands/commitments/create.js +1 -1
  56. package/dist/commands/commitments/delete.d.ts +1 -0
  57. package/dist/commands/commitments/delete.js +56 -6
  58. package/dist/commands/commitments/feedback.js +9 -1
  59. package/dist/commands/commitments/handover.js +16 -0
  60. package/dist/commands/commitments/hypotheses.d.ts +1 -0
  61. package/dist/commands/commitments/hypotheses.js +17 -2
  62. package/dist/commands/commitments/links/list.js +4 -1
  63. package/dist/commands/commitments/liveness.d.ts +18 -0
  64. package/dist/commands/commitments/liveness.js +80 -0
  65. package/dist/commands/commitments/metrics.d.ts +1 -0
  66. package/dist/commands/commitments/metrics.js +8 -1
  67. package/dist/commands/commitments/next-tick.d.ts +39 -0
  68. package/dist/commands/commitments/next-tick.js +122 -0
  69. package/dist/commands/commitments/observations.d.ts +1 -0
  70. package/dist/commands/commitments/observations.js +19 -2
  71. package/dist/commands/commitments/pause.js +12 -0
  72. package/dist/commands/commitments/receipt.d.ts +2 -0
  73. package/dist/commands/commitments/receipt.js +16 -2
  74. package/dist/commands/commitments/remediation-proposal.js +6 -2
  75. package/dist/commands/commitments/remediation-proposals.js +5 -1
  76. package/dist/commands/commitments/restore.d.ts +25 -0
  77. package/dist/commands/commitments/restore.js +46 -0
  78. package/dist/commands/commitments/show.js +32 -0
  79. package/dist/commands/commitments/trigger-status.js +33 -0
  80. package/dist/commands/commitments/update.d.ts +1 -0
  81. package/dist/commands/commitments/update.js +31 -5
  82. package/dist/commands/commitments/wake-capabilities.d.ts +0 -1
  83. package/dist/commands/commitments/wake-capabilities.js +8 -4
  84. package/dist/commands/enterprise/budgets/create.d.ts +11 -0
  85. package/dist/commands/enterprise/budgets/create.js +27 -0
  86. package/dist/commands/enterprise/budgets/evaluate.d.ts +17 -0
  87. package/dist/commands/enterprise/budgets/evaluate.js +32 -0
  88. package/dist/commands/enterprise/budgets/publish.d.ts +14 -0
  89. package/dist/commands/enterprise/budgets/publish.js +30 -0
  90. package/dist/commands/enterprise/contracts/activate.d.ts +14 -0
  91. package/dist/commands/enterprise/contracts/activate.js +30 -0
  92. package/dist/commands/enterprise/contracts/create.d.ts +14 -0
  93. package/dist/commands/enterprise/contracts/create.js +32 -0
  94. package/dist/commands/enterprise/contracts/issue.d.ts +18 -0
  95. package/dist/commands/enterprise/contracts/issue.js +34 -0
  96. package/dist/commands/enterprise/domains/begin.d.ts +20 -0
  97. package/dist/commands/enterprise/domains/begin.js +39 -0
  98. package/dist/commands/enterprise/domains/verify.d.ts +14 -0
  99. package/dist/commands/enterprise/domains/verify.js +32 -0
  100. package/dist/commands/enterprise/external-config/activate.d.ts +22 -0
  101. package/dist/commands/enterprise/external-config/activate.js +49 -0
  102. package/dist/commands/enterprise/external-config/set.d.ts +25 -0
  103. package/dist/commands/enterprise/external-config/set.js +123 -0
  104. package/dist/commands/enterprise/external-config/show.d.ts +12 -0
  105. package/dist/commands/enterprise/external-config/show.js +39 -0
  106. package/dist/commands/enterprise/external-config/suspend.d.ts +13 -0
  107. package/dist/commands/enterprise/external-config/suspend.js +41 -0
  108. package/dist/commands/enterprise/finance/close-snapshot.d.ts +11 -0
  109. package/dist/commands/enterprise/finance/close-snapshot.js +28 -0
  110. package/dist/commands/enterprise/finance/record-document.d.ts +18 -0
  111. package/dist/commands/enterprise/finance/record-document.js +35 -0
  112. package/dist/commands/enterprise/profile.d.ts +20 -0
  113. package/dist/commands/enterprise/profile.js +38 -0
  114. package/dist/commands/login.d.ts +13 -0
  115. package/dist/commands/login.js +77 -0
  116. package/dist/commands/machines/dedicated/index.js +3 -0
  117. package/dist/commands/machines/dedicated/service/apply.d.ts +23 -0
  118. package/dist/commands/machines/dedicated/service/apply.js +99 -0
  119. package/dist/commands/machines/dedicated/service/approve.d.ts +23 -0
  120. package/dist/commands/machines/dedicated/service/approve.js +52 -0
  121. package/dist/commands/machines/dedicated/service/create.d.ts +55 -0
  122. package/dist/commands/machines/dedicated/service/create.js +222 -0
  123. package/dist/commands/machines/dedicated/service/edit.d.ts +30 -0
  124. package/dist/commands/machines/dedicated/service/edit.js +146 -0
  125. package/dist/commands/machines/dedicated/service/exec.d.ts +26 -0
  126. package/dist/commands/machines/dedicated/service/exec.js +92 -0
  127. package/dist/commands/machines/dedicated/service/export.d.ts +29 -0
  128. package/dist/commands/machines/dedicated/service/export.js +106 -0
  129. package/dist/commands/machines/dedicated/service/index.d.ts +14 -0
  130. package/dist/commands/machines/dedicated/service/index.js +49 -0
  131. package/dist/commands/machines/dedicated/service/logs.d.ts +33 -0
  132. package/dist/commands/machines/dedicated/service/logs.js +148 -0
  133. package/dist/commands/machines/dedicated/service/ls.d.ts +20 -0
  134. package/dist/commands/machines/dedicated/service/ls.js +80 -0
  135. package/dist/commands/machines/dedicated/service/restart.d.ts +14 -0
  136. package/dist/commands/machines/dedicated/service/restart.js +29 -0
  137. package/dist/commands/machines/dedicated/service/rm.d.ts +20 -0
  138. package/dist/commands/machines/dedicated/service/rm.js +33 -0
  139. package/dist/commands/machines/dedicated/service/secret/index.d.ts +14 -0
  140. package/dist/commands/machines/dedicated/service/secret/index.js +25 -0
  141. package/dist/commands/machines/dedicated/service/secret/rm.d.ts +22 -0
  142. package/dist/commands/machines/dedicated/service/secret/rm.js +54 -0
  143. package/dist/commands/machines/dedicated/service/secret/set.d.ts +22 -0
  144. package/dist/commands/machines/dedicated/service/secret/set.js +93 -0
  145. package/dist/commands/machines/dedicated/service/start.d.ts +14 -0
  146. package/dist/commands/machines/dedicated/service/start.js +29 -0
  147. package/dist/commands/machines/dedicated/service/status.d.ts +21 -0
  148. package/dist/commands/machines/dedicated/service/status.js +85 -0
  149. package/dist/commands/machines/dedicated/service/stop.d.ts +20 -0
  150. package/dist/commands/machines/dedicated/service/stop.js +35 -0
  151. package/dist/commands/machines/dedicated/service/top.d.ts +22 -0
  152. package/dist/commands/machines/dedicated/service/top.js +120 -0
  153. package/dist/commands/machines/dedicated/sign-in-status.d.ts +22 -0
  154. package/dist/commands/machines/dedicated/sign-in-status.js +79 -0
  155. package/dist/commands/machines/dedicated/ssh-config.d.ts +28 -0
  156. package/dist/commands/machines/dedicated/ssh-config.js +66 -0
  157. package/dist/commands/machines/dedicated/ssh-proxy.d.ts +22 -0
  158. package/dist/commands/machines/dedicated/ssh-proxy.js +62 -0
  159. package/dist/commands/machines/dedicated/ssh.d.ts +29 -0
  160. package/dist/commands/machines/dedicated/ssh.js +121 -0
  161. package/dist/commands/native/allow-all.d.ts +14 -0
  162. package/dist/commands/native/allow-all.js +25 -0
  163. package/dist/commands/native/allow.d.ts +24 -0
  164. package/dist/commands/native/allow.js +45 -0
  165. package/dist/commands/native/deny.d.ts +24 -0
  166. package/dist/commands/native/deny.js +43 -0
  167. package/dist/commands/native/disable.d.ts +17 -0
  168. package/dist/commands/native/disable.js +28 -0
  169. package/dist/commands/native/enable.d.ts +12 -0
  170. package/dist/commands/native/enable.js +29 -0
  171. package/dist/commands/native/list-apps.d.ts +19 -0
  172. package/dist/commands/native/list-apps.js +30 -0
  173. package/dist/commands/native/restrict-to.d.ts +22 -0
  174. package/dist/commands/native/restrict-to.js +41 -0
  175. package/dist/commands/native/status.d.ts +19 -0
  176. package/dist/commands/native/status.js +33 -0
  177. package/dist/commands/native.d.ts +39 -0
  178. package/dist/commands/native.js +76 -0
  179. package/dist/commands/service/index.d.ts +14 -0
  180. package/dist/commands/service/index.js +31 -0
  181. package/dist/commands/service/logs.d.ts +18 -0
  182. package/dist/commands/service/logs.js +53 -0
  183. package/dist/commands/service/ls.d.ts +13 -0
  184. package/dist/commands/service/ls.js +48 -0
  185. package/dist/commands/service/propose.d.ts +34 -0
  186. package/dist/commands/service/propose.js +113 -0
  187. package/dist/commands/service/status.d.ts +17 -0
  188. package/dist/commands/service/status.js +56 -0
  189. package/dist/commands/spaces/auto-executor/runs.d.ts +13 -0
  190. package/dist/commands/spaces/auto-executor/runs.js +56 -0
  191. package/dist/commands/store/governance/artifacts.d.ts +25 -0
  192. package/dist/commands/store/governance/artifacts.js +55 -0
  193. package/dist/commands/store/governance/assign.d.ts +16 -0
  194. package/dist/commands/store/governance/assign.js +54 -0
  195. package/dist/commands/store/governance/create-license.d.ts +18 -0
  196. package/dist/commands/store/governance/create-license.js +35 -0
  197. package/dist/commands/store/governance/install-plan.d.ts +25 -0
  198. package/dist/commands/store/governance/install-plan.js +56 -0
  199. package/dist/commands/store/governance/license-policy.d.ts +30 -0
  200. package/dist/commands/store/governance/license-policy.js +69 -0
  201. package/dist/commands/store/governance/policy.d.ts +25 -0
  202. package/dist/commands/store/governance/policy.js +65 -0
  203. package/dist/commands/store/governance/publish-release.d.ts +17 -0
  204. package/dist/commands/store/governance/publish-release.js +34 -0
  205. package/dist/commands/tasks/deliverable/add.d.ts +15 -0
  206. package/dist/commands/tasks/deliverable/add.js +174 -0
  207. package/dist/commands/tasks/deliverable/archive.d.ts +35 -0
  208. package/dist/commands/tasks/deliverable/archive.js +205 -0
  209. package/dist/commands/tasks/labels/detach.js +3 -0
  210. package/dist/commands/tasks/labels/suggest.d.ts +24 -0
  211. package/dist/commands/tasks/labels/suggest.js +69 -0
  212. package/dist/commands/tasks/list.d.ts +16 -2
  213. package/dist/commands/tasks/list.js +100 -24
  214. package/dist/commands/tasks/show.d.ts +23 -0
  215. package/dist/commands/tasks/show.js +51 -1
  216. package/dist/commands/wiki/rm.d.ts +22 -1
  217. package/dist/commands/wiki/rm.js +52 -3
  218. package/dist/lib/agentic-stream.js +10 -2
  219. package/dist/lib/balance.d.ts +6 -1
  220. package/dist/lib/balance.js +15 -0
  221. package/dist/lib/commerce-command.d.ts +48 -0
  222. package/dist/lib/commerce-command.js +70 -0
  223. package/dist/lib/commerce.d.ts +93 -0
  224. package/dist/lib/commerce.js +129 -0
  225. package/dist/lib/commitment-product.js +1 -1
  226. package/dist/lib/commitments.d.ts +202 -29
  227. package/dist/lib/commitments.js +300 -33
  228. package/dist/lib/dedicated-lease-command.js +10 -0
  229. package/dist/lib/dedicated-machines.d.ts +37 -0
  230. package/dist/lib/dedicated-machines.js +47 -0
  231. package/dist/lib/dedicated-service-command.d.ts +60 -0
  232. package/dist/lib/dedicated-service-command.js +182 -0
  233. package/dist/lib/dedicated-service.d.ts +342 -0
  234. package/dist/lib/dedicated-service.js +741 -0
  235. package/dist/lib/dedicated-ssh.d.ts +136 -0
  236. package/dist/lib/dedicated-ssh.js +387 -0
  237. package/dist/lib/delegated-cli.js +51 -13
  238. package/dist/lib/enterprise-commerce.d.ts +67 -0
  239. package/dist/lib/enterprise-commerce.js +112 -0
  240. package/dist/lib/enterprise-external-configuration.d.ts +60 -0
  241. package/dist/lib/enterprise-external-configuration.js +58 -0
  242. package/dist/lib/first-party-harness.js +17 -3
  243. package/dist/lib/governed-store.d.ts +110 -0
  244. package/dist/lib/governed-store.js +79 -0
  245. package/dist/lib/guest-service-command.d.ts +16 -0
  246. package/dist/lib/guest-service-command.js +32 -0
  247. package/dist/lib/guest-service.d.ts +67 -0
  248. package/dist/lib/guest-service.js +112 -0
  249. package/dist/lib/prompt.d.ts +1 -0
  250. package/dist/lib/prompt.js +1 -0
  251. package/dist/lib/task-asset-upload.d.ts +20 -0
  252. package/dist/lib/task-asset-upload.js +30 -8
  253. package/dist/lib/task-extras.d.ts +23 -0
  254. package/dist/lib/task-extras.js +6 -0
  255. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/daemonScopes.d.ts +9 -3
  256. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/daemonScopes.js +10 -3
  257. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/index.d.ts +1 -1
  258. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/index.js +6 -5
  259. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/messages.d.ts +16 -0
  260. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/messages.js +21 -4
  261. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/spawnEnv.d.ts +1 -1
  262. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/spawnEnv.js +24 -2
  263. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/daemonScopes.d.ts +9 -3
  264. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/daemonScopes.js +10 -3
  265. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/index.d.ts +1 -1
  266. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/index.js +1 -1
  267. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/messages.d.ts +16 -0
  268. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/messages.js +20 -4
  269. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/spawnEnv.d.ts +1 -1
  270. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/spawnEnv.js +24 -2
  271. package/dist/node_modules/@skrr-ai/auth-core/package.json +1 -1
  272. package/dist/node_modules/@skrr-ai/data-provider/index.js +5060 -4827
  273. package/oclif.manifest.json +37416 -31416
  274. package/package.json +43 -1
@@ -0,0 +1,113 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const core_1 = require("@oclif/core");
4
+ const base_command_1 = require("../../base-command");
5
+ const dedicated_service_command_1 = require("../../lib/dedicated-service-command");
6
+ const dedicated_service_1 = require("../../lib/dedicated-service");
7
+ const guest_service_1 = require("../../lib/guest-service");
8
+ const exec_1 = require("../machines/hosted/exec");
9
+ /**
10
+ * `skrr service propose` — the agent lane for a service that should keep
11
+ * running.
12
+ *
13
+ * Runs INSIDE a Dedicated Runtime guest: the spec is written to the daemon's
14
+ * workload socket and lands as a proposal the owner approves or rejects —
15
+ * nothing runs on the proposal alone. The daemon derives who proposed it
16
+ * from the calling process, so provenance is real, not a claim in the JSON.
17
+ */
18
+ class ServicePropose extends base_command_1.BaseCommand {
19
+ static summary = 'Propose an always-on service to this machine’s owner (guest-local)';
20
+ static description = 'Writes a service spec to the machine’s daemon, which parks it as a pending proposal. ' +
21
+ 'The owner approves it with `skrr machines dedicated service approve <lease-id> <name>` — ' +
22
+ 'approval is what makes it run. Runs only on a Dedicated Runtime guest.';
23
+ static examples = [
24
+ '<%= config.bin %> service propose --file service.json',
25
+ '<%= config.bin %> service propose --name worker --cwd /workspace/repos/app -- node dist/worker.js',
26
+ ];
27
+ static usage = 'service propose [flags] -- <command...>';
28
+ static args = {
29
+ command: core_1.Args.string({
30
+ description: 'The service command and its arguments, after --',
31
+ multiple: true,
32
+ required: false,
33
+ ignoreStdin: true,
34
+ }),
35
+ };
36
+ static flags = {
37
+ ...dedicated_service_command_1.serviceSpecFlags,
38
+ file: core_1.Flags.string({ description: 'Read the spec from a service.json file instead of flags' }),
39
+ json: core_1.Flags.boolean({ description: 'Output the proposal as JSON' }),
40
+ };
41
+ async run() {
42
+ if (!(0, dedicated_service_1.runningOnDedicatedRuntimeGuest)()) {
43
+ this.error('`skrr service propose` runs inside a Dedicated Runtime guest — this is not one. ' +
44
+ 'To declare a service on your own machine use `skrr machines dedicated service create <lease-id> …`.', { exit: 2 });
45
+ }
46
+ const { head, tail } = (0, exec_1.splitExecArgv)(this.argv);
47
+ const { args, flags } = await this.parse(ServicePropose, head);
48
+ let spec;
49
+ try {
50
+ spec = this.resolveSpec(flags, tail ?? args.command ?? []);
51
+ }
52
+ catch (err) {
53
+ if (err instanceof dedicated_service_1.DedicatedServiceError)
54
+ this.error(err.message, { exit: 2 });
55
+ throw err;
56
+ }
57
+ const errors = (0, dedicated_service_1.validateServiceSpec)(spec);
58
+ if (errors.length > 0) {
59
+ this.error(`The service spec is not valid:\n${errors.map((e) => ` - ${e}`).join('\n')}`, {
60
+ exit: 2,
61
+ });
62
+ }
63
+ let proposalId;
64
+ let reply;
65
+ try {
66
+ ({ proposalId, reply } = await (0, guest_service_1.proposeGuestService)(spec));
67
+ }
68
+ catch (err) {
69
+ if (err instanceof dedicated_service_1.DedicatedServiceError)
70
+ this.error(err.message, { exit: 1 });
71
+ throw err;
72
+ }
73
+ if (flags.json) {
74
+ this.log(JSON.stringify({ proposalId: proposalId || undefined, spec: (0, dedicated_service_1.specPayload)(spec), reply }, null, 2));
75
+ return;
76
+ }
77
+ this.log(`Proposed service ${spec.name}${proposalId ? ` (proposal ${proposalId})` : ''}. ` +
78
+ 'Nothing runs until the owner approves it with ' +
79
+ `\`skrr machines dedicated service approve <lease-id> ${spec.name}\`.`);
80
+ }
81
+ resolveSpec(flags, argv) {
82
+ const file = flags.file;
83
+ const flagSpecUsed = Boolean(flags.name ||
84
+ flags.cwd ||
85
+ flags.env?.length ||
86
+ flags.restart ||
87
+ flags.notify !== undefined ||
88
+ flags['stop-timeout'] !== undefined ||
89
+ flags['limit-memory'] ||
90
+ flags['limit-cpu'] !== undefined ||
91
+ flags['limit-pids'] !== undefined);
92
+ if (file && (flagSpecUsed || argv.length > 0)) {
93
+ throw new dedicated_service_1.DedicatedServiceError('--file is the whole spec — it cannot be combined with spec flags or a command after --.', 'SPEC_INVALID');
94
+ }
95
+ if (file)
96
+ return (0, guest_service_1.readGuestSpecFile)(file);
97
+ return (0, dedicated_service_1.specFromFlags)({
98
+ name: flags.name,
99
+ argv,
100
+ cwd: flags.cwd,
101
+ env: (0, dedicated_service_1.parseEnvEntries)(flags.env),
102
+ restart: flags.restart,
103
+ notify: flags.notify,
104
+ stopTimeoutSeconds: flags['stop-timeout'],
105
+ limits: {
106
+ memoryMax: flags['limit-memory'],
107
+ cpuQuotaPercent: flags['limit-cpu'],
108
+ pidsMax: flags['limit-pids'],
109
+ },
110
+ });
111
+ }
112
+ }
113
+ exports.default = ServicePropose;
@@ -0,0 +1,17 @@
1
+ import { GuestServiceCommand } from '../../lib/guest-service-command';
2
+ /**
3
+ * `skrr service status` — one service's computed state, read on the machine
4
+ * itself (guest-local, read-only). The `systemctl status` of a guest: tenant
5
+ * code sees its own services without a credential or a round-trip to the API.
6
+ */
7
+ export default class ServiceStatus extends GuestServiceCommand {
8
+ static summary: string;
9
+ static examples: string[];
10
+ static args: {
11
+ name: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
12
+ };
13
+ static flags: {
14
+ json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
15
+ };
16
+ run(): Promise<void>;
17
+ }
@@ -0,0 +1,56 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const core_1 = require("@oclif/core");
4
+ const guest_service_command_1 = require("../../lib/guest-service-command");
5
+ const format_1 = require("../../lib/format");
6
+ const dedicated_service_1 = require("../../lib/dedicated-service");
7
+ /**
8
+ * `skrr service status` — one service's computed state, read on the machine
9
+ * itself (guest-local, read-only). The `systemctl status` of a guest: tenant
10
+ * code sees its own services without a credential or a round-trip to the API.
11
+ */
12
+ class ServiceStatus extends guest_service_command_1.GuestServiceCommand {
13
+ static summary = 'One service’s computed state on this machine (guest-local)';
14
+ static examples = [
15
+ '<%= config.bin %> service status <name>',
16
+ '<%= config.bin %> service status <name> --json',
17
+ ];
18
+ static args = {
19
+ name: core_1.Args.string({ description: 'Service name', required: true, ignoreStdin: true }),
20
+ };
21
+ static flags = {
22
+ json: core_1.Flags.boolean({ description: 'Output as JSON' }),
23
+ };
24
+ async run() {
25
+ this.requireGuest();
26
+ const { args, flags } = await this.parse(ServiceStatus);
27
+ const reply = await this.guestRead('status', { name: args.name });
28
+ const result = (reply.result ?? reply);
29
+ if (flags.json) {
30
+ this.log(JSON.stringify(result, null, 2));
31
+ return;
32
+ }
33
+ const spec = result.spec ?? {};
34
+ this.log(`service ${args.name}`);
35
+ const row = (label, value) => {
36
+ const cell = (0, format_1.formatCell)(value);
37
+ if (cell !== '-')
38
+ this.log(` ${label.padEnd(13)}${cell}`);
39
+ };
40
+ // detail arrives as a string or a structured object — render its fields.
41
+ row('status', [result.status, (0, dedicated_service_1.serviceDetailText)(result.detail)].filter(Boolean).join(' — ') || undefined);
42
+ row('restart', spec.restart);
43
+ row('command', Array.isArray(spec.command) ? spec.command.join(' ') : spec.shell);
44
+ row('cwd', spec.cwd);
45
+ row('updated', spec.updatedAt ? (0, format_1.localStamp)(spec.updatedAt) : undefined);
46
+ const exits = result.exits ?? [];
47
+ if (exits.length > 0) {
48
+ this.log('');
49
+ this.log('recent exits:');
50
+ for (const exit of exits.slice(-10)) {
51
+ this.log(` ${(0, format_1.localStamp)(exit.at)} exit ${exit.exitCode ?? '-'}${exit.signal ? ` ${exit.signal}` : ''}`);
52
+ }
53
+ }
54
+ }
55
+ }
56
+ exports.default = ServiceStatus;
@@ -0,0 +1,13 @@
1
+ import { BaseCommand } from '../../../base-command';
2
+ export default class SpacesAutoExecutorRuns extends BaseCommand {
3
+ static description: string;
4
+ static examples: string[];
5
+ static args: {
6
+ id: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
7
+ };
8
+ static flags: {
9
+ json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
10
+ limit: import("@oclif/core/lib/interfaces").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
11
+ };
12
+ run(): Promise<void>;
13
+ }
@@ -0,0 +1,56 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const core_1 = require("@oclif/core");
4
+ const data_provider_1 = require("@skrr-ai/data-provider");
5
+ const base_command_1 = require("../../../base-command");
6
+ const space_output_1 = require("../../../lib/space-output");
7
+ class SpacesAutoExecutorRuns extends base_command_1.BaseCommand {
8
+ static description = "List a space's recent auto-orchestration runs and its Lead health";
9
+ static examples = [
10
+ '<%= config.bin %> spaces auto-executor runs <space-id>',
11
+ '<%= config.bin %> spaces auto-executor runs <space-id> --limit 50 --json',
12
+ ];
13
+ static args = {
14
+ id: core_1.Args.string({ description: 'Space ID', required: true, ignoreStdin: true }),
15
+ };
16
+ static flags = {
17
+ json: core_1.Flags.boolean({ description: 'Output as JSON' }),
18
+ limit: core_1.Flags.integer({
19
+ description: 'Maximum runs to return (server clamps to 1..50, default 20)',
20
+ }),
21
+ };
22
+ async run() {
23
+ this.requireAuth();
24
+ const { args, flags } = await this.parse(SpacesAutoExecutorRuns);
25
+ let result;
26
+ try {
27
+ result = await data_provider_1.dataService.getSpaceOrchestrationRuns(args.id, flags.limit);
28
+ }
29
+ catch (err) {
30
+ this.handleApiError(err);
31
+ }
32
+ if (flags.json) {
33
+ this.log(JSON.stringify((0, space_output_1.withSpacePerspectiveUrl)(this.cliConfig.baseURL, args.id, 'execution', { result }), null, 2));
34
+ return;
35
+ }
36
+ this.log(`Orchestration: ${result.enabled ? 'enabled' : 'disabled'}`);
37
+ this.log(`Lead health: ${result.leadHealth}`);
38
+ if (result.consecutiveFailures > 0) {
39
+ this.log(`Failures: ${result.consecutiveFailures} consecutive`);
40
+ }
41
+ if (result.lastFailureReason) {
42
+ this.log(`Last failure: ${result.lastFailureReason}`);
43
+ }
44
+ if (result.runs.length === 0) {
45
+ this.log('No orchestration runs recorded.');
46
+ return;
47
+ }
48
+ this.log('');
49
+ for (const run of result.runs) {
50
+ const when = run.triggeredAt ?? 'unknown-time';
51
+ const failure = run.failureReason ? ` — ${run.failureReason}` : '';
52
+ this.log(`${when} ${run.status}${failure}`);
53
+ }
54
+ }
55
+ }
56
+ exports.default = SpacesAutoExecutorRuns;
@@ -0,0 +1,25 @@
1
+ import { BaseCommand } from '../../../base-command';
2
+ /**
3
+ * `skrr store governance artifacts` — the catalogue, searched by what an
4
+ * artifact CAN DO rather than what it is called.
5
+ *
6
+ * Distinct from `skrr store browse`, which finds published agents to install.
7
+ * This searches every governed entity type by capability, permission,
8
+ * verified outcome and cost — the questions you ask when deciding what a
9
+ * workspace should be licensed for, not which agent you personally want.
10
+ */
11
+ export default class StoreGovernanceArtifacts extends BaseCommand {
12
+ static description: string;
13
+ static examples: string[];
14
+ static flags: {
15
+ 'entity-type': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
16
+ capability: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
17
+ permission: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
18
+ 'verified-outcome': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
19
+ 'min-cost-micros': import("@oclif/core/lib/interfaces").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
20
+ 'max-cost-micros': import("@oclif/core/lib/interfaces").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
21
+ limit: import("@oclif/core/lib/interfaces").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
22
+ json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
23
+ };
24
+ run(): Promise<void>;
25
+ }
@@ -0,0 +1,55 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const core_1 = require("@oclif/core");
4
+ const base_command_1 = require("../../../base-command");
5
+ const governed_store_1 = require("../../../lib/governed-store");
6
+ /**
7
+ * `skrr store governance artifacts` — the catalogue, searched by what an
8
+ * artifact CAN DO rather than what it is called.
9
+ *
10
+ * Distinct from `skrr store browse`, which finds published agents to install.
11
+ * This searches every governed entity type by capability, permission,
12
+ * verified outcome and cost — the questions you ask when deciding what a
13
+ * workspace should be licensed for, not which agent you personally want.
14
+ */
15
+ class StoreGovernanceArtifacts extends base_command_1.BaseCommand {
16
+ static description = 'Search the governed store catalogue by capability, permission, verified outcome and cost. For finding an agent to install, use `store browse`.';
17
+ static examples = [
18
+ '<%= config.bin %> store governance artifacts --capability code_review',
19
+ '<%= config.bin %> store governance artifacts --entity-type skill --max-cost-micros 500000',
20
+ ];
21
+ static flags = {
22
+ 'entity-type': core_1.Flags.string({
23
+ description: 'agent, skill, action, service, team, bundle, space_template or connector',
24
+ }),
25
+ capability: core_1.Flags.string({ description: 'Capability the artifact provides' }),
26
+ permission: core_1.Flags.string({ description: 'Permission the artifact requires' }),
27
+ 'verified-outcome': core_1.Flags.string({ description: 'A verified outcome key it claims' }),
28
+ 'min-cost-micros': core_1.Flags.integer({ description: 'Lower bound on cost, in micros' }),
29
+ 'max-cost-micros': core_1.Flags.integer({ description: 'Upper bound on cost, in micros' }),
30
+ limit: core_1.Flags.integer({ description: 'Maximum rows (1-100)' }),
31
+ json: core_1.Flags.boolean({ description: 'Output as JSON' }),
32
+ };
33
+ async run() {
34
+ this.requireAuth();
35
+ const { flags } = await this.parse(StoreGovernanceArtifacts);
36
+ let result;
37
+ try {
38
+ result = await (0, governed_store_1.searchGovernedStoreArtifacts)({
39
+ entityType: flags['entity-type'],
40
+ capability: flags.capability,
41
+ permission: flags.permission,
42
+ verifiedOutcome: flags['verified-outcome'],
43
+ minCostMicros: flags['min-cost-micros'],
44
+ maxCostMicros: flags['max-cost-micros'],
45
+ limit: flags.limit,
46
+ });
47
+ }
48
+ catch (error) {
49
+ this.handleApiError(error);
50
+ return;
51
+ }
52
+ this.log(JSON.stringify(result, null, 2));
53
+ }
54
+ }
55
+ exports.default = StoreGovernanceArtifacts;
@@ -0,0 +1,16 @@
1
+ import { BaseCommand } from '../../../base-command';
2
+ /** Give a workspace-held license to a member or a Space. */
3
+ export default class StoreGovernanceAssign extends BaseCommand {
4
+ static description: string;
5
+ static examples: string[];
6
+ static args: {
7
+ workspace: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
8
+ };
9
+ static flags: {
10
+ license: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
11
+ to: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
12
+ 'assignment-id': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
13
+ json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
14
+ };
15
+ run(): Promise<void>;
16
+ }
@@ -0,0 +1,54 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const core_1 = require("@oclif/core");
4
+ const base_command_1 = require("../../../base-command");
5
+ const governed_store_1 = require("../../../lib/governed-store");
6
+ /** Give a workspace-held license to a member or a Space. */
7
+ class StoreGovernanceAssign extends base_command_1.BaseCommand {
8
+ static description = 'Assign a workspace-held license to a member or a Space — who actually gets to run it.';
9
+ static examples = [
10
+ '<%= config.bin %> store governance assign <workspace-id> --license <id> --to member:<user-id>',
11
+ '<%= config.bin %> store governance assign <workspace-id> --license <id> --to space:<space-id>',
12
+ ];
13
+ static args = {
14
+ workspace: core_1.Args.string({ description: 'Workspace id', required: true, ignoreStdin: true }),
15
+ };
16
+ static flags = {
17
+ license: core_1.Flags.string({ description: 'License to assign', required: true }),
18
+ to: core_1.Flags.string({
19
+ description: 'member:<user-id> or space:<space-id>',
20
+ required: true,
21
+ }),
22
+ 'assignment-id': core_1.Flags.string({ description: 'Assignment id, for a deterministic retry' }),
23
+ json: core_1.Flags.boolean({ description: 'Output as JSON' }),
24
+ };
25
+ async run() {
26
+ this.requireAuth();
27
+ const { args, flags } = await this.parse(StoreGovernanceAssign);
28
+ // `member:` / `space:` rather than two flags, because the two are mutually
29
+ // exclusive and a pair of optional flags lets you pass both or neither.
30
+ const separator = flags.to.indexOf(':');
31
+ const assigneeType = separator > 0 ? flags.to.slice(0, separator) : '';
32
+ const assigneeId = separator > 0 ? flags.to.slice(separator + 1) : '';
33
+ if (!['member', 'space'].includes(assigneeType) || !assigneeId) {
34
+ this.error(`--to must be member:<user-id> or space:<space-id>, got "${flags.to}"`, {
35
+ exit: 2,
36
+ });
37
+ }
38
+ let result;
39
+ try {
40
+ result = await (0, governed_store_1.assignWorkspaceStoreLicense)(args.workspace, {
41
+ licenseId: flags.license,
42
+ assigneeType: assigneeType,
43
+ assigneeId,
44
+ ...(flags['assignment-id'] ? { assignmentId: flags['assignment-id'] } : {}),
45
+ });
46
+ }
47
+ catch (error) {
48
+ this.handleApiError(error);
49
+ return;
50
+ }
51
+ this.log(JSON.stringify(result, null, 2));
52
+ }
53
+ }
54
+ exports.default = StoreGovernanceAssign;
@@ -0,0 +1,18 @@
1
+ import { BaseCommand } from '../../../base-command';
2
+ /**
3
+ * Mint a bundle license against an acquisition (admin).
4
+ *
5
+ * A license always cites WHAT paid for it — a commercial order or a contract —
6
+ * so the body carries that acquisition source. That link is the reason a
7
+ * license can be audited at all, and it is not something a CLI should let you
8
+ * omit by defaulting.
9
+ */
10
+ export default class StoreGovernanceCreateLicense extends BaseCommand {
11
+ static description: string;
12
+ static examples: string[];
13
+ static flags: {
14
+ file: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
15
+ json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
16
+ };
17
+ run(): Promise<void>;
18
+ }
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const base_command_1 = require("../../../base-command");
4
+ const governed_store_1 = require("../../../lib/governed-store");
5
+ const commerce_command_1 = require("../../../lib/commerce-command");
6
+ /**
7
+ * Mint a bundle license against an acquisition (admin).
8
+ *
9
+ * A license always cites WHAT paid for it — a commercial order or a contract —
10
+ * so the body carries that acquisition source. That link is the reason a
11
+ * license can be audited at all, and it is not something a CLI should let you
12
+ * omit by defaulting.
13
+ */
14
+ class StoreGovernanceCreateLicense extends base_command_1.BaseCommand {
15
+ static description = 'Mint a bundle license against a commercial order or contract (admin).';
16
+ static examples = [
17
+ '<%= config.bin %> store governance create-license --file ./license.json',
18
+ ];
19
+ static flags = { ...commerce_command_1.jsonBodyFlags };
20
+ async run() {
21
+ this.requireAuth();
22
+ const { flags } = await this.parse(StoreGovernanceCreateLicense);
23
+ const body = await (0, commerce_command_1.jsonBodyFrom)(this, flags.file);
24
+ let result;
25
+ try {
26
+ result = await (0, governed_store_1.createGovernedStoreLicense)(body);
27
+ }
28
+ catch (error) {
29
+ this.handleApiError(error);
30
+ return;
31
+ }
32
+ this.log(JSON.stringify(result, null, 2));
33
+ }
34
+ }
35
+ exports.default = StoreGovernanceCreateLicense;
@@ -0,0 +1,25 @@
1
+ import { BaseCommand } from '../../../base-command';
2
+ /**
3
+ * `skrr store governance install-plan` — what installing this release WOULD do.
4
+ *
5
+ * A plan, not an install, and the name says so. It resolves the release
6
+ * against a license, the workspace policy and the environment you declare, and
7
+ * answers whether it is permitted and what it would pull. That is the read an
8
+ * operator wants before spending anything — and the reason it is here rather
9
+ * than folded into `store install`, which installs.
10
+ */
11
+ export default class StoreGovernanceInstallPlan extends BaseCommand {
12
+ static description: string;
13
+ static examples: string[];
14
+ static args: {
15
+ release: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
16
+ };
17
+ static flags: {
18
+ license: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
19
+ workspace: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
20
+ space: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
21
+ file: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
22
+ json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
23
+ };
24
+ run(): Promise<void>;
25
+ }
@@ -0,0 +1,56 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const core_1 = require("@oclif/core");
4
+ const base_command_1 = require("../../../base-command");
5
+ const governed_store_1 = require("../../../lib/governed-store");
6
+ const commerce_command_1 = require("../../../lib/commerce-command");
7
+ /**
8
+ * `skrr store governance install-plan` — what installing this release WOULD do.
9
+ *
10
+ * A plan, not an install, and the name says so. It resolves the release
11
+ * against a license, the workspace policy and the environment you declare, and
12
+ * answers whether it is permitted and what it would pull. That is the read an
13
+ * operator wants before spending anything — and the reason it is here rather
14
+ * than folded into `store install`, which installs.
15
+ */
16
+ class StoreGovernanceInstallPlan extends base_command_1.BaseCommand {
17
+ static description = 'Resolve what installing a governed release would do — license, workspace policy and environment. Installs nothing.';
18
+ static examples = [
19
+ '<%= config.bin %> store governance install-plan <release-id>',
20
+ '<%= config.bin %> store governance install-plan <release-id> --workspace <id> --license <id>',
21
+ '<%= config.bin %> store governance install-plan <release-id> --file ./environment.json',
22
+ ];
23
+ static args = {
24
+ release: core_1.Args.string({ description: 'Release id', required: true, ignoreStdin: true }),
25
+ };
26
+ static flags = {
27
+ license: core_1.Flags.string({ description: 'License to resolve against' }),
28
+ workspace: core_1.Flags.string({ description: 'Workspace whose policy applies' }),
29
+ space: core_1.Flags.string({ description: 'Space the install would land in' }),
30
+ file: core_1.Flags.string({
31
+ description: 'JSON with an `environment` object (platformVersion, runtimeKind, …), or -',
32
+ }),
33
+ json: core_1.Flags.boolean({ description: 'Output as JSON' }),
34
+ };
35
+ async run() {
36
+ this.requireAuth();
37
+ const { args, flags } = await this.parse(StoreGovernanceInstallPlan);
38
+ const extra = await (0, commerce_command_1.jsonBodyFrom)(this, flags.file, { required: false });
39
+ let result;
40
+ try {
41
+ result = await (0, governed_store_1.resolveGovernedStoreInstallPlan)({
42
+ ...extra,
43
+ releaseId: args.release,
44
+ ...(flags.license ? { licenseId: flags.license } : {}),
45
+ ...(flags.workspace ? { workspaceId: flags.workspace } : {}),
46
+ ...(flags.space ? { spaceId: flags.space } : {}),
47
+ });
48
+ }
49
+ catch (error) {
50
+ this.handleApiError(error);
51
+ return;
52
+ }
53
+ this.log(JSON.stringify(result, null, 2));
54
+ }
55
+ }
56
+ exports.default = StoreGovernanceInstallPlan;
@@ -0,0 +1,30 @@
1
+ import { BaseCommand } from '../../../base-command';
2
+ /**
3
+ * `skrr store governance license-policy` — how a license takes updates.
4
+ *
5
+ * ONE command over two endpoints, because the only difference between them is
6
+ * WHOSE license it is: yours, or the workspace's. `--workspace` picks the
7
+ * second, and the server resolves the actor from the route rather than from
8
+ * anything the caller asserts. Two owners can hold licenses over the same
9
+ * release and may change different things, so the distinction is real — it is
10
+ * just not a reason to make an operator remember two verb names.
11
+ *
12
+ * `--expect-revision` is REQUIRED by the API, not by convenience: an update
13
+ * policy decides which releases run, and a blind write could silently move a
14
+ * workspace onto a release somebody else had just pinned away from.
15
+ */
16
+ export default class StoreGovernanceLicensePolicy extends BaseCommand {
17
+ static description: string;
18
+ static examples: string[];
19
+ static args: {
20
+ license: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
21
+ };
22
+ static flags: {
23
+ policy: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
24
+ 'expect-revision': import("@oclif/core/lib/interfaces").OptionFlag<number, import("@oclif/core/lib/interfaces").CustomOptions>;
25
+ release: import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
26
+ workspace: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
27
+ json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
28
+ };
29
+ run(): Promise<void>;
30
+ }
@@ -0,0 +1,69 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const core_1 = require("@oclif/core");
4
+ const base_command_1 = require("../../../base-command");
5
+ const governed_store_1 = require("../../../lib/governed-store");
6
+ /**
7
+ * `skrr store governance license-policy` — how a license takes updates.
8
+ *
9
+ * ONE command over two endpoints, because the only difference between them is
10
+ * WHOSE license it is: yours, or the workspace's. `--workspace` picks the
11
+ * second, and the server resolves the actor from the route rather than from
12
+ * anything the caller asserts. Two owners can hold licenses over the same
13
+ * release and may change different things, so the distinction is real — it is
14
+ * just not a reason to make an operator remember two verb names.
15
+ *
16
+ * `--expect-revision` is REQUIRED by the API, not by convenience: an update
17
+ * policy decides which releases run, and a blind write could silently move a
18
+ * workspace onto a release somebody else had just pinned away from.
19
+ */
20
+ class StoreGovernanceLicensePolicy extends base_command_1.BaseCommand {
21
+ static description = 'Set how a bundle license takes updates (manual, pinned or compatible), fenced on the revision you read. Without --workspace it changes a license you hold personally.';
22
+ static examples = [
23
+ '<%= config.bin %> store governance license-policy <license-id> --policy pinned --expect-revision 2',
24
+ '<%= config.bin %> store governance license-policy <license-id> --policy compatible --expect-revision 5 --workspace <workspace-id>',
25
+ ];
26
+ static args = {
27
+ license: core_1.Args.string({ description: 'License id', required: true, ignoreStdin: true }),
28
+ };
29
+ static flags = {
30
+ policy: core_1.Flags.string({
31
+ description: 'How the license takes updates',
32
+ options: ['manual', 'pinned', 'compatible'],
33
+ required: true,
34
+ }),
35
+ 'expect-revision': core_1.Flags.integer({
36
+ description: 'The license revision you are changing (compare-and-set)',
37
+ required: true,
38
+ }),
39
+ release: core_1.Flags.string({
40
+ description: 'Pin to these release ids (repeatable); only meaningful with --policy pinned',
41
+ multiple: true,
42
+ }),
43
+ workspace: core_1.Flags.string({
44
+ description: 'Change the license the WORKSPACE holds, rather than your own',
45
+ }),
46
+ json: core_1.Flags.boolean({ description: 'Output as JSON' }),
47
+ };
48
+ async run() {
49
+ this.requireAuth();
50
+ const { args, flags } = await this.parse(StoreGovernanceLicensePolicy);
51
+ const body = {
52
+ updatePolicy: flags.policy,
53
+ expectedRevision: flags['expect-revision'],
54
+ ...(flags.release?.length ? { selectedReleaseIds: flags.release } : {}),
55
+ };
56
+ let result;
57
+ try {
58
+ result = flags.workspace
59
+ ? await (0, governed_store_1.updateWorkspaceLicensePolicy)(flags.workspace, args.license, body)
60
+ : await (0, governed_store_1.updateOwnLicensePolicy)(args.license, body);
61
+ }
62
+ catch (error) {
63
+ this.handleApiError(error);
64
+ return;
65
+ }
66
+ this.log(JSON.stringify(result, null, 2));
67
+ }
68
+ }
69
+ exports.default = StoreGovernanceLicensePolicy;