@cotal-ai/connector-opencode 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/index.js +22 -14
- package/dist/plugin/index.js +3002 -2412
- package/dist/plugin.d.ts.map +1 -1
- package/package.json +3 -3
package/dist/extension.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extension.d.ts","sourceRoot":"","sources":["../src/extension.ts"],"names":[],"mappings":"AAGA,OAAO,EAAY,KAAK,SAAS,EAAuE,MAAM,gBAAgB,CAAC;AAyG/H;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,iBAAiB,EAAE,
|
|
1
|
+
{"version":3,"file":"extension.d.ts","sourceRoot":"","sources":["../src/extension.ts"],"names":[],"mappings":"AAGA,OAAO,EAAY,KAAK,SAAS,EAAuE,MAAM,gBAAgB,CAAC;AAyG/H;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,iBAAiB,EAAE,SA+L/B,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -6900,7 +6900,7 @@ import { LAUNCH_MATERIAL_ENV, readLaunchMaterial } from "@cotal-ai/core/launch-m
|
|
|
6900
6900
|
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";
|
|
6901
6901
|
|
|
6902
6902
|
// ../connector-core/dist/framing.js
|
|
6903
|
-
import { peerLabel } from "@cotal-ai/core";
|
|
6903
|
+
import { peerLabel } from "@cotal-ai/core/peer-label";
|
|
6904
6904
|
|
|
6905
6905
|
// ../connector-core/dist/manager-call.js
|
|
6906
6906
|
import { BASELINE_LIFECYCLE_ENDPOINT, EpEnvelopeError, dialerFor, goalFollowRefusal, invokeCommand, isPermissionDenied, issuedUserCaller, managerCallerBinding, replyRefusedBeforeEffect, resolveService, standaloneConnectOpts } from "@cotal-ai/core";
|
|
@@ -6927,6 +6927,7 @@ function controlEndpoint(space, name, token = randomBytes(32).toString("base64ur
|
|
|
6927
6927
|
|
|
6928
6928
|
// ../connector-core/dist/launch.js
|
|
6929
6929
|
import { eventChannel as eventChannel2, LAUNCH_MATERIAL_ENV as LAUNCH_MATERIAL_ENV3, parsePrincipalKey, principalKey, writeLaunchMaterial } from "@cotal-ai/core";
|
|
6930
|
+
import { dirname } from "node:path";
|
|
6930
6931
|
import { EVENT_CHANNEL_PREFIX, eventChannel as eventChannel3, eventChannelPrincipal, isEventChannel } from "@cotal-ai/core";
|
|
6931
6932
|
var OS_ENV_ALLOW = [
|
|
6932
6933
|
"PATH",
|
|
@@ -7049,7 +7050,7 @@ function connectorLaunchOptions(connector, launchOptions) {
|
|
|
7049
7050
|
throw new Error(`${connector} connector: launch option key ${JSON.stringify(k)} is not a valid flag name`);
|
|
7050
7051
|
return Object.entries(launchOptions);
|
|
7051
7052
|
}
|
|
7052
|
-
function materialEnv(opts) {
|
|
7053
|
+
function materialEnv(opts, artifacts) {
|
|
7053
7054
|
if (opts.userAuth && opts.creds)
|
|
7054
7055
|
throw new Error("launch: creds (static auth) and userAuth (user-mode auth) are mutually exclusive \u2014 one launch carries one identity plane");
|
|
7055
7056
|
const material = {};
|
|
@@ -7067,7 +7068,9 @@ function materialEnv(opts) {
|
|
|
7067
7068
|
material.userAuth = opts.userAuth;
|
|
7068
7069
|
if (Object.keys(material).length === 0)
|
|
7069
7070
|
return {};
|
|
7070
|
-
|
|
7071
|
+
const path = writeLaunchMaterial(material);
|
|
7072
|
+
artifacts.push(dirname(path));
|
|
7073
|
+
return { [LAUNCH_MATERIAL_ENV3]: path };
|
|
7071
7074
|
}
|
|
7072
7075
|
function launchArmsEvents(opts) {
|
|
7073
7076
|
return opts.events !== false || opts.eventsRequired === true;
|
|
@@ -21752,7 +21755,7 @@ function date4(params) {
|
|
|
21752
21755
|
config(en_default());
|
|
21753
21756
|
|
|
21754
21757
|
// ../connector-core/dist/tool-specs.js
|
|
21755
|
-
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";
|
|
21758
|
+
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";
|
|
21756
21759
|
|
|
21757
21760
|
// ../connector-core/dist/orientation.js
|
|
21758
21761
|
import { peerLabel as peerLabel3 } from "@cotal-ai/core";
|
|
@@ -21762,6 +21765,14 @@ var STOP = new Set("a an and are as at be by do for from has how in is it of on
|
|
|
21762
21765
|
|
|
21763
21766
|
// ../connector-core/dist/tool-specs.js
|
|
21764
21767
|
var NO_TOOL_ARGS = external_exports.strictObject({});
|
|
21768
|
+
var managerInstanceArg = external_exports.string().refine((value) => {
|
|
21769
|
+
try {
|
|
21770
|
+
assertLifecycleToken3(value, "instance");
|
|
21771
|
+
return true;
|
|
21772
|
+
} catch {
|
|
21773
|
+
return false;
|
|
21774
|
+
}
|
|
21775
|
+
}, "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.");
|
|
21765
21776
|
|
|
21766
21777
|
// ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.29.0_zod@4.4.3/node_modules/@modelcontextprotocol/sdk/dist/esm/types.js
|
|
21767
21778
|
var RELATED_TASK_META_KEY = "io.modelcontextprotocol/related-task";
|
|
@@ -23491,6 +23502,9 @@ var MAX_DRAIN_BYTES = 64 * 1024 * 1024;
|
|
|
23491
23502
|
// ../connector-core/dist/gateway.js
|
|
23492
23503
|
import { assertValidName } from "@cotal-ai/core";
|
|
23493
23504
|
var CONNECTION_ID = external_exports.string().min(1).describe("The connection_id cotal_connect returned in THIS conversation. Never reuse another conversation's.");
|
|
23505
|
+
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.";
|
|
23506
|
+
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.";
|
|
23507
|
+
var GATEWAY_INSTRUCTIONS = `${GATEWAY_CONNECTING} ${GATEWAY_LISTENING}`;
|
|
23494
23508
|
|
|
23495
23509
|
// ../connector-core/dist/control.js
|
|
23496
23510
|
var MAX_FRAME_BYTES = 1 << 20;
|
|
@@ -23617,15 +23631,6 @@ var opencodeConnector = {
|
|
|
23617
23631
|
const env = {
|
|
23618
23632
|
...launchEnv({ providerKeys: MODEL_PROVIDER_KEYS, envAllow: opts.envAllow }),
|
|
23619
23633
|
...aclEnv(opts),
|
|
23620
|
-
// Creds, broker URL and the control token ride a 0600 file; only its path is exported.
|
|
23621
|
-
//
|
|
23622
|
-
// The plugin drops even that path once it has read it, and WHERE it does so is the part worth
|
|
23623
|
-
// stating: this connector's seat process is a shim that starts `opencode serve` and a TUI
|
|
23624
|
-
// attached to it, and the plugin runs inside the SERVER. The server is also the process that
|
|
23625
|
-
// executes the session's tool calls, so a shell this seat runs inherits neither the material
|
|
23626
|
-
// nor a reference to it. The shim itself keeps the reference, because the server it starts is
|
|
23627
|
-
// the reader; it runs no tools of its own.
|
|
23628
|
-
...materialEnv({ creds: opts.creds, servers: opts.servers, controlToken: control.token, eventsRequired: opts.eventsRequired, userAuth: opts.userAuth }),
|
|
23629
23634
|
COTAL_SPACE: opts.space,
|
|
23630
23635
|
COTAL_NAME: opts.name
|
|
23631
23636
|
};
|
|
@@ -23692,11 +23697,14 @@ var opencodeConnector = {
|
|
|
23692
23697
|
}
|
|
23693
23698
|
env.OPENCODE_CONFIG_CONTENT = JSON.stringify(config2);
|
|
23694
23699
|
env.COTAL_CONTROL_SOCKET = control.path;
|
|
23700
|
+
const artifacts = [];
|
|
23701
|
+
Object.assign(env, materialEnv({ creds: opts.creds, servers: opts.servers, controlToken: control.token, eventsRequired: opts.eventsRequired, userAuth: opts.userAuth }, artifacts));
|
|
23695
23702
|
return {
|
|
23696
23703
|
command: process.execPath,
|
|
23697
23704
|
args: [SERVE_SHIM],
|
|
23698
23705
|
env,
|
|
23699
|
-
control
|
|
23706
|
+
control,
|
|
23707
|
+
...artifacts.length > 0 ? { artifacts } : {}
|
|
23700
23708
|
};
|
|
23701
23709
|
}
|
|
23702
23710
|
};
|