@ikenga/contract 0.6.0 → 0.9.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.
Files changed (74) hide show
  1. package/README.md +56 -11
  2. package/dist/canvas/Canvas.d.ts +7 -0
  3. package/dist/canvas/Canvas.d.ts.map +1 -0
  4. package/dist/canvas/Canvas.js +115 -0
  5. package/dist/canvas/Canvas.js.map +1 -0
  6. package/dist/canvas/canvas.css +579 -0
  7. package/dist/canvas/index.d.ts +7 -0
  8. package/dist/canvas/index.d.ts.map +1 -0
  9. package/dist/canvas/index.js +4 -0
  10. package/dist/canvas/index.js.map +1 -0
  11. package/dist/canvas/types.d.ts +45 -0
  12. package/dist/canvas/types.d.ts.map +1 -0
  13. package/dist/canvas/types.js +2 -0
  14. package/dist/canvas/types.js.map +1 -0
  15. package/dist/canvas/use-drag-snap.d.ts +33 -0
  16. package/dist/canvas/use-drag-snap.d.ts.map +1 -0
  17. package/dist/canvas/use-drag-snap.js +73 -0
  18. package/dist/canvas/use-drag-snap.js.map +1 -0
  19. package/dist/canvas/use-pan-zoom.d.ts +32 -0
  20. package/dist/canvas/use-pan-zoom.d.ts.map +1 -0
  21. package/dist/canvas/use-pan-zoom.js +161 -0
  22. package/dist/canvas/use-pan-zoom.js.map +1 -0
  23. package/dist/engine/index.d.ts +2 -0
  24. package/dist/engine/index.d.ts.map +1 -1
  25. package/dist/engine/index.js +2 -0
  26. package/dist/engine/index.js.map +1 -1
  27. package/dist/engine/portability.d.ts +113 -0
  28. package/dist/engine/portability.d.ts.map +1 -0
  29. package/dist/engine/portability.js +17 -0
  30. package/dist/engine/portability.js.map +1 -0
  31. package/dist/engine/subagent-transcoder.d.ts +24 -0
  32. package/dist/engine/subagent-transcoder.d.ts.map +1 -0
  33. package/dist/engine/subagent-transcoder.js +341 -0
  34. package/dist/engine/subagent-transcoder.js.map +1 -0
  35. package/dist/engine.d.ts +574 -0
  36. package/dist/engine.d.ts.map +1 -0
  37. package/dist/engine.js +85 -0
  38. package/dist/engine.js.map +1 -0
  39. package/dist/host-verbs.d.ts +194 -0
  40. package/dist/host-verbs.d.ts.map +1 -0
  41. package/dist/host-verbs.js +15 -0
  42. package/dist/host-verbs.js.map +1 -0
  43. package/dist/index.d.ts +1 -0
  44. package/dist/index.d.ts.map +1 -1
  45. package/dist/index.js +1 -0
  46. package/dist/index.js.map +1 -1
  47. package/dist/manifest.d.ts +376 -19
  48. package/dist/manifest.d.ts.map +1 -1
  49. package/dist/manifest.js +95 -4
  50. package/dist/manifest.js.map +1 -1
  51. package/dist/registry.d.ts +364 -36
  52. package/dist/registry.d.ts.map +1 -1
  53. package/dist/registry.js +9 -0
  54. package/dist/registry.js.map +1 -1
  55. package/dist/scopes.js +1 -1
  56. package/dist/scopes.js.map +1 -1
  57. package/package.json +36 -10
  58. package/schemas/registry/index-v1.json +11 -0
  59. package/src/canvas/Canvas.tsx +161 -0
  60. package/src/canvas/canvas.css +579 -0
  61. package/src/canvas/index.ts +14 -0
  62. package/src/canvas/types.ts +48 -0
  63. package/src/canvas/use-drag-snap.ts +107 -0
  64. package/src/canvas/use-pan-zoom.ts +211 -0
  65. package/src/engine/index.ts +2 -0
  66. package/src/engine/portability.ts +123 -0
  67. package/src/engine/subagent-transcoder.test.ts +306 -0
  68. package/src/engine/subagent-transcoder.ts +333 -0
  69. package/src/host-verbs.ts +207 -0
  70. package/src/index.ts +1 -0
  71. package/src/manifest.test.ts +97 -0
  72. package/src/manifest.ts +109 -4
  73. package/src/registry.ts +9 -0
  74. package/src/scopes.ts +1 -1
