dsh-plugin-prompt-tool 0.8.1 → 2.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.
Files changed (139) hide show
  1. package/README.md +84 -67
  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/character-tools.mjs +3 -6
  20. package/engine/compaction-epoch.mjs +31 -13
  21. package/engine/compositions/library/agent-instructions.yml +1 -1
  22. package/engine/compositions/library/command-goal.yml +1 -1
  23. package/engine/compositions/library/compaction.yml +1 -1
  24. package/engine/compositions/library/delegation-ptc.yml +1 -1
  25. package/engine/compositions/library/delegation.yml +1 -1
  26. package/engine/compositions/library/persistent-shell.yml +1 -1
  27. package/engine/compositions/library/planning.yml +1 -1
  28. package/engine/compositions/library/skill-filesystem-cordis.yml +1 -1
  29. package/engine/compositions/library/skill-filesystem.yml +1 -1
  30. package/engine/compositions/library/tool-ask-user.yml +1 -1
  31. package/engine/compositions/library/tool-bash.yml +1 -1
  32. package/engine/compositions/library/tool-cordis.yml +1 -1
  33. package/engine/compositions/library/tool-fs-search.yml +1 -1
  34. package/engine/compositions/library/tool-fs.yml +1 -1
  35. package/engine/compositions/library/tool-goal.yml +1 -1
  36. package/engine/compositions/library/tool-jobs.yml +1 -1
  37. package/engine/compositions/library/tool-plugin-manager-disabled.yml +1 -1
  38. package/engine/compositions/library/tool-plugin-manager.yml +1 -1
  39. package/engine/compositions/library/tool-present.yml +1 -1
  40. package/engine/compositions/library/tool-presentation.yml +1 -1
  41. package/engine/compositions/library/tool-pwsh.yml +1 -1
  42. package/engine/compositions/library/tool-skill.yml +1 -1
  43. package/engine/compositions/library/tool-todo.yml +1 -1
  44. package/engine/compositions/library/tool-web.yml +1 -1
  45. package/engine/compositions/source/local/dev-tool-search.yml +11 -0
  46. package/engine/compositions/source/local/instruction-hint.yml +22 -1
  47. package/engine/compositions/source/local/rule-engine.yml +6 -0
  48. package/engine/condition.mjs +16 -3
  49. package/engine/conditions/anchor.mjs +32 -0
  50. package/engine/conditions/availability.mjs +47 -0
  51. package/engine/conditions/composite.mjs +83 -0
  52. package/engine/conditions/count.mjs +140 -0
  53. package/engine/conditions/evaluation.mjs +41 -0
  54. package/engine/conditions/examples.mjs +11 -0
  55. package/engine/conditions/index.mjs +85 -0
  56. package/engine/conditions/names.mjs +21 -0
  57. package/engine/conditions/phase.mjs +54 -0
  58. package/engine/conditions/preset.mjs +94 -0
  59. package/engine/conditions/scope.mjs +18 -0
  60. package/engine/conditions/session.mjs +22 -0
  61. package/engine/conditions/source.mjs +63 -0
  62. package/engine/conditions/subject.mjs +121 -0
  63. package/engine/conditions/text.mjs +44 -0
  64. package/engine/conditions/values.mjs +32 -0
  65. package/engine/dev-tool-search.mjs +213 -0
  66. package/engine/executor.mjs +93 -31
  67. package/engine/fillers.mjs +23 -16
  68. package/engine/instruction-hint.mjs +39 -23
  69. package/engine/layers.mjs +171 -77
  70. package/engine/order.mjs +20 -0
  71. package/engine/predicates.mjs +2 -753
  72. package/engine/rule-engine.mjs +40 -0
  73. package/engine/rule-runtime.mjs +110 -0
  74. package/engine/rule-spec.mjs +187 -0
  75. package/engine/schema.mjs +32 -11
  76. package/engine/session-var-tools.mjs +3 -6
  77. package/engine/shared.mjs +1 -1
  78. package/engine/st-render.mjs +8 -4
  79. package/engine/strategies.mjs +2 -235
  80. package/engine/subagent-tool-policy-core.mjs +7 -7
  81. package/engine/subagent-tool-policy.mjs +45 -20
  82. package/engine/tool-config-engine.mjs +53 -32
  83. package/engine/trigger-editor-meta.mjs +2 -21
  84. package/engine/trigger-spec.mjs +49 -133
  85. package/engine/world-book-tools.mjs +3 -6
  86. package/lib/client.js +10444 -10886
  87. package/lib/client.js.map +1 -1
  88. package/lib/index.d.mts +265 -361
  89. package/lib/index.mjs +1559 -2026
  90. package/lib/migrate-rules.d.mts +1 -0
  91. package/lib/migrate-rules.mjs +39 -0
  92. package/lib/module-package-CHPFweqK.mjs +2 -0
  93. package/lib/module-package-Cnd1_mwx.mjs +2872 -0
  94. package/lib/{paths-CY5psBqE.d.mts → paths-CyP0IkaM.d.mts} +388 -231
  95. package/lib/preset-transfer.d.mts +2 -2
  96. package/lib/preset-transfer.mjs +3 -2
  97. package/lib/{preset-package-BnJqrU4R.mjs → rules-migration-DJ6vASB5.mjs} +13825 -15283
  98. package/modules/ponytail/module.yml +406 -0
  99. package/modules/skill-surface/module.yml +74 -0
  100. package/modules/tool-surface/module.yml +67 -0
  101. package/package.json +50 -80
  102. package/templates/10-pre-step.yml +26 -22
  103. package/templates/14-first-turn-anchor.yml +25 -21
  104. package/templates/15-guide-auto.yml +34 -19
  105. package/templates/16-custom-fallback.yml +27 -15
  106. package/templates/18-placeholder-env-facts.yml +23 -14
  107. package/templates/20-system-section.yml +20 -11
  108. package/templates/30-runtime-context.yml +13 -7
  109. package/templates/40-agent-request.yml +11 -8
  110. package/templates/50-llm-stream.yml +14 -6
  111. package/templates/60-tool-pipeline.yml +15 -9
  112. package/templates/65-turn-stop.yml +19 -12
  113. package/templates/66-subagent-start.yml +12 -7
  114. package/templates/70-subagent-maintenance.yml +35 -29
  115. package/templates/75-subagent-end.yml +10 -5
  116. package/templates/80-tool-surface.yml +66 -0
  117. package/templates/policies/legacy-defaults.yml +34 -0
  118. package/templates/tools/50-delegate-worldbook.yml +1 -1
  119. package/engine/compositions/source/local/prompt-config-engine.yml +0 -7
  120. package/engine/prompt-config-engine.mjs +0 -104
  121. package/preset/pt-cordis/preset.yml +0 -43
  122. package/preset/pt-cordis/skills/cordis-composition-reference/SKILL.md +0 -29
  123. package/preset/pt-cordis/skills/cordis-composition-reference/references/packages.md +0 -501
  124. package/preset/pt-cordis/skills/cordis-plugin-development/SKILL.md +0 -38
  125. package/preset/pt-cordis/skills/cordis-plugin-development/references/host-plugin.md +0 -60
  126. package/preset/pt-cordis/skills/cordis-plugin-development/references/mcp-bundle.md +0 -5
  127. package/preset/pt-cordis/skills/cordis-plugin-development/references/ui-plugin.md +0 -13
  128. package/preset/pt-cordis/skills/cordis-plugin-development/references/verification.md +0 -5
  129. package/preset/pt-cordis/skills/cordis-plugin-development/templates/decoration/client.js +0 -22
  130. package/preset/pt-cordis/skills/cordis-plugin-development/templates/decoration/cordis.patch.yml +0 -3
  131. package/preset/pt-cordis/skills/cordis-plugin-development/templates/decoration/index.js +0 -2
  132. package/preset/pt-cordis/skills/cordis-plugin-development/templates/decoration/package.json +0 -15
  133. package/preset/pt-cordis/skills/cordis-plugin-development/templates/mcp/cordis.patch.yml +0 -8
  134. package/preset/pt-cordis/skills/cordis-plugin-development/templates/mcp/package.json +0 -7
  135. package/preset/pt-cordis/skills/editing-cordis-compositions/SKILL.md +0 -84
  136. package/preset/pt-custom/preset.yml +0 -15
  137. package/preset/pt-minimal/preset.yml +0 -27
  138. package/preset/pt-ptc/preset.yml +0 -45
  139. package/preset/pt-standard/preset.yml +0 -43
