@skrr-ai/cli 0.1.92 → 0.1.93

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 (267) 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/share.d.ts +27 -0
  10. package/dist/commands/agents/share.js +100 -0
  11. package/dist/commands/agents/vanity.d.ts +21 -0
  12. package/dist/commands/agents/vanity.js +77 -0
  13. package/dist/commands/agents/visibility.d.ts +21 -1
  14. package/dist/commands/agents/visibility.js +112 -0
  15. package/dist/commands/commands.d.ts +1 -0
  16. package/dist/commands/commands.js +22 -9
  17. package/dist/commands/earnings/attributions.d.ts +17 -0
  18. package/dist/commands/earnings/attributions.js +82 -0
  19. package/dist/commands/earnings/index.js +2 -1
  20. package/dist/commands/generate-recovery-code.js +4 -3
  21. package/dist/commands/github/allow-tools.d.ts +1 -0
  22. package/dist/commands/github/app/install.d.ts +1 -0
  23. package/dist/commands/github/app/status.d.ts +1 -0
  24. package/dist/commands/github/connect.d.ts +1 -0
  25. package/dist/commands/github/connections.d.ts +1 -0
  26. package/dist/commands/github/disconnect.d.ts +1 -0
  27. package/dist/commands/github/finalize.d.ts +1 -0
  28. package/dist/commands/github/reconnect.d.ts +1 -0
  29. package/dist/commands/github/run.d.ts +1 -0
  30. package/dist/commands/github/tools.d.ts +1 -0
  31. package/dist/commands/integrations/connections/connect.d.ts +1 -0
  32. package/dist/commands/integrations/connections/disconnect.d.ts +1 -0
  33. package/dist/commands/integrations/connections/finalize.d.ts +1 -0
  34. package/dist/commands/integrations/connections/list.d.ts +1 -0
  35. package/dist/commands/integrations/connections/reconnect.d.ts +1 -0
  36. package/dist/commands/integrations/execute.d.ts +1 -0
  37. package/dist/commands/integrations/search.d.ts +1 -0
  38. package/dist/commands/integrations/toolkits.d.ts +1 -0
  39. package/dist/commands/integrations/tools/allow.d.ts +1 -0
  40. package/dist/commands/integrations/tools/list.d.ts +1 -0
  41. package/dist/commands/login.js +12 -0
  42. package/dist/commands/machines/dedicated/logs.d.ts +19 -0
  43. package/dist/commands/machines/dedicated/logs.js +103 -0
  44. package/dist/commands/machines/dedicated/power/set.js +1 -1
  45. package/dist/commands/open.d.ts +24 -0
  46. package/dist/commands/open.js +74 -0
  47. package/dist/commands/projects/archive.d.ts +1 -0
  48. package/dist/commands/projects/archive.js +23 -0
  49. package/dist/commands/projects/delete.d.ts +1 -0
  50. package/dist/commands/projects/delete.js +23 -0
  51. package/dist/commands/projects/list.d.ts +3 -0
  52. package/dist/commands/projects/list.js +12 -2
  53. package/dist/commands/spaces/actions/add.js +4 -3
  54. package/dist/commands/spaces/actions/available.js +3 -2
  55. package/dist/commands/spaces/actions/list.js +5 -4
  56. package/dist/commands/spaces/actions/replace.js +6 -5
  57. package/dist/commands/spaces/archive.js +3 -2
  58. package/dist/commands/spaces/auto-executor/preview.js +4 -3
  59. package/dist/commands/spaces/auto-executor/run.js +4 -3
  60. package/dist/commands/spaces/auto-executor/runs.js +3 -2
  61. package/dist/commands/spaces/auto-executor/update.js +4 -3
  62. package/dist/commands/spaces/bootstrap.js +3 -2
  63. package/dist/commands/spaces/briefs/delete.js +3 -2
  64. package/dist/commands/spaces/briefs/get.js +3 -2
  65. package/dist/commands/spaces/briefs/list.js +3 -2
  66. package/dist/commands/spaces/briefs/set.js +5 -4
  67. package/dist/commands/spaces/capacity.js +5 -4
  68. package/dist/commands/spaces/conversations.js +3 -2
  69. package/dist/commands/spaces/cycles/create.js +3 -2
  70. package/dist/commands/spaces/cycles/graph.js +2 -1
  71. package/dist/commands/spaces/cycles/list.js +3 -2
  72. package/dist/commands/spaces/cycles/settings.js +4 -3
  73. package/dist/commands/spaces/cycles/show.js +3 -2
  74. package/dist/commands/spaces/cycles/update.js +3 -2
  75. package/dist/commands/spaces/delete.js +4 -3
  76. package/dist/commands/spaces/expertise-suggestions.js +4 -3
  77. package/dist/commands/spaces/files/delete.js +3 -2
  78. package/dist/commands/spaces/files/folders/create.js +3 -2
  79. package/dist/commands/spaces/files/folders/delete.js +3 -2
  80. package/dist/commands/spaces/files/folders/list.js +3 -2
  81. package/dist/commands/spaces/files/folders/update.js +3 -2
  82. package/dist/commands/spaces/files/list.js +3 -2
  83. package/dist/commands/spaces/files/move.js +3 -2
  84. package/dist/commands/spaces/files/rename.js +3 -2
  85. package/dist/commands/spaces/files/upload.js +6 -5
  86. package/dist/commands/spaces/github-automations/set.js +3 -2
  87. package/dist/commands/spaces/github-automations/show.js +3 -2
  88. package/dist/commands/spaces/goals.js +2 -1
  89. package/dist/commands/spaces/heartbeats/create.js +4 -3
  90. package/dist/commands/spaces/heartbeats/delete.js +4 -3
  91. package/dist/commands/spaces/heartbeats/list.js +4 -3
  92. package/dist/commands/spaces/heartbeats/status.js +3 -2
  93. package/dist/commands/spaces/heartbeats/update.js +4 -3
  94. package/dist/commands/spaces/insights.js +5 -4
  95. package/dist/commands/spaces/labels/add.js +4 -3
  96. package/dist/commands/spaces/labels/list.js +2 -1
  97. package/dist/commands/spaces/labels/remove.js +4 -3
  98. package/dist/commands/spaces/list.d.ts +3 -0
  99. package/dist/commands/spaces/list.js +11 -2
  100. package/dist/commands/spaces/live/cards/create.js +3 -2
  101. package/dist/commands/spaces/live/cards/list.js +3 -2
  102. package/dist/commands/spaces/live/cards/reorder.js +7 -2
  103. package/dist/commands/spaces/live/scene.js +4 -3
  104. package/dist/commands/spaces/members/add.js +7 -6
  105. package/dist/commands/spaces/members/list.js +4 -3
  106. package/dist/commands/spaces/members/remove.js +7 -6
  107. package/dist/commands/spaces/move.js +3 -2
  108. package/dist/commands/spaces/pin.js +5 -4
  109. package/dist/commands/spaces/preferences/show.js +4 -3
  110. package/dist/commands/spaces/preferences/tabs.js +4 -3
  111. package/dist/commands/spaces/revisions.js +3 -2
  112. package/dist/commands/spaces/room/ensure.js +5 -4
  113. package/dist/commands/spaces/room/messages.js +3 -2
  114. package/dist/commands/spaces/room/show.js +5 -4
  115. package/dist/commands/spaces/skills/add.js +4 -3
  116. package/dist/commands/spaces/skills/list.js +3 -2
  117. package/dist/commands/spaces/skills/pin.js +4 -3
  118. package/dist/commands/spaces/skills/remove.js +4 -3
  119. package/dist/commands/spaces/snapshot.js +3 -2
  120. package/dist/commands/spaces/states/archive.js +3 -2
  121. package/dist/commands/spaces/states/create.js +3 -2
  122. package/dist/commands/spaces/states/list.js +3 -2
  123. package/dist/commands/spaces/states/reorder.js +2 -1
  124. package/dist/commands/spaces/states/update.js +3 -2
  125. package/dist/commands/spaces/summary.js +4 -3
  126. package/dist/commands/spaces/tasks.d.ts +3 -0
  127. package/dist/commands/spaces/tasks.js +14 -3
  128. package/dist/commands/spaces/triggers/delete.js +5 -4
  129. package/dist/commands/spaces/triggers/set.js +4 -3
  130. package/dist/commands/spaces/triggers/show.js +4 -3
  131. package/dist/commands/spaces/unarchive.js +3 -2
  132. package/dist/commands/spaces/update.js +5 -4
  133. package/dist/commands/spaces/views/create.js +3 -2
  134. package/dist/commands/spaces/views/list.js +3 -2
  135. package/dist/commands/spaces/views/reorder.js +6 -3
  136. package/dist/commands/spaces/views/subscribe.js +2 -1
  137. package/dist/commands/spaces/views/subscriptions.js +1 -0
  138. package/dist/commands/spaces/views/unsubscribe.js +2 -1
  139. package/dist/commands/spaces/widgets/add.js +4 -3
  140. package/dist/commands/spaces/widgets/list.js +3 -2
  141. package/dist/commands/spaces/widgets/remove.js +5 -4
  142. package/dist/commands/spaces/work-graph.js +2 -1
  143. package/dist/commands/store/install.d.ts +1 -1
  144. package/dist/commands/store/install.js +24 -8
  145. package/dist/commands/store/show.d.ts +25 -0
  146. package/dist/commands/store/show.js +203 -0
  147. package/dist/commands/store/stats.d.ts +33 -0
  148. package/dist/commands/store/stats.js +258 -0
  149. package/dist/commands/tasks/actions/attach.js +1 -1
  150. package/dist/commands/tasks/actions/detach.js +4 -3
  151. package/dist/commands/tasks/activity.js +3 -2
  152. package/dist/commands/tasks/ancestors.js +2 -1
  153. package/dist/commands/tasks/approvals/create.js +2 -1
  154. package/dist/commands/tasks/approvals/delete.js +3 -2
  155. package/dist/commands/tasks/approvals/list.js +5 -4
  156. package/dist/commands/tasks/approvals/resolve.js +2 -1
  157. package/dist/commands/tasks/archive.js +3 -2
  158. package/dist/commands/tasks/assign.js +4 -3
  159. package/dist/commands/tasks/attachments/delete.js +3 -2
  160. package/dist/commands/tasks/attachments/download.d.ts +1 -0
  161. package/dist/commands/tasks/attachments/download.js +20 -1
  162. package/dist/commands/tasks/attachments/list.js +2 -1
  163. package/dist/commands/tasks/attachments/set-role.js +2 -1
  164. package/dist/commands/tasks/attachments/upload.js +2 -1
  165. package/dist/commands/tasks/bulk-update.d.ts +1 -0
  166. package/dist/commands/tasks/bulk-update.js +106 -15
  167. package/dist/commands/tasks/cancel-cascade.d.ts +1 -0
  168. package/dist/commands/tasks/cancel-cascade.js +13 -3
  169. package/dist/commands/tasks/cascade-status.js +2 -1
  170. package/dist/commands/tasks/checkout.js +3 -2
  171. package/dist/commands/tasks/children.js +2 -1
  172. package/dist/commands/tasks/comments/add.js +7 -6
  173. package/dist/commands/tasks/comments/anchor.js +8 -7
  174. package/dist/commands/tasks/comments/delete.js +3 -2
  175. package/dist/commands/tasks/comments/list.js +2 -1
  176. package/dist/commands/tasks/comments/reopen.js +3 -2
  177. package/dist/commands/tasks/comments/resolve.js +3 -2
  178. package/dist/commands/tasks/create-tree.d.ts +63 -0
  179. package/dist/commands/tasks/create-tree.js +197 -4
  180. package/dist/commands/tasks/delete.js +5 -4
  181. package/dist/commands/tasks/descendants.js +2 -1
  182. package/dist/commands/tasks/dri-plan.js +3 -2
  183. package/dist/commands/tasks/dri-run.js +3 -2
  184. package/dist/commands/tasks/dri-status.js +2 -1
  185. package/dist/commands/tasks/duplicate-pipeline.js +2 -1
  186. package/dist/commands/tasks/execution-summary.js +2 -1
  187. package/dist/commands/tasks/execution-timeline.js +2 -1
  188. package/dist/commands/tasks/fork.js +1 -0
  189. package/dist/commands/tasks/forward.js +4 -3
  190. package/dist/commands/tasks/handover.js +1 -0
  191. package/dist/commands/tasks/interrupt.js +3 -2
  192. package/dist/commands/tasks/labels/attach.js +4 -3
  193. package/dist/commands/tasks/labels/detach.js +4 -3
  194. package/dist/commands/tasks/labels/suggest.js +5 -4
  195. package/dist/commands/tasks/list.d.ts +27 -1
  196. package/dist/commands/tasks/list.js +101 -3
  197. package/dist/commands/tasks/move.js +4 -3
  198. package/dist/commands/tasks/output.js +6 -5
  199. package/dist/commands/tasks/pause-schedule.js +3 -2
  200. package/dist/commands/tasks/promote.js +1 -0
  201. package/dist/commands/tasks/prompt-log.js +2 -1
  202. package/dist/commands/tasks/release.js +5 -4
  203. package/dist/commands/tasks/remind.js +2 -1
  204. package/dist/commands/tasks/replay.js +3 -2
  205. package/dist/commands/tasks/report.js +1 -0
  206. package/dist/commands/tasks/resume-schedule.js +3 -2
  207. package/dist/commands/tasks/retry-schedule.js +3 -2
  208. package/dist/commands/tasks/retry.js +10 -9
  209. package/dist/commands/tasks/revisions.js +2 -1
  210. package/dist/commands/tasks/runs.js +6 -5
  211. package/dist/commands/tasks/schedule.js +3 -2
  212. package/dist/commands/tasks/self-schedule.js +6 -5
  213. package/dist/commands/tasks/skills/pin.js +3 -2
  214. package/dist/commands/tasks/skills/unpin.js +3 -2
  215. package/dist/commands/tasks/snooze.js +6 -5
  216. package/dist/commands/tasks/start-all.js +5 -4
  217. package/dist/commands/tasks/subscribe.js +1 -0
  218. package/dist/commands/tasks/tags/add.js +4 -3
  219. package/dist/commands/tasks/tags/remove.js +4 -3
  220. package/dist/commands/tasks/timeline.js +3 -2
  221. package/dist/commands/tasks/today.d.ts +4 -1
  222. package/dist/commands/tasks/today.js +12 -2
  223. package/dist/commands/tasks/transcript.js +6 -5
  224. package/dist/commands/tasks/unschedule.js +3 -2
  225. package/dist/commands/tasks/unsnooze.js +3 -2
  226. package/dist/commands/tasks/unsubscribe.js +2 -1
  227. package/dist/commands/tasks/update.js +5 -4
  228. package/dist/commands/tasks/wait.js +5 -4
  229. package/dist/lib/agent-distribution.d.ts +37 -0
  230. package/dist/lib/agent-distribution.js +63 -0
  231. package/dist/lib/agent-ref.d.ts +69 -0
  232. package/dist/lib/agent-ref.js +168 -0
  233. package/dist/lib/api-fetch.d.ts +2 -0
  234. package/dist/lib/api-fetch.js +14 -3
  235. package/dist/lib/command-hygiene.d.ts +13 -0
  236. package/dist/lib/command-hygiene.js +62 -2
  237. package/dist/lib/dedicated-power.d.ts +5 -0
  238. package/dist/lib/dedicated-power.js +30 -2
  239. package/dist/lib/dry-run-plans.d.ts +50 -0
  240. package/dist/lib/dry-run-plans.js +85 -0
  241. package/dist/lib/json-output.d.ts +31 -0
  242. package/dist/lib/json-output.js +78 -0
  243. package/dist/lib/list-output.d.ts +75 -0
  244. package/dist/lib/list-output.js +266 -0
  245. package/dist/lib/machine-daemon-log.d.ts +36 -0
  246. package/dist/lib/machine-daemon-log.js +78 -0
  247. package/dist/lib/node-adapter.js +10 -1
  248. package/dist/lib/open-target.d.ts +12 -0
  249. package/dist/lib/open-target.js +108 -0
  250. package/dist/lib/rate-limit-retry.d.ts +45 -0
  251. package/dist/lib/rate-limit-retry.js +88 -0
  252. package/dist/lib/store-listing.d.ts +45 -0
  253. package/dist/lib/store-listing.js +186 -0
  254. package/dist/lib/task-batch.d.ts +67 -0
  255. package/dist/lib/task-batch.js +227 -0
  256. package/dist/lib/terminal-qr.d.ts +55 -0
  257. package/dist/lib/terminal-qr.js +119 -0
  258. package/dist/lib/web-url.d.ts +11 -0
  259. package/dist/lib/web-url.js +24 -0
  260. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/computerWire.d.ts +68 -0
  261. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/computerWire.js +47 -1
  262. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/computerWire.d.ts +68 -0
  263. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/computerWire.js +46 -0
  264. package/dist/node_modules/@skrr-ai/auth-core/package.json +1 -1
  265. package/dist/node_modules/@skrr-ai/data-provider/index.js +6612 -6113
  266. package/oclif.manifest.json +46778 -38019
  267. package/package.json +2 -1
