antechamber 1.0.40 → 1.0.41
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 +29 -0
- package/dist/approvals.d.ts +9 -1
- package/dist/approvals.js +10 -2
- package/dist/catalog.d.ts +13 -2
- package/dist/catalog.js +88 -52
- package/dist/file-watch.d.ts +35 -0
- package/dist/file-watch.js +163 -0
- package/dist/misc-routes.js +12 -2
- package/dist/pi-event-translation.js +44 -2
- package/dist/route-services.d.ts +8 -1
- package/dist/routes-v2.js +251 -33
- package/dist/server.d.ts +16 -0
- package/dist/server.js +182 -6
- package/dist/session-commands.d.ts +3 -1
- package/dist/session-commands.js +13 -7
- package/dist/session-history.js +3 -0
- package/dist/session-store.d.ts +7 -0
- package/dist/session-store.js +28 -0
- package/dist/session-tree.d.ts +15 -1
- package/dist/sessions.d.ts +85 -1
- package/dist/sessions.js +238 -10
- package/dist/text-generation.d.ts +20 -0
- package/dist/text-generation.js +93 -0
- package/dist/types.d.ts +60 -0
- package/dist/v2.d.ts +8 -1
- package/dist/v2.js +24 -4
- package/extensions/omo-compat/package.json +1 -1
- package/extensions/omo-dag/package.json +1 -1
- package/extensions/omo-work/package.json +1 -1
- package/package.json +1 -1
package/dist/v2.js
CHANGED
|
@@ -23,6 +23,7 @@
|
|
|
23
23
|
*/
|
|
24
24
|
import { randomUUID } from "node:crypto";
|
|
25
25
|
import { getAgentName } from "./agent-name.js";
|
|
26
|
+
import { toV2Permission } from "./approvals.js";
|
|
26
27
|
import { questionFormID, toQuestionForm } from "./question-forms.js";
|
|
27
28
|
import { v2PromptAttachments } from "./prompt-parts.js";
|
|
28
29
|
function genId(prefix) {
|
|
@@ -97,6 +98,7 @@ export function toV2Session(info, opts = {}) {
|
|
|
97
98
|
created: info.time.created,
|
|
98
99
|
updated: info.time.updated,
|
|
99
100
|
...(info.time.idle !== undefined ? { idle: info.time.idle } : {}),
|
|
101
|
+
...(info.time.viewed !== undefined ? { viewed: info.time.viewed } : {}),
|
|
100
102
|
...(info.time.archived !== undefined ? { archived: info.time.archived } : {}),
|
|
101
103
|
},
|
|
102
104
|
title: info.title,
|
|
@@ -127,7 +129,14 @@ function toV2UserMessage(info) {
|
|
|
127
129
|
const metadata = user.metadata !== undefined ? { metadata: user.metadata } : {};
|
|
128
130
|
// Admitted no-reply context lists as OpenCode's synthetic item, not as a user turn.
|
|
129
131
|
if (user.synthetic)
|
|
130
|
-
return {
|
|
132
|
+
return {
|
|
133
|
+
id: user.id,
|
|
134
|
+
time: { created: user.time.created },
|
|
135
|
+
type: "synthetic",
|
|
136
|
+
text,
|
|
137
|
+
...(user.description !== undefined ? { description: user.description } : {}),
|
|
138
|
+
...metadata,
|
|
139
|
+
};
|
|
131
140
|
const inputs = info.parts.flatMap((part) => (part.type === "file" || part.type === "agent" ? [part] : []));
|
|
132
141
|
return {
|
|
133
142
|
id: user.id,
|
|
@@ -290,16 +299,28 @@ export class V2EventTranslator {
|
|
|
290
299
|
switch (ev.type) {
|
|
291
300
|
case "session.inbox.enqueued":
|
|
292
301
|
case "session.inbox.delivered":
|
|
302
|
+
case "session.renamed":
|
|
303
|
+
case "session.agent.selected":
|
|
304
|
+
case "session.archived":
|
|
305
|
+
case "session.unarchived":
|
|
306
|
+
case "session.viewed":
|
|
293
307
|
case "session.revert.staged":
|
|
294
308
|
case "session.revert.cleared":
|
|
295
309
|
case "session.revert.committed":
|
|
296
310
|
case "session.compaction.started":
|
|
311
|
+
case "session.compaction.delta":
|
|
297
312
|
case "session.compaction.ended":
|
|
298
313
|
case "session.compaction.failed":
|
|
299
314
|
case "session.shell.started":
|
|
300
315
|
case "session.shell.ended":
|
|
301
316
|
case "shell.created":
|
|
302
317
|
case "shell.exited":
|
|
318
|
+
case "filesystem.changed":
|
|
319
|
+
case "project.updated":
|
|
320
|
+
case "provider.updated":
|
|
321
|
+
case "model.updated":
|
|
322
|
+
case "command.updated":
|
|
323
|
+
case "vcs.branch.updated":
|
|
303
324
|
return [this.frame(directory, ev.type, ev.properties)];
|
|
304
325
|
case "message.removed":
|
|
305
326
|
return [
|
|
@@ -318,6 +339,7 @@ export class V2EventTranslator {
|
|
|
318
339
|
subpath: subpathOf(info.directory),
|
|
319
340
|
title: info.title,
|
|
320
341
|
agent: info.agent ?? getAgentName(),
|
|
342
|
+
...(info.model !== undefined ? { model: info.model } : {}),
|
|
321
343
|
...(info.parentID !== undefined ? { parentID: info.parentID } : {}),
|
|
322
344
|
...(info.parentMessageID !== undefined ? { parentMessageID: info.parentMessageID } : {}),
|
|
323
345
|
...(info.metadata !== undefined ? { metadata: info.metadata } : {}),
|
|
@@ -327,11 +349,9 @@ export class V2EventTranslator {
|
|
|
327
349
|
case "session.updated": {
|
|
328
350
|
const info = ev.properties.info;
|
|
329
351
|
return [
|
|
330
|
-
this.frame(directory, "session.renamed", { sessionID: info.id, title: info.title }),
|
|
331
352
|
...(info.metadata !== undefined
|
|
332
353
|
? [this.frame(directory, "session.metadata.updated", { sessionID: info.id, metadata: info.metadata })]
|
|
333
354
|
: []),
|
|
334
|
-
this.frame(directory, "session.agent.selected", { sessionID: info.id, agent: info.agent ?? getAgentName() }),
|
|
335
355
|
...(info.cost !== undefined
|
|
336
356
|
? [
|
|
337
357
|
this.frame(directory, "session.usage.updated", {
|
|
@@ -427,7 +447,7 @@ export class V2EventTranslator {
|
|
|
427
447
|
}
|
|
428
448
|
case "permission.asked": {
|
|
429
449
|
const p = ev.properties;
|
|
430
|
-
return [this.frame(directory, "permission.asked", p)];
|
|
450
|
+
return [this.frame(directory, "permission.asked", toV2Permission(p))];
|
|
431
451
|
}
|
|
432
452
|
case "permission.replied":
|
|
433
453
|
return [this.frame(directory, "permission.replied", ev.properties)];
|