pi-fabric 0.65.0 → 0.65.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/dist/agents/manager.d.ts.map +1 -1
- package/dist/agents/pi-binary.d.ts +7 -0
- package/dist/agents/pi-binary.d.ts.map +1 -0
- package/dist/chunks/{chunk-LNLQOUUR.js → chunk-3XLK3HIF.js} +100 -76
- package/dist/chunks/chunk-3XLK3HIF.js.map +7 -0
- package/dist/chunks/{chunk-RGHBZ6D4.js → chunk-IUBTHPXQ.js} +3 -2
- package/dist/chunks/chunk-IUBTHPXQ.js.map +7 -0
- package/dist/chunks/{dashboard-NTBV66TP.js → dashboard-S3TINWGZ.js} +2 -2
- package/dist/chunks/{fabric-runtime-state-EW66PRZY.js → fabric-runtime-state-BJPHJM6A.js} +10 -9
- package/dist/chunks/fabric-runtime-state-BJPHJM6A.js.map +7 -0
- package/dist/chunks/{settings-WDHCKZZK.js → settings-REH4ESIW.js} +6 -3
- package/dist/chunks/{settings-WDHCKZZK.js.map → settings-REH4ESIW.js.map} +2 -2
- package/dist/commands/fabric.d.ts.map +1 -1
- package/dist/fabric-runtime-state.d.ts +1 -1
- package/dist/fabric-runtime-state.d.ts.map +1 -1
- package/dist/index.js +37 -11
- package/dist/index.js.map +2 -2
- package/dist/residency/host.js +1 -1
- package/dist/ui/highlight.d.ts.map +1 -1
- package/dist/ui/settings.d.ts +1 -1
- package/dist/ui/settings.d.ts.map +1 -1
- package/dist/ui/tool-display.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/chunks/chunk-LNLQOUUR.js.map +0 -7
- package/dist/chunks/chunk-RGHBZ6D4.js.map +0 -7
- package/dist/chunks/fabric-runtime-state-EW66PRZY.js.map +0 -7
- /package/dist/chunks/{dashboard-NTBV66TP.js.map → dashboard-S3TINWGZ.js.map} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manager.d.ts","sourceRoot":"","sources":["../../src/agents/manager.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,0 +1,7 @@
|
|
|
1
|
+
export interface PiBinaryResolutionOptions {
|
|
2
|
+
env?: NodeJS.ProcessEnv;
|
|
3
|
+
homeDirectory?: string;
|
|
4
|
+
isExecutable?: (file: string) => boolean;
|
|
5
|
+
}
|
|
6
|
+
export declare const resolvePiBinary: (configured?: string, options?: PiBinaryResolutionOptions) => string;
|
|
7
|
+
//# sourceMappingURL=pi-binary.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pi-binary.d.ts","sourceRoot":"","sources":["../../src/agents/pi-binary.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,yBAAyB;IACxC,GAAG,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC;IACxB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC;CAC1C;AAWD,eAAO,MAAM,eAAe,GAC1B,aAAa,MAAM,EACnB,UAAS,yBAA8B,KACtC,MAWF,CAAC"}
|
|
@@ -736,6 +736,29 @@ ${Date.now()}
|
|
|
736
736
|
}
|
|
737
737
|
};
|
|
738
738
|
|
|
739
|
+
// src/agents/pi-binary.ts
|
|
740
|
+
import { accessSync, constants } from "node:fs";
|
|
741
|
+
import { homedir } from "node:os";
|
|
742
|
+
import path2 from "node:path";
|
|
743
|
+
var executable = (file) => {
|
|
744
|
+
try {
|
|
745
|
+
accessSync(file, constants.X_OK);
|
|
746
|
+
return true;
|
|
747
|
+
} catch {
|
|
748
|
+
return false;
|
|
749
|
+
}
|
|
750
|
+
};
|
|
751
|
+
var resolvePiBinary = (configured, options = {}) => {
|
|
752
|
+
if (configured !== void 0) return configured;
|
|
753
|
+
const env = options.env ?? process.env;
|
|
754
|
+
if (env.PI_FABRIC_PI_BINARY !== void 0) return env.PI_FABRIC_PI_BINARY;
|
|
755
|
+
if (env.LOCALTERM === "1") {
|
|
756
|
+
const shim = path2.join(options.homeDirectory ?? homedir(), ".localterm", "shims", "pi");
|
|
757
|
+
if ((options.isExecutable ?? executable)(shim)) return shim;
|
|
758
|
+
}
|
|
759
|
+
return "pi";
|
|
760
|
+
};
|
|
761
|
+
|
|
739
762
|
// src/lifecycle/types.ts
|
|
740
763
|
var FABRIC_PARTICIPANT_LIFECYCLE_TOPIC = "fabric.participant.lifecycle";
|
|
741
764
|
var FABRIC_LIFECYCLE_SUBSCRIPTION_PREFIX = "topology/subscriptions/";
|
|
@@ -815,7 +838,7 @@ var lifecycleSubscriptionFromValue = (value) => {
|
|
|
815
838
|
import { randomUUID as randomUUID2 } from "node:crypto";
|
|
816
839
|
import fs2 from "node:fs";
|
|
817
840
|
import os from "node:os";
|
|
818
|
-
import
|
|
841
|
+
import path3 from "node:path";
|
|
819
842
|
var ENV_BUDGET = "PI_FABRIC_BUDGET";
|
|
820
843
|
var ENV_BUDGET_FILE = "PI_FABRIC_BUDGET_FILE";
|
|
821
844
|
var ENV_BUDGET_ID = "PI_FABRIC_BUDGET_ID";
|
|
@@ -831,8 +854,8 @@ function activeBudgetState() {
|
|
|
831
854
|
return { budget, file, id: process.env[ENV_BUDGET_ID] ?? "" };
|
|
832
855
|
}
|
|
833
856
|
function initBudgetLedger(budget) {
|
|
834
|
-
const directory = fs2.mkdtempSync(
|
|
835
|
-
const file =
|
|
857
|
+
const directory = fs2.mkdtempSync(path3.join(os.tmpdir(), "pi-fabric-budget-"));
|
|
858
|
+
const file = path3.join(directory, "cost.jsonl");
|
|
836
859
|
fs2.writeFileSync(file, "", { mode: 384 });
|
|
837
860
|
const id = randomUUID2().replaceAll("-", "").slice(0, 16);
|
|
838
861
|
process.env[ENV_BUDGET] = String(budget);
|
|
@@ -882,7 +905,7 @@ function appendBudgetLedger(file, entry) {
|
|
|
882
905
|
import { randomUUID as randomUUID4 } from "node:crypto";
|
|
883
906
|
import fs6 from "node:fs";
|
|
884
907
|
import os4 from "node:os";
|
|
885
|
-
import
|
|
908
|
+
import path7 from "node:path";
|
|
886
909
|
import { fileURLToPath } from "node:url";
|
|
887
910
|
|
|
888
911
|
// src/agents/semaphore.ts
|
|
@@ -1244,11 +1267,11 @@ var TmuxTransport = class {
|
|
|
1244
1267
|
// src/agents/worktree-manager.ts
|
|
1245
1268
|
import fs4 from "node:fs";
|
|
1246
1269
|
import os2 from "node:os";
|
|
1247
|
-
import
|
|
1270
|
+
import path4 from "node:path";
|
|
1248
1271
|
var safeLabel = (value) => value.toLowerCase().replace(/[^a-z0-9-]+/g, "-").replace(/^-+|-+$/g, "").slice(0, 30) || "agent";
|
|
1249
1272
|
var isInside = (root, target) => {
|
|
1250
|
-
const relative =
|
|
1251
|
-
return relative === "" || relative !== ".." && !relative.startsWith(`..${
|
|
1273
|
+
const relative = path4.relative(root, target);
|
|
1274
|
+
return relative === "" || relative !== ".." && !relative.startsWith(`..${path4.sep}`) && !path4.isAbsolute(relative);
|
|
1252
1275
|
};
|
|
1253
1276
|
var worktreePrefixParts = (prefix) => {
|
|
1254
1277
|
const parts = prefix.split(/[\\/]+/).filter(Boolean);
|
|
@@ -1272,9 +1295,9 @@ var WorktreeManager = class {
|
|
|
1272
1295
|
throw new Error("Worktree isolation requires a Git repository");
|
|
1273
1296
|
}
|
|
1274
1297
|
const branch = `pi-fabric/${safeLabel(name)}-${id.slice(0, 8)}`;
|
|
1275
|
-
const parent =
|
|
1298
|
+
const parent = path4.join(os2.tmpdir(), "pi-fabric-worktrees");
|
|
1276
1299
|
fs4.mkdirSync(parent, { recursive: true });
|
|
1277
|
-
const worktreePath =
|
|
1300
|
+
const worktreePath = path4.join(parent, id);
|
|
1278
1301
|
await executeFile("git", ["worktree", "add", "-b", branch, worktreePath, "HEAD"], {
|
|
1279
1302
|
cwd: gitRoot,
|
|
1280
1303
|
timeoutMs: 6e4
|
|
@@ -1283,7 +1306,7 @@ var WorktreeManager = class {
|
|
|
1283
1306
|
const prefix = preserveSourceSubdirectory ? worktreePrefixParts(sourcePrefix) : void 0;
|
|
1284
1307
|
let effectiveCwd = canonicalWorktreePath;
|
|
1285
1308
|
if (prefix && prefix.length > 0) {
|
|
1286
|
-
const candidate =
|
|
1309
|
+
const candidate = path4.resolve(canonicalWorktreePath, ...prefix);
|
|
1287
1310
|
try {
|
|
1288
1311
|
const canonicalCandidate = fs4.realpathSync(candidate);
|
|
1289
1312
|
if (fs4.statSync(canonicalCandidate).isDirectory() && isInside(canonicalWorktreePath, canonicalCandidate)) {
|
|
@@ -1319,11 +1342,11 @@ var WorktreeManager = class {
|
|
|
1319
1342
|
|
|
1320
1343
|
// src/storage/retention.ts
|
|
1321
1344
|
import fs5 from "node:fs";
|
|
1322
|
-
import
|
|
1345
|
+
import path5 from "node:path";
|
|
1323
1346
|
var FABRIC_RUN_ROOT_PREFIX = "pi-fabric-runs-";
|
|
1324
1347
|
var RUN_ROOT_OWNER_FILE = ".fabric-owner.json";
|
|
1325
1348
|
var TERMINAL_STATUSES = /* @__PURE__ */ new Set(["completed", "failed", "stopped", "timed_out"]);
|
|
1326
|
-
var ownerPath = (root) =>
|
|
1349
|
+
var ownerPath = (root) => path5.join(root, RUN_ROOT_OWNER_FILE);
|
|
1327
1350
|
var readJson = (filePath) => {
|
|
1328
1351
|
try {
|
|
1329
1352
|
return JSON.parse(fs5.readFileSync(filePath, "utf8"));
|
|
@@ -1374,8 +1397,8 @@ var pruneClosedRunRoot = (root, orphanedTempRunRetentionMs, oneShotRunRetentionM
|
|
|
1374
1397
|
}
|
|
1375
1398
|
for (const entry of entries) {
|
|
1376
1399
|
if (!entry.isDirectory()) continue;
|
|
1377
|
-
const runDirectory =
|
|
1378
|
-
const record = readJson(
|
|
1400
|
+
const runDirectory = path5.join(root, entry.name);
|
|
1401
|
+
const record = readJson(path5.join(runDirectory, "status.json"));
|
|
1379
1402
|
if (!record?.status || !TERMINAL_STATUSES.has(record.status)) continue;
|
|
1380
1403
|
let fallback = now;
|
|
1381
1404
|
try {
|
|
@@ -1410,8 +1433,8 @@ var sweepTempRunRoots = (options) => {
|
|
|
1410
1433
|
}
|
|
1411
1434
|
for (const entry of entries) {
|
|
1412
1435
|
if (!entry.isDirectory() || !entry.name.startsWith(FABRIC_RUN_ROOT_PREFIX)) continue;
|
|
1413
|
-
const root =
|
|
1414
|
-
if (options.currentRoot &&
|
|
1436
|
+
const root = path5.join(options.tempRoot, entry.name);
|
|
1437
|
+
if (options.currentRoot && path5.resolve(root) === path5.resolve(options.currentRoot)) continue;
|
|
1415
1438
|
const owner = readJson(ownerPath(root));
|
|
1416
1439
|
if (!owner) {
|
|
1417
1440
|
try {
|
|
@@ -1457,8 +1480,8 @@ var pruneActorRunArchives = (options) => {
|
|
|
1457
1480
|
}
|
|
1458
1481
|
for (const entry of entries) {
|
|
1459
1482
|
if (!entry.isDirectory() || entry.name === options.latestRunId) continue;
|
|
1460
|
-
const runDirectory =
|
|
1461
|
-
const record = readJson(
|
|
1483
|
+
const runDirectory = path5.join(options.runsDirectory, entry.name);
|
|
1484
|
+
const record = readJson(path5.join(runDirectory, "status.json"));
|
|
1462
1485
|
if (!record?.status || !TERMINAL_STATUSES.has(record.status)) continue;
|
|
1463
1486
|
let fallback = now;
|
|
1464
1487
|
try {
|
|
@@ -1474,21 +1497,21 @@ var pruneActorRunArchives = (options) => {
|
|
|
1474
1497
|
|
|
1475
1498
|
// src/agents/session-export.ts
|
|
1476
1499
|
import os3 from "node:os";
|
|
1477
|
-
import
|
|
1500
|
+
import path6 from "node:path";
|
|
1478
1501
|
var SESSION_EXPORT_ENV = "PI_FABRIC_AGENT_DIR";
|
|
1479
|
-
var expandHome = (value) => value === "~" ? os3.homedir() : value.startsWith("~/") || value.startsWith(`~${
|
|
1502
|
+
var expandHome = (value) => value === "~" ? os3.homedir() : value.startsWith("~/") || value.startsWith(`~${path6.win32.sep}`) ? path6.join(os3.homedir(), value.slice(2)) : value;
|
|
1480
1503
|
var encodeSessionExportCwd = (cwd) => {
|
|
1481
|
-
const absolute =
|
|
1504
|
+
const absolute = path6.isAbsolute(cwd) || path6.win32.isAbsolute(cwd) ? cwd : path6.resolve(cwd);
|
|
1482
1505
|
return `--${absolute.replace(/^[/\\]/, "").replace(/[/\\:]/g, "-")}--`;
|
|
1483
1506
|
};
|
|
1484
1507
|
var resolveSessionExportDir = (config) => {
|
|
1485
1508
|
if (!config.sessionExport) return void 0;
|
|
1486
|
-
const raw = process.env[SESSION_EXPORT_ENV]?.trim() || config.sessionExportDir.trim() ||
|
|
1509
|
+
const raw = process.env[SESSION_EXPORT_ENV]?.trim() || config.sessionExportDir.trim() || path6.join(os3.homedir(), ".pi", "agent");
|
|
1487
1510
|
return expandHome(raw);
|
|
1488
1511
|
};
|
|
1489
1512
|
var sessionExportFileFor = (root, cwd, runId, at) => {
|
|
1490
1513
|
const fileTimestamp = at.toISOString().replace(/[:.]/g, "-");
|
|
1491
|
-
return
|
|
1514
|
+
return path6.join(
|
|
1492
1515
|
root,
|
|
1493
1516
|
"sessions",
|
|
1494
1517
|
".fabric",
|
|
@@ -1533,7 +1556,7 @@ var resolveAgentCwd = (parentCwd, requestedCwd) => {
|
|
|
1533
1556
|
if (typeof requested !== "string" || requested.trim().length === 0) {
|
|
1534
1557
|
throw new Error(`Invalid Fabric agent cwd ${JSON.stringify(requested)}: path must not be empty`);
|
|
1535
1558
|
}
|
|
1536
|
-
const candidate =
|
|
1559
|
+
const candidate = path7.isAbsolute(requested) ? requested : path7.resolve(parentCwd, requested);
|
|
1537
1560
|
try {
|
|
1538
1561
|
const canonical = fs6.realpathSync(candidate);
|
|
1539
1562
|
fs6.accessSync(canonical, fs6.constants.R_OK | fs6.constants.X_OK);
|
|
@@ -1596,7 +1619,7 @@ var compactUiRecord = (record) => {
|
|
|
1596
1619
|
};
|
|
1597
1620
|
var readNestedAgents = (runDirectory, depth = 0) => {
|
|
1598
1621
|
if (depth >= 8) return [];
|
|
1599
|
-
const nestedRoot =
|
|
1622
|
+
const nestedRoot = path7.join(runDirectory, "nested");
|
|
1600
1623
|
let entries;
|
|
1601
1624
|
try {
|
|
1602
1625
|
entries = fs6.readdirSync(nestedRoot);
|
|
@@ -1605,15 +1628,15 @@ var readNestedAgents = (runDirectory, depth = 0) => {
|
|
|
1605
1628
|
}
|
|
1606
1629
|
const agents = [];
|
|
1607
1630
|
for (const entry of entries.slice(0, 200)) {
|
|
1608
|
-
const runDirectory2 =
|
|
1609
|
-
const record = readRecord(
|
|
1631
|
+
const runDirectory2 = path7.join(nestedRoot, entry);
|
|
1632
|
+
const record = readRecord(path7.join(runDirectory2, "status.json"));
|
|
1610
1633
|
if (!record) continue;
|
|
1611
1634
|
const nestedAgents = readNestedAgents(runDirectory2, depth + 1);
|
|
1612
1635
|
const { logFile: _logFile, nestedAgents: _nestedAgents, ...safeRecord } = record;
|
|
1613
1636
|
agents.push(
|
|
1614
1637
|
compactUiRecord({
|
|
1615
1638
|
...safeRecord,
|
|
1616
|
-
logFile:
|
|
1639
|
+
logFile: path7.join(runDirectory2, "events.jsonl"),
|
|
1617
1640
|
...nestedAgents.length > 0 ? { nestedAgents } : {}
|
|
1618
1641
|
})
|
|
1619
1642
|
);
|
|
@@ -1621,7 +1644,7 @@ var readNestedAgents = (runDirectory, depth = 0) => {
|
|
|
1621
1644
|
return agents;
|
|
1622
1645
|
};
|
|
1623
1646
|
var summarizeRunLog = (runDirectory, lines) => {
|
|
1624
|
-
const page = readJsonlPage(
|
|
1647
|
+
const page = readJsonlPage(path7.join(runDirectory, "events.jsonl"), lines);
|
|
1625
1648
|
const summary = [];
|
|
1626
1649
|
for (const entry of page.lines) {
|
|
1627
1650
|
const parsed = entry.parsed;
|
|
@@ -1672,11 +1695,11 @@ var AgentManager = class {
|
|
|
1672
1695
|
this.config = config;
|
|
1673
1696
|
this.#semaphore = new Semaphore(config.maxConcurrent);
|
|
1674
1697
|
this.#managedTempRoot = options.runRoot === void 0 && process.env.PI_FABRIC_RUN_ROOT === void 0;
|
|
1675
|
-
this.#runRoot = options.runRoot ?? process.env.PI_FABRIC_RUN_ROOT ?? fs6.mkdtempSync(
|
|
1698
|
+
this.#runRoot = options.runRoot ?? process.env.PI_FABRIC_RUN_ROOT ?? fs6.mkdtempSync(path7.join(os4.tmpdir(), "pi-fabric-runs-"));
|
|
1676
1699
|
this.#retention = options.retention ?? DEFAULT_FABRIC_CONFIG.retention;
|
|
1677
1700
|
this.#workerPath = options.workerPath ?? fileURLToPath(new URL("../worker.js", import.meta.url));
|
|
1678
1701
|
this.#fabricExtensionPath = options.fabricExtensionPath ?? fileURLToPath(new URL("../index.js", import.meta.url));
|
|
1679
|
-
this.#piBinary = options.piBinary
|
|
1702
|
+
this.#piBinary = resolvePiBinary(options.piBinary);
|
|
1680
1703
|
this.#claudeBinary = options.claudeBinary ?? process.env.PI_FABRIC_CLAUDE_BINARY ?? config.claude.binary;
|
|
1681
1704
|
this.#vedaBinary = options.vedaBinary ?? process.env.PI_FABRIC_VEDA_BINARY ?? config.veda.binary;
|
|
1682
1705
|
this.#onBackgroundComplete = options.onBackgroundComplete;
|
|
@@ -1826,15 +1849,15 @@ var AgentManager = class {
|
|
|
1826
1849
|
const release = await this.#semaphore.acquire(signal);
|
|
1827
1850
|
const id = randomUUID4().replaceAll("-", "");
|
|
1828
1851
|
const name = safeName(request.name ?? request.task.split("\n", 1)[0] ?? "Fabric agent");
|
|
1829
|
-
const runDirectory =
|
|
1852
|
+
const runDirectory = path7.join(this.#runRoot, id);
|
|
1830
1853
|
fs6.mkdirSync(runDirectory, { recursive: true });
|
|
1831
|
-
const taskFile =
|
|
1832
|
-
const statusFile =
|
|
1833
|
-
const lifecycleFile =
|
|
1834
|
-
const logFile =
|
|
1835
|
-
const steerFile =
|
|
1836
|
-
const schemaFile = request.schema ?
|
|
1837
|
-
const imagesFile = request.images && request.images.length > 0 ?
|
|
1854
|
+
const taskFile = path7.join(runDirectory, "task.txt");
|
|
1855
|
+
const statusFile = path7.join(runDirectory, "status.json");
|
|
1856
|
+
const lifecycleFile = path7.join(runDirectory, "lifecycle.jsonl");
|
|
1857
|
+
const logFile = path7.join(runDirectory, "events.jsonl");
|
|
1858
|
+
const steerFile = path7.join(runDirectory, "steer.jsonl");
|
|
1859
|
+
const schemaFile = request.schema ? path7.join(runDirectory, "schema.json") : void 0;
|
|
1860
|
+
const imagesFile = request.images && request.images.length > 0 ? path7.join(runDirectory, "images.json") : void 0;
|
|
1838
1861
|
fs6.writeFileSync(taskFile, request.task, { encoding: "utf8", mode: 384 });
|
|
1839
1862
|
if (imagesFile) {
|
|
1840
1863
|
fs6.writeFileSync(imagesFile, JSON.stringify(request.images), {
|
|
@@ -1866,7 +1889,7 @@ var AgentManager = class {
|
|
|
1866
1889
|
const sessionFile = request.sessionSeed ? writeHandoffSession(
|
|
1867
1890
|
request.sessionSeed,
|
|
1868
1891
|
agentCwd,
|
|
1869
|
-
|
|
1892
|
+
path7.join(runDirectory, "handoff-session"),
|
|
1870
1893
|
request.thinkingTransfer,
|
|
1871
1894
|
request.handoffCompact
|
|
1872
1895
|
) : request.sessionFile;
|
|
@@ -1943,7 +1966,7 @@ var AgentManager = class {
|
|
|
1943
1966
|
...this.#identityId ? ["--owner-identity-id", this.#identityId] : [],
|
|
1944
1967
|
...request.runnerSessionId ? ["--runner-session-id", request.runnerSessionId] : [],
|
|
1945
1968
|
"--run-root",
|
|
1946
|
-
|
|
1969
|
+
path7.join(runDirectory, "nested"),
|
|
1947
1970
|
"--steer-file",
|
|
1948
1971
|
steerFile,
|
|
1949
1972
|
...schemaFile ? ["--schema-file", schemaFile] : [],
|
|
@@ -2136,10 +2159,10 @@ var AgentManager = class {
|
|
|
2136
2159
|
readLog(id, opts = {}) {
|
|
2137
2160
|
const managed = this.#requireRun(id);
|
|
2138
2161
|
const runDirectory = managed.runDirectory;
|
|
2139
|
-
const logFile =
|
|
2162
|
+
const logFile = path7.join(runDirectory, "events.jsonl");
|
|
2140
2163
|
const lines = Math.max(1, Math.min(opts.lines ?? 200, 5e3));
|
|
2141
2164
|
const page = readJsonlPage(logFile, lines, opts.before);
|
|
2142
|
-
const statusRecord = readRecord(
|
|
2165
|
+
const statusRecord = readRecord(path7.join(runDirectory, "status.json"));
|
|
2143
2166
|
return {
|
|
2144
2167
|
id,
|
|
2145
2168
|
runDirectory,
|
|
@@ -2200,7 +2223,7 @@ var AgentManager = class {
|
|
|
2200
2223
|
`Fabric agent ${id} already finished (${record.status}); steering has no target`
|
|
2201
2224
|
);
|
|
2202
2225
|
}
|
|
2203
|
-
const steerFile =
|
|
2226
|
+
const steerFile = path7.join(managed.runDirectory, "steer.jsonl");
|
|
2204
2227
|
const messageId = randomUUID4();
|
|
2205
2228
|
const line = JSON.stringify({ ...entry, id: messageId, ts: Date.now() }) + "\n";
|
|
2206
2229
|
fs6.appendFileSync(steerFile, line, { encoding: "utf8", mode: 384 });
|
|
@@ -2221,7 +2244,7 @@ var AgentManager = class {
|
|
|
2221
2244
|
await removeTree(this.#runRoot);
|
|
2222
2245
|
}
|
|
2223
2246
|
if (this.#budgetOwned && this.#budget) {
|
|
2224
|
-
await removeTree(
|
|
2247
|
+
await removeTree(path7.dirname(this.#budget.file));
|
|
2225
2248
|
clearOwnedBudgetEnv();
|
|
2226
2249
|
}
|
|
2227
2250
|
}
|
|
@@ -2382,7 +2405,7 @@ var AgentManager = class {
|
|
|
2382
2405
|
if (managed.settled) return;
|
|
2383
2406
|
this.#drainLifecycle(managed);
|
|
2384
2407
|
managed.settled = true;
|
|
2385
|
-
fs6.rmSync(
|
|
2408
|
+
fs6.rmSync(path7.join(managed.runDirectory, "images.json"), { force: true });
|
|
2386
2409
|
this.#emitLifecycle(managed, `run.${result.status}`, result.finishedAt ?? Date.now(), {
|
|
2387
2410
|
status: result.status
|
|
2388
2411
|
});
|
|
@@ -2614,7 +2637,7 @@ var AgentManager = class {
|
|
|
2614
2637
|
// in the parent run until that parent is explicitly cleaned up.
|
|
2615
2638
|
#nestedAgents(managed, force = false) {
|
|
2616
2639
|
const now = Date.now();
|
|
2617
|
-
const needsInitialDiscovery = managed.nestedSnapshot === void 0 && fs6.existsSync(
|
|
2640
|
+
const needsInitialDiscovery = managed.nestedSnapshot === void 0 && fs6.existsSync(path7.join(managed.runDirectory, "nested"));
|
|
2618
2641
|
if (!force && !needsInitialDiscovery && managed.nestedSnapshotAt !== void 0 && now - managed.nestedSnapshotAt < NESTED_SNAPSHOT_POLL_MS) {
|
|
2619
2642
|
return managed.nestedSnapshot ? structuredClone(managed.nestedSnapshot) : [];
|
|
2620
2643
|
}
|
|
@@ -2638,7 +2661,7 @@ var AgentManager = class {
|
|
|
2638
2661
|
cwd: managed.cwd,
|
|
2639
2662
|
runner: managed.runner,
|
|
2640
2663
|
...managed.residency === "durable" ? { residency: "durable" } : {},
|
|
2641
|
-
logFile:
|
|
2664
|
+
logFile: path7.join(managed.runDirectory, "events.jsonl"),
|
|
2642
2665
|
...nestedAgents.length > 0 ? { nestedAgents } : {},
|
|
2643
2666
|
...budget ? { budget } : {},
|
|
2644
2667
|
...managed.model ? { model: managed.model } : {},
|
|
@@ -2694,7 +2717,7 @@ var actorDeliveryNotice = (delivery, triggerTurn) => {
|
|
|
2694
2717
|
import { randomUUID as randomUUID6 } from "node:crypto";
|
|
2695
2718
|
import fs8 from "node:fs";
|
|
2696
2719
|
import os5 from "node:os";
|
|
2697
|
-
import
|
|
2720
|
+
import path9 from "node:path";
|
|
2698
2721
|
|
|
2699
2722
|
// src/actors/predicate.ts
|
|
2700
2723
|
var PREDICATE_VERSION = 1;
|
|
@@ -2766,7 +2789,7 @@ var evaluateActorValidWhile = async (source, facts) => {
|
|
|
2766
2789
|
// src/actors/binding-store.ts
|
|
2767
2790
|
import { createHash, randomUUID as randomUUID5 } from "node:crypto";
|
|
2768
2791
|
import fs7 from "node:fs";
|
|
2769
|
-
import
|
|
2792
|
+
import path8 from "node:path";
|
|
2770
2793
|
var BINDING_LOCK_TIMEOUT_MS = 5e3;
|
|
2771
2794
|
var BINDING_STALE_LOCK_MS = 3e4;
|
|
2772
2795
|
var bindingFileName = (sessionId) => `${createHash("sha256").update(sessionId).digest("hex")}.json`;
|
|
@@ -2776,7 +2799,7 @@ var delay3 = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
|
2776
2799
|
var ActorBindingStore = class {
|
|
2777
2800
|
constructor(sessionId, root) {
|
|
2778
2801
|
this.sessionId = sessionId;
|
|
2779
|
-
this.filePath = root ?
|
|
2802
|
+
this.filePath = root ? path8.join(root, "bindings", bindingFileName(sessionId)) : void 0;
|
|
2780
2803
|
this.#sync(true);
|
|
2781
2804
|
}
|
|
2782
2805
|
#bindings = /* @__PURE__ */ new Map();
|
|
@@ -2892,7 +2915,7 @@ var ActorBindingStore = class {
|
|
|
2892
2915
|
async #withLock(operation) {
|
|
2893
2916
|
if (!this.filePath) return operation();
|
|
2894
2917
|
const lockPath = `${this.filePath}.lock`;
|
|
2895
|
-
const ownerPath2 =
|
|
2918
|
+
const ownerPath2 = path8.join(lockPath, "owner");
|
|
2896
2919
|
const deadline = Date.now() + BINDING_LOCK_TIMEOUT_MS;
|
|
2897
2920
|
const token = randomUUID5();
|
|
2898
2921
|
const processAlive3 = (pid) => {
|
|
@@ -2904,7 +2927,7 @@ var ActorBindingStore = class {
|
|
|
2904
2927
|
return false;
|
|
2905
2928
|
}
|
|
2906
2929
|
};
|
|
2907
|
-
fs7.mkdirSync(
|
|
2930
|
+
fs7.mkdirSync(path8.dirname(this.filePath), { recursive: true, mode: 448 });
|
|
2908
2931
|
while (true) {
|
|
2909
2932
|
try {
|
|
2910
2933
|
fs7.mkdirSync(lockPath, { mode: 448 });
|
|
@@ -3084,7 +3107,7 @@ var ActorManager = class {
|
|
|
3084
3107
|
this.meshConfig = meshConfig;
|
|
3085
3108
|
this.agents = agents;
|
|
3086
3109
|
this.onDeliver = onDeliver;
|
|
3087
|
-
this.#actorRoot = options.actorRoot ?? fs8.mkdtempSync(
|
|
3110
|
+
this.#actorRoot = options.actorRoot ?? fs8.mkdtempSync(path9.join(os5.tmpdir(), "pi-fabric-actors-"));
|
|
3088
3111
|
this.#persistent = options.persistent ?? false;
|
|
3089
3112
|
this.#mainAgent = options.mainAgent;
|
|
3090
3113
|
this.#canManageActor = options.canManageActor;
|
|
@@ -3093,7 +3116,7 @@ var ActorManager = class {
|
|
|
3093
3116
|
this.#claimResidency = options.claimResidency;
|
|
3094
3117
|
this.#rootId = options.rootId ?? identity.id;
|
|
3095
3118
|
this.#meshCursorPath = options.meshCursorPath;
|
|
3096
|
-
this.#registryPath =
|
|
3119
|
+
this.#registryPath = path9.join(this.#actorRoot, "actors.json");
|
|
3097
3120
|
this.#bindings = new ActorBindingStore(
|
|
3098
3121
|
sessionId,
|
|
3099
3122
|
this.#persistent && meshConfig.enabled ? this.#actorRoot : void 0
|
|
@@ -3203,7 +3226,7 @@ var ActorManager = class {
|
|
|
3203
3226
|
throw new Error("This Fabric host cannot commit actor capability requirements");
|
|
3204
3227
|
}
|
|
3205
3228
|
const id = randomUUID6().replaceAll("-", "");
|
|
3206
|
-
const actorDirectory =
|
|
3229
|
+
const actorDirectory = path9.join(this.#actorRoot, id);
|
|
3207
3230
|
fs8.mkdirSync(actorDirectory, { recursive: true, mode: 448 });
|
|
3208
3231
|
const actor = {
|
|
3209
3232
|
id,
|
|
@@ -3228,7 +3251,7 @@ var ActorManager = class {
|
|
|
3228
3251
|
requirements,
|
|
3229
3252
|
...request.validWhile ? { validWhile: structuredClone(request.validWhile) } : {},
|
|
3230
3253
|
latestActivationSequence: 0,
|
|
3231
|
-
sessionFile:
|
|
3254
|
+
sessionFile: path9.join(actorDirectory, "session.jsonl"),
|
|
3232
3255
|
queue: [],
|
|
3233
3256
|
draining: false,
|
|
3234
3257
|
messages: [],
|
|
@@ -3561,17 +3584,17 @@ var ActorManager = class {
|
|
|
3561
3584
|
const type = opts.type ?? "session";
|
|
3562
3585
|
const lines = Math.max(1, Math.min(opts.lines ?? 200, 5e3));
|
|
3563
3586
|
const sessionFile = actor.sessionFile;
|
|
3564
|
-
const logDir =
|
|
3587
|
+
const logDir = path9.join(path9.dirname(sessionFile), "runs");
|
|
3565
3588
|
const sessionPage = type === "run" ? { lines: [], hasMore: false } : readJsonlPage(sessionFile, lines, opts.before);
|
|
3566
3589
|
const session = sessionPage.lines;
|
|
3567
3590
|
let run;
|
|
3568
3591
|
if (type !== "session") {
|
|
3569
3592
|
const targetRunId = opts.runId ?? actor.lastRunId;
|
|
3570
3593
|
if (targetRunId) {
|
|
3571
|
-
const runPath =
|
|
3594
|
+
const runPath = path9.join(logDir, targetRunId);
|
|
3572
3595
|
if (fs8.existsSync(runPath)) {
|
|
3573
|
-
const statusRecord = readRunRecord(
|
|
3574
|
-
const eventsFile =
|
|
3596
|
+
const statusRecord = readRunRecord(path9.join(runPath, "status.json"));
|
|
3597
|
+
const eventsFile = path9.join(runPath, "events.jsonl");
|
|
3575
3598
|
const page = readJsonlPage(eventsFile, lines, opts.before);
|
|
3576
3599
|
run = {
|
|
3577
3600
|
runId: targetRunId,
|
|
@@ -3788,7 +3811,7 @@ var ActorManager = class {
|
|
|
3788
3811
|
await this.#bindings.delete(actor.id);
|
|
3789
3812
|
this.#actors.delete(actor.id);
|
|
3790
3813
|
this.#emitChange();
|
|
3791
|
-
fs8.rmSync(
|
|
3814
|
+
fs8.rmSync(path9.dirname(actor.sessionFile), { recursive: true, force: true });
|
|
3792
3815
|
await this.#saveActors(/* @__PURE__ */ new Set([actor.id]));
|
|
3793
3816
|
await this.mesh.delete({ key: this.#presenceKey(actor.id) }).catch(() => ({ deleted: false }));
|
|
3794
3817
|
if (retainedRunId) await this.agents.cleanup(retainedRunId).catch(() => ({ cleaned: false }));
|
|
@@ -4221,7 +4244,7 @@ var ActorManager = class {
|
|
|
4221
4244
|
}
|
|
4222
4245
|
try {
|
|
4223
4246
|
const watcher = fs8.watch(this.mesh.root, { persistent: false }, (_event, filename) => {
|
|
4224
|
-
if (filename !== null &&
|
|
4247
|
+
if (filename !== null && path9.basename(filename.toString()) !== "events.jsonl") return;
|
|
4225
4248
|
this.#scheduleMeshPoll();
|
|
4226
4249
|
});
|
|
4227
4250
|
this.#meshWatcher = watcher;
|
|
@@ -4331,16 +4354,16 @@ var ActorManager = class {
|
|
|
4331
4354
|
async #retainRunLog(actor, runId) {
|
|
4332
4355
|
const runDirectory = this.agents.runDirectory(runId);
|
|
4333
4356
|
if (!runDirectory || !fs8.existsSync(runDirectory)) return;
|
|
4334
|
-
const dest =
|
|
4357
|
+
const dest = path9.join(path9.dirname(actor.sessionFile), "runs", runId);
|
|
4335
4358
|
fs8.mkdirSync(dest, { recursive: true, mode: 448 });
|
|
4336
4359
|
for (const file of ["events.jsonl", "status.json", "task.txt"]) {
|
|
4337
|
-
const src =
|
|
4338
|
-
if (fs8.existsSync(src)) fs8.copyFileSync(src,
|
|
4360
|
+
const src = path9.join(runDirectory, file);
|
|
4361
|
+
if (fs8.existsSync(src)) fs8.copyFileSync(src, path9.join(dest, file));
|
|
4339
4362
|
}
|
|
4340
|
-
const nested =
|
|
4363
|
+
const nested = path9.join(runDirectory, "nested");
|
|
4341
4364
|
if (fs8.existsSync(nested)) {
|
|
4342
4365
|
try {
|
|
4343
|
-
fs8.cpSync(nested,
|
|
4366
|
+
fs8.cpSync(nested, path9.join(dest, "nested"), { recursive: true });
|
|
4344
4367
|
} catch {
|
|
4345
4368
|
}
|
|
4346
4369
|
}
|
|
@@ -4348,7 +4371,7 @@ var ActorManager = class {
|
|
|
4348
4371
|
}
|
|
4349
4372
|
#pruneRetainedRuns(actor, now = Date.now()) {
|
|
4350
4373
|
pruneActorRunArchives({
|
|
4351
|
-
runsDirectory:
|
|
4374
|
+
runsDirectory: path9.join(path9.dirname(actor.sessionFile), "runs"),
|
|
4352
4375
|
...actor.lastRunId ? { latestRunId: actor.lastRunId } : {},
|
|
4353
4376
|
retentionMs: this.#retention.actorRunArchiveMs,
|
|
4354
4377
|
now
|
|
@@ -4362,7 +4385,7 @@ var ActorManager = class {
|
|
|
4362
4385
|
}
|
|
4363
4386
|
}
|
|
4364
4387
|
#retainedRunIds(actor) {
|
|
4365
|
-
const runsDir =
|
|
4388
|
+
const runsDir = path9.join(path9.dirname(actor.sessionFile), "runs");
|
|
4366
4389
|
try {
|
|
4367
4390
|
return fs8.readdirSync(runsDir).sort();
|
|
4368
4391
|
} catch {
|
|
@@ -4491,7 +4514,7 @@ var ActorManager = class {
|
|
|
4491
4514
|
}
|
|
4492
4515
|
async #withRegistryLock(operation) {
|
|
4493
4516
|
const lockPath = `${this.#registryPath}.lock`;
|
|
4494
|
-
const ownerPath2 =
|
|
4517
|
+
const ownerPath2 = path9.join(lockPath, "owner");
|
|
4495
4518
|
const deadline = Date.now() + ACTOR_REGISTRY_LOCK_TIMEOUT_MS;
|
|
4496
4519
|
const token = randomUUID6();
|
|
4497
4520
|
const processAlive3 = (pid) => {
|
|
@@ -4677,7 +4700,7 @@ ${Date.now()}
|
|
|
4677
4700
|
...typeof record.capabilityDigest === "string" ? { capabilityDigest: record.capabilityDigest } : {},
|
|
4678
4701
|
...record.validWhile?.version === 1 && typeof record.validWhile.source === "string" ? { validWhile: record.validWhile } : {},
|
|
4679
4702
|
latestActivationSequence: 0,
|
|
4680
|
-
sessionFile:
|
|
4703
|
+
sessionFile: path9.join(this.#actorRoot, record.id, "session.jsonl"),
|
|
4681
4704
|
queue: [],
|
|
4682
4705
|
draining: false,
|
|
4683
4706
|
messages: [],
|
|
@@ -4762,7 +4785,7 @@ ${Date.now()}
|
|
|
4762
4785
|
...actor.lastRunId ? { lastRunId: actor.lastRunId } : {},
|
|
4763
4786
|
...actor.lastError ? { lastError: actor.lastError } : {},
|
|
4764
4787
|
sessionFile: actor.sessionFile,
|
|
4765
|
-
logDir:
|
|
4788
|
+
logDir: path9.join(path9.dirname(actor.sessionFile), "runs")
|
|
4766
4789
|
};
|
|
4767
4790
|
}
|
|
4768
4791
|
validateDirectMessage(message, data) {
|
|
@@ -6199,16 +6222,17 @@ var actorParticipantRecord = (actor, rootId, ownerHostId, ownerIdentityId, paren
|
|
|
6199
6222
|
|
|
6200
6223
|
// src/residency/protocol.ts
|
|
6201
6224
|
import { createHash as createHash4 } from "node:crypto";
|
|
6202
|
-
import
|
|
6225
|
+
import path10 from "node:path";
|
|
6203
6226
|
var RESIDENT_HOST_FORMAT = 1;
|
|
6204
6227
|
var RESIDENT_DELIVERY_PREFIX = "residency/deliveries/";
|
|
6205
6228
|
var digest = (value) => createHash4("sha256").update(value).digest("hex");
|
|
6206
6229
|
var residentHostId = (rootId) => `resident:${digest(rootId).slice(0, 24)}`;
|
|
6207
|
-
var residentRoot = (meshRoot, rootId) =>
|
|
6230
|
+
var residentRoot = (meshRoot, rootId) => path10.join(meshRoot, "residency", digest(rootId));
|
|
6208
6231
|
var residentDeliveryPrefix = (rootId) => `${RESIDENT_DELIVERY_PREFIX}${digest(rootId).slice(0, 32)}/`;
|
|
6209
6232
|
|
|
6210
6233
|
export {
|
|
6211
6234
|
MeshStore,
|
|
6235
|
+
resolvePiBinary,
|
|
6212
6236
|
FABRIC_PARTICIPANT_LIFECYCLE_TOPIC,
|
|
6213
6237
|
FABRIC_LIFECYCLE_EVENTS,
|
|
6214
6238
|
isFabricLifecycleEventType,
|
|
@@ -6231,4 +6255,4 @@ export {
|
|
|
6231
6255
|
residentRoot,
|
|
6232
6256
|
residentDeliveryPrefix
|
|
6233
6257
|
};
|
|
6234
|
-
//# sourceMappingURL=chunk-
|
|
6258
|
+
//# sourceMappingURL=chunk-3XLK3HIF.js.map
|