@maria_rcks/t1code 0.0.6 → 0.0.7

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 (112) hide show
  1. package/dist/index.mjs +29526 -872
  2. package/dist/server/BunPTY-tfevpp75.js +114 -0
  3. package/dist/server/NodePTY-shw8pxrb.js +115 -0
  4. package/dist/server/NodeSqliteClient-1zz4vbn2.js +180 -0
  5. package/dist/server/SqliteClient-53018gfq.js +147 -0
  6. package/dist/server/index-313s4ptc.js +18 -0
  7. package/dist/server/index-8anfbrkb.js +844 -0
  8. package/dist/server/index-9kq36ye2.js +584 -0
  9. package/dist/server/index-jgecjkfd.js +34490 -0
  10. package/dist/server/index-wckvcay0.js +48 -0
  11. package/dist/server/index-wrajk4wc.js +523 -0
  12. package/dist/server/index-z7xpvjdt.js +247 -0
  13. package/dist/server/index.js +56202 -0
  14. package/dist/server/node_modules/node-pty/LICENSE +69 -0
  15. package/dist/server/node_modules/node-pty/README.md +165 -0
  16. package/dist/server/node_modules/node-pty/lib/conpty_console_list_agent.js +16 -0
  17. package/dist/server/node_modules/node-pty/lib/conpty_console_list_agent.js.map +1 -0
  18. package/dist/server/node_modules/node-pty/lib/eventEmitter2.js +47 -0
  19. package/dist/server/node_modules/node-pty/lib/eventEmitter2.js.map +1 -0
  20. package/dist/server/node_modules/node-pty/lib/eventEmitter2.test.js +30 -0
  21. package/dist/server/node_modules/node-pty/lib/eventEmitter2.test.js.map +1 -0
  22. package/dist/server/node_modules/node-pty/lib/index.js +52 -0
  23. package/dist/server/node_modules/node-pty/lib/index.js.map +1 -0
  24. package/dist/server/node_modules/node-pty/lib/interfaces.js +7 -0
  25. package/dist/server/node_modules/node-pty/lib/interfaces.js.map +1 -0
  26. package/dist/server/node_modules/node-pty/lib/shared/conout.js +11 -0
  27. package/dist/server/node_modules/node-pty/lib/shared/conout.js.map +1 -0
  28. package/dist/server/node_modules/node-pty/lib/terminal.js +190 -0
  29. package/dist/server/node_modules/node-pty/lib/terminal.js.map +1 -0
  30. package/dist/server/node_modules/node-pty/lib/terminal.test.js +139 -0
  31. package/dist/server/node_modules/node-pty/lib/terminal.test.js.map +1 -0
  32. package/dist/server/node_modules/node-pty/lib/testUtils.test.js +28 -0
  33. package/dist/server/node_modules/node-pty/lib/testUtils.test.js.map +1 -0
  34. package/dist/server/node_modules/node-pty/lib/types.js +7 -0
  35. package/dist/server/node_modules/node-pty/lib/types.js.map +1 -0
  36. package/dist/server/node_modules/node-pty/lib/unixTerminal.js +346 -0
  37. package/dist/server/node_modules/node-pty/lib/unixTerminal.js.map +1 -0
  38. package/dist/server/node_modules/node-pty/lib/unixTerminal.test.js +351 -0
  39. package/dist/server/node_modules/node-pty/lib/unixTerminal.test.js.map +1 -0
  40. package/dist/server/node_modules/node-pty/lib/utils.js +39 -0
  41. package/dist/server/node_modules/node-pty/lib/utils.js.map +1 -0
  42. package/dist/server/node_modules/node-pty/lib/windowsConoutConnection.js +125 -0
  43. package/dist/server/node_modules/node-pty/lib/windowsConoutConnection.js.map +1 -0
  44. package/dist/server/node_modules/node-pty/lib/windowsPtyAgent.js +320 -0
  45. package/dist/server/node_modules/node-pty/lib/windowsPtyAgent.js.map +1 -0
  46. package/dist/server/node_modules/node-pty/lib/windowsPtyAgent.test.js +90 -0
  47. package/dist/server/node_modules/node-pty/lib/windowsPtyAgent.test.js.map +1 -0
  48. package/dist/server/node_modules/node-pty/lib/windowsTerminal.js +199 -0
  49. package/dist/server/node_modules/node-pty/lib/windowsTerminal.js.map +1 -0
  50. package/dist/server/node_modules/node-pty/lib/windowsTerminal.test.js +219 -0
  51. package/dist/server/node_modules/node-pty/lib/windowsTerminal.test.js.map +1 -0
  52. package/dist/server/node_modules/node-pty/lib/worker/conoutSocketWorker.js +22 -0
  53. package/dist/server/node_modules/node-pty/lib/worker/conoutSocketWorker.js.map +1 -0
  54. package/dist/server/node_modules/node-pty/package.json +64 -0
  55. package/dist/server/node_modules/node-pty/prebuilds/darwin-arm64/pty.node +0 -0
  56. package/dist/server/node_modules/node-pty/prebuilds/darwin-arm64/spawn-helper +0 -0
  57. package/dist/server/node_modules/node-pty/prebuilds/darwin-x64/pty.node +0 -0
  58. package/dist/server/node_modules/node-pty/prebuilds/darwin-x64/spawn-helper +0 -0
  59. package/dist/server/node_modules/node-pty/prebuilds/win32-arm64/conpty/OpenConsole.exe +0 -0
  60. package/dist/server/node_modules/node-pty/prebuilds/win32-arm64/conpty/conpty.dll +0 -0
  61. package/dist/server/node_modules/node-pty/prebuilds/win32-arm64/conpty.node +0 -0
  62. package/dist/server/node_modules/node-pty/prebuilds/win32-arm64/conpty.pdb +0 -0
  63. package/dist/server/node_modules/node-pty/prebuilds/win32-arm64/conpty_console_list.node +0 -0
  64. package/dist/server/node_modules/node-pty/prebuilds/win32-arm64/conpty_console_list.pdb +0 -0
  65. package/dist/server/node_modules/node-pty/prebuilds/win32-arm64/pty.node +0 -0
  66. package/dist/server/node_modules/node-pty/prebuilds/win32-arm64/pty.pdb +0 -0
  67. package/dist/server/node_modules/node-pty/prebuilds/win32-arm64/winpty-agent.exe +0 -0
  68. package/dist/server/node_modules/node-pty/prebuilds/win32-arm64/winpty-agent.pdb +0 -0
  69. package/dist/server/node_modules/node-pty/prebuilds/win32-arm64/winpty.dll +0 -0
  70. package/dist/server/node_modules/node-pty/prebuilds/win32-arm64/winpty.pdb +0 -0
  71. package/dist/server/node_modules/node-pty/prebuilds/win32-x64/conpty/OpenConsole.exe +0 -0
  72. package/dist/server/node_modules/node-pty/prebuilds/win32-x64/conpty/conpty.dll +0 -0
  73. package/dist/server/node_modules/node-pty/prebuilds/win32-x64/conpty.node +0 -0
  74. package/dist/server/node_modules/node-pty/prebuilds/win32-x64/conpty.pdb +0 -0
  75. package/dist/server/node_modules/node-pty/prebuilds/win32-x64/conpty_console_list.node +0 -0
  76. package/dist/server/node_modules/node-pty/prebuilds/win32-x64/conpty_console_list.pdb +0 -0
  77. package/dist/server/node_modules/node-pty/prebuilds/win32-x64/pty.node +0 -0
  78. package/dist/server/node_modules/node-pty/prebuilds/win32-x64/pty.pdb +0 -0
  79. package/dist/server/node_modules/node-pty/prebuilds/win32-x64/winpty-agent.exe +0 -0
  80. package/dist/server/node_modules/node-pty/prebuilds/win32-x64/winpty-agent.pdb +0 -0
  81. package/dist/server/node_modules/node-pty/prebuilds/win32-x64/winpty.dll +0 -0
  82. package/dist/server/node_modules/node-pty/prebuilds/win32-x64/winpty.pdb +0 -0
  83. package/dist/server/node_modules/node-pty/typings/node-pty.d.ts +211 -0
  84. package/package.json +1 -7
  85. package/dist/server/BunPTY-3FAOkA1C.cjs +0 -91
  86. package/dist/server/BunPTY-3FAOkA1C.cjs.map +0 -1
  87. package/dist/server/BunPTY-B9Pc7ndx.mjs +0 -91
  88. package/dist/server/BunPTY-B9Pc7ndx.mjs.map +0 -1
  89. package/dist/server/NodePTY-CZNVLBpq.mjs +0 -85
  90. package/dist/server/NodePTY-CZNVLBpq.mjs.map +0 -1
  91. package/dist/server/NodePTY-CbnaoLlj.cjs +0 -86
  92. package/dist/server/NodePTY-CbnaoLlj.cjs.map +0 -1
  93. package/dist/server/NodeSqliteClient-C5fYhtpO.cjs +0 -147
  94. package/dist/server/NodeSqliteClient-C5fYhtpO.cjs.map +0 -1
  95. package/dist/server/NodeSqliteClient-COEUidVC.mjs +0 -143
  96. package/dist/server/NodeSqliteClient-COEUidVC.mjs.map +0 -1
  97. package/dist/server/SqlError-7DUB2NkG.mjs +0 -43
  98. package/dist/server/SqlError-7DUB2NkG.mjs.map +0 -1
  99. package/dist/server/SqlError-CAzXmpza.cjs +0 -48
  100. package/dist/server/SqlError-CAzXmpza.cjs.map +0 -1
  101. package/dist/server/SqliteClient-BMlcF9O1.cjs +0 -133
  102. package/dist/server/SqliteClient-BMlcF9O1.cjs.map +0 -1
  103. package/dist/server/SqliteClient-MZci3yRi.mjs +0 -129
  104. package/dist/server/SqliteClient-MZci3yRi.mjs.map +0 -1
  105. package/dist/server/index.cjs +0 -102183
  106. package/dist/server/index.cjs.map +0 -1
  107. package/dist/server/index.mjs +0 -102127
  108. package/dist/server/index.mjs.map +0 -1
  109. package/dist/server/open-BGXDmMPQ.cjs +0 -501
  110. package/dist/server/open-BGXDmMPQ.cjs.map +0 -1
  111. package/dist/server/open-BvXvp1QV.mjs +0 -492
  112. package/dist/server/open-BvXvp1QV.mjs.map +0 -1
