mirror of
https://github.com/deepseek-ai/deepseek-harness.git
synced 2026-09-12 04:01:20 +00:00
feat(python-example): select the persistent shell by platform
Make the checked-in minimal SDK overlay disable both one-shot shell rows and mount exactly one persistent PTY stack: Bash on Linux/macOS and PowerShell on Windows. The SDK server, explicit dsh home, persistence, editor, timeout, and reduced tool catalog remain unchanged. Update the runnable example and tutorial to list Windows x64 as supported, describe the platform-selected shell, and remove the obsolete POSIX-only restriction. This keeps the documented first Python task executable through the packaged Windows dsh profile instead of advertising a Linux-only overlay on a Windows-capable SDK.
This commit is contained in:
@@ -2,5 +2,5 @@
|
||||
# side as of the last confirmed-consistent state. Both languages carry equal authority;
|
||||
# after editing either side, bring the other along and re-record with:
|
||||
# pnpm run verify-translation-pairing --write examples/python-sdk-agent/README.md
|
||||
README.md: 46a8dc2384d96db39841c4c1e4cdc88d82ff55eb
|
||||
README.zh.md: 5e6e2f89f27398dd7404894f15391a6a693d689b
|
||||
README.md: 7ec0ce984d20205fa50a3f12753a94f4209fac35
|
||||
README.zh.md: e46269f7d6a37123098747d2c8112aa365a98f01
|
||||
|
||||
@@ -21,12 +21,12 @@ Set `DEEPSEEK_BASE_URL` for a compatible proxy, `DSH_MODEL` for the script's def
|
||||
|
||||
The shipped [`@deepseek-ai/dsh-sdk-minimal` bundle](../../packages/bundle/sdk-minimal/README.md) is the complete explicit Cordis tree for this mode. It exposes exactly:
|
||||
|
||||
- owner-scoped persistent `bash`
|
||||
- owner-scoped persistent `bash` on Linux/macOS or `pwsh` on Windows
|
||||
- `str_replace_editor` with `view`, `create`, `str_replace`, and `insert`
|
||||
|
||||
The bundle does not include `dsh-base`, so every additional row is an explicit profile change. Runtime context, local instruction discovery, compaction, settings, managed credentials, telemetry, Web tools, subagents, and the full default tool roster are absent. The tree retains SDK startup and JSON-RPC serving, one environment-configured DeepSeek adapter, local execution, and JSONL persistence.
|
||||
|
||||
This variant is intentionally POSIX-only. Its persistent PTY and editor can modify any path available to the runtime process, so use a disposable checkout or container.
|
||||
The persistent PTY and editor can modify any path available to the runtime process, so use a disposable checkout or container.
|
||||
|
||||
## Add plugins
|
||||
|
||||
|
||||
@@ -21,12 +21,12 @@ python examples/python-sdk-agent/minimal.py \
|
||||
|
||||
随附的 [`@deepseek-ai/dsh-sdk-minimal` 组合包](../../packages/bundle/sdk-minimal/README.zh.md)是该模式完整且显式的 Cordis 配置树。它只暴露:
|
||||
|
||||
- agent 所有的持久 `bash`
|
||||
- Linux/macOS 上 agent 所有的持久 `bash`,或 Windows 上的 `pwsh`
|
||||
- 支持 `view`、`create`、`str_replace` 与 `insert` 的 `str_replace_editor`
|
||||
|
||||
该组合包不包含 `dsh-base`,因此每一个新增配置项都是显式 profile 变更。运行时上下文、本地指令发现、compaction、settings、托管凭据、遥测、Web 工具、subagent 与完整默认工具清单均不存在。配置树保留 SDK 启动与 JSON-RPC 服务、一个由环境配置的 DeepSeek 适配器、本地执行和 JSONL 持久化。
|
||||
|
||||
此变体刻意只支持 POSIX。其持久 PTY 与 editor 可以修改运行时进程可访问的任何路径,因此只应在一次性 checkout 或容器中使用。
|
||||
持久 PTY 与 editor 可以修改运行时进程可访问的任何路径,因此只应在一次性 checkout 或容器中使用。
|
||||
|
||||
## 添加插件
|
||||
|
||||
|
||||
@@ -242,7 +242,8 @@ describe('Python SDK dsh profile keyless smoke', () => {
|
||||
tools?: Array<{ function?: { name?: string } }>
|
||||
}
|
||||
expect(request.messages?.[0]).toMatchObject({ role: 'system', content: 'Minimal allowlist prompt.' })
|
||||
expect(request.tools?.map(tool => tool.function?.name).sort()).toEqual(['bash', 'str_replace_editor'])
|
||||
const shellTool = process.platform === 'win32' ? 'pwsh' : 'bash'
|
||||
expect(request.tools?.map(tool => tool.function?.name).sort()).toEqual([shellTool, 'str_replace_editor'].sort())
|
||||
const profile = JSON.parse(
|
||||
await readFile(join(root, '.dsh', 'profiles', 'sdk-minimal', 'package.json'), 'utf8'),
|
||||
) as { dsh?: { profile?: { bundles?: string[]; patchReload?: string } } }
|
||||
|
||||
Reference in New Issue
Block a user