@alexkroman1/aai-cli 0.9.0

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 (58) hide show
  1. package/LICENSE +21 -0
  2. package/dist/_build-p1HHkdon.mjs +132 -0
  3. package/dist/_discover-BzlCDVZ6.mjs +161 -0
  4. package/dist/_init-l_uoyFCN.mjs +82 -0
  5. package/dist/_link-BGXGFYWa.mjs +47 -0
  6. package/dist/_server-common-qLA1QU2C.mjs +36 -0
  7. package/dist/_ui-kJIua5L9.mjs +44 -0
  8. package/dist/cli.mjs +318 -0
  9. package/dist/deploy-KyNJaoP5.mjs +86 -0
  10. package/dist/dev-DBFvKyzk.mjs +39 -0
  11. package/dist/init-BWG5OrQa.mjs +65 -0
  12. package/dist/rag-BnCMnccf.mjs +173 -0
  13. package/dist/secret-CzeHIGzE.mjs +50 -0
  14. package/dist/start-C1qkhU4O.mjs +23 -0
  15. package/package.json +39 -0
  16. package/templates/_shared/.env.example +5 -0
  17. package/templates/_shared/CLAUDE.md +1051 -0
  18. package/templates/_shared/biome.json +32 -0
  19. package/templates/_shared/global.d.ts +1 -0
  20. package/templates/_shared/index.html +16 -0
  21. package/templates/_shared/package.json +23 -0
  22. package/templates/_shared/tsconfig.json +15 -0
  23. package/templates/code-interpreter/agent.ts +27 -0
  24. package/templates/code-interpreter/client.tsx +3 -0
  25. package/templates/css.d.ts +1 -0
  26. package/templates/dispatch-center/agent.ts +1227 -0
  27. package/templates/dispatch-center/client.tsx +505 -0
  28. package/templates/embedded-assets/agent.ts +48 -0
  29. package/templates/embedded-assets/client.tsx +3 -0
  30. package/templates/embedded-assets/knowledge.json +20 -0
  31. package/templates/health-assistant/agent.ts +160 -0
  32. package/templates/health-assistant/client.tsx +3 -0
  33. package/templates/infocom-adventure/agent.ts +164 -0
  34. package/templates/infocom-adventure/client.tsx +300 -0
  35. package/templates/math-buddy/agent.ts +21 -0
  36. package/templates/math-buddy/client.tsx +3 -0
  37. package/templates/memory-agent/agent.ts +20 -0
  38. package/templates/memory-agent/client.tsx +3 -0
  39. package/templates/night-owl/agent.ts +98 -0
  40. package/templates/night-owl/client.tsx +12 -0
  41. package/templates/personal-finance/agent.ts +26 -0
  42. package/templates/personal-finance/client.tsx +3 -0
  43. package/templates/pizza-ordering/agent.ts +218 -0
  44. package/templates/pizza-ordering/client.tsx +264 -0
  45. package/templates/simple/agent.ts +6 -0
  46. package/templates/simple/client.tsx +3 -0
  47. package/templates/smart-research/agent.ts +164 -0
  48. package/templates/smart-research/client.tsx +3 -0
  49. package/templates/solo-rpg/agent.ts +1244 -0
  50. package/templates/solo-rpg/client.tsx +698 -0
  51. package/templates/support/README.md +62 -0
  52. package/templates/support/agent.ts +19 -0
  53. package/templates/support/client.tsx +3 -0
  54. package/templates/travel-concierge/agent.ts +29 -0
  55. package/templates/travel-concierge/client.tsx +3 -0
  56. package/templates/tsconfig.json +1 -0
  57. package/templates/web-researcher/agent.ts +17 -0
  58. package/templates/web-researcher/client.tsx +3 -0
