@standardagents/builder 0.11.0-next.c3b4490 → 0.11.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.
- package/dist/built-in-routes.js +158 -8
- package/dist/built-in-routes.js.map +1 -1
- package/dist/index.d.ts +28 -19
- package/dist/index.js +164 -14
- package/dist/index.js.map +1 -1
- package/dist/plugin.js +6 -6
- package/dist/plugin.js.map +1 -1
- package/package.json +4 -4
package/dist/plugin.js
CHANGED
|
@@ -61,18 +61,18 @@ function generateTypesContent(config) {
|
|
|
61
61
|
return `// Auto-generated by @standardagents/builder - DO NOT EDIT
|
|
62
62
|
// Generated at: ${(/* @__PURE__ */ new Date()).toISOString()}
|
|
63
63
|
//
|
|
64
|
-
// This file augments the
|
|
64
|
+
// This file augments the StandardAgentSpec namespace declared in @standardagents/spec
|
|
65
65
|
// to provide type-safe references for your models, prompts, agents, and tools.
|
|
66
66
|
|
|
67
67
|
/**
|
|
68
|
-
* Augment the global
|
|
68
|
+
* Augment the global StandardAgentSpec namespace with your project's specific types.
|
|
69
69
|
* This provides autocomplete and type checking for model, prompt, agent, and tool references.
|
|
70
70
|
*
|
|
71
71
|
* Uses interface declaration merging with property keys to create union types.
|
|
72
72
|
* Example: interface ModelRegistry { 'gpt-4o': true; } gives type Models = 'gpt-4o'
|
|
73
73
|
*/
|
|
74
74
|
declare global {
|
|
75
|
-
namespace
|
|
75
|
+
namespace StandardAgentSpec {
|
|
76
76
|
/** Model names from agents/models/ */
|
|
77
77
|
interface ModelRegistry {
|
|
78
78
|
${generateRegistryProperties(models)}
|
|
@@ -660,7 +660,7 @@ function parseModelFile(content) {
|
|
|
660
660
|
function generateModelFile(data, options) {
|
|
661
661
|
const { providerName, providerPackage } = options;
|
|
662
662
|
const lines = [
|
|
663
|
-
`import { defineModel } from '@standardagents/
|
|
663
|
+
`import { defineModel } from '@standardagents/spec';`,
|
|
664
664
|
`import { ${providerName} } from '${providerPackage}';`,
|
|
665
665
|
"",
|
|
666
666
|
`export default defineModel({`,
|
|
@@ -894,7 +894,7 @@ function isEmptySchema(schema) {
|
|
|
894
894
|
// src/sdk/generators/generatePromptFile.ts
|
|
895
895
|
function generatePromptFile(data) {
|
|
896
896
|
const hasSchema = data.requiredSchema && !isEmptySchema(data.requiredSchema);
|
|
897
|
-
const lines = [`import { definePrompt } from '@standardagents/
|
|
897
|
+
const lines = [`import { definePrompt } from '@standardagents/spec';`];
|
|
898
898
|
if (hasSchema) {
|
|
899
899
|
lines.push(`import { z } from 'zod';`);
|
|
900
900
|
}
|
|
@@ -1084,7 +1084,7 @@ function normalizePart(part) {
|
|
|
1084
1084
|
// src/sdk/generators/generateAgentFile.ts
|
|
1085
1085
|
function generateAgentFile(data) {
|
|
1086
1086
|
const lines = [
|
|
1087
|
-
`import { defineAgent } from '@standardagents/
|
|
1087
|
+
`import { defineAgent } from '@standardagents/spec';`,
|
|
1088
1088
|
"",
|
|
1089
1089
|
`export default defineAgent({`,
|
|
1090
1090
|
` name: '${escapeString3(data.name)}',`
|