veryfront 0.1.1173 → 0.1.1174

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.
@@ -22,15 +22,15 @@ export default {
22
22
  },
23
23
  "ai-agent": {
24
24
  "files": {
25
- "agents/assistant.ts": "import { agent } from \"veryfront/agent\";\n\nexport default agent({\n id: \"assistant\",\n name: \"Assistant\",\n description: \"Turn a rough idea into a clear next move.\",\n system:\n \"Be direct and practical. Structure complex answers clearly. Use the calculator tool for arithmetic instead of calculating mentally. Use other tools when they improve accuracy, and state assumptions that affect the result.\",\n tools: true,\n maxSteps: 10,\n suggestions: {\n suggestions: [\n {\n type: \"prompt\",\n title: \"Shape an idea\",\n prompt: \"Turn this rough idea into a focused plan with the first three steps: \",\n },\n {\n type: \"prompt\",\n title: \"Run the numbers\",\n prompt:\n \"Calculate an 18% tip on $84.50, split the total among three people, and explain the result briefly.\",\n },\n ],\n },\n});\n",
25
+ "agents/assistant.ts": "import { agent } from \"veryfront/agent\";\n\nexport default agent({\n id: \"assistant\",\n name: \"Assistant\",\n description: \"Turn a rough idea into a clear next move.\",\n system:\n \"Be direct and practical. Structure complex answers clearly. Use the calculator tool for arithmetic instead of calculating mentally. For currency splits, make rounded shares add exactly to the total and explain any remainder. Use other tools when they improve accuracy, and state assumptions that affect the result.\",\n tools: true,\n maxSteps: 10,\n suggestions: {\n suggestions: [\n {\n type: \"prompt\",\n title: \"Shape an idea\",\n prompt: \"Turn this rough idea into a focused plan with the first three steps: \",\n },\n {\n type: \"prompt\",\n title: \"Run the numbers\",\n prompt:\n \"Calculate an 18% tip on $84.50, split the total among three people, and explain the result briefly.\",\n },\n ],\n },\n});\n",
26
26
  "app/api/ag-ui/route.ts": "import { createAgUiHandler } from \"veryfront/agent\";\n\nexport const POST = createAgUiHandler(\"assistant\");\n",
27
27
  "app/layout.tsx": "import \"../globals.css\";\nimport { Head } from \"veryfront/head\";\n\nexport default function RootLayout({\n children,\n}: {\n children: React.ReactNode;\n}): React.ReactNode {\n return (\n <>\n <Head>\n <title>Assistant</title>\n <link rel=\"icon\" href=\"/favicon.svg\" type=\"image/svg+xml\" />\n </Head>\n {children}\n </>\n );\n}\n",
28
28
  "app/page.tsx": "\"use client\";\n\nimport { Chat } from \"veryfront/chat\";\n\nexport default function ChatPage(): React.JSX.Element {\n return <Chat agentId=\"assistant\" className=\"h-screen\" />;\n}\n",
29
- "evals/assistant.eval.ts": "import { datasets, evalAgent, judges, metrics } from \"veryfront/eval\";\n\nexport default evalAgent({\n name: \"Assistant smoke test\",\n target: \"agent:assistant\",\n dataset: datasets.inline([\n {\n id: \"calculator\",\n input:\n \"Calculate an 18% tip on $84.50, split the total among three people, and explain the result briefly.\",\n reference: \"$99.71 total; two people pay $33.24 and one pays $33.23.\",\n },\n ]),\n metrics: [\n metrics.answer.contains({ text: \"15.21\" }).gate(),\n metrics.answer.contains({ text: \"99.71\" }).gate(),\n metrics.answer.contains({ text: \"33.24\" }).gate(),\n metrics.answer.contains({ text: \"33.23\" }).gate(),\n metrics.agent.calledTool(\"calculator\").gate(),\n metrics.agent.noFailedTools().gate(),\n metrics.judge.rubric({\n rubric:\n \"The answer must correctly state the $15.21 tip, $99.71 total, and a cent-exact split of two payments of $33.24 and one of $33.23. It should explain the result briefly.\",\n judge: judges.llm.rubric(),\n }).gate({ min: 0.8 }),\n ],\n});\n",
29
+ "evals/assistant.eval.ts": "import { datasets, evalAgent, judges, metrics } from \"veryfront/eval\";\n\nexport default evalAgent({\n name: \"Assistant smoke test\",\n target: \"agent:assistant\",\n dataset: datasets.inline([\n {\n id: \"calculator\",\n input:\n \"Calculate an 18% tip on $84.50, split the total among three people, and explain the result briefly.\",\n reference: \"$99.71 total; two people pay $33.24 and one pays $33.23.\",\n },\n ]),\n metrics: [\n metrics.answer.regex({\n pattern: String.raw`(?<![-\\d.\\\\])\\\\?\\$15\\.21(?![\\d.])`,\n }).gate(),\n metrics.answer.regex({\n pattern: String.raw`(?<![-\\d.\\\\])\\\\?\\$99\\.71(?![\\d.])`,\n }).gate(),\n metrics.answer.regex({\n pattern: String.raw`(?<![-\\d.\\\\])\\\\?\\$33\\.24(?![\\d.])`,\n }).gate(),\n metrics.answer.regex({\n pattern: String.raw`(?<![-\\d.\\\\])\\\\?\\$33\\.23(?![\\d.])`,\n }).gate(),\n metrics.agent.calledTool(\"calculator\").gate(),\n metrics.agent.noFailedTools().gate(),\n metrics.judge.rubric({\n rubric:\n \"The answer must correctly state the $15.21 tip, $99.71 total, and a cent-exact split of two payments of $33.24 and one of $33.23. It should explain the result briefly.\",\n judge: judges.llm.rubric(),\n }).gate({ min: 0.8 }),\n ],\n});\n",
30
30
  "globals.css": "@import \"tailwindcss\";\n",
31
31
  "public/favicon.svg": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 64 64\">\n <rect width=\"64\" height=\"64\" fill=\"#fff\"/>\n <circle cx=\"32\" cy=\"32\" r=\"20\" fill=\"#000\"/>\n</svg>\n",
32
32
  "README.md": "# AI Agent\n\nA small, customizable agent with a streaming chat UI and tool support.\n\n## What's included\n\n- Single assistant agent with streaming chat UI\n- Example calculator tool\n- Smoke eval for the agent and calculator\n- App-mode `Chat` component for real-time responses\n\n## Structure\n\n```\nagents/assistant.ts Agent definition\ntools/calculator.ts Example tool\nevals/assistant.eval.ts Agent smoke eval\napp/\n api/ag-ui/route.ts AG-UI endpoint\n page.tsx Chat interface\n```\n\n## Customize\n\n- Edit `agents/assistant.ts` to change the agent's identity, instructions, and suggestions.\n- Add or replace files in `tools/` to give the agent new capabilities.\n- Update `evals/assistant.eval.ts`, then run `npm run eval -- assistant`.\n- Edit `app/page.tsx` when you need to customize the chat UI.\n",
33
- "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",
33
+ "tools/calculator.ts": "import { tool } from \"veryfront/tool\";\nimport { defineSchema } from \"veryfront/schemas\";\n\nexport default tool({\n id: \"calculator\",\n description: \"Perform arithmetic. For round, a is the value and b is the decimal places.\",\n inputSchema: defineSchema((v) => v.object({\n operation: v.enum([\"add\", \"subtract\", \"multiply\", \"divide\", \"round\"]),\n a: v.number(),\n b: v.number(),\n }))(),\n execute: ({ operation, a, b }) => {\n const precision = Math.min(100, Math.max(0, Math.trunc(b)));\n\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 if (operation === \"round\") {\n const offset = Math.sign(a) * Number.EPSILON * Math.max(1, Math.abs(a));\n return { result: Number((a + offset).toFixed(precision)) };\n }\n return { result: a / b };\n },\n});\n",
34
34
  "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"
35
35
  }
36
36
  },
