@moku-labs/native 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.
@@ -0,0 +1,615 @@
1
+ import { EnvApi, LogApi } from "@moku-labs/common";
2
+ import { EmitFn } from "@moku-labs/core";
3
+
4
+ //#region \0rolldown/runtime.js
5
+ //#endregion
6
+ //#region src/config.d.ts
7
+ /** The five packaging targets (D1 — all five in v1). */
8
+ declare const TARGETS: readonly ["macos", "windows", "linux", "ios", "android"];
9
+ /** A native packaging target. */
10
+ type Target = (typeof TARGETS)[number];
11
+ /** Pipeline phases in execution order — drives NativePhase and progress rendering (mirrors web's PHASE_ORDER). */
12
+ declare const PHASE_ORDER: readonly ["scaffold", "codegen", "icons", "compile", "bundle", "collect"];
13
+ /** A build pipeline phase. */
14
+ type NativePhase = (typeof PHASE_ORDER)[number];
15
+ /**
16
+ * Per-capability packaging parameters — ONE map drives both `Config["capabilities"]`
17
+ * and project's `resolve<K extends keyof CapabilityConfigMap>` (S2-refined; spec/09 §3/§5 technique).
18
+ * deep-link is custom-scheme-only in v1 (D-011); the `mode` discriminant keeps `"universal"` additive later.
19
+ */
20
+ type CapabilityConfigMap = {
21
+ store: Record<string, never>;
22
+ notification: Record<string, never>;
23
+ "clipboard-manager": Record<string, never>;
24
+ tray: Record<string, never>;
25
+ "deep-link": {
26
+ mode: "scheme";
27
+ scheme: string;
28
+ };
29
+ };
30
+ /** Signing configuration — env-var REFERENCES and config-safe identifiers only, never raw secrets. */
31
+ type SigningConfig = {
32
+ android?: {
33
+ keystorePath?: string;
34
+ keystorePasswordEnv?: string;
35
+ keyAlias?: string;
36
+ };
37
+ windows?: {
38
+ certificateThumbprint?: string;
39
+ };
40
+ };
41
+ /**
42
+ * Global configuration shape for the framework. Read by every plugin via `ctx.global`.
43
+ * Required-with-defaults fields keep the complete-C default literal valid under exactOptionalPropertyTypes.
44
+ */
45
+ type Config = {
46
+ /** App identity — project.onInit validates name/identifier are non-empty (reverse-DNS identifier). */app: {
47
+ name: string;
48
+ identifier: string;
49
+ version?: string;
50
+ }; /** Web build/dev wiring codegenned into tauri.conf.json (S3). cwd for monorepo layouts (S3-refined). */
51
+ web: {
52
+ build: string;
53
+ dev: {
54
+ command: string;
55
+ url: string;
56
+ };
57
+ dist: string;
58
+ cwd?: string;
59
+ }; /** Composed `@moku-labs/system` plugins — the kernel-guaranteed name-only contract (spec/03 §1). */
60
+ system: ReadonlyArray<{
61
+ name: string;
62
+ }>; /** Per-capability packaging parameters. */
63
+ capabilities: Partial<CapabilityConfigMap>; /** Targets this app ships (D1 default: all five). */
64
+ targets: readonly Target[]; /** Generated Tauri project root (contains src-tauri/). Gitignored build output. */
65
+ projectDir: string; /** Installer delivery root. */
66
+ outDir: string; /** Signing env-var references. */
67
+ signing: SigningConfig;
68
+ };
69
+ /** native:phase payload — one flat event, target as a field (context decision). */
70
+ type NativePhaseEvent = {
71
+ target: Target;
72
+ phase: NativePhase;
73
+ status: "start" | "progress" | "done" | "error";
74
+ durationMs?: number;
75
+ detail?: string;
76
+ };
77
+ /** native:complete payload — where the shippable artifacts landed. */
78
+ type NativeCompleteEvent = {
79
+ target: Target;
80
+ outPath: string;
81
+ artifacts: readonly string[];
82
+ durationMs: number;
83
+ };
84
+ /**
85
+ * Framework-level events (spec/07 §6 `framework-domain:*`) — emitted by build, hookable by all plugins.
86
+ */
87
+ type Events = {
88
+ "native:phase": NativePhaseEvent;
89
+ "native:complete": NativeCompleteEvent;
90
+ };
91
+ declare namespace types_d_exports$3 {
92
+ export { Api$4 as Api, CleanResult, CompletenessResult, GenerateResult, ManifestEntry, PatchResult, PlistEntry, ProjectContext, RegistryRow, ResolvedCapability, TauriConfFragment };
93
+ }
94
+ /** Result of a write-if-changed generation pass. */
95
+ type GenerateResult = {
96
+ written: string[];
97
+ unchanged: string[];
98
+ skipped: string[];
99
+ };
100
+ /** Mobile gen/-tree gate — completeness (required-file set), not existence (S4 refinement). */
101
+ type CompletenessResult = {
102
+ status: "not-applicable";
103
+ } | {
104
+ status: "not-initialized";
105
+ } | {
106
+ status: "incomplete";
107
+ missing: readonly string[];
108
+ } | {
109
+ status: "complete";
110
+ };
111
+ /** Result of the idempotent mobile patch pass (v1: Android signing only). */
112
+ type PatchResult = {
113
+ patched: string[];
114
+ unchanged: string[];
115
+ };
116
+ /** Result of a clean pass. */
117
+ type CleanResult = {
118
+ removed: readonly string[];
119
+ };
120
+ /** One capability registry row — packaging metadata with per-row research confidence. */
121
+ type RegistryRow = {
122
+ name: keyof CapabilityConfigMap;
123
+ npmPackage: `@tauri-apps/plugin-${string}`;
124
+ crate: `tauri-plugin-${string}`;
125
+ crateRange: string;
126
+ npmRange: string;
127
+ rustInit: string;
128
+ permissions: readonly string[];
129
+ platforms: readonly Target[];
130
+ confidence: "high" | "medium" | "low";
131
+ };
132
+ /** A tauri.conf.json contribution fragment (plugins section + bundle metadata). */
133
+ type TauriConfFragment = Record<string, unknown>;
134
+ /** An Info.ios.plist sidecar entry (src-tauri root, outside gen/) — empty for every v1 row. */
135
+ type PlistEntry = {
136
+ key: string;
137
+ value: string;
138
+ };
139
+ /** An AndroidManifest need — empty for every v1 row (official plugins self-merge via build.rs). */
140
+ type ManifestEntry = {
141
+ parentTag: string;
142
+ xml: string;
143
+ };
144
+ /** A capability resolved against consumer config. */
145
+ type ResolvedCapability = RegistryRow & {
146
+ conf: TauriConfFragment;
147
+ sidecarPlist: readonly PlistEntry[];
148
+ manifest: readonly ManifestEntry[];
149
+ };
150
+ /**
151
+ * Domain context for the project plugin's API factory. This plugin has no per-plugin
152
+ * config/state — it consumes global config only (D-005) — so this is deliberately
153
+ * narrower than the kernel's full `PluginContext`: just `global` + the injected `log`
154
+ * core API (MC2).
155
+ */
156
+ type ProjectContext = {
157
+ readonly global: Readonly<Config>;
158
+ readonly log: LogApi;
159
+ };
160
+ /** Public API of the project plugin. */
161
+ type Api$4 = {
162
+ generate(opts: {
163
+ target: Target;
164
+ }): Promise<GenerateResult>;
165
+ completeness(opts: {
166
+ target: Target;
167
+ }): CompletenessResult;
168
+ patchMobile(opts: {
169
+ target: "ios" | "android";
170
+ }): Promise<PatchResult>;
171
+ clean(opts?: {
172
+ target?: Target;
173
+ }): Promise<CleanResult>;
174
+ resolve<K extends keyof CapabilityConfigMap>(name: K, config?: CapabilityConfigMap[K]): ResolvedCapability;
175
+ isKnownCapability(name: string): name is keyof CapabilityConfigMap;
176
+ registryRows(): ReadonlyArray<RegistryRow>;
177
+ requiredFiles(platform: "ios" | "android"): readonly string[];
178
+ };
179
+ declare namespace types_d_exports$4 {
180
+ export { Api$3 as Api, CompileTick, Config$3 as Config, DevExit, DevHandle, RunResult, SpawnFn, State$1 as State, TauriContext, TauriError, TauriErrorDetails, TauriErrorKind };
181
+ }
182
+ /**
183
+ * Structural spawn seam — injectable for tests (skeleton-conventions §3).
184
+ * `signal` lets long-lived callers (the dev seam) request cancellation without
185
+ * the caller ever touching a raw ChildProcess — the real implementation wires
186
+ * it to a process-group kill escalation (spawn.ts).
187
+ */
188
+ type SpawnFn = (opts: {
189
+ cmd: readonly string[];
190
+ cwd: string;
191
+ env?: Readonly<Record<string, string>>;
192
+ detached?: boolean;
193
+ onLine?: (line: string) => void;
194
+ signal?: AbortSignal;
195
+ }) => Promise<{
196
+ code: number | null;
197
+ signal: string | null;
198
+ stdout: string;
199
+ stderr: string;
200
+ }>;
201
+ /** tauri plugin per-plugin config — test seams (| undefined required under exactOptionalPropertyTypes). */
202
+ type Config$3 = {
203
+ spawnImpl?: SpawnFn | undefined;
204
+ nodePath?: string | undefined;
205
+ readiness: {
206
+ intervalMs: number;
207
+ timeoutMs: number;
208
+ };
209
+ };
210
+ /** Result of a one-shot verb (non-zero exits throw TauriError instead). */
211
+ type RunResult = {
212
+ code: 0;
213
+ stdout: string;
214
+ stderr: string;
215
+ durationMs: number;
216
+ };
217
+ /** Parsed compile progress tick — real crate counts, never fake percentages. */
218
+ type CompileTick = {
219
+ crate: string;
220
+ index?: number;
221
+ total?: number;
222
+ };
223
+ /** How a dev session ended. */
224
+ type DevExit = {
225
+ code: number | null;
226
+ signal: string | null;
227
+ };
228
+ /** Live dev-session handle — teardown is owned HERE (D-002), never by cli. */
229
+ type DevHandle = {
230
+ url: string;
231
+ ready: Promise<void>;
232
+ exited: Promise<DevExit>;
233
+ stop(): Promise<void>;
234
+ };
235
+ /** Classified subprocess failure taxonomy. */
236
+ type TauriErrorKind = "toolchain-missing" | "config-invalid" | "compile-failed" | "signing-failed" | "device-unavailable" | "cancelled" | "unknown";
237
+ /** Extra fields carried on a classified failure, alongside the standard `Error` shape. */
238
+ type TauriErrorDetails = {
239
+ /** The taxonomy bucket assigned by `errors.ts#classify`. */readonly kind: TauriErrorKind; /** Raw process exit code (`null` when the process was signal-terminated). */
240
+ readonly exitCode: number | null; /** Scrubbed tail of stderr (secrets already masked) — safe to log/display. */
241
+ readonly stderrTail: string;
242
+ };
243
+ /**
244
+ * Thrown by every one-shot verb (`icon`/`build`/`mobileInit`) on a non-zero exit.
245
+ * Carries a classified {@link TauriErrorKind} and the scrubbed stderr tail so
246
+ * callers (`build`, `doctor`, `cli`) can render an actionable message without
247
+ * re-deriving the taxonomy or re-scrubbing raw output.
248
+ */
249
+ declare class TauriError extends Error implements TauriErrorDetails {
250
+ readonly kind: TauriErrorKind;
251
+ readonly exitCode: number | null;
252
+ readonly stderrTail: string;
253
+ /**
254
+ * Constructs a classified `TauriError`.
255
+ *
256
+ * @param kind - Taxonomy bucket.
257
+ * @param message - Fully formatted `[native] ...` message.
258
+ * @param details - Exit code + scrubbed stderr tail.
259
+ * @param details.exitCode - Raw process exit code (`null` when signal-terminated).
260
+ * @param details.stderrTail - Scrubbed tail of stderr — already safe to log/display.
261
+ * @example
262
+ * ```ts
263
+ * throw new TauriError("compile-failed", "[native] tauri compile failed.\n See stderr.", {
264
+ * exitCode: 101,
265
+ * stderrTail: "error[E0432]: unresolved import `foo`",
266
+ * });
267
+ * ```
268
+ */
269
+ constructor(kind: TauriErrorKind, message: string, details: {
270
+ exitCode: number | null;
271
+ stderrTail: string;
272
+ });
273
+ }
274
+ /** Mutable plugin state — the one live dev handle (undefined = no live session; unicorn/no-null). */
275
+ type State$1 = {
276
+ dev: DevHandle | undefined;
277
+ };
278
+ /** Public API of the tauri plugin — the framework's ONLY subprocess seam. */
279
+ type Api$3 = {
280
+ icon(opts: {
281
+ source: string;
282
+ }): Promise<RunResult>;
283
+ build(opts: {
284
+ target: Target;
285
+ onTick?: (tick: CompileTick) => void;
286
+ onOutput?: (line: string) => void;
287
+ }): Promise<RunResult>;
288
+ mobileInit(opts: {
289
+ platform: "ios" | "android";
290
+ }): Promise<RunResult>;
291
+ dev(opts: {
292
+ target?: Target;
293
+ onOutput?: (line: string) => void;
294
+ }): Promise<DevHandle>;
295
+ version(): Promise<{
296
+ cliVersion: string;
297
+ } | null>;
298
+ };
299
+ /**
300
+ * Domain context shared by every tauri domain file. Structural composition
301
+ * (not the bare `PluginCtx` export) because this plugin needs `global`
302
+ * (projectDir, web.dev.url) and the `log`/`env` core APIs alongside
303
+ * `config`/`state` — see moku-testing's mock-context.md §Standard Factory.
304
+ */
305
+ type TauriContext = {
306
+ readonly global: Readonly<Config>;
307
+ readonly config: Readonly<Config$3>;
308
+ state: State$1;
309
+ readonly log: LogApi;
310
+ readonly env: EnvApi;
311
+ };
312
+ declare namespace types_d_exports {
313
+ export { Api$2 as Api, BuildContext, BuildResult };
314
+ }
315
+ /** Result of one target's full pipeline pass. */
316
+ type BuildResult = {
317
+ target: Target;
318
+ outPath: string;
319
+ artifacts: readonly string[];
320
+ durationMs: number;
321
+ phases: ReadonlyArray<{
322
+ phase: NativePhase;
323
+ durationMs: number;
324
+ }>;
325
+ };
326
+ /** Public API of the build plugin — the per-target pipeline orchestrator. */
327
+ type Api$2 = {
328
+ run(opts: {
329
+ target: Target;
330
+ }): Promise<BuildResult>;
331
+ runAll(opts?: {
332
+ targets?: readonly Target[];
333
+ }): Promise<readonly BuildResult[]>;
334
+ };
335
+ /**
336
+ * Structural mirror of `@moku-labs/core`'s unexported `PluginLike` — same field shape
337
+ * (`name`/`spec`/`_phantom`), so a real plugin instance (e.g. `projectPlugin`) satisfies
338
+ * it without importing a core-internal type. `PluginCtx`'s own JSDoc anticipates this:
339
+ * "for advanced composition (e.g. adding require), use EmitFn<E> directly" — this is the
340
+ * `require`-side equivalent, re-derived locally since core intentionally exports only
341
+ * `PluginCtx`/`EmitFn` for domain composition (moku-testing mock-context.md).
342
+ */
343
+ type PluginLike$2 = {
344
+ readonly name: string;
345
+ readonly spec: unknown;
346
+ readonly _phantom: {
347
+ readonly config: unknown;
348
+ readonly state: unknown;
349
+ readonly api: unknown;
350
+ readonly events?: Record<string, unknown>;
351
+ };
352
+ };
353
+ /** Extracts a plugin-like value's API type from its phantom `api` slot. */
354
+ type PluginApiOf$2<P extends PluginLike$2> = P extends {
355
+ readonly _phantom: {
356
+ readonly api: infer A;
357
+ };
358
+ } ? A : never;
359
+ /**
360
+ * Domain context for the build plugin's pipeline. Structural (not the bare `PluginCtx`
361
+ * export) because this plugin genuinely needs `require` — build's only two dependencies
362
+ * are `project` and `tauri` (D-007) — alongside `global` and the `log` core API (MC2).
363
+ * No `config`/`state` fields: build has neither (spec/03 §Config, §State).
364
+ */
365
+ type BuildContext = {
366
+ readonly global: Readonly<Config>;
367
+ readonly log: LogApi;
368
+ readonly emit: EmitFn<Events>;
369
+ readonly require: <P extends PluginLike$2>(plugin: P) => PluginApiOf$2<P>;
370
+ };
371
+ declare namespace types_d_exports$2 {
372
+ export { Api$1 as Api, CheckResult, Config$2 as Config, DoctorContext, DoctorEvents, DoctorReport, ProbeFn };
373
+ }
374
+ /** Structural probe seam — injectable for tests. */
375
+ type ProbeFn = (cmd: string, args: readonly string[]) => Promise<{
376
+ code: number;
377
+ stdout: string;
378
+ }>;
379
+ /** doctor plugin per-plugin config (| undefined required under exactOptionalPropertyTypes). */
380
+ type Config$2 = {
381
+ probeImpl?: ProbeFn | undefined;
382
+ };
383
+ /** One completed check — also the doctor:check event payload. */
384
+ type CheckResult = {
385
+ id: string;
386
+ target: Target | "host";
387
+ status: "pass" | "warn" | "fail";
388
+ message: string;
389
+ fixIt?: string;
390
+ };
391
+ /** Aggregated diagnosis report (warns don't flip ok; fails do). */
392
+ type DoctorReport = {
393
+ ok: boolean;
394
+ checks: readonly CheckResult[];
395
+ };
396
+ /** Events this plugin declares (spec/14 §2 register callback pattern). */
397
+ type DoctorEvents = {
398
+ "doctor:check": CheckResult;
399
+ };
400
+ /**
401
+ * Structural mirror of `@moku-labs/core`'s unexported `PluginLike` — same field shape
402
+ * (`name`/`spec`/`_phantom`), so a real plugin instance (e.g. `projectPlugin`) satisfies
403
+ * it without importing a core-internal type. `PluginCtx`'s own JSDoc anticipates this:
404
+ * "for advanced composition (e.g. adding require), use EmitFn<E> directly" — this is the
405
+ * `require`-side equivalent, re-derived locally since core intentionally exports only
406
+ * `PluginCtx`/`EmitFn` for domain composition (moku-testing mock-context.md; house style
407
+ * established by the sibling `build` plugin's `types.ts`, spec/04 §Dependencies).
408
+ */
409
+ type PluginLike$1 = {
410
+ readonly name: string;
411
+ readonly spec: unknown;
412
+ readonly _phantom: {
413
+ readonly config: unknown;
414
+ readonly state: unknown;
415
+ readonly api: unknown;
416
+ readonly events?: Record<string, unknown>;
417
+ };
418
+ };
419
+ /** Extracts a plugin-like value's API type from its phantom `api` slot. */
420
+ type PluginApiOf$1<P extends PluginLike$1> = P extends {
421
+ readonly _phantom: {
422
+ readonly api: infer A;
423
+ };
424
+ } ? A : never;
425
+ /**
426
+ * Domain context for the doctor API factory. Structural composition (mock-context.md
427
+ * "advanced composition" case): doctor genuinely needs `require` — its two dependencies
428
+ * are `project` and `tauri` (D-007) — alongside `global` and the `log`/`env` core APIs
429
+ * (MC2/MC3). No `state` field: doctor has none (spec/04 §State).
430
+ */
431
+ type DoctorContext = {
432
+ readonly global: Readonly<Config>;
433
+ readonly config: Readonly<Config$2>;
434
+ readonly log: LogApi;
435
+ readonly env: EnvApi;
436
+ readonly emit: EmitFn<DoctorEvents>;
437
+ readonly require: <P extends PluginLike$1>(plugin: P) => PluginApiOf$1<P>;
438
+ };
439
+ /** Public API of the doctor plugin. */
440
+ type Api$1 = {
441
+ run(opts?: {
442
+ target?: Target;
443
+ }): Promise<DoctorReport>;
444
+ };
445
+ declare namespace types_d_exports$1 {
446
+ export { Api, CliContext, Config$1 as Config, ConfirmFn, RenderFn, State };
447
+ }
448
+ /** Structural render sink — injectable for tests (default: branded `@moku-labs/common/cli` console). */
449
+ type RenderFn = (line: string) => void;
450
+ /** Structural confirm seam — injectable for tests (default: styled confirm from the branded kit). */
451
+ type ConfirmFn = (question: string) => Promise<boolean>;
452
+ /** cli plugin per-plugin config (| undefined required under exactOptionalPropertyTypes). */
453
+ type Config$1 = {
454
+ renderImpl?: RenderFn | undefined;
455
+ confirmImpl?: ConfirmFn | undefined;
456
+ };
457
+ /** Live-render bookkeeping for the current verb invocation (undefined = no active phase; unicorn/no-null). */
458
+ type State = {
459
+ progress: {
460
+ phase: NativePhase | undefined;
461
+ startedAt: number | undefined;
462
+ ticks: number;
463
+ };
464
+ };
465
+ /** Public API of the cli plugin — typed verbs, NO argv parsing. */
466
+ type Api = {
467
+ build(opts?: {
468
+ target?: Target;
469
+ all?: boolean;
470
+ }): Promise<void>;
471
+ dev(opts?: {
472
+ target?: Target;
473
+ }): Promise<void>;
474
+ doctor(opts?: {
475
+ target?: Target;
476
+ }): Promise<boolean>;
477
+ clean(opts?: {
478
+ target?: Target;
479
+ }): Promise<void>;
480
+ };
481
+ /**
482
+ * Structural mirror of `@moku-labs/core`'s unexported `PluginLike` — same field shape
483
+ * (`name`/`spec`/`_phantom`), so a real plugin instance (e.g. `projectPlugin`) satisfies
484
+ * it without importing a core-internal type. Re-derived locally per the house pattern
485
+ * established by the sibling `build`/`doctor` plugins' `types.ts` (moku-testing
486
+ * mock-context.md; spec/04 §Dependencies).
487
+ */
488
+ type PluginLike = {
489
+ readonly name: string;
490
+ readonly spec: unknown;
491
+ readonly _phantom: {
492
+ readonly config: unknown;
493
+ readonly state: unknown;
494
+ readonly api: unknown;
495
+ readonly events?: Record<string, unknown>;
496
+ };
497
+ };
498
+ /** Extracts a plugin-like value's API type from its phantom `api` slot. */
499
+ type PluginApiOf<P extends PluginLike> = P extends {
500
+ readonly _phantom: {
501
+ readonly api: infer A;
502
+ };
503
+ } ? A : never;
504
+ /**
505
+ * Domain context shared by the cli plugin's `api` and `hooks` factories. Structural
506
+ * composition (not the bare `PluginCtx` export): cli genuinely needs `require` — its four
507
+ * dependencies are project/tauri/build/doctor (D-007) — alongside the mutable render-progress
508
+ * `state` and the injectable render/confirm seams on `config`.
509
+ */
510
+ type CliContext = {
511
+ readonly global: Readonly<Config>;
512
+ readonly config: Readonly<Config$1>;
513
+ state: State;
514
+ readonly require: <P extends PluginLike>(plugin: P) => PluginApiOf<P>;
515
+ };
516
+ //#endregion
517
+ //#region src/plugins/build/index.d.ts
518
+ /**
519
+ * Standard tier — sequential per-target pipeline emitting global native:phase/native:complete;
520
+ * owns the collect phase (bundle-location table → dist-native/<target>/).
521
+ *
522
+ * @see README.md
523
+ * @example
524
+ * ```ts
525
+ * const app = createApp({ plugins: [projectPlugin, tauriPlugin, buildPlugin] });
526
+ * ```
527
+ */
528
+ declare const buildPlugin: import("@moku-labs/core").PluginInstance<"build", Record<string, never>, Record<string, never>, Api$2, {}> & Record<never, never>;
529
+ //#endregion
530
+ //#region src/plugins/cli/index.d.ts
531
+ /**
532
+ * Standard tier — typed verb surface (build/dev/doctor/clean), branded rendering (MC1),
533
+ * live progress via hooks. dev() awaits tauri's DevHandle but never holds it (D-002).
534
+ * `api`/`hooks` use the wrapper-call form (not a bare factory reference) so this call's
535
+ * own contextual inference merges the doctor depends edge's `doctor:check` event into ctx
536
+ * (mirrors doctor/index.ts's `api: ctx => createDoctorApi(ctx)` precedent).
537
+ *
538
+ * @see README.md
539
+ * @example
540
+ * ```ts
541
+ * const app = createApp({ plugins: [projectPlugin, tauriPlugin, buildPlugin, doctorPlugin, cliPlugin] });
542
+ * ```
543
+ */
544
+ declare const cliPlugin: import("@moku-labs/core").PluginInstance<"cli", Config$1, State, Api, {}> & Record<never, never>;
545
+ //#endregion
546
+ //#region src/plugins/doctor/index.d.ts
547
+ /**
548
+ * Complex tier — per-target toolchain/completeness/version-skew diagnosis via a checks/ registry.
549
+ * Emits `doctor:check` per completed check (cli renders these live).
550
+ *
551
+ * @see README.md
552
+ * @example
553
+ * ```ts
554
+ * const app = createApp({ plugins: [projectPlugin, tauriPlugin, doctorPlugin] });
555
+ * ```
556
+ */
557
+ declare const doctorPlugin: import("@moku-labs/core").PluginInstance<"doctor", Config$2, Record<string, never>, Api$1, {
558
+ "doctor:check": CheckResult;
559
+ }> & Record<never, never>;
560
+ //#endregion
561
+ //#region src/plugins/project/index.d.ts
562
+ /**
563
+ * Complex tier — capability registry + .moku/tauri generators + write-if-changed writer +
564
+ * mobile init-once-then-patch (Android signing only in v1) + clean.
565
+ *
566
+ * @see README.md
567
+ * @example
568
+ * ```ts
569
+ * const app = createApp({ plugins: [projectPlugin] });
570
+ * ```
571
+ */
572
+ declare const projectPlugin: import("@moku-labs/core").PluginInstance<"project", Record<string, never>, Record<string, never>, Api$4, {}> & Record<never, never>;
573
+ //#endregion
574
+ //#region src/plugins/tauri/index.d.ts
575
+ /**
576
+ * Standard tier — `@tauri-apps/cli` subprocess seam: argv builders, injectable spawn,
577
+ * process-group dev lifecycle, stream parsing, error taxonomy, secret scrubbing.
578
+ *
579
+ * NO onStop by design (D-002): spec/08 §2 TeardownContext = { global } — a regular plugin's
580
+ * onStop cannot reach ctx.state, so dev teardown is owned by the dev seam's own control flow
581
+ * (signal handlers + DevHandle.stop()), which also covers Ctrl-C where onStop never fires.
582
+ *
583
+ * @see README.md
584
+ * @example
585
+ * ```ts
586
+ * const app = createApp({ plugins: [tauriPlugin] });
587
+ * ```
588
+ */
589
+ declare const tauriPlugin: import("@moku-labs/core").PluginInstance<"tauri", Config$3, State$1, Api$3, {}> & Record<never, never>;
590
+ //#endregion
591
+ //#region src/index.d.ts
592
+ /**
593
+ * Creates a native consumer app (Layer 3) from this framework.
594
+ *
595
+ * @example
596
+ * ```ts
597
+ * export const native = createApp({ config: { app: { name: "MyApp", identifier: "com.example.myapp" } } });
598
+ * ```
599
+ */
600
+ declare const createApp: <const ExtraPlugins extends readonly import("@moku-labs/core").AnyPluginInstance[] = readonly []>(options?: import("@moku-labs/core").CreateAppOptions<Config, Events, (import("@moku-labs/core").PluginInstance<"project", Record<string, never>, Record<string, never>, Api$4, {}> & Record<never, never>) | (import("@moku-labs/core").PluginInstance<"tauri", Config$3, State$1, Api$3, {}> & Record<never, never>) | (import("@moku-labs/core").PluginInstance<"build", Record<string, never>, Record<string, never>, Api$2, {}> & Record<never, never>) | (import("@moku-labs/core").PluginInstance<"doctor", Config$2, Record<string, never>, Api$1, {
601
+ "doctor:check": CheckResult;
602
+ }> & Record<never, never>) | (import("@moku-labs/core").PluginInstance<"cli", Config$1, State, Api, {}> & Record<never, never>) | ExtraPlugins[number], [...ExtraPlugins], import("@moku-labs/core").CoreApisFromTuple<[import("@moku-labs/core").CorePluginInstance<"log", import("@moku-labs/common").LogConfig, import("@moku-labs/common").LogState, import("@moku-labs/common").LogApi>, import("@moku-labs/core").CorePluginInstance<"env", import("@moku-labs/common").EnvConfig, import("@moku-labs/common").EnvState, import("@moku-labs/common").EnvApi>]>> | undefined) => import("@moku-labs/core").App<Config, Events, (import("@moku-labs/core").PluginInstance<"project", Record<string, never>, Record<string, never>, Api$4, {}> & Record<never, never>) | (import("@moku-labs/core").PluginInstance<"tauri", Config$3, State$1, Api$3, {}> & Record<never, never>) | (import("@moku-labs/core").PluginInstance<"build", Record<string, never>, Record<string, never>, Api$2, {}> & Record<never, never>) | (import("@moku-labs/core").PluginInstance<"doctor", Config$2, Record<string, never>, Api$1, {
603
+ "doctor:check": CheckResult;
604
+ }> & Record<never, never>) | (import("@moku-labs/core").PluginInstance<"cli", Config$1, State, Api, {}> & Record<never, never>) | ExtraPlugins[number], import("@moku-labs/core").CoreApisFromTuple<[import("@moku-labs/core").CorePluginInstance<"log", import("@moku-labs/common").LogConfig, import("@moku-labs/common").LogState, import("@moku-labs/common").LogApi>, import("@moku-labs/core").CorePluginInstance<"env", import("@moku-labs/common").EnvConfig, import("@moku-labs/common").EnvState, import("@moku-labs/common").EnvApi>]>>;
605
+ /**
606
+ * Creates a consumer-authored plugin bound to this framework's chain.
607
+ *
608
+ * @example
609
+ * ```ts
610
+ * const myPlugin = createPlugin("my", { api: () => ({}) });
611
+ * ```
612
+ */
613
+ declare const createPlugin: import("@moku-labs/core").BoundCreatePluginFunction<Config, Events, import("@moku-labs/core").CoreApisFromTuple<[import("@moku-labs/core").CorePluginInstance<"log", import("@moku-labs/common").LogConfig, import("@moku-labs/common").LogState, import("@moku-labs/common").LogApi>, import("@moku-labs/core").CorePluginInstance<"env", import("@moku-labs/common").EnvConfig, import("@moku-labs/common").EnvState, import("@moku-labs/common").EnvApi>]>>;
614
+ //#endregion
615
+ export { types_d_exports as Build, type CapabilityConfigMap, types_d_exports$1 as Cli, type Config, types_d_exports$2 as Doctor, type Events, type NativeCompleteEvent, type NativePhase, type NativePhaseEvent, PHASE_ORDER, types_d_exports$3 as Project, type SigningConfig, TARGETS, type Target, types_d_exports$4 as Tauri, buildPlugin, cliPlugin, createApp, createPlugin, doctorPlugin, projectPlugin, tauriPlugin };