@suluk/cockpit 0.1.16 → 0.1.17

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@suluk/cockpit",
3
- "version": "0.1.16",
3
+ "version": "0.1.17",
4
4
  "description": "The pure cockpit core (cycle model · builder model · codegen · deploy planning · validate/audit/preview) shared by the vscode extension and the /superadmin web admin panel. CANDIDATE tooling.",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -19,7 +19,7 @@
19
19
  ".": "./src/index.ts"
20
20
  },
21
21
  "dependencies": {
22
- "@suluk/core": "^0.1.7",
22
+ "@suluk/core": "^0.1.9",
23
23
  "@suluk/hono": "^0.1.2",
24
24
  "@suluk/scalar": "^0.1.2",
25
25
  "@suluk/swagger": "^0.1.2",
@@ -28,7 +28,7 @@
28
28
  "@suluk/deploy": "^0.1.3",
29
29
  "@suluk/cost": "^0.1.2",
30
30
  "@suluk/visual": "^0.1.3",
31
- "@suluk/agents": "^0.1.0"
31
+ "@suluk/agents": "^0.1.1"
32
32
  },
33
33
  "devDependencies": {
34
34
  "@types/bun": "latest"
package/src/agents.ts CHANGED
@@ -50,7 +50,7 @@ export interface AgentNodeView {
50
50
  context: AgentContextLoad;
51
51
  /** per-skill model pick (C027 × @suluk/models) — present only when agentsView is given a catalog. OBSERVE-only:
52
52
  * "why this model" (declared vs selected, top ids, deciding preference, UNKNOWN-coverage gaps). Never executes. */
53
- modelSelection?: { skill: string; from: "declared" | "selected"; ids: string[]; decidingPreference?: string; coverageGaps?: string[] }[];
53
+ modelSelection?: { skill: string; from?: "declared" | "selected"; ids?: string[]; resolve?: "pinned" | "router" | "latest"; pickPinned?: boolean; decidingPreference?: string; coverageGaps?: string[]; error?: string }[];
54
54
  }
55
55
  /** The agent-declared vs operator-effective diff + the cost three-number (cap / estimate / actual). Read-only. */
56
56
  export interface AgentGovernedView {
@@ -163,12 +163,14 @@ export function agentsView(doc: OpenAPIv4Document, opts: { catalog?: ModelCatalo
163
163
  ...(opts.catalog ? {
164
164
  modelSelection: Object.keys(a.skills ?? {}).sort().map((sk) => {
165
165
  const minWin = cr.loads.find((l) => l.agent === name)?.minWindowRequired;
166
- const r = skillModels(doc, name, sk, opts.catalog!, minWin);
167
- return {
168
- skill: sk, from: r.from, ids: r.ids.slice(0, 3),
169
- ...(r.selection?.ranked[0] ? { decidingPreference: r.selection.ranked[0].why.decidingPreference } : {}),
170
- ...(r.selection ? { coverageGaps: r.selection.coverageGaps } : {}),
171
- };
166
+ try {
167
+ const r = skillModels(doc, name, sk, opts.catalog!, minWin);
168
+ return {
169
+ skill: sk, from: r.from, ids: r.ids.slice(0, 3), resolve: r.target.kind, pickPinned: r.pickPinned,
170
+ ...(r.selection?.ranked[0] ? { decidingPreference: r.selection.ranked[0].why.decidingPreference } : {}),
171
+ ...(r.selection ? { coverageGaps: r.selection.coverageGaps } : {}),
172
+ };
173
+ } catch (e) { return { skill: sk, error: e instanceof Error ? e.message : String(e) }; } // governed + router ⇒ fail-loud, surfaced
172
174
  }),
173
175
  } : {}),
174
176
  };
@@ -108,7 +108,9 @@ describe("C027 cockpit agents view (OBSERVE)", () => {
108
108
  d["x-suluk-agents"]!.conin.skills!.operate = { modelProfile: "cheap-fast" };
109
109
  const sel = agentsView(d, { catalog: SEED_CATALOG }).agents.find((a) => a.name === "conin")!.modelSelection!.find((m) => m.skill === "operate")!;
110
110
  expect(sel.from).toBe("selected");
111
- expect(sel.ids.length).toBeGreaterThan(0);
111
+ expect(sel.ids!.length).toBeGreaterThan(0);
112
+ expect(sel.resolve).toBe("pinned"); // C030 default, ungoverned
113
+ expect(sel.pickPinned).toBe(true);
112
114
  expect(sel.decidingPreference).toBeTruthy();
113
115
  });
114
116