@narumitw/pi-codex-compact 0.47.1 → 0.49.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@narumitw/pi-codex-compact",
3
- "version": "0.47.1",
3
+ "version": "0.49.2",
4
4
  "description": "Experimental Codex Remote Compaction V2 for Pi's OpenAI Codex provider.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -29,7 +29,7 @@
29
29
  "typecheck": "tsc --noEmit"
30
30
  },
31
31
  "dependencies": {
32
- "@narumitw/pi-tui-kit": "^0.45.0"
32
+ "@narumitw/pi-tui-kit": "^0.49.1"
33
33
  },
34
34
  "peerDependencies": {
35
35
  "@earendil-works/pi-agent-core": "*",
@@ -1,5 +1,5 @@
1
1
  import type { ExtensionCommandContext } from "@earendil-works/pi-coding-agent";
2
- import { defineMenu, runMenu } from "@narumitw/pi-tui-kit";
2
+ import type { MenuDefinition } from "@narumitw/pi-tui-kit";
3
3
  import type {
4
4
  CodexCompactSettings,
5
5
  CodexCompactSettingsRuntime,
@@ -63,8 +63,8 @@ async function update(
63
63
  export function createCodexCompactMenu(
64
64
  runtime: CodexCompactSettingsRuntime,
65
65
  options: { onCompactRequested?: () => void; status?: CompactMenuStatus } = {},
66
- ) {
67
- return defineMenu<CodexCompactSettingsState, Screen, Action, ExtensionCommandContext>({
66
+ ): MenuDefinition<CodexCompactSettingsState, Screen, Action, ExtensionCommandContext> {
67
+ return {
68
68
  start: "main",
69
69
  screens: {
70
70
  main: ({ state }) => ({
@@ -178,7 +178,7 @@ export function createCodexCompactMenu(
178
178
  "set-notify": ({ ctx, value, signal }) =>
179
179
  update(runtime, ctx, { notifyOnFallback: value === "On" }, signal),
180
180
  },
181
- });
181
+ };
182
182
  }
183
183
 
184
184
  export async function showCodexCompactMenu(
@@ -190,6 +190,8 @@ export async function showCodexCompactMenu(
190
190
  ctx.ui.notify(`Edit Codex compaction settings at ${safeText(runtime.get().path)}.`, "info");
191
191
  return;
192
192
  }
193
+ const { runMenu } = await import("@narumitw/pi-tui-kit");
194
+ if (owner.signal.aborted || !owner.isCurrent()) return;
193
195
  let compactRequested = false;
194
196
  await runMenu(
195
197
  ctx,