deepline 0.3.337 → 0.3.338

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.
Files changed (95) hide show
  1. package/dist/bundling-sources/sdk/src/agent-runtime.ts +21 -0
  2. package/dist/bundling-sources/sdk/src/release.ts +1 -1
  3. package/dist/bundling-sources/shared_libs/observability/scheduled-jobs.json +2 -2
  4. package/dist/cli/auth-LVTYDMEL.js +31 -0
  5. package/dist/cli/{auth-6EREYQBM.mjs → auth-MTF2TRBC.mjs} +4 -4
  6. package/dist/cli/{billing-VMXYQMW6.mjs → billing-HXXPKDYV.mjs} +4 -4
  7. package/dist/cli/{billing-HZBD5KW6.js → billing-OXEY6DAU.js} +71 -71
  8. package/dist/cli/{chunk-3OBY2AGM.js → chunk-5OHHWYOV.js} +45 -45
  9. package/dist/cli/{chunk-FY65AYHZ.mjs → chunk-6CEPAFCE.mjs} +4 -4
  10. package/dist/cli/{chunk-NC5ODEG7.js → chunk-7EQ3WFD2.js} +9 -9
  11. package/dist/cli/{chunk-HBM2UKEU.mjs → chunk-7WL23HDH.mjs} +1 -1
  12. package/dist/cli/{chunk-M7IN66XB.js → chunk-AHO5IXHM.js} +15 -15
  13. package/dist/cli/{chunk-6PGYQ6IG.js → chunk-BYIWZOSA.js} +6 -6
  14. package/dist/cli/{chunk-VXCRG4J7.mjs → chunk-CGVCELEC.mjs} +1 -1
  15. package/dist/cli/{chunk-HDI6GSRQ.js → chunk-CVSUI4Z2.js} +48 -48
  16. package/dist/cli/{chunk-GPN5QAN2.mjs → chunk-FBU4A2ZE.mjs} +2 -2
  17. package/dist/cli/{chunk-YSR4PFTZ.js → chunk-FOODYFMR.js} +1 -1
  18. package/dist/cli/{chunk-5WTJ73QU.js → chunk-FYR7GGUF.js} +225 -225
  19. package/dist/cli/{chunk-MHWEX6GA.js → chunk-HJEHCSFH.js} +8 -8
  20. package/dist/cli/{chunk-35JNW43E.mjs → chunk-ID5OGCLU.mjs} +3 -3
  21. package/dist/cli/{chunk-YQW2FPKQ.mjs → chunk-J47TX67H.mjs} +1 -1
  22. package/dist/cli/{chunk-4SRIWSEG.js → chunk-KLAWLBSP.js} +60 -60
  23. package/dist/cli/{chunk-QEBA4KXE.js → chunk-KRZDVQZH.js} +70 -28
  24. package/dist/cli/{chunk-5ERCVX2D.mjs → chunk-MIHJFRGP.mjs} +2 -2
  25. package/dist/cli/{chunk-2LHYWYHM.mjs → chunk-N3EOKUQV.mjs} +54 -12
  26. package/dist/cli/{chunk-TB6HY4BW.mjs → chunk-NHTICK5G.mjs} +2 -2
  27. package/dist/cli/{chunk-XFSDLHGS.js → chunk-NR5ILIKI.js} +2 -2
  28. package/dist/cli/{chunk-A75J52BM.js → chunk-NUJIZBLA.js} +89 -76
  29. package/dist/cli/{chunk-ZUB3LXOI.mjs → chunk-OTJMWSIK.mjs} +5 -5
  30. package/dist/cli/{chunk-7MRAPBWB.mjs → chunk-SSRGN56V.mjs} +1 -1
  31. package/dist/cli/{chunk-IYK6XS5X.mjs → chunk-UVGGJ2CV.mjs} +6 -6
  32. package/dist/cli/{chunk-NIXE5325.js → chunk-XWTEOTGL.js} +26 -26
  33. package/dist/cli/{chunk-NQ42LHHS.mjs → chunk-YMLGJ2B7.mjs} +14 -1
  34. package/dist/cli/{client-BLGAYJME.mjs → client-LXBODS53.mjs} +3 -3
  35. package/dist/cli/client-V4OIXTP6.js +20 -0
  36. package/dist/cli/{csv-43QTLWPN.mjs → csv-3346Z7MA.mjs} +3 -3
  37. package/dist/cli/{csv-6WIFI6WR.js → csv-5UMO4TMZ.js} +12 -12
  38. package/dist/cli/{db-NCERSUPL.mjs → db-HVAQDN7U.mjs} +4 -4
  39. package/dist/cli/{db-5XFKB76V.js → db-RBWIVEB3.js} +29 -29
  40. package/dist/cli/{describe-4DNSNQKM.js → describe-LAAOJYI2.js} +15 -15
  41. package/dist/cli/{describe-V4BPRUES.mjs → describe-OKSZOU3V.mjs} +8 -8
  42. package/dist/cli/{executions-GQ4C2FGI.js → executions-5WENZ6MO.js} +6 -6
  43. package/dist/cli/{executions-IGXMYAYA.mjs → executions-T56YNXAC.mjs} +4 -4
  44. package/dist/cli/{feedback-UVDBDHE4.mjs → feedback-RU4EKJYX.mjs} +8 -3
  45. package/dist/cli/{feedback-UFFCKVNH.js → feedback-YZILULGJ.js} +11 -6
  46. package/dist/cli/{git-XI6XRTIZ.mjs → git-LX7NYWDT.mjs} +4 -4
  47. package/dist/cli/git-XASJHFDR.js +23 -0
  48. package/dist/cli/index.js +79 -79
  49. package/dist/cli/index.mjs +31 -31
  50. package/dist/cli/{legacy-noops-5Z3YLPCN.js → legacy-noops-K6W26TQA.js} +7 -7
  51. package/dist/cli/{legacy-noops-IUJOLPED.mjs → legacy-noops-SN44IUWD.mjs} +4 -4
  52. package/dist/cli/{monitors-KUS3ROXZ.mjs → monitors-BQ5SXRDD.mjs} +4 -4
  53. package/dist/cli/{monitors-TZAGTEID.js → monitors-R4D7X7PL.js} +85 -85
  54. package/dist/cli/{org-AHHROX6T.js → org-6GWQHHLF.js} +60 -60
  55. package/dist/cli/{org-SLIG47UE.mjs → org-RNR3CGVL.mjs} +4 -4
  56. package/dist/cli/play-2V2Y4P3P.js +153 -0
  57. package/dist/cli/{play-G4AQ2OZ5.mjs → play-CPG4HFXR.mjs} +7 -7
  58. package/dist/cli/{providers-PBFVQ2EP.js → providers-AP5NBYJF.js} +7 -7
  59. package/dist/cli/{providers-XQIQO6M3.mjs → providers-YEFPQW3K.mjs} +4 -4
  60. package/dist/cli/{quickstart-X6CLGXVG.js → quickstart-5D6WSPKU.js} +5 -5
  61. package/dist/cli/{quickstart-PCASXB6T.mjs → quickstart-IT43KYUN.mjs} +3 -3
  62. package/dist/cli/{search-ZTYQBKME.mjs → search-BVTZBNF3.mjs} +5 -5
  63. package/dist/cli/search-O66KVPGA.js +26 -0
  64. package/dist/cli/{secrets-IDF3FB7W.mjs → secrets-7HG77SLP.mjs} +4 -4
  65. package/dist/cli/{secrets-N3DWWVAY.js → secrets-L6Q2JJNX.js} +13 -13
  66. package/dist/cli/{sessions-ECDSBB7P.mjs → sessions-SSBDCVQN.mjs} +4 -4
  67. package/dist/cli/{sessions-SXXMNGUT.js → sessions-TNXYON2R.js} +5 -5
  68. package/dist/cli/{settings-IXHK6BAK.js → settings-4FKK3LUF.js} +74 -74
  69. package/dist/cli/{settings-FKARLN4C.mjs → settings-5L23COY7.mjs} +7 -7
  70. package/dist/cli/{setup-MJXYEE27.js → setup-EB5JLUFH.js} +41 -41
  71. package/dist/cli/{setup-LJG55UUU.mjs → setup-GXXWJFRV.mjs} +6 -6
  72. package/dist/cli/{skills-3IBFR2ZU.mjs → skills-ETEFVVPT.mjs} +4 -4
  73. package/dist/cli/skills-XFMWA4WX.js +28 -0
  74. package/dist/cli/tools-3TWNYKZY.js +40 -0
  75. package/dist/cli/{tools-ZJTHJHAD.mjs → tools-HDTU55RW.mjs} +6 -6
  76. package/dist/cli/update-AEBCM2LT.js +28 -0
  77. package/dist/cli/{update-ZN34FLDH.mjs → update-FR5QUV5I.mjs} +6 -6
  78. package/dist/cli/{workflow-LPCF7OMO.mjs → workflow-BE77YVLP.mjs} +5 -5
  79. package/dist/cli/{workflow-VLCSTKPW.js → workflow-OFWWX4ZP.js} +15 -15
  80. package/dist/index.js +6 -6
  81. package/dist/index.mjs +3 -3
  82. package/dist/install-integrity.json +74 -74
  83. package/dist/release.d.mts +1 -1
  84. package/dist/release.d.ts +1 -1
  85. package/dist/release.js +2 -2
  86. package/dist/release.mjs +1 -1
  87. package/package.json +1 -1
  88. package/dist/cli/auth-XS3LNSAH.js +0 -31
  89. package/dist/cli/client-ERDYIAWV.js +0 -20
  90. package/dist/cli/git-4ORFOHYQ.js +0 -23
  91. package/dist/cli/play-RRKTT3F2.js +0 -153
  92. package/dist/cli/search-QGFQSDJI.js +0 -26
  93. package/dist/cli/skills-RI3IZNWB.js +0 -28
  94. package/dist/cli/tools-NQJLSI4O.js +0 -40
  95. package/dist/cli/update-JY7TJJDL.js +0 -28
