@opencode-compat/cli 0.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/README.md ADDED
@@ -0,0 +1,22 @@
1
+ # @opencode-compat/cli
2
+
3
+ OCP compat doctor, Plugin×Host×Tier matrix runner, Layer A `setup` / `overrides`, and `migrate-zcode` companion CLI.
4
+
5
+ ```text
6
+ compat doctor [--host opencode|mimo|kilo|zcode]
7
+ compat setup [--dir <path>] [--host <id>] [--mode auto|npm|file] [--dry-run]
8
+ [--deep|--no-deep] [--reify|--no-reify]
9
+ compat overrides
10
+ compat matrix [...]
11
+ compat migrate-zcode --plugin <dir> [--out <dir>] [--dry-run]
12
+ ```
13
+
14
+ `setup` defaults to **deep** child `package.json` patches and **auto-reify** (`npm install`) when a patched tree already has `node_modules` — required on MiMo/Kilo isolated per-plugin install dirs. Re-run after installing or upgrading consumer plugins.
15
+
16
+ User-facing entry is **`ocp`** from `@opencode-compat/ocp` (defaults to `setup`). This package remains the bridge CLI implementation.
17
+
18
+ `migrate-zcode` packs **plugin-packaged** skills/commands/manifests into a `.zcode-plugin` tree. It is **not** OCP ABI compatibility (ZCode stays T0) and does **not** migrate host MCP.
19
+
20
+ **License:** MPL-2.0
21
+
22
+ See the monorepo [README](../../README.md), [OCP 0.1](../../docs/ocp/0.1.md), and [migrator plan](../../docs/plans/zcode-asset-migrator-plan.md).
package/bin/compat.ts ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bun
2
+ /**
3
+ * Published entry uses dist/ (src/ is not in the npm tarball).
4
+ * From a checkout: run `bun run build` first, or `bun packages/cli/src/…` via tests.
5
+ */
6
+ import { mainAsync } from "../dist/index.js"
7
+
8
+ process.exit(await mainAsync())
@@ -0,0 +1,66 @@
1
+ /**
2
+ * @opencode-compat/cli — `compat doctor` + matrix + setup + migrate-zcode companion.
3
+ */
4
+ export declare const PKG: "@opencode-compat/cli";
5
+ export declare const VERSION: "0.1.0";
6
+ import { type MigrateMarketplaceReport, type MigrateReport } from "@opencode-compat/migrate-zcode";
7
+ import { type DetectOptions, type HostId } from "@opencode-compat/profile";
8
+ export { parseSetupArgs, setup, type SetupOptions, type SetupResult } from "./setup";
9
+ export type DoctorResult = {
10
+ ok: boolean;
11
+ message: string;
12
+ host?: string;
13
+ source?: string;
14
+ };
15
+ /** Run OCP compat doctor against the current (or injected) environment. */
16
+ export declare function doctor(options?: DetectOptions): DoctorResult;
17
+ export type MatrixCliOptions = {
18
+ hosts?: HostId[];
19
+ fixtureIds?: string[];
20
+ /** When true, exercise mimo/kilo compatProjectDirs expectations (operator/docs path). */
21
+ compatScan?: boolean;
22
+ };
23
+ export type MatrixCell = {
24
+ id: string;
25
+ tier: string;
26
+ host: HostId;
27
+ status: "pass" | "fail" | "skip";
28
+ message: string;
29
+ detail?: string;
30
+ };
31
+ type FixturesApi = {
32
+ runMatrix: (options?: {
33
+ hosts?: HostId[];
34
+ fixtureIds?: string[];
35
+ compatScanEnabled?: boolean | Partial<Record<HostId, boolean>>;
36
+ }) => Promise<MatrixCell[]>;
37
+ formatMatrix: (results: MatrixCell[]) => string;
38
+ matrixOk: (results: MatrixCell[]) => boolean;
39
+ };
40
+ /** Resolve monorepo fixtures (CLI matrix is a checkout-rooted command). */
41
+ export declare function loadFixtures(): Promise<FixturesApi>;
42
+ /** Run Plugin×Host×Tier matrix via fixtures/ (OCP §10). */
43
+ export declare function matrix(options?: MatrixCliOptions): Promise<MatrixCell[]>;
44
+ export declare function runSetupCli(rest: string[]): Promise<number>;
45
+ export type MigrateZcodeCliOptions = {
46
+ plugins: string[];
47
+ out?: string;
48
+ name?: string;
49
+ version?: string;
50
+ marketplaceName?: string;
51
+ marketplaceDescription?: string;
52
+ ownerName?: string;
53
+ ownerUrl?: string;
54
+ dryRun: boolean;
55
+ allowEmpty: boolean;
56
+ format: "text" | "json";
57
+ help: boolean;
58
+ };
59
+ export declare function parseMigrateZcodeArgs(rest: string[]): MigrateZcodeCliOptions;
60
+ /** Exit: 0 ok, 1 error/collision, 2 empty without allowEmpty. */
61
+ export declare function migrateZcodeExitCode(report: MigrateReport | MigrateMarketplaceReport): number;
62
+ export declare function runMigrateZcodeCli(rest: string[]): Promise<number>;
63
+ export declare function mainAsync(argv?: string[]): Promise<number>;
64
+ /** Sync entry for doctor / overrides / setup / help (used by unit tests). */
65
+ export declare function main(argv?: string[]): number;
66
+ //# sourceMappingURL=index.d.ts.map
package/dist/index.js ADDED
@@ -0,0 +1,450 @@
1
+ /**
2
+ * @opencode-compat/cli — `compat doctor` + matrix + setup + migrate-zcode companion.
3
+ */
4
+ export const PKG = "@opencode-compat/cli";
5
+ export const VERSION = "0.1.0";
6
+ import { doctorReport } from "@opencode-compat/adapter";
7
+ import { migrateZcode, migrateZcodeMarketplace, } from "@opencode-compat/migrate-zcode";
8
+ import { facadeOverrideSnippet, } from "@opencode-compat/profile";
9
+ import { resolve } from "node:path";
10
+ import { parseSetupArgs, setup, } from "./setup";
11
+ export { parseSetupArgs, setup } from "./setup";
12
+ /** Run OCP compat doctor against the current (or injected) environment. */
13
+ export function doctor(options) {
14
+ const report = doctorReport(options);
15
+ const { result } = report;
16
+ if (!result.supported) {
17
+ return {
18
+ ok: false,
19
+ message: result.message ?? report.summary,
20
+ host: result.id,
21
+ source: result.source,
22
+ };
23
+ }
24
+ return {
25
+ ok: true,
26
+ message: report.summary,
27
+ host: result.id,
28
+ source: result.source,
29
+ };
30
+ }
31
+ /** Resolve monorepo fixtures (CLI matrix is a checkout-rooted command). */
32
+ export async function loadFixtures() {
33
+ const url = new URL("../../../fixtures/index.ts", import.meta.url);
34
+ return (await import(url.href));
35
+ }
36
+ /** Run Plugin×Host×Tier matrix via fixtures/ (OCP §10). */
37
+ export async function matrix(options = {}) {
38
+ const fixtures = await loadFixtures();
39
+ return fixtures.runMatrix({
40
+ hosts: options.hosts,
41
+ fixtureIds: options.fixtureIds,
42
+ compatScanEnabled: options.compatScan ? true : undefined,
43
+ });
44
+ }
45
+ function printHelp() {
46
+ console.log(`opencode-compat — OCP doctor + matrix + setup + companions
47
+
48
+ Usage:
49
+ opencode-compat doctor [--host opencode|mimo|kilo|zcode]
50
+ opencode-compat overrides
51
+ opencode-compat setup [--dir <path>] [--host <id>] [--mode auto|npm|file] [--dry-run]
52
+ [--deep|--no-deep] [--reify|--no-reify] [--provider-shim|--no-provider-shim]
53
+ opencode-compat matrix [--host <id>]... [--fixture <id>]... [--compat-scan]
54
+ opencode-compat migrate-zcode --plugin <dir> [--out <dir>] [options]
55
+ opencode-compat migrate-zcode --plugin <dir> [--plugin <dir>...] \\
56
+ --marketplace-name <name> --out <dir> [options]
57
+
58
+ Commands:
59
+ doctor Detect host and print capability summary
60
+ overrides Print suggested install-time facade override JSON
61
+ setup Write Layer A overrides + Option B provider shims into host install tree
62
+ matrix Run OCP §10 Plugin×Host×Tier conformance fixtures
63
+ migrate-zcode Companion: pack plugin skills/commands/manifests → .zcode-plugin
64
+ (not OCP ABI; ZCode stays T0; does not migrate host MCP)
65
+
66
+ setup options:
67
+ --dir <path> Install tree root (default: host pluginInstallDir)
68
+ --host opencode|mimo|kilo|... Force host detection
69
+ --mode auto|npm|file Override spec form (auto prefers local file:)
70
+ --version <ver> npm: facade version (default 0.1.0)
71
+ --dry-run Print plan only; do not write
72
+ --deep / --no-deep Also patch child package.json (default: deep)
73
+ --reify / --no-reify npm install after patch when node_modules exists (default: auto)
74
+ --provider-shim / --no-provider-shim
75
+ In-place create*/languageModel adoption shims after reify (default: on)
76
+
77
+ migrate-zcode options:
78
+ --plugin <dir> Plugin package root (repeatable; required)
79
+ --out <dir> Output directory (required unless --dry-run)
80
+ --name <name> Override plugin.json name (single-plugin mode)
81
+ --version <ver> Override plugin.json version (single-plugin mode)
82
+ --marketplace-name <name> Wrap plugin(s) into a multi-plugin marketplace tree
83
+ --marketplace-description <t> Catalog description
84
+ --owner-name <name> Catalog owner.name
85
+ --owner-url <url> Catalog owner.url
86
+ --dry-run Scan/report only; do not write
87
+ --allow-empty Succeed when no marketplace assets found
88
+ --format text|json Report format (default: text)
89
+ `);
90
+ }
91
+ const HOST_IDS = new Set(["opencode", "mimo", "kilo", "zcode", "unknown"]);
92
+ function parseArgs(argv) {
93
+ const [, , command = "doctor", ...rest] = argv;
94
+ let host;
95
+ const hosts = [];
96
+ const fixtures = [];
97
+ let compatScan = false;
98
+ for (let i = 0; i < rest.length; i++) {
99
+ const arg = rest[i];
100
+ if (arg === "--host") {
101
+ const value = rest[++i];
102
+ host = value;
103
+ if (value && HOST_IDS.has(value))
104
+ hosts.push(value);
105
+ }
106
+ else if (arg?.startsWith("--host=")) {
107
+ const value = arg.slice("--host=".length);
108
+ host = value;
109
+ if (HOST_IDS.has(value))
110
+ hosts.push(value);
111
+ }
112
+ else if (arg === "--fixture") {
113
+ const value = rest[++i];
114
+ if (value)
115
+ fixtures.push(value);
116
+ }
117
+ else if (arg?.startsWith("--fixture=")) {
118
+ fixtures.push(arg.slice("--fixture=".length));
119
+ }
120
+ else if (arg === "--compat-scan") {
121
+ compatScan = true;
122
+ }
123
+ }
124
+ return {
125
+ command,
126
+ host,
127
+ hosts,
128
+ fixtures,
129
+ compatScan,
130
+ migrateRest: rest,
131
+ setupRest: rest,
132
+ };
133
+ }
134
+ export async function runSetupCli(rest) {
135
+ const opts = parseSetupArgs(rest);
136
+ if (opts.help) {
137
+ printHelp();
138
+ return 0;
139
+ }
140
+ try {
141
+ const result = setup({
142
+ dir: opts.dir,
143
+ host: opts.host,
144
+ version: opts.version,
145
+ mode: opts.mode,
146
+ dryRun: opts.dryRun,
147
+ deep: opts.deep,
148
+ reify: opts.reify,
149
+ });
150
+ console.log(result.message);
151
+ if (opts.dryRun || !result.ok) {
152
+ console.log(JSON.stringify(result.overrides, null, 2));
153
+ }
154
+ for (const t of result.targets.filter((x) => x.changed || x.reified || x.reifyError)) {
155
+ const mark = t.reifyError ? "!" : t.reified ? "*" : t.created ? "+" : "~";
156
+ console.log(` ${mark} ${t.path}`);
157
+ }
158
+ return result.ok ? 0 : 1;
159
+ }
160
+ catch (err) {
161
+ const message = err instanceof Error ? err.message : String(err);
162
+ console.error(`setup failed: ${message}`);
163
+ return 1;
164
+ }
165
+ }
166
+ export function parseMigrateZcodeArgs(rest) {
167
+ const opts = {
168
+ plugins: [],
169
+ dryRun: false,
170
+ allowEmpty: false,
171
+ format: "text",
172
+ help: false,
173
+ };
174
+ for (let i = 0; i < rest.length; i++) {
175
+ const arg = rest[i];
176
+ if (arg === "--help" || arg === "-h")
177
+ opts.help = true;
178
+ else if (arg === "--plugin") {
179
+ const value = rest[++i];
180
+ if (value)
181
+ opts.plugins.push(value);
182
+ }
183
+ else if (arg?.startsWith("--plugin=")) {
184
+ opts.plugins.push(arg.slice("--plugin=".length));
185
+ }
186
+ else if (arg === "--out")
187
+ opts.out = rest[++i];
188
+ else if (arg?.startsWith("--out="))
189
+ opts.out = arg.slice("--out=".length);
190
+ else if (arg === "--name")
191
+ opts.name = rest[++i];
192
+ else if (arg?.startsWith("--name="))
193
+ opts.name = arg.slice("--name=".length);
194
+ else if (arg === "--version")
195
+ opts.version = rest[++i];
196
+ else if (arg?.startsWith("--version=")) {
197
+ opts.version = arg.slice("--version=".length);
198
+ }
199
+ else if (arg === "--marketplace-name")
200
+ opts.marketplaceName = rest[++i];
201
+ else if (arg?.startsWith("--marketplace-name=")) {
202
+ opts.marketplaceName = arg.slice("--marketplace-name=".length);
203
+ }
204
+ else if (arg === "--marketplace-description") {
205
+ opts.marketplaceDescription = rest[++i];
206
+ }
207
+ else if (arg?.startsWith("--marketplace-description=")) {
208
+ opts.marketplaceDescription = arg.slice("--marketplace-description=".length);
209
+ }
210
+ else if (arg === "--owner-name")
211
+ opts.ownerName = rest[++i];
212
+ else if (arg?.startsWith("--owner-name=")) {
213
+ opts.ownerName = arg.slice("--owner-name=".length);
214
+ }
215
+ else if (arg === "--owner-url")
216
+ opts.ownerUrl = rest[++i];
217
+ else if (arg?.startsWith("--owner-url=")) {
218
+ opts.ownerUrl = arg.slice("--owner-url=".length);
219
+ }
220
+ else if (arg === "--dry-run")
221
+ opts.dryRun = true;
222
+ else if (arg === "--allow-empty")
223
+ opts.allowEmpty = true;
224
+ else if (arg === "--format") {
225
+ const value = rest[++i];
226
+ if (value === "json" || value === "text")
227
+ opts.format = value;
228
+ }
229
+ else if (arg?.startsWith("--format=")) {
230
+ const value = arg.slice("--format=".length);
231
+ if (value === "json" || value === "text")
232
+ opts.format = value;
233
+ }
234
+ }
235
+ return opts;
236
+ }
237
+ function formatMigrateText(report) {
238
+ const lines = [
239
+ `migrate-zcode: ${report.ok ? "ok" : "failed"}`,
240
+ `pluginDir: ${report.pluginDir}`,
241
+ report.outDir ? `outDir: ${report.outDir}` : undefined,
242
+ `skills: ${report.included.skills.length}`,
243
+ ...report.included.skills.map((s) => ` + ${s}`),
244
+ `commands: ${report.included.commands.length}`,
245
+ ...report.included.commands.map((c) => ` + ${c}`),
246
+ `manifests: ${report.included.manifests.length}`,
247
+ ...report.included.manifests.map((m) => ` + ${m}`),
248
+ `skipped: ${report.skipped.length}`,
249
+ ...report.skipped.map((s) => ` - ${s.reason} (${s.path})`),
250
+ `warnings: ${report.warnings.length}`,
251
+ ...report.warnings.map((w) => ` ! ${w}`),
252
+ "",
253
+ "Note: not OCP ABI. ZCode stays T0. Host MCP is not migrated.",
254
+ ];
255
+ return lines.filter((l) => l !== undefined).join("\n");
256
+ }
257
+ function formatMarketplaceText(report) {
258
+ const lines = [
259
+ `migrate-zcode marketplace: ${report.ok ? "ok" : "failed"}`,
260
+ `marketplace: ${report.marketplaceName}`,
261
+ report.outDir ? `outDir: ${report.outDir}` : undefined,
262
+ `plugins: ${report.plugins.length}`,
263
+ ...report.plugins.map((p) => ` + ${p.name} (${p.source})`),
264
+ `pluginDirs: ${report.pluginDirs.length}`,
265
+ ...report.pluginDirs.map((d) => ` * ${d}`),
266
+ `skipped: ${report.skipped.length}`,
267
+ ...report.skipped.map((s) => ` - ${s.reason} (${s.path})`),
268
+ `warnings: ${report.warnings.length}`,
269
+ ...report.warnings.map((w) => ` ! ${w}`),
270
+ "",
271
+ "Note: not OCP ABI. ZCode stays T0. Host MCP is not migrated.",
272
+ ];
273
+ return lines.filter((l) => l !== undefined).join("\n");
274
+ }
275
+ /** Exit: 0 ok, 1 error/collision, 2 empty without allowEmpty. */
276
+ export function migrateZcodeExitCode(report) {
277
+ if (report.ok)
278
+ return 0;
279
+ if (report.warnings.some((w) => w.startsWith("empty-migration:") || w.startsWith("empty-marketplace:"))) {
280
+ return 2;
281
+ }
282
+ return 1;
283
+ }
284
+ export async function runMigrateZcodeCli(rest) {
285
+ const opts = parseMigrateZcodeArgs(rest);
286
+ if (opts.help) {
287
+ printHelp();
288
+ return 0;
289
+ }
290
+ if (opts.plugins.length === 0) {
291
+ console.error("migrate-zcode: --plugin <dir> is required");
292
+ printHelp();
293
+ return 1;
294
+ }
295
+ if (!opts.dryRun && !opts.out?.trim()) {
296
+ console.error("migrate-zcode: --out <dir> is required unless --dry-run");
297
+ return 1;
298
+ }
299
+ const marketplaceMode = Boolean(opts.marketplaceName?.trim()) || opts.plugins.length > 1;
300
+ if (opts.plugins.length > 1 && !opts.marketplaceName?.trim()) {
301
+ console.error("migrate-zcode: multiple --plugin values require --marketplace-name");
302
+ return 1;
303
+ }
304
+ try {
305
+ if (marketplaceMode) {
306
+ const result = await migrateZcodeMarketplace({
307
+ pluginDirs: opts.plugins.map((p) => resolve(p)),
308
+ outDir: opts.out ? resolve(opts.out) : undefined,
309
+ marketplaceName: opts.marketplaceName.trim(),
310
+ marketplaceDescription: opts.marketplaceDescription,
311
+ ownerName: opts.ownerName,
312
+ ownerUrl: opts.ownerUrl,
313
+ dryRun: opts.dryRun || !opts.out,
314
+ allowEmpty: opts.allowEmpty,
315
+ });
316
+ if (opts.format === "json") {
317
+ console.log(JSON.stringify(result.report, null, 2));
318
+ }
319
+ else {
320
+ console.log(formatMarketplaceText(result.report));
321
+ }
322
+ return migrateZcodeExitCode(result.report);
323
+ }
324
+ const result = await migrateZcode({
325
+ pluginDir: resolve(opts.plugins[0]),
326
+ outDir: opts.out ? resolve(opts.out) : undefined,
327
+ name: opts.name,
328
+ version: opts.version,
329
+ dryRun: opts.dryRun || !opts.out,
330
+ allowEmpty: opts.allowEmpty,
331
+ });
332
+ if (opts.format === "json") {
333
+ console.log(JSON.stringify(result.report, null, 2));
334
+ }
335
+ else {
336
+ console.log(formatMigrateText(result.report));
337
+ }
338
+ return migrateZcodeExitCode(result.report);
339
+ }
340
+ catch (err) {
341
+ const message = err instanceof Error ? err.message : String(err);
342
+ console.error(`migrate-zcode failed: ${message}`);
343
+ return 1;
344
+ }
345
+ }
346
+ export async function mainAsync(argv = process.argv) {
347
+ const { command, host, hosts, fixtures, compatScan, migrateRest, setupRest } = parseArgs(argv);
348
+ if (command === "help" || command === "--help" || command === "-h") {
349
+ printHelp();
350
+ return 0;
351
+ }
352
+ if (command === "overrides") {
353
+ console.log(facadeOverrideSnippet());
354
+ return 0;
355
+ }
356
+ if (command === "setup") {
357
+ return runSetupCli(setupRest);
358
+ }
359
+ if (command === "migrate-zcode") {
360
+ return runMigrateZcodeCli(migrateRest);
361
+ }
362
+ if (command === "matrix") {
363
+ try {
364
+ const mod = await loadFixtures();
365
+ const results = await mod.runMatrix({
366
+ hosts: hosts.length > 0 ? hosts : undefined,
367
+ fixtureIds: fixtures.length > 0 ? fixtures : undefined,
368
+ compatScanEnabled: compatScan ? true : undefined,
369
+ });
370
+ console.log(mod.formatMatrix(results));
371
+ return mod.matrixOk(results) ? 0 : 1;
372
+ }
373
+ catch (err) {
374
+ const message = err instanceof Error ? err.message : String(err);
375
+ console.error(`matrix failed: ${message}`);
376
+ console.error("(matrix expects a monorepo checkout with fixtures/ next to packages/)");
377
+ return 1;
378
+ }
379
+ }
380
+ if (command !== "doctor") {
381
+ console.error(`Unknown command: ${command}`);
382
+ printHelp();
383
+ return 1;
384
+ }
385
+ const env = host
386
+ ? { ...process.env, OPENCODE_COMPAT_HOST: host }
387
+ : process.env;
388
+ const result = doctor({ env });
389
+ console.log(result.message);
390
+ if (result.host) {
391
+ console.log(`\n(exit: ${result.ok ? "ok" : "unsupported"} host=${result.host} source=${result.source})`);
392
+ }
393
+ return result.ok ? 0 : 1;
394
+ }
395
+ /** Sync entry for doctor / overrides / setup / help (used by unit tests). */
396
+ export function main(argv = process.argv) {
397
+ const { command, host, setupRest } = parseArgs(argv);
398
+ if (command === "matrix" || command === "migrate-zcode") {
399
+ console.error(`${command} requires async entry — use: opencode-compat ${command}`);
400
+ return 1;
401
+ }
402
+ if (command === "help" || command === "--help" || command === "-h") {
403
+ printHelp();
404
+ return 0;
405
+ }
406
+ if (command === "overrides") {
407
+ console.log(facadeOverrideSnippet());
408
+ return 0;
409
+ }
410
+ if (command === "setup") {
411
+ // setup is sync; expose via main for tests / thin wrappers
412
+ const opts = parseSetupArgs(setupRest);
413
+ if (opts.help) {
414
+ printHelp();
415
+ return 0;
416
+ }
417
+ try {
418
+ const result = setup({
419
+ dir: opts.dir,
420
+ host: opts.host,
421
+ version: opts.version,
422
+ mode: opts.mode,
423
+ dryRun: opts.dryRun,
424
+ deep: opts.deep,
425
+ });
426
+ console.log(result.message);
427
+ return result.ok ? 0 : 1;
428
+ }
429
+ catch (err) {
430
+ const message = err instanceof Error ? err.message : String(err);
431
+ console.error(`setup failed: ${message}`);
432
+ return 1;
433
+ }
434
+ }
435
+ if (command !== "doctor") {
436
+ console.error(`Unknown command: ${command}`);
437
+ printHelp();
438
+ return 1;
439
+ }
440
+ const env = host
441
+ ? { ...process.env, OPENCODE_COMPAT_HOST: host }
442
+ : process.env;
443
+ const result = doctor({ env });
444
+ console.log(result.message);
445
+ if (result.host) {
446
+ console.log(`\n(exit: ${result.ok ? "ok" : "unsupported"} host=${result.host} source=${result.source})`);
447
+ }
448
+ return result.ok ? 0 : 1;
449
+ }
450
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,39 @@
1
+ export type ProviderShimOptions = {
2
+ /** Host plugin install root (e.g. ~/.cache/mimocode/packages). */
3
+ dir: string;
4
+ /** Optional host id hint recorded in meta / used for messaging. */
5
+ hostHint?: string;
6
+ dryRun?: boolean;
7
+ };
8
+ export type ProviderShimTarget = {
9
+ packageDir: string;
10
+ packageName?: string;
11
+ entry: string;
12
+ original: string;
13
+ changed: boolean;
14
+ skipped?: string;
15
+ };
16
+ export type ProviderShimResult = {
17
+ ok: boolean;
18
+ targets: ProviderShimTarget[];
19
+ message: string;
20
+ };
21
+ type PackageJson = {
22
+ name?: string;
23
+ main?: string;
24
+ module?: string;
25
+ exports?: unknown;
26
+ dependencies?: Record<string, string>;
27
+ peerDependencies?: Record<string, string>;
28
+ [key: string]: unknown;
29
+ };
30
+ /** Resolve package root entry relative path (POSIX, leading `./`). */
31
+ export declare function resolvePackageEntryRel(pkg: PackageJson): string | undefined;
32
+ /** Static scan for `export … create*` / named exports (sync; no module eval). */
33
+ export declare function discoverExportNames(source: string): string[];
34
+ /** Discover provider package directories under a host install tree. */
35
+ export declare function discoverProviderPackageDirs(installRoot: string): string[];
36
+ /** Apply Option B shims under a host plugin install tree. */
37
+ export declare function setupProviderShims(options: ProviderShimOptions): ProviderShimResult;
38
+ export {};
39
+ //# sourceMappingURL=provider-shim.d.ts.map