Files
dsh-abap-workbench/cordis.patch.yml
T

196 lines
13 KiB
YAML
Raw Normal View History

# ABAP 工作台预设(DSH ≥ 0.2.0 声明行格式)。
#
# 只有一个 @deepseek-ai/dsh-agent-preset 声明,避免预设选择器被多个 ABAP 预设占满。
# 运行模式(只读 / 调试 / 更改)不放预设里,而是按工作区写入
# <workspace>/.dsh-abap-adt/destinations.yaml 的 policy 键:
# - 只读(默认,继承下方安全基线)
# - 调试:allowExecution: true, allowDebugger: true
# - 更改:enableTransports: true, allowTransportableEdits: true, allowDebugger: true,
# allowExecution: true;allowedPackages / allowedTransports 取工作区白名单
# (默认 Z*,$TMP 与 *,可在设置页编辑)
# 切换入口:设置 → ABAP ADT → 运行模式;状态条徽章同步显示当前模式。
#
# 只有选择本预设的会话才挂载 adt_* 工具;全局/standard 会话不挂载。
# 只读 ≠ 无害:仍能读取 SAP 源码与业务数据。建议连开发/测试系统 + 最小权限账号。
- insert:
- id: preset-abap-adt
name: '@deepseek-ai/dsh-agent-preset'
config:
id: abap-adt
name: ABAP 工作台
description: >-
单个 SAP ABAP 预设:只读 / 调试 / 更改三种运行模式由当前工作区的权限策略决定,
在「设置 → ABAP ADT → 运行模式」切换;工具集固定,模式只影响策略。
order: 5
plugins:
- id: persona
name: '@deepseek-ai/dsh-persona'
config:
prefix: |-
你是 SAP ABAP 工作台代理(只读 / 调试 / 更改三种模式由当前工作区的策略决定),运行在 DeepSeek Harness 上(模型 {{model}}),通过 adt_* 工具经 ADT REST 访问 SAP 系统。当前工作目录见运行时上下文。
第一步永远是:adt_permissions 查看当前生效策略,adt_list_destinations 看目的地;引用目的地必须用精确名字(拼错会报错,不会静默落到默认系统)。模式以 adt_permissions 的结果为准,不要凭猜测——同一条指令在不同工作区可能是不同模式。
三种模式与纪律:
1) 只读模式(写/激活/删除/传输/执行/调试均被拒):只做调查与解释,输出结论 + 证据 + 建议补丁;遇到 [POLICY] 拒绝时如实告诉用户,不要换参数重试,可建议用户在该工作区的设置页把模式切到「调试」或「更改」。
2) 调试模式(只读 + 允许执行 + 调试器):先用只读手段定位(adt_search / adt_object_read / adt_where_used / adt_dumps);adt_debug 是唯一调试工具:先 action:"setBreakpoint",再触发代码路径,然后 action:"listen" 长轮询;命中后用 variables / stack / step(stepInto/stepOver/stepReturn/stepContinue)检查;结束必须 action:"detach"——一个目的地一个调试会话,detach 后不能重连。断点只对目标用户的客户代码生效,命中一次后要重新设置;用 adt_execute 触发程序或 if_oo_adt_classrun 类。调试变量写值默认关闭,需要时由用户显式开启。
3) 更改模式(按当前工作区白名单可写(默认 Z* 与 $TMP)、允许传输、允许执行与调试器):传输请求纪律最高优先——对可传输包的任何修改前先问用户要请求号(adt_transports {status:"modifiable"} 可列出打开请求),每次写操作显式传 transport 参数,绝不让后端自己开 task;$TMP 本地包不需要请求号;包归属不清楚时先问。释放传输是人的决定,没有对应工具,也不主动提议。写前必须先给用户看 Before/After diff(结构类型用字段级 patch,源码类型给完整新源码)并等确认;读后改:adt_object_read 建快照,adt_object_edit 在锁下校验,[CONFLICT] 重新读重新改,persisted:false 视为硬失败;顺序 check(adt_check)→ lock → write → activate,激活不级联(主程序与 include 要在一次 adt_activate 里),HTTP 200 不等于激活成功。验证阶梯:adt_run_unit_tests → adt_run_atc → adt_execute;数据用 adt_data_preview(ABAP SQL:DESCENDING、无 LIMIT、length/offset 分页)。做到 release-ready 为止,报告改了哪些对象、记到哪个请求号、check/激活/单测/ATC 结论。
通用规则:先读后答,不臆测对象内容;列表输出自带截断说明,只有「没有说明的空列表」才是真为空;结构化类型(DOMA/DTEL/TTYP/MSAG)读作 JSON;用户要改动时给可直接应用的补丁(Before/After 或 unified diff);被 [POLICY] 拒绝时说清是哪条策略并建议切换模式,不要绕过或反复重试。
- id: agent-instructions
name: '@deepseek-ai/dsh-agent-instructions'
config:
maxBytes: 65536
- id: tool-bash
name: '@deepseek-ai/dsh-tool-bash'
disabled: !!js process.platform === 'win32'
- id: tool-pwsh
name: '@deepseek-ai/dsh-tool-pwsh'
disabled: !!js process.platform !== 'win32'
- id: tool-fs
name: '@deepseek-ai/dsh-tool-fs'
- id: tool-fs-search
name: '@deepseek-ai/dsh-tool-fs-search'
config:
sampleOverCapGlobResults: false
- id: tool-jobs
name: '@deepseek-ai/dsh-tool-jobs'
- id: tool-skill
name: '@deepseek-ai/dsh-tool-skill'
- id: command-goal
name: '@deepseek-ai/dsh-command-goal'
- id: tool-goal
name: '@deepseek-ai/dsh-tool-goal'
- id: planning
name: cordis:group
group: true
isolate:
planMode: true
config:
- id: plan-mode
name: '@deepseek-ai/dsh-plan-mode'
config:
section: |
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.
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.
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 to exit_plan_mode.
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.
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.
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.
- id: compaction
name: cordis:group
group: true
isolate:
compaction: true
toolResultPruner: true
config:
- id: compaction-basic
name: '@deepseek-ai/dsh-compaction-basic'
- id: command-compact
name: '@deepseek-ai/dsh-command-compact'
- id: tool-result-pruner
name: '@deepseek-ai/dsh-compaction-tool-result-pruner'
config:
thresholdChars: 8192
headChars: 4096
tailChars: 1024
- id: delegation
name: cordis:group
group: true
isolate:
workflowEngine: true
config:
- id: tool-subagent-control
name: '@deepseek-ai/dsh-tool-subagent-control'
- id: tool-subagent-list-agents
name: '@deepseek-ai/dsh-tool-subagent-control/list-agents'
- id: tool-subagent
name: '@deepseek-ai/dsh-tool-subagent'
config:
provider: spawn
toolName: subagent
modelSelectionSettings: true
backgroundMode: continuable
- id: tool-subagent-fork
name: '@deepseek-ai/dsh-tool-subagent'
config:
provider: fork
toolName: subagent_fork
backgroundMode: continuable
- id: tool-subagent-codex
name: '@deepseek-ai/dsh-tool-subagent'
disabled: true
config:
provider: codex
toolName: subagent_codex
backgroundMode: one-shot
maxDepth: provider-managed
- id: tool-subagent-claude-code
name: '@deepseek-ai/dsh-tool-subagent'
disabled: true
config:
provider: claude-code
toolName: subagent_claude_code
backgroundMode: one-shot
maxDepth: provider-managed
- id: workflow-ptc
name: '@deepseek-ai/dsh-workflow-ptc'
config:
provider: spawn
- id: tool-workflow
name: '@deepseek-ai/dsh-tool-workflow'
- id: tool-ralph
name: '@deepseek-ai/dsh-tool-ralph'
disabled: true
config:
subagentProvider: spawn
maxRounds: 64
- id: tool-ask-user
name: '@deepseek-ai/dsh-tool-ask-user'
- id: tool-todo
name: '@deepseek-ai/dsh-tool-todo'
config:
allowParallelInProgress: true
- id: tool-web
name: '@deepseek-ai/dsh-tool-web'
config:
fetch: true
searchTimeoutMs: 60000
- id: present
name: '@deepseek-ai/dsh-tool-present'
- id: tool-plugin-manager
name: '@deepseek-ai/dsh-plugin-manager/tools'
disabled: true
# ============ ABAP 工具与安全基线(Read-Only baseline)============
# 预设只带「安全基线」:写/激活/删除/执行/调试关闭;传输只允许“读”
# (adt_transports / adt_object_versions 是只读工具,enableTransports 只控制
# 传输工具族与传输号校验,真正拦写的是 allowedPackages 哨兵值)。
# 运行模式由工作区文件 <workspace>/.dsh-abap-adt/destinations.yaml 的 policy
# 覆盖(该工作区内的目的地按工作区策略执行):
# 只读 = 继承本基线(可读传输请求/版本);调试 = + allowExecution + allowDebugger;
# 更改 = allowTransportableEdits + allowedPackages 白名单 + allowDebugger。
# 切换入口:设置 → ABAP ADT → 运行模式(写回工作区文件,立即生效)。
- id: abap-adt
name: '@nefevcore/abap-adt-dsh-plugin'
config:
demo: true
defaultDestination: demo
enableTransports: true
allowTransportableEdits: false
allowedPackages: "__READ_ONLY_NO_PACKAGE__"
allowedTransports: "*"
allowExecution: false
allowBatchWrites: false
allowDebugger: false
allowDebugVariables: false
blockedTablesProfile: 'off'
destinations: []
- id: abap-adt-ui
name: 'dsh-abap-workbench'
config: {}