@@ -1,5 +0,0 @@
1
- # Verify in the available environment
2
-
3
- Prefer the authenticated page already connected to Harness. Do not launch a separate browser from shell commands, change `HOME`, inspect personal browser profiles, search for authentication tokens, or alter keychains to obtain a screenshot. For a visual-only request without browser control, limit verification to JavaScript syntax, manifest validation, and the live Client slot, then report that visual verification remains unavailable. Before or after installation, do not search for rasterizers, invoke Quick Look, extract SVG into preview files, emulate React/DOM, or implement a custom renderer to compensate for missing browser control. A screenshot of a mock page is not verification of the running plugin.
4
-
5
- For any test subprocess or temporary resource, use a unique owned directory, bound execution, and await cleanup. A failed optional preview must not turn into environment repair or block installation.
@@ -1,22 +0,0 @@
1
- window.__ModuleLoader__.load({
2
- id: '@local/my-decoration',
3
- factory(require) {
4
- const React = require('react');
5
- const h = React.createElement;
6
- function Decoration() {
7
- return h('svg', {
8
- viewBox: '0 0 64 64', width: 48, height: 48,
9
- 'aria-hidden': true,
10
- style: { display: 'block', pointerEvents: 'none' },
11
- }, h('circle', { cx: 32, cy: 32, r: 24, fill: '#247bbf' }));
12
- }
13
- return {
14
- inject: ['slots'],
15
- apply(ctx) {
16
- ctx.slots.inject('conversation.composer.dock', () => ctx.slots.register({
17
- name: 'conversation.composer.dock', id: 'my-decoration', order: 5,
18
- }, Decoration));
19
- },
20
- };
21
- },
22
- });
@@ -1,3 +0,0 @@
1
- - insert:
2
- - id: my-decoration
3
- name: '@local/my-decoration'
@@ -1,2 +0,0 @@
1
- /** Host half of the decoration bundle; the Client module owns the rendering. */
2
- export function apply() {}
@@ -1,15 +0,0 @@
1
- {
2
- "name": "@local/my-decoration",
3
- "version": "1.0.0",
4
- "private": true,
5
- "type": "module",
6
- "exports": { ".": "./index.js", "./client": "./client.js" },
7
- "dsh": {
8
- "bundle": { "patch": "./cordis.patch.yml" },
9
- "client": {
10
- "platform": "web",
11
- "immediately": true,
12
- "inject": ["@deepseek-ai/dsh-client-ui-conversation"]
13
- }
14
- }
15
- }
@@ -1,8 +0,0 @@
1
- - insert:
2
- - id: demo-mcp
3
- name: '@deepseek-ai/dsh-mcp-client'
4
- config:
5
- serverName: demo
6
- transport: streamable-http
7
- url: http://127.0.0.1:3000/mcp
8
- failOnStartupError: true
@@ -1,7 +0,0 @@
1
- {
2
- "name": "@local/demo-mcp",
3
- "version": "1.0.0",
4
- "private": true,
5
- "type": "module",
6
- "dsh": { "bundle": { "patch": "./cordis.patch.yml" } }
7
- }
@@ -1,84 +0,0 @@
1
- ---
2
- name: editing-cordis-compositions
3
- description: Use when creating, changing, or validating an agent preset or other Cordis composition for this harness, including deciding host versus preset placement and checking that an authored preset mounts.
4
- ---
5
-
6
- # Editing Cordis compositions
7
-
8
- Agent presets are ordinary `@deepseek-ai/dsh-agent-preset` declarations carried by bundle patches. Nothing edits a declaration in place: a preset is created or changed by installing a bundle whose patch declares or overrides it. This file states the declaration format; when it leaves a question open, read the `@deepseek-ai/dsh-agent-preset` README and `lib/types` declarations under the `packageDir` that `cordis_inspect_query` `Config.listConfigs` returns when queried with a `preset-<id>` row's `entry` id, or `packages/preset/agent-preset/src` in a source checkout.
9
-
10
- ## Where declarations live
11
-
12
- The shipped Web presets are `presets/<id>.patch.yml` files of the `@deepseek-ai/dsh-web-app` bundle, ids `standard`, `ptc`, `minimal` and `cordis`. Installed, the bundle resolves from the dsh installation, not the profile; querying `Config.listConfigs` with the `entry` id of any `preset-<id>` row it declares returns that `packageDir`. In a source checkout of DSH it is `packages/bundle/web-app/`. Read one file with the file-read tool when you need a template; `minimal.patch.yml` is the shortest. In Desktop the bundle sits inside `app.asar`, which shell commands cannot open. Load `cordis-composition-reference` for the patch dialect and the list of plugin packages a preset can mount.
13
-
14
- A declaration row has these `config` fields: `id` (required, lowercase letters, digits and hyphens), `plugins` (required Cordis entry list), and optional `name`, `description` and `order` (roster position). The Loader row `id` is `preset-<id>` by convention.
15
-
16
- ## Create a preset
17
-
18
- Write a bundle directory in the workspace with exactly two files, then install it.
19
-
20
- `review-preset/package.json`:
21
-
22
- ```json
23
- {
24
- "name": "@local/dsh-review-preset",
25
- "version": "1.0.0",
26
- "private": true,
27
- "type": "module",
28
- "dsh": { "bundle": { "patch": "./cordis.patch.yml" } }
29
- }
30
- ```
31
-
32
- `review-preset/cordis.patch.yml`:
33
-
34
- ```yaml
35
- - insert:
36
- - id: preset-review
37
- name: '@deepseek-ai/dsh-agent-preset'
38
- config:
39
- id: review
40
- name: Review
41
- description: Reviews changes with the shell only.
42
- order: 10
43
- plugins:
44
- - id: persona
45
- name: '@deepseek-ai/dsh-persona'
46
- config:
47
- prefix: You review software changes.
48
- - id: tool-bash
49
- name: '@deepseek-ai/dsh-tool-bash'
50
- ```
51
-
52
- Install with `plugin_manager`, `action: install_bundle`, `target` set to the absolute bundle directory. It runs package installation and bundle selection itself; do not reproduce those steps with shell commands.
53
-
54
- ## Change a shipped preset
55
-
56
- Override the declaration by its Loader row id instead of inserting. The override replaces the complete `config`, so restate `id`, `plugins` and every other field the shipped file carries:
57
-
58
- ```yaml
59
- - id: preset-standard
60
- name: '@deepseek-ai/dsh-agent-preset'
61
- config:
62
- id: standard
63
- order: 1
64
- plugins:
65
- # the shipped list with your changes
66
- ```
67
-
68
- ## Migrate a legacy preset
69
-
70
- Before declaration rows, a user preset was a directory `$DSH_HOME/.agent-presets/<id>/` holding `preset.yml` (display `name`, `description`, `order`) and `agent.cordis.yml` (the plugin entry list). Nothing reads that directory any more. To migrate one, create a bundle as above whose declaration takes `id` from the directory name, `name`, `description`, and `order` from `preset.yml`, and `plugins` from `agent.cordis.yml` verbatim; check each plugin name against `cordis-composition-reference` because packages renamed since the preset was written fail at activation. Install it, verify the row, then delete the legacy directory.
71
-
72
- ## Verify
73
-
74
- `plugin_manager` `list_bundles` lists the installed bundle; `list_plugins` shows the `preset-<id>` row with its activation state. A declaration whose activation fails stays on the roster with its diagnostic and cannot compose a session until the bundle is fixed and reinstalled. Existing sessions and their children keep the plugin revision they started with; validate changed behavior in a new session. Installing a bundle executes plugin code in the Host process, so it requires Full access or approval.
75
-
76
- ## Choose plugin placement
77
-
78
- Host plugins supply shared services: tools and prompt registries, the Agent loop, sessions, persistence, settings, sandbox policy, model routes, and subagent backends. Preset plugins contribute scoped tools, persona, prompt sections, and policies to those registries. Preset revisions are eagerly activated once and shared by their selecting Agents.
79
-
80
- A preset plugin that supplies a service must isolate the provider and all its consumers in the same realm. A service consumed by Host plugins belongs in the Host configuration. Scope controls contributions and event visibility; `isolate` controls service instances. Use ordinary Cordis groups for nested plugin lists. Keep `!!js` expressions only in plugin configuration or `disabled`; the Loader evaluates them when activating the child plugin. Resolve assets from installed packages rather than a preset directory.
81
-
82
- ## Extend the Host
83
-
84
- For new plugin code or profile-wide capabilities, load `cordis-plugin-development`, author a workspace bundle, and install it with `plugin_manager`. Inspect available APIs through `cordis_inspect_list` and `cordis_inspect_query`, including a mounted plugin's Config schema through the Host `Config` provider; those tools do not invoke Remote methods. Verify the installed capability before reporting completion.
@@ -1,15 +0,0 @@
1
- # 自定义预设:空白起点(所有参数为空,由引擎与 UI 默认值兜底)。
2
- # 新建时选择本模板得到一份可自由配置的用户预设;空模块清单生成空组合,
3
- # 参数、模块和提示词配置都由用户从 UI 按需添加。
4
- id: pt-custom
5
- name: 自定义预设
6
- description: 空白起点:所有参数为空,按需从 UI 配置。
7
- version: 1.0.0
8
- engineCompat: ">=0.4.2"
9
- modules: []
10
- layerSettings: {}
11
- # 空白起点不隐式装配任何提示词卡:需要时从 UI 添加。
12
- # 指令文件正文由独立指令来源(pre-step 协调器 + $DSH_HOME/.prompt-tool/instructions.yml)
13
- # 按会话现场解析,预设侧不再有 agentsHints 开关。
14
- promptConfigs: []
15
- legacyCleanup: []
@@ -1,27 +0,0 @@
1
- id: pt-minimal
2
- name: 极简模式
3
- description: 仅提供持久 shell 的单工具编码 Agent。
4
- version: 1.0.0
5
- engineCompat: ">=0.4.2"
6
- modules:
7
- - persistent-shell
8
- - prompt-config-engine
9
- persona:
10
- prefix: You are a helpful software engineer assistant.
11
- complete: true
12
- includeRuntimeContext: false
13
- promptConfigs: []
14
- layerSettings:
15
- agent-request:
16
- modelProvider: ""
17
- modelName: ""
18
- modelReasoningEffort: ""
19
- modelTemperature: ""
20
- modelMaxTokens: ""
21
- subagent-start:
22
- subagentModelProvider: ""
23
- subagentModelName: ""
24
- subagentReasoningEffort: ""
25
- subagentTemperature: ""
26
- subagentMaxTokens: ""
27
- maxDepth: ""
@@ -1,45 +0,0 @@
1
- id: pt-ptc
2
- name: PTC 模式
3
- description: 功能完整的编码 Agent,但默认不提供 workflow 工具;其他工具通过 PTC 模式 SDK 呈现,让模型用一个
4
- TypeScript 程序组合多步操作。
5
- version: 1.0.0
6
- engineCompat: ">=0.4.2"
7
- modules:
8
- - agent-instructions
9
- - tool-bash
10
- - tool-pwsh
11
- - tool-fs
12
- - tool-fs-search
13
- - tool-jobs
14
- - skill-filesystem
15
- - tool-skill
16
- - command-goal
17
- - tool-goal
18
- - planning
19
- - compaction
20
- - delegation-ptc
21
- - tool-ask-user
22
- - tool-todo
23
- - tool-web
24
- - tool-presentation
25
- - tool-present
26
- - tool-plugin-manager-disabled
27
- - prompt-config-engine
28
- persona:
29
- suffix: Your working directory is {{cwd}}.
30
- prefix: You are a coding agent powered by the {{model}} model.
31
- promptConfigs: []
32
- layerSettings:
33
- agent-request:
34
- modelProvider: ""
35
- modelName: ""
36
- modelReasoningEffort: ""
37
- modelTemperature: ""
38
- modelMaxTokens: ""
39
- subagent-start:
40
- subagentModelProvider: ""
41
- subagentModelName: ""
42
- subagentReasoningEffort: ""
43
- subagentTemperature: ""
44
- subagentMaxTokens: ""
45
- maxDepth: ""
@@ -1,43 +0,0 @@
1
- id: pt-standard
2
- name: 标准模式
3
- description: 功能完整的编码 Agent,支持文件编辑、Shell、文件与网页检索、Skills、计划、目标、子代理和工作流。
4
- version: 1.0.0
5
- engineCompat: ">=0.4.2"
6
- modules:
7
- - agent-instructions
8
- - tool-bash
9
- - tool-pwsh
10
- - tool-fs
11
- - tool-fs-search
12
- - tool-jobs
13
- - skill-filesystem
14
- - tool-skill
15
- - command-goal
16
- - tool-goal
17
- - planning
18
- - compaction
19
- - delegation
20
- - tool-ask-user
21
- - tool-todo
22
- - tool-web
23
- - tool-present
24
- - tool-plugin-manager-disabled
25
- - prompt-config-engine
26
- persona:
27
- suffix: Your working directory is {{cwd}}.
28
- prefix: You are a coding agent powered by the {{model}} model.
29
- promptConfigs: []
30
- layerSettings:
31
- agent-request:
32
- modelProvider: ""
33
- modelName: ""
34
- modelReasoningEffort: ""
35
- modelTemperature: ""
36
- modelMaxTokens: ""
37
- subagent-start:
38
- subagentModelProvider: ""
39
- subagentModelName: ""
40
- subagentReasoningEffort: ""
41
- subagentTemperature: ""
42
- subagentMaxTokens: ""
43
- maxDepth: ""