@anna-ai/cli 0.1.29 → 0.1.32

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 (68) hide show
  1. package/dist/{_lifecycle-shared-BpSOfVCP.js → _lifecycle-shared-CUK2CE76.js} +1 -1
  2. package/dist/account-bqao7Gp5.js +30 -0
  3. package/dist/{agent-CaZVCPs6.js → agent-CzPryLi6.js} +1 -1
  4. package/dist/{app-bundle-upload-BhAYo6yj.js → app-bundle-upload-CqT9KUOl.js} +2 -2
  5. package/dist/{app-cache-Bl7cE5fm.js → app-cache-BqnTkxUw.js} +1 -0
  6. package/dist/{apps-CCdtLmxQ.js → apps-DlVsVHQ5.js} +46 -1
  7. package/dist/{apps-cut-BOhg9RHy.js → apps-cut-8870xpk-.js} +11 -11
  8. package/dist/{apps-destructive-DWF4eTHn.js → apps-destructive-B6RFjokU.js} +3 -3
  9. package/dist/{apps-discard-Dy3vzpCM.js → apps-discard-hVZxAQyj.js} +11 -11
  10. package/dist/{apps-3VcdHIBK.js → apps-dvknZYI2.js} +2 -2
  11. package/dist/{apps-grants-DgvymPBT.js → apps-grants-DnXCnkH5.js} +2 -2
  12. package/dist/{apps-publish-Dgi4lBlu.js → apps-publish-BKqVsS1W.js} +13 -7
  13. package/dist/apps-publish-Djpw5cfG.js +15 -0
  14. package/dist/{apps-push-DbUEFdCK.js → apps-push-B3wZr9B4.js} +18 -12
  15. package/dist/{apps-release-DJFG4BV3.js → apps-release-DZK30eF_.js} +4 -4
  16. package/dist/apps-rename-slug-D2BrWasG.js +62 -0
  17. package/dist/{apps-status-F6aVlzDW.js → apps-status-Ca6MdXZd.js} +2 -2
  18. package/dist/{apps-submit-review-BVmZlhmB.js → apps-submit-review-DMFQI8JZ.js} +3 -3
  19. package/dist/{apps-sync-meta-CQQC_Heb.js → apps-sync-meta-BOb6J_wz.js} +27 -18
  20. package/dist/{apps-versions-BIKsJzIT.js → apps-versions-D1lixrmM.js} +2 -2
  21. package/dist/{bridge-DAY7bsje.js → bridge-CbjqAm0H.js} +1 -1
  22. package/dist/bridge-CzHB_IsQ.js +3 -0
  23. package/dist/{bundled-executas-DeBhDjd8.js → bundled-executas-06keEPP_.js} +1 -1
  24. package/dist/cli.js +61 -40
  25. package/dist/dev-C3yWhzAp.js +4 -0
  26. package/dist/{dev-DXODERsf.js → dev-Re6NyNDS.js} +5 -5
  27. package/dist/{dev-app-cache-TSjL4D4n.js → dev-app-cache-Dv1dZ_bw.js} +1 -0
  28. package/dist/{doctor-DCsBgyRg.js → doctor-VrfEkedz.js} +1 -1
  29. package/dist/{executa-cache-Kx3rfQD-.js → executa-cache-B0O79Hpb.js} +1 -1
  30. package/dist/{executa-destructive-PL2ooHpZ.js → executa-destructive-Bz7vWxEO.js} +3 -3
  31. package/dist/{executa-dev-DEpBrEIH.js → executa-dev-B5Uz982M.js} +8 -8
  32. package/dist/{executa-install-BHQpOskj.js → executa-install-BW9jjY7u.js} +2 -2
  33. package/dist/executa-install-Cyid8R7r.js +7 -0
  34. package/dist/{executa-publish-CkPAB34b.js → executa-publish-Ah6J7jYd.js} +4 -4
  35. package/dist/executa-publish-DI_6M_ea.js +9 -0
  36. package/dist/{executa-reads-CjGZq1yP.js → executa-reads-BXDJWWw6.js} +2 -2
  37. package/dist/listing-meta-BlY7XMrw.js +117 -0
  38. package/dist/{manifest-Bljz8Y6T.js → manifest-DOMrcdCK.js} +16 -1
  39. package/dist/{publish-BYWuujP3.js → publish-GpvkaBIx.js} +11 -10
  40. package/dist/{runner-BuYbm-ex.js → runner-BxYjAmih.js} +9 -3
  41. package/dist/{server-F_VA-5tS.js → server-BMcGaUTy.js} +229 -5
  42. package/dist/{storage-CKTmE87u.js → storage-BkF4XyI0.js} +3 -3
  43. package/dist/{token-Cg7BZGp6.js → token-uedeaAy7.js} +1 -1
  44. package/dist/{working-orchestration-Pjm4YC_U.js → working-orchestration-1jzRuk34.js} +30 -13
  45. package/package.json +3 -3
  46. package/templates/executa/go/main.go +1 -1
  47. package/templates/executa/node/plugin.mjs +1 -1
  48. package/templates/executa/python/__SLUG_PY___plugin.py +1 -1
  49. package/templates/minimal/executas/__SLUG__/__SLUG_PY___plugin.py +1 -1
  50. package/dist/apps-publish-Do7M5je3.js +0 -14
  51. package/dist/bridge-6GIQG63S.js +0 -3
  52. package/dist/dev-CQkCFVXu.js +0 -4
  53. package/dist/executa-install-Bvf_Lvvg.js +0 -7
  54. package/dist/executa-publish-IXWSwva0.js +0 -9
  55. /package/dist/{bundled-executas-B6b8gIfp.js → bundled-executas-_H1A9M50.js} +0 -0
  56. /package/dist/{confirm-h_qMrx0I.js → confirm-BuT56E_B.js} +0 -0
  57. /package/dist/{dev-account-CGo8k9_2.js → dev-account-DqEFCmVg.js} +0 -0
  58. /package/dist/{executa-cache-CXiEgFZY.js → executa-cache-Do1D7xC0.js} +0 -0
  59. /package/dist/{executa-init-DXea7yRN.js → executa-init-D-kWINZ3.js} +0 -0
  60. /package/dist/{executa-register-BUiPzPIU.js → executa-register-D5kvSSz_.js} +0 -0
  61. /package/dist/{executas-CK3er6f9.js → executas-BhFed1B-.js} +0 -0
  62. /package/dist/{fixture-BvP5umlN.js → fixture-BUKQYR5e.js} +0 -0
  63. /package/dist/{host_upload-BXeHTgJs.js → host_upload-BVzAqvX1.js} +0 -0
  64. /package/dist/{image-CSEXEfD-.js → image-BLPyUbGQ.js} +0 -0
  65. /package/dist/{login-BGZjMAlh.js → login-DhgBgsfx.js} +0 -0
  66. /package/dist/{logout-mh2_QlyM.js → logout-VYDkLYAx.js} +0 -0
  67. /package/dist/{sampling-DwV7VPfT.js → sampling-XBIEYU4A.js} +0 -0
  68. /package/dist/{whoami-l_kIkfbI.js → whoami-C_x26b_k.js} +0 -0