@@ -0,0 +1,107 @@
1
+ // Scale-aware grid-snap drag for the <Canvas> primitive.
2
+ //
3
+ // Owns the in-flight drag gesture (which item, where it started) and the
4
+ // pointer math that moves it: cursor delta is divided by the current viewport
5
+ // scale (so a 10px screen move at scale 0.5 becomes a 20px canvas move, and at
6
+ // scale 2.0 a 5px canvas move), then snapped to the `gridSnap` lattice.
7
+ //
8
+ // nx = round((startPos.x + dx / scale) / gridSnap) * gridSnap
9
+ //
10
+ // Does NOT own `layout` — it reads the current placement to seed the gesture
11
+ // and emits the moved layout through `onLayoutChange`. The parent stays the
12
+ // source of truth.
13
+ //
14
+ // Extracted verbatim (behavior-preserving) from shell home.tsx's canvas block.
15
+
16
+ import { useCallback, useEffect, useRef } from 'react';
17
+ import type { ItemId, Placement } from './types.js';
18
+
19
+ export interface DragState {
20
+ id: ItemId;
21
+ startMouse: { x: number; y: number };
22
+ startPos: { x: number; y: number };
23
+ }
24
+
25
+ export interface UseDragSnapArgs {
26
+ /** Controlled layout (id → placement). Read at gesture start; never mutated. */
27
+ layout: Record<ItemId, Placement>;
28
+ /** Snap lattice in canvas units. Home passes 12, studio passes 24. */
29
+ gridSnap: number;
30
+ /** Current viewport scale — drag delta is divided by this. */
31
+ scale: number;
32
+ /** Emits the moved layout so the parent can persist / re-render. */
33
+ onLayoutChange?: (layout: Record<ItemId, Placement>) => void;
34
+ /** Stage element whose `.is-dragging` class suppresses the pan transition. */
35
+ stageRef: React.RefObject<HTMLDivElement | null>;
36
+ }
37
+
38
+ export interface UseDragSnap {
39
+ dragState: React.MutableRefObject<DragState | null>;
40
+ /** Begin dragging `id` from a mousedown at screen (clientX, clientY). */
41
+ beginDrag: (id: ItemId, clientX: number, clientY: number) => void;
42
+ /** Is an item drag in flight? */
43
+ isDragging: () => boolean;
44
+ }
45
+
46
+ export function useDragSnap(args: UseDragSnapArgs): UseDragSnap {
47
+ const { layout, gridSnap, scale, onLayoutChange, stageRef } = args;
48
+ const dragState = useRef<DragState | null>(null);
49
+
50
+ // Keep the freshest layout/scale/snap reachable from the global listener
51
+ // without re-subscribing it on every render.
52
+ const layoutRef = useRef(layout);
53
+ layoutRef.current = layout;
54
+ const scaleRef = useRef(scale);
55
+ scaleRef.current = scale;
56
+ const gridSnapRef = useRef(gridSnap);
57
+ gridSnapRef.current = gridSnap;
58
+ const onLayoutChangeRef = useRef(onLayoutChange);
59
+ onLayoutChangeRef.current = onLayoutChange;
60
+
61
+ const beginDrag = useCallback(
62
+ (id: ItemId, clientX: number, clientY: number) => {
63
+ const w = layoutRef.current[id];
64
+ if (!w) return;
65
+ dragState.current = {
66
+ id,
67
+ startMouse: { x: clientX, y: clientY },
68
+ startPos: { x: w.x, y: w.y },
69
+ };
70
+ stageRef.current?.classList.add('is-dragging');
71
+ },
72
+ [stageRef]
73
+ );
74
+
75
+ const isDragging = useCallback(() => dragState.current != null, []);
76
+
77
+ useEffect(() => {
78
+ const onMove = (e: MouseEvent) => {
79
+ if (!dragState.current) return;
80
+ const s = scaleRef.current || 1;
81
+ const snap = gridSnapRef.current;
82
+ const dx = e.clientX - dragState.current.startMouse.x;
83
+ const dy = e.clientY - dragState.current.startMouse.y;
84
+ const nx = Math.round((dragState.current.startPos.x + dx / s) / snap) * snap;
85
+ const ny = Math.round((dragState.current.startPos.y + dy / s) / snap) * snap;
86
+ const id = dragState.current.id;
87
+ const cur = layoutRef.current;
88
+ const prev = cur[id];
89
+ if (!prev || (prev.x === nx && prev.y === ny)) return;
90
+ onLayoutChangeRef.current?.({ ...cur, [id]: { ...prev, x: nx, y: ny } });
91
+ };
92
+ const onUp = () => {
93
+ if (dragState.current) {
94
+ dragState.current = null;
95
+ stageRef.current?.classList.remove('is-dragging');
96
+ }
97
+ };
98
+ window.addEventListener('mousemove', onMove);
99
+ window.addEventListener('mouseup', onUp);
100
+ return () => {
101
+ window.removeEventListener('mousemove', onMove);
102
+ window.removeEventListener('mouseup', onUp);
103
+ };
104
+ }, [stageRef]);
105
+
106
+ return { dragState, beginDrag, isDragging };
107
+ }
@@ -0,0 +1,211 @@
1
+ // Pan / zoom / auto-fit for the <Canvas> primitive.
2
+ //
3
+ // Owns the viewport pan offset + scale, the imperative auto-fit math, the
4
+ // pan gesture (Space-drag / middle-mouse / empty-canvas drag), and the
5
+ // Space/Escape keyboard affordances + window-resize re-fit. It deliberately
6
+ // does NOT own `layout`, `selectedId`, or `editMode` — those stay parent-held
7
+ // and are threaded in as values so the auto-fit closure can read them.
8
+ //
9
+ // Extracted verbatim (behavior-preserving) from shell home.tsx's canvas block.
10
+
11
+ import { useCallback, useEffect, useRef, useState } from 'react';
12
+ import type { ItemId, Placement, Viewport } from './types.js';
13
+
14
+ export interface UsePanZoomArgs {
15
+ /** Controlled layout (id → placement) the auto-fit bounding box reads. */
16
+ layout: Record<ItemId, Placement>;
17
+ /** Controlled edit-mode flag — auto-fit reserves palette width when true. */
18
+ editMode: boolean;
19
+ /** Re-fit on window resize. Default true. */
20
+ autoFitOnResize?: boolean;
21
+ /** Notified whenever the viewport pan/scale changes (controlled mirror). */
22
+ onViewportChange?: (viewport: Viewport) => void;
23
+ /** Escape exits edit mode → parent owns the state flip. */
24
+ onEditModeChange?: (editMode: boolean) => void;
25
+ /** Escape clears selection. */
26
+ onSelectionChange?: (selectedId: ItemId | null) => void;
27
+ }
28
+
29
+ export interface UsePanZoom {
30
+ /** Live viewport (x/y/scale). Mirrors `pan` in the original home code. */
31
+ pan: Viewport;
32
+ setPan: React.Dispatch<React.SetStateAction<Viewport>>;
33
+ /** Imperative re-fit. `animate=false` snaps without the transition. */
34
+ autoFit: (animate?: boolean) => void;
35
+ canvasRef: React.RefObject<HTMLDivElement | null>;
36
+ stageRef: React.RefObject<HTMLDivElement | null>;
37
+ /** True while Space is held — drag/pan branch reads this. */
38
+ spaceDown: React.MutableRefObject<boolean>;
39
+ /** Begin a pan gesture from a mousedown at screen (clientX, clientY). */
40
+ beginPan: (clientX: number, clientY: number) => void;
41
+ /** Is a pan gesture in flight? */
42
+ isPanning: () => boolean;
43
+ }
44
+
45
+ const RESERVED_PALETTE_WIDTH = 320;
46
+
47
+ export function usePanZoom(args: UsePanZoomArgs): UsePanZoom {
48
+ const {
49
+ layout,
50
+ editMode,
51
+ autoFitOnResize = true,
52
+ onViewportChange,
53
+ onEditModeChange,
54
+ onSelectionChange,
55
+ } = args;
56
+
57
+ const [pan, setPan] = useState<Viewport>({ x: 0, y: 0, scale: 1 });
58
+
59
+ const canvasRef = useRef<HTMLDivElement>(null);
60
+ const stageRef = useRef<HTMLDivElement>(null);
61
+ const spaceDown = useRef(false);
62
+ const panStart = useRef<{ x: number; y: number } | null>(null);
63
+ // Latest pan reachable synchronously (for beginPan's offset seed) without
64
+ // adding `pan` to the gesture callbacks' deps.
65
+ const panRef = useRef(pan);
66
+ panRef.current = pan;
67
+
68
+ // Mirror viewport changes to the controlled parent in an effect (never
69
+ // inside a setState updater — that would setState-during-render the parent
70
+ // and trip React's "Cannot update a component while rendering a different
71
+ // component" warning). The ref skips the initial mount so the parent isn't
72
+ // notified of the default {0,0,1} before any real fit.
73
+ const viewportCbRef = useRef(onViewportChange);
74
+ viewportCbRef.current = onViewportChange;
75
+ const mountedViewport = useRef(false);
76
+ useEffect(() => {
77
+ if (!mountedViewport.current) {
78
+ mountedViewport.current = true;
79
+ return;
80
+ }
81
+ viewportCbRef.current?.(pan);
82
+ }, [pan]);
83
+
84
+ // Auto-fit: scale the bounding box of all items into the visible area,
85
+ // scaling down only (never up). Reserves the palette gutter in edit mode.
86
+ // Threads `layout` + `editMode` as deps so the closure never goes stale.
87
+ const autoFit = useCallback(
88
+ (animate = true) => {
89
+ const canvas = canvasRef.current;
90
+ const items = Object.values(layout);
91
+ if (!canvas || !items.length) return;
92
+ let minX = Infinity,
93
+ minY = Infinity,
94
+ maxX = -Infinity,
95
+ maxY = -Infinity;
96
+ for (const w of items) {
97
+ if (w.x < minX) minX = w.x;
98
+ if (w.y < minY) minY = w.y;
99
+ if (w.x + w.w > maxX) maxX = w.x + w.w;
100
+ if (w.y + w.h > maxY) maxY = w.y + w.h;
101
+ }
102
+ const cw = canvas.clientWidth - (editMode ? RESERVED_PALETTE_WIDTH : 0) - 40;
103
+ const ch = canvas.clientHeight - 44 - 32;
104
+ const bw = maxX - minX;
105
+ const bh = maxY - minY;
106
+ const sx = bw > 0 ? cw / bw : 1;
107
+ const sy = bh > 0 ? ch / bh : 1;
108
+ const scale = Math.min(1, sx, sy);
109
+ const offX = Math.round((cw + 40 - bw * scale) / 2 - minX * scale);
110
+ const offY = Math.round((ch + 32 - bh * scale) / 2 - minY * scale + 22);
111
+ setPan({ x: offX, y: offY, scale });
112
+ if (stageRef.current) stageRef.current.classList.toggle('is-dragging', !animate);
113
+ },
114
+ [layout, editMode, setPan]
115
+ );
116
+
117
+ // Initial fit + window-resize re-fit. Empty dep array on purpose — autoFit
118
+ // is read through the ref-stable callback, matching the original effect.
119
+ useEffect(() => {
120
+ requestAnimationFrame(() => autoFit(false));
121
+ if (!autoFitOnResize) return;
122
+ const onResize = () => autoFit(true);
123
+ window.addEventListener('resize', onResize);
124
+ return () => window.removeEventListener('resize', onResize);
125
+ // eslint-disable-next-line react-hooks/exhaustive-deps
126
+ }, []);
127
+
128
+ // Re-fit whenever edit mode toggles (palette gutter changes the fit box).
129
+ useEffect(() => {
130
+ autoFit(true);
131
+ }, [editMode, autoFit]);
132
+
133
+ // Keyboard — Escape exits edit, Space arms the pan-grab cursor.
134
+ useEffect(() => {
135
+ const down = (e: KeyboardEvent) => {
136
+ if (e.key === 'Escape' && editMode) {
137
+ onEditModeChange?.(false);
138
+ onSelectionChange?.(null);
139
+ }
140
+ if (
141
+ e.code === 'Space' &&
142
+ !e.repeat &&
143
+ document.activeElement === document.body &&
144
+ canvasRef.current
145
+ ) {
146
+ spaceDown.current = true;
147
+ canvasRef.current.style.cursor = 'grab';
148
+ e.preventDefault();
149
+ }
150
+ };
151
+ const up = (e: KeyboardEvent) => {
152
+ if (e.code === 'Space') {
153
+ spaceDown.current = false;
154
+ if (canvasRef.current) canvasRef.current.style.cursor = '';
155
+ }
156
+ };
157
+ window.addEventListener('keydown', down);
158
+ window.addEventListener('keyup', up);
159
+ return () => {
160
+ window.removeEventListener('keydown', down);
161
+ window.removeEventListener('keyup', up);
162
+ };
163
+ }, [editMode, onEditModeChange, onSelectionChange]);
164
+
165
+ const beginPan = useCallback((clientX: number, clientY: number) => {
166
+ const p = panRef.current;
167
+ panStart.current = { x: clientX - p.x, y: clientY - p.y };
168
+ stageRef.current?.classList.add('is-dragging');
169
+ if (canvasRef.current) canvasRef.current.style.cursor = 'grabbing';
170
+ }, []);
171
+
172
+ const isPanning = useCallback(() => panStart.current != null, []);
173
+
174
+ // Global pan move/up. Drag (item) move/up lives in use-drag-snap so this
175
+ // effect only owns the pan branch + its own cleanup.
176
+ useEffect(() => {
177
+ const onMove = (e: MouseEvent) => {
178
+ if (panStart.current) {
179
+ setPan((p) => ({
180
+ ...p,
181
+ x: e.clientX - panStart.current!.x,
182
+ y: e.clientY - panStart.current!.y,
183
+ }));
184
+ }
185
+ };
186
+ const onUp = () => {
187
+ if (panStart.current) {
188
+ panStart.current = null;
189
+ stageRef.current?.classList.remove('is-dragging');
190
+ if (canvasRef.current) canvasRef.current.style.cursor = spaceDown.current ? 'grab' : '';
191
+ }
192
+ };
193
+ window.addEventListener('mousemove', onMove);
194
+ window.addEventListener('mouseup', onUp);
195
+ return () => {
196
+ window.removeEventListener('mousemove', onMove);
197
+ window.removeEventListener('mouseup', onUp);
198
+ };
199
+ }, [setPan]);
200
+
201
+ return {
202
+ pan,
203
+ setPan,
204
+ autoFit,
205
+ canvasRef,
206
+ stageRef,
207
+ spaceDown,
208
+ beginPan,
209
+ isPanning,
210
+ };
211
+ }
@@ -10,3 +10,5 @@
10
10
  export * from './adapter.js';
