@aifabrix/builder 2.53.1 → 2.54.1

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 (321) hide show
  1. package/bin/aifabrix.js +2 -2
  2. package/lib/api/assistants.api.js +8 -5
  3. package/lib/api/channel-identity.api.js +41 -0
  4. package/lib/api/evidence-authoring.api.js +5 -1
  5. package/lib/api/evidence.api.js +2 -0
  6. package/lib/api/types/evidence.types.js +2 -0
  7. package/lib/api/work-search.api.js +136 -0
  8. package/lib/channels/add-channel.js +163 -126
  9. package/lib/channels/approval-guides/chatgpt.js +14 -18
  10. package/lib/channels/approval-guides/claude.js +29 -0
  11. package/lib/channels/approval-guides/index.js +88 -22
  12. package/lib/channels/approval-guides/mcp-client.js +27 -0
  13. package/lib/channels/approval-guides/microsoft-copilot.js +52 -3
  14. package/lib/channels/approval-guides/slack.js +10 -10
  15. package/lib/channels/approval-guides/teams-bot.js +8 -12
  16. package/lib/channels/channel-add-continuations.js +91 -0
  17. package/lib/channels/channel-add-ensure.js +124 -27
  18. package/lib/channels/channel-add-existing.js +160 -28
  19. package/lib/channels/channel-add-failure.js +60 -0
  20. package/lib/channels/channel-add-remaining.js +486 -0
  21. package/lib/channels/channel-add-tty.js +190 -0
  22. package/lib/channels/channel-add-wizard-config.js +138 -0
  23. package/lib/channels/channel-add-wizard.js +250 -0
  24. package/lib/channels/channel-artifact-generator.js +27 -13
  25. package/lib/channels/channel-cardinality.js +83 -0
  26. package/lib/channels/channel-catalog-icon.js +45 -0
  27. package/lib/channels/channel-cli-instructions.js +75 -0
  28. package/lib/channels/channel-configuration-map.js +213 -0
  29. package/lib/channels/channel-credential.js +11 -14
  30. package/lib/channels/channel-definition-project.js +101 -0
  31. package/lib/channels/channel-definition-registry.js +154 -0
  32. package/lib/channels/channel-description.js +59 -2
  33. package/lib/channels/channel-discovery.js +16 -2
  34. package/lib/channels/channel-external-system.js +86 -9
  35. package/lib/channels/channel-install-envelope-actions.js +88 -0
  36. package/lib/channels/channel-install-envelope-microsoft.js +155 -0
  37. package/lib/channels/channel-install-envelope.js +356 -0
  38. package/lib/channels/channel-install-help-md.js +172 -0
  39. package/lib/channels/channel-install-http-payload.js +62 -0
  40. package/lib/channels/channel-install-inventory.js +115 -0
  41. package/lib/channels/channel-install-profiles.js +90 -0
  42. package/lib/channels/channel-instance-collision.js +118 -0
  43. package/lib/channels/channel-instance-key.js +100 -0
  44. package/lib/channels/channel-instance-materialize.js +240 -0
  45. package/lib/channels/channel-integration-generator.js +16 -9
  46. package/lib/channels/channel-integration-template.js +101 -22
  47. package/lib/channels/channel-inventory-fetch.js +79 -0
  48. package/lib/channels/channel-oauth-preflight.js +104 -0
  49. package/lib/channels/channel-package-version.js +76 -0
  50. package/lib/channels/channel-predefined-client.js +154 -0
  51. package/lib/channels/channel-probe.js +7 -2
  52. package/lib/channels/channel-runtime-resolver.js +180 -72
  53. package/lib/channels/channel-status-display.js +86 -16
  54. package/lib/channels/channel-targets.js +106 -92
  55. package/lib/channels/chatgpt-callback.js +318 -0
  56. package/lib/channels/chatgpt-channel-add.js +229 -0
  57. package/lib/channels/chatgpt-preflight.js +396 -0
  58. package/lib/channels/chatgpt-runtime-contract.js +17 -0
  59. package/lib/channels/chatgpt-setup-values.js +124 -0
  60. package/lib/channels/claude-callback.js +67 -0
  61. package/lib/channels/claude-channel-add.js +254 -0
  62. package/lib/channels/claude-runtime-contract.js +40 -0
  63. package/lib/channels/claude-runtime.js +58 -0
  64. package/lib/channels/claude-setup-values.js +89 -0
  65. package/lib/channels/mcp-client/config-merge.js +148 -0
  66. package/lib/channels/mcp-client/ensure-client.js +231 -0
  67. package/lib/channels/mcp-client/paths.js +53 -0
  68. package/lib/channels/mcp-client/profiles.js +122 -0
  69. package/lib/channels/mcp-client/redirect-uris.js +99 -0
  70. package/lib/channels/mcp-client/runtime.js +59 -0
  71. package/lib/channels/mcp-client-channel-add.js +186 -0
  72. package/lib/channels/microsoft-copilot-channel-add.js +117 -7
  73. package/lib/channels/microsoft-copilot-entra-identifier-uris.js +187 -0
  74. package/lib/channels/microsoft-copilot-entra-sso-form.js +106 -18
  75. package/lib/channels/microsoft-copilot-entra-sso.js +31 -2
  76. package/lib/channels/microsoft-copilot-package-prior.js +107 -0
  77. package/lib/channels/microsoft-copilot-package.js +29 -28
  78. package/lib/channels/microsoft-provisioning/a365.js +80 -0
  79. package/lib/channels/microsoft-provisioning/auth-config.js +240 -0
  80. package/lib/channels/microsoft-provisioning/auth.js +179 -0
  81. package/lib/channels/microsoft-provisioning/cli.js +71 -0
  82. package/lib/channels/microsoft-provisioning/constants.js +75 -0
  83. package/lib/channels/microsoft-provisioning/errors.js +117 -0
  84. package/lib/channels/microsoft-provisioning/index.js +55 -0
  85. package/lib/channels/microsoft-provisioning/install-atk.js +158 -0
  86. package/lib/channels/microsoft-provisioning/install-teams.js +115 -0
  87. package/lib/channels/microsoft-provisioning/login-portal-device.js +236 -0
  88. package/lib/channels/microsoft-provisioning/login-portal-parse.js +71 -0
  89. package/lib/channels/microsoft-provisioning/login-portal-teams.js +193 -0
  90. package/lib/channels/microsoft-provisioning/login-portal.js +230 -0
  91. package/lib/channels/microsoft-provisioning/persist.js +110 -0
  92. package/lib/channels/microsoft-provisioning/teams-bot-args.js +119 -0
  93. package/lib/channels/microsoft-provisioning/teams-bot-controller.js +123 -0
  94. package/lib/channels/microsoft-provisioning/teams-bot-parse.js +134 -0
  95. package/lib/channels/microsoft-provisioning/teams-bot-persist.js +113 -0
  96. package/lib/channels/microsoft-provisioning/teams-bot-provision.js +234 -0
  97. package/lib/channels/microsoft-provisioning/teams-bot-secrets.js +45 -0
  98. package/lib/channels/microsoft-provisioning/teams-cli.js +82 -0
  99. package/lib/channels/runtime-tool-catalog.js +5 -2
  100. package/lib/channels/slack-channel-add-portal.js +130 -0
  101. package/lib/channels/slack-channel-add-tty-auth.js +95 -0
  102. package/lib/channels/slack-channel-add.js +258 -0
  103. package/lib/channels/slack-provisioning/apps.js +181 -0
  104. package/lib/channels/slack-provisioning/auth-store.js +110 -0
  105. package/lib/channels/slack-provisioning/auth-ticket.js +185 -0
  106. package/lib/channels/slack-provisioning/auth.js +115 -0
  107. package/lib/channels/slack-provisioning/callbacks.js +41 -0
  108. package/lib/channels/slack-provisioning/cli.js +226 -0
  109. package/lib/channels/slack-provisioning/constants.js +37 -0
  110. package/lib/channels/slack-provisioning/credentials.js +169 -0
  111. package/lib/channels/slack-provisioning/curl-shim.js +132 -0
  112. package/lib/channels/slack-provisioning/developer-install.js +118 -0
  113. package/lib/channels/slack-provisioning/env-file.js +120 -0
  114. package/lib/channels/slack-provisioning/errors.js +47 -0
  115. package/lib/channels/slack-provisioning/go-ca-bundle.js +137 -0
  116. package/lib/channels/slack-provisioning/index.js +250 -0
  117. package/lib/channels/slack-provisioning/install-cli.js +323 -0
  118. package/lib/channels/slack-provisioning/manifest.js +89 -0
  119. package/lib/channels/slack-provisioning/oauth-lock.js +33 -0
  120. package/lib/channels/slack-provisioning/offer-cli.js +113 -0
  121. package/lib/channels/slack-provisioning/onboard-members.js +122 -0
  122. package/lib/channels/slack-provisioning/onboard.js +89 -0
  123. package/lib/channels/slack-provisioning/persist.js +95 -0
  124. package/lib/channels/slack-provisioning/remaining-urls.js +158 -0
  125. package/lib/channels/slack-provisioning/with-curl-on-path.js +48 -0
  126. package/lib/channels/teams-bot-channel-add.js +94 -0
  127. package/lib/channels/vendor-dataplane-url.js +249 -0
  128. package/lib/cli/setup-certification.help.js +2 -0
  129. package/lib/cli/setup-external-system-help.js +2 -0
  130. package/lib/cli/setup-external-system.js +1 -1
  131. package/lib/commands/channel-add-help.js +366 -0
  132. package/lib/commands/channel-add-setup.js +162 -80
  133. package/lib/commands/channel-configure.js +118 -0
  134. package/lib/commands/channel.js +10 -1
  135. package/lib/commands/governance-upload-external.js +6 -3
  136. package/lib/commands/lifecycle-command-action.js +2 -5
  137. package/lib/commands/lifecycle-external.js +93 -21
  138. package/lib/commands/repair-datasource-test-payload.js +4 -2
  139. package/lib/commands/repair-datasource-webhooks-sync-bridge.js +23 -2
  140. package/lib/commands/repair-datasource.js +3 -0
  141. package/lib/commands/repair-external-run.js +59 -25
  142. package/lib/commands/repair-openapi-rest-runtime.js +127 -0
  143. package/lib/commands/repair-orchestration-tag-merge.js +339 -0
  144. package/lib/commands/repair-rbac-catalog-defaults.js +96 -0
  145. package/lib/commands/repair-rbac-platform-preset.js +26 -15
  146. package/lib/commands/repair-rbac-reader-roles.js +8 -21
  147. package/lib/commands/repair-rbac.js +10 -34
  148. package/lib/commands/repair-system-permissions.js +24 -22
  149. package/lib/commands/role-assistant-test-output.js +14 -0
  150. package/lib/commands/role-assistant.js +59 -21
  151. package/lib/commands/test-e2e-external.js +148 -21
  152. package/lib/commands/upload-credential-push-log.js +2 -1
  153. package/lib/commands/upload-publish-context.js +1 -1
  154. package/lib/commands/upload-role-assistant-shell.js +124 -0
  155. package/lib/commands/upload-sidecar-followups.js +6 -3
  156. package/lib/commands/upload.js +18 -3
  157. package/lib/core/secrets-docker-env.js +4 -1
  158. package/lib/core/secrets-env-content.js +17 -3
  159. package/lib/datasource/capability/capability-manifest.js +0 -3
  160. package/lib/datasource/capability/copy-test-payload.js +3 -0
  161. package/lib/external-system/deploy-helpers.js +26 -1
  162. package/lib/external-system/deploy.js +10 -6
  163. package/lib/external-system/download-helpers.js +29 -2
  164. package/lib/external-system/download-role-assistant.js +83 -4
  165. package/lib/external-system/download.js +40 -30
  166. package/lib/external-system/sync-deploy-manifest.js +3 -2
  167. package/lib/external-system/upload-identity.js +42 -0
  168. package/lib/generator/index.js +19 -15
  169. package/lib/generator/split.js +13 -2
  170. package/lib/lifecycle/role-assistant-governance.js +146 -0
  171. package/lib/lifecycle/scenario-upload.js +181 -30
  172. package/lib/programmatic/builder-api-cors.js +143 -0
  173. package/lib/programmatic/builder-api-request.js +6 -0
  174. package/lib/programmatic/builder-api-route-dispatch.js +56 -42
  175. package/lib/programmatic/builder-api-server.js +8 -1
  176. package/lib/programmatic/capability-registry.js +54 -0
  177. package/lib/programmatic/channel-install-help-resolve.js +359 -0
  178. package/lib/programmatic/channel-install-session.js +218 -0
  179. package/lib/programmatic/help-content/channel-onboarding.md +2 -0
  180. package/lib/programmatic/help-content/cip-overview.md +3 -1
  181. package/lib/programmatic/http-raw-response.js +62 -0
  182. package/lib/programmatic/openapi-channel-install-bindings.js +179 -0
  183. package/lib/programmatic/openapi-channel-install-schemas.js +286 -0
  184. package/lib/programmatic/openapi-component-schemas.js +18 -1
  185. package/lib/programmatic/openapi-description-enricher.js +3 -1
  186. package/lib/programmatic/openapi-descriptions.js +74 -3
  187. package/lib/programmatic/openapi-envelope-examples.js +117 -0
  188. package/lib/programmatic/openapi-operation-bindings.js +4 -1
  189. package/lib/programmatic/openapi-schema-descriptions-channel.js +316 -0
  190. package/lib/programmatic/openapi-spec.js +12 -8
  191. package/lib/programmatic/platform-rbac-catalog.js +36 -18
  192. package/lib/programmatic/route-handler-map.js +51 -1
  193. package/lib/programmatic/route-handlers-context.js +2 -1
  194. package/lib/programmatic/run-auth-permissions.js +54 -0
  195. package/lib/programmatic/run-channel-catalog.js +196 -0
  196. package/lib/programmatic/run-channel-install-artifacts.js +137 -0
  197. package/lib/programmatic/run-channel-install-copilot.js +353 -0
  198. package/lib/programmatic/run-channel-install-options.js +232 -0
  199. package/lib/programmatic/run-channel-install-teams-bot.js +204 -0
  200. package/lib/programmatic/run-channel-install.js +346 -0
  201. package/lib/programmatic/run-channel-package.js +87 -7
  202. package/lib/programmatic/workspace-context.js +2 -0
  203. package/lib/role-assistant/evidence-sync.js +4 -2
  204. package/lib/role-assistant/evidence-validation-issues.js +51 -0
  205. package/lib/role-assistant/knowledge-sync.js +10 -4
  206. package/lib/role-assistant/settings.js +49 -2
  207. package/lib/role-assistant/test-cases-evaluate.js +30 -2
  208. package/lib/role-assistant/test-cases-evidence.js +175 -0
  209. package/lib/role-assistant/test-cases-search.js +229 -0
  210. package/lib/role-assistant/test-cases.js +37 -4
  211. package/lib/role-assistant/test-runner-search.js +149 -0
  212. package/lib/role-assistant/test-runner-workhub-helpers.js +40 -2
  213. package/lib/role-assistant/test-runner-workhub-soft.js +9 -3
  214. package/lib/role-assistant/test-runner-workhub.js +29 -11
  215. package/lib/role-assistant/test-runner.js +16 -1
  216. package/lib/schema/external-datasource.schema.json +112 -18
  217. package/lib/schema/external-system.schema.json +159 -2
  218. package/lib/schema/mcp-client-profile.schema.json +103 -0
  219. package/lib/utils/app-path-resolve.js +4 -0
  220. package/lib/utils/authentication-env-template.js +44 -6
  221. package/lib/utils/credential-secrets-env.js +6 -1
  222. package/lib/utils/env-copy.js +19 -7
  223. package/lib/utils/external-env-template.js +20 -2
  224. package/lib/utils/paths.js +18 -1
  225. package/lib/utils/platform-shell-package.js +69 -0
  226. package/lib/utils/port-resolver.js +50 -1
  227. package/lib/utils/rewrite-name-flag.js +20 -0
  228. package/lib/utils/role-assistant-paths.js +13 -10
  229. package/lib/utils/schema-resolver.js +11 -1
  230. package/lib/utils/secrets-helpers.js +12 -21
  231. package/lib/utils/token-manager.js +10 -5
  232. package/lib/validation/validate.js +40 -0
  233. package/package.json +1 -1
  234. package/templates/README.md +1 -1
  235. package/templates/applications/builder-api/Dockerfile +1 -1
  236. package/templates/applications/builder-api/env.template +7 -0
  237. package/templates/applications/dataplane/application.yaml +6 -5
  238. package/templates/applications/dataplane/env.template +2 -2
  239. package/templates/applications/dataplane/rbac.yaml +7 -2
  240. package/templates/applications/keycloak/Dockerfile +30 -4
  241. package/templates/applications/keycloak/application.yaml +2 -2
  242. package/templates/applications/keycloak/cimd-lenient-parse/AbstractClientIdMetadataDocumentExecutor.java +896 -0
  243. package/templates/applications/keycloak/cimd-lenient-parse/SOURCE.md +19 -0
  244. package/templates/applications/keycloak/env.template +3 -0
  245. package/templates/applications/miso-controller/application.yaml +1 -2
  246. package/templates/applications/miso-controller/env.template +2 -0
  247. package/templates/channels/README.md +5 -5
  248. package/templates/channels/chatgpt/TROUBLESHOOTING.md +51 -0
  249. package/templates/channels/chatgpt/channel.json +59 -0
  250. package/templates/channels/chatgpt/icon.svg +1 -0
  251. package/templates/channels/chatgpt/install.template.md.hbs +20 -95
  252. package/templates/channels/chatgpt/integration/README.md +1 -1
  253. package/templates/channels/chatgpt/integration/application.json +2 -2
  254. package/templates/channels/chatgpt/integration/chatgpt-system.json +49 -4
  255. package/templates/channels/chatgpt/integration/env.template +2 -4
  256. package/templates/channels/chatgpt/integration/rbac.json +13 -0
  257. package/templates/channels/claude/TROUBLESHOOTING.md +41 -0
  258. package/templates/channels/claude/channel.json +59 -0
  259. package/templates/channels/claude/icon.svg +1 -0
  260. package/templates/channels/claude/install.template.md.hbs +21 -0
  261. package/templates/channels/claude/integration/README.md +14 -0
  262. package/templates/channels/claude/integration/application.json +15 -0
  263. package/templates/channels/claude/integration/claude-system.json +59 -0
  264. package/templates/channels/claude/integration/env.template +2 -0
  265. package/templates/channels/claude/integration/rbac.json +13 -0
  266. package/templates/channels/claude/manifest.template.json.hbs +40 -0
  267. package/templates/channels/mcp-client/channel.json +72 -0
  268. package/templates/channels/mcp-client/icon.svg +1 -0
  269. package/templates/channels/mcp-client/install.template.md.hbs +24 -0
  270. package/templates/channels/mcp-client/integration/README.md +13 -0
  271. package/templates/channels/mcp-client/integration/application.json +15 -0
  272. package/templates/channels/mcp-client/integration/env.template +2 -0
  273. package/templates/channels/mcp-client/integration/mcp-client-system.json +72 -0
  274. package/templates/channels/mcp-client/integration/rbac.json +13 -0
  275. package/templates/channels/mcp-client/manifest.template.json.hbs +41 -0
  276. package/templates/channels/mcp-client/profiles/cursor.json +26 -0
  277. package/templates/channels/mcp-client/profiles/github-copilot.json +29 -0
  278. package/templates/channels/mcp-client/profiles/vscode.json +29 -0
  279. package/templates/channels/microsoft-copilot/channel.json +73 -0
  280. package/templates/channels/microsoft-copilot/declarative-agent.template.json.hbs +8 -4
  281. package/templates/channels/microsoft-copilot/entra-sso-registration.template.md.hbs +65 -5
  282. package/templates/channels/microsoft-copilot/icon.svg +1 -0
  283. package/templates/channels/microsoft-copilot/install.template.md.hbs +9 -9
  284. package/templates/channels/microsoft-copilot/integration/README.md +1 -1
  285. package/templates/channels/microsoft-copilot/integration/application.json +2 -2
  286. package/templates/channels/microsoft-copilot/integration/env.template +3 -6
  287. package/templates/channels/microsoft-copilot/integration/microsoft-copilot-system.json +63 -4
  288. package/templates/channels/microsoft-copilot/integration/rbac.json +13 -0
  289. package/templates/channels/microsoft-copilot/oauth-plugin-vault-required.template.md.hbs +5 -5
  290. package/templates/channels/slack/channel.json +223 -0
  291. package/templates/channels/slack/icon.svg +1 -0
  292. package/templates/channels/slack/install.template.md.hbs +36 -28
  293. package/templates/channels/slack/integration/README.md +245 -22
  294. package/templates/channels/slack/integration/application.json +44 -7
  295. package/templates/channels/slack/integration/env.template +15 -6
  296. package/templates/channels/slack/integration/openapi/openapi.json +126 -0
  297. package/templates/channels/slack/integration/rbac.json +84 -0
  298. package/templates/channels/slack/integration/slack-datasource-commands.json +154 -0
  299. package/templates/channels/slack/integration/slack-datasource-conversations.json +28 -3
  300. package/templates/channels/slack/integration/slack-datasource-events.json +154 -0
  301. package/templates/channels/slack/integration/slack-datasource-interactive.json +154 -0
  302. package/templates/channels/slack/integration/slack-datasource-messages.json +40 -2
  303. package/templates/channels/slack/integration/slack-system.json +155 -77
  304. package/templates/channels/slack/manifest.template.json.hbs +5 -2
  305. package/templates/channels/teams-bot/channel.json +161 -0
  306. package/templates/channels/teams-bot/icon.svg +1 -0
  307. package/templates/channels/teams-bot/install.template.md.hbs +12 -13
  308. package/templates/channels/teams-bot/integration/README.md +5 -4
  309. package/templates/channels/teams-bot/integration/application.json +6 -4
  310. package/templates/channels/teams-bot/integration/env.template +5 -4
  311. package/templates/channels/teams-bot/integration/openapi/openapi.json +68 -0
  312. package/templates/channels/teams-bot/integration/rbac.json +21 -0
  313. package/templates/channels/teams-bot/integration/teams-bot-datasource-activities.json +154 -0
  314. package/templates/channels/teams-bot/integration/teams-bot-system.json +128 -23
  315. package/templates/channels/web-embed/channel.json +60 -0
  316. package/templates/channels/web-embed/install.template.md.hbs +1 -1
  317. package/templates/channels/web-embed/integration/README.md +2 -2
  318. package/templates/channels/web-embed/integration/application.json +2 -2
  319. package/templates/channels/web-embed/integration/env.template +1 -1
  320. package/templates/channels/web-embed/integration/rbac.json +13 -0
  321. package/templates/channels/web-embed/integration/web-embed-system.json +50 -4
