@cotal-ai/connector-jcode 0.70.0 → 0.71.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 +87 -76
- package/dist/index.js +13 -10
- package/dist/mcp.js +26 -26
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -30,10 +30,13 @@ function userJcodeHome() {
|
|
|
30
30
|
import { registry as registry3 } from "@cotal-ai/core";
|
|
31
31
|
|
|
32
32
|
// ../connector-core/dist/config.js
|
|
33
|
-
import { DEFAULT_SERVER, DEV_OWNER, LAUNCH_MATERIAL_ENV, discardLaunchMaterial, assertLifecycleToken, assertValidChannel, channelInAllow, credsClaims, eventChannel, idFromCreds, isConcreteChannel, loadAgentFile, parseJoinLink,
|
|
33
|
+
import { DEFAULT_SERVER, DEV_OWNER, LAUNCH_MATERIAL_ENV as LAUNCH_MATERIAL_ENV2, discardLaunchMaterial, assertLifecycleToken, assertValidChannel, channelInAllow, credsClaims, eventChannel, idFromCreds, isConcreteChannel, loadAgentFile, parseJoinLink, resolveReadAcl } from "@cotal-ai/core";
|
|
34
|
+
|
|
35
|
+
// ../connector-core/dist/session-env.js
|
|
36
|
+
import { LAUNCH_MATERIAL_ENV, readLaunchMaterial } from "@cotal-ai/core/launch-material";
|
|
34
37
|
|
|
35
38
|
// ../connector-core/dist/agent.js
|
|
36
|
-
import { normalizeMentions, RUN_LAUNCH_DEADLINE_MS, subjectMatches, isConcreteChannel as isConcreteChannel2, assertValidChannel as assertValidChannel2, channelInAllow as channelInAllow2, resolvePeer as resolvePeerInRoster, peerLabel as peerLabel2, CotalEndpoint, BASELINE_LIFECYCLE_ENDPOINT as BASELINE_LIFECYCLE_ENDPOINT2, BIND_SPLIT_REISSUES, assertLifecycleToken as assertLifecycleToken3, EpEnvelopeError, isPublishPermissionDenied, unansweredRequest, renderLifecycleBlocked, controlReplyFrom,
|
|
39
|
+
import { normalizeMentions, RUN_LAUNCH_DEADLINE_MS, subjectMatches, isConcreteChannel as isConcreteChannel2, assertValidChannel as assertValidChannel2, channelInAllow as channelInAllow2, resolvePeer as resolvePeerInRoster, peerLabel as peerLabel2, CotalEndpoint, BASELINE_LIFECYCLE_ENDPOINT as BASELINE_LIFECYCLE_ENDPOINT2, BIND_SPLIT_REISSUES, assertLifecycleToken as assertLifecycleToken3, EpEnvelopeError, isPublishPermissionDenied, unansweredRequest, renderLifecycleBlocked, controlReplyFrom, runAgentBearer, partsToText, assertValidRole } from "@cotal-ai/core";
|
|
37
40
|
|
|
38
41
|
// ../connector-core/dist/framing.js
|
|
39
42
|
import { peerLabel } from "@cotal-ai/core";
|
|
@@ -58,7 +61,7 @@ function controlEndpoint(space, name, token = randomBytes(32).toString("base64ur
|
|
|
58
61
|
}
|
|
59
62
|
|
|
60
63
|
// ../connector-core/dist/launch.js
|
|
61
|
-
import { eventChannel as eventChannel2, LAUNCH_MATERIAL_ENV as
|
|
64
|
+
import { eventChannel as eventChannel2, LAUNCH_MATERIAL_ENV as LAUNCH_MATERIAL_ENV3, parsePrincipalKey, principalKey, writeLaunchMaterial } from "@cotal-ai/core";
|
|
62
65
|
import { EVENT_CHANNEL_PREFIX, eventChannel as eventChannel3, eventChannelPrincipal, isEventChannel } from "@cotal-ai/core";
|
|
63
66
|
var OS_ENV_ALLOW = [
|
|
64
67
|
"PATH",
|
|
@@ -127,6 +130,11 @@ var OPERATOR_ENV_KEEP = [
|
|
|
127
130
|
"COTAL_ORCA_BIN"
|
|
128
131
|
];
|
|
129
132
|
function launchEnv(opts = {}) {
|
|
133
|
+
for (const k of opts.envAllow ?? []) {
|
|
134
|
+
const name = k.toUpperCase();
|
|
135
|
+
if (name.startsWith("COTAL_") && !OPERATOR_ENV_KEEP.some((keep) => keep === name))
|
|
136
|
+
throw new Error(`spawn.env cannot list "${k}": the launcher sets COTAL_ names for each seat, and only the machine-wide ones such as COTAL_HOME cross from the spawning process`);
|
|
137
|
+
}
|
|
130
138
|
const env = {};
|
|
131
139
|
const sourceKey = /* @__PURE__ */ new Map();
|
|
132
140
|
for (const k of Object.keys(process.env))
|
|
@@ -187,7 +195,7 @@ function materialEnv(opts) {
|
|
|
187
195
|
material.userAuth = opts.userAuth;
|
|
188
196
|
if (Object.keys(material).length === 0)
|
|
189
197
|
return {};
|
|
190
|
-
return { [
|
|
198
|
+
return { [LAUNCH_MATERIAL_ENV3]: writeLaunchMaterial(material) };
|
|
191
199
|
}
|
|
192
200
|
|
|
193
201
|
// ../connector-core/dist/agui.js
|
|
@@ -15861,12 +15869,7 @@ var jcodeConnector = {
|
|
|
15861
15869
|
}
|
|
15862
15870
|
if (opts.configPath) env.COTAL_AGENT_FILE = resolve(opts.configPath);
|
|
15863
15871
|
if (opts.model) env.COTAL_MODEL = opts.model;
|
|
15864
|
-
if (opts.variant
|
|
15865
|
-
const variant = opts.variant.trim();
|
|
15866
|
-
if (!variant)
|
|
15867
|
-
throw new Error("jcode connector: a model variant was given but it is empty \u2014 there is no reasoning effort to select");
|
|
15868
|
-
env.COTAL_VARIANT = variant;
|
|
15869
|
-
}
|
|
15872
|
+
if (opts.variant) env.COTAL_VARIANT = opts.variant;
|
|
15870
15873
|
const launchOptions = connectorLaunchOptions("jcode", opts.launchOptions);
|
|
15871
15874
|
if (launchOptions.length)
|
|
15872
15875
|
throw new Error(
|