cccc-sdk 0.1.0 → 0.1.1

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.
Files changed (50) hide show
  1. package/README.md +68 -186
  2. package/dist/client.d.ts +101 -186
  3. package/dist/client.d.ts.map +1 -0
  4. package/dist/client.js +373 -410
  5. package/dist/client.js.map +1 -0
  6. package/dist/errors.d.ts +28 -10
  7. package/dist/errors.d.ts.map +1 -0
  8. package/dist/errors.js +42 -16
  9. package/dist/errors.js.map +1 -0
  10. package/dist/index.d.ts +7 -7
  11. package/dist/index.d.ts.map +1 -0
  12. package/dist/index.js +11 -10
  13. package/dist/index.js.map +1 -0
  14. package/dist/transport.d.ts +19 -24
  15. package/dist/transport.d.ts.map +1 -0
  16. package/dist/transport.js +202 -92
  17. package/dist/transport.js.map +1 -0
  18. package/dist/types.d.ts +273 -0
  19. package/dist/types.d.ts.map +1 -0
  20. package/dist/types.js +5 -0
  21. package/dist/types.js.map +1 -0
  22. package/package.json +24 -25
  23. package/dist/types/actor.d.ts +0 -42
  24. package/dist/types/actor.d.ts.map +0 -1
  25. package/dist/types/actor.js +0 -5
  26. package/dist/types/actor.js.map +0 -1
  27. package/dist/types/context.d.ts +0 -89
  28. package/dist/types/context.d.ts.map +0 -1
  29. package/dist/types/context.js +0 -5
  30. package/dist/types/context.js.map +0 -1
  31. package/dist/types/event.d.ts +0 -15
  32. package/dist/types/event.d.ts.map +0 -1
  33. package/dist/types/event.js +0 -5
  34. package/dist/types/event.js.map +0 -1
  35. package/dist/types/group.d.ts +0 -33
  36. package/dist/types/group.d.ts.map +0 -1
  37. package/dist/types/group.js +0 -5
  38. package/dist/types/group.js.map +0 -1
  39. package/dist/types/index.d.ts +0 -10
  40. package/dist/types/index.d.ts.map +0 -1
  41. package/dist/types/index.js +0 -10
  42. package/dist/types/index.js.map +0 -1
  43. package/dist/types/ipc.d.ts +0 -24
  44. package/dist/types/ipc.d.ts.map +0 -1
  45. package/dist/types/ipc.js +0 -10
  46. package/dist/types/ipc.js.map +0 -1
  47. package/dist/types/message.d.ts +0 -53
  48. package/dist/types/message.d.ts.map +0 -1
  49. package/dist/types/message.js +0 -5
  50. package/dist/types/message.js.map +0 -1
package/README.md CHANGED
@@ -1,221 +1,103 @@
1
- # @cccc/sdk
1
+ # CCCC TypeScript SDK
2
2
 
3
- CCCC Client SDK for Node.js - IPC client for CCCC daemon.
3
+ TypeScript/Node.js client for the CCCC daemon (IPC v1).
4
4
 
5
- ## Installation
6
-
7
- ```bash
8
- npm install @cccc/sdk
9
- ```
10
-
11
- ## Requirements
12
-
13
- - Node.js >= 18.0.0
14
- - CCCC daemon running locally
15
-
16
- ## Quick Start
17
-
18
- ```typescript
19
- import { CCCCClient } from '@cccc/sdk';
20
-
21
- const client = new CCCCClient();
22
-
23
- // Check daemon is running
24
- const isRunning = await client.ping();
25
- console.log('Daemon running:', isRunning);
26
-
27
- // List all groups
28
- const groups = await client.groups.list();
29
- console.log('Groups:', groups);
30
- ```
31
-
32
- ## API Overview
5
+ ## Relationship to CCCC core
33
6
 
