@jskit-ai/assistant-core 0.1.243 → 0.1.244

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.
@@ -8,14 +8,14 @@
8
8
  "build": "vite build"
9
9
  },
10
10
  "dependencies": {
11
- "@jskit-ai/assistant-core": "0.1.243",
12
- "@jskit-ai/http-runtime": "0.1.245",
13
- "@jskit-ai/kernel": "0.1.247",
11
+ "@jskit-ai/assistant-core": "0.1.244",
12
+ "@jskit-ai/http-runtime": "0.1.246",
13
+ "@jskit-ai/kernel": "0.1.248",
14
14
  "@mdi/js": "^7.4.47",
15
15
  "vue": "^3.5.13",
16
16
  "vuetify": "^4.0.0",
17
- "@jskit-ai/connectors-core": "0.1.64",
18
- "@jskit-ai/connectors-catalog": "0.1.66"
17
+ "@jskit-ai/connectors-core": "0.1.65",
18
+ "@jskit-ai/connectors-catalog": "0.1.67"
19
19
  },
20
20
  "devDependencies": {
21
21
  "@vitejs/plugin-vue": "^6.0.7",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jskit-ai/assistant-core",
3
- "version": "0.1.243",
3
+ "version": "0.1.244",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "test": "node --test --test-concurrency=1"
@@ -47,8 +47,8 @@
47
47
  "@ai-sdk/perplexity": "^4.0.43",
48
48
  "@ai-sdk/togetherai": "^3.0.49",
49
49
  "@ai-sdk/xai": "^4.0.58",
50
- "@jskit-ai/resource-core": "0.1.189",
51
- "@jskit-ai/resource-crud-core": "0.1.189",
50
+ "@jskit-ai/resource-core": "0.1.190",
51
+ "@jskit-ai/resource-crud-core": "0.1.190",
52
52
  "@mdi/js": "^7.4.47",
53
53
  "@openrouter/ai-sdk-provider": "^3.0.0",
54
54
  "ai": "^7.0.101",
@@ -57,8 +57,8 @@
57
57
  "ws": "^8.20.1"
58
58
  },
59
59
  "peerDependencies": {
60
- "@jskit-ai/http-runtime": "0.1.245",
61
- "@jskit-ai/kernel": "0.1.247",
60
+ "@jskit-ai/http-runtime": "0.1.246",
61
+ "@jskit-ai/kernel": "0.1.248",
62
62
  "vue": "^3.5.13",
63
63
  "vuetify": "^4.0.0"
64
64
  },
@@ -29,12 +29,21 @@ const OPENCODE_ZEN_PUBLIC_API_KEY = "public";
29
29
  const text = normalizeNullableText;
30
30
 
31
31
  export function openCodeProcessEnvironment(baseEnv = {}, {
32
- cacheRoot = "", dbPath = "", inlineConfig = "", outputTokenMax = 0, password = ""
32
+ cacheRoot = "", dbPath = "", inlineConfig = "", outputTokenMax = 0, packageInstalls = true, password = ""
33
33
  } = {}) {
34
34
  return {
35
35
  // OpenCode installs plugin dependencies through npm, which ignores XDG_CACHE_HOME.
36
- npm_config_cache: path.join(cacheRoot, "npm"),
37
- npm_config_prefer_offline: "true",
36
+ ...(packageInstalls ? {
37
+ npm_config_cache: path.join(cacheRoot, "npm"),
38
+ npm_config_prefer_offline: "true"
39
+ } : {
40
+ // Each server that loads a fresh configuration directory starts installing
41
+ // OpenCode's plugin package, and while that install runs the first SIGTERM
42
+ // only aborts it, leaving the server alive. A short-lived server that needs
43
+ // no packages fails the install at once from a cache nothing populates.
44
+ npm_config_cache: path.join(cacheRoot, "npm-offline"),
45
+ npm_config_offline: "true"
46
+ }),
38
47
  NO_PROXY: [text(baseEnv.NO_PROXY), OPENCODE_HOST, "localhost", "::1"]
39
48
  .filter(Boolean)
40
49
  .join(","),
@@ -3,7 +3,7 @@ import { access, mkdtemp, rm } from "node:fs/promises";
3
3
  import os from "node:os";
4
4
  import path from "node:path";
5
5
  import test from "node:test";
6
- import { createOpenCodeServerProcess } from "../src/server/conversation/openCodeProcess.js";
6
+ import { createOpenCodeServerProcess, openCodeProcessEnvironment } from "../src/server/conversation/openCodeProcess.js";
7
7
 
8
8
  async function fixture(t, options = {}) {
9
9
  const workdir = await mkdtemp(path.join(os.tmpdir(), "jskit-opencode-process-"));
@@ -175,3 +175,17 @@ test("production stop retains failure for retry and keeps the complete confirmed
175
175
  assert.equal(attempt, 3);
176
176
  await assert.rejects(access(f.config.privateRoot), { code: "ENOENT" });
177
177
  });
178
+
179
+ test("a server that needs no packages makes OpenCode's plugin install fail at once", () => {
180
+ const installing = openCodeProcessEnvironment({}, { cacheRoot: "/cache" });
181
+ assert.equal(installing.npm_config_cache, "/cache/npm");
182
+ assert.equal(installing.npm_config_prefer_offline, "true");
183
+ assert.equal(installing.npm_config_offline, undefined);
184
+ // A real OpenCode 1.18.31 catalogue server stopped mid-install ignored SIGTERM
185
+ // for the whole systemd stop timeout; offline from an empty cache it stopped in
186
+ // under 50 ms and returned the same providers and agents.
187
+ const offline = openCodeProcessEnvironment({}, { cacheRoot: "/cache", packageInstalls: false });
188
+ assert.equal(offline.npm_config_offline, "true");
189
+ assert.equal(offline.npm_config_cache, "/cache/npm-offline");
190
+ assert.equal(offline.npm_config_prefer_offline, undefined);
191
+ });