@@ -62,4 +62,4 @@ async function withErrorHandling(fn) {
62
62
  }
63
63
 
64
64
  //#endregion
65
- export { resolveClient, withErrorHandling };
65
+ export { reportError, resolveClient, withErrorHandling };
@@ -0,0 +1,30 @@
1
+ import "./credentials-BTv2IfUZ.js";
2
+ import { setDeveloperHandle } from "./apps-DlVsVHQ5.js";
3
+ import { CliError } from "./client-D-_z1ALk.js";
4
+ import { reportError, resolveClient } from "./_lifecycle-shared-CUK2CE76.js";
5
+ import { bold, dim, green, red } from "kleur/colors";
6
+
7
+ //#region src/commands/account.ts
8
+ async function runAccountSetHandle(opts) {
9
+ try {
10
+ const { client, host, source } = resolveClient({ account: opts.account });
11
+ if (!opts.json) console.log(dim(`using PAT from ${source} (host=${host})`));
12
+ const { handle } = await setDeveloperHandle(client, opts.handle);
13
+ if (opts.json) console.log(JSON.stringify({ handle }, null, 2));
14
+ else console.log(green(`✓ developer handle set to `) + bold(`@${handle}`) + "\n" + dim(` your apps are now published as @${handle}/<slug>.`));
15
+ return 0;
16
+ } catch (e) {
17
+ if (e instanceof CliError && e.status && e.status >= 400) {
18
+ const body = e.body;
19
+ const detail = body?.detail;
20
+ if (detail && typeof detail === "object" && detail.code) {
21
+ console.error(red(`✗ ${detail.code}: ${detail.message ?? "handle rejected"}`));
22
+ return e.exitCode;
23
+ }
24
+ }
25
+ return reportError(e);
26
+ }
27
+ }
28
+
29
+ //#endregion
30
+ export { runAccountSetHandle };
@@ -1,5 +1,5 @@
1
1
  import { canonicalHost } from "./credentials-BTv2IfUZ.js";
2
- import { hostOf, mintAppSession, requireAccount, withCode } from "./dev-account-CGo8k9_2.js";
2
+ import { hostOf, mintAppSession, requireAccount, withCode } from "./dev-account-DqEFCmVg.js";
3
3
  import { resolve } from "node:path";
4
4
  import { existsSync, readFileSync } from "node:fs";
5
5
 
@@ -1,6 +1,6 @@
1
- import { finalizeBundle, finalizeWorkingBundle, getBundle, initBundle, initWorkingBundle, uploadBundleFile, uploadWorkingBundleFile } from "./apps-CCdtLmxQ.js";
1
+ import { finalizeBundle, finalizeWorkingBundle, getBundle, initBundle, initWorkingBundle, uploadBundleFile, uploadWorkingBundleFile } from "./apps-DlVsVHQ5.js";
2
2
  import { CliError } from "./client-D-_z1ALk.js";
3
- import { canonicalize } from "./executa-publish-CkPAB34b.js";
3
+ import { canonicalize } from "./executa-publish-Ah6J7jYd.js";
4
4
  import { join, relative, sep } from "node:path";
5
5
  import { readFileSync, readdirSync, statSync } from "node:fs";
