@shipers-dev/multi 0.6.0 → 0.6.2
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/index.js +26 -4
- package/package.json +1 -1
- package/src/acpx-runner.ts +22 -0
- package/src/index.ts +3 -3
package/dist/index.js
CHANGED
|
@@ -5399,6 +5399,27 @@ async function runAcpx(opts) {
|
|
|
5399
5399
|
args.push(opts.prompt);
|
|
5400
5400
|
const proc = Bun.spawn(args, { stdout: "pipe", stderr: "pipe", stdin: "ignore" });
|
|
5401
5401
|
let stopReason = "end_turn";
|
|
5402
|
+
(async () => {
|
|
5403
|
+
try {
|
|
5404
|
+
const r = proc.stderr.getReader();
|
|
5405
|
+
const d = new TextDecoder;
|
|
5406
|
+
let sb = "";
|
|
5407
|
+
while (true) {
|
|
5408
|
+
const { value, done } = await r.read();
|
|
5409
|
+
if (done)
|
|
5410
|
+
break;
|
|
5411
|
+
sb += d.decode(value, { stream: true });
|
|
5412
|
+
let nl;
|
|
5413
|
+
while ((nl = sb.indexOf(`
|
|
5414
|
+
`)) !== -1) {
|
|
5415
|
+
const ln = sb.slice(0, nl).trim();
|
|
5416
|
+
sb = sb.slice(nl + 1);
|
|
5417
|
+
if (ln)
|
|
5418
|
+
await opts.onEvent({ event_type: "progress", payload: { message: `[acpx] ${ln.slice(0, 500)}` } });
|
|
5419
|
+
}
|
|
5420
|
+
}
|
|
5421
|
+
} catch {}
|
|
5422
|
+
})();
|
|
5402
5423
|
const reader = proc.stdout.getReader();
|
|
5403
5424
|
const dec = new TextDecoder;
|
|
5404
5425
|
let buf = "";
|
|
@@ -5460,6 +5481,7 @@ function handleSessionUpdate(params) {
|
|
|
5460
5481
|
const u = params.update || {};
|
|
5461
5482
|
const kind = u.sessionUpdate;
|
|
5462
5483
|
const out = [];
|
|
5484
|
+
out.push({ event_type: "progress", payload: { message: `[acpx upd] ${kind} keys=${Object.keys(u).join(",")}` } });
|
|
5463
5485
|
switch (kind) {
|
|
5464
5486
|
case "agent_message_chunk":
|
|
5465
5487
|
case "agent_thought_chunk": {
|
|
@@ -5531,7 +5553,7 @@ var LOG_PATH = join(MULTI_DIR, "logs", "agent.log");
|
|
|
5531
5553
|
var SKILLS_DIR = join(MULTI_DIR, "skills");
|
|
5532
5554
|
var STOP_PATH = join(MULTI_DIR, "stop.flag");
|
|
5533
5555
|
var TASKS_DB_PATH = join(MULTI_DIR, "tasks.db");
|
|
5534
|
-
var VERSION = "0.6.
|
|
5556
|
+
var VERSION = "0.6.2";
|
|
5535
5557
|
var COMMANDS = {
|
|
5536
5558
|
setup: "Register this device with a workspace",
|
|
5537
5559
|
connect: "Connect device to realtime hub and execute assigned tasks",
|
|
@@ -6193,15 +6215,15 @@ Context (original task ${task.key}): ${task.title}` : base || task.title;
|
|
|
6193
6215
|
userPart += `
|
|
6194
6216
|
|
|
6195
6217
|
---
|
|
6196
|
-
Attached files (
|
|
6218
|
+
Attached input files (read them with your tools if useful):
|
|
6197
6219
|
${lines}
|
|
6198
6220
|
|
|
6199
|
-
|
|
6221
|
+
Note: if (and only if) you produce binary or large artifact outputs (screenshots, data exports, generated source files), write them under ${outDir}. Always put your human-facing reply in the chat response itself \u2014 do NOT write your answer as a file.`;
|
|
6200
6222
|
} else {
|
|
6201
6223
|
userPart += `
|
|
6202
6224
|
|
|
6203
6225
|
---
|
|
6204
|
-
|
|
6226
|
+
Respond in the chat. Only if you produce large artifact files (screenshots, data exports, generated source code), write them under ${outDir}. Do not put your answer in a file.`;
|
|
6205
6227
|
}
|
|
6206
6228
|
let preamble = "";
|
|
6207
6229
|
try {
|
package/package.json
CHANGED
package/src/acpx-runner.ts
CHANGED
|
@@ -36,6 +36,26 @@ export async function runAcpx(opts: AcpxRunOpts): Promise<{ stopReason: string }
|
|
|
36
36
|
const proc = Bun.spawn(args, { stdout: 'pipe', stderr: 'pipe', stdin: 'ignore' });
|
|
37
37
|
let stopReason = 'end_turn';
|
|
38
38
|
|
|
39
|
+
// Forward stderr to our progress stream so we can debug in the UI/logs
|
|
40
|
+
(async () => {
|
|
41
|
+
try {
|
|
42
|
+
const r = (proc.stderr as ReadableStream<Uint8Array>).getReader();
|
|
43
|
+
const d = new TextDecoder();
|
|
44
|
+
let sb = '';
|
|
45
|
+
while (true) {
|
|
46
|
+
const { value, done } = await r.read();
|
|
47
|
+
if (done) break;
|
|
48
|
+
sb += d.decode(value, { stream: true });
|
|
49
|
+
let nl: number;
|
|
50
|
+
while ((nl = sb.indexOf('\n')) !== -1) {
|
|
51
|
+
const ln = sb.slice(0, nl).trim();
|
|
52
|
+
sb = sb.slice(nl + 1);
|
|
53
|
+
if (ln) await opts.onEvent({ event_type: 'progress', payload: { message: `[acpx] ${ln.slice(0, 500)}` } });
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
} catch {}
|
|
57
|
+
})();
|
|
58
|
+
|
|
39
59
|
const reader = (proc.stdout as ReadableStream<Uint8Array>).getReader();
|
|
40
60
|
const dec = new TextDecoder();
|
|
41
61
|
let buf = '';
|
|
@@ -92,6 +112,8 @@ function handleSessionUpdate(params: any): AcpEvent[] {
|
|
|
92
112
|
const u = params.update || {};
|
|
93
113
|
const kind = u.sessionUpdate;
|
|
94
114
|
const out: AcpEvent[] = [];
|
|
115
|
+
// Fallthrough debug: emit the update kind + keys so we can see what acpx is sending
|
|
116
|
+
out.push({ event_type: 'progress', payload: { message: `[acpx upd] ${kind} keys=${Object.keys(u).join(',')}` } });
|
|
95
117
|
switch (kind) {
|
|
96
118
|
case 'agent_message_chunk':
|
|
97
119
|
case 'agent_thought_chunk': {
|
package/src/index.ts
CHANGED
|
@@ -17,7 +17,7 @@ const LOG_PATH = join(MULTI_DIR, 'logs', 'agent.log');
|
|
|
17
17
|
const SKILLS_DIR = join(MULTI_DIR, 'skills');
|
|
18
18
|
const STOP_PATH = join(MULTI_DIR, 'stop.flag');
|
|
19
19
|
const TASKS_DB_PATH = join(MULTI_DIR, 'tasks.db');
|
|
20
|
-
const VERSION = '0.6.
|
|
20
|
+
const VERSION = '0.6.2';
|
|
21
21
|
|
|
22
22
|
const COMMANDS = {
|
|
23
23
|
setup: 'Register this device with a workspace',
|
|
@@ -629,9 +629,9 @@ async function handleRunTask(apiUrl: string, deviceId: string, task: any, detect
|
|
|
629
629
|
userPart = stripSelfMention(userPart, preferType);
|
|
630
630
|
if (attachmentRefs.length) {
|
|
631
631
|
const lines = attachmentRefs.map(a => `- ${a.filename}: ${a.path}`).join('\n');
|
|
632
|
-
userPart += `\n\n---\nAttached files (
|
|
632
|
+
userPart += `\n\n---\nAttached input files (read them with your tools if useful):\n${lines}\n\nNote: if (and only if) you produce binary or large artifact outputs (screenshots, data exports, generated source files), write them under ${outDir}. Always put your human-facing reply in the chat response itself — do NOT write your answer as a file.`;
|
|
633
633
|
} else {
|
|
634
|
-
userPart += `\n\n---\
|
|
634
|
+
userPart += `\n\n---\nRespond in the chat. Only if you produce large artifact files (screenshots, data exports, generated source code), write them under ${outDir}. Do not put your answer in a file.`;
|
|
635
635
|
}
|
|
636
636
|
|
|
637
637
|
// Pull agent + linked skills to construct system/context preamble
|