@skrr-ai/cli 0.1.92 → 0.1.94

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (323) hide show
  1. package/dist/base-command.d.ts +44 -0
  2. package/dist/base-command.js +96 -0
  3. package/dist/commands/agents/badge.d.ts +41 -0
  4. package/dist/commands/agents/badge.js +158 -0
  5. package/dist/commands/agents/create.d.ts +24 -0
  6. package/dist/commands/agents/create.js +212 -0
  7. package/dist/commands/agents/embed.d.ts +20 -0
  8. package/dist/commands/agents/embed.js +61 -0
  9. package/dist/commands/agents/operating-plan.d.ts +11 -0
  10. package/dist/commands/agents/operating-plan.js +54 -0
  11. package/dist/commands/agents/roles/example.d.ts +11 -0
  12. package/dist/commands/agents/roles/example.js +30 -0
  13. package/dist/commands/{commitments/mode.d.ts → agents/roles/export.d.ts} +5 -5
  14. package/dist/commands/agents/roles/export.js +81 -0
  15. package/dist/commands/agents/roles/install.d.ts +12 -0
  16. package/dist/commands/agents/roles/install.js +48 -0
  17. package/dist/commands/agents/roles/list.d.ts +11 -0
  18. package/dist/commands/agents/roles/list.js +36 -0
  19. package/dist/commands/agents/roles/preview.d.ts +14 -0
  20. package/dist/commands/agents/roles/preview.js +49 -0
  21. package/dist/commands/agents/roles/withdraw.d.ts +13 -0
  22. package/dist/commands/agents/roles/withdraw.js +43 -0
  23. package/dist/commands/agents/share.d.ts +27 -0
  24. package/dist/commands/agents/share.js +100 -0
  25. package/dist/commands/agents/vanity.d.ts +21 -0
  26. package/dist/commands/agents/vanity.js +77 -0
  27. package/dist/commands/agents/visibility.d.ts +21 -1
  28. package/dist/commands/agents/visibility.js +112 -0
  29. package/dist/commands/commands.d.ts +1 -0
  30. package/dist/commands/commands.js +22 -9
  31. package/dist/commands/commitments/{autonomy-requests → cadence-requests}/decide.d.ts +5 -7
  32. package/dist/commands/commitments/{autonomy-requests → cadence-requests}/decide.js +13 -15
  33. package/dist/commands/commitments/cost.d.ts +1 -1
  34. package/dist/commands/commitments/cost.js +1 -1
  35. package/dist/commands/commitments/create.d.ts +0 -7
  36. package/dist/commands/commitments/create.js +9 -98
  37. package/dist/commands/commitments/delivery.js +3 -21
  38. package/dist/commands/commitments/doctor.js +28 -27
  39. package/dist/commands/commitments/effective-policy.js +5 -36
  40. package/dist/commands/commitments/evaluations.d.ts +15 -0
  41. package/dist/commands/commitments/evaluations.js +54 -0
  42. package/dist/commands/commitments/pack/activate.d.ts +11 -0
  43. package/dist/commands/commitments/pack/activate.js +22 -0
  44. package/dist/commands/commitments/pack/bind.js +1 -1
  45. package/dist/commands/commitments/remediate.js +2 -5
  46. package/dist/commands/commitments/show.js +1 -1
  47. package/dist/commands/commitments/update.js +9 -9
  48. package/dist/commands/commitments/wake-capabilities.d.ts +1 -3
  49. package/dist/commands/commitments/wake-capabilities.js +5 -21
  50. package/dist/commands/earnings/attributions.d.ts +17 -0
  51. package/dist/commands/earnings/attributions.js +82 -0
  52. package/dist/commands/earnings/index.js +2 -1
  53. package/dist/commands/generate-recovery-code.js +4 -3
  54. package/dist/commands/github/allow-tools.d.ts +1 -0
  55. package/dist/commands/github/app/install.d.ts +1 -0
  56. package/dist/commands/github/app/status.d.ts +1 -0
  57. package/dist/commands/github/connect.d.ts +1 -0
  58. package/dist/commands/github/connections.d.ts +1 -0
  59. package/dist/commands/github/disconnect.d.ts +1 -0
  60. package/dist/commands/github/finalize.d.ts +1 -0
  61. package/dist/commands/github/reconnect.d.ts +1 -0
  62. package/dist/commands/github/run.d.ts +1 -0
  63. package/dist/commands/github/tools.d.ts +1 -0
  64. package/dist/commands/integrations/connections/connect.d.ts +1 -0
  65. package/dist/commands/integrations/connections/disconnect.d.ts +1 -0
  66. package/dist/commands/integrations/connections/finalize.d.ts +1 -0
  67. package/dist/commands/integrations/connections/list.d.ts +1 -0
  68. package/dist/commands/integrations/connections/reconnect.d.ts +1 -0
  69. package/dist/commands/integrations/execute.d.ts +1 -0
  70. package/dist/commands/integrations/search.d.ts +1 -0
  71. package/dist/commands/integrations/toolkits.d.ts +1 -0
  72. package/dist/commands/integrations/tools/allow.d.ts +1 -0
  73. package/dist/commands/integrations/tools/list.d.ts +1 -0
  74. package/dist/commands/login.js +12 -0
  75. package/dist/commands/machines/dedicated/logs.d.ts +19 -0
  76. package/dist/commands/machines/dedicated/logs.js +103 -0
  77. package/dist/commands/machines/dedicated/power/set.js +1 -1
  78. package/dist/commands/open.d.ts +24 -0
  79. package/dist/commands/open.js +74 -0
  80. package/dist/commands/projects/archive.d.ts +1 -0
  81. package/dist/commands/projects/archive.js +23 -0
  82. package/dist/commands/projects/delete.d.ts +1 -0
  83. package/dist/commands/projects/delete.js +23 -0
  84. package/dist/commands/projects/list.d.ts +3 -0
  85. package/dist/commands/projects/list.js +12 -2
  86. package/dist/commands/spaces/actions/add.js +4 -3
  87. package/dist/commands/spaces/actions/available.js +3 -2
  88. package/dist/commands/spaces/actions/list.js +5 -4
  89. package/dist/commands/spaces/actions/replace.js +6 -5
  90. package/dist/commands/spaces/archive.js +3 -2
  91. package/dist/commands/spaces/auto-executor/preview.js +4 -3
  92. package/dist/commands/spaces/auto-executor/run.js +4 -3
  93. package/dist/commands/spaces/auto-executor/runs.js +3 -2
  94. package/dist/commands/spaces/auto-executor/update.js +4 -3
  95. package/dist/commands/spaces/bootstrap.js +3 -2
  96. package/dist/commands/spaces/briefs/delete.js +3 -2
  97. package/dist/commands/spaces/briefs/get.js +3 -2
  98. package/dist/commands/spaces/briefs/list.js +3 -2
  99. package/dist/commands/spaces/briefs/set.js +5 -4
  100. package/dist/commands/spaces/capacity.js +5 -4
  101. package/dist/commands/spaces/conversations.js +3 -2
  102. package/dist/commands/spaces/cycles/create.js +3 -2
  103. package/dist/commands/spaces/cycles/graph.js +2 -1
  104. package/dist/commands/spaces/cycles/list.js +3 -2
  105. package/dist/commands/spaces/cycles/settings.js +4 -3
  106. package/dist/commands/spaces/cycles/show.js +3 -2
  107. package/dist/commands/spaces/cycles/update.js +3 -2
  108. package/dist/commands/spaces/delete.js +4 -3
  109. package/dist/commands/spaces/expertise-suggestions.js +4 -3
  110. package/dist/commands/spaces/files/delete.js +3 -2
  111. package/dist/commands/spaces/files/folders/create.js +3 -2
  112. package/dist/commands/spaces/files/folders/delete.js +3 -2
  113. package/dist/commands/spaces/files/folders/list.js +3 -2
  114. package/dist/commands/spaces/files/folders/update.js +3 -2
  115. package/dist/commands/spaces/files/list.js +3 -2
  116. package/dist/commands/spaces/files/move.js +3 -2
  117. package/dist/commands/spaces/files/rename.js +3 -2
  118. package/dist/commands/spaces/files/upload.js +6 -5
  119. package/dist/commands/spaces/github-automations/set.js +3 -2
  120. package/dist/commands/spaces/github-automations/show.js +3 -2
  121. package/dist/commands/spaces/goals.js +2 -1
  122. package/dist/commands/spaces/heartbeats/create.js +4 -3
  123. package/dist/commands/spaces/heartbeats/delete.js +4 -3
  124. package/dist/commands/spaces/heartbeats/list.js +4 -3
  125. package/dist/commands/spaces/heartbeats/status.js +3 -2
  126. package/dist/commands/spaces/heartbeats/update.js +4 -3
  127. package/dist/commands/spaces/insights.js +5 -4
  128. package/dist/commands/spaces/labels/add.js +4 -3
  129. package/dist/commands/spaces/labels/list.js +2 -1
  130. package/dist/commands/spaces/labels/remove.js +4 -3
  131. package/dist/commands/spaces/list.d.ts +3 -0
  132. package/dist/commands/spaces/list.js +11 -2
  133. package/dist/commands/spaces/live/cards/create.js +3 -2
  134. package/dist/commands/spaces/live/cards/list.js +3 -2
  135. package/dist/commands/spaces/live/cards/reorder.js +7 -2
  136. package/dist/commands/spaces/live/scene.js +4 -3
  137. package/dist/commands/spaces/members/add.js +7 -6
  138. package/dist/commands/spaces/members/list.js +4 -3
  139. package/dist/commands/spaces/members/remove.js +7 -6
  140. package/dist/commands/spaces/move.js +3 -2
  141. package/dist/commands/spaces/pin.js +5 -4
  142. package/dist/commands/spaces/preferences/show.js +4 -3
  143. package/dist/commands/spaces/preferences/tabs.js +4 -3
  144. package/dist/commands/spaces/revisions.js +3 -2
  145. package/dist/commands/spaces/room/ensure.js +5 -4
  146. package/dist/commands/spaces/room/messages.js +3 -2
  147. package/dist/commands/spaces/room/show.js +5 -4
  148. package/dist/commands/spaces/skills/add.js +4 -3
  149. package/dist/commands/spaces/skills/list.js +3 -2
  150. package/dist/commands/spaces/skills/pin.js +4 -3
  151. package/dist/commands/spaces/skills/remove.js +4 -3
  152. package/dist/commands/spaces/snapshot.js +3 -2
  153. package/dist/commands/spaces/states/archive.js +3 -2
  154. package/dist/commands/spaces/states/create.js +3 -2
  155. package/dist/commands/spaces/states/list.js +3 -2
  156. package/dist/commands/spaces/states/reorder.js +2 -1
  157. package/dist/commands/spaces/states/update.js +3 -2
  158. package/dist/commands/spaces/summary.js +4 -3
  159. package/dist/commands/spaces/tasks.d.ts +3 -0
  160. package/dist/commands/spaces/tasks.js +14 -3
  161. package/dist/commands/spaces/triggers/delete.js +5 -4
  162. package/dist/commands/spaces/triggers/set.js +4 -3
  163. package/dist/commands/spaces/triggers/show.js +4 -3
  164. package/dist/commands/spaces/unarchive.js +3 -2
  165. package/dist/commands/spaces/update.js +5 -4
  166. package/dist/commands/spaces/views/create.js +3 -2
  167. package/dist/commands/spaces/views/list.js +3 -2
  168. package/dist/commands/spaces/views/reorder.js +6 -3
  169. package/dist/commands/spaces/views/subscribe.js +2 -1
  170. package/dist/commands/spaces/views/subscriptions.js +1 -0
  171. package/dist/commands/spaces/views/unsubscribe.js +2 -1
  172. package/dist/commands/spaces/widgets/add.js +4 -3
  173. package/dist/commands/spaces/widgets/list.js +3 -2
  174. package/dist/commands/spaces/widgets/remove.js +5 -4
  175. package/dist/commands/spaces/work-graph.js +2 -1
  176. package/dist/commands/store/install.d.ts +1 -1
  177. package/dist/commands/store/install.js +24 -8
  178. package/dist/commands/store/show.d.ts +25 -0
  179. package/dist/commands/store/show.js +203 -0
  180. package/dist/commands/store/stats.d.ts +33 -0
  181. package/dist/commands/store/stats.js +258 -0
  182. package/dist/commands/tasks/actions/attach.js +1 -1
  183. package/dist/commands/tasks/actions/detach.js +4 -3
  184. package/dist/commands/tasks/activity.js +3 -2
  185. package/dist/commands/tasks/ancestors.js +2 -1
  186. package/dist/commands/tasks/approvals/create.js +2 -1
  187. package/dist/commands/tasks/approvals/delete.js +3 -2
  188. package/dist/commands/tasks/approvals/list.js +5 -4
  189. package/dist/commands/tasks/approvals/resolve.js +2 -1
  190. package/dist/commands/tasks/archive.js +3 -2
  191. package/dist/commands/tasks/assign.js +4 -3
  192. package/dist/commands/tasks/attachments/delete.js +3 -2
  193. package/dist/commands/tasks/attachments/download.d.ts +1 -0
  194. package/dist/commands/tasks/attachments/download.js +20 -1
  195. package/dist/commands/tasks/attachments/list.js +2 -1
  196. package/dist/commands/tasks/attachments/set-role.js +2 -1
  197. package/dist/commands/tasks/attachments/upload.js +2 -1
  198. package/dist/commands/tasks/bulk-update.d.ts +1 -0
  199. package/dist/commands/tasks/bulk-update.js +106 -15
  200. package/dist/commands/tasks/cancel-cascade.d.ts +1 -0
  201. package/dist/commands/tasks/cancel-cascade.js +13 -3
  202. package/dist/commands/tasks/cascade-status.js +2 -1
  203. package/dist/commands/tasks/checkout.js +3 -2
  204. package/dist/commands/tasks/children.js +2 -1
  205. package/dist/commands/tasks/comments/add.js +7 -6
  206. package/dist/commands/tasks/comments/anchor.js +8 -7
  207. package/dist/commands/tasks/comments/delete.js +3 -2
  208. package/dist/commands/tasks/comments/list.js +2 -1
  209. package/dist/commands/tasks/comments/reopen.js +3 -2
  210. package/dist/commands/tasks/comments/resolve.js +3 -2
  211. package/dist/commands/tasks/create-tree.d.ts +63 -0
  212. package/dist/commands/tasks/create-tree.js +197 -4
  213. package/dist/commands/tasks/delete.js +5 -4
  214. package/dist/commands/tasks/descendants.js +2 -1
  215. package/dist/commands/tasks/dri-plan.js +3 -2
  216. package/dist/commands/tasks/dri-run.js +3 -2
  217. package/dist/commands/tasks/dri-status.js +2 -1
  218. package/dist/commands/tasks/duplicate-pipeline.js +2 -1
  219. package/dist/commands/tasks/execution-summary.js +2 -1
  220. package/dist/commands/tasks/execution-timeline.js +2 -1
  221. package/dist/commands/tasks/fork.js +1 -0
  222. package/dist/commands/tasks/forward.js +4 -3
  223. package/dist/commands/tasks/handover.js +1 -0
  224. package/dist/commands/tasks/interrupt.js +3 -2
  225. package/dist/commands/tasks/labels/attach.js +4 -3
  226. package/dist/commands/tasks/labels/detach.js +4 -3
  227. package/dist/commands/tasks/labels/suggest.js +5 -4
  228. package/dist/commands/tasks/list.d.ts +27 -1
  229. package/dist/commands/tasks/list.js +101 -3
  230. package/dist/commands/tasks/move.js +4 -3
  231. package/dist/commands/tasks/output.js +6 -5
  232. package/dist/commands/tasks/pause-schedule.js +3 -2
  233. package/dist/commands/tasks/promote.js +1 -0
  234. package/dist/commands/tasks/prompt-log.js +2 -1
  235. package/dist/commands/tasks/release.js +5 -4
  236. package/dist/commands/tasks/remind.js +2 -1
  237. package/dist/commands/tasks/replay.js +3 -2
  238. package/dist/commands/tasks/report.js +1 -0
  239. package/dist/commands/tasks/resume-schedule.js +3 -2
  240. package/dist/commands/tasks/retry-schedule.js +3 -2
  241. package/dist/commands/tasks/retry.js +10 -9
  242. package/dist/commands/tasks/revisions.js +2 -1
  243. package/dist/commands/tasks/runs.js +6 -5
  244. package/dist/commands/tasks/schedule.js +3 -2
  245. package/dist/commands/tasks/self-schedule.js +6 -5
  246. package/dist/commands/tasks/skills/pin.js +3 -2
  247. package/dist/commands/tasks/skills/unpin.js +3 -2
  248. package/dist/commands/tasks/snooze.js +6 -5
  249. package/dist/commands/tasks/start-all.js +5 -4
  250. package/dist/commands/tasks/subscribe.js +1 -0
  251. package/dist/commands/tasks/tags/add.js +4 -3
  252. package/dist/commands/tasks/tags/remove.js +4 -3
  253. package/dist/commands/tasks/timeline.js +3 -2
  254. package/dist/commands/tasks/today.d.ts +4 -1
  255. package/dist/commands/tasks/today.js +12 -2
  256. package/dist/commands/tasks/transcript.js +6 -5
  257. package/dist/commands/tasks/unschedule.js +3 -2
  258. package/dist/commands/tasks/unsnooze.js +3 -2
  259. package/dist/commands/tasks/unsubscribe.js +2 -1
  260. package/dist/commands/tasks/update.js +5 -4
  261. package/dist/commands/tasks/wait.js +5 -4
  262. package/dist/lib/agent-distribution.d.ts +37 -0
  263. package/dist/lib/agent-distribution.js +63 -0
  264. package/dist/lib/agent-ref.d.ts +69 -0
  265. package/dist/lib/agent-ref.js +168 -0
  266. package/dist/lib/api-fetch.d.ts +2 -0
  267. package/dist/lib/api-fetch.js +14 -3
  268. package/dist/lib/command-hygiene.d.ts +13 -0
  269. package/dist/lib/command-hygiene.js +62 -2
  270. package/dist/lib/commitment-product.d.ts +0 -6
  271. package/dist/lib/commitment-product.js +1 -30
  272. package/dist/lib/commitments.d.ts +9 -45
  273. package/dist/lib/commitments.js +24 -95
  274. package/dist/lib/dedicated-power.d.ts +5 -0
  275. package/dist/lib/dedicated-power.js +30 -2
  276. package/dist/lib/dry-run-plans.d.ts +50 -0
  277. package/dist/lib/dry-run-plans.js +85 -0
  278. package/dist/lib/json-output.d.ts +31 -0
  279. package/dist/lib/json-output.js +78 -0
  280. package/dist/lib/list-output.d.ts +75 -0
  281. package/dist/lib/list-output.js +266 -0
  282. package/dist/lib/machine-daemon-log.d.ts +36 -0
  283. package/dist/lib/machine-daemon-log.js +78 -0
  284. package/dist/lib/node-adapter.js +10 -1
  285. package/dist/lib/northstars.js +1 -1
  286. package/dist/lib/open-target.d.ts +12 -0
  287. package/dist/lib/open-target.js +108 -0
  288. package/dist/lib/rate-limit-retry.d.ts +45 -0
  289. package/dist/lib/rate-limit-retry.js +88 -0
  290. package/dist/lib/roles.d.ts +98 -0
  291. package/dist/lib/roles.js +45 -0
  292. package/dist/lib/store-listing.d.ts +45 -0
  293. package/dist/lib/store-listing.js +186 -0
  294. package/dist/lib/task-batch.d.ts +67 -0
  295. package/dist/lib/task-batch.js +227 -0
  296. package/dist/lib/terminal-qr.d.ts +55 -0
  297. package/dist/lib/terminal-qr.js +119 -0
  298. package/dist/lib/web-url.d.ts +11 -0
  299. package/dist/lib/web-url.js +24 -0
  300. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/commitmentExecutionContract.d.ts +45 -0
  301. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/commitmentExecutionContract.js +550 -0
  302. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/computerWire.d.ts +68 -0
  303. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/computerWire.js +47 -1
  304. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/sessionPermissionAuthority.d.ts +7 -44
  305. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/sessionPermissionAuthority.js +8 -47
  306. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/commitmentExecutionContract.d.ts +45 -0
  307. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/commitmentExecutionContract.js +545 -0
  308. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/computerWire.d.ts +68 -0
  309. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/computerWire.js +46 -0
  310. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/sessionPermissionAuthority.d.ts +7 -44
  311. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/sessionPermissionAuthority.js +8 -47
  312. package/dist/node_modules/@skrr-ai/auth-core/package.json +11 -1
  313. package/dist/node_modules/@skrr-ai/data-provider/index.js +7285 -6673
  314. package/dist/node_modules/@skrr-ai/data-provider/package.json +2 -2
  315. package/oclif.manifest.json +35937 -26820
  316. package/package.json +6 -2
  317. package/dist/commands/commitments/autonomy.d.ts +0 -30
  318. package/dist/commands/commitments/autonomy.js +0 -67
  319. package/dist/commands/commitments/mode.js +0 -58
  320. package/dist/commands/commitments/pack/promote.d.ts +0 -19
  321. package/dist/commands/commitments/pack/promote.js +0 -46
  322. package/dist/commands/commitments/pack/shadow.d.ts +0 -20
  323. package/dist/commands/commitments/pack/shadow.js +0 -42
