@powerhousedao/desktop 6.2.3-dev.57 → 6.2.3-dev.58

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,85 @@
1
+ import { ChildProcess } from "node:child_process";
2
+ //#region src/bundle-stack.d.ts
3
+ /**
4
+ * P6.3 — stage the shippable STACK into the shell project: everything the
5
+ * installed app needs to run `ph run desktop` with no environment at all
6
+ * (D6.c). The shell's resources map `../dist-stack` → `stack`, and its
7
+ * uniform-runners mode falls back to `resources/stack` when the env pair is
8
+ * absent. Layout:
9
+ *
10
+ * dist-stack/
11
+ * hosts/ the project's host files
12
+ * agents/ when present
13
+ * powerhouse.config.json
14
+ * package.json minimal, names the project
15
+ * dist/ the BUILT Connect (ph run connect build)
16
+ * node_modules/ vendored @powerhousedao/ph-cli (hoisted,
17
+ * real files — computed-specifier imports and
18
+ * PGlite wasm forbid bundling)
19
+ */
20
+ interface BundleStackOptions {
21
+ projectRoot: string;
22
+ shellProjectDir: string;
23
+ /** Vendor the runtime packages (slow). Skipped when false — an existing
24
+ * vendored tree is left in place. */
25
+ vendor?: boolean;
26
+ /** The ph-cli version/tag to vendor. Default: "dev". NOTE: the vendored
27
+ * ph-cli must carry the `run` command — registry tags published before
28
+ * uniform-runners landed cannot run a stack; until a nightly catches up,
29
+ * pass `phCliSpec` with a locally packed tarball instead. */
30
+ phCliVersion?: string;
31
+ /** Overrides the ph-cli install spec entirely (e.g. a `pnpm pack` tarball
32
+ * path for a not-yet-published build). */
33
+ phCliSpec?: string;
34
+ /** The connect member's port — written into the stack's shell.json so the
35
+ * shell knows where to probe/navigate with no environment at all. */
36
+ connectPort?: number;
37
+ logger?: (message: string) => void;
38
+ }
39
+ interface BundleStackResult {
40
+ stackDir: string;
41
+ vendored: boolean;
42
+ }
43
+ export declare function bundleStack(options: BundleStackOptions): BundleStackResult;
44
+ //#endregion
45
+ //#region src/shell.d.ts
46
+ /**
47
+ * Shell discovery and launch. The Rust/Tauri shell lives in the
48
+ * ph-win-desktop repo (cargo cannot ride an npm package); the runner locates
49
+ * a checkout via `runner.shell.project` or PH_DESKTOP_SHELL and prefers its
50
+ * BUILT exe (dev config like window title is baked into a build — the
51
+ * `--config` projection below applies to tauri-cli invocations only).
52
+ */
53
+ interface ShellOptions {
54
+ /** Path to a ph-win-desktop checkout (absolute or project-relative). */
55
+ project?: string;
56
+ window?: {
57
+ title?: string;
58
+ width?: number;
59
+ height?: number;
60
+ };
61
+ tray?: boolean;
62
+ fileAssociations?: string[];
63
+ }
64
+ interface ResolvedShell {
65
+ projectDir: string;
66
+ /** A built exe when one exists (debug preferred for dev), else undefined →
67
+ * fall back to `pnpm tauri dev`. */
68
+ exe?: string;
69
+ }
70
+ export declare function resolveShell(projectRoot: string, options: ShellOptions | undefined, env: Record<string, string | undefined>): ResolvedShell;
71
+ /** Resolve the project's ph-cli entry from ITS dependency tree — the same
72
+ * resolution `ph run` itself uses. */
73
+ export declare function resolvePhCliEntry(projectRoot: string): string;
74
+ /** The env trio (plus flag and userData) the shell's uniform-runners mode
75
+ * reads — wired by the RUNNER so nobody exports variables by hand. */
76
+ export declare function shellEnv(projectRoot: string, connectPort: number, env: Record<string, string | undefined>): Record<string, string>;
77
+ /** Project host shell options onto a tauri `--config` merge patch (D6.d) —
78
+ * the host file stays the single source for app identity on tauri-cli
79
+ * invocations; a built exe has these baked. */
80
+ export declare function tauriConfigPatch(options: ShellOptions | undefined): Record<string, unknown> | undefined;
81
+ export declare function launchShell(shell: ResolvedShell, envVars: Record<string, string>, options: ShellOptions | undefined): ChildProcess;
82
+ //#endregion
83
+ export type { BundleStackOptions, BundleStackResult, ResolvedShell, ShellOptions };
84
+ export {};
85
+ //# sourceMappingURL=index.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../src/bundle-stack.ts","../src/shell.ts"],"mappings":";;;;;;;;;;;;;;;;;;;UAqBiB;EACf;EACA;;;EAGA;;;;;EAKA;;;EAGA;;;EAGA;EACA,UAAU;;UAGK;EACf;EACA;;wBASc,YAAY,SAAS,qBAAqB;;;;;;;;;;UCtCzC;;EAEf;EACA;IAAW;IAAgB;IAAgB;;EAC3C;EACA;;UAGe;EACf;;;EAGA;;wBAGc,aACd,qBACA,SAAS,0BACT,KAAK,qCACJ;;;wBA4Ba,kBAAkB;;;wBAUlB,SACd,qBACA,qBACA,KAAK,qCACJ;;;;wBAaa,iBACd,SAAS,2BACR;wBA2Ba,YACd,OAAO,eACP,SAAS,wBACT,SAAS,2BACR"}
package/dist/index.mjs ADDED
@@ -0,0 +1,2 @@
1
+ import { a as tauriConfigPatch, i as shellEnv, n as resolvePhCliEntry, o as bundleStack, r as resolveShell, t as launchShell } from "./shell-DcBLVLVz.mjs";
2
+ export { bundleStack, launchShell, resolvePhCliEntry, resolveShell, shellEnv, tauriConfigPatch };
@@ -0,0 +1,106 @@
1
+ import { HostDefinition, RunnerContext } from "@powerhousedao/host-core";
2
+ //#region src/runner.d.ts
3
+ /**
4
+ * @powerhousedao/desktop/runner (phase 6): the desktop host productized.
5
+ *
6
+ * - `run`/`serve`: the headless stack — byte-identical delegation to
7
+ * host-core's generic compound (phase-3 semantics unchanged).
8
+ * - `dev`: the NATIVE window — resolves the shell (runner.shell.project /
9
+ * PH_DESKTOP_SHELL), wires the env trio itself (PH_RUN_PROJECT, PH_RUN_CLI,
10
+ * PH_WIN_CONNECT_PORT, + userData/flag) and launches the built exe when one
11
+ * exists, else `pnpm tauri dev` with the shell-config projection (D6.d).
12
+ * - `build`: the PACKAGING verb — forwards `build` to members that export it
13
+ * (skipping the rest WITH a log line: packaging builds what is buildable,
14
+ * unlike the generic compound's uniform fail-loud forwarding), then stages
15
+ * the shippable stack into the shell project (bundle-stack: hosts + config
16
+ * + built Connect + vendored ph-cli) so the installed app runs with no
17
+ * environment at all (D6.c).
18
+ */
19
+ export declare const kind = "compound";
20
+ export declare const hostSchema: import("zod").ZodObject<{
21
+ name: import("zod").ZodString;
22
+ runner: import("zod").ZodObject<{
23
+ module: import("zod").ZodString;
24
+ defaultVerb: import("zod").ZodOptional<import("zod").ZodString>;
25
+ port: import("zod").ZodOptional<import("zod").ZodNumber>;
26
+ }, import("zod/v4/core").$loose>;
27
+ children: import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodObject<{
28
+ host: import("zod").ZodString;
29
+ plugins: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
30
+ runner: import("zod").ZodOptional<import("zod").ZodObject<{}, import("zod/v4/core").$loose>>;
31
+ config: import("zod").ZodOptional<import("zod").ZodObject<{}, import("zod/v4/core").$loose>>;
32
+ reactor: import("zod").ZodOptional<import("zod").ZodObject<{
33
+ backends: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodObject<{
34
+ kind: import("zod").ZodOptional<import("zod").ZodEnum<{
35
+ "in-process": "in-process";
36
+ remote: "remote";
37
+ worker: "worker";
38
+ }>>;
39
+ storage: import("zod").ZodOptional<import("zod").ZodObject<{
40
+ kind: import("zod").ZodEnum<{
41
+ idb: "idb";
42
+ memory: "memory";
43
+ path: "path";
44
+ postgres: "postgres";
45
+ }>;
46
+ dataDir: import("zod").ZodOptional<import("zod").ZodString>;
47
+ url: import("zod").ZodOptional<import("zod").ZodString>;
48
+ }, import("zod/v4/core").$strict>>;
49
+ readModel: import("zod").ZodOptional<import("zod").ZodObject<{
50
+ url: import("zod").ZodOptional<import("zod").ZodString>;
51
+ }, import("zod/v4/core").$strict>>;
52
+ packages: import("zod").ZodOptional<import("zod").ZodObject<{
53
+ cdnUrl: import("zod").ZodOptional<import("zod").ZodString>;
54
+ specs: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
55
+ dynamic: import("zod").ZodOptional<import("zod").ZodBoolean>;
56
+ }, import("zod/v4/core").$strict>>;
57
+ remote: import("zod").ZodOptional<import("zod").ZodObject<{
58
+ host: import("zod").ZodOptional<import("zod").ZodString>;
59
+ url: import("zod").ZodOptional<import("zod").ZodString>;
60
+ }, import("zod/v4/core").$strict>>;
61
+ }, import("zod/v4/core").$strict>>>;
62
+ placement: import("zod").ZodOptional<import("zod").ZodObject<{
63
+ primary: import("zod").ZodOptional<import("zod").ZodString>;
64
+ default: import("zod").ZodOptional<import("zod").ZodObject<{}, import("zod/v4/core").$loose>>;
65
+ }, import("zod/v4/core").$strict>>;
66
+ workflows: import("zod").ZodOptional<import("zod").ZodBoolean>;
67
+ protocol: import("zod").ZodOptional<import("zod").ZodObject<{
68
+ featureFlags: import("zod").ZodOptional<import("zod").ZodObject<{
69
+ documentDecisions: import("zod").ZodOptional<import("zod").ZodBoolean>;
70
+ authEnforcement: import("zod").ZodOptional<import("zod").ZodBoolean>;
71
+ authGroups: import("zod").ZodOptional<import("zod").ZodBoolean>;
72
+ authConditions: import("zod").ZodOptional<import("zod").ZodBoolean>;
73
+ }, import("zod/v4/core").$strict>>;
74
+ createSignaturePolicy: import("zod").ZodOptional<import("zod").ZodEnum<{
75
+ legacy: "legacy";
76
+ "v2-required": "v2-required";
77
+ }>>;
78
+ unsupportedStoredDocuments: import("zod").ZodOptional<import("zod").ZodEnum<{
79
+ "read-only": "read-only";
80
+ refuse: "refuse";
81
+ }>>;
82
+ }, import("zod/v4/core").$strict>>;
83
+ }, import("zod/v4/core").$strict>>;
84
+ }, import("zod/v4/core").$strict>>;
85
+ config: import("zod").ZodOptional<import("zod").ZodObject<{}, import("zod/v4/core").$loose>>;
86
+ profile: import("zod").ZodOptional<import("zod").ZodObject<{
87
+ appId: import("zod").ZodOptional<import("zod").ZodString>;
88
+ name: import("zod").ZodOptional<import("zod").ZodString>;
89
+ description: import("zod").ZodOptional<import("zod").ZodString>;
90
+ icon: import("zod").ZodOptional<import("zod").ZodString>;
91
+ }, import("zod/v4/core").$strict>>;
92
+ }, import("zod/v4/core").$loose>;
93
+ export declare function run(host: HostDefinition, ctx: RunnerContext): Promise<import("@powerhousedao/host-core").RunCompoundResult>;
94
+ export declare const serve: typeof run;
95
+ /** dev = the native window around the live stack, zero manual env. */
96
+ export interface ShellHandle {
97
+ /** Resolves when the shell window exits — the runner's keep-alive. */
98
+ ready: Promise<void>;
99
+ shutdown: () => void;
100
+ }
101
+ export declare function dev(host: HostDefinition, ctx: RunnerContext): Promise<ShellHandle>;
102
+ /** build = members' builds (where exported) + the shippable stack staging. */
103
+ export declare function build(host: HostDefinition, ctx: RunnerContext): Promise<void>;
104
+ //#endregion
105
+ export {};
106
+ //# sourceMappingURL=runner.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runner.d.mts","names":[],"sources":["../src/runner.ts"],"mappings":";;;;;;;;;;;;;;;;;;qBAkCa;qBAEA,0BAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAAqB;wBA0CtB,IAAI,MAAM,gBAAgB,KAAK,gBAAa,2CAAA;qBAKrD,cAAK;;iBAGD;;EAEf,OAAO;EACP;;wBAGoB,IACpB,MAAM,gBACN,KAAK,gBACJ,QAAQ;;wBA8BW,MACpB,MAAM,gBACN,KAAK,gBACJ"}
@@ -0,0 +1,95 @@
1
+ import { i as shellEnv, o as bundleStack, r as resolveShell, t as launchShell } from "./shell-DcBLVLVz.mjs";
2
+ import { compoundHostSchema, getVerb, loadHost, resolveRunnerModule, validateHost } from "@powerhousedao/host-core";
3
+ //#region src/runner.ts
4
+ /**
5
+ * @powerhousedao/desktop/runner (phase 6): the desktop host productized.
6
+ *
7
+ * - `run`/`serve`: the headless stack — byte-identical delegation to
8
+ * host-core's generic compound (phase-3 semantics unchanged).
9
+ * - `dev`: the NATIVE window — resolves the shell (runner.shell.project /
10
+ * PH_DESKTOP_SHELL), wires the env trio itself (PH_RUN_PROJECT, PH_RUN_CLI,
11
+ * PH_WIN_CONNECT_PORT, + userData/flag) and launches the built exe when one
12
+ * exists, else `pnpm tauri dev` with the shell-config projection (D6.d).
13
+ * - `build`: the PACKAGING verb — forwards `build` to members that export it
14
+ * (skipping the rest WITH a log line: packaging builds what is buildable,
15
+ * unlike the generic compound's uniform fail-loud forwarding), then stages
16
+ * the shippable stack into the shell project (bundle-stack: hosts + config
17
+ * + built Connect + vendored ph-cli) so the installed app runs with no
18
+ * environment at all (D6.c).
19
+ */
20
+ const kind = "compound";
21
+ const hostSchema = compoundHostSchema;
22
+ async function compoundModule() {
23
+ return import("@powerhousedao/host-core/runners/compound");
24
+ }
25
+ /** The connect member's port — the shell's readiness probe and window URL. */
26
+ async function connectPort(host, ctx) {
27
+ const children = host.children ?? {};
28
+ for (const wrapper of Object.values(children)) {
29
+ if (wrapper.host !== "connect") continue;
30
+ if (typeof wrapper.runner?.port === "number") return wrapper.runner.port;
31
+ const member = await loadHost(ctx.projectRoot, wrapper.host);
32
+ if (typeof member.host.runner.port === "number") return member.host.runner.port;
33
+ }
34
+ throw new Error(`hosts/${host.name}: no connect member with a resolvable runner.port — the shell needs it for its readiness probe and window URL.`);
35
+ }
36
+ async function run(host, ctx) {
37
+ return (await compoundModule()).run(host, ctx);
38
+ }
39
+ const serve = run;
40
+ async function dev(host, ctx) {
41
+ const options = host.runner;
42
+ const shell = resolveShell(ctx.projectRoot, options.shell, ctx.env);
43
+ const port = await connectPort(host, ctx);
44
+ const envVars = shellEnv(ctx.projectRoot, port, ctx.env);
45
+ console.log(`[${host.name}] launching the desktop shell (${shell.exe ? shell.exe : "pnpm tauri dev"}) — stack via ph run ${host.name}, window at http://127.0.0.1:${port}/`);
46
+ const child = launchShell(shell, envVars, options.shell);
47
+ return {
48
+ ready: new Promise((resolve) => child.once("exit", () => resolve())),
49
+ shutdown: () => {
50
+ try {
51
+ child.kill();
52
+ } catch {}
53
+ }
54
+ };
55
+ }
56
+ /** build = members' builds (where exported) + the shippable stack staging. */
57
+ async function build(host, ctx) {
58
+ const children = host.children ?? {};
59
+ for (const [name, wrapper] of Object.entries(children)) {
60
+ const member = await loadHost(ctx.projectRoot, wrapper.host);
61
+ const specifier = member.host.runner.module;
62
+ const runner = await resolveRunnerModule(ctx.projectRoot, specifier);
63
+ validateHost(runner, specifier, member.host, `hosts/${wrapper.host}/host.js`);
64
+ if (typeof runner.build !== "function") {
65
+ console.log(`[${host.name}] build: ${name} (${wrapper.host}) exports no build — skipped (packaging builds what is buildable)`);
66
+ continue;
67
+ }
68
+ const fn = getVerb(runner, specifier, "build");
69
+ console.log(`[${host.name}] build → ${name} (${wrapper.host})`);
70
+ await fn(member.host, {
71
+ ...ctx,
72
+ verb: "build"
73
+ });
74
+ }
75
+ const runnerOptions = host.runner;
76
+ if (!runnerOptions.shell?.project && !ctx.env.PH_DESKTOP_SHELL) {
77
+ console.log(`[${host.name}] build: no shell configured — members built; stack staging skipped (set runner.shell.project to stage the shippable stack).`);
78
+ return;
79
+ }
80
+ const shell = resolveShell(ctx.projectRoot, runnerOptions.shell, ctx.env);
81
+ console.log(`[${host.name}] staging the stack into ${shell.projectDir}…`);
82
+ const result = bundleStack({
83
+ projectRoot: ctx.projectRoot,
84
+ shellProjectDir: shell.projectDir,
85
+ vendor: runnerOptions.vendorStack,
86
+ phCliVersion: runnerOptions.phCliVersion,
87
+ phCliSpec: runnerOptions.phCliSpec ?? ctx.env.PH_DESKTOP_PHCLI_SPEC,
88
+ connectPort: await connectPort(host, ctx)
89
+ });
90
+ console.log(`[${host.name}] stack staged at ${result.stackDir}${result.vendored ? " (ph-cli vendored)" : ""} — the shell runs it with no environment (resources fallback).`);
91
+ }
92
+ //#endregion
93
+ export { build, dev, hostSchema, kind, run, serve };
94
+
95
+ //# sourceMappingURL=runner.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runner.mjs","names":[],"sources":["../src/runner.ts"],"sourcesContent":["import {\n compoundHostSchema,\n getVerb,\n loadHost,\n resolveRunnerModule,\n validateHost,\n type HostDefinition,\n type RunnerContext,\n} from \"@powerhousedao/host-core\";\nimport { bundleStack } from \"./bundle-stack.js\";\nimport {\n launchShell,\n resolveShell,\n shellEnv,\n type ShellOptions,\n} from \"./shell.js\";\n\n/**\n * @powerhousedao/desktop/runner (phase 6): the desktop host productized.\n *\n * - `run`/`serve`: the headless stack — byte-identical delegation to\n * host-core's generic compound (phase-3 semantics unchanged).\n * - `dev`: the NATIVE window — resolves the shell (runner.shell.project /\n * PH_DESKTOP_SHELL), wires the env trio itself (PH_RUN_PROJECT, PH_RUN_CLI,\n * PH_WIN_CONNECT_PORT, + userData/flag) and launches the built exe when one\n * exists, else `pnpm tauri dev` with the shell-config projection (D6.d).\n * - `build`: the PACKAGING verb — forwards `build` to members that export it\n * (skipping the rest WITH a log line: packaging builds what is buildable,\n * unlike the generic compound's uniform fail-loud forwarding), then stages\n * the shippable stack into the shell project (bundle-stack: hosts + config\n * + built Connect + vendored ph-cli) so the installed app runs with no\n * environment at all (D6.c).\n */\n\nexport const kind = \"compound\";\n\nexport const hostSchema = compoundHostSchema;\n\ninterface DesktopRunnerOptions {\n shell?: ShellOptions;\n /** build: vendor ph-cli into the staged stack (default true). */\n vendorStack?: boolean;\n /** build: the ph-cli version/tag to vendor (default \"dev\"). */\n phCliVersion?: string;\n /** build: full install spec override (e.g. a pnpm-pack tarball path) for a\n * ph-cli not yet on the registry. */\n phCliSpec?: string;\n}\n\ninterface ChildWrapper {\n host: string;\n runner?: { port?: number; defaultVerb?: string } & Record<string, unknown>;\n}\n\nasync function compoundModule() {\n return import(\"@powerhousedao/host-core/runners/compound\");\n}\n\n/** The connect member's port — the shell's readiness probe and window URL. */\nasync function connectPort(\n host: HostDefinition,\n ctx: RunnerContext,\n): Promise<number> {\n const children = (host.children ?? {}) as Record<string, ChildWrapper>;\n for (const wrapper of Object.values(children)) {\n if (wrapper.host !== \"connect\") continue;\n if (typeof wrapper.runner?.port === \"number\") return wrapper.runner.port;\n const member = await loadHost(ctx.projectRoot, wrapper.host);\n if (typeof member.host.runner.port === \"number\") {\n return member.host.runner.port;\n }\n }\n throw new Error(\n `hosts/${host.name}: no connect member with a resolvable runner.port — ` +\n `the shell needs it for its readiness probe and window URL.`,\n );\n}\n\nexport async function run(host: HostDefinition, ctx: RunnerContext) {\n const compound = await compoundModule();\n return compound.run(host, ctx);\n}\n\nexport const serve = run;\n\n/** dev = the native window around the live stack, zero manual env. */\nexport interface ShellHandle {\n /** Resolves when the shell window exits — the runner's keep-alive. */\n ready: Promise<void>;\n shutdown: () => void;\n}\n\nexport async function dev(\n host: HostDefinition,\n ctx: RunnerContext,\n): Promise<ShellHandle> {\n const options = host.runner as { shell?: ShellOptions };\n const shell = resolveShell(ctx.projectRoot, options.shell, ctx.env);\n const port = await connectPort(host, ctx);\n const envVars = shellEnv(ctx.projectRoot, port, ctx.env);\n\n console.log(\n `[${host.name}] launching the desktop shell ` +\n `(${shell.exe ? shell.exe : \"pnpm tauri dev\"}) — stack via ` +\n `ph run ${host.name}, window at http://127.0.0.1:${port}/`,\n );\n const child = launchShell(shell, envVars, options.shell);\n const exited = new Promise<void>((resolve) =>\n child.once(\"exit\", () => resolve()),\n );\n\n return {\n // keep the runner alive as long as the window lives\n ready: exited,\n shutdown: () => {\n try {\n child.kill();\n } catch {\n // already gone\n }\n },\n };\n}\n\n/** build = members' builds (where exported) + the shippable stack staging. */\nexport async function build(\n host: HostDefinition,\n ctx: RunnerContext,\n): Promise<void> {\n const children = (host.children ?? {}) as Record<string, ChildWrapper>;\n for (const [name, wrapper] of Object.entries(children)) {\n const member = await loadHost(ctx.projectRoot, wrapper.host);\n const specifier = member.host.runner.module;\n const runner = await resolveRunnerModule(ctx.projectRoot, specifier);\n validateHost(\n runner,\n specifier,\n member.host,\n `hosts/${wrapper.host}/host.js`,\n );\n if (typeof (runner as Record<string, unknown>).build !== \"function\") {\n console.log(\n `[${host.name}] build: ${name} (${wrapper.host}) exports no build — skipped (packaging builds what is buildable)`,\n );\n continue;\n }\n const fn = getVerb(runner, specifier, \"build\");\n console.log(`[${host.name}] build → ${name} (${wrapper.host})`);\n await fn(member.host, { ...ctx, verb: \"build\" });\n }\n\n const runnerOptions = host.runner as DesktopRunnerOptions &\n HostDefinition[\"runner\"];\n if (!runnerOptions.shell?.project && !ctx.env.PH_DESKTOP_SHELL) {\n console.log(\n `[${host.name}] build: no shell configured — members built; stack ` +\n `staging skipped (set runner.shell.project to stage the shippable stack).`,\n );\n return;\n }\n const shell = resolveShell(ctx.projectRoot, runnerOptions.shell, ctx.env);\n console.log(`[${host.name}] staging the stack into ${shell.projectDir}…`);\n const result = bundleStack({\n projectRoot: ctx.projectRoot,\n shellProjectDir: shell.projectDir,\n vendor: runnerOptions.vendorStack,\n phCliVersion: runnerOptions.phCliVersion,\n phCliSpec: runnerOptions.phCliSpec ?? ctx.env.PH_DESKTOP_PHCLI_SPEC,\n connectPort: await connectPort(host, ctx),\n });\n console.log(\n `[${host.name}] stack staged at ${result.stackDir}` +\n `${result.vendored ? \" (ph-cli vendored)\" : \"\"} — the shell runs it with ` +\n `no environment (resources fallback).`,\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAkCA,MAAa,OAAO;AAEpB,MAAa,aAAa;AAkB1B,eAAe,iBAAiB;CAC9B,OAAO,OAAO;AAChB;;AAGA,eAAe,YACb,MACA,KACiB;CACjB,MAAM,WAAY,KAAK,YAAY,CAAC;CACpC,KAAK,MAAM,WAAW,OAAO,OAAO,QAAQ,GAAG;EAC7C,IAAI,QAAQ,SAAS,WAAW;EAChC,IAAI,OAAO,QAAQ,QAAQ,SAAS,UAAU,OAAO,QAAQ,OAAO;EACpE,MAAM,SAAS,MAAM,SAAS,IAAI,aAAa,QAAQ,IAAI;EAC3D,IAAI,OAAO,OAAO,KAAK,OAAO,SAAS,UACrC,OAAO,OAAO,KAAK,OAAO;CAE9B;CACA,MAAM,IAAI,MACR,SAAS,KAAK,KAAK,+GAErB;AACF;AAEA,eAAsB,IAAI,MAAsB,KAAoB;CAElE,QAAO,MADgB,eAAe,EAAA,CACtB,IAAI,MAAM,GAAG;AAC/B;AAEA,MAAa,QAAQ;AASrB,eAAsB,IACpB,MACA,KACsB;CACtB,MAAM,UAAU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,IACN,IAAI,KAAK,KAAK,6HAEhB;EACA;CACF;CACA,MAAM,QAAQ,aAAa,IAAI,aAAa,cAAc,OAAO,IAAI,GAAG;CACxE,QAAQ,IAAI,IAAI,KAAK,KAAK,2BAA2B,MAAM,WAAW,EAAE;CACxE,MAAM,SAAS,YAAY;EACzB,aAAa,IAAI;EACjB,iBAAiB,MAAM;EACvB,QAAQ,cAAc;EACtB,cAAc,cAAc;EAC5B,WAAW,cAAc,aAAa,IAAI,IAAI;EAC9C,aAAa,MAAM,YAAY,MAAM,GAAG;CAC1C,CAAC;CACD,QAAQ,IACN,IAAI,KAAK,KAAK,oBAAoB,OAAO,WACpC,OAAO,WAAW,uBAAuB,GAAG,+DAEnD;AACF"}
@@ -0,0 +1,148 @@
1
+ import { createRequire } from "node:module";
2
+ import { spawn, spawnSync } from "node:child_process";
3
+ import fs from "node:fs";
4
+ import path from "node:path";
5
+ import { pathToFileURL } from "node:url";
6
+ //#region src/bundle-stack.ts
7
+ function copyIfExists(from, to) {
8
+ if (!fs.existsSync(from)) return false;
9
+ fs.cpSync(from, to, { recursive: true });
10
+ return true;
11
+ }
12
+ function bundleStack(options) {
13
+ const log = options.logger ?? console.log;
14
+ const stackDir = path.join(options.shellProjectDir, "dist-stack");
15
+ for (const entry of [
16
+ "hosts",
17
+ "agents",
18
+ "dist",
19
+ "powerhouse.config.json",
20
+ "package.json"
21
+ ]) fs.rmSync(path.join(stackDir, entry), {
22
+ recursive: true,
23
+ force: true
24
+ });
25
+ fs.mkdirSync(stackDir, { recursive: true });
26
+ for (const dir of [
27
+ "hosts",
28
+ "agents",
29
+ "dist"
30
+ ]) log(` ${dir}/ ${copyIfExists(path.join(options.projectRoot, dir), path.join(stackDir, dir)) ? "staged" : "absent — skipped"}`);
31
+ const stagedDesktopHost = path.join(stackDir, "hosts", "desktop", "host.js");
32
+ if (fs.existsSync(stagedDesktopHost)) {
33
+ const source = fs.readFileSync(stagedDesktopHost, "utf8");
34
+ if (source.includes("@powerhousedao/desktop/runner")) {
35
+ fs.writeFileSync(stagedDesktopHost, "// STAGED COPY (bundle-stack): runner.module rewritten to the generic\n// compound — the packaged shell is the window; there is no nested shell.\n" + source.replace(/@powerhousedao\/desktop\/runner/g, "@powerhousedao/host-core/runners/compound"));
36
+ log(" hosts/desktop/host.js: runner rewritten to the generic compound (staged copy)");
37
+ }
38
+ }
39
+ copyIfExists(path.join(options.projectRoot, "powerhouse.config.json"), path.join(stackDir, "powerhouse.config.json"));
40
+ if (typeof options.connectPort === "number") {
41
+ fs.writeFileSync(path.join(stackDir, "shell.json"), `${JSON.stringify({ connectPort: options.connectPort }, null, 2)}\n`);
42
+ log(` shell.json: connectPort ${options.connectPort}`);
43
+ }
44
+ const sourcePkg = JSON.parse(fs.readFileSync(path.join(options.projectRoot, "package.json"), "utf8"));
45
+ const version = options.phCliVersion ?? "dev";
46
+ fs.writeFileSync(path.join(stackDir, "package.json"), `${JSON.stringify({
47
+ name: sourcePkg.name ?? "powerhouse-desktop-stack",
48
+ private: true,
49
+ type: "module",
50
+ dependencies: { "@powerhousedao/ph-cli": version }
51
+ }, null, 2)}\n`);
52
+ let vendored = false;
53
+ if (options.vendor !== false) {
54
+ const specs = `"${options.phCliSpec ?? `@powerhousedao/ph-cli@${version}`}" "@powerhousedao/host-core@${version}"`;
55
+ log(` vendoring ${specs} (hoisted, real files)…`);
56
+ const result = spawnSync(`npm install ${specs} --install-strategy=hoisted --omit=dev --no-audit --no-fund`, {
57
+ cwd: stackDir,
58
+ stdio: "pipe",
59
+ shell: true,
60
+ windowsHide: true
61
+ });
62
+ if (result.status !== 0) throw new Error(`bundle-stack: vendoring failed (${result.status}):\n${result.stderr.toString().slice(-800)}`);
63
+ vendored = true;
64
+ } else log(" vendoring skipped (vendor: false) — existing tree left in place");
65
+ return {
66
+ stackDir,
67
+ vendored
68
+ };
69
+ }
70
+ //#endregion
71
+ //#region src/shell.ts
72
+ function resolveShell(projectRoot, options, env) {
73
+ const configured = options?.project ?? env.PH_DESKTOP_SHELL;
74
+ if (!configured) throw new Error("No desktop shell configured: set runner.shell.project in the host file (path to a ph-win-desktop checkout) or the PH_DESKTOP_SHELL environment variable. `ph run desktop` (headless stack) needs neither.");
75
+ const projectDir = path.resolve(projectRoot, configured);
76
+ if (!fs.existsSync(path.join(projectDir, "src-tauri"))) throw new Error(`Desktop shell not found at ${projectDir} (no src-tauri/) — check runner.shell.project / PH_DESKTOP_SHELL.`);
77
+ return {
78
+ projectDir,
79
+ exe: [
80
+ path.join(projectDir, "src-tauri", "target", "debug", "ph-win.exe"),
81
+ path.join(projectDir, "src-tauri", "target", "release", "ph-win.exe"),
82
+ path.join(projectDir, "src-tauri", "target", "debug", "ph-win"),
83
+ path.join(projectDir, "src-tauri", "target", "release", "ph-win")
84
+ ].find((c) => fs.existsSync(c))
85
+ };
86
+ }
87
+ /** Resolve the project's ph-cli entry from ITS dependency tree — the same
88
+ * resolution `ph run` itself uses. */
89
+ function resolvePhCliEntry(projectRoot) {
90
+ const pkgPath = createRequire(pathToFileURL(path.join(projectRoot, "package.json")).href).resolve("@powerhousedao/ph-cli/package.json");
91
+ return path.join(path.dirname(pkgPath), "dist", "cli.mjs");
92
+ }
93
+ /** The env trio (plus flag and userData) the shell's uniform-runners mode
94
+ * reads — wired by the RUNNER so nobody exports variables by hand. */
95
+ function shellEnv(projectRoot, connectPort, env) {
96
+ return {
97
+ FEATURE_UNIFORM_RUNNERS_ENABLED: "1",
98
+ PH_RUN_PROJECT: projectRoot,
99
+ PH_RUN_CLI: resolvePhCliEntry(projectRoot),
100
+ PH_WIN_CONNECT_PORT: String(connectPort),
101
+ ...env.PH_USER_DATA_DIR ? { PH_USER_DATA_DIR: env.PH_USER_DATA_DIR } : {}
102
+ };
103
+ }
104
+ /** Project host shell options onto a tauri `--config` merge patch (D6.d) —
105
+ * the host file stays the single source for app identity on tauri-cli
106
+ * invocations; a built exe has these baked. */
107
+ function tauriConfigPatch(options) {
108
+ if (!options) return void 0;
109
+ const patch = {};
110
+ if (options.window) patch.app = { windows: [{
111
+ ...options.window.title ? { title: options.window.title } : {},
112
+ ...options.window.width ? { width: options.window.width } : {},
113
+ ...options.window.height ? { height: options.window.height } : {}
114
+ }] };
115
+ if (options.fileAssociations?.length) patch.bundle = { fileAssociations: [{
116
+ ext: options.fileAssociations.map((e) => e.replace(/^\./, "")),
117
+ name: "Powerhouse Document"
118
+ }] };
119
+ return Object.keys(patch).length > 0 ? patch : void 0;
120
+ }
121
+ function launchShell(shell, envVars, options) {
122
+ if (shell.exe) return spawn(shell.exe, [], {
123
+ cwd: shell.projectDir,
124
+ env: {
125
+ ...process.env,
126
+ ...envVars
127
+ },
128
+ stdio: "inherit",
129
+ windowsHide: true
130
+ });
131
+ const patch = tauriConfigPatch(options);
132
+ const args = ["tauri", "dev"];
133
+ if (patch) args.push("--config", JSON.stringify(patch));
134
+ return spawn("pnpm", args, {
135
+ cwd: shell.projectDir,
136
+ env: {
137
+ ...process.env,
138
+ ...envVars
139
+ },
140
+ stdio: "inherit",
141
+ shell: true,
142
+ windowsHide: true
143
+ });
144
+ }
145
+ //#endregion
146
+ export { tauriConfigPatch as a, shellEnv as i, resolvePhCliEntry as n, bundleStack as o, resolveShell as r, launchShell as t };
147
+
148
+ //# sourceMappingURL=shell-DcBLVLVz.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shell-DcBLVLVz.mjs","names":[],"sources":["../src/bundle-stack.ts","../src/shell.ts"],"sourcesContent":["import { spawnSync } from \"node:child_process\";\nimport fs from \"node:fs\";\nimport path from \"node:path\";\n\n/**\n * P6.3 — stage the shippable STACK into the shell project: everything the\n * installed app needs to run `ph run desktop` with no environment at all\n * (D6.c). The shell's resources map `../dist-stack` → `stack`, and its\n * uniform-runners mode falls back to `resources/stack` when the env pair is\n * absent. Layout:\n *\n * dist-stack/\n * hosts/ the project's host files\n * agents/ when present\n * powerhouse.config.json\n * package.json minimal, names the project\n * dist/ the BUILT Connect (ph run connect build)\n * node_modules/ vendored @powerhousedao/ph-cli (hoisted,\n * real files — computed-specifier imports and\n * PGlite wasm forbid bundling)\n */\nexport interface BundleStackOptions {\n projectRoot: string;\n shellProjectDir: string;\n /** Vendor the runtime packages (slow). Skipped when false — an existing\n * vendored tree is left in place. */\n vendor?: boolean;\n /** The ph-cli version/tag to vendor. Default: \"dev\". NOTE: the vendored\n * ph-cli must carry the `run` command — registry tags published before\n * uniform-runners landed cannot run a stack; until a nightly catches up,\n * pass `phCliSpec` with a locally packed tarball instead. */\n phCliVersion?: string;\n /** Overrides the ph-cli install spec entirely (e.g. a `pnpm pack` tarball\n * path for a not-yet-published build). */\n phCliSpec?: string;\n /** The connect member's port — written into the stack's shell.json so the\n * shell knows where to probe/navigate with no environment at all. */\n connectPort?: number;\n logger?: (message: string) => void;\n}\n\nexport interface BundleStackResult {\n stackDir: string;\n vendored: boolean;\n}\n\nfunction copyIfExists(from: string, to: string): boolean {\n if (!fs.existsSync(from)) return false;\n fs.cpSync(from, to, { recursive: true });\n return true;\n}\n\nexport function bundleStack(options: BundleStackOptions): BundleStackResult {\n const log = options.logger ?? console.log;\n const stackDir = path.join(options.shellProjectDir, \"dist-stack\");\n\n // Fresh staging for project files; the vendored node_modules survives\n // unless re-vendoring (it is by far the slowest part).\n for (const entry of [\n \"hosts\",\n \"agents\",\n \"dist\",\n \"powerhouse.config.json\",\n \"package.json\",\n ]) {\n fs.rmSync(path.join(stackDir, entry), { recursive: true, force: true });\n }\n fs.mkdirSync(stackDir, { recursive: true });\n\n for (const dir of [\"hosts\", \"agents\", \"dist\"]) {\n const copied = copyIfExists(\n path.join(options.projectRoot, dir),\n path.join(stackDir, dir),\n );\n log(` ${dir}/ ${copied ? \"staged\" : \"absent — skipped\"}`);\n }\n\n // Inside the package there is no nested shell — the shell IS the window —\n // so the staged desktop host runs on the generic compound. Rewrite the\n // runner.module projection in the STAGED copy only.\n const stagedDesktopHost = path.join(stackDir, \"hosts\", \"desktop\", \"host.js\");\n if (fs.existsSync(stagedDesktopHost)) {\n const source = fs.readFileSync(stagedDesktopHost, \"utf8\");\n if (source.includes(\"@powerhousedao/desktop/runner\")) {\n fs.writeFileSync(\n stagedDesktopHost,\n \"// STAGED COPY (bundle-stack): runner.module rewritten to the generic\\n\" +\n \"// compound — the packaged shell is the window; there is no nested shell.\\n\" +\n source.replace(\n /@powerhousedao\\/desktop\\/runner/g,\n \"@powerhousedao/host-core/runners/compound\",\n ),\n );\n log(\n \" hosts/desktop/host.js: runner rewritten to the generic compound (staged copy)\",\n );\n }\n }\n copyIfExists(\n path.join(options.projectRoot, \"powerhouse.config.json\"),\n path.join(stackDir, \"powerhouse.config.json\"),\n );\n\n // shell.json: the stack's contract with the shell. The no-env (packaged)\n // path has nobody to set PH_WIN_CONNECT_PORT, so the shell reads the probe\n // and window port from here.\n if (typeof options.connectPort === \"number\") {\n fs.writeFileSync(\n path.join(stackDir, \"shell.json\"),\n `${JSON.stringify({ connectPort: options.connectPort }, null, 2)}\\n`,\n );\n log(` shell.json: connectPort ${options.connectPort}`);\n }\n\n // A minimal manifest: names the project (lock identity) and depends on\n // ph-cli so the vendored tree resolves exactly like a real install.\n const sourcePkg = JSON.parse(\n fs.readFileSync(path.join(options.projectRoot, \"package.json\"), \"utf8\"),\n ) as { name?: string };\n const version = options.phCliVersion ?? \"dev\";\n fs.writeFileSync(\n path.join(stackDir, \"package.json\"),\n `${JSON.stringify(\n {\n name: sourcePkg.name ?? \"powerhouse-desktop-stack\",\n private: true,\n type: \"module\",\n dependencies: { \"@powerhousedao/ph-cli\": version },\n },\n null,\n 2,\n )}\\n`,\n );\n\n let vendored = false;\n if (options.vendor !== false) {\n const phCliSpec = options.phCliSpec ?? `@powerhousedao/ph-cli@${version}`;\n // host-core rides along: host files resolve runner modules (the generic\n // compound) from the STACK's own node_modules.\n const specs = `\"${phCliSpec}\" \"@powerhousedao/host-core@${version}\"`;\n log(` vendoring ${specs} (hoisted, real files)…`);\n // One command string: shell:true with an args ARRAY concatenates without\n // escaping (DEP0190 warns); the spec values are our own constants/paths.\n const result = spawnSync(\n `npm install ${specs} --install-strategy=hoisted --omit=dev --no-audit --no-fund`,\n { cwd: stackDir, stdio: \"pipe\", shell: true, windowsHide: true },\n );\n if (result.status !== 0) {\n throw new Error(\n `bundle-stack: vendoring failed (${result.status}):\\n` +\n `${result.stderr.toString().slice(-800)}`,\n );\n }\n vendored = true;\n } else {\n log(\" vendoring skipped (vendor: false) — existing tree left in place\");\n }\n\n return { stackDir, vendored };\n}\n","import { spawn, type ChildProcess } from \"node:child_process\";\nimport fs from \"node:fs\";\nimport { createRequire } from \"node:module\";\nimport path from \"node:path\";\nimport { pathToFileURL } from \"node:url\";\n\n/**\n * Shell discovery and launch. The Rust/Tauri shell lives in the\n * ph-win-desktop repo (cargo cannot ride an npm package); the runner locates\n * a checkout via `runner.shell.project` or PH_DESKTOP_SHELL and prefers its\n * BUILT exe (dev config like window title is baked into a build — the\n * `--config` projection below applies to tauri-cli invocations only).\n */\n\nexport interface ShellOptions {\n /** Path to a ph-win-desktop checkout (absolute or project-relative). */\n project?: string;\n window?: { title?: string; width?: number; height?: number };\n tray?: boolean;\n fileAssociations?: string[];\n}\n\nexport interface ResolvedShell {\n projectDir: string;\n /** A built exe when one exists (debug preferred for dev), else undefined →\n * fall back to `pnpm tauri dev`. */\n exe?: string;\n}\n\nexport function resolveShell(\n projectRoot: string,\n options: ShellOptions | undefined,\n env: Record<string, string | undefined>,\n): ResolvedShell {\n const configured = options?.project ?? env.PH_DESKTOP_SHELL;\n if (!configured) {\n throw new Error(\n \"No desktop shell configured: set runner.shell.project in the host file \" +\n \"(path to a ph-win-desktop checkout) or the PH_DESKTOP_SHELL \" +\n \"environment variable. `ph run desktop` (headless stack) needs neither.\",\n );\n }\n const projectDir = path.resolve(projectRoot, configured);\n if (!fs.existsSync(path.join(projectDir, \"src-tauri\"))) {\n throw new Error(\n `Desktop shell not found at ${projectDir} (no src-tauri/) — check ` +\n `runner.shell.project / PH_DESKTOP_SHELL.`,\n );\n }\n const candidates = [\n path.join(projectDir, \"src-tauri\", \"target\", \"debug\", \"ph-win.exe\"),\n path.join(projectDir, \"src-tauri\", \"target\", \"release\", \"ph-win.exe\"),\n path.join(projectDir, \"src-tauri\", \"target\", \"debug\", \"ph-win\"),\n path.join(projectDir, \"src-tauri\", \"target\", \"release\", \"ph-win\"),\n ];\n const exe = candidates.find((c) => fs.existsSync(c));\n return { projectDir, exe };\n}\n\n/** Resolve the project's ph-cli entry from ITS dependency tree — the same\n * resolution `ph run` itself uses. */\nexport function resolvePhCliEntry(projectRoot: string): string {\n const require_ = createRequire(\n pathToFileURL(path.join(projectRoot, \"package.json\")).href,\n );\n const pkgPath = require_.resolve(\"@powerhousedao/ph-cli/package.json\");\n return path.join(path.dirname(pkgPath), \"dist\", \"cli.mjs\");\n}\n\n/** The env trio (plus flag and userData) the shell's uniform-runners mode\n * reads — wired by the RUNNER so nobody exports variables by hand. */\nexport function shellEnv(\n projectRoot: string,\n connectPort: number,\n env: Record<string, string | undefined>,\n): Record<string, string> {\n return {\n FEATURE_UNIFORM_RUNNERS_ENABLED: \"1\",\n PH_RUN_PROJECT: projectRoot,\n PH_RUN_CLI: resolvePhCliEntry(projectRoot),\n PH_WIN_CONNECT_PORT: String(connectPort),\n ...(env.PH_USER_DATA_DIR ? { PH_USER_DATA_DIR: env.PH_USER_DATA_DIR } : {}),\n };\n}\n\n/** Project host shell options onto a tauri `--config` merge patch (D6.d) —\n * the host file stays the single source for app identity on tauri-cli\n * invocations; a built exe has these baked. */\nexport function tauriConfigPatch(\n options: ShellOptions | undefined,\n): Record<string, unknown> | undefined {\n if (!options) return undefined;\n const patch: Record<string, unknown> = {};\n if (options.window) {\n patch.app = {\n windows: [\n {\n ...(options.window.title ? { title: options.window.title } : {}),\n ...(options.window.width ? { width: options.window.width } : {}),\n ...(options.window.height ? { height: options.window.height } : {}),\n },\n ],\n };\n }\n if (options.fileAssociations?.length) {\n patch.bundle = {\n fileAssociations: [\n {\n ext: options.fileAssociations.map((e) => e.replace(/^\\./, \"\")),\n name: \"Powerhouse Document\",\n },\n ],\n };\n }\n return Object.keys(patch).length > 0 ? patch : undefined;\n}\n\nexport function launchShell(\n shell: ResolvedShell,\n envVars: Record<string, string>,\n options: ShellOptions | undefined,\n): ChildProcess {\n if (shell.exe) {\n return spawn(shell.exe, [], {\n cwd: shell.projectDir,\n env: { ...process.env, ...envVars },\n stdio: \"inherit\",\n windowsHide: true,\n });\n }\n // tauri dev (needs cargo); config projection applies here.\n const patch = tauriConfigPatch(options);\n const args = [\"tauri\", \"dev\"];\n if (patch) args.push(\"--config\", JSON.stringify(patch));\n return spawn(\"pnpm\", args, {\n cwd: shell.projectDir,\n env: { ...process.env, ...envVars },\n stdio: \"inherit\",\n shell: true,\n windowsHide: true,\n });\n}\n"],"mappings":";;;;;;AA8CA,SAAS,aAAa,MAAc,IAAqB;CACvD,IAAI,CAAC,GAAG,WAAW,IAAI,GAAG,OAAO;CACjC,GAAG,OAAO,MAAM,IAAI,EAAE,WAAW,KAAK,CAAC;CACvC,OAAO;AACT;AAEA,SAAgB,YAAY,SAAgD;CAC1E,MAAM,MAAM,QAAQ,UAAU,QAAQ;CACtC,MAAM,WAAW,KAAK,KAAK,QAAQ,iBAAiB,YAAY;CAIhE,KAAK,MAAM,SAAS;EAClB;EACA;EACA;EACA;EACA;CACF,GACE,GAAG,OAAO,KAAK,KAAK,UAAU,KAAK,GAAG;EAAE,WAAW;EAAM,OAAO;CAAK,CAAC;CAExE,GAAG,UAAU,UAAU,EAAE,WAAW,KAAK,CAAC;CAE1C,KAAK,MAAM,OAAO;EAAC;EAAS;EAAU;CAAM,GAK1C,IAAI,KAAK,IAAI,IAJE,aACb,KAAK,KAAK,QAAQ,aAAa,GAAG,GAClC,KAAK,KAAK,UAAU,GAAG,CAEH,IAAI,WAAW,oBAAoB;CAM3D,MAAM,oBAAoB,KAAK,KAAK,UAAU,SAAS,WAAW,SAAS;CAC3E,IAAI,GAAG,WAAW,iBAAiB,GAAG;EACpC,MAAM,SAAS,GAAG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AAQ,OAAO,SAAS,EAAE,QAAQ,QAAQ,OAAO,OAAO,IAAI,CAAC;CACnE,CACF,EACF;CAEF,IAAI,QAAQ,kBAAkB,QAC5B,MAAM,SAAS,EACb,kBAAkB,CAChB;EACE,KAAK,QAAQ,iBAAiB,KAAK,MAAM,EAAE,QAAQ,OAAO,EAAE,CAAC;EAC7D,MAAM;CACR,CACF,EACF;CAEF,OAAO,OAAO,KAAK,KAAK,CAAC,CAAC,SAAS,IAAI,QAAQ,KAAA;AACjD;AAEA,SAAgB,YACd,OACA,SACA,SACc;CACd,IAAI,MAAM,KACR,OAAO,MAAM,MAAM,KAAK,CAAC,GAAG;EAC1B,KAAK,MAAM;EACX,KAAK;GAAE,GAAG,QAAQ;GAAK,GAAG;EAAQ;EAClC,OAAO;EACP,aAAa;CACf,CAAC;CAGH,MAAM,QAAQ,iBAAiB,OAAO;CACtC,MAAM,OAAO,CAAC,SAAS,KAAK;CAC5B,IAAI,OAAO,KAAK,KAAK,YAAY,KAAK,UAAU,KAAK,CAAC;CACtD,OAAO,MAAM,QAAQ,MAAM;EACzB,KAAK,MAAM;EACX,KAAK;GAAE,GAAG,QAAQ;GAAK,GAAG;EAAQ;EAClC,OAAO;EACP,OAAO;EACP,aAAa;CACf,CAAC;AACH"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@powerhousedao/desktop",
3
- "version": "6.2.3-dev.57",
3
+ "version": "6.2.3-dev.58",
4
4
  "description": "The desktop runner for uniform-runners hosts: the generic compound stack wrapped in a native shell — dev opens the window, build stages the shippable stack.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -30,7 +30,7 @@
30
30
  "./package.json": "./package.json"
31
31
  },
32
32
  "dependencies": {
33
- "@powerhousedao/host-core": "6.2.3-dev.57",
33
+ "@powerhousedao/host-core": "6.2.3-dev.58",
34
34
  "zod": "4.3.6"
35
35
  },
36
36
  "devDependencies": {