@powerhousedao/ph-run 6.2.3-dev.90 → 6.2.3-dev.92
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/dist/runners/connect.d.mts +6 -0
- package/dist/runners/connect.d.mts.map +1 -1
- package/dist/runners/connect.mjs +3 -3
- package/dist/runners/connect.mjs.map +1 -1
- package/dist/runners/member-config.d.mts +4 -0
- package/dist/runners/member-config.d.mts.map +1 -1
- package/dist/runners/switchboard.d.mts +10 -0
- package/dist/runners/switchboard.d.mts.map +1 -1
- package/package.json +7 -7
|
@@ -69,6 +69,7 @@ export declare const declaredHostSchema: z.ZodObject<{
|
|
|
69
69
|
authEnforcement: z.ZodOptional<z.ZodBoolean>;
|
|
70
70
|
authGroups: z.ZodOptional<z.ZodBoolean>;
|
|
71
71
|
authConditions: z.ZodOptional<z.ZodBoolean>;
|
|
72
|
+
undoV3: z.ZodOptional<z.ZodBoolean>;
|
|
72
73
|
}, z.core.$strict>>;
|
|
73
74
|
createSignaturePolicy: z.ZodOptional<z.ZodEnum<{
|
|
74
75
|
legacy: "legacy";
|
|
@@ -218,6 +219,7 @@ export declare const declaredHostSchema: z.ZodObject<{
|
|
|
218
219
|
authEnforcement: z.ZodOptional<z.ZodBoolean>;
|
|
219
220
|
authGroups: z.ZodOptional<z.ZodBoolean>;
|
|
220
221
|
authConditions: z.ZodOptional<z.ZodBoolean>;
|
|
222
|
+
undoV3: z.ZodOptional<z.ZodBoolean>;
|
|
221
223
|
}, z.core.$strict>>;
|
|
222
224
|
createSignaturePolicy: z.ZodOptional<z.ZodEnum<{
|
|
223
225
|
legacy: "legacy";
|
|
@@ -435,6 +437,7 @@ export declare const hostSchema: z.ZodObject<{
|
|
|
435
437
|
authEnforcement: z.ZodOptional<z.ZodBoolean>;
|
|
436
438
|
authGroups: z.ZodOptional<z.ZodBoolean>;
|
|
437
439
|
authConditions: z.ZodOptional<z.ZodBoolean>;
|
|
440
|
+
undoV3: z.ZodOptional<z.ZodBoolean>;
|
|
438
441
|
}, z.core.$strict>>;
|
|
439
442
|
createSignaturePolicy: z.ZodOptional<z.ZodEnum<{
|
|
440
443
|
legacy: "legacy";
|
|
@@ -584,6 +587,7 @@ export declare const hostSchema: z.ZodObject<{
|
|
|
584
587
|
authEnforcement: z.ZodOptional<z.ZodBoolean>;
|
|
585
588
|
authGroups: z.ZodOptional<z.ZodBoolean>;
|
|
586
589
|
authConditions: z.ZodOptional<z.ZodBoolean>;
|
|
590
|
+
undoV3: z.ZodOptional<z.ZodBoolean>;
|
|
587
591
|
}, z.core.$strict>>;
|
|
588
592
|
createSignaturePolicy: z.ZodOptional<z.ZodEnum<{
|
|
589
593
|
legacy: "legacy";
|
|
@@ -891,6 +895,7 @@ export declare function withoutBuiltImages(config: PHConnectRuntimeConfig | unde
|
|
|
891
895
|
authEnforcement?: boolean | undefined;
|
|
892
896
|
authGroups?: boolean | undefined;
|
|
893
897
|
authConditions?: boolean | undefined;
|
|
898
|
+
undoV3?: boolean | undefined;
|
|
894
899
|
} | undefined;
|
|
895
900
|
createSignaturePolicy?: "legacy" | "v2-required" | undefined;
|
|
896
901
|
unsupportedStoredDocuments?: "read-only" | "refuse" | undefined;
|
|
@@ -1103,6 +1108,7 @@ export declare function withoutBuiltImages(config: PHConnectRuntimeConfig | unde
|
|
|
1103
1108
|
authEnforcement?: boolean | undefined;
|
|
1104
1109
|
authGroups?: boolean | undefined;
|
|
1105
1110
|
authConditions?: boolean | undefined;
|
|
1111
|
+
undoV3?: boolean | undefined;
|
|
1106
1112
|
} | undefined;
|
|
1107
1113
|
createSignaturePolicy?: "legacy" | "v2-required" | undefined;
|
|
1108
1114
|
unsupportedStoredDocuments?: "read-only" | "refuse" | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connect.d.mts","names":[],"sources":["../../src/runners/connect.ts"],"mappings":";;;;;;;;;;;;qBAuCa;qBA0CA,oBAAkB,EAAA
|
|
1
|
+
{"version":3,"file":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;;;wBAMK,cACd,QAAQ,iBACR;EAAa;EAAc;IAC1B,aAAa;;;;;;;;;wBAiDA,eACd,MAAM,mBACN,MAAM,eACN,gBACC;;;;;;;wBAsJmB,qBAAqB,GACzC,KAAK,eACL,aAAa,QAAQ,KACpB,QAAQ;;;wBAqBW,oBACpB,MAAM,mBACN,KAAK,gBACJ;wBAsBa,mBAAmB,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YAU/B,sBACV,MAAM,oBACN,WAAW,sBACX,kBACA;EAAY;MACT,QAAQ;;;;;;;wBAQS,UACpB,OAAO,oBACP,MAAM,mBACN,KAAK,gBACJ,QAAQ,aAAa;;;wBAmCF,MACpB,MAAM,mBACN,KAAK,gBACJ,QAAQ,aAAa;;qBAMX,YAAG;qBAEH"}
|
package/dist/runners/connect.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="1afe3171-4423-5b61-896d-d2141ebf418a")}catch(e){}}();
|
|
3
3
|
import { defineHostSchemas, entryActiveForVerb, findDeadConnectConfig, isStructuralMultiReactor, mergeDefaultDrives, normalizePluginEntries, placeConnectDrives, projectDrivesIntoConnect, projectReactorToConnect, refineConnectReactor, remoteBackendUrls, resolveDriveDeclaration } from "@powerhousedao/host-core";
|
|
4
4
|
import { DEFAULT_CONNECT_OUTDIR, DEFAULT_CONNECT_STUDIO_PORT } from "@powerhousedao/shared/clis";
|
|
5
5
|
import { connectConfigSchemaWith } from "@powerhousedao/shared/connect/connect-config-schema";
|
|
@@ -151,7 +151,7 @@ function callerOverrideRaw(host, ctx, verb = "dev") {
|
|
|
151
151
|
};
|
|
152
152
|
const { connect } = projectReactorToConnect(reactor);
|
|
153
153
|
const structural = isStructuralMultiReactor(reactor);
|
|
154
|
-
if (!connect.reactor && !connect.instance && !connect.app && !structural) return host.config !== void 0 || composition || declaredDefaults ? base : void 0;
|
|
154
|
+
if (!connect.reactor && !connect.instance && !connect.app && !structural) return host.config !== void 0 || composition || declaredDefaults || base.renown !== void 0 || base.instance !== void 0 ? base : void 0;
|
|
155
155
|
const projected = structural ? projectDrivesIntoConnect({
|
|
156
156
|
createdDriveUrls: remoteBackendUrls(reactor),
|
|
157
157
|
configuredDefaultDrives: base.drives?.defaultDrives
|
|
@@ -268,4 +268,4 @@ const verbs = ["run", "serve"];
|
|
|
268
268
|
export { callerOverride, connectHandle, declaredHostSchema, hostSchema, kind, outputsSchema, run, serve, serveWith, startUnderSupervisor, validateComposition, verbs, withoutBuiltImages };
|
|
269
269
|
|
|
270
270
|
//# sourceMappingURL=connect.mjs.map
|
|
271
|
-
//# debugId=
|
|
271
|
+
//# debugId=1afe3171-4423-5b61-896d-d2141ebf418a
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connect.mjs","sources":["../../src/runners/connect.ts"],"sourcesContent":["import {\n DEFAULT_CONNECT_OUTDIR,\n DEFAULT_CONNECT_STUDIO_PORT,\n type PHConnectCompositionEntry,\n type PHConnectDefaultDrive,\n type PHConnectRuntimeConfig,\n} from \"@powerhousedao/shared/clis\";\nimport { connectConfigSchemaWith } from \"@powerhousedao/shared/connect/connect-config-schema\";\nimport { isPassthroughImageRef } from \"@powerhousedao/shared/connect/image-ref\";\nimport { withOriginPlaceholders } from \"@powerhousedao/shared/connect/origin-placeholder\";\nimport {\n defineHostSchemas,\n entryActiveForVerb,\n findDeadConnectConfig,\n isStructuralMultiReactor,\n mergeDefaultDrives,\n normalizePluginEntries,\n placeConnectDrives,\n resolveDriveDeclaration,\n type DriveDeclaration,\n projectDrivesIntoConnect,\n projectReactorToConnect,\n refineConnectReactor,\n remoteBackendUrls,\n type ReactorConfig,\n type RunnerContext,\n type RunnerHandle,\n} from \"@powerhousedao/host-core\";\nimport { z } from \"zod\";\nimport type { ConnectPreviewArgs } from \"../services/classic-args.js\";\nimport type { ConnectServeOverride } from \"../services/connect-serve.js\";\n\n/**\n * BRIDGE runner for Connect hosts (uniform-runners phase 0): maps a\n * hosts/connect/host.js definition onto the SAME service the classic\n * `ph connect studio` (dev/run), `ph connect build` and `ph connect preview`\n * (serve) commands call — no forked behavior.\n */\n\nexport const kind = \"reactor\";\n\n/** The connect host: the host-core reactor host with every runner option\n * this module reads declared (strict: an unknown runner key fails), and\n * `config` typed by Connect's own zod schema (the authored `connect` block),\n * whose URL fields that name another host's outputs\n * (`drives.defaultDrives[].url`, `renown.switchboardUrl`) are token-able.\n * One definition, two schemas: `declaredHostSchema` (token-able fields take\n * output tokens; types host files) and `hostSchema` (resolved; checked\n * right before the verb). */\nconst schemas = defineHostSchemas((s) =>\n s.reactorHostSchema\n .extend({\n runner: s.runnerBaseSchema\n .extend({\n /** Open a browser tab once listening (dev/serve). */\n openBrowser: z.boolean().optional(),\n /** Fail instead of moving to the next free port when `port` is taken. */\n strictPort: z.boolean().optional(),\n /** The Connect build output dir (`build` writes it, `serve` serves it). */\n outDir: z.string().min(1).optional(),\n /** Patch the baked CSP for the runtime registry (`serve`); a\n * compound's wiring sets it on its connect member. */\n cspRegistrySync: z.boolean().optional(),\n /** The host's routes folder, project-relative; false for none.\n * Default: hosts/connect/routes. */\n routes: z.union([z.string(), z.literal(false)]).optional(),\n /** The switchboard this Connect is served next to: its server\n * (dev and serve) proxies the switchboard's paths (`/graphql`,\n * `/d/*`, `/attachments`, `/mcp`, `/api/*`) to `target`, and the\n * served config names that switchboard as `${origin}`, resolved by\n * the browser against the page's origin. So one config holds from\n * the developer's `localhost` and from a published site alike, with\n * every call on the page's own origin. Typically a sibling's\n * `origin` output token. */\n proxy: z.strictObject({ target: s.tokenable(z.url()) }).optional(),\n })\n .strict(),\n config: connectConfigSchemaWith(s.tokenable).optional(),\n })\n .superRefine(refineConnectReactor),\n);\nexport const declaredHostSchema = schemas.declaredHostSchema;\nexport const hostSchema = schemas.hostSchema;\n\n/** What a connect host.js author writes. */\nexport type ConnectHost = z.input<typeof declaredHostSchema>;\n/** What a verb receives (defaults applied). */\nexport type ConnectHostParsed = z.output<typeof hostSchema>;\n\n/** What a started Connect (`dev`/`run`/`serve`) produces: the origin it\n * actually listens on and the app URL (origin plus base path). */\nexport const outputsSchema = z.strictObject({\n origin: z.url(),\n endpoints: z.strictObject({ connect: z.url() }),\n});\nexport type ConnectOutputs = z.infer<typeof outputsSchema>;\n\ndeclare global {\n interface PHHostRunners {\n \"@powerhousedao/ph-cli/runners/connect\": {\n host: ConnectHost;\n outputs: ConnectOutputs;\n };\n }\n}\n\n/** The slice of a vite dev/preview server a handle needs. */\nexport interface ListeningServer {\n resolvedUrls: { local: string[] } | null;\n close(): Promise<void>;\n}\n\n/** A started Connect as a runner handle. vite has already listened when the\n * service returns, so `ready` is settled; the outputs carry the URL vite\n * resolved (the port it actually bound), falling back to the requested one. */\nexport function connectHandle(\n server: ListeningServer,\n requested: { host: string; port: number },\n): RunnerHandle<ConnectOutputs> {\n const fallback = `http://${requested.host}:${requested.port}/`;\n const app = server.resolvedUrls?.local[0] ?? fallback;\n let closing: Promise<void> | undefined;\n return {\n outputs: outputsSchema.parse({\n origin: new URL(app).origin,\n endpoints: { connect: app },\n }),\n ready: Promise.resolve(),\n shutdown: () => (closing ??= server.close()),\n };\n}\n\n/** host.js reactor.drives -> the served drives.defaultDrives shapes: locals\n * carry id/name/icon and the preferredEditor under its Connect alias `app`;\n * remotes carry their URL. */\nfunction declaredDrivesToDefaults(\n projectRoot: string,\n declarations: readonly DriveDeclaration[],\n): PHConnectDefaultDrive[] {\n return declarations.map((declaration) => {\n const drive = resolveDriveDeclaration(projectRoot, declaration);\n if (drive.kind === \"remote\") {\n return {\n url: drive.remoteUrl!,\n name: drive.name,\n icon: drive.icon ?? null,\n };\n }\n return {\n local: true as const,\n // A local drive is skipped on later boots by this id, so it stays fixed.\n id: drive.id ?? drive.slug,\n name: drive.name,\n icon: drive.icon ?? null,\n ...(drive.preferredEditor ? { app: drive.preferredEditor } : {}),\n };\n });\n}\n\n/**\n * The served override. With `runner.proxy`, every URL on the proxied\n * switchboard's origin (drives, backends, plugin configs, however they were\n * written or resolved from output tokens) is served as `${origin}…`: the\n * browser reaches the switchboard through the page's own origin, which this\n * Connect's server proxies, so the config holds wherever the page is loaded\n * from. A host may also write `${origin}/…` itself; that passes through.\n */\nexport function callerOverride(\n host: ConnectHostParsed,\n ctx?: RunnerContext,\n verb = \"dev\",\n): PHConnectRuntimeConfig | undefined {\n const override = callerOverrideRaw(host, ctx, verb);\n const target = host.runner.proxy?.target;\n return override && target\n ? withOriginPlaceholders(override, target)\n : override;\n}\n\nfunction callerOverrideRaw(\n host: ConnectHostParsed,\n ctx?: RunnerContext,\n verb = \"dev\",\n): PHConnectRuntimeConfig | undefined {\n // A copy: the projection below adds served-only keys (composition, …).\n const base: PHConnectRuntimeConfig = { ...host.config };\n const reactor: ReactorConfig | undefined = host.reactor;\n\n // The Renown instance a person chose at start, under the names the\n // switchboard reads, so the two can't disagree.\n const renownUrl = ctx?.env.RENOWN_URL?.trim();\n const renownSwitchboardUrl = ctx?.env.SWITCHBOARD_URL?.trim();\n if (renownUrl || renownSwitchboardUrl) {\n base.renown = {\n ...base.renown,\n ...(renownUrl ? { url: renownUrl } : {}),\n ...(renownSwitchboardUrl ? { switchboardUrl: renownSwitchboardUrl } : {}),\n };\n }\n\n // R3: the composition (verb-filtered, projected as DATA — the browser\n // pipeline resolves and runs the entries), declared drives, and the\n // reactor-core identity/namespace keys.\n const entries = host.runner.plugins;\n const composition: PHConnectCompositionEntry[] | undefined =\n entries === undefined\n ? undefined\n : normalizePluginEntries(entries, `hosts/${host.name}/host.js`)\n .filter((entry) => entryActiveForVerb(entry, verb))\n .map((entry) => ({ module: entry.module, config: entry.config }));\n // Entry configs arrive RESOLVED: output tokens (e.g. the workflows\n // plugin's `drive: switchboard.drives.workflows.url`) were replaced by\n // `ph run` (standalone: the producer's run record; in a compound: the\n // member's live outputs) before validateHost let this verb run.\n if (entries !== undefined) {\n // Change 2: show the composition plan on the `ph run connect` terminal.\n // The pipeline itself runs in the browser (hook execution logs to the\n // browser console); here we report WHAT will be served and for which verb.\n const all = normalizePluginEntries(entries, `hosts/${host.name}/host.js`);\n console.log(\n `[connect] composition plan (verb=${verb}): ${composition?.length ?? 0} active of ${all.length} declared`,\n );\n for (const entry of all) {\n const active = entryActiveForVerb(entry, verb);\n const scope =\n entry.verbs === \"*\" ? \"\" : ` verbs=[${entry.verbs.join(\",\")}]`;\n const cfg = Object.keys(entry.config);\n console.log(\n `[connect] ${active ? \"•\" : \"○\"} ${entry.module}${scope}` +\n (cfg.length ? ` config: {${cfg.join(\", \")}}` : \"\") +\n (active ? \"\" : \" (inactive for this verb)\"),\n );\n }\n }\n // Config a Connect plugin owns, set on the host while that plugin is not\n // composed for this verb: Connect serves the plugin-absent value instead.\n for (const warning of findDeadConnectConfig(\n host.config,\n entries,\n verb,\n `hosts/${host.name}/host.js`,\n )) {\n console.warn(warning.message);\n }\n const declared = reactor?.drives;\n const declaredDefaults =\n declared && ctx\n ? declaredDrivesToDefaults(ctx.projectRoot, declared)\n : undefined;\n const reactorRenown = reactor?.renown;\n const reactorNamespace = reactor?.namespace;\n base.drives = declaredDefaults\n ? {\n ...base.drives,\n defaultDrives: mergeDefaultDrives(\n declaredDefaults,\n base.drives?.defaultDrives ?? [],\n ),\n preserveStrategy: base.drives?.preserveStrategy ?? \"preserve-all\",\n }\n : base.drives;\n if (composition) base.composition = composition;\n if (reactorRenown) base.renown = { ...reactorRenown, ...base.renown };\n if (reactorNamespace !== undefined)\n base.instance = {\n ...base.instance,\n namespace: base.instance?.namespace ?? reactorNamespace,\n } as typeof base.instance;\n const { connect } = projectReactorToConnect(reactor);\n const structural = isStructuralMultiReactor(reactor);\n if (!connect.reactor && !connect.instance && !connect.app && !structural) {\n // `base` IS host.config when the host has one; a host without a config\n // block still carries its composition and drives (set on `base` above).\n // With none of the three, there is no override: a classic build.\n return host.config !== undefined || composition || declaredDefaults\n ? base\n : undefined;\n }\n const projected = structural\n ? projectDrivesIntoConnect({\n createdDriveUrls: remoteBackendUrls(reactor),\n configuredDefaultDrives: base.drives?.defaultDrives,\n }).drives\n : base.drives;\n const placed = placeConnectDrives(reactor, projected?.defaultDrives ?? []);\n const drives =\n projected?.defaultDrives === undefined\n ? projected\n : { ...projected, defaultDrives: placed.defaultDrives };\n // When the host DECLARES backends, instance facts derive from them and win\n // over config defaults (declaring `kind: \"worker\"` is more explicit intent\n // than a scaffold's `reactorWorker: false`); without backends the P2 rule\n // stands — an explicit connect.* value wins over descriptive projection.\n const declaresBackends = Object.keys(reactor?.backends ?? {}).length > 0;\n const instance = declaresBackends\n ? {\n ...base.instance,\n ...connect.instance,\n ...(placed.collections ? { collections: placed.collections } : {}),\n }\n : { ...connect.instance, ...base.instance };\n return {\n ...base,\n reactor: { ...connect.reactor, ...base.reactor },\n instance: instance as never,\n app: { ...connect.app, ...base.app },\n ...(drives ? { drives: { ...base.drives, ...drives } } : {}),\n };\n}\n\n/**\n * Start a server; under a supervising compound (`ctx.parent`), drop the\n * process-exiting signal listeners it installed (vite's dev and preview\n * servers exit on SIGTERM): the compound owns the exit and stops members in\n * reverse dependency order through their handles.\n */\nexport async function startUnderSupervisor<T>(\n ctx: RunnerContext,\n start: () => Promise<T>,\n): Promise<T> {\n if (!ctx.parent) return start();\n const signals = [\"SIGINT\", \"SIGTERM\"] as const;\n const before = new Map(\n signals.map((signal) => [signal, new Set(process.listeners(signal))]),\n );\n try {\n return await start();\n } finally {\n for (const signal of signals) {\n for (const listener of process.listeners(signal)) {\n if (!before.get(signal)?.has(listener)) {\n process.off(signal, listener);\n }\n }\n }\n }\n}\n\n/** Fail at `ph run`, naming the plugin and key, when a composed Connect\n * plugin's entry config does not match its schema. */\nexport async function validateComposition(\n host: ConnectHostParsed,\n ctx: RunnerContext,\n): Promise<void> {\n const { validateConnectPluginConfigs } =\n await import(\"./connect-plugin-configs.js\");\n await validateConnectPluginConfigs(\n ctx.projectRoot,\n host.runner.plugins,\n ctx.verb,\n `hosts/${host.name}/host.js`,\n );\n}\n\n/** A project file the build resolved: the built dist has it (as icon.ico or\n * a data URI); served, its path would mean nothing. */\nfunction isBuiltImage(ref: unknown): boolean {\n const src =\n typeof ref === \"object\" && ref !== null && \"src\" in ref ? ref.src : ref;\n return typeof src === \"string\" && !isPassthroughImageRef(src);\n}\n\n// The served config keeps the build's images: the favicon and any branding\n// image given as a project path were resolved into the dist, and merged over\n// it a path would replace the built data URI with a URL that 404s.\nexport function withoutBuiltImages(config: PHConnectRuntimeConfig | undefined) {\n const branding = config?.branding;\n if (!branding) return config;\n const { favicon: _, ...served } = branding;\n if (isBuiltImage(served.icon)) delete served.icon;\n if (isBuiltImage(served.loader)) delete served.loader;\n return { ...config, branding: served };\n}\n\n/** A server for a built Connect, given what to serve and how. */\nexport type ConnectServerStart = (\n args: ConnectPreviewArgs,\n override?: ConnectServeOverride,\n dirname?: string,\n options?: { proxy?: string },\n) => Promise<ListeningServer>;\n\n/** `serve` on a given server. The host's connect config (including a\n * supervising compound's projected drives and the reactor projection) rides a\n * serve override: the baked powerhouse.config.json merges with it at request\n * time, and `runner.cspRegistrySync` (set by the compound's wiring) patches the\n * baked CSP's script-src for the runtime registry. Together these replace the\n * ph-win-desktop sidecar's hand-rolled static server (desktop shape). */\nexport async function serveWith(\n start: ConnectServerStart,\n host: ConnectHostParsed,\n ctx: RunnerContext,\n): Promise<RunnerHandle<ConnectOutputs>> {\n await validateComposition(host, ctx);\n const runner = host.runner;\n const port = runner.port ?? DEFAULT_CONNECT_STUDIO_PORT;\n const bind = runner.host ?? \"127.0.0.1\";\n const args: Partial<ConnectPreviewArgs> = {\n port,\n outDir: runner.outDir ?? DEFAULT_CONNECT_OUTDIR,\n open: runner.openBrowser === true,\n strictPort: runner.strictPort === true,\n cors: true,\n printUrls: true,\n bindCLIShortcuts: false,\n // Explicit IPv4 loopback (runner.host overrides): vite's default\n // \"localhost\" can bind ::1 only on Windows, and a supervising shell\n // (ph-win) probes 127.0.0.1 — the sidecar this replaces bound 127.0.0.1.\n host: bind,\n };\n const override = withoutBuiltImages(callerOverride(host, ctx, ctx.verb));\n const server = await startUnderSupervisor<ListeningServer>(ctx, () =>\n start(\n args as ConnectPreviewArgs,\n {\n connect: override,\n cspRegistrySync: runner.cspRegistrySync === true,\n },\n undefined,\n { proxy: runner.proxy?.target },\n ),\n );\n return connectHandle(server, { host: bind, port });\n}\n\n/** Serves a built Connect (run `build` first) with nothing but what a running\n * app has. ph-cli's runner adds the verbs that need build tools. */\nexport async function serve(\n host: ConnectHostParsed,\n ctx: RunnerContext,\n): Promise<RunnerHandle<ConnectOutputs>> {\n const { runConnectServer } = await import(\"../services/connect-server.js\");\n return serveWith(runConnectServer, host, ctx);\n}\n\n/** With no Studio here, running Connect is serving its build. */\nexport const run = serve;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MAAM,OAAO;CAC1C,OAAO,UAAU,kBAAkB,MAAM,GAAG;AAC9C;;AAGA,MAAa,MAAM;AAEnB,MAAa,QAAQ,CAAC,OAAO,OAAO","debug_id":"64674726-f10e-55e9-b178-dd7eb54b6e63"}
|
|
1
|
+
{"version":3,"file":"connect.mjs","sources":["../../src/runners/connect.ts"],"sourcesContent":["import {\n DEFAULT_CONNECT_OUTDIR,\n DEFAULT_CONNECT_STUDIO_PORT,\n type PHConnectCompositionEntry,\n type PHConnectDefaultDrive,\n type PHConnectRuntimeConfig,\n} from \"@powerhousedao/shared/clis\";\nimport { connectConfigSchemaWith } from \"@powerhousedao/shared/connect/connect-config-schema\";\nimport { isPassthroughImageRef } from \"@powerhousedao/shared/connect/image-ref\";\nimport { withOriginPlaceholders } from \"@powerhousedao/shared/connect/origin-placeholder\";\nimport {\n defineHostSchemas,\n entryActiveForVerb,\n findDeadConnectConfig,\n isStructuralMultiReactor,\n mergeDefaultDrives,\n normalizePluginEntries,\n placeConnectDrives,\n resolveDriveDeclaration,\n type DriveDeclaration,\n projectDrivesIntoConnect,\n projectReactorToConnect,\n refineConnectReactor,\n remoteBackendUrls,\n type ReactorConfig,\n type RunnerContext,\n type RunnerHandle,\n} from \"@powerhousedao/host-core\";\nimport { z } from \"zod\";\nimport type { ConnectPreviewArgs } from \"../services/classic-args.js\";\nimport type { ConnectServeOverride } from \"../services/connect-serve.js\";\n\n/**\n * BRIDGE runner for Connect hosts (uniform-runners phase 0): maps a\n * hosts/connect/host.js definition onto the SAME service the classic\n * `ph connect studio` (dev/run), `ph connect build` and `ph connect preview`\n * (serve) commands call — no forked behavior.\n */\n\nexport const kind = \"reactor\";\n\n/** The connect host: the host-core reactor host with every runner option\n * this module reads declared (strict: an unknown runner key fails), and\n * `config` typed by Connect's own zod schema (the authored `connect` block),\n * whose URL fields that name another host's outputs\n * (`drives.defaultDrives[].url`, `renown.switchboardUrl`) are token-able.\n * One definition, two schemas: `declaredHostSchema` (token-able fields take\n * output tokens; types host files) and `hostSchema` (resolved; checked\n * right before the verb). */\nconst schemas = defineHostSchemas((s) =>\n s.reactorHostSchema\n .extend({\n runner: s.runnerBaseSchema\n .extend({\n /** Open a browser tab once listening (dev/serve). */\n openBrowser: z.boolean().optional(),\n /** Fail instead of moving to the next free port when `port` is taken. */\n strictPort: z.boolean().optional(),\n /** The Connect build output dir (`build` writes it, `serve` serves it). */\n outDir: z.string().min(1).optional(),\n /** Patch the baked CSP for the runtime registry (`serve`); a\n * compound's wiring sets it on its connect member. */\n cspRegistrySync: z.boolean().optional(),\n /** The host's routes folder, project-relative; false for none.\n * Default: hosts/connect/routes. */\n routes: z.union([z.string(), z.literal(false)]).optional(),\n /** The switchboard this Connect is served next to: its server\n * (dev and serve) proxies the switchboard's paths (`/graphql`,\n * `/d/*`, `/attachments`, `/mcp`, `/api/*`) to `target`, and the\n * served config names that switchboard as `${origin}`, resolved by\n * the browser against the page's origin. So one config holds from\n * the developer's `localhost` and from a published site alike, with\n * every call on the page's own origin. Typically a sibling's\n * `origin` output token. */\n proxy: z.strictObject({ target: s.tokenable(z.url()) }).optional(),\n })\n .strict(),\n config: connectConfigSchemaWith(s.tokenable).optional(),\n })\n .superRefine(refineConnectReactor),\n);\nexport const declaredHostSchema = schemas.declaredHostSchema;\nexport const hostSchema = schemas.hostSchema;\n\n/** What a connect host.js author writes. */\nexport type ConnectHost = z.input<typeof declaredHostSchema>;\n/** What a verb receives (defaults applied). */\nexport type ConnectHostParsed = z.output<typeof hostSchema>;\n\n/** What a started Connect (`dev`/`run`/`serve`) produces: the origin it\n * actually listens on and the app URL (origin plus base path). */\nexport const outputsSchema = z.strictObject({\n origin: z.url(),\n endpoints: z.strictObject({ connect: z.url() }),\n});\nexport type ConnectOutputs = z.infer<typeof outputsSchema>;\n\ndeclare global {\n interface PHHostRunners {\n \"@powerhousedao/ph-cli/runners/connect\": {\n host: ConnectHost;\n outputs: ConnectOutputs;\n };\n }\n}\n\n/** The slice of a vite dev/preview server a handle needs. */\nexport interface ListeningServer {\n resolvedUrls: { local: string[] } | null;\n close(): Promise<void>;\n}\n\n/** A started Connect as a runner handle. vite has already listened when the\n * service returns, so `ready` is settled; the outputs carry the URL vite\n * resolved (the port it actually bound), falling back to the requested one. */\nexport function connectHandle(\n server: ListeningServer,\n requested: { host: string; port: number },\n): RunnerHandle<ConnectOutputs> {\n const fallback = `http://${requested.host}:${requested.port}/`;\n const app = server.resolvedUrls?.local[0] ?? fallback;\n let closing: Promise<void> | undefined;\n return {\n outputs: outputsSchema.parse({\n origin: new URL(app).origin,\n endpoints: { connect: app },\n }),\n ready: Promise.resolve(),\n shutdown: () => (closing ??= server.close()),\n };\n}\n\n/** host.js reactor.drives -> the served drives.defaultDrives shapes: locals\n * carry id/name/icon and the preferredEditor under its Connect alias `app`;\n * remotes carry their URL. */\nfunction declaredDrivesToDefaults(\n projectRoot: string,\n declarations: readonly DriveDeclaration[],\n): PHConnectDefaultDrive[] {\n return declarations.map((declaration) => {\n const drive = resolveDriveDeclaration(projectRoot, declaration);\n if (drive.kind === \"remote\") {\n return {\n url: drive.remoteUrl!,\n name: drive.name,\n icon: drive.icon ?? null,\n };\n }\n return {\n local: true as const,\n // A local drive is skipped on later boots by this id, so it stays fixed.\n id: drive.id ?? drive.slug,\n name: drive.name,\n icon: drive.icon ?? null,\n ...(drive.preferredEditor ? { app: drive.preferredEditor } : {}),\n };\n });\n}\n\n/**\n * The served override. With `runner.proxy`, every URL on the proxied\n * switchboard's origin (drives, backends, plugin configs, however they were\n * written or resolved from output tokens) is served as `${origin}…`: the\n * browser reaches the switchboard through the page's own origin, which this\n * Connect's server proxies, so the config holds wherever the page is loaded\n * from. A host may also write `${origin}/…` itself; that passes through.\n */\nexport function callerOverride(\n host: ConnectHostParsed,\n ctx?: RunnerContext,\n verb = \"dev\",\n): PHConnectRuntimeConfig | undefined {\n const override = callerOverrideRaw(host, ctx, verb);\n const target = host.runner.proxy?.target;\n return override && target\n ? withOriginPlaceholders(override, target)\n : override;\n}\n\nfunction callerOverrideRaw(\n host: ConnectHostParsed,\n ctx?: RunnerContext,\n verb = \"dev\",\n): PHConnectRuntimeConfig | undefined {\n // A copy: the projection below adds served-only keys (composition, …).\n const base: PHConnectRuntimeConfig = { ...host.config };\n const reactor: ReactorConfig | undefined = host.reactor;\n\n // The Renown instance a person chose at start, under the names the\n // switchboard reads, so the two can't disagree.\n const renownUrl = ctx?.env.RENOWN_URL?.trim();\n const renownSwitchboardUrl = ctx?.env.SWITCHBOARD_URL?.trim();\n if (renownUrl || renownSwitchboardUrl) {\n base.renown = {\n ...base.renown,\n ...(renownUrl ? { url: renownUrl } : {}),\n ...(renownSwitchboardUrl ? { switchboardUrl: renownSwitchboardUrl } : {}),\n };\n }\n\n // R3: the composition (verb-filtered, projected as DATA — the browser\n // pipeline resolves and runs the entries), declared drives, and the\n // reactor-core identity/namespace keys.\n const entries = host.runner.plugins;\n const composition: PHConnectCompositionEntry[] | undefined =\n entries === undefined\n ? undefined\n : normalizePluginEntries(entries, `hosts/${host.name}/host.js`)\n .filter((entry) => entryActiveForVerb(entry, verb))\n .map((entry) => ({ module: entry.module, config: entry.config }));\n // Entry configs arrive RESOLVED: output tokens (e.g. the workflows\n // plugin's `drive: switchboard.drives.workflows.url`) were replaced by\n // `ph run` (standalone: the producer's run record; in a compound: the\n // member's live outputs) before validateHost let this verb run.\n if (entries !== undefined) {\n // Change 2: show the composition plan on the `ph run connect` terminal.\n // The pipeline itself runs in the browser (hook execution logs to the\n // browser console); here we report WHAT will be served and for which verb.\n const all = normalizePluginEntries(entries, `hosts/${host.name}/host.js`);\n console.log(\n `[connect] composition plan (verb=${verb}): ${composition?.length ?? 0} active of ${all.length} declared`,\n );\n for (const entry of all) {\n const active = entryActiveForVerb(entry, verb);\n const scope =\n entry.verbs === \"*\" ? \"\" : ` verbs=[${entry.verbs.join(\",\")}]`;\n const cfg = Object.keys(entry.config);\n console.log(\n `[connect] ${active ? \"•\" : \"○\"} ${entry.module}${scope}` +\n (cfg.length ? ` config: {${cfg.join(\", \")}}` : \"\") +\n (active ? \"\" : \" (inactive for this verb)\"),\n );\n }\n }\n // Config a Connect plugin owns, set on the host while that plugin is not\n // composed for this verb: Connect serves the plugin-absent value instead.\n for (const warning of findDeadConnectConfig(\n host.config,\n entries,\n verb,\n `hosts/${host.name}/host.js`,\n )) {\n console.warn(warning.message);\n }\n const declared = reactor?.drives;\n const declaredDefaults =\n declared && ctx\n ? declaredDrivesToDefaults(ctx.projectRoot, declared)\n : undefined;\n const reactorRenown = reactor?.renown;\n const reactorNamespace = reactor?.namespace;\n base.drives = declaredDefaults\n ? {\n ...base.drives,\n defaultDrives: mergeDefaultDrives(\n declaredDefaults,\n base.drives?.defaultDrives ?? [],\n ),\n preserveStrategy: base.drives?.preserveStrategy ?? \"preserve-all\",\n }\n : base.drives;\n if (composition) base.composition = composition;\n if (reactorRenown) base.renown = { ...reactorRenown, ...base.renown };\n if (reactorNamespace !== undefined)\n base.instance = {\n ...base.instance,\n namespace: base.instance?.namespace ?? reactorNamespace,\n } as typeof base.instance;\n const { connect } = projectReactorToConnect(reactor);\n const structural = isStructuralMultiReactor(reactor);\n if (!connect.reactor && !connect.instance && !connect.app && !structural) {\n // `base` IS host.config when the host has one; a host without a config\n // block still carries its composition, drives, Renown and namespace (set\n // on `base` above). With none of them, there is no override: a classic\n // build.\n return host.config !== undefined ||\n composition ||\n declaredDefaults ||\n base.renown !== undefined ||\n base.instance !== undefined\n ? base\n : undefined;\n }\n const projected = structural\n ? projectDrivesIntoConnect({\n createdDriveUrls: remoteBackendUrls(reactor),\n configuredDefaultDrives: base.drives?.defaultDrives,\n }).drives\n : base.drives;\n const placed = placeConnectDrives(reactor, projected?.defaultDrives ?? []);\n const drives =\n projected?.defaultDrives === undefined\n ? projected\n : { ...projected, defaultDrives: placed.defaultDrives };\n // When the host DECLARES backends, instance facts derive from them and win\n // over config defaults (declaring `kind: \"worker\"` is more explicit intent\n // than a scaffold's `reactorWorker: false`); without backends the P2 rule\n // stands — an explicit connect.* value wins over descriptive projection.\n const declaresBackends = Object.keys(reactor?.backends ?? {}).length > 0;\n const instance = declaresBackends\n ? {\n ...base.instance,\n ...connect.instance,\n ...(placed.collections ? { collections: placed.collections } : {}),\n }\n : { ...connect.instance, ...base.instance };\n return {\n ...base,\n reactor: { ...connect.reactor, ...base.reactor },\n instance: instance as never,\n app: { ...connect.app, ...base.app },\n ...(drives ? { drives: { ...base.drives, ...drives } } : {}),\n };\n}\n\n/**\n * Start a server; under a supervising compound (`ctx.parent`), drop the\n * process-exiting signal listeners it installed (vite's dev and preview\n * servers exit on SIGTERM): the compound owns the exit and stops members in\n * reverse dependency order through their handles.\n */\nexport async function startUnderSupervisor<T>(\n ctx: RunnerContext,\n start: () => Promise<T>,\n): Promise<T> {\n if (!ctx.parent) return start();\n const signals = [\"SIGINT\", \"SIGTERM\"] as const;\n const before = new Map(\n signals.map((signal) => [signal, new Set(process.listeners(signal))]),\n );\n try {\n return await start();\n } finally {\n for (const signal of signals) {\n for (const listener of process.listeners(signal)) {\n if (!before.get(signal)?.has(listener)) {\n process.off(signal, listener);\n }\n }\n }\n }\n}\n\n/** Fail at `ph run`, naming the plugin and key, when a composed Connect\n * plugin's entry config does not match its schema. */\nexport async function validateComposition(\n host: ConnectHostParsed,\n ctx: RunnerContext,\n): Promise<void> {\n const { validateConnectPluginConfigs } =\n await import(\"./connect-plugin-configs.js\");\n await validateConnectPluginConfigs(\n ctx.projectRoot,\n host.runner.plugins,\n ctx.verb,\n `hosts/${host.name}/host.js`,\n );\n}\n\n/** A project file the build resolved: the built dist has it (as icon.ico or\n * a data URI); served, its path would mean nothing. */\nfunction isBuiltImage(ref: unknown): boolean {\n const src =\n typeof ref === \"object\" && ref !== null && \"src\" in ref ? ref.src : ref;\n return typeof src === \"string\" && !isPassthroughImageRef(src);\n}\n\n// The served config keeps the build's images: the favicon and any branding\n// image given as a project path were resolved into the dist, and merged over\n// it a path would replace the built data URI with a URL that 404s.\nexport function withoutBuiltImages(config: PHConnectRuntimeConfig | undefined) {\n const branding = config?.branding;\n if (!branding) return config;\n const { favicon: _, ...served } = branding;\n if (isBuiltImage(served.icon)) delete served.icon;\n if (isBuiltImage(served.loader)) delete served.loader;\n return { ...config, branding: served };\n}\n\n/** A server for a built Connect, given what to serve and how. */\nexport type ConnectServerStart = (\n args: ConnectPreviewArgs,\n override?: ConnectServeOverride,\n dirname?: string,\n options?: { proxy?: string },\n) => Promise<ListeningServer>;\n\n/** `serve` on a given server. The host's connect config (including a\n * supervising compound's projected drives and the reactor projection) rides a\n * serve override: the baked powerhouse.config.json merges with it at request\n * time, and `runner.cspRegistrySync` (set by the compound's wiring) patches the\n * baked CSP's script-src for the runtime registry. Together these replace the\n * ph-win-desktop sidecar's hand-rolled static server (desktop shape). */\nexport async function serveWith(\n start: ConnectServerStart,\n host: ConnectHostParsed,\n ctx: RunnerContext,\n): Promise<RunnerHandle<ConnectOutputs>> {\n await validateComposition(host, ctx);\n const runner = host.runner;\n const port = runner.port ?? DEFAULT_CONNECT_STUDIO_PORT;\n const bind = runner.host ?? \"127.0.0.1\";\n const args: Partial<ConnectPreviewArgs> = {\n port,\n outDir: runner.outDir ?? DEFAULT_CONNECT_OUTDIR,\n open: runner.openBrowser === true,\n strictPort: runner.strictPort === true,\n cors: true,\n printUrls: true,\n bindCLIShortcuts: false,\n // Explicit IPv4 loopback (runner.host overrides): vite's default\n // \"localhost\" can bind ::1 only on Windows, and a supervising shell\n // (ph-win) probes 127.0.0.1 — the sidecar this replaces bound 127.0.0.1.\n host: bind,\n };\n const override = withoutBuiltImages(callerOverride(host, ctx, ctx.verb));\n const server = await startUnderSupervisor<ListeningServer>(ctx, () =>\n start(\n args as ConnectPreviewArgs,\n {\n connect: override,\n cspRegistrySync: runner.cspRegistrySync === true,\n },\n undefined,\n { proxy: runner.proxy?.target },\n ),\n );\n return connectHandle(server, { host: bind, port });\n}\n\n/** Serves a built Connect (run `build` first) with nothing but what a running\n * app has. ph-cli's runner adds the verbs that need build tools. */\nexport async function serve(\n host: ConnectHostParsed,\n ctx: RunnerContext,\n): Promise<RunnerHandle<ConnectOutputs>> {\n const { runConnectServer } = await import(\"../services/connect-server.js\");\n return serveWith(runConnectServer, host, ctx);\n}\n\n/** With no Studio here, running Connect is serving its build. */\nexport const run = serve;\n\nexport const verbs = [\"run\", \"serve\"];\n"],"names":[],"mappings":";;;;;;;;;;;;;;;AAuCA,MAAa,OAAO;;;;;;;;;AAUpB,MAAM,UAAU,mBAAmB,MACjC,EAAE,kBACC,OAAO;CACN,QAAQ,EAAE,iBACP,OAAO;;EAEN,aAAa,EAAE,QAAQ,CAAC,CAAC,SAAS;;EAElC,YAAY,EAAE,QAAQ,CAAC,CAAC,SAAS;;EAEjC,QAAQ,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS;;;EAGnC,iBAAiB,EAAE,QAAQ,CAAC,CAAC,SAAS;;;EAGtC,QAAQ,EAAE,MAAM,CAAC,EAAE,OAAO,GAAG,EAAE,QAAQ,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS;;;;;;;;;EASzD,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,UAAU,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS;CACnE,CAAC,CAAC,CACD,OAAO;CACV,QAAQ,wBAAwB,EAAE,SAAS,CAAC,CAAC,SAAS;AACxD,CAAC,CAAC,CACD,YAAY,oBAAoB,CACrC;AACA,MAAa,qBAAqB,QAAQ;AAC1C,MAAa,aAAa,QAAQ;;;AASlC,MAAa,gBAAgB,EAAE,aAAa;CAC1C,QAAQ,EAAE,IAAI;CACd,WAAW,EAAE,aAAa,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;AAChD,CAAC;;;;AAqBD,SAAgB,cACd,QACA,WAC8B;CAC9B,MAAM,WAAW,UAAU,UAAU,KAAK,GAAG,UAAU,KAAK;CAC5D,MAAM,MAAM,OAAO,cAAc,MAAM,MAAM;CAC7C,IAAI;CACJ,OAAO;EAC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,MACE,MACA;EACE,SAAS;EACT,iBAAiB,OAAO,oBAAoB;CAC9C,GACA,KAAA,GACA,EAAE,OAAO,OAAO,OAAO,OAAO,CAChC,CACF,GAC6B;EAAE,MAAM;EAAM;CAAK,CAAC;AACnD;;;AAIA,eAAsB,MACpB,MACA,KACuC;CACvC,MAAM,EAAE,qBAAqB,MAAM,OAAO;CAC1C,OAAO,UAAU,kBAAkB,MAAM,GAAG;AAC9C;;AAGA,MAAa,MAAM;AAEnB,MAAa,QAAQ,CAAC,OAAO,OAAO","debug_id":"1afe3171-4423-5b61-896d-d2141ebf418a"}
|
|
@@ -75,6 +75,7 @@ export declare const memberSwitchboardConfigSchema: import("zod").ZodType<{
|
|
|
75
75
|
authEnforcement?: boolean | undefined;
|
|
76
76
|
authGroups?: boolean | undefined;
|
|
77
77
|
authConditions?: boolean | undefined;
|
|
78
|
+
undoV3?: boolean | undefined;
|
|
78
79
|
} | undefined;
|
|
79
80
|
createSignaturePolicy?: "legacy" | "v2-required" | undefined;
|
|
80
81
|
unsupportedStoredDocuments?: "read-only" | "refuse" | undefined;
|
|
@@ -254,6 +255,7 @@ export declare const memberSwitchboardConfigSchema: import("zod").ZodType<{
|
|
|
254
255
|
authEnforcement?: boolean | undefined;
|
|
255
256
|
authGroups?: boolean | undefined;
|
|
256
257
|
authConditions?: boolean | undefined;
|
|
258
|
+
undoV3?: boolean | undefined;
|
|
257
259
|
} | undefined;
|
|
258
260
|
createSignaturePolicy?: "legacy" | "v2-required" | undefined;
|
|
259
261
|
unsupportedStoredDocuments?: "read-only" | "refuse" | undefined;
|
|
@@ -433,6 +435,7 @@ export declare const memberSwitchboardConfigSchema: import("zod").ZodType<{
|
|
|
433
435
|
authEnforcement?: boolean | undefined;
|
|
434
436
|
authGroups?: boolean | undefined;
|
|
435
437
|
authConditions?: boolean | undefined;
|
|
438
|
+
undoV3?: boolean | undefined;
|
|
436
439
|
} | undefined;
|
|
437
440
|
createSignaturePolicy?: "legacy" | "v2-required" | undefined;
|
|
438
441
|
unsupportedStoredDocuments?: "read-only" | "refuse" | undefined;
|
|
@@ -612,6 +615,7 @@ export declare const memberSwitchboardConfigSchema: import("zod").ZodType<{
|
|
|
612
615
|
authEnforcement?: boolean | undefined;
|
|
613
616
|
authGroups?: boolean | undefined;
|
|
614
617
|
authConditions?: boolean | undefined;
|
|
618
|
+
undoV3?: boolean | undefined;
|
|
615
619
|
} | undefined;
|
|
616
620
|
createSignaturePolicy?: "legacy" | "v2-required" | undefined;
|
|
617
621
|
unsupportedStoredDocuments?: "read-only" | "refuse" | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"member-config.d.mts","names":[],"sources":["../../src/runners/member-config.ts"],"mappings":";;;;KAqBK,MAAM,SAAS;;iBAGH;;EAEf,OAAO;;EAEP,QAAQ;;;wBAeM,mBAAmB,KAAK,KAAK,OAAO;;;;;;wBAsBpC,YAAY,KAAK,KAAK,eAA8B;;;;qBA2BvD,6CAA6B
|
|
1
|
+
{"version":3,"file":"member-config.d.mts","names":[],"sources":["../../src/runners/member-config.ts"],"mappings":";;;;KAqBK,MAAM,SAAS;;iBAGH;;EAEf,OAAO;;EAEP,QAAQ;;;wBAeM,mBAAmB,KAAK,KAAK,OAAO;;;;;;wBAsBpC,YAAY,KAAK,KAAK,eAA8B;;;;qBA2BvD,6CAA6B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAezB;EACf,UAAU;EACV;IAAW,cAAc;;;;wBAYX,gBACd,GAAG,yBACH,GAAG,yBACH;;wBAac,sBAAsB,QAAQ;;;;;;wBAiB9B,wBACd,SAAS,2BACT,KAAK,KACL;EACG;EAAa;;;;;;;;;;wBA2BI,wBACpB,QAAQ,mBACR,KAAK,WACL;EACE;EACA,SAAS;;EAET,WAAW;IAEZ,QAAQ;;;;;;wBAwCK,qBACd,SAAS,2BACT,KAAK,KACL;;wBAgBc,mBACd,kBACA;EAAU"}
|
|
@@ -67,6 +67,7 @@ export declare const declaredHostSchema: z.ZodObject<{
|
|
|
67
67
|
authEnforcement: z.ZodOptional<z.ZodBoolean>;
|
|
68
68
|
authGroups: z.ZodOptional<z.ZodBoolean>;
|
|
69
69
|
authConditions: z.ZodOptional<z.ZodBoolean>;
|
|
70
|
+
undoV3: z.ZodOptional<z.ZodBoolean>;
|
|
70
71
|
}, z.core.$strict>>;
|
|
71
72
|
createSignaturePolicy: z.ZodOptional<z.ZodEnum<{
|
|
72
73
|
legacy: "legacy";
|
|
@@ -175,6 +176,7 @@ export declare const declaredHostSchema: z.ZodObject<{
|
|
|
175
176
|
authEnforcement?: boolean | undefined;
|
|
176
177
|
authGroups?: boolean | undefined;
|
|
177
178
|
authConditions?: boolean | undefined;
|
|
179
|
+
undoV3?: boolean | undefined;
|
|
178
180
|
} | undefined;
|
|
179
181
|
createSignaturePolicy?: "legacy" | "v2-required" | undefined;
|
|
180
182
|
unsupportedStoredDocuments?: "read-only" | "refuse" | undefined;
|
|
@@ -354,6 +356,7 @@ export declare const declaredHostSchema: z.ZodObject<{
|
|
|
354
356
|
authEnforcement?: boolean | undefined;
|
|
355
357
|
authGroups?: boolean | undefined;
|
|
356
358
|
authConditions?: boolean | undefined;
|
|
359
|
+
undoV3?: boolean | undefined;
|
|
357
360
|
} | undefined;
|
|
358
361
|
createSignaturePolicy?: "legacy" | "v2-required" | undefined;
|
|
359
362
|
unsupportedStoredDocuments?: "read-only" | "refuse" | undefined;
|
|
@@ -533,6 +536,7 @@ export declare const declaredHostSchema: z.ZodObject<{
|
|
|
533
536
|
authEnforcement?: boolean | undefined;
|
|
534
537
|
authGroups?: boolean | undefined;
|
|
535
538
|
authConditions?: boolean | undefined;
|
|
539
|
+
undoV3?: boolean | undefined;
|
|
536
540
|
} | undefined;
|
|
537
541
|
createSignaturePolicy?: "legacy" | "v2-required" | undefined;
|
|
538
542
|
unsupportedStoredDocuments?: "read-only" | "refuse" | undefined;
|
|
@@ -712,6 +716,7 @@ export declare const declaredHostSchema: z.ZodObject<{
|
|
|
712
716
|
authEnforcement?: boolean | undefined;
|
|
713
717
|
authGroups?: boolean | undefined;
|
|
714
718
|
authConditions?: boolean | undefined;
|
|
719
|
+
undoV3?: boolean | undefined;
|
|
715
720
|
} | undefined;
|
|
716
721
|
createSignaturePolicy?: "legacy" | "v2-required" | undefined;
|
|
717
722
|
unsupportedStoredDocuments?: "read-only" | "refuse" | undefined;
|
|
@@ -898,6 +903,7 @@ export declare const hostSchema: z.ZodObject<{
|
|
|
898
903
|
authEnforcement: z.ZodOptional<z.ZodBoolean>;
|
|
899
904
|
authGroups: z.ZodOptional<z.ZodBoolean>;
|
|
900
905
|
authConditions: z.ZodOptional<z.ZodBoolean>;
|
|
906
|
+
undoV3: z.ZodOptional<z.ZodBoolean>;
|
|
901
907
|
}, z.core.$strict>>;
|
|
902
908
|
createSignaturePolicy: z.ZodOptional<z.ZodEnum<{
|
|
903
909
|
legacy: "legacy";
|
|
@@ -1006,6 +1012,7 @@ export declare const hostSchema: z.ZodObject<{
|
|
|
1006
1012
|
authEnforcement?: boolean | undefined;
|
|
1007
1013
|
authGroups?: boolean | undefined;
|
|
1008
1014
|
authConditions?: boolean | undefined;
|
|
1015
|
+
undoV3?: boolean | undefined;
|
|
1009
1016
|
} | undefined;
|
|
1010
1017
|
createSignaturePolicy?: "legacy" | "v2-required" | undefined;
|
|
1011
1018
|
unsupportedStoredDocuments?: "read-only" | "refuse" | undefined;
|
|
@@ -1185,6 +1192,7 @@ export declare const hostSchema: z.ZodObject<{
|
|
|
1185
1192
|
authEnforcement?: boolean | undefined;
|
|
1186
1193
|
authGroups?: boolean | undefined;
|
|
1187
1194
|
authConditions?: boolean | undefined;
|
|
1195
|
+
undoV3?: boolean | undefined;
|
|
1188
1196
|
} | undefined;
|
|
1189
1197
|
createSignaturePolicy?: "legacy" | "v2-required" | undefined;
|
|
1190
1198
|
unsupportedStoredDocuments?: "read-only" | "refuse" | undefined;
|
|
@@ -1364,6 +1372,7 @@ export declare const hostSchema: z.ZodObject<{
|
|
|
1364
1372
|
authEnforcement?: boolean | undefined;
|
|
1365
1373
|
authGroups?: boolean | undefined;
|
|
1366
1374
|
authConditions?: boolean | undefined;
|
|
1375
|
+
undoV3?: boolean | undefined;
|
|
1367
1376
|
} | undefined;
|
|
1368
1377
|
createSignaturePolicy?: "legacy" | "v2-required" | undefined;
|
|
1369
1378
|
unsupportedStoredDocuments?: "read-only" | "refuse" | undefined;
|
|
@@ -1543,6 +1552,7 @@ export declare const hostSchema: z.ZodObject<{
|
|
|
1543
1552
|
authEnforcement?: boolean | undefined;
|
|
1544
1553
|
authGroups?: boolean | undefined;
|
|
1545
1554
|
authConditions?: boolean | undefined;
|
|
1555
|
+
undoV3?: boolean | undefined;
|
|
1546
1556
|
} | undefined;
|
|
1547
1557
|
createSignaturePolicy?: "legacy" | "v2-required" | undefined;
|
|
1548
1558
|
unsupportedStoredDocuments?: "read-only" | "refuse" | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"switchboard.d.mts","names":[],"sources":["../../src/runners/switchboard.ts"],"mappings":";;;;;;;;;;qBA0Ca;qBAoCA,oBAAkB,EAAA
|
|
1
|
+
{"version":3,"file":"switchboard.d.mts","names":[],"sources":["../../src/runners/switchboard.ts"],"mappings":";;;;;;;;;;qBA0Ca;qBAoCA,oBAAkB,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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A,KAAA;;YAGhC,kBAAkB,EAAE,aAAa;;YAEjC,wBAAwB,EAAE,cAAc;;qBAGvC,8BAA4B,EAAA;;;GAGvC,EAAA,KAAA;;;;;;;qBAQW,eAAa,EAAA;;;;;;;;;;GAOxB,EAAA,KAAA;YACU,qBAAqB,EAAE,aAAa;QAExC;YACI;IACR;MACE,MAAM;MACN,SAAS;;;;;YAMH,wBAAwB,KAAK;EACvC;;;;;;;;;;;;;;wBAqGoB,aACpB,aACA,mBACA,eAAe,kBACf,mBAAkB,QACjB;;YAqBS,oBAAoB,aAAa;wBAiTvB,IACpB,MAAM,uBACN,KAAK,gBACJ,QAAQ;qBAIE,cAAK;qBAEL;wBAES,IACpB,MAAM,uBACN,KAAK,gBACJ,QAAQ;;wBAKW,UACpB,MAAM,uBACN,KAAK,mBACJ,QAAQ"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@powerhousedao/ph-run",
|
|
3
|
-
"version": "6.2.3-dev.
|
|
3
|
+
"version": "6.2.3-dev.92",
|
|
4
4
|
"description": "Runs a project's hosts, with none of the tools that build one",
|
|
5
5
|
"license": "AGPL-3.0-only",
|
|
6
6
|
"type": "module",
|
|
@@ -72,13 +72,13 @@
|
|
|
72
72
|
"dist"
|
|
73
73
|
],
|
|
74
74
|
"dependencies": {
|
|
75
|
-
"@powerhousedao/config": "6.2.3-dev.
|
|
76
|
-
"@powerhousedao/host-core": "6.2.3-dev.
|
|
77
|
-
"@powerhousedao/reactor": "6.2.3-dev.
|
|
78
|
-
"@powerhousedao/shared": "6.2.3-dev.
|
|
79
|
-
"@powerhousedao/switchboard": "6.2.3-dev.
|
|
75
|
+
"@powerhousedao/config": "6.2.3-dev.92",
|
|
76
|
+
"@powerhousedao/host-core": "6.2.3-dev.92",
|
|
77
|
+
"@powerhousedao/reactor": "6.2.3-dev.92",
|
|
78
|
+
"@powerhousedao/shared": "6.2.3-dev.92",
|
|
79
|
+
"@powerhousedao/switchboard": "6.2.3-dev.92",
|
|
80
80
|
"cmd-ts": "0.15.0",
|
|
81
|
-
"document-model": "6.2.3-dev.
|
|
81
|
+
"document-model": "6.2.3-dev.92",
|
|
82
82
|
"dotenv": "16.4.7",
|
|
83
83
|
"sirv": "^3.0.2",
|
|
84
84
|
"zod": "^4.5.4"
|