dsh-ptc-plus 0.4.8 → 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.
Files changed (139) hide show
  1. package/README.en.md +61 -123
  2. package/README.md +61 -123
  3. package/assets/dsh-ptc-plus-banner-en.webp +0 -0
  4. package/assets/dsh-ptc-plus-banner-zh.webp +0 -0
  5. package/assets/ptc-plus-repl-workspace-en.png +0 -0
  6. package/assets/ptc-plus-repl-workspace-zh.png +0 -0
  7. package/assets/ptc-plus-settings-en.png +0 -0
  8. package/assets/ptc-plus-settings-zh.png +0 -0
  9. package/client.cjs +42336 -0
  10. package/cordis.patch.yml +13 -2
  11. package/docs/README.md +7 -2
  12. package/docs/adr/0005-temporary-rejected-cell-edit-transport.md +31 -179
  13. package/docs/adr/0008-define-agent-operating-contract.md +5 -1
  14. package/docs/adr/0009-bound-expensive-acceptance-default.md +2 -2
  15. package/docs/adr/0016-archive-resolved-review-findings.md +1 -1
  16. package/docs/adr/0017-track-the-latest-dsh-public-surface.md +2 -2
  17. package/docs/adr/0019-plugin-settings-and-kill-switch.md +14 -3
  18. package/docs/adr/0020-optional-cordis-tools-in-ptc-mode.md +2 -2
  19. package/docs/adr/0022-stage-npm-releases-with-oidc.md +4 -2
  20. package/docs/adr/0023-global-user-bindings.md +3 -1
  21. package/docs/adr/0026-persist-the-delivery-verdict-against-the-verified-candidate.md +2 -0
  22. package/docs/adr/0028-attach-to-the-host-ptc-execution-seam.md +101 -35
  23. package/docs/adr/0030-serve-both-typert-codec-generations-from-one-codec.md +3 -3
  24. package/docs/adr/0031-close-semantic-obligations-by-owner.md +1 -1
  25. package/docs/adr/0032-own-session-log-facts-in-a-host-only-projection.md +27 -0
  26. package/docs/adr/0033-gate-client-visual-usability-in-a-browser.md +23 -0
  27. package/docs/adr/0034-keep-program-values-separate-from-output-projections.md +29 -0
  28. package/docs/adr/0035-run-coverage-only-before-a-new-release.md +27 -0
  29. package/docs/adr/0036-separate-focused-development-from-delivery-verification.md +29 -0
  30. package/docs/adr/0037-keep-tool-hover-previews-passive.md +52 -0
  31. package/docs/adr/0038-freeze-session-capability-plans.md +71 -0
  32. package/docs/adr/0039-verify-documentation-without-runtime-suites.md +29 -0
  33. package/docs/adr/0040-separate-capability-configurations-from-session-observations.md +39 -0
  34. package/docs/adr/0041-record-cell-execution-directories.md +65 -0
  35. package/docs/adr/0042-persist-provider-availability-and-handback.md +41 -0
  36. package/docs/adr/0043-compose-capability-and-context-policies.md +37 -0
  37. package/docs/adr/README.md +6 -0
  38. package/docs/architecture.md +25 -27
  39. package/docs/binding-review-placement-design.md +29 -21
  40. package/docs/capability-planning-components.md +93 -0
  41. package/docs/capability-projection.md +7 -0
  42. package/docs/client-ui.md +88 -29
  43. package/docs/client-visual-contract.md +65 -0
  44. package/docs/context-management.md +22 -0
  45. package/docs/context-optimization-plan.md +353 -0
  46. package/docs/context-public-interface-coverage.md +25 -0
  47. package/docs/durability-design.md +31 -14
  48. package/docs/evaluation.md +41 -6
  49. package/docs/evaluations/command-goat-deepseek-v4.1-flash-20261006.md +126 -0
  50. package/docs/evaluations/command-goat-deepseek-v4.1-flash.md +281 -0
  51. package/docs/installation.md +50 -8
  52. package/docs/program-data-plane.md +5 -3
  53. package/docs/publishing.md +5 -5
  54. package/docs/release-coverage.md +73 -0
  55. package/docs/release-notes.md +1 -1
  56. package/docs/review-procedure.md +56 -0
  57. package/docs/runtime-reference.md +48 -16
  58. package/docs/semantic-validation.md +14 -2
  59. package/docs/stateful-binding-updates-proposal.md +2 -2
  60. package/docs/user-bindings.en.md +2 -2
  61. package/docs/user-bindings.md +3 -3
  62. package/docs/value-wire.md +11 -1
  63. package/docs/verification-optimization-work.md +52 -15
  64. package/docs/verification.md +30 -86
  65. package/index.js +147 -23
  66. package/internal/binding-toggle-receipt.js +24 -0
  67. package/internal/capability-command-receipt.js +29 -0
  68. package/internal/capability-environment.js +1247 -0
  69. package/internal/capability-plan.js +285 -0
  70. package/internal/capability-policy.js +96 -0
  71. package/internal/capability-statistics-store.js +180 -0
  72. package/internal/capability-statistics.js +210 -0
  73. package/internal/compiler-platform.js +5 -3
  74. package/internal/compiler-service.js +2 -9
  75. package/internal/config-spec.js +79 -9
  76. package/internal/cordis-tools-owner.js +22 -19
  77. package/internal/direct-surface-owner.js +29 -29
  78. package/internal/dynamic-environment-runtime.js +9 -9
  79. package/internal/edit-transport-owner.js +183 -139
  80. package/internal/execution-provider-owner.js +160 -0
  81. package/internal/execution-seam-compat.js +76 -120
  82. package/internal/isolated-worker.js +12 -8
  83. package/internal/kernel-worker.js +104 -32
  84. package/internal/native-root-dynamic.js +12 -13
  85. package/internal/program-bindings.js +190 -0
  86. package/internal/recovery-tips.js +53 -23
  87. package/internal/rejected-cell-editor.js +8 -8
  88. package/internal/repl-observation-interest.js +11 -3
  89. package/internal/rpc-contract.js +1 -0
  90. package/internal/runtime-bridge-owner.js +351 -82
  91. package/internal/runtime-config.js +58 -0
  92. package/internal/runtime-contexts.js +85 -16
  93. package/internal/runtime-intrinsics.js +1 -0
  94. package/internal/runtime-messages.js +41 -0
  95. package/internal/sdk-projection.js +10 -82
  96. package/internal/session-cell-executor.js +42 -19
  97. package/internal/session-events.js +74 -4
  98. package/internal/session-journal-recovery.js +904 -184
  99. package/internal/session-journal-schema.js +6 -3
  100. package/internal/session-journal.js +31 -2
  101. package/internal/session-log-view.js +189 -43
  102. package/internal/session-runtime.js +175 -23
  103. package/internal/settings-compat.js +23 -6
  104. package/internal/stateful-module-compiler.js +3 -2
  105. package/internal/stateful-module-runtime.js +7 -3
  106. package/internal/stateful-root-runtime.js +9 -4
  107. package/internal/user-binding-authoring.js +2 -7
  108. package/internal/user-bindings-owner.js +47 -7
  109. package/internal/validated-parse-repair.js +1 -1
  110. package/internal/value-wire.js +68 -21
  111. package/internal/worker-cwd-virtualization.js +20 -18
  112. package/internal/worker-realm-surfaces.js +3 -3
  113. package/locale/en.json +6 -0
  114. package/locale/zh.json +6 -0
  115. package/package.json +55 -38
  116. package/src/client-authoring-view.js +286 -168
  117. package/src/client-binding-review.js +4 -1
  118. package/src/client-binding-toggle.js +18 -0
  119. package/src/client-capabilities-view.js +1341 -0
  120. package/src/client-capability-sort.js +29 -0
  121. package/src/client-code-editor.js +6 -0
  122. package/src/client-copy.js +881 -8
  123. package/src/client-feature-gates.js +15 -5
  124. package/src/client-host-compat.js +23 -2
  125. package/src/client-indicator-view.js +4 -6
  126. package/src/client-primitives.js +280 -0
  127. package/src/client-repl-view.js +23 -16
  128. package/src/client-settings-view.js +412 -69
  129. package/src/client-styles.js +193 -41
  130. package/src/client-tool-hover.js +185 -0
  131. package/src/client-tool-view.js +45 -11
  132. package/src/client-transport.js +44 -9
  133. package/src/client-workbench.js +9 -10
  134. package/src/client.js +148 -68
  135. package/assets/ptc-plus-bindings-en.png +0 -0
  136. package/assets/ptc-plus-bindings-zh.png +0 -0
  137. package/assets/ptc-plus-repair-en.png +0 -0
  138. package/assets/ptc-plus-repair-zh.png +0 -0
  139. package/client.js +0 -31857
@@ -3,7 +3,6 @@ import { boundContextSummary, createUserMessage } from '@deepseek-ai/dsh-llm'
3
3
  import { validateJsonSchemaValue } from '@deepseek-ai/dsh-tools'
4
4
  import { PTC_MESSAGE_SOURCE_KIND } from './message-sources.js'
5
5
  import { canonicalizeToolCallStream } from './tool-call-canonicalizer.js'
6
- import { editRunCodeSchema } from './rejected-cell-editor.js'
7
6
  import { sessionRuntimeContexts } from './runtime-contexts.js'
8
7
  import { projectProgramSdk } from './sdk-projection.js'
9
8
  import { EDIT_RUN_CODE } from './edit-transport-owner.js'
@@ -16,11 +15,12 @@ import {
16
15
  } from './run-code-description.js'
17
16
  import { userBindingsConfiguredContext } from './user-bindings.js'
18
17
  import { BINDING_AUTHORING_SDK } from './user-binding-authoring.js'
18
+ import { executionPolicies } from './binding-update-policy.js'
19
19
 
20
- const RUN_CODE_TOOL_DESCRIPTION = 'Evaluate the next TypeScript cell in this session-bound persistent REPL, reusing earlier top-level bindings. Use `code` for the async-function body and `description` for its short UI summary. Successful image-bearing subtool results are attached after the cell.'
21
- const RUN_CODE_CODE_DESCRIPTION = 'Code for the next REPL cell, parsed as the body of an async TypeScript function.'
20
+ const RUN_CODE_TOOL_DESCRIPTION = 'Evaluate the next TypeScript cell in this session-bound persistent REPL, reusing earlier top-level bindings. Use `code` for the cell and `description` for its short UI summary. Successful image-bearing subtool results are attached after the cell.'
21
+ const RUN_CODE_CODE_DESCRIPTION = 'Code for the next PTC TypeScript cell, following the selected language conventions.'
22
22
  const RUN_CODE_DESCRIPTION_DESCRIPTION = 'Short active-voice summary of what this cell does, 5-10 words (shown in the UI).'
