create-agentmark 0.2.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 (64) 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 -57
  6. package/dist/index.js.map +1 -1
  7. package/package.json +4 -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 -214
  12. package/dist/utils/examples/create-example-app.js.map +0 -1
  13. package/dist/utils/examples/templates/animal-drawing-prompt.d.ts +0 -2
  14. package/dist/utils/examples/templates/animal-drawing-prompt.d.ts.map +0 -1
  15. package/dist/utils/examples/templates/animal-drawing-prompt.js +0 -19
  16. package/dist/utils/examples/templates/animal-drawing-prompt.js.map +0 -1
  17. package/dist/utils/examples/templates/app-index.d.ts +0 -2
  18. package/dist/utils/examples/templates/app-index.d.ts.map +0 -1
  19. package/dist/utils/examples/templates/app-index.js +0 -95
  20. package/dist/utils/examples/templates/app-index.js.map +0 -1
  21. package/dist/utils/examples/templates/customer-support-prompt.d.ts +0 -2
  22. package/dist/utils/examples/templates/customer-support-prompt.d.ts.map +0 -1
  23. package/dist/utils/examples/templates/customer-support-prompt.js +0 -40
  24. package/dist/utils/examples/templates/customer-support-prompt.js.map +0 -1
  25. package/dist/utils/examples/templates/datasets.d.ts +0 -5
  26. package/dist/utils/examples/templates/datasets.d.ts.map +0 -1
  27. package/dist/utils/examples/templates/datasets.js +0 -21
  28. package/dist/utils/examples/templates/datasets.js.map +0 -1
  29. package/dist/utils/examples/templates/env.d.ts +0 -2
  30. package/dist/utils/examples/templates/env.d.ts.map +0 -1
  31. package/dist/utils/examples/templates/env.js +0 -30
  32. package/dist/utils/examples/templates/env.js.map +0 -1
  33. package/dist/utils/examples/templates/example-prompts.d.ts +0 -2
  34. package/dist/utils/examples/templates/example-prompts.d.ts.map +0 -1
  35. package/dist/utils/examples/templates/example-prompts.js +0 -35
  36. package/dist/utils/examples/templates/example-prompts.js.map +0 -1
  37. package/dist/utils/examples/templates/index.d.ts +0 -12
  38. package/dist/utils/examples/templates/index.d.ts.map +0 -1
  39. package/dist/utils/examples/templates/index.js +0 -12
  40. package/dist/utils/examples/templates/index.js.map +0 -1
  41. package/dist/utils/examples/templates/package-setup.d.ts +0 -3
  42. package/dist/utils/examples/templates/package-setup.d.ts.map +0 -1
  43. package/dist/utils/examples/templates/package-setup.js +0 -63
  44. package/dist/utils/examples/templates/package-setup.js.map +0 -1
  45. package/dist/utils/examples/templates/party-planner-prompt.d.ts +0 -2
  46. package/dist/utils/examples/templates/party-planner-prompt.d.ts.map +0 -1
  47. package/dist/utils/examples/templates/party-planner-prompt.js +0 -40
  48. package/dist/utils/examples/templates/party-planner-prompt.js.map +0 -1
  49. package/dist/utils/examples/templates/story-teller-prompt.d.ts +0 -2
  50. package/dist/utils/examples/templates/story-teller-prompt.d.ts.map +0 -1
  51. package/dist/utils/examples/templates/story-teller-prompt.js +0 -23
  52. package/dist/utils/examples/templates/story-teller-prompt.js.map +0 -1
  53. package/dist/utils/examples/templates/tsconfig.d.ts +0 -2
  54. package/dist/utils/examples/templates/tsconfig.d.ts.map +0 -1
  55. package/dist/utils/examples/templates/tsconfig.js +0 -14
  56. package/dist/utils/examples/templates/tsconfig.js.map +0 -1
  57. package/dist/utils/examples/templates/user-client-config.d.ts +0 -6
  58. package/dist/utils/examples/templates/user-client-config.d.ts.map +0 -1
  59. package/dist/utils/examples/templates/user-client-config.js +0 -163
  60. package/dist/utils/examples/templates/user-client-config.js.map +0 -1
  61. package/dist/utils/providers.d.ts +0 -9
  62. package/dist/utils/providers.d.ts.map +0 -1
  63. package/dist/utils/providers.js +0 -16
  64. package/dist/utils/providers.js.map +0 -1
