@legioncodeinc/honeycomb 0.1.7 → 0.1.9

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.
@@ -0,0 +1,41 @@
1
+ // dist/src/daemon/restart-helper.js
2
+ import { spawn } from "node:child_process";
3
+ var port = Number(process.env.HONEYCOMB_RESTART_PORT ?? "3850");
4
+ var entry = process.env.HONEYCOMB_RESTART_ENTRY ?? "";
5
+ var POLL_INTERVAL_MS = 200;
6
+ var MAX_WAIT_MS = 3e4;
7
+ var POLL_TIMEOUT_MS = 1e3;
8
+ var LOCK_RELEASE_GRACE_MS = 800;
9
+ var healthUrl = `http://127.0.0.1:${Number.isFinite(port) && port > 0 ? port : 3850}/health`;
10
+ async function stillUp() {
11
+ const ac = new AbortController();
12
+ const timer = setTimeout(() => ac.abort(), POLL_TIMEOUT_MS);
13
+ try {
14
+ const res = await fetch(healthUrl, { method: "GET", signal: ac.signal });
15
+ return res.ok;
16
+ } catch (error) {
17
+ return error instanceof Error && error.name === "AbortError";
18
+ } finally {
19
+ clearTimeout(timer);
20
+ }
21
+ }
22
+ function sleep(ms) {
23
+ return new Promise((r) => {
24
+ const t = setTimeout(r, ms);
25
+ t.unref?.();
26
+ });
27
+ }
28
+ async function main() {
29
+ if (entry === "")
30
+ return;
31
+ const deadline = Date.now() + MAX_WAIT_MS;
32
+ while (Date.now() < deadline) {
33
+ if (!await stillUp())
34
+ break;
35
+ await sleep(POLL_INTERVAL_MS);
36
+ }
37
+ await sleep(LOCK_RELEASE_GRACE_MS);
38
+ const child = spawn(process.execPath, [entry], { detached: true, stdio: "ignore" });
39
+ child.unref();
40
+ }
41
+ void main();
@@ -2,7 +2,7 @@
2
2
  import { createServer } from "node:http";
3
3
 
4
4
  // dist/src/shared/constants.js
5
- var HONEYCOMB_VERSION = true ? "0.1.7" : "0.0.0-dev";
5
+ var HONEYCOMB_VERSION = true ? "0.1.9" : "0.0.0-dev";
6
6
 
7
7
  // dist/embeddings/src/index.js
8
8
  var EMBED_DIMS = 768;
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "honeycomb",
3
3
  "description": "Honeycomb — persistent memory for Claude Code sessions via the local Honeycomb daemon",
4
- "version": "0.1.7",
4
+ "version": "0.1.9",
5
5
  "author": {
6
6
  "name": "Honeycomb"
7
7
  },
