@skrr-ai/cli 0.1.46 → 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 (305) 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/code/handover.d.ts +2 -2
  10. package/dist/commands/code/handover.js +12 -13
  11. package/dist/commands/code/install.js +31 -0
  12. package/dist/commands/code/update.d.ts +46 -0
  13. package/dist/commands/code/update.js +242 -0
  14. package/dist/commands/commerce/entitlements/explain.d.ts +22 -0
  15. package/dist/commands/commerce/entitlements/explain.js +40 -0
  16. package/dist/commands/commerce/incidents/audit.d.ts +20 -0
  17. package/dist/commands/commerce/incidents/audit.js +37 -0
  18. package/dist/commands/commerce/incidents/list.d.ts +22 -0
  19. package/dist/commands/commerce/incidents/list.js +49 -0
  20. package/dist/commands/commerce/incidents/resolve.d.ts +23 -0
  21. package/dist/commands/commerce/incidents/resolve.js +45 -0
  22. package/dist/commands/commerce/incidents/retry.d.ts +22 -0
  23. package/dist/commands/commerce/incidents/retry.js +45 -0
  24. package/dist/commands/commerce/incidents/show.d.ts +13 -0
  25. package/dist/commands/commerce/incidents/show.js +30 -0
  26. package/dist/commands/commerce/offers/approve.d.ts +17 -0
  27. package/dist/commands/commerce/offers/approve.js +33 -0
  28. package/dist/commands/commerce/offers/create.d.ts +18 -0
  29. package/dist/commands/commerce/offers/create.js +34 -0
  30. package/dist/commands/commerce/offers/publish.d.ts +13 -0
  31. package/dist/commands/commerce/offers/publish.js +28 -0
  32. package/dist/commands/commerce/offers/retire.d.ts +17 -0
  33. package/dist/commands/commerce/offers/retire.js +32 -0
  34. package/dist/commands/commerce/offers/validate.d.ts +18 -0
  35. package/dist/commands/commerce/offers/validate.js +33 -0
  36. package/dist/commands/commerce/products/create.d.ts +10 -0
  37. package/dist/commands/commerce/products/create.js +25 -0
  38. package/dist/commands/commerce/promotions/redeem.d.ts +13 -0
  39. package/dist/commands/commerce/promotions/redeem.js +32 -0
  40. package/dist/commands/commerce/terms/accept.d.ts +18 -0
  41. package/dist/commands/commerce/terms/accept.js +39 -0
  42. package/dist/commands/commerce/terms/show.d.ts +10 -0
  43. package/dist/commands/commerce/terms/show.js +34 -0
  44. package/dist/commands/commerce/trials/conversion-preview.d.ts +18 -0
  45. package/dist/commands/commerce/trials/conversion-preview.js +39 -0
  46. package/dist/commands/commerce/trials/start.d.ts +23 -0
  47. package/dist/commands/commerce/trials/start.js +58 -0
  48. package/dist/commands/commitments/accounting.d.ts +39 -0
  49. package/dist/commands/commitments/accounting.js +116 -0
  50. package/dist/commands/commitments/action-history.d.ts +1 -0
  51. package/dist/commands/commitments/action-history.js +8 -1
  52. package/dist/commands/commitments/case.d.ts +1 -0
  53. package/dist/commands/commitments/case.js +19 -3
  54. package/dist/commands/commitments/cases.d.ts +1 -0
  55. package/dist/commands/commitments/cases.js +11 -1
  56. package/dist/commands/commitments/checks.d.ts +1 -0
  57. package/dist/commands/commitments/checks.js +5 -1
  58. package/dist/commands/commitments/cost.d.ts +62 -0
  59. package/dist/commands/commitments/cost.js +130 -0
  60. package/dist/commands/commitments/create.js +1 -1
  61. package/dist/commands/commitments/delete.d.ts +1 -0
  62. package/dist/commands/commitments/delete.js +56 -6
  63. package/dist/commands/commitments/feedback.js +9 -1
  64. package/dist/commands/commitments/handover.js +16 -0
  65. package/dist/commands/commitments/hypotheses.d.ts +1 -0
  66. package/dist/commands/commitments/hypotheses.js +17 -2
  67. package/dist/commands/commitments/links/list.js +4 -1
  68. package/dist/commands/commitments/liveness.d.ts +18 -0
  69. package/dist/commands/commitments/liveness.js +80 -0
  70. package/dist/commands/commitments/metrics.d.ts +1 -0
  71. package/dist/commands/commitments/metrics.js +8 -1
  72. package/dist/commands/commitments/next-tick.d.ts +39 -0
  73. package/dist/commands/commitments/next-tick.js +122 -0
  74. package/dist/commands/commitments/observations.d.ts +1 -0
  75. package/dist/commands/commitments/observations.js +19 -2
  76. package/dist/commands/commitments/pause.js +12 -0
  77. package/dist/commands/commitments/receipt.d.ts +2 -0
  78. package/dist/commands/commitments/receipt.js +16 -2
  79. package/dist/commands/commitments/remediation-proposal.js +6 -2
  80. package/dist/commands/commitments/remediation-proposals.js +5 -1
  81. package/dist/commands/commitments/restore.d.ts +25 -0
  82. package/dist/commands/commitments/restore.js +46 -0
  83. package/dist/commands/commitments/show.js +32 -0
  84. package/dist/commands/commitments/trigger-status.js +33 -0
  85. package/dist/commands/commitments/update.d.ts +1 -0
  86. package/dist/commands/commitments/update.js +31 -5
  87. package/dist/commands/commitments/wake-capabilities.d.ts +0 -1
  88. package/dist/commands/commitments/wake-capabilities.js +8 -4
  89. package/dist/commands/convos/handover.d.ts +1 -0
  90. package/dist/commands/convos/handover.js +4 -0
  91. package/dist/commands/daemon/index.js +2 -0
  92. package/dist/commands/daemon/update.d.ts +19 -0
  93. package/dist/commands/daemon/update.js +48 -0
  94. package/dist/commands/enterprise/budgets/create.d.ts +11 -0
  95. package/dist/commands/enterprise/budgets/create.js +27 -0
  96. package/dist/commands/enterprise/budgets/evaluate.d.ts +17 -0
  97. package/dist/commands/enterprise/budgets/evaluate.js +32 -0
  98. package/dist/commands/enterprise/budgets/publish.d.ts +14 -0
  99. package/dist/commands/enterprise/budgets/publish.js +30 -0
  100. package/dist/commands/enterprise/contracts/activate.d.ts +14 -0
  101. package/dist/commands/enterprise/contracts/activate.js +30 -0
  102. package/dist/commands/enterprise/contracts/create.d.ts +14 -0
  103. package/dist/commands/enterprise/contracts/create.js +32 -0
  104. package/dist/commands/enterprise/contracts/issue.d.ts +18 -0
  105. package/dist/commands/enterprise/contracts/issue.js +34 -0
  106. package/dist/commands/enterprise/domains/begin.d.ts +20 -0
  107. package/dist/commands/enterprise/domains/begin.js +39 -0
  108. package/dist/commands/enterprise/domains/verify.d.ts +14 -0
  109. package/dist/commands/enterprise/domains/verify.js +32 -0
  110. package/dist/commands/enterprise/external-config/activate.d.ts +22 -0
  111. package/dist/commands/enterprise/external-config/activate.js +49 -0
  112. package/dist/commands/enterprise/external-config/set.d.ts +25 -0
  113. package/dist/commands/enterprise/external-config/set.js +123 -0
  114. package/dist/commands/enterprise/external-config/show.d.ts +12 -0
  115. package/dist/commands/enterprise/external-config/show.js +39 -0
  116. package/dist/commands/enterprise/external-config/suspend.d.ts +13 -0
  117. package/dist/commands/enterprise/external-config/suspend.js +41 -0
  118. package/dist/commands/enterprise/finance/close-snapshot.d.ts +11 -0
  119. package/dist/commands/enterprise/finance/close-snapshot.js +28 -0
  120. package/dist/commands/enterprise/finance/record-document.d.ts +18 -0
  121. package/dist/commands/enterprise/finance/record-document.js +35 -0
  122. package/dist/commands/enterprise/profile.d.ts +20 -0
  123. package/dist/commands/enterprise/profile.js +38 -0
  124. package/dist/commands/login.d.ts +13 -0
  125. package/dist/commands/login.js +77 -0
  126. package/dist/commands/machines/dedicated/index.js +3 -0
  127. package/dist/commands/machines/dedicated/service/apply.d.ts +23 -0
  128. package/dist/commands/machines/dedicated/service/apply.js +99 -0
  129. package/dist/commands/machines/dedicated/service/approve.d.ts +23 -0
  130. package/dist/commands/machines/dedicated/service/approve.js +52 -0
  131. package/dist/commands/machines/dedicated/service/create.d.ts +55 -0
  132. package/dist/commands/machines/dedicated/service/create.js +222 -0
  133. package/dist/commands/machines/dedicated/service/edit.d.ts +30 -0
  134. package/dist/commands/machines/dedicated/service/edit.js +146 -0
  135. package/dist/commands/machines/dedicated/service/exec.d.ts +26 -0
  136. package/dist/commands/machines/dedicated/service/exec.js +92 -0
  137. package/dist/commands/machines/dedicated/service/export.d.ts +29 -0
  138. package/dist/commands/machines/dedicated/service/export.js +106 -0
  139. package/dist/commands/machines/dedicated/service/index.d.ts +14 -0
  140. package/dist/commands/machines/dedicated/service/index.js +49 -0
  141. package/dist/commands/machines/dedicated/service/logs.d.ts +33 -0
  142. package/dist/commands/machines/dedicated/service/logs.js +148 -0
  143. package/dist/commands/machines/dedicated/service/ls.d.ts +20 -0
  144. package/dist/commands/machines/dedicated/service/ls.js +80 -0
  145. package/dist/commands/machines/dedicated/service/restart.d.ts +14 -0
  146. package/dist/commands/machines/dedicated/service/restart.js +29 -0
  147. package/dist/commands/machines/dedicated/service/rm.d.ts +20 -0
  148. package/dist/commands/machines/dedicated/service/rm.js +33 -0
  149. package/dist/commands/machines/dedicated/service/secret/index.d.ts +14 -0
  150. package/dist/commands/machines/dedicated/service/secret/index.js +25 -0
  151. package/dist/commands/machines/dedicated/service/secret/rm.d.ts +22 -0
  152. package/dist/commands/machines/dedicated/service/secret/rm.js +54 -0
  153. package/dist/commands/machines/dedicated/service/secret/set.d.ts +22 -0
  154. package/dist/commands/machines/dedicated/service/secret/set.js +93 -0
  155. package/dist/commands/machines/dedicated/service/start.d.ts +14 -0
  156. package/dist/commands/machines/dedicated/service/start.js +29 -0
  157. package/dist/commands/machines/dedicated/service/status.d.ts +21 -0
  158. package/dist/commands/machines/dedicated/service/status.js +85 -0
  159. package/dist/commands/machines/dedicated/service/stop.d.ts +20 -0
  160. package/dist/commands/machines/dedicated/service/stop.js +35 -0
  161. package/dist/commands/machines/dedicated/service/top.d.ts +22 -0
  162. package/dist/commands/machines/dedicated/service/top.js +120 -0
  163. package/dist/commands/machines/dedicated/sign-in-status.d.ts +22 -0
  164. package/dist/commands/machines/dedicated/sign-in-status.js +79 -0
  165. package/dist/commands/machines/dedicated/ssh-config.d.ts +28 -0
  166. package/dist/commands/machines/dedicated/ssh-config.js +66 -0
  167. package/dist/commands/machines/dedicated/ssh-proxy.d.ts +22 -0
  168. package/dist/commands/machines/dedicated/ssh-proxy.js +62 -0
  169. package/dist/commands/machines/dedicated/ssh.d.ts +29 -0
  170. package/dist/commands/machines/dedicated/ssh.js +121 -0
  171. package/dist/commands/native/allow-all.d.ts +14 -0
  172. package/dist/commands/native/allow-all.js +25 -0
  173. package/dist/commands/native/allow.d.ts +24 -0
  174. package/dist/commands/native/allow.js +45 -0
  175. package/dist/commands/native/deny.d.ts +24 -0
  176. package/dist/commands/native/deny.js +43 -0
  177. package/dist/commands/native/disable.d.ts +17 -0
  178. package/dist/commands/native/disable.js +28 -0
  179. package/dist/commands/native/enable.d.ts +12 -0
  180. package/dist/commands/native/enable.js +29 -0
  181. package/dist/commands/native/list-apps.d.ts +19 -0
  182. package/dist/commands/native/list-apps.js +30 -0
  183. package/dist/commands/native/restrict-to.d.ts +22 -0
  184. package/dist/commands/native/restrict-to.js +41 -0
  185. package/dist/commands/native/status.d.ts +19 -0
  186. package/dist/commands/native/status.js +33 -0
  187. package/dist/commands/native.d.ts +39 -0
  188. package/dist/commands/native.js +76 -0
  189. package/dist/commands/service/index.d.ts +14 -0
  190. package/dist/commands/service/index.js +31 -0
  191. package/dist/commands/service/logs.d.ts +18 -0
  192. package/dist/commands/service/logs.js +53 -0
  193. package/dist/commands/service/ls.d.ts +13 -0
  194. package/dist/commands/service/ls.js +48 -0
  195. package/dist/commands/service/propose.d.ts +34 -0
  196. package/dist/commands/service/propose.js +113 -0
  197. package/dist/commands/service/status.d.ts +17 -0
  198. package/dist/commands/service/status.js +56 -0
  199. package/dist/commands/spaces/auto-executor/runs.d.ts +13 -0
  200. package/dist/commands/spaces/auto-executor/runs.js +56 -0
  201. package/dist/commands/spaces/briefs/get.js +8 -0
  202. package/dist/commands/spaces/briefs/list.js +2 -0
  203. package/dist/commands/spaces/briefs/set.d.ts +3 -0
  204. package/dist/commands/spaces/briefs/set.js +78 -13
  205. package/dist/commands/spaces/expertise-suggestions.d.ts +12 -0
  206. package/dist/commands/spaces/expertise-suggestions.js +71 -0
  207. package/dist/commands/spaces/members/add.d.ts +1 -0
  208. package/dist/commands/spaces/members/add.js +11 -3
  209. package/dist/commands/spaces/members/list.js +11 -0
  210. package/dist/commands/store/governance/artifacts.d.ts +25 -0
  211. package/dist/commands/store/governance/artifacts.js +55 -0
  212. package/dist/commands/store/governance/assign.d.ts +16 -0
  213. package/dist/commands/store/governance/assign.js +54 -0
  214. package/dist/commands/store/governance/create-license.d.ts +18 -0
  215. package/dist/commands/store/governance/create-license.js +35 -0
  216. package/dist/commands/store/governance/install-plan.d.ts +25 -0
  217. package/dist/commands/store/governance/install-plan.js +56 -0
  218. package/dist/commands/store/governance/license-policy.d.ts +30 -0
  219. package/dist/commands/store/governance/license-policy.js +69 -0
  220. package/dist/commands/store/governance/policy.d.ts +25 -0
  221. package/dist/commands/store/governance/policy.js +65 -0
  222. package/dist/commands/store/governance/publish-release.d.ts +17 -0
  223. package/dist/commands/store/governance/publish-release.js +34 -0
  224. package/dist/commands/tasks/assign.d.ts +9 -0
  225. package/dist/commands/tasks/assign.js +108 -1
  226. package/dist/commands/tasks/deliverable/add.d.ts +15 -0
  227. package/dist/commands/tasks/deliverable/add.js +174 -0
  228. package/dist/commands/tasks/deliverable/archive.d.ts +35 -0
  229. package/dist/commands/tasks/deliverable/archive.js +205 -0
  230. package/dist/commands/tasks/labels/detach.js +3 -0
  231. package/dist/commands/tasks/labels/suggest.d.ts +24 -0
  232. package/dist/commands/tasks/labels/suggest.js +69 -0
  233. package/dist/commands/tasks/list.d.ts +16 -2
  234. package/dist/commands/tasks/list.js +100 -24
  235. package/dist/commands/tasks/show.d.ts +23 -0
  236. package/dist/commands/tasks/show.js +51 -1
  237. package/dist/commands/wiki/rm.d.ts +22 -1
  238. package/dist/commands/wiki/rm.js +52 -3
  239. package/dist/lib/agentic-stream.js +10 -2
  240. package/dist/lib/assignee-resolver.d.ts +22 -0
  241. package/dist/lib/assignee-resolver.js +26 -0
  242. package/dist/lib/balance.d.ts +6 -1
  243. package/dist/lib/balance.js +15 -0
  244. package/dist/lib/code-handover.d.ts +0 -10
  245. package/dist/lib/code-handover.js +20 -5
  246. package/dist/lib/commerce-command.d.ts +48 -0
  247. package/dist/lib/commerce-command.js +70 -0
  248. package/dist/lib/commerce.d.ts +93 -0
  249. package/dist/lib/commerce.js +129 -0
  250. package/dist/lib/commitment-product.js +1 -1
  251. package/dist/lib/commitments.d.ts +202 -29
  252. package/dist/lib/commitments.js +300 -33
  253. package/dist/lib/dedicated-lease-command.js +10 -0
  254. package/dist/lib/dedicated-machines.d.ts +37 -0
  255. package/dist/lib/dedicated-machines.js +47 -0
  256. package/dist/lib/dedicated-service-command.d.ts +60 -0
  257. package/dist/lib/dedicated-service-command.js +182 -0
  258. package/dist/lib/dedicated-service.d.ts +342 -0
  259. package/dist/lib/dedicated-service.js +741 -0
  260. package/dist/lib/dedicated-ssh.d.ts +136 -0
  261. package/dist/lib/dedicated-ssh.js +387 -0
  262. package/dist/lib/delegated-cli.js +51 -13
  263. package/dist/lib/enterprise-commerce.d.ts +67 -0
  264. package/dist/lib/enterprise-commerce.js +112 -0
  265. package/dist/lib/enterprise-external-configuration.d.ts +60 -0
  266. package/dist/lib/enterprise-external-configuration.js +58 -0
  267. package/dist/lib/first-party-harness.js +17 -3
  268. package/dist/lib/governed-store.d.ts +110 -0
  269. package/dist/lib/governed-store.js +79 -0
  270. package/dist/lib/guest-service-command.d.ts +16 -0
  271. package/dist/lib/guest-service-command.js +32 -0
  272. package/dist/lib/guest-service.d.ts +67 -0
  273. package/dist/lib/guest-service.js +112 -0
  274. package/dist/lib/prompt.d.ts +1 -0
  275. package/dist/lib/prompt.js +1 -0
  276. package/dist/lib/task-asset-upload.d.ts +20 -0
  277. package/dist/lib/task-asset-upload.js +30 -8
  278. package/dist/lib/task-extras.d.ts +23 -0
  279. package/dist/lib/task-extras.js +6 -0
  280. package/dist/lib/update-check.d.ts +80 -7
  281. package/dist/lib/update-check.js +365 -33
  282. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/daemonScopes.d.ts +9 -3
  283. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/daemonScopes.js +10 -3
  284. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/firstPartyHarness.d.ts +9 -1
  285. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/firstPartyHarness.js +8 -0
  286. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/index.d.ts +1 -1
  287. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/index.js +6 -5
  288. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/messages.d.ts +16 -0
  289. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/messages.js +21 -4
  290. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/spawnEnv.d.ts +1 -1
  291. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/spawnEnv.js +24 -2
  292. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/daemonScopes.d.ts +9 -3
  293. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/daemonScopes.js +10 -3
  294. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/firstPartyHarness.d.ts +9 -1
  295. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/firstPartyHarness.js +8 -0
  296. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/index.d.ts +1 -1
  297. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/index.js +1 -1
  298. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/messages.d.ts +16 -0
  299. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/messages.js +20 -4
  300. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/spawnEnv.d.ts +1 -1
  301. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/spawnEnv.js +24 -2
  302. package/dist/node_modules/@skrr-ai/auth-core/package.json +1 -1
  303. package/dist/node_modules/@skrr-ai/data-provider/index.js +5067 -4821
  304. package/oclif.manifest.json +34877 -28659
  305. package/package.json +43 -1
