Skip to content

Commit 01e6af6

Browse files
feat(messaging): Setup lists the Slack page where connector-slack is composed (Part of #34730) (#35973)
<!-- claude-projects-attribution: {"github_login":"os-elon-musk"} --> _Requested by **Elon** · [project thread](https://claude.ai/code/project/chan_01WedDzV26nniwxv7jC88B9D?thread=cmsg_01WedDzV26nniwxv7jC88B9D62xGLMbyWJaMEVnAMEjTK1)_ Part of #34730 Clause-②: no Metadata-protocol: none ## 维护者速读 - 用户能看到什么变化:在接入了 Slack 连接器的部署上,组织管理员在“设置 › 集成”菜单里多了一个“Slack”入口,点开就是上一张界面改动做好的 Slack 管理页;没有接入 Slack 的部署菜单不变。 - 为什么做:这是「Slack 私信通知」专题第三步的服务端一半,补上管理页的菜单入口,同时补写上一步欠下的一句更新说明。 - 出错会怎样:最坏是入口不出现或排在别的位置,管理页本身仍可用地址直接打开;改动只加一个菜单项,可以直接撤回。 - 要你做什么:无。 ## What changes Step 3 of #34730, server half: Setup's menu entry for the Slack page that PR #35968 adds (component `messaging:slack`, gated by `setup.write`, today reachable only at `/apps/setup/component/messaging/slack`). This PR was written in session `session_016WV4czKnDE6hsyXQzB9wB2`. - **The entry** (`service-messaging/src/slack-setup-ui.ts`): `SLACK_SETUP_UI_BUNDLE` contributes Setup › Integrations (`group_integrations`) › **Slack**, `type: 'component'`, `componentRef: 'messaging:slack'`, `requiredPermissions: ['setup.write']` (the `SLACK_ADMIN_CAPABILITY` every Slack administrator door asks), priority 140: after Connector Credentials / Connector Connections (120), before Cloud Connection (200). The shape copies `CONNECTOR_CREDENTIALS_UI_BUNDLE` in service-automation. - **Registered only where the slack channel registers**: `MessagingServicePlugin` registers the bundle through the `manifest` service inside the same `kernel:ready` hook as the `slack` channel, after the same `if (!getSlack()) return;`. Without connector-slack, no entry. A composition with no `manifest` service gets no entry and still boots (the pattern's try/catch). - **Nav label i18n, the pattern's way**: `apps.setup.navigation.nav_slack.label` = `Slack` (the product name, kept verbatim as `Webhooks` is in `zh-CN`) in all eleven platform locales under `packages/platform-objects/src/apps/translations/`, with the source digest recorded in the seven locales that record one for the neighbouring `nav_connector_connections` (`c3c9e181e8c74b22`, computed with `hashSource`; control: `Connector Connections` reproduces the committed `949e9a8fd25c3d57`). - **Gates that judge the entry**: `packages/cli/scripts/check-app-nav-i18n.mjs` gains a roster row reading `SLACK_SETUP_UI_BUNDLE` (the `service-automation` row's shape, since the bundle registers at `kernel:ready`), so the label is judged in every locale; `packages/cli/test/setup-integrations-order.pin.test.ts` orders it as its own tier. `packages/cli/vitest.config.ts` resolves `@objectstack/service-messaging` to source (`check:test-source-alias` asked for it); `packages/services/service-messaging/vitest.config.ts` declares `OS_REGISTRY_LOG: 'warn'` (`check:registry-log-declared` asked for it, since the new pin folds a `SchemaRegistry`). - **Changeset** (`.changeset/34730-s3b-slack-setup-entry.md`, patch on service-messaging and platform-objects): the entry, plus the sentence owed from step 2: the topic `messaging.slack_link_removed` is listed by `GET /api/v1/messaging/preference-options` and `GET /api/v1/messaging/me/preferences` on every deployment, and is emitted only where connector-slack is composed (when an administrator removes a person's link or the organization's install). Read first: `messaging-service-plugin.ts` (the hook, the riskiest hunk: the registration must stay behind the slack guard), `slack-setup-ui.ts`, `slack-channel-composition.test.ts`. Two-minute check: `pnpm --filter @objectstack/service-messaging exec vitest run src/slack-channel-composition.test.ts` shows 5 passed, among them "with a slack service: the entry is registered once and served under Integrations" and "without a slack service: no entry is registered and Integrations serves none". ## Evals Base `523ada4cc0`; tests below at `fd50ed384d` / `60b28db358` (final head; the last commit only adds the cli alias). <details><summary>Pins: with and without connector-slack, through the Setup app fold</summary> The new top-level describe sits in the existing slack composition harness (`slack-channel-composition.test.ts`), whose `compose({ slack })` boots `MessagingServicePlugin` with and without connector-slack's `slack` service. The harness now records what the plugin registers with `manifest`, and each side folds those manifests into the Setup app the way the meta door serves it (`SchemaRegistry.registerApp(SETUP_APP)` + `setPackageNavContributions`, then `getApp('setup')`): - with slack: the bundle is registered exactly once, and `group_integrations` serves `nav_slack` with `componentRef: 'messaging:slack'` and `requiredPermissions: ['setup.write']`; - without slack (control): no bundle, no `nav_slack` in the served group, while the same boot registered the messaging manifest; - the bundle parses as a `ManifestSchema`, and `setup.write` is a declared org-scoped platform capability. `pnpm --filter @objectstack/service-messaging test` on `fd50ed384d`: `Test Files 79 passed (79)`, `Tests 1060 passed (1060)`, `VERDICT command-exit 0`. `pnpm --filter @objectstack/cli exec vitest run --project unit test/setup-integrations-order.pin.test.ts` on `60b28db358`: `Tests 1 passed (1)`. `pnpm --filter @objectstack/platform-objects exec vitest run src/apps/translations/`: `Test Files 26 passed (26)`, `Tests 587 passed (587)`. `node packages/cli/scripts/check-app-nav-i18n.mjs`: `OK (14 contributor(s), 11 locale(s), 2 app(s) — setup: 61 merged nav id(s), account: 15 merged nav id(s) — every id labelled in every locale)`; `--self-test` exit 0. </details> <details><summary>Ablations (all through scripts/ablation-replace.mjs, each restored to HEAD with git diff HEAD empty)</summary> - Registration removed (`...register(SLACK_SETUP_UI_BUNDLE);` replaced by a marker): anchor 1 to 0, blob `794db597159a` to `a5675d9a239f`; `Tests 1 failed | 4 passed (5)`, the failure being "with a slack service: the entry is registered once and served under Integrations". - Slack guard removed (`if (!getSlack()) return;`): anchor 1 to 0; `Tests 2 failed | 3 passed (5)`: both "without a slack service" cases, the step-2 channel pin and the new entry pin. - Priority 140 to 250: the cli order pin fails with `expected Set{ 'nav_cloud_connection' } to deeply equal Set{ 'nav_slack' }`. The messaging tests import the plugin by relative path (source), and the cli pin reaches source through the new alias, so no rebuild sits between mutation and run. </details> <details><summary>Type-check and gates</summary> - `pnpm --filter @objectstack/service-messaging typecheck && pnpm --filter @objectstack/platform-objects typecheck && pnpm --filter @objectstack/cli typecheck`: exit 0. - `node scripts/pm/dispatch-gates.mjs --commands` derived 77 commands on the final head `60b28db358`: all 77 exit 0, and `--ran` reconciles 77 of 77 with a derived zero NOT-MEASURED. First run (74 on `5380a29a6a`) was red on `check:registry-log-declared` and `check:test-source-alias` (fixed by the two vitest config entries above) and refused on a missing build for `check:i18n` and `check:dual-build-cjs-loads` (exit 3; green after building the closures they name). - `node scripts/pm/overlap-check.mjs --branch=claude/area-a4W-34730-s3b`: `VERDICT clean exit 0` (no open PR shares a file). - Not run locally, CI's: the whole `@objectstack/cli` unit layer (a two-worker local run passed 570 s without finishing and was stopped, so it is NOT MEASURED here; Test Core runs it). </details> ## Acceptance notes - File surface is wider than the claim amendment's `packages/services/service-messaging/src/**`: the order asks for nav label i18n "following the pattern", and the pattern's labels live in `packages/platform-objects/src/apps/translations/` and are judged by the cli roster gate and order pin, so those files, and the two vitest configs the gates asked for, ride here. No ui, spec or skills change. - `Metadata-protocol: none` measured: the entry adds no authorable key, value or metadata type; it is a navigation contribution a deployment without connector-slack never sees (it is not registered there). - The pin reads the entry through the registry fold the `/api/v1/meta/app` door serves, not through an HTTP request to that door; booting ObjectQL plus REST in service-messaging's suite would add a full engine boot for the same fold. https://claude.ai/code/session_016WV4czKnDE6hsyXQzB9wB2 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent 62daf7d commit 01e6af6

27 files changed

Lines changed: 188 additions & 5 deletions
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
'@objectstack/service-messaging': patch
3+
'@objectstack/platform-objects': patch
4+
---
5+
6+
Clause-②: no
7+
Metadata-protocol: none
8+
9+
feat(messaging): Setup lists the Slack page where connector-slack is composed
10+
11+
- **Setup › Integrations › Slack.** Where connector-slack is composed, Setup now lists a Slack entry under Integrations. It opens the console's Slack page (`messaging:slack`), where an organization administrator installs or replaces the organization's Slack token, removes the install, and reviews or removes each member's Slack link. The entry asks `setup.write`, the capability every Slack administrator door asks. `MessagingServicePlugin` registers it in the same `kernel:ready` hook, and on the same condition, as the `slack` channel. Without connector-slack, Setup lists no Slack entry. The label is translated in every locale the platform ships. The bundle is exported as `SLACK_SETUP_UI_BUNDLE`, with `SLACK_SETUP_COMPONENT_REF`.
12+
- **The Slack link removal topic, on every deployment.** `GET /api/v1/messaging/preference-options` and `GET /api/v1/messaging/me/preferences` list the topic `messaging.slack_link_removed` on every deployment, including one without connector-slack. It is emitted only where connector-slack is composed, when an administrator removes a person's Slack link or removes the organization's Slack install.

‎packages/cli/scripts/check-app-nav-i18n.mjs‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -465,6 +465,17 @@ const CONTRIBUTORS = [
465465
return { manifests: [CONNECTOR_CREDENTIALS_UI_BUNDLE] };
466466
},
467467
},
468+
{
469+
// `nav_slack` (Setup → Integrations). Registered by `MessagingServicePlugin`
470+
// at `kernel:ready`, and only where connector-slack's `slack` service
471+
// resolves, so the bundle is read directly — the row above's shape.
472+
source: '@objectstack/service-messaging (SLACK_SETUP_UI_BUNDLE)',
473+
apps: ['setup'],
474+
async load() {
475+
const { SLACK_SETUP_UI_BUNDLE } = await import('@objectstack/service-messaging');
476+
return { manifests: [SLACK_SETUP_UI_BUNDLE] };
477+
},
478+
},
468479
{
469480
source: '@objectstack/cloud-connection (cloud + marketplace UI bundles)',
470481
apps: ['setup'],

‎packages/cli/test/setup-integrations-order.pin.test.ts‎

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
// Datasources `@objectstack/service-datasource`
1515
// Connector Credentials `@objectstack/service-automation`
1616
// Connector Connections `@objectstack/service-automation` (same contribution)
17+
// Slack `@objectstack/service-messaging` (with connector-slack composed)
1718
// Cloud Connection `@objectstack/cloud-connection`
1819
//
1920
// Each contributor states the group's other priorities in its own header so
@@ -35,16 +36,18 @@
3536
// Why it lives in `packages/cli/test/`
3637
// ---------------------------------------------------------------------------
3738
// The same reason as `connect-agent-both-halves-wire.pin.test.ts` beside it:
38-
// this is a COMPOSED fact across five packages and the registry fold, and
39+
// this is a COMPOSED fact across six packages and the registry fold, and
3940
// `packages/cli` is the only workspace package that depends on all of them.
4041
//
41-
// Two of the five register their contribution from inside `init()` through
42+
// Two of the six register their contribution from inside `init()` through
4243
// the `manifest` service rather than exporting it, so they are booted here on
4344
// a context that serves exactly that service — the shape
4445
// `packages/cli/scripts/check-app-nav-i18n.mjs` boots the same two with.
4546
// `@objectstack/service-automation` registers its bundle at `kernel:ready`,
4647
// which this context never fires, so its exported bundle is read directly, as
47-
// that gate does too.
48+
// that gate does too. `@objectstack/service-messaging` registers its Slack
49+
// bundle at `kernel:ready` too, and only with connector-slack composed; it is
50+
// read the same way.
4851

4952
import { describe, expect, it } from 'vitest';
5053
import { CLOUD_CONNECTION_UI_BUNDLE } from '@objectstack/cloud-connection';
@@ -54,6 +57,7 @@ import { SETUP_APP, SETUP_NAV_CONTRIBUTIONS } from '@objectstack/platform-object
5457
import { WebhookOutboxPlugin } from '@objectstack/plugin-webhooks';
5558
import { CONNECTOR_CREDENTIALS_UI_BUNDLE } from '@objectstack/service-automation';
5659
import { DatasourceAdminServicePlugin } from '@objectstack/service-datasource';
60+
import { SLACK_SETUP_UI_BUNDLE } from '@objectstack/service-messaging';
5761

5862
type AnyRec = Record<string, any>;
5963

@@ -67,6 +71,7 @@ const EXPECTED_TIERS: readonly (readonly string[])[] = [
6771
['nav_webhooks', 'nav_http_deliveries', 'nav_datasources'],
6872
// One contribution carries both, in this order (ADR-0143 D5 added the second).
6973
['nav_connector_credentials', 'nav_connector_connections'],
74+
['nav_slack'],
7075
['nav_cloud_connection'],
7176
];
7277

@@ -105,6 +110,7 @@ async function setupContributions(): Promise<Array<{ packageId: string; contribu
105110
// reds if it moves back.
106111
['@objectstack/mcp', [CONNECT_AGENT_UI_BUNDLE as AnyRec]],
107112
['@objectstack/service-automation', [CONNECTOR_CREDENTIALS_UI_BUNDLE as AnyRec]],
113+
['@objectstack/service-messaging', [SLACK_SETUP_UI_BUNDLE as AnyRec]],
108114
['@objectstack/cloud-connection', [CLOUD_CONNECTION_UI_BUNDLE as AnyRec]],
109115
];
110116
const out: Array<{ packageId: string; contribution: AnyRec }> = SETUP_NAV_CONTRIBUTIONS.map((contribution) => ({

‎packages/cli/vitest.config.ts‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1008,6 +1008,14 @@ export default defineConfig({
10081008
find: /^@objectstack\/service-push$/,
10091009
replacement: path.resolve(__dirname, '../services/service-push/src/index.ts'),
10101010
},
1011+
// `setup-integrations-order.pin.test.ts` reads `SLACK_SETUP_UI_BUNDLE`,
1012+
// the Setup › Integrations › Slack contribution. Resolved to source for
1013+
// the reason its neighbours give. `check:test-source-alias` names this
1014+
// import and fails without it.
1015+
{
1016+
find: /^@objectstack\/service-messaging$/,
1017+
replacement: path.resolve(__dirname, '../services/service-messaging/src/index.ts'),
1018+
},
10111019
],
10121020
},
10131021
test: {

‎packages/platform-objects/src/apps/translations/ar.source-hashes.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ export const arSourceHashes: Readonly<Record<string, string>> = {
128128
'apps.setup.navigation.nav_datasources.label': '2f0648ce23158e6f',
129129
'apps.setup.navigation.nav_connector_credentials.label': '0504775224e05a81',
130130
'apps.setup.navigation.nav_connector_connections.label': '949e9a8fd25c3d57',
131+
'apps.setup.navigation.nav_slack.label': 'c3c9e181e8c74b22',
131132
'apps.setup.navigation.nav_oauth_apps.label': '1b26cce61a4c10eb',
132133
'apps.studio.label': '5aaaaea2294ee893',
133134
'apps.studio.description': 'c026a5795933995d',

‎packages/platform-objects/src/apps/translations/ar.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ export const ar: TranslationData = {
125125
nav_datasources: { label: 'مصادر البيانات' },
126126
nav_connector_credentials: { label: 'بيانات اعتماد الموصلات' },
127127
nav_connector_connections: { label: 'اتصالات الموصلات' },
128+
nav_slack: { label: 'Slack' },
128129

129130
nav_oauth_apps: { label: 'تطبيقات OAuth' },
130131
},

‎packages/platform-objects/src/apps/translations/de.source-hashes.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ export const deSourceHashes: Readonly<Record<string, string>> = {
129129
'apps.setup.navigation.nav_datasources.label': '2f0648ce23158e6f',
130130
'apps.setup.navigation.nav_connector_credentials.label': '0504775224e05a81',
131131
'apps.setup.navigation.nav_connector_connections.label': '949e9a8fd25c3d57',
132+
'apps.setup.navigation.nav_slack.label': 'c3c9e181e8c74b22',
132133
'apps.setup.navigation.nav_oauth_apps.label': '1b26cce61a4c10eb',
133134
'apps.studio.label': '5aaaaea2294ee893',
134135
'apps.studio.description': 'c026a5795933995d',

‎packages/platform-objects/src/apps/translations/de.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ export const de: TranslationData = {
127127
nav_datasources: { label: 'Datenquellen' },
128128
nav_connector_credentials: { label: 'Konnektor-Anmeldedaten' },
129129
nav_connector_connections: { label: 'Konnektor-Verbindungen' },
130+
nav_slack: { label: 'Slack' },
130131

131132
nav_oauth_apps: { label: 'OAuth-Anwendungen' },
132133
},

‎packages/platform-objects/src/apps/translations/en.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@ export const en: TranslationData = {
166166
nav_datasources: { label: 'Datasources' },
167167
nav_connector_credentials: { label: 'Connector Credentials' },
168168
nav_connector_connections: { label: 'Connector Connections' },
169+
nav_slack: { label: 'Slack' },
169170

170171
// Advanced
171172
//

‎packages/platform-objects/src/apps/translations/es-ES.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ export const esES: TranslationData = {
113113
nav_datasources: { label: 'Fuentes de datos' },
114114
nav_connector_credentials: { label: 'Credenciales de conectores' },
115115
nav_connector_connections: { label: 'Conexiones de conectores' },
116+
nav_slack: { label: 'Slack' },
116117

117118
nav_oauth_apps: { label: 'Aplicaciones OAuth' },
118119
},

0 commit comments

Comments
 (0)