@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.
@@ -969,6 +969,7 @@ var VERB_TABLE = Object.freeze([
969
969
  { verb: "maintenance", cls: "storage", summary: "run version-history compaction over version-bumped tables (030)" },
970
970
  { verb: "remember", cls: "storage", summary: "write a memory through the daemon (--type fact|convention|preference|decision|gotcha|reference)" },
971
971
  { verb: "recall", cls: "storage", summary: "recall memories through the daemon" },
972
+ { verb: "memory", cls: "storage", summary: "lifecycle: conflicts (list/resolve), stale-refs (list), inspect <id> --lifecycle (058d)" },
972
973
  { verb: "agent", cls: "storage", summary: "run an agent turn through the daemon" },
973
974
  { verb: "ontology", cls: "storage", summary: "inspect/propose ontology changes through the daemon" },
974
975
  { verb: "secret", cls: "storage", summary: "manage named secrets through the daemon" },
@@ -15815,7 +15816,88 @@ async function runCaptureGuarded(env, ctx, capture, onError) {
15815
15816
  return decision;
15816
15817
  }
15817
15818
 
15819
+ // dist/src/hooks/shared/project-resolver.js
15820
+ import { execFileSync } from "node:child_process";
15821
+ import { existsSync as existsSync6, mkdirSync as mkdirSync7, readFileSync as readFileSync9, writeFileSync as writeFileSync7 } from "node:fs";
15822
+ import { homedir as homedir8 } from "node:os";
15823
+ import { dirname as dirname6, join as join8, resolve as resolve3, sep } from "node:path";
15824
+ var UNSORTED_PROJECT_ID = "__unsorted__";
15825
+ var PROJECTS_CACHE_FILE_NAME = "projects.json";
15826
+ var PROJECTS_CACHE_SCHEMA_VERSION = 1;
15827
+ var ProjectsCacheSchema = external_exports.object({
15828
+ schemaVersion: external_exports.literal(PROJECTS_CACHE_SCHEMA_VERSION),
15829
+ org: external_exports.string(),
15830
+ workspace: external_exports.string(),
15831
+ bindings: external_exports.array(external_exports.object({
15832
+ path: external_exports.string(),
15833
+ projectId: external_exports.string()
15834
+ })),
15835
+ projects: external_exports.array(external_exports.object({
15836
+ projectId: external_exports.string(),
15837
+ name: external_exports.string(),
15838
+ remoteSignal: external_exports.string(),
15839
+ boundPaths: external_exports.array(external_exports.string())
15840
+ }))
15841
+ });
15842
+ function emptyProjectsCache(org = "", workspace = "") {
15843
+ return { schemaVersion: PROJECTS_CACHE_SCHEMA_VERSION, org, workspace, bindings: [], projects: [] };
15844
+ }
15845
+ function projectsCacheDir(dir) {
15846
+ return dir ?? join8(homedir8(), CREDENTIALS_DIR_NAME);
15847
+ }
15848
+ function projectsCachePath(dir) {
15849
+ return join8(projectsCacheDir(dir), PROJECTS_CACHE_FILE_NAME);
15850
+ }
15851
+ function loadProjectsCache(dir) {
15852
+ const path = projectsCachePath(dir);
15853
+ if (!existsSync6(path))
15854
+ return emptyProjectsCache();
15855
+ let raw;
15856
+ try {
15857
+ raw = readFileSync9(path, "utf8");
15858
+ } catch {
15859
+ return emptyProjectsCache();
15860
+ }
15861
+ let parsed;
15862
+ try {
15863
+ parsed = JSON.parse(raw);
15864
+ } catch {
15865
+ return emptyProjectsCache();
15866
+ }
15867
+ const result = ProjectsCacheSchema.safeParse(parsed);
15868
+ if (!result.success) {
15869
+ return emptyProjectsCache();
15870
+ }
15871
+ return result.data;
15872
+ }
15873
+ function hasBoundProject(cache) {
15874
+ return cache.bindings.some((b) => b.projectId.length > 0 && b.projectId !== UNSORTED_PROJECT_ID);
15875
+ }
15876
+ function hasBoundProjectOnDisk(input) {
15877
+ const loaded = loadProjectsCache(input.dir);
15878
+ const cache = input.workspace !== void 0 && loaded.workspace.length > 0 && loaded.workspace !== input.workspace ? emptyProjectsCache(loaded.org, loaded.workspace) : loaded;
15879
+ return hasBoundProject(cache);
15880
+ }
15881
+
15818
15882
  // dist/src/hooks/shared/session-start.js
15883
+ 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.';
15884
+ function createOnboardingNoticeGate(dir) {
15885
+ return {
15886
+ hasBoundProject(_meta, credential) {
15887
+ if (credential === void 0 || credential.token === void 0 || credential.token.length === 0) {
15888
+ return true;
15889
+ }
15890
+ try {
15891
+ return hasBoundProjectOnDisk({
15892
+ ...credential.workspace !== void 0 ? { workspace: credential.workspace } : {},
15893
+ ...dir !== void 0 ? { dir } : {}
15894
+ });
15895
+ } catch {
15896
+ return true;
15897
+ }
15898
+ }
15899
+ };
15900
+ }
15819
15901
  async function runSessionStart(input, deps) {
15820
15902
  const seams = deps.seams ?? createNoopSessionStartSeams();
15821
15903
  const meta3 = input.meta;
@@ -15829,7 +15911,8 @@ async function runSessionStart(input, deps) {
15829
15911
  }
15830
15912
  const contextBlock = await safe(() => deps.context.render({ meta: meta3, runtimePath: input.runtimePath, credential }), "");
15831
15913
  const primeBlock = deps.prime !== void 0 ? await safe(() => deps.prime.render({ meta: meta3, runtimePath: input.runtimePath, credential }), "") : "";
15832
- const additionalContext = joinBlocks(contextBlock, primeBlock);
15914
+ const noticeBlock = await safe(() => Promise.resolve(renderOnboardingNotice(deps.onboardingNotice, meta3, credential)), "");
15915
+ const additionalContext = joinBlocks(noticeBlock, joinBlocks(contextBlock, primeBlock));
15833
15916
  await safeVoid(() => seams.autoPullSkills(credential));
15834
15917
  await safeVoid(() => seams.autoPullAssets(credential));
15835
15918
  await safeVoid(() => seams.spawnGraphPull(meta3));
@@ -15844,6 +15927,15 @@ function joinBlocks(context, prime) {
15844
15927
 
15845
15928
  ${prime}`;
15846
15929
  }
15930
+ function renderOnboardingNotice(gate, meta3, credential) {
15931
+ if (gate === void 0)
15932
+ return "";
15933
+ try {
15934
+ return gate.hasBoundProject(meta3, credential) ? "" : BIND_PROJECT_NOTICE;
15935
+ } catch {
15936
+ return "";
15937
+ }
15938
+ }
15847
15939
  async function safe(fn, fallback) {
15848
15940
  try {
15849
15941
  return await fn();
@@ -16197,28 +16289,6 @@ async function parseJson2(res) {
16197
16289
  }
16198
16290
  }
16199
16291
 
16200
- // dist/src/hooks/shared/project-resolver.js
16201
- import { execFileSync } from "node:child_process";
16202
- import { existsSync as existsSync6, mkdirSync as mkdirSync7, readFileSync as readFileSync9, writeFileSync as writeFileSync7 } from "node:fs";
16203
- import { homedir as homedir8 } from "node:os";
16204
- import { dirname as dirname6, join as join8, resolve as resolve3, sep } from "node:path";
16205
- var PROJECTS_CACHE_SCHEMA_VERSION = 1;
16206
- var ProjectsCacheSchema = external_exports.object({
16207
- schemaVersion: external_exports.literal(PROJECTS_CACHE_SCHEMA_VERSION),
16208
- org: external_exports.string(),
16209
- workspace: external_exports.string(),
16210
- bindings: external_exports.array(external_exports.object({
16211
- path: external_exports.string(),
16212
- projectId: external_exports.string()
16213
- })),
16214
- projects: external_exports.array(external_exports.object({
16215
- projectId: external_exports.string(),
16216
- name: external_exports.string(),
16217
- remoteSignal: external_exports.string(),
16218
- boundPaths: external_exports.array(external_exports.string())
16219
- }))
16220
- });
16221
-
16222
16292
  // dist/src/hooks/runtime.js
16223
16293
  var NOTIFICATIONS_ENDPOINT = "/api/diagnostics/notifications";
16224
16294
  function createHookRuntime(options = {}) {
@@ -16234,6 +16304,7 @@ function createHookRuntime(options = {}) {
16234
16304
  const summarySpawn = options.summarySpawn ?? noopSummarySpawn;
16235
16305
  const captureEnv = { captureFlag: options.captureFlag ?? process.env.HONEYCOMB_CAPTURE };
16236
16306
  const seams = options.seams ?? createSessionStartSeams({ credentials, host, port, fetch: doFetch });
16307
+ const onboardingNotice = options.onboardingNotice ?? createOnboardingNoticeGate();
16237
16308
  return {
16238
16309
  deps,
16239
16310
  notifications,
@@ -16242,15 +16313,15 @@ function createHookRuntime(options = {}) {
16242
16313
  if (input === void 0) {
16243
16314
  return { result: { ok: true }, dropped: true };
16244
16315
  }
16245
- return dispatchLifecycle(input, deps, captureEnv, notifications, summarySpawn, prime, seams);
16316
+ return dispatchLifecycle(input, deps, captureEnv, notifications, summarySpawn, prime, seams, onboardingNotice);
16246
16317
  }
16247
16318
  };
16248
16319
  }
16249
- async function dispatchLifecycle(input, deps, captureEnv, notifications, summarySpawn, prime, seams) {
16320
+ async function dispatchLifecycle(input, deps, captureEnv, notifications, summarySpawn, prime, seams, onboardingNotice) {
16250
16321
  try {
16251
16322
  switch (input.event) {
16252
16323
  case "session-start": {
16253
- const sessionDeps = { ...deps, captureEnv, prime, seams };
16324
+ const sessionDeps = { ...deps, captureEnv, prime, seams, onboardingNotice };
16254
16325
  const result = await runSessionStart(input, sessionDeps);
16255
16326
  const drain = await drainNotificationsSoft(notifications);
16256
16327
  return { result, drain };
@@ -969,6 +969,7 @@ var VERB_TABLE = Object.freeze([
969
969
  { verb: "maintenance", cls: "storage", summary: "run version-history compaction over version-bumped tables (030)" },
970
970
  { verb: "remember", cls: "storage", summary: "write a memory through the daemon (--type fact|convention|preference|decision|gotcha|reference)" },
971
971
  { verb: "recall", cls: "storage", summary: "recall memories through the daemon" },
972
+ { verb: "memory", cls: "storage", summary: "lifecycle: conflicts (list/resolve), stale-refs (list), inspect <id> --lifecycle (058d)" },
972
973
  { verb: "agent", cls: "storage", summary: "run an agent turn through the daemon" },
973
974
  { verb: "ontology", cls: "storage", summary: "inspect/propose ontology changes through the daemon" },
974
975
  { verb: "secret", cls: "storage", summary: "manage named secrets through the daemon" },
@@ -15815,7 +15816,88 @@ async function runCaptureGuarded(env, ctx, capture, onError) {
15815
15816
  return decision;
15816
15817
  }
15817
15818
 
15819
+ // dist/src/hooks/shared/project-resolver.js
15820
+ import { execFileSync } from "node:child_process";
15821
+ import { existsSync as existsSync6, mkdirSync as mkdirSync7, readFileSync as readFileSync9, writeFileSync as writeFileSync7 } from "node:fs";
15822
+ import { homedir as homedir8 } from "node:os";
15823
+ import { dirname as dirname6, join as join8, resolve as resolve3, sep } from "node:path";
15824
+ var UNSORTED_PROJECT_ID = "__unsorted__";
15825
+ var PROJECTS_CACHE_FILE_NAME = "projects.json";
15826
+ var PROJECTS_CACHE_SCHEMA_VERSION = 1;
15827
+ var ProjectsCacheSchema = external_exports.object({
15828
+ schemaVersion: external_exports.literal(PROJECTS_CACHE_SCHEMA_VERSION),
15829
+ org: external_exports.string(),
15830
+ workspace: external_exports.string(),
15831
+ bindings: external_exports.array(external_exports.object({
15832
+ path: external_exports.string(),
15833
+ projectId: external_exports.string()
15834
+ })),
15835
+ projects: external_exports.array(external_exports.object({
15836
+ projectId: external_exports.string(),
15837
+ name: external_exports.string(),
15838
+ remoteSignal: external_exports.string(),
15839
+ boundPaths: external_exports.array(external_exports.string())
15840
+ }))
15841
+ });
15842
+ function emptyProjectsCache(org = "", workspace = "") {
15843
+ return { schemaVersion: PROJECTS_CACHE_SCHEMA_VERSION, org, workspace, bindings: [], projects: [] };
15844
+ }
15845
+ function projectsCacheDir(dir) {
15846
+ return dir ?? join8(homedir8(), CREDENTIALS_DIR_NAME);
15847
+ }
15848
+ function projectsCachePath(dir) {
15849
+ return join8(projectsCacheDir(dir), PROJECTS_CACHE_FILE_NAME);
15850
+ }
15851
+ function loadProjectsCache(dir) {
15852
+ const path = projectsCachePath(dir);
15853
+ if (!existsSync6(path))
15854
+ return emptyProjectsCache();
15855
+ let raw;
15856
+ try {
15857
+ raw = readFileSync9(path, "utf8");
15858
+ } catch {
15859
+ return emptyProjectsCache();
15860
+ }
15861
+ let parsed;
15862
+ try {
15863
+ parsed = JSON.parse(raw);
15864
+ } catch {
15865
+ return emptyProjectsCache();
15866
+ }
15867
+ const result = ProjectsCacheSchema.safeParse(parsed);
15868
+ if (!result.success) {
15869
+ return emptyProjectsCache();
15870
+ }
15871
+ return result.data;
15872
+ }
15873
+ function hasBoundProject(cache) {
15874
+ return cache.bindings.some((b) => b.projectId.length > 0 && b.projectId !== UNSORTED_PROJECT_ID);
15875
+ }
15876
+ function hasBoundProjectOnDisk(input) {
15877
+ const loaded = loadProjectsCache(input.dir);
15878
+ const cache = input.workspace !== void 0 && loaded.workspace.length > 0 && loaded.workspace !== input.workspace ? emptyProjectsCache(loaded.org, loaded.workspace) : loaded;
15879
+ return hasBoundProject(cache);
15880
+ }
15881
+
15818
15882
  // dist/src/hooks/shared/session-start.js
15883
+ 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.';
15884
+ function createOnboardingNoticeGate(dir) {
15885
+ return {
15886
+ hasBoundProject(_meta, credential) {
15887
+ if (credential === void 0 || credential.token === void 0 || credential.token.length === 0) {
15888
+ return true;
15889
+ }
15890
+ try {
15891
+ return hasBoundProjectOnDisk({
15892
+ ...credential.workspace !== void 0 ? { workspace: credential.workspace } : {},
15893
+ ...dir !== void 0 ? { dir } : {}
15894
+ });
15895
+ } catch {
15896
+ return true;
15897
+ }
15898
+ }
15899
+ };
15900
+ }
15819
15901
  async function runSessionStart(input, deps) {
15820
15902
  const seams = deps.seams ?? createNoopSessionStartSeams();
15821
15903
  const meta3 = input.meta;
@@ -15829,7 +15911,8 @@ async function runSessionStart(input, deps) {
15829
15911
  }
15830
15912
  const contextBlock = await safe(() => deps.context.render({ meta: meta3, runtimePath: input.runtimePath, credential }), "");
15831
15913
  const primeBlock = deps.prime !== void 0 ? await safe(() => deps.prime.render({ meta: meta3, runtimePath: input.runtimePath, credential }), "") : "";
15832
- const additionalContext = joinBlocks(contextBlock, primeBlock);
15914
+ const noticeBlock = await safe(() => Promise.resolve(renderOnboardingNotice(deps.onboardingNotice, meta3, credential)), "");
15915
+ const additionalContext = joinBlocks(noticeBlock, joinBlocks(contextBlock, primeBlock));
15833
15916
  await safeVoid(() => seams.autoPullSkills(credential));
15834
15917
  await safeVoid(() => seams.autoPullAssets(credential));
15835
15918
  await safeVoid(() => seams.spawnGraphPull(meta3));
@@ -15844,6 +15927,15 @@ function joinBlocks(context, prime) {
15844
15927
 
15845
15928
  ${prime}`;
15846
15929
  }
15930
+ function renderOnboardingNotice(gate, meta3, credential) {
15931
+ if (gate === void 0)
15932
+ return "";
15933
+ try {
15934
+ return gate.hasBoundProject(meta3, credential) ? "" : BIND_PROJECT_NOTICE;
15935
+ } catch {
15936
+ return "";
15937
+ }
15938
+ }
15847
15939
  async function safe(fn, fallback) {
15848
15940
  try {
15849
15941
  return await fn();
@@ -16197,28 +16289,6 @@ async function parseJson2(res) {
16197
16289
  }
16198
16290
  }
16199
16291
 
16200
- // dist/src/hooks/shared/project-resolver.js
16201
- import { execFileSync } from "node:child_process";
16202
- import { existsSync as existsSync6, mkdirSync as mkdirSync7, readFileSync as readFileSync9, writeFileSync as writeFileSync7 } from "node:fs";
16203
- import { homedir as homedir8 } from "node:os";
16204
- import { dirname as dirname6, join as join8, resolve as resolve3, sep } from "node:path";
16205
- var PROJECTS_CACHE_SCHEMA_VERSION = 1;
16206
- var ProjectsCacheSchema = external_exports.object({
16207
- schemaVersion: external_exports.literal(PROJECTS_CACHE_SCHEMA_VERSION),
16208
- org: external_exports.string(),
16209
- workspace: external_exports.string(),
16210
- bindings: external_exports.array(external_exports.object({
16211
- path: external_exports.string(),
16212
- projectId: external_exports.string()
16213
- })),
16214
- projects: external_exports.array(external_exports.object({
16215
- projectId: external_exports.string(),
16216
- name: external_exports.string(),
16217
- remoteSignal: external_exports.string(),
16218
- boundPaths: external_exports.array(external_exports.string())
16219
- }))
16220
- });
16221
-
16222
16292
  // dist/src/hooks/runtime.js
16223
16293
  var NOTIFICATIONS_ENDPOINT = "/api/diagnostics/notifications";
16224
16294
  function createHookRuntime(options = {}) {
@@ -16234,6 +16304,7 @@ function createHookRuntime(options = {}) {
16234
16304
  const summarySpawn = options.summarySpawn ?? noopSummarySpawn;
16235
16305
  const captureEnv = { captureFlag: options.captureFlag ?? process.env.HONEYCOMB_CAPTURE };
16236
16306
  const seams = options.seams ?? createSessionStartSeams({ credentials, host, port, fetch: doFetch });
16307
+ const onboardingNotice = options.onboardingNotice ?? createOnboardingNoticeGate();
16237
16308
  return {
16238
16309
  deps,
16239
16310
  notifications,
@@ -16242,15 +16313,15 @@ function createHookRuntime(options = {}) {
16242
16313
  if (input === void 0) {
16243
16314
  return { result: { ok: true }, dropped: true };
16244
16315
  }
16245
- return dispatchLifecycle(input, deps, captureEnv, notifications, summarySpawn, prime, seams);
16316
+ return dispatchLifecycle(input, deps, captureEnv, notifications, summarySpawn, prime, seams, onboardingNotice);
16246
16317
  }
16247
16318
  };
16248
16319
  }
16249
- async function dispatchLifecycle(input, deps, captureEnv, notifications, summarySpawn, prime, seams) {
16320
+ async function dispatchLifecycle(input, deps, captureEnv, notifications, summarySpawn, prime, seams, onboardingNotice) {
16250
16321
  try {
16251
16322
  switch (input.event) {
16252
16323
  case "session-start": {
16253
- const sessionDeps = { ...deps, captureEnv, prime, seams };
16324
+ const sessionDeps = { ...deps, captureEnv, prime, seams, onboardingNotice };
16254
16325
  const result = await runSessionStart(input, sessionDeps);
16255
16326
  const drain = await drainNotificationsSoft(notifications);
16256
16327
  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 additionalContext = joinBlocks(contextBlock, primeBlock);
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 };