@code-yeongyu/senpi-codemode 2026.8.27 → 2026.8.28
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
CHANGED
|
@@ -12,6 +12,20 @@
|
|
|
12
12
|
|
|
13
13
|
### Removed
|
|
14
14
|
|
|
15
|
+
## [2026.8.28] - 2026-08-28
|
|
16
|
+
|
|
17
|
+
### Breaking Changes
|
|
18
|
+
|
|
19
|
+
### Added
|
|
20
|
+
|
|
21
|
+
### Changed
|
|
22
|
+
|
|
23
|
+
### Fixed
|
|
24
|
+
|
|
25
|
+
- JavaScript and Python eval kernels resolve worker and prelude assets from the executable sidecar in Bun-compiled distributions instead of passing unusable `$bunfs` paths to `Worker` and `python3`.
|
|
26
|
+
|
|
27
|
+
### Removed
|
|
28
|
+
|
|
15
29
|
## [2026.8.27] - 2026-08-27
|
|
16
30
|
|
|
17
31
|
### Breaking Changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@code-yeongyu/senpi-codemode",
|
|
3
|
-
"version": "2026.8.
|
|
3
|
+
"version": "2026.8.28",
|
|
4
4
|
"description": "Source-only senpi extension package for codemode evaluation tools",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./src/index.ts",
|
|
@@ -30,14 +30,14 @@
|
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"@babel/parser": "8.0.4",
|
|
33
|
-
"@earendil-works/pi-ai": "npm:@code-yeongyu/senpi-ai@2026.8.
|
|
33
|
+
"@earendil-works/pi-ai": "npm:@code-yeongyu/senpi-ai@2026.8.28",
|
|
34
34
|
"typebox": "1.3.18"
|
|
35
35
|
},
|
|
36
36
|
"peerDependencies": {
|
|
37
|
-
"@code-yeongyu/senpi": "2026.8.
|
|
37
|
+
"@code-yeongyu/senpi": "2026.8.28"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
|
-
"@code-yeongyu/senpi": "2026.8.
|
|
40
|
+
"@code-yeongyu/senpi": "2026.8.28"
|
|
41
41
|
},
|
|
42
42
|
"keywords": [
|
|
43
43
|
"senpi",
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
+
import { dirname, join } from "node:path";
|
|
2
|
+
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
1
3
|
import type { HostToKernelMessage, KernelToHostMessage } from "../../bridge/protocol.ts";
|
|
2
4
|
import type { KernelInterruptHandle } from "../../tool/types.ts";
|
|
5
|
+
import { type CodemodeRuntimeAssetEnvironment, resolveCodemodeRuntimeAsset } from "../shared/runtime-asset.ts";
|
|
3
6
|
import { createInlineWorker, type WorkerLike } from "./inline-worker.ts";
|
|
4
7
|
import {
|
|
5
8
|
assertJavaScriptKernelOpen,
|
|
@@ -16,6 +19,15 @@ import { bridgeError, spawnNodeWorker, WorkerStartupCancelledError, waitForReady
|
|
|
16
19
|
export { JavaScriptKernelClosedError, type JavaScriptKernelMode, type JavaScriptRunInput } from "./kernel-contract.ts";
|
|
17
20
|
export type { JavaScriptKernelOptions } from "./local-module-loader.ts";
|
|
18
21
|
|
|
22
|
+
export interface JavaScriptWorkerEntryUrlOptions extends CodemodeRuntimeAssetEnvironment {
|
|
23
|
+
readonly localPath?: string;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export function resolveJsWorkerEntryUrl(options: JavaScriptWorkerEntryUrlOptions = {}): URL {
|
|
27
|
+
const localPath = options.localPath ?? join(dirname(fileURLToPath(import.meta.url)), "worker-entry.js");
|
|
28
|
+
return pathToFileURL(resolveCodemodeRuntimeAsset(localPath, join("kernels", "js", "worker-entry.js"), options));
|
|
29
|
+
}
|
|
30
|
+
|
|
19
31
|
export class JavaScriptKernel {
|
|
20
32
|
readonly #options: JavaScriptKernelOptions;
|
|
21
33
|
readonly #moduleLoader: LocalModuleLoader;
|
|
@@ -161,7 +173,7 @@ export class JavaScriptKernel {
|
|
|
161
173
|
|
|
162
174
|
#spawnWorker(): WorkerLike {
|
|
163
175
|
try {
|
|
164
|
-
const url = this.#options.workerEntryUrl ??
|
|
176
|
+
const url = this.#options.workerEntryUrl ?? resolveJsWorkerEntryUrl();
|
|
165
177
|
return spawnNodeWorker(url, this.#options.cwd, this.#options.parallelPoolWidth);
|
|
166
178
|
} catch (error) {
|
|
167
179
|
if (!(error instanceof Error)) throw error;
|
|
@@ -1,7 +1,21 @@
|
|
|
1
|
+
import { dirname, join } from "node:path";
|
|
2
|
+
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
1
3
|
import type { HostToKernelMessage, KernelToHostMessage } from "../../bridge/protocol.ts";
|
|
4
|
+
import { type CodemodeRuntimeAssetEnvironment, resolveCodemodeRuntimeAsset } from "../shared/runtime-asset.ts";
|
|
2
5
|
import type { JavaScriptKernelMode } from "./kernel-contract.ts";
|
|
3
6
|
import { spawnNodeWorker } from "./worker-host.ts";
|
|
4
7
|
|
|
8
|
+
export interface JavaScriptInlineWorkerEntryUrlOptions extends CodemodeRuntimeAssetEnvironment {
|
|
9
|
+
readonly localPath?: string;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export function resolveInlineWorkerEntryUrl(options: JavaScriptInlineWorkerEntryUrlOptions = {}): URL {
|
|
13
|
+
const localPath = options.localPath ?? join(dirname(fileURLToPath(import.meta.url)), "inline-worker-entry.js");
|
|
14
|
+
return pathToFileURL(
|
|
15
|
+
resolveCodemodeRuntimeAsset(localPath, join("kernels", "js", "inline-worker-entry.js"), options),
|
|
16
|
+
);
|
|
17
|
+
}
|
|
18
|
+
|
|
5
19
|
export interface WorkerLike {
|
|
6
20
|
readonly mode: JavaScriptKernelMode;
|
|
7
21
|
postMessage(message: HostToKernelMessage): void;
|
|
@@ -11,5 +25,5 @@ export interface WorkerLike {
|
|
|
11
25
|
}
|
|
12
26
|
|
|
13
27
|
export function createInlineWorker(cwd: string, parallelPoolWidth: number): WorkerLike {
|
|
14
|
-
return spawnNodeWorker(
|
|
28
|
+
return spawnNodeWorker(resolveInlineWorkerEntryUrl(), cwd, parallelPoolWidth, "inline");
|
|
15
29
|
}
|
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
isKernelToHostMessage,
|
|
9
9
|
type KernelToHostMessage,
|
|
10
10
|
} from "../../bridge/protocol.ts";
|
|
11
|
+
import { type CodemodeRuntimeAssetEnvironment, resolveCodemodeRuntimeAsset } from "../shared/runtime-asset.ts";
|
|
11
12
|
import {
|
|
12
13
|
defaultSpawn,
|
|
13
14
|
hardKill,
|
|
@@ -47,6 +48,18 @@ export interface PythonTransportOptions {
|
|
|
47
48
|
|
|
48
49
|
const hardKillWaitMs = 500;
|
|
49
50
|
|
|
51
|
+
export interface PythonPreludePathOptions extends CodemodeRuntimeAssetEnvironment {
|
|
52
|
+
readonly localPath?: string;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export function resolvePythonPreludePath(options: PythonPreludePathOptions = {}): string {
|
|
56
|
+
return resolveCodemodeRuntimeAsset(
|
|
57
|
+
options.localPath ?? join(dirname(fileURLToPath(import.meta.url)), "prelude.py"),
|
|
58
|
+
join("kernels", "py", "prelude.py"),
|
|
59
|
+
options,
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
|
|
50
63
|
export class PythonKernelTransport {
|
|
51
64
|
readonly #options: PythonTransportOptions;
|
|
52
65
|
readonly #child: KernelChild;
|
|
@@ -64,7 +77,7 @@ export class PythonKernelTransport {
|
|
|
64
77
|
}
|
|
65
78
|
|
|
66
79
|
static async start(options: PythonTransportOptions): Promise<PythonKernelTransport> {
|
|
67
|
-
const scriptPath =
|
|
80
|
+
const scriptPath = resolvePythonPreludePath();
|
|
68
81
|
const invocation = splitCommand(options.interpreterPath);
|
|
69
82
|
const spawnOptions: KernelSpawnOptions = {
|
|
70
83
|
command: invocation.command,
|