@skaile/forge-settings 1.0.1 → 1.1.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/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.1.0
4
+
5
+ - `@skaile/forge-settings/server`: `HarnessRow` carries `detection: HarnessDetection` (installed / version / login, from `@skaile/workspaces` `detectHarnesses()`). `buildHarnessRows(harnesses, settings, detections?)` takes the host's detections as an optional third argument; a harness it does not mention, or every harness when it is omitted, reports `{ id, status: "unknown" }`.
6
+ - Needs `@skaile/workspaces` ^6.14.0 (the `HarnessDetection` type).
7
+
3
8
  ## 1.0.1
4
9
 
5
10
  - `@skaile/forge-settings/ai-sdk`: an `unresolved` `ModelResolutionError` no longer copies Workspaces' error text into `message` (it could echo a resolved credential or a key in an endpoint query). The message is now fixed (`provider '<id>': credential, endpoint or provider SDK could not be resolved`); the original error stays on `cause`.
package/dist/module.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@skaile/forge-settings",
3
3
  "configKey": "forgeSettings",
4
- "version": "1.0.1",
4
+ "version": "1.1.0",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.3",
7
7
  "unbuild": "3.6.1"
@@ -19,6 +19,7 @@
19
19
  *
20
20
  * Pure functions over plain values: no Node built-ins, no environment, no file access.
21
21
  */
22
+ import type { HarnessDetection } from "@skaile/workspaces/sdk/bridge";
22
23
  import type { HarnessInfo } from "@skaile/workspaces/types";
23
24
  import type { SkaileSettings } from "../shared/settings-types.js";
24
25
  /** The slice of {@link SkaileSettings} that selects, configures and locks harnesses. */
@@ -56,14 +57,18 @@ export type HarnessRow = HarnessInfo & {
56
57
  experimental: boolean;
57
58
  /** Whether the instance's `enabledHarnesses` offers it. */
58
59
  enabled: boolean;
60
+ /** What `detectHarnesses()` found on this host: installed, version, login. */
61
+ detection: HarnessDetection;
59
62
  };
60
63
  /**
61
64
  * The rows of `GET /api/agents`: one per harness, in `harnesses` order. Hosts
62
65
  * filter to `enabled` unless the request asked for all (`?all=1`).
63
66
  * `surfaces` and `providerPlurality` ride along from {@link HarnessInfo} so the
64
67
  * Harness tab can offer each harness only the providers it can use.
68
+ * `detections` is the host's `detectHarnesses()` answer; a harness it does not
69
+ * mention (or every harness, when it is omitted) reports `{ status: "unknown" }`.
65
70
  */
66
- export declare function buildHarnessRows(harnesses: HarnessInfo[], s: Pick<HarnessSettings, "enabledHarnesses">): HarnessRow[];
71
+ export declare function buildHarnessRows(harnesses: HarnessInfo[], s: Pick<HarnessSettings, "enabledHarnesses">, detections?: readonly HarnessDetection[]): HarnessRow[];
67
72
  /** What {@link validateHarnessSettingsPatch} hands back for a valid body. */
68
73
  export type HarnessSettingsPatch = {
69
74
  /**
@@ -21,13 +21,14 @@ export function resolveLockFlags(stored) {
21
21
  export function enabledHarnessIds(s) {
22
22
  return s.enabledHarnesses?.length ? s.enabledHarnesses : [...DEFAULT_ENABLED_HARNESSES];
23
23
  }
24
- export function buildHarnessRows(harnesses, s) {
24
+ export function buildHarnessRows(harnesses, s, detections = []) {
25
25
  const enabled = new Set(enabledHarnessIds(s));
26
26
  return harnesses.map((info) => ({
27
27
  ...info,
28
28
  label: HARNESS_LABELS[info.id] ?? info.name,
29
29
  experimental: isExperimentalHarness(info.id),
30
- enabled: enabled.has(info.id)
30
+ enabled: enabled.has(info.id),
31
+ detection: detections.find((d) => d.id === info.id) ?? { id: info.id, status: "unknown" }
31
32
  }));
32
33
  }
33
34
  const isObject = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skaile/forge-settings",
3
- "version": "1.0.1",
3
+ "version": "1.1.0",
4
4
  "description": "Provider and settings operations for Skaile forge apps: provider registry layers, credential store, env layers, model discovery, the providers panel, and editor / AI SDK model adapters.",
5
5
  "type": "module",
6
6
  "packageManager": "bun@1.3.9",
@@ -55,7 +55,7 @@
55
55
  },
56
56
  "dependencies": {
57
57
  "@nuxt/kit": "^4.0.0",
58
- "@skaile/workspaces": "^6.10.0",
58
+ "@skaile/workspaces": "^6.14.0",
59
59
  "ofetch": "^1.4.0",
60
60
  "yaml": "^2.9.0"
61
61
  },
@@ -20,6 +20,7 @@
20
20
  * Pure functions over plain values: no Node built-ins, no environment, no file access.
21
21
  */
22
22
 
23
+ import type { HarnessDetection } from "@skaile/workspaces/sdk/bridge";
23
24
  import type { HarnessInfo } from "@skaile/workspaces/types";
24
25
  import {
25
26
  DEFAULT_ENABLED_HARNESSES,
@@ -96,6 +97,8 @@ export type HarnessRow = HarnessInfo & {
96
97
  experimental: boolean;
97
98
  /** Whether the instance's `enabledHarnesses` offers it. */
98
99
  enabled: boolean;
100
+ /** What `detectHarnesses()` found on this host: installed, version, login. */
101
+ detection: HarnessDetection;
99
102
  };
100
103
 
101
104
  /**
@@ -103,10 +106,13 @@ export type HarnessRow = HarnessInfo & {
103
106
  * filter to `enabled` unless the request asked for all (`?all=1`).
104
107
  * `surfaces` and `providerPlurality` ride along from {@link HarnessInfo} so the
105
108
  * Harness tab can offer each harness only the providers it can use.
109
+ * `detections` is the host's `detectHarnesses()` answer; a harness it does not
110
+ * mention (or every harness, when it is omitted) reports `{ status: "unknown" }`.
106
111
  */
107
112
  export function buildHarnessRows(
108
113
  harnesses: HarnessInfo[],
109
114
  s: Pick<HarnessSettings, "enabledHarnesses">,
115
+ detections: readonly HarnessDetection[] = [],
110
116
  ): HarnessRow[] {
111
117
  const enabled = new Set(enabledHarnessIds(s));
112
118
  return harnesses.map((info) => ({
@@ -114,6 +120,7 @@ export function buildHarnessRows(
114
120
  label: HARNESS_LABELS[info.id] ?? info.name,
115
121
  experimental: isExperimentalHarness(info.id),
116
122
  enabled: enabled.has(info.id),
123
+ detection: detections.find((d) => d.id === info.id) ?? { id: info.id, status: "unknown" },
117
124
  }));
118
125
  }
119
126