opc-agent 1.1.1 → 1.1.3

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.
Files changed (142) hide show
  1. package/CHANGELOG.md +51 -51
  2. package/CONTRIBUTING.md +75 -75
  3. package/README.md +222 -126
  4. package/README.zh-CN.md +129 -80
  5. package/dist/channels/web.js +256 -256
  6. package/dist/deploy/hermes.js +22 -22
  7. package/dist/deploy/openclaw.js +31 -31
  8. package/dist/providers/index.d.ts +1 -1
  9. package/dist/providers/index.js +148 -13
  10. package/dist/schema/oad.d.ts +3 -3
  11. package/dist/templates/code-reviewer.js +5 -5
  12. package/dist/templates/customer-service.js +2 -2
  13. package/dist/templates/data-analyst.js +5 -5
  14. package/dist/templates/knowledge-base.js +2 -2
  15. package/dist/templates/sales-assistant.js +4 -4
  16. package/dist/templates/teacher.js +6 -6
  17. package/docs/.vitepress/config.ts +103 -103
  18. package/docs/api/cli.md +48 -48
  19. package/docs/api/oad-schema.md +64 -64
  20. package/docs/api/sdk.md +80 -80
  21. package/docs/guide/concepts.md +51 -51
  22. package/docs/guide/configuration.md +79 -79
  23. package/docs/guide/deployment.md +42 -42
  24. package/docs/guide/getting-started.md +44 -44
  25. package/docs/guide/templates.md +28 -28
  26. package/docs/guide/testing.md +84 -84
  27. package/docs/index.md +27 -27
  28. package/docs/zh/api/cli.md +54 -54
  29. package/docs/zh/api/oad-schema.md +87 -87
  30. package/docs/zh/api/sdk.md +102 -102
  31. package/docs/zh/guide/concepts.md +104 -104
  32. package/docs/zh/guide/configuration.md +135 -135
  33. package/docs/zh/guide/deployment.md +81 -81
  34. package/docs/zh/guide/getting-started.md +82 -82
  35. package/docs/zh/guide/templates.md +84 -84
  36. package/docs/zh/guide/testing.md +88 -88
  37. package/docs/zh/index.md +27 -27
  38. package/examples/customer-service-demo/README.md +90 -90
  39. package/examples/customer-service-demo/oad.yaml +107 -107
  40. package/package.json +1 -1
  41. package/src/analytics/index.ts +66 -66
  42. package/src/channels/discord.ts +192 -192
  43. package/src/channels/email.ts +177 -177
  44. package/src/channels/feishu.ts +236 -236
  45. package/src/channels/index.ts +15 -15
  46. package/src/channels/slack.ts +160 -160
  47. package/src/channels/telegram.ts +90 -90
  48. package/src/channels/voice.ts +106 -106
  49. package/src/channels/web.ts +596 -596
  50. package/src/channels/webhook.ts +199 -199
  51. package/src/channels/websocket.ts +87 -87
  52. package/src/channels/wechat.ts +149 -149
  53. package/src/core/a2a.ts +143 -143
  54. package/src/core/agent.ts +152 -152
  55. package/src/core/analytics-engine.ts +186 -186
  56. package/src/core/auth.ts +57 -57
  57. package/src/core/cache.ts +141 -141
  58. package/src/core/compose.ts +77 -77
  59. package/src/core/config.ts +14 -14
  60. package/src/core/errors.ts +148 -148
  61. package/src/core/hitl.ts +138 -138
  62. package/src/core/knowledge.ts +210 -210
  63. package/src/core/logger.ts +57 -57
  64. package/src/core/orchestrator.ts +215 -215
  65. package/src/core/performance.ts +187 -187
  66. package/src/core/rate-limiter.ts +128 -128
  67. package/src/core/room.ts +109 -109
  68. package/src/core/runtime.ts +152 -152
  69. package/src/core/sandbox.ts +101 -101
  70. package/src/core/security.ts +171 -171
  71. package/src/core/types.ts +68 -68
  72. package/src/core/versioning.ts +106 -106
  73. package/src/core/watch.ts +178 -178
  74. package/src/core/workflow.ts +235 -235
  75. package/src/deploy/hermes.ts +156 -156
  76. package/src/deploy/openclaw.ts +200 -200
  77. package/src/dtv/data.ts +29 -29
  78. package/src/dtv/trust.ts +43 -43
  79. package/src/dtv/value.ts +47 -47
  80. package/src/i18n/index.ts +216 -216
  81. package/src/index.ts +110 -110
  82. package/src/marketplace/index.ts +223 -223
  83. package/src/memory/deepbrain.ts +108 -108
  84. package/src/memory/index.ts +34 -34
  85. package/src/plugins/index.ts +208 -208
  86. package/src/providers/index.ts +322 -183
  87. package/src/schema/oad.ts +155 -155
  88. package/src/skills/base.ts +16 -16
  89. package/src/skills/document.ts +100 -100
  90. package/src/skills/http.ts +35 -35
  91. package/src/skills/index.ts +27 -27
  92. package/src/skills/scheduler.ts +80 -80
  93. package/src/skills/webhook-trigger.ts +59 -59
  94. package/src/templates/code-reviewer.ts +34 -34
  95. package/src/templates/customer-service.ts +80 -80
  96. package/src/templates/data-analyst.ts +70 -70
  97. package/src/templates/executive-assistant.ts +71 -71
  98. package/src/templates/financial-advisor.ts +60 -60
  99. package/src/templates/knowledge-base.ts +31 -31
  100. package/src/templates/legal-assistant.ts +71 -71
  101. package/src/templates/sales-assistant.ts +79 -79
  102. package/src/templates/teacher.ts +79 -79
  103. package/src/testing/index.ts +181 -181
  104. package/src/tools/calculator.ts +73 -73
  105. package/src/tools/datetime.ts +149 -149
  106. package/src/tools/json-transform.ts +187 -187
  107. package/src/tools/mcp.ts +76 -76
  108. package/src/tools/text-analysis.ts +116 -116
  109. package/templates/Dockerfile +15 -15
  110. package/templates/code-reviewer/README.md +27 -27
  111. package/templates/code-reviewer/oad.yaml +41 -41
  112. package/templates/customer-service/README.md +22 -22
  113. package/templates/customer-service/oad.yaml +36 -36
  114. package/templates/docker-compose.yml +21 -21
  115. package/templates/knowledge-base/README.md +28 -28
  116. package/templates/knowledge-base/oad.yaml +38 -38
  117. package/templates/sales-assistant/README.md +26 -26
  118. package/templates/sales-assistant/oad.yaml +43 -43
  119. package/tests/a2a.test.ts +66 -66
  120. package/tests/agent.test.ts +72 -72
  121. package/tests/analytics.test.ts +50 -50
  122. package/tests/channel.test.ts +39 -39
  123. package/tests/e2e.test.ts +134 -134
  124. package/tests/errors.test.ts +83 -83
  125. package/tests/hitl.test.ts +71 -71
  126. package/tests/i18n.test.ts +41 -41
  127. package/tests/mcp.test.ts +54 -54
  128. package/tests/oad.test.ts +68 -68
  129. package/tests/performance.test.ts +115 -115
  130. package/tests/plugin.test.ts +74 -74
  131. package/tests/room.test.ts +106 -106
  132. package/tests/runtime.test.ts +42 -42
  133. package/tests/sandbox.test.ts +46 -46
  134. package/tests/security.test.ts +60 -60
  135. package/tests/templates.test.ts +77 -77
  136. package/tests/v070.test.ts +76 -76
  137. package/tests/versioning.test.ts +75 -75
  138. package/tests/voice.test.ts +61 -61
  139. package/tests/webhook.test.ts +29 -29
  140. package/tests/workflow.test.ts +143 -143
  141. package/tsconfig.json +19 -19
  142. package/vitest.config.ts +9 -9