@@ -1,7 +1,10 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
2
2
 
3
3
 
4
- var _chunk6PGYQ6IGjs = require('./chunk-6PGYQ6IG.js');
4
+ var _chunkBYIWZOSAjs = require('./chunk-BYIWZOSA.js');
5
+
6
+
7
+ var _chunkNUJIZBLAjs = require('./chunk-NUJIZBLA.js');
5
8
 
6
9
  // src/cli/commands/sessions.ts
7
10
 
@@ -12,6 +15,9 @@ var _chunk6PGYQ6IGjs = require('./chunk-6PGYQ6IG.js');
12
15
 
13
16
 
14
17
 
18
+
19
+
20
+
15
21
  var _fs = require('fs');
16
22
  var _os = require('os');
17
23
  var _path = require('path');
@@ -129,21 +135,43 @@ function statIfReadable(filePath) {
129
135
  return null;
130
136
  }
131
137
  }
132
- function newestSessionFile(agent) {
133
- let newest = null;
134
- for (const candidate of listSessionFiles(agent)) {
135
- if (!newest || candidate.mtimeMs > newest.mtimeMs) {
136
- newest = candidate;
138
+ function currentSessionFile(agent) {
139
+ const newestFirst = listSessionFiles(agent).sort(
140
+ (a, b) => b.mtimeMs - a.mtimeMs
141
+ );
142
+ const sessionId = _chunkNUJIZBLAjs.agentSessionIdFromEnvironment.call(void 0, );
143
+ const cwd = process.cwd();
144
+ return _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(newestFirst.find((candidate) => candidate.sessionId === sessionId), () => ( newestFirst.find(
145
+ (candidate) => sessionStartedInDirectory(candidate, cwd)
146
+ ))), () => ( newestFirst[0])), () => ( null));
147
+ }
148
+ function sessionStartedInDirectory(candidate, cwd) {
149
+ if (candidate.agent === "claude") {
150
+ return _path.basename.call(void 0, _path.dirname.call(void 0, candidate.filePath)) === cwd.replace(/[^a-zA-Z0-9]/g, "-");
151
+ }
152
+ return readCodexSessionCwd(candidate.filePath) === cwd;
153
+ }
154
+ function readCodexSessionCwd(filePath) {
155
+ try {
156
+ const fd = _fs.openSync.call(void 0, filePath, "r");
157
+ try {
158
+ const head = Buffer.alloc(8192);
159
+ const length = _fs.readSync.call(void 0, fd, head, 0, head.length, 0);
160
+ const match = head.toString("utf8", 0, length).match(/"cwd":("(?:[^"\\]|\\.)*")/);
161
+ return _optionalChain([match, 'optionalAccess', _17 => _17[1]]) ? JSON.parse(match[1]) : null;
162
+ } finally {
163
+ _fs.closeSync.call(void 0, fd);
137
164
  }
165
+ } catch (e4) {
166
+ return null;
138
167
  }
139
- return newest;
140
168
  }
141
169
  function sessionIdFromClaudeFilePath(filePath) {
142
170
  return _path.basename.call(void 0, filePath, ".jsonl");
143
171
  }
144
172
  function sessionIdFromCodexFilePath(filePath) {
145
173
  const match = _path.basename.call(void 0, filePath, ".jsonl").match(UUID_IN_TEXT_RE);
146
- return _nullishCoalesce(_optionalChain([match, 'optionalAccess', _17 => _17[0]]), () => ( null));
174
+ return _nullishCoalesce(_optionalChain([match, 'optionalAccess', _18 => _18[0]]), () => ( null));
147
175
  }
148
176
  function readCodexSessionId(filePath) {
149
177
  try {
@@ -155,10 +183,10 @@ function readCodexSessionId(filePath) {
155
183
  if (!parsed || typeof parsed !== "object") continue;
156
184
  const record = parsed;
157
185
  const payload = record.payload && typeof record.payload === "object" ? record.payload : null;
158
- const id = record.type === "session_meta" && typeof _optionalChain([payload, 'optionalAccess', _18 => _18.id]) === "string" ? payload.id : null;
186
+ const id = record.type === "session_meta" && typeof _optionalChain([payload, 'optionalAccess', _19 => _19.id]) === "string" ? payload.id : null;
159
187
  if (id && UUID_RE.test(id)) return id;
160
188
  }
161
- } catch (e4) {
189
+ } catch (e5) {
162
190
  return null;
163
191
  }
164
192
  return null;
@@ -201,7 +229,7 @@ function resolveSessionTargets(input) {
201
229
  const agent = parseSessionAgent(input.agent);
202
230
  const targets = [];
203
231
  if (input.currentSession) {
204
- const currentFile = newestSessionFile(agent);
232
+ const currentFile = currentSessionFile(agent);
205
233
  if (!currentFile) {
206
234
  throw new Error(
207
235
  `No session files found in ${sessionSearchDescription(agent)}.`
@@ -223,7 +251,7 @@ function resolveSessionTargets(input) {
223
251
  }
224
252
  targets.push({
225
253
  sessionId,
226
- label: _nullishCoalesce(_optionalChain([input, 'access', _19 => _19.labels, 'optionalAccess', _20 => _20[index]]), () => ( `${candidate.agent}-session-${sessionId}`)),
254
+ label: _nullishCoalesce(_optionalChain([input, 'access', _20 => _20.labels, 'optionalAccess', _21 => _21[index]]), () => ( `${candidate.agent}-session-${sessionId}`)),
227
255
  filePath: candidate.filePath,
228
256
  agent: candidate.agent
229
257
  });
@@ -236,7 +264,7 @@ function resolveSessionTargets(input) {
236
264
  function parseJsonLine(line) {
237
265
  try {
238
266
  return JSON.parse(line);
239
- } catch (e5) {
267
+ } catch (e6) {
240
268
  return null;
241
269
  }
242
270
  }
@@ -420,7 +448,7 @@ function buildSessionUploadContent(raw) {
420
448
  return { encodedContent: encoded, needsChunking: true };
421
449
  }
422
450
  async function uploadPayload(path, payload) {
423
- const { http } = _chunk6PGYQ6IGjs.getAuthedHttpClient.call(void 0, );
451
+ const { http } = _chunkBYIWZOSAjs.getAuthedHttpClient.call(void 0, );
424
452
  return await http.post(path, payload);
425
453
  }
426
454
  async function uploadChunkedSessions(sessions, options) {
@@ -452,16 +480,20 @@ async function uploadChunkedSessions(sessions, options) {
452
480
  environments: sessions.map(() => detectShellContext()),
453
481
  ...options.rating ? { rating: options.rating } : {}
454
482
  });
455
- _chunk6PGYQ6IGjs.printCommandEnvelope.call(void 0,
483
+ const sessionIds = sessions.map((session) => session.sessionId);
484
+ _chunkBYIWZOSAjs.printCommandEnvelope.call(void 0,
456
485
  {
457
486
  ...response,
458
487
  ok: true,
459
488
  uploaded: sessions.length,
489
+ session_ids: sessionIds,
460
490
  render: {
461
491
  sections: [
462
492
  {
463
493
  title: "sessions send",
464
- lines: ["Session uploaded to #internal-reports (chunked)."]
494
+ lines: [
495
+ `Session ${sessionIds.join(", ")} uploaded to #internal-reports (chunked).`
496
+ ]
465
497
  }
466
498
  ]
467
499
  }
@@ -481,7 +513,7 @@ async function handleSessionsSend(options) {
481
513
  filename: _path.basename.call(void 0, filePath),
482
514
  ...rating ? { rating } : {}
483
515
  });
484
- _chunk6PGYQ6IGjs.printCommandEnvelope.call(void 0,
516
+ _chunkBYIWZOSAjs.printCommandEnvelope.call(void 0,
485
517
  {
486
518
  ...response2,
487
519
  ok: true,
@@ -515,9 +547,9 @@ async function handleSessionsSend(options) {
515
547
  await uploadChunkedSessions(built, { json: options.json, rating });
516
548
  return;
517
549
  }
518
- const response = built.length === 1 && !_optionalChain([options, 'access', _21 => _21.label, 'optionalAccess', _22 => _22.length]) ? await uploadPayload("/api/v2/cli/send-session", {
519
- session_id: _optionalChain([built, 'access', _23 => _23[0], 'optionalAccess', _24 => _24.sessionId]),
520
- content: _optionalChain([built, 'access', _25 => _25[0], 'optionalAccess', _26 => _26.encodedContent]),
550
+ const response = built.length === 1 && !_optionalChain([options, 'access', _22 => _22.label, 'optionalAccess', _23 => _23.length]) ? await uploadPayload("/api/v2/cli/send-session", {
551
+ session_id: _optionalChain([built, 'access', _24 => _24[0], 'optionalAccess', _25 => _25.sessionId]),
552
+ content: _optionalChain([built, 'access', _26 => _26[0], 'optionalAccess', _27 => _27.encodedContent]),
521
553
  environment: detectShellContext(),
522
554
  ...rating ? { rating } : {}
523
555
  }) : await uploadPayload("/api/v2/cli/send-session", {
@@ -530,16 +562,20 @@ async function handleSessionsSend(options) {
530
562
  environment: detectShellContext(),
531
563
  ...rating ? { rating } : {}
532
564
  });
533
- _chunk6PGYQ6IGjs.printCommandEnvelope.call(void 0,
565
+ const sessionIds = built.map((session) => session.sessionId);
566
+ _chunkBYIWZOSAjs.printCommandEnvelope.call(void 0,
534
567
  {
535
568
  ...response,
536
569
  ok: true,
537
570
  uploaded: built.length,
571
+ session_ids: sessionIds,
538
572
  render: {
539
573
  sections: [
540
574
  {
541
575
  title: "sessions send",
542
- lines: ["Session uploaded to #internal-reports."]
576
+ lines: [
577
+ `Session ${sessionIds.join(", ")} uploaded to #internal-reports.`
578
+ ]
543
579
  }
544
580
  ]
545
581
  }
@@ -548,7 +584,7 @@ async function handleSessionsSend(options) {
548
584
  );
549
585
  }
550
586
  function loadViewerAssets() {
551
- const cliEntry = _optionalChain([process, 'access', _27 => _27.argv, 'access', _28 => _28[1], 'optionalAccess', _29 => _29.trim, 'call', _30 => _30()]) ? _fs.realpathSync.call(void 0, _path.resolve.call(void 0, process.argv[1])) : null;
587
+ const cliEntry = _optionalChain([process, 'access', _28 => _28.argv, 'access', _29 => _29[1], 'optionalAccess', _30 => _30.trim, 'call', _31 => _31()]) ? _fs.realpathSync.call(void 0, _path.resolve.call(void 0, process.argv[1])) : null;
552
588
  const candidateRoots = [
553
589
  ...cliEntry ? [
554
590
  _path.join.call(void 0, _path.dirname.call(void 0, _path.dirname.call(void 0, cliEntry)), "viewer"),
@@ -571,7 +607,7 @@ function loadViewerAssets() {
571
607
  css: _fs.readFileSync.call(void 0, cssPath, "utf8"),
572
608
  js: _fs.readFileSync.call(void 0, jsPath, "utf8")
573
609
  };
574
- } catch (e6) {
610
+ } catch (e7) {
575
611
  continue;
576
612
  }
577
613
  }
@@ -601,7 +637,7 @@ async function handleSessionsRender(options) {
601
637
  _fs.mkdirSync.call(void 0, outputDir, { recursive: true });
602
638
  outputPath = _path.join.call(void 0,
603
639
  outputDir,
604
- targets.length > 1 ? "session-viewer.html" : `session-${_optionalChain([targets, 'access', _31 => _31[0], 'optionalAccess', _32 => _32.sessionId])}.html`
640
+ targets.length > 1 ? "session-viewer.html" : `session-${_optionalChain([targets, 'access', _32 => _32[0], 'optionalAccess', _33 => _33.sessionId])}.html`
605
641
  );
606
642
  } else {
607
643
  _fs.mkdirSync.call(void 0, _path.dirname.call(void 0, outputPath), { recursive: true });
@@ -635,7 +671,7 @@ ${refreshMeta}
635
671
  </body>
636
672
  </html>`;
637
673
  _fs.writeFileSync.call(void 0, outputPath, html, "utf8");
638
- _chunk6PGYQ6IGjs.printCommandEnvelope.call(void 0,
674
+ _chunkBYIWZOSAjs.printCommandEnvelope.call(void 0,
639
675
  {
640
676
  ok: true,
641
677
  file: outputPath,
@@ -699,7 +735,10 @@ Examples:
699
735
  "--agent <auto|claude|codex>",
700
736
  "Limit transcript discovery to one agent runtime",
701
737
  "auto"
702
- ).option("--current-session", "Use the newest local agent session JSONL").option("--file <path>", "Upload a raw local file instead of a session").option(
738
+ ).option(
739
+ "--current-session",
740
+ "Use the calling agent's session, else the newest in this directory"
741
+ ).option("--file <path>", "Upload a raw local file instead of a session").option(
703
742
  "--rating <good|poor|neutral>",
704
743
  "Tag the upload by outcome, not tone, so Deepline can filter sessions: good = the user's goal was met without product problems; poor = the goal was missed, or a product failure, bug, or avoidable friction (including a substantial workaround) got in the way; neutral = partly met or unclear."
705
744
  ).option("--json", "Emit JSON output. Also automatic when stdout is piped").action(handleSessionsSend);
@@ -726,7 +765,10 @@ Examples:
726
765
  "--agent <auto|claude|codex>",
727
766
  "Limit transcript discovery to one agent runtime",
728
767
  "auto"
729
- ).option("--current-session", "Use the newest local agent session JSONL").option("--auto-refresh <seconds>", "Add a browser auto-refresh interval").option("-o, --output <path>", "Output HTML path").option("--json", "Emit JSON output. Also automatic when stdout is piped").action(handleSessionsRender);
768
+ ).option(
769
+ "--current-session",
770
+ "Use the calling agent's session, else the newest in this directory"
771
+ ).option("--auto-refresh <seconds>", "Add a browser auto-refresh interval").option("-o, --output <path>", "Output HTML path").option("--json", "Emit JSON output. Also automatic when stdout is piped").action(handleSessionsRender);
730
772
  }
731
773
 
732
774
 
@@ -2,10 +2,10 @@ import {
2
2
  getAuthedHttpClient,
3
3
  openInBrowser,
4
4
  printCommandEnvelope
5
- } from "./chunk-YQW2FPKQ.mjs";
5
+ } from "./chunk-J47TX67H.mjs";
6
6
  import {
7
7
  resolveBaseUrlOnly
8
- } from "./chunk-NQ42LHHS.mjs";
8
+ } from "./chunk-YMLGJ2B7.mjs";
9
9
 
10
10
  // src/cli/commands/git.ts
11
11
  function shellQuote(value) {
@@ -1,14 +1,20 @@
1
1
  import {
2
2
  getAuthedHttpClient,
3
3
  printCommandEnvelope
4
- } from "./chunk-YQW2FPKQ.mjs";
4
+ } from "./chunk-J47TX67H.mjs";
5
+ import {
6
+ agentSessionIdFromEnvironment
7
+ } from "./chunk-YMLGJ2B7.mjs";
5
8
 
6
9
  // src/cli/commands/sessions.ts
7
10
  import {
11
+ closeSync,
8
12
  existsSync,
9
13
  mkdirSync,
14
+ openSync,
10
15
  readdirSync,
11
16
  readFileSync,
17
+ readSync,
12
18
  realpathSync,
13
19
  statSync,
14
20
  writeFileSync
@@ -129,14 +135,36 @@ function statIfReadable(filePath) {
129
135
  return null;
130
136
  }
131
137
  }
132
- function newestSessionFile(agent) {
133
- let newest = null;
134
- for (const candidate of listSessionFiles(agent)) {
135
- if (!newest || candidate.mtimeMs > newest.mtimeMs) {
136
- newest = candidate;
138
+ function currentSessionFile(agent) {
139
+ const newestFirst = listSessionFiles(agent).sort(
140
+ (a, b) => b.mtimeMs - a.mtimeMs
141
+ );
142
+ const sessionId = agentSessionIdFromEnvironment();
143
+ const cwd = process.cwd();
144
+ return newestFirst.find((candidate) => candidate.sessionId === sessionId) ?? newestFirst.find(
145
+ (candidate) => sessionStartedInDirectory(candidate, cwd)
146
+ ) ?? newestFirst[0] ?? null;
147
+ }
148
+ function sessionStartedInDirectory(candidate, cwd) {
149
+ if (candidate.agent === "claude") {
150
+ return basename(dirname(candidate.filePath)) === cwd.replace(/[^a-zA-Z0-9]/g, "-");
151
+ }
152
+ return readCodexSessionCwd(candidate.filePath) === cwd;
153
+ }
154
+ function readCodexSessionCwd(filePath) {
155
+ try {
156
+ const fd = openSync(filePath, "r");
157
+ try {
158
+ const head = Buffer.alloc(8192);
159
+ const length = readSync(fd, head, 0, head.length, 0);
160
+ const match = head.toString("utf8", 0, length).match(/"cwd":("(?:[^"\\]|\\.)*")/);
161
+ return match?.[1] ? JSON.parse(match[1]) : null;
162
+ } finally {
163
+ closeSync(fd);
137
164
  }
165
+ } catch {
166
+ return null;
138
167
  }
139
- return newest;
140
168
  }
141
169
  function sessionIdFromClaudeFilePath(filePath) {
142
170
  return basename(filePath, ".jsonl");
@@ -201,7 +229,7 @@ function resolveSessionTargets(input) {
201
229
  const agent = parseSessionAgent(input.agent);
202
230
  const targets = [];
203
231
  if (input.currentSession) {
204
- const currentFile = newestSessionFile(agent);
232
+ const currentFile = currentSessionFile(agent);
205
233
  if (!currentFile) {
206
234
  throw new Error(
207
235
  `No session files found in ${sessionSearchDescription(agent)}.`
@@ -452,16 +480,20 @@ async function uploadChunkedSessions(sessions, options) {
452
480
  environments: sessions.map(() => detectShellContext()),
453
481
  ...options.rating ? { rating: options.rating } : {}
454
482
  });
483
+ const sessionIds = sessions.map((session) => session.sessionId);
455
484
  printCommandEnvelope(
456
485
  {
457
486
  ...response,
458
487
  ok: true,
459
488
  uploaded: sessions.length,
489
+ session_ids: sessionIds,
460
490
  render: {
461
491
  sections: [
462
492
  {
463
493
  title: "sessions send",
464
- lines: ["Session uploaded to #internal-reports (chunked)."]
494
+ lines: [
495
+ `Session ${sessionIds.join(", ")} uploaded to #internal-reports (chunked).`
496
+ ]
465
497
  }
466
498
  ]
467
499
  }
@@ -530,16 +562,20 @@ async function handleSessionsSend(options) {
530
562
  environment: detectShellContext(),
531
563
  ...rating ? { rating } : {}
532
564
  });
565
+ const sessionIds = built.map((session) => session.sessionId);
533
566
  printCommandEnvelope(
534
567
  {
535
568
  ...response,
536
569
  ok: true,
537
570
  uploaded: built.length,
571
+ session_ids: sessionIds,
538
572
  render: {
539
573
  sections: [
540
574
  {
541
575
  title: "sessions send",
542
- lines: ["Session uploaded to #internal-reports."]
576
+ lines: [
577
+ `Session ${sessionIds.join(", ")} uploaded to #internal-reports.`
578
+ ]
543
579
  }
544
580
  ]
545
581
  }
@@ -699,7 +735,10 @@ Examples:
699
735
  "--agent <auto|claude|codex>",
700
736
  "Limit transcript discovery to one agent runtime",
701
737
  "auto"
702
- ).option("--current-session", "Use the newest local agent session JSONL").option("--file <path>", "Upload a raw local file instead of a session").option(
738
+ ).option(
739
+ "--current-session",
740
+ "Use the calling agent's session, else the newest in this directory"
741
+ ).option("--file <path>", "Upload a raw local file instead of a session").option(
703
742
  "--rating <good|poor|neutral>",
704
743
  "Tag the upload by outcome, not tone, so Deepline can filter sessions: good = the user's goal was met without product problems; poor = the goal was missed, or a product failure, bug, or avoidable friction (including a substantial workaround) got in the way; neutral = partly met or unclear."
705
744
  ).option("--json", "Emit JSON output. Also automatic when stdout is piped").action(handleSessionsSend);
@@ -726,7 +765,10 @@ Examples:
726
765
  "--agent <auto|claude|codex>",
727
766
  "Limit transcript discovery to one agent runtime",
728
767
  "auto"
729
- ).option("--current-session", "Use the newest local agent session JSONL").option("--auto-refresh <seconds>", "Add a browser auto-refresh interval").option("-o, --output <path>", "Output HTML path").option("--json", "Emit JSON output. Also automatic when stdout is piped").action(handleSessionsRender);
768
+ ).option(
769
+ "--current-session",
770
+ "Use the calling agent's session, else the newest in this directory"
771
+ ).option("--auto-refresh <seconds>", "Add a browser auto-refresh interval").option("-o, --output <path>", "Output HTML path").option("--json", "Emit JSON output. Also automatic when stdout is piped").action(handleSessionsRender);
730
772
  }
731
773
 
732
774
  export {
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-GAMFK2ZP.mjs";
4
4
  import {
5
5
  printCommandEnvelope
6
- } from "./chunk-YQW2FPKQ.mjs";
6
+ } from "./chunk-J47TX67H.mjs";
7
7
  import {
8
8
  DEFAULT_SKILL_AGENTS,
9
9
  KNOWN_SKILL_AGENTS,
@@ -22,7 +22,7 @@ import {
22
22
  sdkCliStateDirPath,
23
23
  skillsAgentPathSegment,
24
24
  writeSdkSkillsLocalVersion
25
- } from "./chunk-NQ42LHHS.mjs";
25
+ } from "./chunk-YMLGJ2B7.mjs";
26
26
  import {
27
27
  DeeplineError
28
28
  } from "./chunk-NXGCO4JB.mjs";
@@ -1,6 +1,6 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
2
2
 
3
- var _chunk4SRIWSEGjs = require('./chunk-4SRIWSEG.js');
3
+ var _chunkKLAWLBSPjs = require('./chunk-KLAWLBSP.js');
4
4
 
5
5
  // src/cli/npm-script-policy.ts
6
6
  var _child_process = require('child_process');
@@ -13,7 +13,7 @@ function npmSupportsAllowScripts(version) {
13
13
  }
14
14
  function readNpmVersion(env) {
15
15
  try {
16
- const plan = _chunk4SRIWSEGjs.resolveShellSpawn.call(void 0, "npm", ["--version"], process.platform, env);
16
+ const plan = _chunkKLAWLBSPjs.resolveShellSpawn.call(void 0, "npm", ["--version"], process.platform, env);
17
17
  const result = _child_process.spawnSync.call(void 0, plan.command, plan.args, {
18
18
  encoding: "utf8",
19
19
  env,