@aifabrix/builder 2.52.0 → 2.53.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (310) hide show
  1. package/lib/api/datasources-extended.api.js +8 -8
  2. package/lib/api/keycloak.api.js +92 -0
  3. package/lib/api/token-providers.api.js +77 -0
  4. package/lib/api/types/keycloak.types.js +23 -0
  5. package/lib/api/types/token-providers.types.js +65 -0
  6. package/lib/app/deploy-config.js +3 -2
  7. package/lib/app/down.js +16 -1
  8. package/lib/channels/add-channel.js +134 -57
  9. package/lib/channels/approval-guides/chatgpt.js +1 -1
  10. package/lib/channels/approval-guides/index.js +3 -0
  11. package/lib/channels/approval-guides/microsoft-copilot.js +27 -14
  12. package/lib/channels/channel-add-ensure.js +128 -0
  13. package/lib/channels/channel-add-existing.js +72 -0
  14. package/lib/channels/channel-artifact-generator.js +11 -1
  15. package/lib/channels/channel-branding.js +94 -0
  16. package/lib/channels/channel-credential.js +8 -0
  17. package/lib/channels/channel-discovery.js +330 -0
  18. package/lib/channels/channel-external-system.js +1 -1
  19. package/lib/channels/channel-runtime-resolver.js +107 -14
  20. package/lib/channels/channel-status-display.js +36 -3
  21. package/lib/channels/microsoft-copilot-channel-add.js +138 -0
  22. package/lib/channels/microsoft-copilot-entra-sso-form.js +251 -0
  23. package/lib/channels/microsoft-copilot-entra-sso.js +285 -0
  24. package/lib/channels/microsoft-copilot-icons.js +74 -0
  25. package/lib/channels/microsoft-copilot-limits.js +103 -0
  26. package/lib/channels/microsoft-copilot-package.js +178 -52
  27. package/lib/channels/microsoft-copilot-validate.js +227 -0
  28. package/lib/cli/attach-default-help-examples.js +102 -0
  29. package/lib/cli/index.js +4 -0
  30. package/lib/cli/infra-guided.js +13 -6
  31. package/lib/cli/setup-credential-deployment.js +7 -5
  32. package/lib/cli/setup-infra.js +31 -4
  33. package/lib/cli/setup-utility-validate.js +1 -0
  34. package/lib/commands/channel-add-setup.js +28 -9
  35. package/lib/commands/channel.js +14 -10
  36. package/lib/commands/credential-push.js +37 -5
  37. package/lib/commands/integration-definition.js +158 -0
  38. package/lib/commands/package-score.js +72 -0
  39. package/lib/commands/repair-auth-apply.js +19 -5
  40. package/lib/commands/repair-datasource-sync-operations.js +4 -1
  41. package/lib/commands/role-assistant-test-output.js +200 -0
  42. package/lib/commands/role-assistant.js +163 -166
  43. package/lib/datasource/capability/capability-resolve.js +15 -5
  44. package/lib/datasource/capability/copy-operations.js +14 -4
  45. package/lib/deployment/deployer-poll-run.js +2 -2
  46. package/lib/deployment/deployer.js +1 -1
  47. package/lib/deployment/environment.js +2 -2
  48. package/lib/external-system/deploy.js +11 -21
  49. package/lib/infrastructure/index.js +19 -4
  50. package/lib/integration-definition/apply.js +476 -0
  51. package/lib/integration-definition/canonical-json.js +51 -0
  52. package/lib/integration-definition/emit-suite-bid.js +94 -0
  53. package/lib/integration-definition/enrich-crm-field-mappings.js +240 -0
  54. package/lib/integration-definition/enrich-openapi-operations.js +433 -0
  55. package/lib/integration-definition/from-discovery.js +339 -0
  56. package/lib/integration-definition/hash.js +37 -0
  57. package/lib/integration-definition/index.js +37 -0
  58. package/lib/integration-definition/resource-type-catalog.js +59 -0
  59. package/lib/integration-definition/system-kind-enum.js +40 -0
  60. package/lib/integration-definition/validate.js +148 -0
  61. package/lib/lab/package-parity-score.js +417 -0
  62. package/lib/programmatic/builder-api-request.js +5 -1
  63. package/lib/programmatic/builder-help-governance.js +3 -2
  64. package/lib/programmatic/capability-registry.js +20 -0
  65. package/lib/programmatic/help-content/channel-onboarding.md +35 -0
  66. package/lib/programmatic/help-content/cip-overview.md +27 -0
  67. package/lib/programmatic/help-content/connected-system-ui.md +70 -0
  68. package/lib/programmatic/help-content/dimensions-guide.md +23 -0
  69. package/lib/programmatic/help-content/enterprise-sync-fabrix.md +123 -0
  70. package/lib/programmatic/help-content/overview.md +25 -0
  71. package/lib/programmatic/help-content/subscription-guide.md +27 -0
  72. package/lib/programmatic/help-content/workflow.md +50 -0
  73. package/lib/programmatic/openapi-component-schemas.js +7 -1
  74. package/lib/programmatic/openapi-descriptions.js +46 -0
  75. package/lib/programmatic/openapi-envelope-examples.js +280 -0
  76. package/lib/programmatic/openapi-operation-bindings.js +50 -0
  77. package/lib/programmatic/openapi-request-schemas.js +40 -0
  78. package/lib/programmatic/openapi-result-schemas-overflow.js +101 -0
  79. package/lib/programmatic/openapi-result-schemas.js +76 -99
  80. package/lib/programmatic/openapi-schema-descriptions-core.js +25 -4
  81. package/lib/programmatic/openapi-schema-descriptions-help.js +1 -1
  82. package/lib/programmatic/openapi-schema-descriptions-operations.js +43 -0
  83. package/lib/programmatic/openapi-schema-helpers.js +9 -9
  84. package/lib/programmatic/openapi-spec.js +11 -1
  85. package/lib/programmatic/orchestration-openapi-meta.js +10 -0
  86. package/lib/programmatic/persist-supplied-openapi.js +180 -0
  87. package/lib/programmatic/route-handler-map.js +35 -1
  88. package/lib/programmatic/run-channel-package.js +236 -0
  89. package/lib/programmatic/run-integration-definition.js +77 -0
  90. package/lib/role-assistant/evidence-sync.js +55 -7
  91. package/lib/role-assistant/knowledge-sync-logging.js +58 -0
  92. package/lib/role-assistant/knowledge-sync.js +88 -93
  93. package/lib/role-assistant/test-cases-bid.js +155 -0
  94. package/lib/role-assistant/test-cases-evaluate.js +9 -1
  95. package/lib/role-assistant/test-cases-honesty.js +24 -10
  96. package/lib/role-assistant/test-cases.js +28 -0
  97. package/lib/role-assistant/test-runner-attachments.js +118 -0
  98. package/lib/role-assistant/test-runner-bid-apply.js +201 -0
  99. package/lib/role-assistant/test-runner-bid-document.js +278 -0
  100. package/lib/role-assistant/test-runner-start-payload.js +96 -0
  101. package/lib/role-assistant/test-runner-workhub-answers.js +249 -20
  102. package/lib/role-assistant/test-runner-workhub-helpers.js +100 -0
  103. package/lib/role-assistant/test-runner-workhub-soft.js +86 -0
  104. package/lib/role-assistant/test-runner-workhub.js +152 -107
  105. package/lib/role-assistant/test-runner.js +5 -63
  106. package/lib/role-assistant/test-suite.js +112 -0
  107. package/lib/schema/application-schema.json +56 -6
  108. package/lib/schema/external-datasource.schema.json +103 -17
  109. package/lib/schema/external-system.schema.json +54 -3
  110. package/lib/schema/integration-definition.schema.json +195 -0
  111. package/lib/utils/authentication-shape.js +6 -0
  112. package/lib/utils/compose-generator.js +10 -1
  113. package/lib/utils/compose-traefik-extra-routes.js +107 -0
  114. package/lib/utils/docker-build.js +2 -2
  115. package/lib/utils/help-builder.js +3 -1
  116. package/lib/utils/promote-dev-docker-image.js +102 -18
  117. package/lib/utils/transient-developer-id.js +28 -0
  118. package/package.json +14 -16
  119. package/templates/README.md +12 -1
  120. package/templates/applications/dataplane/application.yaml +10 -2
  121. package/templates/applications/dataplane/env.template +7 -6
  122. package/templates/applications/miso-controller/application.yaml +23 -8
  123. package/templates/applications/miso-controller/env.template +8 -2
  124. package/templates/applications/miso-controller/rbac.yaml +1 -0
  125. package/templates/channels/README.md +11 -1
  126. package/templates/channels/brand/color-192.png +0 -0
  127. package/templates/channels/brand/dark/128.png +0 -0
  128. package/templates/channels/brand/dark/192.png +0 -0
  129. package/templates/channels/brand/dark/256.png +0 -0
  130. package/templates/channels/brand/dark/32.png +0 -0
  131. package/templates/channels/brand/dark/512.png +0 -0
  132. package/templates/channels/brand/dark/64.png +0 -0
  133. package/templates/channels/brand/light/128.png +0 -0
  134. package/templates/channels/brand/light/192.png +0 -0
  135. package/templates/channels/brand/light/256.png +0 -0
  136. package/templates/channels/brand/light/32.png +0 -0
  137. package/templates/channels/brand/light/512.png +0 -0
  138. package/templates/channels/brand/light/64.png +0 -0
  139. package/templates/channels/brand/mono-white/128.png +0 -0
  140. package/templates/channels/brand/mono-white/192.png +0 -0
  141. package/templates/channels/brand/mono-white/256.png +0 -0
  142. package/templates/channels/brand/mono-white/32.png +0 -0
  143. package/templates/channels/brand/mono-white/512.png +0 -0
  144. package/templates/channels/brand/mono-white/64.png +0 -0
  145. package/templates/channels/brand/outline-32.png +0 -0
  146. package/templates/channels/chatgpt/install.template.md.hbs +6 -4
  147. package/templates/channels/chatgpt/integration/README.md +4 -5
  148. package/templates/channels/chatgpt/integration/chatgpt-system.json +1 -16
  149. package/templates/channels/microsoft-copilot/ai-plugin.template.json.hbs +14 -16
  150. package/templates/channels/microsoft-copilot/declarative-agent.template.json.hbs +5 -3
  151. package/templates/channels/microsoft-copilot/entra-sso-registration.template.md.hbs +30 -0
  152. package/templates/channels/microsoft-copilot/fi-fi.template.json.hbs +7 -0
  153. package/templates/channels/microsoft-copilot/install.template.md.hbs +93 -22
  154. package/templates/channels/microsoft-copilot/integration/README.md +2 -3
  155. package/templates/channels/microsoft-copilot/integration/microsoft-copilot-system.json +1 -22
  156. package/templates/channels/microsoft-copilot/manifest.template.json.hbs +34 -19
  157. package/templates/channels/microsoft-copilot/oauth-plugin-vault-required.template.md.hbs +15 -0
  158. package/templates/channels/slack/integration/README.md +2 -4
  159. package/templates/channels/teams-bot/install.template.md.hbs +4 -0
  160. package/templates/channels/teams-bot/integration/README.md +3 -5
  161. package/templates/channels/web-embed/integration/web-embed-system.json +1 -16
  162. package/templates/python/docker-compose.hbs +36 -0
  163. package/templates/typescript/docker-compose.hbs +36 -0
  164. package/.cursor/plans/Done/157.1-security-quality-violations-by-type.csv +0 -374
  165. package/.cursor/process/README.md +0 -9
  166. package/.cursor/rules/anchor-docs.mdc +0 -15
  167. package/.cursor/rules/assistant-driven-integration-build.mdc +0 -40
  168. package/.cursor/rules/cli-layout.mdc +0 -81
  169. package/.cursor/rules/cli-product-neutral.mdc +0 -43
  170. package/.cursor/rules/deploy-rules/docker-image-ip-policy.mdc +0 -49
  171. package/.cursor/rules/docs-rules.mdc +0 -32
  172. package/.cursor/rules/plan-rules/application-lifecycle.mdc +0 -30
  173. package/.cursor/rules/plan-rules/plan-frontmatter.mdc +0 -35
  174. package/.cursor/rules/plan-rules/plan-lifecycle.mdc +0 -31
  175. package/.cursor/rules/plan-rules/plan-validation-gate.mdc +0 -34
  176. package/.cursor/rules/project-rules.mdc +0 -913
  177. package/.cursor/skills/README.md +0 -15
  178. package/.dockerignore +0 -52
  179. package/.eslintignore +0 -22
  180. package/.markdownlint.json +0 -14
  181. package/anchor-docs/README.md +0 -10
  182. package/anchor-docs/_TEMPLATE +0 -24
  183. package/babel.config.js +0 -6
  184. package/bin/builder-api-cleanup.js +0 -26
  185. package/bin/builder-api-nest.js +0 -10
  186. package/bin/builder-api-spike.js +0 -19
  187. package/enterprise-knowledge/README.md +0 -50
  188. package/enterprise-knowledge/enterprise-integration-lifecycle/README.md +0 -22
  189. package/enterprise-knowledge/enterprise-integration-lifecycle/application.json +0 -15
  190. package/enterprise-knowledge/enterprise-integration-lifecycle/deploy.js +0 -69
  191. package/enterprise-knowledge/enterprise-integration-lifecycle/enterprise-integration-lifecycle-deploy.json +0 -52
  192. package/enterprise-knowledge/enterprise-integration-lifecycle/enterprise-integration-lifecycle-system.json +0 -29
  193. package/enterprise-knowledge/enterprise-integration-lifecycle/env.template +0 -2
  194. package/integration/README.md +0 -81
  195. package/integration/github/README.md +0 -53
  196. package/integration/github/application.json +0 -21
  197. package/integration/github/deploy.js +0 -72
  198. package/integration/github/env.template +0 -11
  199. package/integration/github/github-datasource-issue-comments.json +0 -239
  200. package/integration/github/github-datasource-issues.json +0 -399
  201. package/integration/github/github-datasource-repository.json +0 -354
  202. package/integration/github/github-deploy.json +0 -1202
  203. package/integration/github/github-system.json +0 -82
  204. package/integration/hubspot-test/README.md +0 -159
  205. package/integration/hubspot-test/application.json +0 -54
  206. package/integration/hubspot-test/companies.json +0 -2048
  207. package/integration/hubspot-test/create-hubspot.js +0 -523
  208. package/integration/hubspot-test/env.template +0 -4
  209. package/integration/hubspot-test/hubspot-test-datasource-company.json +0 -138
  210. package/integration/hubspot-test/hubspot-test-datasource-contact.json +0 -146
  211. package/integration/hubspot-test/hubspot-test-datasource-deal.json +0 -146
  212. package/integration/hubspot-test/hubspot-test-datasource-users.json +0 -76
  213. package/integration/hubspot-test/hubspot-test-deploy.json +0 -2160
  214. package/integration/hubspot-test/hubspot-test-system.json +0 -74
  215. package/integration/hubspot-test/rbac.json +0 -166
  216. package/integration/hubspot-test/test-artifacts/wizard-hubspot-credential-real.yaml +0 -20
  217. package/integration/hubspot-test/test-artifacts/wizard-hubspot-env-vars.yaml +0 -9
  218. package/integration/hubspot-test/test-artifacts/wizard-invalid-add-datasource.yaml +0 -5
  219. package/integration/hubspot-test/test-artifacts/wizard-invalid-app-name.yaml +0 -5
  220. package/integration/hubspot-test/test-artifacts/wizard-invalid-credential-create.yaml +0 -7
  221. package/integration/hubspot-test/test-artifacts/wizard-invalid-credential-select.yaml +0 -7
  222. package/integration/hubspot-test/test-artifacts/wizard-invalid-known-platform.yaml +0 -4
  223. package/integration/hubspot-test/test-artifacts/wizard-invalid-missing-app.yaml +0 -4
  224. package/integration/hubspot-test/test-artifacts/wizard-invalid-missing-source.yaml +0 -2
  225. package/integration/hubspot-test/test-artifacts/wizard-invalid-mode.yaml +0 -5
  226. package/integration/hubspot-test/test-artifacts/wizard-invalid-openapi-file.yaml +0 -5
  227. package/integration/hubspot-test/test-artifacts/wizard-invalid-openapi-url.yaml +0 -4
  228. package/integration/hubspot-test/test-artifacts/wizard-invalid-source.yaml +0 -4
  229. package/integration/hubspot-test/test-artifacts/wizard-valid-for-dimension-array-test.yaml +0 -5
  230. package/integration/hubspot-test/test-artifacts/wizard-valid-for-dimension-key-test.yaml +0 -5
  231. package/integration/hubspot-test/test-artifacts/wizard-valid-for-dimension-path-test.yaml +0 -5
  232. package/integration/hubspot-test/test-artifacts/wizard-valid-for-dimension-test.yaml +0 -5
  233. package/integration/hubspot-test/test-artifacts/wizard-valid-for-rbac-test.yaml +0 -5
  234. package/integration/hubspot-test/test-artifacts/wizard-valid-for-rbac-yaml-test.yaml +0 -5
  235. package/integration/hubspot-test/test-dataplane-down-helpers.js +0 -249
  236. package/integration/hubspot-test/test-dataplane-down-tests.js +0 -386
  237. package/integration/hubspot-test/test-dataplane-down.js +0 -209
  238. package/integration/hubspot-test/test.js +0 -1588
  239. package/integration/hubspot-test/wizard-hubspot-e2e.yaml +0 -16
  240. package/integration/hubspot-test/wizard-hubspot-platform.yaml +0 -8
  241. package/integration/hubspot-test/wizard-hubspot-test-headless.yaml +0 -23
  242. package/integration/roundtrip-test-local/README.md +0 -143
  243. package/integration/roundtrip-test-local/application.yaml +0 -13
  244. package/integration/roundtrip-test-local/env.template +0 -15
  245. package/integration/roundtrip-test-local/roundtrip-test-local-datasource-roundtrip-test-company.yaml +0 -14
  246. package/integration/roundtrip-test-local/roundtrip-test-local-deploy.json +0 -61
  247. package/integration/roundtrip-test-local/roundtrip-test-local-system.yaml +0 -25
  248. package/integration/roundtrip-test-local2/README.md +0 -143
  249. package/integration/roundtrip-test-local2/application.yaml +0 -13
  250. package/integration/roundtrip-test-local2/env.template +0 -15
  251. package/integration/roundtrip-test-local2/roundtrip-test-local2-datasource-company.yaml +0 -31
  252. package/integration/roundtrip-test-local2/roundtrip-test-local2-deploy.json +0 -86
  253. package/integration/roundtrip-test-local2/roundtrip-test-local2-system.yaml +0 -25
  254. package/integration/test/wizard.yaml +0 -8
  255. package/jest.config.coverage.js +0 -37
  256. package/jest.config.default.js +0 -11
  257. package/jest.config.integration.fixtures.js +0 -22
  258. package/jest.config.integration.js +0 -33
  259. package/jest.config.isolated.js +0 -11
  260. package/jest.config.manual.js +0 -30
  261. package/jest.global-live-fabrix-hooks.js +0 -36
  262. package/jest.isolated-projects.js +0 -260
  263. package/jest.projects.js +0 -76
  264. package/packages/builder-api/README.md +0 -120
  265. package/packages/builder-api/package.json +0 -30
  266. package/packages/builder-api/src/app.module.ts +0 -7
  267. package/packages/builder-api/src/auth/auth.module.ts +0 -5
  268. package/packages/builder-api/src/external-system/external-system.module.ts +0 -5
  269. package/packages/builder-api/src/main.ts +0 -16
  270. package/packages/builder-api/tsconfig.json +0 -15
  271. package/scripts/check-builder-api-architecture-grep.js +0 -79
  272. package/scripts/check-datasource-test-run-schema-sync.js +0 -34
  273. package/scripts/ci-fix.sh +0 -19
  274. package/scripts/ci-simulate.sh +0 -19
  275. package/scripts/diagnose-cli.js +0 -150
  276. package/scripts/docker_image_content_gate.js +0 -47
  277. package/scripts/docker_image_content_gate.sh +0 -5
  278. package/scripts/export-builder-api-evidence.js +0 -262
  279. package/scripts/install-local.js +0 -490
  280. package/scripts/lib/builder-api-docker-staging-copy.js +0 -60
  281. package/scripts/lib/builder-api-docker-staging-core.js +0 -183
  282. package/scripts/lib/docker-image-content-gate-core.js +0 -166
  283. package/scripts/lib/plan-actor.js +0 -109
  284. package/scripts/lib/plan-config.js +0 -20
  285. package/scripts/lib/plan-gates.js +0 -154
  286. package/scripts/lib/plan-meta.js +0 -104
  287. package/scripts/lib/plan-parse.js +0 -162
  288. package/scripts/lib/plan-prevalidate-gates.js +0 -337
  289. package/scripts/lib/plan-run-core.js +0 -125
  290. package/scripts/lib/plan-run-report.js +0 -119
  291. package/scripts/plan-approve.js +0 -24
  292. package/scripts/plan-archive.js +0 -49
  293. package/scripts/plan-run.js +0 -13
  294. package/scripts/plan-set-actor.js +0 -21
  295. package/scripts/plan-validate.js +0 -80
  296. package/scripts/pnpm/af.mjs +0 -110
  297. package/scripts/pnpm/check-quiet.mjs +0 -32
  298. package/scripts/pnpm/dev-install.mjs +0 -29
  299. package/scripts/pnpm/dev-reload.mjs +0 -18
  300. package/scripts/pnpm/help.mjs +0 -55
  301. package/scripts/pnpm/lib/dev-reload-core.mjs +0 -189
  302. package/scripts/pnpm/lib/dev-reload-log-capture.mjs +0 -67
  303. package/scripts/pnpm/lib/dev-reload-log-utils.mjs +0 -32
  304. package/scripts/pnpm/lib/resolve-aifabrix-bin.mjs +0 -124
  305. package/scripts/pnpm/lib/resolve-app-url.mjs +0 -183
  306. package/scripts/pnpm/lib/spinner.mjs +0 -42
  307. package/scripts/pnpm-global-remove.js +0 -48
  308. package/scripts/stage_builder_api_for_docker.js +0 -65
  309. package/scripts/sync-builder-api-template.js +0 -44
  310. package/scripts/test-dataplane-bootstrap.js +0 -331
