nebula-notebook-mcp 0.2.0 → 0.3.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/bin/nebula +5 -0
- package/bin/nebula.js +4 -0
- package/dist/cli/compute.d.ts +11 -0
- package/dist/cli/compute.d.ts.map +1 -0
- package/dist/cli/compute.js +405 -0
- package/dist/cli/compute.js.map +1 -0
- package/dist/cli/index.d.ts +12 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +87 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/kernel.d.ts +8 -0
- package/dist/cli/kernel.d.ts.map +1 -0
- package/dist/cli/kernel.js +102 -0
- package/dist/cli/kernel.js.map +1 -0
- package/dist/cli/nb.d.ts +8 -0
- package/dist/cli/nb.d.ts.map +1 -0
- package/dist/cli/nb.js +331 -0
- package/dist/cli/nb.js.map +1 -0
- package/dist/cli/run.d.ts +7 -0
- package/dist/cli/run.d.ts.map +1 -0
- package/dist/cli/run.js +120 -0
- package/dist/cli/run.js.map +1 -0
- package/dist/cli/session.d.ts +10 -0
- package/dist/cli/session.d.ts.map +1 -0
- package/dist/cli/session.js +111 -0
- package/dist/cli/session.js.map +1 -0
- package/dist/cli/shared.d.ts +67 -0
- package/dist/cli/shared.d.ts.map +1 -0
- package/dist/cli/shared.js +213 -0
- package/dist/cli/shared.js.map +1 -0
- package/dist/cli/skill.d.ts +12 -0
- package/dist/cli/skill.d.ts.map +1 -0
- package/dist/cli/skill.js +176 -0
- package/dist/cli/skill.js.map +1 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -2
- package/dist/index.js.map +1 -1
- package/dist/notebook/client.d.ts +126 -2
- package/dist/notebook/client.d.ts.map +1 -1
- package/dist/notebook/client.js +62 -3
- package/dist/notebook/client.js.map +1 -1
- package/dist/tools/compute.d.ts +62 -0
- package/dist/tools/compute.d.ts.map +1 -0
- package/dist/tools/compute.js +307 -0
- package/dist/tools/compute.js.map +1 -0
- package/dist/tools/files.js +1 -1
- package/dist/tools/files.js.map +1 -1
- package/dist/tools/index.d.ts +8 -0
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +6 -0
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/notebook.js +2 -2
- package/dist/tools/notebook.js.map +1 -1
- package/dist/types.d.ts +4 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/utils/imageResize.d.ts.map +1 -1
- package/dist/utils/imageResize.js +18 -1
- package/dist/utils/imageResize.js.map +1 -1
- package/package.json +3 -2
package/bin/nebula
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# Extensionless launcher so `nebula` resolves via PATH (e.g. in Nebula's
|
|
3
|
+
# built-in terminals, where this bin dir is prepended to PATH). npm installs
|
|
4
|
+
# get the name via the package.json bin map instead.
|
|
5
|
+
exec node "$(dirname "$0")/nebula.js" "$@"
|
package/bin/nebula.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `nebula compute …` — scheduler-backed compute allocations (HPC clusters).
|
|
3
|
+
*
|
|
4
|
+
* Detection-gated: servers without a scheduler (laptops, plain workstations)
|
|
5
|
+
* report enabled=false and every other subcommand fails fast with a clear
|
|
6
|
+
* message. Same AXI conventions as the rest of the CLI: --json/--quiet,
|
|
7
|
+
* one hint line, `--wait` FOLLOWS the allocation internally (the agent never
|
|
8
|
+
* writes its own poll loop — the process exiting is the signal).
|
|
9
|
+
*/
|
|
10
|
+
export declare function cmdCompute(argv: string[]): Promise<number>;
|
|
11
|
+
//# sourceMappingURL=compute.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compute.d.ts","sourceRoot":"","sources":["../../src/cli/compute.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AA+DH,wBAAsB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,CAuBhE"}
|
|
@@ -0,0 +1,405 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `nebula compute …` — scheduler-backed compute allocations (HPC clusters).
|
|
3
|
+
*
|
|
4
|
+
* Detection-gated: servers without a scheduler (laptops, plain workstations)
|
|
5
|
+
* report enabled=false and every other subcommand fails fast with a clear
|
|
6
|
+
* message. Same AXI conventions as the rest of the CLI: --json/--quiet,
|
|
7
|
+
* one hint line, `--wait` FOLLOWS the allocation internally (the agent never
|
|
8
|
+
* writes its own poll loop — the process exiting is the signal).
|
|
9
|
+
*/
|
|
10
|
+
import { CliError, EXIT, makeClient, parse, parseIntFlag, printHint, printJson, requirePositional, resolveUrl, toCliError, } from './shared.js';
|
|
11
|
+
const COMPUTE_HELP = `usage: nebula compute <status|queues|alloc|ls|use|cancel> …
|
|
12
|
+
|
|
13
|
+
Scheduler-backed compute (HPC clusters). Optional: servers without a
|
|
14
|
+
scheduler report "no scheduler on this server" — check status first.
|
|
15
|
+
|
|
16
|
+
compute status scheduler present? enabled?
|
|
17
|
+
compute queues partitions + QoS + idle CPUs/GPUs + backlog
|
|
18
|
+
compute alloc --partition P [...] request an allocation
|
|
19
|
+
[--qos Q] [--cpus N] [--mem GB] [--gpus N] [--gpu-type T]
|
|
20
|
+
[--walltime H] [--name NAME] [--idle-timeout MIN] [--wait] [--max-wait S]
|
|
21
|
+
--idle-timeout MIN auto-ends the allocation after MIN minutes with no
|
|
22
|
+
kernel or terminal activity (the node's server exits itself) — a safety
|
|
23
|
+
net against forgotten allocations; recommended for agent-created ones.
|
|
24
|
+
--wait BLOCKS until the allocation is active (internal polling; run it
|
|
25
|
+
as a background shell task for long queue waits). Exit 1 on failure,
|
|
26
|
+
exit 3 if --max-wait (default 3600s) expires while still queued.
|
|
27
|
+
compute ls list allocations
|
|
28
|
+
compute use <alloc-id|name> <notebook-path>
|
|
29
|
+
bind the notebook's kernels to the
|
|
30
|
+
allocation's server (must be active);
|
|
31
|
+
after this, nebula run executes there
|
|
32
|
+
compute cancel <id> cancel an allocation (frees the nodes)
|
|
33
|
+
|
|
34
|
+
Etiquette: allocations consume real cluster resources — request modest sizes,
|
|
35
|
+
cancel what you created when done, never cancel allocations you didn't create,
|
|
36
|
+
and add --idle-timeout 60 as a safety net in case you forget.
|
|
37
|
+
|
|
38
|
+
examples:
|
|
39
|
+
nebula compute queues
|
|
40
|
+
nebula compute alloc --partition gpu --gpus 1 --walltime 2 --idle-timeout 60 --wait
|
|
41
|
+
nebula compute use a1b2c3d4 analysis.ipynb
|
|
42
|
+
nebula compute cancel a1b2c3d4`;
|
|
43
|
+
/** --wait polling: starts quick, backs off to ~5s (same philosophy as nebula run). */
|
|
44
|
+
const POLL_START_MS = 1_000;
|
|
45
|
+
const POLL_MAX_MS = 5_000;
|
|
46
|
+
const TERMINAL_STATES = new Set(['ended', 'failed', 'cancelled']);
|
|
47
|
+
function sleep(ms) {
|
|
48
|
+
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
49
|
+
}
|
|
50
|
+
export async function cmdCompute(argv) {
|
|
51
|
+
const [sub, ...rest] = argv;
|
|
52
|
+
if (sub === undefined || sub === '--help' || sub === '-h') {
|
|
53
|
+
console.log(COMPUTE_HELP);
|
|
54
|
+
return sub === undefined ? EXIT.USAGE : EXIT.OK;
|
|
55
|
+
}
|
|
56
|
+
switch (sub) {
|
|
57
|
+
case 'status':
|
|
58
|
+
return computeStatus(rest);
|
|
59
|
+
case 'queues':
|
|
60
|
+
return computeQueues(rest);
|
|
61
|
+
case 'alloc':
|
|
62
|
+
return computeAlloc(rest);
|
|
63
|
+
case 'ls':
|
|
64
|
+
return computeLs(rest);
|
|
65
|
+
case 'use':
|
|
66
|
+
return computeUse(rest);
|
|
67
|
+
case 'cancel':
|
|
68
|
+
return computeCancel(rest);
|
|
69
|
+
default:
|
|
70
|
+
throw new CliError(`unknown compute subcommand: ${sub}`, EXIT.USAGE, "run 'nebula compute --help' for the list");
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
function noScheduler() {
|
|
74
|
+
return new CliError('no scheduler on this server — compute allocations are unavailable', EXIT.ERROR, 'kernels run directly on the server; check availability with: nebula compute status');
|
|
75
|
+
}
|
|
76
|
+
// =============================================================================
|
|
77
|
+
// compute status
|
|
78
|
+
// =============================================================================
|
|
79
|
+
async function computeStatus(argv) {
|
|
80
|
+
const { values } = parse(argv);
|
|
81
|
+
if (values.help) {
|
|
82
|
+
console.log(COMPUTE_HELP);
|
|
83
|
+
return EXIT.OK;
|
|
84
|
+
}
|
|
85
|
+
const client = makeClient(resolveUrl(values.url));
|
|
86
|
+
const result = await client.computeStatus();
|
|
87
|
+
if (!result.success)
|
|
88
|
+
throw toCliError(result.error);
|
|
89
|
+
const { enabled, scheduler } = result.data;
|
|
90
|
+
if (values.json) {
|
|
91
|
+
printJson(result.data);
|
|
92
|
+
return EXIT.OK;
|
|
93
|
+
}
|
|
94
|
+
console.log(`enabled: ${enabled}`);
|
|
95
|
+
console.log(`scheduler: ${scheduler ?? '-'}`);
|
|
96
|
+
if (enabled) {
|
|
97
|
+
printHint('see partitions and load with: nebula compute queues', values);
|
|
98
|
+
}
|
|
99
|
+
else {
|
|
100
|
+
printHint('no scheduler here — notebooks execute directly on this server', values);
|
|
101
|
+
}
|
|
102
|
+
return EXIT.OK;
|
|
103
|
+
}
|
|
104
|
+
// =============================================================================
|
|
105
|
+
// compute queues
|
|
106
|
+
// =============================================================================
|
|
107
|
+
function pad(s, w) {
|
|
108
|
+
return s.length >= w ? s : s + ' '.repeat(w - s.length);
|
|
109
|
+
}
|
|
110
|
+
function table(rows) {
|
|
111
|
+
if (rows.length === 0)
|
|
112
|
+
return [];
|
|
113
|
+
const widths = rows[0].map((_, col) => Math.max(...rows.map((r) => (r[col] ?? '').length)));
|
|
114
|
+
return rows.map((r) => r.map((cell, col) => pad(cell ?? '', widths[col])).join(' ').trimEnd());
|
|
115
|
+
}
|
|
116
|
+
async function computeQueues(argv) {
|
|
117
|
+
const { values } = parse(argv);
|
|
118
|
+
if (values.help) {
|
|
119
|
+
console.log(COMPUTE_HELP);
|
|
120
|
+
return EXIT.OK;
|
|
121
|
+
}
|
|
122
|
+
const client = makeClient(resolveUrl(values.url));
|
|
123
|
+
const result = await client.listPartitions();
|
|
124
|
+
if (!result.success)
|
|
125
|
+
throw toCliError(result.error);
|
|
126
|
+
const data = result.data;
|
|
127
|
+
if (!data.enabled)
|
|
128
|
+
throw noScheduler();
|
|
129
|
+
if (values.json) {
|
|
130
|
+
printJson(data);
|
|
131
|
+
return EXIT.OK;
|
|
132
|
+
}
|
|
133
|
+
const allowed = new Set(data.associations?.partitions ?? []);
|
|
134
|
+
const partitions = data.load?.partitions ?? [];
|
|
135
|
+
const rows = [
|
|
136
|
+
['PARTITION', 'STATE', 'TIMELIMIT', 'CPUS idle/tot', 'GPUS idle/tot (type)', 'PENDING', 'RUNNING'],
|
|
137
|
+
];
|
|
138
|
+
for (const p of partitions) {
|
|
139
|
+
rows.push([
|
|
140
|
+
p.name + (allowed.size > 0 && !allowed.has(p.name) ? ' *' : ''),
|
|
141
|
+
p.up ? 'up' : 'down',
|
|
142
|
+
p.timeLimit,
|
|
143
|
+
`${p.cpus.idle}/${p.cpus.total}`,
|
|
144
|
+
p.gpus ? `${p.gpus.idle}/${p.gpus.total} (${p.gpus.type})` : '-',
|
|
145
|
+
String(p.jobs.pending),
|
|
146
|
+
String(p.jobs.running),
|
|
147
|
+
]);
|
|
148
|
+
}
|
|
149
|
+
for (const line of table(rows))
|
|
150
|
+
console.log(line);
|
|
151
|
+
if (allowed.size > 0 && partitions.some((p) => !allowed.has(p.name))) {
|
|
152
|
+
console.log('(* = you cannot submit to this partition)');
|
|
153
|
+
}
|
|
154
|
+
const qoses = data.load?.qoses ?? [];
|
|
155
|
+
if (qoses.length > 0) {
|
|
156
|
+
console.log('');
|
|
157
|
+
const qosRows = [['QOS', 'PRIORITY', 'MAX WALL', 'PREEMPTIBLE', 'PENDING', 'RUNNING']];
|
|
158
|
+
for (const q of qoses) {
|
|
159
|
+
qosRows.push([
|
|
160
|
+
q.name + (q.name === data.associations?.defaultQos ? ' (default)' : ''),
|
|
161
|
+
String(q.priority),
|
|
162
|
+
q.maxWall ?? '-',
|
|
163
|
+
q.preemptible ? 'yes' : 'no',
|
|
164
|
+
String(q.jobs.pending),
|
|
165
|
+
String(q.jobs.running),
|
|
166
|
+
]);
|
|
167
|
+
}
|
|
168
|
+
for (const line of table(qosRows))
|
|
169
|
+
console.log(line);
|
|
170
|
+
}
|
|
171
|
+
printHint('request one with: nebula compute alloc --partition <P> [--wait]', values);
|
|
172
|
+
return EXIT.OK;
|
|
173
|
+
}
|
|
174
|
+
// =============================================================================
|
|
175
|
+
// compute alloc
|
|
176
|
+
// =============================================================================
|
|
177
|
+
async function computeAlloc(argv) {
|
|
178
|
+
const { values } = parse(argv, {
|
|
179
|
+
partition: { type: 'string' },
|
|
180
|
+
qos: { type: 'string' },
|
|
181
|
+
cpus: { type: 'string' },
|
|
182
|
+
mem: { type: 'string' },
|
|
183
|
+
gpus: { type: 'string' },
|
|
184
|
+
'gpu-type': { type: 'string' },
|
|
185
|
+
walltime: { type: 'string' },
|
|
186
|
+
name: { type: 'string' },
|
|
187
|
+
'idle-timeout': { type: 'string' },
|
|
188
|
+
wait: { type: 'boolean' },
|
|
189
|
+
'max-wait': { type: 'string' },
|
|
190
|
+
});
|
|
191
|
+
if (values.help) {
|
|
192
|
+
console.log(COMPUTE_HELP);
|
|
193
|
+
return EXIT.OK;
|
|
194
|
+
}
|
|
195
|
+
const partition = typeof values.partition === 'string' ? values.partition : '';
|
|
196
|
+
if (!partition) {
|
|
197
|
+
throw new CliError('--partition is required', EXIT.USAGE, 'see available partitions with: nebula compute queues');
|
|
198
|
+
}
|
|
199
|
+
const spec = { partition };
|
|
200
|
+
if (typeof values.qos === 'string')
|
|
201
|
+
spec.qos = values.qos;
|
|
202
|
+
if (values.cpus !== undefined)
|
|
203
|
+
spec.cpus = parseIntFlag(values.cpus, '--cpus', 1);
|
|
204
|
+
if (values.mem !== undefined)
|
|
205
|
+
spec.memGb = parseIntFlag(values.mem, '--mem', 4);
|
|
206
|
+
if (values.gpus !== undefined)
|
|
207
|
+
spec.gpus = parseIntFlag(values.gpus, '--gpus', 0);
|
|
208
|
+
if (typeof values['gpu-type'] === 'string')
|
|
209
|
+
spec.gpuType = values['gpu-type'];
|
|
210
|
+
if (values.walltime !== undefined) {
|
|
211
|
+
const hours = Number(values.walltime);
|
|
212
|
+
if (Number.isNaN(hours) || hours <= 0) {
|
|
213
|
+
throw new CliError(`--walltime must be a positive number of hours, got "${String(values.walltime)}"`, EXIT.USAGE);
|
|
214
|
+
}
|
|
215
|
+
spec.walltimeMinutes = Math.round(hours * 60);
|
|
216
|
+
}
|
|
217
|
+
if (typeof values.name === 'string')
|
|
218
|
+
spec.jobName = values.name;
|
|
219
|
+
if (values['idle-timeout'] !== undefined) {
|
|
220
|
+
const minutes = parseIntFlag(values['idle-timeout'], '--idle-timeout', 60);
|
|
221
|
+
if (minutes <= 0) {
|
|
222
|
+
throw new CliError(`--idle-timeout must be a positive number of minutes, got "${String(values['idle-timeout'])}"`, EXIT.USAGE);
|
|
223
|
+
}
|
|
224
|
+
spec.idleTimeoutMinutes = minutes;
|
|
225
|
+
}
|
|
226
|
+
const maxWait = parseIntFlag(values['max-wait'], '--max-wait', 3600);
|
|
227
|
+
const client = makeClient(resolveUrl(values.url));
|
|
228
|
+
// Fail fast with a friendly message when the server has no scheduler.
|
|
229
|
+
const status = await client.computeStatus();
|
|
230
|
+
if (status.success && !status.data.enabled)
|
|
231
|
+
throw noScheduler();
|
|
232
|
+
const created = await client.createAllocation(spec);
|
|
233
|
+
if (!created.success)
|
|
234
|
+
throw toCliError(created.error);
|
|
235
|
+
let alloc = created.data;
|
|
236
|
+
if (!values.wait) {
|
|
237
|
+
if (values.json) {
|
|
238
|
+
printJson(alloc);
|
|
239
|
+
return EXIT.OK;
|
|
240
|
+
}
|
|
241
|
+
console.log(`allocation: ${alloc.id}`);
|
|
242
|
+
console.log(`state: ${alloc.state}`);
|
|
243
|
+
printHint(`follow with: nebula compute ls; when active: nebula compute use ${alloc.id} <notebook.ipynb>`, values);
|
|
244
|
+
return EXIT.OK;
|
|
245
|
+
}
|
|
246
|
+
// --wait: FOLLOW the allocation until active or terminal. Internal polling
|
|
247
|
+
// only — launch as a background shell task; process exit is the signal.
|
|
248
|
+
const deadline = maxWait <= 0 ? Number.POSITIVE_INFINITY : Date.now() + maxWait * 1000;
|
|
249
|
+
let pollMs = POLL_START_MS;
|
|
250
|
+
while (alloc.state !== 'active' && !TERMINAL_STATES.has(alloc.state) && Date.now() < deadline) {
|
|
251
|
+
await sleep(Math.min(pollMs, Math.max(0, deadline - Date.now())));
|
|
252
|
+
pollMs = Math.min(pollMs * 1.5, POLL_MAX_MS);
|
|
253
|
+
try {
|
|
254
|
+
const list = await client.listAllocations();
|
|
255
|
+
if (list.success) {
|
|
256
|
+
const found = list.data.find((a) => a.id === alloc.id);
|
|
257
|
+
if (found)
|
|
258
|
+
alloc = found;
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
catch {
|
|
262
|
+
// transient network blip — keep following
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
if (values.json) {
|
|
266
|
+
printJson(alloc);
|
|
267
|
+
return alloc.state === 'active' ? EXIT.OK : TERMINAL_STATES.has(alloc.state) ? EXIT.ERROR : EXIT.RUNNING;
|
|
268
|
+
}
|
|
269
|
+
console.log(`allocation: ${alloc.id}`);
|
|
270
|
+
console.log(`state: ${alloc.state}`);
|
|
271
|
+
if (alloc.state === 'active') {
|
|
272
|
+
console.log(`server: ${alloc.serverId}`);
|
|
273
|
+
console.log(`node: ${alloc.nodes?.join(',') || '-'}`);
|
|
274
|
+
printHint(`bind a notebook to it with: nebula compute use ${alloc.id} <notebook.ipynb>`, values);
|
|
275
|
+
return EXIT.OK;
|
|
276
|
+
}
|
|
277
|
+
if (TERMINAL_STATES.has(alloc.state)) {
|
|
278
|
+
console.error(`error: allocation ${alloc.id} ${alloc.state}${alloc.reason ? ` (${alloc.reason})` : ''}`);
|
|
279
|
+
return EXIT.ERROR;
|
|
280
|
+
}
|
|
281
|
+
printHint(`still ${alloc.state} after ${maxWait}s (exit 3); keep following with: nebula compute ls`, values);
|
|
282
|
+
return EXIT.RUNNING;
|
|
283
|
+
}
|
|
284
|
+
// =============================================================================
|
|
285
|
+
// compute ls
|
|
286
|
+
// =============================================================================
|
|
287
|
+
async function computeLs(argv) {
|
|
288
|
+
const { values } = parse(argv);
|
|
289
|
+
if (values.help) {
|
|
290
|
+
console.log(COMPUTE_HELP);
|
|
291
|
+
return EXIT.OK;
|
|
292
|
+
}
|
|
293
|
+
const client = makeClient(resolveUrl(values.url));
|
|
294
|
+
const result = await client.listAllocations();
|
|
295
|
+
if (!result.success)
|
|
296
|
+
throw toCliError(result.error);
|
|
297
|
+
const allocations = result.data;
|
|
298
|
+
if (values.json) {
|
|
299
|
+
printJson(allocations);
|
|
300
|
+
return EXIT.OK;
|
|
301
|
+
}
|
|
302
|
+
if (allocations.length === 0) {
|
|
303
|
+
console.log('(no allocations)');
|
|
304
|
+
printHint('request one with: nebula compute alloc --partition <P> --wait', values);
|
|
305
|
+
return EXIT.OK;
|
|
306
|
+
}
|
|
307
|
+
const rows = [['ID', 'STATE', 'PARTITION', 'QOS', 'CPUS', 'MEM', 'GPUS', 'NODE', 'NAME']];
|
|
308
|
+
for (const a of allocations) {
|
|
309
|
+
rows.push([
|
|
310
|
+
a.id,
|
|
311
|
+
a.state,
|
|
312
|
+
a.spec.partition,
|
|
313
|
+
a.spec.qos ?? '-',
|
|
314
|
+
String(a.spec.cpus),
|
|
315
|
+
`${a.spec.memGb}G`,
|
|
316
|
+
a.spec.gpus ? `${a.spec.gpus}${a.spec.gpuType ? ` (${a.spec.gpuType})` : ''}` : '-',
|
|
317
|
+
a.nodes?.join(',') || '-',
|
|
318
|
+
a.spec.jobName,
|
|
319
|
+
]);
|
|
320
|
+
}
|
|
321
|
+
for (const line of table(rows))
|
|
322
|
+
console.log(line);
|
|
323
|
+
printHint('bind a notebook to an active one: nebula compute use <id> <notebook.ipynb>', values);
|
|
324
|
+
return EXIT.OK;
|
|
325
|
+
}
|
|
326
|
+
// =============================================================================
|
|
327
|
+
// compute use
|
|
328
|
+
// =============================================================================
|
|
329
|
+
async function findAllocation(client, idOrName) {
|
|
330
|
+
const result = await client.listAllocations();
|
|
331
|
+
if (!result.success)
|
|
332
|
+
throw toCliError(result.error);
|
|
333
|
+
const allocations = result.data;
|
|
334
|
+
const found = allocations.find((a) => a.id === idOrName) ??
|
|
335
|
+
allocations.find((a) => a.spec.jobName === idOrName);
|
|
336
|
+
if (!found) {
|
|
337
|
+
throw new CliError(`allocation not found: ${idOrName}`, EXIT.ERROR, 'list allocations with: nebula compute ls');
|
|
338
|
+
}
|
|
339
|
+
return found;
|
|
340
|
+
}
|
|
341
|
+
async function computeUse(argv) {
|
|
342
|
+
const { values, positionals } = parse(argv, {
|
|
343
|
+
kernel: { type: 'string' },
|
|
344
|
+
});
|
|
345
|
+
if (values.help) {
|
|
346
|
+
console.log(COMPUTE_HELP);
|
|
347
|
+
return EXIT.OK;
|
|
348
|
+
}
|
|
349
|
+
const usage = 'nebula compute use <alloc-id|name> <notebook-path>';
|
|
350
|
+
const idOrName = requirePositional(positionals, 0, 'alloc-id|name', usage);
|
|
351
|
+
const nbPath = requirePositional(positionals, 1, 'notebook-path', usage);
|
|
352
|
+
const url = resolveUrl(values.url);
|
|
353
|
+
const client = makeClient(url, nbPath);
|
|
354
|
+
const alloc = await findAllocation(client, idOrName);
|
|
355
|
+
if (alloc.state !== 'active' || !alloc.serverId) {
|
|
356
|
+
throw new CliError(`allocation ${alloc.id} is not active (state: ${alloc.state}) — kernels need an active allocation`, EXIT.ERROR, alloc.state === 'pending' || alloc.state === 'running'
|
|
357
|
+
? `it is still coming up; check with: nebula compute ls`
|
|
358
|
+
: `request a new one with: nebula compute alloc --partition ${alloc.spec.partition} --wait`);
|
|
359
|
+
}
|
|
360
|
+
const kernelName = typeof values.kernel === 'string' ? values.kernel : undefined;
|
|
361
|
+
const bound = await client.getOrCreateKernelForFile(nbPath, kernelName, alloc.serverId);
|
|
362
|
+
if (!bound.success)
|
|
363
|
+
throw toCliError(bound.error, nbPath);
|
|
364
|
+
if (values.json) {
|
|
365
|
+
printJson({
|
|
366
|
+
allocationId: alloc.id,
|
|
367
|
+
serverId: alloc.serverId,
|
|
368
|
+
sessionId: bound.data.sessionId,
|
|
369
|
+
kernelName: bound.data.kernelName,
|
|
370
|
+
path: nbPath,
|
|
371
|
+
});
|
|
372
|
+
return EXIT.OK;
|
|
373
|
+
}
|
|
374
|
+
console.log(`bound: ${nbPath} → allocation ${alloc.id} (server ${alloc.serverId})`);
|
|
375
|
+
console.log(`session: ${bound.data.sessionId} (${bound.data.kernelName})`);
|
|
376
|
+
printHint(`nebula run ${nbPath} <cell-id> now executes on the allocation; cancel it when done: nebula compute cancel ${alloc.id}`, values);
|
|
377
|
+
return EXIT.OK;
|
|
378
|
+
}
|
|
379
|
+
// =============================================================================
|
|
380
|
+
// compute cancel
|
|
381
|
+
// =============================================================================
|
|
382
|
+
async function computeCancel(argv) {
|
|
383
|
+
const { values, positionals } = parse(argv);
|
|
384
|
+
if (values.help) {
|
|
385
|
+
console.log(COMPUTE_HELP);
|
|
386
|
+
return EXIT.OK;
|
|
387
|
+
}
|
|
388
|
+
const id = requirePositional(positionals, 0, 'id', 'nebula compute cancel <id>');
|
|
389
|
+
const client = makeClient(resolveUrl(values.url));
|
|
390
|
+
const result = await client.cancelAllocation(id);
|
|
391
|
+
if (!result.success) {
|
|
392
|
+
if (/not found/i.test(result.error ?? '')) {
|
|
393
|
+
throw new CliError(`allocation not found: ${id}`, EXIT.ERROR, 'list allocations with: nebula compute ls');
|
|
394
|
+
}
|
|
395
|
+
throw toCliError(result.error);
|
|
396
|
+
}
|
|
397
|
+
if (values.json) {
|
|
398
|
+
printJson({ cancelled: true, id });
|
|
399
|
+
return EXIT.OK;
|
|
400
|
+
}
|
|
401
|
+
console.log(`cancelled: ${id}`);
|
|
402
|
+
printHint('notebooks bound to it fall back to a new kernel on next use', values);
|
|
403
|
+
return EXIT.OK;
|
|
404
|
+
}
|
|
405
|
+
//# sourceMappingURL=compute.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compute.js","sourceRoot":"","sources":["../../src/cli/compute.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAOH,OAAO,EACL,QAAQ,EACR,IAAI,EACJ,UAAU,EACV,KAAK,EACL,YAAY,EACZ,SAAS,EACT,SAAS,EACT,iBAAiB,EACjB,UAAU,EACV,UAAU,GACX,MAAM,aAAa,CAAC;AAErB,MAAM,YAAY,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iCA+BY,CAAC;AAElC,sFAAsF;AACtF,MAAM,aAAa,GAAG,KAAK,CAAC;AAC5B,MAAM,WAAW,GAAG,KAAK,CAAC;AAE1B,MAAM,eAAe,GAAG,IAAI,GAAG,CAAC,CAAC,OAAO,EAAE,QAAQ,EAAE,WAAW,CAAC,CAAC,CAAC;AAElE,SAAS,KAAK,CAAC,EAAU;IACvB,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC;AAC3D,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,IAAc;IAC7C,MAAM,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC;IAC5B,IAAI,GAAG,KAAK,SAAS,IAAI,GAAG,KAAK,QAAQ,IAAI,GAAG,KAAK,IAAI,EAAE,CAAC;QAC1D,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;QAC1B,OAAO,GAAG,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,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,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,IAAI,EAAE,CAAC,EAAE,CAAC;YAC1C,MAAM,IAAI,QAAQ,CAAC,yBAAyB,EAAE,EAAE,EAAE,IAAI,CAAC,KAAK,EAAE,0CAA0C,CAAC,CAAC;QAC5G,CAAC;QACD,MAAM,UAAU,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACjC,CAAC;IAED,IAAI,MAAM,CAAC,IAAI,EAAE,CAAC;QAChB,SAAS,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,CAAC;QACnC,OAAO,IAAI,CAAC,EAAE,CAAC;IACjB,CAAC;IACD,OAAO,CAAC,GAAG,CAAC,cAAc,EAAE,EAAE,CAAC,CAAC;IAChC,SAAS,CAAC,6DAA6D,EAAE,MAAM,CAAC,CAAC;IACjF,OAAO,IAAI,CAAC,EAAE,CAAC;AACjB,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* nebula — agent-facing CLI for Nebula Notebook.
|
|
3
|
+
*
|
|
4
|
+
* A thin layer over the shared NebulaClient / tools code (the same code the
|
|
5
|
+
* MCP server uses). Design follows AXI (https://axi.md): compact plain-text
|
|
6
|
+
* output, combined operations, one contextual hint per command, --json for
|
|
7
|
+
* raw output, distinct exit codes.
|
|
8
|
+
*
|
|
9
|
+
* Exit codes: 0 ok · 1 error · 2 usage · 7 kernel dead/not-found · 9 OCC conflict
|
|
10
|
+
*/
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* nebula — agent-facing CLI for Nebula Notebook.
|
|
3
|
+
*
|
|
4
|
+
* A thin layer over the shared NebulaClient / tools code (the same code the
|
|
5
|
+
* MCP server uses). Design follows AXI (https://axi.md): compact plain-text
|
|
6
|
+
* output, combined operations, one contextual hint per command, --json for
|
|
7
|
+
* raw output, distinct exit codes.
|
|
8
|
+
*
|
|
9
|
+
* Exit codes: 0 ok · 1 error · 2 usage · 7 kernel dead/not-found · 9 OCC conflict
|
|
10
|
+
*/
|
|
11
|
+
import { CliError, EXIT } from './shared.js';
|
|
12
|
+
import { cmdNb } from './nb.js';
|
|
13
|
+
import { cmdRun } from './run.js';
|
|
14
|
+
import { cmdKernel } from './kernel.js';
|
|
15
|
+
import { cmdSession } from './session.js';
|
|
16
|
+
import { cmdCompute } from './compute.js';
|
|
17
|
+
import { cmdSetupSkill } from './skill.js';
|
|
18
|
+
const ROOT_HELP = `nebula — work with notebooks on a running Nebula server
|
|
19
|
+
|
|
20
|
+
Server URL required: --url <url> on any command, or export NEBULA_URL.
|
|
21
|
+
|
|
22
|
+
usage: nebula <command> …
|
|
23
|
+
|
|
24
|
+
nb read <path> list cells (--cells, --outputs, --full)
|
|
25
|
+
nb edit <path> <cell-id> … update a cell (OCC-checked; conflict → exit 9)
|
|
26
|
+
nb insert <path> --index N … insert a cell
|
|
27
|
+
nb delete <path> <cell-id> delete a cell
|
|
28
|
+
nb search <path> <query> search cell sources (--limit)
|
|
29
|
+
run <path> <cell-id> execute a cell + print output tail (--tail)
|
|
30
|
+
kernel status|restart|interrupt <path>
|
|
31
|
+
session start|end <path> hold/release the agent lock across invocations
|
|
32
|
+
compute status|queues|alloc|ls|use|cancel
|
|
33
|
+
cluster compute allocations (HPC; optional —
|
|
34
|
+
absent unless the server has a scheduler)
|
|
35
|
+
setup-skill install the Claude Code skill (for agents outside Nebula terminals)
|
|
36
|
+
|
|
37
|
+
Every command accepts --json (raw output) and --quiet (no hint line).
|
|
38
|
+
Run 'nebula <command> --help' for examples.`;
|
|
39
|
+
async function main(argv) {
|
|
40
|
+
const [cmd, ...rest] = argv;
|
|
41
|
+
if (cmd === undefined || cmd === '--help' || cmd === '-h' || cmd === 'help') {
|
|
42
|
+
console.log(ROOT_HELP);
|
|
43
|
+
return EXIT.OK;
|
|
44
|
+
}
|
|
45
|
+
switch (cmd) {
|
|
46
|
+
case 'nb':
|
|
47
|
+
return cmdNb(rest);
|
|
48
|
+
case 'run':
|
|
49
|
+
return cmdRun(rest);
|
|
50
|
+
case 'kernel':
|
|
51
|
+
return cmdKernel(rest);
|
|
52
|
+
case 'session':
|
|
53
|
+
return cmdSession(rest);
|
|
54
|
+
case 'compute':
|
|
55
|
+
return cmdCompute(rest);
|
|
56
|
+
case 'setup-skill':
|
|
57
|
+
return cmdSetupSkill(rest);
|
|
58
|
+
default:
|
|
59
|
+
throw new CliError(`unknown command: ${cmd}`, EXIT.USAGE, "run 'nebula --help' for the command list");
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
/** Exit only after stdout/stderr are flushed (they can be async on pipes). */
|
|
63
|
+
function finish(code) {
|
|
64
|
+
let pending = 2;
|
|
65
|
+
const done = () => {
|
|
66
|
+
pending -= 1;
|
|
67
|
+
if (pending === 0)
|
|
68
|
+
process.exit(code);
|
|
69
|
+
};
|
|
70
|
+
process.stdout.write('', done);
|
|
71
|
+
process.stderr.write('', done);
|
|
72
|
+
}
|
|
73
|
+
main(process.argv.slice(2))
|
|
74
|
+
.then(finish)
|
|
75
|
+
.catch((e) => {
|
|
76
|
+
if (e instanceof CliError) {
|
|
77
|
+
console.error(`error: ${e.message}`);
|
|
78
|
+
if (e.hintText)
|
|
79
|
+
console.error(`hint: ${e.hintText}`);
|
|
80
|
+
finish(e.code);
|
|
81
|
+
}
|
|
82
|
+
else {
|
|
83
|
+
console.error(`error: ${e instanceof Error ? e.message : String(e)}`);
|
|
84
|
+
finish(EXIT.ERROR);
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/cli/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
3
|
+
*
|
|
4
|
+
* Uses the shared NebulaClient kernel-session helpers (same logic as the
|
|
5
|
+
* MCP kernel tools, but addressed by notebook path per invocation).
|
|
6
|
+
*/
|
|
7
|
+
export declare function cmdKernel(argv: string[]): Promise<number>;
|
|
8
|
+
//# sourceMappingURL=kernel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kernel.d.ts","sourceRoot":"","sources":["../../src/cli/kernel.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAyBH,wBAAsB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,CAyB/D"}
|