34
- ### Groups
35
-
36
- ```typescript
37
- // List groups
38
- const groups = await client.groups.list();
39
-
40
- // Get group info
41
- const group = await client.groups.get('g_abc123');
42
-
43
- // Create group
44
- const newGroup = await client.groups.create({
45
- title: 'My Project',
46
- topic: 'Building something awesome',
47
- url: '/path/to/project',
48
- });
49
-
50
- // Start/Stop group
51
- await client.groups.start('g_abc123');
52
- await client.groups.stop('g_abc123');
53
-
54
- // Set group state
55
- await client.groups.setState('g_abc123', 'active', 'user');
56
- ```
57
-
58
- ### Actors
59
-
60
- ```typescript
61
- // List actors
62
- const actors = await client.actors.list('g_abc123');
63
-
64
- // Add actor
65
- const actor = await client.actors.add('g_abc123', 'user', {
66
- actor_id: 'agent-1',
67
- runtime: 'claude',
68
- runner: 'pty',
69
- title: 'Claude Agent',
70
- });
71
-
72
- // Start/Stop/Restart actor
73
- await client.actors.start('g_abc123', 'agent-1', 'user');
74
- await client.actors.stop('g_abc123', 'agent-1', 'user');
75
- await client.actors.restart('g_abc123', 'agent-1', 'user');
76
-
77
- // Remove actor
78
- await client.actors.remove('g_abc123', 'agent-1', 'user');
79
- ```
7
+ - CCCC core repository: https://github.com/ChesterRa/cccc
8
+ - `cccc` core provides daemon/web/CLI and owns runtime state.
9
+ - `cccc-sdk` provides Node.js client APIs that call the daemon over IPC.
80
10
 
81
- ### Messages
82
-
83
- ```typescript
84
- // Send message
85
- const event = await client.messages.send('g_abc123', 'user', {
86
- text: 'Hello agents!',
87
- to: ['agent-1', 'agent-2'],
88
- });
11
+ ## Installation
89
12
 
90
- // Reply to message
91
- await client.messages.reply('g_abc123', 'user', {
92
- event_id: 'abc123',
93
- text: 'Got it!',
94
- });
13
+ ```bash
14
+ npm install cccc-sdk
95
15
  ```
96
16
 
97
- ### Inbox
17
+ ## Quick start
98
18
 
99
19
  ```typescript
100
- // List inbox messages
101
- const messages = await client.inbox.list('g_abc123', 'agent-1', {
102
- kind_filter: 'chat',
103
- limit: 50,
104
- });
105
-
106
- // Mark as read
107
- await client.inbox.markRead('g_abc123', 'agent-1', 'event_id');
20
+ import { CCCCClient } from 'cccc-sdk';
21
+
22
+ async function main() {
23
+ const client = await CCCCClient.create();
24
+
25
+ await client.assertCompatible({
26
+ requireIpcV: 1,
27
+ requireCapabilities: { events_stream: true },
28
+ requireOps: ['groups', 'send', 'reply', 'group_automation_manage'],
29
+ });
30
+
31
+ const group = await client.groupCreate({ title: 'TS demo' });
32
+ const groupId = String(group.group_id || '');
33
+
34
+ await client.send({
35
+ groupId,
36
+ text: 'Please check this and reply.',
37
+ priority: 'attention',
38
+ replyRequired: true,
39
+ });
40
+ }
108
41
 
109
- // Mark all as read
110
- await client.inbox.markAllRead('g_abc123', 'agent-1');
42
+ main().catch(console.error);
111
43
  ```
112
44
 
113
- ### Context
45
+ ## Message semantics
114
46
 
115
- ```typescript
116
- // Get context
117
- const ctx = await client.context.get('g_abc123');
118
- console.log('Vision:', ctx.vision);
119
- console.log('Milestones:', ctx.milestones);
47
+ - `priority`: `'normal' | 'attention'`
48
+ - `replyRequired`: `boolean` (maps to daemon `reply_required`)
120
49
 
121
- // Update vision
122
- await client.vision.update('g_abc123', 'Build the best product');
50
+ Supported in:
51
+ - `send(options)`
52
+ - `reply(options)`
53
+ - `sendCrossGroup(options)`
123
54
 
