@synap-core/cli 1.6.1 → 1.7.0
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/commands/data.js +16 -9
- package/dist/commands/data.js.map +1 -1
- package/dist/commands/discover.d.ts +18 -0
- package/dist/commands/discover.js +71 -0
- package/dist/commands/discover.js.map +1 -0
- package/dist/commands/knowledge.js +9 -5
- package/dist/commands/knowledge.js.map +1 -1
- package/dist/index.js +11 -0
- package/dist/index.js.map +1 -1
- package/dist/lib/hub-client.d.ts +8 -0
- package/dist/lib/hub-client.js +14 -0
- package/dist/lib/hub-client.js.map +1 -1
- package/dist/lib/pod.d.ts +8 -0
- package/dist/lib/pod.js +9 -1
- package/dist/lib/pod.js.map +1 -1
- package/dist/lib/targets.js +31 -7
- package/dist/lib/targets.js.map +1 -1
- package/node_modules/@synap/hub-rest-client/dist/index.cjs +881 -0
- package/node_modules/@synap/hub-rest-client/dist/index.d.cts +907 -0
- package/node_modules/@synap/hub-rest-client/dist/index.d.ts +907 -0
- package/node_modules/@synap/hub-rest-client/dist/index.js +851 -0
- package/node_modules/@synap/hub-rest-client/package.json +45 -0
- package/node_modules/@synap/hub-rest-client/src/client.ts +1143 -0
- package/node_modules/@synap/hub-rest-client/src/errors.ts +30 -0
- package/node_modules/@synap/hub-rest-client/src/index.ts +111 -0
- package/node_modules/@synap/hub-rest-client/src/setup.ts +77 -0
- package/node_modules/@synap/hub-rest-client/src/types.ts +639 -0
- package/package.json +8 -2
- package/skills/synap/SKILL.md +19 -20
|
@@ -0,0 +1,639 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @synap/hub-rest-client — Hub Protocol REST API Types
|
|
3
|
+
*
|
|
4
|
+
* Canonical TypeScript interfaces for all objects returned by the
|
|
5
|
+
* Synap Hub Protocol REST API (`/api/hub/*`).
|
|
6
|
+
*
|
|
7
|
+
* These are the source of truth for external consumers (Raycast extension,
|
|
8
|
+
* CLI, third-party integrations). Keep in sync with hub-protocol-rest.ts
|
|
9
|
+
* response shapes in synap-backend.
|
|
10
|
+
*
|
|
11
|
+
* Zero runtime dependencies — pure TypeScript interfaces.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
// ─── Core entities ───────────────────────────────────────────────────────────
|
|
15
|
+
|
|
16
|
+
export interface HubEntity {
|
|
17
|
+
id: string;
|
|
18
|
+
title: string;
|
|
19
|
+
profileSlug: string;
|
|
20
|
+
workspaceId: string | null;
|
|
21
|
+
/** JSONB property bag — keys depend on the profile schema */
|
|
22
|
+
properties: Record<string, unknown>;
|
|
23
|
+
createdAt: string;
|
|
24
|
+
updatedAt: string;
|
|
25
|
+
// Convenience shortcuts pulled from properties at response time
|
|
26
|
+
status?: string;
|
|
27
|
+
priority?: string;
|
|
28
|
+
dueDate?: string;
|
|
29
|
+
content?: string;
|
|
30
|
+
url?: string;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export interface HubDocument {
|
|
34
|
+
id: string;
|
|
35
|
+
title: string;
|
|
36
|
+
content: string;
|
|
37
|
+
workspaceId: string | null;
|
|
38
|
+
createdAt: string;
|
|
39
|
+
updatedAt: string;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export interface HubChannel {
|
|
43
|
+
id: string;
|
|
44
|
+
name: string;
|
|
45
|
+
type:
|
|
46
|
+
| "personal"
|
|
47
|
+
| "thread"
|
|
48
|
+
| "sub_thread"
|
|
49
|
+
| "feed"
|
|
50
|
+
| "external"
|
|
51
|
+
| "agent_collab";
|
|
52
|
+
workspaceId: string | null;
|
|
53
|
+
agentType?: string;
|
|
54
|
+
contextObjectType?:
|
|
55
|
+
| "workspace"
|
|
56
|
+
| "entity"
|
|
57
|
+
| "document"
|
|
58
|
+
| "view"
|
|
59
|
+
| "project"
|
|
60
|
+
| "task"
|
|
61
|
+
| "user"
|
|
62
|
+
| "external"
|
|
63
|
+
| null;
|
|
64
|
+
contextObjectId?: string | null;
|
|
65
|
+
createdAt: string;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export interface HubWorkspace {
|
|
69
|
+
id: string;
|
|
70
|
+
name: string;
|
|
71
|
+
role?: string;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/** GET /api/hub/workspaces — canonical Hub Protocol shape (not `data`). */
|
|
75
|
+
export interface HubWorkspacesListResponse {
|
|
76
|
+
workspaces: HubWorkspace[];
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/** GET /api/hub/users/me returns at least `id` (and `scopes`); email may be omitted. */
|
|
80
|
+
export interface HubUser {
|
|
81
|
+
id: string;
|
|
82
|
+
email?: string;
|
|
83
|
+
name?: string;
|
|
84
|
+
scopes?: string[];
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export interface HubMemoryResult {
|
|
88
|
+
id: string;
|
|
89
|
+
content: string;
|
|
90
|
+
score?: number;
|
|
91
|
+
createdAt: string;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
// ─── Response wrappers ───────────────────────────────────────────────────────
|
|
95
|
+
|
|
96
|
+
export interface HubListResponse<T> {
|
|
97
|
+
data: T[];
|
|
98
|
+
total?: number;
|
|
99
|
+
hasMore?: boolean;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
export interface HubSingleResponse<T> {
|
|
103
|
+
data: T;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
// ─── Input types ─────────────────────────────────────────────────────────────
|
|
107
|
+
|
|
108
|
+
export interface CreateEntityInput {
|
|
109
|
+
profileSlug: string;
|
|
110
|
+
title: string;
|
|
111
|
+
workspaceId?: string;
|
|
112
|
+
properties?: Record<string, unknown>;
|
|
113
|
+
content?: string;
|
|
114
|
+
url?: string;
|
|
115
|
+
status?: string;
|
|
116
|
+
priority?: "low" | "medium" | "high" | "urgent";
|
|
117
|
+
dueDate?: string;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
export interface UpdateEntityInput {
|
|
121
|
+
title?: string;
|
|
122
|
+
properties?: Record<string, unknown>;
|
|
123
|
+
content?: string;
|
|
124
|
+
url?: string;
|
|
125
|
+
status?: string;
|
|
126
|
+
priority?: "low" | "medium" | "high" | "urgent";
|
|
127
|
+
dueDate?: string;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
export interface CreateDocumentInput {
|
|
131
|
+
title: string;
|
|
132
|
+
content?: string;
|
|
133
|
+
workspaceId?: string;
|
|
134
|
+
entityId?: string;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
export interface StoreMemoryInput {
|
|
138
|
+
fact: string;
|
|
139
|
+
context?: string;
|
|
140
|
+
workspaceId?: string;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
export interface SendToChannelInput {
|
|
144
|
+
channelId: string;
|
|
145
|
+
content: string;
|
|
146
|
+
/** Defaults to the authenticated user (GET /users/me). */
|
|
147
|
+
userId?: string;
|
|
148
|
+
role?: "system" | "assistant" | "user";
|
|
149
|
+
/** When true, may queue an IS response on AI-active threads (server-side). */
|
|
150
|
+
autoRespond?: boolean;
|
|
151
|
+
workspaceId?: string;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
// ─── Setup types ─────────────────────────────────────────────────────────────
|
|
155
|
+
|
|
156
|
+
export interface AgentSetupResult {
|
|
157
|
+
hubApiKey: string;
|
|
158
|
+
agentUserId: string;
|
|
159
|
+
workspaceId: string;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
export interface PodStatus {
|
|
163
|
+
url: string;
|
|
164
|
+
healthy: boolean;
|
|
165
|
+
version?: string;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
// ─── Capture pipeline types ───────────────────────────────────────────────────
|
|
169
|
+
|
|
170
|
+
export interface CaptureProposal {
|
|
171
|
+
tempId: string;
|
|
172
|
+
profileSlug: string;
|
|
173
|
+
title: string;
|
|
174
|
+
description?: string;
|
|
175
|
+
properties?: Record<string, unknown>;
|
|
176
|
+
confidence: number;
|
|
177
|
+
action: "create" | "link" | "dismiss";
|
|
178
|
+
linkedEntityId?: string;
|
|
179
|
+
linkedEntityTitle?: string;
|
|
180
|
+
dedupCandidates?: Array<{
|
|
181
|
+
entityId: string;
|
|
182
|
+
title: string;
|
|
183
|
+
profileSlug: string;
|
|
184
|
+
score: number;
|
|
185
|
+
}>;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
export interface CaptureRelation {
|
|
189
|
+
sourceTempId: string;
|
|
190
|
+
targetTempId: string;
|
|
191
|
+
relationType: string;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
export interface CaptureStructureResponse {
|
|
195
|
+
proposals: CaptureProposal[];
|
|
196
|
+
relations: CaptureRelation[];
|
|
197
|
+
followUp: string | null;
|
|
198
|
+
dedupCandidates?: Record<
|
|
199
|
+
string,
|
|
200
|
+
Array<{ entityId: string; title: string; score: number }>
|
|
201
|
+
>;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
export interface CaptureExecuteInput {
|
|
205
|
+
entities: Array<{
|
|
206
|
+
tempId: string;
|
|
207
|
+
profileSlug: string;
|
|
208
|
+
title: string;
|
|
209
|
+
description?: string;
|
|
210
|
+
properties?: Record<string, unknown>;
|
|
211
|
+
action: "create" | "link" | "dismiss";
|
|
212
|
+
linkedEntityId?: string;
|
|
213
|
+
confidence?: number;
|
|
214
|
+
}>;
|
|
215
|
+
relations?: CaptureRelation[];
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
export interface CaptureExecuteResponse {
|
|
219
|
+
created: Array<{
|
|
220
|
+
tempId: string;
|
|
221
|
+
entityId: string;
|
|
222
|
+
profileSlug: string;
|
|
223
|
+
linked: boolean;
|
|
224
|
+
}>;
|
|
225
|
+
relations: Array<{
|
|
226
|
+
sourceTempId: string;
|
|
227
|
+
targetTempId: string;
|
|
228
|
+
relationType: string;
|
|
229
|
+
}>;
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
// ─── Relations & Graph ───────────────────────────────────────────────────────
|
|
233
|
+
|
|
234
|
+
export interface HubRelation {
|
|
235
|
+
id: string;
|
|
236
|
+
sourceEntityId: string;
|
|
237
|
+
targetEntityId: string;
|
|
238
|
+
type: string;
|
|
239
|
+
label?: string;
|
|
240
|
+
createdAt: string;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
export interface HubGraphNode extends HubEntity {
|
|
244
|
+
depth: number;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
export interface HubGraphEdge {
|
|
248
|
+
sourceId: string;
|
|
249
|
+
targetId: string;
|
|
250
|
+
type: string;
|
|
251
|
+
label?: string;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
export interface HubGraphResult {
|
|
255
|
+
nodes: HubGraphNode[];
|
|
256
|
+
edges: HubGraphEdge[];
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
/**
|
|
260
|
+
* A single link returned by getConnections() — unified view across three sources:
|
|
261
|
+
* - `"graph"` : an explicit row in the relations table
|
|
262
|
+
* - `"property"` : derived from another entity's `entity_id` property pointing here
|
|
263
|
+
* - `"thread"` : a chat thread created, updated, or referenced this entity
|
|
264
|
+
*/
|
|
265
|
+
export interface HubConnection {
|
|
266
|
+
entityId: string;
|
|
267
|
+
entity: HubEntity | null;
|
|
268
|
+
label: string;
|
|
269
|
+
direction: "outgoing" | "incoming" | "structural";
|
|
270
|
+
source: "graph" | "property" | "thread";
|
|
271
|
+
relationType?: string;
|
|
272
|
+
propertySlug?: string;
|
|
273
|
+
propertyLabel?: string;
|
|
274
|
+
channelId?: string;
|
|
275
|
+
channelRelationshipType?: string;
|
|
276
|
+
createdAt?: string | null;
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
export interface HubConnectionsResult {
|
|
280
|
+
connections: HubConnection[];
|
|
281
|
+
counts: {
|
|
282
|
+
total: number;
|
|
283
|
+
graph: number;
|
|
284
|
+
structural: number;
|
|
285
|
+
threads: number;
|
|
286
|
+
};
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
// ─── Profiles & Property Defs ────────────────────────────────────────────────
|
|
290
|
+
|
|
291
|
+
export interface HubProfile {
|
|
292
|
+
id: string;
|
|
293
|
+
slug: string;
|
|
294
|
+
displayName: string;
|
|
295
|
+
description?: string;
|
|
296
|
+
entityScope: "pod" | "workspace";
|
|
297
|
+
parentSlug?: string;
|
|
298
|
+
icon?: string;
|
|
299
|
+
color?: string;
|
|
300
|
+
properties?: HubPropertyDef[];
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
export interface HubPropertyDef {
|
|
304
|
+
id: string;
|
|
305
|
+
slug: string;
|
|
306
|
+
displayName: string;
|
|
307
|
+
type:
|
|
308
|
+
| "string"
|
|
309
|
+
| "number"
|
|
310
|
+
| "boolean"
|
|
311
|
+
| "date"
|
|
312
|
+
| "entity_id"
|
|
313
|
+
| "array"
|
|
314
|
+
| "object"
|
|
315
|
+
| "secret";
|
|
316
|
+
required?: boolean;
|
|
317
|
+
options?: string[];
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
// ─── Discover ────────────────────────────────────────────────────────────────
|
|
321
|
+
|
|
322
|
+
export interface HubDiscoverProperty {
|
|
323
|
+
slug: string;
|
|
324
|
+
displayName: string;
|
|
325
|
+
type: string;
|
|
326
|
+
options?: string[];
|
|
327
|
+
required?: boolean;
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
export interface HubDiscoverProfile {
|
|
331
|
+
slug: string;
|
|
332
|
+
displayName: string;
|
|
333
|
+
scope: "pod" | "workspace";
|
|
334
|
+
description?: string | null;
|
|
335
|
+
icon?: string | null;
|
|
336
|
+
properties: HubDiscoverProperty[];
|
|
337
|
+
createCommand: string;
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
export interface HubDiscoverResult {
|
|
341
|
+
profiles: HubDiscoverProfile[];
|
|
342
|
+
commands: Record<string, string>;
|
|
343
|
+
hint: string;
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
// ─── Threads & Channels ──────────────────────────────────────────────────────
|
|
347
|
+
|
|
348
|
+
export interface HubThread {
|
|
349
|
+
id: string;
|
|
350
|
+
name?: string;
|
|
351
|
+
type:
|
|
352
|
+
| "personal"
|
|
353
|
+
| "thread"
|
|
354
|
+
| "sub_thread"
|
|
355
|
+
| "feed"
|
|
356
|
+
| "external"
|
|
357
|
+
| "agent_collab";
|
|
358
|
+
workspaceId?: string;
|
|
359
|
+
agentType?: string;
|
|
360
|
+
contextObjectType?:
|
|
361
|
+
| "workspace"
|
|
362
|
+
| "entity"
|
|
363
|
+
| "document"
|
|
364
|
+
| "view"
|
|
365
|
+
| "project"
|
|
366
|
+
| "task"
|
|
367
|
+
| "user"
|
|
368
|
+
| "external";
|
|
369
|
+
contextObjectId?: string;
|
|
370
|
+
parentChannelId?: string;
|
|
371
|
+
linkedEntityIds?: string[];
|
|
372
|
+
linkedDocumentIds?: string[];
|
|
373
|
+
createdAt: string;
|
|
374
|
+
updatedAt: string;
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
export interface HubMessage {
|
|
378
|
+
id: string;
|
|
379
|
+
content: string;
|
|
380
|
+
role: "user" | "assistant" | "system";
|
|
381
|
+
userId?: string;
|
|
382
|
+
createdAt: string;
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
export interface HubThreadContext {
|
|
386
|
+
thread: HubThread;
|
|
387
|
+
messages: HubMessage[];
|
|
388
|
+
linkedEntities: HubEntity[];
|
|
389
|
+
linkedDocuments: HubDocument[];
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
// ─── Proposals ───────────────────────────────────────────────────────────────
|
|
393
|
+
|
|
394
|
+
export interface HubProposal {
|
|
395
|
+
id: string;
|
|
396
|
+
status: "pending" | "approved" | "rejected";
|
|
397
|
+
action: "create" | "update" | "delete";
|
|
398
|
+
subjectType: string;
|
|
399
|
+
data: Record<string, unknown>;
|
|
400
|
+
reason?: string;
|
|
401
|
+
createdAt: string;
|
|
402
|
+
reviewedAt?: string;
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
// ─── Views ───────────────────────────────────────────────────────────────────
|
|
406
|
+
|
|
407
|
+
export interface HubView {
|
|
408
|
+
id: string;
|
|
409
|
+
name: string;
|
|
410
|
+
type:
|
|
411
|
+
| "table"
|
|
412
|
+
| "kanban"
|
|
413
|
+
| "list"
|
|
414
|
+
| "grid"
|
|
415
|
+
| "gallery"
|
|
416
|
+
| "calendar"
|
|
417
|
+
| "timeline"
|
|
418
|
+
| "graph"
|
|
419
|
+
| "bento"
|
|
420
|
+
| string;
|
|
421
|
+
profileSlug?: string;
|
|
422
|
+
workspaceId?: string;
|
|
423
|
+
config?: Record<string, unknown>;
|
|
424
|
+
createdAt: string;
|
|
425
|
+
updatedAt: string;
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
// ─── Search ───────────────────────────────────────────────────────────────────
|
|
429
|
+
|
|
430
|
+
export interface HubSearchResult {
|
|
431
|
+
entities: HubEntity[];
|
|
432
|
+
documents: HubDocument[];
|
|
433
|
+
total: number;
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
// ─── Commands ────────────────────────────────────────────────────────────────
|
|
437
|
+
|
|
438
|
+
export interface HubCommand {
|
|
439
|
+
id: string;
|
|
440
|
+
name: string;
|
|
441
|
+
slug: string;
|
|
442
|
+
description?: string;
|
|
443
|
+
workspaceId?: string;
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
// ─── Agent Users ─────────────────────────────────────────────────────────────
|
|
447
|
+
|
|
448
|
+
export interface HubAgentUser {
|
|
449
|
+
id: string;
|
|
450
|
+
name: string;
|
|
451
|
+
agentType?: string;
|
|
452
|
+
workspaceId?: string;
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
// ─── User Context ─────────────────────────────────────────────────────────────
|
|
456
|
+
|
|
457
|
+
export interface HubUserContext {
|
|
458
|
+
recentEntities: HubEntity[];
|
|
459
|
+
activeThreads: HubThread[];
|
|
460
|
+
workspaceSummary?: Record<string, unknown>;
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
// ─── Governance ───────────────────────────────────────────────────────────────
|
|
464
|
+
|
|
465
|
+
export interface HubGovernanceResult {
|
|
466
|
+
status: "approved" | "proposed" | "denied";
|
|
467
|
+
id?: string;
|
|
468
|
+
proposalId?: string;
|
|
469
|
+
reason?: string;
|
|
470
|
+
message?: string;
|
|
471
|
+
/**
|
|
472
|
+
* Short human-readable summary of what was proposed. Present on `proposed`
|
|
473
|
+
* responses. Example: `Delete task "Q2 plan review"`.
|
|
474
|
+
*/
|
|
475
|
+
summary?: string;
|
|
476
|
+
/**
|
|
477
|
+
* Reasoning — echoed from the AI's rationale or the policy's explanation
|
|
478
|
+
* of why review is needed. Present on `proposed` responses.
|
|
479
|
+
*/
|
|
480
|
+
reasoning?: string;
|
|
481
|
+
/**
|
|
482
|
+
* Pod-relative path for the review UI: `/proposals/{id}`.
|
|
483
|
+
* Present on `proposed` responses.
|
|
484
|
+
*/
|
|
485
|
+
reviewPath?: string;
|
|
486
|
+
/**
|
|
487
|
+
* Absolute URL for the review UI (defaults to `studio.synap.live`,
|
|
488
|
+
* overridable via `SYNAP_APP_URL` on the pod). Surface this directly to
|
|
489
|
+
* the user so they can approve without digging through the app.
|
|
490
|
+
*/
|
|
491
|
+
reviewUrl?: string;
|
|
492
|
+
}
|
|
493
|
+
|
|
494
|
+
// ─── Write input types ────────────────────────────────────────────────────────
|
|
495
|
+
|
|
496
|
+
export interface CreateThreadInput {
|
|
497
|
+
name?: string;
|
|
498
|
+
type?: HubThread["type"];
|
|
499
|
+
workspaceId?: string;
|
|
500
|
+
agentType?: string;
|
|
501
|
+
entityId?: string;
|
|
502
|
+
documentId?: string;
|
|
503
|
+
userId?: string;
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
export interface CreateRelationInput {
|
|
507
|
+
sourceEntityId: string;
|
|
508
|
+
targetEntityId: string;
|
|
509
|
+
type: string;
|
|
510
|
+
label?: string;
|
|
511
|
+
workspaceId?: string;
|
|
512
|
+
userId?: string;
|
|
513
|
+
}
|
|
514
|
+
|
|
515
|
+
export interface CreateViewInput {
|
|
516
|
+
name: string;
|
|
517
|
+
type: HubView["type"];
|
|
518
|
+
profileSlug?: string;
|
|
519
|
+
workspaceId: string;
|
|
520
|
+
config?: Record<string, unknown>;
|
|
521
|
+
userId?: string;
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
export interface ExecuteCommandInput {
|
|
525
|
+
slug: string;
|
|
526
|
+
workspaceId?: string;
|
|
527
|
+
parameters?: Record<string, unknown>;
|
|
528
|
+
userId?: string;
|
|
529
|
+
}
|
|
530
|
+
|
|
531
|
+
// ─── Automations ──────────────────────────────────────────────────────────────
|
|
532
|
+
|
|
533
|
+
export type AutomationStatus = "draft" | "active" | "paused" | "error";
|
|
534
|
+
export type AutomationTriggerType = "event" | "cron" | "webhook" | "manual";
|
|
535
|
+
|
|
536
|
+
export interface HubAutomation {
|
|
537
|
+
id: string;
|
|
538
|
+
userId: string;
|
|
539
|
+
workspaceId?: string | null;
|
|
540
|
+
name: string;
|
|
541
|
+
description?: string | null;
|
|
542
|
+
triggerType: AutomationTriggerType;
|
|
543
|
+
triggerConfig?: Record<string, unknown>;
|
|
544
|
+
flowDefinition?: {
|
|
545
|
+
nodes: Record<string, unknown>[];
|
|
546
|
+
edges: Record<string, unknown>[];
|
|
547
|
+
};
|
|
548
|
+
status: AutomationStatus;
|
|
549
|
+
metadata?: Record<string, unknown>;
|
|
550
|
+
createdAt?: string;
|
|
551
|
+
updatedAt?: string;
|
|
552
|
+
}
|
|
553
|
+
|
|
554
|
+
export interface CreateAutomationInput {
|
|
555
|
+
name: string;
|
|
556
|
+
triggerType: AutomationTriggerType;
|
|
557
|
+
workspaceId?: string | null;
|
|
558
|
+
description?: string;
|
|
559
|
+
triggerConfig?: Record<string, unknown>;
|
|
560
|
+
flowDefinition?: {
|
|
561
|
+
nodes: Record<string, unknown>[];
|
|
562
|
+
edges: Record<string, unknown>[];
|
|
563
|
+
};
|
|
564
|
+
status?: AutomationStatus;
|
|
565
|
+
metadata?: Record<string, unknown>;
|
|
566
|
+
userId?: string;
|
|
567
|
+
agentUserId?: string;
|
|
568
|
+
}
|
|
569
|
+
|
|
570
|
+
export interface UpdateAutomationInput {
|
|
571
|
+
name?: string;
|
|
572
|
+
description?: string;
|
|
573
|
+
triggerType?: AutomationTriggerType;
|
|
574
|
+
triggerConfig?: Record<string, unknown>;
|
|
575
|
+
flowDefinition?: {
|
|
576
|
+
nodes: Record<string, unknown>[];
|
|
577
|
+
edges: Record<string, unknown>[];
|
|
578
|
+
};
|
|
579
|
+
status?: AutomationStatus;
|
|
580
|
+
metadata?: Record<string, unknown>;
|
|
581
|
+
workspaceId?: string;
|
|
582
|
+
userId?: string;
|
|
583
|
+
}
|
|
584
|
+
|
|
585
|
+
// ─── Subscriptions / Reactions (Pulse) ───────────────────────────────────────
|
|
586
|
+
|
|
587
|
+
export type ReactionKind =
|
|
588
|
+
| "automation"
|
|
589
|
+
| "ai_feed"
|
|
590
|
+
| "ai_react"
|
|
591
|
+
| "notify"
|
|
592
|
+
| "webhook"
|
|
593
|
+
| "message_out";
|
|
594
|
+
|
|
595
|
+
export type ReactionLens = "all" | "internal" | "external";
|
|
596
|
+
|
|
597
|
+
/** Opaque reaction event from the Pulse feed — shape varies by kind. */
|
|
598
|
+
export interface HubReactionEvent {
|
|
599
|
+
id: string;
|
|
600
|
+
eventType: string;
|
|
601
|
+
kind?: ReactionKind;
|
|
602
|
+
workspaceId?: string | null;
|
|
603
|
+
userId?: string;
|
|
604
|
+
createdAt: string;
|
|
605
|
+
reactions?: Record<string, unknown>[];
|
|
606
|
+
[key: string]: unknown;
|
|
607
|
+
}
|
|
608
|
+
|
|
609
|
+
// ─── Notifications ────────────────────────────────────────────────────────────
|
|
610
|
+
|
|
611
|
+
export type NotificationSourceType =
|
|
612
|
+
| "proposal"
|
|
613
|
+
| "connector"
|
|
614
|
+
| "agent"
|
|
615
|
+
| "system"
|
|
616
|
+
| "inbox_item";
|
|
617
|
+
|
|
618
|
+
export interface CreateNotificationInput {
|
|
619
|
+
userId: string;
|
|
620
|
+
workspaceId: string;
|
|
621
|
+
type: string;
|
|
622
|
+
sourceType?: NotificationSourceType;
|
|
623
|
+
sourceId?: string;
|
|
624
|
+
workspaceUrl?: string;
|
|
625
|
+
groupKey?: string;
|
|
626
|
+
data?: Record<string, unknown>;
|
|
627
|
+
}
|
|
628
|
+
|
|
629
|
+
// ─── Webhooks ─────────────────────────────────────────────────────────────────
|
|
630
|
+
|
|
631
|
+
export interface HubWebhookDelivery {
|
|
632
|
+
id: string;
|
|
633
|
+
subscriptionId: string;
|
|
634
|
+
status: string;
|
|
635
|
+
responseStatus?: number;
|
|
636
|
+
attempt: number;
|
|
637
|
+
deliveredAt?: string;
|
|
638
|
+
createdAt: string;
|
|
639
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@synap-core/cli",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.7.0",
|
|
4
4
|
"description": "Synap CLI — connect OpenClaw to sovereign knowledge infrastructure",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -10,9 +10,12 @@
|
|
|
10
10
|
"build": "tsc",
|
|
11
11
|
"dev": "tsx src/index.ts",
|
|
12
12
|
"sync-skills": "bash scripts/sync-skills.sh",
|
|
13
|
-
"prepublishOnly": "pnpm sync-skills && pnpm build"
|
|
13
|
+
"prepublishOnly": "pnpm sync-skills && pnpm build",
|
|
14
|
+
"prepack": "rm -rf node_modules/@synap/hub-rest-client && cp -r ../synap-backend/packages/hub-rest-client node_modules/@synap/",
|
|
15
|
+
"postpack": "rm -rf node_modules/@synap/hub-rest-client && ln -s ../../../synap-backend/packages/hub-rest-client node_modules/@synap/hub-rest-client"
|
|
14
16
|
},
|
|
15
17
|
"dependencies": {
|
|
18
|
+
"@synap/hub-rest-client": "file:../synap-backend/packages/hub-rest-client",
|
|
16
19
|
"chalk": "^5.4.0",
|
|
17
20
|
"commander": "^13.0.0",
|
|
18
21
|
"ora": "^8.0.0",
|
|
@@ -24,6 +27,9 @@
|
|
|
24
27
|
"tsx": "^4.0.0",
|
|
25
28
|
"typescript": "^5.7.0"
|
|
26
29
|
},
|
|
30
|
+
"bundledDependencies": [
|
|
31
|
+
"@synap/hub-rest-client"
|
|
32
|
+
],
|
|
27
33
|
"files": [
|
|
28
34
|
"dist",
|
|
29
35
|
"skills"
|