@swarmdock/shared 0.1.1 → 0.2.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.
- package/dist/constants.d.ts +34 -1
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +44 -5
- package/dist/constants.js.map +1 -1
- package/dist/schemas.d.ts +95 -0
- package/dist/schemas.d.ts.map +1 -1
- package/dist/schemas.js +54 -13
- package/dist/schemas.js.map +1 -1
- package/dist/types.d.ts +111 -1
- package/dist/types.d.ts.map +1 -1
- package/package.json +11 -6
- package/.turbo/turbo-build.log +0 -4
- package/.turbo/turbo-type-check.log +0 -4
- package/src/constants.ts +0 -71
- package/src/index.ts +0 -3
- package/src/schemas.ts +0 -135
- package/src/types.ts +0 -141
- package/tsconfig.json +0 -8
package/dist/constants.d.ts
CHANGED
|
@@ -7,6 +7,8 @@ export declare const AGENT_STATUS: {
|
|
|
7
7
|
readonly ACTIVE: "active";
|
|
8
8
|
readonly SUSPENDED: "suspended";
|
|
9
9
|
readonly DEREGISTERED: "deregistered";
|
|
10
|
+
readonly DORMANT: "dormant";
|
|
11
|
+
readonly BANNED: "banned";
|
|
10
12
|
};
|
|
11
13
|
export declare const TASK_STATUS: {
|
|
12
14
|
readonly OPEN: "open";
|
|
@@ -33,6 +35,37 @@ export declare const ESCROW_STATUS: {
|
|
|
33
35
|
readonly REFUNDED: "refunded";
|
|
34
36
|
readonly FAILED: "failed";
|
|
35
37
|
};
|
|
38
|
+
export declare const DISPUTE_STATUS: {
|
|
39
|
+
readonly OPEN: "open";
|
|
40
|
+
readonly TRIBUNAL: "tribunal";
|
|
41
|
+
readonly RESOLVED: "resolved";
|
|
42
|
+
readonly ESCALATED: "escalated";
|
|
43
|
+
};
|
|
44
|
+
export declare const DISPUTE_RESOLUTION: {
|
|
45
|
+
readonly RELEASE: "release";
|
|
46
|
+
readonly REFUND: "refund";
|
|
47
|
+
readonly SPLIT: "split";
|
|
48
|
+
};
|
|
49
|
+
export declare const DISPUTE_VERDICT: {
|
|
50
|
+
readonly REQUESTER_WINS: "requester_wins";
|
|
51
|
+
readonly ASSIGNEE_WINS: "assignee_wins";
|
|
52
|
+
readonly SPLIT: "split";
|
|
53
|
+
};
|
|
54
|
+
export declare const TRANSACTION_TYPE: {
|
|
55
|
+
readonly ESCROW_DEPOSIT: "escrow_deposit";
|
|
56
|
+
readonly ESCROW_RELEASE: "escrow_release";
|
|
57
|
+
readonly ESCROW_REFUND: "escrow_refund";
|
|
58
|
+
readonly PLATFORM_FEE: "platform_fee";
|
|
59
|
+
readonly TRIBUNAL_FEE: "tribunal_fee";
|
|
60
|
+
readonly DISPUTE_REFUND: "dispute_refund";
|
|
61
|
+
};
|
|
62
|
+
export declare const TRANSACTION_STATUS: {
|
|
63
|
+
readonly PENDING: "pending";
|
|
64
|
+
readonly CONFIRMED: "confirmed";
|
|
65
|
+
readonly FAILED: "failed";
|
|
66
|
+
};
|
|
67
|
+
export declare const REPUTATION_DIMENSIONS: readonly ["quality", "reliability", "speed", "communication", "value"];
|
|
68
|
+
export type ReputationDimension = (typeof REPUTATION_DIMENSIONS)[number];
|
|
36
69
|
export declare const TRUST_LEVELS: {
|
|
37
70
|
readonly L0: 0;
|
|
38
71
|
readonly L1: 1;
|
|
@@ -52,6 +85,6 @@ export declare const PRICING_MODEL: {
|
|
|
52
85
|
readonly PER_REQUEST: "per-request";
|
|
53
86
|
readonly CUSTOM: "custom";
|
|
54
87
|
};
|
|
55
|
-
export declare const SCOPES: readonly ["tasks.read", "tasks.write", "bids.write", "profile.write", "ratings.write"];
|
|
88
|
+
export declare const SCOPES: readonly ["tasks.read", "tasks.write", "bids.write", "profile.write", "ratings.write", "portfolio.write"];
|
|
56
89
|
export type Scope = (typeof SCOPES)[number];
|
|
57
90
|
//# sourceMappingURL=constants.d.ts.map
|
package/dist/constants.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/const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export const AGENT_STATUS = {
|
|
|
7
7
|
ACTIVE: 'active',
|
|
8
8
|
SUSPENDED: 'suspended',
|
|
9
9
|
DEREGISTERED: 'deregistered',
|
|
10
|
+
DORMANT: 'dormant',
|
|
11
|
+
BANNED: 'banned',
|
|
10
12
|
};
|
|
11
13
|
export const TASK_STATUS = {
|
|
12
14
|
OPEN: 'open',
|
|
@@ -33,12 +35,48 @@ export const ESCROW_STATUS = {
|
|
|
33
35
|
REFUNDED: 'refunded',
|
|
34
36
|
FAILED: 'failed',
|
|
35
37
|
};
|
|
38
|
+
export const DISPUTE_STATUS = {
|
|
39
|
+
OPEN: 'open',
|
|
40
|
+
TRIBUNAL: 'tribunal',
|
|
41
|
+
RESOLVED: 'resolved',
|
|
42
|
+
ESCALATED: 'escalated',
|
|
43
|
+
};
|
|
44
|
+
export const DISPUTE_RESOLUTION = {
|
|
45
|
+
RELEASE: 'release',
|
|
46
|
+
REFUND: 'refund',
|
|
47
|
+
SPLIT: 'split',
|
|
48
|
+
};
|
|
49
|
+
export const DISPUTE_VERDICT = {
|
|
50
|
+
REQUESTER_WINS: 'requester_wins',
|
|
51
|
+
ASSIGNEE_WINS: 'assignee_wins',
|
|
52
|
+
SPLIT: 'split',
|
|
53
|
+
};
|
|
54
|
+
export const TRANSACTION_TYPE = {
|
|
55
|
+
ESCROW_DEPOSIT: 'escrow_deposit',
|
|
56
|
+
ESCROW_RELEASE: 'escrow_release',
|
|
57
|
+
ESCROW_REFUND: 'escrow_refund',
|
|
58
|
+
PLATFORM_FEE: 'platform_fee',
|
|
59
|
+
TRIBUNAL_FEE: 'tribunal_fee',
|
|
60
|
+
DISPUTE_REFUND: 'dispute_refund',
|
|
61
|
+
};
|
|
62
|
+
export const TRANSACTION_STATUS = {
|
|
63
|
+
PENDING: 'pending',
|
|
64
|
+
CONFIRMED: 'confirmed',
|
|
65
|
+
FAILED: 'failed',
|
|
66
|
+
};
|
|
67
|
+
export const REPUTATION_DIMENSIONS = [
|
|
68
|
+
'quality',
|
|
69
|
+
'reliability',
|
|
70
|
+
'speed',
|
|
71
|
+
'communication',
|
|
72
|
+
'value',
|
|
73
|
+
];
|
|
36
74
|
export const TRUST_LEVELS = {
|
|
37
|
-
L0: 0, // Unverified
|
|
38
|
-
L1: 1, //
|
|
39
|
-
L2: 2, //
|
|
40
|
-
L3: 3, // Portfolio verified
|
|
41
|
-
L4: 4, // Community endorsed
|
|
75
|
+
L0: 0, // Unverified — anonymous agent
|
|
76
|
+
L1: 1, // Challenge completed — basic registration
|
|
77
|
+
L2: 2, // Tasks completed — has track record
|
|
78
|
+
L3: 3, // Portfolio verified — consistently good work
|
|
79
|
+
L4: 4, // Community endorsed — top reputation
|
|
42
80
|
};
|
|
43
81
|
export const MATCHING_MODE = {
|
|
44
82
|
DIRECT: 'direct',
|
|
@@ -58,5 +96,6 @@ export const SCOPES = [
|
|
|
58
96
|
'bids.write',
|
|
59
97
|
'profile.write',
|
|
60
98
|
'ratings.write',
|
|
99
|
+
'portfolio.write',
|
|
61
100
|
];
|
|
62
101
|
//# sourceMappingURL=constants.js.map
|
package/dist/constants.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC;AACtC,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,CAAC;AAC/B,MAAM,CAAC,MAAM,gBAAgB,GAAG,EAAE,CAAC;AACnC,MAAM,CAAC,MAAM,qBAAqB,GAAG,GAAG,CAAC;AAEzC,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,OAAO,EAAE,SAAS;IAClB,MAAM,EAAE,QAAQ;IAChB,SAAS,EAAE,WAAW;IACtB,YAAY,EAAE,cAAc;
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAA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schemas.d.ts
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
export declare const MicroUsdcAmountSchema: z.ZodString;
|
|
2
3
|
export declare const AgentRegisterSchema: z.ZodObject<{
|
|
3
4
|
publicKey: z.ZodString;
|
|
4
5
|
displayName: z.ZodString;
|
|
5
6
|
description: z.ZodOptional<z.ZodString>;
|
|
7
|
+
avatarUrl: z.ZodOptional<z.ZodString>;
|
|
8
|
+
ownerDid: z.ZodOptional<z.ZodString>;
|
|
6
9
|
framework: z.ZodOptional<z.ZodString>;
|
|
7
10
|
frameworkVersion: z.ZodOptional<z.ZodString>;
|
|
8
11
|
modelProvider: z.ZodOptional<z.ZodString>;
|
|
@@ -15,18 +18,26 @@ export declare const AgentRegisterSchema: z.ZodObject<{
|
|
|
15
18
|
description: z.ZodString;
|
|
16
19
|
category: z.ZodString;
|
|
17
20
|
tags: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
21
|
+
inputModes: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
22
|
+
outputModes: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
18
23
|
pricingModel: z.ZodDefault<z.ZodEnum<["per-task", "per-hour", "per-token", "per-request", "custom"]>>;
|
|
19
24
|
basePrice: z.ZodString;
|
|
20
25
|
examplePrompts: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
26
|
+
benchmarkScores: z.ZodOptional<z.ZodUnknown>;
|
|
27
|
+
sampleOutputs: z.ZodOptional<z.ZodUnknown>;
|
|
21
28
|
}, "strip", z.ZodTypeAny, {
|
|
22
29
|
description: string;
|
|
23
30
|
skillId: string;
|
|
24
31
|
skillName: string;
|
|
25
32
|
category: string;
|
|
26
33
|
tags: string[];
|
|
34
|
+
inputModes: string[];
|
|
35
|
+
outputModes: string[];
|
|
27
36
|
pricingModel: "per-task" | "per-hour" | "per-token" | "per-request" | "custom";
|
|
28
37
|
basePrice: string;
|
|
29
38
|
examplePrompts: string[];
|
|
39
|
+
benchmarkScores?: unknown;
|
|
40
|
+
sampleOutputs?: unknown;
|
|
30
41
|
}, {
|
|
31
42
|
description: string;
|
|
32
43
|
skillId: string;
|
|
@@ -34,8 +45,12 @@ export declare const AgentRegisterSchema: z.ZodObject<{
|
|
|
34
45
|
category: string;
|
|
35
46
|
basePrice: string;
|
|
36
47
|
tags?: string[] | undefined;
|
|
48
|
+
inputModes?: string[] | undefined;
|
|
49
|
+
outputModes?: string[] | undefined;
|
|
37
50
|
pricingModel?: "per-task" | "per-hour" | "per-token" | "per-request" | "custom" | undefined;
|
|
38
51
|
examplePrompts?: string[] | undefined;
|
|
52
|
+
benchmarkScores?: unknown;
|
|
53
|
+
sampleOutputs?: unknown;
|
|
39
54
|
}>, "many">>;
|
|
40
55
|
}, "strip", z.ZodTypeAny, {
|
|
41
56
|
publicKey: string;
|
|
@@ -47,11 +62,17 @@ export declare const AgentRegisterSchema: z.ZodObject<{
|
|
|
47
62
|
skillName: string;
|
|
48
63
|
category: string;
|
|
49
64
|
tags: string[];
|
|
65
|
+
inputModes: string[];
|
|
66
|
+
outputModes: string[];
|
|
50
67
|
pricingModel: "per-task" | "per-hour" | "per-token" | "per-request" | "custom";
|
|
51
68
|
basePrice: string;
|
|
52
69
|
examplePrompts: string[];
|
|
70
|
+
benchmarkScores?: unknown;
|
|
71
|
+
sampleOutputs?: unknown;
|
|
53
72
|
}[];
|
|
54
73
|
description?: string | undefined;
|
|
74
|
+
avatarUrl?: string | undefined;
|
|
75
|
+
ownerDid?: string | undefined;
|
|
55
76
|
framework?: string | undefined;
|
|
56
77
|
frameworkVersion?: string | undefined;
|
|
57
78
|
modelProvider?: string | undefined;
|
|
@@ -62,6 +83,8 @@ export declare const AgentRegisterSchema: z.ZodObject<{
|
|
|
62
83
|
displayName: string;
|
|
63
84
|
walletAddress: string;
|
|
64
85
|
description?: string | undefined;
|
|
86
|
+
avatarUrl?: string | undefined;
|
|
87
|
+
ownerDid?: string | undefined;
|
|
65
88
|
framework?: string | undefined;
|
|
66
89
|
frameworkVersion?: string | undefined;
|
|
67
90
|
modelProvider?: string | undefined;
|
|
@@ -74,8 +97,12 @@ export declare const AgentRegisterSchema: z.ZodObject<{
|
|
|
74
97
|
category: string;
|
|
75
98
|
basePrice: string;
|
|
76
99
|
tags?: string[] | undefined;
|
|
100
|
+
inputModes?: string[] | undefined;
|
|
101
|
+
outputModes?: string[] | undefined;
|
|
77
102
|
pricingModel?: "per-task" | "per-hour" | "per-token" | "per-request" | "custom" | undefined;
|
|
78
103
|
examplePrompts?: string[] | undefined;
|
|
104
|
+
benchmarkScores?: unknown;
|
|
105
|
+
sampleOutputs?: unknown;
|
|
79
106
|
}[] | undefined;
|
|
80
107
|
}>;
|
|
81
108
|
export declare const AgentVerifySchema: z.ZodObject<{
|
|
@@ -101,6 +128,8 @@ export declare const AgentLoginChallengeSchema: z.ZodObject<{
|
|
|
101
128
|
export declare const AgentUpdateSchema: z.ZodObject<{
|
|
102
129
|
displayName: z.ZodOptional<z.ZodString>;
|
|
103
130
|
description: z.ZodOptional<z.ZodString>;
|
|
131
|
+
avatarUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
132
|
+
ownerDid: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
104
133
|
framework: z.ZodOptional<z.ZodString>;
|
|
105
134
|
frameworkVersion: z.ZodOptional<z.ZodString>;
|
|
106
135
|
modelProvider: z.ZodOptional<z.ZodString>;
|
|
@@ -110,6 +139,8 @@ export declare const AgentUpdateSchema: z.ZodObject<{
|
|
|
110
139
|
}, "strip", z.ZodTypeAny, {
|
|
111
140
|
displayName?: string | undefined;
|
|
112
141
|
description?: string | undefined;
|
|
142
|
+
avatarUrl?: string | null | undefined;
|
|
143
|
+
ownerDid?: string | null | undefined;
|
|
113
144
|
framework?: string | undefined;
|
|
114
145
|
frameworkVersion?: string | undefined;
|
|
115
146
|
modelProvider?: string | undefined;
|
|
@@ -119,6 +150,8 @@ export declare const AgentUpdateSchema: z.ZodObject<{
|
|
|
119
150
|
}, {
|
|
120
151
|
displayName?: string | undefined;
|
|
121
152
|
description?: string | undefined;
|
|
153
|
+
avatarUrl?: string | null | undefined;
|
|
154
|
+
ownerDid?: string | null | undefined;
|
|
122
155
|
framework?: string | undefined;
|
|
123
156
|
frameworkVersion?: string | undefined;
|
|
124
157
|
modelProvider?: string | undefined;
|
|
@@ -131,6 +164,7 @@ export declare const TaskCreateSchema: z.ZodObject<{
|
|
|
131
164
|
description: z.ZodString;
|
|
132
165
|
skillRequirements: z.ZodArray<z.ZodString, "many">;
|
|
133
166
|
inputData: z.ZodOptional<z.ZodUnknown>;
|
|
167
|
+
inputFiles: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
134
168
|
matchingMode: z.ZodDefault<z.ZodEnum<["direct", "open", "auto"]>>;
|
|
135
169
|
budgetMin: z.ZodOptional<z.ZodString>;
|
|
136
170
|
budgetMax: z.ZodString;
|
|
@@ -140,6 +174,7 @@ export declare const TaskCreateSchema: z.ZodObject<{
|
|
|
140
174
|
description: string;
|
|
141
175
|
title: string;
|
|
142
176
|
skillRequirements: string[];
|
|
177
|
+
inputFiles: string[];
|
|
143
178
|
matchingMode: "open" | "direct" | "auto";
|
|
144
179
|
budgetMax: string;
|
|
145
180
|
inputData?: unknown;
|
|
@@ -152,6 +187,7 @@ export declare const TaskCreateSchema: z.ZodObject<{
|
|
|
152
187
|
skillRequirements: string[];
|
|
153
188
|
budgetMax: string;
|
|
154
189
|
inputData?: unknown;
|
|
190
|
+
inputFiles?: string[] | undefined;
|
|
155
191
|
matchingMode?: "open" | "direct" | "auto" | undefined;
|
|
156
192
|
budgetMin?: string | undefined;
|
|
157
193
|
deadline?: string | undefined;
|
|
@@ -198,6 +234,39 @@ export declare const TaskSubmitSchema: z.ZodObject<{
|
|
|
198
234
|
files?: string[] | undefined;
|
|
199
235
|
notes?: string | undefined;
|
|
200
236
|
}>;
|
|
237
|
+
export declare const TaskDisputeSchema: z.ZodObject<{
|
|
238
|
+
reason: z.ZodString;
|
|
239
|
+
evidence: z.ZodOptional<z.ZodUnknown>;
|
|
240
|
+
}, "strip", z.ZodTypeAny, {
|
|
241
|
+
reason: string;
|
|
242
|
+
evidence?: unknown;
|
|
243
|
+
}, {
|
|
244
|
+
reason: string;
|
|
245
|
+
evidence?: unknown;
|
|
246
|
+
}>;
|
|
247
|
+
export declare const DisputeResolveSchema: z.ZodObject<{
|
|
248
|
+
resolution: z.ZodEnum<["release", "refund", "split"]>;
|
|
249
|
+
notes: z.ZodOptional<z.ZodString>;
|
|
250
|
+
splitPercent: z.ZodOptional<z.ZodNumber>;
|
|
251
|
+
}, "strip", z.ZodTypeAny, {
|
|
252
|
+
resolution: "release" | "refund" | "split";
|
|
253
|
+
notes?: string | undefined;
|
|
254
|
+
splitPercent?: number | undefined;
|
|
255
|
+
}, {
|
|
256
|
+
resolution: "release" | "refund" | "split";
|
|
257
|
+
notes?: string | undefined;
|
|
258
|
+
splitPercent?: number | undefined;
|
|
259
|
+
}>;
|
|
260
|
+
export declare const TribunalVoteSchema: z.ZodObject<{
|
|
261
|
+
verdict: z.ZodEnum<["requester_wins", "assignee_wins", "split"]>;
|
|
262
|
+
notes: z.ZodOptional<z.ZodString>;
|
|
263
|
+
}, "strip", z.ZodTypeAny, {
|
|
264
|
+
verdict: "split" | "requester_wins" | "assignee_wins";
|
|
265
|
+
notes?: string | undefined;
|
|
266
|
+
}, {
|
|
267
|
+
verdict: "split" | "requester_wins" | "assignee_wins";
|
|
268
|
+
notes?: string | undefined;
|
|
269
|
+
}>;
|
|
201
270
|
export declare const TaskListQuerySchema: z.ZodObject<{
|
|
202
271
|
q: z.ZodOptional<z.ZodString>;
|
|
203
272
|
status: z.ZodOptional<z.ZodString>;
|
|
@@ -232,18 +301,24 @@ export declare const TaskListQuerySchema: z.ZodObject<{
|
|
|
232
301
|
export declare const AgentListQuerySchema: z.ZodObject<{
|
|
233
302
|
q: z.ZodOptional<z.ZodString>;
|
|
234
303
|
skills: z.ZodOptional<z.ZodString>;
|
|
304
|
+
framework: z.ZodOptional<z.ZodString>;
|
|
305
|
+
minTrustLevel: z.ZodOptional<z.ZodNumber>;
|
|
235
306
|
limit: z.ZodDefault<z.ZodNumber>;
|
|
236
307
|
offset: z.ZodDefault<z.ZodNumber>;
|
|
237
308
|
}, "strip", z.ZodTypeAny, {
|
|
238
309
|
limit: number;
|
|
239
310
|
offset: number;
|
|
311
|
+
framework?: string | undefined;
|
|
240
312
|
skills?: string | undefined;
|
|
241
313
|
q?: string | undefined;
|
|
314
|
+
minTrustLevel?: number | undefined;
|
|
242
315
|
}, {
|
|
316
|
+
framework?: string | undefined;
|
|
243
317
|
skills?: string | undefined;
|
|
244
318
|
q?: string | undefined;
|
|
245
319
|
limit?: number | undefined;
|
|
246
320
|
offset?: number | undefined;
|
|
321
|
+
minTrustLevel?: number | undefined;
|
|
247
322
|
}>;
|
|
248
323
|
export declare const BidCreateSchema: z.ZodObject<{
|
|
249
324
|
proposedPrice: z.ZodString;
|
|
@@ -271,24 +346,40 @@ export declare const RatingCreateSchema: z.ZodObject<{
|
|
|
271
346
|
speedScore: z.ZodOptional<z.ZodNumber>;
|
|
272
347
|
communicationScore: z.ZodOptional<z.ZodNumber>;
|
|
273
348
|
reliabilityScore: z.ZodOptional<z.ZodNumber>;
|
|
349
|
+
valueScore: z.ZodOptional<z.ZodNumber>;
|
|
350
|
+
evidence: z.ZodOptional<z.ZodUnknown>;
|
|
274
351
|
comment: z.ZodOptional<z.ZodString>;
|
|
275
352
|
}, "strip", z.ZodTypeAny, {
|
|
276
353
|
taskId: string;
|
|
277
354
|
rateeId: string;
|
|
278
355
|
qualityScore: number;
|
|
356
|
+
evidence?: unknown;
|
|
279
357
|
speedScore?: number | undefined;
|
|
280
358
|
communicationScore?: number | undefined;
|
|
281
359
|
reliabilityScore?: number | undefined;
|
|
360
|
+
valueScore?: number | undefined;
|
|
282
361
|
comment?: string | undefined;
|
|
283
362
|
}, {
|
|
284
363
|
taskId: string;
|
|
285
364
|
rateeId: string;
|
|
286
365
|
qualityScore: number;
|
|
366
|
+
evidence?: unknown;
|
|
287
367
|
speedScore?: number | undefined;
|
|
288
368
|
communicationScore?: number | undefined;
|
|
289
369
|
reliabilityScore?: number | undefined;
|
|
370
|
+
valueScore?: number | undefined;
|
|
290
371
|
comment?: string | undefined;
|
|
291
372
|
}>;
|
|
373
|
+
export declare const PortfolioItemUpdateSchema: z.ZodObject<{
|
|
374
|
+
isPinned: z.ZodOptional<z.ZodBoolean>;
|
|
375
|
+
displayOrder: z.ZodOptional<z.ZodNumber>;
|
|
376
|
+
}, "strip", z.ZodTypeAny, {
|
|
377
|
+
isPinned?: boolean | undefined;
|
|
378
|
+
displayOrder?: number | undefined;
|
|
379
|
+
}, {
|
|
380
|
+
isPinned?: boolean | undefined;
|
|
381
|
+
displayOrder?: number | undefined;
|
|
382
|
+
}>;
|
|
292
383
|
export type AgentRegisterInput = z.infer<typeof AgentRegisterSchema>;
|
|
293
384
|
export type AgentVerifyInput = z.infer<typeof AgentVerifySchema>;
|
|
294
385
|
export type AgentLoginChallengeInput = z.infer<typeof AgentLoginChallengeSchema>;
|
|
@@ -296,8 +387,12 @@ export type AgentUpdateInput = z.infer<typeof AgentUpdateSchema>;
|
|
|
296
387
|
export type TaskCreateInput = z.infer<typeof TaskCreateSchema>;
|
|
297
388
|
export type TaskUpdateInput = z.infer<typeof TaskUpdateSchema>;
|
|
298
389
|
export type TaskSubmitInput = z.infer<typeof TaskSubmitSchema>;
|
|
390
|
+
export type TaskDisputeInput = z.infer<typeof TaskDisputeSchema>;
|
|
391
|
+
export type DisputeResolveInput = z.infer<typeof DisputeResolveSchema>;
|
|
392
|
+
export type TribunalVoteInput = z.infer<typeof TribunalVoteSchema>;
|
|
299
393
|
export type TaskListQuery = z.infer<typeof TaskListQuerySchema>;
|
|
300
394
|
export type AgentListQuery = z.infer<typeof AgentListQuerySchema>;
|
|
301
395
|
export type BidCreateInput = z.infer<typeof BidCreateSchema>;
|
|
302
396
|
export type RatingCreateInput = z.infer<typeof RatingCreateSchema>;
|
|
397
|
+
export type PortfolioItemUpdateInput = z.infer<typeof PortfolioItemUpdateSchema>;
|
|
303
398
|
//# sourceMappingURL=schemas.d.ts.map
|
package/dist/schemas.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../src/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../src/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAYxB,eAAO,MAAM,qBAAqB,aAAuD,CAAC;AAG1F,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgC9B,CAAC;AAEH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;EAI5B,CAAC;AAEH,eAAO,MAAM,yBAAyB;;;;;;EAEpC,CAAC;AAEH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAW5B,CAAC;AAGH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAe3B,CAAC;AAEH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;EAI3B,CAAC;AAEH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;EAO3B,CAAC;AAEH,eAAO,MAAM,iBAAiB;;;;;;;;;EAG5B,CAAC;AAEH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;EAQ/B,CAAC;AAEH,eAAO,MAAM,kBAAkB;;;;;;;;;EAO7B,CAAC;AAEH,eAAO,MAAM,mBAAmB;;;;;;;;;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,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAClE,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAC7D,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AACnE,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC"}
|
package/dist/schemas.js
CHANGED
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { MATCHING_MODE, PRICING_MODEL } from './constants.js';
|
|
2
|
+
import { MATCHING_MODE, PRICING_MODEL, DISPUTE_RESOLUTION, DISPUTE_VERDICT, } from './constants.js';
|
|
3
|
+
const MICRO_USDC_AMOUNT_MESSAGE = 'Must be a non-negative integer amount in micro-USDC';
|
|
4
|
+
export const MicroUsdcAmountSchema = z.string().regex(/^\d+$/, MICRO_USDC_AMOUNT_MESSAGE);
|
|
3
5
|
// Agent registration
|
|
4
6
|
export const AgentRegisterSchema = z.object({
|
|
5
7
|
publicKey: z.string().min(1, 'Public key is required'),
|
|
6
8
|
displayName: z.string().min(1).max(200),
|
|
7
9
|
description: z.string().max(2000).optional(),
|
|
10
|
+
avatarUrl: z.string().url().optional(),
|
|
11
|
+
ownerDid: z.string().optional(),
|
|
8
12
|
framework: z.string().optional(),
|
|
9
13
|
frameworkVersion: z.string().optional(),
|
|
10
14
|
modelProvider: z.string().optional(),
|
|
@@ -17,6 +21,8 @@ export const AgentRegisterSchema = z.object({
|
|
|
17
21
|
description: z.string().min(1),
|
|
18
22
|
category: z.string().min(1),
|
|
19
23
|
tags: z.array(z.string()).default([]),
|
|
24
|
+
inputModes: z.array(z.string()).default(['text']),
|
|
25
|
+
outputModes: z.array(z.string()).default(['text']),
|
|
20
26
|
pricingModel: z.enum([
|
|
21
27
|
PRICING_MODEL.PER_TASK,
|
|
22
28
|
PRICING_MODEL.PER_HOUR,
|
|
@@ -24,8 +30,10 @@ export const AgentRegisterSchema = z.object({
|
|
|
24
30
|
PRICING_MODEL.PER_REQUEST,
|
|
25
31
|
PRICING_MODEL.CUSTOM,
|
|
26
32
|
]).default(PRICING_MODEL.PER_TASK),
|
|
27
|
-
basePrice:
|
|
33
|
+
basePrice: MicroUsdcAmountSchema, // USDC amount as string (6 decimals)
|
|
28
34
|
examplePrompts: z.array(z.string()).default([]),
|
|
35
|
+
benchmarkScores: z.unknown().optional(),
|
|
36
|
+
sampleOutputs: z.unknown().optional(),
|
|
29
37
|
})).default([]),
|
|
30
38
|
});
|
|
31
39
|
export const AgentVerifySchema = z.object({
|
|
@@ -39,12 +47,14 @@ export const AgentLoginChallengeSchema = z.object({
|
|
|
39
47
|
export const AgentUpdateSchema = z.object({
|
|
40
48
|
displayName: z.string().min(1).max(200).optional(),
|
|
41
49
|
description: z.string().max(2000).optional(),
|
|
50
|
+
avatarUrl: z.string().url().nullable().optional(),
|
|
51
|
+
ownerDid: z.string().nullable().optional(),
|
|
42
52
|
framework: z.string().optional(),
|
|
43
53
|
frameworkVersion: z.string().optional(),
|
|
44
54
|
modelProvider: z.string().optional(),
|
|
45
55
|
modelName: z.string().optional(),
|
|
46
56
|
agentCardUrl: z.string().url().optional(),
|
|
47
|
-
dailySpendingLimit:
|
|
57
|
+
dailySpendingLimit: MicroUsdcAmountSchema.optional(),
|
|
48
58
|
});
|
|
49
59
|
// Tasks
|
|
50
60
|
export const TaskCreateSchema = z.object({
|
|
@@ -52,13 +62,14 @@ export const TaskCreateSchema = z.object({
|
|
|
52
62
|
description: z.string().min(1).max(10000),
|
|
53
63
|
skillRequirements: z.array(z.string().min(1)).min(1),
|
|
54
64
|
inputData: z.unknown().optional(),
|
|
65
|
+
inputFiles: z.array(z.string().url()).default([]),
|
|
55
66
|
matchingMode: z.enum([
|
|
56
67
|
MATCHING_MODE.DIRECT,
|
|
57
68
|
MATCHING_MODE.OPEN,
|
|
58
69
|
MATCHING_MODE.AUTO,
|
|
59
70
|
]).default(MATCHING_MODE.OPEN),
|
|
60
|
-
budgetMin:
|
|
61
|
-
budgetMax:
|
|
71
|
+
budgetMin: MicroUsdcAmountSchema.optional(),
|
|
72
|
+
budgetMax: MicroUsdcAmountSchema,
|
|
62
73
|
deadline: z.string().datetime().optional(),
|
|
63
74
|
directAssigneeId: z.string().uuid().optional(), // for direct matching
|
|
64
75
|
});
|
|
@@ -75,12 +86,33 @@ export const TaskSubmitSchema = z.object({
|
|
|
75
86
|
files: z.array(z.string().url()).default([]),
|
|
76
87
|
notes: z.string().max(5000).optional(),
|
|
77
88
|
});
|
|
89
|
+
export const TaskDisputeSchema = z.object({
|
|
90
|
+
reason: z.string().min(1).max(5000),
|
|
91
|
+
evidence: z.unknown().optional(),
|
|
92
|
+
});
|
|
93
|
+
export const DisputeResolveSchema = z.object({
|
|
94
|
+
resolution: z.enum([
|
|
95
|
+
DISPUTE_RESOLUTION.RELEASE,
|
|
96
|
+
DISPUTE_RESOLUTION.REFUND,
|
|
97
|
+
DISPUTE_RESOLUTION.SPLIT,
|
|
98
|
+
]),
|
|
99
|
+
notes: z.string().max(5000).optional(),
|
|
100
|
+
splitPercent: z.number().min(0).max(100).optional(), // assignee's share when split
|
|
101
|
+
});
|
|
102
|
+
export const TribunalVoteSchema = z.object({
|
|
103
|
+
verdict: z.enum([
|
|
104
|
+
DISPUTE_VERDICT.REQUESTER_WINS,
|
|
105
|
+
DISPUTE_VERDICT.ASSIGNEE_WINS,
|
|
106
|
+
DISPUTE_VERDICT.SPLIT,
|
|
107
|
+
]),
|
|
108
|
+
notes: z.string().max(5000).optional(),
|
|
109
|
+
});
|
|
78
110
|
export const TaskListQuerySchema = z.object({
|
|
79
111
|
q: z.string().optional(),
|
|
80
112
|
status: z.string().optional(),
|
|
81
113
|
skills: z.string().optional(), // comma-separated
|
|
82
|
-
budgetMin:
|
|
83
|
-
budgetMax:
|
|
114
|
+
budgetMin: MicroUsdcAmountSchema.optional(),
|
|
115
|
+
budgetMax: MicroUsdcAmountSchema.optional(),
|
|
84
116
|
requesterId: z.string().uuid().optional(),
|
|
85
117
|
assigneeId: z.string().uuid().optional(),
|
|
86
118
|
limit: z.coerce.number().min(1).max(100).default(20),
|
|
@@ -89,25 +121,34 @@ export const TaskListQuerySchema = z.object({
|
|
|
89
121
|
export const AgentListQuerySchema = z.object({
|
|
90
122
|
q: z.string().optional(),
|
|
91
123
|
skills: z.string().optional(), // comma-separated
|
|
124
|
+
framework: z.string().optional(),
|
|
125
|
+
minTrustLevel: z.coerce.number().min(0).max(4).optional(),
|
|
92
126
|
limit: z.coerce.number().min(1).max(100).default(20),
|
|
93
127
|
offset: z.coerce.number().min(0).default(0),
|
|
94
128
|
});
|
|
95
129
|
// Bids
|
|
96
130
|
export const BidCreateSchema = z.object({
|
|
97
|
-
proposedPrice:
|
|
131
|
+
proposedPrice: MicroUsdcAmountSchema,
|
|
98
132
|
confidenceScore: z.number().min(0).max(1).optional(),
|
|
99
133
|
estimatedDuration: z.string().optional(), // ISO 8601 duration
|
|
100
134
|
proposal: z.string().max(5000).optional(),
|
|
101
135
|
portfolioRefs: z.array(z.string().url()).default([]),
|
|
102
136
|
});
|
|
103
|
-
// Ratings
|
|
137
|
+
// Ratings (float 0-1 scale)
|
|
104
138
|
export const RatingCreateSchema = z.object({
|
|
105
139
|
taskId: z.string().uuid(),
|
|
106
140
|
rateeId: z.string().uuid(),
|
|
107
|
-
qualityScore: z.number().
|
|
108
|
-
speedScore: z.number().
|
|
109
|
-
communicationScore: z.number().
|
|
110
|
-
reliabilityScore: z.number().
|
|
141
|
+
qualityScore: z.number().min(0).max(1),
|
|
142
|
+
speedScore: z.number().min(0).max(1).optional(),
|
|
143
|
+
communicationScore: z.number().min(0).max(1).optional(),
|
|
144
|
+
reliabilityScore: z.number().min(0).max(1).optional(),
|
|
145
|
+
valueScore: z.number().min(0).max(1).optional(),
|
|
146
|
+
evidence: z.unknown().optional(),
|
|
111
147
|
comment: z.string().max(2000).optional(),
|
|
112
148
|
});
|
|
149
|
+
// Portfolio
|
|
150
|
+
export const PortfolioItemUpdateSchema = z.object({
|
|
151
|
+
isPinned: z.boolean().optional(),
|
|
152
|
+
displayOrder: z.number().int().min(0).optional(),
|
|
153
|
+
});
|
|
113
154
|
//# sourceMappingURL=schemas.js.map
|
package/dist/schemas.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schemas.js","sourceRoot":"","sources":["../src/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,
|
|
1
|
+
{"version":3,"file":"schemas.js","sourceRoot":"","sources":["../src/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAEL,aAAa,EACb,aAAa,EAGb,kBAAkB,EAClB,eAAe,GAChB,MAAM,gBAAgB,CAAC;AAExB,MAAM,yBAAyB,GAAG,qDAAqD,CAAC;AACxF,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,OAAO,EAAE,yBAAyB,CAAC,CAAC;AAE1F,qBAAqB;AACrB,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC1C,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,wBAAwB,CAAC;IACtD,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC;IACvC,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE;IAC5C,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE;IACtC,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC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GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;IAC/C,QAAQ,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IAChC,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE;CACzC,CAAC,CAAC;AAEH,YAAY;AACZ,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,CAAC,MAAM,CAAC;IAChD,QAAQ,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IAChC,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;CACjD,CAAC,CAAC"}
|
package/dist/types.d.ts
CHANGED
|
@@ -1,20 +1,26 @@
|
|
|
1
|
-
import type { Scope } from './constants.js';
|
|
1
|
+
import type { Scope, ReputationDimension } from './constants.js';
|
|
2
2
|
export interface Agent {
|
|
3
3
|
id: string;
|
|
4
4
|
did: string;
|
|
5
5
|
publicKey: string;
|
|
6
6
|
displayName: string;
|
|
7
7
|
description: string | null;
|
|
8
|
+
avatarUrl: string | null;
|
|
9
|
+
ownerDid: string | null;
|
|
8
10
|
framework: string | null;
|
|
9
11
|
frameworkVersion: string | null;
|
|
10
12
|
modelProvider: string | null;
|
|
11
13
|
modelName: string | null;
|
|
14
|
+
agentCard: unknown;
|
|
12
15
|
walletAddress: string;
|
|
13
16
|
trustLevel: number;
|
|
14
17
|
dailySpendingLimit: string | null;
|
|
18
|
+
earningTotal: string | null;
|
|
15
19
|
agentCardUrl: string | null;
|
|
16
20
|
status: string;
|
|
21
|
+
verifiedAt: string | null;
|
|
17
22
|
lastHeartbeat: string | null;
|
|
23
|
+
lastActiveAt: string | null;
|
|
18
24
|
createdAt: string;
|
|
19
25
|
updatedAt: string;
|
|
20
26
|
}
|
|
@@ -26,13 +32,19 @@ export interface AgentSkill {
|
|
|
26
32
|
description: string;
|
|
27
33
|
category: string;
|
|
28
34
|
tags: string[];
|
|
35
|
+
inputModes: string[];
|
|
36
|
+
outputModes: string[];
|
|
29
37
|
pricingModel: string;
|
|
30
38
|
basePrice: string;
|
|
31
39
|
currency: string;
|
|
32
40
|
examplePrompts: string[];
|
|
41
|
+
benchmarkScores: unknown;
|
|
42
|
+
sampleOutputs: unknown;
|
|
33
43
|
tasksCompleted: number;
|
|
44
|
+
avgCompletionTime: string | null;
|
|
34
45
|
avgQualityScore: number | null;
|
|
35
46
|
createdAt: string;
|
|
47
|
+
updatedAt: string;
|
|
36
48
|
}
|
|
37
49
|
export interface Task {
|
|
38
50
|
id: string;
|
|
@@ -42,11 +54,14 @@ export interface Task {
|
|
|
42
54
|
description: string;
|
|
43
55
|
skillRequirements: string[];
|
|
44
56
|
inputData: unknown;
|
|
57
|
+
inputFiles: string[] | null;
|
|
45
58
|
matchingMode: string;
|
|
46
59
|
budgetMin: string | null;
|
|
47
60
|
budgetMax: string;
|
|
48
61
|
currency: string;
|
|
49
62
|
finalPrice: string | null;
|
|
63
|
+
platformFee: string | null;
|
|
64
|
+
paymentTxId: string | null;
|
|
50
65
|
status: string;
|
|
51
66
|
deadline: string | null;
|
|
52
67
|
startedAt: string | null;
|
|
@@ -55,6 +70,7 @@ export interface Task {
|
|
|
55
70
|
resultArtifacts: unknown;
|
|
56
71
|
resultFiles: string[] | null;
|
|
57
72
|
qualityScore: number | null;
|
|
73
|
+
qualityDetails: unknown;
|
|
58
74
|
createdAt: string;
|
|
59
75
|
updatedAt: string;
|
|
60
76
|
}
|
|
@@ -84,6 +100,23 @@ export interface EscrowTransaction {
|
|
|
84
100
|
createdAt: string;
|
|
85
101
|
updatedAt: string;
|
|
86
102
|
}
|
|
103
|
+
export interface Dispute {
|
|
104
|
+
id: string;
|
|
105
|
+
taskId: string;
|
|
106
|
+
raisedByAgentId: string;
|
|
107
|
+
againstAgentId: string | null;
|
|
108
|
+
reason: string;
|
|
109
|
+
evidence: unknown;
|
|
110
|
+
status: string;
|
|
111
|
+
resolution: string | null;
|
|
112
|
+
resolutionNotes: string | null;
|
|
113
|
+
tribunalAgents: string[] | null;
|
|
114
|
+
tribunalVotes: unknown;
|
|
115
|
+
verdict: string | null;
|
|
116
|
+
createdAt: string;
|
|
117
|
+
resolvedAt: string | null;
|
|
118
|
+
updatedAt: string;
|
|
119
|
+
}
|
|
87
120
|
export interface AgentRating {
|
|
88
121
|
id: string;
|
|
89
122
|
taskId: string;
|
|
@@ -93,8 +126,74 @@ export interface AgentRating {
|
|
|
93
126
|
speedScore: number | null;
|
|
94
127
|
communicationScore: number | null;
|
|
95
128
|
reliabilityScore: number | null;
|
|
129
|
+
valueScore: number | null;
|
|
130
|
+
overallScore: number;
|
|
131
|
+
evidence: unknown;
|
|
96
132
|
comment: string | null;
|
|
133
|
+
raterReputationAtTime: number | null;
|
|
134
|
+
weight: number | null;
|
|
135
|
+
createdAt: string;
|
|
136
|
+
}
|
|
137
|
+
export interface AgentReputationRecord {
|
|
138
|
+
agentId: string;
|
|
139
|
+
dimension: ReputationDimension;
|
|
140
|
+
score: number;
|
|
141
|
+
confidence: number;
|
|
142
|
+
totalRatings: number;
|
|
143
|
+
recentTrend: number | null;
|
|
144
|
+
updatedAt: string;
|
|
145
|
+
}
|
|
146
|
+
export interface PortfolioItem {
|
|
147
|
+
id?: string;
|
|
148
|
+
agentId?: string;
|
|
149
|
+
taskId: string;
|
|
150
|
+
title: string;
|
|
151
|
+
description: string;
|
|
152
|
+
category?: string;
|
|
153
|
+
completedAt: string;
|
|
154
|
+
qualityScore: number | null;
|
|
155
|
+
requester: {
|
|
156
|
+
id: string;
|
|
157
|
+
displayName: string;
|
|
158
|
+
} | null;
|
|
159
|
+
artifacts: unknown[];
|
|
160
|
+
files: string[];
|
|
161
|
+
isPinned?: boolean;
|
|
162
|
+
displayOrder?: number;
|
|
163
|
+
}
|
|
164
|
+
export interface Transaction {
|
|
165
|
+
id: string;
|
|
166
|
+
taskId: string | null;
|
|
167
|
+
type: string;
|
|
168
|
+
fromAgentId: string | null;
|
|
169
|
+
toAgentId: string | null;
|
|
170
|
+
amount: string;
|
|
171
|
+
currency: string;
|
|
172
|
+
txHash: string | null;
|
|
173
|
+
blockNumber: string | null;
|
|
174
|
+
network: string | null;
|
|
175
|
+
status: string;
|
|
97
176
|
createdAt: string;
|
|
177
|
+
confirmedAt: string | null;
|
|
178
|
+
}
|
|
179
|
+
export interface AuditLogEntry {
|
|
180
|
+
id: number;
|
|
181
|
+
timestamp: string;
|
|
182
|
+
eventType: string;
|
|
183
|
+
actorId: string | null;
|
|
184
|
+
targetId: string | null;
|
|
185
|
+
targetType: string | null;
|
|
186
|
+
payload: unknown;
|
|
187
|
+
hash: string;
|
|
188
|
+
previousHash: string | null;
|
|
189
|
+
}
|
|
190
|
+
export interface StoredArtifactRef {
|
|
191
|
+
key: string;
|
|
192
|
+
url: string;
|
|
193
|
+
contentType: string;
|
|
194
|
+
byteLength: number;
|
|
195
|
+
source: 'inline' | 'file';
|
|
196
|
+
originalUrl?: string;
|
|
98
197
|
}
|
|
99
198
|
export interface AATPayload {
|
|
100
199
|
sub: string;
|
|
@@ -129,4 +228,15 @@ export interface SSEEvent {
|
|
|
129
228
|
data: unknown;
|
|
130
229
|
timestamp: string;
|
|
131
230
|
}
|
|
231
|
+
export interface QualityReport {
|
|
232
|
+
overallScore: number;
|
|
233
|
+
checks: QualityCheck[];
|
|
234
|
+
passed: boolean;
|
|
235
|
+
}
|
|
236
|
+
export interface QualityCheck {
|
|
237
|
+
name: string;
|
|
238
|
+
score: number;
|
|
239
|
+
passed: boolean;
|
|
240
|
+
details?: string;
|
|
241
|
+
}
|
|
132
242
|
//# sourceMappingURL=types.d.ts.map
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK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MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,OAAO,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,aAAa;IAC5B,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,YAAY,EAAE,CAAC;IACvB,MAAM,EAAE,OAAO,CAAC;CACjB;AAED,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB"}
|
package/package.json
CHANGED
|
@@ -1,23 +1,28 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@swarmdock/shared",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
7
|
+
"files": [
|
|
8
|
+
"dist"
|
|
9
|
+
],
|
|
7
10
|
"exports": {
|
|
8
11
|
".": {
|
|
9
12
|
"import": "./dist/index.js",
|
|
10
13
|
"types": "./dist/index.d.ts"
|
|
11
14
|
}
|
|
12
15
|
},
|
|
13
|
-
"scripts": {
|
|
14
|
-
"type-check": "tsc --noEmit",
|
|
15
|
-
"build": "tsc"
|
|
16
|
-
},
|
|
17
16
|
"dependencies": {
|
|
18
17
|
"zod": "^3.24.0"
|
|
19
18
|
},
|
|
20
19
|
"devDependencies": {
|
|
20
|
+
"tsx": "^4.20.0",
|
|
21
21
|
"typescript": "^5.8.0"
|
|
22
|
+
},
|
|
23
|
+
"scripts": {
|
|
24
|
+
"type-check": "tsc --noEmit",
|
|
25
|
+
"build": "tsc",
|
|
26
|
+
"test": "node --import ./node_modules/tsx/dist/loader.mjs --test tests/**/*.test.ts"
|
|
22
27
|
}
|
|
23
|
-
}
|
|
28
|
+
}
|
package/.turbo/turbo-build.log
DELETED
package/src/constants.ts
DELETED
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
export const PLATFORM_FEE_PERCENT = 7;
|
|
2
|
-
export const USDC_DECIMALS = 6;
|
|
3
|
-
export const AAT_EXPIRY_HOURS = 24;
|
|
4
|
-
export const CHALLENGE_TTL_SECONDS = 300;
|
|
5
|
-
|
|
6
|
-
export const AGENT_STATUS = {
|
|
7
|
-
PENDING: 'pending',
|
|
8
|
-
ACTIVE: 'active',
|
|
9
|
-
SUSPENDED: 'suspended',
|
|
10
|
-
DEREGISTERED: 'deregistered',
|
|
11
|
-
} as const;
|
|
12
|
-
|
|
13
|
-
export const TASK_STATUS = {
|
|
14
|
-
OPEN: 'open',
|
|
15
|
-
BIDDING: 'bidding',
|
|
16
|
-
ASSIGNED: 'assigned',
|
|
17
|
-
IN_PROGRESS: 'in_progress',
|
|
18
|
-
REVIEW: 'review',
|
|
19
|
-
COMPLETED: 'completed',
|
|
20
|
-
DISPUTED: 'disputed',
|
|
21
|
-
CANCELLED: 'cancelled',
|
|
22
|
-
EXPIRED: 'expired',
|
|
23
|
-
FAILED: 'failed',
|
|
24
|
-
} as const;
|
|
25
|
-
|
|
26
|
-
export const BID_STATUS = {
|
|
27
|
-
PENDING: 'pending',
|
|
28
|
-
ACCEPTED: 'accepted',
|
|
29
|
-
REJECTED: 'rejected',
|
|
30
|
-
WITHDRAWN: 'withdrawn',
|
|
31
|
-
} as const;
|
|
32
|
-
|
|
33
|
-
export const ESCROW_STATUS = {
|
|
34
|
-
PENDING: 'pending',
|
|
35
|
-
FUNDED: 'funded',
|
|
36
|
-
RELEASED: 'released',
|
|
37
|
-
REFUNDED: 'refunded',
|
|
38
|
-
FAILED: 'failed',
|
|
39
|
-
} as const;
|
|
40
|
-
|
|
41
|
-
export const TRUST_LEVELS = {
|
|
42
|
-
L0: 0, // Unverified
|
|
43
|
-
L1: 1, // Email verified
|
|
44
|
-
L2: 2, // Challenge completed
|
|
45
|
-
L3: 3, // Portfolio verified
|
|
46
|
-
L4: 4, // Community endorsed
|
|
47
|
-
} as const;
|
|
48
|
-
|
|
49
|
-
export const MATCHING_MODE = {
|
|
50
|
-
DIRECT: 'direct',
|
|
51
|
-
OPEN: 'open',
|
|
52
|
-
AUTO: 'auto',
|
|
53
|
-
} as const;
|
|
54
|
-
|
|
55
|
-
export const PRICING_MODEL = {
|
|
56
|
-
PER_TASK: 'per-task',
|
|
57
|
-
PER_HOUR: 'per-hour',
|
|
58
|
-
PER_TOKEN: 'per-token',
|
|
59
|
-
PER_REQUEST: 'per-request',
|
|
60
|
-
CUSTOM: 'custom',
|
|
61
|
-
} as const;
|
|
62
|
-
|
|
63
|
-
export const SCOPES = [
|
|
64
|
-
'tasks.read',
|
|
65
|
-
'tasks.write',
|
|
66
|
-
'bids.write',
|
|
67
|
-
'profile.write',
|
|
68
|
-
'ratings.write',
|
|
69
|
-
] as const;
|
|
70
|
-
|
|
71
|
-
export type Scope = (typeof SCOPES)[number];
|
package/src/index.ts
DELETED
package/src/schemas.ts
DELETED
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import { TASK_STATUS, MATCHING_MODE, PRICING_MODEL, BID_STATUS, SCOPES } from './constants.js';
|
|
3
|
-
|
|
4
|
-
// Agent registration
|
|
5
|
-
export const AgentRegisterSchema = z.object({
|
|
6
|
-
publicKey: z.string().min(1, 'Public key is required'),
|
|
7
|
-
displayName: z.string().min(1).max(200),
|
|
8
|
-
description: z.string().max(2000).optional(),
|
|
9
|
-
framework: z.string().optional(),
|
|
10
|
-
frameworkVersion: z.string().optional(),
|
|
11
|
-
modelProvider: z.string().optional(),
|
|
12
|
-
modelName: z.string().optional(),
|
|
13
|
-
walletAddress: z.string().regex(/^0x[a-fA-F0-9]{40}$/, 'Invalid Ethereum address'),
|
|
14
|
-
agentCardUrl: z.string().url().optional(),
|
|
15
|
-
skills: z.array(z.object({
|
|
16
|
-
skillId: z.string().min(1),
|
|
17
|
-
skillName: z.string().min(1),
|
|
18
|
-
description: z.string().min(1),
|
|
19
|
-
category: z.string().min(1),
|
|
20
|
-
tags: z.array(z.string()).default([]),
|
|
21
|
-
pricingModel: z.enum([
|
|
22
|
-
PRICING_MODEL.PER_TASK,
|
|
23
|
-
PRICING_MODEL.PER_HOUR,
|
|
24
|
-
PRICING_MODEL.PER_TOKEN,
|
|
25
|
-
PRICING_MODEL.PER_REQUEST,
|
|
26
|
-
PRICING_MODEL.CUSTOM,
|
|
27
|
-
]).default(PRICING_MODEL.PER_TASK),
|
|
28
|
-
basePrice: z.string().min(1), // USDC amount as string (6 decimals)
|
|
29
|
-
examplePrompts: z.array(z.string()).default([]),
|
|
30
|
-
})).default([]),
|
|
31
|
-
});
|
|
32
|
-
|
|
33
|
-
export const AgentVerifySchema = z.object({
|
|
34
|
-
publicKey: z.string().min(1),
|
|
35
|
-
challenge: z.string().min(1),
|
|
36
|
-
signature: z.string().min(1),
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
export const AgentLoginChallengeSchema = z.object({
|
|
40
|
-
publicKey: z.string().min(1),
|
|
41
|
-
});
|
|
42
|
-
|
|
43
|
-
export const AgentUpdateSchema = z.object({
|
|
44
|
-
displayName: z.string().min(1).max(200).optional(),
|
|
45
|
-
description: z.string().max(2000).optional(),
|
|
46
|
-
framework: z.string().optional(),
|
|
47
|
-
frameworkVersion: z.string().optional(),
|
|
48
|
-
modelProvider: z.string().optional(),
|
|
49
|
-
modelName: z.string().optional(),
|
|
50
|
-
agentCardUrl: z.string().url().optional(),
|
|
51
|
-
dailySpendingLimit: z.string().optional(),
|
|
52
|
-
});
|
|
53
|
-
|
|
54
|
-
// Tasks
|
|
55
|
-
export const TaskCreateSchema = z.object({
|
|
56
|
-
title: z.string().min(1).max(500),
|
|
57
|
-
description: z.string().min(1).max(10000),
|
|
58
|
-
skillRequirements: z.array(z.string().min(1)).min(1),
|
|
59
|
-
inputData: z.unknown().optional(),
|
|
60
|
-
matchingMode: z.enum([
|
|
61
|
-
MATCHING_MODE.DIRECT,
|
|
62
|
-
MATCHING_MODE.OPEN,
|
|
63
|
-
MATCHING_MODE.AUTO,
|
|
64
|
-
]).default(MATCHING_MODE.OPEN),
|
|
65
|
-
budgetMin: z.string().optional(),
|
|
66
|
-
budgetMax: z.string().min(1),
|
|
67
|
-
deadline: z.string().datetime().optional(),
|
|
68
|
-
directAssigneeId: z.string().uuid().optional(), // for direct matching
|
|
69
|
-
});
|
|
70
|
-
|
|
71
|
-
export const TaskUpdateSchema = z.object({
|
|
72
|
-
title: z.string().min(1).max(500).optional(),
|
|
73
|
-
description: z.string().min(1).max(10000).optional(),
|
|
74
|
-
deadline: z.string().datetime().optional(),
|
|
75
|
-
});
|
|
76
|
-
|
|
77
|
-
export const TaskSubmitSchema = z.object({
|
|
78
|
-
artifacts: z.array(z.object({
|
|
79
|
-
type: z.string(),
|
|
80
|
-
content: z.unknown(),
|
|
81
|
-
})).min(1),
|
|
82
|
-
files: z.array(z.string().url()).default([]),
|
|
83
|
-
notes: z.string().max(5000).optional(),
|
|
84
|
-
});
|
|
85
|
-
|
|
86
|
-
export const TaskListQuerySchema = z.object({
|
|
87
|
-
q: z.string().optional(),
|
|
88
|
-
status: z.string().optional(),
|
|
89
|
-
skills: z.string().optional(), // comma-separated
|
|
90
|
-
budgetMin: z.string().optional(),
|
|
91
|
-
budgetMax: z.string().optional(),
|
|
92
|
-
requesterId: z.string().uuid().optional(),
|
|
93
|
-
assigneeId: z.string().uuid().optional(),
|
|
94
|
-
limit: z.coerce.number().min(1).max(100).default(20),
|
|
95
|
-
offset: z.coerce.number().min(0).default(0),
|
|
96
|
-
});
|
|
97
|
-
|
|
98
|
-
export const AgentListQuerySchema = z.object({
|
|
99
|
-
q: z.string().optional(),
|
|
100
|
-
skills: z.string().optional(), // comma-separated
|
|
101
|
-
limit: z.coerce.number().min(1).max(100).default(20),
|
|
102
|
-
offset: z.coerce.number().min(0).default(0),
|
|
103
|
-
});
|
|
104
|
-
|
|
105
|
-
// Bids
|
|
106
|
-
export const BidCreateSchema = z.object({
|
|
107
|
-
proposedPrice: z.string().min(1),
|
|
108
|
-
confidenceScore: z.number().min(0).max(1).optional(),
|
|
109
|
-
estimatedDuration: z.string().optional(), // ISO 8601 duration
|
|
110
|
-
proposal: z.string().max(5000).optional(),
|
|
111
|
-
portfolioRefs: z.array(z.string().url()).default([]),
|
|
112
|
-
});
|
|
113
|
-
|
|
114
|
-
// Ratings
|
|
115
|
-
export const RatingCreateSchema = z.object({
|
|
116
|
-
taskId: z.string().uuid(),
|
|
117
|
-
rateeId: z.string().uuid(),
|
|
118
|
-
qualityScore: z.number().int().min(1).max(5),
|
|
119
|
-
speedScore: z.number().int().min(1).max(5).optional(),
|
|
120
|
-
communicationScore: z.number().int().min(1).max(5).optional(),
|
|
121
|
-
reliabilityScore: z.number().int().min(1).max(5).optional(),
|
|
122
|
-
comment: z.string().max(2000).optional(),
|
|
123
|
-
});
|
|
124
|
-
|
|
125
|
-
export type AgentRegisterInput = z.infer<typeof AgentRegisterSchema>;
|
|
126
|
-
export type AgentVerifyInput = z.infer<typeof AgentVerifySchema>;
|
|
127
|
-
export type AgentLoginChallengeInput = z.infer<typeof AgentLoginChallengeSchema>;
|
|
128
|
-
export type AgentUpdateInput = z.infer<typeof AgentUpdateSchema>;
|
|
129
|
-
export type TaskCreateInput = z.infer<typeof TaskCreateSchema>;
|
|
130
|
-
export type TaskUpdateInput = z.infer<typeof TaskUpdateSchema>;
|
|
131
|
-
export type TaskSubmitInput = z.infer<typeof TaskSubmitSchema>;
|
|
132
|
-
export type TaskListQuery = z.infer<typeof TaskListQuerySchema>;
|
|
133
|
-
export type AgentListQuery = z.infer<typeof AgentListQuerySchema>;
|
|
134
|
-
export type BidCreateInput = z.infer<typeof BidCreateSchema>;
|
|
135
|
-
export type RatingCreateInput = z.infer<typeof RatingCreateSchema>;
|
package/src/types.ts
DELETED
|
@@ -1,141 +0,0 @@
|
|
|
1
|
-
import type { Scope } from './constants.js';
|
|
2
|
-
|
|
3
|
-
export interface Agent {
|
|
4
|
-
id: string;
|
|
5
|
-
did: string;
|
|
6
|
-
publicKey: string; // base64 encoded
|
|
7
|
-
displayName: string;
|
|
8
|
-
description: string | null;
|
|
9
|
-
framework: string | null;
|
|
10
|
-
frameworkVersion: string | null;
|
|
11
|
-
modelProvider: string | null;
|
|
12
|
-
modelName: string | null;
|
|
13
|
-
walletAddress: string;
|
|
14
|
-
trustLevel: number;
|
|
15
|
-
dailySpendingLimit: string | null;
|
|
16
|
-
agentCardUrl: string | null;
|
|
17
|
-
status: string;
|
|
18
|
-
lastHeartbeat: string | null;
|
|
19
|
-
createdAt: string;
|
|
20
|
-
updatedAt: string;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export interface AgentSkill {
|
|
24
|
-
id: string;
|
|
25
|
-
agentId: string;
|
|
26
|
-
skillId: string;
|
|
27
|
-
skillName: string;
|
|
28
|
-
description: string;
|
|
29
|
-
category: string;
|
|
30
|
-
tags: string[];
|
|
31
|
-
pricingModel: string;
|
|
32
|
-
basePrice: string;
|
|
33
|
-
currency: string;
|
|
34
|
-
examplePrompts: string[];
|
|
35
|
-
tasksCompleted: number;
|
|
36
|
-
avgQualityScore: number | null;
|
|
37
|
-
createdAt: string;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
export interface Task {
|
|
41
|
-
id: string;
|
|
42
|
-
requesterId: string;
|
|
43
|
-
assigneeId: string | null;
|
|
44
|
-
title: string;
|
|
45
|
-
description: string;
|
|
46
|
-
skillRequirements: string[];
|
|
47
|
-
inputData: unknown;
|
|
48
|
-
matchingMode: string;
|
|
49
|
-
budgetMin: string | null;
|
|
50
|
-
budgetMax: string;
|
|
51
|
-
currency: string;
|
|
52
|
-
finalPrice: string | null;
|
|
53
|
-
status: string;
|
|
54
|
-
deadline: string | null;
|
|
55
|
-
startedAt: string | null;
|
|
56
|
-
submittedAt: string | null;
|
|
57
|
-
completedAt: string | null;
|
|
58
|
-
resultArtifacts: unknown;
|
|
59
|
-
resultFiles: string[] | null;
|
|
60
|
-
qualityScore: number | null;
|
|
61
|
-
createdAt: string;
|
|
62
|
-
updatedAt: string;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
export interface TaskBid {
|
|
66
|
-
id: string;
|
|
67
|
-
taskId: string;
|
|
68
|
-
bidderId: string;
|
|
69
|
-
proposedPrice: string;
|
|
70
|
-
confidenceScore: number | null;
|
|
71
|
-
estimatedDuration: string | null;
|
|
72
|
-
proposal: string | null;
|
|
73
|
-
portfolioRefs: string[] | null;
|
|
74
|
-
status: string;
|
|
75
|
-
createdAt: string;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
export interface EscrowTransaction {
|
|
79
|
-
id: string;
|
|
80
|
-
taskId: string;
|
|
81
|
-
payerId: string;
|
|
82
|
-
payeeId: string | null;
|
|
83
|
-
amount: string;
|
|
84
|
-
platformFee: string | null;
|
|
85
|
-
status: string;
|
|
86
|
-
escrowTxHash: string | null;
|
|
87
|
-
releaseTxHash: string | null;
|
|
88
|
-
network: string;
|
|
89
|
-
createdAt: string;
|
|
90
|
-
updatedAt: string;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
export interface AgentRating {
|
|
94
|
-
id: string;
|
|
95
|
-
taskId: string;
|
|
96
|
-
raterId: string;
|
|
97
|
-
rateeId: string;
|
|
98
|
-
qualityScore: number;
|
|
99
|
-
speedScore: number | null;
|
|
100
|
-
communicationScore: number | null;
|
|
101
|
-
reliabilityScore: number | null;
|
|
102
|
-
comment: string | null;
|
|
103
|
-
createdAt: string;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
export interface AATPayload {
|
|
107
|
-
sub: string; // DID
|
|
108
|
-
agent_id: string;
|
|
109
|
-
trust_level: number;
|
|
110
|
-
scopes: Scope[];
|
|
111
|
-
iat: number;
|
|
112
|
-
exp: number;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
export interface AgentCard {
|
|
116
|
-
name: string;
|
|
117
|
-
description: string;
|
|
118
|
-
url: string;
|
|
119
|
-
version: string;
|
|
120
|
-
skills: AgentCardSkill[];
|
|
121
|
-
authentication?: {
|
|
122
|
-
schemes: string[];
|
|
123
|
-
credentials?: string;
|
|
124
|
-
};
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
export interface AgentCardSkill {
|
|
128
|
-
id: string;
|
|
129
|
-
name: string;
|
|
130
|
-
description: string;
|
|
131
|
-
tags?: string[];
|
|
132
|
-
examples?: string[];
|
|
133
|
-
inputModes?: string[];
|
|
134
|
-
outputModes?: string[];
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
export interface SSEEvent {
|
|
138
|
-
type: string;
|
|
139
|
-
data: unknown;
|
|
140
|
-
timestamp: string;
|
|
141
|
-
}
|