@framers/agentos 0.1.51 → 0.1.53
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/dist/api/AgentOS.d.ts +10 -10
- package/dist/api/AgentOS.d.ts.map +1 -1
- package/dist/channels/index.d.ts +2 -1
- package/dist/channels/index.d.ts.map +1 -1
- package/dist/channels/index.js +2 -1
- package/dist/channels/index.js.map +1 -1
- package/dist/core/agency/index.d.ts +1 -2
- package/dist/core/agency/index.d.ts.map +1 -1
- package/dist/core/agency/index.js +1 -2
- package/dist/core/agency/index.js.map +1 -1
- package/dist/core/agents/AgentCore.d.ts +8 -19
- package/dist/core/agents/AgentCore.d.ts.map +1 -1
- package/dist/core/agents/AgentCore.js +7 -15
- package/dist/core/agents/AgentCore.js.map +1 -1
- package/dist/core/agents/AgentFactory.d.ts +9 -13
- package/dist/core/agents/AgentFactory.d.ts.map +1 -1
- package/dist/core/agents/AgentFactory.js +9 -13
- package/dist/core/agents/AgentFactory.js.map +1 -1
- package/dist/core/audio/SilenceDetector.d.ts +5 -5
- package/dist/core/audio/SilenceDetector.js +5 -5
- package/dist/core/evaluation/index.d.ts +2 -2
- package/dist/core/evaluation/index.js +2 -2
- package/dist/core/hitl/index.d.ts +1 -2
- package/dist/core/hitl/index.d.ts.map +1 -1
- package/dist/core/hitl/index.js +1 -2
- package/dist/core/hitl/index.js.map +1 -1
- package/dist/core/index.d.ts +1 -1
- package/dist/core/index.js +1 -1
- package/dist/core/llm/IPromptEngine.d.ts +13 -8
- package/dist/core/llm/IPromptEngine.d.ts.map +1 -1
- package/dist/core/llm/IPromptEngine.js.map +1 -1
- package/dist/core/marketplace/index.d.ts +2 -2
- package/dist/core/marketplace/index.js +2 -2
- package/dist/core/observability/index.d.ts +2 -2
- package/dist/core/observability/index.js +2 -2
- package/dist/core/planning/index.d.ts +1 -2
- package/dist/core/planning/index.d.ts.map +1 -1
- package/dist/core/planning/index.js +1 -2
- package/dist/core/planning/index.js.map +1 -1
- package/dist/core/provenance/index.d.ts +2 -2
- package/dist/core/provenance/index.js +2 -2
- package/dist/core/safety/index.d.ts +3 -2
- package/dist/core/safety/index.d.ts.map +1 -1
- package/dist/core/safety/index.js +3 -2
- package/dist/core/safety/index.js.map +1 -1
- package/dist/core/sandbox/index.d.ts +2 -2
- package/dist/core/sandbox/index.js +2 -2
- package/dist/core/structured/index.d.ts +1 -2
- package/dist/core/structured/index.d.ts.map +1 -1
- package/dist/core/structured/index.js +1 -2
- package/dist/core/structured/index.js.map +1 -1
- package/dist/core/tools/index.d.ts +2 -1
- package/dist/core/tools/index.d.ts.map +1 -1
- package/dist/core/tools/index.js +2 -1
- package/dist/core/tools/index.js.map +1 -1
- package/dist/discovery/index.d.ts +2 -1
- package/dist/discovery/index.d.ts.map +1 -1
- package/dist/discovery/index.js +2 -1
- package/dist/discovery/index.js.map +1 -1
- package/dist/memory/AgentMemory.d.ts +139 -0
- package/dist/memory/AgentMemory.d.ts.map +1 -0
- package/dist/memory/AgentMemory.js +177 -0
- package/dist/memory/AgentMemory.js.map +1 -0
- package/dist/memory/index.d.ts +4 -1
- package/dist/memory/index.d.ts.map +1 -1
- package/dist/memory/index.js +5 -2
- package/dist/memory/index.js.map +1 -1
- package/dist/rag/audit/index.d.ts +5 -2
- package/dist/rag/audit/index.d.ts.map +1 -1
- package/dist/rag/audit/index.js +5 -2
- package/dist/rag/audit/index.js.map +1 -1
- package/dist/rag/implementations/vector_stores/InMemoryVectorStore.d.ts +1 -2
- package/dist/rag/implementations/vector_stores/InMemoryVectorStore.d.ts.map +1 -1
- package/dist/rag/implementations/vector_stores/InMemoryVectorStore.js +1 -2
- package/dist/rag/implementations/vector_stores/InMemoryVectorStore.js.map +1 -1
- package/dist/rag/reranking/index.d.ts +2 -2
- package/dist/rag/reranking/index.js +2 -2
- package/dist/rag/reranking/providers/index.d.ts +3 -2
- package/dist/rag/reranking/providers/index.d.ts.map +1 -1
- package/dist/rag/reranking/providers/index.js +3 -2
- package/dist/rag/reranking/providers/index.js.map +1 -1
- package/dist/social-posting/ContentAdaptationEngine.d.ts +148 -0
- package/dist/social-posting/ContentAdaptationEngine.d.ts.map +1 -0
- package/dist/social-posting/ContentAdaptationEngine.js +445 -0
- package/dist/social-posting/ContentAdaptationEngine.js.map +1 -0
- package/dist/social-posting/SocialAbstractService.d.ts +52 -0
- package/dist/social-posting/SocialAbstractService.d.ts.map +1 -0
- package/dist/social-posting/SocialAbstractService.js +127 -0
- package/dist/social-posting/SocialAbstractService.js.map +1 -0
- package/dist/social-posting/SocialPostManager.d.ts +252 -0
- package/dist/social-posting/SocialPostManager.d.ts.map +1 -0
- package/dist/social-posting/SocialPostManager.js +344 -0
- package/dist/social-posting/SocialPostManager.js.map +1 -0
- package/dist/social-posting/index.d.ts +12 -0
- package/dist/social-posting/index.d.ts.map +1 -0
- package/dist/social-posting/index.js +15 -0
- package/dist/social-posting/index.js.map +1 -0
- package/dist/voice/index.d.ts +2 -1
- package/dist/voice/index.d.ts.map +1 -1
- package/dist/voice/index.js +2 -1
- package/dist/voice/index.js.map +1 -1
- package/package.json +6 -3
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Social Post Manager — post lifecycle engine.
|
|
3
|
+
* @module @framers/agentos/social-posting/SocialPostManager
|
|
4
|
+
*
|
|
5
|
+
* Manages the full lifecycle of social media posts through a state machine:
|
|
6
|
+
*
|
|
7
|
+
* DRAFT --> SCHEDULED --> PUBLISHING --> PUBLISHED
|
|
8
|
+
* |
|
|
9
|
+
* ERROR --> RETRY --> PUBLISHING
|
|
10
|
+
*
|
|
11
|
+
* Storage is in-memory (Map<string, SocialPost>). The backend module will
|
|
12
|
+
* layer on DB persistence via IStorageAdapter when this is wired into
|
|
13
|
+
* the NestJS service layer.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```typescript
|
|
17
|
+
* import { SocialPostManager } from '../social-posting';
|
|
18
|
+
*
|
|
19
|
+
* const manager = new SocialPostManager();
|
|
20
|
+
*
|
|
21
|
+
* const post = manager.createDraft({
|
|
22
|
+
* seedId: 'agent-alpha',
|
|
23
|
+
* content: 'Hello world!',
|
|
24
|
+
* platforms: ['twitter', 'bluesky'],
|
|
25
|
+
* });
|
|
26
|
+
*
|
|
27
|
+
* manager.schedulePost(post.id, '2026-03-05T12:00:00Z');
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
/**
|
|
31
|
+
* State machine states for a social post.
|
|
32
|
+
*
|
|
33
|
+
* Valid transitions:
|
|
34
|
+
* - draft --> scheduled | publishing
|
|
35
|
+
* - scheduled --> publishing
|
|
36
|
+
* - publishing --> published | error
|
|
37
|
+
* - error --> retry
|
|
38
|
+
* - retry --> publishing
|
|
39
|
+
*/
|
|
40
|
+
export type SocialPostStatus = 'draft' | 'scheduled' | 'publishing' | 'published' | 'error' | 'retry';
|
|
41
|
+
/**
|
|
42
|
+
* Per-platform publishing result tracked on a SocialPost.
|
|
43
|
+
*/
|
|
44
|
+
export interface SocialPostPlatformResult {
|
|
45
|
+
/** Target platform identifier (e.g. 'twitter', 'bluesky'). */
|
|
46
|
+
platform: string;
|
|
47
|
+
/** Platform-assigned post ID after successful publish. */
|
|
48
|
+
postId?: string;
|
|
49
|
+
/** Canonical URL of the published post. */
|
|
50
|
+
url?: string;
|
|
51
|
+
/** Current status for this platform leg. */
|
|
52
|
+
status: 'pending' | 'success' | 'error';
|
|
53
|
+
/** Error message if status is 'error'. */
|
|
54
|
+
error?: string;
|
|
55
|
+
/** ISO 8601 timestamp of successful publish. */
|
|
56
|
+
publishedAt?: string;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* A social post managed by the SocialPostManager.
|
|
60
|
+
*
|
|
61
|
+
* `adaptations` maps platform names to platform-specific content variants
|
|
62
|
+
* produced by the ContentAdaptationEngine (or by the LLM skill layer).
|
|
63
|
+
*/
|
|
64
|
+
export interface SocialPost {
|
|
65
|
+
/** Unique post identifier (UUID v4). */
|
|
66
|
+
id: string;
|
|
67
|
+
/** The agent seed this post belongs to. */
|
|
68
|
+
seedId: string;
|
|
69
|
+
/** The original, platform-agnostic content. */
|
|
70
|
+
baseContent: string;
|
|
71
|
+
/** Platform-specific content adaptations (platform --> adapted text). */
|
|
72
|
+
adaptations: Record<string, string>;
|
|
73
|
+
/** Target platforms for this post. */
|
|
74
|
+
platforms: string[];
|
|
75
|
+
/** Optional media attachment URLs. */
|
|
76
|
+
mediaUrls?: string[];
|
|
77
|
+
/** ISO 8601 timestamp when the post should be published. */
|
|
78
|
+
scheduledAt?: string;
|
|
79
|
+
/** Current lifecycle status. */
|
|
80
|
+
status: SocialPostStatus;
|
|
81
|
+
/** Per-platform publishing results. */
|
|
82
|
+
results: Record<string, SocialPostPlatformResult>;
|
|
83
|
+
/** Number of retry attempts so far. */
|
|
84
|
+
retryCount: number;
|
|
85
|
+
/** Maximum retry attempts before permanent failure. */
|
|
86
|
+
maxRetries: number;
|
|
87
|
+
/** ISO 8601 creation timestamp. */
|
|
88
|
+
createdAt: string;
|
|
89
|
+
/** ISO 8601 last-update timestamp. */
|
|
90
|
+
updatedAt: string;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Input for creating a new draft post.
|
|
94
|
+
*/
|
|
95
|
+
export interface CreateDraftInput {
|
|
96
|
+
/** The agent seed this post belongs to. */
|
|
97
|
+
seedId: string;
|
|
98
|
+
/** The base content for the post. */
|
|
99
|
+
content: string;
|
|
100
|
+
/** Target platforms (e.g. ['twitter', 'linkedin']). */
|
|
101
|
+
platforms: string[];
|
|
102
|
+
/** Optional media attachment URLs. */
|
|
103
|
+
mediaUrls?: string[];
|
|
104
|
+
/** Pre-computed platform adaptations (platform --> adapted text). */
|
|
105
|
+
adaptations?: Record<string, string>;
|
|
106
|
+
/** ISO 8601 scheduled publish time. If omitted, the post stays as a draft. */
|
|
107
|
+
schedule?: string;
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Manages the lifecycle of social media posts.
|
|
111
|
+
*
|
|
112
|
+
* Provides create, schedule, publish, retry, and query operations over an
|
|
113
|
+
* in-memory store. Platform-specific publishing is delegated to callers
|
|
114
|
+
* (typically the ToolExecutor / skill layer) via the {@link publishNow}
|
|
115
|
+
* callback mechanism.
|
|
116
|
+
*
|
|
117
|
+
* @example
|
|
118
|
+
* ```typescript
|
|
119
|
+
* const manager = new SocialPostManager();
|
|
120
|
+
* const draft = manager.createDraft({
|
|
121
|
+
* seedId: 'my-agent',
|
|
122
|
+
* content: 'Big announcement!',
|
|
123
|
+
* platforms: ['twitter', 'linkedin'],
|
|
124
|
+
* });
|
|
125
|
+
*
|
|
126
|
+
* // Schedule for later
|
|
127
|
+
* manager.schedulePost(draft.id, '2026-03-10T15:00:00Z');
|
|
128
|
+
*
|
|
129
|
+
* // Or publish immediately
|
|
130
|
+
* await manager.publishNow(draft.id);
|
|
131
|
+
* ```
|
|
132
|
+
*/
|
|
133
|
+
export declare class SocialPostManager {
|
|
134
|
+
/** In-memory post store keyed by post ID. */
|
|
135
|
+
private readonly posts;
|
|
136
|
+
/**
|
|
137
|
+
* Optional publish handler injected by the consuming layer.
|
|
138
|
+
* Called for each platform when {@link publishNow} is invoked.
|
|
139
|
+
*
|
|
140
|
+
* When not provided, publishNow will mark all platforms as 'pending'
|
|
141
|
+
* and transition the post to 'publishing', leaving actual delivery
|
|
142
|
+
* to the caller.
|
|
143
|
+
*/
|
|
144
|
+
private publishHandler?;
|
|
145
|
+
/**
|
|
146
|
+
* Register a platform publish handler.
|
|
147
|
+
*
|
|
148
|
+
* The handler receives the full post and a single platform string and must
|
|
149
|
+
* return a {@link SocialPostPlatformResult}. It is called once per platform
|
|
150
|
+
* during {@link publishNow}.
|
|
151
|
+
*
|
|
152
|
+
* @param handler - Async function that publishes content to a platform
|
|
153
|
+
*/
|
|
154
|
+
setPublishHandler(handler: (post: SocialPost, platform: string) => Promise<SocialPostPlatformResult>): void;
|
|
155
|
+
/**
|
|
156
|
+
* Create a new draft post.
|
|
157
|
+
*
|
|
158
|
+
* If `input.schedule` is provided, the post is automatically transitioned
|
|
159
|
+
* to 'scheduled' status.
|
|
160
|
+
*
|
|
161
|
+
* @param input - Draft creation parameters
|
|
162
|
+
* @returns The newly created SocialPost in 'draft' (or 'scheduled') status
|
|
163
|
+
*/
|
|
164
|
+
createDraft(input: CreateDraftInput): SocialPost;
|
|
165
|
+
/**
|
|
166
|
+
* Schedule a draft post for future publishing.
|
|
167
|
+
*
|
|
168
|
+
* @param postId - ID of the post to schedule
|
|
169
|
+
* @param timestamp - ISO 8601 timestamp for desired publish time
|
|
170
|
+
* @returns The updated SocialPost in 'scheduled' status
|
|
171
|
+
* @throws {Error} If the post is not found or the transition is invalid
|
|
172
|
+
*/
|
|
173
|
+
schedulePost(postId: string, timestamp: string): SocialPost;
|
|
174
|
+
/**
|
|
175
|
+
* Publish a post immediately.
|
|
176
|
+
*
|
|
177
|
+
* Transitions the post to 'publishing' and, if a publish handler is
|
|
178
|
+
* registered, invokes it for each target platform. After all platform
|
|
179
|
+
* results are collected, the post is transitioned to either 'published'
|
|
180
|
+
* (all succeeded) or 'error' (any failure).
|
|
181
|
+
*
|
|
182
|
+
* If no publish handler is registered, the post remains in 'publishing'
|
|
183
|
+
* status with all platform results set to 'pending'.
|
|
184
|
+
*
|
|
185
|
+
* @param postId - ID of the post to publish
|
|
186
|
+
* @returns The updated SocialPost after publish attempts
|
|
187
|
+
* @throws {Error} If the post is not found or the transition is invalid
|
|
188
|
+
*/
|
|
189
|
+
publishNow(postId: string): Promise<SocialPost>;
|
|
190
|
+
/**
|
|
191
|
+
* Record a platform-specific publish result.
|
|
192
|
+
*
|
|
193
|
+
* Used by external publish handlers to report results asynchronously
|
|
194
|
+
* (e.g. webhook callbacks).
|
|
195
|
+
*
|
|
196
|
+
* @param postId - ID of the post
|
|
197
|
+
* @param platform - Platform identifier
|
|
198
|
+
* @param result - The platform result to record
|
|
199
|
+
* @returns The updated SocialPost
|
|
200
|
+
* @throws {Error} If the post is not found
|
|
201
|
+
*/
|
|
202
|
+
markPlatformResult(postId: string, platform: string, result: SocialPostPlatformResult): SocialPost;
|
|
203
|
+
/**
|
|
204
|
+
* Retry a failed post.
|
|
205
|
+
*
|
|
206
|
+
* Transitions the post from 'error' to 'retry', increments the retry
|
|
207
|
+
* counter, and resets failed platform results to 'pending'.
|
|
208
|
+
*
|
|
209
|
+
* @param postId - ID of the post to retry
|
|
210
|
+
* @returns The updated SocialPost in 'retry' status
|
|
211
|
+
* @throws {Error} If the post is not found, the transition is invalid,
|
|
212
|
+
* or the maximum retry count has been reached
|
|
213
|
+
*/
|
|
214
|
+
retryFailed(postId: string): SocialPost;
|
|
215
|
+
/**
|
|
216
|
+
* Retrieve a post by ID.
|
|
217
|
+
*
|
|
218
|
+
* @param postId - ID of the post to retrieve
|
|
219
|
+
* @returns The SocialPost if found, otherwise undefined
|
|
220
|
+
*/
|
|
221
|
+
getPost(postId: string): SocialPost | undefined;
|
|
222
|
+
/**
|
|
223
|
+
* List posts with optional filtering by seed ID and/or status.
|
|
224
|
+
*
|
|
225
|
+
* @param seedId - Optional seed ID filter
|
|
226
|
+
* @param status - Optional status filter
|
|
227
|
+
* @returns Array of matching SocialPost objects
|
|
228
|
+
*/
|
|
229
|
+
listPosts(seedId?: string, status?: SocialPostStatus): SocialPost[];
|
|
230
|
+
/**
|
|
231
|
+
* Get all scheduled posts whose scheduledAt timestamp has passed.
|
|
232
|
+
*
|
|
233
|
+
* Used by a polling loop or scheduler to find posts that are due for
|
|
234
|
+
* publishing.
|
|
235
|
+
*
|
|
236
|
+
* @returns Array of SocialPost objects that are due for publishing
|
|
237
|
+
*/
|
|
238
|
+
getDuePosts(): SocialPost[];
|
|
239
|
+
/**
|
|
240
|
+
* Retrieve a post or throw if not found.
|
|
241
|
+
*/
|
|
242
|
+
private requirePost;
|
|
243
|
+
/**
|
|
244
|
+
* Assert that a state transition is valid.
|
|
245
|
+
*/
|
|
246
|
+
private assertTransition;
|
|
247
|
+
/**
|
|
248
|
+
* Initialize platform results with 'pending' status for each platform.
|
|
249
|
+
*/
|
|
250
|
+
private initPlatformResults;
|
|
251
|
+
}
|
|
252
|
+
//# sourceMappingURL=SocialPostManager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SocialPostManager.d.ts","sourceRoot":"","sources":["../../src/social-posting/SocialPostManager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAQH;;;;;;;;;GASG;AACH,MAAM,MAAM,gBAAgB,GACxB,OAAO,GACP,WAAW,GACX,YAAY,GACZ,WAAW,GACX,OAAO,GACP,OAAO,CAAC;AAEZ;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACvC,8DAA8D;IAC9D,QAAQ,EAAE,MAAM,CAAC;IACjB,0DAA0D;IAC1D,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,2CAA2C;IAC3C,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,4CAA4C;IAC5C,MAAM,EAAE,SAAS,GAAG,SAAS,GAAG,OAAO,CAAC;IACxC,0CAA0C;IAC1C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,gDAAgD;IAChD,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;;;;GAKG;AACH,MAAM,WAAW,UAAU;IACzB,wCAAwC;IACxC,EAAE,EAAE,MAAM,CAAC;IACX,2CAA2C;IAC3C,MAAM,EAAE,MAAM,CAAC;IACf,+CAA+C;IAC/C,WAAW,EAAE,MAAM,CAAC;IACpB,yEAAyE;IACzE,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACpC,sCAAsC;IACtC,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,sCAAsC;IACtC,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB,4DAA4D;IAC5D,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,gCAAgC;IAChC,MAAM,EAAE,gBAAgB,CA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;;;;;;;OAWG;IACH,kBAAkB,CAChB,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,wBAAwB,GAC/B,UAAU;IAoBb;;;;;;;;;;OAUG;IACH,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,UAAU;IA+BvC;;;;;OAKG;IACH,OAAO,CAAC,MAAM,EAAE,MAAM,GAAG,UAAU,GAAG,SAAS;IAK/C;;;;;;OAMG;IACH,SAAS,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,gBAAgB,GAAG,UAAU,EAAE;IAYnE;;;;;;;OAOG;IACH,WAAW,IAAI,UAAU,EAAE;IAqB3B;;OAEG;IACH,OAAO,CAAC,WAAW;IAQnB;;OAEG;IACH,OAAO,CAAC,gBAAgB;IAaxB;;OAEG;IACH,OAAO,CAAC,mBAAmB;CAS5B"}
|
|
@@ -0,0 +1,344 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Social Post Manager — post lifecycle engine.
|
|
3
|
+
* @module @framers/agentos/social-posting/SocialPostManager
|
|
4
|
+
*
|
|
5
|
+
* Manages the full lifecycle of social media posts through a state machine:
|
|
6
|
+
*
|
|
7
|
+
* DRAFT --> SCHEDULED --> PUBLISHING --> PUBLISHED
|
|
8
|
+
* |
|
|
9
|
+
* ERROR --> RETRY --> PUBLISHING
|
|
10
|
+
*
|
|
11
|
+
* Storage is in-memory (Map<string, SocialPost>). The backend module will
|
|
12
|
+
* layer on DB persistence via IStorageAdapter when this is wired into
|
|
13
|
+
* the NestJS service layer.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```typescript
|
|
17
|
+
* import { SocialPostManager } from '../social-posting/index.js';
|
|
18
|
+
*
|
|
19
|
+
* const manager = new SocialPostManager();
|
|
20
|
+
*
|
|
21
|
+
* const post = manager.createDraft({
|
|
22
|
+
* seedId: 'agent-alpha',
|
|
23
|
+
* content: 'Hello world!',
|
|
24
|
+
* platforms: ['twitter', 'bluesky'],
|
|
25
|
+
* });
|
|
26
|
+
*
|
|
27
|
+
* manager.schedulePost(post.id, '2026-03-05T12:00:00Z');
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
import { generateUUID } from '../utils/uuid.js';
|
|
31
|
+
// ============================================================================
|
|
32
|
+
// Constants
|
|
33
|
+
// ============================================================================
|
|
34
|
+
/** Default maximum number of retry attempts before a post is permanently failed. */
|
|
35
|
+
const DEFAULT_MAX_RETRIES = 3;
|
|
36
|
+
// ============================================================================
|
|
37
|
+
// Valid State Transitions
|
|
38
|
+
// ============================================================================
|
|
39
|
+
/**
|
|
40
|
+
* Allowed state transitions for the post lifecycle state machine.
|
|
41
|
+
* Each key maps to the set of states it may transition to.
|
|
42
|
+
*/
|
|
43
|
+
const VALID_TRANSITIONS = {
|
|
44
|
+
draft: ['scheduled', 'publishing'],
|
|
45
|
+
scheduled: ['publishing'],
|
|
46
|
+
publishing: ['published', 'error'],
|
|
47
|
+
published: [],
|
|
48
|
+
error: ['retry'],
|
|
49
|
+
retry: ['publishing'],
|
|
50
|
+
};
|
|
51
|
+
// ============================================================================
|
|
52
|
+
// SocialPostManager
|
|
53
|
+
// ============================================================================
|
|
54
|
+
/**
|
|
55
|
+
* Manages the lifecycle of social media posts.
|
|
56
|
+
*
|
|
57
|
+
* Provides create, schedule, publish, retry, and query operations over an
|
|
58
|
+
* in-memory store. Platform-specific publishing is delegated to callers
|
|
59
|
+
* (typically the ToolExecutor / skill layer) via the {@link publishNow}
|
|
60
|
+
* callback mechanism.
|
|
61
|
+
*
|
|
62
|
+
* @example
|
|
63
|
+
* ```typescript
|
|
64
|
+
* const manager = new SocialPostManager();
|
|
65
|
+
* const draft = manager.createDraft({
|
|
66
|
+
* seedId: 'my-agent',
|
|
67
|
+
* content: 'Big announcement!',
|
|
68
|
+
* platforms: ['twitter', 'linkedin'],
|
|
69
|
+
* });
|
|
70
|
+
*
|
|
71
|
+
* // Schedule for later
|
|
72
|
+
* manager.schedulePost(draft.id, '2026-03-10T15:00:00Z');
|
|
73
|
+
*
|
|
74
|
+
* // Or publish immediately
|
|
75
|
+
* await manager.publishNow(draft.id);
|
|
76
|
+
* ```
|
|
77
|
+
*/
|
|
78
|
+
export class SocialPostManager {
|
|
79
|
+
constructor() {
|
|
80
|
+
/** In-memory post store keyed by post ID. */
|
|
81
|
+
this.posts = new Map();
|
|
82
|
+
}
|
|
83
|
+
// --------------------------------------------------------------------------
|
|
84
|
+
// Configuration
|
|
85
|
+
// --------------------------------------------------------------------------
|
|
86
|
+
/**
|
|
87
|
+
* Register a platform publish handler.
|
|
88
|
+
*
|
|
89
|
+
* The handler receives the full post and a single platform string and must
|
|
90
|
+
* return a {@link SocialPostPlatformResult}. It is called once per platform
|
|
91
|
+
* during {@link publishNow}.
|
|
92
|
+
*
|
|
93
|
+
* @param handler - Async function that publishes content to a platform
|
|
94
|
+
*/
|
|
95
|
+
setPublishHandler(handler) {
|
|
96
|
+
this.publishHandler = handler;
|
|
97
|
+
}
|
|
98
|
+
// --------------------------------------------------------------------------
|
|
99
|
+
// Lifecycle Operations
|
|
100
|
+
// --------------------------------------------------------------------------
|
|
101
|
+
/**
|
|
102
|
+
* Create a new draft post.
|
|
103
|
+
*
|
|
104
|
+
* If `input.schedule` is provided, the post is automatically transitioned
|
|
105
|
+
* to 'scheduled' status.
|
|
106
|
+
*
|
|
107
|
+
* @param input - Draft creation parameters
|
|
108
|
+
* @returns The newly created SocialPost in 'draft' (or 'scheduled') status
|
|
109
|
+
*/
|
|
110
|
+
createDraft(input) {
|
|
111
|
+
const now = new Date().toISOString();
|
|
112
|
+
const post = {
|
|
113
|
+
id: generateUUID(),
|
|
114
|
+
seedId: input.seedId,
|
|
115
|
+
baseContent: input.content,
|
|
116
|
+
adaptations: input.adaptations ?? {},
|
|
117
|
+
platforms: [...input.platforms],
|
|
118
|
+
mediaUrls: input.mediaUrls ? [...input.mediaUrls] : undefined,
|
|
119
|
+
scheduledAt: input.schedule,
|
|
120
|
+
status: input.schedule ? 'scheduled' : 'draft',
|
|
121
|
+
results: this.initPlatformResults(input.platforms),
|
|
122
|
+
retryCount: 0,
|
|
123
|
+
maxRetries: DEFAULT_MAX_RETRIES,
|
|
124
|
+
createdAt: now,
|
|
125
|
+
updatedAt: now,
|
|
126
|
+
};
|
|
127
|
+
this.posts.set(post.id, post);
|
|
128
|
+
return { ...post };
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Schedule a draft post for future publishing.
|
|
132
|
+
*
|
|
133
|
+
* @param postId - ID of the post to schedule
|
|
134
|
+
* @param timestamp - ISO 8601 timestamp for desired publish time
|
|
135
|
+
* @returns The updated SocialPost in 'scheduled' status
|
|
136
|
+
* @throws {Error} If the post is not found or the transition is invalid
|
|
137
|
+
*/
|
|
138
|
+
schedulePost(postId, timestamp) {
|
|
139
|
+
const post = this.requirePost(postId);
|
|
140
|
+
this.assertTransition(post.status, 'scheduled');
|
|
141
|
+
post.scheduledAt = timestamp;
|
|
142
|
+
post.status = 'scheduled';
|
|
143
|
+
post.updatedAt = new Date().toISOString();
|
|
144
|
+
return { ...post };
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Publish a post immediately.
|
|
148
|
+
*
|
|
149
|
+
* Transitions the post to 'publishing' and, if a publish handler is
|
|
150
|
+
* registered, invokes it for each target platform. After all platform
|
|
151
|
+
* results are collected, the post is transitioned to either 'published'
|
|
152
|
+
* (all succeeded) or 'error' (any failure).
|
|
153
|
+
*
|
|
154
|
+
* If no publish handler is registered, the post remains in 'publishing'
|
|
155
|
+
* status with all platform results set to 'pending'.
|
|
156
|
+
*
|
|
157
|
+
* @param postId - ID of the post to publish
|
|
158
|
+
* @returns The updated SocialPost after publish attempts
|
|
159
|
+
* @throws {Error} If the post is not found or the transition is invalid
|
|
160
|
+
*/
|
|
161
|
+
async publishNow(postId) {
|
|
162
|
+
const post = this.requirePost(postId);
|
|
163
|
+
this.assertTransition(post.status, 'publishing');
|
|
164
|
+
post.status = 'publishing';
|
|
165
|
+
post.updatedAt = new Date().toISOString();
|
|
166
|
+
if (!this.publishHandler) {
|
|
167
|
+
return { ...post };
|
|
168
|
+
}
|
|
169
|
+
// Publish to each platform concurrently
|
|
170
|
+
const platformResults = await Promise.allSettled(post.platforms.map(async (platform) => {
|
|
171
|
+
try {
|
|
172
|
+
const result = await this.publishHandler(post, platform);
|
|
173
|
+
post.results[platform] = result;
|
|
174
|
+
return result;
|
|
175
|
+
}
|
|
176
|
+
catch (err) {
|
|
177
|
+
const errorResult = {
|
|
178
|
+
platform,
|
|
179
|
+
status: 'error',
|
|
180
|
+
error: err instanceof Error ? err.message : String(err),
|
|
181
|
+
};
|
|
182
|
+
post.results[platform] = errorResult;
|
|
183
|
+
return errorResult;
|
|
184
|
+
}
|
|
185
|
+
}));
|
|
186
|
+
// Determine aggregate status
|
|
187
|
+
const allResults = Object.values(post.results);
|
|
188
|
+
const hasError = allResults.some((r) => r.status === 'error');
|
|
189
|
+
const allSuccess = allResults.every((r) => r.status === 'success');
|
|
190
|
+
if (allSuccess) {
|
|
191
|
+
post.status = 'published';
|
|
192
|
+
}
|
|
193
|
+
else if (hasError) {
|
|
194
|
+
post.status = 'error';
|
|
195
|
+
}
|
|
196
|
+
post.updatedAt = new Date().toISOString();
|
|
197
|
+
return { ...post };
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* Record a platform-specific publish result.
|
|
201
|
+
*
|
|
202
|
+
* Used by external publish handlers to report results asynchronously
|
|
203
|
+
* (e.g. webhook callbacks).
|
|
204
|
+
*
|
|
205
|
+
* @param postId - ID of the post
|
|
206
|
+
* @param platform - Platform identifier
|
|
207
|
+
* @param result - The platform result to record
|
|
208
|
+
* @returns The updated SocialPost
|
|
209
|
+
* @throws {Error} If the post is not found
|
|
210
|
+
*/
|
|
211
|
+
markPlatformResult(postId, platform, result) {
|
|
212
|
+
const post = this.requirePost(postId);
|
|
213
|
+
post.results[platform] = result;
|
|
214
|
+
// Auto-transition based on aggregate results
|
|
215
|
+
const allResults = Object.values(post.results);
|
|
216
|
+
const allSuccess = allResults.every((r) => r.status === 'success');
|
|
217
|
+
const hasError = allResults.some((r) => r.status === 'error');
|
|
218
|
+
const hasPending = allResults.some((r) => r.status === 'pending');
|
|
219
|
+
if (allSuccess && !hasPending) {
|
|
220
|
+
post.status = 'published';
|
|
221
|
+
}
|
|
222
|
+
else if (hasError && !hasPending) {
|
|
223
|
+
post.status = 'error';
|
|
224
|
+
}
|
|
225
|
+
post.updatedAt = new Date().toISOString();
|
|
226
|
+
return { ...post };
|
|
227
|
+
}
|
|
228
|
+
/**
|
|
229
|
+
* Retry a failed post.
|
|
230
|
+
*
|
|
231
|
+
* Transitions the post from 'error' to 'retry', increments the retry
|
|
232
|
+
* counter, and resets failed platform results to 'pending'.
|
|
233
|
+
*
|
|
234
|
+
* @param postId - ID of the post to retry
|
|
235
|
+
* @returns The updated SocialPost in 'retry' status
|
|
236
|
+
* @throws {Error} If the post is not found, the transition is invalid,
|
|
237
|
+
* or the maximum retry count has been reached
|
|
238
|
+
*/
|
|
239
|
+
retryFailed(postId) {
|
|
240
|
+
const post = this.requirePost(postId);
|
|
241
|
+
this.assertTransition(post.status, 'retry');
|
|
242
|
+
if (post.retryCount >= post.maxRetries) {
|
|
243
|
+
throw new Error(`Post ${postId} has exceeded maximum retries (${post.maxRetries})`);
|
|
244
|
+
}
|
|
245
|
+
post.status = 'retry';
|
|
246
|
+
post.retryCount += 1;
|
|
247
|
+
post.updatedAt = new Date().toISOString();
|
|
248
|
+
// Reset failed platform results to pending for re-attempt
|
|
249
|
+
for (const platform of post.platforms) {
|
|
250
|
+
if (post.results[platform]?.status === 'error') {
|
|
251
|
+
post.results[platform] = {
|
|
252
|
+
platform,
|
|
253
|
+
status: 'pending',
|
|
254
|
+
};
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
return { ...post };
|
|
258
|
+
}
|
|
259
|
+
// --------------------------------------------------------------------------
|
|
260
|
+
// Query Operations
|
|
261
|
+
// --------------------------------------------------------------------------
|
|
262
|
+
/**
|
|
263
|
+
* Retrieve a post by ID.
|
|
264
|
+
*
|
|
265
|
+
* @param postId - ID of the post to retrieve
|
|
266
|
+
* @returns The SocialPost if found, otherwise undefined
|
|
267
|
+
*/
|
|
268
|
+
getPost(postId) {
|
|
269
|
+
const post = this.posts.get(postId);
|
|
270
|
+
return post ? { ...post } : undefined;
|
|
271
|
+
}
|
|
272
|
+
/**
|
|
273
|
+
* List posts with optional filtering by seed ID and/or status.
|
|
274
|
+
*
|
|
275
|
+
* @param seedId - Optional seed ID filter
|
|
276
|
+
* @param status - Optional status filter
|
|
277
|
+
* @returns Array of matching SocialPost objects
|
|
278
|
+
*/
|
|
279
|
+
listPosts(seedId, status) {
|
|
280
|
+
const results = [];
|
|
281
|
+
for (const post of this.posts.values()) {
|
|
282
|
+
if (seedId && post.seedId !== seedId)
|
|
283
|
+
continue;
|
|
284
|
+
if (status && post.status !== status)
|
|
285
|
+
continue;
|
|
286
|
+
results.push({ ...post });
|
|
287
|
+
}
|
|
288
|
+
return results;
|
|
289
|
+
}
|
|
290
|
+
/**
|
|
291
|
+
* Get all scheduled posts whose scheduledAt timestamp has passed.
|
|
292
|
+
*
|
|
293
|
+
* Used by a polling loop or scheduler to find posts that are due for
|
|
294
|
+
* publishing.
|
|
295
|
+
*
|
|
296
|
+
* @returns Array of SocialPost objects that are due for publishing
|
|
297
|
+
*/
|
|
298
|
+
getDuePosts() {
|
|
299
|
+
const now = new Date();
|
|
300
|
+
const results = [];
|
|
301
|
+
for (const post of this.posts.values()) {
|
|
302
|
+
if (post.status === 'scheduled' &&
|
|
303
|
+
post.scheduledAt &&
|
|
304
|
+
new Date(post.scheduledAt) <= now) {
|
|
305
|
+
results.push({ ...post });
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
return results;
|
|
309
|
+
}
|
|
310
|
+
// --------------------------------------------------------------------------
|
|
311
|
+
// Internal Helpers
|
|
312
|
+
// --------------------------------------------------------------------------
|
|
313
|
+
/**
|
|
314
|
+
* Retrieve a post or throw if not found.
|
|
315
|
+
*/
|
|
316
|
+
requirePost(postId) {
|
|
317
|
+
const post = this.posts.get(postId);
|
|
318
|
+
if (!post) {
|
|
319
|
+
throw new Error(`Social post not found: ${postId}`);
|
|
320
|
+
}
|
|
321
|
+
return post;
|
|
322
|
+
}
|
|
323
|
+
/**
|
|
324
|
+
* Assert that a state transition is valid.
|
|
325
|
+
*/
|
|
326
|
+
assertTransition(current, target) {
|
|
327
|
+
const allowed = VALID_TRANSITIONS[current];
|
|
328
|
+
if (!allowed || !allowed.includes(target)) {
|
|
329
|
+
throw new Error(`Invalid state transition: '${current}' --> '${target}'. ` +
|
|
330
|
+
`Allowed transitions from '${current}': [${(allowed ?? []).join(', ')}]`);
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
/**
|
|
334
|
+
* Initialize platform results with 'pending' status for each platform.
|
|
335
|
+
*/
|
|
336
|
+
initPlatformResults(platforms) {
|
|
337
|
+
const results = {};
|
|
338
|
+
for (const platform of platforms) {
|
|
339
|
+
results[platform] = { platform, status: 'pending' };
|
|
340
|
+
}
|
|
341
|
+
return results;
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
//# sourceMappingURL=SocialPostManager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SocialPostManager.js","sourceRoot":"","sources":["../../src/social-posting/SocialPostManager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AA+F7C,+EAA+E;AAC/E,YAAY;AACZ,+EAA+E;AAE/E,oFAAoF;AACpF,MAAM,mBAAmB,GAAG,CAAC,CAAC;AAE9B,+EAA+E;AAC/E,0BAA0B;AAC1B,+EAA+E;AAE/E;;;GAGG;AACH,MAAM,iBAAiB,GAAiD;IACtE,KAAK,EAAE,CAAC,WAAW,EAAE,YAA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C;QAC7D,KAAK,MAAM,QAAQ,IAAI,SAAS,EAAE,CAAC;YACjC,OAAO,CAAC,QAAQ,CAAC,GAAG,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC;QACtD,CAAC;QACD,OAAO,OAAO,CAAC;IACjB,CAAC;CACF"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Social Posting module barrel exports.
|
|
3
|
+
*
|
|
4
|
+
* @module @framers/agentos/social-posting
|
|
5
|
+
*
|
|
6
|
+
* Provides the post lifecycle engine ({@link SocialPostManager}) and
|
|
7
|
+
* platform-aware content adaptation ({@link ContentAdaptationEngine}).
|
|
8
|
+
*/
|
|
9
|
+
export { SocialPostManager, type SocialPost, type SocialPostStatus, type SocialPostPlatformResult, type CreateDraftInput, } from './SocialPostManager';
|
|
10
|
+
export { ContentAdaptationEngine, type PlatformConstraints, type AdaptedContent, } from './ContentAdaptationEngine';
|
|
11
|
+
export { SocialAbstractService, type SocialRequestOptions, type SocialServiceConfig, } from './SocialAbstractService';
|
|
12
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/social-posting/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,EACL,iBAAiB,EACjB,KAAK,UAAU,EACf,KAAK,gBAAgB,EACrB,KAAK,wBAAwB,EAC7B,KAAK,gBAAgB,GACtB,MAAM,qBAAqB,CAAC;AAG7B,OAAO,EACL,uBAAuB,EACvB,KAAK,mBAAmB,EACxB,KAAK,cAAc,GACpB,MAAM,2BAA2B,CAAC;AAGnC,OAAO,EACL,qBAAqB,EACrB,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,GACzB,MAAM,yBAAyB,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Social Posting module barrel exports.
|
|
3
|
+
*
|
|
4
|
+
* @module @framers/agentos/social-posting
|
|
5
|
+
*
|
|
6
|
+
* Provides the post lifecycle engine ({@link SocialPostManager}) and
|
|
7
|
+
* platform-aware content adaptation ({@link ContentAdaptationEngine}).
|
|
8
|
+
*/
|
|
9
|
+
// Post lifecycle state machine
|
|
10
|
+
export { SocialPostManager, } from './SocialPostManager.js';
|
|
11
|
+
// Platform-specific content adaptation
|
|
12
|
+
export { ContentAdaptationEngine, } from './ContentAdaptationEngine.js';
|
|
13
|
+
// Shared HTTP base class for channel service implementations
|
|
14
|
+
export { SocialAbstractService, } from './SocialAbstractService.js';
|
|
15
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/social-posting/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,+BAA+B;AAC/B,OAAO,EACL,iBAAiB,GAKlB,MAAM,qBAAqB,CAAC;AAE7B,uCAAuC;AACvC,OAAO,EACL,uBAAuB,GAGxB,MAAM,2BAA2B,CAAC;AAEnC,6DAA6D;AAC7D,OAAO,EACL,qBAAqB,GAGtB,MAAM,yBAAyB,CAAC"}
|
package/dist/voice/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/voice/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/voice/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,cAAc,YAAY,CAAC;AAC3B,YAAY,EACV,kBAAkB,EAClB,iBAAiB,EACjB,kBAAkB,EAClB,eAAe,EACf,YAAY,EACZ,mBAAmB,EACnB,kBAAkB,GACnB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,YAAY,EACV,oBAAoB,EACpB,gBAAgB,EAChB,uBAAuB,GACxB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,mBAAmB,EACnB,mBAAmB,EACnB,SAAS,EACT,YAAY,GACb,MAAM,sBAAsB,CAAC"}
|