@h-rig/cli 0.0.6-alpha.72 → 0.0.6-alpha.73

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/bin/rig.js CHANGED
@@ -7900,7 +7900,20 @@ async function attachRunBundledPiFrontend(context, input) {
7900
7900
  if (payload?.ok && typeof payload.content === "string" && payload.content.trim()) {
7901
7901
  const fileName = typeof payload.fileName === "string" && payload.fileName.trim() ? payload.fileName.replace(/[^A-Za-z0-9._-]/g, "_") : `rig-run-${input.runId}.jsonl`;
7902
7902
  const localSessionPath = join3(tempSessionDir, fileName);
7903
- writeFileSync6(localSessionPath, payload.content);
7903
+ const content = payload.content.split(`
7904
+ `).map((line, index) => {
7905
+ if (index > 0 || !line.trim())
7906
+ return line;
7907
+ try {
7908
+ const header = JSON.parse(line);
7909
+ if (header.type === "session" && typeof header.cwd === "string") {
7910
+ return JSON.stringify({ ...header, cwd: process.cwd() });
7911
+ }
7912
+ } catch {}
7913
+ return line;
7914
+ }).join(`
7915
+ `);
7916
+ writeFileSync6(localSessionPath, content);
7904
7917
  sessionFileArg = ["--session", localSessionPath];
7905
7918
  }
7906
7919
  } catch {}
@@ -609,7 +609,20 @@ async function attachRunBundledPiFrontend(context, input) {
609
609
  if (payload?.ok && typeof payload.content === "string" && payload.content.trim()) {
610
610
  const fileName = typeof payload.fileName === "string" && payload.fileName.trim() ? payload.fileName.replace(/[^A-Za-z0-9._-]/g, "_") : `rig-run-${input.runId}.jsonl`;
611
611
  const localSessionPath = join(tempSessionDir, fileName);
612
- writeFileSync2(localSessionPath, payload.content);
612
+ const content = payload.content.split(`
613
+ `).map((line, index) => {
614
+ if (index > 0 || !line.trim())
615
+ return line;
616
+ try {
617
+ const header = JSON.parse(line);
618
+ if (header.type === "session" && typeof header.cwd === "string") {
619
+ return JSON.stringify({ ...header, cwd: process.cwd() });
620
+ }
621
+ } catch {}
622
+ return line;
623
+ }).join(`
624
+ `);
625
+ writeFileSync2(localSessionPath, content);
613
626
  sessionFileArg = ["--session", localSessionPath];
614
627
  }
615
628
  } catch {}
@@ -372,7 +372,20 @@ async function attachRunBundledPiFrontend(context, input) {
372
372
  if (payload?.ok && typeof payload.content === "string" && payload.content.trim()) {
373
373
  const fileName = typeof payload.fileName === "string" && payload.fileName.trim() ? payload.fileName.replace(/[^A-Za-z0-9._-]/g, "_") : `rig-run-${input.runId}.jsonl`;
374
374
  const localSessionPath = join(tempSessionDir, fileName);
375
- writeFileSync2(localSessionPath, payload.content);
375
+ const content = payload.content.split(`
376
+ `).map((line, index) => {
377
+ if (index > 0 || !line.trim())
378
+ return line;
379
+ try {
380
+ const header = JSON.parse(line);
381
+ if (header.type === "session" && typeof header.cwd === "string") {
382
+ return JSON.stringify({ ...header, cwd: process.cwd() });
383
+ }
384
+ } catch {}
385
+ return line;
386
+ }).join(`
387
+ `);
388
+ writeFileSync2(localSessionPath, content);
376
389
  sessionFileArg = ["--session", localSessionPath];
377
390
  }
378
391
  } catch {}
@@ -847,7 +847,20 @@ async function attachRunBundledPiFrontend(context, input) {
847
847
  if (payload?.ok && typeof payload.content === "string" && payload.content.trim()) {
848
848
  const fileName = typeof payload.fileName === "string" && payload.fileName.trim() ? payload.fileName.replace(/[^A-Za-z0-9._-]/g, "_") : `rig-run-${input.runId}.jsonl`;
849
849
  const localSessionPath = join2(tempSessionDir, fileName);
850
- writeFileSync2(localSessionPath, payload.content);
850
+ const content = payload.content.split(`
851
+ `).map((line, index) => {
852
+ if (index > 0 || !line.trim())
853
+ return line;
854
+ try {
855
+ const header = JSON.parse(line);
856
+ if (header.type === "session" && typeof header.cwd === "string") {
857
+ return JSON.stringify({ ...header, cwd: process.cwd() });
858
+ }
859
+ } catch {}
860
+ return line;
861
+ }).join(`
862
+ `);
863
+ writeFileSync2(localSessionPath, content);
851
864
  sessionFileArg = ["--session", localSessionPath];
852
865
  }
853
866
  } catch {}
