veryfront 0.1.601 → 0.1.603
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/init/deno-config-generator.d.ts +10 -0
- package/esm/cli/commands/init/deno-config-generator.d.ts.map +1 -0
- package/esm/cli/commands/init/deno-config-generator.js +26 -0
- package/esm/cli/commands/init/handler.d.ts.map +1 -1
- package/esm/cli/commands/init/handler.js +8 -0
- package/esm/cli/commands/init/init-command.d.ts.map +1 -1
- package/esm/cli/commands/init/init-command.js +14 -3
- package/esm/cli/commands/init/interactive-wizard.d.ts +3 -2
- package/esm/cli/commands/init/interactive-wizard.d.ts.map +1 -1
- package/esm/cli/commands/init/interactive-wizard.js +37 -2
- package/esm/cli/commands/init/runtime.d.ts +8 -0
- package/esm/cli/commands/init/runtime.d.ts.map +1 -0
- package/esm/cli/commands/init/runtime.js +14 -0
- package/esm/cli/commands/init/types.d.ts +3 -0
- package/esm/cli/commands/init/types.d.ts.map +1 -1
- package/esm/deno.js +1 -1
- package/esm/src/agent/runtime/tool-helpers.js +1 -1
- package/esm/src/platform/adapters/veryfront-api-client/operations.d.ts.map +1 -1
- package/esm/src/platform/adapters/veryfront-api-client/operations.js +10 -4
- package/esm/src/sandbox/shell-tools.d.ts.map +1 -1
- package/esm/src/sandbox/shell-tools.js +4 -4
- package/esm/src/utils/version-constant.d.ts +1 -1
- package/esm/src/utils/version-constant.js +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Write a thin `deno.json` to the scaffolded project directory. Relies on
|
|
3
|
+
* `nodeModulesDir: "auto"` so Deno reads dependencies from the
|
|
4
|
+
* sibling `package.json` and materializes `node_modules/` on first task run.
|
|
5
|
+
*
|
|
6
|
+
* Throws if `deno.json` already exists at the destination — no template
|
|
7
|
+
* ships one today, so an existing file means something unexpected.
|
|
8
|
+
*/
|
|
9
|
+
export declare function createDenoConfig(projectDir: string): Promise<void>;
|
|
10
|
+
//# sourceMappingURL=deno-config-generator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deno-config-generator.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/init/deno-config-generator.ts"],"names":[],"mappings":"AAYA;;;;;;;GAOG;AACH,wBAAsB,gBAAgB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAOxE"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { join } from "../../../src/platform/compat/path/index.js";
|
|
2
|
+
import { createFileSystem } from "../../../src/platform/index.js";
|
|
3
|
+
const DENO_CONFIG = {
|
|
4
|
+
nodeModulesDir: "auto",
|
|
5
|
+
tasks: {
|
|
6
|
+
dev: "deno run -A npm:veryfront dev",
|
|
7
|
+
build: "deno run -A npm:veryfront build",
|
|
8
|
+
preview: "deno run -A npm:veryfront preview",
|
|
9
|
+
},
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Write a thin `deno.json` to the scaffolded project directory. Relies on
|
|
13
|
+
* `nodeModulesDir: "auto"` so Deno reads dependencies from the
|
|
14
|
+
* sibling `package.json` and materializes `node_modules/` on first task run.
|
|
15
|
+
*
|
|
16
|
+
* Throws if `deno.json` already exists at the destination — no template
|
|
17
|
+
* ships one today, so an existing file means something unexpected.
|
|
18
|
+
*/
|
|
19
|
+
export async function createDenoConfig(projectDir) {
|
|
20
|
+
const fs = createFileSystem();
|
|
21
|
+
const target = join(projectDir, "deno.json");
|
|
22
|
+
if (await fs.exists(target)) {
|
|
23
|
+
throw new Error(`Refusing to overwrite existing deno.json at ${target}`);
|
|
24
|
+
}
|
|
25
|
+
await fs.writeTextFile(target, JSON.stringify(DENO_CONFIG, null, 2) + "\n");
|
|
26
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handler.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/init/handler.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"handler.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/init/handler.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAKxD;;GAEG;AACH,wBAAsB,iBAAiB,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CAqEvE"}
|
|
@@ -7,6 +7,7 @@ import { createFileSystem } from "../../../src/platform/index.js";
|
|
|
7
7
|
import { cliLogger } from "../../utils/index.js";
|
|
8
8
|
import { resolvePath } from "./path-utils.js";
|
|
9
9
|
import { initCommand } from "./init-command.js";
|
|
10
|
+
import { parseRuntime } from "./runtime.js";
|
|
10
11
|
/**
|
|
11
12
|
* Handle the init command with argument parsing and config file support
|
|
12
13
|
*/
|
|
@@ -19,6 +20,9 @@ export async function handleInitCommand(args) {
|
|
|
19
20
|
let env;
|
|
20
21
|
const deploy = Boolean(args.deploy);
|
|
21
22
|
const force = Boolean(args.force || args.f);
|
|
23
|
+
let runtime = args.runtime !== undefined
|
|
24
|
+
? parseRuntime(args.runtime)
|
|
25
|
+
: undefined;
|
|
22
26
|
// Load config file if provided
|
|
23
27
|
const configPath = args.config || args.c;
|
|
24
28
|
if (configPath) {
|
|
@@ -34,6 +38,9 @@ export async function handleInitCommand(args) {
|
|
|
34
38
|
skipInstall ||= config.skipInstall ?? false;
|
|
35
39
|
skipEnvPrompt ||= config.skipEnvPrompt ?? false;
|
|
36
40
|
env = config.env;
|
|
41
|
+
if (runtime === undefined && config.runtime !== undefined) {
|
|
42
|
+
runtime = parseRuntime(config.runtime);
|
|
43
|
+
}
|
|
37
44
|
cliLogger.debug(`Loaded config from ${resolvedPath}`);
|
|
38
45
|
}
|
|
39
46
|
catch (error) {
|
|
@@ -58,5 +65,6 @@ export async function handleInitCommand(args) {
|
|
|
58
65
|
env,
|
|
59
66
|
deploy,
|
|
60
67
|
force,
|
|
68
|
+
runtime,
|
|
61
69
|
});
|
|
62
70
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init-command.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/init/init-command.ts"],"names":[],"mappings":"AAAA;;;iCAGiC;
|
|
1
|
+
{"version":3,"file":"init-command.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/init/init-command.ts"],"names":[],"mappings":"AAAA;;;iCAGiC;AAWjC,OAAO,KAAK,EAAE,WAAW,EAA6B,MAAM,YAAY,CAAC;AAiKzE;;GAEG;AACH,wBAAsB,WAAW,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CA6YrE"}
|
|
@@ -9,6 +9,7 @@ import { box } from "../../ui/box.js";
|
|
|
9
9
|
import { ensureDir } from "../../../deps/jsr.io/@std/fs/1.0.24/mod.js";
|
|
10
10
|
import { join } from "../../../src/platform/compat/path/index.js";
|
|
11
11
|
import { createPackageJson } from "./config-generator.js";
|
|
12
|
+
import { createDenoConfig } from "./deno-config-generator.js";
|
|
12
13
|
import { createError, toError } from "../../../src/errors/index.js";
|
|
13
14
|
import { cwd } from "../../../src/platform/index.js";
|
|
14
15
|
import { createFileSystem } from "../../../src/platform/index.js";
|
|
@@ -167,8 +168,9 @@ export async function initCommand(options) {
|
|
|
167
168
|
return;
|
|
168
169
|
}
|
|
169
170
|
}
|
|
171
|
+
let wizardRuntime = "node";
|
|
170
172
|
if (shouldRunWizard(options)) {
|
|
171
|
-
const wizardResult = await runInteractiveWizard(name);
|
|
173
|
+
const wizardResult = await runInteractiveWizard(name, options.runtime);
|
|
172
174
|
if (wizardResult.cancelled) {
|
|
173
175
|
return;
|
|
174
176
|
}
|
|
@@ -177,10 +179,16 @@ export async function initCommand(options) {
|
|
|
177
179
|
projectName = wizardResult.projectName;
|
|
178
180
|
}
|
|
179
181
|
initGit = wizardResult.initGit;
|
|
182
|
+
wizardRuntime = wizardResult.runtime;
|
|
180
183
|
}
|
|
181
184
|
else {
|
|
182
185
|
template = options.template ?? "minimal";
|
|
183
186
|
}
|
|
187
|
+
const runtime = options.runtime ?? wizardRuntime;
|
|
188
|
+
// Map runtime to package-manager preference. "node" → "npm" so an explicit
|
|
189
|
+
// --runtime node always uses npm regardless of lockfiles or user agent;
|
|
190
|
+
// "bun"/"deno" force the matching pm.
|
|
191
|
+
const pmPreference = runtime === "node" ? "npm" : runtime;
|
|
184
192
|
const projectDir = projectName ? join(cwd(), projectName) : cwd();
|
|
185
193
|
const fs = createFileSystem();
|
|
186
194
|
validateOrThrow("features", features, validateFeatures);
|
|
@@ -285,6 +293,9 @@ export async function initCommand(options) {
|
|
|
285
293
|
npmDependencies: integration.config.npmDependencies,
|
|
286
294
|
})),
|
|
287
295
|
});
|
|
296
|
+
if (runtime === "deno") {
|
|
297
|
+
await createDenoConfig(projectDir);
|
|
298
|
+
}
|
|
288
299
|
}
|
|
289
300
|
if (allEnvVars.length) {
|
|
290
301
|
const envResult = await promptForEnvVars(dedupeEnvVars(allEnvVars), {
|
|
@@ -331,7 +342,7 @@ export async function initCommand(options) {
|
|
|
331
342
|
}
|
|
332
343
|
options._featureTips = featureTips;
|
|
333
344
|
if (!options.skipInstall) {
|
|
334
|
-
const pm = await detectPackageManager(projectDir);
|
|
345
|
+
const pm = await detectPackageManager(projectDir, pmPreference);
|
|
335
346
|
const installSpinner = quiet ? null : createSpinner(`Installing dependencies with ${pm}...`);
|
|
336
347
|
const installSuccess = await installDependencies(projectDir, {
|
|
337
348
|
silent: true,
|
|
@@ -399,7 +410,7 @@ export async function initCommand(options) {
|
|
|
399
410
|
}
|
|
400
411
|
}
|
|
401
412
|
// Build success box with next steps
|
|
402
|
-
const pm = await detectPackageManager(projectDir);
|
|
413
|
+
const pm = await detectPackageManager(projectDir, pmPreference);
|
|
403
414
|
const devCommand = getRunCommand(pm, "dev");
|
|
404
415
|
const localSteps = [];
|
|
405
416
|
if (projectName) {
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import type { InitTemplate } from "./types.js";
|
|
1
|
+
import type { InitRuntime, InitTemplate } from "./types.js";
|
|
2
2
|
/** Reject path separators and traversal so the name stays a single directory. */
|
|
3
3
|
export declare function validateProjectName(name: string): string | null;
|
|
4
4
|
export interface WizardResult {
|
|
5
5
|
projectName: string | null;
|
|
6
6
|
template: InitTemplate;
|
|
7
|
+
runtime: InitRuntime;
|
|
7
8
|
initGit: boolean;
|
|
8
9
|
skipped: boolean;
|
|
9
10
|
cancelled: boolean;
|
|
10
11
|
}
|
|
11
|
-
export declare function runInteractiveWizard(existingName?: string): Promise<WizardResult>;
|
|
12
|
+
export declare function runInteractiveWizard(existingName?: string, presetRuntime?: InitRuntime): Promise<WizardResult>;
|
|
12
13
|
export declare function shouldRunWizard(options: {
|
|
13
14
|
template?: string;
|
|
14
15
|
}): boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interactive-wizard.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/init/interactive-wizard.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"interactive-wizard.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/init/interactive-wizard.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE5D,iFAAiF;AACjF,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAI/D;AAED,MAAM,WAAW,YAAY;IAC3B,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,QAAQ,EAAE,YAAY,CAAC;IACvB,OAAO,EAAE,WAAW,CAAC;IACrB,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,OAAO,CAAC;CACpB;AAMD,wBAAsB,oBAAoB,CACxC,YAAY,CAAC,EAAE,MAAM,EACrB,aAAa,CAAC,EAAE,WAAW,GAC1B,OAAO,CAAC,YAAY,CAAC,CAmLvB;AAED,wBAAgB,eAAe,CAAC,OAAO,EAAE;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAGvE"}
|
|
@@ -15,11 +15,12 @@ export function validateProjectName(name) {
|
|
|
15
15
|
function canRunWizard() {
|
|
16
16
|
return !(isCiEnv() || isDenoTestingEnv()) && checkIsInteractive();
|
|
17
17
|
}
|
|
18
|
-
export async function runInteractiveWizard(existingName) {
|
|
18
|
+
export async function runInteractiveWizard(existingName, presetRuntime) {
|
|
19
19
|
if (!canRunWizard()) {
|
|
20
20
|
return {
|
|
21
21
|
projectName: existingName ?? null,
|
|
22
22
|
template: "minimal",
|
|
23
|
+
runtime: presetRuntime ?? "node",
|
|
23
24
|
initGit: false,
|
|
24
25
|
skipped: true,
|
|
25
26
|
cancelled: false,
|
|
@@ -52,6 +53,7 @@ export async function runInteractiveWizard(existingName) {
|
|
|
52
53
|
return {
|
|
53
54
|
projectName: null,
|
|
54
55
|
template: "minimal",
|
|
56
|
+
runtime: "node",
|
|
55
57
|
initGit: false,
|
|
56
58
|
skipped: false,
|
|
57
59
|
cancelled: true,
|
|
@@ -64,6 +66,7 @@ export async function runInteractiveWizard(existingName) {
|
|
|
64
66
|
return {
|
|
65
67
|
projectName: null,
|
|
66
68
|
template: "minimal",
|
|
69
|
+
runtime: "node",
|
|
67
70
|
initGit: false,
|
|
68
71
|
skipped: false,
|
|
69
72
|
cancelled: true,
|
|
@@ -76,6 +79,7 @@ export async function runInteractiveWizard(existingName) {
|
|
|
76
79
|
return {
|
|
77
80
|
projectName: null,
|
|
78
81
|
template: "minimal",
|
|
82
|
+
runtime: "node",
|
|
79
83
|
initGit: false,
|
|
80
84
|
skipped: false,
|
|
81
85
|
cancelled: true,
|
|
@@ -91,12 +95,34 @@ export async function runInteractiveWizard(existingName) {
|
|
|
91
95
|
return {
|
|
92
96
|
projectName: null,
|
|
93
97
|
template: "minimal",
|
|
98
|
+
runtime: "node",
|
|
94
99
|
initGit: false,
|
|
95
100
|
skipped: false,
|
|
96
101
|
cancelled: true,
|
|
97
102
|
};
|
|
98
103
|
}
|
|
99
104
|
const template = templateChoice;
|
|
105
|
+
// Runtime selection (skipped when CLI passed --runtime explicitly)
|
|
106
|
+
let runtime = presetRuntime ?? "node";
|
|
107
|
+
if (presetRuntime === undefined) {
|
|
108
|
+
const runtimeChoice = await select("What runtime should this project use?", [
|
|
109
|
+
{ value: "node", label: "Node.js", description: "Default" },
|
|
110
|
+
{ value: "bun", label: "Bun", description: "Fast JS runtime" },
|
|
111
|
+
{ value: "deno", label: "Deno", description: "Secure-by-default" },
|
|
112
|
+
], 0);
|
|
113
|
+
if (runtimeChoice === null) {
|
|
114
|
+
console.log(muted("\n Cancelled.\n"));
|
|
115
|
+
return {
|
|
116
|
+
projectName: null,
|
|
117
|
+
template: "minimal",
|
|
118
|
+
runtime: "node",
|
|
119
|
+
initGit: false,
|
|
120
|
+
skipped: false,
|
|
121
|
+
cancelled: true,
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
runtime = runtimeChoice;
|
|
125
|
+
}
|
|
100
126
|
// Git init prompt
|
|
101
127
|
const gitChoice = await select("Initialize a git repository?", [
|
|
102
128
|
{ value: "yes", label: "Yes", description: "Initialize git and create first commit" },
|
|
@@ -107,6 +133,7 @@ export async function runInteractiveWizard(existingName) {
|
|
|
107
133
|
return {
|
|
108
134
|
projectName: null,
|
|
109
135
|
template: "minimal",
|
|
136
|
+
runtime: "node",
|
|
110
137
|
initGit: false,
|
|
111
138
|
skipped: false,
|
|
112
139
|
cancelled: true,
|
|
@@ -125,9 +152,17 @@ export async function runInteractiveWizard(existingName) {
|
|
|
125
152
|
console.log(` ${brand("Location:")} ./ ${dim("(current folder)")}`);
|
|
126
153
|
}
|
|
127
154
|
console.log(` ${brand("Template:")} ${templateLabel}`);
|
|
155
|
+
console.log(` ${brand("Runtime:")} ${runtime}`);
|
|
128
156
|
console.log(` ${brand("Git:")} ${initGit ? "Yes" : "No"}`);
|
|
129
157
|
console.log("");
|
|
130
|
-
return {
|
|
158
|
+
return {
|
|
159
|
+
projectName,
|
|
160
|
+
template,
|
|
161
|
+
runtime,
|
|
162
|
+
initGit,
|
|
163
|
+
skipped: false,
|
|
164
|
+
cancelled: false,
|
|
165
|
+
};
|
|
131
166
|
}
|
|
132
167
|
export function shouldRunWizard(options) {
|
|
133
168
|
// Always run wizard unless template is explicitly specified via --template
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { InitRuntime } from "./types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Validate an unknown value (from CLI args or a config file) and return it
|
|
4
|
+
* as an `InitRuntime`. Throws with an actionable error when the value is
|
|
5
|
+
* not one of `node | bun | deno`.
|
|
6
|
+
*/
|
|
7
|
+
export declare function parseRuntime(value: unknown): InitRuntime;
|
|
8
|
+
//# sourceMappingURL=runtime.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/init/runtime.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAI9C;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,WAAW,CAWxD"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
const VALID_RUNTIMES = ["node", "bun", "deno"];
|
|
2
|
+
/**
|
|
3
|
+
* Validate an unknown value (from CLI args or a config file) and return it
|
|
4
|
+
* as an `InitRuntime`. Throws with an actionable error when the value is
|
|
5
|
+
* not one of `node | bun | deno`.
|
|
6
|
+
*/
|
|
7
|
+
export function parseRuntime(value) {
|
|
8
|
+
if (typeof value === "string" &&
|
|
9
|
+
VALID_RUNTIMES.includes(value)) {
|
|
10
|
+
return value;
|
|
11
|
+
}
|
|
12
|
+
throw new Error(`Invalid runtime value: ${JSON.stringify(value)}. ` +
|
|
13
|
+
`Must be one of: ${VALID_RUNTIMES.join(", ")}.`);
|
|
14
|
+
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { FeatureName, IntegrationName } from "../../templates/types.js";
|
|
2
2
|
export type InitTemplate = "ai-agent" | "docs-agent" | "multi-agent-system" | "agentic-workflow" | "coding-agent" | "saas-starter" | "minimal";
|
|
3
3
|
export type EnvValues = Record<string, string>;
|
|
4
|
+
export type InitRuntime = "node" | "bun" | "deno";
|
|
4
5
|
export interface InitOptions {
|
|
5
6
|
name?: string;
|
|
6
7
|
template?: InitTemplate;
|
|
@@ -15,5 +16,7 @@ export interface InitOptions {
|
|
|
15
16
|
deploy?: boolean;
|
|
16
17
|
/** Overwrite existing directory */
|
|
17
18
|
force?: boolean;
|
|
19
|
+
/** Runtime for the scaffolded project. Defaults to "node". */
|
|
20
|
+
runtime?: InitRuntime;
|
|
18
21
|
}
|
|
19
22
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/init/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAE7E,MAAM,MAAM,YAAY,GACpB,UAAU,GACV,YAAY,GACZ,oBAAoB,GACpB,kBAAkB,GAClB,cAAc,GACd,cAAc,GACd,SAAS,CAAC;AAEd,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAE/C,MAAM,WAAW,WAAW;IAC1B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,YAAY,CAAC;IACxB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,EAAE,WAAW,EAAE,CAAC;IACzB,YAAY,CAAC,EAAE,eAAe,EAAE,CAAC;IACjC,GAAG,CAAC,EAAE,SAAS,CAAC;IAChB,+BAA+B;IAC/B,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,wCAAwC;IACxC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,mCAAmC;IACnC,KAAK,CAAC,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/init/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAE7E,MAAM,MAAM,YAAY,GACpB,UAAU,GACV,YAAY,GACZ,oBAAoB,GACpB,kBAAkB,GAClB,cAAc,GACd,cAAc,GACd,SAAS,CAAC;AAEd,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAE/C,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,KAAK,GAAG,MAAM,CAAC;AAElD,MAAM,WAAW,WAAW;IAC1B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,YAAY,CAAC;IACxB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,EAAE,WAAW,EAAE,CAAC;IACzB,YAAY,CAAC,EAAE,eAAe,EAAE,CAAC;IACjC,GAAG,CAAC,EAAE,SAAS,CAAC;IAChB,+BAA+B;IAC/B,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,wCAAwC;IACxC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,mCAAmC;IACnC,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,8DAA8D;IAC9D,OAAO,CAAC,EAAE,WAAW,CAAC;CACvB"}
|
package/esm/deno.js
CHANGED
|
@@ -183,7 +183,7 @@ function logToolDefinition(name, def) {
|
|
|
183
183
|
function addToolDefinition(tools, name,
|
|
184
184
|
// deno-lint-ignore no-explicit-any -- generic erasure: accepts Tool with any input/output types
|
|
185
185
|
tool) {
|
|
186
|
-
const def = toolToProviderDefinition(tool);
|
|
186
|
+
const def = toolToProviderDefinition({ ...tool, id: name });
|
|
187
187
|
logToolDefinition(name, def);
|
|
188
188
|
tools.push(def);
|
|
189
189
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"operations.d.ts","sourceRoot":"","sources":["../../../../../src/src/platform/adapters/veryfront-api-client/operations.ts"],"names":[],"mappings":"AACA,OAAO,EAAyC,KAAK,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAE7F,OAAO,EAWL,KAAK,oBAAoB,EACzB,KAAK,QAAQ,EACb,KAAK,OAAO,EACZ,KAAK,WAAW,EACjB,MAAM,oBAAoB,CAAC;AAQ5B,MAAM,MAAM,aAAa,GAAG,MAAM,MAAM,CAAC;AAEzC,MAAM,WAAW,gBAAgB;IAC/B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,GAAG,YAAY,CAAC;IAC/B,SAAS,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC;CAC5B;AAED,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,WAAW,EAAE,CAAC;IACrB,SAAS,EAAE,QAAQ,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACjC;AAED,MAAM,WAAW,qBAAqB;IACpC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,yBAA0B,SAAQ,qBAAqB;IACtE,gBAAgB,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,6BAA8B,SAAQ,yBAAyB;IAC9E,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,MAAM,WAAW,wBAAyB,SAAQ,yBAAyB;IACzE,MAAM,CAAC,EAAE,UAAU,GAAG,OAAO,GAAG,QAAQ,CAAC;IACzC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,8BAA8B;IAC7C,MAAM,EAAE,OAAO,GAAG,SAAS,GAAG,UAAU,GAAG,QAAQ,CAAC;IACpD,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;
|
|
1
|
+
{"version":3,"file":"operations.d.ts","sourceRoot":"","sources":["../../../../../src/src/platform/adapters/veryfront-api-client/operations.ts"],"names":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,OAAO,GAAE,IAAI,CAAC,gBAAgB,EAAE,QAAQ,CAAM,GAC7C,OAAO,CAAC,WAAW,EAAE,CAAC;IAMzB,cAAc,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC;IA+B1F,qBAAqB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,oBAAoB,GAAG,IAAI,CAAC;IA2CrE,oBAAoB,CACxB,UAAU,EAAE,MAAM,EAClB,KAAK,EAAE,yBAAyB,GAC/B,OAAO,CAAC,8BAA8B,CAAC;IAcpC,wBAAwB,CAC5B,UAAU,EAAE,MAAM,EAClB,KAAK,EAAE,6BAA6B,GACnC,OAAO,CAAC,8BAA8B,CAAC;IA4BpC,mBAAmB,CACvB,UAAU,EAAE,MAAM,EAClB,KAAK,EAAE,wBAAwB,GAC9B,OAAO,CAAC,8BAA8B,CAAC;IAmC1C,OAAO,CAAC,OAAO;CAahB"}
|
|
@@ -19,6 +19,10 @@ function buildListParams(options) {
|
|
|
19
19
|
params.set("pattern", pattern);
|
|
20
20
|
return params;
|
|
21
21
|
}
|
|
22
|
+
function addRuntimeServerFunctionAccess(params) {
|
|
23
|
+
params.set("include_server_functions", "true");
|
|
24
|
+
return params;
|
|
25
|
+
}
|
|
22
26
|
function mapProjectFile(file) {
|
|
23
27
|
return {
|
|
24
28
|
id: file.id,
|
|
@@ -159,7 +163,7 @@ export class VeryfrontAPIOperations {
|
|
|
159
163
|
});
|
|
160
164
|
}
|
|
161
165
|
async listEnvironmentFiles(projectRef, environmentName = "production", options = {}) {
|
|
162
|
-
const params = buildListParams(options);
|
|
166
|
+
const params = addRuntimeServerFunctionAccess(buildListParams(options));
|
|
163
167
|
const url = `/projects/${encodeURIComponent(projectRef)}/environments/${encodeURIComponent(environmentName)}/files?${params}`;
|
|
164
168
|
logger.debug("listEnvironmentFiles", {
|
|
165
169
|
projectRef,
|
|
@@ -192,7 +196,8 @@ export class VeryfrontAPIOperations {
|
|
|
192
196
|
}
|
|
193
197
|
getEnvironmentFile(projectRef, environmentName, pathOrId) {
|
|
194
198
|
return withSpan(SpanNames.API_GET_FILE, async () => {
|
|
195
|
-
const
|
|
199
|
+
const params = addRuntimeServerFunctionAccess(new URLSearchParams());
|
|
200
|
+
const url = `/projects/${encodeURIComponent(projectRef)}/environments/${encodeURIComponent(environmentName)}/files/${encodeURIComponent(pathOrId)}?${params}`;
|
|
196
201
|
logger.debug("getEnvironmentFile", { projectRef, environmentName, pathOrId });
|
|
197
202
|
const raw = await this.request(url);
|
|
198
203
|
const response = getEnvironmentFileDetailSchema().parse(raw);
|
|
@@ -212,7 +217,7 @@ export class VeryfrontAPIOperations {
|
|
|
212
217
|
});
|
|
213
218
|
}
|
|
214
219
|
async listReleaseFiles(projectRef, version = "latest", options = {}) {
|
|
215
|
-
const params = buildListParams(options);
|
|
220
|
+
const params = addRuntimeServerFunctionAccess(buildListParams(options));
|
|
216
221
|
const url = `/projects/${encodeURIComponent(projectRef)}/releases/${encodeURIComponent(version)}/files?${params}`;
|
|
217
222
|
logger.debug("listReleaseFiles", { projectRef, version, pattern: options.pattern });
|
|
218
223
|
const raw = await this.request(url);
|
|
@@ -229,7 +234,8 @@ export class VeryfrontAPIOperations {
|
|
|
229
234
|
}
|
|
230
235
|
getReleaseFile(projectRef, version, pathOrId) {
|
|
231
236
|
return withSpan(SpanNames.API_GET_FILE, async () => {
|
|
232
|
-
const
|
|
237
|
+
const params = addRuntimeServerFunctionAccess(new URLSearchParams());
|
|
238
|
+
const url = `/projects/${encodeURIComponent(projectRef)}/releases/${encodeURIComponent(version)}/files/${encodeURIComponent(pathOrId)}?${params}`;
|
|
233
239
|
logger.debug("getReleaseFile", { projectRef, version, pathOrId });
|
|
234
240
|
const raw = await this.request(url);
|
|
235
241
|
const response = getReleaseFileDetailSchema().parse(raw);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shell-tools.d.ts","sourceRoot":"","sources":["../../../src/src/sandbox/shell-tools.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,kBAAkB,EAElB,mBAAmB,EACnB,yBAAyB,EAC1B,MAAM,gCAAgC,CAAC;AAExC,YAAY,EACV,kBAAkB,IAAI,mBAAmB,EACzC,0BAA0B,EAC1B,mBAAmB,EACnB,yBAAyB,IAAI,qBAAqB,GACnD,MAAM,gCAAgC,CAAC;
|
|
1
|
+
{"version":3,"file":"shell-tools.d.ts","sourceRoot":"","sources":["../../../src/src/sandbox/shell-tools.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,kBAAkB,EAElB,mBAAmB,EACnB,yBAAyB,EAC1B,MAAM,gCAAgC,CAAC;AAExC,YAAY,EACV,kBAAkB,IAAI,mBAAmB,EACzC,0BAA0B,EAC1B,mBAAmB,EACnB,yBAAyB,IAAI,qBAAqB,GACnD,MAAM,gCAAgC,CAAC;AAqJxC,gCAAgC;AAChC,wBAAgB,oBAAoB,CAAC,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,mBAAmB,CAM5F;AAED,iCAAiC;AACjC,wBAAgB,sBAAsB,CAAC,SAAS,EAAE,mBAAmB,GAAG,mBAAmB,CAiC1F;AAED,kCAAkC;AAClC,wBAAsB,uBAAuB,CAC3C,OAAO,EAAE,kBAAkB,EAC3B,gBAAgB,EAAE,yBAAyB,GAC1C,OAAO,CAAC,mBAAmB,CAAC,CAU9B"}
|
|
@@ -100,11 +100,11 @@ function normalizeJsonSchema(value) {
|
|
|
100
100
|
schema.maxItems = value.maxItems;
|
|
101
101
|
return schema;
|
|
102
102
|
}
|
|
103
|
-
function normalizeBashTool(toolDefinition) {
|
|
103
|
+
function normalizeBashTool(toolName, toolDefinition) {
|
|
104
104
|
if (!isRecord(toolDefinition)) {
|
|
105
|
-
return {};
|
|
105
|
+
return { id: toolName };
|
|
106
106
|
}
|
|
107
|
-
const normalized = {};
|
|
107
|
+
const normalized = { id: toolName };
|
|
108
108
|
const id = toolDefinition.id;
|
|
109
109
|
const type = toolDefinition.type;
|
|
110
110
|
const description = toolDefinition.description;
|
|
@@ -137,7 +137,7 @@ function normalizeBashTool(toolDefinition) {
|
|
|
137
137
|
}
|
|
138
138
|
/** Normalizes bash tool set. */
|
|
139
139
|
export function normalizeBashToolSet(bashTools) {
|
|
140
|
-
return Object.fromEntries(Object.entries(bashTools).map(([name, toolDefinition]) => [name, normalizeBashTool(toolDefinition)]));
|
|
140
|
+
return Object.fromEntries(Object.entries(bashTools).map(([name, toolDefinition]) => [name, normalizeBashTool(name, toolDefinition)]));
|
|
141
141
|
}
|
|
142
142
|
/** Rename sandbox file tools. */
|
|
143
143
|
export function renameSandboxFileTools(bashTools) {
|