pi-dsh-mimic 0.1.1 → 0.1.2
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 +54 -111
- package/README.zh-CN.md +41 -86
- package/SECURITY.md +9 -6
- package/docs/advanced.md +6 -5
- package/docs/advanced.zh-CN.md +4 -4
- package/docs/project2-evidence.md +4 -2
- package/package.json +1 -1
- package/src/constants.ts +0 -2
- package/src/index.ts +0 -2
- package/src/session-stage.ts +1 -4
package/README.md
CHANGED
|
@@ -1,71 +1,49 @@
|
|
|
1
|
-
[Repository index](../../README.en.md) · [简体中文](README.zh-CN.md) ·
|
|
1
|
+
[Repository index](../../README.en.md) · [简体中文](README.zh-CN.md) ·
|
|
2
|
+
[Experiments and design](docs/advanced.md) ·
|
|
3
|
+
[Project2 evidence ledger](docs/project2-evidence.md)
|
|
2
4
|
|
|
3
5
|
# pi-dsh-mimic
|
|
4
6
|
|
|
5
|
-
`pi-dsh-mimic`
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
response,
|
|
9
|
-
|
|
7
|
+
`pi-dsh-mimic` changes only the first DeepSeek V4 Pro request in
|
|
8
|
+
[Pi](https://github.com/earendil-works/pi). The real task begins with the DSH
|
|
9
|
+
Minimal persona and its `bash` and `str_replace_editor` tools. After the first
|
|
10
|
+
valid response, later requests return to Pi-native formatting and the complete
|
|
11
|
+
tool catalog.
|
|
10
12
|
|
|
11
|
-
|
|
13
|
+
It does not require the full DSH harness and adds no extra model round.
|
|
12
14
|
|
|
13
|
-
|
|
14
|
-
- Pi's mature tools, session management, and plugin ecosystem.
|
|
15
|
+
## How it works
|
|
15
16
|
|
|
16
|
-
|
|
17
|
-
|
|
17
|
+
1. In a fresh target session, the original task becomes the Minimal request.
|
|
18
|
+
2. The first successful assistant response or actual tool call ends bootstrap.
|
|
19
|
+
3. Later requests keep the Minimal persona while Pi again owns payload encoding,
|
|
20
|
+
tool ordering, and plugin tools.
|
|
18
21
|
|
|
19
|
-
|
|
22
|
+
Provider errors and aborted responses do not consume bootstrap. A small Pi
|
|
23
|
+
custom entry persists the phase across resume. If the process crashes after a
|
|
24
|
+
completed response but before the phase is recorded, durable assistant/tool
|
|
25
|
+
history repairs the state on reload.
|
|
26
|
+
|
|
27
|
+
## Experimental result
|
|
28
|
+
|
|
29
|
+
On one frozen Project2 V4.1b long-horizon maintenance task, default Pi scored
|
|
30
|
+
92. Four final runs of the same one-shot flow scored 98, 96, 96, and 98. This
|
|
31
|
+
comparison supports the current first-request design; it does not establish a
|
|
32
|
+
general result across projects, model revisions, or evaluations.
|
|
20
33
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
1. request #1 uses the Minimal persona and exposes only DSH-style `bash` and
|
|
25
|
-
`str_replace_editor`;
|
|
26
|
-
2. after the first successful assistant response or durable tool call, request
|
|
27
|
-
#2 restores Pi's native provider payload and complete current tool catalog;
|
|
28
|
-
3. the Minimal persona remains for the session, while Pi's larger generated
|
|
29
|
-
system prompt is not replayed as an extra user message.
|
|
30
|
-
|
|
31
|
-
The extension adds no identity warm-up or model round, makes no hidden copy of
|
|
32
|
-
the task, does not inject `We need`, and does not proxy the API.
|
|
33
|
-
|
|
34
|
-
## Project2 results
|
|
35
|
-
|
|
36
|
-
Project2 V4.1b is a personal, self-hosted long-horizon repository-maintenance
|
|
37
|
-
evaluation. The model repairs a multi-module Python backend and ESP32-S3
|
|
38
|
-
firmware project covering authentication and session privacy, database
|
|
39
|
-
migrations, cross-module features, backward compatibility,
|
|
40
|
-
Wi-Fi/MQTT/NVS/protocol and ESP-IDF contracts, and delivery evidence. It is not
|
|
41
|
-
a general benchmark; these scores compare engineering completion on one frozen
|
|
42
|
-
task.
|
|
43
|
-
|
|
44
|
-
Default Pi scored 92. Four final runs of the same one-shot request flow scored
|
|
45
|
-
**98, 96, 96, and 98**, all with F3 at 16/16:
|
|
46
|
-
|
|
47
|
-
| Run | Provider | Score | Key dimensions |
|
|
48
|
-
| --- | --- | ---: | --- |
|
|
49
|
-
| Default Pi baseline | Official DeepSeek API | 92 | F3 11, F6 10, F8 6 |
|
|
50
|
-
| Early Minimal-mimic prototype | Official DeepSeek API | **98** | F3 16, F6 10, F8 7 |
|
|
51
|
-
| Same-flow replication | Official DeepSeek API | 96 | F3 16, F6 10, F8 5 |
|
|
52
|
-
| First packaged implementation | Official DeepSeek API | 96 | F3 16, F6 8, F8 7 |
|
|
53
|
-
| Current independent implementation | OpenCode Go | **98** | F3 16, F6 10, F8 7 |
|
|
54
|
-
|
|
55
|
-
The results show that a DSH Minimal first request can establish a strong V4 Pro
|
|
56
|
-
trajectory inside Pi and that restoring Pi's full tool catalog does not break
|
|
57
|
-
it. See [Experiments and design](docs/advanced.md) for the rejected alternatives
|
|
58
|
-
and the evidence behind each implementation choice. The
|
|
59
|
-
[Project2 evidence ledger](docs/project2-evidence.md), maintained in Chinese,
|
|
60
|
-
contains evaluator IDs and sources.
|
|
34
|
+
See [Experiments and design](docs/advanced.md) for conditions, negative results,
|
|
35
|
+
and implementation choices. The [Project2 evidence ledger](docs/project2-evidence.md)
|
|
36
|
+
contains the complete runs and evaluator sources.
|
|
61
37
|
|
|
62
38
|
## Install and use
|
|
63
39
|
|
|
64
|
-
Requirements: Node.js 22.19 or later, Pi 0.84.2 or later, and
|
|
65
|
-
|
|
66
|
-
routes.
|
|
40
|
+
Requirements: Node.js 22.19 or later, Pi 0.84.2 or later, and a provider
|
|
41
|
+
configured in Pi whose model id contains `deepseek-v4-pro`. The official
|
|
42
|
+
DeepSeek API and OpenCode Go are the repository-qualified routes. The extension
|
|
43
|
+
also activates for third-party providers; compatibility, data handling, and
|
|
44
|
+
billing then follow the provider selected by the user.
|
|
67
45
|
|
|
68
|
-
Install
|
|
46
|
+
Install for the current user:
|
|
69
47
|
|
|
70
48
|
```bash
|
|
71
49
|
pi install npm:pi-dsh-mimic
|
|
@@ -85,53 +63,28 @@ pi -e ./packages/pi-dsh-mimic \
|
|
|
85
63
|
--model deepseek-v4-pro
|
|
86
64
|
```
|
|
87
65
|
|
|
88
|
-
For OpenCode Go,
|
|
89
|
-
|
|
90
|
-
`pi-package` keyword required by the
|
|
91
|
-
[Pi Package Catalog](https://pi.dev/packages).
|
|
66
|
+
For OpenCode Go, set Pi's expected `OPENCODE_API_KEY` environment variable and
|
|
67
|
+
select the `opencode-go` provider.
|
|
92
68
|
|
|
93
69
|
Select V4 Pro before starting a new session. Switching to V4 Pro inside an
|
|
94
|
-
existing conversation does not
|
|
70
|
+
existing conversation does not create a synthetic bootstrap. The extension
|
|
71
|
+
registers `str_replace_editor` in a target session; if that same session later
|
|
72
|
+
switches to another model, the tool may remain in the current catalog. Start a
|
|
73
|
+
new session when a clean non-target tool catalog matters.
|
|
95
74
|
|
|
96
|
-
## Request
|
|
75
|
+
## Request changes
|
|
97
76
|
|
|
98
|
-
| |
|
|
77
|
+
| | First request | Later requests |
|
|
99
78
|
| --- | --- | --- |
|
|
100
|
-
|
|
|
101
|
-
| User history | Original task, including Pi
|
|
102
|
-
|
|
|
103
|
-
|
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
Provider errors and aborted responses do not consume the bootstrap. A small Pi
|
|
111
|
-
custom entry persists the phase, and durable assistant/tool history repairs a
|
|
112
|
-
crash-stale state on resume.
|
|
113
|
-
|
|
114
|
-
## Offline verification
|
|
115
|
-
|
|
116
|
-
TypeScript typechecking and all 13 automated tests pass. Twelve cover package
|
|
117
|
-
behavior and its manifest; one verifies the session-statistics helper. Package
|
|
118
|
-
behavior coverage includes:
|
|
119
|
-
|
|
120
|
-
- original task, persona, field order, cache omission, and two-tool schemas in
|
|
121
|
-
request #1;
|
|
122
|
-
- Pi-native payload, complete catalog, and plugin-tool restoration in request
|
|
123
|
-
#2;
|
|
124
|
-
- images, API-error retry, text promotion, session resume, and crash-stale
|
|
125
|
-
recovery;
|
|
126
|
-
- existing-conversation isolation, both providers, and non-target models;
|
|
127
|
-
- editor create, view, replace, insert, and ambiguous-replacement rejection.
|
|
128
|
-
|
|
129
|
-
OpenCode Go bash-first and editor-first offline loopbacks also pass through Pi's
|
|
130
|
-
real package loader and provider path with `realModelCalls=0`. Request #2 carries
|
|
131
|
-
a real tool result and restores `read/bash/edit/write/str_replace_editor`. After
|
|
132
|
-
normalizing the user task, the new request #1 matches the historical 98-point
|
|
133
|
-
capture in messages, key order, schemas, `strict:false`, and serialized
|
|
134
|
-
structure.
|
|
79
|
+
| Persona | `You are a helpful software engineer assistant.` | unchanged |
|
|
80
|
+
| User history | Original task, including Pi images | unchanged |
|
|
81
|
+
| Tools | `bash`, `str_replace_editor` | Pi's current full catalog, including plugin tools |
|
|
82
|
+
| Payload | DSH Minimal shape | Pi-native encoding and ordering |
|
|
83
|
+
|
|
84
|
+
`str_replace_editor` can view, create, and modify absolute paths with the Pi
|
|
85
|
+
process's filesystem permissions. The task, context, and tool results are sent
|
|
86
|
+
to the provider selected by the user. The extension does not read or store API
|
|
87
|
+
keys. See [SECURITY.md](SECURITY.md) for the full boundary.
|
|
135
88
|
|
|
136
89
|
## Development
|
|
137
90
|
|
|
@@ -142,17 +95,7 @@ npm run check
|
|
|
142
95
|
npm run pack:check
|
|
143
96
|
```
|
|
144
97
|
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
This package runs with the Pi process's filesystem permissions;
|
|
148
|
-
`str_replace_editor` can create and modify files. The task, context, and tool
|
|
149
|
-
results are sent to the selected DeepSeek or OpenCode provider. The package
|
|
150
|
-
does not read, store, log, or transmit API keys and adds no model round. See
|
|
151
|
-
[SECURITY.md](SECURITY.md).
|
|
152
|
-
|
|
153
|
-
The Minimal persona and two tool-protocol texts come from DeepSeek Harness's
|
|
98
|
+
The Minimal persona and two tool protocols come from DeepSeek Harness's
|
|
154
99
|
[public Minimal protocol](https://github.com/deepseek-ai/deepseek-harness). See
|
|
155
|
-
[LICENSE](LICENSE) and [NOTICE](NOTICE).
|
|
156
|
-
|
|
157
|
-
experiments. It is not affiliated with or endorsed by Pi, DeepSeek, OpenCode,
|
|
158
|
-
or OpenAI.
|
|
100
|
+
[LICENSE](LICENSE) and [NOTICE](NOTICE). This project is not affiliated with or
|
|
101
|
+
endorsed by Pi, DeepSeek, OpenCode, or OpenAI.
|
package/README.zh-CN.md
CHANGED
|
@@ -1,60 +1,41 @@
|
|
|
1
|
-
[仓库索引](../../README.md) · [English](README.md) ·
|
|
1
|
+
[仓库索引](../../README.md) · [English](README.md) ·
|
|
2
|
+
[实验与设计](docs/advanced.zh-CN.md) · [Project2 证据账本](docs/project2-evidence.md)
|
|
2
3
|
|
|
3
4
|
# pi-dsh-mimic
|
|
4
5
|
|
|
5
|
-
`pi-dsh-mimic` 在 [Pi](https://github.com/earendil-works/pi)
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
`pi-dsh-mimic` 只修改 DeepSeek V4 Pro 在 [Pi](https://github.com/earendil-works/pi)
|
|
7
|
+
中的第一次模型请求。真实任务先进入 DSH Minimal 的 persona 与 `bash`、
|
|
8
|
+
`str_replace_editor` 两个工具;第一次有效响应后,后续请求恢复 Pi 原生格式和完整工具
|
|
9
|
+
目录。
|
|
8
10
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
- DSH Minimal 首请求带来的 V4 Pro 工程能力;
|
|
12
|
-
- Pi 成熟的工具、session 管理和插件生态。
|
|
13
|
-
|
|
14
|
-
用户无需安装或运行完整 DSH harness,也不必长期停留在两个工具的 Minimal 环境中。
|
|
11
|
+
它不需要安装完整 DSH harness,也不会增加额外模型轮次。
|
|
15
12
|
|
|
16
13
|
## 工作方式
|
|
17
14
|
|
|
18
|
-
新建目标 session
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
`str_replace_editor`;
|
|
22
|
-
2. 第一个成功 assistant response 或 durable tool call 后,请求 #2 恢复 Pi 原生
|
|
23
|
-
provider payload 和当下完整工具目录;
|
|
24
|
-
3. Minimal persona 在整个 session 保持,Pi 较长的自动 system prompt 不会作为额外
|
|
25
|
-
user message 重放。
|
|
15
|
+
1. 新建目标 session 后,原始任务直接成为 Minimal 请求;
|
|
16
|
+
2. 第一次成功的 assistant response 或实际 tool call 结束 bootstrap;
|
|
17
|
+
3. 后续请求继续使用 Minimal persona,但 payload、工具排序和插件工具由 Pi 接管。
|
|
26
18
|
|
|
27
|
-
|
|
19
|
+
Provider error 或 aborted response 不消耗 bootstrap。阶段会写入一个小型 Pi custom entry,
|
|
20
|
+
因此 session resume 后仍能恢复;如果进程在响应完成后、阶段写入前崩溃,durable
|
|
21
|
+
assistant/tool 历史会把状态修正到执行阶段。
|
|
28
22
|
|
|
29
|
-
##
|
|
23
|
+
## 实验结果
|
|
30
24
|
|
|
31
|
-
Project2 V4.1b
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
只用于比较同一冻结任务下的工程完成度。
|
|
25
|
+
在一个冻结的 Project2 V4.1b 长程代码维护任务中,默认 Pi 得到 92;使用相同 one-shot
|
|
26
|
+
流程的四次最终结果为 98、96、96、98。这个对照支持当前首请求设计,但不能直接外推到
|
|
27
|
+
其他项目、模型版本或评测。
|
|
35
28
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
| 运行 | Provider | 分数 | 关键分项 |
|
|
40
|
-
| --- | --- | ---: | --- |
|
|
41
|
-
| 默认 Pi baseline | DeepSeek 官方 API | 92 | F3 11,F6 10,F8 6 |
|
|
42
|
-
| 早期 Minimal 模拟原型 | DeepSeek 官方 API | **98** | F3 16,F6 10,F8 7 |
|
|
43
|
-
| 同流程复现实验 | DeepSeek 官方 API | 96 | F3 16,F6 10,F8 5 |
|
|
44
|
-
| 首次 package 化实现 | DeepSeek 官方 API | 96 | F3 16,F6 8,F8 7 |
|
|
45
|
-
| 当前独立实现 | OpenCode Go | **98** | F3 16,F6 10,F8 7 |
|
|
46
|
-
|
|
47
|
-
这些结果表明:DSH Minimal 首请求可以在 Pi 中稳定建立高能力轨迹,而恢复 Pi 完整工具
|
|
48
|
-
目录不会破坏它。实验过程、被否决的设计和每项实现选择的依据见
|
|
49
|
-
[实验与设计](docs/advanced.zh-CN.md);完整 evaluator IDs 与来源见
|
|
50
|
-
[Project2 证据账本](docs/project2-evidence.md)。
|
|
29
|
+
实验条件、负结果和实现取舍见[实验与设计](docs/advanced.zh-CN.md),完整运行与 evaluator
|
|
30
|
+
来源见 [Project2 证据账本](docs/project2-evidence.md)。
|
|
51
31
|
|
|
52
32
|
## 安装和使用
|
|
53
33
|
|
|
54
|
-
要求:Node.js 22.19 或更新版本、Pi 0.84.2
|
|
55
|
-
|
|
34
|
+
要求:Node.js 22.19 或更新版本、Pi 0.84.2 或更新版本,并已在 Pi 中配置模型标识包含
|
|
35
|
+
`deepseek-v4-pro` 的 provider。DeepSeek 官方 API 与 OpenCode Go 是本仓库已验证的路径;
|
|
36
|
+
第三方 provider 也会激活扩展,其兼容性、数据边界和计费由用户选择的 provider 决定。
|
|
56
37
|
|
|
57
|
-
|
|
38
|
+
安装到当前用户:
|
|
58
39
|
|
|
59
40
|
```bash
|
|
60
41
|
pi install npm:pi-dsh-mimic
|
|
@@ -74,43 +55,25 @@ pi -e ./packages/pi-dsh-mimic \
|
|
|
74
55
|
--model deepseek-v4-pro
|
|
75
56
|
```
|
|
76
57
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
`pi-package` keyword,可由 [Pi Package Catalog](https://pi.dev/packages) 索引。
|
|
58
|
+
OpenCode Go 使用 Pi 预期的 `OPENCODE_API_KEY` 环境变量,并将 provider 设为
|
|
59
|
+
`opencode-go`。
|
|
80
60
|
|
|
81
|
-
|
|
61
|
+
请先选择 V4 Pro,再新建 session。已有对话中途切换到 V4 Pro 不会补造 bootstrap。
|
|
62
|
+
扩展在目标 session 中注册 `str_replace_editor`;如果在同一个 session 里再切换到其他
|
|
63
|
+
模型,这个工具可能继续留在当前工具目录。需要干净的非目标模型环境时,新建 session。
|
|
82
64
|
|
|
83
|
-
##
|
|
65
|
+
## 请求变化
|
|
84
66
|
|
|
85
|
-
| |
|
|
67
|
+
| | 第一次请求 | 后续请求 |
|
|
86
68
|
| --- | --- | --- |
|
|
87
|
-
|
|
|
88
|
-
| User 历史 | 原始任务,包括 Pi
|
|
89
|
-
|
|
|
90
|
-
|
|
|
91
|
-
|
|
92
|
-
扩展不调用 `setActiveTools`,也不覆盖 Pi 原生 `bash`、`read`、`edit` 或 `write`。目标
|
|
93
|
-
新 session 武装时才注册一个可执行 `str_replace_editor`;请求 #2 起,其他 package
|
|
94
|
-
提供的工具会自然出现在完整目录中。
|
|
69
|
+
| Persona | `You are a helpful software engineer assistant.` | 保持不变 |
|
|
70
|
+
| User 历史 | 原始任务,包括 Pi 图片 | 保持不变 |
|
|
71
|
+
| 工具 | `bash`、`str_replace_editor` | Pi 当前完整目录,包括其他插件工具 |
|
|
72
|
+
| Payload | DSH Minimal 形状 | Pi 原生编码与排序 |
|
|
95
73
|
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
## 离线验证
|
|
100
|
-
|
|
101
|
-
TypeScript typecheck 已通过,13 项自动化测试全部通过。其中 12 项覆盖 package 行为与
|
|
102
|
-
manifest,1 项验证 session 统计工具。Package 行为测试覆盖:
|
|
103
|
-
|
|
104
|
-
- 首请求原任务、persona、字段顺序、cache 移除和两工具 schema;
|
|
105
|
-
- 请求 #2 恢复 Pi 原生 payload、完整目录和其他插件工具;
|
|
106
|
-
- 图片、API error 重试、文本回答晋升、session resume 和 crash-stale 恢复;
|
|
107
|
-
- 已有对话隔离、DeepSeek/OpenCode 双 provider 与非目标模型隔离;
|
|
108
|
-
- editor 的 create、view、replace、insert 和歧义替换拒绝。
|
|
109
|
-
|
|
110
|
-
OpenCode Go bash-first 与 editor-first 离线回环还通过 Pi 的真实 package loader 和 provider
|
|
111
|
-
路径验证了两个请求,`realModelCalls=0`。请求 #2 携带真实工具结果,并恢复
|
|
112
|
-
`read/bash/edit/write/str_replace_editor`。归一 user task 后,新请求 #1 与历史 98 分
|
|
113
|
-
capture 在消息、字段顺序、schema、`strict:false` 和序列化结构上逐项相等。
|
|
74
|
+
`str_replace_editor` 可以查看、创建和修改绝对路径文件,并继承 Pi 进程的文件系统权限。
|
|
75
|
+
任务、上下文和工具结果会发送给用户选择的 provider。扩展不读取或保存 API key;完整
|
|
76
|
+
边界见 [SECURITY.md](SECURITY.md)。
|
|
114
77
|
|
|
115
78
|
## 开发
|
|
116
79
|
|
|
@@ -121,15 +84,7 @@ npm run check
|
|
|
121
84
|
npm run pack:check
|
|
122
85
|
```
|
|
123
86
|
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
保存、记录或传输 API key,也不增加额外模型轮次。完整说明见
|
|
129
|
-
[SECURITY.md](SECURITY.md)。
|
|
130
|
-
|
|
131
|
-
Minimal persona 与两项工具协议文本来自
|
|
132
|
-
[DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) 的公开 Minimal 协议;
|
|
133
|
-
对应许可声明见 [LICENSE](LICENSE) 和 [NOTICE](NOTICE)。当前实现依据该公开协议、本项目
|
|
134
|
-
捕获的请求和 Project2 实验完成,与 Pi、DeepSeek、OpenCode 或 OpenAI 均无隶属或官方
|
|
135
|
-
背书关系。
|
|
87
|
+
Minimal persona 与两项工具协议来自 DeepSeek Harness 的
|
|
88
|
+
[公开 Minimal 协议](https://github.com/deepseek-ai/deepseek-harness),许可见
|
|
89
|
+
[LICENSE](LICENSE) 和 [NOTICE](NOTICE)。本项目与 Pi、DeepSeek、OpenCode 或 OpenAI
|
|
90
|
+
均无隶属或官方背书关系。
|
package/SECURITY.md
CHANGED
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
`pi-dsh-mimic` does not read, save, log, or transmit API keys. Provider
|
|
6
6
|
credentials remain under Pi and the selected provider's configuration. Never
|
|
7
|
-
put a
|
|
8
|
-
|
|
7
|
+
put a provider credential in a prompt, repository file, issue, screenshot, or
|
|
8
|
+
captured request.
|
|
9
9
|
|
|
10
10
|
If a credential has been exposed, revoke or rotate it with the provider before
|
|
11
11
|
continuing.
|
|
@@ -13,10 +13,13 @@ continuing.
|
|
|
13
13
|
## Provider data boundary
|
|
14
14
|
|
|
15
15
|
For target sessions, the task, conversation messages, tool schemas, and later
|
|
16
|
-
tool results are sent through
|
|
17
|
-
`
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
tool results are sent through the provider selected in Pi. A model id containing
|
|
17
|
+
`deepseek-v4-pro` activates the extension regardless of provider name. The
|
|
18
|
+
repository-qualified routes are `deepseek/deepseek-v4-pro` and
|
|
19
|
+
`opencode-go/deepseek-v4-pro`; third-party provider compatibility and data
|
|
20
|
+
handling remain the user's responsibility. The extension changes the first
|
|
21
|
+
request's persona and tool surface, but it is not an API proxy and does not
|
|
22
|
+
create a confidential channel.
|
|
20
23
|
|
|
21
24
|
The package adds no model round. The user's ordinary first task is the
|
|
22
25
|
bootstrap request and is billed normally by the selected provider.
|
package/docs/advanced.md
CHANGED
|
@@ -117,7 +117,7 @@ establishes a DSH Minimal first request, while Pi remains the execution runtime.
|
|
|
117
117
|
|
|
118
118
|
| Current behavior | Main evidence |
|
|
119
119
|
| --- | --- |
|
|
120
|
-
| Arm only fresh sessions
|
|
120
|
+
| Arm only fresh sessions whose model id contains `deepseek-v4-pro` | Provider names do not gate activation; an existing conversation cannot reproduce a real bootstrap; isolation tests cover target and non-target models |
|
|
121
121
|
| Put the original task in request #1 | Early prototype 98; Whoami 93 |
|
|
122
122
|
| Use the Minimal persona and DSH schemas in request #1 | Pi-native `bash/read` 93; approximate Minimal 93 |
|
|
123
123
|
| Return to Pi-native execution after the first valid response | One-shot 96–98; persistent DSH wire 94 |
|
|
@@ -143,10 +143,11 @@ without injecting them into the prompt.
|
|
|
143
143
|
|
|
144
144
|
## Implementation verification
|
|
145
145
|
|
|
146
|
-
TypeScript typechecking and all
|
|
147
|
-
providers,
|
|
148
|
-
|
|
149
|
-
|
|
146
|
+
TypeScript typechecking and all 14 automated tests pass. Thirteen cover both
|
|
147
|
+
qualified providers, namespaced model ids on third-party providers, images,
|
|
148
|
+
error retry, text promotion, session resume, crash-stale recovery,
|
|
149
|
+
existing-conversation isolation, and non-target model isolation; one verifies
|
|
150
|
+
the session-statistics helper. Editor tests cover create, view, unique
|
|
150
151
|
replacement, insertion, relative-path rejection, and ambiguous-replacement
|
|
151
152
|
rejection.
|
|
152
153
|
|
package/docs/advanced.zh-CN.md
CHANGED
|
@@ -99,7 +99,7 @@ provider payload 和 active catalog,其他 package 的工具会自然出现。
|
|
|
99
99
|
|
|
100
100
|
| 当前行为 | 主要证据 |
|
|
101
101
|
| --- | --- |
|
|
102
|
-
|
|
|
102
|
+
| 只武装模型标识包含 `deepseek-v4-pro` 的新 session | provider 名称不限制激活;已有对话无法还原真实 bootstrap;隔离测试覆盖目标与非目标模型 |
|
|
103
103
|
| 原任务直接进入请求 #1 | 早期原型 98;Whoami 93 |
|
|
104
104
|
| 请求 #1 使用 Minimal persona 与 DSH 两项 schema | Pi 原生 `bash/read` 93;近似 Minimal 93 |
|
|
105
105
|
| 第一次有效响应后恢复 Pi 原生执行 | one-shot 96–98;持续 DSH wire 94 |
|
|
@@ -122,9 +122,9 @@ wire 调用 225 次工具只得到 94,早期原型调用 148 次得到 98;
|
|
|
122
122
|
|
|
123
123
|
## 实现验证
|
|
124
124
|
|
|
125
|
-
TypeScript typecheck 已通过,
|
|
126
|
-
|
|
127
|
-
|
|
125
|
+
TypeScript typecheck 已通过,14 项自动化测试全部通过:13 项覆盖两个已验证 provider、
|
|
126
|
+
第三方 provider 的命名空间模型标识、图片、错误重试、文本晋升、session resume、
|
|
127
|
+
crash-stale 恢复、已有对话隔离和非目标模型隔离;另 1 项验证 session 统计工具。
|
|
128
128
|
Editor 测试覆盖 create、view、unique replace、insert、相对路径拒绝和歧义替换拒绝。
|
|
129
129
|
|
|
130
130
|
OpenCode Go bash-first 与 editor-first 离线回环通过 Pi 的真实 package loader 和 provider
|
|
@@ -219,9 +219,11 @@ evaluator。
|
|
|
219
219
|
## 当前决定
|
|
220
220
|
|
|
221
221
|
- 产品名为 `pi-dsh-mimic`。`0.1.0` 是首次公开实现;`0.1.1` 只补充 Project2 语境和
|
|
222
|
-
|
|
222
|
+
已发布安装说明,运行时代码不变;`0.1.2` 将激活条件改为模型标识包含
|
|
223
|
+
`deepseek-v4-pro`,不再按 provider 名称限制。
|
|
223
224
|
- 默认流程固定为 task-bearing one-shot:请求 #1 模拟 DSH Minimal,请求 #2 恢复 Pi。
|
|
224
|
-
-
|
|
225
|
+
- DeepSeek 官方 API 与 OpenCode Go 是本文已有运行和离线回环证据的 provider;第三方
|
|
226
|
+
provider 可以激活扩展,但不属于本文已经验证的实验范围。
|
|
225
227
|
- Minimal persona 保持;完整 Pi system context 不重放。
|
|
226
228
|
- Project2 同一请求流程已有四次 96–98,不继续重复付费运行。
|
|
227
229
|
- 新任务、模型或服务版本变化、provider payload 实质变化,或新的完整任务结果可以重开
|
package/package.json
CHANGED
package/src/constants.ts
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
export const TARGET_MODEL_ID = "deepseek-v4-pro";
|
|
2
2
|
|
|
3
|
-
export const TARGET_PROVIDERS = ["deepseek", "opencode-go"] as const;
|
|
4
|
-
|
|
5
3
|
export const MINIMAL_PERSONA = "You are a helpful software engineer assistant.";
|
|
6
4
|
|
|
7
5
|
export const STATE_ENTRY_TYPE = "pi-dsh-mimic/session-stage";
|
package/src/index.ts
CHANGED
|
@@ -12,7 +12,6 @@ import {
|
|
|
12
12
|
MINIMAL_PERSONA,
|
|
13
13
|
STATE_ENTRY_TYPE,
|
|
14
14
|
TARGET_MODEL_ID,
|
|
15
|
-
TARGET_PROVIDERS,
|
|
16
15
|
} from "./constants.js";
|
|
17
16
|
import { executeEditor, type EditorArgs } from "./editor.js";
|
|
18
17
|
import {
|
|
@@ -184,5 +183,4 @@ export {
|
|
|
184
183
|
MINIMAL_PERSONA,
|
|
185
184
|
STATE_ENTRY_TYPE,
|
|
186
185
|
TARGET_MODEL_ID,
|
|
187
|
-
TARGET_PROVIDERS,
|
|
188
186
|
};
|
package/src/session-stage.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
STATE_ENTRY_TYPE,
|
|
3
3
|
TARGET_MODEL_ID,
|
|
4
|
-
TARGET_PROVIDERS,
|
|
5
4
|
} from "./constants.js";
|
|
6
5
|
import { isJsonObject } from "./protocol.js";
|
|
7
6
|
|
|
@@ -21,9 +20,7 @@ export function supportedRoute(model: { provider?: unknown; id?: unknown } | und
|
|
|
21
20
|
if (typeof model?.provider !== "string" || typeof model.id !== "string") return undefined;
|
|
22
21
|
const provider = model.provider.toLowerCase();
|
|
23
22
|
const modelId = model.id.toLowerCase();
|
|
24
|
-
if (modelId
|
|
25
|
-
return undefined;
|
|
26
|
-
}
|
|
23
|
+
if (!modelId.includes(TARGET_MODEL_ID)) return undefined;
|
|
27
24
|
return `${provider}/${modelId}`;
|
|
28
25
|
}
|
|
29
26
|
|