@@ -9,9 +9,15 @@
9
9
  'use strict';
10
10
 
11
11
  const path = require('path');
12
- const { getChannelTarget, getDefaultChannelDescription } = require('./channel-targets');
12
+ const {
13
+ assertChannelTargetInstallable,
14
+ getDefaultChannelDescription
15
+ } = require('./channel-targets');
16
+ const { deriveChannelInstanceKey } = require('./channel-instance-key');
13
17
  const { resolveAppDescription } = require('./channel-description');
14
18
  const { resolveChannelRuntimeValues } = require('./channel-runtime-resolver');
19
+ const { vendorFacingUrlsFromCtx } = require('./vendor-dataplane-url');
20
+ const { applySlackPackageVersion } = require('./channel-package-version');
15
21
  const { generateChannelArtifact } = require('./channel-artifact-generator');
16
22
  const { fetchRuntimeLayerBToolNames } = require('./runtime-tool-catalog');
17
23
  const { loadChannelPackageContext } = require('./channel-discovery');
@@ -36,21 +42,30 @@ const { runChannelProbe } = require('./channel-probe');
36
42
  const { resolveChannelAuthContext } = require('./channel-auth-context');
37
43
  const { ensureChannelCredential } = require('./channel-credential');
38
44
  const {
39
- buildChannelApprovalGuide,
45
+ buildLiveInstallApprovalGuide,
40
46
  resolveApprovalPortalUrl
41
47
  } = require('./channel-approval-guide');
