Skip to content

Commit 772a87a

Browse files
os-zhuangclaude
andcommitted
docs(generator): fix reference $ref links and opaque Object types; re-arm link CI
The 243 generated reference pages carried ~92 links to a page that never existed (`[__schema0](./__schema0)`), 6 self-links to `(./#)`, and every inline object rendered as an opaque `Object`. Root causes, all in build-docs.ts: - `formatType` turned `$ref` into `./<schemaName>`, but pages are named after the *zod file* — so no `$ref` link could ever resolve. Named refs now resolve through the schemaCategoryMap/schemaZodFileMap that scanCategories() already built (dead code until now) to `/docs/references/<category>/<file>#<schema>`, and fall back to plain text rather than a 404 when no page exists. - `__schemaN` refs are Zod-hoisted inline schemas with no page at all; they are now expanded structurally, with a cycle guard (these schemas are recursive — a node contains nodes — and naive inlining blows the stack). - `$ref: "#"` (self-reference) now links to the section's own anchor. - Inline objects render their shape one level deep (`{ label: string; value: string; color?: string; … }`) instead of `Object`; const variants render their literal, so discriminated unions read as `'a' | 'b'` rather than `Object | Object`. - JSDoc `{@link ../automation/sync.zod.ts}` linked to a repo path that 404s on the site; source paths now rewrite to their docs route, and a bare `@see` renders as "See also:" prose instead of a stray tag. Counts after regenerating: __schemaN links 92 → 0, (./#) 6 → 0, zod.ts links → 0. Re-arms the link CI, which is why this drifted: check-links.yml had its push/pull_request triggers commented out, leaving only manual dispatch. It now runs on PRs touching content/, scoped by paths so unrelated PRs don't pay for it. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent 26e82b3 commit 772a87a

187 files changed

Lines changed: 2404 additions & 2273 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/check-links.yml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,14 @@ name: Check Links
22

33
on:
44
workflow_dispatch:
5-
# push:
6-
# branches:
7-
# - main
8-
# pull_request:
9-
# branches:
10-
# - main
5+
pull_request:
6+
branches:
7+
- main
8+
paths:
9+
- 'content/**'
10+
- 'README.md'
11+
- 'lychee.toml'
12+
- '.github/workflows/check-links.yml'
1113

1214
jobs:
1315
link-checker:

