@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
@@ -19,6 +19,7 @@ class SpacesPreferencesTabs extends base_command_1.BaseCommand {
19
19
  async run() {
20
20
  this.requireAuth();
21
21
  const { args, flags } = await this.parse(SpacesPreferencesTabs);
22
+ const spaceRef = await this.resolveEntityRef('space', args.id);
22
23
  let raw = {};
23
24
  if (flags['from-json']) {
24
25
  try {
@@ -34,7 +35,7 @@ class SpacesPreferencesTabs extends base_command_1.BaseCommand {
34
35
  this.error('Provide --visible/--hidden values or JSON arrays.', { exit: 1 });
35
36
  let result;
36
37
  try {
37
- result = await data_provider_1.dataService.updateSpaceTabVisibility(args.id, {
38
+ result = await data_provider_1.dataService.updateSpaceTabVisibility(spaceRef, {
38
39
  visible: visible,
39
40
  hidden: hidden,
40
41
  });
@@ -43,9 +44,9 @@ class SpacesPreferencesTabs extends base_command_1.BaseCommand {
43
44
  this.handleApiError(err);
44
45
  }
45
46
  if (flags.json)
46
- this.log(JSON.stringify({ result, url: (0, space_output_1.spacePerspectiveUrl)(this.cliConfig.baseURL, args.id, 'settings') }, null, 2));
47
+ this.log(JSON.stringify({ result, url: (0, space_output_1.spacePerspectiveUrl)(this.cliConfig.baseURL, spaceRef, 'settings') }, null, 2));
47
48
  else
48
- this.log(`Updated tab visibility for space ${args.id}.`);
49
+ this.log(`Updated tab visibility for space ${spaceRef}.`);
49
50
  }
50
51
  }
51
52
  exports.default = SpacesPreferencesTabs;
@@ -20,15 +20,16 @@ class SpacesRevisions extends base_command_1.BaseCommand {
20
20
  async run() {
21
21
  this.requireAuth();
22
22
  const { args, flags } = await this.parse(SpacesRevisions);
23
+ const spaceRef = await this.resolveEntityRef('space', args.id);
23
24
  let result;
24
25
  try {
25
- result = await data_provider_1.dataService.listSpaceRevisions(args.id);
26
+ result = await data_provider_1.dataService.listSpaceRevisions(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.withSpacePerspectiveUrl)(this.cliConfig.baseURL, args.id, 'settings', result), null, 2));
32
+ this.log(JSON.stringify((0, space_output_1.withSpacePerspectiveUrl)(this.cliConfig.baseURL, spaceRef, 'settings', result), null, 2));
32
33
  return;
33
34
  }
34
35
  const items = result?.data ?? [];
@@ -18,12 +18,13 @@ class SpacesRoomEnsure extends space_room_1.SpaceRoomCommand {
18
18
  async run() {
19
19
  this.requireAuth();
20
20
  const { args, flags } = await this.parse(SpacesRoomEnsure);
21
+ const spaceRef = await this.resolveEntityRef('space', args.id);
21
22
  // Idempotent — the same POST the web Room tab issues on mount. Safe to run
22
23
  // repeatedly: it creates the room only when absent, and otherwise just
23
24
  // reconciles the chat's participants/agents against the space membership.
24
- const payload = await this.fetchRoom(args.id, { ensure: true });
25
+ const payload = await this.fetchRoom(spaceRef, { ensure: true });
25
26
  if (flags.json) {
26
- this.log(JSON.stringify((0, space_output_1.withSpacePerspectiveUrl)(this.cliConfig.baseURL, args.id, 'room', payload), null, 2));
27
+ this.log(JSON.stringify((0, space_output_1.withSpacePerspectiveUrl)(this.cliConfig.baseURL, spaceRef, 'room', payload), null, 2));
27
28
  return;
28
29
  }
29
30
  const room = payload.spaceRoom;
@@ -32,8 +33,8 @@ class SpacesRoomEnsure extends space_room_1.SpaceRoomCommand {
32
33
  const changes = (0, space_room_1.describeReconciliation)(room);
33
34
  this.log(changes ? `Reconciled: ${changes}` : 'Membership already up to date.');
34
35
  this.log('');
35
- this.log(`Read: ${this.config.bin} spaces room messages ${args.id}`);
36
- this.log(`Send: ${this.config.bin} spaces room send ${args.id} -m "..."`);
36
+ this.log(`Read: ${this.config.bin} spaces room messages ${spaceRef}`);
37
+ this.log(`Send: ${this.config.bin} spaces room send ${spaceRef} -m "..."`);
37
38
  }
38
39
  }
39
40
  exports.default = SpacesRoomEnsure;
@@ -29,7 +29,8 @@ class SpacesRoomMessages extends space_room_1.SpaceRoomCommand {
29
29
  async run() {
30
30
  this.requireAuth();
31
31
  const { args, flags } = await this.parse(SpacesRoomMessages);
32
- const groupChatId = await this.resolveRoomChatId(args.id);
32
+ const spaceRef = await this.resolveEntityRef('space', args.id);
33
+ const groupChatId = await this.resolveRoomChatId(spaceRef);
33
34
  let response;
34
35
  try {
35
36
  response = await data_provider_1.dataService.getGroupChatMessages(groupChatId, {
@@ -42,7 +43,7 @@ class SpacesRoomMessages extends space_room_1.SpaceRoomCommand {
42
43
  this.handleApiError(err);
43
44
  }
44
45
  if (flags.json) {
45
- this.log(JSON.stringify((0, space_output_1.withSpaceResourceUrls)(this.cliConfig.baseURL, args.id, 'room', response, [
46
+ this.log(JSON.stringify((0, space_output_1.withSpaceResourceUrls)(this.cliConfig.baseURL, spaceRef, 'room', response, [
46
47
  'id',
47
48
  'messageId',
48
49
  '_id',
@@ -19,11 +19,12 @@ class SpacesRoomShow extends space_room_1.SpaceRoomCommand {
19
19
  async run() {
20
20
  this.requireAuth();
21
21
  const { args, flags } = await this.parse(SpacesRoomShow);
22
+ const spaceRef = await this.resolveEntityRef('space', args.id);
22
23
  // Read-only: never creates. A space whose Room tab has not been opened
23
24
  // 404s here, and the base class turns that into an `ensure` hint.
24
- const payload = await this.fetchRoom(args.id);
25
+ const payload = await this.fetchRoom(spaceRef);
25
26
  if (flags.json) {
26
- this.log(JSON.stringify((0, space_output_1.withSpacePerspectiveUrl)(this.cliConfig.baseURL, args.id, 'room', payload), null, 2));
27
+ this.log(JSON.stringify((0, space_output_1.withSpacePerspectiveUrl)(this.cliConfig.baseURL, spaceRef, 'room', payload), null, 2));
27
28
  return;
28
29
  }
29
30
  const chat = payload.groupChat;
@@ -50,8 +51,8 @@ class SpacesRoomShow extends space_room_1.SpaceRoomCommand {
50
51
  ], (line) => this.log(` ${line}`));
51
52
  }
52
53
  this.log('');
53
- this.log(`Read: ${this.config.bin} spaces room messages ${args.id}`);
54
- this.log(`Send: ${this.config.bin} spaces room send ${args.id} -m "..."`);
54
+ this.log(`Read: ${this.config.bin} spaces room messages ${spaceRef}`);
55
+ this.log(`Send: ${this.config.bin} spaces room send ${spaceRef} -m "..."`);
55
56
  }
56
57
  }
57
58
  exports.default = SpacesRoomShow;
@@ -20,18 +20,19 @@ class SpacesSkillsAdd extends base_command_1.BaseCommand {
20
20
  async run() {
21
21
  this.requireAuth();
22
22
  const { args, flags } = await this.parse(SpacesSkillsAdd);
23
+ const spaceRef = await this.resolveEntityRef('space', args.id);
23
24
  let result;
24
25
  try {
25
- result = await data_provider_1.dataService.addSpaceSkill({ spaceId: args.id, skillId: flags.skill });
26
+ result = await data_provider_1.dataService.addSpaceSkill({ spaceId: spaceRef, skillId: flags.skill });
26
27
  }
27
28
  catch (err) {
28
29
  this.handleApiError(err);
29
30
  }
30
31
  if (flags.json) {
31
- this.log(JSON.stringify({ result, url: (0, space_output_1.spacePerspectiveUrl)(this.cliConfig.baseURL, args.id, 'skills') }, null, 2));
32
+ this.log(JSON.stringify({ result, url: (0, space_output_1.spacePerspectiveUrl)(this.cliConfig.baseURL, spaceRef, 'skills') }, null, 2));
32
33
  return;
33
34
  }
34
- this.log(`Added skill ${flags.skill} to space ${args.id}`);
35
+ this.log(`Added skill ${flags.skill} to space ${spaceRef}`);
35
36
  }
36
37
  }
37
38
  exports.default = SpacesSkillsAdd;
@@ -20,9 +20,10 @@ class SpacesSkillsList extends base_command_1.BaseCommand {
20
20
  async run() {
21
21
  this.requireAuth();
22
22
  const { args, flags } = await this.parse(SpacesSkillsList);
23
+ const spaceRef = await this.resolveEntityRef('space', args.id);
23
24
  let response;
24
25
  try {
25
- response = await data_provider_1.dataService.listSpaceSkills(args.id);
26
+ response = await data_provider_1.dataService.listSpaceSkills(spaceRef);
26
27
  }
27
28
  catch (err) {
28
29
  this.handleApiError(err);
@@ -30,7 +31,7 @@ class SpacesSkillsList extends base_command_1.BaseCommand {
30
31
  if (flags.json) {
31
32
  this.log(JSON.stringify({
32
33
  ...response,
33
- url: (0, space_output_1.spacePerspectiveUrl)(this.cliConfig.baseURL, args.id, 'skills'),
34
+ url: (0, space_output_1.spacePerspectiveUrl)(this.cliConfig.baseURL, spaceRef, 'skills'),
34
35
  }, null, 2));
35
36
  return;
36
37
  }
@@ -26,11 +26,12 @@ class SpacesSkillsPin extends base_command_1.BaseCommand {
26
26
  async run() {
27
27
  this.requireAuth();
28
28
  const { args, flags } = await this.parse(SpacesSkillsPin);
29
+ const spaceRef = await this.resolveEntityRef('space', args.id);
29
30
  const pinned = flags.pinned === 'true';
30
31
  let result;
31
32
  try {
32
33
  result = await data_provider_1.dataService.toggleSpaceSkillPin({
33
- spaceId: args.id,
34
+ spaceId: spaceRef,
34
35
  skillId: flags.skill,
35
36
  pinned,
36
37
  });
@@ -39,10 +40,10 @@ class SpacesSkillsPin extends base_command_1.BaseCommand {
39
40
  this.handleApiError(err);
40
41
  }
41
42
  if (flags.json) {
42
- this.log(JSON.stringify({ result, url: (0, space_output_1.spacePerspectiveUrl)(this.cliConfig.baseURL, args.id, 'skills') }, null, 2));
43
+ this.log(JSON.stringify({ result, url: (0, space_output_1.spacePerspectiveUrl)(this.cliConfig.baseURL, spaceRef, 'skills') }, null, 2));
43
44
  return;
44
45
  }
45
- this.log(`Pin set to ${pinned} for skill ${flags.skill} in space ${args.id}`);
46
+ this.log(`Pin set to ${pinned} for skill ${flags.skill} in space ${spaceRef}`);
46
47
  }
47
48
  }
48
49
  exports.default = SpacesSkillsPin;
@@ -20,18 +20,19 @@ class SpacesSkillsRemove extends base_command_1.BaseCommand {
20
20
  async run() {
21
21
  this.requireAuth();
22
22
  const { args, flags } = await this.parse(SpacesSkillsRemove);
23
+ const spaceRef = await this.resolveEntityRef('space', args.id);
23
24
  let result;
24
25
  try {
25
- result = await data_provider_1.dataService.removeSpaceSkill({ spaceId: args.id, skillId: flags.skill });
26
+ result = await data_provider_1.dataService.removeSpaceSkill({ spaceId: spaceRef, skillId: flags.skill });
26
27
  }
27
28
  catch (err) {
28
29
  this.handleApiError(err);
29
30
  }
30
31
  if (flags.json) {
31
- this.log(JSON.stringify({ result, url: (0, space_output_1.spacePerspectiveUrl)(this.cliConfig.baseURL, args.id, 'skills') }, null, 2));
32
+ this.log(JSON.stringify({ result, url: (0, space_output_1.spacePerspectiveUrl)(this.cliConfig.baseURL, spaceRef, 'skills') }, null, 2));
32
33
  return;
33
34
  }
34
- this.log(`Removed skill ${flags.skill} from space ${args.id}`);
35
+ this.log(`Removed skill ${flags.skill} from space ${spaceRef}`);
35
36
  }
36
37
  }
37
38
  exports.default = SpacesSkillsRemove;
@@ -54,6 +54,7 @@ class SpacesSnapshot extends base_command_1.BaseCommand {
54
54
  async run() {
55
55
  this.requireAuth();
56
56
  const { args, flags } = await this.parse(SpacesSnapshot);
57
+ const spaceRef = await this.resolveEntityRef('space', args.id);
57
58
  let body = {};
58
59
  try {
59
60
  body = await (0, prompt_1.readJsonBody)(flags['from-json']);
@@ -78,13 +79,13 @@ class SpacesSnapshot extends base_command_1.BaseCommand {
78
79
  }
79
80
  let result;
80
81
  try {
81
- result = await data_provider_1.dataService.snapshotSpace(args.id, payload);
82
+ result = await data_provider_1.dataService.snapshotSpace(spaceRef, payload);
82
83
  }
83
84
  catch (err) {
84
85
  this.handleApiError(err);
85
86
  }
86
87
  if (flags.json) {
87
- this.log(JSON.stringify((0, space_output_1.withSpacePerspectiveUrl)(this.cliConfig.baseURL, args.id, 'settings', result), null, 2));
88
+ this.log(JSON.stringify((0, space_output_1.withSpacePerspectiveUrl)(this.cliConfig.baseURL, spaceRef, 'settings', result), null, 2));
88
89
  return;
89
90
  }
90
91
  const s = result;
@@ -14,16 +14,17 @@ class SpacesStatesArchive extends base_command_1.BaseCommand {
14
14
  async run() {
15
15
  this.requireAuth();
16
16
  const { args, flags } = await this.parse(SpacesStatesArchive);
17
+ const spaceRef = await this.resolveEntityRef('space', args.id);
17
18
  let state;
18
19
  try {
19
- state = await data_provider_1.dataService.archiveSpaceWorkflowState(args.id, args.state);
20
+ state = await data_provider_1.dataService.archiveSpaceWorkflowState(spaceRef, args.state);
20
21
  }
21
22
  catch (error) {
22
23
  this.handleApiError(error);
23
24
  return;
24
25
  }
25
26
  if (flags.json)
26
- this.log(JSON.stringify((0, web_url_1.withSpaceUrl)(this.cliConfig.baseURL, { ...state, id: args.id }), null, 2));
27
+ this.log(JSON.stringify((0, web_url_1.withSpaceUrl)(this.cliConfig.baseURL, { ...state, id: spaceRef }), null, 2));
27
28
  else
28
29
  this.log(`Archived workflow state ${state.name} (${state.id})`);
29
30
  }
@@ -24,9 +24,10 @@ class SpacesStatesCreate extends base_command_1.BaseCommand {
24
24
  async run() {
25
25
  this.requireAuth();
26
26
  const { args, flags } = await this.parse(SpacesStatesCreate);
27
+ const spaceRef = await this.resolveEntityRef('space', args.id);
27
28
  let state;
28
29
  try {
29
- state = await data_provider_1.dataService.createSpaceWorkflowState(args.id, {
30
+ state = await data_provider_1.dataService.createSpaceWorkflowState(spaceRef, {
30
31
  name: flags.name,
31
32
  color: flags.color,
32
33
  type: flags.type,
@@ -39,7 +40,7 @@ class SpacesStatesCreate extends base_command_1.BaseCommand {
39
40
  return;
40
41
  }
41
42
  if (flags.json)
42
- this.log(JSON.stringify((0, web_url_1.withSpaceUrl)(this.cliConfig.baseURL, { ...state, id: args.id }), null, 2));
43
+ this.log(JSON.stringify((0, web_url_1.withSpaceUrl)(this.cliConfig.baseURL, { ...state, id: spaceRef }), null, 2));
43
44
  else
44
45
  this.log(`Created workflow state ${state.name} (${state.id})`);
45
46
  }
@@ -14,16 +14,17 @@ class SpacesStatesList extends base_command_1.BaseCommand {
14
14
  async run() {
15
15
  this.requireAuth();
16
16
  const { args, flags } = await this.parse(SpacesStatesList);
17
+ const spaceRef = await this.resolveEntityRef('space', args.id);
17
18
  let result;
18
19
  try {
19
- result = await data_provider_1.dataService.listSpaceWorkflowStates(args.id);
20
+ result = await data_provider_1.dataService.listSpaceWorkflowStates(spaceRef);
20
21
  }
21
22
  catch (error) {
22
23
  this.handleApiError(error);
23
24
  return;
24
25
  }
25
26
  if (flags.json) {
26
- this.log(JSON.stringify((0, web_url_1.withSpaceUrl)(this.cliConfig.baseURL, { id: args.id, ...result }), null, 2));
27
+ this.log(JSON.stringify((0, web_url_1.withSpaceUrl)(this.cliConfig.baseURL, { id: spaceRef, ...result }), null, 2));
27
28
  return;
28
29
  }
29
30
  this.log(result.inherited ? `Inherited from Space ${result.sourceSpaceId}` : 'Local workflow states');
@@ -15,13 +15,14 @@ class SpacesStatesReorder extends base_command_1.BaseCommand {
15
15
  async run() {
16
16
  this.requireAuth();
17
17
  const { args, flags } = await this.parse(SpacesStatesReorder);
18
+ const spaceRef = await this.resolveEntityRef('space', args.id);
18
19
  const orderedIds = flags.ids
19
20
  .split(',')
20
21
  .map((id) => id.trim())
21
22
  .filter(Boolean);
22
23
  let result;
23
24
  try {
24
- result = await data_provider_1.dataService.reorderSpaceWorkflowStates(args.id, orderedIds);
25
+ result = await data_provider_1.dataService.reorderSpaceWorkflowStates(spaceRef, orderedIds);
25
26
  }
26
27
  catch (error) {
27
28
  this.handleApiError(error);
@@ -19,11 +19,12 @@ class SpacesStatesUpdate extends base_command_1.BaseCommand {
19
19
  async run() {
20
20
  this.requireAuth();
21
21
  const { args, flags } = await this.parse(SpacesStatesUpdate);
22
+ const spaceRef = await this.resolveEntityRef('space', args.id);
22
23
  if (flags.name === undefined && flags.color === undefined && flags.order === undefined)
23
24
  this.error('Pass --name, --color, or --order.', { exit: 2 });
24
25
  let state;
25
26
  try {
26
- state = await data_provider_1.dataService.updateSpaceWorkflowState(args.id, args.state, {
27
+ state = await data_provider_1.dataService.updateSpaceWorkflowState(spaceRef, args.state, {
27
28
  name: flags.name,
28
29
  color: flags.color,
29
30
  order: flags.order,
@@ -34,7 +35,7 @@ class SpacesStatesUpdate extends base_command_1.BaseCommand {
34
35
  return;
35
36
  }
36
37
  if (flags.json)
37
- this.log(JSON.stringify((0, web_url_1.withSpaceUrl)(this.cliConfig.baseURL, { ...state, id: args.id }), null, 2));
38
+ this.log(JSON.stringify((0, web_url_1.withSpaceUrl)(this.cliConfig.baseURL, { ...state, id: spaceRef }), null, 2));
38
39
  else
39
40
  this.log(`Updated workflow state ${state.name} (${state.id})`);
40
41
  }
@@ -26,15 +26,16 @@ class SpacesSummary extends base_command_1.BaseCommand {
26
26
  async run() {
27
27
  this.requireAuth();
28
28
  const { args, flags } = await this.parse(SpacesSummary);
29
+ const spaceRef = await this.resolveEntityRef('space', args.id);
29
30
  let result;
30
31
  try {
31
- result = await data_provider_1.dataService.getSpaceSummary(args.id);
32
+ result = await data_provider_1.dataService.getSpaceSummary(spaceRef);
32
33
  }
33
34
  catch (err) {
34
35
  this.handleApiError(err);
35
36
  }
36
37
  const output = result && typeof result === 'object'
37
- ? (0, space_output_1.withSpacePerspectiveUrl)(this.cliConfig.baseURL, args.id, 'dashboard', result)
38
+ ? (0, space_output_1.withSpacePerspectiveUrl)(this.cliConfig.baseURL, spaceRef, 'dashboard', result)
38
39
  : result;
39
40
  // This printed the raw payload regardless of `--json`, which differed only
40
41
  // by its own `generatedAt` timestamp — so the flag advertised a mode the
@@ -47,7 +48,7 @@ class SpacesSummary extends base_command_1.BaseCommand {
47
48
  const o = (output ?? {});
48
49
  const tasks = o.tasks;
49
50
  const byPriority = tasks?.openByPriority;
50
- this.log(`Space: ${o.spaceId ?? args.id}`);
51
+ this.log(`Space: ${o.spaceId ?? spaceRef}`);
51
52
  if (o.url)
52
53
  this.log(`Web: ${o.url}`);
53
54
  this.log('');
@@ -6,6 +6,9 @@ export default class SpacesTasks extends BaseCommand {
6
6
  id: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
7
7
  };
8
8
  static flags: {
9
+ fields: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
10
+ compact: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
11
+ ndjson: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
9
12
  json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
10
13
  limit: import("@oclif/core/lib/interfaces").OptionFlag<number, import("@oclif/core/lib/interfaces").CustomOptions>;
11
14
  cursor: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
@@ -5,12 +5,14 @@ const data_provider_1 = require("@skrr-ai/data-provider");
5
5
  const base_command_1 = require("../../base-command");
6
6
  const web_url_1 = require("../../lib/web-url");
7
7
  const format_1 = require("../../lib/format");
8
+ const list_output_1 = require("../../lib/list-output");
8
9
  class SpacesTasks extends base_command_1.BaseCommand {
9
10
  static description = 'List tasks in a space';
10
11
  static examples = [
11
12
  '<%= config.bin %> spaces tasks <space-id>',
12
13
  '<%= config.bin %> spaces tasks <space-id> --limit 100',
13
14
  '<%= config.bin %> spaces tasks <space-id> --json',
15
+ '<%= config.bin %> spaces tasks <space-id> --compact --json',
14
16
  ];
15
17
  static args = {
16
18
  id: core_1.Args.string({ description: 'Space ID', required: true, ignoreStdin: true }),
@@ -19,22 +21,31 @@ class SpacesTasks extends base_command_1.BaseCommand {
19
21
  json: core_1.Flags.boolean({ description: 'Output as JSON' }),
20
22
  limit: core_1.Flags.integer({ description: 'Max results', default: 50 }),
21
23
  cursor: core_1.Flags.string({ description: 'Pagination cursor from a previous page' }),
24
+ ...list_output_1.listOutputFlags,
22
25
  };
23
26
  async run() {
24
27
  this.requireAuth();
25
28
  const { args, flags } = await this.parse(SpacesTasks);
29
+ const spaceRef = await this.resolveEntityRef('space', args.id);
26
30
  let response;
27
31
  try {
28
- response = await data_provider_1.dataService.listSpaceTasks(args.id, {
32
+ response = await data_provider_1.dataService.listSpaceTasks(spaceRef, {
29
33
  limit: flags.limit,
30
34
  cursor: flags.cursor,
35
+ // The server's own card projection: the bytes are never sent.
36
+ ...(flags.compact && !flags.fields ? { view: 'summary' } : {}),
31
37
  });
32
38
  }
33
39
  catch (err) {
34
40
  this.handleApiError(err);
35
41
  }
36
- if (flags.json) {
37
- this.log(JSON.stringify((0, web_url_1.withDataUrls)(this.cliConfig.baseURL, response, web_url_1.taskUrlFrom), null, 2));
42
+ if (flags.json || flags.ndjson) {
43
+ this.printList((0, list_output_1.shapeListResponse)((0, web_url_1.withDataUrls)(this.cliConfig.baseURL, response, web_url_1.taskUrlFrom), {
44
+ resource: 'task',
45
+ fields: flags.fields,
46
+ compact: flags.compact,
47
+ requestedLimit: flags.limit,
48
+ }), Boolean(flags.ndjson));
38
49
  return;
39
50
  }
40
51
  const r = response;
@@ -21,9 +21,10 @@ class SpacesTriggersDelete extends base_command_1.BaseCommand {
21
21
  async run() {
22
22
  this.requireAuth();
23
23
  const { args, flags } = await this.parse(SpacesTriggersDelete);
24
+ const spaceRef = await this.resolveEntityRef('space', args.id);
24
25
  let confirmed;
25
26
  try {
26
- confirmed = await (0, prompt_1.confirmDestructive)(`Delete your assistant trigger config for space ${args.id}?`, flags.yes);
27
+ confirmed = await (0, prompt_1.confirmDestructive)(`Delete your assistant trigger config for space ${spaceRef}?`, flags.yes);
27
28
  }
28
29
  catch (err) {
29
30
  if (err.exit === 7) {
@@ -37,16 +38,16 @@ class SpacesTriggersDelete extends base_command_1.BaseCommand {
37
38
  }
38
39
  let result;
39
40
  try {
40
- result = await triggers_1.triggerApi.deleteSpaceAssistant(args.id);
41
+ result = await triggers_1.triggerApi.deleteSpaceAssistant(spaceRef);
41
42
  }
42
43
  catch (err) {
43
44
  this.handleApiError(err);
44
45
  }
45
46
  if (flags.json) {
46
- this.log(JSON.stringify((0, space_output_1.withSpacePerspectiveUrl)(this.cliConfig.baseURL, args.id, 'schedule', { result }), null, 2));
47
+ this.log(JSON.stringify((0, space_output_1.withSpacePerspectiveUrl)(this.cliConfig.baseURL, spaceRef, 'schedule', { result }), null, 2));
47
48
  return;
48
49
  }
49
- this.log(`Deleted space trigger config for ${args.id}`);
50
+ this.log(`Deleted space trigger config for ${spaceRef}`);
50
51
  }
51
52
  }
52
53
  exports.default = SpacesTriggersDelete;
@@ -78,6 +78,7 @@ class SpacesTriggersSet extends base_command_1.BaseCommand {
78
78
  async run() {
79
79
  this.requireAuth();
80
80
  const { args, flags } = await this.parse(SpacesTriggersSet);
81
+ const spaceRef = await this.resolveEntityRef('space', args.id);
81
82
  let payload;
82
83
  try {
83
84
  payload = await (0, prompt_1.readJsonBody)(flags['from-json']);
@@ -127,17 +128,17 @@ class SpacesTriggersSet extends base_command_1.BaseCommand {
127
128
  }
128
129
  let response;
129
130
  try {
130
- response = await triggers_1.triggerApi.setSpaceAssistant(args.id, payload);
131
+ response = await triggers_1.triggerApi.setSpaceAssistant(spaceRef, payload);
131
132
  }
132
133
  catch (err) {
133
134
  this.handleApiError(err);
134
135
  }
135
136
  if (flags.json) {
136
- this.log(JSON.stringify((0, space_output_1.withSpacePerspectiveUrl)(this.cliConfig.baseURL, args.id, 'schedule', response), null, 2));
137
+ this.log(JSON.stringify((0, space_output_1.withSpacePerspectiveUrl)(this.cliConfig.baseURL, spaceRef, 'schedule', response), null, 2));
137
138
  return;
138
139
  }
139
140
  const assistant = response.assistant ?? {};
140
- this.log(`Updated space triggers for ${args.id}`);
141
+ this.log(`Updated space triggers for ${spaceRef}`);
141
142
  this.log(`Agent: ${String(assistant.agentId ?? '-')}`);
142
143
  this.log(`Enabled: ${assistant.enabled === false ? 'no' : 'yes'}`);
143
144
  }
@@ -19,20 +19,21 @@ class SpacesTriggersShow extends base_command_1.BaseCommand {
19
19
  async run() {
20
20
  this.requireAuth();
21
21
  const { args, flags } = await this.parse(SpacesTriggersShow);
22
+ const spaceRef = await this.resolveEntityRef('space', args.id);
22
23
  let response;
23
24
  try {
24
- response = await triggers_1.triggerApi.getSpaceAssistant(args.id);
25
+ response = await triggers_1.triggerApi.getSpaceAssistant(spaceRef);
25
26
  }
26
27
  catch (err) {
27
28
  this.handleApiError(err);
28
29
  }
29
30
  if (flags.json) {
30
- this.log(JSON.stringify((0, space_output_1.withSpacePerspectiveUrl)(this.cliConfig.baseURL, args.id, 'schedule', response), null, 2));
31
+ this.log(JSON.stringify((0, space_output_1.withSpacePerspectiveUrl)(this.cliConfig.baseURL, spaceRef, 'schedule', response), null, 2));
31
32
  return;
32
33
  }
33
34
  const assistant = response.assistant ?? {};
34
35
  const triggers = (assistant.triggers ?? {});
35
- this.log(`Space: ${args.id}`);
36
+ this.log(`Space: ${spaceRef}`);
36
37
  this.log(`Agent: ${String(assistant.agentId ?? '-')}`);
37
38
  this.log(`Enabled: ${assistant.enabled === false ? 'no' : 'yes'}`);
38
39
  this.log(`On event: ${formatLane(triggers.onEvent)}`);
@@ -16,9 +16,10 @@ class SpacesUnarchive extends base_command_1.BaseCommand {
16
16
  async run() {
17
17
  this.requireAuth();
18
18
  const { args, flags } = await this.parse(SpacesUnarchive);
19
+ const spaceId = await this.resolveEntityRef('space', args.id);
19
20
  let updated;
20
21
  try {
21
- updated = await data_provider_1.dataService.unarchiveSpace(args.id);
22
+ updated = await data_provider_1.dataService.unarchiveSpace(spaceId);
22
23
  }
23
24
  catch (err) {
24
25
  this.handleApiError(err);
@@ -28,7 +29,7 @@ class SpacesUnarchive extends base_command_1.BaseCommand {
28
29
  return;
29
30
  }
30
31
  const s = updated;
31
- this.log(`Unarchived space ${s.id ?? s._id ?? args.id} - ${s.title ?? '(no title)'}`);
32
+ this.log(`Unarchived space ${s.id ?? s._id ?? spaceId} - ${s.title ?? '(no title)'}`);
32
33
  }
33
34
  }
34
35
  exports.default = SpacesUnarchive;
@@ -145,6 +145,7 @@ class SpacesUpdate extends base_command_1.BaseCommand {
145
145
  async run() {
146
146
  this.requireAuth();
147
147
  const { args, flags } = await this.parse(SpacesUpdate);
148
+ const spaceId = await this.resolveEntityRef('space', args.id);
148
149
  let body = {};
149
150
  try {
150
151
  body = await (0, prompt_1.readJsonBody)(flags['from-json']);
@@ -210,7 +211,7 @@ class SpacesUpdate extends base_command_1.BaseCommand {
210
211
  }
211
212
  else {
212
213
  try {
213
- const current = await data_provider_1.dataService.getSpace(args.id);
214
+ const current = await data_provider_1.dataService.getSpace(spaceId);
214
215
  const cur = current?.deliveryPolicy;
215
216
  if (cur && typeof cur === 'object') {
216
217
  basePolicy = { ...cur };
@@ -243,14 +244,14 @@ class SpacesUpdate extends base_command_1.BaseCommand {
243
244
  try {
244
245
  if (Object.keys(payload).length > 0) {
245
246
  updated = await data_provider_1.dataService.updateSpace({
246
- spaceId: args.id,
247
+ spaceId,
247
248
  data: payload,
248
249
  });
249
250
  }
250
251
  for (const goalId of goalIdsToLink) {
251
252
  // Idempotent $addToSet; the response is the freshly-linked space, so it
252
253
  // also serves as `updated` when only --goal was supplied.
253
- updated = await data_provider_1.dataService.linkGoalToSpace({ spaceId: args.id, goalId });
254
+ updated = await data_provider_1.dataService.linkGoalToSpace({ spaceId, goalId });
254
255
  }
255
256
  }
256
257
  catch (err) {
@@ -261,7 +262,7 @@ class SpacesUpdate extends base_command_1.BaseCommand {
261
262
  return;
262
263
  }
263
264
  const s = updated;
264
- this.log(`Updated space ${s.id ?? s._id ?? args.id} - ${s.title ?? '(no title)'}`);
265
+ this.log(`Updated space ${s.id ?? s._id ?? spaceId} - ${s.title ?? '(no title)'}`);
265
266
  }
266
267
  }
267
268
  exports.default = SpacesUpdate;
@@ -23,6 +23,7 @@ class SpacesViewsCreate extends base_command_1.BaseCommand {
23
23
  async run() {
24
24
  this.requireAuth();
25
25
  const { args, flags } = await this.parse(SpacesViewsCreate);
26
+ const spaceRef = await this.resolveEntityRef('space', args.id);
26
27
  let body = {};
27
28
  try {
28
29
  body = await (0, prompt_1.readJsonBody)(flags['from-json']);
@@ -48,13 +49,13 @@ class SpacesViewsCreate extends base_command_1.BaseCommand {
48
49
  this.error('Pass --name and --type, or provide them in JSON.', { exit: 1 });
49
50
  let result;
50
51
  try {
51
- result = await data_provider_1.dataService.createSpaceView(args.id, payload);
52
+ result = await data_provider_1.dataService.createSpaceView(spaceRef, payload);
52
53
  }
53
54
  catch (err) {
54
55
  this.handleApiError(err);
55
56
  }
56
57
  if (flags.json)
57
- this.log(JSON.stringify((0, space_output_1.withSpaceResourceUrls)(this.cliConfig.baseURL, args.id, 'tasks', result, ['id'], (id) => `${(0, space_output_1.spacePerspectiveUrl)(this.cliConfig.baseURL, args.id, 'tasks')}?view=${encodeURIComponent(id)}`), null, 2));
58
+ this.log(JSON.stringify((0, space_output_1.withSpaceResourceUrls)(this.cliConfig.baseURL, spaceRef, 'tasks', result, ['id'], (id) => `${(0, space_output_1.spacePerspectiveUrl)(this.cliConfig.baseURL, spaceRef, 'tasks')}?view=${encodeURIComponent(id)}`), null, 2));
58
59
  else
59
60
  this.log(`Created view ${result?.id ?? '?'}.`);
60
61
  }
@@ -14,15 +14,16 @@ class SpacesViewsList extends base_command_1.BaseCommand {
14
14
  async run() {
15
15
  this.requireAuth();
16
16
  const { args, flags } = await this.parse(SpacesViewsList);
17
+ const spaceRef = await this.resolveEntityRef('space', args.id);
17
18
  let response;
18
19
  try {
19
- response = await data_provider_1.dataService.listSpaceViews(args.id);
20
+ response = await data_provider_1.dataService.listSpaceViews(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, 'tasks', response, ['id'], (id) => `${(0, space_output_1.spacePerspectiveUrl)(this.cliConfig.baseURL, args.id, 'tasks')}?view=${encodeURIComponent(id)}`), null, 2));
26
+ return void this.log(JSON.stringify((0, space_output_1.withSpaceResourceUrls)(this.cliConfig.baseURL, spaceRef, 'tasks', response, ['id'], (id) => `${(0, space_output_1.spacePerspectiveUrl)(this.cliConfig.baseURL, spaceRef, 'tasks')}?view=${encodeURIComponent(id)}`), null, 2));
26
27
  if (!response.data.length)
27
28
  return void this.log('No saved views.');
28
29
  (0, format_1.renderTable)(response.data.map((v) => ({