dsh-ptc-plus 0.5.1 → 0.5.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.en.md +7 -3
- package/README.md +7 -3
- package/client.cjs +1467 -84
- package/compiler-core.cjs +132 -132
- package/compiler-core.cjs.map +3 -3
- package/docs/adr/0005-temporary-rejected-cell-edit-transport.md +2 -0
- package/docs/adr/0027-run-the-session-kernel-in-a-killable-helper-process.md +11 -1
- package/docs/adr/0032-own-session-log-facts-in-a-host-only-projection.md +31 -1
- package/docs/adr/0045-customize-model-visible-prompt-text.md +38 -0
- package/docs/adr/0046-gate-the-commit-with-the-semantic-evidence-tier.md +35 -0
- package/docs/adr/0047-store-journal-argument-digests-in-the-projection.md +88 -0
- package/docs/architecture.md +2 -2
- package/docs/client-ui.md +5 -2
- package/docs/durability-design.md +7 -1
- package/docs/releases/v0.5.2.md +79 -0
- package/docs/runtime-reference.md +36 -2
- package/docs/unmeasured-cell-recovery-repair-proposal.md +387 -0
- package/docs/verification.md +6 -2
- package/index.js +36 -15
- package/internal/bounded-literal.js +85 -0
- package/internal/capability-environment.js +162 -10
- package/internal/capability-plan.js +11 -8
- package/internal/cell-error.js +13 -0
- package/internal/config-spec.js +113 -2
- package/internal/direct-surface-owner.js +14 -10
- package/internal/edit-transport-owner.js +79 -14
- package/internal/isolated-worker.js +134 -17
- package/internal/kernel-worker.js +167 -3
- package/internal/legacy-cell-analysis.js +14 -2
- package/internal/legacy-repl-convenience.js +16 -3
- package/internal/projection-retention.js +238 -0
- package/internal/prompt-text.js +858 -0
- package/internal/recovery-tips.js +50 -11
- package/internal/rejected-cell-editor.js +3 -2
- package/internal/runtime-bridge-owner.js +1 -1
- package/internal/runtime-config.js +2 -0
- package/internal/runtime-contexts.js +14 -5
- package/internal/runtime-messages.js +43 -15
- package/internal/session-cell-executor.js +132 -11
- package/internal/session-journal-recovery.js +1009 -99
- package/internal/session-journal-schema.js +7 -5
- package/internal/session-journal.js +177 -14
- package/internal/session-log-view.js +111 -24
- package/internal/session-runtime.js +674 -33
- package/internal/session-state.js +27 -0
- package/internal/stateful-root-compiler.js +11 -0
- package/internal/stateful-root-runtime.js +17 -0
- package/internal/user-binding-console.js +7 -0
- package/internal/user-bindings-owner.js +3 -0
- package/internal/user-bindings.js +2 -2
- package/internal/validated-parse-repair.js +6 -1
- package/internal/worker-client.js +27 -4
- package/package.json +3 -1
- package/src/client-activity.js +24 -4
- package/src/client-capabilities-view.js +459 -24
- package/src/client-copy.js +163 -2
- package/src/client-repl-view.js +6 -1
- package/src/client-styles.js +64 -2
package/README.en.md
CHANGED
|
@@ -112,6 +112,8 @@ An `accepted: true, scheduled: true` receipt means the edit is scheduled: the en
|
|
|
112
112
|
| Argument validation reports a missing `description` | Distinguish outer and nested tool arguments and provide correction guidance, saved as a complete message so session history remains loadable |
|
|
113
113
|
| Code fails to parse | Identify the source position; at EOF, suggest a target-bound edit if appending one or two closing delimiters has exactly one validated correction |
|
|
114
114
|
|
|
115
|
+
When an accepted edit cannot obtain a compute baseline before it runs, the receipt stays a receipt: the revision does not execute, publishes no new binding, and the outer cell keeps its own result, so a restart does not lose what that cell already saved as a durable checkpoint.
|
|
116
|
+
|
|
115
117
|
The first two behaviors are on by default and can be disabled in settings. Syntax suggestions never execute on their own, and they say nothing about whether the code matches the task's intent. A volatile state cannot be saved as a durable checkpoint, but a rejected save leaves the current variables usable; restore does not undo external effects or change global binding configuration.
|
|
116
118
|
|
|
117
119
|
## Project files and tool capabilities
|
|
@@ -151,17 +153,19 @@ The settings window and the sidebar plugin configuration page are the same confi
|
|
|
151
153
|
| --- | --- | --- |
|
|
152
154
|
| Plugin switch | PTC Plus title switch | Enable or disable PTC Plus |
|
|
153
155
|
| Core workspace | REPL syntax | Allow same-name revisions or choose name protection |
|
|
154
|
-
| Core workspace | State and recovery | Restart recovery, official REPL ownership, contextual tips
|
|
156
|
+
| Core workspace | State and recovery | Restart recovery, official REPL ownership, contextual tips with their frequency, and the unmeasured-cell reclaim threshold |
|
|
155
157
|
| Extensions and tolerance | Tool extensions | Global bindings and their management entry, official Cordis tool integration |
|
|
156
158
|
| Extensions and tolerance | Tool call tolerance | Missing call summaries and identifiable misplaced native-tool calls |
|
|
157
159
|
| Interface and resources | Interface display | Enhanced tool cards, the REPL tab, and the sparkle shortcut |
|
|
158
|
-
| Interface and resources | Resource limits | Execution time, memory, and
|
|
159
|
-
| Experimental | Capabilities and context | Experimental capability management (off by default), independent statistics, common baseline, individual choices,
|
|
160
|
+
| Interface and resources | Resource limits | Execution time, memory, output, sampling, reclamation, and startup limits |
|
|
161
|
+
| Experimental | Capabilities and context | Experimental capability management (off by default), independent statistics, common baseline, individual choices, presentation budgets, and prompt text |
|
|
160
162
|
|
|
161
163
|
Everyday computation features are on by default, and **Cordis development tools are off by default** so they can be enabled when inspecting or developing DSH plugins; see the [integration notes](docs/adr/0020-optional-cordis-tools-in-ptc-mode.md).
|
|
162
164
|
|
|
163
165
|
Capabilities and context is an experimental group, off by default. It selects availability and disclosure for Skills, tools, and MCP capabilities by category, source, or item, and it also covers Initial prompt, Prompt recovery, Output excerpts, and Usage statistics; the switch beside its title pauses the whole group while keeping every choice, and changes apply to new sessions or to a session after an explicit refresh. The sparkle menu also opens the session capability workbench, which views and adjusts the current session's capabilities by category, source, and state: edits live in one draft that you can apply to this session only or save as the global default. See the [configuration reference](docs/runtime-reference.md#configuration) for fields, defaults, and full limits.
|
|
164
166
|
|
|
167
|
+
The **Prompt text** tab lists the fixed text the plugin writes for the model: each row names its channel, presence condition, byte count, and read-only reason, and the totals line reports measured bytes, unmeasured slots, and dynamic slots separately. Editable rows are counted per slot and saving writes the configuration; a channel that is not connected yet says so instead of reporting zero bytes as if measured; protocol text, sentences generated from configuration or runtime facts, and the binding notes you wrote yourself stay read-only.
|
|
168
|
+
|
|
165
169
|
Before a new session starts, capability and global binding changes only update its initial configuration; no change notices are sent or queued. The first request uses the resulting configuration.
|
|
166
170
|
|
|
167
171
|
The host execution provider must use TypeScript; changing it to another language during a reload withdraws the plugin and reports a diagnostic, and switching back re-enables it.
|
package/README.md
CHANGED
|
@@ -112,6 +112,8 @@ return receipt
|
|
|
112
112
|
| 参数校验报告缺少 `description` | 区分外层与嵌套工具参数并给出修正提示;提示以完整消息保存,保持会话历史可加载 |
|
|
113
113
|
| 代码解析失败 | 标出源码位置;若错误在末尾,且追加一到两个闭合符只有一种通过验证的修正,给出绑定原调用的编辑建议 |
|
|
114
114
|
|
|
115
|
+
被接受的编辑若在真正执行前因为没有取得计算基线而未能运行,收据仍然是收据:修订不执行、不产生新变量,外层 cell 自己的结果照常保存,重启恢复时也不会再因为这次编辑而连带丢掉它已保存为 durable 检查点的状态。
|
|
116
|
+
|
|
115
117
|
前两项默认开启,可以在设置里关掉。语法建议不会自动执行,也不代表代码符合任务意图。volatile 状态存不成 durable 检查点,但保存被拒绝后当前变量还能接着用;恢复不撤销外部效果,也不改全局绑定配置。
|
|
116
118
|
|
|
117
119
|
## 项目文件与工具能力
|
|
@@ -151,12 +153,12 @@ return capabilities.search({ query: 'read file content', budgetBytes: 8192 })
|
|
|
151
153
|
| --- | --- | --- |
|
|
152
154
|
| 插件开关 | PTC Plus 标题总开关 | 启用或停用 PTC Plus |
|
|
153
155
|
| 核心工作区 | REPL 语法 | 允许同名修订或选择名称保护 |
|
|
154
|
-
| 核心工作区 | 状态与恢复 | 重启恢复、官方 REPL
|
|
156
|
+
| 核心工作区 | 状态与恢复 | 重启恢复、官方 REPL 模式归属、上下文提示及其频率、未测量 cell 回收阈值 |
|
|
155
157
|
| 扩展与容错 | 工具扩展 | 全局绑定及其管理入口、官方 Cordis 工具集成 |
|
|
156
158
|
| 扩展与容错 | 调用容错 | 缺失调用摘要、可识别的错位原生工具调用 |
|
|
157
159
|
| 界面与资源 | 界面显示 | 增强工具卡片、REPL 页签和星光快捷入口 |
|
|
158
|
-
| 界面与资源 | 资源限制 |
|
|
159
|
-
| 实验性 | 能力与上下文 |
|
|
160
|
+
| 界面与资源 | 资源限制 | 执行时间、内存、输出、采样、回收与启动上限 |
|
|
161
|
+
| 实验性 | 能力与上下文 | 实验性能力管理(默认关闭)、独立统计、常用集、单项选择、展示预算和提示文本 |
|
|
160
162
|
|
|
161
163
|
新会话尚未开始时,调整能力或全局绑定只更新初始配置,不发送或排队发送变更说明;首轮使用调整后的配置。
|
|
162
164
|
|
|
@@ -164,6 +166,8 @@ return capabilities.search({ query: 'read file content', budgetBytes: 8192 })
|
|
|
164
166
|
|
|
165
167
|
“能力与上下文”是实验性设置,默认关闭。打开后可以按类别、来源和单项选择 Skills、Tools 和 MCP 能力的启停与说明方式,初始提示、提示恢复、输出节选和使用统计也在这里;标题旁的总开关一次暂停整组并保留原有选择,改动对新会话或明确刷新后的会话生效。星光菜单里还有一个会话能力工作台,用来按类别、来源和状态查看、调整当前会话的能力,改动先放进草稿,可以只写进本会话,也可以保存成全局默认。字段、默认值和完整限制见[配置参考](docs/runtime-reference.md#configuration)。
|
|
166
168
|
|
|
169
|
+
**提示文本**页签把插件写给模型的固定文本列成清单:每行标注所属通道、存在条件、字节数与只读原因,合计行分别给出已测字节、未测槽和动态槽。可编辑项按槽位计字节,改完保存即写入配置;通道尚未接通时如实显示“通道未接通”,不以 0 字节冒充已测量;协议文本、由配置或运行事实生成的句子,以及你自己写给模型的绑定说明只读展示。
|
|
170
|
+
|
|
167
171
|
宿主执行 provider 必须使用 TypeScript;热重载换成别的语言时插件会撤出并报出诊断,换回来就重新启用。
|
|
168
172
|
|
|
169
173
|
开启 DSH 官方的 `executionMode: persistent-in-memory` 后,可以在“状态与恢复”里用**官方 REPL 模式优先**选择谁接管 PTC 会话:默认关闭,`run_code` 由 PTC Plus 接管;开启后由官方运行时接管,PTC Plus 让出执行、REPL 状态语义与观察,官方模式没开启时该设置不生效。切换立即生效,离开插件执行时会释放插件的内存环境;官方内存状态由 DSH 的 Agent/provider 生命周期管理,切换优先设置不保证清空它。官方执行期间的调用不进入插件记录,切回插件后不会当作可恢复状态。
|