dsh-plugin-prompt-tool 2.0.1 → 3.0.0
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/README.md +100 -233
- package/engine/actions/append-context.mjs +3 -24
- package/engine/actions/assembly.mjs +70 -94
- package/engine/actions/catalog.mjs +65 -28
- package/engine/actions/content.mjs +8 -152
- package/engine/actions/examples.mjs +8 -4
- package/engine/actions/inbox-prepend.mjs +5 -7
- package/engine/actions/index.mjs +17 -9
- package/engine/actions/inject-text.mjs +24 -4
- package/engine/actions/pre-step-filter.mjs +3 -4
- package/engine/actions/registration.mjs +20 -28
- package/engine/actions/request-params.mjs +21 -1
- package/engine/actions/shared.mjs +23 -15
- package/engine/actions/stream-output.mjs +26 -0
- package/engine/actions/tool-gate.mjs +31 -0
- package/engine/actions/tool-result.mjs +36 -0
- package/engine/actions/tool-visibility.mjs +248 -0
- package/engine/agent-capability.mjs +67 -0
- package/engine/anchor-match.mjs +14 -21
- package/engine/audience.d.mts +2 -0
- package/engine/audience.mjs +102 -0
- package/engine/branch.d.mts +4 -0
- package/engine/branch.mjs +62 -19
- package/engine/compaction-epoch.d.mts +25 -0
- package/engine/compaction-epoch.mjs +27 -4
- package/engine/compositions/source/local/filesystem-editor.yml +3 -3
- package/engine/compositions/source/local/instruction-hint.yml +4 -7
- package/engine/compositions/source/local/module-file-tools.yml +2 -0
- package/engine/compositions/source/local/module-import-tools.yml +4 -0
- package/engine/compositions/source/local/module-manifest-tools.yml +2 -0
- package/engine/compositions/source/local/module-rule-tools.yml +5 -0
- package/engine/compositions/source/local/module-variable-tools.yml +5 -0
- package/engine/compositions/source/local/present-as.yml +26 -0
- package/engine/compositions/source/local/tool-config-engine.yml +2 -3
- package/engine/compositions/source/local/tool-search.yml +11 -0
- package/engine/condition-facts.mjs +84 -0
- package/engine/conditions/anchor.mjs +63 -23
- package/engine/conditions/availability.mjs +1 -1
- package/engine/conditions/composite.mjs +4 -4
- package/engine/conditions/count.mjs +43 -13
- package/engine/conditions/evaluation.mjs +74 -19
- package/engine/conditions/examples.mjs +2 -1
- package/engine/conditions/index.d.mts +15 -0
- package/engine/conditions/index.mjs +23 -9
- package/engine/conditions/operators.mjs +4 -0
- package/engine/conditions/phase.mjs +10 -5
- package/engine/conditions/preset.mjs +1 -1
- package/engine/conditions/session.mjs +8 -2
- package/engine/conditions/subject.mjs +144 -65
- package/engine/conditions/text.mjs +26 -8
- package/engine/conditions/variable.mjs +83 -0
- package/engine/context-activation.d.mts +11 -0
- package/engine/{st-world-book.mjs → context-activation.mjs} +104 -64
- package/engine/delivery.d.mts +2 -0
- package/engine/delivery.mjs +93 -0
- package/engine/discovery.d.mts +38 -0
- package/engine/discovery.mjs +146 -0
- package/engine/env-safety.mjs +14 -0
- package/engine/executor.d.mts +28 -0
- package/engine/executor.mjs +290 -205
- package/engine/fillers.mjs +39 -8
- package/engine/fixed-registration.mjs +12 -0
- package/engine/history.mjs +71 -0
- package/engine/instruction-blocks.d.mts +13 -0
- package/engine/instruction-blocks.mjs +21 -0
- package/engine/instruction-files.d.mts +5 -0
- package/engine/instruction-files.mjs +97 -0
- package/engine/instruction-hint.mjs +69 -103
- package/engine/interpolate.d.mts +7 -0
- package/engine/interpolate.mjs +44 -13
- package/engine/layers.mjs +165 -230
- package/engine/machine-paths.mjs +40 -0
- package/engine/module-file-tools.mjs +8 -0
- package/engine/module-import-tools.mjs +10 -0
- package/engine/module-manifest-tools.mjs +8 -0
- package/engine/module-rule-tools.mjs +10 -0
- package/engine/module-variable-tools.mjs +10 -0
- package/engine/order.d.mts +14 -0
- package/engine/order.mjs +0 -3
- package/engine/path-safety.d.mts +2 -0
- package/engine/path-safety.mjs +58 -0
- package/engine/pre-step-source.d.mts +69 -0
- package/engine/pre-step-source.mjs +103 -0
- package/engine/present-as.mjs +77 -0
- package/engine/promotion-pool.d.mts +9 -0
- package/engine/promotion-pool.mjs +69 -0
- package/engine/record.mjs +2 -0
- package/engine/rule-engine.mjs +3 -2
- package/engine/rule-facts.d.mts +11 -0
- package/engine/rule-facts.mjs +60 -0
- package/engine/rule-runtime.d.mts +46 -0
- package/engine/rule-runtime.mjs +98 -13
- package/engine/rule-spec.d.mts +106 -0
- package/engine/rule-spec.mjs +302 -28
- package/engine/run-code-env.mjs +73 -19
- package/engine/schema.mjs +165 -243
- package/engine/sdk-strip.mjs +2 -2
- package/engine/service-names.d.mts +10 -0
- package/engine/service-names.mjs +10 -0
- package/engine/shared.d.mts +21 -0
- package/engine/shared.mjs +47 -26
- package/engine/skill-search.mjs +125 -53
- package/engine/source-kind.d.mts +9 -0
- package/engine/source-kind.mjs +16 -0
- package/engine/strategy-ids.mjs +5 -0
- package/engine/template-evaluation.d.mts +16 -0
- package/engine/template-evaluation.mjs +178 -0
- package/engine/template-frame.d.mts +16 -0
- package/engine/template-frame.mjs +69 -0
- package/engine/tool-config-engine.mjs +39 -35
- package/engine/tool-definition.d.mts +4 -0
- package/engine/tool-definition.mjs +5 -1
- package/engine/tool-git-bash.mjs +5 -1
- package/engine/tool-scope.mjs +22 -0
- package/engine/{dev-tool-search.mjs → tool-search.mjs} +63 -65
- package/engine/trigger.mjs +15 -270
- package/engine/vendor/yaml/dist/compose/resolve-flow-scalar.js +19 -18
- package/engine/vendor/yaml/dist/nodes/Alias.js +25 -23
- package/engine/vendor/yaml/package.json +1 -1
- package/lib/client.js +8312 -6724
- package/lib/client.js.map +1 -1
- package/lib/index.d.mts +37 -762
- package/lib/index.mjs +26919 -5791
- package/modules/ponytail/module.yml +83 -203
- package/modules/ptc-mode/module.yml +45 -0
- package/modules/soul/assets/core-hard.md +6 -0
- package/modules/soul/assets/criteria.md +12 -0
- package/modules/soul/assets/echo.md +12 -0
- package/modules/soul/assets/layers.md +11 -0
- package/modules/soul/assets/ledger.md +9 -0
- package/modules/soul/assets/manifest.yml +20 -0
- package/modules/soul/assets/reference/00-layers.md +27 -0
- package/modules/soul/assets/reference/01-criteria.md +32 -0
- package/modules/soul/assets/reference/02-echo.md +158 -0
- package/modules/soul/assets/reference/03-vital.md +183 -0
- package/modules/soul/assets/reference/04-manifest.json +106 -0
- package/modules/soul/assets/reference/05-doctor.md +67 -0
- package/modules/soul/assets/reference/06-reference.md +189 -0
- package/modules/soul/assets/reference/07-bundle.json +431 -0
- package/modules/soul/assets/reference/08-/350/270/251/345/235/221/345/256/236/345/275/225.md +59 -0
- package/modules/soul/assets/reference/09-dev-workflow.md +109 -0
- package/modules/soul/assets/reference/10-echo-anatomy.md +100 -0
- package/modules/soul/assets/reference/11-self.md +80 -0
- package/modules/soul/assets/reference/12-ledger.md +159 -0
- package/modules/soul/assets/reference/README.md +10 -0
- package/modules/soul/assets/templates/agents-template.md +6 -0
- package/modules/soul/assets/vital.md +9 -0
- package/modules/soul/module.yml +311 -0
- package/modules/superpowers/module.yml +122 -0
- package/modules/tool-surface/module.yml +51 -47
- package/package.json +40 -41
- package/skills/dsh-module/SKILL.md +119 -0
- package/skills/dsh-module/reference.md +185 -0
- package/templates/10-pre-step.yml +2 -3
- package/templates/14-first-turn-anchor.yml +10 -14
- package/templates/15-guide-auto.yml +32 -28
- package/templates/16-custom-fallback.yml +33 -21
- package/templates/20-system-section.yml +1 -4
- package/templates/50-llm-stream.yml +4 -10
- package/templates/60-tool-pipeline.yml +12 -10
- package/templates/63-append-context.yml +20 -0
- package/templates/64-pre-step-filter.yml +23 -0
- package/templates/65-turn-stop.yml +2 -2
- package/templates/67-inbox-prepend.yml +22 -0
- package/templates/70-subagent-maintenance.yml +9 -10
- package/templates/75-subagent-end.yml +2 -2
- package/templates/80-tool-surface.yml +41 -57
- package/templates/tools/40-delegate-module-import.yml +22 -0
- package/templates/tools/50-delegate-module-rules.yml +14 -0
- package/templates/tools/60-delegate-module-variables.yml +17 -0
- package/templates/tools/70-delegate-module-rules-edit.yml +31 -0
- package/engine/actions/decision.mjs +0 -54
- package/engine/actions/guard.mjs +0 -80
- package/engine/actions/sdk-strip.mjs +0 -30
- package/engine/character-tools.mjs +0 -8
- package/engine/classify-task.mjs +0 -53
- package/engine/compositions/library/agent-instructions.yml +0 -9
- package/engine/compositions/library/command-goal.yml +0 -7
- package/engine/compositions/library/compaction.yml +0 -22
- package/engine/compositions/library/delegation-ptc.yml +0 -58
- package/engine/compositions/library/delegation.yml +0 -56
- package/engine/compositions/library/persistent-shell.yml +0 -50
- package/engine/compositions/library/planning.yml +0 -26
- package/engine/compositions/library/skill-filesystem-cordis.yml +0 -10
- package/engine/compositions/library/skill-filesystem.yml +0 -7
- package/engine/compositions/library/tool-ask-user.yml +0 -7
- package/engine/compositions/library/tool-bash.yml +0 -8
- package/engine/compositions/library/tool-cordis.yml +0 -7
- package/engine/compositions/library/tool-fs-search.yml +0 -9
- package/engine/compositions/library/tool-fs.yml +0 -7
- package/engine/compositions/library/tool-goal.yml +0 -7
- package/engine/compositions/library/tool-jobs.yml +0 -7
- package/engine/compositions/library/tool-plugin-manager-disabled.yml +0 -8
- package/engine/compositions/library/tool-plugin-manager.yml +0 -8
- package/engine/compositions/library/tool-present.yml +0 -7
- package/engine/compositions/library/tool-presentation.yml +0 -9
- package/engine/compositions/library/tool-pwsh.yml +0 -8
- package/engine/compositions/library/tool-skill.yml +0 -7
- package/engine/compositions/library/tool-todo.yml +0 -9
- package/engine/compositions/library/tool-web.yml +0 -10
- package/engine/compositions/source/local/character-tools.yml +0 -5
- package/engine/compositions/source/local/declared-triggers.yml +0 -12
- package/engine/compositions/source/local/dev-tool-search.yml +0 -11
- package/engine/compositions/source/local/session-var-tools.yml +0 -5
- package/engine/compositions/source/local/subagent-tool-policy.yml +0 -21
- package/engine/compositions/source/local/world-book-tools.yml +0 -5
- package/engine/condition.mjs +0 -96
- package/engine/declared-triggers.mjs +0 -93
- package/engine/session-var-tools.mjs +0 -8
- package/engine/session-vars.mjs +0 -54
- package/engine/st-macros.d.mts +0 -22
- package/engine/st-macros.mjs +0 -208
- package/engine/st-render.mjs +0 -109
- package/engine/st-world-book.d.mts +0 -10
- package/engine/subagent-tool-policy-core.mjs +0 -400
- package/engine/subagent-tool-policy.mjs +0 -352
- package/engine/trigger-spec.mjs +0 -173
- package/engine/world-book-tools.mjs +0 -8
- package/lib/migrate-rules.d.mts +0 -1
- package/lib/migrate-rules.mjs +0 -39
- package/lib/module-package-CHPFweqK.mjs +0 -2
- package/lib/module-package-Cnd1_mwx.mjs +0 -2872
- package/lib/paths-CyP0IkaM.d.mts +0 -1390
- package/lib/preset-transfer.d.mts +0 -2
- package/lib/preset-transfer.mjs +0 -3
- package/lib/rules-migration-DJ6vASB5.mjs +0 -15334
- package/templates/policies/legacy-defaults.yml +0 -34
- package/templates/tools/40-delegate-character.yml +0 -15
- package/templates/tools/50-delegate-worldbook.yml +0 -15
- package/templates/tools/60-delegate-session-var.yml +0 -15
- package/templates/tools/70-delegate-worldbook-upsert.yml +0 -36
package/engine/classify-task.mjs
DELETED
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* classify-task — 任务分类器(能力归一)。
|
|
3
|
-
*
|
|
4
|
-
* buildPattern(构建任务正则)与 complexPattern(复杂任务正则)→ 三档分类
|
|
5
|
-
* (complex / build / fix)。锚定策略(first-turn-anchor)三档判定与引导策略
|
|
6
|
-
* (guide-auto)复杂判定共用本分类器——正则构建与判定逻辑单一实现,
|
|
7
|
-
* 避免两个策略各自 new RegExp + test(历史重复实现)。
|
|
8
|
-
*
|
|
9
|
-
* 参数缺省 = 对应分类不生效:buildRe/complexRe 未配置时跳过该分支
|
|
10
|
-
* (classify 落 fix;isComplex 恒 false)。
|
|
11
|
-
*/
|
|
12
|
-
export function createTaskClassifier({ buildPattern, complexPattern }) {
|
|
13
|
-
const buildRe = typeof buildPattern === 'string' && buildPattern.length > 0
|
|
14
|
-
? new RegExp(buildPattern, 'i')
|
|
15
|
-
: undefined
|
|
16
|
-
const complexRe = typeof complexPattern === 'string' && complexPattern.length > 0
|
|
17
|
-
? new RegExp(complexPattern, 'i')
|
|
18
|
-
: undefined
|
|
19
|
-
return {
|
|
20
|
-
/** 锚定三档判定可用:两档正则都配置。 */
|
|
21
|
-
get ready() {
|
|
22
|
-
return buildRe !== undefined && complexRe !== undefined
|
|
23
|
-
},
|
|
24
|
-
/** 三档分类:complex > build > fix(fix 为兜底档)。 */
|
|
25
|
-
classify(text) {
|
|
26
|
-
if (complexRe !== undefined && complexRe.test(text)) return 'complex'
|
|
27
|
-
if (buildRe !== undefined && buildRe.test(text)) return 'build'
|
|
28
|
-
return 'fix'
|
|
29
|
-
},
|
|
30
|
-
/** 复杂判定(引导 fallback 用;正则未配置 = false)。 */
|
|
31
|
-
isComplex(text) {
|
|
32
|
-
return complexRe !== undefined && complexRe.test(text)
|
|
33
|
-
},
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* 通用有序任务规则分类器(subagentToolPolicy.taskRules 单一实现)。
|
|
39
|
-
* 规则:order 升序(同 order 按数组顺序)、首个匹配获胜;输入为
|
|
40
|
-
* description + "\n" + prompt;无匹配回落 undefined(调用方用 default)。
|
|
41
|
-
* 规则在保存时已编译(非法 pattern 拒绝整次保存),此处只按顺序 test。
|
|
42
|
-
*/
|
|
43
|
-
export function createOrderedTaskClassifier(rules) {
|
|
44
|
-
const ordered = [...(Array.isArray(rules) ? rules : [])]
|
|
45
|
-
.filter((rule) => rule !== null && typeof rule === 'object' && typeof rule.re?.test === 'function')
|
|
46
|
-
.sort((a, b) => (a.order - b.order) || 0)
|
|
47
|
-
return (text) => {
|
|
48
|
-
for (const rule of ordered) {
|
|
49
|
-
if (rule.re.test(String(text ?? ''))) return rule.id
|
|
50
|
-
}
|
|
51
|
-
return undefined
|
|
52
|
-
}
|
|
53
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
# module: agent-instructions
|
|
2
|
-
# source: master/packages/bundle/web-app/presets/standard.patch.yml
|
|
3
|
-
# commit: 4878cdabd87d4041bdaff61d04c966883b9fd07a
|
|
4
|
-
# local patches: 0
|
|
5
|
-
|
|
6
|
-
- id: agent-instructions
|
|
7
|
-
name: '@deepseek-ai/dsh-agent-instructions'
|
|
8
|
-
config:
|
|
9
|
-
maxBytes: 65536
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
# module: compaction
|
|
2
|
-
# source: master/packages/bundle/web-app/presets/standard.patch.yml
|
|
3
|
-
# commit: 4878cdabd87d4041bdaff61d04c966883b9fd07a
|
|
4
|
-
# local patches: 0
|
|
5
|
-
|
|
6
|
-
- id: compaction
|
|
7
|
-
name: cordis:group
|
|
8
|
-
group: true
|
|
9
|
-
isolate:
|
|
10
|
-
compaction: true
|
|
11
|
-
toolResultPruner: true
|
|
12
|
-
config:
|
|
13
|
-
- id: compaction-basic
|
|
14
|
-
name: '@deepseek-ai/dsh-compaction-basic'
|
|
15
|
-
- id: command-compact
|
|
16
|
-
name: '@deepseek-ai/dsh-command-compact'
|
|
17
|
-
- id: tool-result-pruner
|
|
18
|
-
name: '@deepseek-ai/dsh-compaction-tool-result-pruner'
|
|
19
|
-
config:
|
|
20
|
-
thresholdChars: 8192
|
|
21
|
-
headChars: 4096
|
|
22
|
-
tailChars: 1024
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
# module: delegation-ptc
|
|
2
|
-
# source: master/packages/bundle/web-app/presets/ptc.patch.yml
|
|
3
|
-
# commit: 4878cdabd87d4041bdaff61d04c966883b9fd07a
|
|
4
|
-
# local patches: 0
|
|
5
|
-
|
|
6
|
-
- id: delegation
|
|
7
|
-
name: cordis:group
|
|
8
|
-
group: true
|
|
9
|
-
isolate:
|
|
10
|
-
workflowEngine: true
|
|
11
|
-
config:
|
|
12
|
-
- id: tool-subagent-control
|
|
13
|
-
name: '@deepseek-ai/dsh-tool-subagent-control'
|
|
14
|
-
- id: tool-subagent-list-agents
|
|
15
|
-
name: '@deepseek-ai/dsh-tool-subagent-control/list-agents'
|
|
16
|
-
- id: tool-subagent
|
|
17
|
-
name: '@deepseek-ai/dsh-tool-subagent'
|
|
18
|
-
config:
|
|
19
|
-
provider: spawn
|
|
20
|
-
toolName: subagent
|
|
21
|
-
modelSelectionSettings: true
|
|
22
|
-
backgroundMode: continuable
|
|
23
|
-
- id: tool-subagent-fork
|
|
24
|
-
name: '@deepseek-ai/dsh-tool-subagent'
|
|
25
|
-
config:
|
|
26
|
-
provider: fork
|
|
27
|
-
toolName: subagent_fork
|
|
28
|
-
backgroundMode: continuable
|
|
29
|
-
- id: tool-subagent-codex
|
|
30
|
-
name: '@deepseek-ai/dsh-tool-subagent'
|
|
31
|
-
disabled: true
|
|
32
|
-
config:
|
|
33
|
-
provider: codex
|
|
34
|
-
toolName: subagent_codex
|
|
35
|
-
backgroundMode: one-shot
|
|
36
|
-
maxDepth: provider-managed
|
|
37
|
-
- id: tool-subagent-claude-code
|
|
38
|
-
name: '@deepseek-ai/dsh-tool-subagent'
|
|
39
|
-
disabled: true
|
|
40
|
-
config:
|
|
41
|
-
provider: claude-code
|
|
42
|
-
toolName: subagent_claude_code
|
|
43
|
-
backgroundMode: one-shot
|
|
44
|
-
maxDepth: provider-managed
|
|
45
|
-
- id: workflow-ptc
|
|
46
|
-
name: '@deepseek-ai/dsh-workflow-ptc'
|
|
47
|
-
disabled: true
|
|
48
|
-
config:
|
|
49
|
-
provider: spawn
|
|
50
|
-
- id: tool-workflow
|
|
51
|
-
name: '@deepseek-ai/dsh-tool-workflow'
|
|
52
|
-
disabled: true
|
|
53
|
-
- id: tool-ralph
|
|
54
|
-
name: '@deepseek-ai/dsh-tool-ralph'
|
|
55
|
-
disabled: true
|
|
56
|
-
config:
|
|
57
|
-
subagentProvider: spawn
|
|
58
|
-
maxRounds: 64
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
# module: delegation
|
|
2
|
-
# source: master/packages/bundle/web-app/presets/standard.patch.yml
|
|
3
|
-
# commit: 4878cdabd87d4041bdaff61d04c966883b9fd07a
|
|
4
|
-
# local patches: 0
|
|
5
|
-
|
|
6
|
-
- id: delegation
|
|
7
|
-
name: cordis:group
|
|
8
|
-
group: true
|
|
9
|
-
isolate:
|
|
10
|
-
workflowEngine: true
|
|
11
|
-
config:
|
|
12
|
-
- id: tool-subagent-control
|
|
13
|
-
name: '@deepseek-ai/dsh-tool-subagent-control'
|
|
14
|
-
- id: tool-subagent-list-agents
|
|
15
|
-
name: '@deepseek-ai/dsh-tool-subagent-control/list-agents'
|
|
16
|
-
- id: tool-subagent
|
|
17
|
-
name: '@deepseek-ai/dsh-tool-subagent'
|
|
18
|
-
config:
|
|
19
|
-
provider: spawn
|
|
20
|
-
toolName: subagent
|
|
21
|
-
modelSelectionSettings: true
|
|
22
|
-
backgroundMode: continuable
|
|
23
|
-
- id: tool-subagent-fork
|
|
24
|
-
name: '@deepseek-ai/dsh-tool-subagent'
|
|
25
|
-
config:
|
|
26
|
-
provider: fork
|
|
27
|
-
toolName: subagent_fork
|
|
28
|
-
backgroundMode: continuable
|
|
29
|
-
- id: tool-subagent-codex
|
|
30
|
-
name: '@deepseek-ai/dsh-tool-subagent'
|
|
31
|
-
disabled: true
|
|
32
|
-
config:
|
|
33
|
-
provider: codex
|
|
34
|
-
toolName: subagent_codex
|
|
35
|
-
backgroundMode: one-shot
|
|
36
|
-
maxDepth: provider-managed
|
|
37
|
-
- id: tool-subagent-claude-code
|
|
38
|
-
name: '@deepseek-ai/dsh-tool-subagent'
|
|
39
|
-
disabled: true
|
|
40
|
-
config:
|
|
41
|
-
provider: claude-code
|
|
42
|
-
toolName: subagent_claude_code
|
|
43
|
-
backgroundMode: one-shot
|
|
44
|
-
maxDepth: provider-managed
|
|
45
|
-
- id: workflow-ptc
|
|
46
|
-
name: '@deepseek-ai/dsh-workflow-ptc'
|
|
47
|
-
config:
|
|
48
|
-
provider: spawn
|
|
49
|
-
- id: tool-workflow
|
|
50
|
-
name: '@deepseek-ai/dsh-tool-workflow'
|
|
51
|
-
- id: tool-ralph
|
|
52
|
-
name: '@deepseek-ai/dsh-tool-ralph'
|
|
53
|
-
disabled: true
|
|
54
|
-
config:
|
|
55
|
-
subagentProvider: spawn
|
|
56
|
-
maxRounds: 64
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
# module: persistent-shell
|
|
2
|
-
# source: master/packages/bundle/web-app/presets/minimal.patch.yml
|
|
3
|
-
# commit: 4878cdabd87d4041bdaff61d04c966883b9fd07a
|
|
4
|
-
# local patches: 0
|
|
5
|
-
|
|
6
|
-
- id: persistent-shell
|
|
7
|
-
name: cordis:group
|
|
8
|
-
group: true
|
|
9
|
-
isolate:
|
|
10
|
-
terminals: true
|
|
11
|
-
config:
|
|
12
|
-
- id: pty
|
|
13
|
-
name: '@deepseek-ai/dsh-terminal'
|
|
14
|
-
- id: terminal-bash
|
|
15
|
-
name: '@deepseek-ai/dsh-terminal-bash'
|
|
16
|
-
disabled: !!js process.platform === 'win32'
|
|
17
|
-
config:
|
|
18
|
-
timeoutMs: 300000
|
|
19
|
-
- id: persistent-bash
|
|
20
|
-
name: '@deepseek-ai/dsh-tool-bash-persistent'
|
|
21
|
-
disabled: !!js process.platform === 'win32'
|
|
22
|
-
config:
|
|
23
|
-
timeoutMs: 300000
|
|
24
|
-
description: |-
|
|
25
|
-
Run commands in a bash shell
|
|
26
|
-
* When invoking this tool, the contents of the "command" parameter does NOT need to be XML-escaped.
|
|
27
|
-
* Network access depends on the task environment. Prefer configured mirrors/proxies when they are available.
|
|
28
|
-
* State is persistent across command calls and discussions with the user.
|
|
29
|
-
* To inspect a particular line range of a file, e.g. lines 10-25, try 'sed -n 10,25p /path/to/the/file'.
|
|
30
|
-
* Please avoid commands that may produce a very large amount of output.
|
|
31
|
-
* Please run long lived commands in the background, e.g. 'sleep 10 &' or start a server in the background.
|
|
32
|
-
- id: terminal-pwsh
|
|
33
|
-
name: '@deepseek-ai/dsh-terminal-bash'
|
|
34
|
-
disabled: !!js process.platform !== 'win32'
|
|
35
|
-
config:
|
|
36
|
-
shellDialect: pwsh
|
|
37
|
-
timeoutMs: 300000
|
|
38
|
-
- id: persistent-pwsh
|
|
39
|
-
name: '@deepseek-ai/dsh-tool-pwsh-persistent'
|
|
40
|
-
disabled: !!js process.platform !== 'win32'
|
|
41
|
-
config:
|
|
42
|
-
timeoutMs: 300000
|
|
43
|
-
description: |-
|
|
44
|
-
Run commands in a PowerShell shell
|
|
45
|
-
* When invoking this tool, the contents of the "command" parameter does NOT need to be XML-escaped.
|
|
46
|
-
* You don't have access to the internet via this tool.
|
|
47
|
-
* State is persistent across command calls and discussions with the user.
|
|
48
|
-
* Use native Windows paths (C:\...) and $env:NAME variables; this is PowerShell, not bash.
|
|
49
|
-
* Please avoid commands that may produce a very large amount of output.
|
|
50
|
-
* Please run long lived commands in the background, e.g. 'Start-Job' or start a server with Start-Process.
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
# module: planning
|
|
2
|
-
# source: master/packages/bundle/web-app/presets/standard.patch.yml
|
|
3
|
-
# commit: 4878cdabd87d4041bdaff61d04c966883b9fd07a
|
|
4
|
-
# local patches: 0
|
|
5
|
-
|
|
6
|
-
- id: planning
|
|
7
|
-
name: cordis:group
|
|
8
|
-
group: true
|
|
9
|
-
isolate:
|
|
10
|
-
planMode: true
|
|
11
|
-
config:
|
|
12
|
-
- id: plan-mode
|
|
13
|
-
name: '@deepseek-ai/dsh-plan-mode'
|
|
14
|
-
config:
|
|
15
|
-
section: |
|
|
16
|
-
You are in plan mode. Stay in plan mode until exit_plan_mode succeeds or the user switches the session mode. Imperative language to implement changes means plan the implementation, not execute it. A user's conversational agreement — including an answer confirming something you asked — approves nothing and does not end plan mode; fold the confirmed decision into the plan and submit it through exit_plan_mode.
|
|
17
|
-
|
|
18
|
-
Explore first. Use non-mutating reads, searches, static analysis, and checks to ground the plan in the actual repository. Do not edit or write files, change configuration, run formatters or code generation that rewrites tracked files, commit, or otherwise carry out the plan. Prefer existing functions and patterns over new machinery.
|
|
19
|
-
|
|
20
|
-
The tool catalog stays the same across modes for request-cache stability. These plan-mode rules override any later tool description or guidance that suggests using mutation tools; those tools remain listed to keep the tool catalog unchanged. Do not use todo_write to track this planning phase: it tracks implementation after an approved plan, while the plan itself belongs in exit_plan_mode.
|
|
21
|
-
|
|
22
|
-
Resolve discoverable facts by inspection. Use ask_user_question only for user-owned choices or material ambiguity that inspection cannot answer. Do not ask the user where code lives or how current behavior works when you can find out.
|
|
23
|
-
|
|
24
|
-
Make the plan decision-complete: state the goal and success criteria; group implementation changes by subsystem; identify public API, schema, and data-flow changes; cover edge cases, failure modes, tests, acceptance criteria, and explicit assumptions. Keep it concise enough to review but detailed enough that another engineer can implement it without making design decisions.
|
|
25
|
-
|
|
26
|
-
When ready, call exit_plan_mode with the complete plan markdown, starting with a # title. Make exit_plan_mode the only and final tool call in that assistant response: it presents the plan for approval, and implementation begins only in a later step after approval. Do not paste the final plan as a plain reply or ask "should I proceed?" through prose or ask_user_question. If review rejects it, incorporate the feedback and present again. If the review channel is unavailable or aborted, stay in plan mode and ask the user to switch modes manually; do not proceed with implementation.
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
# module: skill-filesystem-cordis
|
|
2
|
-
# source: master/packages/bundle/web-app/presets/cordis.patch.yml
|
|
3
|
-
# commit: 4878cdabd87d4041bdaff61d04c966883b9fd07a
|
|
4
|
-
# local patches: 0
|
|
5
|
-
|
|
6
|
-
- id: skill-filesystem
|
|
7
|
-
name: '@deepseek-ai/dsh-skill-filesystem'
|
|
8
|
-
config:
|
|
9
|
-
customSkillDirs:
|
|
10
|
-
- !!js process.getBuiltinModule('node:path').join(process.getBuiltinModule('node:path').dirname(process.getBuiltinModule('node:module').createRequire(baseUrl).resolve('@deepseek-ai/dsh-agent-preset/package.json')), 'skills')
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
# module: tool-bash
|
|
2
|
-
# source: master/packages/bundle/web-app/presets/standard.patch.yml
|
|
3
|
-
# commit: 4878cdabd87d4041bdaff61d04c966883b9fd07a
|
|
4
|
-
# local patches: 0
|
|
5
|
-
|
|
6
|
-
- id: tool-bash
|
|
7
|
-
name: '@deepseek-ai/dsh-tool-bash'
|
|
8
|
-
disabled: !!js process.platform === 'win32'
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
# module: tool-fs-search
|
|
2
|
-
# source: master/packages/bundle/web-app/presets/standard.patch.yml
|
|
3
|
-
# commit: 4878cdabd87d4041bdaff61d04c966883b9fd07a
|
|
4
|
-
# local patches: 0
|
|
5
|
-
|
|
6
|
-
- id: tool-fs-search
|
|
7
|
-
name: '@deepseek-ai/dsh-tool-fs-search'
|
|
8
|
-
config:
|
|
9
|
-
sampleOverCapGlobResults: false
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
# module: tool-plugin-manager-disabled
|
|
2
|
-
# source: master/packages/bundle/web-app/presets/standard.patch.yml
|
|
3
|
-
# commit: 4878cdabd87d4041bdaff61d04c966883b9fd07a
|
|
4
|
-
# local patches: 0
|
|
5
|
-
|
|
6
|
-
- id: tool-plugin-manager
|
|
7
|
-
name: '@deepseek-ai/dsh-plugin-manager/tools'
|
|
8
|
-
disabled: true
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
# module: tool-plugin-manager
|
|
2
|
-
# source: master/packages/bundle/web-app/presets/cordis.patch.yml
|
|
3
|
-
# commit: 4878cdabd87d4041bdaff61d04c966883b9fd07a
|
|
4
|
-
# local patches: 0
|
|
5
|
-
|
|
6
|
-
- id: tool-plugin-manager
|
|
7
|
-
name: '@deepseek-ai/dsh-plugin-manager/tools'
|
|
8
|
-
disabled: !!js "!ctx.get('profileContext')"
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
# module: tool-presentation
|
|
2
|
-
# source: master/packages/bundle/web-app/presets/ptc.patch.yml
|
|
3
|
-
# commit: 4878cdabd87d4041bdaff61d04c966883b9fd07a
|
|
4
|
-
# local patches: 0
|
|
5
|
-
|
|
6
|
-
- id: tool-presentation
|
|
7
|
-
name: '@deepseek-ai/dsh-agent-tool-presentation'
|
|
8
|
-
config:
|
|
9
|
-
mode: ptc
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
# module: tool-pwsh
|
|
2
|
-
# source: master/packages/bundle/web-app/presets/standard.patch.yml
|
|
3
|
-
# commit: 4878cdabd87d4041bdaff61d04c966883b9fd07a
|
|
4
|
-
# local patches: 0
|
|
5
|
-
|
|
6
|
-
- id: tool-pwsh
|
|
7
|
-
name: '@deepseek-ai/dsh-tool-pwsh'
|
|
8
|
-
disabled: !!js process.platform !== 'win32'
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
# module: tool-web
|
|
2
|
-
# source: master/packages/bundle/web-app/presets/standard.patch.yml
|
|
3
|
-
# commit: 4878cdabd87d4041bdaff61d04c966883b9fd07a
|
|
4
|
-
# local patches: 0
|
|
5
|
-
|
|
6
|
-
- id: tool-web
|
|
7
|
-
name: '@deepseek-ai/dsh-tool-web'
|
|
8
|
-
config:
|
|
9
|
-
fetch: true
|
|
10
|
-
searchTimeoutMs: 60000
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
# module: declared-triggers
|
|
2
|
-
# source: 本地新增(B7 声明式触发器:preset.yml 顶层 triggers 段 → triggers.yml → 本模块注册)
|
|
3
|
-
# 声明由预设提供,引擎不带默认(2026-09-22 拍板):triggers.yml 缺失 = 没有声明,不注册任何
|
|
4
|
-
# 触发器、也不让预设启动失败(与 subagent-tool-policy 的 ENOENT 降级同一纪律)。
|
|
5
|
-
# 本行由 writePreset 按「有 triggers 段」自动装配(见 src/host/manifest.ts 的 implied modules)。
|
|
6
|
-
# triggersFile 是**初值**:迁移/物化时由 preset-install 的 ENGINE_MANAGED_PATHS 改写成
|
|
7
|
-
# ../<presetId>/triggers.yml(与 subagent-tool-policy 的 policyFile 同一规则)。
|
|
8
|
-
|
|
9
|
-
- id: declared-triggers
|
|
10
|
-
name: ./engine/declared-triggers.mjs
|
|
11
|
-
config:
|
|
12
|
-
triggersFile: ../triggers.yml
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
# module: dev-tool-search
|
|
2
|
-
# source: engine/compositions/source/local/dev-tool-search.yml (本地附加,非官方模块)
|
|
3
|
-
#
|
|
4
|
-
# 工具面的按需发现与解锁。与 assembly 动作的 allowFrom 配对使用:
|
|
5
|
-
# 本工具把解锁名写进持久 tool/call 参数 → allowFrom 读回 → 下次请求起生效。
|
|
6
|
-
# 只挂本行而不配 allowFrom 的话,解锁是一次性的(当次请求用完即被裁掉)。
|
|
7
|
-
#
|
|
8
|
-
# 常驻集由模板声明(见 templates/ 的工具面收窄模板),本行只负责发现入口。
|
|
9
|
-
|
|
10
|
-
- id: dev-tool-search
|
|
11
|
-
name: ./engine/dev-tool-search.mjs
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
# module: subagent-tool-policy
|
|
2
|
-
# source: 本地新增(子代理实例级工具策略:agent-scoped subagent/subagent_fork shadow)
|
|
3
|
-
# 策略数据源 = 预设目录 subagent-tools/policy.yml(writePreset 从 preset.yml 顶层
|
|
4
|
-
# subagentToolPolicy 物化)。策略启用时参数桥不再把主代理 toolFilter 写入
|
|
5
|
-
# delegation.toolFilter;未启用策略的预设完全保持官方 delegation 行为。
|
|
6
|
-
#
|
|
7
|
-
# 能力提供者边界(T4):本行是**能力提供者**(给模型提供 subagent/subagent_fork 两个
|
|
8
|
-
# 可调用工具),**不接入** engine/trigger.mjs。判据:会给模型提供可调用能力
|
|
9
|
-
# (注册工具/域)的 → 能力提供者;干预流程(改提示词、改装配、裁决、追加)的 →
|
|
10
|
-
# 声明式触发器。登记数据在 engine/subagent-tool-policy.mjs 的 `engineProvider`
|
|
11
|
-
# 导出,与 `engineTriggers`(声明式触发器)互斥;守卫见
|
|
12
|
-
# test/engine/provider-boundary.test.mjs。模块内扩权审批门与 fail loud 语义是安全
|
|
13
|
-
# 边界,改装配方式时不得放宽。
|
|
14
|
-
|
|
15
|
-
- id: subagent-tool-policy
|
|
16
|
-
name: ./engine/subagent-tool-policy.mjs
|
|
17
|
-
config:
|
|
18
|
-
policyFile: ../subagent-tools/policy.yml
|
|
19
|
-
spawnProvider: spawn
|
|
20
|
-
forkProvider: fork
|
|
21
|
-
maxDepth: 3
|
package/engine/condition.mjs
DELETED
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* condition — 声明式条件判定的共享实现(pre-step / tool-pipeline / 事件层共用)。
|
|
3
|
-
*
|
|
4
|
-
* 匹配语义来自 anchor-match.mjs:键集合由 schema.mjs 在挂载期归一化并预编译为
|
|
5
|
-
* `config.matchScan`(非法 logic / 空键集合 / 非法正则在挂载期 fail loud)。
|
|
6
|
-
* 本模块只负责「按 subject 取文本」与「是否命中」两件事。
|
|
7
|
-
*
|
|
8
|
-
* 语义约定:
|
|
9
|
-
* - 未声明 match 的配置是**无条件**的(与引入条件判定前逐字一致);
|
|
10
|
-
* - 取不到匹配文本(字段缺失、类型不符、序列化失败)一律按空串处理,即不命中;
|
|
11
|
-
* - 判定异常不抛出:门配错不应该阻断正常链路。
|
|
12
|
-
*/
|
|
13
|
-
|
|
14
|
-
import { extractText, sessionEvents } from './shared.mjs'
|
|
15
|
-
|
|
16
|
-
/** subject → 载荷字段名。改这里等于改所有层的匹配对象。 */
|
|
17
|
-
export const SUBJECT_FIELDS = {
|
|
18
|
-
toolArgs: 'argsText',
|
|
19
|
-
toolResult: 'resultText',
|
|
20
|
-
userMessage: 'userText',
|
|
21
|
-
assistantText: 'assistantText',
|
|
22
|
-
subagentInfo: 'subagentText',
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
/** 按 subject 取参与匹配的文本;取不到一律空串(不命中,不抛错)。 */
|
|
26
|
-
export function subjectTextOf(subject, payload) {
|
|
27
|
-
if (payload === undefined || payload === null) return ''
|
|
28
|
-
const field = SUBJECT_FIELDS[subject]
|
|
29
|
-
return field !== undefined && typeof payload[field] === 'string' ? payload[field] : ''
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* 条件判定:未声明 match 恒真。
|
|
34
|
-
* 消费 schema 预编译的 `config.matchScan`;外部手工构造的 config 没有该函数时按无条件处理。
|
|
35
|
-
*/
|
|
36
|
-
export function conditionHit(config, payload) {
|
|
37
|
-
if (config?.match === undefined) return true
|
|
38
|
-
const scan = config.matchScan
|
|
39
|
-
if (typeof scan !== 'function') return true
|
|
40
|
-
try {
|
|
41
|
-
return scan(subjectTextOf(config.subject, payload)).active === true
|
|
42
|
-
} catch {
|
|
43
|
-
return true
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
/** 工具参数的可匹配文本:对象按 JSON 序列化,字符串原样;序列化失败按空串。 */
|
|
48
|
-
export function toolArgsText(args) {
|
|
49
|
-
if (typeof args === 'string') return args
|
|
50
|
-
try {
|
|
51
|
-
return JSON.stringify(args ?? {})
|
|
52
|
-
} catch {
|
|
53
|
-
return ''
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
/**
|
|
58
|
-
* pre-step 的缺省匹配对象:本批**真实对话**的用户消息文本。
|
|
59
|
-
*
|
|
60
|
-
* 只收真人输入:引擎自己注入的消息同样是 user-role(`executor.mjs` 的
|
|
61
|
-
* `role: PRE_STEP_ROLE`、`pluginMessage` 的 `source` 是 `plugin:<name>` 生产者身份),
|
|
62
|
-
* 把它们算进来会让 `text.match` 匹配到自己注入过的正文——规则正文里出现「重构」
|
|
63
|
-
* 「实现」这类词就会自我命中,且命中判定在去重之前,`dedupe` 挡不住。
|
|
64
|
-
* 过滤判据与 `st-world-book.mjs#stChatMessages` 的同名约定一致(那是最早做对的一处),
|
|
65
|
-
* 两处必须保持同语义。
|
|
66
|
-
*/
|
|
67
|
-
export function userMessagesText(messages) {
|
|
68
|
-
if (!Array.isArray(messages)) return ''
|
|
69
|
-
return messages
|
|
70
|
-
.filter((message) => message?.role === 'user'
|
|
71
|
-
&& message.source?.plugin === undefined
|
|
72
|
-
&& message.source?.kind !== 'plugin'
|
|
73
|
-
&& !(typeof message.source?.kind === 'string' && message.source.kind.startsWith('plugin:'))
|
|
74
|
-
&& (message.source?.kind === undefined || message.source.kind === 'user'))
|
|
75
|
-
.map((message) => extractText(message))
|
|
76
|
-
.filter((text) => text.length > 0)
|
|
77
|
-
.join('\n')
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
/** 最后一条 assistant 消息的文本(turn-stop 的缺省匹配对象)。 */
|
|
81
|
-
export function lastAssistantText(session) {
|
|
82
|
-
const events = sessionEvents(session)
|
|
83
|
-
for (let index = events.length - 1; index >= 0; index -= 1) {
|
|
84
|
-
if (events[index]?.type === 'assistant/message') return extractText(events[index].data)
|
|
85
|
-
}
|
|
86
|
-
return ''
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
/** 子代理事件的匹配文本:事件载荷序列化,取不到即空串。 */
|
|
90
|
-
export function subagentTextOf(info) {
|
|
91
|
-
try {
|
|
92
|
-
return JSON.stringify(info ?? {})
|
|
93
|
-
} catch {
|
|
94
|
-
return ''
|
|
95
|
-
}
|
|
96
|
-
}
|