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.
- package/dist/auth/index.d.ts +13 -3
- package/dist/auth/index.js +101 -9
- package/dist/auth/keychain.d.ts +5 -0
- package/dist/auth/keychain.js +82 -0
- package/dist/auth/notices.d.ts +3 -0
- package/dist/auth/notices.js +42 -0
- package/dist/autofix/index.d.ts +0 -4
- package/dist/autofix/index.js +10 -24
- package/dist/capture/browser.d.ts +11 -0
- package/dist/capture/browser.js +173 -0
- package/dist/capture/diff.d.ts +23 -0
- package/dist/capture/diff.js +52 -0
- package/dist/capture/index.d.ts +23 -0
- package/dist/capture/index.js +210 -0
- package/dist/capture/naming.d.ts +17 -0
- package/dist/capture/naming.js +45 -0
- package/dist/capture/parser.d.ts +15 -0
- package/dist/capture/parser.js +80 -0
- package/dist/capture/types.d.ts +57 -0
- package/dist/capture/types.js +1 -0
- package/dist/cli.js +20 -3
- package/dist/commands/autofix.js +136 -120
- package/dist/commands/cron.js +58 -47
- package/dist/commands/deploy.js +123 -102
- package/dist/commands/generate.js +125 -7
- package/dist/commands/heal.d.ts +10 -0
- package/dist/commands/heal.js +201 -0
- package/dist/commands/i18n.js +146 -111
- package/dist/commands/import.d.ts +2 -0
- package/dist/commands/import.js +157 -0
- package/dist/commands/init.js +19 -7
- package/dist/commands/lint.js +50 -44
- package/dist/commands/llms-txt.js +59 -49
- package/dist/commands/login.js +63 -34
- package/dist/commands/mcp.js +6 -0
- package/dist/commands/monitor.js +13 -8
- package/dist/commands/qa.d.ts +2 -0
- package/dist/commands/qa.js +43 -0
- package/dist/commands/review-pr.js +108 -92
- package/dist/commands/sdk.js +128 -122
- package/dist/commands/security.d.ts +2 -0
- package/dist/commands/security.js +109 -0
- package/dist/commands/test.js +91 -92
- package/dist/commands/version.js +104 -75
- package/dist/commands/watch.js +130 -114
- package/dist/config/types.js +2 -2
- package/dist/context-hub/index.d.ts +23 -0
- package/dist/context-hub/index.js +179 -0
- package/dist/context-hub/mappings.d.ts +8 -0
- package/dist/context-hub/mappings.js +55 -0
- package/dist/context-hub/types.d.ts +33 -0
- package/dist/context-hub/types.js +1 -0
- package/dist/generator/generator.js +39 -6
- package/dist/generator/types.d.ts +7 -0
- package/dist/generator/writer.d.ts +3 -1
- package/dist/generator/writer.js +36 -7
- package/dist/importers/confluence.d.ts +5 -0
- package/dist/importers/confluence.js +137 -0
- package/dist/importers/detect.d.ts +20 -0
- package/dist/importers/detect.js +121 -0
- package/dist/importers/docusaurus.d.ts +5 -0
- package/dist/importers/docusaurus.js +279 -0
- package/dist/importers/gitbook.d.ts +5 -0
- package/dist/importers/gitbook.js +189 -0
- package/dist/importers/github.d.ts +8 -0
- package/dist/importers/github.js +99 -0
- package/dist/importers/index.d.ts +15 -0
- package/dist/importers/index.js +30 -0
- package/dist/importers/markdown.d.ts +6 -0
- package/dist/importers/markdown.js +105 -0
- package/dist/importers/mintlify.d.ts +5 -0
- package/dist/importers/mintlify.js +172 -0
- package/dist/importers/notion.d.ts +5 -0
- package/dist/importers/notion.js +174 -0
- package/dist/importers/readme.d.ts +5 -0
- package/dist/importers/readme.js +184 -0
- package/dist/importers/transform.d.ts +90 -0
- package/dist/importers/transform.js +457 -0
- package/dist/importers/types.d.ts +37 -0
- package/dist/importers/types.js +1 -0
- package/dist/llm/anthropic-client.d.ts +1 -0
- package/dist/llm/anthropic-client.js +3 -1
- package/dist/llm/index.d.ts +6 -4
- package/dist/llm/index.js +76 -261
- package/dist/llm/openai-client.d.ts +1 -0
- package/dist/llm/openai-client.js +7 -2
- package/dist/plugins/index.js +7 -0
- package/dist/qa/checks.d.ts +10 -0
- package/dist/qa/checks.js +492 -0
- package/dist/qa/fixes.d.ts +30 -0
- package/dist/qa/fixes.js +277 -0
- package/dist/qa/index.d.ts +29 -0
- package/dist/qa/index.js +187 -0
- package/dist/qa/types.d.ts +24 -0
- package/dist/qa/types.js +1 -0
- package/dist/scanner/csharp.d.ts +23 -0
- package/dist/scanner/csharp.js +421 -0
- package/dist/scanner/index.js +53 -26
- package/dist/scanner/java.d.ts +39 -0
- package/dist/scanner/java.js +318 -0
- package/dist/scanner/kotlin.d.ts +23 -0
- package/dist/scanner/kotlin.js +389 -0
- package/dist/scanner/php.d.ts +57 -0
- package/dist/scanner/php.js +351 -0
- package/dist/scanner/python.js +17 -0
- package/dist/scanner/ruby.d.ts +36 -0
- package/dist/scanner/ruby.js +431 -0
- package/dist/scanner/swift.d.ts +25 -0
- package/dist/scanner/swift.js +392 -0
- package/dist/scanner/types.d.ts +1 -1
- package/dist/template/content/docs/_navigation.json +46 -0
- package/dist/template/content/docs/_sidebars.json +684 -0
- package/dist/template/content/docs/core.md +4544 -0
- package/dist/template/content/docs/index.mdx +89 -0
- package/dist/template/content/docs/integrations.md +1158 -0
- package/dist/template/content/docs/llms-full.md +403 -0
- package/dist/template/content/docs/llms.txt +4588 -0
- package/dist/template/content/docs/other.md +10379 -0
- package/dist/template/content/docs/tools.md +746 -0
- package/dist/template/content/docs/types.md +531 -0
- package/dist/template/docs.json +13 -11
- package/dist/template/mdx-components.tsx +27 -2
- package/dist/template/package.json +6 -0
- package/dist/template/public/search-index.json +1 -1
- package/dist/template/scripts/build-search-index.mjs +149 -13
- package/dist/template/src/app/api/chat/route.ts +83 -128
- package/dist/template/src/app/docs/[...slug]/page.tsx +75 -20
- package/dist/template/src/app/docs/llms-full.md +151 -4
- package/dist/template/src/app/docs/llms.txt +2464 -847
- package/dist/template/src/app/docs/page.mdx +48 -38
- package/dist/template/src/app/layout.tsx +3 -1
- package/dist/template/src/app/page.tsx +22 -8
- package/dist/template/src/components/ai-chat.tsx +73 -64
- package/dist/template/src/components/breadcrumbs.tsx +21 -23
- package/dist/template/src/components/copy-button.tsx +13 -9
- package/dist/template/src/components/copy-page-button.tsx +54 -0
- package/dist/template/src/components/docs-layout.tsx +37 -25
- package/dist/template/src/components/header.tsx +51 -10
- package/dist/template/src/components/mdx/card.tsx +17 -3
- package/dist/template/src/components/mdx/code-block.tsx +13 -9
- package/dist/template/src/components/mdx/code-group.tsx +13 -8
- package/dist/template/src/components/mdx/heading.tsx +15 -2
- package/dist/template/src/components/mdx/highlighted-code.tsx +13 -8
- package/dist/template/src/components/mdx/index.tsx +2 -0
- package/dist/template/src/components/mdx/mermaid.tsx +110 -0
- package/dist/template/src/components/mdx/screenshot.tsx +150 -0
- package/dist/template/src/components/scroll-to-hash.tsx +48 -0
- package/dist/template/src/components/sidebar.tsx +12 -18
- package/dist/template/src/components/table-of-contents.tsx +9 -0
- package/dist/template/src/lib/highlight.ts +3 -88
- package/dist/template/src/lib/navigation.ts +159 -0
- package/dist/template/src/lib/search-types.ts +4 -1
- package/dist/template/src/lib/search.ts +30 -7
- package/dist/template/src/styles/globals.css +17 -6
- package/dist/utils/files.d.ts +9 -1
- package/dist/utils/files.js +59 -10
- package/dist/utils/validation.d.ts +0 -3
- package/dist/utils/validation.js +0 -26
- package/package.json +5 -1
package/dist/utils/files.js
CHANGED
|
@@ -1,25 +1,41 @@
|
|
|
1
|
-
import { readdirSync, statSync } from 'fs';
|
|
1
|
+
import { readdirSync, statSync, lstatSync } from 'fs';
|
|
2
2
|
import { join, extname } from 'path';
|
|
3
3
|
/**
|
|
4
4
|
* Recursively find all .md and .mdx files in a directory.
|
|
5
|
-
* Skips hidden directories and
|
|
5
|
+
* Skips hidden directories, node_modules, and symlinks.
|
|
6
6
|
*/
|
|
7
7
|
export function findMdxFiles(dir) {
|
|
8
8
|
const files = [];
|
|
9
|
-
function walk(currentDir) {
|
|
10
|
-
|
|
9
|
+
function walk(currentDir, depth) {
|
|
10
|
+
if (depth > 30)
|
|
11
|
+
return;
|
|
12
|
+
let entries;
|
|
13
|
+
try {
|
|
14
|
+
entries = readdirSync(currentDir);
|
|
15
|
+
}
|
|
16
|
+
catch {
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
11
19
|
for (const entry of entries) {
|
|
12
20
|
const fullPath = join(currentDir, entry);
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
21
|
+
try {
|
|
22
|
+
// Skip symlinks to prevent infinite loops
|
|
23
|
+
if (lstatSync(fullPath).isSymbolicLink())
|
|
24
|
+
continue;
|
|
25
|
+
const stat = statSync(fullPath);
|
|
26
|
+
if (stat.isDirectory() && !entry.startsWith('.') && entry !== 'node_modules') {
|
|
27
|
+
walk(fullPath, depth + 1);
|
|
28
|
+
}
|
|
29
|
+
else if (stat.isFile() && (extname(entry) === '.mdx' || extname(entry) === '.md')) {
|
|
30
|
+
files.push(fullPath);
|
|
31
|
+
}
|
|
16
32
|
}
|
|
17
|
-
|
|
18
|
-
|
|
33
|
+
catch {
|
|
34
|
+
continue;
|
|
19
35
|
}
|
|
20
36
|
}
|
|
21
37
|
}
|
|
22
|
-
walk(dir);
|
|
38
|
+
walk(dir, 0);
|
|
23
39
|
return files;
|
|
24
40
|
}
|
|
25
41
|
/**
|
|
@@ -31,3 +47,36 @@ export function slugify(str) {
|
|
|
31
47
|
.replace(/[^a-z0-9]+/g, '-')
|
|
32
48
|
.replace(/^-|-$/g, '');
|
|
33
49
|
}
|
|
50
|
+
/**
|
|
51
|
+
* Simple YAML frontmatter parser — splits on --- markers.
|
|
52
|
+
* Returns parsed key-value data and remaining content body.
|
|
53
|
+
*/
|
|
54
|
+
export function parseFrontmatter(content) {
|
|
55
|
+
const match = content.match(/^---\r?\n([\s\S]*?)\r?\n---\r?\n?([\s\S]*)$/);
|
|
56
|
+
if (!match)
|
|
57
|
+
return { data: {}, content };
|
|
58
|
+
const yamlStr = match[1];
|
|
59
|
+
const body = match[2];
|
|
60
|
+
const data = {};
|
|
61
|
+
for (const line of yamlStr.split('\n')) {
|
|
62
|
+
const kvMatch = line.match(/^(\w[\w-]*)\s*:\s*(.*)$/);
|
|
63
|
+
if (!kvMatch)
|
|
64
|
+
continue;
|
|
65
|
+
const key = kvMatch[1];
|
|
66
|
+
let value = kvMatch[2].trim();
|
|
67
|
+
if (typeof value === 'string') {
|
|
68
|
+
if ((value.startsWith('"') && value.endsWith('"')) ||
|
|
69
|
+
(value.startsWith("'") && value.endsWith("'"))) {
|
|
70
|
+
value = value.slice(1, -1);
|
|
71
|
+
}
|
|
72
|
+
else if (value === 'true')
|
|
73
|
+
value = true;
|
|
74
|
+
else if (value === 'false')
|
|
75
|
+
value = false;
|
|
76
|
+
else if (/^\d+$/.test(value))
|
|
77
|
+
value = parseInt(value, 10);
|
|
78
|
+
}
|
|
79
|
+
data[key] = value;
|
|
80
|
+
}
|
|
81
|
+
return { data, content: body };
|
|
82
|
+
}
|
package/dist/utils/validation.js
CHANGED
|
@@ -1,16 +1,3 @@
|
|
|
1
|
-
import { existsSync } from 'fs';
|
|
2
|
-
import { resolve } from 'path';
|
|
3
|
-
export function validatePath(input, mustExist = true) {
|
|
4
|
-
const resolved = resolve(input);
|
|
5
|
-
// Prevent path traversal outside cwd
|
|
6
|
-
if (!resolved.startsWith(process.cwd()) && !resolved.startsWith('/tmp')) {
|
|
7
|
-
// Allow absolute paths but warn
|
|
8
|
-
}
|
|
9
|
-
if (mustExist && !existsSync(resolved)) {
|
|
10
|
-
throw new Error(`Path does not exist: ${resolved}`);
|
|
11
|
-
}
|
|
12
|
-
return resolved;
|
|
13
|
-
}
|
|
14
1
|
export function validateUrl(input) {
|
|
15
2
|
try {
|
|
16
3
|
const url = new URL(input);
|
|
@@ -23,16 +10,3 @@ export function validateUrl(input) {
|
|
|
23
10
|
throw new Error(`Invalid URL: ${input}`);
|
|
24
11
|
}
|
|
25
12
|
}
|
|
26
|
-
export function validateSlug(input) {
|
|
27
|
-
if (!/^[a-zA-Z0-9_-]+$/.test(input)) {
|
|
28
|
-
throw new Error(`Invalid slug: ${input}. Only alphanumeric, hyphens, and underscores allowed.`);
|
|
29
|
-
}
|
|
30
|
-
return input;
|
|
31
|
-
}
|
|
32
|
-
export function sanitizeForShell(input) {
|
|
33
|
-
// Only allow safe characters for git refs, filenames, etc.
|
|
34
|
-
if (!/^[a-zA-Z0-9/_~.^@{}-]+$/.test(input)) {
|
|
35
|
-
throw new Error(`Unsafe characters in input: ${input}`);
|
|
36
|
-
}
|
|
37
|
-
return input;
|
|
38
|
-
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "skrypt-ai",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"description": "AI-powered documentation generator with code examples",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/cli.js",
|
|
@@ -54,6 +54,10 @@
|
|
|
54
54
|
"openai": "^6.27.0",
|
|
55
55
|
"typescript": "^5.9.3"
|
|
56
56
|
},
|
|
57
|
+
"optionalDependencies": {
|
|
58
|
+
"@napi-rs/keyring": "^1.1.6",
|
|
59
|
+
"playwright": "^1.52.0"
|
|
60
|
+
},
|
|
57
61
|
"devDependencies": {
|
|
58
62
|
"@eslint/js": "^10.0.1",
|
|
59
63
|
"@types/js-yaml": "^4.0.9",
|