pi-fabric 0.92.19 → 0.92.21

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 (44) hide show
  1. package/dist/agents.js +3 -3
  2. package/dist/chunks/chunk-EDL4JDW7.js +184 -0
  3. package/dist/chunks/chunk-EDL4JDW7.js.map +7 -0
  4. package/dist/chunks/{chunk-3KOK4CPR.js → chunk-EFHCXJTV.js} +2 -2
  5. package/dist/chunks/{chunk-4U5NR5VF.js → chunk-KI4VAMHK.js} +8 -8
  6. package/dist/chunks/{chunk-NIUOPHLB.js → chunk-MAP2LVSM.js} +123 -123
  7. package/dist/chunks/chunk-MAP2LVSM.js.map +7 -0
  8. package/dist/chunks/{chunk-VHEO26TE.js → chunk-NSTQH46Z.js} +5 -5
  9. package/dist/chunks/{chunk-TPLMVELH.js → chunk-VYXFSUWU.js} +4 -4
  10. package/dist/chunks/{chunk-DW5MTOJP.js → chunk-XFSRHUZH.js} +5 -5
  11. package/dist/chunks/{chunk-OP2KTYQB.js → chunk-ZMIJ6AT4.js} +4 -4
  12. package/dist/core/action-registry.js +2 -2
  13. package/dist/fabric-runtime-state.js +16 -15
  14. package/dist/fabric-runtime-state.js.map +2 -2
  15. package/dist/index.js +13 -10
  16. package/dist/index.js.map +2 -2
  17. package/dist/jev/browser.js +2 -2
  18. package/dist/jev/observation.js +2 -2
  19. package/dist/jev.js +5 -5
  20. package/dist/memory/file-worker.d.ts +15 -0
  21. package/dist/memory/file-worker.d.ts.map +1 -0
  22. package/dist/memory/file-worker.js +44 -0
  23. package/dist/memory/file-worker.js.map +7 -0
  24. package/dist/memory/worker-provider.d.ts +24 -0
  25. package/dist/memory/worker-provider.d.ts.map +1 -0
  26. package/dist/memory/worker-provider.js +18 -0
  27. package/dist/memory/worker-provider.js.map +7 -0
  28. package/dist/prewalk/arm.d.ts.map +1 -1
  29. package/dist/providers/jev-provider.js +4 -4
  30. package/dist/residency/host.js +4 -4
  31. package/dist/residency/pi-entry.js +4 -4
  32. package/dist/runtime/typescript-kernel.js +6 -6
  33. package/dist/runtime-state-builtins.d.ts.map +1 -1
  34. package/docs/agents.md +1 -1
  35. package/docs/configuration.md +1 -1
  36. package/docs/memory-recall.md +21 -0
  37. package/package.json +2 -1
  38. package/dist/chunks/chunk-NIUOPHLB.js.map +0 -7
  39. /package/dist/chunks/{chunk-3KOK4CPR.js.map → chunk-EFHCXJTV.js.map} +0 -0
  40. /package/dist/chunks/{chunk-4U5NR5VF.js.map → chunk-KI4VAMHK.js.map} +0 -0
  41. /package/dist/chunks/{chunk-VHEO26TE.js.map → chunk-NSTQH46Z.js.map} +0 -0
  42. /package/dist/chunks/{chunk-TPLMVELH.js.map → chunk-VYXFSUWU.js.map} +0 -0
  43. /package/dist/chunks/{chunk-DW5MTOJP.js.map → chunk-XFSRHUZH.js.map} +0 -0
  44. /package/dist/chunks/{chunk-OP2KTYQB.js.map → chunk-ZMIJ6AT4.js.map} +0 -0
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  BrowserHarnessProvider,
3
3
  browserHarnessComponent
4
- } from "../chunks/chunk-TPLMVELH.js";
5
- import "../chunks/chunk-PSNXUZMY.js";
4
+ } from "../chunks/chunk-VYXFSUWU.js";
6
5
  import "../chunks/chunk-7TB7NXSL.js";
6
+ import "../chunks/chunk-PSNXUZMY.js";
7
7
  import "../chunks/chunk-G4LADAYY.js";
8
8
  import "../chunks/chunk-3YZUQESG.js";
