@alexkroman1/aai-cli 6.5.0 → 6.5.1

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 (48) hide show
  1. package/dist/{_agent-vGW5SBnX.mjs → _agent-DpH2pBJd.mjs} +1 -5
  2. package/dist/{_bundler-BapCUUJN.mjs → _bundler-C2BDwU7r.mjs} +5 -7
  3. package/dist/{_dev-server-DQ1t9sbw.mjs → _dev-server-LLLWnFBs.mjs} +3 -3
  4. package/dist/_e2e-test-utils.d.ts +17 -17
  5. package/dist/{_init-CpISqoR8.mjs → _init-C57bWAQ8.mjs} +2 -2
  6. package/dist/{_slug-api-D2heILuC.mjs → _slug-api-BxrsJXVI.mjs} +3 -3
  7. package/dist/_slug-api.d.ts +1 -1
  8. package/dist/{_api-client-LgLksMhN.mjs → _studio-U3jhKlA3.mjs} +105 -2
  9. package/dist/_studio.d.ts +11 -0
  10. package/dist/{_templates-iDGjGiPf.mjs → _templates-Dxb_P2Wz.mjs} +1 -1
  11. package/dist/bin.d.mts +2 -0
  12. package/dist/{build-BO1Ni6oJ.mjs → build-Dfza2pRI.mjs} +2 -2
  13. package/dist/cli.mjs +43 -42
  14. package/dist/{client-bundler-B8Q9F8gJ.mjs → client-bundler-BEIqgOtd.mjs} +2 -2
  15. package/dist/client-bundler.mjs +1 -1
  16. package/dist/{delete-4I0uNR4a.mjs → delete-vbpjGzqs.mjs} +3 -3
  17. package/dist/{deploy-DJ3HRcia.mjs → deploy-B8lubiRT.mjs} +3 -4
  18. package/dist/{dev-C6SWaAZP.mjs → dev-Uq5ujP8a.mjs} +1 -1
  19. package/dist/{eject-Zrzk5KV3.mjs → eject-31gjtaHF.mjs} +2 -2
  20. package/dist/{init-BTRGiPQr.mjs → init-l6xfU4xX.mjs} +3 -3
  21. package/dist/{login-k0Z3VQu9.mjs → login-C71-qz8F.mjs} +1 -1
  22. package/dist/scaffold/package.json +3 -3
  23. package/dist/{secret-DzSQx1Ds.mjs → secret-BuMuFR4B.mjs} +2 -2
  24. package/dist/{storage-C-Do0mIA.mjs → storage-DzRZ-eCw.mjs} +2 -2
  25. package/dist/{studio-BGVmCA2G.mjs → studio-BCNUpDgP.mjs} +4 -5
  26. package/dist/templates/retail/resolve.ts +16 -0
  27. package/dist/templates/retail/store.ts +20 -0
  28. package/dist/templates/retail/tools/cancel_pending_order.ts +2 -5
  29. package/dist/templates/retail/tools/exchange_delivered_order_items.ts +2 -5
  30. package/dist/templates/retail/tools/get_order_details.ts +4 -6
  31. package/dist/templates/retail/tools/get_user_details.ts +2 -7
  32. package/dist/templates/retail/tools/modify_pending_order_address.ts +2 -5
  33. package/dist/templates/retail/tools/modify_pending_order_items.ts +2 -5
  34. package/dist/templates/retail/tools/modify_pending_order_payment.ts +2 -5
  35. package/dist/templates/retail/tools/modify_user_address.ts +2 -7
  36. package/dist/templates/retail/tools/return_delivered_order_items.ts +2 -5
  37. package/dist/templates/transcription-workflow/agent.test.ts +2 -3
  38. package/dist/templates/transcription-workflow/workflows/batch.ts +2 -13
  39. package/dist/templates/transcription-workflow/workflows/stream.ts +1 -10
  40. package/dist/templates/transcription-workflow/workflows/sync-api.ts +8 -2
  41. package/dist/templates/transcription-workflow/workflows/transcribe.ts +8 -2
  42. package/dist/{test-B6ZBxSpk.mjs → test-9kPKJI-w.mjs} +1 -3
  43. package/dist/typecheck.mjs +4 -5
  44. package/dist/{worker-bundler-CIdDhZ0c.mjs → worker-bundler-CGD4r8Kc.mjs} +25 -11
  45. package/dist/worker-bundler.mjs +1 -1
  46. package/dist/{workflow-B-O97AqI.mjs → workflow-CFpxOFfQ.mjs} +1 -1
  47. package/package.json +4 -4
  48. package/dist/_studio-zAJycZ8j.mjs +0 -94
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alexkroman1/aai-cli",
3
- "version": "6.5.0",
3
+ "version": "6.5.1",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "aai": "bin.mjs"
@@ -44,8 +44,8 @@
44
44
  "p-timeout": "^7.0.1",
45
45
  "vite": "^8.2.1",
46
46
  "zod": "^4.4.3",
47
- "@alexkroman1/aai": "6.5.0",
48
- "@alexkroman1/aai-ui": "6.5.0"
47
+ "@alexkroman1/aai": "6.5.1",
48
+ "@alexkroman1/aai-ui": "6.5.1"
49
49
  },
50
50
  "devDependencies": {
51
51
  "playwright": "^1.62.1",
@@ -53,7 +53,7 @@
53
53
  "verdaccio": "^6.9.2",
54
54
  "vitest": "^4.1.10",
55
55
  "workflow": "4.8.2",
56
- "aai-templates": "0.3.5"
56
+ "aai-templates": "0.3.6"
57
57
  },
