@vectorize-io/hindsight-coding-agents 0.5.4 → 0.6.0
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 +24 -7
- package/dist/antigravity-hook.js +205 -81
- package/dist/antigravity-statusline.js +32 -22
- package/dist/antigravity-stop-hook.js +216 -79
- package/dist/claude-hook.js +205 -81
- package/dist/claude-sessionstart-hook.js +167 -105
- package/dist/claude-stop-hook.js +216 -79
- package/dist/cline.js +279 -86
- package/dist/codex-hook.js +205 -81
- package/dist/codex-sessionstart-hook.js +167 -105
- package/dist/codex-stop-hook.js +216 -79
- package/dist/copilot-hook.js +205 -81
- package/dist/copilot-sessionstart-hook.js +167 -105
- package/dist/copilot-stop-hook.js +216 -79
- package/dist/cursor-hook.js +205 -81
- package/dist/cursor-sessionstart-hook.js +167 -105
- package/dist/cursor-stop-hook.js +216 -79
- package/dist/daemon-start.js +28 -18
- package/dist/dcode-hook.js +205 -81
- package/dist/dcode-sessionstart-hook.js +167 -105
- package/dist/dcode-stop-hook.js +216 -79
- package/dist/deepen.js +98 -40
- package/dist/devin-hook.js +205 -81
- package/dist/devin-sessionstart-hook.js +167 -105
- package/dist/devin-stop-hook.js +216 -79
- package/dist/droid-hook.js +205 -81
- package/dist/droid-sessionstart-hook.js +167 -105
- package/dist/droid-stop-hook.js +216 -79
- package/dist/dsh.js +277 -85
- package/dist/grok-hook.js +205 -81
- package/dist/grok-sessionstart-hook.js +167 -105
- package/dist/grok-stop-hook.js +216 -79
- package/dist/hindsight-seed.js +32 -22
- package/dist/index.js +280 -88
- package/dist/installer.js +308 -214
- package/dist/kilo.js +280 -88
- package/dist/mcp-server.js +97 -39
- package/dist/opencode2.js +279 -87
- package/dist/pi.js +279 -87
- package/dist/prime-agent.js +279 -87
- package/dist/qwen-hook.js +205 -81
- package/dist/qwen-sessionstart-hook.js +167 -105
- package/dist/qwen-stop-hook.js +216 -79
- package/dist/status.js +94 -36
- package/dist/zcode-hook.js +205 -81
- package/dist/zcode-sessionstart-hook.js +167 -105
- package/dist/zcode-stop-hook.js +216 -79
- package/package.json +1 -1
- package/plugin.json +1 -1
- package/skill/SKILL.md +24 -7
package/dist/daemon-start.js
CHANGED
|
@@ -301,8 +301,8 @@ var init_dist = __esm({
|
|
|
301
301
|
|
|
302
302
|
// src/core/config.ts
|
|
303
303
|
import { readFileSync as readFileSync2 } from "fs";
|
|
304
|
-
import { homedir as
|
|
305
|
-
import { join as
|
|
304
|
+
import { homedir as homedir3 } from "os";
|
|
305
|
+
import { join as join7 } from "path";
|
|
306
306
|
|
|
307
307
|
// src/core/seed.ts
|
|
308
308
|
import { spawn as realSpawn } from "child_process";
|
|
@@ -312,16 +312,28 @@ var DEFAULT_SEED_LIMIT = 300;
|
|
|
312
312
|
|
|
313
313
|
// src/core/bank.ts
|
|
314
314
|
import { existsSync } from "fs";
|
|
315
|
-
import { homedir } from "os";
|
|
316
|
-
import { basename, dirname as dirname4, join as
|
|
315
|
+
import { homedir as homedir2 } from "os";
|
|
316
|
+
import { basename, dirname as dirname4, join as join5, normalize, sep } from "path";
|
|
317
317
|
|
|
318
318
|
// src/core/diag.ts
|
|
319
|
-
import {
|
|
319
|
+
import { join as join3 } from "path";
|
|
320
320
|
|
|
321
321
|
// src/core/log.ts
|
|
322
|
-
import { appendFileSync, mkdirSync } from "fs";
|
|
323
|
-
import {
|
|
322
|
+
import { appendFileSync, mkdirSync, renameSync, statSync } from "fs";
|
|
323
|
+
import { homedir } from "os";
|
|
324
324
|
import { dirname as dirname2, join as join2 } from "path";
|
|
325
|
+
function logsDir() {
|
|
326
|
+
return join2(homedir(), ".hindsight", "coding-agents-logs");
|
|
327
|
+
}
|
|
328
|
+
var LOG_MAX_BYTES = 10 * 1024 * 1024;
|
|
329
|
+
function appendLogLine(file, text) {
|
|
330
|
+
mkdirSync(dirname2(file), { recursive: true, mode: 448 });
|
|
331
|
+
try {
|
|
332
|
+
if (statSync(file).size >= LOG_MAX_BYTES) renameSync(file, `${file}.1`);
|
|
333
|
+
} catch {
|
|
334
|
+
}
|
|
335
|
+
appendFileSync(file, text, { mode: 384 });
|
|
336
|
+
}
|
|
325
337
|
var WEIGHT = { debug: 10, info: 20, warn: 30, error: 40 };
|
|
326
338
|
var current = ["debug", "info", "warn", "error"].find(
|
|
327
339
|
(l) => l === process.env.HINDSIGHT_LOG_LEVEL
|
|
@@ -330,15 +342,13 @@ function setLogLevel(level) {
|
|
|
330
342
|
if (!process.env.HINDSIGHT_LOG_LEVEL) current = level;
|
|
331
343
|
}
|
|
332
344
|
function logFilePath() {
|
|
333
|
-
return process.env.HINDSIGHT_LOG_FILE || join2(
|
|
345
|
+
return process.env.HINDSIGHT_LOG_FILE || join2(logsDir(), "plugin.log");
|
|
334
346
|
}
|
|
335
347
|
function write(level, scope, msg, extra) {
|
|
336
348
|
if (WEIGHT[level] < WEIGHT[current]) return;
|
|
337
349
|
try {
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
appendFileSync(
|
|
341
|
-
file,
|
|
350
|
+
appendLogLine(
|
|
351
|
+
logFilePath(),
|
|
342
352
|
`${(/* @__PURE__ */ new Date()).toISOString()} ${level.toUpperCase().padEnd(5)} [${scope}] ${msg}` + (extra && Object.keys(extra).length ? ` ${JSON.stringify(extra)}` : "") + "\n"
|
|
343
353
|
);
|
|
344
354
|
} catch {
|
|
@@ -353,12 +363,12 @@ var log = {
|
|
|
353
363
|
|
|
354
364
|
// src/core/diag.ts
|
|
355
365
|
function diagFilePath() {
|
|
356
|
-
return process.env.HINDSIGHT_DIAG_FILE || "
|
|
366
|
+
return process.env.HINDSIGHT_DIAG_FILE || join3(logsDir(), "diag.jsonl");
|
|
357
367
|
}
|
|
358
368
|
function diag(harness, event, extra = {}) {
|
|
359
369
|
log.debug(harness, `diag:${event}`, extra);
|
|
360
370
|
try {
|
|
361
|
-
|
|
371
|
+
appendLogLine(
|
|
362
372
|
diagFilePath(),
|
|
363
373
|
JSON.stringify({ ts: (/* @__PURE__ */ new Date()).toISOString(), harness, event, ...extra }) + "\n"
|
|
364
374
|
);
|
|
@@ -368,7 +378,7 @@ function diag(harness, event, extra = {}) {
|
|
|
368
378
|
|
|
369
379
|
// src/core/git-layout.ts
|
|
370
380
|
import { lstatSync, readFileSync, realpathSync } from "fs";
|
|
371
|
-
import { dirname as dirname3, isAbsolute, join as
|
|
381
|
+
import { dirname as dirname3, isAbsolute, join as join4, resolve } from "path";
|
|
372
382
|
|
|
373
383
|
// src/core/missions.ts
|
|
374
384
|
import { createHash } from "crypto";
|
|
@@ -406,7 +416,7 @@ function parseHashedCron(cron) {
|
|
|
406
416
|
|
|
407
417
|
// src/core/util.ts
|
|
408
418
|
import { accessSync, constants } from "fs";
|
|
409
|
-
import { delimiter, join as
|
|
419
|
+
import { delimiter, join as join6 } from "path";
|
|
410
420
|
|
|
411
421
|
// src/core/hindsight.ts
|
|
412
422
|
var DEFAULT_OBSERVATION_SCOPES = "shared";
|
|
@@ -414,7 +424,7 @@ var RETRY_AFTER_FLOOR_MS = 10 * 1e3;
|
|
|
414
424
|
var RETRY_AFTER_CEILING_MS = 60 * 1e3;
|
|
415
425
|
|
|
416
426
|
// src/core/config.ts
|
|
417
|
-
var CONFIG_PATH = process.env.HINDSIGHT_CONFIG ||
|
|
427
|
+
var CONFIG_PATH = process.env.HINDSIGHT_CONFIG || join7(homedir3(), ".hindsight", "coding-agent.json");
|
|
418
428
|
var DEFAULT_DAEMON_PORT = 9077;
|
|
419
429
|
var DEFAULT_DAEMON_PROFILE = "coding-agent";
|
|
420
430
|
function resolvePageTrigger(raw) {
|
|
@@ -639,7 +649,7 @@ function loadConfig(opts = {}) {
|
|
|
639
649
|
|
|
640
650
|
// src/core/daemon.ts
|
|
641
651
|
import { execFileSync, spawn as realSpawn2 } from "child_process";
|
|
642
|
-
import { dirname as dirname5, join as
|
|
652
|
+
import { dirname as dirname5, join as join8 } from "path";
|
|
643
653
|
import { fileURLToPath as fileURLToPath2 } from "url";
|
|
644
654
|
async function isServerHealthy(baseUrl, timeoutMs = 2e3) {
|
|
645
655
|
try {
|