@vectorize-io/hindsight-coding-agents 0.8.2 → 0.8.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.
Files changed (64) hide show
  1. package/README.md +13 -3
  2. package/dist/antigravity-hook.js +95 -42
  3. package/dist/antigravity-statusline.js +6 -6
  4. package/dist/antigravity-stop-hook.js +132 -51
  5. package/dist/claude-hook.js +95 -42
  6. package/dist/claude-sessionstart-hook.js +383 -99
  7. package/dist/claude-stop-hook.js +132 -51
  8. package/dist/cline.js +401 -91
  9. package/dist/codebuddy-hook.js +95 -42
  10. package/dist/codebuddy-sessionstart-hook.js +383 -99
  11. package/dist/codebuddy-stop-hook.js +132 -51
  12. package/dist/codex-hook.js +95 -42
  13. package/dist/codex-sessionstart-hook.js +383 -99
  14. package/dist/codex-stop-hook.js +132 -51
  15. package/dist/copilot-hook.js +95 -42
  16. package/dist/copilot-sessionstart-hook.js +383 -99
  17. package/dist/copilot-stop-hook.js +132 -51
  18. package/dist/cursor-hook.js +95 -42
  19. package/dist/cursor-sessionstart-hook.js +383 -99
  20. package/dist/cursor-stop-hook.js +132 -51
  21. package/dist/daemon-start.js +10 -10
  22. package/dist/dcode-hook.js +95 -42
  23. package/dist/dcode-sessionstart-hook.js +383 -99
  24. package/dist/dcode-stop-hook.js +132 -51
  25. package/dist/deepen.js +82 -23
  26. package/dist/devin-hook.js +95 -42
  27. package/dist/devin-sessionstart-hook.js +383 -99
  28. package/dist/devin-stop-hook.js +132 -51
  29. package/dist/droid-hook.js +95 -42
  30. package/dist/droid-sessionstart-hook.js +383 -99
  31. package/dist/droid-stop-hook.js +132 -51
  32. package/dist/dsh.js +420 -98
  33. package/dist/grok-hook.js +95 -42
  34. package/dist/grok-sessionstart-hook.js +383 -99
  35. package/dist/grok-stop-hook.js +132 -51
  36. package/dist/hindsight-seed.js +6 -6
  37. package/dist/index.js +425 -110
  38. package/dist/installer.js +89 -80
  39. package/dist/kilo.js +425 -110
  40. package/dist/kimi-hook.js +95 -42
  41. package/dist/kimi-sessionstart-hook.js +383 -99
  42. package/dist/kimi-stop-hook.js +132 -51
  43. package/dist/mcp-server.js +169 -62
  44. package/dist/opencode2.js +581 -104
  45. package/dist/pi.js +401 -98
  46. package/dist/prime-agent.js +401 -98
  47. package/dist/qwen-hook.js +95 -42
  48. package/dist/qwen-sessionstart-hook.js +383 -99
  49. package/dist/qwen-stop-hook.js +132 -51
  50. package/dist/status.js +67 -17
  51. package/dist/survey-supervisor.js +73 -9
  52. package/dist/traecode-hook.js +95 -42
  53. package/dist/traecode-sessionstart-hook.js +383 -99
  54. package/dist/traecode-stop-hook.js +132 -51
  55. package/dist/workbuddy-hook.js +95 -42
  56. package/dist/workbuddy-sessionstart-hook.js +383 -99
  57. package/dist/workbuddy-stop-hook.js +132 -51
  58. package/dist/zcode-hook.js +95 -42
  59. package/dist/zcode-sessionstart-hook.js +383 -99
  60. package/dist/zcode-stop-hook.js +132 -51
  61. package/index.js +4 -1
  62. package/package.json +6 -4
  63. package/plugin.json +1 -1
  64. package/skill/SKILL.md +10 -2
