@deepseek-ai/dsh-ptc-runtime-node 0.2.2-rc.4 → 0.2.3-alpha.1

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.
Files changed (71) hide show
  1. package/README.i18n.yaml +24 -24
  2. package/README.md +49 -17
  3. package/README.zh.md +49 -17
  4. package/lib/configuration.js +15 -5
  5. package/lib/index.js +439 -148
  6. package/lib/persistent-process.js +683 -90
  7. package/lib/process.js +683 -90
  8. package/lib/types/bindings.d.ts +10 -5
  9. package/lib/types/bindings.d.ts.map +1 -1
  10. package/lib/types/bindings.js.map +1 -1
  11. package/lib/types/bootstrap.d.ts +42 -24
  12. package/lib/types/bootstrap.d.ts.map +1 -1
  13. package/lib/types/bootstrap.js.map +1 -1
  14. package/lib/types/config.d.ts +14 -2
  15. package/lib/types/config.d.ts.map +1 -1
  16. package/lib/types/config.js.map +1 -1
  17. package/lib/types/configuration.d.ts +5 -4
  18. package/lib/types/configuration.d.ts.map +1 -1
  19. package/lib/types/configuration.js.map +1 -1
  20. package/lib/types/environment.d.ts +13 -0
  21. package/lib/types/environment.d.ts.map +1 -1
  22. package/lib/types/environment.js.map +1 -1
  23. package/lib/types/evaluators/index.d.ts.map +1 -1
  24. package/lib/types/evaluators/index.js.map +1 -1
  25. package/lib/types/evaluators/scoped-repl-evaluator.d.ts +22 -0
  26. package/lib/types/evaluators/scoped-repl-evaluator.d.ts.map +1 -0
  27. package/lib/types/evaluators/scoped-repl-evaluator.js.map +1 -0
  28. package/lib/types/evaluators/scoped-repl.d.ts +130 -0
  29. package/lib/types/evaluators/scoped-repl.d.ts.map +1 -0
  30. package/lib/types/evaluators/scoped-repl.js.map +1 -0
  31. package/lib/types/evaluators/types.d.ts +3 -3
  32. package/lib/types/evaluators/types.d.ts.map +1 -1
  33. package/lib/types/evaluators/types.js.map +1 -1
  34. package/lib/types/execution.d.ts +3 -2
  35. package/lib/types/execution.d.ts.map +1 -1
  36. package/lib/types/execution.js.map +1 -1
  37. package/lib/types/index.d.ts +6 -1
  38. package/lib/types/index.d.ts.map +1 -1
  39. package/lib/types/index.js.map +1 -1
  40. package/lib/types/json-wire.d.ts +16 -4
  41. package/lib/types/json-wire.d.ts.map +1 -1
  42. package/lib/types/json-wire.js.map +1 -1
  43. package/lib/types/output-ledger.d.ts +10 -10
  44. package/lib/types/output-ledger.d.ts.map +1 -1
  45. package/lib/types/output-ledger.js.map +1 -1
  46. package/lib/types/process.d.ts +2 -0
  47. package/lib/types/process.d.ts.map +1 -1
  48. package/lib/types/process.js.map +1 -1
  49. package/lib/types/protocol.d.ts +31 -5
  50. package/lib/types/protocol.d.ts.map +1 -1
  51. package/lib/types/protocol.js.map +1 -1
  52. package/lib/types/worker.d.ts +6 -3
  53. package/lib/types/worker.d.ts.map +1 -1
  54. package/lib/types/worker.js.map +1 -1
  55. package/package.json +23 -21
  56. package/src/bindings.ts +33 -26
  57. package/src/bootstrap.ts +159 -57
  58. package/src/config.ts +21 -3
  59. package/src/configuration.ts +13 -6
  60. package/src/environment.ts +39 -0
  61. package/src/evaluators/index.ts +2 -0
  62. package/src/evaluators/scoped-repl-evaluator.ts +110 -0
  63. package/src/evaluators/scoped-repl.ts +339 -0
  64. package/src/evaluators/types.ts +3 -3
  65. package/src/execution.ts +37 -17
  66. package/src/index.ts +58 -13
  67. package/src/json-wire.ts +44 -8
  68. package/src/output-ledger.ts +42 -45
  69. package/src/process.ts +89 -18
  70. package/src/protocol.ts +37 -10
  71. package/src/worker.ts +75 -40
