@aifabrix/builder 2.51.1 → 2.52.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 (69) hide show
  1. package/lib/app/run-container-start.js +4 -0
  2. package/lib/app/run-deploy-job.js +135 -27
  3. package/lib/app/run-env-compose.js +32 -0
  4. package/lib/app/run-env-recovery.js +35 -0
  5. package/lib/app/run-helpers.js +5 -6
  6. package/lib/app/run.js +11 -3
  7. package/lib/channels/approval-guides/chatgpt.js +12 -9
  8. package/lib/channels/channel-targets.js +18 -1
  9. package/lib/channels/chatgpt-runtime-contract.js +1 -1
  10. package/lib/cli/infra-guided-footers.js +1 -1
  11. package/lib/cli/infra-guided-public-url-warn.js +55 -0
  12. package/lib/cli/infra-guided.js +65 -56
  13. package/lib/cli/setup-app.help.js +4 -0
  14. package/lib/cli/setup-app.test-commands.js +59 -28
  15. package/lib/cli/setup-external-system.js +50 -12
  16. package/lib/commands/channel-add-setup.js +8 -2
  17. package/lib/commands/channel.js +16 -5
  18. package/lib/commands/deploy-gate-orchestrator.js +3 -2
  19. package/lib/commands/governance-verify-external.js +2 -5
  20. package/lib/commands/lifecycle-external.js +14 -7
  21. package/lib/commands/role-assistant.js +66 -8
  22. package/lib/commands/test-governance-external.js +2 -5
  23. package/lib/commands/up-miso.js +61 -24
  24. package/lib/commands/upload-data-sync-finalize.js +20 -3
  25. package/lib/commands/verify-governance-external.js +2 -5
  26. package/lib/commands/verify-operations-external.js +2 -5
  27. package/lib/commands/verify-operations-step-plan.js +31 -0
  28. package/lib/commands/verify-trust-command-action.js +2 -5
  29. package/lib/datasource/datasource-identifier.js +4 -3
  30. package/lib/datasource/integration-context.js +3 -3
  31. package/lib/datasource/resolve-app.js +90 -8
  32. package/lib/datasource/test-e2e.js +2 -2
  33. package/lib/datasource/unified-validation-run-body.js +15 -1
  34. package/lib/datasource/unified-validation-run-resolve.js +2 -2
  35. package/lib/external-system/deploy-helpers.js +9 -5
  36. package/lib/external-system/deploy.js +2 -1
  37. package/lib/external-system/test-system-level.js +21 -3
  38. package/lib/external-system/test.js +4 -4
  39. package/lib/generator/builders.js +9 -15
  40. package/lib/role-assistant/knowledge-markdown-frontmatter.js +75 -0
  41. package/lib/role-assistant/knowledge-sync.js +25 -5
  42. package/lib/role-assistant/test-runner-workhub-answers.js +44 -26
  43. package/lib/role-assistant/test-runner-workhub.js +21 -7
  44. package/lib/schema/application-schema.json +10 -28
  45. package/lib/schema/infra.parameter.yaml +0 -20
  46. package/lib/utils/certify-external-workspace.js +40 -0
  47. package/lib/utils/docker-run-ephemeral.js +77 -17
  48. package/lib/utils/health-check-public-warn.js +31 -13
  49. package/lib/utils/health-check.js +11 -1
  50. package/lib/utils/paths.js +13 -15
  51. package/lib/utils/role-assistant-paths.js +76 -14
  52. package/lib/utils/upload-sync-options.js +7 -4
  53. package/lib/validation/reserved-system-key-prefixes.js +56 -0
  54. package/lib/validation/validate.js +54 -19
  55. package/package.json +1 -1
  56. package/templates/applications/builder-api/application.yaml +3 -3
  57. package/templates/applications/dataplane/application.yaml +3 -4
  58. package/templates/applications/dataplane/env.template +2 -2
  59. package/templates/applications/dataplane/rbac.yaml +10 -10
  60. package/templates/applications/keycloak/application.yaml +2 -2
  61. package/templates/applications/keycloak/env.template +5 -2
  62. package/templates/applications/miso-controller/application.yaml +3 -3
  63. package/templates/applications/miso-controller/env.template +16 -3
  64. package/templates/channels/chatgpt/install.template.md.hbs +75 -37
  65. package/templates/channels/chatgpt/integration/README.md +3 -2
  66. package/templates/channels/chatgpt/manifest.template.json.hbs +3 -3
  67. package/templates/channels/slack/install.template.md.hbs +6 -1
  68. package/templates/python/docker-compose.hbs +10 -0
  69. package/templates/typescript/docker-compose.hbs +10 -0
