From 887b3276f02d9164a9ff12c28c837a70bb6ff858 Mon Sep 17 00:00:00 2001 From: os-zhuang Date: Thu, 25 Jun 2026 13:30:24 +0800 Subject: [PATCH] =?UTF-8?q?chore(crm):=20remove=20the=20AI=20agent=20?= =?UTF-8?q?=E2=80=94=20service-ai=20is=20an=20enterprise=20capability?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Mirror the showcase change (#2317): the open-source CRM example shouldn't define an AI agent that requires the enterprise @objectstack/service-ai runtime. - delete src/agents/ (SalesAssistantAgent + DealManagementSkill + LookupContactTool) and its config wiring (agents / skills) plus the unused referenceMetadata export; - remove the @objectstack/service-ai dependency (added in #2311 to back the agent). crm now boots as a Community-Edition shape: no AI service registered, discovery reports services.ai unavailable, /api/v1/ai/agents 404. tsc --noEmit + all 29 crm tests pass. Co-Authored-By: Claude Opus 4.8 --- examples/app-crm/objectstack.config.ts | 18 ------- examples/app-crm/package.json | 1 - examples/app-crm/src/agents/index.ts | 7 --- .../src/agents/sales-assistant.agent.ts | 50 ------------------- pnpm-lock.yaml | 3 -- 5 files changed, 79 deletions(-) delete mode 100644 examples/app-crm/src/agents/index.ts delete mode 100644 examples/app-crm/src/agents/sales-assistant.agent.ts diff --git a/examples/app-crm/objectstack.config.ts b/examples/app-crm/objectstack.config.ts index e8220f84fe..89ddd6df8c 100644 --- a/examples/app-crm/objectstack.config.ts +++ b/examples/app-crm/objectstack.config.ts @@ -13,11 +13,6 @@ import * as actions from './src/actions/index.js'; import * as emails from './src/emails/index.js'; import { allHooks } from './src/hooks/index.js'; import { allFlows } from './src/flows/index.js'; -import { - SalesAssistantAgent, - LookupContactTool, - DealManagementSkill, -} from './src/agents/index.js'; import { SalesRepRole, SalesManagerRole, @@ -136,19 +131,6 @@ export default defineStack({ // Integrations connectors: [HubSpotConnector, SlackConnector], - // AI - agents: [SalesAssistantAgent], - skills: [DealManagementSkill], - // Seed data data: CrmSeedData, }); - -/** - * Reference templates for metadata types not (yet) wired into a - * top-level defineStack collection. The Studio metadata-admin UI - * can copy from these when authoring. - */ -export const referenceMetadata = { - tools: [LookupContactTool], -}; diff --git a/examples/app-crm/package.json b/examples/app-crm/package.json index cb6a618633..8075b0af34 100644 --- a/examples/app-crm/package.json +++ b/examples/app-crm/package.json @@ -20,7 +20,6 @@ }, "dependencies": { "@objectstack/runtime": "workspace:*", - "@objectstack/service-ai": "workspace:*", "@objectstack/spec": "workspace:*" }, "devDependencies": { diff --git a/examples/app-crm/src/agents/index.ts b/examples/app-crm/src/agents/index.ts deleted file mode 100644 index 2f0d836487..0000000000 --- a/examples/app-crm/src/agents/index.ts +++ /dev/null @@ -1,7 +0,0 @@ -// Copyright (c) 2025 ObjectStack. Licensed under the Apache-2.0 license. - -export { - SalesAssistantAgent, - DealManagementSkill, - LookupContactTool, -} from './sales-assistant.agent.js'; diff --git a/examples/app-crm/src/agents/sales-assistant.agent.ts b/examples/app-crm/src/agents/sales-assistant.agent.ts deleted file mode 100644 index 30040152d9..0000000000 --- a/examples/app-crm/src/agents/sales-assistant.agent.ts +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) 2025 ObjectStack. Licensed under the Apache-2.0 license. - -import { defineAgent, defineSkill, defineTool } from '@objectstack/spec'; - -/** - * Example tool — looks up a CRM contact by email. - * Demonstrates a minimal Tool definition for the metadata-admin UI. - */ -export const LookupContactTool = defineTool({ - name: 'crm_lookup_contact', - label: 'Look up Contact', - description: 'Find a contact in the CRM by email address.', - parameters: { - type: 'object', - properties: { - email: { - type: 'string', - description: 'Contact email address', - }, - }, - required: ['email'], - }, - requiresConfirmation: false, - active: true, - builtIn: false, -}); - -/** - * Example skill — bundles tools used to manage deals. - */ -export const DealManagementSkill = defineSkill({ - name: 'crm_deal_management', - label: 'Deal Management', - description: 'Tools and prompts for working with sales opportunities.', - tools: ['crm_lookup_contact'], - active: true, -}); - -/** - * Example agent — a sales assistant for the CRM. - */ -export const SalesAssistantAgent = defineAgent({ - name: 'crm_sales_assistant', - label: 'Sales Assistant', - role: 'You are a helpful sales operations assistant for a CRM system.', - instructions: - 'Help sales reps find contacts, update opportunities, and summarise their pipeline. Always be concise and ask before making destructive changes.', - active: true, - visibility: 'global', -}); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index c85ad601c0..da53cfac76 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -109,9 +109,6 @@ importers: '@objectstack/runtime': specifier: workspace:* version: link:../../packages/runtime - '@objectstack/service-ai': - specifier: workspace:* - version: link:../../packages/services/service-ai '@objectstack/spec': specifier: workspace:* version: link:../../packages/spec