11
11
  export * from './acp.js';
12
12
  export * from './errors.js';
13
+ export * from './portability.js';
14
+ export * from './subagent-transcoder.js';
@@ -0,0 +1,123 @@
1
+ /**
2
+ * Portability surface for engine pkgs — ADR-012.
3
+ *
4
+ * Engine pkgs implement this in parallel to the runtime adapter
5
+ * (`AcpEngine` in `./acp.ts`). The kernel's `engine_assets` registry calls
6
+ * these methods at pkg install / uninstall time, fanning the operation out
7
+ * to every installed `EngineAdapter` so a user's pkg investment (skills,
8
+ * commands, agents, MCP servers) survives an engine swap.
9
+ *
10
+ * No manifest schema changes — pkgs continue to declare `skills`,
11
+ * `commands`, `agents` as folder paths and `mcp[]` as inline entries.
12
+ * This file is a runtime interface; it has no Zod schema and no
13
+ * compile-time dependency on the manifest schema beyond reusing
14
+ * `McpServer` for the spec passed to `registerMcpServer`.
15
+ */
16
+
17
+ import type { McpServer } from '../manifest.js';
18
+
19
+ /**
20
+ * Result of an install / register operation. Per ADR §2 the kernel's pkg
21
+ * manager UI surfaces these so the user can see exactly what each engine
22
+ * adapter wrote.
23
+ */
24
+ export interface InstallReport {
25
+ /** Absolute paths the adapter wrote or symlinked. */
26
+ wrote: string[];
27
+ /** Targets that were already correct — idempotent no-op. */
28
+ skipped: string[];
29
+ /** Non-fatal notes (e.g. "commands not supported on Codex; skipped"). */
30
+ warnings: string[];
31
+ }
32
+
33
+ /**
34
+ * Dry-run output for `EngineAdapter.plan()`. Shape mirrors `InstallReport`
35
+ * plus the `(engineId, pkgId)` tuple so the pkg manager UI can render a
36
+ * per-engine breakdown ("this pkg will install assets into 3 engines").
37
+ */
38
+ export interface InstallPlan extends InstallReport {
39
+ /** Engine the plan was computed against — matches `EngineAdapter.id`. */
40
+ engineId: string;
41
+ /** Pkg the plan was computed for — matches the manifest `id` field. */
42
+ pkgId: string;
43
+ }
44
+
45
+ /**
46
+ * Minimal pkg manifest slice the adapter needs to compute a plan. Carved
47
+ * narrow on purpose: `plan()` runs before install, so it shouldn't load
48
+ * disk content the adapter wouldn't otherwise touch. Folder paths are
49
+ * relative to the pkg root (same convention as the on-disk manifest).
50
+ */
51
+ export interface ManifestSnapshot {
52
+ /** Pkg id (e.g. `com.ikenga.studio`). */
53
+ id: string;
54
+ /** Pkg slug used to namespace materialized dirs (id with `.` → `-`). */
55
+ slug: string;
56
+ /** Relative folder for `skills/<name>/SKILL.md` files, if any. */
57
+ skills?: string;
58
+ /** Relative folder for `commands/<name>.md` files, if any. */
59
+ commands?: string;
60
+ /** Relative folder for `agents/<name>.md` files, if any. */
61
+ agents?: string;
62
+ /** Inline MCP server specs from the manifest's `mcp[]` block. */
63
+ mcp: McpServer[];
64
+ }
65
+
66
+ /**
67
+ * Portability adapter exported by every engine pkg alongside its runtime
68
+ * `AcpEngine`. The kernel resolves both at load time (ADR §2).
69
+ *
70
+ * Folder-level methods. Each `install*` call is the adapter's chance to
71
+ * symlink, copy, or walk-and-transcode the whole folder — the choice
72
+ * depends on what the engine accepts natively. Idempotent by contract:
73
+ * re-running with unchanged inputs is a no-op.
74
+ *
75
+ * `registerMcpServer` writes a single entry into the engine's external
76
+ * settings file (`~/.claude/settings.json`, `~/.gemini/settings.json`,
77
+ * `~/.codex/config.toml`). Entries are keyed `ikenga.<pkg-slug>.<name>`
78
+ * per ADR §7 so they never collide with user-authored entries.
79
+ *
80
+ * Inverses tear down only what this pkg owned — user content in the same
81
+ * dir / settings file is left untouched.
82
+ */
83
+ export interface EngineAdapter {
84
+ /** Engine identifier — matches `engine.agentId` in the pkg manifest. */
85
+ readonly id: string;
86
+
87
+ /**
88
+ * Materialize the pkg's skills folder into the engine's recognized
89
+ * location. Idempotent.
90
+ */
91
+ installSkills(folder: string, pkgId: string, pkgSlug: string): Promise<InstallReport>;
92
+
93
+ /**
94
+ * Materialize the pkg's commands folder. Engines without a first-class
95
+ * commands primitive (Codex) may emit warnings and skip per-file
96
+ * instead of erroring — see ADR §5.
97
+ */
98
+ installCommands(folder: string, pkgId: string, pkgSlug: string): Promise<InstallReport>;
99
+
100
+ /** Materialize the pkg's agents folder. Codex transcodes MD→TOML. */
101
+ installAgents(folder: string, pkgId: string, pkgSlug: string): Promise<InstallReport>;
102
+
103
+ /**
104
+ * Register one MCP server in the engine's external settings file.
105
+ * Idempotent on the `(pkgSlug, server name)` key.
106
+ */
107
+ registerMcpServer(spec: McpServer, pkgId: string, pkgSlug: string): Promise<InstallReport>;
108
+
109
+ /** Inverse of `installSkills`. Removes only entries this pkg owned. */
110
+ uninstallSkills(pkgId: string, pkgSlug: string): Promise<void>;
111
+ /** Inverse of `installCommands`. */
112
+ uninstallCommands(pkgId: string, pkgSlug: string): Promise<void>;
113
+ /** Inverse of `installAgents`. */
114
+ uninstallAgents(pkgId: string, pkgSlug: string): Promise<void>;
115
+ /** Inverse of `registerMcpServer`. */
116
+ unregisterMcpServer(serverName: string, pkgId: string, pkgSlug: string): Promise<void>;
117
+
118
+ /**
119
+ * Dry-run used by the pkg manager UI. Returns the same shape as a real
120
+ * install would produce, without touching the filesystem.
121
+ */
122
+ plan(pkgId: string, pkgSlug: string, manifestSnapshot: ManifestSnapshot): Promise<InstallPlan>;
123
+ }