@contractspec/bundle.library 3.8.2 → 3.8.5

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 (121) hide show
  1. package/.turbo/turbo-build.log +130 -116
  2. package/CHANGELOG.md +80 -0
  3. package/dist/application/index.js +806 -131
  4. package/dist/application/mcp/cliMcp.js +21 -2
  5. package/dist/application/mcp/common.js +21 -2
  6. package/dist/application/mcp/common.test.d.ts +1 -0
  7. package/dist/application/mcp/contractsMcp.js +21 -2
  8. package/dist/application/mcp/docsMcp.catalog.d.ts +2 -0
  9. package/dist/application/mcp/docsMcp.catalog.js +382 -0
  10. package/dist/application/mcp/docsMcp.d.ts +5 -1
  11. package/dist/application/mcp/docsMcp.data.d.ts +85 -0
  12. package/dist/application/mcp/docsMcp.data.js +148 -0
  13. package/dist/application/mcp/docsMcp.js +776 -101
  14. package/dist/application/mcp/docsMcp.prompts.d.ts +3 -0
  15. package/dist/application/mcp/docsMcp.prompts.js +522 -0
  16. package/dist/application/mcp/docsMcp.reference.d.ts +24 -0
  17. package/dist/application/mcp/docsMcp.reference.js +236 -0
  18. package/dist/application/mcp/docsMcp.resources.d.ts +3 -0
  19. package/dist/application/mcp/docsMcp.resources.js +520 -0
  20. package/dist/application/mcp/docsMcp.test.d.ts +1 -0
  21. package/dist/application/mcp/docsMcp.tools.d.ts +3 -0
  22. package/dist/application/mcp/docsMcp.tools.js +519 -0
  23. package/dist/application/mcp/index.js +806 -131
  24. package/dist/application/mcp/internalMcp.js +21 -2
  25. package/dist/application/mcp/normalizeMcpRequest.d.ts +1 -0
  26. package/dist/application/mcp/normalizeMcpRequest.js +22 -0
  27. package/dist/application/mcp/providerRankingMcp.js +21 -2
  28. package/dist/components/docs/generated/docs-index.generated.d.ts +6 -6
  29. package/dist/components/docs/index.js +23 -24
  30. package/dist/components/docs/libraries/LibrariesAiAgentPage.js +22 -22
  31. package/dist/components/docs/libraries/LibrariesSupportBotPage.js +1 -2
  32. package/dist/components/docs/libraries/index.js +23 -24
  33. package/dist/components/templates/engine/index.d.ts +1 -1
  34. package/dist/components/templates/engine/index.js +1 -1
  35. package/dist/features/index.js +15 -15
  36. package/dist/index.js +194 -195
  37. package/dist/node/application/index.js +806 -131
  38. package/dist/node/application/mcp/cliMcp.js +21 -2
  39. package/dist/node/application/mcp/common.js +21 -2
  40. package/dist/node/application/mcp/contractsMcp.js +21 -2
  41. package/dist/node/application/mcp/docsMcp.catalog.js +381 -0
  42. package/dist/node/application/mcp/docsMcp.data.js +147 -0
  43. package/dist/node/application/mcp/docsMcp.js +776 -101
  44. package/dist/node/application/mcp/docsMcp.prompts.js +521 -0
  45. package/dist/node/application/mcp/docsMcp.reference.js +235 -0
  46. package/dist/node/application/mcp/docsMcp.resources.js +519 -0
  47. package/dist/node/application/mcp/docsMcp.tools.js +518 -0
  48. package/dist/node/application/mcp/index.js +806 -131
  49. package/dist/node/application/mcp/internalMcp.js +21 -2
  50. package/dist/node/application/mcp/normalizeMcpRequest.js +21 -0
  51. package/dist/node/application/mcp/providerRankingMcp.js +21 -2
  52. package/dist/node/components/docs/index.js +23 -24
  53. package/dist/node/components/docs/libraries/LibrariesAiAgentPage.js +22 -22
  54. package/dist/node/components/docs/libraries/LibrariesSupportBotPage.js +1 -2
  55. package/dist/node/components/docs/libraries/index.js +23 -24
  56. package/dist/node/components/templates/engine/index.js +1 -1
  57. package/dist/node/features/index.js +15 -15
  58. package/dist/node/index.js +194 -195
  59. package/dist/node/presentation/features/hooks/index.js +12 -12
  60. package/dist/node/presentation/features/hooks/useContractsRegistry.js +12 -12
  61. package/dist/node/presentation/features/index.js +12 -12
  62. package/dist/node/presentation/features/organisms/FeatureDataViewsList.js +12 -12
  63. package/dist/node/presentation/features/organisms/FeatureEventsList.js +12 -12
  64. package/dist/node/presentation/features/organisms/FeatureFormsList.js +12 -12
  65. package/dist/node/presentation/features/organisms/FeaturePresentationsList.js +12 -12
  66. package/dist/node/presentation/features/organisms/index.js +12 -12
  67. package/dist/node/presentation/features/templates/FeatureDataViewsTemplate/FeatureDataViewsTemplate.js +12 -12
  68. package/dist/node/presentation/features/templates/FeatureDataViewsTemplate/index.js +12 -12
  69. package/dist/node/presentation/features/templates/FeatureEventsTemplate/FeatureEventsTemplate.js +12 -12
  70. package/dist/node/presentation/features/templates/FeatureEventsTemplate/index.js +12 -12
  71. package/dist/node/presentation/features/templates/FeatureFormsTemplate/FeatureFormsTemplate.js +12 -12
  72. package/dist/node/presentation/features/templates/FeatureFormsTemplate/index.js +12 -12
  73. package/dist/node/presentation/features/templates/FeaturePresentationsTemplate/FeaturePresentationsTemplate.js +12 -12
  74. package/dist/node/presentation/features/templates/FeaturePresentationsTemplate/index.js +12 -12
  75. package/dist/presentation/features/hooks/index.js +12 -12
  76. package/dist/presentation/features/hooks/useContractsRegistry.js +12 -12
  77. package/dist/presentation/features/index.js +12 -12
  78. package/dist/presentation/features/organisms/FeatureDataViewsList.js +12 -12
  79. package/dist/presentation/features/organisms/FeatureEventsList.js +12 -12
  80. package/dist/presentation/features/organisms/FeatureFormsList.js +12 -12
  81. package/dist/presentation/features/organisms/FeaturePresentationsList.js +12 -12
  82. package/dist/presentation/features/organisms/index.js +12 -12
  83. package/dist/presentation/features/templates/FeatureDataViewsTemplate/FeatureDataViewsTemplate.js +12 -12
  84. package/dist/presentation/features/templates/FeatureDataViewsTemplate/index.js +12 -12
  85. package/dist/presentation/features/templates/FeatureEventsTemplate/FeatureEventsTemplate.js +12 -12
  86. package/dist/presentation/features/templates/FeatureEventsTemplate/index.js +12 -12
  87. package/dist/presentation/features/templates/FeatureFormsTemplate/FeatureFormsTemplate.js +12 -12
  88. package/dist/presentation/features/templates/FeatureFormsTemplate/index.js +12 -12
  89. package/dist/presentation/features/templates/FeaturePresentationsTemplate/FeaturePresentationsTemplate.js +12 -12
  90. package/dist/presentation/features/templates/FeaturePresentationsTemplate/index.js +12 -12
  91. package/package.json +108 -23
  92. package/src/application/mcp/common.test.ts +64 -0
  93. package/src/application/mcp/common.ts +5 -2
  94. package/src/application/mcp/docsMcp.catalog.ts +2 -0
  95. package/src/application/mcp/docsMcp.data.ts +196 -0
  96. package/src/application/mcp/docsMcp.prompts.ts +165 -0
  97. package/src/application/mcp/docsMcp.reference.ts +152 -0
  98. package/src/application/mcp/docsMcp.resources.ts +194 -0
  99. package/src/application/mcp/docsMcp.test.ts +148 -0
  100. package/src/application/mcp/docsMcp.tools.ts +183 -0
  101. package/src/application/mcp/docsMcp.ts +13 -177
  102. package/src/application/mcp/normalizeMcpRequest.ts +30 -0
  103. package/src/components/docs/generated/docs-index._common.json +1 -1
  104. package/src/components/docs/generated/docs-index.ai-chat-assistant.json +8 -0
  105. package/src/components/docs/generated/docs-index.artisan-knowledge-product.json +18 -0
  106. package/src/components/docs/generated/docs-index.artisan-payments-stripe.json +34 -0
  107. package/src/components/docs/generated/docs-index.data-grid-showcase.json +18 -0
  108. package/src/components/docs/generated/docs-index.generated.ts +6 -6
  109. package/src/components/docs/generated/docs-index.harness-lab.json +10 -0
  110. package/src/components/docs/generated/docs-index.locale-jurisdiction-gate.json +8 -0
  111. package/src/components/docs/generated/docs-index.manifest.json +50 -5
  112. package/src/components/docs/generated/docs-index.messaging-agent-actions.json +18 -0
  113. package/src/components/docs/generated/docs-index.mobile-demo-tasks.json +34 -0
  114. package/src/components/docs/generated/docs-index.opencode-cli.json +2 -2
  115. package/src/components/docs/generated/docs-index.platform-control-plane.json +250 -0
  116. package/src/components/docs/generated/docs-index.platform-harness.json +178 -0
  117. package/src/components/docs/generated/docs-index.platform-integrations.json +22 -14
  118. package/src/components/docs/generated/docs-index.visualization-showcase.json +18 -0
  119. package/src/components/docs/libraries/LibrariesAiAgentPage.tsx +20 -17
  120. package/src/components/docs/libraries/LibrariesSupportBotPage.tsx +1 -2
  121. package/src/components/templates/engine/index.ts +2 -2