9
9
  export {
@@ -4,9 +4,9 @@ import {
4
4
  JevSubscription,
5
5
  checkObserve,
6
6
  jevObserveSchema
7
- } from "../chunks/chunk-OP2KTYQB.js";
8
- import "../chunks/chunk-Z63R5GVN.js";
7
+ } from "../chunks/chunk-ZMIJ6AT4.js";
9
8
  import "../chunks/chunk-4SSMGBF4.js";
9
+ import "../chunks/chunk-Z63R5GVN.js";
10
10
  import "../chunks/chunk-PSNXUZMY.js";
11
11
  import "../chunks/chunk-G4LADAYY.js";
12
12
  import "../chunks/chunk-3YZUQESG.js";
package/dist/jev.js CHANGED
@@ -2,11 +2,11 @@ import {
2
2
  JEV_ACTION_DESCRIPTORS,
3
3
  JevProgramManager,
4
4
  JevProvider
5
- } from "./chunks/chunk-DW5MTOJP.js";
5
+ } from "./chunks/chunk-XFSRHUZH.js";
6
6
  import {
7
7
  BrowserHarnessProvider,
8
8
  browserHarnessComponent
9
- } from "./chunks/chunk-TPLMVELH.js";
9
+ } from "./chunks/chunk-VYXFSUWU.js";
10
10
  import {
11
11
  JevClient,
12
12
  JevCredentials
@@ -14,16 +14,16 @@ import {
14
14
  import {
15
15
  JEV_HOST_EVENTS,
16
16
  JevObservationHost
17
- } from "./chunks/chunk-OP2KTYQB.js";
18
- import "./chunks/chunk-Z63R5GVN.js";
17
+ } from "./chunks/chunk-ZMIJ6AT4.js";
19
18
  import "./chunks/chunk-4SSMGBF4.js";
19
+ import "./chunks/chunk-Z63R5GVN.js";
20
20
  import {
21
21
  createJevAuthProvider
22
22
  } from "./chunks/chunk-T3A5GNCW.js";
23
23
  import "./chunks/chunk-B74OWVAN.js";
24
24
  import "./chunks/chunk-XB3RJVT4.js";
25
- import "./chunks/chunk-PSNXUZMY.js";
26
25
  import "./chunks/chunk-7TB7NXSL.js";
26
+ import "./chunks/chunk-PSNXUZMY.js";
27
27
  import {
28
28
  DEFAULT_JEV_CONFIG,
29
29
  normalizeJevConfig
@@ -0,0 +1,15 @@
1
+ export type MemoryWorkerReply = {
2
+ id: number;
3
+ type: "progress";
4
+ text: string;
5
+ } | {
6
+ id: number;
7
+ type: "result";
8
+ value: unknown;
9
+ } | {
10
+ id: number;
11
+ type: "error";
12
+ name: string;
13
+ message: string;
14
+ };
15
+ //# sourceMappingURL=file-worker.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file-worker.d.ts","sourceRoot":"","sources":["../../src/memory/file-worker.ts"],"names":[],"mappings":"AAYA,MAAM,MAAM,iBAAiB,GACzB;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,UAAU,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAC9C;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,QAAQ,CAAC;IAAC,KAAK,EAAE,OAAO,CAAA;CAAE,GAC9C;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,OAAO,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC"}
@@ -0,0 +1,44 @@
1
+ import {
2
+ MemoryProvider
3
+ } from "../chunks/chunk-UQ4LTUH4.js";
4
+ import "../chunks/chunk-7A6NVHB5.js";
5
+ import "../chunks/chunk-U5FYOMG5.js";
6
+ import "../chunks/chunk-MGDLRV2R.js";
7
+ import "../chunks/chunk-XT4346N7.js";
8
+ import "../chunks/chunk-NQOEHX62.js";
9
+ import "../chunks/chunk-ZDNGXLEC.js";
10
+ import "../chunks/chunk-D5WKZONW.js";
11
+ import "../chunks/chunk-G4LADAYY.js";
12
+ import "../chunks/chunk-YU62DDKK.js";
13
+ import "../chunks/chunk-3YZUQESG.js";
14
+
15
+ // src/memory/file-worker.ts
16
+ import { parentPort, workerData } from "node:worker_threads";
17
+ var port = parentPort;
18
+ if (port) {
19
+ const context = workerData;
20
+ const provider = new MemoryProvider(context);
21
+ port.on("message", async (request) => {
22
+ if (request.branch) context.getLiveBranch = () => request.branch;
23
+ else delete context.getLiveBranch;
24
+ try {
25
+ const value = await provider.invoke(request.action, request.args, {
26
+ cwd: context.cwd,
27
+ signal: void 0,
28
+ parentToolCallId: "memory-worker",
29
+ nestedToolCallId: String(request.id),
30
+ extensionContext: {},
31
+ update: (text) => port.postMessage({ id: request.id, type: "progress", text })
32
+ });
33
+ port.postMessage({ id: request.id, type: "result", value });
34
+ } catch (error) {
35
+ port.postMessage({
36
+ id: request.id,
37
+ type: "error",
38
+ name: error instanceof Error ? error.name : "Error",
39
+ message: error instanceof Error ? error.message : String(error)
40
+ });
41
+ }
42
+ });
43
+ }
44
+ //# sourceMappingURL=file-worker.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/memory/file-worker.ts"],
4
+ "sourcesContent": ["import { parentPort, workerData } from \"node:worker_threads\";\nimport type { FabricInvocationContext } from \"../protocol.js\";\nimport { MemoryProvider, type MemoryProviderContext } from \"../providers/memory-provider.js\";\nimport type { LiveSessionBranch } from \"./lineage.js\";\n\ninterface MemoryWorkerRequest {\n id: number;\n action: string;\n args: Record<string, unknown>;\n branch?: LiveSessionBranch;\n}\n\nexport type MemoryWorkerReply =\n | { id: number; type: \"progress\"; text: string }\n | { id: number; type: \"result\"; value: unknown }\n | { id: number; type: \"error\"; name: string; message: string };\n\nconst port = parentPort;\nif (port) {\n const context = workerData as MemoryProviderContext;\n // One engine per worker preserves bounded continuation/expansion caches across queued calls.\n const provider = new MemoryProvider(context);\n port.on(\"message\", async (request: MemoryWorkerRequest) => {\n if (request.branch) context.getLiveBranch = () => request.branch!;\n else delete context.getLiveBranch;\n try {\n const value = await provider.invoke(request.action, request.args, {\n cwd: context.cwd,\n signal: undefined,\n parentToolCallId: \"memory-worker\",\n nestedToolCallId: String(request.id),\n extensionContext: {} as FabricInvocationContext[\"extensionContext\"],\n update: text => port.postMessage({ id: request.id, type: \"progress\", text } satisfies MemoryWorkerReply),\n });\n port.postMessage({ id: request.id, type: \"result\", value } satisfies MemoryWorkerReply);\n } catch (error) {\n port.postMessage({\n id: request.id, type: \"error\",\n name: error instanceof Error ? error.name : \"Error\",\n message: error instanceof Error ? error.message : String(error),\n } satisfies MemoryWorkerReply);\n }\n });\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;AAAA,SAAS,YAAY,kBAAkB;AAiBvC,IAAM,OAAO;AACb,IAAI,MAAM;AACR,QAAM,UAAU;AAEhB,QAAM,WAAW,IAAI,eAAe,OAAO;AAC3C,OAAK,GAAG,WAAW,OAAO,YAAiC;AACzD,QAAI,QAAQ,OAAQ,SAAQ,gBAAgB,MAAM,QAAQ;AAAA,QACrD,QAAO,QAAQ;AACpB,QAAI;AACF,YAAM,QAAQ,MAAM,SAAS,OAAO,QAAQ,QAAQ,QAAQ,MAAM;AAAA,QAChE,KAAK,QAAQ;AAAA,QACb,QAAQ;AAAA,QACR,kBAAkB;AAAA,QAClB,kBAAkB,OAAO,QAAQ,EAAE;AAAA,QACnC,kBAAkB,CAAC;AAAA,QACnB,QAAQ,UAAQ,KAAK,YAAY,EAAE,IAAI,QAAQ,IAAI,MAAM,YAAY,KAAK,CAA6B;AAAA,MACzG,CAAC;AACD,WAAK,YAAY,EAAE,IAAI,QAAQ,IAAI,MAAM,UAAU,MAAM,CAA6B;AAAA,IACxF,SAAS,OAAO;AACd,WAAK,YAAY;AAAA,QACf,IAAI,QAAQ;AAAA,QAAI,MAAM;AAAA,QACtB,MAAM,iBAAiB,QAAQ,MAAM,OAAO;AAAA,QAC5C,SAAS,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK;AAAA,MAChE,CAA6B;AAAA,IAC/B;AAAA,EACF,CAAC;AACH;",
6
+ "names": []
7
+ }
@@ -0,0 +1,24 @@
1
+ import type { FabricInvocationContext } from "../protocol.js";
2
+ import { MemoryProvider, type MemoryProviderContext } from "../providers/memory-provider.js";
3
+ /** Pi-facing file memory: one lazy worker, bounded FIFO, no transcript work on the UI thread. */
4
+ export declare class WorkerMemoryProvider extends MemoryProvider {
5
+ private readonly workerContext;
6
+ private readonly workerUrl;
7
+ private worker;
8
+ private active;
9
+ private readonly pending;
10
+ private idleTimer;
11
+ private stopping;
12
+ private closed;
13
+ private nextId;
14
+ constructor(workerContext: MemoryProviderContext, workerUrl?: URL);
15
+ invoke(action: string, args: Record<string, unknown>, invocation: FabricInvocationContext): Promise<unknown>;
16
+ private snapshot;
17
+ private start;
18
+ private finish;
19
+ private failWorker;
20
+ private pump;
21
+ private retire;
22
+ close(): Promise<void>;
23
+ }
24
+ //# sourceMappingURL=worker-provider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"worker-provider.d.ts","sourceRoot":"","sources":["../../src/memory/worker-provider.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AAC9D,OAAO,EAAE,cAAc,EAAE,KAAK,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AAuB7F,iGAAiG;AACjG,qBAAa,oBAAqB,SAAQ,cAAc;IAUpD,OAAO,CAAC,QAAQ,CAAC,aAAa;IAC9B,OAAO,CAAC,QAAQ,CAAC,SAAS;IAV5B,OAAO,CAAC,MAAM,CAAqB;IACnC,OAAO,CAAC,MAAM,CAAsB;IACpC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAiB;IACzC,OAAO,CAAC,SAAS,CAA6B;IAC9C,OAAO,CAAC,QAAQ,CAA4B;IAC5C,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,MAAM,CAAK;gBAGA,aAAa,EAAE,qBAAqB,EACpC,SAAS,MAAuD;IAKpE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,UAAU,EAAE,uBAAuB,GAAG,OAAO,CAAC,OAAO,CAAC;IAgC3H,OAAO,CAAC,QAAQ;IAqBhB,OAAO,CAAC,KAAK;IA0Cb,OAAO,CAAC,MAAM;IAMd,OAAO,CAAC,UAAU;IAQlB,OAAO,CAAC,IAAI;IA4BZ,OAAO,CAAC,MAAM;IAeR,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;CAS7B"}
@@ -0,0 +1,18 @@
1
+ import {
2
+ WorkerMemoryProvider
3
+ } from "../chunks/chunk-EDL4JDW7.js";
4
+ import "../chunks/chunk-UQ4LTUH4.js";
5
+ import "../chunks/chunk-7A6NVHB5.js";
6
+ import "../chunks/chunk-U5FYOMG5.js";
7
+ import "../chunks/chunk-MGDLRV2R.js";
8
+ import "../chunks/chunk-XT4346N7.js";
9
+ import "../chunks/chunk-NQOEHX62.js";
10
+ import "../chunks/chunk-ZDNGXLEC.js";
11
+ import "../chunks/chunk-D5WKZONW.js";
12
+ import "../chunks/chunk-G4LADAYY.js";
13
+ import "../chunks/chunk-YU62DDKK.js";
14
+ import "../chunks/chunk-3YZUQESG.js";
15
+ export {
16
+ WorkerMemoryProvider
17
+ };
18
+ //# sourceMappingURL=worker-provider.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "sourcesContent": [],
5
+ "mappings": "",
6
+ "names": []
7
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"arm.d.ts","sourceRoot":"","sources":["../../src/prewalk/arm.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACtF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAUtD,eAAO,MAAM,uBAAuB,GAClC,OAAO,WAAW,EAClB,SAAS,gBAAgB,EACzB,IAAI,YAAY,EAChB,OAAO;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,KACtC,OAAO,CAAC,IAAI,CAiCd,CAAC;AAUF,eAAO,MAAM,oBAAoB,GAC/B,OAAO,WAAW,EAClB,SAAS,gBAAgB,EACzB,IAAI,YAAY,KACf,OAAO,CAAC,MAAM,GAAG,SAAS,CAkB5B,CAAC"}
1
+ {"version":3,"file":"arm.d.ts","sourceRoot":"","sources":["../../src/prewalk/arm.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACtF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAWtD,eAAO,MAAM,uBAAuB,GAClC,OAAO,WAAW,EAClB,SAAS,gBAAgB,EACzB,IAAI,YAAY,EAChB,OAAO;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,KACtC,OAAO,CAAC,IAAI,CAiCd,CAAC;AAUF,eAAO,MAAM,oBAAoB,GAC/B,OAAO,WAAW,EAClB,SAAS,gBAAgB,EACzB,IAAI,YAAY,KACf,OAAO,CAAC,MAAM,GAAG,SAAS,CAuB5B,CAAC"}
@@ -4,15 +4,15 @@ import {
4
4
  jevAdviceSchema,
5
5
  jevLaunchSchema,
6
6
  jevRequestSchema
7
- } from "../chunks/chunk-DW5MTOJP.js";
7
+ } from "../chunks/chunk-XFSRHUZH.js";
8
8
  import "../chunks/chunk-M3S7XITB.js";
9
- import "../chunks/chunk-OP2KTYQB.js";
10
- import "../chunks/chunk-Z63R5GVN.js";
9
+ import "../chunks/chunk-ZMIJ6AT4.js";
11
10
  import "../chunks/chunk-4SSMGBF4.js";
11
+ import "../chunks/chunk-Z63R5GVN.js";
12
12
  import "../chunks/chunk-B74OWVAN.js";
13
13
  import "../chunks/chunk-XB3RJVT4.js";
14
- import "../chunks/chunk-PSNXUZMY.js";
15
14
  import "../chunks/chunk-7TB7NXSL.js";
15
+ import "../chunks/chunk-PSNXUZMY.js";
16
16
  import "../chunks/chunk-SH6PXPNJ.js";
17
17
  import "../chunks/chunk-D5WKZONW.js";
18
18
  import "../chunks/chunk-G4LADAYY.js";
@@ -1,16 +1,16 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  runResidentHostFromConfigPath
4
- } from "../chunks/chunk-3KOK4CPR.js";
5
- import "../chunks/chunk-4U5NR5VF.js";
4
+ } from "../chunks/chunk-EFHCXJTV.js";
5
+ import "../chunks/chunk-KI4VAMHK.js";
6
6
  import "../chunks/chunk-X7G62ZGH.js";
