veryfront 0.1.857 → 0.1.859
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/esm/cli/commands/lint/handler.d.ts.map +1 -1
- package/esm/cli/commands/lint/handler.js +9 -12
- package/esm/cli/commands/mcp/handler.d.ts +3 -0
- package/esm/cli/commands/mcp/handler.d.ts.map +1 -1
- package/esm/cli/commands/mcp/handler.js +4 -4
- package/esm/cli/commands/serve/split-mode.d.ts +1 -0
- package/esm/cli/commands/serve/split-mode.d.ts.map +1 -1
- package/esm/cli/commands/serve/split-mode.js +45 -13
- package/esm/cli/commands/test/command.d.ts.map +1 -1
- package/esm/cli/commands/test/command.js +5 -2
- package/esm/cli/commands/test/handler.d.ts.map +1 -1
- package/esm/cli/commands/test/handler.js +19 -13
- package/esm/cli/mcp/standalone.d.ts +7 -0
- package/esm/cli/mcp/standalone.d.ts.map +1 -1
- package/esm/cli/mcp/standalone.js +9 -10
- package/esm/cli/mcp/tools/context7-tools.d.ts.map +1 -1
- package/esm/cli/mcp/tools/context7-tools.js +3 -3
- package/esm/cli/mcp/tools/helpers.d.ts +8 -0
- package/esm/cli/mcp/tools/helpers.d.ts.map +1 -1
- package/esm/cli/mcp/tools/project-tools.d.ts.map +1 -1
- package/esm/cli/mcp/tools/project-tools.js +33 -3
- package/esm/cli/mcp/tools/run-lint-tool.d.ts +6 -0
- package/esm/cli/mcp/tools/run-lint-tool.d.ts.map +1 -1
- package/esm/cli/mcp/tools/run-lint-tool.js +10 -58
- package/esm/cli/mcp/tools/run-tests-tool.d.ts +6 -0
- package/esm/cli/mcp/tools/run-tests-tool.d.ts.map +1 -1
- package/esm/cli/mcp/tools/run-tests-tool.js +8 -32
- package/esm/cli/scaffold/engine.js +1 -1
- package/esm/cli/shared/animation.d.ts +8 -0
- package/esm/cli/shared/animation.d.ts.map +1 -1
- package/esm/cli/shared/animation.js +2 -7
- package/esm/cli/templates/manifest.js +7 -7
- package/esm/cli/utils/write-run-result.js +4 -4
- package/esm/deno.js +1 -1
- package/esm/src/agent/runtime/constants.js +1 -1
- package/esm/src/chat/provider-errors.d.ts.map +1 -1
- package/esm/src/chat/provider-errors.js +20 -0
- package/esm/src/platform/compat/process/command.d.ts.map +1 -1
- package/esm/src/platform/compat/process/command.js +4 -3
- package/esm/src/platform/compat/process/env.d.ts.map +1 -1
- package/esm/src/platform/compat/process/env.js +13 -9
- package/esm/src/platform/compat/process/lifecycle.d.ts.map +1 -1
- package/esm/src/platform/compat/process/lifecycle.js +55 -37
- package/esm/src/platform/compat/process/runtime-process.d.ts.map +1 -1
- package/esm/src/platform/compat/process/runtime-process.js +4 -3
- package/esm/src/platform/compat/runtime.d.ts +2 -0
- package/esm/src/platform/compat/runtime.d.ts.map +1 -1
- package/esm/src/platform/compat/runtime.js +14 -6
- package/esm/src/platform/compat/stdin.d.ts.map +1 -1
- package/esm/src/platform/compat/stdin.js +17 -13
- package/esm/src/utils/version-constant.d.ts +1 -1
- package/esm/src/utils/version-constant.js +1 -1
- package/package.json +1 -1
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
* Runs the project test suite via subprocess and returns structured results.
|
|
5
5
|
* Reuses parseTestOutput from the CLI test command.
|
|
6
6
|
*/
|
|
7
|
-
import * as dntShim from "../../../_dnt.shims.js";
|
|
8
7
|
import { defineSchema, lazySchema } from "../../../src/schemas/index.js";
|
|
8
|
+
import { runCommand } from "../../../src/platform/index.js";
|
|
9
9
|
import { parseTestOutput } from "../../commands/test/command.js";
|
|
10
10
|
const getRunTestsInput = defineSchema((v) => v.object({
|
|
11
11
|
filter: v.string().optional().describe("Filter tests by name pattern. Example: 'router' to run only tests matching 'router'."),
|
|
@@ -35,41 +35,17 @@ export const TEST_ENV = {
|
|
|
35
35
|
};
|
|
36
36
|
/** Spawn deno test and return structured results. Exported for standalone reuse. */
|
|
37
37
|
export async function executeTests(input) {
|
|
38
|
-
const
|
|
38
|
+
const timeoutMs = input.timeout ?? 300000;
|
|
39
|
+
const result = await runCommand("deno", {
|
|
39
40
|
args: buildTestArgs(input),
|
|
40
|
-
|
|
41
|
-
stderr: "piped",
|
|
41
|
+
capture: true,
|
|
42
42
|
env: TEST_ENV,
|
|
43
|
+
timeoutMs,
|
|
43
44
|
});
|
|
44
|
-
|
|
45
|
-
const timeoutMs = input.timeout ?? 300000;
|
|
46
|
-
const outputPromise = child.output();
|
|
47
|
-
let timerId;
|
|
48
|
-
const timeoutResult = "timeout";
|
|
49
|
-
const timeoutPromise = new Promise((resolve) => {
|
|
50
|
-
timerId = dntShim.setTimeout(() => {
|
|
51
|
-
resolve(timeoutResult);
|
|
52
|
-
}, timeoutMs);
|
|
53
|
-
// Don't prevent process exit while waiting
|
|
54
|
-
dntShim.Deno.unrefTimer(timerId);
|
|
55
|
-
});
|
|
56
|
-
const result = await Promise.race([outputPromise, timeoutPromise]);
|
|
57
|
-
if (timerId !== undefined) {
|
|
58
|
-
clearTimeout(timerId);
|
|
59
|
-
}
|
|
60
|
-
if (result === timeoutResult) {
|
|
61
|
-
try {
|
|
62
|
-
child.kill();
|
|
63
|
-
}
|
|
64
|
-
catch {
|
|
65
|
-
// Process may have already exited
|
|
66
|
-
}
|
|
67
|
-
await outputPromise.catch(() => undefined);
|
|
45
|
+
if (result.code === 124) {
|
|
68
46
|
throw new Error(`Test execution timed out after ${timeoutMs}ms`);
|
|
69
47
|
}
|
|
70
|
-
|
|
71
|
-
const stderr = new TextDecoder().decode(result.stderr);
|
|
72
|
-
return parseTestOutput(stdout + "\n" + stderr, result.code);
|
|
48
|
+
return parseTestOutput(`${result.stdout ?? ""}\n${result.stderr ?? ""}`, result.code);
|
|
73
49
|
}
|
|
74
50
|
export const vfRunTests = {
|
|
75
51
|
name: "vf_run_tests",
|
|
@@ -83,7 +59,7 @@ export const vfRunTests = {
|
|
|
83
59
|
description: "Use this when you need to run the project's test suite and get structured pass/fail results. " +
|
|
84
60
|
"Returns a summary with total, passed, failed, skipped counts and failure details including " +
|
|
85
61
|
"file path, test name, error message, and line number. " +
|
|
86
|
-
"Do not use for lint checks
|
|
62
|
+
"Do not use for lint checks. Use vf_run_lint instead.",
|
|
87
63
|
inputSchema: runTestsInput,
|
|
88
64
|
execute: (input) => executeTests(input),
|
|
89
65
|
};
|
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Animation state for accessibility
|
|
3
|
+
*
|
|
4
|
+
* Controls whether CLI animations (spinners, progress bars) are disabled.
|
|
5
|
+
* Set by --no-animation flag or when TERM=dumb.
|
|
6
|
+
*
|
|
7
|
+
* @module cli/shared/animation
|
|
8
|
+
*/
|
|
1
9
|
export declare function setAnimationDisabled(disabled: boolean): void;
|
|
2
10
|
export declare function isAnimationDisabled(): boolean;
|
|
3
11
|
//# sourceMappingURL=animation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"animation.d.ts","sourceRoot":"","sources":["../../../src/cli/shared/animation.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"animation.d.ts","sourceRoot":"","sources":["../../../src/cli/shared/animation.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAMH,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,OAAO,GAAG,IAAI,CAE5D;AAED,wBAAgB,mBAAmB,IAAI,OAAO,CAG7C"}
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* @module cli/shared/animation
|
|
8
8
|
*/
|
|
9
|
-
import
|
|
9
|
+
import { getEnv } from "../../src/platform/index.js";
|
|
10
10
|
let _animationDisabled = false;
|
|
11
11
|
export function setAnimationDisabled(disabled) {
|
|
12
12
|
_animationDisabled = disabled;
|
|
@@ -14,10 +14,5 @@ export function setAnimationDisabled(disabled) {
|
|
|
14
14
|
export function isAnimationDisabled() {
|
|
15
15
|
if (_animationDisabled)
|
|
16
16
|
return true;
|
|
17
|
-
|
|
18
|
-
return dntShim.Deno.env.get("TERM") === "dumb";
|
|
19
|
-
}
|
|
20
|
-
catch {
|
|
21
|
-
return false;
|
|
22
|
-
}
|
|
17
|
+
return getEnv("TERM") === "dumb";
|
|
23
18
|
}
|
|
@@ -27,7 +27,7 @@ export default {
|
|
|
27
27
|
"app/page.tsx": "'use client'\n\nimport { Chat, useChat } from 'veryfront/chat'\n\nexport default function ChatPage(): React.JSX.Element {\n const chat = useChat({ api: '/api/ag-ui' })\n\n return <Chat {...chat} className=\"flex-1 min-h-0\" placeholder=\"Message\" />\n}\n",
|
|
28
28
|
"globals.css": "@import \"tailwindcss\";\n",
|
|
29
29
|
"README.md": "# AI Agent\n\nA simple conversational AI with tool support.\n\n## What's included\n\n- Single assistant agent with streaming chat UI\n- Example calculator tool\n- `useChat` hook for real-time responses\n\n## Structure\n\n```\nagents/assistant.ts Agent definition\ntools/calculator.ts Example tool\napp/\n api/ag-ui/route.ts AG-UI endpoint\n page.tsx Chat interface\n```\n\nThis starter is not production-ready.\n",
|
|
30
|
-
"tools/calculator.ts": "import { tool } from \"veryfront/tool\";\nimport { defineSchema } from \"veryfront/schemas\";\n\nexport default tool({\n id: \"calculator\",\n description: \"Perform basic arithmetic operations\",\n inputSchema: defineSchema((v) => v.object({\n operation: v.enum([\"add\", \"subtract\", \"multiply\", \"divide\"]),\n a: v.number(),\n b: v.number(),\n }))(),\n execute:
|
|
30
|
+
"tools/calculator.ts": "import { tool } from \"veryfront/tool\";\nimport { defineSchema } from \"veryfront/schemas\";\n\nexport default tool({\n id: \"calculator\",\n description: \"Perform basic arithmetic operations\",\n inputSchema: defineSchema((v) => v.object({\n operation: v.enum([\"add\", \"subtract\", \"multiply\", \"divide\"]),\n a: v.number(),\n b: v.number(),\n }))(),\n execute: ({ operation, a, b }) => {\n if (operation === \"divide\" && b === 0) {\n throw new Error(\"Cannot divide by zero\");\n }\n\n if (operation === \"add\") return { result: a + b };\n if (operation === \"subtract\") return { result: a - b };\n if (operation === \"multiply\") return { result: a * b };\n return { result: a / b };\n },\n});\n",
|
|
31
31
|
"tsconfig.json": "{\n \"compilerOptions\": {\n \"target\": \"ES2022\",\n \"module\": \"ESNext\",\n \"moduleResolution\": \"bundler\",\n \"strict\": true,\n \"jsx\": \"react-jsx\",\n \"skipLibCheck\": true,\n \"esModuleInterop\": true,\n \"paths\": {\n \"@/*\": [\"./*\"]\n }\n },\n \"include\": [\"**/*.ts\", \"**/*.tsx\"],\n \"exclude\": [\"node_modules\"]\n}\n"
|
|
32
32
|
}
|
|
33
33
|
},
|
|
@@ -608,32 +608,32 @@ export default {
|
|
|
608
608
|
},
|
|
609
609
|
"ai-rules:agents.md": {
|
|
610
610
|
"files": {
|
|
611
|
-
"agents.md": "# Veryfront project guide\n\nThis is a Veryfront project. Veryfront is a framework for building and running AI apps and agents in TypeScript and React.\n\n## Project conventions\n\nUse these folders as runtime boundaries. Create folders only when the feature needs them.\n\n- `app/`: pages, layouts, route handlers, and user-facing API routes.\n- `agents/`: model reasoning and tool use.\n- `tools/`: deterministic callable capabilities.\n- `workflows/`: multi-step coordination.\n- `tasks/`: background work targets.\n- `prompts/`: reusable prompt templates.\n- `resources/`: project data exposed to MCP clients.\n- `skills/`: reusable agent instructions in `skills/<id>/SKILL.md`.\n- `integrations/`: service connectors and integration-local code.\n\n## Developer loop\n\n1. Start local development with `veryfront dev`.\n2. Generate new files with `veryfront generate <type> <name>`.\n3. Inspect current CLI commands with `veryfront schema --json`.\
|
|
611
|
+
"agents.md": "# Veryfront project guide\n\nThis is a Veryfront project. Veryfront is a framework for building and running AI apps and agents in TypeScript and React.\n\n## Project conventions\n\nUse these folders as runtime boundaries. Create folders only when the feature needs them.\n\n- `app/`: pages, layouts, route handlers, and user-facing API routes.\n- `agents/`: model reasoning and tool use.\n- `tools/`: deterministic callable capabilities.\n- `workflows/`: multi-step coordination.\n- `tasks/`: background work targets.\n- `prompts/`: reusable prompt templates.\n- `resources/`: project data exposed to MCP clients.\n- `skills/`: reusable agent instructions in `skills/<id>/SKILL.md`.\n- `integrations/`: service connectors and integration-local code.\n\n## Developer loop\n\n1. Start local development with `veryfront dev`.\n2. Generate new files with `veryfront generate <type> <name>`.\n3. For example, add an agent with a tool and skill by running `veryfront generate agent research-agent`, `veryfront generate tool search-docs`, and `veryfront generate skill research`. Use names that match the app domain.\n4. Inspect current CLI commands with `veryfront schema --json`.\n5. Use https://veryfront.com/docs when local files and CLI schema do not answer a Veryfront API or convention question.\n6. Run focused tests and lint before shipping.\n\n## Coding agent loop\n\nWhen the Veryfront MCP server is connected, call `vf_bootstrap` once at session start. Use `vf_get_conventions` before adding files, `vf_scaffold` for new routes and AI primitives, `vf_get_errors` after edits, and `vf_run_tests` or `vf_run_lint` for verification.\n\n`veryfront dev` starts the HTTP MCP endpoint on the app port plus 2. With the default app port, use `http://localhost:3002/mcp`.\n\nIf MCP is not connected, use `veryfront schema --json` and the documented CLI commands from the shell.\n\nPrefer Veryfront scaffold tools over hand-written boilerplate. Keep app routes, agents, tools, workflows, tasks, resources, prompts, and skills in their expected folders.\n\n## Inference\n\nAgent routes need model access. Use `veryfront login` for the Veryfront Cloud gateway, set `VERYFRONT_API_TOKEN`, or set provider keys such as `OPENAI_API_KEY` or `ANTHROPIC_API_KEY`.\n"
|
|
612
612
|
}
|
|
613
613
|
},
|
|
614
614
|
"ai-rules:claude-code.md": {
|
|
615
615
|
"files": {
|
|
616
|
-
"claude-code.md": "# Veryfront project guide\n\nFollow `AGENTS.md` when it exists. If it does not exist, use this guide.\n\nThis is a Veryfront project. Veryfront is a framework for building and running AI apps and agents in TypeScript and React.\n\n## Project conventions\n\nUse these folders as runtime boundaries. Create folders only when the feature needs them.\n\n- `app/`: pages, layouts, route handlers, and user-facing API routes.\n- `agents/`: model reasoning and tool use.\n- `tools/`: deterministic callable capabilities.\n- `workflows/`: multi-step coordination.\n- `tasks/`: background work targets.\n- `prompts/`: reusable prompt templates.\n- `resources/`: project data exposed to MCP clients.\n- `skills/`: reusable agent instructions in `skills/<id>/SKILL.md`.\n- `integrations/`: service connectors and integration-local code.\n\n## Developer loop\n\n1. Start local development with `veryfront dev`.\n2. Generate new files with `veryfront generate <type> <name>`.\n3. Inspect current CLI commands with `veryfront schema --json`.\
|
|
616
|
+
"claude-code.md": "# Veryfront project guide\n\nFollow `AGENTS.md` when it exists. If it does not exist, use this guide.\n\nThis is a Veryfront project. Veryfront is a framework for building and running AI apps and agents in TypeScript and React.\n\n## Project conventions\n\nUse these folders as runtime boundaries. Create folders only when the feature needs them.\n\n- `app/`: pages, layouts, route handlers, and user-facing API routes.\n- `agents/`: model reasoning and tool use.\n- `tools/`: deterministic callable capabilities.\n- `workflows/`: multi-step coordination.\n- `tasks/`: background work targets.\n- `prompts/`: reusable prompt templates.\n- `resources/`: project data exposed to MCP clients.\n- `skills/`: reusable agent instructions in `skills/<id>/SKILL.md`.\n- `integrations/`: service connectors and integration-local code.\n\n## Developer loop\n\n1. Start local development with `veryfront dev`.\n2. Generate new files with `veryfront generate <type> <name>`.\n3. For example, add an agent with a tool and skill by running `veryfront generate agent research-agent`, `veryfront generate tool search-docs`, and `veryfront generate skill research`. Use names that match the app domain.\n4. Inspect current CLI commands with `veryfront schema --json`.\n5. Use https://veryfront.com/docs when local files and CLI schema do not answer a Veryfront API or convention question.\n6. Run focused tests and lint before shipping.\n\n## Coding agent loop\n\nWhen the Veryfront MCP server is connected, call `vf_bootstrap` once at session start. Use `vf_get_conventions` before adding files, `vf_scaffold` for new routes and AI primitives, `vf_get_errors` after edits, and `vf_run_tests` or `vf_run_lint` for verification.\n\n`veryfront dev` starts the HTTP MCP endpoint on the app port plus 2. With the default app port, use `http://localhost:3002/mcp`.\n\nIf MCP is not connected, use `veryfront schema --json` and the documented CLI commands from the shell.\n\nPrefer Veryfront scaffold tools over hand-written boilerplate. Keep app routes, agents, tools, workflows, tasks, resources, prompts, and skills in their expected folders.\n\n## Inference\n\nAgent routes need model access. Use `veryfront login` for the Veryfront Cloud gateway, set `VERYFRONT_API_TOKEN`, or set provider keys such as `OPENAI_API_KEY` or `ANTHROPIC_API_KEY`.\n"
|
|
617
617
|
}
|
|
618
618
|
},
|
|
619
619
|
"ai-rules:copilot.md": {
|
|
620
620
|
"files": {
|
|
621
|
-
"copilot.md": "# Veryfront project guide\n\nFollow `AGENTS.md` when it exists. If it does not exist, use this guide.\n\nThis is a Veryfront project. Veryfront is a framework for building and running AI apps and agents in TypeScript and React.\n\n## Project conventions\n\nUse these folders as runtime boundaries. Create folders only when the feature needs them.\n\n- `app/`: pages, layouts, route handlers, and user-facing API routes.\n- `agents/`: model reasoning and tool use.\n- `tools/`: deterministic callable capabilities.\n- `workflows/`: multi-step coordination.\n- `tasks/`: background work targets.\n- `prompts/`: reusable prompt templates.\n- `resources/`: project data exposed to MCP clients.\n- `skills/`: reusable agent instructions in `skills/<id>/SKILL.md`.\n- `integrations/`: service connectors and integration-local code.\n\n## Developer loop\n\n1. Start local development with `veryfront dev`.\n2. Generate new files with `veryfront generate <type> <name>`.\n3. Inspect current CLI commands with `veryfront schema --json`.\
|
|
621
|
+
"copilot.md": "# Veryfront project guide\n\nFollow `AGENTS.md` when it exists. If it does not exist, use this guide.\n\nThis is a Veryfront project. Veryfront is a framework for building and running AI apps and agents in TypeScript and React.\n\n## Project conventions\n\nUse these folders as runtime boundaries. Create folders only when the feature needs them.\n\n- `app/`: pages, layouts, route handlers, and user-facing API routes.\n- `agents/`: model reasoning and tool use.\n- `tools/`: deterministic callable capabilities.\n- `workflows/`: multi-step coordination.\n- `tasks/`: background work targets.\n- `prompts/`: reusable prompt templates.\n- `resources/`: project data exposed to MCP clients.\n- `skills/`: reusable agent instructions in `skills/<id>/SKILL.md`.\n- `integrations/`: service connectors and integration-local code.\n\n## Developer loop\n\n1. Start local development with `veryfront dev`.\n2. Generate new files with `veryfront generate <type> <name>`.\n3. For example, add an agent with a tool and skill by running `veryfront generate agent research-agent`, `veryfront generate tool search-docs`, and `veryfront generate skill research`. Use names that match the app domain.\n4. Inspect current CLI commands with `veryfront schema --json`.\n5. Use https://veryfront.com/docs when local files and CLI schema do not answer a Veryfront API or convention question.\n6. Run focused tests and lint before shipping.\n\n## Coding agent loop\n\nWhen the Veryfront MCP server is connected, call `vf_bootstrap` once at session start. Use `vf_get_conventions` before adding files, `vf_scaffold` for new routes and AI primitives, `vf_get_errors` after edits, and `vf_run_tests` or `vf_run_lint` for verification.\n\n`veryfront dev` starts the HTTP MCP endpoint on the app port plus 2. With the default app port, use `http://localhost:3002/mcp`.\n\nIf MCP is not connected, use `veryfront schema --json` and the documented CLI commands from the shell.\n\nPrefer Veryfront scaffold tools over hand-written boilerplate. Keep app routes, agents, tools, workflows, tasks, resources, prompts, and skills in their expected folders.\n\n## Inference\n\nAgent routes need model access. Use `veryfront login` for the Veryfront Cloud gateway, set `VERYFRONT_API_TOKEN`, or set provider keys such as `OPENAI_API_KEY` or `ANTHROPIC_API_KEY`.\n"
|
|
622
622
|
}
|
|
623
623
|
},
|
|
624
624
|
"ai-rules:cursor.md": {
|
|
625
625
|
"files": {
|
|
626
|
-
"cursor.md": "# Veryfront project guide\n\nFollow `AGENTS.md` when it exists. If it does not exist, use this guide.\n\nThis is a Veryfront project. Veryfront is a framework for building and running AI apps and agents in TypeScript and React.\n\n## Project conventions\n\nUse these folders as runtime boundaries. Create folders only when the feature needs them.\n\n- `app/`: pages, layouts, route handlers, and user-facing API routes.\n- `agents/`: model reasoning and tool use.\n- `tools/`: deterministic callable capabilities.\n- `workflows/`: multi-step coordination.\n- `tasks/`: background work targets.\n- `prompts/`: reusable prompt templates.\n- `resources/`: project data exposed to MCP clients.\n- `skills/`: reusable agent instructions in `skills/<id>/SKILL.md`.\n- `integrations/`: service connectors and integration-local code.\n\n## Developer loop\n\n1. Start local development with `veryfront dev`.\n2. Generate new files with `veryfront generate <type> <name>`.\n3. Inspect current CLI commands with `veryfront schema --json`.\
|
|
626
|
+
"cursor.md": "# Veryfront project guide\n\nFollow `AGENTS.md` when it exists. If it does not exist, use this guide.\n\nThis is a Veryfront project. Veryfront is a framework for building and running AI apps and agents in TypeScript and React.\n\n## Project conventions\n\nUse these folders as runtime boundaries. Create folders only when the feature needs them.\n\n- `app/`: pages, layouts, route handlers, and user-facing API routes.\n- `agents/`: model reasoning and tool use.\n- `tools/`: deterministic callable capabilities.\n- `workflows/`: multi-step coordination.\n- `tasks/`: background work targets.\n- `prompts/`: reusable prompt templates.\n- `resources/`: project data exposed to MCP clients.\n- `skills/`: reusable agent instructions in `skills/<id>/SKILL.md`.\n- `integrations/`: service connectors and integration-local code.\n\n## Developer loop\n\n1. Start local development with `veryfront dev`.\n2. Generate new files with `veryfront generate <type> <name>`.\n3. For example, add an agent with a tool and skill by running `veryfront generate agent research-agent`, `veryfront generate tool search-docs`, and `veryfront generate skill research`. Use names that match the app domain.\n4. Inspect current CLI commands with `veryfront schema --json`.\n5. Use https://veryfront.com/docs when local files and CLI schema do not answer a Veryfront API or convention question.\n6. Run focused tests and lint before shipping.\n\n## Coding agent loop\n\nWhen the Veryfront MCP server is connected, call `vf_bootstrap` once at session start. Use `vf_get_conventions` before adding files, `vf_scaffold` for new routes and AI primitives, `vf_get_errors` after edits, and `vf_run_tests` or `vf_run_lint` for verification.\n\n`veryfront dev` starts the HTTP MCP endpoint on the app port plus 2. With the default app port, use `http://localhost:3002/mcp`.\n\nIf MCP is not connected, use `veryfront schema --json` and the documented CLI commands from the shell.\n\nPrefer Veryfront scaffold tools over hand-written boilerplate. Keep app routes, agents, tools, workflows, tasks, resources, prompts, and skills in their expected folders.\n\n## Inference\n\nAgent routes need model access. Use `veryfront login` for the Veryfront Cloud gateway, set `VERYFRONT_API_TOKEN`, or set provider keys such as `OPENAI_API_KEY` or `ANTHROPIC_API_KEY`.\n"
|
|
627
627
|
}
|
|
628
628
|
},
|
|
629
629
|
"ai-rules:skill.md": {
|
|
630
630
|
"files": {
|
|
631
|
-
"skill.md": "---\nname: veryfront\ndescription: Build and run AI apps and agents with Veryfront CLI\nlicense: Apache-2.0\ncompatibility: Claude Code, Cursor, VS Code, Codex, Gemini CLI\nmetadata:\n author: veryfront\n version: \"1.0\"\n---\n\n# Veryfront\n\nVeryfront is a framework for building and running AI apps and agents in TypeScript and React.\n\n## Project conventions\n\nUse these folders as runtime boundaries. Create folders only when the feature needs them.\n\n- `app/`: pages, layouts, route handlers, and user-facing API routes.\n- `agents/`: model reasoning and tool use.\n- `tools/`: deterministic callable capabilities.\n- `workflows/`: multi-step coordination.\n- `tasks/`: background work targets.\n- `prompts/`: reusable prompt templates.\n- `resources/`: project data exposed to MCP clients.\n- `skills/`: reusable agent instructions in `skills/<id>/SKILL.md`.\n- `integrations/`: service connectors and integration-local code.\n\n## Developer loop\n\n1. Start local development with `veryfront dev`.\n2. Generate new files with `veryfront generate <type> <name>`.\n3. Inspect current CLI commands with `veryfront schema --json`.\
|
|
631
|
+
"skill.md": "---\nname: veryfront\ndescription: Build and run AI apps and agents with Veryfront CLI\nlicense: Apache-2.0\ncompatibility: Claude Code, Cursor, VS Code, Codex, Gemini CLI\nmetadata:\n author: veryfront\n version: \"1.0\"\n---\n\n# Veryfront\n\nVeryfront is a framework for building and running AI apps and agents in TypeScript and React.\n\n## Project conventions\n\nUse these folders as runtime boundaries. Create folders only when the feature needs them.\n\n- `app/`: pages, layouts, route handlers, and user-facing API routes.\n- `agents/`: model reasoning and tool use.\n- `tools/`: deterministic callable capabilities.\n- `workflows/`: multi-step coordination.\n- `tasks/`: background work targets.\n- `prompts/`: reusable prompt templates.\n- `resources/`: project data exposed to MCP clients.\n- `skills/`: reusable agent instructions in `skills/<id>/SKILL.md`.\n- `integrations/`: service connectors and integration-local code.\n\n## Developer loop\n\n1. Start local development with `veryfront dev`.\n2. Generate new files with `veryfront generate <type> <name>`.\n3. For example, add an agent with a tool and skill by running `veryfront generate agent research-agent`, `veryfront generate tool search-docs`, and `veryfront generate skill research`. Use names that match the app domain.\n4. Inspect current CLI commands with `veryfront schema --json`.\n5. Use https://veryfront.com/docs when local files and CLI schema do not answer a Veryfront API or convention question.\n6. Run focused tests and lint before shipping.\n\n## Coding agent loop\n\nWhen the Veryfront MCP server is connected, call `vf_bootstrap` once at session start. Use `vf_get_conventions` before adding files, `vf_scaffold` for new routes and AI primitives, `vf_get_errors` after edits, and `vf_run_tests` or `vf_run_lint` for verification.\n\n`veryfront dev` starts the HTTP MCP endpoint on the app port plus 2. With the default app port, use `http://localhost:3002/mcp`.\n\nIf MCP is not connected, use `veryfront schema --json` and the documented CLI commands from the shell.\n\n## Inference\n\nAgent routes need model access. Use `veryfront login` for the Veryfront Cloud gateway, set `VERYFRONT_API_TOKEN`, or set provider keys such as `OPENAI_API_KEY` or `ANTHROPIC_API_KEY`.\n"
|
|
632
632
|
}
|
|
633
633
|
},
|
|
634
634
|
"ai-rules:windsurf.md": {
|
|
635
635
|
"files": {
|
|
636
|
-
"windsurf.md": "# Veryfront project guide\n\nFollow `AGENTS.md` when it exists. If it does not exist, use this guide.\n\nThis is a Veryfront project. Veryfront is a framework for building and running AI apps and agents in TypeScript and React.\n\n## Project conventions\n\nUse these folders as runtime boundaries. Create folders only when the feature needs them.\n\n- `app/`: pages, layouts, route handlers, and user-facing API routes.\n- `agents/`: model reasoning and tool use.\n- `tools/`: deterministic callable capabilities.\n- `workflows/`: multi-step coordination.\n- `tasks/`: background work targets.\n- `prompts/`: reusable prompt templates.\n- `resources/`: project data exposed to MCP clients.\n- `skills/`: reusable agent instructions in `skills/<id>/SKILL.md`.\n- `integrations/`: service connectors and integration-local code.\n\n## Developer loop\n\n1. Start local development with `veryfront dev`.\n2. Generate new files with `veryfront generate <type> <name>`.\n3. Inspect current CLI commands with `veryfront schema --json`.\
|
|
636
|
+
"windsurf.md": "# Veryfront project guide\n\nFollow `AGENTS.md` when it exists. If it does not exist, use this guide.\n\nThis is a Veryfront project. Veryfront is a framework for building and running AI apps and agents in TypeScript and React.\n\n## Project conventions\n\nUse these folders as runtime boundaries. Create folders only when the feature needs them.\n\n- `app/`: pages, layouts, route handlers, and user-facing API routes.\n- `agents/`: model reasoning and tool use.\n- `tools/`: deterministic callable capabilities.\n- `workflows/`: multi-step coordination.\n- `tasks/`: background work targets.\n- `prompts/`: reusable prompt templates.\n- `resources/`: project data exposed to MCP clients.\n- `skills/`: reusable agent instructions in `skills/<id>/SKILL.md`.\n- `integrations/`: service connectors and integration-local code.\n\n## Developer loop\n\n1. Start local development with `veryfront dev`.\n2. Generate new files with `veryfront generate <type> <name>`.\n3. For example, add an agent with a tool and skill by running `veryfront generate agent research-agent`, `veryfront generate tool search-docs`, and `veryfront generate skill research`. Use names that match the app domain.\n4. Inspect current CLI commands with `veryfront schema --json`.\n5. Use https://veryfront.com/docs when local files and CLI schema do not answer a Veryfront API or convention question.\n6. Run focused tests and lint before shipping.\n\n## Coding agent loop\n\nWhen the Veryfront MCP server is connected, call `vf_bootstrap` once at session start. Use `vf_get_conventions` before adding files, `vf_scaffold` for new routes and AI primitives, `vf_get_errors` after edits, and `vf_run_tests` or `vf_run_lint` for verification.\n\n`veryfront dev` starts the HTTP MCP endpoint on the app port plus 2. With the default app port, use `http://localhost:3002/mcp`.\n\nIf MCP is not connected, use `veryfront schema --json` and the documented CLI commands from the shell.\n\nPrefer Veryfront scaffold tools over hand-written boilerplate. Keep app routes, agents, tools, workflows, tasks, resources, prompts, and skills in their expected folders.\n\n## Inference\n\nAgent routes need model access. Use `veryfront login` for the Veryfront Cloud gateway, set `VERYFRONT_API_TOKEN`, or set provider keys such as `OPENAI_API_KEY` or `ANTHROPIC_API_KEY`.\n"
|
|
637
637
|
}
|
|
638
638
|
}
|
|
639
639
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import * as dntShim from "../../_dnt.shims.js";
|
|
2
1
|
import { dirname } from "../../src/platform/compat/path/index.js";
|
|
2
|
+
import { getEnv, mkdir, writeTextFile } from "../../src/platform/index.js";
|
|
3
3
|
import { sanitizeRunOutputForLogging } from "./sanitize-run-output.js";
|
|
4
4
|
const RUN_RESULT_PATH_ENV = "VERYFRONT_RUN_RESULT_PATH";
|
|
5
5
|
function getRunResultPath() {
|
|
6
|
-
const value =
|
|
6
|
+
const value = getEnv(RUN_RESULT_PATH_ENV)?.trim();
|
|
7
7
|
return value ? value : null;
|
|
8
8
|
}
|
|
9
9
|
export async function writeRunResultIfConfigured(value) {
|
|
@@ -11,6 +11,6 @@ export async function writeRunResultIfConfigured(value) {
|
|
|
11
11
|
if (!resultPath) {
|
|
12
12
|
return;
|
|
13
13
|
}
|
|
14
|
-
await
|
|
15
|
-
await
|
|
14
|
+
await mkdir(dirname(resultPath), { recursive: true });
|
|
15
|
+
await writeTextFile(resultPath, JSON.stringify(sanitizeRunOutputForLogging(value), null, 2));
|
|
16
16
|
}
|
package/esm/deno.js
CHANGED
|
@@ -17,7 +17,7 @@ const MODEL_MAX_OUTPUT_TOKENS = {
|
|
|
17
17
|
"google-ai-studio/gemini-3.1-flash-lite": 65_536,
|
|
18
18
|
"google-ai-studio/gemini-2.5-pro": 65_536,
|
|
19
19
|
"google-ai-studio/gemini-2.5-flash": 65_536,
|
|
20
|
-
"mistral/mistral-large-2512":
|
|
20
|
+
"mistral/mistral-large-2512": 1_024,
|
|
21
21
|
};
|
|
22
22
|
const MODEL_MAX_OUTPUT_TOKEN_ALIASES = {
|
|
23
23
|
"google/gemini-3.1-pro": "google-ai-studio/gemini-3.1-pro-preview",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provider-errors.d.ts","sourceRoot":"","sources":["../../../src/src/chat/provider-errors.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;
|
|
1
|
+
{"version":3,"file":"provider-errors.d.ts","sourceRoot":"","sources":["../../../src/src/chat/provider-errors.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AA8BD,4CAA4C;AAC5C,MAAM,MAAM,mBAAmB,GAAG;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,KAAK,EAAE,OAAO,CAAA;CAAE,GAAG;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,KAAK,CAAA;CAAE,CAAC;AAE7F,0CAA0C;AAC1C,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,mBAAmB,CAMhE;AAgBD,iCAAiC;AACjC,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,OAAO,GAAG,mBAAmB,GAAG,IAAI,CA+B/E;AAED,yCAAyC;AACzC,wBAAgB,oBAAoB,CAAC,iBAAiB,EAAE,MAAM,GAAG,OAAO,CAOvE;AA2FD,sCAAsC;AACtC,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,OAAO,GAAG,mBAAmB,CAEtE"}
|
|
@@ -6,6 +6,15 @@ const PROJECT_SCHEMA_ERROR = {
|
|
|
6
6
|
code: "PROJECT_SCHEMA_ERROR",
|
|
7
7
|
message: "Project code has an invalid Veryfront schema. Update the schema to use defineSchema(), then run the agent again.",
|
|
8
8
|
};
|
|
9
|
+
const MODEL_UNSUPPORTED_ASSISTANT_PREFILL_ERROR = {
|
|
10
|
+
code: "MODEL_UNSUPPORTED_ASSISTANT_PREFILL",
|
|
11
|
+
message: "The selected model does not support assistant-message prefill. Start a new user message or choose a compatible model.",
|
|
12
|
+
};
|
|
13
|
+
const AI_PROVIDER_SPEND_LIMIT_ERROR = {
|
|
14
|
+
code: "AI_PROVIDER_SPEND_LIMIT_EXCEEDED",
|
|
15
|
+
message: "The AI provider spend limit has been reached. Try again later or ask an administrator to raise the AI provider spend limit.",
|
|
16
|
+
status: 402,
|
|
17
|
+
};
|
|
9
18
|
function isErrorRecord(value) {
|
|
10
19
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
11
20
|
}
|
|
@@ -37,6 +46,10 @@ export function parseKnownProblemBody(body) {
|
|
|
37
46
|
const slug = typeof body.slug === "string" ? body.slug : null;
|
|
38
47
|
const error = typeof body.error === "string" ? body.error : null;
|
|
39
48
|
const suggestion = typeof body.suggestion === "string" ? body.suggestion : null;
|
|
49
|
+
const normalizedProblemText = `${error ?? ""} ${suggestion ?? ""}`.toLowerCase();
|
|
50
|
+
if (normalizedProblemText.includes("ai provider spend limit")) {
|
|
51
|
+
return AI_PROVIDER_SPEND_LIMIT_ERROR;
|
|
52
|
+
}
|
|
40
53
|
if (slug === "insufficient-credits" || error === "AI credit limit exceeded") {
|
|
41
54
|
return {
|
|
42
55
|
code: "INSUFFICIENT_CREDITS",
|
|
@@ -68,6 +81,9 @@ function parseKnownProviderBody(body) {
|
|
|
68
81
|
if (!isErrorRecord(body)) {
|
|
69
82
|
return null;
|
|
70
83
|
}
|
|
84
|
+
if (body.type === "error" && isErrorRecord(body.error)) {
|
|
85
|
+
return parseKnownProviderBody(body.error);
|
|
86
|
+
}
|
|
71
87
|
if (body.type === "overloaded_error") {
|
|
72
88
|
return {
|
|
73
89
|
code: "OVERLOADED_ERROR",
|
|
@@ -97,6 +113,10 @@ function parseKnownProviderBody(body) {
|
|
|
97
113
|
body.message.includes("too long")) {
|
|
98
114
|
return { code: "CONTEXT_LENGTH_EXCEEDED", message: "Conversation is too long" };
|
|
99
115
|
}
|
|
116
|
+
if (body.type === "invalid_request_error" && typeof body.message === "string" &&
|
|
117
|
+
body.message.toLowerCase().includes("does not support assistant message prefill")) {
|
|
118
|
+
return MODEL_UNSUPPORTED_ASSISTANT_PREFILL_ERROR;
|
|
119
|
+
}
|
|
100
120
|
return null;
|
|
101
121
|
}
|
|
102
122
|
function getErrorMessage(error) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command.d.ts","sourceRoot":"","sources":["../../../../../src/src/platform/compat/process/command.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,cAAc;IAC7B,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC7B,gDAAgD;IAChD,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,mEAAmE;IACnE,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,sEAAsE;IACtE,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,kEAAkE;IAClE,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AA6ED;;;;;;;;;GASG;AACH,wBAAsB,UAAU,CAC9B,GAAG,EAAE,MAAM,EACX,OAAO,GAAE,cAAmB,GAC3B,OAAO,CAAC,aAAa,CAAC,
|
|
1
|
+
{"version":3,"file":"command.d.ts","sourceRoot":"","sources":["../../../../../src/src/platform/compat/process/command.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,cAAc;IAC7B,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC7B,gDAAgD;IAChD,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,mEAAmE;IACnE,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,sEAAsE;IACtE,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,kEAAkE;IAClE,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AA6ED;;;;;;;;;GASG;AACH,wBAAsB,UAAU,CAC9B,GAAG,EAAE,MAAM,EACX,OAAO,GAAE,cAAmB,GAC3B,OAAO,CAAC,aAAa,CAAC,CAuLxB"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as dntShim from "../../../../_dnt.shims.js";
|
|
2
2
|
import { dynamicImport } from "../dynamic-import.js";
|
|
3
|
-
import { isBun as IS_BUN, isDeno as IS_DENO } from "../runtime.js";
|
|
3
|
+
import { getDenoRuntime, isBun as IS_BUN, isDeno as IS_DENO } from "../runtime.js";
|
|
4
4
|
import { isWindowsPlatform, runtimeProcess } from "./runtime-process.js";
|
|
5
5
|
const COMMAND_TIMEOUT_EXIT_CODE = 124;
|
|
6
6
|
const FORCE_KILL_GRACE_MS = 250;
|
|
@@ -79,8 +79,9 @@ export async function runCommand(cmd, options = {}) {
|
|
|
79
79
|
const effectiveTimeoutMs = timeoutMs && timeoutMs > 0 ? Math.floor(timeoutMs) : undefined;
|
|
80
80
|
// Determine stdio mode: inherit > capture > null
|
|
81
81
|
const stdioMode = inherit ? "inherit" : capture ? "piped" : "null";
|
|
82
|
-
|
|
83
|
-
|
|
82
|
+
const deno = IS_DENO ? getDenoRuntime() : undefined;
|
|
83
|
+
if (deno) {
|
|
84
|
+
const command = new deno.Command(cmd, {
|
|
84
85
|
args,
|
|
85
86
|
cwd: cmdCwd,
|
|
86
87
|
env: cmdEnv,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"env.d.ts","sourceRoot":"","sources":["../../../../../src/src/platform/compat/process/env.ts"],"names":[],"mappings":"AAOA,MAAM,MAAM,iBAAiB,GAAG;IAC9B,QAAQ,EAAE,MAAM,OAAO,CAAC;IACxB,GAAG,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC;IAC5C,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;CACtC,CAAC;AAoBF,oDAAoD;AACpD,wBAAgB,GAAG,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"env.d.ts","sourceRoot":"","sources":["../../../../../src/src/platform/compat/process/env.ts"],"names":[],"mappings":"AAOA,MAAM,MAAM,iBAAiB,GAAG;IAC9B,QAAQ,EAAE,MAAM,OAAO,CAAC;IACxB,GAAG,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC;IAC5C,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;CACtC,CAAC;AAoBF,oDAAoD;AACpD,wBAAgB,GAAG,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAoB5C;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAqB1D;AAqCD,kEAAkE;AAClE,wBAAgB,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAWtD;AAKD,MAAM,WAAW,iBAAiB;IAChC,UAAU,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC/B,WAAW,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAChC,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAUD,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;AAC9D,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAAC;AAOpE,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;AAC9D,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAAC;AAUpE,wBAAgB,aAAa,CAC3B,GAAG,EAAE,MAAM,EACX,QAAQ,UAAQ,EAChB,OAAO,GAAE,iBAAsB,GAC9B,OAAO,CAmBT;AAED,gBAAgB;AAChB,wBAAgB,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAiBvD;AAED,6CAA6C;AAC7C,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAiB3C;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,IAAI,iBAAiB,GAAG,IAAI,CAS/D"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as dntShim from "../../../../_dnt.shims.js";
|
|
2
|
-
import { isDeno as IS_DENO } from "../runtime.js";
|
|
2
|
+
import { getDenoRuntime, isDeno as IS_DENO } from "../runtime.js";
|
|
3
3
|
import { runtimeProcess } from "./runtime-process.js";
|
|
4
4
|
function getEnvOverlayStore() {
|
|
5
5
|
const storage = getEnvOverlayStorage();
|
|
@@ -15,8 +15,9 @@ function getOverlayEnvValue(store, key) {
|
|
|
15
15
|
}
|
|
16
16
|
/** Read and write process environment variables. */
|
|
17
17
|
export function env() {
|
|
18
|
-
const
|
|
19
|
-
|
|
18
|
+
const deno = IS_DENO ? getDenoRuntime() : undefined;
|
|
19
|
+
const base = deno
|
|
20
|
+
? deno.env.toObject()
|
|
20
21
|
: runtimeProcess
|
|
21
22
|
? { ...runtimeProcess.env }
|
|
22
23
|
: {};
|
|
@@ -41,9 +42,10 @@ export function getHostEnv(key) {
|
|
|
41
42
|
if (overlayResult.hasValue) {
|
|
42
43
|
return overlayResult.value;
|
|
43
44
|
}
|
|
44
|
-
|
|
45
|
+
const deno = IS_DENO ? getDenoRuntime() : undefined;
|
|
46
|
+
if (deno) {
|
|
45
47
|
try {
|
|
46
|
-
return
|
|
48
|
+
return deno.env.get(key);
|
|
47
49
|
}
|
|
48
50
|
catch {
|
|
49
51
|
// Under a tightened env permission allowlist (project isolation workers),
|
|
@@ -148,8 +150,9 @@ export function setEnv(key, value) {
|
|
|
148
150
|
overlay.set(key, value);
|
|
149
151
|
return;
|
|
150
152
|
}
|
|
151
|
-
|
|
152
|
-
|
|
153
|
+
const deno = IS_DENO ? getDenoRuntime() : undefined;
|
|
154
|
+
if (deno) {
|
|
155
|
+
deno.env.set(key, value);
|
|
153
156
|
return;
|
|
154
157
|
}
|
|
155
158
|
if (runtimeProcess) {
|
|
@@ -165,8 +168,9 @@ export function deleteEnv(key) {
|
|
|
165
168
|
overlay.set(key, null);
|
|
166
169
|
return;
|
|
167
170
|
}
|
|
168
|
-
|
|
169
|
-
|
|
171
|
+
const deno = IS_DENO ? getDenoRuntime() : undefined;
|
|
172
|
+
if (deno) {
|
|
173
|
+
deno.env.delete(key);
|
|
170
174
|
return;
|
|
171
175
|
}
|
|
172
176
|
if (runtimeProcess) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lifecycle.d.ts","sourceRoot":"","sources":["../../../../../src/src/platform/compat/process/lifecycle.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,2BAA2B,CAAC;AAIrD,6EAA6E;AAC7E,wBAAgB,OAAO,IAAI,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"lifecycle.d.ts","sourceRoot":"","sources":["../../../../../src/src/platform/compat/process/lifecycle.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,2BAA2B,CAAC;AAIrD,6EAA6E;AAC7E,wBAAgB,OAAO,IAAI,MAAM,EAAE,CAKlC;AAED,yFAAyF;AACzF,wBAAgB,IAAI,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,KAAK,CAKzC;AAED,4CAA4C;AAC5C,wBAAgB,GAAG,IAAI,MAAM,CAK5B;AAED,wBAAgB,KAAK,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAW7C;AAED,wBAAgB,GAAG,IAAI,MAAM,CAK5B;AAED,wBAAgB,WAAW,IAAI;IAC7B,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;CAClB,CAaA;AAED;;GAEG;AACH,wBAAgB,aAAa,IAAI,OAAO,CAKvC;AAED;;GAEG;AACH,wBAAgB,WAAW,IAAI,OAAO,CAKrC;AAED;;;GAGG;AACH,wBAAgB,eAAe,IAAI;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAqBnE;AAED;;GAEG;AACH,wBAAgB,iBAAiB,IAAI,MAAM,CAQ1C;AAED;;;GAGG;AACH,wBAAgB,SAAS,IAAI,MAAM,CASlC;AAED;;GAEG;AACH,wBAAgB,QAAQ,CACtB,MAAM,EAAE,QAAQ,GAAG,SAAS,EAC5B,OAAO,EAAE,MAAM,IAAI,GAClB,IAAI,CAON;AAED;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAC3B,OAAO,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,mBAAmB,GAAG,oBAAoB,KAAK,OAAO,GAAG,IAAI,GAC1F,IAAI,CAiDN;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,OAAO,EAAE,UAAU,CAAC,OAAO,OAAO,CAAC,WAAW,CAAC,GAAG,IAAI,CAahF;AAED;;GAEG;AACH,wBAAgB,QAAQ,IAAI,MAAM,CAKjC;AAED;;;GAGG;AACH,wBAAgB,MAAM,IAAI,MAAM,CAW/B;AAED;;;GAGG;AACH,wBAAgB,SAAS,IAAI;IAAE,KAAK,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;CAAE,GAAG,IAAI,CAWpE;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAE9C;AAED;;;GAGG;AACH,wBAAsB,gBAAgB,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,CAexE;AAED;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAG1D;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,IAAI,MAAM,GAAG,IAAI,CAuBjD"}
|