@threadlines/server 0.2.1
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/LICENSE +22 -0
- package/README.md +36 -0
- package/dist/BunPTY-YfDZS1LK.mjs +93 -0
- package/dist/NodePTY-4q2ctg4D.mjs +96 -0
- package/dist/NodeSqliteClient-CroFvdcT.mjs +159 -0
- package/dist/PTY-B_NJr7la.mjs +22 -0
- package/dist/bin.mjs +72114 -0
- package/package.json +47 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 T3 Tools Inc.
|
|
4
|
+
Copyright (c) 2026 Wilfredo Leon and Threadlines contributors.
|
|
5
|
+
|
|
6
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
in the Software without restriction, including without limitation the rights
|
|
9
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
furnished to do so, subject to the following conditions:
|
|
12
|
+
|
|
13
|
+
The above copyright notice and this permission notice shall be included in all
|
|
14
|
+
copies or substantial portions of the Software.
|
|
15
|
+
|
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# @threadlines/server
|
|
2
|
+
|
|
3
|
+
Threadlines server and CLI package.
|
|
4
|
+
|
|
5
|
+
Threadlines is a local-first desktop workspace for Codex and Claude Code. This
|
|
6
|
+
package contains the server/CLI used by the desktop app, remote bootstrap flows,
|
|
7
|
+
and advanced local usage.
|
|
8
|
+
|
|
9
|
+
Most users should install the signed desktop app from GitHub Releases:
|
|
10
|
+
|
|
11
|
+
https://github.com/Threadlines/threadlines/releases
|
|
12
|
+
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
Run without installing:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
npx @threadlines/server@latest --help
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Install globally:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
npm install --global @threadlines/server
|
|
25
|
+
threadlines --help
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Threadlines uses locally installed coding agents. Install and authenticate at
|
|
29
|
+
least one maintained provider before use:
|
|
30
|
+
|
|
31
|
+
- Codex: install Codex CLI and run `codex login`
|
|
32
|
+
- Claude: install Claude Code and run `claude auth login`
|
|
33
|
+
|
|
34
|
+
## License
|
|
35
|
+
|
|
36
|
+
MIT. See `LICENSE`.
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import { t as PtyAdapter } from "./PTY-B_NJr7la.mjs";
|
|
4
|
+
import * as Effect from "effect/Effect";
|
|
5
|
+
import * as Layer from "effect/Layer";
|
|
6
|
+
//#region src/terminal/Layers/BunPTY.ts
|
|
7
|
+
var BunPtyProcess = class {
|
|
8
|
+
dataListeners = /* @__PURE__ */ new Set();
|
|
9
|
+
exitListeners = /* @__PURE__ */ new Set();
|
|
10
|
+
decoder = new TextDecoder();
|
|
11
|
+
process;
|
|
12
|
+
didExit = false;
|
|
13
|
+
constructor(process) {
|
|
14
|
+
this.process = process;
|
|
15
|
+
this.process.exited.then((exitCode) => {
|
|
16
|
+
this.emitExit({
|
|
17
|
+
exitCode: Number.isInteger(exitCode) ? exitCode : 0,
|
|
18
|
+
signal: typeof this.process.signalCode === "number" ? this.process.signalCode : null
|
|
19
|
+
});
|
|
20
|
+
}).catch(() => {
|
|
21
|
+
this.emitExit({
|
|
22
|
+
exitCode: 1,
|
|
23
|
+
signal: null
|
|
24
|
+
});
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
get pid() {
|
|
28
|
+
return this.process.pid;
|
|
29
|
+
}
|
|
30
|
+
write(data) {
|
|
31
|
+
if (!this.process.terminal) throw new Error("Bun PTY terminal handle is unavailable");
|
|
32
|
+
this.process.terminal.write(data);
|
|
33
|
+
}
|
|
34
|
+
resize(cols, rows) {
|
|
35
|
+
if (!this.process.terminal?.resize) throw new Error("Bun PTY resize is unavailable");
|
|
36
|
+
this.process.terminal.resize(cols, rows);
|
|
37
|
+
}
|
|
38
|
+
kill(signal) {
|
|
39
|
+
if (!signal) {
|
|
40
|
+
this.process.kill();
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
this.process.kill(signal);
|
|
44
|
+
}
|
|
45
|
+
onData(callback) {
|
|
46
|
+
this.dataListeners.add(callback);
|
|
47
|
+
return () => {
|
|
48
|
+
this.dataListeners.delete(callback);
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
onExit(callback) {
|
|
52
|
+
this.exitListeners.add(callback);
|
|
53
|
+
return () => {
|
|
54
|
+
this.exitListeners.delete(callback);
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
emitData(data) {
|
|
58
|
+
if (this.didExit) return;
|
|
59
|
+
const text = this.decoder.decode(data, { stream: true });
|
|
60
|
+
if (text.length === 0) return;
|
|
61
|
+
for (const listener of this.dataListeners) listener(text);
|
|
62
|
+
}
|
|
63
|
+
emitExit(event) {
|
|
64
|
+
if (this.didExit) return;
|
|
65
|
+
this.didExit = true;
|
|
66
|
+
const remainder = this.decoder.decode();
|
|
67
|
+
if (remainder.length > 0) for (const listener of this.dataListeners) listener(remainder);
|
|
68
|
+
for (const listener of this.exitListeners) listener(event);
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
const layer = Layer.effect(PtyAdapter, Effect.gen(function* () {
|
|
72
|
+
if (process.platform === "win32") return yield* Effect.die("Bun PTY terminal support is unavailable on Windows. Please use Node.js (e.g. by running `threadlines`) instead.");
|
|
73
|
+
return { spawn: (input) => Effect.sync(() => {
|
|
74
|
+
let processHandle = null;
|
|
75
|
+
const command = [input.shell, ...input.args ?? []];
|
|
76
|
+
processHandle = new BunPtyProcess(Bun.spawn(command, {
|
|
77
|
+
cwd: input.cwd,
|
|
78
|
+
env: input.env,
|
|
79
|
+
terminal: {
|
|
80
|
+
cols: input.cols,
|
|
81
|
+
rows: input.rows,
|
|
82
|
+
data: (_terminal, data) => {
|
|
83
|
+
processHandle?.emitData(data);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}));
|
|
87
|
+
return processHandle;
|
|
88
|
+
}) };
|
|
89
|
+
}));
|
|
90
|
+
//#endregion
|
|
91
|
+
export { layer };
|
|
92
|
+
|
|
93
|
+
//# sourceMappingURL=BunPTY-YfDZS1LK.mjs.map
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import { n as PtySpawnError, t as PtyAdapter } from "./PTY-B_NJr7la.mjs";
|
|
4
|
+
import { createRequire } from "node:module";
|
|
5
|
+
import * as Effect from "effect/Effect";
|
|
6
|
+
import * as Layer from "effect/Layer";
|
|
7
|
+
import * as FileSystem from "effect/FileSystem";
|
|
8
|
+
import * as Path from "effect/Path";
|
|
9
|
+
//#region src/terminal/Layers/NodePTY.ts
|
|
10
|
+
let didEnsureSpawnHelperExecutable = false;
|
|
11
|
+
const resolveNodePtySpawnHelperPath = Effect.gen(function* () {
|
|
12
|
+
const requireForNodePty = createRequire(import.meta.url);
|
|
13
|
+
const path = yield* Path.Path;
|
|
14
|
+
const fs = yield* FileSystem.FileSystem;
|
|
15
|
+
const packageJsonPath = requireForNodePty.resolve("node-pty/package.json");
|
|
16
|
+
const packageDir = path.dirname(packageJsonPath);
|
|
17
|
+
const candidates = [
|
|
18
|
+
path.join(packageDir, "build", "Release", "spawn-helper"),
|
|
19
|
+
path.join(packageDir, "build", "Debug", "spawn-helper"),
|
|
20
|
+
path.join(packageDir, "prebuilds", `${process.platform}-${process.arch}`, "spawn-helper")
|
|
21
|
+
];
|
|
22
|
+
for (const candidate of candidates) if (yield* fs.exists(candidate)) return candidate;
|
|
23
|
+
return null;
|
|
24
|
+
}).pipe(Effect.orElseSucceed(() => null));
|
|
25
|
+
const ensureNodePtySpawnHelperExecutable = Effect.fn(function* (explicitPath) {
|
|
26
|
+
const fs = yield* FileSystem.FileSystem;
|
|
27
|
+
if (process.platform === "win32") return;
|
|
28
|
+
if (!explicitPath && didEnsureSpawnHelperExecutable) return;
|
|
29
|
+
const helperPath = explicitPath ?? (yield* resolveNodePtySpawnHelperPath);
|
|
30
|
+
if (!helperPath) return;
|
|
31
|
+
if (!explicitPath) didEnsureSpawnHelperExecutable = true;
|
|
32
|
+
if (!(yield* fs.exists(helperPath))) return;
|
|
33
|
+
yield* fs.chmod(helperPath, 493).pipe(Effect.orElseSucceed(() => void 0));
|
|
34
|
+
});
|
|
35
|
+
var NodePtyProcess = class {
|
|
36
|
+
process;
|
|
37
|
+
constructor(process) {
|
|
38
|
+
this.process = process;
|
|
39
|
+
}
|
|
40
|
+
get pid() {
|
|
41
|
+
return this.process.pid;
|
|
42
|
+
}
|
|
43
|
+
write(data) {
|
|
44
|
+
this.process.write(data);
|
|
45
|
+
}
|
|
46
|
+
resize(cols, rows) {
|
|
47
|
+
this.process.resize(cols, rows);
|
|
48
|
+
}
|
|
49
|
+
kill(signal) {
|
|
50
|
+
this.process.kill(signal);
|
|
51
|
+
}
|
|
52
|
+
onData(callback) {
|
|
53
|
+
const disposable = this.process.onData(callback);
|
|
54
|
+
return () => {
|
|
55
|
+
disposable.dispose();
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
onExit(callback) {
|
|
59
|
+
const disposable = this.process.onExit((event) => {
|
|
60
|
+
callback({
|
|
61
|
+
exitCode: event.exitCode,
|
|
62
|
+
signal: event.signal ?? null
|
|
63
|
+
});
|
|
64
|
+
});
|
|
65
|
+
return () => {
|
|
66
|
+
disposable.dispose();
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
const layer = Layer.effect(PtyAdapter, Effect.gen(function* () {
|
|
71
|
+
const fs = yield* FileSystem.FileSystem;
|
|
72
|
+
const path = yield* Path.Path;
|
|
73
|
+
const nodePty = yield* Effect.promise(() => import("node-pty"));
|
|
74
|
+
const ensureNodePtySpawnHelperExecutableCached = yield* Effect.cached(ensureNodePtySpawnHelperExecutable().pipe(Effect.provideService(FileSystem.FileSystem, fs), Effect.provideService(Path.Path, path), Effect.orElseSucceed(() => void 0)));
|
|
75
|
+
return { spawn: Effect.fn(function* (input) {
|
|
76
|
+
yield* ensureNodePtySpawnHelperExecutableCached;
|
|
77
|
+
return new NodePtyProcess(yield* Effect.try({
|
|
78
|
+
try: () => nodePty.spawn(input.shell, input.args ?? [], {
|
|
79
|
+
cwd: input.cwd,
|
|
80
|
+
cols: input.cols,
|
|
81
|
+
rows: input.rows,
|
|
82
|
+
env: input.env,
|
|
83
|
+
name: globalThis.process.platform === "win32" ? "xterm-color" : "xterm-256color"
|
|
84
|
+
}),
|
|
85
|
+
catch: (cause) => new PtySpawnError({
|
|
86
|
+
adapter: "node-pty",
|
|
87
|
+
message: cause instanceof Error ? cause.message : "Failed to spawn PTY process",
|
|
88
|
+
cause
|
|
89
|
+
})
|
|
90
|
+
}));
|
|
91
|
+
}) };
|
|
92
|
+
}));
|
|
93
|
+
//#endregion
|
|
94
|
+
export { ensureNodePtySpawnHelperExecutable, layer };
|
|
95
|
+
|
|
96
|
+
//# sourceMappingURL=NodePTY-4q2ctg4D.mjs.map
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import * as Effect from "effect/Effect";
|
|
4
|
+
import * as Layer from "effect/Layer";
|
|
5
|
+
import * as Context from "effect/Context";
|
|
6
|
+
import * as Duration from "effect/Duration";
|
|
7
|
+
import * as Stream from "effect/Stream";
|
|
8
|
+
import * as Client from "effect/unstable/sql/SqlClient";
|
|
9
|
+
import * as Config from "effect/Config";
|
|
10
|
+
import { identity } from "effect/Function";
|
|
11
|
+
import * as Cache from "effect/Cache";
|
|
12
|
+
import * as Scope from "effect/Scope";
|
|
13
|
+
import * as Semaphore from "effect/Semaphore";
|
|
14
|
+
import * as Fiber from "effect/Fiber";
|
|
15
|
+
import { DatabaseSync } from "node:sqlite";
|
|
16
|
+
import * as Reactivity from "effect/unstable/reactivity/Reactivity";
|
|
17
|
+
import { SqlError, classifySqliteError } from "effect/unstable/sql/SqlError";
|
|
18
|
+
import * as Statement from "effect/unstable/sql/Statement";
|
|
19
|
+
//#region src/persistence/NodeSqliteClient.ts
|
|
20
|
+
/**
|
|
21
|
+
* Port of `@effect/sql-sqlite-node` that uses the native `node:sqlite`
|
|
22
|
+
* bindings instead of `better-sqlite3`.
|
|
23
|
+
*
|
|
24
|
+
* @module SqliteClient
|
|
25
|
+
*/
|
|
26
|
+
const ATTR_DB_SYSTEM_NAME = "db.system.name";
|
|
27
|
+
const TypeId = "~local/sqlite-node/SqliteClient";
|
|
28
|
+
/**
|
|
29
|
+
* SqliteClient - Effect service tag for the sqlite SQL client.
|
|
30
|
+
*/
|
|
31
|
+
const SqliteClient = Context.Service("threadlines/persistence/NodeSqliteClient");
|
|
32
|
+
/**
|
|
33
|
+
* Verify that the current Node.js version includes the `node:sqlite` APIs
|
|
34
|
+
* used by `NodeSqliteClient` — specifically `StatementSync.columns()` (added
|
|
35
|
+
* in Node 22.16.0 / 23.11.0).
|
|
36
|
+
*
|
|
37
|
+
* @see https://github.com/nodejs/node/pull/57490
|
|
38
|
+
*/
|
|
39
|
+
const checkNodeSqliteCompat = () => {
|
|
40
|
+
const parts = process.versions.node.split(".").map(Number);
|
|
41
|
+
const major = parts[0] ?? 0;
|
|
42
|
+
const minor = parts[1] ?? 0;
|
|
43
|
+
if (!(major === 22 && minor >= 16 || major === 23 && minor >= 11 || major >= 24)) return Effect.die(`Node.js ${process.versions.node} is missing required node:sqlite APIs (StatementSync.columns). Upgrade to Node.js >=22.16, >=23.11, or >=24.`);
|
|
44
|
+
return Effect.void;
|
|
45
|
+
};
|
|
46
|
+
const makeWithDatabase = Effect.fn("makeWithDatabase")(function* (options, openDatabase) {
|
|
47
|
+
yield* checkNodeSqliteCompat();
|
|
48
|
+
const compiler = Statement.makeCompilerSqlite(options.transformQueryNames);
|
|
49
|
+
const transformRows = options.transformResultNames ? Statement.defaultTransforms(options.transformResultNames).array : void 0;
|
|
50
|
+
const makeConnection = Effect.gen(function* () {
|
|
51
|
+
const scope = yield* Effect.scope;
|
|
52
|
+
const db = openDatabase();
|
|
53
|
+
yield* Scope.addFinalizer(scope, Effect.sync(() => db.close()));
|
|
54
|
+
const statementReaderCache = /* @__PURE__ */ new WeakMap();
|
|
55
|
+
const hasRows = (statement) => {
|
|
56
|
+
const cached = statementReaderCache.get(statement);
|
|
57
|
+
if (cached !== void 0) return cached;
|
|
58
|
+
const value = statement.columns().length > 0;
|
|
59
|
+
statementReaderCache.set(statement, value);
|
|
60
|
+
return value;
|
|
61
|
+
};
|
|
62
|
+
const prepareCache = yield* Cache.make({
|
|
63
|
+
capacity: options.prepareCacheSize ?? 200,
|
|
64
|
+
timeToLive: options.prepareCacheTTL ?? Duration.minutes(10),
|
|
65
|
+
lookup: (sql) => Effect.try({
|
|
66
|
+
try: () => db.prepare(sql),
|
|
67
|
+
catch: (cause) => new SqlError({ reason: classifySqliteError(cause, {
|
|
68
|
+
message: "Failed to prepare statement",
|
|
69
|
+
operation: "prepare"
|
|
70
|
+
}) })
|
|
71
|
+
})
|
|
72
|
+
});
|
|
73
|
+
const runStatement = (statement, params, raw) => Effect.withFiber((fiber) => {
|
|
74
|
+
statement.setReadBigInts(Boolean(Context.get(fiber.context, Client.SafeIntegers)));
|
|
75
|
+
try {
|
|
76
|
+
if (hasRows(statement)) return Effect.succeed(statement.all(...params));
|
|
77
|
+
const result = statement.run(...params);
|
|
78
|
+
return Effect.succeed(raw ? result : []);
|
|
79
|
+
} catch (cause) {
|
|
80
|
+
return Effect.fail(new SqlError({ reason: classifySqliteError(cause, {
|
|
81
|
+
message: "Failed to execute statement",
|
|
82
|
+
operation: "execute"
|
|
83
|
+
}) }));
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
const run = (sql, params, raw = false) => Effect.flatMap(Cache.get(prepareCache, sql), (s) => runStatement(s, params, raw));
|
|
87
|
+
const runValuesStatement = (statement, params) => Effect.try({
|
|
88
|
+
try: () => {
|
|
89
|
+
if (hasRows(statement)) {
|
|
90
|
+
statement.setReturnArrays(true);
|
|
91
|
+
return statement.all(...params);
|
|
92
|
+
}
|
|
93
|
+
statement.run(...params);
|
|
94
|
+
return [];
|
|
95
|
+
},
|
|
96
|
+
catch: (cause) => new SqlError({ reason: classifySqliteError(cause, {
|
|
97
|
+
message: "Failed to execute statement",
|
|
98
|
+
operation: "execute"
|
|
99
|
+
}) })
|
|
100
|
+
});
|
|
101
|
+
const runValues = (sql, params) => Effect.acquireUseRelease(Cache.get(prepareCache, sql), (statement) => runValuesStatement(statement, params), (statement) => Effect.sync(() => {
|
|
102
|
+
if (hasRows(statement)) statement.setReturnArrays(false);
|
|
103
|
+
}));
|
|
104
|
+
return identity({
|
|
105
|
+
execute(sql, params, rowTransform) {
|
|
106
|
+
return rowTransform ? Effect.map(run(sql, params), rowTransform) : run(sql, params);
|
|
107
|
+
},
|
|
108
|
+
executeRaw(sql, params) {
|
|
109
|
+
return run(sql, params, true);
|
|
110
|
+
},
|
|
111
|
+
executeValues(sql, params) {
|
|
112
|
+
return runValues(sql, params);
|
|
113
|
+
},
|
|
114
|
+
executeValuesUnprepared(sql, params) {
|
|
115
|
+
return runValuesStatement(db.prepare(sql), params ?? []);
|
|
116
|
+
},
|
|
117
|
+
executeUnprepared(sql, params, rowTransform) {
|
|
118
|
+
const effect = runStatement(db.prepare(sql), params ?? [], false);
|
|
119
|
+
return rowTransform ? Effect.map(effect, rowTransform) : effect;
|
|
120
|
+
},
|
|
121
|
+
executeStream(_sql, _params) {
|
|
122
|
+
return Stream.die("executeStream not implemented");
|
|
123
|
+
}
|
|
124
|
+
});
|
|
125
|
+
});
|
|
126
|
+
const semaphore = yield* Semaphore.make(1);
|
|
127
|
+
const connection = yield* makeConnection;
|
|
128
|
+
const acquirer = semaphore.withPermits(1)(Effect.succeed(connection));
|
|
129
|
+
const transactionAcquirer = Effect.uninterruptibleMask((restore) => {
|
|
130
|
+
const fiber = Fiber.getCurrent();
|
|
131
|
+
const scope = Context.getUnsafe(fiber.context, Scope.Scope);
|
|
132
|
+
return Effect.as(Effect.tap(restore(semaphore.take(1)), () => Scope.addFinalizer(scope, semaphore.release(1))), connection);
|
|
133
|
+
});
|
|
134
|
+
return yield* Client.make({
|
|
135
|
+
acquirer,
|
|
136
|
+
compiler,
|
|
137
|
+
transactionAcquirer,
|
|
138
|
+
spanAttributes: [...options.spanAttributes ? Object.entries(options.spanAttributes) : [], [ATTR_DB_SYSTEM_NAME, "sqlite"]],
|
|
139
|
+
transformRows
|
|
140
|
+
});
|
|
141
|
+
});
|
|
142
|
+
const make = (options) => makeWithDatabase(options, () => new DatabaseSync(options.filename, {
|
|
143
|
+
readOnly: options.readonly ?? false,
|
|
144
|
+
allowExtension: options.allowExtension ?? false
|
|
145
|
+
}));
|
|
146
|
+
const makeMemory = (config = {}) => makeWithDatabase({
|
|
147
|
+
...config,
|
|
148
|
+
filename: ":memory:",
|
|
149
|
+
readonly: false
|
|
150
|
+
}, () => {
|
|
151
|
+
return new DatabaseSync(":memory:", { allowExtension: config.allowExtension ?? false });
|
|
152
|
+
});
|
|
153
|
+
const layerConfig = (config) => Layer.effectContext(Config.unwrap(config).pipe(Effect.flatMap(make), Effect.map((client) => Context.make(SqliteClient, client).pipe(Context.add(Client.SqlClient, client))))).pipe(Layer.provide(Reactivity.layer));
|
|
154
|
+
const layer = (config) => Layer.effectContext(Effect.map(make(config), (client) => Context.make(SqliteClient, client).pipe(Context.add(Client.SqlClient, client)))).pipe(Layer.provide(Reactivity.layer));
|
|
155
|
+
const layerMemory = (config = {}) => Layer.effectContext(Effect.map(makeMemory(config), (client) => Context.make(SqliteClient, client).pipe(Context.add(Client.SqlClient, client)))).pipe(Layer.provide(Reactivity.layer));
|
|
156
|
+
//#endregion
|
|
157
|
+
export { SqliteClient, TypeId, layer, layerConfig, layerMemory };
|
|
158
|
+
|
|
159
|
+
//# sourceMappingURL=NodeSqliteClient-CroFvdcT.mjs.map
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import "effect/Effect";
|
|
4
|
+
import * as Context from "effect/Context";
|
|
5
|
+
import * as Schema from "effect/Schema";
|
|
6
|
+
//#region src/terminal/Services/PTY.ts
|
|
7
|
+
/**
|
|
8
|
+
* PtyError - Error type for PTY adapter operations.
|
|
9
|
+
*/
|
|
10
|
+
var PtySpawnError = class extends Schema.TaggedErrorClass()("PtySpawnError", {
|
|
11
|
+
adapter: Schema.String,
|
|
12
|
+
message: Schema.String,
|
|
13
|
+
cause: Schema.optional(Schema.Defect())
|
|
14
|
+
}) {};
|
|
15
|
+
/**
|
|
16
|
+
* PtyAdapter - Service tag for PTY process integration.
|
|
17
|
+
*/
|
|
18
|
+
var PtyAdapter = class extends Context.Service()("threadlines/terminal/Services/PTY/PtyAdapter") {};
|
|
19
|
+
//#endregion
|
|
20
|
+
export { PtySpawnError as n, PtyAdapter as t };
|
|
21
|
+
|
|
22
|
+
//# sourceMappingURL=PTY-B_NJr7la.mjs.map
|