@arcreflex/agent-transcripts 0.1.17 → 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
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/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
|
|