@@ -1,91 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- const require_index = require('./index.cjs');
4
-
5
- //#region src/terminal/Layers/BunPTY.ts
6
- var BunPtyProcess = class {
7
- dataListeners = /* @__PURE__ */ new Set();
8
- exitListeners = /* @__PURE__ */ new Set();
9
- decoder = new TextDecoder();
10
- didExit = false;
11
- constructor(process) {
12
- this.process = process;
13
- this.process.exited.then((exitCode) => {
14
- this.emitExit({
15
- exitCode: Number.isInteger(exitCode) ? exitCode : 0,
16
- signal: typeof this.process.signalCode === "number" ? this.process.signalCode : null
17
- });
18
- }).catch(() => {
19
- this.emitExit({
20
- exitCode: 1,
21
- signal: null
22
- });
23
- });
24
- }
25
- get pid() {
26
- return this.process.pid;
27
- }
28
- write(data) {
29
- if (!this.process.terminal) throw new Error("Bun PTY terminal handle is unavailable");
30
- this.process.terminal.write(data);
31
- }
32
- resize(cols, rows) {
33
- if (!this.process.terminal?.resize) throw new Error("Bun PTY resize is unavailable");
34
- this.process.terminal.resize(cols, rows);
35
- }
36
- kill(signal) {
37
- if (!signal) {
38
- this.process.kill();
39
- return;
40
- }
41
- this.process.kill(signal);
42
- }
43
- onData(callback) {
44
- this.dataListeners.add(callback);
45
- return () => {
46
- this.dataListeners.delete(callback);
47
- };
48
- }
49
- onExit(callback) {
50
- this.exitListeners.add(callback);
51
- return () => {
52
- this.exitListeners.delete(callback);
53
- };
54
- }
55
- emitData(data) {
56
- if (this.didExit) return;
57
- const text = this.decoder.decode(data, { stream: true });
58
- if (text.length === 0) return;
59
- for (const listener of this.dataListeners) listener(text);
60
- }
61
- emitExit(event) {
62
- if (this.didExit) return;
63
- this.didExit = true;
64
- const remainder = this.decoder.decode();
65
- if (remainder.length > 0) for (const listener of this.dataListeners) listener(remainder);
66
- for (const listener of this.exitListeners) listener(event);
67
- }
68
- };
69
- const layer = require_index.effect(require_index.PtyAdapter, require_index.gen(function* () {
70
- if (process.platform === "win32") return yield* require_index.die$1("Bun PTY terminal support is unavailable on Windows. Please use Node.js (e.g. by running `npx t3`) instead.");
71
- return { spawn: (input) => require_index.sync(() => {
72
- let processHandle = null;
73
- const command = [input.shell, ...input.args ?? []];
74
- processHandle = new BunPtyProcess(Bun.spawn(command, {
75
- cwd: input.cwd,
76
- env: input.env,
77
- terminal: {
78
- cols: input.cols,
79
- rows: input.rows,
80
- data: (_terminal, data) => {
81
- processHandle?.emitData(data);
82
- }
83
- }
84
- }));
85
- return processHandle;
86
- }) };
87
- }));
88
-
89
- //#endregion
90
- exports.layer = layer;
91
- //# sourceMappingURL=BunPTY-3FAOkA1C.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"BunPTY-3FAOkA1C.cjs","names":["PtyAdapter"],"sources":["../src/terminal/Layers/BunPTY.ts"],"sourcesContent":["import { Effect, Layer } from \"effect\";\nimport { PtyAdapter, PtyAdapterShape, PtyExitEvent, PtyProcess } from \"../Services/PTY\";\n\nclass BunPtyProcess implements PtyProcess {\n private readonly dataListeners = new Set<(data: string) => void>();\n private readonly exitListeners = new Set<(event: PtyExitEvent) => void>();\n private readonly decoder = new TextDecoder();\n private didExit = false;\n\n constructor(private readonly process: Bun.Subprocess) {\n void this.process.exited\n .then((exitCode) => {\n this.emitExit({\n exitCode: Number.isInteger(exitCode) ? exitCode : 0,\n signal: typeof this.process.signalCode === \"number\" ? this.process.signalCode : null,\n });\n })\n .catch(() => {\n this.emitExit({ exitCode: 1, signal: null });\n });\n }\n\n get pid(): number {\n return this.process.pid;\n }\n\n write(data: string): void {\n if (!this.process.terminal) {\n throw new Error(\"Bun PTY terminal handle is unavailable\");\n }\n this.process.terminal.write(data);\n }\n\n resize(cols: number, rows: number): void {\n if (!this.process.terminal?.resize) {\n throw new Error(\"Bun PTY resize is unavailable\");\n }\n this.process.terminal.resize(cols, rows);\n }\n\n kill(signal?: string): void {\n if (!signal) {\n this.process.kill();\n return;\n }\n this.process.kill(signal as NodeJS.Signals);\n }\n\n onData(callback: (data: string) => void): () => void {\n this.dataListeners.add(callback);\n return () => {\n this.dataListeners.delete(callback);\n };\n }\n\n onExit(callback: (event: PtyExitEvent) => void): () => void {\n this.exitListeners.add(callback);\n return () => {\n this.exitListeners.delete(callback);\n };\n }\n\n emitData(data: Uint8Array): void {\n if (this.didExit) return;\n const text = this.decoder.decode(data, { stream: true });\n if (text.length === 0) return;\n for (const listener of this.dataListeners) {\n listener(text);\n }\n }\n\n private emitExit(event: PtyExitEvent): void {\n if (this.didExit) return;\n this.didExit = true;\n\n const remainder = this.decoder.decode();\n if (remainder.length > 0) {\n for (const listener of this.dataListeners) {\n listener(remainder);\n }\n }\n\n for (const listener of this.exitListeners) {\n listener(event);\n }\n }\n}\n\nexport const layer = Layer.effect(\n PtyAdapter,\n Effect.gen(function* () {\n if (process.platform === \"win32\") {\n return yield* Effect.die(\n \"Bun PTY terminal support is unavailable on Windows. Please use Node.js (e.g. by running `npx t3`) instead.\",\n );\n }\n return {\n spawn: (input) =>\n Effect.sync(() => {\n let processHandle: BunPtyProcess | null = null;\n const command = [input.shell, ...(input.args ?? [])];\n const subprocess = Bun.spawn(command, {\n cwd: input.cwd,\n env: input.env,\n terminal: {\n cols: input.cols,\n rows: input.rows,\n data: (_terminal, data) => {\n processHandle?.emitData(data);\n },\n },\n });\n processHandle = new BunPtyProcess(subprocess);\n return processHandle;\n }),\n } satisfies PtyAdapterShape;\n }),\n);\n"],"mappings":";;;;;AAGA,IAAM,gBAAN,MAA0C;CACxC,AAAiB,gCAAgB,IAAI,KAA6B;CAClE,AAAiB,gCAAgB,IAAI,KAAoC;CACzE,AAAiB,UAAU,IAAI,aAAa;CAC5C,AAAQ,UAAU;C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rB,MAAK,MAAM,YAAY,KAAK,cAC1B,UAAS,UAAU;AAIvB,OAAK,MAAM,YAAY,KAAK,cAC1B,UAAS,MAAM;;;AAKrB,MAAa,6BACXA,4CACW,aAAa;AACtB,KAAI,QAAQ,aAAa,QACvB,QAAO,2BACL,6GACD;AAEH,QAAO,EACL,QAAQ,mCACY;EAChB,IAAI,gBAAsC;EAC1C,MAAM,UAAU,CAAC,MAAM,OAAO,GAAI,MAAM,QAAQ,EAAE,CAAE;AAYpD,kBAAgB,IAAI,cAXD,IAAI,MAAM,SAAS;GACpC,KAAK,MAAM;GACX,KAAK,MAAM;GACX,UAAU;IACR,MAAM,MAAM;IACZ,MAAM,MAAM;IACZ,OAAO,WAAW,SAAS;AACzB,oBAAe,SAAS,KAAK;;IAEhC;GACF,CAAC,CAC2C;AAC7C,SAAO;GACP,EACL;EACD,CACH"}
@@ -1,91 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- import { H as effect, I as sync, T as die, k as gen, t as PtyAdapter } from "./index.mjs";
4
-
5
- //#region src/terminal/Layers/BunPTY.ts
6
- var BunPtyProcess = class {
7
- dataListeners = /* @__PURE__ */ new Set();
8
- exitListeners = /* @__PURE__ */ new Set();
9
- decoder = new TextDecoder();
10
- didExit = false;
11
- constructor(process) {
12
- this.process = process;
13
- this.process.exited.then((exitCode) => {
14
- this.emitExit({
15
- exitCode: Number.isInteger(exitCode) ? exitCode : 0,
16
- signal: typeof this.process.signalCode === "number" ? this.process.signalCode : null
17
- });
18
- }).catch(() => {
19
- this.emitExit({
20
- exitCode: 1,
21
- signal: null
22
- });
23
- });
24
- }
25
- get pid() {
26
- return this.process.pid;
27
- }
28
- write(data) {
29
- if (!this.process.terminal) throw new Error("Bun PTY terminal handle is unavailable");
30
- this.process.terminal.write(data);
31
- }
32
- resize(cols, rows) {
33
- if (!this.process.terminal?.resize) throw new Error("Bun PTY resize is unavailable");
34
- this.process.terminal.resize(cols, rows);
35
- }
36
- kill(signal) {
37
- if (!signal) {
38
- this.process.kill();
39
- return;
40
- }
41
- this.process.kill(signal);
42
- }
43
- onData(callback) {
44
- this.dataListeners.add(callback);
45
- return () => {
46
- this.dataListeners.delete(callback);
47
- };
48
- }
49
- onExit(callback) {
50
- this.exitListeners.add(callback);
51
- return () => {
52
- this.exitListeners.delete(callback);
53
- };
54
- }
55
- emitData(data) {
56
- if (this.didExit) return;
57
- const text = this.decoder.decode(data, { stream: true });
58
- if (text.length === 0) return;
59
- for (const listener of this.dataListeners) listener(text);
60
- }
61
- emitExit(event) {
62
- if (this.didExit) return;
63
- this.didExit = true;
64
- const remainder = this.decoder.decode();
65
- if (remainder.length > 0) for (const listener of this.dataListeners) listener(remainder);
66
- for (const listener of this.exitListeners) listener(event);
67
- }
68
- };
69
- const layer = effect(PtyAdapter, gen(function* () {
70
- if (process.platform === "win32") return yield* die("Bun PTY terminal support is unavailable on Windows. Please use Node.js (e.g. by running `npx t3`) instead.");
71
- return { spawn: (input) => sync(() => {
72
- let processHandle = null;
73
- const command = [input.shell, ...input.args ?? []];
74
- processHandle = new BunPtyProcess(Bun.spawn(command, {
75
- cwd: input.cwd,
76
- env: input.env,
77
- terminal: {
78
- cols: input.cols,
79
- rows: input.rows,
80
- data: (_terminal, data) => {
81
- processHandle?.emitData(data);
82
- }
83
- }
84
- }));
85
- return processHandle;
86
- }) };
87
- }));
88
-
89
- //#endregion
90
- export { layer };
91
- //# sourceMappingURL=BunPTY-B9Pc7ndx.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"BunPTY-B9Pc7ndx.mjs","names":["Layer.effect","Effect.gen","Effect.die","Effect.sync"],"sources":["../src/terminal/Layers/BunPTY.ts"],"sourcesContent":["import { Effect, Layer } from \"effect\";\nimport { PtyAdapter, PtyAdapterShape, PtyExitEvent, PtyProcess } from \"../Services/PTY\";\n\nclass BunPtyProcess implements PtyProcess {\n private readonly dataListeners = new Set<(data: string) => void>();\n private readonly exitListeners = new Set<(event: PtyExitEvent) => void>();\n private readonly decoder = new TextDecoder();\n private didExit = false;\n\n constructor(private readonly process: Bun.Subprocess) {\n void this.process.exited\n .then((exitCode) => {\n this.emitExit({\n exitCode: Number.isInteger(exitCode) ? exitCode : 0,\n signal: typeof this.process.signalCode === \"number\" ? this.process.signalCode : null,\n });\n })\n .catch(() => {\n this.emitExit({ exitCode: 1, signal: null });\n });\n }\n\n get pid(): number {\n return this.process.pid;\n }\n\n write(data: string): void {\n if (!this.process.terminal) {\n throw new Error(\"Bun PTY terminal handle is unavailable\");\n }\n this.process.terminal.write(data);\n }\n\n resize(cols: number, rows: number): void {\n if (!this.process.terminal?.resize) {\n throw new Error(\"Bun PTY resize is unavailable\");\n }\n this.process.terminal.resize(cols, rows);\n }\n\n kill(signal?: string): void {\n if (!signal) {\n this.process.kill();\n return;\n }\n this.process.kill(signal as NodeJS.Signals);\n }\n\n onData(callback: (data: string) => void): () => void {\n this.dataListeners.add(callback);\n return () => {\n this.dataListeners.delete(callback);\n };\n }\n\n onExit(callback: (event: PtyExitEvent) => void): () => void {\n this.exitListeners.add(callback);\n return () => {\n this.exitListeners.delete(callback);\n };\n }\n\n emitData(data: Uint8Array): void {\n if (this.didExit) return;\n const text = this.decoder.decode(data, { stream: true });\n if (text.length === 0) return;\n for (const listener of this.dataListeners) {\n listener(text);\n }\n }\n\n private emitExit(event: PtyExitEvent): void {\n if (this.didExit) return;\n this.didExit = true;\n\n const remainder = this.decoder.decode();\n if (remainder.length > 0) {\n for (const listener of this.dataListeners) {\n listener(remainder);\n }\n }\n\n for (const listener of this.exitListeners) {\n listener(event);\n }\n }\n}\n\nexport const layer = Layer.effect(\n PtyAdapter,\n Effect.gen(function* () {\n if (process.platform === \"win32\") {\n return yield* Effect.die(\n \"Bun PTY terminal support is unavailable on Windows. Please use Node.js (e.g. by running `npx t3`) instead.\",\n );\n }\n return {\n spawn: (input) =>\n Effect.sync(() => {\n let processHandle: BunPtyProcess | null = null;\n const command = [input.shell, ...(input.args ?? [])];\n const subprocess = Bun.spawn(command, {\n cwd: input.cwd,\n env: input.env,\n terminal: {\n cols: input.cols,\n rows: input.rows,\n data: (_terminal, data) => {\n processHandle?.emitData(data);\n },\n },\n });\n processHandle = new BunPtyProcess(subprocess);\n return processHandle;\n }),\n } satisfies PtyAdapterShape;\n }),\n);\n"],"mappings":";;;;;AAGA,IAAM,gBAAN,MAA0C;CACxC,AAAiB,gCAAgB,IAAI,KAA6B;CAClE,AAAiB,gCAAgB,IAAI,KAAoC;CACzE,AAAiB,UAAU,IAAI,aAAa;CAC5C,AAAQ,UAAU;CAElB,YAAY,AAAiB,SAAyB;EAAzB;AAC3B,EAAK,KAAK,QAAQ,OACf,MAAM,aAAa;AAClB,QAAK,SAAS;IACZ,UAAU,OAAO,UAAU,SAAS,GAAG,WAAW;IAClD,QAAQ,OAAO,KAAK,QAAQ,eAAe,WAAW,KAAK,QAAQ,aAAa;IACjF,CAAC;IACF,CACD,YAAY;AACX,QAAK,SAAS;IAAE,UAAU;IAAG,QAAQ;IAAM,CAAC;IAC5C;;CAGN,IAAI,MAAc;AAChB,SAAO,KAAK,QAAQ;;CAGtB,MAAM,MAAoB;AACxB,MAAI,CAAC,KAAK,QAAQ,SAChB,OAAM,IAAI,MAAM,yCAAyC;AAE3D,OAAK,QAAQ,SAAS,MAAM,KAAK;;CAGnC,OAAO,MAAc,MAAoB;AACvC,MAAI,CAAC,KAAK,QAAQ,UAAU,OAC1B,OAAM,IAAI,MAAM,gCAAgC;AAElD,OAAK,QAAQ,SAAS,OAAO,MAAM,KAAK;;CAG1C,KAAK,QAAuB;AAC1B,MAAI,CAAC,QAAQ;AACX,QAAK,QAAQ,MAAM;AACnB;;AAEF,OAAK,QAAQ,KAAK,OAAyB;;CAG7C,OAAO,UAA8C;AACnD,OAAK,cAAc,IAAI,SAAS;AAChC,eAAa;AACX,QAAK,cAAc,OAAO,SAAS;;;CAIvC,OAAO,UAAqD;AAC1D,OAAK,cAAc,IAAI,SAAS;AAChC,eAAa;AACX,QAAK,cAAc,OAAO,SAAS;;;CAIvC,SAAS,MAAwB;AAC/B,MAAI,KAAK,QAAS;EAClB,MAAM,OAAO,KAAK,QAAQ,OAAO,MAAM,EAAE,QAAQ,MAAM,CAAC;AACxD,MAAI,KAAK,WAAW,EAAG;AACvB,OAAK,MAAM,YAAY,KAAK,cAC1B,UAAS,KAAK;;CAIlB,AAAQ,SAAS,OAA2B;AAC1C,MAAI,KAAK,QAAS;AAClB,OAAK,UAAU;EAEf,MAAM,YAAY,KAAK,QAAQ,QAAQ;AACvC,MAAI,UAAU,SAAS,EACrB,MAAK,MAAM,YAAY,KAAK,cAC1B,UAAS,UAAU;AAIvB,OAAK,MAAM,YAAY,KAAK,cAC1B,UAAS,MAAM;;;AAKrB,MAAa,QAAQA,OACnB,YACAC,IAAW,aAAa;AACtB,KAAI,QAAQ,aAAa,QACvB,QAAO,OAAOC,IACZ,6GACD;AAEH,QAAO,EACL,QAAQ,UACNC,WAAkB;EAChB,IAAI,gBAAsC;EAC1C,MAAM,UAAU,CAAC,MAAM,OAAO,GAAI,MAAM,QAAQ,EAAE,CAAE;AAYpD,kBAAgB,IAAI,cAXD,IAAI,MAAM,SAAS;GACpC,KAAK,MAAM;GACX,KAAK,MAAM;GACX,UAAU;IACR,MAAM,MAAM;IACZ,MAAM,MAAM;IACZ,OAAO,WAAW,SAAS;AACzB,oBAAe,SAAS,KAAK;;IAEhC;GACF,CAAC,CAC2C;AAC7C,SAAO;GACP,EACL;EACD,CACH"}
@@ -1,85 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- import { H as effect, M as promise, N as provideService, O as fn, _ as FileSystem, g as Path, j as orElseSucceed, k as gen, t as PtyAdapter, w as cached } from "./index.mjs";
4
- import { createRequire } from "node:module";
5
-
6
- //#region src/terminal/Layers/NodePTY.ts
7
- let didEnsureSpawnHelperExecutable = false;
8
- const resolveNodePtySpawnHelperPath = gen(function* () {
9
- const requireForNodePty = createRequire(import.meta.url);
10
- const path = yield* Path;
11
- const fs = yield* FileSystem;
12
- const packageJsonPath = requireForNodePty.resolve("node-pty/package.json");
13
- const packageDir = path.dirname(packageJsonPath);
14
- const candidates = [
15
- path.join(packageDir, "build", "Release", "spawn-helper"),
16
- path.join(packageDir, "build", "Debug", "spawn-helper"),
17
- path.join(packageDir, "prebuilds", `${process.platform}-${process.arch}`, "spawn-helper")
18
- ];
19
- for (const candidate of candidates) if (yield* fs.exists(candidate)) return candidate;
20
- return null;
21
- }).pipe(orElseSucceed(() => null));
22
- const ensureNodePtySpawnHelperExecutable = fn(function* (explicitPath) {
23
- const fs = yield* FileSystem;
24
- if (process.platform === "win32") return;
25
- if (!explicitPath && didEnsureSpawnHelperExecutable) return;
26
- const helperPath = explicitPath ?? (yield* resolveNodePtySpawnHelperPath);
27
- if (!helperPath) return;
28
- if (!explicitPath) didEnsureSpawnHelperExecutable = true;
29
- if (!(yield* fs.exists(helperPath))) return;
30
- yield* fs.chmod(helperPath, 493).pipe(orElseSucceed(() => void 0));
31
- });
32
- var NodePtyProcess = class {
33
- constructor(process) {
34
- this.process = process;
35
- }
36
- get pid() {
37
- return this.process.pid;
38
- }
39
- write(data) {
40
- this.process.write(data);
41
- }
42
- resize(cols, rows) {
43
- this.process.resize(cols, rows);
44
- }
45
- kill(signal) {
46
- this.process.kill(signal);
47
- }
48
- onData(callback) {
49
- const disposable = this.process.onData(callback);
50
- return () => {
51
- disposable.dispose();
52
- };
53
- }
54
- onExit(callback) {
55
- const disposable = this.process.onExit((event) => {
56
- callback({
57
- exitCode: event.exitCode,
58
- signal: event.signal ?? null
59
- });
60
- });
61
- return () => {
62
- disposable.dispose();
63
- };
64
- }
65
- };
66
- const layer = effect(PtyAdapter, gen(function* () {
67
- const fs = yield* FileSystem;
68
- const path = yield* Path;
69
- const nodePty = yield* promise(() => import("node-pty"));
70
- const ensureNodePtySpawnHelperExecutableCached = yield* cached(ensureNodePtySpawnHelperExecutable().pipe(provideService(FileSystem, fs), provideService(Path, path), orElseSucceed(() => void 0)));
71
- return { spawn: fn(function* (input) {
72
- yield* ensureNodePtySpawnHelperExecutableCached;
73
- return new NodePtyProcess(nodePty.spawn(input.shell, input.args ?? [], {
74
- cwd: input.cwd,
75
- cols: input.cols,
76
- rows: input.rows,
77
- env: input.env,
78
- name: globalThis.process.platform === "win32" ? "xterm-color" : "xterm-256color"
79
- }));
80
- }) };
81
- }));
82
-
83
- //#endregion
84
- export { ensureNodePtySpawnHelperExecutable, layer };
85
- //# sourceMappingURL=NodePTY-CZNVLBpq.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"NodePTY-CZNVLBpq.mjs","names":["Effect.gen","Path.Path","FileSystem.FileSystem","Effect.orElseSucceed","Effect.fn","Layer.effect","Effect.promise","Effect.cached","Effect.provideService"],"sources":["../src/terminal/Layers/NodePTY.ts"],"sourcesContent":["import { createRequire } from \"node:module\";\n\nimport { Effect, FileSystem, Layer, Path } from \"effect\";\nimport { PtyAdapter, PtyAdapterShape, PtyExitEvent, PtyProcess } from \"../Services/PTY\";\n\nlet didEnsureSpawnHelperExecutable = false;\n\nconst resolveNodePtySpawnHelperPath = Effect.gen(function* () {\n const requireForNodePty = createRequire(import.meta.url);\n const path = yield* Path.Path;\n const fs = yield* FileSystem.FileSystem;\n\n const packageJsonPath = requireForNodePty.resolve(\"node-pty/package.json\");\n const packageDir = path.dirname(packageJsonPath);\n const candidates = [\n path.join(packageDir, \"build\", \"Release\", \"spawn-helper\"),\n path.join(packageDir, \"build\", \"Debug\", \"spawn-helper\"),\n path.join(packageDir, \"prebuilds\", `${process.platform}-${process.arch}`, \"spawn-helper\"),\n ];\n\n for (const candidate of candidates) {\n if (yield* fs.exists(candidate)) {\n return candidate;\n }\n }\n return null;\n}).pipe(Effect.orElseSucceed(() => null));\n\nexport const ensureNodePtySpawnHelperExecutable = Effect.fn(function* (explicitPath?: string) {\n const fs = yield* FileSystem.FileSystem;\n if (process.platform === \"win32\") return;\n if (!explicitPath && didEnsureSpawnHelperExecutable) return;\n\n const helperPath = explicitPath ?? (yield* resolveNodePtySpawnHelperPath);\n if (!helperPath) return;\n if (!explicitPath) {\n didEnsureSpawnHelperExecutable = true;\n }\n\n if (!(yield* fs.exists(helperPath))) {\n return;\n }\n\n // Best-effort: avoid FileSystem.stat in packaged mode where some fs metadata can be missing.\n yield* fs.chmod(helperPath, 0o755).pipe(Effect.orElseSucceed(() => undefined));\n});\n\nclass NodePtyProcess implements PtyProcess {\n constructor(private readonly process: import(\"node-pty\").IPty) {}\n\n get pid(): number {\n return this.process.pid;\n }\n\n write(data: string): void {\n this.process.write(data);\n }\n\n resize(cols: number, rows: number): void {\n this.process.resize(cols, rows);\n }\n\n kill(signal?: string): void {\n this.process.kill(signal);\n }\n\n onData(callback: (data: string) => void): () => void {\n const disposable = this.process.onData(callback);\n return () => {\n disposable.dispose();\n };\n }\n\n onExit(callback: (event: PtyExitEvent) => void): () => void {\n const disposable = this.process.onExit((event) => {\n callback({\n exitCode: event.exitCode,\n signal: event.signal ?? null,\n });\n });\n return () => {\n disposable.dispose();\n };\n }\n}\n\nexport const layer = Layer.effect(\n PtyAdapter,\n Effect.gen(function* () {\n const fs = yield* FileSystem.FileSystem;\n const path = yield* Path.Path;\n\n const nodePty = yield* Effect.promise(() => import(\"node-pty\"));\n\n const ensureNodePtySpawnHelperExecutableCached = yield* Effect.cached(\n ensureNodePtySpawnHelperExecutable().pipe(\n Effect.provideService(FileSystem.FileSystem, fs),\n Effect.provideService(Path.Path, path),\n Effect.orElseSucceed(() => undefined),\n ),\n );\n\n return {\n spawn: Effect.fn(function* (input) {\n yield* ensureNodePtySpawnHelperExecutableCached;\n const ptyProcess = nodePty.spawn(input.shell, input.args ?? [], {\n cwd: input.cwd,\n cols: input.cols,\n rows: input.rows,\n env: input.env,\n name: globalThis.process.platform === \"win32\" ? \"xterm-color\" : \"xterm-256color\",\n });\n return new NodePtyProcess(ptyProcess);\n }),\n } satisfies PtyAdapterShape;\n }),\n);\n"],"mappings":";;;;;;AAKA,IAAI,iCAAiC;AAErC,MAAM,gCAAgCA,IAAW,aA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AAqD;EAC1D,MAAM,aAAa,KAAK,QAAQ,QAAQ,UAAU;AAChD,YAAS;IACP,UAAU,MAAM;IAChB,QAAQ,MAAM,UAAU;IACzB,CAAC;IACF;AACF,eAAa;AACX,cAAW,SAAS;;;;AAK1B,MAAa,QAAQE,OACnB,YACAL,IAAW,aAAa;CACtB,MAAM,KAAK,OAAOE;CAClB,MAAM,OAAO,OAAOD;CAEpB,MAAM,UAAU,OAAOK,cAAqB,OAAO,YAAY;CAE/D,MAAM,2CAA2C,OAAOC,OACtD,oCAAoC,CAAC,KACnCC,eAAsBN,YAAuB,GAAG,EAChDM,eAAsBP,MAAW,KAAK,EACtCE,oBAA2B,OAAU,CACtC,CACF;AAED,QAAO,EACL,OAAOC,GAAU,WAAW,OAAO;AACjC,SAAO;AAQP,SAAO,IAAI,eAPQ,QAAQ,MAAM,MAAM,OAAO,MAAM,QAAQ,EAAE,EAAE;GAC9D,KAAK,MAAM;GACX,MAAM,MAAM;GACZ,MAAM,MAAM;GACZ,KAAK,MAAM;GACX,MAAM,WAAW,QAAQ,aAAa,UAAU,gBAAgB;GACjE,CAAC,CACmC;GACrC,EACH;EACD,CACH"}
@@ -1,86 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- const require_index = require('./index.cjs');
4
- let node_module = require("node:module");
5
-
6
- //#region src/terminal/Layers/NodePTY.ts
7
- let didEnsureSpawnHelperExecutable = false;
8
- const resolveNodePtySpawnHelperPath = require_index.gen(function* () {
9
- const requireForNodePty = (0, node_module.createRequire)(require("url").pathToFileURL(__filename).href);
10
- const path = yield* require_index.Path;
11
- const fs = yield* require_index.FileSystem;
12
- const packageJsonPath = requireForNodePty.resolve("node-pty/package.json");
13
- const packageDir = path.dirname(packageJsonPath);
14
- const candidates = [
15
- path.join(packageDir, "build", "Release", "spawn-helper"),
16
- path.join(packageDir, "build", "Debug", "spawn-helper"),
17
- path.join(packageDir, "prebuilds", `${process.platform}-${process.arch}`, "spawn-helper")
18
- ];
19
- for (const candidate of candidates) if (yield* fs.exists(candidate)) return candidate;
20
- return null;
21
- }).pipe(require_index.orElseSucceed(() => null));
22
- const ensureNodePtySpawnHelperExecutable = require_index.fn(function* (explicitPath) {
23
- const fs = yield* require_index.FileSystem;
24
- if (process.platform === "win32") return;
25
- if (!explicitPath && didEnsureSpawnHelperExecutable) return;
26
- const helperPath = explicitPath ?? (yield* resolveNodePtySpawnHelperPath);
27
- if (!helperPath) return;
28
- if (!explicitPath) didEnsureSpawnHelperExecutable = true;
29
- if (!(yield* fs.exists(helperPath))) return;
30
- yield* fs.chmod(helperPath, 493).pipe(require_index.orElseSucceed(() => void 0));
31
- });
32
- var NodePtyProcess = class {
33
- constructor(process) {
34
- this.process = process;
35
- }
36
- get pid() {
37
- return this.process.pid;
38
- }
39
- write(data) {
40
- this.process.write(data);
41
- }
42
- resize(cols, rows) {
43
- this.process.resize(cols, rows);
44
- }
45
- kill(signal) {
46
- this.process.kill(signal);
47
- }
48
- onData(callback) {
49
- const disposable = this.process.onData(callback);
50
- return () => {
51
- disposable.dispose();
52
- };
53
- }
54
- onExit(callback) {
55
- const disposable = this.process.onExit((event) => {
56
- callback({
57
- exitCode: event.exitCode,
58
- signal: event.signal ?? null
59
- });
60
- });
61
- return () => {
62
- disposable.dispose();
63
- };
64
- }
65
- };
66
- const layer = require_index.effect(require_index.PtyAdapter, require_index.gen(function* () {
67
- const fs = yield* require_index.FileSystem;
68
- const path = yield* require_index.Path;
69
- const nodePty = yield* require_index.promise(() => import("node-pty"));
70
- const ensureNodePtySpawnHelperExecutableCached = yield* require_index.cached(ensureNodePtySpawnHelperExecutable().pipe(require_index.provideService(require_index.FileSystem, fs), require_index.provideService(require_index.Path, path), require_index.orElseSucceed(() => void 0)));
71
- return { spawn: require_index.fn(function* (input) {
72
- yield* ensureNodePtySpawnHelperExecutableCached;
73
- return new NodePtyProcess(nodePty.spawn(input.shell, input.args ?? [], {
74
- cwd: input.cwd,
75
- cols: input.cols,
76
- rows: input.rows,
77
- env: input.env,
78
- name: globalThis.process.platform === "win32" ? "xterm-color" : "xterm-256color"
79
- }));
80
- }) };
81
- }));
82
-
83
- //#endregion
84
- exports.ensureNodePtySpawnHelperExecutable = ensureNodePtySpawnHelperExecutable;
85
- exports.layer = layer;
86
- //# sourceMappingURL=NodePTY-CbnaoLlj.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"NodePTY-CbnaoLlj.cjs","names":["PtyAdapter"],"sources":["../src/terminal/Layers/NodePTY.ts"],"sourcesContent":["import { createRequire } from \"node:module\";\n\nimport { Effect, FileSystem, Layer, Path } from \"effect\";\nimport { PtyAdapter, PtyAdapterShape, PtyExitEvent, PtyProcess } from \"../Services/PTY\";\n\nlet didEnsureSpawnHelperExecutable = false;\n\nconst resolveNodePtySpawnHelperPath = Effect.gen(function* () {\n const requireForNodePty = createRequire(import.meta.url);\n const path = yield* Path.Path;\n const fs = yield* FileSystem.FileSystem;\n\n const packageJsonPath = requireForNodePty.resolve(\"node-pty/package.json\");\n const packageDir = path.dirname(packageJsonPath);\n const candidates = [\n path.join(packageDir, \"build\", \"Release\", \"spawn-helper\"),\n path.join(packageDir, \"build\", \"Debug\", \"spawn-helper\"),\n path.join(packageDir, \"prebuilds\", `${process.platform}-${process.arch}`, \"spawn-helper\"),\n ];\n\n for (const candidate of candidates) {\n if (yield* fs.exists(candidate)) {\n return candidate;\n }\n }\n return null;\n}).pipe(Effect.orElseSucceed(() => null));\n\nexport const ensureNodePtySpawnHelperExecutable = Effect.fn(function* (explicitPath?: string) {\n const fs = yield* FileSystem.FileSystem;\n if (process.platform === \"win32\") return;\n if (!explicitPath && didEnsureSpawnHelperExecutable) return;\n\n const helperPath = explicitPath ?? (yield* resolveNodePtySpawnHelperPath);\n if (!helperPath) return;\n if (!explicitPath) {\n didEnsureSpawnHelperExecutable = true;\n }\n\n if (!(yield* fs.exists(helperPath))) {\n return;\n }\n\n // Best-effort: avoid FileSystem.stat in packaged mode where some fs metadata can be missing.\n yield* fs.chmod(helperPath, 0o755).pipe(Effect.orElseSucceed(() => undefined));\n});\n\nclass NodePtyProcess implements PtyProcess {\n constructor(private readonly process: import(\"node-pty\").IPty) {}\n\n get pid(): number {\n return this.process.pid;\n }\n\n write(data: string): void {\n this.process.write(data);\n }\n\n resize(cols: number, rows: number): void {\n this.process.resize(cols, rows);\n }\n\n kill(signal?: string): void {\n this.process.kill(signal);\n }\n\n onData(callback: (data: string) => void): () => void {\n const disposable = this.process.onData(callback);\n return () => {\n disposable.dispose();\n };\n }\n\n onExit(callback: (event: PtyExitEvent) => void): () => void {\n const disposable = this.process.onExit((event) => {\n callback({\n exitCode: event.exitCode,\n signal: event.signal ?? null,\n });\n });\n return () => {\n disposable.dispose();\n };\n }\n}\n\nexport const layer = Layer.effect(\n PtyAdapter,\n Effect.gen(function* () {\n const fs = yield* FileSystem.FileSystem;\n const path = yield* Path.Path;\n\n const nodePty = yield* Effect.promise(() => import(\"node-pty\"));\n\n const ensureNodePtySpawnHelperExecutableCached = yield* Effect.cached(\n ensureNodePtySpawnHelperExecutable().pipe(\n Effect.provideService(FileSystem.FileSystem, fs),\n Effect.provideService(Path.Path, path),\n Effect.orElseSucceed(() => undefined),\n ),\n );\n\n return {\n spawn: Effect.fn(function* (input) {\n yield* ensureNodePtySpawnHelperExecutableCached;\n const ptyProcess = nodePty.spawn(input.shell, input.args ?? [], {\n cwd: input.cwd,\n cols: input.cols,\n rows: input.rows,\n env: input.env,\n name: globalThis.process.platform === \"win32\" ? \"xterm-color\" : \"xterm-256color\",\n });\n return new NodePtyProcess(ptyProcess);\n }),\n } satisfies PtyAdapterShape;\n }),\n);\n"],"mappings":";;;;;;AAKA,IAAI,iCAAiC;AAErC,MAAM,kDAA2C,aAAa;CAC5D,MAAM,iGAAkD;CACxD,MAAM,OAAO;CACb,MAAM,KAAK;CAEX,MAAM,kBAAkB,kBAAkB,QAAQ,wBAAwB;CAC1E,MAAM,aAAa,KAAK,QAAQ,gBAAgB;CAChD,MAAM,aAAa;EACjB,KAAK,KAAK,Y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,YAAY;CAE/D,MAAM,2CAA2C,4BAC/C,oCAAoC,CAAC,4DACU,GAAG,mDACf,KAAK,oCACX,OAAU,CACtC,CACF;AAED,QAAO,EACL,wBAAiB,WAAW,OAAO;AACjC,SAAO;AAQP,SAAO,IAAI,eAPQ,QAAQ,MAAM,MAAM,OAAO,MAAM,QAAQ,EAAE,EAAE;GAC9D,KAAK,MAAM;GACX,MAAM,MAAM;GACZ,MAAM,MAAM;GACZ,KAAK,MAAM;GACX,MAAM,WAAW,QAAQ,aAAa,UAAU,gBAAgB;GACjE,CAAC,CACmC;GACrC,EACH;EACD,CACH"}
@@ -1,147 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- const require_index = require('./index.cjs');
4
- const require_SqlError = require('./SqlError-CAzXmpza.cjs');
5
- let node_sqlite = require("node:sqlite");
6
-
7
- //#region src/persistence/NodeSqliteClient.ts
8
- /**
9
- * Port of `@effect/sql-sqlite-node` that uses the native `node:sqlite`
10
- * bindings instead of `better-sqlite3`.
11
- *
12
- * @module SqliteClient
13
- */
14
- const ATTR_DB_SYSTEM_NAME = "db.system.name";
15
- const TypeId = "~local/sqlite-node/SqliteClient";
16
- /**
17
- * SqliteClient - Effect service tag for the sqlite SQL client.
18
- */
19
- const SqliteClient = require_index.Service("t3/persistence/NodeSqliteClient");
20
- /**
21
- * Verify that the current Node.js version includes the `node:sqlite` APIs
22
- * used by `NodeSqliteClient` — specifically `StatementSync.columns()` (added
23
- * in Node 22.16.0 / 23.11.0).
24
- *
25
- * @see https://github.com/nodejs/node/pull/57490
26
- */
27
- const checkNodeSqliteCompat = () => {
28
- const parts = process.versions.node.split(".").map(Number);
29
- const major = parts[0] ?? 0;
30
- const minor = parts[1] ?? 0;
31
- if (!(major === 22 && minor >= 16 || major === 23 && minor >= 11 || major >= 24)) return require_index.die$1(`Node.js ${process.versions.node} is missing required node:sqlite APIs (StatementSync.columns). Upgrade to Node.js >=22.16, >=23.11, or >=24.`);
32
- return require_index.void_;
33
- };
34
- const makeWithDatabase = (options, openDatabase) => require_index.gen(function* () {
35
- yield* checkNodeSqliteCompat();
36
- const compiler = require_index.makeCompilerSqlite(options.transformQueryNames);
37
- const transformRows = options.transformResultNames ? require_index.defaultTransforms(options.transformResultNames).array : void 0;
38
- const makeConnection = require_index.gen(function* () {
39
- const scope$1 = yield* require_index.scope;
40
- const db = openDatabase();
41
- yield* require_index.addFinalizer$1(scope$1, require_index.sync(() => db.close()));
42
- const statementReaderCache = /* @__PURE__ */ new WeakMap();
43
- const hasRows = (statement) => {
44
- const cached = statementReaderCache.get(statement);
45
- if (cached !== void 0) return cached;
46
- const value = statement.columns().length > 0;
47
- statementReaderCache.set(statement, value);
48
- return value;
49
- };
50
- const prepareCache = yield* require_index.make$1({
51
- capacity: options.prepareCacheSize ?? 200,
52
- timeToLive: options.prepareCacheTTL ?? require_index.minutes(10),
53
- lookup: (sql) => require_index.try_({
54
- try: () => db.prepare(sql),
55
- catch: (cause) => new require_SqlError.SqlError({
56
- cause,
57
- message: "Failed to prepare statement"
58
- })
59
- })
60
- });
61
- const runStatement = (statement, params, raw) => require_index.withFiber((fiber) => {
62
- statement.setReadBigInts(Boolean(require_index.get$1(fiber.services, require_index.SafeIntegers)));
63
- try {
64
- if (hasRows(statement)) return require_index.succeed(statement.all(...params));
65
- const result = statement.run(...params);
66
- return require_index.succeed(raw ? result : []);
67
- } catch (cause) {
68
- return require_index.fail(new require_SqlError.SqlError({
69
- cause,
70
- message: "Failed to execute statement"
71
- }));
72
- }
73
- });
74
- const run = (sql, params, raw = false) => require_index.flatMap(require_index.get(prepareCache, sql), (s) => runStatement(s, params, raw));
75
- const runValues = (sql, params) => require_index.acquireUseRelease(require_index.get(prepareCache, sql), (statement) => require_index.try_({
76
- try: () => {
77
- if (hasRows(statement)) {
78
- statement.setReturnArrays(true);
79
- return statement.all(...params);
80
- }
81
- statement.run(...params);
82
- return [];
83
- },
84
- catch: (cause) => new require_SqlError.SqlError({
85
- cause,
86
- message: "Failed to execute statement"
87
- })
88
- }), (statement) => require_index.sync(() => {
89
- if (hasRows(statement)) statement.setReturnArrays(false);
90
- }));
91
- return require_index.identity({
92
- execute(sql, params, rowTransform) {
93
- return rowTransform ? require_index.map(run(sql, params), rowTransform) : run(sql, params);
94
- },
95
- executeRaw(sql, params) {
96
- return run(sql, params, true);
97
- },
98
- executeValues(sql, params) {
99
- return runValues(sql, params);
100
- },
101
- executeUnprepared(sql, params, rowTransform) {
102
- const effect = runStatement(db.prepare(sql), params ?? [], false);
103
- return rowTransform ? require_index.map(effect, rowTransform) : effect;
104
- },
105
- executeStream(_sql, _params) {
106
- return require_index.die("executeStream not implemented");
107
- }
108
- });
109
- });
110
- const semaphore = yield* require_index.make$2(1);
111
- const connection = yield* makeConnection;
112
- const acquirer = semaphore.withPermits(1)(require_index.succeed(connection));
113
- const transactionAcquirer = require_index.uninterruptibleMask((restore) => {
114
- const fiber = require_index.getCurrent();
115
- const scope = require_index.getUnsafe(fiber.services, require_index.Scope);
116
- return require_index.as(require_index.tap(restore(semaphore.take(1)), () => require_index.addFinalizer$1(scope, semaphore.release(1))), connection);
117
- });
118
- return yield* require_index.make({
119
- acquirer,
120
- compiler,
121
- transactionAcquirer,
122
- spanAttributes: [...options.spanAttributes ? Object.entries(options.spanAttributes) : [], [ATTR_DB_SYSTEM_NAME, "sqlite"]],
123
- transformRows
124
- });
125
- });
126
- const make = (options) => makeWithDatabase(options, () => new node_sqlite.DatabaseSync(options.filename, {
127
- readOnly: options.readonly ?? false,
128
- allowExtension: options.allowExtension ?? false
129
- }));
130
- const makeMemory = (config = {}) => makeWithDatabase({
131
- ...config,
132
- filename: ":memory:",
133
- readonly: false
134
- }, () => {
135
- return new node_sqlite.DatabaseSync(":memory:", { allowExtension: config.allowExtension ?? false });
136
- });
137
- const layerConfig = (config) => require_index.effectServices(require_index.unwrap(config).asEffect().pipe(require_index.flatMap(make), require_index.map((client) => require_index.make$3(SqliteClient, client).pipe(require_index.add(require_index.SqlClient, client))))).pipe(require_index.provide(require_index.layer));
138
- const layer = (config) => require_index.effectServices(require_index.map(make(config), (client) => require_index.make$3(SqliteClient, client).pipe(require_index.add(require_index.SqlClient, client)))).pipe(require_index.provide(require_index.layer));
139
- const layerMemory = (config = {}) => require_index.effectServices(require_index.map(makeMemory(config), (client) => require_index.make$3(SqliteClient, client).pipe(require_index.add(require_index.SqlClient, client)))).pipe(require_index.provide(require_index.layer));
140
-
141
- //#endregion
142
- exports.SqliteClient = SqliteClient;
143
- exports.TypeId = TypeId;
144
- exports.layer = layer;
145
- exports.layerConfig = layerConfig;
146
- exports.layerMemory = layerMemory;
147
- //# sourceMappingURL=NodeSqliteClient-C5fYhtpO.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"NodeSqliteClient-C5fYhtpO.cjs","names":["scope","SqlError","identity","DatabaseSync"],"sources":["../src/persistence/NodeSqliteClient.ts"],"sourcesContent":["/**\n * Port of `@effect/sql-sqlite-node` that uses the native `node:sqlite`\n * bindings instead of `better-sqlite3`.\n *\n * @module SqliteClient\n */\nimport { DatabaseSync, type StatementSync } from \"node:sqlite\";\n\nimport * as Cache from \"effect/Cache\";\nimport * as Config from \"effect/Config\";\nimport * as Duration from \"effect/Duration\";\nimport * as Effect from \"effect/Effect\";\nimport * as Fiber from \"effect/Fiber\";\nimport { identity } from \"effect/Function\";\nimport * as Layer from \"effect/Layer\";\nimport * as Scope from \"effect/Scope\";\nimport * as Semaphore from \"effect/Semaphore\";\nimport * as ServiceMap from \"effect/ServiceMap\";\nimport * as Stream from \"effect/Stream\";\nimport * as Reactivity from \"effect/unstable/reactivity/Reactivity\";\nimport * as Client from \"effect/unstable/sql/SqlClient\";\nimport type { Connection } from \"effect/unstable/sql/SqlConnection\";\nimport { SqlError } from \"effect/unstable/sql/SqlError\";\nimport * as Statement from \"effect/unstable/sql/Statement\";\n\nconst ATTR_DB_SYSTEM_NAME = \"db.system.name\";\n\nexport const TypeId: TypeId = \"~local/sqlite-node/SqliteClient\";\n\nexport type TypeId = \"~local/sqlite-node/SqliteClient\";\n\n/**\n * SqliteClient - Effect service tag for the sqlite SQL client.\n */\nexport const SqliteClient = ServiceMap.Service<Client.SqlClient>(\"t3/persistence/NodeSqliteClient\");\n\nexport interface SqliteClientConfig {\n readonly filename: string;\n readonly readonly?: boolean | undefined;\n readonly allowExtension?: boolean | undefined;\n readonly prepareCacheSize?: number | undefined;\n readonly prepareCacheTTL?: Duration.Input | undefined;\n readonly spanAttributes?: Record<string, unknown> | undefined;\n readonly transformResultNames?: ((str: string) => string) | undefined;\n readonly transformQueryNames?: ((str: string) => string) | undefined;\n}\n\nexport interface SqliteMemoryClientConfig extends Omit<\n SqliteClientConfig,\n \"filename\" | \"readonly\"\n> {}\n\n/**\n * Verify that the current Node.js version includes the `node:sqlite` APIs\n * used by `NodeSqliteClient` — specifically `StatementSync.columns()` (added\n * in Node 22.16.0 / 23.11.0).\n *\n * @see https://github.com/nodejs/node/pull/57490\n */\nconst checkNodeSqliteCompat = () => {\n const parts = process.versions.node.split(\".\").map(Number);\n const major = parts[0] ?? 0;\n const minor = parts[1] ?? 0;\n const supported = (major === 22 && minor >= 16) || (major === 23 && minor >= 11) || major >= 24;\n\n if (!supported) {\n return Effect.die(\n `Node.js ${process.versions.node} is missing required node:sqlite APIs ` +\n `(StatementSync.columns). Upgrade to Node.js >=22.16, >=23.11, or >=24.`,\n );\n }\n return Effect.void;\n};\n\nconst makeWithDatabase = (\n options: SqliteClientConfig,\n openDatabase: () => DatabaseSync,\n): Effect.Effect<Client.SqlClient, never, Scope.Scope | Reactivity.Reactivity> =>\n Effect.gen(function* () {\n yield* checkNodeSqliteCompat();\n\n const compiler = Statement.makeCompilerSqlite(options.transformQueryNames);\n const transformRows = options.transformResultNames\n ? Statement.defaultTransforms(options.transformResultNames).array\n : undefined;\n\n const makeConnection = Effect.gen(function* () {\n const scope = yield* Effect.scope;\n const db = openDatabase();\n yield* Scope.addFinalizer(\n scope,\n Effect.sync(() => db.close()),\n );\n\n const statementReaderCache = new WeakMap<StatementSync, boolean>();\n const hasRows = (statement: StatementSync): boolean => {\n const cached = statementReaderCache.get(statement);\n if (cached !== undefined) {\n return cached;\n }\n const value = statement.columns().length > 0;\n statementReaderCache.set(statement, value);\n return value;\n };\n\n const prepareCache = yield* Cache.make({\n capacity: options.prepareCacheSize ?? 200,\n timeToLive: options.prepareCacheTTL ?? Duration.minutes(10),\n lookup: (sql: string) =>\n Effect.try({\n try: () => db.prepare(sql),\n catch: (cause) => new SqlError({ cause, message: \"Failed to prepare statement\" }),\n }),\n });\n\n const runStatement = (\n statement: StatementSync,\n params: ReadonlyArray<unknown>,\n raw: boolean,\n ) =>\n Effect.withFiber<ReadonlyArray<any>, SqlError>((fiber) => {\n statement.setReadBigInts(Boolean(ServiceMap.get(fiber.services, Client.SafeIntegers)));\n try {\n if (hasRows(statement)) {\n return Effect.succeed(statement.all(...(params as any)));\n }\n const result = statement.run(...(params as any));\n return Effect.succeed(raw ? (result as unknown as ReadonlyArray<any>) : []);\n } catch (cause) {\n return Effect.fail(new SqlError({ cause, message: \"Failed to execute statement\" }));\n }\n });\n\n const run = (sql: string, params: ReadonlyArray<unknown>, raw = false) =>\n Effect.flatMap(Cache.get(prepareCache, sql), (s) => runStatement(s, params, raw));\n\n const runValues = (sql: string, params: ReadonlyArray<unknown>) =>\n Effect.acquireUseRelease(\n Cache.get(prepareCache, sql),\n (statement) =>\n Effect.try({\n try: () => {\n if (hasRows(statement)) {\n statement.setReturnArrays(true);\n // Safe to cast to array after we've setReturnArrays(true)\n return statement.all(...(params as any)) as unknown as ReadonlyArray<\n ReadonlyArray<unknown>\n >;\n }\n statement.run(...(params as any));\n return [];\n },\n catch: (cause) => new SqlError({ cause, message: \"Failed to execute statement\" }),\n }),\n (statement) =>\n Effect.sync(() => {\n if (hasRows(statement)) {\n statement.setReturnArrays(false);\n }\n }),\n );\n\n return identity<Connection>({\n execute(sql, params, rowTransform) {\n return rowTransform ? Effect.map(run(sql, params), rowTransform) : run(sql, params);\n },\n executeRaw(sql, params) {\n return run(sql, params, true);\n },\n executeValues(sql, params) {\n return runValues(sql, params);\n },\n executeUnprepared(sql, params, rowTransform) {\n const effect = runStatement(db.prepare(sql), params ?? [], false);\n return rowTransform ? Effect.map(effect, rowTransform) : effect;\n },\n executeStream(_sql, _params) {\n return Stream.die(\"executeStream not implemented\");\n },\n });\n });\n\n const semaphore = yield* Semaphore.make(1);\n const connection = yield* makeConnection;\n\n const acquirer = semaphore.withPermits(1)(Effect.succeed(connection));\n const transactionAcquirer = Effect.uninterruptibleMask((restore) => {\n const fiber = Fiber.getCurrent()!;\n const scope = ServiceMap.getUnsafe(fiber.services, Scope.Scope);\n return Effect.as(\n Effect.tap(restore(semaphore.take(1)), () =>\n Scope.addFinalizer(scope, semaphore.release(1)),\n ),\n connection,\n );\n });\n\n return yield* Client.make({\n acquirer,\n compiler,\n transactionAcquirer,\n spanAttributes: [\n ...(options.spanAttributes ? Object.entries(options.spanAttributes) : []),\n [ATTR_DB_SYSTEM_NAME, \"sqlite\"],\n ],\n transformRows,\n });\n });\n\nconst make = (\n options: SqliteClientConfig,\n): Effect.Effect<Client.SqlClient, never, Scope.Scope | Reactivity.Reactivity> =>\n makeWithDatabase(\n options,\n () =>\n new DatabaseSync(options.filename, {\n readOnly: options.readonly ?? false,\n allowExtension: options.allowExtension ?? false,\n }),\n );\n\nconst makeMemory = (\n config: SqliteMemoryClientConfig = {},\n): Effect.Effect<Client.SqlClient, never, Scope.Scope | Reactivity.Reactivity> =>\n makeWithDatabase(\n {\n ...config,\n filename: \":memory:\",\n readonly: false,\n },\n () => {\n const database = new DatabaseSync(\":memory:\", {\n allowExtension: config.allowExtension ?? false,\n });\n return database;\n },\n );\n\nexport const layerConfig = (\n config: Config.Wrap<SqliteClientConfig>,\n): Layer.Layer<Client.SqlClient, Config.ConfigError> =>\n Layer.effectServices(\n Config.unwrap(config)\n .asEffect()\n .pipe(\n Effect.flatMap(make),\n Effect.map((client) =>\n ServiceMap.make(SqliteClient, client).pipe(ServiceMap.add(Client.SqlClient, client)),\n ),\n ),\n ).pipe(Layer.provide(Reactivity.layer));\n\nexport const layer = (config: SqliteClientConfig): Layer.Layer<Client.SqlClient> =>\n Layer.effectServices(\n Effect.map(make(config), (client) =>\n ServiceMap.make(SqliteClient, client).pipe(ServiceMap.add(Client.SqlClient, client)),\n ),\n ).pipe(Layer.provide(Reactivity.layer));\n\nexport const layerMemory = (config: SqliteMemoryClientConfig = {}): Layer.Layer<Client.SqlClient> =>\n Layer.effectServices(\n Effect.map(makeMemory(config), (client) =>\n ServiceMap.make(SqliteClient, client).pipe(ServiceMap.add(Client.SqlClient, client)),\n ),\n ).pipe(Layer.provide(Reactivity.layer));\n"],"mappings":";;;;;;;;;;;;;AAyBA,MAAM,sBAAsB;AAE5B,MAAa,SAAiB;;;;AAO9B,MAAa,qCAAoD,kCAAkC;;;;;;;;AAyBnG,MAAM,8BAA8B;CAClC,MAAM,QAAQ,QAAQ,SAAS,KAAK,MAAM,IAAI,CAAC,IAAI,OAAO;CAC1D,MAAM,QAAQ,MAAM,MAAM;CAC1B,MAAM,QAAQ,MAAM,MAAM;AAG1B,KAAI,EAFe,UAAU,MAAM,SAAS,MAAQ,UAAU,MAAM,SAAS,MAAO,SAAS,IAG3F,4BACE,WAAW,QAAQ,SAAS,KAAK,8GAElC;AAEH;;AAGF,MAAM,oBACJ,SACA,mCAEW,aAAa;AACtB,QAAO,uBAAuB;CAE9B,MAAM,4CAAwC,QAAQ,oBAAoB;CAC1E,MAAM,gBAAgB,QAAQ,uDACE,QAAQ,qBAAqB,CAAC,QAC1D;CAEJ,MAAM,mCAA4B,aAAa;EAC7C,MAAMA,UAAQ;EACd,MAAM,KAAK,cAAc;AACzB,sCACEA,kCACkB,GAAG,OAAO,CAAC,CAC9B;EAED,MAAM,uCAAuB,IAAI,SAAiC;EAClE,MAAM,WAAW,cAAsC;GACrD,MAAM,SAAS,qBAAqB,IAAI,UAAU;AAClD,OAAI,WAAW,OACb,QAAO;GAET,MAAM,QAAQ,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