foliko 2.0.5 → 2.0.7
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/.claude/settings.local.json +4 -1
- package/.cli_default_systemPrompt.md +291 -0
- package/CLAUDE.md +3 -0
- package/README.md +20 -3
- package/docs/architecture.md +34 -2
- package/docs/extensions.md +199 -0
- package/docs/migration.md +100 -0
- package/docs/public-api.md +280 -24
- package/docs/usage.md +122 -30
- package/package.json +1 -1
- package/plugins/core/audit/index.js +1 -1
- package/plugins/core/default/bootstrap.js +44 -19
- package/plugins/core/python-loader/index.js +43 -25
- package/plugins/core/scheduler/index.js +1 -0
- package/plugins/core/skill-manager/PROMPT.md +6 -0
- package/plugins/core/skill-manager/index.js +402 -115
- package/plugins/core/sub-agent/PROMPT.md +10 -0
- package/plugins/core/sub-agent/index.js +36 -3
- package/plugins/core/think/index.js +1 -0
- package/plugins/core/workflow/context.js +941 -0
- package/plugins/core/workflow/engine.js +66 -0
- package/plugins/core/workflow/examples/01-basic.js +42 -0
- package/plugins/core/workflow/examples/01-basic.json +30 -0
- package/plugins/core/workflow/examples/02-choice.js +75 -0
- package/plugins/core/workflow/examples/02-choice.json +59 -0
- package/plugins/core/workflow/examples/03-chain-style.js +114 -0
- package/plugins/core/workflow/examples/03-each.json +41 -0
- package/plugins/core/workflow/examples/04-parallel.js +52 -0
- package/plugins/core/workflow/examples/04-parallel.json +51 -0
- package/plugins/core/workflow/examples/05-chain-style.json +68 -0
- package/plugins/core/workflow/examples/05-each.js +65 -0
- package/plugins/core/workflow/examples/06-script.js +82 -0
- package/plugins/core/workflow/examples/07-module-export.js +43 -0
- package/plugins/core/workflow/examples/08-default-export.js +29 -0
- package/plugins/core/workflow/examples/09-next-with-args.js +50 -0
- package/plugins/core/workflow/examples/10-logger.js +34 -0
- package/plugins/core/workflow/examples/11-storage.js +68 -0
- package/plugins/core/workflow/examples/simple.js +77 -0
- package/plugins/core/workflow/examples/simple.json +75 -0
- package/plugins/core/workflow/index.js +204 -78
- package/plugins/core/workflow/js-runner.js +318 -0
- package/plugins/core/workflow/json-runner.js +323 -0
- package/plugins/core/workflow/stages/action.js +211 -0
- package/plugins/core/workflow/stages/choice.js +74 -0
- package/plugins/core/workflow/stages/delay.js +73 -0
- package/plugins/core/workflow/stages/each.js +123 -0
- package/plugins/core/workflow/stages/parallel.js +69 -0
- package/plugins/core/workflow/stages/try.js +142 -0
- package/plugins/executors/data-splitter/PROMPT.md +13 -0
- package/plugins/executors/data-splitter/index.js +8 -6
- package/plugins/executors/extension/extension-registry.js +145 -0
- package/plugins/executors/extension/index.js +405 -437
- package/plugins/executors/extension/prompt-builder.js +359 -0
- package/plugins/executors/extension/skill-helper.js +143 -0
- package/plugins/messaging/feishu/index.js +5 -3
- package/plugins/messaging/qq/index.js +6 -4
- package/plugins/messaging/telegram/index.js +6 -3
- package/plugins/messaging/weixin/index.js +5 -3
- package/plugins/tools/PROMPT.md +26 -0
- package/plugins/tools/index.js +6 -5
- package/sandbox/check-context.js +5 -0
- package/sandbox/test-context.js +27 -0
- package/sandbox/test-fixes.js +40 -0
- package/sandbox/test-hello-js.js +46 -0
- package/skills/foliko/AGENTS.md +196 -43
- package/skills/foliko/SKILL.md +157 -28
- package/skills/mcp/SKILL.md +77 -118
- package/skills/plugins/SKILL.md +89 -3
- package/skills/python/SKILL.md +57 -39
- package/skills/skill-guide/SKILL.md +42 -34
- package/skills/workflows/SKILL.md +753 -436
- package/src/agent/chat.js +56 -28
- package/src/agent/main.js +39 -14
- package/src/agent/prompt-registry.js +56 -16
- package/src/agent/prompts/PROMPT.md +3 -0
- package/src/agent/sub.js +1 -1
- package/src/cli/ui/chat-ui-old.js +5 -2
- package/src/cli/ui/chat-ui.js +9 -5
- package/src/common/constants.js +12 -0
- package/src/common/error-capture.js +91 -0
- package/src/common/json-safe.js +20 -0
- package/src/common/logger.js +2 -2
- package/src/context/compressor.js +6 -2
- package/src/executors/mcp-executor.js +105 -125
- package/src/framework/framework.js +78 -12
- package/src/index.js +4 -0
- package/src/plugin/base.js +908 -5
- package/src/plugin/manager.js +124 -9
- package/src/tool/schema.js +32 -9
- package/src/utils/sandbox.js +1 -1
- package/website/index.html +821 -0
- package/skills/workflows/workflow-troubleshooting/DEBUGGING.md +0 -197
- package/skills/workflows/workflow-troubleshooting/SKILL.md +0 -391
|
@@ -306,10 +306,14 @@ class SubAgentManagerPlugin extends Plugin {
|
|
|
306
306
|
prompts = [
|
|
307
307
|
{
|
|
308
308
|
name: 'subagents',
|
|
309
|
-
|
|
309
|
+
file: path.join(__dirname, 'PROMPT.md'),
|
|
310
|
+
scope: 'global',
|
|
311
|
+
priority: 60,
|
|
310
312
|
description: '子Agent描述与分配规则',
|
|
311
|
-
|
|
312
|
-
|
|
313
|
+
// interpolate 在渲染时注入动态内容
|
|
314
|
+
interpolate: (content) => {
|
|
315
|
+
const list = this._buildSubAgentsList();
|
|
316
|
+
return content.replace('{{subagents}}', list || '(暂无)');
|
|
313
317
|
},
|
|
314
318
|
},
|
|
315
319
|
];
|
|
@@ -567,6 +571,35 @@ class SubAgentManagerPlugin extends Plugin {
|
|
|
567
571
|
return config
|
|
568
572
|
}
|
|
569
573
|
|
|
574
|
+
_buildSubAgentsList() {
|
|
575
|
+
const allSubAgents = this.getAllSubAgents();
|
|
576
|
+
if (!allSubAgents || allSubAgents.length === 0) {
|
|
577
|
+
return '';
|
|
578
|
+
}
|
|
579
|
+
|
|
580
|
+
const lines = [];
|
|
581
|
+
for (const plugin of allSubAgents) {
|
|
582
|
+
const name = plugin.name;
|
|
583
|
+
const role = plugin.role;
|
|
584
|
+
const goal = plugin.description || '';
|
|
585
|
+
|
|
586
|
+
const config = this._framework._subAgentConfigManager?.get(name);
|
|
587
|
+
if (config) {
|
|
588
|
+
const agentDesc = config.getDescription();
|
|
589
|
+
const skills = config.getSkills();
|
|
590
|
+
let info = agentDesc || role || goal || '子代理';
|
|
591
|
+
if (skills && skills.length > 0) {
|
|
592
|
+
info += ` (技能: ${skills.join(', ')})`;
|
|
593
|
+
}
|
|
594
|
+
lines.push(`- **${name}**:${info}`);
|
|
595
|
+
} else {
|
|
596
|
+
lines.push(`- **${name}**:${role || goal || '子代理'}`);
|
|
597
|
+
}
|
|
598
|
+
}
|
|
599
|
+
|
|
600
|
+
return lines.join('\n');
|
|
601
|
+
}
|
|
602
|
+
|
|
570
603
|
_buildDescription() {
|
|
571
604
|
const allSubAgents = this.getAllSubAgents();
|
|
572
605
|
if (!allSubAgents || allSubAgents.length === 0) {
|