create-agentmark 0.3.0 → 0.3.1

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.
Files changed (68) hide show
  1. package/dist/index.cjs +803 -0
  2. package/dist/index.cjs.map +1 -0
  3. package/dist/index.d.cts +1 -0
  4. package/dist/index.d.ts +0 -2
  5. package/dist/index.js +770 -51
  6. package/dist/index.js.map +1 -1
  7. package/package.json +3 -2
  8. package/dist/index.d.ts.map +0 -1
  9. package/dist/utils/examples/create-example-app.d.ts +0 -2
  10. package/dist/utils/examples/create-example-app.d.ts.map +0 -1
  11. package/dist/utils/examples/create-example-app.js +0 -243
  12. package/dist/utils/examples/create-example-app.js.map +0 -1
  13. package/dist/utils/examples/templates/adapters.d.ts +0 -15
  14. package/dist/utils/examples/templates/adapters.d.ts.map +0 -1
  15. package/dist/utils/examples/templates/adapters.js +0 -28
  16. package/dist/utils/examples/templates/adapters.js.map +0 -1
  17. package/dist/utils/examples/templates/animal-drawing-prompt.d.ts +0 -2
  18. package/dist/utils/examples/templates/animal-drawing-prompt.d.ts.map +0 -1
  19. package/dist/utils/examples/templates/animal-drawing-prompt.js +0 -19
  20. package/dist/utils/examples/templates/animal-drawing-prompt.js.map +0 -1
  21. package/dist/utils/examples/templates/app-index.d.ts +0 -2
  22. package/dist/utils/examples/templates/app-index.d.ts.map +0 -1
  23. package/dist/utils/examples/templates/app-index.js +0 -95
  24. package/dist/utils/examples/templates/app-index.js.map +0 -1
  25. package/dist/utils/examples/templates/customer-support-prompt.d.ts +0 -2
  26. package/dist/utils/examples/templates/customer-support-prompt.d.ts.map +0 -1
  27. package/dist/utils/examples/templates/customer-support-prompt.js +0 -40
  28. package/dist/utils/examples/templates/customer-support-prompt.js.map +0 -1
  29. package/dist/utils/examples/templates/datasets.d.ts +0 -5
  30. package/dist/utils/examples/templates/datasets.d.ts.map +0 -1
  31. package/dist/utils/examples/templates/datasets.js +0 -21
  32. package/dist/utils/examples/templates/datasets.js.map +0 -1
  33. package/dist/utils/examples/templates/env.d.ts +0 -2
  34. package/dist/utils/examples/templates/env.d.ts.map +0 -1
  35. package/dist/utils/examples/templates/env.js +0 -12
  36. package/dist/utils/examples/templates/env.js.map +0 -1
  37. package/dist/utils/examples/templates/example-prompts.d.ts +0 -2
  38. package/dist/utils/examples/templates/example-prompts.d.ts.map +0 -1
  39. package/dist/utils/examples/templates/example-prompts.js +0 -35
  40. package/dist/utils/examples/templates/example-prompts.js.map +0 -1
  41. package/dist/utils/examples/templates/index.d.ts +0 -13
  42. package/dist/utils/examples/templates/index.d.ts.map +0 -1
  43. package/dist/utils/examples/templates/index.js +0 -13
  44. package/dist/utils/examples/templates/index.js.map +0 -1
  45. package/dist/utils/examples/templates/package-setup.d.ts +0 -3
  46. package/dist/utils/examples/templates/package-setup.d.ts.map +0 -1
  47. package/dist/utils/examples/templates/package-setup.js +0 -61
  48. package/dist/utils/examples/templates/package-setup.js.map +0 -1
  49. package/dist/utils/examples/templates/party-planner-prompt.d.ts +0 -2
  50. package/dist/utils/examples/templates/party-planner-prompt.d.ts.map +0 -1
  51. package/dist/utils/examples/templates/party-planner-prompt.js +0 -40
  52. package/dist/utils/examples/templates/party-planner-prompt.js.map +0 -1
  53. package/dist/utils/examples/templates/story-teller-prompt.d.ts +0 -2
  54. package/dist/utils/examples/templates/story-teller-prompt.d.ts.map +0 -1
  55. package/dist/utils/examples/templates/story-teller-prompt.js +0 -23
  56. package/dist/utils/examples/templates/story-teller-prompt.js.map +0 -1
  57. package/dist/utils/examples/templates/tsconfig.d.ts +0 -2
  58. package/dist/utils/examples/templates/tsconfig.d.ts.map +0 -1
  59. package/dist/utils/examples/templates/tsconfig.js +0 -14
  60. package/dist/utils/examples/templates/tsconfig.js.map +0 -1
  61. package/dist/utils/examples/templates/user-client-config.d.ts +0 -6
  62. package/dist/utils/examples/templates/user-client-config.d.ts.map +0 -1
  63. package/dist/utils/examples/templates/user-client-config.js +0 -85
  64. package/dist/utils/examples/templates/user-client-config.js.map +0 -1
  65. package/dist/utils/providers.d.ts +0 -9
  66. package/dist/utils/providers.d.ts.map +0 -1
  67. package/dist/utils/providers.js +0 -16
  68. package/dist/utils/providers.js.map +0 -1