124
- // Update sketch
125
- await client.sketch.update('g_abc123', '## Architecture\n...');
126
- ```
55
+ ## Automation semantics
127
56
 
128
- ### Tasks
57
+ `groupAutomationManage` is action-list based (canonical daemon shape):
129
58
 
130
59
  ```typescript
131
- // List tasks
132
- const tasks = await client.tasks.list('g_abc123');
133
-
134
- // Create task
135
- const task = await client.tasks.create('g_abc123', {
136
- name: 'Implement feature X',
137
- goal: 'Feature X works correctly',
138
- steps: [
139
- { name: 'Design API', acceptance: 'API spec documented' },
140
- { name: 'Implement', acceptance: 'Code written and tested' },
141
- { name: 'Review', acceptance: 'PR approved' },
60
+ await client.groupAutomationManage({
61
+ groupId,
62
+ actions: [
63
+ {
64
+ type: 'create_rule',
65
+ rule: {
66
+ id: 'standup',
67
+ enabled: true,
68
+ scope: 'group',
69
+ to: ['@foreman'],
70
+ trigger: { kind: 'interval', every_seconds: 900 },
71
+ action: { kind: 'notify', snippet_ref: 'standup' },
72
+ },
73
+ },
142
74
  ],
143
75
  });
144
-
145
- // Update task status
146
- await client.tasks.update('g_abc123', {
147
- task_id: task.id,
148
- status: 'active',
149
- });
150
76
  ```
151
77
 
152
- ### Milestones
78
+ ## Events stream
153
79
 
154
80
  ```typescript
155
- // Create milestone
156
- const milestone = await client.milestones.create('g_abc123', {
157
- name: 'MVP',
158
- description: 'Minimum viable product',
159
- });
160
-
161
- // Complete milestone
162
- await client.milestones.complete('g_abc123', milestone.id, 'Shipped!');
163
- ```
164
-
165
- ## Error Handling
166
-
167
- ```typescript
168
- import { CCCCClient, CCCCError } from '@cccc/sdk';
169
-
170
- const client = new CCCCClient();
171
-
172
- try {
173
- await client.groups.get('invalid-id');
174
- } catch (error) {
175
- if (error instanceof CCCCError) {
176
- console.error('CCCC Error:', error.code, error.message);
177
- // Handle specific errors
178
- switch (error.code) {
179
- case 'DAEMON_NOT_RUNNING':
180
- console.error('Please start CCCC daemon first');
181
- break;
182
- case 'GROUP_NOT_FOUND':
183
- console.error('Group does not exist');
184
- break;
185
- }
81
+ for await (const item of client.eventsStream({ groupId })) {
82
+ if (item.t === 'event') {
83
+ console.log(item.event.kind, item.event.id);
186
84
  }
187
85
  }
188
86
  ```
189
87
 
190
- ## Configuration
88
+ ## Build and checks
191
89
 
192
- ```typescript
193
- const client = new CCCCClient({
194
- // Custom CCCC home directory (default: ~/.cccc)
195
- ccccHome: '/custom/path/.cccc',
196
- // Request timeout in ms (default: 60000)
197
- timeoutMs: 30000,
198
- });
90
+ ```bash
91
+ npm ci
92
+ npm run typecheck
93
+ npm run build
199
94
  ```
200
95
 
201
- ## Low-level API
202
-
203
- For operations not covered by the high-level API:
204
-
205
- ```typescript
206
- // Direct daemon call
207
- const response = await client.call('custom_op', {
208
- arg1: 'value1',
209
- arg2: 'value2',
210
- });
96
+ ## Requirements
211
97
 
212
- if (response.ok) {
213
- console.log('Result:', response.result);
214
- } else {
215
- console.error('Error:', response.error);
216
- }
217
- ```
98
+ - Node.js 16+
99
+ - Running CCCC daemon
218
100
 
219
101
  ## License
220
102
 
221
- MIT
103
+ Apache-2.0
package/dist/client.d.ts CHANGED
@@ -1,262 +1,177 @@
1
1
  /**
2
- * CCCC Client SDK
3
- *
4
- * High-level API for interacting with CCCC daemon
2
+ * CCCC SDK client
5
3
  */
6
- import { type TransportOptions } from './transport.js';
7
- import { type DaemonResponse } from './types/ipc.js';
8
- import type { Actor, ActorAddOptions, GroupState, HeadlessState } from './types/actor.js';
9
- import type { GroupInfo, GroupCreateOptions, GroupUpdatePatch } from './types/group.js';
10
- import type { SendMessageOptions, ReplyMessageOptions, InboxMessage, InboxListOptions } from './types/message.js';
11
- import type { Event } from './types/event.js';
12
- import type { Context, ContextSyncOp, Task, TaskCreateOptions, TaskUpdateOptions, Milestone, MilestoneCreateOptions } from './types/context.js';
13
- export interface CCCCClientOptions extends TransportOptions {
14
- }
4
+ import type { DaemonEndpoint, DaemonResponse, CCCCClientOptions, CompatibilityOptions, SendOptions, SendCrossGroupOptions, ReplyOptions, ActorAddOptions, ActorUpdateOptions, ActorEnvPrivateUpdateOptions, GroupCreateOptions, GroupUpdateOptions, GroupAutomationUpdateOptions, GroupAutomationManageOptions, GroupAutomationResetBaselineOptions, InboxListOptions, ContextSyncOptions, EventsStreamOptions, EventStreamItem } from './types.js';
15
5
  /**
16
- * Groups API
6
+ * CCCC client
17
7
  */
18
- declare class GroupsAPI {
19
- private client;
20
- constructor(client: CCCCClient);
8
+ export declare class CCCCClient {
9
+ private readonly _endpoint;
10
+ private readonly _timeoutMs;
11
+ private constructor();
21
12
  /**
22
- * List all groups
13
+ * Async factory method: create a client instance
23
14
  */
24
- list(): Promise<GroupInfo[]>;
15
+ static create(options?: CCCCClientOptions): Promise<CCCCClient>;
25
16
  /**
26
- * Get group info
17
+ * Get the current endpoint
27
18
  */
28
- get(groupId: string): Promise<GroupInfo>;
19
+ get endpoint(): DaemonEndpoint;
29
20
  /**
30
- * Create a new group
21
+ * Send raw IPC request and return the full response
31
22
  */
32
- create(options: GroupCreateOptions): Promise<GroupInfo>;
23
+ callRaw(op: string, args?: Record<string, unknown>): Promise<DaemonResponse>;
33
24
  /**
34
- * Set group state
25
+ * Send IPC request and return only result payload
26
+ */
27
+ call(op: string, args?: Record<string, unknown>): Promise<Record<string, unknown>>;
28
+ /**
29
+ * Compatibility check
30
+ */
31
+ assertCompatible(options?: CompatibilityOptions): Promise<Record<string, unknown>>;
32
+ /**
33
+ * Ping daemon
34
+ */
35
+ ping(): Promise<Record<string, unknown>>;
36
+ /**
37
+ * List all groups
35
38
  */
36
- setState(groupId: string, state: GroupState, by: string): Promise<void>;
39
+ groups(): Promise<Record<string, unknown>>;
37
40
  /**
38
- * Start group (activate all enabled actors)
41
+ * Show group details
39
42
  */
40
- start(groupId: string): Promise<void>;
43
+ groupShow(groupId: string): Promise<Record<string, unknown>>;
41
44
  /**
42
- * Stop group (stop all actors)
45
+ * Create group
43
46
  */
44
- stop(groupId: string): Promise<void>;
47
+ groupCreate(options?: GroupCreateOptions): Promise<Record<string, unknown>>;
45
48
  /**
46
49
  * Update group
47
50
  */
48
- update(groupId: string, patch: GroupUpdatePatch): Promise<void>;
51
+ groupUpdate(options: GroupUpdateOptions): Promise<Record<string, unknown>>;
49
52
  /**
50
53
  * Delete group
51
54
  */
52
- delete(groupId: string): Promise<void>;
53
- }
54
- /**
55
- * Actors API
56
- */
57
- declare class ActorsAPI {
58
- private client;
59
- constructor(client: CCCCClient);
55
+ groupDelete(groupId: string, by?: string): Promise<Record<string, unknown>>;
60
56
  /**
61
- * List actors in a group
57
+ * Use group (set active scope)
62
58
  */
63
- list(groupId: string): Promise<Actor[]>;
59
+ groupUse(groupId: string, path: string, by?: string): Promise<Record<string, unknown>>;
64
60
  /**
65
- * Add an actor to a group
61
+ * Set group state
66
62
  */
67
- add(groupId: string, by: string, options: ActorAddOptions): Promise<Actor>;
63
+ groupSetState(groupId: string, state: 'active' | 'idle' | 'paused', by?: string): Promise<Record<string, unknown>>;
68
64
  /**
69
- * Start an actor
65
+ * Update group settings
70
66
  */
71
- start(groupId: string, actorId: string, by: string): Promise<void>;
67
+ groupSettingsUpdate(groupId: string, patch: Record<string, unknown>, by?: string): Promise<Record<string, unknown>>;
72
68
  /**
73
- * Stop an actor
69
+ * Read group-level automation state (rules, snippets, next run, ...)
74
70
  */
75
- stop(groupId: string, actorId: string, by: string): Promise<void>;
71
+ groupAutomationState(groupId: string, by?: string): Promise<Record<string, unknown>>;
76
72
  /**
77
- * Restart an actor
73
+ * Replace group-level automation (rules + snippets)
78
74
  */
79
- restart(groupId: string, actorId: string, by: string): Promise<void>;
75
+ groupAutomationUpdate(options: GroupAutomationUpdateOptions): Promise<Record<string, unknown>>;
80
76
  /**
81
- * Remove an actor
77
+ * Incrementally manage group-level automation (actions[])
82
78
  */
83
- remove(groupId: string, actorId: string, by: string): Promise<void>;
84
- }
85
- /**
86
- * Messages API
87
- */
88
- declare class MessagesAPI {
89
- private client;
90
- constructor(client: CCCCClient);
79
+ groupAutomationManage(options: GroupAutomationManageOptions): Promise<Record<string, unknown>>;
91
80
  /**
92
- * Send a message
81
+ * Reset group-level automation to baseline
93
82
  */
94
- send(groupId: string, by: string, options: SendMessageOptions): Promise<Event>;
83
+ groupAutomationResetBaseline(options: GroupAutomationResetBaselineOptions): Promise<Record<string, unknown>>;
95
84
  /**
96
- * Reply to a message
85
+ * Start group
97
86
  */
98
- reply(groupId: string, by: string, options: ReplyMessageOptions): Promise<Event>;
99
- }
100
- /**
101
- * Inbox API
102
- */
103
- declare class InboxAPI {
104
- private client;
105
- constructor(client: CCCCClient);
87
+ groupStart(groupId: string, by?: string): Promise<Record<string, unknown>>;
106
88
  /**
107
- * List inbox messages
89
+ * Stop group
108
90
  */
109
- list(groupId: string, actorId: string, options?: InboxListOptions): Promise<InboxMessage[]>;
91
+ groupStop(groupId: string, by?: string): Promise<Record<string, unknown>>;
110
92
  /**
111
- * Mark messages as read up to event_id
93
+ * Attach path to group
112
94
  */
113
- markRead(groupId: string, actorId: string, eventId: string): Promise<void>;
95
+ attach(path: string, groupId?: string, by?: string): Promise<Record<string, unknown>>;
114
96
  /**
115
- * Mark all messages as read
97
+ * List actors in group
116
98
  */
117
- markAllRead(groupId: string, actorId: string): Promise<void>;
118
- }
119
- /**
120
- * Context API
121
- */
122
- declare class ContextAPI {
123
- private client;
124
- constructor(client: CCCCClient);
99
+ actorList(groupId: string): Promise<Record<string, unknown>>;
125
100
  /**
126
- * Get project context
101
+ * Add actor
127
102
  */
128
- get(groupId: string): Promise<Context>;
103
+ actorAdd(options: ActorAddOptions): Promise<Record<string, unknown>>;
129
104
  /**
130
- * Sync context with batch operations
105
+ * Update actor
131
106
  */
132
- sync(groupId: string, ops: ContextSyncOp[], dryRun?: boolean): Promise<Record<string, unknown>>;
133
- }
134
- /**
135
- * Tasks API
136
- */
137
- declare class TasksAPI {
138
- private client;
139
- constructor(client: CCCCClient);
107
+ actorUpdate(options: ActorUpdateOptions): Promise<Record<string, unknown>>;
140
108
  /**
141
- * List tasks
109
+ * Remove actor
142
110
  */
143
- list(groupId: string, includeArchived?: boolean): Promise<Task[]>;
111
+ actorRemove(groupId: string, actorId: string, by?: string): Promise<Record<string, unknown>>;
144
112
  /**
145
- * Create a task
113
+ * Start actor
146
114
  */
147
- create(groupId: string, options: TaskCreateOptions): Promise<Task>;
115
+ actorStart(groupId: string, actorId: string, by?: string): Promise<Record<string, unknown>>;
148
116
  /**
149
- * Update a task
117
+ * Stop actor
150
118
  */
151
- update(groupId: string, options: TaskUpdateOptions): Promise<Task>;
152
- }
153
- /**
154
- * Milestones API
155
- */
156
- declare class MilestonesAPI {
157
- private client;
158
- constructor(client: CCCCClient);
119
+ actorStop(groupId: string, actorId: string, by?: string): Promise<Record<string, unknown>>;
159
120
  /**
160
- * Create a milestone
121
+ * Restart actor
161
122
  */
162
- create(groupId: string, options: MilestoneCreateOptions): Promise<Milestone>;
123
+ actorRestart(groupId: string, actorId: string, by?: string): Promise<Record<string, unknown>>;
163
124
  /**
164
- * Complete a milestone
125
+ * List actor private env keys (without values)
165
126
  */
166
- complete(groupId: string, milestoneId: string, outcomes: string): Promise<void>;
167
- }
168
- /**
169
- * Vision API
170
- */
171
- declare class VisionAPI {
172
- private client;
173
- constructor(client: CCCCClient);
127
+ actorEnvPrivateKeys(groupId: string, actorId: string, by?: string): Promise<Record<string, unknown>>;
174
128
  /**
175
- * Update project vision
129
+ * Update actor private env vars (runtime-only; values are never echoed)
176
130
  */
177
- update(groupId: string, vision: string): Promise<void>;
178
- }
179
- /**
180
- * Sketch API
181
- */
182
- declare class SketchAPI {
183
- private client;
184
- constructor(client: CCCCClient);
131
+ actorEnvPrivateUpdate(options: ActorEnvPrivateUpdateOptions): Promise<Record<string, unknown>>;
185
132
  /**
186
- * Update execution sketch
133
+ * Send message
187
134
  */
188
- update(groupId: string, sketch: string): Promise<void>;
189
- }
190
- /**
191
- * Headless API for MCP-driven actors
192
- */
193
- declare class HeadlessAPI {
194
- private client;
195
- constructor(client: CCCCClient);
135
+ send(options: SendOptions): Promise<Record<string, unknown>>;
196
136
  /**
197
- * Get headless session status
137
+ * Send message across groups
198
138
  */
199
- status(groupId: string, actorId: string): Promise<HeadlessState>;
139
+ sendCrossGroup(options: SendCrossGroupOptions): Promise<Record<string, unknown>>;
200
140
  /**
201
- * Set headless session status
141
+ * Reply message
202
142
  */
203
- setStatus(groupId: string, actorId: string, status: 'idle' | 'working' | 'waiting' | 'stopped', taskId?: string): Promise<void>;
143
+ reply(options: ReplyOptions): Promise<Record<string, unknown>>;
204
144
  /**
205
- * Acknowledge processed message
145
+ * Acknowledge chat message
206
146
  */
207
- ackMessage(groupId: string, actorId: string, messageId: string): Promise<void>;
208
- }
209
- /**
210
- * CCCC Client
211
- *
212
- * Main entry point for SDK
213
- *
214
- * @example
215
- * ```typescript
216
- * const client = new CCCCClient();
217
- *
218
- * // List all groups
219
- * const groups = await client.groups.list();
220
- *
221
- * // Add an actor
222
- * await client.actors.add(groupId, 'user', {
223
- * actor_id: 'agent-1',
224
- * runtime: 'claude',
225
- * runner: 'pty'
226
- * });
227
- *
228
- * // Send a message
229
- * await client.messages.send(groupId, 'user', {
230
- * text: 'Hello agents!',
231
- * to: ['agent-1']
232
- * });
233
- * ```
234
- */
235
- export declare class CCCCClient {
236
- private options;
237
- readonly groups: GroupsAPI;
238
- readonly actors: ActorsAPI;
239
- readonly messages: MessagesAPI;
240
- readonly inbox: InboxAPI;
241
- readonly context: ContextAPI;
242
- readonly tasks: TasksAPI;
243
- readonly milestones: MilestonesAPI;
244
- readonly vision: VisionAPI;
245
- readonly sketch: SketchAPI;
246
- readonly headless: HeadlessAPI;
247
- constructor(options?: CCCCClientOptions);
147
+ chatAck(groupId: string, actorId: string, eventId: string, by?: string): Promise<Record<string, unknown>>;
148
+ /**
149
+ * List inbox
150
+ */
151
+ inboxList(options: InboxListOptions): Promise<Record<string, unknown>>;
152
+ /**
153
+ * Mark message as read
154
+ */
155
+ inboxMarkRead(groupId: string, actorId: string, eventId: string, by?: string): Promise<Record<string, unknown>>;
156
+ /**
157
+ * Mark all messages as read
158
+ */
159
+ inboxMarkAllRead(groupId: string, actorId: string, by?: string, kindFilter?: string): Promise<Record<string, unknown>>;
160
+ /**
161
+ * Acknowledge notification
162
+ */
163
+ notifyAck(groupId: string, actorId: string, notifyEventId: string, by?: string): Promise<Record<string, unknown>>;
248
164
  /**
249
- * Ping daemon to check if it's running
165
+ * Get group context
250
166
  */
251
- ping(): Promise<boolean>;
167
+ contextGet(groupId: string): Promise<Record<string, unknown>>;
252
168
  /**
253
- * Low-level daemon call
169
+ * Sync context
254
170
  */
255
- call(op: string, args: Record<string, unknown>): Promise<DaemonResponse>;
171
+ contextSync(options: ContextSyncOptions): Promise<Record<string, unknown>>;
256
172
  /**
257
- * Shutdown the daemon
173
+ * Subscribe to event stream
258
174
  */
259
- shutdown(): Promise<void>;
175
+ eventsStream(options: EventsStreamOptions): AsyncGenerator<EventStreamItem>;
260
176
  }
261
- export {};
262
177
  //# sourceMappingURL=client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EACV,cAAc,EAEd,cAAc,EACd,iBAAiB,EACjB,oBAAoB,EACpB,WAAW,EACX,qBAAqB,EACrB,YAAY,EACZ,eAAe,EACf,kBAAkB,EAClB,4BAA4B,EAC5B,kBAAkB,EAClB,kBAAkB,EAClB,4BAA4B,EAC5B,4BAA4B,EAC5B,mCAAmC,EACnC,gBAAgB,EAChB,kBAAkB,EAClB,mBAAmB,EACnB,eAAe,EAChB,MAAM,YAAY,CAAC;AAYpB;;GAEG;AACH,qBAAa,UAAU;I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