@@ -1210,7 +1210,20 @@ async function attachRunBundledPiFrontend(context, input) {
1210
1210
  if (payload?.ok && typeof payload.content === "string" && payload.content.trim()) {
1211
1211
  const fileName = typeof payload.fileName === "string" && payload.fileName.trim() ? payload.fileName.replace(/[^A-Za-z0-9._-]/g, "_") : `rig-run-${input.runId}.jsonl`;
1212
1212
  const localSessionPath = join(tempSessionDir, fileName);
1213
- writeFileSync2(localSessionPath, payload.content);
1213
+ const content = payload.content.split(`
1214
+ `).map((line, index) => {
1215
+ if (index > 0 || !line.trim())
1216
+ return line;
1217
+ try {
1218
+ const header = JSON.parse(line);
1219
+ if (header.type === "session" && typeof header.cwd === "string") {
1220
+ return JSON.stringify({ ...header, cwd: process.cwd() });
1221
+ }
1222
+ } catch {}
1223
+ return line;
1224
+ }).join(`
1225
+ `);
1226
+ writeFileSync2(localSessionPath, content);
1214
1227
  sessionFileArg = ["--session", localSessionPath];
1215
1228
  }
1216
1229
  } catch {}
@@ -7707,7 +7707,20 @@ async function attachRunBundledPiFrontend(context, input) {
7707
7707
  if (payload?.ok && typeof payload.content === "string" && payload.content.trim()) {
7708
7708
  const fileName = typeof payload.fileName === "string" && payload.fileName.trim() ? payload.fileName.replace(/[^A-Za-z0-9._-]/g, "_") : `rig-run-${input.runId}.jsonl`;
7709
7709
  const localSessionPath = join3(tempSessionDir, fileName);
7710
- writeFileSync6(localSessionPath, payload.content);
7710
+ const content = payload.content.split(`
7711
+ `).map((line, index) => {
7712
+ if (index > 0 || !line.trim())
7713
+ return line;
7714
+ try {
7715
+ const header = JSON.parse(line);
7716
+ if (header.type === "session" && typeof header.cwd === "string") {
7717
+ return JSON.stringify({ ...header, cwd: process.cwd() });
7718
+ }
7719
+ } catch {}
7720
+ return line;
7721
+ }).join(`
7722
+ `);
7723
+ writeFileSync6(localSessionPath, content);
7711
7724
  sessionFileArg = ["--session", localSessionPath];
7712
7725
  }
7713
7726
  } catch {}
package/dist/src/index.js CHANGED
@@ -7896,7 +7896,20 @@ async function attachRunBundledPiFrontend(context, input) {
7896
7896
  if (payload?.ok && typeof payload.content === "string" && payload.content.trim()) {
7897
7897
  const fileName = typeof payload.fileName === "string" && payload.fileName.trim() ? payload.fileName.replace(/[^A-Za-z0-9._-]/g, "_") : `rig-run-${input.runId}.jsonl`;
7898
7898
  const localSessionPath = join3(tempSessionDir, fileName);
7899
- writeFileSync6(localSessionPath, payload.content);
7899
+ const content = payload.content.split(`
7900
+ `).map((line, index) => {
7901
+ if (index > 0 || !line.trim())
7902
+ return line;
7903
+ try {
7904
+ const header = JSON.parse(line);
7905
+ if (header.type === "session" && typeof header.cwd === "string") {
7906
+ return JSON.stringify({ ...header, cwd: process.cwd() });
7907
+ }
7908
+ } catch {}
7909
+ return line;
7910
+ }).join(`
7911
+ `);
7912
+ writeFileSync6(localSessionPath, content);
7900
7913
  sessionFileArg = ["--session", localSessionPath];
7901
7914
  }
7902
7915
  } catch {}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@h-rig/cli",
3
- "version": "0.0.6-alpha.72",
3
+ "version": "0.0.6-alpha.73",
4
4
  "type": "module",
5
5
  "description": "Rig package",
6
6
  "license": "UNLICENSED",
@@ -24,13 +24,13 @@
24
24
  "dependencies": {
25
25
  "@clack/prompts": "^1.2.0",
26
26
  "@earendil-works/pi-coding-agent": "0.79.0",
27
- "@rig/client": "npm:@h-rig/client@0.0.6-alpha.72",
28
- "@rig/contracts": "npm:@h-rig/contracts@0.0.6-alpha.72",
29
- "@rig/core": "npm:@h-rig/core@0.0.6-alpha.72",
30
- "@rig/pi-rig": "npm:@h-rig/pi-rig@0.0.6-alpha.72",
31
- "@rig/runtime": "npm:@h-rig/runtime@0.0.6-alpha.72",
32
- "@rig/server": "npm:@h-rig/server@0.0.6-alpha.72",
33
- "@rig/standard-plugin": "npm:@h-rig/standard-plugin@0.0.6-alpha.72",
27
+ "@rig/client": "npm:@h-rig/client@0.0.6-alpha.73",
28
+ "@rig/contracts": "npm:@h-rig/contracts@0.0.6-alpha.73",
29
+ "@rig/core": "npm:@h-rig/core@0.0.6-alpha.73",
30
+ "@rig/pi-rig": "npm:@h-rig/pi-rig@0.0.6-alpha.73",
31
+ "@rig/runtime": "npm:@h-rig/runtime@0.0.6-alpha.73",
32
+ "@rig/server": "npm:@h-rig/server@0.0.6-alpha.73",
33
+ "@rig/standard-plugin": "npm:@h-rig/standard-plugin@0.0.6-alpha.73",
34
34
  "effect": "4.0.0-beta.78",
35
35
  "picocolors": "^1.1.1"
36
36
  }