@honcho-ai/claude-honcho 0.3.1 → 0.3.3
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/.claude-plugin/plugin.json +1 -1
- package/README.md +95 -12
- package/dist/hooks/post-tool-use.js +16714 -29
- package/dist/hooks/post-tool-use.js.map +91 -5
- package/dist/hooks/pre-compact.js +16909 -39
- package/dist/hooks/pre-compact.js.map +92 -6
- package/dist/hooks/pre-tool-honcho.js +829 -10
- package/dist/hooks/pre-tool-honcho.js.map +10 -5
- package/dist/hooks/save-user-message.js +16552 -32
- package/dist/hooks/save-user-message.js.map +90 -5
- package/dist/hooks/session-end.js +1003 -20
- package/dist/hooks/session-end.js.map +12 -5
- package/dist/hooks/session-start.js +16961 -51
- package/dist/hooks/session-start.js.map +93 -5
- package/dist/hooks/stop.js +16681 -33
- package/dist/hooks/stop.js.map +90 -5
- package/dist/hooks/user-prompt.js +17004 -14
- package/dist/hooks/user-prompt.js.map +93 -4
- package/dist/mcp-server.js +17097 -907
- package/dist/mcp-server.js.map +88 -4
- package/dist/skills/backfill-runner.js +16309 -69
- package/dist/skills/backfill-runner.js.map +89 -4
- package/dist/skills/setup-runner.js +16185 -60
- package/dist/skills/setup-runner.js.map +88 -5
- package/dist/skills/status-runner.js +16184 -21
- package/dist/skills/status-runner.js.map +88 -4
- package/package.json +1 -1
- package/dist/chunk-084dpgp3.js +0 -556
- package/dist/chunk-084dpgp3.js.map +0 -10
- package/dist/chunk-49wja30f.js +0 -20
- package/dist/chunk-49wja30f.js.map +0 -10
- package/dist/chunk-4ryv9310.js +0 -15534
- package/dist/chunk-4ryv9310.js.map +0 -87
- package/dist/chunk-4zgbdwm4.js +0 -261
- package/dist/chunk-4zgbdwm4.js.map +0 -10
- package/dist/chunk-6yybt92z.js +0 -106
- package/dist/chunk-6yybt92z.js.map +0 -9
- package/dist/chunk-9pntsn3x.js +0 -35
- package/dist/chunk-9pntsn3x.js.map +0 -10
- package/dist/chunk-d2gc13m0.js +0 -161
- package/dist/chunk-d2gc13m0.js.map +0 -11
- package/dist/chunk-dxbm7kmf.js +0 -331
- package/dist/chunk-dxbm7kmf.js.map +0 -10
- package/dist/chunk-gnp95nzg.js +0 -438
- package/dist/chunk-gnp95nzg.js.map +0 -12
- package/dist/chunk-jgtvcc65.js +0 -90
- package/dist/chunk-jgtvcc65.js.map +0 -10
- package/dist/chunk-jr0fd6n2.js +0 -181
- package/dist/chunk-jr0fd6n2.js.map +0 -11
- package/dist/chunk-wm6hvkcv.js +0 -245
- package/dist/chunk-wm6hvkcv.js.map +0 -10
- package/dist/chunk-xdntcesh.js +0 -15450
- package/dist/chunk-xdntcesh.js.map +0 -86
- package/dist/chunk-xtdvbfxw.js +0 -146
- package/dist/chunk-xtdvbfxw.js.map +0 -10
- package/dist/chunk-yfrrc1d5.js +0 -838
- package/dist/chunk-yfrrc1d5.js.map +0 -12
package/dist/chunk-jgtvcc65.js
DELETED
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
// src/skills/transcript-parse.ts
|
|
2
|
-
import { existsSync, readFileSync } from "fs";
|
|
3
|
-
function entryType(entry) {
|
|
4
|
-
return entry.type || entry.role;
|
|
5
|
-
}
|
|
6
|
-
function isRealUserPrompt(entry) {
|
|
7
|
-
if (entry.isMeta)
|
|
8
|
-
return false;
|
|
9
|
-
const mc = entry.message?.content ?? entry.content;
|
|
10
|
-
const text = typeof mc === "string" ? mc : Array.isArray(mc) ? mc.filter((b) => b.type === "text" && b.text).map((b) => b.text).join("") : "";
|
|
11
|
-
const trimmed = text.trim();
|
|
12
|
-
return trimmed.length > 0 && !trimmed.startsWith("<");
|
|
13
|
-
}
|
|
14
|
-
function userText(entry) {
|
|
15
|
-
const mc = entry.message?.content ?? entry.content;
|
|
16
|
-
if (typeof mc === "string")
|
|
17
|
-
return mc;
|
|
18
|
-
if (Array.isArray(mc))
|
|
19
|
-
return mc.filter((p) => p.type === "text").map((p) => p.text || "").join(`
|
|
20
|
-
`);
|
|
21
|
-
return "";
|
|
22
|
-
}
|
|
23
|
-
function assistantText(entry) {
|
|
24
|
-
const mc = entry.message?.content ?? entry.content;
|
|
25
|
-
if (typeof mc === "string")
|
|
26
|
-
return mc;
|
|
27
|
-
if (Array.isArray(mc))
|
|
28
|
-
return mc.filter((p) => p.type === "text" && p.text).map((p) => p.text).join(`
|
|
29
|
-
|
|
30
|
-
`);
|
|
31
|
-
return "";
|
|
32
|
-
}
|
|
33
|
-
function readLines(transcriptPath) {
|
|
34
|
-
if (!transcriptPath || !existsSync(transcriptPath))
|
|
35
|
-
return [];
|
|
36
|
-
try {
|
|
37
|
-
return readFileSync(transcriptPath, "utf-8").split(`
|
|
38
|
-
`).filter((line) => line.trim());
|
|
39
|
-
} catch {
|
|
40
|
-
return [];
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
function parseTranscriptForBackfill(transcriptPath) {
|
|
44
|
-
const messages = [];
|
|
45
|
-
let cwd;
|
|
46
|
-
let gitBranch;
|
|
47
|
-
let sessionId;
|
|
48
|
-
for (const line of readLines(transcriptPath)) {
|
|
49
|
-
let entry;
|
|
50
|
-
try {
|
|
51
|
-
entry = JSON.parse(line);
|
|
52
|
-
} catch {
|
|
53
|
-
continue;
|
|
54
|
-
}
|
|
55
|
-
if (entry.cwd)
|
|
56
|
-
cwd = entry.cwd;
|
|
57
|
-
if (entry.gitBranch)
|
|
58
|
-
gitBranch = entry.gitBranch;
|
|
59
|
-
if (entry.sessionId)
|
|
60
|
-
sessionId = entry.sessionId;
|
|
61
|
-
if (entry.isMeta || entry.isSidechain)
|
|
62
|
-
continue;
|
|
63
|
-
const type = entryType(entry);
|
|
64
|
-
if (type === "user") {
|
|
65
|
-
if (!isRealUserPrompt(entry))
|
|
66
|
-
continue;
|
|
67
|
-
const content = userText(entry).trim();
|
|
68
|
-
if (content) {
|
|
69
|
-
messages.push({ role: "user", content, timestamp: entry.timestamp, cwd: entry.cwd, gitBranch: entry.gitBranch });
|
|
70
|
-
}
|
|
71
|
-
} else if (type === "assistant") {
|
|
72
|
-
const content = assistantText(entry).trim();
|
|
73
|
-
if (content) {
|
|
74
|
-
messages.push({ role: "assistant", content, timestamp: entry.timestamp, cwd: entry.cwd, gitBranch: entry.gitBranch });
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
for (let i = 0;i < messages.length; i++) {
|
|
79
|
-
if (messages[i].role !== "assistant")
|
|
80
|
-
continue;
|
|
81
|
-
const next = messages[i + 1];
|
|
82
|
-
messages[i].isResponse = !next || next.role === "user";
|
|
83
|
-
}
|
|
84
|
-
return { messages, cwd, gitBranch, sessionId };
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
export { parseTranscriptForBackfill };
|
|
88
|
-
|
|
89
|
-
//# debugId=4AE5CBBB15B1907564756E2164756E21
|
|
90
|
-
//# sourceMappingURL=chunk-jgtvcc65.js.map
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/skills/transcript-parse.ts"],
|
|
4
|
-
"sourcesContent": [
|
|
5
|
-
"/**\n * Parse Claude Code session transcripts (`~/.claude/projects/<dir>/<uuid>.jsonl`)\n * for the /honcho:import backfill.\n */\nimport { existsSync, readFileSync } from \"fs\";\n\nexport interface TranscriptEntry {\n type?: string;\n role?: string;\n timestamp?: string;\n isMeta?: boolean;\n isSidechain?: boolean;\n cwd?: string;\n gitBranch?: string;\n sessionId?: string;\n message?: {\n role?: string;\n content: string | Array<{ type: string; text?: string; name?: string; input?: unknown }>;\n };\n content?: string | Array<{ type: string; text?: string }>;\n}\n\n/** Ordered, cleaned message ready to upload. */\nexport interface ParsedMessage {\n role: \"user\" | \"assistant\";\n content: string;\n timestamp?: string;\n /** Assistant only: last block of its turn (assistant_response vs assistant_intermediate). */\n isResponse?: boolean;\n /** Entry's env, used for session mapping. */\n cwd?: string;\n gitBranch?: string;\n}\n\nfunction entryType(entry: TranscriptEntry): string | undefined {\n return entry.type || entry.role;\n}\n\n/** True for a real user-typed prompt. Excludes tool_results, isMeta entries, and `<...>` command caveats. */\nfunction isRealUserPrompt(entry: TranscriptEntry): boolean {\n if (entry.isMeta) return false;\n const mc = entry.message?.content ?? entry.content;\n const text =\n typeof mc === \"string\"\n ? mc\n : Array.isArray(mc)\n ? mc.filter((b) => b.type === \"text\" && b.text).map((b) => b.text!).join(\"\")\n : \"\";\n const trimmed = text.trim();\n return trimmed.length > 0 && !trimmed.startsWith(\"<\");\n}\n\nfunction userText(entry: TranscriptEntry): string {\n const mc = entry.message?.content ?? entry.content;\n if (typeof mc === \"string\") return mc;\n if (Array.isArray(mc)) return mc.filter((p) => p.type === \"text\").map((p) => p.text || \"\").join(\"\\n\");\n return \"\";\n}\n\nfunction assistantText(entry: TranscriptEntry): string {\n const mc = entry.message?.content ?? entry.content;\n if (typeof mc === \"string\") return mc;\n if (Array.isArray(mc)) return mc.filter((p) => p.type === \"text\" && p.text).map((p) => p.text!).join(\"\\n\\n\");\n return \"\";\n}\n\nfunction readLines(transcriptPath: string): string[] {\n if (!transcriptPath || !existsSync(transcriptPath)) return [];\n try {\n return readFileSync(transcriptPath, \"utf-8\").split(\"\\n\").filter((line) => line.trim());\n } catch {\n return [];\n }\n}\n\n/**\n * Full-conversation parse: user + assistant messages in order, each with its\n * timestamp and the cwd/gitBranch for session mapping. Skips isMeta / isSidechain\n * / tool-result-only / `<...>` command caveats.\n */\nexport function parseTranscriptForBackfill(transcriptPath: string): {\n messages: ParsedMessage[];\n cwd?: string;\n gitBranch?: string;\n sessionId?: string;\n} {\n const messages: ParsedMessage[] = [];\n let cwd: string | undefined;\n let gitBranch: string | undefined;\n let sessionId: string | undefined;\n\n for (const line of readLines(transcriptPath)) {\n let entry: TranscriptEntry;\n try {\n entry = JSON.parse(line);\n } catch {\n continue;\n }\n // Track the latest environment seen — used to name the session.\n if (entry.cwd) cwd = entry.cwd;\n if (entry.gitBranch) gitBranch = entry.gitBranch;\n if (entry.sessionId) sessionId = entry.sessionId;\n\n if (entry.isMeta || entry.isSidechain) continue;\n const type = entryType(entry);\n\n if (type === \"user\") {\n if (!isRealUserPrompt(entry)) continue;\n const content = userText(entry).trim();\n if (content) {\n messages.push({ role: \"user\", content, timestamp: entry.timestamp, cwd: entry.cwd, gitBranch: entry.gitBranch });\n }\n } else if (type === \"assistant\") {\n const content = assistantText(entry).trim();\n if (content) {\n messages.push({ role: \"assistant\", content, timestamp: entry.timestamp, cwd: entry.cwd, gitBranch: entry.gitBranch });\n }\n }\n }\n\n // Last assistant block of a turn = response, earlier ones = intermediate.\n for (let i = 0; i < messages.length; i++) {\n if (messages[i].role !== \"assistant\") continue;\n const next = messages[i + 1];\n messages[i].isResponse = !next || next.role === \"user\";\n }\n\n return { messages, cwd, gitBranch, sessionId };\n}\n"
|
|
6
|
-
],
|
|
7
|
-
"mappings": ";AAIA;AA8BA,SAAS,SAAS,CAAC,OAA4C;AAAA,EAC7D,OAAO,MAAM,QAAQ,MAAM;AAAA;AAI7B,SAAS,gBAAgB,CAAC,OAAiC;AAAA,EACzD,IAAI,MAAM;AAAA,IAAQ,OAAO;AAAA,EACzB,MAAM,KAAK,MAAM,SAAS,WAAW,MAAM;AAAA,EAC3C,MAAM,OACJ,OAAO,OAAO,WACV,KACA,MAAM,QAAQ,EAAE,IACd,GAAG,OAAO,CAAC,MAAM,EAAE,SAAS,UAAU,EAAE,IAAI,EAAE,IAAI,CAAC,MAAM,EAAE,IAAK,EAAE,KAAK,EAAE,IACzE;AAAA,EACR,MAAM,UAAU,KAAK,KAAK;AAAA,EAC1B,OAAO,QAAQ,SAAS,KAAK,CAAC,QAAQ,WAAW,GAAG;AAAA;AAGtD,SAAS,QAAQ,CAAC,OAAgC;AAAA,EAChD,MAAM,KAAK,MAAM,SAAS,WAAW,MAAM;AAAA,EAC3C,IAAI,OAAO,OAAO;AAAA,IAAU,OAAO;AAAA,EACnC,IAAI,MAAM,QAAQ,EAAE;AAAA,IAAG,OAAO,GAAG,OA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,KAAK;AAAA,IAE5B,IAAI,SAAS,QAAQ;AAAA,MACnB,IAAI,CAAC,iBAAiB,KAAK;AAAA,QAAG;AAAA,MAC9B,MAAM,UAAU,SAAS,KAAK,EAAE,KAAK;AAAA,MACrC,IAAI,SAAS;AAAA,QACX,SAAS,KAAK,EAAE,MAAM,QAAQ,SAAS,WAAW,MAAM,WAAW,KAAK,MAAM,KAAK,WAAW,MAAM,UAAU,CAAC;AAAA,MACjH;AAAA,IACF,EAAO,SAAI,SAAS,aAAa;AAAA,MAC/B,MAAM,UAAU,cAAc,KAAK,EAAE,KAAK;AAAA,MAC1C,IAAI,SAAS;AAAA,QACX,SAAS,KAAK,EAAE,MAAM,aAAa,SAAS,WAAW,MAAM,WAAW,KAAK,MAAM,KAAK,WAAW,MAAM,UAAU,CAAC;AAAA,MACtH;AAAA,IACF;AAAA,EACF;AAAA,EAGA,SAAS,IAAI,EAAG,IAAI,SAAS,QAAQ,KAAK;AAAA,IACxC,IAAI,SAAS,GAAG,SAAS;AAAA,MAAa;AAAA,IACtC,MAAM,OAAO,SAAS,IAAI;AAAA,IAC1B,SAAS,GAAG,aAAa,CAAC,QAAQ,KAAK,SAAS;AAAA,EAClD;AAAA,EAEA,OAAO,EAAE,UAAU,KAAK,WAAW,UAAU;AAAA;",
|
|
8
|
-
"debugId": "4AE5CBBB15B1907564756E2164756E21",
|
|
9
|
-
"names": []
|
|
10
|
-
}
|
package/dist/chunk-jr0fd6n2.js
DELETED
|
@@ -1,181 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
isLoggingEnabled
|
|
3
|
-
} from "./chunk-yfrrc1d5.js";
|
|
4
|
-
|
|
5
|
-
// src/log.ts
|
|
6
|
-
import { homedir } from "os";
|
|
7
|
-
import { join } from "path";
|
|
8
|
-
import { existsSync, appendFileSync, mkdirSync, readFileSync, statSync, writeFileSync } from "fs";
|
|
9
|
-
|
|
10
|
-
// src/unicode.ts
|
|
11
|
-
var blocks = {
|
|
12
|
-
full: String.fromCodePoint(9608),
|
|
13
|
-
upperHalf: String.fromCodePoint(9600),
|
|
14
|
-
lowerHalf: String.fromCodePoint(9604),
|
|
15
|
-
light: String.fromCodePoint(9617),
|
|
16
|
-
medium: String.fromCodePoint(9618),
|
|
17
|
-
dark: String.fromCodePoint(9619),
|
|
18
|
-
lower1_8: String.fromCodePoint(9601),
|
|
19
|
-
lower2_8: String.fromCodePoint(9602),
|
|
20
|
-
lower3_8: String.fromCodePoint(9603),
|
|
21
|
-
lower4_8: String.fromCodePoint(9604),
|
|
22
|
-
lower5_8: String.fromCodePoint(9605),
|
|
23
|
-
lower6_8: String.fromCodePoint(9606),
|
|
24
|
-
lower7_8: String.fromCodePoint(9607)
|
|
25
|
-
};
|
|
26
|
-
var circles = {
|
|
27
|
-
empty: String.fromCodePoint(9675),
|
|
28
|
-
filled: String.fromCodePoint(9679),
|
|
29
|
-
upperRight: String.fromCodePoint(9684),
|
|
30
|
-
rightHalf: String.fromCodePoint(9681),
|
|
31
|
-
lowerRight: String.fromCodePoint(9685),
|
|
32
|
-
leftHalf: String.fromCodePoint(9680),
|
|
33
|
-
upperHalf: String.fromCodePoint(9683),
|
|
34
|
-
lowerHalf: String.fromCodePoint(9682)
|
|
35
|
-
};
|
|
36
|
-
var stars = {
|
|
37
|
-
small: String.fromCodePoint(8902),
|
|
38
|
-
sparkle1: String.fromCodePoint(10023),
|
|
39
|
-
sparkle2: String.fromCodePoint(10022),
|
|
40
|
-
sparkle3: String.fromCodePoint(8889),
|
|
41
|
-
star6: String.fromCodePoint(10038),
|
|
42
|
-
star4: String.fromCodePoint(10036),
|
|
43
|
-
star8: String.fromCodePoint(10040)
|
|
44
|
-
};
|
|
45
|
-
var braille = {
|
|
46
|
-
wave: [
|
|
47
|
-
String.fromCodePoint(10494),
|
|
48
|
-
String.fromCodePoint(10487),
|
|
49
|
-
String.fromCodePoint(10479),
|
|
50
|
-
String.fromCodePoint(10463),
|
|
51
|
-
String.fromCodePoint(10367),
|
|
52
|
-
String.fromCodePoint(10431),
|
|
53
|
-
String.fromCodePoint(10491),
|
|
54
|
-
String.fromCodePoint(10493)
|
|
55
|
-
],
|
|
56
|
-
dots: [
|
|
57
|
-
String.fromCodePoint(10251),
|
|
58
|
-
String.fromCodePoint(10265),
|
|
59
|
-
String.fromCodePoint(10297),
|
|
60
|
-
String.fromCodePoint(10296),
|
|
61
|
-
String.fromCodePoint(10300),
|
|
62
|
-
String.fromCodePoint(10292),
|
|
63
|
-
String.fromCodePoint(10278),
|
|
64
|
-
String.fromCodePoint(10279),
|
|
65
|
-
String.fromCodePoint(10247),
|
|
66
|
-
String.fromCodePoint(10255)
|
|
67
|
-
]
|
|
68
|
-
};
|
|
69
|
-
var brackets = {
|
|
70
|
-
angleLeft: String.fromCodePoint(10216),
|
|
71
|
-
angleRight: String.fromCodePoint(10217)
|
|
72
|
-
};
|
|
73
|
-
var symbols = {
|
|
74
|
-
check: String.fromCodePoint(10003),
|
|
75
|
-
cross: String.fromCodePoint(10007),
|
|
76
|
-
dot: String.fromCodePoint(183),
|
|
77
|
-
bullet: String.fromCodePoint(8226),
|
|
78
|
-
arrow: String.fromCodePoint(8594),
|
|
79
|
-
line: String.fromCodePoint(9472),
|
|
80
|
-
corner: String.fromCodePoint(9492),
|
|
81
|
-
pipe: String.fromCodePoint(9474)
|
|
82
|
-
};
|
|
83
|
-
var arrows = {
|
|
84
|
-
right: String.fromCodePoint(8594),
|
|
85
|
-
left: String.fromCodePoint(8592),
|
|
86
|
-
up: String.fromCodePoint(8593),
|
|
87
|
-
down: String.fromCodePoint(8595),
|
|
88
|
-
rightDouble: String.fromCodePoint(8658),
|
|
89
|
-
leftDouble: String.fromCodePoint(8656),
|
|
90
|
-
rightHook: String.fromCodePoint(8618),
|
|
91
|
-
leftHook: String.fromCodePoint(8617)
|
|
92
|
-
};
|
|
93
|
-
var box = {
|
|
94
|
-
horizontal: String.fromCodePoint(9472),
|
|
95
|
-
vertical: String.fromCodePoint(9474),
|
|
96
|
-
topLeft: String.fromCodePoint(9484),
|
|
97
|
-
topRight: String.fromCodePoint(9488),
|
|
98
|
-
bottomLeft: String.fromCodePoint(9492),
|
|
99
|
-
bottomRight: String.fromCodePoint(9496),
|
|
100
|
-
branchRight: String.fromCodePoint(9500),
|
|
101
|
-
branchLeft: String.fromCodePoint(9508),
|
|
102
|
-
branchDown: String.fromCodePoint(9516),
|
|
103
|
-
branchUp: String.fromCodePoint(9524),
|
|
104
|
-
cross: String.fromCodePoint(9532),
|
|
105
|
-
cornerRight: String.fromCodePoint(9492)
|
|
106
|
-
};
|
|
107
|
-
|
|
108
|
-
// src/log.ts
|
|
109
|
-
var CACHE_DIR = join(homedir(), ".honcho");
|
|
110
|
-
var LOG_FILE = join(CACHE_DIR, "activity.log");
|
|
111
|
-
var MAX_LOG_SIZE = 100 * 1024;
|
|
112
|
-
var sym = {
|
|
113
|
-
check: symbols.check,
|
|
114
|
-
cross: symbols.cross,
|
|
115
|
-
arrow: arrows.right,
|
|
116
|
-
dot: symbols.bullet,
|
|
117
|
-
circle: symbols.dot,
|
|
118
|
-
branch: box.branchRight,
|
|
119
|
-
corner: box.cornerRight,
|
|
120
|
-
pipe: box.vertical,
|
|
121
|
-
top: box.topRight,
|
|
122
|
-
line: box.horizontal
|
|
123
|
-
};
|
|
124
|
-
function ensureLogDir() {
|
|
125
|
-
if (!existsSync(CACHE_DIR)) {
|
|
126
|
-
mkdirSync(CACHE_DIR, { recursive: true });
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
var currentCwd = null;
|
|
130
|
-
var currentSession = null;
|
|
131
|
-
function setLogContext(cwd, session) {
|
|
132
|
-
currentCwd = cwd;
|
|
133
|
-
currentSession = session || null;
|
|
134
|
-
}
|
|
135
|
-
function logActivity(level, source, message, data, options) {
|
|
136
|
-
if (!isLoggingEnabled())
|
|
137
|
-
return;
|
|
138
|
-
ensureLogDir();
|
|
139
|
-
const entry = {
|
|
140
|
-
timestamp: new Date().toISOString(),
|
|
141
|
-
level,
|
|
142
|
-
source,
|
|
143
|
-
message,
|
|
144
|
-
data,
|
|
145
|
-
timing: options?.timing,
|
|
146
|
-
success: options?.success,
|
|
147
|
-
depth: options?.depth ?? 0,
|
|
148
|
-
cwd: options?.cwd || currentCwd || undefined,
|
|
149
|
-
session: options?.session || currentSession || undefined
|
|
150
|
-
};
|
|
151
|
-
try {
|
|
152
|
-
if (existsSync(LOG_FILE)) {
|
|
153
|
-
const stats = statSync(LOG_FILE).size;
|
|
154
|
-
if (stats > MAX_LOG_SIZE) {
|
|
155
|
-
const content = readFileSync(LOG_FILE, "utf-8");
|
|
156
|
-
const truncated = content.slice(-50 * 1024);
|
|
157
|
-
writeFileSync(LOG_FILE, truncated);
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
appendFileSync(LOG_FILE, JSON.stringify(entry) + `
|
|
161
|
-
`);
|
|
162
|
-
} catch {}
|
|
163
|
-
}
|
|
164
|
-
function logHook(hookName, message, data) {
|
|
165
|
-
logActivity("hook", hookName, message, data);
|
|
166
|
-
}
|
|
167
|
-
function logApiCall(endpoint, method, details, timing, success) {
|
|
168
|
-
const msg = `${method} ${endpoint}${details ? ` ${sym.arrow} ${details}` : ""}`;
|
|
169
|
-
logActivity("api", "honcho", msg, undefined, { timing, success });
|
|
170
|
-
}
|
|
171
|
-
function logFlow(stage, message, data) {
|
|
172
|
-
logActivity("flow", stage, message, data);
|
|
173
|
-
}
|
|
174
|
-
function logAsync(operation, message, results) {
|
|
175
|
-
logActivity("async", operation, message, results ? { results } : undefined);
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
export { blocks, circles, stars, braille, brackets, symbols, arrows, setLogContext, logHook, logApiCall, logFlow, logAsync };
|
|
179
|
-
|
|
180
|
-
//# debugId=ACAEB76FCF128E0164756E2164756E21
|
|
181
|
-
//# sourceMappingURL=chunk-jr0fd6n2.js.map
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/log.ts", "../../src/unicode.ts"],
|
|
4
|
-
"sourcesContent": [
|
|
5
|
-
"/**\n * Activity logging for honcho plugin\n *\n * Designed to be:\n * - Educational: Show how honcho plugin architecture works\n * - Elegant: Visual hierarchy with consistent symbols\n * - Useful: Real-time debugging and demo capabilities\n */\n\nimport { homedir } from \"os\";\nimport { join } from \"path\";\nimport { existsSync, appendFileSync, mkdirSync, readFileSync, statSync, writeFileSync } from \"fs\";\nimport { symbols, arrows, box } from \"./unicode.js\";\nimport { isLoggingEnabled } from \"./config.js\";\n\nconst CACHE_DIR = join(homedir(), \".honcho\");\nconst LOG_FILE = join(CACHE_DIR, \"activity.log\");\nconst MAX_LOG_SIZE = 100 * 1024; // 100KB max log size\n\n// ============================================\n// Log Types - Each tells part of the story\n// ============================================\n\nexport type LogLevel =\n | \"hook\" // Hook lifecycle (session-start, session-end, etc.)\n | \"api\" // Honcho API calls\n | \"cache\" // Cache operations (hits, misses, writes)\n | \"flow\" // Data flow & state transitions\n | \"async\" // Parallel/async operations\n | \"error\" // Errors\n | \"debug\"; // Verbose debugging\n\nexport interface LogEntry {\n timestamp: string;\n level: LogLevel;\n source: string;\n message: string;\n data?: any;\n // Enhanced metadata for visual display\n timing?: number; // Duration in ms\n success?: boolean; // Operation succeeded\n parent?: string; // Parent operation ID for hierarchy\n depth?: number; // Nesting depth for indentation\n // Session context for filtering\n cwd?: string; // Working directory\n session?: string; // Session name\n}\n\n// ============================================\n// ANSI Colors - Orange to Pale Blue gradient\n// ============================================\n\nconst c = {\n reset: \"\\x1b[0m\",\n dim: \"\\x1b[2m\",\n bold: \"\\x1b[1m\",\n // Orange to pale blue gradient\n orange: \"\\x1b[38;5;208m\",\n peach: \"\\x1b[38;5;215m\",\n pale: \"\\x1b[38;5;223m\",\n cream: \"\\x1b[38;5;195m\",\n paleBlue: \"\\x1b[38;5;159m\",\n lightBlue: \"\\x1b[38;5;117m\",\n skyBlue: \"\\x1b[38;5;81m\",\n // Semantic colors\n success: \"\\x1b[38;5;114m\",\n error: \"\\x1b[38;5;203m\",\n warn: \"\\x1b[38;5;221m\",\n};\n\n// ============================================\n// Visual Symbols\n// ============================================\n\nconst sym = {\n check: symbols.check, // ✓\n cross: symbols.cross, // ✗\n arrow: arrows.right, // →\n dot: symbols.bullet, // •\n circle: symbols.dot, // ·\n // Box drawing for hierarchy\n branch: box.branchRight, // ├─\n corner: box.cornerRight, // └─\n pipe: box.vertical, // │\n top: box.topRight, // ┌─\n line: box.horizontal, // ─\n};\n\n// ============================================\n// Core Logging Functions\n// ============================================\n\nfunction ensureLogDir(): void {\n if (!existsSync(CACHE_DIR)) {\n mkdirSync(CACHE_DIR, { recursive: true });\n }\n}\n\n// Current session context (set by hooks at startup)\nlet currentCwd: string | null = null;\nlet currentSession: string | null = null;\n\nexport function setLogContext(cwd: string, session?: string): void {\n currentCwd = cwd;\n currentSession = session || null;\n}\n\nexport function getLogContext(): { cwd: string | null; session: string | null } {\n return { cwd: currentCwd, session: currentSession };\n}\n\n/**\n * Log an activity entry\n */\nexport function logActivity(\n level: LogLevel,\n source: string,\n message: string,\n data?: any,\n options?: { timing?: number; success?: boolean; depth?: number; cwd?: string; session?: string }\n): void {\n if (!isLoggingEnabled()) return;\n ensureLogDir();\n\n const entry: LogEntry = {\n timestamp: new Date().toISOString(),\n level,\n source,\n message,\n data,\n timing: options?.timing,\n success: options?.success,\n depth: options?.depth ?? 0,\n cwd: options?.cwd || currentCwd || undefined,\n session: options?.session || currentSession || undefined,\n };\n\n try {\n // Check file size and truncate if needed\n if (existsSync(LOG_FILE)) {\n const stats = statSync(LOG_FILE).size;\n if (stats > MAX_LOG_SIZE) {\n const content = readFileSync(LOG_FILE, \"utf-8\");\n const truncated = content.slice(-50 * 1024);\n writeFileSync(LOG_FILE, truncated);\n }\n }\n\n appendFileSync(LOG_FILE, JSON.stringify(entry) + \"\\n\");\n } catch {\n // Ignore logging errors\n }\n}\n\n// ============================================\n// Specialized Loggers\n// ============================================\n\n/**\n * Log a hook lifecycle event\n */\nexport function logHook(hookName: string, message: string, data?: any): void {\n logActivity(\"hook\", hookName, message, data);\n}\n\n/**\n * Log an API call with optional timing\n */\nexport function logApiCall(endpoint: string, method: string, details?: string, timing?: number, success?: boolean): void {\n const msg = `${method} ${endpoint}${details ? ` ${sym.arrow} ${details}` : \"\"}`;\n logActivity(\"api\", \"honcho\", msg, undefined, { timing, success });\n}\n\n/**\n * Log a cache operation\n */\nexport function logCache(operation: \"hit\" | \"miss\" | \"write\" | \"clear\", key: string, details?: string): void {\n const opSymbol = operation === \"hit\" ? sym.check : operation === \"miss\" ? sym.arrow : sym.dot;\n const msg = `${key} ${opSymbol} ${operation}${details ? ` (${details})` : \"\"}`;\n logActivity(\"cache\", \"cache\", msg, undefined, { success: operation === \"hit\" });\n}\n\n/**\n * Log data flow / state transition\n */\nexport function logFlow(stage: string, message: string, data?: any): void {\n logActivity(\"flow\", stage, message, data);\n}\n\n/**\n * Log async/parallel operation\n */\nexport function logAsync(operation: string, message: string, results?: { name: string; success: boolean; timing?: number }[]): void {\n logActivity(\"async\", operation, message, results ? { results } : undefined);\n}\n\n/**\n * Start a timed operation - returns a function to call when done\n */\nexport function startTimed(source: string, operation: string): (success?: boolean, details?: string) => void {\n const start = Date.now();\n return (success = true, details?: string) => {\n const timing = Date.now() - start;\n logApiCall(operation, \"timing\", details, timing, success);\n };\n}\n\n// ============================================\n// Display Formatting\n// ============================================\n\n/**\n * Get the log file path\n */\nexport function getLogPath(): string {\n return LOG_FILE;\n}\n\nexport interface LogFilter {\n cwd?: string; // Filter by working directory\n session?: string; // Filter by session name\n level?: LogLevel[]; // Filter by log levels\n}\n\n/**\n * Read recent log entries with optional filtering\n */\nexport function getRecentLogs(count: number = 50, filter?: LogFilter): LogEntry[] {\n ensureLogDir();\n\n if (!existsSync(LOG_FILE)) {\n return [];\n }\n\n try {\n const content = readFileSync(LOG_FILE, \"utf-8\");\n const lines = content.trim().split(\"\\n\").filter(l => l);\n let entries = lines.map(line => {\n try {\n return JSON.parse(line) as LogEntry;\n } catch {\n return null;\n }\n }).filter((e): e is LogEntry => e !== null);\n\n // Apply filters\n if (filter) {\n if (filter.cwd) {\n entries = entries.filter(e => e.cwd === filter.cwd);\n }\n if (filter.session) {\n entries = entries.filter(e => e.session === filter.session);\n }\n if (filter.level && filter.level.length > 0) {\n entries = entries.filter(e => filter.level!.includes(e.level));\n }\n }\n\n return entries.slice(-count);\n } catch {\n return [];\n }\n}\n\n/**\n * Format a log entry for display\n */\nexport function formatLogEntry(entry: LogEntry, options?: { showSession?: boolean }): string {\n const time = entry.timestamp.split(\"T\")[1].split(\".\")[0]; // HH:MM:SS\n\n // Level-specific styling\n const levelConfig: Record<LogLevel, { color: string; label: string }> = {\n hook: { color: c.orange, label: \"HOOK\" },\n api: { color: c.peach, label: \"API\" },\n cache: { color: c.paleBlue, label: \"CACHE\" },\n flow: { color: c.lightBlue, label: \"FLOW\" },\n async: { color: c.skyBlue, label: \"ASYNC\" },\n error: { color: c.error, label: \"ERROR\" },\n debug: { color: c.dim, label: \"DEBUG\" },\n };\n\n const config = levelConfig[entry.level] || levelConfig.debug;\n\n // Build the output\n let output = `${c.dim}${time}${c.reset} `;\n\n // Session indicator (when showing all sessions)\n if (options?.showSession && entry.session) {\n output += `${c.pale}${entry.session}${c.reset} `;\n }\n\n // Level badge\n output += `${config.color}[${config.label.padEnd(5)}]${c.reset} `;\n\n // Source\n output += `${c.dim}${entry.source}${c.reset} `;\n\n // Message\n output += entry.message;\n\n // Timing indicator\n if (entry.timing !== undefined) {\n const timingColor = entry.timing < 50 ? c.success : entry.timing < 200 ? c.pale : c.warn;\n output += ` ${timingColor}${entry.timing}ms${c.reset}`;\n }\n\n // Success/failure indicator\n if (entry.success !== undefined) {\n output += ` ${entry.success ? c.success + sym.check : c.error + sym.cross}${c.reset}`;\n }\n\n // Compact data display\n if (entry.data) {\n const dataStr = typeof entry.data === \"string\" ? entry.data : JSON.stringify(entry.data);\n if (dataStr.length < 80) {\n output += ` ${c.dim}${dataStr}${c.reset}`;\n }\n }\n\n return output;\n}\n\n/**\n * Format a group of related entries as a visual tree\n * For demo/educational display\n */\nexport function formatLogGroup(entries: LogEntry[], title?: string): string[] {\n const lines: string[] = [];\n\n if (title) {\n lines.push(`${c.orange}${sym.top}${sym.line} ${title} ${sym.line.repeat(30)}${c.reset}`);\n }\n\n entries.forEach((entry, i) => {\n const isLast = i === entries.length - 1;\n const prefix = title ? (isLast ? sym.corner : sym.branch) : \"\";\n const indent = entry.depth ? \" \".repeat(entry.depth) : \"\";\n\n lines.push(`${c.dim}${prefix}${c.reset}${indent}${formatLogEntry(entry)}`);\n });\n\n return lines;\n}\n\n/**\n * Watch the log file for changes (for tail -f behavior)\n */\nexport function watchLogs(callback: (entries: LogEntry[]) => void): () => void {\n ensureLogDir();\n\n // Track by line count, not byte size (more reliable)\n let lastLineCount = 0;\n if (existsSync(LOG_FILE)) {\n try {\n const content = readFileSync(LOG_FILE, \"utf-8\");\n lastLineCount = content.trim().split(\"\\n\").filter(l => l).length;\n } catch {\n lastLineCount = 0;\n }\n }\n\n const checkForUpdates = () => {\n if (!existsSync(LOG_FILE)) return;\n\n try {\n const content = readFileSync(LOG_FILE, \"utf-8\");\n const lines = content.trim().split(\"\\n\").filter(l => l);\n const currentLineCount = lines.length;\n\n if (currentLineCount > lastLineCount) {\n // Get only the new lines since last check\n const newLines = lines.slice(lastLineCount);\n const newEntries = newLines\n .map(line => {\n try {\n return JSON.parse(line) as LogEntry;\n } catch {\n return null;\n }\n })\n .filter((e): e is LogEntry => e !== null);\n\n if (newEntries.length > 0) {\n callback(newEntries);\n }\n\n lastLineCount = currentLineCount;\n }\n } catch {\n // Ignore read errors during polling\n }\n };\n\n // Poll every 200ms for snappier response\n const interval = setInterval(checkForUpdates, 200);\n\n return () => {\n clearInterval(interval);\n };\n}\n\n/**\n * Clear the log file\n */\nexport function clearLogs(): void {\n ensureLogDir();\n if (existsSync(LOG_FILE)) {\n writeFileSync(LOG_FILE, \"\");\n }\n}\n\n// ============================================\n// Demo/Educational Output\n// ============================================\n\n/**\n * Print a visual legend explaining log types\n */\nexport function printLegend(): void {\n console.log(\"\");\n console.log(`${c.orange}${c.bold}Log Types${c.reset}`);\n console.log(`${c.dim}${sym.line.repeat(40)}${c.reset}`);\n console.log(` ${c.orange}[HOOK]${c.reset} Hook lifecycle ${c.dim}(session-start, user-prompt, etc.)${c.reset}`);\n console.log(` ${c.peach}[API]${c.reset} Honcho API calls ${c.dim}(with timing)${c.reset}`);\n console.log(` ${c.paleBlue}[CACHE]${c.reset} Local cache ${c.dim}(hit/miss/write)${c.reset}`);\n console.log(` ${c.lightBlue}[FLOW]${c.reset} Data flow ${c.dim}(state transitions)${c.reset}`);\n console.log(` ${c.skyBlue}[ASYNC]${c.reset} Parallel ops ${c.dim}(concurrent fetches)${c.reset}`);\n console.log(\"\");\n console.log(`${c.orange}${c.bold}Symbols${c.reset}`);\n console.log(`${c.dim}${sym.line.repeat(40)}${c.reset}`);\n console.log(` ${c.success}${sym.check}${c.reset} Success ${c.error}${sym.cross}${c.reset} Failure ${sym.arrow} Flow/transition`);\n console.log(` ${c.success}< 50ms${c.reset} ${c.pale}< 200ms${c.reset} ${c.warn}> 200ms${c.reset} ${c.dim}(timing)${c.reset}`);\n console.log(\"\");\n}\n",
|
|
6
|
-
"/**\n * Unicode characters generated at runtime using String.fromCodePoint()\n * This survives Bun's bundler which otherwise converts escape sequences to raw UTF-8 bytes\n */\n\n// Block drawing characters\nexport const blocks = {\n full: String.fromCodePoint(0x2588), // █\n upperHalf: String.fromCodePoint(0x2580), // ▀\n lowerHalf: String.fromCodePoint(0x2584), // ▄\n light: String.fromCodePoint(0x2591), // ░\n medium: String.fromCodePoint(0x2592), // ▒\n dark: String.fromCodePoint(0x2593), // ▓\n // Wave blocks (vertical eighths)\n lower1_8: String.fromCodePoint(0x2581), // ▁\n lower2_8: String.fromCodePoint(0x2582), // ▂\n lower3_8: String.fromCodePoint(0x2583), // ▃\n lower4_8: String.fromCodePoint(0x2584), // ▄\n lower5_8: String.fromCodePoint(0x2585), // ▅\n lower6_8: String.fromCodePoint(0x2586), // ▆\n lower7_8: String.fromCodePoint(0x2587), // ▇\n};\n\n// Circle characters\nexport const circles = {\n empty: String.fromCodePoint(0x25CB), // ○\n filled: String.fromCodePoint(0x25CF), // ●\n upperRight: String.fromCodePoint(0x25D4), // ◔\n rightHalf: String.fromCodePoint(0x25D1), // ◑\n lowerRight: String.fromCodePoint(0x25D5), // ◕\n leftHalf: String.fromCodePoint(0x25D0), // ◐\n upperHalf: String.fromCodePoint(0x25D3), // ◓\n lowerHalf: String.fromCodePoint(0x25D2), // ◒\n};\n\n// Star/sparkle characters\nexport const stars = {\n small: String.fromCodePoint(0x22C6), // ⋆\n sparkle1: String.fromCodePoint(0x2727), // ✧\n sparkle2: String.fromCodePoint(0x2726), // ✦\n sparkle3: String.fromCodePoint(0x22B9), // ⊹\n star6: String.fromCodePoint(0x2736), // ✶\n star4: String.fromCodePoint(0x2734), // ✴\n star8: String.fromCodePoint(0x2738), // ✸\n};\n\n// Braille patterns for wave animation\nexport const braille = {\n wave: [\n String.fromCodePoint(0x28FE), // ⣾\n String.fromCodePoint(0x28F7), // ⣷\n String.fromCodePoint(0x28EF), // ⣯\n String.fromCodePoint(0x28DF), // ⣟\n String.fromCodePoint(0x287F), // ⡿\n String.fromCodePoint(0x28BF), // ⢿\n String.fromCodePoint(0x28FB), // ⣻\n String.fromCodePoint(0x28FD), // ⣽\n ],\n dots: [\n String.fromCodePoint(0x280B), // ⠋\n String.fromCodePoint(0x2819), // ⠙\n String.fromCodePoint(0x2839), // ⠹\n String.fromCodePoint(0x2838), // ⠸\n String.fromCodePoint(0x283C), // ⠼\n String.fromCodePoint(0x2834), // ⠴\n String.fromCodePoint(0x2826), // ⠦\n String.fromCodePoint(0x2827), // ⠧\n String.fromCodePoint(0x2807), // ⠇\n String.fromCodePoint(0x280F), // ⠏\n ],\n};\n\n// Bracket characters\nexport const brackets = {\n angleLeft: String.fromCodePoint(0x27E8), // ⟨\n angleRight: String.fromCodePoint(0x27E9), // ⟩\n};\n\n// Symbols\nexport const symbols = {\n check: String.fromCodePoint(0x2713), // ✓\n cross: String.fromCodePoint(0x2717), // ✗\n dot: String.fromCodePoint(0x00B7), // ·\n bullet: String.fromCodePoint(0x2022), // •\n arrow: String.fromCodePoint(0x2192), // →\n line: String.fromCodePoint(0x2500), // ─\n corner: String.fromCodePoint(0x2514), // └\n pipe: String.fromCodePoint(0x2502), // │\n};\n\n// Arrow characters\nexport const arrows = {\n right: String.fromCodePoint(0x2192), // →\n left: String.fromCodePoint(0x2190), // ←\n up: String.fromCodePoint(0x2191), // ↑\n down: String.fromCodePoint(0x2193), // ↓\n rightDouble: String.fromCodePoint(0x21D2), // ⇒\n leftDouble: String.fromCodePoint(0x21D0), // ⇐\n rightHook: String.fromCodePoint(0x21AA), // ↪\n leftHook: String.fromCodePoint(0x21A9), // ↩\n};\n\n// Box drawing characters for visual hierarchy\nexport const box = {\n horizontal: String.fromCodePoint(0x2500), // ─\n vertical: String.fromCodePoint(0x2502), // │\n topLeft: String.fromCodePoint(0x250C), // ┌\n topRight: String.fromCodePoint(0x2510), // ┐\n bottomLeft: String.fromCodePoint(0x2514), // └\n bottomRight: String.fromCodePoint(0x2518), // ┘\n branchRight: String.fromCodePoint(0x251C), // ├\n branchLeft: String.fromCodePoint(0x2524), // ┤\n branchDown: String.fromCodePoint(0x252C), // ┬\n branchUp: String.fromCodePoint(0x2534), // ┴\n cross: String.fromCodePoint(0x253C), // ┼\n cornerRight: String.fromCodePoint(0x2514), // └ (alias for bottomLeft)\n};\n"
|
|
7
|
-
],
|
|
8
|
-
"mappings": ";;;;;AASA;AACA;AACA;;;ACLO,IAAM,SAAS;AAAA,EACpB,MAAM,OAAO,cAAc,IAAM;AAAA,EACjC,WAAW,OAAO,cAAc,IAAM;AAAA,EACtC,WAAW,OAAO,cAAc,IAAM;AAAA,EACtC,OAAO,OAAO,cAAc,IAAM;AAAA,EAClC,QAAQ,OAA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
-
error,
|
|
8
|
-
header,
|
|
9
|
-
label,
|
|
10
|
-
listItem,
|
|
11
|
-
require_dist,
|
|
12
|
-
section,
|
|
13
|
-
success,
|
|
14
|
-
warn
|
|
15
|
-
} from "./chunk-d2gc13m0.js";
|
|
16
|
-
import"./chunk-xdntcesh.js";
|
|
17
|
-
import {
|
|
18
|
-
__toESM,
|
|
19
|
-
addMessagesBatched,
|
|
20
|
-
chunkContent,
|
|
21
|
-
deriveSessionName,
|
|
22
|
-
getConfigDir,
|
|
23
|
-
getHonchoClientOptions,
|
|
24
|
-
getObservationMode,
|
|
25
|
-
loadConfig,
|
|
26
|
-
setDetectedHost
|
|
27
|
-
} from "./chunk-gnp95nzg.js";
|
|
28
|
-
|
|
29
|
-
// src/skills/backfill-runner.ts
|
|
30
|
-
var import_sdk = __toESM(require_dist(), 1);
|
|
31
|
-
import { homedir } from "os";
|
|
32
|
-
import { join, basename } from "path";
|
|
33
|
-
import { pathToFileURL } from "url";
|
|
34
|
-
import { existsSync, readFileSync, writeFileSync, mkdirSync, readdirSync, statSync } from "fs";
|
|
35
|
-
function parseArgs(argv) {
|
|
36
|
-
const args = { days: 30, dryRun: false };
|
|
37
|
-
for (let i = 0;i < argv.length; i++) {
|
|
38
|
-
const a = argv[i];
|
|
39
|
-
if (a === "--dry-run")
|
|
40
|
-
args.dryRun = true;
|
|
41
|
-
else if (a === "--yes") {} else if (a === "--days")
|
|
42
|
-
args.days = parseInt(argv[++i] ?? "30", 10) || 30;
|
|
43
|
-
else if (a.startsWith("--days="))
|
|
44
|
-
args.days = parseInt(a.slice("--days=".length), 10) || 30;
|
|
45
|
-
else if (a === "--workspace")
|
|
46
|
-
args.workspace = argv[++i];
|
|
47
|
-
else if (a.startsWith("--workspace="))
|
|
48
|
-
args.workspace = a.slice("--workspace=".length);
|
|
49
|
-
}
|
|
50
|
-
return args;
|
|
51
|
-
}
|
|
52
|
-
var PROJECTS_DIR = join(homedir(), ".claude", "projects");
|
|
53
|
-
var STATE_FILE = join(getConfigDir(), "backfill-state.json");
|
|
54
|
-
function loadState() {
|
|
55
|
-
try {
|
|
56
|
-
return JSON.parse(readFileSync(STATE_FILE, "utf-8"));
|
|
57
|
-
} catch {
|
|
58
|
-
return { imported: {} };
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
function saveState(state) {
|
|
62
|
-
if (!existsSync(getConfigDir()))
|
|
63
|
-
mkdirSync(getConfigDir(), { recursive: true });
|
|
64
|
-
writeFileSync(STATE_FILE, JSON.stringify(state, null, 2));
|
|
65
|
-
}
|
|
66
|
-
function findTranscripts(days) {
|
|
67
|
-
if (!existsSync(PROJECTS_DIR))
|
|
68
|
-
return [];
|
|
69
|
-
const cutoff = Date.now() - days * 24 * 60 * 60 * 1000;
|
|
70
|
-
const out = [];
|
|
71
|
-
for (const dir of readdirSync(PROJECTS_DIR)) {
|
|
72
|
-
const dirPath = join(PROJECTS_DIR, dir);
|
|
73
|
-
let entries;
|
|
74
|
-
try {
|
|
75
|
-
if (!statSync(dirPath).isDirectory())
|
|
76
|
-
continue;
|
|
77
|
-
entries = readdirSync(dirPath);
|
|
78
|
-
} catch {
|
|
79
|
-
continue;
|
|
80
|
-
}
|
|
81
|
-
for (const file of entries) {
|
|
82
|
-
if (!file.endsWith(".jsonl"))
|
|
83
|
-
continue;
|
|
84
|
-
const path = join(dirPath, file);
|
|
85
|
-
try {
|
|
86
|
-
const st = statSync(path);
|
|
87
|
-
if (st.mtimeMs >= cutoff)
|
|
88
|
-
out.push({ path, mtimeMs: st.mtimeMs });
|
|
89
|
-
} catch {
|
|
90
|
-
continue;
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
return out;
|
|
95
|
-
}
|
|
96
|
-
function groupIntoSessions(transcripts, strategy, peerName, sessionPeerPrefix, sessionOverrides = {}) {
|
|
97
|
-
const groups = new Map;
|
|
98
|
-
let parsed = 0;
|
|
99
|
-
let empty = 0;
|
|
100
|
-
for (const { path } of transcripts) {
|
|
101
|
-
const { messages, cwd: tCwd, gitBranch: tBranch, sessionId } = parseTranscriptForBackfill(path);
|
|
102
|
-
if (messages.length === 0) {
|
|
103
|
-
empty++;
|
|
104
|
-
continue;
|
|
105
|
-
}
|
|
106
|
-
parsed++;
|
|
107
|
-
const source = basename(path);
|
|
108
|
-
for (const msg of messages) {
|
|
109
|
-
const cwd = msg.cwd || tCwd;
|
|
110
|
-
if (!cwd)
|
|
111
|
-
continue;
|
|
112
|
-
const name = strategy === "per-directory" && sessionOverrides[cwd] ? sessionOverrides[cwd] : deriveSessionName(strategy, cwd, {
|
|
113
|
-
peerName,
|
|
114
|
-
sessionPeerPrefix,
|
|
115
|
-
branch: msg.gitBranch || tBranch,
|
|
116
|
-
instanceId: sessionId
|
|
117
|
-
});
|
|
118
|
-
let group = groups.get(name);
|
|
119
|
-
if (!group) {
|
|
120
|
-
group = { name, messages: [] };
|
|
121
|
-
groups.set(name, group);
|
|
122
|
-
}
|
|
123
|
-
group.messages.push({ ...msg, sourceTranscript: source });
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
return { groups, parsed, empty };
|
|
127
|
-
}
|
|
128
|
-
async function run() {
|
|
129
|
-
setDetectedHost("claude_code");
|
|
130
|
-
const args = parseArgs(process.argv.slice(2));
|
|
131
|
-
console.log("");
|
|
132
|
-
console.log(header("honcho backfill"));
|
|
133
|
-
console.log("");
|
|
134
|
-
const config = loadConfig();
|
|
135
|
-
if (!config) {
|
|
136
|
-
console.log(warn("No Honcho config found — run /honcho:setup first."));
|
|
137
|
-
process.exit(1);
|
|
138
|
-
}
|
|
139
|
-
const targetWorkspace = args.workspace || config.workspace;
|
|
140
|
-
const strategy = config.sessionStrategy ?? "per-directory";
|
|
141
|
-
console.log(` ${label("Workspace")}: ${targetWorkspace}${args.workspace ? dim(" (override)") : ""}`);
|
|
142
|
-
console.log(` ${label("Strategy")}: ${strategy}`);
|
|
143
|
-
console.log(` ${label("Window")}: last ${args.days} days`);
|
|
144
|
-
console.log(` ${label("User peer")}: ${config.peerName}`);
|
|
145
|
-
console.log(` ${label("AI peer")}: ${config.aiPeer}`);
|
|
146
|
-
console.log("");
|
|
147
|
-
const allTranscripts = findTranscripts(args.days);
|
|
148
|
-
const state = loadState();
|
|
149
|
-
const already = allTranscripts.filter((t) => state.imported[`${targetWorkspace}::${t.path}`] === t.mtimeMs);
|
|
150
|
-
const todo = allTranscripts.filter((t) => state.imported[`${targetWorkspace}::${t.path}`] !== t.mtimeMs);
|
|
151
|
-
console.log(section("Scanning transcripts"));
|
|
152
|
-
console.log(listItem(`${allTranscripts.length} transcript(s) in window`));
|
|
153
|
-
if (already.length > 0) {
|
|
154
|
-
console.log(listItem(dim(`${already.length} already imported into ${targetWorkspace} — skipping`)));
|
|
155
|
-
}
|
|
156
|
-
if (todo.length === 0) {
|
|
157
|
-
console.log("");
|
|
158
|
-
console.log(success("Nothing new to import."));
|
|
159
|
-
process.exit(0);
|
|
160
|
-
}
|
|
161
|
-
const { groups, parsed, empty } = groupIntoSessions(todo, strategy, config.peerName, config.sessionPeerPrefix, config.sessions ?? {});
|
|
162
|
-
const totalMessages = [...groups.values()].reduce((n, g) => n + g.messages.length, 0);
|
|
163
|
-
console.log(listItem(`${parsed} transcript(s) with content${empty ? dim(` (${empty} empty, skipped)`) : ""}`));
|
|
164
|
-
console.log(listItem(`${groups.size} session(s), ${totalMessages} message(s) to upload`));
|
|
165
|
-
console.log("");
|
|
166
|
-
console.log(section("Sessions"));
|
|
167
|
-
const sorted = [...groups.values()].sort((a, b) => b.messages.length - a.messages.length);
|
|
168
|
-
for (const g of sorted.slice(0, 15)) {
|
|
169
|
-
console.log(listItem(`${g.name} ${dim(`(${g.messages.length} msg)`)}`));
|
|
170
|
-
}
|
|
171
|
-
if (sorted.length > 15)
|
|
172
|
-
console.log(listItem(dim(`… and ${sorted.length - 15} more`)));
|
|
173
|
-
console.log("");
|
|
174
|
-
if (args.dryRun) {
|
|
175
|
-
console.log(success("Dry run — no messages uploaded."));
|
|
176
|
-
process.exit(0);
|
|
177
|
-
}
|
|
178
|
-
const opts = getHonchoClientOptions(config);
|
|
179
|
-
opts.workspaceId = targetWorkspace;
|
|
180
|
-
opts.timeout = 60000;
|
|
181
|
-
opts.maxRetries = 3;
|
|
182
|
-
const honcho = new import_sdk.Honcho(opts);
|
|
183
|
-
const observationMode = getObservationMode(config);
|
|
184
|
-
console.log(section(`Uploading to ${targetWorkspace}`));
|
|
185
|
-
let uploadedSessions = 0;
|
|
186
|
-
let uploadedMessages = 0;
|
|
187
|
-
const errors = [];
|
|
188
|
-
for (const g of sorted) {
|
|
189
|
-
try {
|
|
190
|
-
const [session, userPeer, aiPeer] = await Promise.all([
|
|
191
|
-
honcho.session(g.name),
|
|
192
|
-
honcho.peer(config.peerName),
|
|
193
|
-
honcho.peer(config.aiPeer)
|
|
194
|
-
]);
|
|
195
|
-
const peers = observationMode === "directional" ? [userPeer, [aiPeer, { observeOthers: true }]] : [userPeer, aiPeer];
|
|
196
|
-
await session.addPeers(peers);
|
|
197
|
-
const fallbackTs = new Date().toISOString();
|
|
198
|
-
const messages = g.messages.flatMap((m) => {
|
|
199
|
-
const peer = m.role === "user" ? userPeer : aiPeer;
|
|
200
|
-
return chunkContent(m.content).map((chunk) => peer.message(chunk, {
|
|
201
|
-
createdAt: m.timestamp || fallbackTs,
|
|
202
|
-
metadata: {
|
|
203
|
-
backfill: true,
|
|
204
|
-
source_transcript: m.sourceTranscript,
|
|
205
|
-
session_affinity: g.name,
|
|
206
|
-
type: m.role === "assistant" ? m.isResponse ? "assistant_response" : "assistant_intermediate" : undefined
|
|
207
|
-
}
|
|
208
|
-
}));
|
|
209
|
-
});
|
|
210
|
-
await addMessagesBatched(session, messages);
|
|
211
|
-
uploadedSessions++;
|
|
212
|
-
uploadedMessages += g.messages.length;
|
|
213
|
-
console.log(listItem(success(`${g.name} ${dim(`(${g.messages.length} msg)`)}`)));
|
|
214
|
-
} catch (err) {
|
|
215
|
-
const msg = err instanceof Error ? err.message : String(err);
|
|
216
|
-
errors.push(`${g.name}: ${msg}`);
|
|
217
|
-
console.log(listItem(warn(`${g.name} — ${msg}`)));
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
|
-
if (errors.length === 0) {
|
|
221
|
-
for (const t of todo) {
|
|
222
|
-
state.imported[`${targetWorkspace}::${t.path}`] = t.mtimeMs;
|
|
223
|
-
}
|
|
224
|
-
saveState(state);
|
|
225
|
-
}
|
|
226
|
-
console.log("");
|
|
227
|
-
console.log(success(`Imported ${uploadedMessages} message(s) across ${uploadedSessions} session(s) into ${targetWorkspace}.`));
|
|
228
|
-
if (errors.length > 0) {
|
|
229
|
-
console.log(warn(`${errors.length} session(s) failed — re-run to retry (not marked complete).`));
|
|
230
|
-
}
|
|
231
|
-
console.log("");
|
|
232
|
-
}
|
|
233
|
-
if (process.argv[1] && import.meta.url === pathToFileURL(process.argv[1]).href) {
|
|
234
|
-
run().catch((err) => {
|
|
235
|
-
console.log(error(`Backfill failed: ${err instanceof Error ? err.message : String(err)}`));
|
|
236
|
-
process.exit(1);
|
|
237
|
-
});
|
|
238
|
-
}
|
|
239
|
-
export {
|
|
240
|
-
groupIntoSessions,
|
|
241
|
-
findTranscripts
|
|
242
|
-
};
|
|
243
|
-
|
|
244
|
-
//# debugId=12809EA5B36E008364756E2164756E21
|
|
245
|
-
//# sourceMappingURL=chunk-wm6hvkcv.js.map
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/skills/backfill-runner.ts"],
|
|
4
|
-
"sourcesContent": [
|
|
5
|
-
"#!/usr/bin/env bun\n/**\n * Backfill runner — imports local Claude Code session transcripts into Honcho.\n *\n * Scans ~/.claude/projects/<dir>/<uuid>.jsonl within a recency window, rebuilds\n * each conversation, names sessions with the same rules as the live hooks, and\n * uploads with the original message timestamps.\n *\n * Usage:\n * bun run backfill-runner.ts [--days N] [--workspace NAME] [--dry-run] [--yes]\n * --days N transcripts modified in the last N days (default 30)\n * --workspace NAME target workspace (default: configured workspace)\n * --dry-run print the plan without uploading\n * --yes reserved; non-interactive, uploads unless --dry-run\n */\nimport { Honcho } from \"@honcho-ai/sdk\";\nimport {\n loadConfig,\n getHonchoClientOptions,\n getObservationMode,\n deriveSessionName,\n getConfigDir,\n setDetectedHost,\n type SessionStrategy,\n} from \"../config.js\";\nimport { addMessagesBatched, chunkContent } from \"../cache.js\";\nimport { parseTranscriptForBackfill, type ParsedMessage } from \"./transcript-parse.js\";\nimport * as s from \"../styles.js\";\nimport { homedir } from \"os\";\nimport { join, basename } from \"path\";\nimport { pathToFileURL } from \"url\";\nimport { existsSync, readFileSync, writeFileSync, mkdirSync, readdirSync, statSync } from \"fs\";\n\ninterface Args {\n days: number;\n workspace?: string;\n dryRun: boolean;\n}\n\nfunction parseArgs(argv: string[]): Args {\n const args: Args = { days: 30, dryRun: false };\n for (let i = 0; i < argv.length; i++) {\n const a = argv[i];\n if (a === \"--dry-run\") args.dryRun = true;\n else if (a === \"--yes\") { /* reserved, non-interactive */ }\n else if (a === \"--days\") args.days = parseInt(argv[++i] ?? \"30\", 10) || 30;\n else if (a.startsWith(\"--days=\")) args.days = parseInt(a.slice(\"--days=\".length), 10) || 30;\n else if (a === \"--workspace\") args.workspace = argv[++i];\n else if (a.startsWith(\"--workspace=\")) args.workspace = a.slice(\"--workspace=\".length);\n }\n return args;\n}\n\nconst PROJECTS_DIR = join(homedir(), \".claude\", \"projects\");\nconst STATE_FILE = join(getConfigDir(), \"backfill-state.json\");\n\n/** Idempotency ledger: which (workspace, transcript@mtime) pairs already imported. */\ninterface BackfillState {\n imported: Record<string, number>; // key `${workspace}::${transcriptPath}` -> mtimeMs\n}\n\nfunction loadState(): BackfillState {\n try {\n return JSON.parse(readFileSync(STATE_FILE, \"utf-8\"));\n } catch {\n return { imported: {} };\n }\n}\n\nfunction saveState(state: BackfillState): void {\n if (!existsSync(getConfigDir())) mkdirSync(getConfigDir(), { recursive: true });\n writeFileSync(STATE_FILE, JSON.stringify(state, null, 2));\n}\n\n/** All transcript files under ~/.claude/projects modified within `days`. */\nexport function findTranscripts(days: number): Array<{ path: string; mtimeMs: number }> {\n if (!existsSync(PROJECTS_DIR)) return [];\n const cutoff = Date.now() - days * 24 * 60 * 60 * 1000;\n const out: Array<{ path: string; mtimeMs: number }> = [];\n for (const dir of readdirSync(PROJECTS_DIR)) {\n const dirPath = join(PROJECTS_DIR, dir);\n let entries: string[];\n try {\n if (!statSync(dirPath).isDirectory()) continue;\n entries = readdirSync(dirPath);\n } catch {\n continue;\n }\n for (const file of entries) {\n if (!file.endsWith(\".jsonl\")) continue;\n const path = join(dirPath, file);\n try {\n const st = statSync(path);\n if (st.mtimeMs >= cutoff) out.push({ path, mtimeMs: st.mtimeMs });\n } catch {\n continue;\n }\n }\n }\n return out;\n}\n\ninterface SessionGroup {\n name: string;\n messages: Array<ParsedMessage & { sourceTranscript: string }>;\n}\n\n/** Group all messages into Honcho sessions, naming each via the configured strategy\n * and per-message cwd/branch (+ the transcript uuid for chat-instance). */\nexport function groupIntoSessions(\n transcripts: Array<{ path: string; mtimeMs: number }>,\n strategy: SessionStrategy,\n peerName: string | undefined,\n sessionPeerPrefix: boolean | undefined,\n sessionOverrides: Record<string, string> = {}\n): { groups: Map<string, SessionGroup>; parsed: number; empty: number } {\n const groups = new Map<string, SessionGroup>();\n let parsed = 0;\n let empty = 0;\n\n for (const { path } of transcripts) {\n const { messages, cwd: tCwd, gitBranch: tBranch, sessionId } = parseTranscriptForBackfill(path);\n if (messages.length === 0) {\n empty++;\n continue;\n }\n parsed++;\n const source = basename(path);\n for (const msg of messages) {\n const cwd = msg.cwd || tCwd;\n if (!cwd) continue; // can't name a session without a directory\n // Honor manual per-directory overrides exactly as getSessionName() does,\n // so backfilled sessions share names with future live sessions.\n const name =\n strategy === \"per-directory\" && sessionOverrides[cwd]\n ? sessionOverrides[cwd]\n : deriveSessionName(strategy, cwd, {\n peerName,\n sessionPeerPrefix,\n branch: msg.gitBranch || tBranch,\n instanceId: sessionId,\n });\n let group = groups.get(name);\n if (!group) {\n group = { name, messages: [] };\n groups.set(name, group);\n }\n group.messages.push({ ...msg, sourceTranscript: source });\n }\n }\n return { groups, parsed, empty };\n}\n\nasync function run(): Promise<void> {\n setDetectedHost(\"claude_code\");\n const args = parseArgs(process.argv.slice(2));\n\n console.log(\"\");\n console.log(s.header(\"honcho backfill\"));\n console.log(\"\");\n\n const config = loadConfig();\n if (!config) {\n console.log(s.warn(\"No Honcho config found — run /honcho:setup first.\"));\n process.exit(1);\n }\n\n const targetWorkspace = args.workspace || config.workspace;\n const strategy: SessionStrategy = config.sessionStrategy ?? \"per-directory\";\n\n console.log(` ${s.label(\"Workspace\")}: ${targetWorkspace}${args.workspace ? s.dim(\" (override)\") : \"\"}`);\n console.log(` ${s.label(\"Strategy\")}: ${strategy}`);\n console.log(` ${s.label(\"Window\")}: last ${args.days} days`);\n console.log(` ${s.label(\"User peer\")}: ${config.peerName}`);\n console.log(` ${s.label(\"AI peer\")}: ${config.aiPeer}`);\n console.log(\"\");\n\n // Discover + filter transcripts\n const allTranscripts = findTranscripts(args.days);\n const state = loadState();\n const already = allTranscripts.filter((t) => state.imported[`${targetWorkspace}::${t.path}`] === t.mtimeMs);\n const todo = allTranscripts.filter((t) => state.imported[`${targetWorkspace}::${t.path}`] !== t.mtimeMs);\n\n console.log(s.section(\"Scanning transcripts\"));\n console.log(s.listItem(`${allTranscripts.length} transcript(s) in window`));\n if (already.length > 0) {\n console.log(s.listItem(s.dim(`${already.length} already imported into ${targetWorkspace} — skipping`)));\n }\n if (todo.length === 0) {\n console.log(\"\");\n console.log(s.success(\"Nothing new to import.\"));\n process.exit(0);\n }\n\n // Group into sessions\n const { groups, parsed, empty } = groupIntoSessions(\n todo,\n strategy,\n config.peerName,\n config.sessionPeerPrefix,\n config.sessions ?? {}\n );\n const totalMessages = [...groups.values()].reduce((n, g) => n + g.messages.length, 0);\n\n console.log(s.listItem(`${parsed} transcript(s) with content${empty ? s.dim(` (${empty} empty, skipped)`) : \"\"}`));\n console.log(s.listItem(`${groups.size} session(s), ${totalMessages} message(s) to upload`));\n console.log(\"\");\n\n // Show a preview of session names + counts (cap the printed list)\n console.log(s.section(\"Sessions\"));\n const sorted = [...groups.values()].sort((a, b) => b.messages.length - a.messages.length);\n for (const g of sorted.slice(0, 15)) {\n console.log(s.listItem(`${g.name} ${s.dim(`(${g.messages.length} msg)`)}`));\n }\n if (sorted.length > 15) console.log(s.listItem(s.dim(`… and ${sorted.length - 15} more`)));\n console.log(\"\");\n\n if (args.dryRun) {\n console.log(s.success(\"Dry run — no messages uploaded.\"));\n process.exit(0);\n }\n\n // Upload\n const opts = getHonchoClientOptions(config);\n opts.workspaceId = targetWorkspace;\n // Backfilling large histories: give the network more headroom than the hooks.\n opts.timeout = 60_000;\n opts.maxRetries = 3;\n const honcho = new Honcho(opts);\n const observationMode = getObservationMode(config);\n\n console.log(s.section(`Uploading to ${targetWorkspace}`));\n\n let uploadedSessions = 0;\n let uploadedMessages = 0;\n const errors: string[] = [];\n\n for (const g of sorted) {\n try {\n const [session, userPeer, aiPeer] = await Promise.all([\n honcho.session(g.name),\n honcho.peer(config.peerName),\n honcho.peer(config.aiPeer),\n ]);\n\n const peers: Parameters<typeof session.addPeers>[0] =\n observationMode === \"directional\" ? [userPeer, [aiPeer, { observeOthers: true }]] : [userPeer, aiPeer];\n await session.addPeers(peers);\n\n const fallbackTs = new Date().toISOString();\n const messages = g.messages.flatMap((m) => {\n const peer = m.role === \"user\" ? userPeer : aiPeer;\n return chunkContent(m.content).map((chunk) =>\n peer.message(chunk, {\n createdAt: m.timestamp || fallbackTs,\n metadata: {\n backfill: true,\n source_transcript: m.sourceTranscript,\n session_affinity: g.name,\n type: m.role === \"assistant\"\n ? (m.isResponse ? \"assistant_response\" : \"assistant_intermediate\")\n : undefined,\n },\n })\n );\n });\n\n await addMessagesBatched(session, messages);\n uploadedSessions++;\n uploadedMessages += g.messages.length;\n console.log(s.listItem(s.success(`${g.name} ${s.dim(`(${g.messages.length} msg)`)}`)));\n } catch (err) {\n const msg = err instanceof Error ? err.message : String(err);\n errors.push(`${g.name}: ${msg}`);\n console.log(s.listItem(s.warn(`${g.name} — ${msg}`)));\n }\n }\n\n // Only mark imported on a fully clean run; leave failures unmarked so a re-run retries.\n if (errors.length === 0) {\n for (const t of todo) {\n state.imported[`${targetWorkspace}::${t.path}`] = t.mtimeMs;\n }\n saveState(state);\n }\n\n console.log(\"\");\n console.log(\n s.success(\n `Imported ${uploadedMessages} message(s) across ${uploadedSessions} session(s) into ${targetWorkspace}.`\n )\n );\n if (errors.length > 0) {\n console.log(s.warn(`${errors.length} session(s) failed — re-run to retry (not marked complete).`));\n }\n console.log(\"\");\n}\n\n// Only auto-run when invoked directly; the guard lets other modules import\n// findTranscripts/groupIntoSessions without triggering an upload. URL\n// comparison instead of import.meta.main, which node lacks.\nif (process.argv[1] && import.meta.url === pathToFileURL(process.argv[1]).href) {\n run().catch((err) => {\n console.log(s.error(`Backfill failed: ${err instanceof Error ? err.message : String(err)}`));\n process.exit(1);\n });\n}\n"
|
|
6
|
-
],
|
|
7
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAeA;AAaA;AACA;AACA;AACA;AAQA,SAAS,SAAS,CAAC,MAAsB;AAAA,EACvC,MAAM,OAAa,EAAE,MAAM,IAAI,QAAQ,MAAM;AAAA,EAC7C,SAAS,IAAI,EAAG,IAAI,KAAK,QAAQ,KAAK;AAAA,IACpC,MAAM,IAAI,KAAK;AAAA,IACf,IAAI,MAAM;AAAA,MAAa,KAAK,SAAS;AAAA,IAChC,SAAI,MAAM,SAAS,CAAkC,EACrD,SAAI,MAAM;AAAA,MAAU,KAAK,OAAO,SAAS,KAAK,EAAE,MAAM,MAAM,EAAE,KAAK;AAAA,IACnE,SAAI,EAAE,WAAW,SAAS;AAAA,MAAG,KAAK,OAAO,SAAS,EAAE,MAAM,UAAU,MAAM,GAAG,EAAE,KAAK;AAAA,IACpF,SAAI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