@@ -41,27 +41,27 @@ const fs = __importStar(require("fs"));
41
41
  const path = __importStar(require("path"));
42
42
  function generateIdentityMd(oad) {
43
43
  const m = oad.metadata;
44
- return `# IDENTITY.md
45
-
46
- - **Name:** ${m.name}
47
- - **Version:** ${m.version}
48
- - **Description:** ${m.description ?? 'An AI agent'}
49
- - **Author:** ${m.author ?? 'Unknown'}
50
- - **License:** ${m.license}
44
+ return `# IDENTITY.md
45
+
46
+ - **Name:** ${m.name}
47
+ - **Version:** ${m.version}
48
+ - **Description:** ${m.description ?? 'An AI agent'}
49
+ - **Author:** ${m.author ?? 'Unknown'}
50
+ - **License:** ${m.license}
51
51
  `;
52
52
  }
53
53
  function generateSoulMd(oad) {
54
54
  const prompt = oad.spec.systemPrompt ?? 'You are a helpful AI assistant.';
55
- return `# SOUL.md - ${oad.metadata.name}
56
-
57
- ## System Prompt
58
-
59
- ${prompt}
60
-
61
- ## Model Configuration
62
-
63
- - **Model:** ${oad.spec.model}
64
- - **Provider:** ${oad.spec.provider?.default ?? 'deepseek'}
55
+ return `# SOUL.md - ${oad.metadata.name}
56
+
57
+ ## System Prompt
58
+
59
+ ${prompt}
60
+
61
+ ## Model Configuration
62
+
63
+ - **Model:** ${oad.spec.model}
64
+ - **Provider:** ${oad.spec.provider?.default ?? 'deepseek'}
65
65
  `;
66
66
  }