42
48
  const {
43
49
  normalizeBaseChannelName,
44
50
  resolveChannelDisplayName
45
51
  } = require('./channel-display-name');
46
- const { displayChannelInstallResult } = require('./channel-status-display');
52
+ const { printLiveChannelCanonicalTty } = require('./channel-add-remaining');
47
53
  const { ensureChannelReadyForAdd } = require('./channel-add-ensure');
48
- const { showExistingChannelStatus } = require('./channel-add-existing');
54
+ const { liveInstallTtyCtx, showExistingChannelStatus, shouldReturnSkippedChannel } = require('./channel-add-existing');
49
55
  const {
50
56
  assertMicrosoftCopilotOauthReference,
51
57
  assertMicrosoftCopilotOauthReferenceBeforeForce,
52
58
  loadMicrosoftCopilotEntraContext
53
59
  } = require('./microsoft-copilot-channel-add');
60
+ const {
61
+ maybeAssertMcpClientProfile
62
+ } = require('./mcp-client-channel-add');
63
+ const {
64
+ runChannelAddPreflights,
65
+ runChannelAddContinuations
66
+ } = require('./channel-add-continuations');
67
+ const { maybeProvisionSlackChannel, applySlackOnboardToCtx } = require('./slack-channel-add');
68
+ const { maybeProvisionTeamsBotChannel } = require('./teams-bot-channel-add');
54
69
 
