Commit 766452a
feat(cli): gate AI service auto-registration on a declared @objectstack/service-ai dependency
The CLI auto-registered the headless AIServicePlugin whenever the `ai` tier was
enabled (default) and @objectstack/service-ai was merely *resolvable*. In a
workspace/monorepo the package is hoist-resolvable even when an app doesn't
declare it, so every app got the AI service — discovery reported services.ai as
available and the agent runtime served any metadata-defined agents — including
Community-Edition apps that ship no AI.
Make the DECLARED dependency the AI edition boundary: auto-register AIService
only when the host app lists @objectstack/service-ai in its dependencies. A
Community-Edition app that omits it now gets no AI service, no agents, and
services.ai { enabled:false, status:'unavailable' } in discovery — so the MIT
console hides its AI surface — while MCP and every other capability are
unaffected. MCP is a separate capability: it bridges data/metadata regardless
and only optionally bridges the AI tool registry when the 'ai' service is present.
Declare @objectstack/service-ai in the showcase and crm examples (they ship AI
agents) so they keep AI.
Verified e2e in an isolated build:
- app WITHOUT the dep → discovery AI unavailable, /api/v1/ai/agents 404,
AIService not loaded; MCP server still starts and serves
(OS_MCP_SERVER_ENABLED=true → 401 auth-gate, i.e. live).
- app that DECLARES it → services.ai available + agents served.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>1 parent ffa0aca commit 766452a
5 files changed
Lines changed: 53 additions & 1 deletion
File tree
- .changeset
- examples
- app-crm
- app-showcase
- packages/cli/src/commands
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| 30 | + | |
30 | 31 | | |
31 | 32 | | |
32 | 33 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1416 | 1416 | | |
1417 | 1417 | | |
1418 | 1418 | | |
1419 | | - | |
| 1419 | + | |
| 1420 | + | |
| 1421 | + | |
| 1422 | + | |
| 1423 | + | |
| 1424 | + | |
| 1425 | + | |
| 1426 | + | |
| 1427 | + | |
| 1428 | + | |
| 1429 | + | |
| 1430 | + | |
| 1431 | + | |
| 1432 | + | |
| 1433 | + | |
| 1434 | + | |
| 1435 | + | |
| 1436 | + | |
| 1437 | + | |
| 1438 | + | |
| 1439 | + | |
| 1440 | + | |
1420 | 1441 | | |
1421 | 1442 | | |
1422 | 1443 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 commit comments