opc-agent 0.2.0 → 0.3.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/analytics/index.d.ts +31 -0
- package/dist/analytics/index.js +52 -0
- package/dist/cli.js +66 -4
- package/dist/core/room.d.ts +24 -0
- package/dist/core/room.js +97 -0
- package/dist/core/sandbox.d.ts +28 -0
- package/dist/core/sandbox.js +118 -0
- package/dist/i18n/index.d.ts +13 -0
- package/dist/i18n/index.js +73 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.js +19 -1
- package/dist/plugins/index.d.ts +47 -0
- package/dist/plugins/index.js +59 -0
- package/dist/schema/oad.d.ts +131 -0
- package/dist/schema/oad.js +13 -1
- package/dist/templates/content-writer.d.ts +36 -0
- package/dist/templates/content-writer.js +52 -0
- package/dist/templates/hr-recruiter.d.ts +36 -0
- package/dist/templates/hr-recruiter.js +52 -0
- package/dist/templates/project-manager.d.ts +36 -0
- package/dist/templates/project-manager.js +52 -0
- package/dist/tools/mcp.d.ts +32 -0
- package/dist/tools/mcp.js +49 -0
- package/package.json +1 -1
- package/src/analytics/index.ts +66 -0
- package/src/cli.ts +76 -7
- package/src/core/room.ts +109 -0
- package/src/core/sandbox.ts +101 -0
- package/src/i18n/index.ts +79 -0
- package/src/index.ts +14 -0
- package/src/plugins/index.ts +87 -0
- package/src/schema/oad.ts +14 -0
- package/src/templates/content-writer.ts +58 -0
- package/src/templates/hr-recruiter.ts +58 -0
- package/src/templates/project-manager.ts +58 -0
- package/src/tools/mcp.ts +76 -0
- package/tests/analytics.test.ts +50 -0
- package/tests/i18n.test.ts +41 -0
- package/tests/mcp.test.ts +54 -0
- package/tests/plugin.test.ts +74 -0
- package/tests/room.test.ts +106 -0
- package/tests/sandbox.test.ts +46 -0
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PluginManager = void 0;
|
|
4
|
+
class PluginManager {
|
|
5
|
+
plugins = new Map();
|
|
6
|
+
register(plugin) {
|
|
7
|
+
this.plugins.set(plugin.name, plugin);
|
|
8
|
+
}
|
|
9
|
+
unregister(name) {
|
|
10
|
+
this.plugins.delete(name);
|
|
11
|
+
}
|
|
12
|
+
get(name) {
|
|
13
|
+
return this.plugins.get(name);
|
|
14
|
+
}
|
|
15
|
+
list() {
|
|
16
|
+
return Array.from(this.plugins.values()).map(({ name, version, description }) => ({
|
|
17
|
+
name,
|
|
18
|
+
version,
|
|
19
|
+
description,
|
|
20
|
+
}));
|
|
21
|
+
}
|
|
22
|
+
has(name) {
|
|
23
|
+
return this.plugins.has(name);
|
|
24
|
+
}
|
|
25
|
+
async runHook(hookName, ...args) {
|
|
26
|
+
for (const plugin of this.plugins.values()) {
|
|
27
|
+
const hook = plugin.hooks?.[hookName];
|
|
28
|
+
if (hook) {
|
|
29
|
+
await hook(...args);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
getAllSkills() {
|
|
34
|
+
const skills = [];
|
|
35
|
+
for (const plugin of this.plugins.values()) {
|
|
36
|
+
if (plugin.skills)
|
|
37
|
+
skills.push(...plugin.skills);
|
|
38
|
+
}
|
|
39
|
+
return skills;
|
|
40
|
+
}
|
|
41
|
+
getAllTools() {
|
|
42
|
+
const tools = [];
|
|
43
|
+
for (const plugin of this.plugins.values()) {
|
|
44
|
+
if (plugin.tools)
|
|
45
|
+
tools.push(...plugin.tools);
|
|
46
|
+
}
|
|
47
|
+
return tools;
|
|
48
|
+
}
|
|
49
|
+
getAllChannels() {
|
|
50
|
+
const channels = [];
|
|
51
|
+
for (const plugin of this.plugins.values()) {
|
|
52
|
+
if (plugin.channels)
|
|
53
|
+
channels.push(...plugin.channels);
|
|
54
|
+
}
|
|
55
|
+
return channels;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
exports.PluginManager = PluginManager;
|
|
59
|
+
//# sourceMappingURL=index.js.map
|
package/dist/schema/oad.d.ts
CHANGED
|
@@ -175,6 +175,29 @@ export declare const MetadataSchema: z.ZodObject<{
|
|
|
175
175
|
tags?: string[] | undefined;
|
|
176
176
|
} | undefined;
|
|
177
177
|
}>;
|
|
178
|
+
export declare const RoomSchema: z.ZodObject<{
|
|
179
|
+
name: z.ZodString;
|
|
180
|
+
agents: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
181
|
+
topics: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
182
|
+
}, "strip", z.ZodTypeAny, {
|
|
183
|
+
name: string;
|
|
184
|
+
agents: string[];
|
|
185
|
+
topics: string[];
|
|
186
|
+
}, {
|
|
187
|
+
name: string;
|
|
188
|
+
agents?: string[] | undefined;
|
|
189
|
+
topics?: string[] | undefined;
|
|
190
|
+
}>;
|
|
191
|
+
export declare const StreamingSchema: z.ZodObject<{
|
|
192
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
193
|
+
chunkSize: z.ZodOptional<z.ZodNumber>;
|
|
194
|
+
}, "strip", z.ZodTypeAny, {
|
|
195
|
+
enabled: boolean;
|
|
196
|
+
chunkSize?: number | undefined;
|
|
197
|
+
}, {
|
|
198
|
+
enabled?: boolean | undefined;
|
|
199
|
+
chunkSize?: number | undefined;
|
|
200
|
+
}>;
|
|
178
201
|
export declare const SpecSchema: z.ZodObject<{
|
|
179
202
|
provider: z.ZodOptional<z.ZodObject<{
|
|
180
203
|
default: z.ZodDefault<z.ZodString>;
|
|
@@ -277,6 +300,30 @@ export declare const SpecSchema: z.ZodObject<{
|
|
|
277
300
|
level?: "sandbox" | "verified" | "certified" | "listed" | undefined;
|
|
278
301
|
} | undefined;
|
|
279
302
|
}>>;
|
|
303
|
+
room: z.ZodOptional<z.ZodObject<{
|
|
304
|
+
name: z.ZodString;
|
|
305
|
+
agents: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
306
|
+
topics: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
307
|
+
}, "strip", z.ZodTypeAny, {
|
|
308
|
+
name: string;
|
|
309
|
+
agents: string[];
|
|
310
|
+
topics: string[];
|
|
311
|
+
}, {
|
|
312
|
+
name: string;
|
|
313
|
+
agents?: string[] | undefined;
|
|
314
|
+
topics?: string[] | undefined;
|
|
315
|
+
}>>;
|
|
316
|
+
streaming: z.ZodDefault<z.ZodUnion<[z.ZodBoolean, z.ZodObject<{
|
|
317
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
318
|
+
chunkSize: z.ZodOptional<z.ZodNumber>;
|
|
319
|
+
}, "strip", z.ZodTypeAny, {
|
|
320
|
+
enabled: boolean;
|
|
321
|
+
chunkSize?: number | undefined;
|
|
322
|
+
}, {
|
|
323
|
+
enabled?: boolean | undefined;
|
|
324
|
+
chunkSize?: number | undefined;
|
|
325
|
+
}>]>>;
|
|
326
|
+
locale: z.ZodOptional<z.ZodEnum<["en", "zh-CN"]>>;
|
|
280
327
|
}, "strip", z.ZodTypeAny, {
|
|
281
328
|
model: string;
|
|
282
329
|
skills: {
|
|
@@ -289,6 +336,10 @@ export declare const SpecSchema: z.ZodObject<{
|
|
|
289
336
|
config?: Record<string, unknown> | undefined;
|
|
290
337
|
port?: number | undefined;
|
|
291
338
|
}[];
|
|
339
|
+
streaming: boolean | {
|
|
340
|
+
enabled: boolean;
|
|
341
|
+
chunkSize?: number | undefined;
|
|
342
|
+
};
|
|
292
343
|
provider?: {
|
|
293
344
|
default: string;
|
|
294
345
|
allowed: string[];
|
|
@@ -311,6 +362,12 @@ export declare const SpecSchema: z.ZodObject<{
|
|
|
311
362
|
level: "sandbox" | "verified" | "certified" | "listed";
|
|
312
363
|
} | undefined;
|
|
313
364
|
} | undefined;
|
|
365
|
+
room?: {
|
|
366
|
+
name: string;
|
|
367
|
+
agents: string[];
|
|
368
|
+
topics: string[];
|
|
369
|
+
} | undefined;
|
|
370
|
+
locale?: "en" | "zh-CN" | undefined;
|
|
314
371
|
}, {
|
|
315
372
|
provider?: {
|
|
316
373
|
default?: string | undefined;
|
|
@@ -345,6 +402,16 @@ export declare const SpecSchema: z.ZodObject<{
|
|
|
345
402
|
level?: "sandbox" | "verified" | "certified" | "listed" | undefined;
|
|
346
403
|
} | undefined;
|
|
347
404
|
} | undefined;
|
|
405
|
+
room?: {
|
|
406
|
+
name: string;
|
|
407
|
+
agents?: string[] | undefined;
|
|
408
|
+
topics?: string[] | undefined;
|
|
409
|
+
} | undefined;
|
|
410
|
+
streaming?: boolean | {
|
|
411
|
+
enabled?: boolean | undefined;
|
|
412
|
+
chunkSize?: number | undefined;
|
|
413
|
+
} | undefined;
|
|
414
|
+
locale?: "en" | "zh-CN" | undefined;
|
|
348
415
|
}>;
|
|
349
416
|
export declare const OADSchema: z.ZodObject<{
|
|
350
417
|
apiVersion: z.ZodLiteral<"opc/v1">;
|
|
@@ -498,6 +565,30 @@ export declare const OADSchema: z.ZodObject<{
|
|
|
498
565
|
level?: "sandbox" | "verified" | "certified" | "listed" | undefined;
|
|
499
566
|
} | undefined;
|
|
500
567
|
}>>;
|
|
568
|
+
room: z.ZodOptional<z.ZodObject<{
|
|
569
|
+
name: z.ZodString;
|
|
570
|
+
agents: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
571
|
+
topics: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
572
|
+
}, "strip", z.ZodTypeAny, {
|
|
573
|
+
name: string;
|
|
574
|
+
agents: string[];
|
|
575
|
+
topics: string[];
|
|
576
|
+
}, {
|
|
577
|
+
name: string;
|
|
578
|
+
agents?: string[] | undefined;
|
|
579
|
+
topics?: string[] | undefined;
|
|
580
|
+
}>>;
|
|
581
|
+
streaming: z.ZodDefault<z.ZodUnion<[z.ZodBoolean, z.ZodObject<{
|
|
582
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
583
|
+
chunkSize: z.ZodOptional<z.ZodNumber>;
|
|
584
|
+
}, "strip", z.ZodTypeAny, {
|
|
585
|
+
enabled: boolean;
|
|
586
|
+
chunkSize?: number | undefined;
|
|
587
|
+
}, {
|
|
588
|
+
enabled?: boolean | undefined;
|
|
589
|
+
chunkSize?: number | undefined;
|
|
590
|
+
}>]>>;
|
|
591
|
+
locale: z.ZodOptional<z.ZodEnum<["en", "zh-CN"]>>;
|
|
501
592
|
}, "strip", z.ZodTypeAny, {
|
|
502
593
|
model: string;
|
|
503
594
|
skills: {
|
|
@@ -510,6 +601,10 @@ export declare const OADSchema: z.ZodObject<{
|
|
|
510
601
|
config?: Record<string, unknown> | undefined;
|
|
511
602
|
port?: number | undefined;
|
|
512
603
|
}[];
|
|
604
|
+
streaming: boolean | {
|
|
605
|
+
enabled: boolean;
|
|
606
|
+
chunkSize?: number | undefined;
|
|
607
|
+
};
|
|
513
608
|
provider?: {
|
|
514
609
|
default: string;
|
|
515
610
|
allowed: string[];
|
|
@@ -532,6 +627,12 @@ export declare const OADSchema: z.ZodObject<{
|
|
|
532
627
|
level: "sandbox" | "verified" | "certified" | "listed";
|
|
533
628
|
} | undefined;
|
|
534
629
|
} | undefined;
|
|
630
|
+
room?: {
|
|
631
|
+
name: string;
|
|
632
|
+
agents: string[];
|
|
633
|
+
topics: string[];
|
|
634
|
+
} | undefined;
|
|
635
|
+
locale?: "en" | "zh-CN" | undefined;
|
|
535
636
|
}, {
|
|
536
637
|
provider?: {
|
|
537
638
|
default?: string | undefined;
|
|
@@ -566,6 +667,16 @@ export declare const OADSchema: z.ZodObject<{
|
|
|
566
667
|
level?: "sandbox" | "verified" | "certified" | "listed" | undefined;
|
|
567
668
|
} | undefined;
|
|
568
669
|
} | undefined;
|
|
670
|
+
room?: {
|
|
671
|
+
name: string;
|
|
672
|
+
agents?: string[] | undefined;
|
|
673
|
+
topics?: string[] | undefined;
|
|
674
|
+
} | undefined;
|
|
675
|
+
streaming?: boolean | {
|
|
676
|
+
enabled?: boolean | undefined;
|
|
677
|
+
chunkSize?: number | undefined;
|
|
678
|
+
} | undefined;
|
|
679
|
+
locale?: "en" | "zh-CN" | undefined;
|
|
569
680
|
}>;
|
|
570
681
|
}, "strip", z.ZodTypeAny, {
|
|
571
682
|
apiVersion: "opc/v1";
|
|
@@ -595,6 +706,10 @@ export declare const OADSchema: z.ZodObject<{
|
|
|
595
706
|
config?: Record<string, unknown> | undefined;
|
|
596
707
|
port?: number | undefined;
|
|
597
708
|
}[];
|
|
709
|
+
streaming: boolean | {
|
|
710
|
+
enabled: boolean;
|
|
711
|
+
chunkSize?: number | undefined;
|
|
712
|
+
};
|
|
598
713
|
provider?: {
|
|
599
714
|
default: string;
|
|
600
715
|
allowed: string[];
|
|
@@ -617,6 +732,12 @@ export declare const OADSchema: z.ZodObject<{
|
|
|
617
732
|
level: "sandbox" | "verified" | "certified" | "listed";
|
|
618
733
|
} | undefined;
|
|
619
734
|
} | undefined;
|
|
735
|
+
room?: {
|
|
736
|
+
name: string;
|
|
737
|
+
agents: string[];
|
|
738
|
+
topics: string[];
|
|
739
|
+
} | undefined;
|
|
740
|
+
locale?: "en" | "zh-CN" | undefined;
|
|
620
741
|
};
|
|
621
742
|
}, {
|
|
622
743
|
apiVersion: "opc/v1";
|
|
@@ -668,6 +789,16 @@ export declare const OADSchema: z.ZodObject<{
|
|
|
668
789
|
level?: "sandbox" | "verified" | "certified" | "listed" | undefined;
|
|
669
790
|
} | undefined;
|
|
670
791
|
} | undefined;
|
|
792
|
+
room?: {
|
|
793
|
+
name: string;
|
|
794
|
+
agents?: string[] | undefined;
|
|
795
|
+
topics?: string[] | undefined;
|
|
796
|
+
} | undefined;
|
|
797
|
+
streaming?: boolean | {
|
|
798
|
+
enabled?: boolean | undefined;
|
|
799
|
+
chunkSize?: number | undefined;
|
|
800
|
+
} | undefined;
|
|
801
|
+
locale?: "en" | "zh-CN" | undefined;
|
|
671
802
|
};
|
|
672
803
|
}>;
|
|
673
804
|
export type OADDocument = z.infer<typeof OADSchema>;
|
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.LongTermMemorySchema = exports.ChannelSchema = exports.SkillRefSchema = void 0;
|
|
3
|
+
exports.OADSchema = exports.SpecSchema = exports.StreamingSchema = exports.RoomSchema = 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({
|
|
@@ -50,6 +50,15 @@ exports.MetadataSchema = zod_1.z.object({
|
|
|
50
50
|
license: zod_1.z.string().default('Apache-2.0'),
|
|
51
51
|
marketplace: exports.MarketplaceSchema.optional(),
|
|
52
52
|
});
|
|
53
|
+
exports.RoomSchema = zod_1.z.object({
|
|
54
|
+
name: zod_1.z.string(),
|
|
55
|
+
agents: zod_1.z.array(zod_1.z.string()).default([]),
|
|
56
|
+
topics: zod_1.z.array(zod_1.z.string()).default([]),
|
|
57
|
+
});
|
|
58
|
+
exports.StreamingSchema = zod_1.z.object({
|
|
59
|
+
enabled: zod_1.z.boolean().default(false),
|
|
60
|
+
chunkSize: zod_1.z.number().optional(),
|
|
61
|
+
});
|
|
53
62
|
exports.SpecSchema = zod_1.z.object({
|
|
54
63
|
provider: exports.ProviderSchema.optional(),
|
|
55
64
|
model: zod_1.z.string().default('deepseek-chat'),
|
|
@@ -58,6 +67,9 @@ exports.SpecSchema = zod_1.z.object({
|
|
|
58
67
|
channels: zod_1.z.array(exports.ChannelSchema).default([]),
|
|
59
68
|
memory: exports.MemorySchema.optional(),
|
|
60
69
|
dtv: exports.DTVSchema.optional(),
|
|
70
|
+
room: exports.RoomSchema.optional(),
|
|
71
|
+
streaming: zod_1.z.union([zod_1.z.boolean(), exports.StreamingSchema]).default(false),
|
|
72
|
+
locale: zod_1.z.enum(['en', 'zh-CN']).optional(),
|
|
61
73
|
});
|
|
62
74
|
exports.OADSchema = zod_1.z.object({
|
|
63
75
|
apiVersion: zod_1.z.literal('opc/v1'),
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { BaseSkill } from '../skills/base';
|
|
2
|
+
import type { AgentContext, Message, SkillResult } from '../core/types';
|
|
3
|
+
export declare class BlogWriterSkill extends BaseSkill {
|
|
4
|
+
name: string;
|
|
5
|
+
description: string;
|
|
6
|
+
execute(_context: AgentContext, message: Message): Promise<SkillResult>;
|
|
7
|
+
}
|
|
8
|
+
export declare class SocialMediaSkill extends BaseSkill {
|
|
9
|
+
name: string;
|
|
10
|
+
description: string;
|
|
11
|
+
execute(_context: AgentContext, message: Message): Promise<SkillResult>;
|
|
12
|
+
}
|
|
13
|
+
export declare function createContentWriterConfig(): {
|
|
14
|
+
apiVersion: string;
|
|
15
|
+
kind: string;
|
|
16
|
+
metadata: {
|
|
17
|
+
name: string;
|
|
18
|
+
version: string;
|
|
19
|
+
description: string;
|
|
20
|
+
author: string;
|
|
21
|
+
license: string;
|
|
22
|
+
};
|
|
23
|
+
spec: {
|
|
24
|
+
model: string;
|
|
25
|
+
systemPrompt: string;
|
|
26
|
+
skills: {
|
|
27
|
+
name: string;
|
|
28
|
+
description: string;
|
|
29
|
+
}[];
|
|
30
|
+
channels: {
|
|
31
|
+
type: string;
|
|
32
|
+
port: number;
|
|
33
|
+
}[];
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
//# sourceMappingURL=content-writer.d.ts.map
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SocialMediaSkill = exports.BlogWriterSkill = void 0;
|
|
4
|
+
exports.createContentWriterConfig = createContentWriterConfig;
|
|
5
|
+
const base_1 = require("../skills/base");
|
|
6
|
+
class BlogWriterSkill extends base_1.BaseSkill {
|
|
7
|
+
name = 'blog-writer';
|
|
8
|
+
description = 'Help write blog posts with SEO optimization';
|
|
9
|
+
async execute(_context, message) {
|
|
10
|
+
const lower = message.content.toLowerCase();
|
|
11
|
+
if (lower.includes('blog') || lower.includes('article') || lower.includes('post')) {
|
|
12
|
+
return this.match('I can help write blog posts! Please share the topic, target audience, and any keywords you\'d like to include for SEO.', 0.8);
|
|
13
|
+
}
|
|
14
|
+
return this.noMatch();
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
exports.BlogWriterSkill = BlogWriterSkill;
|
|
18
|
+
class SocialMediaSkill extends base_1.BaseSkill {
|
|
19
|
+
name = 'social-media';
|
|
20
|
+
description = 'Create social media content';
|
|
21
|
+
async execute(_context, message) {
|
|
22
|
+
const lower = message.content.toLowerCase();
|
|
23
|
+
if (lower.includes('social') || lower.includes('tweet') || lower.includes('linkedin')) {
|
|
24
|
+
return this.match('I can create social media content! Tell me the platform (Twitter/LinkedIn/etc.), topic, and tone you prefer.', 0.8);
|
|
25
|
+
}
|
|
26
|
+
return this.noMatch();
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
exports.SocialMediaSkill = SocialMediaSkill;
|
|
30
|
+
function createContentWriterConfig() {
|
|
31
|
+
return {
|
|
32
|
+
apiVersion: 'opc/v1',
|
|
33
|
+
kind: 'Agent',
|
|
34
|
+
metadata: {
|
|
35
|
+
name: 'content-writer',
|
|
36
|
+
version: '1.0.0',
|
|
37
|
+
description: 'Content Writer — blog posts, social media, SEO optimization',
|
|
38
|
+
author: 'Deepleaper',
|
|
39
|
+
license: 'Apache-2.0',
|
|
40
|
+
},
|
|
41
|
+
spec: {
|
|
42
|
+
model: 'deepseek-chat',
|
|
43
|
+
systemPrompt: 'You are a content writing assistant. Help create blog posts, social media content, and optimize for SEO. Be creative, engaging, and audience-aware.',
|
|
44
|
+
skills: [
|
|
45
|
+
{ name: 'blog-writer', description: 'Write blog posts' },
|
|
46
|
+
{ name: 'social-media', description: 'Create social media content' },
|
|
47
|
+
],
|
|
48
|
+
channels: [{ type: 'web', port: 3000 }],
|
|
49
|
+
},
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=content-writer.js.map
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { BaseSkill } from '../skills/base';
|
|
2
|
+
import type { AgentContext, Message, SkillResult } from '../core/types';
|
|
3
|
+
export declare class ResumeScreeningSkill extends BaseSkill {
|
|
4
|
+
name: string;
|
|
5
|
+
description: string;
|
|
6
|
+
execute(_context: AgentContext, message: Message): Promise<SkillResult>;
|
|
7
|
+
}
|
|
8
|
+
export declare class InterviewSchedulingSkill extends BaseSkill {
|
|
9
|
+
name: string;
|
|
10
|
+
description: string;
|
|
11
|
+
execute(_context: AgentContext, message: Message): Promise<SkillResult>;
|
|
12
|
+
}
|
|
13
|
+
export declare function createHRRecruiterConfig(): {
|
|
14
|
+
apiVersion: string;
|
|
15
|
+
kind: string;
|
|
16
|
+
metadata: {
|
|
17
|
+
name: string;
|
|
18
|
+
version: string;
|
|
19
|
+
description: string;
|
|
20
|
+
author: string;
|
|
21
|
+
license: string;
|
|
22
|
+
};
|
|
23
|
+
spec: {
|
|
24
|
+
model: string;
|
|
25
|
+
systemPrompt: string;
|
|
26
|
+
skills: {
|
|
27
|
+
name: string;
|
|
28
|
+
description: string;
|
|
29
|
+
}[];
|
|
30
|
+
channels: {
|
|
31
|
+
type: string;
|
|
32
|
+
port: number;
|
|
33
|
+
}[];
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
//# sourceMappingURL=hr-recruiter.d.ts.map
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.InterviewSchedulingSkill = exports.ResumeScreeningSkill = void 0;
|
|
4
|
+
exports.createHRRecruiterConfig = createHRRecruiterConfig;
|
|
5
|
+
const base_1 = require("../skills/base");
|
|
6
|
+
class ResumeScreeningSkill extends base_1.BaseSkill {
|
|
7
|
+
name = 'resume-screening';
|
|
8
|
+
description = 'Screen resumes against job requirements';
|
|
9
|
+
async execute(_context, message) {
|
|
10
|
+
const lower = message.content.toLowerCase();
|
|
11
|
+
if (lower.includes('resume') || lower.includes('cv') || lower.includes('candidate')) {
|
|
12
|
+
return this.match('I can help screen resumes. Please share the candidate\'s resume and the job requirements, and I\'ll provide an analysis.', 0.8);
|
|
13
|
+
}
|
|
14
|
+
return this.noMatch();
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
exports.ResumeScreeningSkill = ResumeScreeningSkill;
|
|
18
|
+
class InterviewSchedulingSkill extends base_1.BaseSkill {
|
|
19
|
+
name = 'interview-scheduling';
|
|
20
|
+
description = 'Help schedule interviews with candidates';
|
|
21
|
+
async execute(_context, message) {
|
|
22
|
+
const lower = message.content.toLowerCase();
|
|
23
|
+
if (lower.includes('schedule') || lower.includes('interview') || lower.includes('calendar')) {
|
|
24
|
+
return this.match('I can help schedule interviews. Please provide the candidate name, preferred dates, and interview format (phone/video/onsite).', 0.8);
|
|
25
|
+
}
|
|
26
|
+
return this.noMatch();
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
exports.InterviewSchedulingSkill = InterviewSchedulingSkill;
|
|
30
|
+
function createHRRecruiterConfig() {
|
|
31
|
+
return {
|
|
32
|
+
apiVersion: 'opc/v1',
|
|
33
|
+
kind: 'Agent',
|
|
34
|
+
metadata: {
|
|
35
|
+
name: 'hr-recruiter',
|
|
36
|
+
version: '1.0.0',
|
|
37
|
+
description: 'HR Recruiter — resume screening, interview scheduling, candidate Q&A',
|
|
38
|
+
author: 'Deepleaper',
|
|
39
|
+
license: 'Apache-2.0',
|
|
40
|
+
},
|
|
41
|
+
spec: {
|
|
42
|
+
model: 'deepseek-chat',
|
|
43
|
+
systemPrompt: 'You are an HR recruiter assistant. Help with resume screening, interview scheduling, and answering candidate questions. Be professional and friendly.',
|
|
44
|
+
skills: [
|
|
45
|
+
{ name: 'resume-screening', description: 'Screen resumes' },
|
|
46
|
+
{ name: 'interview-scheduling', description: 'Schedule interviews' },
|
|
47
|
+
],
|
|
48
|
+
channels: [{ type: 'web', port: 3000 }],
|
|
49
|
+
},
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=hr-recruiter.js.map
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { BaseSkill } from '../skills/base';
|
|
2
|
+
import type { AgentContext, Message, SkillResult } from '../core/types';
|
|
3
|
+
export declare class TaskTrackingSkill extends BaseSkill {
|
|
4
|
+
name: string;
|
|
5
|
+
description: string;
|
|
6
|
+
execute(_context: AgentContext, message: Message): Promise<SkillResult>;
|
|
7
|
+
}
|
|
8
|
+
export declare class MeetingNotesSkill extends BaseSkill {
|
|
9
|
+
name: string;
|
|
10
|
+
description: string;
|
|
11
|
+
execute(_context: AgentContext, message: Message): Promise<SkillResult>;
|
|
12
|
+
}
|
|
13
|
+
export declare function createProjectManagerConfig(): {
|
|
14
|
+
apiVersion: string;
|
|
15
|
+
kind: string;
|
|
16
|
+
metadata: {
|
|
17
|
+
name: string;
|
|
18
|
+
version: string;
|
|
19
|
+
description: string;
|
|
20
|
+
author: string;
|
|
21
|
+
license: string;
|
|
22
|
+
};
|
|
23
|
+
spec: {
|
|
24
|
+
model: string;
|
|
25
|
+
systemPrompt: string;
|
|
26
|
+
skills: {
|
|
27
|
+
name: string;
|
|
28
|
+
description: string;
|
|
29
|
+
}[];
|
|
30
|
+
channels: {
|
|
31
|
+
type: string;
|
|
32
|
+
port: number;
|
|
33
|
+
}[];
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
//# sourceMappingURL=project-manager.d.ts.map
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MeetingNotesSkill = exports.TaskTrackingSkill = void 0;
|
|
4
|
+
exports.createProjectManagerConfig = createProjectManagerConfig;
|
|
5
|
+
const base_1 = require("../skills/base");
|
|
6
|
+
class TaskTrackingSkill extends base_1.BaseSkill {
|
|
7
|
+
name = 'task-tracking';
|
|
8
|
+
description = 'Track project tasks and status';
|
|
9
|
+
async execute(_context, message) {
|
|
10
|
+
const lower = message.content.toLowerCase();
|
|
11
|
+
if (lower.includes('task') || lower.includes('todo') || lower.includes('progress')) {
|
|
12
|
+
return this.match('I can help track tasks. Tell me the task name, assignee, and deadline, and I\'ll add it to the tracker.', 0.8);
|
|
13
|
+
}
|
|
14
|
+
return this.noMatch();
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
exports.TaskTrackingSkill = TaskTrackingSkill;
|
|
18
|
+
class MeetingNotesSkill extends base_1.BaseSkill {
|
|
19
|
+
name = 'meeting-notes';
|
|
20
|
+
description = 'Generate and manage meeting notes';
|
|
21
|
+
async execute(_context, message) {
|
|
22
|
+
const lower = message.content.toLowerCase();
|
|
23
|
+
if (lower.includes('meeting') || lower.includes('notes') || lower.includes('minutes')) {
|
|
24
|
+
return this.match('I can help with meeting notes. Share the meeting details and I\'ll create structured notes with action items.', 0.8);
|
|
25
|
+
}
|
|
26
|
+
return this.noMatch();
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
exports.MeetingNotesSkill = MeetingNotesSkill;
|
|
30
|
+
function createProjectManagerConfig() {
|
|
31
|
+
return {
|
|
32
|
+
apiVersion: 'opc/v1',
|
|
33
|
+
kind: 'Agent',
|
|
34
|
+
metadata: {
|
|
35
|
+
name: 'project-manager',
|
|
36
|
+
version: '1.0.0',
|
|
37
|
+
description: 'Project Manager — task tracking, status updates, meeting notes',
|
|
38
|
+
author: 'Deepleaper',
|
|
39
|
+
license: 'Apache-2.0',
|
|
40
|
+
},
|
|
41
|
+
spec: {
|
|
42
|
+
model: 'deepseek-chat',
|
|
43
|
+
systemPrompt: 'You are a project management assistant. Help track tasks, provide status updates, and manage meeting notes. Be organized and action-oriented.',
|
|
44
|
+
skills: [
|
|
45
|
+
{ name: 'task-tracking', description: 'Track tasks' },
|
|
46
|
+
{ name: 'meeting-notes', description: 'Manage meeting notes' },
|
|
47
|
+
],
|
|
48
|
+
channels: [{ type: 'web', port: 3000 }],
|
|
49
|
+
},
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=project-manager.js.map
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { AgentContext } from '../core/types';
|
|
2
|
+
/**
|
|
3
|
+
* MCP (Model Context Protocol) compatible tool interface.
|
|
4
|
+
* Tools follow the MCP standard format with JSON Schema input validation.
|
|
5
|
+
*/
|
|
6
|
+
export interface MCPToolDefinition {
|
|
7
|
+
name: string;
|
|
8
|
+
description: string;
|
|
9
|
+
inputSchema: Record<string, unknown>;
|
|
10
|
+
}
|
|
11
|
+
export interface MCPToolResult {
|
|
12
|
+
content: string;
|
|
13
|
+
isError?: boolean;
|
|
14
|
+
metadata?: Record<string, unknown>;
|
|
15
|
+
}
|
|
16
|
+
export interface MCPTool extends MCPToolDefinition {
|
|
17
|
+
execute(input: Record<string, unknown>, context?: AgentContext): Promise<MCPToolResult>;
|
|
18
|
+
}
|
|
19
|
+
export declare class MCPToolRegistry {
|
|
20
|
+
private tools;
|
|
21
|
+
register(tool: MCPTool): void;
|
|
22
|
+
unregister(name: string): void;
|
|
23
|
+
get(name: string): MCPTool | undefined;
|
|
24
|
+
list(): MCPToolDefinition[];
|
|
25
|
+
has(name: string): boolean;
|
|
26
|
+
execute(name: string, input: Record<string, unknown>, context?: AgentContext): Promise<MCPToolResult>;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Create an MCP tool from a simple function.
|
|
30
|
+
*/
|
|
31
|
+
export declare function createMCPTool(name: string, description: string, inputSchema: Record<string, unknown>, executeFn: (input: Record<string, unknown>, context?: AgentContext) => Promise<MCPToolResult>): MCPTool;
|
|
32
|
+
//# sourceMappingURL=mcp.d.ts.map
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MCPToolRegistry = void 0;
|
|
4
|
+
exports.createMCPTool = createMCPTool;
|
|
5
|
+
class MCPToolRegistry {
|
|
6
|
+
tools = new Map();
|
|
7
|
+
register(tool) {
|
|
8
|
+
this.tools.set(tool.name, tool);
|
|
9
|
+
}
|
|
10
|
+
unregister(name) {
|
|
11
|
+
this.tools.delete(name);
|
|
12
|
+
}
|
|
13
|
+
get(name) {
|
|
14
|
+
return this.tools.get(name);
|
|
15
|
+
}
|
|
16
|
+
list() {
|
|
17
|
+
return Array.from(this.tools.values()).map(({ name, description, inputSchema }) => ({
|
|
18
|
+
name,
|
|
19
|
+
description,
|
|
20
|
+
inputSchema,
|
|
21
|
+
}));
|
|
22
|
+
}
|
|
23
|
+
has(name) {
|
|
24
|
+
return this.tools.has(name);
|
|
25
|
+
}
|
|
26
|
+
async execute(name, input, context) {
|
|
27
|
+
const tool = this.tools.get(name);
|
|
28
|
+
if (!tool) {
|
|
29
|
+
return { content: `Tool '${name}' not found`, isError: true };
|
|
30
|
+
}
|
|
31
|
+
try {
|
|
32
|
+
return await tool.execute(input, context);
|
|
33
|
+
}
|
|
34
|
+
catch (err) {
|
|
35
|
+
return {
|
|
36
|
+
content: `Tool execution error: ${err instanceof Error ? err.message : String(err)}`,
|
|
37
|
+
isError: true,
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
exports.MCPToolRegistry = MCPToolRegistry;
|
|
43
|
+
/**
|
|
44
|
+
* Create an MCP tool from a simple function.
|
|
45
|
+
*/
|
|
46
|
+
function createMCPTool(name, description, inputSchema, executeFn) {
|
|
47
|
+
return { name, description, inputSchema, execute: executeFn };
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=mcp.js.map
|