pi-gsd 2.0.17 → 2.0.19

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.
@@ -783,13 +783,8 @@ function runLoop(content, filePath, config, projectRoot, pkgRoot, rawArguments,
783
783
  if (inDeadZone(tag.start, extractCodeFenceRegions(current))) continue;
784
784
  const incPath = tag.node.attrs["path"];
785
785
  if (!incPath) continue;
786
- const subPath = incPath.replace(/^\.pi\/gsd\//, "");
787
- const candidates = [
788
- import_node_path3.default.resolve(projectRoot, incPath),
789
- import_node_path3.default.resolve(pkgRoot, ".gsd", "harnesses", "pi", "get-shit-done", subPath)
790
- ];
791
- const abs = candidates.find((c) => import_node_fs2.default.existsSync(c));
792
- if (!abs) throw new Error(`Include not found: ${incPath} (tried project + package harness)`);
786
+ const abs = import_node_path3.default.resolve(projectRoot, incPath);
787
+ if (!import_node_fs2.default.existsSync(abs)) throw new Error(`Include not found: ${incPath}`);
793
788
  const check = checkTrustedPath(abs, config, projectRoot, pkgRoot);
794
789
  if (!check.ok) throw new Error(`Include rejected: ${check.reason}`);
795
790
  const included = import_node_fs2.default.readFileSync(abs, "utf8");
@@ -858,6 +853,14 @@ function readWorkflowVersionTag(content) {
858
853
  function copyHarness(src, dest) {
859
854
  let symlinksReplaced = 0;
860
855
  let filesCopied = 0;
856
+ try {
857
+ if ((0, import_node_fs3.existsSync)(dest) && (0, import_node_fs3.lstatSync)(dest).isSymbolicLink()) {
858
+ const { unlinkSync } = require("fs");
859
+ unlinkSync(dest);
860
+ symlinksReplaced++;
861
+ }
862
+ } catch {
863
+ }
861
864
  const walk = (srcDir, destDir) => {
862
865
  (0, import_node_fs3.mkdirSync)(destDir, { recursive: true });
863
866
  const entries = (0, import_node_fs3.readdirSync)(srcDir, { withFileTypes: true });
@@ -1028,7 +1031,7 @@ function pi_gsd_hooks_default(pi) {
1028
1031
  return { messages: [] };
1029
1032
  }
1030
1033
  const extFile2 = typeof __filename !== "undefined" ? __filename : "";
1031
- const pkgRoot2 = (0, import_node_path4.join)((0, import_node_path4.dirname)(extFile2), "..", "..");
1034
+ const pkgRoot2 = (0, import_node_path4.join)((0, import_node_path4.dirname)(extFile2), "..");
1032
1035
  const loadSettings = (settingsPath) => {
1033
1036
  try {
1034
1037
  if ((0, import_node_fs3.existsSync)(settingsPath)) {
@@ -1094,7 +1097,7 @@ function pi_gsd_hooks_default(pi) {
1094
1097
  pi.on("session_start", async (_event, ctx) => {
1095
1098
  try {
1096
1099
  const extFile = typeof __filename !== "undefined" ? __filename : "";
1097
- const pkgRoot = (0, import_node_path4.join)((0, import_node_path4.dirname)(extFile), "..", "..");
1100
+ const pkgRoot = (0, import_node_path4.join)((0, import_node_path4.dirname)(extFile), "..");
1098
1101
  const pkgHarness = (0, import_node_path4.join)(pkgRoot, ".gsd", "harnesses", "pi", "get-shit-done");
1099
1102
  const projectHarness = (0, import_node_path4.join)(ctx.cwd, ".pi", "gsd");
1100
1103
  if ((0, import_node_fs3.existsSync)(pkgHarness)) {