@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
@@ -0,0 +1,183 @@
1
+ import {
2
+ defineCommand,
3
+ defineSchemaModel,
4
+ installOp,
5
+ OperationSpecRegistry,
6
+ } from '@contractspec/lib.contracts-spec';
7
+ import type { DocPresentationRoute } from '@contractspec/lib.contracts-spec/docs';
8
+ import {
9
+ ContractReferenceInput,
10
+ ContractReferenceOutput,
11
+ DocsIndexInput,
12
+ DocsIndexOutput,
13
+ } from '@contractspec/lib.contracts-spec/docs';
14
+ import { ScalarTypeEnum } from '@contractspec/lib.schema';
15
+ import {
16
+ getDocById,
17
+ getDocByRoute,
18
+ listDocFacets,
19
+ searchDocs,
20
+ } from './docsMcp.data';
21
+ import { resolveContractReference } from './docsMcp.reference';
22
+
23
+ const DOC_OWNERS = ['@contractspec'];
24
+ const DOC_TAGS = ['docs', 'mcp'];
25
+
26
+ const DocsGetInput = defineSchemaModel({
27
+ name: 'DocsGetInput',
28
+ fields: {
29
+ id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
30
+ },
31
+ });
32
+
33
+ const DocsGetOutput = defineSchemaModel({
34
+ name: 'DocsGetOutput',
35
+ fields: {
36
+ doc: { type: ScalarTypeEnum.JSON(), isOptional: false },
37
+ content: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
38
+ },
39
+ });
40
+
41
+ const DocsResolveRouteInput = defineSchemaModel({
42
+ name: 'DocsResolveRouteInput',
43
+ fields: {
44
+ route: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
45
+ },
46
+ });
47
+
48
+ const DocsResolveRouteOutput = defineSchemaModel({
49
+ name: 'DocsResolveRouteOutput',
50
+ fields: {
51
+ doc: { type: ScalarTypeEnum.JSON(), isOptional: false },
52
+ content: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
53
+ },
54
+ });
55
+
56
+ const DocsFacetsInput = defineSchemaModel({
57
+ name: 'DocsFacetsInput',
58
+ fields: {},
59
+ });
60
+
61
+ const DocsFacetsOutput = defineSchemaModel({
62
+ name: 'DocsFacetsOutput',
63
+ fields: {
64
+ facets: { type: ScalarTypeEnum.JSON(), isOptional: false },
65
+ },
66
+ });
67
+
68
+ export function buildDocOps(routes: DocPresentationRoute[]) {
69
+ const registry = new OperationSpecRegistry();
70
+
71
+ installOp(
72
+ registry,
73
+ defineCommand({
74
+ meta: {
75
+ key: 'docs.search',
76
+ version: '1.0.0',
77
+ stability: 'beta',
78
+ owners: DOC_OWNERS,
79
+ tags: DOC_TAGS,
80
+ description:
81
+ 'Search ContractSpec docs by query, tag, kind, or visibility.',
82
+ goal: 'Find the most relevant DocBlocks without browsing the full corpus.',
83
+ context: 'Read-only docs MCP search surface.',
84
+ },
85
+ io: { input: DocsIndexInput, output: DocsIndexOutput },
86
+ policy: { auth: 'anonymous' },
87
+ transport: { mcp: { toolName: 'docs_search-v1_0_0' } },
88
+ }),
89
+ async (args) => searchDocs(routes, args)
90
+ );
91
+
92
+ installOp(
93
+ registry,
94
+ defineCommand({
95
+ meta: {
96
+ key: 'docs.get',
97
+ version: '1.0.0',
98
+ stability: 'beta',
99
+ owners: DOC_OWNERS,
100
+ tags: DOC_TAGS,
101
+ description: 'Read a single DocBlock by id.',
102
+ goal: 'Fetch the exact markdown content and metadata for a known doc id.',
103
+ context: 'Read-only docs MCP surface.',
104
+ },
105
+ io: { input: DocsGetInput, output: DocsGetOutput },
106
+ policy: { auth: 'anonymous' },
107
+ transport: { mcp: { toolName: 'docs_get-v1_0_0' } },
108
+ }),
109
+ async ({ id }) => {
110
+ const found = getDocById(id);
111
+ if (!found) throw new Error(`DocBlock not found: ${id}`);
112
+ return found;
113
+ }
114
+ );
115
+
116
+ installOp(
117
+ registry,
118
+ defineCommand({
119
+ meta: {
120
+ key: 'docs.resolveRoute',
121
+ version: '1.0.0',
122
+ stability: 'beta',
123
+ owners: DOC_OWNERS,
124
+ tags: DOC_TAGS,
125
+ description: 'Resolve a docs route to the matching DocBlock.',
126
+ goal: 'Turn a route or URL path into a canonical doc id and markdown body.',
127
+ context: 'Read-only docs MCP surface.',
128
+ },
129
+ io: { input: DocsResolveRouteInput, output: DocsResolveRouteOutput },
130
+ policy: { auth: 'anonymous' },
131
+ transport: { mcp: { toolName: 'docs_resolve_route-v1_0_0' } },
132
+ }),
133
+ async ({ route }) => {
134
+ const found = getDocByRoute(routes, route);
135
+ if (!found) throw new Error(`Doc route not found: ${route}`);
136
+ return found;
137
+ }
138
+ );
139
+
140
+ installOp(
141
+ registry,
142
+ defineCommand({
143
+ meta: {
144
+ key: 'docs.contract.lookup',
145
+ version: '1.0.0',
146
+ stability: 'beta',
147
+ owners: DOC_OWNERS,
148
+ tags: DOC_TAGS,
149
+ description:
150
+ 'Resolve a ContractSpec surface into a docs-ready reference payload.',
151
+ goal: 'Get canonical docs metadata, route, and optional schema for a spec key.',
152
+ context: 'Read-only docs MCP surface.',
153
+ },
154
+ io: { input: ContractReferenceInput, output: ContractReferenceOutput },
155
+ policy: { auth: 'anonymous' },
156
+ transport: { mcp: { toolName: 'docs_contract_reference-v1_0_0' } },
157
+ }),
158
+ async (args) => resolveContractReference(args)
159
+ );
160
+
161
+ installOp(
162
+ registry,
163
+ defineCommand({
164
+ meta: {
165
+ key: 'docs.list.facets',
166
+ version: '1.0.0',
167
+ stability: 'beta',
168
+ owners: DOC_OWNERS,
169
+ tags: DOC_TAGS,
170
+ description:
171
+ 'List docs taxonomy facets such as tags, kinds, and visibilities.',
172
+ goal: 'Help agents browse the docs corpus before making targeted reads.',
173
+ context: 'Read-only docs MCP surface.',
174
+ },
175
+ io: { input: DocsFacetsInput, output: DocsFacetsOutput },
176
+ policy: { auth: 'anonymous' },
177
+ transport: { mcp: { toolName: 'docs_list_facets-v1_0_0' } },
178
+ }),
179
+ async () => ({ facets: listDocFacets(routes) })
180
+ );
181
+
182
+ return registry;
183
+ }
@@ -1,184 +1,18 @@
1
- import {
2
- definePrompt,
3
- defineResourceTemplate,
4
- installOp,
5
- OperationSpecRegistry,
6
- PromptRegistry,
7
- ResourceRegistry,
8
- } from '@contractspec/lib.contracts-spec';
9
- import type { DocPresentationRoute } from '@contractspec/lib.contracts-spec/docs';
10
1
  import { defaultDocRegistry } from '@contractspec/lib.contracts-spec/docs';
