dsh-llm-omp-transports 0.3.6 → 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.
- package/lib/omp/antigravity-cli.mjs +16 -10
- package/lib/omp/antigravity-login.mjs +16 -10
- package/package.json +1 -1
|
@@ -150,14 +150,25 @@ var Archive = class {
|
|
|
150
150
|
return new Map(tarMembers(new Uint8Array(tar)).map((member) => [member.name, member.bytes]));
|
|
151
151
|
}
|
|
152
152
|
};
|
|
153
|
+
function pipeOf(stream, name) {
|
|
154
|
+
if (stream === null) throw new Error(`Antigravity CLI spawned without a readable ${name}`);
|
|
155
|
+
return new ReadableStream({
|
|
156
|
+
start(controller) {
|
|
157
|
+
stream.on("data", (chunk) => controller.enqueue(new Uint8Array(chunk)));
|
|
158
|
+
stream.on("end", () => controller.close());
|
|
159
|
+
stream.on("error", (error) => controller.error(error));
|
|
160
|
+
}
|
|
161
|
+
});
|
|
162
|
+
}
|
|
153
163
|
function spawn(command, options = {}) {
|
|
164
|
+
const stderrMode = options.stderr ?? "ignore";
|
|
154
165
|
const child = nodeSpawn(command[0], command.slice(1), {
|
|
155
166
|
cwd: options.cwd,
|
|
156
|
-
stdio: [options.stdin ?? "pipe", options.stdout ?? "pipe",
|
|
167
|
+
stdio: [options.stdin ?? "pipe", options.stdout ?? "pipe", stderrMode],
|
|
157
168
|
env: options.env
|
|
158
169
|
});
|
|
159
|
-
const stdout = child.stdout;
|
|
160
|
-
|
|
170
|
+
const stdout = pipeOf(child.stdout, "stdout");
|
|
171
|
+
const stderr = stderrMode === "pipe" ? pipeOf(child.stderr, "stderr") : void 0;
|
|
161
172
|
const exited = new Promise((resolve3) => {
|
|
162
173
|
child.once("exit", (code) => resolve3(code ?? 1));
|
|
163
174
|
child.once("error", () => resolve3(1));
|
|
@@ -175,13 +186,8 @@ function spawn(command, options = {}) {
|
|
|
175
186
|
};
|
|
176
187
|
return {
|
|
177
188
|
stdin,
|
|
178
|
-
stdout
|
|
179
|
-
|
|
180
|
-
stdout.on("data", (chunk) => controller.enqueue(new Uint8Array(chunk)));
|
|
181
|
-
stdout.on("end", () => controller.close());
|
|
182
|
-
stdout.on("error", (error) => controller.error(error));
|
|
183
|
-
}
|
|
184
|
-
}),
|
|
189
|
+
stdout,
|
|
190
|
+
...stderr === void 0 ? {} : { stderr },
|
|
185
191
|
exited,
|
|
186
192
|
kill: (signal) => {
|
|
187
193
|
child.kill(signal);
|
|
@@ -144,14 +144,25 @@ var Archive = class {
|
|
|
144
144
|
return new Map(tarMembers(new Uint8Array(tar)).map((member) => [member.name, member.bytes]));
|
|
145
145
|
}
|
|
146
146
|
};
|
|
147
|
+
function pipeOf(stream, name) {
|
|
148
|
+
if (stream === null) throw new Error(`Antigravity CLI spawned without a readable ${name}`);
|
|
149
|
+
return new ReadableStream({
|
|
150
|
+
start(controller) {
|
|
151
|
+
stream.on("data", (chunk) => controller.enqueue(new Uint8Array(chunk)));
|
|
152
|
+
stream.on("end", () => controller.close());
|
|
153
|
+
stream.on("error", (error) => controller.error(error));
|
|
154
|
+
}
|
|
155
|
+
});
|
|
156
|
+
}
|
|
147
157
|
function spawn(command, options = {}) {
|
|
158
|
+
const stderrMode = options.stderr ?? "ignore";
|
|
148
159
|
const child = nodeSpawn(command[0], command.slice(1), {
|
|
149
160
|
cwd: options.cwd,
|
|
150
|
-
stdio: [options.stdin ?? "pipe", options.stdout ?? "pipe",
|
|
161
|
+
stdio: [options.stdin ?? "pipe", options.stdout ?? "pipe", stderrMode],
|
|
151
162
|
env: options.env
|
|
152
163
|
});
|
|
153
|
-
const stdout = child.stdout;
|
|
154
|
-
|
|
164
|
+
const stdout = pipeOf(child.stdout, "stdout");
|
|
165
|
+
const stderr = stderrMode === "pipe" ? pipeOf(child.stderr, "stderr") : void 0;
|
|
155
166
|
const exited = new Promise((resolve3) => {
|
|
156
167
|
child.once("exit", (code) => resolve3(code ?? 1));
|
|
157
168
|
child.once("error", () => resolve3(1));
|
|
@@ -169,13 +180,8 @@ function spawn(command, options = {}) {
|
|
|
169
180
|
};
|
|
170
181
|
return {
|
|
171
182
|
stdin,
|
|
172
|
-
stdout
|
|
173
|
-
|
|
174
|
-
stdout.on("data", (chunk) => controller.enqueue(new Uint8Array(chunk)));
|
|
175
|
-
stdout.on("end", () => controller.close());
|
|
176
|
-
stdout.on("error", (error) => controller.error(error));
|
|
177
|
-
}
|
|
178
|
-
}),
|
|
183
|
+
stdout,
|
|
184
|
+
...stderr === void 0 ? {} : { stderr },
|
|
179
185
|
exited,
|
|
180
186
|
kill: (signal) => {
|
|
181
187
|
child.kill(signal);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-llm-omp-transports",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "DSH transport plugin: serves providers whose wire protocols only oh-my-pi's own transport code can speak (Cursor and Devin), by registering its own routes on the dsh-llm seam.",
|
|
6
6
|
"keywords": [
|