@@ -92,8 +92,61 @@ function nestedString(raw, a, b) {
92
92
  function userMessageData(text) {
93
93
  return { kind: "user_message", text };
94
94
  }
95
- function assistantMessageData(text) {
96
- return { kind: "assistant_message", text };
95
+ function assistantMessageData(text, usage) {
96
+ const normalized = usage !== void 0 ? compactUsage(usage) : void 0;
97
+ return {
98
+ kind: "assistant_message",
99
+ text,
100
+ ...normalized !== void 0 ? { usage: normalized } : {}
101
+ };
102
+ }
103
+ function compactUsage(usage) {
104
+ const out = {};
105
+ if (isCount(usage.input))
106
+ out.input = usage.input;
107
+ if (isCount(usage.output))
108
+ out.output = usage.output;
109
+ if (isCount(usage.cacheRead))
110
+ out.cacheRead = usage.cacheRead;
111
+ if (isCount(usage.cacheCreation))
112
+ out.cacheCreation = usage.cacheCreation;
113
+ return Object.keys(out).length > 0 ? out : void 0;
114
+ }
115
+ function isCount(n) {
116
+ return typeof n === "number" && Number.isInteger(n) && n >= 0;
117
+ }
118
+ function extractTurnUsage(raw) {
119
+ const block = usageBlock(raw);
120
+ if (block === void 0)
121
+ return void 0;
122
+ const usage = {
123
+ ...readCount(block, "input_tokens") !== void 0 ? { input: readCount(block, "input_tokens") } : {},
124
+ ...readCount(block, "output_tokens") !== void 0 ? { output: readCount(block, "output_tokens") } : {},
125
+ ...readCount(block, "cache_read_input_tokens") !== void 0 ? { cacheRead: readCount(block, "cache_read_input_tokens") } : {},
126
+ ...readCount(block, "cache_creation_input_tokens") !== void 0 ? { cacheCreation: readCount(block, "cache_creation_input_tokens") } : {}
127
+ };
128
+ return compactUsage(usage);
129
+ }
130
+ function usageBlock(raw) {
131
+ const top = nested(raw, "usage");
132
+ if (top !== null && typeof top === "object")
133
+ return top;
134
+ const inner = nestedRecord(nested(raw, "message"), "usage");
135
+ return inner;
136
+ }
137
+ function nestedRecord(obj, key) {
138
+ if (obj !== null && typeof obj === "object") {
139
+ const value = obj[key];
140
+ if (value !== null && typeof value === "object")
141
+ return value;
142
+ }
143
+ return void 0;
144
+ }
145
+ function readCount(block, key) {
146
+ const value = block[key];
147
+ if (typeof value !== "number" || !Number.isInteger(value) || value < 0)
148
+ return void 0;
149
+ return value;
97
150
  }
98
151
  function toolCallData(tool, input, response) {
99
152
  return { kind: "tool_call", tool, input, response };
@@ -143,7 +196,7 @@ function claudeCodeExtractData(raw, logical) {
143
196
  case "tool_call":
144
197
  return toolCallData(pickString(raw, "tool_name", "tool"), nested(raw, "tool_input"), nested(raw, "tool_response"));
145
198
  case "assistant_message":
146
- return assistantMessageData(pickString(raw, "text", "message"));
199
+ return assistantMessageData(pickString(raw, "text", "message"), extractTurnUsage(raw));
147
200
  case "session-end":
148
201
  return sessionEndData(pickString(raw, "reason") || "Stop");
149
202
  default:
@@ -958,38 +1011,52 @@ var SKILL_ROW_DEFAULTS = Object.freeze({
958
1011
  });
959
1012
 
960
1013
  // dist/src/commands/contracts.js
1014
+ var VERB_GROUPS = Object.freeze([
1015
+ { key: "memory", label: "Memory & recall" },
1016
+ { key: "knowledge", label: "Knowledge & skills" },
1017
+ { key: "agents", label: "Agents, routing & config" },
1018
+ { key: "account", label: "Account & workspaces" },
1019
+ { key: "system", label: "Setup & system" }
1020
+ ]);
961
1021
  var VERB_TABLE = Object.freeze([
962
- { verb: "setup", cls: "local", summary: "detect assistants, wire hooks, bring up the daemon" },
963
- { verb: "install", cls: "local", summary: "bring up the daemon (health-gated) + open the dashboard (PRD-050a)" },
964
- { verb: "status", cls: "local", summary: "daemon connectivity + login + D1\u2013D5 environment health" },
965
- { verb: "daemon", cls: "local", summary: "start | stop | status the loopback daemon (3850)" },
966
- { verb: "dashboard", cls: "local", summary: "launch the daemon-served dashboard (020b)" },
967
- { verb: "telemetry", cls: "local", summary: "show exactly what adoption telemetry has been / would be sent (--show, PRD-050e)" },
968
- { verb: "pollinate", cls: "storage", summary: "trigger a pollinating consolidation pass on the daemon (009/026)" },
969
- { verb: "maintenance", cls: "storage", summary: "run version-history compaction over version-bumped tables (030)" },
970
- { verb: "remember", cls: "storage", summary: "write a memory through the daemon (--type fact|convention|preference|decision|gotcha|reference)" },
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)" },
973
- { verb: "agent", cls: "storage", summary: "run an agent turn through the daemon" },
974
- { verb: "ontology", cls: "storage", summary: "inspect/propose ontology changes through the daemon" },
975
- { verb: "secret", cls: "storage", summary: "manage named secrets through the daemon" },
976
- { verb: "settings", cls: "storage", summary: "get/set/list vault settings + provider\u2192model selector through the daemon" },
977
- { verb: "asset", cls: "storage", summary: "register/promote/demote/style skills+agents through the tier\xD7style lattice (033)" },
978
- { verb: "skill", cls: "storage", summary: "skillify scope/pull/unpull/force/promote through the daemon (promote = cross-project, 049c)" },
979
- { verb: "skillify", cls: "storage", summary: "pull team skills from the daemon (016c)" },
980
- { verb: "hook", cls: "local", summary: "inspect/wire harness hooks" },
981
- { verb: "route", cls: "storage", summary: "manage inference routes through the daemon" },
982
- { verb: "sources", cls: "storage", summary: "connect/index/purge sources through the daemon" },
983
- { verb: "graph", cls: "storage", summary: "build/query the codebase graph through the daemon" },
984
- { verb: "goal", cls: "storage", summary: "manage goals/KPIs through the daemon" },
985
- { verb: "whoami", cls: "auth", summary: "show the authenticated user, org, and workspace (GET /me)" },
986
- { verb: "org", cls: "auth", summary: "list/switch org (passthrough to the auth dispatcher)" },
987
- { verb: "workspace", cls: "auth", summary: "list/switch/use workspace (passthrough to the auth dispatcher)" },
988
- { verb: "workspaces", cls: "auth", summary: "list workspaces in the active org (alias of `workspace list`)" },
989
- { verb: "project", cls: "auth", summary: "list/bind/use projects + show the resolved per-folder scope (049d)" },
990
- { verb: "sessions", cls: "storage", summary: "list/prune captured sessions through the daemon" },
991
- { verb: "uninstall", cls: "local", summary: "reverse only Honeycomb's changes" },
992
- { verb: "update", cls: "local", summary: "self-update the CLI, daemon, and bundles" }
1022
+ // Memory & recall the product's core write/read/lifecycle surface.
1023
+ { verb: "remember", cls: "storage", group: "memory", summary: "write a memory through the daemon (--type fact|convention|preference|decision|gotcha|reference)" },
1024
+ { verb: "recall", cls: "storage", group: "memory", summary: "recall memories through the daemon" },
1025
+ { verb: "memory", cls: "storage", group: "memory", summary: "lifecycle: conflicts (list/resolve), stale-refs (list), inspect <id> --lifecycle (058d)" },
1026
+ { verb: "sessions", cls: "storage", group: "memory", summary: "list/prune captured sessions through the daemon" },
1027
+ { verb: "pollinate", cls: "storage", group: "memory", summary: "trigger a pollinating consolidation pass on the daemon (009/026)" },
1028
+ { verb: "maintenance", cls: "storage", group: "memory", summary: "run version-history compaction over version-bumped tables (030)" },
1029
+ // Knowledge & skills — skills, assets, ontology, the codebase graph, and goals.
1030
+ { verb: "skill", cls: "storage", group: "knowledge", summary: "skillify scope/pull/unpull/force/promote through the daemon (promote = cross-project, 049c)" },
1031
+ { verb: "skillify", cls: "storage", group: "knowledge", summary: "pull team skills from the daemon (016c)" },
1032
+ { verb: "asset", cls: "storage", group: "knowledge", summary: "register/promote/demote/style skills+agents through the tier\xD7style lattice (033)" },
1033
+ { verb: "ontology", cls: "storage", group: "knowledge", summary: "inspect/propose ontology changes through the daemon" },
1034
+ { verb: "graph", cls: "storage", group: "knowledge", summary: "build/query the codebase graph through the daemon" },
1035
+ { verb: "sources", cls: "storage", group: "knowledge", summary: "connect/index/purge sources through the daemon" },
1036
+ { verb: "goal", cls: "storage", group: "knowledge", summary: "manage goals/KPIs through the daemon" },
1037
+ // Agents, routing & config agent turns, inference routes, secrets, and vault settings.
1038
+ { verb: "agent", cls: "storage", group: "agents", summary: "run an agent turn through the daemon" },
1039
+ { verb: "route", cls: "storage", group: "agents", summary: "manage inference routes through the daemon" },
1040
+ { verb: "secret", cls: "storage", group: "agents", summary: "manage named secrets through the daemon" },
1041
+ { verb: "settings", cls: "storage", group: "agents", summary: "get/set/list vault settings + provider\u2192model selector through the daemon" },
1042
+ // Account & workspaces — auth, identity, and the org/workspace/project scope surface.
1043
+ { verb: "login", cls: "auth", group: "account", summary: "authenticate via device flow, or --token <key> for headless (023)" },
1044
+ { verb: "logout", cls: "auth", group: "account", summary: "remove the shared credentials and sign out (023)" },
1045
+ { verb: "whoami", cls: "auth", group: "account", summary: "show the authenticated user, org, and workspace (GET /me)" },
1046
+ { verb: "org", cls: "auth", group: "account", summary: "list/switch org (passthrough to the auth dispatcher)" },
1047
+ { verb: "workspace", cls: "auth", group: "account", summary: "list/switch/use workspace (passthrough to the auth dispatcher)" },
1048
+ { verb: "workspaces", cls: "auth", group: "account", summary: "list workspaces in the active org (alias of `workspace list`)" },
1049
+ { verb: "project", cls: "auth", group: "account", summary: "list/bind/use projects + show the resolved per-folder scope (049d)" },
1050
+ // Setup & system install/onboard, daemon lifecycle, dashboard, hooks, telemetry, update.
1051
+ { verb: "setup", cls: "local", group: "system", summary: "detect assistants, wire hooks, bring up the daemon" },
1052
+ { verb: "install", cls: "local", group: "system", summary: "bring up the daemon (health-gated) + open the dashboard (PRD-050a)" },
1053
+ { verb: "status", cls: "local", group: "system", summary: "daemon connectivity + login + D1\u2013D5 environment health" },
1054
+ { verb: "daemon", cls: "local", group: "system", summary: "start | stop | status the loopback daemon (3850)" },
1055
+ { verb: "dashboard", cls: "local", group: "system", summary: "launch the daemon-served dashboard (020b)" },
1056
+ { verb: "hook", cls: "local", group: "system", summary: "inspect/wire harness hooks" },
1057
+ { verb: "telemetry", cls: "local", group: "system", summary: "show exactly what adoption telemetry has been / would be sent (--show, PRD-050e)" },
1058
+ { verb: "update", cls: "local", group: "system", summary: "self-update the CLI, daemon, and bundles" },
1059
+ { verb: "uninstall", cls: "local", group: "system", summary: "reverse only Honeycomb's changes" }
993
1060
  ]);
994
1061
  var DEFAULT_GLOBAL_FLAGS = Object.freeze({
995
1062
  help: false,
@@ -92,8 +92,61 @@ function nestedString(raw, a, b) {
92
92
  function userMessageData(text) {
93
93
  return { kind: "user_message", text };
94
94
  }
95
- function assistantMessageData(text) {
96
- return { kind: "assistant_message", text };
95
+ function assistantMessageData(text, usage) {
96
+ const normalized = usage !== void 0 ? compactUsage(usage) : void 0;
97
+ return {
98
+ kind: "assistant_message",
99
+ text,
100
+ ...normalized !== void 0 ? { usage: normalized } : {}
101
+ };
102
+ }
103
+ function compactUsage(usage) {
104
+ const out = {};
105
+ if (isCount(usage.input))
106
+ out.input = usage.input;
107
+ if (isCount(usage.output))
108
+ out.output = usage.output;
109
+ if (isCount(usage.cacheRead))
110
+ out.cacheRead = usage.cacheRead;
111
+ if (isCount(usage.cacheCreation))
112
+ out.cacheCreation = usage.cacheCreation;
113
+ return Object.keys(out).length > 0 ? out : void 0;
114
+ }
115
+ function isCount(n) {
116
+ return typeof n === "number" && Number.isInteger(n) && n >= 0;
117
+ }
118
+ function extractTurnUsage(raw) {
119
+ const block = usageBlock(raw);
120
+ if (block === void 0)
121
+ return void 0;
122
+ const usage = {
123
+ ...readCount(block, "input_tokens") !== void 0 ? { input: readCount(block, "input_tokens") } : {},
124
+ ...readCount(block, "output_tokens") !== void 0 ? { output: readCount(block, "output_tokens") } : {},
125
+ ...readCount(block, "cache_read_input_tokens") !== void 0 ? { cacheRead: readCount(block, "cache_read_input_tokens") } : {},
126
+ ...readCount(block, "cache_creation_input_tokens") !== void 0 ? { cacheCreation: readCount(block, "cache_creation_input_tokens") } : {}
127
+ };
128
+ return compactUsage(usage);
129
+ }
130
+ function usageBlock(raw) {
131
+ const top = nested(raw, "usage");
132
+ if (top !== null && typeof top === "object")
133
+ return top;
134
+ const inner = nestedRecord(nested(raw, "message"), "usage");
135
+ return inner;
136
+ }
137
+ function nestedRecord(obj, key) {
138
+ if (obj !== null && typeof obj === "object") {
139
+ const value = obj[key];
140
+ if (value !== null && typeof value === "object")
141
+ return value;
142
+ }
143
+ return void 0;
144
+ }
145
+ function readCount(block, key) {
146
+ const value = block[key];
147
+ if (typeof value !== "number" || !Number.isInteger(value) || value < 0)
148
+ return void 0;
149
+ return value;
97
150
  }
98
151
  function toolCallData(tool, input, response) {
99
152
  return { kind: "tool_call", tool, input, response };
@@ -143,7 +196,7 @@ function claudeCodeExtractData(raw, logical) {
143
196
  case "tool_call":
144
197
  return toolCallData(pickString(raw, "tool_name", "tool"), nested(raw, "tool_input"), nested(raw, "tool_response"));
145
198
  case "assistant_message":
146
- return assistantMessageData(pickString(raw, "text", "message"));
199
+ return assistantMessageData(pickString(raw, "text", "message"), extractTurnUsage(raw));
147
200
  case "session-end":
148
201
  return sessionEndData(pickString(raw, "reason") || "Stop");
149
202
  default:
@@ -958,38 +1011,52 @@ var SKILL_ROW_DEFAULTS = Object.freeze({
958
1011
  });
959
1012
 
960
1013
  // dist/src/commands/contracts.js
1014
+ var VERB_GROUPS = Object.freeze([
1015
+ { key: "memory", label: "Memory & recall" },
1016
+ { key: "knowledge", label: "Knowledge & skills" },
1017
+ { key: "agents", label: "Agents, routing & config" },
1018
+ { key: "account", label: "Account & workspaces" },
1019
+ { key: "system", label: "Setup & system" }
1020
+ ]);
961
1021
  var VERB_TABLE = Object.freeze([
962
- { verb: "setup", cls: "local", summary: "detect assistants, wire hooks, bring up the daemon" },
963
- { verb: "install", cls: "local", summary: "bring up the daemon (health-gated) + open the dashboard (PRD-050a)" },
964
- { verb: "status", cls: "local", summary: "daemon connectivity + login + D1\u2013D5 environment health" },
965
- { verb: "daemon", cls: "local", summary: "start | stop | status the loopback daemon (3850)" },
966
- { verb: "dashboard", cls: "local", summary: "launch the daemon-served dashboard (020b)" },
967
- { verb: "telemetry", cls: "local", summary: "show exactly what adoption telemetry has been / would be sent (--show, PRD-050e)" },
968
- { verb: "pollinate", cls: "storage", summary: "trigger a pollinating consolidation pass on the daemon (009/026)" },
969
- { verb: "maintenance", cls: "storage", summary: "run version-history compaction over version-bumped tables (030)" },
970
- { verb: "remember", cls: "storage", summary: "write a memory through the daemon (--type fact|convention|preference|decision|gotcha|reference)" },
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)" },
973
- { verb: "agent", cls: "storage", summary: "run an agent turn through the daemon" },
974
- { verb: "ontology", cls: "storage", summary: "inspect/propose ontology changes through the daemon" },
975
- { verb: "secret", cls: "storage", summary: "manage named secrets through the daemon" },
976
- { verb: "settings", cls: "storage", summary: "get/set/list vault settings + provider\u2192model selector through the daemon" },
977
- { verb: "asset", cls: "storage", summary: "register/promote/demote/style skills+agents through the tier\xD7style lattice (033)" },
978
- { verb: "skill", cls: "storage", summary: "skillify scope/pull/unpull/force/promote through the daemon (promote = cross-project, 049c)" },
979
- { verb: "skillify", cls: "storage", summary: "pull team skills from the daemon (016c)" },
980
- { verb: "hook", cls: "local", summary: "inspect/wire harness hooks" },
981
- { verb: "route", cls: "storage", summary: "manage inference routes through the daemon" },
982
- { verb: "sources", cls: "storage", summary: "connect/index/purge sources through the daemon" },
983
- { verb: "graph", cls: "storage", summary: "build/query the codebase graph through the daemon" },
984
- { verb: "goal", cls: "storage", summary: "manage goals/KPIs through the daemon" },
985
- { verb: "whoami", cls: "auth", summary: "show the authenticated user, org, and workspace (GET /me)" },
986
- { verb: "org", cls: "auth", summary: "list/switch org (passthrough to the auth dispatcher)" },
987
- { verb: "workspace", cls: "auth", summary: "list/switch/use workspace (passthrough to the auth dispatcher)" },
988
- { verb: "workspaces", cls: "auth", summary: "list workspaces in the active org (alias of `workspace list`)" },
989
- { verb: "project", cls: "auth", summary: "list/bind/use projects + show the resolved per-folder scope (049d)" },
990
- { verb: "sessions", cls: "storage", summary: "list/prune captured sessions through the daemon" },
991
- { verb: "uninstall", cls: "local", summary: "reverse only Honeycomb's changes" },
992
- { verb: "update", cls: "local", summary: "self-update the CLI, daemon, and bundles" }
1022
+ // Memory & recall the product's core write/read/lifecycle surface.
1023
+ { verb: "remember", cls: "storage", group: "memory", summary: "write a memory through the daemon (--type fact|convention|preference|decision|gotcha|reference)" },
1024
+ { verb: "recall", cls: "storage", group: "memory", summary: "recall memories through the daemon" },
1025
+ { verb: "memory", cls: "storage", group: "memory", summary: "lifecycle: conflicts (list/resolve), stale-refs (list), inspect <id> --lifecycle (058d)" },
1026
+ { verb: "sessions", cls: "storage", group: "memory", summary: "list/prune captured sessions through the daemon" },
1027
+ { verb: "pollinate", cls: "storage", group: "memory", summary: "trigger a pollinating consolidation pass on the daemon (009/026)" },
1028
+ { verb: "maintenance", cls: "storage", group: "memory", summary: "run version-history compaction over version-bumped tables (030)" },
1029
+ // Knowledge & skills — skills, assets, ontology, the codebase graph, and goals.
1030
+ { verb: "skill", cls: "storage", group: "knowledge", summary: "skillify scope/pull/unpull/force/promote through the daemon (promote = cross-project, 049c)" },
1031
+ { verb: "skillify", cls: "storage", group: "knowledge", summary: "pull team skills from the daemon (016c)" },
1032
+ { verb: "asset", cls: "storage", group: "knowledge", summary: "register/promote/demote/style skills+agents through the tier\xD7style lattice (033)" },
1033
+ { verb: "ontology", cls: "storage", group: "knowledge", summary: "inspect/propose ontology changes through the daemon" },
1034
+ { verb: "graph", cls: "storage", group: "knowledge", summary: "build/query the codebase graph through the daemon" },
1035
+ { verb: "sources", cls: "storage", group: "knowledge", summary: "connect/index/purge sources through the daemon" },
1036
+ { verb: "goal", cls: "storage", group: "knowledge", summary: "manage goals/KPIs through the daemon" },
1037
+ // Agents, routing & config agent turns, inference routes, secrets, and vault settings.
1038
+ { verb: "agent", cls: "storage", group: "agents", summary: "run an agent turn through the daemon" },
1039
+ { verb: "route", cls: "storage", group: "agents", summary: "manage inference routes through the daemon" },
1040
+ { verb: "secret", cls: "storage", group: "agents", summary: "manage named secrets through the daemon" },
1041
+ { verb: "settings", cls: "storage", group: "agents", summary: "get/set/list vault settings + provider\u2192model selector through the daemon" },
1042
+ // Account & workspaces — auth, identity, and the org/workspace/project scope surface.
1043
+ { verb: "login", cls: "auth", group: "account", summary: "authenticate via device flow, or --token <key> for headless (023)" },
1044
+ { verb: "logout", cls: "auth", group: "account", summary: "remove the shared credentials and sign out (023)" },
1045
+ { verb: "whoami", cls: "auth", group: "account", summary: "show the authenticated user, org, and workspace (GET /me)" },
1046
+ { verb: "org", cls: "auth", group: "account", summary: "list/switch org (passthrough to the auth dispatcher)" },
1047
+ { verb: "workspace", cls: "auth", group: "account", summary: "list/switch/use workspace (passthrough to the auth dispatcher)" },
1048
+ { verb: "workspaces", cls: "auth", group: "account", summary: "list workspaces in the active org (alias of `workspace list`)" },
1049
+ { verb: "project", cls: "auth", group: "account", summary: "list/bind/use projects + show the resolved per-folder scope (049d)" },
1050
+ // Setup & system install/onboard, daemon lifecycle, dashboard, hooks, telemetry, update.
1051
+ { verb: "setup", cls: "local", group: "system", summary: "detect assistants, wire hooks, bring up the daemon" },
1052
+ { verb: "install", cls: "local", group: "system", summary: "bring up the daemon (health-gated) + open the dashboard (PRD-050a)" },
1053
+ { verb: "status", cls: "local", group: "system", summary: "daemon connectivity + login + D1\u2013D5 environment health" },
1054
+ { verb: "daemon", cls: "local", group: "system", summary: "start | stop | status the loopback daemon (3850)" },
1055
+ { verb: "dashboard", cls: "local", group: "system", summary: "launch the daemon-served dashboard (020b)" },
1056
+ { verb: "hook", cls: "local", group: "system", summary: "inspect/wire harness hooks" },
1057
+ { verb: "telemetry", cls: "local", group: "system", summary: "show exactly what adoption telemetry has been / would be sent (--show, PRD-050e)" },
1058
+ { verb: "update", cls: "local", group: "system", summary: "self-update the CLI, daemon, and bundles" },
1059
+ { verb: "uninstall", cls: "local", group: "system", summary: "reverse only Honeycomb's changes" }
993
1060
  ]);
994
1061
  var DEFAULT_GLOBAL_FLAGS = Object.freeze({
995
1062
  help: false,
@@ -92,8 +92,61 @@ function nestedString(raw, a, b) {
92
92
  function userMessageData(text) {
93
93
  return { kind: "user_message", text };
94
94
  }
95
- function assistantMessageData(text) {
96
- return { kind: "assistant_message", text };
95
+ function assistantMessageData(text, usage) {
96
+ const normalized = usage !== void 0 ? compactUsage(usage) : void 0;
97
+ return {
98
+ kind: "assistant_message",
99
+ text,
100
+ ...normalized !== void 0 ? { usage: normalized } : {}
101
+ };
102
+ }
103
+ function compactUsage(usage) {
104
+ const out = {};
105
+ if (isCount(usage.input))
106
+ out.input = usage.input;
107
+ if (isCount(usage.output))
108
+ out.output = usage.output;
109
+ if (isCount(usage.cacheRead))
110
+ out.cacheRead = usage.cacheRead;
111
+ if (isCount(usage.cacheCreation))
112
+ out.cacheCreation = usage.cacheCreation;
113
+ return Object.keys(out).length > 0 ? out : void 0;
114
+ }
115
+ function isCount(n) {
116
+ return typeof n === "number" && Number.isInteger(n) && n >= 0;
117
+ }
118
+ function extractTurnUsage(raw) {
119
+ const block = usageBlock(raw);
120
+ if (block === void 0)
121
+ return void 0;
122
+ const usage = {
123
+ ...readCount(block, "input_tokens") !== void 0 ? { input: readCount(block, "input_tokens") } : {},
124
+ ...readCount(block, "output_tokens") !== void 0 ? { output: readCount(block, "output_tokens") } : {},
125
+ ...readCount(block, "cache_read_input_tokens") !== void 0 ? { cacheRead: readCount(block, "cache_read_input_tokens") } : {},
126
+ ...readCount(block, "cache_creation_input_tokens") !== void 0 ? { cacheCreation: readCount(block, "cache_creation_input_tokens") } : {}
127
+ };
128
+ return compactUsage(usage);
129
+ }
130
+ function usageBlock(raw) {
131
+ const top = nested(raw, "usage");
132
+ if (top !== null && typeof top === "object")
133
+ return top;
134
+ const inner = nestedRecord(nested(raw, "message"), "usage");
135
+ return inner;
136
+ }
137
+ function nestedRecord(obj, key) {
138
+ if (obj !== null && typeof obj === "object") {
139
+ const value = obj[key];
140
+ if (value !== null && typeof value === "object")
141
+ return value;
142
+ }
143
+ return void 0;
144
+ }
145
+ function readCount(block, key) {
146
+ const value = block[key];
147
+ if (typeof value !== "number" || !Number.isInteger(value) || value < 0)
148
+ return void 0;
149
+ return value;
97
150
  }
98
151
  function toolCallData(tool, input, response) {
99
152
  return { kind: "tool_call", tool, input, response };
@@ -143,7 +196,7 @@ function claudeCodeExtractData(raw, logical) {
143
196
  case "tool_call":
144
197
  return toolCallData(pickString(raw, "tool_name", "tool"), nested(raw, "tool_input"), nested(raw, "tool_response"));
145
198
  case "assistant_message":
146
- return assistantMessageData(pickString(raw, "text", "message"));
199
+ return assistantMessageData(pickString(raw, "text", "message"), extractTurnUsage(raw));
147
200
  case "session-end":
148
201
  return sessionEndData(pickString(raw, "reason") || "Stop");
149
202
  default:
@@ -958,38 +1011,52 @@ var SKILL_ROW_DEFAULTS = Object.freeze({
958
1011
  });
959
1012
 
960
1013
  // dist/src/commands/contracts.js
1014
+ var VERB_GROUPS = Object.freeze([
1015
+ { key: "memory", label: "Memory & recall" },
1016
+ { key: "knowledge", label: "Knowledge & skills" },
1017
+ { key: "agents", label: "Agents, routing & config" },
1018
+ { key: "account", label: "Account & workspaces" },
1019
+ { key: "system", label: "Setup & system" }
1020
+ ]);
961
1021
  var VERB_TABLE = Object.freeze([
962
- { verb: "setup", cls: "local", summary: "detect assistants, wire hooks, bring up the daemon" },
963
- { verb: "install", cls: "local", summary: "bring up the daemon (health-gated) + open the dashboard (PRD-050a)" },
964
- { verb: "status", cls: "local", summary: "daemon connectivity + login + D1\u2013D5 environment health" },
965
- { verb: "daemon", cls: "local", summary: "start | stop | status the loopback daemon (3850)" },
966
- { verb: "dashboard", cls: "local", summary: "launch the daemon-served dashboard (020b)" },
967
- { verb: "telemetry", cls: "local", summary: "show exactly what adoption telemetry has been / would be sent (--show, PRD-050e)" },
968
- { verb: "pollinate", cls: "storage", summary: "trigger a pollinating consolidation pass on the daemon (009/026)" },
969
- { verb: "maintenance", cls: "storage", summary: "run version-history compaction over version-bumped tables (030)" },
970
- { verb: "remember", cls: "storage", summary: "write a memory through the daemon (--type fact|convention|preference|decision|gotcha|reference)" },
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)" },
973
- { verb: "agent", cls: "storage", summary: "run an agent turn through the daemon" },
974
- { verb: "ontology", cls: "storage", summary: "inspect/propose ontology changes through the daemon" },
975
- { verb: "secret", cls: "storage", summary: "manage named secrets through the daemon" },
976
- { verb: "settings", cls: "storage", summary: "get/set/list vault settings + provider\u2192model selector through the daemon" },
977
- { verb: "asset", cls: "storage", summary: "register/promote/demote/style skills+agents through the tier\xD7style lattice (033)" },
978
- { verb: "skill", cls: "storage", summary: "skillify scope/pull/unpull/force/promote through the daemon (promote = cross-project, 049c)" },
979
- { verb: "skillify", cls: "storage", summary: "pull team skills from the daemon (016c)" },
980
- { verb: "hook", cls: "local", summary: "inspect/wire harness hooks" },
981
- { verb: "route", cls: "storage", summary: "manage inference routes through the daemon" },
982
- { verb: "sources", cls: "storage", summary: "connect/index/purge sources through the daemon" },
983
- { verb: "graph", cls: "storage", summary: "build/query the codebase graph through the daemon" },
984
- { verb: "goal", cls: "storage", summary: "manage goals/KPIs through the daemon" },
985
- { verb: "whoami", cls: "auth", summary: "show the authenticated user, org, and workspace (GET /me)" },
986
- { verb: "org", cls: "auth", summary: "list/switch org (passthrough to the auth dispatcher)" },
987
- { verb: "workspace", cls: "auth", summary: "list/switch/use workspace (passthrough to the auth dispatcher)" },
988
- { verb: "workspaces", cls: "auth", summary: "list workspaces in the active org (alias of `workspace list`)" },
989
- { verb: "project", cls: "auth", summary: "list/bind/use projects + show the resolved per-folder scope (049d)" },
990
- { verb: "sessions", cls: "storage", summary: "list/prune captured sessions through the daemon" },
991
- { verb: "uninstall", cls: "local", summary: "reverse only Honeycomb's changes" },
992
- { verb: "update", cls: "local", summary: "self-update the CLI, daemon, and bundles" }
1022
+ // Memory & recall the product's core write/read/lifecycle surface.
1023
+ { verb: "remember", cls: "storage", group: "memory", summary: "write a memory through the daemon (--type fact|convention|preference|decision|gotcha|reference)" },
1024
+ { verb: "recall", cls: "storage", group: "memory", summary: "recall memories through the daemon" },
1025
+ { verb: "memory", cls: "storage", group: "memory", summary: "lifecycle: conflicts (list/resolve), stale-refs (list), inspect <id> --lifecycle (058d)" },
1026
+ { verb: "sessions", cls: "storage", group: "memory", summary: "list/prune captured sessions through the daemon" },
1027
+ { verb: "pollinate", cls: "storage", group: "memory", summary: "trigger a pollinating consolidation pass on the daemon (009/026)" },
1028
+ { verb: "maintenance", cls: "storage", group: "memory", summary: "run version-history compaction over version-bumped tables (030)" },
1029
+ // Knowledge & skills — skills, assets, ontology, the codebase graph, and goals.
1030
+ { verb: "skill", cls: "storage", group: "knowledge", summary: "skillify scope/pull/unpull/force/promote through the daemon (promote = cross-project, 049c)" },
1031
+ { verb: "skillify", cls: "storage", group: "knowledge", summary: "pull team skills from the daemon (016c)" },
1032
+ { verb: "asset", cls: "storage", group: "knowledge", summary: "register/promote/demote/style skills+agents through the tier\xD7style lattice (033)" },
1033
+ { verb: "ontology", cls: "storage", group: "knowledge", summary: "inspect/propose ontology changes through the daemon" },
1034
+ { verb: "graph", cls: "storage", group: "knowledge", summary: "build/query the codebase graph through the daemon" },
1035
+ { verb: "sources", cls: "storage", group: "knowledge", summary: "connect/index/purge sources through the daemon" },
1036
+ { verb: "goal", cls: "storage", group: "knowledge", summary: "manage goals/KPIs through the daemon" },
1037
+ // Agents, routing & config agent turns, inference routes, secrets, and vault settings.
1038
+ { verb: "agent", cls: "storage", group: "agents", summary: "run an agent turn through the daemon" },
1039
+ { verb: "route", cls: "storage", group: "agents", summary: "manage inference routes through the daemon" },
1040
+ { verb: "secret", cls: "storage", group: "agents", summary: "manage named secrets through the daemon" },
1041
+ { verb: "settings", cls: "storage", group: "agents", summary: "get/set/list vault settings + provider\u2192model selector through the daemon" },
1042
+ // Account & workspaces — auth, identity, and the org/workspace/project scope surface.
1043
+ { verb: "login", cls: "auth", group: "account", summary: "authenticate via device flow, or --token <key> for headless (023)" },
1044
+ { verb: "logout", cls: "auth", group: "account", summary: "remove the shared credentials and sign out (023)" },
1045
+ { verb: "whoami", cls: "auth", group: "account", summary: "show the authenticated user, org, and workspace (GET /me)" },
1046
+ { verb: "org", cls: "auth", group: "account", summary: "list/switch org (passthrough to the auth dispatcher)" },
1047
+ { verb: "workspace", cls: "auth", group: "account", summary: "list/switch/use workspace (passthrough to the auth dispatcher)" },
1048
+ { verb: "workspaces", cls: "auth", group: "account", summary: "list workspaces in the active org (alias of `workspace list`)" },
1049
+ { verb: "project", cls: "auth", group: "account", summary: "list/bind/use projects + show the resolved per-folder scope (049d)" },
1050
+ // Setup & system install/onboard, daemon lifecycle, dashboard, hooks, telemetry, update.
1051
+ { verb: "setup", cls: "local", group: "system", summary: "detect assistants, wire hooks, bring up the daemon" },
1052
+ { verb: "install", cls: "local", group: "system", summary: "bring up the daemon (health-gated) + open the dashboard (PRD-050a)" },
1053
+ { verb: "status", cls: "local", group: "system", summary: "daemon connectivity + login + D1\u2013D5 environment health" },
1054
+ { verb: "daemon", cls: "local", group: "system", summary: "start | stop | status the loopback daemon (3850)" },
1055
+ { verb: "dashboard", cls: "local", group: "system", summary: "launch the daemon-served dashboard (020b)" },
1056
+ { verb: "hook", cls: "local", group: "system", summary: "inspect/wire harness hooks" },
1057
+ { verb: "telemetry", cls: "local", group: "system", summary: "show exactly what adoption telemetry has been / would be sent (--show, PRD-050e)" },
1058
+ { verb: "update", cls: "local", group: "system", summary: "self-update the CLI, daemon, and bundles" },
1059
+ { verb: "uninstall", cls: "local", group: "system", summary: "reverse only Honeycomb's changes" }
993
1060
  ]);
994
1061
  var DEFAULT_GLOBAL_FLAGS = Object.freeze({
995
1062
  help: false,