dsh-ptc-plus 0.4.8 → 0.4.10
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 +11 -3
- package/README.md +11 -3
- package/client.js +1151 -529
- package/cordis.patch.yml +12 -2
- package/docs/README.md +1 -0
- package/docs/adr/0005-temporary-rejected-cell-edit-transport.md +19 -0
- package/docs/adr/0019-plugin-settings-and-kill-switch.md +13 -2
- package/docs/adr/0020-optional-cordis-tools-in-ptc-mode.md +1 -1
- package/docs/adr/0023-global-user-bindings.md +1 -1
- package/docs/adr/0028-attach-to-the-host-ptc-execution-seam.md +82 -18
- package/docs/adr/0030-serve-both-typert-codec-generations-from-one-codec.md +3 -3
- package/docs/adr/0032-own-session-log-facts-in-a-host-only-projection.md +27 -0
- package/docs/adr/0033-gate-client-visual-usability-in-a-browser.md +23 -0
- package/docs/architecture.md +3 -3
- package/docs/binding-review-placement-design.md +29 -21
- package/docs/client-ui.md +20 -8
- package/docs/client-visual-contract.md +48 -0
- package/docs/durability-design.md +12 -0
- package/docs/installation.md +27 -6
- package/docs/runtime-reference.md +1 -1
- package/docs/user-bindings.en.md +2 -2
- package/docs/user-bindings.md +3 -3
- package/docs/verification-optimization-work.md +26 -0
- package/docs/verification.md +2 -0
- package/index.js +28 -7
- package/internal/compiler-platform.js +5 -3
- package/internal/compiler-service.js +2 -9
- package/internal/cordis-tools-owner.js +22 -19
- package/internal/direct-surface-owner.js +2 -0
- package/internal/edit-transport-owner.js +8 -5
- package/internal/execution-provider-owner.js +157 -0
- package/internal/execution-seam-compat.js +69 -113
- package/internal/isolated-worker.js +12 -8
- package/internal/recovery-tips.js +50 -21
- package/internal/runtime-bridge-owner.js +88 -57
- package/internal/runtime-contexts.js +13 -13
- package/internal/session-events.js +40 -4
- package/internal/session-journal-recovery.js +678 -181
- package/internal/session-log-view.js +189 -43
- package/internal/session-runtime.js +58 -10
- package/internal/settings-compat.js +12 -2
- package/internal/user-bindings-owner.js +6 -5
- package/locale/en.json +6 -0
- package/locale/zh.json +6 -0
- package/package.json +13 -14
- package/src/client-authoring-view.js +222 -141
- package/src/client-binding-review.js +2 -0
- package/src/client-code-editor.js +6 -0
- package/src/client-copy.js +10 -0
- package/src/client-feature-gates.js +12 -5
- package/src/client-host-compat.js +23 -2
- package/src/client-primitives.js +249 -0
- package/src/client-repl-view.js +3 -3
- package/src/client-settings-view.js +2 -29
- package/src/client-styles.js +92 -33
- package/src/client-tool-view.js +8 -3
- package/src/client-workbench.js +3 -3
- package/src/client.js +72 -46
- package/assets/ptc-plus-bindings-en.png +0 -0
- package/assets/ptc-plus-bindings-zh.png +0 -0
- package/assets/ptc-plus-repair-en.png +0 -0
- package/assets/ptc-plus-repair-zh.png +0 -0
package/README.en.md
CHANGED
|
@@ -37,6 +37,8 @@ dsh plugin --profile <profile> add dsh-ptc-plus
|
|
|
37
37
|
|
|
38
38
|
Replace `<profile>` with your profile name. Restart DSH and select **PTC mode** in the session. Continuous computation, call tolerance, and global bindings default to on. Explicitly disabled options in an existing configuration stay disabled.
|
|
39
39
|
|
|
40
|
+
Session history uses DSH's public reader, and the Host incrementally projects prompt facts. Missing read surfaces or malformed historical event arrays produce explicit diagnostics, not a claim that unavailable history was successfully recovered as an empty session.
|
|
41
|
+
|
|
40
42
|
With the default interface settings, the session has a **REPL** tab; wide screens also show a green **PTC Plus** header indicator. The sparkle button beside the composer opens the global binding menu and **PTC Plus settings**. You can also open **Plugins → Installed → dsh-ptc-plus → Configure** in the sidebar to check the main switch and all plugin settings.
|
|
41
43
|
|
|
42
44
|
Once installed, describe your task to the model as usual. The `run_code` and `edit_run_code` examples below show how the model uses these features. See the [installation guide](docs/installation.md) for other installation methods, Desktop, the local development launcher, upgrades, and troubleshooting.
|
|
@@ -128,6 +130,8 @@ edit_run_code({
|
|
|
128
130
|
|
|
129
131
|
An edit **reruns the entire cell**; this example returns `12`. Earlier state changes are not rolled back. If the code writes files or calls external services, rerunning still requires considering duplicate effects. Edits can repair failed code or refine a successful computation.
|
|
130
132
|
|
|
133
|
+
Republishing a historical result as a compacted display entry is not another execution and does not make the older cell the new edit target. A newer failed cell remains available for correction.
|
|
134
|
+
|
|
131
135
|
### Recover from identifiable call problems
|
|
132
136
|
|
|
133
137
|
| Situation | PTC Plus behavior |
|
|
@@ -191,9 +195,9 @@ Global bindings and the sparkle shortcut default to on. Create entries manually,
|
|
|
191
195
|
|
|
192
196
|
### Author, review, and enable
|
|
193
197
|
|
|
194
|
-
The model can test with in-memory examples before submitting a draft. The draft
|
|
198
|
+
The model can test with in-memory examples before submitting a draft. The draft floats above the composer; expanding or collapsing it leaves the conversation in place. Opening a draft from the composer menu or original request goes directly to the large dialog. Choose **Enlarge binding draft** to review the complete source in a large dialog with independent scrolling and save/discard actions at the bottom. The header separates resize and close controls; **Shrink binding draft** returns to preview. Review its source, interface, and model instructions, then choose **Save and enable**, **Save disabled**, or **Discard draft**. Submission alone neither saves nor enables a binding. If you close the panel, the sparkle button's draft badge lets you reopen it.
|
|
195
199
|
|
|
196
|
-
The sparkle menu lists and toggles entries even before the first message; these choices apply across sessions. Enabled entries' interfaces and usage notes are provided to the model in new sessions. Changes during a session are delivered on its next allowed request.
|
|
200
|
+
The sparkle menu lists and toggles entries even before the first message; these choices apply across sessions. Enabled entries appear first; the disabled group shows its count and starts collapsed. Only the binding list scrolls, keeping authoring, revision, management, and settings actions visible at the bottom. Enabled entries' interfaces and usage notes are provided to the model in new sessions. Changes during a session are delivered on its next allowed request.
|
|
197
201
|
|
|
198
202
|
### Interface guidance and independent trial runs
|
|
199
203
|
|
|
@@ -205,6 +209,8 @@ The workbench can run unsaved source and retain temporary variables across execu
|
|
|
205
209
|
|
|
206
210
|
The **REPL tab** lets you search retained names, inspect definitions, see reuse counts and bounded value previews, and open the global binding workbench. Previews have type and size limits; missing, incomplete, or unreadable previews are identified explicitly, and display does not invoke user getters. The green **PTC Plus** header indicator offers a quick binding list on wide screens; use the REPL tab on narrow screens.
|
|
207
211
|
|
|
212
|
+
Workbench controls provide visible keyboard focus and disabled feedback, and REPL names remain readable in light and dark themes. See the [visual contract](docs/client-visual-contract.md) for browser regression checks and their coverage limits.
|
|
213
|
+
|
|
208
214
|

|
|
209
215
|
|
|
210
216
|
The sparkle menu beside the composer groups binding authoring, entry management, and **PTC Plus settings**. Its settings dialog and the sidebar plugin configuration page share the same configuration:
|
|
@@ -221,7 +227,9 @@ The sparkle menu beside the composer groups binding authoring, entry management,
|
|
|
221
227
|
|
|
222
228
|
Everyday computation features default to on. **Cordis development tools default to off** and can be enabled when inspecting or developing DSH plugins; see the [integration notes](docs/adr/0020-optional-cordis-tools-in-ptc-mode.md). Explicitly disabled options stay disabled, and each saved binding keeps its own enabled state.
|
|
223
229
|
|
|
224
|
-
Settings usually apply immediately. A worker's memory limit cannot be changed while that worker is active. See the [configuration reference](docs/runtime-reference.md#configuration) for fields, defaults, and full limits.
|
|
230
|
+
Settings usually apply immediately. A worker's memory limit cannot be changed while that worker is active or a submitted cell is preparing to execute. See the [configuration reference](docs/runtime-reference.md#configuration) for fields, defaults, and full limits.
|
|
231
|
+
|
|
232
|
+
The host execution provider must use TypeScript. Changing it to another language during reload withdraws the active PTC runtime and reports a diagnostic; returning to TypeScript reactivates it without changing the plugin setting.
|
|
225
233
|
|
|
226
234
|

|
|
227
235
|
|
package/README.md
CHANGED
|
@@ -37,6 +37,8 @@ dsh plugin --profile <profile> add dsh-ptc-plus
|
|
|
37
37
|
|
|
38
38
|
将 `<profile>` 替换为实际 profile 名称。安装后重启 DSH,在会话中选择 **PTC 模式**。连续计算、调用容错和全局绑定默认开启;已有配置中显式关闭的选项会保持关闭。
|
|
39
39
|
|
|
40
|
+
会话历史通过 DSH 的公开 reader 读取,提示事实由 Host 增量投影维护;读取面缺失或旧格式事件数组损坏时会明确报错,不把不可用历史当作成功恢复的空会话。
|
|
41
|
+
|
|
40
42
|
在默认界面设置下,会话中会出现 **REPL** 页签;宽屏顶部还会显示绿色 **PTC Plus** 标志。输入框旁的星光按钮可打开全局绑定菜单和 **PTC Plus 设置**。也可从侧边栏 **插件 → 已安装 → dsh-ptc-plus → 配置** 检查插件总开关和全部设置。
|
|
41
43
|
|
|
42
44
|
安装完成后正常向模型描述任务即可,下面的 `run_code` 和 `edit_run_code` 示例说明模型如何使用这些能力。其他安装方式、Desktop、本地开发启动器、升级和故障排查见[安装指南](docs/installation.md)。
|
|
@@ -128,6 +130,8 @@ edit_run_code({
|
|
|
128
130
|
|
|
129
131
|
修改后会**重新执行整个 cell**,以上例子返回 `12`。已发生的状态修改不会回滚;如果代码涉及写文件或外部服务,重跑仍需考虑重复效果。编辑既可用于修复失败的代码,也可用于微调已成功的计算。
|
|
130
132
|
|
|
133
|
+
历史结果被压缩为新的显示条目,不算再次执行,也不会把旧 cell 变成新的编辑目标;较新的失败 cell 仍可继续修正。
|
|
134
|
+
|
|
131
135
|
### 处理可以确定的调用问题
|
|
132
136
|
|
|
133
137
|
| 情况 | PTC Plus 的处理 |
|
|
@@ -191,9 +195,9 @@ return capabilities.inspect({
|
|
|
191
195
|
|
|
192
196
|
### 编写、审阅与启用
|
|
193
197
|
|
|
194
|
-
|
|
198
|
+
模型可先用内存样例测试,再提交草稿。草稿悬浮在输入框上方,展开或折叠不挤动对话;从星光菜单或原请求打开草稿时,直接进入大窗口。点击 **放大查看绑定草稿** 可在大窗口内审阅完整源码,正文独立滚动,底部保留保存与丢弃按钮;标题栏的放大、缩小与关闭操作分开显示,点击 **缩小显示绑定草稿** 返回预览;由你检查源码、接口和给模型的提示词,并选择 **保存并启用**、**保存为停用** 或 **丢弃草稿**。提交草稿本身不会保存或启用绑定;关闭面板后,可从星光按钮的草稿角标重新打开。
|
|
195
199
|
|
|
196
|
-
|
|
200
|
+
星光菜单可在首条消息发出前查看、启停条目,选择对所有会话生效。已启用条目优先展示,停用组显示数量并默认折叠;只有绑定列表滚动,底部编写、修改、管理和设置按钮始终可见。已启用条目的接口和使用提示会提供给新会话中的模型;中途修改后,在现有会话的下一次允许请求中更新。
|
|
197
201
|
|
|
198
202
|
### 接口提示与独立试运行
|
|
199
203
|
|
|
@@ -205,6 +209,8 @@ return capabilities.inspect({
|
|
|
205
209
|
|
|
206
210
|
**REPL 页签**可搜索当前保留的名称,查看定义来源、复用次数和有界值预览,也可打开全局绑定工作台。预览有类型和大小限制,未采集、不完整或不可读取时会明确标注,不会为展示调用用户 getter。宽屏顶部的绿色 **PTC Plus** 标志提供快捷绑定清单,窄屏可使用 REPL 页签。
|
|
207
211
|
|
|
212
|
+
工作台控件提供可见的键盘焦点和禁用反馈,REPL 名称在明暗主题下保持可读;关键控件的浏览器回归检查及覆盖边界见[视觉契约](docs/client-visual-contract.md)。
|
|
213
|
+
|
|
208
214
|

|
|
209
215
|
|
|
210
216
|
输入框旁的星光菜单将绑定编写、条目管理和 **PTC Plus 设置** 分组提供。设置弹窗与侧边栏插件配置页使用同一套配置:
|
|
@@ -221,7 +227,9 @@ return capabilities.inspect({
|
|
|
221
227
|
|
|
222
228
|
面向日常计算的功能默认开启。**Cordis 开发工具默认关闭**,适用于检查或开发 DSH 插件,按需开启即可;详见[集成说明](docs/adr/0020-optional-cordis-tools-in-ptc-mode.md)。已有配置中显式关闭的选项会保持关闭,条目是否启用也由各自的保存状态决定。
|
|
223
229
|
|
|
224
|
-
设置通常即时生效;活动 worker
|
|
230
|
+
设置通常即时生效;活动 worker 存在或已提交的 cell 正在准备执行时不能修改其内存上限。字段、默认值和完整限制见[配置参考](docs/runtime-reference.md#configuration)。
|
|
231
|
+
|
|
232
|
+
宿主执行 provider 必须使用 TypeScript。热重载改为其他语言时,PTC Plus 撤出当前接管并报告诊断;恢复 TypeScript 后重新启用,插件开关保持原选择。
|
|
225
233
|
|
|
226
234
|

|
|
227
235
|
|