agent-contracts-runtime 0.36.14 → 0.36.16

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 (37) hide show
  1. package/README.md +2 -1
  2. package/cli-contract.yaml +1 -1
  3. package/dist/adapters/adk-sdk.d.ts +4 -3
  4. package/dist/adapters/adk-sdk.js +1 -1
  5. package/dist/adapters/claude-agent-sdk.d.ts +4 -3
  6. package/dist/adapters/claude-agent-sdk.js +17 -9
  7. package/dist/adapters/claude-agent-sdk.js.map +1 -1
  8. package/dist/adapters/mock.d.ts +1 -1
  9. package/dist/adapters/openai-agents-sdk.d.ts +4 -3
  10. package/dist/agent-runtime.bundle.mjs +366 -373
  11. package/dist/agent-runtime.bundle.mjs.map +3 -3
  12. package/dist/{bound-resolver-K4UHLXN6.js → bound-resolver-I7WLYGC6.js} +3 -3
  13. package/dist/{chunk-MWZXU25C.js → chunk-2E2LWE6C.js} +2 -2
  14. package/dist/{chunk-TGPIGGSG.js → chunk-6JVGBBP3.js} +3 -3
  15. package/dist/{chunk-LTZA6QWC.js → chunk-KKJW4TE5.js} +7 -1
  16. package/dist/chunk-KKJW4TE5.js.map +1 -0
  17. package/dist/{chunk-MGRZBGQL.js → chunk-M57HVYUU.js} +7 -3
  18. package/dist/{chunk-MGRZBGQL.js.map → chunk-M57HVYUU.js.map} +1 -1
  19. package/dist/{chunk-VOBS62OH.js → chunk-S7MTKPBF.js} +2 -2
  20. package/dist/cli/index.js +13 -12
  21. package/dist/cli/index.js.map +1 -1
  22. package/dist/{context-B_bekYiE.d.ts → context-BEisfYPn.d.ts} +2 -1
  23. package/dist/generator/index.d.ts +3 -2
  24. package/dist/generator/index.js +2 -2
  25. package/dist/{guardrail-hooks-C8G5NGsj.d.ts → guardrail-hooks-CFd3a8tQ.d.ts} +2 -1
  26. package/dist/index.d.ts +7 -6
  27. package/dist/index.js +4 -4
  28. package/dist/{task-runner-Bo37lS9q.d.ts → task-runner-CD8nnKpn.d.ts} +2 -1
  29. package/docs/cli-reference.md +1 -1
  30. package/package.json +19 -18
  31. package/templates/contracts-index.ts.hbs +8 -8
  32. package/templates/tasks.ts.hbs +2 -2
  33. package/dist/chunk-LTZA6QWC.js.map +0 -1
  34. /package/dist/{bound-resolver-K4UHLXN6.js.map → bound-resolver-I7WLYGC6.js.map} +0 -0
  35. /package/dist/{chunk-MWZXU25C.js.map → chunk-2E2LWE6C.js.map} +0 -0
  36. /package/dist/{chunk-TGPIGGSG.js.map → chunk-6JVGBBP3.js.map} +0 -0
  37. /package/dist/{chunk-VOBS62OH.js.map → chunk-S7MTKPBF.js.map} +0 -0
