@cotal-ai/connector-jcode 0.92.2 → 0.94.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.
package/dist/index.js CHANGED
@@ -6920,7 +6920,7 @@ import { DEFAULT_SERVER, DEV_OWNER, LAUNCH_MATERIAL_ENV as LAUNCH_MATERIAL_ENV2,
6920
6920
  import { LAUNCH_MATERIAL_ENV, readLaunchMaterial } from "@cotal-ai/core/launch-material";
6921
6921
 
6922
6922
  // ../connector-core/dist/agent.js
6923
- import { normalizeMentions, RUN_LAUNCH_DEADLINE_MS, subjectMatches, isConcreteChannel as isConcreteChannel2, assertValidChannel as assertValidChannel2, channelInAllow as channelInAllow2, resolvePeer as resolvePeerInRoster, peerLabel as peerLabel2, CotalEndpoint, acquireLocalConsumer, BASELINE_LIFECYCLE_ENDPOINT as BASELINE_LIFECYCLE_ENDPOINT2, BIND_SPLIT_REISSUES, assertLifecycleToken as assertLifecycleToken2, EpEnvelopeError as EpEnvelopeError2, isPublishPermissionDenied, unansweredRequest, controlReplyFrom, controlReplyFromThrown, runAgentBearer, partsToText, assertValidRole } from "@cotal-ai/core";
6923
+ import { normalizeMentions, RUN_LAUNCH_DEADLINE_MS, subjectMatches, isConcreteChannel as isConcreteChannel2, assertValidChannel as assertValidChannel2, channelInAllow as channelInAllow2, eventChannelPrincipal, resolvePeer as resolvePeerInRoster, peerLabel as peerLabel2, CotalEndpoint, acquireLocalConsumer, BASELINE_LIFECYCLE_ENDPOINT as BASELINE_LIFECYCLE_ENDPOINT2, BIND_SPLIT_REISSUES, assertLifecycleToken as assertLifecycleToken2, EpEnvelopeError as EpEnvelopeError2, isPublishPermissionDenied, unansweredRequest, controlReplyFrom, controlReplyFromThrown, runAgentBearer, partsToText, assertValidRole } from "@cotal-ai/core";
6924
6924
 
6925
6925
  // ../connector-core/dist/framing.js
6926
6926
  import { peerLabel } from "@cotal-ai/core/peer-label";
@@ -6951,7 +6951,7 @@ function controlEndpoint(space, name, token = randomBytes(32).toString("base64ur
6951
6951
  // ../connector-core/dist/launch.js
6952
6952
  import { eventChannel as eventChannel2, LAUNCH_MATERIAL_ENV as LAUNCH_MATERIAL_ENV3, parsePrincipalKey, principalKey, writeLaunchMaterial } from "@cotal-ai/core";
6953
6953
  import { dirname } from "node:path";
6954
- import { EVENT_CHANNEL_PREFIX, eventChannel as eventChannel3, eventChannelPrincipal, isEventChannel } from "@cotal-ai/core";
6954
+ import { EVENT_CHANNEL_PREFIX, eventChannel as eventChannel3, eventChannelPrincipal as eventChannelPrincipal2, isEventChannel } from "@cotal-ai/core";
6955
6955
  var OS_ENV_ALLOW = [
6956
6956
  "PATH",
6957
6957
  "HOME",
@@ -7256,6 +7256,9 @@ function registerAguiFramePartRenderer() {
7256
7256
  }
7257
7257
  registerAguiFramePartRenderer();
7258
7258
 
7259
+ // ../connector-core/dist/control.js
7260
+ var MAX_FRAME_BYTES = 1 << 20;
7261
+
7259
7262
  // ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/classic/external.js
7260
7263
  var external_exports = {};
7261
7264
  __export(external_exports, {
@@ -23516,15 +23519,42 @@ if (typeof global.crypto === "undefined") {
23516
23519
  var MAX_DRAIN_BYTES = 64 * 1024 * 1024;
23517
23520
 
23518
23521
  // ../connector-core/dist/gateway.js
23519
- import { assertValidName } from "@cotal-ai/core";
23522
+ import { assertValidName, conversationSelection, SELECTION_MAX_ITEMS } from "@cotal-ai/core";
23523
+ var GATEWAY_TOOLS = /* @__PURE__ */ new Set([
23524
+ "cotal_orientation",
23525
+ "cotal_connection_status",
23526
+ "cotal_roster",
23527
+ "cotal_docs",
23528
+ "cotal_inbox",
23529
+ "cotal_send",
23530
+ "cotal_dm",
23531
+ "cotal_anycast",
23532
+ "cotal_status",
23533
+ "cotal_channel_info",
23534
+ "cotal_channels",
23535
+ "cotal_channel_mode",
23536
+ "cotal_join",
23537
+ "cotal_leave"
23538
+ ]);
23539
+ var NATIVE_GATEWAY_TOOLS = /* @__PURE__ */ new Set([
23540
+ ...GATEWAY_TOOLS,
23541
+ "cotal_spawn",
23542
+ "cotal_persona",
23543
+ "cotal_personas",
23544
+ "cotal_despawn",
23545
+ "cotal_run",
23546
+ "cotal_reconnect"
23547
+ ]);
23548
+ var SELECTION_SHAPE = {
23549
+ channels: external_exports.array(external_exports.strictObject({ channel: external_exports.string().min(1), access: external_exports.enum(["read", "read-post"]) })).max(SELECTION_MAX_ITEMS).optional().describe("Channels this connection may join and read, or read and post to. No wildcards."),
23550
+ role: external_exports.string().min(1).optional().describe("A role to hold, so role requests (cotal_anycast) reach this connection."),
23551
+ capabilities: external_exports.array(external_exports.enum(["spawn", "run"])).optional().describe("spawn: start and stop agents through a manager. run: start and manage workflow runs.")
23552
+ };
23520
23553
  var CONNECTION_ID = external_exports.string().min(1).describe("The connection_id cotal_connect returned in THIS conversation. Never reuse another conversation's.");
23521
23554
  var GATEWAY_LISTENING = "Messages reach you only when you call a tool: to listen, call cotal_wait, which returns as soon as a message arrives. When the person asks you to stay on Cotal or keep listening, call cotal_wait again each time it returns and handle each message as it arrives, until they ask you to stop.";
23522
- var GATEWAY_CONNECTING = "Cotal connects this conversation to the person's Cotal space. Call cotal_connect once with a short name for this conversation, then pass the returned connection_id on every other cotal tool call. Each conversation needs its own connection. Never reuse another conversation's connection_id.";
23555
+ var GATEWAY_CONNECTING = "Cotal connects this conversation to the person's Cotal space after they approve its permissions. Call cotal_connect with a short name. If approval is pending, show the person its link and wait for their decision; do not approve for them or poll. Then resume the same request as directed. Only a successful connection returns connection_id, required on every other cotal tool call. Each conversation needs its own connection. Never reuse another conversation's connection_id or approval_id.";
23523
23556
  var GATEWAY_INSTRUCTIONS = `${GATEWAY_CONNECTING} ${GATEWAY_LISTENING}`;
23524
23557
 
23525
- // ../connector-core/dist/control.js
23526
- var MAX_FRAME_BYTES = 1 << 20;
23527
-
23528
23558
  // ../../node_modules/.pnpm/smol-toml@1.8.0/node_modules/smol-toml/dist/date.js
23529
23559
  var DATE_TIME_RE = /^(\d{4}-\d{2}-\d{2})?[T ]?(?:(\d{2}):\d{2}(?::\d{2}(?:\.\d+)?)?)?(Z|[-+]\d{2}:\d{2})?$/i;
23530
23560
  var TomlDate = class _TomlDate extends Date {