@swarmdock/shared 0.1.1 → 0.2.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/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 +94 -0
- package/dist/schemas.d.ts.map +1 -1
- package/dist/schemas.js +45 -6
- 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 +1 -1
- package/src/constants.ts +52 -5
- package/src/schemas.ts +61 -6
- package/src/types.ts +119 -1
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/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,oBAAoB,IAAI,CAAC;AACtC,eAAO,MAAM,aAAa,IAAI,CAAC;AAC/B,eAAO,MAAM,gBAAgB,KAAK,CAAC;AACnC,eAAO,MAAM,qBAAqB,MAAM,CAAC;AAEzC,eAAO,MAAM,YAAY
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,oBAAoB,IAAI,CAAC;AACtC,eAAO,MAAM,aAAa,IAAI,CAAC;AAC/B,eAAO,MAAM,gBAAgB,KAAK,CAAC;AACnC,eAAO,MAAM,qBAAqB,MAAM,CAAC;AAEzC,eAAO,MAAM,YAAY;;;;;;;CAOf,CAAC;AAEX,eAAO,MAAM,WAAW;;;;;;;;;;;CAWd,CAAC;AAEX,eAAO,MAAM,UAAU;;;;;CAKb,CAAC;AAEX,eAAO,MAAM,aAAa;;;;;;CAMhB,CAAC;AAEX,eAAO,MAAM,cAAc;;;;;CAKjB,CAAC;AAEX,eAAO,MAAM,kBAAkB;;;;CAIrB,CAAC;AAEX,eAAO,MAAM,eAAe;;;;CAIlB,CAAC;AAEX,eAAO,MAAM,gBAAgB;;;;;;;CAOnB,CAAC;AAEX,eAAO,MAAM,kBAAkB;;;;CAIrB,CAAC;AAEX,eAAO,MAAM,qBAAqB,wEAMxB,CAAC;AAEX,MAAM,MAAM,mBAAmB,GAAG,CAAC,OAAO,qBAAqB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEzE,eAAO,MAAM,YAAY;;;;;;CAMf,CAAC;AAEX,eAAO,MAAM,aAAa;;;;CAIhB,CAAC;AAEX,eAAO,MAAM,aAAa;;;;;;CAMhB,CAAC;AAEX,eAAO,MAAM,MAAM,2GAOT,CAAC;AAEX,MAAM,MAAM,KAAK,GAAG,CAAC,OAAO,MAAM,CAAC,CAAC,MAAM,CAAC,CAAC"}
|
package/dist/constants.js
CHANGED
|
@@ -7,6 +7,8 @@ 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,CAAC,CAAC;AACtC,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,CAAC;AAC/B,MAAM,CAAC,MAAM,gBAAgB,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z.ZodString;
|
|
4
4
|
displayName: z.ZodString;
|
|
5
5
|
description: z.ZodOptional<z.ZodString>;
|
|
6
|
+
avatarUrl: z.ZodOptional<z.ZodString>;
|
|
7
|
+
ownerDid: z.ZodOptional<z.ZodString>;
|
|
6
8
|
framework: z.ZodOptional<z.ZodString>;
|
|
7
9
|
frameworkVersion: z.ZodOptional<z.ZodString>;
|
|
8
10
|
modelProvider: z.ZodOptional<z.ZodString>;
|
|
@@ -15,18 +17,26 @@ export declare const AgentRegisterSchema: z.ZodObject<{
|
|
|
15
17
|
description: z.ZodString;
|
|
16
18
|
category: z.ZodString;
|
|
17
19
|
tags: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
20
|
+
inputModes: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
21
|
+
outputModes: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
18
22
|
pricingModel: z.ZodDefault<z.ZodEnum<["per-task", "per-hour", "per-token", "per-request", "custom"]>>;
|
|
19
23
|
basePrice: z.ZodString;
|
|
20
24
|
examplePrompts: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
25
|
+
benchmarkScores: z.ZodOptional<z.ZodUnknown>;
|
|
26
|
+
sampleOutputs: z.ZodOptional<z.ZodUnknown>;
|
|
21
27
|
}, "strip", z.ZodTypeAny, {
|
|
22
28
|
description: string;
|
|
23
29
|
skillId: string;
|
|
24
30
|
skillName: string;
|
|
25
31
|
category: string;
|
|
26
32
|
tags: string[];
|
|
33
|
+
inputModes: string[];
|
|
34
|
+
outputModes: string[];
|
|
27
35
|
pricingModel: "per-task" | "per-hour" | "per-token" | "per-request" | "custom";
|
|
28
36
|
basePrice: string;
|
|
29
37
|
examplePrompts: string[];
|
|
38
|
+
benchmarkScores?: unknown;
|
|
39
|
+
sampleOutputs?: unknown;
|
|
30
40
|
}, {
|
|
31
41
|
description: string;
|
|
32
42
|
skillId: string;
|
|
@@ -34,8 +44,12 @@ export declare const AgentRegisterSchema: z.ZodObject<{
|
|
|
34
44
|
category: string;
|
|
35
45
|
basePrice: string;
|
|
36
46
|
tags?: string[] | undefined;
|
|
47
|
+
inputModes?: string[] | undefined;
|
|
48
|
+
outputModes?: string[] | undefined;
|
|
37
49
|
pricingModel?: "per-task" | "per-hour" | "per-token" | "per-request" | "custom" | undefined;
|
|
38
50
|
examplePrompts?: string[] | undefined;
|
|
51
|
+
benchmarkScores?: unknown;
|
|
52
|
+
sampleOutputs?: unknown;
|
|
39
53
|
}>, "many">>;
|
|
40
54
|
}, "strip", z.ZodTypeAny, {
|
|
41
55
|
publicKey: string;
|
|
@@ -47,11 +61,17 @@ export declare const AgentRegisterSchema: z.ZodObject<{
|
|
|
47
61
|
skillName: string;
|
|
48
62
|
category: string;
|
|
49
63
|
tags: string[];
|
|
64
|
+
inputModes: string[];
|
|
65
|
+
outputModes: string[];
|
|
50
66
|
pricingModel: "per-task" | "per-hour" | "per-token" | "per-request" | "custom";
|
|
51
67
|
basePrice: string;
|
|
52
68
|
examplePrompts: string[];
|
|
69
|
+
benchmarkScores?: unknown;
|
|
70
|
+
sampleOutputs?: unknown;
|
|
53
71
|
}[];
|
|
54
72
|
description?: string | undefined;
|
|
73
|
+
avatarUrl?: string | undefined;
|
|
74
|
+
ownerDid?: string | undefined;
|
|
55
75
|
framework?: string | undefined;
|
|
56
76
|
frameworkVersion?: string | undefined;
|
|
57
77
|
modelProvider?: string | undefined;
|
|
@@ -62,6 +82,8 @@ export declare const AgentRegisterSchema: z.ZodObject<{
|
|
|
62
82
|
displayName: string;
|
|
63
83
|
walletAddress: string;
|
|
64
84
|
description?: string | undefined;
|
|
85
|
+
avatarUrl?: string | undefined;
|
|
86
|
+
ownerDid?: string | undefined;
|
|
65
87
|
framework?: string | undefined;
|
|
66
88
|
frameworkVersion?: string | undefined;
|
|
67
89
|
modelProvider?: string | undefined;
|
|
@@ -74,8 +96,12 @@ export declare const AgentRegisterSchema: z.ZodObject<{
|
|
|
74
96
|
category: string;
|
|
75
97
|
basePrice: string;
|
|
76
98
|
tags?: string[] | undefined;
|
|
99
|
+
inputModes?: string[] | undefined;
|
|
100
|
+
outputModes?: string[] | undefined;
|
|
77
101
|
pricingModel?: "per-task" | "per-hour" | "per-token" | "per-request" | "custom" | undefined;
|
|
78
102
|
examplePrompts?: string[] | undefined;
|
|
103
|
+
benchmarkScores?: unknown;
|
|
104
|
+
sampleOutputs?: unknown;
|
|
79
105
|
}[] | undefined;
|
|
80
106
|
}>;
|
|
81
107
|
export declare const AgentVerifySchema: z.ZodObject<{
|
|
@@ -101,6 +127,8 @@ export declare const AgentLoginChallengeSchema: z.ZodObject<{
|
|
|
101
127
|
export declare const AgentUpdateSchema: z.ZodObject<{
|
|
102
128
|
displayName: z.ZodOptional<z.ZodString>;
|
|
103
129
|
description: z.ZodOptional<z.ZodString>;
|
|
130
|
+
avatarUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
131
|
+
ownerDid: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
104
132
|
framework: z.ZodOptional<z.ZodString>;
|
|
105
133
|
frameworkVersion: z.ZodOptional<z.ZodString>;
|
|
106
134
|
modelProvider: z.ZodOptional<z.ZodString>;
|
|
@@ -110,6 +138,8 @@ export declare const AgentUpdateSchema: z.ZodObject<{
|
|
|
110
138
|
}, "strip", z.ZodTypeAny, {
|
|
111
139
|
displayName?: string | undefined;
|
|
112
140
|
description?: string | undefined;
|
|
141
|
+
avatarUrl?: string | null | undefined;
|
|
142
|
+
ownerDid?: string | null | undefined;
|
|
113
143
|
framework?: string | undefined;
|
|
114
144
|
frameworkVersion?: string | undefined;
|
|
115
145
|
modelProvider?: string | undefined;
|
|
@@ -119,6 +149,8 @@ export declare const AgentUpdateSchema: z.ZodObject<{
|
|
|
119
149
|
}, {
|
|
120
150
|
displayName?: string | undefined;
|
|
121
151
|
description?: string | undefined;
|
|
152
|
+
avatarUrl?: string | null | undefined;
|
|
153
|
+
ownerDid?: string | null | undefined;
|
|
122
154
|
framework?: string | undefined;
|
|
123
155
|
frameworkVersion?: string | undefined;
|
|
124
156
|
modelProvider?: string | undefined;
|
|
@@ -131,6 +163,7 @@ export declare const TaskCreateSchema: z.ZodObject<{
|
|
|
131
163
|
description: z.ZodString;
|
|
132
164
|
skillRequirements: z.ZodArray<z.ZodString, "many">;
|
|
133
165
|
inputData: z.ZodOptional<z.ZodUnknown>;
|
|
166
|
+
inputFiles: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
134
167
|
matchingMode: z.ZodDefault<z.ZodEnum<["direct", "open", "auto"]>>;
|
|
135
168
|
budgetMin: z.ZodOptional<z.ZodString>;
|
|
136
169
|
budgetMax: z.ZodString;
|
|
@@ -140,6 +173,7 @@ export declare const TaskCreateSchema: z.ZodObject<{
|
|
|
140
173
|
description: string;
|
|
141
174
|
title: string;
|
|
142
175
|
skillRequirements: string[];
|
|
176
|
+
inputFiles: string[];
|
|
143
177
|
matchingMode: "open" | "direct" | "auto";
|
|
144
178
|
budgetMax: string;
|
|
145
179
|
inputData?: unknown;
|
|
@@ -152,6 +186,7 @@ export declare const TaskCreateSchema: z.ZodObject<{
|
|
|
152
186
|
skillRequirements: string[];
|
|
153
187
|
budgetMax: string;
|
|
154
188
|
inputData?: unknown;
|
|
189
|
+
inputFiles?: string[] | undefined;
|
|
155
190
|
matchingMode?: "open" | "direct" | "auto" | undefined;
|
|
156
191
|
budgetMin?: string | undefined;
|
|
157
192
|
deadline?: string | undefined;
|
|
@@ -198,6 +233,39 @@ export declare const TaskSubmitSchema: z.ZodObject<{
|
|
|
198
233
|
files?: string[] | undefined;
|
|
199
234
|
notes?: string | undefined;
|
|
200
235
|
}>;
|
|
236
|
+
export declare const TaskDisputeSchema: z.ZodObject<{
|
|
237
|
+
reason: z.ZodString;
|
|
238
|
+
evidence: z.ZodOptional<z.ZodUnknown>;
|
|
239
|
+
}, "strip", z.ZodTypeAny, {
|
|
240
|
+
reason: string;
|
|
241
|
+
evidence?: unknown;
|
|
242
|
+
}, {
|
|
243
|
+
reason: string;
|
|
244
|
+
evidence?: unknown;
|
|
245
|
+
}>;
|
|
246
|
+
export declare const DisputeResolveSchema: z.ZodObject<{
|
|
247
|
+
resolution: z.ZodEnum<["release", "refund", "split"]>;
|
|
248
|
+
notes: z.ZodOptional<z.ZodString>;
|
|
249
|
+
splitPercent: z.ZodOptional<z.ZodNumber>;
|
|
250
|
+
}, "strip", z.ZodTypeAny, {
|
|
251
|
+
resolution: "release" | "refund" | "split";
|
|
252
|
+
notes?: string | undefined;
|
|
253
|
+
splitPercent?: number | undefined;
|
|
254
|
+
}, {
|
|
255
|
+
resolution: "release" | "refund" | "split";
|
|
256
|
+
notes?: string | undefined;
|
|
257
|
+
splitPercent?: number | undefined;
|
|
258
|
+
}>;
|
|
259
|
+
export declare const TribunalVoteSchema: z.ZodObject<{
|
|
260
|
+
verdict: z.ZodEnum<["requester_wins", "assignee_wins", "split"]>;
|
|
261
|
+
notes: z.ZodOptional<z.ZodString>;
|
|
262
|
+
}, "strip", z.ZodTypeAny, {
|
|
263
|
+
verdict: "split" | "requester_wins" | "assignee_wins";
|
|
264
|
+
notes?: string | undefined;
|
|
265
|
+
}, {
|
|
266
|
+
verdict: "split" | "requester_wins" | "assignee_wins";
|
|
267
|
+
notes?: string | undefined;
|
|
268
|
+
}>;
|
|
201
269
|
export declare const TaskListQuerySchema: z.ZodObject<{
|
|
202
270
|
q: z.ZodOptional<z.ZodString>;
|
|
203
271
|
status: z.ZodOptional<z.ZodString>;
|
|
@@ -232,18 +300,24 @@ export declare const TaskListQuerySchema: z.ZodObject<{
|
|
|
232
300
|
export declare const AgentListQuerySchema: z.ZodObject<{
|
|
233
301
|
q: z.ZodOptional<z.ZodString>;
|
|
234
302
|
skills: z.ZodOptional<z.ZodString>;
|
|
303
|
+
framework: z.ZodOptional<z.ZodString>;
|
|
304
|
+
minTrustLevel: z.ZodOptional<z.ZodNumber>;
|
|
235
305
|
limit: z.ZodDefault<z.ZodNumber>;
|
|
236
306
|
offset: z.ZodDefault<z.ZodNumber>;
|
|
237
307
|
}, "strip", z.ZodTypeAny, {
|
|
238
308
|
limit: number;
|
|
239
309
|
offset: number;
|
|
310
|
+
framework?: string | undefined;
|
|
240
311
|
skills?: string | undefined;
|
|
241
312
|
q?: string | undefined;
|
|
313
|
+
minTrustLevel?: number | undefined;
|
|
242
314
|
}, {
|
|
315
|
+
framework?: string | undefined;
|
|
243
316
|
skills?: string | undefined;
|
|
244
317
|
q?: string | undefined;
|
|
245
318
|
limit?: number | undefined;
|
|
246
319
|
offset?: number | undefined;
|
|
320
|
+
minTrustLevel?: number | undefined;
|
|
247
321
|
}>;
|
|
248
322
|
export declare const BidCreateSchema: z.ZodObject<{
|
|
249
323
|
proposedPrice: z.ZodString;
|
|
@@ -271,24 +345,40 @@ export declare const RatingCreateSchema: z.ZodObject<{
|
|
|
271
345
|
speedScore: z.ZodOptional<z.ZodNumber>;
|
|
272
346
|
communicationScore: z.ZodOptional<z.ZodNumber>;
|
|
273
347
|
reliabilityScore: z.ZodOptional<z.ZodNumber>;
|
|
348
|
+
valueScore: z.ZodOptional<z.ZodNumber>;
|
|
349
|
+
evidence: z.ZodOptional<z.ZodUnknown>;
|
|
274
350
|
comment: z.ZodOptional<z.ZodString>;
|
|
275
351
|
}, "strip", z.ZodTypeAny, {
|
|
276
352
|
taskId: string;
|
|
277
353
|
rateeId: string;
|
|
278
354
|
qualityScore: number;
|
|
355
|
+
evidence?: unknown;
|
|
279
356
|
speedScore?: number | undefined;
|
|
280
357
|
communicationScore?: number | undefined;
|
|
281
358
|
reliabilityScore?: number | undefined;
|
|
359
|
+
valueScore?: number | undefined;
|
|
282
360
|
comment?: string | undefined;
|
|
283
361
|
}, {
|
|
284
362
|
taskId: string;
|
|
285
363
|
rateeId: string;
|
|
286
364
|
qualityScore: number;
|
|
365
|
+
evidence?: unknown;
|
|
287
366
|
speedScore?: number | undefined;
|
|
288
367
|
communicationScore?: number | undefined;
|
|
289
368
|
reliabilityScore?: number | undefined;
|
|
369
|
+
valueScore?: number | undefined;
|
|
290
370
|
comment?: string | undefined;
|
|
291
371
|
}>;
|
|
372
|
+
export declare const PortfolioItemUpdateSchema: z.ZodObject<{
|
|
373
|
+
isPinned: z.ZodOptional<z.ZodBoolean>;
|
|
374
|
+
displayOrder: z.ZodOptional<z.ZodNumber>;
|
|
375
|
+
}, "strip", z.ZodTypeAny, {
|
|
376
|
+
isPinned?: boolean | undefined;
|
|
377
|
+
displayOrder?: number | undefined;
|
|
378
|
+
}, {
|
|
379
|
+
isPinned?: boolean | undefined;
|
|
380
|
+
displayOrder?: number | undefined;
|
|
381
|
+
}>;
|
|
292
382
|
export type AgentRegisterInput = z.infer<typeof AgentRegisterSchema>;
|
|
293
383
|
export type AgentVerifyInput = z.infer<typeof AgentVerifySchema>;
|
|
294
384
|
export type AgentLoginChallengeInput = z.infer<typeof AgentLoginChallengeSchema>;
|
|
@@ -296,8 +386,12 @@ export type AgentUpdateInput = z.infer<typeof AgentUpdateSchema>;
|
|
|
296
386
|
export type TaskCreateInput = z.infer<typeof TaskCreateSchema>;
|
|
297
387
|
export type TaskUpdateInput = z.infer<typeof TaskUpdateSchema>;
|
|
298
388
|
export type TaskSubmitInput = z.infer<typeof TaskSubmitSchema>;
|
|
389
|
+
export type TaskDisputeInput = z.infer<typeof TaskDisputeSchema>;
|
|
390
|
+
export type DisputeResolveInput = z.infer<typeof DisputeResolveSchema>;
|
|
391
|
+
export type TribunalVoteInput = z.infer<typeof TribunalVoteSchema>;
|
|
299
392
|
export type TaskListQuery = z.infer<typeof TaskListQuerySchema>;
|
|
300
393
|
export type AgentListQuery = z.infer<typeof AgentListQuerySchema>;
|
|
301
394
|
export type BidCreateInput = z.infer<typeof BidCreateSchema>;
|
|
302
395
|
export type RatingCreateInput = z.infer<typeof RatingCreateSchema>;
|
|
396
|
+
export type PortfolioItemUpdateInput = z.infer<typeof PortfolioItemUpdateSchema>;
|
|
303
397
|
//# 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,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAU9B,CAAC;AAEH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;EAO/B,CAAC;AAGH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;EAM1B,CAAC;AAGH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;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M,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC"}
|
package/dist/schemas.js
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
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
3
|
// Agent registration
|
|
4
4
|
export const AgentRegisterSchema = z.object({
|
|
5
5
|
publicKey: z.string().min(1, 'Public key is required'),
|
|
6
6
|
displayName: z.string().min(1).max(200),
|
|
7
7
|
description: z.string().max(2000).optional(),
|
|
8
|
+
avatarUrl: z.string().url().optional(),
|
|
9
|
+
ownerDid: z.string().optional(),
|
|
8
10
|
framework: z.string().optional(),
|
|
9
11
|
frameworkVersion: z.string().optional(),
|
|
10
12
|
modelProvider: z.string().optional(),
|
|
@@ -17,6 +19,8 @@ export const AgentRegisterSchema = z.object({
|
|
|
17
19
|
description: z.string().min(1),
|
|
18
20
|
category: z.string().min(1),
|
|
19
21
|
tags: z.array(z.string()).default([]),
|
|
22
|
+
inputModes: z.array(z.string()).default(['text']),
|
|
23
|
+
outputModes: z.array(z.string()).default(['text']),
|
|
20
24
|
pricingModel: z.enum([
|
|
21
25
|
PRICING_MODEL.PER_TASK,
|
|
22
26
|
PRICING_MODEL.PER_HOUR,
|
|
@@ -26,6 +30,8 @@ export const AgentRegisterSchema = z.object({
|
|
|
26
30
|
]).default(PRICING_MODEL.PER_TASK),
|
|
27
31
|
basePrice: z.string().min(1), // USDC amount as string (6 decimals)
|
|
28
32
|
examplePrompts: z.array(z.string()).default([]),
|
|
33
|
+
benchmarkScores: z.unknown().optional(),
|
|
34
|
+
sampleOutputs: z.unknown().optional(),
|
|
29
35
|
})).default([]),
|
|
30
36
|
});
|
|
31
37
|
export const AgentVerifySchema = z.object({
|
|
@@ -39,6 +45,8 @@ export const AgentLoginChallengeSchema = z.object({
|
|
|
39
45
|
export const AgentUpdateSchema = z.object({
|
|
40
46
|
displayName: z.string().min(1).max(200).optional(),
|
|
41
47
|
description: z.string().max(2000).optional(),
|
|
48
|
+
avatarUrl: z.string().url().nullable().optional(),
|
|
49
|
+
ownerDid: z.string().nullable().optional(),
|
|
42
50
|
framework: z.string().optional(),
|
|
43
51
|
frameworkVersion: z.string().optional(),
|
|
44
52
|
modelProvider: z.string().optional(),
|
|
@@ -52,6 +60,7 @@ export const TaskCreateSchema = z.object({
|
|
|
52
60
|
description: z.string().min(1).max(10000),
|
|
53
61
|
skillRequirements: z.array(z.string().min(1)).min(1),
|
|
54
62
|
inputData: z.unknown().optional(),
|
|
63
|
+
inputFiles: z.array(z.string().url()).default([]),
|
|
55
64
|
matchingMode: z.enum([
|
|
56
65
|
MATCHING_MODE.DIRECT,
|
|
57
66
|
MATCHING_MODE.OPEN,
|
|
@@ -75,6 +84,27 @@ export const TaskSubmitSchema = z.object({
|
|
|
75
84
|
files: z.array(z.string().url()).default([]),
|
|
76
85
|
notes: z.string().max(5000).optional(),
|
|
77
86
|
});
|
|
87
|
+
export const TaskDisputeSchema = z.object({
|
|
88
|
+
reason: z.string().min(1).max(5000),
|
|
89
|
+
evidence: z.unknown().optional(),
|
|
90
|
+
});
|
|
91
|
+
export const DisputeResolveSchema = z.object({
|
|
92
|
+
resolution: z.enum([
|
|
93
|
+
DISPUTE_RESOLUTION.RELEASE,
|
|
94
|
+
DISPUTE_RESOLUTION.REFUND,
|
|
95
|
+
DISPUTE_RESOLUTION.SPLIT,
|
|
96
|
+
]),
|
|
97
|
+
notes: z.string().max(5000).optional(),
|
|
98
|
+
splitPercent: z.number().min(0).max(100).optional(), // assignee's share when split
|
|
99
|
+
});
|
|
100
|
+
export const TribunalVoteSchema = z.object({
|
|
101
|
+
verdict: z.enum([
|
|
102
|
+
DISPUTE_VERDICT.REQUESTER_WINS,
|
|
103
|
+
DISPUTE_VERDICT.ASSIGNEE_WINS,
|
|
104
|
+
DISPUTE_VERDICT.SPLIT,
|
|
105
|
+
]),
|
|
106
|
+
notes: z.string().max(5000).optional(),
|
|
107
|
+
});
|
|
78
108
|
export const TaskListQuerySchema = z.object({
|
|
79
109
|
q: z.string().optional(),
|
|
80
110
|
status: z.string().optional(),
|
|
@@ -89,6 +119,8 @@ export const TaskListQuerySchema = z.object({
|
|
|
89
119
|
export const AgentListQuerySchema = z.object({
|
|
90
120
|
q: z.string().optional(),
|
|
91
121
|
skills: z.string().optional(), // comma-separated
|
|
122
|
+
framework: z.string().optional(),
|
|
123
|
+
minTrustLevel: z.coerce.number().min(0).max(4).optional(),
|
|
92
124
|
limit: z.coerce.number().min(1).max(100).default(20),
|
|
93
125
|
offset: z.coerce.number().min(0).default(0),
|
|
94
126
|
});
|
|
@@ -100,14 +132,21 @@ export const BidCreateSchema = z.object({
|
|
|
100
132
|
proposal: z.string().max(5000).optional(),
|
|
101
133
|
portfolioRefs: z.array(z.string().url()).default([]),
|
|
102
134
|
});
|
|
103
|
-
// Ratings
|
|
135
|
+
// Ratings (float 0-1 scale)
|
|
104
136
|
export const RatingCreateSchema = z.object({
|
|
105
137
|
taskId: z.string().uuid(),
|
|
106
138
|
rateeId: z.string().uuid(),
|
|
107
|
-
qualityScore: z.number().
|
|
108
|
-
speedScore: z.number().
|
|
109
|
-
communicationScore: z.number().
|
|
110
|
-
reliabilityScore: z.number().
|
|
139
|
+
qualityScore: z.number().min(0).max(1),
|
|
140
|
+
speedScore: z.number().min(0).max(1).optional(),
|
|
141
|
+
communicationScore: z.number().min(0).max(1).optional(),
|
|
142
|
+
reliabilityScore: z.number().min(0).max(1).optional(),
|
|
143
|
+
valueScore: z.number().min(0).max(1).optional(),
|
|
144
|
+
evidence: z.unknown().optional(),
|
|
111
145
|
comment: z.string().max(2000).optional(),
|
|
112
146
|
});
|
|
147
|
+
// Portfolio
|
|
148
|
+
export const PortfolioItemUpdateSchema = z.object({
|
|
149
|
+
isPinned: z.boolean().optional(),
|
|
150
|
+
displayOrder: z.number().int().min(0).optional(),
|
|
151
|
+
});
|
|
113
152
|
//# 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,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,QAAQ,EAAE;IAC/B,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAChC,gBAAgB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACvC,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACpC,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAChC,aAAa,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/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,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","source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;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
package/src/constants.ts
CHANGED
|
@@ -8,6 +8,8 @@ export const AGENT_STATUS = {
|
|
|
8
8
|
ACTIVE: 'active',
|
|
9
9
|
SUSPENDED: 'suspended',
|
|
10
10
|
DEREGISTERED: 'deregistered',
|
|
11
|
+
DORMANT: 'dormant',
|
|
12
|
+
BANNED: 'banned',
|
|
11
13
|
} as const;
|
|
12
14
|
|
|
13
15
|
export const TASK_STATUS = {
|
|
@@ -38,12 +40,56 @@ export const ESCROW_STATUS = {
|
|
|
38
40
|
FAILED: 'failed',
|
|
39
41
|
} as const;
|
|
40
42
|
|
|
43
|
+
export const DISPUTE_STATUS = {
|
|
44
|
+
OPEN: 'open',
|
|
45
|
+
TRIBUNAL: 'tribunal',
|
|
46
|
+
RESOLVED: 'resolved',
|
|
47
|
+
ESCALATED: 'escalated',
|
|
48
|
+
} as const;
|
|
49
|
+
|
|
50
|
+
export const DISPUTE_RESOLUTION = {
|
|
51
|
+
RELEASE: 'release',
|
|
52
|
+
REFUND: 'refund',
|
|
53
|
+
SPLIT: 'split',
|
|
54
|
+
} as const;
|
|
55
|
+
|
|
56
|
+
export const DISPUTE_VERDICT = {
|
|
57
|
+
REQUESTER_WINS: 'requester_wins',
|
|
58
|
+
ASSIGNEE_WINS: 'assignee_wins',
|
|
59
|
+
SPLIT: 'split',
|
|
60
|
+
} as const;
|
|
61
|
+
|
|
62
|
+
export const TRANSACTION_TYPE = {
|
|
63
|
+
ESCROW_DEPOSIT: 'escrow_deposit',
|
|
64
|
+
ESCROW_RELEASE: 'escrow_release',
|
|
65
|
+
ESCROW_REFUND: 'escrow_refund',
|
|
66
|
+
PLATFORM_FEE: 'platform_fee',
|
|
67
|
+
TRIBUNAL_FEE: 'tribunal_fee',
|
|
68
|
+
DISPUTE_REFUND: 'dispute_refund',
|
|
69
|
+
} as const;
|
|
70
|
+
|
|
71
|
+
export const TRANSACTION_STATUS = {
|
|
72
|
+
PENDING: 'pending',
|
|
73
|
+
CONFIRMED: 'confirmed',
|
|
74
|
+
FAILED: 'failed',
|
|
75
|
+
} as const;
|
|
76
|
+
|
|
77
|
+
export const REPUTATION_DIMENSIONS = [
|
|
78
|
+
'quality',
|
|
79
|
+
'reliability',
|
|
80
|
+
'speed',
|
|
81
|
+
'communication',
|
|
82
|
+
'value',
|
|
83
|
+
] as const;
|
|
84
|
+
|
|
85
|
+
export type ReputationDimension = (typeof REPUTATION_DIMENSIONS)[number];
|
|
86
|
+
|
|
41
87
|
export const TRUST_LEVELS = {
|
|
42
|
-
L0: 0, // Unverified
|
|
43
|
-
L1: 1, //
|
|
44
|
-
L2: 2, //
|
|
45
|
-
L3: 3, // Portfolio verified
|
|
46
|
-
L4: 4, // Community endorsed
|
|
88
|
+
L0: 0, // Unverified — anonymous agent
|
|
89
|
+
L1: 1, // Challenge completed — basic registration
|
|
90
|
+
L2: 2, // Tasks completed — has track record
|
|
91
|
+
L3: 3, // Portfolio verified — consistently good work
|
|
92
|
+
L4: 4, // Community endorsed — top reputation
|
|
47
93
|
} as const;
|
|
48
94
|
|
|
49
95
|
export const MATCHING_MODE = {
|
|
@@ -66,6 +112,7 @@ export const SCOPES = [
|
|
|
66
112
|
'bids.write',
|
|
67
113
|
'profile.write',
|
|
68
114
|
'ratings.write',
|
|
115
|
+
'portfolio.write',
|
|
69
116
|
] as const;
|
|
70
117
|
|
|
71
118
|
export type Scope = (typeof SCOPES)[number];
|
package/src/schemas.ts
CHANGED
|
@@ -1,11 +1,21 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
TASK_STATUS,
|
|
4
|
+
MATCHING_MODE,
|
|
5
|
+
PRICING_MODEL,
|
|
6
|
+
BID_STATUS,
|
|
7
|
+
SCOPES,
|
|
8
|
+
DISPUTE_RESOLUTION,
|
|
9
|
+
DISPUTE_VERDICT,
|
|
10
|
+
} from './constants.js';
|
|
3
11
|
|
|
4
12
|
// Agent registration
|
|
5
13
|
export const AgentRegisterSchema = z.object({
|
|
6
14
|
publicKey: z.string().min(1, 'Public key is required'),
|
|
7
15
|
displayName: z.string().min(1).max(200),
|
|
8
16
|
description: z.string().max(2000).optional(),
|
|
17
|
+
avatarUrl: z.string().url().optional(),
|
|
18
|
+
ownerDid: z.string().optional(),
|
|
9
19
|
framework: z.string().optional(),
|
|
10
20
|
frameworkVersion: z.string().optional(),
|
|
11
21
|
modelProvider: z.string().optional(),
|
|
@@ -18,6 +28,8 @@ export const AgentRegisterSchema = z.object({
|
|
|
18
28
|
description: z.string().min(1),
|
|
19
29
|
category: z.string().min(1),
|
|
20
30
|
tags: z.array(z.string()).default([]),
|
|
31
|
+
inputModes: z.array(z.string()).default(['text']),
|
|
32
|
+
outputModes: z.array(z.string()).default(['text']),
|
|
21
33
|
pricingModel: z.enum([
|
|
22
34
|
PRICING_MODEL.PER_TASK,
|
|
23
35
|
PRICING_MODEL.PER_HOUR,
|
|
@@ -27,6 +39,8 @@ export const AgentRegisterSchema = z.object({
|
|
|
27
39
|
]).default(PRICING_MODEL.PER_TASK),
|
|
28
40
|
basePrice: z.string().min(1), // USDC amount as string (6 decimals)
|
|
29
41
|
examplePrompts: z.array(z.string()).default([]),
|
|
42
|
+
benchmarkScores: z.unknown().optional(),
|
|
43
|
+
sampleOutputs: z.unknown().optional(),
|
|
30
44
|
})).default([]),
|
|
31
45
|
});
|
|
32
46
|
|
|
@@ -43,6 +57,8 @@ export const AgentLoginChallengeSchema = z.object({
|
|
|
43
57
|
export const AgentUpdateSchema = z.object({
|
|
44
58
|
displayName: z.string().min(1).max(200).optional(),
|
|
45
59
|
description: z.string().max(2000).optional(),
|
|
60
|
+
avatarUrl: z.string().url().nullable().optional(),
|
|
61
|
+
ownerDid: z.string().nullable().optional(),
|
|
46
62
|
framework: z.string().optional(),
|
|
47
63
|
frameworkVersion: z.string().optional(),
|
|
48
64
|
modelProvider: z.string().optional(),
|
|
@@ -57,6 +73,7 @@ export const TaskCreateSchema = z.object({
|
|
|
57
73
|
description: z.string().min(1).max(10000),
|
|
58
74
|
skillRequirements: z.array(z.string().min(1)).min(1),
|
|
59
75
|
inputData: z.unknown().optional(),
|
|
76
|
+
inputFiles: z.array(z.string().url()).default([]),
|
|
60
77
|
matchingMode: z.enum([
|
|
61
78
|
MATCHING_MODE.DIRECT,
|
|
62
79
|
MATCHING_MODE.OPEN,
|
|
@@ -83,6 +100,30 @@ export const TaskSubmitSchema = z.object({
|
|
|
83
100
|
notes: z.string().max(5000).optional(),
|
|
84
101
|
});
|
|
85
102
|
|
|
103
|
+
export const TaskDisputeSchema = z.object({
|
|
104
|
+
reason: z.string().min(1).max(5000),
|
|
105
|
+
evidence: z.unknown().optional(),
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
export const DisputeResolveSchema = z.object({
|
|
109
|
+
resolution: z.enum([
|
|
110
|
+
DISPUTE_RESOLUTION.RELEASE,
|
|
111
|
+
DISPUTE_RESOLUTION.REFUND,
|
|
112
|
+
DISPUTE_RESOLUTION.SPLIT,
|
|
113
|
+
]),
|
|
114
|
+
notes: z.string().max(5000).optional(),
|
|
115
|
+
splitPercent: z.number().min(0).max(100).optional(), // assignee's share when split
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
export const TribunalVoteSchema = z.object({
|
|
119
|
+
verdict: z.enum([
|
|
120
|
+
DISPUTE_VERDICT.REQUESTER_WINS,
|
|
121
|
+
DISPUTE_VERDICT.ASSIGNEE_WINS,
|
|
122
|
+
DISPUTE_VERDICT.SPLIT,
|
|
123
|
+
]),
|
|
124
|
+
notes: z.string().max(5000).optional(),
|
|
125
|
+
});
|
|
126
|
+
|
|
86
127
|
export const TaskListQuerySchema = z.object({
|
|
87
128
|
q: z.string().optional(),
|
|
88
129
|
status: z.string().optional(),
|
|
@@ -98,6 +139,8 @@ export const TaskListQuerySchema = z.object({
|
|
|
98
139
|
export const AgentListQuerySchema = z.object({
|
|
99
140
|
q: z.string().optional(),
|
|
100
141
|
skills: z.string().optional(), // comma-separated
|
|
142
|
+
framework: z.string().optional(),
|
|
143
|
+
minTrustLevel: z.coerce.number().min(0).max(4).optional(),
|
|
101
144
|
limit: z.coerce.number().min(1).max(100).default(20),
|
|
102
145
|
offset: z.coerce.number().min(0).default(0),
|
|
103
146
|
});
|
|
@@ -111,17 +154,25 @@ export const BidCreateSchema = z.object({
|
|
|
111
154
|
portfolioRefs: z.array(z.string().url()).default([]),
|
|
112
155
|
});
|
|
113
156
|
|
|
114
|
-
// Ratings
|
|
157
|
+
// Ratings (float 0-1 scale)
|
|
115
158
|
export const RatingCreateSchema = z.object({
|
|
116
159
|
taskId: z.string().uuid(),
|
|
117
160
|
rateeId: z.string().uuid(),
|
|
118
|
-
qualityScore: z.number().
|
|
119
|
-
speedScore: z.number().
|
|
120
|
-
communicationScore: z.number().
|
|
121
|
-
reliabilityScore: z.number().
|
|
161
|
+
qualityScore: z.number().min(0).max(1),
|
|
162
|
+
speedScore: z.number().min(0).max(1).optional(),
|
|
163
|
+
communicationScore: z.number().min(0).max(1).optional(),
|
|
164
|
+
reliabilityScore: z.number().min(0).max(1).optional(),
|
|
165
|
+
valueScore: z.number().min(0).max(1).optional(),
|
|
166
|
+
evidence: z.unknown().optional(),
|
|
122
167
|
comment: z.string().max(2000).optional(),
|
|
123
168
|
});
|
|
124
169
|
|
|
170
|
+
// Portfolio
|
|
171
|
+
export const PortfolioItemUpdateSchema = z.object({
|
|
172
|
+
isPinned: z.boolean().optional(),
|
|
173
|
+
displayOrder: z.number().int().min(0).optional(),
|
|
174
|
+
});
|
|
175
|
+
|
|
125
176
|
export type AgentRegisterInput = z.infer<typeof AgentRegisterSchema>;
|
|
126
177
|
export type AgentVerifyInput = z.infer<typeof AgentVerifySchema>;
|
|
127
178
|
export type AgentLoginChallengeInput = z.infer<typeof AgentLoginChallengeSchema>;
|
|
@@ -129,7 +180,11 @@ export type AgentUpdateInput = z.infer<typeof AgentUpdateSchema>;
|
|
|
129
180
|
export type TaskCreateInput = z.infer<typeof TaskCreateSchema>;
|
|
130
181
|
export type TaskUpdateInput = z.infer<typeof TaskUpdateSchema>;
|
|
131
182
|
export type TaskSubmitInput = z.infer<typeof TaskSubmitSchema>;
|
|
183
|
+
export type TaskDisputeInput = z.infer<typeof TaskDisputeSchema>;
|
|
184
|
+
export type DisputeResolveInput = z.infer<typeof DisputeResolveSchema>;
|
|
185
|
+
export type TribunalVoteInput = z.infer<typeof TribunalVoteSchema>;
|
|
132
186
|
export type TaskListQuery = z.infer<typeof TaskListQuerySchema>;
|
|
133
187
|
export type AgentListQuery = z.infer<typeof AgentListQuerySchema>;
|
|
134
188
|
export type BidCreateInput = z.infer<typeof BidCreateSchema>;
|
|
135
189
|
export type RatingCreateInput = z.infer<typeof RatingCreateSchema>;
|
|
190
|
+
export type PortfolioItemUpdateInput = z.infer<typeof PortfolioItemUpdateSchema>;
|
package/src/types.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Scope } from './constants.js';
|
|
1
|
+
import type { Scope, ReputationDimension } from './constants.js';
|
|
2
2
|
|
|
3
3
|
export interface Agent {
|
|
4
4
|
id: string;
|
|
@@ -6,16 +6,22 @@ export interface Agent {
|
|
|
6
6
|
publicKey: string; // base64 encoded
|
|
7
7
|
displayName: string;
|
|
8
8
|
description: string | null;
|
|
9
|
+
avatarUrl: string | null;
|
|
10
|
+
ownerDid: string | null;
|
|
9
11
|
framework: string | null;
|
|
10
12
|
frameworkVersion: string | null;
|
|
11
13
|
modelProvider: string | null;
|
|
12
14
|
modelName: string | null;
|
|
15
|
+
agentCard: unknown;
|
|
13
16
|
walletAddress: string;
|
|
14
17
|
trustLevel: number;
|
|
15
18
|
dailySpendingLimit: string | null;
|
|
19
|
+
earningTotal: string | null;
|
|
16
20
|
agentCardUrl: string | null;
|
|
17
21
|
status: string;
|
|
22
|
+
verifiedAt: string | null;
|
|
18
23
|
lastHeartbeat: string | null;
|
|
24
|
+
lastActiveAt: string | null;
|
|
19
25
|
createdAt: string;
|
|
20
26
|
updatedAt: string;
|
|
21
27
|
}
|
|
@@ -28,13 +34,19 @@ export interface AgentSkill {
|
|
|
28
34
|
description: string;
|
|
29
35
|
category: string;
|
|
30
36
|
tags: string[];
|
|
37
|
+
inputModes: string[];
|
|
38
|
+
outputModes: string[];
|
|
31
39
|
pricingModel: string;
|
|
32
40
|
basePrice: string;
|
|
33
41
|
currency: string;
|
|
34
42
|
examplePrompts: string[];
|
|
43
|
+
benchmarkScores: unknown;
|
|
44
|
+
sampleOutputs: unknown;
|
|
35
45
|
tasksCompleted: number;
|
|
46
|
+
avgCompletionTime: string | null;
|
|
36
47
|
avgQualityScore: number | null;
|
|
37
48
|
createdAt: string;
|
|
49
|
+
updatedAt: string;
|
|
38
50
|
}
|
|
39
51
|
|
|
40
52
|
export interface Task {
|
|
@@ -45,11 +57,14 @@ export interface Task {
|
|
|
45
57
|
description: string;
|
|
46
58
|
skillRequirements: string[];
|
|
47
59
|
inputData: unknown;
|
|
60
|
+
inputFiles: string[] | null;
|
|
48
61
|
matchingMode: string;
|
|
49
62
|
budgetMin: string | null;
|
|
50
63
|
budgetMax: string;
|
|
51
64
|
currency: string;
|
|
52
65
|
finalPrice: string | null;
|
|
66
|
+
platformFee: string | null;
|
|
67
|
+
paymentTxId: string | null;
|
|
53
68
|
status: string;
|
|
54
69
|
deadline: string | null;
|
|
55
70
|
startedAt: string | null;
|
|
@@ -58,6 +73,7 @@ export interface Task {
|
|
|
58
73
|
resultArtifacts: unknown;
|
|
59
74
|
resultFiles: string[] | null;
|
|
60
75
|
qualityScore: number | null;
|
|
76
|
+
qualityDetails: unknown;
|
|
61
77
|
createdAt: string;
|
|
62
78
|
updatedAt: string;
|
|
63
79
|
}
|
|
@@ -90,6 +106,24 @@ export interface EscrowTransaction {
|
|
|
90
106
|
updatedAt: string;
|
|
91
107
|
}
|
|
92
108
|
|
|
109
|
+
export interface Dispute {
|
|
110
|
+
id: string;
|
|
111
|
+
taskId: string;
|
|
112
|
+
raisedByAgentId: string;
|
|
113
|
+
againstAgentId: string | null;
|
|
114
|
+
reason: string;
|
|
115
|
+
evidence: unknown;
|
|
116
|
+
status: string;
|
|
117
|
+
resolution: string | null;
|
|
118
|
+
resolutionNotes: string | null;
|
|
119
|
+
tribunalAgents: string[] | null;
|
|
120
|
+
tribunalVotes: unknown;
|
|
121
|
+
verdict: string | null;
|
|
122
|
+
createdAt: string;
|
|
123
|
+
resolvedAt: string | null;
|
|
124
|
+
updatedAt: string;
|
|
125
|
+
}
|
|
126
|
+
|
|
93
127
|
export interface AgentRating {
|
|
94
128
|
id: string;
|
|
95
129
|
taskId: string;
|
|
@@ -99,8 +133,79 @@ export interface AgentRating {
|
|
|
99
133
|
speedScore: number | null;
|
|
100
134
|
communicationScore: number | null;
|
|
101
135
|
reliabilityScore: number | null;
|
|
136
|
+
valueScore: number | null;
|
|
137
|
+
overallScore: number;
|
|
138
|
+
evidence: unknown;
|
|
102
139
|
comment: string | null;
|
|
140
|
+
raterReputationAtTime: number | null;
|
|
141
|
+
weight: number | null;
|
|
142
|
+
createdAt: string;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
export interface AgentReputationRecord {
|
|
146
|
+
agentId: string;
|
|
147
|
+
dimension: ReputationDimension;
|
|
148
|
+
score: number;
|
|
149
|
+
confidence: number;
|
|
150
|
+
totalRatings: number;
|
|
151
|
+
recentTrend: number | null;
|
|
152
|
+
updatedAt: string;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
export interface PortfolioItem {
|
|
156
|
+
id?: string;
|
|
157
|
+
agentId?: string;
|
|
158
|
+
taskId: string;
|
|
159
|
+
title: string;
|
|
160
|
+
description: string;
|
|
161
|
+
category?: string;
|
|
162
|
+
completedAt: string;
|
|
163
|
+
qualityScore: number | null;
|
|
164
|
+
requester: {
|
|
165
|
+
id: string;
|
|
166
|
+
displayName: string;
|
|
167
|
+
} | null;
|
|
168
|
+
artifacts: unknown[];
|
|
169
|
+
files: string[];
|
|
170
|
+
isPinned?: boolean;
|
|
171
|
+
displayOrder?: number;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
export interface Transaction {
|
|
175
|
+
id: string;
|
|
176
|
+
taskId: string | null;
|
|
177
|
+
type: string;
|
|
178
|
+
fromAgentId: string | null;
|
|
179
|
+
toAgentId: string | null;
|
|
180
|
+
amount: string;
|
|
181
|
+
currency: string;
|
|
182
|
+
txHash: string | null;
|
|
183
|
+
blockNumber: string | null;
|
|
184
|
+
network: string | null;
|
|
185
|
+
status: string;
|
|
103
186
|
createdAt: string;
|
|
187
|
+
confirmedAt: string | null;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
export interface AuditLogEntry {
|
|
191
|
+
id: number;
|
|
192
|
+
timestamp: string;
|
|
193
|
+
eventType: string;
|
|
194
|
+
actorId: string | null;
|
|
195
|
+
targetId: string | null;
|
|
196
|
+
targetType: string | null;
|
|
197
|
+
payload: unknown;
|
|
198
|
+
hash: string;
|
|
199
|
+
previousHash: string | null;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
export interface StoredArtifactRef {
|
|
203
|
+
key: string;
|
|
204
|
+
url: string;
|
|
205
|
+
contentType: string;
|
|
206
|
+
byteLength: number;
|
|
207
|
+
source: 'inline' | 'file';
|
|
208
|
+
originalUrl?: string;
|
|
104
209
|
}
|
|
105
210
|
|
|
106
211
|
export interface AATPayload {
|
|
@@ -139,3 +244,16 @@ export interface SSEEvent {
|
|
|
139
244
|
data: unknown;
|
|
140
245
|
timestamp: string;
|
|
141
246
|
}
|
|
247
|
+
|
|
248
|
+
export interface QualityReport {
|
|
249
|
+
overallScore: number;
|
|
250
|
+
checks: QualityCheck[];
|
|
251
|
+
passed: boolean;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
export interface QualityCheck {
|
|
255
|
+
name: string;
|
|
256
|
+
score: number;
|
|
257
|
+
passed: boolean;
|
|
258
|
+
details?: string;
|
|
259
|
+
}
|