@cotal-ai/connector-opencode 0.86.0 → 0.88.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.
@@ -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,SA0L/B,CAAC"}
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
@@ -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
- return { [LAUNCH_MATERIAL_ENV3]: writeLaunchMaterial(material) };
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;
@@ -23628,15 +23631,6 @@ var opencodeConnector = {
23628
23631
  const env = {
23629
23632
  ...launchEnv({ providerKeys: MODEL_PROVIDER_KEYS, envAllow: opts.envAllow }),
23630
23633
  ...aclEnv(opts),
23631
- // Creds, broker URL and the control token ride a 0600 file; only its path is exported.
23632
- //
23633
- // The plugin drops even that path once it has read it, and WHERE it does so is the part worth
23634
- // stating: this connector's seat process is a shim that starts `opencode serve` and a TUI
23635
- // attached to it, and the plugin runs inside the SERVER. The server is also the process that
23636
- // executes the session's tool calls, so a shell this seat runs inherits neither the material
23637
- // nor a reference to it. The shim itself keeps the reference, because the server it starts is
23638
- // the reader; it runs no tools of its own.
23639
- ...materialEnv({ creds: opts.creds, servers: opts.servers, controlToken: control.token, eventsRequired: opts.eventsRequired, userAuth: opts.userAuth }),
23640
23634
  COTAL_SPACE: opts.space,
23641
23635
  COTAL_NAME: opts.name
23642
23636
  };
@@ -23703,11 +23697,14 @@ var opencodeConnector = {
23703
23697
  }
23704
23698
  env.OPENCODE_CONFIG_CONTENT = JSON.stringify(config2);
23705
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));
23706
23702
  return {
23707
23703
  command: process.execPath,
23708
23704
  args: [SERVE_SHIM],
23709
23705
  env,
23710
- control
23706
+ control,
23707
+ ...artifacts.length > 0 ? { artifacts } : {}
23711
23708
  };
23712
23709
  }
23713
23710
  };