taskplane 0.23.9 → 0.23.10

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.
@@ -14,8 +14,21 @@ import { fileURLToPath } from "node:url";
14
14
  import { dirname, join } from "node:path";
15
15
 
16
16
  const __dirname = dirname(fileURLToPath(import.meta.url));
17
- // TP-115: Disable jiti filesystem cache to prevent stale compiled code
18
- // after npm update. Without this, jiti serves old cached .mjs even when
19
- // the .ts source files have been updated by a new package version.
20
- const jiti = createJiti(import.meta.url, { cache: false });
17
+
18
+ // TP-115: Purge jiti cache for taskplane modules before loading.
19
+ // Pi's main process caches compiled .ts .mjs at $TEMP/jiti/.
20
+ // The engine-worker fork must compile fresh from current source files,
21
+ // not use stale cached versions from Pi's startup.
22
+ import { readdirSync, unlinkSync } from "node:fs";
23
+ import { tmpdir } from "node:os";
24
+ try {
25
+ const cacheDir = join(tmpdir(), "jiti");
26
+ for (const f of readdirSync(cacheDir)) {
27
+ if (f.startsWith("taskplane-") && f.endsWith(".mjs")) {
28
+ try { unlinkSync(join(cacheDir, f)); } catch {}
29
+ }
30
+ }
31
+ } catch { /* cache dir may not exist */ }
32
+
33
+ const jiti = createJiti(import.meta.url);
21
34
  await jiti.import(join(__dirname, "engine-worker.ts"));
@@ -2268,7 +2268,7 @@ export async function executeOrchBatch(
2268
2268
  const w = snap.worker || {};
2269
2269
  const r = snap.reviewer || {};
2270
2270
  // Key by session name (match lane record) for per-task lookup
2271
- const laneRec = batchState.lanes.find((l: { laneNumber: number }) => l.laneNumber === snap.laneNumber);
2271
+ const laneRec = (batchState.lanes || []).find((l: { laneNumber: number }) => l.laneNumber === snap.laneNumber);
2272
2272
  const key = laneRec?.tmuxSessionName || `lane-${snap.laneNumber}`;
2273
2273
  laneTokens.set(key, {
2274
2274
  input: (w.inputTokens || 0) + (r.inputTokens || 0),
@@ -2282,6 +2282,7 @@ export async function executeOrchBatch(
2282
2282
  }
2283
2283
  } catch { /* runtime dir may not exist */ }
2284
2284
 
2285
+
2285
2286
  // Legacy fallback: lane-state-*.json sidecars (only if V2 found nothing)
2286
2287
  if (laneTokens.size === 0) {
2287
2288
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "taskplane",
3
- "version": "0.23.9",
3
+ "version": "0.23.10",
4
4
  "description": "AI agent orchestration for pi — parallel task execution with checkpoint discipline",
5
5
  "keywords": [
6
6
  "pi-package",