@cotal-ai/connector-opencode 0.21.0 → 0.22.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.
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAiCA,OAAO,KAAK,EAAE,MAAM,EAAS,MAAM,qBAAqB,CAAC;AAiBzD,eAAO,MAAM,KAAK,EAAE,MA+cnB,CAAC"}
1
+ {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAgCA,OAAO,KAAK,EAAE,MAAM,EAAS,MAAM,qBAAqB,CAAC;AAgBzD,eAAO,MAAM,KAAK,EAAE,MAwbnB,CAAC"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cotal-ai/connector-opencode",
3
3
  "description": "Cotal connector for OpenCode: a native in-process plugin that joins a session to the mesh.",
4
- "version": "0.21.0",
4
+ "version": "0.22.0",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
7
7
  "type": "git",
@@ -24,9 +24,9 @@
24
24
  "@opencode-ai/plugin": "^1.16.2",
25
25
  "esbuild": "^0.28.0",
26
26
  "tsx": "^4.22.4",
27
- "@cotal-ai/connector-core": "0.21.0",
28
- "@cotal-ai/core": "0.21.0",
29
- "@cotal-ai/smoke-kit": "0.0.0"
27
+ "@cotal-ai/connector-core": "0.22.0",
28
+ "@cotal-ai/smoke-kit": "0.0.0",
29
+ "@cotal-ai/core": "0.22.0"
30
30
  },
31
31
  "files": [
32
32
  "dist"
@@ -1,42 +0,0 @@
1
- /**
2
- * OpenCode transcript mirror — publishes the agent's OWN session output to the per-agent `tr-<name>`
3
- * channel (assistant text in full, tool calls as one-liners, tool results truncated, reasoning
4
- * omitted) so observers can read what an OpenCode agent ACTUALLY did — not only what it narrates on
5
- * the work channels (the Claude connector has had this; OpenCode did not).
6
- *
7
- * EVENT-DRIVEN, not poll-based. The connector plugin already receives OpenCode's bus events
8
- * in-process, so the mirror taps them (the same live stream a UI can proxy to a browser, instead of
9
- * re-reading the session each frame):
10
- * • record(msg) ← message.updated: learn which messageIDs are ASSISTANT (mirror the agent's
11
- * own output, never the injected user/peer turns).
12
- * • observe(part) ← message.part.updated: condense the part NOW and buffer its lines (tool results
13
- * truncated to a preview, assistant text kept in full;
14
- * keyed by `${messageID}:${partID}`, replaced as it streams).
15
- * • flush() ← session.idle: publish the turn's settled assistant lines, then clear.
16
- * • reset() ← session adoption: drop the buffer at a hard boundary (`/new`).
17
- * Cost is O(parts-this-turn) with NO HTTP — unlike a fetch-the-whole-session-every-idle poll, which is
18
- * O(N²) and grows unboundedly over a long session. flush() snapshots the turn's lines and clears before
19
- * it publishes, so a duplicate/late session.idle can't republish the batch.
20
- *
21
- * Each turn's lines are published ONCE to the channel; DURABLE delivery (persistence, replay to offline
22
- * readers) is the channel's job — a durable `tr-<name>` is JetStream-backed — not a hand-rolled retry
23
- * buffer here. This mirror is therefore best-effort at the publish boundary: the plugin runs flush() on
24
- * the turn-end path and keeps a transport error OFF the turn loop by logging it (so a failed publish can
25
- * never wedge the agent) — which means a publish that fails outright drops THAT turn's lines. That is
26
- * the deliberate tradeoff for an opt-in observability side-channel; it is logged, never silent.
27
- */
28
- import type { MeshAgent } from "@cotal-ai/connector-core";
29
- export interface TranscriptMirror {
30
- /** message.updated → remember which messageIDs are assistant-authored (this turn). */
31
- record(message: any): void;
32
- /** message.part.updated → condense the part and buffer its lines (tool results truncated, assistant
33
- * text kept full; keyed by `${messageID}:${partID}`, this turn). */
34
- observe(part: any): void;
35
- /** session.idle → publish the turn's settled assistant lines to the channel, then clear. */
36
- flush(): Promise<void>;
37
- /** session adoption (`/new`) → drop the buffer so a new session never inherits stale parts. */
38
- reset(): void;
39
- }
40
- /** An event-driven mirror to `channel`, fed from the plugin's OpenCode event hook. */
41
- export declare function createTranscriptMirror(agent: MeshAgent, channel: string): TranscriptMirror;
42
- //# sourceMappingURL=transcript.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"transcript.d.ts","sourceRoot":"","sources":["../src/transcript.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AA8D1D,MAAM,WAAW,gBAAgB;IAC/B,sFAAsF;IACtF,MAAM,CAAC,OAAO,EAAE,GAAG,GAAG,IAAI,CAAC;IAC3B;yEACqE;IACrE,OAAO,CAAC,IAAI,EAAE,GAAG,GAAG,IAAI,CAAC;IACzB,4FAA4F;IAC5F,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACvB,+FAA+F;IAC/F,KAAK,IAAI,IAAI,CAAC;CACf;AAED,sFAAsF;AACtF,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,GAAG,gBAAgB,CAyC1F"}