@code-yeongyu/senpi-codemode 2026.10.10-10 → 2026.10.10-12

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.
Files changed (47) hide show
  1. package/CHANGELOG.md +46 -0
  2. package/package.json +4 -4
  3. package/src/bridge/memory-protocol.ts +8 -1
  4. package/src/bridge/protocol.ts +1 -1
  5. package/src/bridges/eval-environment-schemas.ts +5 -1
  6. package/src/environments/editable-check.ts +1 -1
  7. package/src/extension/session-cwd.ts +25 -9
  8. package/src/extension/session-manager.ts +4 -4
  9. package/src/kernels/jl/runner.jl +11 -22
  10. package/src/kernels/js/group-signal-notice.js +117 -0
  11. package/src/kernels/js/inline-worker.ts +2 -0
  12. package/src/kernels/js/local-module-loader.ts +8 -0
  13. package/src/kernels/js/process-tree-host.ts +4 -8
  14. package/src/kernels/js/process-tree.d.ts +11 -0
  15. package/src/kernels/js/process-tree.js +55 -10
  16. package/src/kernels/js/windows-tree-kill-host.ts +117 -0
  17. package/src/kernels/js/windows-tree-kill.d.ts +19 -0
  18. package/src/kernels/js/windows-tree-kill.js +100 -0
  19. package/src/kernels/js/worker-cwd.js +41 -10
  20. package/src/kernels/js/worker-runtime.js +23 -4
  21. package/src/kernels/js/worker-shell-capture.js +4 -0
  22. package/src/kernels/js/worker-slot.ts +2 -3
  23. package/src/kernels/py/prelude.py +36 -25
  24. package/src/kernels/py/transport.ts +4 -0
  25. package/src/kernels/rb/runner.rb +9 -19
  26. package/src/kernels/sandbox/vendor/pi-codemode/runtime/host.ts +2 -2
  27. package/src/kernels/shared/bun-ffi.ts +24 -0
  28. package/src/kernels/shared/kernel-memory-host.ts +30 -7
  29. package/src/kernels/shared/process-cpu.ts +7 -3
  30. package/src/kernels/shared/process-group-cpu.ts +6 -3
  31. package/src/kernels/shared/subprocess-kernel.ts +29 -3
  32. package/src/kernels/shared/subprocess-memory-globals.ts +101 -0
  33. package/src/kernels/shared/subprocess-process.ts +20 -12
  34. package/src/kernels/shared/subprocess-queue.ts +1 -0
  35. package/src/tool/eval-tool.ts +2 -1
  36. package/src/tool/render-agent.ts +110 -0
  37. package/src/tool/render-blocks.ts +252 -0
  38. package/src/tool/render-call.ts +130 -0
  39. package/src/tool/render-cell.ts +165 -0
  40. package/src/tool/render-detail.ts +152 -0
  41. package/src/tool/render-live.ts +288 -0
  42. package/src/tool/render-result.ts +202 -0
  43. package/src/tool/render-status.ts +166 -0
  44. package/src/tool/render-tail.ts +139 -0
  45. package/src/tool/render.ts +3 -1128
  46. package/src/tool/run-eval-cell.ts +7 -12
  47. 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 (!("describeKernelTools" in kernel) || typeof kernel.describeKernelTools !== "function") return undefined;
360
- const withTools = kernel as EvalKernel & {
361
- describeKernelTools: (names: readonly string[]) => Promise<KernelToolsDescribeResult>;
362
- invokeKernelTool: ExtensionKernelTools["invoke"];
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: (names) => withTools.describeKernelTools(names),
367
- invoke: (request, options) => withTools.invokeKernelTool(request, options),
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 { AgentToolResult, AgentToolUpdateCallback, KernelPreludeContribution } from "@code-yeongyu/senpi";
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 {