@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.
@@ -1,4 +1,5 @@
1
1
  #!/usr/bin/env bun
2
+ // @bun
2
3
  var __create = Object.create;
3
4
  var __getProtoOf = Object.getPrototypeOf;
4
5
  var __defProp = Object.defineProperty;
@@ -15566,7 +15567,7 @@ var import_sdk = __toESM(require_dist(), 1);
15566
15567
  import { homedir as homedir2 } from "os";
15567
15568
  import { join as join3, basename, dirname, resolve, sep } from "path";
15568
15569
  import { fileURLToPath } from "url";
15569
- import { existsSync as existsSync3, mkdirSync as mkdirSync2, readFileSync as readFileSync2, statSync, writeFileSync as writeFileSync2 } from "fs";
15570
+ import { chmodSync, existsSync as existsSync3, mkdirSync as mkdirSync2, readFileSync as readFileSync2, statSync, writeFileSync as writeFileSync2 } from "fs";
15570
15571
 
15571
15572
  // src/git.ts
15572
15573
  import { execSync } from "child_process";
@@ -15904,6 +15905,9 @@ function mergeWithEnvVars(config) {
15904
15905
  if (process.env.HONCHO_LOGGING === "false") {
15905
15906
  config.logging = false;
15906
15907
  }
15908
+ if (process.env.HONCHO_SAVE_MESSAGES === "false") {
15909
+ config.saveMessages = false;
15910
+ }
15907
15911
  if (process.env.HONCHO_SAVE_TOOL_USE !== undefined) {
15908
15912
  config.saveToolUse = process.env.HONCHO_SAVE_TOOL_USE === "true";
15909
15913
  }
@@ -15912,6 +15916,11 @@ function mergeWithEnvVars(config) {
15912
15916
  }
15913
15917
  return config;
15914
15918
  }
15919
+ function writeConfigFile(data) {
15920
+ if (existsSync3(CONFIG_FILE))
15921
+ chmodSync(CONFIG_FILE, 384);
15922
+ writeFileSync2(CONFIG_FILE, JSON.stringify(data, null, 2), { mode: 384 });
15923
+ }
15915
15924
  function saveConfig(config) {
15916
15925
  if (!existsSync3(CONFIG_DIR)) {
15917
15926
  mkdirSync2(CONFIG_DIR, { recursive: true });
@@ -15942,9 +15951,10 @@ function saveConfig(config) {
15942
15951
  setHostIfExplicit("aiPeer", config.aiPeer, existing.aiPeer ?? DEFAULT_AI_PEER[host]);
15943
15952
  const enabledForSave = process.env.HONCHO_ENABLED === "false" && config.enabled === false ? existingHost.enabled : config.enabled;
15944
15953
  const loggingForSave = process.env.HONCHO_LOGGING === "false" && config.logging === false ? existingHost.logging : config.logging;
15954
+ const saveMessagesForSave = process.env.HONCHO_SAVE_MESSAGES === "false" && config.saveMessages === false ? existingHost.saveMessages : config.saveMessages;
15945
15955
  setHostIfExplicit("enabled", enabledForSave, existing.enabled);
15946
15956
  setHostIfExplicit("logging", loggingForSave, existing.logging);
15947
- setHostIfExplicit("saveMessages", config.saveMessages, existing.saveMessages);
15957
+ setHostIfExplicit("saveMessages", saveMessagesForSave, existing.saveMessages);
15948
15958
  setHostIfExplicit("sessionStrategy", config.sessionStrategy, existing.sessionStrategy);
15949
15959
  setHostIfExplicit("sessionPeerPrefix", config.sessionPeerPrefix, existing.sessionPeerPrefix);
15950
15960
  setHostIfExplicit("reasoningLevel", config.reasoningLevel, existing.reasoningLevel);
@@ -15959,7 +15969,7 @@ function saveConfig(config) {
15959
15969
  hostEntry.apiKey = existingHost.apiKey;
15960
15970
  }
15961
15971
  existing.hosts[host] = hostEntry;
15962
- writeFileSync2(CONFIG_FILE, JSON.stringify(existing, null, 2));
15972
+ writeConfigFile(existing);
15963
15973
  }
15964
15974
  function saveRootField(field, value) {
15965
15975
  if (!existsSync3(CONFIG_DIR)) {
@@ -15972,7 +15982,7 @@ function saveRootField(field, value) {
15972
15982
  } catch {}
15973
15983
  }
15974
15984
  existing[field] = value;
15975
- writeFileSync2(CONFIG_FILE, JSON.stringify(existing, null, 2));
15985
+ writeConfigFile(existing);
15976
15986
  }
15977
15987
  function getClaudeSettingsPath() {
15978
15988
  return join3(homedir2(), ".claude", "settings.json");
@@ -16183,6 +16193,14 @@ function listItem(text, indent = 0) {
16183
16193
  import { existsSync as existsSync4, readFileSync as readFileSync3, readdirSync, statSync as statSync2 } from "fs";
16184
16194
  import { homedir as homedir3 } from "os";
16185
16195
  import { join as join4 } from "path";
16196
+
16197
+ // src/prompt-filters.ts
16198
+ var LEADING_REMINDERS = /^(?:\s*<system-reminder>[\s\S]*?<\/system-reminder>)+\s*/;
16199
+ function stripLeadingReminders(prompt) {
16200
+ return prompt.replace(LEADING_REMINDERS, "");
16201
+ }
16202
+
16203
+ // src/skills/transcript-parse.ts
16186
16204
  function entryType(entry) {
16187
16205
  return entry.type || entry.role;
16188
16206
  }
@@ -16191,7 +16209,7 @@ function isRealUserPrompt(entry) {
16191
16209
  return false;
16192
16210
  const mc = entry.message?.content ?? entry.content;
16193
16211
  const text = typeof mc === "string" ? mc : Array.isArray(mc) ? mc.filter((b) => b.type === "text" && b.text).map((b) => b.text).join("") : "";
16194
- const trimmed = text.trim();
16212
+ const trimmed = stripLeadingReminders(text).trim();
16195
16213
  return trimmed.length > 0 && !trimmed.startsWith("<");
16196
16214
  }
16197
16215
  function userText(entry) {
@@ -16247,7 +16265,7 @@ function parseTranscriptForBackfill(transcriptPath) {
16247
16265
  if (type === "user") {
16248
16266
  if (!isRealUserPrompt(entry))
16249
16267
  continue;
16250
- const content = userText(entry).trim();
16268
+ const content = stripLeadingReminders(userText(entry)).trim();
16251
16269
  if (content) {
16252
16270
  messages.push({ role: "user", content, timestamp: entry.timestamp, cwd: entry.cwd, gitBranch: entry.gitBranch });
16253
16271
  }
@@ -16299,7 +16317,7 @@ function findTranscripts(days) {
16299
16317
  }
16300
16318
 
16301
16319
  // src/skills/setup.ts
16302
- import { copyFileSync, chmodSync, existsSync as existsSync5, mkdirSync as mkdirSync3, readFileSync as readFileSync4, writeFileSync as writeFileSync3 } from "fs";
16320
+ import { copyFileSync, chmodSync as chmodSync2, existsSync as existsSync5, mkdirSync as mkdirSync3, readFileSync as readFileSync4, writeFileSync as writeFileSync3 } from "fs";
16303
16321
  import { dirname as dirname2, join as join5 } from "path";
16304
16322
  import { fileURLToPath as fileURLToPath2 } from "url";
16305
16323
  function installStatusline() {
@@ -16310,7 +16328,7 @@ function installStatusline() {
16310
16328
  if (!existsSync5(getConfigDir()))
16311
16329
  mkdirSync3(getConfigDir(), { recursive: true });
16312
16330
  copyFileSync(src, dest);
16313
- chmodSync(dest, 493);
16331
+ chmodSync2(dest, 493);
16314
16332
  console.log(success(`Renderer installed at ${dest}`));
16315
16333
  } catch (err) {
16316
16334
  console.log(warn(`Could not install renderer: ${err instanceof Error ? err.message : String(err)}`));
@@ -16460,5 +16478,5 @@ async function setup() {
16460
16478
  // src/skills/setup-runner.ts
16461
16479
  await setup();
16462
16480
 
16463
- //# debugId=EF51AE94A7D1A30D64756E2164756E21
16481
+ //# debugId=0CBA4DB64728BD8F64756E2164756E21
16464
16482
  //# sourceMappingURL=setup-runner.js.map