dsh-plugin-prompt-tool 1.0.0 → 2.0.1

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 (95) hide show
  1. package/README.md +38 -29
  2. package/engine/actions/append-context.mjs +49 -0
  3. package/engine/actions/assembly.mjs +150 -0
  4. package/engine/actions/catalog.mjs +92 -0
  5. package/engine/actions/content.mjs +205 -0
  6. package/engine/actions/decision.mjs +54 -0
  7. package/engine/actions/examples.mjs +11 -0
  8. package/engine/actions/guard.mjs +80 -0
  9. package/engine/actions/inbox-prepend.mjs +37 -0
  10. package/engine/actions/index.mjs +100 -0
  11. package/engine/actions/inject-text.mjs +22 -0
  12. package/engine/actions/pre-step-filter.mjs +55 -0
  13. package/engine/actions/registration.mjs +168 -0
  14. package/engine/actions/request-params.mjs +32 -0
  15. package/engine/actions/sdk-strip.mjs +30 -0
  16. package/engine/actions/shared.mjs +71 -0
  17. package/engine/actions.mjs +2 -931
  18. package/engine/branch.mjs +44 -0
  19. package/engine/compaction-epoch.mjs +31 -13
  20. package/engine/compositions/source/local/dev-tool-search.yml +11 -0
  21. package/engine/compositions/source/local/instruction-hint.yml +22 -1
  22. package/engine/compositions/source/local/rule-engine.yml +6 -0
  23. package/engine/condition.mjs +16 -3
  24. package/engine/conditions/anchor.mjs +32 -0
  25. package/engine/conditions/availability.mjs +47 -0
  26. package/engine/conditions/composite.mjs +83 -0
  27. package/engine/conditions/count.mjs +140 -0
  28. package/engine/conditions/evaluation.mjs +41 -0
  29. package/engine/conditions/examples.mjs +11 -0
  30. package/engine/conditions/index.mjs +85 -0
  31. package/engine/conditions/names.mjs +21 -0
  32. package/engine/conditions/phase.mjs +54 -0
  33. package/engine/conditions/preset.mjs +94 -0
  34. package/engine/conditions/scope.mjs +18 -0
  35. package/engine/conditions/session.mjs +22 -0
  36. package/engine/conditions/source.mjs +63 -0
  37. package/engine/conditions/subject.mjs +121 -0
  38. package/engine/conditions/text.mjs +44 -0
  39. package/engine/conditions/values.mjs +32 -0
  40. package/engine/dev-tool-search.mjs +213 -0
  41. package/engine/executor.mjs +55 -6
  42. package/engine/fillers.mjs +23 -16
  43. package/engine/instruction-hint.mjs +34 -22
  44. package/engine/layers.mjs +135 -49
  45. package/engine/order.mjs +4 -1
  46. package/engine/predicates.mjs +2 -753
  47. package/engine/rule-engine.mjs +40 -0
  48. package/engine/rule-runtime.mjs +110 -0
  49. package/engine/rule-spec.mjs +187 -0
  50. package/engine/schema.mjs +16 -5
  51. package/engine/shared.mjs +1 -1
  52. package/engine/strategies.mjs +2 -235
  53. package/engine/subagent-tool-policy-core.mjs +7 -7
  54. package/engine/subagent-tool-policy.mjs +20 -10
  55. package/engine/tool-config-engine.mjs +53 -32
  56. package/engine/trigger-spec.mjs +49 -133
  57. package/lib/client.js +11117 -10860
  58. package/lib/client.js.map +1 -1
  59. package/lib/index.d.mts +82 -139
  60. package/lib/index.mjs +826 -1087
  61. package/lib/migrate-rules.d.mts +1 -0
  62. package/lib/migrate-rules.mjs +39 -0
  63. package/lib/module-package-CHPFweqK.mjs +2 -0
  64. package/lib/module-package-Cnd1_mwx.mjs +2872 -0
  65. package/lib/{paths-BgL42sSM.d.mts → paths-CyP0IkaM.d.mts} +223 -108
  66. package/lib/preset-transfer.d.mts +2 -2
  67. package/lib/preset-transfer.mjs +3 -2
  68. package/lib/{module-package-Cm3fHHlp.mjs → rules-migration-DJ6vASB5.mjs} +13696 -15557
  69. package/modules/ponytail/module.yml +381 -147
  70. package/modules/skill-surface/module.yml +74 -0
  71. package/modules/tool-surface/module.yml +67 -0
  72. package/package.json +5 -1
  73. package/templates/10-pre-step.yml +26 -22
  74. package/templates/14-first-turn-anchor.yml +25 -21
  75. package/templates/15-guide-auto.yml +34 -19
  76. package/templates/16-custom-fallback.yml +27 -15
  77. package/templates/18-placeholder-env-facts.yml +23 -14
  78. package/templates/20-system-section.yml +16 -10
  79. package/templates/30-runtime-context.yml +13 -7
  80. package/templates/40-agent-request.yml +11 -8
  81. package/templates/50-llm-stream.yml +14 -6
  82. package/templates/60-tool-pipeline.yml +15 -9
  83. package/templates/65-turn-stop.yml +19 -12
  84. package/templates/66-subagent-start.yml +12 -7
  85. package/templates/70-subagent-maintenance.yml +35 -29
  86. package/templates/75-subagent-end.yml +10 -5
  87. package/templates/80-tool-surface.yml +66 -0
  88. package/templates/policies/legacy-defaults.yml +34 -0
  89. package/engine/compositions/source/local/prompt-config-engine.yml +0 -7
  90. package/engine/prompt-config-engine.mjs +0 -104
  91. package/engine/trigger-editor-meta.mjs +0 -48
  92. package/modules/ponytail/configs/0000-ponytail-rules.yml +0 -102
  93. package/modules/ponytail/configs/0010-ponytail-level-full.yml +0 -19
  94. package/modules/ponytail/configs/0020-ponytail-level-lite.yml +0 -19
  95. package/modules/ponytail/configs/0030-ponytail-level-ultra.yml +0 -19
