@agimon-ai/po-file-edit 0.0.0-alpha.185 → 0.0.0-alpha.187

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.
@@ -39,6 +39,7 @@ node_fs_promises = __toESM(node_fs_promises, 1);
39
39
  let node_os = require("node:os");
40
40
  node_os = __toESM(node_os, 1);
41
41
  let _agimon_ai_po_config = require("@agimon-ai/po-config");
42
+ let _agimon_ai_po_core_nodePlatform = require("@agimon-ai/po-core/nodePlatform");
42
43
  let node_crypto = require("node:crypto");
43
44
  let _agimon_ai_po_core_childProcess = require("@agimon-ai/po-core/childProcess");
44
45
  let _agimon_ai_po_core_piSettings = require("@agimon-ai/po-core/piSettings");
@@ -1328,8 +1329,8 @@ async function readSessionFiles(timelinePath, cwd) {
1328
1329
  * read directly, with the cross-process lock a subagent child's appends need.
1329
1330
  *
1330
1331
  * The edge build replaces this module with `index.edge.ts`, which reads the
1331
- * file system the host injects. Node has no use for one, so the parameter is
1332
- * accepted to keep the two builds callable alike and left unused.
1332
+ * file system the host injects. On Node, an injected file system is used for
1333
+ * config reads when provided, falling back to `createNodePlatform().env(cwd)`.
1333
1334
  */
1334
1335
  const nodePresenceFiles = {
1335
1336
  isFile: async (filePath) => (await node_fs_promises.default.stat(filePath).catch(() => void 0))?.isFile() === true,
@@ -1341,16 +1342,20 @@ const nodePresenceFiles = {
1341
1342
  * a plan link in the transcript opens in the file view. A config that cannot be
1342
1343
  * read admits nothing extra rather than failing the preview.
1343
1344
  */
1344
- function plansRoots(cwd, environment, homeDirectory) {
1345
+ async function plansRoots(files, cwd, environment, homeDirectory) {
1345
1346
  const home = homeDirectory ?? environment.HOME ?? node_os.default.homedir();
1347
+ const fs = files ?? (0, _agimon_ai_po_core_nodePlatform.createNodePlatform)().env(cwd);
1346
1348
  try {
1347
- const configured = (0, _agimon_ai_po_config.loadPoConfig)(cwd, home, environment).modes?.planning?.plansDirectory;
1348
- return [(0, _agimon_ai_po_config.resolvePlanningPlansDirectory)(configured, cwd, home)];
1349
+ const config = await (0, _agimon_ai_po_config.readPoConfig)(fs, cwd, _agimon_ai_po_core_platform.BACKGROUND_CONTEXT, {
1350
+ environment,
1351
+ homeDirectory: home
1352
+ });
1353
+ return [(0, _agimon_ai_po_config.resolvePlanningPlansDirectory)(config.modes?.planning?.plansDirectory, cwd, home)];
1349
1354
  } catch {
1350
1355
  return [];
1351
1356
  }
1352
1357
  }
1353
- function createFileEditStorage(_fileSystem) {
1358
+ function createFileEditStorage(fileSystem) {
1354
1359
  return {
1355
1360
  paths: (environment) => new FileEditPaths(environment),
1356
1361
  timeline: () => new TimelineStore(),
@@ -1360,7 +1365,7 @@ function createFileEditStorage(_fileSystem) {
1360
1365
  workingFiles: () => new NodeWorkingFiles(),
1361
1366
  presenceFiles: () => nodePresenceFiles,
1362
1367
  sessionFiles: readSessionFiles,
1363
- readableRoots: ({ cwd, environment, homeDirectory }) => () => plansRoots(cwd, environment, homeDirectory),
1368
+ readableRoots: ({ cwd, environment, homeDirectory }) => () => plansRoots(fileSystem, cwd, environment, homeDirectory),
1364
1369
  sweepAbandoned: (directory, keep) => sweepSessionState({
1365
1370
  directory,
1366
1371
  keep