content/docs/references/ai/agent.mdx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -74,22 +74,22 @@ const result = AIKnowledge.parse(data);
7474
| **avatar** | `string` | optional | |
7575
| **role** | `string` || The persona/role (e.g. "Senior Support Engineer") |
7676
| **instructions** | `string` || System Prompt / Prime Directives |
77-
| **model** | `Object` | optional | |
78-
| **lifecycle** | `Object` | optional | State machine defining the agent conversation follow and constraints |
77+
| **model** | `{ provider: Enum<'openai' \| 'azure_openai' \| 'anthropic' \| 'local'>; model: string; temperature: number; maxTokens?: number; … }` | optional | |
78+
| **lifecycle** | `{ id: string; description?: string; contextSchema?: Record<string, any>; initial: string; … }` | optional | State machine defining the agent conversation follow and constraints |
7979
| **surface** | `Enum<'ask' \| 'build'>` || Product surface this agent binds ('ask' \| 'build') — ADR-0063 §1 |
8080
| **skills** | `string[]` | optional | Skill names to attach (Agent→Skill→Tool architecture) |
81-
| **tools** | `Object[]` | optional | Direct tool references (legacy fallback) |
82-
| **knowledge** | `Object` | optional | RAG access |
81+
| **tools** | `{ type: Enum<'action' \| 'flow' \| 'query' \| 'vector_search'>; name: string; description?: string }[]` | optional | Direct tool references (legacy fallback) |
82+
| **knowledge** | `{ topics: string[]; indexes: string[] }` | optional | RAG access |
8383
| **active** | `boolean` || |
8484
| **access** | `string[]` | optional | Who can chat with this agent |
8585
| **permissions** | `string[]` | optional | Required permission-set capabilities |
8686
| **tenantId** | `string` | optional | Tenant/Organization ID |
8787
| **visibility** | `Enum<'global' \| 'organization' \| 'private'>` || [EXPERIMENTAL — NOT ENFORCED, #1901] Intended listing scope. No runtime consumer yet; use access/permissions for real gating. |
88-
| **planning** | `Object` | optional | Autonomous reasoning and planning configuration |
89-
| **memory** | `Object` | optional | Agent memory management |
90-
| **guardrails** | `Object` | optional | Safety guardrails for the agent |
91-
| **structuredOutput** | `Object` | optional | Structured output format and validation configuration |
92-
| **protection** | `Object` | optional | Package author protection block — lock policy for this agent. |
88+
| **planning** | `{ strategy: Enum<'react' \| 'plan_and_execute' \| 'reflexion' \| 'tree_of_thought'>; maxIterations: integer; allowReplan: boolean }` | optional | Autonomous reasoning and planning configuration |
89+
| **memory** | `{ longTerm?: object; reflectionInterval?: integer }` | optional | Agent memory management |
90+
| **guardrails** | `{ maxTokensPerInvocation?: integer; maxExecutionTimeSec?: integer; blockedTopics?: string[] }` | optional | Safety guardrails for the agent |
91+
| **structuredOutput** | `{ format: Enum<'json_object' \| 'json_schema' \| 'regex' \| 'grammar' \| 'xml'>; schema?: Record<string, any>; strict: boolean; retryOnValidationFailure: boolean; … }` | optional | Structured output format and validation configuration |
92+
| **protection** | `{ lock: Enum<'none' \| 'no-overlay' \| 'no-delete' \| 'full'>; reason: string; docsUrl?: string }` | optional | Package author protection block — lock policy for this agent. |
9393
| **_lock** | `Enum<'none' \| 'no-overlay' \| 'no-delete' \| 'full'>` | optional | Item-level lock — controls overlay & delete (ADR-0010). |
9494
| **_lockReason** | `string` | optional | Human-readable reason shown when a write is refused by _lock. |
9595
| **_lockSource** | `Enum<'artifact' \| 'package' \| 'env-forced'>` | optional | Layer that set _lock (artifact \| package \| env-forced). |

content/docs/references/ai/conversation.mdx

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ const result = CodeContent.parse(data);
3333

3434
| Property | Type | Required | Description |
3535
| :--- | :--- | :--- | :--- |
36-
| **type** | `string` || |
36+
| **type** | `'code'` || |
3737
| **text** | `string` || Code snippet |
3838
| **language** | `string` || |
3939
| **metadata** | `Record<string, any>` | optional | |
@@ -93,12 +93,12 @@ const result = CodeContent.parse(data);
9393
| **id** | `string` || Unique message ID |
9494
| **timestamp** | `string` || ISO 8601 timestamp |
9595
| **role** | `Enum<'system' \| 'user' \| 'assistant' \| 'function' \| 'tool'>` || |
96-
| **content** | `Object \| Object \| Object \| Object[]` || Message content (multimodal array) |
97-
| **functionCall** | `Object` | optional | Legacy function call |
98-
| **toolCalls** | `Object[]` | optional | Tool calls |
96+
| **content** | `{ type: 'text'; text: string; metadata?: Record<string, any> } \| { type: 'image'; imageUrl: string; detail: Enum<'low' \| 'high' \| 'auto'>; metadata?: Record<string, any> } \| { type: 'file'; fileUrl: string; mimeType: string; fileName?: string; … } \| { type: 'code'; text: string; language: string; metadata?: Record<string, any> }[]` || Message content (multimodal array) |
97+
| **functionCall** | `{ name: string; arguments: string; result?: string }` | optional | Legacy function call |
98+
| **toolCalls** | `{ id: string; type: Enum<'function'>; function: object }[]` | optional | Tool calls |
9999
| **toolCallId** | `string` | optional | Tool call ID this message responds to |
100100
| **name** | `string` | optional | Name of the function/user |
101-
| **tokens** | `Object` | optional | Token usage for this message |
101+
| **tokens** | `{ promptTokens: integer; completionTokens: integer; totalTokens: integer }` | optional | Token usage for this message |
102102
| **cost** | `number` | optional | Cost for this message in USD |
103103
| **pinned** | `boolean` || Prevent removal during pruning |
104104
| **importance** | `number` | optional | Importance score for pruning |
@@ -116,12 +116,12 @@ const result = CodeContent.parse(data);
116116
| :--- | :--- | :--- | :--- |
117117
| **id** | `string` || Unique session ID |
118118
| **name** | `string` | optional | Session name/title |
119-
| **context** | `Object` || |
119+
| **context** | `{ sessionId: string; userId?: string; agentId?: string; object?: string; … }` || |
120120
| **modelId** | `string` | optional | AI model ID |
121-
| **tokenBudget** | `Object` || |
122-
| **messages** | `Object[]` || |
123-
| **tokens** | `Object` | optional | |
124-
| **totalTokens** | `Object` | optional | Total tokens across all messages |
121+
| **tokenBudget** | `{ maxTokens: integer; maxPromptTokens?: integer; maxCompletionTokens?: integer; reserveTokens: integer; … }` || |
122+
| **messages** | `{ id: string; timestamp: string; role: Enum<'system' \| 'user' \| 'assistant' \| 'function' \| 'tool'>; content: { type: 'text'; text: string; metadata?: Record<string, any> } \| { type: 'image'; imageUrl: string; detail: Enum<'low' \| 'high' \| 'auto'>; metadata?: Record<string, any> } \| { type: 'file'; fileUrl: string; mimeType: string; fileName?: string; … } \| { type: 'code'; text: string; language: string; metadata?: Record<string, any> }[]; … }[]` || |
123+
| **tokens** | `{ promptTokens: integer; completionTokens: integer; totalTokens: integer; budgetLimit: integer; … }` | optional | |
124+
| **totalTokens** | `{ promptTokens: integer; completionTokens: integer; totalTokens: integer }` | optional | Total tokens across all messages |
125125
| **totalCost** | `number` | optional | Total cost for this session in USD |
126126
| **status** | `Enum<'active' \| 'paused' \| 'completed' \| 'archived'>` || |
127127
| **createdAt** | `string` || ISO 8601 timestamp |
@@ -143,7 +143,7 @@ const result = CodeContent.parse(data);
143143
| **originalTokens** | `integer` || Original token count |
144144
| **summaryTokens** | `integer` || Summary token count |
145145
| **tokensSaved** | `integer` || Tokens saved |
146-
| **messageRange** | `Object` || Range of messages summarized |
146+
| **messageRange** | `{ startIndex: integer; endIndex: integer }` || Range of messages summarized |
147147
| **generatedAt** | `string` || ISO 8601 timestamp |
148148
| **modelId** | `string` | optional | Model used for summarization |
149149

@@ -156,7 +156,7 @@ const result = CodeContent.parse(data);
156156

157157
| Property | Type | Required | Description |
158158
| :--- | :--- | :--- | :--- |
159-
| **type** | `string` || |
159+
| **type** | `'file'` || |
160160
| **fileUrl** | `string` || File attachment URL |
161161
| **mimeType** | `string` || MIME type |
162162
| **fileName** | `string` | optional | |
@@ -184,7 +184,7 @@ const result = CodeContent.parse(data);
184184

185185
| Property | Type | Required | Description |
186186
| :--- | :--- | :--- | :--- |
187-
| **type** | `string` || |
187+
| **type** | `'image'` || |
188188
| **imageUrl** | `string` || Image URL |
189189
| **detail** | `Enum<'low' \| 'high' \| 'auto'>` || |
190190
| **metadata** | `Record<string, any>` | optional | |
@@ -206,7 +206,7 @@ This schema accepts one of the following structures:
206206

207207
| Property | Type | Required | Description |
208208
| :--- | :--- | :--- | :--- |
209-
| **type** | `string` || |
209+
| **type** | `'text'` || |
210210
| **text** | `string` || Text content |
211211
| **metadata** | `Record<string, any>` | optional | |
212212

@@ -220,7 +220,7 @@ This schema accepts one of the following structures:
220220

221221
| Property | Type | Required | Description |
222222
| :--- | :--- | :--- | :--- |
223-
| **type** | `string` || |
223+
| **type** | `'image'` || |
224224
| **imageUrl** | `string` || Image URL |
225225
| **detail** | `Enum<'low' \| 'high' \| 'auto'>` || |
226226
| **metadata** | `Record<string, any>` | optional | |
@@ -235,7 +235,7 @@ This schema accepts one of the following structures:
235235

236236
| Property | Type | Required | Description |
237237
| :--- | :--- | :--- | :--- |
238-
| **type** | `string` || |
238+
| **type** | `'file'` || |
239239
| **fileUrl** | `string` || File attachment URL |
240240
| **mimeType** | `string` || MIME type |
241241
| **fileName** | `string` | optional | |
@@ -251,7 +251,7 @@ This schema accepts one of the following structures:
251251

252252
| Property | Type | Required | Description |
253253
| :--- | :--- | :--- | :--- |
254-
| **type** | `string` || |
254+
| **type** | `'code'` || |
255255
| **text** | `string` || Code snippet |
256256
| **language** | `string` || |
257257
| **metadata** | `Record<string, any>` | optional | |
@@ -281,7 +281,7 @@ This schema accepts one of the following structures:
281281
| Property | Type | Required | Description |
282282
| :--- | :--- | :--- | :--- |
283283
| **timestamp** | `string` || Event timestamp |
284-
| **prunedMessages** | `Object[]` || |
284+
| **prunedMessages** | `{ messageId: string; role: Enum<'system' \| 'user' \| 'assistant' \| 'function' \| 'tool'>; tokens: integer; importance?: number }[]` || |
285285
| **tokensFreed** | `integer` || |
286286
| **messagesRemoved** | `integer` || |
287287
| **remainingTokens** | `integer` || |
@@ -309,7 +309,7 @@ This schema accepts one of the following structures:
309309

310310
| Property | Type | Required | Description |
311311
| :--- | :--- | :--- | :--- |
312-
| **type** | `string` || |
312+
| **type** | `'text'` || |
313313
| **text** | `string` || Text content |
314314
| **metadata** | `Record<string, any>` | optional | |
315315

@@ -380,7 +380,7 @@ This schema accepts one of the following structures:
380380
| :--- | :--- | :--- | :--- |
381381
| **id** | `string` || Tool call ID |
382382
| **type** | `Enum<'function'>` || |
383-
| **function** | `Object` || |
383+
| **function** | `{ name: string; arguments: string; result?: string }` || |
384384

385385

386386
---

content/docs/references/ai/knowledge-source.mdx

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ const result = FileKnowledgeSource.parse(data);
4343

4444
| Property | Type | Required | Description |
4545
| :--- | :--- | :--- | :--- |
46-
| **kind** | `string` || |
46+
| **kind** | `'file'` || |
4747
| **prefix** | `string` || Storage prefix |
4848
| **mimeTypes** | `string[]` | optional | |
4949

@@ -56,7 +56,7 @@ const result = FileKnowledgeSource.parse(data);
5656

5757
| Property | Type | Required | Description |
5858
| :--- | :--- | :--- | :--- |
59-
| **kind** | `string` || |
59+
| **kind** | `'http'` || |
6060
| **urls** | `string[]` || |
6161
| **userAgent** | `string` | optional | |
6262

@@ -86,10 +86,10 @@ const result = FileKnowledgeSource.parse(data);
8686
| **description** | `string` | optional | |
8787
| **adapter** | `string` || Adapter id |
8888
| **adapterConfig** | `Record<string, any>` | optional | |
89-
| **source** | `Object \| Object \| Object` || |
90-
| **embedding** | `Object` | optional | |
91-
| **vectorStore** | `Object` | optional | |
92-
| **refresh** | `Object` | optional | |
89+
| **source** | `{ kind: 'object'; object: string; contentFields: string[]; metadataFields?: string[]; … } \| { kind: 'file'; prefix: string; mimeTypes?: string[] } \| { kind: 'http'; urls: string[]; userAgent?: string }` || |
90+
| **embedding** | `{ provider: Enum<'openai' \| 'cohere' \| 'azure_openai' \| 'huggingface' \| 'local' \| 'custom'>; model: string; dimensions: integer; endpoint?: string; … }` | optional | |
91+
| **vectorStore** | `{ provider: Enum<'pgvector' \| 'chroma' \| 'qdrant' \| 'pinecone' \| 'weaviate' \| 'milvus' \| 'redis' \| 'opensearch' \| 'elasticsearch' \| 'custom'>; collection: string; endpoint?: string; secretRef?: string; … }` | optional | |
92+
| **refresh** | `{ onRecordChange?: boolean; cron?: string }` | optional | |
9393
| **aiExposed** | `boolean` | optional | |
9494

9595

@@ -107,7 +107,7 @@ This schema accepts one of the following structures:
107107

108108
| Property | Type | Required | Description |
109109
| :--- | :--- | :--- | :--- |
110-
| **kind** | `string` || |
110+
| **kind** | `'object'` || |
111111
| **object** | `string` || Short object name to index |
112112
| **contentFields** | `string[]` || Fields contributing to document content |
113113
| **metadataFields** | `string[]` | optional | |
@@ -121,7 +121,7 @@ This schema accepts one of the following structures:
121121

122122
| Property | Type | Required | Description |
123123
| :--- | :--- | :--- | :--- |
124-
| **kind** | `string` || |
124+
| **kind** | `'file'` || |
125125
| **prefix** | `string` || Storage prefix |
126126
| **mimeTypes** | `string[]` | optional | |
127127

@@ -133,7 +133,7 @@ This schema accepts one of the following structures:
133133

134134
| Property | Type | Required | Description |
135135
| :--- | :--- | :--- | :--- |
136-
| **kind** | `string` || |
136+
| **kind** | `'http'` || |
137137
| **urls** | `string[]` || |
138138
| **userAgent** | `string` | optional | |
139139

@@ -148,7 +148,7 @@ This schema accepts one of the following structures:
148148

149149
| Property | Type | Required | Description |
150150
| :--- | :--- | :--- | :--- |
151-
| **kind** | `string` || |
151+
| **kind** | `'object'` || |
152152
| **object** | `string` || Short object name to index |
153153
| **contentFields** | `string[]` || Fields contributing to document content |
154154
| **metadataFields** | `string[]` | optional | |

content/docs/references/ai/mcp.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ server (so an agent can mount its tools).
2323

2424
2. **MCPToolBinding** — how an MCP tool from a referenced server
2525

26-
is exposed as an ObjectStack [AIToolDefinition](AIToolDefinition) (alias,
26+
is exposed as an ObjectStack `AIToolDefinition` (alias,
2727

2828
visibility, approval policy).
2929

0 commit comments

Comments
 (0)