@skrr-ai/cli 0.1.92 → 0.1.94

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 (323) hide show
  1. package/dist/base-command.d.ts +44 -0
  2. package/dist/base-command.js +96 -0
  3. package/dist/commands/agents/badge.d.ts +41 -0
  4. package/dist/commands/agents/badge.js +158 -0
  5. package/dist/commands/agents/create.d.ts +24 -0
  6. package/dist/commands/agents/create.js +212 -0
  7. package/dist/commands/agents/embed.d.ts +20 -0
  8. package/dist/commands/agents/embed.js +61 -0
  9. package/dist/commands/agents/operating-plan.d.ts +11 -0
  10. package/dist/commands/agents/operating-plan.js +54 -0
  11. package/dist/commands/agents/roles/example.d.ts +11 -0
  12. package/dist/commands/agents/roles/example.js +30 -0
  13. package/dist/commands/{commitments/mode.d.ts → agents/roles/export.d.ts} +5 -5
  14. package/dist/commands/agents/roles/export.js +81 -0
  15. package/dist/commands/agents/roles/install.d.ts +12 -0
  16. package/dist/commands/agents/roles/install.js +48 -0
  17. package/dist/commands/agents/roles/list.d.ts +11 -0
  18. package/dist/commands/agents/roles/list.js +36 -0
  19. package/dist/commands/agents/roles/preview.d.ts +14 -0
  20. package/dist/commands/agents/roles/preview.js +49 -0
  21. package/dist/commands/agents/roles/withdraw.d.ts +13 -0
  22. package/dist/commands/agents/roles/withdraw.js +43 -0
  23. package/dist/commands/agents/share.d.ts +27 -0
  24. package/dist/commands/agents/share.js +100 -0
  25. package/dist/commands/agents/vanity.d.ts +21 -0
  26. package/dist/commands/agents/vanity.js +77 -0
  27. package/dist/commands/agents/visibility.d.ts +21 -1
  28. package/dist/commands/agents/visibility.js +112 -0
  29. package/dist/commands/commands.d.ts +1 -0
  30. package/dist/commands/commands.js +22 -9
  31. package/dist/commands/commitments/{autonomy-requests → cadence-requests}/decide.d.ts +5 -7
  32. package/dist/commands/commitments/{autonomy-requests → cadence-requests}/decide.js +13 -15
  33. package/dist/commands/commitments/cost.d.ts +1 -1
  34. package/dist/commands/commitments/cost.js +1 -1
  35. package/dist/commands/commitments/create.d.ts +0 -7
  36. package/dist/commands/commitments/create.js +9 -98
  37. package/dist/commands/commitments/delivery.js +3 -21
  38. package/dist/commands/commitments/doctor.js +28 -27
  39. package/dist/commands/commitments/effective-policy.js +5 -36
  40. package/dist/commands/commitments/evaluations.d.ts +15 -0
  41. package/dist/commands/commitments/evaluations.js +54 -0
  42. package/dist/commands/commitments/pack/activate.d.ts +11 -0
  43. package/dist/commands/commitments/pack/activate.js +22 -0
  44. package/dist/commands/commitments/pack/bind.js +1 -1
  45. package/dist/commands/commitments/remediate.js +2 -5
  46. package/dist/commands/commitments/show.js +1 -1
  47. package/dist/commands/commitments/update.js +9 -9
  48. package/dist/commands/commitments/wake-capabilities.d.ts +1 -3
  49. package/dist/commands/commitments/wake-capabilities.js +5 -21
  50. package/dist/commands/earnings/attributions.d.ts +17 -0
  51. package/dist/commands/earnings/attributions.js +82 -0
  52. package/dist/commands/earnings/index.js +2 -1
  53. package/dist/commands/generate-recovery-code.js +4 -3
  54. package/dist/commands/github/allow-tools.d.ts +1 -0
  55. package/dist/commands/github/app/install.d.ts +1 -0
  56. package/dist/commands/github/app/status.d.ts +1 -0
  57. package/dist/commands/github/connect.d.ts +1 -0
  58. package/dist/commands/github/connections.d.ts +1 -0
  59. package/dist/commands/github/disconnect.d.ts +1 -0
  60. package/dist/commands/github/finalize.d.ts +1 -0
  61. package/dist/commands/github/reconnect.d.ts +1 -0
  62. package/dist/commands/github/run.d.ts +1 -0
  63. package/dist/commands/github/tools.d.ts +1 -0
  64. package/dist/commands/integrations/connections/connect.d.ts +1 -0
  65. package/dist/commands/integrations/connections/disconnect.d.ts +1 -0
  66. package/dist/commands/integrations/connections/finalize.d.ts +1 -0
  67. package/dist/commands/integrations/connections/list.d.ts +1 -0
  68. package/dist/commands/integrations/connections/reconnect.d.ts +1 -0
  69. package/dist/commands/integrations/execute.d.ts +1 -0
  70. package/dist/commands/integrations/search.d.ts +1 -0
  71. package/dist/commands/integrations/toolkits.d.ts +1 -0
  72. package/dist/commands/integrations/tools/allow.d.ts +1 -0
  73. package/dist/commands/integrations/tools/list.d.ts +1 -0
  74. package/dist/commands/login.js +12 -0
  75. package/dist/commands/machines/dedicated/logs.d.ts +19 -0
  76. package/dist/commands/machines/dedicated/logs.js +103 -0
  77. package/dist/commands/machines/dedicated/power/set.js +1 -1
  78. package/dist/commands/open.d.ts +24 -0
  79. package/dist/commands/open.js +74 -0
  80. package/dist/commands/projects/archive.d.ts +1 -0
  81. package/dist/commands/projects/archive.js +23 -0
  82. package/dist/commands/projects/delete.d.ts +1 -0
  83. package/dist/commands/projects/delete.js +23 -0
  84. package/dist/commands/projects/list.d.ts +3 -0
  85. package/dist/commands/projects/list.js +12 -2
  86. package/dist/commands/spaces/actions/add.js +4 -3
  87. package/dist/commands/spaces/actions/available.js +3 -2
  88. package/dist/commands/spaces/actions/list.js +5 -4
  89. package/dist/commands/spaces/actions/replace.js +6 -5
  90. package/dist/commands/spaces/archive.js +3 -2
  91. package/dist/commands/spaces/auto-executor/preview.js +4 -3
  92. package/dist/commands/spaces/auto-executor/run.js +4 -3
  93. package/dist/commands/spaces/auto-executor/runs.js +3 -2
  94. package/dist/commands/spaces/auto-executor/update.js +4 -3
  95. package/dist/commands/spaces/bootstrap.js +3 -2
  96. package/dist/commands/spaces/briefs/delete.js +3 -2
  97. package/dist/commands/spaces/briefs/get.js +3 -2
  98. package/dist/commands/spaces/briefs/list.js +3 -2
  99. package/dist/commands/spaces/briefs/set.js +5 -4
  100. package/dist/commands/spaces/capacity.js +5 -4
  101. package/dist/commands/spaces/conversations.js +3 -2
  102. package/dist/commands/spaces/cycles/create.js +3 -2
  103. package/dist/commands/spaces/cycles/graph.js +2 -1
  104. package/dist/commands/spaces/cycles/list.js +3 -2
  105. package/dist/commands/spaces/cycles/settings.js +4 -3
  106. package/dist/commands/spaces/cycles/show.js +3 -2
  107. package/dist/commands/spaces/cycles/update.js +3 -2
  108. package/dist/commands/spaces/delete.js +4 -3
  109. package/dist/commands/spaces/expertise-suggestions.js +4 -3
  110. package/dist/commands/spaces/files/delete.js +3 -2
  111. package/dist/commands/spaces/files/folders/create.js +3 -2
  112. package/dist/commands/spaces/files/folders/delete.js +3 -2
  113. package/dist/commands/spaces/files/folders/list.js +3 -2
  114. package/dist/commands/spaces/files/folders/update.js +3 -2
  115. package/dist/commands/spaces/files/list.js +3 -2
  116. package/dist/commands/spaces/files/move.js +3 -2
  117. package/dist/commands/spaces/files/rename.js +3 -2
  118. package/dist/commands/spaces/files/upload.js +6 -5
  119. package/dist/commands/spaces/github-automations/set.js +3 -2
  120. package/dist/commands/spaces/github-automations/show.js +3 -2
  121. package/dist/commands/spaces/goals.js +2 -1
  122. package/dist/commands/spaces/heartbeats/create.js +4 -3
  123. package/dist/commands/spaces/heartbeats/delete.js +4 -3
  124. package/dist/commands/spaces/heartbeats/list.js +4 -3
  125. package/dist/commands/spaces/heartbeats/status.js +3 -2
  126. package/dist/commands/spaces/heartbeats/update.js +4 -3
  127. package/dist/commands/spaces/insights.js +5 -4
  128. package/dist/commands/spaces/labels/add.js +4 -3
  129. package/dist/commands/spaces/labels/list.js +2 -1
  130. package/dist/commands/spaces/labels/remove.js +4 -3
  131. package/dist/commands/spaces/list.d.ts +3 -0
  132. package/dist/commands/spaces/list.js +11 -2
  133. package/dist/commands/spaces/live/cards/create.js +3 -2
  134. package/dist/commands/spaces/live/cards/list.js +3 -2
  135. package/dist/commands/spaces/live/cards/reorder.js +7 -2
  136. package/dist/commands/spaces/live/scene.js +4 -3
  137. package/dist/commands/spaces/members/add.js +7 -6
  138. package/dist/commands/spaces/members/list.js +4 -3
  139. package/dist/commands/spaces/members/remove.js +7 -6
  140. package/dist/commands/spaces/move.js +3 -2
  141. package/dist/commands/spaces/pin.js +5 -4
  142. package/dist/commands/spaces/preferences/show.js +4 -3
  143. package/dist/commands/spaces/preferences/tabs.js +4 -3
  144. package/dist/commands/spaces/revisions.js +3 -2
  145. package/dist/commands/spaces/room/ensure.js +5 -4
  146. package/dist/commands/spaces/room/messages.js +3 -2
  147. package/dist/commands/spaces/room/show.js +5 -4
  148. package/dist/commands/spaces/skills/add.js +4 -3
  149. package/dist/commands/spaces/skills/list.js +3 -2
  150. package/dist/commands/spaces/skills/pin.js +4 -3
  151. package/dist/commands/spaces/skills/remove.js +4 -3
  152. package/dist/commands/spaces/snapshot.js +3 -2
  153. package/dist/commands/spaces/states/archive.js +3 -2
  154. package/dist/commands/spaces/states/create.js +3 -2
  155. package/dist/commands/spaces/states/list.js +3 -2
  156. package/dist/commands/spaces/states/reorder.js +2 -1
  157. package/dist/commands/spaces/states/update.js +3 -2
  158. package/dist/commands/spaces/summary.js +4 -3
  159. package/dist/commands/spaces/tasks.d.ts +3 -0
  160. package/dist/commands/spaces/tasks.js +14 -3
  161. package/dist/commands/spaces/triggers/delete.js +5 -4
  162. package/dist/commands/spaces/triggers/set.js +4 -3
  163. package/dist/commands/spaces/triggers/show.js +4 -3
  164. package/dist/commands/spaces/unarchive.js +3 -2
  165. package/dist/commands/spaces/update.js +5 -4
  166. package/dist/commands/spaces/views/create.js +3 -2
  167. package/dist/commands/spaces/views/list.js +3 -2
  168. package/dist/commands/spaces/views/reorder.js +6 -3
  169. package/dist/commands/spaces/views/subscribe.js +2 -1
  170. package/dist/commands/spaces/views/subscriptions.js +1 -0
  171. package/dist/commands/spaces/views/unsubscribe.js +2 -1
  172. package/dist/commands/spaces/widgets/add.js +4 -3
  173. package/dist/commands/spaces/widgets/list.js +3 -2
  174. package/dist/commands/spaces/widgets/remove.js +5 -4
  175. package/dist/commands/spaces/work-graph.js +2 -1
  176. package/dist/commands/store/install.d.ts +1 -1
  177. package/dist/commands/store/install.js +24 -8
  178. package/dist/commands/store/show.d.ts +25 -0
  179. package/dist/commands/store/show.js +203 -0
  180. package/dist/commands/store/stats.d.ts +33 -0
  181. package/dist/commands/store/stats.js +258 -0
  182. package/dist/commands/tasks/actions/attach.js +1 -1
  183. package/dist/commands/tasks/actions/detach.js +4 -3
  184. package/dist/commands/tasks/activity.js +3 -2
  185. package/dist/commands/tasks/ancestors.js +2 -1
  186. package/dist/commands/tasks/approvals/create.js +2 -1
  187. package/dist/commands/tasks/approvals/delete.js +3 -2
  188. package/dist/commands/tasks/approvals/list.js +5 -4
  189. package/dist/commands/tasks/approvals/resolve.js +2 -1
  190. package/dist/commands/tasks/archive.js +3 -2
  191. package/dist/commands/tasks/assign.js +4 -3
  192. package/dist/commands/tasks/attachments/delete.js +3 -2
  193. package/dist/commands/tasks/attachments/download.d.ts +1 -0
  194. package/dist/commands/tasks/attachments/download.js +20 -1
  195. package/dist/commands/tasks/attachments/list.js +2 -1
  196. package/dist/commands/tasks/attachments/set-role.js +2 -1
  197. package/dist/commands/tasks/attachments/upload.js +2 -1
  198. package/dist/commands/tasks/bulk-update.d.ts +1 -0
  199. package/dist/commands/tasks/bulk-update.js +106 -15
  200. package/dist/commands/tasks/cancel-cascade.d.ts +1 -0
  201. package/dist/commands/tasks/cancel-cascade.js +13 -3
  202. package/dist/commands/tasks/cascade-status.js +2 -1
  203. package/dist/commands/tasks/checkout.js +3 -2
  204. package/dist/commands/tasks/children.js +2 -1
  205. package/dist/commands/tasks/comments/add.js +7 -6
  206. package/dist/commands/tasks/comments/anchor.js +8 -7
  207. package/dist/commands/tasks/comments/delete.js +3 -2
  208. package/dist/commands/tasks/comments/list.js +2 -1
  209. package/dist/commands/tasks/comments/reopen.js +3 -2
  210. package/dist/commands/tasks/comments/resolve.js +3 -2
  211. package/dist/commands/tasks/create-tree.d.ts +63 -0
  212. package/dist/commands/tasks/create-tree.js +197 -4
  213. package/dist/commands/tasks/delete.js +5 -4
  214. package/dist/commands/tasks/descendants.js +2 -1
  215. package/dist/commands/tasks/dri-plan.js +3 -2
  216. package/dist/commands/tasks/dri-run.js +3 -2
  217. package/dist/commands/tasks/dri-status.js +2 -1
  218. package/dist/commands/tasks/duplicate-pipeline.js +2 -1
  219. package/dist/commands/tasks/execution-summary.js +2 -1
  220. package/dist/commands/tasks/execution-timeline.js +2 -1
  221. package/dist/commands/tasks/fork.js +1 -0
  222. package/dist/commands/tasks/forward.js +4 -3
  223. package/dist/commands/tasks/handover.js +1 -0
  224. package/dist/commands/tasks/interrupt.js +3 -2
  225. package/dist/commands/tasks/labels/attach.js +4 -3
  226. package/dist/commands/tasks/labels/detach.js +4 -3
  227. package/dist/commands/tasks/labels/suggest.js +5 -4
  228. package/dist/commands/tasks/list.d.ts +27 -1
  229. package/dist/commands/tasks/list.js +101 -3
  230. package/dist/commands/tasks/move.js +4 -3
  231. package/dist/commands/tasks/output.js +6 -5
  232. package/dist/commands/tasks/pause-schedule.js +3 -2
  233. package/dist/commands/tasks/promote.js +1 -0
  234. package/dist/commands/tasks/prompt-log.js +2 -1
  235. package/dist/commands/tasks/release.js +5 -4
  236. package/dist/commands/tasks/remind.js +2 -1
  237. package/dist/commands/tasks/replay.js +3 -2
  238. package/dist/commands/tasks/report.js +1 -0
  239. package/dist/commands/tasks/resume-schedule.js +3 -2
  240. package/dist/commands/tasks/retry-schedule.js +3 -2
  241. package/dist/commands/tasks/retry.js +10 -9
  242. package/dist/commands/tasks/revisions.js +2 -1
  243. package/dist/commands/tasks/runs.js +6 -5
  244. package/dist/commands/tasks/schedule.js +3 -2
  245. package/dist/commands/tasks/self-schedule.js +6 -5
  246. package/dist/commands/tasks/skills/pin.js +3 -2
  247. package/dist/commands/tasks/skills/unpin.js +3 -2
  248. package/dist/commands/tasks/snooze.js +6 -5
  249. package/dist/commands/tasks/start-all.js +5 -4
  250. package/dist/commands/tasks/subscribe.js +1 -0
  251. package/dist/commands/tasks/tags/add.js +4 -3
  252. package/dist/commands/tasks/tags/remove.js +4 -3
  253. package/dist/commands/tasks/timeline.js +3 -2
  254. package/dist/commands/tasks/today.d.ts +4 -1
  255. package/dist/commands/tasks/today.js +12 -2
  256. package/dist/commands/tasks/transcript.js +6 -5
  257. package/dist/commands/tasks/unschedule.js +3 -2
  258. package/dist/commands/tasks/unsnooze.js +3 -2
  259. package/dist/commands/tasks/unsubscribe.js +2 -1
  260. package/dist/commands/tasks/update.js +5 -4
  261. package/dist/commands/tasks/wait.js +5 -4
  262. package/dist/lib/agent-distribution.d.ts +37 -0
  263. package/dist/lib/agent-distribution.js +63 -0
  264. package/dist/lib/agent-ref.d.ts +69 -0
  265. package/dist/lib/agent-ref.js +168 -0
  266. package/dist/lib/api-fetch.d.ts +2 -0
  267. package/dist/lib/api-fetch.js +14 -3
  268. package/dist/lib/command-hygiene.d.ts +13 -0
  269. package/dist/lib/command-hygiene.js +62 -2
  270. package/dist/lib/commitment-product.d.ts +0 -6
  271. package/dist/lib/commitment-product.js +1 -30
  272. package/dist/lib/commitments.d.ts +9 -45
  273. package/dist/lib/commitments.js +24 -95
  274. package/dist/lib/dedicated-power.d.ts +5 -0
  275. package/dist/lib/dedicated-power.js +30 -2
  276. package/dist/lib/dry-run-plans.d.ts +50 -0
  277. package/dist/lib/dry-run-plans.js +85 -0
  278. package/dist/lib/json-output.d.ts +31 -0
  279. package/dist/lib/json-output.js +78 -0
  280. package/dist/lib/list-output.d.ts +75 -0
  281. package/dist/lib/list-output.js +266 -0
  282. package/dist/lib/machine-daemon-log.d.ts +36 -0
  283. package/dist/lib/machine-daemon-log.js +78 -0
  284. package/dist/lib/node-adapter.js +10 -1
  285. package/dist/lib/northstars.js +1 -1
  286. package/dist/lib/open-target.d.ts +12 -0
  287. package/dist/lib/open-target.js +108 -0
  288. package/dist/lib/rate-limit-retry.d.ts +45 -0
  289. package/dist/lib/rate-limit-retry.js +88 -0
  290. package/dist/lib/roles.d.ts +98 -0
  291. package/dist/lib/roles.js +45 -0
  292. package/dist/lib/store-listing.d.ts +45 -0
  293. package/dist/lib/store-listing.js +186 -0
  294. package/dist/lib/task-batch.d.ts +67 -0
  295. package/dist/lib/task-batch.js +227 -0
  296. package/dist/lib/terminal-qr.d.ts +55 -0
  297. package/dist/lib/terminal-qr.js +119 -0
  298. package/dist/lib/web-url.d.ts +11 -0
  299. package/dist/lib/web-url.js +24 -0
  300. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/commitmentExecutionContract.d.ts +45 -0
  301. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/commitmentExecutionContract.js +550 -0
  302. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/computerWire.d.ts +68 -0
  303. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/computerWire.js +47 -1
  304. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/sessionPermissionAuthority.d.ts +7 -44
  305. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/sessionPermissionAuthority.js +8 -47
  306. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/commitmentExecutionContract.d.ts +45 -0
  307. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/commitmentExecutionContract.js +545 -0
  308. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/computerWire.d.ts +68 -0
  309. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/computerWire.js +46 -0
  310. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/sessionPermissionAuthority.d.ts +7 -44
  311. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/sessionPermissionAuthority.js +8 -47
  312. package/dist/node_modules/@skrr-ai/auth-core/package.json +11 -1
  313. package/dist/node_modules/@skrr-ai/data-provider/index.js +7285 -6673
  314. package/dist/node_modules/@skrr-ai/data-provider/package.json +2 -2
  315. package/oclif.manifest.json +35937 -26820
  316. package/package.json +6 -2
  317. package/dist/commands/commitments/autonomy.d.ts +0 -30
  318. package/dist/commands/commitments/autonomy.js +0 -67
  319. package/dist/commands/commitments/mode.js +0 -58
  320. package/dist/commands/commitments/pack/promote.d.ts +0 -19
  321. package/dist/commands/commitments/pack/promote.js +0 -46
  322. package/dist/commands/commitments/pack/shadow.d.ts +0 -20
  323. package/dist/commands/commitments/pack/shadow.js +0 -42
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FROM_SPEC_COMPATIBLE_FLAGS = void 0;
3
4
  exports.agentCreateMissingFieldsMessage = agentCreateMissingFieldsMessage;
