@wildo-ai/wildo-cli 1.1.3 → 1.1.4

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.
Files changed (141) hide show
  1. package/dist/src/commands/context/__tests__/assurance-basis.command.test.d.ts +2 -0
  2. package/dist/src/commands/context/__tests__/assurance-basis.command.test.d.ts.map +1 -0
  3. package/dist/src/commands/context/__tests__/assurance-basis.command.test.js +63 -0
  4. package/dist/src/commands/context/__tests__/assurance-basis.command.test.js.map +1 -0
  5. package/dist/src/commands/context/assurance-basis.command.d.ts +61 -0
  6. package/dist/src/commands/context/assurance-basis.command.d.ts.map +1 -0
  7. package/dist/src/commands/context/assurance-basis.command.js +166 -0
  8. package/dist/src/commands/context/assurance-basis.command.js.map +1 -0
  9. package/dist/src/commands/dev/charts-audit.command.d.ts +5 -3
  10. package/dist/src/commands/dev/charts-audit.command.d.ts.map +1 -1
  11. package/dist/src/commands/dev/charts-audit.command.js +35 -6
  12. package/dist/src/commands/dev/charts-audit.command.js.map +1 -1
  13. package/dist/src/commands/fwk/generate-providers.command.d.ts.map +1 -1
  14. package/dist/src/commands/fwk/generate-providers.command.js +18 -2
  15. package/dist/src/commands/fwk/generate-providers.command.js.map +1 -1
  16. package/dist/src/commands/generate/email-preview.command.d.ts +8 -0
  17. package/dist/src/commands/generate/email-preview.command.d.ts.map +1 -1
  18. package/dist/src/commands/generate/email-preview.command.js +57 -0
  19. package/dist/src/commands/generate/email-preview.command.js.map +1 -1
  20. package/dist/src/commands/init.command.d.ts.map +1 -1
  21. package/dist/src/commands/init.command.js +32 -0
  22. package/dist/src/commands/init.command.js.map +1 -1
  23. package/dist/src/commands/lock/check.command.d.ts.map +1 -1
  24. package/dist/src/commands/lock/check.command.js +3 -2
  25. package/dist/src/commands/lock/check.command.js.map +1 -1
  26. package/dist/src/commands/registry/login.command.d.ts.map +1 -1
  27. package/dist/src/commands/registry/login.command.js +2 -0
  28. package/dist/src/commands/registry/login.command.js.map +1 -1
  29. package/dist/src/commands/registry/publish.command.d.ts.map +1 -1
  30. package/dist/src/commands/registry/publish.command.js +2 -0
  31. package/dist/src/commands/registry/publish.command.js.map +1 -1
  32. package/dist/src/commands/registry/registry-transport.constants.d.ts +33 -0
  33. package/dist/src/commands/registry/registry-transport.constants.d.ts.map +1 -0
  34. package/dist/src/commands/registry/registry-transport.constants.js +33 -0
  35. package/dist/src/commands/registry/registry-transport.constants.js.map +1 -0
  36. package/dist/src/commands/registry/whoami.command.d.ts.map +1 -1
  37. package/dist/src/commands/registry/whoami.command.js +2 -0
  38. package/dist/src/commands/registry/whoami.command.js.map +1 -1
  39. package/dist/src/modules/domain/credentials/__tests__/approver-user.module.test.d.ts +2 -0
  40. package/dist/src/modules/domain/credentials/__tests__/approver-user.module.test.d.ts.map +1 -0
  41. package/dist/src/modules/domain/credentials/__tests__/approver-user.module.test.js +146 -0
  42. package/dist/src/modules/domain/credentials/__tests__/approver-user.module.test.js.map +1 -0
  43. package/dist/src/modules/domain/credentials/approver-user.module.d.ts +85 -0
  44. package/dist/src/modules/domain/credentials/approver-user.module.d.ts.map +1 -0
  45. package/dist/src/modules/domain/credentials/approver-user.module.js +92 -0
  46. package/dist/src/modules/domain/credentials/approver-user.module.js.map +1 -0
  47. package/dist/src/services/application/__tests__/app-bootstrap.approving-administrator.test.d.ts +2 -0
  48. package/dist/src/services/application/__tests__/app-bootstrap.approving-administrator.test.d.ts.map +1 -0
  49. package/dist/src/services/application/__tests__/app-bootstrap.approving-administrator.test.js +111 -0
  50. package/dist/src/services/application/__tests__/app-bootstrap.approving-administrator.test.js.map +1 -0
  51. package/dist/src/services/application/__tests__/provider-package-links.service.test.js +68 -0
  52. package/dist/src/services/application/__tests__/provider-package-links.service.test.js.map +1 -1
  53. package/dist/src/services/application/app-bootstrap.service.d.ts +9 -0
  54. package/dist/src/services/application/app-bootstrap.service.d.ts.map +1 -1
  55. package/dist/src/services/application/app-bootstrap.service.js +30 -1
  56. package/dist/src/services/application/app-bootstrap.service.js.map +1 -1
  57. package/dist/src/services/application/application-runtime-bootstrap.service.d.ts +6 -0
  58. package/dist/src/services/application/application-runtime-bootstrap.service.d.ts.map +1 -1
  59. package/dist/src/services/application/application-runtime-bootstrap.service.js +41 -0
  60. package/dist/src/services/application/application-runtime-bootstrap.service.js.map +1 -1
  61. package/dist/src/services/application/provider-package-links.service.d.ts +30 -0
  62. package/dist/src/services/application/provider-package-links.service.d.ts.map +1 -1
  63. package/dist/src/services/application/provider-package-links.service.js +35 -3
  64. package/dist/src/services/application/provider-package-links.service.js.map +1 -1
  65. package/dist/src/services/application/provider-runtime-sync.service.d.ts.map +1 -1
  66. package/dist/src/services/application/provider-runtime-sync.service.js +4 -3
  67. package/dist/src/services/application/provider-runtime-sync.service.js.map +1 -1
  68. package/dist/src/services/application/saas-skeleton.service.d.ts.map +1 -1
  69. package/dist/src/services/application/saas-skeleton.service.js +22 -2
  70. package/dist/src/services/application/saas-skeleton.service.js.map +1 -1
  71. package/dist/src/services/companion/workbench-cli.service.js +10 -1
  72. package/dist/src/services/companion/workbench-cli.service.js.map +1 -1
  73. package/dist/src/services/credentials/__tests__/provider-contribution-registration.guard.test.d.ts +2 -0
  74. package/dist/src/services/credentials/__tests__/provider-contribution-registration.guard.test.d.ts.map +1 -0
  75. package/dist/src/services/credentials/__tests__/provider-contribution-registration.guard.test.js +94 -0
  76. package/dist/src/services/credentials/__tests__/provider-contribution-registration.guard.test.js.map +1 -0
  77. package/dist/src/services/credentials/ci-secrets-adapter.service.d.ts.map +1 -1
  78. package/dist/src/services/credentials/ci-secrets-adapter.service.js +16 -0
  79. package/dist/src/services/credentials/ci-secrets-adapter.service.js.map +1 -1
  80. package/dist/src/services/credentials/composed-provider-catalogue.d.ts +34 -0
  81. package/dist/src/services/credentials/composed-provider-catalogue.d.ts.map +1 -1
  82. package/dist/src/services/credentials/composed-provider-catalogue.js +35 -0
  83. package/dist/src/services/credentials/composed-provider-catalogue.js.map +1 -1
  84. package/dist/src/services/credentials/credentials.schemas.d.ts +27 -0
  85. package/dist/src/services/credentials/credentials.schemas.d.ts.map +1 -1
  86. package/dist/src/services/credentials/credentials.schemas.js +50 -0
  87. package/dist/src/services/credentials/credentials.schemas.js.map +1 -1
  88. package/dist/src/services/credentials/framework-managed-secrets.d.ts +1 -1
  89. package/dist/src/services/credentials/framework-managed-secrets.d.ts.map +1 -1
  90. package/dist/src/services/credentials/framework-managed-secrets.js +49 -8
  91. package/dist/src/services/credentials/framework-managed-secrets.js.map +1 -1
  92. package/dist/src/services/deployment/infra-writer.service.d.ts.map +1 -1
  93. package/dist/src/services/deployment/infra-writer.service.js +23 -4
  94. package/dist/src/services/deployment/infra-writer.service.js.map +1 -1
  95. package/dist/src/services/deployment/k8s/__tests__/k8s-bootstrap.service.test.js +45 -2
  96. package/dist/src/services/deployment/k8s/__tests__/k8s-bootstrap.service.test.js.map +1 -1
  97. package/dist/src/services/deployment/k8s/k8s-bootstrap.service.d.ts +23 -0
  98. package/dist/src/services/deployment/k8s/k8s-bootstrap.service.d.ts.map +1 -1
  99. package/dist/src/services/deployment/k8s/k8s-bootstrap.service.js +49 -6
  100. package/dist/src/services/deployment/k8s/k8s-bootstrap.service.js.map +1 -1
  101. package/dist/src/services/environment/env-vars-builder.service.d.ts.map +1 -1
  102. package/dist/src/services/environment/env-vars-builder.service.js +19 -0
  103. package/dist/src/services/environment/env-vars-builder.service.js.map +1 -1
  104. package/dist/src/services/framework/__tests__/engine-provider-specifications.reconciliation.test.js +8 -0
  105. package/dist/src/services/framework/__tests__/engine-provider-specifications.reconciliation.test.js.map +1 -1
  106. package/dist/src/services/framework/__tests__/framework-knowledge-audit.live.contract.test.js +17 -0
  107. package/dist/src/services/framework/__tests__/framework-knowledge-audit.live.contract.test.js.map +1 -1
  108. package/dist/src/services/framework/__tests__/framework-knowledge-audit.service.test.js +51 -0
  109. package/dist/src/services/framework/__tests__/framework-knowledge-audit.service.test.js.map +1 -1
  110. package/dist/src/services/framework/framework-knowledge-audit.service.d.ts +41 -1
  111. package/dist/src/services/framework/framework-knowledge-audit.service.d.ts.map +1 -1
  112. package/dist/src/services/framework/framework-knowledge-audit.service.js +90 -0
  113. package/dist/src/services/framework/framework-knowledge-audit.service.js.map +1 -1
  114. package/dist/src/services/framework/provider-transposition/__tests__/base-url-is-a-declared-env-slot.test.d.ts +2 -0
  115. package/dist/src/services/framework/provider-transposition/__tests__/base-url-is-a-declared-env-slot.test.d.ts.map +1 -0
  116. package/dist/src/services/framework/provider-transposition/__tests__/base-url-is-a-declared-env-slot.test.js +100 -0
  117. package/dist/src/services/framework/provider-transposition/__tests__/base-url-is-a-declared-env-slot.test.js.map +1 -0
  118. package/dist/src/services/framework/provider-transposition/__tests__/plan-matches-emit.test.js +55 -2
  119. package/dist/src/services/framework/provider-transposition/__tests__/plan-matches-emit.test.js.map +1 -1
  120. package/dist/src/services/framework/provider-transposition/provider-package.emitter.d.ts +9 -0
  121. package/dist/src/services/framework/provider-transposition/provider-package.emitter.d.ts.map +1 -1
  122. package/dist/src/services/framework/provider-transposition/provider-package.emitter.js +139 -19
  123. package/dist/src/services/framework/provider-transposition/provider-package.emitter.js.map +1 -1
  124. package/dist/src/services/frontend/cloudflare-cdn.service.d.ts.map +1 -1
  125. package/dist/src/services/frontend/cloudflare-cdn.service.js +33 -2
  126. package/dist/src/services/frontend/cloudflare-cdn.service.js.map +1 -1
  127. package/dist/tsconfig.build.tsbuildinfo +1 -1
  128. package/dist/tsconfig.tsbuildinfo +1 -1
  129. package/package.json +17 -17
  130. package/scripts/app-dependency-alignment/propagated-engine-overrides.json +13 -0
  131. package/templates/infra/docker-compose/docker-compose.wildo-platform.yml.hbs +64 -16
  132. package/templates/saas/engine-peer-closure.json +12 -0
  133. package/templates/saas/scenarios/add-provider/scenario.json +11 -11
  134. package/templates/saas/scenarios/add-technical-doc/files/technical-doc/docusaurus.config.ts.hbs +34 -0
  135. package/templates/saas/scenarios/add-technical-doc/files/technical-doc/src/pages/auth/exchange.tsx +24 -1
  136. package/templates/saas/scenarios/add-technical-doc/files/technical-doc/src/theme/Root.tsx +22 -2
  137. package/templates/saas/skeleton/backend-api/package.json.hbs +1 -1
  138. package/templates/saas/skeleton/backend-api/src/companion-exports.ts +13 -2
  139. package/wildo-framework.info.json +1 -1
  140. package/templates/saas/scenarios/add-backend-provider/scenario.json +0 -17
  141. package/templates/saas/skeleton/backend-api/src/provider-contributions.ts +0 -44