@@ -103,4 +103,5 @@ interface GuardrailContext {
103
103
  */
104
104
  declare function buildGuardrailContext(dsl: any, binding: any, policyName?: string): GuardrailContext;
105
105
 
106
- export { type GuardrailContext as G, buildGuardrailContext as a, buildContractContext as b };
106
+ export { buildGuardrailContext as a, buildContractContext as b };
107
+ export type { GuardrailContext as G };
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- export { b as buildContractContext, a as buildGuardrailContext } from '../context-B_bekYiE.js';
2
+ export { b as buildContractContext, a as buildGuardrailContext } from '../context-BEisfYPn.js';
3
3
 
4
4
  /**
5
5
  * Generator configuration — loads and validates agents.conf.yaml / agent-runtime.config.yaml
@@ -152,4 +152,5 @@ interface GenerateResult {
152
152
  declare function generate(options?: GenerateOptions): Promise<GenerateResult>;
153
153
  declare function checkFreshness(configPath?: string): Promise<boolean>;
154
154
 
155
- export { DEFAULT_CONFIG_PATH, type GenerateOptions, type GenerateResult, type ProjectConfig, ProjectConfigSchema, type ResolvedConfig, checkFreshness, generate, loadConfig, loadProjectConfig };
155
+ export { DEFAULT_CONFIG_PATH, ProjectConfigSchema, checkFreshness, generate, loadConfig, loadProjectConfig };
156
+ export type { GenerateOptions, GenerateResult, ProjectConfig, ResolvedConfig };
@@ -5,11 +5,11 @@ import {
5
5
  generate,
6
6
  loadConfig,
7
7
  loadProjectConfig
8
- } from "../chunk-VOBS62OH.js";
8
+ } from "../chunk-S7MTKPBF.js";
9
9
  import {
10
10
  buildContractContext,
11
11
  buildGuardrailContext
12
- } from "../chunk-LTZA6QWC.js";
12
+ } from "../chunk-KKJW4TE5.js";
13
13
  export {
14
14
  DEFAULT_CONFIG_PATH,
15
15
  ProjectConfigSchema,
@@ -80,4 +80,5 @@ declare function createGuardrailHooks(checks: GuardrailCheckFunctions): Guardrai
80
80
  declare function createGuardrailHooksForAgent(agentId: string, perAgent: Map<string, GuardrailRuleData>): GuardrailHooks;
81
81
  declare function createGuardrailHooksFromRules(rules: GuardrailRuleData): GuardrailHooks;
82
82
 
83
- export { type GuardrailHooks as G, type HookContext as H, type GuardrailRuleData as a, type GuardrailCheckFunctions as b, type GuardrailCheckResult as c, type GuardrailRule as d, type HookResponse as e, createGuardrailHooks as f, createGuardrailHooksForAgent as g, createGuardrailHooksFromRules as h, getBlockingViolations as i, getWarnings as j, hasBlockingViolation as k };
83
+ export { createGuardrailHooks as f, createGuardrailHooksForAgent as g, createGuardrailHooksFromRules as h, getBlockingViolations as i, getWarnings as j, hasBlockingViolation as k };
84
+ export type { GuardrailHooks as G, HookContext as H, GuardrailRuleData as a, GuardrailCheckFunctions as b, GuardrailCheckResult as c, GuardrailRule as d, HookResponse as e };
package/dist/index.d.ts CHANGED
@@ -1,9 +1,9 @@
1
- import { S as SdkAdapter, T as TaskOutcome, b as TaskContractLike, c as AgentContractLike, d as TaskContext, P as PromptBuilderOptions, e as TaskRunResult } from './task-runner-Bo37lS9q.js';
2
- export { A as AdapterSendOptions, a as AgentExecutionRequest, f as AgentProgressEvent, C as CacheConfig, g as CandidateAgent, I as InMemoryStore, M as MemoryRef, h as MemoryStore, R as RetryDecision, i as SplitPrompt, j as TaskRunOptions, k as buildCandidateAgents, l as buildRetryFollowUp, m as buildSplitTaskPrompt, n as buildTaskPrompt, o as extractStructuredResult, r as renderAgentSystemPrompt, p as runTask, z as zodSchemaToPromptDescription, q as zodSchemaToYamlExample } from './task-runner-Bo37lS9q.js';
1
+ import { S as SdkAdapter, T as TaskOutcome, b as TaskContractLike, c as AgentContractLike, d as TaskContext, P as PromptBuilderOptions, e as TaskRunResult } from './task-runner-CD8nnKpn.js';
2
+ export { A as AdapterSendOptions, a as AgentExecutionRequest, f as AgentProgressEvent, C as CacheConfig, g as CandidateAgent, I as InMemoryStore, M as MemoryRef, h as MemoryStore, R as RetryDecision, i as SplitPrompt, j as TaskRunOptions, k as buildCandidateAgents, l as buildRetryFollowUp, m as buildSplitTaskPrompt, n as buildTaskPrompt, o as extractStructuredResult, r as renderAgentSystemPrompt, p as runTask, z as zodSchemaToPromptDescription, q as zodSchemaToYamlExample } from './task-runner-CD8nnKpn.js';
3
3
  import { z } from 'zod';
4
- import { a as GuardrailRuleData, G as GuardrailHooks } from './guardrail-hooks-C8G5NGsj.js';
5
- export { b as GuardrailCheckFunctions, c as GuardrailCheckResult, d as GuardrailRule, H as HookContext, e as HookResponse, f as createGuardrailHooks, g as createGuardrailHooksForAgent, h as createGuardrailHooksFromRules, i as getBlockingViolations, j as getWarnings, k as hasBlockingViolation } from './guardrail-hooks-C8G5NGsj.js';
6
- import { G as GuardrailContext } from './context-B_bekYiE.js';
4
+ import { a as GuardrailRuleData, G as GuardrailHooks } from './guardrail-hooks-CFd3a8tQ.js';
5
+ export { b as GuardrailCheckFunctions, c as GuardrailCheckResult, d as GuardrailRule, H as HookContext, e as HookResponse, f as createGuardrailHooks, g as createGuardrailHooksForAgent, h as createGuardrailHooksFromRules, i as getBlockingViolations, j as getWarnings, k as hasBlockingViolation } from './guardrail-hooks-CFd3a8tQ.js';
6
+ import { G as GuardrailContext } from './context-BEisfYPn.js';
7
7
 
8
8
  /**
9
9
  * ModelResolver — resolves a model_class to a concrete adapter + model pair.
@@ -619,4 +619,5 @@ interface ExecuteWorkflowOptions extends ExecuteOptions {
619
619
  }
620
620
  declare function executeWorkflow(workflowId: string, options: ExecuteWorkflowOptions): Promise<WorkflowResult>;
621
621
 
622
- export { type AdapterOrFactory, AgentContractLike, type AgentPlugin, type ArtifactBindingConfig, type BoundResolveOptions, BoundResolver, type CreateAdapterOptions, type DelegateStep, type DslContext, DslValidationError, type ExecuteOptions, type ExecuteTaskOptions, type ExecuteWorkflowOptions, type GateStep, GuardrailHooks, type GuardrailResult, GuardrailRuleData, type HandoffInput, type LoadDslOptions, type ModelAwareSdkAdapterFactory, type ModelClass, type ModelMappingConfig, type ModelResolver, type ModelResolverOptions, type PermissionMode, type PluginLoadResult, PluginRegistry, type ProgressSink, type ProgressSinkOptions, type PromptBuilderArgs, PromptBuilderOptions, type RequiredEntities, type ResolvedComponent, type ResolvedModel, type Runtime, type RuntimeConfig, SdkAdapter, type SdkAdapterFactory, type StepCompleteEvent, type StepResult, TaskContext, TaskContractLike, type TaskHookContext, TaskOutcome, TaskRunResult, WorkflowBuilder, type WorkflowContractLike, type WorkflowHookContext, type WorkflowInvocation, type WorkflowRegistries, type WorkflowResult, type WorkflowRunOptions, type WorkflowStep, buildGateEvaluationPrompt, buildGuardrailRulesFromDsl, buildPerAgentGuardrails, buildRegistriesFromDsl, createAdapter, createModelResolver, createProgressSink, createRuntime, executeTask, executeWorkflow, getEffectiveGuardrailIds, getGuardrailRulesForAgent, guardrailContextToRuleData, jsonSchemaToZod, loadDslContext, loadPlugins, loadPluginsFromDirectory, loadPluginsFromPaths, parseGateEvaluationResponse, pluginRegistry, runWorkflow };
622
+ export { AgentContractLike, BoundResolver, DslValidationError, GuardrailHooks, GuardrailRuleData, PluginRegistry, PromptBuilderOptions, SdkAdapter, TaskContext, TaskContractLike, TaskOutcome, TaskRunResult, WorkflowBuilder, buildGateEvaluationPrompt, buildGuardrailRulesFromDsl, buildPerAgentGuardrails, buildRegistriesFromDsl, createAdapter, createModelResolver, createProgressSink, createRuntime, executeTask, executeWorkflow, getEffectiveGuardrailIds, getGuardrailRulesForAgent, guardrailContextToRuleData, jsonSchemaToZod, loadDslContext, loadPlugins, loadPluginsFromDirectory, loadPluginsFromPaths, parseGateEvaluationResponse, pluginRegistry, runWorkflow };
623
+ export type { AdapterOrFactory, AgentPlugin, ArtifactBindingConfig, BoundResolveOptions, CreateAdapterOptions, DelegateStep, DslContext, ExecuteOptions, ExecuteTaskOptions, ExecuteWorkflowOptions, GateStep, GuardrailResult, HandoffInput, LoadDslOptions, ModelAwareSdkAdapterFactory, ModelClass, ModelMappingConfig, ModelResolver, ModelResolverOptions, PermissionMode, PluginLoadResult, ProgressSink, ProgressSinkOptions, PromptBuilderArgs, RequiredEntities, ResolvedComponent, ResolvedModel, Runtime, RuntimeConfig, SdkAdapterFactory, StepCompleteEvent, StepResult, TaskHookContext, WorkflowContractLike, WorkflowHookContext, WorkflowInvocation, WorkflowRegistries, WorkflowResult, WorkflowRunOptions, WorkflowStep };
package/dist/index.js CHANGED
@@ -21,14 +21,14 @@ import {
21
21
  runWorkflow,
22
22
  zodSchemaToPromptDescription,
23
23
  zodSchemaToYamlExample
24
- } from "./chunk-TGPIGGSG.js";
24
+ } from "./chunk-6JVGBBP3.js";
25
25
  import {
26
26
  BoundResolver,
27
27
  buildPerAgentGuardrails,
28
28
  getEffectiveGuardrailIds,
29
29
  getGuardrailRulesForAgent,
30
30
  guardrailContextToRuleData
31
- } from "./chunk-MWZXU25C.js";
31
+ } from "./chunk-2E2LWE6C.js";
32
32
  import {
33
33
  createModelResolver
34
34
  } from "./chunk-AWBHN3LI.js";
@@ -41,8 +41,8 @@ import {
41
41
  getWarnings,
42
42
  hasBlockingViolation,
43
43
  pluginRegistry
44
- } from "./chunk-MGRZBGQL.js";
45
- import "./chunk-LTZA6QWC.js";
44
+ } from "./chunk-M57HVYUU.js";
45
+ import "./chunk-KKJW4TE5.js";
46
46
  import {
47
47
  DslValidationError,
48
48
  buildGuardrailRulesFromDsl,
@@ -394,4 +394,5 @@ declare function runTask(adapter: SdkAdapter, taskId: string, context: TaskConte
394
394
  };
395
395
  }): Promise<TaskRunResult>;
396
396
 
397
- export { type AdapterSendOptions as A, type CacheConfig as C, InMemoryStore as I, type MemoryRef as M, type PromptBuilderOptions as P, type RetryDecision as R, type SdkAdapter as S, type TaskOutcome as T, type AgentExecutionRequest as a, type TaskContractLike as b, type AgentContractLike as c, type TaskContext as d, type TaskRunResult as e, type AgentProgressEvent as f, type CandidateAgent as g, type MemoryStore as h, type SplitPrompt as i, type TaskRunOptions as j, buildCandidateAgents as k, buildRetryFollowUp as l, buildSplitTaskPrompt as m, buildTaskPrompt as n, extractStructuredResult as o, runTask as p, zodSchemaToYamlExample as q, renderAgentSystemPrompt as r, zodSchemaToPromptDescription as z };
397
+ export { InMemoryStore as I, buildCandidateAgents as k, buildRetryFollowUp as l, buildSplitTaskPrompt as m, buildTaskPrompt as n, extractStructuredResult as o, runTask as p, zodSchemaToYamlExample as q, renderAgentSystemPrompt as r, zodSchemaToPromptDescription as z };
398
+ export type { AdapterSendOptions as A, CacheConfig as C, MemoryRef as M, PromptBuilderOptions as P, RetryDecision as R, SdkAdapter as S, TaskOutcome as T, AgentExecutionRequest as a, TaskContractLike as b, AgentContractLike as c, TaskContext as d, TaskRunResult as e, AgentProgressEvent as f, CandidateAgent as g, MemoryStore as h, SplitPrompt as i, TaskRunOptions as j };
@@ -5,7 +5,7 @@ Generates typed contracts, handoff validators, and guardrail hooks from DSL,
5
5
  then runs workflows through pluggable SDK adapters.
6
6
 
7
7
 
8
- **Version:** 0.36.14
8
+ **Version:** 0.36.16
9
9
 
10
10
  ## Table of Contents
11
11
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-contracts-runtime",
3
- "version": "0.36.14",
3
+ "version": "0.36.16",
4
4
  "description": "Runtime bridge for executing agent-contracts workflows on Agent SDKs",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -48,7 +48,7 @@
48
48
  "scripts": {
49
49
  "generate": "cli-contracts generate",
50
50
  "generate:builtin": "npx agent-runtime generate -c dsl/agent-runtime.config.yaml",
51
- "build": "npm run generate && tsup",
51
+ "build": "npm run generate && tsup && npm run bundle",
52
52
  "typecheck": "tsc --noEmit",
53
53
  "test": "vitest run",
54
54
  "test:watch": "vitest",
@@ -91,25 +91,25 @@
91
91
  "agent-contracts": "^0.34.0",
92
92
  "commander": "^12.1.0",
93
93
  "dotenv": "^17.4.2",
94
- "handlebars": "^4.7.9",
95
- "tsx": "^4.21.0",
94
+ "handlebars": "^4.7.10",
95
+ "tsx": "^4.22.0",
96
96
  "yaml": "^2.8.3",
97
- "zod": "^4.0.0"
97
+ "zod": "^4.6.7"
98
98
  },
99
99
  "devDependencies": {
100
- "@anthropic-ai/claude-agent-sdk": "^0.2.138",
101
- "@google/adk": "^1.2.0",
102
- "@openai/agents": "^0.11.1",
103
- "@types/node": "^25.6.0",
104
- "cli-contracts": "^0.34.6",
105
- "esbuild": "^0.28.1",
106
- "tsup": "^8.5.0",
107
- "typescript": "^5.8.3",
108
- "vitest": "^4.1.11"
100
+ "@anthropic-ai/claude-agent-sdk": "^0.3.323",
101
+ "@google/adk": "^2.5.0",
102
+ "@openai/agents": "^0.22.0",
103
+ "@types/node": "^26.6.6",
104
+ "cli-contracts": "^0.34.12",
105
+ "esbuild": "^0.28.2",
106
+ "tsup": "^9.0.0",
107
+ "typescript": "^5.9.3",
108
+ "vitest": "^4.1.12"
109
109
  },
110
110
  "peerDependencies": {
111
111
  "@anthropic-ai/claude-agent-sdk": ">=0.2.0",
112
- "@google/adk": ">=1.2.0",
112
+ "@google/adk": ">=2.2.0",
113
113
  "@openai/agents": ">=0.10.0"
114
114
  },
115
115
  "peerDependenciesMeta": {
@@ -126,9 +126,10 @@
126
126
  "overrides": {
127
127
  "uuid": "^11.1.1",
128
128
  "@opentelemetry/core": "^2.8.0",
129
- "@hono/node-server": "^2.0.12",
130
129
  "adm-zip": "^0.6.0",
131
- "qs": "^6.16.0",
132
- "esbuild": "$esbuild"
130
+ "esbuild": "$esbuild",
131
+ "gcp-metadata@^8": {
132
+ "gaxios": "^7.3.1"
133
+ }
133
134
  }
134
135
  }
@@ -1,8 +1,8 @@
1
- export { agentRegistry } from "./agents";
2
- export type { AgentContract, AgentId } from "./agents";
3
- export { taskRegistry } from "./tasks";
4
- export type { TaskContract } from "./tasks";
5
- export { handoffSchemas, handoffs } from "./handoffs";
6
- export type { HandoffTypeId, HandoffEnvelope } from "./handoffs";
7
- export { workflowRegistry } from "./workflows";
8
- export { resolvedDsl } from "./dsl-data";
1
+ export { agentRegistry } from "{{relativeImport "agents.ts"}}";
2
+ export type { AgentContract, AgentId } from "{{relativeImport "agents.ts"}}";
3
+ export { taskRegistry } from "{{relativeImport "tasks.ts"}}";
4
+ export type { TaskContract } from "{{relativeImport "tasks.ts"}}";
5
+ export { handoffSchemas, handoffs } from "{{relativeImport "handoffs.ts"}}";
6
+ export type { HandoffTypeId, HandoffEnvelope } from "{{relativeImport "handoffs.ts"}}";
7
+ export { workflowRegistry } from "{{relativeImport "workflows.ts"}}";
8
+ export { resolvedDsl } from "{{relativeImport "dsl-data.ts"}}";
@@ -1,5 +1,5 @@
1
- import type { AgentId } from "./agents";
2
- import type { HandoffTypeId } from "./handoffs";
1
+ import type { AgentId } from "{{relativeImport "agents.ts"}}";
2
+ import type { HandoffTypeId } from "{{relativeImport "handoffs.ts"}}";
3
3
 
4
4
  export type ModelClass = "fast" | "standard" | "thinking";
5
5
 
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/generator/template-engine.ts","../src/generator/context.ts"],"sourcesContent":["/**\n * Handlebars template engine with custom helpers for TypeScript code generation\n */\n\nimport { readFile } from \"node:fs/promises\";\nimport { resolve, join } from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\nimport Handlebars from \"handlebars\";\n\nimport { existsSync } from \"node:fs\";\n\nconst __dirname = fileURLToPath(new URL(\".\", import.meta.url));\n\nfunction findPackageRoot(): string {\n let dir = __dirname;\n for (let i = 0; i < 5; i++) {\n if (existsSync(join(dir, \"package.json\"))) return dir;\n dir = resolve(dir, \"..\");\n }\n return resolve(__dirname, \"..\");\n}\n\nconst BUILTIN_TEMPLATES_DIR = join(findPackageRoot(), \"templates\");\n\nfunction toCamelCase(str: string): string {\n return str.replace(/-([a-z])/g, (_, c: string) => c.toUpperCase());\n}\n\nfunction toPascalCase(str: string): string {\n const camel = toCamelCase(str);\n return camel.charAt(0).toUpperCase() + camel.slice(1);\n}\n\nconst hbs = Handlebars.create();\n\nhbs.registerHelper(\"camelCase\", (str: string) => toCamelCase(str));\nhbs.registerHelper(\"PascalCase\", (str: string) => toPascalCase(str));\n\nhbs.registerHelper(\"eq\", (a: unknown, b: unknown) => a === b);\nhbs.registerHelper(\"notEmpty\", (arr: unknown) =>\n Array.isArray(arr) ? arr.length > 0 : !!arr,\n);\n\nhbs.registerHelper(\"json\", (value: unknown) =>\n new Handlebars.SafeString(JSON.stringify(value, null, 2)),\n);\n\nhbs.registerHelper(\"hasDependsOn\", (step: Record<string, unknown>) =>\n \"depends_on\" in step && Array.isArray(step.depends_on),\n);\n\nhbs.registerHelper(\"jsonInline\", (value: unknown) =>\n new Handlebars.SafeString(JSON.stringify(value)),\n);\n\nhbs.registerHelper(\"indent\", (text: string, spaces: number) => {\n if (typeof text !== \"string\") return text;\n const pad = \" \".repeat(spaces);\n return text\n .split(\"\\n\")\n .map((line, i) => (i === 0 ? line : pad + line))\n .join(\"\\n\");\n});\n\n/** Escape a JSON Schema pattern for safe inclusion in a JS regex literal (/.../). */\nfunction escapeRegexPatternForSource(pattern: string): string {\n return pattern.replace(/\\\\/g, \"\\\\\\\\\").replace(/\\//g, \"\\\\/\");\n}\n\nfunction appendStringValidations(base: string, schema: Record<string, unknown>): string {\n let result = base;\n if (schema.minLength !== undefined) result += `.min(${schema.minLength})`;\n if (schema.maxLength !== undefined) result += `.max(${schema.maxLength})`;\n if (schema.pattern !== undefined) {\n const escaped = escapeRegexPatternForSource(schema.pattern as string);\n result += `.regex(/${escaped}/)`;\n }\n return result;\n}\n\nfunction appendNumberValidations(\n base: string,\n schema: Record<string, unknown>,\n isInteger: boolean,\n): string {\n let result = base;\n if (isInteger) result += \".int()\";\n if (schema.minimum !== undefined) result += `.min(${schema.minimum})`;\n if (schema.maximum !== undefined) result += `.max(${schema.maximum})`;\n return result;\n}\n\nfunction appendArrayValidations(base: string, schema: Record<string, unknown>): string {\n let result = base;\n if (schema.minItems !== undefined) result += `.min(${schema.minItems})`;\n if (schema.maxItems !== undefined) result += `.max(${schema.maxItems})`;\n return result;\n}\n\nhbs.registerHelper(\"zodType\", function zodType(schema: Record<string, unknown>): string {\n if (!schema || typeof schema !== \"object\") return \"z.unknown()\";\n\n if (schema.enum) {\n const vals = (schema.enum as string[]).map((v) => `\"${v}\"`).join(\", \");\n return `z.enum([${vals}])`;\n }\n\n if (schema.const !== undefined) {\n return `z.literal(${JSON.stringify(schema.const)})`;\n }\n\n const type = schema.type as string | undefined;\n\n if (type === \"string\") return appendStringValidations(\"z.string()\", schema);\n if (type === \"integer\") return appendNumberValidations(\"z.number()\", schema, true);\n if (type === \"number\") return appendNumberValidations(\"z.number()\", schema, false);\n if (type === \"boolean\") return \"z.boolean()\";\n\n if (type === \"array\") {\n const items = schema.items as Record<string, unknown> | undefined;\n const inner = items ? zodType(items) : \"z.unknown()\";\n return appendArrayValidations(`z.array(${inner})`, schema);\n }\n\n if (type === \"object\") {\n const props = schema.properties as Record<string, Record<string, unknown>> | undefined;\n if (!props) return \"z.record(z.string(), z.unknown())\";\n\n const required = (schema.required as string[]) ?? [];\n const fields = Object.entries(props)\n .map(([key, val]) => {\n const base = zodType(val);\n const opt = required.includes(key) ? \"\" : \".optional()\";\n const safeKey = /^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(key) ? key : `\"${key}\"`;\n return ` ${safeKey}: ${base}${opt},`;\n })\n .join(\"\\n\");\n return `z.object({\\n${fields}\\n})`;\n }\n\n if (schema.allOf) {\n const parts = (schema.allOf as Record<string, unknown>[]).map(zodType);\n if (parts.length === 1) return parts[0];\n return parts.reduce((acc, part) => `${acc}.extend(${part}.shape)`);\n }\n\n return \"z.unknown()\";\n});\n\nhbs.registerHelper(\"regexEscape\", (str: string) => {\n if (typeof str !== \"string\") return str;\n return str.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\");\n});\n\nhbs.registerHelper(\"stringArray\", (arr: unknown) => {\n if (!Array.isArray(arr)) return \"[]\";\n return \"[\" + arr.map((s) => `\"${s}\"`).join(\", \") + \"]\";\n});\n\n/**\n * Load a template by name, with custom dir override fallback to built-in.\n */\nasync function loadTemplate(\n name: string,\n customDir?: string,\n): Promise<string> {\n if (customDir) {\n try {\n return await readFile(join(customDir, name), \"utf8\");\n } catch {\n // fallback to built-in\n }\n }\n return readFile(join(BUILTIN_TEMPLATES_DIR, name), \"utf8\");\n}\n\nexport async function renderTemplate(\n name: string,\n context: Record<string, unknown>,\n customDir?: string,\n): Promise<string> {\n const source = await loadTemplate(name, customDir);\n const compiled = hbs.compile(source, { noEscape: true });\n return compiled(context);\n}\n\nexport { hbs, toCamelCase, toPascalCase };\n","/**\n * Build template contexts from resolved DSL data\n */\n\nimport { toCamelCase, toPascalCase } from \"./template-engine.js\";\n\nexport interface AgentEntry {\n id: string;\n varName: string;\n role_name: string;\n purpose: string;\n mode: string;\n dispatch_only: boolean;\n can_read_artifacts: string[];\n can_write_artifacts: string[];\n can_execute_tools: string[];\n can_invoke_agents: string[];\n can_return_handoffs: string[];\n responsibilities: string[];\n constraints: string[];\n rules: Array<{ id: string; description: string; severity: string }>;\n escalation_criteria: Array<{ condition: string; action: string }>;\n}\n\nexport interface TaskEntry {\n id: string;\n varName: string;\n description: string;\n target_agent: string;\n allowed_from_agents: string[];\n workflow: string;\n invocation_handoff: string;\n result_handoff: string;\n input_artifacts: string[];\n responsibilities: string[];\n completion_criteria: string[];\n optional: boolean;\n model_class?: string;\n}\n\nexport interface WorkflowStepEntry {\n type: string;\n task?: string;\n from_agent?: string;\n description?: string;\n optional?: boolean;\n max_retries?: number;\n max_follow_ups?: number;\n depends_on?: string[];\n gate_kind?: string;\n retry?: { condition: string; fix_task: string; revalidate_task?: string };\n}\n\nexport interface WorkflowEntry {\n id: string;\n varName: string;\n description: string;\n trigger: string;\n entry_conditions: string[];\n steps: WorkflowStepEntry[];\n}\n\nexport interface HandoffEntry {\n id: string;\n varName: string;\n pascalName: string;\n schemaName: string;\n description: string;\n schema: Record<string, unknown>;\n}\n\nexport interface ContractContext {\n agentEntries: AgentEntry[];\n taskEntries: TaskEntry[];\n workflowEntries: WorkflowEntry[];\n handoffEntries: HandoffEntry[];\n}\n\n/**\n * Determine if a task is optional by checking if any workflow step referencing it is optional.\n */\nfunction isTaskOptional(\n taskId: string,\n workflows: Record<string, { steps: Array<{ type: string; task?: string; optional?: boolean }> }>,\n): boolean {\n for (const wf of Object.values(workflows)) {\n for (const step of wf.steps) {\n if (step.type === \"delegate\" && step.task === taskId && step.optional) {\n return true;\n }\n }\n }\n return false;\n}\n\n/**\n * Compute max_retries from workflow step or fallback to 0.\n */\nfunction getMaxRetries(\n taskId: string,\n workflows: Record<string, { steps: Array<Record<string, unknown>> }>,\n): number {\n for (const wf of Object.values(workflows)) {\n for (const step of wf.steps) {\n if (step.type === \"delegate\" && step.task === taskId) {\n const retry = step.retry as { condition: string } | undefined;\n return retry ? 1 : 0;\n }\n }\n }\n return 0;\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function buildContractContext(dsl: any): ContractContext {\n const agents = (dsl.agents ?? {}) as Record<string, Record<string, unknown>>;\n const tasks = (dsl.tasks ?? {}) as Record<string, Record<string, unknown>>;\n const workflows = (dsl.workflow ?? {}) as Record<string, Record<string, unknown>>;\n const handoffTypes = (dsl.handoff_types ?? {}) as Record<string, Record<string, unknown>>;\n\n const agentEntries: AgentEntry[] = Object.entries(agents).map(([id, agent]) => ({\n id,\n varName: toCamelCase(id),\n role_name: (agent.role_name as string) ?? id,\n purpose: (agent.purpose as string) ?? \"\",\n mode: (agent.mode as string) ?? \"read-write\",\n dispatch_only: (agent.dispatch_only as boolean) ?? false,\n can_read_artifacts: (agent.can_read_artifacts as string[]) ?? [],\n can_write_artifacts: (agent.can_write_artifacts as string[]) ?? [],\n can_execute_tools: (agent.can_execute_tools as string[]) ?? [],\n can_invoke_agents: (agent.can_invoke_agents as string[]) ?? [],\n can_return_handoffs: (agent.can_return_handoffs as string[]) ?? [],\n responsibilities: (agent.responsibilities as string[]) ?? [],\n constraints: (agent.constraints as string[]) ?? [],\n rules: (agent.rules as AgentEntry[\"rules\"]) ?? [],\n escalation_criteria: (agent.escalation_criteria as AgentEntry[\"escalation_criteria\"]) ?? [],\n }));\n\n const taskEntries: TaskEntry[] = Object.entries(tasks).map(([id, task]) => ({\n id,\n varName: toCamelCase(id),\n description: (task.description as string) ?? \"\",\n target_agent: (task.target_agent as string) ?? \"\",\n allowed_from_agents: (task.allowed_from_agents as string[]) ?? [],\n workflow: (task.workflow as string) ?? \"\",\n invocation_handoff: (task.invocation_handoff as string) ?? \"\",\n result_handoff: (task.result_handoff as string) ?? \"\",\n input_artifacts: (task.input_artifacts as string[]) ?? [],\n responsibilities: (task.responsibilities as string[]) ?? [],\n completion_criteria: (task.completion_criteria as string[]) ?? [],\n optional: isTaskOptional(id, workflows as Record<string, { steps: Array<{ type: string; task?: string; optional?: boolean }> }>),\n ...(task.model_class ? { model_class: task.model_class as string } : {}),\n }));\n\n const workflowEntries: WorkflowEntry[] = Object.entries(workflows).map(\n ([id, wf]) => {\n const steps = ((wf.steps as Array<Record<string, unknown>>) ?? []).map((step) => {\n const entry: WorkflowStepEntry = { type: step.type as string };\n if (step.type === \"delegate\") {\n entry.task = step.task as string;\n entry.from_agent = step.from_agent as string;\n entry.description = (step.description as string | undefined) ?? \"\";\n const wfStep = step as Record<string, unknown>;\n entry.optional = isTaskOptional(\n step.task as string,\n workflows as Record<string, { steps: Array<{ type: string; task?: string; optional?: boolean }> }>,\n );\n entry.max_retries = (wfStep.max_retries as number | undefined) ?? (wfStep.retry ? 1 : 0);\n entry.max_follow_ups = wfStep.max_follow_ups as number | undefined;\n if (wfStep.depends_on !== undefined) {\n entry.depends_on = wfStep.depends_on as string[];\n }\n if (wfStep.retry) {\n const r = wfStep.retry as Record<string, unknown>;\n entry.retry = {\n condition: r.condition as string,\n fix_task: r.fix_task as string,\n revalidate_task: r.revalidate_task as string | undefined,\n };\n }\n } else if (step.type === \"gate\") {\n entry.gate_kind = step.gate_kind as string;\n entry.description = (step.description as string | undefined) ?? \"\";\n if (step.depends_on !== undefined) {\n entry.depends_on = step.depends_on as string[];\n }\n }\n return entry;\n });\n\n return {\n id,\n varName: toCamelCase(id),\n description: (wf.description as string) ?? \"\",\n trigger: (wf.trigger as string) ?? \"\",\n entry_conditions: (wf.entry_conditions as string[]) ?? [],\n steps,\n };\n },\n );\n\n const handoffEntries: HandoffEntry[] = Object.entries(handoffTypes).map(\n ([id, ht]) => ({\n id,\n varName: toCamelCase(id),\n pascalName: toPascalCase(id),\n schemaName: toPascalCase(id) + \"Schema\",\n description: (ht.description as string) ?? \"\",\n schema: (ht.schema as Record<string, unknown>) ?? {},\n }),\n );\n\n return { agentEntries, taskEntries, workflowEntries, handoffEntries };\n}\n\nexport interface GuardrailCheckEntry {\n guardrail_id: string;\n description: string;\n severity: string;\n action: string;\n matcher_type: string;\n pattern: string;\n message: string;\n file_glob?: string;\n exclude_glob?: string;\n}\n\nexport interface GuardrailContext {\n commandChecks: GuardrailCheckEntry[];\n fileChecks: GuardrailCheckEntry[];\n contentChecks: GuardrailCheckEntry[];\n allChecks: GuardrailCheckEntry[];\n hasGuardrails: boolean;\n}\n\n/**\n * Build guardrail context from DSL guardrails, binding guardrail_impl, and active policy.\n * Mirrors the agent-contracts resolveChecks pattern.\n */\nexport function buildGuardrailContext(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n dsl: any,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n binding: any,\n policyName?: string,\n): GuardrailContext {\n const empty: GuardrailContext = {\n commandChecks: [],\n fileChecks: [],\n contentChecks: [],\n allChecks: [],\n hasGuardrails: false,\n };\n\n if (!binding?.guardrail_impl) return empty;\n\n const guardrails = dsl.guardrails ?? {};\n const policies = dsl.guardrail_policies ?? {};\n const policy = policyName ? policies[policyName] : undefined;\n\n const allChecks: GuardrailCheckEntry[] = [];\n\n for (const [guardrailId, impl] of Object.entries(\n binding.guardrail_impl as Record<string, { checks: Array<Record<string, unknown>> }>,\n )) {\n const guardrail = guardrails[guardrailId] as Record<string, unknown> | undefined;\n const description = (guardrail?.description as string) ?? guardrailId;\n\n const policyRule = policy?.rules?.find(\n (r: Record<string, unknown>) => r.guardrail === guardrailId,\n );\n const severity = (policyRule?.severity as string) ?? \"warning\";\n const action = (policyRule?.action as string) ?? \"warn\";\n\n for (const check of impl.checks) {\n const matcher = check.matcher as Record<string, unknown> | undefined;\n if (!matcher) continue;\n\n allChecks.push({\n guardrail_id: guardrailId,\n description,\n severity,\n action,\n matcher_type: matcher.type as string,\n pattern: matcher.pattern as string,\n message: (check.message as string) ?? description,\n file_glob: matcher.file_glob as string | undefined,\n exclude_glob: matcher.exclude_glob as string | undefined,\n });\n }\n }\n\n return {\n commandChecks: allChecks.filter((c) => c.matcher_type === \"command_regex\"),\n fileChecks: allChecks.filter((c) => c.matcher_type === \"file_glob\"),\n contentChecks: allChecks.filter((c) => c.matcher_type === \"content_regex\"),\n allChecks,\n hasGuardrails: allChecks.length > 0,\n };\n}\n"],"mappings":";AAIA,SAAS,gBAAgB;AACzB,SAAS,SAAS,YAAY;AAC9B,SAAS,qBAAqB;AAC9B,OAAO,gBAAgB;AAEvB,SAAS,kBAAkB;AAE3B,IAAM,YAAY,cAAc,IAAI,IAAI,KAAK,YAAY,GAAG,CAAC;AAE7D,SAAS,kBAA0B;AACjC,MAAI,MAAM;AACV,WAAS,IAAI,GAAG,IAAI,GAAG,KAAK;AAC1B,QAAI,WAAW,KAAK,KAAK,cAAc,CAAC,EAAG,QAAO;AAClD,UAAM,QAAQ,KAAK,IAAI;AAAA,EACzB;AACA,SAAO,QAAQ,WAAW,IAAI;AAChC;AAEA,IAAM,w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