@@ -0,0 +1,50 @@
1
+ #!/usr/bin/env node
2
+ import { d as askPassword, i as getServerInfo } from "./_discover-BzlCDVZ6.mjs";
3
+ import { a as step, i as runCommand, o as stepInfo, t as detail } from "./_ui-kJIua5L9.mjs";
4
+ //#region secret.ts
5
+ async function apiFetch(cwd, pathSuffix, init) {
6
+ const { serverUrl, slug, apiKey } = await getServerInfo(cwd);
7
+ const resp = await fetch(`${serverUrl}/${slug}/secret${pathSuffix}`, {
8
+ ...init,
9
+ headers: {
10
+ Authorization: `Bearer ${apiKey}`,
11
+ ...init?.headers
12
+ }
13
+ });
14
+ if (!resp.ok) {
15
+ const text = await resp.text();
16
+ throw new Error(`Secret operation failed: ${text}`);
17
+ }
18
+ return {
19
+ resp,
20
+ slug
21
+ };
22
+ }
23
+ async function runSecretPut(cwd, name) {
24
+ const value = await askPassword(`Enter value for ${name}`);
25
+ if (!value) throw new Error("No value provided");
26
+ await runCommand(async ({ log }) => {
27
+ const { slug } = await apiFetch(cwd, "", {
28
+ method: "PUT",
29
+ headers: { "Content-Type": "application/json" },
30
+ body: JSON.stringify({ [name]: value })
31
+ });
32
+ log(step("Set", `${name} for ${slug}`));
33
+ });
34
+ }
35
+ async function runSecretDelete(cwd, name) {
36
+ await runCommand(async ({ log }) => {
37
+ const { slug } = await apiFetch(cwd, `/${name}`, { method: "DELETE" });
38
+ log(step("Deleted", `${name} from ${slug}`));
39
+ });
40
+ }
41
+ async function runSecretList(cwd) {
42
+ await runCommand(async ({ log }) => {
43
+ const { resp } = await apiFetch(cwd, "");
44
+ const { vars } = await resp.json();
45
+ if (vars.length === 0) log(stepInfo("Secrets", "none set"));
46
+ else for (const name of vars) log(detail(name));
47
+ });
48
+ }
49
+ //#endregion
50
+ export { runSecretDelete, runSecretList, runSecretPut };
@@ -0,0 +1,23 @@
1
+ #!/usr/bin/env node
2
+ import { t as fileExists } from "./_discover-BzlCDVZ6.mjs";
3
+ import { a as step, i as runCommand } from "./_ui-kJIua5L9.mjs";
4
+ import { n as loadAgentDef, r as resolveServerEnv, t as bootServer } from "./_server-common-qLA1QU2C.mjs";
5
+ import path from "node:path";
6
+ //#region start.ts
7
+ async function _startProductionServer(cwd, port, log) {
8
+ const clientDir = path.join(cwd, ".aai", "client");
9
+ log(step("Start", "loading agent"));
10
+ await bootServer(await loadAgentDef(cwd), clientDir, await resolveServerEnv(), port);
11
+ log(step("Ready", `http://localhost:${port}`));
12
+ }
13
+ async function runStartCommand(opts) {
14
+ const port = Number.parseInt(opts.port, 10);
15
+ const buildDir = path.join(opts.cwd, ".aai", "build");
16
+ if (!await fileExists(path.join(buildDir, "worker.js"))) throw new Error("No build found — run `aai build` first");
17
+ await runCommand(async ({ log }) => {
18
+ log(step("Start", `production server on port ${port}`));
19
+ await _startProductionServer(opts.cwd, port, log);
20
+ });
21
+ }
22
+ //#endregion
23
+ export { runStartCommand };
package/package.json ADDED
@@ -0,0 +1,39 @@
1
+ {
2
+ "name": "@alexkroman1/aai-cli",
3
+ "version": "0.9.0",
4
+ "type": "module",
5
+ "bin": {
6
+ "aai": "dist/cli.mjs"
7
+ },
8
+ "files": [
9
+ "dist",
10
+ "templates"
11
+ ],
12
+ "dependencies": {
13
+ "@chonkiejs/core": "^0.0.8",
14
+ "@clack/prompts": "^1.1.0",
15
+ "@preact/preset-vite": "^2.10.5",
16
+ "@tailwindcss/vite": "^4.2.2",
17
+ "citty": "^0.2.1",
18
+ "human-id": "^4.1.3",
19
+ "p-limit": "^7.3.0",
20
+ "picocolors": "^1.1.1",
21
+ "vite": "^8.0.2",
22
+ "zod": "^4.3.6",
23
+ "@alexkroman1/aai": "0.9.0"
24
+ },
25
+ "devDependencies": {
26
+ "playwright": "^1.58.2",
27
+ "tsdown": "^0.21.4"
28
+ },
29
+ "engines": {
30
+ "node": ">=22.6"
31
+ },
32
+ "scripts": {
33
+ "build": "tsdown",
34
+ "typecheck": "tsc --noEmit",
35
+ "lint": "biome check .",
36
+ "test:integration": "vitest run pack-build.test.ts -c vitest.slow.config.ts",
37
+ "test:e2e": "vitest run e2e.test.ts -c vitest.slow.config.ts"
38
+ }
39
+ }
@@ -0,0 +1,5 @@
1
+ # Set secrets on the server with: aai env add <NAME>
2
+ # Pull secret names here for local reference: aai env pull
3
+ #
4
+ # ASSEMBLYAI_API_KEY is managed globally by the CLI (~/.config/aai/).
5
+ # Add any additional secrets your agent needs below: