skrypt-ai 0.4.2 → 0.6.0

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 (159) hide show
  1. package/dist/auth/index.d.ts +13 -3
  2. package/dist/auth/index.js +101 -9
  3. package/dist/auth/keychain.d.ts +5 -0
  4. package/dist/auth/keychain.js +82 -0
  5. package/dist/auth/notices.d.ts +3 -0
  6. package/dist/auth/notices.js +42 -0
  7. package/dist/autofix/index.d.ts +0 -4
  8. package/dist/autofix/index.js +10 -24
  9. package/dist/capture/browser.d.ts +11 -0
  10. package/dist/capture/browser.js +173 -0
  11. package/dist/capture/diff.d.ts +23 -0
  12. package/dist/capture/diff.js +52 -0
  13. package/dist/capture/index.d.ts +23 -0
  14. package/dist/capture/index.js +210 -0
  15. package/dist/capture/naming.d.ts +17 -0
  16. package/dist/capture/naming.js +45 -0
  17. package/dist/capture/parser.d.ts +15 -0
  18. package/dist/capture/parser.js +80 -0
  19. package/dist/capture/types.d.ts +57 -0
  20. package/dist/capture/types.js +1 -0
  21. package/dist/cli.js +20 -3
  22. package/dist/commands/autofix.js +136 -120
  23. package/dist/commands/cron.js +58 -47
  24. package/dist/commands/deploy.js +123 -102
  25. package/dist/commands/generate.js +125 -7
  26. package/dist/commands/heal.d.ts +10 -0
  27. package/dist/commands/heal.js +201 -0
  28. package/dist/commands/i18n.js +146 -111
  29. package/dist/commands/import.d.ts +2 -0
  30. package/dist/commands/import.js +157 -0
  31. package/dist/commands/init.js +19 -7
  32. package/dist/commands/lint.js +50 -44
  33. package/dist/commands/llms-txt.js +59 -49
  34. package/dist/commands/login.js +63 -34
  35. package/dist/commands/mcp.js +6 -0
  36. package/dist/commands/monitor.js +13 -8
  37. package/dist/commands/qa.d.ts +2 -0
  38. package/dist/commands/qa.js +43 -0
  39. package/dist/commands/review-pr.js +108 -92
  40. package/dist/commands/sdk.js +128 -122
  41. package/dist/commands/security.d.ts +2 -0
  42. package/dist/commands/security.js +109 -0
  43. package/dist/commands/test.js +91 -92
  44. package/dist/commands/version.js +104 -75
  45. package/dist/commands/watch.js +130 -114
  46. package/dist/config/types.js +2 -2
  47. package/dist/context-hub/index.d.ts +23 -0
  48. package/dist/context-hub/index.js +179 -0
  49. package/dist/context-hub/mappings.d.ts +8 -0
  50. package/dist/context-hub/mappings.js +55 -0
  51. package/dist/context-hub/types.d.ts +33 -0
  52. package/dist/context-hub/types.js +1 -0
  53. package/dist/generator/generator.js +39 -6
  54. package/dist/generator/types.d.ts +7 -0
  55. package/dist/generator/writer.d.ts +3 -1
  56. package/dist/generator/writer.js +36 -7
  57. package/dist/importers/confluence.d.ts +5 -0
  58. package/dist/importers/confluence.js +137 -0
  59. package/dist/importers/detect.d.ts +20 -0
  60. package/dist/importers/detect.js +121 -0
  61. package/dist/importers/docusaurus.d.ts +5 -0
  62. package/dist/importers/docusaurus.js +279 -0
  63. package/dist/importers/gitbook.d.ts +5 -0
  64. package/dist/importers/gitbook.js +189 -0
  65. package/dist/importers/github.d.ts +8 -0
  66. package/dist/importers/github.js +99 -0
  67. package/dist/importers/index.d.ts +15 -0
  68. package/dist/importers/index.js +30 -0
  69. package/dist/importers/markdown.d.ts +6 -0
  70. package/dist/importers/markdown.js +105 -0
  71. package/dist/importers/mintlify.d.ts +5 -0
  72. package/dist/importers/mintlify.js +172 -0
  73. package/dist/importers/notion.d.ts +5 -0
  74. package/dist/importers/notion.js +174 -0
  75. package/dist/importers/readme.d.ts +5 -0
  76. package/dist/importers/readme.js +184 -0
  77. package/dist/importers/transform.d.ts +90 -0
  78. package/dist/importers/transform.js +457 -0
  79. package/dist/importers/types.d.ts +37 -0
  80. package/dist/importers/types.js +1 -0
  81. package/dist/llm/anthropic-client.d.ts +1 -0
  82. package/dist/llm/anthropic-client.js +3 -1
  83. package/dist/llm/index.d.ts +6 -4
  84. package/dist/llm/index.js +76 -261
  85. package/dist/llm/openai-client.d.ts +1 -0
  86. package/dist/llm/openai-client.js +7 -2
  87. package/dist/plugins/index.js +7 -0
  88. package/dist/qa/checks.d.ts +10 -0
  89. package/dist/qa/checks.js +492 -0
  90. package/dist/qa/fixes.d.ts +30 -0
  91. package/dist/qa/fixes.js +277 -0
  92. package/dist/qa/index.d.ts +29 -0
  93. package/dist/qa/index.js +187 -0
  94. package/dist/qa/types.d.ts +24 -0
  95. package/dist/qa/types.js +1 -0
  96. package/dist/scanner/csharp.d.ts +23 -0
  97. package/dist/scanner/csharp.js +421 -0
  98. package/dist/scanner/index.js +53 -26
  99. package/dist/scanner/java.d.ts +39 -0
  100. package/dist/scanner/java.js +318 -0
  101. package/dist/scanner/kotlin.d.ts +23 -0
  102. package/dist/scanner/kotlin.js +389 -0
  103. package/dist/scanner/php.d.ts +57 -0
  104. package/dist/scanner/php.js +351 -0
  105. package/dist/scanner/python.js +17 -0
  106. package/dist/scanner/ruby.d.ts +36 -0
  107. package/dist/scanner/ruby.js +431 -0
  108. package/dist/scanner/swift.d.ts +25 -0
  109. package/dist/scanner/swift.js +392 -0
  110. package/dist/scanner/types.d.ts +1 -1
  111. package/dist/template/content/docs/_navigation.json +46 -0
  112. package/dist/template/content/docs/_sidebars.json +684 -0
  113. package/dist/template/content/docs/core.md +4544 -0
  114. package/dist/template/content/docs/index.mdx +89 -0
  115. package/dist/template/content/docs/integrations.md +1158 -0
  116. package/dist/template/content/docs/llms-full.md +403 -0
  117. package/dist/template/content/docs/llms.txt +4588 -0
  118. package/dist/template/content/docs/other.md +10379 -0
  119. package/dist/template/content/docs/tools.md +746 -0
  120. package/dist/template/content/docs/types.md +531 -0
  121. package/dist/template/docs.json +13 -11
  122. package/dist/template/mdx-components.tsx +27 -2
  123. package/dist/template/package.json +6 -0
  124. package/dist/template/public/search-index.json +1 -1
  125. package/dist/template/scripts/build-search-index.mjs +149 -13
  126. package/dist/template/src/app/api/chat/route.ts +83 -128
  127. package/dist/template/src/app/docs/[...slug]/page.tsx +75 -20
  128. package/dist/template/src/app/docs/llms-full.md +151 -4
  129. package/dist/template/src/app/docs/llms.txt +2464 -847
  130. package/dist/template/src/app/docs/page.mdx +48 -38
  131. package/dist/template/src/app/layout.tsx +3 -1
  132. package/dist/template/src/app/page.tsx +22 -8
  133. package/dist/template/src/components/ai-chat.tsx +73 -64
  134. package/dist/template/src/components/breadcrumbs.tsx +21 -23
  135. package/dist/template/src/components/copy-button.tsx +13 -9
  136. package/dist/template/src/components/copy-page-button.tsx +54 -0
  137. package/dist/template/src/components/docs-layout.tsx +37 -25
  138. package/dist/template/src/components/header.tsx +51 -10
  139. package/dist/template/src/components/mdx/card.tsx +17 -3
  140. package/dist/template/src/components/mdx/code-block.tsx +13 -9
  141. package/dist/template/src/components/mdx/code-group.tsx +13 -8
  142. package/dist/template/src/components/mdx/heading.tsx +15 -2
  143. package/dist/template/src/components/mdx/highlighted-code.tsx +13 -8
  144. package/dist/template/src/components/mdx/index.tsx +2 -0
  145. package/dist/template/src/components/mdx/mermaid.tsx +110 -0
  146. package/dist/template/src/components/mdx/screenshot.tsx +150 -0
  147. package/dist/template/src/components/scroll-to-hash.tsx +48 -0
  148. package/dist/template/src/components/sidebar.tsx +12 -18
  149. package/dist/template/src/components/table-of-contents.tsx +9 -0
  150. package/dist/template/src/lib/highlight.ts +3 -88
  151. package/dist/template/src/lib/navigation.ts +159 -0
  152. package/dist/template/src/lib/search-types.ts +4 -1
  153. package/dist/template/src/lib/search.ts +30 -7
  154. package/dist/template/src/styles/globals.css +17 -6
  155. package/dist/utils/files.d.ts +9 -1
  156. package/dist/utils/files.js +59 -10
  157. package/dist/utils/validation.d.ts +0 -3
  158. package/dist/utils/validation.js +0 -26
  159. package/package.json +5 -1
