veryfront 0.1.857 → 0.1.858
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/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":"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"}
|
|
@@ -1,33 +1,37 @@
|
|
|
1
1
|
import * as dntShim from "../../../../_dnt.shims.js";
|
|
2
|
-
import { isBun as IS_BUN, isDeno as IS_DENO } from "../runtime.js";
|
|
2
|
+
import { getDenoRuntime, isBun as IS_BUN, isDeno as IS_DENO } from "../runtime.js";
|
|
3
3
|
import { runtimeProcess } from "./runtime-process.js";
|
|
4
4
|
/** Get command-line arguments (cross-runtime: Deno.args or process.argv). */
|
|
5
5
|
export function getArgs() {
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
const deno = IS_DENO ? getDenoRuntime() : undefined;
|
|
7
|
+
if (deno)
|
|
8
|
+
return deno.args;
|
|
8
9
|
if (runtimeProcess)
|
|
9
10
|
return runtimeProcess.argv.slice(2);
|
|
10
11
|
return [];
|
|
11
12
|
}
|
|
12
13
|
/** Exit the process with an optional code (cross-runtime: Deno.exit or process.exit). */
|
|
13
14
|
export function exit(code) {
|
|
14
|
-
|
|
15
|
-
|
|
15
|
+
const deno = IS_DENO ? getDenoRuntime() : undefined;
|
|
16
|
+
if (deno)
|
|
17
|
+
deno.exit(code);
|
|
16
18
|
if (runtimeProcess)
|
|
17
19
|
runtimeProcess.exit(code);
|
|
18
20
|
throw new Error("exit() is not supported in this runtime");
|
|
19
21
|
}
|
|
20
22
|
/** Return the current working directory. */
|
|
21
23
|
export function cwd() {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
+
const deno = IS_DENO ? getDenoRuntime() : undefined;
|
|
25
|
+
if (deno)
|
|
26
|
+
return deno.cwd();
|
|
24
27
|
if (runtimeProcess)
|
|
25
28
|
return runtimeProcess.cwd();
|
|
26
29
|
throw new Error("cwd() is not supported in this runtime");
|
|
27
30
|
}
|
|
28
31
|
export function chdir(directory) {
|
|
29
|
-
|
|
30
|
-
|
|
32
|
+
const deno = IS_DENO ? getDenoRuntime() : undefined;
|
|
33
|
+
if (deno) {
|
|
34
|
+
deno.chdir(directory);
|
|
31
35
|
return;
|
|
32
36
|
}
|
|
33
37
|
if (runtimeProcess) {
|
|
@@ -37,15 +41,17 @@ export function chdir(directory) {
|
|
|
37
41
|
throw new Error("chdir() is not supported in this runtime");
|
|
38
42
|
}
|
|
39
43
|
export function pid() {
|
|
40
|
-
|
|
41
|
-
|
|
44
|
+
const deno = IS_DENO ? getDenoRuntime() : undefined;
|
|
45
|
+
if (deno)
|
|
46
|
+
return deno.pid;
|
|
42
47
|
if (runtimeProcess)
|
|
43
48
|
return runtimeProcess.pid;
|
|
44
49
|
return 0;
|
|
45
50
|
}
|
|
46
51
|
export function memoryUsage() {
|
|
47
|
-
|
|
48
|
-
|
|
52
|
+
const deno = IS_DENO ? getDenoRuntime() : undefined;
|
|
53
|
+
if (deno) {
|
|
54
|
+
const { rss, heapTotal, heapUsed, external } = deno.memoryUsage();
|
|
49
55
|
return { rss, heapTotal, heapUsed, external };
|
|
50
56
|
}
|
|
51
57
|
if (!runtimeProcess) {
|
|
@@ -58,8 +64,9 @@ export function memoryUsage() {
|
|
|
58
64
|
* Check if stdin is a TTY (terminal)
|
|
59
65
|
*/
|
|
60
66
|
export function isInteractive() {
|
|
61
|
-
|
|
62
|
-
|
|
67
|
+
const deno = IS_DENO ? getDenoRuntime() : undefined;
|
|
68
|
+
if (deno)
|
|
69
|
+
return deno.stdin.isTerminal();
|
|
63
70
|
if (runtimeProcess)
|
|
64
71
|
return runtimeProcess.stdin.isTTY ?? false;
|
|
65
72
|
return false;
|
|
@@ -68,8 +75,9 @@ export function isInteractive() {
|
|
|
68
75
|
* Check if stdout is a TTY (terminal)
|
|
69
76
|
*/
|
|
70
77
|
export function isStdoutTTY() {
|
|
71
|
-
|
|
72
|
-
|
|
78
|
+
const deno = IS_DENO ? getDenoRuntime() : undefined;
|
|
79
|
+
if (deno)
|
|
80
|
+
return deno.stdout.isTerminal();
|
|
73
81
|
if (runtimeProcess)
|
|
74
82
|
return runtimeProcess.stdout.isTTY ?? false;
|
|
75
83
|
return false;
|
|
@@ -80,9 +88,10 @@ export function isStdoutTTY() {
|
|
|
80
88
|
*/
|
|
81
89
|
export function getTerminalSize() {
|
|
82
90
|
const defaultSize = { columns: 80, rows: 24 };
|
|
83
|
-
|
|
91
|
+
const deno = IS_DENO ? getDenoRuntime() : undefined;
|
|
92
|
+
if (deno) {
|
|
84
93
|
try {
|
|
85
|
-
const { columns, rows } =
|
|
94
|
+
const { columns, rows } = deno.consoleSize();
|
|
86
95
|
return { columns, rows };
|
|
87
96
|
}
|
|
88
97
|
catch (_) {
|
|
@@ -102,8 +111,9 @@ export function getTerminalSize() {
|
|
|
102
111
|
* Get runtime version string
|
|
103
112
|
*/
|
|
104
113
|
export function getRuntimeVersion() {
|
|
105
|
-
|
|
106
|
-
|
|
114
|
+
const deno = IS_DENO ? getDenoRuntime() : undefined;
|
|
115
|
+
if (deno)
|
|
116
|
+
return `Deno ${deno.version.deno}`;
|
|
107
117
|
if ("Bun" in dntShim.dntGlobalThis) {
|
|
108
118
|
return `Bun ${dntShim.dntGlobalThis.Bun.version}`;
|
|
109
119
|
}
|
|
@@ -116,8 +126,9 @@ export function getRuntimeVersion() {
|
|
|
116
126
|
* Returns: "darwin" (macOS), "linux", "windows", or the raw platform string
|
|
117
127
|
*/
|
|
118
128
|
export function getOsType() {
|
|
119
|
-
|
|
120
|
-
|
|
129
|
+
const deno = IS_DENO ? getDenoRuntime() : undefined;
|
|
130
|
+
if (deno)
|
|
131
|
+
return deno.build.os;
|
|
121
132
|
if (runtimeProcess) {
|
|
122
133
|
// Node/Bun uses process.platform which returns "win32" for Windows
|
|
123
134
|
const platform = runtimeProcess.platform;
|
|
@@ -129,8 +140,9 @@ export function getOsType() {
|
|
|
129
140
|
* Register a signal handler (SIGINT, SIGTERM) for graceful shutdown
|
|
130
141
|
*/
|
|
131
142
|
export function onSignal(signal, handler) {
|
|
132
|
-
|
|
133
|
-
|
|
143
|
+
const deno = IS_DENO ? getDenoRuntime() : undefined;
|
|
144
|
+
if (deno) {
|
|
145
|
+
deno.addSignalListener(signal, handler);
|
|
134
146
|
return;
|
|
135
147
|
}
|
|
136
148
|
if (runtimeProcess)
|
|
@@ -193,8 +205,9 @@ export function onGlobalError(onError) {
|
|
|
193
205
|
* Unreference a timer to prevent it from keeping the process alive
|
|
194
206
|
*/
|
|
195
207
|
export function unrefTimer(timerId) {
|
|
196
|
-
|
|
197
|
-
|
|
208
|
+
const deno = IS_DENO ? getDenoRuntime() : undefined;
|
|
209
|
+
if (deno && typeof deno.unrefTimer === "function" && typeof timerId === "number") {
|
|
210
|
+
deno.unrefTimer(timerId);
|
|
198
211
|
return;
|
|
199
212
|
}
|
|
200
213
|
if (timerId && typeof timerId === "object") {
|
|
@@ -208,8 +221,9 @@ export function unrefTimer(timerId) {
|
|
|
208
221
|
* Get the executable path of the current runtime
|
|
209
222
|
*/
|
|
210
223
|
export function execPath() {
|
|
211
|
-
|
|
212
|
-
|
|
224
|
+
const deno = IS_DENO ? getDenoRuntime() : undefined;
|
|
225
|
+
if (deno)
|
|
226
|
+
return deno.execPath();
|
|
213
227
|
if (runtimeProcess)
|
|
214
228
|
return runtimeProcess.execPath;
|
|
215
229
|
return "";
|
|
@@ -219,9 +233,10 @@ export function execPath() {
|
|
|
219
233
|
* Returns OS uptime on Deno, process uptime on Node.js
|
|
220
234
|
*/
|
|
221
235
|
export function uptime() {
|
|
222
|
-
|
|
236
|
+
const deno = IS_DENO ? getDenoRuntime() : undefined;
|
|
237
|
+
if (deno) {
|
|
223
238
|
// Deno.osUptime() returns system uptime in seconds
|
|
224
|
-
return
|
|
239
|
+
return deno.osUptime?.() ?? 0;
|
|
225
240
|
}
|
|
226
241
|
if (runtimeProcess) {
|
|
227
242
|
// process.uptime() returns process uptime in seconds
|
|
@@ -234,9 +249,10 @@ export function uptime() {
|
|
|
234
249
|
* Returns null if not available (e.g., in browser/workers)
|
|
235
250
|
*/
|
|
236
251
|
export function getStdout() {
|
|
237
|
-
|
|
252
|
+
const deno = IS_DENO ? getDenoRuntime() : undefined;
|
|
253
|
+
if (deno) {
|
|
238
254
|
const encoder = new TextEncoder();
|
|
239
|
-
return { write: (data) =>
|
|
255
|
+
return { write: (data) => deno.stdout.writeSync(encoder.encode(data)) };
|
|
240
256
|
}
|
|
241
257
|
const stdout = runtimeProcess?.stdout;
|
|
242
258
|
if (stdout) {
|
|
@@ -256,8 +272,9 @@ export function writeStdout(text) {
|
|
|
256
272
|
* Returns a promise that resolves when the write is complete
|
|
257
273
|
*/
|
|
258
274
|
export async function writeStdoutAsync(data) {
|
|
259
|
-
|
|
260
|
-
|
|
275
|
+
const deno = IS_DENO ? getDenoRuntime() : undefined;
|
|
276
|
+
if (deno)
|
|
277
|
+
return await deno.stdout.write(data);
|
|
261
278
|
const stdout = runtimeProcess?.stdout;
|
|
262
279
|
if (stdout) {
|
|
263
280
|
return await new Promise((resolve, reject) => {
|
|
@@ -290,8 +307,9 @@ export function promptSync(message) {
|
|
|
290
307
|
*/
|
|
291
308
|
export function readStdinByteSync() {
|
|
292
309
|
const buf = new Uint8Array(1);
|
|
293
|
-
|
|
294
|
-
|
|
310
|
+
const deno = IS_DENO ? getDenoRuntime() : undefined;
|
|
311
|
+
if (deno) {
|
|
312
|
+
const n = deno.stdin.readSync(buf);
|
|
295
313
|
return n ? buf[0] ?? null : null;
|
|
296
314
|
}
|
|
297
315
|
if (IS_BUN) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime-process.d.ts","sourceRoot":"","sources":["../../../../../src/src/platform/compat/process/runtime-process.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,cAAc,GAAG,cAAc,cAAc,CAAC,CAAC;AAE3D;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,WAAW,EAAE,OAAO,GAAG,WAAW,IAAI,cAAc,CAIzF;AAED,eAAO,MAAM,cAAc,EAAE,cAAc,GAAG,IAEtC,CAAC;AAET,wBAAgB,iBAAiB,IAAI,OAAO,
|
|
1
|
+
{"version":3,"file":"runtime-process.d.ts","sourceRoot":"","sources":["../../../../../src/src/platform/compat/process/runtime-process.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,cAAc,GAAG,cAAc,cAAc,CAAC,CAAC;AAE3D;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,WAAW,EAAE,OAAO,GAAG,WAAW,IAAI,cAAc,CAIzF;AAED,eAAO,MAAM,cAAc,EAAE,cAAc,GAAG,IAEtC,CAAC;AAET,wBAAgB,iBAAiB,IAAI,OAAO,CAM3C"}
|
|
@@ -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
|
const nodeProcess = dntShim.dntGlobalThis.process;
|
|
4
4
|
/**
|
|
5
5
|
* Detect a real Node/Bun process object.
|
|
@@ -16,8 +16,9 @@ export const runtimeProcess = testHasRuntimeProcess(nodeProcess)
|
|
|
16
16
|
? nodeProcess
|
|
17
17
|
: null;
|
|
18
18
|
export function isWindowsPlatform() {
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
const deno = IS_DENO ? getDenoRuntime() : undefined;
|
|
20
|
+
if (deno)
|
|
21
|
+
return deno.build.os === "windows";
|
|
21
22
|
const platform = runtimeProcess?.platform ??
|
|
22
23
|
dntShim.dntGlobalThis.process?.platform;
|
|
23
24
|
return platform === "win32";
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import * as dntShim from "../../../_dnt.shims.js";
|
|
2
|
+
export declare function getDenoRuntime(): typeof dntShim.Deno | undefined;
|
|
1
3
|
/**
|
|
2
4
|
* Check if an executable path is a compiled Deno binary.
|
|
3
5
|
* Detects by binary name: "deno" or "deno.exe" = standard runtime, anything else = compiled.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../../../src/src/platform/compat/runtime.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../../../src/src/platform/compat/runtime.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,wBAAwB,CAAC;AAelD,wBAAgB,cAAc,IAAI,OAAO,OAAO,CAAC,IAAI,GAAG,SAAS,CAWhE;AAMD;;;;GAIG;AACH,wBAAgB,yBAAyB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAOnE;AAmBD,uFAAuF;AACvF,eAAO,MAAM,KAAK,EAAE,OAAwB,CAAC;AAE7C,gGAAgG;AAChG,eAAO,MAAM,MAAM,EAAE,OAAoC,CAAC;AAE1D,0DAA0D;AAC1D,eAAO,MAAM,MAAM,EAAE,OAA4C,CAAC;AAElE;;;;GAIG;AACH,eAAO,MAAM,cAAc,EAAE,OAA0C,CAAC;AAExE,oDAAoD;AACpD,eAAO,MAAM,YAAY,EAAE,OAAgC,CAAC;AAE5D;;;;GAIG;AACH,wBAAgB,aAAa,IAAI,OAAO,CAEvC;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,mBAAmB,IAAI,OAAO,CAK7C;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,IAAI,OAAO,CAE9C"}
|