23
- const CODE_TRANSPORT_INSTRUCTION = '`run_code` and `edit_run_code` are the only tools callable directly. Call every native tool declared by the SDK from inside a program.'
23
+ const CODE_TRANSPORT_INSTRUCTION = '`run_code` is the only tool callable directly. Call `tools.edit_run_code` and other SDK tools from inside a program. An accepted edit runs after the current cell finishes.'
24
24
  const PTC_COLLAPSE_SECTION_NAMES = Object.freeze(['tools:ptc-only', 'tools:code-only'])
25
25
  const INVALID_TOOL_JSON_FAILURE = Object.freeze({
26
26
  code: 'MALFORMED_RESPONSE',
@@ -53,19 +53,20 @@ function adaptRunCodeSchema(tool) {
53
53
  }
54
54
  }
55
55
 
56
- function capabilitySdk(nativeSdk, userBindingsEnabled) {
57
- return `${projectProgramSdk(nativeSdk)}
56
+ function capabilitySdk(nativeSdk, userBindingsEnabled, languageSemantics) {
57
+ return `${projectProgramSdk(nativeSdk, { languageSemantics })}
58
58
 
59
59
  ## PTC Plus program capabilities
60
60
 
61
- Discover program APIs without calling them. \`tree()\` lists namespaces and members; \`inspect()\` describes selected \`namespace.member\` symbols. \`find()\` matches case-insensitive symbols or contiguous words, separating CamelCase and punctuation. Use short queries such as \`"read"\`; if none match, shorten the query or check \`tree()\`. Missing metadata is unknown.
61
+ Discover program APIs without calling them. \`search({query})\` retrieves whole indexed API descriptions by English/Chinese words; its UTF-8 JSON byte budget includes the envelope, with a continuation cursor and inspect references for oversized entries. \`tree()\` lists namespaces and members; \`find()\` matches case-insensitive symbols or contiguous words, separating CamelCase and punctuation; \`inspect()\` returns selected \`namespace.member\` symbols with an item-count budget. Missing metadata is unknown.
62
62
 
63
63
  \`\`\`ts
64
- declare class CapabilityExplorationError extends Error { readonly operation: "tree" | "find" | "inspect" }
64
+ declare class CapabilityExplorationError extends Error { readonly operation: "tree" | "find" | "inspect" | "search" }
65
65
  declare const capabilities: {
66
66
  tree(): Promise<Array<{ namespace: string; members: string[] }>>
67
67
  find(query: string): Promise<Array<{ symbol: string; description?: string; completeness: string; effect: string; replay: string }>>
68
68
  inspect(args?: { symbols?: string[]; budget?: number }): Promise<{ symbols: unknown[]; omitted: number; unknown: string[]; budget: number }>
69
+ search(args: { query: string; budgetBytes?: number; limit?: number; cursor?: string }): Promise<{ matches: Array<{ symbol: string; owner: unknown; contract: unknown }>; oversized: Array<{ symbol: string; requiredBytes: number; inspect: { symbols: string[]; budget: number } }>; total: number; remaining: number; cursor: string | null; budgetBytes: number; usedBytes: number; unit: "utf8-json-bytes" }>
69
70
  }
70
71
  \`\`\`${userBindingsEnabled ? `\n${BINDING_AUTHORING_SDK}` : ''}`
71
72
  }
@@ -118,16 +119,8 @@ function presentationState(assembly) {
118
119
  const collapse = PTC_COLLAPSE_SECTION_NAMES
119
120
  .map(name => assembly?.sections?.find(section => section?.name === name))
120
121
  .find(section => section !== undefined)
121
- if (collapse !== undefined) {
122
- const presentation = typeof collapse.text === 'string' && collapse.text.trim().length > 0
123
- ? 'ptc'
124
- : 'both'
125
- return { presentation, ownerProven: true, collapseSectionName: collapse.name }
126
- }
127
- const presentation = tools.every(tool => tool?.name === RUN_CODE || tool?.name === EDIT_RUN_CODE)
128
- ? 'ptc'
129
- : 'both'
130
- return { presentation, ownerProven: false, collapseSectionName: undefined }
122
+ return { presentation: 'ptc', ownerProven: collapse !== undefined,
123
+ collapseSectionName: collapse?.name }
131
124
  }
132
125
 
133
126
  async function* bindCallPolicies(source, policy, calls) {
@@ -464,6 +457,8 @@ export function createDirectSurfaceOwner({
464
457
  toolSchemasForAgent,
465
458
  userBindingsForAgent = async () => undefined,
466
459
  setAgentPresentation = async () => {},
460
+ sessionLogView,
461
+ capabilityEnvironment,
467
462
  }) {
468
463
  // Composition is anchored to Agent identity because DSH selects presentation
469
464
  // once per composed agent. Request signals bind the exact assembly to stream
@@ -477,6 +472,7 @@ export function createDirectSurfaceOwner({
477
472
  let disposed = false
478
473
  let currentCanonicalizeToolCalls = canonicalizeToolCalls
479
474
  let currentAutoDescribeRunCode = runtimeConfig.autoDescribeRunCode
475
+ let currentLanguageSemantics = executionPolicies(runtimeConfig).languageSemantics
480
476
  const tipConfig = {
481
477
  enabled: runtimeConfig.tipsEnabled,
482
478
  cooldownMessages: runtimeConfig.tipCooldownMessages,
@@ -562,6 +558,7 @@ export function createDirectSurfaceOwner({
562
558
 
563
559
  return Object.freeze({
564
560
  reconfigure(nextConfig) {
561
+ currentLanguageSemantics = executionPolicies(nextConfig).languageSemantics
565
562
  currentCanonicalizeToolCalls = nextConfig.canonicalizeToolCalls
566
563
  currentAutoDescribeRunCode = nextConfig.autoDescribeRunCode
567
564
  cordisRecovery.reconfigure(nextConfig.cordisToolsEnabled)
@@ -570,8 +567,11 @@ export function createDirectSurfaceOwner({
570
567
  tipConfig.escalationFailures = nextConfig.tipEscalationFailures
571
568
  },
572
569
  async assemble(initialAssembly, context, next) {
570
+ // Settings observes Host-owned catalogs without preparing a session environment.
571
+ if (context?.ptcPlusCapabilityObservation === true) return next()
573
572
  // Keep schema projection and later execution on one configuration snapshot.
574
573
  const autoDescribeRunCode = currentAutoDescribeRunCode
574
+ const languageSemantics = currentLanguageSemantics
575
575
  const agent = context?.agent
576
576
  const id = sessionId(agent)
577
577
  const requestOwner = id === undefined ? undefined : sessionOwner(id)
@@ -624,16 +624,18 @@ export function createDirectSurfaceOwner({
624
624
  if (!isCurrent()) return assembly
625
625
  const sessionPtc = presentation !== 'native' && id !== undefined
626
626
  const sessionPtcProjection = presentation === 'ptc' && id !== undefined
627
+ if (sessionPtc) await capabilityEnvironment?.prepare(agent, assembly.sections)
627
628
  const userBindings = sessionPtc ? await userBindingsForAgent(agent) : undefined
628
629
  if (!isCurrent()) return assembly
629
630
  const runCode = tools.find(tool => tool?.name === RUN_CODE)
630
- let directTools = tools
631
+ let directTools = sessionPtc ? capabilityEnvironment?.visibleSchemas(agent, tools) ?? tools : tools
631
632
  if (sessionPtcProjection) {
632
633
  editTransport.ensureInstalled(agent)
633
- directTools = [adaptRunCodeSchema(runCode), editRunCodeSchema()]
634
+ directTools = [adaptRunCodeSchema(runCode)]
634
635
  }
635
636
  const runtimeContexts = sessionPtc
636
637
  ? sessionRuntimeContexts(agent, tipConfig, {
638
+ sessionLogView,
637
639
  cordisRecoveryRequired(view) {
638
640
  return cordisRecovery.required(agent, view)
639
641
  },
@@ -648,9 +650,10 @@ export function createDirectSurfaceOwner({
648
650
  && assembly.sections.some(section => section?.name === 'tools:sdk'
649
651
  || (sessionPtcProjection && section?.name === completedState.collapseSectionName))
650
652
  const sections = projectsSections
651
- ? assembly.sections.map(section => {
653
+ ? (capabilityEnvironment?.projectSections(agent, assembly.sections) ?? assembly.sections).map(section => {
652
654
  if (section?.name === 'tools:sdk') {
653
- return { ...section, text: capabilitySdk(section.text, userBindings !== undefined) }
655
+ return { ...section, text: capabilitySdk(capabilityEnvironment?.sdk(agent, section.text) ?? section.text,
656
+ userBindings !== undefined, languageSemantics) }
654
657
  }
655
658
  if (sessionPtcProjection && section?.name === completedState.collapseSectionName) {
656
659
  return { ...section, text: CODE_TRANSPORT_INSTRUCTION }
@@ -660,7 +663,7 @@ export function createDirectSurfaceOwner({
660
663
  : assembly.sections
661
664
  if (id !== undefined) {
662
665
  const nativeSchemas = presentation === 'ptc'
663
- ? new Map(toolSchemasForAgent(agent)
666
+ ? new Map((capabilityEnvironment?.visibleSchemas(agent, toolSchemasForAgent(agent)) ?? toolSchemasForAgent(agent))
664
667
  .filter(schema => typeof schema?.name === 'string'
665
668
  && schema.name !== RUN_CODE && schema.name !== EDIT_RUN_CODE)
666
669
  .map(schema => [schema.name, schema]))
@@ -704,20 +707,17 @@ export function createDirectSurfaceOwner({
704
707
  return bindCallPolicies(recovered, policy, policy.owner.calls)
705
708
  },
706
709
  executionRejection(exec) {
707
- if (exec.name === EDIT_RUN_CODE && exec.parent !== undefined) {
708
- return rejection(`tool ${EDIT_RUN_CODE} is only callable directly in PTC mode; call native tools from inside run_code`)
709
- }
710
710
  const policy = dispatchPolicy(exec)
711
711
  if (exec.name === EDIT_RUN_CODE) {
712
- return policy?.presentation === 'ptc'
712
+ return exec.parent !== undefined
713
713
  ? undefined
714
- : rejection(`tool ${EDIT_RUN_CODE} is not declared for this request`)
714
+ : rejection(`tool ${EDIT_RUN_CODE} must be called through tools.${EDIT_RUN_CODE} inside run_code`)
715
715
  }
716
716
  if (exec.name === RUN_CODE || exec.parent !== undefined) {
717
717
  return undefined
718
718
  }
719
719
  if (policy?.presentation !== 'ptc') return undefined
720
- return rejection(`tool ${exec.name} is not a direct PTC tool; use run_code or edit_run_code directly, and call native tools from inside run_code`)
720
+ return rejection(`tool ${exec.name} is not a direct PTC tool; use run_code directly, and call SDK tools from inside run_code`)
721
721
  },
722
722
  executionArguments(exec) {
723
723
  const policy = dispatchPolicy(exec)
@@ -54,7 +54,7 @@ const asBindings = value => {
54
54
 
55
55
  /** Native reference operations over compiler-proved lexical and object frames. */
56
56
  export function createDynamicEnvironmentRuntime({
57
- importModule = (source, options) => import(source, options),
57
+ importModule: defaultImportModule = (source, options) => import(source, options),
58
58
  intrinsicEval = defaultIntrinsics.intrinsicEval, realmFunction = defaultIntrinsics.realmFunction, globalObject = defaultIntrinsics.globalObject,
59
59
  errors, reflect = defaultIntrinsics.reflect, object, interfaceOwner, resolveAmbient = programAmbientResolver,
60
60
  } = {}) {
@@ -173,7 +173,7 @@ export function createDynamicEnvironmentRuntime({
173
173
 
174
174
  function environment({ frames = [], varFrame = new internal.Map(), strict = false, origin, lexicalContext = {},
175
175
  getThis = () => globalObject, getNewTarget = () => undefined, allowNewTarget = false,
176
- ambient = ambientReference, createVar, declareVars, nativeAwait = false } = {}) {
176
+ ambient = ambientReference, createVar, declareVars, nativeAwait = false, importModule = defaultImportModule } = {}) {
177
177
  varFrame = asBindings(varFrame)
178
178
  const capturedFrames = []
179
179
  for (let index = 0; index < frames.length; index++) {
@@ -268,19 +268,19 @@ export function createDynamicEnvironmentRuntime({
268
268
  internal.copyArray(captured, rootIndex, captured.length, combined)
269
269
  internal.copyArray(frames, boundary, frames.length, combined)
270
270
  }
271
- return environment({ frames: combined,
271
+ return environment({ importModule, frames: combined,
272
272
  varFrame, strict: nextStrict, getThis, getNewTarget, allowNewTarget, ambient, createVar, declareVars, nativeAwait, origin, lexicalContext })
273
273
  },
274
274
  awaitActivation() {
275
275
  const local = new internal.Map()
276
- return environment({ frames: internal.copyArray(frames, 0, frames.length, [{ kind: 'lexical', bindings: local }]), varFrame: local,
276
+ return environment({ importModule, frames: internal.copyArray(frames, 0, frames.length, [{ kind: 'lexical', bindings: local }]), varFrame: local,
277
277
  strict, getThis, getNewTarget, allowNewTarget, ambient, nativeAwait: true, origin, lexicalContext })
278
278
  },
279
279
  activation(bindings, nextGetThis = getThis, nextGetNewTarget = getNewTarget, nextStrict = strict, ownFunction = true, selfBindings) {
280
280
  bindings = asBindings(bindings)
281
281
  const activationFrames = [{ kind: 'lexical', bindings }]
282
282
  if (selfBindings !== undefined) internal.appendArray(activationFrames, { kind: 'self', bindings: asBindings(selfBindings) })
283
- return environment({ frames: internal.copyArray(frames, 0, frames.length, activationFrames), varFrame: bindings,
283
+ return environment({ importModule, frames: internal.copyArray(frames, 0, frames.length, activationFrames), varFrame: bindings,
284
284
  strict: nextStrict, getThis: nextGetThis, getNewTarget: nextGetNewTarget, allowNewTarget: ownFunction || allowNewTarget, ambient, origin,
285
285
  lexicalContext: ownFunction ? { privateReferences: lexicalContext.privateReferences } : lexicalContext })
286
286
  },
@@ -294,7 +294,7 @@ export function createDynamicEnvironmentRuntime({
294
294
  }
295
295
  const parameterFrames = [{ kind: 'lexical', bindings }]
296
296
  if (selfBindings !== undefined) internal.appendArray(parameterFrames, { kind: 'self', bindings: asBindings(selfBindings) })
297
- selected = environment({ frames: internal.copyArray(frames, 0, frames.length, parameterFrames), varFrame: bindings,
297
+ selected = environment({ importModule, frames: internal.copyArray(frames, 0, frames.length, parameterFrames), varFrame: bindings,
298
298
  strict: nextStrict, getThis: nextGetThis, getNewTarget: nextGetNewTarget, allowNewTarget: ownFunction || allowNewTarget, ambient, origin, lexicalContext })
299
299
  internal.weakMapSet(parameterEnvironments, key, selected)
300
300
  }
@@ -309,15 +309,15 @@ export function createDynamicEnvironmentRuntime({
309
309
  } })
310
310
  return nativeCalls.registerCallableSourceTarget(adapter, fn)
311
311
  },
312
- context(options) { return environment({ frames, varFrame, strict: options.strict ?? strict,
312
+ context(options) { return environment({ importModule, frames, varFrame, strict: options.strict ?? strict,
313
313
  getThis: options.getThis ?? getThis, getNewTarget: options.getNewTarget ?? getNewTarget,
314
314
  allowNewTarget: options.allowNewTarget ?? allowNewTarget, ambient, createVar, declareVars, nativeAwait, origin,
315
315
  lexicalContext: { ...lexicalContext, ...options } }) },
316
- at(nextOrigin) { return environment({ frames, varFrame, strict, getThis, getNewTarget,
316
+ at(nextOrigin) { return environment({ importModule, frames, varFrame, strict, getThis, getNewTarget,
317
317
  allowNewTarget, ambient, createVar, declareVars, nativeAwait, origin: nextOrigin, lexicalContext }) },
318
318
  withObject(value) {
319
319
  if (value === null || value === undefined) throw new errors.TypeError('Cannot convert undefined or null to object')
320
- return environment({ frames: internal.copyArray(frames, 0, frames.length, [{ kind: 'object', object: object(value) }]),
320
+ return environment({ importModule, frames: internal.copyArray(frames, 0, frames.length, [{ kind: 'object', object: object(value) }]),
321
321
  varFrame, strict, getThis, getNewTarget, allowNewTarget, ambient, createVar, declareVars, nativeAwait, origin, lexicalContext })
322
322
  },
323
323
  declareEvalVars(names) {