7
- import "../chunks/chunk-PM5I335G.js";
8
7
  import "../chunks/chunk-VPPIJRNZ.js";
8
+ import "../chunks/chunk-PM5I335G.js";
9
9
  import "../chunks/chunk-TSRKCXNI.js";
10
10
  import "../chunks/chunk-IWH6PCMK.js";
11
11
  import "../chunks/chunk-PXAICAUT.js";
12
- import "../chunks/chunk-YQFAHWGE.js";
13
12
  import "../chunks/chunk-CGPK5WHX.js";
13
+ import "../chunks/chunk-YQFAHWGE.js";
14
14
  import "../chunks/chunk-OKOHRXGF.js";
15
15
  import "../chunks/chunk-QLJ5P7HV.js";
16
16
  import "../chunks/chunk-U3FNEK2H.js";
@@ -1,15 +1,15 @@
1
1
  import {
2
2
  runResidentHostFromConfigPath
3
- } from "../chunks/chunk-3KOK4CPR.js";
4
- import "../chunks/chunk-4U5NR5VF.js";
3
+ } from "../chunks/chunk-EFHCXJTV.js";
4
+ import "../chunks/chunk-KI4VAMHK.js";
5
5
  import "../chunks/chunk-X7G62ZGH.js";
6
- import "../chunks/chunk-PM5I335G.js";
7
6
  import "../chunks/chunk-VPPIJRNZ.js";
