@standardagents/builder 0.11.0-next.c3b4490 → 0.11.0

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/index.d.ts CHANGED
@@ -13,63 +13,71 @@ import 'vite';
13
13
  * Types are automatically populated when you run `pnpm dev` or `pnpm build`,
14
14
  * which scans your `agentbuilder/` directories and generates types.
15
15
  *
16
- * The generated types are placed in `.agentbuilder/types.d.ts` and augment this namespace.
16
+ * The generated types are placed in `.agents/types.d.ts` and augment the
17
+ * StandardAgentSpec namespace from @standardagents/spec.
17
18
  *
18
- * Note: We use interfaces as type registries because TypeScript allows interface
19
- * declaration merging. The user's generated types will add properties to these
20
- * interfaces, and we extract the union of all property keys.
19
+ * Note: This namespace is provided for backward compatibility. New code should
20
+ * use StandardAgentSpec types directly, which are defined in @standardagents/spec.
21
+ *
22
+ * @deprecated Use StandardAgentSpec namespace from @standardagents/spec instead
21
23
  */
22
24
  declare global {
23
25
  namespace AgentBuilder {
24
26
  /**
25
27
  * Interface for model type registration.
26
- * Generated types add properties: interface ModelRegistry { 'gpt-4o': true; 'claude-3': true; }
27
- * This gives us: type Models = keyof ModelRegistry = 'gpt-4o' | 'claude-3'
28
+ * @deprecated Use StandardAgentSpec.ModelRegistry instead
28
29
  */
29
- interface ModelRegistry {
30
+ interface ModelRegistry extends StandardAgentSpec.ModelRegistry {
30
31
  }
31
32
  /**
32
33
  * Interface for prompt type registration.
34
+ * @deprecated Use StandardAgentSpec.PromptRegistry instead
33
35
  */
34
- interface PromptRegistry {
36
+ interface PromptRegistry extends StandardAgentSpec.PromptRegistry {
35
37
  }
36
38
  /**
37
39
  * Interface for agent type registration.
40
+ * @deprecated Use StandardAgentSpec.AgentRegistry instead
38
41
  */
39
- interface AgentRegistry {
42
+ interface AgentRegistry extends StandardAgentSpec.AgentRegistry {
40
43
  }
41
44
  /**
42
45
  * Interface for tool type registration.
46
+ * @deprecated Use StandardAgentSpec.ToolRegistry instead
43
47
  */
44
- interface ToolRegistry {
48
+ interface ToolRegistry extends StandardAgentSpec.ToolRegistry {
45
49
  }
46
50
  /**
47
51
  * Interface for callable type registration (prompts, agents, tools).
52
+ * @deprecated Use StandardAgentSpec.CallableRegistry instead
48
53
  */
49
- interface CallableRegistry {
54
+ interface CallableRegistry extends StandardAgentSpec.CallableRegistry {
50
55
  }
51
56
  /**
52
57
  * Union type of all model names defined in agentbuilder/models/.
53
- * When ModelRegistry is empty, this defaults to string for flexibility.
54
- * When populated, it narrows to the specific model names.
58
+ * @deprecated Use StandardAgentSpec.Models instead
55
59
  */
56
- type Models = keyof ModelRegistry extends never ? string : keyof ModelRegistry;
60
+ type Models = StandardAgentSpec.Models;
57
61
  /**
58
62
  * Union type of all prompt names defined in agentbuilder/prompts/.
63
+ * @deprecated Use StandardAgentSpec.Prompts instead
59
64
  */
60
- type Prompts = keyof PromptRegistry extends never ? string : keyof PromptRegistry;
65
+ type Prompts = StandardAgentSpec.Prompts;
61
66
  /**
62
67
  * Union type of all agent names defined in agentbuilder/agents/.
68
+ * @deprecated Use StandardAgentSpec.Agents instead
63
69
  */
64
- type Agents = keyof AgentRegistry extends never ? string : keyof AgentRegistry;
70
+ type Agents = StandardAgentSpec.Agents;
65
71
  /**
66
72
  * Union type of all tool names defined in agentbuilder/tools/.
73
+ * @deprecated Use StandardAgentSpec.Tools instead
67
74
  */
68
- type Tools = keyof ToolRegistry extends never ? string : keyof ToolRegistry;
75
+ type Tools = StandardAgentSpec.Tools;
69
76
  /**
70
77
  * Union type of all callable items (prompts, agents, tools) that can be used as tools.
78
+ * @deprecated Use StandardAgentSpec.Callables instead
71
79
  */
72
- type Callables = keyof CallableRegistry extends never ? string : keyof CallableRegistry;
80
+ type Callables = StandardAgentSpec.Callables;
73
81
  }
74
82
  }
75
83
 
package/dist/index.js CHANGED
@@ -7521,18 +7521,18 @@ function generateTypesContent(config) {
7521
7521
  return `// Auto-generated by @standardagents/builder - DO NOT EDIT
7522
7522
  // Generated at: ${(/* @__PURE__ */ new Date()).toISOString()}
7523
7523
  //
7524
- // This file augments the AgentBuilder namespace declared in @standardagents/builder
7524
+ // This file augments the StandardAgentSpec namespace declared in @standardagents/spec
7525
7525
  // to provide type-safe references for your models, prompts, agents, and tools.
7526
7526
 
7527
7527
  /**
7528
- * Augment the global AgentBuilder namespace with your project's specific types.
7528
+ * Augment the global StandardAgentSpec namespace with your project's specific types.
7529
7529
  * This provides autocomplete and type checking for model, prompt, agent, and tool references.
7530
7530
  *
7531
7531
  * Uses interface declaration merging with property keys to create union types.
7532
7532
  * Example: interface ModelRegistry { 'gpt-4o': true; } gives type Models = 'gpt-4o'
7533
7533
  */
7534
7534
  declare global {
7535
- namespace AgentBuilder {
7535
+ namespace StandardAgentSpec {
7536
7536
  /** Model names from agents/models/ */
7537
7537
  interface ModelRegistry {
7538
7538
  ${generateRegistryProperties(models)}
@@ -8120,7 +8120,7 @@ function parseModelFile(content) {
8120
8120
  function generateModelFile(data, options) {
8121
8121
  const { providerName, providerPackage } = options;
8122
8122
  const lines = [
8123
- `import { defineModel } from '@standardagents/builder';`,
8123
+ `import { defineModel } from '@standardagents/spec';`,
8124
8124
  `import { ${providerName} } from '${providerPackage}';`,
8125
8125
  "",
8126
8126
  `export default defineModel({`,
@@ -8354,7 +8354,7 @@ function isEmptySchema(schema) {
8354
8354
  // src/sdk/generators/generatePromptFile.ts
8355
8355
  function generatePromptFile(data) {
8356
8356
  const hasSchema = data.requiredSchema && !isEmptySchema(data.requiredSchema);
8357
- const lines = [`import { definePrompt } from '@standardagents/builder';`];
8357
+ const lines = [`import { definePrompt } from '@standardagents/spec';`];
8358
8358
  if (hasSchema) {
8359
8359
  lines.push(`import { z } from 'zod';`);
8360
8360
  }
@@ -8544,7 +8544,7 @@ function normalizePart(part) {
8544
8544
  // src/sdk/generators/generateAgentFile.ts
8545
8545
  function generateAgentFile(data) {
8546
8546
  const lines = [
8547
- `import { defineAgent } from '@standardagents/builder';`,
8547
+ `import { defineAgent } from '@standardagents/spec';`,
8548
8548
  "",
8549
8549
  `export default defineAgent({`,
8550
8550
  ` name: '${escapeString3(data.name)}',`