@@ -26,6 +26,25 @@ var authLogger = new Logger({
26
26
  enableContext: true,
27
27
  enableColors: false
28
28
  });
29
+ // src/application/mcp/normalizeMcpRequest.ts
30
+ var REQUIRED_ACCEPT_TYPES = ["application/json", "text/event-stream"];
31
+ function canNormalizeAcceptHeader(acceptHeader) {
32
+ return !acceptHeader || acceptHeader.includes("*/*") || acceptHeader.includes("application/*") || REQUIRED_ACCEPT_TYPES.some((value) => acceptHeader.includes(value));
33
+ }
34
+ function normalizeMcpRequest(request) {
35
+ if (request.method !== "POST")
36
+ return request;
37
+ const acceptHeader = request.headers.get("accept");
38
+ if (!canNormalizeAcceptHeader(acceptHeader))
39
+ return request;
40
+ const missingTypes = REQUIRED_ACCEPT_TYPES.filter((value) => !acceptHeader?.includes(value));
41
+ if (missingTypes.length === 0)
42
+ return request;
43
+ const headers = new Headers(request.headers);
44
+ headers.set("accept", [acceptHeader, ...missingTypes].filter(Boolean).join(", "));
45
+ return new Request(request, { headers });
46
+ }
47
+
29
48
  // src/application/mcp/common.ts
