@powerhousedao/shared 6.2.3-dev.71 → 6.2.3-dev.72

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.
@@ -1942,6 +1942,10 @@ declare const PEER_EXTERNAL_DEPENDENCIES: {
1942
1942
  readonly peer: "^4";
1943
1943
  readonly dev: "4.6.5";
1944
1944
  };
1945
+ readonly "@tanstack/react-router": {
1946
+ readonly peer: "^1.170.41";
1947
+ readonly dev: "1.170.41";
1948
+ };
1945
1949
  };
1946
1950
  declare const FEATURE_DEPENDENCIES: {
1947
1951
  readonly analyticsProcessor: {
@@ -2314,4 +2318,4 @@ type Manifest = z.infer<typeof ManifestSchema>;
2314
2318
  //#endregion
2315
2319
  export { PH_GLOBAL_PROJECT_NAME as A, SERVICE_ACTIONS as B, LEGACY_LINT_FORMAT_DEPENDENCIES as C, PEER_EXTERNAL_DEPENDENCIES as D, MINIMUM_NODE_VERSION as E, PROJECT_PORT_BAND_STUDIO as F, externalDependencies as G, VERSIONED_DEV_DEPENDENCIES as H, PROJECT_PORT_BAND_SWITCHBOARD as I, packageScripts as J, externalDevDependencies as K, PROJECT_PORT_BAND_VETRA_CONNECT as L, POWERHOUSE_CONFIG_FILE as M, POWERHOUSE_GLOBAL_DIR as N, PH_BIN as O, PROJECT_PORT_BAND_SIZE as P, REACTOR_API_PACKAGE as R, HOME_DIR as S, LOG_LEVELS as T, VERSIONED_PEER_DEPENDENCIES as U, VERSIONED_DEPENDENCIES as V, defaultManifest as W, DEFAULT_VETRA_DRIVE_ID as _, DEFAULT_CONFIG as a, GRAPHQL_PACKAGE as b, DEFAULT_CONNECT_STUDIO_PORT as c, DEFAULT_EXPIRY_SECONDS as d, DEFAULT_REGISTRY_URL as f, DEFAULT_VETRA_CONNECT_PORT as g, DEFAULT_TIMEOUT as h, BOILERPLATE_DEPENDENCY_OVERRIDES as i, PIECES_FRAMEWORK_PACKAGE as j, PH_GLOBAL_DIR_NAME as k, DEFAULT_DRIVE_ICON as l, DEFAULT_SWITCHBOARD_PORT as m, ANALYTICS_ENGINE_CORE_PACKAGE as n, DEFAULT_CONNECT_OUTDIR as o, DEFAULT_RENOWN_URL as p, packageJsonExports as q, BOILERPLATE_ALLOWED_BUILDS as r, DEFAULT_CONNECT_PREVIEW_PORT as s, Manifest as t, DEFAULT_EXPIRY_DAYS as u, DRIVES_PRESERVE_STRATEGIES as v, LEGACY_LINT_FORMAT_FILES as w, GRAPHQL_TAG_PACKAGE as x, FEATURE_DEPENDENCIES as y, SECONDS_IN_DAY as z };
2316
2320
  export {};
2317
- //# sourceMappingURL=types-DT6KawYx.d.mts.map
2321
+ //# sourceMappingURL=types-BNdhWTBs.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types-DT6KawYx.d.mts","names":[],"sources":["../../host-tokens/index.ts","../../connect/connect-config-schema.ts","../../clis/constants.ts","../../clis/types.ts","../../document-model/schemas.ts","../../document-model/types.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;KAeY;;;UAWK,YAAY;EAC3B;IAAW;IAAc;IAAiB,MAAM;;WACvC,WAAW;;;UAIL;EACf,4BAA4B;;;;UAKb,UAAU;EACzB,OAAO;IAAe;IAAY,MAAM;;WAC/B,WAAW;;;UAIL;EACf;;;;;UAMe,SAAS;EACxB;IACE,MAAM,cAAc;IACpB;IACA,IAAI;IACJ;;;;UAKa;EACf;IAAiB;IAAc;;;KAGrB,QACR,cACA,cACA,WACA,YACA,WACA;;;KAoBC,UAAU,KAAK,QAAQ,GAAG;;;KAI1B;;KAGA,YACD,kCACA;;KAEC,aACD,YAAY,SAAS,4BACrB,UAAU,SAAS;;;;;;;;KASX,cAAc;EAEpB;IACE,MAAM;IACN;IACA,IAAI,SAAS;IACb;;;EAIF;IACE,MAAM;IACN;IACA,IAAI,SAAS;IACb;;;;UAKS,eAAe;EAC9B;IACE,MAAM;IACN;IACA,IAAI,SAAS;IACb;;;KAIC,YAAY,KAAK,+BAClB,cAAc,aACd,wCACuB,IAC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cAEA;cACA;cACA;cAQA;;aACU;aAAa;;;aACT;aAAY;;;aAC5B;aAAa;;;aACP;aAAa;;;aACrB;aAAY;;;cAKR;;aAET;aACA;aACA;;;aAKA;aACA;aACA;;;cAWS;cAUA;cAiBA;WACC;WACN;WACI;;cAGC;cAkBA;WACX;aACE;aACA;aACA;;WAEF;aACE;aACA;;WAEF;aACE;aACA;aACA;;WAEF;aACE;aACA;aACA;;WAEF;aACE;aACA;aACA;;WAEF;aACE;aACA;aACA;;WAEF;aACE;aACA;;WAGF;aACE;;WAEF;aACE;aACA;aACA;;WAKF;aACE;aACA;;WAEF;aACE;aACA;;WAEF;WACA;;cAGW;WACX;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WAEA;;cAIW;cAIA;cAcA;cAwBA;WACX;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;;cAGW,iBAAiB;cAuBjB,gBAAgB;;;KC/VjB,mBAAmB;KACnB,WAAW;KAOX;KAGA;EACV;EACA;EACA,WAAW;EACX;;;;KAgHU,yBAAyB,EAAE,aAC9B;;KAIG;;;EAGV;;EAEA;;EAEA;;KAGU;EAEV,UAAU;EACV;EACA;EACA;EACA;EACA;EACA;EAGA;EACA;EACA;IACE;IACA;MAIM;MACA;;IAEN;MACE;MACA;MACA;;;EAGJ;IACE;IACA;IACA,SAAS;;EAEX;IACE;MACE;;IAEF;;EAEF;IACE;IACA;IACA;IACA;;EAEF,WAAW;EACX;IACE;IACA;IACA;;EAGF;IACE;;EAIF;IACE;;EAEF;EACA,UAAU;;;;cCkoBC,gBAAc,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuBzB,EAAA,KAAA;;;KCg3BU,WAAW,EAAE,aAAa"}
1
+ {"version":3,"file":"types-BNdhWTBs.d.mts","names":[],"sources":["../../host-tokens/index.ts","../../connect/connect-config-schema.ts","../../clis/constants.ts","../../clis/types.ts","../../document-model/schemas.ts","../../document-model/types.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;KAeY;;;UAWK,YAAY;EAC3B;IAAW;IAAc;IAAiB,MAAM;;WACvC,WAAW;;;UAIL;EACf,4BAA4B;;;;UAKb,UAAU;EACzB,OAAO;IAAe;IAAY,MAAM;;WAC/B,WAAW;;;UAIL;EACf;;;;;UAMe,SAAS;EACxB;IACE,MAAM,cAAc;IACpB;IACA,IAAI;IACJ;;;;UAKa;EACf;IAAiB;IAAc;;;KAGrB,QACR,cACA,cACA,WACA,YACA,WACA;;;KAoBC,UAAU,KAAK,QAAQ,GAAG;;;KAI1B;;KAGA,YACD,kCACA;;KAEC,aACD,YAAY,SAAS,4BACrB,UAAU,SAAS;;;;;;;;KASX,cAAc;EAEpB;IACE,MAAM;IACN;IACA,IAAI,SAAS;IACb;;;EAIF;IACE,MAAM;IACN;IACA,IAAI,SAAS;IACb;;;;UAKS,eAAe;EAC9B;IACE,MAAM;IACN;IACA,IAAI,SAAS;IACb;;;KAIC,YAAY,KAAK,+BAClB,cAAc,aACd,wCACuB,IACnB,eAAe,iBAAiB;;KAKnC,SAAS,GAAG,KAAK,UAAU;;;;KAK3B,YAAY,GAAG,UAAU,YACxB,SAAS,GAAG;EAAgC;OAC5C,SAAS,QAAQ;EAAgC;;;;;;;;;;KAU3C,SAAS,GAAG,UAAU,SAAS,0BAA0B,IACjE,QAEI,YAAY,KACZ,UAAU,qBACM,IAAI,cAAc,oBAClC,YAAY,GAAG,KACf,YAAY;;;;;;;;KASR,SAAS,GAAG,UAAU,SAAS,UACvC,SAAS,UAAU,IAAI,KACvB,cAAc,UAAU,IAAI;KAE3B,cAAc,GAAG,UAAU,UAAU,+BACtC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aACA;;WAEF;aACE;aACA;;WAEF;WACA;;cAGW;WACX;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WAEA;;cAIW;cAIA;cAcA;cAwBA;WACX;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;;cAGW,iBAAiB;cAuBjB,gBAAgB;;;KCjWjB,mBAAmB;KACnB,WAAW;KAOX;KAGA;EACV;EACA;EACA,WAAW;EACX;;;;KAgHU,yBAAyB,EAAE,aAC9B;;KAIG;;;EAGV;;EAEA;;EAEA;;KAGU;EAEV,UAAU;EACV;EACA;EACA;EACA;EACA;EACA;EAGA;EACA;EACA;IACE;IACA;MAIM;MACA;;IAEN;MACE;MACA;MACA;;;EAGJ;IACE;IACA;IACA,SAAS;;EAEX;IACE;MACE;;IAEF;;EAEF;IACE;IACA;IACA;IACA;;EAEF,WAAW;EACX;IACE;IACA;IACA;;EAGF;IACE;;EAIF;IACE;;EAEF;EACA,UAAU;;;;cCkoBC,gBAAc,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuBzB,EAAA,KAAA;;;KCg3BU,WAAW,EAAE,aAAa"}
@@ -64,7 +64,7 @@ const connectLoaderSchema = z.strictObject({
64
64
  const connectBrandingSchema = z.strictObject({
65
65
  appName: z.string().nullable().optional().describe("Browser tab title, installed-app name and in-app brand text. null or omitted: 'Powerhouse Connect'."),
66
66
  icon: optionalImageRef("App icon master (1024x1024 PNG recommended, or an SVG). The favicons and installed-app icons are found next to it as <name>_16x16.png, _32x32, _64x64, _192x192 and _512x512; the 64 px one is the in-app logo. null or omitted: Connect's icon."),
67
- favicon: z.string().nullable().optional().describe("The browser tab icon: a file (.ico, .svg or .png) relative to the project, served and built as icon.ico. A build input; the built runtime config leaves it out. `ph connect build --favicon` wins over it."),
67
+ favicon: z.string().nullable().optional().describe("The browser tab icon: a file (.ico, .svg or .png) relative to the project, served and built as icon.ico, or as icon.svg or icon.png for those types. A build input; the built runtime config leaves it out. `ph connect build --favicon` wins over it."),
68
68
  loader: z.union([connectImageRefSchema, connectLoaderSchema]).nullable().optional().describe("The loading image (first paint, app start, drive and editor loading). A path gets a gentle pulse; { src, animation, size } says otherwise, with animation \"none\" for an image that animates itself (animated SVG, GIF or WebP). null or omitted: Connect's animated logo.")
69
69
  }).describe("App identity and visual branding. Every field is optional; null means the default.");
70
70
  /** `connect.home`: the home screen (the generic chrome's landing page). */
@@ -1 +1 @@
1
- {"version":3,"file":"connect-config-schema.js","names":[],"sources":["../../connect/connect-config-schema.ts"],"sourcesContent":["// Single source of Connect's config (browser-safe, zod only). The PHConnect*\n// types (../clis/types.ts) and the JSON Schema fragments Ajv consumes\n// (./schema-fragments.ts) are derived from it.\n//\n// Never `.default(x)`: it fills values on parse; use `.meta({ default })`.\n// Never `.meta({ id })`: it emits `$defs`, whose refs break once the fragment\n// is embedded in another schema root.\n\nimport { z } from \"zod\";\nimport { tokenable, type TokenField } from \"../host-tokens/index.js\";\n\n// ---------------------------------------------------------------------------\n// Images, colours, lengths and backgrounds\n// ---------------------------------------------------------------------------\n\nconst IMAGE_REF =\n \"Image reference: a project-relative file path, a URL, or a data URI.\";\nconst IMAGE_REF_OR_DEFAULT =\n \"Image reference: a project-relative file path (resolved by the Connect build), a URL, or a data URI. null keeps the default.\";\n\n/** An image reference: a project-relative file path (the Connect build turns\n * it into a data URI or an emitted file), a URL, or a data URI. */\nexport const connectImageRefSchema = z.string().describe(IMAGE_REF);\n\n/** An image reference where `null` (or omitting it) keeps the default. */\nconst optionalImageRef = (description = IMAGE_REF_OR_DEFAULT) =>\n connectImageRefSchema.nullable().optional().describe(description);\n\n/** An image per colour scheme: one reference for both, or `{ light, dark }`\n * (`dark` falls back to `light`). */\nexport const connectSchemedImageSchema = z\n .union([\n connectImageRefSchema,\n z.strictObject({\n light: connectImageRefSchema,\n dark: connectImageRefSchema.nullable().optional(),\n }),\n ])\n .describe(\n \"One image for both colour schemes, or { light, dark } (dark falls back to light).\",\n );\n\n/** A CSS colour per colour scheme (`dark` falls back to `light`). */\nexport const connectSchemedColorSchema = z.union([\n z.string(),\n z.strictObject({\n light: z.string(),\n dark: z.string().nullable().optional(),\n }),\n]);\n\n/** A CSS length: a number is px, a string is passed through as written. */\nexport const connectLengthSchema = z.union([z.number(), z.string()]);\n\nconst optionalLength = () =>\n connectLengthSchema\n .nullable()\n .optional()\n .describe(\n 'A CSS length: a number is px; a string is used as written (\"40%\", \"min(55%, 880px)\", \"calc(50% - 120px)\").',\n );\n\n/** Distances to the four edges; each is optional. */\nexport const connectEdgesSchema = z.strictObject({\n top: optionalLength(),\n right: optionalLength(),\n bottom: optionalLength(),\n left: optionalLength(),\n});\n\n/** One image of a decorated pane, absolutely positioned inside it. */\nexport const connectBackgroundLayerSchema = z\n .strictObject({\n src: connectSchemedImageSchema,\n position: connectEdgesSchema\n .nullable()\n .optional()\n .describe(\n \"Distances to the pane's edges; at most one per axis. Omitted: centred both ways.\",\n ),\n width: optionalLength(),\n height: optionalLength(),\n minWidth: optionalLength(),\n minHeight: optionalLength(),\n maxWidth: optionalLength(),\n maxHeight: optionalLength(),\n opacity: z\n .number()\n .min(0)\n .max(1)\n .nullable()\n .optional()\n .describe(\"0 to 1 (default 1).\"),\n fade: connectEdgesSchema\n .nullable()\n .optional()\n .describe(\n \"Feather depth per edge, fading the layer into the page colour.\",\n ),\n })\n .describe(\n \"An image laid over the page, absolutely positioned: the edges set in `position` pin it, an axis with neither edge set is centred.\",\n );\n\n/** A decorated pane: the page colour and the images laid over it. */\nexport const connectBackgroundLayersSchema = z.strictObject({\n color: connectSchemedColorSchema\n .nullable()\n .optional()\n .describe(\n \"The page colour, or { light, dark }. Omitted or null: the theme's page background.\",\n ),\n layers: z\n .array(connectBackgroundLayerSchema)\n .describe(\"Painted in order; the first is at the back.\"),\n});\n\n/** A pane's background: layers over a page colour, or one image as\n * shorthand for a single layer pinned bottom-right. */\nexport const connectBackgroundSchema = z\n .union([connectImageRefSchema, connectBackgroundLayersSchema])\n .describe(\n \"Layered images over a page colour, or a single image pinned to the bottom-right corner. null keeps the default.\",\n );\n\n// ---------------------------------------------------------------------------\n// branding, home\n// ---------------------------------------------------------------------------\n\n/** The loading image and the motion applied to it. */\nexport const connectLoaderSchema = z.strictObject({\n src: connectImageRefSchema,\n animation: z\n .enum([\"pulse\", \"spin\", \"none\"])\n .nullable()\n .optional()\n .describe(\"Motion applied to the image (default pulse).\"),\n size: z\n .number()\n .min(16)\n .max(512)\n .nullable()\n .optional()\n .describe(\n \"Rendered width in CSS pixels (default 96); the height follows the image.\",\n ),\n});\n\n/** `connect.branding`: Connect's identity and look. */\nexport const connectBrandingSchema = z\n .strictObject({\n appName: z\n .string()\n .nullable()\n .optional()\n .describe(\n \"Browser tab title, installed-app name and in-app brand text. null or omitted: 'Powerhouse Connect'.\",\n ),\n icon: optionalImageRef(\n \"App icon master (1024x1024 PNG recommended, or an SVG). The favicons and installed-app icons are found next to it as <name>_16x16.png, _32x32, _64x64, _192x192 and _512x512; the 64 px one is the in-app logo. null or omitted: Connect's icon.\",\n ),\n favicon: z\n .string()\n .nullable()\n .optional()\n .describe(\n \"The browser tab icon: a file (.ico, .svg or .png) relative to the project, served and built as icon.ico. A build input; the built runtime config leaves it out. `ph connect build --favicon` wins over it.\",\n ),\n loader: z\n .union([connectImageRefSchema, connectLoaderSchema])\n .nullable()\n .optional()\n .describe(\n 'The loading image (first paint, app start, drive and editor loading). A path gets a gentle pulse; { src, animation, size } says otherwise, with animation \"none\" for an image that animates itself (animated SVG, GIF or WebP). null or omitted: Connect\\'s animated logo.',\n ),\n })\n .describe(\n \"App identity and visual branding. Every field is optional; null means the default.\",\n );\n\n/** `connect.home`: the home screen (the generic chrome's landing page). */\nexport const connectHomeSchema = z\n .strictObject({\n background: connectBackgroundSchema\n .nullable()\n .optional()\n .describe(\n \"The home screen's background: { color, layers } with each image positioned and sized, or one image pinned bottom-right. null or omitted: the bundled gradient.\",\n ),\n })\n .describe(\"The home screen (the generic chrome's landing page).\");\n\n// ---------------------------------------------------------------------------\n// app, ai, packages\n// ---------------------------------------------------------------------------\n\nexport const connectAppSchema = z\n .strictObject({\n logLevel: z.enum([\"debug\", \"info\", \"warn\", \"error\"]).optional().meta({\n description:\n \"Log level applied by Connect's logger at boot. Affects browser-side output only.\",\n default: \"info\",\n }),\n basePath: z.string().optional().meta({\n description:\n \"Base path Connect is mounted under (e.g. '/connect' for subpath deploys). Normalised at runtime to start and end with '/'. Defaults to the build-time BASE_URL.\",\n default: \"/\",\n }),\n offline: z.boolean().optional().meta({\n description:\n \"When true (default), the build emits a precaching service worker so Connect's app shell works offline, and the SPA registers it at boot. Set false to opt this deployment out: no service worker is built, the SPA skips registration, and any previously-installed worker is unregistered.\",\n default: true,\n }),\n studioMode: z.boolean().optional().meta({\n description:\n \"Studio mode. Enables builder-only capabilities: Connect loads the vetra package and exposes DocumentModel (and vetra spec types) as creatable documents. Forced on by `ph vetra` / `ph connect studio`; false by default.\",\n default: false,\n }),\n workflowsEnabled: z\n .boolean()\n .optional()\n .describe(\n \"Powerhouse workflows in Connect. When true the tab loads the @powerhousedao/workflow package (workflow + connection documents, their editors and Workflow Studio) and the reactor worker registers its document models. Falls back to the top-level `workflows.enabled`; set it to override that for Connect. Independent of studioMode. False when neither is set.\",\n ),\n })\n .describe(\"Top-level Connect application behaviour.\");\n\nexport const connectAiSchema = z\n .strictObject({\n assistantEnabled: z.boolean().optional().meta({\n description:\n \"When true, Connect mounts the in-browser AI assistant (bottom-right chat FAB that talks to a user-configured OpenAI-compatible endpoint and acts on the reactor). Disabled by default.\",\n default: false,\n }),\n })\n .describe(\"AI assistant (chat) behaviour.\");\n\nexport const connectPackagesSchema = z\n .strictObject({\n externalEnabled: z.boolean().optional().meta({\n description:\n \"When false, Connect refuses to load any package that wasn't bundled at build time. Affirmative replacement for the legacy PH_CONNECT_EXTERNAL_PACKAGES_DISABLED env var.\",\n default: true,\n }),\n liveReload: z.boolean().optional().meta({\n description:\n \"When true, Connect subscribes to the static-mode `/__packages` SSE channel so live publishes flow into the running tab without a page reload. Only works under hosting that serves this channel (e.g. ph-clint static mode).\",\n default: false,\n }),\n })\n .describe(\n \"Runtime behaviour for the Connect package manager (separate from top-level `packages[]`, which lists which packages to load).\",\n );\n\n// ---------------------------------------------------------------------------\n// drives\n// ---------------------------------------------------------------------------\n\nconst EXPLORER_ICONS_DESCRIPTION =\n \"The drive explorer's icons (the generic plugin's); each null keeps the built-in icon.\";\n\n/** The drive explorer's icons: the generic chrome's, owned by the generic\n * plugin. Each `null` keeps the built-in icon. */\nexport const connectExplorerIconsSchema = z\n .strictObject({\n localDrive: optionalImageRef(\"Local drives without an icon of their own.\"),\n remoteDrive: optionalImageRef(\n \"Remote drives without an icon of their own.\",\n ),\n folder: optionalImageRef(\"Folders.\"),\n document: optionalImageRef(\n \"Documents whose type has no icon in `documents`.\",\n ),\n documents: z\n .record(z.string(), connectImageRefSchema)\n .nullable()\n .optional()\n .describe('Per document type, e.g. \"acme/invoice\".'),\n })\n .describe(EXPLORER_ICONS_DESCRIPTION);\n\nexport const connectDefaultDriveRemoteSchema = z.strictObject({\n url: z.string(),\n name: z.string().nullable().optional(),\n icon: z.string().nullable().optional(),\n});\n\nexport const connectDefaultDriveLocalSchema = z.strictObject({\n local: z\n .literal(true)\n .describe(\n \"Discriminator: this entry is a local drive created on first boot.\",\n ),\n id: z\n .string()\n .describe(\n \"Stable drive id. The drive is created with this id on first boot and is not re-created on later boots.\",\n ),\n name: z.string().nullable().optional(),\n icon: z.string().nullable().optional(),\n app: z\n .string()\n .optional()\n .describe(\"Drive app (preferred editor) to open on the drive.\"),\n});\n\nexport const connectDefaultDriveSchema = z.union([\n connectDefaultDriveRemoteSchema,\n connectDefaultDriveLocalSchema,\n]);\n\n/** `connect.drives.sections.{remote,local}`: three affirmative toggles. */\nexport const connectDriveSectionSchema = z\n .strictObject({\n enabled: z.boolean().optional().meta({\n description: \"When false, the section is hidden in the sidebar.\",\n default: true,\n }),\n allowAdd: z.boolean().optional().meta({\n description:\n \"When false, the section's 'add drive' affordance is hidden.\",\n default: true,\n }),\n allowDelete: z.boolean().optional().meta({\n description:\n \"When false, drives in this section cannot be deleted from the UI.\",\n default: true,\n }),\n })\n .describe(\n \"Visibility and add/delete affordances for a drive section in the sidebar.\",\n );\n\nexport const connectDriveSectionsSchema = z\n .strictObject({\n remote: connectDriveSectionSchema.optional(),\n local: connectDriveSectionSchema.optional(),\n })\n .describe(\n \"Per-section visibility and affordance toggles. `remote` covers what was historically split into 'public' + 'cloud'; `local` is browser-local drives.\",\n );\n\n/** Mirrors DRIVES_PRESERVE_STRATEGIES (../clis/constants.ts, which imports\n * node: modules, so it is not imported here); a test pins the two. */\nexport const connectDrivePreserveStrategySchema = z.enum([\n \"preserve-all\",\n \"preserve-by-url-and-detach\",\n]);\n\nexport const connectDrivesSchema = z\n .strictObject({\n allowAddDrive: z.boolean().optional().meta({\n description:\n \"When false, the SPA hides the 'add drive' affordance entirely (top-level). Per-section overrides live in `sections.{remote,local}.allowAdd`.\",\n default: true,\n }),\n defaultDrives: z.array(connectDefaultDriveSchema).optional().meta({\n description:\n \"Drives the SPA auto-connects to on first load. Each entry is either a remote drive (a URL, with optional name/icon overrides) or a local drive (created locally on first boot, with a stable id and optional name/icon/app).\",\n default: [],\n }),\n preserveStrategy: connectDrivePreserveStrategySchema\n .optional()\n .describe(\n \"Strategy applied when defaultDrives change between deploys. 'preserve-all' keeps user-added drives untouched; 'preserve-by-url-and-detach' detaches removed default drives. No schema default — opt-in only.\",\n ),\n sections: connectDriveSectionsSchema.optional(),\n icons: connectExplorerIconsSchema\n .nullable()\n .optional()\n .describe(EXPLORER_ICONS_DESCRIPTION),\n })\n .describe(\"Default-drive and add-drive UI behaviour.\");\n\n// ---------------------------------------------------------------------------\n// renown, sentry, openPanel\n// ---------------------------------------------------------------------------\n\nexport const connectRenownRainbowAdapterSchema = z\n .strictObject({\n walletConnectProjectId: z\n .string()\n .optional()\n .describe(\n \"WalletConnect project id; required for this adapter to function.\",\n ),\n infuraProjectId: z\n .string()\n .optional()\n .describe(\"Optional Infura project id used to build RPC transports.\"),\n })\n .describe(\"wagmi + RainbowKit external-wallet adapter config.\");\n\nexport const connectRenownPrivyAdapterSchema = z\n .strictObject({\n appId: z\n .string()\n .optional()\n .describe(\"Privy application id; required for this adapter to function.\"),\n clientId: z.string().optional().describe(\"Optional Privy client id.\"),\n methods: z\n .array(z.string())\n .optional()\n .describe(\n \"Login methods this adapter offers; default per adapter when omitted.\",\n ),\n })\n .describe(\"Privy embedded/social adapter config.\");\n\nexport const connectRenownAdaptersSchema = z\n .strictObject({\n rainbow: connectRenownRainbowAdapterSchema.optional(),\n privy: connectRenownPrivyAdapterSchema.optional(),\n })\n .describe(\n \"Per-adapter wallet config for in-page auth. Presence of an adapter key enables it; omit or leave empty for redirect-only behaviour.\",\n );\n\nexport const connectRenownSchema = z\n .strictObject({\n url: z.string().optional().meta({\n description: \"Renown auth service URL.\",\n default: \"https://www.renown.id\",\n }),\n networkId: z.string().optional().meta({\n description: \"CAIP-2 network namespace (e.g. 'eip155').\",\n default: \"eip155\",\n }),\n chainId: z.number().optional().meta({\n description: \"CAIP-2 chain reference within the network namespace.\",\n default: 1,\n }),\n namespace: z\n .string()\n .optional()\n .describe(\n \"Renown localStorage namespace; share it across Connects to share login.\",\n ),\n switchboardUrl: z\n .string()\n .optional()\n .describe(\n \"Switchboard GraphQL URL. When set, Connect enables in-page (no-redirect) Renown sign-in; otherwise it falls back to the redirect flow via `url`.\",\n ),\n adapters: connectRenownAdaptersSchema.optional(),\n })\n .describe(\"Renown identity / authentication coordinates.\");\n\nexport const connectSentrySchema = z\n .strictObject({\n dsn: z.string().nullable().optional().meta({\n description:\n \"Sentry DSN URL. `null` disables Sentry entirely; the SPA never loads the Sentry SDK chunk.\",\n default: null,\n }),\n env: z.string().optional().meta({\n description:\n \"Sentry environment label, surfaced as the `environment` tag on every event.\",\n default: \"dev\",\n }),\n tracing: z.boolean().optional().meta({\n description: \"Enable Sentry performance tracing.\",\n default: false,\n }),\n })\n .describe(\n \"Sentry error-tracking coordinates. Set `dsn` to enable Sentry; leave `dsn` null to disable. The Sentry release tag stays build-time (stamped via Vite's `define` from WORKSPACE_VERSION) so it always matches the sourcemaps uploaded by CI.\",\n );\n\nexport const connectOpenPanelSchema = z\n .strictObject({\n clientId: z.string().optional().meta({\n description:\n \"OpenPanel client id. Empty string disables OpenPanel entirely.\",\n default: \"\",\n }),\n apiUrl: z\n .string()\n .optional()\n .describe(\n \"OpenPanel API URL for self-hosted instances (e.g. 'https://openpanel.example/api'). Omit to use OpenPanel's hosted API.\",\n ),\n trackUiEvents: z.boolean().optional().meta({\n description: \"Track UI events.\",\n default: true,\n }),\n trackOperations: z.boolean().optional().meta({\n description: \"Track document operations.\",\n default: true,\n }),\n })\n .describe(\n \"OpenPanel product analytics. Set `clientId` to enable; an empty `clientId` disables it. Events are only sent after the user accepts analytics cookies. Takes precedence over the build-time PH_CONNECT_OPENPANEL_* env vars.\",\n );\n\n// ---------------------------------------------------------------------------\n// instance, reactor\n// ---------------------------------------------------------------------------\n\n/** Which reactor client Connect runs (see PHReactorClientMode). */\nexport const connectReactorClientModeSchema = z.enum([\n \"in-process\",\n \"worker\",\n \"remote\",\n \"router\",\n]);\n\nexport const connectInstanceSchema = z\n .strictObject({\n namespace: z.string().nullable().meta({\n description:\n \"Explicit storage/SharedWorker namespace for this instance. `null` derives it from the base path (and, later, the configured endpoint), so root deployments stay byte-identical.\",\n default: null,\n }),\n reactorWorker: z.boolean().meta({\n description:\n \"Host the reactor in a shared worker instead of on the main thread. Off by default; the main-thread reactor stays the proven path until cutover is verified. Packaged deployments load the worker from the prebuilt bundle `ph connect build` emits under __reactor_worker__/ (the dev server builds it lazily at the same path); when that bundle is absent the feature reports itself unavailable instead of starting a worker that cannot load.\",\n default: false,\n }),\n multiReactor: z.boolean().optional().meta({\n description:\n \"Opt-in multi-reactor routing. When on, Connect routes through the in-browser reactor plus remote backends instead of the single in-browser reactor. Off by default; the single-reactor path is unchanged.\",\n default: false,\n }),\n })\n .describe(\n \"Per-instance identity. Lets one origin host multiple isolated Connect instances, each with its own storage + SharedWorker namespace.\",\n );\n\nexport const connectReactorFeatureFlagsSchema = z\n .strictObject({\n documentDecisions: z.boolean().optional().meta({\n description:\n \"Decide writes from the document stream rather than the document meta cache, so a backdated deletion denies the operations that sort after it.\",\n default: false,\n }),\n authEnforcement: z.boolean().optional().meta({\n description:\n \"Enforce the auth scope's policy at admission, replay, and read. Requires documentDecisions.\",\n default: false,\n }),\n authGroups: z.boolean().optional().meta({\n description:\n \"Let `{ group }` principals match against the rosters of the group documents a policy names. Requires authEnforcement.\",\n default: false,\n }),\n authConditions: z.boolean().optional().meta({\n description:\n \"Evaluate `where` and `match` conditions on grants. Requires authGroups. Do not enable on a fleet `preflight:auth` reports as crossing a reducer version.\",\n default: false,\n }),\n })\n .describe(\n \"Enforcement flags. Each implies its predecessors, and the reactor refuses to boot on a set that names a later flag without an earlier one. These are consensus settings: a Connect syncing with a fleet must carry the same flags the fleet does, or the two reach different replay outcomes for the same history and diverge.\",\n );\n\nexport const connectReactorSchema = z\n .strictObject({\n featureFlags: connectReactorFeatureFlagsSchema.optional(),\n createSignaturePolicy: z.enum([\"legacy\", \"v2-required\"]).optional().meta({\n description:\n \"What new documents are created as. `v2-required` documents accept only v2 action signatures and take content-addressed ids; set `legacy` while any peer Connect syncs with predates them. Existing documents keep their policy.\",\n default: \"v2-required\",\n }),\n unsupportedStoredDocuments: z\n .enum([\"refuse\", \"read-only\"])\n .optional()\n .meta({\n description:\n \"What the reactor does when this browser's store holds documents at protocol versions this build does not run. `refuse` fails the boot and names the versions; `read-only` boots and keeps those documents read-only.\",\n default: \"refuse\",\n }),\n })\n .describe(\n \"Settings for the reactor Connect runs in the browser, on the main thread or in the shared worker alike.\",\n );\n\n// ---------------------------------------------------------------------------\n// pwa\n// ---------------------------------------------------------------------------\n\n/** A runtime-caching / denylist URL match. A string is handed to Workbox\n * verbatim; `{ source, flags }` is rebuilt into a RegExp at build time. */\nexport const connectPwaUrlPatternSchema = z\n .union([\n z.string(),\n z\n .strictObject({\n source: z.string().describe(\"RegExp source.\"),\n flags: z.string().optional().describe(\"RegExp flags (e.g. 'i').\"),\n })\n // Not expressible in JSON Schema, so only the zod path checks it.\n .refine(\n (p) => {\n try {\n new RegExp(p.source, p.flags);\n return true;\n } catch {\n return false;\n }\n },\n { message: \"source/flags do not compile to a valid RegExp\" },\n ),\n ])\n .describe(\n \"URL match. A string is matched verbatim by Workbox; { source, flags } is rebuilt into a RegExp at build time.\",\n );\n\nexport const connectPwaCacheStrategySchema = z.enum([\n \"CacheFirst\",\n \"CacheOnly\",\n \"NetworkFirst\",\n \"NetworkOnly\",\n \"StaleWhileRevalidate\",\n]);\n\n/** Serialisable subset of a Workbox `RuntimeCaching` rule. */\nexport const connectPwaRuntimeCachingSchema = z.strictObject({\n urlPattern: connectPwaUrlPatternSchema,\n handler: connectPwaCacheStrategySchema,\n method: z.enum([\"GET\", \"POST\", \"PUT\", \"DELETE\", \"HEAD\", \"PATCH\"]).optional(),\n options: z\n .strictObject({\n cacheName: z.string().optional(),\n networkTimeoutSeconds: z\n .number()\n .optional()\n .describe(\n \"Seconds a NetworkFirst rule waits for the network before falling back to the cache.\",\n ),\n expiration: z\n .strictObject({\n maxEntries: z.number().optional(),\n maxAgeSeconds: z.number().optional(),\n })\n .optional(),\n cacheableResponse: z\n .strictObject({\n statuses: z.array(z.number()).optional(),\n headers: z.record(z.string(), z.string()).optional(),\n })\n .optional(),\n })\n .optional(),\n});\n\nexport const connectPwaIconSchema = z.strictObject({\n src: z.string(),\n sizes: z.string().optional(),\n type: z.string().optional(),\n purpose: z.string().optional(),\n});\n\n/** A File Handling API entry. No `action`: every handler opens at Connect's\n * app root, because consuming launched files needs Connect's own code. */\nexport const connectPwaFileHandlerSchema = z.strictObject({\n accept: z\n .record(\n z.string(),\n z.array(z.string().regex(/^\\./, \"file extensions must start with '.'\")),\n )\n .describe(\n \"MIME type → file extensions. Each extension must start with '.'; browsers ignore entries without it.\",\n ),\n icons: z\n .array(connectPwaIconSchema)\n .optional()\n .describe(\"OS-level file-type icons.\"),\n launch_type: z.enum([\"single-client\", \"multiple-clients\"]).optional(),\n});\n\n/** Web-app-manifest fields a package or project may override. */\nexport const connectPwaManifestSchema = z\n .strictObject({\n name: z.string().optional(),\n short_name: z.string().optional(),\n description: z.string().optional(),\n theme_color: z.string().optional(),\n background_color: z.string().optional(),\n display: z\n .enum([\"fullscreen\", \"standalone\", \"minimal-ui\", \"browser\"])\n .optional(),\n start_url: z.string().optional(),\n scope: z.string().optional(),\n icons: z\n .array(connectPwaIconSchema)\n .optional()\n .describe(\n \"Icons appended to the built-in set and de-duplicated by (src, sizes, purpose).\",\n ),\n file_handlers: z\n .array(connectPwaFileHandlerSchema)\n .optional()\n .describe(\n \"File associations appended after Connect's built-in .phd/.phdm handler and de-duplicated on the whole entry. Entries only declare accepted types; there is no action field, because opening the files requires Connect's own runtime handling, so every handler opens at the app root.\",\n ),\n launch_handler: z\n .strictObject({\n client_mode: z.enum([\n \"auto\",\n \"focus-existing\",\n \"navigate-existing\",\n \"navigate-new\",\n ]),\n })\n .optional()\n .describe(\n \"How the OS launches the app for handled files/links. Connect defaults to focus-existing.\",\n ),\n })\n .describe(\"Web-app-manifest field overrides.\");\n\nconst pwaShape = {\n globPatterns: z\n .array(z.string())\n .optional()\n .describe(\"Extra Workbox precache globs, unioned with the built-ins.\"),\n globIgnores: z\n .array(z.string())\n .optional()\n .describe(\"Extra precache ignore globs, unioned with the built-ins.\"),\n maximumFileSizeToCacheInBytes: z\n .number()\n .optional()\n .describe(\n \"Raise the precache file-size ceiling. The max across all contributors wins, so no contributor can shrink another's limit.\",\n ),\n runtimeCaching: z\n .array(connectPwaRuntimeCachingSchema)\n .optional()\n .describe(\n \"Runtime-caching rules appended after the built-in rules. Workbox is first-match-wins, so these cannot override a built-in rule matching the same URL.\",\n ),\n navigateFallbackDenylist: z\n .array(connectPwaUrlPatternSchema)\n .optional()\n .describe(\n \"Extra SPA navigate-fallback denylist patterns, unioned with the built-ins.\",\n ),\n};\n\nconst PWA_DESCRIPTION =\n \"Progressive-web-app / service-worker overrides, layered on Connect's built-in PWA defaults at build time. Scalar fields deep-merge (this layer wins); the array members (icons, file_handlers, globs, runtimeCaching and denylist patterns) are additive; maximumFileSizeToCacheInBytes takes the max across contributors. (categories is not set here — it is derived from the manifest's category field.) Only applied when connect.app.offline is true.\";\n\n/** `connect.pwa` as authored. */\nexport const connectPwaSchema = z\n .strictObject({ manifest: connectPwaManifestSchema.optional(), ...pwaShape })\n .describe(PWA_DESCRIPTION);\n\n// ---------------------------------------------------------------------------\n// The connect block\n// ---------------------------------------------------------------------------\n\n/**\n * The `connect` block as authored: powerhouse.config.json's `connect`, the\n * connect host's `config`, and `ph connect config` writes. Every field is\n * optional; omit the section entirely for default behaviour.\n */\nexport const connectConfigSchema = z\n .strictObject({\n branding: connectBrandingSchema.optional(),\n home: connectHomeSchema.optional(),\n app: connectAppSchema.optional(),\n ai: connectAiSchema.optional(),\n packages: connectPackagesSchema.optional(),\n drives: connectDrivesSchema.optional(),\n renown: connectRenownSchema.optional(),\n sentry: connectSentrySchema.optional(),\n openPanel: connectOpenPanelSchema.optional(),\n instance: connectInstanceSchema.optional(),\n reactor: connectReactorSchema.optional(),\n pwa: connectPwaSchema.optional(),\n })\n .describe(\n \"Connect-specific UI customisations. All fields optional; omit the section entirely for default behaviour.\",\n );\n\nexport type ConnectConfig = z.output<typeof connectConfigSchema>;\nexport type ConnectConfigInput = z.input<typeof connectConfigSchema>;\n\n// ---------------------------------------------------------------------------\n// The declared form: a connect host's `config`\n// ---------------------------------------------------------------------------\n\n/** `schema` carrying `source`'s description and meta (zod keeps them per\n * instance, so `.extend()` and a rebuilt field drop them). */\nfunction withMetaOf<S extends z.ZodType>(schema: S, source: z.ZodType): S {\n const meta = source.meta();\n return meta ? schema.meta(meta) : schema;\n}\n\n/**\n * The `connect` block with its token-able fields wrapped by `field`: the\n * fields that name another host's outputs, which a connect host's `config`\n * may write as output tokens (`ph run` resolves them before the verb).\n *\n * - `drives.defaultDrives[].url` (a remote entry): e.g. a switchboard's\n * `drives.<slug>.url` output.\n * - `renown.switchboardUrl`: a switchboard's `endpoints.graphql` output.\n *\n * The connect runner builds it with host-core's `s.tokenable` (declared:\n * tokens in; resolved: plain values only). The output type is\n * {@link ConnectConfig} either way. powerhouse.config.json's `connect` block,\n * the served config and their JSON Schemas stay {@link connectConfigSchema},\n * which takes no tokens.\n */\nexport function connectConfigSchemaWith(field: TokenField) {\n const remoteDrive = connectDefaultDriveRemoteSchema.extend({\n url: field(z.string()),\n });\n const shape = connectDrivesSchema.shape;\n const drives = withMetaOf(\n connectDrivesSchema.extend({\n defaultDrives: withMetaOf(\n z\n .array(z.union([remoteDrive, connectDefaultDriveLocalSchema]))\n .optional(),\n shape.defaultDrives,\n ),\n }),\n connectDrivesSchema,\n );\n const renown = withMetaOf(\n connectRenownSchema.extend({\n switchboardUrl: withMetaOf(\n field(z.string()).optional(),\n connectRenownSchema.shape.switchboardUrl,\n ),\n }),\n connectRenownSchema,\n );\n return withMetaOf(\n connectConfigSchema.extend({\n drives: drives.optional(),\n renown: renown.optional(),\n }),\n connectConfigSchema,\n );\n}\n\n/** The declared `connect` block: {@link connectConfigSchemaWith} with every\n * token accepted in its token-able fields. */\nexport const declaredConnectConfigSchema =\n /* @__PURE__ */ connectConfigSchemaWith(tokenable);\n\n/** What a connect host's `config` may hold (tokens in token-able fields). */\nexport type DeclaredConnectConfigInput = z.input<\n typeof declaredConnectConfigSchema\n>;\n\n// ---------------------------------------------------------------------------\n// The served runtime config: authored fields plus what is derived or\n// projected. These fields are never authored, so the authored schema (and\n// the JSON Schema fragment emitted from it) rejects them.\n// ---------------------------------------------------------------------------\n\n/** One entry of the host.js composition, projected into the served config as\n * data (module specifier + validated config). */\nexport const connectCompositionEntrySchema = z.strictObject({\n module: z.string(),\n config: z.record(z.string(), z.unknown()).optional(),\n});\n\n/** `instance` plus `reactorClient`, derived from the host's reactor backends. */\nexport const connectRuntimeInstanceSchema = connectInstanceSchema.extend({\n reactorClient: connectReactorClientModeSchema.optional(),\n});\n\n/** The manifest plus `categories`, derived from contributors' `category`. */\nexport const connectRuntimePwaManifestSchema = connectPwaManifestSchema.extend({\n categories: z.array(z.string()).optional(),\n});\n\nexport const connectRuntimePwaSchema = connectPwaSchema.extend({\n manifest: connectRuntimePwaManifestSchema.optional(),\n});\n\n/** The served `connect` block (runtime powerhouse.config.json). */\nexport const connectRuntimeConfigSchema = connectConfigSchema.extend({\n composition: z.array(connectCompositionEntrySchema).optional(),\n instance: connectRuntimeInstanceSchema.optional(),\n pwa: connectRuntimePwaSchema.optional(),\n});\n\nexport type ConnectRuntimeConfig = z.output<typeof connectRuntimeConfigSchema>;\n"],"mappings":";;;AAeA,MAAM,YACJ;AACF,MAAM,uBACJ;;;AAIF,MAAa,wBAAwB,EAAE,OAAO,CAAC,CAAC,SAAS,SAAS;;AAGlE,MAAM,oBAAoB,cAAc,yBACtC,sBAAsB,SAAS,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS,WAAW;;;AAIlE,MAAa,4BAA4B,EACtC,MAAM,CACL,uBACA,EAAE,aAAa;CACb,OAAO;CACP,MAAM,sBAAsB,SAAS,CAAC,CAAC,SAAS;AAClD,CAAC,CACH,CAAC,CAAC,CACD,SACC,mFACF;;AAGF,MAAa,4BAA4B,EAAE,MAAM,CAC/C,EAAE,OAAO,GACT,EAAE,aAAa;CACb,OAAO,EAAE,OAAO;CAChB,MAAM,EAAE,OAAO,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS;AACvC,CAAC,CACH,C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,EAAE,OAAO,CAAC,EACvB,CAAC;CACD,MAAM,QAAQ,oBAAoB;CAClC,MAAM,SAAS,WACb,oBAAoB,OAAO,EACzB,eAAe,WACb,EACG,MAAM,EAAE,MAAM,CAAC,aAAa,8BAA8B,CAAC,CAAC,CAAC,CAC7D,SAAS,GACZ,MAAM,aACR,EACF,CAAC,GACD,mBACF;CACA,MAAM,SAAS,WACb,oBAAoB,OAAO,EACzB,gBAAgB,WACd,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,SAAS,GAC3B,oBAAoB,MAAM,cAC5B,EACF,CAAC,GACD,mBACF;CACA,OAAO,WACL,oBAAoB,OAAO;EACzB,QAAQ,OAAO,SAAS;EACxB,QAAQ,OAAO,SAAS;CAC1B,CAAC,GACD,mBACF;AACF;;;AAIA,MAAa,8BACK,wCAAwB,SAAS;;;AAenD,MAAa,gCAAgC,EAAE,aAAa;CAC1D,QAAQ,EAAE,OAAO;CACjB,QAAQ,EAAE,OAAO,EAAE,OAAO,GAAG,EAAE,QAAQ,CAAC,CAAC,CAAC,SAAS;AACrD,CAAC;;AAGD,MAAa,+BAA+B,sBAAsB,OAAO,EACvE,eAAe,+BAA+B,SAAS,EACzD,CAAC;;AAGD,MAAa,kCAAkC,yBAAyB,OAAO,EAC7E,YAAY,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,SAAS,EAC3C,CAAC;AAED,MAAa,0BAA0B,iBAAiB,OAAO,EAC7D,UAAU,gCAAgC,SAAS,EACrD,CAAC;;AAGD,MAAa,6BAA6B,oBAAoB,OAAO;CACnE,aAAa,EAAE,MAAM,6BAA6B,CAAC,CAAC,SAAS;CAC7D,UAAU,6BAA6B,SAAS;CAChD,KAAK,wBAAwB,SAAS;AACxC,CAAC"}
1
+ {"version":3,"file":"connect-config-schema.js","names":[],"sources":["../../connect/connect-config-schema.ts"],"sourcesContent":["// Single source of Connect's config (browser-safe, zod only). The PHConnect*\n// types (../clis/types.ts) and the JSON Schema fragments Ajv consumes\n// (./schema-fragments.ts) are derived from it.\n//\n// Never `.default(x)`: it fills values on parse; use `.meta({ default })`.\n// Never `.meta({ id })`: it emits `$defs`, whose refs break once the fragment\n// is embedded in another schema root.\n\nimport { z } from \"zod\";\nimport { tokenable, type TokenField } from \"../host-tokens/index.js\";\n\n// ---------------------------------------------------------------------------\n// Images, colours, lengths and backgrounds\n// ---------------------------------------------------------------------------\n\nconst IMAGE_REF =\n \"Image reference: a project-relative file path, a URL, or a data URI.\";\nconst IMAGE_REF_OR_DEFAULT =\n \"Image reference: a project-relative file path (resolved by the Connect build), a URL, or a data URI. null keeps the default.\";\n\n/** An image reference: a project-relative file path (the Connect build turns\n * it into a data URI or an emitted file), a URL, or a data URI. */\nexport const connectImageRefSchema = z.string().describe(IMAGE_REF);\n\n/** An image reference where `null` (or omitting it) keeps the default. */\nconst optionalImageRef = (description = IMAGE_REF_OR_DEFAULT) =>\n connectImageRefSchema.nullable().optional().describe(description);\n\n/** An image per colour scheme: one reference for both, or `{ light, dark }`\n * (`dark` falls back to `light`). */\nexport const connectSchemedImageSchema = z\n .union([\n connectImageRefSchema,\n z.strictObject({\n light: connectImageRefSchema,\n dark: connectImageRefSchema.nullable().optional(),\n }),\n ])\n .describe(\n \"One image for both colour schemes, or { light, dark } (dark falls back to light).\",\n );\n\n/** A CSS colour per colour scheme (`dark` falls back to `light`). */\nexport const connectSchemedColorSchema = z.union([\n z.string(),\n z.strictObject({\n light: z.string(),\n dark: z.string().nullable().optional(),\n }),\n]);\n\n/** A CSS length: a number is px, a string is passed through as written. */\nexport const connectLengthSchema = z.union([z.number(), z.string()]);\n\nconst optionalLength = () =>\n connectLengthSchema\n .nullable()\n .optional()\n .describe(\n 'A CSS length: a number is px; a string is used as written (\"40%\", \"min(55%, 880px)\", \"calc(50% - 120px)\").',\n );\n\n/** Distances to the four edges; each is optional. */\nexport const connectEdgesSchema = z.strictObject({\n top: optionalLength(),\n right: optionalLength(),\n bottom: optionalLength(),\n left: optionalLength(),\n});\n\n/** One image of a decorated pane, absolutely positioned inside it. */\nexport const connectBackgroundLayerSchema = z\n .strictObject({\n src: connectSchemedImageSchema,\n position: connectEdgesSchema\n .nullable()\n .optional()\n .describe(\n \"Distances to the pane's edges; at most one per axis. Omitted: centred both ways.\",\n ),\n width: optionalLength(),\n height: optionalLength(),\n minWidth: optionalLength(),\n minHeight: optionalLength(),\n maxWidth: optionalLength(),\n maxHeight: optionalLength(),\n opacity: z\n .number()\n .min(0)\n .max(1)\n .nullable()\n .optional()\n .describe(\"0 to 1 (default 1).\"),\n fade: connectEdgesSchema\n .nullable()\n .optional()\n .describe(\n \"Feather depth per edge, fading the layer into the page colour.\",\n ),\n })\n .describe(\n \"An image laid over the page, absolutely positioned: the edges set in `position` pin it, an axis with neither edge set is centred.\",\n );\n\n/** A decorated pane: the page colour and the images laid over it. */\nexport const connectBackgroundLayersSchema = z.strictObject({\n color: connectSchemedColorSchema\n .nullable()\n .optional()\n .describe(\n \"The page colour, or { light, dark }. Omitted or null: the theme's page background.\",\n ),\n layers: z\n .array(connectBackgroundLayerSchema)\n .describe(\"Painted in order; the first is at the back.\"),\n});\n\n/** A pane's background: layers over a page colour, or one image as\n * shorthand for a single layer pinned bottom-right. */\nexport const connectBackgroundSchema = z\n .union([connectImageRefSchema, connectBackgroundLayersSchema])\n .describe(\n \"Layered images over a page colour, or a single image pinned to the bottom-right corner. null keeps the default.\",\n );\n\n// ---------------------------------------------------------------------------\n// branding, home\n// ---------------------------------------------------------------------------\n\n/** The loading image and the motion applied to it. */\nexport const connectLoaderSchema = z.strictObject({\n src: connectImageRefSchema,\n animation: z\n .enum([\"pulse\", \"spin\", \"none\"])\n .nullable()\n .optional()\n .describe(\"Motion applied to the image (default pulse).\"),\n size: z\n .number()\n .min(16)\n .max(512)\n .nullable()\n .optional()\n .describe(\n \"Rendered width in CSS pixels (default 96); the height follows the image.\",\n ),\n});\n\n/** `connect.branding`: Connect's identity and look. */\nexport const connectBrandingSchema = z\n .strictObject({\n appName: z\n .string()\n .nullable()\n .optional()\n .describe(\n \"Browser tab title, installed-app name and in-app brand text. null or omitted: 'Powerhouse Connect'.\",\n ),\n icon: optionalImageRef(\n \"App icon master (1024x1024 PNG recommended, or an SVG). The favicons and installed-app icons are found next to it as <name>_16x16.png, _32x32, _64x64, _192x192 and _512x512; the 64 px one is the in-app logo. null or omitted: Connect's icon.\",\n ),\n favicon: z\n .string()\n .nullable()\n .optional()\n .describe(\n \"The browser tab icon: a file (.ico, .svg or .png) relative to the project, served and built as icon.ico, or as icon.svg or icon.png for those types. A build input; the built runtime config leaves it out. `ph connect build --favicon` wins over it.\",\n ),\n loader: z\n .union([connectImageRefSchema, connectLoaderSchema])\n .nullable()\n .optional()\n .describe(\n 'The loading image (first paint, app start, drive and editor loading). A path gets a gentle pulse; { src, animation, size } says otherwise, with animation \"none\" for an image that animates itself (animated SVG, GIF or WebP). null or omitted: Connect\\'s animated logo.',\n ),\n })\n .describe(\n \"App identity and visual branding. Every field is optional; null means the default.\",\n );\n\n/** `connect.home`: the home screen (the generic chrome's landing page). */\nexport const connectHomeSchema = z\n .strictObject({\n background: connectBackgroundSchema\n .nullable()\n .optional()\n .describe(\n \"The home screen's background: { color, layers } with each image positioned and sized, or one image pinned bottom-right. null or omitted: the bundled gradient.\",\n ),\n })\n .describe(\"The home screen (the generic chrome's landing page).\");\n\n// ---------------------------------------------------------------------------\n// app, ai, packages\n// ---------------------------------------------------------------------------\n\nexport const connectAppSchema = z\n .strictObject({\n logLevel: z.enum([\"debug\", \"info\", \"warn\", \"error\"]).optional().meta({\n description:\n \"Log level applied by Connect's logger at boot. Affects browser-side output only.\",\n default: \"info\",\n }),\n basePath: z.string().optional().meta({\n description:\n \"Base path Connect is mounted under (e.g. '/connect' for subpath deploys). Normalised at runtime to start and end with '/'. Defaults to the build-time BASE_URL.\",\n default: \"/\",\n }),\n offline: z.boolean().optional().meta({\n description:\n \"When true (default), the build emits a precaching service worker so Connect's app shell works offline, and the SPA registers it at boot. Set false to opt this deployment out: no service worker is built, the SPA skips registration, and any previously-installed worker is unregistered.\",\n default: true,\n }),\n studioMode: z.boolean().optional().meta({\n description:\n \"Studio mode. Enables builder-only capabilities: Connect loads the vetra package and exposes DocumentModel (and vetra spec types) as creatable documents. Forced on by `ph vetra` / `ph connect studio`; false by default.\",\n default: false,\n }),\n workflowsEnabled: z\n .boolean()\n .optional()\n .describe(\n \"Powerhouse workflows in Connect. When true the tab loads the @powerhousedao/workflow package (workflow + connection documents, their editors and Workflow Studio) and the reactor worker registers its document models. Falls back to the top-level `workflows.enabled`; set it to override that for Connect. Independent of studioMode. False when neither is set.\",\n ),\n })\n .describe(\"Top-level Connect application behaviour.\");\n\nexport const connectAiSchema = z\n .strictObject({\n assistantEnabled: z.boolean().optional().meta({\n description:\n \"When true, Connect mounts the in-browser AI assistant (bottom-right chat FAB that talks to a user-configured OpenAI-compatible endpoint and acts on the reactor). Disabled by default.\",\n default: false,\n }),\n })\n .describe(\"AI assistant (chat) behaviour.\");\n\nexport const connectPackagesSchema = z\n .strictObject({\n externalEnabled: z.boolean().optional().meta({\n description:\n \"When false, Connect refuses to load any package that wasn't bundled at build time. Affirmative replacement for the legacy PH_CONNECT_EXTERNAL_PACKAGES_DISABLED env var.\",\n default: true,\n }),\n liveReload: z.boolean().optional().meta({\n description:\n \"When true, Connect subscribes to the static-mode `/__packages` SSE channel so live publishes flow into the running tab without a page reload. Only works under hosting that serves this channel (e.g. ph-clint static mode).\",\n default: false,\n }),\n })\n .describe(\n \"Runtime behaviour for the Connect package manager (separate from top-level `packages[]`, which lists which packages to load).\",\n );\n\n// ---------------------------------------------------------------------------\n// drives\n// ---------------------------------------------------------------------------\n\nconst EXPLORER_ICONS_DESCRIPTION =\n \"The drive explorer's icons (the generic plugin's); each null keeps the built-in icon.\";\n\n/** The drive explorer's icons: the generic chrome's, owned by the generic\n * plugin. Each `null` keeps the built-in icon. */\nexport const connectExplorerIconsSchema = z\n .strictObject({\n localDrive: optionalImageRef(\"Local drives without an icon of their own.\"),\n remoteDrive: optionalImageRef(\n \"Remote drives without an icon of their own.\",\n ),\n folder: optionalImageRef(\"Folders.\"),\n document: optionalImageRef(\n \"Documents whose type has no icon in `documents`.\",\n ),\n documents: z\n .record(z.string(), connectImageRefSchema)\n .nullable()\n .optional()\n .describe('Per document type, e.g. \"acme/invoice\".'),\n })\n .describe(EXPLORER_ICONS_DESCRIPTION);\n\nexport const connectDefaultDriveRemoteSchema = z.strictObject({\n url: z.string(),\n name: z.string().nullable().optional(),\n icon: z.string().nullable().optional(),\n});\n\nexport const connectDefaultDriveLocalSchema = z.strictObject({\n local: z\n .literal(true)\n .describe(\n \"Discriminator: this entry is a local drive created on first boot.\",\n ),\n id: z\n .string()\n .describe(\n \"Stable drive id. The drive is created with this id on first boot and is not re-created on later boots.\",\n ),\n name: z.string().nullable().optional(),\n icon: z.string().nullable().optional(),\n app: z\n .string()\n .optional()\n .describe(\"Drive app (preferred editor) to open on the drive.\"),\n});\n\nexport const connectDefaultDriveSchema = z.union([\n connectDefaultDriveRemoteSchema,\n connectDefaultDriveLocalSchema,\n]);\n\n/** `connect.drives.sections.{remote,local}`: three affirmative toggles. */\nexport const connectDriveSectionSchema = z\n .strictObject({\n enabled: z.boolean().optional().meta({\n description: \"When false, the section is hidden in the sidebar.\",\n default: true,\n }),\n allowAdd: z.boolean().optional().meta({\n description:\n \"When false, the section's 'add drive' affordance is hidden.\",\n default: true,\n }),\n allowDelete: z.boolean().optional().meta({\n description:\n \"When false, drives in this section cannot be deleted from the UI.\",\n default: true,\n }),\n })\n .describe(\n \"Visibility and add/delete affordances for a drive section in the sidebar.\",\n );\n\nexport const connectDriveSectionsSchema = z\n .strictObject({\n remote: connectDriveSectionSchema.optional(),\n local: connectDriveSectionSchema.optional(),\n })\n .describe(\n \"Per-section visibility and affordance toggles. `remote` covers what was historically split into 'public' + 'cloud'; `local` is browser-local drives.\",\n );\n\n/** Mirrors DRIVES_PRESERVE_STRATEGIES (../clis/constants.ts, which imports\n * node: modules, so it is not imported here); a test pins the two. */\nexport const connectDrivePreserveStrategySchema = z.enum([\n \"preserve-all\",\n \"preserve-by-url-and-detach\",\n]);\n\nexport const connectDrivesSchema = z\n .strictObject({\n allowAddDrive: z.boolean().optional().meta({\n description:\n \"When false, the SPA hides the 'add drive' affordance entirely (top-level). Per-section overrides live in `sections.{remote,local}.allowAdd`.\",\n default: true,\n }),\n defaultDrives: z.array(connectDefaultDriveSchema).optional().meta({\n description:\n \"Drives the SPA auto-connects to on first load. Each entry is either a remote drive (a URL, with optional name/icon overrides) or a local drive (created locally on first boot, with a stable id and optional name/icon/app).\",\n default: [],\n }),\n preserveStrategy: connectDrivePreserveStrategySchema\n .optional()\n .describe(\n \"Strategy applied when defaultDrives change between deploys. 'preserve-all' keeps user-added drives untouched; 'preserve-by-url-and-detach' detaches removed default drives. No schema default — opt-in only.\",\n ),\n sections: connectDriveSectionsSchema.optional(),\n icons: connectExplorerIconsSchema\n .nullable()\n .optional()\n .describe(EXPLORER_ICONS_DESCRIPTION),\n })\n .describe(\"Default-drive and add-drive UI behaviour.\");\n\n// ---------------------------------------------------------------------------\n// renown, sentry, openPanel\n// ---------------------------------------------------------------------------\n\nexport const connectRenownRainbowAdapterSchema = z\n .strictObject({\n walletConnectProjectId: z\n .string()\n .optional()\n .describe(\n \"WalletConnect project id; required for this adapter to function.\",\n ),\n infuraProjectId: z\n .string()\n .optional()\n .describe(\"Optional Infura project id used to build RPC transports.\"),\n })\n .describe(\"wagmi + RainbowKit external-wallet adapter config.\");\n\nexport const connectRenownPrivyAdapterSchema = z\n .strictObject({\n appId: z\n .string()\n .optional()\n .describe(\"Privy application id; required for this adapter to function.\"),\n clientId: z.string().optional().describe(\"Optional Privy client id.\"),\n methods: z\n .array(z.string())\n .optional()\n .describe(\n \"Login methods this adapter offers; default per adapter when omitted.\",\n ),\n })\n .describe(\"Privy embedded/social adapter config.\");\n\nexport const connectRenownAdaptersSchema = z\n .strictObject({\n rainbow: connectRenownRainbowAdapterSchema.optional(),\n privy: connectRenownPrivyAdapterSchema.optional(),\n })\n .describe(\n \"Per-adapter wallet config for in-page auth. Presence of an adapter key enables it; omit or leave empty for redirect-only behaviour.\",\n );\n\nexport const connectRenownSchema = z\n .strictObject({\n url: z.string().optional().meta({\n description: \"Renown auth service URL.\",\n default: \"https://www.renown.id\",\n }),\n networkId: z.string().optional().meta({\n description: \"CAIP-2 network namespace (e.g. 'eip155').\",\n default: \"eip155\",\n }),\n chainId: z.number().optional().meta({\n description: \"CAIP-2 chain reference within the network namespace.\",\n default: 1,\n }),\n namespace: z\n .string()\n .optional()\n .describe(\n \"Renown localStorage namespace; share it across Connects to share login.\",\n ),\n switchboardUrl: z\n .string()\n .optional()\n .describe(\n \"Switchboard GraphQL URL. When set, Connect enables in-page (no-redirect) Renown sign-in; otherwise it falls back to the redirect flow via `url`.\",\n ),\n adapters: connectRenownAdaptersSchema.optional(),\n })\n .describe(\"Renown identity / authentication coordinates.\");\n\nexport const connectSentrySchema = z\n .strictObject({\n dsn: z.string().nullable().optional().meta({\n description:\n \"Sentry DSN URL. `null` disables Sentry entirely; the SPA never loads the Sentry SDK chunk.\",\n default: null,\n }),\n env: z.string().optional().meta({\n description:\n \"Sentry environment label, surfaced as the `environment` tag on every event.\",\n default: \"dev\",\n }),\n tracing: z.boolean().optional().meta({\n description: \"Enable Sentry performance tracing.\",\n default: false,\n }),\n })\n .describe(\n \"Sentry error-tracking coordinates. Set `dsn` to enable Sentry; leave `dsn` null to disable. The Sentry release tag stays build-time (stamped via Vite's `define` from WORKSPACE_VERSION) so it always matches the sourcemaps uploaded by CI.\",\n );\n\nexport const connectOpenPanelSchema = z\n .strictObject({\n clientId: z.string().optional().meta({\n description:\n \"OpenPanel client id. Empty string disables OpenPanel entirely.\",\n default: \"\",\n }),\n apiUrl: z\n .string()\n .optional()\n .describe(\n \"OpenPanel API URL for self-hosted instances (e.g. 'https://openpanel.example/api'). Omit to use OpenPanel's hosted API.\",\n ),\n trackUiEvents: z.boolean().optional().meta({\n description: \"Track UI events.\",\n default: true,\n }),\n trackOperations: z.boolean().optional().meta({\n description: \"Track document operations.\",\n default: true,\n }),\n })\n .describe(\n \"OpenPanel product analytics. Set `clientId` to enable; an empty `clientId` disables it. Events are only sent after the user accepts analytics cookies. Takes precedence over the build-time PH_CONNECT_OPENPANEL_* env vars.\",\n );\n\n// ---------------------------------------------------------------------------\n// instance, reactor\n// ---------------------------------------------------------------------------\n\n/** Which reactor client Connect runs (see PHReactorClientMode). */\nexport const connectReactorClientModeSchema = z.enum([\n \"in-process\",\n \"worker\",\n \"remote\",\n \"router\",\n]);\n\nexport const connectInstanceSchema = z\n .strictObject({\n namespace: z.string().nullable().meta({\n description:\n \"Explicit storage/SharedWorker namespace for this instance. `null` derives it from the base path (and, later, the configured endpoint), so root deployments stay byte-identical.\",\n default: null,\n }),\n reactorWorker: z.boolean().meta({\n description:\n \"Host the reactor in a shared worker instead of on the main thread. Off by default; the main-thread reactor stays the proven path until cutover is verified. Packaged deployments load the worker from the prebuilt bundle `ph connect build` emits under __reactor_worker__/ (the dev server builds it lazily at the same path); when that bundle is absent the feature reports itself unavailable instead of starting a worker that cannot load.\",\n default: false,\n }),\n multiReactor: z.boolean().optional().meta({\n description:\n \"Opt-in multi-reactor routing. When on, Connect routes through the in-browser reactor plus remote backends instead of the single in-browser reactor. Off by default; the single-reactor path is unchanged.\",\n default: false,\n }),\n })\n .describe(\n \"Per-instance identity. Lets one origin host multiple isolated Connect instances, each with its own storage + SharedWorker namespace.\",\n );\n\nexport const connectReactorFeatureFlagsSchema = z\n .strictObject({\n documentDecisions: z.boolean().optional().meta({\n description:\n \"Decide writes from the document stream rather than the document meta cache, so a backdated deletion denies the operations that sort after it.\",\n default: false,\n }),\n authEnforcement: z.boolean().optional().meta({\n description:\n \"Enforce the auth scope's policy at admission, replay, and read. Requires documentDecisions.\",\n default: false,\n }),\n authGroups: z.boolean().optional().meta({\n description:\n \"Let `{ group }` principals match against the rosters of the group documents a policy names. Requires authEnforcement.\",\n default: false,\n }),\n authConditions: z.boolean().optional().meta({\n description:\n \"Evaluate `where` and `match` conditions on grants. Requires authGroups. Do not enable on a fleet `preflight:auth` reports as crossing a reducer version.\",\n default: false,\n }),\n })\n .describe(\n \"Enforcement flags. Each implies its predecessors, and the reactor refuses to boot on a set that names a later flag without an earlier one. These are consensus settings: a Connect syncing with a fleet must carry the same flags the fleet does, or the two reach different replay outcomes for the same history and diverge.\",\n );\n\nexport const connectReactorSchema = z\n .strictObject({\n featureFlags: connectReactorFeatureFlagsSchema.optional(),\n createSignaturePolicy: z.enum([\"legacy\", \"v2-required\"]).optional().meta({\n description:\n \"What new documents are created as. `v2-required` documents accept only v2 action signatures and take content-addressed ids; set `legacy` while any peer Connect syncs with predates them. Existing documents keep their policy.\",\n default: \"v2-required\",\n }),\n unsupportedStoredDocuments: z\n .enum([\"refuse\", \"read-only\"])\n .optional()\n .meta({\n description:\n \"What the reactor does when this browser's store holds documents at protocol versions this build does not run. `refuse` fails the boot and names the versions; `read-only` boots and keeps those documents read-only.\",\n default: \"refuse\",\n }),\n })\n .describe(\n \"Settings for the reactor Connect runs in the browser, on the main thread or in the shared worker alike.\",\n );\n\n// ---------------------------------------------------------------------------\n// pwa\n// ---------------------------------------------------------------------------\n\n/** A runtime-caching / denylist URL match. A string is handed to Workbox\n * verbatim; `{ source, flags }` is rebuilt into a RegExp at build time. */\nexport const connectPwaUrlPatternSchema = z\n .union([\n z.string(),\n z\n .strictObject({\n source: z.string().describe(\"RegExp source.\"),\n flags: z.string().optional().describe(\"RegExp flags (e.g. 'i').\"),\n })\n // Not expressible in JSON Schema, so only the zod path checks it.\n .refine(\n (p) => {\n try {\n new RegExp(p.source, p.flags);\n return true;\n } catch {\n return false;\n }\n },\n { message: \"source/flags do not compile to a valid RegExp\" },\n ),\n ])\n .describe(\n \"URL match. A string is matched verbatim by Workbox; { source, flags } is rebuilt into a RegExp at build time.\",\n );\n\nexport const connectPwaCacheStrategySchema = z.enum([\n \"CacheFirst\",\n \"CacheOnly\",\n \"NetworkFirst\",\n \"NetworkOnly\",\n \"StaleWhileRevalidate\",\n]);\n\n/** Serialisable subset of a Workbox `RuntimeCaching` rule. */\nexport const connectPwaRuntimeCachingSchema = z.strictObject({\n urlPattern: connectPwaUrlPatternSchema,\n handler: connectPwaCacheStrategySchema,\n method: z.enum([\"GET\", \"POST\", \"PUT\", \"DELETE\", \"HEAD\", \"PATCH\"]).optional(),\n options: z\n .strictObject({\n cacheName: z.string().optional(),\n networkTimeoutSeconds: z\n .number()\n .optional()\n .describe(\n \"Seconds a NetworkFirst rule waits for the network before falling back to the cache.\",\n ),\n expiration: z\n .strictObject({\n maxEntries: z.number().optional(),\n maxAgeSeconds: z.number().optional(),\n })\n .optional(),\n cacheableResponse: z\n .strictObject({\n statuses: z.array(z.number()).optional(),\n headers: z.record(z.string(), z.string()).optional(),\n })\n .optional(),\n })\n .optional(),\n});\n\nexport const connectPwaIconSchema = z.strictObject({\n src: z.string(),\n sizes: z.string().optional(),\n type: z.string().optional(),\n purpose: z.string().optional(),\n});\n\n/** A File Handling API entry. No `action`: every handler opens at Connect's\n * app root, because consuming launched files needs Connect's own code. */\nexport const connectPwaFileHandlerSchema = z.strictObject({\n accept: z\n .record(\n z.string(),\n z.array(z.string().regex(/^\\./, \"file extensions must start with '.'\")),\n )\n .describe(\n \"MIME type → file extensions. Each extension must start with '.'; browsers ignore entries without it.\",\n ),\n icons: z\n .array(connectPwaIconSchema)\n .optional()\n .describe(\"OS-level file-type icons.\"),\n launch_type: z.enum([\"single-client\", \"multiple-clients\"]).optional(),\n});\n\n/** Web-app-manifest fields a package or project may override. */\nexport const connectPwaManifestSchema = z\n .strictObject({\n name: z.string().optional(),\n short_name: z.string().optional(),\n description: z.string().optional(),\n theme_color: z.string().optional(),\n background_color: z.string().optional(),\n display: z\n .enum([\"fullscreen\", \"standalone\", \"minimal-ui\", \"browser\"])\n .optional(),\n start_url: z.string().optional(),\n scope: z.string().optional(),\n icons: z\n .array(connectPwaIconSchema)\n .optional()\n .describe(\n \"Icons appended to the built-in set and de-duplicated by (src, sizes, purpose).\",\n ),\n file_handlers: z\n .array(connectPwaFileHandlerSchema)\n .optional()\n .describe(\n \"File associations appended after Connect's built-in .phd/.phdm handler and de-duplicated on the whole entry. Entries only declare accepted types; there is no action field, because opening the files requires Connect's own runtime handling, so every handler opens at the app root.\",\n ),\n launch_handler: z\n .strictObject({\n client_mode: z.enum([\n \"auto\",\n \"focus-existing\",\n \"navigate-existing\",\n \"navigate-new\",\n ]),\n })\n .optional()\n .describe(\n \"How the OS launches the app for handled files/links. Connect defaults to focus-existing.\",\n ),\n })\n .describe(\"Web-app-manifest field overrides.\");\n\nconst pwaShape = {\n globPatterns: z\n .array(z.string())\n .optional()\n .describe(\"Extra Workbox precache globs, unioned with the built-ins.\"),\n globIgnores: z\n .array(z.string())\n .optional()\n .describe(\"Extra precache ignore globs, unioned with the built-ins.\"),\n maximumFileSizeToCacheInBytes: z\n .number()\n .optional()\n .describe(\n \"Raise the precache file-size ceiling. The max across all contributors wins, so no contributor can shrink another's limit.\",\n ),\n runtimeCaching: z\n .array(connectPwaRuntimeCachingSchema)\n .optional()\n .describe(\n \"Runtime-caching rules appended after the built-in rules. Workbox is first-match-wins, so these cannot override a built-in rule matching the same URL.\",\n ),\n navigateFallbackDenylist: z\n .array(connectPwaUrlPatternSchema)\n .optional()\n .describe(\n \"Extra SPA navigate-fallback denylist patterns, unioned with the built-ins.\",\n ),\n};\n\nconst PWA_DESCRIPTION =\n \"Progressive-web-app / service-worker overrides, layered on Connect's built-in PWA defaults at build time. Scalar fields deep-merge (this layer wins); the array members (icons, file_handlers, globs, runtimeCaching and denylist patterns) are additive; maximumFileSizeToCacheInBytes takes the max across contributors. (categories is not set here — it is derived from the manifest's category field.) Only applied when connect.app.offline is true.\";\n\n/** `connect.pwa` as authored. */\nexport const connectPwaSchema = z\n .strictObject({ manifest: connectPwaManifestSchema.optional(), ...pwaShape })\n .describe(PWA_DESCRIPTION);\n\n// ---------------------------------------------------------------------------\n// The connect block\n// ---------------------------------------------------------------------------\n\n/**\n * The `connect` block as authored: powerhouse.config.json's `connect`, the\n * connect host's `config`, and `ph connect config` writes. Every field is\n * optional; omit the section entirely for default behaviour.\n */\nexport const connectConfigSchema = z\n .strictObject({\n branding: connectBrandingSchema.optional(),\n home: connectHomeSchema.optional(),\n app: connectAppSchema.optional(),\n ai: connectAiSchema.optional(),\n packages: connectPackagesSchema.optional(),\n drives: connectDrivesSchema.optional(),\n renown: connectRenownSchema.optional(),\n sentry: connectSentrySchema.optional(),\n openPanel: connectOpenPanelSchema.optional(),\n instance: connectInstanceSchema.optional(),\n reactor: connectReactorSchema.optional(),\n pwa: connectPwaSchema.optional(),\n })\n .describe(\n \"Connect-specific UI customisations. All fields optional; omit the section entirely for default behaviour.\",\n );\n\nexport type ConnectConfig = z.output<typeof connectConfigSchema>;\nexport type ConnectConfigInput = z.input<typeof connectConfigSchema>;\n\n// ---------------------------------------------------------------------------\n// The declared form: a connect host's `config`\n// ---------------------------------------------------------------------------\n\n/** `schema` carrying `source`'s description and meta (zod keeps them per\n * instance, so `.extend()` and a rebuilt field drop them). */\nfunction withMetaOf<S extends z.ZodType>(schema: S, source: z.ZodType): S {\n const meta = source.meta();\n return meta ? schema.meta(meta) : schema;\n}\n\n/**\n * The `connect` block with its token-able fields wrapped by `field`: the\n * fields that name another host's outputs, which a connect host's `config`\n * may write as output tokens (`ph run` resolves them before the verb).\n *\n * - `drives.defaultDrives[].url` (a remote entry): e.g. a switchboard's\n * `drives.<slug>.url` output.\n * - `renown.switchboardUrl`: a switchboard's `endpoints.graphql` output.\n *\n * The connect runner builds it with host-core's `s.tokenable` (declared:\n * tokens in; resolved: plain values only). The output type is\n * {@link ConnectConfig} either way. powerhouse.config.json's `connect` block,\n * the served config and their JSON Schemas stay {@link connectConfigSchema},\n * which takes no tokens.\n */\nexport function connectConfigSchemaWith(field: TokenField) {\n const remoteDrive = connectDefaultDriveRemoteSchema.extend({\n url: field(z.string()),\n });\n const shape = connectDrivesSchema.shape;\n const drives = withMetaOf(\n connectDrivesSchema.extend({\n defaultDrives: withMetaOf(\n z\n .array(z.union([remoteDrive, connectDefaultDriveLocalSchema]))\n .optional(),\n shape.defaultDrives,\n ),\n }),\n connectDrivesSchema,\n );\n const renown = withMetaOf(\n connectRenownSchema.extend({\n switchboardUrl: withMetaOf(\n field(z.string()).optional(),\n connectRenownSchema.shape.switchboardUrl,\n ),\n }),\n connectRenownSchema,\n );\n return withMetaOf(\n connectConfigSchema.extend({\n drives: drives.optional(),\n renown: renown.optional(),\n }),\n connectConfigSchema,\n );\n}\n\n/** The declared `connect` block: {@link connectConfigSchemaWith} with every\n * token accepted in its token-able fields. */\nexport const declaredConnectConfigSchema =\n /* @__PURE__ */ connectConfigSchemaWith(tokenable);\n\n/** What a connect host's `config` may hold (tokens in token-able fields). */\nexport type DeclaredConnectConfigInput = z.input<\n typeof declaredConnectConfigSchema\n>;\n\n// ---------------------------------------------------------------------------\n// The served runtime config: authored fields plus what is derived or\n// projected. These fields are never authored, so the authored schema (and\n// the JSON Schema fragment emitted from it) rejects them.\n// ---------------------------------------------------------------------------\n\n/** One entry of the host.js composition, projected into the served config as\n * data (module specifier + validated config). */\nexport const connectCompositionEntrySchema = z.strictObject({\n module: z.string(),\n config: z.record(z.string(), z.unknown()).optional(),\n});\n\n/** `instance` plus `reactorClient`, derived from the host's reactor backends. */\nexport const connectRuntimeInstanceSchema = connectInstanceSchema.extend({\n reactorClient: connectReactorClientModeSchema.optional(),\n});\n\n/** The manifest plus `categories`, derived from contributors' `category`. */\nexport const connectRuntimePwaManifestSchema = connectPwaManifestSchema.extend({\n categories: z.array(z.string()).optional(),\n});\n\nexport const connectRuntimePwaSchema = connectPwaSchema.extend({\n manifest: connectRuntimePwaManifestSchema.optional(),\n});\n\n/** The served `connect` block (runtime powerhouse.config.json). */\nexport const connectRuntimeConfigSchema = connectConfigSchema.extend({\n composition: z.array(connectCompositionEntrySchema).optional(),\n instance: connectRuntimeInstanceSchema.optional(),\n pwa: connectRuntimePwaSchema.optional(),\n});\n\nexport type ConnectRuntimeConfig = z.output<typeof connectRuntimeConfigSchema>;\n"],"mappings":";;;AAeA,MAAM,YACJ;AACF,MAAM,uBACJ;;;AAIF,MAAa,wBAAwB,EAAE,OAAO,CAAC,CAAC,SAAS,SAAS;;AAGlE,MAAM,oBAAoB,cAAc,yBACtC,sBAAsB,SAAS,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS,WAAW;;;AAIlE,MAAa,4BAA4B,EACtC,MAAM,CACL,uBACA,EAAE,aAAa;CACb,OAAO;CACP,MAAM,sBAAsB,SAAS,CAAC,CAAC,SAAS;AAClD,CAAC,CACH,CAAC,CAAC,CACD,SACC,mFACF;;AAGF,MAAa,4BAA4B,EAAE,MAAM,CAC/C,EAAE,OAAO,GACT,EAAE,aAAa;CACb,OAAO,EAAE,OAAO;CAChB,MAAM,EAAE,OAAO,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS;AACvC,CAAC,CACH,CAAC;;AAGD,MAAa,sBAAsB,EAAE,MAAM,CAAC,EAAE,OAAO,GAAG,EAAE,OAAO,CAAC,CAAC;AAEnE,MAAM,uBACJ,oBACG,SAAS,CAAC,CACV,SAAS,CAAC,CACV,SACC,kHACF;;AAGJ,MAAa,qBAAqB,EAAE,aAAa;CAC/C,KAAK,eAAe;CACpB,OAAO,eAAe;CACtB,QAAQ,eAAe;CACvB,MAAM,eAAe;AACvB,CAAC;;AAGD,MAAa,+BAA+B,EACzC,aAAa;CACZ,KAAK;CACL,UAAU,mBACP,SAAS,CAAC,CACV,SAAS,CAAC,CACV,SACC,kFACF;CACF,OAAO,eAAe;CACtB,QAAQ,eAAe;CACvB,UAAU,eAAe;CACzB,WAAW,eAAe;CAC1B,UAAU,eAAe;CACzB,WAAW,eAAe;CAC1B,SAAS,EACN,OAAO,CAAC,CACR,IAAI,CAAC,CAAC,CACN,IAAI,CAAC,CAAC,CACN,SAAS,CAAC,CACV,SAAS,CAAC,CACV,SAAS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,GAAG,EAAE,QAAQ,CAAC,CAAC,CAAC,SAAS;AACrD,CAAC;;AAGD,MAAa,+BAA+B,sBAAsB,OAAO,EACvE,eAAe,+BAA+B,SAAS,EACzD,CAAC;;AAGD,MAAa,kCAAkC,yBAAyB,OAAO,EAC7E,YAAY,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,SAAS,EAC3C,CAAC;AAED,MAAa,0BAA0B,iBAAiB,OAAO,EAC7D,UAAU,gCAAgC,SAAS,EACrD,CAAC;;AAGD,MAAa,6BAA6B,oBAAoB,OAAO;CACnE,aAAa,EAAE,MAAM,6BAA6B,CAAC,CAAC,SAAS;CAC7D,UAAU,6BAA6B,SAAS;CAChD,KAAK,wBAAwB,SAAS;AACxC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["fs"],"sources":["../../registry/types.ts","../../clis/constants.ts","../../clis/file-system/get-config.ts","../../clis/file-system/spawn-async.ts","../../registry/registry.ts"],"sourcesContent":["import type { Manifest } from \"types\";\nexport interface PackageInfo {\n name: string;\n path: string;\n manifest: Manifest | null;\n documentTypes: string[];\n version?: string;\n /** Install spec the user requested (name, name@tag, or name@version); present\n * on installed packages, used to pick the update stream. Absent for legacy\n * entries. */\n spec?: string;\n /** Mapping of dist-tag → version (e.g. {latest: \"1.0.0\", dev: \"1.1.0-dev.3\"}). */\n distTags?: Record<string, string>;\n /** All published versions of the package, sorted ascending by semver. */\n versions?: string[];\n /**\n * The newest version the registry currently reports for this package (the\n * `version` field of list items / single-package responses). Distinct from\n * {@link version}, which holds the installed version on installed rows.\n * Every registry reports it, even ones without dist-tag support, so it is\n * the fallback target for the `latest` update stream.\n */\n latestVersion?: string;\n /** Accounts that own the name (publish/unpublish rights). Present only on\n * registries with the Postgres-backed auth; omitted when untracked. */\n owners?: string[];\n}\n\n/**\n * Item shape of `GET /packages` pages: only what a listing card renders. Pass\n * `detail=full` for {@link PackageInfo} items.\n */\nexport interface PackageListItem {\n name: string;\n path: string;\n version?: string;\n description?: string;\n category?: string;\n publisher?: { name?: string; url?: string };\n}\n\n/** Envelope of `GET /packages` and `GET /pieces`. */\nexport interface Page<T> {\n items: T[];\n total: number;\n limit: number;\n offset: number;\n hasMore: boolean;\n}\n\n/** Filter options over the `name`-restricted set, sent with `facets=true`. */\nexport interface PackageFacets {\n categories: string[];\n publishers: string[];\n}\n\n/** `GET /packages`; items are {@link PackageInfo} with `detail=full`. */\nexport interface PackagePage<T = PackageListItem> extends Page<T> {\n facets?: PackageFacets;\n}\n\n/** Manifest module lists accepted by the `moduleType` filter. */\nexport const PACKAGE_MODULE_TYPES = [\n \"documentModels\",\n \"editors\",\n \"apps\",\n \"subgraphs\",\n \"processors\",\n] as const;\nexport type PackageModuleType = (typeof PACKAGE_MODULE_TYPES)[number];\n\nexport type RegistryPackageStatus =\n | \"available\"\n | \"local-install\"\n | \"registry-install\"\n | \"dismissed\";\n\nexport type RegistryPackageSource =\n | \"available\"\n | \"local-install\"\n | \"registry-install\"\n | \"common\"\n | \"project\";\n\nexport type RegistryPackage = PackageInfo & {\n status: RegistryPackageStatus;\n /**\n * Shared-dependency version mismatches against the Connect build's version\n * table, pre-formatted (see `formatSharedDepWarnings`). Absent when the\n * host has no shared-deps table (vendor-off / dev) or none were found.\n */\n sharedDepWarnings?: string[];\n};\nexport type RegistryPackageMap = Record<string, RegistryPackage | undefined>;\nexport type RegistryPackageList = RegistryPackage[];\n","import { homedir } from \"node:os\";\nimport { join } from \"node:path\";\nimport type { Manifest } from \"../document-model/types.js\";\nimport type { PowerhouseConfig } from \"./types.js\";\n\nexport const SERVICE_ACTIONS = [\n \"start\",\n \"stop\",\n \"status\",\n \"setup\",\n \"restart\",\n] as const;\n\nexport const SECONDS_IN_DAY = 24 * 60 * 60;\nexport const DEFAULT_EXPIRY_DAYS = 7;\nexport const DEFAULT_EXPIRY_SECONDS = DEFAULT_EXPIRY_DAYS * SECONDS_IN_DAY;\n\nexport const DRIVES_PRESERVE_STRATEGIES = [\n \"preserve-all\",\n \"preserve-by-url-and-detach\",\n] as const;\n\nexport const LOG_LEVELS = [\n \"debug\",\n \"info\",\n \"warn\",\n \"error\",\n \"verbose\",\n] as const;\n\nexport const DEFAULT_TIMEOUT = 300 as const;\n\nexport const DEFAULT_CONNECT_STUDIO_PORT = 3000 as const;\n\nexport const DEFAULT_VETRA_CONNECT_PORT = 3001 as const;\n\nexport const DEFAULT_CONNECT_PREVIEW_PORT = 4173 as const;\n\nexport const DEFAULT_CONNECT_OUTDIR = \".ph/connect-build/dist/\" as const;\n\nexport const DEFAULT_RENOWN_URL = \"https://www.renown.id\" as const;\n\nexport const DEFAULT_REGISTRY_URL = \"https://registry.vetra.io\" as const;\n\nexport const DEFAULT_SWITCHBOARD_PORT = 4001 as const;\n\n// Per-project dev-server port bands. `ph init` assigns each project a port\n// triple derived from its name, so two projects never collide and an agent's\n// MCP URL can be baked into .mcp.json before a session starts.\n//\n// Two hard constraints picked these bands, both below 10000:\n//\n// 1. Below the OS ephemeral range. Linux allocates outbound source ports\n// from 32768-60999 (`/proc/sys/net/ipv4/ip_local_port_range`); macOS and\n// Windows start at 49152. A listener parked in that window can lose a\n// race to a transient outbound socket, which would surface as a\n// `--strictPort` failure blaming a project conflict that does not exist.\n// 2. Below 10000, which is where ph-clint starts. ph-clint derives its own\n// per-CLI ports by hashing into 10000-59900, so staying under 10000\n// keeps the two schemes from ever contending.\n//\n// Within those limits the blocks were chosen by measuring which ports the\n// Powerhouse repos actually reference: 2000-2999 has none, 7000-7999 has one,\n// 6000-6999 has five. See PROJECT_PORT_DENYLIST in project-ports.ts for the\n// individual ports skipped inside them.\nexport const PROJECT_PORT_BAND_SIZE = 1000 as const;\nexport const PROJECT_PORT_BAND_SWITCHBOARD = 7000 as const;\nexport const PROJECT_PORT_BAND_STUDIO = 6000 as const;\nexport const PROJECT_PORT_BAND_VETRA_CONNECT = 2000 as const;\n\n/**\n * Icon for the drives switchboard creates by default, inlined as a data URI.\n *\n * A remote URL is the wrong shape for this: the value is baked into the drive\n * document and rendered by every Connect that opens it, so the icon only\n * appears when that client can reach that host. A desktop or air-gapped install\n * cannot, and the ipfs.io gateway this previously pointed at now answers 403\n * regardless.\n *\n * The mark is drawn dark-on-light so it stays legible against either theme.\n */\nexport const DEFAULT_DRIVE_ICON =\n \"data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2016%2016'%3E%3Crect%20width='16'%20height='16'%20rx='3'%20fill='%23F3F5F7'/%3E%3Cpath%20fill='%23343839'%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M10.0059%200L3.41636%205.45646C2.44979%206.25682%202.3795%207.71452%203.26456%208.60418L5.54425%2010.8957C6.21311%2011.568%206.35783%2012.6012%205.89944%2013.4314L4.48126%2016H2.13333C0.955126%2016%200%2015.0449%200%2013.8667V2.13333C0%200.955126%200.955126%200%202.13333%200H10.0059ZM11.2436%200L10.0128%202.24221C9.55899%203.06891%209.70183%204.09549%2010.3641%204.7669L12.7825%207.21868C13.6656%208.11402%2013.5866%209.57512%2012.612%2010.37L5.70922%2016H13.8667C15.0449%2016%2016%2015.0449%2016%2013.8667V2.13333C16%200.955126%2015.0449%200%2013.8667%200H11.2436Z'/%3E%3C/svg%3E\" as const;\n\nexport const DEFAULT_VETRA_DRIVE_ID = \"vetra\" as const;\n\nexport const MINIMUM_NODE_VERSION = \"24.0.0\" as const;\nexport const PH_BIN = \"ph-cli-legacy\" as const;\nexport const POWERHOUSE_CONFIG_FILE = \"powerhouse.config.json\" as const;\nexport const PH_GLOBAL_DIR_NAME = \".ph\" as const;\n// Keep PH_GLOBAL_PROJECT_NAME for backwards compatibility\nexport const PH_GLOBAL_PROJECT_NAME = PH_GLOBAL_DIR_NAME;\n\nexport const HOME_DIR = homedir();\n\nexport const POWERHOUSE_GLOBAL_DIR = join(HOME_DIR, PH_GLOBAL_DIR_NAME);\n\n// Workspace packages that go in peerDependencies of every generated project.\nexport const VERSIONED_PEER_DEPENDENCIES = [\n \"document-model\",\n \"@powerhousedao/reactor-browser\",\n];\n\ntype PeerSpec = { peer: string; dev: string };\n\nexport const REACTOR_API_PACKAGE = \"@powerhousedao/reactor-api\";\nexport const ANALYTICS_ENGINE_CORE_PACKAGE =\n \"@powerhousedao/analytics-engine-core\";\nexport const GRAPHQL_PACKAGE = \"graphql\";\nexport const GRAPHQL_TAG_PACKAGE = \"graphql-tag\";\nexport const PIECES_FRAMEWORK_PACKAGE = \"@powerhousedao/pieces-framework\";\n\n// External peerDependencies of every generated project.\n// `peer` is the consumer-facing range; `dev` is the exact build-tested pin.\n// graphql / graphql-tag are always-on because the workspace packages pulled\n// in by every `ph init` project (codegen, reactor-api, reactor-browser,\n// vetra-packages) declare them as peers — even projects without subgraphs\n// need them in scope so pnpm hoists a single graphql instance.\nexport const PEER_EXTERNAL_DEPENDENCIES = {\n [GRAPHQL_PACKAGE]: { peer: \"^16\", dev: \"16.12.0\" },\n [GRAPHQL_TAG_PACKAGE]: { peer: \"^2\", dev: \"2.12.6\" },\n react: { peer: \"^19\", dev: \"19.2.6\" },\n \"react-dom\": { peer: \"^19\", dev: \"19.2.6\" },\n zod: { peer: \"^4\", dev: \"4.6.5\" },\n} as const satisfies Record<string, PeerSpec>;\n\n// Per-feature deps added dynamically by codegen when required. `devVersioned`\n// is for a workspace package the build inlines, which no consumer provides.\nexport const FEATURE_DEPENDENCIES = {\n analyticsProcessor: {\n peerVersioned: [ANALYTICS_ENGINE_CORE_PACKAGE],\n peerExternal: {},\n devVersioned: [],\n },\n // Each piece is bundled whole (build-pieces.mts), framework included, so the\n // framework is only ever needed to compile the piece's own source.\n piece: {\n peerVersioned: [],\n peerExternal: {},\n devVersioned: [PIECES_FRAMEWORK_PACKAGE],\n },\n} as const satisfies Record<\n string,\n {\n peerVersioned: readonly string[];\n peerExternal: Record<string, PeerSpec>;\n devVersioned: readonly string[];\n }\n>;\n\nexport const VERSIONED_DEPENDENCIES = [\n ...VERSIONED_PEER_DEPENDENCIES,\n ...FEATURE_DEPENDENCIES.analyticsProcessor.peerVersioned,\n];\n\n// Transitive dependencies whose postinstall scripts the generated project\n// trusts. Mirrors the `allowBuilds` map in the boilerplate's\n// pnpm-workspace.yaml and is also passed as `--allow-build` flags to\n// `pnpm dlx @powerhousedao/ph-cli init` so pnpm 11's strict-dep-builds\n// default doesn't prompt during the outer dlx download.\nexport const BOILERPLATE_ALLOWED_BUILDS = [\n \"@apollo/protobufjs\",\n \"@datadog/pprof\",\n \"@parcel/watcher\",\n \"@reown/appkit\",\n \"bufferutil\",\n \"esbuild\",\n \"keccak\",\n \"protobufjs\",\n \"utf-8-validate\",\n] as const;\n\n// Single-version pins the boilerplate enforces on generated projects,\n// avoiding duplicates from coexisting version ranges. Rendered as pnpm\n// `overrides` (pnpm-workspace.yaml) and as yarn v1 `resolutions`\n// (package.json). Generated-project only — never change the monorepo\n// catalog for this (a re-resolution there pulls a tsc-crashing TS6 beta).\nexport const BOILERPLATE_DEPENDENCY_OVERRIDES = {\n \"date-fns\": \"4.3.0\",\n vite: \"8.0.14\",\n rolldown: \"1.0.2\",\n} as const satisfies Record<string, string>;\n\nexport const VERSIONED_DEV_DEPENDENCIES = [\n \"@powerhousedao/ph-cli\",\n \"@powerhousedao/reactor\",\n \"@powerhousedao/shared\",\n \"@powerhousedao/connect\",\n \"@powerhousedao/design-system\",\n // uniform-runners: the runner modules the scaffolded hosts/*/host.js\n // files name (desktop runner, clint-runner/mastra-runner, and the generic\n // compound they build on); dormant in classic projects until the feature\n // flag defaults on.\n \"@powerhousedao/host-core\",\n \"@powerhousedao/clint\",\n \"@powerhousedao/desktop\",\n // the switchboard plugins the scaffolded switchboard host composes\n // (workflows, mcp, …) and their PHPluginConfigs types for tsc -p hosts.\n \"@powerhousedao/switchboard\",\n];\n\nexport const packageJsonExports = {\n \".\": {\n types: \"./dist/types/index.d.ts\",\n browser: \"./dist/browser/index.js\",\n node: \"./dist/node/index.mjs\",\n },\n \"./reactor\": {\n types: \"./dist/types/reactor/index.d.ts\",\n browser: \"./dist/browser/reactor/index.js\",\n },\n \"./document-models\": {\n types: \"./dist/types/document-models/index.d.ts\",\n browser: \"./dist/browser/document-models/index.js\",\n node: \"./dist/node/document-models/index.mjs\",\n },\n \"./document-models/*\": {\n types: \"./dist/types/document-models/*/index.d.ts\",\n browser: \"./dist/browser/document-models/*/index.js\",\n node: \"./dist/node/document-models/*/index.mjs\",\n },\n \"./editors\": {\n types: \"./dist/types/editors/index.d.ts\",\n browser: \"./dist/browser/editors/index.js\",\n node: \"./dist/node/editors/index.mjs\",\n },\n \"./editors/*\": {\n types: \"./dist/types/editors/*/editor.d.ts\",\n browser: \"./dist/browser/editors/*/editor.js\",\n node: \"./dist/node/editors/*/editor.mjs\",\n },\n \"./subgraphs\": {\n types: \"./dist/types/subgraphs/index.d.ts\",\n node: \"./dist/node/subgraphs/index.mjs\",\n },\n // The routes the package offers other Connects; built when it has any.\n \"./connect-routes\": {\n browser: \"./dist/browser/connect-routes.js\",\n },\n \"./processors\": {\n types: \"./dist/types/processors/index.d.ts\",\n browser: \"./dist/browser/processors/index.js\",\n node: \"./dist/node/processors/index.mjs\",\n },\n // Node only, as the build is: a piece is loaded by a host process, never by\n // the browser. Without these a package can build a piece and still fail the\n // `packageName/pieces` import a host resolves it through.\n \"./pieces\": {\n types: \"./dist/types/pieces/index.d.ts\",\n node: \"./dist/node/pieces/index.mjs\",\n },\n \"./pieces/*\": {\n types: \"./dist/types/pieces/*/index.d.ts\",\n node: \"./dist/node/pieces/*/index.mjs\",\n },\n \"./manifest\": \"./dist/powerhouse.manifest.json\",\n \"./style.css\": \"./dist/style.css\",\n} as const;\n\nexport const packageScripts = {\n \"test:watch\": \"vitest\",\n lint: \"oxlint --type-aware --type-check\",\n \"lint:fix\": \"oxlint --type-aware --type-check --fix\",\n format: \"oxfmt\",\n \"format:check\": \"oxfmt --check\",\n tsc: \"tsc\",\n \"tsc:watch\": \"tsc --watch\",\n generate: \"ph-cli generate\",\n connect: \"ph-cli connect\",\n build: \"ph-cli build\",\n reactor: \"ph-cli reactor\",\n service: \"ph-cli service\",\n vetra: \"ph-cli vetra\",\n \"service-startup\":\n \"bash ./node_modules/@powerhousedao/ph-cli/dist/scripts/service-startup.sh\",\n \"service-unstartup\":\n \"bash ./node_modules/@powerhousedao/ph-cli/dist/scripts/service-unstartup.sh\",\n} as const;\n\nexport const externalDependencies = {} as const;\n\n// eslint/prettier devDependencies present in projects scaffolded before the oxc migration.\n// Stripped from package.json during `ph migrate`.\nexport const LEGACY_LINT_FORMAT_DEPENDENCIES = [\n \"@eslint/js\",\n \"eslint\",\n \"eslint-config-prettier\",\n \"eslint-plugin-prettier\",\n \"eslint-plugin-react\",\n \"eslint-plugin-react-hooks\",\n \"globals\",\n \"prettier\",\n \"typescript-eslint\",\n] as const;\n\n// Legacy lint/format config files written by eslint/prettier boilerplate.\n// Removed from the project root during `ph migrate`.\nexport const LEGACY_LINT_FORMAT_FILES = [\n \"eslint.config.js\",\n \"eslint.config.mjs\",\n \"eslint.config.cjs\",\n \"eslint.config.ts\",\n \".eslintrc\",\n \".eslintrc.js\",\n \".eslintrc.cjs\",\n \".eslintrc.json\",\n \".eslintrc.yml\",\n \".eslintrc.yaml\",\n \".eslintignore\",\n \".prettierrc\",\n \".prettierrc.js\",\n \".prettierrc.cjs\",\n \".prettierrc.json\",\n \".prettierrc.yml\",\n \".prettierrc.yaml\",\n \"prettier.config.js\",\n \"prettier.config.cjs\",\n \"prettier.config.mjs\",\n \".prettierignore\",\n] as const;\n\nexport const externalDevDependencies = {\n \"@electric-sql/pglite\": \"0.3.15\",\n \"@electric-sql/pglite-tools\": \"0.2.20\",\n \"@powerhousedao/document-engineering\": \"1.40.5\",\n \"@tailwindcss/cli\": \"^4.1.18\",\n \"@tailwindcss/vite\": \"^4.1.18\",\n \"@types/node\": \"^24.9.2\",\n \"@types/react\": \"^19.2.3\",\n \"@types/react-dom\": \"^19.2.3\",\n \"@vitejs/plugin-react\": \"^6.0.1\",\n \"@vitest/coverage-v8\": \"5.0.3\",\n oxfmt: \"0.68.0\",\n oxlint: \"1.70.0\",\n \"oxlint-tsgolint\": \"0.23.0\",\n tailwindcss: \"^4.1.16\",\n typescript: \"~7.0.2\",\n vite: \"^8.0.10\",\n \"vite-tsconfig-paths\": \"6.1.1\",\n vitest: \"5.0.3\",\n} as const;\n\nexport const defaultManifest: Manifest = {\n name: \"\",\n description: \"\",\n category: \"\",\n publisher: {\n name: \"\",\n url: \"\",\n },\n documentModels: [],\n editors: [],\n apps: [],\n subgraphs: [],\n processors: [],\n};\n\nconst DEFAULT_DOCUMENT_MODELS_DIR = \"./document-models\";\nconst DEFAULT_EDITORS_DIR = \"./editors\";\nconst DEFAULT_PROCESSORS_DIR = \"./processors\";\nconst DEFAULT_SUBGRAPHS_DIR = \"./subgraphs\";\nconst DEFAULT_IMPORT_SCRIPTS_DIR = \"./scripts\";\nconst DEFAULT_SKIP_FORMAT = false;\nconst DEFAULT_LOG_LEVEL = \"info\";\n\nexport const DEFAULT_CONFIG: PowerhouseConfig = {\n documentModelsDir: DEFAULT_DOCUMENT_MODELS_DIR,\n editorsDir: DEFAULT_EDITORS_DIR,\n processorsDir: DEFAULT_PROCESSORS_DIR,\n subgraphsDir: DEFAULT_SUBGRAPHS_DIR,\n importScriptsDir: DEFAULT_IMPORT_SCRIPTS_DIR,\n skipFormat: DEFAULT_SKIP_FORMAT,\n logLevel: DEFAULT_LOG_LEVEL,\n auth: {\n enabled: false,\n admins: [],\n },\n};\n","import { readFileSync } from \"node:fs\";\nimport { DEFAULT_CONFIG } from \"../constants.js\";\nimport type { PowerhouseConfig } from \"../types.js\";\n\nexport function getConfig(path = \"./powerhouse.config.json\") {\n let config: PowerhouseConfig = { ...DEFAULT_CONFIG };\n try {\n const configStr = readFileSync(path, \"utf-8\");\n const userConfig = JSON.parse(configStr) as PowerhouseConfig;\n config = { ...config, ...userConfig };\n } catch {\n // console.warn(\"No powerhouse.config.json found, using defaults\");\n }\n\n return config;\n}\n","import spawn from \"cross-spawn\";\n\nexport function spawnAsync(\n command: string,\n args: string[],\n options: {\n cwd?: string;\n env?: NodeJS.ProcessEnv;\n } = {},\n): Promise<string> {\n return new Promise((resolve, reject) => {\n // cross-spawn rather than node:child_process.spawn. On Windows npm, pnpm\n // and yarn are all `.cmd` shims, and since the fix for CVE-2024-27980\n // (Node 18.20.2 / 20.12.2 / 21.7.3 and later) `spawn` refuses to execute\n // `.bat`/`.cmd` unless `shell: true` -- it throws `spawn EINVAL`, and\n // synchronously, so an `error` listener never sees it. Passing\n // `shell: true` instead would hand the arguments to cmd.exe, which strips\n // quotes and splits on shell metacharacters. cross-spawn resolves the shim\n // and escapes the arguments itself, so the call keeps shell-less argument\n // semantics on every platform.\n const child = spawn(command, args, {\n cwd: options.cwd,\n env: options.env,\n stdio: [\"ignore\", \"pipe\", \"pipe\"],\n });\n\n let stdout = \"\";\n let stderr = \"\";\n\n child.stdout?.on(\"data\", (d: Buffer) => {\n stdout += d.toString();\n });\n\n child.stderr?.on(\"data\", (d: Buffer) => {\n stderr += d.toString();\n });\n\n child.on(\"error\", reject);\n\n child.on(\"close\", (code) => {\n if (code === 0) {\n resolve(stdout.trim());\n } else {\n reject(\n new Error(stderr.trim() || `${command} exited with code ${code}`),\n );\n }\n });\n });\n}\n","import { promises as fs } from \"node:fs\";\nimport { homedir } from \"node:os\";\nimport { join } from \"node:path\";\nimport {\n DEFAULT_REGISTRY_URL,\n POWERHOUSE_CONFIG_FILE,\n} from \"../clis/constants.js\";\nimport { getConfig } from \"../clis/file-system/get-config.js\";\nimport { spawnAsync } from \"../clis/file-system/spawn-async.js\";\n\nexport { DEFAULT_REGISTRY_URL } from \"../clis/constants.js\";\n\n/**\n * Extract the host portion of a registry URL — what npm uses as the key in\n * `~/.npmrc` for per-registry tokens (e.g. `//registry.vetra.io/`).\n */\nexport function registryAuthKey(registryUrl: string): string {\n const url = new URL(registryUrl);\n // Always trailing slash; npm's lookup is exact-match against the leading\n // path of the registry URL, with `//` prefix and trailing `/`.\n const path = url.pathname.endsWith(\"/\") ? url.pathname : `${url.pathname}/`;\n return `//${url.host}${path}:_authToken`;\n}\n\nexport interface ResolveRegistryUrlOptions {\n /** Explicit registry URL (e.g. from --registry flag). Highest priority. */\n registry?: string;\n /** Project path to read powerhouse.config.json from. */\n projectPath: string;\n /** Environment variables. Defaults to process.env. */\n env?: Record<string, string | undefined>;\n}\n\n/**\n * Resolve the registry URL with priority: flag > env > config > default.\n */\nexport function resolveRegistryUrl(options: ResolveRegistryUrlOptions): string {\n const { registry, projectPath, env = process.env } = options;\n const configPath = join(projectPath, POWERHOUSE_CONFIG_FILE);\n const config = getConfig(configPath);\n\n return (\n registry ??\n env.PH_REGISTRY_URL ??\n config.packageRegistryUrl ??\n DEFAULT_REGISTRY_URL\n );\n}\n\n/**\n * Check if the user is authenticated with the given npm registry.\n * Returns the username on success, throws on failure.\n */\nexport async function checkNpmAuth(registryUrl: string): Promise<string> {\n return spawnAsync(\"npm\", [\"whoami\", \"--registry\", registryUrl]);\n}\n\nexport interface NpmPublishOptions {\n /** Registry URL to publish to. */\n registryUrl: string;\n /** Working directory (project root). */\n cwd: string;\n /** Additional arguments forwarded to npm publish. */\n args?: string[];\n /** Bearer token for the registry. When set, passed via a registry-scoped\n * `_authToken` config flag rather than read from the user's `.npmrc`. */\n authToken?: string;\n}\n\nexport interface NpmPublishResult {\n /** stdout from npm publish. */\n stdout: string;\n}\n\n/**\n * Run `npm publish` against the given registry.\n * Uses spawn with args array to avoid shell injection.\n *\n * When `authToken` is provided, the token is passed via a registry-scoped\n * `--//host/:_authToken=<token>` flag (npm's standard form for per-registry\n * tokens) so we never have to write to `~/.npmrc`.\n */\nexport async function npmPublish(\n options: NpmPublishOptions,\n): Promise<NpmPublishResult> {\n const { registryUrl, cwd, args = [], authToken } = options;\n const tokenArg = authToken\n ? [`--${registryAuthKey(registryUrl)}=${authToken}`]\n : [];\n const npmArgs = [\"publish\", \"--registry\", registryUrl, ...tokenArg, ...args];\n const stdout = await spawnAsync(\"npm\", npmArgs, { cwd });\n return { stdout };\n}\n\n/**\n * Write `_authToken=<token>` for the given registry host into `~/.npmrc`,\n * preserving any other lines. Replaces the existing entry for the same key\n * if present. Returns the absolute path to the npmrc that was written.\n */\nexport async function writeRegistryAuthToken(\n registryUrl: string,\n token: string,\n): Promise<string> {\n const npmrcPath = join(homedir(), \".npmrc\");\n const key = registryAuthKey(registryUrl);\n let existing = \"\";\n try {\n existing = await fs.readFile(npmrcPath, \"utf8\");\n } catch (err) {\n if ((err as NodeJS.ErrnoException).code !== \"ENOENT\") throw err;\n }\n const lines = existing.split(\"\\n\");\n const filtered = lines.filter((line) => !line.startsWith(`${key}=`));\n // Also drop any trailing empties to avoid stacking blank lines on rewrite.\n while (filtered.length && filtered[filtered.length - 1] === \"\")\n filtered.pop();\n filtered.push(`${key}=${token}`);\n await fs.writeFile(npmrcPath, `${filtered.join(\"\\n\")}\\n`, \"utf8\");\n return npmrcPath;\n}\n\nexport interface NpmUnpublishOptions {\n /** Registry URL to unpublish from. */\n registryUrl: string;\n /** Working directory (project root). */\n cwd: string;\n /** Package spec: `<name>` (whole package) or `<name>@<version>` (single version). */\n spec: string;\n /** Additional arguments forwarded to npm unpublish. */\n args?: string[];\n /** Bearer token for the registry (same semantics as `NpmPublishOptions.authToken`). */\n authToken?: string;\n}\n\nexport interface NpmUnpublishResult {\n /** stdout from npm unpublish. */\n stdout: string;\n}\n\n/**\n * Run `npm unpublish` against the given registry.\n * Always passes `--force` because npm otherwise refuses to unpublish packages\n * older than 72h (a public-npmjs safeguard that doesn't apply to private registries).\n */\nexport async function npmUnpublish(\n options: NpmUnpublishOptions,\n): Promise<NpmUnpublishResult> {\n const { registryUrl, cwd, spec, args = [], authToken } = options;\n const tokenArg = authToken\n ? [`--${registryAuthKey(registryUrl)}=${authToken}`]\n : [];\n const npmArgs = [\n \"unpublish\",\n spec,\n \"--registry\",\n registryUrl,\n \"--force\",\n ...tokenArg,\n ...args,\n ];\n const stdout = await spawnAsync(\"npm\", npmArgs, { cwd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CAEA,MAAM,WADQ,SAAS,MAAM,IACR,CAAC,CAAC,QAAQ,SAAS,CAAC,KAAK,WAAW,GAAG,IAAI,EAAE,CAAC;CAEnE,OAAO,SAAS,UAAU,SAAS,SAAS,SAAS,OAAO,IAC1D,SAAS,IAAI;CACf,SAAS,KAAK,GAAG,IAAI,GAAG,OAAO;CAC/B,MAAMA,SAAG,UAAU,WAAW,GAAG,SAAS,KAAK,IAAI,EAAE,KAAK,MAAM;CAChE,OAAO;AACT;;;;;;AAyBA,eAAsB,aACpB,SAC6B;CAC7B,MAAM,EAAE,aAAa,KAAK,MAAM,OAAO,CAAC,GAAG,cAAc;CAczD,OAAO,EAAE,QAAA,MADY,WAAW,OAAO;EARrC;EACA;EACA;EACA;EACA;EACA,GATe,YACb,CAAC,KAAK,gBAAgB,WAAW,EAAE,GAAG,WAAW,IACjD,CAAC;EAQH,GAAG;CAEkC,GAAS,EAAE,IAAI,CAAC,EACvC;AAClB"}
1
+ {"version":3,"file":"index.js","names":["fs"],"sources":["../../registry/types.ts","../../clis/constants.ts","../../clis/file-system/get-config.ts","../../clis/file-system/spawn-async.ts","../../registry/registry.ts"],"sourcesContent":["import type { Manifest } from \"types\";\nexport interface PackageInfo {\n name: string;\n path: string;\n manifest: Manifest | null;\n documentTypes: string[];\n version?: string;\n /** Install spec the user requested (name, name@tag, or name@version); present\n * on installed packages, used to pick the update stream. Absent for legacy\n * entries. */\n spec?: string;\n /** Mapping of dist-tag → version (e.g. {latest: \"1.0.0\", dev: \"1.1.0-dev.3\"}). */\n distTags?: Record<string, string>;\n /** All published versions of the package, sorted ascending by semver. */\n versions?: string[];\n /**\n * The newest version the registry currently reports for this package (the\n * `version` field of list items / single-package responses). Distinct from\n * {@link version}, which holds the installed version on installed rows.\n * Every registry reports it, even ones without dist-tag support, so it is\n * the fallback target for the `latest` update stream.\n */\n latestVersion?: string;\n /** Accounts that own the name (publish/unpublish rights). Present only on\n * registries with the Postgres-backed auth; omitted when untracked. */\n owners?: string[];\n}\n\n/**\n * Item shape of `GET /packages` pages: only what a listing card renders. Pass\n * `detail=full` for {@link PackageInfo} items.\n */\nexport interface PackageListItem {\n name: string;\n path: string;\n version?: string;\n description?: string;\n category?: string;\n publisher?: { name?: string; url?: string };\n}\n\n/** Envelope of `GET /packages` and `GET /pieces`. */\nexport interface Page<T> {\n items: T[];\n total: number;\n limit: number;\n offset: number;\n hasMore: boolean;\n}\n\n/** Filter options over the `name`-restricted set, sent with `facets=true`. */\nexport interface PackageFacets {\n categories: string[];\n publishers: string[];\n}\n\n/** `GET /packages`; items are {@link PackageInfo} with `detail=full`. */\nexport interface PackagePage<T = PackageListItem> extends Page<T> {\n facets?: PackageFacets;\n}\n\n/** Manifest module lists accepted by the `moduleType` filter. */\nexport const PACKAGE_MODULE_TYPES = [\n \"documentModels\",\n \"editors\",\n \"apps\",\n \"subgraphs\",\n \"processors\",\n] as const;\nexport type PackageModuleType = (typeof PACKAGE_MODULE_TYPES)[number];\n\nexport type RegistryPackageStatus =\n | \"available\"\n | \"local-install\"\n | \"registry-install\"\n | \"dismissed\";\n\nexport type RegistryPackageSource =\n | \"available\"\n | \"local-install\"\n | \"registry-install\"\n | \"common\"\n | \"project\";\n\nexport type RegistryPackage = PackageInfo & {\n status: RegistryPackageStatus;\n /**\n * Shared-dependency version mismatches against the Connect build's version\n * table, pre-formatted (see `formatSharedDepWarnings`). Absent when the\n * host has no shared-deps table (vendor-off / dev) or none were found.\n */\n sharedDepWarnings?: string[];\n};\nexport type RegistryPackageMap = Record<string, RegistryPackage | undefined>;\nexport type RegistryPackageList = RegistryPackage[];\n","import { homedir } from \"node:os\";\nimport { join } from \"node:path\";\nimport type { Manifest } from \"../document-model/types.js\";\nimport type { PowerhouseConfig } from \"./types.js\";\n\nexport const SERVICE_ACTIONS = [\n \"start\",\n \"stop\",\n \"status\",\n \"setup\",\n \"restart\",\n] as const;\n\nexport const SECONDS_IN_DAY = 24 * 60 * 60;\nexport const DEFAULT_EXPIRY_DAYS = 7;\nexport const DEFAULT_EXPIRY_SECONDS = DEFAULT_EXPIRY_DAYS * SECONDS_IN_DAY;\n\nexport const DRIVES_PRESERVE_STRATEGIES = [\n \"preserve-all\",\n \"preserve-by-url-and-detach\",\n] as const;\n\nexport const LOG_LEVELS = [\n \"debug\",\n \"info\",\n \"warn\",\n \"error\",\n \"verbose\",\n] as const;\n\nexport const DEFAULT_TIMEOUT = 300 as const;\n\nexport const DEFAULT_CONNECT_STUDIO_PORT = 3000 as const;\n\nexport const DEFAULT_VETRA_CONNECT_PORT = 3001 as const;\n\nexport const DEFAULT_CONNECT_PREVIEW_PORT = 4173 as const;\n\nexport const DEFAULT_CONNECT_OUTDIR = \".ph/connect-build/dist/\" as const;\n\nexport const DEFAULT_RENOWN_URL = \"https://www.renown.id\" as const;\n\nexport const DEFAULT_REGISTRY_URL = \"https://registry.vetra.io\" as const;\n\nexport const DEFAULT_SWITCHBOARD_PORT = 4001 as const;\n\n// Per-project dev-server port bands. `ph init` assigns each project a port\n// triple derived from its name, so two projects never collide and an agent's\n// MCP URL can be baked into .mcp.json before a session starts.\n//\n// Two hard constraints picked these bands, both below 10000:\n//\n// 1. Below the OS ephemeral range. Linux allocates outbound source ports\n// from 32768-60999 (`/proc/sys/net/ipv4/ip_local_port_range`); macOS and\n// Windows start at 49152. A listener parked in that window can lose a\n// race to a transient outbound socket, which would surface as a\n// `--strictPort` failure blaming a project conflict that does not exist.\n// 2. Below 10000, which is where ph-clint starts. ph-clint derives its own\n// per-CLI ports by hashing into 10000-59900, so staying under 10000\n// keeps the two schemes from ever contending.\n//\n// Within those limits the blocks were chosen by measuring which ports the\n// Powerhouse repos actually reference: 2000-2999 has none, 7000-7999 has one,\n// 6000-6999 has five. See PROJECT_PORT_DENYLIST in project-ports.ts for the\n// individual ports skipped inside them.\nexport const PROJECT_PORT_BAND_SIZE = 1000 as const;\nexport const PROJECT_PORT_BAND_SWITCHBOARD = 7000 as const;\nexport const PROJECT_PORT_BAND_STUDIO = 6000 as const;\nexport const PROJECT_PORT_BAND_VETRA_CONNECT = 2000 as const;\n\n/**\n * Icon for the drives switchboard creates by default, inlined as a data URI.\n *\n * A remote URL is the wrong shape for this: the value is baked into the drive\n * document and rendered by every Connect that opens it, so the icon only\n * appears when that client can reach that host. A desktop or air-gapped install\n * cannot, and the ipfs.io gateway this previously pointed at now answers 403\n * regardless.\n *\n * The mark is drawn dark-on-light so it stays legible against either theme.\n */\nexport const DEFAULT_DRIVE_ICON =\n \"data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2016%2016'%3E%3Crect%20width='16'%20height='16'%20rx='3'%20fill='%23F3F5F7'/%3E%3Cpath%20fill='%23343839'%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M10.0059%200L3.41636%205.45646C2.44979%206.25682%202.3795%207.71452%203.26456%208.60418L5.54425%2010.8957C6.21311%2011.568%206.35783%2012.6012%205.89944%2013.4314L4.48126%2016H2.13333C0.955126%2016%200%2015.0449%200%2013.8667V2.13333C0%200.955126%200.955126%200%202.13333%200H10.0059ZM11.2436%200L10.0128%202.24221C9.55899%203.06891%209.70183%204.09549%2010.3641%204.7669L12.7825%207.21868C13.6656%208.11402%2013.5866%209.57512%2012.612%2010.37L5.70922%2016H13.8667C15.0449%2016%2016%2015.0449%2016%2013.8667V2.13333C16%200.955126%2015.0449%200%2013.8667%200H11.2436Z'/%3E%3C/svg%3E\" as const;\n\nexport const DEFAULT_VETRA_DRIVE_ID = \"vetra\" as const;\n\nexport const MINIMUM_NODE_VERSION = \"24.0.0\" as const;\nexport const PH_BIN = \"ph-cli-legacy\" as const;\nexport const POWERHOUSE_CONFIG_FILE = \"powerhouse.config.json\" as const;\nexport const PH_GLOBAL_DIR_NAME = \".ph\" as const;\n// Keep PH_GLOBAL_PROJECT_NAME for backwards compatibility\nexport const PH_GLOBAL_PROJECT_NAME = PH_GLOBAL_DIR_NAME;\n\nexport const HOME_DIR = homedir();\n\nexport const POWERHOUSE_GLOBAL_DIR = join(HOME_DIR, PH_GLOBAL_DIR_NAME);\n\n// Workspace packages that go in peerDependencies of every generated project.\nexport const VERSIONED_PEER_DEPENDENCIES = [\n \"document-model\",\n \"@powerhousedao/reactor-browser\",\n];\n\ntype PeerSpec = { peer: string; dev: string };\n\nexport const REACTOR_API_PACKAGE = \"@powerhousedao/reactor-api\";\nexport const ANALYTICS_ENGINE_CORE_PACKAGE =\n \"@powerhousedao/analytics-engine-core\";\nexport const GRAPHQL_PACKAGE = \"graphql\";\nexport const GRAPHQL_TAG_PACKAGE = \"graphql-tag\";\nexport const PIECES_FRAMEWORK_PACKAGE = \"@powerhousedao/pieces-framework\";\n\n// External peerDependencies of every generated project.\n// `peer` is the consumer-facing range; `dev` is the exact build-tested pin.\n// graphql / graphql-tag are always-on because the workspace packages pulled\n// in by every `ph init` project (codegen, reactor-api, reactor-browser,\n// vetra-packages) declare them as peers — even projects without subgraphs\n// need them in scope so pnpm hoists a single graphql instance.\nexport const PEER_EXTERNAL_DEPENDENCIES = {\n [GRAPHQL_PACKAGE]: { peer: \"^16\", dev: \"16.12.0\" },\n [GRAPHQL_TAG_PACKAGE]: { peer: \"^2\", dev: \"2.12.6\" },\n react: { peer: \"^19\", dev: \"19.2.6\" },\n \"react-dom\": { peer: \"^19\", dev: \"19.2.6\" },\n zod: { peer: \"^4\", dev: \"4.6.5\" },\n // Project routes import it; Connect and connect-core take the project's copy.\n \"@tanstack/react-router\": { peer: \"^1.170.41\", dev: \"1.170.41\" },\n} as const satisfies Record<string, PeerSpec>;\n\n// Per-feature deps added dynamically by codegen when required. `devVersioned`\n// is for a workspace package the build inlines, which no consumer provides.\nexport const FEATURE_DEPENDENCIES = {\n analyticsProcessor: {\n peerVersioned: [ANALYTICS_ENGINE_CORE_PACKAGE],\n peerExternal: {},\n devVersioned: [],\n },\n // Each piece is bundled whole (build-pieces.mts), framework included, so the\n // framework is only ever needed to compile the piece's own source.\n piece: {\n peerVersioned: [],\n peerExternal: {},\n devVersioned: [PIECES_FRAMEWORK_PACKAGE],\n },\n} as const satisfies Record<\n string,\n {\n peerVersioned: readonly string[];\n peerExternal: Record<string, PeerSpec>;\n devVersioned: readonly string[];\n }\n>;\n\nexport const VERSIONED_DEPENDENCIES = [\n ...VERSIONED_PEER_DEPENDENCIES,\n ...FEATURE_DEPENDENCIES.analyticsProcessor.peerVersioned,\n];\n\n// Transitive dependencies whose postinstall scripts the generated project\n// trusts. Mirrors the `allowBuilds` map in the boilerplate's\n// pnpm-workspace.yaml and is also passed as `--allow-build` flags to\n// `pnpm dlx @powerhousedao/ph-cli init` so pnpm 11's strict-dep-builds\n// default doesn't prompt during the outer dlx download.\nexport const BOILERPLATE_ALLOWED_BUILDS = [\n \"@apollo/protobufjs\",\n \"@datadog/pprof\",\n \"@parcel/watcher\",\n \"@reown/appkit\",\n \"bufferutil\",\n \"esbuild\",\n \"keccak\",\n \"protobufjs\",\n \"utf-8-validate\",\n] as const;\n\n// Single-version pins the boilerplate enforces on generated projects,\n// avoiding duplicates from coexisting version ranges. Rendered as pnpm\n// `overrides` (pnpm-workspace.yaml) and as yarn v1 `resolutions`\n// (package.json). Generated-project only — never change the monorepo\n// catalog for this (a re-resolution there pulls a tsc-crashing TS6 beta).\nexport const BOILERPLATE_DEPENDENCY_OVERRIDES = {\n \"date-fns\": \"4.3.0\",\n vite: \"8.0.14\",\n rolldown: \"1.0.2\",\n} as const satisfies Record<string, string>;\n\nexport const VERSIONED_DEV_DEPENDENCIES = [\n \"@powerhousedao/ph-cli\",\n \"@powerhousedao/reactor\",\n \"@powerhousedao/shared\",\n \"@powerhousedao/connect\",\n \"@powerhousedao/design-system\",\n // uniform-runners: the runner modules the scaffolded hosts/*/host.js\n // files name (desktop runner, clint-runner/mastra-runner, and the generic\n // compound they build on); dormant in classic projects until the feature\n // flag defaults on.\n \"@powerhousedao/host-core\",\n \"@powerhousedao/clint\",\n \"@powerhousedao/desktop\",\n // the switchboard plugins the scaffolded switchboard host composes\n // (workflows, mcp, …) and their PHPluginConfigs types for tsc -p hosts.\n \"@powerhousedao/switchboard\",\n];\n\nexport const packageJsonExports = {\n \".\": {\n types: \"./dist/types/index.d.ts\",\n browser: \"./dist/browser/index.js\",\n node: \"./dist/node/index.mjs\",\n },\n \"./reactor\": {\n types: \"./dist/types/reactor/index.d.ts\",\n browser: \"./dist/browser/reactor/index.js\",\n },\n \"./document-models\": {\n types: \"./dist/types/document-models/index.d.ts\",\n browser: \"./dist/browser/document-models/index.js\",\n node: \"./dist/node/document-models/index.mjs\",\n },\n \"./document-models/*\": {\n types: \"./dist/types/document-models/*/index.d.ts\",\n browser: \"./dist/browser/document-models/*/index.js\",\n node: \"./dist/node/document-models/*/index.mjs\",\n },\n \"./editors\": {\n types: \"./dist/types/editors/index.d.ts\",\n browser: \"./dist/browser/editors/index.js\",\n node: \"./dist/node/editors/index.mjs\",\n },\n \"./editors/*\": {\n types: \"./dist/types/editors/*/editor.d.ts\",\n browser: \"./dist/browser/editors/*/editor.js\",\n node: \"./dist/node/editors/*/editor.mjs\",\n },\n \"./subgraphs\": {\n types: \"./dist/types/subgraphs/index.d.ts\",\n node: \"./dist/node/subgraphs/index.mjs\",\n },\n // The routes the package offers other Connects; built when it has any.\n \"./connect-routes\": {\n browser: \"./dist/browser/connect-routes.js\",\n },\n \"./processors\": {\n types: \"./dist/types/processors/index.d.ts\",\n browser: \"./dist/browser/processors/index.js\",\n node: \"./dist/node/processors/index.mjs\",\n },\n // Node only, as the build is: a piece is loaded by a host process, never by\n // the browser. Without these a package can build a piece and still fail the\n // `packageName/pieces` import a host resolves it through.\n \"./pieces\": {\n types: \"./dist/types/pieces/index.d.ts\",\n node: \"./dist/node/pieces/index.mjs\",\n },\n \"./pieces/*\": {\n types: \"./dist/types/pieces/*/index.d.ts\",\n node: \"./dist/node/pieces/*/index.mjs\",\n },\n \"./manifest\": \"./dist/powerhouse.manifest.json\",\n \"./style.css\": \"./dist/style.css\",\n} as const;\n\nexport const packageScripts = {\n \"test:watch\": \"vitest\",\n lint: \"oxlint --type-aware --type-check\",\n \"lint:fix\": \"oxlint --type-aware --type-check --fix\",\n format: \"oxfmt\",\n \"format:check\": \"oxfmt --check\",\n tsc: \"tsc\",\n \"tsc:watch\": \"tsc --watch\",\n generate: \"ph-cli generate\",\n connect: \"ph-cli connect\",\n build: \"ph-cli build\",\n reactor: \"ph-cli reactor\",\n service: \"ph-cli service\",\n vetra: \"ph-cli vetra\",\n \"service-startup\":\n \"bash ./node_modules/@powerhousedao/ph-cli/dist/scripts/service-startup.sh\",\n \"service-unstartup\":\n \"bash ./node_modules/@powerhousedao/ph-cli/dist/scripts/service-unstartup.sh\",\n} as const;\n\nexport const externalDependencies = {} as const;\n\n// eslint/prettier devDependencies present in projects scaffolded before the oxc migration.\n// Stripped from package.json during `ph migrate`.\nexport const LEGACY_LINT_FORMAT_DEPENDENCIES = [\n \"@eslint/js\",\n \"eslint\",\n \"eslint-config-prettier\",\n \"eslint-plugin-prettier\",\n \"eslint-plugin-react\",\n \"eslint-plugin-react-hooks\",\n \"globals\",\n \"prettier\",\n \"typescript-eslint\",\n] as const;\n\n// Legacy lint/format config files written by eslint/prettier boilerplate.\n// Removed from the project root during `ph migrate`.\nexport const LEGACY_LINT_FORMAT_FILES = [\n \"eslint.config.js\",\n \"eslint.config.mjs\",\n \"eslint.config.cjs\",\n \"eslint.config.ts\",\n \".eslintrc\",\n \".eslintrc.js\",\n \".eslintrc.cjs\",\n \".eslintrc.json\",\n \".eslintrc.yml\",\n \".eslintrc.yaml\",\n \".eslintignore\",\n \".prettierrc\",\n \".prettierrc.js\",\n \".prettierrc.cjs\",\n \".prettierrc.json\",\n \".prettierrc.yml\",\n \".prettierrc.yaml\",\n \"prettier.config.js\",\n \"prettier.config.cjs\",\n \"prettier.config.mjs\",\n \".prettierignore\",\n] as const;\n\nexport const externalDevDependencies = {\n \"@electric-sql/pglite\": \"0.3.15\",\n \"@electric-sql/pglite-tools\": \"0.2.20\",\n \"@powerhousedao/document-engineering\": \"1.40.5\",\n \"@tailwindcss/cli\": \"^4.1.18\",\n \"@tailwindcss/vite\": \"^4.1.18\",\n \"@types/node\": \"^24.9.2\",\n \"@types/react\": \"^19.2.3\",\n \"@types/react-dom\": \"^19.2.3\",\n \"@vitejs/plugin-react\": \"^6.0.1\",\n \"@vitest/coverage-v8\": \"5.0.3\",\n oxfmt: \"0.68.0\",\n oxlint: \"1.70.0\",\n \"oxlint-tsgolint\": \"0.23.0\",\n tailwindcss: \"^4.1.16\",\n typescript: \"~7.0.2\",\n vite: \"^8.0.10\",\n \"vite-tsconfig-paths\": \"6.1.1\",\n vitest: \"5.0.3\",\n} as const;\n\nexport const defaultManifest: Manifest = {\n name: \"\",\n description: \"\",\n category: \"\",\n publisher: {\n name: \"\",\n url: \"\",\n },\n documentModels: [],\n editors: [],\n apps: [],\n subgraphs: [],\n processors: [],\n};\n\nconst DEFAULT_DOCUMENT_MODELS_DIR = \"./document-models\";\nconst DEFAULT_EDITORS_DIR = \"./editors\";\nconst DEFAULT_PROCESSORS_DIR = \"./processors\";\nconst DEFAULT_SUBGRAPHS_DIR = \"./subgraphs\";\nconst DEFAULT_IMPORT_SCRIPTS_DIR = \"./scripts\";\nconst DEFAULT_SKIP_FORMAT = false;\nconst DEFAULT_LOG_LEVEL = \"info\";\n\nexport const DEFAULT_CONFIG: PowerhouseConfig = {\n documentModelsDir: DEFAULT_DOCUMENT_MODELS_DIR,\n editorsDir: DEFAULT_EDITORS_DIR,\n processorsDir: DEFAULT_PROCESSORS_DIR,\n subgraphsDir: DEFAULT_SUBGRAPHS_DIR,\n importScriptsDir: DEFAULT_IMPORT_SCRIPTS_DIR,\n skipFormat: DEFAULT_SKIP_FORMAT,\n logLevel: DEFAULT_LOG_LEVEL,\n auth: {\n enabled: false,\n admins: [],\n },\n};\n","import { readFileSync } from \"node:fs\";\nimport { DEFAULT_CONFIG } from \"../constants.js\";\nimport type { PowerhouseConfig } from \"../types.js\";\n\nexport function getConfig(path = \"./powerhouse.config.json\") {\n let config: PowerhouseConfig = { ...DEFAULT_CONFIG };\n try {\n const configStr = readFileSync(path, \"utf-8\");\n const userConfig = JSON.parse(configStr) as PowerhouseConfig;\n config = { ...config, ...userConfig };\n } catch {\n // console.warn(\"No powerhouse.config.json found, using defaults\");\n }\n\n return config;\n}\n","import spawn from \"cross-spawn\";\n\nexport function spawnAsync(\n command: string,\n args: string[],\n options: {\n cwd?: string;\n env?: NodeJS.ProcessEnv;\n } = {},\n): Promise<string> {\n return new Promise((resolve, reject) => {\n // cross-spawn rather than node:child_process.spawn. On Windows npm, pnpm\n // and yarn are all `.cmd` shims, and since the fix for CVE-2024-27980\n // (Node 18.20.2 / 20.12.2 / 21.7.3 and later) `spawn` refuses to execute\n // `.bat`/`.cmd` unless `shell: true` -- it throws `spawn EINVAL`, and\n // synchronously, so an `error` listener never sees it. Passing\n // `shell: true` instead would hand the arguments to cmd.exe, which strips\n // quotes and splits on shell metacharacters. cross-spawn resolves the shim\n // and escapes the arguments itself, so the call keeps shell-less argument\n // semantics on every platform.\n const child = spawn(command, args, {\n cwd: options.cwd,\n env: options.env,\n stdio: [\"ignore\", \"pipe\", \"pipe\"],\n });\n\n let stdout = \"\";\n let stderr = \"\";\n\n child.stdout?.on(\"data\", (d: Buffer) => {\n stdout += d.toString();\n });\n\n child.stderr?.on(\"data\", (d: Buffer) => {\n stderr += d.toString();\n });\n\n child.on(\"error\", reject);\n\n child.on(\"close\", (code) => {\n if (code === 0) {\n resolve(stdout.trim());\n } else {\n reject(\n new Error(stderr.trim() || `${command} exited with code ${code}`),\n );\n }\n });\n });\n}\n","import { promises as fs } from \"node:fs\";\nimport { homedir } from \"node:os\";\nimport { join } from \"node:path\";\nimport {\n DEFAULT_REGISTRY_URL,\n POWERHOUSE_CONFIG_FILE,\n} from \"../clis/constants.js\";\nimport { getConfig } from \"../clis/file-system/get-config.js\";\nimport { spawnAsync } from \"../clis/file-system/spawn-async.js\";\n\nexport { DEFAULT_REGISTRY_URL } from \"../clis/constants.js\";\n\n/**\n * Extract the host portion of a registry URL — what npm uses as the key in\n * `~/.npmrc` for per-registry tokens (e.g. `//registry.vetra.io/`).\n */\nexport function registryAuthKey(registryUrl: string): string {\n const url = new URL(registryUrl);\n // Always trailing slash; npm's lookup is exact-match against the leading\n // path of the registry URL, with `//` prefix and trailing `/`.\n const path = url.pathname.endsWith(\"/\") ? url.pathname : `${url.pathname}/`;\n return `//${url.host}${path}:_authToken`;\n}\n\nexport interface ResolveRegistryUrlOptions {\n /** Explicit registry URL (e.g. from --registry flag). Highest priority. */\n registry?: string;\n /** Project path to read powerhouse.config.json from. */\n projectPath: string;\n /** Environment variables. Defaults to process.env. */\n env?: Record<string, string | undefined>;\n}\n\n/**\n * Resolve the registry URL with priority: flag > env > config > default.\n */\nexport function resolveRegistryUrl(options: ResolveRegistryUrlOptions): string {\n const { registry, projectPath, env = process.env } = options;\n const configPath = join(projectPath, POWERHOUSE_CONFIG_FILE);\n const config = getConfig(configPath);\n\n return (\n registry ??\n env.PH_REGISTRY_URL ??\n config.packageRegistryUrl ??\n DEFAULT_REGISTRY_URL\n );\n}\n\n/**\n * Check if the user is authenticated with the given npm registry.\n * Returns the username on success, throws on failure.\n */\nexport async function checkNpmAuth(registryUrl: string): Promise<string> {\n return spawnAsync(\"npm\", [\"whoami\", \"--registry\", registryUrl]);\n}\n\nexport interface NpmPublishOptions {\n /** Registry URL to publish to. */\n registryUrl: string;\n /** Working directory (project root). */\n cwd: string;\n /** Additional arguments forwarded to npm publish. */\n args?: string[];\n /** Bearer token for the registry. When set, passed via a registry-scoped\n * `_authToken` config flag rather than read from the user's `.npmrc`. */\n authToken?: string;\n}\n\nexport interface NpmPublishResult {\n /** stdout from npm publish. */\n stdout: string;\n}\n\n/**\n * Run `npm publish` against the given registry.\n * Uses spawn with args array to avoid shell injection.\n *\n * When `authToken` is provided, the token is passed via a registry-scoped\n * `--//host/:_authToken=<token>` flag (npm's standard form for per-registry\n * tokens) so we never have to write to `~/.npmrc`.\n */\nexport async function npmPublish(\n options: NpmPublishOptions,\n): Promise<NpmPublishResult> {\n const { registryUrl, cwd, args = [], authToken } = options;\n const tokenArg = authToken\n ? [`--${registryAuthKey(registryUrl)}=${authToken}`]\n : [];\n const npmArgs = [\"publish\", \"--registry\", registryUrl, ...tokenArg, ...args];\n const stdout = await spawnAsync(\"npm\", npmArgs, { cwd });\n return { stdout };\n}\n\n/**\n * Write `_authToken=<token>` for the given registry host into `~/.npmrc`,\n * preserving any other lines. Replaces the existing entry for the same key\n * if present. Returns the absolute path to the npmrc that was written.\n */\nexport async function writeRegistryAuthToken(\n registryUrl: string,\n token: string,\n): Promise<string> {\n const npmrcPath = join(homedir(), \".npmrc\");\n const key = registryAuthKey(registryUrl);\n let existing = \"\";\n try {\n existing = await fs.readFile(npmrcPath, \"utf8\");\n } catch (err) {\n if ((err as NodeJS.ErrnoException).code !== \"ENOENT\") throw err;\n }\n const lines = existing.split(\"\\n\");\n const filtered = lines.filter((line) => !line.startsWith(`${key}=`));\n // Also drop any trailing empties to avoid stacking blank lines on rewrite.\n while (filtered.length && filtered[filtered.length - 1] === \"\")\n filtered.pop();\n filtered.push(`${key}=${token}`);\n await fs.writeFile(npmrcPath, `${filtered.join(\"\\n\")}\\n`, \"utf8\");\n return npmrcPath;\n}\n\nexport interface NpmUnpublishOptions {\n /** Registry URL to unpublish from. */\n registryUrl: string;\n /** Working directory (project root). */\n cwd: string;\n /** Package spec: `<name>` (whole package) or `<name>@<version>` (single version). */\n spec: string;\n /** Additional arguments forwarded to npm unpublish. */\n args?: string[];\n /** Bearer token for the registry (same semantics as `NpmPublishOptions.authToken`). */\n authToken?: string;\n}\n\nexport interface NpmUnpublishResult {\n /** stdout from npm unpublish. */\n stdout: string;\n}\n\n/**\n * Run `npm unpublish` against the given registry.\n * Always passes `--force` because npm otherwise refuses to unpublish packages\n * older than 72h (a public-npmjs safeguard that doesn't apply to private registries).\n */\nexport async function npmUnpublish(\n options: NpmUnpublishOptions,\n): Promise<NpmUnpublishResult> {\n const { registryUrl, cwd, spec, args = [], authToken } = options;\n const tokenArg = authToken\n ? [`--${registryAuthKey(registryUrl)}=${authToken}`]\n : [];\n const npmArgs = [\n \"unpublish\",\n spec,\n \"--registry\",\n registryUrl,\n \"--force\",\n ...tokenArg,\n ...args,\n ];\n const stdout = await spawnAsync(\"npm\", npmArgs, { cwd });\n return { stdout };\n}\n"],"mappings":";;;;;;;;;AA8DA,MAAa,uBAAuB;CAClC;CACA;CACA;CACA;CACA;AACF;AC1BA,MAAa,uBAAuB;AA8CpC,MAAa,yBAAyB;AAKtC,MAAa,WAAW,QAAQ;AAEK,KAAK,UAAA,KAA4B;AAGtE,MAAa,8BAA8B,CACzC,kBACA,gCACF;AA6BA,MAAa,uBAAuB;CAClC,oBAAoB;EAClB,eAAe,CAAC,sCAA6B;EAC7C,cAAc,CAAC;EACf,cAAc,CAAC;CACjB;CAGA,OAAO;EACL,eAAe,CAAC;EAChB,cAAc,CAAC;EACf,cAAc,CAAC,iCAAwB;CACzC;AACF;AASsC,CACpC,GAAG,6BACH,GAAG,qBAAqB,mBAAmB,aAC7C;AAoNA,MAAa,iBAAmC;CAC9C,mBAAmB;CACnB,YAAY;CACZ,eAAe;CACf,cAAc;CACd,kBAAkB;CAClB,YAAY;CACZ,UAAU;CACV,MAAM;EACJ,SAAS;EACT,QAAQ,CAAC;CACX;AACF;;;ACvXA,SAAgB,UAAU,OAAO,4BAA4B;CAC3D,IAAI,SAA2B,EAAE,GAAG,eAAe;CACnD,IAAI;EACF,MAAM,YAAY,aAAa,MAAM,OAAO;EAC5C,MAAM,aAAa,KAAK,MAAM,SAAS;EACvC,SAAS;GAAE,GAAG;GAAQ,GAAG;EAAW;CACtC,QAAQ,CAER;CAEA,OAAO;AACT;;;ACbA,SAAgB,WACd,SACA,MACA,UAGI,CAAC,GACY;CACjB,OAAO,IAAI,SAAS,SAAS,WAAW;EAUtC,MAAM,QAAQ,MAAM,SAAS,MAAM;GACjC,KAAK,QAAQ;GACb,KAAK,QAAQ;GACb,OAAO;IAAC;IA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K,QAAQ,GAAG,QAAQ;CAC1C,MAAM,MAAM,gBAAgB,WAAW;CACvC,IAAI,WAAW;CACf,IAAI;EACF,WAAW,MAAMA,SAAG,SAAS,WAAW,MAAM;CAChD,SAAS,KAAK;EACZ,IAAK,IAA8B,SAAS,UAAU,MAAM;CAC9D;CAEA,MAAM,WADQ,SAAS,MAAM,IACR,CAAC,CAAC,QAAQ,SAAS,CAAC,KAAK,WAAW,GAAG,IAAI,EAAE,CAAC;CAEnE,OAAO,SAAS,UAAU,SAAS,SAAS,SAAS,OAAO,IAC1D,SAAS,IAAI;CACf,SAAS,KAAK,GAAG,IAAI,GAAG,OAAO;CAC/B,MAAMA,SAAG,UAAU,WAAW,GAAG,SAAS,KAAK,IAAI,EAAE,KAAK,MAAM;CAChE,OAAO;AACT;;;;;;AAyBA,eAAsB,aACpB,SAC6B;CAC7B,MAAM,EAAE,aAAa,KAAK,MAAM,OAAO,CAAC,GAAG,cAAc;CAczD,OAAO,EAAE,QAAA,MADY,WAAW,OAAO;EARrC;EACA;EACA;EACA;EACA;EACA,GATe,YACb,CAAC,KAAK,gBAAgB,WAAW,EAAE,GAAG,WAAW,IACjD,CAAC;EAQH,GAAG;CAEkC,GAAS,EAAE,IAAI,CAAC,EACvC;AAClB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@powerhousedao/shared",
3
- "version": "6.2.3-dev.71",
3
+ "version": "6.2.3-dev.72",
4
4
  "type": "module",
5
5
  "sideEffects": false,
6
6
  "publishConfig": {