@@ -0,0 +1 @@
1
+ export {}
@@ -0,0 +1,39 @@
1
+ #!/usr/bin/env node
2
+ import { a as rollbackRulesMigration, r as planRulesMigration, t as applyRulesMigration } from "./rules-migration-DJ6vASB5.mjs";
3
+ //#region src/migrate-rules.ts
4
+ const args = process.argv.slice(2).filter((value) => value !== "--");
5
+ let root;
6
+ let mode;
7
+ for (let index = 0; index < args.length; index++) {
8
+ const value = args[index];
9
+ if (value === "--root" && root === void 0) root = args[++index];
10
+ else if ([
11
+ "--check",
12
+ "--apply",
13
+ "--rollback",
14
+ "--decompose"
15
+ ].includes(value) && mode === void 0) mode = value;
16
+ else throw new Error(`未知或重复参数:${value}`);
17
+ }
18
+ if (!root || !mode) throw new Error("用法:prompt-tool-migrate-rules --root <模块根绝对路径> --check|--apply|--rollback|--decompose");
19
+ if (mode === "--rollback") console.log(JSON.stringify({
20
+ root,
21
+ ...rollbackRulesMigration(root)
22
+ }, null, 2));
23
+ else {
24
+ const plan = planRulesMigration(root, { decompose: mode === "--decompose" });
25
+ if (mode === "--check") console.log(JSON.stringify({
26
+ root: plan.root,
27
+ changes: plan.items.map(({ moduleId, sourceHash }) => ({
28
+ moduleId,
29
+ sourceHash
30
+ })),
31
+ writable: false
32
+ }, null, 2));
33
+ else console.log(JSON.stringify({
34
+ root: plan.root,
35
+ ...await applyRulesMigration(plan)
36
+ }, null, 2));
37
+ }
38
+ //#endregion
39
+ export {};
@@ -0,0 +1,2 @@
1
+ import { a as installModulePackage, o as moduleImportPreview } from "./module-package-Cnd1_mwx.mjs";
2
+ export { installModulePackage, installModulePackage as installPresetPackage, moduleImportPreview, moduleImportPreview as presetImportPreview };