@cad0p/pi-napkin 0.3.2 → 0.4.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.
@@ -0,0 +1,49 @@
1
+ /**
2
+ * Type shims for @cad0p/napkin's untyped transitive dependencies.
3
+ *
4
+ * napkin ships its TypeScript *sources* (no `dist/`, no bundled `.d.ts`),
5
+ * so importing `Napkin` pulls napkin's `src/` into this project's `tsc`
6
+ * compilation. napkin 0.10's `bases.ts`/`formula.ts` import `js-yaml`,
7
+ * `sql.js`, and `jexl`, none of which ship type declarations. napkin
8
+ * itself stays green because it carries `src/types.d.ts` shims — but
9
+ * those live inside `node_modules/@cad0p/napkin` and are NOT picked up
10
+ * by a consumer's compilation.
11
+ *
12
+ * The `sql.js` and `jexl` declarations below mirror napkin's own
13
+ * `src/types.d.ts` *verbatim* so that `bases.ts`/`formula.ts` typecheck
14
+ * here exactly as they do in napkin's repo. This is deliberately *not*
15
+ * `@types/sql.js`: the real `@types/sql.js` exposes a genuine internal
16
+ * mismatch in napkin's `bases.ts` (`unknown[][]` vs `SqlValue[][]`,
17
+ * TS2322) that this extension does not exercise and that belongs to
18
+ * napkin. `js-yaml` is declared as `any` (napkin's code only calls
19
+ * `yaml.load`, and napkin itself uses `@types/js-yaml`). These three
20
+ * modules are never imported by pi-napkin code directly.
21
+ */
22
+ declare module "js-yaml";
23
+
24
+ declare module "sql.js" {
25
+ interface Database {
26
+ run(sql: string, params?: unknown[]): void;
27
+ exec(sql: string): { columns: string[]; values: unknown[][] }[];
28
+ close(): void;
29
+ // biome-ignore lint/complexity/noBannedTypes: sql.js dynamic function registration
30
+ create_function(name: string, fn: Function): void;
31
+ }
32
+ interface SqlJsStatic {
33
+ Database: new () => Database;
34
+ }
35
+
36
+ export type { Database };
37
+ export default function initSqlJs(): Promise<SqlJsStatic>;
38
+ }
39
+
40
+ declare module "jexl" {
41
+ class Jexl {
42
+ eval(expr: string, context?: Record<string, unknown>): Promise<unknown>;
43
+ // biome-ignore lint/complexity/noBannedTypes: jexl dynamic function registration
44
+ addFunction(name: string, fn: Function): void;
45
+ // biome-ignore lint/complexity/noBannedTypes: jexl dynamic transform registration
46
+ addTransform(name: string, fn: Function): void;
47
+ }
48
+ export default { Jexl };
49
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cad0p/pi-napkin",
3
- "version": "0.3.2",
3
+ "version": "0.4.0",
4
4
  "description": "📜 Napkin integration for pi — vault context, knowledge tools, and automatic distillation with git-worktree concurrency safety",
5
5
  "type": "module",
6
6
  "packageManager": "pnpm@11.10.0",
@@ -65,7 +65,7 @@
65
65
  "vitest": "^2.1.0"
66
66
  },
67
67
  "dependencies": {
68
- "@cad0p/napkin": "^0.8.1"
68
+ "@cad0p/napkin": "^0.10.0"
69
69
  },
70
70
  "peerDependencies": {
71
71
  "@earendil-works/pi-coding-agent": ">=0.74.0",