7
+ import "../chunks/chunk-PM5I335G.js";
8
8
  import "../chunks/chunk-TSRKCXNI.js";
9
9
  import "../chunks/chunk-IWH6PCMK.js";
10
10
  import "../chunks/chunk-PXAICAUT.js";
11
- import "../chunks/chunk-YQFAHWGE.js";
12
11
  import "../chunks/chunk-CGPK5WHX.js";
12
+ import "../chunks/chunk-YQFAHWGE.js";
13
13
  import "../chunks/chunk-OKOHRXGF.js";
14
14
  import "../chunks/chunk-QLJ5P7HV.js";
15
15
  import "../chunks/chunk-U3FNEK2H.js";
@@ -1,9 +1,3 @@
1
- import {
2
- buildCoreOverrideGuestDeclarations
3
- } from "../chunks/chunk-RETQZJ4K.js";
4
- import {
5
- buildDynamicGuestDeclarations
6
- } from "../chunks/chunk-KYXZJNV6.js";
7
1
  import {
8
2
  BunProcessRuntime,
9
3
  NodeProcessRuntime
@@ -16,6 +10,12 @@ import {
16
10
  } from "../chunks/chunk-N5GUXC6F.js";
17
11
  import "../chunks/chunk-YU4O6SWQ.js";
18
12
  import "../chunks/chunk-PAN6C3JM.js";
13
+ import {
14
+ buildCoreOverrideGuestDeclarations
15
+ } from "../chunks/chunk-RETQZJ4K.js";
16
+ import {
17
+ buildDynamicGuestDeclarations
18
+ } from "../chunks/chunk-KYXZJNV6.js";
19
19
  import {
20
20
  repairFabricGuestCode
21
21
  } from "../chunks/chunk-VXZZJ44D.js";
@@ -1 +1 @@
1
- {"version":3,"file":"runtime-state-builtins.d.ts","sourceRoot":"","sources":["../src/runtime-state-builtins.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAExE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAChE,OAAO,EAA2B,KAAK,uBAAuB,EAAE,KAAK,+BAA+B,EAAE,MAAM,oCAAoC,CAAC;AACjJ,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAEhE,OAAO,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAQhF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAGhE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAE3D,oFAAoF;AACpF,qBAAa,oBAAoB;IAE7B,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,WAAW;IAC5B,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAC;gBAHZ,QAAQ,EAAE,+BAA+B,EACzC,QAAQ,EAAE,cAAc,EACxB,WAAW,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,EACnC,WAAW,CAAC,EAAE,iBAAiB,YAAA;IAG5C,OAAO,CAAC,SAAS,EAAE,uBAAuB,GAAG,OAAO,CAAC,IAAI,CAAC;IAK1D,KAAK,CACT,GAAG,EAAE,MAAM,EACX,MAAM,EAAE,YAAY,EACpB,aAAa,EAAE,mBAAmB,EAClC,KAAK,CAAC,EAAE;QAAE,IAAI,EAAE,mBAAmB,CAAC;QAAC,SAAS,EAAE,MAAM,MAAM,CAAA;KAAE,GAC7D,OAAO,CAAC,IAAI,CAAC;IAoEV,IAAI,CAAC,MAAM,EAAE,YAAY,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,YAAY,EAAE,YAAY,EAAE,oBAAoB,GAAG,OAAO,CAAC,IAAI,CAAC;IA0BtH,MAAM,CAAC,OAAO,EAAE,gBAAgB,EAAE,MAAM,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IA6B/F,YAAY,CAAC,MAAM,EAAE,YAAY,GAAG,IAAI;CAczC"}
1
+ {"version":3,"file":"runtime-state-builtins.d.ts","sourceRoot":"","sources":["../src/runtime-state-builtins.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAExE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAChE,OAAO,EAA2B,KAAK,uBAAuB,EAAE,KAAK,+BAA+B,EAAE,MAAM,oCAAoC,CAAC;AACjJ,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAEhE,OAAO,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAShF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAGhE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAE3D,oFAAoF;AACpF,qBAAa,oBAAoB;IAE7B,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,WAAW;IAC5B,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAC;gBAHZ,QAAQ,EAAE,+BAA+B,EACzC,QAAQ,EAAE,cAAc,EACxB,WAAW,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,EACnC,WAAW,CAAC,EAAE,iBAAiB,YAAA;IAG5C,OAAO,CAAC,SAAS,EAAE,uBAAuB,GAAG,OAAO,CAAC,IAAI,CAAC;IAK1D,KAAK,CACT,GAAG,EAAE,MAAM,EACX,MAAM,EAAE,YAAY,EACpB,aAAa,EAAE,mBAAmB,EAClC,KAAK,CAAC,EAAE;QAAE,IAAI,EAAE,mBAAmB,CAAC;QAAC,SAAS,EAAE,MAAM,MAAM,CAAA;KAAE,GAC7D,OAAO,CAAC,IAAI,CAAC;IAoEV,IAAI,CAAC,MAAM,EAAE,YAAY,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,YAAY,EAAE,YAAY,EAAE,oBAAoB,GAAG,OAAO,CAAC,IAAI,CAAC;IA0BtH,MAAM,CAAC,OAAO,EAAE,gBAAgB,EAAE,MAAM,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IA6B/F,YAAY,CAAC,MAAM,EAAE,YAAY,GAAG,IAAI;CAczC"}
package/docs/agents.md CHANGED
@@ -172,7 +172,7 @@ After an explicit handoff settles, Fabric queues one visible `pi-fabric-handoff-
172
172
  /fabric prewalk --enable
173
173
  ```
174
174
 
175
- When you supply a task, Fabric arms prewalk and immediately submits the task to Main. Without a task, it captures the next user input. Select the executor in `/fabric settings` under **Prewalk**. **Always re-arm** uses `prewalk.model` to arm prewalk automatically at each session start without interaction. It also arms prewalk after each completed handoff. `/fabric prewalk --off` cancels only the current session arm. `/fabric prewalk --disable` persists the master switch to the project config when trusted (global config otherwise), cancels any live arm, and keeps prewalk inert after restart; `--enable` reverses it.
175
+ When you supply a task, Fabric arms prewalk and immediately submits the task to Main. Without a task, it captures the next user input. Select the executor in `/fabric settings` under **Prewalk**. **Always re-arm** uses `prewalk.model` to arm prewalk automatically at each Main session start without interaction. It also arms prewalk after each completed handoff. Child agents and actors do not auto-arm from inherited settings, so trajectory executors finish their assigned work instead of handing it off again on their first write. Explicit arming remains available. `/fabric prewalk --off` cancels only the current session arm. `/fabric prewalk --disable` persists the master switch to the project config when trusted (global config otherwise), cancels any live arm, and keeps prewalk inert after restart; `--enable` reverses it.
176
176
 
177
177
  Host extensions that must serialize work after prewalk can use the acknowledged protocol exported from `pi-fabric/protocol`. Emit `FABRIC_PREWALK_REQUEST_EVENT` with `{ version: 1, context, claim, respond }`. Fabric calls `claim()` synchronously; the first claimant owns the request. It calls `respond({ ok: true })` only after prewalk is armed, or `respond({ ok: false, error })` after cancellation or failure. A request that is not claimed means no compatible Fabric runtime is installed. The protocol intentionally arms without submitting a task, so the caller can deliver its next queued row only after the acknowledgment.
178
178
 
@@ -239,7 +239,7 @@ Unknown definitions stay visible as waiting. They do not fail the Fabric runtime
239
239
 
240
240
  `prewalk.thinking` sets the optional reasoning effort for the trajectory child executor. Its values are `off` / `minimal` / `low` / `medium` / `high` / `xhigh` / `max`, clamped to each model's supported levels. When you leave it unset, the executor inherits `agents.thinking`. In-place mode keeps Main's session level.
241
241
 
242
- `prewalk.alwaysRearm` defaults to `false`. When enabled, prewalk returns to an armed, taskless state after each completed handoff (in-place return or trajectory completion). Every session then starts armed automatically, non-interactively from `prewalk.model`, and `/fabric reload` re-arms as well. `/fabric prewalk --off` cancels the armed state until the next session start or reload. Turns that settle without a handoff never disarm prewalk, regardless of this setting. The settings UI labels an unset model **Ask each time**. Non-interactive sessions must configure a model. In-place mode does not require child agents. Trajectory mode requires `agents.enabled`. It shows child spawn, progress, nested tools, metrics, and completion in Main's Fabric activity UI.
242
+ `prewalk.alwaysRearm` defaults to `false`. When enabled, prewalk returns to an armed, taskless state after each completed handoff (in-place return or trajectory completion). Every Main session then starts armed automatically, non-interactively from `prewalk.model`, and `/fabric reload` re-arms Main as well. Child agents and actors never auto-arm from inherited settings; explicit arming is unaffected. `/fabric prewalk --off` cancels the armed state until the next session start or reload. Turns that settle without a handoff never disarm prewalk, regardless of this setting. The settings UI labels an unset model **Ask each time**. Non-interactive sessions must configure a model. In-place mode does not require child agents. Trajectory mode requires `agents.enabled`. It shows child spawn, progress, nested tools, metrics, and completion in Main's Fabric activity UI.
243
243
 
244
244
  `prewalk.detectShellWrites` defaults to `true`. When armed, a `fabric_exec` boundary that ran a successful `pi.bash` or `pi.powershell` without an audited `pi.edit` / `pi.write` / `schema.commit` claims the handoff if file size or mtime stats drifted from the arm-time baseline. This routes shell heredocs and formatter binaries to the executor as well. The report's `trigger.files` lists the bounded drifted paths. Set it to `false` to accept audited mutations only.
245
245
 
@@ -287,6 +287,27 @@ regex result never counts as an authoritative no-match.
287
287
 
288
288
  ## Tiers, refresh, and work budgets
289
289
 
290
+ Pi's built-in filesystem memory provider runs recall, expansion, and session
291
+ listing in one lazy worker thread. Discovery, source hashing, JSON parsing,
292
+ cache maintenance, and ranking do not run on Pi's input/render thread. A
293
+ burst of calls shares a FIFO queue (at most 64 outstanding requests), rather
294
+ than spawning a CPU-heavy worker for every recall. Aborting an active call
295
+ terminates its worker; queued calls can be cancelled independently. Idle
296
+ workers are unreferenced and released after 30 seconds, and provider teardown
297
+ terminates outstanding work. A missing worker artifact is an error, not a
298
+ silent fallback to blocking execution.
299
+
300
+ Live-session branch snapshots carry entry IDs only, are taken when each
301
+ queued request starts, and are checked again before returning its result.
302
+ Navigation during retrieval rejects the request instead of returning evidence
303
+ from a different live branch. Registered host-backed adapters remain in their
304
+ authorized owning host and keep their existing cancellation contracts.
305
+
306
+ `bun run benchmark:memory-recall` exercises a burst of 13 cold-session recalls
307
+ and reports both retrieval time and host event-loop heartbeat gaps. Pass
308
+ `--inline` directly to `node scripts/benchmark-memory-recall.mjs` to compare
309
+ with the synchronous engine used internally by the worker.
310
+
290
311
  The `memory.hotSessions` most recently modified sessions stay hot. Every
291
312
  older session is cold. Once a session crosses the boundary, Fabric drops
292
313
  the old derived tier record after building the replacement. Explicit
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-fabric",
3
- "version": "0.92.19",
3
+ "version": "0.92.21",
4
4
  "description": "A programmable tool and agent runtime for Pi",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -53,6 +53,7 @@
53
53
  "certify:entropy": "bun run build && node scripts/certify-entropy.mjs",
54
54
  "benchmark:real-resume": "bun run build && node scripts/benchmark-real-resume.mjs",
55
55
  "benchmark:memory-heads": "bun run build && node scripts/benchmark-memory-heads.mjs",
56
+ "benchmark:memory-recall": "bun run build && node scripts/benchmark-memory-recall.mjs",
56
57
  "benchmark:conversation": "bun run build && node --expose-gc scripts/benchmark-conversation.mjs",
57
58
  "benchmark:activity": "node --expose-gc scripts/benchmark-activity.mjs",
58
59
  "benchmark:turn-cpu": "node scripts/benchmark-turn-cpu.mjs",