@@ -1,40 +0,0 @@
1
- export const getCustomerSupportPrompt = (model) => {
2
- return `---
3
- name: customer-support-agent
4
- text_config:
5
- model_name: ${model}
6
- max_calls: 2
7
- tools:
8
- search_knowledgebase:
9
- description: Search the company knowledgebase for information about shipping, warranty, and returns policies.
10
- parameters:
11
- type: object
12
- properties:
13
- query:
14
- type: string
15
- description: The search query to find relevant information
16
- required: [query]
17
- test_settings:
18
- dataset: customer-query.jsonl
19
- props:
20
- customer_question: "I'm having trouble with my order. How long does shipping take?"
21
- input_schema:
22
- type: object
23
- properties:
24
- customer_question:
25
- type: string
26
- description: "The customer's question"
27
- required:
28
- - customer_question
29
- ---
30
-
31
- <System>
32
- You are a customer service agent for a company that sells products online. You are given a customer's question and you need to respond to the customer. You need to be friendly, professional, and helpful.
33
-
34
- You have access to the following tool:
35
- - search_knowledgebase: Search the company knowledgebase for information about shipping, warranty, and returns. Use this when customers ask about these topics.
36
- </System>
37
-
38
- <User>{props.customer_question}</User>`;
39
- };
40
- //# sourceMappingURL=customer-support-prompt.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"customer-support-prompt.js","sourceRoot":"","sources":["../../../../src/utils/examples/templates/customer-support-prompt.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,KAAa,EAAU,EAAE;IAChE,OAAO;;;gBAGO,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uCAiCkB,CAAC;AACxC,CAAC,CAAC"}
@@ -1,5 +0,0 @@
1
- export declare const getAnimalDataset: () => string;
2
- export declare const getCustomerQueryDataset: () => string;
3
- export declare const getPartyDataset: () => string;
4
- export declare const getStoryDataset: () => string;
5
- //# sourceMappingURL=datasets.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"datasets.d.ts","sourceRoot":"","sources":["../../../../src/utils/examples/templates/datasets.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB,QAAO,MAInC,CAAC;AAEF,eAAO,MAAM,uBAAuB,QAAO,MAI1C,CAAC;AAEF,eAAO,MAAM,eAAe,QAAO,MAIlC,CAAC;AAEF,eAAO,MAAM,eAAe,QAAO,MAIlC,CAAC"}
@@ -1,21 +0,0 @@
1
- export const getAnimalDataset = () => {
2
- return `{"input": {"animal": "cat"}, "expected_output": "A realistic picture of a cat"}
3
- {"input": {"animal": "dog"}, "expected_output": "A realistic picture of a dog"}
4
- {"input": {"animal": "bird"}, "expected_output": "A realistic picture of a bird"}`;
5
- };
6
- export const getCustomerQueryDataset = () => {
7
- return `{"input": {"customer_question": "My package hasn't arrived yet. Can you help me track it?"}}
8
- {"input": {"customer_question": "I received the wrong item in my order. What should I do?"}}
9
- {"input": {"customer_question": "How do I return a product that I purchased last week?"}}`;
10
- };
11
- export const getPartyDataset = () => {
12
- return `{"input": {"party_text": "We're having a party with Alice, Bob, and Carol."}, "expected_output": "{\\"names\\": [\\"Alice\\", \\"Bob\\", \\"Carol\\"]}"}
13
- {"input": {"party_text": "The guest list includes Dave, Emma, and Frank."}, "expected_output": "{\\"names\\": [\\"Dave\\", \\"Emma\\", \\"Frank\\"]}"}
14
- {"input": {"party_text": "Join us for a celebration with Grace, Henry, and Isla."}, "expected_output": "{\\"names\\": [\\"Grace\\", \\"Henry\\", \\"Isla\\"]}"}`;
15
- };
16
- export const getStoryDataset = () => {
17
- return `{"input": {"story": "Once upon a time, the Moon woke up and found her glow missing! She floated around the sky asking stars, clouds, and even comets if they'd seen her light. It wasn't until she peeked into a mountain lake that she saw her glow shining back—hidden in her own reflection! Laughing, she realized she had never lost it—it was with her all along, just hiding beneath a cloudy sky."}}
18
- {"input": {"story": "Benny was no ordinary banana—he dreamed of becoming a superhero. One day, when a monkey slipped in the jungle and cried for help, Benny rolled into action, dodging vines and swinging from branches using his peel like a lasso. The monkey was saved, and from that day on, Benny was known as \\"The Peel of Justice,\\" the bravest fruit in the whole rainforest."}}
19
- {"input": {"story": "In the town of Maplebrook, there was a library that whispered stories when no one was looking. Curious little Nia tiptoed in one rainy day and heard the books giggling softly. She opened one called The Secret Tunnel, and to her surprise, it sucked her in! She found herself riding a dragon through glittering caves. When she returned, the book winked shut—waiting for its next reader to listen."}}`;
20
- };
21
- //# sourceMappingURL=datasets.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"datasets.js","sourceRoot":"","sources":["../../../../src/utils/examples/templates/datasets.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,gBAAgB,GAAG,GAAW,EAAE;IAC3C,OAAO;;kFAEyE,CAAC;AACnF,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,uBAAuB,GAAG,GAAW,EAAE;IAClD,OAAO;;0FAEiF,CAAC;AAC3F,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,eAAe,GAAG,GAAW,EAAE;IAC1C,OAAO;;gKAEuJ,CAAC;AACjK,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,eAAe,GAAG,GAAW,EAAE;IAC1C,OAAO;;maAE0Z,CAAC;AACpa,CAAC,CAAC"}
@@ -1,2 +0,0 @@
1
- export declare const getEnvFileContent: (_modelProvider: string, apiKey?: string) => string;
2
- //# sourceMappingURL=env.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"env.d.ts","sourceRoot":"","sources":["../../../../src/utils/examples/templates/env.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,iBAAiB,GAC5B,gBAAgB,MAAM,EACtB,SAAQ,MAAW,KAClB,MAWF,CAAC"}
@@ -1,12 +0,0 @@
1
- export const getEnvFileContent = (_modelProvider, apiKey = '') => {
2
- const apiKeyValue = apiKey || 'your_api_key_here';
3
- return `# Cloud deployment: Set these environment variables
4
- # AGENTMARK_BASE_URL=https://api.agentmark.co
5
- # AGENTMARK_API_KEY=your_agentmark_api_key
6
- # AGENTMARK_APP_ID=your_agentmark_app_id
7
- # Learn more: https://docs.agentmark.co/platform/getting_started/quickstart
8
-
9
- OPENAI_API_KEY=${apiKeyValue}
10
- `;
11
- };
12
- //# sourceMappingURL=env.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"env.js","sourceRoot":"","sources":["../../../../src/utils/examples/templates/env.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAC/B,cAAsB,EACtB,SAAiB,EAAE,EACX,EAAE;IACV,MAAM,WAAW,GAAG,MAAM,IAAI,mBAAmB,CAAC;IAElD,OAAO;;;;;;iBAMQ,WAAW;CAC3B,CAAC;AACF,CAAC,CAAC"}
@@ -1,2 +0,0 @@
1
- export declare const createExamplePrompts: (model: string, targetPath?: string, adapter?: string) => void;
2
- //# sourceMappingURL=example-prompts.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"example-prompts.d.ts","sourceRoot":"","sources":["../../../../src/utils/examples/templates/example-prompts.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,oBAAoB,GAAI,OAAO,MAAM,EAAE,aAAY,MAAY,EAAE,UAAS,MAAiB,SA+BvG,CAAC"}
@@ -1,35 +0,0 @@
1
- import fs from 'fs-extra';
2
- import { getAnimalDrawingPrompt } from './animal-drawing-prompt.js';
3
- import { getCustomerSupportPrompt } from './customer-support-prompt.js';
4
- import { getPartyPlannerPrompt } from './party-planner-prompt.js';
5
- import { getStoryTellerPrompt } from './story-teller-prompt.js';
6
- import { getAnimalDataset, getCustomerQueryDataset, getPartyDataset, getStoryDataset } from './datasets.js';
7
- export const createExamplePrompts = (model, targetPath = ".", adapter = "ai-sdk") => {
8
- // Ensure the templates directory exists
9
- fs.ensureDirSync(`${targetPath}/agentmark`);
10
- // Create animal drawing prompt and dataset (skip for mastra adapter)
11
- if (adapter !== "mastra") {
12
- const animalDrawingPrompt = getAnimalDrawingPrompt();
13
- fs.writeFileSync(`${targetPath}/agentmark/animal-drawing.prompt.mdx`, animalDrawingPrompt);
14
- const animalDataset = getAnimalDataset();
15
- fs.writeFileSync(`${targetPath}/agentmark/animal.jsonl`, animalDataset);
16
- }
17
- // Create customer support prompt and dataset
18
- const customerSupportPrompt = getCustomerSupportPrompt(model);
19
- fs.writeFileSync(`${targetPath}/agentmark/customer-support-agent.prompt.mdx`, customerSupportPrompt);
20
- const customerQueryDataset = getCustomerQueryDataset();
21
- fs.writeFileSync(`${targetPath}/agentmark/customer-query.jsonl`, customerQueryDataset);
22
- // Create party planner prompt and dataset
23
- const partyPlannerPrompt = getPartyPlannerPrompt(model);
24
- fs.writeFileSync(`${targetPath}/agentmark/party-planner.prompt.mdx`, partyPlannerPrompt);
25
- const partyDataset = getPartyDataset();
26
- fs.writeFileSync(`${targetPath}/agentmark/party.jsonl`, partyDataset);
27
- // Create story teller prompt and dataset (skip for mastra adapter)
28
- if (adapter !== "mastra") {
29
- const storyTellerPrompt = getStoryTellerPrompt();
30
- fs.writeFileSync(`${targetPath}/agentmark/story-teller.prompt.mdx`, storyTellerPrompt);
31
- const storyDataset = getStoryDataset();
32
- fs.writeFileSync(`${targetPath}/agentmark/story.jsonl`, storyDataset);
33
- }
34
- };
35
- //# sourceMappingURL=example-prompts.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"example-prompts.js","sourceRoot":"","sources":["../../../../src/utils/examples/templates/example-prompts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,UAAU,CAAC;AAC1B,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAC;AACxE,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAClE,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAE5G,MAAM,CAAC,MAAM,oBAAoB,GAA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C,EAAE,CAAC,aAAa,CAAC,GAAG,UAAU,wBAAwB,EAAE,YAAY,CAAC,CAAC;IACxE,CAAC;AACH,CAAC,CAAC"}
@@ -1,13 +0,0 @@
1
- export * from './adapters.js';
2
- export * from './app-index.js';
3
- export * from './env.js';
4
- export * from './package-setup.js';
5
- export * from './tsconfig.js';
6
- export * from './animal-drawing-prompt.js';
7
- export * from './customer-support-prompt.js';
8
- export * from './party-planner-prompt.js';
9
- export * from './story-teller-prompt.js';
10
- export * from './datasets.js';
11
- export * from './example-prompts.js';
12
- export * from './user-client-config.js';
13
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/utils/examples/templates/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AACzB,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC;AAC9B,cAAc,4BAA4B,CAAC;AAC3C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,0BAA0B,CAAC;AACzC,cAAc,eAAe,CAAC;AAC9B,cAAc,sBAAsB,CAAC;AACrC,cAAc,yBAAyB,CAAC"}
@@ -1,13 +0,0 @@
1
- export * from './adapters.js';
2
- export * from './app-index.js';
3
- export * from './env.js';
4
- export * from './package-setup.js';
5
- export * from './tsconfig.js';
6
- export * from './animal-drawing-prompt.js';
7
- export * from './customer-support-prompt.js';
8
- export * from './party-planner-prompt.js';
9
- export * from './story-teller-prompt.js';
10
- export * from './datasets.js';
11
- export * from './example-prompts.js';
12
- export * from './user-client-config.js';
13
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/utils/examples/templates/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AACzB,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC;AAC9B,cAAc,4BAA4B,CAAC;AAC3C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,0BAA0B,CAAC;AACzC,cAAc,eAAe,CAAC;AAC9B,cAAc,sBAAsB,CAAC;AACrC,cAAc,yBAAyB,CAAC"}
@@ -1,3 +0,0 @@
1
- export declare const setupPackageJson: (targetPath?: string) => void;
2
- export declare const installDependencies: (modelProvider: string, targetPath?: string, adapter?: string) => void;
3
- //# sourceMappingURL=package-setup.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"package-setup.d.ts","sourceRoot":"","sources":["../../../../src/utils/examples/templates/package-setup.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,gBAAgB,GAAI,aAAY,MAAY,SA4BxD,CAAC;AAEF,eAAO,MAAM,mBAAmB,GAC9B,eAAe,MAAM,EACrB,aAAY,MAAY,EACxB,UAAS,MAAiB,SAuC3B,CAAC"}
@@ -1,61 +0,0 @@
1
- import fs from "fs-extra";
2
- import { execSync, execFileSync } from "child_process";
3
- import { getAdapterConfig } from "./adapters.js";
4
- export const setupPackageJson = (targetPath = ".") => {
5
- const packageJsonPath = `${targetPath}/package.json`;
6
- if (!fs.existsSync(packageJsonPath)) {
7
- console.log("Creating package.json...");
8
- execSync("npm init -y", { cwd: targetPath });
9
- }
10
- // Update the created package.json with additional information
11
- const pkgJson = fs.readJsonSync(packageJsonPath);
12
- pkgJson.name =
13
- pkgJson.name === "test" || !pkgJson.name
14
- ? "agentmark-example-app"
15
- : pkgJson.name;
16
- pkgJson.description =
17
- pkgJson.description || "A simple Node.js app using the Agentmark SDK";
18
- // All platforms use "agentmark dev" which runs their respective dev-entry.ts
19
- const devScript = "agentmark dev";
20
- pkgJson.scripts = {
21
- ...pkgJson.scripts,
22
- "demo": "npx tsx index.ts",
23
- "dev": devScript,
24
- "prompt": "agentmark run-prompt",
25
- "experiment": "agentmark run-experiment",
26
- };
27
- fs.writeJsonSync(packageJsonPath, pkgJson, { spaces: 2 });
28
- };
29
- export const installDependencies = (modelProvider, targetPath = ".", adapter = "ai-sdk") => {
30
- console.log("Installing required packages...");
31
- console.log("This might take a moment...");
32
- const adapterConfig = getAdapterConfig(adapter);
33
- try {
34
- // Install TypeScript, ts-node, CLI, and other dev dependencies
35
- // CLI needs to be a devDep so dev-entry.ts can import from @agentmark/cli/runner-server
36
- const devDepsCmd = "npm install --save-dev typescript ts-node @types/node @agentmark/cli --legacy-peer-deps";
37
- execSync(devDepsCmd, {
38
- stdio: "inherit",
39
- cwd: targetPath,
40
- });
41
- // Install the common packages
42
- // SDK is required for both local (connects to agentmark serve) and cloud (connects to API)
43
- const installArgs = [
44
- "install",
45
- "dotenv",
46
- "@agentmark/prompt-core",
47
- "@agentmark/sdk",
48
- adapterConfig.package,
49
- `@ai-sdk/${modelProvider}@^2`,
50
- ...adapterConfig.dependencies,
51
- "--legacy-peer-deps",
52
- ];
53
- execFileSync("npm", installArgs, { stdio: "inherit", cwd: targetPath });
54
- console.log("Packages installed successfully!");
55
- }
56
- catch (error) {
57
- console.error("Error installing packages:", error);
58
- throw new Error("Failed to install required packages. Please check your network connection and try again.");
59
- }
60
- };
61
- //# sourceMappingURL=package-setup.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"package-setup.js","sourceRoot":"","sources":["../../../../src/utils/examples/templates/package-setup.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,UAAU,CAAC;AAC1B,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAEjD,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,aAAqB,GAAG,EAAE,EAAE;IAC3D,MAAM,eAAe,GAAG,GAAG,UAAU,eAAe,CAAC;IAErD,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,eAAe,CA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U;SAChB,CAAC,CAAC;QAEH,8BAA8B;QAC9B,2FAA2F;QAC3F,MAAM,WAAW,GAAG;YAClB,SAAS;YACT,QAAQ;YACR,wBAAwB;YACxB,gBAAgB;YAChB,aAAa,CAAC,OAAO;YACrB,WAAW,aAAa,KAAK;YAC7B,GAAG,aAAa,CAAC,YAAY;YAC7B,oBAAoB;SACrB,CAAC;QAEF,YAAY,CAAC,KAAK,EAAE,WAAW,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG,EAAE,UAAU,EAAE,CAAC,CAAC;QAExE,OAAO,CAAC,GAAG,CAAC,kCAAkC,CAAC,CAAC;IAClD,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,4BAA4B,EAAE,KAAK,CAAC,CAAC;QACnD,MAAM,IAAI,KAAK,CACb,0FAA0F,CAC3F,CAAC;IACJ,CAAC;AACH,CAAC,CAAC"}
@@ -1,2 +0,0 @@
1
- export declare const getPartyPlannerPrompt: (model: string) => string;
2
- //# sourceMappingURL=party-planner-prompt.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"party-planner-prompt.d.ts","sourceRoot":"","sources":["../../../../src/utils/examples/templates/party-planner-prompt.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,qBAAqB,GAAI,OAAO,MAAM,KAAG,MAsCrD,CAAC"}
@@ -1,40 +0,0 @@
1
- export const getPartyPlannerPrompt = (model) => {
2
- return `---
3
- name: party-planner
4
- object_config:
5
- model_name: ${model}
6
- schema:
7
- type: object
8
- properties:
9
- names:
10
- type: array
11
- description: "List of names of people attending the party."
12
- items:
13
- type: string
14
- required:
15
- - names
16
- test_settings:
17
- dataset: party.jsonl
18
- evals:
19
- - exact_match_json
20
- props:
21
- party_text: "We're having a party with Alice, Bob, and Carol."
22
- input_schema:
23
- type: object
24
- properties:
25
- party_text:
26
- type: string
27
- description: "A block of text describing the upcoming party and attendees."
28
- required:
29
- - party_text
30
- ---
31
-
32
- <System>
33
- Extract the names of all people attending the party from the following text. Respond with a list of names only.
34
- </System>
35
-
36
- <User>
37
- Text: {props.party_text}
38
- </User>`;
39
- };
40
- //# sourceMappingURL=party-planner-prompt.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"party-planner-prompt.js","sourceRoot":"","sources":["../../../../src/utils/examples/templates/party-planner-prompt.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,KAAa,EAAU,EAAE;IAC7D,OAAO;;;gBAGO,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAiCb,CAAC;AACT,CAAC,CAAC"}
@@ -1,2 +0,0 @@
1
- export declare const getStoryTellerPrompt: () => string;
2
- //# sourceMappingURL=story-teller-prompt.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"story-teller-prompt.d.ts","sourceRoot":"","sources":["../../../../src/utils/examples/templates/story-teller-prompt.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,oBAAoB,QAAO,MAqBvC,CAAC"}
@@ -1,23 +0,0 @@
1
- export const getStoryTellerPrompt = () => {
2
- return `---
3
- name: story-teller
4
- speech_config:
5
- model_name: tts-1-hd
6
- voice: "nova"
7
- speed: 1.0
8
- output_format: "mp3"
9
- test_settings:
10
- dataset: story.jsonl
11
- props:
12
- story: "Once upon a time, there was a cat who loved to play with a ball."
13
- ---
14
-
15
- <System>
16
- You are a storyteller for children. Make sure your story is engaging and interesting.
17
- </System>
18
-
19
- <SpeechPrompt>
20
- - {props.story}
21
- </SpeechPrompt>`;
22
- };
23
- //# sourceMappingURL=story-teller-prompt.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"story-teller-prompt.js","sourceRoot":"","sources":["../../../../src/utils/examples/templates/story-teller-prompt.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,oBAAoB,GAAG,GAAW,EAAE;IAC/C,OAAO;;;;;;;;;;;;;;;;;;;gBAmBO,CAAC;AACjB,CAAC,CAAC"}
@@ -1,2 +0,0 @@
1
- export declare const getTsConfigContent: () => object;
2
- //# sourceMappingURL=tsconfig.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tsconfig.d.ts","sourceRoot":"","sources":["../../../../src/utils/examples/templates/tsconfig.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,kBAAkB,QAAO,MAYrC,CAAC"}
@@ -1,14 +0,0 @@
1
- export const getTsConfigContent = () => {
2
- return {
3
- "compilerOptions": {
4
- "target": "ES2020",
5
- "module": "NodeNext",
6
- "moduleResolution": "NodeNext",
7
- "esModuleInterop": true,
8
- "forceConsistentCasingInFileNames": true,
9
- "strict": true,
10
- "skipLibCheck": true
11
- }
12
- };
13
- };
14
- //# sourceMappingURL=tsconfig.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tsconfig.js","sourceRoot":"","sources":["../../../../src/utils/examples/templates/tsconfig.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,kBAAkB,GAAG,GAAW,EAAE;IAC7C,OAAO;QACL,iBAAiB,EAAE;YACjB,QAAQ,EAAE,QAAQ;YAClB,QAAQ,EAAE,UAAU;YACpB,kBAAkB,EAAE,UAAU;YAC9B,iBAAiB,EAAE,IAAI;YACvB,kCAAkC,EAAE,IAAI;YACxC,QAAQ,EAAE,IAAI;YACd,cAAc,EAAE,IAAI;SACrB;KACF,CAAC;AACJ,CAAC,CAAC"}
@@ -1,6 +0,0 @@
1
- export declare const getClientConfigContent: (options: {
2
- provider: string;
3
- languageModels: string[];
4
- adapter: string;
5
- }) => string;
6
- //# sourceMappingURL=user-client-config.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"user-client-config.d.ts","sourceRoot":"","sources":["../../../../src/utils/examples/templates/user-client-config.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,sBAAsB,GAAI,SAAS;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,cAAc,EAAE,MAAM,EAAE,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,WAqF9G,CAAC"}
@@ -1,85 +0,0 @@
1
- import { getAdapterConfig } from "./adapters.js";
2
- export const getClientConfigContent = (options) => {
3
- const { provider, languageModels, adapter } = options;
4
- const adapterConfig = getAdapterConfig(adapter);
5
- const { modelRegistry, toolRegistry } = adapterConfig.classes;
6
- const providerImport = `import { ${provider} } from '@ai-sdk/${provider}';`;
7
- const extraModelRegs = provider === 'openai'
8
- ? `.registerModels(["dall-e-3"], (name: string) => ${provider}.image(name))
9
- .registerModels(["tts-1-hd"], (name: string) => ${provider}.speech(name))`
10
- : '';
11
- return `// agentmark.client.ts
12
- import path from 'node:path';
13
- import dotenv from 'dotenv';
14
- dotenv.config({ path: path.resolve(__dirname, '.env') });
15
- import { createAgentMarkClient, ${modelRegistry}, ${toolRegistry}, EvalRegistry } from "${adapterConfig.package}";
16
- import { AgentMarkSDK } from "@agentmark/sdk";
17
- import AgentMarkTypes, { Tools } from './agentmark.types';
18
- ${providerImport}
19
-
20
- function createModelRegistry() {
21
- const modelRegistry = new ${modelRegistry}()
22
- .registerModels(${JSON.stringify(languageModels)}, (name: string) => ${provider}(name))
23
- ${extraModelRegs};
24
- return modelRegistry;
25
- }
26
-
27
- function createToolRegistry() {
28
- const toolRegistry = new ${toolRegistry}<Tools>()
29
- .register('search_knowledgebase', async ({ query }) => {
30
- // Simulate search delay
31
- await new Promise(resolve => setTimeout(resolve, 500));
32
-
33
- // Return all three knowledge base articles
34
- // The LLM will select the relevant one based on the query
35
- return {
36
- articles: [
37
- { topic: 'shipping', content: 'Standard shipping takes 3–5 business days.' },
38
- { topic: 'warranty', content: 'All products include a 1-year limited warranty.' },
39
- { topic: 'returns', content: 'You can return items within 30 days of delivery.' }
40
- ]
41
- };
42
- });
43
- return toolRegistry;
44
- }
45
-
46
- function createEvalRegistry() {
47
- const evalRegistry = new EvalRegistry()
48
- .register('exact_match_json', ({ output, expectedOutput }) => {
49
- if (!expectedOutput) {
50
- return { score: 0, label: 'error', reason: 'No expected output provided', passed: false };
51
- }
52
- try {
53
- const ok = JSON.stringify(output) === JSON.stringify(JSON.parse(expectedOutput));
54
- return {
55
- score: ok ? 1 : 0,
56
- label: ok ? 'correct' : 'incorrect',
57
- reason: ok ? 'Exact match' : 'Mismatch',
58
- passed: ok
59
- };
60
- } catch (e) {
61
- return { score: 0, label: 'error', reason: 'Failed to parse expected output as JSON', passed: false };
62
- }
63
- });
64
- return evalRegistry;
65
- }
66
-
67
- function createClient(ctx?: { env?: Record<string,string|undefined> }) {
68
- const env = (ctx?.env ?? process.env) as Record<string, string | undefined>;
69
- // For local development, connect to the local agentmark serve instance (default: http://localhost:9418)
70
- // For cloud deployment, set AGENTMARK_BASE_URL, AGENTMARK_API_KEY, and AGENTMARK_APP_ID
71
- const baseUrl = env.AGENTMARK_BASE_URL || 'http://localhost:9418';
72
- const apiKey = env.AGENTMARK_API_KEY || '';
73
- const appId = env.AGENTMARK_APP_ID || '';
74
- const sdk = new AgentMarkSDK({ apiKey, appId, baseUrl });
75
- const fileLoader = sdk.getFileLoader();
76
- const modelRegistry = createModelRegistry();
77
- const toolRegistry = createToolRegistry();
78
- const evalRegistry = createEvalRegistry();
79
- return createAgentMarkClient<AgentMarkTypes, typeof toolRegistry>({ loader: fileLoader, modelRegistry, toolRegistry, evalRegistry });
80
- }
81
-
82
- export const client = createClient();
83
- `;
84
- };
85
- //# sourceMappingURL=user-client-config.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"user-client-config.js","sourceRoot":"","sources":["../../../../src/utils/examples/templates/user-client-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAEjD,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,OAAwE,EAAE,EAAE;IACjH,MAAM,EAAE,QAAQ,EAAE,cAAc,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC;IACtD,MAAM,aAAa,GAAG,gBAAgB,CAAC,OAAO,CAAC,CAAC;IAChD,MAAM,EAAE,aAAa,EAAE,YAAY,EAAE,GAAG,aAAa,CAAC,OAAO,CAAC;IAE9D,MAAM,cAAc,GAAG,YAAY,QAAQ,oBAAoB,QAAQ,IAAI,CAAC;IAE5E,MAAM,cAAc,GAAG,QAAQ,KAAK,QAAQ;QAC1C,CAAC,CAAC,mDAAmD,QAAQ;sDACX,QAAQ,gBAAgB;QAC1E,CAAC,CAAC,EAAE,CAAC;IAEP,OAAO;;;;kCAIyB,aAAa,KAAK,YAAY,0BAA0B,aAAa,CAAC,OAAO;;;EAG7G,cAAc;;;8BAGc,aAAa;sBACrB,IAAI,CAAC,SAAS,CAAC,cAAc,CAAC,uBAAuB,QAAQ;MAC7E,cAAc;;;;;6BAKS,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuDxC,CAAC;AACF,CAAC,CAAC"}
@@ -1,9 +0,0 @@
1
- export declare const Providers: {
2
- openai: {
3
- label: string;
4
- languageModels: string[];
5
- imageModels: string[];
6
- speechModels: string[];
7
- };
8
- };
9
- //# sourceMappingURL=providers.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"providers.d.ts","sourceRoot":"","sources":["../../src/utils/providers.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,SAAS;;;;;;;CAcrB,CAAC"}
@@ -1,16 +0,0 @@
1
- export const Providers = {
2
- openai: {
3
- label: "OpenAI",
4
- languageModels: [
5
- "gpt-4o",
6
- "gpt-4o-mini",
7
- "gpt-4",
8
- "gpt-5",
9
- "gpt-4-turbo",
10
- "gpt-3.5-turbo",
11
- ],
12
- imageModels: ["dall-e-3", "dall-e-2"],
13
- speechModels: ["tts-1", "tts-1-hd"],
14
- },
15
- };
16
- //# sourceMappingURL=providers.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"providers.js","sourceRoot":"","sources":["../../src/utils/providers.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,MAAM,EAAE;QACN,KAAK,EAAE,QAAQ;QACf,cAAc,EAAE;YACd,QAAQ;YACR,aAAa;YACb,OAAO;YACP,OAAO;YACP,aAAa;YACb,eAAe;SAChB;QACD,WAAW,EAAE,CAAC,UAAU,EAAE,UAAU,CAAC;QACrC,YAAY,EAAE,CAAC,OAAO,EAAE,UAAU,CAAC;KACpC;CACF,CAAC"}