Skip to content

Commit 0e95686

Browse files
authored
Merge pull request #747 from objectstack-ai/copilot/create-feed-chatter-service
2 parents 4b6cf91 + 031b990 commit 0e95686

15 files changed

Lines changed: 1707 additions & 13 deletions

ROADMAP.md

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -304,11 +304,13 @@ business/custom objects, aligning with industry best practices (e.g., ServiceNow
304304
|:---|:---:|:---|:---|
305305
| `II18nService` | **P1** | `@objectstack/service-i18n` | Map-backed translation with locale resolution |
306306
| `IRealtimeService` | **P1** | `@objectstack/service-realtime` | WebSocket/SSE push (replaces Studio setTimeout hack) |
307+
| `IFeedService` | **P1** | `@objectstack/service-feed` | ✅ Feed/Chatter with comments, reactions, subscriptions |
307308
| `ISearchService` | **P1** | `@objectstack/service-search` | In-memory search first, then Meilisearch driver |
308309
| `INotificationService` | **P2** | `@objectstack/service-notification` | Email adapter (console logger in dev mode) |
309310

310311
- [x] `service-i18n` — Implement `II18nService` with file-based locale loading
311312
- [x] `service-realtime` — Implement `IRealtimeService` with WebSocket + in-memory pub/sub
313+
- [x] `service-feed` — Implement `IFeedService` with in-memory adapter (Feed CRUD, Reactions, Subscriptions, Threading)
312314
- [ ] `service-search` — Implement `ISearchService` with in-memory search + Meilisearch adapter
313315
- [ ] `service-notification` — Implement `INotificationService` with email adapter
314316

@@ -571,19 +573,20 @@ Final polish and advanced features.
571573
| 12 | Job Service | `IJobService` || `@objectstack/service-job` | Interval + cron skeleton |
572574
| 13 | Storage Service | `IStorageService` || `@objectstack/service-storage` | Local FS + S3 skeleton |
573575
| 14 | Realtime Service | `IRealtimeService` || `@objectstack/service-realtime` | In-memory pub/sub |
574-
| 15 | Search Service | `ISearchService` || `@objectstack/service-search` (planned) | Spec only |
575-
| 16 | Notification Service | `INotificationService` || `@objectstack/service-notification` (planned) | Spec only |
576-
| 17 | AI Service | `IAIService` || `@objectstack/service-ai` (planned) | Spec only |
577-
| 18 | Automation Service | `IAutomationService` || `@objectstack/service-automation` | Plugin-based DAG engine (MVP) |
578-
| 19 | Workflow Service | `IWorkflowService` || `@objectstack/service-workflow` (planned) | Spec only |
579-
| 20 | GraphQL Service | `IGraphQLService` || `@objectstack/service-graphql` (planned) | Spec only |
580-
| 21 | i18n Service | `II18nService` || `@objectstack/service-i18n` | File-based locale loading |
581-
| 22 | UI Service | `IUIService` | ⚠️ || **Deprecated** — merged into `IMetadataService` |
582-
| 23 | Schema Driver | `ISchemaDriver` ||| Spec only |
583-
| 24 | Startup Orchestrator | `IStartupOrchestrator` ||| Kernel handles basics |
584-
| 25 | Plugin Validator | `IPluginValidator` ||| Spec only |
585-
586-
**Summary:** 13 fully implemented · 2 partially implemented · 10 specification only
576+
| 15 | Feed Service | `IFeedService` || `@objectstack/service-feed` | In-memory feed/chatter (comments, reactions, subscriptions) |
577+
| 16 | Search Service | `ISearchService` || `@objectstack/service-search` (planned) | Spec only |
578+
| 17 | Notification Service | `INotificationService` || `@objectstack/service-notification` (planned) | Spec only |
579+
| 18 | AI Service | `IAIService` || `@objectstack/service-ai` (planned) | Spec only |
580+
| 19 | Automation Service | `IAutomationService` || `@objectstack/service-automation` | Plugin-based DAG engine (MVP) |
581+
| 20 | Workflow Service | `IWorkflowService` || `@objectstack/service-workflow` (planned) | Spec only |
582+
| 21 | GraphQL Service | `IGraphQLService` || `@objectstack/service-graphql` (planned) | Spec only |
583+
| 22 | i18n Service | `II18nService` || `@objectstack/service-i18n` | File-based locale loading |
584+
| 23 | UI Service | `IUIService` | ⚠️ || **Deprecated** — merged into `IMetadataService` |
585+
| 24 | Schema Driver | `ISchemaDriver` ||| Spec only |
586+
| 25 | Startup Orchestrator | `IStartupOrchestrator` ||| Kernel handles basics |
587+
| 26 | Plugin Validator | `IPluginValidator` ||| Spec only |
588+
589+
**Summary:** 14 fully implemented · 2 partially implemented · 10 specification only
587590

588591
---
589592

@@ -612,6 +615,7 @@ Final polish and advanced features.
612615
| `@objectstack/service-storage` | 3.0.6 | 8 | ✅ Stable | 7/10 |
613616
| `@objectstack/service-i18n` | 3.0.7 | 20 | ✅ Stable | 7/10 |
614617
| `@objectstack/service-realtime` | 3.0.7 | 14 | ✅ Stable | 7/10 |
618+
| `@objectstack/service-feed` | 3.0.7 | 40 | ✅ Stable | 7/10 |
615619
| `@objectstack/nextjs` | 3.0.2 || ✅ Stable | 10/10 |
616620
| `@objectstack/nestjs` | 3.0.2 || ✅ Stable | 10/10 |
617621
| `@objectstack/hono` | 3.0.2 || ✅ Stable | 10/10 |
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"name": "@objectstack/service-feed",
3+
"version": "3.0.7",
4+
"license": "Apache-2.0",
5+
"description": "Feed/Chatter Service for ObjectStack — implements IFeedService with in-memory adapter for comments, reactions, field changes, and record subscriptions",
6+
"type": "module",
7+
"main": "dist/index.js",
8+
"types": "dist/index.d.ts",
9+
"exports": {
10+
".": {
11+
"types": "./dist/index.d.ts",
12+
"import": "./dist/index.mjs",
13+
"require": "./dist/index.js"
14+
}
15+
},
16+
"scripts": {
17+
"build": "tsup --config ../../../tsup.config.ts",
18+
"test": "vitest run"
19+
},
20+
"dependencies": {
21+
"@objectstack/core": "workspace:*",
22+
"@objectstack/spec": "workspace:*"
23+
},
24+
"devDependencies": {
25+
"typescript": "^5.0.0",
26+
"vitest": "^4.0.18",
27+
"@types/node": "^25.2.3"
28+
}
29+
}
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
// Copyright (c) 2025 ObjectStack. Licensed under the Apache-2.0 license.
2+
3+
import type { Plugin, PluginContext } from '@objectstack/core';
4+
import { InMemoryFeedAdapter } from './in-memory-feed-adapter.js';
5+
import type { InMemoryFeedAdapterOptions } from './in-memory-feed-adapter.js';
6+
7+
/**
8+
* Configuration options for the FeedServicePlugin.
9+
*/
10+
export interface FeedServicePluginOptions {
11+
/** Feed adapter type (default: 'memory') */
12+
adapter?: 'memory';
13+
/** Options for the in-memory adapter */
14+
memory?: InMemoryFeedAdapterOptions;
15+
}
16+
17+
/**
18+
* FeedServicePlugin — Production IFeedService implementation.
19+
*
20+
* Registers a Feed/Chatter service with the kernel during the init phase.
21+
* Currently supports in-memory storage for single-process environments.
22+
*
23+
* @example
24+
* ```ts
25+
* import { ObjectKernel } from '@objectstack/core';
26+
* import { FeedServicePlugin } from '@objectstack/service-feed';
27+
*
28+
* const kernel = new ObjectKernel();
29+
* kernel.use(new FeedServicePlugin());
30+
* await kernel.bootstrap();
31+
*
32+
* const feed = kernel.getService('feed');
33+
* const item = await feed.createFeedItem({
34+
* object: 'account',
35+
* recordId: 'rec_123',
36+
* type: 'comment',
37+
* actor: { type: 'user', id: 'user_1', name: 'Alice' },
38+
* body: 'Great progress!',
39+
* });
40+
* ```
41+
*/
42+
export class FeedServicePlugin implements Plugin {
43+
name = 'com.objectstack.service.feed';
44+
version = '1.0.0';
45+
type = 'standard';
46+
47+
private readonly options: FeedServicePluginOptions;
48+
49+
constructor(options: FeedServicePluginOptions = {}) {
50+
this.options = { adapter: 'memory', ...options };
51+
}
52+
53+
async init(ctx: PluginContext): Promise<void> {
54+
const feed = new InMemoryFeedAdapter(this.options.memory);
55+
ctx.registerService('feed', feed);
56+
ctx.logger.info('FeedServicePlugin: registered in-memory feed adapter');
57+
}
58+
}

0 commit comments

Comments
 (0)