@@ -62,25 +62,26 @@ class TasksSnooze extends base_command_1.BaseCommand {
62
62
  this.failWithCliError({ ...failure, exit: 2, retryable: false });
63
63
  return;
64
64
  }
65
+ const taskRef = await this.resolveEntityRef('task', identity.id);
65
66
  try {
66
67
  if (flags.status) {
67
- const response = await data_provider_1.dataService.getTaskSnooze(identity.id);
68
+ const response = await data_provider_1.dataService.getTaskSnooze(taskRef);
68
69
  if (flags.json)
69
70
  this.log(JSON.stringify(response, null, 2));
70
71
  else
71
- this.log(response.snoozed ? `Snoozed ${identity.id}.` : `Not snoozed: ${identity.id}.`);
72
+ this.log(response.snoozed ? `Snoozed ${taskRef}.` : `Not snoozed: ${taskRef}.`);
72
73
  return;
73
74
  }
74
- const response = await data_provider_1.dataService.snoozeTask(identity.id, {
75
+ const response = await data_provider_1.dataService.snoozeTask(taskRef, {
75
76
  ...(flags.until ? { until: new Date(flags.until).toISOString() } : {}),
76
77
  ...(flags['until-activity'] ? { untilActivity: true } : {}),
77
78
  });
78
79
  if (flags.json)
79
80
  this.log(JSON.stringify(response, null, 2));
80
81
  else if (flags['until-activity'])
81
- this.log(`Snoozed ${identity.id} until new activity.`);
82
+ this.log(`Snoozed ${taskRef} until new activity.`);
82
83
  else
83
- this.log(`Snoozed ${identity.id} until ${new Date(flags.until).toLocaleString()}.`);
84
+ this.log(`Snoozed ${taskRef} until ${new Date(flags.until).toLocaleString()}.`);
84
85
  }
85
86
  catch (error) {
86
87
  this.handleApiError(error);
@@ -24,17 +24,18 @@ class TasksStartAll extends base_command_1.BaseCommand {
24
24
  async run() {
25
25
  this.requireAuth();
26
26
  const { args, flags } = await this.parse(TasksStartAll);
27
+ const taskRef = await this.resolveEntityRef('task', args.id);
27
28
  const mode = flags.mode;
28
29
  let result;
29
30
  try {
30
31
  if (mode === 'dri') {
31
- result = await data_provider_1.dataService.startDRIAgent(args.id);
32
+ result = await data_provider_1.dataService.startDRIAgent(taskRef);
32
33
  }
33
34
  else if (mode === 'dri-plan') {
34
- result = await data_provider_1.dataService.startDRIPlan(args.id);
35
+ result = await data_provider_1.dataService.startDRIPlan(taskRef);
35
36
  }
36
37
  else {
37
- result = await data_provider_1.dataService.startAllTasks(args.id);
38
+ result = await data_provider_1.dataService.startAllTasks(taskRef);
38
39
  }
39
40
  }
40
41
  catch (err) {
@@ -44,7 +45,7 @@ class TasksStartAll extends base_command_1.BaseCommand {
44
45
  this.log(JSON.stringify(result, null, 2));
45
46
  return;
46
47
  }
47
- this.log(`Started ${mode} pipeline for task ${args.id}`);
48
+ this.log(`Started ${mode} pipeline for task ${taskRef}`);
48
49
  const r = result;
49
50
  if (r.runId)
50
51
  this.log(`Run ID: ${r.runId}`);
@@ -36,6 +36,7 @@ class TasksSubscribe extends base_command_1.BaseCommand {
36
36
  details: failure.details,
37
37
  });
38
38
  }
39
+ const taskRef = await this.resolveEntityRef('task', identity.id);
39
40
  let task;
40
41
  let response;
41
42
  try {
@@ -31,6 +31,7 @@ class TasksTagsAdd extends base_command_1.BaseCommand {
31
31
  async run() {
32
32
  this.requireAuth();
33
33
  const { args, flags } = await this.parse(TasksTagsAdd);
34
+ const taskRef = await this.resolveEntityRef('task', args.id);
34
35
  const incoming = (flags.tag ?? [])
35
36
  .map((t) => t.trim().toLowerCase())
36
37
  .filter((t) => t.length > 0);
@@ -39,7 +40,7 @@ class TasksTagsAdd extends base_command_1.BaseCommand {
39
40
  }
40
41
  let current;
41
42
  try {
42
- current = await data_provider_1.dataService.getTask(args.id, { enrich: false });
43
+ current = await data_provider_1.dataService.getTask(taskRef, { enrich: false });
43
44
  }
44
45
  catch (err) {
45
46
  this.handleApiError(err);
@@ -55,7 +56,7 @@ class TasksTagsAdd extends base_command_1.BaseCommand {
55
56
  let updated;
56
57
  try {
57
58
  updated = await data_provider_1.dataService.updateTask({
58
- taskId: args.id,
59
+ taskId: taskRef,
59
60
  data: { tags: merged },
60
61
  });
61
62
  }
@@ -68,7 +69,7 @@ class TasksTagsAdd extends base_command_1.BaseCommand {
68
69
  }
69
70
  const t = updated;
70
71
  const ref = t.identifier ?? (t.taskNumber ? `#${t.taskNumber}` : '');
71
- this.log(`Added ${incoming.length} tag(s) to task ${t.id ?? args.id}${ref ? ` (${ref})` : ''} — now: ${merged.join(', ')}`);
72
+ this.log(`Added ${incoming.length} tag(s) to task ${t.id ?? taskRef}${ref ? ` (${ref})` : ''} — now: ${merged.join(', ')}`);
72
73
  }
73
74
  }
74
75
  exports.default = TasksTagsAdd;
@@ -27,13 +27,14 @@ class TasksTagsRemove extends base_command_1.BaseCommand {
27
27
  async run() {
28
28
  this.requireAuth();
29
29
  const { args, flags } = await this.parse(TasksTagsRemove);
30
+ const taskRef = await this.resolveEntityRef('task', args.id);
30
31
  const targets = new Set((flags.tag ?? []).map((t) => t.trim().toLowerCase()).filter((t) => t.length > 0));
31
32
  if (targets.size === 0) {
32
33
  this.error('At least one --tag is required.', { exit: 1 });
33
34
  }
34
35
  let current;
35
36
  try {
36
- current = await data_provider_1.dataService.getTask(args.id, { enrich: false });
37
+ current = await data_provider_1.dataService.getTask(taskRef, { enrich: false });
37
38
  }
38
39
  catch (err) {
39
40
  this.handleApiError(err);
@@ -49,7 +50,7 @@ class TasksTagsRemove extends base_command_1.BaseCommand {
49
50
  let updated;
50
51
  try {
51
52
  updated = await data_provider_1.dataService.updateTask({
52
- taskId: args.id,
53
+ taskId: taskRef,
53
54
  data: { tags: next },
54
55
  });
55
56
  }
@@ -62,7 +63,7 @@ class TasksTagsRemove extends base_command_1.BaseCommand {
62
63
  }
63
64
  const t = updated;
64
65
  const ref = t.identifier ?? (t.taskNumber ? `#${t.taskNumber}` : '');
65
- this.log(`Removed ${existing.length - next.length} tag(s) from task ${t.id ?? args.id}${ref ? ` (${ref})` : ''} — now: ${next.join(', ') || '(none)'}`);
66
+ this.log(`Removed ${existing.length - next.length} tag(s) from task ${t.id ?? taskRef}${ref ? ` (${ref})` : ''} — now: ${next.join(', ') || '(none)'}`);
66
67
  }
67
68
  }
68
69
  exports.default = TasksTagsRemove;
@@ -33,9 +33,10 @@ class TasksTimeline extends base_command_1.BaseCommand {
33
33
  async run() {
34
34
  this.requireAuth();
35
35
  const { args, flags } = await this.parse(TasksTimeline);
36
+ const taskRef = await this.resolveEntityRef('task', args.id);
36
37
  let result;
37
38
  try {
38
- result = await data_provider_1.dataService.getTaskTimeline(args.id, {
39
+ result = await data_provider_1.dataService.getTaskTimeline(taskRef, {
39
40
  limit: flags.limit,
40
41
  cursor: flags.cursor,
41
42
  type: flags.type,
@@ -54,7 +55,7 @@ class TasksTimeline extends base_command_1.BaseCommand {
54
55
  if (rows.length === 0) {
55
56
  // `renderTable([])` prints NOTHING — no header, no empty state, exit 0 —
56
57
  // which is indistinguishable from a broken command. Say what happened.
57
- this.log(await (0, task_legacy_1.emptyCanonicalView)(args.id, 'timeline entries'));
58
+ this.log(await (0, task_legacy_1.emptyCanonicalView)(taskRef, 'timeline entries'));
58
59
  return;
59
60
  }
60
61
  (0, format_1.renderTable)(rows.map((item) => ({
@@ -3,10 +3,13 @@ export default class TasksToday extends BaseCommand {
3
3
  static description: string;
4
4
  static examples: string[];
5
5
  static flags: {
6
+ 'include-snoozed': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
7
+ fields: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
8
+ compact: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
9
+ ndjson: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
6
10
  json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
7
11
  limit: import("@oclif/core/lib/interfaces").OptionFlag<number, import("@oclif/core/lib/interfaces").CustomOptions>;
8
12
  cursor: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
9
- 'include-snoozed': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
10
13
  };
11
14
  run(): Promise<void>;
12
15
  }
@@ -5,6 +5,7 @@ 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 TasksToday extends base_command_1.BaseCommand {
9
10
  static description = "List today's tasks";
10
11
  static examples = [
@@ -12,11 +13,13 @@ class TasksToday extends base_command_1.BaseCommand {
12
13
  '<%= config.bin %> tasks today --limit 25',
13
14
  '<%= config.bin %> tasks today --json',
14
15
  '<%= config.bin %> tasks today --include-snoozed',
16
+ '<%= config.bin %> tasks today --compact --json',
15
17
  ];
16
18
  static flags = {
17
19
  json: core_1.Flags.boolean({ description: 'Output as JSON' }),
18
20
  limit: core_1.Flags.integer({ description: 'Max results', default: 50 }),
19
21
  cursor: core_1.Flags.string({ description: 'Pagination cursor from a previous page' }),
22
+ ...list_output_1.listOutputFlags,
20
23
  'include-snoozed': core_1.Flags.boolean({
21
24
  description: 'Include tasks you have personally snoozed (hidden by default)',
22
25
  }),
@@ -35,8 +38,15 @@ class TasksToday extends base_command_1.BaseCommand {
35
38
  catch (err) {
36
39
  this.handleApiError(err);
37
40
  }
38
- if (flags.json) {
39
- this.log(JSON.stringify((0, web_url_1.withDataUrls)(this.cliConfig.baseURL, response, web_url_1.taskUrlFrom), null, 2));
41
+ if (flags.json || flags.ndjson) {
42
+ // `/tasks/today` has no server-side `view=summary`, so --compact is a
43
+ // client-side trim here: the rows still cross the wire.
44
+ this.printList((0, list_output_1.shapeListResponse)((0, web_url_1.withDataUrls)(this.cliConfig.baseURL, response, web_url_1.taskUrlFrom), {
45
+ resource: 'task',
46
+ fields: flags.fields,
47
+ compact: flags.compact,
48
+ requestedLimit: flags.limit,
49
+ }), Boolean(flags.ndjson));
40
50
  return;
41
51
  }
42
52
  const r = response;
@@ -55,9 +55,10 @@ class TasksTranscript extends base_command_1.BaseCommand {
55
55
  details: { suggestion: failure.suggestion, context: failure.details },
56
56
  });
57
57
  }
58
+ const taskRef = await this.resolveEntityRef('task', taskIdentity.id);
58
59
  let task;
59
60
  try {
60
- task = (await data_provider_1.dataService.getTask(taskIdentity.id, { enrich: false }));
61
+ task = (await data_provider_1.dataService.getTask(taskRef, { enrich: false }));
61
62
  }
62
63
  catch (err) {
63
64
  this.handleApiError(err);
@@ -67,13 +68,13 @@ class TasksTranscript extends base_command_1.BaseCommand {
67
68
  // A task with no execution conversation has simply never been run by an
68
69
  // agent — a real state, not a lookup failure. Say which one it is.
69
70
  this.failWithCliError({
70
- message: `Task ${task.identifier ?? taskIdentity.id} has no execution conversation yet (status: ${task.status ?? 'unknown'}).`,
71
+ message: `Task ${task.identifier ?? taskRef} has no execution conversation yet (status: ${task.status ?? 'unknown'}).`,
71
72
  code: 'TASK_CONVERSATION_MISSING',
72
73
  exit: 4,
73
74
  retryable: false,
74
75
  details: {
75
76
  suggestion: 'Start the task (`skrr tasks start <task-id>`) or check `skrr tasks runs <task-id>` for a failed run.',
76
- taskId: taskIdentity.id,
77
+ taskId: taskRef,
77
78
  status: task.status ?? null,
78
79
  },
79
80
  });
@@ -93,7 +94,7 @@ class TasksTranscript extends base_command_1.BaseCommand {
93
94
  if (flags.json) {
94
95
  this.log(JSON.stringify({
95
96
  object: 'sky.task_transcript',
96
- taskId: String(task.id ?? taskIdentity.id),
97
+ taskId: String(task.id ?? taskRef),
97
98
  identifier: task.identifier ?? null,
98
99
  status: task.status ?? null,
99
100
  conversationId,
@@ -104,7 +105,7 @@ class TasksTranscript extends base_command_1.BaseCommand {
104
105
  }, null, 2));
105
106
  return;
106
107
  }
107
- this.log(`Task: ${task.identifier ?? task.id ?? taskIdentity.id} — ${task.title ?? '-'}`);
108
+ this.log(`Task: ${task.identifier ?? task.id ?? taskRef} — ${task.title ?? '-'}`);
108
109
  this.log(`Status: ${task.status ?? '-'}`);
109
110
  this.log(`Conversation: ${conversationId}`);
110
111
  this.log('');
@@ -19,9 +19,10 @@ class TasksUnschedule extends base_command_1.BaseCommand {
19
19
  async run() {
20
20
  this.requireAuth();
21
21
  const { args, flags } = await this.parse(TasksUnschedule);
22
+ const taskRef = await this.resolveEntityRef('task', args.id);
22
23
  let result;
23
24
  try {
24
- result = await data_provider_1.dataService.unscheduleTask(args.id);
25
+ result = await data_provider_1.dataService.unscheduleTask(taskRef);
25
26
  }
26
27
  catch (err) {
27
28
  this.handleApiError(err);
@@ -32,7 +33,7 @@ class TasksUnschedule extends base_command_1.BaseCommand {
32
33
  }
33
34
  const t = result;
34
35
  const ref = t.identifier ?? (t.taskNumber ? `#${t.taskNumber}` : '');
35
- this.log(`Unscheduled task ${t.id ?? t._id ?? args.id}${ref ? ` (${ref})` : ''}`);
36
+ this.log(`Unscheduled task ${t.id ?? t._id ?? taskRef}${ref ? ` (${ref})` : ''}`);
36
37
  }
37
38
  }
38
39
  exports.default = TasksUnschedule;
@@ -30,12 +30,13 @@ class TasksUnsnooze extends base_command_1.BaseCommand {
30
30
  this.failWithCliError({ ...failure, exit: 2, retryable: false });
31
31
  return;
32
32
  }
33
+ const taskRef = await this.resolveEntityRef('task', identity.id);
33
34
  try {
34
- const response = await data_provider_1.dataService.unsnoozeTask(identity.id);
35
+ const response = await data_provider_1.dataService.unsnoozeTask(taskRef);
35
36
  if (flags.json)
36
37
  this.log(JSON.stringify(response, null, 2));
37
38
  else
38
- this.log(`Unsnoozed ${identity.id}.`);
39
+ this.log(`Unsnoozed ${taskRef}.`);
39
40
  }
40
41
  catch (error) {
41
42
  this.handleApiError(error);
@@ -36,10 +36,11 @@ class TasksUnsubscribe extends base_command_1.BaseCommand {
36
36
  });
37
37
  return;
38
38
  }
39
+ const taskRef = await this.resolveEntityRef('task', identity.id);
39
40
  let task;
40
41
  let response = { unsubscribed: false };
41
42
  try {
42
- task = await data_provider_1.dataService.getTask(identity.id);
43
+ task = await data_provider_1.dataService.getTask(taskRef);
43
44
  const subscriptions = await data_provider_1.dataService.listEntitySubscriptions({ entityType: 'task' });
44
45
  const subscription = subscriptions.items.find((candidate) => candidate.entityId === task.id && candidate.subscriberType === 'user');
45
46
  if (subscription?.id)
@@ -220,6 +220,7 @@ class TasksUpdate extends base_command_1.BaseCommand {
220
220
  details: { suggestion: failure.suggestion, context: failure.details },
221
221
  });
222
222
  }
223
+ const taskRef = await this.resolveEntityRef('task', taskIdentity.id);
223
224
  // `--expect clear` is an explicit empty list, which the API turns into $unset —
224
225
  // distinct from omitting the flag, which leaves the declaration untouched.
225
226
  // Without the sentinel there is no way to say "stop requiring an output"
@@ -284,7 +285,7 @@ class TasksUpdate extends base_command_1.BaseCommand {
284
285
  if (changesSpec) {
285
286
  let settled = [];
286
287
  try {
287
- const acceptance = await data_provider_1.dataService.getTaskAcceptance(taskIdentity.id);
288
+ const acceptance = await data_provider_1.dataService.getTaskAcceptance(taskRef);
288
289
  settled = acceptance.expectations.filter((e) => e.assessmentId);
289
290
  }
290
291
  catch {
@@ -435,7 +436,7 @@ class TasksUpdate extends base_command_1.BaseCommand {
435
436
  await this.resolveAssigneesInPayload(payload, {
436
437
  resolveSpaceId: async () => {
437
438
  try {
438
- const task = (await data_provider_1.dataService.getTask(taskIdentity.id, { enrich: false }));
439
+ const task = (await data_provider_1.dataService.getTask(taskRef, { enrich: false }));
439
440
  return typeof task.spaceId === 'string' ? task.spaceId : undefined;
440
441
  }
441
442
  catch {
@@ -448,7 +449,7 @@ class TasksUpdate extends base_command_1.BaseCommand {
448
449
  let updated;
449
450
  try {
450
451
  updated = await data_provider_1.dataService.updateTask({
451
- taskId: taskIdentity.id,
452
+ taskId: taskRef,
452
453
  data: payload,
453
454
  });
454
455
  }
@@ -481,7 +482,7 @@ class TasksUpdate extends base_command_1.BaseCommand {
481
482
  }
482
483
  const t = updated;
483
484
  const ref = t.identifier ?? (t.taskNumber ? `#${t.taskNumber}` : '');
484
- this.log(`Updated task ${t.id ?? t._id ?? taskIdentity.id}${ref ? ` (${ref})` : ''} — ${t.title ?? '(no title)'}`);
485
+ this.log(`Updated task ${t.id ?? t._id ?? taskRef}${ref ? ` (${ref})` : ''} — ${t.title ?? '(no title)'}`);
485
486
  // `--yes` asserts the revocation; it does not erase that it happened.
486
487
  // Report the cost after the write too, or the evidence is silently gone.
487
488
  if (changesSpec && flags.yes && (settledSpecAssessments > 0 || acceptanceUnreadable)) {
@@ -54,6 +54,7 @@ class TasksWait extends base_command_1.BaseCommand {
54
54
  details: { suggestion: failure.suggestion, context: failure.details },
55
55
  });
56
56
  }
57
+ const taskRef = await this.resolveEntityRef('task', taskIdentity.id);
57
58
  const failOn = (0, task_execution_1.parseStatusSet)(flags['fail-on'], task_execution_1.DEFAULT_FAIL_STATUSES);
58
59
  let timeoutMs = null;
59
60
  try {
@@ -75,16 +76,16 @@ class TasksWait extends base_command_1.BaseCommand {
75
76
  try {
76
77
  tasks = flags.descendants
77
78
  ? await (0, task_execution_1.fetchTaskSet)({
78
- rootId: taskIdentity.id,
79
+ rootId: taskRef,
79
80
  descendants: true,
80
81
  childrenOnly: flags['children-only'],
81
82
  })
82
- : await (0, task_execution_1.fetchTaskSet)({ ids: [taskIdentity.id, ...(flags.task ?? [])] });
83
+ : await (0, task_execution_1.fetchTaskSet)({ ids: [taskRef, ...(flags.task ?? [])] });
83
84
  }
84
85
  catch (err) {
85
86
  this.handleApiError(err);
86
87
  }
87
- const snapshot = (0, task_execution_1.buildSnapshot)(tasks, failOn, taskIdentity.id);
88
+ const snapshot = (0, task_execution_1.buildSnapshot)(tasks, failOn, taskRef);
88
89
  const failed = snapshot.failureTasks.length > 0;
89
90
  const satisfied = snapshot.tasks.length > 0 &&
90
91
  snapshot.tasks.every((task) => (0, task_execution_1.satisfiesWaitTarget)(task, flags.until));
@@ -101,7 +102,7 @@ class TasksWait extends base_command_1.BaseCommand {
101
102
  }
102
103
  if (timeoutMs != null && Date.now() - startedAt >= timeoutMs) {
103
104
  this.failWithCliError({
104
- message: `Timed out waiting for ${taskIdentity.id} after ${flags.timeout}.`,
105
+ message: `Timed out waiting for ${taskRef} after ${flags.timeout}.`,
105
106
  code: 'TASK_WAIT_TIMEOUT',
106
107
  exit: 124,
107
108
  retryable: true,
@@ -0,0 +1,37 @@
1
+ import { type DistributionChannel, type StoreBadgeStyle } from '@skrr-ai/data-provider';
2
+ /**
3
+ * The CLI's half of agent distribution (docs/architecture/agent-distribution-2026-10-08.md):
4
+ * minting the sharer's attribution code for a public agent and building the
5
+ * addresses `skrr agents share` and `skrr agents badge` print.
6
+ *
7
+ * Every URL comes from data-provider's one builder over this deployment's web
8
+ * origin — never a hand-spelled `/a/…` — so a link printed here is the link the
9
+ * web and mobile share sheets print for the same (sharer, agent, channel).
10
+ */
11
+ export type AgentShareLink = {
12
+ agentId: string;
13
+ channel: DistributionChannel;
14
+ code: string;
15
+ url: string;
16
+ };
17
+ /**
18
+ * The server answers every kind of not-public (private, unpublished, missing,
19
+ * moderated) with the same 404, so the CLI cannot — and must not try to — tell
20
+ * them apart. What it CAN say is what to do instead.
21
+ */
22
+ export declare class AgentNotShareableError extends Error {
23
+ readonly agentId: string;
24
+ readonly code = "AGENT_NOT_SHAREABLE";
25
+ constructor(agentId: string);
26
+ }
27
+ /**
28
+ * Mint (idempotently — the same sharer, agent and channel always get the same
29
+ * code) and return the canonical attributed listing URL.
30
+ */
31
+ export declare function mintAgentShareLink({ baseURL, agentId, channel, }: {
32
+ baseURL: string;
33
+ agentId: string;
34
+ channel: DistributionChannel;
35
+ }): Promise<AgentShareLink>;
36
+ /** The anonymous badge image of a public listing, on the API this CLI talks to. */
37
+ export declare function agentBadgeImageUrl(agentId: string, style?: StoreBadgeStyle): string;
@@ -0,0 +1,63 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AgentNotShareableError = void 0;
4
+ exports.mintAgentShareLink = mintAgentShareLink;
5
+ exports.agentBadgeImageUrl = agentBadgeImageUrl;
6
+ const data_provider_1 = require("@skrr-ai/data-provider");
7
+ const http_error_1 = require("./http-error");
8
+ const web_url_1 = require("./web-url");
9
+ /**
10
+ * The server answers every kind of not-public (private, unpublished, missing,
11
+ * moderated) with the same 404, so the CLI cannot — and must not try to — tell
12
+ * them apart. What it CAN say is what to do instead.
13
+ */
14
+ class AgentNotShareableError extends Error {
15
+ agentId;
16
+ code = 'AGENT_NOT_SHAREABLE';
17
+ constructor(agentId) {
18
+ super(`${agentId} has no public Store listing, so it has no public link: it is private, ` +
19
+ 'unpublished, or does not exist. To give one person access to a private agent, use ' +
20
+ `\`skrr agent-shares create ${agentId} --recipient <user-id>\`; to publish it, ` +
21
+ `\`skrr agents visibility ${agentId} --public\`.`);
22
+ this.agentId = agentId;
23
+ this.name = 'AgentNotShareableError';
24
+ }
25
+ }
26
+ exports.AgentNotShareableError = AgentNotShareableError;
27
+ function isNotDistributable(err) {
28
+ if ((0, http_error_1.httpStatusOf)(err) === 404)
29
+ return true;
30
+ const body = (0, http_error_1.httpBodyOf)(err);
31
+ return body?.code === 'ENTITY_NOT_FOUND';
32
+ }
33
+ /**
34
+ * Mint (idempotently — the same sharer, agent and channel always get the same
35
+ * code) and return the canonical attributed listing URL.
36
+ */
37
+ async function mintAgentShareLink({ baseURL, agentId, channel, }) {
38
+ let minted;
39
+ try {
40
+ minted = await data_provider_1.dataService.mintDistributionCode({
41
+ entity: { kind: 'agent', id: agentId },
42
+ channel,
43
+ });
44
+ }
45
+ catch (err) {
46
+ if (isNotDistributable(err))
47
+ throw new AgentNotShareableError(agentId);
48
+ throw err;
49
+ }
50
+ return {
51
+ agentId,
52
+ channel,
53
+ code: minted.code,
54
+ url: (0, data_provider_1.buildShareUrl)((0, web_url_1.webOrigin)(baseURL), { kind: 'agent', id: agentId }, {
55
+ code: minted.code,
56
+ channel,
57
+ }),
58
+ };
59
+ }
60
+ /** The anonymous badge image of a public listing, on the API this CLI talks to. */
61
+ function agentBadgeImageUrl(agentId, style) {
62
+ return (0, data_provider_1.publicStoreAgentBadge)(agentId, style && style !== 'flat' ? { style } : {});
63
+ }
@@ -0,0 +1,69 @@
1
+ import { type Attribution, type DistributionChannel, type ResolveAgentVanityResponse, type ResolveDistributionCodeResponse } from '@skrr-ai/data-provider';
2
+ /**
3
+ * THE ONE PLACE A STORE AGENT REFERENCE IS RESOLVED.
4
+ *
5
+ * `skrr store install|show|stats`, `skrr agents share|badge` and `skrr open`
6
+ * read the positional through `resolveAgentRef`, never by using the raw string
7
+ * as an id. Accepted, in this order:
8
+ *
9
+ * - an agent id, typed as-is (`agent_abc`) — no attribution: nobody shared it;
10
+ * - any first-party link `parseSkrrLink` recognises as an agent
11
+ * (`https://skrr.ai/a/<id>[/slug]`, `/store/agents/<id>`, `/agent/<id>`,
12
+ * `skrr://agent/<id>`), keeping the link's own `?s=` / `?ch=`;
13
+ * - a first-party link that carries only a share code (`/?s=<code>`), or
14
+ * names something the CLI cannot look up locally but carries a code — the
15
+ * code is resolved through the server (`resolveDistributionCode`);
16
+ * - a vanity address, `@handle/agent-slug` or `…/@handle/agent-slug` — the
17
+ * alias is resolved through the server's public vanity endpoint (a retired
18
+ * handle or slug still resolves; agent-distribution-2026-10-08, "Vanity
19
+ * URLs"). A vanity link that also carries a code is resolved by its code,
20
+ * which names the agent exactly.
21
+ *
22
+ * Link recognition is data-provider's (`inspectSkrrLink`, principle 5): no
23
+ * regex here decides what a URL names.
24
+ *
25
+ * Attribution belongs to the SHARER's channel. A pasted link keeps the `ch` it
26
+ * was minted with; a bare id carries none, and this never invents one (no
27
+ * `ch=cli` for an id someone typed — that would credit a share nobody made).
28
+ */
29
+ export type ResolvedAgentRef = {
30
+ agentId: string;
31
+ /**
32
+ * How it was given: an id, a link naming the agent, a share code the server
33
+ * resolved, or a vanity alias the server resolved.
34
+ */
35
+ source: 'id' | 'link' | 'code' | 'vanity';
36
+ attribution: Attribution;
37
+ };
38
+ export type AgentRefErrorCode = 'AGENT_REF_EMPTY' | 'AGENT_REF_UNSUPPORTED' | 'AGENT_REF_FOREIGN' | 'AGENT_REF_NOT_AN_AGENT' | 'AGENT_REF_VANITY_UNRESOLVED' | 'AGENT_REF_CODE_UNRESOLVED';
39
+ export declare class AgentRefError extends Error {
40
+ readonly code: AgentRefErrorCode;
41
+ constructor(message: string, code: AgentRefErrorCode);
42
+ }
43
+ export type AgentRefOptions = {
44
+ /** The configured deployment; its hosts count as first-party besides the built-in list. */
45
+ baseURL?: string;
46
+ /** How a share code is resolved. Defaults to the anonymous public resolve endpoint. */
47
+ resolveCode?: (code: string) => Promise<ResolveDistributionCodeResponse | null>;
48
+ /** How a vanity alias is resolved. Defaults to the anonymous public vanity endpoint. */
49
+ resolveVanity?: (handle: string, slug: string) => Promise<ResolveAgentVanityResponse | null>;
50
+ };
51
+ /**
52
+ * The built-in first-party hosts plus every origin the configured deployment
53
+ * serves (a dev or self-hosted `baseURL` is first-party for its own user).
54
+ */
55
+ export declare function cliFirstPartyHosts(baseURL?: string): string[];
56
+ export declare function resolveAgentRef(input: string, options?: AgentRefOptions): Promise<ResolvedAgentRef>;
57
+ /**
58
+ * The canonical public address of a resolved agent, keeping the attribution it
59
+ * arrived with — what a command prints when it echoes a link back (an install
60
+ * command, an `open`), so following the echo credits the same share.
61
+ */
62
+ export declare function attributedListingUrl(baseURL: string, ref: Pick<ResolvedAgentRef, 'agentId' | 'attribution'>): string;
63
+ /** The install body fields an attribution maps to; empty for an unattributed ref. */
64
+ export declare function installAttribution(attribution: Attribution): {
65
+ distributionCode?: string;
66
+ channel?: DistributionChannel;
67
+ };
68
+ /** Quote a URL for a POSIX shell: `?` and `&` in an attributed link are metacharacters. */
69
+ export declare function shellQuote(value: string): string;