@cotal-ai/connector-opencode 0.68.0 → 0.69.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.
@@ -20,7 +20,7 @@
20
20
  * holds no per-part state to drop: a part arrives once, complete, and is mapped in one shot. So the
21
21
  * divergence log is the source's, and there is nothing here for a revert to invalidate.
22
22
  */
23
- import { type AguiEvent, type RecordMapper } from "@cotal-ai/connector-core";
23
+ import { type RecordMapper } from "@cotal-ai/connector-core";
24
24
  import type { OpenCodeRecord } from "./agui-source.js";
25
25
  export interface OpenCodeMapperOptions {
26
26
  /** The native session id. It is the `threadId` on every event and nothing else may claim it. */
@@ -34,25 +34,12 @@ export interface OpenCodeMapperOptions {
34
34
  }
35
35
  export interface OpenCodeMapper {
36
36
  map: RecordMapper<OpenCodeRecord>;
37
- /**
38
- * Close the open run at a boundary the record stream cannot see: `session.idle`, which §3.2 makes
39
- * the flush boundary. Returns `null` when nothing is open, so calling it twice cannot manufacture
40
- * a second `RUN_FINISHED` for the bracket machine to refuse.
41
- */
42
- closeOpenRun: (timestamp: number, stopReason?: string) => {
43
- runId: string;
44
- events: AguiEvent[];
45
- } | null;
46
- /** The run currently open, or `null`. */
47
- openRun: () => string | null;
48
37
  /**
49
38
  * Forget a run the emitter closed out of band. KEYED ON THE ID: the report can arrive after this
50
39
  * mapper has already opened a newer run, and clearing unconditionally would orphan that one, whose
51
40
  * events would then emit under no run at all and halt a session that had done nothing wrong.
52
41
  */
53
42
  forgetOpenRun: (runId: string) => void;
54
- /** Why this session opened no runs, or `null` once one has. A silent refusal is the defect. */
55
- diagnose: () => string | null;
56
43
  }
57
44
  export declare function createOpenCodeMapper(opts: OpenCodeMapperOptions): OpenCodeMapper;
58
45
  //# sourceMappingURL=agui-map.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"agui-map.d.ts","sourceRoot":"","sources":["../src/agui-map.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAq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E,MAAM,MAAM,CAAC;IACxB,sEAAsE;IACtE,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,kGAAkG;IAClG,GAAG,CAAC,EAAE,MAAM,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,cAAc;IAC7B,GAAG,EAAE,YAAY,CAAC,cAAc,CAAC,CAAC;IAClC;;;;OAIG;IACH,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACxC;AAkDD,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,qBAAqB,GAAG,cAAc,CAuGhF"}
package/dist/index.js CHANGED
@@ -11,7 +11,7 @@ import { resolve } from "node:path";
11
11
  import { registry as registry3 } from "@cotal-ai/core";
12
12
 
13
13
  // ../connector-core/dist/config.js
14
- import { DEFAULT_SERVER, DEV_OWNER, LAUNCH_MATERIAL_ENV, discardLaunchMaterial, assertLifecycleToken, assertValidChannel, channelInAllow, credsClaims, eventChannel, idFromCreds, isConcreteChannel, loadAgentFile, parseJoinLink, readLaunchMaterial } from "@cotal-ai/core";
14
+ import { DEFAULT_SERVER, DEV_OWNER, LAUNCH_MATERIAL_ENV, discardLaunchMaterial, assertLifecycleToken, assertValidChannel, channelInAllow, credsClaims, eventChannel, idFromCreds, isConcreteChannel, loadAgentFile, parseJoinLink, readLaunchMaterial, resolveReadAcl } from "@cotal-ai/core";
15
15
 
16
16
  // ../connector-core/dist/agent.js
17
17
  import { normalizeMentions, RUN_LAUNCH_DEADLINE_MS, subjectMatches, isConcreteChannel as isConcreteChannel2, assertValidChannel as assertValidChannel2, channelInAllow as channelInAllow2, resolvePeer as resolvePeerInRoster, CotalEndpoint, BASELINE_LIFECYCLE_ENDPOINT as BASELINE_LIFECYCLE_ENDPOINT2, BIND_SPLIT_REISSUES, assertLifecycleToken as assertLifecycleToken3, EpEnvelopeError, isPublishPermissionDenied, unansweredRequest, renderLifecycleBlocked, bearerCommandFailure, partsToText, routeToken } from "@cotal-ai/core";
@@ -178,14 +178,11 @@ function materialEnv(opts) {
178
178
  // ../connector-core/dist/agui.js
179
179
  import { AGUI_FRAME_KIND, AGUI_EVENT_TYPE, isAguiFramePart } from "@cotal-ai/core";
180
180
  import { AGUI_FRAME_KIND as AGUI_FRAME_KIND2, AGUI_EVENT_TYPE as AGUI_EVENT_TYPE2, isAguiFramePart as isAguiFramePart2 } from "@cotal-ai/core";
181
- import { isCasLoss, principalKey as principalKey2 } from "@cotal-ai/core";
182
181
  var TRUNCATABLE_FIELDS = [
183
182
  { type: AGUI_EVENT_TYPE2.TOOL_CALL_ARGS, field: "delta" },
184
183
  { type: AGUI_EVENT_TYPE2.TOOL_CALL_RESULT, field: "content" },
185
184
  { type: AGUI_EVENT_TYPE2.TEXT_MESSAGE_CONTENT, field: "delta" }
186
185
  ];
187
- var SIZING_ID = "S".repeat(64);
188
- var SIZING_EXPECTATION = Number.MAX_SAFE_INTEGER;
189
186
  var EGRESS_FORBIDDEN_TYPES = /* @__PURE__ */ new Set([
190
187
  AGUI_EVENT_TYPE2.TOOL_CALL_ARGS,
191
188
  AGUI_EVENT_TYPE2.TOOL_CALL_RESULT
@@ -208,6 +205,11 @@ var KNOWN_EVENT_KEYS_BY_TYPE = /* @__PURE__ */ new Map([
208
205
  [AGUI_EVENT_TYPE2.CUSTOM, /* @__PURE__ */ new Set(["type", "timestamp", "rawEvent", "name", "value", "cotal"])]
209
206
  ]);
210
207
 
208
+ // ../connector-core/dist/agui-emitter.js
209
+ import { isAguiFramePart as isAguiFramePart3, isCasLoss, principalKey as principalKey2 } from "@cotal-ai/core";
210
+ var SIZING_ID = "S".repeat(64);
211
+ var SIZING_EXPECTATION = Number.MAX_SAFE_INTEGER;
212
+
211
213
  // ../connector-core/dist/event-wal.js
212
214
  import { assertIdToken } from "@cotal-ai/core";
213
215
 
@@ -215,7 +217,7 @@ import { assertIdToken } from "@cotal-ai/core";
215
217
  import { ensureDirNoSymlink } from "@cotal-ai/core";
216
218
 
217
219
  // ../connector-core/dist/agui-render.js
218
- import { AGUI_EVENT_TYPE as AGUI_EVENT_TYPE3, AGUI_FRAME_KIND as AGUI_FRAME_KIND3, isAguiFramePart as isAguiFramePart3, registry } from "@cotal-ai/core";
220
+ import { AGUI_EVENT_TYPE as AGUI_EVENT_TYPE3, AGUI_FRAME_KIND as AGUI_FRAME_KIND3, isAguiFramePart as isAguiFramePart4, registry } from "@cotal-ai/core";
219
221
  var str = (v) => typeof v === "string" ? v : void 0;
220
222
  var CONT = " \xB7 ";
221
223
  var TEXT_PREFIX = "\xBB ";
@@ -322,7 +324,7 @@ var aguiFramePartRenderer = Object.freeze({
322
324
  kind: "part-renderer",
323
325
  name: AGUI_FRAME_KIND3,
324
326
  render(part) {
325
- if (!isAguiFramePart3(part))
327
+ if (!isAguiFramePart4(part))
326
328
  return `[not an AG-UI frame]`;
327
329
  const events = part.events;
328
330
  if (!Array.isArray(events) || events.length === 0)
@@ -14853,7 +14855,7 @@ function date4(params) {
14853
14855
  config(en_default());
14854
14856
 
14855
14857
  // ../connector-core/dist/tool-specs.js
14856
- import { isConcreteChannel as isConcreteChannel3, channelInAllow as channelInAllow3, AmbiguousPeerError, assertLifecycleToken as assertLifecycleToken4, isPermissionDenied as isPermissionDenied2, renderLifecycleBlocked as renderLifecycleBlocked2, LANG_PROBLEM_DETAIL_KIND } from "@cotal-ai/core";
14858
+ import { isConcreteChannel as isConcreteChannel3, channelInAllow as channelInAllow3, AmbiguousPeerError, assertLifecycleToken as assertLifecycleToken4, isPermissionDenied as isPermissionDenied2, renderLifecycleBlocked as renderLifecycleBlocked2, LANG_PROBLEM_DETAIL_KIND, formatAge, presenceAges } from "@cotal-ai/core";
14857
14859
 
14858
14860
  // ../connector-core/dist/docs.js
14859
14861
  var STOP = new Set("a an and are as at be by do for from has how in is it of on or that the this to use using was what when where which who with you your".split(" "));