67
67
  function generateAgentsMd(oad) {
@@ -112,23 +112,23 @@ function generateAgentsMd(oad) {
112
112
  return md;
113
113
  }
114
114
  function generateUserMd(oad) {
115
- return `# USER.md
116
-
117
- - **Name:** (your name)
118
- - **Role:** User
119
- - **Notes:** Configure this file with your preferences for ${oad.metadata.name}.
115
+ return `# USER.md
116
+
117
+ - **Name:** (your name)
118
+ - **Role:** User
119
+ - **Notes:** Configure this file with your preferences for ${oad.metadata.name}.
120
120
  `;
121
121
  }
122
122
  function generateMemoryMd(oad) {
123
- return `# MEMORY.md - ${oad.metadata.name}
124
-
125
- ## Persistent Knowledge
126
-
127
- (Agent will store learned information here)
128
-
129
- ## User Preferences
130
-
131
- (Discovered user preferences will be noted here)
123
+ return `# MEMORY.md - ${oad.metadata.name}
124
+
125
+ ## Persistent Knowledge
126
+
127
+ (Agent will store learned information here)
128
+
129
+ ## User Preferences
130
+
131
+ (Discovered user preferences will be noted here)
132
132
  `;
133
133
  }
134
134
  function generateOpenClawConfig(oad, agentDir) {
@@ -5,5 +5,5 @@ export interface LLMProvider {
5
5
  chatStream(messages: Message[], systemPrompt?: string): AsyncIterable<string>;
6
6
  }
7
7
  export declare function createProvider(name?: string, model?: string, baseUrl?: string, apiKey?: string): LLMProvider;
8
- export declare const SUPPORTED_PROVIDERS: readonly ["openai", "deepseek", "qwen"];
8
+ export declare const SUPPORTED_PROVIDERS: readonly ["openai", "deepseek", "qwen", "gemini"];
9
9
  //# sourceMappingURL=index.d.ts.map
@@ -69,20 +69,27 @@ class OpenAICompatibleProvider {
69
69
  throw new Error('No API key configured. Set OPC_LLM_API_KEY or OPENAI_API_KEY environment variable.');
70
70
  }
71
71
  const url = new URL(`${this.baseUrl}/chat/completions`);
72
+ const isGemini = url.hostname.includes('googleapis.com');
73
+ if (isGemini) {
74
+ url.searchParams.set('key', this.apiKey);
75
+ }
72
76
  const isHttps = url.protocol === 'https:';
73
77
  const lib = isHttps ? https : http;
74
78
  const postData = JSON.stringify(body);
79
+ const headers = {
80
+ 'Content-Type': 'application/json',
81
+ 'Content-Length': String(Buffer.byteLength(postData)),
82
+ };
83
+ if (!isGemini) {
84
+ headers['Authorization'] = `Bearer ${this.apiKey}`;
85
+ }
75
86
  return new Promise((resolve, reject) => {
76
87
  const req = lib.request({
77
88
  hostname: url.hostname,
78
89
  port: url.port || (isHttps ? 443 : 80),
79
- path: url.pathname,
90
+ path: url.pathname + url.search,
80
91
  method: 'POST',
81
- headers: {
82
- 'Content-Type': 'application/json',
83
- Authorization: `Bearer ${this.apiKey}`,
84
- 'Content-Length': Buffer.byteLength(postData),
85
- },
92
+ headers,
86
93
  }, (res) => {
87
94
  let data = '';
88
95
  res.on('data', (chunk) => (data += chunk.toString()));
@@ -127,6 +134,10 @@ class OpenAICompatibleProvider {
127
134
  }
128
135
  const formatted = this.formatMessages(messages, systemPrompt);
129
136
  const url = new URL(`${this.baseUrl}/chat/completions`);
137
+ const isGemini = url.hostname.includes('googleapis.com');
138
+ if (isGemini) {
139
+ url.searchParams.set('key', this.apiKey);
140
+ }
130
141
  const isHttps = url.protocol === 'https:';
131
142
  const lib = isHttps ? https : http;
132
143
  const postData = JSON.stringify({
@@ -136,17 +147,20 @@ class OpenAICompatibleProvider {
136
147
  max_tokens: 2048,
137
148
  stream: true,
138
149
  });
150
+ const streamHeaders = {
151
+ 'Content-Type': 'application/json',
152
+ 'Content-Length': String(Buffer.byteLength(postData)),
153
+ };
154
+ if (!isGemini) {
155
+ streamHeaders['Authorization'] = `Bearer ${this.apiKey}`;
156
+ }
139
157
  const response = await new Promise((resolve, reject) => {
140
158
  const req = lib.request({
141
159
  hostname: url.hostname,
142
160
  port: url.port || (isHttps ? 443 : 80),
143
- path: url.pathname,
161
+ path: url.pathname + url.search,
144
162
  method: 'POST',
145
- headers: {
146
- 'Content-Type': 'application/json',
147
- Authorization: `Bearer ${this.apiKey}`,
148
- 'Content-Length': Buffer.byteLength(postData),
149
- },
163
+ headers: streamHeaders,
150
164
  }, resolve);
151
165
  req.on('error', reject);
152
166
  req.write(postData);
@@ -183,9 +197,130 @@ class OpenAICompatibleProvider {
183
197
  }
184
198
  }
185
199
  }
200
+ class GeminiNativeProvider {
201
+ name = 'gemini';
202
+ model;
203
+ apiKey;
204
+ constructor(model, apiKey) {
205
+ this.model = model;
206
+ this.apiKey = apiKey || getApiKey();
207
+ }
208
+ buildUrl(stream) {
209
+ const action = stream ? 'streamGenerateContent?alt=sse&' : 'generateContent?';
210
+ return `https://generativelanguage.googleapis.com/v1beta/models/${this.model}:${action}key=${this.apiKey}`;
211
+ }
212
+ formatContents(messages, systemPrompt) {
213
+ const contents = [];
214
+ for (const m of messages) {
215
+ contents.push({ role: m.role === 'assistant' ? 'model' : 'user', parts: [{ text: m.content }] });
216
+ }
217
+ const result = { contents };
218
+ if (systemPrompt) {
219
+ result.systemInstruction = { parts: [{ text: systemPrompt }] };
220
+ }
221
+ return result;
222
+ }
223
+ async chat(messages, systemPrompt) {
224
+ if (!this.apiKey) {
225
+ const last = messages[messages.length - 1];
226
+ return `[gemini/${this.model} - no API key] Echo: ${last?.content ?? ''}`;
227
+ }
228
+ const body = this.formatContents(messages, systemPrompt);
229
+ const url = this.buildUrl(false);
230
+ const postData = JSON.stringify(body);
231
+ return new Promise((resolve, reject) => {
232
+ const parsedUrl = new URL(url);
233
+ const req = https.request({
234
+ hostname: parsedUrl.hostname,
235
+ path: parsedUrl.pathname + parsedUrl.search,
236
+ method: 'POST',
237
+ headers: { 'Content-Type': 'application/json', 'Content-Length': String(Buffer.byteLength(postData)) },
238
+ }, (res) => {
239
+ let data = '';
240
+ res.on('data', (chunk) => (data += chunk.toString()));
241
+ res.on('end', () => {
242
+ if (res.statusCode && res.statusCode >= 400) {
243
+ reject(new Error(`Gemini API error ${res.statusCode}: ${data}`));
244
+ return;
245
+ }
246
+ try {
247
+ const parsed = JSON.parse(data);
248
+ resolve(parsed.candidates?.[0]?.content?.parts?.[0]?.text ?? '');
249
+ }
250
+ catch {
251
+ reject(new Error(`Invalid Gemini response: ${data.slice(0, 200)}`));
252
+ }
253
+ });
254
+ });
255
+ req.on('error', reject);
256
+ req.write(postData);
257
+ req.end();
258
+ });
259
+ }
260
+ async *chatStream(messages, systemPrompt) {
261
+ if (!this.apiKey) {
262
+ const last = messages[messages.length - 1];
263
+ yield `[gemini/${this.model} - no API key] Echo: ${last?.content ?? ''}`;
264
+ return;
265
+ }
266
+ const body = this.formatContents(messages, systemPrompt);
267
+ const url = this.buildUrl(true);
268
+ const postData = JSON.stringify(body);
269
+ const parsedUrl = new URL(url);
270
+ const response = await new Promise((resolve, reject) => {
271
+ const req = https.request({
272
+ hostname: parsedUrl.hostname,
273
+ path: parsedUrl.pathname + parsedUrl.search,
274
+ method: 'POST',
275
+ headers: { 'Content-Type': 'application/json', 'Content-Length': String(Buffer.byteLength(postData)) },
276
+ }, resolve);
277
+ req.on('error', reject);
278
+ req.write(postData);
279
+ req.end();
280
+ });
281
+ if (response.statusCode && response.statusCode >= 400) {
282
+ let data = '';
283
+ for await (const chunk of response)
284
+ data += chunk.toString();
285
+ throw new Error(`Gemini API error ${response.statusCode}: ${data}`);
286
+ }
287
+ let buffer = '';
288
+ for await (const chunk of response) {
289
+ buffer += chunk.toString();
290
+ const lines = buffer.split('\n');
291
+ buffer = lines.pop() ?? '';
292
+ for (const line of lines) {
293
+ const trimmed = line.trim();
294
+ if (!trimmed.startsWith('data: '))
295
+ continue;
296
+ const data = trimmed.slice(6);
297
+ if (data === '[DONE]')
298
+ return;
299
+ try {
300
+ const parsed = JSON.parse(data);
301
+ const text = parsed.candidates?.[0]?.content?.parts?.[0]?.text;
302
+ if (text)
303
+ yield text;
304
+ }
305
+ catch { }
306
+ }
307
+ }
308
+ }
309
+ }
310
+ function isGeminiNative() {
311
+ const baseUrl = process.env.OPC_LLM_BASE_URL || '';
312
+ const key = getApiKey();
313
+ // Use native Gemini API when: key starts with AQ. (new format) OR base URL points to googleapis
314
+ return key.startsWith('AQ.') || (baseUrl.includes('googleapis.com') && !baseUrl.includes('/openai'));
315
+ }
186
316
  function createProvider(name = 'openai', model, baseUrl, apiKey) {
187
317
  const finalModel = model || process.env.OPC_LLM_MODEL || 'gpt-4o-mini';
318
+ const finalKey = apiKey || getApiKey();
319
+ // Auto-detect Gemini native when key is new format
320
+ if (finalKey.startsWith('AQ.') || isGeminiNative()) {
321
+ return new GeminiNativeProvider(finalModel, finalKey);
322
+ }
188
323
  return new OpenAICompatibleProvider(name, finalModel, baseUrl, apiKey);
189
324
  }
190
- exports.SUPPORTED_PROVIDERS = ['openai', 'deepseek', 'qwen'];
325
+ exports.SUPPORTED_PROVIDERS = ['openai', 'deepseek', 'qwen', 'gemini'];
191
326
  //# sourceMappingURL=index.js.map
@@ -577,6 +577,7 @@ export declare const SpecSchema: z.ZodObject<{
577
577
  config?: Record<string, unknown> | undefined;
578
578
  }[] | undefined;
579
579
  }, {
580
+ model?: string | undefined;
580
581
  auth?: {
581
582
  enabled?: boolean | undefined;
582
583
  apiKeys?: string[] | undefined;
@@ -597,7 +598,6 @@ export declare const SpecSchema: z.ZodObject<{
597
598
  default?: string | undefined;
598
599
  allowed?: string[] | undefined;
599
600
  } | undefined;
600
- model?: string | undefined;
601
601
  systemPrompt?: string | undefined;
602
602
  skills?: {
603
603
  name: string;
@@ -995,6 +995,7 @@ export declare const OADSchema: z.ZodObject<{
995
995
  config?: Record<string, unknown> | undefined;
996
996
  }[] | undefined;
997
997
  }, {
998
+ model?: string | undefined;
998
999
  auth?: {
999
1000
  enabled?: boolean | undefined;
1000
1001
  apiKeys?: string[] | undefined;
@@ -1015,7 +1016,6 @@ export declare const OADSchema: z.ZodObject<{
1015
1016
  default?: string | undefined;
1016
1017
  allowed?: string[] | undefined;
1017
1018
  } | undefined;
1018
- model?: string | undefined;
1019
1019
  systemPrompt?: string | undefined;
1020
1020
  skills?: {
1021
1021
  name: string;
@@ -1183,6 +1183,7 @@ export declare const OADSchema: z.ZodObject<{
1183
1183
  } | undefined;
1184
1184
  };
1185
1185
  spec: {
1186
+ model?: string | undefined;
1186
1187
  auth?: {
1187
1188
  enabled?: boolean | undefined;
1188
1189
  apiKeys?: string[] | undefined;
@@ -1203,7 +1204,6 @@ export declare const OADSchema: z.ZodObject<{
1203
1204
  default?: string | undefined;
1204
1205
  allowed?: string[] | undefined;
1205
1206
  } | undefined;
1206
- model?: string | undefined;
1207
1207
  systemPrompt?: string | undefined;
1208
1208
  skills?: {
1209
1209
  name: string;
@@ -2,11 +2,11 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.CODE_REVIEWER_SYSTEM_PROMPT = void 0;
4
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
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
10
  Rate severity: 🔴 Critical | 🟡 Warning | 🔵 Info`;
11
11
  function createCodeReviewerConfig() {
12
12
  return {
@@ -41,8 +41,8 @@ class HandoffSkill extends base_1.BaseSkill {
41
41
  }
42
42
  }
43
43
  exports.HandoffSkill = HandoffSkill;
44
- exports.CUSTOMER_SERVICE_SYSTEM_PROMPT = `You are a friendly and professional customer service agent.
45
- You help customers with their questions about products, orders, shipping, and returns.
44
+ exports.CUSTOMER_SERVICE_SYSTEM_PROMPT = `You are a friendly and professional customer service agent.
45
+ You help customers with their questions about products, orders, shipping, and returns.
46
46
  Be concise, helpful, and empathetic. If you're unsure, offer to connect them with a human agent.`;
47
47
  function createCustomerServiceConfig() {
48
48
  return {
@@ -33,11 +33,11 @@ class InsightSkill extends base_1.BaseSkill {
33
33
  }
34
34
  }
35
35
  exports.InsightSkill = InsightSkill;
36
- exports.DATA_ANALYST_SYSTEM_PROMPT = `You are a professional data analyst assistant. Your goals:
37
- 1. Help users query, transform, and analyze data
38
- 2. Create clear visualizations and summaries
39
- 3. Identify trends, patterns, and anomalies
40
- 4. Explain findings in plain language
36
+ exports.DATA_ANALYST_SYSTEM_PROMPT = `You are a professional data analyst assistant. Your goals:
37
+ 1. Help users query, transform, and analyze data
38
+ 2. Create clear visualizations and summaries
39
+ 3. Identify trends, patterns, and anomalies
40
+ 4. Explain findings in plain language
41
41
  Be precise with numbers, always cite your data source, and suggest next steps for deeper analysis.`;
42
42
  function createDataAnalystConfig() {
43
43
  return {
@@ -2,8 +2,8 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.KNOWLEDGE_BASE_SYSTEM_PROMPT = void 0;
4
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.
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
7
  Always cite sources when possible. Be accurate and concise.`;
8
8
  function createKnowledgeBaseConfig() {
9
9
  return {
@@ -43,10 +43,10 @@ class LeadCaptureSkill extends base_1.BaseSkill {
43
43
  }
44
44
  }
45
45
  exports.LeadCaptureSkill = LeadCaptureSkill;
46
- exports.SALES_ASSISTANT_SYSTEM_PROMPT = `You are a professional sales assistant. Your goals:
47
- 1. Answer product questions accurately and enthusiastically
48
- 2. Capture leads by collecting name, email, and company info
49
- 3. Book appointments when prospects are ready
46
+ exports.SALES_ASSISTANT_SYSTEM_PROMPT = `You are a professional sales assistant. Your goals:
47
+ 1. Answer product questions accurately and enthusiastically
48
+ 2. Capture leads by collecting name, email, and company info
49
+ 3. Book appointments when prospects are ready
50
50
  Be friendly, persuasive but not pushy. Always provide value first.`;
51
51
  function createSalesAssistantConfig() {
52
52
  return {
@@ -39,12 +39,12 @@ class ExplainSkill extends base_1.BaseSkill {
39
39
  }
40
40
  }
41
41
  exports.ExplainSkill = ExplainSkill;
42
- exports.TEACHER_SYSTEM_PROMPT = `You are a patient and encouraging teacher assistant. Your goals:
43
- 1. Create engaging lesson plans tailored to student level
44
- 2. Generate quizzes and assessments with answer keys
45
- 3. Explain complex concepts using analogies and examples
46
- 4. Provide constructive feedback and encouragement
47
- 5. Adapt teaching style to different learning preferences
42
+ exports.TEACHER_SYSTEM_PROMPT = `You are a patient and encouraging teacher assistant. Your goals:
43
+ 1. Create engaging lesson plans tailored to student level
44
+ 2. Generate quizzes and assessments with answer keys
45
+ 3. Explain complex concepts using analogies and examples
46
+ 4. Provide constructive feedback and encouragement
47
+ 5. Adapt teaching style to different learning preferences
48
48
  Be patient, use clear language, and always check for understanding. Use the Socratic method when appropriate.`;
49
49
  function createTeacherConfig() {
50
50
  return {
@@ -1,103 +1,103 @@
1
- import { defineConfig } from 'vitepress';
2
-
3
- export default defineConfig({
4
- title: 'OPC Agent',
5
- description: 'Open Agent Framework - Build, test, and run AI Agents for business workstations',
6
-
7
- locales: {
8
- root: {
9
- label: 'English',
10
- lang: 'en',
11
- themeConfig: {
12
- nav: [
13
- { text: 'Guide', link: '/guide/getting-started' },
14
- { text: 'API', link: '/api/oad-schema' },
15
- { text: 'GitHub', link: 'https://github.com/Deepleaper/opc-agent' },
16
- ],
17
- sidebar: {
18
- '/guide/': [
19
- {
20
- text: 'Introduction',
21
- items: [
22
- { text: 'Getting Started', link: '/guide/getting-started' },
23
- { text: 'Core Concepts', link: '/guide/concepts' },
24
- ],
25
- },
26
- {
27
- text: 'Usage',
28
- items: [
29
- { text: 'Templates', link: '/guide/templates' },
30
- { text: 'Configuration', link: '/guide/configuration' },
31
- { text: 'Testing', link: '/guide/testing' },
32
- { text: 'Deployment', link: '/guide/deployment' },
33
- ],
34
- },
35
- ],
36
- '/api/': [
37
- {
38
- text: 'Reference',
39
- items: [
40
- { text: 'OAD Schema', link: '/api/oad-schema' },
41
- { text: 'CLI Commands', link: '/api/cli' },
42
- { text: 'SDK', link: '/api/sdk' },
43
- ],
44
- },
45
- ],
46
- },
47
- },
48
- },
49
- zh: {
50
- label: '中文',
51
- lang: 'zh-CN',
52
- description: '开放智能体框架 — 构建、测试、运行企业级 AI 智能体',
53
- themeConfig: {
54
- nav: [
55
- { text: '指南', link: '/zh/guide/getting-started' },
56
- { text: 'API', link: '/zh/api/oad-schema' },
57
- { text: 'GitHub', link: 'https://github.com/Deepleaper/opc-agent' },
58
- ],
59
- sidebar: {
60
- '/zh/guide/': [
61
- {
62
- text: '入门',
63
- items: [
64
- { text: '快速开始', link: '/zh/guide/getting-started' },
65
- { text: '核心概念', link: '/zh/guide/concepts' },
66
- ],
67
- },
68
- {
69
- text: '使用',
70
- items: [
71
- { text: '模板', link: '/zh/guide/templates' },
72
- { text: '配置', link: '/zh/guide/configuration' },
73
- { text: '测试', link: '/zh/guide/testing' },
74
- { text: '部署', link: '/zh/guide/deployment' },
75
- ],
76
- },
77
- ],
78
- '/zh/api/': [
79
- {
80
- text: '参考',
81
- items: [
82
- { text: 'OAD Schema', link: '/zh/api/oad-schema' },
83
- { text: 'CLI 命令', link: '/zh/api/cli' },
84
- { text: 'SDK', link: '/zh/api/sdk' },
85
- ],
86
- },
87
- ],
88
- },
89
- },
90
- },
91
- },
92
-
93
- themeConfig: {
94
- logo: '/logo.svg',
95
- socialLinks: [
96
- { icon: 'github', link: 'https://github.com/Deepleaper/opc-agent' },
97
- ],
98
- footer: {
99
- message: 'Released under the Apache-2.0 License.',
100
- copyright: 'Copyright © 2025 Deepleaper 跃盟科技',
101
- },
102
- },
103
- });
1
+ import { defineConfig } from 'vitepress';
2
+
3
+ export default defineConfig({
4
+ title: 'OPC Agent',
5
+ description: 'Open Agent Framework - Build, test, and run AI Agents for business workstations',
6
+
7
+ locales: {
8
+ root: {
9
+ label: 'English',
10
+ lang: 'en',
11
+ themeConfig: {
12
+ nav: [
13
+ { text: 'Guide', link: '/guide/getting-started' },
14
+ { text: 'API', link: '/api/oad-schema' },
15
+ { text: 'GitHub', link: 'https://github.com/Deepleaper/opc-agent' },
16
+ ],
17
+ sidebar: {
18
+ '/guide/': [
19
+ {
20
+ text: 'Introduction',
21
+ items: [
22
+ { text: 'Getting Started', link: '/guide/getting-started' },
23
+ { text: 'Core Concepts', link: '/guide/concepts' },
24
+ ],
25
+ },
26
+ {
27
+ text: 'Usage',
28
+ items: [
29
+ { text: 'Templates', link: '/guide/templates' },
30
+ { text: 'Configuration', link: '/guide/configuration' },
31
+ { text: 'Testing', link: '/guide/testing' },
32
+ { text: 'Deployment', link: '/guide/deployment' },
33
+ ],
34
+ },
35
+ ],
36
+ '/api/': [
37
+ {
38
+ text: 'Reference',
39
+ items: [
40
+ { text: 'OAD Schema', link: '/api/oad-schema' },
41
+ { text: 'CLI Commands', link: '/api/cli' },
42
+ { text: 'SDK', link: '/api/sdk' },
43
+ ],
44
+ },
45
+ ],
46
+ },
47
+ },
48
+ },
49
+ zh: {
50
+ label: '中文',
51
+ lang: 'zh-CN',
52
+ description: '开放智能体框架 — 构建、测试、运行企业级 AI 智能体',
53
+ themeConfig: {
54
+ nav: [
55
+ { text: '指南', link: '/zh/guide/getting-started' },
56
+ { text: 'API', link: '/zh/api/oad-schema' },
57
+ { text: 'GitHub', link: 'https://github.com/Deepleaper/opc-agent' },
58
+ ],
59
+ sidebar: {
60
+ '/zh/guide/': [
61
+ {
62
+ text: '入门',
63
+ items: [
64
+ { text: '快速开始', link: '/zh/guide/getting-started' },
65
+ { text: '核心概念', link: '/zh/guide/concepts' },
66
+ ],
67
+ },
68
+ {
69
+ text: '使用',
70
+ items: [
71
+ { text: '模板', link: '/zh/guide/templates' },
72
+ { text: '配置', link: '/zh/guide/configuration' },
73
+ { text: '测试', link: '/zh/guide/testing' },
74
+ { text: '部署', link: '/zh/guide/deployment' },
75
+ ],
76
+ },
77
+ ],
78
+ '/zh/api/': [
79
+ {
80
+ text: '参考',
81
+ items: [
82
+ { text: 'OAD Schema', link: '/zh/api/oad-schema' },
83
+ { text: 'CLI 命令', link: '/zh/api/cli' },
84
+ { text: 'SDK', link: '/zh/api/sdk' },
85
+ ],
86
+ },
87
+ ],
88
+ },
89
+ },
90
+ },
91
+ },
92
+
93
+ themeConfig: {
94
+ logo: '/logo.svg',
95
+ socialLinks: [
96
+ { icon: 'github', link: 'https://github.com/Deepleaper/opc-agent' },
97
+ ],
98
+ footer: {
99
+ message: 'Released under the Apache-2.0 License.',
100
+ copyright: 'Copyright © 2025 Deepleaper 跃盟科技',
101
+ },
102
+ },
103
+ });