58
58
  "peerDependencies": {
59
59
  "vitest": "^4.1.10"
@@ -1,94 +0,0 @@
1
- #!/usr/bin/env node
2
- import { a as isStringArray, i as checkedResponse, n as apiRequest } from "./_api-client-LgLksMhN.mjs";
3
- import path from "node:path";
4
- import { MAX_SLUG_LENGTH, PREVIEW_SLUG_SUFFIX, VALID_SLUG_RE, isRecord } from "@alexkroman1/aai/utils";
5
- import { slugifyName } from "@alexkroman1/aai/slugify";
6
- import { isLocalOnlyFile, snapshotWorkspaceFiles } from "@alexkroman1/aai/workspace-files";
7
- //#region _studio.ts
8
- /**
9
- * Internals of the studio-workspace commands (`aai list/pull/push/publish`):
10
- * the local source-file walk and the thin clients for the platform's
11
- * `/studio/projects` routes. The workspace is the single source of truth —
12
- * these helpers only move files between a local directory and the project's
13
- * workspace row; production deploys happen exclusively through the studio's
14
- * Publish route (which runs the deploy machinery in the project's sandbox).
15
- */
16
- /**
17
- * Snapshot the local project into a workspace file map.
18
- *
19
- * The walk, the caps, the skip rules and the strict UTF-8 decode all come
20
- * from the SDK (`@alexkroman1/aai/workspace-files`), which is also what the
21
- * guest's end-of-turn sync uses — the two write the same map from opposite
22
- * ends, and a disagreement between them is not an error but a file silently
23
- * dropped here and resurrected there.
24
- *
25
- * `isLocalOnlyFile` is the one rule this side adds: `.env` rides the secret
26
- * routes and lockfiles are install output, so neither belongs in a row.
27
- */
28
- function collectSourceFiles(dir) {
29
- return snapshotWorkspaceFiles(dir, {
30
- subject: "Project",
31
- skipFile: isLocalOnlyFile
32
- });
33
- }
34
- /**
35
- * A studio project name derived from a directory name, or null if unusable.
36
- *
37
- * The normalization is the platform's own (`slugifyName`), not a local
38
- * regex. This used to strip `[^a-z0-9-_]` by hand, which differs from the
39
- * studio's slugifier on exactly the names people give agents: `Café
40
- * Ordering` reduced to `caf-ordering` here and `cafe-ordering` there, so the
41
- * same directory produced a different project depending on whether it was
42
- * created by `aai push` or by typing the name into the studio.
43
- *
44
- * A `-preview` suffix is deliberately unusable. Publishing a project deploys
45
- * it under the project's own name, so a `*-preview` project would claim a
46
- * slug the studio's orphan-preview sweep reaps hourly — deleting the agent,
47
- * its app-database schema, and its secrets on a schedule the user never
48
- * asked for. Refusing the name is recoverable (rename the directory); losing
49
- * a published agent to the reaper is not.
50
- */
51
- function projectNameFromDir(dir) {
52
- const name = slugifyName(path.basename(dir), MAX_SLUG_LENGTH);
53
- if (name.endsWith(PREVIEW_SLUG_SUFFIX)) return null;
54
- return VALID_SLUG_RE.test(name) ? name : null;
55
- }
56
- /** The shareable studio URL for a project — what every command prints. */
57
- function studioProjectUrl(serverUrl, project) {
58
- return `${serverUrl}/studio/chat/${project}`;
59
- }
60
- function listStudioProjects(serverUrl, apiKey) {
61
- return apiRequest(`${serverUrl}/studio/projects`, {
62
- apiKey,
63
- action: "list"
64
- }).then((res) => checkedResponse(res, (value) => isRecord(value) && isStringArray(value.projects), `the studio project list at ${serverUrl}`).projects);
65
- }
66
- /** Fetch a project, or null when it doesn't exist (the push existence probe). */
67
- function fetchStudioProject(serverUrl, apiKey, project) {
68
- return apiRequest(`${serverUrl}/studio/projects/${encodeURIComponent(project)}`, {
69
- apiKey,
70
- action: "pull",
71
- allow404: true
72
- });
73
- }
74
- /** `PUT /studio/projects/:project/source` — the atomic whole-tree push. */
75
- function pushStudioSource(serverUrl, apiKey, project, body) {
76
- return apiRequest(`${serverUrl}/studio/projects/${encodeURIComponent(project)}/source`, {
77
- apiKey,
78
- action: "push",
79
- method: "PUT",
80
- body,
81
- hints: { 409: "The studio has newer changes. Run `aai pull` to fetch them, or `aai push --force` to overwrite." }
82
- });
83
- }
84
- /** `POST /studio/projects/:project/deploy` — Publish, in the project's sandbox. */
85
- function publishStudioProject(serverUrl, apiKey, project) {
86
- return apiRequest(`${serverUrl}/studio/projects/${encodeURIComponent(project)}/deploy`, {
87
- apiKey,
88
- action: "publish",
89
- method: "POST",
90
- retry: 0
91
- });
92
- }
93
- //#endregion
94
- export { publishStudioProject as a, projectNameFromDir as i, fetchStudioProject as n, pushStudioSource as o, listStudioProjects as r, studioProjectUrl as s, collectSourceFiles as t };