@@ -1 +1 @@
1
- {"version":3,"file":"generate-providers.command.js","sourceRoot":"","sources":["../../../../src/commands/fwk/generate-providers.command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEnD,OAAO,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAEhE,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE1D,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAErC,OAAO,EAAE,qBAAqB,EAAE,MAAM,iFAAiF,CAAC;AACxH,OAAO,EAAE,0BAA0B,EAAE,MAAM,yEAAyE,CAAC;AACrH,OAAO,EAAE,wBAAwB,EAAE,MAAM,qEAAqE,CAAC;AAC/G,OAAO,EAAE,iBAAiB,EAAE,MAAM,wEAAwE,CAAC;AAC3G,OAAO,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,+EAA+E,CAAC;AAC3I,OAAO,EACL,4BAA4B,EAC5B,WAAW,EACX,aAAa,EACb,cAAc,GACf,MAAM,gFAAgF,CAAC;AACxF,OAAO,EACL,6BAA6B,GAG9B,MAAM,gFAAgF,CAAC;AAExF;;;;;;;GAOG;AACH,MAAM,2BAA2B,GAAG,6BAA6B,CAAC;AAElE;;;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,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;IACtI,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,kBAAkB,CAAC;IAC5B,CAAC;AACH,CAAC","sourcesContent":["import { readdirSync, statSync } from 'node:fs';\nimport { execSync } from 'node:child_process';\nimport { dirname, join, resolve } from 'node:path';\n\nimport { ProviderCatalogueSource } from '@wildo-ai/saas-models';\n\nimport { BaseCommand } from '~wildo-cli/kernel/base-command';\nimport { CommandCategory } from '~wildo-cli/kernel/types';\nimport type { CommandMeta, CommandContext, CommandResult, FlagDefinition } from '~wildo-cli/kernel/types';\nimport { existsSync } from 'node:fs';\n\nimport { readActivepiecesPiece } from '~wildo-cli/services/framework/provider-transposition/activepieces-source.reader';\nimport { enrichFromOpenApiDocuments } from '~wildo-cli/services/framework/provider-transposition/openapi-enrichment';\nimport { mergeTransposedProviders } from '~wildo-cli/services/framework/provider-transposition/provider-merge';\nimport { readSimToolFamily } from '~wildo-cli/services/framework/provider-transposition/sim-source.reader';\nimport { emitProvidersPackage, planProvidersPackage } from '~wildo-cli/services/framework/provider-transposition/provider-package.emitter';\nimport {\n CatalogueEntryClassification,\n isFullBatch,\n readDecisions,\n writeInventory,\n} from '~wildo-cli/services/framework/provider-transposition/provider-catalogue-record';\nimport {\n TransposedOperationResolution,\n type TransposedOperation,\n type TransposedProvider,\n} from '~wildo-cli/services/framework/provider-transposition/transposed-provider.model';\n\n/**\n * Where the source catalogues conventionally sit: a sibling of the framework checkout.\n *\n * Not a fallback invented for convenience — it is where they already are, and the flag being\n * mandatory is what made a regeneration stall twice on a path somebody had to remember. The refusal\n * itself was right: a catalogue cannot be assumed into existence. What was missing is that the\n * ordinary case needs no assumption at all.\n */\nconst SIBLING_CATALOGUE_DIRECTORY = 'connector-scrapping-sources';\n\n/**\n * Every checkout beside the framework that IS a catalogue, identified by layout.\n *\n * By layout and never by name, which is the same rule the detector downstream applies and the one\n * that matters most here: a directory called `activepieces` belonging to an unrelated project is a\n * real Activepieces checkout at a different upstream commit, so running against it does not fail —\n * it succeeds, wrongly. Matching on `packages/pieces/community` and `apps/sim/tools` cannot make\n * that mistake.\n *\n * Returns EMPTY rather than throwing when the directory is absent, so the caller's own refusal — the\n * one that explains what a catalogue is — stays the single place that reports it.\n */\nfunction discoverSiblingCatalogues(frameworkRoot: string): readonly string[] {\n const parent = join(dirname(frameworkRoot), SIBLING_CATALOGUE_DIRECTORY);\n if (!existsSync(parent)) return [];\n\n const found: string[] = [];\n for (const entry of readdirSync(parent).sort()) {\n const candidate = join(parent, entry);\n if (!statSync(candidate).isDirectory()) continue;\n if (existsSync(join(candidate, 'packages', 'pieces', 'community'))\n || existsSync(join(candidate, 'apps', 'sim', 'tools'))) {\n found.push(candidate);\n }\n }\n return found;\n}\n\nconst FLAG_CATALOGUE = 'catalogue';\nconst FLAG_VENDOR = 'vendor';\nconst FLAG_LIMIT = 'limit';\nconst FLAG_DRY_RUN = 'dry-run';\nconst FLAG_OPENAPI = 'openapi';\n\nconst FLAGS: Record<string, FlagDefinition> = {\n [FLAG_CATALOGUE]: {\n type: 'string',\n description: 'Comma-separated paths to source catalogue checkouts (Activepieces and/or Sim repository roots; each layout is detected). Optional when the checkouts sit in `connector-scrapping-sources` beside the framework, which is where they conventionally live; the run then names the ones it found. Passing both catalogues merges them into one provider per vendor.',\n },\n [FLAG_VENDOR]: {\n type: 'string',\n description: 'Transpose one vendor only, by directory name (e.g. `clockify`, `google-sheets`). Underscores and hyphens are interchangeable. Omit to run the whole catalogue.',\n },\n [FLAG_LIMIT]: {\n type: 'string',\n description: 'Stop after N vendors. For a smoke run over a large catalogue.',\n },\n [FLAG_OPENAPI]: {\n type: 'string',\n description:\n 'Path to an OpenAPI corpus (e.g. jentic-public-apis/apis/openapi). OPT-IN and never a catalogue: '\n + 'a vendor document is consulted about operations the catalogues already chose, to answer what an '\n + 'operation ANSWERS. It contributes no operation of its own, so the emitted set is identical with '\n + 'and without it.',\n },\n [FLAG_DRY_RUN]: {\n type: 'boolean',\n description: 'Read and report without writing any package.',\n default: false,\n },\n};\n\n/**\n * `wildo fwk generate-providers` — the transposer.\n *\n * Reads an external catalogue's SOURCE — Activepieces or Sim, detected from the checkout's layout —\n * and emits native Wildo provider packages under `providers/<ref>/`. The catalogue is a build-time input that lives OUTSIDE this repository (a\n * sibling checkout), so its path is an argument and never a default: a tool that assumed a\n * repo-relative location would break the moment anybody cloned the sources somewhere else, and\n * vendoring 21 GB of somebody else's specs is a fork, not a build input.\n *\n * What it emits is ordinary Wildo code. No third-party package becomes a runtime dependency of any\n * application and nothing third-party executes — the operations are DATA, run by the engine's own\n * HTTP client. That distinction is the reason this command exists at all: the alternative, wrapping\n * and executing published bundles, was built, measured, and deleted on 2026-09-06.\n */\nexport default class FwkGenerateProvidersCommand extends BaseCommand {\n readonly meta: CommandMeta = {\n name: 'fwk generate-providers',\n description: 'Transpose an external catalogue (Activepieces or Sim) into native Wildo provider packages under providers/.',\n category: CommandCategory.Fwk,\n flags: FLAGS,\n };\n\n async run(ctx: CommandContext): Promise<CommandResult> {\n const frameworkRoot = ctx.cliContext.resolvedHomes.framework.repositoryRoot;\n if (frameworkRoot === undefined || frameworkRoot === null) {\n ctx.log.error('Framework path not set. Run `wildo init` inside the framework workspace first.');\n return { success: false };\n }\n\n const cataloguePath = ctx.flags[FLAG_CATALOGUE] as string | undefined;\n const discovered = cataloguePath === undefined ? discoverSiblingCatalogues(frameworkRoot) : [];\n if (cataloguePath === undefined && discovered.length === 0) {\n ctx.log.error(\n '--catalogue is required: the source catalogues live outside this repository, so their path cannot be assumed.',\n );\n ctx.log.error(\n `Nothing was found at the conventional location either (${join(dirname(frameworkRoot), SIBLING_CATALOGUE_DIRECTORY)}). `\n + 'A catalogue is identified by its LAYOUT, never by its directory name — an Activepieces checkout contains '\n + '`packages/pieces/community`, a Sim one contains `apps/sim/tools`. Locate yours with:\\n'\n + ' find ~ -type d -path \"*/packages/pieces/community\" -not -path \"*/node_modules/*\"\\n'\n + ' find ~ -type d -path \"*/apps/sim/tools\" -not -path \"*/node_modules/*\"',\n );\n return { success: false };\n }\n\n const catalogueRoots = cataloguePath === undefined\n ? discovered\n : cataloguePath.split(',').map((entry) => resolve(entry.trim())).filter((entry) => entry.length > 0);\n\n if (cataloguePath === undefined) {\n // Say WHICH, always. A discovered path is one the caller did not type, so a run that silently\n // used the wrong checkout would be indistinguishable from one that used the right one — and\n // running against the wrong Activepieces does not fail, it succeeds at a different upstream\n // commit. Naming them is what makes the convenience auditable.\n ctx.log.info(`--catalogue not given; using the catalogues beside the framework: ${catalogueRoots.join(', ')}`);\n }\n const layouts: Array<{ readonly layout: CatalogueLayout; readonly revision: string }> = [];\n for (const root of catalogueRoots) {\n // Each catalogue announces itself by its own layout. Detecting it beats a flag the caller has\n // to remember and get right: a wrong flag reads every file and finds nothing, which looks\n // exactly like an empty catalogue.\n const layout = detectCatalogue(root);\n if (layout === undefined) {\n ctx.log.error(\n `${root} is neither an Activepieces checkout (packages/pieces/community) nor a Sim one (apps/sim/tools). Point --catalogue at each repository ROOT.`,\n );\n return { success: false };\n }\n layouts.push({ layout, revision: readRevision(root) });\n }\n\n const vendor = ctx.flags[FLAG_VENDOR] as string | undefined;\n const limit = ctx.flags[FLAG_LIMIT] as string | undefined;\n const dryRun = ctx.flags[FLAG_DRY_RUN] === true;\n const providersRoot = join(frameworkRoot, 'providers');\n\n // Read every catalogue first, merge second, emit third. The order is what makes one provider per\n // vendor possible: a per-catalogue emit could only ever produce one package per SOURCE, which is\n // exactly the shape Paul ruled out on 2026-09-06.\n const read: TransposedProvider[] = [];\n const unreadableByVendor = new Map<string, TransposedOperation[]>();\n let vendorsRead = 0;\n\n for (const { layout, revision } of layouts) {\n let entries = readdirSync(layout.vendorsRoot).filter(\n (entry) => !entry.startsWith('__') && statSync(join(layout.vendorsRoot, entry)).isDirectory(),\n );\n // Sim spells a vendor with underscores and Activepieces with hyphens; accept either spelling so\n // `--vendor google-sheets` reaches both catalogues.\n if (vendor !== undefined) entries = entries.filter((entry) => entry.replace(/_/g, '-') === vendor.replace(/_/g, '-'));\n if (limit !== undefined) entries = entries.slice(0, Number(limit));\n\n for (const entry of entries) {\n const directory = join(layout.vendorsRoot, entry);\n const result =\n layout.source === ProviderCatalogueSource.ACTIVEPIECES\n ? readActivepiecesPiece({ pieceDirectory: directory, sourceVersion: revision })\n : readSimToolFamily({ toolDirectory: directory, sourceVersion: revision });\n read.push(result.provider);\n vendorsRead += 1;\n const existing = unreadableByVendor.get(result.provider.ref) ?? [];\n unreadableByVendor.set(result.provider.ref, [...existing, ...result.unreadable]);\n }\n }\n\n if (read.length === 0) {\n ctx.log.error(vendor === undefined ? 'No vendors found in any catalogue.' : `No vendor directory named '${vendor}' in any catalogue.`);\n return { success: false };\n }\n\n const merged = mergeTransposedProviders(read);\n const reports = merged.reports;\n // Enrichment runs AFTER the merge, on the operations that survived it, because a document answers\n // a question about an operation rather than proposing one — and the merge is what decides which\n // operations exist.\n const openApiRoot = ctx.flags[FLAG_OPENAPI] as string | undefined;\n const enrichment = openApiRoot === undefined ? undefined : enrichFromOpenApiDocuments(merged.providers, resolve(openApiRoot));\n const providers = enrichment?.providers ?? merged.providers;\n const completed = reports.reduce((total, report) => total + report.completed, 0);\n const deduplicated = reports.reduce((total, report) => total + report.deduplicated, 0);\n\n // Collected as it is reported, so the file and the warnings can never disagree about who was\n // withheld — two passes over the same predicate is how they would drift.\n const withheld: Array<{ ref: string; pending: number; unreadable: number }> = [];\n for (const provider of providers) {\n if (provider.operations.some((o) => o.resolution === TransposedOperationResolution.RESOLVED)) continue;\n const pend = provider.operations.filter((o) => o.resolution === TransposedOperationResolution.PENDING_ENDPOINT).length;\n const unreadable = (unreadableByVendor.get(provider.ref) ?? []).length;\n withheld.push({ ref: provider.ref, pending: pend, unreadable });\n ctx.log.warn(`${provider.ref}: no executable operation (${pend} pending, ${unreadable} unreadable) — no subpath exported.`);\n }\n\n // ONE package with a subpath per vendor (Paul, 2026-09-06). The emitter replaces the whole\n // vendor tree, so a vendor that disappears upstream disappears here rather than leaving an\n // exported subpath onto a room that was demolished.\n //\n // Which is why a FILTERED run may not emit. `--vendor` and `--limit` narrow the vendor list, and\n // the replace is unconditional, so emitting after a filter deletes every vendor the filter\n // excluded — 692 of them for `--vendor clockify` — and rewrites `package.json`, `NOTICE` and the\n // companion barrel to describe the one that survived. A partially emitted catalogue is not a\n // smaller catalogue; it is a broken one whose every manifest claims otherwise. Refusing is the\n // honest answer: merging into an existing tree is real complexity for a smoke-run flag (#393).\n const filtered = vendor !== undefined || limit !== undefined;\n if (filtered && !dryRun) {\n ctx.log.error(\n `A filtered run cannot emit: --${vendor !== undefined ? FLAG_VENDOR : FLAG_LIMIT} narrows the batch, and the emitter replaces the whole vendor tree, `\n + 'so emitting would delete every vendor the filter excluded. Add --dry-run to inspect the filtered result, or drop the filter to regenerate.',\n );\n return { success: false };\n }\n\n // Only a run that covered every catalogue the policy names, with no filter, may conclude that a\n // record entry matching nothing is stale. Everything else is a partial look, and a partial look\n // must not withdraw.\n const emitOptions = {\n packageRoot: providersRoot,\n providers,\n unreadableByVendor,\n fullBatch: isFullBatch({ packageRoot: providersRoot, sourcesRead: layouts.map(({ layout }) => layout.source), filtered }),\n };\n // Both branches take their counts from the SAME plan, so a dry run predicts the emit it is a dry\n // run of. Two copies of this accounting disagreed by 856 operations (#393).\n const emitResult = dryRun ? planProvidersPackage(emitOptions) : emitProvidersPackage(emitOptions);\n const refusedTotal = [...emitResult.refusedByVendor.values()].reduce((total, byReason) => total + [...byReason.values()].reduce((sum, count) => sum + count, 0), 0);\n\n // The consolidated account of the catalogue, made durable.\n //\n // Four records existed and none answered \"where do we stand\": the ledger holds operation\n // identity, the decisions hold judgements one file at a time, each vendor's own\n // `pending-operations.json` holds that vendor's losses, and this run's summary holds totals\n // naming nobody. So \"which vendors are unjudged\" or \"which are platform internals\" meant a script\n // across all four — which is why those answers kept being re-derived and then lost.\n //\n // Guarded by the same condition as the withdrawal pass, and for the same reason: a filtered or\n // dry run has not seen every vendor, so its inventory would omit entries it never opened.\n if (!dryRun && !filtered) {\n const withheldRefs = new Map(withheld.map((row) => [row.ref, row]));\n writeInventory(providersRoot, {\n generatedOn: new Date().toISOString().slice(0, 10),\n sourcesRead: layouts.map(({ layout }) => layout.source),\n entries: providers.map((provider) => {\n const decisions = readDecisions(providersRoot, provider.ref);\n const lost = withheldRefs.get(provider.ref);\n return {\n ref: provider.ref,\n classification: decisions?.classification ?? CatalogueEntryClassification.THIRD_PARTY_VENDOR,\n sources: [...new Set(provider.operations.map((operation) => operation.provenance.source))].sort(),\n exported: decisions?.scrape !== false && lost === undefined,\n withheld: decisions?.scrape === false,\n // Judged, not merely decided: a `scrape: false` file is a decision about SHIPPING, and\n // reading it as an admissibility judgement would report the withheld entries as done.\n admissibilityJudged: (decisions?.admissibleConnections?.length ?? 0) > 0,\n operations: provider.operations.filter((o) => o.resolution === TransposedOperationResolution.RESOLVED).length,\n pending: lost?.pending ?? provider.operations.filter((o) => o.resolution === TransposedOperationResolution.PENDING_ENDPOINT).length,\n unreadable: lost?.unreadable ?? (unreadableByVendor.get(provider.ref) ?? []).length,\n refusedAtEmit: Object.fromEntries(emitResult.refusedByVendor.get(provider.ref) ?? new Map()),\n };\n }),\n });\n }\n\n // A refusal count that moves is ordinary source movement, not a regression, so it is REPORTED\n // and never refused. Reporting it here is what stops it being noticed only by whoever reads a\n // 738-file ledger diff.\n if (emitResult.refusalMovement.size > 0) {\n const worsened = [...emitResult.refusalMovement].filter(([, byReason]) => Object.values(byReason).some((movement) => movement > 0));\n const improved = [...emitResult.refusalMovement].filter(([, byReason]) => Object.values(byReason).every((movement) => movement < 0));\n ctx.log.info(\n `Refusals moved for ${emitResult.refusalMovement.size} vendor(s): ${worsened.length} refusing MORE than last run, ${improved.length} refusing fewer. `\n + (worsened.length === 0\n ? 'Nothing got worse.'\n : `Worse: ${worsened\n .slice(0, 8)\n .map(([ref, byReason]) => `${ref} (${Object.entries(byReason).filter(([, m]) => m > 0).map(([reason, m]) => `+${m} ${reason}`).join(', ')})`)\n .join('; ')}${worsened.length > 8 ? ` and ${worsened.length - 8} more` : ''}.`),\n );\n }\n\n ctx.log.info(\n `${dryRun ? 'Would emit' : 'Emitted'} one package with ${emitResult.vendors} vendor subpath(s), merged from ${vendorsRead} vendor view(s) across `\n + `${layouts.map(({ layout, revision }) => `${layout.source}@${revision}`).join(' + ')}: `\n + `${emitResult.executableOperations} executable, ${emitResult.pendingOperations} pending an endpoint, ${emitResult.unreadableOperations} unreadable, `\n + `${refusedTotal} refused at emit across ${emitResult.refusedByVendor.size} vendor(s). `\n + `The merge completed ${completed} pending operation(s) from another catalogue's endpoint and collapsed ${deduplicated} duplicate(s).`\n + (enrichment === undefined\n ? ''\n : ` Vendor documents answered ${enrichment.report.operationsMatched} operation(s) across ${enrichment.report.vendorsWithADocument} vendor(s), adding ${enrichment.report.responseShapesAdded} response shape(s).`),\n );\n return { success: true };\n }\n}\n\ninterface CatalogueLayout {\n /**\n * Typed from the engine's `ProviderCatalogueSource` rather than re-spelled, which this field's\n * own comment already said it was: two hand-written literals beside a sentence naming the enum\n * they copy. The narrowing to two members is deliberate and is not the enum's shape — the third,\n * `OPENAPI_DOCUMENT`, is not a monorepo LAYOUT and is never produced by `detectCatalogue`; it\n * enters later through `enrichFromOpenApiDocuments`.\n */\n readonly source: ProviderCatalogueSource.ACTIVEPIECES | ProviderCatalogueSource.SIM;\n /** The directory whose children are one vendor each. */\n readonly vendorsRoot: string;\n}\n\nfunction detectCatalogue(root: string): CatalogueLayout | undefined {\n const activepieces = join(root, 'packages', 'pieces', 'community');\n if (existsSync(activepieces)) return { source: ProviderCatalogueSource.ACTIVEPIECES, vendorsRoot: activepieces };\n const sim = join(root, 'apps', 'sim', 'tools');\n if (existsSync(sim)) return { source: ProviderCatalogueSource.SIM, vendorsRoot: sim };\n return undefined;\n}\n\n/**\n * The catalogue's exact revision, recorded against every operation so a regeneration is\n * attributable to a specific upstream movement. A checkout with no git metadata is named as such\n * rather than given a plausible-looking version, because an invented provenance is worse than an\n * absent one.\n */\nfunction readRevision(catalogueRoot: string): string {\n try {\n return execSync('git rev-parse --short HEAD', { cwd: catalogueRoot, encoding: 'utf8', stdio: ['ignore', 'pipe', 'ignore'] }).trim();\n } catch {\n return 'unknown-revision';\n }\n}\n"]}
1
+ {"version":3,"file":"generate-providers.command.js","sourceRoot":"","sources":["../../../../src/commands/fwk/generate-providers.command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEnD,OAAO,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAEhE,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE1D,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAErC,OAAO,EAAE,qBAAqB,EAAE,MAAM,iFAAiF,CAAC;AACxH,OAAO,EAAE,0BAA0B,EAAE,MAAM,yEAAyE,CAAC;AACrH,OAAO,EAAE,wBAAwB,EAAE,MAAM,qEAAqE,CAAC;AAC/G,OAAO,EAAE,iBAAiB,EAAE,MAAM,wEAAwE,CAAC;AAC3G,OAAO,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,+EAA+E,CAAC;AAC3I,OAAO,EACL,4BAA4B,EAC5B,WAAW,EACX,aAAa,EACb,cAAc,GACf,MAAM,gFAAgF,CAAC;AACxF,OAAO,EACL,6BAA6B,GAG9B,MAAM,gFAAgF,CAAC;AAExF;;;;;;;GAOG;AACH,MAAM,2BAA2B,GAAG,6BAA6B,CAAC;AAElE;;;;;;;;;;;GAWG;AACH,SAAS,yBAAyB,CAAC,aAAqB;IACtD,MAAM,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AU,CAAC,GAAG,CAAC;QAAE,OAAO,EAAE,MAAM,EAAE,uBAAuB,CAAC,GAAG,EAAE,WAAW,EAAE,GAAG,EAAE,CAAC;IACtF,OAAO,SAAS,CAAC;AACnB,CAAC;AAED;;;;;GAKG;AACH,SAAS,YAAY,CAAC,aAAqB;IACzC,IAAI,CAAC;QACH,OAAO,QAAQ,CAAC,4BAA4B,EAAE,EAAE,GAAG,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;IACtI,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,kBAAkB,CAAC;IAC5B,CAAC;AACH,CAAC","sourcesContent":["import { readdirSync, statSync } from 'node:fs';\nimport { execSync } from 'node:child_process';\nimport { dirname, join, resolve } from 'node:path';\n\nimport { ProviderCatalogueSource } from '@wildo-ai/saas-models';\n\nimport { BaseCommand } from '~wildo-cli/kernel/base-command';\nimport { CommandCategory } from '~wildo-cli/kernel/types';\nimport type { CommandMeta, CommandContext, CommandResult, FlagDefinition } from '~wildo-cli/kernel/types';\nimport { existsSync } from 'node:fs';\n\nimport { readActivepiecesPiece } from '~wildo-cli/services/framework/provider-transposition/activepieces-source.reader';\nimport { enrichFromOpenApiDocuments } from '~wildo-cli/services/framework/provider-transposition/openapi-enrichment';\nimport { mergeTransposedProviders } from '~wildo-cli/services/framework/provider-transposition/provider-merge';\nimport { readSimToolFamily } from '~wildo-cli/services/framework/provider-transposition/sim-source.reader';\nimport { emitProvidersPackage, planProvidersPackage } from '~wildo-cli/services/framework/provider-transposition/provider-package.emitter';\nimport {\n CatalogueEntryClassification,\n isFullBatch,\n readDecisions,\n writeInventory,\n} from '~wildo-cli/services/framework/provider-transposition/provider-catalogue-record';\nimport {\n TransposedOperationResolution,\n type TransposedOperation,\n type TransposedProvider,\n} from '~wildo-cli/services/framework/provider-transposition/transposed-provider.model';\n\n/**\n * Where the source catalogues conventionally sit: a sibling of the framework checkout.\n *\n * Not a fallback invented for convenience — it is where they already are, and the flag being\n * mandatory is what made a regeneration stall twice on a path somebody had to remember. The refusal\n * itself was right: a catalogue cannot be assumed into existence. What was missing is that the\n * ordinary case needs no assumption at all.\n */\nconst SIBLING_CATALOGUE_DIRECTORY = 'connector-scrapping-sources';\n\n/**\n * Every checkout beside the framework that IS a catalogue, identified by layout.\n *\n * By layout and never by name, which is the same rule the detector downstream applies and the one\n * that matters most here: a directory called `activepieces` belonging to an unrelated project is a\n * real Activepieces checkout at a different upstream commit, so running against it does not fail —\n * it succeeds, wrongly. Matching on `packages/pieces/community` and `apps/sim/tools` cannot make\n * that mistake.\n *\n * Returns EMPTY rather than throwing when the directory is absent, so the caller's own refusal — the\n * one that explains what a catalogue is — stays the single place that reports it.\n */\nfunction discoverSiblingCatalogues(frameworkRoot: string): readonly string[] {\n const parent = join(dirname(frameworkRoot), SIBLING_CATALOGUE_DIRECTORY);\n if (!existsSync(parent)) return [];\n\n const found: string[] = [];\n for (const entry of readdirSync(parent).sort()) {\n const candidate = join(parent, entry);\n if (!statSync(candidate).isDirectory()) continue;\n if (existsSync(join(candidate, 'packages', 'pieces', 'community'))\n || existsSync(join(candidate, 'apps', 'sim', 'tools'))) {\n found.push(candidate);\n }\n }\n return found;\n}\n\nconst FLAG_CATALOGUE = 'catalogue';\nconst FLAG_VENDOR = 'vendor';\nconst FLAG_LIMIT = 'limit';\nconst FLAG_DRY_RUN = 'dry-run';\nconst FLAG_OPENAPI = 'openapi';\n\nconst FLAGS: Record<string, FlagDefinition> = {\n [FLAG_CATALOGUE]: {\n type: 'string',\n description: 'Comma-separated paths to source catalogue checkouts (Activepieces and/or Sim repository roots; each layout is detected). Optional when the checkouts sit in `connector-scrapping-sources` beside the framework, which is where they conventionally live; the run then names the ones it found. Passing both catalogues merges them into one provider per vendor.',\n },\n [FLAG_VENDOR]: {\n type: 'string',\n description: 'Transpose one vendor only, by directory name (e.g. `clockify`, `google-sheets`). Underscores and hyphens are interchangeable. Omit to run the whole catalogue.',\n },\n [FLAG_LIMIT]: {\n type: 'string',\n description: 'Stop after N vendors. For a smoke run over a large catalogue.',\n },\n [FLAG_OPENAPI]: {\n type: 'string',\n description:\n 'Path to an OpenAPI corpus (e.g. jentic-public-apis/apis/openapi). OPT-IN and never a catalogue: '\n + 'a vendor document is consulted about operations the catalogues already chose, to answer what an '\n + 'operation ANSWERS. It contributes no operation of its own, so the emitted set is identical with '\n + 'and without it.',\n },\n [FLAG_DRY_RUN]: {\n type: 'boolean',\n description: 'Read and report without writing any package.',\n default: false,\n },\n};\n\n/**\n * `wildo fwk generate-providers` — the transposer.\n *\n * Reads an external catalogue's SOURCE — Activepieces or Sim, detected from the checkout's layout —\n * and emits native Wildo provider packages under `providers/<ref>/`. The catalogue is a build-time input that lives OUTSIDE this repository (a\n * sibling checkout), so its path is an argument and never a default: a tool that assumed a\n * repo-relative location would break the moment anybody cloned the sources somewhere else, and\n * vendoring 21 GB of somebody else's specs is a fork, not a build input.\n *\n * What it emits is ordinary Wildo code. No third-party package becomes a runtime dependency of any\n * application and nothing third-party executes — the operations are DATA, run by the engine's own\n * HTTP client. That distinction is the reason this command exists at all: the alternative, wrapping\n * and executing published bundles, was built, measured, and deleted on 2026-09-06.\n */\nexport default class FwkGenerateProvidersCommand extends BaseCommand {\n readonly meta: CommandMeta = {\n name: 'fwk generate-providers',\n description: 'Transpose an external catalogue (Activepieces or Sim) into native Wildo provider packages under providers/.',\n category: CommandCategory.Fwk,\n flags: FLAGS,\n };\n\n async run(ctx: CommandContext): Promise<CommandResult> {\n const frameworkRoot = ctx.cliContext.resolvedHomes.framework.repositoryRoot;\n if (frameworkRoot === undefined || frameworkRoot === null) {\n ctx.log.error('Framework path not set. Run `wildo init` inside the framework workspace first.');\n return { success: false };\n }\n\n const cataloguePath = ctx.flags[FLAG_CATALOGUE] as string | undefined;\n const discovered = cataloguePath === undefined ? discoverSiblingCatalogues(frameworkRoot) : [];\n if (cataloguePath === undefined && discovered.length === 0) {\n ctx.log.error(\n '--catalogue is required: the source catalogues live outside this repository, so their path cannot be assumed.',\n );\n ctx.log.error(\n `Nothing was found at the conventional location either (${join(dirname(frameworkRoot), SIBLING_CATALOGUE_DIRECTORY)}). `\n + 'A catalogue is identified by its LAYOUT, never by its directory name — an Activepieces checkout contains '\n + '`packages/pieces/community`, a Sim one contains `apps/sim/tools`. Locate yours with:\\n'\n + ' find ~ -type d -path \"*/packages/pieces/community\" -not -path \"*/node_modules/*\"\\n'\n + ' find ~ -type d -path \"*/apps/sim/tools\" -not -path \"*/node_modules/*\"',\n );\n return { success: false };\n }\n\n const catalogueRoots = cataloguePath === undefined\n ? discovered\n : cataloguePath.split(',').map((entry) => resolve(entry.trim())).filter((entry) => entry.length > 0);\n\n if (cataloguePath === undefined) {\n // Say WHICH, always. A discovered path is one the caller did not type, so a run that silently\n // used the wrong checkout would be indistinguishable from one that used the right one — and\n // running against the wrong Activepieces does not fail, it succeeds at a different upstream\n // commit. Naming them is what makes the convenience auditable.\n ctx.log.info(`--catalogue not given; using the catalogues beside the framework: ${catalogueRoots.join(', ')}`);\n }\n const layouts: Array<{ readonly layout: CatalogueLayout; readonly revision: string }> = [];\n for (const root of catalogueRoots) {\n // Each catalogue announces itself by its own layout. Detecting it beats a flag the caller has\n // to remember and get right: a wrong flag reads every file and finds nothing, which looks\n // exactly like an empty catalogue.\n const layout = detectCatalogue(root);\n if (layout === undefined) {\n ctx.log.error(\n `${root} is neither an Activepieces checkout (packages/pieces/community) nor a Sim one (apps/sim/tools). Point --catalogue at each repository ROOT.`,\n );\n return { success: false };\n }\n layouts.push({ layout, revision: readRevision(root) });\n }\n\n const vendor = ctx.flags[FLAG_VENDOR] as string | undefined;\n const limit = ctx.flags[FLAG_LIMIT] as string | undefined;\n const dryRun = ctx.flags[FLAG_DRY_RUN] === true;\n const providersRoot = join(frameworkRoot, 'providers');\n\n // Read every catalogue first, merge second, emit third. The order is what makes one provider per\n // vendor possible: a per-catalogue emit could only ever produce one package per SOURCE, which is\n // exactly the shape Paul ruled out on 2026-09-06.\n const read: TransposedProvider[] = [];\n const unreadableByVendor = new Map<string, TransposedOperation[]>();\n let vendorsRead = 0;\n\n for (const { layout, revision } of layouts) {\n let entries = readdirSync(layout.vendorsRoot).filter(\n (entry) => !entry.startsWith('__') && statSync(join(layout.vendorsRoot, entry)).isDirectory(),\n );\n // Sim spells a vendor with underscores and Activepieces with hyphens; accept either spelling so\n // `--vendor google-sheets` reaches both catalogues.\n if (vendor !== undefined) entries = entries.filter((entry) => entry.replace(/_/g, '-') === vendor.replace(/_/g, '-'));\n if (limit !== undefined) entries = entries.slice(0, Number(limit));\n\n for (const entry of entries) {\n const directory = join(layout.vendorsRoot, entry);\n const result =\n layout.source === ProviderCatalogueSource.ACTIVEPIECES\n ? readActivepiecesPiece({ pieceDirectory: directory, sourceVersion: revision })\n : readSimToolFamily({ toolDirectory: directory, sourceVersion: revision });\n read.push(result.provider);\n vendorsRead += 1;\n const existing = unreadableByVendor.get(result.provider.ref) ?? [];\n unreadableByVendor.set(result.provider.ref, [...existing, ...result.unreadable]);\n }\n }\n\n if (read.length === 0) {\n ctx.log.error(vendor === undefined ? 'No vendors found in any catalogue.' : `No vendor directory named '${vendor}' in any catalogue.`);\n return { success: false };\n }\n\n const merged = mergeTransposedProviders(read);\n const reports = merged.reports;\n // Enrichment runs AFTER the merge, on the operations that survived it, because a document answers\n // a question about an operation rather than proposing one — and the merge is what decides which\n // operations exist.\n const openApiRoot = ctx.flags[FLAG_OPENAPI] as string | undefined;\n const enrichment = openApiRoot === undefined ? undefined : enrichFromOpenApiDocuments(merged.providers, resolve(openApiRoot));\n const providers = enrichment?.providers ?? merged.providers;\n const completed = reports.reduce((total, report) => total + report.completed, 0);\n const deduplicated = reports.reduce((total, report) => total + report.deduplicated, 0);\n\n // Collected as it is reported, so the file and the warnings can never disagree about who was\n // withheld — two passes over the same predicate is how they would drift.\n const withheld: Array<{ ref: string; pending: number; unreadable: number }> = [];\n for (const provider of providers) {\n if (provider.operations.some((o) => o.resolution === TransposedOperationResolution.RESOLVED)) continue;\n const pend = provider.operations.filter((o) => o.resolution === TransposedOperationResolution.PENDING_ENDPOINT).length;\n const unreadable = (unreadableByVendor.get(provider.ref) ?? []).length;\n withheld.push({ ref: provider.ref, pending: pend, unreadable });\n\n // A vendor somebody DECIDED to withhold is not news. This warning exists to surface an entry\n // that produced nothing UNEXPECTEDLY — a vendor whose extraction broke, which somebody might\n // fix — and a deliberate `scrape: false` is the opposite of that. Reporting both made the line\n // fire 214 times a run, and a warning that fires 214 times is read by nobody, which cost the\n // real findings their audience. The withheld entries stay in the inventory, where the question\n // they answer is \"what did we decide\" rather than \"what went wrong\".\n if (readDecisions(providersRoot, provider.ref)?.scrape === false) continue;\n\n ctx.log.warn(`${provider.ref}: no executable operation (${pend} pending, ${unreadable} unreadable) — no subpath exported.`);\n }\n\n // ONE package with a subpath per vendor (Paul, 2026-09-06). The emitter replaces the whole\n // vendor tree, so a vendor that disappears upstream disappears here rather than leaving an\n // exported subpath onto a room that was demolished.\n //\n // Which is why a FILTERED run may not emit. `--vendor` and `--limit` narrow the vendor list, and\n // the replace is unconditional, so emitting after a filter deletes every vendor the filter\n // excluded — 692 of them for `--vendor clockify` — and rewrites `package.json`, `NOTICE` and the\n // companion barrel to describe the one that survived. A partially emitted catalogue is not a\n // smaller catalogue; it is a broken one whose every manifest claims otherwise. Refusing is the\n // honest answer: merging into an existing tree is real complexity for a smoke-run flag (#393).\n const filtered = vendor !== undefined || limit !== undefined;\n if (filtered && !dryRun) {\n ctx.log.error(\n `A filtered run cannot emit: --${vendor !== undefined ? FLAG_VENDOR : FLAG_LIMIT} narrows the batch, and the emitter replaces the whole vendor tree, `\n + 'so emitting would delete every vendor the filter excluded. Add --dry-run to inspect the filtered result, or drop the filter to regenerate.',\n );\n return { success: false };\n }\n\n // Only a run that covered every catalogue the policy names, with no filter, may conclude that a\n // record entry matching nothing is stale. Everything else is a partial look, and a partial look\n // must not withdraw.\n const emitOptions = {\n packageRoot: providersRoot,\n providers,\n unreadableByVendor,\n fullBatch: isFullBatch({ packageRoot: providersRoot, sourcesRead: layouts.map(({ layout }) => layout.source), filtered }),\n };\n // Both branches take their counts from the SAME plan, so a dry run predicts the emit it is a dry\n // run of. Two copies of this accounting disagreed by 856 operations (#393).\n const emitResult = dryRun ? planProvidersPackage(emitOptions) : emitProvidersPackage(emitOptions);\n const refusedTotal = [...emitResult.refusedByVendor.values()].reduce((total, byReason) => total + [...byReason.values()].reduce((sum, count) => sum + count, 0), 0);\n\n // The consolidated account of the catalogue, made durable.\n //\n // Four records existed and none answered \"where do we stand\": the ledger holds operation\n // identity, the decisions hold judgements one file at a time, each vendor's own\n // `pending-operations.json` holds that vendor's losses, and this run's summary holds totals\n // naming nobody. So \"which vendors are unjudged\" or \"which are platform internals\" meant a script\n // across all four — which is why those answers kept being re-derived and then lost.\n //\n // Guarded by the same condition as the withdrawal pass, and for the same reason: a filtered or\n // dry run has not seen every vendor, so its inventory would omit entries it never opened.\n if (!dryRun && !filtered) {\n const withheldRefs = new Map(withheld.map((row) => [row.ref, row]));\n writeInventory(providersRoot, {\n generatedOn: new Date().toISOString().slice(0, 10),\n sourcesRead: layouts.map(({ layout }) => layout.source),\n entries: providers.map((provider) => {\n const decisions = readDecisions(providersRoot, provider.ref);\n const lost = withheldRefs.get(provider.ref);\n return {\n ref: provider.ref,\n classification: decisions?.classification ?? CatalogueEntryClassification.THIRD_PARTY_VENDOR,\n sources: [...new Set(provider.operations.map((operation) => operation.provenance.source))].sort(),\n // Asked, never re-derived. `vendorIsExported` has three clauses — nothing executable,\n // withheld by decision, and a ref the ENGINE already owns — and reconstructing it here\n // missed the third, reporting 707 exports against 682 actually emitted. The emitter now\n // reports the set it built the package from.\n exported: emitResult.exportedOperationCounts.has(provider.ref),\n withheld: decisions?.scrape === false,\n // Judged, not merely decided: a `scrape: false` file is a decision about SHIPPING, and\n // reading it as an admissibility judgement would report the withheld entries as done.\n admissibilityJudged: (decisions?.admissibleConnections?.length ?? 0) > 0,\n // The count the emitter shipped, falling back to the planned count for an entry it did\n // not export — a withheld vendor still has operations, and reporting zero would read as\n // \"nothing to ship\" rather than \"we chose not to\".\n operations: emitResult.exportedOperationCounts.get(provider.ref)\n ?? provider.operations.filter((o) => o.resolution === TransposedOperationResolution.RESOLVED).length,\n pending: lost?.pending ?? provider.operations.filter((o) => o.resolution === TransposedOperationResolution.PENDING_ENDPOINT).length,\n unreadable: lost?.unreadable ?? (unreadableByVendor.get(provider.ref) ?? []).length,\n refusedAtEmit: Object.fromEntries(emitResult.refusedByVendor.get(provider.ref) ?? new Map()),\n };\n }),\n });\n }\n\n // A refusal count that moves is ordinary source movement, not a regression, so it is REPORTED\n // and never refused. Reporting it here is what stops it being noticed only by whoever reads a\n // 738-file ledger diff.\n if (emitResult.refusalMovement.size > 0) {\n const worsened = [...emitResult.refusalMovement].filter(([, byReason]) => Object.values(byReason).some((movement) => movement > 0));\n const improved = [...emitResult.refusalMovement].filter(([, byReason]) => Object.values(byReason).every((movement) => movement < 0));\n ctx.log.info(\n `Refusals moved for ${emitResult.refusalMovement.size} vendor(s): ${worsened.length} refusing MORE than last run, ${improved.length} refusing fewer. `\n + (worsened.length === 0\n ? 'Nothing got worse.'\n : `Worse: ${worsened\n .slice(0, 8)\n .map(([ref, byReason]) => `${ref} (${Object.entries(byReason).filter(([, m]) => m > 0).map(([reason, m]) => `+${m} ${reason}`).join(', ')})`)\n .join('; ')}${worsened.length > 8 ? ` and ${worsened.length - 8} more` : ''}.`),\n );\n }\n\n ctx.log.info(\n `${dryRun ? 'Would emit' : 'Emitted'} one package with ${emitResult.vendors} vendor subpath(s), merged from ${vendorsRead} vendor view(s) across `\n + `${layouts.map(({ layout, revision }) => `${layout.source}@${revision}`).join(' + ')}: `\n + `${emitResult.executableOperations} executable, ${emitResult.pendingOperations} pending an endpoint, ${emitResult.unreadableOperations} unreadable, `\n + `${refusedTotal} refused at emit across ${emitResult.refusedByVendor.size} vendor(s). `\n + `The merge completed ${completed} pending operation(s) from another catalogue's endpoint and collapsed ${deduplicated} duplicate(s).`\n + (enrichment === undefined\n ? ''\n : ` Vendor documents answered ${enrichment.report.operationsMatched} operation(s) across ${enrichment.report.vendorsWithADocument} vendor(s), adding ${enrichment.report.responseShapesAdded} response shape(s).`),\n );\n return { success: true };\n }\n}\n\ninterface CatalogueLayout {\n /**\n * Typed from the engine's `ProviderCatalogueSource` rather than re-spelled, which this field's\n * own comment already said it was: two hand-written literals beside a sentence naming the enum\n * they copy. The narrowing to two members is deliberate and is not the enum's shape — the third,\n * `OPENAPI_DOCUMENT`, is not a monorepo LAYOUT and is never produced by `detectCatalogue`; it\n * enters later through `enrichFromOpenApiDocuments`.\n */\n readonly source: ProviderCatalogueSource.ACTIVEPIECES | ProviderCatalogueSource.SIM;\n /** The directory whose children are one vendor each. */\n readonly vendorsRoot: string;\n}\n\nfunction detectCatalogue(root: string): CatalogueLayout | undefined {\n const activepieces = join(root, 'packages', 'pieces', 'community');\n if (existsSync(activepieces)) return { source: ProviderCatalogueSource.ACTIVEPIECES, vendorsRoot: activepieces };\n const sim = join(root, 'apps', 'sim', 'tools');\n if (existsSync(sim)) return { source: ProviderCatalogueSource.SIM, vendorsRoot: sim };\n return undefined;\n}\n\n/**\n * The catalogue's exact revision, recorded against every operation so a regeneration is\n * attributable to a specific upstream movement. A checkout with no git metadata is named as such\n * rather than given a plausible-looking version, because an invented provenance is worse than an\n * absent one.\n */\nfunction readRevision(catalogueRoot: string): string {\n try {\n return execSync('git rev-parse --short HEAD', { cwd: catalogueRoot, encoding: 'utf8', stdio: ['ignore', 'pipe', 'ignore'] }).trim();\n } catch {\n return 'unknown-revision';\n }\n}\n"]}
@@ -3,5 +3,13 @@ import type { CommandMeta, CommandContext, CommandResult } from '../../kernel/ty
3
3
  export default class GenerateEmailPreviewCommand extends BaseCommand {
4
4
  readonly meta: CommandMeta;
5
5
  run(ctx: CommandContext): Promise<CommandResult>;
6
+ /**
7
+ * Write the rendered HTML and return its path, or `null` when the write failed.
8
+ *
9
+ * A failed write REPORTS and does not fail the command: the preview itself succeeded, the subject
10
+ * and text body are already on screen, and turning a successful render into a failed command
11
+ * because a temporary directory was not writable would lose the answer the developer came for.
12
+ */
13
+ private writeRenderedHtml;
6
14
  }
7
15
  //# sourceMappingURL=email-preview.command.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"email-preview.command.d.ts","sourceRoot":"","sources":["../../../../src/commands/generate/email-preview.command.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAG7D,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAQ1F,MAAM,CAAC,OAAO,OAAO,2BAA4B,SAAQ,WAAW;IAClE,QAAQ,CAAC,IAAI,EAAE,WAAW,CAgBxB;IAEI,GAAG,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,aAAa,CAAC;CA2CvD"}
1
+ {"version":3,"file":"email-preview.command.d.ts","sourceRoot":"","sources":["../../../../src/commands/generate/email-preview.command.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAG7D,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAQ1F,MAAM,CAAC,OAAO,OAAO,2BAA4B,SAAQ,WAAW;IAClE,QAAQ,CAAC,IAAI,EAAE,WAAW,CAoBxB;IAEI,GAAG,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,aAAa,CAAC;IAwEtD;;;;;;OAMG;YACW,iBAAiB;CAiBhC"}
@@ -1,4 +1,7 @@
1
1
  import chalk from 'chalk';
2
+ import { writeFile } from 'node:fs/promises';
3
+ import { tmpdir } from 'node:os';
4
+ import { join } from 'node:path';
2
5
  import { BaseCommand } from '../../kernel/base-command.js';
3
6
  import { CommandCategory } from '../../kernel/types.js';
4
7
  import { ErrorUtils } from '../../infrastructure/errors/error.utils.js';
@@ -20,6 +23,10 @@ export default class GenerateEmailPreviewCommand extends BaseCommand {
20
23
  description: 'Locale to preview',
21
24
  required: true,
22
25
  },
26
+ out: {
27
+ type: 'string',
28
+ description: 'Where to write the rendered HTML (default: a file in the OS temporary directory)',
29
+ },
23
30
  },
24
31
  };
25
32
  async run(ctx) {
@@ -43,6 +50,32 @@ export default class GenerateEmailPreviewCommand extends BaseCommand {
43
50
  ctx.log.info('');
44
51
  ctx.log.info(chalk.bold(' Subject'));
45
52
  ctx.log.info(` ${result.subject}`);
53
+ /*
54
+ * WRITE THE HTML, because rendering it was always the point (#567).
55
+ *
56
+ * The companion has rendered `bodyHtml` since this command was written, and this command
57
+ * fetched it over the wire and then printed only `subject` and `bodyText`. So the one question
58
+ * the email lane exists to answer — *does this actually LOOK right* — was unanswerable from
59
+ * the surface built to answer it, and a plain-text dump cannot answer it by construction: a
60
+ * brand logo is an `<img>`, and that is a fair part of how ninety-five scaffold templates came
61
+ * to render no logo without anyone noticing (#522).
62
+ *
63
+ * A FILE rather than a served inbox, and the reason is what a preview IS. `previewTemplate`
64
+ * builds its own mock context — `preview@example.com`, `Preview Object` — so nothing here is a
65
+ * real send and nothing here is personal data. The retention question that made a per-send
66
+ * artifact a real decision on #546 therefore does not arise: there is no recipient, no body
67
+ * anyone wrote, and no environment in which this command runs by itself.
68
+ *
69
+ * Overwritten per template+locale rather than accumulated, so repeated previews of the same
70
+ * template do not fill a directory, and a stale file can never be mistaken for a fresh render.
71
+ */
72
+ const htmlPath = await this.writeRenderedHtml(ctx, result);
73
+ if (htmlPath) {
74
+ ctx.log.info('');
75
+ ctx.log.info(chalk.bold(' Rendered HTML'));
76
+ ctx.log.info(` ${htmlPath}`);
77
+ ctx.log.info(chalk.dim(' Open it in a browser to see the email as a recipient would.'));
78
+ }
46
79
  if (result.bodyText) {
47
80
  ctx.log.info('');
48
81
  ctx.log.info(chalk.bold(' Body Text'));
@@ -58,5 +91,29 @@ export default class GenerateEmailPreviewCommand extends BaseCommand {
58
91
  return { success: false };
59
92
  }
60
93
  }
94
+ /**
95
+ * Write the rendered HTML and return its path, or `null` when the write failed.
96
+ *
97
+ * A failed write REPORTS and does not fail the command: the preview itself succeeded, the subject
98
+ * and text body are already on screen, and turning a successful render into a failed command
99
+ * because a temporary directory was not writable would lose the answer the developer came for.
100
+ */
101
+ async writeRenderedHtml(ctx, result) {
102
+ if (!result.bodyHtml)
103
+ return null;
104
+ const requestedPath = typeof ctx.flags.out === 'string' && ctx.flags.out.trim().length > 0 ? ctx.flags.out.trim() : undefined;
105
+ // Filesystem-safe, and NOT an escape: every path separator and dot in a ref collapses to `-`, so
106
+ // a template ref can never steer the write out of the directory chosen here.
107
+ const slug = `${result.templateRef}-${result.locale}`.replace(/[^a-zA-Z0-9-]+/g, '-');
108
+ const path = requestedPath ?? join(tmpdir(), `wildo-email-preview-${slug}.html`);
109
+ try {
110
+ await writeFile(path, result.bodyHtml, 'utf8');
111
+ return path;
112
+ }
113
+ catch (error) {
114
+ ctx.log.warn(` Could not write the rendered HTML to ${path}: ${ErrorUtils.extractErrorMessage(error)}`);
115
+ return null;
116
+ }
117
+ }
61
118
  }
62
119
  //# sourceMappingURL=email-preview.command.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"email-preview.command.js","sourceRoot":"","sources":["../../../../../../src/commands/generate/email-preview.command.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,MAAM,8CAA8C,CAAC;AAE1E,OAAO,EAAE,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AAC3E,OAAO,EACL,aAAa,EACb,iBAAiB,GAElB,MAAM,uBAAuB,CAAC;AAE/B,MAAM,CAAC,OAA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,CAAC,CAAC;YACzF,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;QAC5B,CAAC;IACH,CAAC;CACF","sourcesContent":["import chalk from 'chalk';\n\nimport { BaseCommand } from '~wildo-cli/kernel/base-command';\nimport { CommandCategory } from '~wildo-cli/kernel/types';\nimport { ErrorUtils } from '~wildo-cli/infrastructure/errors/error.utils';\nimport type { CommandMeta, CommandContext, CommandResult } from '~wildo-cli/kernel/types';\nimport { ensureSaasAppScope } from '~wildo-cli/kernel/command-scope-utils';\nimport {\n companionPost,\n requireStringFlag,\n type PreviewEmailTemplateCliResult,\n} from './email-command.utils';\n\nexport default class GenerateEmailPreviewCommand extends BaseCommand {\n readonly meta: CommandMeta = {\n name: 'generate email preview',\n description: 'Preview an email template',\n category: CommandCategory.Generate,\n flags: {\n template: {\n type: 'string',\n description: 'Template ref to preview',\n required: true,\n },\n locale: {\n type: 'string',\n description: 'Locale to preview',\n required: true,\n },\n },\n };\n\n async run(ctx: CommandContext): Promise<CommandResult> {\n if (!ensureSaasAppScope(ctx)) {\n return { success: false };\n }\n\n const templateRef = requireStringFlag(ctx, 'template', 'template ref to preview');\n const locale = requireStringFlag(ctx, 'locale', 'locale to preview');\n if (!templateRef || !locale) {\n return { success: false };\n }\n\n try {\n ctx.log.info(chalk.cyan('\\n Previewing email template via dev companion...\\n'));\n\n const result = await companionPost<PreviewEmailTemplateCliResult>(\n ctx,\n '/api/companion/email-templates/preview',\n { templateRef, locale },\n );\n\n ctx.log.success(' Email template preview completed.');\n ctx.log.info(chalk.dim(` Template: ${result.templateRef}`));\n ctx.log.info(chalk.dim(` Locale: ${result.locale}`));\n if (result.resolvedLocale) ctx.log.info(chalk.dim(` Resolved locale: ${result.resolvedLocale}`));\n ctx.log.info(chalk.dim(` Previewed at: ${result.previewedAt}`));\n ctx.log.info('');\n ctx.log.info(chalk.bold(' Subject'));\n ctx.log.info(` ${result.subject}`);\n if (result.bodyText) {\n ctx.log.info('');\n ctx.log.info(chalk.bold(' Body Text'));\n for (const line of result.bodyText.split('\\n')) {\n ctx.log.info(` ${line}`);\n }\n }\n ctx.log.info('');\n\n return { success: true };\n } catch (error) {\n ctx.log.error(`Email template preview failed: ${ErrorUtils.extractErrorMessage(error)}`);\n return { success: false };\n }\n }\n}\n"]}
1
+ {"version":3,"file":"email-preview.command.js","sourceRoot":"","sources":["../../../../src/commands/generate/email-preview.command.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,MAAM,8CAA8C,CAAC;AAE1E,OAAO,EAAE,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AAC3E,OAAO,EACL,aAAa,EACb,iBAAiB,GAElB,MAAM,uBAAuB,CAAC;AAE/B,MAAM,CAAC,OAAO,OAAO,2BAA4B,SAAQ,WAAW;IACzD,IAAI,GAAgB;QAC3B,IAAI,EAAE,wBAAwB;QAC9B,WAAW,EAAE,2BAA2B;QACxC,QAAQ,EAAE,eAAe,CAAC,QAAQ;QAClC,KAAK,EAAE;YACL,QAAQ,EAAE;gBACR,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,yBAAyB;gBACtC,QAAQ,EAAE,IAAI;aACf;YACD,MAAM,EAAE;gBACN,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,mBAAmB;gBAChC,QAAQ,EAAE,IAAI;aACf;YACD,GAAG,EAAE;gBACH,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,kFAAkF;aAChG;SACF;KACF,CAAC;IAEF,KAAK,CAAC,GAAG,CAAC,GAAmB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GAAG,CAAC,KAAK,CAAC,kCAAkC,UAAU,CAAC,mBAAmB,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;YACzF,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;QAC5B,CAAC;IACH,CAAC;IAED;;;;;;OAMG;IACK,KAAK,CAAC,iBAAiB,CAAC,GAAmB,EAAE,MAAqC;QACxF,IAAI,CAAC,MAAM,CAAC,QAAQ;YAAE,OAAO,IAAI,CAAC;QAElC,MAAM,aAAa,GAAG,OAAO,GAAG,CAAC,KAAK,CAAC,GAAG,KAAK,QAAQ,IAAI,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;QAC9H,iGAAiG;QACjG,6EAA6E;QAC7E,MAAM,IAAI,GAAG,GAAG,MAAM,CAAC,WAAW,IAAI,MAAM,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,iBAAiB,EAAE,GAAG,CAAC,CAAC;QACtF,MAAM,IAAI,GAAG,aAAa,IAAI,IAAI,CAAC,MAAM,EAAE,EAAE,uBAAuB,IAAI,OAAO,CAAC,CAAC;QAEjF,IAAI,CAAC;YACH,MAAM,SAAS,CAAC,IAAI,EAAE,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;YAC/C,OAAO,IAAI,CAAC;QACd,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,0CAA0C,IAAI,KAAK,UAAU,CAAC,mBAAmB,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;YACzG,OAAO,IAAI,CAAC;QACd,CAAC;IACH,CAAC;CACF","sourcesContent":["import chalk from 'chalk';\nimport { writeFile } from 'node:fs/promises';\nimport { tmpdir } from 'node:os';\nimport { join } from 'node:path';\n\nimport { BaseCommand } from '~wildo-cli/kernel/base-command';\nimport { CommandCategory } from '~wildo-cli/kernel/types';\nimport { ErrorUtils } from '~wildo-cli/infrastructure/errors/error.utils';\nimport type { CommandMeta, CommandContext, CommandResult } from '~wildo-cli/kernel/types';\nimport { ensureSaasAppScope } from '~wildo-cli/kernel/command-scope-utils';\nimport {\n companionPost,\n requireStringFlag,\n type PreviewEmailTemplateCliResult,\n} from './email-command.utils';\n\nexport default class GenerateEmailPreviewCommand extends BaseCommand {\n readonly meta: CommandMeta = {\n name: 'generate email preview',\n description: 'Preview an email template',\n category: CommandCategory.Generate,\n flags: {\n template: {\n type: 'string',\n description: 'Template ref to preview',\n required: true,\n },\n locale: {\n type: 'string',\n description: 'Locale to preview',\n required: true,\n },\n out: {\n type: 'string',\n description: 'Where to write the rendered HTML (default: a file in the OS temporary directory)',\n },\n },\n };\n\n async run(ctx: CommandContext): Promise<CommandResult> {\n if (!ensureSaasAppScope(ctx)) {\n return { success: false };\n }\n\n const templateRef = requireStringFlag(ctx, 'template', 'template ref to preview');\n const locale = requireStringFlag(ctx, 'locale', 'locale to preview');\n if (!templateRef || !locale) {\n return { success: false };\n }\n\n try {\n ctx.log.info(chalk.cyan('\\n Previewing email template via dev companion...\\n'));\n\n const result = await companionPost<PreviewEmailTemplateCliResult>(\n ctx,\n '/api/companion/email-templates/preview',\n { templateRef, locale },\n );\n\n ctx.log.success(' Email template preview completed.');\n ctx.log.info(chalk.dim(` Template: ${result.templateRef}`));\n ctx.log.info(chalk.dim(` Locale: ${result.locale}`));\n if (result.resolvedLocale) ctx.log.info(chalk.dim(` Resolved locale: ${result.resolvedLocale}`));\n ctx.log.info(chalk.dim(` Previewed at: ${result.previewedAt}`));\n ctx.log.info('');\n ctx.log.info(chalk.bold(' Subject'));\n ctx.log.info(` ${result.subject}`);\n\n /*\n * WRITE THE HTML, because rendering it was always the point (#567).\n *\n * The companion has rendered `bodyHtml` since this command was written, and this command\n * fetched it over the wire and then printed only `subject` and `bodyText`. So the one question\n * the email lane exists to answer — *does this actually LOOK right* — was unanswerable from\n * the surface built to answer it, and a plain-text dump cannot answer it by construction: a\n * brand logo is an `<img>`, and that is a fair part of how ninety-five scaffold templates came\n * to render no logo without anyone noticing (#522).\n *\n * A FILE rather than a served inbox, and the reason is what a preview IS. `previewTemplate`\n * builds its own mock context — `preview@example.com`, `Preview Object` — so nothing here is a\n * real send and nothing here is personal data. The retention question that made a per-send\n * artifact a real decision on #546 therefore does not arise: there is no recipient, no body\n * anyone wrote, and no environment in which this command runs by itself.\n *\n * Overwritten per template+locale rather than accumulated, so repeated previews of the same\n * template do not fill a directory, and a stale file can never be mistaken for a fresh render.\n */\n const htmlPath = await this.writeRenderedHtml(ctx, result);\n if (htmlPath) {\n ctx.log.info('');\n ctx.log.info(chalk.bold(' Rendered HTML'));\n ctx.log.info(` ${htmlPath}`);\n ctx.log.info(chalk.dim(' Open it in a browser to see the email as a recipient would.'));\n }\n\n if (result.bodyText) {\n ctx.log.info('');\n ctx.log.info(chalk.bold(' Body Text'));\n for (const line of result.bodyText.split('\\n')) {\n ctx.log.info(` ${line}`);\n }\n }\n ctx.log.info('');\n\n return { success: true };\n } catch (error) {\n ctx.log.error(`Email template preview failed: ${ErrorUtils.extractErrorMessage(error)}`);\n return { success: false };\n }\n }\n\n /**\n * Write the rendered HTML and return its path, or `null` when the write failed.\n *\n * A failed write REPORTS and does not fail the command: the preview itself succeeded, the subject\n * and text body are already on screen, and turning a successful render into a failed command\n * because a temporary directory was not writable would lose the answer the developer came for.\n */\n private async writeRenderedHtml(ctx: CommandContext, result: PreviewEmailTemplateCliResult): Promise<string | null> {\n if (!result.bodyHtml) return null;\n\n const requestedPath = typeof ctx.flags.out === 'string' && ctx.flags.out.trim().length > 0 ? ctx.flags.out.trim() : undefined;\n // Filesystem-safe, and NOT an escape: every path separator and dot in a ref collapses to `-`, so\n // a template ref can never steer the write out of the directory chosen here.\n const slug = `${result.templateRef}-${result.locale}`.replace(/[^a-zA-Z0-9-]+/g, '-');\n const path = requestedPath ?? join(tmpdir(), `wildo-email-preview-${slug}.html`);\n\n try {\n await writeFile(path, result.bodyHtml, 'utf8');\n return path;\n } catch (error) {\n ctx.log.warn(` Could not write the rendered HTML to ${path}: ${ErrorUtils.extractErrorMessage(error)}`);\n return null;\n }\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"init.command.d.ts","sourceRoot":"","sources":["../../../src/commands/init.command.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAKH,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAG7D,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAkJ1F,MAAM,CAAC,OAAO,OAAO,WAAY,SAAQ,WAAW;IAClD,QAAQ,CAAC,IAAI,EAAE,WAAW,CAwDxB;IAEI,GAAG,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,aAAa,CAAC;IA4QtD;;;;;;;;;;;;;;;;;;;OAmBG;YACW,kBAAkB;IAkChC;;;;;;;;;;;;;;;;OAgBG;YACW,qBAAqB;IAyCnC;;;;;;;;;;;;;;;;;OAiBG;YACW,4BAA4B;IAmC1C;;;;OAIG;IACH,OAAO,CAAC,aAAa;IAOrB,4EAA4E;IAC5E,OAAO,CAAC,oBAAoB;IAuC5B;;;;;;;;;;OAUG;IACH;;;;;;;;;;;;;;;OAeG;YACW,yBAAyB;IA2BvC,OAAO,CAAC,6BAA6B;CA8BtC"}
1
+ {"version":3,"file":"init.command.d.ts","sourceRoot":"","sources":["../../../src/commands/init.command.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAKH,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAG7D,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAmJ1F,MAAM,CAAC,OAAO,OAAO,WAAY,SAAQ,WAAW;IAClD,QAAQ,CAAC,IAAI,EAAE,WAAW,CAwDxB;IAEI,GAAG,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,aAAa,CAAC;IA4QtD;;;;;;;;;;;;;;;;;;;OAmBG;YACW,kBAAkB;IAkChC;;;;;;;;;;;;;;;;OAgBG;YACW,qBAAqB;IAwEnC;;;;;;;;;;;;;;;;;OAiBG;YACW,4BAA4B;IAmC1C;;;;OAIG;IACH,OAAO,CAAC,aAAa;IAOrB,4EAA4E;IAC5E,OAAO,CAAC,oBAAoB;IAuC5B;;;;;;;;;;OAUG;IACH;;;;;;;;;;;;;;;OAeG;YACW,yBAAyB;IA2BvC,OAAO,CAAC,6BAA6B;CA8BtC"}
@@ -47,6 +47,7 @@ import { EnvironmentUtils } from '../services/environment/environment.service.js
47
47
  import { SetupStatus } from '../services/environment/environment.schemas.js';
48
48
  import { SecretsProvisioning, SecretsProvisioningStatus, } from '../services/credentials/secrets-provisioning.service.js';
49
49
  import { platformAdminUserModule, resolveAdminUserFromEnvSeeds, } from '../modules/domain/credentials/admin-user.module.js';
50
+ import { resolveApproverIdentity } from '../modules/domain/credentials/approver-user.module.js';
50
51
  import { WildoCliInitAdminEnvKeys } from '../services/credentials/credentials.schemas.js';
51
52
  import { ApplicationAssetsDeliveryService, ApplicationAssetsLaneStatus } from '../services/application/application-assets-delivery.service.js';
52
53
  const MINIMUM_VERSIONS = {
@@ -506,6 +507,27 @@ export default class InitCommand extends BaseCommand {
506
507
  catch (error) {
507
508
  return { outcome: null, blockedReason: ErrorUtils.extractErrorMessage(error) };
508
509
  }
510
+ /*
511
+ * The SECOND administrator, minted in the same breath as the first (#575).
512
+ *
513
+ * `applicationAccessGrantApproverIsDistinct` refuses an approver who is the requester and
514
+ * refuses an absent one, and the application-scoped grant has no auto-approval branch — so a
515
+ * platform provisioned with one administrator cannot read any application-wide surface at all.
516
+ * Provisioning one and leaving the second to a runbook is what makes that control unusable in
517
+ * practice, so both are created here or neither is.
518
+ *
519
+ * `isLocalEnvironment: true` is a STATEMENT, not an inference: this function creates the app's
520
+ * `local` secrets and nothing else (`envName` above is `WildoLocationType.LOCAL`). It is what
521
+ * licenses the sub-addressed derivation, and it is the only thing that does — a remote
522
+ * environment reaching `resolveApproverIdentity` without the seeds is refused.
523
+ */
524
+ let approver;
525
+ try {
526
+ approver = resolveApproverIdentity({ admin, isLocalEnvironment: true, log: ctx.log }).approver;
527
+ }
528
+ catch (error) {
529
+ return { outcome: null, blockedReason: ErrorUtils.extractErrorMessage(error) };
530
+ }
509
531
  const outcome = SecretsProvisioning.ensureForEnvironment(envName, {
510
532
  createWith: {
511
533
  admin: {
@@ -517,6 +539,16 @@ export default class InitCommand extends BaseCommand {
517
539
  // the "who minted this?" answer in a single registry.
518
540
  ...(admin.password ? { password: admin.password } : {}),
519
541
  },
542
+ approver: {
543
+ email: approver.email,
544
+ firstName: approver.firstName,
545
+ lastName: approver.lastName,
546
+ // Same omission rule, and it is what makes "the same password as the administrator" true
547
+ // rather than approximately true: when the operator typed none, BOTH are left for the
548
+ // framework-managed materials to mint, and the APPROVER_PASSWORD material copies the
549
+ // administrator's rather than generating a second one.
550
+ ...(approver.password ? { password: approver.password } : {}),
551
+ },
520
552
  },
521
553
  });
522
554
  // Mark the environment set up. This is not cosmetic: `runEnvSetup` treats a non-COMPLETED