@@ -0,0 +1,242 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const core_1 = require("@oclif/core");
4
+ const auth_core_1 = require("@skrr-ai/auth-core");
5
+ const base_command_1 = require("../../base-command");
6
+ const cli_installers_1 = require("../../lib/cli-installers");
7
+ const daemon_target_1 = require("../../lib/daemon-target");
8
+ const first_party_harness_1 = require("../../lib/first-party-harness");
9
+ /**
10
+ * `skrr code update` — pull the engine's signed release down through the daemon.
11
+ *
12
+ * ── Why this command exists ────────────────────────────────────────────────
13
+ *
14
+ * The update verb has been API-exposed and daemon-implemented since OSK-10096 —
15
+ * `POST /api/daemons/:id/cli-installers/:provider/update` re-fetches the signed
16
+ * manifest and installs whatever the channel points at. But the only CLI that
17
+ * reached it was `skrr harnesses install <provider> --update`: a flag on a
18
+ * command a `code` user has no reason to read. On stable that left no
19
+ * discoverable path at all — `code install` answered "Already installed." with
20
+ * no next step, and the channel moving past the installed build was invisible
21
+ * from the surface that owns the engine (OSK-10650).
22
+ *
23
+ * So this adds a SURFACE and no mechanism. Same route `harnesses install
24
+ * --update` posts, same inventory pre-check, same 504 recovery — one update
25
+ * path, spelled where the engine's users look.
26
+ */
27
+ class CodeUpdate extends base_command_1.BaseCommand {
28
+ static description = `Update the ${auth_core_1.FIRST_PARTY_HARNESS.displayName} engine on this machine, through the daemon`;
29
+ static examples = [
30
+ '<%= config.bin %> code update',
31
+ '<%= config.bin %> code update --daemon <daemon-id>',
32
+ '<%= config.bin %> code update --json',
33
+ ];
34
+ static flags = {
35
+ daemon: core_1.Flags.string({
36
+ description: 'Which daemon runs the update. Defaults to this machine on a Dedicated Runtime, otherwise to the only active one; required when you have several.',
37
+ }),
38
+ wait: core_1.Flags.boolean({
39
+ default: true,
40
+ allowNo: true,
41
+ description: 'Follow the update job until it finishes. --no-wait returns the job id.',
42
+ }),
43
+ json: core_1.Flags.boolean({ description: 'Emit the result as JSON' }),
44
+ };
45
+ async run() {
46
+ const { flags } = await this.parse(CodeUpdate);
47
+ const daemonId = this.updateTarget(await this.resolveTarget(flags.daemon));
48
+ // Ask the inventory before posting: a daemon older than managed updates has
49
+ // no handler for the request and would leave it to time out, and an engine
50
+ // that updates some other way has a reason the daemon already words.
51
+ let inventory;
52
+ try {
53
+ inventory = await (0, cli_installers_1.listCliInstallers)(daemonId, this.resolvedCredential);
54
+ }
55
+ catch (err) {
56
+ this.handleApiError(err);
57
+ }
58
+ const row = (inventory.providers ?? []).find((p) => (0, auth_core_1.isFirstPartyHarnessProvider)(p.provider));
59
+ if (!row) {
60
+ this.failWithCliError({
61
+ message: `${auth_core_1.FIRST_PARTY_HARNESS.displayName} is not installed on ${daemonId}. ` +
62
+ `Install it with \`${this.config.bin} code install\`.`,
63
+ code: 'NOT_INSTALLED',
64
+ exit: 1,
65
+ retryable: false,
66
+ });
67
+ }
68
+ if (row.updatable === undefined) {
69
+ this.failWithCliError({
70
+ message: `The daemon ${daemonId} (${inventory.daemonVersion ?? 'version not reported'}) cannot update ${auth_core_1.FIRST_PARTY_HARNESS.displayName}: it predates managed updates. ` +
71
+ `Update the daemon, then run this again.`,
72
+ code: 'DAEMON_UPDATE_UNSUPPORTED',
73
+ exit: 1,
74
+ retryable: false,
75
+ });
76
+ }
77
+ if (!row.updatable) {
78
+ this.failWithCliError({
79
+ message: row.updateDisabledReason?.trim() ||
80
+ `${auth_core_1.FIRST_PARTY_HARNESS.displayName}: the daemon cannot update it here.`,
81
+ code: 'CLI_NOT_UPDATABLE',
82
+ exit: 1,
83
+ retryable: false,
84
+ });
85
+ }
86
+ const start = await this.start(daemonId, flags.json === true);
87
+ if (!start)
88
+ return;
89
+ const jobId = start.job?.id;
90
+ if (!start.started || !jobId) {
91
+ if (flags.json) {
92
+ this.log(JSON.stringify({ daemonId, ...start }, null, 2));
93
+ return;
94
+ }
95
+ this.log(start.alreadyRunning
96
+ ? `${auth_core_1.FIRST_PARTY_HARNESS.displayName}: an install or update is already running (job ${start.job?.id ?? 'unknown'}).`
97
+ : `${auth_core_1.FIRST_PARTY_HARNESS.displayName}: ${start.provider?.updateDisabledReason?.trim() || 'the daemon started no update job.'}`);
98
+ return;
99
+ }
100
+ if (!flags.wait) {
101
+ if (flags.json) {
102
+ this.log(JSON.stringify({ daemonId, ...start }, null, 2));
103
+ return;
104
+ }
105
+ this.log(`Update started on ${daemonId} — job ${jobId}.`);
106
+ return;
107
+ }
108
+ if (!flags.json) {
109
+ this.logToStderr(`Updating ${auth_core_1.FIRST_PARTY_HARNESS.displayName} ${row.version ? `${row.version} ` : ''}on ${daemonId}…`);
110
+ }
111
+ const job = await this.follow(daemonId, jobId, flags.json === true);
112
+ if (!job)
113
+ return;
114
+ if (flags.json) {
115
+ this.log(JSON.stringify({ daemonId, job }, null, 2));
116
+ if (job.status !== 'succeeded')
117
+ process.exitCode = 1;
118
+ return;
119
+ }
120
+ if (job.status === 'failed') {
121
+ this.failWithCliError({
122
+ message: job.error || 'The update failed and the daemon gave no reason.',
123
+ code: 'UPDATE_FAILED',
124
+ exit: 1,
125
+ retryable: false,
126
+ });
127
+ }
128
+ this.log((0, cli_installers_1.updateOutcomeLine)(job) ??
129
+ `${auth_core_1.FIRST_PARTY_HARNESS.displayName} updated${job.installedVersion ? ` to ${job.installedVersion}` : ''}.`);
130
+ }
131
+ /** Which daemon the update targets, by the rule every daemon-picking command shares. */
132
+ async resolveTarget(explicit) {
133
+ try {
134
+ return await (0, daemon_target_1.resolveDaemonTarget)({
135
+ explicit,
136
+ local: (0, daemon_target_1.localMachine)({ baseURL: this.cliConfig?.baseURL }),
137
+ listActiveDaemons: () => (0, daemon_target_1.listConnectedDaemons)(this.resolvedCredential),
138
+ });
139
+ }
140
+ catch (err) {
141
+ this.handleApiError(err);
142
+ }
143
+ }
144
+ /**
145
+ * The daemon id to update through, or the refusal — identical rules to
146
+ * `code install`: a Dedicated Runtime's own machine is image-managed, several
147
+ * connected daemons get named rather than guessed.
148
+ */
149
+ updateTarget(target) {
150
+ if (target.kind === 'daemon')
151
+ return target.daemonId;
152
+ if (target.kind === 'this-machine') {
153
+ this.failWithCliError({
154
+ message: target.explicit
155
+ ? first_party_harness_1.DEDICATED_RUNTIME_ENGINE_MESSAGE
156
+ : `${first_party_harness_1.DEDICATED_RUNTIME_ENGINE_MESSAGE} This command updates the machine it runs on; ` +
157
+ 'to update another of your machines, name it with --daemon.',
158
+ code: 'DEDICATED_RUNTIME_ENGINE_SHIPS_WITH_IMAGE',
159
+ exit: 1,
160
+ retryable: false,
161
+ });
162
+ }
163
+ if (target.kind === 'none') {
164
+ this.failWithCliError({
165
+ message: 'No daemon is connected for this account, so nothing can perform the update. ' +
166
+ `Start the background service on this computer with \`${this.config.bin} daemon start\`, then run this again.`,
167
+ code: 'NO_DAEMON',
168
+ exit: 1,
169
+ retryable: false,
170
+ });
171
+ }
172
+ const { daemons } = target;
173
+ const choices = daemons
174
+ .slice(0, 10)
175
+ .map((d) => ` ${d.id} ${d.name || '—'}`)
176
+ .join('\n');
177
+ this.failWithCliError({
178
+ message: `${daemons.length} connected daemons — say which machine should update the engine:\n${choices}\n` +
179
+ `Pass one with --daemon, or see each daemon id in the DAEMON ID column of \`${this.config.bin} harnesses list\`.`,
180
+ code: 'AMBIGUOUS_DAEMON',
181
+ exit: 1,
182
+ retryable: false,
183
+ });
184
+ }
185
+ /**
186
+ * Start the update, and survive a gateway that cut the request off — the same
187
+ * 504 recovery `harnesses install --update` uses: the relay can drop the
188
+ * answer while the daemon runs the job it started, so on a server-side
189
+ * failure we ask the daemon and follow the job it reports.
190
+ */
191
+ async start(daemonId, json) {
192
+ try {
193
+ return await (0, cli_installers_1.startManagedCliUpdate)(daemonId, PROVIDER, this.resolvedCredential);
194
+ }
195
+ catch (err) {
196
+ const status = err.status ?? 0;
197
+ if (status >= 500 || status === 408) {
198
+ const job = await (0, cli_installers_1.jobStartedDespiteTimeout)(daemonId, PROVIDER, this.resolvedCredential);
199
+ if (job?.id) {
200
+ if (!json) {
201
+ this.logToStderr(`The request to ${daemonId} did not come back (HTTP ${status}), but the daemon started job ${job.id}. Following it.`);
202
+ }
203
+ return { started: true, job };
204
+ }
205
+ }
206
+ this.handleApiError(err);
207
+ return undefined;
208
+ }
209
+ }
210
+ /** Follow a job to its end, or report why it could not be followed (and return nothing). */
211
+ async follow(daemonId, jobId, json) {
212
+ const outcome = await (0, cli_installers_1.followManagedCliInstallJob)({
213
+ daemonId,
214
+ jobId,
215
+ credential: this.resolvedCredential,
216
+ onLogLine: json ? undefined : (line) => this.logToStderr(` ${line}`),
217
+ });
218
+ if (outcome.kind === 'missing') {
219
+ this.failWithCliError({
220
+ message: `The daemon no longer has update job ${jobId}.`,
221
+ code: 'JOB_MISSING',
222
+ exit: 1,
223
+ retryable: false,
224
+ });
225
+ return undefined;
226
+ }
227
+ if (outcome.kind === 'timeout') {
228
+ this.failWithCliError({
229
+ message: `Still updating after ${Math.round(cli_installers_1.INSTALL_MAX_WAIT_MS / 60000)} minutes — the daemon is ` +
230
+ `still working on job ${jobId}. Check \`${this.config.bin} code doctor\` in a while.`,
231
+ code: 'UPDATE_PENDING',
232
+ exit: 1,
233
+ retryable: true,
234
+ });
235
+ return undefined;
236
+ }
237
+ return outcome.job;
238
+ }
239
+ }
240
+ exports.default = CodeUpdate;
241
+ /** Same canonical provider id `code install` posts — read from the identity module. */
242
+ const PROVIDER = auth_core_1.FIRST_PARTY_HARNESS.provider;
@@ -0,0 +1,22 @@
1
+ import { BaseCommand } from '../../../base-command';
2
+ /**
3
+ * `skrr commerce entitlements explain` — WHY a subject can or cannot do a thing.
4
+ *
5
+ * The read that pays for this whole topic. "This account says it cannot do X"
6
+ * is a support question, and the answer is a trace through offers, contracts
7
+ * and grants. Tracing it from a terminal — and pasting the JSON into the
8
+ * ticket — is the case a console makes slow.
9
+ *
10
+ * The body is passed through because the question has a real shape (subject,
11
+ * capability, scope type and id) that the server validates. It is a QUESTION,
12
+ * so nothing is mutated by asking it.
13
+ */
14
+ export default class CommerceEntitlementsExplain extends BaseCommand {
15
+ static description: string;
16
+ static examples: string[];
17
+ static flags: {
18
+ file: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
19
+ json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
20
+ };
21
+ run(): Promise<void>;
22
+ }
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const base_command_1 = require("../../../base-command");
4
+ const commerce_1 = require("../../../lib/commerce");
5
+ const commerce_command_1 = require("../../../lib/commerce-command");
6
+ /**
7
+ * `skrr commerce entitlements explain` — WHY a subject can or cannot do a thing.
8
+ *
9
+ * The read that pays for this whole topic. "This account says it cannot do X"
10
+ * is a support question, and the answer is a trace through offers, contracts
11
+ * and grants. Tracing it from a terminal — and pasting the JSON into the
12
+ * ticket — is the case a console makes slow.
13
+ *
14
+ * The body is passed through because the question has a real shape (subject,
15
+ * capability, scope type and id) that the server validates. It is a QUESTION,
16
+ * so nothing is mutated by asking it.
17
+ */
18
+ class CommerceEntitlementsExplain extends base_command_1.BaseCommand {
19
+ static description = 'Explain why a subject does or does not hold a capability at a scope (admin). A question — it changes nothing.';
20
+ static examples = [
21
+ '<%= config.bin %> commerce entitlements explain --file ./question.json',
22
+ 'echo \'{"subject":{...},"capability":"...","scopeType":"workspace","scopeId":"..."}\' | <%= config.bin %> commerce entitlements explain --file -',
23
+ ];
24
+ static flags = { ...commerce_command_1.jsonBodyFlags };
25
+ async run() {
26
+ this.requireAuth();
27
+ const { flags } = await this.parse(CommerceEntitlementsExplain);
28
+ const body = await (0, commerce_command_1.jsonBodyFrom)(this, flags.file);
29
+ let result;
30
+ try {
31
+ result = await (0, commerce_1.explainCommerceEntitlement)(body);
32
+ }
33
+ catch (error) {
34
+ this.handleApiError(error);
35
+ return;
36
+ }
37
+ this.log(JSON.stringify(result, null, 2));
38
+ }
39
+ }
40
+ exports.default = CommerceEntitlementsExplain;
@@ -0,0 +1,20 @@
1
+ import { BaseCommand } from '../../../base-command';
2
+ /**
3
+ * What was DONE to an incident, as opposed to what it is.
4
+ *
5
+ * Kept a separate verb from `show` because the two answer different questions
6
+ * and one of them is the one you need when an incident looks resolved and
7
+ * nobody remembers who resolved it.
8
+ */
9
+ export default class CommerceIncidentsAudit extends BaseCommand {
10
+ static description: string;
11
+ static examples: string[];
12
+ static args: {
13
+ kind: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
14
+ incident: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
15
+ };
16
+ static flags: {
17
+ json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
18
+ };
19
+ run(): Promise<void>;
20
+ }
@@ -0,0 +1,37 @@
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 commerce_1 = require("../../../lib/commerce");
6
+ /**
7
+ * What was DONE to an incident, as opposed to what it is.
8
+ *
9
+ * Kept a separate verb from `show` because the two answer different questions
10
+ * and one of them is the one you need when an incident looks resolved and
11
+ * nobody remembers who resolved it.
12
+ */
13
+ class CommerceIncidentsAudit extends base_command_1.BaseCommand {
14
+ static description = 'Show the audit trail of one marketplace incident — who acted on it and when (admin).';
15
+ static examples = ['<%= config.bin %> commerce incidents audit integrity <incident-id>'];
16
+ static args = {
17
+ kind: core_1.Args.string({ description: 'Incident kind', required: true, ignoreStdin: true }),
18
+ incident: core_1.Args.string({ description: 'Incident id', required: true, ignoreStdin: true }),
19
+ };
20
+ static flags = {
21
+ json: core_1.Flags.boolean({ description: 'Output as JSON' }),
22
+ };
23
+ async run() {
24
+ this.requireAuth();
25
+ const { args } = await this.parse(CommerceIncidentsAudit);
26
+ let result;
27
+ try {
28
+ result = await (0, commerce_1.listMarketplaceIncidentAudit)(args.kind, args.incident);
29
+ }
30
+ catch (error) {
31
+ this.handleApiError(error);
32
+ return;
33
+ }
34
+ this.log(JSON.stringify(result, null, 2));
35
+ }
36
+ }
37
+ exports.default = CommerceIncidentsAudit;
@@ -0,0 +1,22 @@
1
+ import { BaseCommand } from '../../../base-command';
2
+ /**
3
+ * `skrr commerce incidents list <kind>` — the marketplace incident queue.
4
+ *
5
+ * `kind` stays a free positional rather than an enum here: the server owns the
6
+ * set of incident kinds, and hard-coding it in the CLI is the second
7
+ * declaration that drifts. An unknown kind is refused by the API with its own
8
+ * message, which is more useful than a stale list of options.
9
+ */
10
+ export default class CommerceIncidentsList extends BaseCommand {
11
+ static description: string;
12
+ static examples: string[];
13
+ static args: {
14
+ kind: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
15
+ };
16
+ static flags: {
17
+ status: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
18
+ limit: import("@oclif/core/lib/interfaces").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
19
+ json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
20
+ };
21
+ run(): Promise<void>;
22
+ }
@@ -0,0 +1,49 @@
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 commerce_1 = require("../../../lib/commerce");
6
+ /**
7
+ * `skrr commerce incidents list <kind>` — the marketplace incident queue.
8
+ *
9
+ * `kind` stays a free positional rather than an enum here: the server owns the
10
+ * set of incident kinds, and hard-coding it in the CLI is the second
11
+ * declaration that drifts. An unknown kind is refused by the API with its own
12
+ * message, which is more useful than a stale list of options.
13
+ */
14
+ class CommerceIncidentsList extends base_command_1.BaseCommand {
15
+ static description = 'List marketplace incidents of one kind — the queue an operator triages (admin).';
16
+ static examples = [
17
+ '<%= config.bin %> commerce incidents list integrity',
18
+ '<%= config.bin %> commerce incidents list fulfillment --limit 50',
19
+ ];
20
+ static args = {
21
+ kind: core_1.Args.string({
22
+ description: 'Incident kind, as the API defines it (e.g. integrity, fulfillment)',
23
+ required: true,
24
+ ignoreStdin: true,
25
+ }),
26
+ };
27
+ static flags = {
28
+ status: core_1.Flags.string({ description: 'Filter by status, when the API supports one' }),
29
+ limit: core_1.Flags.integer({ description: 'Maximum rows to return' }),
30
+ json: core_1.Flags.boolean({ description: 'Output as JSON' }),
31
+ };
32
+ async run() {
33
+ this.requireAuth();
34
+ const { args, flags } = await this.parse(CommerceIncidentsList);
35
+ let result;
36
+ try {
37
+ result = await (0, commerce_1.listMarketplaceIncidents)(args.kind, {
38
+ status: flags.status,
39
+ limit: flags.limit,
40
+ });
41
+ }
42
+ catch (error) {
43
+ this.handleApiError(error);
44
+ return;
45
+ }
46
+ this.log(JSON.stringify(result, null, 2));
47
+ }
48
+ }
49
+ exports.default = CommerceIncidentsList;
@@ -0,0 +1,23 @@
1
+ import { BaseCommand } from '../../../base-command';
2
+ /**
3
+ * `skrr commerce incidents resolve` — close an INTEGRITY incident.
4
+ *
5
+ * Integrity only, and not a flag on a generic verb. A fulfillment problem is
6
+ * RETRIED — the work runs again and the system decides. An integrity incident
7
+ * is RESOLVED — a person looked and stated a conclusion. Those are different
8
+ * acts with different evidence behind them, and a single `incidents fix` that
9
+ * chose between them by inspecting the kind would let a retry be recorded as a
10
+ * human judgement.
11
+ */
12
+ export default class CommerceIncidentsResolve extends BaseCommand {
13
+ static description: string;
14
+ static examples: string[];
15
+ static args: {
16
+ incident: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
17
+ };
18
+ static flags: {
19
+ file: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
20
+ json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
21
+ };
22
+ run(): Promise<void>;
23
+ }
@@ -0,0 +1,45 @@
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 commerce_1 = require("../../../lib/commerce");
6
+ const commerce_command_1 = require("../../../lib/commerce-command");
7
+ /**
8
+ * `skrr commerce incidents resolve` — close an INTEGRITY incident.
9
+ *
10
+ * Integrity only, and not a flag on a generic verb. A fulfillment problem is
11
+ * RETRIED — the work runs again and the system decides. An integrity incident
12
+ * is RESOLVED — a person looked and stated a conclusion. Those are different
13
+ * acts with different evidence behind them, and a single `incidents fix` that
14
+ * chose between them by inspecting the kind would let a retry be recorded as a
15
+ * human judgement.
16
+ */
17
+ class CommerceIncidentsResolve extends base_command_1.BaseCommand {
18
+ static description = 'Resolve an integrity incident with a stated resolution (admin). For a fulfillment problem use `commerce incidents retry` — running the work again is not the same act as somebody deciding.';
19
+ static examples = [
20
+ '<%= config.bin %> commerce incidents resolve <incident-id> --file ./resolution.json',
21
+ ];
22
+ static args = {
23
+ incident: core_1.Args.string({
24
+ description: 'Integrity incident id',
25
+ required: true,
26
+ ignoreStdin: true,
27
+ }),
28
+ };
29
+ static flags = { ...commerce_command_1.jsonBodyFlags };
30
+ async run() {
31
+ this.requireAuth();
32
+ const { args, flags } = await this.parse(CommerceIncidentsResolve);
33
+ const body = await (0, commerce_command_1.jsonBodyFrom)(this, flags.file);
34
+ let result;
35
+ try {
36
+ result = await (0, commerce_1.resolveIntegrityIncident)(args.incident, body);
37
+ }
38
+ catch (error) {
39
+ this.handleApiError(error);
40
+ return;
41
+ }
42
+ this.log(JSON.stringify(result, null, 2));
43
+ }
44
+ }
45
+ exports.default = CommerceIncidentsResolve;
@@ -0,0 +1,22 @@
1
+ import { BaseCommand } from '../../../base-command';
2
+ /**
3
+ * `skrr commerce incidents retry` — run a fulfillment reconciliation again.
4
+ *
5
+ * The id is a 64-char hex digest on the server, not an opaque row id: the
6
+ * reconciliation is addressed by WHAT it reconciles, which is what makes a
7
+ * retry idempotent rather than a second attempt at a different thing. The CLI
8
+ * does not validate the shape — a wrong id should be refused by the authority
9
+ * that owns the format, with its own message.
10
+ */
11
+ export default class CommerceIncidentsRetry extends BaseCommand {
12
+ static description: string;
13
+ static examples: string[];
14
+ static args: {
15
+ reconciliation: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
16
+ };
17
+ static flags: {
18
+ file: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
19
+ json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
20
+ };
21
+ run(): Promise<void>;
22
+ }
@@ -0,0 +1,45 @@
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 commerce_1 = require("../../../lib/commerce");
6
+ const commerce_command_1 = require("../../../lib/commerce-command");
7
+ /**
8
+ * `skrr commerce incidents retry` — run a fulfillment reconciliation again.
9
+ *
10
+ * The id is a 64-char hex digest on the server, not an opaque row id: the
11
+ * reconciliation is addressed by WHAT it reconciles, which is what makes a
12
+ * retry idempotent rather than a second attempt at a different thing. The CLI
13
+ * does not validate the shape — a wrong id should be refused by the authority
14
+ * that owns the format, with its own message.
15
+ */
16
+ class CommerceIncidentsRetry extends base_command_1.BaseCommand {
17
+ static description = 'Retry a marketplace fulfillment reconciliation (admin). Running the work again — not a statement that somebody judged it; for that see `commerce incidents resolve`.';
18
+ static examples = [
19
+ '<%= config.bin %> commerce incidents retry <reconciliation-id>',
20
+ '<%= config.bin %> commerce incidents retry <reconciliation-id> --file ./retry.json',
21
+ ];
22
+ static args = {
23
+ reconciliation: core_1.Args.string({
24
+ description: 'Fulfillment reconciliation id',
25
+ required: true,
26
+ ignoreStdin: true,
27
+ }),
28
+ };
29
+ static flags = { ...commerce_command_1.jsonBodyFlags };
30
+ async run() {
31
+ this.requireAuth();
32
+ const { args, flags } = await this.parse(CommerceIncidentsRetry);
33
+ const body = await (0, commerce_command_1.jsonBodyFrom)(this, flags.file, { required: false });
34
+ let result;
35
+ try {
36
+ result = await (0, commerce_1.retryFulfillmentReconciliation)(args.reconciliation, body);
37
+ }
38
+ catch (error) {
39
+ this.handleApiError(error);
40
+ return;
41
+ }
42
+ this.log(JSON.stringify(result, null, 2));
43
+ }
44
+ }
45
+ exports.default = CommerceIncidentsRetry;
@@ -0,0 +1,13 @@
1
+ import { BaseCommand } from '../../../base-command';
2
+ export default class CommerceIncidentsShow extends BaseCommand {
3
+ static description: string;
4
+ static examples: string[];
5
+ static args: {
6
+ kind: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
7
+ incident: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
8
+ };
9
+ static flags: {
10
+ json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
11
+ };
12
+ run(): Promise<void>;
13
+ }
@@ -0,0 +1,30 @@
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 commerce_1 = require("../../../lib/commerce");
6
+ class CommerceIncidentsShow extends base_command_1.BaseCommand {
7
+ static description = 'Show one marketplace incident (admin).';
8
+ static examples = ['<%= config.bin %> commerce incidents show integrity <incident-id>'];
9
+ static args = {
10
+ kind: core_1.Args.string({ description: 'Incident kind', required: true, ignoreStdin: true }),
11
+ incident: core_1.Args.string({ description: 'Incident id', required: true, ignoreStdin: true }),
12
+ };
13
+ static flags = {
14
+ json: core_1.Flags.boolean({ description: 'Output as JSON' }),
15
+ };
16
+ async run() {
17
+ this.requireAuth();
18
+ const { args } = await this.parse(CommerceIncidentsShow);
19
+ let result;
20
+ try {
21
+ result = await (0, commerce_1.getMarketplaceIncident)(args.kind, args.incident);
22
+ }
23
+ catch (error) {
24
+ this.handleApiError(error);
25
+ return;
26
+ }
27
+ this.log(JSON.stringify(result, null, 2));
28
+ }
29
+ }
30
+ exports.default = CommerceIncidentsShow;
@@ -0,0 +1,17 @@
1
+ import { BaseCommand } from '../../../base-command';
2
+ /**
3
+ * Step 2: somebody signs off. The server records WHO from the credential, so
4
+ * there is no `--actor` here — an approval a caller could attribute to someone
5
+ * else is not an approval.
6
+ */
7
+ export default class CommerceOffersApprove extends BaseCommand {
8
+ static description: string;
9
+ static examples: string[];
10
+ static args: {
11
+ offer: 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
+ }