55
70
  /**
56
71
  * @param {typeof import('./channel-targets').CHANNEL_TARGETS[string]} target
@@ -66,22 +81,6 @@ function resolveInstallStatus(target, channelExt, dryRun) {
66
81
  return 'installed';
67
82
  }
68
83
 
69
- /**
70
- * @param {Object|null} validation
71
- * @returns {Object|null}
72
- */
73
- function toValidationDisplay(validation) {
74
- if (!validation) return null;
75
- return {
76
- callbackReachable: validation.callbackReachable,
77
- credentialValid: validation.credentialValid,
78
- assistantCatalogReachable: validation.assistantCatalogReachable,
79
- inboundVerification: Object.values(validation.inboundVerification).every(Boolean),
80
- probeTiers: validation.probeTiers || null,
81
- runtimeChecks: validation.runtimeChecks || null
82
- };
83
- }
84
-
85
84
  /**
86
85
  * @param {string} channelTarget
87
86
  * @param {Object} artifactParams
@@ -102,6 +101,26 @@ function generateArtifactWithAudit(channelTarget, artifactParams) {
102
101
  }
103
102
  }
104
103
 
104
+ /**
105
+ * @param {string} channelTarget
106
+ * @param {Object} packageContext
107
+ * @param {Object} ctx
108
+ * @returns {Promise<string[]>}
109
+ */
110
+ async function resolveInstallLayerBToolNames(channelTarget, packageContext, ctx) {
111
+ const usesLayerB = channelTarget === 'chatgpt'
112
+ || channelTarget === 'microsoft-copilot'
113
+ || channelTarget === 'mcp-client'
114
+ || channelTarget === 'claude';
115
+ if (!usesLayerB) {
116
+ return [];
117
+ }
118
+ if (packageContext?.governedToolNames?.length > 0) {
119
+ return packageContext.governedToolNames;
120
+ }
121
+ return fetchRuntimeLayerBToolNames(ctx.dataplaneUrl, ctx.authConfig, channelTarget);
122
+ }
123
+
105
124
  /**
106
125
  * @param {Object} ctx
107
126
  * @param {string} channelTarget
@@ -113,7 +132,7 @@ function generateArtifactWithAudit(channelTarget, artifactParams) {
113
132
  async function patchConfigWithAudit(ctx, channelTarget, channelBlock, status, artifactHash) {
114
133
  try {
115
134
  await patchChannelExtension(
116
- { dataplaneUrl: ctx.dataplaneUrl, authConfig: ctx.authConfig, channelTarget },
135
+ { ...ctx, channelTarget },
117
136
  channelBlock
118
137
  );
119
138
  auditConfigPatched(channelTarget, { status, artifactHash });
@@ -156,18 +175,20 @@ async function maybeRunProbe(ctx, channelBlock, channelTarget, probe) {
156
175
  * @returns {Promise<{ target: Object, name: string, baseName: string, description: string, ctx: Object, existing: Object|null }>}
157
176
  */