package/dist/cline.js CHANGED
@@ -225,14 +225,14 @@ function probeGitLayout(directory) {
225
225
  var PLACEHOLDER = /\{([a-zA-Z_]+)\}/g;
226
226
  function applyTemplate(template, resolvers, what) {
227
227
  return template.replace(PLACEHOLDER, (_, name) => {
228
- const resolve3 = resolvers[name];
229
- if (!resolve3) {
228
+ const resolve4 = resolvers[name];
229
+ if (!resolve4) {
230
230
  console.error(
231
231
  `hindsight: unknown ${what} placeholder "{${name}}" \u2014 valid: ` + Object.keys(resolvers).sort().map((k) => `{${k}}`).join(", ")
232
232
  );
233
233
  return "unknown";
234
234
  }
235
- return resolve3();
235
+ return resolve4();
236
236
  });
237
237
  }
238
238
 
@@ -653,29 +653,33 @@ function codingBankManifest(overrides, mode = DEFAULT_RETAIN_EXTRACTION_MODE, de
653
653
  }
654
654
 
655
655
  // package.json
656
- var version = "0.8.2";
656
+ var version = "0.8.3";
657
657
 
658
658
  // src/core/util.ts
659
- import { accessSync, constants } from "fs";
660
- import { delimiter, join as join6 } from "path";
661
- function binOnPath(bin) {
662
- try {
663
- if (bin.includes("/")) {
664
- accessSync(bin, constants.X_OK);
659
+ import { accessSync, constants, statSync as statSync2 } from "fs";
660
+ import { delimiter, extname, isAbsolute as isAbsolute2, join as join6, resolve as resolve2 } from "path";
661
+ function binOnPath(bin, opts = {}) {
662
+ const platform = opts.platform ?? process.platform;
663
+ const env = opts.env ?? process.env;
664
+ const runnable = (file2) => {
665
+ try {
666
+ if (!statSync2(file2).isFile()) return false;
667
+ if (platform !== "win32") accessSync(file2, constants.X_OK);
665
668
  return true;
669
+ } catch {
670
+ return false;
666
671
  }
667
- for (const dir of (process.env.PATH || "").split(delimiter)) {
668
- if (!dir) continue;
669
- try {
670
- accessSync(join6(dir, bin), constants.X_OK);
671
- return true;
672
- } catch {
673
- }
672
+ };
673
+ if (isAbsolute2(bin) || /[\\/]/.test(bin)) return runnable(bin) ? resolve2(bin) : void 0;
674
+ const names = platform !== "win32" || extname(bin) ? [bin] : (opts.exts ?? (env.PATHEXT || ".COM;.EXE;.BAT;.CMD").split(";")).filter(Boolean).map((ext) => bin + ext.toLowerCase());
675
+ for (const dir of (env.PATH || "").split(delimiter)) {
676
+ if (!dir) continue;
677
+ for (const name of names) {
678
+ const file2 = join6(dir, name);
679
+ if (runnable(file2)) return resolve2(file2);
674
680
  }
675
- return false;
676
- } catch {
677
- return false;
678
681
  }
682
+ return void 0;
679
683
  }
680
684
  var sleep = (ms) => new Promise((r) => setTimeout(r, ms));
681
685
  function semverGte(version3, min) {
@@ -945,15 +949,19 @@ var HindsightClient = class {
945
949
  }
946
950
  /**
947
951
  * Whether this server honours `operation_id` on an async retain, and can therefore be appended to
948
- * safely (see MIN_IDEMPOTENT_RETAIN_VERSION). Probed once per client via the version endpoint; anything
952
+ * safely (see MIN_IDEMPOTENT_RETAIN_VERSION). Probed via the version endpoint; anything
949
953
  * unreachable, unparseable or older answers "no", which costs efficiency, never correctness.
954
+ * Only a "yes" is cached: a long-lived plugin client would otherwise keep replacing for the rest
955
+ * of the process after one probe that hit a restarting server (#5735).
950
956
  */
951
957
  async supportsIdempotentRetain() {
952
- if (this.idempotentRetain === void 0) {
953
- this.idempotentRetain = await this.probeIdempotentRetain();
954
- this.log(`server retain idempotency: ${this.idempotentRetain ? "supported" : "unavailable"}`);
958
+ if (this.idempotentRetain) return true;
959
+ const supported = await this.probeIdempotentRetain();
960
+ if (supported || this.idempotentRetain === void 0) {
961
+ this.log(`server retain idempotency: ${supported ? "supported" : "unavailable"}`);
955
962
  }
956
- return this.idempotentRetain;
963
+ this.idempotentRetain = supported;
964
+ return supported;
957
965
  }
958
966
  /** `/v1/version` first: an ingress that routes only `/v1` to the API (the Helm chart's default)
959
967
  * hands a bare `/version` to the control plane, whose HTML 404 or login redirect read as "no",
@@ -1987,15 +1995,15 @@ function stagedVersion(pkgRoot) {
1987
1995
  }
1988
1996
  }
1989
1997
  function isNewer(candidate, current2) {
1990
- const parse3 = (v) => {
1998
+ const parse4 = (v) => {
1991
1999
  const [core = "", ...rest] = v.trim().split("-");
1992
2000
  return {
1993
2001
  nums: core.split(".").map((n) => Number.parseInt(n, 10)),
1994
2002
  pre: rest.length > 0
1995
2003
  };
1996
2004
  };
1997
- const a = parse3(candidate);
1998
- const b = parse3(current2);
2005
+ const a = parse4(candidate);
2006
+ const b = parse4(current2);
1999
2007
  if (a.nums.length !== 3 || b.nums.length !== 3) return false;
2000
2008
  if (a.nums.some(Number.isNaN) || b.nums.some(Number.isNaN)) return false;
2001
2009
  for (let i = 0; i < 3; i++) {
@@ -2072,7 +2080,7 @@ function spawnNpm(spawnImpl, bin, args, opts) {
2072
2080
  return process.platform === "win32" ? spawnImpl([bin, ...args].join(" "), { ...opts, shell: true }) : spawnImpl(bin, args, opts);
2073
2081
  }
2074
2082
  async function npmViewVersion(pkg, spawnImpl = realSpawn2) {
2075
- return new Promise((resolve3) => {
2083
+ return new Promise((resolve4) => {
2076
2084
  let out = "";
2077
2085
  let settled = false;
2078
2086
  let deadline;
@@ -2081,7 +2089,7 @@ async function npmViewVersion(pkg, spawnImpl = realSpawn2) {
2081
2089
  settled = true;
2082
2090
  if (deadline) clearTimeout(deadline);
2083
2091
  if (reason) log.info("auto-update", `version check failed: ${reason}`);
2084
- resolve3(v);
2092
+ resolve4(v);
2085
2093
  };
2086
2094
  try {
2087
2095
  const child = spawnNpm(spawnImpl, "npm", ["view", pkg, "version", "--json"], {
@@ -2278,8 +2286,8 @@ async function waitBounded(p, ms) {
2278
2286
  try {
2279
2287
  await Promise.race([
2280
2288
  p,
2281
- new Promise((resolve3) => {
2282
- timer = setTimeout(resolve3, Math.max(ms, 0));
2289
+ new Promise((resolve4) => {
2290
+ timer = setTimeout(resolve4, Math.max(ms, 0));
2283
2291
  })
2284
2292
  ]);
2285
2293
  } finally {
@@ -16924,7 +16932,7 @@ import { execFileSync as execFileSync4 } from "child_process";
16924
16932
 
16925
16933
  // src/core/git.ts
16926
16934
  import { execFileSync as execFileSync2 } from "child_process";
16927
- import { resolve as resolve2 } from "path";
16935
+ import { resolve as resolve3 } from "path";
16928
16936
 
16929
16937
  // src/core/uuid.ts
16930
16938
  import { createHash as createHash2 } from "crypto";
@@ -16952,18 +16960,25 @@ var US = "";
16952
16960
  var RS = "";
16953
16961
  var GITLOG_HEAD = "gitlog-head:";
16954
16962
  var GITLOG_FORMAT = `--format=%h${US}%ad${US}%an${US}%s${US}%b${RS}`;
16955
- function git(repo, ...args) {
16963
+ function runGit(repo, args, env) {
16956
16964
  return execFileSync2("git", ["-C", repo, "-c", "log.showSignature=false", ...args], {
16957
16965
  encoding: "utf8",
16958
16966
  maxBuffer: 1 << 28,
16959
16967
  windowsHide: true,
16968
+ env,
16960
16969
  // execFileSync otherwise forwards failed git stderr into the host's TUI,
16961
16970
  // even when callers catch the error. Keep diagnostics on the error instead.
16962
16971
  stdio: ["ignore", "pipe", "pipe"]
16963
16972
  });
16964
16973
  }
16974
+ function git(repo, ...args) {
16975
+ return runGit(repo, args);
16976
+ }
16977
+ function gitLocal(repo, ...args) {
16978
+ return runGit(repo, args, { ...process.env, GIT_NO_LAZY_FETCH: "1" });
16979
+ }
16965
16980
  function repoNameOf(repo) {
16966
- return projectNameOf(resolve2(repo));
16981
+ return projectNameOf(resolve3(repo));
16967
16982
  }
16968
16983
  function gitHeadSha(dir) {
16969
16984
  try {
@@ -16975,7 +16990,7 @@ function gitHeadSha(dir) {
16975
16990
  function commitsSince(dir, sinceSha) {
16976
16991
  if (!/^[0-9a-f]{40}(?:[0-9a-f]{24})?$/.test(sinceSha)) return null;
16977
16992
  try {
16978
- const n = Number.parseInt(git(dir, "rev-list", "--count", `${sinceSha}..HEAD`).trim(), 10);
16993
+ const n = Number.parseInt(gitLocal(dir, "rev-list", "--count", `${sinceSha}..HEAD`).trim(), 10);
16979
16994
  return Number.isFinite(n) ? n : null;
16980
16995
  } catch {
16981
16996
  return null;
@@ -17001,11 +17016,197 @@ async function gitLogIsCurrent(client, repo, head) {
17001
17016
  // src/core/survey.ts
17002
17017
  import { execFileSync as execFileSync3, spawn as realSpawn5 } from "child_process";
17003
17018
  import { createHash as createHash3 } from "crypto";
17004
- import { existsSync as existsSync3 } from "fs";
17019
+ import { existsSync as existsSync3, readFileSync as readFileSync5, writeFileSync as writeFileSync3 } from "fs";
17005
17020
  import { homedir as homedir5, tmpdir as tmpdir2 } from "os";
17006
17021
  import { dirname as dirname7, join as join11 } from "path";
17007
17022
  import { fileURLToPath as fileURLToPath4 } from "url";
17008
17023
 
17024
+ // node_modules/smol-toml/dist/stringify.js
17025
+ var BARE_KEY = /^[a-z0-9-_]+$/i;
17026
+ var HAS_WELLFORMED = !!"".isWellFormed;
17027
+ function extendedTypeOf(obj) {
17028
+ let type = typeof obj;
17029
+ if (type === "object") {
17030
+ if (Array.isArray(obj))
17031
+ return "array";
17032
+ if (typeof obj.getUTCDate === "function" && obj instanceof Date)
17033
+ return "date";
17034
+ if (globalThis.Temporal) {
17035
+ if (obj.until) {
17036
+ if (obj instanceof Temporal.ZonedDateTime)
17037
+ return "temporal/tz+uc";
17038
+ if (obj instanceof Temporal.PlainDateTime || obj instanceof Temporal.PlainDate)
17039
+ return "temporal/uc";
17040
+ if (obj instanceof Temporal.PlainTime || obj instanceof Temporal.Instant)
17041
+ return "temporal";
17042
+ if (obj instanceof Temporal.PlainYearMonth)
17043
+ return "temporal/x";
17044
+ } else if (obj.toPlainDate && obj instanceof Temporal.PlainMonthDay || obj.negated && obj instanceof Temporal.Duration) {
17045
+ return "temporal/x";
17046
+ }
17047
+ }
17048
+ }
17049
+ return type;
17050
+ }
17051
+ function isArrayOfTables(obj) {
17052
+ for (let i = 0; i < obj.length; i++) {
17053
+ if (extendedTypeOf(obj[i]) !== "object")
17054
+ return false;
17055
+ }
17056
+ return obj.length != 0;
17057
+ }
17058
+ function formatWellFormedStringUnchecked(s) {
17059
+ return JSON.stringify(s).replaceAll("\x7F", "\\u007f");
17060
+ }
17061
+ function formatString(s) {
17062
+ return formatWellFormedStringUnchecked(HAS_WELLFORMED ? s.toWellFormed() : s);
17063
+ }
17064
+ function formatKey(s) {
17065
+ if (BARE_KEY.test(s))
17066
+ return s;
17067
+ if (HAS_WELLFORMED && !s.isWellFormed())
17068
+ throw new RangeError("key contains illegal lone surrogates");
17069
+ return formatWellFormedStringUnchecked(s);
17070
+ }
17071
+ function stringifyValue(val, type, depth, numberAsFloat, strictTemporal) {
17072
+ if (depth === 0) {
17073
+ throw new Error("Could not stringify the object: maximum object depth exceeded");
17074
+ }
17075
+ switch (type) {
17076
+ // @ts-expect-error -- intentional fallthrough case
17077
+ case "number":
17078
+ if (isNaN(val))
17079
+ return "nan";
17080
+ if (val === Infinity)
17081
+ return "inf";
17082
+ if (val === -Infinity)
17083
+ return "-inf";
17084
+ if (Number.isInteger(val) && (numberAsFloat || !Number.isSafeInteger(val)))
17085
+ return val.toFixed(1);
17086
+ case "bigint":
17087
+ case "boolean":
17088
+ case "temporal":
17089
+ return val.toString();
17090
+ case "string":
17091
+ return formatString(val);
17092
+ case "date":
17093
+ if (isNaN(val.getTime()))
17094
+ throw new TypeError("cannot serialize invalid date");
17095
+ return val.toISOString();
17096
+ case "object":
17097
+ return stringifyInlineTable(val, depth, numberAsFloat, strictTemporal);
17098
+ case "array":
17099
+ return stringifyArray(val, depth, numberAsFloat, strictTemporal);
17100
+ // @ts-expect-error -- intentional fallthrough case
17101
+ case "temporal/tz+uc":
17102
+ if (strictTemporal) {
17103
+ let tz = val.timeZoneId;
17104
+ let tzc = tz.charCodeAt(0);
17105
+ if (
17106
+ // Classic offset
17107
+ tzc !== 43 && tzc !== 45 && // Fast pre-check pass; see below for the actually accepted values
17108
+ (tzc !== 85 && tzc !== 71 && tzc !== 90 && tzc !== 69 || // UTC and its aliases; Temporal implementations don't all canonicalise unfortunately
17109
+ tz !== "UTC" && tz !== "UCT" && tz !== "Universal" && tz !== "Zulu" && // GMT is a TZ but it's for all intents and purposes equivalent to UTC. Safe to downgrade.
17110
+ !tz.startsWith("GMT") && tz !== "Greenwich" && // Etc/* are all safe to downgrade to offset (either UTC, GMT, or offset)
17111
+ !tz.startsWith("Etc/"))
17112
+ ) {
17113
+ throw new TypeError("Temporal objects with an IANA timezone are not allowed in Temporal strict mode");
17114
+ }
17115
+ }
17116
+ case "temporal/uc":
17117
+ if (strictTemporal && val.calendarId !== "iso8601")
17118
+ throw new TypeError("Temporal objects with a non-default calendar are not allowed in Temporal strict mode");
17119
+ return val.toString({
17120
+ calendarName: "never",
17121
+ timeZoneName: "never"
17122
+ });
17123
+ case "temporal/x":
17124
+ throw new TypeError("Unsupported " + val[Symbol.toStringTag]);
17125
+ }
17126
+ }
17127
+ function stringifyInlineTable(obj, depth, numberAsFloat, strictTemporal) {
17128
+ let keys = Object.keys(obj);
17129
+ if (keys.length === 0)
17130
+ return "{}";
17131
+ let res = "{ ";
17132
+ for (let i = 0; i < keys.length; i++) {
17133
+ let k = keys[i];
17134
+ if (i)
17135
+ res += ", ";
17136
+ res += formatKey(k) + " = " + stringifyValue(obj[k], extendedTypeOf(obj[k]), depth - 1, numberAsFloat, strictTemporal);
17137
+ }
17138
+ return res + " }";
17139
+ }
17140
+ function stringifyArray(array2, depth, numberAsFloat, strictTemporal) {
17141
+ if (array2.length === 0)
17142
+ return "[]";
17143
+ let res = "[ ";
17144
+ for (let i = 0; i < array2.length; i++) {
17145
+ if (i)
17146
+ res += ", ";
17147
+ if (array2[i] === null || array2[i] === void 0) {
17148
+ throw new TypeError("arrays cannot contain null or undefined values");
17149
+ }
17150
+ res += stringifyValue(array2[i], extendedTypeOf(array2[i]), depth - 1, numberAsFloat, strictTemporal);
17151
+ }
17152
+ return res + " ]";
17153
+ }
17154
+ function stringifyArrayTable(array2, key, depth, numberAsFloat, strictTemporal) {
17155
+ if (depth === 0) {
17156
+ throw new Error("Could not stringify the object: maximum object depth exceeded");
17157
+ }
17158
+ let res = "";
17159
+ for (let i = 0; i < array2.length; i++) {
17160
+ res += `${res && "\n"}[[${key}]]
17161
+ `;
17162
+ res += stringifyTable(0, array2[i], key, depth, numberAsFloat, strictTemporal);
17163
+ }
17164
+ return res;
17165
+ }
17166
+ function stringifyTable(tableKey, obj, prefix, depth, numberAsFloat, strictTemporal) {
17167
+ if (depth === 0) {
17168
+ throw new Error("Could not stringify the object: maximum object depth exceeded");
17169
+ }
17170
+ let preamble = "";
17171
+ let tables = "";
17172
+ let keys = Object.keys(obj);
17173
+ for (let i = 0; i < keys.length; i++) {
17174
+ let k = keys[i];
17175
+ if (obj[k] !== null && obj[k] !== void 0) {
17176
+ let type = extendedTypeOf(obj[k]);
17177
+ if (type === "symbol" || type === "function") {
17178
+ throw new TypeError(`cannot serialize values of type '${type}'`);
17179
+ }
17180
+ let key = formatKey(k);
17181
+ if (type === "array" && isArrayOfTables(obj[k])) {
17182
+ tables += (tables && "\n") + stringifyArrayTable(obj[k], prefix ? `${prefix}.${key}` : key, depth - 1, numberAsFloat, strictTemporal);
17183
+ } else if (type === "object") {
17184
+ let tblKey = prefix ? `${prefix}.${key}` : key;
17185
+ tables += (tables && "\n") + stringifyTable(tblKey, obj[k], tblKey, depth - 1, numberAsFloat, strictTemporal);
17186
+ } else {
17187
+ preamble += key;
17188
+ preamble += " = ";
17189
+ preamble += stringifyValue(obj[k], type, depth, numberAsFloat, strictTemporal);
17190
+ preamble += "\n";
17191
+ }
17192
+ }
17193
+ }
17194
+ if (tableKey && (preamble || !tables))
17195
+ preamble = preamble ? `[${tableKey}]
17196
+ ${preamble}` : `[${tableKey}]`;
17197
+ return preamble && tables ? `${preamble}
17198
+ ${tables}` : preamble || tables;
17199
+ }
17200
+ function stringify(obj, { maxDepth = 1e3, numbersAsFloat = false, strictTemporal = false } = {}) {
17201
+ if (extendedTypeOf(obj) !== "object") {
17202
+ throw new TypeError("stringify can only be called with an object");
17203
+ }
17204
+ let str = stringifyTable(0, obj, "", maxDepth, numbersAsFloat, strictTemporal);
17205
+ if (str[str.length - 1] !== "\n")
17206
+ return str + "\n";
17207
+ return str;
17208
+ }
17209
+
17009
17210
  // src/core/survey-lease.ts
17010
17211
  import { spawn as realSpawn4 } from "child_process";
17011
17212
  import { randomUUID } from "crypto";
@@ -17016,7 +17217,7 @@ import {
17016
17217
  renameSync as renameSync2,
17017
17218
  rmdirSync,
17018
17219
  rmSync,
17019
- statSync as statSync2,
17220
+ statSync as statSync3,
17020
17221
  unlinkSync as unlinkSync2,
17021
17222
  utimesSync,
17022
17223
  writeFileSync as writeFileSync2
@@ -17053,7 +17254,7 @@ function reclaimIfStale(directory, staleMs) {
17053
17254
  return true;
17054
17255
  }
17055
17256
  if (owners.length !== 1) return false;
17056
- const age = Date.now() - statSync2(join10(directory, owners[0])).mtimeMs;
17257
+ const age = Date.now() - statSync3(join10(directory, owners[0])).mtimeMs;
17057
17258
  if (Math.abs(age) <= staleMs) return false;
17058
17259
  releaseLease({ directory, owner: owners[0] });
17059
17260
  return true;
@@ -17116,7 +17317,7 @@ function opencodeCanDefineSurveyAgent(bin) {
17116
17317
  windowsHide: true,
17117
17318
  stdio: ["ignore", "pipe", "ignore"]
17118
17319
  });
17119
- return Number(/(\d+)\./.exec(out)?.[1] ?? 0) >= 1;
17320
+ return Number(/(\d+)\./.exec(out)?.[1] ?? 0) === 1;
17120
17321
  } catch {
17121
17322
  return false;
17122
17323
  }
@@ -17131,6 +17332,7 @@ var SURVEY_DISALLOWED_TOOLS = [
17131
17332
  "WebSearch",
17132
17333
  "Task"
17133
17334
  ];
17335
+ var tomlValue = (value) => stringify({ v: value }).slice("v = ".length).trim();
17134
17336
  function buildSurveyPlan(harness, bin, repoDir, opts) {
17135
17337
  const env = {
17136
17338
  ...process.env,
@@ -17189,9 +17391,9 @@ function buildSurveyPlan(harness, bin, repoDir, opts) {
17189
17391
  "-c",
17190
17392
  `mcp_servers.hindsight.command="node"`,
17191
17393
  "-c",
17192
- `mcp_servers.hindsight.args=["${opts.mcpServerPath}"]`,
17394
+ `mcp_servers.hindsight.args=${tomlValue([opts.mcpServerPath])}`,
17193
17395
  "-c",
17194
- `mcp_servers.hindsight.env.HINDSIGHT_MCP_PROJECT_CWD="${repoDir}"`,
17396
+ `mcp_servers.hindsight.env.HINDSIGHT_MCP_PROJECT_CWD=${tomlValue(repoDir)}`,
17195
17397
  "-c",
17196
17398
  `mcp_servers.hindsight.env.HINDSIGHT_MCP_HARNESS="codex"`,
17197
17399
  SURVEY_PROMPT
@@ -17215,10 +17417,19 @@ function buildSurveyPlan(harness, bin, repoDir, opts) {
17215
17417
  }
17216
17418
  }
17217
17419
  }
17420
+ var SURVEY_MAX_ATTEMPTS = 3;
17421
+ function surveyAttempts(file2, sha) {
17422
+ try {
17423
+ const state = JSON.parse(readFileSync5(file2, "utf8"));
17424
+ return state.sha === sha && typeof state.attempts === "number" ? state.attempts : 0;
17425
+ } catch {
17426
+ return 0;
17427
+ }
17428
+ }
17218
17429
  async function startCodebaseSurvey(repoDir, opts = {}) {
17219
17430
  try {
17220
17431
  const spawnFn = opts.spawn ?? realSpawn5;
17221
- const exists = opts.exists ?? binOnPath;
17432
+ const resolveBin = opts.resolveBin ?? ((bin) => binOnPath(bin, { exts: [".exe"] }));
17222
17433
  const mcpServerPath = opts.mcpServerPath ?? join11(dirname7(fileURLToPath4(import.meta.url)), "mcp-server.js");
17223
17434
  const preferred = opts.harness ?? "claude-code";
17224
17435
  const order = [
@@ -17232,10 +17443,16 @@ async function startCodebaseSurvey(repoDir, opts = {}) {
17232
17443
  for (const harness of order) {
17233
17444
  if (seen.has(harness)) continue;
17234
17445
  seen.add(harness);
17235
- const bin = resolveAgentBin(harness, opts.claudeBin);
17236
- if (!exists(bin)) continue;
17237
- if (harness === "opencode" && !(opts.opencodeDefinesAgent ?? opencodeCanDefineSurveyAgent)(bin))
17446
+ const name = resolveAgentBin(harness, opts.claudeBin);
17447
+ const bin = resolveBin(name);
17448
+ if (!bin) {
17449
+ log.info("survey", `${harness}: ${name} not found, trying the next agent`);
17450
+ continue;
17451
+ }
17452
+ if (harness === "opencode" && !(opts.opencodeDefinesAgent ?? opencodeCanDefineSurveyAgent)(bin)) {
17453
+ log.info("survey", `${harness}: ${bin} cannot define the survey agent, trying the next`);
17238
17454
  continue;
17455
+ }
17239
17456
  const plan = buildSurveyPlan(harness, bin, repoDir, {
17240
17457
  model: opts.model,
17241
17458
  budgetUsd: opts.budgetUsd,
@@ -17244,12 +17461,19 @@ async function startCodebaseSurvey(repoDir, opts = {}) {
17244
17461
  const { cfg, bankId } = resolveHostConfig(harness, repoDir);
17245
17462
  if (cfg.disabled) return false;
17246
17463
  const key = createHash3("sha256").update(JSON.stringify([cfg.apiUrl.replace(/\/+$/, ""), cfg.apiToken ?? "", bankId])).digest("hex");
17247
- const lease = acquireLease(
17248
- opts.lease?.dir ?? join11(tmpdir2(), "hindsight-coding-agent", "surveys"),
17249
- key,
17250
- opts.lease?.staleMs ?? LEASE_STALE_MS
17251
- );
17464
+ const leaseDir = opts.lease?.dir ?? join11(tmpdir2(), "hindsight-coding-agent", "surveys");
17465
+ const lease = acquireLease(leaseDir, key, opts.lease?.staleMs ?? LEASE_STALE_MS);
17252
17466
  if (!lease) return false;
17467
+ const attemptsFile = join11(
17468
+ leaseDir,
17469
+ `attempts-${createHash3("sha256").update(JSON.stringify([key, repoDir])).digest("hex")}.json`
17470
+ );
17471
+ const attempts = opts.sha ? surveyAttempts(attemptsFile, opts.sha) : 0;
17472
+ if (attempts >= SURVEY_MAX_ATTEMPTS) {
17473
+ log.info("survey", `${attempts} surveys already launched at ${opts.sha}, skipping`);
17474
+ releaseLease(lease);
17475
+ return false;
17476
+ }
17253
17477
  const spec = {
17254
17478
  lease,
17255
17479
  bin: plan.bin,
@@ -17257,7 +17481,7 @@ async function startCodebaseSurvey(repoDir, opts = {}) {
17257
17481
  ...opts.lease?.heartbeatMs ? { heartbeatMs: opts.lease.heartbeatMs } : {}
17258
17482
  };
17259
17483
  const supervisorPath = opts.supervisorPath ?? join11(dirname7(fileURLToPath4(import.meta.url)), "survey-supervisor.js");
17260
- return await new Promise((resolve3) => {
17484
+ return await new Promise((resolve4) => {
17261
17485
  try {
17262
17486
  const child = spawnFn("node", [supervisorPath], {
17263
17487
  cwd: repoDir,
@@ -17267,19 +17491,31 @@ async function startCodebaseSurvey(repoDir, opts = {}) {
17267
17491
  env: { ...plan.env, [SURVEY_SPEC_ENV]: JSON.stringify(spec) }
17268
17492
  });
17269
17493
  let spawned = false;
17270
- child.on("error", () => {
17494
+ child.on("error", (e) => {
17271
17495
  if (spawned) return;
17496
+ log.warn("survey", `survey supervisor failed to launch: ${describeError(e)}`);
17272
17497
  releaseLease(lease);
17273
- resolve3(false);
17498
+ resolve4(false);
17274
17499
  });
17275
17500
  child.once("spawn", () => {
17276
17501
  spawned = true;
17277
17502
  child.unref();
17278
- resolve3(true);
17503
+ if (opts.sha) {
17504
+ try {
17505
+ writeFileSync3(
17506
+ attemptsFile,
17507
+ JSON.stringify({ sha: opts.sha, attempts: attempts + 1 }),
17508
+ { mode: 384 }
17509
+ );
17510
+ } catch {
17511
+ }
17512
+ }
17513
+ resolve4(true);
17279
17514
  });
17280
- } catch {
17515
+ } catch (e) {
17516
+ log.warn("survey", `survey supervisor failed to launch: ${describeError(e)}`);
17281
17517
  releaseLease(lease);
17282
- resolve3(false);
17518
+ resolve4(false);
17283
17519
  }
17284
17520
  });
17285
17521
  }
@@ -17557,6 +17793,18 @@ function pendingReplayable(cursor, now) {
17557
17793
  if (pending.some((p) => now - p.at > PENDING_MAX_AGE_MS)) return false;
17558
17794
  return pending.reduce((n, p) => n + p.content.length, 0) <= PENDING_MAX_BYTES;
17559
17795
  }
17796
+ function advanceSegments(cursor, bank) {
17797
+ if (!cursor || cursor.bank === bank) return cursor?.segments;
17798
+ return [...cursor.segments ?? [{ bank: cursor.bank, from: 0 }], { bank, from: cursor.turns }];
17799
+ }
17800
+ function bankTurns(turns, segments, bank) {
17801
+ if (!segments) return turns;
17802
+ return turns.filter((_, i) => {
17803
+ let owner;
17804
+ for (const s of segments) if (s.from <= i) owner = s.bank;
17805
+ return owner === bank;
17806
+ });
17807
+ }
17560
17808
  var MAX_CURSOR_OPS = 8;
17561
17809
  function fingerprintTurns(turns, count) {
17562
17810
  const h = createHash5("sha1").update(String(count));
@@ -17567,7 +17815,8 @@ function planRetain(turns, cursor, opts) {
17567
17815
  if (!turns.length) return { mode: "skip" };
17568
17816
  if (!opts.appendSupported || !cursor || cursor.dirty) return { mode: "replace" };
17569
17817
  if (!pendingReplayable(cursor, opts.now ?? Date.now())) return { mode: "replace" };
17570
- if (cursor.bank !== opts.bank) return { mode: "replace" };
17818
+ if (cursor.bank !== opts.bank && !cursor.segments?.some((s) => s.bank === opts.bank))
17819
+ return { mode: "replace" };
17571
17820
  const seen = cursor.paths ?? [];
17572
17821
  const newFile = Boolean(opts.path && seen.length && !seen.includes(opts.path));
17573
17822
  const continues = cursor.turns <= turns.length && fingerprintTurns(turns, cursor.turns) === cursor.fingerprint;
@@ -17688,8 +17937,17 @@ async function writeSession(client, sessionId2, turns, startTs, harness, stamp,
17688
17937
  let cursor = cursors?.read(sessionId2);
17689
17938
  const probed = Boolean(cursors) && cursor?.appendSupported !== true;
17690
17939
  const appendSupported = Boolean(cursors) && (cursor?.appendSupported === true || await supportsAppend(client));
17940
+ const moved = Boolean(cursor && cursor.bank !== client.bank);
17941
+ if (moved)
17942
+ log.warn(harness ?? "", "session moved to another bank mid-session", {
17943
+ session: sessionId2,
17944
+ from: cursor?.bank,
17945
+ to: client.bank,
17946
+ atTurn: cursor?.turns
17947
+ });
17948
+ const segments = advanceSegments(cursor, client.bank);
17691
17949
  let ops = [];
17692
- if (appendSupported && cursor?.ops?.length && !cursor.dirty)
17950
+ if (appendSupported && cursor?.ops?.length && !cursor.dirty && !moved)
17693
17951
  ({ cursor, ops } = await settleOps(client, cursor));
17694
17952
  const plan = planRetain(turns, cursor, {
17695
17953
  appendSupported,
@@ -17698,7 +17956,7 @@ async function writeSession(client, sessionId2, turns, startTs, harness, stamp,
17698
17956
  });
17699
17957
  if (probed) diag(harness ?? "", "retain_mode", { mode: plan.mode, appendSupported });
17700
17958
  const paths = plan.mode === "replace" ? transcriptPath ? [transcriptPath] : void 0 : advancePaths(cursor?.paths, transcriptPath);
17701
- const outbox = plan.mode === "replace" ? [] : cursor?.pending ?? [];
17959
+ const outbox = plan.mode === "replace" || moved ? [] : cursor?.pending ?? [];
17702
17960
  if (plan.mode === "skip" && !outbox.length) return;
17703
17961
  const opId = (mode, content) => uuidV5(`${client.bank}
17704
17962
  ${refId}
@@ -17740,6 +17998,7 @@ ${content}`);
17740
17998
  fingerprint: fingerprintTurns(turns, turns.length),
17741
17999
  bank: client.bank,
17742
18000
  ...paths ? { paths } : {},
18001
+ ...segments ? { segments } : {},
17743
18002
  ...appendSupported ? { appendSupported: true } : {}
17744
18003
  };
17745
18004
  const accepted = (id) => {
@@ -17752,9 +18011,14 @@ ${content}`);
17752
18011
  return now?.turns === next.turns && now?.fingerprint === next.fingerprint;
17753
18012
  };
17754
18013
  if (plan.mode === "replace") {
17755
- const content = renderSessionJsonl(refId, turns, startTs);
18014
+ const share = bankTurns(turns, segments, client.bank);
18015
+ if (!share.length) return;
18016
+ const content = renderSessionJsonl(refId, share, startTs);
18017
+ const base = cursor ? `${cursor.turns}
18018
+ ${cursor.fingerprint}` : "";
17756
18019
  cursors?.write(sessionId2, { ...next, dirty: true });
17757
- const operationId = opId("replace", content);
18020
+ const operationId = opId("replace", `${base}
18021
+ ${content}`);
17758
18022
  await submitWithRetry(() => submit(content, operationId, false), stillOurs, retryUntil);
17759
18023
  ops = [];
17760
18024
  cursors?.write(sessionId2, accepted(operationId));
@@ -17781,7 +18045,7 @@ ${content}`);
17781
18045
  }
17782
18046
 
17783
18047
  // src/core/usage.ts
17784
- import { readFileSync as readFileSync5 } from "fs";
18048
+ import { readFileSync as readFileSync6 } from "fs";
17785
18049
  import { join as join13 } from "path";
17786
18050
  function usageFilePath() {
17787
18051
  return process.env.HINDSIGHT_USAGE_FILE || join13(logsDir(), "usage.jsonl");
@@ -17864,12 +18128,12 @@ function buildRetainStamp(cfg, ctx) {
17864
18128
  const base = resolversFor(ctx);
17865
18129
  const cache = /* @__PURE__ */ new Map();
17866
18130
  const resolvers = Object.fromEntries(
17867
- Object.entries(base).map(([name, resolve3]) => [
18131
+ Object.entries(base).map(([name, resolve4]) => [
17868
18132
  name,
17869
18133
  () => {
17870
18134
  const hit = cache.get(name);
17871
18135
  if (hit !== void 0) return hit;
17872
- const value = resolve3();
18136
+ const value = resolve4();
17873
18137
  cache.set(name, value);
17874
18138
  return value;
17875
18139
  }
@@ -17889,7 +18153,7 @@ function buildRetainStamp(cfg, ctx) {
17889
18153
  }
17890
18154
 
17891
18155
  // src/core/skill-sync.ts
17892
- import { cpSync, existsSync as existsSync6, readFileSync as readFileSync6 } from "fs";
18156
+ import { cpSync, existsSync as existsSync6, readFileSync as readFileSync7 } from "fs";
17893
18157
  import { homedir as homedir7 } from "os";
17894
18158
  import { dirname as dirname8, join as join15 } from "path";
17895
18159
  import { fileURLToPath as fileURLToPath5 } from "url";
@@ -17964,7 +18228,7 @@ function syncCompanionSkill(harness, opts = {}) {
17964
18228
  const dstMd = join15(dst, "SKILL.md");
17965
18229
  const installed = existsSync6(dstMd);
17966
18230
  if (!installed && !opts.install) return;
17967
- if (!installed || readFileSync6(srcMd, "utf8") !== readFileSync6(dstMd, "utf8")) {
18231
+ if (!installed || readFileSync7(srcMd, "utf8") !== readFileSync7(dstMd, "utf8")) {
17968
18232
  cpSync(src, dst, { recursive: true });
17969
18233
  }
17970
18234
  } catch {
@@ -17986,9 +18250,9 @@ function brandWord() {
17986
18250
  }
17987
18251
 
17988
18252
  // src/core/legacy.ts
17989
- import { existsSync as existsSync7, readFileSync as readFileSync7 } from "fs";
18253
+ import { existsSync as existsSync7, readFileSync as readFileSync8 } from "fs";
17990
18254
  import { homedir as homedir8 } from "os";
17991
- import { join as join16, relative, isAbsolute as isAbsolute2 } from "path";
18255
+ import { join as join16, relative, isAbsolute as isAbsolute3 } from "path";
17992
18256
  var LEGACY_CLAUDE_PLUGIN = "hindsight-memory";
17993
18257
  function detectLegacyClaudePlugin(cwd, claudeDir = join16(homedir8(), ".claude")) {
17994
18258
  const registry2 = readJson(join16(claudeDir, "plugins", "installed_plugins.json"));
@@ -18003,7 +18267,7 @@ function detectLegacyClaudePlugin(cwd, claudeDir = join16(homedir8(), ".claude")
18003
18267
  if (!i || typeof i !== "object") return false;
18004
18268
  if (typeof i.projectPath !== "string") return true;
18005
18269
  const rel = relative(i.projectPath, cwd);
18006
- return rel === "" || !rel.startsWith("..") && !isAbsolute2(rel);
18270
+ return rel === "" || !rel.startsWith("..") && !isAbsolute3(rel);
18007
18271
  });
18008
18272
  if (active) return key;
18009
18273
  }
@@ -18011,7 +18275,7 @@ function detectLegacyClaudePlugin(cwd, claudeDir = join16(homedir8(), ".claude")
18011
18275
  }
18012
18276
  function readJson(path) {
18013
18277
  try {
18014
- const parsed = JSON.parse(readFileSync7(path, "utf8"));
18278
+ const parsed = JSON.parse(readFileSync8(path, "utf8"));
18015
18279
  return parsed && typeof parsed === "object" ? parsed : void 0;
18016
18280
  } catch {
18017
18281
  return void 0;
@@ -18023,7 +18287,7 @@ function legacyClaudePluginWarning(key) {
18023
18287
  }
18024
18288
 
18025
18289
  // src/core/session-cache.ts
18026
- import { mkdirSync as mkdirSync4, readFileSync as readFileSync8, renameSync as renameSync3, rmSync as rmSync2, writeFileSync as writeFileSync3 } from "fs";
18290
+ import { mkdirSync as mkdirSync4, readFileSync as readFileSync9, renameSync as renameSync3, rmSync as rmSync2, writeFileSync as writeFileSync4 } from "fs";
18027
18291
  import { tmpdir as tmpdir3 } from "os";
18028
18292
  import { dirname as dirname9, join as join17 } from "path";
18029
18293
  function sessionCacheFile(harness, sessionId2) {
@@ -18031,7 +18295,7 @@ function sessionCacheFile(harness, sessionId2) {
18031
18295
  }
18032
18296
  function readSessionCache(cacheFile) {
18033
18297
  try {
18034
- return JSON.parse(readFileSync8(cacheFile, "utf8"));
18298
+ return JSON.parse(readFileSync9(cacheFile, "utf8"));
18035
18299
  } catch {
18036
18300
  return {};
18037
18301
  }
@@ -18040,7 +18304,7 @@ function writeFileAtomic(path, body) {
18040
18304
  mkdirSync4(dirname9(path), { recursive: true });
18041
18305
  const tmp = `${path}.${process.pid}.tmp`;
18042
18306
  try {
18043
- writeFileSync3(tmp, body);
18307
+ writeFileSync4(tmp, body);
18044
18308
  renameSync3(tmp, path);
18045
18309
  } catch (e) {
18046
18310
  try {
@@ -18150,12 +18414,13 @@ async function buildSessionStartContext(args) {
18150
18414
  startSeed(cwd, { limit: cfg.seedLimit, harness });
18151
18415
  if (cold) {
18152
18416
  if (cfg.codebaseSurvey !== false) {
18417
+ const sha = resolveHeadSha(cwd);
18153
18418
  const started = await startSurvey(cwd, {
18154
18419
  harness,
18155
18420
  model: cfg.surveyModel,
18156
- budgetUsd: cfg.surveyBudgetUsd
18421
+ budgetUsd: cfg.surveyBudgetUsd,
18422
+ sha: sha ?? void 0
18157
18423
  });
18158
- const sha = resolveHeadSha(cwd);
18159
18424
  if (started && sha) recordSurveyBaseline(sha);
18160
18425
  }
18161
18426
  diag(harness, "seed_started", { bank: bankId });
@@ -18176,7 +18441,8 @@ async function buildSessionStartContext(args) {
18176
18441
  const started = await startSurvey(cwd, {
18177
18442
  harness,
18178
18443
  model: cfg.surveyModel,
18179
- budgetUsd: cfg.surveyBudgetUsd
18444
+ budgetUsd: cfg.surveyBudgetUsd,
18445
+ sha
18180
18446
  });
18181
18447
  if (started) {
18182
18448
  recordSurveyBaseline(sha);
@@ -18278,7 +18544,7 @@ If you VERIFY this memory is wrong or outdated (the code or facts contradict it)
18278
18544
  }
18279
18545
 
18280
18546
  // src/core/turn-journal.ts
18281
- import { appendFileSync as appendFileSync2, mkdirSync as mkdirSync5, readFileSync as readFileSync9, statSync as statSync3 } from "fs";
18547
+ import { appendFileSync as appendFileSync2, mkdirSync as mkdirSync5, readFileSync as readFileSync10, statSync as statSync4 } from "fs";
18282
18548
  import { tmpdir as tmpdir4 } from "os";
18283
18549
  import { dirname as dirname10, join as join18 } from "path";
18284
18550
  var JOURNAL_MAX_BYTES = 8 * 1024 * 1024;
@@ -18492,8 +18758,6 @@ var RuntimeCore = class {
18492
18758
  fetchTranscript;
18493
18759
  /** Write-backs started and not yet settled — what `flush` waits for. */
18494
18760
  inFlight = /* @__PURE__ */ new Set();
18495
- lastInjection = "";
18496
- // most recent turn's injection block, keyed by nothing (see getInjection)
18497
18761
  deferInitialReflect = false;
18498
18762
  /** Host-notice channel (opencode/Kilo: client.tui.showToast via the adapter). Optional, fail-open. */
18499
18763
  notify;
@@ -18565,7 +18829,11 @@ var RuntimeCore = class {
18565
18829
  */
18566
18830
  async onPrompt(sessionId2, prompt) {
18567
18831
  if (process.env.HINDSIGHT_DISABLE_HOOKS) return;
18568
- if (!sessionId2 || !prompt.trim()) return;
18832
+ if (!sessionId2) return;
18833
+ if (!prompt.trim()) {
18834
+ this.injection.delete(sessionId2);
18835
+ return;
18836
+ }
18569
18837
  const turns = (this.turnCount.get(sessionId2) ?? 0) + 1;
18570
18838
  this.turnCount.set(sessionId2, turns);
18571
18839
  const cacheFile = sessionCacheFile(this.harness, sessionId2);
@@ -18597,18 +18865,21 @@ var RuntimeCore = class {
18597
18865
  }
18598
18866
  const block = blocks.filter(Boolean).join("\n\n");
18599
18867
  this.injection.set(sessionId2, block);
18600
- this.lastInjection = block;
18601
18868
  }
18602
18869
  /**
18603
- * The system-prompt text to inject this turn (built by the preceding onPrompt), or undefined.
18604
- * opencode's `experimental.chat.system.transform` hook fires with NO sessionId (input is just
18605
- * `{model}`), so a session-keyed lookup returns nothing there — fall back to the most recent
18606
- * turn's block (`lastInjection`). The completion's system.transform fires right after that
18607
- * session's `chat.message`/onPrompt, so `lastInjection` is this turn's block.
18870
+ * The text to inject into this turn's user message (built by the preceding onPrompt), or
18871
+ * undefined.
18872
+ *
18873
+ * It goes into the USER turn on every host, never the system prompt (#5914). The block changes
18874
+ * from turn to turn — the recall runs once, the roster refresh on a cadence — so a system prompt
18875
+ * carrying it differed between requests and broke the provider's prefix cache from that point
18876
+ * on. Persisted in the turn it belongs to, it leaves the system prompt and the earlier history
18877
+ * byte-identical. That used to need a fallback to the most recent block for opencode's
18878
+ * `experimental.chat.system.transform`, which fired with no session id; nothing reads it that
18879
+ * way any more.
18608
18880
  */
18609
18881
  getInjection(sessionId2) {
18610
- const keyed = sessionId2 ? this.injection.get(sessionId2) : void 0;
18611
- return keyed ?? this.lastInjection ?? void 0;
18882
+ return this.injection.get(sessionId2) || void 0;
18612
18883
  }
18613
18884
  /**
18614
18885
  * Full normalized transcript (rich: user/assistant text + tool calls/outputs): upsert every turn
@@ -18768,8 +19039,8 @@ async function settleWithinHookBudget(work) {
18768
19039
  () => true
18769
19040
  // RuntimeCore is fail-open; an adapter failure must be equally non-fatal.
18770
19041
  ),
18771
- new Promise((resolve3) => {
18772
- timer = setTimeout(() => resolve3(false), CLINE_HOOK_BUDGET_MS);
19042
+ new Promise((resolve4) => {
19043
+ timer = setTimeout(() => resolve4(false), CLINE_HOOK_BUDGET_MS);
18773
19044
  })
18774
19045
  ]);
18775
19046
  } finally {
@@ -18864,3 +19135,42 @@ export {
18864
19135
  cline_default as default,
18865
19136
  plugin
18866
19137
  };
19138
+ /*! Bundled license information:
19139
+
19140
+ smol-toml/dist/error.js:
19141
+ smol-toml/dist/primitive.js:
19142
+ smol-toml/dist/date.js:
19143
+ smol-toml/dist/extract.js:
19144
+ smol-toml/dist/util.js:
19145
+ smol-toml/dist/struct.js:
19146
+ smol-toml/dist/parse.js:
19147
+ smol-toml/dist/stringify.js:
19148
+ smol-toml/dist/index.js:
19149
+ (*!
19150
+ * Copyright (c) Squirrel Chat et al., All rights reserved.
19151
+ * SPDX-License-Identifier: BSD-3-Clause
19152
+ *
19153
+ * Redistribution and use in source and binary forms, with or without
19154
+ * modification, are permitted provided that the following conditions are met:
19155
+ *
19156
+ * 1. Redistributions of source code must retain the above copyright notice, this
19157
+ * list of conditions and the following disclaimer.
19158
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
19159
+ * this list of conditions and the following disclaimer in the
19160
+ * documentation and/or other materials provided with the distribution.
19161
+ * 3. Neither the name of the copyright holder nor the names of its contributors
19162
+ * may be used to endorse or promote products derived from this software without
19163
+ * specific prior written permission.
19164
+ *
19165
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
19166
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19167
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19168
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
19169
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19170
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
19171
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
19172
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
19173
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
19174
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
19175
+ *)
19176
+ */