@cotal-ai/connector-jcode 0.85.0 → 0.87.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/extension.d.ts.map +1 -1
- package/dist/host.js +3013 -2423
- package/dist/index.js +28 -6
- package/dist/mcp.js +1010 -801
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -6923,7 +6923,7 @@ import { LAUNCH_MATERIAL_ENV, readLaunchMaterial } from "@cotal-ai/core/launch-m
|
|
|
6923
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";
|
|
6924
6924
|
|
|
6925
6925
|
// ../connector-core/dist/framing.js
|
|
6926
|
-
import { peerLabel } from "@cotal-ai/core";
|
|
6926
|
+
import { peerLabel } from "@cotal-ai/core/peer-label";
|
|
6927
6927
|
|
|
6928
6928
|
// ../connector-core/dist/manager-call.js
|
|
6929
6929
|
import { BASELINE_LIFECYCLE_ENDPOINT, EpEnvelopeError, dialerFor, goalFollowRefusal, invokeCommand, isPermissionDenied, issuedUserCaller, managerCallerBinding, replyRefusedBeforeEffect, resolveService, standaloneConnectOpts } from "@cotal-ai/core";
|
|
@@ -6950,6 +6950,7 @@ function controlEndpoint(space, name, token = randomBytes(32).toString("base64ur
|
|
|
6950
6950
|
|
|
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
|
+
import { dirname } from "node:path";
|
|
6953
6954
|
import { EVENT_CHANNEL_PREFIX, eventChannel as eventChannel3, eventChannelPrincipal, isEventChannel } from "@cotal-ai/core";
|
|
6954
6955
|
var OS_ENV_ALLOW = [
|
|
6955
6956
|
"PATH",
|
|
@@ -7065,7 +7066,7 @@ function connectorLaunchOptions(connector, launchOptions) {
|
|
|
7065
7066
|
throw new Error(`${connector} connector: launch option key ${JSON.stringify(k)} is not a valid flag name`);
|
|
7066
7067
|
return Object.entries(launchOptions);
|
|
7067
7068
|
}
|
|
7068
|
-
function materialEnv(opts) {
|
|
7069
|
+
function materialEnv(opts, artifacts) {
|
|
7069
7070
|
if (opts.userAuth && opts.creds)
|
|
7070
7071
|
throw new Error("launch: creds (static auth) and userAuth (user-mode auth) are mutually exclusive \u2014 one launch carries one identity plane");
|
|
7071
7072
|
const material = {};
|
|
@@ -7083,7 +7084,9 @@ function materialEnv(opts) {
|
|
|
7083
7084
|
material.userAuth = opts.userAuth;
|
|
7084
7085
|
if (Object.keys(material).length === 0)
|
|
7085
7086
|
return {};
|
|
7086
|
-
|
|
7087
|
+
const path2 = writeLaunchMaterial(material);
|
|
7088
|
+
artifacts.push(dirname(path2));
|
|
7089
|
+
return { [LAUNCH_MATERIAL_ENV3]: path2 };
|
|
7087
7090
|
}
|
|
7088
7091
|
function launchArmsEvents(opts) {
|
|
7089
7092
|
return opts.events !== false || opts.eventsRequired === true;
|
|
@@ -21768,7 +21771,7 @@ function date4(params) {
|
|
|
21768
21771
|
config(en_default());
|
|
21769
21772
|
|
|
21770
21773
|
// ../connector-core/dist/tool-specs.js
|
|
21771
|
-
import { isConcreteChannel as isConcreteChannel3, channelInAllow as channelInAllow3, AmbiguousPeerError, peerLabel as peerLabel4, assertLifecycleToken as assertLifecycleToken3, isPermissionDenied as isPermissionDenied2, renderLifecycleBlocked, EpEnvelopeError as EpEnvelopeError3, LANG_PROBLEM_DETAIL_KIND, formatAge, presenceAges } from "@cotal-ai/core";
|
|
21774
|
+
import { isConcreteChannel as isConcreteChannel3, channelInAllow as channelInAllow3, AmbiguousPeerError, peerLabel as peerLabel4, assertLifecycleToken as assertLifecycleToken3, isPermissionDenied as isPermissionDenied2, renderLifecycleBlocked, EpEnvelopeError as EpEnvelopeError3, LANG_PROBLEM_DETAIL_KIND, formatAge, presenceAges, presenceText } from "@cotal-ai/core";
|
|
21772
21775
|
|
|
21773
21776
|
// ../connector-core/dist/orientation.js
|
|
21774
21777
|
import { peerLabel as peerLabel3 } from "@cotal-ai/core";
|
|
@@ -21778,6 +21781,14 @@ var STOP = new Set("a an and are as at be by do for from has how in is it of on
|
|
|
21778
21781
|
|
|
21779
21782
|
// ../connector-core/dist/tool-specs.js
|
|
21780
21783
|
var NO_TOOL_ARGS = external_exports.strictObject({});
|
|
21784
|
+
var managerInstanceArg = external_exports.string().refine((value) => {
|
|
21785
|
+
try {
|
|
21786
|
+
assertLifecycleToken3(value, "instance");
|
|
21787
|
+
return true;
|
|
21788
|
+
} catch {
|
|
21789
|
+
return false;
|
|
21790
|
+
}
|
|
21791
|
+
}, "instance must be a lifecycle token ([a-z0-9]{26,32})").optional().describe("Optional manager instance id for a multi-manager space. When omitted, a seat a manager launched uses that manager and any other caller lets the mesh select one; on a user-auth mesh with several of your managers live, that selection refuses and lists their ids. A pin that cannot be resolved is refused without falling back to another manager.");
|
|
21781
21792
|
|
|
21782
21793
|
// ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.29.0_zod@4.4.3/node_modules/@modelcontextprotocol/sdk/dist/esm/types.js
|
|
21783
21794
|
var RELATED_TASK_META_KEY = "io.modelcontextprotocol/related-task";
|
|
@@ -23507,6 +23518,9 @@ var MAX_DRAIN_BYTES = 64 * 1024 * 1024;
|
|
|
23507
23518
|
// ../connector-core/dist/gateway.js
|
|
23508
23519
|
import { assertValidName } from "@cotal-ai/core";
|
|
23509
23520
|
var CONNECTION_ID = external_exports.string().min(1).describe("The connection_id cotal_connect returned in THIS conversation. Never reuse another conversation's.");
|
|
23521
|
+
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.";
|
|
23523
|
+
var GATEWAY_INSTRUCTIONS = `${GATEWAY_CONNECTING} ${GATEWAY_LISTENING}`;
|
|
23510
23524
|
|
|
23511
23525
|
// ../connector-core/dist/control.js
|
|
23512
23526
|
var MAX_FRAME_BYTES = 1 << 20;
|
|
@@ -24456,7 +24470,6 @@ var jcodeConnector = {
|
|
|
24456
24470
|
const env = {
|
|
24457
24471
|
...launchEnv({ envAllow: opts.envAllow }),
|
|
24458
24472
|
...aclEnv(opts),
|
|
24459
|
-
...materialEnv({ creds: opts.creds, servers: opts.servers, controlToken: control.token, eventsRequired: opts.eventsRequired, userAuth: opts.userAuth }),
|
|
24460
24473
|
COTAL_SPACE: opts.space,
|
|
24461
24474
|
COTAL_NAME: opts.name,
|
|
24462
24475
|
COTAL_CONTROL_SOCKET: control.path,
|
|
@@ -24494,7 +24507,16 @@ var jcodeConnector = {
|
|
|
24494
24507
|
throw new Error(
|
|
24495
24508
|
`jcode connector: launch options are not supported by the Harness API host (first option: ${launchOptions[0][0]})`
|
|
24496
24509
|
);
|
|
24497
|
-
|
|
24510
|
+
const artifacts = [];
|
|
24511
|
+
Object.assign(env, materialEnv({ creds: opts.creds, servers: opts.servers, controlToken: control.token, eventsRequired: opts.eventsRequired, userAuth: opts.userAuth }, artifacts));
|
|
24512
|
+
return {
|
|
24513
|
+
command: HOST_COMMAND,
|
|
24514
|
+
args: [HOST_ENTRY],
|
|
24515
|
+
env,
|
|
24516
|
+
control,
|
|
24517
|
+
...opts.resume ? { resumeRecordPath: jcodeForkRecordPath(seatHome) } : {},
|
|
24518
|
+
...artifacts.length > 0 ? { artifacts } : {}
|
|
24519
|
+
};
|
|
24498
24520
|
}
|
|
24499
24521
|
};
|
|
24500
24522
|
registry3.register(jcodeConnector);
|