@runtimed/node 0.1.1 → 0.2.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.md +66 -3
- package/package.json +6 -5
- package/src/binding.cjs +57 -52
- package/src/binding.d.ts +240 -1
package/README.md
CHANGED
|
@@ -24,12 +24,25 @@ async function main() {
|
|
|
24
24
|
const session = await createNotebook({
|
|
25
25
|
runtime: "python",
|
|
26
26
|
workingDir: process.cwd(),
|
|
27
|
+
// Record these before the first cell runs.
|
|
28
|
+
dependencies: ["numpy", "matplotlib"],
|
|
29
|
+
packageManager: "uv",
|
|
30
|
+
description: "plotting smoke test",
|
|
27
31
|
});
|
|
28
32
|
|
|
29
33
|
try {
|
|
30
34
|
console.log("daemon socket:", defaultSocketPath());
|
|
31
35
|
|
|
32
|
-
|
|
36
|
+
await session.syncEnvironment();
|
|
37
|
+
|
|
38
|
+
const result = await session.runCell(`
|
|
39
|
+
import numpy as np
|
|
40
|
+
import matplotlib.pyplot as plt
|
|
41
|
+
|
|
42
|
+
x = np.linspace(0, 6.28, 200)
|
|
43
|
+
plt.plot(x, np.sin(x))
|
|
44
|
+
plt.show()
|
|
45
|
+
`);
|
|
33
46
|
console.log(result.status);
|
|
34
47
|
console.log(result.outputs);
|
|
35
48
|
|
|
@@ -45,18 +58,52 @@ main().catch((error) => {
|
|
|
45
58
|
});
|
|
46
59
|
```
|
|
47
60
|
|
|
61
|
+
## Notebook Dependencies
|
|
62
|
+
|
|
63
|
+
`createNotebook()` accepts `dependencies` so agent code can declare packages
|
|
64
|
+
up-front instead of failing the first import and retrying after `addUvDependency()`.
|
|
65
|
+
The `packageManager` option is typed from the native binding's `PackageManager`
|
|
66
|
+
string enum (`"uv"`, `"conda"`, or `"pixi"`) and is converted to the shared
|
|
67
|
+
notebook protocol enum before the daemon handshake. `description` can be used
|
|
68
|
+
as a human-readable peer label for agent-created sessions.
|
|
69
|
+
|
|
48
70
|
## API Surface
|
|
49
71
|
|
|
50
72
|
- `defaultSocketPath()` returns the socket path for the current nteract channel
|
|
51
73
|
or the `RUNTIMED_SOCKET_PATH` override.
|
|
52
74
|
- `socketPathForChannel("stable" | "nightly")` returns a channel-specific
|
|
53
75
|
daemon socket path.
|
|
54
|
-
- `
|
|
55
|
-
- `
|
|
76
|
+
- `listActiveNotebooks(options)` lists active daemon notebook rooms.
|
|
77
|
+
- `createNotebook(options)` creates a notebook and records optional first-call dependencies.
|
|
78
|
+
- `openNotebook(notebookId, options)` connects to an existing daemon notebook.
|
|
79
|
+
- `openNotebookPath(path, options)` opens a notebook file through the daemon.
|
|
80
|
+
- `showNotebook(options)` opens an active notebook or path in nteract Desktop,
|
|
81
|
+
returning a structured `opened: false` response in headless environments.
|
|
82
|
+
- `shutdownNotebook(notebookId, options)` shuts down a notebook room by ID.
|
|
56
83
|
- `getExecutionResult(executionId, options)` reads a result by execution ID.
|
|
84
|
+
- `Session.listCells()` and `Session.getCell(cellId)` inspect notebook cells.
|
|
85
|
+
- `Session.createCell(source, options)`, `Session.setCell(cellId, options)`,
|
|
86
|
+
`Session.deleteCell(cellId)`, and `Session.moveCell(cellId, options)` provide
|
|
87
|
+
direct notebook editing without MCP JSON round-trips.
|
|
88
|
+
- `Session.executeCell(cellId, options)` runs an existing code cell.
|
|
89
|
+
- `Session.showNotebook()` opens the session in nteract Desktop when a display
|
|
90
|
+
is available.
|
|
91
|
+
- `Session.interruptKernel()`, `Session.shutdownKernel()`, and
|
|
92
|
+
`Session.restartKernel()` manage the running kernel.
|
|
93
|
+
- `Session.shutdownNotebook()` shuts down this notebook room and closes the session.
|
|
57
94
|
- `Session.runCell(source, options)` creates, runs, and waits for a cell.
|
|
58
95
|
- `Session.queueCell(source, options)` queues a cell and returns IDs.
|
|
59
96
|
- `Session.waitForExecution(executionId, options)` waits for queued work.
|
|
97
|
+
- `Session.addDependency(spec, { packageManager })` /
|
|
98
|
+
`Session.addDependencies(specs, { packageManager })` and
|
|
99
|
+
`Session.removeDependency(spec, { packageManager })` /
|
|
100
|
+
`Session.removeDependencies(specs, { packageManager })` edit notebook
|
|
101
|
+
dependency metadata for UV, Conda, or Pixi. Batch variants use one CRDT
|
|
102
|
+
metadata transaction.
|
|
103
|
+
- `Session.getDependencyStatus()` returns dependency metadata, fingerprint, and
|
|
104
|
+
trust state in one call.
|
|
105
|
+
- `Session.getRuntimeStatus()` returns kernel lifecycle, activity, env source,
|
|
106
|
+
and startup error details.
|
|
60
107
|
- `Session.addUvDependency(spec)` records a UV dependency for the notebook.
|
|
61
108
|
- `Session.syncEnvironment()` installs recorded notebook dependencies.
|
|
62
109
|
- `Session.saveNotebook(path?)` saves the notebook.
|
|
@@ -74,6 +121,22 @@ cargo xtask dev-daemon
|
|
|
74
121
|
Published nteract desktop builds manage their own daemon. Set
|
|
75
122
|
`RUNTIMED_SOCKET_PATH` when you need to connect to a specific daemon instance.
|
|
76
123
|
|
|
124
|
+
## Development Smoke Test
|
|
125
|
+
|
|
126
|
+
After building the native binding, run the daemon-backed API smoke test with:
|
|
127
|
+
|
|
128
|
+
```bash
|
|
129
|
+
RUNTIMED_SOCKET_PATH=/path/to/runtimed.sock pnpm --dir packages/runtimed-node smoke:api
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
When testing an out-of-tree N-API build, point the smoke script at it:
|
|
133
|
+
|
|
134
|
+
```bash
|
|
135
|
+
RUNTIMED_NODE_SMOKE_MODULE=/tmp/runtimed-node-napi-check/index.cjs \
|
|
136
|
+
RUNTIMED_SOCKET_PATH=/path/to/runtimed.sock \
|
|
137
|
+
pnpm --dir packages/runtimed-node smoke:api
|
|
138
|
+
```
|
|
139
|
+
|
|
77
140
|
## Platform Packages
|
|
78
141
|
|
|
79
142
|
The platform packages are implementation details and should normally be
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@runtimed/node",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Node.js bindings for controlling nteract runtimed notebooks and Python kernels.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "BSD-3-Clause",
|
|
@@ -47,9 +47,9 @@
|
|
|
47
47
|
]
|
|
48
48
|
},
|
|
49
49
|
"optionalDependencies": {
|
|
50
|
-
"@runtimed/node-
|
|
51
|
-
"@runtimed/node-
|
|
52
|
-
"@runtimed/node-win32-x64-msvc": "0.
|
|
50
|
+
"@runtimed/node-linux-x64-gnu": "0.2.0",
|
|
51
|
+
"@runtimed/node-darwin-arm64": "0.2.0",
|
|
52
|
+
"@runtimed/node-win32-x64-msvc": "0.2.0"
|
|
53
53
|
},
|
|
54
54
|
"publishConfig": {
|
|
55
55
|
"access": "public"
|
|
@@ -63,6 +63,7 @@
|
|
|
63
63
|
"build:debug": "napi build --platform --js binding.cjs --dts binding.d.ts --manifest-path ../../crates/runtimed-node/Cargo.toml --output-dir src",
|
|
64
64
|
"pack:platform:dry-run": "node scripts/assemble-platform-package.mjs --pack-dry-run",
|
|
65
65
|
"pack:dry-run": "pnpm pack --dry-run",
|
|
66
|
-
"smoke": "node -e \"const m = require('./src/index.cjs'); console.log('defaultSocketPath:', m.defaultSocketPath());\""
|
|
66
|
+
"smoke": "node -e \"const m = require('./src/index.cjs'); console.log('defaultSocketPath:', m.defaultSocketPath());\"",
|
|
67
|
+
"smoke:api": "node scripts/smoke-api.cjs"
|
|
67
68
|
}
|
|
68
69
|
}
|
package/src/binding.cjs
CHANGED
|
@@ -77,8 +77,8 @@ function requireNative() {
|
|
|
77
77
|
try {
|
|
78
78
|
const binding = require('@runtimed/node-android-arm64')
|
|
79
79
|
const bindingPackageVersion = require('@runtimed/node-android-arm64/package.json').version
|
|
80
|
-
if (bindingPackageVersion !== '0.
|
|
81
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
80
|
+
if (bindingPackageVersion !== '0.2.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
81
|
+
throw new Error(`Native binding package version mismatch, expected 0.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
82
82
|
}
|
|
83
83
|
return binding
|
|
84
84
|
} catch (e) {
|
|
@@ -93,8 +93,8 @@ function requireNative() {
|
|
|
93
93
|
try {
|
|
94
94
|
const binding = require('@runtimed/node-android-arm-eabi')
|
|
95
95
|
const bindingPackageVersion = require('@runtimed/node-android-arm-eabi/package.json').version
|
|
96
|
-
if (bindingPackageVersion !== '0.
|
|
97
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
96
|
+
if (bindingPackageVersion !== '0.2.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
97
|
+
throw new Error(`Native binding package version mismatch, expected 0.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
98
98
|
}
|
|
99
99
|
return binding
|
|
100
100
|
} catch (e) {
|
|
@@ -114,8 +114,8 @@ function requireNative() {
|
|
|
114
114
|
try {
|
|
115
115
|
const binding = require('@runtimed/node-win32-x64-gnu')
|
|
116
116
|
const bindingPackageVersion = require('@runtimed/node-win32-x64-gnu/package.json').version
|
|
117
|
-
if (bindingPackageVersion !== '0.
|
|
118
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
117
|
+
if (bindingPackageVersion !== '0.2.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
118
|
+
throw new Error(`Native binding package version mismatch, expected 0.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
119
119
|
}
|
|
120
120
|
return binding
|
|
121
121
|
} catch (e) {
|
|
@@ -130,8 +130,8 @@ function requireNative() {
|
|
|
130
130
|
try {
|
|
131
131
|
const binding = require('@runtimed/node-win32-x64-msvc')
|
|
132
132
|
const bindingPackageVersion = require('@runtimed/node-win32-x64-msvc/package.json').version
|
|
133
|
-
if (bindingPackageVersion !== '0.
|
|
134
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
133
|
+
if (bindingPackageVersion !== '0.2.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
134
|
+
throw new Error(`Native binding package version mismatch, expected 0.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
135
135
|
}
|
|
136
136
|
return binding
|
|
137
137
|
} catch (e) {
|
|
@@ -147,8 +147,8 @@ function requireNative() {
|
|
|
147
147
|
try {
|
|
148
148
|
const binding = require('@runtimed/node-win32-ia32-msvc')
|
|
149
149
|
const bindingPackageVersion = require('@runtimed/node-win32-ia32-msvc/package.json').version
|
|
150
|
-
if (bindingPackageVersion !== '0.
|
|
151
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
150
|
+
if (bindingPackageVersion !== '0.2.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
151
|
+
throw new Error(`Native binding package version mismatch, expected 0.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
152
152
|
}
|
|
153
153
|
return binding
|
|
154
154
|
} catch (e) {
|
|
@@ -163,8 +163,8 @@ function requireNative() {
|
|
|
163
163
|
try {
|
|
164
164
|
const binding = require('@runtimed/node-win32-arm64-msvc')
|
|
165
165
|
const bindingPackageVersion = require('@runtimed/node-win32-arm64-msvc/package.json').version
|
|
166
|
-
if (bindingPackageVersion !== '0.
|
|
167
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
166
|
+
if (bindingPackageVersion !== '0.2.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
167
|
+
throw new Error(`Native binding package version mismatch, expected 0.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
168
168
|
}
|
|
169
169
|
return binding
|
|
170
170
|
} catch (e) {
|
|
@@ -182,8 +182,8 @@ function requireNative() {
|
|
|
182
182
|
try {
|
|
183
183
|
const binding = require('@runtimed/node-darwin-universal')
|
|
184
184
|
const bindingPackageVersion = require('@runtimed/node-darwin-universal/package.json').version
|
|
185
|
-
if (bindingPackageVersion !== '0.
|
|
186
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
185
|
+
if (bindingPackageVersion !== '0.2.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
186
|
+
throw new Error(`Native binding package version mismatch, expected 0.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
187
187
|
}
|
|
188
188
|
return binding
|
|
189
189
|
} catch (e) {
|
|
@@ -198,8 +198,8 @@ function requireNative() {
|
|
|
198
198
|
try {
|
|
199
199
|
const binding = require('@runtimed/node-darwin-x64')
|
|
200
200
|
const bindingPackageVersion = require('@runtimed/node-darwin-x64/package.json').version
|
|
201
|
-
if (bindingPackageVersion !== '0.
|
|
202
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
201
|
+
if (bindingPackageVersion !== '0.2.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
202
|
+
throw new Error(`Native binding package version mismatch, expected 0.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
203
203
|
}
|
|
204
204
|
return binding
|
|
205
205
|
} catch (e) {
|
|
@@ -214,8 +214,8 @@ function requireNative() {
|
|
|
214
214
|
try {
|
|
215
215
|
const binding = require('@runtimed/node-darwin-arm64')
|
|
216
216
|
const bindingPackageVersion = require('@runtimed/node-darwin-arm64/package.json').version
|
|
217
|
-
if (bindingPackageVersion !== '0.
|
|
218
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
217
|
+
if (bindingPackageVersion !== '0.2.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
218
|
+
throw new Error(`Native binding package version mismatch, expected 0.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
219
219
|
}
|
|
220
220
|
return binding
|
|
221
221
|
} catch (e) {
|
|
@@ -234,8 +234,8 @@ function requireNative() {
|
|
|
234
234
|
try {
|
|
235
235
|
const binding = require('@runtimed/node-freebsd-x64')
|
|
236
236
|
const bindingPackageVersion = require('@runtimed/node-freebsd-x64/package.json').version
|
|
237
|
-
if (bindingPackageVersion !== '0.
|
|
238
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
237
|
+
if (bindingPackageVersion !== '0.2.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
238
|
+
throw new Error(`Native binding package version mismatch, expected 0.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
239
239
|
}
|
|
240
240
|
return binding
|
|
241
241
|
} catch (e) {
|
|
@@ -250,8 +250,8 @@ function requireNative() {
|
|
|
250
250
|
try {
|
|
251
251
|
const binding = require('@runtimed/node-freebsd-arm64')
|
|
252
252
|
const bindingPackageVersion = require('@runtimed/node-freebsd-arm64/package.json').version
|
|
253
|
-
if (bindingPackageVersion !== '0.
|
|
254
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
253
|
+
if (bindingPackageVersion !== '0.2.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
254
|
+
throw new Error(`Native binding package version mismatch, expected 0.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
255
255
|
}
|
|
256
256
|
return binding
|
|
257
257
|
} catch (e) {
|
|
@@ -271,8 +271,8 @@ function requireNative() {
|
|
|
271
271
|
try {
|
|
272
272
|
const binding = require('@runtimed/node-linux-x64-musl')
|
|
273
273
|
const bindingPackageVersion = require('@runtimed/node-linux-x64-musl/package.json').version
|
|
274
|
-
if (bindingPackageVersion !== '0.
|
|
275
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
274
|
+
if (bindingPackageVersion !== '0.2.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
275
|
+
throw new Error(`Native binding package version mismatch, expected 0.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
276
276
|
}
|
|
277
277
|
return binding
|
|
278
278
|
} catch (e) {
|
|
@@ -287,8 +287,8 @@ function requireNative() {
|
|
|
287
287
|
try {
|
|
288
288
|
const binding = require('@runtimed/node-linux-x64-gnu')
|
|
289
289
|
const bindingPackageVersion = require('@runtimed/node-linux-x64-gnu/package.json').version
|
|
290
|
-
if (bindingPackageVersion !== '0.
|
|
291
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
290
|
+
if (bindingPackageVersion !== '0.2.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
291
|
+
throw new Error(`Native binding package version mismatch, expected 0.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
292
292
|
}
|
|
293
293
|
return binding
|
|
294
294
|
} catch (e) {
|
|
@@ -305,8 +305,8 @@ function requireNative() {
|
|
|
305
305
|
try {
|
|
306
306
|
const binding = require('@runtimed/node-linux-arm64-musl')
|
|
307
307
|
const bindingPackageVersion = require('@runtimed/node-linux-arm64-musl/package.json').version
|
|
308
|
-
if (bindingPackageVersion !== '0.
|
|
309
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
308
|
+
if (bindingPackageVersion !== '0.2.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
309
|
+
throw new Error(`Native binding package version mismatch, expected 0.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
310
310
|
}
|
|
311
311
|
return binding
|
|
312
312
|
} catch (e) {
|
|
@@ -321,8 +321,8 @@ function requireNative() {
|
|
|
321
321
|
try {
|
|
322
322
|
const binding = require('@runtimed/node-linux-arm64-gnu')
|
|
323
323
|
const bindingPackageVersion = require('@runtimed/node-linux-arm64-gnu/package.json').version
|
|
324
|
-
if (bindingPackageVersion !== '0.
|
|
325
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
324
|
+
if (bindingPackageVersion !== '0.2.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
325
|
+
throw new Error(`Native binding package version mismatch, expected 0.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
326
326
|
}
|
|
327
327
|
return binding
|
|
328
328
|
} catch (e) {
|
|
@@ -339,8 +339,8 @@ function requireNative() {
|
|
|
339
339
|
try {
|
|
340
340
|
const binding = require('@runtimed/node-linux-arm-musleabihf')
|
|
341
341
|
const bindingPackageVersion = require('@runtimed/node-linux-arm-musleabihf/package.json').version
|
|
342
|
-
if (bindingPackageVersion !== '0.
|
|
343
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
342
|
+
if (bindingPackageVersion !== '0.2.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
343
|
+
throw new Error(`Native binding package version mismatch, expected 0.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
344
344
|
}
|
|
345
345
|
return binding
|
|
346
346
|
} catch (e) {
|
|
@@ -355,8 +355,8 @@ function requireNative() {
|
|
|
355
355
|
try {
|
|
356
356
|
const binding = require('@runtimed/node-linux-arm-gnueabihf')
|
|
357
357
|
const bindingPackageVersion = require('@runtimed/node-linux-arm-gnueabihf/package.json').version
|
|
358
|
-
if (bindingPackageVersion !== '0.
|
|
359
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
358
|
+
if (bindingPackageVersion !== '0.2.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
359
|
+
throw new Error(`Native binding package version mismatch, expected 0.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
360
360
|
}
|
|
361
361
|
return binding
|
|
362
362
|
} catch (e) {
|
|
@@ -373,8 +373,8 @@ function requireNative() {
|
|
|
373
373
|
try {
|
|
374
374
|
const binding = require('@runtimed/node-linux-loong64-musl')
|
|
375
375
|
const bindingPackageVersion = require('@runtimed/node-linux-loong64-musl/package.json').version
|
|
376
|
-
if (bindingPackageVersion !== '0.
|
|
377
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
376
|
+
if (bindingPackageVersion !== '0.2.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
377
|
+
throw new Error(`Native binding package version mismatch, expected 0.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
378
378
|
}
|
|
379
379
|
return binding
|
|
380
380
|
} catch (e) {
|
|
@@ -389,8 +389,8 @@ function requireNative() {
|
|
|
389
389
|
try {
|
|
390
390
|
const binding = require('@runtimed/node-linux-loong64-gnu')
|
|
391
391
|
const bindingPackageVersion = require('@runtimed/node-linux-loong64-gnu/package.json').version
|
|
392
|
-
if (bindingPackageVersion !== '0.
|
|
393
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
392
|
+
if (bindingPackageVersion !== '0.2.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
393
|
+
throw new Error(`Native binding package version mismatch, expected 0.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
394
394
|
}
|
|
395
395
|
return binding
|
|
396
396
|
} catch (e) {
|
|
@@ -407,8 +407,8 @@ function requireNative() {
|
|
|
407
407
|
try {
|
|
408
408
|
const binding = require('@runtimed/node-linux-riscv64-musl')
|
|
409
409
|
const bindingPackageVersion = require('@runtimed/node-linux-riscv64-musl/package.json').version
|
|
410
|
-
if (bindingPackageVersion !== '0.
|
|
411
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
410
|
+
if (bindingPackageVersion !== '0.2.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
411
|
+
throw new Error(`Native binding package version mismatch, expected 0.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
412
412
|
}
|
|
413
413
|
return binding
|
|
414
414
|
} catch (e) {
|
|
@@ -423,8 +423,8 @@ function requireNative() {
|
|
|
423
423
|
try {
|
|
424
424
|
const binding = require('@runtimed/node-linux-riscv64-gnu')
|
|
425
425
|
const bindingPackageVersion = require('@runtimed/node-linux-riscv64-gnu/package.json').version
|
|
426
|
-
if (bindingPackageVersion !== '0.
|
|
427
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
426
|
+
if (bindingPackageVersion !== '0.2.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
427
|
+
throw new Error(`Native binding package version mismatch, expected 0.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
428
428
|
}
|
|
429
429
|
return binding
|
|
430
430
|
} catch (e) {
|
|
@@ -440,8 +440,8 @@ function requireNative() {
|
|
|
440
440
|
try {
|
|
441
441
|
const binding = require('@runtimed/node-linux-ppc64-gnu')
|
|
442
442
|
const bindingPackageVersion = require('@runtimed/node-linux-ppc64-gnu/package.json').version
|
|
443
|
-
if (bindingPackageVersion !== '0.
|
|
444
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
443
|
+
if (bindingPackageVersion !== '0.2.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
444
|
+
throw new Error(`Native binding package version mismatch, expected 0.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
445
445
|
}
|
|
446
446
|
return binding
|
|
447
447
|
} catch (e) {
|
|
@@ -456,8 +456,8 @@ function requireNative() {
|
|
|
456
456
|
try {
|
|
457
457
|
const binding = require('@runtimed/node-linux-s390x-gnu')
|
|
458
458
|
const bindingPackageVersion = require('@runtimed/node-linux-s390x-gnu/package.json').version
|
|
459
|
-
if (bindingPackageVersion !== '0.
|
|
460
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
459
|
+
if (bindingPackageVersion !== '0.2.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
460
|
+
throw new Error(`Native binding package version mismatch, expected 0.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
461
461
|
}
|
|
462
462
|
return binding
|
|
463
463
|
} catch (e) {
|
|
@@ -476,8 +476,8 @@ function requireNative() {
|
|
|
476
476
|
try {
|
|
477
477
|
const binding = require('@runtimed/node-openharmony-arm64')
|
|
478
478
|
const bindingPackageVersion = require('@runtimed/node-openharmony-arm64/package.json').version
|
|
479
|
-
if (bindingPackageVersion !== '0.
|
|
480
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
479
|
+
if (bindingPackageVersion !== '0.2.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
480
|
+
throw new Error(`Native binding package version mismatch, expected 0.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
481
481
|
}
|
|
482
482
|
return binding
|
|
483
483
|
} catch (e) {
|
|
@@ -492,8 +492,8 @@ function requireNative() {
|
|
|
492
492
|
try {
|
|
493
493
|
const binding = require('@runtimed/node-openharmony-x64')
|
|
494
494
|
const bindingPackageVersion = require('@runtimed/node-openharmony-x64/package.json').version
|
|
495
|
-
if (bindingPackageVersion !== '0.
|
|
496
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
495
|
+
if (bindingPackageVersion !== '0.2.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
496
|
+
throw new Error(`Native binding package version mismatch, expected 0.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
497
497
|
}
|
|
498
498
|
return binding
|
|
499
499
|
} catch (e) {
|
|
@@ -508,8 +508,8 @@ function requireNative() {
|
|
|
508
508
|
try {
|
|
509
509
|
const binding = require('@runtimed/node-openharmony-arm')
|
|
510
510
|
const bindingPackageVersion = require('@runtimed/node-openharmony-arm/package.json').version
|
|
511
|
-
if (bindingPackageVersion !== '0.
|
|
512
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
511
|
+
if (bindingPackageVersion !== '0.2.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
512
|
+
throw new Error(`Native binding package version mismatch, expected 0.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
513
513
|
}
|
|
514
514
|
return binding
|
|
515
515
|
} catch (e) {
|
|
@@ -580,7 +580,12 @@ module.exports.Session = nativeBinding.Session
|
|
|
580
580
|
module.exports.createNotebook = nativeBinding.createNotebook
|
|
581
581
|
module.exports.defaultSocketPath = nativeBinding.defaultSocketPath
|
|
582
582
|
module.exports.getExecutionResult = nativeBinding.getExecutionResult
|
|
583
|
+
module.exports.listActiveNotebooks = nativeBinding.listActiveNotebooks
|
|
583
584
|
module.exports.openNotebook = nativeBinding.openNotebook
|
|
585
|
+
module.exports.openNotebookPath = nativeBinding.openNotebookPath
|
|
586
|
+
module.exports.PackageManager = nativeBinding.PackageManager
|
|
584
587
|
module.exports.readParquetFile = nativeBinding.readParquetFile
|
|
588
|
+
module.exports.showNotebook = nativeBinding.showNotebook
|
|
589
|
+
module.exports.shutdownNotebook = nativeBinding.shutdownNotebook
|
|
585
590
|
module.exports.socketPathForChannel = nativeBinding.socketPathForChannel
|
|
586
591
|
module.exports.summarizeParquetFile = nativeBinding.summarizeParquetFile
|
package/src/binding.d.ts
CHANGED
|
@@ -11,11 +11,35 @@ export declare class Session {
|
|
|
11
11
|
saveNotebook(path?: string | undefined | null): Promise<void>
|
|
12
12
|
/** Close the session and release the underlying connection. */
|
|
13
13
|
close(): Promise<void>
|
|
14
|
+
/**
|
|
15
|
+
* Add dependencies to the selected package manager (defaults to UV) in one CRDT transaction.
|
|
16
|
+
* Call `syncEnvironment()` or restart the kernel to install them.
|
|
17
|
+
*/
|
|
18
|
+
addDependencies(packages: Array<string>, options?: DependencyEditOptions | undefined | null): Promise<void>
|
|
19
|
+
/**
|
|
20
|
+
* Add a dependency to the selected package manager (defaults to UV).
|
|
21
|
+
* Call `syncEnvironment()` or restart the kernel to install it.
|
|
22
|
+
*/
|
|
23
|
+
addDependency(pkg: string, options?: DependencyEditOptions | undefined | null): Promise<void>
|
|
24
|
+
/**
|
|
25
|
+
* Remove dependencies from the selected package manager (defaults to UV) in one CRDT transaction.
|
|
26
|
+
* Returns the number of dependencies removed.
|
|
27
|
+
*/
|
|
28
|
+
removeDependencies(packages: Array<string>, options?: DependencyEditOptions | undefined | null): Promise<number>
|
|
29
|
+
/**
|
|
30
|
+
* Remove a dependency from the selected package manager (defaults to UV).
|
|
31
|
+
* Returns true if a dependency was removed.
|
|
32
|
+
*/
|
|
33
|
+
removeDependency(pkg: string, options?: DependencyEditOptions | undefined | null): Promise<boolean>
|
|
14
34
|
/**
|
|
15
35
|
* Add a UV dependency to the notebook (e.g. `"matplotlib>=3.8"`).
|
|
16
36
|
* Call `syncEnvironment()` or restart the kernel to install it.
|
|
17
37
|
*/
|
|
18
38
|
addUvDependency(pkg: string): Promise<void>
|
|
39
|
+
/** Get runtime/kernel state, including lifecycle error details. */
|
|
40
|
+
getRuntimeStatus(): Promise<RuntimeStatus>
|
|
41
|
+
/** Get dependency metadata, fingerprint, and current trust state. */
|
|
42
|
+
getDependencyStatus(): Promise<DependencyStatus>
|
|
19
43
|
/** Get the current dependency fingerprint for diagnostics. */
|
|
20
44
|
dependencyFingerprint(): Promise<string | null>
|
|
21
45
|
/** Approve and sign the current dependency metadata. */
|
|
@@ -26,6 +50,23 @@ export declare class Session {
|
|
|
26
50
|
* Returns once the install finishes.
|
|
27
51
|
*/
|
|
28
52
|
syncEnvironment(): Promise<void>
|
|
53
|
+
/** Return all cells in notebook order. */
|
|
54
|
+
listCells(): Promise<Array<JsCellSnapshot>>
|
|
55
|
+
/** Return one cell by ID, or null if it does not exist. */
|
|
56
|
+
getCell(cellId: string): Promise<JsCellSnapshot | null>
|
|
57
|
+
/** Create a cell without executing it. Returns the new cell ID. */
|
|
58
|
+
createCell(source: string, options?: CreateCellOptions | undefined | null): Promise<string>
|
|
59
|
+
/** Replace a cell's source and/or type. Returns true if the cell existed. */
|
|
60
|
+
setCell(cellId: string, options: SetCellOptions): Promise<boolean>
|
|
61
|
+
/** Delete a cell. Returns true if the cell existed. */
|
|
62
|
+
deleteCell(cellId: string): Promise<boolean>
|
|
63
|
+
/**
|
|
64
|
+
* Move a cell after another cell, or to the beginning when omitted/null.
|
|
65
|
+
* Returns the new position string.
|
|
66
|
+
*/
|
|
67
|
+
moveCell(cellId: string, options?: MoveCellOptions | undefined | null): Promise<string>
|
|
68
|
+
/** Execute an existing code cell and wait for terminal outputs. */
|
|
69
|
+
executeCell(cellId: string, options?: ExecuteCellOptions | undefined | null): Promise<CellResult>
|
|
29
70
|
/**
|
|
30
71
|
* Execute a source string as a new cell. Starts the kernel on demand.
|
|
31
72
|
* Returns the cell's outputs once execution is terminal.
|
|
@@ -33,10 +74,36 @@ export declare class Session {
|
|
|
33
74
|
runCell(source: string, options?: RunCellOptions | undefined | null): Promise<CellResult>
|
|
34
75
|
/** Queue a source string as a new cell without waiting for execution. */
|
|
35
76
|
queueCell(source: string, options?: QueueCellOptions | undefined | null): Promise<QueuedExecution>
|
|
77
|
+
/** Interrupt the currently executing cell. */
|
|
78
|
+
interruptKernel(): Promise<boolean>
|
|
79
|
+
/** Shutdown the running kernel. Returns false when no kernel is running. */
|
|
80
|
+
shutdownKernel(): Promise<boolean>
|
|
81
|
+
/** Restart the kernel, clearing in-memory state while preserving notebook dependencies. */
|
|
82
|
+
restartKernel(): Promise<boolean>
|
|
83
|
+
/** Shutdown this notebook's kernel and evict its daemon room. */
|
|
84
|
+
shutdownNotebook(): Promise<boolean>
|
|
85
|
+
/**
|
|
86
|
+
* Open this notebook in nteract Desktop. In headless environments, returns
|
|
87
|
+
* `opened: false` with a reason instead of failing.
|
|
88
|
+
*/
|
|
89
|
+
showNotebook(): Promise<ShowNotebookResult>
|
|
36
90
|
/** Wait for an already-queued execution in this live session. */
|
|
37
91
|
waitForExecution(executionId: string, options?: WaitExecutionOptions | undefined | null): Promise<CellResult>
|
|
38
92
|
}
|
|
39
93
|
|
|
94
|
+
/** An active notebook room reported by the daemon. */
|
|
95
|
+
export interface ActiveNotebook {
|
|
96
|
+
notebookId: string
|
|
97
|
+
activePeers: number
|
|
98
|
+
hadPeers: boolean
|
|
99
|
+
hasKernel: boolean
|
|
100
|
+
kernelType?: string
|
|
101
|
+
envSource?: string
|
|
102
|
+
kernelStatus?: string
|
|
103
|
+
ephemeral: boolean
|
|
104
|
+
notebookPath?: string
|
|
105
|
+
}
|
|
106
|
+
|
|
40
107
|
/** Result of running a cell. */
|
|
41
108
|
export interface CellResult {
|
|
42
109
|
cellId: string
|
|
@@ -48,6 +115,21 @@ export interface CellResult {
|
|
|
48
115
|
outputs: Array<JsOutput>
|
|
49
116
|
}
|
|
50
117
|
|
|
118
|
+
/** Conda dependency metadata. */
|
|
119
|
+
export interface CondaDependencyStatus {
|
|
120
|
+
dependencies: Array<string>
|
|
121
|
+
channels: Array<string>
|
|
122
|
+
python?: string
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
/** Options for `Session.createCell()`. */
|
|
126
|
+
export interface CreateCellOptions {
|
|
127
|
+
/** Cell source type: `"code"` (default), `"markdown"`, or `"raw"`. */
|
|
128
|
+
cellType?: string
|
|
129
|
+
/** Insert after this cell, or omit to insert at the beginning. */
|
|
130
|
+
afterCellId?: string
|
|
131
|
+
}
|
|
132
|
+
|
|
51
133
|
/** Create a new (ephemeral) notebook against the daemon. */
|
|
52
134
|
export declare function createNotebook(options?: CreateNotebookOptions | undefined | null): Promise<Session>
|
|
53
135
|
|
|
@@ -61,6 +143,16 @@ export interface CreateNotebookOptions {
|
|
|
61
143
|
socketPath?: string
|
|
62
144
|
/** Actor label for presence / Automerge provenance. */
|
|
63
145
|
peerLabel?: string
|
|
146
|
+
/** Human-readable session description. Used as the peer label when `peerLabel` is omitted. */
|
|
147
|
+
description?: string
|
|
148
|
+
/**
|
|
149
|
+
* Packages to record before the kernel starts (for example `["numpy", "matplotlib"]`).
|
|
150
|
+
* Python notebooks use the selected package manager; Deno notebooks treat these as
|
|
151
|
+
* runtime-native import dependencies.
|
|
152
|
+
*/
|
|
153
|
+
dependencies?: Array<string>
|
|
154
|
+
/** Package manager for Python dependencies. Defaults to the daemon/user setting. */
|
|
155
|
+
packageManager?: PackageManager
|
|
64
156
|
}
|
|
65
157
|
|
|
66
158
|
/**
|
|
@@ -71,6 +163,37 @@ export interface CreateNotebookOptions {
|
|
|
71
163
|
*/
|
|
72
164
|
export declare function defaultSocketPath(): string
|
|
73
165
|
|
|
166
|
+
/** Options for dependency edit methods. */
|
|
167
|
+
export interface DependencyEditOptions {
|
|
168
|
+
/** Dependency manager to edit. Defaults to `uv` for Python notebooks. */
|
|
169
|
+
packageManager?: PackageManager
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
/** Notebook dependency metadata and trust/runtime status. */
|
|
173
|
+
export interface DependencyStatus {
|
|
174
|
+
uv?: UvDependencyStatus
|
|
175
|
+
conda?: CondaDependencyStatus
|
|
176
|
+
pixi?: PixiDependencyStatus
|
|
177
|
+
fingerprint?: string
|
|
178
|
+
trust: DependencyTrustStatus
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
/** Notebook trust state for dependency metadata. */
|
|
182
|
+
export interface DependencyTrustStatus {
|
|
183
|
+
status?: string
|
|
184
|
+
needsApproval?: boolean
|
|
185
|
+
approvedUvDependencies: Array<string>
|
|
186
|
+
approvedCondaDependencies: Array<string>
|
|
187
|
+
approvedPixiDependencies: Array<string>
|
|
188
|
+
approvedPixiPypiDependencies: Array<string>
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
/** Options for `Session.executeCell()`. */
|
|
192
|
+
export interface ExecuteCellOptions {
|
|
193
|
+
/** Max milliseconds to wait for execution. Default 120_000 (2 min). */
|
|
194
|
+
timeoutMs?: number
|
|
195
|
+
}
|
|
196
|
+
|
|
74
197
|
/** Read a terminal execution result from the daemon's durable execution store. */
|
|
75
198
|
export declare function getExecutionResult(executionId: string, options?: GetExecutionResultOptions | undefined | null): Promise<CellResult>
|
|
76
199
|
|
|
@@ -80,6 +203,18 @@ export interface GetExecutionResultOptions {
|
|
|
80
203
|
socketPath?: string
|
|
81
204
|
}
|
|
82
205
|
|
|
206
|
+
/** A notebook cell snapshot. */
|
|
207
|
+
export interface JsCellSnapshot {
|
|
208
|
+
id: string
|
|
209
|
+
cellType: string
|
|
210
|
+
position: string
|
|
211
|
+
source: string
|
|
212
|
+
/** JSON-encoded metadata object. */
|
|
213
|
+
metadataJson: string
|
|
214
|
+
/** Legacy execution count as stored in the notebook doc. */
|
|
215
|
+
executionCount?: string
|
|
216
|
+
}
|
|
217
|
+
|
|
83
218
|
/** One output from a cell. `data` values are: `{ type: "text"|"binary"|"json", value: ... }`. */
|
|
84
219
|
export interface JsOutput {
|
|
85
220
|
outputType: string
|
|
@@ -95,13 +230,47 @@ export interface JsOutput {
|
|
|
95
230
|
blobPathsJson?: string
|
|
96
231
|
}
|
|
97
232
|
|
|
233
|
+
/** List active notebook rooms from the daemon. */
|
|
234
|
+
export declare function listActiveNotebooks(options?: ListActiveNotebooksOptions | undefined | null): Promise<Array<ActiveNotebook>>
|
|
235
|
+
|
|
236
|
+
/** Options for top-level `listActiveNotebooks()`. */
|
|
237
|
+
export interface ListActiveNotebooksOptions {
|
|
238
|
+
/** Override daemon socket path (otherwise uses `defaultSocketPath()`). */
|
|
239
|
+
socketPath?: string
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
/** Options for `Session.moveCell()`. */
|
|
243
|
+
export interface MoveCellOptions {
|
|
244
|
+
/** Move after this cell, or omit/null to move to the beginning. */
|
|
245
|
+
afterCellId?: string
|
|
246
|
+
}
|
|
247
|
+
|
|
98
248
|
/** Open an existing notebook by ID. */
|
|
99
249
|
export declare function openNotebook(notebookId: string, options?: OpenNotebookOptions | undefined | null): Promise<Session>
|
|
100
250
|
|
|
101
|
-
/** Options for `openNotebook()`. */
|
|
251
|
+
/** Options for `openNotebook()` and `openNotebookPath()`. */
|
|
102
252
|
export interface OpenNotebookOptions {
|
|
103
253
|
socketPath?: string
|
|
104
254
|
peerLabel?: string
|
|
255
|
+
/** Human-readable session description. Used as the peer label when `peerLabel` is omitted. */
|
|
256
|
+
description?: string
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
/** Open an existing notebook file by path. */
|
|
260
|
+
export declare function openNotebookPath(path: string, options?: OpenNotebookOptions | undefined | null): Promise<Session>
|
|
261
|
+
|
|
262
|
+
/**
|
|
263
|
+
* Package manager for Python notebook dependencies.
|
|
264
|
+
*
|
|
265
|
+
* This mirrors `notebook_protocol::connection::PackageManager` at the N-API
|
|
266
|
+
* boundary. We cannot attach `#[napi]` to the protocol crate's external enum,
|
|
267
|
+
* and that enum intentionally includes an `Unknown(String)` wire-compatibility
|
|
268
|
+
* variant that should not be exposed as a typed JavaScript option.
|
|
269
|
+
*/
|
|
270
|
+
export declare const enum PackageManager {
|
|
271
|
+
Uv = 'uv',
|
|
272
|
+
Conda = 'conda',
|
|
273
|
+
Pixi = 'pixi'
|
|
105
274
|
}
|
|
106
275
|
|
|
107
276
|
export interface ParquetColumnInfo {
|
|
@@ -128,6 +297,14 @@ export interface ParquetSummaryResult {
|
|
|
128
297
|
columns: Array<ParquetColumnInfo>
|
|
129
298
|
}
|
|
130
299
|
|
|
300
|
+
/** Pixi dependency metadata. */
|
|
301
|
+
export interface PixiDependencyStatus {
|
|
302
|
+
dependencies: Array<string>
|
|
303
|
+
pypiDependencies: Array<string>
|
|
304
|
+
channels: Array<string>
|
|
305
|
+
python?: string
|
|
306
|
+
}
|
|
307
|
+
|
|
131
308
|
/** Options for `Session.queueCell()`. */
|
|
132
309
|
export interface QueueCellOptions {
|
|
133
310
|
/** Cell source type: `"code"` (default), `"markdown"`, or `"raw"`. */
|
|
@@ -154,6 +331,62 @@ export interface RunCellOptions {
|
|
|
154
331
|
cellType?: string
|
|
155
332
|
}
|
|
156
333
|
|
|
334
|
+
/** Runtime/kernel status from RuntimeStateDoc. */
|
|
335
|
+
export interface RuntimeStatus {
|
|
336
|
+
status: string
|
|
337
|
+
lifecycle: string
|
|
338
|
+
activity?: string
|
|
339
|
+
startingPhase: string
|
|
340
|
+
name: string
|
|
341
|
+
language: string
|
|
342
|
+
envSource: string
|
|
343
|
+
runtimeAgentId: string
|
|
344
|
+
errorReason?: string
|
|
345
|
+
errorDetails?: string
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
/** Options for `Session.setCell()`. */
|
|
349
|
+
export interface SetCellOptions {
|
|
350
|
+
/** New source text. Omit to leave unchanged. */
|
|
351
|
+
source?: string
|
|
352
|
+
/** New cell source type. Omit to leave unchanged. */
|
|
353
|
+
cellType?: string
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
/**
|
|
357
|
+
* Open a notebook in nteract Desktop by active notebook ID or file path.
|
|
358
|
+
* In headless environments, returns `opened: false` with a reason instead of failing.
|
|
359
|
+
*/
|
|
360
|
+
export declare function showNotebook(options?: ShowNotebookOptions | undefined | null): Promise<ShowNotebookResult>
|
|
361
|
+
|
|
362
|
+
/** Options for top-level `showNotebook()`. */
|
|
363
|
+
export interface ShowNotebookOptions {
|
|
364
|
+
/** Override daemon socket path (otherwise uses `defaultSocketPath()`). */
|
|
365
|
+
socketPath?: string
|
|
366
|
+
/** Active notebook UUID to open in the app. */
|
|
367
|
+
notebookId?: string
|
|
368
|
+
/** File path to open in the app. If both path and notebookId are provided, path wins. */
|
|
369
|
+
path?: string
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
/** Result of asking nteract Desktop to show a notebook. */
|
|
373
|
+
export interface ShowNotebookResult {
|
|
374
|
+
notebookId?: string
|
|
375
|
+
path?: string
|
|
376
|
+
opened: boolean
|
|
377
|
+
reason?: string
|
|
378
|
+
warning?: string
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
/** Shutdown a notebook's kernel and evict its daemon room by notebook ID. */
|
|
382
|
+
export declare function shutdownNotebook(notebookId: string, options?: ShutdownNotebookOptions | undefined | null): Promise<boolean>
|
|
383
|
+
|
|
384
|
+
/** Options for top-level `shutdownNotebook()`. */
|
|
385
|
+
export interface ShutdownNotebookOptions {
|
|
386
|
+
/** Override daemon socket path (otherwise uses `defaultSocketPath()`). */
|
|
387
|
+
socketPath?: string
|
|
388
|
+
}
|
|
389
|
+
|
|
157
390
|
/**
|
|
158
391
|
* Return the daemon socket path for a specific channel ("stable" or
|
|
159
392
|
* "nightly"). Ignores `RUNTIMED_SOCKET_PATH`.
|
|
@@ -163,6 +396,12 @@ export declare function socketPathForChannel(channel: string): string
|
|
|
163
396
|
/** Summarize a parquet file from a local blob/file path. */
|
|
164
397
|
export declare function summarizeParquetFile(filePath: string): ParquetSummaryResult
|
|
165
398
|
|
|
399
|
+
/** UV dependency metadata. */
|
|
400
|
+
export interface UvDependencyStatus {
|
|
401
|
+
dependencies: Array<string>
|
|
402
|
+
requiresPython?: string
|
|
403
|
+
}
|
|
404
|
+
|
|
166
405
|
/** Options for `Session.waitForExecution()`. */
|
|
167
406
|
export interface WaitExecutionOptions {
|
|
168
407
|
/** Cell ID to use when reporting kernel failures before terminal state syncs. */
|