@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
@@ -13,16 +13,17 @@ class SpacesGitHubAutomationsShow extends base_command_1.BaseCommand {
13
13
  async run() {
14
14
  this.requireAuth();
15
15
  const { args, flags } = await this.parse(SpacesGitHubAutomationsShow);
16
+ const spaceRef = await this.resolveEntityRef('space', args.id);
16
17
  let result;
17
18
  try {
18
- result = await data_provider_1.dataService.getSpaceGitHubAutomations(args.id);
19
+ result = await data_provider_1.dataService.getSpaceGitHubAutomations(spaceRef);
19
20
  }
20
21
  catch (error) {
21
22
  this.handleApiError(error);
22
23
  return;
23
24
  }
24
25
  if (flags.json) {
25
- this.log(JSON.stringify((0, web_url_1.withSpaceUrl)(this.cliConfig.baseURL, { id: args.id, ...result }), null, 2));
26
+ this.log(JSON.stringify((0, web_url_1.withSpaceUrl)(this.cliConfig.baseURL, { id: spaceRef, ...result }), null, 2));
26
27
  return;
27
28
  }
28
29
  const policy = result.githubAutomations?.prLifecycle;
@@ -20,9 +20,10 @@ class SpacesGoals extends base_command_1.BaseCommand {
20
20
  async run() {
21
21
  this.requireAuth();
22
22
  const { args, flags } = await this.parse(SpacesGoals);
23
+ const spaceRef = await this.resolveEntityRef('space', args.id);
23
24
  let response;
24
25
  try {
25
- response = await data_provider_1.dataService.listSpaceGoals(args.id);
26
+ response = await data_provider_1.dataService.listSpaceGoals(spaceRef);
26
27
  }
27
28
  catch (err) {
28
29
  this.handleApiError(err);
@@ -39,6 +39,7 @@ class SpacesHeartbeatsCreate extends base_command_1.BaseCommand {
39
39
  async run() {
40
40
  this.requireAuth();
41
41
  const { args, flags } = await this.parse(SpacesHeartbeatsCreate);
42
+ const spaceRef = await this.resolveEntityRef('space', args.id);
42
43
  let body = {};
43
44
  try {
44
45
  body = await (0, prompt_1.readJsonBody)(flags['from-json']);
@@ -75,7 +76,7 @@ class SpacesHeartbeatsCreate extends base_command_1.BaseCommand {
75
76
  let result;
76
77
  try {
77
78
  result = await data_provider_1.dataService.createSpaceHeartbeat({
78
- spaceId: args.id,
79
+ spaceId: spaceRef,
79
80
  ...payload,
80
81
  });
81
82
  }
@@ -83,10 +84,10 @@ class SpacesHeartbeatsCreate extends base_command_1.BaseCommand {
83
84
  this.handleApiError(err);
84
85
  }
85
86
  if (flags.json) {
86
- this.log(JSON.stringify((0, space_output_1.withSpacePerspectiveUrl)(this.cliConfig.baseURL, args.id, 'schedule', result), null, 2));
87
+ this.log(JSON.stringify((0, space_output_1.withSpacePerspectiveUrl)(this.cliConfig.baseURL, spaceRef, 'schedule', result), null, 2));
87
88
  return;
88
89
  }
89
- this.log(`Created heartbeat for agent ${agentId} in space ${args.id}`);
90
+ this.log(`Created heartbeat for agent ${agentId} in space ${spaceRef}`);
90
91
  }
91
92
  }
92
93
  exports.default = SpacesHeartbeatsCreate;
@@ -22,9 +22,10 @@ class SpacesHeartbeatsDelete extends base_command_1.BaseCommand {
22
22
  async run() {
23
23
  this.requireAuth();
24
24
  const { args, flags } = await this.parse(SpacesHeartbeatsDelete);
25
+ const spaceRef = await this.resolveEntityRef('space', args.id);
25
26
  let confirmed;
26
27
  try {
27
- confirmed = await (0, prompt_1.confirmDestructive)(`Delete heartbeat for agent ${args.agentId} in space ${args.id}? This cannot be undone.`, flags.yes);
28
+ confirmed = await (0, prompt_1.confirmDestructive)(`Delete heartbeat for agent ${args.agentId} in space ${spaceRef}? This cannot be undone.`, flags.yes);
28
29
  }
29
30
  catch (err) {
30
31
  this.error(err.message, {
@@ -36,7 +37,7 @@ class SpacesHeartbeatsDelete extends base_command_1.BaseCommand {
36
37
  return;
37
38
  }
38
39
  try {
39
- await data_provider_1.dataService.deleteSpaceHeartbeat(args.id, args.agentId);
40
+ await data_provider_1.dataService.deleteSpaceHeartbeat(spaceRef, args.agentId);
40
41
  }
41
42
  catch (err) {
42
43
  this.handleApiError(err);
@@ -45,7 +46,7 @@ class SpacesHeartbeatsDelete extends base_command_1.BaseCommand {
45
46
  this.log(JSON.stringify({
46
47
  success: true,
47
48
  agentId: args.agentId,
48
- url: (0, space_output_1.spacePerspectiveUrl)(this.cliConfig.baseURL, args.id, 'schedule'),
49
+ url: (0, space_output_1.spacePerspectiveUrl)(this.cliConfig.baseURL, spaceRef, 'schedule'),
49
50
  }, null, 2));
50
51
  return;
51
52
  }
@@ -51,15 +51,16 @@ class SpacesHeartbeatsList extends base_command_1.BaseCommand {
51
51
  async run() {
52
52
  this.requireAuth();
53
53
  const { args, flags } = await this.parse(SpacesHeartbeatsList);
54
+ const spaceRef = await this.resolveEntityRef('space', args.id);
54
55
  let response;
55
56
  try {
56
- response = await data_provider_1.dataService.listSpaceHeartbeats(args.id);
57
+ response = await data_provider_1.dataService.listSpaceHeartbeats(spaceRef);
57
58
  }
58
59
  catch (err) {
59
60
  this.handleApiError(err);
60
61
  }
61
62
  if (flags.json) {
62
- this.log(JSON.stringify((0, space_output_1.withSpaceResourceUrls)(this.cliConfig.baseURL, args.id, 'schedule', response, [
63
+ this.log(JSON.stringify((0, space_output_1.withSpaceResourceUrls)(this.cliConfig.baseURL, spaceRef, 'schedule', response, [
63
64
  'agentId',
64
65
  'id',
65
66
  '_id',
@@ -87,7 +88,7 @@ class SpacesHeartbeatsList extends base_command_1.BaseCommand {
87
88
  ], (line) => this.log(line));
88
89
  this.log('');
89
90
  this.log('For live next-run status of a specific heartbeat:');
90
- this.log(` skrr spaces heartbeats status ${args.id} <agent-id>`);
91
+ this.log(` skrr spaces heartbeats status ${spaceRef} <agent-id>`);
91
92
  }
92
93
  }
93
94
  exports.default = SpacesHeartbeatsList;
@@ -21,9 +21,10 @@ class SpacesHeartbeatsStatus extends base_command_1.BaseCommand {
21
21
  async run() {
22
22
  this.requireAuth();
23
23
  const { args, flags } = await this.parse(SpacesHeartbeatsStatus);
24
+ const spaceRef = await this.resolveEntityRef('space', args.id);
24
25
  let result;
25
26
  try {
26
- result = await data_provider_1.dataService.getSpaceHeartbeatStatus(args.id, args.agentId);
27
+ result = await data_provider_1.dataService.getSpaceHeartbeatStatus(spaceRef, args.agentId);
27
28
  }
28
29
  catch (err) {
29
30
  this.handleApiError(err);
@@ -31,7 +32,7 @@ class SpacesHeartbeatsStatus extends base_command_1.BaseCommand {
31
32
  // --json takes priority over the human-readable "not configured" message
32
33
  // so piped consumers always receive valid JSON (null when missing).
33
34
  if (flags.json) {
34
- this.log(JSON.stringify((0, space_output_1.withSpacePerspectiveUrl)(this.cliConfig.baseURL, args.id, 'schedule', {
35
+ this.log(JSON.stringify((0, space_output_1.withSpacePerspectiveUrl)(this.cliConfig.baseURL, spaceRef, 'schedule', {
35
36
  result: result ?? null,
36
37
  }), null, 2));
37
38
  return;
@@ -38,6 +38,7 @@ class SpacesHeartbeatsUpdate extends base_command_1.BaseCommand {
38
38
  async run() {
39
39
  this.requireAuth();
40
40
  const { args, flags } = await this.parse(SpacesHeartbeatsUpdate);
41
+ const spaceRef = await this.resolveEntityRef('space', args.id);
41
42
  let body = {};
42
43
  try {
43
44
  body = await (0, prompt_1.readJsonBody)(flags['from-json']);
@@ -63,7 +64,7 @@ class SpacesHeartbeatsUpdate extends base_command_1.BaseCommand {
63
64
  let result;
64
65
  try {
65
66
  result = await data_provider_1.dataService.updateSpaceHeartbeat({
66
- spaceId: args.id,
67
+ spaceId: spaceRef,
67
68
  agentId: args.agentId,
68
69
  ...payload,
69
70
  });
@@ -72,10 +73,10 @@ class SpacesHeartbeatsUpdate extends base_command_1.BaseCommand {
72
73
  this.handleApiError(err);
73
74
  }
74
75
  if (flags.json) {
75
- this.log(JSON.stringify((0, space_output_1.withSpacePerspectiveUrl)(this.cliConfig.baseURL, args.id, 'schedule', result), null, 2));
76
+ this.log(JSON.stringify((0, space_output_1.withSpacePerspectiveUrl)(this.cliConfig.baseURL, spaceRef, 'schedule', result), null, 2));
76
77
  return;
77
78
  }
78
- this.log(`Updated heartbeat for agent ${args.agentId} in space ${args.id}`);
79
+ this.log(`Updated heartbeat for agent ${args.agentId} in space ${spaceRef}`);
79
80
  }
80
81
  }
81
82
  exports.default = SpacesHeartbeatsUpdate;
@@ -144,6 +144,7 @@ class SpacesInsights extends base_command_1.BaseCommand {
144
144
  if ((!args.id && !flags.all) || (args.id && flags.all)) {
145
145
  this.error('Pass exactly one Space ID or --all', { exit: 2 });
146
146
  }
147
+ const spaceRef = args.id ? await this.resolveEntityRef('space', args.id) : undefined;
147
148
  let request;
148
149
  try {
149
150
  const requestFlags = {
@@ -166,13 +167,13 @@ class SpacesInsights extends base_command_1.BaseCommand {
166
167
  }
167
168
  try {
168
169
  if (flags.csv) {
169
- process.stdout.write(args.id
170
- ? await data_provider_1.dataService.exportSpaceTaskInsightsCsv(args.id, request)
170
+ process.stdout.write(spaceRef
171
+ ? await data_provider_1.dataService.exportSpaceTaskInsightsCsv(spaceRef, request)
171
172
  : await data_provider_1.dataService.exportWorkspaceTaskInsightsCsv(request));
172
173
  return;
173
174
  }
174
- const result = args.id
175
- ? await data_provider_1.dataService.getSpaceTaskInsights(args.id, request)
175
+ const result = spaceRef
176
+ ? await data_provider_1.dataService.getSpaceTaskInsights(spaceRef, request)
176
177
  : await data_provider_1.dataService.getWorkspaceTaskInsights(request);
177
178
  if (flags.json) {
178
179
  this.log(JSON.stringify(result, null, 2));
@@ -24,6 +24,7 @@ class SpacesLabelsAdd extends base_command_1.BaseCommand {
24
24
  async run() {
25
25
  this.requireAuth();
26
26
  const { args, flags } = await this.parse(SpacesLabelsAdd);
27
+ const spaceRef = await this.resolveEntityRef('space', args.id);
27
28
  // `spaces update` deliberately refuses labelIds — the server routes label
28
29
  // changes through this atomic $addToSet endpoint so concurrent edits can't
29
30
  // clobber each other. Re-attaching an already-attached label is a no-op.
@@ -45,20 +46,20 @@ class SpacesLabelsAdd extends base_command_1.BaseCommand {
45
46
  }
46
47
  let result;
47
48
  try {
48
- result = await data_provider_1.dataService.addLabelToSpace({ spaceId: args.id, labelId });
49
+ result = await data_provider_1.dataService.addLabelToSpace({ spaceId: spaceRef, labelId });
49
50
  }
50
51
  catch (err) {
51
52
  this.handleApiError(err);
52
53
  }
53
54
  const updated = (0, web_url_1.withSpaceUrl)(this.cliConfig.baseURL, {
54
- id: args.id,
55
+ id: spaceRef,
55
56
  ...result,
56
57
  });
57
58
  if (flags.json) {
58
59
  this.log(JSON.stringify(updated, null, 2));
59
60
  return;
60
61
  }
61
- this.log(`Attached label ${flags.label} to space ${args.id}`);
62
+ this.log(`Attached label ${flags.label} to space ${spaceRef}`);
62
63
  this.log(`URL: ${updated.url ?? '-'}`);
63
64
  }
64
65
  }
@@ -19,9 +19,10 @@ class SpacesLabelsList extends base_command_1.BaseCommand {
19
19
  async run() {
20
20
  this.requireAuth();
21
21
  const { args, flags } = await this.parse(SpacesLabelsList);
22
+ const spaceRef = await this.resolveEntityRef('space', args.id);
22
23
  let space;
23
24
  try {
24
- space = await data_provider_1.dataService.getSpace(args.id);
25
+ space = await data_provider_1.dataService.getSpace(spaceRef);
25
26
  }
26
27
  catch (err) {
27
28
  this.handleApiError(err);
@@ -24,6 +24,7 @@ class SpacesLabelsRemove extends base_command_1.BaseCommand {
24
24
  async run() {
25
25
  this.requireAuth();
26
26
  const { args, flags } = await this.parse(SpacesLabelsRemove);
27
+ const spaceRef = await this.resolveEntityRef('space', args.id);
27
28
  // Detach is intentionally permissive server-side: you can remove a label
28
29
  // you can no longer read, so a revoked label never gets stuck on a space.
29
30
  // A name is resolved against the DECLARED vocabulary; an unknown one is
@@ -44,20 +45,20 @@ class SpacesLabelsRemove extends base_command_1.BaseCommand {
44
45
  }
45
46
  let result;
46
47
  try {
47
- result = await data_provider_1.dataService.removeLabelFromSpace({ spaceId: args.id, labelId });
48
+ result = await data_provider_1.dataService.removeLabelFromSpace({ spaceId: spaceRef, labelId });
48
49
  }
49
50
  catch (err) {
50
51
  this.handleApiError(err);
51
52
  }
52
53
  const updated = (0, web_url_1.withSpaceUrl)(this.cliConfig.baseURL, {
53
- id: args.id,
54
+ id: spaceRef,
54
55
  ...result,
55
56
  });
56
57
  if (flags.json) {
57
58
  this.log(JSON.stringify(updated, null, 2));
58
59
  return;
59
60
  }
60
- this.log(`Detached label ${flags.label} from space ${args.id}`);
61
+ this.log(`Detached label ${flags.label} from space ${spaceRef}`);
61
62
  this.log(`URL: ${updated.url ?? '-'}`);
62
63
  }
63
64
  }
@@ -34,6 +34,9 @@ export default class SpacesList extends BaseCommand {
34
34
  static description: string;
35
35
  static examples: string[];
36
36
  static flags: {
37
+ fields: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
38
+ compact: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
39
+ ndjson: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
37
40
  json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
38
41
  status: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
39
42
  label: import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
@@ -7,6 +7,7 @@ const data_provider_1 = require("@skrr-ai/data-provider");
7
7
  const base_command_1 = require("../../base-command");
8
8
  const web_url_1 = require("../../lib/web-url");
9
9
  const format_1 = require("../../lib/format");
10
+ const list_output_1 = require("../../lib/list-output");
10
11
  /**
11
12
  * What an empty `--q` result is allowed to claim.
12
13
  *
@@ -55,6 +56,8 @@ class SpacesList extends base_command_1.BaseCommand {
55
56
  '<%= config.bin %> spaces list --label <label-a> --label <label-b>',
56
57
  '<%= config.bin %> spaces list --q "always on"',
57
58
  '<%= config.bin %> spaces list --include-archived --json',
59
+ '<%= config.bin %> spaces list --compact --json',
60
+ '<%= config.bin %> spaces list --fields id,identifier,title --ndjson',
58
61
  ];
59
62
  static flags = {
60
63
  json: core_1.Flags.boolean({ description: 'Output as JSON' }),
@@ -87,6 +90,7 @@ class SpacesList extends base_command_1.BaseCommand {
87
90
  }),
88
91
  limit: core_1.Flags.integer({ description: 'Max results', default: 50 }),
89
92
  cursor: core_1.Flags.string({ description: 'Pagination cursor from a previous page' }),
93
+ ...list_output_1.listOutputFlags,
90
94
  };
91
95
  async run() {
92
96
  this.requireAuth();
@@ -105,8 +109,13 @@ class SpacesList extends base_command_1.BaseCommand {
105
109
  catch (err) {
106
110
  this.handleApiError(err);
107
111
  }
108
- if (flags.json) {
109
- this.log(JSON.stringify((0, web_url_1.withDataUrls)(this.cliConfig.baseURL, response, web_url_1.spaceUrlFrom), null, 2));
112
+ if (flags.json || flags.ndjson) {
113
+ this.printList((0, list_output_1.shapeListResponse)((0, web_url_1.withDataUrls)(this.cliConfig.baseURL, response, web_url_1.spaceUrlFrom), {
114
+ resource: 'space',
115
+ fields: flags.fields,
116
+ compact: flags.compact,
117
+ requestedLimit: flags.limit,
118
+ }), Boolean(flags.ndjson));
110
119
  return;
111
120
  }
112
121
  const r = response;
@@ -27,6 +27,7 @@ class SpacesLiveCardsCreate extends base_command_1.BaseCommand {
27
27
  async run() {
28
28
  this.requireAuth();
29
29
  const { args, flags } = await this.parse(SpacesLiveCardsCreate);
30
+ const spaceRef = await this.resolveEntityRef('space', args.id);
30
31
  let body = {};
31
32
  try {
32
33
  body = await (0, prompt_1.readJsonBody)(flags['from-json']);
@@ -54,13 +55,13 @@ class SpacesLiveCardsCreate extends base_command_1.BaseCommand {
54
55
  this.error('Pass --kind and --title, or provide them in JSON.', { exit: 1 });
55
56
  let result;
56
57
  try {
57
- result = await data_provider_1.dataService.createSpace3DCard(args.id, payload);
58
+ result = await data_provider_1.dataService.createSpace3DCard(spaceRef, payload);
58
59
  }
59
60
  catch (err) {
60
61
  this.handleApiError(err);
61
62
  }
62
63
  if (flags.json)
63
- this.log(JSON.stringify((0, space_output_1.withSpaceResourceUrls)(this.cliConfig.baseURL, args.id, 'live', result, ['id']), null, 2));
64
+ this.log(JSON.stringify((0, space_output_1.withSpaceResourceUrls)(this.cliConfig.baseURL, spaceRef, 'live', result, ['id']), null, 2));
64
65
  else
65
66
  this.log(`Created Live card ${result?.id ?? '?'}.`);
66
67
  }
@@ -14,15 +14,16 @@ class SpacesLiveCardsList extends base_command_1.BaseCommand {
14
14
  async run() {
15
15
  this.requireAuth();
16
16
  const { args, flags } = await this.parse(SpacesLiveCardsList);
17
+ const spaceRef = await this.resolveEntityRef('space', args.id);
17
18
  let response;
18
19
  try {
19
- response = await data_provider_1.dataService.listSpace3DCards(args.id);
20
+ response = await data_provider_1.dataService.listSpace3DCards(spaceRef);
20
21
  }
21
22
  catch (err) {
22
23
  this.handleApiError(err);
23
24
  }
24
25
  if (flags.json)
25
- return void this.log(JSON.stringify((0, space_output_1.withSpaceResourceUrls)(this.cliConfig.baseURL, args.id, 'live', response, ['id']), null, 2));
26
+ return void this.log(JSON.stringify((0, space_output_1.withSpaceResourceUrls)(this.cliConfig.baseURL, spaceRef, 'live', response, ['id']), null, 2));
26
27
  (0, format_1.renderTable)(response.data.map((c) => ({
27
28
  id: c.id,
28
29
  title: c.title,
@@ -18,6 +18,7 @@ class SpacesLiveCardsReorder extends base_command_1.BaseCommand {
18
18
  async run() {
19
19
  this.requireAuth();
20
20
  const { args, flags } = await this.parse(SpacesLiveCardsReorder);
21
+ const spaceRef = await this.resolveEntityRef('space', args.id);
21
22
  let raw = {};
22
23
  if (flags['from-json']) {
23
24
  try {
@@ -36,7 +37,7 @@ class SpacesLiveCardsReorder extends base_command_1.BaseCommand {
36
37
  this.error('Provide repeated --card IDs or orderedIds JSON.', { exit: 1 });
37
38
  let result;
38
39
  try {
39
- result = await data_provider_1.dataService.reorderSpace3DCards(args.id, {
40
+ result = await data_provider_1.dataService.reorderSpace3DCards(spaceRef, {
40
41
  orderedIds: orderedIds,
41
42
  });
42
43
  }
@@ -44,7 +45,11 @@ class SpacesLiveCardsReorder extends base_command_1.BaseCommand {
44
45
  this.handleApiError(err);
45
46
  }
46
47
  if (flags.json)
47
- this.log(JSON.stringify({ result, orderedIds, url: (0, space_output_1.spacePerspectiveUrl)(this.cliConfig.baseURL, args.id, 'live') }, null, 2));
48
+ this.log(JSON.stringify({
49
+ result,
50
+ orderedIds,
51
+ url: (0, space_output_1.spacePerspectiveUrl)(this.cliConfig.baseURL, spaceRef, 'live'),
52
+ }, null, 2));
48
53
  else
49
54
  this.log(`Reordered ${orderedIds.length} Live cards.`);
50
55
  }
@@ -18,6 +18,7 @@ class SpacesLiveScene extends base_command_1.BaseCommand {
18
18
  async run() {
19
19
  this.requireAuth();
20
20
  const { args, flags } = await this.parse(SpacesLiveScene);
21
+ const spaceRef = await this.resolveEntityRef('space', args.id);
21
22
  let result;
22
23
  if (flags.character || flags['from-json']) {
23
24
  let body = {};
@@ -32,7 +33,7 @@ class SpacesLiveScene extends base_command_1.BaseCommand {
32
33
  if (!body.characterId || typeof body.characterId !== 'string')
33
34
  this.error('Pass --character or characterId in JSON.', { exit: 1 });
34
35
  try {
35
- result = await data_provider_1.dataService.updateSpaceLiveScene(args.id, body);
36
+ result = await data_provider_1.dataService.updateSpaceLiveScene(spaceRef, body);
36
37
  }
37
38
  catch (err) {
38
39
  this.handleApiError(err);
@@ -40,14 +41,14 @@ class SpacesLiveScene extends base_command_1.BaseCommand {
40
41
  }
41
42
  else {
42
43
  try {
43
- result = await data_provider_1.dataService.getSpaceLiveScene(args.id);
44
+ result = await data_provider_1.dataService.getSpaceLiveScene(spaceRef);
44
45
  }
45
46
  catch (err) {
46
47
  this.handleApiError(err);
47
48
  }
48
49
  }
49
50
  const output = result && typeof result === 'object'
50
- ? (0, space_output_1.withSpacePerspectiveUrl)(this.cliConfig.baseURL, args.id, 'live', result)
51
+ ? (0, space_output_1.withSpacePerspectiveUrl)(this.cliConfig.baseURL, spaceRef, 'live', result)
51
52
  : result;
52
53
  this.log(JSON.stringify(output, null, 2));
53
54
  }
@@ -76,6 +76,7 @@ class SpacesMembersAdd extends base_command_1.BaseCommand {
76
76
  async run() {
77
77
  this.requireAuth();
78
78
  const { args, flags } = await this.parse(SpacesMembersAdd);
79
+ const spaceRef = await this.resolveEntityRef('space', args.id);
79
80
  const userIds = flags.user ?? [];
80
81
  const agentIds = flags.agent ?? [];
81
82
  if (userIds.length + agentIds.length === 0) {
@@ -106,8 +107,8 @@ class SpacesMembersAdd extends base_command_1.BaseCommand {
106
107
  let current;
107
108
  let result;
108
109
  try {
109
- current = await data_provider_1.dataService.getResourcePermissions(data_provider_1.ResourceType.SPACE, args.id);
110
- result = await data_provider_1.dataService.updateResourcePermissions(data_provider_1.ResourceType.SPACE, args.id, {
110
+ current = await data_provider_1.dataService.getResourcePermissions(data_provider_1.ResourceType.SPACE, spaceRef);
111
+ result = await data_provider_1.dataService.updateResourcePermissions(data_provider_1.ResourceType.SPACE, spaceRef, {
111
112
  updated: updated,
112
113
  removed: [],
113
114
  public: Boolean(current.public),
@@ -117,14 +118,14 @@ class SpacesMembersAdd extends base_command_1.BaseCommand {
117
118
  if ((brief && brief.trim().length > 0) || (expertise && expertise.length > 0)) {
118
119
  const saves = [
119
120
  ...userIds.map((principalId) => data_provider_1.dataService.upsertSpaceBrief({
120
- spaceId: args.id,
121
+ spaceId: spaceRef,
121
122
  principalType: 'user',
122
123
  principalId,
123
124
  content: brief && brief.trim().length > 0 ? brief : undefined,
124
125
  expertise,
125
126
  })),
126
127
  ...agentIds.map((principalId) => data_provider_1.dataService.upsertSpaceBrief({
127
- spaceId: args.id,
128
+ spaceId: spaceRef,
128
129
  principalType: 'agent',
129
130
  principalId,
130
131
  content: brief && brief.trim().length > 0 ? brief : undefined,
@@ -138,14 +139,14 @@ class SpacesMembersAdd extends base_command_1.BaseCommand {
138
139
  this.handleApiError(err);
139
140
  }
140
141
  if (flags.json) {
141
- this.log(JSON.stringify((0, space_output_1.withSpacePerspectiveUrl)(this.cliConfig.baseURL, args.id, 'members', result), null, 2));
142
+ this.log(JSON.stringify((0, space_output_1.withSpacePerspectiveUrl)(this.cliConfig.baseURL, spaceRef, 'members', result), null, 2));
142
143
  return;
143
144
  }
144
145
  const parts = [
145
146
  userIds.length ? `${userIds.length} user(s)` : '',
146
147
  agentIds.length ? `${agentIds.length} agent(s)` : '',
147
148
  ].filter(Boolean);
148
- this.log(`Added ${parts.join(' and ')} to space ${args.id} as ${flags.role}.`);
149
+ this.log(`Added ${parts.join(' and ')} to space ${spaceRef} as ${flags.role}.`);
149
150
  }
150
151
  }
151
152
  exports.default = SpacesMembersAdd;
@@ -21,17 +21,18 @@ class SpacesMembersList extends base_command_1.BaseCommand {
21
21
  async run() {
22
22
  this.requireAuth();
23
23
  const { args, flags } = await this.parse(SpacesMembersList);
24
+ const spaceRef = await this.resolveEntityRef('space', args.id);
24
25
  let response;
25
26
  let briefs = [];
26
27
  try {
27
- response = await data_provider_1.dataService.getResourcePermissions(data_provider_1.ResourceType.SPACE, args.id);
28
- briefs = (await data_provider_1.dataService.listSpaceBriefs(args.id).catch(() => [])).filter((b) => Array.isArray(b.expertise) && b.expertise.length > 0);
28
+ response = await data_provider_1.dataService.getResourcePermissions(data_provider_1.ResourceType.SPACE, spaceRef);
29
+ briefs = (await data_provider_1.dataService.listSpaceBriefs(spaceRef).catch(() => [])).filter((b) => Array.isArray(b.expertise) && b.expertise.length > 0);
29
30
  }
30
31
  catch (err) {
31
32
  this.handleApiError(err);
32
33
  }
33
34
  if (flags.json) {
34
- this.log(JSON.stringify((0, space_output_1.withSpacePerspectiveUrl)(this.cliConfig.baseURL, args.id, 'members', response), null, 2));
35
+ this.log(JSON.stringify((0, space_output_1.withSpacePerspectiveUrl)(this.cliConfig.baseURL, spaceRef, 'members', response), null, 2));
35
36
  return;
36
37
  }
37
38
  const principals = (response.principals ?? []);
@@ -32,6 +32,7 @@ class SpacesMembersRemove extends base_command_1.BaseCommand {
32
32
  async run() {
33
33
  this.requireAuth();
34
34
  const { args, flags } = await this.parse(SpacesMembersRemove);
35
+ const spaceRef = await this.resolveEntityRef('space', args.id);
35
36
  const userIds = flags.user ?? [];
36
37
  const agentIds = flags.agent ?? [];
37
38
  if (userIds.length + agentIds.length === 0) {
@@ -44,8 +45,8 @@ class SpacesMembersRemove extends base_command_1.BaseCommand {
44
45
  let current;
45
46
  let result;
46
47
  try {
47
- current = await data_provider_1.dataService.getResourcePermissions(data_provider_1.ResourceType.SPACE, args.id);
48
- result = await data_provider_1.dataService.updateResourcePermissions(data_provider_1.ResourceType.SPACE, args.id, {
48
+ current = await data_provider_1.dataService.getResourcePermissions(data_provider_1.ResourceType.SPACE, spaceRef);
49
+ result = await data_provider_1.dataService.updateResourcePermissions(data_provider_1.ResourceType.SPACE, spaceRef, {
49
50
  updated: [],
50
51
  removed: removed,
51
52
  public: Boolean(current.public),
@@ -53,8 +54,8 @@ class SpacesMembersRemove extends base_command_1.BaseCommand {
53
54
  });
54
55
  if (!flags['keep-brief']) {
55
56
  const deletes = [
56
- ...userIds.map((principalId) => data_provider_1.dataService.deleteSpaceBrief(args.id, 'user', principalId).catch(() => undefined)),
57
- ...agentIds.map((principalId) => data_provider_1.dataService.deleteSpaceBrief(args.id, 'agent', principalId).catch(() => undefined)),
57
+ ...userIds.map((principalId) => data_provider_1.dataService.deleteSpaceBrief(spaceRef, 'user', principalId).catch(() => undefined)),
58
+ ...agentIds.map((principalId) => data_provider_1.dataService.deleteSpaceBrief(spaceRef, 'agent', principalId).catch(() => undefined)),
58
59
  ];
59
60
  await Promise.all(deletes);
60
61
  }
@@ -63,14 +64,14 @@ class SpacesMembersRemove extends base_command_1.BaseCommand {
63
64
  this.handleApiError(err);
64
65
  }
65
66
  if (flags.json) {
66
- this.log(JSON.stringify((0, space_output_1.withSpacePerspectiveUrl)(this.cliConfig.baseURL, args.id, 'members', result), null, 2));
67
+ this.log(JSON.stringify((0, space_output_1.withSpacePerspectiveUrl)(this.cliConfig.baseURL, spaceRef, 'members', result), null, 2));
67
68
  return;
68
69
  }
69
70
  const parts = [
70
71
  userIds.length ? `${userIds.length} user(s)` : '',
71
72
  agentIds.length ? `${agentIds.length} agent(s)` : '',
72
73
  ].filter(Boolean);
73
- this.log(`Removed ${parts.join(' and ')} from space ${args.id}.`);
74
+ this.log(`Removed ${parts.join(' and ')} from space ${spaceRef}.`);
74
75
  }
75
76
  }
76
77
  exports.default = SpacesMembersRemove;
@@ -50,6 +50,7 @@ class SpacesMove extends base_command_1.BaseCommand {
50
50
  async run() {
51
51
  this.requireAuth();
52
52
  const { args, flags } = await this.parse(SpacesMove);
53
+ const spaceRef = await this.resolveEntityRef('space', args.id);
53
54
  let parentSpaceId;
54
55
  try {
55
56
  parentSpaceId = resolveReparentTarget(flags);
@@ -59,7 +60,7 @@ class SpacesMove extends base_command_1.BaseCommand {
59
60
  }
60
61
  let updated;
61
62
  try {
62
- updated = await data_provider_1.dataService.reparentSpace(args.id, parentSpaceId);
63
+ updated = await data_provider_1.dataService.reparentSpace(spaceRef, parentSpaceId);
63
64
  }
64
65
  catch (err) {
65
66
  this.handleApiError(err);
@@ -70,7 +71,7 @@ class SpacesMove extends base_command_1.BaseCommand {
70
71
  }
71
72
  const s = updated;
72
73
  const dest = parentSpaceId ? `under ${parentSpaceId}` : 'to the root';
73
- this.log(`Moved space ${s.id ?? s._id ?? args.id} - ${s.title ?? '(no title)'} ${dest} (depth ${s.depth ?? 0})`);
74
+ this.log(`Moved space ${s.id ?? s._id ?? spaceRef} - ${s.title ?? '(no title)'} ${dest} (depth ${s.depth ?? 0})`);
74
75
  // The move committed; something downstream of it did not. The server used
75
76
  // to spend a 500 on this, which said the move had not happened. Now it says
76
77
  // what is stale, and the only way that reaches a human is if we print it.
@@ -13,21 +13,22 @@ class SpacesPin extends base_command_1.BaseCommand {
13
13
  async run() {
14
14
  this.requireAuth();
15
15
  const { args, flags } = await this.parse(SpacesPin);
16
+ const spaceRef = await this.resolveEntityRef('space', args.id);
16
17
  let result;
17
18
  try {
18
- result = await data_provider_1.dataService.toggleSpacePin(args.id);
19
+ result = await data_provider_1.dataService.toggleSpacePin(spaceRef);
19
20
  }
20
21
  catch (err) {
21
22
  this.handleApiError(err);
22
23
  }
23
24
  if (flags.json)
24
25
  this.log(JSON.stringify({
25
- spaceId: args.id,
26
+ spaceId: spaceRef,
26
27
  ...result,
27
- url: (0, space_output_1.spacePerspectiveUrl)(this.cliConfig.baseURL, args.id, 'settings'),
28
+ url: (0, space_output_1.spacePerspectiveUrl)(this.cliConfig.baseURL, spaceRef, 'settings'),
28
29
  }, null, 2));
29
30
  else
30
- this.log(`${result?.isPinned ? 'Pinned' : 'Unpinned'} space ${args.id}.`);
31
+ this.log(`${result?.isPinned ? 'Pinned' : 'Unpinned'} space ${spaceRef}.`);
31
32
  }
32
33
  }
33
34
  exports.default = SpacesPin;
@@ -13,6 +13,7 @@ class SpacesPreferencesShow extends base_command_1.BaseCommand {
13
13
  async run() {
14
14
  this.requireAuth();
15
15
  const { args, flags } = await this.parse(SpacesPreferencesShow);
16
+ const spaceRef = await this.resolveEntityRef('space', args.id);
16
17
  let response;
17
18
  try {
18
19
  response = await data_provider_1.dataService.getAllSpacePreferences();
@@ -20,9 +21,9 @@ class SpacesPreferencesShow extends base_command_1.BaseCommand {
20
21
  catch (err) {
21
22
  this.handleApiError(err);
22
23
  }
23
- const preferences = response.spacePreferences?.[args.id] ?? {};
24
- const output = (0, space_output_1.withSpacePerspectiveUrl)(this.cliConfig.baseURL, args.id, 'settings', {
25
- spaceId: args.id,
24
+ const preferences = response.spacePreferences?.[spaceRef] ?? {};
25
+ const output = (0, space_output_1.withSpacePerspectiveUrl)(this.cliConfig.baseURL, spaceRef, 'settings', {
26
+ spaceId: spaceRef,
26
27
  preferences,
27
28
  });
28
29
  if (flags.json)