4
5
  exports.agentCreateMissingFields = agentCreateMissingFields;
5
6
  exports.unappliedPayloadKeys = unappliedPayloadKeys;
@@ -15,6 +16,7 @@ const execution_target_1 = require("../../lib/execution-target");
15
16
  const prompt_1 = require("../../lib/prompt");
16
17
  const agent_config_1 = require("../../lib/agent-config");
17
18
  const web_url_1 = require("../../lib/web-url");
19
+ const agent_spec_1 = require("../../lib/agent-spec");
18
20
  /**
19
21
  * OSK-4831 — build the missing-fields sentence from the real missing set.
20
22
  *
@@ -138,6 +140,23 @@ function backgroundLoopLines(agentId, relationshipLoopsSkipped) {
138
140
  ' skrr agents create --no-relationship-loops # a single-purpose agent next time',
139
141
  ];
140
142
  }
143
+ /**
144
+ * The flags `--from-spec` may be combined with: placement and identity for the
145
+ * NEW row, which a spec document deliberately cannot carry (where an agent runs
146
+ * is not portable). Every configuration flag is refused alongside it, because
147
+ * the file is the source — a flag that quietly overrode a line of it would
148
+ * leave git and the agent disagreeing from the first push.
149
+ */
150
+ exports.FROM_SPEC_COMPATIBLE_FLAGS = Object.freeze([
151
+ 'from-spec',
152
+ 'json',
153
+ 'name',
154
+ 'target',
155
+ 'next-target',
156
+ 'working-directory',
157
+ 'default-permission-mode',
158
+ 'no-relationship-loops',
159
+ ]);
141
160
  class AgentsCreate extends base_command_1.BaseCommand {
142
161
  static description = 'Create a new agent in the selected workspace, or in your default workspace when --workspace is omitted (`skrr workspaces list` names it)';
143
162
  static examples = [
@@ -147,11 +166,19 @@ class AgentsCreate extends base_command_1.BaseCommand {
147
166
  '<%= config.bin %> agents create --from-json agent.json',
148
167
  'cat agent.json | <%= config.bin %> agents create --from-json -',
149
168
  '<%= config.bin %> agents create --from-json template.json --name "Override name"',
169
+ '<%= config.bin %> agents create --from-spec agents/reviewer.agent.json',
170
+ '<%= config.bin %> agents create --from-spec agents/reviewer.agent.json --name "Reviewer (staging)" --target hosted-machine',
150
171
  ];
151
172
  static flags = {
152
173
  json: core_1.Flags.boolean({ description: 'Output the created agent as JSON' }),
153
174
  'from-json': core_1.Flags.string({
154
175
  description: 'Path to a JSON file (or "-" for stdin) to use as the request body',
176
+ exclusive: ['from-spec'],
177
+ }),
178
+ 'from-spec': core_1.Flags.string({
179
+ description: 'Create the agent from an agent-as-code spec document (`skrr agents pull` writes one; "-" for stdin). ' +
180
+ 'Checked with the same rules as `agents push`; a refused document leaves no agent behind',
181
+ exclusive: ['from-json'],
155
182
  }),
156
183
  // `--title` is an alias, not a rename (OSK-4850). tasks, spaces, projects,
157
184
  // goals and `chats create` all name the thing with `--title`, so muscle
@@ -295,6 +322,10 @@ class AgentsCreate extends base_command_1.BaseCommand {
295
322
  async run() {
296
323
  this.requireAuth();
297
324
  const { flags } = await this.parse(AgentsCreate);
325
+ if (flags['from-spec']) {
326
+ await this.createFromSpec(flags);
327
+ return;
328
+ }
298
329
  // Default to {} so TS flow-analysis is satisfied — the catch calls this.error(), which throws.
299
330
  let body = {};
300
331
  try {
@@ -447,5 +478,186 @@ class AgentsCreate extends base_command_1.BaseCommand {
447
478
  }
448
479
  this.log(`URL: ${(0, web_url_1.withAgentUrl)(this.cliConfig.baseURL, a).url ?? '-'}`);
449
480
  }
481
+ /**
482
+ * `agents create --from-spec <file>`: bootstrap a NEW agent from an
483
+ * agent-as-code document, so a repository can hold an agent before one
484
+ * exists (`agents push` needs an existing id).
485
+ *
486
+ * Two writes, one writer per concern. The create carries only what makes a
487
+ * row — its name, provider, model and placement — and every other field
488
+ * reaches the agent through the push endpoint, so the document is held to
489
+ * exactly the rules `agents push` and `agents validate` apply (portable
490
+ * fields only, no credentials, no withheld references, nothing push may not
491
+ * set). Validation runs first with no network. If the server then refuses
492
+ * the document, the agent just created is deleted again: a refused spec must
493
+ * not leave behind a half-configured agent that looks like it worked.
494
+ */
495
+ async createFromSpec(flags) {
496
+ const source = String(flags['from-spec']);
497
+ const incompatible = Object.keys(flags)
498
+ // This command's own flags only: the global ones (--profile, --workspace,
499
+ // --token, --bare) choose WHO creates, not what is created.
500
+ .filter((flag) => Object.prototype.hasOwnProperty.call(AgentsCreate.flags, flag))
501
+ .filter((flag) => flags[flag] !== undefined && flags[flag] !== false)
502
+ .filter((flag) => !exports.FROM_SPEC_COMPATIBLE_FLAGS.includes(flag));
503
+ if (incompatible.length > 0) {
504
+ this.failWithCliError({
505
+ message: `--from-spec takes the agent's configuration from ${source}; ` +
506
+ `${incompatible.map((flag) => `--${flag}`).join(', ')} cannot be combined with it. ` +
507
+ 'Edit the file instead (placement flags --target, --next-target, --working-directory, ' +
508
+ '--default-permission-mode, and --name, are accepted).',
509
+ code: 'AGENT_SPEC_FLAG_CONFLICT',
510
+ exit: 1,
511
+ retryable: false,
512
+ details: { incompatible },
513
+ });
514
+ }
515
+ let raw;
516
+ try {
517
+ raw = await (0, agent_spec_1.readSpecSource)(source);
518
+ }
519
+ catch (err) {
520
+ this.failWithCliError({
521
+ message: `Could not read ${source}: ${err.message}`,
522
+ code: 'AGENT_SPEC_READ_FAILED',
523
+ exit: 1,
524
+ retryable: true,
525
+ details: { path: source },
526
+ });
527
+ }
528
+ const parsed = (0, agent_spec_1.parseAndValidateAgentSpec)(raw, source);
529
+ if (!parsed.ok) {
530
+ this.failWithCliError({
531
+ message: parsed.message,
532
+ code: 'AGENT_SPEC_NOT_JSON',
533
+ exit: 1,
534
+ retryable: false,
535
+ });
536
+ }
537
+ if (!parsed.validation.ok) {
538
+ this.failWithCliError({
539
+ message: (0, agent_spec_1.issueBlock)(`Refused before sending: ${source} carries fields that may not travel. No agent was created.`, parsed.validation.issues),
540
+ code: 'AGENT_SPEC_INVALID',
541
+ exit: 1,
542
+ retryable: false,
543
+ details: { issues: parsed.validation.issues },
544
+ });
545
+ }
546
+ const document = parsed.validation.document;
547
+ const spec = { ...document.spec };
548
+ // `--name` renames the copy (a staging twin of a committed agent). It is
549
+ // written into the document too, or the push would rename it straight back.
550
+ if (typeof flags.name === 'string' && flags.name.trim())
551
+ spec.name = flags.name.trim();
552
+ const name = typeof spec.name === 'string' ? spec.name.trim() : '';
553
+ if (!name) {
554
+ this.failWithCliError({
555
+ message: `${source} has no "name" under "spec". Add one, or pass --name.`,
556
+ code: 'AGENT_CREATE_MISSING_FIELDS',
557
+ exit: 1,
558
+ retryable: false,
559
+ details: { missing: ['--name'] },
560
+ });
561
+ }
562
+ // Placement is never in a spec (it is not portable), so it defaults here
563
+ // exactly as a named create does, and the defaults are said out loud.
564
+ const appliedDefaults = [];
565
+ const provider = typeof spec.provider === 'string' && spec.provider ? spec.provider : 'agentic';
566
+ if (provider !== spec.provider)
567
+ appliedDefaults.push('provider=agentic');
568
+ const model = typeof spec.model === 'string' && spec.model ? spec.model : 'default';
569
+ if (model !== spec.model)
570
+ appliedDefaults.push('model=default');
571
+ let target = typeof flags.target === 'string' ? flags.target : undefined;
572
+ const nextTargets = flags['next-target'] ?? [];
573
+ if (!target) {
574
+ if (nextTargets.length > 0) {
575
+ this.error('--next-target requires --target.', { exit: 1 });
576
+ }
577
+ target = 'agent-worker';
578
+ appliedDefaults.push('target=agent-worker');
579
+ }
580
+ let executionPolicy;
581
+ try {
582
+ executionPolicy = (0, execution_target_1.buildExecutionOrderPatch)({
583
+ selectors: [target, ...nextTargets],
584
+ }).executionPolicy;
585
+ }
586
+ catch (err) {
587
+ this.error(err.message, { exit: 1 });
588
+ }
589
+ const payload = (0, prompt_1.mergeDefined)({}, {
590
+ name,
591
+ provider,
592
+ model,
593
+ executionPolicy,
594
+ workingDirectory: flags['working-directory'],
595
+ defaultPermissionMode: flags['default-permission-mode'],
596
+ relationshipLoops: flags['no-relationship-loops'] ? false : undefined,
597
+ });
598
+ let created;
599
+ try {
600
+ created = (await data_provider_1.dataService.createAgent(payload));
601
+ }
602
+ catch (err) {
603
+ this.handleApiError(err);
604
+ }
605
+ const agentId = String(created.id ?? created._id ?? '');
606
+ let pushed;
607
+ try {
608
+ pushed = await data_provider_1.dataService.pushAgentSpec(agentId, { ...document, spec });
609
+ }
610
+ catch (err) {
611
+ // Undo the create first, then report — whichever way the undo went.
612
+ let rollback;
613
+ try {
614
+ await data_provider_1.dataService.deleteAgent({ agent_id: agentId });
615
+ rollback = `The agent created for it (${agentId}) was deleted again.`;
616
+ }
617
+ catch (deleteErr) {
618
+ rollback =
619
+ `The agent created for it (${agentId}) could NOT be deleted ` +
620
+ `(${deleteErr.message}); remove it with \`skrr agents delete ${agentId}\`.`;
621
+ }
622
+ const refusal = (0, agent_spec_1.refusalIssues)(err);
623
+ this.failWithCliError({
624
+ message: refusal
625
+ ? (0, agent_spec_1.issueBlock)(`The server refused ${source}. ${rollback}`, refusal.issues)
626
+ : `Could not apply ${source} (${err.message}). ${rollback}`,
627
+ code: refusal?.code ?? 'AGENT_SPEC_REFUSED',
628
+ status: err.status,
629
+ exit: 1,
630
+ retryable: !refusal,
631
+ details: { agentId, rolledBack: !rollback.includes('NOT'), issues: refusal?.issues },
632
+ });
633
+ }
634
+ if (flags.json) {
635
+ this.log(JSON.stringify({
636
+ agent: (0, web_url_1.withAgentUrl)(this.cliConfig.baseURL, created),
637
+ spec: {
638
+ source,
639
+ applied: pushed.applied,
640
+ unchanged: pushed.unchanged,
641
+ derived: pushed.derived ?? [],
642
+ untouched: pushed.untouched,
643
+ },
644
+ defaultsApplied: appliedDefaults,
645
+ }, null, 2));
646
+ return;
647
+ }
648
+ const fields = [...pushed.applied, ...pushed.unchanged];
649
+ this.log(`Created agent ${agentId} — ${name}, from ${source} (${fields.length} field(s)).`);
650
+ if (appliedDefaults.length > 0)
651
+ this.log(`Defaults applied: ${appliedDefaults.join(', ')}`);
652
+ const derived = pushed.derived ?? [];
653
+ if (derived.length > 0) {
654
+ this.log(`Not taken from the file, because the server derives it from other fields: ${derived.join(', ')}.`);
655
+ }
656
+ this.log(`Keep the file in step: \`skrr agents push ${agentId} --file ${source === '-' ? '<file>' : source}\`.`);
657
+ for (const line of backgroundLoopLines(agentId, flags['no-relationship-loops'] === true)) {
658
+ this.log(line);
659
+ }
660
+ this.log(`URL: ${(0, web_url_1.withAgentUrl)(this.cliConfig.baseURL, created).url ?? '-'}`);
661
+ }
450
662
  }
451
663
  exports.default = AgentsCreate;
@@ -0,0 +1,20 @@
1
+ import { BaseCommand } from '../../base-command';
2
+ /**
3
+ * `skrr agents embed <agent>` — the snippet that puts a listing CARD for a
4
+ * public agent on another site (agent-distribution-2026-10-08.md, "Embed").
5
+ *
6
+ * Mints (idempotently) your share code on the `embed` channel, so installs
7
+ * that start from the card are attributed to you and show up under that
8
+ * channel in the listing's funnel. The card is a listing, not a chat.
9
+ */
10
+ export default class AgentsEmbed extends BaseCommand {
11
+ static description: string;
12
+ static examples: string[];
13
+ static args: {
14
+ id: 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,61 @@
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 web_url_1 = require("../../lib/web-url");
7
+ /**
8
+ * `skrr agents embed <agent>` — the snippet that puts a listing CARD for a
9
+ * public agent on another site (agent-distribution-2026-10-08.md, "Embed").
10
+ *
11
+ * Mints (idempotently) your share code on the `embed` channel, so installs
12
+ * that start from the card are attributed to you and show up under that
13
+ * channel in the listing's funnel. The card is a listing, not a chat.
14
+ */
15
+ class AgentsEmbed extends base_command_1.BaseCommand {
16
+ static description = "Print the HTML snippet that embeds a public agent's listing card on another site, with your embed share code";
17
+ static examples = [
18
+ '<%= config.bin %> agents embed <agent-id>',
19
+ '<%= config.bin %> agents embed <agent-id> --json',
20
+ ];
21
+ static args = {
22
+ id: core_1.Args.string({
23
+ description: 'Agent ID of a public Store listing',
24
+ required: true,
25
+ ignoreStdin: true,
26
+ }),
27
+ };
28
+ static flags = {
29
+ json: core_1.Flags.boolean({ description: 'Output as JSON ({ code, snippet, cardUrl })' }),
30
+ };
31
+ async run() {
32
+ this.requireAuth();
33
+ const { args, flags } = await this.parse(AgentsEmbed);
34
+ let code;
35
+ try {
36
+ ({ code } = await data_provider_1.dataService.mintDistributionCode({
37
+ entity: { kind: 'agent', id: args.id },
38
+ channel: 'embed',
39
+ }));
40
+ }
41
+ catch (error) {
42
+ // A private or missing agent answers ENTITY_NOT_FOUND: only a public
43
+ // listing can be embedded.
44
+ this.handleApiError(error, { subject: 'public agent listing' });
45
+ return;
46
+ }
47
+ const origin = (0, web_url_1.webOrigin)(this.cliConfig.baseURL);
48
+ const snippet = (0, data_provider_1.buildAgentEmbedSnippet)({ origin, agentId: args.id, code });
49
+ const cardUrl = `${origin}${(0, data_provider_1.embedListingPath)(args.id, { code })}`;
50
+ if (flags.json) {
51
+ this.log(JSON.stringify({ code, snippet, cardUrl }, null, 2));
52
+ return;
53
+ }
54
+ this.log('Paste this where the card should appear:');
55
+ this.log('');
56
+ this.log(snippet);
57
+ this.log('');
58
+ this.log(`Preview: ${cardUrl}`);
59
+ }
60
+ }
61
+ exports.default = AgentsEmbed;
@@ -0,0 +1,11 @@
1
+ import { BaseCommand } from '../../base-command';
2
+ export default class AgentOperatingPlan extends BaseCommand {
3
+ static description: string;
4
+ static args: {
5
+ id: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
6
+ };
7
+ static flags: {
8
+ json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
9
+ };
10
+ run(): Promise<void>;
11
+ }
@@ -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 roles_1 = require("../../lib/roles");
6
+ class AgentOperatingPlan extends base_command_1.BaseCommand {
7
+ static description = 'Read responsibilities, evidence, inquiries, work, delayed evaluation and existing planning loops without scheduling work';
8
+ static args = {
9
+ id: core_1.Args.string({ required: true, description: 'Agent ID', ignoreStdin: true }),
10
+ };
11
+ static flags = {
12
+ json: core_1.Flags.boolean({ description: 'Output full joined state and source coverage as JSON' }),
13
+ };
14
+ async run() {
15
+ this.requireAuth();
16
+ const { args, flags } = await this.parse(AgentOperatingPlan);
17
+ try {
18
+ const plan = await roles_1.roleApi.plan(args.id);
19
+ if (flags.json) {
20
+ this.log(JSON.stringify(plan, null, 2));
21
+ return;
22
+ }
23
+ this.log(`Operating plan — ${args.id} (${plan.generatedAt})`);
24
+ for (const r of plan.responsibilities) {
25
+ this.log(`\n${r.title} · ${r.status} · ${r.kind} v${r.version}`);
26
+ this.log(` Responsibility: ${r.purpose}`);
27
+ this.log(` Evidence: ${r.evidence.status}${r.evidence.issues?.length ? ` (${r.evidence.issues.join(', ')})` : ''}`);
28
+ this.log(" Execution authority: tools, sandbox and approvals use the Agent's runtime permissions.");
29
+ for (const q of r.inquiries)
30
+ this.log(` Inquiry: ${q.question} [${q.status}] — ${q.decisionImpact}`);
31
+ for (const w of r.work)
32
+ this.log(` Work: ${w.title} [${w.status}]`);
33
+ for (const w of r.waiting)
34
+ this.log(` Evaluation: ${w.status} — ${w.reason}${w.nextAt ? `; next ${w.nextAt}` : ''}`);
35
+ this.log(` Next intervention: ${r.lifecycle !== 'active' ? 'inactive; requires activation' : r.nextIntervention?.nextAt || r.nextIntervention?.status || 'not recorded'}`);
36
+ if (r.blocker)
37
+ this.log(` Blocker: ${r.blocker.code} — ${r.blocker.remediation || ''}`);
38
+ }
39
+ this.log(`\n${plan.planning.loops.length} existing planning/reflection loops; ${plan.planning.todos.length} scheduled work blocks.`);
40
+ if (plan.learning?.skillValidation)
41
+ this.log(`Skill validation: ${plan.learning.skillValidation.enabled ? 'enabled' : 'disabled'} (${plan.learning.skillValidation.scope}); external effects validated: ${plan.learning.skillValidation.externalEffectsValidated}.`);
42
+ if (!plan.coverage.complete) {
43
+ this.log(`Incomplete coverage${plan.coverage.truncated ? '; view limits reached' : ''}.`);
44
+ for (const s of plan.coverage.sources.filter((s) => s.status !== 'available'))
45
+ this.log(` ${s.name}: ${s.status} (${s.code || 'unknown'})`);
46
+ }
47
+ this.log('Task or Run completion does not establish a verified outcome.');
48
+ }
49
+ catch (error) {
50
+ this.handleApiError(error);
51
+ }
52
+ }
53
+ }
54
+ exports.default = AgentOperatingPlan;
@@ -0,0 +1,11 @@
1
+ import { BaseCommand } from '../../../base-command';
2
+ export default class RolesExample extends BaseCommand {
3
+ static description: string;
4
+ static args: {
5
+ role: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
6
+ };
7
+ static flags: {
8
+ output: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
9
+ };
10
+ run(): Promise<void>;
11
+ }
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const core_1 = require("@oclif/core");
4
+ const node_fs_1 = require("node:fs");
5
+ const data_provider_1 = require("@skrr-ai/data-provider");
6
+ const base_command_1 = require("../../../base-command");
7
+ class RolesExample extends base_command_1.BaseCommand {
8
+ static description = 'Start a portable DevOps, Financial Tech or Research Operations role using one generic schema';
9
+ static args = {
10
+ role: core_1.Args.string({
11
+ required: true,
12
+ options: ['devops', 'financial', 'research'],
13
+ description: 'Example role',
14
+ ignoreStdin: true,
15
+ }),
16
+ };
17
+ static flags = {
18
+ output: core_1.Flags.string({ description: 'Save the example JSON to a file; otherwise print JSON' }),
19
+ };
20
+ async run() {
21
+ const { args, flags } = await this.parse(RolesExample);
22
+ const example = data_provider_1.ROLE_OPERATING_SPEC_EXAMPLES[args.role];
23
+ const json = `${JSON.stringify(example, null, 2)}\n`;
24
+ if (flags.output)
25
+ (0, node_fs_1.writeFileSync)(flags.output, json, { mode: 0o600 });
26
+ else
27
+ this.log(json.trimEnd());
28
+ }
29
+ }
30
+ exports.default = RolesExample;
@@ -1,15 +1,15 @@
1
- import { BaseCommand } from '../../base-command';
2
- export default class CommitmentsMode extends BaseCommand {
1
+ import { BaseCommand } from '../../../base-command';
2
+ export default class RolesExport extends BaseCommand {
3
3
  static description: string;
4
4
  static examples: string[];
5
5
  static args: {
6
6
  id: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
7
- mode: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
7
+ key: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
8
8
  };
9
9
  static flags: {
10
+ summary: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
11
+ output: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
10
12
  json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
11
- verbose: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
12
- reason: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
13
13
  };
14
14
  run(): Promise<void>;
15
15
  }
@@ -0,0 +1,81 @@
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 roles_1 = require("../../../lib/roles");
6
+ const artifact_export_1 = require("../../../lib/artifact-export");
7
+ /** Shape version of the portable role spec this command writes. */
8
+ const ROLE_EXPORT_VERSION = 1;
9
+ class RolesExport extends base_command_1.BaseCommand {
10
+ static description = 'Export portable role authoring intent; credentials, installation IDs and runtime state are excluded';
11
+ static examples = [
12
+ '<%= config.bin %> agents roles export <agent> <key> --summary',
13
+ '<%= config.bin %> agents roles export <agent> <key> --output role.json',
14
+ '<%= config.bin %> agents roles export <agent> <key> --output - | jq .',
15
+ ];
16
+ static args = {
17
+ id: core_1.Args.string({ required: true, description: 'Agent ID', ignoreStdin: true }),
18
+ key: core_1.Args.string({ required: true, description: 'Role key', ignoreStdin: true }),
19
+ };
20
+ static flags = {
21
+ ...(0, artifact_export_1.standardExportFlags)(),
22
+ };
23
+ async run() {
24
+ this.requireAuth();
25
+ const { args, flags } = await this.parse(RolesExport);
26
+ let selection;
27
+ try {
28
+ selection = (0, artifact_export_1.resolveExportSelection)(flags);
29
+ }
30
+ catch (err) {
31
+ if (err instanceof artifact_export_1.ExportContractError) {
32
+ this.failWithCliError({ message: err.message, code: err.code, exit: 2, retryable: false });
33
+ }
34
+ throw err;
35
+ }
36
+ let spec;
37
+ try {
38
+ spec = await roles_1.roleApi.export(args.id, args.key);
39
+ }
40
+ catch (error) {
41
+ this.handleApiError(error);
42
+ }
43
+ if (selection.summary) {
44
+ const summary = (0, artifact_export_1.contentFreeSummary)({
45
+ command: 'agents roles export',
46
+ artifactSchemaVersion: ROLE_EXPORT_VERSION,
47
+ itemCount: 1,
48
+ counts: {},
49
+ });
50
+ this.log(selection.json ? JSON.stringify(summary, null, 2) : (0, artifact_export_1.humanExportSummary)(summary));
51
+ return;
52
+ }
53
+ const serialized = (0, artifact_export_1.serializedArtifact)(spec);
54
+ if (selection.output === '-') {
55
+ this.log(serialized.trimEnd());
56
+ return;
57
+ }
58
+ let receipt;
59
+ try {
60
+ receipt = await (0, artifact_export_1.writeExportArtifact)({
61
+ command: 'agents roles export',
62
+ artifactSchemaVersion: ROLE_EXPORT_VERSION,
63
+ format: 'json',
64
+ output: selection.output,
65
+ content: serialized,
66
+ itemCount: 1,
67
+ });
68
+ }
69
+ catch (err) {
70
+ this.failWithCliError({
71
+ message: `Could not write ${selection.output}: ${err.message}`,
72
+ code: 'ROLE_EXPORT_WRITE_FAILED',
73
+ exit: 1,
74
+ retryable: false,
75
+ details: { path: selection.output },
76
+ });
77
+ }
78
+ this.log(selection.json ? JSON.stringify(receipt, null, 2) : (0, artifact_export_1.humanExportReceipt)(receipt));
79
+ }
80
+ }
81
+ exports.default = RolesExport;
@@ -0,0 +1,12 @@
1
+ import { BaseCommand } from '../../../base-command';
2
+ export default class RolesInstall extends BaseCommand {
3
+ static description: string;
4
+ static args: {
5
+ id: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
6
+ };
7
+ static flags: {
8
+ preview: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
9
+ json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
10
+ };
11
+ run(): Promise<void>;
12
+ }
@@ -0,0 +1,48 @@
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 roles_1 = require("../../../lib/roles");
6
+ class RolesInstall extends base_command_1.BaseCommand {
7
+ static description = 'Install or reconcile a reviewed role preview as inactive existing objects; never attach credentials or activate work';
8
+ static args = {
9
+ id: core_1.Args.string({ required: true, description: 'Agent ID', ignoreStdin: true }),
10
+ };
11
+ static flags = {
12
+ preview: core_1.Flags.string({
13
+ required: true,
14
+ description: 'Server-generated preview JSON saved by agents roles preview',
15
+ }),
16
+ json: core_1.Flags.boolean({ description: 'Output the installation receipt as JSON' }),
17
+ };
18
+ async run() {
19
+ this.requireAuth();
20
+ const { args, flags } = await this.parse(RolesInstall);
21
+ try {
22
+ const preview = (0, roles_1.readRoleJson)(flags.preview);
23
+ (0, roles_1.assertRolePreview)(preview);
24
+ const receipt = await roles_1.roleApi.install(args.id, preview);
25
+ if (flags.json)
26
+ this.log(JSON.stringify(receipt, null, 2));
27
+ else {
28
+ this.log(receipt.complete ? 'Role installed inactive.' : 'Role installation partially saved.');
29
+ for (const item of receipt.results)
30
+ this.log(` ${item.key || item.id || 'receipt'}: ${item.status}${item.code ? ` (${item.code})` : ''}`);
31
+ this.log('Review and activate the Compass, attach required skills and evidence sources, then activate responsibilities through commitments resume.');
32
+ this.log(`Inspect the joined state: agents operating-plan ${args.id}`);
33
+ }
34
+ if (!receipt.complete)
35
+ this.failWithCliError({
36
+ code: 'ROLE_INSTALL_INCOMPLETE',
37
+ message: 'Some role objects were saved but installation is incomplete. Refresh the preview and reconcile the same revision.',
38
+ retryable: true,
39
+ exit: 1,
40
+ details: receipt,
41
+ });
42
+ }
43
+ catch (error) {
44
+ this.handleApiError(error);
45
+ }
46
+ }
47
+ }
48
+ exports.default = RolesInstall;
@@ -0,0 +1,11 @@
1
+ import { BaseCommand } from '../../../base-command';
2
+ export default class RolesList extends BaseCommand {
3
+ static description: string;
4
+ static args: {
5
+ id: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
6
+ };
7
+ static flags: {
8
+ json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
9
+ };
10
+ run(): Promise<void>;
11
+ }
@@ -0,0 +1,36 @@
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 roles_1 = require("../../../lib/roles");
6
+ class RolesList extends base_command_1.BaseCommand {
7
+ static description = 'List installed role specifications and their Compass lifecycle';
8
+ static args = {
9
+ id: core_1.Args.string({ required: true, description: 'Agent ID', ignoreStdin: true }),
10
+ };
11
+ static flags = { json: core_1.Flags.boolean({ description: 'Output as JSON' }) };
12
+ async run() {
13
+ this.requireAuth();
14
+ const { args, flags } = await this.parse(RolesList);
15
+ try {
16
+ const result = await roles_1.roleApi.list(args.id);
17
+ if (flags.json) {
18
+ this.log(JSON.stringify(result, null, 2));
19
+ return;
20
+ }
21
+ for (const role of result.roles)
22
+ this.log(`${role.spec.key}: ${role.spec.title} · revision ${role.spec.revision} · ${role.status} · Compass ${role.compassStatus} v${role.compassVersion}`);
23
+ if (!result.roles.length)
24
+ this.log('No roles installed. Use agents roles example to start a portable configuration.');
25
+ if (result.skillInventory) {
26
+ this.log(`Attached Skill inventory: ${result.skillInventory.status}`);
27
+ for (const skill of result.skillInventory.skills)
28
+ this.log(` ${skill.name}: ${skill.id} · ${skill.versions.join(', ')}`);
29
+ }
30
+ }
31
+ catch (error) {
32
+ this.handleApiError(error);
33
+ }
34
+ }
35
+ }
36
+ exports.default = RolesList;