@@ -2,63 +2,101 @@
2
2
 
3
3
  {{appDescription}}
4
4
 
5
- Environment: **{{environment}}** · Credential key: `{{credentialKey}}`
6
-
7
- This output is connection and administration material (`channel-chatgpt.json` + `INSTALL.md`), not a plugin archive.
8
-
9
- ## Workspace admin setup (manual)
10
-
11
- 1. Sign in to your ChatGPT workspace as an admin and enable **Developer mode / custom MCP apps** if required by workspace policy.
12
- 2. Create a custom MCP app and use the generated artifact from `dist/channels/chatgpt/channel-chatgpt.json` as the connection reference.
13
- 3. Configure the remote MCP URL and transport from **Runtime connection** below.
14
- 4. Complete authentication setup for your workspace policy. Store credential references in AI Fabrix: [Authentication settings]({{credentialPortalUrl}})
15
- 5. Refresh tools in ChatGPT after configuration changes so ChatGPT reads the latest Runtime tool list.
16
- 6. Publish the app to the workspace and configure workspace access controls (RBAC or equivalent).
5
+ **Environment:** {{environment}}
6
+ **AI Fabrix credential reference:** `{{credentialKey}}`
7
+
8
+ > This document and `dist/channels/chatgpt/channel-chatgpt.json` are deployment references for administrators. ChatGPT does not install the JSON file as a plugin archive. ChatGPT connects directly to the remote MCP endpoint and discovers the tools exposed by that server.
9
+
10
+ ## ChatGPT workspace setup
11
+
12
+ 1. Sign in to the ChatGPT web app as a workspace admin or owner.
13
+ 2. Enable Developer mode for custom MCP apps:
14
+ - **Business:** **Workspace settings → Apps → Create**, or **Settings → Apps → Advanced settings**.
15
+ - **Enterprise/Edu:** grant the appropriate Developer mode permission under **Workspace settings → Permissions & roles → Connected data**, then enable it under **Settings → Apps → Advanced settings**.
16
+ 3. Open **Settings → Apps → Create** (or the equivalent **Workspace settings → Apps → Create** entry).
17
+ 4. Enter the app name `{{appName}}` and the remote MCP URL shown under **Runtime connection** below.
18
+ 5. Select **OAuth** as the authentication mechanism. Do not configure a custom API key in ChatGPT; custom API-key authentication is not supported for a remote custom MCP app.
19
+ 6. Select **Scan tools**. If prompted, complete the OAuth authorization flow and wait for ChatGPT to finish scanning the Runtime tool list.
20
+ 7. Review the discovered tools and create the app as a draft.
21
+ 8. Test representative read and write workflows. Confirm that user authorization and action confirmations behave as expected.
22
+ 9. Publish the app to the workspace and configure its access and action controls. Only workspace admins or owners can publish it.
23
+ 10. After MCP tool names, schemas, annotations, or authentication metadata change, use **Refresh** in the app's action controls and review the changes before enabling them.
17
24
 
18
25
  ## Runtime connection
19
26
 
20
- Configure these values in the ChatGPT custom MCP app. Do not place secrets in generated files.
27
+ Configure the following values in the ChatGPT custom MCP app. Never place access tokens, client secrets, or API keys in generated files.
21
28
 
