@aifabrix/builder 2.54.1 → 2.55.2
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.
- package/README.md +8 -0
- package/lib/agent-kit/apply-ops.js +82 -0
- package/lib/agent-kit/checksums.js +28 -0
- package/lib/agent-kit/classify.js +113 -0
- package/lib/agent-kit/claude-shim.js +61 -0
- package/lib/agent-kit/constants.js +55 -0
- package/lib/agent-kit/file-list.js +103 -0
- package/lib/agent-kit/host-approve.js +172 -0
- package/lib/agent-kit/hosting/github.js +63 -0
- package/lib/agent-kit/hosts.js +71 -0
- package/lib/agent-kit/init.js +319 -0
- package/lib/agent-kit/kit-root.js +17 -0
- package/lib/agent-kit/managed-section.js +79 -0
- package/lib/agent-kit/package-load.js +45 -0
- package/lib/agent-kit/plan-ops.js +69 -0
- package/lib/agent-kit/remote-prompts.js +272 -0
- package/lib/agent-kit/render-host-markdown.js +40 -0
- package/lib/agent-kit/repo-guard.js +47 -0
- package/lib/agent-kit/report.js +107 -0
- package/lib/agent-kit/run.js +82 -0
- package/lib/agent-kit/scm/git.js +122 -0
- package/lib/agent-kit/start.js +310 -0
- package/lib/agent-kit/state-file.js +83 -0
- package/lib/agent-kit/status.js +50 -0
- package/lib/agent-kit/v1-detect.js +81 -0
- package/lib/agent-kit/validate-kit.js +87 -0
- package/lib/agent-kit/workspace-name.js +40 -0
- package/lib/agent-kit/workspace-skeleton.js +103 -0
- package/lib/api/role-assistant-test-pack.api.js +86 -0
- package/lib/api/work-search.api.js +31 -4
- package/lib/api/work.api.js +19 -12
- package/lib/app/deploy.js +7 -4
- package/lib/app/list-external-systems.js +2 -1
- package/lib/app/offer-create-from-template.js +184 -0
- package/lib/app/show-display.js +33 -6
- package/lib/app/show.js +25 -2
- package/lib/channels/add-channel.js +1 -0
- package/lib/channels/approval-guides/claude.js +2 -2
- package/lib/channels/channel-add-failure.js +1 -0
- package/lib/channels/channel-add-remaining.js +15 -9
- package/lib/channels/channel-definition-status.js +115 -0
- package/lib/channels/channel-description.js +2 -1
- package/lib/channels/channel-install-envelope.js +4 -2
- package/lib/channels/channel-integration-generator.js +2 -0
- package/lib/channels/channel-runtime-resolver.js +14 -0
- package/lib/channels/channel-targets.js +31 -5
- package/lib/channels/claude-setup-values.js +4 -1
- package/lib/channels/slack-channel-add.js +59 -6
- package/lib/channels/slack-mcp-callback.js +51 -0
- package/lib/channels/slack-mcp-runtime.js +156 -0
- package/lib/channels/slack-provisioning/install-cli.js +14 -2
- package/lib/channels/slack-provisioning/with-curl-on-path.js +6 -1
- package/lib/cli/index.js +4 -0
- package/lib/cli/setup-app.js +8 -1
- package/lib/cli/setup-auth.js +11 -2
- package/lib/cli/setup-certification-commands.js +2 -2
- package/lib/cli/setup-certification.help.js +3 -1
- package/lib/commands/agent-kit-help.js +149 -0
- package/lib/commands/agent-kit.js +417 -0
- package/lib/commands/auth-status-user.js +99 -0
- package/lib/commands/auth-status.js +14 -4
- package/lib/commands/channel-add-help.js +5 -5
- package/lib/commands/datasource-capability-relate-cli.js +5 -4
- package/lib/commands/datasource-load-export-cli.js +7 -2
- package/lib/commands/datasource-test-trust-cli.js +5 -1
- package/lib/commands/governance-command-action.js +5 -4
- package/lib/commands/identity-membership-role-cache.js +6 -1
- package/lib/commands/lifecycle-command-action.js +16 -15
- package/lib/commands/login-credentials.js +8 -3
- package/lib/commands/login-device.js +14 -5
- package/lib/commands/login.js +14 -1
- package/lib/commands/logout.js +50 -15
- package/lib/commands/repair-auth-apply.js +1 -1
- package/lib/commands/repair-datasource-key-skip.js +39 -0
- package/lib/commands/repair-datasource-keys.js +24 -12
- package/lib/commands/repair-rbac.js +16 -10
- package/lib/commands/role-assistant-copy-output.js +61 -0
- package/lib/commands/role-assistant-copy.js +155 -0
- package/lib/commands/role-assistant-test-output.js +8 -9
- package/lib/commands/role-assistant-test-result-rows.js +42 -0
- package/lib/commands/role-assistant.js +140 -59
- package/lib/commands/search.js +143 -0
- package/lib/commands/test-trust-external.js +7 -5
- package/lib/commands/upload-sidecar-followups.js +4 -1
- package/lib/commands/verify-governance-command-action.js +9 -7
- package/lib/commands/verify-operations-command-action.js +9 -8
- package/lib/commands/verify-operations-skip-e2e.js +131 -0
- package/lib/commands/verify-operations-step-plan.js +6 -33
- package/lib/commands/verify-operations-steps.js +3 -1
- package/lib/commands/verify-trust-command-action.js +6 -5
- package/lib/datasource/capability/relate-operations.js +28 -10
- package/lib/datasource/capability/run-capability-relate.js +48 -25
- package/lib/datasource/datasource-identifier.js +13 -5
- package/lib/deployment/deployer-poll-run.js +117 -35
- package/lib/external-system/deploy-dataplane-published.js +70 -0
- package/lib/external-system/deploy.js +12 -2
- package/lib/external-system/download-role-assistant.js +41 -15
- package/lib/external-system/download.js +8 -3
- package/lib/generator/helpers.js +12 -1
- package/lib/generator/wizard-datasource-key.js +54 -0
- package/lib/generator/wizard.js +55 -54
- package/lib/integration-definition/apply-datasource-keys.js +75 -0
- package/lib/integration-definition/apply-relationships.js +195 -0
- package/lib/integration-definition/apply-static-enterprise.js +232 -0
- package/lib/integration-definition/apply-system-file.js +71 -0
- package/lib/integration-definition/apply-test-endpoint.js +89 -0
- package/lib/integration-definition/apply-viewpoint-defaults.js +157 -0
- package/lib/integration-definition/apply.js +78 -59
- package/lib/integration-definition/enrich-openapi-operations.js +36 -10
- package/lib/integration-definition/enrich-openapi-pick.js +87 -0
- package/lib/lifecycle/role-assistant-governance.js +56 -21
- package/lib/programmatic/capability-registry.js +1 -0
- package/lib/programmatic/index.js +2 -0
- package/lib/programmatic/openapi-apply-result-schemas.js +8 -0
- package/lib/programmatic/openapi-channel-install-schemas.js +4 -1
- package/lib/programmatic/openapi-component-schemas.js +1 -0
- package/lib/programmatic/openapi-descriptions.js +9 -3
- package/lib/programmatic/openapi-envelope-examples.js +7 -0
- package/lib/programmatic/openapi-operation-bindings.js +5 -0
- package/lib/programmatic/openapi-request-schemas.js +5 -0
- package/lib/programmatic/openapi-schema-descriptions-channel.js +8 -5
- package/lib/programmatic/openapi-schema-descriptions-operations.js +19 -0
- package/lib/programmatic/openapi-spec.js +1 -0
- package/lib/programmatic/request-timeout.js +3 -0
- package/lib/programmatic/route-handler-map.js +7 -0
- package/lib/programmatic/run-channel-catalog.js +50 -8
- package/lib/programmatic/run-channel-install-options.js +5 -1
- package/lib/programmatic/run-download.js +41 -0
- package/lib/protection/auth-context.js +3 -1
- package/lib/protection/protection-display.js +3 -2
- package/lib/protection/report-exit.js +50 -0
- package/lib/protection/run-commands.js +2 -0
- package/lib/role-assistant/knowledge-sync-settings-push.js +172 -0
- package/lib/role-assistant/knowledge-sync.js +9 -126
- package/lib/role-assistant/package-validate.js +175 -0
- package/lib/role-assistant/test-case-assertion-row.js +36 -0
- package/lib/role-assistant/test-case-copy-bind.js +77 -0
- package/lib/role-assistant/test-case-copy-expected.js +127 -0
- package/lib/role-assistant/test-case-copy-from-work.js +90 -0
- package/lib/role-assistant/test-case-copy-interactions.js +67 -0
- package/lib/role-assistant/test-case-copy.js +119 -0
- package/lib/role-assistant/test-case-expected-catalog.js +135 -0
- package/lib/role-assistant/test-case-validate.js +88 -0
- package/lib/role-assistant/test-cases-bid.js +117 -4
- package/lib/role-assistant/test-cases-evaluate.js +149 -31
- package/lib/role-assistant/test-cases-evidence.js +44 -5
- package/lib/role-assistant/test-cases-honesty.js +155 -6
- package/lib/role-assistant/test-cases-lifecycle.js +297 -0
- package/lib/role-assistant/test-cases-search-graph.js +122 -0
- package/lib/role-assistant/test-cases-search.js +20 -2
- package/lib/role-assistant/test-cases.js +34 -168
- package/lib/role-assistant/test-pack-map.js +180 -0
- package/lib/role-assistant/test-pack-sync.js +187 -0
- package/lib/role-assistant/test-runner-debug.js +54 -0
- package/lib/role-assistant/test-runner-respond-body.js +36 -0
- package/lib/role-assistant/test-runner-search.js +20 -5
- package/lib/role-assistant/test-runner-start-payload.js +63 -10
- package/lib/role-assistant/test-runner-workhub-answers.js +45 -16
- package/lib/role-assistant/test-runner-workhub.js +45 -21
- package/lib/role-assistant/test-runner.js +53 -10
- package/lib/schema/external-datasource.schema.json +36 -5
- package/lib/schema/external-system.schema.json +20 -2
- package/lib/schema/infra-parameter.schema.json +51 -3
- package/lib/schema/infra.parameter.yaml +476 -40
- package/lib/schema/role-assistant-test-case.schema.json +408 -0
- package/lib/schema/type/document-storage.json +1 -1
- package/lib/search/dataplane-context.js +23 -0
- package/lib/search/search-args.js +211 -0
- package/lib/search/search-display.js +238 -0
- package/lib/search/search-errors.js +50 -0
- package/lib/search/search-prompts.js +119 -0
- package/lib/search/search-roles.js +85 -0
- package/lib/search/search-run.js +241 -0
- package/lib/search/search-skills.js +198 -0
- package/lib/utils/api-required-permissions.js +271 -0
- package/lib/utils/api.js +16 -13
- package/lib/utils/authentication-slot-show.js +153 -0
- package/lib/utils/cli-json-exit.js +41 -0
- package/lib/utils/cli-utils.js +23 -5
- package/lib/utils/controller-url.js +78 -4
- package/lib/utils/credential-display.js +43 -1
- package/lib/utils/deployment-errors.js +15 -0
- package/lib/utils/deployment-validation-helpers.js +4 -1
- package/lib/utils/device-code.js +31 -10
- package/lib/utils/error-formatters/error-parser.js +16 -1
- package/lib/utils/error-formatters/permission-errors.js +19 -5
- package/lib/utils/external-system-readiness-compact-blocks.js +5 -1
- package/lib/utils/external-system-readiness-compact-display.js +30 -1
- package/lib/utils/external-system-validators.js +2 -1
- package/lib/utils/help-builder.js +3 -1
- package/lib/utils/keycloak-realm-ready.js +5 -2
- package/lib/utils/logger.js +1 -0
- package/lib/utils/paths.js +26 -5
- package/lib/utils/schema-loader.js +37 -0
- package/lib/utils/secrets-helpers.js +2 -2
- package/lib/utils/write-stream-and-wait.js +63 -0
- package/lib/validation/validate-external-file.js +5 -1
- package/lib/validation/validate.js +3 -2
- package/package.json +20 -6
- package/templates/agent-kit/adapters/claude/nested.CLAUDE.md +1 -0
- package/templates/agent-kit/adapters/claude/root.CLAUDE.md +5 -0
- package/templates/agent-kit/adapters/cursor/commands/cust-0-plan.md +5 -0
- package/templates/agent-kit/adapters/cursor/commands/cust-1-validate.md +5 -0
- package/templates/agent-kit/adapters/cursor/commands/cust-2-build.md +5 -0
- package/templates/agent-kit/adapters/cursor/commands/cust-3-push.md +5 -0
- package/templates/agent-kit/adapters/cursor/commands/cust-biz-1-validate.md +5 -0
- package/templates/agent-kit/adapters/cursor/commands/cust-biz-2-build.md +5 -0
- package/templates/agent-kit/adapters/cursor/commands/cust-biz-3-prove.md +5 -0
- package/templates/agent-kit/agent-kit.yaml +45 -0
- package/templates/agent-kit/instructions/AGENTKIT.md +104 -0
- package/templates/agent-kit/instructions/integration.AGENTS.md +25 -0
- package/templates/agent-kit/instructions/role-assistant.AGENTS.md +22 -0
- package/templates/agent-kit/instructions/root.AGENTS.md +37 -0
- package/templates/agent-kit/parity-inventory.yaml +188 -0
- package/templates/agent-kit/skills/aifabrix-connected-system/SKILL.md +59 -0
- package/templates/agent-kit/skills/aifabrix-connected-system/references/contract-checklist.md +40 -0
- package/templates/agent-kit/skills/aifabrix-connected-system/references/delivery-gates.md +54 -0
- package/templates/agent-kit/skills/aifabrix-connected-system/references/production-safety.md +35 -0
- package/templates/agent-kit/skills/aifabrix-connected-system/scripts/reserved-system-key.js +19 -0
- package/templates/agent-kit/skills/aifabrix-plan/SKILL.md +52 -0
- package/templates/agent-kit/skills/aifabrix-plan/references/challenge-checklist.md +108 -0
- package/templates/agent-kit/skills/aifabrix-plan/references/interaction.md +34 -0
- package/templates/agent-kit/skills/aifabrix-plan/references/plan-template.md +182 -0
- package/templates/agent-kit/skills/aifabrix-prove/SKILL.md +51 -0
- package/templates/agent-kit/skills/aifabrix-prove/references/demo-template.md +65 -0
- package/templates/agent-kit/skills/aifabrix-prove/references/evidence-lifecycle.md +68 -0
- package/templates/agent-kit/skills/aifabrix-prove/references/learning-template.md +66 -0
- package/templates/agent-kit/skills/aifabrix-role-assistant/SKILL.md +43 -0
- package/templates/agent-kit/skills/aifabrix-role-assistant/references/package-boundary.md +21 -0
- package/templates/agent-kit/skills/shared/hosts.md +65 -0
- package/templates/agent-kit/skills/shared/login.md +16 -0
- package/templates/agent-kit/workspace/.cursor/plans/README.md +22 -0
- package/templates/agent-kit/workspace/LICENSE.mit +21 -0
- package/templates/agent-kit/workspace/README.md +89 -0
- package/templates/applications/builder-api/Dockerfile +3 -1
- package/templates/applications/dataplane/application.yaml +2 -3
- package/templates/applications/dataplane/env.template +5 -5
- package/templates/applications/dataplane/rbac.yaml +28 -0
- package/templates/applications/keycloak/env.template +3 -3
- package/templates/applications/miso-controller/application.yaml +21 -2
- package/templates/applications/miso-controller/env.template +96 -25
- package/templates/applications/miso-controller/rbac.yaml +5 -0
- package/templates/channels/claude/TROUBLESHOOTING.md +3 -0
- package/templates/channels/claude/channel.json +1 -1
- package/templates/channels/claude/install.template.md.hbs +1 -0
- package/templates/channels/claude/integration/claude-system.json +1 -1
- package/templates/channels/slack/channel.json +11 -0
- package/templates/channels/slack/install.template.md.hbs +9 -0
- package/templates/channels/slack/integration/slack-system.json +11 -0
- package/templates/channels/slack/manifest.template.json.hbs +6 -3
- package/templates/channels/teams-bot/channel.json +1 -0
- package/templates/python/docker-compose.hbs +14 -0
- package/templates/typescript/docker-compose.hbs +14 -0
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Slackbot MCP Client packaging (opt-in). Auth freeze: manual_auth.
|
|
3
|
+
*
|
|
4
|
+
* @fileoverview Slack MCP manifest fields from discovery; HMAC path stays default
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
'use strict';
|
|
8
|
+
|
|
9
|
+
const SLACK_MCP_AUTH_TYPE = 'manual_auth';
|
|
10
|
+
const SLACK_MCP_AUTH_PROVIDER_KEY = 'mcp_aifabrix';
|
|
11
|
+
const SLACK_MCP_SERVER_KEY = 'runtime-orchestration';
|
|
12
|
+
const SLACK_MCP_CALLBACK_URI = 'https://oauth2.slack.com/external/auth/callback';
|
|
13
|
+
const SLACK_MCP_OAUTH_SCOPES = ['openid', 'profile', 'email', 'offline_access'];
|
|
14
|
+
const SLACK_MCP_CAPABILITY = 'customerOAuth';
|
|
15
|
+
const SLACK_MCP_MISSING_URL = 'Runtime MCP URL is missing.';
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* @param {string} [controllerUrl]
|
|
19
|
+
* @param {string} [mcpUrl]
|
|
20
|
+
* @param {string} [dataplaneBaseUrl]
|
|
21
|
+
* @returns {string}
|
|
22
|
+
*/
|
|
23
|
+
function authorizationServerBase(controllerUrl, mcpUrl, dataplaneBaseUrl) {
|
|
24
|
+
const candidate = controllerUrl || mcpUrl || dataplaneBaseUrl;
|
|
25
|
+
try {
|
|
26
|
+
return `${new URL(candidate).origin}/auth/realms/aifabrix`;
|
|
27
|
+
} catch {
|
|
28
|
+
return '';
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* @param {string} asBase
|
|
34
|
+
* @returns {{ authorizationUrl: string, tokenUrl: string }}
|
|
35
|
+
*/
|
|
36
|
+
function keycloakEndpoints(asBase) {
|
|
37
|
+
if (!asBase) {
|
|
38
|
+
return { authorizationUrl: '', tokenUrl: '' };
|
|
39
|
+
}
|
|
40
|
+
return {
|
|
41
|
+
authorizationUrl: `${asBase}/protocol/openid-connect/auth`,
|
|
42
|
+
tokenUrl: `${asBase}/protocol/openid-connect/token`
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* @param {Object} resolved
|
|
48
|
+
* @returns {void}
|
|
49
|
+
*/
|
|
50
|
+
function clearSlackMcpPackaging(resolved) {
|
|
51
|
+
resolved.slackMcpAuthType = '';
|
|
52
|
+
resolved.slackMcpAuthProviderKey = '';
|
|
53
|
+
resolved.slackMcpCallbackUri = '';
|
|
54
|
+
resolved.slackMcpCapability = '';
|
|
55
|
+
resolved.slackMcpServersJson = '';
|
|
56
|
+
resolved.slackExternalAuthJson = '';
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* @param {Object} resolved
|
|
61
|
+
* @returns {boolean}
|
|
62
|
+
*/
|
|
63
|
+
function selectsCustomerOAuth(resolved) {
|
|
64
|
+
const caps = resolved.discoveryAuthenticationCapabilities;
|
|
65
|
+
if (!Array.isArray(caps) || caps.length === 0) {
|
|
66
|
+
return true;
|
|
67
|
+
}
|
|
68
|
+
return caps.includes(SLACK_MCP_CAPABILITY);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* @param {Object} resolved
|
|
73
|
+
* @param {Object} params
|
|
74
|
+
* @param {string} mcpUrl
|
|
75
|
+
* @returns {Object}
|
|
76
|
+
*/
|
|
77
|
+
function buildExternalAuthProviders(resolved, params, mcpUrl) {
|
|
78
|
+
const asBase = authorizationServerBase(
|
|
79
|
+
params && params.controllerUrl,
|
|
80
|
+
mcpUrl,
|
|
81
|
+
resolved.dataplaneBaseUrl
|
|
82
|
+
);
|
|
83
|
+
const endpoints = keycloakEndpoints(asBase);
|
|
84
|
+
const provider = {
|
|
85
|
+
authorization_url: endpoints.authorizationUrl,
|
|
86
|
+
token_url: endpoints.tokenUrl,
|
|
87
|
+
scope: SLACK_MCP_OAUTH_SCOPES,
|
|
88
|
+
use_pkce: true,
|
|
89
|
+
identity_config: null
|
|
90
|
+
};
|
|
91
|
+
const clientId =
|
|
92
|
+
typeof resolved.slackMcpClientId === 'string' ? resolved.slackMcpClientId.trim() : '';
|
|
93
|
+
if (clientId) {
|
|
94
|
+
provider.client_id = clientId;
|
|
95
|
+
}
|
|
96
|
+
return { oauth2: { [SLACK_MCP_AUTH_PROVIDER_KEY]: provider } };
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* @param {Object} resolved
|
|
101
|
+
* @param {Object} [params]
|
|
102
|
+
* @returns {void}
|
|
103
|
+
*/
|
|
104
|
+
function applySlackMcpRuntimeValues(resolved, params) {
|
|
105
|
+
if (!resolved.enableMcpServer) {
|
|
106
|
+
clearSlackMcpPackaging(resolved);
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
const mcpUrl = typeof resolved.mcpUrl === 'string' ? resolved.mcpUrl.trim() : '';
|
|
110
|
+
if (!mcpUrl) {
|
|
111
|
+
throw new Error(SLACK_MCP_MISSING_URL);
|
|
112
|
+
}
|
|
113
|
+
if (!selectsCustomerOAuth(resolved)) {
|
|
114
|
+
throw new Error('Slack MCP requires customerOAuth on Runtime discovery.');
|
|
115
|
+
}
|
|
116
|
+
resolved.slackMcpAuthType = SLACK_MCP_AUTH_TYPE;
|
|
117
|
+
resolved.slackMcpAuthProviderKey = SLACK_MCP_AUTH_PROVIDER_KEY;
|
|
118
|
+
resolved.slackMcpCallbackUri = SLACK_MCP_CALLBACK_URI;
|
|
119
|
+
resolved.slackMcpCapability = SLACK_MCP_CAPABILITY;
|
|
120
|
+
resolved.slackMcpServersJson = JSON.stringify({
|
|
121
|
+
[SLACK_MCP_SERVER_KEY]: {
|
|
122
|
+
url: mcpUrl,
|
|
123
|
+
auth_type: SLACK_MCP_AUTH_TYPE,
|
|
124
|
+
auth_provider_key: SLACK_MCP_AUTH_PROVIDER_KEY
|
|
125
|
+
}
|
|
126
|
+
});
|
|
127
|
+
resolved.slackExternalAuthJson = JSON.stringify(
|
|
128
|
+
buildExternalAuthProviders(resolved, params || {}, mcpUrl)
|
|
129
|
+
);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* @param {Object} [runtimeValues]
|
|
134
|
+
* @returns {string[]}
|
|
135
|
+
*/
|
|
136
|
+
function slackMcpRemainingSteps(runtimeValues) {
|
|
137
|
+
if (!runtimeValues || !runtimeValues.enableMcpServer) {
|
|
138
|
+
return [];
|
|
139
|
+
}
|
|
140
|
+
return [
|
|
141
|
+
'Connect the AI Fabrix MCP server in Slack',
|
|
142
|
+
'Complete sign-in at AI Fabrix when Slack asks'
|
|
143
|
+
];
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
module.exports = {
|
|
147
|
+
SLACK_MCP_AUTH_TYPE,
|
|
148
|
+
SLACK_MCP_AUTH_PROVIDER_KEY,
|
|
149
|
+
SLACK_MCP_SERVER_KEY,
|
|
150
|
+
SLACK_MCP_CALLBACK_URI,
|
|
151
|
+
SLACK_MCP_OAUTH_SCOPES,
|
|
152
|
+
SLACK_MCP_CAPABILITY,
|
|
153
|
+
SLACK_MCP_MISSING_URL,
|
|
154
|
+
applySlackMcpRuntimeValues,
|
|
155
|
+
slackMcpRemainingSteps
|
|
156
|
+
};
|
|
@@ -179,6 +179,19 @@ function fetchHttpsText(url, redirects = 0) {
|
|
|
179
179
|
});
|
|
180
180
|
}
|
|
181
181
|
|
|
182
|
+
/**
|
|
183
|
+
* Drop Node's version footer; prefer an Error: line when present.
|
|
184
|
+
* @param {string} text
|
|
185
|
+
* @returns {string}
|
|
186
|
+
*/
|
|
187
|
+
function lastUsefulInstallLine(text) {
|
|
188
|
+
const lines = text.split('\n').map((line) => line.trim()).filter(Boolean);
|
|
189
|
+
const withoutNode = lines.filter((line) => !/^Node\.js v\d/i.test(line));
|
|
190
|
+
const pool = withoutNode.length ? withoutNode : lines;
|
|
191
|
+
const errorLine = [...pool].reverse().find((line) => /^Error:/i.test(line));
|
|
192
|
+
return errorLine || pool[pool.length - 1] || '';
|
|
193
|
+
}
|
|
194
|
+
|
|
182
195
|
/**
|
|
183
196
|
* Prefer child stderr over Node's "Command failed: bash /tmp/…" wrapper.
|
|
184
197
|
* @param {unknown} error
|
|
@@ -190,8 +203,7 @@ function slackCliInstallFailureMessage(error) {
|
|
|
190
203
|
const raw = error && error.message ? String(error.message) : '';
|
|
191
204
|
const fromChild = stderr || stdout;
|
|
192
205
|
if (fromChild) {
|
|
193
|
-
|
|
194
|
-
return lines[lines.length - 1] || fromChild;
|
|
206
|
+
return lastUsefulInstallLine(fromChild) || fromChild;
|
|
195
207
|
}
|
|
196
208
|
const stripped = raw.replace(/^Command failed: bash \S+\s*/i, '').trim();
|
|
197
209
|
return stripped || 'Slack CLI install failed.';
|
|
@@ -22,7 +22,12 @@ async function curlExists(env) {
|
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
function writeCurlShim(dir) {
|
|
25
|
-
const
|
|
25
|
+
const source = path.join(__dirname, 'curl-shim.js');
|
|
26
|
+
if (!fs.existsSync(source)) {
|
|
27
|
+
throw new Error(`Slack CLI curl shim missing: ${source}`);
|
|
28
|
+
}
|
|
29
|
+
const runtime = path.join(dir, 'curl-shim.js');
|
|
30
|
+
fs.copyFileSync(source, runtime);
|
|
26
31
|
const wrapper = `#!/bin/sh\nexec "${process.execPath}" "${runtime}" "$@"\n`;
|
|
27
32
|
fs.writeFileSync(path.join(dir, 'curl'), wrapper, { mode: 0o755 });
|
|
28
33
|
}
|
package/lib/cli/index.js
CHANGED
|
@@ -25,9 +25,11 @@ const { setupDimensionCommands } = require('../commands/dimension');
|
|
|
25
25
|
const { setupResourceTypeCommands } = require('../commands/resource-type');
|
|
26
26
|
const { setupRoleCommands } = require('../commands/role');
|
|
27
27
|
const { setupRoleAssistantCommands } = require('../commands/role-assistant');
|
|
28
|
+
const { setupSearchCommands } = require('../commands/search');
|
|
28
29
|
const { setupEvidenceKindCommands } = require('../commands/evidence-kind');
|
|
29
30
|
const { setupEnterpriseKnowledgeCommands } = require('../commands/enterprise-knowledge');
|
|
30
31
|
const { setupIdentityCommands } = require('../commands/identity');
|
|
32
|
+
const { setupAgentKitCommands } = require('../commands/agent-kit');
|
|
31
33
|
const { setupProtectionCommands } = require('../commands/protection');
|
|
32
34
|
const { setupEvidenceCommands } = require('../commands/evidence');
|
|
33
35
|
const { setupCredentialDeploymentCommands } = require('./setup-credential-deployment');
|
|
@@ -80,9 +82,11 @@ function setupExtendedCliCommands(program) {
|
|
|
80
82
|
setupResourceTypeCommands(program);
|
|
81
83
|
setupRoleCommands(program);
|
|
82
84
|
setupRoleAssistantCommands(program);
|
|
85
|
+
setupSearchCommands(program);
|
|
83
86
|
setupEvidenceKindCommands(program);
|
|
84
87
|
setupEnterpriseKnowledgeCommands(program);
|
|
85
88
|
setupIdentityCommands(program);
|
|
89
|
+
setupAgentKitCommands(program);
|
|
86
90
|
setupProtectionCommands(program);
|
|
87
91
|
setupEvidenceCommands(program);
|
|
88
92
|
setupUtilityCommands(program);
|
package/lib/cli/setup-app.js
CHANGED
|
@@ -39,6 +39,10 @@ Examples:
|
|
|
39
39
|
$ aifabrix deploy myapp
|
|
40
40
|
$ aifabrix deploy myapp --local
|
|
41
41
|
|
|
42
|
+
# Missing local app that matches a shipped template (TTY asks to create)
|
|
43
|
+
$ aifabrix deploy dataplane
|
|
44
|
+
$ aifabrix deploy dataplane --yes
|
|
45
|
+
|
|
42
46
|
# Local — external system (integration/<systemKey>/); manifest regenerated on deploy
|
|
43
47
|
$ aifabrix deploy hubspot-demo
|
|
44
48
|
$ aifabrix deploy hubspot-demo --local
|
|
@@ -69,6 +73,7 @@ Notes:
|
|
|
69
73
|
- Default output is a compact status card; use -v for expanded preflight and readiness detail.
|
|
70
74
|
- Controller deploy always polls to a terminal status (no --poll / --no-poll on this command).
|
|
71
75
|
- --repository-url overrides repo URL for pipeline validate (default: application.yaml repository.repositoryUrl).
|
|
76
|
+
- If the app is missing locally and the name matches a shipped template, TTY asks to create it (use --yes in scripts).
|
|
72
77
|
`;
|
|
73
78
|
|
|
74
79
|
const PUSH_HELP_AFTER = `
|
|
@@ -367,6 +372,7 @@ function setupDeployCommand(program) {
|
|
|
367
372
|
'--subject-email <emails>',
|
|
368
373
|
'Subject email(s) for governance gate (comma-separated; used with --gate governance|full)'
|
|
369
374
|
)
|
|
375
|
+
.option('-y, --yes', 'Create a missing app from a matching shipped template without prompting')
|
|
370
376
|
.action(async(appName, options) => {
|
|
371
377
|
try {
|
|
372
378
|
const probeTimeout =
|
|
@@ -381,8 +387,9 @@ function setupDeployCommand(program) {
|
|
|
381
387
|
};
|
|
382
388
|
const outcome = await app.deployApp(appName, opts);
|
|
383
389
|
if (opts.local && outcome) {
|
|
390
|
+
const targetApp = outcome.appKey || appName;
|
|
384
391
|
if (outcome.usedExternalDeploy) await app.restartApp('dataplane');
|
|
385
|
-
else await app.runApp(
|
|
392
|
+
else await app.runApp(targetApp, opts);
|
|
386
393
|
}
|
|
387
394
|
} catch (error) {
|
|
388
395
|
handleCommandError(error, 'deploy');
|
package/lib/cli/setup-auth.js
CHANGED
|
@@ -17,7 +17,12 @@ const { handleAuthConfig } = require('../commands/auth-config');
|
|
|
17
17
|
const LOGIN_HELP_AFTER = `
|
|
18
18
|
Examples:
|
|
19
19
|
$ aifabrix login
|
|
20
|
+
$ aifabrix login -c https://controller.example.com
|
|
20
21
|
$ aifabrix login -m credentials -a myapp -e dev
|
|
22
|
+
|
|
23
|
+
Notes:
|
|
24
|
+
- Public controller URLs are stored as origin + /miso (extra path segments are ignored).
|
|
25
|
+
- Localhost URLs keep the origin unless the path is already /miso.
|
|
21
26
|
`;
|
|
22
27
|
|
|
23
28
|
const AUTH_HELP_AFTER = `
|
|
@@ -34,12 +39,15 @@ Subcommand: auth status [--validate] for CI/scripts (exit codes 0/1/3).
|
|
|
34
39
|
const LOGOUT_HELP_AFTER = `
|
|
35
40
|
Examples:
|
|
36
41
|
$ aifabrix logout
|
|
42
|
+
$ aifabrix logout --type client
|
|
43
|
+
$ aifabrix logout --type device
|
|
37
44
|
$ aifabrix logout -c http://localhost:3600
|
|
38
45
|
$ aifabrix logout -e dev
|
|
39
46
|
$ aifabrix logout -e dev -a hubspot-e2e
|
|
40
47
|
|
|
41
48
|
Notes:
|
|
42
49
|
- With no flags: clears all device tokens and all client tokens in config.yaml.
|
|
50
|
+
- Use --type client or --type device to clear only that token type.
|
|
43
51
|
- Device tokens are keyed by controller URL (-c).
|
|
44
52
|
- Client tokens are per environment and app (-e and optional -a).
|
|
45
53
|
- Run aifabrix auth status to list stored app tokens and copy-paste logout commands.
|
|
@@ -164,7 +172,7 @@ function setupLoginCommand(program) {
|
|
|
164
172
|
program.command('login')
|
|
165
173
|
.description('Sign in to Miso Controller (device or credentials flow)')
|
|
166
174
|
.addHelpText('after', LOGIN_HELP_AFTER)
|
|
167
|
-
.option('-c, --controller <url>', 'Controller URL (default:
|
|
175
|
+
.option('-c, --controller <url>', 'Controller URL (public hosts use origin + /miso; default: config or localhost by developer ID)')
|
|
168
176
|
.option('-m, --method <method>', 'Authentication method (device|credentials)', 'device')
|
|
169
177
|
.option('-a, --app <app>', 'Application name (required for credentials method, reads from secrets.local.yaml)')
|
|
170
178
|
.option('--client-id <id>', 'Client ID (for credentials method, overrides secrets.local.yaml)')
|
|
@@ -188,7 +196,8 @@ function setupLoginCommand(program) {
|
|
|
188
196
|
|
|
189
197
|
function setupLogoutCommand(program) {
|
|
190
198
|
program.command('logout')
|
|
191
|
-
.description('Clear stored tokens (optional filter by controller/env/app)')
|
|
199
|
+
.description('Clear stored tokens (optional filter by type/controller/env/app)')
|
|
200
|
+
.option('-t, --type <type>', 'Clear only one token type (device|client)')
|
|
192
201
|
.option('-c, --controller <url>', 'Clear device tokens for specific controller')
|
|
193
202
|
.option('-e, --environment <env>', 'Clear client tokens for specific environment')
|
|
194
203
|
.option('-a, --app <app>', 'Clear client tokens for specific app (requires --environment)')
|
|
@@ -20,7 +20,7 @@ function setupVerifyOperationsCommand(program) {
|
|
|
20
20
|
.option('-e, --env <env>', 'Environment: dev, tst, or pro', 'dev')
|
|
21
21
|
.option('-v, --verbose', 'Readiness breakdown and verification step checklist')
|
|
22
22
|
.option('-d, --debug', 'Write debug logs under integration/<systemKey>/logs/')
|
|
23
|
-
.option('--no-publish', 'Skip
|
|
23
|
+
.option('--no-publish', 'Skip uploading local files (verify-operations does not upload by default)')
|
|
24
24
|
.option(
|
|
25
25
|
'--force',
|
|
26
26
|
'With default sync, pass force to upload (same as aifabrix upload --force)'
|
|
@@ -39,7 +39,7 @@ function setupVerifyTrustCommand(program) {
|
|
|
39
39
|
.option('-e, --env <env>', 'Environment: dev, tst, or pro', 'dev')
|
|
40
40
|
.option('-v, --verbose', 'Per-datasource breakdown')
|
|
41
41
|
.option('-d, --debug', 'Write debug log under integration/<systemKey>/logs/')
|
|
42
|
-
.option('--no-publish', 'Skip
|
|
42
|
+
.option('--no-publish', 'Skip uploading local files (verify-trust does not upload by default)')
|
|
43
43
|
.option(
|
|
44
44
|
'--force',
|
|
45
45
|
'With default sync, pass force to upload (same as aifabrix upload --force)'
|
|
@@ -12,6 +12,8 @@ Examples:
|
|
|
12
12
|
|
|
13
13
|
Notes:
|
|
14
14
|
- Orchestrates validate → test → test-integration → test-e2e for the system.
|
|
15
|
+
- Does not upload. Upload is not publish; run aifabrix deploy to publish.
|
|
16
|
+
- Static custom packages (syncBridge disabled) skip live E2E (not FAILED).
|
|
15
17
|
- Default output shows Operational Readiness % and OPERATIONS VERIFIED/FAILED only.
|
|
16
18
|
- -v / --verbose adds readiness breakdown and verification step checklist at the end.
|
|
17
19
|
- -v does not enable upload sidecar logs or inner E2E poll spinners (use aifabrix upload -v for upload detail).
|
|
@@ -28,7 +30,7 @@ Examples:
|
|
|
28
30
|
Notes:
|
|
29
31
|
- For one datasource: aifabrix datasource verify-trust <datasourceKey>
|
|
30
32
|
- Does not call external vendor APIs (use verify-operations / test-e2e for connectivity).
|
|
31
|
-
-
|
|
33
|
+
- Does not upload. Upload is not publish; run aifabrix deploy to publish.
|
|
32
34
|
`;
|
|
33
35
|
|
|
34
36
|
const VERIFY_GOVERNANCE_HELP_AFTER = `
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Help text for `aifabrix agent-kit` leaves.
|
|
3
|
+
* @fileoverview Per-command examples so update -h is not install-centric
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
'use strict';
|
|
7
|
+
|
|
8
|
+
const HOST_OPTION_HELP =
|
|
9
|
+
'Coding hosts to activate: all, cursor, claude, or codex (one name = that host only)';
|
|
10
|
+
|
|
11
|
+
const APPROVE_ALL_OPTION_HELP =
|
|
12
|
+
'Auto-approve tools for all, claude, or codex (omit value = every selected host)';
|
|
13
|
+
|
|
14
|
+
const GROUP_HELP = `
|
|
15
|
+
Coding hosts (--host) are Cursor, Claude Code, and/or Codex in this workspace.
|
|
16
|
+
GitHub remotes are a separate command (agent-kit remote create).
|
|
17
|
+
|
|
18
|
+
Examples:
|
|
19
|
+
$ aifabrix agent-kit init cust-demo --host all --approve-all --yes
|
|
20
|
+
$ aifabrix agent-kit install --host claude --approve-all --yes
|
|
21
|
+
$ aifabrix agent-kit install --host all --approve-all claude --yes
|
|
22
|
+
$ aifabrix agent-kit update --host all --approve-all --yes
|
|
23
|
+
$ aifabrix agent-kit remote create --org my-org --yes
|
|
24
|
+
$ aifabrix agent-kit start claude --remote-control --approve-all --yes
|
|
25
|
+
$ aifabrix agent-kit start claude --name aifabrix-docs --remote-control --approve-all --yes
|
|
26
|
+
$ aifabrix agent-kit start codex --approve-all --yes
|
|
27
|
+
$ aifabrix agent-kit status
|
|
28
|
+
$ aifabrix agent-kit validate
|
|
29
|
+
`;
|
|
30
|
+
|
|
31
|
+
const INSTALL_HELP = `
|
|
32
|
+
--host chooses which coding apps this repo supports (default all).
|
|
33
|
+
Use one name to activate only that host. --approve-all [claude|codex] writes
|
|
34
|
+
auto-approve configs for that host's tools only.
|
|
35
|
+
|
|
36
|
+
Examples:
|
|
37
|
+
$ aifabrix agent-kit install
|
|
38
|
+
$ aifabrix agent-kit install --host all --approve-all --yes
|
|
39
|
+
$ aifabrix agent-kit install --host claude --approve-all --yes
|
|
40
|
+
$ aifabrix agent-kit install --host codex --approve-all --yes
|
|
41
|
+
$ aifabrix agent-kit install --host all --approve-all claude --yes
|
|
42
|
+
$ aifabrix agent-kit install --skip-approve-all
|
|
43
|
+
$ aifabrix agent-kit install --dry-run
|
|
44
|
+
|
|
45
|
+
TTY asks which hosts to support (omit --host) and which tools to auto-approve.
|
|
46
|
+
Silent: --host <name> --approve-all [claude|codex] --yes. Skip: --skip-approve-all.
|
|
47
|
+
Start without installing skills: aifabrix agent-kit start claude
|
|
48
|
+
`;
|
|
49
|
+
|
|
50
|
+
const STATUS_HELP = `
|
|
51
|
+
Examples:
|
|
52
|
+
$ aifabrix agent-kit status
|
|
53
|
+
$ aifabrix agent-kit status --json
|
|
54
|
+
`;
|
|
55
|
+
|
|
56
|
+
const UPDATE_HELP = `
|
|
57
|
+
Examples:
|
|
58
|
+
$ aifabrix agent-kit update
|
|
59
|
+
$ aifabrix agent-kit update --host all --approve-all --yes
|
|
60
|
+
$ aifabrix agent-kit update --host claude --force
|
|
61
|
+
$ aifabrix agent-kit update --host all --approve-all claude --yes
|
|
62
|
+
$ aifabrix agent-kit update --dry-run
|
|
63
|
+
|
|
64
|
+
Omit --host to keep the coding hosts already recorded. Pass --host claude or
|
|
65
|
+
--host codex to activate only that host. --approve-all claude writes Claude
|
|
66
|
+
Code tool auto-approve only.
|
|
67
|
+
`;
|
|
68
|
+
|
|
69
|
+
const VALIDATE_HELP = `
|
|
70
|
+
Examples:
|
|
71
|
+
$ aifabrix agent-kit validate
|
|
72
|
+
$ aifabrix agent-kit validate --json
|
|
73
|
+
`;
|
|
74
|
+
|
|
75
|
+
const INIT_HELP = `
|
|
76
|
+
--host chooses Cursor, Claude Code, and/or Codex for the new workspace.
|
|
77
|
+
GitHub (origin + push) is --remote / agent-kit remote create — not --host.
|
|
78
|
+
|
|
79
|
+
Examples:
|
|
80
|
+
$ aifabrix agent-kit init cust-demo
|
|
81
|
+
$ aifabrix agent-kit init cust-demo --host all --approve-all --yes
|
|
82
|
+
$ aifabrix agent-kit init cust-demo --host claude --approve-all --yes
|
|
83
|
+
$ aifabrix agent-kit init cust-demo --host all --approve-all claude --yes
|
|
84
|
+
$ aifabrix agent-kit init cust-demo --host all --remote --org my-org --yes
|
|
85
|
+
$ aifabrix agent-kit init ./path/to/cust-demo --dry-run --json
|
|
86
|
+
|
|
87
|
+
Interactive (TTY): omit --host / --yes to be prompted.
|
|
88
|
+
Silent local: --host all --approve-all --yes
|
|
89
|
+
Silent one host: --host claude --approve-all --yes
|
|
90
|
+
Silent remote: --host all --remote --org <owner> --yes
|
|
91
|
+
`;
|
|
92
|
+
|
|
93
|
+
const REMOTE_GROUP_HELP = `
|
|
94
|
+
This is GitHub only: create origin and push this workspace.
|
|
95
|
+
It does not choose Cursor, Claude Code, or Codex.
|
|
96
|
+
|
|
97
|
+
Examples:
|
|
98
|
+
$ aifabrix agent-kit remote create
|
|
99
|
+
$ aifabrix agent-kit remote create --org my-org --yes
|
|
100
|
+
$ aifabrix agent-kit install --host claude --approve-all --yes
|
|
101
|
+
$ aifabrix agent-kit install --host codex --approve-all --yes
|
|
102
|
+
$ aifabrix agent-kit install --host all --approve-all claude --yes
|
|
103
|
+
`;
|
|
104
|
+
|
|
105
|
+
const REMOTE_HELP = `
|
|
106
|
+
Creates a GitHub repository (origin) and pushes this workspace.
|
|
107
|
+
Not coding-host selection — use --host on install/update for Claude or Codex.
|
|
108
|
+
|
|
109
|
+
Examples:
|
|
110
|
+
$ cd cust-demo && aifabrix agent-kit remote create
|
|
111
|
+
$ aifabrix agent-kit remote create --org my-org --yes
|
|
112
|
+
$ aifabrix agent-kit remote create --org my-org --dry-run --json
|
|
113
|
+
|
|
114
|
+
Interactive (TTY): omit flags to be prompted. Silent: --org <owner> --yes
|
|
115
|
+
`;
|
|
116
|
+
|
|
117
|
+
const START_HELP = `
|
|
118
|
+
Does not install Agent Kit skills. Starts claude or codex in tmux in this git
|
|
119
|
+
workspace so closing the terminal does not kill the session. Detach: Ctrl-b then
|
|
120
|
+
d. --approve-all writes that app's local permission config only. --name is the
|
|
121
|
+
tmux session (default: last folder, e.g. aifabrix-docs). Claude also gets
|
|
122
|
+
--name and --remote-control hostname-user-folder, e.g.
|
|
123
|
+
builder01-dev03-aifabrix-docs. Claude --tmux is for worktrees, not this wrapper.
|
|
124
|
+
That is not Claude --cloud (a separate cloud VM). Codex has no phone/web attach.
|
|
125
|
+
|
|
126
|
+
Examples:
|
|
127
|
+
$ aifabrix agent-kit start claude --remote-control --approve-all --yes
|
|
128
|
+
$ aifabrix agent-kit start claude --name aifabrix-docs --remote-control --approve-all --yes
|
|
129
|
+
$ aifabrix agent-kit start claude --name aifabrix-miso --remote-control --approve-all --yes
|
|
130
|
+
$ aifabrix agent-kit start claude --remote-control --detach
|
|
131
|
+
$ aifabrix agent-kit start claude
|
|
132
|
+
$ aifabrix agent-kit start claude --approve-all --yes
|
|
133
|
+
$ aifabrix agent-kit start codex --approve-all --yes
|
|
134
|
+
$ aifabrix agent-kit start claude --dry-run --json
|
|
135
|
+
`;
|
|
136
|
+
|
|
137
|
+
module.exports = {
|
|
138
|
+
HOST_OPTION_HELP,
|
|
139
|
+
APPROVE_ALL_OPTION_HELP,
|
|
140
|
+
GROUP_HELP,
|
|
141
|
+
INSTALL_HELP,
|
|
142
|
+
STATUS_HELP,
|
|
143
|
+
UPDATE_HELP,
|
|
144
|
+
VALIDATE_HELP,
|
|
145
|
+
INIT_HELP,
|
|
146
|
+
REMOTE_GROUP_HELP,
|
|
147
|
+
REMOTE_HELP,
|
|
148
|
+
START_HELP
|
|
149
|
+
};
|