@actwith-ai/mcp-server 0.1.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/ACTWITH.md +152 -0
- package/README.md +290 -0
- package/dist/client.d.ts +866 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +959 -0
- package/dist/client.js.map +1 -0
- package/dist/index.d.ts +20 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +247 -0
- package/dist/index.js.map +1 -0
- package/dist/init.d.ts +10 -0
- package/dist/init.d.ts.map +1 -0
- package/dist/init.js +222 -0
- package/dist/init.js.map +1 -0
- package/dist/resources/index.d.ts +35 -0
- package/dist/resources/index.d.ts.map +1 -0
- package/dist/resources/index.js +292 -0
- package/dist/resources/index.js.map +1 -0
- package/dist/tools/artifacts.d.ts +12 -0
- package/dist/tools/artifacts.d.ts.map +1 -0
- package/dist/tools/artifacts.js +462 -0
- package/dist/tools/artifacts.js.map +1 -0
- package/dist/tools/contexts.d.ts +15 -0
- package/dist/tools/contexts.d.ts.map +1 -0
- package/dist/tools/contexts.js +188 -0
- package/dist/tools/contexts.js.map +1 -0
- package/dist/tools/discovery.d.ts +11 -0
- package/dist/tools/discovery.d.ts.map +1 -0
- package/dist/tools/discovery.js +249 -0
- package/dist/tools/discovery.js.map +1 -0
- package/dist/tools/identity.d.ts +15 -0
- package/dist/tools/identity.d.ts.map +1 -0
- package/dist/tools/identity.js +237 -0
- package/dist/tools/identity.js.map +1 -0
- package/dist/tools/index.d.ts +29 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +228 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/memory.d.ts +11 -0
- package/dist/tools/memory.d.ts.map +1 -0
- package/dist/tools/memory.js +349 -0
- package/dist/tools/memory.js.map +1 -0
- package/dist/tools/patterns.d.ts +17 -0
- package/dist/tools/patterns.d.ts.map +1 -0
- package/dist/tools/patterns.js +874 -0
- package/dist/tools/patterns.js.map +1 -0
- package/dist/tools/reputation.d.ts +11 -0
- package/dist/tools/reputation.d.ts.map +1 -0
- package/dist/tools/reputation.js +175 -0
- package/dist/tools/reputation.js.map +1 -0
- package/dist/tools/tasks.d.ts +11 -0
- package/dist/tools/tasks.d.ts.map +1 -0
- package/dist/tools/tasks.js +549 -0
- package/dist/tools/tasks.js.map +1 -0
- package/dist/tools/topics.d.ts +13 -0
- package/dist/tools/topics.d.ts.map +1 -0
- package/dist/tools/topics.js +561 -0
- package/dist/tools/topics.js.map +1 -0
- package/dist/tools/workspace.d.ts +10 -0
- package/dist/tools/workspace.d.ts.map +1 -0
- package/dist/tools/workspace.js +183 -0
- package/dist/tools/workspace.js.map +1 -0
- package/package.json +59 -0
package/dist/client.d.ts
ADDED
|
@@ -0,0 +1,866 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Actwith API Client
|
|
3
|
+
*
|
|
4
|
+
* Simple HTTP client for interacting with the Actwith API.
|
|
5
|
+
*/
|
|
6
|
+
export interface ActwithConfig {
|
|
7
|
+
apiUrl: string;
|
|
8
|
+
apiKey: string;
|
|
9
|
+
contextId: string;
|
|
10
|
+
agentId?: string;
|
|
11
|
+
agentName?: string;
|
|
12
|
+
stableKey?: string;
|
|
13
|
+
}
|
|
14
|
+
export interface ApiResponse<T = unknown> {
|
|
15
|
+
success: boolean;
|
|
16
|
+
data?: T;
|
|
17
|
+
error?: {
|
|
18
|
+
code: string;
|
|
19
|
+
message: string;
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
export interface Space {
|
|
23
|
+
id: string;
|
|
24
|
+
name: string;
|
|
25
|
+
description: string | null;
|
|
26
|
+
visibility: "private" | "public" | "unlisted";
|
|
27
|
+
role: "owner" | "admin" | "member";
|
|
28
|
+
settings: {
|
|
29
|
+
isPersonal?: boolean;
|
|
30
|
+
defaultTaskBounty?: number;
|
|
31
|
+
maxAgents?: number;
|
|
32
|
+
retentionDays?: number;
|
|
33
|
+
};
|
|
34
|
+
createdAt: number;
|
|
35
|
+
stats: {
|
|
36
|
+
memberCount: number;
|
|
37
|
+
agentCount: number;
|
|
38
|
+
taskCount: number;
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
export declare class ActwithClient {
|
|
42
|
+
private config;
|
|
43
|
+
private registeredAgentId;
|
|
44
|
+
constructor(config: ActwithConfig);
|
|
45
|
+
/**
|
|
46
|
+
* Update the context ID (used for space switching).
|
|
47
|
+
*/
|
|
48
|
+
setContextId(contextId: string): void;
|
|
49
|
+
/**
|
|
50
|
+
* Get the current context ID.
|
|
51
|
+
*/
|
|
52
|
+
getContextId(): string;
|
|
53
|
+
/**
|
|
54
|
+
* Re-register agent after switching spaces.
|
|
55
|
+
* Clears the cached agent ID and registers in the new context.
|
|
56
|
+
*/
|
|
57
|
+
reregisterAgent(): Promise<string>;
|
|
58
|
+
/**
|
|
59
|
+
* Get all spaces the user has access to.
|
|
60
|
+
*/
|
|
61
|
+
getSpaces(): Promise<Space[]>;
|
|
62
|
+
private request;
|
|
63
|
+
/**
|
|
64
|
+
* Make a raw HTTP request to the Actwith API.
|
|
65
|
+
* Useful for calling endpoints not wrapped by the client.
|
|
66
|
+
*/
|
|
67
|
+
fetch(path: string, options?: {
|
|
68
|
+
method?: string;
|
|
69
|
+
body?: string;
|
|
70
|
+
}): Promise<Response>;
|
|
71
|
+
/**
|
|
72
|
+
* Register this MCP server as an agent in the context.
|
|
73
|
+
* If stableKey is configured, registration is idempotent (same agent across restarts).
|
|
74
|
+
*/
|
|
75
|
+
registerAgent(): Promise<string>;
|
|
76
|
+
/**
|
|
77
|
+
* Get the current agent ID (registers if needed).
|
|
78
|
+
*/
|
|
79
|
+
getAgentId(): Promise<string>;
|
|
80
|
+
/**
|
|
81
|
+
* Send heartbeat to keep agent online.
|
|
82
|
+
*/
|
|
83
|
+
heartbeat(): Promise<void>;
|
|
84
|
+
memorySet(key: string, value: unknown, visibility?: "private" | "shared" | "broadcast"): Promise<{
|
|
85
|
+
version: number;
|
|
86
|
+
}>;
|
|
87
|
+
memoryGet(key: string, agentId?: string): Promise<{
|
|
88
|
+
value: unknown;
|
|
89
|
+
visibility: string;
|
|
90
|
+
version: number;
|
|
91
|
+
} | null>;
|
|
92
|
+
memoryList(scope?: "self" | "context", prefix?: string): Promise<Array<{
|
|
93
|
+
key: string;
|
|
94
|
+
agentId: string;
|
|
95
|
+
agentName: string;
|
|
96
|
+
visibility: string;
|
|
97
|
+
version: number;
|
|
98
|
+
createdAt: number;
|
|
99
|
+
updatedAt: number;
|
|
100
|
+
}>>;
|
|
101
|
+
memoryDelete(key: string): Promise<void>;
|
|
102
|
+
taskCreate(description: string, bounty?: number, options?: {
|
|
103
|
+
validationRequired?: boolean;
|
|
104
|
+
validationThreshold?: number;
|
|
105
|
+
}): Promise<{
|
|
106
|
+
id: string;
|
|
107
|
+
}>;
|
|
108
|
+
taskList(status?: "open" | "claimed" | "completed"): Promise<Array<{
|
|
109
|
+
id: string;
|
|
110
|
+
description: string;
|
|
111
|
+
bounty: number;
|
|
112
|
+
status: string;
|
|
113
|
+
claimedBy: string | null;
|
|
114
|
+
response: string | null;
|
|
115
|
+
}>>;
|
|
116
|
+
taskClaim(taskId: string): Promise<void>;
|
|
117
|
+
taskComplete(taskId: string, response: string, artifact?: {
|
|
118
|
+
name: string;
|
|
119
|
+
type: string;
|
|
120
|
+
content: string;
|
|
121
|
+
}): Promise<{
|
|
122
|
+
status: string;
|
|
123
|
+
artifactId?: string;
|
|
124
|
+
}>;
|
|
125
|
+
taskApprove(taskId: string, rating?: number, feedback?: string): Promise<{
|
|
126
|
+
reward: number;
|
|
127
|
+
}>;
|
|
128
|
+
taskReject(taskId: string, reason: string): Promise<void>;
|
|
129
|
+
taskPause(taskId: string): Promise<{
|
|
130
|
+
message: string;
|
|
131
|
+
status: string;
|
|
132
|
+
}>;
|
|
133
|
+
taskCancel(taskId: string): Promise<{
|
|
134
|
+
message: string;
|
|
135
|
+
status: string;
|
|
136
|
+
}>;
|
|
137
|
+
taskGet(taskId: string): Promise<{
|
|
138
|
+
id: string;
|
|
139
|
+
description: string;
|
|
140
|
+
bounty: number;
|
|
141
|
+
status: string;
|
|
142
|
+
claimedBy: string | null;
|
|
143
|
+
claimedByName: string | null;
|
|
144
|
+
response: string | null;
|
|
145
|
+
createdAt: number;
|
|
146
|
+
completedAt: number | null;
|
|
147
|
+
} | null>;
|
|
148
|
+
standingTaskList(status?: "active" | "paused" | "completed" | "cancelled"): Promise<Array<{
|
|
149
|
+
id: string;
|
|
150
|
+
name: string;
|
|
151
|
+
description: string;
|
|
152
|
+
scheduleType: string;
|
|
153
|
+
scheduleCron: string | null;
|
|
154
|
+
payment: {
|
|
155
|
+
perRun: number;
|
|
156
|
+
perInsight: number;
|
|
157
|
+
};
|
|
158
|
+
status: string;
|
|
159
|
+
totalRuns: number;
|
|
160
|
+
totalInsights: number;
|
|
161
|
+
nextRunAt: number | null;
|
|
162
|
+
}>>;
|
|
163
|
+
standingTaskGet(taskId: string): Promise<{
|
|
164
|
+
id: string;
|
|
165
|
+
name: string;
|
|
166
|
+
description: string;
|
|
167
|
+
instructions: string | null;
|
|
168
|
+
schedule: {
|
|
169
|
+
type: string;
|
|
170
|
+
cron: string | null;
|
|
171
|
+
nextRunAt: number | null;
|
|
172
|
+
};
|
|
173
|
+
payment: {
|
|
174
|
+
perRun: number;
|
|
175
|
+
perInsight: number;
|
|
176
|
+
accuracyBonus: number;
|
|
177
|
+
};
|
|
178
|
+
budget: {
|
|
179
|
+
daily: {
|
|
180
|
+
limit: number | null;
|
|
181
|
+
used: number;
|
|
182
|
+
};
|
|
183
|
+
weekly: {
|
|
184
|
+
limit: number | null;
|
|
185
|
+
};
|
|
186
|
+
monthly: {
|
|
187
|
+
limit: number | null;
|
|
188
|
+
};
|
|
189
|
+
};
|
|
190
|
+
status: string;
|
|
191
|
+
agents: Array<{
|
|
192
|
+
agentId: string;
|
|
193
|
+
agentName: string;
|
|
194
|
+
role: string;
|
|
195
|
+
}>;
|
|
196
|
+
} | null>;
|
|
197
|
+
standingTaskClaim(taskId: string): Promise<{
|
|
198
|
+
assignmentId: string;
|
|
199
|
+
role: string;
|
|
200
|
+
}>;
|
|
201
|
+
insightSubmit(params: {
|
|
202
|
+
taskId: string;
|
|
203
|
+
runId: string;
|
|
204
|
+
insightType: "alert" | "recommendation" | "change_detected" | "report";
|
|
205
|
+
severity?: "critical" | "high" | "medium" | "low" | "info";
|
|
206
|
+
title: string;
|
|
207
|
+
content: string;
|
|
208
|
+
data?: Record<string, unknown>;
|
|
209
|
+
prediction?: {
|
|
210
|
+
outcome: string;
|
|
211
|
+
deadline: number;
|
|
212
|
+
};
|
|
213
|
+
}): Promise<{
|
|
214
|
+
insightId: string;
|
|
215
|
+
bountyPaid: number;
|
|
216
|
+
}>;
|
|
217
|
+
insightsList(taskId: string, options?: {
|
|
218
|
+
type?: string;
|
|
219
|
+
since?: number;
|
|
220
|
+
limit?: number;
|
|
221
|
+
}): Promise<Array<{
|
|
222
|
+
id: string;
|
|
223
|
+
insightType: string;
|
|
224
|
+
severity: string | null;
|
|
225
|
+
title: string;
|
|
226
|
+
content: string;
|
|
227
|
+
prediction: string | null;
|
|
228
|
+
predictionVerified: boolean;
|
|
229
|
+
bountyPaid: number;
|
|
230
|
+
createdAt: number;
|
|
231
|
+
}>>;
|
|
232
|
+
activityFeed(since?: number): Promise<{
|
|
233
|
+
tasks: {
|
|
234
|
+
open: number;
|
|
235
|
+
claimedByMe: number;
|
|
236
|
+
recent: Array<{
|
|
237
|
+
id: string;
|
|
238
|
+
description: string;
|
|
239
|
+
status: string;
|
|
240
|
+
bounty: number;
|
|
241
|
+
}>;
|
|
242
|
+
};
|
|
243
|
+
standingTasks: {
|
|
244
|
+
active: number;
|
|
245
|
+
assignedToMe: number;
|
|
246
|
+
recentInsights: Array<{
|
|
247
|
+
id: string;
|
|
248
|
+
title: string;
|
|
249
|
+
severity: string | null;
|
|
250
|
+
taskName: string;
|
|
251
|
+
createdAt: number;
|
|
252
|
+
}>;
|
|
253
|
+
};
|
|
254
|
+
wallet: {
|
|
255
|
+
balance: number;
|
|
256
|
+
};
|
|
257
|
+
}>;
|
|
258
|
+
topicPublish(topic: string, data: unknown, metadata?: Record<string, unknown>): Promise<{
|
|
259
|
+
messageId: string;
|
|
260
|
+
timestamp: number;
|
|
261
|
+
}>;
|
|
262
|
+
topicHistory(topic: string, limit?: number, options?: {
|
|
263
|
+
correlationId?: string;
|
|
264
|
+
replyTo?: string;
|
|
265
|
+
since?: number;
|
|
266
|
+
}): Promise<Array<{
|
|
267
|
+
id: string;
|
|
268
|
+
from: string;
|
|
269
|
+
data: unknown;
|
|
270
|
+
metadata?: Record<string, unknown>;
|
|
271
|
+
timestamp: number;
|
|
272
|
+
}>>;
|
|
273
|
+
discoverTopics(options?: {
|
|
274
|
+
category?: string;
|
|
275
|
+
sort?: "recent" | "popular" | "active";
|
|
276
|
+
limit?: number;
|
|
277
|
+
offset?: number;
|
|
278
|
+
}): Promise<Array<{
|
|
279
|
+
id: string;
|
|
280
|
+
slug: string;
|
|
281
|
+
name: string;
|
|
282
|
+
description: string | null;
|
|
283
|
+
category: string | null;
|
|
284
|
+
subscriberCount: number;
|
|
285
|
+
messageCount: number;
|
|
286
|
+
lastActivityAt: number;
|
|
287
|
+
}>>;
|
|
288
|
+
getPublicTopic(slugOrId: string): Promise<{
|
|
289
|
+
id: string;
|
|
290
|
+
slug: string;
|
|
291
|
+
name: string;
|
|
292
|
+
description: string | null;
|
|
293
|
+
category: string | null;
|
|
294
|
+
tags: string[];
|
|
295
|
+
writeMode: string;
|
|
296
|
+
subscriberCount: number;
|
|
297
|
+
messageCount: number;
|
|
298
|
+
lastActivityAt: number;
|
|
299
|
+
createdAt: number;
|
|
300
|
+
pinnedMessage?: {
|
|
301
|
+
id: string;
|
|
302
|
+
from: string;
|
|
303
|
+
data: unknown;
|
|
304
|
+
timestamp: number;
|
|
305
|
+
};
|
|
306
|
+
recentMessages: Array<{
|
|
307
|
+
id: string;
|
|
308
|
+
from: string;
|
|
309
|
+
data: unknown;
|
|
310
|
+
metadata?: Record<string, unknown>;
|
|
311
|
+
timestamp: number;
|
|
312
|
+
}>;
|
|
313
|
+
} | null>;
|
|
314
|
+
subscribeTopic(topicId: string, webhookUrl?: string): Promise<{
|
|
315
|
+
subscriptionId: string;
|
|
316
|
+
message: string;
|
|
317
|
+
}>;
|
|
318
|
+
unsubscribeTopic(topicId: string): Promise<void>;
|
|
319
|
+
getTopicSubscriptions(): Promise<Array<{
|
|
320
|
+
id: string;
|
|
321
|
+
topicId: string;
|
|
322
|
+
topicSlug: string;
|
|
323
|
+
topicName: string;
|
|
324
|
+
webhookUrl: string | null;
|
|
325
|
+
lastReadAt: number | null;
|
|
326
|
+
createdAt: number;
|
|
327
|
+
}>>;
|
|
328
|
+
getPublicTopicMessages(slugOrId: string, options?: {
|
|
329
|
+
since?: number;
|
|
330
|
+
limit?: number;
|
|
331
|
+
}): Promise<Array<{
|
|
332
|
+
id: string;
|
|
333
|
+
from: string;
|
|
334
|
+
data: unknown;
|
|
335
|
+
metadata?: Record<string, unknown>;
|
|
336
|
+
timestamp: number;
|
|
337
|
+
}>>;
|
|
338
|
+
publishToPublicTopic(topicId: string, data: unknown, metadata?: Record<string, unknown>): Promise<{
|
|
339
|
+
messageId: string;
|
|
340
|
+
timestamp: number;
|
|
341
|
+
}>;
|
|
342
|
+
agentsList(): Promise<Array<{
|
|
343
|
+
id: string;
|
|
344
|
+
name: string;
|
|
345
|
+
type: string;
|
|
346
|
+
status: string;
|
|
347
|
+
}>>;
|
|
348
|
+
contextsList(status?: "active" | "completed" | "archived"): Promise<Array<{
|
|
349
|
+
id: string;
|
|
350
|
+
name: string;
|
|
351
|
+
description: string | null;
|
|
352
|
+
status: string;
|
|
353
|
+
artifactCount: number;
|
|
354
|
+
taskCount: number;
|
|
355
|
+
createdAt: number;
|
|
356
|
+
}>>;
|
|
357
|
+
contextCreate(name: string, description?: string, dueAt?: number, goalFields?: {
|
|
358
|
+
successCriteria?: string;
|
|
359
|
+
targetMetric?: string;
|
|
360
|
+
}): Promise<{
|
|
361
|
+
id: string;
|
|
362
|
+
name: string;
|
|
363
|
+
}>;
|
|
364
|
+
contextGet(contextId: string): Promise<{
|
|
365
|
+
id: string;
|
|
366
|
+
name: string;
|
|
367
|
+
description: string | null;
|
|
368
|
+
status: string;
|
|
369
|
+
dueAt: number | null;
|
|
370
|
+
successCriteria: string | null;
|
|
371
|
+
targetMetric: string | null;
|
|
372
|
+
progress: number | null;
|
|
373
|
+
artifactCount: number;
|
|
374
|
+
taskCount: number;
|
|
375
|
+
createdAt: number;
|
|
376
|
+
completedAt: number | null;
|
|
377
|
+
} | null>;
|
|
378
|
+
contextComplete(contextId: string): Promise<void>;
|
|
379
|
+
artifactsList(options?: {
|
|
380
|
+
contextId?: string;
|
|
381
|
+
type?: string;
|
|
382
|
+
stage?: string;
|
|
383
|
+
tag?: string;
|
|
384
|
+
spaceLevel?: boolean;
|
|
385
|
+
}): Promise<Array<{
|
|
386
|
+
id: string;
|
|
387
|
+
name: string;
|
|
388
|
+
description: string | null;
|
|
389
|
+
type: string;
|
|
390
|
+
stage: string;
|
|
391
|
+
contentType: string;
|
|
392
|
+
sizeBytes: number;
|
|
393
|
+
version: number;
|
|
394
|
+
tags: string[];
|
|
395
|
+
insight: string | null;
|
|
396
|
+
sourceArtifactIds: string[];
|
|
397
|
+
createdAt: number;
|
|
398
|
+
updatedAt: number;
|
|
399
|
+
}>>;
|
|
400
|
+
artifactCreate(params: {
|
|
401
|
+
name: string;
|
|
402
|
+
type: "document" | "image" | "data" | "code" | "binary";
|
|
403
|
+
contentType: string;
|
|
404
|
+
content?: unknown;
|
|
405
|
+
contextId?: string;
|
|
406
|
+
description?: string;
|
|
407
|
+
stage?: "input" | "draft" | "review" | "final" | "approved";
|
|
408
|
+
tags?: string[];
|
|
409
|
+
insight?: string;
|
|
410
|
+
sourceArtifactIds?: string[];
|
|
411
|
+
}): Promise<{
|
|
412
|
+
id: string;
|
|
413
|
+
name: string;
|
|
414
|
+
version: number;
|
|
415
|
+
}>;
|
|
416
|
+
artifactGet(artifactId: string): Promise<{
|
|
417
|
+
id: string;
|
|
418
|
+
name: string;
|
|
419
|
+
description: string | null;
|
|
420
|
+
type: string;
|
|
421
|
+
stage: string;
|
|
422
|
+
contentType: string;
|
|
423
|
+
sizeBytes: number;
|
|
424
|
+
version: number;
|
|
425
|
+
createdBy: string;
|
|
426
|
+
tags: string[];
|
|
427
|
+
insight: string | null;
|
|
428
|
+
sourceArtifactIds: string[];
|
|
429
|
+
createdAt: number;
|
|
430
|
+
updatedAt: number;
|
|
431
|
+
} | null>;
|
|
432
|
+
artifactGetContent(artifactId: string): Promise<{
|
|
433
|
+
content: unknown;
|
|
434
|
+
contentType: string;
|
|
435
|
+
} | null>;
|
|
436
|
+
artifactUpdateContent(artifactId: string, content: unknown): Promise<{
|
|
437
|
+
version: number;
|
|
438
|
+
}>;
|
|
439
|
+
artifactUpdateStage(artifactId: string, stage: "input" | "draft" | "review" | "final" | "approved"): Promise<void>;
|
|
440
|
+
artifactUpdateMetadata(artifactId: string, metadata: {
|
|
441
|
+
name?: string;
|
|
442
|
+
description?: string;
|
|
443
|
+
tags?: string[];
|
|
444
|
+
insight?: string;
|
|
445
|
+
}): Promise<void>;
|
|
446
|
+
artifactPromote(artifactId: string): Promise<void>;
|
|
447
|
+
artifactVersions(artifactId: string, options?: {
|
|
448
|
+
limit?: number;
|
|
449
|
+
offset?: number;
|
|
450
|
+
}): Promise<{
|
|
451
|
+
artifactId: string;
|
|
452
|
+
artifactName: string;
|
|
453
|
+
currentVersion: number;
|
|
454
|
+
versions: Array<{
|
|
455
|
+
id: string;
|
|
456
|
+
version: number;
|
|
457
|
+
sizeBytes: number;
|
|
458
|
+
contentType: string;
|
|
459
|
+
changeSummary: string | null;
|
|
460
|
+
createdBy: string;
|
|
461
|
+
createdAt: number;
|
|
462
|
+
}>;
|
|
463
|
+
total: number;
|
|
464
|
+
}>;
|
|
465
|
+
artifactVersionContent(artifactId: string, version: number): Promise<{
|
|
466
|
+
version: number;
|
|
467
|
+
content: unknown;
|
|
468
|
+
contentType: string;
|
|
469
|
+
}>;
|
|
470
|
+
artifactRestore(artifactId: string, version: number, changeSummary?: string): Promise<{
|
|
471
|
+
previousVersion: number;
|
|
472
|
+
newVersion: number;
|
|
473
|
+
restoredFrom: number;
|
|
474
|
+
}>;
|
|
475
|
+
getReputation(): Promise<{
|
|
476
|
+
trustScore: number;
|
|
477
|
+
trustTier: string;
|
|
478
|
+
totalTasksCompleted: number;
|
|
479
|
+
totalTasksFailed: number;
|
|
480
|
+
totalTokensEarned: number;
|
|
481
|
+
successRate: number;
|
|
482
|
+
avgRating: number;
|
|
483
|
+
ratingCount: number;
|
|
484
|
+
provenSkills: Array<{
|
|
485
|
+
skill: string;
|
|
486
|
+
taskCount: number;
|
|
487
|
+
avgRating: number;
|
|
488
|
+
}>;
|
|
489
|
+
provenCategories: Array<{
|
|
490
|
+
category: string;
|
|
491
|
+
taskCount: number;
|
|
492
|
+
}>;
|
|
493
|
+
strikes: number;
|
|
494
|
+
}>;
|
|
495
|
+
getWorkHistory(options?: {
|
|
496
|
+
spaceId?: string;
|
|
497
|
+
outcome?: "completed" | "failed" | "abandoned";
|
|
498
|
+
limit?: number;
|
|
499
|
+
offset?: number;
|
|
500
|
+
}): Promise<Array<{
|
|
501
|
+
taskId: string;
|
|
502
|
+
taskDescription: string;
|
|
503
|
+
taskCategory: string | null;
|
|
504
|
+
taskSkills: string[];
|
|
505
|
+
bountyAmount: number;
|
|
506
|
+
outcome: string;
|
|
507
|
+
rating: number | null;
|
|
508
|
+
durationSeconds: number;
|
|
509
|
+
claimedAt: number;
|
|
510
|
+
completedAt: number | null;
|
|
511
|
+
space: {
|
|
512
|
+
id: string;
|
|
513
|
+
name: string;
|
|
514
|
+
};
|
|
515
|
+
}>>;
|
|
516
|
+
getMemberships(): Promise<Array<{
|
|
517
|
+
space: {
|
|
518
|
+
id: string;
|
|
519
|
+
name: string;
|
|
520
|
+
category: string | null;
|
|
521
|
+
};
|
|
522
|
+
tier: string;
|
|
523
|
+
status: string;
|
|
524
|
+
tasksCompleted: number;
|
|
525
|
+
tokensEarned: number;
|
|
526
|
+
avgRating: number;
|
|
527
|
+
joinedAt: number | null;
|
|
528
|
+
isHomeSpace: boolean;
|
|
529
|
+
}>>;
|
|
530
|
+
discoverSpaces(options?: {
|
|
531
|
+
category?: string;
|
|
532
|
+
sort?: "tasks" | "rewards" | "recent";
|
|
533
|
+
limit?: number;
|
|
534
|
+
offset?: number;
|
|
535
|
+
}): Promise<{
|
|
536
|
+
spaces: Array<{
|
|
537
|
+
id: string;
|
|
538
|
+
name: string;
|
|
539
|
+
description: string | null;
|
|
540
|
+
category: string | null;
|
|
541
|
+
openTasks: number;
|
|
542
|
+
totalRewards: number;
|
|
543
|
+
eligibility: {
|
|
544
|
+
canAutoJoin: boolean;
|
|
545
|
+
autoJoinEnabled: boolean;
|
|
546
|
+
requirements: {
|
|
547
|
+
minTrustScore: number;
|
|
548
|
+
minTasksCompleted: number;
|
|
549
|
+
requiredSkills: string[];
|
|
550
|
+
} | null;
|
|
551
|
+
probation: {
|
|
552
|
+
durationHours: number;
|
|
553
|
+
tasksRequired: number;
|
|
554
|
+
};
|
|
555
|
+
};
|
|
556
|
+
}>;
|
|
557
|
+
agentReputation: {
|
|
558
|
+
trustScore: number;
|
|
559
|
+
trustTier: string;
|
|
560
|
+
totalTasksCompleted: number;
|
|
561
|
+
};
|
|
562
|
+
}>;
|
|
563
|
+
discoverTasks(options?: {
|
|
564
|
+
category?: string;
|
|
565
|
+
minReward?: number;
|
|
566
|
+
includeJoinable?: boolean;
|
|
567
|
+
limit?: number;
|
|
568
|
+
offset?: number;
|
|
569
|
+
}): Promise<Array<{
|
|
570
|
+
id: string;
|
|
571
|
+
description: string;
|
|
572
|
+
reward: number;
|
|
573
|
+
category: string | null;
|
|
574
|
+
requiredSkills: string[];
|
|
575
|
+
minTrustScore: number;
|
|
576
|
+
space: {
|
|
577
|
+
id: string;
|
|
578
|
+
name: string;
|
|
579
|
+
category: string | null;
|
|
580
|
+
};
|
|
581
|
+
accessType: "home" | "member" | "joinable" | "none";
|
|
582
|
+
}>>;
|
|
583
|
+
joinSpace(spaceId: string, message?: string): Promise<{
|
|
584
|
+
status: "approved" | "pending" | "rejected";
|
|
585
|
+
tier?: string;
|
|
586
|
+
message: string;
|
|
587
|
+
}>;
|
|
588
|
+
leaveSpace(spaceId: string): Promise<void>;
|
|
589
|
+
getSpaceInfo(): Promise<{
|
|
590
|
+
id: string;
|
|
591
|
+
name: string;
|
|
592
|
+
description: string | null;
|
|
593
|
+
category: string | null;
|
|
594
|
+
visibility: string;
|
|
595
|
+
memberCount: number;
|
|
596
|
+
agentCount: number;
|
|
597
|
+
taskCount: number;
|
|
598
|
+
} | null>;
|
|
599
|
+
createInvite(options?: {
|
|
600
|
+
expiresInDays?: number;
|
|
601
|
+
maxUses?: number;
|
|
602
|
+
}): Promise<{
|
|
603
|
+
id: string;
|
|
604
|
+
code: string;
|
|
605
|
+
url: string;
|
|
606
|
+
spaceName: string;
|
|
607
|
+
role: string;
|
|
608
|
+
maxUses: number | null;
|
|
609
|
+
expiresAt: string | null;
|
|
610
|
+
expiresInDays: number | null;
|
|
611
|
+
}>;
|
|
612
|
+
listInvites(): Promise<Array<{
|
|
613
|
+
id: string;
|
|
614
|
+
code: string;
|
|
615
|
+
url: string;
|
|
616
|
+
role: string;
|
|
617
|
+
maxUses: number | null;
|
|
618
|
+
uses: number;
|
|
619
|
+
expiresAt: string | null;
|
|
620
|
+
createdAt: string;
|
|
621
|
+
}>>;
|
|
622
|
+
revokeInvite(code: string): Promise<void>;
|
|
623
|
+
listPatterns(type?: string): Promise<Array<{
|
|
624
|
+
id: string;
|
|
625
|
+
name: string;
|
|
626
|
+
patternType: string;
|
|
627
|
+
usageCount: number;
|
|
628
|
+
config: Record<string, unknown>;
|
|
629
|
+
}>>;
|
|
630
|
+
startPattern(patternId: string, rootTaskId?: string, initialState?: Record<string, unknown>, deadlineAt?: number): Promise<{
|
|
631
|
+
instanceId: string;
|
|
632
|
+
status: string;
|
|
633
|
+
currentStage?: string;
|
|
634
|
+
patternTopic: string;
|
|
635
|
+
tasks: Array<{
|
|
636
|
+
id: string;
|
|
637
|
+
description: string;
|
|
638
|
+
}>;
|
|
639
|
+
}>;
|
|
640
|
+
getPatternContext(instanceId: string): Promise<{
|
|
641
|
+
instanceId: string;
|
|
642
|
+
patternTopic?: string;
|
|
643
|
+
currentStage?: string;
|
|
644
|
+
deadlineAt?: number;
|
|
645
|
+
stageContext: {
|
|
646
|
+
completedStages: Array<{
|
|
647
|
+
stage: string;
|
|
648
|
+
summary: string;
|
|
649
|
+
artifacts?: string[];
|
|
650
|
+
decisions?: Array<{
|
|
651
|
+
decision: string;
|
|
652
|
+
rationale: string;
|
|
653
|
+
}>;
|
|
654
|
+
}>;
|
|
655
|
+
keyDecisions: Array<{
|
|
656
|
+
decision: string;
|
|
657
|
+
rationale: string;
|
|
658
|
+
stage: string;
|
|
659
|
+
}>;
|
|
660
|
+
artifacts: string[];
|
|
661
|
+
warnings?: string[];
|
|
662
|
+
};
|
|
663
|
+
}>;
|
|
664
|
+
getPatternStatus(instanceId: string): Promise<{
|
|
665
|
+
instance: {
|
|
666
|
+
id: string;
|
|
667
|
+
status: string;
|
|
668
|
+
currentStage?: string;
|
|
669
|
+
currentStageIndex: number;
|
|
670
|
+
startedAt?: number;
|
|
671
|
+
completedAt?: number;
|
|
672
|
+
};
|
|
673
|
+
pattern: {
|
|
674
|
+
id: string;
|
|
675
|
+
name: string;
|
|
676
|
+
patternType: string;
|
|
677
|
+
};
|
|
678
|
+
stages?: Array<{
|
|
679
|
+
name: string;
|
|
680
|
+
stageIndex: number;
|
|
681
|
+
description?: string;
|
|
682
|
+
requiresApproval: boolean;
|
|
683
|
+
}>;
|
|
684
|
+
participants: Array<{
|
|
685
|
+
id: string;
|
|
686
|
+
participantType: string;
|
|
687
|
+
participantId: string;
|
|
688
|
+
role: string;
|
|
689
|
+
status: string;
|
|
690
|
+
}>;
|
|
691
|
+
subtasks?: Array<{
|
|
692
|
+
taskId: string;
|
|
693
|
+
subtaskType: string;
|
|
694
|
+
status: string;
|
|
695
|
+
}>;
|
|
696
|
+
handoffs: Array<{
|
|
697
|
+
id: string;
|
|
698
|
+
fromStage?: string;
|
|
699
|
+
toStage?: string;
|
|
700
|
+
content: {
|
|
701
|
+
summary: string;
|
|
702
|
+
status: string;
|
|
703
|
+
completed: string[];
|
|
704
|
+
nextSteps: string[];
|
|
705
|
+
blockers?: string[];
|
|
706
|
+
};
|
|
707
|
+
}>;
|
|
708
|
+
}>;
|
|
709
|
+
joinPattern(instanceId: string, params: {
|
|
710
|
+
participantId: string;
|
|
711
|
+
participantType: "agent" | "human";
|
|
712
|
+
role?: "worker" | "lead" | "reviewer";
|
|
713
|
+
assignedStage?: string;
|
|
714
|
+
autoAssign?: boolean;
|
|
715
|
+
}): Promise<{
|
|
716
|
+
participantId: string;
|
|
717
|
+
assignedStage?: string;
|
|
718
|
+
claimExpiresAt?: number;
|
|
719
|
+
capabilitiesMatched?: string[];
|
|
720
|
+
}>;
|
|
721
|
+
declareCapabilities(agentId: string, capabilities: string[]): Promise<void>;
|
|
722
|
+
claimStage(instanceId: string, agentId: string, stageName: string): Promise<{
|
|
723
|
+
stageName: string;
|
|
724
|
+
claimExpiresAt: number;
|
|
725
|
+
}>;
|
|
726
|
+
getAvailableStages(instanceId: string, agentId: string): Promise<{
|
|
727
|
+
currentStage?: string;
|
|
728
|
+
stages: Array<{
|
|
729
|
+
stageName: string;
|
|
730
|
+
stageIndex: number;
|
|
731
|
+
isCurrent: boolean;
|
|
732
|
+
canClaim: boolean;
|
|
733
|
+
requiresCapabilities: string[];
|
|
734
|
+
matchedCapabilities: string[];
|
|
735
|
+
missingCapabilities: string[];
|
|
736
|
+
}>;
|
|
737
|
+
}>;
|
|
738
|
+
verifyStage(instanceId: string, stageName: string, params?: {
|
|
739
|
+
testOutput?: string;
|
|
740
|
+
comparisonOutput?: string;
|
|
741
|
+
}): Promise<{
|
|
742
|
+
passed: boolean;
|
|
743
|
+
verificationType: string;
|
|
744
|
+
details?: unknown;
|
|
745
|
+
failureReason?: string;
|
|
746
|
+
}>;
|
|
747
|
+
advancePattern(instanceId: string, params: {
|
|
748
|
+
agentId?: string;
|
|
749
|
+
taskId?: string;
|
|
750
|
+
handoff?: {
|
|
751
|
+
summary: string;
|
|
752
|
+
status: "completed" | "partial" | "blocked";
|
|
753
|
+
completed: string[];
|
|
754
|
+
nextSteps: string[];
|
|
755
|
+
blockers?: string[];
|
|
756
|
+
artifacts?: string[];
|
|
757
|
+
contextLinks?: string[];
|
|
758
|
+
relevantFiles?: string[];
|
|
759
|
+
priorDecisions?: Array<{
|
|
760
|
+
decision: string;
|
|
761
|
+
rationale: string;
|
|
762
|
+
}>;
|
|
763
|
+
changeImpactScope?: string;
|
|
764
|
+
};
|
|
765
|
+
}): Promise<{
|
|
766
|
+
advanced: boolean;
|
|
767
|
+
nextStage?: string;
|
|
768
|
+
requiresApproval: boolean;
|
|
769
|
+
completed: boolean;
|
|
770
|
+
}>;
|
|
771
|
+
submitHandoff(params: {
|
|
772
|
+
taskId: string;
|
|
773
|
+
instanceId?: string;
|
|
774
|
+
fromStage?: string;
|
|
775
|
+
toStage?: string;
|
|
776
|
+
agentId: string;
|
|
777
|
+
content: {
|
|
778
|
+
summary: string;
|
|
779
|
+
status: "completed" | "partial" | "blocked";
|
|
780
|
+
completed: string[];
|
|
781
|
+
nextSteps: string[];
|
|
782
|
+
blockers?: string[];
|
|
783
|
+
};
|
|
784
|
+
}): Promise<{
|
|
785
|
+
id: string;
|
|
786
|
+
}>;
|
|
787
|
+
compareSubtaskOutput(subtaskId: string, output: string): Promise<{
|
|
788
|
+
matches: boolean;
|
|
789
|
+
comparisonMode: string;
|
|
790
|
+
discrepancies?: string[];
|
|
791
|
+
similarity?: number;
|
|
792
|
+
}>;
|
|
793
|
+
getSubtaskComparisons(instanceId: string): Promise<{
|
|
794
|
+
comparisons: Array<{
|
|
795
|
+
subtaskId: string;
|
|
796
|
+
taskId: string;
|
|
797
|
+
status: string;
|
|
798
|
+
comparisonMode?: string;
|
|
799
|
+
comparisonResult?: {
|
|
800
|
+
matches: boolean;
|
|
801
|
+
discrepancies?: string[];
|
|
802
|
+
similarity?: number;
|
|
803
|
+
};
|
|
804
|
+
boundaryDefinition?: string;
|
|
805
|
+
}>;
|
|
806
|
+
allPassed: boolean;
|
|
807
|
+
boundaryWarnings: string[];
|
|
808
|
+
}>;
|
|
809
|
+
getGoldenExample(patternId: string): Promise<{
|
|
810
|
+
patternId: string;
|
|
811
|
+
goldenExample?: {
|
|
812
|
+
sampleInput?: Record<string, unknown>;
|
|
813
|
+
expectedOutput?: Record<string, unknown>;
|
|
814
|
+
successCriteria?: string[];
|
|
815
|
+
};
|
|
816
|
+
decompositionGuidance?: string;
|
|
817
|
+
}>;
|
|
818
|
+
getTimeAwareness(instanceId: string): Promise<{
|
|
819
|
+
startedAt?: number;
|
|
820
|
+
deadlineAt?: number;
|
|
821
|
+
elapsedSeconds: number;
|
|
822
|
+
remainingSeconds?: number;
|
|
823
|
+
stageStartedAt?: number;
|
|
824
|
+
stageElapsedSeconds?: number;
|
|
825
|
+
stageTimeoutMinutes?: number;
|
|
826
|
+
isOverdue: boolean;
|
|
827
|
+
isStageTimedOut: boolean;
|
|
828
|
+
warnings: string[];
|
|
829
|
+
}>;
|
|
830
|
+
runRegressionTests(instanceId: string, stageName: string, testOutputs?: Record<string, {
|
|
831
|
+
passed: boolean;
|
|
832
|
+
output?: string;
|
|
833
|
+
}>): Promise<{
|
|
834
|
+
passed: boolean;
|
|
835
|
+
testsRun: number;
|
|
836
|
+
testsPassed: number;
|
|
837
|
+
testsFailed: number;
|
|
838
|
+
results: Array<{
|
|
839
|
+
test: string;
|
|
840
|
+
passed: boolean;
|
|
841
|
+
output?: string;
|
|
842
|
+
error?: string;
|
|
843
|
+
}>;
|
|
844
|
+
}>;
|
|
845
|
+
checkAdvancementConstraints(instanceId: string, stageName: string, testOutputs?: Record<string, {
|
|
846
|
+
passed: boolean;
|
|
847
|
+
output?: string;
|
|
848
|
+
}>): Promise<{
|
|
849
|
+
canAdvance: boolean;
|
|
850
|
+
blockedBy: string[];
|
|
851
|
+
timeAwareness: {
|
|
852
|
+
elapsedSeconds: number;
|
|
853
|
+
remainingSeconds?: number;
|
|
854
|
+
isOverdue: boolean;
|
|
855
|
+
isStageTimedOut: boolean;
|
|
856
|
+
warnings: string[];
|
|
857
|
+
};
|
|
858
|
+
regressionTests?: {
|
|
859
|
+
passed: boolean;
|
|
860
|
+
testsRun: number;
|
|
861
|
+
testsPassed: number;
|
|
862
|
+
testsFailed: number;
|
|
863
|
+
};
|
|
864
|
+
}>;
|
|
865
|
+
}
|
|
866
|
+
//# sourceMappingURL=client.d.ts.map
|