antechamber 2.0.3 → 2.0.4
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/CHANGELOG.md +10 -0
- package/dist/pi-event-translation.d.ts +1 -1
- package/dist/pi-event-translation.js +2 -2
- package/dist/session-commands.d.ts +1 -1
- package/dist/session-commands.js +4 -32
- package/dist/sessions.js +8 -2
- package/dist/types.d.ts +3 -25
- package/dist/v2.js +4 -3
- package/extensions/antechamber/package.json +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,16 @@ and this project uses [Semantic Versioning](https://semver.org/).
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [2.0.4] - 2026-11-19
|
|
11
|
+
|
|
12
|
+
### Fixed
|
|
13
|
+
|
|
14
|
+
- A print-only slash command such as `/loop stop` no longer renders below its own output in OpenChamber 2.x. The
|
|
15
|
+
command now takes the time OmO admitted it, and its output is always created after it.
|
|
16
|
+
- A `!` shell command shows one card in OpenChamber 2.5, not two. The adapter no longer sends `session.shell.started`
|
|
17
|
+
and `session.shell.ended`, which OpenChamber draws as a second shell row; the remaining `bash` card is the one that
|
|
18
|
+
shows output while the command runs.
|
|
19
|
+
|
|
10
20
|
## [2.0.3] - 2026-11-17
|
|
11
21
|
|
|
12
22
|
### Fixed
|
|
@@ -67,7 +67,7 @@ export declare class PiEventTranslator {
|
|
|
67
67
|
finishInterruptedRun(s: ManagedSession, error: NonNullable<OCAssistantMessage["error"]>): void;
|
|
68
68
|
setStatus(s: ManagedSession, status: OCSessionStatus): void;
|
|
69
69
|
emitPart(s: ManagedSession, part: OCPart, delta?: string): void;
|
|
70
|
-
deliverInput(s: ManagedSession, messageID: string): void;
|
|
70
|
+
deliverInput(s: ManagedSession, messageID: string, created?: number): void;
|
|
71
71
|
private reconcileUser;
|
|
72
72
|
onPiEvent(s: ManagedSession, ev: Record<string, unknown>): void;
|
|
73
73
|
private onTodoEntry;
|
|
@@ -253,10 +253,10 @@ export class PiEventTranslator {
|
|
|
253
253
|
properties: delta === undefined ? { part } : { part, delta },
|
|
254
254
|
});
|
|
255
255
|
}
|
|
256
|
-
deliverInput(s, messageID) {
|
|
256
|
+
deliverInput(s, messageID, created) {
|
|
257
257
|
this.services.emit(s.info.directory, {
|
|
258
258
|
type: "session.inbox.delivered",
|
|
259
|
-
properties: { sessionID: s.info.id, inboxID: messageID },
|
|
259
|
+
properties: { sessionID: s.info.id, inboxID: messageID, ...(created !== undefined ? { created } : {}) },
|
|
260
260
|
});
|
|
261
261
|
s.inputs?.delete(messageID);
|
|
262
262
|
}
|
|
@@ -89,7 +89,7 @@ export declare function createShellMessage(session: ManagedSession, command: str
|
|
|
89
89
|
export declare function shellUserMessage(message: ShellMessage): ShellUserMessage;
|
|
90
90
|
/** An adapter-authored notice card; `created` places a replayed notice at its original time. */
|
|
91
91
|
export declare function noticeMessage(session: ManagedSession, messageText: string, error?: OCAssistantMessage["error"], created?: number): ShareNoticeMessage;
|
|
92
|
-
export declare function announceSessionNotice(context: ShareNoticeContext, messageText: string, error?: OCAssistantMessage["error"]): void;
|
|
92
|
+
export declare function announceSessionNotice(context: ShareNoticeContext, messageText: string, error?: OCAssistantMessage["error"], created?: number): void;
|
|
93
93
|
export declare function announceSessionError(context: ShareNoticeContext, errorName: string, messageText: string): void;
|
|
94
94
|
export declare function completeShellMessage(message: ShellMessage, command: string, result: ShellResult): void;
|
|
95
95
|
export declare function failShellMessage(message: ShellMessage, command: string, error: string, metadata?: Record<string, unknown>): void;
|
package/dist/session-commands.js
CHANGED
|
@@ -265,11 +265,11 @@ export function noticeMessage(session, messageText, error, created) {
|
|
|
265
265
|
};
|
|
266
266
|
return { info, parts: [part] };
|
|
267
267
|
}
|
|
268
|
-
export function announceSessionNotice(context, messageText, error) {
|
|
268
|
+
export function announceSessionNotice(context, messageText, error, created) {
|
|
269
269
|
const { session, sessions, emit } = context;
|
|
270
270
|
if (!sessions.messages(session.info.id))
|
|
271
271
|
return;
|
|
272
|
-
const message = noticeMessage(session, messageText, error);
|
|
272
|
+
const message = noticeMessage(session, messageText, error, created);
|
|
273
273
|
const [part] = message.parts;
|
|
274
274
|
const { info } = message;
|
|
275
275
|
sessions.appendMessage(session.info.id, message);
|
|
@@ -319,15 +319,6 @@ export async function runShellCommand(context) {
|
|
|
319
319
|
sessions.messages(session.info.id);
|
|
320
320
|
const message = createShellMessage(session, command);
|
|
321
321
|
const user = shellUserMessage(message);
|
|
322
|
-
const shell = {
|
|
323
|
-
id: message.parts[0].callID,
|
|
324
|
-
command,
|
|
325
|
-
cwd: session.info.directory,
|
|
326
|
-
shell: "bash",
|
|
327
|
-
file: "",
|
|
328
|
-
metadata: {},
|
|
329
|
-
time: { started: message.info.time.created },
|
|
330
|
-
};
|
|
331
322
|
const dispatch = (session.tree.shellDispatch ??= {});
|
|
332
323
|
dispatch[message.info.id] = false;
|
|
333
324
|
const afterEntryId = session.tree.leafId ?? null;
|
|
@@ -369,11 +360,9 @@ export async function runShellCommand(context) {
|
|
|
369
360
|
setShellStatus(context, "busy");
|
|
370
361
|
shellEvent(context, { type: "message.updated", properties: { info: user.info } });
|
|
371
362
|
shellEvent(context, { type: "message.part.updated", properties: { part: user.parts[0] } });
|
|
363
|
+
// The `bash` card above is the shell's only card. No `session.shell.started`/`ended`: OpenChamber 2.5 draws
|
|
364
|
+
// those as a second shell row, one that cannot show output while the command runs.
|
|
372
365
|
emitShellMessage(context, message);
|
|
373
|
-
shellEvent(context, {
|
|
374
|
-
type: "session.shell.started",
|
|
375
|
-
properties: { sessionID: session.info.id, shell: { ...shell, status: "running" } },
|
|
376
|
-
});
|
|
377
366
|
try {
|
|
378
367
|
await sessions.update(session.info.id, {});
|
|
379
368
|
const response = await sessions.sessionRpc(session.info.id, { type: "bash", command, executionId: message.parts[0].callID }, controller.signal, () => {
|
|
@@ -426,23 +415,6 @@ export async function runShellCommand(context) {
|
|
|
426
415
|
streaming?.off("event", onOutput);
|
|
427
416
|
clearTimeout(flush);
|
|
428
417
|
delete session.cancelShell;
|
|
429
|
-
const state = message.parts[0].state;
|
|
430
|
-
const metadata = state.status === "pending" ? undefined : state.metadata;
|
|
431
|
-
const output = state.status === "completed" ? state.output : state.status === "error" ? state.error : "";
|
|
432
|
-
const size = Buffer.byteLength(output);
|
|
433
|
-
shellEvent(context, {
|
|
434
|
-
type: "session.shell.ended",
|
|
435
|
-
properties: {
|
|
436
|
-
sessionID: session.info.id,
|
|
437
|
-
shell: {
|
|
438
|
-
...shell,
|
|
439
|
-
status: state.status === "completed" ? "exited" : "killed",
|
|
440
|
-
...(typeof metadata?.exitCode === "number" ? { exit: metadata.exitCode } : {}),
|
|
441
|
-
time: { ...shell.time, completed: message.info.time.completed ?? Date.now() },
|
|
442
|
-
},
|
|
443
|
-
output: { output, cursor: size, size, truncated: metadata?.truncated === true },
|
|
444
|
-
},
|
|
445
|
-
});
|
|
446
418
|
setShellStatus(context, "idle");
|
|
447
419
|
await sessions.update(session.info.id, {});
|
|
448
420
|
}
|
package/dist/sessions.js
CHANGED
|
@@ -1324,7 +1324,10 @@ export class SessionManager {
|
|
|
1324
1324
|
};
|
|
1325
1325
|
const onNotification = (request) => {
|
|
1326
1326
|
if (request.method === "notify" && typeof request.message === "string") {
|
|
1327
|
-
|
|
1327
|
+
// OpenChamber 2.x orders by creation time and breaks a same-millisecond tie on the (random) id, so the
|
|
1328
|
+
// command's output must be created after the command itself.
|
|
1329
|
+
const created = Math.max(Date.now(), userMsg.time.created + 1);
|
|
1330
|
+
announceSessionNotice({ sessions: this, session: s, emit: this.emit }, request.message, undefined, created);
|
|
1328
1331
|
}
|
|
1329
1332
|
};
|
|
1330
1333
|
if (text.startsWith("/"))
|
|
@@ -1370,6 +1373,8 @@ export class SessionManager {
|
|
|
1370
1373
|
properties: {
|
|
1371
1374
|
sessionID: s.info.id,
|
|
1372
1375
|
inboxID: userMsg.id,
|
|
1376
|
+
// Admission time, not now: a print-only command's output was already announced during the prompt RPC.
|
|
1377
|
+
created: userMsg.time.created,
|
|
1373
1378
|
item: {
|
|
1374
1379
|
type: "user",
|
|
1375
1380
|
delivery,
|
|
@@ -1388,8 +1393,9 @@ export class SessionManager {
|
|
|
1388
1393
|
typeof res.data === "object" &&
|
|
1389
1394
|
"disposition" in res.data &&
|
|
1390
1395
|
res.data.disposition === "handled") {
|
|
1396
|
+
// OmO handled the command on admission, ahead of the output it printed.
|
|
1391
1397
|
if (!input.delivered)
|
|
1392
|
-
this.events.deliverInput(s, userMsg.id);
|
|
1398
|
+
this.events.deliverInput(s, userMsg.id, userMsg.time.created);
|
|
1393
1399
|
if (wasIdle)
|
|
1394
1400
|
this.events.setStatus(s, { type: "idle" });
|
|
1395
1401
|
}
|
package/dist/types.d.ts
CHANGED
|
@@ -257,6 +257,8 @@ export type OCEvent = {
|
|
|
257
257
|
properties: {
|
|
258
258
|
sessionID: string;
|
|
259
259
|
inboxID: string;
|
|
260
|
+
/** v2 envelope time; OpenChamber 2.x takes the user message's creation time from it. Defaults to now. */
|
|
261
|
+
created?: number;
|
|
260
262
|
item: {
|
|
261
263
|
type: "user";
|
|
262
264
|
delivery: "steer" | "queue";
|
|
@@ -279,6 +281,7 @@ export type OCEvent = {
|
|
|
279
281
|
properties: {
|
|
280
282
|
sessionID: string;
|
|
281
283
|
inboxID: string;
|
|
284
|
+
created?: number;
|
|
282
285
|
};
|
|
283
286
|
} | {
|
|
284
287
|
type: "session.diff";
|
|
@@ -409,31 +412,6 @@ export type OCEvent = {
|
|
|
409
412
|
};
|
|
410
413
|
};
|
|
411
414
|
};
|
|
412
|
-
} | {
|
|
413
|
-
type: "session.shell.started" | "session.shell.ended";
|
|
414
|
-
properties: {
|
|
415
|
-
sessionID: string;
|
|
416
|
-
shell: {
|
|
417
|
-
id: string;
|
|
418
|
-
command: string;
|
|
419
|
-
cwd: string;
|
|
420
|
-
shell: string;
|
|
421
|
-
file: string;
|
|
422
|
-
status: "running" | "exited" | "timeout" | "killed";
|
|
423
|
-
exit?: number;
|
|
424
|
-
metadata: Record<string, unknown>;
|
|
425
|
-
time: {
|
|
426
|
-
started: number;
|
|
427
|
-
completed?: number;
|
|
428
|
-
};
|
|
429
|
-
};
|
|
430
|
-
output?: {
|
|
431
|
-
output: string;
|
|
432
|
-
cursor: number;
|
|
433
|
-
size: number;
|
|
434
|
-
truncated: boolean;
|
|
435
|
-
};
|
|
436
|
-
};
|
|
437
415
|
} | {
|
|
438
416
|
type: "shell.created";
|
|
439
417
|
properties: {
|
package/dist/v2.js
CHANGED
|
@@ -298,7 +298,10 @@ export class V2EventTranslator {
|
|
|
298
298
|
translate(directory, ev) {
|
|
299
299
|
switch (ev.type) {
|
|
300
300
|
case "session.inbox.enqueued":
|
|
301
|
-
case "session.inbox.delivered":
|
|
301
|
+
case "session.inbox.delivered": {
|
|
302
|
+
const { created, ...data } = ev.properties;
|
|
303
|
+
return [this.frame(directory, ev.type, data, created)];
|
|
304
|
+
}
|
|
302
305
|
case "session.renamed":
|
|
303
306
|
case "session.agent.selected":
|
|
304
307
|
case "session.archived":
|
|
@@ -311,8 +314,6 @@ export class V2EventTranslator {
|
|
|
311
314
|
case "session.compaction.delta":
|
|
312
315
|
case "session.compaction.ended":
|
|
313
316
|
case "session.compaction.failed":
|
|
314
|
-
case "session.shell.started":
|
|
315
|
-
case "session.shell.ended":
|
|
316
317
|
case "shell.created":
|
|
317
318
|
case "shell.exited":
|
|
318
319
|
case "filesystem.changed":
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "antechamber-openchamber",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.4",
|
|
4
4
|
"description": "OpenChamber extension for antechamber: installs and pins the antechamber server and OmO, draws the OmO Graph and the OmO Work section, and titles OmO tool cards",
|
|
5
5
|
"private": true,
|
|
6
6
|
"type": "module",
|