@alveus-ai/std 0.1.48 → 0.1.49
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/dist/agents/basic-chat.js +2 -2
- package/dist/agents/react.js +1 -1
- package/dist/blobs/{32a1c173fef4627d2c39bdfa293253d6baa6f6d1d3c4f1f146994c80030af7d5.js → 2fff20a2f2145c537e470a4b1f067080ebf10460533b638dc77bf937ddd362f4.js} +1 -0
- package/dist/blobs/{ea02e7f577c9e420831c741a0b02ec15b1b5f76975074cf031d763ec263327d1.js → 66296bb746405ec02e83f2e1e6d40195d2a361ac1cfac57c037296e3fbfcdb26.js} +1 -0
- package/dist/blobs/{0caaf80d04fbe7c988c7c5961fca2260ac01d8a91c37281cf8a18a719794ff7d.js → fd2d75bca62956931b98463149236799bdf6f09ee9321240c9df7cf2eccbbea4.js} +32 -0
- package/package.json +1 -1
|
@@ -55,7 +55,7 @@ export function createChatAgent(systemPrompt, options = {}) {
|
|
|
55
55
|
};
|
|
56
56
|
}, {
|
|
57
57
|
name: name || 'chat-agent',
|
|
58
|
-
description: description || 'A basic chat agent', hash: "
|
|
58
|
+
description: description || 'A basic chat agent', hash: "2fff20a2f2145c537e470a4b1f067080ebf10460533b638dc77bf937ddd362f4",
|
|
59
59
|
});
|
|
60
60
|
}
|
|
61
61
|
/**
|
|
@@ -87,7 +87,7 @@ export function createJsonChatAgent(systemPrompt, options = {}) {
|
|
|
87
87
|
return { data, raw: reply };
|
|
88
88
|
}, {
|
|
89
89
|
name: name || 'json-chat-agent',
|
|
90
|
-
description: description || 'A structured JSON chat agent', hash: "
|
|
90
|
+
description: description || 'A structured JSON chat agent', hash: "66296bb746405ec02e83f2e1e6d40195d2a361ac1cfac57c037296e3fbfcdb26",
|
|
91
91
|
});
|
|
92
92
|
}
|
|
93
93
|
//# sourceMappingURL=basic-chat.js.map
|
package/dist/agents/react.js
CHANGED
|
@@ -349,7 +349,7 @@ Rules:
|
|
|
349
349
|
steps,
|
|
350
350
|
iterations,
|
|
351
351
|
};
|
|
352
|
-
}, { name: 'ReActLogic', hash: "
|
|
352
|
+
}, { name: 'ReActLogic', hash: "fd2d75bca62956931b98463149236799bdf6f09ee9321240c9df7cf2eccbbea4" });
|
|
353
353
|
/**
|
|
354
354
|
* Built-in tool Zod schemas
|
|
355
355
|
*/
|
|
@@ -22,6 +22,7 @@ __export(virtual_agent_exports, {
|
|
|
22
22
|
default: () => virtual_agent_default
|
|
23
23
|
});
|
|
24
24
|
module.exports = __toCommonJS(virtual_agent_exports);
|
|
25
|
+
var import_core = require("@alveus-ai/core");
|
|
25
26
|
var __alveusHandler = async (_state, event, ctx) => {
|
|
26
27
|
const messages = [
|
|
27
28
|
{ role: "system", content: systemPrompt }
|
|
@@ -22,6 +22,7 @@ __export(virtual_agent_exports, {
|
|
|
22
22
|
default: () => virtual_agent_default
|
|
23
23
|
});
|
|
24
24
|
module.exports = __toCommonJS(virtual_agent_exports);
|
|
25
|
+
var import_zod2 = require("zod");
|
|
25
26
|
|
|
26
27
|
// src/utils/parse-json.ts
|
|
27
28
|
function parseJsonResponse(text) {
|
|
@@ -93,6 +94,13 @@ function findFirstJsonStart(text) {
|
|
|
93
94
|
return -1;
|
|
94
95
|
}
|
|
95
96
|
|
|
97
|
+
// src/utils/schema.ts
|
|
98
|
+
var import_zod = require("zod");
|
|
99
|
+
function getPromptSchemaString(schema) {
|
|
100
|
+
const jsonSchemaObj = import_zod.z.toJSONSchema(schema);
|
|
101
|
+
return JSON.stringify(jsonSchemaObj, null, 2);
|
|
102
|
+
}
|
|
103
|
+
|
|
96
104
|
// src/utils/json-validator.ts
|
|
97
105
|
function validateJsonSchema(value, schema) {
|
|
98
106
|
const effectiveSchema = schema.properties ? schema : schema;
|
|
@@ -166,6 +174,30 @@ function validateType(value, schema) {
|
|
|
166
174
|
}
|
|
167
175
|
|
|
168
176
|
// src/agents/virtual-agent.ts
|
|
177
|
+
var BUILTIN_SCHEMAS = {
|
|
178
|
+
calculator: import_zod2.z.object({
|
|
179
|
+
expression: import_zod2.z.string().describe("Arithmetic expression to evaluate")
|
|
180
|
+
}),
|
|
181
|
+
string: import_zod2.z.object({
|
|
182
|
+
operation: import_zod2.z.enum(["length", "uppercase", "lowercase", "reverse"]).describe("String operation"),
|
|
183
|
+
text: import_zod2.z.string().describe("Input text")
|
|
184
|
+
})
|
|
185
|
+
};
|
|
186
|
+
var BUILTIN_TOOLS = {
|
|
187
|
+
calculator: {
|
|
188
|
+
hash: "builtin:calculator",
|
|
189
|
+
description: "Performs arithmetic calculations. Supports +, -, *, /, and parentheses.",
|
|
190
|
+
parameters: getPromptSchemaString(BUILTIN_SCHEMAS.calculator),
|
|
191
|
+
jsonSchema: JSON.parse(getPromptSchemaString(BUILTIN_SCHEMAS.calculator))
|
|
192
|
+
},
|
|
193
|
+
string: {
|
|
194
|
+
hash: "builtin:string",
|
|
195
|
+
description: "Performs string operations: length, uppercase, lowercase, reverse",
|
|
196
|
+
parameters: getPromptSchemaString(BUILTIN_SCHEMAS.string),
|
|
197
|
+
jsonSchema: JSON.parse(getPromptSchemaString(BUILTIN_SCHEMAS.string))
|
|
198
|
+
}
|
|
199
|
+
};
|
|
200
|
+
var availableTools = Object.keys(BUILTIN_TOOLS);
|
|
169
201
|
var __alveusHandler = async (_state, event, ctx) => {
|
|
170
202
|
const BUILTIN_EXECUTORS = {
|
|
171
203
|
"builtin:calculator": async ({ expression }) => {
|