@vectorize-io/hindsight-coding-agents 0.8.6 → 0.8.8
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/README.md +31 -21
- package/dist/antigravity-hook.js +278 -190
- package/dist/antigravity-statusline.js +30 -24
- package/dist/antigravity-stop-hook.js +271 -169
- package/dist/claude-hook.js +278 -190
- package/dist/claude-sessionstart-hook.js +301 -212
- package/dist/claude-stop-hook.js +271 -169
- package/dist/cline.js +258 -214
- package/dist/codebuddy-hook.js +278 -190
- package/dist/codebuddy-sessionstart-hook.js +301 -212
- package/dist/codebuddy-stop-hook.js +271 -169
- package/dist/codex-hook.js +278 -190
- package/dist/codex-sessionstart-hook.js +301 -212
- package/dist/codex-stop-hook.js +271 -169
- package/dist/copilot-hook.js +278 -190
- package/dist/copilot-sessionstart-hook.js +301 -212
- package/dist/copilot-stop-hook.js +271 -169
- package/dist/cursor-hook.js +278 -190
- package/dist/cursor-sessionstart-hook.js +301 -212
- package/dist/cursor-stop-hook.js +271 -169
- package/dist/daemon-start.js +20 -16
- package/dist/dcode-hook.js +278 -190
- package/dist/dcode-sessionstart-hook.js +301 -212
- package/dist/dcode-stop-hook.js +271 -169
- package/dist/deepen.js +98 -83
- package/dist/devin-hook.js +278 -190
- package/dist/devin-sessionstart-hook.js +301 -212
- package/dist/devin-stop-hook.js +271 -169
- package/dist/droid-hook.js +278 -190
- package/dist/droid-sessionstart-hook.js +301 -212
- package/dist/droid-stop-hook.js +271 -169
- package/dist/dsh.js +309 -251
- package/dist/grok-hook.js +278 -190
- package/dist/grok-sessionstart-hook.js +301 -212
- package/dist/grok-stop-hook.js +271 -169
- package/dist/hindsight-seed.js +35 -26
- package/dist/index.js +310 -252
- package/dist/installer.js +172 -68
- package/dist/kilo.js +310 -252
- package/dist/kimi-hook.js +278 -190
- package/dist/kimi-sessionstart-hook.js +301 -212
- package/dist/kimi-stop-hook.js +271 -169
- package/dist/mcp-server.js +165 -148
- package/dist/opencode2.js +310 -252
- package/dist/pi.js +309 -251
- package/dist/prime-agent.js +309 -251
- package/dist/qwen-hook.js +278 -190
- package/dist/qwen-sessionstart-hook.js +301 -212
- package/dist/qwen-stop-hook.js +271 -169
- package/dist/status.js +134 -117
- package/dist/traecode-hook.js +278 -190
- package/dist/traecode-sessionstart-hook.js +301 -212
- package/dist/traecode-stop-hook.js +271 -169
- package/dist/workbuddy-hook.js +278 -190
- package/dist/workbuddy-sessionstart-hook.js +301 -212
- package/dist/workbuddy-stop-hook.js +271 -169
- package/dist/zcode-hook.js +278 -190
- package/dist/zcode-sessionstart-hook.js +301 -212
- package/dist/zcode-stop-hook.js +271 -169
- package/package.json +2 -1
- package/plugin.json +1 -1
- package/skill/SKILL.md +31 -26
package/dist/hindsight-seed.js
CHANGED
|
@@ -7,16 +7,25 @@ import { join as join7 } from "path";
|
|
|
7
7
|
|
|
8
8
|
// src/core/seed.ts
|
|
9
9
|
import { spawn as realSpawn } from "child_process";
|
|
10
|
-
import { dirname, join } from "path";
|
|
10
|
+
import { dirname, join as join2 } from "path";
|
|
11
11
|
import { fileURLToPath } from "url";
|
|
12
|
+
|
|
13
|
+
// src/core/util.ts
|
|
14
|
+
import { accessSync, constants, statSync } from "fs";
|
|
15
|
+
import { delimiter, extname, isAbsolute, join, resolve } from "path";
|
|
16
|
+
function nodeBinary() {
|
|
17
|
+
return process.versions.bun || process.versions.electron ? "node" : process.execPath;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
// src/core/seed.ts
|
|
12
21
|
var DEFAULT_SEED_LIMIT = 300;
|
|
13
22
|
function startBackgroundSeed(repoDir, opts = {}) {
|
|
14
23
|
try {
|
|
15
24
|
const spawnFn = opts.spawn ?? realSpawn;
|
|
16
|
-
const enginePath = opts.enginePath ??
|
|
25
|
+
const enginePath = opts.enginePath ?? join2(dirname(fileURLToPath(import.meta.url)), "deepen.js");
|
|
17
26
|
const limit = opts.limit ?? DEFAULT_SEED_LIMIT;
|
|
18
27
|
const child = spawnFn(
|
|
19
|
-
|
|
28
|
+
nodeBinary(),
|
|
20
29
|
[
|
|
21
30
|
enginePath,
|
|
22
31
|
"--repo",
|
|
@@ -51,24 +60,24 @@ function seedControl(command2, args) {
|
|
|
51
60
|
// src/core/bank.ts
|
|
52
61
|
import { existsSync } from "fs";
|
|
53
62
|
import { homedir as homedir2 } from "os";
|
|
54
|
-
import { basename, dirname as dirname4, join as
|
|
63
|
+
import { basename, dirname as dirname4, join as join6, normalize, sep } from "path";
|
|
55
64
|
|
|
56
65
|
// src/core/diag.ts
|
|
57
66
|
import { readFileSync } from "fs";
|
|
58
|
-
import { join as
|
|
67
|
+
import { join as join4 } from "path";
|
|
59
68
|
|
|
60
69
|
// src/core/log.ts
|
|
61
|
-
import { appendFileSync, mkdirSync, renameSync, statSync } from "fs";
|
|
70
|
+
import { appendFileSync, mkdirSync, renameSync, statSync as statSync2 } from "fs";
|
|
62
71
|
import { homedir } from "os";
|
|
63
|
-
import { dirname as dirname2, join as
|
|
72
|
+
import { dirname as dirname2, join as join3 } from "path";
|
|
64
73
|
function logsDir() {
|
|
65
|
-
return
|
|
74
|
+
return join3(homedir(), ".hindsight", "coding-agents-logs");
|
|
66
75
|
}
|
|
67
76
|
var LOG_MAX_BYTES = 10 * 1024 * 1024;
|
|
68
77
|
function appendLogLine(file, text) {
|
|
69
78
|
mkdirSync(dirname2(file), { recursive: true, mode: 448 });
|
|
70
79
|
try {
|
|
71
|
-
if (
|
|
80
|
+
if (statSync2(file).size >= LOG_MAX_BYTES) renameSync(file, `${file}.1`);
|
|
72
81
|
} catch {
|
|
73
82
|
}
|
|
74
83
|
appendFileSync(file, text, { mode: 384 });
|
|
@@ -78,7 +87,7 @@ var current = ["debug", "info", "warn", "error"].find(
|
|
|
78
87
|
(l) => l === process.env.HINDSIGHT_LOG_LEVEL
|
|
79
88
|
) ?? "info";
|
|
80
89
|
function logFilePath() {
|
|
81
|
-
return process.env.HINDSIGHT_LOG_FILE ||
|
|
90
|
+
return process.env.HINDSIGHT_LOG_FILE || join3(logsDir(), "plugin.log");
|
|
82
91
|
}
|
|
83
92
|
function write(level, scope, msg, extra) {
|
|
84
93
|
if (WEIGHT[level] < WEIGHT[current]) return;
|
|
@@ -99,7 +108,7 @@ var log = {
|
|
|
99
108
|
|
|
100
109
|
// src/core/diag.ts
|
|
101
110
|
function diagFilePath() {
|
|
102
|
-
return process.env.HINDSIGHT_DIAG_FILE ||
|
|
111
|
+
return process.env.HINDSIGHT_DIAG_FILE || join4(logsDir(), "diag.jsonl");
|
|
103
112
|
}
|
|
104
113
|
function diag(harness, event, extra = {}) {
|
|
105
114
|
log.debug(harness, `diag:${event}`, extra);
|
|
@@ -114,7 +123,7 @@ function diag(harness, event, extra = {}) {
|
|
|
114
123
|
|
|
115
124
|
// src/core/git-layout.ts
|
|
116
125
|
import { lstatSync, readFileSync as readFileSync2, realpathSync } from "fs";
|
|
117
|
-
import { dirname as dirname3, isAbsolute, join as
|
|
126
|
+
import { dirname as dirname3, isAbsolute as isAbsolute2, join as join5, resolve as resolve2 } from "path";
|
|
118
127
|
var TRANSIENT = /* @__PURE__ */ new Set(["EAGAIN", "EMFILE", "ENFILE", "EBUSY", "EINTR", "EIO", "ETIMEDOUT"]);
|
|
119
128
|
var ATTEMPTS = 3;
|
|
120
129
|
var BACKOFF_MS = 20;
|
|
@@ -147,19 +156,19 @@ function gitDirFromPointer(text, holder) {
|
|
|
147
156
|
const match = /^\s*gitdir:\s*(.+?)\s*$/m.exec(text);
|
|
148
157
|
if (!match) return null;
|
|
149
158
|
const target = match[1];
|
|
150
|
-
return
|
|
159
|
+
return isAbsolute2(target) ? target : resolve2(holder, target);
|
|
151
160
|
}
|
|
152
161
|
function commonDirOf(gitDir) {
|
|
153
|
-
const pointer = entryKind(
|
|
162
|
+
const pointer = entryKind(join5(gitDir, "commondir")) === "file" ? readTextOrNull(join5(gitDir, "commondir"))?.trim() : null;
|
|
154
163
|
if (!pointer) return gitDir;
|
|
155
|
-
return
|
|
164
|
+
return isAbsolute2(pointer) ? pointer : resolve2(gitDir, pointer);
|
|
156
165
|
}
|
|
157
166
|
function isBare(commonDir) {
|
|
158
|
-
const config = readTextOrNull(
|
|
167
|
+
const config = readTextOrNull(join5(commonDir, "config"));
|
|
159
168
|
return config !== null && /^\s*bare\s*=\s*true\s*$/im.test(config);
|
|
160
169
|
}
|
|
161
170
|
function looksLikeBareRepository(directory) {
|
|
162
|
-
return entryKind(
|
|
171
|
+
return entryKind(join5(directory, "HEAD")) === "file" && entryKind(join5(directory, "objects")) === "dir" && entryKind(join5(directory, "refs")) === "dir";
|
|
163
172
|
}
|
|
164
173
|
function canonical(path) {
|
|
165
174
|
try {
|
|
@@ -174,9 +183,9 @@ function resolved(commonDir) {
|
|
|
174
183
|
return { status: "resolved", commonDir: canonicalDir, bare: isBare(canonicalDir) };
|
|
175
184
|
}
|
|
176
185
|
function probeOnce(directory) {
|
|
177
|
-
let current2 =
|
|
186
|
+
let current2 = resolve2(directory);
|
|
178
187
|
for (; ; ) {
|
|
179
|
-
const dotGit =
|
|
188
|
+
const dotGit = join5(current2, ".git");
|
|
180
189
|
const kind = entryKind(dotGit);
|
|
181
190
|
if (kind === "dir") {
|
|
182
191
|
const layout = resolved(commonDirOf(dotGit));
|
|
@@ -287,10 +296,14 @@ function gitProjectName(directory, resolveWorktrees, sessionRoot = "") {
|
|
|
287
296
|
return dirName(sessionRoot || directory);
|
|
288
297
|
}
|
|
289
298
|
function configuredDir(dir) {
|
|
290
|
-
const expanded = dir === "~" || dir.startsWith("~/") ?
|
|
299
|
+
const expanded = dir === "~" || dir.startsWith("~/") ? join6(homedir2(), dir.slice(1)) : dir;
|
|
291
300
|
return normalize(expanded).replace(new RegExp(`\\${sep}+$`), "");
|
|
292
301
|
}
|
|
293
|
-
function isWithin(directory, configured) {
|
|
302
|
+
function isWithin(directory, configured, platform = process.platform) {
|
|
303
|
+
if (platform === "win32") {
|
|
304
|
+
directory = directory.toLowerCase();
|
|
305
|
+
configured = configured.toLowerCase();
|
|
306
|
+
}
|
|
294
307
|
return directory === configured || directory.startsWith(configured + sep);
|
|
295
308
|
}
|
|
296
309
|
function mapLookup(map, directory) {
|
|
@@ -416,11 +429,7 @@ var PLUGIN_GOVERNED_BANK_FIELDS = [
|
|
|
416
429
|
];
|
|
417
430
|
|
|
418
431
|
// package.json
|
|
419
|
-
var version = "0.8.
|
|
420
|
-
|
|
421
|
-
// src/core/util.ts
|
|
422
|
-
import { accessSync, constants, statSync as statSync2 } from "fs";
|
|
423
|
-
import { delimiter, extname, isAbsolute as isAbsolute2, join as join6, resolve as resolve2 } from "path";
|
|
432
|
+
var version = "0.8.8";
|
|
424
433
|
|
|
425
434
|
// src/core/hindsight.ts
|
|
426
435
|
var USER_AGENT = `hindsight-coding-agents/${version}`;
|