@vectorize-io/hindsight-coding-agents 0.5.1 → 0.5.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.
- package/README.md +84 -9
- package/dist/antigravity-hook.js +424 -81
- package/dist/antigravity-statusline.js +56 -11
- package/dist/antigravity-stop-hook.js +515 -134
- package/dist/claude-hook.js +424 -81
- package/dist/claude-sessionstart-hook.js +392 -98
- package/dist/claude-stop-hook.js +515 -134
- package/dist/cline.js +218 -73
- package/dist/codex-hook.js +424 -81
- package/dist/codex-sessionstart-hook.js +392 -98
- package/dist/codex-stop-hook.js +515 -134
- package/dist/copilot-hook.js +424 -81
- package/dist/copilot-sessionstart-hook.js +392 -98
- package/dist/copilot-stop-hook.js +515 -134
- package/dist/cursor-hook.js +424 -81
- package/dist/cursor-sessionstart-hook.js +392 -98
- package/dist/cursor-stop-hook.js +515 -134
- package/dist/daemon-start.js +50 -9
- package/dist/dcode-hook.js +424 -81
- package/dist/dcode-sessionstart-hook.js +392 -98
- package/dist/dcode-stop-hook.js +515 -134
- package/dist/deepen.js +164 -27
- package/dist/devin-hook.js +424 -81
- package/dist/devin-sessionstart-hook.js +392 -98
- package/dist/devin-stop-hook.js +515 -134
- package/dist/droid-hook.js +2920 -0
- package/dist/droid-sessionstart-hook.js +3487 -0
- package/dist/droid-stop-hook.js +3188 -0
- package/dist/dsh.js +260 -109
- package/dist/grok-hook.js +424 -81
- package/dist/grok-sessionstart-hook.js +392 -98
- package/dist/grok-stop-hook.js +515 -134
- package/dist/hindsight-seed.js +56 -11
- package/dist/index.js +257 -110
- package/dist/installer.js +530 -223
- package/dist/kilo.js +257 -110
- package/dist/mcp-server.js +537 -146
- package/dist/opencode2.js +257 -110
- package/dist/pi.js +256 -109
- package/dist/prime-agent.js +256 -109
- package/dist/qwen-hook.js +424 -81
- package/dist/qwen-sessionstart-hook.js +392 -98
- package/dist/qwen-stop-hook.js +515 -134
- package/dist/status.js +128 -20
- package/dist/zcode-hook.js +2920 -0
- package/dist/zcode-sessionstart-hook.js +3487 -0
- package/dist/zcode-stop-hook.js +3188 -0
- package/package.json +11 -5
- package/plugin.json +1 -1
- package/skill/SKILL.md +42 -8
|
@@ -278,9 +278,13 @@ function isOptedIn(config, directory) {
|
|
|
278
278
|
const pathMap = config.mapPathToBank;
|
|
279
279
|
return Boolean(pathMap && directories.some((candidate) => mapLookup(pathMap, candidate)));
|
|
280
280
|
}
|
|
281
|
-
function
|
|
281
|
+
function mappedBank(config, directory, sessionRoot) {
|
|
282
282
|
const pathMap = config.mapPathToBank;
|
|
283
|
-
|
|
283
|
+
if (!directory || !pathMap) return void 0;
|
|
284
|
+
return lookupDirectories(config, directory, sessionRoot).map((candidate) => mapLookup(pathMap, candidate)).find((bank) => bank !== void 0);
|
|
285
|
+
}
|
|
286
|
+
function deriveBankId(config, directory, harness = "coding", sessionRoot) {
|
|
287
|
+
const mapped = mappedBank(config, directory, sessionRoot);
|
|
284
288
|
if (mapped) return mapped;
|
|
285
289
|
const dynamic = config.dynamicBankId ?? !config.bankId;
|
|
286
290
|
if (!dynamic) return config.bankId || DEFAULT_BANK_NAME;
|
|
@@ -307,6 +311,40 @@ function deriveBankIdOrSkip(config, directory, harness = "coding", sessionRoot)
|
|
|
307
311
|
}
|
|
308
312
|
}
|
|
309
313
|
|
|
314
|
+
// src/core/missions.ts
|
|
315
|
+
import { createHash } from "crypto";
|
|
316
|
+
var DEFAULT_PAGE_TRIGGER_CRON = "H * * * *";
|
|
317
|
+
var CRON_FIELD_RANGES = [
|
|
318
|
+
[0, 59],
|
|
319
|
+
// minute
|
|
320
|
+
[0, 23],
|
|
321
|
+
// hour
|
|
322
|
+
[1, 31],
|
|
323
|
+
// day of month
|
|
324
|
+
[1, 12],
|
|
325
|
+
// month
|
|
326
|
+
[0, 6]
|
|
327
|
+
// day of week
|
|
328
|
+
];
|
|
329
|
+
var HASHED_FIELD = /^H(?:\((\d+)-(\d+)\))?$/;
|
|
330
|
+
function isHashedCron(cron) {
|
|
331
|
+
return /(^|\s)H/.test(cron);
|
|
332
|
+
}
|
|
333
|
+
function parseHashedCron(cron) {
|
|
334
|
+
const fields = cron.trim().split(/\s+/);
|
|
335
|
+
if (fields.length !== CRON_FIELD_RANGES.length) return void 0;
|
|
336
|
+
for (const [i, field] of fields.entries()) {
|
|
337
|
+
if (!field.startsWith("H")) continue;
|
|
338
|
+
const m = HASHED_FIELD.exec(field);
|
|
339
|
+
if (!m) return void 0;
|
|
340
|
+
if (m[1] === void 0) continue;
|
|
341
|
+
const [lo, hi] = [Number(m[1]), Number(m[2])];
|
|
342
|
+
const [min, max] = CRON_FIELD_RANGES[i];
|
|
343
|
+
if (lo > hi || lo < min || hi > max) return void 0;
|
|
344
|
+
}
|
|
345
|
+
return fields;
|
|
346
|
+
}
|
|
347
|
+
|
|
310
348
|
// src/core/util.ts
|
|
311
349
|
import { accessSync, constants } from "fs";
|
|
312
350
|
import { delimiter, join as join5 } from "path";
|
|
@@ -320,16 +358,22 @@ var RETRY_AFTER_CEILING_MS = 60 * 1e3;
|
|
|
320
358
|
var CONFIG_PATH = process.env.HINDSIGHT_CONFIG || join6(homedir2(), ".hindsight", "coding-agent.json");
|
|
321
359
|
var DEFAULT_DAEMON_PORT = 9077;
|
|
322
360
|
var DEFAULT_DAEMON_PROFILE = "coding-agent";
|
|
323
|
-
function
|
|
324
|
-
if (raw.pageTriggerType === "manual") return "manual";
|
|
325
|
-
if (raw.pageTriggerType === "
|
|
326
|
-
|
|
361
|
+
function resolvePageTrigger(raw) {
|
|
362
|
+
if (raw.pageTriggerType === "manual") return { type: "manual" };
|
|
363
|
+
if (raw.pageTriggerType === "auto-refresh") return { type: "auto-refresh" };
|
|
364
|
+
if (raw.pageTriggerType !== void 0 && raw.pageTriggerType !== "cron")
|
|
327
365
|
log.warn(
|
|
328
366
|
"config",
|
|
329
|
-
|
|
367
|
+
`ignoring pageTriggerType=${JSON.stringify(raw.pageTriggerType)} \u2014 expected cron|auto-refresh|manual`
|
|
330
368
|
);
|
|
331
|
-
|
|
332
|
-
return "
|
|
369
|
+
const cron = raw.pageTriggerCron?.trim();
|
|
370
|
+
if (!cron) return { type: "cron", cron: DEFAULT_PAGE_TRIGGER_CRON };
|
|
371
|
+
if (!isHashedCron(cron) || parseHashedCron(cron)) return { type: "cron", cron };
|
|
372
|
+
log.warn(
|
|
373
|
+
"config",
|
|
374
|
+
`pageTriggerCron ${JSON.stringify(cron)} has a malformed hashed field \u2014 write \`H\` or \`H(<lo>-<hi>)\` within the field's own range, e.g. "H H(0-5) * * *" \u2014 falling back to ${JSON.stringify(DEFAULT_PAGE_TRIGGER_CRON)}`
|
|
375
|
+
);
|
|
376
|
+
return { type: "cron", cron: DEFAULT_PAGE_TRIGGER_CRON };
|
|
333
377
|
}
|
|
334
378
|
var DEFAULT_REFLECT_TOOL_TIMEOUT_MS = 33e4;
|
|
335
379
|
var REFLECT_BUDGETS = ["low", "mid", "high"];
|
|
@@ -361,6 +405,7 @@ function resolveObservationScopes(raw) {
|
|
|
361
405
|
function resolveConfig(raw = {}) {
|
|
362
406
|
const serverMode = ["cloud", "self-hosted", "daemon"].includes(raw.serverMode) ? raw.serverMode : "cloud";
|
|
363
407
|
const apiPort = raw.apiPort || DEFAULT_DAEMON_PORT;
|
|
408
|
+
const pageTrigger = resolvePageTrigger(raw);
|
|
364
409
|
return {
|
|
365
410
|
serverMode,
|
|
366
411
|
// Daemon mode resolves the URL HERE rather than at each call site: every entry point already
|
|
@@ -395,8 +440,8 @@ function resolveConfig(raw = {}) {
|
|
|
395
440
|
reflectBudget: resolveReflectBudget(raw),
|
|
396
441
|
autoReflect: raw.autoReflect ?? true,
|
|
397
442
|
pageRefreshEveryTurns: raw.pageRefreshEveryTurns || 10,
|
|
398
|
-
pageTriggerType:
|
|
399
|
-
pageTriggerCron:
|
|
443
|
+
pageTriggerType: pageTrigger.type,
|
|
444
|
+
pageTriggerCron: pageTrigger.cron,
|
|
400
445
|
autoSeed: raw.autoSeed ?? true,
|
|
401
446
|
seedLimit: raw.seedLimit || DEFAULT_SEED_LIMIT,
|
|
402
447
|
codebaseSurvey: raw.codebaseSurvey ?? true,
|