@@ -3,7 +3,60 @@ import { readFile, readdir } from 'fs/promises'
3
3
  import { join } from 'path'
4
4
  import { compileMDX } from 'next-mdx-remote/rsc'
5
5
  import remarkGfm from 'remark-gfm'
6
- import * as components from '@/components/mdx'
6
+ import * as mdxComponents from '@/components/mdx'
7
+ import { findPageInNavigation, type Navigation } from '@/lib/navigation'
8
+ import { Children, isValidElement, type ReactNode } from 'react'
9
+
10
+ /** Wrapper for <pre> that routes mermaid code blocks to the Mermaid component */
11
+ function PreWithMermaid(props: { children: ReactNode; className?: string }) {
12
+ let isMermaid = false
13
+ let codeText = ''
14
+
15
+ Children.forEach(props.children, (child) => {
16
+ if (isValidElement(child) && child.type === 'code') {
17
+ const childProps = child.props as { className?: string; children?: string }
18
+ if (childProps.className?.includes('language-mermaid')) {
19
+ isMermaid = true
20
+ codeText = childProps.children || ''
21
+ }
22
+ }
23
+ })
24
+
25
+ if (isMermaid) {
26
+ return <mdxComponents.Mermaid chart={codeText} />
27
+ }
28
+
29
+ return <mdxComponents.HighlightedCode {...props} />
30
+ }
31
+
32
+ /** Passthrough component for generated content that references unknown JSX tags */
33
+ function Passthrough({ children }: { children?: ReactNode }) {
34
+ return <>{children}</>
35
+ }
36
+
37
+ /** Strip empty <a id="..."></a> anchor tags — headings already have IDs from the Heading component */
38
+ function AnchorOrLink(props: { id?: string; href?: string; children?: ReactNode; className?: string }) {
39
+ // Empty anchor-only elements (e.g. <a id="pluginmanager"></a>) — strip them
40
+ if (props.id && !props.href && !props.children) {
41
+ return null
42
+ }
43
+ // Regular links — render normally
44
+ return <a {...props} />
45
+ }
46
+
47
+ const components = {
48
+ ...mdxComponents,
49
+ pre: PreWithMermaid,
50
+ h1: mdxComponents.H1,
51
+ h2: mdxComponents.H2,
52
+ h3: mdxComponents.H3,
53
+ h4: mdxComponents.H4,
54
+ a: AnchorOrLink,
55
+ // Passthrough for JSX tags that appear in generated code examples
56
+ Tabs: Passthrough,
57
+ TabItem: Passthrough,
58
+ Details: Passthrough,
59
+ }
7
60
  import type { Metadata } from 'next'
