@docyrus/docyrus 0.0.70 → 0.0.72

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/main.js CHANGED
@@ -139349,7 +139349,7 @@ function buildInputSchema(args2, env2, options2) {
139349
139349
  // package.json
139350
139350
  var package_default = {
139351
139351
  name: "@docyrus/docyrus",
139352
- version: "0.0.70",
139352
+ version: "0.0.72",
139353
139353
  private: false,
139354
139354
  description: "Docyrus API CLI",
139355
139355
  main: "./main.js",
@@ -139363,8 +139363,8 @@ var package_default = {
139363
139363
  "@clack/prompts": "^0.11.0",
139364
139364
  "@ff-labs/fff-node": "0.6.4",
139365
139365
  "@hono/node-server": "^1.19.13",
139366
- "@mariozechner/pi-ai": "0.71.0",
139367
- "@mariozechner/pi-coding-agent": "0.71.0",
139366
+ "@mariozechner/pi-ai": "0.71.1",
139367
+ "@mariozechner/pi-coding-agent": "0.71.1",
139368
139368
  "@modelcontextprotocol/ext-apps": "^1.2.2",
139369
139369
  "@modelcontextprotocol/sdk": "^1.25.1",
139370
139370
  "@mozilla/readability": "^0.6.0",
@@ -154018,29 +154018,75 @@ async function migrateLegacyPiAgentDir(params) {
154018
154018
  }
154019
154019
  return { migrated: true, copiedFiles };
154020
154020
  }
154021
- async function notifyLegacyTrackedSessionLocation(params) {
154021
+ async function moveFile(source, destination) {
154022
+ try {
154023
+ await (0, import_promises22.rename)(source, destination);
154024
+ return;
154025
+ } catch (error48) {
154026
+ if (error48.code !== "EXDEV") {
154027
+ throw error48;
154028
+ }
154029
+ }
154030
+ await (0, import_promises22.copyFile)(source, destination);
154031
+ await (0, import_promises22.rm)(source, { force: true });
154032
+ }
154033
+ async function migrateLegacyTrackedSessions(params) {
154022
154034
  const log = params.log ?? ((message) => process.stderr.write(`${message}
154023
154035
  `));
154036
+ const result = { migrated: false, movedFiles: 0, skippedFiles: 0 };
154024
154037
  try {
154025
- const legacy = await safeResolveRealPath(params.legacyTrackedSessionsRootPath);
154026
- if (!legacy) {
154027
- return;
154038
+ const legacyRoot = await safeResolveRealPath(params.legacyTrackedSessionsRootPath);
154039
+ if (!legacyRoot) {
154040
+ return result;
154028
154041
  }
154029
- const legacyEntries = await (0, import_promises22.readdir)(legacy, { withFileTypes: true }).catch(() => []);
154030
- const hasLegacy = legacyEntries.some((entry) => entry.isDirectory());
154031
- if (!hasLegacy) {
154032
- return;
154042
+ const legacyEntries = await (0, import_promises22.readdir)(legacyRoot, { withFileTypes: true }).catch(() => []);
154043
+ const legacyDirs = legacyEntries.filter((entry) => entry.isDirectory());
154044
+ if (legacyDirs.length === 0) {
154045
+ return result;
154033
154046
  }
154034
- const tracked = await safeResolveRealPath(params.trackedSessionsRootPath);
154035
- if (tracked) {
154036
- const trackedEntries = await (0, import_promises22.readdir)(tracked, { withFileTypes: true }).catch(() => []);
154037
- if (trackedEntries.some((entry) => entry.isDirectory())) {
154038
- return;
154047
+ await (0, import_promises22.mkdir)(params.trackedSessionsRootPath, { recursive: true });
154048
+ for (const dir of legacyDirs) {
154049
+ const legacyDirPath = (0, import_node_path28.join)(legacyRoot, dir.name);
154050
+ const trackedDirPath = (0, import_node_path28.join)(params.trackedSessionsRootPath, dir.name);
154051
+ await (0, import_promises22.mkdir)(trackedDirPath, { recursive: true });
154052
+ const fileEntries = await (0, import_promises22.readdir)(legacyDirPath, { withFileTypes: true }).catch(() => []);
154053
+ for (const file2 of fileEntries) {
154054
+ if (!file2.isFile()) {
154055
+ continue;
154056
+ }
154057
+ const source = (0, import_node_path28.join)(legacyDirPath, file2.name);
154058
+ const destination = (0, import_node_path28.join)(trackedDirPath, file2.name);
154059
+ if (await pathExists(destination)) {
154060
+ result.skippedFiles += 1;
154061
+ continue;
154062
+ }
154063
+ try {
154064
+ await moveFile(source, destination);
154065
+ result.movedFiles += 1;
154066
+ } catch {
154067
+ result.skippedFiles += 1;
154068
+ }
154069
+ }
154070
+ const remaining = await (0, import_promises22.readdir)(legacyDirPath).catch(() => null);
154071
+ if (remaining && remaining.length === 0) {
154072
+ await (0, import_promises22.rm)(legacyDirPath, { recursive: true, force: true }).catch(() => {
154073
+ });
154039
154074
  }
154040
154075
  }
154041
- log(`pi sessions now write to ${params.trackedSessionsRootPath}; legacy transcripts remain in ${params.legacyTrackedSessionsRootPath}.`);
154076
+ const remainingTop = await (0, import_promises22.readdir)(legacyRoot).catch(() => null);
154077
+ if (remainingTop && remainingTop.length === 0) {
154078
+ await (0, import_promises22.rm)(legacyRoot, { recursive: true, force: true }).catch(() => {
154079
+ });
154080
+ }
154081
+ if (result.movedFiles > 0 || result.skippedFiles > 0) {
154082
+ result.migrated = true;
154083
+ const moved = `${result.movedFiles} moved`;
154084
+ const skipped = result.skippedFiles > 0 ? `, ${result.skippedFiles} skipped (already present)` : "";
154085
+ log(`Moved legacy pi sessions to ${params.trackedSessionsRootPath} (${moved}${skipped}).`);
154086
+ }
154042
154087
  } catch {
154043
154088
  }
154089
+ return result;
154044
154090
  }
154045
154091
 
154046
154092
  // src/services/soulRegistry.ts
@@ -154120,7 +154166,6 @@ var DOCYRUS_MIGRATED_SKILL_NAMES = [
154120
154166
  "docyrus-cli-app"
154121
154167
  ];
154122
154168
  var DOCYRUS_EXTERNAL_SKILL_AGENT_IDS = [
154123
- "pi",
154124
154169
  "claude-code",
154125
154170
  "codex",
154126
154171
  "github-copilot",
@@ -154365,6 +154410,19 @@ async function syncTrackedSkills(params) {
154365
154410
  });
154366
154411
  }));
154367
154412
  }
154413
+ async function cleanupLegacyDocyrusPiSkills(params) {
154414
+ const projectSkillsRoot = (0, import_node_path30.join)(params.cwd, ".pi", "skills");
154415
+ if (!(0, import_node_fs17.existsSync)(projectSkillsRoot)) {
154416
+ return;
154417
+ }
154418
+ const docyrusOwned = [
154419
+ ...DOCYRUS_MIGRATED_SKILL_NAMES,
154420
+ DOCYRUS_PACKAGED_PLATFORM_SKILL_NAME
154421
+ ];
154422
+ await Promise.all(docyrusOwned.map(async (name2) => {
154423
+ await (0, import_promises24.rm)((0, import_node_path30.join)(projectSkillsRoot, name2), { recursive: true, force: true });
154424
+ }));
154425
+ }
154368
154426
  async function writeRuntimeSkill(params) {
154369
154427
  const runtimeSkillDir = (0, import_node_path30.join)(params.agentRootPath, "skills", "docyrus-runtime-context");
154370
154428
  await (0, import_promises24.mkdir)(runtimeSkillDir, {
@@ -154768,7 +154826,7 @@ function createPiAgentLauncher(options2) {
154768
154826
  globalRootPath: agentRootPath
154769
154827
  }).catch(() => {
154770
154828
  });
154771
- await notifyLegacyTrackedSessionLocation({
154829
+ await migrateLegacyTrackedSessions({
154772
154830
  legacyTrackedSessionsRootPath: (0, import_node_path30.join)(resolveDocyrusPiAgentRootPath(settingsRootPath), "sessions"),
154773
154831
  trackedSessionsRootPath: resolveDocyrusTrackedSessionsRootPath(cwd)
154774
154832
  });
@@ -154782,6 +154840,7 @@ function createPiAgentLauncher(options2) {
154782
154840
  trackedSkillsRoot: resolveDocyrusTrackedSkillsRootPath(cwd),
154783
154841
  agentRootPath
154784
154842
  });
154843
+ await cleanupLegacyDocyrusPiSkills({ cwd });
154785
154844
  await writeRuntimeSkill({
154786
154845
  agentRootPath,
154787
154846
  content: createPiAgentRuntimeSkill({
@@ -154943,6 +155002,7 @@ function createPiAgentServerLauncher(options2) {
154943
155002
  trackedSkillsRoot: resolveDocyrusTrackedSkillsRootPath(cwd),
154944
155003
  agentRootPath
154945
155004
  });
155005
+ await cleanupLegacyDocyrusPiSkills({ cwd });
154946
155006
  await writeRuntimeSkill({
154947
155007
  agentRootPath,
154948
155008
  content: createPiAgentRuntimeSkill({