@oh-my-pi/pi-coding-agent 12.14.1 → 12.14.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oh-my-pi/pi-coding-agent",
3
- "version": "12.14.1",
3
+ "version": "12.14.2",
4
4
  "description": "Coding agent CLI with read, bash, edit, write tools and session management",
5
5
  "type": "module",
6
6
  "bin": {
@@ -85,12 +85,12 @@
85
85
  },
86
86
  "dependencies": {
87
87
  "@mozilla/readability": "0.6.0",
88
- "@oh-my-pi/omp-stats": "12.14.1",
89
- "@oh-my-pi/pi-agent-core": "12.14.1",
90
- "@oh-my-pi/pi-ai": "12.14.1",
91
- "@oh-my-pi/pi-natives": "12.14.1",
92
- "@oh-my-pi/pi-tui": "12.14.1",
93
- "@oh-my-pi/pi-utils": "12.14.1",
88
+ "@oh-my-pi/omp-stats": "12.14.2",
89
+ "@oh-my-pi/pi-agent-core": "12.14.2",
90
+ "@oh-my-pi/pi-ai": "12.14.2",
91
+ "@oh-my-pi/pi-natives": "12.14.2",
92
+ "@oh-my-pi/pi-tui": "12.14.2",
93
+ "@oh-my-pi/pi-utils": "12.14.2",
94
94
  "@sinclair/typebox": "^0.34.48",
95
95
  "@xterm/headless": "^6.0.0",
96
96
  "ajv": "^8.18.0",
@@ -5,24 +5,7 @@ import * as path from "node:path";
5
5
 
6
6
  const docsDir = new URL("../../../docs/", import.meta.url).pathname;
7
7
  const outputPath = new URL("../src/internal-urls/docs-index.generated.ts", import.meta.url).pathname;
8
- const importBase = "../../../../docs";
9
-
10
- function toIdentifier(relativePath: string): string {
11
- const withoutExt = relativePath.replace(/\.md$/i, "");
12
- const parts = withoutExt
13
- .split(/[^a-zA-Z0-9]+/)
14
- .filter(Boolean)
15
- .map((part, index) => {
16
- if (index === 0) {
17
- return part.toLowerCase();
18
- }
19
- return part.charAt(0).toUpperCase() + part.slice(1).toLowerCase();
20
- });
21
-
22
- const base = parts.length > 0 ? parts.join("") : "doc";
23
- const safeBase = /^[0-9]/.test(base) ? `doc${base}` : base;
24
- return `${safeBase}Md`;
25
- }
8
+
26
9
 
27
10
  const glob = new Glob("**/*.md");
28
11
  const entries: string[] = [];
@@ -31,26 +14,17 @@ for await (const relativePath of glob.scan(docsDir)) {
31
14
  }
32
15
  entries.sort();
33
16
 
34
- const usedIdentifiers = new Set<string>();
35
- const docs = entries.map((relativePath) => {
36
- let identifier = toIdentifier(relativePath);
37
- let suffix = 2;
38
- while (usedIdentifiers.has(identifier)) {
39
- identifier = `${toIdentifier(relativePath)}${suffix}`;
40
- suffix++;
41
- }
42
- usedIdentifiers.add(identifier);
43
- return { relativePath, identifier };
44
- });
45
- docs.sort((a, b) => a.identifier.localeCompare(b.identifier) || a.relativePath.localeCompare(b.relativePath));
46
-
47
- const imports = docs
48
- .map(({ relativePath, identifier }) => `import ${identifier} from "${importBase}/${relativePath}" with { type: "text" };`)
49
- .join("\n");
50
-
51
- const mapEntries = docs.map(({ relativePath, identifier }) => `\t"${relativePath}": ${identifier},`).join("\n");
52
-
53
- const output = `// Auto-generated by scripts/generate-docs-index.ts - DO NOT EDIT\n\n${imports}\n\nexport const EMBEDDED_DOCS: Readonly<Record<string, string>> = {\n${mapEntries}\n};\n\nexport const EMBEDDED_DOC_FILENAMES = Object.keys(EMBEDDED_DOCS).sort();\n`;
17
+ const docs = [...entries];
18
+
19
+ const mapEntries = await Promise.all(
20
+ docs.map(async (relativePath) => {
21
+ const content = await Bun.file(path.join(docsDir, relativePath)).text();
22
+ return `\t"${relativePath}": ${JSON.stringify(content)},`;
23
+ }),
24
+ );
25
+
26
+
27
+ const output = `// Auto-generated by scripts/generate-docs-index.ts - DO NOT EDIT\n\nexport const EMBEDDED_DOCS: Readonly<Record<string, string>> = {\n${mapEntries.join("\n")}\n};\n\nexport const EMBEDDED_DOC_FILENAMES = Object.keys(EMBEDDED_DOCS).sort();\n`;
54
28
 
55
29
  await Bun.write(outputPath, output);
56
30
  console.log(`Generated ${path.relative(process.cwd(), outputPath)} (${docs.length} docs)`);