11
- import z from 'zod';
12
- import { docsSearchSpec } from '../../features/docs';
13
2
  import { appLogger } from '../../infrastructure/elysia/logger';
14
3
  import { createMcpElysiaHandler } from './common';
4
+ import { buildDocPrompts } from './docsMcp.prompts';
5
+ import { buildDocResources } from './docsMcp.resources';
6
+ import { buildDocOps } from './docsMcp.tools';
15
7
 
16
- const DOC_OWNERS = ['@contractspec'];
17
- const DOC_TAGS = ['docs', 'mcp'];
18
-
19
- function buildDocResources(routes: DocPresentationRoute[]) {
20
- const resources = new ResourceRegistry();
21
-
22
- resources.register(
23
- defineResourceTemplate({
24
- meta: {
25
- uriTemplate: 'docs://list',
26
- title: 'DocBlocks index',
27
- description:
28
- 'All registered DocBlocks with route, visibility, tags, and summary.',
29
- mimeType: 'application/json',
30
- tags: DOC_TAGS,
31
- },
32
- input: z.object({}),
33
- resolve: async () => {
34
- const docs = routes.map(({ block, route }) => ({
35
- id: block.id,
36
- title: block.title,
37
- summary: block.summary ?? '',
38
- tags: block.tags ?? [],
39
- visibility: block.visibility ?? 'public',
40
- route,
41
- }));
42
-
43
- return {
44
- uri: 'docs://list',
45
- mimeType: 'application/json',
46
- data: JSON.stringify(docs, null, 2),
47
- };
48
- },
49
- })
50
- );
51
-
52
- resources.register(
53
- defineResourceTemplate({
54
- meta: {
55
- uriTemplate: 'docs://doc/{id}',
56
- title: 'DocBlock markdown',
57
- description: 'Fetch DocBlock body by id as markdown.',
58
- mimeType: 'text/markdown',
59
- tags: DOC_TAGS,
60
- },
61
- input: z.object({ id: z.string() }),
62
- resolve: async ({ id }) => {
63
- const found = defaultDocRegistry.get(id);
64
- if (!found) {
65
- return {
66
- uri: `docs://doc/${encodeURIComponent(id)}`,
67
- mimeType: 'text/plain',
68
- data: `DocBlock not found: ${id}`,
69
- };
70
- }
71
-
72
- return {
73
- uri: `docs://doc/${encodeURIComponent(id)}`,
74
- mimeType: 'text/markdown',
75
- data: String(found.block.body ?? ''),
76
- };
77
- },
78
- })
79
- );
80
-
81
- return resources;
82
- }
83
-
84
- function buildDocPrompts() {
85
- const prompts = new PromptRegistry();
86
-
87
- prompts.register(
88
- definePrompt({
89
- meta: {
90
- key: 'docs.navigator',
91
- version: '1.0.0',
92
- title: 'Find relevant ContractSpec docs',
93
- description: 'Guide agents to pick the right DocBlock by topic or tag.',
94
- tags: DOC_TAGS,
95
- stability: 'beta',
96
- owners: DOC_OWNERS,
97
- },
98
- args: [
99
- {
100
- name: 'topic',
101
- description: 'Goal or subject to search for.',
102
- required: false,
103
- schema: z.string().optional(),
104
- },
105
- {
106
- name: 'tag',
107
- description: 'Optional tag filter.',
108
- required: false,
109
- schema: z.string().optional(),
110
- },
111
- ],
112
- input: z.object({
113
- topic: z.string().optional(),
114
- tag: z.string().optional(),
115
- }),
116
- render: async ({ topic, tag }) => {
117
- const parts = [
118
- {
119
- type: 'text' as const,
120
- text: `Use the docs index to choose DocBlocks. If a specific topic is provided, prefer docs whose id/title/summary match it.${topic ? ` Topic: ${topic}.` : ''}${tag ? ` Tag: ${tag}.` : ''}`,
121
- },
122
- {
123
- type: 'resource' as const,
124
- uri: 'docs://list',
125
- title: 'DocBlocks index',
126
- },
127
- ];
128
- return parts;
129
- },
130
- })
131
- );
132
-
133
- return prompts;
134
- }
135
-
136
- function buildDocOps(routes: DocPresentationRoute[]) {
137
- const registry = new OperationSpecRegistry();
138
-
139
- // Use the module-level spec from docs.contracts.ts
140
- installOp(registry, docsSearchSpec, async (args) => {
141
- const query = args.query?.toLowerCase().trim();
142
- const tagsFilter = args.tag?.map((t) => t.toLowerCase().trim()) ?? [];
143
- const visibility = args.visibility?.toLowerCase().trim();
144
-
145
- const docs = routes
146
- .map(({ block, route }) => ({
147
- id: block.id,
148
- title: block.title,
149
- summary: block.summary ?? '',
150
- tags: block.tags ?? [],
151
- visibility: (block.visibility ?? 'public').toLowerCase(),
152
- route,
153
- }))
154
- .filter((doc) => {
155
- const matchesQuery = query
156
- ? doc.id.toLowerCase().includes(query) ||
157
- doc.title.toLowerCase().includes(query) ||
158
- doc.summary.toLowerCase().includes(query)
159
- : true;
160
- const matchesTags = tagsFilter.length
161
- ? tagsFilter.every((t) =>
162
- doc.tags.some((tag) => tag.toLowerCase().includes(t))
163
- )
164
- : true;
165
- const matchesVisibility = visibility
166
- ? doc.visibility === visibility
167
- : true;
168
- return matchesQuery && matchesTags && matchesVisibility;
169
- });
170
-
171
- return {
172
- docs,
173
- items: docs,
174
- total: docs.length,
175
- };
176
- });
177
-
178
- return registry;
8
+ interface DocsMcpHandlerOptions {
9
+ includePresentations?: boolean;
179
10
  }
180
11
 
181
- export function createDocsMcpHandler(path = '/api/mcp/docs') {
12
+ export function createDocsMcpHandler(
13
+ path = '/api/mcp/docs',
14
+ options: DocsMcpHandlerOptions = {}
15
+ ) {
182
16
  const routes = defaultDocRegistry.list();
183
17
 
184
18
  return createMcpElysiaHandler({
@@ -187,7 +21,9 @@ export function createDocsMcpHandler(path = '/api/mcp/docs') {
187
21
  serverName: 'contractspec-docs-mcp',
188
22
  ops: buildDocOps(routes),
189
23
  resources: buildDocResources(routes),
190
- prompts: buildDocPrompts(),
191
- presentations: routes.map(({ descriptor }) => descriptor),
24
+ prompts: buildDocPrompts(routes),
25
+ presentations: options.includePresentations
26
+ ? routes.map(({ descriptor }) => descriptor)
27
+ : undefined,
192
28
  });
193
29
  }
@@ -0,0 +1,30 @@
1
+ const REQUIRED_ACCEPT_TYPES = ['application/json', 'text/event-stream'];
2
+
3
+ function canNormalizeAcceptHeader(acceptHeader: string | null) {
4
+ return (
5
+ !acceptHeader ||
6
+ acceptHeader.includes('*/*') ||
7
+ acceptHeader.includes('application/*') ||
8
+ REQUIRED_ACCEPT_TYPES.some((value) => acceptHeader.includes(value))
9
+ );
10
+ }
11
+
12
+ export function normalizeMcpRequest(request: Request) {
13
+ if (request.method !== 'POST') return request;
14
+
15
+ const acceptHeader = request.headers.get('accept');
16
+ if (!canNormalizeAcceptHeader(acceptHeader)) return request;
17
+
18
+ const missingTypes = REQUIRED_ACCEPT_TYPES.filter(
19
+ (value) => !acceptHeader?.includes(value)
20
+ );
21
+ if (missingTypes.length === 0) return request;
22
+
23
+ const headers = new Headers(request.headers);
24
+ headers.set(
25
+ 'accept',
26
+ [acceptHeader, ...missingTypes].filter(Boolean).join(', ')
27
+ );
28
+
29
+ return new Request(request, { headers });
30
+ }
@@ -1399,7 +1399,7 @@
1399
1399
  {
1400
1400
  "id": "docs.tech.presentation-runtime",
1401
1401
  "title": "Presentation Runtime",
1402
- "summary": "Cross-platform runtime for list pages and presentation flows.",
1402
+ "summary": "Cross-platform runtime for list pages, presentation flows, and headless ContractSpec tables.",
1403
1403
  "route": "/docs/tech/presentation-runtime",
1404
1404
  "source": "docblock",
1405
1405
  "contentPath": "docblocks/docs/tech/presentation-runtime.md",
@@ -1,4 +1,12 @@
1
1
  [
2
+ {
3
+ "id": "ai-chat-assistant/ai-chat-assistant",
4
+ "title": "ai-chat-assistant",
5
+ "summary": "Focused assistant example with chat UX and search-backed retrieval.\n- **Type**: feature\n- **Version**: 1.0.0\n- **Stability**: beta\n- **Owners**: @platform.core\n- **Tags**: ai, chat, assistant, example\n- **File**: `packages/examples/ai-chat-assistant/src/ai-chat-assistant.feature.ts`",
6
+ "route": "/docs/reference/ai-chat-assistant/ai-chat-assistant",
7
+ "source": "generated",
8
+ "contentPath": "ai-chat-assistant/ai-chat-assistant.md"
9
+ },
2
10
  {
3
11
  "id": "ai-chat-assistant/assistant.search",
4
12
  "title": "assistant.search",
@@ -0,0 +1,18 @@
1
+ [
2
+ {
3
+ "id": "artisan.knowledge.product/artisan.knowledge.product",
4
+ "title": "artisan.knowledge.product",
5
+ "summary": "Blueprint that surfaces canonical product knowledge to agents and workflows.\n- **Type**: app-config (app-config)\n- **Version**: 1.0.0\n- **Tags**: knowledge, product-canon\n- **File**: `packages/examples/knowledge-canon/src/blueprint.ts`",
6
+ "route": "/docs/reference/artisan.knowledge.product/artisan.knowledge.product",
7
+ "source": "generated",
8
+ "contentPath": "artisan.knowledge.product/artisan.knowledge.product.md"
9
+ },
10
+ {
11
+ "id": "artisan.knowledge.product/knowledge-canon",
12
+ "title": "knowledge-canon",
13
+ "summary": "Curated product knowledge space with blueprint, tenant config, and FAQ workflow\n- **Type**: feature\n- **Version**: 1.0.0\n- **Stability**: experimental\n- **Owners**: @examples\n- **Tags**: knowledge, canon, faq",
14
+ "route": "/docs/reference/artisan.knowledge.product/knowledge-canon",
15
+ "source": "generated",
16
+ "contentPath": "artisan.knowledge.product/knowledge-canon.md"
17
+ }
18
+ ]
@@ -0,0 +1,34 @@
1
+ [
2
+ {
3
+ "id": "artisan.payments.stripe/artisan.payments.stripe",
4
+ "title": "artisan.payments.stripe",
5
+ "summary": "Blueprint enabling card payments for ArtisanOS merchants via the Stripe integration.\n- **Type**: app-config (app-config)\n- **Version**: 1.0.0\n- **Tags**: stripe, payments\n- **File**: `packages/examples/integration-stripe/src/blueprint.ts`",
6
+ "route": "/docs/reference/artisan.payments.stripe/artisan.payments.stripe",
7
+ "source": "generated",
8
+ "contentPath": "artisan.payments.stripe/artisan.payments.stripe.md"
9
+ },
10
+ {
11
+ "id": "artisan.payments.stripe/integration-stripe",
12
+ "title": "integration-stripe",
13
+ "summary": "Stripe payments integration with blueprint, workflow, and tenant configuration\n- **Type**: feature\n- **Version**: 1.0.0\n- **Stability**: experimental\n- **Owners**: @integration-team\n- **Tags**: integration, stripe, payments",
14
+ "route": "/docs/reference/artisan.payments.stripe/integration-stripe",
15
+ "source": "generated",
16
+ "contentPath": "artisan.payments.stripe/integration-stripe.md"
17
+ },
18
+ {
19
+ "id": "artisan.payments.stripe/integration-stripe.integration.psp",
20
+ "title": "integration-stripe.integration.psp",
21
+ "summary": "Integration contract for managed or BYOK Stripe card processing.\n- **Type**: integration (integration)\n- **Version**: 1.0.0\n- **Tags**: stripe, payments\n- **File**: `packages/examples/integration-stripe/src/integration.ts`",
22
+ "route": "/docs/reference/artisan.payments.stripe/integration-stripe.integration.psp",
23
+ "source": "generated",
24
+ "contentPath": "artisan.payments.stripe/integration-stripe.integration.psp.md"
25
+ },
26
+ {
27
+ "id": "artisan.payments.stripe/integration-stripe.workflow.payment",
28
+ "title": "integration-stripe.workflow.payment",
29
+ "summary": "Charge a customer using the tenant Stripe connection and record settlement details.\n- **Type**: workflow (workflow)\n- **Version**: 1.0.0\n- **Tags**: stripe\n- **File**: `packages/examples/integration-stripe/src/workflow.ts`",
30
+ "route": "/docs/reference/artisan.payments.stripe/integration-stripe.workflow.payment",
31
+ "source": "generated",
32
+ "contentPath": "artisan.payments.stripe/integration-stripe.workflow.payment.md"
33
+ }
34
+ ]
@@ -0,0 +1,18 @@
1
+ [
2
+ {
3
+ "id": "data-grid-showcase/data-grid-showcase",
4
+ "title": "data-grid-showcase",
5
+ "summary": "Focused ContractSpec table example covering client mode, server mode, and DataView adapter paths.\n- **Type**: feature\n- **Version**: 1.0.0\n- **Stability**: experimental\n- **Owners**: @platform.core\n- **Tags**: table, data-grid, ui, tanstack",
6
+ "route": "/docs/reference/data-grid-showcase/data-grid-showcase",
7
+ "source": "generated",
8
+ "contentPath": "data-grid-showcase/data-grid-showcase.md"
9
+ },
10
+ {
11
+ "id": "data-grid-showcase/examples.data-grid-showcase.rows.list",
12
+ "title": "examples.data-grid-showcase.rows.list",
13
+ "summary": "Lists the demo rows used by the data-grid showcase.\n- **Type**: operation (query)\n- **Version**: 1.0.0\n- **Stability**: experimental\n- **Owners**: @platform.core\n- **Tags**: examples, table, data-grid\n- **File**: `packages/examples/data-grid-showcase/src/contracts/data-grid-showcase.operation.ts`",
14
+ "route": "/docs/reference/data-grid-showcase/examples.data-grid-showcase.rows.list",
15
+ "source": "generated",
16
+ "contentPath": "data-grid-showcase/examples.data-grid-showcase.rows.list.md"
17
+ }
18
+ ]
@@ -1,6 +1,6 @@
1
1
  export type DocsIndexSource = 'generated' | 'docblock';
2
2
 
3
- export interface DocsIndexEntry {
3
+ export type DocsIndexEntry = {
4
4
  id: string;
5
5
  title: string;
6
6
  summary?: string;
@@ -12,20 +12,20 @@ export interface DocsIndexEntry {
12
12
  visibility?: string;
13
13
  version?: string;
14
14
  owners?: string[];
15
- }
15
+ };
16
16
 
17
- export interface DocsIndexChunk {
17
+ export type DocsIndexChunk = {
18
18
  key: string;
19
19
  file: string;
20
20
  total: number;
21
- }
21
+ };
22
22
 
23
- export interface DocsIndexManifest {
23
+ export type DocsIndexManifest = {
24
24
  generatedAt: string;
25
25
  total: number;
26
26
  version: string | null;
27
27
  contentRoot: string | null;
28
28
  chunks: DocsIndexChunk[];
29
- }
29
+ };
30
30
 
31
31
  export const DOCS_INDEX_MANIFEST = 'docs-index.manifest.json';
@@ -0,0 +1,10 @@
1
+ [
2
+ {
3
+ "id": "harness-lab/harness-lab",
4
+ "title": "harness-lab",
5
+ "summary": "Focused harness example for deterministic sandbox and browser evaluation flows.\n- **Type**: feature\n- **Version**: 1.0.0\n- **Stability**: experimental\n- **Owners**: @examples\n- **Tags**: harness, runtime, evaluation",
6
+ "route": "/docs/reference/harness-lab/harness-lab",
7
+ "source": "generated",
8
+ "contentPath": "harness-lab/harness-lab.md"
9
+ }
10
+ ]
@@ -46,5 +46,13 @@
46
46
  "route": "/docs/reference/locale-jurisdiction-gate/locale-jurisdiction-gate",
47
47
  "source": "generated",
48
48
  "contentPath": "locale-jurisdiction-gate/locale-jurisdiction-gate.md"
49
+ },
50
+ {
51
+ "id": "locale-jurisdiction-gate/locale-jurisdiction-gate.policy.gate",
52
+ "title": "locale-jurisdiction-gate.policy.gate",
53
+ "summary": "Requires explicit locale, jurisdiction, knowledge snapshot, and allowed scope before assistant requests may proceed.\n- **Type**: policy (policy)\n- **Version**: 1.0.0\n- **Tags**: assistant, policy, jurisdiction",
54
+ "route": "/docs/reference/locale-jurisdiction-gate/locale-jurisdiction-gate.policy.gate",
55
+ "source": "generated",
56
+ "contentPath": "locale-jurisdiction-gate/locale-jurisdiction-gate.policy.gate.md"
49
57
  }
50
58
  ]