opc-agent 1.1.1 → 1.1.2
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 +51 -51
- package/CONTRIBUTING.md +75 -75
- package/README.md +222 -126
- package/README.zh-CN.md +129 -80
- package/dist/channels/web.js +256 -256
- package/dist/deploy/hermes.js +22 -22
- package/dist/deploy/openclaw.js +31 -31
- package/dist/templates/code-reviewer.js +5 -5
- package/dist/templates/customer-service.js +2 -2
- package/dist/templates/data-analyst.js +5 -5
- package/dist/templates/knowledge-base.js +2 -2
- package/dist/templates/sales-assistant.js +4 -4
- package/dist/templates/teacher.js +6 -6
- package/docs/.vitepress/config.ts +103 -103
- package/docs/api/cli.md +48 -48
- package/docs/api/oad-schema.md +64 -64
- package/docs/api/sdk.md +80 -80
- package/docs/guide/concepts.md +51 -51
- package/docs/guide/configuration.md +79 -79
- package/docs/guide/deployment.md +42 -42
- package/docs/guide/getting-started.md +44 -44
- package/docs/guide/templates.md +28 -28
- package/docs/guide/testing.md +84 -84
- package/docs/index.md +27 -27
- package/docs/zh/api/cli.md +54 -54
- package/docs/zh/api/oad-schema.md +87 -87
- package/docs/zh/api/sdk.md +102 -102
- package/docs/zh/guide/concepts.md +104 -104
- package/docs/zh/guide/configuration.md +135 -135
- package/docs/zh/guide/deployment.md +81 -81
- package/docs/zh/guide/getting-started.md +82 -82
- package/docs/zh/guide/templates.md +84 -84
- package/docs/zh/guide/testing.md +88 -88
- package/docs/zh/index.md +27 -27
- package/examples/customer-service-demo/README.md +90 -90
- package/examples/customer-service-demo/oad.yaml +107 -107
- package/package.json +1 -1
- package/src/analytics/index.ts +66 -66
- package/src/channels/discord.ts +192 -192
- package/src/channels/email.ts +177 -177
- package/src/channels/feishu.ts +236 -236
- package/src/channels/index.ts +15 -15
- package/src/channels/slack.ts +160 -160
- package/src/channels/telegram.ts +90 -90
- package/src/channels/voice.ts +106 -106
- package/src/channels/web.ts +596 -596
- package/src/channels/webhook.ts +199 -199
- package/src/channels/websocket.ts +87 -87
- package/src/channels/wechat.ts +149 -149
- package/src/core/a2a.ts +143 -143
- package/src/core/agent.ts +152 -152
- package/src/core/analytics-engine.ts +186 -186
- package/src/core/auth.ts +57 -57
- package/src/core/cache.ts +141 -141
- package/src/core/compose.ts +77 -77
- package/src/core/config.ts +14 -14
- package/src/core/errors.ts +148 -148
- package/src/core/hitl.ts +138 -138
- package/src/core/knowledge.ts +210 -210
- package/src/core/logger.ts +57 -57
- package/src/core/orchestrator.ts +215 -215
- package/src/core/performance.ts +187 -187
- package/src/core/rate-limiter.ts +128 -128
- package/src/core/room.ts +109 -109
- package/src/core/runtime.ts +152 -152
- package/src/core/sandbox.ts +101 -101
- package/src/core/security.ts +171 -171
- package/src/core/types.ts +68 -68
- package/src/core/versioning.ts +106 -106
- package/src/core/watch.ts +178 -178
- package/src/core/workflow.ts +235 -235
- package/src/deploy/hermes.ts +156 -156
- package/src/deploy/openclaw.ts +200 -200
- package/src/dtv/data.ts +29 -29
- package/src/dtv/trust.ts +43 -43
- package/src/dtv/value.ts +47 -47
- package/src/i18n/index.ts +216 -216
- package/src/index.ts +110 -110
- package/src/marketplace/index.ts +223 -223
- package/src/memory/deepbrain.ts +108 -108
- package/src/memory/index.ts +34 -34
- package/src/plugins/index.ts +208 -208
- package/src/providers/index.ts +183 -183
- package/src/schema/oad.ts +155 -155
- package/src/skills/base.ts +16 -16
- package/src/skills/document.ts +100 -100
- package/src/skills/http.ts +35 -35
- package/src/skills/index.ts +27 -27
- package/src/skills/scheduler.ts +80 -80
- package/src/skills/webhook-trigger.ts +59 -59
- package/src/templates/code-reviewer.ts +34 -34
- package/src/templates/customer-service.ts +80 -80
- package/src/templates/data-analyst.ts +70 -70
- package/src/templates/executive-assistant.ts +71 -71
- package/src/templates/financial-advisor.ts +60 -60
- package/src/templates/knowledge-base.ts +31 -31
- package/src/templates/legal-assistant.ts +71 -71
- package/src/templates/sales-assistant.ts +79 -79
- package/src/templates/teacher.ts +79 -79
- package/src/testing/index.ts +181 -181
- package/src/tools/calculator.ts +73 -73
- package/src/tools/datetime.ts +149 -149
- package/src/tools/json-transform.ts +187 -187
- package/src/tools/mcp.ts +76 -76
- package/src/tools/text-analysis.ts +116 -116
- package/templates/Dockerfile +15 -15
- package/templates/code-reviewer/README.md +27 -27
- package/templates/code-reviewer/oad.yaml +41 -41
- package/templates/customer-service/README.md +22 -22
- package/templates/customer-service/oad.yaml +36 -36
- package/templates/docker-compose.yml +21 -21
- package/templates/knowledge-base/README.md +28 -28
- package/templates/knowledge-base/oad.yaml +38 -38
- package/templates/sales-assistant/README.md +26 -26
- package/templates/sales-assistant/oad.yaml +43 -43
- package/tests/a2a.test.ts +66 -66
- package/tests/agent.test.ts +72 -72
- package/tests/analytics.test.ts +50 -50
- package/tests/channel.test.ts +39 -39
- package/tests/e2e.test.ts +134 -134
- package/tests/errors.test.ts +83 -83
- package/tests/hitl.test.ts +71 -71
- package/tests/i18n.test.ts +41 -41
- package/tests/mcp.test.ts +54 -54
- package/tests/oad.test.ts +68 -68
- package/tests/performance.test.ts +115 -115
- package/tests/plugin.test.ts +74 -74
- package/tests/room.test.ts +106 -106
- package/tests/runtime.test.ts +42 -42
- package/tests/sandbox.test.ts +46 -46
- package/tests/security.test.ts +60 -60
- package/tests/templates.test.ts +77 -77
- package/tests/v070.test.ts +76 -76
- package/tests/versioning.test.ts +75 -75
- package/tests/voice.test.ts +61 -61
- package/tests/webhook.test.ts +29 -29
- package/tests/workflow.test.ts +143 -143
- package/tsconfig.json +19 -19
- package/vitest.config.ts +9 -9
package/src/index.ts
CHANGED
|
@@ -1,110 +1,110 @@
|
|
|
1
|
-
// OPC Agent — Open Agent Framework
|
|
2
|
-
export { BaseAgent } from './core/agent';
|
|
3
|
-
export { AgentRuntime, truncateOutput } from './core/runtime';
|
|
4
|
-
export { Logger } from './core/logger';
|
|
5
|
-
export { loadOAD, validateOAD } from './core/config';
|
|
6
|
-
export { OADSchema } from './schema/oad';
|
|
7
|
-
export type { OADDocument, Metadata, Spec, DTVConfig, TrustLevelType } from './schema/oad';
|
|
8
|
-
export type { IAgent, IChannel, ISkill, Message, AgentContext, SkillResult, MemoryStore, AgentState } from './core/types';
|
|
9
|
-
export { BaseChannel } from './channels';
|
|
10
|
-
export { WebChannel } from './channels/web';
|
|
11
|
-
export { TelegramChannel } from './channels/telegram';
|
|
12
|
-
export { WebSocketChannel } from './channels/websocket';
|
|
13
|
-
export { BaseSkill } from './skills/base';
|
|
14
|
-
export { SkillRegistry } from './skills';
|
|
15
|
-
export { InMemoryStore } from './memory';
|
|
16
|
-
export { DeepBrainMemoryStore } from './memory/deepbrain';
|
|
17
|
-
export { TrustManager } from './dtv/trust';
|
|
18
|
-
export { ValueTracker } from './dtv/value';
|
|
19
|
-
export { MRGConfigReader } from './dtv/data';
|
|
20
|
-
export { createProvider, SUPPORTED_PROVIDERS } from './providers';
|
|
21
|
-
|
|
22
|
-
// v0.3.0 new modules
|
|
23
|
-
export { Room } from './core/room';
|
|
24
|
-
export type { RoomMessage } from './core/room';
|
|
25
|
-
export { MCPToolRegistry, createMCPTool } from './tools/mcp';
|
|
26
|
-
export type { MCPTool, MCPToolDefinition, MCPToolResult } from './tools/mcp';
|
|
27
|
-
export { PluginManager } from './plugins';
|
|
28
|
-
export type { IPlugin, PluginHooks } from './plugins';
|
|
29
|
-
export { Sandbox } from './core/sandbox';
|
|
30
|
-
export type { SandboxConfig, SandboxRestrictions } from './core/sandbox';
|
|
31
|
-
export { Analytics } from './analytics';
|
|
32
|
-
|
|
33
|
-
// v0.4.0 modules
|
|
34
|
-
export { WorkflowEngine } from './core/workflow';
|
|
35
|
-
export type { WorkflowDefinition, WorkflowStep, WorkflowResult, StepResult } from './core/workflow';
|
|
36
|
-
export { AgentRegistry } from './core/a2a';
|
|
37
|
-
export type { A2ARequest, A2AResponse, AgentCapability, AgentRegistration } from './core/a2a';
|
|
38
|
-
export { HITLManager } from './core/hitl';
|
|
39
|
-
export type { ApprovalRequest, ApprovalResponse, HITLConfig } from './core/hitl';
|
|
40
|
-
export { VoiceChannel } from './channels/voice';
|
|
41
|
-
export type { VoiceChannelConfig, STTProvider, TTSProvider } from './channels/voice';
|
|
42
|
-
export { WebhookChannel } from './channels/webhook';
|
|
43
|
-
export type { WebhookConfig, WebhookPayload } from './channels/webhook';
|
|
44
|
-
export { VersionManager } from './core/versioning';
|
|
45
|
-
export type { VersionEntry, Migration } from './core/versioning';
|
|
46
|
-
export { ConnectionPool, RequestBatcher, LazyLoader } from './core/performance';
|
|
47
|
-
export type { AnalyticsSnapshot } from './analytics';
|
|
48
|
-
export { t, setLocale, getLocale, detectLocale, addMessages } from './i18n';
|
|
49
|
-
export type { Locale } from './i18n';
|
|
50
|
-
|
|
51
|
-
// v0.5.0+ modules
|
|
52
|
-
export { KnowledgeBase } from './core/knowledge';
|
|
53
|
-
export { deployToHermes } from './deploy/hermes';
|
|
54
|
-
export type { HermesDeployOptions, HermesDeployResult } from './deploy/hermes';
|
|
55
|
-
export { publishAgent, installAgent } from './marketplace';
|
|
56
|
-
export type { AgentManifest, PublishOptions, InstallOptions } from './marketplace';
|
|
57
|
-
|
|
58
|
-
// v0.7.0 modules
|
|
59
|
-
export { createAuthMiddleware, getActiveSessions } from './core/auth';
|
|
60
|
-
export type { AuthConfig, AuthSession } from './core/auth';
|
|
61
|
-
// v0.8.0 modules
|
|
62
|
-
export { Orchestrator } from './core/orchestrator';
|
|
63
|
-
export type { AgentNode, OrchestratorWorkflow, OrchestratorConfig, HandoffRequest } from './core/orchestrator';
|
|
64
|
-
export { AgentPipeline, compose } from './core/compose';
|
|
65
|
-
export type { ComposableAgent, ComposeOptions } from './core/compose';
|
|
66
|
-
export { EmailChannel } from './channels/email';
|
|
67
|
-
export type { EmailChannelConfig, EmailMessage } from './channels/email';
|
|
68
|
-
export { SlackChannel } from './channels/slack';
|
|
69
|
-
export type { SlackChannelConfig, SlashCommandConfig, SlashCommandPayload } from './channels/slack';
|
|
70
|
-
export { WeChatChannel } from './channels/wechat';
|
|
71
|
-
export type { WeChatChannelConfig, WeChatMessage, TemplateMessageData } from './channels/wechat';
|
|
72
|
-
export { CalculatorTool } from './tools/calculator';
|
|
73
|
-
export { DateTimeTool } from './tools/datetime';
|
|
74
|
-
export { JsonTransformTool } from './tools/json-transform';
|
|
75
|
-
export { TextAnalysisTool } from './tools/text-analysis';
|
|
76
|
-
|
|
77
|
-
export { HttpSkill } from './skills/http';
|
|
78
|
-
export { WebhookTriggerSkill } from './skills/webhook-trigger';
|
|
79
|
-
export type { WebhookTarget } from './skills/webhook-trigger';
|
|
80
|
-
export { SchedulerSkill } from './skills/scheduler';
|
|
81
|
-
export type { ScheduledTask } from './skills/scheduler';
|
|
82
|
-
export { DocumentSkill } from './skills/document';
|
|
83
|
-
export type { DocumentChunk } from './skills/document';
|
|
84
|
-
|
|
85
|
-
// v0.9.0 modules
|
|
86
|
-
export { runTests, loadTestCases, formatReport } from './testing';
|
|
87
|
-
export type { TestCase, TestResult, TestReport } from './testing';
|
|
88
|
-
export { AnalyticsEngine } from './core/analytics-engine';
|
|
89
|
-
export type { AnalyticsEvent, AnalyticsStats } from './core/analytics-engine';
|
|
90
|
-
export { RateLimiter } from './core/rate-limiter';
|
|
91
|
-
export { LLMCache } from './core/cache';
|
|
92
|
-
export type { CacheConfig, CacheEntry } from './core/cache';
|
|
93
|
-
export { getSupportedLocales } from './i18n';
|
|
94
|
-
export { createDataAnalystConfig } from './templates/data-analyst';
|
|
95
|
-
export { createTeacherConfig } from './templates/teacher';
|
|
96
|
-
|
|
97
|
-
// v1.0.0 modules
|
|
98
|
-
export { OPCError, ProviderError, ValidationError, ConfigError, ChannelError, PluginError, RateLimitError, SecurityError, TimeoutError, wrapError, formatErrorForUser } from './core/errors';
|
|
99
|
-
export { sanitizeInput, detectInjection, securityHeaders, corsMiddleware, APIKeyManager, inputValidation } from './core/security';
|
|
100
|
-
export type { SecurityHeadersConfig, CORSConfig, APIKeyEntry } from './core/security';
|
|
101
|
-
export { createLoggingPlugin, createAnalyticsPlugin, createRateLimitPlugin } from './plugins';
|
|
102
|
-
export type { PluginManifest } from './plugins';
|
|
103
|
-
|
|
104
|
-
// v1.1.0 modules
|
|
105
|
-
export { FeishuChannel } from './channels/feishu';
|
|
106
|
-
export type { FeishuChannelConfig } from './channels/feishu';
|
|
107
|
-
export { DiscordChannel } from './channels/discord';
|
|
108
|
-
export type { DiscordChannelConfig } from './channels/discord';
|
|
109
|
-
export { ProcessWatcher } from './core/watch';
|
|
110
|
-
export type { WatchPattern, WatchMatch, WatchOptions } from './core/watch';
|
|
1
|
+
// OPC Agent — Open Agent Framework
|
|
2
|
+
export { BaseAgent } from './core/agent';
|
|
3
|
+
export { AgentRuntime, truncateOutput } from './core/runtime';
|
|
4
|
+
export { Logger } from './core/logger';
|
|
5
|
+
export { loadOAD, validateOAD } from './core/config';
|
|
6
|
+
export { OADSchema } from './schema/oad';
|
|
7
|
+
export type { OADDocument, Metadata, Spec, DTVConfig, TrustLevelType } from './schema/oad';
|
|
8
|
+
export type { IAgent, IChannel, ISkill, Message, AgentContext, SkillResult, MemoryStore, AgentState } from './core/types';
|
|
9
|
+
export { BaseChannel } from './channels';
|
|
10
|
+
export { WebChannel } from './channels/web';
|
|
11
|
+
export { TelegramChannel } from './channels/telegram';
|
|
12
|
+
export { WebSocketChannel } from './channels/websocket';
|
|
13
|
+
export { BaseSkill } from './skills/base';
|
|
14
|
+
export { SkillRegistry } from './skills';
|
|
15
|
+
export { InMemoryStore } from './memory';
|
|
16
|
+
export { DeepBrainMemoryStore } from './memory/deepbrain';
|
|
17
|
+
export { TrustManager } from './dtv/trust';
|
|
18
|
+
export { ValueTracker } from './dtv/value';
|
|
19
|
+
export { MRGConfigReader } from './dtv/data';
|
|
20
|
+
export { createProvider, SUPPORTED_PROVIDERS } from './providers';
|
|
21
|
+
|
|
22
|
+
// v0.3.0 new modules
|
|
23
|
+
export { Room } from './core/room';
|
|
24
|
+
export type { RoomMessage } from './core/room';
|
|
25
|
+
export { MCPToolRegistry, createMCPTool } from './tools/mcp';
|
|
26
|
+
export type { MCPTool, MCPToolDefinition, MCPToolResult } from './tools/mcp';
|
|
27
|
+
export { PluginManager } from './plugins';
|
|
28
|
+
export type { IPlugin, PluginHooks } from './plugins';
|
|
29
|
+
export { Sandbox } from './core/sandbox';
|
|
30
|
+
export type { SandboxConfig, SandboxRestrictions } from './core/sandbox';
|
|
31
|
+
export { Analytics } from './analytics';
|
|
32
|
+
|
|
33
|
+
// v0.4.0 modules
|
|
34
|
+
export { WorkflowEngine } from './core/workflow';
|
|
35
|
+
export type { WorkflowDefinition, WorkflowStep, WorkflowResult, StepResult } from './core/workflow';
|
|
36
|
+
export { AgentRegistry } from './core/a2a';
|
|
37
|
+
export type { A2ARequest, A2AResponse, AgentCapability, AgentRegistration } from './core/a2a';
|
|
38
|
+
export { HITLManager } from './core/hitl';
|
|
39
|
+
export type { ApprovalRequest, ApprovalResponse, HITLConfig } from './core/hitl';
|
|
40
|
+
export { VoiceChannel } from './channels/voice';
|
|
41
|
+
export type { VoiceChannelConfig, STTProvider, TTSProvider } from './channels/voice';
|
|
42
|
+
export { WebhookChannel } from './channels/webhook';
|
|
43
|
+
export type { WebhookConfig, WebhookPayload } from './channels/webhook';
|
|
44
|
+
export { VersionManager } from './core/versioning';
|
|
45
|
+
export type { VersionEntry, Migration } from './core/versioning';
|
|
46
|
+
export { ConnectionPool, RequestBatcher, LazyLoader } from './core/performance';
|
|
47
|
+
export type { AnalyticsSnapshot } from './analytics';
|
|
48
|
+
export { t, setLocale, getLocale, detectLocale, addMessages } from './i18n';
|
|
49
|
+
export type { Locale } from './i18n';
|
|
50
|
+
|
|
51
|
+
// v0.5.0+ modules
|
|
52
|
+
export { KnowledgeBase } from './core/knowledge';
|
|
53
|
+
export { deployToHermes } from './deploy/hermes';
|
|
54
|
+
export type { HermesDeployOptions, HermesDeployResult } from './deploy/hermes';
|
|
55
|
+
export { publishAgent, installAgent } from './marketplace';
|
|
56
|
+
export type { AgentManifest, PublishOptions, InstallOptions } from './marketplace';
|
|
57
|
+
|
|
58
|
+
// v0.7.0 modules
|
|
59
|
+
export { createAuthMiddleware, getActiveSessions } from './core/auth';
|
|
60
|
+
export type { AuthConfig, AuthSession } from './core/auth';
|
|
61
|
+
// v0.8.0 modules
|
|
62
|
+
export { Orchestrator } from './core/orchestrator';
|
|
63
|
+
export type { AgentNode, OrchestratorWorkflow, OrchestratorConfig, HandoffRequest } from './core/orchestrator';
|
|
64
|
+
export { AgentPipeline, compose } from './core/compose';
|
|
65
|
+
export type { ComposableAgent, ComposeOptions } from './core/compose';
|
|
66
|
+
export { EmailChannel } from './channels/email';
|
|
67
|
+
export type { EmailChannelConfig, EmailMessage } from './channels/email';
|
|
68
|
+
export { SlackChannel } from './channels/slack';
|
|
69
|
+
export type { SlackChannelConfig, SlashCommandConfig, SlashCommandPayload } from './channels/slack';
|
|
70
|
+
export { WeChatChannel } from './channels/wechat';
|
|
71
|
+
export type { WeChatChannelConfig, WeChatMessage, TemplateMessageData } from './channels/wechat';
|
|
72
|
+
export { CalculatorTool } from './tools/calculator';
|
|
73
|
+
export { DateTimeTool } from './tools/datetime';
|
|
74
|
+
export { JsonTransformTool } from './tools/json-transform';
|
|
75
|
+
export { TextAnalysisTool } from './tools/text-analysis';
|
|
76
|
+
|
|
77
|
+
export { HttpSkill } from './skills/http';
|
|
78
|
+
export { WebhookTriggerSkill } from './skills/webhook-trigger';
|
|
79
|
+
export type { WebhookTarget } from './skills/webhook-trigger';
|
|
80
|
+
export { SchedulerSkill } from './skills/scheduler';
|
|
81
|
+
export type { ScheduledTask } from './skills/scheduler';
|
|
82
|
+
export { DocumentSkill } from './skills/document';
|
|
83
|
+
export type { DocumentChunk } from './skills/document';
|
|
84
|
+
|
|
85
|
+
// v0.9.0 modules
|
|
86
|
+
export { runTests, loadTestCases, formatReport } from './testing';
|
|
87
|
+
export type { TestCase, TestResult, TestReport } from './testing';
|
|
88
|
+
export { AnalyticsEngine } from './core/analytics-engine';
|
|
89
|
+
export type { AnalyticsEvent, AnalyticsStats } from './core/analytics-engine';
|
|
90
|
+
export { RateLimiter } from './core/rate-limiter';
|
|
91
|
+
export { LLMCache } from './core/cache';
|
|
92
|
+
export type { CacheConfig, CacheEntry } from './core/cache';
|
|
93
|
+
export { getSupportedLocales } from './i18n';
|
|
94
|
+
export { createDataAnalystConfig } from './templates/data-analyst';
|
|
95
|
+
export { createTeacherConfig } from './templates/teacher';
|
|
96
|
+
|
|
97
|
+
// v1.0.0 modules
|
|
98
|
+
export { OPCError, ProviderError, ValidationError, ConfigError, ChannelError, PluginError, RateLimitError, SecurityError, TimeoutError, wrapError, formatErrorForUser } from './core/errors';
|
|
99
|
+
export { sanitizeInput, detectInjection, securityHeaders, corsMiddleware, APIKeyManager, inputValidation } from './core/security';
|
|
100
|
+
export type { SecurityHeadersConfig, CORSConfig, APIKeyEntry } from './core/security';
|
|
101
|
+
export { createLoggingPlugin, createAnalyticsPlugin, createRateLimitPlugin } from './plugins';
|
|
102
|
+
export type { PluginManifest } from './plugins';
|
|
103
|
+
|
|
104
|
+
// v1.1.0 modules
|
|
105
|
+
export { FeishuChannel } from './channels/feishu';
|
|
106
|
+
export type { FeishuChannelConfig } from './channels/feishu';
|
|
107
|
+
export { DiscordChannel } from './channels/discord';
|
|
108
|
+
export type { DiscordChannelConfig } from './channels/discord';
|
|
109
|
+
export { ProcessWatcher } from './core/watch';
|
|
110
|
+
export type { WatchPattern, WatchMatch, WatchOptions } from './core/watch';
|