6
6
  import { createHash } from "node:crypto";
@@ -18,6 +18,7 @@ function readAppIdentity(cwd) {
18
18
  host: canonicalHost(raw.host),
19
19
  app_id: raw.app_id,
20
20
  slug: raw.slug,
21
+ handle: typeof raw.handle === "string" ? raw.handle : void 0,
21
22
  first_published_at: raw.first_published_at
22
23
  };
23
24
  } catch {}
@@ -33,6 +33,35 @@ async function patchApp(client, appId, body) {
33
33
  });
34
34
  return r.data;
35
35
  }
36
+ /**
37
+ * Upload a store-listing logo from local bytes. The server normalizes raster
38
+ * images to a 256² WebP and stores SVGs verbatim (after an active-content
39
+ * check), writes the resulting CDN URL onto the app row, and returns it.
40
+ */
41
+ async function uploadAppLogo(client, appId, blob) {
42
+ const r = await client.request({
43
+ method: "POST",
44
+ path: `/api/v1/developer/apps/${appId}/logo`,
45
+ multipart: { fields: { file: blob } }
46
+ });
47
+ return r.data;
48
+ }
49
+ /**
50
+ * Upload a single store-listing screenshot from local bytes. The server
51
+ * normalizes raster images to WebP (aspect ratio preserved, long side capped),
52
+ * stores SVGs verbatim (after an active-content check), and returns the CDN
53
+ * URL. Unlike the logo, this does NOT mutate the app row — callers collect all
54
+ * resulting URLs (mixed with any passthrough externals) and persist the
55
+ * ordered list via `PATCH …/apps/{id}` `screenshots`.
56
+ */
57
+ async function uploadAppScreenshot(client, appId, blob) {
58
+ const r = await client.request({
59
+ method: "POST",
60
+ path: `/api/v1/developer/apps/${appId}/screenshots`,
61
+ multipart: { fields: { file: blob } }
62
+ });
63
+ return r.data;
64
+ }
36
65
  async function listVersions(client, appId) {
37
66
  const r = await client.request({ path: `/api/v1/developer/apps/${appId}/versions` });
38
67
  return Array.isArray(r.data) ? r.data : [];
@@ -104,6 +133,22 @@ async function getAppGrants(client, appId) {
104
133
  });
105
134
  return r.status === 404 ? null : r.data;
106
135
  }
136
+ /**
137
+ * Set (or rename) the caller's developer handle — the per-developer
138
+ * namespace for `@handle/slug` public app refs.
139
+ *
140
+ * `PUT /api/v1/developer/profile/handle`. Server validates the handle
141
+ * grammar/reserved words and uniqueness; renaming away from a handle that
142
+ * owns a published app is rejected (409 SLUG_FROZEN / manual flow).
143
+ */
144
+ async function setDeveloperHandle(client, handle) {
145
+ const r = await client.request({
146
+ method: "PUT",
147
+ path: "/api/v1/developer/profile/handle",
148
+ body: { handle }
149
+ });
150
+ return r.data;
151
+ }
107
152
  /** GET the bundle for a version, or `null` when none is initialized (404). */
