pi-nebius 0.3.1 → 0.3.2
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/CHANGELOG.md +8 -0
- package/dist/benchmark/command.js +11 -1
- package/dist/benchmark/host-worker.mjs +28 -0
- package/package.json +5 -3
- package/src/benchmark/command.ts +16 -6
- package/src/benchmark/host-worker.mjs +28 -0
- package/dist/benchmark/host-worker.js +0 -14
- package/src/benchmark/host-worker.ts +0 -14
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,14 @@
|
|
|
3
3
|
Versions use Semantic Versioning. Entries describe changes included in the named version;
|
|
4
4
|
a version is released only when its matching Git tag and GitHub release are published.
|
|
5
5
|
|
|
6
|
+
## [0.3.2](https://github.com/PeterHdd/pi-nebius/compare/v0.3.1...v0.3.2) (2026-09-17)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* launch benchmark workers from installed packages ([f7e717a](https://github.com/PeterHdd/pi-nebius/commit/f7e717a3454ae700451e63f54d78bda1d155d1dd))
|
|
12
|
+
* launch benchmark workers from installed packages ([cf516f7](https://github.com/PeterHdd/pi-nebius/commit/cf516f724d0d85ce921e4b0a6347bdcb6b251493))
|
|
13
|
+
|
|
6
14
|
## [0.3.1](https://github.com/PeterHdd/pi-nebius/compare/v0.3.0...v0.3.1) (2026-09-17)
|
|
7
15
|
|
|
8
16
|
|
|
@@ -5,6 +5,7 @@ import { tmpdir } from "node:os";
|
|
|
5
5
|
import { dirname, join } from "node:path";
|
|
6
6
|
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
7
7
|
import { parseArgs } from "node:util";
|
|
8
|
+
import { Text } from "@earendil-works/pi-tui";
|
|
8
9
|
import { MISSING_KEY } from "../discovery.js";
|
|
9
10
|
import { applyModelSettings } from "../model-settings.js";
|
|
10
11
|
import { loadDefinition, positive } from "./definition.js";
|
|
@@ -33,6 +34,15 @@ export async function hostPiEntry() {
|
|
|
33
34
|
return join(dirname(manifestPath), manifest.main);
|
|
34
35
|
}
|
|
35
36
|
export function registerBenchmarkCommand(pi, getSettings = () => ({})) {
|
|
37
|
+
pi.registerMessageRenderer("nebius-benchmark", (message, options, theme) => {
|
|
38
|
+
const content = typeof message.content === "string"
|
|
39
|
+
? message.content
|
|
40
|
+
: message.content
|
|
41
|
+
.filter((part) => part.type === "text")
|
|
42
|
+
.map((part) => part.text)
|
|
43
|
+
.join("\n");
|
|
44
|
+
return new Text(`${theme.fg("customMessageLabel", "[nebius-benchmark]")}\n\n${content}`, options.outputPad ?? 1, 0);
|
|
45
|
+
});
|
|
36
46
|
let starting = false;
|
|
37
47
|
let active;
|
|
38
48
|
const show = (content) => pi.sendMessage({ customType: "nebius-benchmark", content, display: true }, { triggerTurn: false });
|
|
@@ -149,7 +159,7 @@ export function registerBenchmarkCommand(pi, getSettings = () => ({})) {
|
|
|
149
159
|
apiKey: key,
|
|
150
160
|
signal: controller.signal,
|
|
151
161
|
piEntry,
|
|
152
|
-
workerPath: fileURLToPath(new URL(
|
|
162
|
+
workerPath: fileURLToPath(new URL("./host-worker.mjs", import.meta.url)),
|
|
153
163
|
workerArgs: [piEntry],
|
|
154
164
|
onRun: (run) => {
|
|
155
165
|
ctx.ui.setStatus("nebius-benchmark", `Benchmark: ${task} (${++completed}/${total})`);
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { readFileSync } from "node:fs";
|
|
2
|
+
import { registerHooks, stripTypeScriptTypes } from "node:module";
|
|
3
|
+
import { pathToFileURL } from "node:url";
|
|
4
|
+
// Reuse the installed host's SDK; Git installs intentionally omit Pi dev dependencies.
|
|
5
|
+
const hostEntry = process.argv[2];
|
|
6
|
+
if (!hostEntry)
|
|
7
|
+
throw new Error("Missing host Pi entry");
|
|
8
|
+
const sourceRoot = new URL("../", import.meta.url).href;
|
|
9
|
+
registerHooks({
|
|
10
|
+
// Node's automatic type stripping rejects installed sources under node_modules.
|
|
11
|
+
// This JavaScript bootstrap explicitly strips only this package's own sources.
|
|
12
|
+
load(url, context, nextLoad) {
|
|
13
|
+
if (url.startsWith(sourceRoot) && url.endsWith(".ts")) {
|
|
14
|
+
return {
|
|
15
|
+
format: "module",
|
|
16
|
+
source: stripTypeScriptTypes(readFileSync(new URL(url), "utf8"), { sourceUrl: url }),
|
|
17
|
+
shortCircuit: true,
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
return nextLoad(url, context);
|
|
21
|
+
},
|
|
22
|
+
resolve(specifier, context, nextResolve) {
|
|
23
|
+
if (specifier.startsWith("@earendil-works/"))
|
|
24
|
+
return nextResolve(specifier, { ...context, parentURL: pathToFileURL(hostEntry).href });
|
|
25
|
+
return nextResolve(specifier, context);
|
|
26
|
+
},
|
|
27
|
+
});
|
|
28
|
+
await import("./worker.js");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-nebius",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.2",
|
|
4
4
|
"description": "Nebius Token Factory provider and agentic coding benchmarks for Pi",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -42,13 +42,15 @@
|
|
|
42
42
|
},
|
|
43
43
|
"peerDependencies": {
|
|
44
44
|
"@earendil-works/pi-ai": "*",
|
|
45
|
-
"@earendil-works/pi-coding-agent": "*"
|
|
45
|
+
"@earendil-works/pi-coding-agent": "*",
|
|
46
|
+
"@earendil-works/pi-tui": "*"
|
|
46
47
|
},
|
|
47
48
|
"devDependencies": {
|
|
49
|
+
"@biomejs/biome": "^2.2.0",
|
|
48
50
|
"@earendil-works/pi-ai": "0.85.1",
|
|
49
51
|
"@earendil-works/pi-coding-agent": "0.85.1",
|
|
52
|
+
"@earendil-works/pi-tui": "0.85.1",
|
|
50
53
|
"@types/node": "^22.0.0",
|
|
51
|
-
"@biomejs/biome": "^2.2.0",
|
|
52
54
|
"tsx": "^4.20.0",
|
|
53
55
|
"typescript": "^5.9.0"
|
|
54
56
|
},
|
package/src/benchmark/command.ts
CHANGED
|
@@ -6,6 +6,7 @@ import { dirname, join } from "node:path";
|
|
|
6
6
|
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
7
7
|
import { parseArgs } from "node:util";
|
|
8
8
|
import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
9
|
+
import { Text } from "@earendil-works/pi-tui";
|
|
9
10
|
import { MISSING_KEY } from "../discovery.ts";
|
|
10
11
|
import { applyModelSettings, type ModelSettingsMap } from "../model-settings.ts";
|
|
11
12
|
import type { NebiusModel } from "../models.ts";
|
|
@@ -42,6 +43,20 @@ export function registerBenchmarkCommand(
|
|
|
42
43
|
pi: ExtensionAPI,
|
|
43
44
|
getSettings: () => ModelSettingsMap = () => ({}),
|
|
44
45
|
) {
|
|
46
|
+
pi.registerMessageRenderer("nebius-benchmark", (message, options, theme) => {
|
|
47
|
+
const content =
|
|
48
|
+
typeof message.content === "string"
|
|
49
|
+
? message.content
|
|
50
|
+
: message.content
|
|
51
|
+
.filter((part) => part.type === "text")
|
|
52
|
+
.map((part) => part.text)
|
|
53
|
+
.join("\n");
|
|
54
|
+
return new Text(
|
|
55
|
+
`${theme.fg("customMessageLabel", "[nebius-benchmark]")}\n\n${content}`,
|
|
56
|
+
options.outputPad ?? 1,
|
|
57
|
+
0,
|
|
58
|
+
);
|
|
59
|
+
});
|
|
45
60
|
let starting = false;
|
|
46
61
|
let active: { controller: AbortController; done: Promise<void> } | undefined;
|
|
47
62
|
const show = (content: string) =>
|
|
@@ -168,12 +183,7 @@ export function registerBenchmarkCommand(
|
|
|
168
183
|
apiKey: key,
|
|
169
184
|
signal: controller.signal,
|
|
170
185
|
piEntry,
|
|
171
|
-
workerPath: fileURLToPath(
|
|
172
|
-
new URL(
|
|
173
|
-
import.meta.url.endsWith(".ts") ? "./host-worker.ts" : "./host-worker.js",
|
|
174
|
-
import.meta.url,
|
|
175
|
-
),
|
|
176
|
-
),
|
|
186
|
+
workerPath: fileURLToPath(new URL("./host-worker.mjs", import.meta.url)),
|
|
177
187
|
workerArgs: [piEntry],
|
|
178
188
|
onRun: (run) => {
|
|
179
189
|
ctx.ui.setStatus("nebius-benchmark", `Benchmark: ${task} (${++completed}/${total})`);
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { readFileSync } from "node:fs";
|
|
2
|
+
import { registerHooks, stripTypeScriptTypes } from "node:module";
|
|
3
|
+
import { pathToFileURL } from "node:url";
|
|
4
|
+
|
|
5
|
+
// Reuse the installed host's SDK; Git installs intentionally omit Pi dev dependencies.
|
|
6
|
+
const hostEntry = process.argv[2];
|
|
7
|
+
if (!hostEntry) throw new Error("Missing host Pi entry");
|
|
8
|
+
const sourceRoot = new URL("../", import.meta.url).href;
|
|
9
|
+
registerHooks({
|
|
10
|
+
// Node's automatic type stripping rejects installed sources under node_modules.
|
|
11
|
+
// This JavaScript bootstrap explicitly strips only this package's own sources.
|
|
12
|
+
load(url, context, nextLoad) {
|
|
13
|
+
if (url.startsWith(sourceRoot) && url.endsWith(".ts")) {
|
|
14
|
+
return {
|
|
15
|
+
format: "module",
|
|
16
|
+
source: stripTypeScriptTypes(readFileSync(new URL(url), "utf8"), { sourceUrl: url }),
|
|
17
|
+
shortCircuit: true,
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
return nextLoad(url, context);
|
|
21
|
+
},
|
|
22
|
+
resolve(specifier, context, nextResolve) {
|
|
23
|
+
if (specifier.startsWith("@earendil-works/"))
|
|
24
|
+
return nextResolve(specifier, { ...context, parentURL: pathToFileURL(hostEntry).href });
|
|
25
|
+
return nextResolve(specifier, context);
|
|
26
|
+
},
|
|
27
|
+
});
|
|
28
|
+
await import("./worker.ts");
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { registerHooks } from "node:module";
|
|
2
|
-
import { pathToFileURL } from "node:url";
|
|
3
|
-
// Reuse the installed host's SDK; Git installs intentionally omit Pi dev dependencies.
|
|
4
|
-
const hostEntry = process.argv[2];
|
|
5
|
-
if (!hostEntry)
|
|
6
|
-
throw new Error("Missing host Pi entry");
|
|
7
|
-
registerHooks({
|
|
8
|
-
resolve(specifier, context, nextResolve) {
|
|
9
|
-
if (specifier.startsWith("@earendil-works/"))
|
|
10
|
-
return nextResolve(specifier, { ...context, parentURL: pathToFileURL(hostEntry).href });
|
|
11
|
-
return nextResolve(specifier, context);
|
|
12
|
-
},
|
|
13
|
-
});
|
|
14
|
-
await import("./worker.js");
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { registerHooks } from "node:module";
|
|
2
|
-
import { pathToFileURL } from "node:url";
|
|
3
|
-
|
|
4
|
-
// Reuse the installed host's SDK; Git installs intentionally omit Pi dev dependencies.
|
|
5
|
-
const hostEntry = process.argv[2];
|
|
6
|
-
if (!hostEntry) throw new Error("Missing host Pi entry");
|
|
7
|
-
registerHooks({
|
|
8
|
-
resolve(specifier, context, nextResolve) {
|
|
9
|
-
if (specifier.startsWith("@earendil-works/"))
|
|
10
|
-
return nextResolve(specifier, { ...context, parentURL: pathToFileURL(hostEntry).href });
|
|
11
|
-
return nextResolve(specifier, context);
|
|
12
|
-
},
|
|
13
|
-
});
|
|
14
|
-
await import("./worker.ts");
|