29
+ - **App name:** `{{appName}}`
22
30
  {{#if mcpUrl}}
23
- - **Remote MCP URL:** {{mcpUrl}}
31
+ - **Remote MCP URL:** `{{{mcpUrl}}}`
24
32
  {{/if}}
25
- - **Runtime system key:** {{runtimeSystemKey}}
26
- - **Transport:** {{runtimeTransport}}
27
- - **Auth mode:** {{runtimeAuthMode}}
28
- - **Expected Layer B tools:**
33
+ - **Runtime system key:** `{{runtimeSystemKey}}`
34
+ - **Transport:** Streamable HTTP
35
+ - **Authentication:** OAuth 2.1 authorization-code flow with PKCE (`S256`)
36
+ - **AI Fabrix credential reference:** `{{credentialKey}}`
37
+ - **AI Fabrix authentication settings:** [Open authentication settings]({{{credentialPortalUrl}}})
38
+
39
+ The `{{credentialKey}}` value is an AI Fabrix credential reference. It is not a secret to paste into ChatGPT.
40
+
41
+ ## OAuth requirements
42
+
43
+ Before ChatGPT can connect successfully, the MCP deployment must meet all of these requirements:
44
+
45
+ - The MCP endpoint is reachable over public HTTPS with a publicly trusted TLS certificate chain.
46
+ - The MCP server publishes OAuth protected-resource metadata, normally at `/.well-known/oauth-protected-resource`, or points to it in the `WWW-Authenticate` header returned with a `401 Unauthorized` response.
47
+ - The protected-resource document identifies the canonical resource URL, authorization server, and supported scopes.
48
+ - The authorization server publishes OAuth or OpenID Connect discovery metadata.
49
+ - The authorization server supports the authorization-code flow and PKCE with `S256`.
50
+ - The OAuth flow preserves the MCP `resource` parameter, and issued access tokens contain the expected audience and scopes.
51
+ - The redirect URI shown by ChatGPT when the app is created is allowlisted in the authorization server.
52
+ - The MCP server validates every access token's signature, issuer, audience, expiry, and scopes.
53
+ - Each authenticated MCP tool declares an `oauth2` security scheme with the scopes it needs.
54
+
55
+ If this development endpoint is deliberately anonymous, select **No authentication** instead and declare `noauth` on the applicable tools. Do not describe the app as “OAuth or API key”; the selected mechanism must match the behavior advertised by the MCP server.
56
+
57
+ ## Expected Runtime Layer B tools
58
+
59
+ ChatGPT should discover the following tools from the live MCP server during **Scan tools**:
60
+
29
61
  {{#each layerBToolNames}}
30
- - `{{this}}`
62
+ - `{{this}}`
31
63
  {{/each}}
32
64
 
33
- AI Fabrix `--probe` validates Runtime through the first-party MCP gateway
34
- (`/api/v1/mcp/servers/tools` and MCP docs for `{{runtimeSystemKey}}`), including
35
- Layer B discovery and BTA Evidence authoring reachability. ChatGPT workspace apps still
36
- require a working streamable-http Remote MCP URL and admin publication.
37
-
38
- ## Runtime and Role Assistant boundary checks
65
+ The live server response is authoritative. This list is an expected deployment contract, not a substitute for MCP tool discovery.
39
66
 
40
- - Runtime should resolve assistants dynamically per user from:
67
+ ## Runtime and Role Assistant boundaries
41
68
 
42
- {{assistantCatalogUrl}}
69
+ - Runtime resolves assistants dynamically for the current user from `{{{assistantCatalogUrl}}}`.
70
+ - ChatGPT's top-level tool surface remains limited to the Runtime Layer B tools listed above.
71
+ - Evidence authoring remains an internal Business Transformation Assistant capability. It is reached through `ChatGPT → runtime-orchestration → Business Transformation Assistant → internal evidence capabilities` and is not exposed as a top-level ChatGPT tool.
72
+ - One authenticated Runtime connection can support multiple Role Assistants, subject to the current user's authorization.
43
73
 
44
- - The ChatGPT top-level tool surface should stay at Runtime Layer B tools.
45
- - Evidence authoring remains an internal Business Transformation Assistant capability path, not top-level ChatGPT tools.
74
+ ## BTA evidence-authoring proof scenario
46
75
 
47
- ## BTA Evidence-authoring proof scenario
76
+ Use this scenario to verify the ChatGPT → Runtime → BTA path without exposing Evidence commands as top-level ChatGPT tools:
48
77
 
49
- Use this scenario to verify ChatGPT → Runtime → BTA path without exposing Evidence commands as top-level ChatGPT tools:
78
+ 1. Ask {{baseName}} to improve an existing Role Assistant from process documentation.
79
+ 2. Confirm that {{baseName}} starts or continues Business Transformation Assistant work through Runtime.
80
+ 3. Confirm that BTA performs evidence metadata, download, upload, and reasoning operations internally and presents certified proposals.
81
+ 4. Approve selected proposals and confirm that activation remains an explicit human action.
50
82
 
51
- 1. Ask ChatGPT to improve an existing Role Assistant from process documentation.
52
- 2. Confirm ChatGPT starts or continues Business Transformation Assistant work through Runtime.
53
- 3. Confirm BTA performs evidence metadata/download/upload reasoning and presents certified proposals.
54
- 4. Approve selected proposals and confirm activation remains an explicit human action.
83
+ ## AI Fabrix validation
55
84
 
56
- ## AI Fabrix validation commands
85
+ Before workspace publication, validate the live Streamable HTTP endpoint with MCP Inspector and confirm that initialization, tool discovery, representative calls, invalid inputs, OAuth challenges, and authorization checks all work.
57
86
 
58
- After workspace publication and authentication setup:
87
+ Then run the AI Fabrix probe:
59
88
 
60
89
  ```bash
61
90
  aifabrix channel add {{channelTarget}} --name "{{baseName}}" --probe
62
91
  ```
63
92
 
93
+ The probe should validate Runtime through the first-party MCP gateway, including Layer B discovery and BTA Evidence-authoring reachability. A successful AI Fabrix probe does not replace ChatGPT's own **Scan tools**, OAuth, and workspace publication checks.
94
+
64
95
  Use `--force` only to regenerate artifacts and patch channel metadata. It does not rotate credentials.
96
+
97
+ ## Current validation status
98
+
99
+ - Local artifact validation: complete
100
+ - Live Runtime validation: pending
101
+ - ChatGPT workspace tool scan: pending
102
+ - ChatGPT workspace publication: requires a workspace admin or owner
@@ -10,5 +10,6 @@ aifabrix channel add chatgpt --name "Your Assistant" --probe
10
10
  ```
11
11
 
12
12
  The `channel add` step generates `dist/channels/chatgpt/channel-chatgpt.json` and
13
- `INSTALL.md` for ChatGPT workspace admins to connect a custom MCP app to the
14
- runtime-orchestration server.
13
+ `INSTALL.md`. Those files are deployment references for workspace admins: ChatGPT
14
+ connects to the remote Runtime MCP URL (OAuth) and discovers tools; it does not
15
+ install the JSON as a plugin archive.
@@ -6,9 +6,9 @@
6
6
  "environment": "{{environment}}",
7
7
  "runtime": {
8
8
  "runtimeSystemKey": "{{runtimeSystemKey}}",
9
- "remoteMcpUrl": "{{mcpUrl}}",
9
+ "remoteMcpUrl": "{{{mcpUrl}}}",
10
10
  "transport": "{{runtimeTransport}}",
11
- "assistantCatalogUrl": "{{assistantCatalogUrl}}",
11
+ "assistantCatalogUrl": "{{{assistantCatalogUrl}}}",
12
12
  "roleAssistantResolution": "dynamic-runtime",
13
13
  "layerBToolNames": [
14
14
  {{#each layerBToolNames}}
@@ -19,7 +19,7 @@
19
19
  "authentication": {
20
20
  "mode": "{{runtimeAuthMode}}",
21
21
  "credentialKey": "{{credentialKey}}",
22
- "credentialPortalUrl": "{{credentialPortalUrl}}",
22
+ "credentialPortalUrl": "{{{credentialPortalUrl}}}",
23
23
  "scopes": {{{scopesJson}}}
24
24
  },
25
25
  "boundaries": {
@@ -17,7 +17,7 @@ One Slack app delivers **Role Assistant** chat, **Work hub** shortcuts, and **do
17
17
  5. Confirm **App Home → Messages tab** is **ON** in the manifest (required for bot DMs and proactive notifications; slash commands work without it).
18
18
  6. Click **Create**, then open **Install App** → **Install to Workspace** and approve.
19
19
  7. Copy **Bot User OAuth Token** and **Signing Secret** from the Slack app settings.
20
- 8. Save **Bot User OAuth Token** and **Signing Secret** in AI Fabrix: [Authentication settings]({{credentialPortalUrl}})
20
+ 8. Save **Bot User OAuth Token** and **Signing Secret** in AI Fabrix: [Authentication settings]({{{credentialPortalUrl}}})
21
21
 
22
22
  ## Platform callback URLs
23
23
 
@@ -32,6 +32,11 @@ Configure these in your Slack app if you edit settings manually. Do not embed se
32
32
  {{#if commandUrl}}
33
33
  - **Slash commands:** {{commandUrl}}
34
34
  {{/if}}
35
+ {{#if oauthCallbackUrl}}
36
+ - **OAuth Redirect URL:** {{oauthCallbackUrl}}
37
+ {{/if}}
38
+
39
+ Paste the **OAuth Redirect URL** into Slack app settings → **OAuth & Permissions** → **Redirect URLs** (required for Add to Slack / OAuth).
35
40
 
36
41
  Register these **V1** slash commands in the manifest (all use the same request URL):
37
42
 
@@ -53,6 +53,10 @@ services:
53
53
  {{/if}}
54
54
  env_file:
55
55
  - {{envFile}}
56
+ {{#if devMountPath}}
57
+ # Bind-mount replaces /app and hides image ENTRYPOINT scripts (e.g. docker-entrypoint.sh).
58
+ entrypoint: []
59
+ {{/if}}
56
60
  {{#if reloadStartCommand}}
57
61
  command: ["sh", "-c", "cd /app && {{{reloadStartCommand}}}"]
58
62
  {{/if}}
@@ -111,6 +115,9 @@ services:
111
115
  - LOCAL_MODE=false
112
116
  env_file:
113
117
  - {{envFile}}
118
+ {{#if devMountPath}}
119
+ entrypoint: []
120
+ {{/if}}
114
121
  command: ["sh", "-c", "cd /app && {{{workerSidecars.worker.command}}}"]
115
122
  networks:
116
123
  - {{networkName}}
@@ -136,6 +143,9 @@ services:
136
143
  - LOCAL_MODE=false
137
144
  env_file:
138
145
  - {{envFile}}
146
+ {{#if devMountPath}}
147
+ entrypoint: []
148
+ {{/if}}
139
149
  command: ["sh", "-c", "cd /app && {{{workerSidecars.beat.command}}}"]
140
150
  networks:
141
151
  - {{networkName}}
@@ -53,6 +53,10 @@ services:
53
53
  {{/if}}
54
54
  env_file:
55
55
  - {{envFile}}
56
+ {{#if devMountPath}}
57
+ # Bind-mount replaces /app and hides image ENTRYPOINT scripts (e.g. docker-entrypoint.sh).
58
+ entrypoint: []
59
+ {{/if}}
56
60
  {{#if reloadStartCommand}}
57
61
  command: ["sh", "-c", "cd /app && {{reloadStartCommand}}"]
58
62
  {{/if}}
@@ -111,6 +115,9 @@ services:
111
115
  - LOCAL_MODE=false
112
116
  env_file:
113
117
  - {{envFile}}
118
+ {{#if devMountPath}}
119
+ entrypoint: []
120
+ {{/if}}
114
121
  command: ["sh", "-c", "cd /app && {{{workerSidecars.worker.command}}}"]
115
122
  networks:
116
123
  - {{networkName}}
@@ -134,6 +141,9 @@ services:
134
141
  - LOCAL_MODE=false
135
142
  env_file:
136
143
  - {{envFile}}
144
+ {{#if devMountPath}}
145
+ entrypoint: []
146
+ {{/if}}
137
147
  command: ["sh", "-c", "cd /app && {{{workerSidecars.beat.command}}}"]
138
148
  networks:
139
149
  - {{networkName}}