codiedev 0.9.42 → 0.9.43
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/dist/codie.js +65 -15
- package/package.json +1 -1
package/dist/codie.js
CHANGED
|
@@ -169,6 +169,66 @@ function installBrandWordmarkUnsafe(runtime) {
|
|
|
169
169
|
(0, child_process_1.spawnSync)("codesign", ["--force", "--sign", "-", runtime], { stdio: "ignore" });
|
|
170
170
|
}
|
|
171
171
|
}
|
|
172
|
+
async function runNonInteractive(runtime, runtimeArgs, env) {
|
|
173
|
+
const child = (0, child_process_1.spawn)(runtime, runtimeArgs, {
|
|
174
|
+
stdio: ["inherit", "pipe", "pipe"],
|
|
175
|
+
env,
|
|
176
|
+
});
|
|
177
|
+
return await new Promise((resolve, reject) => {
|
|
178
|
+
let blockReason;
|
|
179
|
+
let pendingStdout = [];
|
|
180
|
+
let flushTimer;
|
|
181
|
+
// OpenCode reports a plugin rejection through two different pipes: the
|
|
182
|
+
// adapter's private reason on stderr, then its generic UnknownError on
|
|
183
|
+
// stdout. Hold stdout very briefly so the reason can win that race. Normal
|
|
184
|
+
// run output remains streaming with only an imperceptible delay.
|
|
185
|
+
const flushStdout = () => {
|
|
186
|
+
flushTimer = undefined;
|
|
187
|
+
if (!blockReason) {
|
|
188
|
+
for (const chunk of pendingStdout)
|
|
189
|
+
process.stdout.write(chunk);
|
|
190
|
+
}
|
|
191
|
+
pendingStdout = [];
|
|
192
|
+
};
|
|
193
|
+
const scheduleStdoutFlush = () => {
|
|
194
|
+
if (!flushTimer)
|
|
195
|
+
flushTimer = setTimeout(flushStdout, 75);
|
|
196
|
+
};
|
|
197
|
+
child.stdout?.on("data", (chunk) => {
|
|
198
|
+
if (blockReason)
|
|
199
|
+
return;
|
|
200
|
+
pendingStdout.push(Buffer.from(chunk));
|
|
201
|
+
scheduleStdoutFlush();
|
|
202
|
+
});
|
|
203
|
+
child.stderr?.on("data", (chunk) => {
|
|
204
|
+
const text = chunk.toString();
|
|
205
|
+
const reason = (0, codieLauncher_1.extractCodieSecurityBlock)(text);
|
|
206
|
+
if (reason) {
|
|
207
|
+
blockReason = reason;
|
|
208
|
+
pendingStdout = [];
|
|
209
|
+
if (flushTimer)
|
|
210
|
+
clearTimeout(flushTimer);
|
|
211
|
+
flushTimer = undefined;
|
|
212
|
+
return;
|
|
213
|
+
}
|
|
214
|
+
if (!blockReason)
|
|
215
|
+
process.stderr.write(chunk);
|
|
216
|
+
});
|
|
217
|
+
child.once("error", reject);
|
|
218
|
+
child.once("close", (status) => {
|
|
219
|
+
if (flushTimer)
|
|
220
|
+
clearTimeout(flushTimer);
|
|
221
|
+
if (blockReason) {
|
|
222
|
+
pendingStdout = [];
|
|
223
|
+
console.error(`Codie Security blocked this action:\n${blockReason}`);
|
|
224
|
+
}
|
|
225
|
+
else {
|
|
226
|
+
flushStdout();
|
|
227
|
+
}
|
|
228
|
+
resolve(status);
|
|
229
|
+
});
|
|
230
|
+
});
|
|
231
|
+
}
|
|
172
232
|
async function main() {
|
|
173
233
|
(0, codieRuntime_1.assertCodieNodeVersion)(process.versions.node);
|
|
174
234
|
const connected = connectedCodiedevConfig();
|
|
@@ -235,23 +295,13 @@ async function main() {
|
|
|
235
295
|
const nonInteractiveRun = runtimeArgs[0] === "run";
|
|
236
296
|
if (nonInteractiveRun)
|
|
237
297
|
env.CODIEDEV_SECURITY_BLOCK_OUTPUT = "marker";
|
|
238
|
-
const result = (0, child_process_1.spawnSync)(runtime, runtimeArgs, {
|
|
239
|
-
stdio: nonInteractiveRun ? ["inherit", "inherit", "pipe"] : "inherit",
|
|
240
|
-
encoding: nonInteractiveRun ? "utf8" : undefined,
|
|
241
|
-
env,
|
|
242
|
-
});
|
|
243
|
-
if (result.error)
|
|
244
|
-
throw result.error;
|
|
245
298
|
if (nonInteractiveRun) {
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
if (blockReason) {
|
|
249
|
-
console.error(`Codie Security blocked this action:\n${blockReason}`);
|
|
250
|
-
}
|
|
251
|
-
else if (stderr) {
|
|
252
|
-
process.stderr.write(stderr);
|
|
253
|
-
}
|
|
299
|
+
process.exitCode = (await runNonInteractive(runtime, runtimeArgs, env)) ?? 1;
|
|
300
|
+
return;
|
|
254
301
|
}
|
|
302
|
+
const result = (0, child_process_1.spawnSync)(runtime, runtimeArgs, { stdio: "inherit", env });
|
|
303
|
+
if (result.error)
|
|
304
|
+
throw result.error;
|
|
255
305
|
process.exitCode = result.status === null ? 1 : result.status;
|
|
256
306
|
}
|
|
257
307
|
main().catch((error) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "codiedev",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.43",
|
|
4
4
|
"description": "Connect Claude Code, Codex, Cursor, OpenCode, or VS Code Copilot to Codiedev for team session capture and artifact collaboration — and run the governed Codie harness",
|
|
5
5
|
"bin": {
|
|
6
6
|
"codiedev": "dist/cli.js",
|