dsh-ptc-plus 0.4.10 → 0.5.0
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 +60 -130
- package/README.md +60 -130
- package/assets/dsh-ptc-plus-banner-en.webp +0 -0
- package/assets/dsh-ptc-plus-banner-zh.webp +0 -0
- package/assets/ptc-plus-repl-workspace-en.png +0 -0
- package/assets/ptc-plus-repl-workspace-zh.png +0 -0
- package/assets/ptc-plus-settings-en.png +0 -0
- package/assets/ptc-plus-settings-zh.png +0 -0
- package/client.cjs +42336 -0
- package/cordis.patch.yml +1 -0
- package/docs/README.md +6 -2
- package/docs/adr/0005-temporary-rejected-cell-edit-transport.md +31 -198
- package/docs/adr/0008-define-agent-operating-contract.md +5 -1
- package/docs/adr/0009-bound-expensive-acceptance-default.md +2 -2
- package/docs/adr/0016-archive-resolved-review-findings.md +1 -1
- package/docs/adr/0017-track-the-latest-dsh-public-surface.md +2 -2
- package/docs/adr/0019-plugin-settings-and-kill-switch.md +1 -1
- package/docs/adr/0020-optional-cordis-tools-in-ptc-mode.md +1 -1
- package/docs/adr/0022-stage-npm-releases-with-oidc.md +4 -2
- package/docs/adr/0023-global-user-bindings.md +2 -0
- package/docs/adr/0026-persist-the-delivery-verdict-against-the-verified-candidate.md +2 -0
- package/docs/adr/0028-attach-to-the-host-ptc-execution-seam.md +25 -23
- package/docs/adr/0031-close-semantic-obligations-by-owner.md +1 -1
- package/docs/adr/0034-keep-program-values-separate-from-output-projections.md +29 -0
- package/docs/adr/0035-run-coverage-only-before-a-new-release.md +27 -0
- package/docs/adr/0036-separate-focused-development-from-delivery-verification.md +29 -0
- package/docs/adr/0037-keep-tool-hover-previews-passive.md +52 -0
- package/docs/adr/0038-freeze-session-capability-plans.md +71 -0
- package/docs/adr/0039-verify-documentation-without-runtime-suites.md +29 -0
- package/docs/adr/0040-separate-capability-configurations-from-session-observations.md +39 -0
- package/docs/adr/0041-record-cell-execution-directories.md +65 -0
- package/docs/adr/0042-persist-provider-availability-and-handback.md +41 -0
- package/docs/adr/0043-compose-capability-and-context-policies.md +37 -0
- package/docs/adr/README.md +6 -0
- package/docs/architecture.md +23 -25
- package/docs/capability-planning-components.md +93 -0
- package/docs/capability-projection.md +7 -0
- package/docs/client-ui.md +70 -23
- package/docs/client-visual-contract.md +26 -9
- package/docs/context-management.md +22 -0
- package/docs/context-optimization-plan.md +353 -0
- package/docs/context-public-interface-coverage.md +25 -0
- package/docs/durability-design.md +20 -15
- package/docs/evaluation.md +41 -6
- package/docs/evaluations/command-goat-deepseek-v4.1-flash-20261006.md +126 -0
- package/docs/evaluations/command-goat-deepseek-v4.1-flash.md +281 -0
- package/docs/installation.md +31 -10
- package/docs/program-data-plane.md +5 -3
- package/docs/publishing.md +5 -5
- package/docs/release-coverage.md +73 -0
- package/docs/release-notes.md +1 -1
- package/docs/review-procedure.md +56 -0
- package/docs/runtime-reference.md +48 -16
- package/docs/semantic-validation.md +14 -2
- package/docs/stateful-binding-updates-proposal.md +2 -2
- package/docs/user-bindings.md +1 -1
- package/docs/value-wire.md +11 -1
- package/docs/verification-optimization-work.md +26 -15
- package/docs/verification.md +30 -88
- package/index.js +123 -20
- package/internal/binding-toggle-receipt.js +24 -0
- package/internal/capability-command-receipt.js +29 -0
- package/internal/capability-environment.js +1247 -0
- package/internal/capability-plan.js +285 -0
- package/internal/capability-policy.js +96 -0
- package/internal/capability-statistics-store.js +180 -0
- package/internal/capability-statistics.js +210 -0
- package/internal/config-spec.js +79 -9
- package/internal/direct-surface-owner.js +27 -29
- package/internal/dynamic-environment-runtime.js +9 -9
- package/internal/edit-transport-owner.js +180 -139
- package/internal/execution-provider-owner.js +15 -12
- package/internal/execution-seam-compat.js +8 -8
- package/internal/kernel-worker.js +104 -32
- package/internal/native-root-dynamic.js +12 -13
- package/internal/program-bindings.js +190 -0
- package/internal/recovery-tips.js +3 -2
- package/internal/rejected-cell-editor.js +8 -8
- package/internal/repl-observation-interest.js +11 -3
- package/internal/rpc-contract.js +1 -0
- package/internal/runtime-bridge-owner.js +272 -34
- package/internal/runtime-config.js +58 -0
- package/internal/runtime-contexts.js +74 -5
- package/internal/runtime-intrinsics.js +1 -0
- package/internal/runtime-messages.js +41 -0
- package/internal/sdk-projection.js +10 -82
- package/internal/session-cell-executor.js +42 -19
- package/internal/session-events.js +34 -0
- package/internal/session-journal-recovery.js +234 -11
- package/internal/session-journal-schema.js +6 -3
- package/internal/session-journal.js +31 -2
- package/internal/session-log-view.js +1 -1
- package/internal/session-runtime.js +119 -15
- package/internal/settings-compat.js +12 -5
- package/internal/stateful-module-compiler.js +3 -2
- package/internal/stateful-module-runtime.js +7 -3
- package/internal/stateful-root-runtime.js +9 -4
- package/internal/user-binding-authoring.js +2 -7
- package/internal/user-bindings-owner.js +41 -2
- package/internal/validated-parse-repair.js +1 -1
- package/internal/value-wire.js +68 -21
- package/internal/worker-cwd-virtualization.js +20 -18
- package/internal/worker-realm-surfaces.js +3 -3
- package/package.json +47 -29
- package/src/client-authoring-view.js +67 -30
- package/src/client-binding-review.js +2 -1
- package/src/client-binding-toggle.js +18 -0
- package/src/client-capabilities-view.js +1341 -0
- package/src/client-capability-sort.js +29 -0
- package/src/client-copy.js +871 -8
- package/src/client-feature-gates.js +3 -0
- package/src/client-indicator-view.js +4 -6
- package/src/client-primitives.js +33 -2
- package/src/client-repl-view.js +20 -13
- package/src/client-settings-view.js +411 -41
- package/src/client-styles.js +108 -15
- package/src/client-tool-hover.js +185 -0
- package/src/client-tool-view.js +37 -8
- package/src/client-transport.js +44 -9
- package/src/client-workbench.js +6 -7
- package/src/client.js +76 -22
- package/client.js +0 -32479
package/README.en.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<p align="center">
|
|
2
|
-
<img src="assets/dsh-ptc-plus-banner-en.webp" width="100%" alt="PTC Plus:
|
|
2
|
+
<img src="assets/dsh-ptc-plus-banner-v2-en.webp" width="100%" alt="PTC Plus: Tweak it, keep computing!">
|
|
3
3
|
</p>
|
|
4
4
|
|
|
5
5
|
<p align="center">
|
|
@@ -25,29 +25,23 @@ PTC Plus provides a stateful TypeScript computation environment for DSH's **PTC
|
|
|
25
25
|
- **Avoid routine call failures**: use familiar module syntax, recover from identifiable call omissions, and receive correction suggestions for verifiable syntax errors.
|
|
26
26
|
- **Reuse common capabilities**: save functions as global bindings, provide their interfaces and usage notes to the model, and use them across sessions.
|
|
27
27
|
|
|
28
|
-
[Quick start](#quick-start) · [Feature overview](#feature-overview) · [Continuous computation](#continuous-computation-and-language-extensions) · [Editing and
|
|
28
|
+
[Quick start](#quick-start) · [Feature overview](#feature-overview) · [Continuous computation](#continuous-computation-and-language-extensions) · [Editing and 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) · [Development](#development)
|
|
29
29
|
|
|
30
30
|
## Quick start
|
|
31
31
|
|
|
32
|
-
Requires Node.js `^22.19.0 || >=24.0.0` and the latest available official DSH release
|
|
32
|
+
Requires Node.js `^22.19.0 || >=24.0.0` and the latest available official DSH release:
|
|
33
33
|
|
|
34
34
|
```sh
|
|
35
35
|
dsh plugin --profile <profile> add dsh-ptc-plus
|
|
36
36
|
```
|
|
37
37
|
|
|
38
|
-
Replace `<profile>` with your profile name
|
|
38
|
+
Replace `<profile>` with your profile name, restart DSH, and select **PTC mode** in the session. Continuous computation, call tolerance, and global bindings are on by default. To upgrade, run `dsh plugin --profile <profile> add dsh-ptc-plus@latest` and restart that Host; see the [installation guide](docs/installation.md) for other installation methods, Desktop, the local development launcher, and troubleshooting.
|
|
39
39
|
|
|
40
|
-
|
|
41
|
-
|
|
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.
|
|
43
|
-
|
|
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.
|
|
45
|
-
|
|
46
|
-
For Windows source testing, double-click `scripts\run-upstream-dsh.cmd` to fetch the official DSH default branch, reuse an isolated build cache, and load this plugin checkout. The first run installs dependencies and builds DSH; see [upstream source testing](docs/installation.md#upstream-source-development-launcher-windows).
|
|
40
|
+
The session shows a **REPL** tab, and wide screens show a **PTC Plus** header indicator. The sparkle button beside the composer opens the global binding menu, the session capability workbench, and **PTC Plus settings**; **Plugins → Installed → dsh-ptc-plus → Configure** in the sidebar is the same configuration.
|
|
47
41
|
|
|
48
42
|
## Feature overview
|
|
49
43
|
|
|
50
|
-
Default PTC mode starts every execution in a fresh environment:
|
|
44
|
+
Default PTC mode starts every execution in a fresh environment: the previous call's variables 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 those gaps.
|
|
51
45
|
|
|
52
46
|
| Scenario | Default PTC mode | With PTC Plus |
|
|
53
47
|
| --- | --- | --- |
|
|
@@ -56,24 +50,20 @@ Default PTC mode starts every execution in a fresh environment: variables from t
|
|
|
56
50
|
| 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 |
|
|
57
51
|
| 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 |
|
|
58
52
|
| Omit a call summary | Missing `run_code.description` fails validation | Supply a display summary automatically so otherwise valid code proceeds |
|
|
59
|
-
| Provider rejects malformed tool JSON | The whole turn ends with a provider error |
|
|
53
|
+
| Provider rejects malformed tool JSON | The whole turn ends with a provider error | A repairable call tail continues; anything else becomes a schema rejection result so the model can continue |
|
|
60
54
|
| 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 |
|
|
61
55
|
| 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 |
|
|
62
|
-
| Work with the current
|
|
63
|
-
| Find tools and parameters | Read through the tool interfaces already supplied to the model |
|
|
56
|
+
| Work with the current directory | Execute in the directory resolved by the Host for the current call | Relative file operations and default child processes use the session's current directory when they run, and an in-cell `tools.working_directory({ cd })` applies to the rest of that cell; module imports keep the starting directory, and existing modules and import closures retain their source base |
|
|
57
|
+
| Find tools and parameters | Read through the tool interfaces already supplied to the model | Retrieve matching interfaces in one byte-budgeted `capabilities.search` response, or list and inspect members |
|
|
64
58
|
| 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 |
|
|
65
|
-
| Inspect computation state | No reusable session variables remain after a call | View retained names, source definitions, reuse counts, and
|
|
59
|
+
| Inspect computation state | No reusable session variables remain after a call | View retained names, source definitions, reuse counts, and value previews in the REPL tab |
|
|
66
60
|
| 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 |
|
|
67
61
|
| 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 |
|
|
68
62
|
| 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 |
|
|
69
63
|
|
|
70
|
-
The following sections explain usage and limits. See the [runtime reference](docs/runtime-reference.md) for complete language rules, configuration fields, and diagnostics.
|
|
71
|
-
|
|
72
64
|
## Continuous computation and language extensions
|
|
73
65
|
|
|
74
|
-
The model executes the
|
|
75
|
-
|
|
76
|
-
First, define the data and a calculation:
|
|
66
|
+
The model executes the code below through `run_code`, and each call's code is a **cell**.
|
|
77
67
|
|
|
78
68
|
```ts
|
|
79
69
|
const amounts: number[] = [12, 8, 5]
|
|
@@ -83,56 +73,35 @@ function total() {
|
|
|
83
73
|
return total() // 25
|
|
84
74
|
```
|
|
85
75
|
|
|
86
|
-
|
|
76
|
+
The next call revises the data without redefining `total`:
|
|
87
77
|
|
|
88
78
|
```ts
|
|
89
79
|
const amounts = amounts.filter(value => value >= 8)
|
|
90
80
|
return total() // 20
|
|
91
81
|
```
|
|
92
82
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
The default **stateful semantics** (`bindingUpdates: 'stateful'`) extend JavaScript/TypeScript binding rules for continued revision:
|
|
83
|
+
The default **stateful semantics** (`bindingUpdates: 'stateful'`) extend JavaScript/TypeScript binding rules for that continued revision:
|
|
96
84
|
|
|
97
|
-
- Variables, functions, classes, and import bindings in the same scope can be updated, including
|
|
98
|
-
- Existing closures read updated
|
|
99
|
-
-
|
|
100
|
-
- Failed initialization does not permanently reserve a name that was never successfully established. Other changes made before the failure are not rolled back.
|
|
101
|
-
|
|
102
|
-
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.
|
|
103
|
-
|
|
104
|
-
<details>
|
|
105
|
-
<summary>When static imports and local overrides take effect</summary>
|
|
106
|
-
|
|
107
|
-
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:
|
|
108
|
-
|
|
109
|
-
```ts
|
|
110
|
-
join = (await import('node:path')).join
|
|
111
|
-
```
|
|
85
|
+
- Variables, functions, classes, and import bindings in the same scope can be updated, including those declared with `const`, and same-name revisions also work inside one cell.
|
|
86
|
+
- Existing closures read the updated binding, a function value saved earlier is still the original function, and blocks, functions, and loop iterations keep their separate scopes.
|
|
87
|
+
- A failed initialization does not permanently reserve that name, and changes made before the failure are not rolled back.
|
|
112
88
|
|
|
113
|
-
|
|
89
|
+
Cells support TypeScript (including runtime `enum` and namespaces), top-level `await` / `return`, and static `import` / `export`; a static import takes effect before the whole cell body executes, and an assignment later in the body can override it. To detect name overwrites instead, disable **Allow redeclarations and overrides** and use the `protected` policy; protected runtime names such as `tools` can never be overwritten.
|
|
114
90
|
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
`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.
|
|
91
|
+
`run_code`, edited code, and the global binding workbench follow the same language policy, while explicit `eval`, `Function`, `node:vm`, and independent runtimes keep their own native boundaries. Scope, module interoperability, and historical session rules are in the [language reference](docs/runtime-reference.md#cell-semantics), and complete language rules, configuration fields, and diagnostics are in the [runtime reference](docs/runtime-reference.md).
|
|
118
92
|
|
|
119
93
|
## Code editing and call tolerance
|
|
120
94
|
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
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`:
|
|
95
|
+
The model can call `tools.edit_run_code` inside a new `run_code` cell to change the most recent editable cell of the current turn without resending its source:
|
|
124
96
|
|
|
125
97
|
```js
|
|
126
|
-
edit_run_code({
|
|
98
|
+
const receipt = await tools.edit_run_code({
|
|
127
99
|
edits: [{ old_string: 'value >= 8', new_string: 'value >= 10' }]
|
|
128
100
|
})
|
|
101
|
+
return receipt
|
|
129
102
|
```
|
|
130
103
|
|
|
131
|
-
An edit
|
|
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
|
-
|
|
135
|
-
### Recover from identifiable call problems
|
|
104
|
+
An `accepted: true, scheduled: true` receipt means the edit is scheduled: the entire target cell reruns after the outer cell finishes, and the next cell reads the revised value (`12` above). Reads later in the accepting cell still see the old state, earlier state changes are not rolled back, and a rerun of code that wrote files or called external services still needs to account for duplicate effects. Each regular-expression edit requires `pattern`, `flags`, `replacement`, and `expected_matches`; pass `""` explicitly when no flags are needed.
|
|
136
105
|
|
|
137
106
|
| Situation | PTC Plus behavior |
|
|
138
107
|
| --- | --- |
|
|
@@ -141,122 +110,83 @@ Republishing a historical result as a compacted display entry is not another exe
|
|
|
141
110
|
| 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 |
|
|
142
111
|
| 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 |
|
|
143
112
|
|
|
144
|
-
The first two behaviors
|
|
113
|
+
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.
|
|
145
114
|
|
|
146
115
|
## Project files and tool capabilities
|
|
147
116
|
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
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.
|
|
117
|
+
The model can use Node.js directly to read files, process data, and run programs. Relative paths and child processes without an explicit `cwd` use the session's current directory when they run, so an in-cell `tools.working_directory({ cd })` applies to the rest of that cell and matches the Host tools. Module imports and `import.meta` keep the starting directory; loaded modules, escaped import closures, and captured `require` keep their original base, and `process.chdir` is unavailable inside a cell. File, network, and other external inputs stay usable in the live environment, but a restart is not guaranteed to recover them.
|
|
151
118
|
|
|
152
|
-
|
|
119
|
+
`capabilities.search()` finds and returns complete interfaces in one call, budgeted in bytes, with oversized entries kept complete and given an individual retrieval reference; `tree()`, `find()`, and `inspect()` remain available.
|
|
153
120
|
|
|
154
121
|
```ts
|
|
155
|
-
|
|
156
|
-
const manifest = JSON.parse(await readFile('package.json', 'utf8'))
|
|
157
|
-
const deps = Object.keys(manifest.dependencies ?? {})
|
|
158
|
-
return deps.length
|
|
122
|
+
return capabilities.search({ query: 'read file content', budgetBytes: 8192 })
|
|
159
123
|
```
|
|
160
124
|
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
```ts
|
|
164
|
-
return deps.map(dep => dep + '@' + manifest.dependencies[dep])
|
|
165
|
-
```
|
|
166
|
-
|
|
167
|
-
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.
|
|
168
|
-
|
|
169
|
-
### Discover tools as needed
|
|
170
|
-
|
|
171
|
-
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:
|
|
172
|
-
|
|
173
|
-
```ts
|
|
174
|
-
const matches = await capabilities.find('read')
|
|
175
|
-
return capabilities.inspect({
|
|
176
|
-
symbols: matches.slice(0, 4).map(item => item.symbol),
|
|
177
|
-
budget: 4,
|
|
178
|
-
})
|
|
179
|
-
```
|
|
180
|
-
|
|
181
|
-
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).
|
|
125
|
+
Search uses English/Chinese lexical matching, and a miss does not prove that a tool is unavailable. Discovery grants no additional authority, DSH still validates and schedules calls, and more usage notes are in [capability discovery](docs/runtime-reference.md#capability-discovery).
|
|
182
126
|
|
|
183
127
|
## Global bindings: reuse functions across sessions
|
|
184
128
|
|
|
185
|
-
Session variables serve the current task
|
|
186
|
-
|
|
187
|
-
Global bindings and the sparkle shortcut default to on. Create entries manually, import `.ts` files, or ask the model to write and revise them:
|
|
129
|
+
Session variables serve the current task, and **global bindings** save common TypeScript functions for multiple sessions to load: after saving `textTools`, the model can call `textTools.clean(text)`. Create entries by hand, import `.ts` files, or ask the model:
|
|
188
130
|
|
|
189
131
|
```text
|
|
190
132
|
/binding new Create textTools to trim outer whitespace while preserving interior spaces
|
|
191
133
|
/binding edit <id> Add line-by-line trimming
|
|
192
134
|
```
|
|
193
135
|
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
### Author, review, and enable
|
|
197
|
-
|
|
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.
|
|
199
|
-
|
|
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.
|
|
201
|
-
|
|
202
|
-
### Interface guidance and independent trial runs
|
|
203
|
-
|
|
204
|
-
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.
|
|
136
|
+
The draft the model submits floats above the composer, and in the large dialog you read the complete source, interface, and model instructions before choosing **Save and enable**, **Save disabled**, or **Discard draft**; submitting a draft neither saves nor enables it. Enabled entries' interfaces and usage notes go to the model in new sessions, and a change made during a session takes effect on its next allowed request.
|
|
205
137
|
|
|
206
|
-
The workbench
|
|
138
|
+
The workbench runs unsaved source and keeps temporary variables between executions; its computation state is separate from the model's session, file and network operations still have real effects, and 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.
|
|
207
139
|
|
|
208
140
|
## Interface and settings
|
|
209
141
|
|
|
210
|
-
The **REPL tab**
|
|
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.
|
|
142
|
+
The **REPL tab** lists the names kept in the session with their definitions, reuse counts, and value previews, and opens the global binding workbench. Hovering a collapsed execution card for 400 ms, or focusing it with the keyboard, shows an excerpt of its recorded source, result, and feature notices, and click, Enter/Space, or tap expands the full content and copies the code; “Preview execution content on hover” under Interface display turns this off.
|
|
213
143
|
|
|
214
144
|

|
|
215
145
|
|
|
216
|
-
The
|
|
146
|
+
The settings window and the sidebar plugin configuration page are the same configuration, grouped like this:
|
|
217
147
|
|
|
218
|
-
| Group | What you can adjust |
|
|
219
|
-
| --- | --- |
|
|
220
|
-
| Plugin switch | Enable or disable PTC Plus |
|
|
221
|
-
|
|
|
222
|
-
|
|
|
223
|
-
|
|
|
224
|
-
|
|
|
225
|
-
| Interface display | Enhanced tool cards, the REPL tab, and the sparkle shortcut |
|
|
226
|
-
| Resource limits | Execution time, memory, and output budgets |
|
|
148
|
+
| Functional module | Group | What you can adjust |
|
|
149
|
+
| --- | --- | --- |
|
|
150
|
+
| Plugin switch | PTC Plus title switch | Enable or disable PTC Plus |
|
|
151
|
+
| Core workspace | REPL syntax | Allow same-name revisions or choose name protection |
|
|
152
|
+
| Core workspace | State and recovery | Restart recovery, contextual tips, and their frequency |
|
|
153
|
+
| Extensions and tolerance | Tool extensions | Global bindings and their management entry, official Cordis tool integration |
|
|
154
|
+
| Extensions and tolerance | Tool call tolerance | Missing call summaries and identifiable misplaced native-tool calls |
|
|
155
|
+
| Interface and resources | Interface display | Enhanced tool cards, the REPL tab, and the sparkle shortcut |
|
|
156
|
+
| Interface and resources | Resource limits | Execution time, memory, and output budgets |
|
|
157
|
+
| Experimental | Capabilities and context | Experimental capability management (off by default), independent statistics, common baseline, individual choices, and presentation budgets |
|
|
227
158
|
|
|
228
|
-
Everyday computation features default
|
|
159
|
+
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).
|
|
229
160
|
|
|
230
|
-
|
|
161
|
+
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.
|
|
231
162
|
|
|
232
|
-
The host execution provider must use TypeScript
|
|
163
|
+
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.
|
|
233
164
|
|
|
234
|
-

|
|
235
166
|
|
|
236
167
|
## Value transfer and state recovery
|
|
237
168
|
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
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.
|
|
241
|
-
|
|
242
|
-
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.
|
|
243
|
-
|
|
244
|
-
### Recover state with verifiable history
|
|
169
|
+
Within the supported range of the plugin's graph IPC, program arguments, results, and recovery records keep `undefined`, BigInt, `NaN`, infinities, sparse arrays, cycles, and shared references, and supported values can be returned directly without writing `JSON.stringify` yourself (it drops object fields containing `undefined`, turns `NaN` and infinities into `null` and `-0` into `0`, and rejects BigInt). Functions, Promises, class instances, Date, Map, and Set are outside that range, and native `tools.*` JSON argument and result contracts do not change; see the [value contract](docs/value-wire.md).
|
|
245
170
|
|
|
246
|
-
Session state is not permanent memory
|
|
247
|
-
|
|
248
|
-
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.
|
|
171
|
+
Session state is not permanent memory: after a restart, a runtime reset, or context compaction, only state verifiable from session records whose provenance remains in the model's context is retained, and everything else is discarded with a diagnostic, continuing in an empty environment when necessary. Missing or damaged session records produce an explicit error instead of being treated as a successfully recovered empty session. Recovery neither redispatches recorded native-tool calls nor reverses historical external effects; see the [runtime reference](docs/runtime-reference.md) for its evidence and limits.
|
|
249
172
|
|
|
250
173
|
## Boundaries
|
|
251
174
|
|
|
252
|
-
- **Execution permissions**: primarily designed for `danger-full-access`. Code can
|
|
253
|
-
- **Failures and reruns**: a failed execution does not mean earlier statements had no effect. Process isolation, editing, and recovery do not
|
|
254
|
-
- **Errors and cost**: language adaptation and call tolerance do not guarantee that every program
|
|
175
|
+
- **Execution permissions**: primarily designed for `danger-full-access`. Code can reach Node.js and the operating system directly, and the plugin adds no security sandbox; native-tool permissions, approvals, cancellation, and sandbox policy stay with DSH.
|
|
176
|
+
- **Failures and reruns**: a failed execution does not mean earlier statements had no effect. Process isolation, editing, and recovery do not make an external operation safe to repeat, and a timeout or an output overflow can release the computation environment.
|
|
177
|
+
- **Errors and cost**: language adaptation and call tolerance do not guarantee that every program runs, and actual call counts and token usage depend on the task and model; the [evaluation notes](docs/evaluation.md#recorded-paired-observation) record one comparison and its limits.
|
|
255
178
|
|
|
256
179
|
PTC Plus is a community plugin, with no affiliation with or endorsement from DeepSeek or DSH.
|
|
257
180
|
|
|
258
|
-
##
|
|
181
|
+
## Development
|
|
182
|
+
|
|
183
|
+
Development happens in the repository root: `npm ci` installs dependencies and `npm run build` regenerates `client.cjs` and the compiler artifacts. Focused tests require an explicit selection:
|
|
184
|
+
|
|
185
|
+
```sh
|
|
186
|
+
npm run test:backend:focus -- --file test/<owner>.test.js --test-name-pattern="<case>"
|
|
187
|
+
npm run test:client:focus -- "<test name pattern>"
|
|
188
|
+
```
|
|
259
189
|
|
|
260
|
-
[
|
|
190
|
+
Before delivery, pick the check through [change classification](docs/verification.md#change-classification): documentation-only changes run `npm run verify:docs`, everything else runs `npm run check`, and both are followed by the [review procedure](docs/review-procedure.md). Architecture and the data plane are in [architecture and development](docs/architecture.md), the [documentation index](docs/README.md) lists everything, and installation and publishing are covered by the [installation guide](docs/installation.md) and the [publishing procedure](docs/publishing.md).
|
|
261
191
|
|
|
262
192
|
[MIT License](LICENSE)
|