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/internal/value-wire.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { types } from 'node:util'
|
|
1
2
|
import { assertFields, isRecord } from './record-utils.js'
|
|
2
3
|
import { runtimeIntrinsics as internal } from './runtime-intrinsics.js'
|
|
3
4
|
import {
|
|
@@ -23,6 +24,9 @@ const intrinsicFunctionToString = Function.prototype.toString
|
|
|
23
24
|
const reflectApply = Reflect.apply
|
|
24
25
|
const bufferByteLength = internal.bufferByteLength
|
|
25
26
|
const jsonStringify = JSON.stringify
|
|
27
|
+
const { isProxy, isDate, isMap, isSet, isRegExp, isAnyArrayBuffer, isTypedArray,
|
|
28
|
+
isDataView, isNativeError, isPromise, isWeakMap, isWeakSet } = types
|
|
29
|
+
const encodingFailures = new WeakMap()
|
|
26
30
|
|
|
27
31
|
function limitsOf(options = {}) {
|
|
28
32
|
const limits = { ...DEFAULT_VALUE_LIMITS, ...options }
|
|
@@ -36,19 +40,16 @@ function limitsOf(options = {}) {
|
|
|
36
40
|
}
|
|
37
41
|
|
|
38
42
|
function hasIntrinsicConstructor(prototype, name) {
|
|
43
|
+
if (isProxy(prototype)) return false
|
|
39
44
|
const constructor = Object.getOwnPropertyDescriptor(prototype, 'constructor')?.value
|
|
40
|
-
if (typeof constructor !== 'function') return false
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
&& reflectApply(intrinsicFunctionToString, constructor, []) === `function ${name}() { [native code] }`
|
|
45
|
-
} catch {
|
|
46
|
-
return false
|
|
47
|
-
}
|
|
45
|
+
if (typeof constructor !== 'function' || isProxy(constructor)) return false
|
|
46
|
+
return Object.getOwnPropertyDescriptor(constructor, 'name')?.value === name
|
|
47
|
+
&& Object.getOwnPropertyDescriptor(constructor, 'prototype')?.value === prototype
|
|
48
|
+
&& reflectApply(intrinsicFunctionToString, constructor, []) === `function ${name}() { [native code] }`
|
|
48
49
|
}
|
|
49
50
|
|
|
50
51
|
function isIntrinsicObjectPrototype(value) {
|
|
51
|
-
return Object.getPrototypeOf(value) === null && hasIntrinsicConstructor(value, 'Object')
|
|
52
|
+
return !isProxy(value) && Object.getPrototypeOf(value) === null && hasIntrinsicConstructor(value, 'Object')
|
|
52
53
|
}
|
|
53
54
|
|
|
54
55
|
function plainObjectPrototype(value) {
|
|
@@ -66,8 +67,53 @@ function hasPlainArrayPrototype(value) {
|
|
|
66
67
|
&& isIntrinsicObjectPrototype(objectPrototype)
|
|
67
68
|
}
|
|
68
69
|
|
|
69
|
-
function invalid(path, detail) {
|
|
70
|
-
|
|
70
|
+
function invalid(path, detail, kind = 'shape', legacyDetail = detail, legacyMessage = `value at ${path} is not PTC Value V1: ${legacyDetail}`) {
|
|
71
|
+
const error = new TypeError(`value at ${path} is not PTC Value V1: ${detail}`)
|
|
72
|
+
weakMapSet(encodingFailures, error, { kind, path, detail, legacyMessage })
|
|
73
|
+
throw error
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/** Brand checks do not read constructor, toStringTag, getters, or Proxy traps. */
|
|
77
|
+
function unsupportedObject(value) {
|
|
78
|
+
if (isProxy(value)) return 'Proxy'
|
|
79
|
+
if (isDate(value)) return 'Date'
|
|
80
|
+
if (isMap(value)) return 'Map'
|
|
81
|
+
if (isSet(value)) return 'Set'
|
|
82
|
+
if (isRegExp(value)) return 'RegExp'
|
|
83
|
+
if (isAnyArrayBuffer(value)) return 'ArrayBuffer/SharedArrayBuffer'
|
|
84
|
+
if (isTypedArray(value)) return 'TypedArray/Buffer'
|
|
85
|
+
if (isDataView(value)) return 'DataView'
|
|
86
|
+
if (isNativeError(value)) return 'Error'
|
|
87
|
+
if (isPromise(value)) return 'Promise'
|
|
88
|
+
if (isWeakMap(value)) return 'WeakMap'
|
|
89
|
+
if (isWeakSet(value)) return 'WeakSet'
|
|
90
|
+
return 'unknown prototype'
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export function valueEncodingFailure(error) {
|
|
94
|
+
return weakMapGet(encodingFailures, error)
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
export function valueEncodingHelp(failure) {
|
|
98
|
+
return failure?.kind === 'budget'
|
|
99
|
+
? 'reduce the transferred graph to fit the reported value budget'
|
|
100
|
+
: 'select needed data explicitly as supported primitives, plain objects or arrays; keep unsupported live values in bindings (Date: explicit ISO text or timestamp; Map/Set: explicit entries or values); do not JSON.stringify a graph containing BigInt'
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/** Only codec-owned failures acquire boundary facts; owner exceptions remain untouched. */
|
|
104
|
+
export function encodeValueAtBoundary(value, options, boundary) {
|
|
105
|
+
try {
|
|
106
|
+
return encodeValue(value, options)
|
|
107
|
+
} catch (error) {
|
|
108
|
+
const failure = valueEncodingFailure(error)
|
|
109
|
+
if (failure === undefined) throw error
|
|
110
|
+
const fact = boundary === 'parameter'
|
|
111
|
+
? 'program binding parameter was not dispatched'
|
|
112
|
+
: 'program binding call completed, but its result could not be transferred; external effects may already have occurred; do not repeat the operation solely to obtain its result'
|
|
113
|
+
const wrapped = new TypeError(`${fact}: ${error.message}; ${valueEncodingHelp(failure)}`)
|
|
114
|
+
weakMapSet(encodingFailures, wrapped, failure)
|
|
115
|
+
throw wrapped
|
|
116
|
+
}
|
|
71
117
|
}
|
|
72
118
|
|
|
73
119
|
function stringBytes(value) {
|
|
@@ -86,7 +132,7 @@ export function encodeValue(value, options = {}) {
|
|
|
86
132
|
|
|
87
133
|
const accountText = (text, path) => {
|
|
88
134
|
textBytes += stringBytes(text)
|
|
89
|
-
if (textBytes > limits.maxStringBytes) invalid(path, `string budget exceeds ${limits.maxStringBytes} bytes
|
|
135
|
+
if (textBytes > limits.maxStringBytes) invalid(path, `string budget exceeds ${limits.maxStringBytes} bytes`, 'budget')
|
|
90
136
|
}
|
|
91
137
|
|
|
92
138
|
const atom = (current, path) => {
|
|
@@ -106,14 +152,14 @@ export function encodeValue(value, options = {}) {
|
|
|
106
152
|
if (typeof current === 'bigint') {
|
|
107
153
|
const text = toString(current)
|
|
108
154
|
const digits = text[0] === '-' ? text.length - 1 : text.length
|
|
109
|
-
if (digits > limits.maxBigIntDigits) invalid(path, `BigInt exceeds ${limits.maxBigIntDigits} digits
|
|
155
|
+
if (digits > limits.maxBigIntDigits) invalid(path, `BigInt exceeds ${limits.maxBigIntDigits} digits`, 'budget')
|
|
110
156
|
accountText(text, path)
|
|
111
157
|
return { tag: 'bigint', value: text }
|
|
112
158
|
}
|
|
113
|
-
if (typeof current !== 'object') invalid(path, typeof current)
|
|
159
|
+
if (typeof current !== 'object') invalid(path, typeof current, 'unsupported')
|
|
114
160
|
const prior = weakMapGet(seen, current)
|
|
115
161
|
if (prior !== undefined) return { tag: 'reference', index: prior }
|
|
116
|
-
if (nodes.length >= limits.maxNodes) invalid(path, `node budget exceeds ${limits.maxNodes}
|
|
162
|
+
if (nodes.length >= limits.maxNodes) invalid(path, `node budget exceeds ${limits.maxNodes}`, 'budget')
|
|
117
163
|
const index = nodes.length
|
|
118
164
|
weakMapSet(seen, current, index)
|
|
119
165
|
appendArray(nodes, undefined)
|
|
@@ -127,10 +173,10 @@ export function encodeValue(value, options = {}) {
|
|
|
127
173
|
const current = item.value
|
|
128
174
|
if (isArray(current)) {
|
|
129
175
|
if (!hasPlainArrayPrototype(current)) invalid(item.path, 'non-plain array')
|
|
130
|
-
if (current.length > limits.maxArrayLength) invalid(item.path, `array length exceeds ${limits.maxArrayLength}
|
|
176
|
+
if (current.length > limits.maxArrayLength) invalid(item.path, `array length exceeds ${limits.maxArrayLength}`, 'budget')
|
|
131
177
|
arraySlotCount += current.length
|
|
132
178
|
if (arraySlotCount > limits.maxArrayLength) {
|
|
133
|
-
invalid(item.path, `array slot budget exceeds ${limits.maxArrayLength}
|
|
179
|
+
invalid(item.path, `array slot budget exceeds ${limits.maxArrayLength}`, 'budget')
|
|
134
180
|
}
|
|
135
181
|
const entries = []
|
|
136
182
|
const keys = Reflect.ownKeys(current)
|
|
@@ -147,7 +193,7 @@ export function encodeValue(value, options = {}) {
|
|
|
147
193
|
invalid(`${item.path}[${key}]`, 'array index must be an enumerable data property')
|
|
148
194
|
}
|
|
149
195
|
edgeCount += 1
|
|
150
|
-
if (edgeCount > limits.maxEdges) invalid(item.path, `edge budget exceeds ${limits.maxEdges}
|
|
196
|
+
if (edgeCount > limits.maxEdges) invalid(item.path, `edge budget exceeds ${limits.maxEdges}`, 'budget')
|
|
151
197
|
appendArray(entries, [index, atom(descriptor.value, `${item.path}[${key}]`)])
|
|
152
198
|
}
|
|
153
199
|
nodes[item.index] = { type: 'array', length: current.length, entries }
|
|
@@ -155,7 +201,7 @@ export function encodeValue(value, options = {}) {
|
|
|
155
201
|
}
|
|
156
202
|
|
|
157
203
|
const prototype = plainObjectPrototype(current)
|
|
158
|
-
if (prototype === undefined) invalid(item.path, 'non-plain object')
|
|
204
|
+
if (prototype === undefined) invalid(item.path, `non-plain object (${unsupportedObject(current)})`, 'unsupported', 'non-plain object')
|
|
159
205
|
const entries = []
|
|
160
206
|
const keys = Reflect.ownKeys(current)
|
|
161
207
|
for (let keyIndex = 0; keyIndex < keys.length; keyIndex += 1) {
|
|
@@ -167,7 +213,7 @@ export function encodeValue(value, options = {}) {
|
|
|
167
213
|
}
|
|
168
214
|
accountText(key, `${item.path}.${key}`)
|
|
169
215
|
edgeCount += 1
|
|
170
|
-
if (edgeCount > limits.maxEdges) invalid(item.path, `edge budget exceeds ${limits.maxEdges}
|
|
216
|
+
if (edgeCount > limits.maxEdges) invalid(item.path, `edge budget exceeds ${limits.maxEdges}`, 'budget')
|
|
171
217
|
appendArray(entries, [key, atom(descriptor.value, `${item.path}.${key}`)])
|
|
172
218
|
}
|
|
173
219
|
nodes[item.index] = { type: 'object', prototype, entries }
|
|
@@ -442,7 +488,8 @@ function renderCanonicalValue(normalized, limits) {
|
|
|
442
488
|
let bytes = 0
|
|
443
489
|
const append = (text) => {
|
|
444
490
|
bytes += stringBytes(text)
|
|
445
|
-
if (bytes > limits.maxStringBytes)
|
|
491
|
+
if (bytes > limits.maxStringBytes) invalid('$', `rendered PTC value exceeds ${limits.maxStringBytes} bytes`, 'budget', undefined,
|
|
492
|
+
`rendered PTC value exceeds ${limits.maxStringBytes} bytes`)
|
|
446
493
|
appendArray(chunks, text)
|
|
447
494
|
}
|
|
448
495
|
const emitted = new Set()
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
installProjectedProcessCwd,
|
|
8
8
|
} from './worker-realm-surfaces.js'
|
|
9
9
|
|
|
10
|
-
const { Reflect: privateReflect, appendArray, bufferConcat, bufferIsBuffer, bufferToString,
|
|
10
|
+
const { Reflect: privateReflect, appendArray, bufferConcat, bufferFrom, bufferIsBuffer, bufferToString,
|
|
11
11
|
copyArray, isArray, regexpTest } = internal
|
|
12
12
|
const TRAILING_SEPARATOR = /[\\/]$/
|
|
13
13
|
|
|
@@ -108,29 +108,32 @@ export function projectChildProcessArguments(name, args, sessionCwd) {
|
|
|
108
108
|
: withDefaultOptions(2)
|
|
109
109
|
}
|
|
110
110
|
|
|
111
|
-
/** Install
|
|
112
|
-
export function installWorkerCwdVirtualization(sessionCwd, originalRequire, markVolatile) {
|
|
111
|
+
/** Install stable Node wrappers; the execution owner supplies each cell's cwd. */
|
|
112
|
+
export function installWorkerCwdVirtualization(sessionCwd, originalRequire, markVolatile, readCwd = () => sessionCwd) {
|
|
113
|
+
const nativeCwd = process.cwd
|
|
114
|
+
const currentCwd = () => readCwd() ?? privateReflect.apply(nativeCwd, process, [])
|
|
113
115
|
if (sessionCwd === undefined) {
|
|
114
|
-
const nativeCwd = process.cwd
|
|
115
116
|
assignWorkerRealmProperty(WORKER_REALM_MUTATION.STABLE, 'process.cwd', process, 'cwd', () => {
|
|
116
|
-
markVolatile('process.cwd')
|
|
117
|
-
return
|
|
117
|
+
if (readCwd() === undefined) markVolatile('process.cwd')
|
|
118
|
+
return currentCwd()
|
|
118
119
|
})
|
|
119
|
-
|
|
120
|
-
}
|
|
120
|
+
} else installProjectedProcessCwd(process, currentCwd)
|
|
121
121
|
const nativeResolve = resolve
|
|
122
|
-
const
|
|
122
|
+
const directoryPrefix = () => {
|
|
123
|
+
const cwd = currentCwd()
|
|
124
|
+
return cwd + (regexpTest(TRAILING_SEPARATOR, cwd) ? '' : sep)
|
|
125
|
+
}
|
|
123
126
|
const sessionPath = (value) => {
|
|
124
|
-
if (typeof value === 'string') return isAbsolute(value) ? value : nativeResolve(
|
|
127
|
+
if (typeof value === 'string') return isAbsolute(value) ? value : nativeResolve(currentCwd(), value)
|
|
125
128
|
if (bufferIsBuffer(value)) {
|
|
126
129
|
const absolute = isAbsolute(bufferToString(value, 'utf8', 0, 3))
|
|
127
|
-
return absolute ? value : bufferConcat([
|
|
130
|
+
return absolute ? value : bufferConcat([bufferFrom(directoryPrefix()), value])
|
|
128
131
|
}
|
|
129
132
|
return value
|
|
130
133
|
}
|
|
131
134
|
const sessionPathPrefix = (value) => {
|
|
132
135
|
if (typeof value !== 'string' || isAbsolute(value) || parse(value).root !== '') return sessionPath(value)
|
|
133
|
-
return
|
|
136
|
+
return directoryPrefix() + value
|
|
134
137
|
}
|
|
135
138
|
const projectPaths = (args, indices) => {
|
|
136
139
|
const next = copyArray(args)
|
|
@@ -148,18 +151,17 @@ export function installWorkerCwdVirtualization(sessionCwd, originalRequire, mark
|
|
|
148
151
|
const sessionGlobOptions = (args) => {
|
|
149
152
|
if (typeof args[1] === 'function') {
|
|
150
153
|
const next = copyArray(args, 0, 1)
|
|
151
|
-
appendArray(next, { cwd:
|
|
154
|
+
appendArray(next, { cwd: currentCwd() })
|
|
152
155
|
return copyArray(args, 1, args.length, next)
|
|
153
156
|
}
|
|
154
157
|
const next = copyArray(args)
|
|
155
|
-
if (next[1] === undefined) next[1] = { cwd:
|
|
158
|
+
if (next[1] === undefined) next[1] = { cwd: currentCwd() }
|
|
156
159
|
else if (next[1] !== null && typeof next[1] === 'object' && next[1].cwd === undefined) {
|
|
157
|
-
next[1] = { ...next[1], cwd:
|
|
160
|
+
next[1] = { ...next[1], cwd: currentCwd() }
|
|
158
161
|
}
|
|
159
162
|
return next
|
|
160
163
|
}
|
|
161
164
|
|
|
162
|
-
installProjectedProcessCwd(process, sessionCwd)
|
|
163
165
|
const fs = originalRequire('node:fs')
|
|
164
166
|
const path = originalRequire('node:path')
|
|
165
167
|
for (const [name, indices] of Object.entries(FILE_SYSTEM_PATH_ARGUMENTS)) {
|
|
@@ -174,10 +176,10 @@ export function installWorkerCwdVirtualization(sessionCwd, originalRequire, mark
|
|
|
174
176
|
wrapBuiltin(fs, name, sessionGlobOptions)
|
|
175
177
|
wrapBuiltin(fs.promises, name, sessionGlobOptions)
|
|
176
178
|
}
|
|
177
|
-
wrapBuiltin(path, 'resolve', args => copyArray(args, 0, args.length, [
|
|
179
|
+
wrapBuiltin(path, 'resolve', args => copyArray(args, 0, args.length, [currentCwd()]))
|
|
178
180
|
const childProcess = originalRequire('node:child_process')
|
|
179
181
|
for (const name of ['exec', 'execFile', 'execFileSync', 'execSync', 'fork', 'spawn', 'spawnSync']) {
|
|
180
182
|
wrapBuiltin(childProcess, name,
|
|
181
|
-
args => projectChildProcessArguments(name, args,
|
|
183
|
+
args => projectChildProcessArguments(name, args, currentCwd()), CHILD_PROCESS_PROJECTED_PROPERTIES[name])
|
|
182
184
|
}
|
|
183
185
|
}
|
|
@@ -41,7 +41,7 @@ export const WORKER_REALM_SURFACE_CONTRACT = objectFreeze([
|
|
|
41
41
|
surface: 'process.cwd',
|
|
42
42
|
owner: 'internal/worker-cwd-virtualization.js',
|
|
43
43
|
classification: WORKER_REALM_MUTATION.STABLE,
|
|
44
|
-
contract: 'recorded cwd; immutable and non-configurable when a session cwd exists',
|
|
44
|
+
contract: 'current recorded cell cwd; callable immutable and non-configurable when a session cwd exists',
|
|
45
45
|
reference: 'plain Node worker process descriptor',
|
|
46
46
|
verification: 'cwd-descriptor',
|
|
47
47
|
}),
|
|
@@ -49,7 +49,7 @@ export const WORKER_REALM_SURFACE_CONTRACT = objectFreeze([
|
|
|
49
49
|
surface: 'cwd-projected Node builtins',
|
|
50
50
|
owner: 'internal/worker-cwd-virtualization.js',
|
|
51
51
|
classification: WORKER_REALM_MUTATION.STABLE,
|
|
52
|
-
contract: 'relative fs, path, and child-process calls use the recorded cwd while retaining callable descriptors',
|
|
52
|
+
contract: 'relative fs, path, and new child-process calls use the current recorded cell cwd while retaining callable descriptors',
|
|
53
53
|
reference: 'plain Node worker fs, fs/promises, path, and child_process callable descriptors',
|
|
54
54
|
verification: 'cwd-projected-builtins',
|
|
55
55
|
}),
|
|
@@ -148,7 +148,7 @@ export function installProjectedProcessCwd(processObject, cwd) {
|
|
|
148
148
|
configurable: false,
|
|
149
149
|
enumerable: true,
|
|
150
150
|
writable: false,
|
|
151
|
-
value: () => cwd,
|
|
151
|
+
value: typeof cwd === 'function' ? cwd : () => cwd,
|
|
152
152
|
})
|
|
153
153
|
}
|
|
154
154
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-ptc-plus",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"icon": "assets/ptc-plus-icon.svg",
|
|
5
5
|
"description": "A session-bound agent-native REPL for DeepSeek Harness PTC mode.",
|
|
6
6
|
"type": "module",
|
|
@@ -8,13 +8,13 @@
|
|
|
8
8
|
"exports": {
|
|
9
9
|
".": "./index.js",
|
|
10
10
|
"./execution-provider": "./internal/execution-provider-owner.js",
|
|
11
|
-
"./client": "./client.
|
|
11
|
+
"./client": "./client.cjs",
|
|
12
12
|
"./package.json": "./package.json",
|
|
13
13
|
"./locale/*.json": "./locale/*.json"
|
|
14
14
|
},
|
|
15
15
|
"files": [
|
|
16
16
|
"index.js",
|
|
17
|
-
"client.
|
|
17
|
+
"client.cjs",
|
|
18
18
|
"compiler-core.cjs",
|
|
19
19
|
"compiler-core.cjs.map",
|
|
20
20
|
"compiler-platform.cjs",
|
|
@@ -49,38 +49,24 @@
|
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
51
|
"@babel/code-frame": "^7.29.7",
|
|
52
|
-
"@babel/core": "^7.29.7",
|
|
53
|
-
"@babel/generator": "^7.29.8",
|
|
54
|
-
"@babel/helper-create-class-features-plugin": "^7.29.7",
|
|
55
52
|
"@babel/parser": "^7.29.0",
|
|
56
|
-
"@babel/plugin-proposal-decorators": "^7.29.7",
|
|
57
|
-
"@babel/plugin-transform-explicit-resource-management": "^7.29.7",
|
|
58
|
-
"@babel/plugin-transform-optional-chaining": "^7.29.7",
|
|
59
|
-
"@babel/plugin-transform-typescript": "^7.29.7",
|
|
60
|
-
"@babel/traverse": "^7.29.0",
|
|
61
|
-
"@codemirror/lang-javascript": "^6.2.5",
|
|
62
|
-
"@codemirror/language": "^6.12.4",
|
|
63
|
-
"@codemirror/state": "^6.7.4",
|
|
64
|
-
"@codemirror/view": "^6.43.11",
|
|
65
|
-
"@deepseek-ai/schemastery": "^3.18.3",
|
|
66
53
|
"@deepseek-ai/dsh-util-values": "^0.2.0-rc.2 || ^0.2.1-alpha.1",
|
|
54
|
+
"@deepseek-ai/schemastery": "^3.18.3",
|
|
67
55
|
"@jridgewell/trace-mapping": "^0.3.31",
|
|
68
|
-
"
|
|
69
|
-
"acorn": "^8.15.0",
|
|
70
|
-
"amaro": "1.1.11",
|
|
71
|
-
"codemirror": "^6.0.2",
|
|
72
|
-
"fflate": "^0.8.3",
|
|
73
|
-
"pathe": "^2.0.3",
|
|
74
|
-
"react-is": "^19.3.0",
|
|
75
|
-
"tslib": "^2.8.1",
|
|
76
|
-
"typescript": "^6.0.3"
|
|
56
|
+
"acorn": "^8.15.0"
|
|
77
57
|
},
|
|
78
58
|
"peerDependencies": {
|
|
59
|
+
"@deepseek-ai/cordis": "*",
|
|
79
60
|
"@deepseek-ai/dsh-atomic-write": "*",
|
|
80
61
|
"@deepseek-ai/dsh-home-paths": "*",
|
|
81
62
|
"@deepseek-ai/dsh-llm": "*",
|
|
63
|
+
"@deepseek-ai/dsh-scope": "*",
|
|
64
|
+
"@deepseek-ai/dsh-session": "*",
|
|
65
|
+
"@deepseek-ai/dsh-session-format-catalog": "*",
|
|
82
66
|
"@deepseek-ai/dsh-settings": "*",
|
|
67
|
+
"@deepseek-ai/dsh-skill": "*",
|
|
83
68
|
"@deepseek-ai/dsh-skill-filesystem": "*",
|
|
69
|
+
"@deepseek-ai/dsh-spill-policy": "*",
|
|
84
70
|
"@deepseek-ai/dsh-tool-cordis": "*",
|
|
85
71
|
"@deepseek-ai/dsh-tools": "*",
|
|
86
72
|
"@deepseek-ai/dsh-typert-protocol": "*"
|
|
@@ -89,12 +75,18 @@
|
|
|
89
75
|
"build": "node scripts/client-bundle.mjs build && node scripts/compiler-bundle.mjs build",
|
|
90
76
|
"build:check": "node scripts/client-bundle.mjs check && node scripts/compiler-bundle.mjs check",
|
|
91
77
|
"test:client": "vitest run --config scripts/client-test.config.mjs",
|
|
78
|
+
"test:client:focus": "node scripts/client-focused-tests.mjs",
|
|
79
|
+
"test:client:fixtures": "vitest run --config scripts/client-test.config.mjs --testNamePattern=\"^(REPL observations and shared workbench remain separate from session execution|saved cards retain exact source across remount and locale changes; catalog conflicts keep drafts actionable)$\"",
|
|
92
80
|
"test:client:visual": "node scripts/client-visual-check.mjs",
|
|
93
|
-
"test:semantics": "node
|
|
81
|
+
"test:semantics": "node scripts/test-suite-files.mjs --file test/semantic-test262.test.js --file test/semantic-dialect.test.js --file test/semantic-boundaries.test.js --file test/semantic-boundary-storage.test.js --file test/semantic-boundary-promises.test.js --file test/semantic-boundary-reflection.test.js",
|
|
94
82
|
"semantic:check": "node scripts/semantic-obligations.mjs",
|
|
95
83
|
"test:client:web": "node scripts/client-web-smoke.mjs",
|
|
84
|
+
"test:client:tool-hover:focus": "node scripts/client-tool-hover.mjs --focus",
|
|
85
|
+
"test:client:fallback:focus": "node scripts/client-fallback-smoke.mjs --focus",
|
|
86
|
+
"test:client:layout:focus": "node scripts/client-binding-layout.mjs --focus",
|
|
96
87
|
"test:client:fallback": "node scripts/client-fallback-smoke.mjs",
|
|
97
88
|
"test:client:layout": "node scripts/client-binding-layout.mjs",
|
|
89
|
+
"readme:screenshots": "node scripts/readme-screenshots.mjs",
|
|
98
90
|
"host:baseline:update": "node scripts/dsh-dependency-baseline.mjs update",
|
|
99
91
|
"host:baseline:verify": "node scripts/dsh-dependency-baseline.mjs verify",
|
|
100
92
|
"test:host-contract": "node scripts/dsh-host-contract-suite.mjs",
|
|
@@ -112,12 +104,16 @@
|
|
|
112
104
|
"session:migrate": "node scripts/migrate-session-log.mjs",
|
|
113
105
|
"coverage": "node scripts/coverage.mjs",
|
|
114
106
|
"coverage:focus": "node scripts/coverage.mjs --focus",
|
|
107
|
+
"test:backend:focus": "node scripts/test-suite-files.mjs --focus",
|
|
108
|
+
"test:backend": "node scripts/test-suite-files.mjs",
|
|
115
109
|
"test:ci:runtime": "node --test --test-concurrency=1 test/package-contract.test.js test/compiler-platform.test.js test/direct-surface-policy.test.js test/isolated-entrance.test.js test/plugin-native-call-transport.test.js",
|
|
116
|
-
"verify": "npm run review:validate && npm run host:baseline:verify && npm run semantic:check && npm run build:check && node --check index.js && node --check internal/kernel-worker.js && node --check scripts/migrate-session-log.mjs && node --check scripts/expensive-headless-acceptance.mjs && node --check scripts/ab-headless-trajectories.mjs &&
|
|
117
|
-
"verify:ci": "npm run review:validate && npm run host:baseline:verify && npm run semantic:check && npm run build:check && node --check index.js && node --check internal/kernel-worker.js && node --check scripts/migrate-session-log.mjs &&
|
|
110
|
+
"verify": "npm run review:validate && npm run host:baseline:verify && npm run semantic:check && npm run build:check && node --check index.js && node --check internal/kernel-worker.js && node --check scripts/migrate-session-log.mjs && node --check scripts/expensive-headless-acceptance.mjs && node --check scripts/ab-headless-trajectories.mjs && node scripts/deterministic-test-groups.mjs",
|
|
111
|
+
"verify:ci": "npm run review:validate && npm run host:baseline:verify && npm run semantic:check && npm run build:check && node --check index.js && node --check internal/kernel-worker.js && node --check scripts/migrate-session-log.mjs && node scripts/deterministic-test-groups.mjs --ci",
|
|
118
112
|
"check": "node scripts/review-findings.mjs check",
|
|
113
|
+
"verify:docs": "node scripts/review-findings.mjs docs",
|
|
119
114
|
"test:expensive": "node scripts/expensive-headless-acceptance.mjs",
|
|
120
|
-
"test:ab": "node scripts/ab-headless-trajectories.mjs"
|
|
115
|
+
"test:ab": "node scripts/ab-headless-trajectories.mjs",
|
|
116
|
+
"test:package:consumer": "node scripts/npm-consumer-smoke.mjs"
|
|
121
117
|
},
|
|
122
118
|
"keywords": [
|
|
123
119
|
"deepseek-harness",
|
|
@@ -155,6 +151,18 @@
|
|
|
155
151
|
}
|
|
156
152
|
},
|
|
157
153
|
"devDependencies": {
|
|
154
|
+
"@babel/core": "^7.29.7",
|
|
155
|
+
"@babel/generator": "^7.29.8",
|
|
156
|
+
"@babel/helper-create-class-features-plugin": "^7.29.7",
|
|
157
|
+
"@babel/plugin-proposal-decorators": "^7.29.7",
|
|
158
|
+
"@babel/plugin-transform-explicit-resource-management": "^7.29.7",
|
|
159
|
+
"@babel/plugin-transform-optional-chaining": "^7.29.7",
|
|
160
|
+
"@babel/plugin-transform-typescript": "^7.29.7",
|
|
161
|
+
"@babel/traverse": "^7.29.0",
|
|
162
|
+
"@codemirror/lang-javascript": "^6.2.5",
|
|
163
|
+
"@codemirror/language": "^6.12.4",
|
|
164
|
+
"@codemirror/state": "^6.7.4",
|
|
165
|
+
"@codemirror/view": "^6.43.11",
|
|
158
166
|
"@deepseek-ai/dsh": "next",
|
|
159
167
|
"@deepseek-ai/dsh-agent-loop": "next",
|
|
160
168
|
"@deepseek-ai/dsh-api-gateway": "next",
|
|
@@ -169,6 +177,7 @@
|
|
|
169
177
|
"@deepseek-ai/dsh-client-ui-session": "next",
|
|
170
178
|
"@deepseek-ai/dsh-client-ui-slots": "next",
|
|
171
179
|
"@deepseek-ai/dsh-commands": "next",
|
|
180
|
+
"@deepseek-ai/dsh-compaction-image-offload": "next",
|
|
172
181
|
"@deepseek-ai/dsh-home-paths": "next",
|
|
173
182
|
"@deepseek-ai/dsh-llm": "next",
|
|
174
183
|
"@deepseek-ai/dsh-session-format-catalog": "next",
|
|
@@ -181,14 +190,19 @@
|
|
|
181
190
|
"@deepseek-ai/dsh-typert-protocol": "next",
|
|
182
191
|
"@deepseek-ai/dsh-typert-registry": "next",
|
|
183
192
|
"@deepseek-ai/dsh-util-workspace-path": "next",
|
|
193
|
+
"@lezer/highlight": "^1.2.3",
|
|
194
|
+
"@radix-ui/react-select": "^2.2.6",
|
|
184
195
|
"@shikijs/langs": "^4.3.1",
|
|
185
196
|
"@testing-library/react": "^16.3.3",
|
|
197
|
+
"amaro": "1.1.11",
|
|
186
198
|
"anser": "^2.3.5",
|
|
187
199
|
"c8": "^12.0.0",
|
|
188
200
|
"clsx": "^2.0.0",
|
|
201
|
+
"codemirror": "^6.0.2",
|
|
189
202
|
"convert-source-map": "^2.0.0",
|
|
190
203
|
"diff": "^9.0.0",
|
|
191
204
|
"esbuild": "0.28.2",
|
|
205
|
+
"fflate": "^0.8.3",
|
|
192
206
|
"immer": "^10.1.1",
|
|
193
207
|
"jsdom": "^29.1.1",
|
|
194
208
|
"katex": "^0.16.47",
|
|
@@ -203,11 +217,15 @@
|
|
|
203
217
|
"micromark-util-classify-character": "^2.0.1",
|
|
204
218
|
"micromark-util-sanitize-uri": "^2.0.1",
|
|
205
219
|
"micromark-util-symbol": "^2.0.1",
|
|
220
|
+
"pathe": "^2.0.3",
|
|
206
221
|
"playwright": "^1.63.0",
|
|
207
222
|
"react": "^18.3.1",
|
|
208
223
|
"react-dom": "^18.3.1",
|
|
224
|
+
"react-is": "^19.3.0",
|
|
209
225
|
"shiki": "^4.3.1",
|
|
210
226
|
"simple-icons": "16.31.0",
|
|
227
|
+
"tslib": "^2.8.1",
|
|
228
|
+
"typescript": "^6.0.3",
|
|
211
229
|
"vitest": "^5.0.0",
|
|
212
230
|
"yaml": "^2.9.0",
|
|
213
231
|
"zustand": "~4.4.7"
|