108
153
  async function getBundle(client, appId, versionId) {
109
154
  const r = await client.request({
@@ -218,4 +263,4 @@ async function finalizeWorkingBundle(client, appId, skipRemoteCheck = false) {
218
263
  }
219
264
 
220
265
  //#endregion
221
- export { archiveApp, createApp, createVersion, cutWorkingDraft, deleteApp, deleteWorkingDraft, finalizeBundle, finalizeWorkingBundle, findAppBySlug, getApp, getAppGrants, getBundle, getWorkingDraft, initBundle, initWorkingBundle, listMyApps, listVersions, patchApp, publishVersion, submitForReview, unarchiveApp, unpublishApp, uploadBundleFile, uploadWorkingBundleFile, upsertWorkingDraft };
266
+ export { archiveApp, createApp, createVersion, cutWorkingDraft, deleteApp, deleteWorkingDraft, finalizeBundle, finalizeWorkingBundle, findAppBySlug, getApp, getAppGrants, getBundle, getWorkingDraft, initBundle, initWorkingBundle, listMyApps, listVersions, patchApp, publishVersion, setDeveloperHandle, submitForReview, unarchiveApp, unpublishApp, uploadAppLogo, uploadAppScreenshot, uploadBundleFile, uploadWorkingBundleFile, upsertWorkingDraft };
@@ -1,17 +1,17 @@
1
1
  import { canonicalHost } from "./credentials-BTv2IfUZ.js";
2
2
  import "./nexus-root-BlPwOusj.js";
3
- import { cutWorkingDraft } from "./apps-CCdtLmxQ.js";
3
+ import { cutWorkingDraft } from "./apps-DlVsVHQ5.js";
4
4
  import { CliError } from "./client-D-_z1ALk.js";
5
- import { readExecutasLock, writeExecutasLock } from "./bundled-executas-B6b8gIfp.js";
6
- import "./executas-CK3er6f9.js";
7
- import "./executa-cache-CXiEgFZY.js";
8
- import "./executa-publish-CkPAB34b.js";
9
- import "./manifest-Bljz8Y6T.js";
10
- import { resolveClient, withErrorHandling } from "./_lifecycle-shared-BpSOfVCP.js";
11
- import "./dev-DXODERsf.js";
12
- import "./executa-install-BHQpOskj.js";
13
- import "./app-cache-Bl7cE5fm.js";
14
- import { resolveAppBySlugOrCache } from "./working-orchestration-Pjm4YC_U.js";
5
+ import { resolveClient, withErrorHandling } from "./_lifecycle-shared-CUK2CE76.js";
6
+ import { readExecutasLock, writeExecutasLock } from "./bundled-executas-_H1A9M50.js";
7
+ import "./executas-BhFed1B-.js";
8
+ import "./executa-cache-Do1D7xC0.js";
9
+ import "./executa-publish-Ah6J7jYd.js";
10
+ import "./manifest-DOMrcdCK.js";
11
+ import "./dev-Re6NyNDS.js";
12
+ import "./executa-install-BW9jjY7u.js";
13
+ import "./app-cache-BqnTkxUw.js";
14
+ import { resolveAppBySlugOrCache } from "./working-orchestration-1jzRuk34.js";
15
15
  import { resolve } from "node:path";
16
16
  import { bold, cyan, dim, green, yellow } from "kleur/colors";
17
17
 
@@ -1,8 +1,8 @@
1
1
  import "./credentials-BTv2IfUZ.js";
2
- import { archiveApp, deleteApp, findAppBySlug, unarchiveApp, unpublishApp } from "./apps-CCdtLmxQ.js";
2
+ import { archiveApp, deleteApp, findAppBySlug, unarchiveApp, unpublishApp } from "./apps-DlVsVHQ5.js";
3
3
  import { CliError } from "./client-D-_z1ALk.js";
4
- import { resolveClient, withErrorHandling } from "./_lifecycle-shared-BpSOfVCP.js";
5
- import { ensureDestructiveAllowed } from "./confirm-h_qMrx0I.js";
4
+ import { resolveClient, withErrorHandling } from "./_lifecycle-shared-CUK2CE76.js";
5
+ import { ensureDestructiveAllowed } from "./confirm-BuT56E_B.js";
6
6
  import { dim, green, yellow } from "kleur/colors";
7
7
 
8
8
  //#region src/commands/apps-destructive.ts
@@ -1,17 +1,17 @@
1
1
  import "./credentials-BTv2IfUZ.js";
2
2
  import "./nexus-root-BlPwOusj.js";
3
- import { deleteWorkingDraft, getWorkingDraft } from "./apps-CCdtLmxQ.js";
3
+ import { deleteWorkingDraft, getWorkingDraft } from "./apps-DlVsVHQ5.js";
4
4
  import "./client-D-_z1ALk.js";
5
- import "./bundled-executas-B6b8gIfp.js";
6
- import "./executas-CK3er6f9.js";
7
- import "./executa-cache-CXiEgFZY.js";
8
- import "./executa-publish-CkPAB34b.js";
9
- import "./manifest-Bljz8Y6T.js";
10
- import { resolveClient, withErrorHandling } from "./_lifecycle-shared-BpSOfVCP.js";
11
- import "./dev-DXODERsf.js";
12
- import "./executa-install-BHQpOskj.js";
13
- import "./app-cache-Bl7cE5fm.js";
14
- import { resolveAppBySlugOrCache } from "./working-orchestration-Pjm4YC_U.js";
5
+ import { resolveClient, withErrorHandling } from "./_lifecycle-shared-CUK2CE76.js";
6
+ import "./bundled-executas-_H1A9M50.js";
7
+ import "./executas-BhFed1B-.js";
8
+ import "./executa-cache-Do1D7xC0.js";
9
+ import "./executa-publish-Ah6J7jYd.js";
10
+ import "./manifest-DOMrcdCK.js";
11
+ import "./dev-Re6NyNDS.js";
12
+ import "./executa-install-BW9jjY7u.js";
13
+ import "./app-cache-BqnTkxUw.js";
14
+ import { resolveAppBySlugOrCache } from "./working-orchestration-1jzRuk34.js";
15
15
  import { dim, green, yellow } from "kleur/colors";
16
16
 
17
17
  //#region src/commands/apps-discard.ts
@@ -1,7 +1,7 @@
1
1
  import "./credentials-BTv2IfUZ.js";
2
- import { listMyApps } from "./apps-CCdtLmxQ.js";
2
+ import { listMyApps } from "./apps-DlVsVHQ5.js";
3
3
  import "./client-D-_z1ALk.js";
4
- import { resolveClient, withErrorHandling } from "./_lifecycle-shared-BpSOfVCP.js";
4
+ import { resolveClient, withErrorHandling } from "./_lifecycle-shared-CUK2CE76.js";
5
5
  import { bold, cyan, dim, green, magenta, red, yellow } from "kleur/colors";
6
6
 
7
7
  //#region src/commands/apps.ts
@@ -1,7 +1,7 @@
1
1
  import "./credentials-BTv2IfUZ.js";
2
- import { findAppBySlug, getAppGrants } from "./apps-CCdtLmxQ.js";
2
+ import { findAppBySlug, getAppGrants } from "./apps-DlVsVHQ5.js";
3
3
  import { CliError } from "./client-D-_z1ALk.js";
4
- import { resolveClient, withErrorHandling } from "./_lifecycle-shared-BpSOfVCP.js";
4
+ import { resolveClient, withErrorHandling } from "./_lifecycle-shared-CUK2CE76.js";
5
5
  import { bold, cyan, dim } from "kleur/colors";
6
6
 
7
7
  //#region src/commands/apps-grants.ts
@@ -1,12 +1,13 @@
1
1
  import { canonicalHost } from "./credentials-BTv2IfUZ.js";
2
- import { createApp, createVersion, findAppBySlug, getApp } from "./apps-CCdtLmxQ.js";
2
+ import { createApp, createVersion, findAppBySlug, getApp } from "./apps-DlVsVHQ5.js";
3
3
  import { CliError } from "./client-D-_z1ALk.js";
4
- import { parseExecutaIdOverrides, readExecutasLock, substituteBundledRefs, validateBundledHandles, writeBundleToolIdSidecar, writeExecutasLock } from "./bundled-executas-B6b8gIfp.js";
5
- import { bumpVersion, bundleHash, manifestHash, rewriteVersion, runExecutaPublish } from "./executa-publish-CkPAB34b.js";
6
- import { loadAppManifest } from "./manifest-Bljz8Y6T.js";
7
- import { resolveClient, withErrorHandling } from "./_lifecycle-shared-BpSOfVCP.js";
8
- import { appCacheMatches, readAppIdentity, writeAppIdentity } from "./app-cache-Bl7cE5fm.js";
9
- import { isExistingDir, uploadAppBundle } from "./app-bundle-upload-BhAYo6yj.js";
4
+ import { resolveClient, withErrorHandling } from "./_lifecycle-shared-CUK2CE76.js";
5
+ import { parseExecutaIdOverrides, readExecutasLock, substituteBundledRefs, validateBundledHandles, writeBundleToolIdSidecar, writeExecutasLock } from "./bundled-executas-_H1A9M50.js";
6
+ import { bumpVersion, bundleHash, manifestHash, rewriteVersion, runExecutaPublish } from "./executa-publish-Ah6J7jYd.js";
7
+ import { loadAppManifest } from "./manifest-DOMrcdCK.js";
8
+ import { appCacheMatches, readAppIdentity, writeAppIdentity } from "./app-cache-BqnTkxUw.js";
9
+ import { syncAppListingMeta } from "./listing-meta-BlY7XMrw.js";
10
+ import { isExistingDir, uploadAppBundle } from "./app-bundle-upload-CqT9KUOl.js";
10
11
  import { resolve } from "node:path";
11
12
  import { bold, cyan, dim, green, yellow } from "kleur/colors";
12
13
 
@@ -228,6 +229,11 @@ async function runAppsPublish(opts) {
228
229
  externalOrigins: Array.isArray(uiBundle.external_origins) ? uiBundle.external_origins : [],
229
230
  log: opts.json ? void 0 : (m) => console.log(dim(m))
230
231
  });
232
+ try {
233
+ await syncAppListingMeta(client, appId, manifest, { cwd });
234
+ } catch (err) {
235
+ if (!opts.json) console.log(yellow(`! listing metadata sync skipped: ${err.message}`));
236
+ }
231
237
  const finalApp = await getApp(client, appId);
232
238
  if (opts.json) {
233
239
  console.log(JSON.stringify({
@@ -0,0 +1,15 @@
1
+ import "./credentials-BTv2IfUZ.js";
2
+ import "./apps-DlVsVHQ5.js";
3
+ import "./client-D-_z1ALk.js";
4
+ import "./_lifecycle-shared-CUK2CE76.js";
5
+ import "./bundled-executas-_H1A9M50.js";
6
+ import "./executas-BhFed1B-.js";
7
+ import "./executa-cache-Do1D7xC0.js";
8
+ import "./executa-publish-Ah6J7jYd.js";
9
+ import "./manifest-DOMrcdCK.js";
10
+ import "./app-cache-BqnTkxUw.js";
11
+ import "./listing-meta-BlY7XMrw.js";
12
+ import "./app-bundle-upload-CqT9KUOl.js";
13
+ import { runAppsPublish } from "./apps-publish-BKqVsS1W.js";
14
+
15
+ export { runAppsPublish };
@@ -1,18 +1,19 @@
1
1
  import "./credentials-BTv2IfUZ.js";
2
2
  import "./nexus-root-BlPwOusj.js";
3
- import { getApp, getWorkingDraft, upsertWorkingDraft } from "./apps-CCdtLmxQ.js";
3
+ import { getApp, getWorkingDraft, upsertWorkingDraft } from "./apps-DlVsVHQ5.js";
4
4
  import { CliError } from "./client-D-_z1ALk.js";
5
- import "./bundled-executas-B6b8gIfp.js";
6
- import "./executas-CK3er6f9.js";
7
- import "./executa-cache-CXiEgFZY.js";
8
- import { bumpVersion, bundleHash, manifestHash, rewriteVersion } from "./executa-publish-CkPAB34b.js";
9
- import { loadAppManifest } from "./manifest-Bljz8Y6T.js";
10
- import { resolveClient, withErrorHandling } from "./_lifecycle-shared-BpSOfVCP.js";
11
- import "./dev-DXODERsf.js";
12
- import "./executa-install-BHQpOskj.js";
13
- import "./app-cache-Bl7cE5fm.js";
14
- import { installLocalBundledShims, resolveAppIdentity, resolveBundledExecutas } from "./working-orchestration-Pjm4YC_U.js";
15
- import { isExistingDir, uploadWorkingBundle } from "./app-bundle-upload-BhAYo6yj.js";
5
+ import { resolveClient, withErrorHandling } from "./_lifecycle-shared-CUK2CE76.js";
6
+ import "./bundled-executas-_H1A9M50.js";
7
+ import "./executas-BhFed1B-.js";
8
+ import "./executa-cache-Do1D7xC0.js";
9
+ import { bumpVersion, bundleHash, manifestHash, rewriteVersion } from "./executa-publish-Ah6J7jYd.js";
10
+ import { loadAppManifest } from "./manifest-DOMrcdCK.js";
11
+ import "./dev-Re6NyNDS.js";
12
+ import "./executa-install-BW9jjY7u.js";
13
+ import "./app-cache-BqnTkxUw.js";
14
+ import { installLocalBundledShims, resolveAppIdentity, resolveBundledExecutas } from "./working-orchestration-1jzRuk34.js";
15
+ import { syncAppListingMeta } from "./listing-meta-BlY7XMrw.js";
16
+ import { isExistingDir, uploadWorkingBundle } from "./app-bundle-upload-CqT9KUOl.js";
16
17
  import { resolve } from "node:path";
17
18
  import { bold, cyan, dim, green, yellow } from "kleur/colors";
18
19
 
@@ -97,6 +98,11 @@ async function runAppsPush(opts) {
97
98
  log: opts.json ? void 0 : (m) => console.log(dim(m))
98
99
  });
99
100
  }
101
+ try {
102
+ await syncAppListingMeta(client, appId, manifest, { cwd });
103
+ } catch (err) {
104
+ if (!opts.json) console.log(yellow(`! listing metadata sync skipped: ${err.message}`));
105
+ }
100
106
  const finalApp = await getApp(client, appId);
101
107
  const draft = await getWorkingDraft(client, appId);
102
108
  if (opts.json) {
@@ -1,8 +1,8 @@
1
1
  import { canonicalHost } from "./credentials-BTv2IfUZ.js";
2
- import { findAppBySlug, getApp, getBundle, listVersions, publishVersion } from "./apps-CCdtLmxQ.js";
2
+ import { findAppBySlug, getApp, getBundle, listVersions, publishVersion } from "./apps-DlVsVHQ5.js";
3
3
  import { CliError } from "./client-D-_z1ALk.js";
4
- import { resolveClient, withErrorHandling } from "./_lifecycle-shared-BpSOfVCP.js";
5
- import { readAppIdentity } from "./app-cache-Bl7cE5fm.js";
4
+ import { resolveClient, withErrorHandling } from "./_lifecycle-shared-CUK2CE76.js";
5
+ import { readAppIdentity } from "./app-cache-BqnTkxUw.js";
6
6
  import { resolve } from "node:path";
7
7
  import { bold, cyan, dim, green, yellow } from "kleur/colors";
8
8
 
@@ -58,7 +58,7 @@ async function runAppsRelease(opts) {
58
58
  if (!target) {
59
59
  if (opts.allowCreate) {
60
60
  if (!opts.json) console.log(yellow(`version ${opts.version} not found remotely; running 'apps publish' first (--allow-create)…`));
61
- const { runAppsPublish } = await import("./apps-publish-Do7M5je3.js");
61
+ const { runAppsPublish } = await import("./apps-publish-Djpw5cfG.js");
62
62
  const code = await runAppsPublish({
63
63
  cwd: opts.cwd,
64
64
  account: opts.account,
@@ -0,0 +1,62 @@
1
+ import "./credentials-BTv2IfUZ.js";
2
+ import { findAppBySlug, patchApp } from "./apps-DlVsVHQ5.js";
3
+ import { CliError } from "./client-D-_z1ALk.js";
4
+ import { reportError, resolveClient } from "./_lifecycle-shared-CUK2CE76.js";
5
+ import { loadAppManifest } from "./manifest-DOMrcdCK.js";
6
+ import { readAppIdentity, writeAppIdentity } from "./app-cache-BqnTkxUw.js";
7
+ import { writeFileSync } from "node:fs";
8
+ import { bold, dim, green, red, yellow } from "kleur/colors";
9
+
10
+ //#region src/commands/apps-rename-slug.ts
11
+ async function runAppsRenameSlug(opts) {
12
+ const cwd = opts.cwd ?? process.cwd();
13
+ try {
14
+ const { client, host } = resolveClient({ account: opts.account });
15
+ const manifest = loadAppManifest(cwd, opts.manifest);
16
+ const oldSlug = manifest.slug;
17
+ if (oldSlug === opts.newSlug) {
18
+ console.error(yellow(`slug is already "${opts.newSlug}" — nothing to do.`));
19
+ return 0;
20
+ }
21
+ const identity = readAppIdentity(cwd);
22
+ let appId = identity && identity.host === host ? identity.app_id : void 0;
23
+ if (appId === void 0) {
24
+ const found = await findAppBySlug(client, oldSlug);
25
+ if (!found) {
26
+ console.error(red(`✗ no app found for slug "${oldSlug}" under this account.`));
27
+ return 4;
28
+ }
29
+ appId = found.id;
30
+ }
31
+ const updated = await patchApp(client, appId, { slug: opts.newSlug });
32
+ const nextMeta = {
33
+ ...manifest.metadataRaw,
34
+ slug: opts.newSlug
35
+ };
36
+ writeFileSync(manifest.metadataPath, JSON.stringify(nextMeta, null, 2) + "\n", "utf-8");
37
+ if (identity) writeAppIdentity(cwd, {
38
+ ...identity,
39
+ slug: opts.newSlug
40
+ });
41
+ if (opts.json) console.log(JSON.stringify({
42
+ id: appId,
43
+ old_slug: oldSlug,
44
+ slug: updated.slug ?? opts.newSlug
45
+ }, null, 2));
46
+ else console.log(green(`✓ renamed slug `) + bold(oldSlug) + green(` → `) + bold(updated.slug ?? opts.newSlug) + "\n" + dim(` updated ${manifest.metadataPath} and .anna/app.json.`));
47
+ return 0;
48
+ } catch (e) {
49
+ if (e instanceof CliError && e.status && e.status >= 400) {
50
+ const body = e.body;
51
+ const detail = body?.detail;
52
+ if (detail && typeof detail === "object" && detail.code) {
53
+ console.error(red(`✗ ${detail.code}: ${detail.message ?? "rename rejected"}`));
54
+ return e.exitCode;
55
+ }
56
+ }
57
+ return reportError(e);
58
+ }
59
+ }
60
+
61
+ //#endregion
62
+ export { runAppsRenameSlug };
@@ -1,7 +1,7 @@
1
1
  import "./credentials-BTv2IfUZ.js";
2
- import { findAppBySlug, getApp, listVersions } from "./apps-CCdtLmxQ.js";
2
+ import { findAppBySlug, getApp, listVersions } from "./apps-DlVsVHQ5.js";
3
3
  import { CliError } from "./client-D-_z1ALk.js";
4
- import { resolveClient, withErrorHandling } from "./_lifecycle-shared-BpSOfVCP.js";
4
+ import { resolveClient, withErrorHandling } from "./_lifecycle-shared-CUK2CE76.js";
5
5
  import { bold, cyan, dim, green, red, yellow } from "kleur/colors";
6
6
 
7
7
  //#region src/commands/apps-status.ts
@@ -1,8 +1,8 @@
1
1
  import { canonicalHost } from "./credentials-BTv2IfUZ.js";
2
- import { findAppBySlug, getApp, submitForReview } from "./apps-CCdtLmxQ.js";
2
+ import { findAppBySlug, getApp, submitForReview } from "./apps-DlVsVHQ5.js";
3
3
  import { CliError } from "./client-D-_z1ALk.js";
4
- import { resolveClient, withErrorHandling } from "./_lifecycle-shared-BpSOfVCP.js";
5
- import { readAppIdentity } from "./app-cache-Bl7cE5fm.js";
4
+ import { resolveClient, withErrorHandling } from "./_lifecycle-shared-CUK2CE76.js";
5
+ import { readAppIdentity } from "./app-cache-BqnTkxUw.js";
6
6
  import { resolve } from "node:path";
7
7
  import { bold, cyan, green } from "kleur/colors";
8
8
 
@@ -1,9 +1,10 @@
1
1
  import { canonicalHost } from "./credentials-BTv2IfUZ.js";
2
- import { findAppBySlug, getApp, patchApp } from "./apps-CCdtLmxQ.js";
2
+ import { findAppBySlug, getApp } from "./apps-DlVsVHQ5.js";
3
3
  import { CliError } from "./client-D-_z1ALk.js";
4
- import { loadAppManifest } from "./manifest-Bljz8Y6T.js";
5
- import { resolveClient, withErrorHandling } from "./_lifecycle-shared-BpSOfVCP.js";
6
- import { readAppIdentity } from "./app-cache-Bl7cE5fm.js";
4
+ import { resolveClient, withErrorHandling } from "./_lifecycle-shared-CUK2CE76.js";
5
+ import { loadAppManifest } from "./manifest-DOMrcdCK.js";
6
+ import { readAppIdentity } from "./app-cache-BqnTkxUw.js";
7
+ import { syncAppListingMeta } from "./listing-meta-BlY7XMrw.js";
7
8
  import { resolve } from "node:path";
8
9
  import { bold, cyan, dim, green } from "kleur/colors";
9
10
 
@@ -27,27 +28,31 @@ async function runAppsSyncMeta(opts) {
27
28
  }
28
29
  }
29
30
  if (appId === null) throw new CliError(`no app with slug "${manifest.slug}" on ${host} — run 'anna-app apps publish' first`, 5);
30
- const meta = {
31
- name: manifest.name,
32
- category: manifest.category,
33
- tagline: manifest.tagline,
34
- description: manifest.description
35
- };
31
+ const sync = await syncAppListingMeta(client, appId, manifest, {
32
+ cwd,
33
+ logoOverride: opts.logo,
34
+ dryRun: opts.dryRun
35
+ });
36
+ const meta = sync.meta;
36
37
  if (opts.dryRun) {
38
+ const plan = {
39
+ host,
40
+ app_id: appId,
41
+ slug: serverSlug,
42
+ meta,
43
+ logo: sync.logoUpload?.source,
44
+ screenshots: sync.screenshotUploads?.map((s) => s.source),
45
+ dry_run: true
46
+ };
37
47
  if (opts.json) {
38
- console.log(JSON.stringify({
39
- host,
40
- app_id: appId,
41
- slug: serverSlug,
42
- meta,
43
- dry_run: true
44
- }, null, 2));
48
+ console.log(JSON.stringify(plan, null, 2));
45
49
  return 0;
46
50
  }
47
51
  console.log(`[dry-run] would PATCH apps/${serverSlug} metadata: ` + JSON.stringify(meta));
52
+ if (sync.logoUpload) console.log(`[dry-run] would upload logo from ${sync.logoUpload.source}`);
53
+ for (const shot of sync.screenshotUploads ?? []) console.log(`[dry-run] would upload screenshot from ${shot.source}`);
48
54
  return 0;
49
55
  }
50
- await patchApp(client, appId, meta);
51
56
  const finalApp = await getApp(client, appId);
52
57
  if (opts.json) {
53
58
  console.log(JSON.stringify({
@@ -55,6 +60,8 @@ async function runAppsSyncMeta(opts) {
55
60
  app_id: appId,
56
61
  slug: serverSlug,
57
62
  meta,
63
+ logo_url: sync.logoUpload?.logo_url,
64
+ screenshot_urls: sync.screenshotUploads?.map((s) => s.screenshot_url),
58
65
  status: finalApp.status
59
66
  }, null, 2));
60
67
  return 0;
@@ -63,6 +70,8 @@ async function runAppsSyncMeta(opts) {
63
70
  console.log(` ${dim("name :")} ${manifest.name}`);
64
71
  if (manifest.category) console.log(` ${dim("category :")} ${manifest.category}`);
65
72
  if (manifest.tagline) console.log(` ${dim("tagline :")} ${manifest.tagline}`);
73
+ if (sync.logoUpload?.logo_url) console.log(` ${dim("logo :")} ${sync.logoUpload.logo_url}`);
74
+ if (sync.screenshotUploads && sync.screenshotUploads.length > 0) console.log(` ${dim("shots :")} ${sync.screenshotUploads.length} uploaded`);
66
75
  console.log(bold(cyan(`status: ${finalApp.status}`)));
67
76
  return 0;
68
77
  });
@@ -1,7 +1,7 @@
1
1
  import "./credentials-BTv2IfUZ.js";
2
- import { findAppBySlug, listVersions } from "./apps-CCdtLmxQ.js";
2
+ import { findAppBySlug, listVersions } from "./apps-DlVsVHQ5.js";
3
3
  import { CliError } from "./client-D-_z1ALk.js";
4
- import { resolveClient, withErrorHandling } from "./_lifecycle-shared-BpSOfVCP.js";
4
+ import { resolveClient, withErrorHandling } from "./_lifecycle-shared-CUK2CE76.js";
5
5
  import { bold, cyan, dim, green } from "kleur/colors";
6
6
 
7
7
  //#region src/commands/apps-versions.ts
@@ -9,7 +9,7 @@ import { createInterface } from "node:readline";
9
9
  * `uvx <pkg>@<version>` so end users always run the dispatcher version
10
10
  * the CLI was tested against.
11
11
  */
12
- const PINNED_RUNTIME_VERSION = "0.2.0a9";
12
+ const PINNED_RUNTIME_VERSION = "0.2.0a11";
13
13
  /**
14
14
  * Throwable from a {@link RequestHandler} to send a structured JSON-RPC
15
15
  * error back to the python bridge with a stable string ``code`` (e.g.
@@ -0,0 +1,3 @@
1
+ import { BridgeRequestError, PINNED_RUNTIME_VERSION, PythonBridge } from "./bridge-CbjqAm0H.js";
2
+
3
+ export { PINNED_RUNTIME_VERSION, PythonBridge };
@@ -1,5 +1,5 @@
1
1
  import "./credentials-BTv2IfUZ.js";
2
2
  import "./client-D-_z1ALk.js";
3
- import { collectBundledHandles, lockPath, parseExecutaIdOverrides, readExecutasLock, substituteBundledRefs, validateBundledHandles, writeBundleToolIdSidecar, writeExecutasLock } from "./bundled-executas-B6b8gIfp.js";
3
+ import { collectBundledHandles, lockPath, parseExecutaIdOverrides, readExecutasLock, substituteBundledRefs, validateBundledHandles, writeBundleToolIdSidecar, writeExecutasLock } from "./bundled-executas-_H1A9M50.js";
4
4
 
5
5
  export { substituteBundledRefs, writeBundleToolIdSidecar };