opc-agent 0.1.0 → 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/CHANGELOG.md +44 -0
- package/CONTRIBUTING.md +75 -0
- package/README.md +105 -116
- package/README.zh-CN.md +58 -96
- package/dist/channels/telegram.d.ts +21 -0
- package/dist/channels/telegram.js +120 -0
- package/dist/channels/websocket.d.ts +15 -0
- package/dist/channels/websocket.js +81 -0
- package/dist/cli.js +199 -27
- package/dist/core/agent.d.ts +2 -0
- package/dist/core/agent.js +3 -1
- package/dist/core/logger.d.ts +19 -0
- package/dist/core/logger.js +50 -0
- package/dist/core/runtime.d.ts +11 -0
- package/dist/core/runtime.js +76 -0
- package/dist/index.d.ts +5 -1
- package/dist/index.js +10 -1
- package/dist/memory/deepbrain.d.ts +40 -0
- package/dist/memory/deepbrain.js +135 -0
- package/dist/schema/oad.d.ts +163 -36
- package/dist/schema/oad.js +10 -3
- package/dist/templates/code-reviewer.d.ts +41 -0
- package/dist/templates/code-reviewer.js +38 -0
- package/dist/templates/knowledge-base.d.ts +44 -0
- package/dist/templates/knowledge-base.js +35 -0
- package/dist/templates/sales-assistant.d.ts +56 -0
- package/dist/templates/sales-assistant.js +79 -0
- package/package.json +11 -2
- package/src/channels/telegram.ts +90 -0
- package/src/channels/websocket.ts +87 -0
- package/src/cli.ts +216 -32
- package/src/core/agent.ts +4 -1
- package/src/core/logger.ts +57 -0
- package/src/core/runtime.ts +79 -1
- package/src/index.ts +5 -1
- package/src/memory/deepbrain.ts +108 -0
- package/src/schema/oad.ts +10 -2
- package/src/templates/code-reviewer.ts +34 -0
- package/src/templates/knowledge-base.ts +31 -0
- package/src/templates/sales-assistant.ts +79 -0
- package/templates/code-reviewer/README.md +27 -0
- package/templates/code-reviewer/oad.yaml +41 -0
- package/templates/knowledge-base/README.md +28 -0
- package/templates/knowledge-base/oad.yaml +38 -0
- package/templates/sales-assistant/README.md +26 -0
- package/templates/sales-assistant/oad.yaml +43 -0
package/dist/schema/oad.d.ts
CHANGED
|
@@ -13,30 +13,63 @@ export declare const SkillRefSchema: z.ZodObject<{
|
|
|
13
13
|
config?: Record<string, unknown> | undefined;
|
|
14
14
|
}>;
|
|
15
15
|
export declare const ChannelSchema: z.ZodObject<{
|
|
16
|
-
type: z.ZodEnum<["web", "websocket", "cli"]>;
|
|
16
|
+
type: z.ZodEnum<["web", "websocket", "telegram", "cli"]>;
|
|
17
17
|
port: z.ZodOptional<z.ZodNumber>;
|
|
18
18
|
config: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
19
19
|
}, "strip", z.ZodTypeAny, {
|
|
20
|
-
type: "web" | "websocket" | "cli";
|
|
20
|
+
type: "web" | "websocket" | "telegram" | "cli";
|
|
21
21
|
config?: Record<string, unknown> | undefined;
|
|
22
22
|
port?: number | undefined;
|
|
23
23
|
}, {
|
|
24
|
-
type: "web" | "websocket" | "cli";
|
|
24
|
+
type: "web" | "websocket" | "telegram" | "cli";
|
|
25
25
|
config?: Record<string, unknown> | undefined;
|
|
26
26
|
port?: number | undefined;
|
|
27
27
|
}>;
|
|
28
|
+
export declare const LongTermMemorySchema: z.ZodObject<{
|
|
29
|
+
provider: z.ZodDefault<z.ZodEnum<["in-memory", "deepbrain"]>>;
|
|
30
|
+
collection: z.ZodOptional<z.ZodString>;
|
|
31
|
+
config: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
32
|
+
}, "strip", z.ZodTypeAny, {
|
|
33
|
+
provider: "in-memory" | "deepbrain";
|
|
34
|
+
config?: Record<string, unknown> | undefined;
|
|
35
|
+
collection?: string | undefined;
|
|
36
|
+
}, {
|
|
37
|
+
config?: Record<string, unknown> | undefined;
|
|
38
|
+
provider?: "in-memory" | "deepbrain" | undefined;
|
|
39
|
+
collection?: string | undefined;
|
|
40
|
+
}>;
|
|
28
41
|
export declare const MemorySchema: z.ZodObject<{
|
|
29
42
|
shortTerm: z.ZodDefault<z.ZodBoolean>;
|
|
30
|
-
longTerm: z.ZodDefault<z.ZodBoolean
|
|
43
|
+
longTerm: z.ZodDefault<z.ZodUnion<[z.ZodBoolean, z.ZodObject<{
|
|
44
|
+
provider: z.ZodDefault<z.ZodEnum<["in-memory", "deepbrain"]>>;
|
|
45
|
+
collection: z.ZodOptional<z.ZodString>;
|
|
46
|
+
config: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
47
|
+
}, "strip", z.ZodTypeAny, {
|
|
48
|
+
provider: "in-memory" | "deepbrain";
|
|
49
|
+
config?: Record<string, unknown> | undefined;
|
|
50
|
+
collection?: string | undefined;
|
|
51
|
+
}, {
|
|
52
|
+
config?: Record<string, unknown> | undefined;
|
|
53
|
+
provider?: "in-memory" | "deepbrain" | undefined;
|
|
54
|
+
collection?: string | undefined;
|
|
55
|
+
}>]>>;
|
|
31
56
|
provider: z.ZodOptional<z.ZodString>;
|
|
32
57
|
}, "strip", z.ZodTypeAny, {
|
|
33
58
|
shortTerm: boolean;
|
|
34
|
-
longTerm: boolean
|
|
59
|
+
longTerm: boolean | {
|
|
60
|
+
provider: "in-memory" | "deepbrain";
|
|
61
|
+
config?: Record<string, unknown> | undefined;
|
|
62
|
+
collection?: string | undefined;
|
|
63
|
+
};
|
|
35
64
|
provider?: string | undefined;
|
|
36
65
|
}, {
|
|
37
|
-
shortTerm?: boolean | undefined;
|
|
38
|
-
longTerm?: boolean | undefined;
|
|
39
66
|
provider?: string | undefined;
|
|
67
|
+
shortTerm?: boolean | undefined;
|
|
68
|
+
longTerm?: boolean | {
|
|
69
|
+
config?: Record<string, unknown> | undefined;
|
|
70
|
+
provider?: "in-memory" | "deepbrain" | undefined;
|
|
71
|
+
collection?: string | undefined;
|
|
72
|
+
} | undefined;
|
|
40
73
|
}>;
|
|
41
74
|
export declare const TrustLevel: z.ZodEnum<["sandbox", "verified", "certified", "listed"]>;
|
|
42
75
|
export declare const DTVSchema: z.ZodObject<{
|
|
@@ -82,12 +115,18 @@ export declare const ProviderSchema: z.ZodObject<{
|
|
|
82
115
|
export declare const MarketplaceSchema: z.ZodObject<{
|
|
83
116
|
certified: z.ZodDefault<z.ZodBoolean>;
|
|
84
117
|
category: z.ZodOptional<z.ZodString>;
|
|
118
|
+
pricing: z.ZodOptional<z.ZodEnum<["free", "freemium", "paid", "enterprise"]>>;
|
|
119
|
+
tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
85
120
|
}, "strip", z.ZodTypeAny, {
|
|
86
121
|
certified: boolean;
|
|
87
122
|
category?: string | undefined;
|
|
123
|
+
pricing?: "free" | "freemium" | "paid" | "enterprise" | undefined;
|
|
124
|
+
tags?: string[] | undefined;
|
|
88
125
|
}, {
|
|
89
126
|
certified?: boolean | undefined;
|
|
90
127
|
category?: string | undefined;
|
|
128
|
+
pricing?: "free" | "freemium" | "paid" | "enterprise" | undefined;
|
|
129
|
+
tags?: string[] | undefined;
|
|
91
130
|
}>;
|
|
92
131
|
export declare const MetadataSchema: z.ZodObject<{
|
|
93
132
|
name: z.ZodString;
|
|
@@ -98,12 +137,18 @@ export declare const MetadataSchema: z.ZodObject<{
|
|
|
98
137
|
marketplace: z.ZodOptional<z.ZodObject<{
|
|
99
138
|
certified: z.ZodDefault<z.ZodBoolean>;
|
|
100
139
|
category: z.ZodOptional<z.ZodString>;
|
|
140
|
+
pricing: z.ZodOptional<z.ZodEnum<["free", "freemium", "paid", "enterprise"]>>;
|
|
141
|
+
tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
101
142
|
}, "strip", z.ZodTypeAny, {
|
|
102
143
|
certified: boolean;
|
|
103
144
|
category?: string | undefined;
|
|
145
|
+
pricing?: "free" | "freemium" | "paid" | "enterprise" | undefined;
|
|
146
|
+
tags?: string[] | undefined;
|
|
104
147
|
}, {
|
|
105
148
|
certified?: boolean | undefined;
|
|
106
149
|
category?: string | undefined;
|
|
150
|
+
pricing?: "free" | "freemium" | "paid" | "enterprise" | undefined;
|
|
151
|
+
tags?: string[] | undefined;
|
|
107
152
|
}>>;
|
|
108
153
|
}, "strip", z.ZodTypeAny, {
|
|
109
154
|
name: string;
|
|
@@ -114,6 +159,8 @@ export declare const MetadataSchema: z.ZodObject<{
|
|
|
114
159
|
marketplace?: {
|
|
115
160
|
certified: boolean;
|
|
116
161
|
category?: string | undefined;
|
|
162
|
+
pricing?: "free" | "freemium" | "paid" | "enterprise" | undefined;
|
|
163
|
+
tags?: string[] | undefined;
|
|
117
164
|
} | undefined;
|
|
118
165
|
}, {
|
|
119
166
|
name: string;
|
|
@@ -124,6 +171,8 @@ export declare const MetadataSchema: z.ZodObject<{
|
|
|
124
171
|
marketplace?: {
|
|
125
172
|
certified?: boolean | undefined;
|
|
126
173
|
category?: string | undefined;
|
|
174
|
+
pricing?: "free" | "freemium" | "paid" | "enterprise" | undefined;
|
|
175
|
+
tags?: string[] | undefined;
|
|
127
176
|
} | undefined;
|
|
128
177
|
}>;
|
|
129
178
|
export declare const SpecSchema: z.ZodObject<{
|
|
@@ -153,30 +202,50 @@ export declare const SpecSchema: z.ZodObject<{
|
|
|
153
202
|
config?: Record<string, unknown> | undefined;
|
|
154
203
|
}>, "many">>;
|
|
155
204
|
channels: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
156
|
-
type: z.ZodEnum<["web", "websocket", "cli"]>;
|
|
205
|
+
type: z.ZodEnum<["web", "websocket", "telegram", "cli"]>;
|
|
157
206
|
port: z.ZodOptional<z.ZodNumber>;
|
|
158
207
|
config: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
159
208
|
}, "strip", z.ZodTypeAny, {
|
|
160
|
-
type: "web" | "websocket" | "cli";
|
|
209
|
+
type: "web" | "websocket" | "telegram" | "cli";
|
|
161
210
|
config?: Record<string, unknown> | undefined;
|
|
162
211
|
port?: number | undefined;
|
|
163
212
|
}, {
|
|
164
|
-
type: "web" | "websocket" | "cli";
|
|
213
|
+
type: "web" | "websocket" | "telegram" | "cli";
|
|
165
214
|
config?: Record<string, unknown> | undefined;
|
|
166
215
|
port?: number | undefined;
|
|
167
216
|
}>, "many">>;
|
|
168
217
|
memory: z.ZodOptional<z.ZodObject<{
|
|
169
218
|
shortTerm: z.ZodDefault<z.ZodBoolean>;
|
|
170
|
-
longTerm: z.ZodDefault<z.ZodBoolean
|
|
219
|
+
longTerm: z.ZodDefault<z.ZodUnion<[z.ZodBoolean, z.ZodObject<{
|
|
220
|
+
provider: z.ZodDefault<z.ZodEnum<["in-memory", "deepbrain"]>>;
|
|
221
|
+
collection: z.ZodOptional<z.ZodString>;
|
|
222
|
+
config: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
223
|
+
}, "strip", z.ZodTypeAny, {
|
|
224
|
+
provider: "in-memory" | "deepbrain";
|
|
225
|
+
config?: Record<string, unknown> | undefined;
|
|
226
|
+
collection?: string | undefined;
|
|
227
|
+
}, {
|
|
228
|
+
config?: Record<string, unknown> | undefined;
|
|
229
|
+
provider?: "in-memory" | "deepbrain" | undefined;
|
|
230
|
+
collection?: string | undefined;
|
|
231
|
+
}>]>>;
|
|
171
232
|
provider: z.ZodOptional<z.ZodString>;
|
|
172
233
|
}, "strip", z.ZodTypeAny, {
|
|
173
234
|
shortTerm: boolean;
|
|
174
|
-
longTerm: boolean
|
|
235
|
+
longTerm: boolean | {
|
|
236
|
+
provider: "in-memory" | "deepbrain";
|
|
237
|
+
config?: Record<string, unknown> | undefined;
|
|
238
|
+
collection?: string | undefined;
|
|
239
|
+
};
|
|
175
240
|
provider?: string | undefined;
|
|
176
241
|
}, {
|
|
177
|
-
shortTerm?: boolean | undefined;
|
|
178
|
-
longTerm?: boolean | undefined;
|
|
179
242
|
provider?: string | undefined;
|
|
243
|
+
shortTerm?: boolean | undefined;
|
|
244
|
+
longTerm?: boolean | {
|
|
245
|
+
config?: Record<string, unknown> | undefined;
|
|
246
|
+
provider?: "in-memory" | "deepbrain" | undefined;
|
|
247
|
+
collection?: string | undefined;
|
|
248
|
+
} | undefined;
|
|
180
249
|
}>>;
|
|
181
250
|
dtv: z.ZodOptional<z.ZodObject<{
|
|
182
251
|
trust: z.ZodOptional<z.ZodObject<{
|
|
@@ -216,7 +285,7 @@ export declare const SpecSchema: z.ZodObject<{
|
|
|
216
285
|
config?: Record<string, unknown> | undefined;
|
|
217
286
|
}[];
|
|
218
287
|
channels: {
|
|
219
|
-
type: "web" | "websocket" | "cli";
|
|
288
|
+
type: "web" | "websocket" | "telegram" | "cli";
|
|
220
289
|
config?: Record<string, unknown> | undefined;
|
|
221
290
|
port?: number | undefined;
|
|
222
291
|
}[];
|
|
@@ -227,7 +296,11 @@ export declare const SpecSchema: z.ZodObject<{
|
|
|
227
296
|
systemPrompt?: string | undefined;
|
|
228
297
|
memory?: {
|
|
229
298
|
shortTerm: boolean;
|
|
230
|
-
longTerm: boolean
|
|
299
|
+
longTerm: boolean | {
|
|
300
|
+
provider: "in-memory" | "deepbrain";
|
|
301
|
+
config?: Record<string, unknown> | undefined;
|
|
302
|
+
collection?: string | undefined;
|
|
303
|
+
};
|
|
231
304
|
provider?: string | undefined;
|
|
232
305
|
} | undefined;
|
|
233
306
|
dtv?: {
|
|
@@ -251,14 +324,18 @@ export declare const SpecSchema: z.ZodObject<{
|
|
|
251
324
|
config?: Record<string, unknown> | undefined;
|
|
252
325
|
}[] | undefined;
|
|
253
326
|
channels?: {
|
|
254
|
-
type: "web" | "websocket" | "cli";
|
|
327
|
+
type: "web" | "websocket" | "telegram" | "cli";
|
|
255
328
|
config?: Record<string, unknown> | undefined;
|
|
256
329
|
port?: number | undefined;
|
|
257
330
|
}[] | undefined;
|
|
258
331
|
memory?: {
|
|
259
|
-
shortTerm?: boolean | undefined;
|
|
260
|
-
longTerm?: boolean | undefined;
|
|
261
332
|
provider?: string | undefined;
|
|
333
|
+
shortTerm?: boolean | undefined;
|
|
334
|
+
longTerm?: boolean | {
|
|
335
|
+
config?: Record<string, unknown> | undefined;
|
|
336
|
+
provider?: "in-memory" | "deepbrain" | undefined;
|
|
337
|
+
collection?: string | undefined;
|
|
338
|
+
} | undefined;
|
|
262
339
|
} | undefined;
|
|
263
340
|
dtv?: {
|
|
264
341
|
value?: {
|
|
@@ -281,12 +358,18 @@ export declare const OADSchema: z.ZodObject<{
|
|
|
281
358
|
marketplace: z.ZodOptional<z.ZodObject<{
|
|
282
359
|
certified: z.ZodDefault<z.ZodBoolean>;
|
|
283
360
|
category: z.ZodOptional<z.ZodString>;
|
|
361
|
+
pricing: z.ZodOptional<z.ZodEnum<["free", "freemium", "paid", "enterprise"]>>;
|
|
362
|
+
tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
284
363
|
}, "strip", z.ZodTypeAny, {
|
|
285
364
|
certified: boolean;
|
|
286
365
|
category?: string | undefined;
|
|
366
|
+
pricing?: "free" | "freemium" | "paid" | "enterprise" | undefined;
|
|
367
|
+
tags?: string[] | undefined;
|
|
287
368
|
}, {
|
|
288
369
|
certified?: boolean | undefined;
|
|
289
370
|
category?: string | undefined;
|
|
371
|
+
pricing?: "free" | "freemium" | "paid" | "enterprise" | undefined;
|
|
372
|
+
tags?: string[] | undefined;
|
|
290
373
|
}>>;
|
|
291
374
|
}, "strip", z.ZodTypeAny, {
|
|
292
375
|
name: string;
|
|
@@ -297,6 +380,8 @@ export declare const OADSchema: z.ZodObject<{
|
|
|
297
380
|
marketplace?: {
|
|
298
381
|
certified: boolean;
|
|
299
382
|
category?: string | undefined;
|
|
383
|
+
pricing?: "free" | "freemium" | "paid" | "enterprise" | undefined;
|
|
384
|
+
tags?: string[] | undefined;
|
|
300
385
|
} | undefined;
|
|
301
386
|
}, {
|
|
302
387
|
name: string;
|
|
@@ -307,6 +392,8 @@ export declare const OADSchema: z.ZodObject<{
|
|
|
307
392
|
marketplace?: {
|
|
308
393
|
certified?: boolean | undefined;
|
|
309
394
|
category?: string | undefined;
|
|
395
|
+
pricing?: "free" | "freemium" | "paid" | "enterprise" | undefined;
|
|
396
|
+
tags?: string[] | undefined;
|
|
310
397
|
} | undefined;
|
|
311
398
|
}>;
|
|
312
399
|
spec: z.ZodObject<{
|
|
@@ -336,30 +423,50 @@ export declare const OADSchema: z.ZodObject<{
|
|
|
336
423
|
config?: Record<string, unknown> | undefined;
|
|
337
424
|
}>, "many">>;
|
|
338
425
|
channels: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
339
|
-
type: z.ZodEnum<["web", "websocket", "cli"]>;
|
|
426
|
+
type: z.ZodEnum<["web", "websocket", "telegram", "cli"]>;
|
|
340
427
|
port: z.ZodOptional<z.ZodNumber>;
|
|
341
428
|
config: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
342
429
|
}, "strip", z.ZodTypeAny, {
|
|
343
|
-
type: "web" | "websocket" | "cli";
|
|
430
|
+
type: "web" | "websocket" | "telegram" | "cli";
|
|
344
431
|
config?: Record<string, unknown> | undefined;
|
|
345
432
|
port?: number | undefined;
|
|
346
433
|
}, {
|
|
347
|
-
type: "web" | "websocket" | "cli";
|
|
434
|
+
type: "web" | "websocket" | "telegram" | "cli";
|
|
348
435
|
config?: Record<string, unknown> | undefined;
|
|
349
436
|
port?: number | undefined;
|
|
350
437
|
}>, "many">>;
|
|
351
438
|
memory: z.ZodOptional<z.ZodObject<{
|
|
352
439
|
shortTerm: z.ZodDefault<z.ZodBoolean>;
|
|
353
|
-
longTerm: z.ZodDefault<z.ZodBoolean
|
|
440
|
+
longTerm: z.ZodDefault<z.ZodUnion<[z.ZodBoolean, z.ZodObject<{
|
|
441
|
+
provider: z.ZodDefault<z.ZodEnum<["in-memory", "deepbrain"]>>;
|
|
442
|
+
collection: z.ZodOptional<z.ZodString>;
|
|
443
|
+
config: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
444
|
+
}, "strip", z.ZodTypeAny, {
|
|
445
|
+
provider: "in-memory" | "deepbrain";
|
|
446
|
+
config?: Record<string, unknown> | undefined;
|
|
447
|
+
collection?: string | undefined;
|
|
448
|
+
}, {
|
|
449
|
+
config?: Record<string, unknown> | undefined;
|
|
450
|
+
provider?: "in-memory" | "deepbrain" | undefined;
|
|
451
|
+
collection?: string | undefined;
|
|
452
|
+
}>]>>;
|
|
354
453
|
provider: z.ZodOptional<z.ZodString>;
|
|
355
454
|
}, "strip", z.ZodTypeAny, {
|
|
356
455
|
shortTerm: boolean;
|
|
357
|
-
longTerm: boolean
|
|
456
|
+
longTerm: boolean | {
|
|
457
|
+
provider: "in-memory" | "deepbrain";
|
|
458
|
+
config?: Record<string, unknown> | undefined;
|
|
459
|
+
collection?: string | undefined;
|
|
460
|
+
};
|
|
358
461
|
provider?: string | undefined;
|
|
359
462
|
}, {
|
|
360
|
-
shortTerm?: boolean | undefined;
|
|
361
|
-
longTerm?: boolean | undefined;
|
|
362
463
|
provider?: string | undefined;
|
|
464
|
+
shortTerm?: boolean | undefined;
|
|
465
|
+
longTerm?: boolean | {
|
|
466
|
+
config?: Record<string, unknown> | undefined;
|
|
467
|
+
provider?: "in-memory" | "deepbrain" | undefined;
|
|
468
|
+
collection?: string | undefined;
|
|
469
|
+
} | undefined;
|
|
363
470
|
}>>;
|
|
364
471
|
dtv: z.ZodOptional<z.ZodObject<{
|
|
365
472
|
trust: z.ZodOptional<z.ZodObject<{
|
|
@@ -399,7 +506,7 @@ export declare const OADSchema: z.ZodObject<{
|
|
|
399
506
|
config?: Record<string, unknown> | undefined;
|
|
400
507
|
}[];
|
|
401
508
|
channels: {
|
|
402
|
-
type: "web" | "websocket" | "cli";
|
|
509
|
+
type: "web" | "websocket" | "telegram" | "cli";
|
|
403
510
|
config?: Record<string, unknown> | undefined;
|
|
404
511
|
port?: number | undefined;
|
|
405
512
|
}[];
|
|
@@ -410,7 +517,11 @@ export declare const OADSchema: z.ZodObject<{
|
|
|
410
517
|
systemPrompt?: string | undefined;
|
|
411
518
|
memory?: {
|
|
412
519
|
shortTerm: boolean;
|
|
413
|
-
longTerm: boolean
|
|
520
|
+
longTerm: boolean | {
|
|
521
|
+
provider: "in-memory" | "deepbrain";
|
|
522
|
+
config?: Record<string, unknown> | undefined;
|
|
523
|
+
collection?: string | undefined;
|
|
524
|
+
};
|
|
414
525
|
provider?: string | undefined;
|
|
415
526
|
} | undefined;
|
|
416
527
|
dtv?: {
|
|
@@ -434,14 +545,18 @@ export declare const OADSchema: z.ZodObject<{
|
|
|
434
545
|
config?: Record<string, unknown> | undefined;
|
|
435
546
|
}[] | undefined;
|
|
436
547
|
channels?: {
|
|
437
|
-
type: "web" | "websocket" | "cli";
|
|
548
|
+
type: "web" | "websocket" | "telegram" | "cli";
|
|
438
549
|
config?: Record<string, unknown> | undefined;
|
|
439
550
|
port?: number | undefined;
|
|
440
551
|
}[] | undefined;
|
|
441
552
|
memory?: {
|
|
442
|
-
shortTerm?: boolean | undefined;
|
|
443
|
-
longTerm?: boolean | undefined;
|
|
444
553
|
provider?: string | undefined;
|
|
554
|
+
shortTerm?: boolean | undefined;
|
|
555
|
+
longTerm?: boolean | {
|
|
556
|
+
config?: Record<string, unknown> | undefined;
|
|
557
|
+
provider?: "in-memory" | "deepbrain" | undefined;
|
|
558
|
+
collection?: string | undefined;
|
|
559
|
+
} | undefined;
|
|
445
560
|
} | undefined;
|
|
446
561
|
dtv?: {
|
|
447
562
|
value?: {
|
|
@@ -464,6 +579,8 @@ export declare const OADSchema: z.ZodObject<{
|
|
|
464
579
|
marketplace?: {
|
|
465
580
|
certified: boolean;
|
|
466
581
|
category?: string | undefined;
|
|
582
|
+
pricing?: "free" | "freemium" | "paid" | "enterprise" | undefined;
|
|
583
|
+
tags?: string[] | undefined;
|
|
467
584
|
} | undefined;
|
|
468
585
|
};
|
|
469
586
|
spec: {
|
|
@@ -474,7 +591,7 @@ export declare const OADSchema: z.ZodObject<{
|
|
|
474
591
|
config?: Record<string, unknown> | undefined;
|
|
475
592
|
}[];
|
|
476
593
|
channels: {
|
|
477
|
-
type: "web" | "websocket" | "cli";
|
|
594
|
+
type: "web" | "websocket" | "telegram" | "cli";
|
|
478
595
|
config?: Record<string, unknown> | undefined;
|
|
479
596
|
port?: number | undefined;
|
|
480
597
|
}[];
|
|
@@ -485,7 +602,11 @@ export declare const OADSchema: z.ZodObject<{
|
|
|
485
602
|
systemPrompt?: string | undefined;
|
|
486
603
|
memory?: {
|
|
487
604
|
shortTerm: boolean;
|
|
488
|
-
longTerm: boolean
|
|
605
|
+
longTerm: boolean | {
|
|
606
|
+
provider: "in-memory" | "deepbrain";
|
|
607
|
+
config?: Record<string, unknown> | undefined;
|
|
608
|
+
collection?: string | undefined;
|
|
609
|
+
};
|
|
489
610
|
provider?: string | undefined;
|
|
490
611
|
} | undefined;
|
|
491
612
|
dtv?: {
|
|
@@ -509,6 +630,8 @@ export declare const OADSchema: z.ZodObject<{
|
|
|
509
630
|
marketplace?: {
|
|
510
631
|
certified?: boolean | undefined;
|
|
511
632
|
category?: string | undefined;
|
|
633
|
+
pricing?: "free" | "freemium" | "paid" | "enterprise" | undefined;
|
|
634
|
+
tags?: string[] | undefined;
|
|
512
635
|
} | undefined;
|
|
513
636
|
};
|
|
514
637
|
spec: {
|
|
@@ -524,14 +647,18 @@ export declare const OADSchema: z.ZodObject<{
|
|
|
524
647
|
config?: Record<string, unknown> | undefined;
|
|
525
648
|
}[] | undefined;
|
|
526
649
|
channels?: {
|
|
527
|
-
type: "web" | "websocket" | "cli";
|
|
650
|
+
type: "web" | "websocket" | "telegram" | "cli";
|
|
528
651
|
config?: Record<string, unknown> | undefined;
|
|
529
652
|
port?: number | undefined;
|
|
530
653
|
}[] | undefined;
|
|
531
654
|
memory?: {
|
|
532
|
-
shortTerm?: boolean | undefined;
|
|
533
|
-
longTerm?: boolean | undefined;
|
|
534
655
|
provider?: string | undefined;
|
|
656
|
+
shortTerm?: boolean | undefined;
|
|
657
|
+
longTerm?: boolean | {
|
|
658
|
+
config?: Record<string, unknown> | undefined;
|
|
659
|
+
provider?: "in-memory" | "deepbrain" | undefined;
|
|
660
|
+
collection?: string | undefined;
|
|
661
|
+
} | undefined;
|
|
535
662
|
} | undefined;
|
|
536
663
|
dtv?: {
|
|
537
664
|
value?: {
|
package/dist/schema/oad.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.OADSchema = exports.SpecSchema = exports.MetadataSchema = exports.MarketplaceSchema = exports.ProviderSchema = exports.DTVSchema = exports.TrustLevel = exports.MemorySchema = exports.ChannelSchema = exports.SkillRefSchema = void 0;
|
|
3
|
+
exports.OADSchema = exports.SpecSchema = exports.MetadataSchema = exports.MarketplaceSchema = exports.ProviderSchema = exports.DTVSchema = exports.TrustLevel = exports.MemorySchema = exports.LongTermMemorySchema = exports.ChannelSchema = exports.SkillRefSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
// ─── OAD Schema v1 ───────────────────────────────────────────
|
|
6
6
|
exports.SkillRefSchema = zod_1.z.object({
|
|
@@ -9,13 +9,18 @@ exports.SkillRefSchema = zod_1.z.object({
|
|
|
9
9
|
config: zod_1.z.record(zod_1.z.unknown()).optional(),
|
|
10
10
|
});
|
|
11
11
|
exports.ChannelSchema = zod_1.z.object({
|
|
12
|
-
type: zod_1.z.enum(['web', 'websocket', 'cli']),
|
|
12
|
+
type: zod_1.z.enum(['web', 'websocket', 'telegram', 'cli']),
|
|
13
13
|
port: zod_1.z.number().optional(),
|
|
14
14
|
config: zod_1.z.record(zod_1.z.unknown()).optional(),
|
|
15
15
|
});
|
|
16
|
+
exports.LongTermMemorySchema = zod_1.z.object({
|
|
17
|
+
provider: zod_1.z.enum(['in-memory', 'deepbrain']).default('in-memory'),
|
|
18
|
+
collection: zod_1.z.string().optional(),
|
|
19
|
+
config: zod_1.z.record(zod_1.z.unknown()).optional(),
|
|
20
|
+
});
|
|
16
21
|
exports.MemorySchema = zod_1.z.object({
|
|
17
22
|
shortTerm: zod_1.z.boolean().default(true),
|
|
18
|
-
longTerm: zod_1.z.boolean().default(false),
|
|
23
|
+
longTerm: zod_1.z.union([zod_1.z.boolean(), exports.LongTermMemorySchema]).default(false),
|
|
19
24
|
provider: zod_1.z.string().optional(),
|
|
20
25
|
});
|
|
21
26
|
exports.TrustLevel = zod_1.z.enum(['sandbox', 'verified', 'certified', 'listed']);
|
|
@@ -34,6 +39,8 @@ exports.ProviderSchema = zod_1.z.object({
|
|
|
34
39
|
exports.MarketplaceSchema = zod_1.z.object({
|
|
35
40
|
certified: zod_1.z.boolean().default(false),
|
|
36
41
|
category: zod_1.z.string().optional(),
|
|
42
|
+
pricing: zod_1.z.enum(['free', 'freemium', 'paid', 'enterprise']).optional(),
|
|
43
|
+
tags: zod_1.z.array(zod_1.z.string()).optional(),
|
|
37
44
|
});
|
|
38
45
|
exports.MetadataSchema = zod_1.z.object({
|
|
39
46
|
name: zod_1.z.string(),
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
export declare const CODE_REVIEWER_SYSTEM_PROMPT = "You are an expert code reviewer. When given code:\n1. Check for bugs, security issues, and performance problems\n2. Suggest improvements for readability and maintainability\n3. Follow language-specific best practices\n4. Be constructive and explain your reasoning\nRate severity: \uD83D\uDD34 Critical | \uD83D\uDFE1 Warning | \uD83D\uDD35 Info";
|
|
2
|
+
export declare function createCodeReviewerConfig(): {
|
|
3
|
+
apiVersion: "opc/v1";
|
|
4
|
+
kind: "Agent";
|
|
5
|
+
metadata: {
|
|
6
|
+
name: string;
|
|
7
|
+
version: string;
|
|
8
|
+
description: string;
|
|
9
|
+
author: string;
|
|
10
|
+
license: string;
|
|
11
|
+
};
|
|
12
|
+
spec: {
|
|
13
|
+
provider: {
|
|
14
|
+
default: string;
|
|
15
|
+
allowed: string[];
|
|
16
|
+
};
|
|
17
|
+
model: string;
|
|
18
|
+
systemPrompt: string;
|
|
19
|
+
skills: {
|
|
20
|
+
name: string;
|
|
21
|
+
description: string;
|
|
22
|
+
}[];
|
|
23
|
+
channels: {
|
|
24
|
+
type: "web";
|
|
25
|
+
port: number;
|
|
26
|
+
}[];
|
|
27
|
+
memory: {
|
|
28
|
+
shortTerm: boolean;
|
|
29
|
+
longTerm: boolean;
|
|
30
|
+
};
|
|
31
|
+
dtv: {
|
|
32
|
+
trust: {
|
|
33
|
+
level: "sandbox";
|
|
34
|
+
};
|
|
35
|
+
value: {
|
|
36
|
+
metrics: string[];
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
//# sourceMappingURL=code-reviewer.d.ts.map
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CODE_REVIEWER_SYSTEM_PROMPT = void 0;
|
|
4
|
+
exports.createCodeReviewerConfig = createCodeReviewerConfig;
|
|
5
|
+
exports.CODE_REVIEWER_SYSTEM_PROMPT = `You are an expert code reviewer. When given code:
|
|
6
|
+
1. Check for bugs, security issues, and performance problems
|
|
7
|
+
2. Suggest improvements for readability and maintainability
|
|
8
|
+
3. Follow language-specific best practices
|
|
9
|
+
4. Be constructive and explain your reasoning
|
|
10
|
+
Rate severity: 🔴 Critical | 🟡 Warning | 🔵 Info`;
|
|
11
|
+
function createCodeReviewerConfig() {
|
|
12
|
+
return {
|
|
13
|
+
apiVersion: 'opc/v1',
|
|
14
|
+
kind: 'Agent',
|
|
15
|
+
metadata: {
|
|
16
|
+
name: 'code-reviewer',
|
|
17
|
+
version: '1.0.0',
|
|
18
|
+
description: 'AI code reviewer that reviews code and suggests improvements',
|
|
19
|
+
author: 'OPC Agent',
|
|
20
|
+
license: 'Apache-2.0',
|
|
21
|
+
},
|
|
22
|
+
spec: {
|
|
23
|
+
provider: { default: 'deepseek', allowed: ['openai', 'deepseek', 'qwen'] },
|
|
24
|
+
model: 'deepseek-chat',
|
|
25
|
+
systemPrompt: exports.CODE_REVIEWER_SYSTEM_PROMPT,
|
|
26
|
+
skills: [
|
|
27
|
+
{ name: 'code-analysis', description: 'Analyze code for bugs' },
|
|
28
|
+
],
|
|
29
|
+
channels: [{ type: 'web', port: 3000 }],
|
|
30
|
+
memory: { shortTerm: true, longTerm: false },
|
|
31
|
+
dtv: {
|
|
32
|
+
trust: { level: 'sandbox' },
|
|
33
|
+
value: { metrics: ['reviews_completed', 'issues_found'] },
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=code-reviewer.js.map
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
export declare const KNOWLEDGE_BASE_SYSTEM_PROMPT = "You are a knowledge base assistant. Answer questions using the company documents\nand knowledge provided to you. If you don't have enough information, say so honestly.\nAlways cite sources when possible. Be accurate and concise.";
|
|
2
|
+
export declare function createKnowledgeBaseConfig(): {
|
|
3
|
+
apiVersion: "opc/v1";
|
|
4
|
+
kind: "Agent";
|
|
5
|
+
metadata: {
|
|
6
|
+
name: string;
|
|
7
|
+
version: string;
|
|
8
|
+
description: string;
|
|
9
|
+
author: string;
|
|
10
|
+
license: string;
|
|
11
|
+
};
|
|
12
|
+
spec: {
|
|
13
|
+
provider: {
|
|
14
|
+
default: string;
|
|
15
|
+
allowed: string[];
|
|
16
|
+
};
|
|
17
|
+
model: string;
|
|
18
|
+
systemPrompt: string;
|
|
19
|
+
skills: {
|
|
20
|
+
name: string;
|
|
21
|
+
description: string;
|
|
22
|
+
}[];
|
|
23
|
+
channels: {
|
|
24
|
+
type: "web";
|
|
25
|
+
port: number;
|
|
26
|
+
}[];
|
|
27
|
+
memory: {
|
|
28
|
+
shortTerm: boolean;
|
|
29
|
+
longTerm: {
|
|
30
|
+
provider: "deepbrain";
|
|
31
|
+
collection: string;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
dtv: {
|
|
35
|
+
trust: {
|
|
36
|
+
level: "sandbox";
|
|
37
|
+
};
|
|
38
|
+
value: {
|
|
39
|
+
metrics: string[];
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
//# sourceMappingURL=knowledge-base.d.ts.map
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.KNOWLEDGE_BASE_SYSTEM_PROMPT = void 0;
|
|
4
|
+
exports.createKnowledgeBaseConfig = createKnowledgeBaseConfig;
|
|
5
|
+
exports.KNOWLEDGE_BASE_SYSTEM_PROMPT = `You are a knowledge base assistant. Answer questions using the company documents
|
|
6
|
+
and knowledge provided to you. If you don't have enough information, say so honestly.
|
|
7
|
+
Always cite sources when possible. Be accurate and concise.`;
|
|
8
|
+
function createKnowledgeBaseConfig() {
|
|
9
|
+
return {
|
|
10
|
+
apiVersion: 'opc/v1',
|
|
11
|
+
kind: 'Agent',
|
|
12
|
+
metadata: {
|
|
13
|
+
name: 'knowledge-base',
|
|
14
|
+
version: '1.0.0',
|
|
15
|
+
description: 'RAG-powered knowledge base agent using DeepBrain for semantic search',
|
|
16
|
+
author: 'OPC Agent',
|
|
17
|
+
license: 'Apache-2.0',
|
|
18
|
+
},
|
|
19
|
+
spec: {
|
|
20
|
+
provider: { default: 'deepseek', allowed: ['openai', 'deepseek', 'qwen'] },
|
|
21
|
+
model: 'deepseek-chat',
|
|
22
|
+
systemPrompt: exports.KNOWLEDGE_BASE_SYSTEM_PROMPT,
|
|
23
|
+
skills: [
|
|
24
|
+
{ name: 'doc-search', description: 'Search company documents' },
|
|
25
|
+
],
|
|
26
|
+
channels: [{ type: 'web', port: 3000 }],
|
|
27
|
+
memory: { shortTerm: true, longTerm: { provider: 'deepbrain', collection: 'company-knowledge' } },
|
|
28
|
+
dtv: {
|
|
29
|
+
trust: { level: 'sandbox' },
|
|
30
|
+
value: { metrics: ['queries_answered', 'docs_indexed'] },
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=knowledge-base.js.map
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { BaseSkill } from '../skills/base';
|
|
2
|
+
import type { AgentContext, Message, SkillResult } from '../core/types';
|
|
3
|
+
export declare class ProductQASkill extends BaseSkill {
|
|
4
|
+
name: string;
|
|
5
|
+
description: string;
|
|
6
|
+
private catalog;
|
|
7
|
+
constructor(catalog?: Record<string, string>);
|
|
8
|
+
execute(_context: AgentContext, message: Message): Promise<SkillResult>;
|
|
9
|
+
}
|
|
10
|
+
export declare class LeadCaptureSkill extends BaseSkill {
|
|
11
|
+
name: string;
|
|
12
|
+
description: string;
|
|
13
|
+
private emailRegex;
|
|
14
|
+
execute(context: AgentContext, message: Message): Promise<SkillResult>;
|
|
15
|
+
}
|
|
16
|
+
export declare const SALES_ASSISTANT_SYSTEM_PROMPT = "You are a professional sales assistant. Your goals:\n1. Answer product questions accurately and enthusiastically\n2. Capture leads by collecting name, email, and company info\n3. Book appointments when prospects are ready\nBe friendly, persuasive but not pushy. Always provide value first.";
|
|
17
|
+
export declare function createSalesAssistantConfig(): {
|
|
18
|
+
apiVersion: "opc/v1";
|
|
19
|
+
kind: "Agent";
|
|
20
|
+
metadata: {
|
|
21
|
+
name: string;
|
|
22
|
+
version: string;
|
|
23
|
+
description: string;
|
|
24
|
+
author: string;
|
|
25
|
+
license: string;
|
|
26
|
+
};
|
|
27
|
+
spec: {
|
|
28
|
+
provider: {
|
|
29
|
+
default: string;
|
|
30
|
+
allowed: string[];
|
|
31
|
+
};
|
|
32
|
+
model: string;
|
|
33
|
+
systemPrompt: string;
|
|
34
|
+
skills: {
|
|
35
|
+
name: string;
|
|
36
|
+
description: string;
|
|
37
|
+
}[];
|
|
38
|
+
channels: {
|
|
39
|
+
type: "web";
|
|
40
|
+
port: number;
|
|
41
|
+
}[];
|
|
42
|
+
memory: {
|
|
43
|
+
shortTerm: boolean;
|
|
44
|
+
longTerm: boolean;
|
|
45
|
+
};
|
|
46
|
+
dtv: {
|
|
47
|
+
trust: {
|
|
48
|
+
level: "sandbox";
|
|
49
|
+
};
|
|
50
|
+
value: {
|
|
51
|
+
metrics: string[];
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
//# sourceMappingURL=sales-assistant.d.ts.map
|