veryfront 0.1.1232 → 0.1.1233
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/README.md +5 -0
- package/esm/cli/app/actions.js +1 -1
- package/esm/cli/app/shell.js +3 -3
- package/esm/cli/app/state.js +1 -1
- package/esm/cli/app/views/dashboard.js +1 -1
- package/esm/cli/app/views/help.js +1 -1
- package/esm/cli/commands/deploy/command-help.d.ts.map +1 -1
- package/esm/cli/commands/deploy/command-help.js +1 -0
- package/esm/cli/commands/deploy/command.js +6 -4
- package/esm/cli/commands/dev/command-help.d.ts.map +1 -1
- package/esm/cli/commands/dev/command-help.js +12 -1
- package/esm/cli/commands/dev/command.d.ts +8 -0
- package/esm/cli/commands/dev/command.d.ts.map +1 -1
- package/esm/cli/commands/dev/command.js +25 -5
- package/esm/cli/commands/dev/handler.d.ts +7 -1
- package/esm/cli/commands/dev/handler.d.ts.map +1 -1
- package/esm/cli/commands/dev/handler.js +110 -3
- package/esm/cli/commands/dev/inference-status.d.ts +12 -0
- package/esm/cli/commands/dev/inference-status.d.ts.map +1 -0
- package/esm/cli/commands/dev/inference-status.js +20 -0
- package/esm/cli/commands/login/command-help.d.ts.map +1 -1
- package/esm/cli/commands/login/command-help.js +1 -0
- package/esm/cli/commands/mcp/command-help.js +1 -1
- package/esm/cli/commands/whoami/command-help.d.ts.map +1 -1
- package/esm/cli/commands/whoami/command-help.js +1 -0
- package/esm/cli/mcp/server.d.ts.map +1 -1
- package/esm/cli/mcp/server.js +2 -1
- package/esm/cli/mcp/tools/deploy-tool.d.ts +2 -1
- package/esm/cli/mcp/tools/deploy-tool.d.ts.map +1 -1
- package/esm/cli/mcp/tools/deploy-tool.js +6 -2
- package/esm/cli/mcp/tools/dev-tools.js +1 -1
- package/esm/cli/mcp/tools.js +1 -1
- package/esm/cli/router.d.ts.map +1 -1
- package/esm/cli/router.js +11 -4
- package/esm/cli/shared/deployment/deploy-project.d.ts +21 -2
- package/esm/cli/shared/deployment/deploy-project.d.ts.map +1 -1
- package/esm/cli/shared/deployment/deploy-project.js +194 -35
- package/esm/cli/shared/deployment/result.d.ts +10 -0
- package/esm/cli/shared/deployment/result.d.ts.map +1 -1
- package/esm/deno.d.ts +2 -0
- package/esm/deno.js +9 -7
- package/esm/src/agent/composition/composition.d.ts.map +1 -1
- package/esm/src/agent/composition/composition.js +10 -1
- package/esm/src/agent/runtime/attachment-reachability.d.ts +69 -0
- package/esm/src/agent/runtime/attachment-reachability.d.ts.map +1 -0
- package/esm/src/agent/runtime/attachment-reachability.js +205 -0
- package/esm/src/agent/runtime/index.d.ts.map +1 -1
- package/esm/src/agent/runtime/index.js +11 -2
- package/esm/src/agent/runtime/text-generation-runtime-message-converter.d.ts +15 -3
- package/esm/src/agent/runtime/text-generation-runtime-message-converter.d.ts.map +1 -1
- package/esm/src/agent/runtime/text-generation-runtime-message-converter.js +22 -6
- package/esm/src/agent/schemas/agent.schema.d.ts +1 -1
- package/esm/src/agent/service/config.d.ts.map +1 -1
- package/esm/src/agent/service/config.js +3 -1
- package/esm/src/chat/invoke-agent-stream.d.ts +19 -0
- package/esm/src/chat/invoke-agent-stream.d.ts.map +1 -1
- package/esm/src/chat/invoke-agent-stream.js +20 -0
- package/esm/src/config/hosted-compatibility.d.ts +64 -0
- package/esm/src/config/hosted-compatibility.d.ts.map +1 -0
- package/esm/src/config/hosted-compatibility.js +235 -0
- package/esm/src/config/index.d.ts +1 -0
- package/esm/src/config/index.d.ts.map +1 -1
- package/esm/src/config/index.js +1 -0
- package/esm/src/config/loader.d.ts.map +1 -1
- package/esm/src/config/loader.js +68 -4
- package/esm/src/errors/error-registry/deploy.d.ts +11 -0
- package/esm/src/errors/error-registry/deploy.d.ts.map +1 -1
- package/esm/src/errors/error-registry/deploy.js +24 -0
- package/esm/src/errors/error-registry.d.ts +2 -0
- package/esm/src/errors/error-registry.d.ts.map +1 -1
- package/esm/src/errors/index.d.ts +1 -1
- package/esm/src/errors/index.d.ts.map +1 -1
- package/esm/src/errors/index.js +2 -2
- package/esm/src/extensions/setup-hint.d.ts +59 -0
- package/esm/src/extensions/setup-hint.d.ts.map +1 -0
- package/esm/src/extensions/setup-hint.js +124 -0
- package/esm/src/html/hydration-script-builder/hydration-runtime.generated.js +1 -1
- package/esm/src/html/styles-builder/tailwind-compiler.d.ts.map +1 -1
- package/esm/src/html/styles-builder/tailwind-compiler.js +10 -9
- package/esm/src/platform/adapters/native-file-system-provenance.d.ts +23 -0
- package/esm/src/platform/adapters/native-file-system-provenance.d.ts.map +1 -1
- package/esm/src/platform/adapters/native-file-system-provenance.js +25 -0
- package/esm/src/platform/adapters/runtime/bun/filesystem-adapter.d.ts.map +1 -1
- package/esm/src/platform/adapters/runtime/bun/filesystem-adapter.js +2 -2
- package/esm/src/platform/adapters/runtime/deno/filesystem-adapter.d.ts.map +1 -1
- package/esm/src/platform/adapters/runtime/deno/filesystem-adapter.js +2 -2
- package/esm/src/platform/adapters/runtime/node/filesystem-adapter.d.ts.map +1 -1
- package/esm/src/platform/adapters/runtime/node/filesystem-adapter.js +2 -2
- package/esm/src/platform/adapters/runtime/shared/node-filesystem-adapter.d.ts.map +1 -1
- package/esm/src/platform/adapters/runtime/shared/node-filesystem-adapter.js +2 -2
- package/esm/src/platform/compat/http/pinned-fetch.d.ts +1 -1
- package/esm/src/platform/compat/process/env.d.ts +4 -0
- package/esm/src/platform/compat/process/env.d.ts.map +1 -1
- package/esm/src/platform/compat/process/env.js +25 -7
- package/esm/src/platform/compat/process/runtime-process.d.ts +8 -0
- package/esm/src/platform/compat/process/runtime-process.d.ts.map +1 -1
- package/esm/src/platform/compat/process/runtime-process.js +8 -0
- package/esm/src/platform/compat/process/scoped-process-env.d.ts +29 -0
- package/esm/src/platform/compat/process/scoped-process-env.d.ts.map +1 -0
- package/esm/src/platform/compat/process/scoped-process-env.js +221 -0
- package/esm/src/provider/runtime-loader/provider-http.d.ts.map +1 -1
- package/esm/src/provider/runtime-loader/provider-http.js +5 -1
- package/esm/src/react/components/chat/chat/components/empty-state.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/components/empty-state.js +6 -1
- package/esm/src/react/components/chat/chat/components/reasoning.d.ts +4 -0
- package/esm/src/react/components/chat/chat/components/reasoning.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/components/reasoning.js +5 -1
- package/esm/src/react/components/chat/chat/components/skill-tool.d.ts +10 -1
- package/esm/src/react/components/chat/chat/components/skill-tool.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/components/skill-tool.js +19 -5
- package/esm/src/react/components/chat/chat/components/tool-ui.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/components/tool-ui.js +118 -28
- package/esm/src/react/components/chat/chat/composition/chat-composer.d.ts +3 -8
- package/esm/src/react/components/chat/chat/composition/chat-composer.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/composition/chat-composer.js +4 -29
- package/esm/src/react/components/chat/chat/composition/chat-input-attach.d.ts +20 -0
- package/esm/src/react/components/chat/chat/composition/chat-input-attach.d.ts.map +1 -0
- package/esm/src/react/components/chat/chat/composition/chat-input-attach.js +54 -0
- package/esm/src/react/components/chat/chat/composition/error-banner.d.ts +13 -3
- package/esm/src/react/components/chat/chat/composition/error-banner.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/composition/error-banner.js +11 -8
- package/esm/src/react/components/ui/alert.d.ts +9 -8
- package/esm/src/react/components/ui/alert.d.ts.map +1 -1
- package/esm/src/react/components/ui/alert.js +9 -8
- package/esm/src/react/components/ui/design-tokens.d.ts.map +1 -1
- package/esm/src/react/components/ui/design-tokens.js +8 -0
- package/esm/src/security/http/auth.d.ts.map +1 -1
- package/esm/src/security/http/auth.js +14 -1
- package/esm/src/security/http/local-control-request.d.ts +9 -4
- package/esm/src/security/http/local-control-request.d.ts.map +1 -1
- package/esm/src/security/http/local-control-request.js +36 -14
- package/esm/src/security/http/outbound-fetch.d.ts +1 -0
- package/esm/src/security/http/outbound-fetch.d.ts.map +1 -1
- package/esm/src/security/http/outbound-fetch.js +35 -5
- package/esm/src/security/http/platform-liveness-probe.d.ts +39 -0
- package/esm/src/security/http/platform-liveness-probe.d.ts.map +1 -0
- package/esm/src/security/http/platform-liveness-probe.js +45 -0
- package/esm/src/security/sandbox/worker-pool.d.ts +47 -1
- package/esm/src/security/sandbox/worker-pool.d.ts.map +1 -1
- package/esm/src/security/sandbox/worker-pool.js +76 -4
- package/esm/src/server/handlers/dev/framework-candidates.generated.d.ts.map +1 -1
- package/esm/src/server/handlers/dev/framework-candidates.generated.js +186 -36
- package/esm/src/server/index.d.ts +1 -1
- package/esm/src/server/index.d.ts.map +1 -1
- package/esm/src/server/index.js +1 -1
- package/esm/src/server/production-server.d.ts.map +1 -1
- package/esm/src/server/production-server.js +6 -0
- package/esm/src/server/utils/domain-parser.d.ts +39 -2
- package/esm/src/server/utils/domain-parser.d.ts.map +1 -1
- package/esm/src/server/utils/domain-parser.js +72 -19
- package/esm/src/utils/version-constant.d.ts +1 -1
- package/esm/src/utils/version-constant.js +1 -1
- package/esm/templates/manifest.js +6 -6
- package/package.json +8 -8
package/README.md
CHANGED
|
@@ -10,6 +10,11 @@ Veryfront Code is a full-stack framework for building AI-powered applications an
|
|
|
10
10
|
|
|
11
11
|
It gives you agents, tools, workflows, and a complete React rendering stack in a single framework. Veryfront Code runs on Node.js, Deno, and Bun, and can be deployed anywhere or shipped through the Veryfront platform with built-in preview environments and production hosting.
|
|
12
12
|
|
|
13
|
+
Veryfront Code is an Apache-2.0 open-source framework that works standalone.
|
|
14
|
+
Develop and evaluate locally, self-host in your own cloud or on-premises
|
|
15
|
+
environment, or use Veryfront Cloud for managed platform services. A Veryfront
|
|
16
|
+
account is not required for local development or self-hosting.
|
|
17
|
+
|
|
13
18
|
<p align="center">
|
|
14
19
|
<img src="./assets/banner.svg" alt="Veryfront" width="100%">
|
|
15
20
|
</p>
|
package/esm/cli/app/actions.js
CHANGED
|
@@ -69,7 +69,7 @@ export function createLauncher(host) {
|
|
|
69
69
|
}
|
|
70
70
|
return {
|
|
71
71
|
openInBrowser(project, port) {
|
|
72
|
-
return open(`http://${project.slug}.
|
|
72
|
+
return open(`http://${project.slug}.localhost:${port}`, (url) => `Opened ${url}`);
|
|
73
73
|
},
|
|
74
74
|
openInStudio(project) {
|
|
75
75
|
return open(`https://veryfront.com/projects/${project.slug}`, () => `Opened Studio for ${project.slug}`);
|
package/esm/cli/app/shell.js
CHANGED
|
@@ -53,7 +53,7 @@ export function createApp(config) {
|
|
|
53
53
|
state = setTemplates(TEMPLATES)(state);
|
|
54
54
|
state = updateServer({
|
|
55
55
|
port: config.port,
|
|
56
|
-
url: `http://
|
|
56
|
+
url: `http://localhost:${config.port}`,
|
|
57
57
|
})(state);
|
|
58
58
|
state = updateMCP({
|
|
59
59
|
enabled: config.mcpPort !== undefined,
|
|
@@ -304,9 +304,9 @@ export function createApp(config) {
|
|
|
304
304
|
function start() {
|
|
305
305
|
running = true;
|
|
306
306
|
if (!isInteractiveMode) {
|
|
307
|
-
console.log(`Server running on http://
|
|
307
|
+
console.log(`Server running on http://localhost:${config.port}`);
|
|
308
308
|
if (config.mcpPort)
|
|
309
|
-
console.log(`MCP available at http://
|
|
309
|
+
console.log(`MCP available at http://localhost:${config.mcpPort}/mcp`);
|
|
310
310
|
return;
|
|
311
311
|
}
|
|
312
312
|
write(screen.altOn + cursor.hide);
|
package/esm/cli/app/state.js
CHANGED
|
@@ -42,7 +42,7 @@ function hasRemoteProjects(state) {
|
|
|
42
42
|
function renderStatus(state) {
|
|
43
43
|
const lines = [` ✓ Server ready at ${brand(state.server.url)}`];
|
|
44
44
|
if (state.mcp.enabled && state.mcp.transport === "http" && state.mcp.httpPort !== undefined) {
|
|
45
|
-
lines.push(` ✓ MCP ready at ${brand(`http://
|
|
45
|
+
lines.push(` ✓ MCP ready at ${brand(`http://localhost:${state.mcp.httpPort}/mcp`)}`);
|
|
46
46
|
}
|
|
47
47
|
const { errors, warnings } = state.server;
|
|
48
48
|
if (errors > 0 || warnings > 0) {
|
|
@@ -44,7 +44,7 @@ export function renderHelpView(state) {
|
|
|
44
44
|
lines.push(` ${dim('"mcpServers": {')}`);
|
|
45
45
|
lines.push(` ${dim(' "veryfront": {')}`);
|
|
46
46
|
lines.push(` ${dim(' "type": "url",')}`);
|
|
47
|
-
lines.push(` ${dim(` "url": "http://
|
|
47
|
+
lines.push(` ${dim(` "url": "http://localhost:${state.mcp.httpPort}/mcp"`)}`);
|
|
48
48
|
lines.push(` ${dim(" }")}`);
|
|
49
49
|
lines.push(` ${dim("}")}`);
|
|
50
50
|
lines.push("");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command-help.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/deploy/command-help.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEvD,eAAO,MAAM,UAAU,EAAE,
|
|
1
|
+
{"version":3,"file":"command-help.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/deploy/command-help.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEvD,eAAO,MAAM,UAAU,EAAE,WAqDxB,CAAC"}
|
|
@@ -49,5 +49,6 @@ export const deployHelp = {
|
|
|
49
49
|
"With --project, promotes only: the working directory is never pushed, so the selected project directory's push receipt must already name that project",
|
|
50
50
|
"Creates a new release from the resolved branch",
|
|
51
51
|
"Verifies the target environment points to the created deployment before succeeding",
|
|
52
|
+
"Warns when only the environment's access gate answered the readiness probe, so the app itself was never observed serving",
|
|
52
53
|
],
|
|
53
54
|
};
|
|
@@ -101,13 +101,15 @@ async function deployCommandHuman(options) {
|
|
|
101
101
|
progressText = next;
|
|
102
102
|
spinner.update(next);
|
|
103
103
|
};
|
|
104
|
-
|
|
104
|
+
// Collected, not overwritten: a deploy can raise more than one warning, and
|
|
105
|
+
// the one an operator most needs is not reliably the last.
|
|
106
|
+
const warnings = [];
|
|
105
107
|
let outcome;
|
|
106
108
|
try {
|
|
107
109
|
outcome = await deployRunner(options).execute(toDeployRequest(options), {
|
|
108
110
|
onEvent(event) {
|
|
109
111
|
if (event.kind === "warning") {
|
|
110
|
-
|
|
112
|
+
warnings.push(event.message);
|
|
111
113
|
return;
|
|
112
114
|
}
|
|
113
115
|
updateProgress(deployProgressText(event, env, verbose));
|
|
@@ -145,8 +147,8 @@ async function deployCommandHuman(options) {
|
|
|
145
147
|
logInfo(` Source digest: ${result.sourceDigest}`);
|
|
146
148
|
logInfo(` Control plane: ${result.controlPlane}`);
|
|
147
149
|
}
|
|
148
|
-
|
|
149
|
-
logWarning(
|
|
150
|
+
for (const message of warnings)
|
|
151
|
+
logWarning(message);
|
|
150
152
|
if (verbose) {
|
|
151
153
|
const { getPostDeployTips } = await import("../../help/tips.js");
|
|
152
154
|
console.log(getPostDeployTips());
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command-help.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/dev/command-help.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEvD,eAAO,MAAM,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"command-help.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/dev/command-help.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEvD,eAAO,MAAM,OAAO,EAAE,WAqCrB,CAAC"}
|
|
@@ -6,7 +6,7 @@ export const devHelp = {
|
|
|
6
6
|
options: [
|
|
7
7
|
{
|
|
8
8
|
flag: "--port <number>",
|
|
9
|
-
description: "Port to run on",
|
|
9
|
+
description: "Port to run on (also reads PORT env var)",
|
|
10
10
|
default: "3000",
|
|
11
11
|
},
|
|
12
12
|
{
|
|
@@ -21,7 +21,18 @@ export const devHelp = {
|
|
|
21
21
|
examples: [
|
|
22
22
|
"veryfront dev",
|
|
23
23
|
"veryfront dev --port 8080",
|
|
24
|
+
"PORT=3001 veryfront dev",
|
|
24
25
|
"veryfront dev --open",
|
|
25
26
|
"veryfront dev --no-hmr",
|
|
26
27
|
],
|
|
28
|
+
notes: [
|
|
29
|
+
"Port selection priority (highest to lowest):",
|
|
30
|
+
" 1. --port / -p flag",
|
|
31
|
+
" 2. PORT env var",
|
|
32
|
+
" 3. VERYFRONT_PORT env var",
|
|
33
|
+
" 4. Default: 3000",
|
|
34
|
+
"",
|
|
35
|
+
"When the requested port is taken, the server falls forward to the next",
|
|
36
|
+
"free port. Open the URL the CLI prints to reach the running server.",
|
|
37
|
+
],
|
|
27
38
|
};
|
|
@@ -6,6 +6,14 @@ import { type RemoteProject } from "../../sync/index.js";
|
|
|
6
6
|
import { type PushOptions } from "../push/index.js";
|
|
7
7
|
export interface DevOptions {
|
|
8
8
|
port: number;
|
|
9
|
+
/**
|
|
10
|
+
* True when the port was set explicitly by a `--port` / `-p` flag or by a
|
|
11
|
+
* valid `PORT` / `VERYFRONT_PORT` env var. When false (or absent) the port
|
|
12
|
+
* value fell through to the hardcoded default and `config.dev.port` should
|
|
13
|
+
* take precedence. Defaults to `port !== DEFAULT_DEV_PORT` for callers that
|
|
14
|
+
* do not set this field, preserving backward-compatible behaviour.
|
|
15
|
+
*/
|
|
16
|
+
portExplicit?: boolean;
|
|
9
17
|
projectDir: string;
|
|
10
18
|
hmr?: boolean;
|
|
11
19
|
open?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/dev/command.ts"],"names":[],"mappings":"AAAA;;GAEG;AAmBH,OAAO,EAAE,KAAK,YAAY,EAA2B,MAAM,qBAAqB,CAAC;AACjF,OAAO,EAAuB,KAAK,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAE9E,OAAO,EAAwC,KAAK,WAAW,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"command.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/dev/command.ts"],"names":[],"mappings":"AAAA;;GAEG;AAmBH,OAAO,EAAE,KAAK,YAAY,EAA2B,MAAM,qBAAqB,CAAC;AACjF,OAAO,EAAuB,KAAK,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAE9E,OAAO,EAAwC,KAAK,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAM1F,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb;;;;;;OAMG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,UAAU,EAAE,MAAM,CAAC;IACnB,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,8EAA8E;IAC9E,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED,MAAM,MAAM,iBAAiB,GAAG,UAAU,CAAC;AAE3C,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;IACrB,IAAI,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;IACpB;;;;;OAKG;IACH,IAAI,EAAE,MAAM,CAAC;IACb,2DAA2D;IAC3D,IAAI,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAC3B;AAQD,wBAAsB,cAAc,CAClC,QAAQ,CAAC,EAAE,MAAM,GAChB,OAAO,CAAC;IAAE,QAAQ,EAAE,YAAY,GAAG,IAAI,CAAC;IAAC,QAAQ,EAAE,aAAa,EAAE,CAAA;CAAE,CAAC,CAQvE;AAED,wBAAgB,gCAAgC,CAC9C,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,aAAa,GACrB,WAAW,CAEb;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAsB,wBAAwB,CAAC,CAAC,EAC9C,aAAa,EAAE,MAAM,EACrB,KAAK,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,CAAC,CAAC,GAClC,OAAO,CAAC;IAAE,MAAM,EAAE,CAAC,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,CAoBtC;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAsB,0BAA0B,CAC9C,aAAa,EAAE,MAAM,EACrB,KAAK,GAAE,MAAM,OAAO,CAAC,IAAI,CAAuB,EAChD,KAAK,GAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAmB,GAC1D,OAAO,CAAC,OAAO,CAAC,CAIlB;AAED,wBAAgB,UAAU,CAAC,OAAO,EAAE,UAAU,GAAG,OAAO,CAAC,gBAAgB,CAAC,CA6SzE"}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
import { compileAllMDX, watchMDX } from "../../../src/build/index.js";
|
|
5
5
|
import { CONFIG_NOT_FOUND, PORT_IN_USE } from "../../../src/errors/index.js";
|
|
6
6
|
import { join } from "../../../src/platform/compat/path/index.js";
|
|
7
|
-
import { runtime } from "../../../src/platform/index.js";
|
|
7
|
+
import { getEnv, runtime } from "../../../src/platform/index.js";
|
|
8
8
|
import { getConfig } from "../../../src/config/index.js";
|
|
9
9
|
import { getEnvironmentConfig } from "../../../src/config/index.js";
|
|
10
10
|
import { startDevServer } from "../../../src/server/index.js";
|
|
@@ -25,6 +25,7 @@ import { createStagedPushOptions, pushCommand } from "../push/index.js";
|
|
|
25
25
|
import { createProjectSelector } from "./project-selector.js";
|
|
26
26
|
import { createDevLogController } from "./log-controller.js";
|
|
27
27
|
import { findAvailablePort, isPortAvailable, isPortInUseError } from "./port-fallback.js";
|
|
28
|
+
import { listInferenceOptions } from "./inference-status.js";
|
|
28
29
|
function authStatus(identity) {
|
|
29
30
|
return isApiKeyIdentity(identity)
|
|
30
31
|
? "Authenticated with an API key"
|
|
@@ -99,7 +100,7 @@ export async function clearLocalCachesIfPortFree(requestedPort, clear = clearAll
|
|
|
99
100
|
}
|
|
100
101
|
export function devCommand(options) {
|
|
101
102
|
return withSpan("cli.command.dev", async () => {
|
|
102
|
-
const { port, projectDir, hmr = true, open = false, demoMode = false, clearLocalCaches = false, } = options;
|
|
103
|
+
const { port, portExplicit, projectDir, hmr = true, open = false, demoMode = false, clearLocalCaches = false, } = options;
|
|
103
104
|
const startTime = Date.now();
|
|
104
105
|
let doneResolve;
|
|
105
106
|
const done = new Promise((resolve) => {
|
|
@@ -120,7 +121,14 @@ export function devCommand(options) {
|
|
|
120
121
|
throw error;
|
|
121
122
|
}
|
|
122
123
|
const DEFAULT_DEV_PORT = 3000;
|
|
123
|
-
|
|
124
|
+
// Use `portExplicit` when provided so that `PORT=3000` is honoured even
|
|
125
|
+
// though 3000 equals the default — the old sentinel `port !== 3000` would
|
|
126
|
+
// silently discard an explicit env-var request that happens to equal the
|
|
127
|
+
// default value. Fall back to the sentinel for callers that predate this
|
|
128
|
+
// field.
|
|
129
|
+
const finalPort = (portExplicit ?? port !== DEFAULT_DEV_PORT)
|
|
130
|
+
? port
|
|
131
|
+
: (config?.dev?.port ?? port);
|
|
124
132
|
const enableHMR = config?.dev?.hmr !== false && hmr;
|
|
125
133
|
if (clearLocalCaches)
|
|
126
134
|
await clearLocalCachesIfPortFree(finalPort);
|
|
@@ -247,13 +255,25 @@ export function devCommand(options) {
|
|
|
247
255
|
stop: shutdown,
|
|
248
256
|
};
|
|
249
257
|
}
|
|
250
|
-
const serverUrl = `http://
|
|
258
|
+
const serverUrl = `http://localhost:${boundPort}`;
|
|
251
259
|
const elapsed = Date.now() - startTime;
|
|
252
260
|
console.log();
|
|
253
261
|
console.log(` ✓ Ready in ${formatDuration(elapsed)}`);
|
|
254
262
|
console.log(` ${brand(serverUrl)}`);
|
|
263
|
+
const inferenceOptions = listInferenceOptions({
|
|
264
|
+
apiToken: runtimeAuth.apiToken,
|
|
265
|
+
projectSlug: runtimeAuth.projectSlug,
|
|
266
|
+
openaiApiKey: getEnv("OPENAI_API_KEY"),
|
|
267
|
+
openaiBaseUrl: getEnv("OPENAI_BASE_URL"),
|
|
268
|
+
anthropicApiKey: getEnv("ANTHROPIC_API_KEY"),
|
|
269
|
+
googleApiKey: getEnv("GOOGLE_API_KEY") ?? getEnv("GOOGLE_GENERATIVE_AI_API_KEY"),
|
|
270
|
+
mistralApiKey: getEnv("MISTRAL_API_KEY"),
|
|
271
|
+
});
|
|
272
|
+
if (inferenceOptions.length > 0) {
|
|
273
|
+
console.log(` ${dim("Inference")} ${brand(inferenceOptions.join(", "))}`);
|
|
274
|
+
}
|
|
255
275
|
if (mcpServer && isVerbose()) {
|
|
256
|
-
console.log(` ${dim("MCP")} ${brand(`http://
|
|
276
|
+
console.log(` ${dim("MCP")} ${brand(`http://localhost:${mcpPort}/mcp`)}`);
|
|
257
277
|
}
|
|
258
278
|
if (isTTY()) {
|
|
259
279
|
console.log(devShortcuts());
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Dev command handler
|
|
3
3
|
*/
|
|
4
4
|
import type { ParsedArgs } from "../../shared/types.js";
|
|
5
|
-
|
|
5
|
+
declare const parseDevArgsBase: (args: ParsedArgs) => import("../../shared/args.js").SafeParseResult<import("../../../src/extensions/schema/schema-validator.js").InferShape<{
|
|
6
6
|
port: import("../../../src/internal-agents/schema.js").Schema<number>;
|
|
7
7
|
project: import("../../../src/internal-agents/schema.js").Schema<string | undefined>;
|
|
8
8
|
hmr: import("../../../src/internal-agents/schema.js").Schema<boolean>;
|
|
@@ -10,5 +10,11 @@ export declare const parseDevArgs: (args: ParsedArgs) => import("../../shared/ar
|
|
|
10
10
|
open: import("../../../src/internal-agents/schema.js").Schema<boolean>;
|
|
11
11
|
debug: import("../../../src/internal-agents/schema.js").Schema<boolean>;
|
|
12
12
|
}>>;
|
|
13
|
+
/**
|
|
14
|
+
* Parses dev command arguments, honouring `PORT` / `VERYFRONT_PORT` as
|
|
15
|
+
* lower-precedence defaults when no explicit `--port` / `-p` is given.
|
|
16
|
+
*/
|
|
17
|
+
export declare const parseDevArgs: typeof parseDevArgsBase;
|
|
13
18
|
export declare function handleDevCommand(args: ParsedArgs): Promise<void>;
|
|
19
|
+
export {};
|
|
14
20
|
//# sourceMappingURL=handler.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handler.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/dev/handler.ts"],"names":[],"mappings":"AAAA;;GAEG;AAUH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"handler.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/dev/handler.ts"],"names":[],"mappings":"AAAA;;GAEG;AAUH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAmFxD,QAAA,MAAM,gBAAgB;;;;;;;GAOpB,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,YAAY,EAAE,OAAO,gBAajC,CAAC;AAwBF,wBAAsB,gBAAgB,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CAsDtE"}
|
|
@@ -3,12 +3,80 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { defineSchema, lazySchema } from "../../../src/schemas/index.js";
|
|
5
5
|
import { isAbsolute, join } from "../../../src/platform/compat/path/index.js";
|
|
6
|
-
import { cwd, setEnv } from "../../../src/platform/index.js";
|
|
6
|
+
import { cwd, getEnv, setEnv } from "../../../src/platform/index.js";
|
|
7
7
|
import { createFileSystem } from "../../../src/platform/index.js";
|
|
8
|
-
import { cliLogger, DEFAULT_DEV_SERVER_PORT, showHeader } from "../../utils/index.js";
|
|
8
|
+
import { cliLogger, DEFAULT_DEV_SERVER_PORT, logWarning, showHeader } from "../../utils/index.js";
|
|
9
9
|
import { refreshLoggerConfig } from "../../../src/utils/index.js";
|
|
10
10
|
import { createArgParser, parseArgsOrThrow } from "../../shared/args.js";
|
|
11
11
|
import { ensureCliBundlerContracts } from "../../shared/default-contracts.js";
|
|
12
|
+
/**
|
|
13
|
+
* Parse a port from an env var string. Returns `undefined` when the var is
|
|
14
|
+
* absent, empty, not an all-digit integer, or outside the valid port range
|
|
15
|
+
* 1–65535. Invalid values emit a warning so the developer sees exactly what
|
|
16
|
+
* was rejected rather than getting a silent fallback.
|
|
17
|
+
*
|
|
18
|
+
* `Number.parseInt("3001abc")` silently returns 3001, so this function requires
|
|
19
|
+
* the entire trimmed string to be digits before converting — no prefix parsing.
|
|
20
|
+
*/
|
|
21
|
+
function parsePortEnv(name) {
|
|
22
|
+
const raw = getEnv(name);
|
|
23
|
+
if (raw === undefined)
|
|
24
|
+
return undefined;
|
|
25
|
+
const trimmed = raw.trim();
|
|
26
|
+
if (trimmed === "")
|
|
27
|
+
return undefined;
|
|
28
|
+
if (!/^\d+$/.test(trimmed)) {
|
|
29
|
+
logWarning(`${name}=${JSON.stringify(raw)} is not a valid port number; ignoring`);
|
|
30
|
+
return undefined;
|
|
31
|
+
}
|
|
32
|
+
const port = Number(trimmed);
|
|
33
|
+
if (port < 1 || port > 65535) {
|
|
34
|
+
logWarning(`${name}=${port} is outside the valid port range (1-65535); ignoring`);
|
|
35
|
+
return undefined;
|
|
36
|
+
}
|
|
37
|
+
return port;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Read a numeric port from an env var, returning `fallback` when the var is
|
|
41
|
+
* absent or contains a value that fails strict validation (non-integer string,
|
|
42
|
+
* trailing garbage, or a value outside the 1-65535 range).
|
|
43
|
+
*/
|
|
44
|
+
function readPortEnv(name, fallback) {
|
|
45
|
+
return parsePortEnv(name) ?? fallback;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Returns true when the named env var holds a valid port number (all-digit
|
|
49
|
+
* string within 1–65535). This is a pure predicate — it never emits warnings,
|
|
50
|
+
* because those were already emitted by `parsePortEnv` during arg parsing.
|
|
51
|
+
* Used to determine whether the port came from an explicit env var rather than
|
|
52
|
+
* falling through to the hardcoded default.
|
|
53
|
+
*/
|
|
54
|
+
function isValidPortEnv(name) {
|
|
55
|
+
const raw = getEnv(name);
|
|
56
|
+
if (!raw)
|
|
57
|
+
return false;
|
|
58
|
+
const t = raw.trim();
|
|
59
|
+
if (!/^\d+$/.test(t))
|
|
60
|
+
return false;
|
|
61
|
+
const n = Number(t);
|
|
62
|
+
return n >= 1 && n <= 65535;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* The default port to use for `veryfront dev`, resolved from env vars.
|
|
66
|
+
*
|
|
67
|
+
* Priority (highest → lowest):
|
|
68
|
+
* 1. `--port` / `-p` flag — explicit, handled by `parseDevArgs`
|
|
69
|
+
* 2. `PORT` — the near-universal PaaS / framework convention
|
|
70
|
+
* 3. `VERYFRONT_PORT` — Veryfront-specific override
|
|
71
|
+
* 4. 3000 — hardcoded default
|
|
72
|
+
*
|
|
73
|
+
* This matches how `veryfront serve` handles the same env vars, and how
|
|
74
|
+
* Next.js, Vite, Create React App, Heroku, and Railway all treat `PORT`.
|
|
75
|
+
*/
|
|
76
|
+
function getDefaultDevPort() {
|
|
77
|
+
const veryfrontPort = readPortEnv("VERYFRONT_PORT", DEFAULT_DEV_SERVER_PORT);
|
|
78
|
+
return readPortEnv("PORT", veryfrontPort);
|
|
79
|
+
}
|
|
12
80
|
const getDevArgsSchema = defineSchema((v) => v.object({
|
|
13
81
|
port: v.number().default(DEFAULT_DEV_SERVER_PORT),
|
|
14
82
|
project: v.string().optional(),
|
|
@@ -18,7 +86,7 @@ const getDevArgsSchema = defineSchema((v) => v.object({
|
|
|
18
86
|
debug: v.boolean().default(false),
|
|
19
87
|
}));
|
|
20
88
|
const DevArgsSchema = lazySchema(getDevArgsSchema);
|
|
21
|
-
|
|
89
|
+
const parseDevArgsBase = createArgParser(DevArgsSchema, {
|
|
22
90
|
port: { keys: ["port", "p"], type: "number" },
|
|
23
91
|
project: { keys: ["project"], type: "string" },
|
|
24
92
|
hmr: { keys: ["hmr"], type: "boolean" },
|
|
@@ -26,6 +94,24 @@ export const parseDevArgs = createArgParser(DevArgsSchema, {
|
|
|
26
94
|
open: { keys: ["open"], type: "boolean" },
|
|
27
95
|
debug: { keys: ["debug", "d"], type: "boolean" },
|
|
28
96
|
});
|
|
97
|
+
/**
|
|
98
|
+
* Parses dev command arguments, honouring `PORT` / `VERYFRONT_PORT` as
|
|
99
|
+
* lower-precedence defaults when no explicit `--port` / `-p` is given.
|
|
100
|
+
*/
|
|
101
|
+
export const parseDevArgs = (args) => {
|
|
102
|
+
const result = parseDevArgsBase(args);
|
|
103
|
+
if (!result.success)
|
|
104
|
+
return result;
|
|
105
|
+
return {
|
|
106
|
+
success: true,
|
|
107
|
+
data: {
|
|
108
|
+
...result.data,
|
|
109
|
+
port: args.port === undefined && args.p === undefined
|
|
110
|
+
? getDefaultDevPort()
|
|
111
|
+
: result.data.port,
|
|
112
|
+
},
|
|
113
|
+
};
|
|
114
|
+
};
|
|
29
115
|
async function resolveProjectDir(projectArg) {
|
|
30
116
|
if (projectArg) {
|
|
31
117
|
const projectDir = isAbsolute(projectArg) ? projectArg : join(cwd(), projectArg);
|
|
@@ -45,6 +131,26 @@ async function resolveProjectDir(projectArg) {
|
|
|
45
131
|
export async function handleDevCommand(args) {
|
|
46
132
|
const opts = parseArgsOrThrow(parseDevArgs, "dev", args);
|
|
47
133
|
showHeader();
|
|
134
|
+
// Warn when `PORT` is set but `--port` overrides it. The developer set an
|
|
135
|
+
// env var that the server is not going to use, and silent divergence is the
|
|
136
|
+
// original defect this fixes. Only `PORT` is surfaced here (not
|
|
137
|
+
// `VERYFRONT_PORT`) because `PORT` is the near-universal convention that
|
|
138
|
+
// developers arriving from Next.js, Vite, Heroku, and Railway expect to work.
|
|
139
|
+
//
|
|
140
|
+
// `portExplicit` is also used to carry provenance into devCommand so that
|
|
141
|
+
// `PORT=3000` is honoured even when 3000 equals the hardcoded default — the
|
|
142
|
+
// sentinel `port !== 3000` check in devCommand must not swallow an explicit
|
|
143
|
+
// env var that happens to equal the default value.
|
|
144
|
+
const portExplicit = args.port !== undefined ||
|
|
145
|
+
args.p !== undefined ||
|
|
146
|
+
isValidPortEnv("PORT") ||
|
|
147
|
+
isValidPortEnv("VERYFRONT_PORT");
|
|
148
|
+
if (args.port !== undefined || args.p !== undefined) {
|
|
149
|
+
const portFromEnv = parsePortEnv("PORT");
|
|
150
|
+
if (portFromEnv !== undefined && opts.port !== portFromEnv) {
|
|
151
|
+
logWarning(`PORT=${portFromEnv} is set but --port ${opts.port} takes precedence`);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
48
154
|
await ensureCliBundlerContracts();
|
|
49
155
|
const projectDir = await resolveProjectDir(opts.project);
|
|
50
156
|
// Enable verbose logging when --debug flag is passed
|
|
@@ -56,6 +162,7 @@ export async function handleDevCommand(args) {
|
|
|
56
162
|
const { devCommand } = await import("./index.js");
|
|
57
163
|
const { done } = await devCommand({
|
|
58
164
|
port: opts.port,
|
|
165
|
+
portExplicit,
|
|
59
166
|
projectDir,
|
|
60
167
|
hmr: opts.hmr && !opts.noHmr,
|
|
61
168
|
open: opts.open,
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface InferenceEnvironment {
|
|
2
|
+
apiToken?: string;
|
|
3
|
+
projectSlug?: string;
|
|
4
|
+
openaiApiKey?: string;
|
|
5
|
+
openaiBaseUrl?: string;
|
|
6
|
+
anthropicApiKey?: string;
|
|
7
|
+
googleApiKey?: string;
|
|
8
|
+
mistralApiKey?: string;
|
|
9
|
+
}
|
|
10
|
+
/** Return the inference paths the current dev process can use without exposing credentials. */
|
|
11
|
+
export declare function listInferenceOptions(environment: InferenceEnvironment): string[];
|
|
12
|
+
//# sourceMappingURL=inference-status.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inference-status.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/dev/inference-status.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAMD,+FAA+F;AAC/F,wBAAgB,oBAAoB,CAAC,WAAW,EAAE,oBAAoB,GAAG,MAAM,EAAE,CAgBhF"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
function isSet(value) {
|
|
2
|
+
return Boolean(value?.trim());
|
|
3
|
+
}
|
|
4
|
+
/** Return the inference paths the current dev process can use without exposing credentials. */
|
|
5
|
+
export function listInferenceOptions(environment) {
|
|
6
|
+
const options = [];
|
|
7
|
+
if (isSet(environment.apiToken) && isSet(environment.projectSlug)) {
|
|
8
|
+
options.push("Veryfront Cloud AI Gateway");
|
|
9
|
+
}
|
|
10
|
+
if (isSet(environment.openaiApiKey)) {
|
|
11
|
+
options.push(isSet(environment.openaiBaseUrl) ? "OpenAI-compatible service" : "OpenAI direct");
|
|
12
|
+
}
|
|
13
|
+
if (isSet(environment.anthropicApiKey))
|
|
14
|
+
options.push("Anthropic direct");
|
|
15
|
+
if (isSet(environment.googleApiKey))
|
|
16
|
+
options.push("Google direct");
|
|
17
|
+
if (isSet(environment.mistralApiKey))
|
|
18
|
+
options.push("Mistral direct");
|
|
19
|
+
return options;
|
|
20
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command-help.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/login/command-help.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEvD,eAAO,MAAM,SAAS,EAAE,
|
|
1
|
+
{"version":3,"file":"command-help.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/login/command-help.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEvD,eAAO,MAAM,SAAS,EAAE,WAoCvB,CAAC"}
|
|
@@ -32,5 +32,6 @@ export const loginHelp = {
|
|
|
32
32
|
"Without options, prompts for authentication method",
|
|
33
33
|
"OAuth methods open browser for authentication",
|
|
34
34
|
"Token is stored in ~/.config/veryfront/token",
|
|
35
|
+
"Exits 1 when no credential was obtained, so scripts can gate on it",
|
|
35
36
|
],
|
|
36
37
|
};
|
|
@@ -17,7 +17,7 @@ export const mcpHelp = {
|
|
|
17
17
|
"The CLI MCP server is development-only. Production start does not expose vf_* tools.",
|
|
18
18
|
"",
|
|
19
19
|
"Claude Code setup (~/.claude.json):",
|
|
20
|
-
` "mcpServers": { "veryfront": { "url": "http://
|
|
20
|
+
` "mcpServers": { "veryfront": { "url": "http://localhost:${DEFAULT_DEV_MCP_PORT}/mcp" } }`,
|
|
21
21
|
"",
|
|
22
22
|
"Available tools:",
|
|
23
23
|
" • vf_list_local_projects - Discover projects on filesystem",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command-help.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/whoami/command-help.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEvD,eAAO,MAAM,UAAU,EAAE,
|
|
1
|
+
{"version":3,"file":"command-help.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/whoami/command-help.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEvD,eAAO,MAAM,UAAU,EAAE,WAYxB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../../src/cli/mcp/server.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../../src/cli/mcp/server.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAiDH,MAAM,WAAW,eAAe;IAC9B,6DAA6D;IAC7D,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,iEAAiE;IACjE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,mCAAmC;IACnC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,qBAAqB;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,qBAAa,YAAY;IACvB,OAAO,CAAC,MAAM,CAAkB;IAChC,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,WAAW,CAA4B;IAC/C,OAAO,CAAC,UAAU,CAA2B;IAC7C,OAAO,CAAC,gBAAgB,CAA8B;gBAE1C,MAAM,GAAE,eAAoB;IAWxC,KAAK,IAAI,IAAI;IAiBP,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAgB3B,OAAO,CAAC,SAAS;IAyHjB,OAAO,CAAC,aAAa;IAiBrB,OAAO,CAAC,cAAc;IAyBtB,OAAO,CAAC,gBAAgB;IAcxB,OAAO,CAAC,eAAe;IAevB,OAAO,CAAC,eAAe;IAsCvB,OAAO,CAAC,2BAA2B;IAInC,OAAO,CAAC,mBAAmB;IAuD3B,OAAO,CAAC,mBAAmB;IAiJ3B,OAAO,CAAC,iBAAiB;IAiCzB,OAAO,CAAC,gBAAgB;CAwCzB;AAED,wBAAgB,eAAe,CAAC,MAAM,EAAE,eAAe,GAAG,YAAY,CAIrE;AAED,cAAc,kCAAkC,CAAC;AACjD,cAAc,YAAY,CAAC"}
|
package/esm/cli/mcp/server.js
CHANGED
|
@@ -16,11 +16,12 @@ import { zodToJsonSchema } from "../../src/tool/schema/index.js";
|
|
|
16
16
|
import { allTools, getTool, setServerStartTime } from "./tools.js";
|
|
17
17
|
import { startStdioJsonRpc } from "./stdio.js";
|
|
18
18
|
import { buildInitializeResult, errorResponse, internalError, invalidRequestError, JsonRpcError, JSONRPCRequestSchema, parseError, PromptsGetParamsSchema, ResourcesReadParamsSchema, successResponse, ToolsCallParamsSchema, } from "./jsonrpc.js";
|
|
19
|
+
// Exact loopback origins only. `localhost` is the hostname the CLI prints.
|
|
20
|
+
// Project subdomains were never admitted here and still are not.
|
|
19
21
|
const ALLOWED_HTTP_ORIGIN_HOSTS = new Set([
|
|
20
22
|
"localhost",
|
|
21
23
|
"127.0.0.1",
|
|
22
24
|
"[::1]",
|
|
23
|
-
"veryfront.me",
|
|
24
25
|
]);
|
|
25
26
|
function isAllowedHttpOrigin(origin) {
|
|
26
27
|
if (!origin)
|
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
* Creates a release from a branch and deploys it to an environment through
|
|
5
5
|
* Deploy Execution (`DeployProject.execute`), the same module behind the
|
|
6
6
|
* `vf deploy` CLI command. Success means the deployment is verified and the
|
|
7
|
-
* environment URL
|
|
7
|
+
* environment URL resolves. Read `urlVerification` to tell whether the app
|
|
8
|
+
* itself answered (`served`) or only its access gate did (`gated`).
|
|
8
9
|
*/
|
|
9
10
|
import type { InferSchema } from "../../../src/extensions/schema/index.js";
|
|
10
11
|
import type { MCPTool } from "../../../src/mcp/index.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deploy-tool.d.ts","sourceRoot":"","sources":["../../../../src/cli/mcp/tools/deploy-tool.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"deploy-tool.d.ts","sourceRoot":"","sources":["../../../../src/cli/mcp/tools/deploy-tool.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yCAAyC,CAAC;AAC3E,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AAGzD,OAAO,EAAuB,KAAK,aAAa,EAAE,MAAM,2CAA2C,CAAC;AACpG,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AAEtE,QAAA,MAAM,qBAAqB;;;;GAY1B,CAAC;AAGF,MAAM,MAAM,kBAAkB,GAAG,WAAW,CAAC,UAAU,CAAC,OAAO,qBAAqB,CAAC,CAAC,CAAC;AAEvF,MAAM,MAAM,mBAAmB,GAC3B,CAAC;IAAE,OAAO,EAAE,IAAI,CAAA;CAAE,GAAG,YAAY,CAAC,GAClC;IAAE,OAAO,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AAEtC,MAAM,WAAW,oBAAoB;IACnC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,kFAAkF;IAClF,aAAa,CAAC,EAAE,aAAa,CAAC;CAC/B;AAED;;;;GAIG;AACH,wBAAsB,aAAa,CACjC,KAAK,EAAE,kBAAkB,EACzB,OAAO,GAAE,oBAAyB,GACjC,OAAO,CAAC,mBAAmB,CAAC,CA+C9B;AAED,eAAO,MAAM,eAAe,EAAE,OAAO,CAAC,kBAAkB,EAAE,mBAAmB,CAuB5E,CAAC"}
|
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
* Creates a release from a branch and deploys it to an environment through
|
|
5
5
|
* Deploy Execution (`DeployProject.execute`), the same module behind the
|
|
6
6
|
* `vf deploy` CLI command. Success means the deployment is verified and the
|
|
7
|
-
* environment URL
|
|
7
|
+
* environment URL resolves. Read `urlVerification` to tell whether the app
|
|
8
|
+
* itself answered (`served`) or only its access gate did (`gated`).
|
|
8
9
|
*/
|
|
9
10
|
import { defineSchema, lazySchema } from "../../../src/schemas/index.js";
|
|
10
11
|
import { getEnvironmentConfig } from "../../../src/config/index.js";
|
|
@@ -76,7 +77,10 @@ export const vfTriggerDeploy = {
|
|
|
76
77
|
"Requires a successful vf push from the current project, then creates and verifies a release " +
|
|
77
78
|
"from the specified branch, deploys it to the target environment, waits for release assets " +
|
|
78
79
|
"and environment readiness, and returns the deployment evidence including the live URL. " +
|
|
79
|
-
"Success means the
|
|
80
|
+
"Success means the deployment is verified and the environment URL resolves. " +
|
|
81
|
+
"Check the returned urlVerification field to tell what the readiness probe established: " +
|
|
82
|
+
"'served' means the app itself answered, 'gated' means only its access gate answered so the " +
|
|
83
|
+
"app was never observed, and 'unprobed' means the project has no static page route to check. " +
|
|
80
84
|
"Requires a valid API token (set VERYFRONT_API_TOKEN or run 'veryfront login'). " +
|
|
81
85
|
"Do not use for local builds; use vf_build instead. " +
|
|
82
86
|
"Do not use for running tests before deploy; use vf_run_tests instead.",
|
|
@@ -63,7 +63,7 @@ export const vfGetDebugContext = {
|
|
|
63
63
|
description: "Use this when you need the dev server's debug context including project slug, environment, request context mode, and multi-project configuration. Returns project info and server mode. Do not use for error details — use vf_get_errors instead.",
|
|
64
64
|
inputSchema: getDebugContextInput,
|
|
65
65
|
execute: (input) => withSpan("cli.mcp.tool.vf_get_debug_context", async () => {
|
|
66
|
-
const host = input.project ? `${input.project}.
|
|
66
|
+
const host = input.project ? `${input.project}.localhost` : "localhost";
|
|
67
67
|
const url = `http://${host}:${input.port}/_vf_debug/context`;
|
|
68
68
|
try {
|
|
69
69
|
const response = await fetch(url);
|
package/esm/cli/mcp/tools.js
CHANGED
|
@@ -113,7 +113,7 @@ export function createVfGetStatus(env = getEnvironmentConfig()) {
|
|
|
113
113
|
const port = env.port ?? DEFAULT_MCP_PORT;
|
|
114
114
|
return {
|
|
115
115
|
running: true,
|
|
116
|
-
url: `http://
|
|
116
|
+
url: `http://localhost:${port}`,
|
|
117
117
|
port,
|
|
118
118
|
errorCount: counts.compile + counts.runtime + counts.bundle,
|
|
119
119
|
warningCount: logs.query({ level: "warn" }).length,
|
package/esm/cli/router.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"router.d.ts","sourceRoot":"","sources":["../../src/cli/router.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"router.d.ts","sourceRoot":"","sources":["../../src/cli/router.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAyHpD;;;;GAIG;AACH,wBAAsB,YAAY,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CAyIlE"}
|