skrypt-ai 0.3.4 → 0.4.1

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 (95) hide show
  1. package/README.md +1 -1
  2. package/dist/auth/index.d.ts +0 -1
  3. package/dist/auth/index.js +3 -5
  4. package/dist/autofix/index.js +15 -3
  5. package/dist/cli.js +19 -4
  6. package/dist/commands/check-links.js +164 -174
  7. package/dist/commands/deploy.js +5 -2
  8. package/dist/commands/generate.js +206 -199
  9. package/dist/commands/i18n.js +3 -20
  10. package/dist/commands/init.js +47 -40
  11. package/dist/commands/lint.js +3 -20
  12. package/dist/commands/mcp.js +125 -122
  13. package/dist/commands/monitor.js +125 -108
  14. package/dist/commands/review-pr.js +1 -1
  15. package/dist/commands/sdk.js +1 -1
  16. package/dist/config/loader.js +21 -2
  17. package/dist/generator/organizer.d.ts +3 -0
  18. package/dist/generator/organizer.js +4 -9
  19. package/dist/generator/writer.js +2 -10
  20. package/dist/github/pr-comments.js +21 -8
  21. package/dist/plugins/index.js +1 -0
  22. package/dist/scanner/index.js +8 -2
  23. package/dist/template/docs.json +2 -1
  24. package/dist/template/next.config.mjs +2 -1
  25. package/dist/template/package.json +17 -15
  26. package/dist/template/public/favicon.svg +4 -0
  27. package/dist/template/public/search-index.json +1 -1
  28. package/dist/template/scripts/build-search-index.mjs +120 -25
  29. package/dist/template/src/app/api/chat/route.ts +11 -3
  30. package/dist/template/src/app/docs/README.md +28 -0
  31. package/dist/template/src/app/docs/[...slug]/page.tsx +139 -16
  32. package/dist/template/src/app/docs/auth/page.mdx +589 -0
  33. package/dist/template/src/app/docs/autofix/page.mdx +624 -0
  34. package/dist/template/src/app/docs/cli/page.mdx +217 -0
  35. package/dist/template/src/app/docs/config/page.mdx +428 -0
  36. package/dist/template/src/app/docs/configuration/page.mdx +86 -0
  37. package/dist/template/src/app/docs/deployment/page.mdx +112 -0
  38. package/dist/template/src/app/docs/error.tsx +20 -0
  39. package/dist/template/src/app/docs/generator/generator.md +504 -0
  40. package/dist/template/src/app/docs/generator/organizer.md +779 -0
  41. package/dist/template/src/app/docs/generator/page.mdx +613 -0
  42. package/dist/template/src/app/docs/github/page.mdx +502 -0
  43. package/dist/template/src/app/docs/llm/anthropic-client.md +549 -0
  44. package/dist/template/src/app/docs/llm/index.md +471 -0
  45. package/dist/template/src/app/docs/llm/page.mdx +428 -0
  46. package/dist/template/src/app/docs/llms-full.md +256 -0
  47. package/dist/template/src/app/docs/llms.txt +2971 -0
  48. package/dist/template/src/app/docs/not-found.tsx +23 -0
  49. package/dist/template/src/app/docs/page.mdx +0 -3
  50. package/dist/template/src/app/docs/plugins/page.mdx +1793 -0
  51. package/dist/template/src/app/docs/pro/page.mdx +121 -0
  52. package/dist/template/src/app/docs/quickstart/page.mdx +93 -0
  53. package/dist/template/src/app/docs/scanner/content-type.md +599 -0
  54. package/dist/template/src/app/docs/scanner/index.md +212 -0
  55. package/dist/template/src/app/docs/scanner/page.mdx +307 -0
  56. package/dist/template/src/app/docs/scanner/python.md +469 -0
  57. package/dist/template/src/app/docs/scanner/python_parser.md +1056 -0
  58. package/dist/template/src/app/docs/scanner/rust.md +325 -0
  59. package/dist/template/src/app/docs/scanner/typescript.md +201 -0
  60. package/dist/template/src/app/error.tsx +3 -3
  61. package/dist/template/src/app/icon.tsx +29 -0
  62. package/dist/template/src/app/layout.tsx +42 -0
  63. package/dist/template/src/app/not-found.tsx +35 -0
  64. package/dist/template/src/app/page.tsx +62 -28
  65. package/dist/template/src/components/ai-chat.tsx +26 -21
  66. package/dist/template/src/components/breadcrumbs.tsx +46 -2
  67. package/dist/template/src/components/copy-button.tsx +17 -3
  68. package/dist/template/src/components/docs-layout.tsx +142 -8
  69. package/dist/template/src/components/feedback.tsx +4 -2
  70. package/dist/template/src/components/footer.tsx +42 -0
  71. package/dist/template/src/components/header.tsx +29 -5
  72. package/dist/template/src/components/mdx/accordion.tsx +7 -6
  73. package/dist/template/src/components/mdx/card.tsx +19 -7
  74. package/dist/template/src/components/mdx/code-block.tsx +17 -3
  75. package/dist/template/src/components/mdx/code-group.tsx +65 -18
  76. package/dist/template/src/components/mdx/code-playground.tsx +3 -0
  77. package/dist/template/src/components/mdx/go-playground.tsx +3 -0
  78. package/dist/template/src/components/mdx/highlighted-code.tsx +171 -76
  79. package/dist/template/src/components/mdx/python-playground.tsx +2 -0
  80. package/dist/template/src/components/mdx/tabs.tsx +74 -6
  81. package/dist/template/src/components/page-header.tsx +19 -0
  82. package/dist/template/src/components/scroll-to-top.tsx +33 -0
  83. package/dist/template/src/components/search-dialog.tsx +206 -52
  84. package/dist/template/src/components/sidebar.tsx +136 -77
  85. package/dist/template/src/components/table-of-contents.tsx +23 -7
  86. package/dist/template/src/lib/highlight.ts +90 -31
  87. package/dist/template/src/lib/search.ts +14 -4
  88. package/dist/template/src/lib/theme-utils.ts +140 -0
  89. package/dist/template/src/styles/globals.css +307 -166
  90. package/dist/template/src/types/remark-gfm.d.ts +2 -0
  91. package/dist/utils/files.d.ts +9 -0
  92. package/dist/utils/files.js +33 -0
  93. package/dist/utils/validation.d.ts +4 -0
  94. package/dist/utils/validation.js +38 -0
  95. package/package.json +1 -4
