dsh-ptc-plus 0.4.2 → 0.4.3
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 +166 -76
- package/README.md +167 -77
- package/assets/dsh-ptc-plus-banner-en.webp +0 -0
- package/assets/dsh-ptc-plus-banner-zh.webp +0 -0
- package/assets/ptc-plus-icon.svg +5 -0
- package/client.js +593 -306
- package/compiler-core.cjs +162 -160
- package/compiler-core.cjs.map +3 -3
- package/docs/README.md +3 -1
- package/docs/adr/0005-temporary-rejected-cell-edit-transport.md +8 -7
- package/docs/adr/0008-define-agent-operating-contract.md +2 -2
- package/docs/adr/0010-session-log-derived-recovery-tips.md +7 -0
- package/docs/adr/0016-archive-resolved-review-findings.md +3 -3
- package/docs/adr/0019-plugin-settings-and-kill-switch.md +3 -3
- package/docs/adr/0020-optional-cordis-tools-in-ptc-mode.md +2 -0
- package/docs/adr/0021-separate-host-bootstrap-from-session-runtime.md +14 -3
- package/docs/adr/0023-global-user-bindings.md +1 -1
- package/docs/adr/0026-persist-the-delivery-verdict-against-the-verified-candidate.md +23 -7
- package/docs/adr/0027-run-the-session-kernel-in-a-killable-helper-process.md +4 -0
- package/docs/adr/0028-attach-to-the-host-ptc-execution-seam.md +26 -6
- package/docs/adr/0031-close-semantic-obligations-by-owner.md +29 -0
- package/docs/adr/README.md +4 -4
- package/docs/architecture.md +6 -5
- package/docs/binding-review-placement-design.md +1 -1
- package/docs/client-ui.md +8 -4
- package/docs/durability-design.md +7 -7
- package/docs/installation.md +26 -8
- package/docs/runtime-reference.md +18 -11
- package/docs/semantic-validation.md +7 -3
- package/docs/user-bindings.en.md +7 -6
- package/docs/user-bindings.md +6 -5
- package/docs/value-wire.md +1 -1
- package/docs/verification.md +38 -1
- package/index.js +39 -34
- package/internal/async-local-storage-intrinsics.js +12 -7
- package/internal/callable-source-facts.js +37 -1
- package/internal/cell-analysis.js +64 -9
- package/internal/config-spec.js +1 -1
- package/internal/cordis-tools-owner.js +20 -10
- package/internal/edit-transport-owner.js +80 -20
- package/internal/execution-seam-compat.js +192 -30
- package/internal/kernel-worker.js +162 -72
- package/internal/message-sources.js +14 -0
- package/internal/module-compilation.js +2 -1
- package/internal/repl-memory-projection.js +10 -0
- package/internal/repl-scope-normalizer.js +72 -35
- package/internal/repl-value-observer.js +141 -45
- package/internal/runtime-config.js +62 -2
- package/internal/runtime-intrinsics.js +3 -0
- package/internal/runtime-messages.js +6 -4
- package/internal/session-cell-executor.js +24 -1
- package/internal/session-journal-recovery.js +267 -67
- package/internal/session-journal.js +466 -40
- package/internal/session-log-view.js +5 -4
- package/internal/session-runtime.js +45 -21
- package/internal/session-state.js +7 -29
- package/internal/settings-compat.js +66 -1
- package/internal/source-position-map.js +19 -0
- package/internal/user-binding-console-worker.js +23 -9
- package/internal/user-binding-draft-projection.js +3 -2
- package/internal/user-bindings-owner.js +2 -1
- package/internal/user-bindings.js +6 -1
- package/internal/validated-parse-repair.js +6 -2
- package/internal/value-wire.js +95 -30
- package/internal/worker-client.js +99 -8
- package/internal/worker-cwd-virtualization.js +10 -9
- package/internal/worker-output-capture.js +187 -0
- package/internal/worker-output-fence.js +26 -0
- package/internal/worker-realm-surfaces.js +197 -0
- package/internal/worker-repl-realm.js +10 -4
- package/package.json +36 -4
- package/src/client-activity.js +4 -1
- package/src/client-authoring-view.js +121 -62
- package/src/client-console.js +4 -2
- package/src/client-copy.js +4 -2
- package/src/client-feature-gates.js +7 -9
- package/src/client-host-compat.js +104 -27
- package/src/client-repl-view.js +3 -1
- package/src/client-styles.js +12 -1
- package/src/client-tool-view.js +3 -1
- package/src/client-transport.js +2 -2
- package/src/client-workbench.js +4 -3
- package/src/client.js +56 -17
package/README.en.md
CHANGED
|
@@ -1,24 +1,13 @@
|
|
|
1
1
|
<p align="center">
|
|
2
|
-
<img src="assets/dsh-ptc-plus-banner-en.webp" width="100%" alt="
|
|
2
|
+
<img src="assets/dsh-ptc-plus-banner-en.webp" width="100%" alt="PTC Plus: No need to start over! Update it. Keep computing!">
|
|
3
3
|
</p>
|
|
4
4
|
|
|
5
5
|
<p align="center">
|
|
6
|
-
<a href="README.md">简体中文</a> ·
|
|
7
|
-
<strong>English</strong>
|
|
8
|
-
</p>
|
|
9
|
-
|
|
10
|
-
<p align="center">
|
|
11
|
-
<a href="#what-default-ptc-mode-gets-wrong">Problems</a> ·
|
|
12
|
-
<a href="#three-scenes-that-matter-most">Scenes</a> ·
|
|
13
|
-
<a href="#settings">Settings</a> ·
|
|
14
|
-
<a href="#scope">Scope</a> ·
|
|
15
|
-
<a href="#install">Install</a> ·
|
|
16
|
-
<a href="#documentation">Docs</a>
|
|
6
|
+
<a href="README.md">简体中文</a> · <strong>English</strong>
|
|
17
7
|
</p>
|
|
18
8
|
|
|
19
9
|
<p align="center">
|
|
20
10
|
<a href="https://github.com/deepseek-ai/deepseek-harness"><img alt="DeepSeek Harness PTC mode" src="https://img.shields.io/badge/DeepSeek%20Harness-PTC%20mode-4b6bfb"></a>
|
|
21
|
-
<a href="package.json"><img alt="Node.js ^22.19.0 || >=24.0.0" src="https://img.shields.io/badge/Node.js-%5E22.19.0%20%7C%7C%20%3E%3D24.0.0-5fa04e?logo=nodedotjs&logoColor=white"></a>
|
|
22
11
|
<a href="https://www.npmjs.com/package/dsh-ptc-plus"><img alt="npm version" src="https://img.shields.io/npm/v/dsh-ptc-plus?logo=npm"></a>
|
|
23
12
|
<a href="LICENSE"><img alt="License: MIT" src="https://img.shields.io/badge/License-MIT-yellow.svg"></a>
|
|
24
13
|
</p>
|
|
@@ -27,53 +16,132 @@
|
|
|
27
16
|
<a href="https://awesome-dsh-plugin.com/"><img alt="Awesome DSH Plugin" src="https://awesome-dsh-plugin.com/badge.svg"></a>
|
|
28
17
|
</p>
|
|
29
18
|
|
|
30
|
-
|
|
19
|
+
**Let the model keep computing and revise its work within a session, with less repeated setup and fewer avoidable tool-call errors.**
|
|
31
20
|
|
|
32
|
-
|
|
21
|
+
PTC Plus provides a stateful TypeScript computation environment for DSH's **PTC mode**. Built on a REPL, it keeps variables, functions, imports, and intermediate results available across tool calls. It extends declaration update rules and adapts module syntax, with call tolerance and code editing designed for models that repeatedly write and revise code.
|
|
33
22
|
|
|
34
|
-
|
|
35
|
-
|
|
23
|
+
- **Keep computing**: reuse data already loaded and processed in the session.
|
|
24
|
+
- **Revise directly**: update a variable or function under the same name; existing closures read the updated binding. Small changes can be sent as code deltas.
|
|
25
|
+
- **Avoid routine call failures**: use familiar module syntax, recover from identifiable call omissions, and receive correction suggestions for verifiable syntax errors.
|
|
26
|
+
- **Reuse common capabilities**: save functions as global bindings, provide their interfaces and usage notes to the model, and use them across sessions.
|
|
36
27
|
|
|
37
|
-
|
|
38
|
-
> Built for `danger-full-access`: code can access Node.js and the operating system directly. The plugin adds no sandbox. Use it where that permission scope is acceptable.
|
|
28
|
+
[Quick start](#quick-start) · [Feature overview](#feature-overview) · [Continuous computation](#continuous-computation-and-language-extensions) · [Editing and call tolerance](#code-editing-and-call-tolerance) · [Global bindings](#global-bindings-reuse-functions-across-sessions) · [Interface and settings](#interface-and-settings) · [Values and recovery](#value-transfer-and-state-recovery)
|
|
39
29
|
|
|
40
|
-
##
|
|
30
|
+
## Quick start
|
|
41
31
|
|
|
42
|
-
Requires Node.js `^22.19.0 || >=24.0.0` and
|
|
32
|
+
Requires Node.js `^22.19.0 || >=24.0.0` and the latest available official DSH release. Install into the profile you actually use:
|
|
43
33
|
|
|
44
34
|
```sh
|
|
45
35
|
dsh plugin --profile <profile> add dsh-ptc-plus
|
|
46
36
|
```
|
|
47
37
|
|
|
48
|
-
|
|
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.
|
|
49
39
|
|
|
50
|
-
|
|
40
|
+
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.
|
|
51
41
|
|
|
52
|
-
|
|
42
|
+
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.
|
|
43
|
+
|
|
44
|
+
## Feature overview
|
|
45
|
+
|
|
46
|
+
Default PTC mode starts every execution in a fresh environment: variables from the previous call are gone, and a change that depends on earlier results means resending the setup code. PTC Plus turns `run_code` into a session-bound TypeScript REPL and closes the gaps below.
|
|
53
47
|
|
|
54
48
|
| Scenario | Default PTC mode | With PTC Plus |
|
|
55
49
|
| --- | --- | --- |
|
|
56
|
-
| Continue
|
|
57
|
-
|
|
|
58
|
-
|
|
|
59
|
-
|
|
|
60
|
-
|
|
|
61
|
-
|
|
|
62
|
-
|
|
|
63
|
-
|
|
|
64
|
-
|
|
|
65
|
-
|
|
|
66
|
-
|
|
|
67
|
-
|
|
|
68
|
-
|
|
|
50
|
+
| Continue processing data | Each call starts fresh, so setup code must be sent again | Variables, functions, imports, and intermediate results stay in the session for the next call |
|
|
51
|
+
| Revise an existing name | No established binding can be updated, so the whole cell has to be resent | Revise variables, functions, classes, and import bindings under the same names; existing closures read updated bindings |
|
|
52
|
+
| Change a small part of the code | A one-line change means resending the complete source | Submit a delta through `edit_run_code`, then execute the complete revised cell |
|
|
53
|
+
| Use module syntax | Static `import` and `export` are invalid inside the function body | Write them directly in a cell; the plugin adapts the module syntax |
|
|
54
|
+
| Omit a call summary | Missing `run_code.description` fails validation | Supply a display summary automatically so otherwise valid code proceeds |
|
|
55
|
+
| Recover a misplaced top-level tool call | Undeclared top-level calls are rejected in PTC mode | Convert the call to `run_code` when the live tool definitions uniquely identify the target and validate its arguments |
|
|
56
|
+
| Locate a code error | Return the native error and stack | Map the error to the cell source; suggest an edit when a missing trailing delimiter has one verified correction |
|
|
57
|
+
| Work with the current project | Relative Node paths depend on the host process directory | Resolve file paths, session module imports, and default child-process directories from the session project directory |
|
|
58
|
+
| Find tools and parameters | Read through the tool interfaces already supplied to the model | List and search current capabilities in code, then inspect relevant interfaces on demand |
|
|
59
|
+
| Transfer data beyond plain JSON | JSON cannot fully represent `undefined`, BigInt, cycles, and similar values | Preserve supported special values and reference relationships for further computation and recovery |
|
|
60
|
+
| Inspect computation state | No reusable session variables remain after a call | View retained names, source definitions, reuse counts, and bounded value previews in the REPL tab |
|
|
61
|
+
| Reuse functions across sessions | Save the code yourself and reload it in later calls | Save TypeScript global bindings and supply their interfaces and usage notes to the model |
|
|
62
|
+
| Author and test global bindings | No dedicated workbench for global bindings | Ask the model for a draft to review, or run unsaved source in the workbench |
|
|
63
|
+
| Continue after a restart | No computation state spans calls, so there is nothing to recover | Recover verifiable state from session records and report what cannot be recovered |
|
|
64
|
+
|
|
65
|
+
The following sections explain usage and limits. See the [runtime reference](docs/runtime-reference.md) for complete language rules, configuration fields, and diagnostics.
|
|
66
|
+
|
|
67
|
+
## Continuous computation and language extensions
|
|
68
|
+
|
|
69
|
+
The model executes the following code through `run_code`. Each call's code is a **cell**.
|
|
70
|
+
|
|
71
|
+
First, define the data and a calculation:
|
|
72
|
+
|
|
73
|
+
```ts
|
|
74
|
+
const amounts: number[] = [12, 8, 5]
|
|
75
|
+
function total() {
|
|
76
|
+
return amounts.reduce((sum, value) => sum + value, 0)
|
|
77
|
+
}
|
|
78
|
+
return total() // 25
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
In the next call, revise the data and reuse the function:
|
|
82
|
+
|
|
83
|
+
```ts
|
|
84
|
+
const amounts = amounts.filter(value => value >= 8)
|
|
85
|
+
return total() // 20
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
There is no need to redefine `total` or invent another variable name to avoid a redeclaration error. `total()` reads the updated `amounts`.
|
|
89
|
+
|
|
90
|
+
The default **stateful semantics** (`bindingUpdates: 'stateful'`) extend JavaScript/TypeScript binding rules for continued revision:
|
|
91
|
+
|
|
92
|
+
- Variables, functions, classes, and import bindings in the same scope can be updated, including bindings declared with `const`. Same-name revisions also work within a single cell.
|
|
93
|
+
- Existing closures read updated bindings; a previously saved function value remains the original function.
|
|
94
|
+
- Blocks, functions, and loop iterations retain their separate scopes.
|
|
95
|
+
- Failed initialization does not permanently reserve a name that was never successfully established. Other changes made before the failure are not rolled back.
|
|
96
|
+
|
|
97
|
+
Cells support TypeScript, top-level `await` / `return`, and static `import` / `export`. To detect name overwrites instead, disable **Allow redeclarations and overrides** to select the `protected` policy. Protected runtime names such as `tools` remain unavailable for overwriting.
|
|
98
|
+
|
|
99
|
+
<details>
|
|
100
|
+
<summary>When static imports and local overrides take effect</summary>
|
|
101
|
+
|
|
102
|
+
Static imports take effect **before the entire cell body executes**. Assignments and ordinary declarations in the body can then override them. A static import in a later cell restores the binding's live module source. Writing an import below an ordinary declaration in the same cell does not restore it at that textual position. To retrieve the current exported value at a particular step, assign it explicitly:
|
|
69
103
|
|
|
70
|
-
|
|
104
|
+
```ts
|
|
105
|
+
join = (await import('node:path')).join
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
This captures the function value at that moment; a static import follows its module source. See the [runtime reference](docs/runtime-reference.md#cell-semantics) for more language rules.
|
|
109
|
+
|
|
110
|
+
</details>
|
|
111
|
+
|
|
112
|
+
`run_code`, edited code, and the global binding workbench follow the same language policy; the workbench's temporary state is separate from the model's session. Explicit `eval`, `Function`, `node:vm`, and independent runtimes retain their corresponding native boundaries. See the [language reference](docs/runtime-reference.md#cell-semantics) for scope, module interoperability, and historical session rules.
|
|
113
|
+
|
|
114
|
+
## Code editing and call tolerance
|
|
115
|
+
|
|
116
|
+
### Send only the change
|
|
117
|
+
|
|
118
|
+
The model can use `edit_run_code` to change the most recent editable cell in the current model turn without resending its complete source. If the second cell above has just completed and the same turn is still running, its filter can be changed to `value >= 10`:
|
|
119
|
+
|
|
120
|
+
```js
|
|
121
|
+
edit_run_code({
|
|
122
|
+
edits: [{ old_string: 'value >= 8', new_string: 'value >= 10' }]
|
|
123
|
+
})
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
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.
|
|
71
127
|
|
|
72
|
-
|
|
128
|
+
### Recover from identifiable call problems
|
|
73
129
|
|
|
74
|
-
|
|
130
|
+
| Situation | PTC Plus behavior |
|
|
131
|
+
| --- | --- |
|
|
132
|
+
| `run_code` omits its outer `description` | Supply a display summary so code with otherwise valid arguments can execute |
|
|
133
|
+
| The model calls a native tool outside the PTC direct-tool list | Convert it to the corresponding `run_code` when current tool definitions uniquely identify the target and validate the arguments |
|
|
134
|
+
| 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 |
|
|
75
135
|
|
|
76
|
-
The
|
|
136
|
+
The first two behaviors default to on and can be disabled in settings. Syntax suggestions do not execute automatically or establish that the code matches the task's intent.
|
|
137
|
+
|
|
138
|
+
## Project files and tool capabilities
|
|
139
|
+
|
|
140
|
+
### Start from the session project directory
|
|
141
|
+
|
|
142
|
+
The model can use Node.js directly to read files, process data, and run programs. Relative file paths and imports in session code resolve from the recorded session project directory. Child processes use that directory when `cwd` is omitted; an explicit directory still takes precedence.
|
|
143
|
+
|
|
144
|
+
For example, in a project containing `package.json`, the first call reads its dependencies:
|
|
77
145
|
|
|
78
146
|
```ts
|
|
79
147
|
import { readFile } from 'node:fs/promises'
|
|
@@ -82,79 +150,101 @@ const deps = Object.keys(manifest.dependencies ?? {})
|
|
|
82
150
|
return deps.length
|
|
83
151
|
```
|
|
84
152
|
|
|
85
|
-
The next call
|
|
153
|
+
The next call works directly with the loaded data:
|
|
86
154
|
|
|
87
155
|
```ts
|
|
88
156
|
return deps.map(dep => dep + '@' + manifest.dependencies[dep])
|
|
89
157
|
```
|
|
90
158
|
|
|
91
|
-
|
|
159
|
+
This does not reread the file: it uses `manifest` already in the session. Direct file, network, and other external inputs can remain usable in the live environment without being guaranteed recoverable after a restart.
|
|
92
160
|
|
|
93
|
-
###
|
|
161
|
+
### Discover tools as needed
|
|
94
162
|
|
|
95
|
-
The model can
|
|
163
|
+
The model can still use DSH's current native tools through `tools.*`. To discover available capabilities, `capabilities.tree()` lists the catalog, `find()` searches names and descriptions, and `inspect()` provides parameter information for selected interfaces:
|
|
96
164
|
|
|
97
165
|
```ts
|
|
98
|
-
|
|
166
|
+
const matches = await capabilities.find('read')
|
|
167
|
+
return capabilities.inspect({
|
|
168
|
+
symbols: matches.slice(0, 4).map(item => item.symbol),
|
|
169
|
+
budget: 4,
|
|
170
|
+
})
|
|
99
171
|
```
|
|
100
172
|
|
|
101
|
-
|
|
173
|
+
Search uses lexical matching, so short keywords such as `read` or `session` work best. A miss does not prove that a tool is unavailable. Discovery grants no additional authority; DSH still validates and schedules calls. See [capability discovery](docs/runtime-reference.md#capability-discovery).
|
|
102
174
|
|
|
103
|
-
|
|
175
|
+
## Global bindings: reuse functions across sessions
|
|
104
176
|
|
|
105
|
-
|
|
177
|
+
Session variables serve the current task. **Global bindings** save common TypeScript functions for multiple sessions to load. For example, after saving a binding named `textTools`, the model can call `textTools.clean(text)`.
|
|
106
178
|
|
|
107
|
-
|
|
179
|
+
Global bindings and the sparkle shortcut default to on. Create entries manually, import `.ts` files, or ask the model to write and revise them:
|
|
108
180
|
|
|
109
181
|
```text
|
|
110
182
|
/binding new Create textTools to trim outer whitespace while preserving interior spaces
|
|
111
183
|
/binding edit <id> Add line-by-line trimming
|
|
112
184
|
```
|
|
113
185
|
|
|
114
|
-
|
|
186
|
+
`<id>` is the entry's identifier in the workbench. You can also select the binding to revise from the sparkle menu.
|
|
187
|
+
|
|
188
|
+
### Author, review, and enable
|
|
189
|
+
|
|
190
|
+
The model can test with in-memory examples before submitting a draft. The draft appears above the composer, where you 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.
|
|
115
191
|
|
|
116
|
-
The
|
|
192
|
+
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.
|
|
117
193
|
|
|
118
|
-
|
|
194
|
+
### Interface guidance and independent trial runs
|
|
119
195
|
|
|
120
|
-
|
|
196
|
+
Each entry can derive its public interface from source and include purpose, input constraints, or examples. Editing only its instructions does not reset its loaded runtime state. Assignment or redeclaration in a session overrides only the corresponding name and does not rewrite the saved global entry.
|
|
121
197
|
|
|
122
|
-
|
|
198
|
+
The workbench can run unsaved source and retain temporary variables across executions. Its computation state is separate from the model's session, making it useful for manual function checks; file and network operations still have real effects. Entries can be managed without an active PTC session. See the [global binding guide](docs/user-bindings.en.md) for source format, interface generation, storage, and the full workflow.
|
|
123
199
|
|
|
124
|
-
|
|
200
|
+
## Interface and settings
|
|
125
201
|
|
|
126
|
-
|
|
127
|
-
- **REPL syntax**: `bindingUpdates` defaults to `stateful`, allowing cross-cell updates of variables, functions, classes, and import aliases, and letting a repeated declaration in one logical scope of one cell update the same identity; choose `protected` to keep name protection. `tools` and the injected error classes can be neither redeclared nor written: a declaration collision reports `PTC-N001`, and a failed assignment names the affected binding. Existing configurations that still contain five separate switches appear as pending migration, and the settings page lets you choose either unified policy directly. Module syntax is enabled by default.
|
|
128
|
-
- **Module interoperability**: PTC-managed namespaces support live reads and local overrides, including when passed to external functions. External code independently importing a compiled module through native APIs does not receive the same namespace or writable-export guarantee. See the [runtime reference](docs/runtime-reference.md#cell-semantics).
|
|
129
|
-
- **State and recovery**: control restart recovery and contextual error tips.
|
|
130
|
-
- **Tool extensions**: enable global bindings or official Cordis tools for advanced use.
|
|
131
|
-
- **Interface display**: control enhanced tool cards, the REPL tab, and the binding authoring shortcut.
|
|
132
|
-
- **Resource limits**: adjust execution time, memory, and output limits.
|
|
202
|
+
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.
|
|
133
203
|
|
|
134
|
-
|
|
204
|
+

|
|
135
205
|
|
|
136
|
-
|
|
206
|
+
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:
|
|
207
|
+
|
|
208
|
+
| Group | What you can adjust |
|
|
209
|
+
| --- | --- |
|
|
210
|
+
| Plugin switch | Enable or disable PTC Plus |
|
|
211
|
+
| Tool call tolerance | Missing call summaries and identifiable misplaced native-tool calls |
|
|
212
|
+
| REPL syntax | Allow same-name revisions or choose name protection |
|
|
213
|
+
| State and recovery | Restart recovery, contextual tips, and their frequency |
|
|
214
|
+
| Tool extensions | Global bindings and their management entry, official Cordis tool integration |
|
|
215
|
+
| Interface display | Enhanced tool cards, the REPL tab, and the sparkle shortcut |
|
|
216
|
+
| Resource limits | Execution time, memory, and output budgets |
|
|
217
|
+
|
|
218
|
+
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.
|
|
219
|
+
|
|
220
|
+
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.
|
|
137
221
|
|
|
138
222
|

|
|
139
223
|
|
|
140
|
-
|
|
224
|
+
## Value transfer and state recovery
|
|
225
|
+
|
|
226
|
+
### Preserve values beyond plain JSON
|
|
227
|
+
|
|
228
|
+
Within the supported value domain, tool arguments, results, and recovery records preserve `undefined`, BigInt, `NaN`, infinities, sparse arrays, cycles, and shared references. Ordinary JSON results remain structured values; special values are displayed as readable text to the model, separately from their program values.
|
|
141
229
|
|
|
142
|
-
|
|
230
|
+
This does not make every JavaScript object transferable or persistent: functions, Promises, class instances, Date, Map, and Set are outside the value-transfer domain. Keeping a function in the REPL for later calls is different from returning that function as a tool result. Reuse session variables for continued computation; see the [value-transfer specification](docs/value-wire.md) for the complete supported domain.
|
|
143
231
|
|
|
144
|
-
|
|
232
|
+
### Recover state with verifiable history
|
|
145
233
|
|
|
146
|
-
|
|
234
|
+
Session state is not permanent memory. After a restart, runtime reset, or context compaction, only state verifiable from session records whose provenance remains in the model's context can be retained. Direct file or network inputs, damaged history, and compacted source provenance can reduce what remains available.
|
|
147
235
|
|
|
148
|
-
|
|
236
|
+
Unverifiable state is discarded with a diagnostic; if necessary, the current computation continues in an empty environment. Recovery neither redispatches recorded native-tool calls nor reverses historical external effects. See the [runtime reference](docs/runtime-reference.md) for recovery evidence and limits.
|
|
149
237
|
|
|
150
|
-
|
|
238
|
+
## Boundaries
|
|
151
239
|
|
|
152
|
-
|
|
240
|
+
- **Execution permissions**: primarily designed for `danger-full-access`. Code can access Node.js and the operating system directly; the plugin adds no security sandbox. DSH continues to own native-tool permissions, approvals, cancellation, and sandbox policy.
|
|
241
|
+
- **Failures and reruns**: a failed execution does not mean earlier statements had no effect. Process isolation, editing, and recovery do not guarantee that external operations are safe to repeat. Timeouts or output overflow can also release the computation environment.
|
|
242
|
+
- **Errors and cost**: language adaptation and call tolerance do not guarantee that every program succeeds. Actual call counts and token usage depend on the task and model; see the [evaluation notes](docs/evaluation.md#recorded-paired-observation) for a recorded comparison and its limitations.
|
|
153
243
|
|
|
154
|
-
|
|
244
|
+
PTC Plus is a community plugin, with no affiliation with or endorsement from DeepSeek or DSH.
|
|
155
245
|
|
|
156
|
-
##
|
|
246
|
+
## Further reading
|
|
157
247
|
|
|
158
|
-
[
|
|
248
|
+
[Installation and upgrades](docs/installation.md) · [Global bindings](docs/user-bindings.en.md) · [Runtime reference](docs/runtime-reference.md) · [Architecture and development](docs/architecture.md) · [Verification](docs/verification.md) · [All documentation](docs/README.md)
|
|
159
249
|
|
|
160
|
-
[MIT License](LICENSE)
|
|
250
|
+
[MIT License](LICENSE)
|