@tlockney/cdp-kernel 0.8.0 → 0.10.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.
@@ -101,7 +101,10 @@ const jupyter = createJupyter({
101
101
  // A request can't block for an answer, so prompt() and confirm() behave
102
102
  // as when the frontend has no stdin.
103
103
  input: () => null,
104
+ // jupyter.params (#456): the CDPK_PARAMS binding, set when install() runs.
105
+ params: () => paramsText,
104
106
  });
107
+ let paramsText;
105
108
 
106
109
  // --- Modules ----------------------------------------------------------------
107
110
  const modules = new Map();
@@ -131,6 +134,7 @@ let handle = null;
131
134
 
132
135
  function install(env) {
133
136
  const meta = JSON.parse(env.META);
137
+ paramsText = typeof env.CDPK_PARAMS === "string" ? env.CDPK_PARAMS : undefined;
134
138
  globalThis.__cdpk = {
135
139
  import: cellImport,
136
140
  meta: { ...meta, resolve: (specifier) => new URL(specifier, meta.url).href },
@@ -164,7 +168,7 @@ function install(env) {
164
168
  globalThis.confirm = jupyter.confirm;
165
169
  // A cell has no fetch(request, env), so the Worker's bindings (#26) are a
166
170
  // global, without the kernel's own.
167
- const { UNSAFE, TOKEN, META, ...bindings } = env;
171
+ const { UNSAFE, TOKEN, META, CDPK_PARAMS, ...bindings } = env;
168
172
  globalThis.env = bindings;
169
173
  // workerd forbids eval without its UnsafeEval binding; celld (#25) allows
170
174
  // a plain global eval and has no such binding.