@legioncodeinc/honeycomb 0.1.4 → 0.1.6
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/.claude-plugin/marketplace.json +2 -2
- package/.claude-plugin/plugin.json +1 -1
- package/README.md +3 -4
- package/bundle/cli.js +223 -37
- package/daemon/dashboard-app.js +10 -10
- package/daemon/index.js +3068 -547
- package/embeddings/embed-daemon.js +1 -1
- package/harnesses/claude-code/.claude-plugin/plugin.json +1 -1
- package/harnesses/claude-code/bundle/capture.js +97 -26
- package/harnesses/claude-code/bundle/index.js +97 -26
- package/harnesses/claude-code/bundle/pre-tool-use.js +97 -26
- package/harnesses/claude-code/bundle/session-end.js +97 -26
- package/harnesses/claude-code/bundle/session-start.js +97 -26
- package/harnesses/codex/bundle/capture.js +97 -26
- package/harnesses/codex/bundle/index.js +97 -26
- package/harnesses/codex/bundle/pre-tool-use.js +97 -26
- package/harnesses/codex/bundle/session-start.js +97 -26
- package/harnesses/codex/package.json +1 -1
- package/harnesses/cursor/bundle/capture.js +97 -26
- package/harnesses/cursor/bundle/index.js +97 -26
- package/harnesses/cursor/bundle/pre-tool-use.js +97 -26
- package/harnesses/cursor/bundle/session-end.js +97 -26
- package/harnesses/cursor/bundle/session-start.js +97 -26
- package/harnesses/openclaw/dist/index.js +1 -1
- package/harnesses/openclaw/openclaw.plugin.json +1 -1
- package/harnesses/openclaw/package.json +1 -1
- package/mcp/bundle/server.js +1 -1
- package/package.json +1 -1
|
@@ -961,6 +961,7 @@ var VERB_TABLE = Object.freeze([
|
|
|
961
961
|
{ verb: "maintenance", cls: "storage", summary: "run version-history compaction over version-bumped tables (030)" },
|
|
962
962
|
{ verb: "remember", cls: "storage", summary: "write a memory through the daemon (--type fact|convention|preference|decision|gotcha|reference)" },
|
|
963
963
|
{ verb: "recall", cls: "storage", summary: "recall memories through the daemon" },
|
|
964
|
+
{ verb: "memory", cls: "storage", summary: "lifecycle: conflicts (list/resolve), stale-refs (list), inspect <id> --lifecycle (058d)" },
|
|
964
965
|
{ verb: "agent", cls: "storage", summary: "run an agent turn through the daemon" },
|
|
965
966
|
{ verb: "ontology", cls: "storage", summary: "inspect/propose ontology changes through the daemon" },
|
|
966
967
|
{ verb: "secret", cls: "storage", summary: "manage named secrets through the daemon" },
|
|
@@ -15807,7 +15808,88 @@ async function runCaptureGuarded(env, ctx, capture, onError) {
|
|
|
15807
15808
|
return decision;
|
|
15808
15809
|
}
|
|
15809
15810
|
|
|
15811
|
+
// dist/src/hooks/shared/project-resolver.js
|
|
15812
|
+
import { execFileSync } from "node:child_process";
|
|
15813
|
+
import { existsSync as existsSync6, mkdirSync as mkdirSync7, readFileSync as readFileSync9, writeFileSync as writeFileSync7 } from "node:fs";
|
|
15814
|
+
import { homedir as homedir8 } from "node:os";
|
|
15815
|
+
import { dirname as dirname6, join as join8, resolve as resolve3, sep } from "node:path";
|
|
15816
|
+
var UNSORTED_PROJECT_ID = "__unsorted__";
|
|
15817
|
+
var PROJECTS_CACHE_FILE_NAME = "projects.json";
|
|
15818
|
+
var PROJECTS_CACHE_SCHEMA_VERSION = 1;
|
|
15819
|
+
var ProjectsCacheSchema = external_exports.object({
|
|
15820
|
+
schemaVersion: external_exports.literal(PROJECTS_CACHE_SCHEMA_VERSION),
|
|
15821
|
+
org: external_exports.string(),
|
|
15822
|
+
workspace: external_exports.string(),
|
|
15823
|
+
bindings: external_exports.array(external_exports.object({
|
|
15824
|
+
path: external_exports.string(),
|
|
15825
|
+
projectId: external_exports.string()
|
|
15826
|
+
})),
|
|
15827
|
+
projects: external_exports.array(external_exports.object({
|
|
15828
|
+
projectId: external_exports.string(),
|
|
15829
|
+
name: external_exports.string(),
|
|
15830
|
+
remoteSignal: external_exports.string(),
|
|
15831
|
+
boundPaths: external_exports.array(external_exports.string())
|
|
15832
|
+
}))
|
|
15833
|
+
});
|
|
15834
|
+
function emptyProjectsCache(org = "", workspace = "") {
|
|
15835
|
+
return { schemaVersion: PROJECTS_CACHE_SCHEMA_VERSION, org, workspace, bindings: [], projects: [] };
|
|
15836
|
+
}
|
|
15837
|
+
function projectsCacheDir(dir) {
|
|
15838
|
+
return dir ?? join8(homedir8(), CREDENTIALS_DIR_NAME);
|
|
15839
|
+
}
|
|
15840
|
+
function projectsCachePath(dir) {
|
|
15841
|
+
return join8(projectsCacheDir(dir), PROJECTS_CACHE_FILE_NAME);
|
|
15842
|
+
}
|
|
15843
|
+
function loadProjectsCache(dir) {
|
|
15844
|
+
const path = projectsCachePath(dir);
|
|
15845
|
+
if (!existsSync6(path))
|
|
15846
|
+
return emptyProjectsCache();
|
|
15847
|
+
let raw;
|
|
15848
|
+
try {
|
|
15849
|
+
raw = readFileSync9(path, "utf8");
|
|
15850
|
+
} catch {
|
|
15851
|
+
return emptyProjectsCache();
|
|
15852
|
+
}
|
|
15853
|
+
let parsed;
|
|
15854
|
+
try {
|
|
15855
|
+
parsed = JSON.parse(raw);
|
|
15856
|
+
} catch {
|
|
15857
|
+
return emptyProjectsCache();
|
|
15858
|
+
}
|
|
15859
|
+
const result = ProjectsCacheSchema.safeParse(parsed);
|
|
15860
|
+
if (!result.success) {
|
|
15861
|
+
return emptyProjectsCache();
|
|
15862
|
+
}
|
|
15863
|
+
return result.data;
|
|
15864
|
+
}
|
|
15865
|
+
function hasBoundProject(cache) {
|
|
15866
|
+
return cache.bindings.some((b) => b.projectId.length > 0 && b.projectId !== UNSORTED_PROJECT_ID);
|
|
15867
|
+
}
|
|
15868
|
+
function hasBoundProjectOnDisk(input) {
|
|
15869
|
+
const loaded = loadProjectsCache(input.dir);
|
|
15870
|
+
const cache = input.workspace !== void 0 && loaded.workspace.length > 0 && loaded.workspace !== input.workspace ? emptyProjectsCache(loaded.org, loaded.workspace) : loaded;
|
|
15871
|
+
return hasBoundProject(cache);
|
|
15872
|
+
}
|
|
15873
|
+
|
|
15810
15874
|
// dist/src/hooks/shared/session-start.js
|
|
15875
|
+
var BIND_PROJECT_NOTICE = 'Honeycomb is paused: no project is bound to this workspace yet, so nothing is being captured. Bind a folder to start \u2014 open the Honeycomb dashboard and pick a folder, or run "honeycomb project bind" in the folder you want Honeycomb to remember.';
|
|
15876
|
+
function createOnboardingNoticeGate(dir) {
|
|
15877
|
+
return {
|
|
15878
|
+
hasBoundProject(_meta, credential) {
|
|
15879
|
+
if (credential === void 0 || credential.token === void 0 || credential.token.length === 0) {
|
|
15880
|
+
return true;
|
|
15881
|
+
}
|
|
15882
|
+
try {
|
|
15883
|
+
return hasBoundProjectOnDisk({
|
|
15884
|
+
...credential.workspace !== void 0 ? { workspace: credential.workspace } : {},
|
|
15885
|
+
...dir !== void 0 ? { dir } : {}
|
|
15886
|
+
});
|
|
15887
|
+
} catch {
|
|
15888
|
+
return true;
|
|
15889
|
+
}
|
|
15890
|
+
}
|
|
15891
|
+
};
|
|
15892
|
+
}
|
|
15811
15893
|
async function runSessionStart(input, deps) {
|
|
15812
15894
|
const seams = deps.seams ?? createNoopSessionStartSeams();
|
|
15813
15895
|
const meta3 = input.meta;
|
|
@@ -15821,7 +15903,8 @@ async function runSessionStart(input, deps) {
|
|
|
15821
15903
|
}
|
|
15822
15904
|
const contextBlock = await safe(() => deps.context.render({ meta: meta3, runtimePath: input.runtimePath, credential }), "");
|
|
15823
15905
|
const primeBlock = deps.prime !== void 0 ? await safe(() => deps.prime.render({ meta: meta3, runtimePath: input.runtimePath, credential }), "") : "";
|
|
15824
|
-
const
|
|
15906
|
+
const noticeBlock = await safe(() => Promise.resolve(renderOnboardingNotice(deps.onboardingNotice, meta3, credential)), "");
|
|
15907
|
+
const additionalContext = joinBlocks(noticeBlock, joinBlocks(contextBlock, primeBlock));
|
|
15825
15908
|
await safeVoid(() => seams.autoPullSkills(credential));
|
|
15826
15909
|
await safeVoid(() => seams.autoPullAssets(credential));
|
|
15827
15910
|
await safeVoid(() => seams.spawnGraphPull(meta3));
|
|
@@ -15836,6 +15919,15 @@ function joinBlocks(context, prime) {
|
|
|
15836
15919
|
|
|
15837
15920
|
${prime}`;
|
|
15838
15921
|
}
|
|
15922
|
+
function renderOnboardingNotice(gate, meta3, credential) {
|
|
15923
|
+
if (gate === void 0)
|
|
15924
|
+
return "";
|
|
15925
|
+
try {
|
|
15926
|
+
return gate.hasBoundProject(meta3, credential) ? "" : BIND_PROJECT_NOTICE;
|
|
15927
|
+
} catch {
|
|
15928
|
+
return "";
|
|
15929
|
+
}
|
|
15930
|
+
}
|
|
15839
15931
|
async function safe(fn, fallback) {
|
|
15840
15932
|
try {
|
|
15841
15933
|
return await fn();
|
|
@@ -16189,28 +16281,6 @@ async function parseJson2(res) {
|
|
|
16189
16281
|
}
|
|
16190
16282
|
}
|
|
16191
16283
|
|
|
16192
|
-
// dist/src/hooks/shared/project-resolver.js
|
|
16193
|
-
import { execFileSync } from "node:child_process";
|
|
16194
|
-
import { existsSync as existsSync6, mkdirSync as mkdirSync7, readFileSync as readFileSync9, writeFileSync as writeFileSync7 } from "node:fs";
|
|
16195
|
-
import { homedir as homedir8 } from "node:os";
|
|
16196
|
-
import { dirname as dirname6, join as join8, resolve as resolve3, sep } from "node:path";
|
|
16197
|
-
var PROJECTS_CACHE_SCHEMA_VERSION = 1;
|
|
16198
|
-
var ProjectsCacheSchema = external_exports.object({
|
|
16199
|
-
schemaVersion: external_exports.literal(PROJECTS_CACHE_SCHEMA_VERSION),
|
|
16200
|
-
org: external_exports.string(),
|
|
16201
|
-
workspace: external_exports.string(),
|
|
16202
|
-
bindings: external_exports.array(external_exports.object({
|
|
16203
|
-
path: external_exports.string(),
|
|
16204
|
-
projectId: external_exports.string()
|
|
16205
|
-
})),
|
|
16206
|
-
projects: external_exports.array(external_exports.object({
|
|
16207
|
-
projectId: external_exports.string(),
|
|
16208
|
-
name: external_exports.string(),
|
|
16209
|
-
remoteSignal: external_exports.string(),
|
|
16210
|
-
boundPaths: external_exports.array(external_exports.string())
|
|
16211
|
-
}))
|
|
16212
|
-
});
|
|
16213
|
-
|
|
16214
16284
|
// dist/src/hooks/runtime.js
|
|
16215
16285
|
var NOTIFICATIONS_ENDPOINT = "/api/diagnostics/notifications";
|
|
16216
16286
|
function createHookRuntime(options = {}) {
|
|
@@ -16226,6 +16296,7 @@ function createHookRuntime(options = {}) {
|
|
|
16226
16296
|
const summarySpawn = options.summarySpawn ?? noopSummarySpawn;
|
|
16227
16297
|
const captureEnv = { captureFlag: options.captureFlag ?? process.env.HONEYCOMB_CAPTURE };
|
|
16228
16298
|
const seams = options.seams ?? createSessionStartSeams({ credentials, host, port, fetch: doFetch });
|
|
16299
|
+
const onboardingNotice = options.onboardingNotice ?? createOnboardingNoticeGate();
|
|
16229
16300
|
return {
|
|
16230
16301
|
deps,
|
|
16231
16302
|
notifications,
|
|
@@ -16234,15 +16305,15 @@ function createHookRuntime(options = {}) {
|
|
|
16234
16305
|
if (input === void 0) {
|
|
16235
16306
|
return { result: { ok: true }, dropped: true };
|
|
16236
16307
|
}
|
|
16237
|
-
return dispatchLifecycle(input, deps, captureEnv, notifications, summarySpawn, prime, seams);
|
|
16308
|
+
return dispatchLifecycle(input, deps, captureEnv, notifications, summarySpawn, prime, seams, onboardingNotice);
|
|
16238
16309
|
}
|
|
16239
16310
|
};
|
|
16240
16311
|
}
|
|
16241
|
-
async function dispatchLifecycle(input, deps, captureEnv, notifications, summarySpawn, prime, seams) {
|
|
16312
|
+
async function dispatchLifecycle(input, deps, captureEnv, notifications, summarySpawn, prime, seams, onboardingNotice) {
|
|
16242
16313
|
try {
|
|
16243
16314
|
switch (input.event) {
|
|
16244
16315
|
case "session-start": {
|
|
16245
|
-
const sessionDeps = { ...deps, captureEnv, prime, seams };
|
|
16316
|
+
const sessionDeps = { ...deps, captureEnv, prime, seams, onboardingNotice };
|
|
16246
16317
|
const result = await runSessionStart(input, sessionDeps);
|
|
16247
16318
|
const drain = await drainNotificationsSoft(notifications);
|
|
16248
16319
|
return { result, drain };
|
|
@@ -961,6 +961,7 @@ var VERB_TABLE = Object.freeze([
|
|
|
961
961
|
{ verb: "maintenance", cls: "storage", summary: "run version-history compaction over version-bumped tables (030)" },
|
|
962
962
|
{ verb: "remember", cls: "storage", summary: "write a memory through the daemon (--type fact|convention|preference|decision|gotcha|reference)" },
|
|
963
963
|
{ verb: "recall", cls: "storage", summary: "recall memories through the daemon" },
|
|
964
|
+
{ verb: "memory", cls: "storage", summary: "lifecycle: conflicts (list/resolve), stale-refs (list), inspect <id> --lifecycle (058d)" },
|
|
964
965
|
{ verb: "agent", cls: "storage", summary: "run an agent turn through the daemon" },
|
|
965
966
|
{ verb: "ontology", cls: "storage", summary: "inspect/propose ontology changes through the daemon" },
|
|
966
967
|
{ verb: "secret", cls: "storage", summary: "manage named secrets through the daemon" },
|
|
@@ -15807,7 +15808,88 @@ async function runCaptureGuarded(env, ctx, capture, onError) {
|
|
|
15807
15808
|
return decision;
|
|
15808
15809
|
}
|
|
15809
15810
|
|
|
15811
|
+
// dist/src/hooks/shared/project-resolver.js
|
|
15812
|
+
import { execFileSync } from "node:child_process";
|
|
15813
|
+
import { existsSync as existsSync6, mkdirSync as mkdirSync7, readFileSync as readFileSync9, writeFileSync as writeFileSync7 } from "node:fs";
|
|
15814
|
+
import { homedir as homedir8 } from "node:os";
|
|
15815
|
+
import { dirname as dirname6, join as join8, resolve as resolve3, sep } from "node:path";
|
|
15816
|
+
var UNSORTED_PROJECT_ID = "__unsorted__";
|
|
15817
|
+
var PROJECTS_CACHE_FILE_NAME = "projects.json";
|
|
15818
|
+
var PROJECTS_CACHE_SCHEMA_VERSION = 1;
|
|
15819
|
+
var ProjectsCacheSchema = external_exports.object({
|
|
15820
|
+
schemaVersion: external_exports.literal(PROJECTS_CACHE_SCHEMA_VERSION),
|
|
15821
|
+
org: external_exports.string(),
|
|
15822
|
+
workspace: external_exports.string(),
|
|
15823
|
+
bindings: external_exports.array(external_exports.object({
|
|
15824
|
+
path: external_exports.string(),
|
|
15825
|
+
projectId: external_exports.string()
|
|
15826
|
+
})),
|
|
15827
|
+
projects: external_exports.array(external_exports.object({
|
|
15828
|
+
projectId: external_exports.string(),
|
|
15829
|
+
name: external_exports.string(),
|
|
15830
|
+
remoteSignal: external_exports.string(),
|
|
15831
|
+
boundPaths: external_exports.array(external_exports.string())
|
|
15832
|
+
}))
|
|
15833
|
+
});
|
|
15834
|
+
function emptyProjectsCache(org = "", workspace = "") {
|
|
15835
|
+
return { schemaVersion: PROJECTS_CACHE_SCHEMA_VERSION, org, workspace, bindings: [], projects: [] };
|
|
15836
|
+
}
|
|
15837
|
+
function projectsCacheDir(dir) {
|
|
15838
|
+
return dir ?? join8(homedir8(), CREDENTIALS_DIR_NAME);
|
|
15839
|
+
}
|
|
15840
|
+
function projectsCachePath(dir) {
|
|
15841
|
+
return join8(projectsCacheDir(dir), PROJECTS_CACHE_FILE_NAME);
|
|
15842
|
+
}
|
|
15843
|
+
function loadProjectsCache(dir) {
|
|
15844
|
+
const path = projectsCachePath(dir);
|
|
15845
|
+
if (!existsSync6(path))
|
|
15846
|
+
return emptyProjectsCache();
|
|
15847
|
+
let raw;
|
|
15848
|
+
try {
|
|
15849
|
+
raw = readFileSync9(path, "utf8");
|
|
15850
|
+
} catch {
|
|
15851
|
+
return emptyProjectsCache();
|
|
15852
|
+
}
|
|
15853
|
+
let parsed;
|
|
15854
|
+
try {
|
|
15855
|
+
parsed = JSON.parse(raw);
|
|
15856
|
+
} catch {
|
|
15857
|
+
return emptyProjectsCache();
|
|
15858
|
+
}
|
|
15859
|
+
const result = ProjectsCacheSchema.safeParse(parsed);
|
|
15860
|
+
if (!result.success) {
|
|
15861
|
+
return emptyProjectsCache();
|
|
15862
|
+
}
|
|
15863
|
+
return result.data;
|
|
15864
|
+
}
|
|
15865
|
+
function hasBoundProject(cache) {
|
|
15866
|
+
return cache.bindings.some((b) => b.projectId.length > 0 && b.projectId !== UNSORTED_PROJECT_ID);
|
|
15867
|
+
}
|
|
15868
|
+
function hasBoundProjectOnDisk(input) {
|
|
15869
|
+
const loaded = loadProjectsCache(input.dir);
|
|
15870
|
+
const cache = input.workspace !== void 0 && loaded.workspace.length > 0 && loaded.workspace !== input.workspace ? emptyProjectsCache(loaded.org, loaded.workspace) : loaded;
|
|
15871
|
+
return hasBoundProject(cache);
|
|
15872
|
+
}
|
|
15873
|
+
|
|
15810
15874
|
// dist/src/hooks/shared/session-start.js
|
|
15875
|
+
var BIND_PROJECT_NOTICE = 'Honeycomb is paused: no project is bound to this workspace yet, so nothing is being captured. Bind a folder to start \u2014 open the Honeycomb dashboard and pick a folder, or run "honeycomb project bind" in the folder you want Honeycomb to remember.';
|
|
15876
|
+
function createOnboardingNoticeGate(dir) {
|
|
15877
|
+
return {
|
|
15878
|
+
hasBoundProject(_meta, credential) {
|
|
15879
|
+
if (credential === void 0 || credential.token === void 0 || credential.token.length === 0) {
|
|
15880
|
+
return true;
|
|
15881
|
+
}
|
|
15882
|
+
try {
|
|
15883
|
+
return hasBoundProjectOnDisk({
|
|
15884
|
+
...credential.workspace !== void 0 ? { workspace: credential.workspace } : {},
|
|
15885
|
+
...dir !== void 0 ? { dir } : {}
|
|
15886
|
+
});
|
|
15887
|
+
} catch {
|
|
15888
|
+
return true;
|
|
15889
|
+
}
|
|
15890
|
+
}
|
|
15891
|
+
};
|
|
15892
|
+
}
|
|
15811
15893
|
async function runSessionStart(input, deps) {
|
|
15812
15894
|
const seams = deps.seams ?? createNoopSessionStartSeams();
|
|
15813
15895
|
const meta3 = input.meta;
|
|
@@ -15821,7 +15903,8 @@ async function runSessionStart(input, deps) {
|
|
|
15821
15903
|
}
|
|
15822
15904
|
const contextBlock = await safe(() => deps.context.render({ meta: meta3, runtimePath: input.runtimePath, credential }), "");
|
|
15823
15905
|
const primeBlock = deps.prime !== void 0 ? await safe(() => deps.prime.render({ meta: meta3, runtimePath: input.runtimePath, credential }), "") : "";
|
|
15824
|
-
const
|
|
15906
|
+
const noticeBlock = await safe(() => Promise.resolve(renderOnboardingNotice(deps.onboardingNotice, meta3, credential)), "");
|
|
15907
|
+
const additionalContext = joinBlocks(noticeBlock, joinBlocks(contextBlock, primeBlock));
|
|
15825
15908
|
await safeVoid(() => seams.autoPullSkills(credential));
|
|
15826
15909
|
await safeVoid(() => seams.autoPullAssets(credential));
|
|
15827
15910
|
await safeVoid(() => seams.spawnGraphPull(meta3));
|
|
@@ -15836,6 +15919,15 @@ function joinBlocks(context, prime) {
|
|
|
15836
15919
|
|
|
15837
15920
|
${prime}`;
|
|
15838
15921
|
}
|
|
15922
|
+
function renderOnboardingNotice(gate, meta3, credential) {
|
|
15923
|
+
if (gate === void 0)
|
|
15924
|
+
return "";
|
|
15925
|
+
try {
|
|
15926
|
+
return gate.hasBoundProject(meta3, credential) ? "" : BIND_PROJECT_NOTICE;
|
|
15927
|
+
} catch {
|
|
15928
|
+
return "";
|
|
15929
|
+
}
|
|
15930
|
+
}
|
|
15839
15931
|
async function safe(fn, fallback) {
|
|
15840
15932
|
try {
|
|
15841
15933
|
return await fn();
|
|
@@ -16189,28 +16281,6 @@ async function parseJson2(res) {
|
|
|
16189
16281
|
}
|
|
16190
16282
|
}
|
|
16191
16283
|
|
|
16192
|
-
// dist/src/hooks/shared/project-resolver.js
|
|
16193
|
-
import { execFileSync } from "node:child_process";
|
|
16194
|
-
import { existsSync as existsSync6, mkdirSync as mkdirSync7, readFileSync as readFileSync9, writeFileSync as writeFileSync7 } from "node:fs";
|
|
16195
|
-
import { homedir as homedir8 } from "node:os";
|
|
16196
|
-
import { dirname as dirname6, join as join8, resolve as resolve3, sep } from "node:path";
|
|
16197
|
-
var PROJECTS_CACHE_SCHEMA_VERSION = 1;
|
|
16198
|
-
var ProjectsCacheSchema = external_exports.object({
|
|
16199
|
-
schemaVersion: external_exports.literal(PROJECTS_CACHE_SCHEMA_VERSION),
|
|
16200
|
-
org: external_exports.string(),
|
|
16201
|
-
workspace: external_exports.string(),
|
|
16202
|
-
bindings: external_exports.array(external_exports.object({
|
|
16203
|
-
path: external_exports.string(),
|
|
16204
|
-
projectId: external_exports.string()
|
|
16205
|
-
})),
|
|
16206
|
-
projects: external_exports.array(external_exports.object({
|
|
16207
|
-
projectId: external_exports.string(),
|
|
16208
|
-
name: external_exports.string(),
|
|
16209
|
-
remoteSignal: external_exports.string(),
|
|
16210
|
-
boundPaths: external_exports.array(external_exports.string())
|
|
16211
|
-
}))
|
|
16212
|
-
});
|
|
16213
|
-
|
|
16214
16284
|
// dist/src/hooks/runtime.js
|
|
16215
16285
|
var NOTIFICATIONS_ENDPOINT = "/api/diagnostics/notifications";
|
|
16216
16286
|
function createHookRuntime(options = {}) {
|
|
@@ -16226,6 +16296,7 @@ function createHookRuntime(options = {}) {
|
|
|
16226
16296
|
const summarySpawn = options.summarySpawn ?? noopSummarySpawn;
|
|
16227
16297
|
const captureEnv = { captureFlag: options.captureFlag ?? process.env.HONEYCOMB_CAPTURE };
|
|
16228
16298
|
const seams = options.seams ?? createSessionStartSeams({ credentials, host, port, fetch: doFetch });
|
|
16299
|
+
const onboardingNotice = options.onboardingNotice ?? createOnboardingNoticeGate();
|
|
16229
16300
|
return {
|
|
16230
16301
|
deps,
|
|
16231
16302
|
notifications,
|
|
@@ -16234,15 +16305,15 @@ function createHookRuntime(options = {}) {
|
|
|
16234
16305
|
if (input === void 0) {
|
|
16235
16306
|
return { result: { ok: true }, dropped: true };
|
|
16236
16307
|
}
|
|
16237
|
-
return dispatchLifecycle(input, deps, captureEnv, notifications, summarySpawn, prime, seams);
|
|
16308
|
+
return dispatchLifecycle(input, deps, captureEnv, notifications, summarySpawn, prime, seams, onboardingNotice);
|
|
16238
16309
|
}
|
|
16239
16310
|
};
|
|
16240
16311
|
}
|
|
16241
|
-
async function dispatchLifecycle(input, deps, captureEnv, notifications, summarySpawn, prime, seams) {
|
|
16312
|
+
async function dispatchLifecycle(input, deps, captureEnv, notifications, summarySpawn, prime, seams, onboardingNotice) {
|
|
16242
16313
|
try {
|
|
16243
16314
|
switch (input.event) {
|
|
16244
16315
|
case "session-start": {
|
|
16245
|
-
const sessionDeps = { ...deps, captureEnv, prime, seams };
|
|
16316
|
+
const sessionDeps = { ...deps, captureEnv, prime, seams, onboardingNotice };
|
|
16246
16317
|
const result = await runSessionStart(input, sessionDeps);
|
|
16247
16318
|
const drain = await drainNotificationsSoft(notifications);
|
|
16248
16319
|
return { result, drain };
|
|
@@ -961,6 +961,7 @@ var VERB_TABLE = Object.freeze([
|
|
|
961
961
|
{ verb: "maintenance", cls: "storage", summary: "run version-history compaction over version-bumped tables (030)" },
|
|
962
962
|
{ verb: "remember", cls: "storage", summary: "write a memory through the daemon (--type fact|convention|preference|decision|gotcha|reference)" },
|
|
963
963
|
{ verb: "recall", cls: "storage", summary: "recall memories through the daemon" },
|
|
964
|
+
{ verb: "memory", cls: "storage", summary: "lifecycle: conflicts (list/resolve), stale-refs (list), inspect <id> --lifecycle (058d)" },
|
|
964
965
|
{ verb: "agent", cls: "storage", summary: "run an agent turn through the daemon" },
|
|
965
966
|
{ verb: "ontology", cls: "storage", summary: "inspect/propose ontology changes through the daemon" },
|
|
966
967
|
{ verb: "secret", cls: "storage", summary: "manage named secrets through the daemon" },
|
|
@@ -15807,7 +15808,88 @@ async function runCaptureGuarded(env, ctx, capture, onError) {
|
|
|
15807
15808
|
return decision;
|
|
15808
15809
|
}
|
|
15809
15810
|
|
|
15811
|
+
// dist/src/hooks/shared/project-resolver.js
|
|
15812
|
+
import { execFileSync } from "node:child_process";
|
|
15813
|
+
import { existsSync as existsSync6, mkdirSync as mkdirSync7, readFileSync as readFileSync9, writeFileSync as writeFileSync7 } from "node:fs";
|
|
15814
|
+
import { homedir as homedir8 } from "node:os";
|
|
15815
|
+
import { dirname as dirname6, join as join8, resolve as resolve3, sep } from "node:path";
|
|
15816
|
+
var UNSORTED_PROJECT_ID = "__unsorted__";
|
|
15817
|
+
var PROJECTS_CACHE_FILE_NAME = "projects.json";
|
|
15818
|
+
var PROJECTS_CACHE_SCHEMA_VERSION = 1;
|
|
15819
|
+
var ProjectsCacheSchema = external_exports.object({
|
|
15820
|
+
schemaVersion: external_exports.literal(PROJECTS_CACHE_SCHEMA_VERSION),
|
|
15821
|
+
org: external_exports.string(),
|
|
15822
|
+
workspace: external_exports.string(),
|
|
15823
|
+
bindings: external_exports.array(external_exports.object({
|
|
15824
|
+
path: external_exports.string(),
|
|
15825
|
+
projectId: external_exports.string()
|
|
15826
|
+
})),
|
|
15827
|
+
projects: external_exports.array(external_exports.object({
|
|
15828
|
+
projectId: external_exports.string(),
|
|
15829
|
+
name: external_exports.string(),
|
|
15830
|
+
remoteSignal: external_exports.string(),
|
|
15831
|
+
boundPaths: external_exports.array(external_exports.string())
|
|
15832
|
+
}))
|
|
15833
|
+
});
|
|
15834
|
+
function emptyProjectsCache(org = "", workspace = "") {
|
|
15835
|
+
return { schemaVersion: PROJECTS_CACHE_SCHEMA_VERSION, org, workspace, bindings: [], projects: [] };
|
|
15836
|
+
}
|
|
15837
|
+
function projectsCacheDir(dir) {
|
|
15838
|
+
return dir ?? join8(homedir8(), CREDENTIALS_DIR_NAME);
|
|
15839
|
+
}
|
|
15840
|
+
function projectsCachePath(dir) {
|
|
15841
|
+
return join8(projectsCacheDir(dir), PROJECTS_CACHE_FILE_NAME);
|
|
15842
|
+
}
|
|
15843
|
+
function loadProjectsCache(dir) {
|
|
15844
|
+
const path = projectsCachePath(dir);
|
|
15845
|
+
if (!existsSync6(path))
|
|
15846
|
+
return emptyProjectsCache();
|
|
15847
|
+
let raw;
|
|
15848
|
+
try {
|
|
15849
|
+
raw = readFileSync9(path, "utf8");
|
|
15850
|
+
} catch {
|
|
15851
|
+
return emptyProjectsCache();
|
|
15852
|
+
}
|
|
15853
|
+
let parsed;
|
|
15854
|
+
try {
|
|
15855
|
+
parsed = JSON.parse(raw);
|
|
15856
|
+
} catch {
|
|
15857
|
+
return emptyProjectsCache();
|
|
15858
|
+
}
|
|
15859
|
+
const result = ProjectsCacheSchema.safeParse(parsed);
|
|
15860
|
+
if (!result.success) {
|
|
15861
|
+
return emptyProjectsCache();
|
|
15862
|
+
}
|
|
15863
|
+
return result.data;
|
|
15864
|
+
}
|
|
15865
|
+
function hasBoundProject(cache) {
|
|
15866
|
+
return cache.bindings.some((b) => b.projectId.length > 0 && b.projectId !== UNSORTED_PROJECT_ID);
|
|
15867
|
+
}
|
|
15868
|
+
function hasBoundProjectOnDisk(input) {
|
|
15869
|
+
const loaded = loadProjectsCache(input.dir);
|
|
15870
|
+
const cache = input.workspace !== void 0 && loaded.workspace.length > 0 && loaded.workspace !== input.workspace ? emptyProjectsCache(loaded.org, loaded.workspace) : loaded;
|
|
15871
|
+
return hasBoundProject(cache);
|
|
15872
|
+
}
|
|
15873
|
+
|
|
15810
15874
|
// dist/src/hooks/shared/session-start.js
|
|
15875
|
+
var BIND_PROJECT_NOTICE = 'Honeycomb is paused: no project is bound to this workspace yet, so nothing is being captured. Bind a folder to start \u2014 open the Honeycomb dashboard and pick a folder, or run "honeycomb project bind" in the folder you want Honeycomb to remember.';
|
|
15876
|
+
function createOnboardingNoticeGate(dir) {
|
|
15877
|
+
return {
|
|
15878
|
+
hasBoundProject(_meta, credential) {
|
|
15879
|
+
if (credential === void 0 || credential.token === void 0 || credential.token.length === 0) {
|
|
15880
|
+
return true;
|
|
15881
|
+
}
|
|
15882
|
+
try {
|
|
15883
|
+
return hasBoundProjectOnDisk({
|
|
15884
|
+
...credential.workspace !== void 0 ? { workspace: credential.workspace } : {},
|
|
15885
|
+
...dir !== void 0 ? { dir } : {}
|
|
15886
|
+
});
|
|
15887
|
+
} catch {
|
|
15888
|
+
return true;
|
|
15889
|
+
}
|
|
15890
|
+
}
|
|
15891
|
+
};
|
|
15892
|
+
}
|
|
15811
15893
|
async function runSessionStart(input, deps) {
|
|
15812
15894
|
const seams = deps.seams ?? createNoopSessionStartSeams();
|
|
15813
15895
|
const meta3 = input.meta;
|
|
@@ -15821,7 +15903,8 @@ async function runSessionStart(input, deps) {
|
|
|
15821
15903
|
}
|
|
15822
15904
|
const contextBlock = await safe(() => deps.context.render({ meta: meta3, runtimePath: input.runtimePath, credential }), "");
|
|
15823
15905
|
const primeBlock = deps.prime !== void 0 ? await safe(() => deps.prime.render({ meta: meta3, runtimePath: input.runtimePath, credential }), "") : "";
|
|
15824
|
-
const
|
|
15906
|
+
const noticeBlock = await safe(() => Promise.resolve(renderOnboardingNotice(deps.onboardingNotice, meta3, credential)), "");
|
|
15907
|
+
const additionalContext = joinBlocks(noticeBlock, joinBlocks(contextBlock, primeBlock));
|
|
15825
15908
|
await safeVoid(() => seams.autoPullSkills(credential));
|
|
15826
15909
|
await safeVoid(() => seams.autoPullAssets(credential));
|
|
15827
15910
|
await safeVoid(() => seams.spawnGraphPull(meta3));
|
|
@@ -15836,6 +15919,15 @@ function joinBlocks(context, prime) {
|
|
|
15836
15919
|
|
|
15837
15920
|
${prime}`;
|
|
15838
15921
|
}
|
|
15922
|
+
function renderOnboardingNotice(gate, meta3, credential) {
|
|
15923
|
+
if (gate === void 0)
|
|
15924
|
+
return "";
|
|
15925
|
+
try {
|
|
15926
|
+
return gate.hasBoundProject(meta3, credential) ? "" : BIND_PROJECT_NOTICE;
|
|
15927
|
+
} catch {
|
|
15928
|
+
return "";
|
|
15929
|
+
}
|
|
15930
|
+
}
|
|
15839
15931
|
async function safe(fn, fallback) {
|
|
15840
15932
|
try {
|
|
15841
15933
|
return await fn();
|
|
@@ -16189,28 +16281,6 @@ async function parseJson2(res) {
|
|
|
16189
16281
|
}
|
|
16190
16282
|
}
|
|
16191
16283
|
|
|
16192
|
-
// dist/src/hooks/shared/project-resolver.js
|
|
16193
|
-
import { execFileSync } from "node:child_process";
|
|
16194
|
-
import { existsSync as existsSync6, mkdirSync as mkdirSync7, readFileSync as readFileSync9, writeFileSync as writeFileSync7 } from "node:fs";
|
|
16195
|
-
import { homedir as homedir8 } from "node:os";
|
|
16196
|
-
import { dirname as dirname6, join as join8, resolve as resolve3, sep } from "node:path";
|
|
16197
|
-
var PROJECTS_CACHE_SCHEMA_VERSION = 1;
|
|
16198
|
-
var ProjectsCacheSchema = external_exports.object({
|
|
16199
|
-
schemaVersion: external_exports.literal(PROJECTS_CACHE_SCHEMA_VERSION),
|
|
16200
|
-
org: external_exports.string(),
|
|
16201
|
-
workspace: external_exports.string(),
|
|
16202
|
-
bindings: external_exports.array(external_exports.object({
|
|
16203
|
-
path: external_exports.string(),
|
|
16204
|
-
projectId: external_exports.string()
|
|
16205
|
-
})),
|
|
16206
|
-
projects: external_exports.array(external_exports.object({
|
|
16207
|
-
projectId: external_exports.string(),
|
|
16208
|
-
name: external_exports.string(),
|
|
16209
|
-
remoteSignal: external_exports.string(),
|
|
16210
|
-
boundPaths: external_exports.array(external_exports.string())
|
|
16211
|
-
}))
|
|
16212
|
-
});
|
|
16213
|
-
|
|
16214
16284
|
// dist/src/hooks/runtime.js
|
|
16215
16285
|
var NOTIFICATIONS_ENDPOINT = "/api/diagnostics/notifications";
|
|
16216
16286
|
function createHookRuntime(options = {}) {
|
|
@@ -16226,6 +16296,7 @@ function createHookRuntime(options = {}) {
|
|
|
16226
16296
|
const summarySpawn = options.summarySpawn ?? noopSummarySpawn;
|
|
16227
16297
|
const captureEnv = { captureFlag: options.captureFlag ?? process.env.HONEYCOMB_CAPTURE };
|
|
16228
16298
|
const seams = options.seams ?? createSessionStartSeams({ credentials, host, port, fetch: doFetch });
|
|
16299
|
+
const onboardingNotice = options.onboardingNotice ?? createOnboardingNoticeGate();
|
|
16229
16300
|
return {
|
|
16230
16301
|
deps,
|
|
16231
16302
|
notifications,
|
|
@@ -16234,15 +16305,15 @@ function createHookRuntime(options = {}) {
|
|
|
16234
16305
|
if (input === void 0) {
|
|
16235
16306
|
return { result: { ok: true }, dropped: true };
|
|
16236
16307
|
}
|
|
16237
|
-
return dispatchLifecycle(input, deps, captureEnv, notifications, summarySpawn, prime, seams);
|
|
16308
|
+
return dispatchLifecycle(input, deps, captureEnv, notifications, summarySpawn, prime, seams, onboardingNotice);
|
|
16238
16309
|
}
|
|
16239
16310
|
};
|
|
16240
16311
|
}
|
|
16241
|
-
async function dispatchLifecycle(input, deps, captureEnv, notifications, summarySpawn, prime, seams) {
|
|
16312
|
+
async function dispatchLifecycle(input, deps, captureEnv, notifications, summarySpawn, prime, seams, onboardingNotice) {
|
|
16242
16313
|
try {
|
|
16243
16314
|
switch (input.event) {
|
|
16244
16315
|
case "session-start": {
|
|
16245
|
-
const sessionDeps = { ...deps, captureEnv, prime, seams };
|
|
16316
|
+
const sessionDeps = { ...deps, captureEnv, prime, seams, onboardingNotice };
|
|
16246
16317
|
const result = await runSessionStart(input, sessionDeps);
|
|
16247
16318
|
const drain = await drainNotificationsSoft(notifications);
|
|
16248
16319
|
return { result, drain };
|