158
177
  async function prepareChannelContext(channelTarget, options) {
159
- const target = getChannelTarget(channelTarget);
160
- if (target.experimental) {
161
- throw new Error(
162
- `Channel target "${channelTarget}" is experimental. Confirm product requirement before use.`
163
- );
164
- }
178
+ const target = assertChannelTargetInstallable(channelTarget, options);
165
179
  if (!options.name || typeof options.name !== 'string' || !options.name.trim()) {
166
180
  throw new Error('--name is required for channel add');
167
181
  }
168
182
 
169
183
  const baseName = normalizeBaseChannelName(options.name);
170
- const ctx = await resolveChannelAuthContext(channelTarget, { silent: options.quiet });
184
+ const ctx =
185
+ options.authContext && typeof options.authContext === 'object'
186
+ ? options.authContext
187
+ : await resolveChannelAuthContext(channelTarget, {
188
+ silent: options.verbose !== true
189
+ });
190
+ ctx.instanceSystemKey = options.systemKey;
191
+ ctx.projectRoot = options.projectRoot;
171
192
  const name = resolveChannelDisplayName(baseName, ctx.environment);
172
193
  const rawDescription =
173
194
  options.description && String(options.description).trim()
@@ -176,9 +197,9 @@ async function prepareChannelContext(channelTarget, options) {
176
197
  const description = resolveAppDescription(channelTarget, rawDescription);
177
198
 
178
199
  const system = await fetchCommunicationSystem({
179
- dataplaneUrl: ctx.dataplaneUrl,
180
- authConfig: ctx.authConfig,
181
- channelTarget
200
+ ...ctx,
201
+ channelTarget,
202
+ allowMissing: channelTarget === 'slack'
182
203
  });
183
204
  const existing = getExistingChannelExtension(system);
184
205
  return { target, name, baseName, description, ctx, existing };
@@ -189,58 +210,42 @@ async function prepareChannelContext(channelTarget, options) {
189
210
  * @returns {Promise<Object>}
190
211
  */
191
212
  async function completeLiveInstall(params) {
192
- const { ctx, channelTarget, channelBlock, status, artifact, target, name, baseName, options } = params;
193
-
213
+ const { ctx, channelTarget, channelBlock, status, artifact, target, options } = params;
194
214
  await ensureChannelCredential({
195
215
  ctx,
196
216
  channelTarget,
197
217
  target,
198
218
  force: options.force === true
199
219
  });
200
-
201
220
  await patchConfigWithAudit(ctx, channelTarget, channelBlock, status, artifact.artifactHash);
202
-
203
- const projectRoot = options.projectRoot || process.cwd();
204
- const approvalGuide =
205
- status === 'approvalRequired'
206
- ? buildChannelApprovalGuide(channelTarget, {
207
- projectRoot,
208
- name,
209
- baseName,
210
- artifactPath: artifact.outputPath,
211
- dataplaneBaseUrl: ctx.dataplaneUrl,
212
- environment: ctx.environment || options.environment || 'dev'
213
- })
214
- : null;
221
+ const approvalGuide = buildLiveInstallApprovalGuide(params);
215
222
  if (approvalGuide?.portalUrl) {
216
223
  auditApprovalRequired(channelTarget, { approvalUrl: approvalGuide.portalUrl });
217
224
  }
218
-
219
225
  const validation = await maybeRunProbe(ctx, channelBlock, channelTarget, options.probe);
220
-
221
- displayChannelInstallResult({
222
- channelTarget,
223
- name,
224
- baseName,
225
- statusLabel: status === 'approvalRequired' ? 'Approval required' : 'Installed',
226
- credentialKey: target.credentialKey,
227
- capabilities: target.capabilities,
228
- artifactPath: artifact.outputPath,
229
- installGuidePath: artifact.installPath,
230
- zipPath: artifact.zipPath,
231
- installReady: artifact.installReady,
232
- blocker: artifact.blocker,
233
- packageReady: artifact.packageReady,
234
- packageBlocker: artifact.packageBlocker,
235
- microsoftPublicationPending:
236
- artifact.microsoftPublicationPending !== undefined
237
- ? artifact.microsoftPublicationPending
238
- : status === 'approvalRequired',
239
- validation: toValidationDisplay(validation),
240
- approvalGuide
241
- });
242
-
243
- return { channelBlock, artifact, validation, approvalGuide };
226
+ const slack = params.slackProvision || null;
227
+ const teamsBot = params.teamsBotProvision || null;
228
+ let ttyCtx = liveInstallTtyCtx(ctx, slack, teamsBot);
229
+ if (channelTarget === 'slack') {
230
+ ttyCtx = await applySlackOnboardToCtx(ttyCtx, options);
231
+ }
232
+ if (options.quiet !== true) {
233
+ printLiveChannelCanonicalTty({
234
+ channelTarget,
235
+ ctx: ttyCtx,
236
+ options,
237
+ runtimeValues: params.runtimeValues
238
+ });
239
+ }
240
+ return {
241
+ channelBlock,
242
+ artifact,
243
+ validation,
244
+ approvalGuide,
245
+ slackProvision: slack,
246
+ teamsBotProvision: teamsBot,
247
+ runtimeValues: params.runtimeValues
248
+ };
244
249
  }
245
250
 
246
251
  /**
@@ -248,26 +253,24 @@ async function completeLiveInstall(params) {
248
253
  * @returns {{ dryRun: true, channelBlock: Object, artifact: Object }}
249
254
  */
250
255
  function finishDryRunInstall(params) {
251
- displayChannelInstallResult({
252
- channelTarget: params.channelTarget,
253
- name: params.name,
254
- baseName: params.baseName,
255
- statusLabel: 'Generated (dry-run)',
256
- credentialKey: params.target.credentialKey,
257
- capabilities: params.target.capabilities,
258
- artifactPath: params.artifact.outputPath,
259
- installGuidePath: params.artifact.installPath,
260
- zipPath: params.artifact.zipPath,
261
- installReady: params.artifact.installReady,
262
- blocker: params.artifact.blocker
263
- });
264
- return { dryRun: true, channelBlock: params.channelBlock, artifact: params.artifact };
256
+ if (params.options && params.options.quiet !== true) {
257
+ printLiveChannelCanonicalTty({
258
+ channelTarget: params.channelTarget,
259
+ ctx: {
260
+ dataplaneUrl: params.runtimeValues && params.runtimeValues.dataplaneBaseUrl
261
+ },
262
+ options: params.options || { dryRun: true },
263
+ runtimeValues: params.runtimeValues
264
+ });
265
+ }
266
+ return {
267
+ dryRun: true,
268
+ channelBlock: params.channelBlock,
269
+ artifact: params.artifact,
270
+ runtimeValues: params.runtimeValues
271
+ };
265
272
  }
266
273
 
267
- /**
268
- * @param {Object} params
269
- * @returns {Promise<{ artifact: Object, channelBlock: Object, status: string }>}
270
- */
271
274
  /**
272
275
  * @param {Object|null} packageContext
273
276
  * @param {Object} options
@@ -286,7 +289,9 @@ function brandingIconOrOption(packageContext, options, key) {
286
289
 
287
290
  async function resolvePackageContextForInstall(params) {
288
291
  const { channelTarget, options, name, description, ctx } = params;
289
- const packagingTargets = new Set(['chatgpt', 'microsoft-copilot', 'slack', 'teams-bot']);
292
+ const packagingTargets = new Set([
293
+ 'chatgpt', 'microsoft-copilot', 'slack', 'teams-bot', 'mcp-client', 'claude'
294
+ ]);
290
295
  if (!packagingTargets.has(channelTarget)) {
291
296
  return null;
292
297
  }
@@ -325,24 +330,20 @@ async function resolvePackageContextForInstall(params) {
325
330
  };
326
331
  }
327
332
 
328
- async function buildInstallArtifacts(params) {
329
- const { channelTarget, options, target, existing, name, baseName, description, ctx } = params;
330
- const packageContext = await resolvePackageContextForInstall(params);
331
- let runtimeToolNames = [];
332
- if (channelTarget === 'chatgpt' || channelTarget === 'microsoft-copilot') {
333
- runtimeToolNames =
334
- packageContext?.governedToolNames?.length > 0
335
- ? packageContext.governedToolNames
336
- : await fetchRuntimeLayerBToolNames(ctx.dataplaneUrl, ctx.authConfig, channelTarget);
337
- }
333
+ async function resolveInstallRuntimeValues(params, packageContext, runtimeToolNames) {
334
+ const { channelTarget, options, existing, name, baseName, description, ctx } = params;
338
335
  let entraProvider = null;
339
336
  let entraIdentityProvider = null;
340
337
  if (channelTarget === 'microsoft-copilot') {
341
338
  ({ entraProvider, entraIdentityProvider } = await loadMicrosoftCopilotEntraContext(ctx));
342
339
  }
343
- const runtimeValues = resolveChannelRuntimeValues({
344
- dataplaneBaseUrl: ctx.dataplaneUrl,
340
+ applySlackPackageVersion(channelTarget, options, existing);
341
+ const vendor = vendorFacingUrlsFromCtx(ctx);
342
+ return resolveChannelRuntimeValues({
343
+ dataplaneBaseUrl: vendor.dataplaneBaseUrl,
344
+ controllerUrl: vendor.controllerUrl,
345
345
  channelTarget,
346
+ instanceSystemKey: options.systemKey,
346
347
  appName: name,
347
348
  baseName,
348
349
  environment: ctx.environment,
@@ -354,23 +355,40 @@ async function buildInstallArtifacts(params) {
354
355
  entraProvider,
355
356
  entraIdentityProvider,
356
357
  oauthPluginVaultReferenceId: options.oauthPluginVaultReferenceId,
358
+ packageVersion: options.packageVersion,
357
359
  scopes: options.scopes,
358
360
  iconColorPath: brandingIconOrOption(packageContext, options, 'iconColorPath'),
359
- iconOutlinePath: brandingIconOrOption(packageContext, options, 'iconOutlinePath')
361
+ iconOutlinePath: brandingIconOrOption(packageContext, options, 'iconOutlinePath'),
362
+ mcpClientProfile:
363
+ channelTarget === 'mcp-client' ? maybeAssertMcpClientProfile(channelTarget, options) : undefined
360
364
  });
361
- const projectRoot = options.projectRoot || process.cwd();
365
+ }
366
+
367
+ async function buildInstallArtifacts(params) {
368
+ const { channelTarget, options, target, existing, name, baseName, description } = params;
369
+ const packageContext = await resolvePackageContextForInstall(params);
370
+ const runtimeToolNames = await resolveInstallLayerBToolNames(channelTarget, packageContext, params.ctx);
371
+ const runtimeValues = await resolveInstallRuntimeValues(params, packageContext, runtimeToolNames);
362
372
  const artifact = generateArtifactWithAudit(channelTarget, {
363
- projectRoot,
373
+ projectRoot: options.projectRoot || process.cwd(),
364
374
  channelTarget,
365
375
  runtimeValues,
366
376
  dryRun: options.dryRun === true
367
377
  });
368
378
  const status = resolveInstallStatus(target, existing, options.dryRun === true);
369
379
  const channelBlock = buildChannelExtensionBlock(
370
- { name, baseName, description, artifactHash: artifact.artifactHash, status },
380
+ {
381
+ name,
382
+ baseName,
383
+ description,
384
+ status,
385
+ artifactHash: artifact.artifactHash,
386
+ commandPrefix: runtimeValues.commandPrefix,
387
+ packageVersion: runtimeValues.packageVersion
388
+ },
371
389
  target
372
390
  );
373
- return { artifact, channelBlock, status };
391
+ return { artifact, channelBlock, status, runtimeValues };
374
392
  }
375
393
 
376
394
  /**
@@ -379,34 +397,40 @@ async function buildInstallArtifacts(params) {
379
397
  * @returns {Object}
380
398
  */
381
399
  function assertChannelAddOptions(channelTarget, options) {
382
- const target = getChannelTarget(channelTarget);
383
- if (target.experimental) {
384
- throw new Error(
385
- `Channel target "${channelTarget}" is experimental. Confirm product requirement before use.`
386
- );
387
- }
400
+ const target = assertChannelTargetInstallable(channelTarget, options);
388
401
  if (!options.name || typeof options.name !== 'string' || !options.name.trim()) {
389
402
  throw new Error('--name is required for channel add');
390
403
  }
404
+ options.systemKey = deriveChannelInstanceKey(channelTarget, options.name, options.systemKey);
391
405
  return target;
392
406
  }
393
407
 
394
408
  /**
395
409
  * @param {string} channelTarget
396
410
  * @param {Object} options
397
- * @returns {Promise<Object>}
411
+ * @returns {Promise<void>}
398
412
  */
399
- async function runAddChannel(channelTarget, options = {}) {
400
- const target = assertChannelAddOptions(channelTarget, options);
413
+ async function prepareAddChannelGuards(channelTarget, options) {
414
+ maybeAssertMcpClientProfile(channelTarget, options);
401
415
  if (channelTarget === 'microsoft-copilot' && options.force === true) {
402
416
  await assertMicrosoftCopilotOauthReferenceBeforeForce(options);
403
417
  }
404
418
  await ensureChannelReadyForAdd(channelTarget, options);
419
+ }
420
+
421
+ /**
422
+ * @param {string} channelTarget
423
+ * @param {Object} options
424
+ * @returns {Promise<Object>}
425
+ */
426
+ async function runAddChannel(channelTarget, options = {}) {
427
+ const target = assertChannelAddOptions(channelTarget, options);
428
+ await prepareAddChannelGuards(channelTarget, options);
405
429
  const { name, baseName, description, ctx, existing } = await prepareChannelContext(
406
430
  channelTarget,
407
431
  options
408
432
  );
409
- const skipped = showExistingChannelStatus({
433
+ const skipped = await showExistingChannelStatus({
410
434
  existing,
411
435
  options,
412
436
  channelTarget,
@@ -414,11 +438,13 @@ async function runAddChannel(channelTarget, options = {}) {
414
438
  baseName,
415
439
  ctx
416
440
  });
417
- if (skipped) return skipped;
441
+ if (shouldReturnSkippedChannel(channelTarget, options, skipped)) {
442
+ return skipped;
443
+ }
418
444
  if (channelTarget === 'microsoft-copilot') {
419
445
  await assertMicrosoftCopilotOauthReference({ options, ctx, name, baseName, description });
420
446
  }
421
- const { artifact, channelBlock, status } = await buildInstallArtifacts({
447
+ const built = await buildInstallArtifacts({
422
448
  channelTarget,
423
449
  options,
424
450
  target,
@@ -429,21 +455,32 @@ async function runAddChannel(channelTarget, options = {}) {
429
455
  ctx
430
456
  });
431
457
  if (options.dryRun) {
432
- return finishDryRunInstall({ channelTarget, name, baseName, target, artifact, channelBlock });
458
+ return finishDryRunInstall({ channelTarget, name, baseName, target, options, ...built });
433
459
  }
434
- return completeLiveInstall({
460
+ return runLiveChannelInstall({
435
461
  ctx,
436
462
  channelTarget,
437
- channelBlock,
438
- status,
439
- artifact,
463
+ options,
440
464
  target,
441
465
  name,
442
466
  baseName,
443
- options
467
+ ...built
444
468
  });
445
469
  }
446
470
 
471
+ /**
472
+ * @param {Object} params
473
+ * @returns {Promise<Object>}
474
+ */
475
+ async function runLiveChannelInstall(params) {
476
+ await runChannelAddPreflights(params);
477
+ const slackProvision = await maybeProvisionSlackChannel(params);
478
+ const teamsBotProvision = await maybeProvisionTeamsBotChannel(params);
479
+ const result = await completeLiveInstall({ ...params, slackProvision, teamsBotProvision });
480
+ await runChannelAddContinuations(params);
481
+ return result;
482
+ }
483
+
447
484
  /**
448
485
  * @param {string} channelTarget
449
486
  * @param {Object} options
@@ -1,35 +1,31 @@
1
1
  /**
2
- * ChatGPT enterprise channel admin approval steps (plan 152).
2
+ * ChatGPT remaining workspace steps (customer-facing).
3
3
  *
4
- * @fileoverview OpenAI Platform / workspace connector guide
4
+ * @fileoverview Short ChatGPT Apps create/publish steps — no protocol dump
5
5
  * @author AI Fabrix Team
6
- * @version 1.0.0
6
+ * @version 1.3.0
7
7
  */
8
8
 
9
9
  'use strict';
10
10
 
11
- const { formatCredentialPortalStep } = require('./credential-portal');
11
+ const { CHATGPT_APPS_CREATE_URL } = require('../chatgpt-runtime-contract');
12
12
 
13
13
  /**
14
14
  * @param {Object} ctx
15
- * @returns {{ portalUrl: string, steps: string[] }}
15
+ * @returns {{ portalUrl: string, heading: string, credentialPortalUrl: null, steps: string[] }}
16
16
  */
17
17
  function buildChatGptApprovalGuide(ctx) {
18
+ const name = ctx.appName || ctx.name || '';
19
+ const serverUrl = ctx.mcpUrl || '';
18
20
  return {
19
- portalUrl: 'https://chatgpt.com/',
21
+ portalUrl: CHATGPT_APPS_CREATE_URL,
22
+ heading: 'Create the ChatGPT app',
23
+ credentialPortalUrl: null,
20
24
  steps: [
21
- 'Sign in to the ChatGPT web app as a workspace admin or owner.',
22
- 'Enable Developer mode for custom MCP apps (Business: Workspace settings → Apps, or Settings → Apps → Advanced settings; Enterprise/Edu: grant Developer mode under Permissions & roles → Connected data first).',
23
- 'Create a custom MCP app with the Remote MCP URL from INSTALL.md (channel-chatgpt.json is a deployment reference, not a plugin archive).',
24
- 'Select OAuth (authorization-code + PKCE S256). Do not configure a custom API key for a remote custom MCP app.',
25
- 'Scan tools, complete OAuth if prompted, review discovered governed tools, then save the app as a draft.',
26
- formatCredentialPortalStep(
27
- ctx,
28
- `${ctx.credentialKey || 'channel'} credential references (not secrets to paste into ChatGPT)`
29
- ),
30
- 'Test representative workflows, then publish the app and configure workspace access and action controls.',
31
- `After ChatGPT lists the app as active, re-run: ${ctx.resumeCommand}`,
32
- 'Optional: use --probe for AI Fabrix-side Runtime checks; ChatGPT Scan tools / OAuth / publication remain workspace-admin responsibilities.'
25
+ `Open ${CHATGPT_APPS_CREATE_URL}`,
26
+ `Create the app with Name: ${name}; Server URL: ${serverUrl}; Authentication: OAuth. Add the logo now — ChatGPT does not let you change it after create.`,
27
+ 'If ChatGPT shows a callback URL that is not already registered: aifabrix channel configure chatgpt --callback-url "<callback-url>"',
28
+ 'Publish and connect the app.'
33
29
  ]
34
30
  };
35
31
  }
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Claude remaining workspace steps (customer-facing).
3
+ *
4
+ * @fileoverview Short Claude connector Name and Server URL steps — no protocol dump
5
+ */
6
+
7
+ 'use strict';
8
+
9
+ const { CLAUDE_CONNECTORS_URL } = require('../claude-runtime-contract');
10
+
11
+ /**
12
+ * @param {Object} ctx
13
+ * @returns {{ portalUrl: string, heading: string, credentialPortalUrl: null, steps: string[] }}
14
+ */
15
+ function buildClaudeApprovalGuide(ctx) {
16
+ const name = ctx.appName || ctx.name || '';
17
+ const serverUrl = ctx.mcpUrl || '';
18
+ return {
19
+ portalUrl: CLAUDE_CONNECTORS_URL,
20
+ heading: 'Add the Claude custom connector',
21
+ credentialPortalUrl: null,
22
+ steps: [
23
+ `Open ${CLAUDE_CONNECTORS_URL}`,
24
+ `Add a custom connector with Name: ${name}; Server URL: ${serverUrl}.`
25
+ ]
26
+ };
27
+ }
28
+
29
+ module.exports = { buildClaudeApprovalGuide };