@dainprotocol/service-sdk 2.0.95 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +29 -0
- package/dist/client/types.d.ts +252 -0
- package/dist/client/types.js +159 -31
- package/dist/client/types.js.map +1 -1
- package/dist/protocol/grants.d.ts +12 -0
- package/dist/protocol/registry.d.ts +6 -4
- package/dist/service/auth.d.ts +15 -1
- package/dist/service/auth.js +156 -35
- package/dist/service/auth.js.map +1 -1
- package/dist/service/server.js +306 -183
- package/dist/service/server.js.map +1 -1
- package/dist/service/service.js +6 -8
- package/dist/service/service.js.map +1 -1
- package/dist/service/types.d.ts +10 -9
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1013,6 +1013,35 @@ interface DAINServiceConfig {
|
|
|
1013
1013
|
author: string;
|
|
1014
1014
|
tags: string[];
|
|
1015
1015
|
logo?: string;
|
|
1016
|
+
/**
|
|
1017
|
+
* Declarative DAIN Platform policy advertised by /metadata.
|
|
1018
|
+
* Runtime grants remain account-bound and arrive through ToolContext.
|
|
1019
|
+
*/
|
|
1020
|
+
registryPolicy?: {
|
|
1021
|
+
registry?: {
|
|
1022
|
+
programId: string;
|
|
1023
|
+
network: 'mainnet' | 'devnet' | 'testnet' | 'localnet';
|
|
1024
|
+
address?: string;
|
|
1025
|
+
};
|
|
1026
|
+
agent?: {
|
|
1027
|
+
organizationId: number | string;
|
|
1028
|
+
agentId: number;
|
|
1029
|
+
address?: string;
|
|
1030
|
+
name?: string;
|
|
1031
|
+
endpoint?: string;
|
|
1032
|
+
verified?: boolean;
|
|
1033
|
+
};
|
|
1034
|
+
requiredScopes?: string[];
|
|
1035
|
+
requiredDataFields?: Array<{
|
|
1036
|
+
id: string;
|
|
1037
|
+
label: string;
|
|
1038
|
+
mode: 'read' | 'write';
|
|
1039
|
+
required?: boolean;
|
|
1040
|
+
sensitivity?: 'public' | 'personal' | 'financial' | 'credential' | 'secret';
|
|
1041
|
+
}>;
|
|
1042
|
+
paymentOffers?: DainPaymentOffer[];
|
|
1043
|
+
grantPolicies?: DainGrantPolicy[];
|
|
1044
|
+
};
|
|
1016
1045
|
};
|
|
1017
1046
|
identity: {
|
|
1018
1047
|
apiKey?: string;
|
package/dist/client/types.d.ts
CHANGED
|
@@ -3,6 +3,132 @@ export declare const PricingInfoSchema: z.ZodObject<{
|
|
|
3
3
|
pricePerUse: z.ZodNumber;
|
|
4
4
|
currency: z.ZodString;
|
|
5
5
|
}, z.core.$strip>;
|
|
6
|
+
export declare const DainServiceRegistryPolicySchema: z.ZodObject<{
|
|
7
|
+
registry: z.ZodOptional<z.ZodObject<{
|
|
8
|
+
programId: z.ZodString;
|
|
9
|
+
network: z.ZodEnum<{
|
|
10
|
+
mainnet: "mainnet";
|
|
11
|
+
devnet: "devnet";
|
|
12
|
+
testnet: "testnet";
|
|
13
|
+
localnet: "localnet";
|
|
14
|
+
}>;
|
|
15
|
+
address: z.ZodOptional<z.ZodString>;
|
|
16
|
+
}, z.core.$loose>>;
|
|
17
|
+
agent: z.ZodOptional<z.ZodObject<{
|
|
18
|
+
organizationId: z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>;
|
|
19
|
+
agentId: z.ZodNumber;
|
|
20
|
+
address: z.ZodOptional<z.ZodString>;
|
|
21
|
+
name: z.ZodOptional<z.ZodString>;
|
|
22
|
+
description: z.ZodOptional<z.ZodString>;
|
|
23
|
+
endpoint: z.ZodOptional<z.ZodString>;
|
|
24
|
+
verified: z.ZodOptional<z.ZodBoolean>;
|
|
25
|
+
statusMask: z.ZodOptional<z.ZodNumber>;
|
|
26
|
+
signatories: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
27
|
+
reputationAddress: z.ZodOptional<z.ZodString>;
|
|
28
|
+
organization: z.ZodOptional<z.ZodObject<{
|
|
29
|
+
id: z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>;
|
|
30
|
+
address: z.ZodOptional<z.ZodString>;
|
|
31
|
+
name: z.ZodOptional<z.ZodString>;
|
|
32
|
+
description: z.ZodOptional<z.ZodString>;
|
|
33
|
+
uri: z.ZodOptional<z.ZodString>;
|
|
34
|
+
verified: z.ZodOptional<z.ZodBoolean>;
|
|
35
|
+
statusMask: z.ZodOptional<z.ZodNumber>;
|
|
36
|
+
reputationAddress: z.ZodOptional<z.ZodString>;
|
|
37
|
+
}, z.core.$loose>>;
|
|
38
|
+
}, z.core.$loose>>;
|
|
39
|
+
requiredDataFields: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
40
|
+
id: z.ZodString;
|
|
41
|
+
label: z.ZodString;
|
|
42
|
+
description: z.ZodOptional<z.ZodString>;
|
|
43
|
+
mode: z.ZodEnum<{
|
|
44
|
+
read: "read";
|
|
45
|
+
write: "write";
|
|
46
|
+
}>;
|
|
47
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
48
|
+
sensitivity: z.ZodOptional<z.ZodEnum<{
|
|
49
|
+
public: "public";
|
|
50
|
+
personal: "personal";
|
|
51
|
+
financial: "financial";
|
|
52
|
+
credential: "credential";
|
|
53
|
+
secret: "secret";
|
|
54
|
+
}>>;
|
|
55
|
+
purpose: z.ZodOptional<z.ZodString>;
|
|
56
|
+
retention: z.ZodOptional<z.ZodEnum<{
|
|
57
|
+
none: "none";
|
|
58
|
+
session: "session";
|
|
59
|
+
automation: "automation";
|
|
60
|
+
service: "service";
|
|
61
|
+
}>>;
|
|
62
|
+
}, z.core.$loose>>>;
|
|
63
|
+
paymentOffers: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
64
|
+
id: z.ZodString;
|
|
65
|
+
kind: z.ZodEnum<{
|
|
66
|
+
one_time: "one_time";
|
|
67
|
+
pure_subscription: "pure_subscription";
|
|
68
|
+
hybrid_subscription: "hybrid_subscription";
|
|
69
|
+
pay_as_you_go: "pay_as_you_go";
|
|
70
|
+
}>;
|
|
71
|
+
agent: z.ZodOptional<z.ZodObject<{
|
|
72
|
+
organizationId: z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>;
|
|
73
|
+
agentId: z.ZodNumber;
|
|
74
|
+
address: z.ZodOptional<z.ZodString>;
|
|
75
|
+
name: z.ZodOptional<z.ZodString>;
|
|
76
|
+
description: z.ZodOptional<z.ZodString>;
|
|
77
|
+
endpoint: z.ZodOptional<z.ZodString>;
|
|
78
|
+
verified: z.ZodOptional<z.ZodBoolean>;
|
|
79
|
+
statusMask: z.ZodOptional<z.ZodNumber>;
|
|
80
|
+
signatories: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
81
|
+
reputationAddress: z.ZodOptional<z.ZodString>;
|
|
82
|
+
organization: z.ZodOptional<z.ZodObject<{
|
|
83
|
+
id: z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>;
|
|
84
|
+
address: z.ZodOptional<z.ZodString>;
|
|
85
|
+
name: z.ZodOptional<z.ZodString>;
|
|
86
|
+
description: z.ZodOptional<z.ZodString>;
|
|
87
|
+
uri: z.ZodOptional<z.ZodString>;
|
|
88
|
+
verified: z.ZodOptional<z.ZodBoolean>;
|
|
89
|
+
statusMask: z.ZodOptional<z.ZodNumber>;
|
|
90
|
+
reputationAddress: z.ZodOptional<z.ZodString>;
|
|
91
|
+
}, z.core.$loose>>;
|
|
92
|
+
}, z.core.$loose>>;
|
|
93
|
+
organizationId: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
|
|
94
|
+
agentId: z.ZodOptional<z.ZodNumber>;
|
|
95
|
+
vaultId: z.ZodOptional<z.ZodNumber>;
|
|
96
|
+
mint: z.ZodObject<{
|
|
97
|
+
chain: z.ZodLiteral<"solana">;
|
|
98
|
+
mint: z.ZodString;
|
|
99
|
+
decimals: z.ZodOptional<z.ZodNumber>;
|
|
100
|
+
symbol: z.ZodOptional<z.ZodString>;
|
|
101
|
+
}, z.core.$loose>;
|
|
102
|
+
amount: z.ZodString;
|
|
103
|
+
baseAmount: z.ZodOptional<z.ZodString>;
|
|
104
|
+
periodSeconds: z.ZodOptional<z.ZodNumber>;
|
|
105
|
+
trialSeconds: z.ZodOptional<z.ZodNumber>;
|
|
106
|
+
description: z.ZodOptional<z.ZodString>;
|
|
107
|
+
}, z.core.$loose>>>;
|
|
108
|
+
requiredScopes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
109
|
+
grantPolicies: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
110
|
+
id: z.ZodString;
|
|
111
|
+
name: z.ZodOptional<z.ZodString>;
|
|
112
|
+
description: z.ZodOptional<z.ZodString>;
|
|
113
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
114
|
+
scopes: z.ZodArray<z.ZodString>;
|
|
115
|
+
limits: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
116
|
+
kind: z.ZodEnum<{
|
|
117
|
+
tools: "tools";
|
|
118
|
+
spend: "spend";
|
|
119
|
+
calls: "calls";
|
|
120
|
+
period: "period";
|
|
121
|
+
chains: "chains";
|
|
122
|
+
}>;
|
|
123
|
+
value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodArray<z.ZodString>]>;
|
|
124
|
+
periodSeconds: z.ZodOptional<z.ZodNumber>;
|
|
125
|
+
}, z.core.$loose>>>;
|
|
126
|
+
toolIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
127
|
+
dataFieldIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
128
|
+
paymentOfferIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
129
|
+
expiresInSeconds: z.ZodOptional<z.ZodNumber>;
|
|
130
|
+
}, z.core.$loose>>>;
|
|
131
|
+
}, z.core.$loose>;
|
|
6
132
|
export declare const MetadataSchema: z.ZodObject<{
|
|
7
133
|
id: z.ZodString;
|
|
8
134
|
orgId: z.ZodString;
|
|
@@ -34,6 +160,132 @@ export declare const MetadataSchema: z.ZodObject<{
|
|
|
34
160
|
ok: z.ZodBoolean;
|
|
35
161
|
reason: z.ZodOptional<z.ZodString>;
|
|
36
162
|
}, z.core.$loose>>;
|
|
163
|
+
registryPolicy: z.ZodOptional<z.ZodObject<{
|
|
164
|
+
registry: z.ZodOptional<z.ZodObject<{
|
|
165
|
+
programId: z.ZodString;
|
|
166
|
+
network: z.ZodEnum<{
|
|
167
|
+
mainnet: "mainnet";
|
|
168
|
+
devnet: "devnet";
|
|
169
|
+
testnet: "testnet";
|
|
170
|
+
localnet: "localnet";
|
|
171
|
+
}>;
|
|
172
|
+
address: z.ZodOptional<z.ZodString>;
|
|
173
|
+
}, z.core.$loose>>;
|
|
174
|
+
agent: z.ZodOptional<z.ZodObject<{
|
|
175
|
+
organizationId: z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>;
|
|
176
|
+
agentId: z.ZodNumber;
|
|
177
|
+
address: z.ZodOptional<z.ZodString>;
|
|
178
|
+
name: z.ZodOptional<z.ZodString>;
|
|
179
|
+
description: z.ZodOptional<z.ZodString>;
|
|
180
|
+
endpoint: z.ZodOptional<z.ZodString>;
|
|
181
|
+
verified: z.ZodOptional<z.ZodBoolean>;
|
|
182
|
+
statusMask: z.ZodOptional<z.ZodNumber>;
|
|
183
|
+
signatories: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
184
|
+
reputationAddress: z.ZodOptional<z.ZodString>;
|
|
185
|
+
organization: z.ZodOptional<z.ZodObject<{
|
|
186
|
+
id: z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>;
|
|
187
|
+
address: z.ZodOptional<z.ZodString>;
|
|
188
|
+
name: z.ZodOptional<z.ZodString>;
|
|
189
|
+
description: z.ZodOptional<z.ZodString>;
|
|
190
|
+
uri: z.ZodOptional<z.ZodString>;
|
|
191
|
+
verified: z.ZodOptional<z.ZodBoolean>;
|
|
192
|
+
statusMask: z.ZodOptional<z.ZodNumber>;
|
|
193
|
+
reputationAddress: z.ZodOptional<z.ZodString>;
|
|
194
|
+
}, z.core.$loose>>;
|
|
195
|
+
}, z.core.$loose>>;
|
|
196
|
+
requiredDataFields: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
197
|
+
id: z.ZodString;
|
|
198
|
+
label: z.ZodString;
|
|
199
|
+
description: z.ZodOptional<z.ZodString>;
|
|
200
|
+
mode: z.ZodEnum<{
|
|
201
|
+
read: "read";
|
|
202
|
+
write: "write";
|
|
203
|
+
}>;
|
|
204
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
205
|
+
sensitivity: z.ZodOptional<z.ZodEnum<{
|
|
206
|
+
public: "public";
|
|
207
|
+
personal: "personal";
|
|
208
|
+
financial: "financial";
|
|
209
|
+
credential: "credential";
|
|
210
|
+
secret: "secret";
|
|
211
|
+
}>>;
|
|
212
|
+
purpose: z.ZodOptional<z.ZodString>;
|
|
213
|
+
retention: z.ZodOptional<z.ZodEnum<{
|
|
214
|
+
none: "none";
|
|
215
|
+
session: "session";
|
|
216
|
+
automation: "automation";
|
|
217
|
+
service: "service";
|
|
218
|
+
}>>;
|
|
219
|
+
}, z.core.$loose>>>;
|
|
220
|
+
paymentOffers: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
221
|
+
id: z.ZodString;
|
|
222
|
+
kind: z.ZodEnum<{
|
|
223
|
+
one_time: "one_time";
|
|
224
|
+
pure_subscription: "pure_subscription";
|
|
225
|
+
hybrid_subscription: "hybrid_subscription";
|
|
226
|
+
pay_as_you_go: "pay_as_you_go";
|
|
227
|
+
}>;
|
|
228
|
+
agent: z.ZodOptional<z.ZodObject<{
|
|
229
|
+
organizationId: z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>;
|
|
230
|
+
agentId: z.ZodNumber;
|
|
231
|
+
address: z.ZodOptional<z.ZodString>;
|
|
232
|
+
name: z.ZodOptional<z.ZodString>;
|
|
233
|
+
description: z.ZodOptional<z.ZodString>;
|
|
234
|
+
endpoint: z.ZodOptional<z.ZodString>;
|
|
235
|
+
verified: z.ZodOptional<z.ZodBoolean>;
|
|
236
|
+
statusMask: z.ZodOptional<z.ZodNumber>;
|
|
237
|
+
signatories: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
238
|
+
reputationAddress: z.ZodOptional<z.ZodString>;
|
|
239
|
+
organization: z.ZodOptional<z.ZodObject<{
|
|
240
|
+
id: z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>;
|
|
241
|
+
address: z.ZodOptional<z.ZodString>;
|
|
242
|
+
name: z.ZodOptional<z.ZodString>;
|
|
243
|
+
description: z.ZodOptional<z.ZodString>;
|
|
244
|
+
uri: z.ZodOptional<z.ZodString>;
|
|
245
|
+
verified: z.ZodOptional<z.ZodBoolean>;
|
|
246
|
+
statusMask: z.ZodOptional<z.ZodNumber>;
|
|
247
|
+
reputationAddress: z.ZodOptional<z.ZodString>;
|
|
248
|
+
}, z.core.$loose>>;
|
|
249
|
+
}, z.core.$loose>>;
|
|
250
|
+
organizationId: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
|
|
251
|
+
agentId: z.ZodOptional<z.ZodNumber>;
|
|
252
|
+
vaultId: z.ZodOptional<z.ZodNumber>;
|
|
253
|
+
mint: z.ZodObject<{
|
|
254
|
+
chain: z.ZodLiteral<"solana">;
|
|
255
|
+
mint: z.ZodString;
|
|
256
|
+
decimals: z.ZodOptional<z.ZodNumber>;
|
|
257
|
+
symbol: z.ZodOptional<z.ZodString>;
|
|
258
|
+
}, z.core.$loose>;
|
|
259
|
+
amount: z.ZodString;
|
|
260
|
+
baseAmount: z.ZodOptional<z.ZodString>;
|
|
261
|
+
periodSeconds: z.ZodOptional<z.ZodNumber>;
|
|
262
|
+
trialSeconds: z.ZodOptional<z.ZodNumber>;
|
|
263
|
+
description: z.ZodOptional<z.ZodString>;
|
|
264
|
+
}, z.core.$loose>>>;
|
|
265
|
+
requiredScopes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
266
|
+
grantPolicies: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
267
|
+
id: z.ZodString;
|
|
268
|
+
name: z.ZodOptional<z.ZodString>;
|
|
269
|
+
description: z.ZodOptional<z.ZodString>;
|
|
270
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
271
|
+
scopes: z.ZodArray<z.ZodString>;
|
|
272
|
+
limits: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
273
|
+
kind: z.ZodEnum<{
|
|
274
|
+
tools: "tools";
|
|
275
|
+
spend: "spend";
|
|
276
|
+
calls: "calls";
|
|
277
|
+
period: "period";
|
|
278
|
+
chains: "chains";
|
|
279
|
+
}>;
|
|
280
|
+
value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodArray<z.ZodString>]>;
|
|
281
|
+
periodSeconds: z.ZodOptional<z.ZodNumber>;
|
|
282
|
+
}, z.core.$loose>>>;
|
|
283
|
+
toolIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
284
|
+
dataFieldIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
285
|
+
paymentOfferIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
286
|
+
expiresInSeconds: z.ZodOptional<z.ZodNumber>;
|
|
287
|
+
}, z.core.$loose>>>;
|
|
288
|
+
}, z.core.$loose>>;
|
|
37
289
|
}, z.core.$strip>;
|
|
38
290
|
export declare const ServiceConfigSchema: z.ZodObject<{
|
|
39
291
|
id: z.ZodString;
|
package/dist/client/types.js
CHANGED
|
@@ -1,11 +1,119 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.HumanActionStepSchema = exports.ExampleQueriesSchema = exports.ExampleQuerySchema = exports.DirectAuthStatusSchema = exports.ProviderInfoSchema = exports.OAuth2ProviderInfoSchema = exports.ServiceWidgetWithDataSchema = exports.ServiceWidgetSchema = exports.RecommendationRenderResponseSchema = exports.RecommendationRenderErrorSchema = exports.RenderedRecommendationCardSchema = exports.RecommendationRenderRequestSchema = exports.RecommendationRenderRequestCardSchema = exports.RecommendationSearchResponseSchema = exports.RecommendationSearchCardSchema = exports.RecommendationSearchRequestSchema = exports.GetAllToolsAsJsonSchemaResponseSchema = exports.ToolWithJsonSchemaSchema = exports.ServiceAgentSchema = exports.ServiceDatasourceWithDataSchema = exports.FreshnessEnvelopeSchema = exports.ServiceDatasourceSchema = exports.DatasourceTypeSchema = exports.ServiceContextWithDataSchema = exports.ServiceContextSchema = exports.ToolConfigSchema = exports.ToolboxConfigSchema = exports.ServiceConfigSchema = exports.MetadataSchema = exports.PricingInfoSchema = void 0;
|
|
3
|
+
exports.HumanActionStepSchema = exports.ExampleQueriesSchema = exports.ExampleQuerySchema = exports.DirectAuthStatusSchema = exports.ProviderInfoSchema = exports.OAuth2ProviderInfoSchema = exports.ServiceWidgetWithDataSchema = exports.ServiceWidgetSchema = exports.RecommendationRenderResponseSchema = exports.RecommendationRenderErrorSchema = exports.RenderedRecommendationCardSchema = exports.RecommendationRenderRequestSchema = exports.RecommendationRenderRequestCardSchema = exports.RecommendationSearchResponseSchema = exports.RecommendationSearchCardSchema = exports.RecommendationSearchRequestSchema = exports.GetAllToolsAsJsonSchemaResponseSchema = exports.ToolWithJsonSchemaSchema = exports.ServiceAgentSchema = exports.ServiceDatasourceWithDataSchema = exports.FreshnessEnvelopeSchema = exports.ServiceDatasourceSchema = exports.DatasourceTypeSchema = exports.ServiceContextWithDataSchema = exports.ServiceContextSchema = exports.ToolConfigSchema = exports.ToolboxConfigSchema = exports.ServiceConfigSchema = exports.MetadataSchema = exports.DainServiceRegistryPolicySchema = exports.PricingInfoSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
exports.PricingInfoSchema = zod_1.z.object({
|
|
6
6
|
pricePerUse: zod_1.z.number(),
|
|
7
7
|
currency: zod_1.z.string(),
|
|
8
8
|
});
|
|
9
|
+
const DainRegistryIdSchema = zod_1.z.union([zod_1.z.number(), zod_1.z.string()]);
|
|
10
|
+
const DainRegistryRefSchema = zod_1.z
|
|
11
|
+
.object({
|
|
12
|
+
programId: zod_1.z.string(),
|
|
13
|
+
network: zod_1.z.enum(["mainnet", "devnet", "testnet", "localnet"]),
|
|
14
|
+
address: zod_1.z.string().optional(),
|
|
15
|
+
})
|
|
16
|
+
.passthrough();
|
|
17
|
+
const DainOrganizationRegistryRefSchema = zod_1.z
|
|
18
|
+
.object({
|
|
19
|
+
id: DainRegistryIdSchema,
|
|
20
|
+
address: zod_1.z.string().optional(),
|
|
21
|
+
name: zod_1.z.string().optional(),
|
|
22
|
+
description: zod_1.z.string().optional(),
|
|
23
|
+
uri: zod_1.z.string().optional(),
|
|
24
|
+
verified: zod_1.z.boolean().optional(),
|
|
25
|
+
statusMask: zod_1.z.number().optional(),
|
|
26
|
+
reputationAddress: zod_1.z.string().optional(),
|
|
27
|
+
})
|
|
28
|
+
.passthrough();
|
|
29
|
+
const DainAgentRegistryRefSchema = zod_1.z
|
|
30
|
+
.object({
|
|
31
|
+
organizationId: DainRegistryIdSchema,
|
|
32
|
+
agentId: zod_1.z.number(),
|
|
33
|
+
address: zod_1.z.string().optional(),
|
|
34
|
+
name: zod_1.z.string().optional(),
|
|
35
|
+
description: zod_1.z.string().optional(),
|
|
36
|
+
endpoint: zod_1.z.string().optional(),
|
|
37
|
+
verified: zod_1.z.boolean().optional(),
|
|
38
|
+
statusMask: zod_1.z.number().optional(),
|
|
39
|
+
signatories: zod_1.z.array(zod_1.z.string()).optional(),
|
|
40
|
+
reputationAddress: zod_1.z.string().optional(),
|
|
41
|
+
organization: DainOrganizationRegistryRefSchema.optional(),
|
|
42
|
+
})
|
|
43
|
+
.passthrough();
|
|
44
|
+
const DainDataFieldRequirementSchema = zod_1.z
|
|
45
|
+
.object({
|
|
46
|
+
id: zod_1.z.string(),
|
|
47
|
+
label: zod_1.z.string(),
|
|
48
|
+
description: zod_1.z.string().optional(),
|
|
49
|
+
mode: zod_1.z.enum(["read", "write"]),
|
|
50
|
+
required: zod_1.z.boolean().optional(),
|
|
51
|
+
sensitivity: zod_1.z
|
|
52
|
+
.enum(["public", "personal", "financial", "credential", "secret"])
|
|
53
|
+
.optional(),
|
|
54
|
+
purpose: zod_1.z.string().optional(),
|
|
55
|
+
retention: zod_1.z.enum(["none", "session", "automation", "service"]).optional(),
|
|
56
|
+
})
|
|
57
|
+
.passthrough();
|
|
58
|
+
const DainPaymentOfferSchema = zod_1.z
|
|
59
|
+
.object({
|
|
60
|
+
id: zod_1.z.string(),
|
|
61
|
+
kind: zod_1.z.enum([
|
|
62
|
+
"one_time",
|
|
63
|
+
"pure_subscription",
|
|
64
|
+
"hybrid_subscription",
|
|
65
|
+
"pay_as_you_go",
|
|
66
|
+
]),
|
|
67
|
+
agent: DainAgentRegistryRefSchema.optional(),
|
|
68
|
+
organizationId: DainRegistryIdSchema.optional(),
|
|
69
|
+
agentId: zod_1.z.number().optional(),
|
|
70
|
+
vaultId: zod_1.z.number().optional(),
|
|
71
|
+
mint: zod_1.z
|
|
72
|
+
.object({
|
|
73
|
+
chain: zod_1.z.literal("solana"),
|
|
74
|
+
mint: zod_1.z.string(),
|
|
75
|
+
decimals: zod_1.z.number().optional(),
|
|
76
|
+
symbol: zod_1.z.string().optional(),
|
|
77
|
+
})
|
|
78
|
+
.passthrough(),
|
|
79
|
+
amount: zod_1.z.string(),
|
|
80
|
+
baseAmount: zod_1.z.string().optional(),
|
|
81
|
+
periodSeconds: zod_1.z.number().optional(),
|
|
82
|
+
trialSeconds: zod_1.z.number().optional(),
|
|
83
|
+
description: zod_1.z.string().optional(),
|
|
84
|
+
})
|
|
85
|
+
.passthrough();
|
|
86
|
+
const DainGrantLimitSchema = zod_1.z
|
|
87
|
+
.object({
|
|
88
|
+
kind: zod_1.z.enum(["spend", "calls", "period", "chains", "tools"]),
|
|
89
|
+
value: zod_1.z.union([zod_1.z.string(), zod_1.z.number(), zod_1.z.array(zod_1.z.string())]),
|
|
90
|
+
periodSeconds: zod_1.z.number().optional(),
|
|
91
|
+
})
|
|
92
|
+
.passthrough();
|
|
93
|
+
const DainGrantPolicySchema = zod_1.z
|
|
94
|
+
.object({
|
|
95
|
+
id: zod_1.z.string(),
|
|
96
|
+
name: zod_1.z.string().optional(),
|
|
97
|
+
description: zod_1.z.string().optional(),
|
|
98
|
+
required: zod_1.z.boolean().optional(),
|
|
99
|
+
scopes: zod_1.z.array(zod_1.z.string()),
|
|
100
|
+
limits: zod_1.z.array(DainGrantLimitSchema).optional(),
|
|
101
|
+
toolIds: zod_1.z.array(zod_1.z.string()).optional(),
|
|
102
|
+
dataFieldIds: zod_1.z.array(zod_1.z.string()).optional(),
|
|
103
|
+
paymentOfferIds: zod_1.z.array(zod_1.z.string()).optional(),
|
|
104
|
+
expiresInSeconds: zod_1.z.number().optional(),
|
|
105
|
+
})
|
|
106
|
+
.passthrough();
|
|
107
|
+
exports.DainServiceRegistryPolicySchema = zod_1.z
|
|
108
|
+
.object({
|
|
109
|
+
registry: DainRegistryRefSchema.optional(),
|
|
110
|
+
agent: DainAgentRegistryRefSchema.optional(),
|
|
111
|
+
requiredDataFields: zod_1.z.array(DainDataFieldRequirementSchema).optional(),
|
|
112
|
+
paymentOffers: zod_1.z.array(DainPaymentOfferSchema).optional(),
|
|
113
|
+
requiredScopes: zod_1.z.array(zod_1.z.string()).optional(),
|
|
114
|
+
grantPolicies: zod_1.z.array(DainGrantPolicySchema).optional(),
|
|
115
|
+
})
|
|
116
|
+
.passthrough();
|
|
9
117
|
exports.MetadataSchema = zod_1.z.object({
|
|
10
118
|
id: zod_1.z.string(),
|
|
11
119
|
orgId: zod_1.z.string(),
|
|
@@ -44,6 +152,7 @@ exports.MetadataSchema = zod_1.z.object({
|
|
|
44
152
|
})
|
|
45
153
|
.passthrough()
|
|
46
154
|
.optional(),
|
|
155
|
+
registryPolicy: exports.DainServiceRegistryPolicySchema.optional(),
|
|
47
156
|
});
|
|
48
157
|
exports.ServiceConfigSchema = zod_1.z.object({
|
|
49
158
|
id: zod_1.z.string(),
|
|
@@ -106,7 +215,8 @@ exports.DatasourceTypeSchema = zod_1.z.enum([
|
|
|
106
215
|
"xml",
|
|
107
216
|
"text",
|
|
108
217
|
]);
|
|
109
|
-
exports.ServiceDatasourceSchema = zod_1.z
|
|
218
|
+
exports.ServiceDatasourceSchema = zod_1.z
|
|
219
|
+
.object({
|
|
110
220
|
id: zod_1.z.string(),
|
|
111
221
|
name: zod_1.z.string(),
|
|
112
222
|
description: zod_1.z.string(),
|
|
@@ -119,8 +229,10 @@ exports.ServiceDatasourceSchema = zod_1.z.object({
|
|
|
119
229
|
scope: zod_1.z.enum(["global", "account"]).optional(),
|
|
120
230
|
dataClass: zod_1.z.string().optional(),
|
|
121
231
|
inputSchema: zod_1.z.any(),
|
|
122
|
-
})
|
|
123
|
-
|
|
232
|
+
})
|
|
233
|
+
.passthrough();
|
|
234
|
+
exports.FreshnessEnvelopeSchema = zod_1.z
|
|
235
|
+
.object({
|
|
124
236
|
freshAt: zod_1.z.number().int().optional(),
|
|
125
237
|
transport: zod_1.z.enum(["stream", "poll", "hybrid"]).optional(),
|
|
126
238
|
requestedPolicy: zod_1.z.record(zod_1.z.string(), zod_1.z.any()).optional(),
|
|
@@ -128,7 +240,8 @@ exports.FreshnessEnvelopeSchema = zod_1.z.object({
|
|
|
128
240
|
scope: zod_1.z.enum(["global", "account"]).optional(),
|
|
129
241
|
accountId: zod_1.z.string().nullable().optional(),
|
|
130
242
|
accountEpoch: zod_1.z.number().int().nullable().optional(),
|
|
131
|
-
})
|
|
243
|
+
})
|
|
244
|
+
.passthrough();
|
|
132
245
|
exports.ServiceDatasourceWithDataSchema = exports.ServiceDatasourceSchema.extend({
|
|
133
246
|
data: zod_1.z.any(),
|
|
134
247
|
freshness: exports.FreshnessEnvelopeSchema.optional(),
|
|
@@ -143,7 +256,8 @@ exports.ServiceAgentSchema = zod_1.z.object({
|
|
|
143
256
|
inputSchema: zod_1.z.any(),
|
|
144
257
|
outputSchema: zod_1.z.any(),
|
|
145
258
|
});
|
|
146
|
-
exports.ToolWithJsonSchemaSchema = zod_1.z
|
|
259
|
+
exports.ToolWithJsonSchemaSchema = zod_1.z
|
|
260
|
+
.object({
|
|
147
261
|
id: zod_1.z.string().optional(),
|
|
148
262
|
name: zod_1.z.string().optional(),
|
|
149
263
|
description: zod_1.z.string().optional(),
|
|
@@ -155,13 +269,16 @@ exports.ToolWithJsonSchemaSchema = zod_1.z.object({
|
|
|
155
269
|
suggestConfirmationUISchema: zod_1.z.any().optional(),
|
|
156
270
|
supportsUserActions: zod_1.z.boolean().optional(),
|
|
157
271
|
// Tool safety metadata (optional, backward-compatible)
|
|
158
|
-
sideEffectClass: zod_1.z
|
|
272
|
+
sideEffectClass: zod_1.z
|
|
273
|
+
.enum(["read", "write", "external", "unknown"])
|
|
274
|
+
.optional(),
|
|
159
275
|
supportsParallel: zod_1.z.boolean().optional(),
|
|
160
276
|
idempotencyScope: zod_1.z
|
|
161
277
|
.enum(["none", "toolCall", "run", "session", "account"])
|
|
162
278
|
.optional(),
|
|
163
279
|
maxConcurrencyHint: zod_1.z.number().int().min(1).max(64).optional(),
|
|
164
|
-
})
|
|
280
|
+
})
|
|
281
|
+
.passthrough();
|
|
165
282
|
exports.GetAllToolsAsJsonSchemaResponseSchema = zod_1.z.object({
|
|
166
283
|
tools: zod_1.z.array(exports.ToolWithJsonSchemaSchema),
|
|
167
284
|
reccomendedPrompts: zod_1.z.array(zod_1.z.string()),
|
|
@@ -209,7 +326,12 @@ exports.RenderedRecommendationCardSchema = zod_1.z.object({
|
|
|
209
326
|
});
|
|
210
327
|
exports.RecommendationRenderErrorSchema = zod_1.z.object({
|
|
211
328
|
cardId: zod_1.z.string(),
|
|
212
|
-
code: zod_1.z.enum([
|
|
329
|
+
code: zod_1.z.enum([
|
|
330
|
+
"not_found",
|
|
331
|
+
"invalid_params",
|
|
332
|
+
"render_failed",
|
|
333
|
+
"invalid_request",
|
|
334
|
+
]),
|
|
213
335
|
message: zod_1.z.string(),
|
|
214
336
|
details: zod_1.z.unknown().optional(),
|
|
215
337
|
});
|
|
@@ -219,7 +341,8 @@ exports.RecommendationRenderResponseSchema = zod_1.z.object({
|
|
|
219
341
|
renderedCount: zod_1.z.number().int().min(0),
|
|
220
342
|
requestedCount: zod_1.z.number().int().min(0),
|
|
221
343
|
});
|
|
222
|
-
exports.ServiceWidgetSchema = zod_1.z
|
|
344
|
+
exports.ServiceWidgetSchema = zod_1.z
|
|
345
|
+
.object({
|
|
223
346
|
id: zod_1.z.string(),
|
|
224
347
|
name: zod_1.z.string(),
|
|
225
348
|
description: zod_1.z.string(),
|
|
@@ -227,7 +350,8 @@ exports.ServiceWidgetSchema = zod_1.z.object({
|
|
|
227
350
|
size: zod_1.z.enum(["sm", "md", "lg"]).optional(), // Widget size, defaults to "sm"
|
|
228
351
|
// Widget definition refresh policy (optional, for pinned widget definitions)
|
|
229
352
|
refreshIntervalMs: zod_1.z.number().int().min(0).optional(),
|
|
230
|
-
})
|
|
353
|
+
})
|
|
354
|
+
.passthrough();
|
|
231
355
|
exports.ServiceWidgetWithDataSchema = exports.ServiceWidgetSchema.extend({
|
|
232
356
|
text: zod_1.z.string().optional(),
|
|
233
357
|
data: zod_1.z.any().optional(),
|
|
@@ -242,13 +366,13 @@ exports.OAuth2ProviderInfoSchema = zod_1.z.object({
|
|
|
242
366
|
tokenUrl: zod_1.z.string(),
|
|
243
367
|
scopes: zod_1.z.array(zod_1.z.string()),
|
|
244
368
|
reason: zod_1.z.string().optional(),
|
|
245
|
-
requiredTools: zod_1.z.array(zod_1.z.string()).optional()
|
|
369
|
+
requiredTools: zod_1.z.array(zod_1.z.string()).optional(),
|
|
246
370
|
}),
|
|
247
|
-
connected: zod_1.z.boolean()
|
|
371
|
+
connected: zod_1.z.boolean(),
|
|
248
372
|
});
|
|
249
373
|
exports.ProviderInfoSchema = zod_1.z.object({
|
|
250
374
|
name: zod_1.z.string(),
|
|
251
|
-
type: zod_1.z.enum([
|
|
375
|
+
type: zod_1.z.enum(["oauth2", "direct"]),
|
|
252
376
|
connected: zod_1.z.boolean(),
|
|
253
377
|
reason: zod_1.z.string().optional(),
|
|
254
378
|
requiredTools: zod_1.z.array(zod_1.z.string()).optional(),
|
|
@@ -257,23 +381,25 @@ exports.ProviderInfoSchema = zod_1.z.object({
|
|
|
257
381
|
authMethod: zod_1.z.union([
|
|
258
382
|
zod_1.z.null(),
|
|
259
383
|
zod_1.z.object({
|
|
260
|
-
type: zod_1.z.literal(
|
|
261
|
-
authUrl: zod_1.z.string()
|
|
384
|
+
type: zod_1.z.literal("oauth2"),
|
|
385
|
+
authUrl: zod_1.z.string(),
|
|
262
386
|
}),
|
|
263
387
|
zod_1.z.object({
|
|
264
|
-
type: zod_1.z.literal(
|
|
265
|
-
onboardingTool: zod_1.z.string()
|
|
266
|
-
})
|
|
267
|
-
])
|
|
388
|
+
type: zod_1.z.literal("direct"),
|
|
389
|
+
onboardingTool: zod_1.z.string(),
|
|
390
|
+
}),
|
|
391
|
+
]),
|
|
268
392
|
});
|
|
269
393
|
exports.DirectAuthStatusSchema = zod_1.z.object({
|
|
270
|
-
status: zod_1.z.enum([
|
|
271
|
-
config: zod_1.z
|
|
272
|
-
|
|
273
|
-
|
|
394
|
+
status: zod_1.z.enum(["complete", "authorization_pending", "not_found"]),
|
|
395
|
+
config: zod_1.z
|
|
396
|
+
.object({
|
|
397
|
+
configuredAt: zod_1.z.number(),
|
|
398
|
+
})
|
|
399
|
+
.optional(),
|
|
274
400
|
expires_in: zod_1.z.number().optional(),
|
|
275
401
|
interval: zod_1.z.number().optional(),
|
|
276
|
-
error: zod_1.z.string().optional()
|
|
402
|
+
error: zod_1.z.string().optional(),
|
|
277
403
|
});
|
|
278
404
|
exports.ExampleQuerySchema = zod_1.z.object({
|
|
279
405
|
category: zod_1.z.string(),
|
|
@@ -290,16 +416,18 @@ exports.HumanActionStepSchema = zod_1.z.object({
|
|
|
290
416
|
title: zod_1.z.string(),
|
|
291
417
|
description: zod_1.z.string().optional(),
|
|
292
418
|
requiresResponse: zod_1.z.boolean().optional(),
|
|
293
|
-
callbackUrl: zod_1.z.string().optional()
|
|
419
|
+
callbackUrl: zod_1.z.string().optional(),
|
|
294
420
|
})),
|
|
295
|
-
status: zod_1.z.enum([
|
|
296
|
-
response: zod_1.z
|
|
421
|
+
status: zod_1.z.enum(["pending", "completed", "failed", "timeout"]),
|
|
422
|
+
response: zod_1.z
|
|
423
|
+
.object({
|
|
297
424
|
actionId: zod_1.z.string(),
|
|
298
425
|
responseText: zod_1.z.string().optional(),
|
|
299
426
|
timestamp: zod_1.z.date(),
|
|
300
|
-
data: zod_1.z.any().optional()
|
|
301
|
-
})
|
|
427
|
+
data: zod_1.z.any().optional(),
|
|
428
|
+
})
|
|
429
|
+
.optional(),
|
|
302
430
|
createdAt: zod_1.z.date(),
|
|
303
|
-
timeoutAt: zod_1.z.date().optional()
|
|
431
|
+
timeoutAt: zod_1.z.date().optional(),
|
|
304
432
|
});
|
|
305
433
|
//# sourceMappingURL=types.js.map
|