pi-fabric 0.51.0 → 0.51.1
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/dist/agents/session-export.d.ts +16 -9
- package/dist/agents/session-export.d.ts.map +1 -1
- package/dist/chunks/{chunk-W57AXNHR.js → chunk-RMO4VHZ4.js} +3 -2
- package/dist/chunks/chunk-RMO4VHZ4.js.map +7 -0
- package/dist/chunks/{fabric-runtime-state-NP7VH5TC.js → fabric-runtime-state-ZXNYGZUY.js} +2 -2
- package/dist/chunks/{settings-O7TJU56G.js → settings-6KMEMXDJ.js} +3 -3
- package/dist/chunks/{settings-O7TJU56G.js.map → settings-6KMEMXDJ.js.map} +2 -2
- package/dist/index.js +2 -2
- package/dist/residency/host.js +1 -1
- package/docs/configuration.md +12 -6
- package/package.json +1 -1
- package/dist/chunks/chunk-W57AXNHR.js.map +0 -7
- /package/dist/chunks/{fabric-runtime-state-NP7VH5TC.js.map → fabric-runtime-state-ZXNYGZUY.js.map} +0 -0
|
@@ -1,18 +1,21 @@
|
|
|
1
1
|
import type { FabricAgentConfig } from "../config.js";
|
|
2
2
|
/**
|
|
3
3
|
* Host-side resolution for the usage export store written by spawned workers
|
|
4
|
-
* (see worker/session-export.ts).
|
|
5
|
-
*
|
|
4
|
+
* (see worker/session-export.ts). Files follow the pi-format store layout that
|
|
5
|
+
* tokscale and ccusage already scan:
|
|
6
6
|
*
|
|
7
|
-
* <root>/sessions/<encoded-cwd>/<timestamp>_<runId>.jsonl
|
|
7
|
+
* <root>/sessions/.fabric/<encoded-cwd>/<timestamp>_<runId>.jsonl
|
|
8
8
|
*
|
|
9
|
-
*
|
|
9
|
+
* Both trackers walk their session roots recursively, while pi's own resume
|
|
10
|
+
* picker only reads its immediate "<encoded-cwd>" directory — so hosting the
|
|
11
|
+
* export under the ".fabric" namespace inside pi's store makes trackers count
|
|
12
|
+
* subagent usage with zero configuration while pi itself never lists these
|
|
13
|
+
* files. Root resolves as:
|
|
10
14
|
*
|
|
11
|
-
* PI_FABRIC_AGENT_DIR env > agents.sessionExportDir > ~/.pi
|
|
15
|
+
* PI_FABRIC_AGENT_DIR env > agents.sessionExportDir > ~/.pi/agent
|
|
12
16
|
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
* therefore ingest this store unmodified.
|
|
17
|
+
* Prefer an isolated store instead? Set agents.sessionExportDir to
|
|
18
|
+
* ~/.pi-fabric/agent and register it as a ccusage pi.stores named store.
|
|
16
19
|
*/
|
|
17
20
|
export declare const SESSION_EXPORT_ENV = "PI_FABRIC_AGENT_DIR";
|
|
18
21
|
/**
|
|
@@ -24,6 +27,10 @@ export declare const SESSION_EXPORT_ENV = "PI_FABRIC_AGENT_DIR";
|
|
|
24
27
|
export declare const encodeSessionExportCwd: (cwd: string) => string;
|
|
25
28
|
/** Root of the export store, or undefined when `agents.sessionExport` is off. */
|
|
26
29
|
export declare const resolveSessionExportDir: (config: FabricAgentConfig) => string | undefined;
|
|
27
|
-
/**
|
|
30
|
+
/**
|
|
31
|
+
* Final JSONL path for one run: `<root>/sessions/.fabric/<encoded-cwd>/<ts>_<runId>.jsonl`.
|
|
32
|
+
* The ".fabric" namespace is deliberate: tokscale (walkdir) and ccusage both
|
|
33
|
+
* recurse past it, but pi's per-project resume picker never descends into it.
|
|
34
|
+
*/
|
|
28
35
|
export declare const sessionExportFileFor: (root: string, cwd: string, runId: string, at: Date) => string;
|
|
29
36
|
//# sourceMappingURL=session-export.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session-export.d.ts","sourceRoot":"","sources":["../../src/agents/session-export.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAEtD
|
|
1
|
+
{"version":3,"file":"session-export.d.ts","sourceRoot":"","sources":["../../src/agents/session-export.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAEtD;;;;;;;;;;;;;;;;;GAiBG;AAEH,eAAO,MAAM,kBAAkB,wBAAwB,CAAC;AASxD;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB,GAAI,KAAK,MAAM,KAAG,MACqB,CAAC;AAE3E,iFAAiF;AACjF,eAAO,MAAM,uBAAuB,GAAI,QAAQ,iBAAiB,KAAG,MAAM,GAAG,SAO5E,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,GAC/B,MAAM,MAAM,EACZ,KAAK,MAAM,EACX,OAAO,MAAM,EACb,IAAI,IAAI,KACP,MASF,CAAC"}
|
|
@@ -1449,7 +1449,7 @@ var expandHome = (value) => value === "~" ? os3.homedir() : value.startsWith("~/
|
|
|
1449
1449
|
var encodeSessionExportCwd = (cwd) => `--${path5.resolve(cwd).replace(/^[/\\]/, "").replace(/[/\\:]/g, "-")}--`;
|
|
1450
1450
|
var resolveSessionExportDir = (config) => {
|
|
1451
1451
|
if (!config.sessionExport) return void 0;
|
|
1452
|
-
const raw = process.env[SESSION_EXPORT_ENV]?.trim() || config.sessionExportDir.trim() || path5.join(os3.homedir(), ".pi
|
|
1452
|
+
const raw = process.env[SESSION_EXPORT_ENV]?.trim() || config.sessionExportDir.trim() || path5.join(os3.homedir(), ".pi", "agent");
|
|
1453
1453
|
return expandHome(raw);
|
|
1454
1454
|
};
|
|
1455
1455
|
var sessionExportFileFor = (root, cwd, runId, at) => {
|
|
@@ -1457,6 +1457,7 @@ var sessionExportFileFor = (root, cwd, runId, at) => {
|
|
|
1457
1457
|
return path5.join(
|
|
1458
1458
|
root,
|
|
1459
1459
|
"sessions",
|
|
1460
|
+
".fabric",
|
|
1460
1461
|
encodeSessionExportCwd(cwd),
|
|
1461
1462
|
`${fileTimestamp}_${runId}.jsonl`
|
|
1462
1463
|
);
|
|
@@ -5490,4 +5491,4 @@ export {
|
|
|
5490
5491
|
residentRoot,
|
|
5491
5492
|
residentDeliveryPrefix
|
|
5492
5493
|
};
|
|
5493
|
-
//# sourceMappingURL=chunk-
|
|
5494
|
+
//# sourceMappingURL=chunk-RMO4VHZ4.js.map
|