@agentuity/cli 2.0.10 → 3.0.0-alpha.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.
- package/dist/cmd/ai/prompt/index.d.ts.map +1 -1
- package/dist/cmd/ai/prompt/index.js +2 -7
- package/dist/cmd/ai/prompt/index.js.map +1 -1
- package/dist/cmd/build/adapters/generic.d.ts +29 -0
- package/dist/cmd/build/adapters/generic.d.ts.map +1 -0
- package/dist/cmd/build/adapters/generic.js +190 -0
- package/dist/cmd/build/adapters/generic.js.map +1 -0
- package/dist/cmd/build/adapters/index.d.ts +15 -0
- package/dist/cmd/build/adapters/index.d.ts.map +1 -0
- package/dist/cmd/build/adapters/index.js +24 -0
- package/dist/cmd/build/adapters/index.js.map +1 -0
- package/dist/cmd/build/adapters/nextjs.d.ts +11 -0
- package/dist/cmd/build/adapters/nextjs.d.ts.map +1 -0
- package/dist/cmd/build/adapters/nextjs.js +118 -0
- package/dist/cmd/build/adapters/nextjs.js.map +1 -0
- package/dist/cmd/build/adapters/static-server.d.ts +23 -0
- package/dist/cmd/build/adapters/static-server.d.ts.map +1 -0
- package/dist/cmd/build/adapters/static-server.js +137 -0
- package/dist/cmd/build/adapters/static-server.js.map +1 -0
- package/dist/cmd/build/adapters/types.d.ts +71 -0
- package/dist/cmd/build/adapters/types.d.ts.map +1 -0
- package/dist/cmd/build/adapters/types.js +8 -0
- package/dist/cmd/build/adapters/types.js.map +1 -0
- package/dist/cmd/build/detect/engine.d.ts +24 -0
- package/dist/cmd/build/detect/engine.d.ts.map +1 -0
- package/dist/cmd/build/detect/engine.js +91 -0
- package/dist/cmd/build/detect/engine.js.map +1 -0
- package/dist/cmd/build/detect/frameworks.d.ts +66 -0
- package/dist/cmd/build/detect/frameworks.d.ts.map +1 -0
- package/dist/cmd/build/detect/frameworks.js +278 -0
- package/dist/cmd/build/detect/frameworks.js.map +1 -0
- package/dist/cmd/build/detect/generic.d.ts +13 -0
- package/dist/cmd/build/detect/generic.d.ts.map +1 -0
- package/dist/cmd/build/detect/generic.js +62 -0
- package/dist/cmd/build/detect/generic.js.map +1 -0
- package/dist/cmd/build/detect/index.d.ts +27 -0
- package/dist/cmd/build/detect/index.d.ts.map +1 -0
- package/dist/cmd/build/detect/index.js +76 -0
- package/dist/cmd/build/detect/index.js.map +1 -0
- package/dist/cmd/build/detect/types.d.ts +91 -0
- package/dist/cmd/build/detect/types.d.ts.map +1 -0
- package/dist/cmd/build/detect/types.js +9 -0
- package/dist/cmd/build/detect/types.js.map +1 -0
- package/dist/cmd/build/detect/util.d.ts +41 -0
- package/dist/cmd/build/detect/util.d.ts.map +1 -0
- package/dist/cmd/build/detect/util.js +101 -0
- package/dist/cmd/build/detect/util.js.map +1 -0
- package/dist/cmd/build/index.d.ts.map +1 -1
- package/dist/cmd/build/index.js +49 -22
- package/dist/cmd/build/index.js.map +1 -1
- package/dist/cmd/build/package/index.d.ts +30 -0
- package/dist/cmd/build/package/index.d.ts.map +1 -0
- package/dist/cmd/build/package/index.js +39 -0
- package/dist/cmd/build/package/index.js.map +1 -0
- package/dist/cmd/build/package/launch.d.ts +56 -0
- package/dist/cmd/build/package/launch.d.ts.map +1 -0
- package/dist/cmd/build/package/launch.js +56 -0
- package/dist/cmd/build/package/launch.js.map +1 -0
- package/dist/cmd/build/typecheck.d.ts.map +1 -1
- package/dist/cmd/build/typecheck.js +8 -0
- package/dist/cmd/build/typecheck.js.map +1 -1
- package/dist/cmd/cloud/deploy.d.ts.map +1 -1
- package/dist/cmd/cloud/deploy.js +63 -13
- package/dist/cmd/cloud/deploy.js.map +1 -1
- package/dist/cmd/coder/create.d.ts.map +1 -1
- package/dist/cmd/coder/create.js +18 -0
- package/dist/cmd/coder/create.js.map +1 -1
- package/dist/cmd/coder/index.d.ts.map +1 -1
- package/dist/cmd/coder/index.js +4 -0
- package/dist/cmd/coder/index.js.map +1 -1
- package/dist/cmd/coder/start.d.ts.map +1 -1
- package/dist/cmd/coder/start.js +49 -1
- package/dist/cmd/coder/start.js.map +1 -1
- package/dist/cmd/coder/update.d.ts.map +1 -1
- package/dist/cmd/coder/update.js +21 -1
- package/dist/cmd/coder/update.js.map +1 -1
- package/dist/cmd/coder/workspace/create.d.ts.map +1 -1
- package/dist/cmd/coder/workspace/create.js +17 -1
- package/dist/cmd/coder/workspace/create.js.map +1 -1
- package/dist/cmd/coder/workspace/list.js +2 -2
- package/dist/cmd/coder/workspace/list.js.map +1 -1
- package/dist/cmd/dev/index.d.ts +9 -0
- package/dist/cmd/dev/index.d.ts.map +1 -1
- package/dist/cmd/dev/index.js +127 -923
- package/dist/cmd/dev/index.js.map +1 -1
- package/dist/cmd/project/auth/shared.d.ts.map +1 -1
- package/dist/cmd/project/auth/shared.js +14 -38
- package/dist/cmd/project/auth/shared.js.map +1 -1
- package/dist/cmd/project/create.d.ts.map +1 -1
- package/dist/cmd/project/create.js +12 -19
- package/dist/cmd/project/create.js.map +1 -1
- package/dist/cmd/project/frameworks-ai-examples.d.ts +15 -0
- package/dist/cmd/project/frameworks-ai-examples.d.ts.map +1 -0
- package/dist/cmd/project/frameworks-ai-examples.js +160 -0
- package/dist/cmd/project/frameworks-ai-examples.js.map +1 -0
- package/dist/cmd/project/frameworks-landing-pages.d.ts +17 -0
- package/dist/cmd/project/frameworks-landing-pages.d.ts.map +1 -0
- package/dist/cmd/project/frameworks-landing-pages.js +242 -0
- package/dist/cmd/project/frameworks-landing-pages.js.map +1 -0
- package/dist/cmd/project/frameworks.d.ts +58 -0
- package/dist/cmd/project/frameworks.d.ts.map +1 -0
- package/dist/cmd/project/frameworks.js +152 -0
- package/dist/cmd/project/frameworks.js.map +1 -0
- package/dist/cmd/project/reconcile.d.ts.map +1 -1
- package/dist/cmd/project/reconcile.js +10 -23
- package/dist/cmd/project/reconcile.js.map +1 -1
- package/dist/cmd/project/remote-import.js +1 -1
- package/dist/cmd/project/scaffold.d.ts +58 -0
- package/dist/cmd/project/scaffold.d.ts.map +1 -0
- package/dist/cmd/project/scaffold.js +223 -0
- package/dist/cmd/project/scaffold.js.map +1 -0
- package/dist/cmd/project/template-flow.d.ts +8 -4
- package/dist/cmd/project/template-flow.d.ts.map +1 -1
- package/dist/cmd/project/template-flow.js +93 -144
- package/dist/cmd/project/template-flow.js.map +1 -1
- package/dist/deploy-metadata.d.ts +49 -0
- package/dist/deploy-metadata.d.ts.map +1 -0
- package/dist/deploy-metadata.js +183 -0
- package/dist/deploy-metadata.js.map +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/types.d.ts +25 -31
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/package.json +13 -8
- package/src/cmd/ai/prompt/index.ts +2 -7
- package/src/cmd/build/adapters/generic.ts +239 -0
- package/src/cmd/build/adapters/index.ts +30 -0
- package/src/cmd/build/adapters/nextjs.ts +146 -0
- package/src/cmd/build/adapters/static-server.ts +143 -0
- package/src/cmd/build/adapters/types.ts +93 -0
- package/src/cmd/build/detect/engine.ts +111 -0
- package/src/cmd/build/detect/frameworks.ts +335 -0
- package/src/cmd/build/detect/generic.ts +71 -0
- package/src/cmd/build/detect/index.ts +122 -0
- package/src/cmd/build/detect/types.ts +109 -0
- package/src/cmd/build/detect/util.ts +104 -0
- package/src/cmd/build/index.ts +64 -24
- package/src/cmd/build/package/index.ts +66 -0
- package/src/cmd/build/package/launch.ts +104 -0
- package/src/cmd/build/typecheck.ts +9 -0
- package/src/cmd/cloud/deploy.ts +86 -13
- package/src/cmd/coder/create.ts +24 -1
- package/src/cmd/coder/index.ts +4 -0
- package/src/cmd/coder/start.ts +60 -1
- package/src/cmd/coder/update.ts +18 -1
- package/src/cmd/coder/workspace/create.ts +20 -2
- package/src/cmd/coder/workspace/list.ts +2 -2
- package/src/cmd/dev/index.ts +155 -1059
- package/src/cmd/project/auth/shared.ts +14 -39
- package/src/cmd/project/create.ts +14 -19
- package/src/cmd/project/frameworks-ai-examples.ts +166 -0
- package/src/cmd/project/frameworks-landing-pages.ts +267 -0
- package/src/cmd/project/frameworks.ts +223 -0
- package/src/cmd/project/reconcile.ts +10 -22
- package/src/cmd/project/remote-import.ts +1 -1
- package/src/cmd/project/scaffold.ts +300 -0
- package/src/cmd/project/template-flow.ts +102 -156
- package/src/deploy-metadata.ts +253 -0
- package/src/index.ts +0 -2
- package/src/types.ts +0 -31
- package/dist/agents-docs.d.ts +0 -23
- package/dist/agents-docs.d.ts.map +0 -1
- package/dist/agents-docs.js +0 -56
- package/dist/agents-docs.js.map +0 -1
- package/dist/cmd/ai/prompt/agent.d.ts +0 -10
- package/dist/cmd/ai/prompt/agent.d.ts.map +0 -1
- package/dist/cmd/ai/prompt/agent.js +0 -28
- package/dist/cmd/ai/prompt/agent.js.map +0 -1
- package/dist/cmd/build/app-router-detector.d.ts +0 -39
- package/dist/cmd/build/app-router-detector.d.ts.map +0 -1
- package/dist/cmd/build/app-router-detector.js +0 -229
- package/dist/cmd/build/app-router-detector.js.map +0 -1
- package/dist/cmd/build/format-schema.d.ts +0 -6
- package/dist/cmd/build/format-schema.d.ts.map +0 -1
- package/dist/cmd/build/format-schema.js +0 -60
- package/dist/cmd/build/format-schema.js.map +0 -1
- package/dist/cmd/build/vite/agent-discovery.d.ts +0 -37
- package/dist/cmd/build/vite/agent-discovery.d.ts.map +0 -1
- package/dist/cmd/build/vite/agent-discovery.js +0 -263
- package/dist/cmd/build/vite/agent-discovery.js.map +0 -1
- package/dist/cmd/build/vite/beacon-plugin.d.ts +0 -19
- package/dist/cmd/build/vite/beacon-plugin.d.ts.map +0 -1
- package/dist/cmd/build/vite/beacon-plugin.js +0 -137
- package/dist/cmd/build/vite/beacon-plugin.js.map +0 -1
- package/dist/cmd/build/vite/browser-env-plugin.d.ts +0 -9
- package/dist/cmd/build/vite/browser-env-plugin.d.ts.map +0 -1
- package/dist/cmd/build/vite/browser-env-plugin.js +0 -28
- package/dist/cmd/build/vite/browser-env-plugin.js.map +0 -1
- package/dist/cmd/build/vite/bun-dev-server.d.ts +0 -67
- package/dist/cmd/build/vite/bun-dev-server.d.ts.map +0 -1
- package/dist/cmd/build/vite/bun-dev-server.js +0 -340
- package/dist/cmd/build/vite/bun-dev-server.js.map +0 -1
- package/dist/cmd/build/vite/bundle-files.d.ts +0 -12
- package/dist/cmd/build/vite/bundle-files.d.ts.map +0 -1
- package/dist/cmd/build/vite/bundle-files.js +0 -107
- package/dist/cmd/build/vite/bundle-files.js.map +0 -1
- package/dist/cmd/build/vite/config-loader.d.ts +0 -29
- package/dist/cmd/build/vite/config-loader.d.ts.map +0 -1
- package/dist/cmd/build/vite/config-loader.js +0 -57
- package/dist/cmd/build/vite/config-loader.js.map +0 -1
- package/dist/cmd/build/vite/db-rewrite.d.ts +0 -50
- package/dist/cmd/build/vite/db-rewrite.d.ts.map +0 -1
- package/dist/cmd/build/vite/db-rewrite.js +0 -169
- package/dist/cmd/build/vite/db-rewrite.js.map +0 -1
- package/dist/cmd/build/vite/docs-generator.d.ts +0 -13
- package/dist/cmd/build/vite/docs-generator.d.ts.map +0 -1
- package/dist/cmd/build/vite/docs-generator.js +0 -97
- package/dist/cmd/build/vite/docs-generator.js.map +0 -1
- package/dist/cmd/build/vite/env-types-generator.d.ts +0 -26
- package/dist/cmd/build/vite/env-types-generator.d.ts.map +0 -1
- package/dist/cmd/build/vite/env-types-generator.js +0 -110
- package/dist/cmd/build/vite/env-types-generator.js.map +0 -1
- package/dist/cmd/build/vite/index.d.ts +0 -3
- package/dist/cmd/build/vite/index.d.ts.map +0 -1
- package/dist/cmd/build/vite/index.js +0 -4
- package/dist/cmd/build/vite/index.js.map +0 -1
- package/dist/cmd/build/vite/lifecycle-generator.d.ts +0 -19
- package/dist/cmd/build/vite/lifecycle-generator.d.ts.map +0 -1
- package/dist/cmd/build/vite/lifecycle-generator.js +0 -328
- package/dist/cmd/build/vite/lifecycle-generator.js.map +0 -1
- package/dist/cmd/build/vite/metadata-generator.d.ts +0 -36
- package/dist/cmd/build/vite/metadata-generator.d.ts.map +0 -1
- package/dist/cmd/build/vite/metadata-generator.js +0 -575
- package/dist/cmd/build/vite/metadata-generator.js.map +0 -1
- package/dist/cmd/build/vite/prompt-generator.d.ts +0 -23
- package/dist/cmd/build/vite/prompt-generator.d.ts.map +0 -1
- package/dist/cmd/build/vite/prompt-generator.js +0 -123
- package/dist/cmd/build/vite/prompt-generator.js.map +0 -1
- package/dist/cmd/build/vite/public-asset-path-plugin.d.ts +0 -45
- package/dist/cmd/build/vite/public-asset-path-plugin.d.ts.map +0 -1
- package/dist/cmd/build/vite/public-asset-path-plugin.js +0 -166
- package/dist/cmd/build/vite/public-asset-path-plugin.js.map +0 -1
- package/dist/cmd/build/vite/route-discovery.d.ts +0 -64
- package/dist/cmd/build/vite/route-discovery.d.ts.map +0 -1
- package/dist/cmd/build/vite/route-discovery.js +0 -187
- package/dist/cmd/build/vite/route-discovery.js.map +0 -1
- package/dist/cmd/build/vite/server-bundler.d.ts +0 -20
- package/dist/cmd/build/vite/server-bundler.d.ts.map +0 -1
- package/dist/cmd/build/vite/server-bundler.js +0 -388
- package/dist/cmd/build/vite/server-bundler.js.map +0 -1
- package/dist/cmd/build/vite/static-renderer.d.ts +0 -26
- package/dist/cmd/build/vite/static-renderer.d.ts.map +0 -1
- package/dist/cmd/build/vite/static-renderer.js +0 -188
- package/dist/cmd/build/vite/static-renderer.js.map +0 -1
- package/dist/cmd/build/vite/tailwind-source-plugin.d.ts +0 -15
- package/dist/cmd/build/vite/tailwind-source-plugin.d.ts.map +0 -1
- package/dist/cmd/build/vite/tailwind-source-plugin.js +0 -61
- package/dist/cmd/build/vite/tailwind-source-plugin.js.map +0 -1
- package/dist/cmd/build/vite/vite-asset-server-config.d.ts +0 -24
- package/dist/cmd/build/vite/vite-asset-server-config.d.ts.map +0 -1
- package/dist/cmd/build/vite/vite-asset-server-config.js +0 -285
- package/dist/cmd/build/vite/vite-asset-server-config.js.map +0 -1
- package/dist/cmd/build/vite/vite-asset-server.d.ts +0 -30
- package/dist/cmd/build/vite/vite-asset-server.d.ts.map +0 -1
- package/dist/cmd/build/vite/vite-asset-server.js +0 -109
- package/dist/cmd/build/vite/vite-asset-server.js.map +0 -1
- package/dist/cmd/build/vite/vite-builder.d.ts +0 -59
- package/dist/cmd/build/vite/vite-builder.d.ts.map +0 -1
- package/dist/cmd/build/vite/vite-builder.js +0 -401
- package/dist/cmd/build/vite/vite-builder.js.map +0 -1
- package/dist/cmd/build/vite/workbench-generator.d.ts +0 -10
- package/dist/cmd/build/vite/workbench-generator.d.ts.map +0 -1
- package/dist/cmd/build/vite/workbench-generator.js +0 -135
- package/dist/cmd/build/vite/workbench-generator.js.map +0 -1
- package/dist/cmd/build/vite/ws-proxy.d.ts +0 -53
- package/dist/cmd/build/vite/ws-proxy.d.ts.map +0 -1
- package/dist/cmd/build/vite/ws-proxy.js +0 -95
- package/dist/cmd/build/vite/ws-proxy.js.map +0 -1
- package/dist/cmd/build/vite-bundler.d.ts +0 -29
- package/dist/cmd/build/vite-bundler.d.ts.map +0 -1
- package/dist/cmd/build/vite-bundler.js +0 -93
- package/dist/cmd/build/vite-bundler.js.map +0 -1
- package/dist/cmd/dev/agents.d.ts +0 -2
- package/dist/cmd/dev/agents.d.ts.map +0 -1
- package/dist/cmd/dev/agents.js +0 -123
- package/dist/cmd/dev/agents.js.map +0 -1
- package/dist/cmd/dev/api.d.ts +0 -20
- package/dist/cmd/dev/api.d.ts.map +0 -1
- package/dist/cmd/dev/api.js +0 -42
- package/dist/cmd/dev/api.js.map +0 -1
- package/dist/cmd/dev/dev-lock.d.ts +0 -62
- package/dist/cmd/dev/dev-lock.d.ts.map +0 -1
- package/dist/cmd/dev/dev-lock.js +0 -250
- package/dist/cmd/dev/dev-lock.js.map +0 -1
- package/dist/cmd/dev/download.d.ts +0 -11
- package/dist/cmd/dev/download.d.ts.map +0 -1
- package/dist/cmd/dev/download.js +0 -94
- package/dist/cmd/dev/download.js.map +0 -1
- package/dist/cmd/dev/file-watcher.d.ts +0 -24
- package/dist/cmd/dev/file-watcher.d.ts.map +0 -1
- package/dist/cmd/dev/file-watcher.js +0 -349
- package/dist/cmd/dev/file-watcher.js.map +0 -1
- package/dist/cmd/dev/process-manager.d.ts +0 -104
- package/dist/cmd/dev/process-manager.d.ts.map +0 -1
- package/dist/cmd/dev/process-manager.js +0 -204
- package/dist/cmd/dev/process-manager.js.map +0 -1
- package/dist/cmd/dev/sync.d.ts +0 -12
- package/dist/cmd/dev/sync.d.ts.map +0 -1
- package/dist/cmd/dev/sync.js +0 -227
- package/dist/cmd/dev/sync.js.map +0 -1
- package/dist/cmd/dev/templates.d.ts +0 -3
- package/dist/cmd/dev/templates.d.ts.map +0 -1
- package/dist/cmd/dev/templates.js +0 -58
- package/dist/cmd/dev/templates.js.map +0 -1
- package/dist/cmd/project/download.d.ts +0 -35
- package/dist/cmd/project/download.d.ts.map +0 -1
- package/dist/cmd/project/download.js +0 -403
- package/dist/cmd/project/download.js.map +0 -1
- package/dist/cmd/project/templates.d.ts +0 -9
- package/dist/cmd/project/templates.d.ts.map +0 -1
- package/dist/cmd/project/templates.js +0 -34
- package/dist/cmd/project/templates.js.map +0 -1
- package/src/agents-docs.ts +0 -86
- package/src/cmd/ai/prompt/agent.md +0 -305
- package/src/cmd/ai/prompt/agent.ts +0 -31
- package/src/cmd/build/app-router-detector.ts +0 -320
- package/src/cmd/build/format-schema.ts +0 -66
- package/src/cmd/build/vite/agent-discovery.ts +0 -380
- package/src/cmd/build/vite/beacon-plugin.ts +0 -164
- package/src/cmd/build/vite/browser-env-plugin.ts +0 -34
- package/src/cmd/build/vite/bun-dev-server.ts +0 -458
- package/src/cmd/build/vite/bundle-files.ts +0 -135
- package/src/cmd/build/vite/config-loader.ts +0 -76
- package/src/cmd/build/vite/db-rewrite.ts +0 -189
- package/src/cmd/build/vite/docs-generator.ts +0 -103
- package/src/cmd/build/vite/env-types-generator.ts +0 -145
- package/src/cmd/build/vite/index.ts +0 -3
- package/src/cmd/build/vite/lifecycle-generator.ts +0 -381
- package/src/cmd/build/vite/metadata-generator.ts +0 -713
- package/src/cmd/build/vite/prompt-generator.ts +0 -169
- package/src/cmd/build/vite/public-asset-path-plugin.ts +0 -209
- package/src/cmd/build/vite/route-discovery.ts +0 -271
- package/src/cmd/build/vite/server-bundler.ts +0 -481
- package/src/cmd/build/vite/static-renderer.ts +0 -239
- package/src/cmd/build/vite/tailwind-source-plugin.ts +0 -73
- package/src/cmd/build/vite/vite-asset-server-config.ts +0 -349
- package/src/cmd/build/vite/vite-asset-server.ts +0 -154
- package/src/cmd/build/vite/vite-builder.ts +0 -503
- package/src/cmd/build/vite/workbench-generator.ts +0 -152
- package/src/cmd/build/vite/ws-proxy.ts +0 -126
- package/src/cmd/build/vite-bundler.ts +0 -137
- package/src/cmd/dev/agents.ts +0 -140
- package/src/cmd/dev/api.ts +0 -65
- package/src/cmd/dev/dev-lock.ts +0 -332
- package/src/cmd/dev/download.ts +0 -117
- package/src/cmd/dev/file-watcher.ts +0 -423
- package/src/cmd/dev/process-manager.ts +0 -261
- package/src/cmd/dev/sync.ts +0 -411
- package/src/cmd/dev/templates.ts +0 -66
- package/src/cmd/project/download.ts +0 -505
- package/src/cmd/project/templates.ts +0 -56
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agentuity/cli",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0-alpha.0",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"author": "Agentuity employees and contributors",
|
|
6
6
|
"type": "module",
|
|
@@ -41,11 +41,11 @@
|
|
|
41
41
|
"prepublishOnly": "bun run clean && bun run build"
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@agentuity/auth": "
|
|
45
|
-
"@agentuity/coder-tui": "
|
|
46
|
-
"@agentuity/core": "
|
|
47
|
-
"@agentuity/frontend": "
|
|
48
|
-
"@agentuity/server": "
|
|
44
|
+
"@agentuity/auth": "3.0.0-alpha.0",
|
|
45
|
+
"@agentuity/coder-tui": "3.0.0-alpha.0",
|
|
46
|
+
"@agentuity/core": "3.0.0-alpha.0",
|
|
47
|
+
"@agentuity/frontend": "3.0.0-alpha.0",
|
|
48
|
+
"@agentuity/server": "3.0.0-alpha.0",
|
|
49
49
|
"@datasert/cronjs-parser": "^1.4.0",
|
|
50
50
|
"@vitejs/plugin-react": "^5.1.2",
|
|
51
51
|
"acorn-loose": "^8.5.2",
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
"zod": "^4.3.5"
|
|
65
65
|
},
|
|
66
66
|
"devDependencies": {
|
|
67
|
-
"@agentuity/test-utils": "
|
|
67
|
+
"@agentuity/test-utils": "3.0.0-alpha.0",
|
|
68
68
|
"@types/adm-zip": "^0.5.7",
|
|
69
69
|
"@types/archiver": "^7.0.0",
|
|
70
70
|
"@types/bun": "latest",
|
|
@@ -77,5 +77,10 @@
|
|
|
77
77
|
"publishConfig": {
|
|
78
78
|
"access": "public"
|
|
79
79
|
},
|
|
80
|
-
"sideEffects": false
|
|
80
|
+
"sideEffects": false,
|
|
81
|
+
"repository": {
|
|
82
|
+
"type": "git",
|
|
83
|
+
"url": "https://github.com/agentuity/sdk.git",
|
|
84
|
+
"directory": "packages/cli"
|
|
85
|
+
}
|
|
81
86
|
}
|
|
@@ -1,27 +1,22 @@
|
|
|
1
1
|
import { createCommand } from '../../../types';
|
|
2
2
|
import { llmSubcommand } from './llm';
|
|
3
3
|
import { apiSubcommand } from './api';
|
|
4
|
-
import { agentSubcommand } from './agent';
|
|
5
4
|
import { webSubcommand } from './web';
|
|
6
5
|
import { getCommand } from '../../../command-prefix';
|
|
7
6
|
|
|
8
7
|
export const promptCommand = createCommand({
|
|
9
8
|
name: 'prompt',
|
|
10
|
-
description: 'Generate prompts for LLMs
|
|
9
|
+
description: 'Generate prompts for LLMs',
|
|
11
10
|
tags: ['read-only', 'fast'],
|
|
12
11
|
examples: [
|
|
13
12
|
{ command: getCommand('ai prompt llm'), description: 'Generate LLM-specific prompt' },
|
|
14
|
-
{
|
|
15
|
-
command: getCommand('ai prompt agent'),
|
|
16
|
-
description: 'Generate LLM-specific prompt for Agents',
|
|
17
|
-
},
|
|
18
13
|
{
|
|
19
14
|
command: getCommand('ai prompt api'),
|
|
20
15
|
description: 'Generate LLM-specific prompt for APIs',
|
|
21
16
|
},
|
|
22
17
|
{ command: getCommand('ai prompt web'), description: 'Generate LLM-specific prompt for Web' },
|
|
23
18
|
],
|
|
24
|
-
subcommands: [
|
|
19
|
+
subcommands: [webSubcommand, llmSubcommand, apiSubcommand],
|
|
25
20
|
});
|
|
26
21
|
|
|
27
22
|
export default promptCommand;
|
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generic build adapter.
|
|
3
|
+
*
|
|
4
|
+
* Handles any JS framework by:
|
|
5
|
+
* 1. Installing dependencies
|
|
6
|
+
* 2. Running the project's build script
|
|
7
|
+
* 3. Copying the build output to the output directory
|
|
8
|
+
*
|
|
9
|
+
* This is the fallback for frameworks without a specific adapter,
|
|
10
|
+
* and is also the base logic that specific adapters build on.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
import { basename, join, resolve, relative } from 'node:path';
|
|
14
|
+
import { cpSync, existsSync, mkdirSync, readdirSync } from 'node:fs';
|
|
15
|
+
import type { BuildAdapter, BuildAdapterOptions, BuildResult } from './types';
|
|
16
|
+
import { getRunCommand } from '../detect/util';
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Run a shell command and return exit code.
|
|
20
|
+
*/
|
|
21
|
+
async function runCommand(
|
|
22
|
+
cmd: string[],
|
|
23
|
+
cwd: string,
|
|
24
|
+
env?: Record<string, string>
|
|
25
|
+
): Promise<{ exitCode: number; stdout: string; stderr: string }> {
|
|
26
|
+
const proc = Bun.spawn(cmd, {
|
|
27
|
+
cwd,
|
|
28
|
+
env: { ...process.env, ...env },
|
|
29
|
+
stdout: 'pipe',
|
|
30
|
+
stderr: 'pipe',
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
const [stdout, stderr] = await Promise.all([
|
|
34
|
+
new Response(proc.stdout).text(),
|
|
35
|
+
new Response(proc.stderr).text(),
|
|
36
|
+
]);
|
|
37
|
+
|
|
38
|
+
await proc.exited;
|
|
39
|
+
|
|
40
|
+
return {
|
|
41
|
+
exitCode: proc.exitCode ?? 1,
|
|
42
|
+
stdout,
|
|
43
|
+
stderr,
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Install dependencies using the detected package manager.
|
|
49
|
+
*/
|
|
50
|
+
export async function installDependencies(
|
|
51
|
+
projectDir: string,
|
|
52
|
+
packageManager: string,
|
|
53
|
+
logger: { debug: (...args: unknown[]) => void }
|
|
54
|
+
): Promise<void> {
|
|
55
|
+
let cmd: string[];
|
|
56
|
+
switch (packageManager) {
|
|
57
|
+
case 'bun':
|
|
58
|
+
cmd = ['bun', 'install'];
|
|
59
|
+
break;
|
|
60
|
+
case 'pnpm':
|
|
61
|
+
cmd = ['pnpm', 'install', '--frozen-lockfile'];
|
|
62
|
+
break;
|
|
63
|
+
case 'yarn':
|
|
64
|
+
cmd = ['yarn', 'install', '--frozen-lockfile'];
|
|
65
|
+
break;
|
|
66
|
+
default:
|
|
67
|
+
cmd = ['npm', 'ci'];
|
|
68
|
+
break;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
logger.debug(`Installing dependencies with: ${cmd.join(' ')}`);
|
|
72
|
+
|
|
73
|
+
const result = await runCommand(cmd, projectDir);
|
|
74
|
+
if (result.exitCode !== 0) {
|
|
75
|
+
throw new Error(
|
|
76
|
+
`Dependency installation failed (exit ${result.exitCode}):\n${result.stderr}`
|
|
77
|
+
);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Run the framework's build command.
|
|
83
|
+
*/
|
|
84
|
+
export async function runBuildCommand(
|
|
85
|
+
projectDir: string,
|
|
86
|
+
buildCommand: string,
|
|
87
|
+
packageManager: string,
|
|
88
|
+
buildEnv?: Record<string, string>,
|
|
89
|
+
logger?: { debug: (...args: unknown[]) => void }
|
|
90
|
+
): Promise<{ stdout: string; stderr: string }> {
|
|
91
|
+
// If it's a package.json script name, use the package manager's run command
|
|
92
|
+
// If it contains spaces or special chars, it's likely a direct command
|
|
93
|
+
const isScriptName = /^[a-zA-Z0-9_:-]+$/.test(buildCommand);
|
|
94
|
+
|
|
95
|
+
let cmd: string[];
|
|
96
|
+
if (isScriptName && buildCommand !== '__agentuity_internal__') {
|
|
97
|
+
const runCmd = getRunCommand(packageManager as 'bun' | 'npm' | 'pnpm' | 'yarn');
|
|
98
|
+
cmd = runCmd.split(' ').concat(buildCommand);
|
|
99
|
+
} else {
|
|
100
|
+
cmd = ['sh', '-c', buildCommand];
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
logger?.debug(`Running build command: ${cmd.join(' ')}`);
|
|
104
|
+
|
|
105
|
+
const result = await runCommand(cmd, projectDir, buildEnv);
|
|
106
|
+
if (result.exitCode !== 0) {
|
|
107
|
+
throw new Error(`Build failed (exit ${result.exitCode}):\n${result.stderr || result.stdout}`);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
return { stdout: result.stdout, stderr: result.stderr };
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
export const genericAdapter: BuildAdapter = {
|
|
114
|
+
name: 'generic',
|
|
115
|
+
|
|
116
|
+
async build(options: BuildAdapterOptions): Promise<BuildResult> {
|
|
117
|
+
const { projectDir, framework, outputDir, logger } = options;
|
|
118
|
+
const started = Date.now();
|
|
119
|
+
const logs: string[] = [];
|
|
120
|
+
|
|
121
|
+
// Step 1: Install dependencies
|
|
122
|
+
logger.debug('Installing dependencies...');
|
|
123
|
+
const installStart = Date.now();
|
|
124
|
+
await installDependencies(projectDir, framework.packageManager, logger);
|
|
125
|
+
logs.push(`✓ Dependencies installed in ${Date.now() - installStart}ms`);
|
|
126
|
+
|
|
127
|
+
// Step 2: Run the build command
|
|
128
|
+
if (framework.buildCommand && framework.buildCommand !== '__agentuity_internal__') {
|
|
129
|
+
logger.debug(`Running build: ${framework.buildCommand}`);
|
|
130
|
+
const buildStart = Date.now();
|
|
131
|
+
await runBuildCommand(
|
|
132
|
+
projectDir,
|
|
133
|
+
framework.buildCommand,
|
|
134
|
+
framework.packageManager,
|
|
135
|
+
framework.buildEnv,
|
|
136
|
+
logger
|
|
137
|
+
);
|
|
138
|
+
logs.push(`✓ Build completed in ${Date.now() - buildStart}ms`);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
// Step 3: Copy build output to output directory
|
|
142
|
+
const buildOutputPath = resolve(projectDir, framework.buildOutput);
|
|
143
|
+
const resolvedOutputDir = resolve(outputDir);
|
|
144
|
+
|
|
145
|
+
// Copy build output to the output directory when they differ.
|
|
146
|
+
// When buildOutput is '.' (project root), the output dir is a subdirectory
|
|
147
|
+
// of the source, so we iterate entries to avoid cpSync's self-copy check.
|
|
148
|
+
const shouldCopy = existsSync(buildOutputPath) && buildOutputPath !== resolvedOutputDir;
|
|
149
|
+
|
|
150
|
+
if (shouldCopy) {
|
|
151
|
+
logger.debug(`Copying build output from ${buildOutputPath} to ${resolvedOutputDir}`);
|
|
152
|
+
mkdirSync(resolvedOutputDir, { recursive: true });
|
|
153
|
+
|
|
154
|
+
// Skip directories that shouldn't be deployed
|
|
155
|
+
const skipEntries = new Set([
|
|
156
|
+
'node_modules',
|
|
157
|
+
'.git',
|
|
158
|
+
'.env',
|
|
159
|
+
basename(resolvedOutputDir), // e.g., '.agentuity'
|
|
160
|
+
]);
|
|
161
|
+
|
|
162
|
+
const entries = readdirSync(buildOutputPath);
|
|
163
|
+
for (const entry of entries) {
|
|
164
|
+
if (skipEntries.has(entry)) continue;
|
|
165
|
+
const srcPath = join(buildOutputPath, entry);
|
|
166
|
+
const dstPath = join(resolvedOutputDir, entry);
|
|
167
|
+
cpSync(srcPath, dstPath, { recursive: true });
|
|
168
|
+
}
|
|
169
|
+
} else {
|
|
170
|
+
// Ensure output dir exists even when we skip the copy
|
|
171
|
+
mkdirSync(resolvedOutputDir, { recursive: true });
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
// Step 4: Determine start command — inject static file server if none exists
|
|
175
|
+
let { startCommand, serverEntry } = framework;
|
|
176
|
+
|
|
177
|
+
if (!startCommand) {
|
|
178
|
+
// No start command (static-only build) — inject a minimal file server
|
|
179
|
+
const { injectStaticServer } = await import('./static-server');
|
|
180
|
+
const injected = injectStaticServer(outputDir);
|
|
181
|
+
startCommand = injected.startCommand;
|
|
182
|
+
serverEntry = injected.serverEntry;
|
|
183
|
+
logs.push('✓ Injected static file server (no start script found)');
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
// Step 5: Copy package.json and node_modules for runtime
|
|
187
|
+
const pkgJsonSrc = join(projectDir, 'package.json');
|
|
188
|
+
const pkgJsonDst = join(outputDir, 'package.json');
|
|
189
|
+
if (existsSync(pkgJsonSrc) && !existsSync(pkgJsonDst)) {
|
|
190
|
+
cpSync(pkgJsonSrc, pkgJsonDst);
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
const nodeModulesSrc = join(projectDir, 'node_modules');
|
|
194
|
+
const nodeModulesDst = join(outputDir, 'node_modules');
|
|
195
|
+
if (existsSync(nodeModulesSrc) && !existsSync(nodeModulesDst)) {
|
|
196
|
+
logger.debug('Copying node_modules for runtime dependencies...');
|
|
197
|
+
cpSync(nodeModulesSrc, nodeModulesDst, { recursive: true });
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
// Step 6: Resolve static asset directory for CDN upload
|
|
201
|
+
// staticDir is relative to the project root (set by framework detection).
|
|
202
|
+
// If it matches buildOutput, the files are already in outputDir from the copy.
|
|
203
|
+
// Otherwise, copy the static assets into the output so deploy can find them.
|
|
204
|
+
let resolvedStaticDir: string | undefined;
|
|
205
|
+
|
|
206
|
+
if (framework.staticDir) {
|
|
207
|
+
const staticSrcPath = resolve(projectDir, framework.staticDir);
|
|
208
|
+
const buildOutputPath = resolve(projectDir, framework.buildOutput);
|
|
209
|
+
|
|
210
|
+
// Check if the static dir is inside the build output (already copied)
|
|
211
|
+
if (staticSrcPath.startsWith(buildOutputPath + '/') || staticSrcPath === buildOutputPath) {
|
|
212
|
+
// Static assets are within the copied build output
|
|
213
|
+
const relativeToOutput = relative(buildOutputPath, staticSrcPath);
|
|
214
|
+
resolvedStaticDir = relativeToOutput
|
|
215
|
+
? join(resolvedOutputDir, relativeToOutput)
|
|
216
|
+
: resolvedOutputDir;
|
|
217
|
+
} else if (existsSync(staticSrcPath)) {
|
|
218
|
+
// Static assets are outside the build output — copy them into the output
|
|
219
|
+
const staticDstPath = join(resolvedOutputDir, framework.staticDir);
|
|
220
|
+
logger.debug(`Copying static assets from ${staticSrcPath} to ${staticDstPath}`);
|
|
221
|
+
mkdirSync(staticDstPath, { recursive: true });
|
|
222
|
+
cpSync(staticSrcPath, staticDstPath, { recursive: true });
|
|
223
|
+
resolvedStaticDir = staticDstPath;
|
|
224
|
+
logs.push(`✓ Copied static assets from ${framework.staticDir}`);
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
return {
|
|
229
|
+
outputDir,
|
|
230
|
+
startCommand,
|
|
231
|
+
serverEntry,
|
|
232
|
+
staticDir:
|
|
233
|
+
resolvedStaticDir && existsSync(resolvedStaticDir) ? resolvedStaticDir : undefined,
|
|
234
|
+
port: framework.port,
|
|
235
|
+
duration: Date.now() - started,
|
|
236
|
+
logs,
|
|
237
|
+
};
|
|
238
|
+
},
|
|
239
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Build Adapter Registry
|
|
3
|
+
*
|
|
4
|
+
* Maps detected framework names to their build adapters.
|
|
5
|
+
* Specific adapters handle framework-specific concerns (e.g., Next.js standalone mode).
|
|
6
|
+
* Frameworks without a specific adapter fall through to the generic adapter.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import type { BuildAdapter } from './types';
|
|
10
|
+
import { genericAdapter } from './generic';
|
|
11
|
+
import { nextjsAdapter } from './nextjs';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Registry of framework-specific build adapters.
|
|
15
|
+
* Frameworks not in this map use the generic adapter.
|
|
16
|
+
*/
|
|
17
|
+
const adapters: Record<string, BuildAdapter> = {
|
|
18
|
+
nextjs: nextjsAdapter,
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Get the build adapter for a detected framework.
|
|
23
|
+
* Falls back to the generic adapter if no specific one exists.
|
|
24
|
+
*/
|
|
25
|
+
export function getAdapter(frameworkName: string): BuildAdapter {
|
|
26
|
+
return adapters[frameworkName] ?? genericAdapter;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
// Re-export types
|
|
30
|
+
export type { BuildAdapter, BuildAdapterOptions, BuildResult } from './types';
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Next.js build adapter.
|
|
3
|
+
*
|
|
4
|
+
* Handles Next.js-specific build concerns:
|
|
5
|
+
* 1. Ensures standalone output mode is configured
|
|
6
|
+
* 2. Copies the standalone directory + static assets to output
|
|
7
|
+
* 3. Sets up the correct start command
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import { join } from 'node:path';
|
|
11
|
+
import { cpSync, existsSync, mkdirSync, readFileSync } from 'node:fs';
|
|
12
|
+
import type { BuildAdapter, BuildAdapterOptions, BuildResult } from './types';
|
|
13
|
+
import { installDependencies, runBuildCommand } from './generic';
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Ensure next.config has output: 'standalone'.
|
|
17
|
+
*
|
|
18
|
+
* Rather than modifying the user's config file, we set the NEXT_OUTPUT env var
|
|
19
|
+
* which can be read in next.config.js, or we check if standalone is already configured.
|
|
20
|
+
* As a fallback, we also set the experimental config via env.
|
|
21
|
+
*/
|
|
22
|
+
function getNextBuildEnv(): Record<string, string> {
|
|
23
|
+
return {
|
|
24
|
+
// Signal to the build that we want standalone output
|
|
25
|
+
NEXT_PRIVATE_STANDALONE: 'true',
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export const nextjsAdapter: BuildAdapter = {
|
|
30
|
+
name: 'nextjs',
|
|
31
|
+
|
|
32
|
+
async build(options: BuildAdapterOptions): Promise<BuildResult> {
|
|
33
|
+
const { projectDir, framework, outputDir, logger } = options;
|
|
34
|
+
const started = Date.now();
|
|
35
|
+
const logs: string[] = [];
|
|
36
|
+
|
|
37
|
+
// Step 1: Install dependencies
|
|
38
|
+
logger.debug('Installing dependencies...');
|
|
39
|
+
const installStart = Date.now();
|
|
40
|
+
await installDependencies(projectDir, framework.packageManager, logger);
|
|
41
|
+
logs.push(`✓ Dependencies installed in ${Date.now() - installStart}ms`);
|
|
42
|
+
|
|
43
|
+
// Step 2: Check if standalone mode is configured
|
|
44
|
+
const nextConfigPath = await findNextConfig(projectDir);
|
|
45
|
+
let standaloneConfigured = false;
|
|
46
|
+
if (nextConfigPath) {
|
|
47
|
+
const content = readFileSync(nextConfigPath, 'utf-8');
|
|
48
|
+
standaloneConfigured =
|
|
49
|
+
content.includes("'standalone'") || content.includes('"standalone"');
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
if (!standaloneConfigured) {
|
|
53
|
+
logger.debug(
|
|
54
|
+
'Standalone output not detected in next.config — setting NEXT_PRIVATE_STANDALONE=true'
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
// Step 3: Run the build with standalone env
|
|
59
|
+
const buildEnv = {
|
|
60
|
+
...framework.buildEnv,
|
|
61
|
+
...getNextBuildEnv(),
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
logger.debug(`Running Next.js build: ${framework.buildCommand}`);
|
|
65
|
+
const buildStart = Date.now();
|
|
66
|
+
await runBuildCommand(
|
|
67
|
+
projectDir,
|
|
68
|
+
framework.buildCommand,
|
|
69
|
+
framework.packageManager,
|
|
70
|
+
buildEnv,
|
|
71
|
+
logger
|
|
72
|
+
);
|
|
73
|
+
logs.push(`✓ Next.js build completed in ${Date.now() - buildStart}ms`);
|
|
74
|
+
|
|
75
|
+
// Step 4: Package the standalone output
|
|
76
|
+
mkdirSync(outputDir, { recursive: true });
|
|
77
|
+
|
|
78
|
+
const standalonePath = join(projectDir, '.next', 'standalone');
|
|
79
|
+
const staticPath = join(projectDir, '.next', 'static');
|
|
80
|
+
const publicPath = join(projectDir, 'public');
|
|
81
|
+
|
|
82
|
+
if (existsSync(standalonePath)) {
|
|
83
|
+
// Copy standalone server
|
|
84
|
+
logger.debug('Copying standalone server...');
|
|
85
|
+
cpSync(standalonePath, outputDir, { recursive: true });
|
|
86
|
+
|
|
87
|
+
// Copy static assets into .next/static within the output
|
|
88
|
+
if (existsSync(staticPath)) {
|
|
89
|
+
const staticDst = join(outputDir, '.next', 'static');
|
|
90
|
+
mkdirSync(staticDst, { recursive: true });
|
|
91
|
+
cpSync(staticPath, staticDst, { recursive: true });
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
// Copy public assets
|
|
95
|
+
if (existsSync(publicPath)) {
|
|
96
|
+
const publicDst = join(outputDir, 'public');
|
|
97
|
+
mkdirSync(publicDst, { recursive: true });
|
|
98
|
+
cpSync(publicPath, publicDst, { recursive: true });
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
logs.push('✓ Standalone output packaged');
|
|
102
|
+
} else {
|
|
103
|
+
// Fallback: copy the whole .next directory
|
|
104
|
+
logger.debug('No standalone output found — copying full .next directory');
|
|
105
|
+
const nextDst = join(outputDir, '.next');
|
|
106
|
+
cpSync(join(projectDir, '.next'), nextDst, { recursive: true });
|
|
107
|
+
|
|
108
|
+
// Copy package.json and node_modules
|
|
109
|
+
cpSync(join(projectDir, 'package.json'), join(outputDir, 'package.json'));
|
|
110
|
+
if (existsSync(join(projectDir, 'node_modules'))) {
|
|
111
|
+
cpSync(join(projectDir, 'node_modules'), join(outputDir, 'node_modules'), {
|
|
112
|
+
recursive: true,
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
logs.push('⚠ No standalone output — using full build (consider enabling standalone mode)');
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
// Determine start command based on what we have
|
|
120
|
+
const hasStandalone = existsSync(join(outputDir, 'server.js'));
|
|
121
|
+
const startCommand = hasStandalone ? 'node server.js' : 'node node_modules/.bin/next start';
|
|
122
|
+
|
|
123
|
+
return {
|
|
124
|
+
outputDir,
|
|
125
|
+
startCommand,
|
|
126
|
+
serverEntry: hasStandalone ? 'server.js' : undefined,
|
|
127
|
+
staticDir: existsSync(join(outputDir, '.next', 'static'))
|
|
128
|
+
? join(outputDir, '.next', 'static')
|
|
129
|
+
: undefined,
|
|
130
|
+
port: framework.port ?? 3000,
|
|
131
|
+
duration: Date.now() - started,
|
|
132
|
+
logs,
|
|
133
|
+
};
|
|
134
|
+
},
|
|
135
|
+
};
|
|
136
|
+
|
|
137
|
+
async function findNextConfig(projectDir: string): Promise<string | null> {
|
|
138
|
+
const candidates = ['next.config.js', 'next.config.mjs', 'next.config.ts', 'next.config.cjs'];
|
|
139
|
+
|
|
140
|
+
for (const name of candidates) {
|
|
141
|
+
const path = join(projectDir, name);
|
|
142
|
+
if (existsSync(path)) return path;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
return null;
|
|
146
|
+
}
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Static file server injector.
|
|
3
|
+
*
|
|
4
|
+
* When a framework has no start command (e.g., static-only builds from
|
|
5
|
+
* Vite SPA, Gatsby, Eleventy), this module injects a minimal file server
|
|
6
|
+
* so there's always a valid start command in launch.json.
|
|
7
|
+
*
|
|
8
|
+
* The server is a small Node.js http script that:
|
|
9
|
+
* - Serves files from the build output directory
|
|
10
|
+
* - Returns index.html for non-file routes (SPA support)
|
|
11
|
+
* - Sets appropriate cache headers
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
import { join } from 'node:path';
|
|
15
|
+
import { writeFileSync, mkdirSync } from 'node:fs';
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* The static server script, inlined as a string.
|
|
19
|
+
* Uses Bun.serve which is available in the deployment runtime.
|
|
20
|
+
* Falls back to a Node.js http server if Bun is not available.
|
|
21
|
+
*/
|
|
22
|
+
const STATIC_SERVER_SCRIPT = `#!/usr/bin/env node
|
|
23
|
+
/**
|
|
24
|
+
* Minimal static file server — auto-generated by Agentuity build.
|
|
25
|
+
* Serves files from the current directory with SPA fallback.
|
|
26
|
+
*/
|
|
27
|
+
const path = require('path');
|
|
28
|
+
const fs = require('fs');
|
|
29
|
+
const http = require('http');
|
|
30
|
+
|
|
31
|
+
const PORT = parseInt(process.env.PORT || '3000', 10);
|
|
32
|
+
const ROOT = __dirname;
|
|
33
|
+
|
|
34
|
+
const MIME_TYPES = {
|
|
35
|
+
'.html': 'text/html',
|
|
36
|
+
'.js': 'application/javascript',
|
|
37
|
+
'.css': 'text/css',
|
|
38
|
+
'.json': 'application/json',
|
|
39
|
+
'.png': 'image/png',
|
|
40
|
+
'.jpg': 'image/jpeg',
|
|
41
|
+
'.jpeg': 'image/jpeg',
|
|
42
|
+
'.gif': 'image/gif',
|
|
43
|
+
'.svg': 'image/svg+xml',
|
|
44
|
+
'.ico': 'image/x-icon',
|
|
45
|
+
'.webp': 'image/webp',
|
|
46
|
+
'.avif': 'image/avif',
|
|
47
|
+
'.woff': 'font/woff',
|
|
48
|
+
'.woff2': 'font/woff2',
|
|
49
|
+
'.ttf': 'font/ttf',
|
|
50
|
+
'.otf': 'font/otf',
|
|
51
|
+
'.map': 'application/json',
|
|
52
|
+
'.txt': 'text/plain',
|
|
53
|
+
'.xml': 'application/xml',
|
|
54
|
+
'.webmanifest': 'application/manifest+json',
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
function getMimeType(filePath) {
|
|
58
|
+
const ext = path.extname(filePath).toLowerCase();
|
|
59
|
+
return MIME_TYPES[ext] || 'application/octet-stream';
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
function isImmutableAsset(filePath) {
|
|
63
|
+
// Hashed assets from bundlers (e.g., main-abc123.js)
|
|
64
|
+
return /\\.[a-f0-9]{8,}\\./i.test(filePath);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
const server = http.createServer((req, res) => {
|
|
68
|
+
const url = new URL(req.url, \`http://localhost:\${PORT}\`);
|
|
69
|
+
let filePath = path.join(ROOT, url.pathname);
|
|
70
|
+
|
|
71
|
+
// Security: prevent directory traversal
|
|
72
|
+
if (!filePath.startsWith(ROOT)) {
|
|
73
|
+
res.writeHead(403);
|
|
74
|
+
res.end('Forbidden');
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
// Try to serve the exact file
|
|
79
|
+
if (fs.existsSync(filePath) && fs.statSync(filePath).isFile()) {
|
|
80
|
+
const content = fs.readFileSync(filePath);
|
|
81
|
+
const mime = getMimeType(filePath);
|
|
82
|
+
const headers = { 'Content-Type': mime };
|
|
83
|
+
|
|
84
|
+
// Immutable caching for hashed assets
|
|
85
|
+
if (isImmutableAsset(filePath)) {
|
|
86
|
+
headers['Cache-Control'] = 'public, max-age=31536000, immutable';
|
|
87
|
+
} else {
|
|
88
|
+
headers['Cache-Control'] = 'public, max-age=0, must-revalidate';
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
res.writeHead(200, headers);
|
|
92
|
+
res.end(content);
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
// Try index.html in the directory
|
|
97
|
+
if (fs.existsSync(filePath) && fs.statSync(filePath).isDirectory()) {
|
|
98
|
+
const indexPath = path.join(filePath, 'index.html');
|
|
99
|
+
if (fs.existsSync(indexPath)) {
|
|
100
|
+
const content = fs.readFileSync(indexPath);
|
|
101
|
+
res.writeHead(200, { 'Content-Type': 'text/html', 'Cache-Control': 'public, max-age=0, must-revalidate' });
|
|
102
|
+
res.end(content);
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
// SPA fallback: serve root index.html for non-file routes
|
|
108
|
+
const indexPath = path.join(ROOT, 'index.html');
|
|
109
|
+
if (fs.existsSync(indexPath)) {
|
|
110
|
+
const content = fs.readFileSync(indexPath);
|
|
111
|
+
res.writeHead(200, { 'Content-Type': 'text/html', 'Cache-Control': 'public, max-age=0, must-revalidate' });
|
|
112
|
+
res.end(content);
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
res.writeHead(404);
|
|
117
|
+
res.end('Not Found');
|
|
118
|
+
});
|
|
119
|
+
|
|
120
|
+
server.listen(PORT, () => {
|
|
121
|
+
console.log(\`Static server listening on port \${PORT}\`);
|
|
122
|
+
});
|
|
123
|
+
`;
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* Inject a static file server into the build output directory.
|
|
127
|
+
*
|
|
128
|
+
* @param outputDir - Absolute path to the build output
|
|
129
|
+
* @returns The start command for the injected server
|
|
130
|
+
*/
|
|
131
|
+
export function injectStaticServer(outputDir: string): {
|
|
132
|
+
startCommand: string;
|
|
133
|
+
serverEntry: string;
|
|
134
|
+
} {
|
|
135
|
+
mkdirSync(outputDir, { recursive: true });
|
|
136
|
+
const serverPath = join(outputDir, '_serve.js');
|
|
137
|
+
writeFileSync(serverPath, STATIC_SERVER_SCRIPT, 'utf-8');
|
|
138
|
+
|
|
139
|
+
return {
|
|
140
|
+
startCommand: 'node _serve.js',
|
|
141
|
+
serverEntry: '_serve.js',
|
|
142
|
+
};
|
|
143
|
+
}
|