30
49
  import { randomUUID } from "crypto";
31
50
  import { createMcpServer } from "@contractspec/lib.contracts-runtime-server-mcp/provider-mcp";
@@ -121,7 +140,7 @@ function createMcpElysiaHandler({
121
140
  stateful: false
122
141
  });
123
142
  try {
124
- return await state.transport.handleRequest(request);
143
+ return await state.transport.handleRequest(normalizeMcpRequest(request));
125
144
  } finally {
126
145
  await closeSessionState(state);
127
146
  }
@@ -157,7 +176,7 @@ function createMcpElysiaHandler({
157
176
  createdState = true;
158
177
  }
159
178
  try {
160
- const response = await state.transport.handleRequest(request);
179
+ const response = await state.transport.handleRequest(normalizeMcpRequest(request));
161
180
  const activeSessionId = state.transport.sessionId;
162
181
  if (activeSessionId && !sessions.has(activeSessionId)) {
163
182
  sessions.set(activeSessionId, state);
@@ -0,0 +1 @@
1
+ export declare function normalizeMcpRequest(request: Request): Request;
@@ -0,0 +1,22 @@
1
+ // @bun
2
+ // src/application/mcp/normalizeMcpRequest.ts
3
+ var REQUIRED_ACCEPT_TYPES = ["application/json", "text/event-stream"];
4
+ function canNormalizeAcceptHeader(acceptHeader) {
5
+ return !acceptHeader || acceptHeader.includes("*/*") || acceptHeader.includes("application/*") || REQUIRED_ACCEPT_TYPES.some((value) => acceptHeader.includes(value));
6
+ }
7
+ function normalizeMcpRequest(request) {
8
+ if (request.method !== "POST")
9
+ return request;
10
+ const acceptHeader = request.headers.get("accept");
11
+ if (!canNormalizeAcceptHeader(acceptHeader))
12
+ return request;
13
+ const missingTypes = REQUIRED_ACCEPT_TYPES.filter((value) => !acceptHeader?.includes(value));
14
+ if (missingTypes.length === 0)
15
+ return request;
16
+ const headers = new Headers(request.headers);
17
+ headers.set("accept", [acceptHeader, ...missingTypes].filter(Boolean).join(", "));
18
+ return new Request(request, { headers });
19
+ }
20
+ export {
21
+ normalizeMcpRequest
22
+ };
@@ -26,6 +26,25 @@ var authLogger = new Logger({
26
26
  enableContext: true,
27
27
  enableColors: false
28
28
  });
29
+ // src/application/mcp/normalizeMcpRequest.ts
30
+ var REQUIRED_ACCEPT_TYPES = ["application/json", "text/event-stream"];
31
+ function canNormalizeAcceptHeader(acceptHeader) {
32
+ return !acceptHeader || acceptHeader.includes("*/*") || acceptHeader.includes("application/*") || REQUIRED_ACCEPT_TYPES.some((value) => acceptHeader.includes(value));
33
+ }
34
+ function normalizeMcpRequest(request) {
35
+ if (request.method !== "POST")
36
+ return request;
37
+ const acceptHeader = request.headers.get("accept");
38
+ if (!canNormalizeAcceptHeader(acceptHeader))
39
+ return request;
40
+ const missingTypes = REQUIRED_ACCEPT_TYPES.filter((value) => !acceptHeader?.includes(value));
41
+ if (missingTypes.length === 0)
42
+ return request;
43
+ const headers = new Headers(request.headers);
44
+ headers.set("accept", [acceptHeader, ...missingTypes].filter(Boolean).join(", "));
45
+ return new Request(request, { headers });
46
+ }
47
+
29
48
  // src/application/mcp/common.ts
30
49
  import { randomUUID } from "crypto";
31
50
  import { createMcpServer } from "@contractspec/lib.contracts-runtime-server-mcp/provider-mcp";
@@ -121,7 +140,7 @@ function createMcpElysiaHandler({
121
140
  stateful: false
122
141
  });
123
142
  try {
124
- return await state.transport.handleRequest(request);
143
+ return await state.transport.handleRequest(normalizeMcpRequest(request));
125
144
  } finally {
126
145
  await closeSessionState(state);
127
146
  }
@@ -157,7 +176,7 @@ function createMcpElysiaHandler({
157
176
  createdState = true;
158
177
  }
159
178
  try {
160
- const response = await state.transport.handleRequest(request);
179
+ const response = await state.transport.handleRequest(normalizeMcpRequest(request));
161
180
  const activeSessionId = state.transport.sessionId;
162
181
  if (activeSessionId && !sessions.has(activeSessionId)) {
163
182
  sessions.set(activeSessionId, state);
@@ -1,5 +1,5 @@
1
1
  export type DocsIndexSource = 'generated' | 'docblock';
2
- export interface DocsIndexEntry {
2
+ export type DocsIndexEntry = {
3
3
  id: string;
4
4
  title: string;
5
5
  summary?: string;
@@ -11,17 +11,17 @@ export interface DocsIndexEntry {
11
11
  visibility?: string;
12
12
  version?: string;
13
13
  owners?: string[];
14
- }
15
- export interface DocsIndexChunk {
14
+ };
15
+ export type DocsIndexChunk = {
16
16
  key: string;
17
17
  file: string;
18
18
  total: number;
19
- }
20
- export interface DocsIndexManifest {
19
+ };
20
+ export type DocsIndexManifest = {
21
21
  generatedAt: string;
22
22
  total: number;
23
23
  version: string | null;
24
24
  contentRoot: string | null;
25
25
  chunks: DocsIndexChunk[];
26
- }
26
+ };
27
27
  export declare const DOCS_INDEX_MANIFEST = "docs-index.manifest.json";
@@ -19320,10 +19320,17 @@ function LibrariesAiAgentPage() {
19320
19320
  }),
19321
19321
  /* @__PURE__ */ jsx76(CodeBlock35, {
19322
19322
  language: "typescript",
19323
- code: `import { defineAgent, AgentRegistry } from '@contractspec/lib.ai-agent';
19323
+ code: `import { defineAgent, AgentRegistry } from '@contractspec/lib.contracts-spec/agent';
19324
19324
 
19325
19325
  const SupportBot = defineAgent({
19326
- meta: { name: 'support.bot', version: '1.0.0' },
19326
+ meta: {
19327
+ key: 'support.bot',
19328
+ version: '1.0.0',
19329
+ description: 'Resolve tickets and escalate low-confidence decisions.',
19330
+ owners: ['support'],
19331
+ tags: ['support'],
19332
+ stability: 'experimental',
19333
+ },
19327
19334
  instructions: 'Resolve tickets. Escalate when confidence < 0.75.',
19328
19335
  tools: [{ name: 'support_resolve_ticket' }],
19329
19336
  policy: {
@@ -19345,19 +19352,17 @@ const registry = new AgentRegistry().register(SupportBot);`
19345
19352
  }),
19346
19353
  /* @__PURE__ */ jsx76(CodeBlock35, {
19347
19354
  language: "typescript",
19348
- code: `import { AgentRunner, ToolExecutor, ApprovalWorkflow } from '@contractspec/lib.ai-agent';
19355
+ code: `import { createUnifiedAgent, ApprovalWorkflow } from '@contractspec/lib.ai-agent';
19349
19356
 
19350
- const runner = new AgentRunner({
19351
- registry,
19352
- llm: mistralProvider,
19353
- toolExecutor: new ToolExecutor({ tools: supportTools }),
19354
- approvalWorkflow: new ApprovalWorkflow(),
19357
+ const approvals = new ApprovalWorkflow();
19358
+ const agent = createUnifiedAgent(SupportBot, {
19359
+ backend: 'ai-sdk',
19360
+ tools: new Map([['support_resolve_ticket', async (input) => resolveTicket(input)]]),
19355
19361
  });
19356
19362
 
19357
- const result = await runner.run({ agent: 'support.bot', input: ticket.body });
19358
- if (result.approvalRequestId) {
19359
- // show in ApprovalQueue UI
19360
- }`
19363
+ const result = await agent.run(ticket.body);
19364
+ // Route low-confidence or manual-review flows through approvals when needed.
19365
+ `
19361
19366
  })
19362
19367
  ]
19363
19368
  }),
@@ -19374,26 +19379,21 @@ if (result.approvalRequestId) {
19374
19379
  /* @__PURE__ */ jsxs76("li", {
19375
19380
  children: [
19376
19381
  /* @__PURE__ */ jsx76("code", {
19377
- children: "defineAgent"
19382
+ children: "createUnifiedAgent"
19378
19383
  }),
19379
19384
  ", ",
19380
19385
  /* @__PURE__ */ jsx76("code", {
19381
- children: "AgentRegistry"
19386
+ children: "ContractSpecAgent"
19382
19387
  }),
19383
19388
  ",",
19384
19389
  " ",
19385
19390
  /* @__PURE__ */ jsx76("code", {
19386
- children: "AgentRunner"
19391
+ children: "UnifiedAgent"
19387
19392
  })
19388
19393
  ]
19389
19394
  }),
19390
- /* @__PURE__ */ jsxs76("li", {
19391
- children: [
19392
- /* @__PURE__ */ jsx76("code", {
19393
- children: "ToolExecutor"
19394
- }),
19395
- " with schema-enforced tool definitions"
19396
- ]
19395
+ /* @__PURE__ */ jsx76("li", {
19396
+ children: "MCP, operation-backed, memory, and subagent tool adapters"
19397
19397
  }),
19398
19398
  /* @__PURE__ */ jsxs76("li", {
19399
19399
  children: [
@@ -22935,10 +22935,9 @@ const draft = await responder.draft(ticket, resolution, classification);`
22935
22935
  /* @__PURE__ */ jsx97(CodeBlock55, {
22936
22936
  language: "typescript",
22937
22937
  code: `import { createSupportTools } from '@contractspec/lib.support-bot/bot';
22938
- import { ToolExecutor } from '@contractspec/lib.ai-agent';
22939
22938
 
22940
22939
  const tools = createSupportTools({ resolver, classifier, responder });
22941
- const executor = new ToolExecutor({ tools });`
22940
+ // Pass these tools into your host runtime or agent adapter.`
22942
22941
  })
22943
22942
  ]
22944
22943
  }),
@@ -42,10 +42,17 @@ function LibrariesAiAgentPage() {
42
42
  }),
43
43
  /* @__PURE__ */ jsx(CodeBlock, {
44
44
  language: "typescript",
45
- code: `import { defineAgent, AgentRegistry } from '@contractspec/lib.ai-agent';
45
+ code: `import { defineAgent, AgentRegistry } from '@contractspec/lib.contracts-spec/agent';
46
46
 
47
47
  const SupportBot = defineAgent({
48
- meta: { name: 'support.bot', version: '1.0.0' },
48
+ meta: {
49
+ key: 'support.bot',
50
+ version: '1.0.0',
51
+ description: 'Resolve tickets and escalate low-confidence decisions.',
52
+ owners: ['support'],
53
+ tags: ['support'],
54
+ stability: 'experimental',
55
+ },
49
56
  instructions: 'Resolve tickets. Escalate when confidence < 0.75.',
50
57
  tools: [{ name: 'support_resolve_ticket' }],
51
58
  policy: {
@@ -67,19 +74,17 @@ const registry = new AgentRegistry().register(SupportBot);`
67
74
  }),
68
75
  /* @__PURE__ */ jsx(CodeBlock, {
69
76
  language: "typescript",
70
- code: `import { AgentRunner, ToolExecutor, ApprovalWorkflow } from '@contractspec/lib.ai-agent';
77
+ code: `import { createUnifiedAgent, ApprovalWorkflow } from '@contractspec/lib.ai-agent';
71
78
 
72
- const runner = new AgentRunner({
73
- registry,
74
- llm: mistralProvider,
75
- toolExecutor: new ToolExecutor({ tools: supportTools }),
76
- approvalWorkflow: new ApprovalWorkflow(),
79
+ const approvals = new ApprovalWorkflow();
80
+ const agent = createUnifiedAgent(SupportBot, {
81
+ backend: 'ai-sdk',
82
+ tools: new Map([['support_resolve_ticket', async (input) => resolveTicket(input)]]),
77
83
  });
78
84
 
79
- const result = await runner.run({ agent: 'support.bot', input: ticket.body });
80
- if (result.approvalRequestId) {
81
- // show in ApprovalQueue UI
82
- }`
85
+ const result = await agent.run(ticket.body);
86
+ // Route low-confidence or manual-review flows through approvals when needed.
87
+ `
83
88
  })
84
89
  ]
85
90
  }),
@@ -96,26 +101,21 @@ if (result.approvalRequestId) {
96
101
  /* @__PURE__ */ jsxs("li", {
97
102
  children: [
98
103
  /* @__PURE__ */ jsx("code", {
99
- children: "defineAgent"
104
+ children: "createUnifiedAgent"
100
105
  }),
101
106
  ", ",
102
107
  /* @__PURE__ */ jsx("code", {
103
- children: "AgentRegistry"
108
+ children: "ContractSpecAgent"
104
109
  }),
105
110
  ",",
106
111
  " ",
107
112
  /* @__PURE__ */ jsx("code", {
108
- children: "AgentRunner"
113
+ children: "UnifiedAgent"
109
114
  })
110
115
  ]
111
116
  }),
112
- /* @__PURE__ */ jsxs("li", {
113
- children: [
114
- /* @__PURE__ */ jsx("code", {
115
- children: "ToolExecutor"
116
- }),
117
- " with schema-enforced tool definitions"
118
- ]
117
+ /* @__PURE__ */ jsx("li", {
118
+ children: "MCP, operation-backed, memory, and subagent tool adapters"
119
119
  }),
120
120
  /* @__PURE__ */ jsxs("li", {
121
121
  children: [
@@ -64,10 +64,9 @@ const draft = await responder.draft(ticket, resolution, classification);`
64
64
  /* @__PURE__ */ jsx(CodeBlock, {
65
65
  language: "typescript",
66
66
  code: `import { createSupportTools } from '@contractspec/lib.support-bot/bot';
67
- import { ToolExecutor } from '@contractspec/lib.ai-agent';
68
67
 
69
68
  const tools = createSupportTools({ resolver, classifier, responder });
70
- const executor = new ToolExecutor({ tools });`
69
+ // Pass these tools into your host runtime or agent adapter.`
71
70
  })
72
71
  ]
73
72
  }),
@@ -267,10 +267,17 @@ function LibrariesAiAgentPage() {
267
267
  }),
268
268
  /* @__PURE__ */ jsx2(CodeBlock2, {
269
269
  language: "typescript",
270
- code: `import { defineAgent, AgentRegistry } from '@contractspec/lib.ai-agent';
270
+ code: `import { defineAgent, AgentRegistry } from '@contractspec/lib.contracts-spec/agent';
271
271
 
272
272
  const SupportBot = defineAgent({
273
- meta: { name: 'support.bot', version: '1.0.0' },
273
+ meta: {
274
+ key: 'support.bot',
275
+ version: '1.0.0',
276
+ description: 'Resolve tickets and escalate low-confidence decisions.',
277
+ owners: ['support'],
278
+ tags: ['support'],
279
+ stability: 'experimental',
280
+ },
274
281
  instructions: 'Resolve tickets. Escalate when confidence < 0.75.',
275
282
  tools: [{ name: 'support_resolve_ticket' }],
276
283
  policy: {
@@ -292,19 +299,17 @@ const registry = new AgentRegistry().register(SupportBot);`
292
299
  }),
293
300
  /* @__PURE__ */ jsx2(CodeBlock2, {
294
301
  language: "typescript",
295
- code: `import { AgentRunner, ToolExecutor, ApprovalWorkflow } from '@contractspec/lib.ai-agent';
302
+ code: `import { createUnifiedAgent, ApprovalWorkflow } from '@contractspec/lib.ai-agent';
296
303
 
297
- const runner = new AgentRunner({
298
- registry,
299
- llm: mistralProvider,
300
- toolExecutor: new ToolExecutor({ tools: supportTools }),
301
- approvalWorkflow: new ApprovalWorkflow(),
304
+ const approvals = new ApprovalWorkflow();
305
+ const agent = createUnifiedAgent(SupportBot, {
306
+ backend: 'ai-sdk',
307
+ tools: new Map([['support_resolve_ticket', async (input) => resolveTicket(input)]]),
302
308
  });
303
309
 
304
- const result = await runner.run({ agent: 'support.bot', input: ticket.body });
305
- if (result.approvalRequestId) {
306
- // show in ApprovalQueue UI
307
- }`
310
+ const result = await agent.run(ticket.body);
311
+ // Route low-confidence or manual-review flows through approvals when needed.
312
+ `
308
313
  })
309
314
  ]
310
315
  }),
@@ -321,26 +326,21 @@ if (result.approvalRequestId) {
321
326
  /* @__PURE__ */ jsxs2("li", {
322
327
  children: [
323
328
  /* @__PURE__ */ jsx2("code", {
324
- children: "defineAgent"
329
+ children: "createUnifiedAgent"
325
330
  }),
326
331
  ", ",
327
332
  /* @__PURE__ */ jsx2("code", {
328
- children: "AgentRegistry"
333
+ children: "ContractSpecAgent"
329
334
  }),
330
335
  ",",
331
336
  " ",
332
337
  /* @__PURE__ */ jsx2("code", {
333
- children: "AgentRunner"
338
+ children: "UnifiedAgent"
334
339
  })
335
340
  ]
336
341
  }),
337
- /* @__PURE__ */ jsxs2("li", {
338
- children: [
339
- /* @__PURE__ */ jsx2("code", {
340
- children: "ToolExecutor"
341
- }),
342
- " with schema-enforced tool definitions"
343
- ]
342
+ /* @__PURE__ */ jsx2("li", {
343
+ children: "MCP, operation-backed, memory, and subagent tool adapters"
344
344
  }),
345
345
  /* @__PURE__ */ jsxs2("li", {
346
346
  children: [
@@ -3882,10 +3882,9 @@ const draft = await responder.draft(ticket, resolution, classification);`
3882
3882
  /* @__PURE__ */ jsx23(CodeBlock22, {
3883
3883
  language: "typescript",
3884
3884
  code: `import { createSupportTools } from '@contractspec/lib.support-bot/bot';
3885
- import { ToolExecutor } from '@contractspec/lib.ai-agent';
3886
3885
 
3887
3886
  const tools = createSupportTools({ resolver, classifier, responder });
3888
- const executor = new ToolExecutor({ tools });`
3887
+ // Pass these tools into your host runtime or agent adapter.`
3889
3888
  })
3890
3889
  ]
3891
3890
  }),
@@ -9,8 +9,8 @@
9
9
  * Import presentations dynamically or use the main templates/engine.ts
10
10
  * which handles the build order correctly.
11
11
  */
12
+ import { TransformEngine } from '@contractspec/lib.contracts-runtime-client-react/transform-engine';
12
13
  import type { PresentationSpec } from '@contractspec/lib.contracts-spec/presentations';
13
- import { TransformEngine } from '@contractspec/lib.contracts-spec/presentations/transform-engine';
14
14
  /**
15
15
  * Create a configured TransformEngine for template rendering
16
16
  */
@@ -4,7 +4,7 @@ import {
4
4
  createDefaultTransformEngine,
5
5
  registerBasicValidation,
6
6
  registerDefaultReactRenderer
7
- } from "@contractspec/lib.contracts-spec/presentations/transform-engine";
7
+ } from "@contractspec/lib.contracts-runtime-client-react/transform-engine";
8
8
  function createTemplateTransformEngine() {
9
9
  const engine = createDefaultTransformEngine();
10
10
  registerDefaultReactRenderer(engine);
@@ -1,13 +1,4 @@
1
1
  // @bun
2
- // src/features/docs/docs.contracts.ts
3
- import {
4
- ContractReferenceQuery,
5
- DocSummaryModel,
6
- DocsIndexInput,
7
- DocsIndexOutput,
8
- DocsIndexQuery,
9
- DocsIndexQuery as DocsIndexQuery2
10
- } from "@contractspec/lib.contracts-spec/docs";
11
2
  // src/features/contracts-registry.ts
12
3
  import {
13
4
  EventRegistry,
@@ -18,11 +9,11 @@ import {
18
9
  } from "@contractspec/lib.contracts-spec/data-views";
19
10
  import {
20
11
  ContractReferenceDataView,
21
- ContractReferenceQuery as ContractReferenceQuery2,
12
+ ContractReferenceQuery,
22
13
  DocsGenerateCommand,
23
14
  DocsGeneratedEvent,
24
15
  DocsIndexDataView,
25
- DocsIndexQuery as DocsIndexQuery3,
16
+ DocsIndexQuery,
26
17
  DocsLayoutPresentation,
27
18
  DocsPublishCommand,
28
19
  DocsPublishedEvent,
@@ -44,7 +35,7 @@ import {
44
35
  var operationRegistry = null;
45
36
  function createContractSpecOperationRegistry() {
46
37
  const registry = new OperationSpecRegistry;
47
- registry.register(DocsIndexQuery3).register(ContractReferenceQuery2).register(DocsGenerateCommand).register(DocsPublishCommand);
38
+ registry.register(DocsIndexQuery).register(ContractReferenceQuery).register(DocsGenerateCommand).register(DocsPublishCommand);
48
39
  return registry;
49
40
  }
50
41
  function getContractSpecOperationRegistry() {
@@ -190,6 +181,15 @@ var DocsFeature = {
190
181
  }
191
182
  };
192
183
 
184
+ // src/features/docs/docs.contracts.ts
185
+ import {
186
+ ContractReferenceQuery as ContractReferenceQuery2,
187
+ DocSummaryModel,
188
+ DocsIndexInput,
189
+ DocsIndexOutput,
190
+ DocsIndexQuery as DocsIndexQuery2,
191
+ DocsIndexQuery as DocsIndexQuery3
192
+ } from "@contractspec/lib.contracts-spec/docs";
193
193
  // src/features/mcp.feature.ts
194
194
  var MCPFeature = {
195
195
  meta: {
@@ -297,7 +297,7 @@ export {
297
297
  getContractSpecFeatureRegistry,
298
298
  getContractSpecEventRegistry,
299
299
  getContractSpecDataViewRegistry,
300
- DocsIndexQuery as docsSearchSpec,
300
+ DocsIndexQuery2 as docsSearchSpec,
301
301
  createContractSpecPresentationRegistry,
302
302
  createContractSpecOperationRegistry,
303
303
  createContractSpecFormRegistry,
@@ -307,10 +307,10 @@ export {
307
307
  PresentationsFeature,
308
308
  MCPFeature,
309
309
  FeatureRegistry2 as FeatureRegistry,
310
- DocsIndexQuery2 as DocsIndexQuery,
310
+ DocsIndexQuery3 as DocsIndexQuery,
311
311
  DocsFeature,
312
312
  DocSummaryModel,
313
313
  DocsIndexOutput as DocSearchOutput,
314
314
  DocsIndexInput as DocSearchInput,
315
- ContractReferenceQuery
315
+ ContractReferenceQuery2 as ContractReferenceQuery
316
316
  };