@staff0rd/assist 0.1209.10 → 0.1209.12
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/.build-files +81 -81
- package/dist/{addActivity-PLNFAQVP.js → addActivity-RJUB6VYL.js} +2 -2
- package/dist/{addPhase-TTGDRRKJ.js → addPhase-7GZMAD5M.js} +3 -3
- package/dist/{advise-36VIPPXJ.js → advise-P5BJ2VXH.js} +3 -3
- package/dist/{askCheck-DRRBLFHP.js → askCheck-Q25WGI6P.js} +7 -7
- package/dist/{askDesign-MJ6BAVD7.js → askDesign-C4ZW7N2J.js} +1 -1
- package/dist/{branch-OMFTQK3W.js → branch-GEXNKBNH.js} +3 -3
- package/dist/built-version +1 -1
- package/dist/{chunk-BZ4NSHKC.js → chunk-2IPZDH4Q.js} +1 -1
- package/dist/{chunk-AVWHLYRU.js → chunk-3N6Z2ZRY.js} +1 -1
- package/dist/{chunk-YP4LPJ7P.js → chunk-3PJJWRGZ.js} +1 -1
- package/dist/{chunk-SIZYUJM7.js → chunk-4LFLNZSZ.js} +1 -1
- package/dist/{chunk-NEC6OVBH.js → chunk-5FJGB5JB.js} +5 -5
- package/dist/{chunk-5GE4SCZV.js → chunk-5PE3M4A4.js} +1 -1
- package/dist/{chunk-VIKP2CPB.js → chunk-5WZOGIUM.js} +6 -6
- package/dist/{chunk-4JVS2C67.js → chunk-6ECUZF6F.js} +1 -1
- package/dist/{chunk-HFUFS7V6.js → chunk-6K7EALV5.js} +1 -1
- package/dist/{chunk-3EPOPLVB.js → chunk-BIHTVQ5N.js} +1 -1
- package/dist/{chunk-M6G6HBNN.js → chunk-BXMHCKEA.js} +2 -2
- package/dist/{chunk-4VJXZMG4.js → chunk-C3JJGZPE.js} +2 -2
- package/dist/{chunk-ZZPDMUIS.js → chunk-CA65WBYZ.js} +1 -1
- package/dist/{chunk-GCC3III2.js → chunk-DLEUEJL4.js} +1 -1
- package/dist/{chunk-AZKNSOKB.js → chunk-DU7FBCCC.js} +1 -1
- package/dist/{chunk-YMENSLWI.js → chunk-FAOVYBS3.js} +1 -1
- package/dist/{chunk-TARU4556.js → chunk-GC5NZJLI.js} +1 -1
- package/dist/{chunk-3COAWQ2J.js → chunk-GCHTEVCU.js} +1 -1
- package/dist/{chunk-7TL5FF4G.js → chunk-GLCAAUED.js} +1 -1
- package/dist/{chunk-3MQCI3HR.js → chunk-H2X2PD2T.js} +1 -1
- package/dist/{chunk-DOIDAWFX.js → chunk-HHJ3BRJG.js} +1 -1
- package/dist/{chunk-36F3K7HM.js → chunk-I77BQNOY.js} +2 -2
- package/dist/{chunk-734KE2N6.js → chunk-IEC4RN4Z.js} +1 -1
- package/dist/{chunk-ZPA2ZLQF.js → chunk-IHBOCKE2.js} +3 -3
- package/dist/{chunk-VJPVCXTO.js → chunk-JMFID37Y.js} +1 -1
- package/dist/{chunk-KGACFC47.js → chunk-L3UOVO3W.js} +7 -7
- package/dist/{chunk-GH2U4GVZ.js → chunk-L74VPF63.js} +3 -3
- package/dist/{chunk-Y7N7LQ4X.js → chunk-M7TQKNPG.js} +1 -1
- package/dist/{chunk-NH4S6JMP.js → chunk-NMMRT55A.js} +1 -1
- package/dist/{chunk-A4WGQPHE.js → chunk-SYRK5ZA2.js} +1 -1
- package/dist/{chunk-GCVGBOX5.js → chunk-U27ZD3KQ.js} +1 -1
- package/dist/{chunk-LCEKIRDI.js → chunk-V3KJ4PGA.js} +2 -2
- package/dist/{chunk-HG2J53VZ.js → chunk-WW5CNGJH.js} +2 -2
- package/dist/{chunk-K6FSJTVW.js → chunk-XAYI77WW.js} +1 -1
- package/dist/{chunk-BCBJMZGJ.js → chunk-XLIFF7Y5.js} +59 -37
- package/dist/{chunk-3OBPZZ6K.js → chunk-YIG46MC2.js} +1 -1
- package/dist/{chunk-J5FJLOMS.js → chunk-YMZH7BJH.js} +1 -1
- package/dist/{chunk-CGTWGF4R.js → chunk-ZWDNCH54.js} +2 -2
- package/dist/{cliHook-6AK4SZVH.js → cliHook-RW6JZJ5C.js} +6 -6
- package/dist/{cliHookCheck-BXTWEIKL.js → cliHookCheck-4A34MEJ4.js} +2 -2
- package/dist/{codexHook-CKPLYNYI.js → codexHook-73Y4ZXBT.js} +8 -8
- package/dist/commands/extension/extension/content.js +45 -45
- package/dist/commands/extension/extension/docs.js +23 -23
- package/dist/commands/sessions/web/bundle.js +457 -457
- package/dist/{commit-XOT7U5LZ.js → commit-DPOMBIMJ.js} +4 -4
- package/dist/{doctorNodes-GZARZJLX.js → doctorNodes-PPEQCCL2.js} +3 -3
- package/dist/{done-7XDZ5EOV.js → done-AVG3QRTA.js} +4 -4
- package/dist/{editHook-RG7F5O5G.js → editHook-TBRDX66J.js} +6 -6
- package/dist/{fixConflict-SHPVWNCI.js → fixConflict-OF3B5BRX.js} +4 -4
- package/dist/index.js +50 -50
- package/dist/{launchMode-E6C56QJ5.js → launchMode-YJHELXRI.js} +14 -14
- package/dist/{list-LWGNQ5OI.js → list-XL5WCHZX.js} +5 -5
- package/dist/{migrate-L6IK3N53.js → migrate-BW2IWRAX.js} +3 -3
- package/dist/{next-RU4CE65F.js → next-YU6KVEF3.js} +13 -13
- package/dist/{phaseDone-LXJHLT2U.js → phaseDone-C7YXMX7D.js} +5 -5
- package/dist/{piHook-3DLZZNQI.js → piHook-3Z3OODUR.js} +6 -6
- package/dist/{propose-S3E5BT6R.js → propose-MVYYF25R.js} +4 -4
- package/dist/{refine-PM727EVL.js → refine-YPDQ4DC3.js} +15 -15
- package/dist/{restartNode-YV73FMYW.js → restartNode-WKT2KC5A.js} +5 -5
- package/dist/{review-LCT3ZUNR.js → review-XGFIOVID.js} +4 -4
- package/dist/{reviewPrComments-BOOP6SKN.js → reviewPrComments-JZSAMIMP.js} +4 -4
- package/dist/{rewindPhase-LUTTHL7A.js → rewindPhase-YYIMI5WB.js} +8 -8
- package/dist/{run-T4LRCNGP.js → run-4WYZVV2Y.js} +11 -11
- package/dist/{run-XKK6RIXT.js → run-NSKPDL3S.js} +11 -11
- package/dist/{runDaemon-OM23ZXUY.js → runDaemon-ZLZOVNOU.js} +23 -18
- package/dist/{runParallelPhase-TF7ICWA2.js → runParallelPhase-7IFBSTQK.js} +7 -7
- package/dist/{runRefine-U5VSEHLT.js → runRefine-B2VACNXX.js} +15 -15
- package/dist/{scan-QGGG4PDJ.js → scan-IB5GKFGY.js} +2 -2
- package/dist/{schemaConfirm-JZDXHHJB.js → schemaConfirm-4XTLWBSV.js} +2 -2
- package/dist/{schemaLock-X5744CQX.js → schemaLock-OORVKODN.js} +2 -2
- package/dist/{schemaUnlock-POW6IROW.js → schemaUnlock-ZAQIPVQW.js} +2 -2
- package/dist/{search-XENUF5PM.js → search-GRKDZSOE.js} +5 -5
- package/dist/{show-75ROW5SY.js → show-ACBXOMQV.js} +3 -3
- package/dist/{show-TKEXHAGK.js → show-BVJVHU57.js} +3 -3
- package/dist/{signExtension-27KZO6ML.js → signExtension-JXLR7NMB.js} +1 -1
- package/dist/{updateNode-YTGHYMUF.js → updateNode-SJNS7AFN.js} +5 -5
- package/dist/{updatePlan-6CS7QADL.js → updatePlan-DTB6NORX.js} +4 -4
- package/dist/{web-4NPV4ZXK.js → web-IQW2FEVO.js} +16 -16
- package/dist/{web-677GLJFT.js → web-KES7GLB2.js} +16 -16
- package/package.json +1 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
next
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-V3KJ4PGA.js";
|
|
4
4
|
import {
|
|
5
5
|
pullIfConfigured
|
|
6
6
|
} from "./chunk-7VTFCHIT.js";
|
|
7
7
|
import {
|
|
8
8
|
run
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-5WZOGIUM.js";
|
|
10
10
|
import {
|
|
11
11
|
launchBlocker
|
|
12
12
|
} from "./chunk-LQMU4BUO.js";
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
readSignal,
|
|
16
16
|
stopWatching,
|
|
17
17
|
watchForMarker
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-L74VPF63.js";
|
|
19
19
|
import {
|
|
20
20
|
resumeNudge
|
|
21
21
|
} from "./chunk-7NZOH4LN.js";
|
|
@@ -31,7 +31,7 @@ import {
|
|
|
31
31
|
} from "./chunk-3DNFNT2L.js";
|
|
32
32
|
import {
|
|
33
33
|
isBlocked
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-DLEUEJL4.js";
|
|
35
35
|
import {
|
|
36
36
|
loadItemSummaries
|
|
37
37
|
} from "./chunk-ZWIWBQO2.js";
|
|
@@ -49,7 +49,7 @@ import {
|
|
|
49
49
|
} from "./chunk-N65VOEFI.js";
|
|
50
50
|
import {
|
|
51
51
|
harnessAdapter
|
|
52
|
-
} from "./chunk-
|
|
52
|
+
} from "./chunk-XLIFF7Y5.js";
|
|
53
53
|
|
|
54
54
|
// src/commands/backlog/launchMode.ts
|
|
55
55
|
import chalk3 from "chalk";
|
|
@@ -15,16 +15,16 @@ import {
|
|
|
15
15
|
import {
|
|
16
16
|
createBranch,
|
|
17
17
|
generateBranchSlug
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-IEC4RN4Z.js";
|
|
19
19
|
import {
|
|
20
20
|
inWebSession
|
|
21
21
|
} from "./chunk-HKGCLAZ7.js";
|
|
22
22
|
import {
|
|
23
23
|
executePhase
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-L74VPF63.js";
|
|
25
25
|
import {
|
|
26
26
|
backlogPhaseActivity
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-6ECUZF6F.js";
|
|
28
28
|
import {
|
|
29
29
|
awaitHarness
|
|
30
30
|
} from "./chunk-ZYK7V4PG.js";
|
|
@@ -59,10 +59,10 @@ import {
|
|
|
59
59
|
import {
|
|
60
60
|
buildReviewPhase,
|
|
61
61
|
resolveReviewPhase
|
|
62
|
-
} from "./chunk-
|
|
62
|
+
} from "./chunk-FAOVYBS3.js";
|
|
63
63
|
import {
|
|
64
64
|
resolvePlan
|
|
65
|
-
} from "./chunk-
|
|
65
|
+
} from "./chunk-BIHTVQ5N.js";
|
|
66
66
|
import {
|
|
67
67
|
findOneItem,
|
|
68
68
|
getOrigin,
|
|
@@ -86,7 +86,7 @@ import {
|
|
|
86
86
|
import {
|
|
87
87
|
harnessAdapter,
|
|
88
88
|
withoutResumeSession
|
|
89
|
-
} from "./chunk-
|
|
89
|
+
} from "./chunk-XLIFF7Y5.js";
|
|
90
90
|
import {
|
|
91
91
|
buildFeature
|
|
92
92
|
} from "./chunk-LKZ7J5AK.js";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
lookupConversation
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-NMMRT55A.js";
|
|
4
4
|
import {
|
|
5
5
|
harnessAdapter,
|
|
6
6
|
readTranscriptTail
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-XLIFF7Y5.js";
|
|
8
8
|
|
|
9
9
|
// src/commands/sessions/shared/targetConversationEvents.ts
|
|
10
10
|
async function targetConversationEvents(cwd, target) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
checkoutPr
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-HHJ3BRJG.js";
|
|
4
4
|
import {
|
|
5
5
|
launchBlocker
|
|
6
6
|
} from "./chunk-LQMU4BUO.js";
|
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
} from "./chunk-3DNFNT2L.js";
|
|
20
20
|
import {
|
|
21
21
|
harnessAdapter
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-XLIFF7Y5.js";
|
|
23
23
|
|
|
24
24
|
// src/commands/launchPrSkill.ts
|
|
25
25
|
import chalk from "chalk";
|
|
@@ -6,10 +6,10 @@ import {
|
|
|
6
6
|
} from "./chunk-DM2P6BNS.js";
|
|
7
7
|
import {
|
|
8
8
|
resolveRewindPlan
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-WW5CNGJH.js";
|
|
10
10
|
import {
|
|
11
11
|
resolvePlan
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-BIHTVQ5N.js";
|
|
13
13
|
import {
|
|
14
14
|
resetPhaseAndDependents,
|
|
15
15
|
updateStatus
|
|
@@ -8,10 +8,10 @@ import {
|
|
|
8
8
|
isDocsPath,
|
|
9
9
|
isSchemaPath,
|
|
10
10
|
mentionsDocsPath
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-DU7FBCCC.js";
|
|
12
12
|
import {
|
|
13
13
|
isSchemaLocked
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-2IPZDH4Q.js";
|
|
15
15
|
import {
|
|
16
16
|
findBuiltinDenyRaw,
|
|
17
17
|
findDeny,
|
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
isApprovedRead,
|
|
22
22
|
resolvePermission,
|
|
23
23
|
splitCompound
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-3N6Z2ZRY.js";
|
|
25
25
|
import {
|
|
26
26
|
inWebSession
|
|
27
27
|
} from "./chunk-HKGCLAZ7.js";
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
} from "./chunk-JM57BCD6.js";
|
|
11
11
|
import {
|
|
12
12
|
firstBrokenHop
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-JMFID37Y.js";
|
|
14
14
|
import {
|
|
15
15
|
describePeerError,
|
|
16
16
|
fetchPeerJson
|
|
@@ -39,7 +39,7 @@ import {
|
|
|
39
39
|
resolveLinkTarget,
|
|
40
40
|
usageWindowKey,
|
|
41
41
|
watcherLogPath
|
|
42
|
-
} from "./chunk-
|
|
42
|
+
} from "./chunk-CA65WBYZ.js";
|
|
43
43
|
import {
|
|
44
44
|
TRACE_HEADER,
|
|
45
45
|
newTraceId
|
|
@@ -47,7 +47,7 @@ import {
|
|
|
47
47
|
import {
|
|
48
48
|
ASSIST_VERSION,
|
|
49
49
|
PROTOCOL_VERSION
|
|
50
|
-
} from "./chunk-
|
|
50
|
+
} from "./chunk-M7TQKNPG.js";
|
|
51
51
|
import {
|
|
52
52
|
findLinkSpec
|
|
53
53
|
} from "./chunk-HPBO553P.js";
|
|
@@ -84,7 +84,7 @@ import {
|
|
|
84
84
|
} from "./chunk-UJBW7FVI.js";
|
|
85
85
|
import {
|
|
86
86
|
targetConversationEvents
|
|
87
|
-
} from "./chunk-
|
|
87
|
+
} from "./chunk-BXMHCKEA.js";
|
|
88
88
|
import {
|
|
89
89
|
configEntryLayers,
|
|
90
90
|
ghFailure,
|
|
@@ -251,7 +251,7 @@ import {
|
|
|
251
251
|
} from "./chunk-AJOU43WT.js";
|
|
252
252
|
import {
|
|
253
253
|
rewindItemToPhase
|
|
254
|
-
} from "./chunk-
|
|
254
|
+
} from "./chunk-I77BQNOY.js";
|
|
255
255
|
import {
|
|
256
256
|
loadItemSummaries,
|
|
257
257
|
phaseUsageTotals,
|
|
@@ -280,7 +280,7 @@ import {
|
|
|
280
280
|
} from "./chunk-W2UW25ZA.js";
|
|
281
281
|
import {
|
|
282
282
|
resolveRewindPlan
|
|
283
|
-
} from "./chunk-
|
|
283
|
+
} from "./chunk-WW5CNGJH.js";
|
|
284
284
|
import {
|
|
285
285
|
deleteItem,
|
|
286
286
|
getOrigin,
|
|
@@ -329,7 +329,7 @@ import {
|
|
|
329
329
|
discoverSessionJsonlPaths,
|
|
330
330
|
harnessAdapter,
|
|
331
331
|
parseSessionFile
|
|
332
|
-
} from "./chunk-
|
|
332
|
+
} from "./chunk-XLIFF7Y5.js";
|
|
333
333
|
import {
|
|
334
334
|
harnessLabel
|
|
335
335
|
} from "./chunk-XZSATLYY.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
backlogPhaseActivity,
|
|
3
3
|
recordPhaseSession
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-6ECUZF6F.js";
|
|
5
5
|
import {
|
|
6
6
|
resumeNudge
|
|
7
7
|
} from "./chunk-7NZOH4LN.js";
|
|
@@ -26,7 +26,7 @@ import {
|
|
|
26
26
|
} from "./chunk-DM2P6BNS.js";
|
|
27
27
|
import {
|
|
28
28
|
buildPhasePrompt
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-3PJJWRGZ.js";
|
|
30
30
|
import {
|
|
31
31
|
getReady
|
|
32
32
|
} from "./chunk-JAQ236DW.js";
|
|
@@ -38,7 +38,7 @@ import {
|
|
|
38
38
|
} from "./chunk-A45XXOEA.js";
|
|
39
39
|
import {
|
|
40
40
|
harnessAdapter
|
|
41
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-XLIFF7Y5.js";
|
|
42
42
|
import {
|
|
43
43
|
getSignalPath
|
|
44
44
|
} from "./chunk-P23ZWXGY.js";
|
|
@@ -3,14 +3,14 @@ import {
|
|
|
3
3
|
} from "./chunk-7VTFCHIT.js";
|
|
4
4
|
import {
|
|
5
5
|
run
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-5WZOGIUM.js";
|
|
7
7
|
import {
|
|
8
8
|
isLockedByOther
|
|
9
9
|
} from "./chunk-BXGPF3TG.js";
|
|
10
10
|
import {
|
|
11
11
|
isBlocked,
|
|
12
12
|
typeLabel
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-DLEUEJL4.js";
|
|
14
14
|
import {
|
|
15
15
|
loadBacklog
|
|
16
16
|
} from "./chunk-JAQ236DW.js";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
resolveReviewPhase
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-FAOVYBS3.js";
|
|
4
4
|
import {
|
|
5
5
|
resolvePlan
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-BIHTVQ5N.js";
|
|
7
7
|
|
|
8
8
|
// src/commands/backlog/resolveRewindPlan.ts
|
|
9
9
|
function resolveRewindPlan(item) {
|
|
@@ -381,6 +381,18 @@ function deriveSessionType(commandName, name) {
|
|
|
381
381
|
return void 0;
|
|
382
382
|
}
|
|
383
383
|
|
|
384
|
+
// src/commands/sessions/shared/deriveProject.ts
|
|
385
|
+
import * as path4 from "path";
|
|
386
|
+
function deriveProject(cwd, filePath, origin) {
|
|
387
|
+
if (!cwd) return dirNameToProject(filePath);
|
|
388
|
+
return origin === "windows" ? path4.win32.basename(cwd) : path4.basename(cwd);
|
|
389
|
+
}
|
|
390
|
+
function dirNameToProject(filePath) {
|
|
391
|
+
const dirName = path4.basename(path4.dirname(filePath));
|
|
392
|
+
const parts = dirName.split("--");
|
|
393
|
+
return parts[parts.length - 1].replace(/-/g, "/");
|
|
394
|
+
}
|
|
395
|
+
|
|
384
396
|
// src/commands/sessions/shared/backlogRunMarkers.ts
|
|
385
397
|
function backlogRunMarkers(text) {
|
|
386
398
|
const match = text.match(/backlog item a(\d+):[ \t]*([^\n]*)/);
|
|
@@ -392,8 +404,31 @@ function backlogRunMarkers(text) {
|
|
|
392
404
|
};
|
|
393
405
|
}
|
|
394
406
|
|
|
407
|
+
// src/commands/sessions/shared/parseFirstUserEntry.ts
|
|
408
|
+
function parseFirstUserEntry(entry) {
|
|
409
|
+
const raw = messageText(entry);
|
|
410
|
+
const commandName = matchMarker(raw, "command-name").replace(/^\//, "");
|
|
411
|
+
const commandArgs = matchMarker(raw, "command-args");
|
|
412
|
+
const name = stripMarkers(raw);
|
|
413
|
+
if (commandName) return { name, commandName, commandArgs };
|
|
414
|
+
return { name, ...backlogRunMarkers(raw) };
|
|
415
|
+
}
|
|
416
|
+
function messageText(entry) {
|
|
417
|
+
const msg = entry.message;
|
|
418
|
+
const content = msg?.content;
|
|
419
|
+
return typeof content === "string" ? content : Array.isArray(content) ? content.find((c) => c.type === "text")?.text ?? "" : "";
|
|
420
|
+
}
|
|
421
|
+
function matchMarker(text, tag) {
|
|
422
|
+
const match = text.match(new RegExp(`<${tag}>([\\s\\S]*?)</${tag}>`));
|
|
423
|
+
return match ? match[1].trim() : "";
|
|
424
|
+
}
|
|
425
|
+
function stripMarkers(text) {
|
|
426
|
+
return text.replace(/<command-[^>]*>[^<]*<\/command-[^>]*>/g, "").trim().slice(0, 80);
|
|
427
|
+
}
|
|
428
|
+
|
|
395
429
|
// src/commands/sessions/shared/extractSessionMeta.ts
|
|
396
430
|
function extractSessionMeta(lines) {
|
|
431
|
+
let reachedFirstPrompt = false;
|
|
397
432
|
let sessionId = "";
|
|
398
433
|
let cwd = "";
|
|
399
434
|
let timestamp = "";
|
|
@@ -408,18 +443,19 @@ function extractSessionMeta(lines) {
|
|
|
408
443
|
cwd ||= strField(entry, "cwd");
|
|
409
444
|
if (entry.type === "user" && !entry.isMeta) {
|
|
410
445
|
({ name, commandName, commandArgs } = parseFirstUserEntry(entry));
|
|
446
|
+
reachedFirstPrompt = true;
|
|
411
447
|
break;
|
|
412
448
|
}
|
|
413
449
|
}
|
|
414
|
-
return {
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
450
|
+
return {
|
|
451
|
+
sessionId,
|
|
452
|
+
cwd,
|
|
453
|
+
timestamp,
|
|
454
|
+
name,
|
|
455
|
+
commandName,
|
|
456
|
+
commandArgs,
|
|
457
|
+
reachedFirstPrompt
|
|
458
|
+
};
|
|
423
459
|
}
|
|
424
460
|
function strField(entry, key) {
|
|
425
461
|
const value = entry[key];
|
|
@@ -432,29 +468,20 @@ function safeParse(line) {
|
|
|
432
468
|
return null;
|
|
433
469
|
}
|
|
434
470
|
}
|
|
435
|
-
function messageText(entry) {
|
|
436
|
-
const msg = entry.message;
|
|
437
|
-
const content = msg?.content;
|
|
438
|
-
return typeof content === "string" ? content : Array.isArray(content) ? content.find((c) => c.type === "text")?.text ?? "" : "";
|
|
439
|
-
}
|
|
440
|
-
function stripMarkers(text) {
|
|
441
|
-
return text.replace(/<command-[^>]*>[^<]*<\/command-[^>]*>/g, "").trim().slice(0, 80);
|
|
442
|
-
}
|
|
443
|
-
function matchMarker(text, tag) {
|
|
444
|
-
const match = text.match(new RegExp(`<${tag}>([\\s\\S]*?)</${tag}>`));
|
|
445
|
-
return match ? match[1].trim() : "";
|
|
446
|
-
}
|
|
447
471
|
|
|
448
|
-
// src/commands/sessions/shared/
|
|
449
|
-
|
|
450
|
-
function
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
472
|
+
// src/commands/sessions/shared/readSessionMeta.ts
|
|
473
|
+
var GROWING_HEAD_SIZES = [16384, 262144, 2097152];
|
|
474
|
+
async function readSessionMeta(handle) {
|
|
475
|
+
let meta = extractSessionMeta([]);
|
|
476
|
+
for (const size of GROWING_HEAD_SIZES) {
|
|
477
|
+
const buf = Buffer.alloc(size);
|
|
478
|
+
const { bytesRead } = await handle.read(buf, 0, size, 0);
|
|
479
|
+
meta = extractSessionMeta(
|
|
480
|
+
buf.toString("utf8", 0, bytesRead).split("\n").filter(Boolean)
|
|
481
|
+
);
|
|
482
|
+
if (bytesRead < size || meta.reachedFirstPrompt) break;
|
|
483
|
+
}
|
|
484
|
+
return meta;
|
|
458
485
|
}
|
|
459
486
|
|
|
460
487
|
// src/commands/sessions/shared/parseSessionFile.ts
|
|
@@ -462,7 +489,7 @@ async function parseSessionFile(filePath, origin = "wsl") {
|
|
|
462
489
|
let handle;
|
|
463
490
|
try {
|
|
464
491
|
handle = await fs2.promises.open(filePath, "r");
|
|
465
|
-
const meta =
|
|
492
|
+
const meta = await readSessionMeta(handle);
|
|
466
493
|
if (!meta.sessionId) return null;
|
|
467
494
|
const lastActivity = (await fs2.promises.stat(filePath)).mtime.toISOString();
|
|
468
495
|
return {
|
|
@@ -481,11 +508,6 @@ async function parseSessionFile(filePath, origin = "wsl") {
|
|
|
481
508
|
await handle?.close();
|
|
482
509
|
}
|
|
483
510
|
}
|
|
484
|
-
async function readHeadLines(handle) {
|
|
485
|
-
const buf = Buffer.alloc(16384);
|
|
486
|
-
const { bytesRead } = await handle.read(buf, 0, buf.length, 0);
|
|
487
|
-
return buf.toString("utf8", 0, bytesRead).split("\n").filter(Boolean);
|
|
488
|
-
}
|
|
489
511
|
|
|
490
512
|
// src/commands/sessions/shared/discoverSessionJsonlPaths.ts
|
|
491
513
|
import * as fs3 from "fs";
|