@arcreflex/agent-transcripts 0.1.16 → 0.1.18
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/package.json +1 -1
- package/src/adapters/index.ts +5 -2
- package/src/adapters/pi-coding-agent.ts +5 -2
- package/src/render-html.ts +12 -10
- package/test/adapters.test.ts +4 -5
package/package.json
CHANGED
package/src/adapters/index.ts
CHANGED
|
@@ -17,8 +17,11 @@ const adapters: Record<string, Adapter> = {
|
|
|
17
17
|
const detectionRules: Array<{ pattern: RegExp; adapter: string }> = [
|
|
18
18
|
// Match .claude/ or /claude/ in path
|
|
19
19
|
{ pattern: /[./]claude[/\\]/, adapter: "claude-code" },
|
|
20
|
-
// Match .pi/agent/sessions/ in path
|
|
21
|
-
{
|
|
20
|
+
// Match .pi/sessions/ or pi-coding-agent/sessions/ in path
|
|
21
|
+
{
|
|
22
|
+
pattern: /[./]pi(?:-coding-agent)?[/\\]sessions[/\\]/,
|
|
23
|
+
adapter: "pi-coding-agent",
|
|
24
|
+
},
|
|
22
25
|
];
|
|
23
26
|
|
|
24
27
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* pi-coding-agent JSONL adapter.
|
|
3
3
|
*
|
|
4
|
-
* Parses session files from ~/.pi/
|
|
4
|
+
* Parses session files from ~/.pi/sessions/{encoded-cwd}/{timestamp}_{uuid}.jsonl
|
|
5
5
|
*
|
|
6
6
|
* Session format: tree-structured JSONL with id/parentId linking (version 3).
|
|
7
7
|
* See: https://github.com/badlogic/pi-mono — pi-coding-agent session docs.
|
|
@@ -536,7 +536,10 @@ function transformConversation(
|
|
|
536
536
|
export const piCodingAgentAdapter: Adapter = {
|
|
537
537
|
name: "pi-coding-agent",
|
|
538
538
|
version: "pi-coding-agent:1",
|
|
539
|
-
defaultSource: join(
|
|
539
|
+
defaultSource: join(
|
|
540
|
+
process.env.PI_CODING_AGENT_DIR ?? join(homedir(), ".pi"),
|
|
541
|
+
"sessions",
|
|
542
|
+
),
|
|
540
543
|
|
|
541
544
|
async discover(source: string): Promise<DiscoveredSession[]> {
|
|
542
545
|
const sessions: DiscoveredSession[] = [];
|
package/src/render-html.ts
CHANGED
|
@@ -304,23 +304,25 @@ main {
|
|
|
304
304
|
color: var(--fg);
|
|
305
305
|
}
|
|
306
306
|
|
|
307
|
-
/* Shiki
|
|
308
|
-
.
|
|
309
|
-
|
|
307
|
+
/* Markdown-highlighted content (Shiki renders as <pre>, but this is prose) */
|
|
308
|
+
.markdown-body pre {
|
|
309
|
+
white-space: pre-wrap;
|
|
310
|
+
overflow-wrap: break-word;
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
.markdown-body .shiki {
|
|
310
314
|
background: transparent !important;
|
|
311
315
|
border: none;
|
|
312
316
|
padding: 0;
|
|
313
317
|
margin: 0;
|
|
314
318
|
}
|
|
315
319
|
|
|
316
|
-
.
|
|
317
|
-
.thinking .shiki span {
|
|
320
|
+
.markdown-body .shiki span {
|
|
318
321
|
color: var(--shiki-light);
|
|
319
322
|
}
|
|
320
323
|
|
|
321
324
|
@media (prefers-color-scheme: dark) {
|
|
322
|
-
.
|
|
323
|
-
.thinking .shiki span {
|
|
325
|
+
.markdown-body .shiki span {
|
|
324
326
|
color: var(--shiki-dark);
|
|
325
327
|
}
|
|
326
328
|
}
|
|
@@ -755,7 +757,7 @@ async function renderMessage(
|
|
|
755
757
|
</div>
|
|
756
758
|
${msg.rawJson ? renderRawToggle() : ""}
|
|
757
759
|
<div class="rendered-view">
|
|
758
|
-
<div class="content">${await contentToHtml(msg.content)}</div>
|
|
760
|
+
<div class="content markdown-body">${await contentToHtml(msg.content)}</div>
|
|
759
761
|
</div>
|
|
760
762
|
${msg.rawJson ? `<div class="raw-view">${rawJson}</div>` : ""}
|
|
761
763
|
</div>`;
|
|
@@ -767,13 +769,13 @@ async function renderMessage(
|
|
|
767
769
|
rendered += `
|
|
768
770
|
<details>
|
|
769
771
|
<summary>thinking...</summary>
|
|
770
|
-
<div class="thinking">${await contentToHtml(msg.thinking)}</div>
|
|
772
|
+
<div class="thinking markdown-body">${await contentToHtml(msg.thinking)}</div>
|
|
771
773
|
</details>`;
|
|
772
774
|
}
|
|
773
775
|
|
|
774
776
|
if (msg.content.trim()) {
|
|
775
777
|
rendered += `
|
|
776
|
-
<div class="content">${await contentToHtml(msg.content)}</div>`;
|
|
778
|
+
<div class="content markdown-body">${await contentToHtml(msg.content)}</div>`;
|
|
777
779
|
}
|
|
778
780
|
|
|
779
781
|
const header = ctx.showAssistantHeader
|
package/test/adapters.test.ts
CHANGED
|
@@ -24,7 +24,8 @@ describe("getDefaultSources", () => {
|
|
|
24
24
|
const pi = specs.find((s) => s.adapter.name === "pi-coding-agent");
|
|
25
25
|
expect(pi).toBeDefined();
|
|
26
26
|
expect(pi?.adapter).toBe(piCodingAgentAdapter);
|
|
27
|
-
expect(pi?.source).toMatch(
|
|
27
|
+
expect(pi?.source).toMatch(/sessions$/);
|
|
28
|
+
expect(pi?.source).toBe(piCodingAgentAdapter.defaultSource);
|
|
28
29
|
});
|
|
29
30
|
|
|
30
31
|
it("only includes adapters with defaultSource set", () => {
|
|
@@ -52,11 +53,9 @@ describe("detectAdapter", () => {
|
|
|
52
53
|
);
|
|
53
54
|
});
|
|
54
55
|
|
|
55
|
-
it("detects pi-coding-agent from .pi/
|
|
56
|
+
it("detects pi-coding-agent from .pi/sessions/ paths", () => {
|
|
56
57
|
expect(
|
|
57
|
-
detectAdapter(
|
|
58
|
-
"/home/user/.pi/agent/sessions/--project--/12345_abc.jsonl",
|
|
59
|
-
),
|
|
58
|
+
detectAdapter("/home/user/.pi/sessions/--project--/12345_abc.jsonl"),
|
|
60
59
|
).toBe("pi-coding-agent");
|
|
61
60
|
});
|
|
62
61
|
|