@@ -0,0 +1,428 @@
1
+ ## Classes
2
+
3
+ ### `OpenAICompatibleClient`
4
+
5
+ ```typescript
6
+ class OpenAICompatibleClient implements LLMClient
7
+ ```
8
+
9
+ Use this to connect to any OpenAI-compatible LLM provider — including OpenAI, DeepSeek, Ollama, OpenRouter, and Google Gemini — through a single unified client interface.
10
+
11
+ `OpenAICompatibleClient` normalizes provider differences (base URLs, auth headers, retry logic) so you can swap providers without changing your application code.
12
+
13
+ ## Constructor Config
14
+
15
+ | Name | Type | Required | Description |
16
+ |------|------|----------|-------------|
17
+ | `provider` | `LLMProvider` | ✅ | Provider identifier (e.g. `'openai'`, `'deepseek'`, `'ollama'`, `'openrouter'`, `'gemini'`) |
18
+ | `model` | `string` | ✅ | Model name to use (e.g. `'gpt-4o'`, `'deepseek-chat'`, `'llama3'`) |
19
+ | `apiKey` | `string` | ✅ | API key for the provider (use `'ollama'` or any placeholder for local providers) |
20
+ | `maxRetries` | `number` | ❌ | Number of retry attempts on failure. Defaults to `3` |
21
+
22
+ ## Methods
23
+
24
+ ### `complete(request: CompletionRequest): Promise<CompletionResponse>`
25
+
26
+ Sends a completion request to the configured provider.
27
+
28
+ | Name | Type | Required | Description |
29
+ |------|------|----------|-------------|
30
+ | `request.messages` | `Message[]` | ✅ | Array of `{ role: 'system' \| 'user' \| 'assistant', content: string }` |
31
+ | `request.temperature` | `number` | ❌ | Sampling temperature (0–2). Lower = more deterministic |
32
+ | `request.maxTokens` | `number` | ❌ | Maximum tokens in the response |
33
+ | `request.stream` | `boolean` | ❌ | Enable streaming responses |
34
+
35
+ #### Returns
36
+
37
+ A `CompletionResponse` object:
38
+
39
+ | Field | Type | Description |
40
+ |-------|------|-------------|
41
+ | `content` | `string` | The generated text response |
42
+ | `usage.promptTokens` | `number` | Tokens consumed by the input |
43
+ | `usage.completionTokens` | `number` | Tokens consumed by the output |
44
+ | `usage.totalTokens` | `number` | Total tokens used |
45
+
46
+ ## Provider Quick Reference
47
+
48
+ | Provider | `provider` value | Notes |
49
+ |----------|-----------------|-------|
50
+ | OpenAI | `'openai'` | Requires OpenAI API key |
51
+ | DeepSeek | `'deepseek'` | Requires DeepSeek API key |
52
+ | Ollama | `'ollama'` | Local — no API key needed |
53
+ | OpenRouter | `'openrouter'` | Routes to many models |
54
+ | Google Gemini | `'gemini'` | Requires Google API key |
55
+
56
+ ### Methods
57
+
58
+ #### `constructor`
59
+
60
+ ```typescript
61
+ constructor(config: LLMClientConfig)
62
+ ```
63
+
64
+ Use this to create a unified LLM client that connects to any OpenAI-compatible API provider (OpenAI, Anthropic, Mistral, local models, etc.) with automatic retry logic and provider-specific configuration.
65
+
66
+ #### Parameters
67
+
68
+ | Name | Type | Required | Description |
69
+ |------|------|----------|-------------|
70
+ | `config` | `LLMClientConfig` | Yes | Configuration object for the LLM client |
71
+ | `config.provider` | `LLMProvider` | Yes | The LLM provider identifier (e.g., `'openai'`, `'mistral'`, `'anthropic'`) |
72
+ | `config.model` | `string` | Yes | The model name to use for completions (e.g., `'gpt-4o'`, `'mistral-large'`) |
73
+ | `config.baseUrl` | `string` | No | Override the default base URL for the provider's API endpoint |
74
+ | `config.maxRetries` | `number` | No | Number of retry attempts on failure. Defaults to `3` |
75
+ | `config.apiKey` | `string` | Yes | API key for authenticating with the provider |
76
+
77
+ #### Returns
78
+
79
+ An `OpenAICompatibleClient` instance with:
80
+ - `provider` — the configured provider identifier (publicly accessible)
81
+ - Access to completion methods using the specified model and retry settings
82
+
83
+ ## Notes
84
+
85
+ - If `config.baseUrl` is omitted, the client automatically resolves the correct endpoint from a built-in provider URL map
86
+ - If `config.maxRetries` is omitted, it defaults to `3`
87
+ - The underlying HTTP client is an `OpenAI` SDK instance, making this compatible with any provider that follows the OpenAI API spec
88
+
89
+ **Example:**
90
+
91
+ ```typescript example.ts
92
+ // ── Inline types (no external imports needed) ──────────────────────────────
93
+
94
+ type LLMProvider = 'openai' | 'mistral' | 'anthropic' | 'local'
95
+
96
+ interface LLMClientConfig {
97
+ provider: LLMProvider
98
+ model: string
99
+ apiKey: string
100
+ baseUrl?: string
101
+ maxRetries?: number
102
+ }
103
+
104
+ const PROVIDER_BASE_URLS: Record<LLMProvider, string> = {
105
+ openai: 'https://api.openai.com/v1',
106
+ mistral: 'https://api.mistral.ai/v1',
107
+ anthropic: 'https://api.anthropic.com/v1',
108
+ local: 'http://localhost:11434/v1',
109
+ }
110
+
111
+ // ── Simulated OpenAICompatibleClient class ─────────────────────────────────
112
+
113
+ class OpenAICompatibleClient {
114
+ provider: LLMProvider
115
+ private model: string
116
+ private maxRetries: number
117
+ private baseUrl: string
118
+ private apiKey: string
119
+
120
+ constructor(config: LLMClientConfig) {
121
+ this.provider = config.provider
122
+ this.model = config.model
123
+ this.maxRetries = config.maxRetries ?? 3
124
+ this.baseUrl = config.baseUrl || PROVIDER_BASE_URLS[config.provider]
125
+ this.apiKey = config.apiKey
126
+
127
+ console.log(`[OpenAICompatibleClient] Initialized`)
128
+ console.log(` Provider : ${this.provider}`)
129
+ console.log(` Model : ${this.model}`)
130
+ console.log(` Base URL : ${this.baseUrl}`)
131
+ console.log(` MaxRetries: ${this.maxRetries}`)
132
+ }
133
+
134
+ async complete(prompt: string): Promise<{ text: string; model: string }> {
135
+ console.log(`\n[OpenAICompatibleClient] Sending prompt to ${this.provider}...`)
136
+ // Simulated response — replace with real HTTP call in production
137
+ return {
138
+ text: `Echo from ${this.model}: "${prompt}"`,
139
+ model: this.model,
140
+ }
141
+ }
142
+ }
143
+
144
+ // ── Usage examples ─────────────────────────────────────────────────────────
145
+
146
+ async function main() {
147
+ try {
148
+ // Example 1: Connect to OpenAI with default settings
149
+ const openaiClient = new OpenAICompatibleClient({
150
+ provider: 'openai',
151
+ model: 'gpt-4o',
152
+ apiKey: process.env.OPENAI_API_KEY || 'sk-your-openai-key-here',
153
+ })
154
+
155
+ const openaiResult = await openaiClient.complete('Summarize the water cycle.')
156
+ console.log('\nOpenAI result:', openaiResult)
157
+ // Output: { text: 'Echo from gpt-4o: "Summarize the water cycle."', model: 'gpt-4o' }
158
+
159
+ // Example 2: Connect to a local Ollama instance with custom base URL
160
+ const localClient = new OpenAICompatibleClient({
161
+ provider: 'local',
162
+ model: 'llama3',
163
+ apiKey: 'not-required-for-local',
164
+ baseUrl: 'http://localhost:11434/v1', // override default
165
+ maxRetries: 1, // fewer retries for local dev
166
+ })
167
+
168
+ const localResult = await localClient.complete('What is 2 + 2?')
169
+ console.log('\nLocal model result:', localResult)
170
+ // Output: { text: 'Echo from llama3: "What is 2 + 2?"', model: 'llama3' }
171
+
172
+ // Example 3: Connect to Mistral with default retry count (3)
173
+ const mistralClient = new OpenAICompatibleClient({
174
+ provider: 'mistral',
175
+ model: 'mistral-large-latest',
176
+ apiKey: process.env.MISTRAL_API_KEY || 'your-mistral-key-here',
177
+ })
178
+
179
+ console.log(`\nMistral provider: ${mistralClient.provider}`)
180
+ // Output: Mistral provider: mistral
181
+
182
+ } catch (error) {
183
+ console.error('Failed to initialize or call LLM client:', error)
184
+ }
185
+ }
186
+
187
+ main()
188
+ ```
189
+
190
+ #### `isConfigured`
191
+
192
+ ```typescript
193
+ isConfigured(): boolean
194
+ ```
195
+
196
+ Use this to verify that an `OpenAICompatibleClient` instance is ready to make API calls before attempting completions.
197
+
198
+ This method acts as a readiness check — it always returns `true` because the underlying OpenAI SDK handles API key validation and configuration errors at request time rather than at initialization. Use it in guard clauses or health checks to follow a consistent "is configured?" pattern across multiple LLM client types.
199
+
200
+ #### Returns
201
+
202
+ | Condition | Value |
203
+ |-----------|-------|
204
+ | Always | `true` — configuration validation is delegated to the OpenAI SDK |
205
+
206
+ > **Note:** A `true` return does **not** guarantee the API key is valid or that the endpoint is reachable. It only confirms the client object was constructed. Actual credential errors surface when calling `complete()`.
207
+
208
+ **Example:**
209
+
210
+ ```typescript example.ts
211
+ // Inline types to simulate the OpenAICompatibleClient behavior
212
+ type LLMProvider = 'openai' | 'azure' | 'groq' | 'custom'
213
+
214
+ interface LLMClientConfig {
215
+ apiKey: string
216
+ provider: LLMProvider
217
+ model?: string
218
+ baseURL?: string
219
+ }
220
+
221
+ // Simulated OpenAICompatibleClient
222
+ class OpenAICompatibleClient {
223
+ private apiKey: string
224
+ private provider: LLMProvider
225
+ private model: string
226
+
227
+ constructor(config: LLMClientConfig) {
228
+ this.apiKey = config.apiKey
229
+ this.provider = config.provider
230
+ this.model = config.model || 'gpt-4o'
231
+ }
232
+
233
+ // OpenAI SDK handles validation — always returns true
234
+ isConfigured(): boolean {
235
+ return true
236
+ }
237
+ }
238
+
239
+ // --- Usage Example ---
240
+
241
+ const client = new OpenAICompatibleClient({
242
+ apiKey: process.env.OPENAI_API_KEY || 'sk-proj-abc123xyz',
243
+ provider: 'openai',
244
+ model: 'gpt-4o',
245
+ })
246
+
247
+ // Guard clause pattern: check before proceeding
248
+ function runCompletion(client: OpenAICompatibleClient, prompt: string) {
249
+ if (!client.isConfigured()) {
250
+ console.error('Client is not configured. Aborting.')
251
+ return
252
+ }
253
+
254
+ console.log(`Client is configured: ${client.isConfigured()}`)
255
+ // Output: Client is configured: true
256
+
257
+ console.log(`Proceeding with prompt: "${prompt}"`)
258
+ // In real usage, you would call: await client.complete({ prompt })
259
+ }
260
+
261
+ runCompletion(client, 'Summarize the latest AI research trends.')
262
+
263
+ // Multi-client health check pattern
264
+ const clients = [
265
+ new OpenAICompatibleClient({ apiKey: 'sk-groq-key-001', provider: 'groq', model: 'llama3-8b-8192' }),
266
+ new OpenAICompatibleClient({ apiKey: 'sk-azure-key-002', provider: 'azure', model: 'gpt-4' }),
267
+ ]
268
+
269
+ const allReady = clients.every(c => c.isConfigured())
270
+ console.log(`All clients ready: ${allReady}`)
271
+ // Output: All clients ready: true
272
+ ```
273
+
274
+ #### `complete`
275
+
276
+ ```typescript
277
+ async complete(request: CompletionRequest): Promise<CompletionResponse>
278
+ ```
279
+
280
+ Use this to send a chat completion request to any OpenAI-compatible API endpoint (OpenAI, Azure, Groq, Together AI, etc.) and receive a structured response with the generated text and token usage.
281
+
282
+ #### Parameters
283
+
284
+ | Name | Type | Required | Description |
285
+ |------|------|----------|-------------|
286
+ | `request` | `CompletionRequest` | Yes | The completion request object containing messages, model, and generation settings |
287
+ | `request.messages` | `Array<{role: string, content: string}>` | Yes | Conversation history as an array of role/content message objects |
288
+ | `request.model` | `string` | No | Model identifier to use (e.g. `"gpt-4o"`, `"llama-3-8b"`). Falls back to the client's default model if omitted |
289
+ | `request.temperature` | `number` | No | Sampling temperature between 0–2. Lower = more deterministic, higher = more creative |
290
+ | `request.maxTokens` | `number` | No | Maximum number of tokens to generate in the response |
291
+ | `request.systemPrompt` | `string` | No | System-level instruction prepended to the conversation |
292
+
293
+ #### Returns
294
+
295
+ Returns a `Promise<CompletionResponse>` that resolves to:
296
+
297
+ | Field | Type | Description |
298
+ |-------|------|-------------|
299
+ | `content` | `string` | The generated text from the model |
300
+ | `model` | `string` | The model that was actually used to generate the response |
301
+ | `usage.promptTokens` | `number` | Number of tokens consumed by the input messages |
302
+ | `usage.completionTokens` | `number` | Number of tokens in the generated response |
303
+ | `usage.totalTokens` | `number` | Total tokens used (prompt + completion) |
304
+
305
+ Throws an error if the API request fails, the model is unavailable, or the API key is invalid.
306
+
307
+ **Example:**
308
+
309
+ ```typescript example.ts
310
+ // ── Inline types (no external imports needed) ──────────────────────────────
311
+
312
+ type Message = { role: 'system' | 'user' | 'assistant'; content: string }
313
+
314
+ type CompletionRequest = {
315
+ messages: Message[]
316
+ model?: string
317
+ temperature?: number
318
+ maxTokens?: number
319
+ systemPrompt?: string
320
+ }
321
+
322
+ type CompletionResponse = {
323
+ content: string
324
+ model: string
325
+ usage: {
326
+ promptTokens: number
327
+ completionTokens: number
328
+ totalTokens: number
329
+ }
330
+ }
331
+
332
+ // ── Minimal OpenAI-compatible client (self-contained simulation) ───────────
333
+
334
+ class OpenAICompatibleClient {
335
+ private apiKey: string
336
+ private baseURL: string
337
+ private model: string
338
+
339
+ constructor(config: { apiKey: string; baseURL?: string; model?: string }) {
340
+ this.apiKey = config.apiKey
341
+ this.baseURL = config.baseURL || 'https://api.openai.com/v1'
342
+ this.model = config.model || 'gpt-4o'
343
+ }
344
+
345
+ async complete(request: CompletionRequest): Promise<CompletionResponse> {
346
+ const model = request.model || this.model
347
+
348
+ const messages: Message[] = []
349
+
350
+ if (request.systemPrompt) {
351
+ messages.push({ role: 'system', content: request.systemPrompt })
352
+ }
353
+ messages.push(...request.messages)
354
+
355
+ const body = {
356
+ model,
357
+ messages,
358
+ ...(request.temperature !== undefined && { temperature: request.temperature }),
359
+ ...(request.maxTokens !== undefined && { max_tokens: request.maxTokens }),
360
+ }
361
+
362
+ const response = await fetch(`${this.baseURL}/chat/completions`, {
363
+ method: 'POST',
364
+ headers: {
365
+ 'Content-Type': 'application/json',
366
+ Authorization: `Bearer ${this.apiKey}`,
367
+ },
368
+ body: JSON.stringify(body),
369
+ })
370
+
371
+ if (!response.ok) {
372
+ const error = await response.text()
373
+ throw new Error(`API request failed (${response.status}): ${error}`)
374
+ }
375
+
376
+ const data = await response.json()
377
+ const choice = data.choices[0]
378
+
379
+ return {
380
+ content: choice.message.content ?? '',
381
+ model: data.model,
382
+ usage: {
383
+ promptTokens: data.usage.prompt_tokens,
384
+ completionTokens: data.usage.completion_tokens,
385
+ totalTokens: data.usage.total_tokens,
386
+ },
387
+ }
388
+ }
389
+ }
390
+
391
+ // ── Usage example ──────────────────────────────────────────────────────────
392
+
393
+ const client = new OpenAICompatibleClient({
394
+ apiKey: process.env.OPENAI_API_KEY || 'sk-your-api-key-here',
395
+ baseURL: 'https://api.openai.com/v1',
396
+ model: 'gpt-4o-mini',
397
+ })
398
+
399
+ async function main() {
400
+ try {
401
+ const response = await client.complete({
402
+ systemPrompt: 'You are a concise assistant. Reply in one sentence.',
403
+ messages: [
404
+ { role: 'user', content: 'What is the capital of Japan?' },
405
+ ],
406
+ temperature: 0.3,
407
+ maxTokens: 60,
408
+ })
409
+
410
+ console.log('Generated text:', response.content)
411
+ // Output: "The capital of Japan is Tokyo."
412
+
413
+ console.log('Model used:', response.model)
414
+ // Output: "gpt-4o-mini"
415
+
416
+ console.log('Token usage:', response.usage)
417
+ // Output: { promptTokens: 28, completionTokens: 10, totalTokens: 38 }
418
+
419
+ } catch (error) {
420
+ if (error instanceof Error) {
421
+ console.error('Completion failed:', error.message)
422
+ }
423
+ }
424
+ }
425
+
426
+ main()
427
+ ```
428
+
@@ -0,0 +1,256 @@
1
+ # Skrypt API
2
+
3
+ > API documentation for Skrypt
4
+
5
+ ## getAuthConfig
6
+ function getAuthConfig(): AuthConfig
7
+
8
+ ## saveAuthConfig
9
+ function saveAuthConfig(config: AuthConfig): void
10
+
11
+ ## clearAuth
12
+ function clearAuth(): void
13
+
14
+ ## checkPlan
15
+ async function checkPlan(apiKey: string): Promise<PlanCheckResponse>
16
+
17
+ ## requirePro
18
+ async function requirePro(commandName: string): Promise<boolean>
19
+
20
+ ## isProCommand
21
+ function isProCommand(command: string): boolean
22
+
23
+ ## autoFixExample
24
+ async function autoFixExample(example: CodeExample, client: LLMClient, options: AutoFixOptions = {}): Promise<FixResult>
25
+
26
+ ## autoFixBatch
27
+ async function autoFixBatch(examples: CodeExample[], client: LLMClient, options: AutoFixOptions = {}): Promise<Map<number, FixResult>>
28
+
29
+ ## createTypeScriptValidator
30
+ function createTypeScriptValidator(): (code: string) => Promise<ValidationResult>
31
+
32
+ ## createPythonValidator
33
+ function createPythonValidator(): (code: string) => Promise<ValidationResult>
34
+
35
+ ## findConfigFile
36
+ function findConfigFile(dir: string): string | null
37
+
38
+ ## loadConfig
39
+ function loadConfig(configPath?: string): Config
40
+
41
+ ## validateConfig
42
+ function validateConfig(config: Config): string[]
43
+
44
+ ## checkApiKey
45
+ function checkApiKey(provider: LLMProvider): { ok: boolean; envKey: string | null }
46
+
47
+ ## generateForElement
48
+ async function generateForElement(element: APIElement, client: LLMClient, options: GenerationOptions, onProgress?: (progress: GenerationProgress) => void): Promise<GeneratedDoc>
49
+
50
+ ## generateForElements
51
+ async function generateForElements(elements: APIElement[], client: LLMClient, options: GenerationOptions): Promise<GeneratedDoc[]>
52
+
53
+ ## formatAsMarkdown
54
+ function formatAsMarkdown(docs: GeneratedDoc[], title: string): string
55
+
56
+ ## organizeByTopic
57
+ function organizeByTopic(docs: GeneratedDoc[], config: TopicConfig = DEFAULT_TOPIC_CONFIG): Topic[]
58
+
59
+ ## detectCrossReferences
60
+ function detectCrossReferences(docs: GeneratedDoc[]): CrossReference[]
61
+
62
+ ## getCrossRefsForElement
63
+ function getCrossRefsForElement(elementName: string, allRefs: CrossReference[]): CrossReference[]
64
+
65
+ ## buildNavigation
66
+ function buildNavigation(topics: Topic[]): NavigationItem[]
67
+
68
+ ## generateSidebarConfig
69
+ function generateSidebarConfig(topics: Topic[]): object
70
+
71
+ ## mergeTopicConfig
72
+ function mergeTopicConfig(userConfig: Partial<TopicConfig>, defaults: TopicConfig = DEFAULT_TOPIC_CONFIG): TopicConfig
73
+
74
+ ## writeLlmsTxt
75
+ async function writeLlmsTxt(docs: GeneratedDoc[], outputDir: string, options: { projectName?: string; description?: string } = {}): Promise<void>
76
+
77
+ ## writeDocsToDirectory
78
+ async function writeDocsToDirectory(results: FileGenerationResult[], outputDir: string, sourceDir: string): Promise<{ filesWritten: number; totalDocs: number }>
79
+
80
+ ## groupDocsByFile
81
+ function groupDocsByFile(docs: GeneratedDoc[]): FileGenerationResult[]
82
+
83
+ ## writeDocsByTopic
84
+ async function writeDocsByTopic(docs: GeneratedDoc[], outputDir: string): Promise<{ filesWritten: number; totalDocs: number; topics: Topic[] }>
85
+
86
+ ## postPRComment
87
+ async function postPRComment(config: PRCommentConfig, issues: DocumentationIssue[]): Promise<CommentResult>
88
+
89
+ ## postInlineComments
90
+ async function postInlineComments(config: PRCommentConfig, issues: DocumentationIssue[]): Promise<CommentResult[]>
91
+
92
+ ## analyzePRForDocs
93
+ async function analyzePRForDocs(config: PRCommentConfig, _options: { checkExamples?: boolean } = {}): Promise<DocumentationIssue[]>
94
+
95
+ ## AnthropicClient
96
+ class AnthropicClient implements LLMClient
97
+
98
+ ## constructor
99
+ constructor(config: LLMClientConfig)
100
+
101
+ ## isConfigured
102
+ isConfigured(): boolean
103
+
104
+ ## complete
105
+ async complete(request: CompletionRequest): Promise<CompletionResponse>
106
+
107
+ ## createLLMClient
108
+ function createLLMClient(config: {
109
+ provider: LLMProvider
110
+ model: string
111
+ baseUrl?: string
112
+ timeout?: number
113
+ maxRetries?: number
114
+ }): LLMClient
115
+
116
+ ## generateDocumentation
117
+ async function generateDocumentation(client: LLMClient, element: ElementContext, options?: { multiLanguage?: boolean }): Promise<GeneratedDocResult>
118
+
119
+ ## fixCodeSample
120
+ async function fixCodeSample(client: LLMClient, code: string, error: string, context: string, iteration: number = 1): Promise<string>
121
+
122
+ ## OpenAICompatibleClient
123
+ class OpenAICompatibleClient implements LLMClient
124
+
125
+ ## constructor
126
+ constructor(config: LLMClientConfig)
127
+
128
+ ## isConfigured
129
+ isConfigured(): boolean
130
+
131
+ ## complete
132
+ async complete(request: CompletionRequest): Promise<CompletionResponse>
133
+
134
+ ## PluginManager
135
+ class PluginManager
136
+
137
+ ## constructor
138
+ constructor(sourcePath: string, outputPath: string, config: Record<string, unknown> = {})
139
+
140
+ ## loadPlugins
141
+ async loadPlugins(configPath?: string): Promise<void>
142
+
143
+ ## register
144
+ register(plugin: SkryptPlugin): void
145
+
146
+ ## runHook
147
+ async runHook<T>(hook: keyof SkryptPlugin, ...args: unknown[]): Promise<T | undefined>
148
+
149
+ ## onInit
150
+ async onInit(): Promise<void>
151
+
152
+ ## onBeforeScan
153
+ async onBeforeScan(): Promise<void>
154
+
155
+ ## onAfterScan
156
+ async onAfterScan<T>(elements: T[]): Promise<T[]>
157
+
158
+ ## onBeforeGenerate
159
+ async onBeforeGenerate<T>(elements: T[]): Promise<T[]>
160
+
161
+ ## onAfterGenerate
162
+ async onAfterGenerate<T>(docs: T[]): Promise<T[]>
163
+
164
+ ## onBeforeWrite
165
+ async onBeforeWrite<T>(docs: T[]): Promise<T[]>
166
+
167
+ ## onAfterWrite
168
+ async onAfterWrite(): Promise<void>
169
+
170
+ ## transformContent
171
+ async transformContent(content: string, filePath: string): Promise<string>
172
+
173
+ ## definePlugin
174
+ function definePlugin(plugin: SkryptPlugin): SkryptPlugin
175
+
176
+ ## classifyElement
177
+ function classifyElement(element: APIElement): ContentClassification
178
+
179
+ ## classifyElements
180
+ function classifyElements(elements: APIElement[]): Map<ContentType, APIElement[]>
181
+
182
+ ## getRecommendedStructure
183
+ function getRecommendedStructure(elements: APIElement[]): {
184
+ sections: { name: string; type: ContentType; elements: APIElement[] }[]
185
+ stats: { api: number; guide: number; tutorial: number; overview: number }
186
+ }
187
+
188
+ ## getPromptForContentType
189
+ function getPromptForContentType(type: ContentType): string
190
+
191
+ ## GoScanner
192
+ class GoScanner implements Scanner
193
+
194
+ ## canHandle
195
+ canHandle(filePath: string): boolean
196
+
197
+ ## scanFile
198
+ async scanFile(filePath: string): Promise<ScanResult>
199
+
200
+ ## scanDirectory
201
+ async function scanDirectory(dir: string, options: ScanOptions = {}): Promise<ScanAllResult>
202
+
203
+ ## scanFile
204
+ async function scanFile(filePath: string): Promise<ScanResult>
205
+
206
+ ## PythonScanner
207
+ class PythonScanner implements Scanner
208
+
209
+ ## canHandle
210
+ canHandle(filePath: string): boolean
211
+
212
+ ## scanFile
213
+ async scanFile(filePath: string): Promise<ScanResult>
214
+
215
+ ## get_docstring
216
+ def get_docstring(node: ast.AST) -> str | None
217
+
218
+ ## get_type_annotation
219
+ def get_type_annotation(annotation: ast.AST | None) -> str | None
220
+
221
+ ## get_default_value
222
+ def get_default_value(default: ast.AST | None) -> str | None
223
+
224
+ ## extract_parameters
225
+ def extract_parameters(args: ast.arguments) -> list[dict[str, Any]]
226
+
227
+ ## build_signature
228
+ def build_signature(name: str, args: ast.arguments, returns: ast.AST | None, is_async: bool) -> str
229
+
230
+ ## extract_function
231
+ def extract_function(node: ast.FunctionDef | ast.AsyncFunctionDef, file_path: str, parent_class: str | None) -> dict[str, Any]
232
+
233
+ ## extract_class
234
+ def extract_class(node: ast.ClassDef, file_path: str) -> list[dict[str, Any]]
235
+
236
+ ## scan_file
237
+ def scan_file(file_path: str) -> dict[str, Any]
238
+
239
+ ## RustScanner
240
+ class RustScanner implements Scanner
241
+
242
+ ## canHandle
243
+ canHandle(filePath: string): boolean
244
+
245
+ ## scanFile
246
+ async scanFile(filePath: string): Promise<ScanResult>
247
+
248
+ ## TypeScriptScanner
249
+ class TypeScriptScanner implements Scanner
250
+
251
+ ## canHandle
252
+ canHandle(filePath: string): boolean
253
+
254
+ ## scanFile
255
+ async scanFile(filePath: string): Promise<ScanResult>
256
+