@code-yeongyu/senpi-codemode 2026.10.10-10 → 2026.10.10-11
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 +32 -0
- package/package.json +4 -4
- package/src/bridge/memory-protocol.ts +8 -1
- package/src/bridge/protocol.ts +1 -1
- package/src/bridges/eval-environment-schemas.ts +5 -1
- package/src/environments/editable-check.ts +1 -1
- package/src/extension/session-cwd.ts +25 -9
- package/src/extension/session-manager.ts +4 -4
- package/src/kernels/jl/runner.jl +11 -22
- package/src/kernels/js/group-signal-notice.js +117 -0
- package/src/kernels/js/inline-worker.ts +2 -0
- package/src/kernels/js/local-module-loader.ts +8 -0
- package/src/kernels/js/process-tree-host.ts +4 -8
- package/src/kernels/js/process-tree.d.ts +11 -0
- package/src/kernels/js/process-tree.js +55 -10
- package/src/kernels/js/windows-tree-kill-host.ts +117 -0
- package/src/kernels/js/windows-tree-kill.d.ts +19 -0
- package/src/kernels/js/windows-tree-kill.js +100 -0
- package/src/kernels/js/worker-cwd.js +41 -10
- package/src/kernels/js/worker-runtime.js +23 -4
- package/src/kernels/js/worker-shell-capture.js +4 -0
- package/src/kernels/js/worker-slot.ts +2 -3
- package/src/kernels/py/prelude.py +36 -25
- package/src/kernels/py/transport.ts +4 -0
- package/src/kernels/rb/runner.rb +9 -19
- package/src/kernels/sandbox/vendor/pi-codemode/runtime/host.ts +2 -2
- package/src/kernels/shared/bun-ffi.ts +24 -0
- package/src/kernels/shared/kernel-memory-host.ts +30 -7
- package/src/kernels/shared/process-cpu.ts +7 -3
- package/src/kernels/shared/process-group-cpu.ts +6 -3
- package/src/kernels/shared/subprocess-kernel.ts +29 -3
- package/src/kernels/shared/subprocess-memory-globals.ts +101 -0
- package/src/kernels/shared/subprocess-process.ts +20 -12
- package/src/kernels/shared/subprocess-queue.ts +1 -0
- package/src/tool/eval-tool.ts +2 -1
- package/src/tool/render-agent.ts +110 -0
- package/src/tool/render-blocks.ts +252 -0
- package/src/tool/render-call.ts +130 -0
- package/src/tool/render-cell.ts +165 -0
- package/src/tool/render-detail.ts +152 -0
- package/src/tool/render-live.ts +288 -0
- package/src/tool/render-result.ts +202 -0
- package/src/tool/render-status.ts +166 -0
- package/src/tool/render-tail.ts +139 -0
- package/src/tool/render.ts +3 -1128
- package/src/tool/run-eval-cell.ts +7 -12
- package/src/tool/types.ts +11 -2
|
@@ -11,11 +11,7 @@ import { resolveSandbox } from "../config/feature-settings.ts";
|
|
|
11
11
|
import { DEFAULT_FOREGROUND_WINDOW_SECONDS, defaultCodemodeSettings } from "../config/settings.ts";
|
|
12
12
|
import type { JsEnvironments } from "../environments/js-environments.ts";
|
|
13
13
|
import type { PackagesInstallEnvironments } from "../environments/packages-install.ts";
|
|
14
|
-
import {
|
|
15
|
-
KERNEL_TOOLS_CAPABILITIES,
|
|
16
|
-
type KernelToolsCapability,
|
|
17
|
-
type KernelToolsDescribeResult,
|
|
18
|
-
} from "../kernels/js/kernel-tools-types.ts";
|
|
14
|
+
import { KERNEL_TOOLS_CAPABILITIES, type KernelToolsCapability } from "../kernels/js/kernel-tools-types.ts";
|
|
19
15
|
import { sandboxCellExecutor, sandboxRuntimeInfo } from "../kernels/sandbox/sandbox-cell.ts";
|
|
20
16
|
import { TIMEOUT_PAUSE_OP, TIMEOUT_RESUME_OP } from "../timeouts/bridge-timeout.ts";
|
|
21
17
|
import { abortError, CellExecution, defaultTimeoutFactory } from "./cell-execution.ts";
|
|
@@ -356,15 +352,14 @@ async function executeCell(
|
|
|
356
352
|
}
|
|
357
353
|
|
|
358
354
|
function kernelToolsFor(kernel: EvalKernel): KernelToolsCapability | undefined {
|
|
359
|
-
if (
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
};
|
|
355
|
+
if (typeof kernel.describeKernelTools !== "function" || typeof kernel.invokeKernelTool !== "function")
|
|
356
|
+
return undefined;
|
|
357
|
+
const describeKernelTools = kernel.describeKernelTools.bind(kernel);
|
|
358
|
+
const invokeKernelTool = kernel.invokeKernelTool.bind(kernel);
|
|
364
359
|
return {
|
|
365
360
|
capabilities: KERNEL_TOOLS_CAPABILITIES,
|
|
366
|
-
describe:
|
|
367
|
-
invoke:
|
|
361
|
+
describe: describeKernelTools,
|
|
362
|
+
invoke: invokeKernelTool,
|
|
368
363
|
} satisfies ExtensionKernelTools;
|
|
369
364
|
}
|
|
370
365
|
|
package/src/tool/types.ts
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type {
|
|
2
|
+
AgentToolResult,
|
|
3
|
+
AgentToolUpdateCallback,
|
|
4
|
+
ExtensionKernelTools,
|
|
5
|
+
KernelPreludeContribution,
|
|
6
|
+
} from "@code-yeongyu/senpi";
|
|
2
7
|
import { type TSchema, type TUnsafe, Type } from "typebox";
|
|
3
8
|
import type { KernelMemoryReport } from "../bridge/memory-protocol.ts";
|
|
4
9
|
import type { HostToKernelMessage, KernelToHostMessage } from "../bridge/protocol.ts";
|
|
@@ -8,7 +13,7 @@ import {
|
|
|
8
13
|
DEFAULT_RUN_BUDGET_SECONDS,
|
|
9
14
|
defaultCodemodeSettings,
|
|
10
15
|
} from "../config/settings.ts";
|
|
11
|
-
import type { KernelToolsCapability } from "../kernels/js/kernel-tools-types.ts";
|
|
16
|
+
import type { KernelToolsCapability, KernelToolsDescribeResult } from "../kernels/js/kernel-tools-types.ts";
|
|
12
17
|
import type { TruncationMeta } from "../output/output-meta.ts";
|
|
13
18
|
|
|
14
19
|
export const evalLanguageOrder = ["js", "py", "rb", "jl"] as const;
|
|
@@ -238,6 +243,10 @@ export interface EvalKernel {
|
|
|
238
243
|
isAlive?(): boolean;
|
|
239
244
|
/** Hands over, and forgets, every queued cell of a dead kernel that never started. */
|
|
240
245
|
drainPending?(): readonly PendingCell[];
|
|
246
|
+
/** Describes this kernel's registered kernel tools; only an in-process JS kernel has them. */
|
|
247
|
+
describeKernelTools?(names: readonly string[]): Promise<KernelToolsDescribeResult>;
|
|
248
|
+
/** Invokes one of this kernel's kernel tools; present exactly when `describeKernelTools` is. */
|
|
249
|
+
invokeKernelTool?: ExtensionKernelTools["invoke"];
|
|
241
250
|
}
|
|
242
251
|
|
|
243
252
|
export interface EvalKernelManager {
|