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.
Files changed (93) hide show
  1. package/.claude/settings.local.json +4 -1
  2. package/.cli_default_systemPrompt.md +291 -0
  3. package/CLAUDE.md +3 -0
  4. package/README.md +20 -3
  5. package/docs/architecture.md +34 -2
  6. package/docs/extensions.md +199 -0
  7. package/docs/migration.md +100 -0
  8. package/docs/public-api.md +280 -24
  9. package/docs/usage.md +122 -30
  10. package/package.json +1 -1
  11. package/plugins/core/audit/index.js +1 -1
  12. package/plugins/core/default/bootstrap.js +44 -19
  13. package/plugins/core/python-loader/index.js +43 -25
  14. package/plugins/core/scheduler/index.js +1 -0
  15. package/plugins/core/skill-manager/PROMPT.md +6 -0
  16. package/plugins/core/skill-manager/index.js +402 -115
  17. package/plugins/core/sub-agent/PROMPT.md +10 -0
  18. package/plugins/core/sub-agent/index.js +36 -3
  19. package/plugins/core/think/index.js +1 -0
  20. package/plugins/core/workflow/context.js +941 -0
  21. package/plugins/core/workflow/engine.js +66 -0
  22. package/plugins/core/workflow/examples/01-basic.js +42 -0
  23. package/plugins/core/workflow/examples/01-basic.json +30 -0
  24. package/plugins/core/workflow/examples/02-choice.js +75 -0
  25. package/plugins/core/workflow/examples/02-choice.json +59 -0
  26. package/plugins/core/workflow/examples/03-chain-style.js +114 -0
  27. package/plugins/core/workflow/examples/03-each.json +41 -0
  28. package/plugins/core/workflow/examples/04-parallel.js +52 -0
  29. package/plugins/core/workflow/examples/04-parallel.json +51 -0
  30. package/plugins/core/workflow/examples/05-chain-style.json +68 -0
  31. package/plugins/core/workflow/examples/05-each.js +65 -0
  32. package/plugins/core/workflow/examples/06-script.js +82 -0
  33. package/plugins/core/workflow/examples/07-module-export.js +43 -0
  34. package/plugins/core/workflow/examples/08-default-export.js +29 -0
  35. package/plugins/core/workflow/examples/09-next-with-args.js +50 -0
  36. package/plugins/core/workflow/examples/10-logger.js +34 -0
  37. package/plugins/core/workflow/examples/11-storage.js +68 -0
  38. package/plugins/core/workflow/examples/simple.js +77 -0
  39. package/plugins/core/workflow/examples/simple.json +75 -0
  40. package/plugins/core/workflow/index.js +204 -78
  41. package/plugins/core/workflow/js-runner.js +318 -0
  42. package/plugins/core/workflow/json-runner.js +323 -0
  43. package/plugins/core/workflow/stages/action.js +211 -0
  44. package/plugins/core/workflow/stages/choice.js +74 -0
  45. package/plugins/core/workflow/stages/delay.js +73 -0
  46. package/plugins/core/workflow/stages/each.js +123 -0
  47. package/plugins/core/workflow/stages/parallel.js +69 -0
  48. package/plugins/core/workflow/stages/try.js +142 -0
  49. package/plugins/executors/data-splitter/PROMPT.md +13 -0
  50. package/plugins/executors/data-splitter/index.js +8 -6
  51. package/plugins/executors/extension/extension-registry.js +145 -0
  52. package/plugins/executors/extension/index.js +405 -437
  53. package/plugins/executors/extension/prompt-builder.js +359 -0
  54. package/plugins/executors/extension/skill-helper.js +143 -0
  55. package/plugins/messaging/feishu/index.js +5 -3
  56. package/plugins/messaging/qq/index.js +6 -4
  57. package/plugins/messaging/telegram/index.js +6 -3
  58. package/plugins/messaging/weixin/index.js +5 -3
  59. package/plugins/tools/PROMPT.md +26 -0
  60. package/plugins/tools/index.js +6 -5
  61. package/sandbox/check-context.js +5 -0
  62. package/sandbox/test-context.js +27 -0
  63. package/sandbox/test-fixes.js +40 -0
  64. package/sandbox/test-hello-js.js +46 -0
  65. package/skills/foliko/AGENTS.md +196 -43
  66. package/skills/foliko/SKILL.md +157 -28
  67. package/skills/mcp/SKILL.md +77 -118
  68. package/skills/plugins/SKILL.md +89 -3
  69. package/skills/python/SKILL.md +57 -39
  70. package/skills/skill-guide/SKILL.md +42 -34
  71. package/skills/workflows/SKILL.md +753 -436
  72. package/src/agent/chat.js +56 -28
  73. package/src/agent/main.js +39 -14
  74. package/src/agent/prompt-registry.js +56 -16
  75. package/src/agent/prompts/PROMPT.md +3 -0
  76. package/src/agent/sub.js +1 -1
  77. package/src/cli/ui/chat-ui-old.js +5 -2
  78. package/src/cli/ui/chat-ui.js +9 -5
  79. package/src/common/constants.js +12 -0
  80. package/src/common/error-capture.js +91 -0
  81. package/src/common/json-safe.js +20 -0
  82. package/src/common/logger.js +2 -2
  83. package/src/context/compressor.js +6 -2
  84. package/src/executors/mcp-executor.js +105 -125
  85. package/src/framework/framework.js +78 -12
  86. package/src/index.js +4 -0
  87. package/src/plugin/base.js +908 -5
  88. package/src/plugin/manager.js +124 -9
  89. package/src/tool/schema.js +32 -9
  90. package/src/utils/sandbox.js +1 -1
  91. package/website/index.html +821 -0
  92. package/skills/workflows/workflow-troubleshooting/DEBUGGING.md +0 -197
  93. package/skills/workflows/workflow-troubleshooting/SKILL.md +0 -391