@@ -1 +1 @@
1
- {"version":3,"file":"worker.js","sourceRoot":"","sources":["../../src/worker.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAA;AAGpD,OAAO,EAAE,uBAAuB,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAA;AAM/G,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAA;AAE7C,OAAO,E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,EAAE,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAA;YACrH,kEAAkE;YAClE,YAAY,CAAC,GAAG,EAAE;gBAChB,IAAI,CAAC,IAAI,CAAC,MAAM;oBAAE,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,KAAK,SAAS,IAAI,qBAAqB,CAAC,OAAO,CAAC,QAAQ,EAAE,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,QAAQ,CAAC,kBAAkB,CAAC,KAAK,SAAS,CAAC,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,aAAa,EAAE,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,CAAA;YACrO,CAAC,CAAC,CAAA;QACJ,CAAC,EAAE,CAAC,KAAc,EAAE,EAAE;YACpB,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,KAAK,SAAS,IAAI,oBAAoB,CAAC,KAAK,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC;gBAC9F,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,aAAa,EAAE,IAAI,CAAC,kBAAkB,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;QACvF,CAAC,CAAC,CAAA;IACJ,CAAC;CAEF"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@deepseek-ai/dsh-ptc-runtime-node",
3
- "description": "Node PTC execution with async function, REPL and VM Script evaluators and optional retained state",
4
- "version": "0.2.2-rc.4",
3
+ "description": "Node PTC execution with async function, REPL, scoped REPL and VM Script evaluators and optional retained state",
4
+ "version": "0.2.3-alpha.1",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -43,33 +43,35 @@
43
43
  "license": "MIT",
44
44
  "peerDependencies": {
45
45
  "@deepseek-ai/cordis": "~4.1.0",
46
- "@deepseek-ai/dsh-ptc-runtime": "0.2.2-rc.4",
47
- "@deepseek-ai/dsh-session": "0.2.2-rc.4",
48
- "@deepseek-ai/dsh-timeout": "0.2.2-rc.4",
49
- "@deepseek-ai/dsh-fs": "0.2.2-rc.4",
50
- "@deepseek-ai/dsh-subprocess": "0.2.2-rc.4",
51
- "@deepseek-ai/dsh-sandbox": "0.2.2-rc.4",
52
- "@deepseek-ai/dsh-sandbox-policy": "0.2.2-rc.4"
46
+ "@deepseek-ai/dsh-ptc-runtime": "0.2.3-alpha.1",
47
+ "@deepseek-ai/dsh-session": "0.2.3-alpha.1",
48
+ "@deepseek-ai/dsh-timeout": "0.2.3-alpha.1",
49
+ "@deepseek-ai/dsh-fs": "0.2.3-alpha.1",
50
+ "@deepseek-ai/dsh-subprocess": "0.2.3-alpha.1",
51
+ "@deepseek-ai/dsh-sandbox": "0.2.3-alpha.1",
52
+ "@deepseek-ai/dsh-sandbox-policy": "0.2.3-alpha.1"
53
53
  },
54
54
  "dependencies": {
55
- "@deepseek-ai/dsh-util-values": "0.2.2-rc.4",
55
+ "@deepseek-ai/dsh-util-values": "0.2.3-alpha.1",
56
56
  "@deepseek-ai/schemastery": "~3.19.0",
57
57
  "acorn": "^8.18.0",
58
58
  "acorn-walk": "^8.3.5",
59
59
  "birpc": "4.2.0"
60
60
  },
61
61
  "devDependencies": {
62
+ "@deepseek-ai/dsh-brand": "0.2.3-alpha.1",
62
63
  "@deepseek-ai/cordis": "~4.1.0",
63
- "@deepseek-ai/dsh-ptc-runtime": "0.2.2-rc.4",
64
- "@deepseek-ai/dsh-session": "0.2.2-rc.4",
65
- "@deepseek-ai/dsh-timeout": "0.2.2-rc.4",
66
- "@deepseek-ai/dsh-fs": "0.2.2-rc.4",
67
- "@deepseek-ai/dsh-subprocess": "0.2.2-rc.4",
68
- "@deepseek-ai/dsh-sandbox": "0.2.2-rc.4",
69
- "@deepseek-ai/dsh-sandbox-policy": "0.2.2-rc.4",
70
- "@deepseek-ai/dsh-fs-local": "0.2.2-rc.4",
71
- "@deepseek-ai/dsh-subprocess-local": "0.2.2-rc.4",
72
- "@deepseek-ai/dsh-session-projection": "0.2.2-rc.4",
73
- "@deepseek-ai/dsh-sandbox-local": "0.2.2-rc.4"
64
+ "@deepseek-ai/dsh-ptc-runtime": "0.2.3-alpha.1",
65
+ "@deepseek-ai/dsh-session": "0.2.3-alpha.1",
66
+ "@deepseek-ai/dsh-timeout": "0.2.3-alpha.1",
67
+ "@deepseek-ai/dsh-fs": "0.2.3-alpha.1",
68
+ "@deepseek-ai/dsh-subprocess": "0.2.3-alpha.1",
69
+ "@deepseek-ai/dsh-sandbox": "0.2.3-alpha.1",
70
+ "@deepseek-ai/dsh-sandbox-policy": "0.2.3-alpha.1",
71
+ "@deepseek-ai/dsh-fs-local": "0.2.3-alpha.1",
72
+ "@deepseek-ai/dsh-subprocess-local": "0.2.3-alpha.1",
73
+ "@deepseek-ai/dsh-session-projection": "0.2.3-alpha.1",
74
+ "@deepseek-ai/dsh-sandbox-local": "0.2.3-alpha.1",
75
+ "@deepseek-ai/dsh-attachment": "0.2.3-alpha.1"
74
76
  }
75
77
  }
package/src/bindings.ts CHANGED
@@ -1,31 +1,28 @@
1
1
  /** Validate and capture the binding names available to one program. */
2
- import { DUNDER_MEMBER, PORTABLE_RESERVED_WORDS, RESERVED_BINDING_GLOBALS, RESERVED_ERROR_MEMBERS } from '@deepseek-ai/dsh-ptc-runtime'
3
- import type { PtcBindingFunction, PtcBindingNamespace, PtcJsonValue, PtcRunRequest } from '@deepseek-ai/dsh-ptc-runtime'
4
- import { snapshotJsonValue } from '@deepseek-ai/dsh-util-values'
5
- import { encodePtcJsonWire, type PtcJsonWire } from './json-wire.ts'
6
- const IDENTIFIER = /^[A-Za-z_][A-Za-z0-9_]*$/
2
+ import { PtcImage, PtcInspectableValue, RESERVED_BINDING_WORDS, PtcRuntimeError, RESERVED_BINDING_GLOBALS, RESERVED_ERROR_MEMBERS } from '@deepseek-ai/dsh-ptc-runtime'
3
+ import type { PtcBindingFunction, PtcBindingNamespace, PtcJsonValue, PtcProgramFormat, PtcRunRequest } from '@deepseek-ai/dsh-ptc-runtime'
4
+ import { snapshotPtcJsonValue, encodePtcJsonWire, type PtcImageWire } from './json-wire.ts'
5
+ import type { BindingResult } from './protocol.ts'
6
+ import { RESERVED_PREFIX } from './evaluators/scoped-repl.ts'
7
+ const IDENTIFIER = /^[A-Za-z_$][A-Za-z0-9_$]*$/
7
8
  /**
8
9
  * Reject unusable namespaces before starting a process.
9
10
  * @param request - Host-owned binding declarations.
11
+ * @param programFormat - Evaluator syntax whose internal identifiers must remain reserved.
10
12
  * @returns Namespaces keyed by their declared global.
11
13
  */
12
- export function validateBindings(request: PtcRunRequest): Map<string, PtcBindingNamespace> {
14
+ export function validateBindings(request: PtcRunRequest, programFormat: PtcProgramFormat): Map<string, PtcBindingNamespace> {
13
15
  const bindings = new Map<string, PtcBindingNamespace>()
14
16
  for (const namespace of request.bindings) {
15
- if (!IDENTIFIER.test(namespace.global) || PORTABLE_RESERVED_WORDS.has(namespace.global)) {
16
- throw new Error(`dsh-ptc-runtime-node: binding global ${JSON.stringify(namespace.global)} is not a usable identifier`)
17
+ if (!IDENTIFIER.test(namespace.global) || RESERVED_BINDING_WORDS.has(namespace.global)
18
+ || (programFormat === 'scoped-repl' && namespace.global.includes(RESERVED_PREFIX))) {
19
+ throw new PtcRuntimeError(`dsh-ptc-runtime-node: binding global ${JSON.stringify(namespace.global)} is not a usable identifier`, 'PTC_RUNTIME_INVALID_ARGUMENT')
17
20
  }
18
- // RESERVED_BINDING_GLOBALS is the seam's shared backend-owned set:
19
- // `console` is THIS backend's log-capture slot; the dunder entries exist
20
- // for the Python side — its seeded/wrapped slots plus the `__debug__`
21
- // compile-time constant — refused here too so the namespace list stays
22
- // portable across backends. The seam declaration is the single home for
23
- // why each entry is reserved.
24
21
  if (RESERVED_BINDING_GLOBALS.has(namespace.global)) {
25
- throw new Error(`dsh-ptc-runtime-node: reserved binding global ${JSON.stringify(namespace.global)}`)
22
+ throw new PtcRuntimeError(`dsh-ptc-runtime-node: reserved binding global ${JSON.stringify(namespace.global)}`, 'PTC_RUNTIME_INVALID_ARGUMENT')
26
23
  }
27
24
  if (bindings.has(namespace.global)) {
28
- throw new Error(`dsh-ptc-runtime-node: duplicate binding global ${JSON.stringify(namespace.global)}`)
25
+ throw new PtcRuntimeError(`dsh-ptc-runtime-node: duplicate binding global ${JSON.stringify(namespace.global)}`, 'PTC_RUNTIME_INVALID_ARGUMENT')
29
26
  }
30
27
  bindings.set(namespace.global, namespace)
31
28
  }
@@ -34,18 +31,19 @@ export function validateBindings(request: PtcRunRequest): Map<string, PtcBinding
34
31
  for (const namespace of request.bindings) {
35
32
  const descriptor = namespace.errorClass
36
33
  if (!descriptor) continue
37
- if (!IDENTIFIER.test(descriptor.name) || PORTABLE_RESERVED_WORDS.has(descriptor.name)) {
38
- throw new Error(`dsh-ptc-runtime-node: binding error class ${JSON.stringify(descriptor.name)} is not a usable identifier`)
34
+ if (!IDENTIFIER.test(descriptor.name) || RESERVED_BINDING_WORDS.has(descriptor.name)
35
+ || (programFormat === 'scoped-repl' && descriptor.name.includes(RESERVED_PREFIX))) {
36
+ throw new PtcRuntimeError(`dsh-ptc-runtime-node: binding error class ${JSON.stringify(descriptor.name)} is not a usable identifier`, 'PTC_RUNTIME_INVALID_ARGUMENT')
39
37
  }
40
38
  if (RESERVED_BINDING_GLOBALS.has(descriptor.name)) {
41
- throw new Error(`dsh-ptc-runtime-node: reserved binding global ${JSON.stringify(descriptor.name)}`)
39
+ throw new PtcRuntimeError(`dsh-ptc-runtime-node: reserved binding global ${JSON.stringify(descriptor.name)}`, 'PTC_RUNTIME_INVALID_ARGUMENT')
42
40
  }
43
41
  if (bindings.has(descriptor.name) || errorClassNames.has(descriptor.name)) {
44
- throw new Error(`dsh-ptc-runtime-node: duplicate injected global ${JSON.stringify(descriptor.name)}`)
42
+ throw new PtcRuntimeError(`dsh-ptc-runtime-node: duplicate injected global ${JSON.stringify(descriptor.name)}`, 'PTC_RUNTIME_INVALID_ARGUMENT')
45
43
  }
46
44
  const member = descriptor.memberNameProperty
47
- if (member.length === 0 || RESERVED_ERROR_MEMBERS.has(member) || DUNDER_MEMBER.test(member)) {
48
- throw new Error(`dsh-ptc-runtime-node: binding error member property ${JSON.stringify(descriptor.memberNameProperty)} is not usable`)
45
+ if (member.length === 0 || RESERVED_ERROR_MEMBERS.has(member)) {
46
+ throw new PtcRuntimeError(`dsh-ptc-runtime-node: binding error member property ${JSON.stringify(descriptor.memberNameProperty)} is not usable`, 'PTC_RUNTIME_INVALID_ARGUMENT')
49
47
  }
50
48
  errorClassNames.add(descriptor.name)
51
49
  }
@@ -56,11 +54,20 @@ export function validateBindings(request: PtcRunRequest): Map<string, PtcBinding
56
54
  * Invoke a host binding and encode its lossless result.
57
55
  * @param binding - Current evaluation's function, absent if it was removed.
58
56
  * @param args - Validated JSON arguments detached from the program.
59
- * @returns Flat lossless JSON; unavailable bindings and invalid results reject.
57
+ * @param image - Registers host-issued images with the owning process.
58
+ * @returns Flat binding data; unavailable bindings and invalid results reject.
60
59
  */
61
- export async function invokeBinding(binding: PtcBindingFunction | undefined, args: PtcJsonValue): Promise<PtcJsonWire> {
60
+ export async function invokeBinding(
61
+ binding: PtcBindingFunction | undefined, args: PtcJsonValue, image?: (value: PtcImage) => PtcImageWire,
62
+ ): Promise<BindingResult> {
62
63
  if (!binding) throw new Error('binding is unavailable in this evaluation; reacquire the current tool')
63
- const value = snapshotJsonValue(await binding(args))
64
+ const resolved = await binding(args)
65
+ const inspection = resolved instanceof PtcInspectableValue ? resolved.text : undefined
66
+ const value = snapshotPtcJsonValue(resolved instanceof PtcInspectableValue ? resolved.value : resolved,
67
+ value => image !== undefined && value instanceof PtcImage)
64
68
  if (value === undefined) throw new Error('binding resolution must be lossless JSON')
65
- return encodePtcJsonWire(value)
69
+ return {
70
+ value: encodePtcJsonWire(value, candidate => candidate instanceof PtcImage ? image?.(candidate) : undefined),
71
+ ...inspection === undefined ? {} : { inspection },
72
+ }
66
73
  }
package/src/bootstrap.ts CHANGED
@@ -3,15 +3,64 @@
3
3
  * @module @deepseek-ai/dsh-ptc-runtime-node/src/bootstrap
4
4
  */
5
5
 
6
- import { inspect, types } from 'node:util'
6
+ import { inspect, types, type InspectOptions } from 'node:util'
7
+ import type { PtcJsonValue } from '@deepseek-ai/dsh-ptc-runtime'
7
8
  import type { HostMethods, ProgramResult, ProgramBootData } from './protocol.ts'
8
9
  import { jsonStringBytesUpTo, jsonValueBytesUpTo, truncateJsonStringBytes } from './output-json.ts'
9
- import { decodePtcJsonWire, encodePtcJsonWire, snapshotPtcJsonValue } from './json-wire.ts'
10
+ import { decodePtcJsonWire, encodePtcJsonWire, snapshotPtcJsonValue, type PtcImageWire } from './json-wire.ts'
10
11
 
11
12
  const CapturedError = Error
12
- const isNativeError = types.isNativeError
13
- const capturedObjectCreate = Object.create
14
- const capturedObjectDefineProperty = Object.defineProperty
13
+ const { isNativeError, isProxy } = types
14
+ const {
15
+ create: capturedObjectCreate,
16
+ defineProperty: capturedObjectDefineProperty,
17
+ getOwnPropertyDescriptor: capturedObjectGetOwnPropertyDescriptor,
18
+ getPrototypeOf: capturedObjectGetPrototypeOf,
19
+ is: capturedObjectIs,
20
+ } = Object
21
+ const capturedOwnKeys = Reflect.ownKeys
22
+
23
+ /** Text and the original JSON data associated with one binding result. */
24
+ export interface BindingInspection {
25
+ /** Detached data used to detect changes before selecting the text. */
26
+ snapshot: PtcJsonValue
27
+ /** Host-authored text for direct inspection of the unchanged value. */
28
+ text: string
29
+ }
30
+
31
+ /** Compare data properties without invoking accessors or traversing model-created proxies. */
32
+ function matchesInspection(value: object, snapshot: PtcJsonValue, images: Pick<WeakMap<object, string>, 'get'>): boolean {
33
+ const pending: [unknown, PtcJsonValue][] = [[value, snapshot]]
34
+ let size = 1
35
+ while (size > 0) {
36
+ const pair = pending[--size] as [unknown, PtcJsonValue]
37
+ const current = pair[0]
38
+ const original = pair[1]
39
+ if (capturedObjectIs(current, original)) continue
40
+ if (current === null || typeof current !== 'object' || original === null || typeof original !== 'object'
41
+ || isProxy(current) || images.get(original) !== undefined
42
+ || capturedObjectGetPrototypeOf(current) !== capturedObjectGetPrototypeOf(original)) return false
43
+ const keys = capturedOwnKeys(current)
44
+ if (keys.length !== capturedOwnKeys(original).length) return false
45
+ for (let index = 0; index < keys.length; index++) {
46
+ const key = keys[index] as string | symbol
47
+ const actual = capturedObjectGetOwnPropertyDescriptor(current, key) as PropertyDescriptor
48
+ const expected = capturedObjectGetOwnPropertyDescriptor(original, key)
49
+ if (!expected || !('value' in actual) || actual.enumerable !== expected.enumerable) return false
50
+ const slot = capturedObjectCreate(null) as PropertyDescriptor
51
+ slot.value = [actual.value, expected.value as PtcJsonValue]
52
+ slot.configurable = true
53
+ capturedObjectDefineProperty(pending, size++, slot)
54
+ }
55
+ }
56
+ return true
57
+ }
58
+
59
+ /** Node formatting options shared with the runtime-owned Image hook. */
60
+ export interface ImageInspectOptions extends InspectOptions {
61
+ /** Primitive token retained by Node when passing options to a formatter in another VM context. */
62
+ ptcImageCollector?: symbol
63
+ }
15
64
 
16
65
  /** Define one public binding-error field without consulting mutable globals or descriptor prototypes. */
17
66
  function defineBindingErrorField(error: Error, key: string, value: string): void {
@@ -36,8 +85,7 @@ export interface PatchableStream {
36
85
  * a sink as each item lands (the real sink sends text to the host eagerly,
37
86
  * so captured output survives a mid-run termination). It includes the log
38
87
  * array syntax and string escaping in its accounting. Once exhausted it emits
39
- * the fitting prefix and reports the limit once; the host turns that condition
40
- * into an explicit `output-limit` run failure.
88
+ * the fitting prefix and reports truncation once; execution continues.
41
89
  */
42
90
  export class LogBuffer {
43
91
  private bytes = 2 // JSON serialization of the empty logs array: []
@@ -84,32 +132,80 @@ export class LogBuffer {
84
132
  this.sink(text)
85
133
  }
86
134
 
87
- /** Remaining exact JSON-byte budget for the completion value or failure message. */
88
- remainingOutputBytes(): number {
89
- return this.maxBytes - this.bytes
90
- }
91
- }
135
+ /** Discard further output after the host exhausts the combined text and image budget. */
136
+ discard(): void { this.truncated = true }
92
137
 
93
- /** The five console methods the shim captures, in the seam's level vocabulary. */
94
- const CONSOLE_LEVELS = ['log', 'info', 'warn', 'error', 'debug'] as const
138
+ /** Whether captured text has exceeded the shared output budget. */
139
+ get overflowed(): boolean { return this.truncated }
140
+ }
95
141
 
96
142
  /**
97
- * A `console` replacement whose five leveled methods render their arguments
98
- * `util.inspect`-style (matching real console formatting closely enough for
99
- * a model to recognize its own output) into the buffer. Only these five
100
- * exist — the program gets a deliberately small console, not Node's full
101
- * console API.
143
+ * Render arguments without depth, array-length or string-length previews and emit registered images in order.
102
144
  * @param logs - the buffer every rendered line is pushed into.
103
- * @returns the five-method console object handed to the program.
145
+ * @param images - Image identities owned by the execution process.
146
+ * @param emitImage - Emits a registered image in the current evaluation.
147
+ * @param inspections - Process-owned text associated with original binding result identities.
148
+ * @returns The program's inspect function and its matching Image collection hook.
149
+ * @throws If object formatting fails; preceding arguments remain visible.
104
150
  */
105
- export function makeConsoleShim(logs: Pick<LogBuffer, 'push'>): Record<(typeof CONSOLE_LEVELS)[number], (...args: unknown[]) => void> {
106
- const render = (args: unknown[]): string =>
107
- args.map(arg => typeof arg === 'string' ? arg : inspect(arg, INSPECT_OPTIONS)).join(' ')
108
- const shim = Object.create(null) as Record<(typeof CONSOLE_LEVELS)[number], (...args: unknown[]) => void>
109
- for (const level of CONSOLE_LEVELS) {
110
- shim[level] = (...args: unknown[]) => { logs.push(render(args)) }
151
+ export function makeInspect(
152
+ logs: Pick<LogBuffer, 'push' | 'overflowed'>, images: Pick<WeakMap<object, string>, 'get'>, emitImage: (id: string) => void,
153
+ inspections?: Pick<WeakMap<object, BindingInspection>, 'get'>,
154
+ ): {
155
+ inspect: (...args: unknown[]) => void
156
+ collectImage: (image: object, options: ImageInspectOptions) => void
157
+ } {
158
+ const collectors = new Map<symbol, string[]>()
159
+ const programInspect = (...args: unknown[]): void => {
160
+ const pending: string[] = []
161
+ const flush = (): void => {
162
+ if (pending.length === 0) return
163
+ logs.push(pending.join(' ') + '\n')
164
+ pending.length = 0
165
+ }
166
+ for (const arg of args) {
167
+ if (logs.overflowed) break
168
+ const inspection = arg !== null && typeof arg === 'object' ? inspections?.get(arg) : undefined
169
+ if (inspection !== undefined && matchesInspection(arg as object, inspection.snapshot, images)) {
170
+ flush()
171
+ if (inspection.text.length > 0) logs.push(inspection.text.endsWith('\n') ? inspection.text : inspection.text + '\n')
172
+ continue
173
+ }
174
+ const directImage = arg !== null && typeof arg === 'object' ? images.get(arg) : undefined
175
+ if (directImage !== undefined) {
176
+ flush()
177
+ emitImage(directImage)
178
+ continue
179
+ }
180
+ const nested: string[] = []
181
+ const collector = Symbol()
182
+ const options: ImageInspectOptions = {
183
+ depth: null, maxArrayLength: null, maxStringLength: null,
184
+ ptcImageCollector: collector,
185
+ }
186
+ collectors.set(collector, nested)
187
+ try {
188
+ pending.push(typeof arg === 'string' ? arg : inspect(arg, options))
189
+ } catch (error: unknown) {
190
+ flush()
191
+ throw error
192
+ } finally {
193
+ collectors.delete(collector)
194
+ }
195
+ if (nested.length === 0) continue
196
+ flush()
197
+ for (const id of nested) emitImage(id)
198
+ }
199
+ flush()
200
+ if (args.length === 0) logs.push('\n')
201
+ }
202
+ return {
203
+ inspect: programInspect,
204
+ collectImage(image, options) {
205
+ const id = images.get(image)
206
+ if (id !== undefined && options.ptcImageCollector !== undefined) collectors.get(options.ptcImageCollector)?.push(id)
207
+ },
111
208
  }
112
- return shim
113
209
  }
114
210
 
115
211
  /**
@@ -142,24 +238,21 @@ export function captureStreamWrites(logs: Pick<LogBuffer, 'push'>, stream: Patch
142
238
  return () => { stream.write = original }
143
239
  }
144
240
 
145
- /** Bounded inspect options: deep enough to be useful, bounded so a pathological value cannot explode the rendering. */
146
- const INSPECT_OPTIONS = { depth: 4, maxArrayLength: 100, maxStringLength: 10_000 } as const
147
-
148
241
  /**
149
242
  * Prepare the program's completion value for the run result. Only lossless
150
- * JSON crosses, and a value that does not fit the remaining combined outer
151
- * budget reports `output-limit`; the host revalidates hostile traffic and
243
+ * JSON crosses, and a value that does not fit even without captured output
244
+ * reports `output-limit`; the host revalidates hostile traffic and
152
245
  * remains authoritative for native pipe writes the program shim cannot observe.
153
246
  *
154
247
  * @param value - the program's completion value.
155
- * @param remainingOutputBytes - exact bytes left after captured logs.
248
+ * @param availableBytes - bytes available to the completion or diagnostic.
156
249
  * @param maxOutputBytes - the configured cap named in an overflow diagnostic.
157
250
  * @returns the result fragment: `{}` for `undefined`, else a flat wire `{ value }`.
158
251
  */
159
252
  export function prepareCompletion(
160
253
  value: unknown,
161
- remainingOutputBytes: number,
162
- maxOutputBytes: number = remainingOutputBytes,
254
+ availableBytes: number,
255
+ maxOutputBytes: number = availableBytes,
163
256
  ): ProgramResult {
164
257
  if (value === undefined) return {}
165
258
  let snapshot: ReturnType<typeof snapshotPtcJsonValue>
@@ -172,44 +265,35 @@ export function prepareCompletion(
172
265
  return prepareFailure(
173
266
  'invalid-output',
174
267
  'program completion must be lossless JSON',
175
- remainingOutputBytes,
176
- maxOutputBytes,
268
+ availableBytes,
177
269
  )
178
270
  }
179
- if (jsonValueBytesUpTo(snapshot, remainingOutputBytes) === undefined) {
180
- return outputLimit(maxOutputBytes)
271
+ if (jsonValueBytesUpTo(snapshot, availableBytes) === undefined) {
272
+ return { error: { kind: 'output-limit', message: `completion value exceeded ${maxOutputBytes} bytes` } }
181
273
  }
182
274
  return { value: encodePtcJsonWire(snapshot) }
183
275
  }
184
276
 
185
- /** Build the fixed overflow fragment without carrying rejected variable bytes. */
186
- function outputLimit(maxOutputBytes: number): ProgramResult {
187
- return { error: { kind: 'output-limit', message: `outer output exceeded ${maxOutputBytes} bytes` } }
188
- }
189
-
190
- /** Admit one bounded failure message or replace it with the fixed overflow diagnostic. */
277
+ /** Truncate diagnostic text while preserving its failure kind. */
191
278
  function prepareFailure(
192
279
  kind: 'exception' | 'invalid-output',
193
280
  message: string,
194
- remainingOutputBytes: number,
195
- maxOutputBytes: number,
281
+ availableBytes: number,
196
282
  ): ProgramResult {
197
- if (jsonStringBytesUpTo(message, remainingOutputBytes) === undefined) return outputLimit(maxOutputBytes)
198
- return { error: { kind, message } }
283
+ const retained = truncateJsonStringBytes(message, availableBytes)
284
+ return { error: { kind, message: retained }, ...retained !== message ? { outputTruncated: true } : {} }
199
285
  }
200
286
 
201
287
  /**
202
288
  * Prepare a thrown program value, including cross-realm errors, without sending
203
289
  * an unbounded stack or string across the process channel.
204
290
  * @param error - the value thrown by the program.
205
- * @param remainingOutputBytes - exact bytes left after captured logs.
206
- * @param maxOutputBytes - the configured cap named in an overflow diagnostic.
207
- * @returns a bounded exception or fixed output-limit fragment.
291
+ * @param availableBytes - bytes available to the completion or diagnostic.
292
+ * @returns a bounded exception preserving its kind and indicating truncated diagnostics.
208
293
  */
209
294
  export function prepareException(
210
295
  error: unknown,
211
- remainingOutputBytes: number,
212
- maxOutputBytes: number = remainingOutputBytes,
296
+ availableBytes: number,
213
297
  ): ProgramResult {
214
298
  let message: string
215
299
  try {
@@ -218,7 +302,7 @@ export function prepareException(
218
302
  } catch {
219
303
  message = 'program threw an unrenderable value'
220
304
  }
221
- return prepareFailure('exception', message, remainingOutputBytes, maxOutputBytes)
305
+ return prepareFailure('exception', message, availableBytes)
222
306
  }
223
307
 
224
308
  /** Constructor type for one program-visible binding rejection class. */
@@ -251,12 +335,18 @@ function bindingFailure(errorClass: BindingErrorConstructor | undefined, memberN
251
335
  * @param data - Namespace declarations injected into the program.
252
336
  * @param host - Evaluation-scoped remote binding calls.
253
337
  * @param errorClasses - Constructors shared with program globals, resolved per invocation.
254
- * @returns One namespace object per declaration; arguments and results must be lossless JSON.
338
+ * @param inspections - Required process-owned inspection text indexed by decoded result identity.
339
+ * @param decodeImage - Optional decoder for host-issued images; image tokens are rejected when absent.
340
+ * @param isImage - Optional recognition of decoded images; omission restricts inspection snapshots to JSON data.
341
+ * @returns One namespace object per declaration.
255
342
  */
256
343
  export function makeNamespaces(
257
344
  data: Pick<ProgramBootData, 'namespaces'>,
258
345
  host: Pick<HostMethods, 'invoke'>,
259
346
  errorClasses: Pick<ReadonlyMap<string, BindingErrorConstructor>, 'get'>,
347
+ inspections: Pick<WeakMap<object, BindingInspection>, 'set'>,
348
+ decodeImage?: (wire: PtcImageWire) => PtcJsonValue,
349
+ isImage?: (value: object) => boolean,
260
350
  ): Record<string, unknown>[] {
261
351
  return data.namespaces.map(({ global, names }) => {
262
352
  const namespace = Object.create(null) as Record<string, unknown>
@@ -272,8 +362,20 @@ export function makeNamespaces(
272
362
  detached = undefined
273
363
  }
274
364
  if (detached === undefined) throw new CapturedError('binding arguments must be lossless JSON')
275
- const result = decodePtcJsonWire(await host.invoke(global, name, encodePtcJsonWire(detached)))
365
+ const resolution: unknown = await host.invoke(global, name, encodePtcJsonWire(detached))
366
+ if (resolution === null || typeof resolution !== 'object' || Array.isArray(resolution) || !('value' in resolution)) {
367
+ throw new CapturedError('binding resolution must be lossless JSON')
368
+ }
369
+ const inspection = 'inspection' in resolution ? resolution.inspection : undefined
370
+ if (inspection !== undefined && typeof inspection !== 'string') throw new CapturedError('binding resolution must be lossless JSON')
371
+ const result = decodePtcJsonWire(resolution.value, decodeImage)
276
372
  if (result === undefined) throw new CapturedError('binding resolution must be lossless JSON')
373
+ if (inspection !== undefined) {
374
+ if (result === null || typeof result !== 'object') throw new CapturedError('binding inspection requires an object or array')
375
+ const snapshot = snapshotPtcJsonValue(result, isImage)
376
+ if (snapshot === undefined) throw new CapturedError('binding inspection requires lossless JSON data')
377
+ inspections.set(result, { snapshot, text: inspection })
378
+ }
277
379
  return result
278
380
  } catch (error: unknown) {
279
381
  throw bindingFailure(errorClass, name, error instanceof CapturedError ? error.message : String(error))
package/src/config.ts CHANGED
@@ -2,20 +2,26 @@
2
2
  import z from '@deepseek-ai/schemastery'
3
3
  import { MAX_TIMER_DELAY_MS } from '@deepseek-ai/dsh-timeout'
4
4
  import type { LaunchConfig } from './launch.ts'
5
+ import { resolvePersistentExecution } from './configuration.ts'
5
6
 
6
7
  /** Deployment-varying runtime bounds and launch choices. */
7
8
  export interface Config {
8
9
  /** Worker invocation in the subprocess world; omitted selects the local carrier. */
9
10
  launch?: LaunchConfig
10
- /** per-call uses fresh async function bodies; vm-script uses VM contexts; persistent-in-memory retains a REPL per owner. */
11
+ /** persistent-in-memory, the default, retains a REPL per owner; per-call uses fresh async function bodies; vm-script uses VM contexts. */
11
12
  executionMode?: 'per-call' | 'persistent-in-memory' | 'vm-script'
12
13
  /** Retain a Script process and context per stateOwner; only supported with executionMode: vm-script. */
13
14
  scriptPersistence?: boolean
15
+ /**
16
+ * Run persistent-in-memory programs as scoped REPL statements whose later calls receive copies of earlier top-level bindings;
17
+ * omitted, it is `SCOPED_REPL_BY_DEFAULT` from configuration.ts, currently true, with persistent-in-memory and false otherwise.
18
+ */
19
+ replScoped?: boolean
14
20
  /** Default elapsed deadline, including nested tool and approval waits. */
15
21
  timeoutMs?: number
16
22
  /** Maximum numeric elapsed budget accepted by resolve. */
17
23
  maxTimeoutMs?: number
18
- /** Combined serialized logs, completion and diagnostic byte cap. */
24
+ /** Combined serialized output and completion or diagnostic cap; terminal data takes priority over captured output. */
19
25
  maxOutputBytes?: number
20
26
  /** V8 old-generation heap limit in MiB; native allocations are excluded. */
21
27
  maxOldGenerationSizeMb?: number
@@ -33,8 +39,9 @@ export interface Config {
33
39
  export type ResolvedConfig = Required<Config>
34
40
  /** Loader defaults for the Node PTC provider. */
35
41
  export const NodeConfig: z<Config> = z.object({
36
- executionMode: z.union([z.const('per-call'), z.const('persistent-in-memory'), z.const('vm-script')]).default('per-call'),
42
+ executionMode: z.union([z.const('per-call'), z.const('persistent-in-memory'), z.const('vm-script')]).default('persistent-in-memory'),
37
43
  scriptPersistence: z.boolean().default(false),
44
+ replScoped: z.boolean(),
38
45
  timeoutMs: z.number().default(120_000),
39
46
  maxTimeoutMs: z.number().default(600_000),
40
47
  maxOutputBytes: z.number().default(67_108_864),
@@ -49,12 +56,23 @@ export const NodeConfig: z<Config> = z.object({
49
56
  ]),
50
57
  })
51
58
 
59
+ /**
60
+ * Select the scoped REPL setting for the configured execution mode.
61
+ * @param config - Loader-defaulted fields whose `replScoped` may be omitted.
62
+ * @returns The explicit setting; when omitted, the setting that `resolvePersistentExecution` writes for function bodies with
63
+ * `persistent-in-memory`, and false in other modes.
64
+ */
65
+ export function resolveReplScoped(config: Pick<Config, 'executionMode' | 'replScoped'>): boolean {
66
+ return config.replScoped ?? (config.executionMode === 'persistent-in-memory' && resolvePersistentExecution().replScoped)
67
+ }
68
+
52
69
  /**
53
70
  * Validate resolved Node limits and paths.
54
71
  * @param config - Loader-defaulted fields with the selected executable.
55
72
  */
56
73
  export function validateConfig(config: ResolvedConfig): void {
57
74
  if (config.scriptPersistence && config.executionMode !== 'vm-script') throw new Error('ptc-runtime-node: scriptPersistence requires executionMode: vm-script')
75
+ if (config.replScoped && config.executionMode !== 'persistent-in-memory') throw new Error('ptc-runtime-node: replScoped requires executionMode: persistent-in-memory')
58
76
  for (const [key, value] of Object.entries(config)) {
59
77
  if (typeof value === 'number' && (!Number.isFinite(value) || value <= 0)) throw new Error(`ptc-runtime-node: ${key} must be positive and finite`)
60
78
  }