@honcho-ai/claude-honcho 0.3.3 → 0.3.4
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/dist/hooks/post-tool-use.js +62 -43
- package/dist/hooks/post-tool-use.js.map +5 -5
- package/dist/hooks/pre-compact.js +70 -46
- package/dist/hooks/pre-compact.js.map +6 -6
- package/dist/hooks/pre-tool-honcho.js +17 -5
- package/dist/hooks/pre-tool-honcho.js.map +4 -4
- package/dist/hooks/save-user-message.js +39 -10
- package/dist/hooks/save-user-message.js.map +5 -5
- package/dist/hooks/session-end.js +18 -5
- package/dist/hooks/session-end.js.map +4 -4
- package/dist/hooks/session-start.js +65 -43
- package/dist/hooks/session-start.js.map +8 -8
- package/dist/hooks/stop.js +82 -36
- package/dist/hooks/stop.js.map +7 -6
- package/dist/hooks/user-prompt.js +122 -76
- package/dist/hooks/user-prompt.js.map +8 -8
- package/dist/mcp-server.js +119 -89
- package/dist/mcp-server.js.map +5 -5
- package/dist/skills/backfill-runner.js +24 -8
- package/dist/skills/backfill-runner.js.map +7 -6
- package/dist/skills/setup-runner.js +27 -9
- package/dist/skills/setup-runner.js.map +7 -6
- package/dist/skills/status-runner.js +14 -5
- package/dist/skills/status-runner.js.map +4 -4
- package/hooks/hooks.json +9 -9
- package/package.json +1 -1
- package/skills/status/SKILL.md +1 -1
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
|
-
// @bun
|
|
3
2
|
var __create = Object.create;
|
|
4
3
|
var __getProtoOf = Object.getPrototypeOf;
|
|
5
4
|
var __defProp = Object.defineProperty;
|
|
@@ -15567,7 +15566,7 @@ var import_sdk = __toESM(require_dist(), 1);
|
|
|
15567
15566
|
import { homedir as homedir2 } from "os";
|
|
15568
15567
|
import { join as join3, basename, dirname, resolve, sep } from "path";
|
|
15569
15568
|
import { fileURLToPath } from "url";
|
|
15570
|
-
import { existsSync as existsSync3, mkdirSync as mkdirSync2, readFileSync as readFileSync2, statSync, writeFileSync as writeFileSync2 } from "fs";
|
|
15569
|
+
import { chmodSync, existsSync as existsSync3, mkdirSync as mkdirSync2, readFileSync as readFileSync2, statSync, writeFileSync as writeFileSync2 } from "fs";
|
|
15571
15570
|
|
|
15572
15571
|
// src/git.ts
|
|
15573
15572
|
import { execSync } from "child_process";
|
|
@@ -15905,6 +15904,9 @@ function mergeWithEnvVars(config) {
|
|
|
15905
15904
|
if (process.env.HONCHO_LOGGING === "false") {
|
|
15906
15905
|
config.logging = false;
|
|
15907
15906
|
}
|
|
15907
|
+
if (process.env.HONCHO_SAVE_MESSAGES === "false") {
|
|
15908
|
+
config.saveMessages = false;
|
|
15909
|
+
}
|
|
15908
15910
|
if (process.env.HONCHO_SAVE_TOOL_USE !== undefined) {
|
|
15909
15911
|
config.saveToolUse = process.env.HONCHO_SAVE_TOOL_USE === "true";
|
|
15910
15912
|
}
|
|
@@ -15913,6 +15915,11 @@ function mergeWithEnvVars(config) {
|
|
|
15913
15915
|
}
|
|
15914
15916
|
return config;
|
|
15915
15917
|
}
|
|
15918
|
+
function writeConfigFile(data) {
|
|
15919
|
+
if (existsSync3(CONFIG_FILE))
|
|
15920
|
+
chmodSync(CONFIG_FILE, 384);
|
|
15921
|
+
writeFileSync2(CONFIG_FILE, JSON.stringify(data, null, 2), { mode: 384 });
|
|
15922
|
+
}
|
|
15916
15923
|
function saveConfig(config) {
|
|
15917
15924
|
if (!existsSync3(CONFIG_DIR)) {
|
|
15918
15925
|
mkdirSync2(CONFIG_DIR, { recursive: true });
|
|
@@ -15943,9 +15950,10 @@ function saveConfig(config) {
|
|
|
15943
15950
|
setHostIfExplicit("aiPeer", config.aiPeer, existing.aiPeer ?? DEFAULT_AI_PEER[host]);
|
|
15944
15951
|
const enabledForSave = process.env.HONCHO_ENABLED === "false" && config.enabled === false ? existingHost.enabled : config.enabled;
|
|
15945
15952
|
const loggingForSave = process.env.HONCHO_LOGGING === "false" && config.logging === false ? existingHost.logging : config.logging;
|
|
15953
|
+
const saveMessagesForSave = process.env.HONCHO_SAVE_MESSAGES === "false" && config.saveMessages === false ? existingHost.saveMessages : config.saveMessages;
|
|
15946
15954
|
setHostIfExplicit("enabled", enabledForSave, existing.enabled);
|
|
15947
15955
|
setHostIfExplicit("logging", loggingForSave, existing.logging);
|
|
15948
|
-
setHostIfExplicit("saveMessages",
|
|
15956
|
+
setHostIfExplicit("saveMessages", saveMessagesForSave, existing.saveMessages);
|
|
15949
15957
|
setHostIfExplicit("sessionStrategy", config.sessionStrategy, existing.sessionStrategy);
|
|
15950
15958
|
setHostIfExplicit("sessionPeerPrefix", config.sessionPeerPrefix, existing.sessionPeerPrefix);
|
|
15951
15959
|
setHostIfExplicit("reasoningLevel", config.reasoningLevel, existing.reasoningLevel);
|
|
@@ -15960,7 +15968,7 @@ function saveConfig(config) {
|
|
|
15960
15968
|
hostEntry.apiKey = existingHost.apiKey;
|
|
15961
15969
|
}
|
|
15962
15970
|
existing.hosts[host] = hostEntry;
|
|
15963
|
-
|
|
15971
|
+
writeConfigFile(existing);
|
|
15964
15972
|
}
|
|
15965
15973
|
function saveRootField(field, value) {
|
|
15966
15974
|
if (!existsSync3(CONFIG_DIR)) {
|
|
@@ -15973,7 +15981,7 @@ function saveRootField(field, value) {
|
|
|
15973
15981
|
} catch {}
|
|
15974
15982
|
}
|
|
15975
15983
|
existing[field] = value;
|
|
15976
|
-
|
|
15984
|
+
writeConfigFile(existing);
|
|
15977
15985
|
}
|
|
15978
15986
|
function getClaudeSettingsPath() {
|
|
15979
15987
|
return join3(homedir2(), ".claude", "settings.json");
|
|
@@ -16126,6 +16134,14 @@ function getObservationMode(config) {
|
|
|
16126
16134
|
import { existsSync as existsSync4, readFileSync as readFileSync3, readdirSync, statSync as statSync2 } from "fs";
|
|
16127
16135
|
import { homedir as homedir3 } from "os";
|
|
16128
16136
|
import { join as join4 } from "path";
|
|
16137
|
+
|
|
16138
|
+
// src/prompt-filters.ts
|
|
16139
|
+
var LEADING_REMINDERS = /^(?:\s*<system-reminder>[\s\S]*?<\/system-reminder>)+\s*/;
|
|
16140
|
+
function stripLeadingReminders(prompt) {
|
|
16141
|
+
return prompt.replace(LEADING_REMINDERS, "");
|
|
16142
|
+
}
|
|
16143
|
+
|
|
16144
|
+
// src/skills/transcript-parse.ts
|
|
16129
16145
|
function entryType(entry) {
|
|
16130
16146
|
return entry.type || entry.role;
|
|
16131
16147
|
}
|
|
@@ -16134,7 +16150,7 @@ function isRealUserPrompt(entry) {
|
|
|
16134
16150
|
return false;
|
|
16135
16151
|
const mc = entry.message?.content ?? entry.content;
|
|
16136
16152
|
const text = typeof mc === "string" ? mc : Array.isArray(mc) ? mc.filter((b) => b.type === "text" && b.text).map((b) => b.text).join("") : "";
|
|
16137
|
-
const trimmed = text.trim();
|
|
16153
|
+
const trimmed = stripLeadingReminders(text).trim();
|
|
16138
16154
|
return trimmed.length > 0 && !trimmed.startsWith("<");
|
|
16139
16155
|
}
|
|
16140
16156
|
function userText(entry) {
|
|
@@ -16190,7 +16206,7 @@ function parseTranscriptForBackfill(transcriptPath) {
|
|
|
16190
16206
|
if (type === "user") {
|
|
16191
16207
|
if (!isRealUserPrompt(entry))
|
|
16192
16208
|
continue;
|
|
16193
|
-
const content = userText(entry).trim();
|
|
16209
|
+
const content = stripLeadingReminders(userText(entry)).trim();
|
|
16194
16210
|
if (content) {
|
|
16195
16211
|
messages.push({ role: "user", content, timestamp: entry.timestamp, cwd: entry.cwd, gitBranch: entry.gitBranch });
|
|
16196
16212
|
}
|
|
@@ -16481,5 +16497,5 @@ async function main() {
|
|
|
16481
16497
|
// src/skills/backfill-runner.ts
|
|
16482
16498
|
await main();
|
|
16483
16499
|
|
|
16484
|
-
//# debugId=
|
|
16500
|
+
//# debugId=E2FF852EB9BB11F464756E2164756E21
|
|
16485
16501
|
//# sourceMappingURL=backfill-runner.js.map
|