altimate-receipts 0.5.0 → 0.5.1

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.
@@ -7,7 +7,7 @@ import {
7
7
  loadSession,
8
8
  selectSummary,
9
9
  upsertSection
10
- } from "./chunk-2QTR3AF4.js";
10
+ } from "./chunk-EYM5WETZ.js";
11
11
 
12
12
  // src/report/sessions.ts
13
13
  async function deriveTargets(opts) {
@@ -259,4 +259,4 @@ export {
259
259
  renderTrends,
260
260
  upsertTrendsSection
261
261
  };
262
- //# sourceMappingURL=chunk-QGUQOQXO.js.map
262
+ //# sourceMappingURL=chunk-EKMFU3ES.js.map
@@ -177,6 +177,37 @@ function shellExecutorArg(clause) {
177
177
  }
178
178
  return void 0;
179
179
  }
180
+ function cwdAtFirstGit(command, base4) {
181
+ let cur = base4;
182
+ let moved = false;
183
+ let unknown = false;
184
+ for (const clause of splitClauses(stripHeredocs(command))) {
185
+ const toks = tokenize(clause);
186
+ if (toks[0] === "cd" || toks[0] === "pushd") {
187
+ const target = toks[1];
188
+ if (!target || /[$`*?]/.test(target)) {
189
+ unknown = true;
190
+ } else if (target.startsWith("/")) {
191
+ cur = target;
192
+ moved = true;
193
+ unknown = false;
194
+ } else if (cur && !unknown) {
195
+ cur = `${cur}/${target}`.replace(/\/\.\//g, "/");
196
+ moved = true;
197
+ } else {
198
+ unknown = true;
199
+ }
200
+ continue;
201
+ }
202
+ if (parseClause(clause)) {
203
+ if (unknown) {
204
+ return { kind: "unknown" };
205
+ }
206
+ return moved && cur ? { kind: "known", path: cur } : { kind: "base" };
207
+ }
208
+ }
209
+ return { kind: "base" };
210
+ }
180
211
  function parseGitInvocations(command, depth = 0) {
181
212
  const stripped = stripHeredocs(command);
182
213
  const out = [];
@@ -1146,6 +1177,7 @@ function deriveSpans(session) {
1146
1177
  status: call.status === "error" ? "error" : call.status === "running" ? "running" : "ok",
1147
1178
  input: call.input,
1148
1179
  output: call.output,
1180
+ cwd: call.cwd,
1149
1181
  startLine: call.startLine,
1150
1182
  destructive,
1151
1183
  attributes: call.attributes
@@ -3628,7 +3660,8 @@ async function parseTranscript(filePath, withMessages, source, provider) {
3628
3660
  id: typeof block.id === "string" ? block.id : void 0,
3629
3661
  name: typeof block.name === "string" ? block.name : "tool",
3630
3662
  input: block.input,
3631
- status: "running"
3663
+ status: "running",
3664
+ cwd: r.cwd
3632
3665
  };
3633
3666
  toolCalls.push(call);
3634
3667
  if (call.id) {
@@ -4527,6 +4560,7 @@ export {
4527
4560
  commandOf,
4528
4561
  destructiveMatch,
4529
4562
  deriveSpans,
4563
+ cwdAtFirstGit,
4530
4564
  parseGitInvocations,
4531
4565
  isNoVerify,
4532
4566
  rewritesHistory,
@@ -4566,4 +4600,4 @@ export {
4566
4600
  redact,
4567
4601
  redactReceipt
4568
4602
  };
4569
- //# sourceMappingURL=chunk-2QTR3AF4.js.map
4603
+ //# sourceMappingURL=chunk-EYM5WETZ.js.map