@ai-sdk/harness-acp 1.0.22 → 1.0.24

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/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # @ai-sdk/harness-acp
2
2
 
3
+ ## 1.0.24
4
+
5
+ ### Patch Changes
6
+
7
+ - @ai-sdk/harness@1.0.86
8
+
9
+ ## 1.0.23
10
+
11
+ ### Patch Changes
12
+
13
+ - 6352c2a: feat(harness-acp): support ACP harnesses that do not have an NPM package via new `install-command` source type
14
+ - Updated dependencies [b74971f]
15
+ - Updated dependencies [fa6af57]
16
+ - @ai-sdk/provider-utils@5.0.29
17
+ - @ai-sdk/harness@1.0.85
18
+
3
19
  ## 1.0.22
4
20
 
5
21
  ### Patch Changes
@@ -12,7 +12,7 @@ import {
12
12
  ListToolsRequestSchema,
13
13
  McpError
14
14
  } from "@modelcontextprotocol/sdk/types.js";
15
- var VERSION = true ? "1.0.22" : "0.0.0-test";
15
+ var VERSION = true ? "1.0.24" : "0.0.0-test";
16
16
  function createHostToolMCPServer({
17
17
  tools: tools2,
18
18
  revision = 1,
@@ -3301,10 +3301,14 @@ async function ensureSession({
3301
3301
  instructions: start.instructions,
3302
3302
  instructionMapping: start.instructionMapping,
3303
3303
  sessionMeta: bridgeConfiguration.sessionMeta,
3304
- environment: createChildEnvironment({ launchEnv })
3304
+ environment: createChildEnvironment({
3305
+ launchEnv,
3306
+ implementationDir,
3307
+ privateHome: implementation.privateHome
3308
+ })
3305
3309
  });
3306
3310
  child = spawn(
3307
- `${implementationDir}/node_modules/.bin/${implementation.executable}`,
3311
+ `${implementationDir}/${implementation.executablePath}`,
3308
3312
  [...implementation.args],
3309
3313
  {
3310
3314
  cwd: workDir,
@@ -3561,7 +3565,9 @@ function resolveGatewayValues({
3561
3565
  };
3562
3566
  }
3563
3567
  function createChildEnvironment({
3564
- launchEnv
3568
+ launchEnv,
3569
+ implementationDir: implementationDir2,
3570
+ privateHome
3565
3571
  }) {
3566
3572
  const blocked = /* @__PURE__ */ new Set([
3567
3573
  "BRIDGE_CHANNEL_TOKEN",
@@ -3572,7 +3578,7 @@ function createChildEnvironment({
3572
3578
  "AI_SDK_ACP_CLIENT_APP_VERSION",
3573
3579
  ACP_BRIDGE_CONFIGURATION_ENV
3574
3580
  ]);
3575
- return {
3581
+ const environment = {
3576
3582
  ...Object.fromEntries(
3577
3583
  Object.entries(processEnv).filter(
3578
3584
  ([key, value]) => !blocked.has(key) && value != null
@@ -3580,6 +3586,17 @@ function createChildEnvironment({
3580
3586
  ),
3581
3587
  ...launchEnv
3582
3588
  };
3589
+ if (!privateHome) return environment;
3590
+ const home = `${implementationDir2}/home`;
3591
+ const inheritedPath = environment.PATH;
3592
+ return {
3593
+ ...environment,
3594
+ HOME: home,
3595
+ PATH: [
3596
+ `${home}/.local/bin`,
3597
+ ...inheritedPath == null || inheritedPath.length === 0 ? [] : [inheritedPath]
3598
+ ].join(":")
3599
+ };
3583
3600
  }
3584
3601
  function isRecord7(value) {
3585
3602
  return value != null && typeof value === "object" && !Array.isArray(value);
@@ -3645,11 +3662,12 @@ async function readImplementationDescriptor({
3645
3662
  const value = await new Response(text, {
3646
3663
  headers: { "content-type": "application/json" }
3647
3664
  }).json();
3648
- if (!isRecord7(value) || typeof value.executable !== "string" || !Array.isArray(value.args) || !value.args.every((item) => typeof item === "string") || !Array.isArray(value.envKeys) || !value.envKeys.every((item) => typeof item === "string")) {
3665
+ if (!isRecord7(value) || typeof value.executablePath !== "string" || typeof value.privateHome !== "boolean" || !Array.isArray(value.args) || !value.args.every((item) => typeof item === "string") || !Array.isArray(value.envKeys) || !value.envKeys.every((item) => typeof item === "string")) {
3649
3666
  throw new Error("Invalid ACP implementation descriptor.");
3650
3667
  }
3651
3668
  return {
3652
- executable: value.executable,
3669
+ executablePath: value.executablePath,
3670
+ privateHome: value.privateHome,
3653
3671
  args: value.args,
3654
3672
  envKeys: value.envKeys
3655
3673
  };