@@ -176,13 +176,17 @@ module.exports = [
176
176
 
177
177
  ### ext_call 调用格式
178
178
 
179
- 当需要通过 AI 调用 skill 命令时,使用 `ext_call` 工具:
179
+ 每个 skill 自动注册为 `skill:<技能名>` 扩展,通过 `ext_call` + `ext_skill` 统一调用。
180
180
 
181
181
  ```javascript
182
+ // 1. 先查询命令参数
183
+ ext_skill({ plugin: "skill:<技能名>" })
184
+
185
+ // 2. 用命令行字符串调用
182
186
  ext_call({
183
- plugin: "skill",
184
- tool: "<skillname>:<commandname>",
185
- args: { command: "<命令行>" }
187
+ plugin: "skill:<技能名>",
188
+ tool: "<commandname>",
189
+ args: { command: "-n Alice -l en" }
186
190
  });
187
191
  ```
188
192
 
@@ -190,31 +194,31 @@ ext_call({
190
194
 
191
195
  | 参数 | 类型 | 说明 |
192
196
  |------|------|------|
193
- | `plugin` | string | 固定为 `"skill"` |
194
- | `tool` | string | 格式为 `<技能名>:<命令名>`,如 `test-skill:greet` |
195
- | `args.command` | string | 命令行参数字符串 |
197
+ | `plugin` | string | 固定为 `"skill:<技能名>"`,如 `skill:test-skill` |
198
+ | `tool` | string | 命令名(不带技能前缀),如 `greet` |
199
+ | `args` | object | 固定为 `{ command: "命令行字符串" }` |
196
200
 
197
201
  **示例:**
198
202
 
199
203
  ```javascript
200
- // 调用 test-skill 的 greet 命令,无参数
204
+ // 调用 test-skill 的 greet 命令
201
205
  ext_call({
202
- plugin: "skill",
203
- tool: "test-skill:greet",
204
- args: { command: "" }
206
+ plugin: "skill:test-skill",
207
+ tool: "greet",
208
+ args: { command: "-n Alice" }
205
209
  });
206
210
 
207
- // 调用 test-skill 的 greet 命令,带参数
211
+ // 调用 test-skill 的 greet 命令,带可选 lang
208
212
  ext_call({
209
- plugin: "skill",
210
- tool: "test-skill:greet",
211
- args: { command: "Alice" }
213
+ plugin: "skill:test-skill",
214
+ tool: "greet",
215
+ args: { command: "-n Alice -l en" }
212
216
  });
213
217
 
214
218
  // 调用 test-skill 的 echo 命令
215
219
  ext_call({
216
- plugin: "skill",
217
- tool: "test-skill:echo",
220
+ plugin: "skill:test-skill",
221
+ tool: "echo",
218
222
  args: { command: "Hello World" }
219
223
  });
220
224
  ```
@@ -383,13 +387,17 @@ module.exports = [
383
387
 
384
388
  ### ext_call 调用格式
385
389
 
386
- 当需要通过 AI 调用 skill 命令时,使用 `ext_call` 工具:
390
+ 每个 skill 自动注册为 `skill:<技能名>` 扩展,通过 `ext_call` + `ext_skill` 统一调用。
387
391
 
388
392
  ```javascript
393
+ // 1. 先查询命令参数
394
+ ext_skill({ plugin: "skill:<技能名>" })
395
+
396
+ // 2. 用命令行字符串调用
389
397
  ext_call({
390
- plugin: "skill",
391
- tool: "<skillname>:<commandname>",
392
- args: { command: "<命令行>" }
398
+ plugin: "skill:<技能名>",
399
+ tool: "<commandname>",
400
+ args: { command: "-n Alice -l en" }
393
401
  });
394
402
  ```
395
403
 
@@ -397,31 +405,31 @@ ext_call({
397
405
 
398
406
  | 参数 | 类型 | 说明 |
399
407
  |------|------|------|
400
- | `plugin` | string | 固定为 `"skill"` |
401
- | `tool` | string | 格式为 `<技能名>:<命令名>`,如 `test-skill:greet` |
402
- | `args.command` | string | 命令行参数字符串 |
408
+ | `plugin` | string | 固定为 `"skill:<技能名>"`,如 `skill:test-skill` |
409
+ | `tool` | string | 命令名(不带技能前缀),如 `greet` |
410
+ | `args` | object | 固定为 `{ command: "命令行字符串" }` |
403
411
 
404
412
  **示例:**
405
413
 
406
414
  ```javascript
407
- // 调用 test-skill 的 greet 命令,无参数
415
+ // 调用 test-skill 的 greet 命令
408
416
  ext_call({
409
- plugin: "skill",
410
- tool: "test-skill:greet",
411
- args: { command: "" }
417
+ plugin: "skill:test-skill",
418
+ tool: "greet",
419
+ args: { command: "-n Alice" }
412
420
  });
413
421
 
414
- // 调用 test-skill 的 greet 命令,带参数
422
+ // 调用 test-skill 的 greet 命令,带可选 lang
415
423
  ext_call({
416
- plugin: "skill",
417
- tool: "test-skill:greet",
418
- args: { command: "Alice" }
424
+ plugin: "skill:test-skill",
425
+ tool: "greet",
426
+ args: { command: "-n Alice -l en" }
419
427
  });
420
428
 
421
429
  // 调用 test-skill 的 echo 命令
422
430
  ext_call({
423
- plugin: "skill",
424
- tool: "test-skill:echo",
431
+ plugin: "skill:test-skill",
432
+ tool: "echo",
425
433
  args: { command: "Hello World" }
426
434
  });
427
435
  ```