veryfront 0.1.211 → 0.1.212
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/mcp/advanced-tools.d.ts.map +1 -1
- package/esm/cli/mcp/advanced-tools.js +2 -0
- package/esm/cli/mcp/standalone.d.ts.map +1 -1
- package/esm/cli/mcp/standalone.js +39 -0
- package/esm/cli/mcp/tools/bootstrap-tool.d.ts +29 -0
- package/esm/cli/mcp/tools/bootstrap-tool.d.ts.map +1 -0
- package/esm/cli/mcp/tools/bootstrap-tool.js +51 -0
- package/esm/deno.js +1 -1
- package/esm/src/agent/data-stream.d.ts.map +1 -1
- package/esm/src/agent/data-stream.js +5 -1
- package/esm/src/agent/runtime/constants.d.ts +2 -0
- package/esm/src/agent/runtime/constants.d.ts.map +1 -1
- package/esm/src/agent/runtime/constants.js +16 -0
- package/esm/src/agent/runtime/index.d.ts.map +1 -1
- package/esm/src/agent/runtime/index.js +7 -5
- package/esm/src/utils/version-constant.d.ts +1 -1
- package/esm/src/utils/version-constant.js +1 -1
- package/package.json +1 -1
- package/src/cli/mcp/advanced-tools.ts +2 -0
- package/src/cli/mcp/standalone.ts +42 -0
- package/src/cli/mcp/tools/bootstrap-tool.ts +67 -0
- package/src/deno.js +1 -1
- package/src/src/agent/data-stream.ts +7 -1
- package/src/src/agent/runtime/constants.ts +18 -0
- package/src/src/agent/runtime/index.ts +7 -5
- package/src/src/utils/version-constant.ts +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"advanced-tools.d.ts","sourceRoot":"","sources":["../../../src/cli/mcp/advanced-tools.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"advanced-tools.d.ts","sourceRoot":"","sources":["../../../src/cli/mcp/advanced-tools.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAgC1C,eAAO,MAAM,aAAa,EAAE,OAAO,EA0BlC,CAAC"}
|
|
@@ -6,11 +6,13 @@ import { vfRunLint } from "./tools/run-lint-tool.js";
|
|
|
6
6
|
import { vfRunTests } from "./tools/run-tests-tool.js";
|
|
7
7
|
import { vfGetConventions, vfScaffold } from "./tools/scaffold-tools.js";
|
|
8
8
|
import { vfGetSkillReference, vfGetSkills } from "./tools/skill-tools.js";
|
|
9
|
+
import { vfBootstrap } from "./tools/bootstrap-tool.js";
|
|
9
10
|
import { cicdTools } from "./tools/cicd-tools.js";
|
|
10
11
|
import { introspectionTools } from "./tools/introspection-tools.js";
|
|
11
12
|
export const advancedTools = [
|
|
12
13
|
...cicdTools,
|
|
13
14
|
...introspectionTools,
|
|
15
|
+
vfBootstrap,
|
|
14
16
|
vfGetSkills,
|
|
15
17
|
vfGetSkillReference,
|
|
16
18
|
vfListLocalProjects,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"standalone.d.ts","sourceRoot":"","sources":["../../../src/cli/mcp/standalone.ts"],"names":[],"mappings":"AAsCA,MAAM,WAAW,mBAAmB;IAClC,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,qBAAa,mBAAmB;IAC9B,OAAO,CAAC,MAAM,CAAkB;IAChC,OAAO,CAAC,KAAK,CAAmB;IAChC,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,WAAW,CAA4B;gBAEnC,MAAM,GAAE,mBAAwB;IAM5C,KAAK,IAAI,IAAI;IAWb,IAAI,IAAI,IAAI;YAME,aAAa;IAW3B,OAAO,CAAC,cAAc;YAgCR,eAAe;IAqB7B,OAAO,CAAC,eAAe;IAUvB,OAAO,CAAC,mBAAmB;YAyBb,mBAAmB;IA6CjC,OAAO,CAAC,iBAAiB;YAkBX,gBAAgB;IAwB9B,OAAO,CAAC,WAAW;
|
|
1
|
+
{"version":3,"file":"standalone.d.ts","sourceRoot":"","sources":["../../../src/cli/mcp/standalone.ts"],"names":[],"mappings":"AAsCA,MAAM,WAAW,mBAAmB;IAClC,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,qBAAa,mBAAmB;IAC9B,OAAO,CAAC,MAAM,CAAkB;IAChC,OAAO,CAAC,KAAK,CAAmB;IAChC,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,WAAW,CAA4B;gBAEnC,MAAM,GAAE,mBAAwB;IAM5C,KAAK,IAAI,IAAI;IAWb,IAAI,IAAI,IAAI;YAME,aAAa;IAW3B,OAAO,CAAC,cAAc;YAgCR,eAAe;IAqB7B,OAAO,CAAC,eAAe;IAUvB,OAAO,CAAC,mBAAmB;YAyBb,mBAAmB;IA6CjC,OAAO,CAAC,iBAAiB;YAkBX,gBAAgB;IAwB9B,OAAO,CAAC,WAAW;IAkQnB,OAAO,CAAC,mBAAmB;CA0F5B;AAED,wBAAgB,yBAAyB,CAAC,MAAM,GAAE,mBAAwB,GAAG,mBAAmB,CAI/F"}
|
|
@@ -403,6 +403,45 @@ export class StandaloneMCPServer {
|
|
|
403
403
|
});
|
|
404
404
|
},
|
|
405
405
|
},
|
|
406
|
+
{
|
|
407
|
+
name: "vf_bootstrap",
|
|
408
|
+
description: "Get full project context in one call: structure, conventions, errors, and server status. " +
|
|
409
|
+
"Use at session start instead of calling vf_get_project_context + vf_get_conventions + " +
|
|
410
|
+
"vf_get_errors + vf_get_status separately.",
|
|
411
|
+
inputSchema: {
|
|
412
|
+
type: "object",
|
|
413
|
+
properties: {
|
|
414
|
+
projectPath: {
|
|
415
|
+
type: "string",
|
|
416
|
+
description: "Project directory (defaults to cwd)",
|
|
417
|
+
},
|
|
418
|
+
},
|
|
419
|
+
},
|
|
420
|
+
async execute(args) {
|
|
421
|
+
const { vfGetProjectContext } = await import("./tools/project-tools.js");
|
|
422
|
+
const { vfGetConventions } = await import("./tools/scaffold-tools.js");
|
|
423
|
+
const [project, conventions] = await Promise.all([
|
|
424
|
+
vfGetProjectContext.execute({ projectPath: args.projectPath }),
|
|
425
|
+
vfGetConventions.execute({ topic: "all" }),
|
|
426
|
+
]);
|
|
427
|
+
let errors = [];
|
|
428
|
+
let running = false;
|
|
429
|
+
try {
|
|
430
|
+
const result = await client.getLiveErrors();
|
|
431
|
+
errors = Array.isArray(result) ? result : [];
|
|
432
|
+
running = true;
|
|
433
|
+
}
|
|
434
|
+
catch {
|
|
435
|
+
// Dev server not running — no errors available
|
|
436
|
+
}
|
|
437
|
+
return {
|
|
438
|
+
project,
|
|
439
|
+
conventions,
|
|
440
|
+
errors: { total: errors.length, items: errors.slice(-20) },
|
|
441
|
+
status: { running },
|
|
442
|
+
};
|
|
443
|
+
},
|
|
444
|
+
},
|
|
406
445
|
...this.createContext7Tools(),
|
|
407
446
|
];
|
|
408
447
|
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MCP tool: vf_bootstrap
|
|
3
|
+
*
|
|
4
|
+
* Returns everything an agent needs at session start in a single call:
|
|
5
|
+
* project context, coding conventions, current errors, and server status.
|
|
6
|
+
*/
|
|
7
|
+
import { z } from "zod";
|
|
8
|
+
import type { MCPTool } from "../../../src/mcp/index.js";
|
|
9
|
+
import { type DevError } from "../../../src/observability/index.js";
|
|
10
|
+
import { vfGetProjectContext } from "./project-tools.js";
|
|
11
|
+
import { vfGetConventions } from "./scaffold-tools.js";
|
|
12
|
+
declare const bootstrapInput: z.ZodObject<{
|
|
13
|
+
projectPath: z.ZodOptional<z.ZodString>;
|
|
14
|
+
}, z.core.$strip>;
|
|
15
|
+
type BootstrapInput = z.infer<typeof bootstrapInput>;
|
|
16
|
+
interface BootstrapResult {
|
|
17
|
+
project: Awaited<ReturnType<typeof vfGetProjectContext.execute>>;
|
|
18
|
+
conventions: Awaited<ReturnType<typeof vfGetConventions.execute>>;
|
|
19
|
+
errors: {
|
|
20
|
+
total: number;
|
|
21
|
+
items: DevError[];
|
|
22
|
+
};
|
|
23
|
+
status: {
|
|
24
|
+
running: boolean;
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
export declare const vfBootstrap: MCPTool<BootstrapInput, BootstrapResult>;
|
|
28
|
+
export {};
|
|
29
|
+
//# sourceMappingURL=bootstrap-tool.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bootstrap-tool.d.ts","sourceRoot":"","sources":["../../../../src/cli/mcp/tools/bootstrap-tool.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,KAAK,QAAQ,EAAqB,MAAM,qCAAqC,CAAC;AACvF,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEvD,QAAA,MAAM,cAAc;;iBAIlB,CAAC;AAEH,KAAK,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAErD,UAAU,eAAe;IACvB,OAAO,EAAE,OAAO,CAAC,UAAU,CAAC,OAAO,mBAAmB,CAAC,OAAO,CAAC,CAAC,CAAC;IACjE,WAAW,EAAE,OAAO,CAAC,UAAU,CAAC,OAAO,gBAAgB,CAAC,OAAO,CAAC,CAAC,CAAC;IAClE,MAAM,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,QAAQ,EAAE,CAAA;KAAE,CAAC;IAC7C,MAAM,EAAE;QAAE,OAAO,EAAE,OAAO,CAAA;KAAE,CAAC;CAC9B;AAED,eAAO,MAAM,WAAW,EAAE,OAAO,CAAC,cAAc,EAAE,eAAe,CAsChE,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MCP tool: vf_bootstrap
|
|
3
|
+
*
|
|
4
|
+
* Returns everything an agent needs at session start in a single call:
|
|
5
|
+
* project context, coding conventions, current errors, and server status.
|
|
6
|
+
*/
|
|
7
|
+
import { z } from "zod";
|
|
8
|
+
import { getErrorCollector } from "../../../src/observability/index.js";
|
|
9
|
+
import { vfGetProjectContext } from "./project-tools.js";
|
|
10
|
+
import { vfGetConventions } from "./scaffold-tools.js";
|
|
11
|
+
const bootstrapInput = z.object({
|
|
12
|
+
projectPath: z.string().optional().describe("Project directory (defaults to current working directory)"),
|
|
13
|
+
});
|
|
14
|
+
export const vfBootstrap = {
|
|
15
|
+
name: "vf_bootstrap",
|
|
16
|
+
title: "Bootstrap",
|
|
17
|
+
annotations: {
|
|
18
|
+
readOnlyHint: true,
|
|
19
|
+
destructiveHint: false,
|
|
20
|
+
idempotentHint: true,
|
|
21
|
+
openWorldHint: false,
|
|
22
|
+
},
|
|
23
|
+
description: "Use this at the start of a new session to get full project context in one call. " +
|
|
24
|
+
"Returns project structure, coding conventions, current errors, and server status. " +
|
|
25
|
+
"Equivalent to calling vf_get_project_context + vf_get_conventions + vf_get_errors + " +
|
|
26
|
+
"vf_get_status separately, but in a single round-trip. " +
|
|
27
|
+
"Do not use repeatedly — call once at session bootstrap.",
|
|
28
|
+
inputSchema: bootstrapInput,
|
|
29
|
+
execute: async (input) => {
|
|
30
|
+
const [project, conventions] = await Promise.all([
|
|
31
|
+
vfGetProjectContext.execute({ projectPath: input.projectPath }),
|
|
32
|
+
vfGetConventions.execute({ topic: "all" }),
|
|
33
|
+
]);
|
|
34
|
+
let errors = [];
|
|
35
|
+
let running = false;
|
|
36
|
+
try {
|
|
37
|
+
const collector = getErrorCollector();
|
|
38
|
+
errors = collector.getAll();
|
|
39
|
+
running = true;
|
|
40
|
+
}
|
|
41
|
+
catch {
|
|
42
|
+
running = false;
|
|
43
|
+
}
|
|
44
|
+
return {
|
|
45
|
+
project,
|
|
46
|
+
conventions,
|
|
47
|
+
errors: { total: errors.length, items: errors.slice(-20) },
|
|
48
|
+
status: { running },
|
|
49
|
+
};
|
|
50
|
+
},
|
|
51
|
+
};
|
package/esm/deno.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-stream.d.ts","sourceRoot":"","sources":["../../../src/src/agent/data-stream.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AAMzE,wBAAgB,kCAAkC,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAmB1E;AAED,wBAAgB,mBAAmB,CAAC,gBAAgB,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAwCvF;AAED,wBAAgB,kBAAkB,CAAC,gBAAgB,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"data-stream.d.ts","sourceRoot":"","sources":["../../../src/src/agent/data-stream.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AAMzE,wBAAgB,kCAAkC,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAmB1E;AAED,wBAAgB,mBAAmB,CAAC,gBAAgB,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAwCvF;AAED,wBAAgB,kBAAkB,CAAC,gBAAgB,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAoBtF;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAiB5E;AAED,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,MAAM,GAAG;IACvD,MAAM,EAAE,sBAAsB,EAAE,CAAC;IACjC,SAAS,EAAE,MAAM,CAAC;CACnB,CAoBA;AAED,wBAAuB,sBAAsB,CAC3C,MAAM,EAAE,cAAc,CAAC,UAAU,CAAC,GACjC,cAAc,CAAC,sBAAsB,CAAC,CAkCxC"}
|
|
@@ -22,7 +22,7 @@ export function mergeToolInputDelta(currentArguments, nextDelta) {
|
|
|
22
22
|
const candidateDeltas = normalizedDelta.startsWith('"')
|
|
23
23
|
? [normalizedDelta, `{${normalizedDelta}`]
|
|
24
24
|
: [normalizedDelta];
|
|
25
|
-
if (currentArguments === "{}") {
|
|
25
|
+
if (currentArguments === "{}" || currentArguments.length === 0) {
|
|
26
26
|
for (const candidate of candidateDeltas) {
|
|
27
27
|
if (candidate.startsWith("{")) {
|
|
28
28
|
return candidate;
|
|
@@ -55,9 +55,13 @@ export function mergeToolCallInput(currentArguments, nextInput) {
|
|
|
55
55
|
if (currentArguments.length === 0) {
|
|
56
56
|
return nextInput;
|
|
57
57
|
}
|
|
58
|
+
const normalizedCurrent = stripLeadingEmptyObjectPlaceholder(currentArguments);
|
|
58
59
|
if (nextInput.trim() === "{}" && currentArguments.trim().startsWith("{")) {
|
|
59
60
|
return currentArguments;
|
|
60
61
|
}
|
|
62
|
+
if (nextInput.trim() === "{}" && normalizedCurrent.trim().startsWith("{")) {
|
|
63
|
+
return normalizedCurrent;
|
|
64
|
+
}
|
|
61
65
|
if (currentArguments.trim() === "{}" && nextInput.trim().startsWith("{")) {
|
|
62
66
|
return nextInput;
|
|
63
67
|
}
|
|
@@ -2,4 +2,6 @@ export declare const DEFAULT_MAX_TOKENS: 4096;
|
|
|
2
2
|
export declare const DEFAULT_TEMPERATURE: 0.7;
|
|
3
3
|
export declare const MAX_STREAM_BUFFER_SIZE: number;
|
|
4
4
|
export declare const DEFAULT_MAX_STEPS = 20;
|
|
5
|
+
/** Look up max output tokens for a model, stripping the `veryfront-cloud/` prefix. */
|
|
6
|
+
export declare function getModelMaxOutputTokens(modelString: string): number | undefined;
|
|
5
7
|
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/src/agent/runtime/constants.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,kBAAkB,MAA2B,CAAC;AAC3D,eAAO,MAAM,mBAAmB,KAA6B,CAAC;AAC9D,eAAO,MAAM,sBAAsB,QAAmC,CAAC;AACvE,eAAO,MAAM,iBAAiB,KAAK,CAAC"}
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/src/agent/runtime/constants.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,kBAAkB,MAA2B,CAAC;AAC3D,eAAO,MAAM,mBAAmB,KAA6B,CAAC;AAC9D,eAAO,MAAM,sBAAsB,QAAmC,CAAC;AACvE,eAAO,MAAM,iBAAiB,KAAK,CAAC;AAYpC,sFAAsF;AACtF,wBAAgB,uBAAuB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAK/E"}
|
|
@@ -3,3 +3,19 @@ export const DEFAULT_MAX_TOKENS = AGENT_DEFAULTS.maxTokens;
|
|
|
3
3
|
export const DEFAULT_TEMPERATURE = AGENT_DEFAULTS.temperature;
|
|
4
4
|
export const MAX_STREAM_BUFFER_SIZE = STREAMING_DEFAULTS.maxBufferSize;
|
|
5
5
|
export const DEFAULT_MAX_STEPS = 20;
|
|
6
|
+
/** Max output token limits per model (normalized IDs without `veryfront-cloud/` prefix). */
|
|
7
|
+
const MODEL_MAX_OUTPUT_TOKENS = {
|
|
8
|
+
"anthropic/claude-opus-4-6": 32_768,
|
|
9
|
+
"anthropic/claude-sonnet-4-6": 16_384,
|
|
10
|
+
"anthropic/claude-haiku-4-5-20251001": 8_192,
|
|
11
|
+
"openai/gpt-5.2": 16_384,
|
|
12
|
+
"google-ai-studio/gemini-2.5-pro": 65_536,
|
|
13
|
+
"google-ai-studio/gemini-2.5-flash": 8_192,
|
|
14
|
+
};
|
|
15
|
+
/** Look up max output tokens for a model, stripping the `veryfront-cloud/` prefix. */
|
|
16
|
+
export function getModelMaxOutputTokens(modelString) {
|
|
17
|
+
const normalized = modelString.startsWith("veryfront-cloud/")
|
|
18
|
+
? modelString.slice("veryfront-cloud/".length)
|
|
19
|
+
: modelString;
|
|
20
|
+
return MODEL_MAX_OUTPUT_TOKENS[normalized];
|
|
21
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/src/agent/runtime/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EACL,KAAK,WAAW,EAEhB,KAAK,aAAa,EAGlB,KAAK,OAAO,EACZ,KAAK,WAAW,EAEhB,KAAK,QAAQ,EACb,KAAK,cAAc,EACpB,MAAM,aAAa,CAAC;AAIrB,OAAO,EAAgB,KAAK,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAU/D,OAAO,EACL,KAAK,eAAe,EAGpB,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACzB,MAAM,0BAA0B,CAAC;AAUlC,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAC5E,OAAO,EACL,qBAAqB,EACrB,iBAAiB,EACjB,iBAAiB,EACjB,uBAAuB,EACvB,iBAAiB,EACjB,mBAAmB,GACpB,MAAM,qBAAqB,CAAC;AAC7B,YAAY,EACV,8BAA8B,EAC9B,gBAAgB,EAChB,wBAAwB,GACzB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,qBAAqB,EACrB,iBAAiB,EACjB,aAAa,EACb,aAAa,GACd,MAAM,mBAAmB,CAAC;AAC3B,YAAY,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACzE,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAChF,OAAO,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAC5E,YAAY,EACV,mBAAmB,EACnB,eAAe,EACf,iBAAiB,GAClB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,mBAAmB,EACnB,sBAAsB,GACvB,MAAM,gBAAgB,CAAC;AAiBx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AE,OAAO,CAAC,EACjC,aAAa,CAAC,EAAE,MAAM,EACtB,uBAAuB,CAAC,EAAE,MAAM,GAC/B,OAAO,CAAC,aAAa,CAAC;IAoDzB;;;OAGG;IACG,MAAM,CACV,QAAQ,EAAE,OAAO,EAAE,EACnB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACjC,SAAS,CAAC,EAAE;QACV,UAAU,CAAC,EAAE,CAAC,QAAQ,EAAE,QAAQ,KAAK,IAAI,CAAC;QAC1C,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;QAClC,QAAQ,CAAC,EAAE,CAAC,QAAQ,EAAE,aAAa,KAAK,IAAI,CAAC;KAC9C,EACD,aAAa,CAAC,EAAE,MAAM,EACtB,uBAAuB,CAAC,EAAE,MAAM,EAChC,WAAW,CAAC,EAAE,WAAW,GACxB,OAAO,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC;IAuHtC;;OAEG;YACW,gBAAgB;IAwS9B;;;;OAIG;YACW,yBAAyB;IAoXvC;;OAEG;YACW,eAAe;IAqC7B;;OAEG;YACW,mBAAmB;IAOjC;;OAEG;IACH,OAAO,CAAC,eAAe;IAKvB,OAAO,CAAC,sBAAsB;IAc9B;;OAEG;IACH,SAAS,IAAI,MAAM,CAAC,OAAO,CAAC;IAI5B;;OAEG;IACG,cAAc,IAAI,OAAO,CAAC;QAC9B,aAAa,EAAE,MAAM,CAAC;QACtB,eAAe,EAAE,MAAM,CAAC;QACxB,IAAI,EAAE,MAAM,CAAC;KACd,CAAC;IAIF;;OAEG;IACG,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC;CAGnC"}
|
|
@@ -34,7 +34,7 @@ export { executeConfiguredTool, getAvailableTools, isDynamicTool, parseToolArgs,
|
|
|
34
34
|
export { accumulateUsage, getMaxSteps, normalizeInput } from "./input-utils.js";
|
|
35
35
|
export { createStreamState, processStream } from "./chat-stream-handler.js";
|
|
36
36
|
export { DEFAULT_MAX_STEPS, DEFAULT_MAX_TOKENS, DEFAULT_TEMPERATURE, MAX_STREAM_BUFFER_SIZE, } from "./constants.js";
|
|
37
|
-
import { DEFAULT_MAX_TOKENS, DEFAULT_TEMPERATURE } from "./constants.js";
|
|
37
|
+
import { DEFAULT_MAX_TOKENS, DEFAULT_TEMPERATURE, getModelMaxOutputTokens } from "./constants.js";
|
|
38
38
|
import { closeSSEStream, generateMessageId, sendSSE } from "./sse-utils.js";
|
|
39
39
|
import { executeConfiguredTool, getAvailableTools, isDynamicTool, parseToolArgs, } from "./tool-helpers.js";
|
|
40
40
|
import { accumulateUsage, getMaxSteps, normalizeInput } from "./input-utils.js";
|
|
@@ -446,7 +446,7 @@ export class AgentRuntime {
|
|
|
446
446
|
allowedToolNames: allowedRemoteToolNames,
|
|
447
447
|
}),
|
|
448
448
|
experimental_repairToolCall: repairToolCall,
|
|
449
|
-
maxOutputTokens: this.resolveMaxOutputTokens(maxOutputTokensOverride),
|
|
449
|
+
maxOutputTokens: this.resolveMaxOutputTokens(effectiveModel, maxOutputTokensOverride),
|
|
450
450
|
temperature: DEFAULT_TEMPERATURE,
|
|
451
451
|
...(headers ? { headers } : {}),
|
|
452
452
|
...(providerOptions ? { providerOptions } : {}),
|
|
@@ -685,7 +685,7 @@ export class AgentRuntime {
|
|
|
685
685
|
allowedToolNames: allowedRemoteToolNames,
|
|
686
686
|
}),
|
|
687
687
|
experimental_repairToolCall: repairToolCall,
|
|
688
|
-
maxOutputTokens: this.resolveMaxOutputTokens(maxOutputTokensOverride),
|
|
688
|
+
maxOutputTokens: this.resolveMaxOutputTokens(effectiveModel, maxOutputTokensOverride),
|
|
689
689
|
temperature: DEFAULT_TEMPERATURE,
|
|
690
690
|
...(headers ? { headers } : {}),
|
|
691
691
|
...(providerOptions ? { providerOptions } : {}),
|
|
@@ -957,13 +957,15 @@ export class AgentRuntime {
|
|
|
957
957
|
const edgeMaxSteps = this.config.edge?.enabled ? this.config.edge.maxSteps : undefined;
|
|
958
958
|
return getMaxSteps(this.config.maxSteps, edgeMaxSteps, platformLimit);
|
|
959
959
|
}
|
|
960
|
-
resolveMaxOutputTokens(maxOutputTokensOverride) {
|
|
960
|
+
resolveMaxOutputTokens(modelString, maxOutputTokensOverride) {
|
|
961
961
|
if (typeof maxOutputTokensOverride === "number" &&
|
|
962
962
|
Number.isFinite(maxOutputTokensOverride) &&
|
|
963
963
|
maxOutputTokensOverride > 0) {
|
|
964
964
|
return Math.floor(maxOutputTokensOverride);
|
|
965
965
|
}
|
|
966
|
-
return this.config.memory?.maxTokens ??
|
|
966
|
+
return this.config.memory?.maxTokens ??
|
|
967
|
+
(modelString ? getModelMaxOutputTokens(modelString) : undefined) ??
|
|
968
|
+
DEFAULT_MAX_TOKENS;
|
|
967
969
|
}
|
|
968
970
|
/**
|
|
969
971
|
* Get memory instance (for advanced use cases)
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.1.
|
|
1
|
+
export declare const VERSION = "0.1.212";
|
|
2
2
|
//# sourceMappingURL=version-constant.d.ts.map
|
package/package.json
CHANGED
|
@@ -26,12 +26,14 @@ import { vfRunLint } from "./tools/run-lint-tool.js";
|
|
|
26
26
|
import { vfRunTests } from "./tools/run-tests-tool.js";
|
|
27
27
|
import { vfGetConventions, vfScaffold } from "./tools/scaffold-tools.js";
|
|
28
28
|
import { vfGetSkillReference, vfGetSkills } from "./tools/skill-tools.js";
|
|
29
|
+
import { vfBootstrap } from "./tools/bootstrap-tool.js";
|
|
29
30
|
import { cicdTools } from "./tools/cicd-tools.js";
|
|
30
31
|
import { introspectionTools } from "./tools/introspection-tools.js";
|
|
31
32
|
|
|
32
33
|
export const advancedTools: MCPTool[] = [
|
|
33
34
|
...cicdTools,
|
|
34
35
|
...introspectionTools,
|
|
36
|
+
vfBootstrap,
|
|
35
37
|
vfGetSkills,
|
|
36
38
|
vfGetSkillReference,
|
|
37
39
|
vfListLocalProjects,
|
|
@@ -467,6 +467,48 @@ export class StandaloneMCPServer {
|
|
|
467
467
|
});
|
|
468
468
|
},
|
|
469
469
|
},
|
|
470
|
+
{
|
|
471
|
+
name: "vf_bootstrap",
|
|
472
|
+
description:
|
|
473
|
+
"Get full project context in one call: structure, conventions, errors, and server status. " +
|
|
474
|
+
"Use at session start instead of calling vf_get_project_context + vf_get_conventions + " +
|
|
475
|
+
"vf_get_errors + vf_get_status separately.",
|
|
476
|
+
inputSchema: {
|
|
477
|
+
type: "object",
|
|
478
|
+
properties: {
|
|
479
|
+
projectPath: {
|
|
480
|
+
type: "string",
|
|
481
|
+
description: "Project directory (defaults to cwd)",
|
|
482
|
+
},
|
|
483
|
+
},
|
|
484
|
+
},
|
|
485
|
+
async execute(args) {
|
|
486
|
+
const { vfGetProjectContext } = await import("./tools/project-tools.js");
|
|
487
|
+
const { vfGetConventions } = await import("./tools/scaffold-tools.js");
|
|
488
|
+
|
|
489
|
+
const [project, conventions] = await Promise.all([
|
|
490
|
+
vfGetProjectContext.execute({ projectPath: args.projectPath as string }),
|
|
491
|
+
vfGetConventions.execute({ topic: "all" }),
|
|
492
|
+
]);
|
|
493
|
+
|
|
494
|
+
let errors: unknown[] = [];
|
|
495
|
+
let running = false;
|
|
496
|
+
try {
|
|
497
|
+
const result = await client.getLiveErrors();
|
|
498
|
+
errors = Array.isArray(result) ? result : [];
|
|
499
|
+
running = true;
|
|
500
|
+
} catch {
|
|
501
|
+
// Dev server not running — no errors available
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
return {
|
|
505
|
+
project,
|
|
506
|
+
conventions,
|
|
507
|
+
errors: { total: errors.length, items: errors.slice(-20) },
|
|
508
|
+
status: { running },
|
|
509
|
+
};
|
|
510
|
+
},
|
|
511
|
+
},
|
|
470
512
|
...this.createContext7Tools(),
|
|
471
513
|
];
|
|
472
514
|
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MCP tool: vf_bootstrap
|
|
3
|
+
*
|
|
4
|
+
* Returns everything an agent needs at session start in a single call:
|
|
5
|
+
* project context, coding conventions, current errors, and server status.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import { z } from "zod";
|
|
9
|
+
import type { MCPTool } from "../../../src/mcp/index.js";
|
|
10
|
+
import { type DevError, getErrorCollector } from "../../../src/observability/index.js";
|
|
11
|
+
import { vfGetProjectContext } from "./project-tools.js";
|
|
12
|
+
import { vfGetConventions } from "./scaffold-tools.js";
|
|
13
|
+
|
|
14
|
+
const bootstrapInput = z.object({
|
|
15
|
+
projectPath: z.string().optional().describe(
|
|
16
|
+
"Project directory (defaults to current working directory)",
|
|
17
|
+
),
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
type BootstrapInput = z.infer<typeof bootstrapInput>;
|
|
21
|
+
|
|
22
|
+
interface BootstrapResult {
|
|
23
|
+
project: Awaited<ReturnType<typeof vfGetProjectContext.execute>>;
|
|
24
|
+
conventions: Awaited<ReturnType<typeof vfGetConventions.execute>>;
|
|
25
|
+
errors: { total: number; items: DevError[] };
|
|
26
|
+
status: { running: boolean };
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export const vfBootstrap: MCPTool<BootstrapInput, BootstrapResult> = {
|
|
30
|
+
name: "vf_bootstrap",
|
|
31
|
+
title: "Bootstrap",
|
|
32
|
+
annotations: {
|
|
33
|
+
readOnlyHint: true,
|
|
34
|
+
destructiveHint: false,
|
|
35
|
+
idempotentHint: true,
|
|
36
|
+
openWorldHint: false,
|
|
37
|
+
},
|
|
38
|
+
description: "Use this at the start of a new session to get full project context in one call. " +
|
|
39
|
+
"Returns project structure, coding conventions, current errors, and server status. " +
|
|
40
|
+
"Equivalent to calling vf_get_project_context + vf_get_conventions + vf_get_errors + " +
|
|
41
|
+
"vf_get_status separately, but in a single round-trip. " +
|
|
42
|
+
"Do not use repeatedly — call once at session bootstrap.",
|
|
43
|
+
inputSchema: bootstrapInput,
|
|
44
|
+
execute: async (input) => {
|
|
45
|
+
const [project, conventions] = await Promise.all([
|
|
46
|
+
vfGetProjectContext.execute({ projectPath: input.projectPath }),
|
|
47
|
+
vfGetConventions.execute({ topic: "all" }),
|
|
48
|
+
]);
|
|
49
|
+
|
|
50
|
+
let errors: DevError[] = [];
|
|
51
|
+
let running = false;
|
|
52
|
+
try {
|
|
53
|
+
const collector = getErrorCollector();
|
|
54
|
+
errors = collector.getAll();
|
|
55
|
+
running = true;
|
|
56
|
+
} catch {
|
|
57
|
+
running = false;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
return {
|
|
61
|
+
project,
|
|
62
|
+
conventions,
|
|
63
|
+
errors: { total: errors.length, items: errors.slice(-20) },
|
|
64
|
+
status: { running },
|
|
65
|
+
};
|
|
66
|
+
},
|
|
67
|
+
};
|
package/src/deno.js
CHANGED
|
@@ -31,7 +31,7 @@ export function mergeToolInputDelta(currentArguments: string, nextDelta: string)
|
|
|
31
31
|
? [normalizedDelta, `{${normalizedDelta}`]
|
|
32
32
|
: [normalizedDelta];
|
|
33
33
|
|
|
34
|
-
if (currentArguments === "{}") {
|
|
34
|
+
if (currentArguments === "{}" || currentArguments.length === 0) {
|
|
35
35
|
for (const candidate of candidateDeltas) {
|
|
36
36
|
if (candidate.startsWith("{")) {
|
|
37
37
|
return candidate;
|
|
@@ -72,10 +72,16 @@ export function mergeToolCallInput(currentArguments: string, nextInput: string):
|
|
|
72
72
|
return nextInput;
|
|
73
73
|
}
|
|
74
74
|
|
|
75
|
+
const normalizedCurrent = stripLeadingEmptyObjectPlaceholder(currentArguments);
|
|
76
|
+
|
|
75
77
|
if (nextInput.trim() === "{}" && currentArguments.trim().startsWith("{")) {
|
|
76
78
|
return currentArguments;
|
|
77
79
|
}
|
|
78
80
|
|
|
81
|
+
if (nextInput.trim() === "{}" && normalizedCurrent.trim().startsWith("{")) {
|
|
82
|
+
return normalizedCurrent;
|
|
83
|
+
}
|
|
84
|
+
|
|
79
85
|
if (currentArguments.trim() === "{}" && nextInput.trim().startsWith("{")) {
|
|
80
86
|
return nextInput;
|
|
81
87
|
}
|
|
@@ -4,3 +4,21 @@ export const DEFAULT_MAX_TOKENS = AGENT_DEFAULTS.maxTokens;
|
|
|
4
4
|
export const DEFAULT_TEMPERATURE = AGENT_DEFAULTS.temperature;
|
|
5
5
|
export const MAX_STREAM_BUFFER_SIZE = STREAMING_DEFAULTS.maxBufferSize;
|
|
6
6
|
export const DEFAULT_MAX_STEPS = 20;
|
|
7
|
+
|
|
8
|
+
/** Max output token limits per model (normalized IDs without `veryfront-cloud/` prefix). */
|
|
9
|
+
const MODEL_MAX_OUTPUT_TOKENS: Record<string, number> = {
|
|
10
|
+
"anthropic/claude-opus-4-6": 32_768,
|
|
11
|
+
"anthropic/claude-sonnet-4-6": 16_384,
|
|
12
|
+
"anthropic/claude-haiku-4-5-20251001": 8_192,
|
|
13
|
+
"openai/gpt-5.2": 16_384,
|
|
14
|
+
"google-ai-studio/gemini-2.5-pro": 65_536,
|
|
15
|
+
"google-ai-studio/gemini-2.5-flash": 8_192,
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
/** Look up max output tokens for a model, stripping the `veryfront-cloud/` prefix. */
|
|
19
|
+
export function getModelMaxOutputTokens(modelString: string): number | undefined {
|
|
20
|
+
const normalized = modelString.startsWith("veryfront-cloud/")
|
|
21
|
+
? modelString.slice("veryfront-cloud/".length)
|
|
22
|
+
: modelString;
|
|
23
|
+
return MODEL_MAX_OUTPUT_TOKENS[normalized];
|
|
24
|
+
}
|
|
@@ -87,7 +87,7 @@ export {
|
|
|
87
87
|
MAX_STREAM_BUFFER_SIZE,
|
|
88
88
|
} from "./constants.js";
|
|
89
89
|
|
|
90
|
-
import { DEFAULT_MAX_TOKENS, DEFAULT_TEMPERATURE } from "./constants.js";
|
|
90
|
+
import { DEFAULT_MAX_TOKENS, DEFAULT_TEMPERATURE, getModelMaxOutputTokens } from "./constants.js";
|
|
91
91
|
import { closeSSEStream, generateMessageId, sendSSE } from "./sse-utils.js";
|
|
92
92
|
import {
|
|
93
93
|
executeConfiguredTool,
|
|
@@ -726,7 +726,7 @@ export class AgentRuntime {
|
|
|
726
726
|
allowedToolNames: allowedRemoteToolNames,
|
|
727
727
|
}),
|
|
728
728
|
experimental_repairToolCall: repairToolCall,
|
|
729
|
-
maxOutputTokens: this.resolveMaxOutputTokens(maxOutputTokensOverride),
|
|
729
|
+
maxOutputTokens: this.resolveMaxOutputTokens(effectiveModel, maxOutputTokensOverride),
|
|
730
730
|
temperature: DEFAULT_TEMPERATURE,
|
|
731
731
|
...(headers ? { headers } : {}),
|
|
732
732
|
...(providerOptions ? { providerOptions } : {}),
|
|
@@ -1033,7 +1033,7 @@ export class AgentRuntime {
|
|
|
1033
1033
|
allowedToolNames: allowedRemoteToolNames,
|
|
1034
1034
|
}),
|
|
1035
1035
|
experimental_repairToolCall: repairToolCall,
|
|
1036
|
-
maxOutputTokens: this.resolveMaxOutputTokens(maxOutputTokensOverride),
|
|
1036
|
+
maxOutputTokens: this.resolveMaxOutputTokens(effectiveModel, maxOutputTokensOverride),
|
|
1037
1037
|
temperature: DEFAULT_TEMPERATURE,
|
|
1038
1038
|
...(headers ? { headers } : {}),
|
|
1039
1039
|
...(providerOptions ? { providerOptions } : {}),
|
|
@@ -1378,7 +1378,7 @@ export class AgentRuntime {
|
|
|
1378
1378
|
return getMaxSteps(this.config.maxSteps, edgeMaxSteps, platformLimit);
|
|
1379
1379
|
}
|
|
1380
1380
|
|
|
1381
|
-
private resolveMaxOutputTokens(maxOutputTokensOverride?: number): number {
|
|
1381
|
+
private resolveMaxOutputTokens(modelString?: string, maxOutputTokensOverride?: number): number {
|
|
1382
1382
|
if (
|
|
1383
1383
|
typeof maxOutputTokensOverride === "number" &&
|
|
1384
1384
|
Number.isFinite(maxOutputTokensOverride) &&
|
|
@@ -1387,7 +1387,9 @@ export class AgentRuntime {
|
|
|
1387
1387
|
return Math.floor(maxOutputTokensOverride);
|
|
1388
1388
|
}
|
|
1389
1389
|
|
|
1390
|
-
return this.config.memory?.maxTokens ??
|
|
1390
|
+
return this.config.memory?.maxTokens ??
|
|
1391
|
+
(modelString ? getModelMaxOutputTokens(modelString) : undefined) ??
|
|
1392
|
+
DEFAULT_MAX_TOKENS;
|
|
1391
1393
|
}
|
|
1392
1394
|
|
|
1393
1395
|
/**
|