8
61
 
9
62
  interface PageProps {
@@ -23,6 +76,13 @@ function getDocsConfig() {
23
76
 
24
77
  async function getContent(slug: string[]) {
25
78
  const contentDir = join(process.cwd(), 'content', 'docs')
79
+
80
+ // Skip metadata files (llms.txt, llms-full.md, _navigation.json, _sidebars.json, README)
81
+ const lastName = slug[slug.length - 1]
82
+ if (lastName.startsWith('_') || lastName.startsWith('llms') || lastName === 'README') {
83
+ return null
84
+ }
85
+
26
86
  const filePath = join(contentDir, ...slug)
27
87
 
28
88
  // Try .mdx first, then .md
@@ -72,17 +132,11 @@ export async function generateMetadata({ params }: PageProps): Promise<Metadata>
72
132
 
73
133
  const frontmatter = await getFrontmatter(slug)
74
134
 
75
- // Fall back to nav config title
135
+ // Fall back to nav config title (works with both flat and tabbed navigation)
76
136
  if (!frontmatter.title) {
77
137
  const path = '/docs/' + slug.join('/')
78
- for (const group of docsConfig.navigation || []) {
79
- for (const page of group.pages || []) {
80
- if (page.path === path) {
81
- frontmatter.title = page.title
82
- break
83
- }
84
- }
85
- }
138
+ const pageInfo = findPageInNavigation(docsConfig.navigation as Navigation || [], path)
139
+ if (pageInfo.title) frontmatter.title = pageInfo.title
86
140
  }
87
141
 
88
142
  const title = frontmatter.title || slug[slug.length - 1].replace(/-/g, ' ').replace(/\b\w/g, (c: string) => c.toUpperCase())
@@ -93,18 +147,12 @@ export async function generateMetadata({ params }: PageProps): Promise<Metadata>
93
147
  }
94
148
  }
95
149
 
96
- /** Look up page title from docs.json navigation by pathname */
150
+ /** Look up page title from docs.json navigation by pathname (works with both formats) */
97
151
  function getNavTitle(slug: string[]): string | undefined {
98
152
  const docsConfig = getDocsConfig()
99
153
  const path = '/docs/' + slug.join('/')
100
- for (const group of docsConfig.navigation || []) {
101
- for (const page of group.pages || []) {
102
- if (page.path === path) {
103
- return page.title
104
- }
105
- }
106
- }
107
- return undefined
154
+ const pageInfo = findPageInNavigation(docsConfig.navigation as Navigation || [], path)
155
+ return pageInfo.title
108
156
  }
109
157
 
110
158
  export default async function DocPage({ params }: PageProps) {
@@ -121,8 +169,11 @@ export default async function DocPage({ params }: PageProps) {
121
169
  const pageDescription = frontmatter.description
122
170
 
123
171
  try {
172
+ // Strip empty <a id="..."></a> anchors from generated content — headings already have IDs
173
+ const cleanedSource = result.content.replace(/<a\s+id="[^"]*"\s*><\/a>\s*/g, '')
174
+
124
175
  const { content } = await compileMDX({
125
- source: result.content,
176
+ source: cleanedSource,
126
177
  components: components as any,
127
178
  options: {
128
179
  parseFrontmatter: true,
@@ -160,6 +211,8 @@ export default async function DocPage({ params }: PageProps) {
160
211
  {pageDescription && (
161
212
  <div data-page-description={pageDescription} className="hidden" />
162
213
  )}
214
+ {/* Raw content for copy page button */}
215
+ <script id="raw-page-content" type="text/plain" data-content={Buffer.from(result.content).toString('base64')} />
163
216
  <div className="prose max-w-none">
164
217
  {content}
165
218
  </div>
@@ -189,6 +242,8 @@ export async function generateStaticParams() {
189
242
  await walkDir(join(dir, entry.name), [...prefix, entry.name])
190
243
  } else if (entry.name.endsWith('.md') || entry.name.endsWith('.mdx')) {
191
244
  const name = entry.name.replace(/\.(mdx?|md)$/, '')
245
+ // Skip metadata files
246
+ if (name.startsWith('_') || name.startsWith('llms') || name === 'README') continue
192
247
  if (name === 'index') {
193
248
  if (prefix.length > 0) {
194
249
  slugs.push({ slug: prefix })
@@ -5,11 +5,17 @@
5
5
  ## getAuthConfig
6
6
  function getAuthConfig(): AuthConfig
7
7
 
8
+ ## getAuthConfigAsync
9
+ async function getAuthConfigAsync(): Promise<AuthConfig>
10
+
8
11
  ## saveAuthConfig
9
- function saveAuthConfig(config: AuthConfig): void
12
+ async function saveAuthConfig(config: AuthConfig): Promise<void>
10
13
 
11
14
  ## clearAuth
12
- function clearAuth(): void
15
+ async function clearAuth(): Promise<void>
16
+
17
+ ## getKeyStorageMethod
18
+ async function getKeyStorageMethod(): Promise<'keychain' | 'file' | 'env' | 'none'>
13
19
 
14
20
  ## checkPlan
15
21
  async function checkPlan(apiKey: string): Promise<PlanCheckResponse>
@@ -17,8 +23,29 @@ async function checkPlan(apiKey: string): Promise<PlanCheckResponse>
17
23
  ## requirePro
18
24
  async function requirePro(commandName: string): Promise<boolean>
19
25
 
20
- ## isProCommand
21
- function isProCommand(command: string): boolean
26
+ ## keychainAvailable
27
+ async function keychainAvailable(): Promise<boolean>
28
+
29
+ ## keychainStore
30
+ async function keychainStore(key: string): Promise<boolean>
31
+
32
+ ## keychainRetrieve
33
+ async function keychainRetrieve(): Promise<string | null>
34
+
35
+ ## keychainDelete
36
+ async function keychainDelete(): Promise<boolean>
37
+
38
+ ## getKeychainPlatformName
39
+ function getKeychainPlatformName(): string
40
+
41
+ ## hasSeenNotice
42
+ function hasSeenNotice(id: string): boolean
43
+
44
+ ## markNoticeSeen
45
+ function markNoticeSeen(id: string): void
46
+
47
+ ## showSecurityNotice
48
+ function showSecurityNotice(): void
22
49
 
23
50
  ## autoFixExample
24
51
  async function autoFixExample(example: CodeExample, client: LLMClient, options: AutoFixOptions = {}): Promise<FixResult>
@@ -92,6 +119,105 @@ async function postInlineComments(config: PRCommentConfig, issues: Documentation
92
119
  ## analyzePRForDocs
93
120
  async function analyzePRForDocs(config: PRCommentConfig, _options: { checkExamples?: boolean } = {}): Promise<DocumentationIssue[]>
94
121
 
122
+ ## importConfluence
123
+ function importConfluence(dir: string, name?: string): ImportResult
124
+
125
+ ## detectFormat
126
+ function detectFormat(dir: string): ImportFormat
127
+
128
+ ## isGitHubUrl
129
+ function isGitHubUrl(input: string): boolean
130
+
131
+ ## parseGitHubUrl
132
+ function parseGitHubUrl(url: string): { owner: string; repo: string; path: string; ref: string }
133
+
134
+ ## importDocusaurus
135
+ function importDocusaurus(dir: string, name?: string): ImportResult
136
+
137
+ ## importGitBook
138
+ function importGitBook(dir: string, name?: string): ImportResult
139
+
140
+ ## importFromGitHub
141
+ async function importFromGitHub(owner: string, repo: string, path: string, ref: string, options?: { format?: ImportFormat; name?: string }): Promise<ImportResult>
142
+
143
+ ## runImport
144
+ function runImport(dir: string, format: ImportFormat, name?: string): ImportResult
145
+
146
+ ## importMarkdown
147
+ function importMarkdown(dir: string, name?: string): ImportResult
148
+
149
+ ## importMintlify
150
+ function importMintlify(dir: string, name?: string): ImportResult
151
+
152
+ ## importNotion
153
+ function importNotion(dir: string, name?: string): ImportResult
154
+
155
+ ## importReadme
156
+ function importReadme(dir: string, name?: string): ImportResult
157
+
158
+ ## transformMintlifyCallouts
159
+ function transformMintlifyCallouts(content: string): string
160
+
161
+ ## transformDocusaurusAdmonitions
162
+ function transformDocusaurusAdmonitions(content: string): string
163
+
164
+ ## transformGitBookHints
165
+ function transformGitBookHints(content: string): string
166
+
167
+ ## transformReadmeCallouts
168
+ function transformReadmeCallouts(content: string): string
169
+
170
+ ## transformNotionCallouts
171
+ function transformNotionCallouts(content: string): string
172
+
173
+ ## transformConfluenceCallouts
174
+ function transformConfluenceCallouts(content: string): string
175
+
176
+ ## transformMintlifyTabs
177
+ function transformMintlifyTabs(content: string): string
178
+
179
+ ## transformDocusaurusTabs
180
+ function transformDocusaurusTabs(content: string): string
181
+
182
+ ## transformGitBookTabs
183
+ function transformGitBookTabs(content: string): string
184
+
185
+ ## transformReadmeCodeBlocks
186
+ function transformReadmeCodeBlocks(content: string): string
187
+
188
+ ## transformGitBookSteps
189
+ function transformGitBookSteps(content: string): string
190
+
191
+ ## transformGitBookExpandable
192
+ function transformGitBookExpandable(content: string): string
193
+
194
+ ## transformGitBookContentRef
195
+ function transformGitBookContentRef(content: string): string
196
+
197
+ ## transformGitBookEmbed
198
+ function transformGitBookEmbed(content: string): string
199
+
200
+ ## transformNotionToggles
201
+ function transformNotionToggles(content: string): string
202
+
203
+ ## transformConfluenceHtml
204
+ function transformConfluenceHtml(content: string): string
205
+
206
+ ## stripDocusaurusImports
207
+ function stripDocusaurusImports(content: string): string
208
+
209
+ ## normalizeFrontmatter
210
+ function normalizeFrontmatter(content: string, defaults?: FrontmatterDefaults): string
211
+
212
+ ## rewriteImagePaths
213
+ function rewriteImagePaths(content: string, mapping: Map<string, string>): string
214
+
215
+ ## stripNotionUUIDs
216
+ function stripNotionUUIDs(filename: string): string
217
+
218
+ ## getSortWeight
219
+ function getSortWeight(content: string): number
220
+
95
221
  ## AnthropicClient
96
222
  class AnthropicClient implements LLMClient
97
223
 
@@ -254,3 +380,24 @@ canHandle(filePath: string): boolean
254
380
  ## scanFile
255
381
  async scanFile(filePath: string): Promise<ScanResult>
256
382
 
383
+ ## findMdxFiles
384
+ function findMdxFiles(dir: string): string[]
385
+
386
+ ## slugify
387
+ function slugify(str: string): string
388
+
389
+ ## parseFrontmatter
390
+ function parseFrontmatter(content: string): { data: Record<string, unknown>; content: string }
391
+
392
+ ## validatePath
393
+ function validatePath(input: string, mustExist = true): string
394
+
395
+ ## validateUrl
396
+ function validateUrl(input: string): string
397
+
398
+ ## validateSlug
399
+ function validateSlug(input: string): string
400
+
401
+ ## sanitizeForShell
402
+ function sanitizeForShell(input: string): string
403
+