@@ -1,37 +0,0 @@
1
- /**
2
- * Jest Configuration for Coverage Reports
3
- * Extends base config with coverage settings
4
- */
5
-
6
- const baseConfig = require('./jest.config');
7
-
8
- module.exports = {
9
- ...baseConfig,
10
- collectCoverageFrom: [
11
- 'lib/**/*.js',
12
- 'bin/**/*.js',
13
- '!**/node_modules/**',
14
- '!**/tests/**',
15
- '!lib/infra.js',
16
- '!bin/aifabrix.js'
17
- ],
18
- coverageDirectory: 'coverage',
19
- coverageReporters: [
20
- 'text',
21
- 'lcov',
22
- 'html'
23
- ],
24
- coverageProvider: 'v8',
25
- coverageThreshold: {
26
- global: {
27
- branches: 80,
28
- functions: 80,
29
- lines: 80,
30
- statements: 80
31
- }
32
- },
33
- // Memory management for coverage runs
34
- maxWorkers: 2,
35
- workerIdleMemoryLimit: '500MB'
36
- };
37
-
@@ -1,11 +0,0 @@
1
- /**
2
- * Default test project only (no isolated suites). Used by test-wrapper pass 1.
3
- * @fileoverview
4
- */
5
-
6
- const { defaultProject, globalLiveFabrixHooks } = require('./jest.projects');
7
-
8
- module.exports = {
9
- ...globalLiveFabrixHooks,
10
- projects: [defaultProject]
11
- };
@@ -1,22 +0,0 @@
1
- /**
2
- * Integration tests that do not build images or talk to Docker.
3
- * Use: npm run test:integration:fixtures
4
- *
5
- * Full Docker lifecycle tests: npm run test:integration (includes steps/ + workflow).
6
- *
7
- * @fileoverview Fixture-only integration Jest config
8
- */
9
-
10
- const { sharedTransform } = require('./jest.projects');
11
-
12
- module.exports = {
13
- displayName: 'integration-fixtures',
14
- testEnvironment: 'node',
15
- transform: sharedTransform,
16
- testMatch: ['**/tests/integration/hubspot/**/*.test.js'],
17
- testPathIgnorePatterns: ['/node_modules/', '\\\\node_modules\\\\'],
18
- maxWorkers: 1,
19
- setupFiles: ['<rootDir>/tests/capture-real-fs.js'],
20
- setupFilesAfterEnv: ['<rootDir>/tests/setup.js'],
21
- testTimeout: 60000
22
- };
@@ -1,33 +0,0 @@
1
- /**
2
- * Jest configuration for integration tests under tests/integration/ only.
3
- *
4
- * IMPORTANT: Do not spread ./jest.config.js here — that config sets `projects` (default +
5
- * isolated suites). Spreading it caused `test:integration` to run the entire multi-project
6
- * suite in one process, leaking mocks/module state between projects and producing flaky
7
- * failures. This file defines a single project matching docs/plans for npm run test:integration.
8
- *
9
- * @fileoverview Full integration Jest config: HubSpot fixtures, workflow shim, and
10
- * tests/integration/steps/* (real Docker: create, build, run, health).
11
- * For fixture-only tests without Docker, use jest.config.integration.fixtures.js
12
- * (npm run test:integration:fixtures).
13
- * @author AI Fabrix Team
14
- * @version 2.0.0
15
- */
16
-
17
- const { sharedTransform } = require('./jest.projects');
18
-
19
- module.exports = {
20
- displayName: 'integration',
21
- testEnvironment: 'node',
22
- transform: sharedTransform,
23
- testMatch: ['**/tests/integration/**/*.test.js'],
24
- testPathIgnorePatterns: ['/node_modules/', '\\\\node_modules\\\\'],
25
- testSequencer: '<rootDir>/tests/integration/test-sequencer.js',
26
- testTimeout: 300000,
27
- maxWorkers: 1,
28
- setupFiles: ['<rootDir>/tests/capture-real-fs.js'],
29
- setupFilesAfterEnv: [
30
- '<rootDir>/tests/setup.js',
31
- '<rootDir>/tests/integration/jest-restore-integration-timeout.js'
32
- ]
33
- };
@@ -1,11 +0,0 @@
1
- /**
2
- * Isolated test projects only. Used by test-wrapper pass 2 (fresh Node process).
3
- * @fileoverview
4
- */
5
-
6
- const { isolatedProjects, globalLiveFabrixHooks } = require('./jest.projects');
7
-
8
- module.exports = {
9
- ...globalLiveFabrixHooks,
10
- projects: isolatedProjects
11
- };
@@ -1,30 +0,0 @@
1
- /**
2
- * Jest Configuration for Manual Tests (real API calls)
3
- * Runs only tests/manual; requires user to be logged in (validated before run).
4
- *
5
- * @fileoverview Jest config for manual tests that call real Controller/Dataplane APIs
6
- * @author AI Fabrix Team
7
- * @version 2.0.0
8
- */
9
-
10
- const baseProject = require('./jest.config').projects[0];
11
-
12
- module.exports = {
13
- // Top-level so Jest actually applies it (project-level testTimeout is ignored in some Jest versions)
14
- testTimeout: 60000,
15
- projects: [
16
- {
17
- ...baseProject,
18
- displayName: 'manual',
19
- testMatch: [
20
- '**/tests/manual/**/*.test.js'
21
- ],
22
- testPathIgnorePatterns: [
23
- '/node_modules/',
24
- '\\\\node_modules\\\\'
25
- ],
26
- setupFilesAfterEnv: ['<rootDir>/tests/manual/setup.js'],
27
- maxWorkers: 1
28
- }
29
- ]
30
- };
@@ -1,36 +0,0 @@
1
- /**
2
- * Global Jest hooks and CI guard project for live ~/.aifabrix protection.
3
- * @fileoverview
4
- */
5
-
6
- /** Once per Jest process — protects live ~/.aifabrix (incl. /workspace/.aifabrix). */
7
- const globalLiveFabrixHooks = {
8
- globalSetup: '<rootDir>/tests/global-live-fabrix-backup.js',
9
- globalTeardown: '<rootDir>/tests/global-live-fabrix-backup.js'
10
- };
11
-
12
- /**
13
- * @param {object} opts - CI flag and Babel transform config from jest.projects.js
14
- * @param {boolean} opts.isCI - Whether CI or CI simulation is active
15
- * @param {object} opts.sharedTransform - Shared babel-jest transform map
16
- * @returns {object} Jest project configuration
17
- */
18
- function createSetupCiLiveFabrixGuardProject({ isCI, sharedTransform }) {
19
- return {
20
- displayName: 'setup-ci-live-fabrix-guard',
21
- testEnvironment: 'node',
22
- transform: sharedTransform,
23
- testMatch: ['**/tests/setup-ci-live-fabrix-guard.test.js'],
24
- testPathIgnorePatterns: ['/node_modules/', '\\\\node_modules\\\\'],
25
- setupFiles: ['<rootDir>/tests/capture-real-fs.js', '<rootDir>/tests/setup-ci-env.js'],
26
- setupFilesAfterEnv: ['<rootDir>/tests/setup.js'],
27
- testTimeout: isCI ? 15000 : 8000,
28
- maxWorkers: 1,
29
- ...globalLiveFabrixHooks
30
- };
31
- }
32
-
33
- module.exports = {
34
- globalLiveFabrixHooks,
35
- createSetupCiLiveFabrixGuardProject
36
- };
@@ -1,260 +0,0 @@
1
- /**
2
- * Jest isolated project list (separate process per suite when run via jest.config.isolated.js).
3
- * @fileoverview
4
- */
5
-
6
- 'use strict';
7
-
8
- const { createSetupCiLiveFabrixGuardProject } = require('./jest.global-live-fabrix-hooks');
9
-
10
- /** @type {[string, string[]][]} displayName and testMatch globs */
11
- const ISOLATED_SUITE_ENTRIES = [
12
- ['cli-utils', ['**/tests/lib/utils/cli-utils.test.js']],
13
- ['external-system-display', ['**/tests/lib/utils/external-system-display.test.js']],
14
- ['dev-hosts-helper', ['**/tests/lib/utils/dev-hosts-helper.test.js']],
15
- ['parameters-validate', ['**/tests/lib/commands/parameters-validate.test.js']],
16
- ['test-e2e-external', ['**/tests/lib/commands/test-e2e-external.test.js']],
17
- ['repair-openapi-sync', ['**/tests/lib/commands/repair-openapi-sync.test.js']],
18
- ['paths-app-listing', ['**/tests/lib/utils/paths-app-listing.test.js']],
19
- ['app-path-resolve', ['**/tests/lib/app-path-resolve.test.js']],
20
- ['paths-system-builder-resolution', ['**/tests/lib/utils/paths-system-builder-resolution.test.js']],
21
- ['manifest-location', ['**/tests/lib/utils/manifest-location.test.js']],
22
- ['installation-log', ['**/tests/lib/utils/installation-log.test.js']],
23
- ['secrets-ancestor-paths', ['**/tests/lib/utils/secrets-ancestor-paths.test.js']],
24
- ['datasource-validation-watch', ['**/tests/lib/utils/datasource-validation-watch.test.js']],
25
- [
26
- 'log-viewer',
27
- [
28
- '**/tests/lib/datasource/log-viewer.test.js',
29
- '**/tests/lib/datasource/log-viewer-structural.test.js',
30
- '**/tests/lib/datasource/log-viewer-run.test.js'
31
- ]
32
- ],
33
- ['audit-evidence-extract', ['**/tests/lib/datasource/audit-evidence-extract.test.js']],
34
- ['manifest-source-emit', ['**/tests/lib/utils/manifest-source-emit.test.js']],
35
- ['register-aifabrix-shell-env', ['**/tests/lib/utils/register-aifabrix-shell-env.test.js']],
36
- ['datasource-test-run-schema-sync', ['**/tests/lib/utils/datasource-test-run-schema-sync.test.js']],
37
- ['infra-platform-contract', ['**/tests/lib/parameters/infra-platform-contract.test.js']],
38
- [
39
- 'application-frontdoor-paths-contract',
40
- ['**/tests/lib/templates/application-frontdoor-paths.contract.test.js']
41
- ],
42
- [
43
- 'dataplane-env-template-contract',
44
- ['**/tests/lib/templates/dataplane-env-template.contract.test.js']
45
- ],
46
- ['database-secret-values', ['**/tests/lib/parameters/database-secret-values.test.js']],
47
- ['infra-parameter-validate', ['**/tests/lib/parameters/infra-parameter-validate.test.js']],
48
- [
49
- 'infra-parameter-catalog',
50
- [
51
- '**/tests/lib/parameters/infra-parameter-catalog.test.js',
52
- '**/tests/lib/utils/platform-kv-ref.test.js'
53
- ]
54
- ],
55
- ['urls-local-registry', ['**/tests/lib/utils/urls-local-registry.test.js']],
56
- ['compose-local-data-mount', ['**/tests/lib/utils/compose-local-data-mount.test.js']],
57
- ['repair-capability-openapi-warnings', ['**/tests/lib/commands/repair-capability-openapi-warnings.test.js']],
58
- ['enterprise-knowledge-paths', ['**/tests/lib/enterprise-knowledge-paths.test.js']],
59
- [
60
- 'download-helpers-destination',
61
- ['**/tests/lib/external-system/download-helpers-destination.test.js']
62
- ],
63
- [
64
- 'external-manifest-digital-worker-openapi',
65
- ['**/tests/lib/validation/external-manifest-digital-worker-openapi.test.js']
66
- ],
67
- ['role-assistant-knowledge-sync', ['**/tests/lib/role-assistant/knowledge-sync.test.js']],
68
- ['role-assistant-evidence-sync', ['**/tests/lib/role-assistant/evidence-sync.test.js']],
69
- ['role-assistant-test-cases', ['**/tests/lib/role-assistant/test-cases.test.js']],
70
- ['governance-fixture-subjects', ['**/tests/lib/commands/governance-fixture-subjects.test.js']],
71
- ['enterprise-knowledge-generate-manifest', ['**/tests/lib/commands/enterprise-knowledge-generate-manifest.test.js']],
72
- ['plan-prevalidate-gates', ['**/tests/lib/plan-prevalidate-gates.test.js']],
73
- ['aifabrix-runtime-config-dir', ['**/tests/lib/utils/aifabrix-runtime-config-dir.test.js']],
74
- ['platform-env-template-kv-catalog', ['**/tests/lib/parameters/platform-env-template-kv-catalog.test.js']],
75
- ['resolve-infra-state-paths', ['**/tests/lib/infrastructure/resolve-infra-state-paths.test.js']],
76
- ['dev-ssh-config-helper', ['**/tests/lib/utils/dev-ssh-config-helper.test.js']],
77
- ['ssh-key-helper', ['**/tests/lib/utils/ssh-key-helper.test.js']],
78
- ['secrets-ensure-catalog-fallback', ['**/tests/lib/core/secrets-ensure-catalog-fallback.test.js']],
79
- ['secrets-ensure', ['**/tests/lib/core/secrets-ensure.test.js']],
80
- ['url-declarative-vdir-inactive-env', ['**/tests/lib/utils/url-declarative-vdir-inactive-env.test.js']],
81
- ['url-declarative-resolve-load-doc', ['**/tests/lib/utils/url-declarative-resolve-load-doc.test.js']],
82
- ['compose-celery-worker', ['**/tests/lib/utils/compose-celery-worker.test.js']],
83
- [
84
- 'url-declarative-user-cfg-per-app-proxy',
85
- ['**/tests/lib/utils/url-declarative-user-cfg-per-app-proxy.test.js']
86
- ],
87
- [
88
- 'declarative-url-paths-spy-suites',
89
- [
90
- '**/tests/lib/utils/url-declarative-expand-traefik-off-no-usercfg.test.js',
91
- '**/tests/lib/core/secrets-env-declarative-show-urls.test.js',
92
- '**/tests/lib/utils/url-declarative-registry-internal-docker-origin.test.js'
93
- ]
94
- ],
95
- ['platform-urls-registry-validation', ['**/tests/lib/commands/platform-urls-registry.validation.test.js']],
96
- ['env-copy-resolve-output', ['**/tests/lib/utils/env-copy-resolve-output.test.js']],
97
- ['write-env-output-reload', ['**/tests/lib/utils/write-env-output-reload.test.js']],
98
- ['app-service-env-from-builder', ['**/tests/lib/utils/app-service-env-from-builder.test.js']],
99
- ['infra-kv-discovery', ['**/tests/lib/parameters/infra-kv-discovery.test.js']],
100
- ['infra-env-defaults', ['**/tests/lib/utils/infra-env-defaults.test.js']],
101
- ['compose-traefik-template', ['**/tests/lib/infrastructure/compose-traefik-template.test.js']],
102
- ['traefik-tls-dynamic', ['**/tests/lib/infrastructure/traefik-tls-dynamic.test.js']],
103
- ['generator-external-rbac', ['**/tests/lib/generator/generator-external-rbac.test.js']],
104
- ['helpers-ensure-admin-secrets', ['**/tests/lib/infrastructure/helpers-ensure-admin-secrets.test.js']],
105
- ['secrets-generator', ['**/tests/lib/utils/secrets-generator.test.js']],
106
- ['ensure-dev-certs-for-remote-docker', ['**/tests/lib/utils/ensure-dev-certs-for-remote-docker.test.js']],
107
- ['generator-error-paths', ['**/tests/lib/generator/generator-error-paths.test.js']],
108
- ['generator-validation', ['**/tests/lib/generator/generator-validation.test.js']],
109
- ['secrets-databaselog', ['**/tests/lib/core/secrets-databaselog.test.js']],
110
- ['schema-241-alignment', ['**/tests/lib/validation/schema-241-alignment.test.js']],
111
- ['miso-controller-npm-sdk-guard', ['**/tests/lib/build/miso-controller-npm-sdk-guard.test.js']],
112
- ['hubspot-e2e-com-v2', ['**/tests/lib/validation/hubspot-e2e-com-v2.test.js']],
113
- ['runtime-configuration-download', ['**/tests/lib/utils/runtime-configuration-download.test.js']],
114
- ['schema-resolver-order', ['**/tests/lib/utils/schema-resolver-order.test.js']],
115
- ['app-module', ['**/tests/lib/app/app.test.js']],
116
- ['admin-secrets', ['**/tests/lib/core/admin-secrets.test.js']],
117
- ['validate-datasource-parsed', ['**/tests/lib/datasource/validate-datasource-parsed.test.js']],
118
- [
119
- 'capability-run-real-fs',
120
- [
121
- '**/tests/lib/datasource/run-capability-copy.test.js',
122
- '**/tests/lib/datasource/run-capability-diff.test.js',
123
- '**/tests/lib/datasource/run-capability-edit.test.js',
124
- '**/tests/lib/datasource/run-capability-remove.test.js'
125
- ]
126
- ],
127
- ['log-cleaner', ['**/tests/lib/datasource/log-cleaner.test.js']],
128
- ['datasource-exporter-service', ['**/tests/lib/datasource/datasource-exporter-service.test.js']],
129
- ['protection-paths', ['**/tests/lib/protection/paths.test.js']],
130
- ['protection-resolve', ['**/tests/lib/protection/protection-resolve.test.js']],
131
- ['protection-create-helpers', ['**/tests/lib/protection/run-protection-create-helpers.test.js']],
132
- [
133
- 'governance-pack-loader',
134
- [
135
- '**/tests/lib/governance/governance-pack-loader.test.js',
136
- '**/tests/lib/lifecycle/scenario-upload.test.js'
137
- ]
138
- ],
139
- [
140
- 'governance-generate-external',
141
- ['**/tests/lib/commands/governance-generate-external.test.js']
142
- ],
143
- ['protection-validate-batch', ['**/tests/lib/protection/validate-batch.test.js']],
144
- ['aifabrix-runtime-sandbox', ['**/tests/helpers/aifabrix-runtime-sandbox.test.js']],
145
- ['aifabrix-runtime-backup', ['**/tests/helpers/aifabrix-runtime-backup.test.js']],
146
- ['paths-jest-sandbox-integration', ['**/tests/lib/utils/paths-jest-sandbox-integration.test.js']],
147
- ['secrets-remove-all-guard', ['**/tests/lib/commands/secrets-remove-all-guard.test.js']],
148
- ['app-logs', ['**/tests/lib/commands/app-logs.test.js']],
149
- ['app-down', ['**/tests/lib/app/app-down.test.js']],
150
- [
151
- 'channel-real-fs',
152
- [
153
- '**/tests/lib/channels/channel-integration-generator.test.js',
154
- '**/tests/lib/channels/channel-artifact-generator.test.js',
155
- '**/tests/lib/channels/channel-integration-template.test.js'
156
- ]
157
- ],
158
- [
159
- 'builder-api-real-fs',
160
- [
161
- '**/tests/lib/programmatic/**/*.test.js',
162
- '**/tests/packages/builder-api/e2e.test.js',
163
- '**/tests/lib/commands/manifest-cli-integration-path.test.js',
164
- '**/tests/lib/commands/manifest-cli-commands.test.js',
165
- '**/tests/lib/commands/repair-datasource-operation-security.test.js',
166
- '**/tests/lib/commands/repair-orchestration-datasource-split.test.js',
167
- '**/tests/lib/commands/repair-openapi-export.test.js',
168
- '**/tests/lib/commands/repair-rbac-platform-preset.test.js',
169
- '**/tests/packages/builder-api/e2e-workspace-lock.test.js',
170
- '**/tests/lib/utils/paths-reload-source.test.js',
171
- '**/tests/lib/platform-integrations-manifest.test.js',
172
- '**/tests/lib/generator/deploy-script.test.js',
173
- '**/tests/lib/commands/repair-deploy-script.test.js',
174
- '**/tests/scripts/stage_builder_api_for_docker.test.js',
175
- '**/tests/lib/scripts/sync-builder-api-template.test.js',
176
- '**/tests/lib/evidence/evidence-service.test.js'
177
- ]
178
- ]
179
- ];
180
-
181
- /** Extra globs excluded from the default project (isolated outside ISOLATED_SUITE_ENTRIES). */
182
- const EXTRA_DEFAULT_IGNORE_GLOBS = ['**/tests/setup-ci-live-fabrix-guard.test.js'];
183
-
184
- /**
185
- * Build Jest `testPathIgnorePatterns` for one isolated testMatch glob.
186
- * @param {string} glob - Glob such as star-star/tests/.../file.test.js
187
- * @returns {string[]} Ignore pattern variants for default project
188
- */
189
- function ignorePatternsForTestGlob(glob) {
190
- const posix = String(glob || '').replace(/^\*\*\//, '');
191
- if (!posix) {
192
- return [];
193
- }
194
- // Multi-file / directory globs: ignore the directory prefix only (Jest regex-safe).
195
- if (posix.includes('*')) {
196
- const dirPath = posix.split('/**')[0].split('*')[0].replace(/\/$/, '');
197
- if (!dirPath) {
198
- return [];
199
- }
200
- const winDir = dirPath.replace(/\//g, '\\\\');
201
- return ['/' + dirPath + '/', '\\\\' + winDir + '\\\\'];
202
- }
203
- const win = posix.replace(/\//g, '\\\\');
204
- const withoutTestsPrefix = posix.replace(/^tests\//, '');
205
- const baseName = posix.split('/').pop().replace(/\./g, '\\.');
206
- const patterns = ['/' + posix, '\\\\' + win, baseName];
207
- if (withoutTestsPrefix !== posix) {
208
- patterns.push(withoutTestsPrefix);
209
- }
210
- return patterns;
211
- }
212
-
213
- /**
214
- * Default-project ignore list derived from isolated suite globs (SSOT).
215
- * @param {boolean} [includeLocalTests] - When true, keep tests/local in default project
216
- * @returns {string[]} Jest testPathIgnorePatterns for the default project
217
- */
218
- function buildDefaultTestPathIgnorePatterns(includeLocalTests) {
219
- const includeLocal = includeLocalTests === true
220
- || (includeLocalTests === undefined && process.env.INCLUDE_LOCAL_TESTS === 'true');
221
- const patterns = [
222
- '/node_modules/',
223
- '\\\\node_modules\\\\',
224
- '/tests/integration/',
225
- '\\\\tests\\\\integration\\\\',
226
- '/tests/manual/',
227
- '\\\\tests\\\\manual\\\\'
228
- ];
229
- const globs = [
230
- ...ISOLATED_SUITE_ENTRIES.flatMap((entry) => entry[1]),
231
- ...EXTRA_DEFAULT_IGNORE_GLOBS
232
- ];
233
- for (const glob of globs) {
234
- patterns.push(...ignorePatternsForTestGlob(glob));
235
- }
236
- if (!includeLocal) {
237
- patterns.push('/tests/local/', '\\\\tests\\\\local\\\\');
238
- }
239
- return patterns;
240
- }
241
-
242
- /**
243
- * @param {Function} makeIsolatedProject - Factory from jest.projects.js
244
- * @param {boolean} isCI - True when CI or CI_SIMULATION is set
245
- * @param {object} sharedTransform - Babel-jest transform shared with default project
246
- * @returns {object[]} Jest multi-project entries
247
- */
248
- function buildIsolatedProjects(makeIsolatedProject, isCI, sharedTransform) {
249
- const projects = ISOLATED_SUITE_ENTRIES.map(([name, testMatch]) =>
250
- makeIsolatedProject(name, testMatch)
251
- );
252
- projects.push(createSetupCiLiveFabrixGuardProject({ isCI, sharedTransform }));
253
- return projects;
254
- }
255
-
256
- module.exports = {
257
- buildIsolatedProjects,
258
- buildDefaultTestPathIgnorePatterns,
259
- ISOLATED_SUITE_ENTRIES
260
- };
package/jest.projects.js DELETED
@@ -1,76 +0,0 @@
1
- /**
2
- * Shared Jest project definitions (default + isolated). Split configs run in separate processes
3
- * so `jest.mock('fs')` in the default suite cannot leak into isolated workers.
4
- * @fileoverview
5
- */
6
-
7
- const { globalLiveFabrixHooks } = require('./jest.global-live-fabrix-hooks');
8
- const {
9
- buildIsolatedProjects,
10
- buildDefaultTestPathIgnorePatterns
11
- } = require('./jest.isolated-projects');
12
-
13
- // Detect CI environment (GitHub Actions, CI simulation, etc.)
14
- const isCI = process.env.CI === 'true' || process.env.CI_SIMULATION === 'true';
15
-
16
- const sharedTransform = {
17
- '^.+\\.js$': ['babel-jest', {
18
- configFile: false,
19
- babelrc: false,
20
- presets: [['@babel/preset-env', { targets: { node: 'current' } }]],
21
- plugins: ['@babel/plugin-syntax-optional-chaining']
22
- }]
23
- };
24
-
25
- /**
26
- * Single-file Jest project (fresh module graph when run in a separate process).
27
- * @param {string} displayName - Jest project display name
28
- * @param {string[]} testMatch - Glob patterns for test files
29
- * @returns {object} Jest project configuration object
30
- */
31
- function makeIsolatedProject(displayName, testMatch) {
32
- return {
33
- displayName,
34
- testEnvironment: 'node',
35
- transform: sharedTransform,
36
- testMatch,
37
- testPathIgnorePatterns: ['/node_modules/', '\\\\node_modules\\\\'],
38
- setupFiles: ['<rootDir>/tests/capture-real-fs.js'],
39
- setupFilesAfterEnv: ['<rootDir>/tests/setup.js'],
40
- testTimeout: isCI ? 15000 : 8000,
41
- maxWorkers: 1
42
- };
43
- }
44
-
45
- const defaultProject = {
46
- displayName: 'default',
47
- testEnvironment: 'node',
48
- transform: sharedTransform,
49
- testMatch: [
50
- '**/tests/**/*.test.js',
51
- '**/tests/**/*.spec.js'
52
- ],
53
- testPathIgnorePatterns: buildDefaultTestPathIgnorePatterns(),
54
- modulePathIgnorePatterns: [
55
- '<rootDir>/docker-builder-api-staging/'
56
- ],
57
- setupFiles: ['<rootDir>/tests/capture-real-fs.js'],
58
- setupFilesAfterEnv: ['<rootDir>/tests/setup.js'],
59
- testTimeout: isCI ? 15000 : 8000,
60
- detectOpenHandles: true,
61
- maxWorkers: 1
62
- };
63
-
64
- const isolatedProjects = buildIsolatedProjects(makeIsolatedProject, isCI, sharedTransform);
65
-
66
- const allProjects = [defaultProject, ...isolatedProjects];
67
-
68
- module.exports = {
69
- isCI,
70
- sharedTransform,
71
- makeIsolatedProject,
72
- defaultProject,
73
- isolatedProjects,
74
- allProjects,
75
- globalLiveFabrixHooks
76
- };
@@ -1,120 +0,0 @@
1
- # @aifabrix/builder-api (154.0)
2
-
3
- HTTP orchestration layer for external-system workspace lifecycle. V1 uses the shared
4
- `lib/programmatic/` adapter over existing Builder CLI libraries (no duplicate facades).
5
-
6
- ## Run with Builder CLI (recommended)
7
-
8
- From the **aifabrix-builder** repository root:
9
-
10
- ```bash
11
- # From aifabrix-builder repo root
12
- aifabrix auth status
13
- aifabrix up-platform # full stack (includes builder-api)
14
- # or incremental when miso + dataplane already run:
15
- aifabrix up-builder-api
16
- aifabrix resolve builder-api # refresh .env from env.template
17
- aifabrix run builder-api --reload
18
- ```
19
-
20
- Hot reload (bind-mount repo root, same pattern as dataplane / miso-controller):
21
-
22
- ```bash
23
- pnpm run dev-reload
24
- # or: aifabrix run builder-api --reload
25
- ```
26
-
27
- Logs, stop, and lifecycle match other Builder-managed apps:
28
-
29
- ```bash
30
- aifabrix logs builder-api
31
- aifabrix down-app builder-api
32
- ```
33
-
34
- Health (adjust port for your `developer-id`): `GET http://localhost:3105/api/v1/builder/health` (dev 1 → `3005 + 100`).
35
-
36
- ReDoc (same as dataplane / miso-controller): `GET http://localhost:3105/api/docs`
37
- OpenAPI JSON: `GET /api/v1/builder/api-docs/openapi.json`
38
-
39
- Platform integration SSOT lives under `integration/` in the builder repo. Publish Enterprise MCP anchor and repository provider integrations before workspace flows:
40
-
41
- ```bash
42
- aifabrix upload enterprise-integration-lifecycle --probe
43
- aifabrix upload <repository-provider-systemKey> --probe
44
- pnpm run dev-reload # builder-api container
45
- ```
46
-
47
- See `integration/README.md` in the builder repo.
48
-
49
- ## Run on host (development / tests only)
50
-
51
- For Jest e2e and quick iteration without Docker, resolve from `builder/builder-api/env.template` (uses `url://` tokens like miso-controller/dataplane) or set localhost URLs manually:
52
-
53
- ```bash
54
- aifabrix resolve builder-api # preferred — expands url://miso-controller-internal, url://dataplane-internal, url://keycloak-*
55
-
56
- # or manual host overrides:
57
- export WORKSPACE_ROOT=/tmp/builder-workspaces
58
- export MISO_CLIENTID=miso-controller-dev-builder-api
59
- export MISO_CLIENTSECRET=<from aifabrix app register builder-api>
60
- export MISO_CONTROLLER_URL=http://localhost:3100/miso
61
- export DATAPLANE_URL=http://localhost:3101/data
62
- export DEFAULT_ENVIRONMENT=dev
63
-
64
- pnpm run dev
65
- # or Nest bootstrap: npm run builder-api:nest
66
- ```
67
-
68
- ## Workspace cleanup
69
-
70
- Scheduled purge of stale draft workspaces (env `WORKSPACE_DRAFT_TTL_DAYS`, `WORKSPACE_INACTIVE_MAX_DAYS`):
71
-
72
- ```bash
73
- npm run builder-api:cleanup
74
- npm run builder-api:cleanup -- --dry-run
75
- ```
76
-
77
- In Docker, schedule via platform cron or sidecar invoking `node bin/builder-api-cleanup.js`.
78
-
79
- ## Package layout
80
-
81
- ```text
82
- builder/builder-api/ # SSOT (edit here; npm run sync-json → template)
83
- templates/applications/builder-api/ # Shipped template copy
84
- packages/builder-api/
85
- src/main.ts # Nest bootstrap → nest-http-bridge
86
- src/app.module.ts
87
- MANUAL-CHECKLIST.md
88
- lib/programmatic/ # Shared HTTP handlers + Enterprise MCP client
89
- ```
90
-
91
- Compile TypeScript: `npm run builder-api:build` (output in `packages/builder-api/dist/`).
92
-
93
- ## 154.1 routes (Enterprise MCP client)
94
-
95
- Provider-neutral HTTP orchestration — remote repository/template via Dataplane Enterprise MCP:
96
-
97
- - `POST /systems/{systemKey}/template/materialize`
98
- - `GET /systems/{systemKey}/workspace/status`
99
- - `POST /systems/{systemKey}/workspace/diff` / `workspace/reset`
100
- - `POST /systems/{systemKey}/repository/sync` / `create-review` / `dispatch-pipeline`
101
- - `GET /systems/{systemKey}/repository/status`
102
-
103
- Governance gates use existing Dataplane lifecycle / verify-trust APIs (no can-execute proxy in builder-api V1).
104
-
105
- Architecture CI: `npm run check:builder-api-arch`
106
-
107
- All other routes require `Authorization: Bearer <token from aifabrix login>`.
108
-
109
- See `MANUAL-CHECKLIST.md` for manual verification, `docs/external-systems.md` and `docs/wizard.md` for integration workflow context.
110
-
111
- ## Nest migration
112
-
113
- This package currently reuses the Node HTTP server in `lib/programmatic/builder-api-server.js`.
114
- NestJS scaffold wraps the same `route-handlers` module via `nest-http-bridge.js`.
115
-
116
- ## Not builder-server
117
-
118
- This service is **not** the dev onboarding `builder-server`. It is stateless multi-user workspace
119
- orchestration with Dataplane as governance authority. Do **not** use ad hoc `docker compose` under
120
- `packages/builder-api/` — use `aifabrix run builder-api` for the full application lifecycle.