@@ -21,6 +21,7 @@ class SpacesViewsReorder extends base_command_1.BaseCommand {
21
21
  async run() {
22
22
  this.requireAuth();
23
23
  const { args, flags } = await this.parse(SpacesViewsReorder);
24
+ const spaceRef = await this.resolveEntityRef('space', args.id);
24
25
  let raw = {};
25
26
  if (flags['from-json']) {
26
27
  try {
@@ -38,7 +39,7 @@ class SpacesViewsReorder extends base_command_1.BaseCommand {
38
39
  if (!Array.isArray(orderedIds) || !orderedIds.length)
39
40
  this.error('Provide repeated --view IDs or orderedIds JSON.', { exit: 1 });
40
41
  if (flags['dry-run']) {
41
- const output = { dryRun: true, spaceId: args.id, orderedIds };
42
+ const output = { dryRun: true, spaceId: spaceRef, orderedIds };
42
43
  this.log(flags.json
43
44
  ? JSON.stringify(output, null, 2)
44
45
  : `Dry run: would reorder ${orderedIds.length} views.`);
@@ -46,7 +47,9 @@ class SpacesViewsReorder extends base_command_1.BaseCommand {
46
47
  }
47
48
  let result;
48
49
  try {
49
- result = await data_provider_1.dataService.reorderSpaceViews(args.id, { orderedIds: orderedIds });
50
+ result = await data_provider_1.dataService.reorderSpaceViews(spaceRef, {
51
+ orderedIds: orderedIds,
52
+ });
50
53
  }
51
54
  catch (err) {
52
55
  this.handleApiError(err);
@@ -55,7 +58,7 @@ class SpacesViewsReorder extends base_command_1.BaseCommand {
55
58
  this.log(JSON.stringify({
56
59
  result,
57
60
  orderedIds,
58
- url: (0, space_output_1.spacePerspectiveUrl)(this.cliConfig.baseURL, args.id, 'tasks'),
61
+ url: (0, space_output_1.spacePerspectiveUrl)(this.cliConfig.baseURL, spaceRef, 'tasks'),
59
62
  }, null, 2));
60
63
  else
61
64
  this.log(`Reordered ${orderedIds.length} views.`);
@@ -25,6 +25,7 @@ class SpacesViewsSubscribe extends base_command_1.BaseCommand {
25
25
  async run() {
26
26
  this.requireAuth();
27
27
  const { args, flags } = await this.parse(SpacesViewsSubscribe);
28
+ const spaceRef = await this.resolveEntityRef('space', args.spaceId);
28
29
  let result;
29
30
  try {
30
31
  // Target resolution on the server verifies that the view belongs to this
@@ -42,7 +43,7 @@ class SpacesViewsSubscribe extends base_command_1.BaseCommand {
42
43
  }
43
44
  if (flags.json)
44
45
  return void this.log(JSON.stringify(result, null, 2));
45
- this.log(`Subscribed to Space View ${args.viewId} in ${args.spaceId}.`);
46
+ this.log(`Subscribed to Space View ${args.viewId} in ${spaceRef}.`);
46
47
  }
47
48
  }
48
49
  exports.default = SpacesViewsSubscribe;
@@ -13,6 +13,7 @@ class SpacesViewsSubscriptions extends base_command_1.BaseCommand {
13
13
  async run() {
14
14
  this.requireAuth();
15
15
  const { args, flags } = await this.parse(SpacesViewsSubscriptions);
16
+ const spaceRef = await this.resolveEntityRef('space', args.spaceId);
16
17
  let items;
17
18
  try {
18
19
  items = await (0, view_subscriptions_1.subscriptionsForView)('space_view', args.viewId);
@@ -13,6 +13,7 @@ class SpacesViewsUnsubscribe extends base_command_1.BaseCommand {
13
13
  async run() {
14
14
  this.requireAuth();
15
15
  const { args, flags } = await this.parse(SpacesViewsUnsubscribe);
16
+ const spaceRef = await this.resolveEntityRef('space', args.spaceId);
16
17
  let result;
17
18
  try {
18
19
  result = await (0, view_subscriptions_1.unsubscribeFromView)('space_view', args.viewId);
@@ -22,7 +23,7 @@ class SpacesViewsUnsubscribe extends base_command_1.BaseCommand {
22
23
  }
23
24
  if (flags.json)
24
25
  return void this.log(JSON.stringify(result, null, 2));
25
- this.log(`Unsubscribed from Space View ${args.viewId} in ${args.spaceId}.`);
26
+ this.log(`Unsubscribed from Space View ${args.viewId} in ${spaceRef}.`);
26
27
  }
27
28
  }
28
29
  exports.default = SpacesViewsUnsubscribe;
@@ -21,10 +21,11 @@ class SpacesWidgetsAdd extends base_command_1.BaseCommand {
21
21
  async run() {
22
22
  this.requireAuth();
23
23
  const { args, flags } = await this.parse(SpacesWidgetsAdd);
24
+ const spaceRef = await this.resolveEntityRef('space', args.id);
24
25
  let result;
25
26
  try {
26
27
  result = await data_provider_1.dataService.addSpaceWidget({
27
- spaceId: args.id,
28
+ spaceId: spaceRef,
28
29
  widgetId: flags.widget,
29
30
  agentId: flags.agent,
30
31
  });
@@ -33,14 +34,14 @@ class SpacesWidgetsAdd extends base_command_1.BaseCommand {
33
34
  this.handleApiError(err);
34
35
  }
35
36
  if (flags.json) {
36
- this.log(JSON.stringify((0, space_output_1.withSpaceResourceUrls)(this.cliConfig.baseURL, args.id, 'widgets', result, [
37
+ this.log(JSON.stringify((0, space_output_1.withSpaceResourceUrls)(this.cliConfig.baseURL, spaceRef, 'widgets', result, [
37
38
  'widgetId',
38
39
  'id',
39
40
  '_id',
40
41
  ]), null, 2));
41
42
  return;
42
43
  }
43
- this.log(`Added widget ${flags.widget} to space ${args.id}`);
44
+ this.log(`Added widget ${flags.widget} to space ${spaceRef}`);
44
45
  }
45
46
  }
46
47
  exports.default = SpacesWidgetsAdd;
@@ -20,15 +20,16 @@ class SpacesWidgetsList extends base_command_1.BaseCommand {
20
20
  async run() {
21
21
  this.requireAuth();
22
22
  const { args, flags } = await this.parse(SpacesWidgetsList);
23
+ const spaceRef = await this.resolveEntityRef('space', args.id);
23
24
  let response;
24
25
  try {
25
- response = await data_provider_1.dataService.listSpaceWidgets(args.id);
26
+ response = await data_provider_1.dataService.listSpaceWidgets(spaceRef);
26
27
  }
27
28
  catch (err) {
28
29
  this.handleApiError(err);
29
30
  }
30
31
  if (flags.json) {
31
- this.log(JSON.stringify((0, space_output_1.withSpaceResourceUrls)(this.cliConfig.baseURL, args.id, 'widgets', response, [
32
+ this.log(JSON.stringify((0, space_output_1.withSpaceResourceUrls)(this.cliConfig.baseURL, spaceRef, 'widgets', response, [
32
33
  'widgetId',
33
34
  'id',
34
35
  '_id',
@@ -22,9 +22,10 @@ class SpacesWidgetsRemove extends base_command_1.BaseCommand {
22
22
  async run() {
23
23
  this.requireAuth();
24
24
  const { args, flags } = await this.parse(SpacesWidgetsRemove);
25
+ const spaceRef = await this.resolveEntityRef('space', args.id);
25
26
  let confirmed;
26
27
  try {
27
- confirmed = await (0, prompt_1.confirmDestructive)(`Remove widget ${args.widgetId} from space ${args.id}?`, flags.yes);
28
+ confirmed = await (0, prompt_1.confirmDestructive)(`Remove widget ${args.widgetId} from space ${spaceRef}?`, flags.yes);
28
29
  }
29
30
  catch (err) {
30
31
  this.error(err.message, {
@@ -37,7 +38,7 @@ class SpacesWidgetsRemove extends base_command_1.BaseCommand {
37
38
  }
38
39
  try {
39
40
  await data_provider_1.dataService.removeSpaceWidget({
40
- spaceId: args.id,
41
+ spaceId: spaceRef,
41
42
  widgetId: args.widgetId,
42
43
  });
43
44
  }
@@ -48,10 +49,10 @@ class SpacesWidgetsRemove extends base_command_1.BaseCommand {
48
49
  this.log(JSON.stringify({
49
50
  success: true,
50
51
  widgetId: args.widgetId,
51
- url: (0, space_output_1.spacePerspectiveUrl)(this.cliConfig.baseURL, args.id, 'widgets'),
52
+ url: (0, space_output_1.spacePerspectiveUrl)(this.cliConfig.baseURL, spaceRef, 'widgets'),
52
53
  }, null, 2));
53
54
  else
54
- this.log(`Removed widget ${args.widgetId} from space ${args.id}`);
55
+ this.log(`Removed widget ${args.widgetId} from space ${spaceRef}`);
55
56
  }
56
57
  }
57
58
  exports.default = SpacesWidgetsRemove;
@@ -29,9 +29,10 @@ class SpacesWorkGraph extends base_command_1.BaseCommand {
29
29
  async run() {
30
30
  this.requireAuth();
31
31
  const { args, flags } = await this.parse(SpacesWorkGraph);
32
+ const spaceRef = await this.resolveEntityRef('space', args.id);
32
33
  let response;
33
34
  try {
34
- response = await data_provider_1.dataService.getSpaceWorkGraph(args.id);
35
+ response = await data_provider_1.dataService.getSpaceWorkGraph(spaceRef);
35
36
  }
36
37
  catch (err) {
37
38
  this.handleApiError(err);
@@ -3,7 +3,7 @@ export default class StoreInstall extends BaseCommand {
3
3
  static description: string;
4
4
  static examples: string[];
5
5
  static args: {
6
- agentId: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
6
+ agent: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
7
7
  };
8
8
  static flags: {
9
9
  json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const core_1 = require("@oclif/core");
4
4
  const data_provider_1 = require("@skrr-ai/data-provider");
5
5
  const base_command_1 = require("../../base-command");
6
+ const agent_ref_1 = require("../../lib/agent-ref");
6
7
  const prompt_1 = require("../../lib/prompt");
7
8
  /**
8
9
  * One line per placement, said the same way the web install rail says it: the
@@ -17,14 +18,15 @@ class StoreInstall extends base_command_1.BaseCommand {
17
18
  static description = 'Install a published agent — you get your own copy of it. A paid agent shows its price and refund terms and asks you to confirm first.';
18
19
  static examples = [
19
20
  '<%= config.bin %> store install agent_abc123',
21
+ "<%= config.bin %> store install 'https://skrr.ai/a/agent_abc123?s=Ab12Cd34&ch=link'",
20
22
  '<%= config.bin %> store install agent_abc123 --release ar_def456',
21
23
  '<%= config.bin %> store install agent_abc123 --run-on local',
22
24
  '<%= config.bin %> store install agent_abc123 --share-outcomes',
23
25
  '<%= config.bin %> store install agent_abc123 --yes --json',
24
26
  ];
25
27
  static args = {
26
- agentId: core_1.Args.string({
27
- description: 'The store agent to install',
28
+ agent: core_1.Args.string({
29
+ description: 'The store agent to install: its id, or a link to it (a share link keeps its attribution)',
28
30
  required: true,
29
31
  ignoreStdin: true,
30
32
  }),
@@ -57,13 +59,26 @@ class StoreInstall extends base_command_1.BaseCommand {
57
59
  async run() {
58
60
  this.requireAuth();
59
61
  const { args, flags } = await this.parse(StoreInstall);
62
+ // A pasted share link credits the person who shared it, on the channel it
63
+ // was shared through; a bare id carries no attribution and sends none.
64
+ let ref;
65
+ try {
66
+ ref = await (0, agent_ref_1.resolveAgentRef)(args.agent, { baseURL: this.cliConfig?.baseURL });
67
+ }
68
+ catch (err) {
69
+ if (err instanceof agent_ref_1.AgentRefError) {
70
+ this.failWithCliError({ message: err.message, code: err.code, exit: 1, retryable: false });
71
+ }
72
+ this.handleApiError(err);
73
+ }
74
+ const { agentId } = ref;
60
75
  // The server still refuses a second install of a listing you own — this is
61
76
  // the friendly read that says so before a quote or a prompt (OSK-12287:
62
77
  // `installs` is the read model; `purchased` answers membership cheaply).
63
78
  let alreadyInstalled = false;
64
79
  try {
65
80
  const owned = await data_provider_1.dataService.getPurchasedAgents();
66
- alreadyInstalled = (owned?.purchasedAgentIds ?? []).includes(args.agentId);
81
+ alreadyInstalled = (owned?.purchasedAgentIds ?? []).includes(agentId);
67
82
  }
68
83
  catch (err) {
69
84
  // A read failure must not block an install — the server re-checks anyway.
@@ -74,7 +89,7 @@ class StoreInstall extends base_command_1.BaseCommand {
74
89
  // an uninstalled copy is restored by the install route. Keep the server
75
90
  // as the final authority if this status read is unavailable.
76
91
  try {
77
- const status = await data_provider_1.dataService.getAgentPurchaseStatus(args.agentId);
92
+ const status = await data_provider_1.dataService.getAgentPurchaseStatus(agentId);
78
93
  if (status.purchased && status.stopReason === 'uninstalled') {
79
94
  alreadyInstalled = false;
80
95
  }
@@ -85,7 +100,7 @@ class StoreInstall extends base_command_1.BaseCommand {
85
100
  }
86
101
  }
87
102
  if (alreadyInstalled) {
88
- this.error(`${args.agentId} is already installed. See it: skrr store updates, or update it: skrr store update ${args.agentId}`, { exit: 1 });
103
+ this.error(`${agentId} is already installed. See it: skrr store updates, or update it: skrr store update ${agentId}`, { exit: 1 });
89
104
  }
90
105
  // What installing would charge NOW, resolved by the server the way the
91
106
  // install resolves it (OSK-12240). The install then pins what was shown, so
@@ -93,7 +108,7 @@ class StoreInstall extends base_command_1.BaseCommand {
93
108
  let quote;
94
109
  try {
95
110
  quote = await data_provider_1.dataService.getStoreAgentAcquisitionQuote({
96
- agentId: args.agentId,
111
+ agentId,
97
112
  ...(flags.release ? { releaseId: flags.release } : {}),
98
113
  });
99
114
  }
@@ -107,7 +122,7 @@ class StoreInstall extends base_command_1.BaseCommand {
107
122
  }
108
123
  const charge = Number(quote.charge) || 0;
109
124
  if (charge > 0) {
110
- const name = quote.listingName || args.agentId;
125
+ const name = quote.listingName || agentId;
111
126
  const version = quote.versionLabel ? ` v${quote.versionLabel}` : '';
112
127
  // Printed before any prompt and even with --yes, so a scripted purchase
113
128
  // still leaves the terms it agreed to in its own output.
@@ -129,7 +144,7 @@ class StoreInstall extends base_command_1.BaseCommand {
129
144
  let response;
130
145
  try {
131
146
  response = await data_provider_1.dataService.installStoreAgent({
132
- agentId: args.agentId,
147
+ agentId,
133
148
  ...(flags.release ? { releaseId: flags.release } : {}),
134
149
  ...(flags.space ? { spaceId: flags.space } : {}),
135
150
  ...(flags['include-bootstrap'] ? { includeBootstrap: true } : {}),
@@ -137,6 +152,7 @@ class StoreInstall extends base_command_1.BaseCommand {
137
152
  // Pin what the person was shown: the charge always, the offer when
138
153
  // there is one to charge under.
139
154
  expectedPrice: charge,
155
+ ...(0, agent_ref_1.installAttribution)(ref.attribution),
140
156
  ...(charge > 0 ? { expectedOfferVersionId: quote.offerVersionId } : {}),
141
157
  ...(flags['run-on']
142
158
  ? { executionPlacement: flags['run-on'] }
@@ -0,0 +1,25 @@
1
+ import { BaseCommand } from '../../base-command';
2
+ /**
3
+ * The Store listing of one published agent, in the terminal — what a buyer
4
+ * reads before `store install`: what it is, who published it, what it costs,
5
+ * how it is rated and used, what it is configured to touch, which release is
6
+ * current and what is known to be wrong with it.
7
+ *
8
+ * The listing itself (`GET /api/store/agents/:id`) is required. Publisher
9
+ * identity comes from the public read model (`/a/<id>` and `/p/@<handle>`),
10
+ * because the authenticated listing carries a mutable author name and no
11
+ * public handle; the release list is the same one `store releases` reads.
12
+ * Those three are side reads — when one fails the line says "unavailable",
13
+ * never "none", because "we could not tell" is a different fact.
14
+ */
15
+ export default class StoreShow extends BaseCommand {
16
+ static description: string;
17
+ static examples: string[];
18
+ static args: {
19
+ agent: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
20
+ };
21
+ static flags: {
22
+ json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
23
+ };
24
+ run(): Promise<void>;
25
+ }
@@ -0,0 +1,203 @@
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 agent_ref_1 = require("../../lib/agent-ref");
7
+ const format_1 = require("../../lib/format");
8
+ const store_listing_1 = require("../../lib/store-listing");
9
+ const web_url_1 = require("../../lib/web-url");
10
+ /** How many releases the detail view lists; `store releases` lists them all. */
11
+ const RECENT_RELEASES = 5;
12
+ async function sideRead(read) {
13
+ try {
14
+ return { value: await read(), error: null };
15
+ }
16
+ catch (err) {
17
+ return { value: null, error: err?.message || 'unavailable' };
18
+ }
19
+ }
20
+ /**
21
+ * The Store listing of one published agent, in the terminal — what a buyer
22
+ * reads before `store install`: what it is, who published it, what it costs,
23
+ * how it is rated and used, what it is configured to touch, which release is
24
+ * current and what is known to be wrong with it.
25
+ *
26
+ * The listing itself (`GET /api/store/agents/:id`) is required. Publisher
27
+ * identity comes from the public read model (`/a/<id>` and `/p/@<handle>`),
28
+ * because the authenticated listing carries a mutable author name and no
29
+ * public handle; the release list is the same one `store releases` reads.
30
+ * Those three are side reads — when one fails the line says "unavailable",
31
+ * never "none", because "we could not tell" is a different fact.
32
+ */
33
+ class StoreShow extends base_command_1.BaseCommand {
34
+ static description = 'Show a store listing: publisher, price, rating, installs, capability disclosure, releases, known issues and the install command';
35
+ static examples = [
36
+ '<%= config.bin %> store show agent_abc123',
37
+ '<%= config.bin %> store show agent_abc123 --json',
38
+ ];
39
+ static args = {
40
+ agent: core_1.Args.string({
41
+ description: 'The store agent: its id or a link to it (/a/<id>, a share link)',
42
+ required: true,
43
+ ignoreStdin: true,
44
+ }),
45
+ };
46
+ static flags = {
47
+ json: core_1.Flags.boolean({ description: 'Output the listing, publisher and releases as JSON' }),
48
+ };
49
+ async run() {
50
+ this.requireAuth();
51
+ const { args, flags } = await this.parse(StoreShow);
52
+ let ref;
53
+ try {
54
+ ref = await (0, agent_ref_1.resolveAgentRef)(args.agent, { baseURL: this.cliConfig.baseURL });
55
+ }
56
+ catch (err) {
57
+ if (err instanceof agent_ref_1.AgentRefError) {
58
+ this.failWithCliError({ message: err.message, code: err.code, exit: 1, retryable: false });
59
+ }
60
+ // Resolving a share code reads the server; its failure is an API failure.
61
+ this.handleApiError(err);
62
+ }
63
+ const { agentId } = ref;
64
+ let listing;
65
+ try {
66
+ listing = await data_provider_1.dataService.getStoreAgent(agentId);
67
+ }
68
+ catch (err) {
69
+ this.handleApiError(err, { subject: `store agent ${agentId}` });
70
+ }
71
+ const [releases, publicListing] = await Promise.all([
72
+ sideRead(() => data_provider_1.dataService.getStoreAgentReleases(agentId)),
73
+ sideRead(() => data_provider_1.dataService.getPublicAgentListing(agentId)),
74
+ ]);
75
+ const handle = publicListing.value?.publisher?.handle ?? null;
76
+ const publisherPage = handle
77
+ ? await sideRead(() => data_provider_1.dataService.getPublicPublisherPage(handle))
78
+ : { value: null, error: null };
79
+ const verifiedDomains = (publisherPage.value?.identityEvidence ?? [])
80
+ .filter((evidence) => evidence.kind === 'domain_control')
81
+ .map((evidence) => evidence.domain);
82
+ // A share link's attribution survives the echo: installing from the printed
83
+ // command credits the same share the person followed. A bare id has none.
84
+ const installTarget = ref.attribution.code || ref.attribution.channel
85
+ ? (0, agent_ref_1.shellQuote)((0, agent_ref_1.attributedListingUrl)(this.cliConfig.baseURL, ref))
86
+ : agentId;
87
+ const installCommand = `${this.config.bin} store install ${installTarget}`;
88
+ const listingUrl = (0, web_url_1.webUrl)(this.cliConfig.baseURL, { kind: 'storeListing', agentId });
89
+ const releaseRows = (releases.value?.data ?? []).slice(0, RECENT_RELEASES);
90
+ if (flags.json) {
91
+ this.log(JSON.stringify({
92
+ agent: listing,
93
+ publisher: {
94
+ handle,
95
+ displayName: publicListing.value?.publisher?.displayName ?? listing.authorName ?? null,
96
+ path: publicListing.value?.publisher?.path ?? null,
97
+ verifiedDomains: publisherPage.value ? verifiedDomains : null,
98
+ ...(publicListing.error ? { listingError: publicListing.error } : {}),
99
+ ...(publisherPage.error ? { profileError: publisherPage.error } : {}),
100
+ },
101
+ releases: releases.value ? releaseRows : null,
102
+ ...(releases.error ? { releasesError: releases.error } : {}),
103
+ url: listingUrl,
104
+ installCommand,
105
+ }, null, 2));
106
+ return;
107
+ }
108
+ const version = listing.versionLabel ? `v${listing.versionLabel}` : 'no version label';
109
+ this.log(`${listing.name} (${agentId}, ${version})`);
110
+ if (listing.description)
111
+ this.log(` ${(0, format_1.collapseWhitespace)(listing.description)}`);
112
+ this.log('');
113
+ // ── Publisher ──
114
+ let publisher;
115
+ if (publicListing.value?.publisher) {
116
+ publisher = `${publicListing.value.publisher.displayName} (@${publicListing.value.publisher.handle})`;
117
+ }
118
+ else if (publicListing.value) {
119
+ publisher = `${listing.authorName ?? 'Unknown'} (no public publisher profile)`;
120
+ }
121
+ else {
122
+ publisher = `${listing.authorName ?? 'Unknown'} (public profile unavailable: ${publicListing.error})`;
123
+ }
124
+ let domains;
125
+ if (!handle)
126
+ domains = publicListing.value ? 'None' : 'Unavailable';
127
+ else if (publisherPage.error)
128
+ domains = `Unavailable (${publisherPage.error})`;
129
+ else
130
+ domains = verifiedDomains.length > 0 ? verifiedDomains.join(', ') : 'None';
131
+ const active = typeof listing.activeInstalls30d === 'number'
132
+ ? `${listing.activeInstalls30d} active in the last 30 days`
133
+ : 'active count unavailable';
134
+ const summary = [
135
+ ['Publisher', publisher],
136
+ // Domain control proven by DNS — identity, never an endorsement.
137
+ ['Verified domain', domains],
138
+ ['Category', listing.category || '-'],
139
+ ['Price', (0, store_listing_1.formatListingPrice)(listing.price)],
140
+ ['Rating', (0, store_listing_1.formatListingRating)(listing.rating, listing.ratingCount)],
141
+ ['Installs', `${listing.installCount ?? 0} total, ${active}`],
142
+ ];
143
+ if (listing.computePayer !== undefined) {
144
+ summary.push(['Runs paid by', (0, data_provider_1.describeStoreComputePayer)(listing.computePayer)]);
145
+ }
146
+ if (listing.supportedLanguages?.length) {
147
+ summary.push(['Languages', `${listing.supportedLanguages.join(', ')} (publisher-declared)`]);
148
+ }
149
+ for (const line of (0, store_listing_1.labelledLines)(summary))
150
+ this.log(line);
151
+ // ── Capabilities and permissions ──
152
+ this.log('');
153
+ this.log('Capabilities and permissions');
154
+ for (const line of (0, store_listing_1.labelledLines)((0, store_listing_1.capabilityDisclosureRows)(listing.capabilityManifest))) {
155
+ this.log(line);
156
+ }
157
+ this.log(` ${store_listing_1.CAPABILITY_DISCLOSURE_FOOTNOTE}`);
158
+ // ── Releases ──
159
+ this.log('');
160
+ this.log(`Current release: ${version}${listing.releaseNumber ? ` (release ${listing.releaseNumber})` : ''}` +
161
+ `${listing.latestReleaseId ? `, ${listing.latestReleaseId}` : ''}`);
162
+ if (listing.changelog)
163
+ this.log(` ${(0, format_1.truncate)((0, format_1.collapseWhitespace)(listing.changelog), 160)}`);
164
+ if (releases.error) {
165
+ this.log(`Recent releases: unavailable (${releases.error})`);
166
+ }
167
+ else if (releaseRows.length > 0) {
168
+ this.log('Recent releases');
169
+ (0, format_1.renderTable)(releaseRows.map((r) => ({
170
+ version: r.versionLabel ? `v${r.versionLabel}` : '-',
171
+ id: String(r.id ?? '-'),
172
+ published: r.publishedAt ? String(r.publishedAt).slice(0, 10) : '-',
173
+ changelog: (0, format_1.collapseWhitespace)(String(r.changelog ?? '')),
174
+ })), [
175
+ { key: 'version', header: 'VERSION' },
176
+ { key: 'id', header: 'RELEASE ID' },
177
+ { key: 'published', header: 'PUBLISHED' },
178
+ { key: 'changelog', header: 'CHANGELOG', maxWidth: 48 },
179
+ ], (line) => this.log(` ${line}`));
180
+ const total = releases.value?.data?.length ?? 0;
181
+ if (total > releaseRows.length || releases.value?.has_more) {
182
+ this.log(` Older releases: ${this.config.bin} store releases ${agentId}`);
183
+ }
184
+ }
185
+ // ── Known issues ──
186
+ const issues = listing.knownIssues ?? [];
187
+ const open = issues.filter((issue) => issue.status === 'open');
188
+ this.log('');
189
+ if (issues.length === 0) {
190
+ this.log('Known issues: none posted for this release');
191
+ }
192
+ else {
193
+ this.log(`Known issues: ${open.length} open, ${issues.length - open.length} resolved`);
194
+ for (const issue of open)
195
+ this.log(` - ${(0, format_1.collapseWhitespace)(issue.title)}`);
196
+ }
197
+ this.log('');
198
+ if (listingUrl)
199
+ this.log(`Listing: ${listingUrl}`);
200
+ this.log(`Install: ${installCommand}`);
201
+ }
202
+ }
203
+ exports.default = StoreShow;
@@ -0,0 +1,33 @@
1
+ import { type StoreAgentInstallFunnelSummary, type StoreAgentReleaseAdoptionSummary, type StoreAgentReleaseOutcomes } from '@skrr-ai/data-provider';
2
+ import { BaseCommand } from '../../base-command';
3
+ /**
4
+ * The publisher's readouts for one of their own Store agents: how buyers move
5
+ * through the install funnel, which releases their copies are on, and how each
6
+ * release turns out in use.
7
+ *
8
+ * Every figure is k-anonymous and publisher-only (the author, or an owner/admin
9
+ * of the organisation the listing is published as) — the same readouts the web
10
+ * shows, under the same terms (I2): the seller side's own copies are excluded, a readout covering fewer buyers than its floor returns NO figures,
11
+ * and small rows are withheld. This command prints a withheld readout as
12
+ * withheld, with the floor it missed. It never prints 0 for one, because zero
13
+ * is a claim the server did not make.
14
+ *
15
+ * There is no `--since`. Each window is fixed by the server — a caller-chosen
16
+ * length would let `days=N` minus `days=N-1` isolate a single buyer — so the
17
+ * window a readout covers is printed with it instead.
18
+ */
19
+ export default class StoreStats extends BaseCommand {
20
+ static description: string;
21
+ static examples: string[];
22
+ static args: {
23
+ agent: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
24
+ };
25
+ static flags: {
26
+ json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
27
+ only: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
28
+ };
29
+ run(): Promise<void>;
30
+ }
31
+ export declare function funnelLines(summary: StoreAgentInstallFunnelSummary): string[];
32
+ export declare function adoptionLines(summary: StoreAgentReleaseAdoptionSummary): string[];
33
+ export declare function outcomesLines(outcomes: StoreAgentReleaseOutcomes): string[];