package/esm/deno.js CHANGED
@@ -1,6 +1,6 @@
1
1
  export default {
2
2
  "name": "veryfront",
3
- "version": "0.1.1173",
3
+ "version": "0.1.1174",
4
4
  "license": "Apache-2.0",
5
5
  "nodeModulesDir": "auto",
6
6
  "minimumDependencyAge": {
@@ -1,3 +1,3 @@
1
1
  /** Shared version value. */
2
- export declare const VERSION = "0.1.1173";
2
+ export declare const VERSION = "0.1.1174";
3
3
  //# sourceMappingURL=version-constant.d.ts.map
@@ -1,4 +1,4 @@
1
1
  // Keep in sync with deno.json version.
2
2
  // scripts/release.ts updates this constant during releases.
3
3
  /** Shared version value. */
4
- export const VERSION = "0.1.1173";
4
+ export const VERSION = "0.1.1174";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "veryfront",
3
- "version": "0.1.1173",
3
+ "version": "0.1.1174",
4
4
  "description": "The simplest way to build AI-powered apps",
5
5
  "keywords": [
6
6
  "react",
@@ -344,10 +344,10 @@
344
344
  "@types/react": "19.2.14",
345
345
  "@types/react-dom": "19.2.3",
346
346
  "ws": "8.21.0",
347
- "@veryfront/ext-bundler-esbuild": "0.1.1173",
348
- "@veryfront/ext-content-mdx": "0.1.1173",
349
- "@veryfront/ext-css-tailwind": "0.1.1173",
350
- "@veryfront/ext-parser-babel": "0.1.1173"
347
+ "@veryfront/ext-bundler-esbuild": "0.1.1174",
348
+ "@veryfront/ext-content-mdx": "0.1.1174",
349
+ "@veryfront/ext-css-tailwind": "0.1.1174",
350
+ "@veryfront/ext-parser-babel": "0.1.1174"
351
351
  },
352
352
  "devDependencies": {
353
353
  "@types/node": "20.9.0"