veryfront 0.1.661 → 0.1.662
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/deno.js +1 -1
- package/esm/src/agent/runtime/agent-definition.d.ts +2 -0
- package/esm/src/agent/runtime/agent-definition.d.ts.map +1 -1
- package/esm/src/agent/runtime/agent-definition.js +9 -0
- package/esm/src/sandbox/shell-tools.d.ts.map +1 -1
- package/esm/src/sandbox/shell-tools.js +23 -1
- 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/esm/deno.js
CHANGED
|
@@ -27,6 +27,7 @@ export declare const getRuntimeAgentMarkdownDefinitionSchema: () => import("../.
|
|
|
27
27
|
}> | undefined>;
|
|
28
28
|
model: import("../../internal-agents/schema.js").Schema<string | undefined>;
|
|
29
29
|
maxSteps: import("../../internal-agents/schema.js").Schema<number | undefined>;
|
|
30
|
+
providerTools: import("../../internal-agents/schema.js").Schema<string[] | undefined>;
|
|
30
31
|
}>>;
|
|
31
32
|
/** Default value for runtime agent context marker. */
|
|
32
33
|
export declare const DEFAULT_RUNTIME_AGENT_CONTEXT_MARKER = "<!-- veryfront-runtime-context -->";
|
|
@@ -44,6 +45,7 @@ export declare const runtimeAgentMarkdownDefinitionSchema: import("../../interna
|
|
|
44
45
|
}> | undefined>;
|
|
45
46
|
model: import("../../internal-agents/schema.js").Schema<string | undefined>;
|
|
46
47
|
maxSteps: import("../../internal-agents/schema.js").Schema<number | undefined>;
|
|
48
|
+
providerTools: import("../../internal-agents/schema.js").Schema<string[] | undefined>;
|
|
47
49
|
}>>;
|
|
48
50
|
/** Definition for runtime agent markdown. */
|
|
49
51
|
export type RuntimeAgentMarkdownDefinition = InferSchema<ReturnType<typeof getRuntimeAgentMarkdownDefinitionSchema>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-definition.d.ts","sourceRoot":"","sources":["../../../../src/src/agent/runtime/agent-definition.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAC;AACpE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAG7D,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAElE,wDAAwD;AACxD,eAAO,MAAM,mCAAmC;;;GAK/C,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,gCAAgC;;;GAAkD,CAAC;AAEhG,oDAAoD;AACpD,MAAM,MAAM,0BAA0B,GAAG,WAAW,CAClD,UAAU,CAAC,OAAO,mCAAmC,CAAC,CACvD,CAAC;AAEF,4DAA4D;AAC5D,eAAO,MAAM,uCAAuC
|
|
1
|
+
{"version":3,"file":"agent-definition.d.ts","sourceRoot":"","sources":["../../../../src/src/agent/runtime/agent-definition.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAC;AACpE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAG7D,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAElE,wDAAwD;AACxD,eAAO,MAAM,mCAAmC;;;GAK/C,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,gCAAgC;;;GAAkD,CAAC;AAEhG,oDAAoD;AACpD,MAAM,MAAM,0BAA0B,GAAG,WAAW,CAClD,UAAU,CAAC,OAAO,mCAAmC,CAAC,CACvD,CAAC;AAEF,4DAA4D;AAC5D,eAAO,MAAM,uCAAuC;;;;;;;;;;;;GAWnD,CAAC;AAEF,sDAAsD;AACtD,eAAO,MAAM,oCAAoC,uCAAuC,CAAC;AAEzF;;GAEG;AACH,eAAO,MAAM,oCAAoC;;;;;;;;;;;;GAEhD,CAAC;AAEF,6CAA6C;AAC7C,MAAM,MAAM,8BAA8B,GAAG,WAAW,CACtD,UAAU,CAAC,OAAO,uCAAuC,CAAC,CAC3D,CAAC;AAEF,wEAAwE;AACxE,eAAO,MAAM,iDAAiD;;;GAK7D,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,8CAA8C;;;GAE1D,CAAC;AAEF,iEAAiE;AACjE,MAAM,MAAM,wCAAwC,GAAG,WAAW,CAChE,UAAU,CAAC,OAAO,iDAAiD,CAAC,CACrE,CAAC;AAEF,8DAA8D;AAC9D,MAAM,MAAM,qCAAqC,GAAG;IAClD,KAAK,EAAE,8BAA8B,CAAC;IACtC,aAAa,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAClC,MAAM,CAAC,EAAE,SAAS,sBAAsB,EAAE,CAAC;IAC3C,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,oBAAoB,CAAC,EAAE,MAAM,CAAC;CAC/B,CAAC;AAuBF,mDAAmD;AACnD,wBAAgB,mCAAmC,CACjD,KAAK,EAAE,wCAAwC,GAC9C,8BAA8B,CAoBhC;AAkBD,4CAA4C;AAC5C,wBAAgB,gCAAgC,CAC9C,KAAK,EAAE,qCAAqC,GAC3C,iBAAiB,EAAE,CA2CrB"}
|
|
@@ -20,6 +20,7 @@ export const getRuntimeAgentMarkdownDefinitionSchema = defineSchema((v) => v.obj
|
|
|
20
20
|
thinking: getRuntimeAgentThinkingConfigSchema().optional(),
|
|
21
21
|
model: v.string().min(1).optional(),
|
|
22
22
|
maxSteps: v.number().optional(),
|
|
23
|
+
providerTools: v.array(v.string().min(1)).optional(),
|
|
23
24
|
}));
|
|
24
25
|
/** Default value for runtime agent context marker. */
|
|
25
26
|
export const DEFAULT_RUNTIME_AGENT_CONTEXT_MARKER = "<!-- veryfront-runtime-context -->";
|
|
@@ -48,6 +49,12 @@ function parseThinking(value) {
|
|
|
48
49
|
}
|
|
49
50
|
return undefined;
|
|
50
51
|
}
|
|
52
|
+
function parseProviderTools(value) {
|
|
53
|
+
if (!Array.isArray(value)) {
|
|
54
|
+
return undefined;
|
|
55
|
+
}
|
|
56
|
+
return value;
|
|
57
|
+
}
|
|
51
58
|
/** Definition for parse runtime agent markdown. */
|
|
52
59
|
export function parseRuntimeAgentMarkdownDefinition(input) {
|
|
53
60
|
const parsedInput = getParseRuntimeAgentMarkdownDefinitionInputSchema().parse(input);
|
|
@@ -57,6 +64,7 @@ export function parseRuntimeAgentMarkdownDefinition(input) {
|
|
|
57
64
|
const model = typeof attrs.model === "string" && attrs.model.trim() ? attrs.model : undefined;
|
|
58
65
|
const thinking = parseThinking(attrs.thinking);
|
|
59
66
|
const maxSteps = typeof attrs["max-steps"] === "number" ? attrs["max-steps"] : undefined;
|
|
67
|
+
const providerTools = parseProviderTools(attrs["provider-tools"]);
|
|
60
68
|
return getRuntimeAgentMarkdownDefinitionSchema().parse({
|
|
61
69
|
id: parsedInput.id,
|
|
62
70
|
name,
|
|
@@ -65,6 +73,7 @@ export function parseRuntimeAgentMarkdownDefinition(input) {
|
|
|
65
73
|
...(model ? { model } : {}),
|
|
66
74
|
...(thinking ? { thinking } : {}),
|
|
67
75
|
...(maxSteps === undefined ? {} : { maxSteps }),
|
|
76
|
+
...(providerTools ? { providerTools } : {}),
|
|
68
77
|
});
|
|
69
78
|
}
|
|
70
79
|
function splitRuntimeAgentInstructions(input) {
|
|
@@ -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;AA0KxC,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"}
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
const SANDBOX_WORKING_DIRECTORY = "/workspace";
|
|
2
2
|
const SANDBOX_TOOL_PROMPT = "Available tools: agent-browser, awk, cat, column, comm, curl, cut, diff, expand, find, fold, grep, head, iconv, join, jq, nl, node, od, paste, printf, python3, rev, sed, sort, split, strings, tail, tee, tr, unexpand, uniq, veryfront, wc, xargs, xxd, yq, and more";
|
|
3
|
+
const PERMISSIVE_OBJECT_SCHEMA = {
|
|
4
|
+
type: "object",
|
|
5
|
+
properties: {},
|
|
6
|
+
additionalProperties: true,
|
|
7
|
+
};
|
|
3
8
|
const JSON_SCHEMA_TYPES = new Set([
|
|
4
9
|
"string",
|
|
5
10
|
"number",
|
|
@@ -98,7 +103,16 @@ function normalizeJsonSchema(value) {
|
|
|
98
103
|
schema.minItems = value.minItems;
|
|
99
104
|
if (typeof value.maxItems === "number")
|
|
100
105
|
schema.maxItems = value.maxItems;
|
|
101
|
-
return schema;
|
|
106
|
+
return Object.keys(schema).length > 0 ? schema : undefined;
|
|
107
|
+
}
|
|
108
|
+
function isContractSchema(value) {
|
|
109
|
+
if (!isRecord(value))
|
|
110
|
+
return false;
|
|
111
|
+
if ("__zod" in value)
|
|
112
|
+
return true;
|
|
113
|
+
return ("_output" in value &&
|
|
114
|
+
typeof value.parse === "function" &&
|
|
115
|
+
typeof value.safeParse === "function");
|
|
102
116
|
}
|
|
103
117
|
function normalizeBashTool(toolName, toolDefinition) {
|
|
104
118
|
if (!isRecord(toolDefinition)) {
|
|
@@ -110,6 +124,8 @@ function normalizeBashTool(toolName, toolDefinition) {
|
|
|
110
124
|
const description = toolDefinition.description;
|
|
111
125
|
const inputSchema = toolDefinition.inputSchema;
|
|
112
126
|
const inputSchemaJson = normalizeJsonSchema(toolDefinition.inputSchemaJson);
|
|
127
|
+
const hasContractInputSchema = isContractSchema(inputSchema);
|
|
128
|
+
const inputSchemaAsJson = hasContractInputSchema ? undefined : normalizeJsonSchema(inputSchema);
|
|
113
129
|
const executeCandidate = toolDefinition.execute;
|
|
114
130
|
const mcp = toolDefinition.mcp;
|
|
115
131
|
if (typeof id === "string") {
|
|
@@ -127,6 +143,12 @@ function normalizeBashTool(toolName, toolDefinition) {
|
|
|
127
143
|
if (inputSchemaJson !== undefined) {
|
|
128
144
|
normalized.inputSchemaJson = inputSchemaJson;
|
|
129
145
|
}
|
|
146
|
+
else if (inputSchemaAsJson !== undefined) {
|
|
147
|
+
normalized.inputSchemaJson = inputSchemaAsJson;
|
|
148
|
+
}
|
|
149
|
+
else if (inputSchema !== undefined && !hasContractInputSchema) {
|
|
150
|
+
normalized.inputSchemaJson = PERMISSIVE_OBJECT_SCHEMA;
|
|
151
|
+
}
|
|
130
152
|
if (typeof executeCandidate === "function") {
|
|
131
153
|
normalized.execute = async (input, options) => executeCandidate(input, options);
|
|
132
154
|
}
|