@@ -1,30 +0,0 @@
1
- // Map providers to their correct environment variable names
2
- const providerApiKeyMap = {
3
- openai: "OPENAI_API_KEY",
4
- anthropic: "ANTHROPIC_API_KEY",
5
- google: "GOOGLE_GENERATIVE_AI_API_KEY",
6
- groq: "GROQ_API_KEY",
7
- xai: "XAI_API_KEY",
8
- ollama: "" // Ollama doesn't need an API key for local usage
9
- };
10
- export const getEnvFileContent = (modelProvider, apiKey = '') => {
11
- const envVarName = providerApiKeyMap[modelProvider] || `${modelProvider.toUpperCase()}_API_KEY`;
12
- const apiKeyValue = apiKey || 'your_api_key_here';
13
- // Ollama doesn't need an API key for local usage
14
- const needsApiKey = modelProvider !== 'ollama';
15
- let content = `# Cloud deployment: Set these environment variables
16
- # AGENTMARK_BASE_URL=https://api.agentmark.co
17
- # AGENTMARK_API_KEY=your_agentmark_api_key
18
- # AGENTMARK_APP_ID=your_agentmark_app_id
19
- # Learn more: https://docs.agentmark.co/platform/getting_started/quickstart
20
-
21
- `;
22
- if (needsApiKey) {
23
- content += `${envVarName}=${apiKeyValue}\n`;
24
- }
25
- else {
26
- content += `# No API key needed for ${modelProvider}\n`;
27
- }
28
- return content;
29
- };
30
- //# sourceMappingURL=env.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"env.js","sourceRoot":"","sources":["../../../../src/utils/examples/templates/env.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,MAAM,iBAAiB,GAA2B;IAChD,MAAM,EAAE,gBAAgB;IACxB,SAAS,EAAE,mBAAmB;IAC9B,MAAM,EAAE,8BAA8B;IACtC,IAAI,EAAE,cAAc;IACpB,GAAG,EAAE,aAAa;IAClB,MAAM,EAAE,EAAE,CAAC,iDAAiD;CAC7D,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAC/B,aAAqB,EACrB,SAAiB,EAAE,EACX,EAAE;IACV,MAAM,UAAU,GAAG,iBAAiB,CAAC,aAAa,CAAC,IAAI,GAAG,aAAa,CAAC,WAAW,EAAE,UAAU,CAAC;IAChG,MAAM,WAAW,GAAG,MAAM,IAAI,mBAAmB,CAAC;IAElD,iDAAiD;IACjD,MAAM,WAAW,GAAG,aAAa,KAAK,QAAQ,CAAC;IAE/C,IAAI,OAAO,GAAG;;;;;;CAMf,CAAC;IAEA,IAAI,WAAW,EAAE,CAAC;QAChB,OAAO,IAAI,GAAG,UAAU,IAAI,WAAW,IAAI,CAAC;IAC9C,CAAC;SAAM,CAAC;QACN,OAAO,IAAI,2BAA2B,aAAa,IAAI,CAAC;IAC1D,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,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,GAAG,CAAC,KAAa,EAAE,aAAqB,GAAG,EAAE,UAAkB,QAAQ,EAAE,EAAE;IA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C;IACxE,CAAC;AACH,CAAC,CAAC"}
@@ -1,12 +0,0 @@
1
- export * from './app-index.js';
2
- export * from './env.js';
3
- export * from './package-setup.js';
4
- export * from './tsconfig.js';
5
- export * from './animal-drawing-prompt.js';
6
- export * from './customer-support-prompt.js';
7
- export * from './party-planner-prompt.js';
8
- export * from './story-teller-prompt.js';
9
- export * from './datasets.js';
10
- export * from './example-prompts.js';
11
- export * from './user-client-config.js';
12
- //# 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,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,12 +0,0 @@
1
- export * from './app-index.js';
2
- export * from './env.js';
3
- export * from './package-setup.js';
4
- export * from './tsconfig.js';
5
- export * from './animal-drawing-prompt.js';
6
- export * from './customer-support-prompt.js';
7
- export * from './party-planner-prompt.js';
8
- export * from './story-teller-prompt.js';
9
- export * from './datasets.js';
10
- export * from './example-prompts.js';
11
- export * from './user-client-config.js';
12
- //# 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,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":"AAGA,eAAO,MAAM,gBAAgB,GAAI,aAAY,MAAY,SAyBxD,CAAC;AAEF,eAAO,MAAM,mBAAmB,GAC9B,eAAe,MAAM,EACrB,aAAY,MAAY,EACxB,UAAS,MAAiB,SAoD3B,CAAC"}
@@ -1,63 +0,0 @@
1
- import fs from "fs-extra";
2
- import { execSync, execFileSync } from "child_process";
3
- export const setupPackageJson = (targetPath = ".") => {
4
- const packageJsonPath = `${targetPath}/package.json`;
5
- if (!fs.existsSync(packageJsonPath)) {
6
- console.log("Creating package.json...");
7
- execSync("npm init -y", { cwd: targetPath });
8
- }
9
- // Update the created package.json with additional information
10
- const pkgJson = fs.readJsonSync(packageJsonPath);
11
- pkgJson.name =
12
- pkgJson.name === "test" || !pkgJson.name
13
- ? "agentmark-example-app"
14
- : pkgJson.name;
15
- pkgJson.description =
16
- pkgJson.description || "A simple Node.js app using the Agentmark SDK";
17
- pkgJson.scripts = {
18
- ...pkgJson.scripts,
19
- "demo": "npx tsx index.ts",
20
- "dev": "agentmark dev",
21
- "prompt": "agentmark run-prompt",
22
- "experiment": "agentmark run-experiment",
23
- };
24
- fs.writeJsonSync(packageJsonPath, pkgJson, { spaces: 2 });
25
- };
26
- export const installDependencies = (modelProvider, targetPath = ".", adapter = "ai-sdk") => {
27
- console.log("Installing required packages...");
28
- console.log("This might take a moment...");
29
- try {
30
- // Install TypeScript, ts-node, CLI, and other dev dependencies
31
- // CLI needs to be a devDep so dev-entry.ts can import from @agentmark/cli/runner-server
32
- execSync("npm install --save-dev typescript ts-node @types/node @agentmark/cli", {
33
- stdio: "inherit",
34
- cwd: targetPath,
35
- });
36
- // Install the common packages
37
- // SDK is required for both local (connects to agentmark serve) and cloud (connects to API)
38
- const installArgs = [
39
- "install",
40
- "dotenv",
41
- "@agentmark/prompt-core",
42
- "@agentmark/sdk",
43
- ];
44
- // Install adapter-specific packages
45
- if (adapter === "mastra") {
46
- const providerPackage = `@ai-sdk/${modelProvider}`;
47
- installArgs.push("@agentmark/mastra-v0-adapter", "@mastra/core@<0.20.0", "@mastra/mcp@<0.13.4", providerPackage);
48
- }
49
- else {
50
- // Use different package names for different providers
51
- // Pin required major versions: ai@v5, @ai-sdk/<provider>@v2
52
- const providerPackage = `@ai-sdk/${modelProvider}@^2`;
53
- installArgs.push("@agentmark/ai-sdk-v5-adapter", providerPackage, "ai@^5");
54
- }
55
- execFileSync("npm", installArgs, { stdio: "inherit", cwd: targetPath });
56
- console.log("Packages installed successfully!");
57
- }
58
- catch (error) {
59
- console.error("Error installing packages:", error);
60
- throw new Error("Failed to install required packages. Please check your network connection and try again.");
61
- }
62
- };
63
- //# 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;AAEvD,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,CAAC,EAAE,CAAC;QACpC,OAAO,CAAC,GAAG,CAAC,0BAA0B,CAAC,CAAC;QACxC,QAAQ,CAAC,aAAa,EAAE,EAAE,GAAG,EAAE,UAAU,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I,CACd,8BAA8B,EAC9B,sBAAsB,EACtB,qBAAqB,EACrB,eAAe,CAChB,CAAC;QACJ,CAAC;aAAM,CAAC;YACN,sDAAsD;YACtD,4DAA4D;YAC5D,MAAM,eAAe,GAAG,WAAW,aAAa,KAAK,CAAC;YACtD,WAAW,CAAC,IAAI,CACd,8BAA8B,EAC9B,eAAe,EACf,OAAO,CACR,CAAC;QACJ,CAAC;QAED,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":"AAAA,eAAO,MAAM,sBAAsB,GAAI,SAAS;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,cAAc,EAAE,MAAM,EAAE,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,WAmK9G,CAAC"}
@@ -1,163 +0,0 @@
1
- export const getClientConfigContent = (options) => {
2
- const { provider, languageModels, adapter } = options;
3
- if (adapter === "mastra") {
4
- const providerImport = provider === 'ollama'
5
- ? "import { ollama } from 'ollama-ai-provider';"
6
- : `import { ${provider} } from '@ai-sdk/${provider}';`;
7
- return `// agentmark.client.ts
8
- import path from 'node:path';
9
- import dotenv from 'dotenv';
10
- dotenv.config({ path: path.resolve(__dirname, '.env') });
11
- import { createAgentMarkClient, MastraModelRegistry, MastraToolRegistry, EvalRegistry } from "@agentmark/mastra-v0-adapter";
12
- import { AgentMarkSDK } from "@agentmark/sdk";
13
- import AgentMarkTypes, { Tools } from './agentmark.types';
14
- ${providerImport}
15
-
16
- function createModelRegistry() {
17
- const modelRegistry = new MastraModelRegistry();
18
- modelRegistry.registerModels(${JSON.stringify(languageModels)}, (name: string) => ${provider}(name));
19
- return modelRegistry;
20
- }
21
-
22
- function createToolRegistry() {
23
- const toolRegistry = new MastraToolRegistry<Tools>()
24
- .register('search_knowledgebase', async ({ query }) => {
25
- // Simulate search delay
26
- await new Promise(resolve => setTimeout(resolve, 500));
27
-
28
- // Return all three knowledge base articles
29
- // The LLM will select the relevant one based on the query
30
- return {
31
- articles: [
32
- { topic: 'shipping', content: 'Standard shipping takes 3–5 business days.' },
33
- { topic: 'warranty', content: 'All products include a 1-year limited warranty.' },
34
- { topic: 'returns', content: 'You can return items within 30 days of delivery.' }
35
- ]
36
- };
37
- });
38
- return toolRegistry;
39
- }
40
-
41
- function createEvalRegistry() {
42
- const evalRegistry = new EvalRegistry()
43
- .register('exact_match_json', ({ output, expectedOutput }) => {
44
- if (!expectedOutput) {
45
- return { score: 0, label: 'error', reason: 'No expected output provided', passed: false };
46
- }
47
- try {
48
- const ok = JSON.stringify(output) === JSON.stringify(JSON.parse(expectedOutput));
49
- return {
50
- score: ok ? 1 : 0,
51
- label: ok ? 'correct' : 'incorrect',
52
- reason: ok ? 'Exact match' : 'Mismatch',
53
- passed: ok
54
- };
55
- } catch (e) {
56
- return { score: 0, label: 'error', reason: 'Failed to parse expected output as JSON', passed: false };
57
- }
58
- });
59
- return evalRegistry;
60
- }
61
-
62
- function createClient(ctx?: { env?: Record<string,string|undefined> }) {
63
- const env = (ctx?.env ?? process.env) as Record<string, string | undefined>;
64
- // For local development, connect to the local agentmark serve instance (default: http://localhost:9418)
65
- // For cloud deployment, set AGENTMARK_BASE_URL, AGENTMARK_API_KEY, and AGENTMARK_APP_ID
66
- const baseUrl = env.AGENTMARK_BASE_URL || 'http://localhost:9418';
67
- const apiKey = env.AGENTMARK_API_KEY || '';
68
- const appId = env.AGENTMARK_APP_ID || '';
69
- const sdk = new AgentMarkSDK({ apiKey, appId, baseUrl });
70
- const fileLoader = sdk.getFileLoader();
71
- const modelRegistry = createModelRegistry();
72
- const toolRegistry = createToolRegistry();
73
- const evalRegistry = createEvalRegistry();
74
- return createAgentMarkClient<AgentMarkTypes, typeof toolRegistry>({ loader: fileLoader, modelRegistry, toolRegistry, evalRegistry });
75
- }
76
-
77
- export const client = createClient();
78
- `;
79
- }
80
- else {
81
- const providerImport = provider === 'ollama'
82
- ? "import { ollama } from 'ollama-ai-provider';"
83
- : `import { ${provider} } from '@ai-sdk/${provider}';`;
84
- const extraModelRegs = provider === 'openai'
85
- ? `.registerModels(["dall-e-3"], (name: string) => ${provider}.image(name))
86
- .registerModels(["tts-1-hd"], (name: string) => ${provider}.speech(name))`
87
- : '';
88
- return `// agentmark.client.ts
89
- import path from 'node:path';
90
- import dotenv from 'dotenv';
91
- dotenv.config({ path: path.resolve(__dirname, '.env') });
92
- import { createAgentMarkClient, VercelAIModelRegistry, VercelAIToolRegistry, EvalRegistry } from "@agentmark/ai-sdk-v5-adapter";
93
- import { AgentMarkSDK } from "@agentmark/sdk";
94
- import AgentMarkTypes, { Tools } from './agentmark.types';
95
- ${providerImport}
96
-
97
- function createModelRegistry() {
98
- const modelRegistry = new VercelAIModelRegistry()
99
- .registerModels(${JSON.stringify(languageModels)}, (name: string) => ${provider}(name))
100
- ${extraModelRegs};
101
- return modelRegistry;
102
- }
103
-
104
- function createToolRegistry() {
105
- const toolRegistry = new VercelAIToolRegistry<Tools>()
106
- .register('search_knowledgebase', async ({ query }) => {
107
- // Simulate search delay
108
- await new Promise(resolve => setTimeout(resolve, 500));
109
-
110
- // Return all three knowledge base articles
111
- // The LLM will select the relevant one based on the query
112
- return {
113
- articles: [
114
- { topic: 'shipping', content: 'Standard shipping takes 3–5 business days.' },
115
- { topic: 'warranty', content: 'All products include a 1-year limited warranty.' },
116
- { topic: 'returns', content: 'You can return items within 30 days of delivery.' }
117
- ]
118
- };
119
- });
120
- return toolRegistry;
121
- }
122
-
123
- function createEvalRegistry() {
124
- const evalRegistry = new EvalRegistry()
125
- .register('exact_match_json', ({ output, expectedOutput }) => {
126
- if (!expectedOutput) {
127
- return { score: 0, label: 'error', reason: 'No expected output provided', passed: false };
128
- }
129
- try {
130
- const ok = JSON.stringify(output) === JSON.stringify(JSON.parse(expectedOutput));
131
- return {
132
- score: ok ? 1 : 0,
133
- label: ok ? 'correct' : 'incorrect',
134
- reason: ok ? 'Exact match' : 'Mismatch',
135
- passed: ok
136
- };
137
- } catch (e) {
138
- return { score: 0, label: 'error', reason: 'Failed to parse expected output as JSON', passed: false };
139
- }
140
- });
141
- return evalRegistry;
142
- }
143
-
144
- function createClient(ctx?: { env?: Record<string,string|undefined> }) {
145
- const env = (ctx?.env ?? process.env) as Record<string, string | undefined>;
146
- // For local development, connect to the local agentmark serve instance (default: http://localhost:9418)
147
- // For cloud deployment, set AGENTMARK_BASE_URL, AGENTMARK_API_KEY, and AGENTMARK_APP_ID
148
- const baseUrl = env.AGENTMARK_BASE_URL || 'http://localhost:9418';
149
- const apiKey = env.AGENTMARK_API_KEY || '';
150
- const appId = env.AGENTMARK_APP_ID || '';
151
- const sdk = new AgentMarkSDK({ apiKey, appId, baseUrl });
152
- const fileLoader = sdk.getFileLoader();
153
- const modelRegistry = createModelRegistry();
154
- const toolRegistry = createToolRegistry();
155
- const evalRegistry = createEvalRegistry();
156
- return createAgentMarkClient<AgentMarkTypes, typeof toolRegistry>({ loader: fileLoader, modelRegistry, toolRegistry, evalRegistry });
157
- }
158
-
159
- export const client = createClient();
160
- `;
161
- }
162
- };
163
- //# 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,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,OAAwE,EAAE,EAAE;IACjH,MAAM,EAAE,QAAQ,EAAE,cAAc,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC;IAEtD,IAAI,OAAO,KAAK,QAAQ,EAAE,CAAC;QACzB,MAAM,cAAc,GAAG,QAAQ,KAAK,QAAQ;YAC1C,CAAC,CAAC,8CAA8C;YAChD,CAAC,CAAC,YAAY,QAAQ,oBAAoB,QAAQ,IAAI,CAAC;QAEzD,OAAO;;;;;;;EAOT,cAAc;;;;iCAIiB,IAAI,CAAC,SAAS,CAAC,cAAc,CAAC,uBAAuB,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4D7F,CAAC;IACA,CAAC;SAAM,CAAC;QACN,MAAM,cAAc,GAAG,QAAQ,KAAK,QAAQ;YAC1C,CAAC,CAAC,8CAA8C;YAChD,CAAC,CAAC,YAAY,QAAQ,oBAAoB,QAAQ,IAAI,CAAC;QACzD,MAAM,cAAc,GAAG,QAAQ,KAAK,QAAQ;YAC1C,CAAC,CAAC,mDAAmD,QAAQ;sDACb,QAAQ,gBAAgB;YACxE,CAAC,CAAC,EAAE,CAAC;QAEP,OAAO;;;;;;;EAOT,cAAc;;;;sBAIM,IAAI,CAAC,SAAS,CAAC,cAAc,CAAC,uBAAuB,QAAQ;MAC7E,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4DnB,CAAC;IACA,CAAC;AACH,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"}