@vellumai/assistant 0.4.49 → 0.4.50

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.
Files changed (239) hide show
  1. package/ARCHITECTURE.md +24 -33
  2. package/README.md +3 -3
  3. package/docs/architecture/memory.md +180 -119
  4. package/package.json +2 -2
  5. package/src/__tests__/agent-loop.test.ts +3 -1
  6. package/src/__tests__/anthropic-provider.test.ts +114 -23
  7. package/src/__tests__/approval-cascade.test.ts +1 -15
  8. package/src/__tests__/approval-routes-http.test.ts +2 -0
  9. package/src/__tests__/assistant-feature-flag-guard.test.ts +0 -23
  10. package/src/__tests__/canonical-guardian-store.test.ts +95 -0
  11. package/src/__tests__/checker.test.ts +13 -0
  12. package/src/__tests__/config-schema.test.ts +1 -68
  13. package/src/__tests__/context-memory-e2e.test.ts +11 -100
  14. package/src/__tests__/conversation-routes-guardian-reply.test.ts +8 -0
  15. package/src/__tests__/conversation-routes-slash-commands.test.ts +1 -0
  16. package/src/__tests__/credential-security-e2e.test.ts +1 -0
  17. package/src/__tests__/credential-vault-unit.test.ts +4 -0
  18. package/src/__tests__/credential-vault.test.ts +13 -1
  19. package/src/__tests__/cu-unified-flow.test.ts +532 -0
  20. package/src/__tests__/date-context.test.ts +93 -77
  21. package/src/__tests__/deterministic-verification-control-plane.test.ts +64 -0
  22. package/src/__tests__/guardian-routing-invariants.test.ts +93 -0
  23. package/src/__tests__/history-repair.test.ts +245 -0
  24. package/src/__tests__/host-cu-proxy.test.ts +165 -3
  25. package/src/__tests__/http-user-message-parity.test.ts +1 -0
  26. package/src/__tests__/invite-redemption-service.test.ts +65 -1
  27. package/src/__tests__/keychain-broker-client.test.ts +4 -4
  28. package/src/__tests__/memory-context-benchmark.benchmark.test.ts +56 -18
  29. package/src/__tests__/memory-lifecycle-e2e.test.ts +244 -387
  30. package/src/__tests__/memory-recall-quality.test.ts +244 -407
  31. package/src/__tests__/memory-regressions.experimental.test.ts +126 -101
  32. package/src/__tests__/memory-regressions.test.ts +477 -2841
  33. package/src/__tests__/memory-retrieval.benchmark.test.ts +33 -150
  34. package/src/__tests__/memory-upsert-concurrency.test.ts +5 -244
  35. package/src/__tests__/mime-builder.test.ts +28 -0
  36. package/src/__tests__/native-web-search.test.ts +1 -0
  37. package/src/__tests__/oauth-cli.test.ts +572 -5
  38. package/src/__tests__/oauth-store.test.ts +120 -6
  39. package/src/__tests__/qdrant-collection-migration.test.ts +53 -8
  40. package/src/__tests__/registry.test.ts +0 -1
  41. package/src/__tests__/relay-server.test.ts +46 -1
  42. package/src/__tests__/schedule-tools.test.ts +32 -0
  43. package/src/__tests__/script-proxy-certs.test.ts +1 -1
  44. package/src/__tests__/secret-onetime-send.test.ts +1 -0
  45. package/src/__tests__/secure-keys.test.ts +7 -2
  46. package/src/__tests__/send-endpoint-busy.test.ts +3 -0
  47. package/src/__tests__/session-abort-tool-results.test.ts +1 -14
  48. package/src/__tests__/session-agent-loop-overflow.test.ts +1583 -0
  49. package/src/__tests__/session-agent-loop.test.ts +19 -15
  50. package/src/__tests__/session-confirmation-signals.test.ts +1 -15
  51. package/src/__tests__/session-error.test.ts +124 -2
  52. package/src/__tests__/session-history-web-search.test.ts +918 -0
  53. package/src/__tests__/session-pre-run-repair.test.ts +1 -14
  54. package/src/__tests__/session-provider-retry-repair.test.ts +25 -28
  55. package/src/__tests__/session-queue.test.ts +37 -27
  56. package/src/__tests__/session-runtime-assembly.test.ts +54 -0
  57. package/src/__tests__/session-slash-known.test.ts +1 -15
  58. package/src/__tests__/session-slash-queue.test.ts +1 -15
  59. package/src/__tests__/session-slash-unknown.test.ts +1 -15
  60. package/src/__tests__/session-workspace-cache-state.test.ts +3 -33
  61. package/src/__tests__/session-workspace-injection.test.ts +3 -37
  62. package/src/__tests__/session-workspace-tool-tracking.test.ts +3 -37
  63. package/src/__tests__/skills-install-extract.test.ts +93 -0
  64. package/src/__tests__/skillssh-registry.test.ts +451 -0
  65. package/src/__tests__/trust-store.test.ts +15 -0
  66. package/src/__tests__/voice-invite-redemption.test.ts +32 -1
  67. package/src/agent/ax-tree-compaction.test.ts +51 -0
  68. package/src/agent/loop.ts +39 -12
  69. package/src/approvals/AGENTS.md +1 -1
  70. package/src/approvals/guardian-request-resolvers.ts +14 -2
  71. package/src/bundler/compiler-tools.ts +66 -2
  72. package/src/calls/call-domain.ts +132 -0
  73. package/src/calls/call-store.ts +6 -0
  74. package/src/calls/relay-server.ts +43 -5
  75. package/src/calls/relay-setup-router.ts +17 -1
  76. package/src/calls/twilio-config.ts +1 -1
  77. package/src/calls/types.ts +3 -1
  78. package/src/cli/commands/doctor.ts +4 -3
  79. package/src/cli/commands/mcp.ts +46 -59
  80. package/src/cli/commands/memory.ts +16 -165
  81. package/src/cli/commands/oauth/apps.ts +31 -2
  82. package/src/cli/commands/oauth/connections.ts +431 -97
  83. package/src/cli/commands/oauth/providers.ts +15 -1
  84. package/src/cli/commands/sessions.ts +5 -2
  85. package/src/cli/commands/skills.ts +173 -1
  86. package/src/cli/http-client.ts +0 -20
  87. package/src/cli/main-screen.tsx +2 -2
  88. package/src/cli/program.ts +5 -6
  89. package/src/cli.ts +4 -10
  90. package/src/config/bundled-skills/computer-use/TOOLS.json +1 -1
  91. package/src/config/bundled-skills/computer-use/tools/computer-use-observe.ts +12 -0
  92. package/src/config/bundled-tool-registry.ts +2 -5
  93. package/src/config/schema.ts +1 -12
  94. package/src/config/schemas/memory-lifecycle.ts +0 -9
  95. package/src/config/schemas/memory-processing.ts +0 -180
  96. package/src/config/schemas/memory-retrieval.ts +32 -104
  97. package/src/config/schemas/memory.ts +0 -10
  98. package/src/config/types.ts +0 -4
  99. package/src/context/window-manager.ts +4 -1
  100. package/src/daemon/config-watcher.ts +61 -3
  101. package/src/daemon/daemon-control.ts +1 -1
  102. package/src/daemon/date-context.ts +114 -31
  103. package/src/daemon/handlers/sessions.ts +18 -13
  104. package/src/daemon/handlers/skills.ts +20 -1
  105. package/src/daemon/history-repair.ts +72 -8
  106. package/src/daemon/host-cu-proxy.ts +55 -26
  107. package/src/daemon/lifecycle.ts +31 -3
  108. package/src/daemon/mcp-reload-service.ts +2 -2
  109. package/src/daemon/message-types/computer-use.ts +1 -12
  110. package/src/daemon/message-types/memory.ts +4 -16
  111. package/src/daemon/message-types/messages.ts +1 -0
  112. package/src/daemon/message-types/sessions.ts +4 -0
  113. package/src/daemon/server.ts +12 -1
  114. package/src/daemon/session-agent-loop-handlers.ts +38 -0
  115. package/src/daemon/session-agent-loop.ts +334 -48
  116. package/src/daemon/session-error.ts +89 -6
  117. package/src/daemon/session-history.ts +17 -7
  118. package/src/daemon/session-media-retry.ts +6 -2
  119. package/src/daemon/session-memory.ts +69 -149
  120. package/src/daemon/session-process.ts +10 -1
  121. package/src/daemon/session-runtime-assembly.ts +49 -19
  122. package/src/daemon/session-surfaces.ts +4 -1
  123. package/src/daemon/session-tool-setup.ts +7 -1
  124. package/src/daemon/session.ts +12 -2
  125. package/src/instrument.ts +61 -1
  126. package/src/memory/admin.ts +2 -191
  127. package/src/memory/canonical-guardian-store.ts +38 -2
  128. package/src/memory/conversation-crud.ts +0 -33
  129. package/src/memory/conversation-queries.ts +22 -3
  130. package/src/memory/db-init.ts +28 -0
  131. package/src/memory/embedding-backend.ts +84 -8
  132. package/src/memory/embedding-types.ts +9 -1
  133. package/src/memory/indexer.ts +7 -46
  134. package/src/memory/items-extractor.ts +274 -76
  135. package/src/memory/job-handlers/backfill.ts +2 -127
  136. package/src/memory/job-handlers/cleanup.ts +2 -16
  137. package/src/memory/job-handlers/extraction.ts +2 -138
  138. package/src/memory/job-handlers/index-maintenance.ts +1 -6
  139. package/src/memory/job-handlers/summarization.ts +3 -148
  140. package/src/memory/job-utils.ts +21 -59
  141. package/src/memory/jobs-store.ts +1 -159
  142. package/src/memory/jobs-worker.ts +9 -52
  143. package/src/memory/migrations/104-core-indexes.ts +3 -3
  144. package/src/memory/migrations/149-oauth-tables.ts +2 -0
  145. package/src/memory/migrations/150-oauth-apps-client-secret-path.ts +98 -0
  146. package/src/memory/migrations/151-oauth-providers-ping-url.ts +11 -0
  147. package/src/memory/migrations/152-memory-item-supersession.ts +44 -0
  148. package/src/memory/migrations/153-drop-entity-tables.ts +15 -0
  149. package/src/memory/migrations/154-drop-fts.ts +20 -0
  150. package/src/memory/migrations/155-drop-conflicts.ts +7 -0
  151. package/src/memory/migrations/156-call-session-invite-metadata.ts +24 -0
  152. package/src/memory/migrations/index.ts +7 -0
  153. package/src/memory/qdrant-client.ts +148 -51
  154. package/src/memory/raw-query.ts +1 -1
  155. package/src/memory/retriever.test.ts +294 -273
  156. package/src/memory/retriever.ts +421 -645
  157. package/src/memory/schema/calls.ts +2 -0
  158. package/src/memory/schema/memory-core.ts +3 -48
  159. package/src/memory/schema/oauth.ts +2 -0
  160. package/src/memory/search/formatting.ts +263 -176
  161. package/src/memory/search/lexical.ts +1 -254
  162. package/src/memory/search/ranking.ts +0 -455
  163. package/src/memory/search/semantic.ts +100 -14
  164. package/src/memory/search/staleness.ts +47 -0
  165. package/src/memory/search/tier-classifier.ts +21 -0
  166. package/src/memory/search/types.ts +15 -77
  167. package/src/memory/task-memory-cleanup.ts +4 -6
  168. package/src/messaging/providers/gmail/mime-builder.ts +17 -7
  169. package/src/oauth/byo-connection.test.ts +8 -1
  170. package/src/oauth/oauth-store.ts +113 -27
  171. package/src/oauth/seed-providers.ts +6 -0
  172. package/src/oauth/token-persistence.ts +11 -3
  173. package/src/permissions/defaults.ts +1 -0
  174. package/src/permissions/trust-store.ts +23 -1
  175. package/src/playbooks/playbook-compiler.ts +1 -1
  176. package/src/prompts/system-prompt.ts +18 -2
  177. package/src/providers/anthropic/client.ts +56 -126
  178. package/src/providers/types.ts +7 -1
  179. package/src/runtime/AGENTS.md +9 -0
  180. package/src/runtime/auth/route-policy.ts +6 -3
  181. package/src/runtime/guardian-reply-router.ts +24 -22
  182. package/src/runtime/http-server.ts +2 -2
  183. package/src/runtime/invite-redemption-service.ts +19 -1
  184. package/src/runtime/invite-service.ts +25 -0
  185. package/src/runtime/pending-interactions.ts +2 -2
  186. package/src/runtime/routes/brain-graph-routes.ts +10 -90
  187. package/src/runtime/routes/conversation-routes.ts +9 -1
  188. package/src/runtime/routes/inbound-stages/acl-enforcement.ts +21 -12
  189. package/src/runtime/routes/memory-item-routes.test.ts +754 -0
  190. package/src/runtime/routes/memory-item-routes.ts +503 -0
  191. package/src/runtime/routes/session-management-routes.ts +3 -3
  192. package/src/runtime/routes/settings-routes.ts +2 -2
  193. package/src/runtime/routes/trust-rules-routes.ts +14 -0
  194. package/src/runtime/routes/workspace-routes.ts +2 -1
  195. package/src/security/keychain-broker-client.ts +17 -4
  196. package/src/security/secure-keys.ts +25 -3
  197. package/src/security/token-manager.ts +36 -36
  198. package/src/skills/catalog-install.ts +74 -18
  199. package/src/skills/skillssh-registry.ts +503 -0
  200. package/src/tools/assets/search.ts +5 -1
  201. package/src/tools/computer-use/definitions.ts +0 -10
  202. package/src/tools/computer-use/registry.ts +1 -1
  203. package/src/tools/credentials/vault.ts +1 -3
  204. package/src/tools/memory/definitions.ts +4 -13
  205. package/src/tools/memory/handlers.test.ts +83 -103
  206. package/src/tools/memory/handlers.ts +50 -85
  207. package/src/tools/schedule/create.ts +8 -1
  208. package/src/tools/schedule/update.ts +8 -1
  209. package/src/tools/skills/load.ts +25 -2
  210. package/src/__tests__/clarification-resolver.test.ts +0 -193
  211. package/src/__tests__/conflict-intent-tokenization.test.ts +0 -160
  212. package/src/__tests__/conflict-policy.test.ts +0 -269
  213. package/src/__tests__/conflict-store.test.ts +0 -372
  214. package/src/__tests__/contradiction-checker.test.ts +0 -361
  215. package/src/__tests__/entity-extractor.test.ts +0 -211
  216. package/src/__tests__/entity-search.test.ts +0 -1117
  217. package/src/__tests__/profile-compiler.test.ts +0 -392
  218. package/src/__tests__/session-conflict-gate.test.ts +0 -1228
  219. package/src/__tests__/session-profile-injection.test.ts +0 -557
  220. package/src/config/bundled-skills/knowledge-graph/SKILL.md +0 -25
  221. package/src/config/bundled-skills/knowledge-graph/TOOLS.json +0 -66
  222. package/src/config/bundled-skills/knowledge-graph/tools/graph-query.ts +0 -211
  223. package/src/daemon/session-conflict-gate.ts +0 -167
  224. package/src/daemon/session-dynamic-profile.ts +0 -77
  225. package/src/memory/clarification-resolver.ts +0 -417
  226. package/src/memory/conflict-intent.ts +0 -205
  227. package/src/memory/conflict-policy.ts +0 -127
  228. package/src/memory/conflict-store.ts +0 -410
  229. package/src/memory/contradiction-checker.ts +0 -508
  230. package/src/memory/entity-extractor.ts +0 -535
  231. package/src/memory/format-recall.ts +0 -47
  232. package/src/memory/fts-reconciler.ts +0 -165
  233. package/src/memory/job-handlers/conflict.ts +0 -200
  234. package/src/memory/profile-compiler.ts +0 -195
  235. package/src/memory/recall-cache.ts +0 -117
  236. package/src/memory/search/entity.ts +0 -535
  237. package/src/memory/search/query-expansion.test.ts +0 -70
  238. package/src/memory/search/query-expansion.ts +0 -118
  239. package/src/runtime/routes/mcp-routes.ts +0 -20
@@ -8,6 +8,14 @@ import {
8
8
  readLocalCatalog,
9
9
  uninstallSkillLocally,
10
10
  } from "../../skills/catalog-install.js";
11
+ import type { AuditResponse } from "../../skills/skillssh-registry.js";
12
+ import {
13
+ fetchSkillAudits,
14
+ formatAuditBadges,
15
+ installExternalSkill,
16
+ resolveSkillSource,
17
+ searchSkillsRegistry,
18
+ } from "../../skills/skillssh-registry.js";
11
19
  import { log } from "../logger.js";
12
20
 
13
21
  // ---------------------------------------------------------------------------
@@ -28,9 +36,13 @@ capabilities with pre-built workflows and tools.
28
36
  Examples:
29
37
  $ assistant skills list
30
38
  $ assistant skills list --json
39
+ $ assistant skills search react
40
+ $ assistant skills search react --limit 5 --json
31
41
  $ assistant skills install weather
32
42
  $ assistant skills install weather --overwrite
33
- $ assistant skills uninstall weather`,
43
+ $ assistant skills uninstall weather
44
+ $ assistant skills add vercel-labs/skills@find-skills
45
+ $ assistant skills add vercel-labs/skills/find-skills --overwrite`,
34
46
  );
35
47
 
36
48
  skills
@@ -79,6 +91,102 @@ Examples:
79
91
  }
80
92
  });
81
93
 
94
+ skills
95
+ .command("search <query>")
96
+ .description("Search the skills.sh community registry")
97
+ .option("--limit <n>", "Maximum number of results", "10")
98
+ .option("--json", "Machine-readable JSON output")
99
+ .addHelpText(
100
+ "after",
101
+ `
102
+ Arguments:
103
+ query Free-text search term matched against skill names, descriptions,
104
+ and tags in the skills.sh registry.
105
+
106
+ Searches the skills.sh community registry and displays matching skills
107
+ with install counts and security audit badges (ATH, Socket, Snyk).
108
+ Audit fetch failures are non-fatal — results are still shown without
109
+ security data.
110
+
111
+ Examples:
112
+ $ assistant skills search react
113
+ $ assistant skills search "file management" --limit 3
114
+ $ assistant skills search deploy --json`,
115
+ )
116
+ .action(async (query: string, opts: { limit: string; json?: boolean }) => {
117
+ const json = opts.json ?? false;
118
+ const limit = parseInt(opts.limit, 10) || 10;
119
+
120
+ try {
121
+ const results = await searchSkillsRegistry(query, limit);
122
+
123
+ if (results.length === 0) {
124
+ if (json) {
125
+ console.log(JSON.stringify({ ok: true, results: [], audits: {} }));
126
+ } else {
127
+ log.info(`No skills found for "${query}".`);
128
+ }
129
+ return;
130
+ }
131
+
132
+ // Group skill slugs by source for batch audit lookups
133
+ const sourceToSlugs = new Map<string, string[]>();
134
+ for (const r of results) {
135
+ const slugs = sourceToSlugs.get(r.source) ?? [];
136
+ slugs.push(r.skillId);
137
+ sourceToSlugs.set(r.source, slugs);
138
+ }
139
+
140
+ // Fetch audits for each unique source, keyed by source/skillId
141
+ // to avoid collisions when different sources share the same slug.
142
+ const allAudits: AuditResponse = {};
143
+ for (const [source, slugs] of sourceToSlugs) {
144
+ try {
145
+ const audits = await fetchSkillAudits(source, slugs);
146
+ for (const [skillId, auditData] of Object.entries(audits)) {
147
+ allAudits[`${source}/${skillId}`] = auditData;
148
+ }
149
+ } catch {
150
+ // Audit fetch failures are non-fatal; display results without audits
151
+ }
152
+ }
153
+
154
+ if (json) {
155
+ console.log(
156
+ JSON.stringify({
157
+ ok: true,
158
+ results,
159
+ audits: allAudits,
160
+ }),
161
+ );
162
+ return;
163
+ }
164
+
165
+ log.info(`Search results for "${query}" (${results.length}):\n`);
166
+ for (const r of results) {
167
+ log.info(` ${r.name}`);
168
+ log.info(` ID: ${r.skillId}`);
169
+ log.info(` Source: ${r.source}`);
170
+ log.info(` Installs: ${r.installs}`);
171
+ const auditData = allAudits[`${r.source}/${r.skillId}`];
172
+ if (auditData) {
173
+ log.info(` ${formatAuditBadges(auditData)}`);
174
+ } else {
175
+ log.info(" Security: no audit data");
176
+ }
177
+ log.info("");
178
+ }
179
+ } catch (err) {
180
+ const msg = err instanceof Error ? err.message : String(err);
181
+ if (json) {
182
+ console.log(JSON.stringify({ ok: false, error: msg }));
183
+ } else {
184
+ log.error(`Error: ${msg}`);
185
+ }
186
+ process.exitCode = 1;
187
+ }
188
+ });
189
+
82
190
  skills
83
191
  .command("install <skill-id>")
84
192
  .description("Install a skill from the catalog")
@@ -157,4 +265,68 @@ Examples:
157
265
  process.exitCode = 1;
158
266
  }
159
267
  });
268
+
269
+ skills
270
+ .command("add <source>")
271
+ .description(
272
+ "Install a community skill from the skills.sh registry (GitHub)",
273
+ )
274
+ .option("--overwrite", "Replace an already installed skill")
275
+ .option("--json", "Machine-readable JSON output")
276
+ .addHelpText(
277
+ "after",
278
+ `
279
+ Arguments:
280
+ source Skill source in one of these formats:
281
+ owner/repo@skill-name
282
+ owner/repo/skill-name
283
+ https://github.com/owner/repo/tree/<branch>/skills/skill-name
284
+
285
+ Notes:
286
+ Fetches the skill's SKILL.md and supporting files from the specified GitHub
287
+ repository and installs them into the workspace skills directory. A
288
+ version.json file is written with origin metadata for provenance tracking.
289
+
290
+ Examples:
291
+ $ assistant skills add vercel-labs/skills@find-skills
292
+ $ assistant skills add vercel-labs/skills/find-skills
293
+ $ assistant skills add vercel-labs/skills@find-skills --overwrite`,
294
+ )
295
+ .action(
296
+ async (source: string, opts: { overwrite?: boolean; json?: boolean }) => {
297
+ const json = opts.json ?? false;
298
+
299
+ try {
300
+ const { owner, repo, skillSlug, ref } = resolveSkillSource(source);
301
+
302
+ await installExternalSkill(
303
+ owner,
304
+ repo,
305
+ skillSlug,
306
+ opts.overwrite ?? false,
307
+ ref,
308
+ );
309
+
310
+ if (json) {
311
+ console.log(
312
+ JSON.stringify({
313
+ ok: true,
314
+ skillSlug,
315
+ source: `${owner}/${repo}`,
316
+ }),
317
+ );
318
+ } else {
319
+ log.info(`Installed skill "${skillSlug}" from ${owner}/${repo}.`);
320
+ }
321
+ } catch (err) {
322
+ const msg = err instanceof Error ? err.message : String(err);
323
+ if (json) {
324
+ console.log(JSON.stringify({ ok: false, error: msg }));
325
+ } else {
326
+ log.error(`Error: ${msg}`);
327
+ }
328
+ process.exitCode = 1;
329
+ }
330
+ },
331
+ );
160
332
  }
@@ -64,23 +64,3 @@ export async function httpSend(
64
64
  }
65
65
  return fetch(url, { ...init, headers });
66
66
  }
67
-
68
- // ---------------------------------------------------------------------------
69
- // Health check
70
- // ---------------------------------------------------------------------------
71
-
72
- /**
73
- * Perform an HTTP health check against the daemon's `/healthz` endpoint.
74
- * Returns true if the daemon responds with HTTP 200, false otherwise.
75
- */
76
- export async function httpHealthCheck(timeoutMs = 2000): Promise<boolean> {
77
- try {
78
- const url = `${getHttpBaseUrl()}/healthz`;
79
- const response = await fetch(url, {
80
- signal: AbortSignal.timeout(timeoutMs),
81
- });
82
- return response.ok;
83
- } catch {
84
- return false;
85
- }
86
- }
@@ -1,8 +1,8 @@
1
1
  import { createRequire } from "node:module";
2
2
  import { dirname, join } from "node:path";
3
3
 
4
+ import { getGatewayInternalBaseUrl } from "../config/env.js";
4
5
  import { getWorkspaceDir } from "../util/platform.js";
5
- import { getHttpBaseUrl } from "./http-client.js";
6
6
 
7
7
  const LEFT_PANEL_WIDTH = 36;
8
8
  const RIGHT_LINE_COUNT = 11;
@@ -14,7 +14,7 @@ export interface MainScreenLayout {
14
14
  }
15
15
 
16
16
  export function renderMainScreen(): MainScreenLayout {
17
- const httpUrl = getHttpBaseUrl();
17
+ const httpUrl = getGatewayInternalBaseUrl();
18
18
  const workspace = getWorkspaceDir();
19
19
  const assistantId = workspace.split("/").pop() ?? "vellum";
20
20
 
@@ -1,8 +1,7 @@
1
- import { createRequire } from "node:module";
2
-
3
1
  import { Command } from "commander";
4
2
 
5
3
  import { registerHooksCommand } from "../hooks/cli.js";
4
+ import { APP_VERSION } from "../version.js";
6
5
  import { registerAuditCommand } from "./commands/audit.js";
7
6
  import { registerAutonomyCommand } from "./commands/autonomy.js";
8
7
  import { registerBrowserRelayCommand } from "./commands/browser-relay.js";
@@ -25,13 +24,13 @@ import { registerSessionsCommand } from "./commands/sessions.js";
25
24
  import { registerSkillsCommand } from "./commands/skills.js";
26
25
  import { registerTrustCommand } from "./commands/trust.js";
27
26
 
28
- const require = createRequire(import.meta.url);
29
- const { version } = require("../../package.json") as { version: string };
30
-
31
27
  export function buildCliProgram(): Command {
32
28
  const program = new Command();
33
29
 
34
- program.name("assistant").description("Local AI assistant").version(version);
30
+ program
31
+ .name("assistant")
32
+ .description("Local AI assistant")
33
+ .version(APP_VERSION);
35
34
 
36
35
  registerDefaultAction(program);
37
36
  registerSessionsCommand(program);
package/src/cli.ts CHANGED
@@ -3,7 +3,7 @@ import { appendFileSync, mkdirSync, readFileSync } from "node:fs";
3
3
  import { dirname } from "node:path";
4
4
  import * as readline from "node:readline";
5
5
 
6
- import { httpHealthCheck, httpSend, readHttpToken } from "./cli/http-client.js";
6
+ import { httpSend } from "./cli/http-client.js";
7
7
  import {
8
8
  type MainScreenLayout,
9
9
  renderMainScreen,
@@ -11,6 +11,7 @@ import {
11
11
  updateStatusText,
12
12
  } from "./cli/main-screen.jsx";
13
13
  import { shouldAutoStartDaemon } from "./daemon/connection-policy.js";
14
+ import { isHttpHealthy } from "./daemon/daemon-control.js";
14
15
  import { ensureDaemonRunning } from "./daemon/lifecycle.js";
15
16
  import type {
16
17
  ConfirmationRequest,
@@ -637,7 +638,7 @@ export async function startCli(): Promise<void> {
637
638
  case "memory_recalled":
638
639
  spinner.stop();
639
640
  process.stdout.write(
640
- `\n\x1B[2m[Memory recalled: ${msg.injectedTokens} tokens | lexical ${msg.lexicalHits} | semantic ${msg.semanticHits} | recency ${msg.recencyHits} | entity ${msg.entityHits} | merged ${msg.mergedCount} → selected ${msg.selectedCount}${msg.rerankApplied ? " (reranked)" : ""} | ${msg.provider}/${msg.model} | ${msg.latencyMs}ms]\x1B[0m\n`,
641
+ `\n\x1B[2m[Memory recalled: ${msg.injectedTokens} tokens | t1 ${msg.tier1Count} t2 ${msg.tier2Count} | semantic ${msg.semanticHits} | recency ${msg.recencyHits} | merged ${msg.mergedCount} → selected ${msg.selectedCount}${msg.sparseVectorUsed ? " (sparse)" : ""} | hybrid ${msg.hybridSearchLatencyMs}ms | ${msg.provider}/${msg.model} | ${msg.latencyMs}ms]\x1B[0m\n`,
641
642
  );
642
643
  spinner.start("Thinking...");
643
644
  break;
@@ -885,17 +886,10 @@ export async function startCli(): Promise<void> {
885
886
 
886
887
  /** Connect the SSE event stream for the current conversation. */
887
888
  async function connectSse(): Promise<void> {
888
- const token = readHttpToken();
889
889
  const controller = new AbortController();
890
890
  sseAbortController = controller;
891
891
 
892
892
  const url = `/v1/events?conversationKey=${encodeURIComponent(conversationKey)}`;
893
- const headers: Record<string, string> = {
894
- Accept: "text/event-stream",
895
- };
896
- if (token) {
897
- headers["Authorization"] = `Bearer ${token}`;
898
- }
899
893
 
900
894
  try {
901
895
  const response = await httpSend(url, {
@@ -1010,7 +1004,7 @@ export async function startCli(): Promise<void> {
1010
1004
  try {
1011
1005
  if (shouldAutoStartDaemon()) await ensureDaemonRunning();
1012
1006
  // Verify the daemon is healthy before attempting SSE
1013
- const healthy = await httpHealthCheck(2000);
1007
+ const healthy = await isHttpHealthy();
1014
1008
  if (!healthy) throw new Error("Health check failed");
1015
1009
  await connectSse();
1016
1010
  reconnectDelay = RECONNECT_BASE_DELAY_MS;
@@ -301,7 +301,7 @@
301
301
  },
302
302
  {
303
303
  "name": "computer_use_respond",
304
- "description": "Respond directly to the user with a text answer. Use this when the user is asking a question (about their schedule, meetings, calendar, etc.) rather than asking you to control the computer.",
304
+ "description": "Respond to the user with a text answer instead of performing computer actions. Use this when you can answer directly without interacting with the screen.",
305
305
  "category": "computer-use",
306
306
  "risk": "low",
307
307
  "input_schema": {
@@ -0,0 +1,12 @@
1
+ import { forwardComputerUseProxyTool } from "../../../../tools/computer-use/skill-proxy-bridge.js";
2
+ import type {
3
+ ToolContext,
4
+ ToolExecutionResult,
5
+ } from "../../../../tools/types.js";
6
+
7
+ export async function run(
8
+ input: Record<string, unknown>,
9
+ context: ToolContext,
10
+ ): Promise<ToolExecutionResult> {
11
+ return forwardComputerUseProxyTool("computer_use_observe", input, context);
12
+ }
@@ -48,6 +48,7 @@ import * as computerUseClick from "./bundled-skills/computer-use/tools/computer-
48
48
  import * as computerUseDone from "./bundled-skills/computer-use/tools/computer-use-done.js";
49
49
  import * as computerUseDrag from "./bundled-skills/computer-use/tools/computer-use-drag.js";
50
50
  import * as computerUseKey from "./bundled-skills/computer-use/tools/computer-use-key.js";
51
+ import * as computerUseObserve from "./bundled-skills/computer-use/tools/computer-use-observe.js";
51
52
  import * as computerUseOpenApp from "./bundled-skills/computer-use/tools/computer-use-open-app.js";
52
53
  import * as computerUseRespond from "./bundled-skills/computer-use/tools/computer-use-respond.js";
53
54
  import * as computerUseRunApplescript from "./bundled-skills/computer-use/tools/computer-use-run-applescript.js";
@@ -88,8 +89,6 @@ import * as calendarListEvents from "./bundled-skills/google-calendar/tools/cale
88
89
  import * as calendarRsvp from "./bundled-skills/google-calendar/tools/calendar-rsvp.js";
89
90
  // ── image-studio ───────────────────────────────────────────────────────────────
90
91
  import * as mediaGenerateImage from "./bundled-skills/image-studio/tools/media-generate-image.js";
91
- // ── knowledge-graph ────────────────────────────────────────────────────────────
92
- import * as graphQuery from "./bundled-skills/knowledge-graph/tools/graph-query.js";
93
92
  // ── media-processing ───────────────────────────────────────────────────────────
94
93
  import * as analyzeKeyframes from "./bundled-skills/media-processing/tools/analyze-keyframes.js";
95
94
  import * as extractKeyframes from "./bundled-skills/media-processing/tools/extract-keyframes.js";
@@ -219,6 +218,7 @@ export const bundledToolRegistry = new Map<string, SkillToolScript>([
219
218
  ["claude-code:tools/claude-code.ts", claudeCode],
220
219
 
221
220
  // computer-use
221
+ ["computer-use:tools/computer-use-observe.ts", computerUseObserve],
222
222
  ["computer-use:tools/computer-use-click.ts", computerUseClick],
223
223
  ["computer-use:tools/computer-use-type-text.ts", computerUseTypeText],
224
224
  ["computer-use:tools/computer-use-key.ts", computerUseKey],
@@ -276,9 +276,6 @@ export const bundledToolRegistry = new Map<string, SkillToolScript>([
276
276
  // image-studio
277
277
  ["image-studio:tools/media-generate-image.ts", mediaGenerateImage],
278
278
 
279
- // knowledge-graph
280
- ["knowledge-graph:tools/graph-query.ts", graphQuery],
281
-
282
279
  // media-processing
283
280
  ["media-processing:tools/ingest-media.ts", ingestMedia],
284
281
  ["media-processing:tools/media-status.ts", mediaStatus],
@@ -91,27 +91,16 @@ export {
91
91
  MemoryRetentionConfigSchema,
92
92
  } from "./schemas/memory-lifecycle.js";
93
93
  export type {
94
- MemoryConflictsConfig,
95
- MemoryEntityConfig,
96
94
  MemoryExtractionConfig,
97
- MemoryProfileConfig,
98
95
  MemorySummarizationConfig,
99
96
  } from "./schemas/memory-processing.js";
100
97
  export {
101
- MemoryConflictsConfigSchema,
102
- MemoryEntityConfigSchema,
103
98
  MemoryExtractionConfigSchema,
104
- MemoryProfileConfigSchema,
105
99
  MemorySummarizationConfigSchema,
106
100
  } from "./schemas/memory-processing.js";
107
- export type {
108
- MemoryRerankingConfig,
109
- MemoryRetrievalConfig,
110
- } from "./schemas/memory-retrieval.js";
101
+ export type { MemoryRetrievalConfig } from "./schemas/memory-retrieval.js";
111
102
  export {
112
103
  MemoryDynamicBudgetConfigSchema,
113
- MemoryEarlyTerminationConfigSchema,
114
- MemoryRerankingConfigSchema,
115
104
  MemoryRetrievalConfigSchema,
116
105
  } from "./schemas/memory-retrieval.js";
117
106
  export type {
@@ -33,15 +33,6 @@ export const MemoryCleanupConfigSchema = z.object({
33
33
  .int("memory.cleanup.enqueueIntervalMs must be an integer")
34
34
  .positive("memory.cleanup.enqueueIntervalMs must be a positive integer")
35
35
  .default(6 * 60 * 60 * 1000),
36
- resolvedConflictRetentionMs: z
37
- .number({
38
- error: "memory.cleanup.resolvedConflictRetentionMs must be a number",
39
- })
40
- .int("memory.cleanup.resolvedConflictRetentionMs must be an integer")
41
- .positive(
42
- "memory.cleanup.resolvedConflictRetentionMs must be a positive integer",
43
- )
44
- .default(30 * 24 * 60 * 60 * 1000),
45
36
  supersededItemRetentionMs: z
46
37
  .number({
47
38
  error: "memory.cleanup.supersededItemRetentionMs must be a number",
@@ -1,28 +1,5 @@
1
1
  import { z } from "zod";
2
2
 
3
- const VALID_MEMORY_ITEM_KINDS = [
4
- "preference",
5
- "profile",
6
- "project",
7
- "decision",
8
- "todo",
9
- "fact",
10
- "constraint",
11
- "relationship",
12
- "event",
13
- "opinion",
14
- "instruction",
15
- "style",
16
- ] as const;
17
-
18
- const DEFAULT_CONFLICTABLE_KINDS = [
19
- "preference",
20
- "profile",
21
- "constraint",
22
- "instruction",
23
- "style",
24
- ] as const;
25
-
26
3
  export const MemoryExtractionConfigSchema = z.object({
27
4
  useLLM: z
28
5
  .boolean({ error: "memory.extraction.useLLM must be a boolean" })
@@ -50,166 +27,9 @@ export const MemorySummarizationConfigSchema = z.object({
50
27
  .default("latency-optimized"),
51
28
  });
52
29
 
53
- export const MemoryEntityConfigSchema = z.object({
54
- enabled: z
55
- .boolean({ error: "memory.entity.enabled must be a boolean" })
56
- .default(true),
57
- modelIntent: z
58
- .enum(["latency-optimized", "quality-optimized", "vision-optimized"], {
59
- error: "memory.entity.modelIntent must be a valid model intent",
60
- })
61
- .default("latency-optimized"),
62
- extractRelations: z
63
- .object({
64
- enabled: z
65
- .boolean({
66
- error: "memory.entity.extractRelations.enabled must be a boolean",
67
- })
68
- .default(true),
69
- backfillBatchSize: z
70
- .number({
71
- error:
72
- "memory.entity.extractRelations.backfillBatchSize must be a number",
73
- })
74
- .int(
75
- "memory.entity.extractRelations.backfillBatchSize must be an integer",
76
- )
77
- .positive(
78
- "memory.entity.extractRelations.backfillBatchSize must be a positive integer",
79
- )
80
- .default(200),
81
- })
82
- .default({ enabled: true, backfillBatchSize: 200 }),
83
- relationRetrieval: z
84
- .object({
85
- enabled: z
86
- .boolean({
87
- error: "memory.entity.relationRetrieval.enabled must be a boolean",
88
- })
89
- .default(true),
90
- maxSeedEntities: z
91
- .number({
92
- error:
93
- "memory.entity.relationRetrieval.maxSeedEntities must be a number",
94
- })
95
- .int(
96
- "memory.entity.relationRetrieval.maxSeedEntities must be an integer",
97
- )
98
- .positive(
99
- "memory.entity.relationRetrieval.maxSeedEntities must be a positive integer",
100
- )
101
- .default(8),
102
- maxNeighborEntities: z
103
- .number({
104
- error:
105
- "memory.entity.relationRetrieval.maxNeighborEntities must be a number",
106
- })
107
- .int(
108
- "memory.entity.relationRetrieval.maxNeighborEntities must be an integer",
109
- )
110
- .positive(
111
- "memory.entity.relationRetrieval.maxNeighborEntities must be a positive integer",
112
- )
113
- .default(20),
114
- maxEdges: z
115
- .number({
116
- error: "memory.entity.relationRetrieval.maxEdges must be a number",
117
- })
118
- .int("memory.entity.relationRetrieval.maxEdges must be an integer")
119
- .positive(
120
- "memory.entity.relationRetrieval.maxEdges must be a positive integer",
121
- )
122
- .default(40),
123
- neighborScoreMultiplier: z
124
- .number({
125
- error:
126
- "memory.entity.relationRetrieval.neighborScoreMultiplier must be a number",
127
- })
128
- .gt(
129
- 0,
130
- "memory.entity.relationRetrieval.neighborScoreMultiplier must be > 0",
131
- )
132
- .lte(
133
- 1,
134
- "memory.entity.relationRetrieval.neighborScoreMultiplier must be <= 1",
135
- )
136
- .default(0.7),
137
- maxDepth: z
138
- .number({
139
- error: "memory.entity.relationRetrieval.maxDepth must be a number",
140
- })
141
- .int("memory.entity.relationRetrieval.maxDepth must be an integer")
142
- .positive(
143
- "memory.entity.relationRetrieval.maxDepth must be a positive integer",
144
- )
145
- .default(3),
146
- depthDecay: z
147
- .boolean({
148
- error: "memory.entity.relationRetrieval.depthDecay must be a boolean",
149
- })
150
- .default(true),
151
- })
152
- .default({
153
- enabled: true,
154
- maxSeedEntities: 8,
155
- maxNeighborEntities: 20,
156
- maxEdges: 40,
157
- neighborScoreMultiplier: 0.7,
158
- maxDepth: 3,
159
- depthDecay: true,
160
- }),
161
- });
162
-
163
- export const MemoryConflictsConfigSchema = z.object({
164
- enabled: z
165
- .boolean({ error: "memory.conflicts.enabled must be a boolean" })
166
- .default(true),
167
- gateMode: z
168
- .enum(["soft"], { error: 'memory.conflicts.gateMode must be "soft"' })
169
- .default("soft"),
170
- resolverLlmTimeoutMs: z
171
- .number({ error: "memory.conflicts.resolverLlmTimeoutMs must be a number" })
172
- .int("memory.conflicts.resolverLlmTimeoutMs must be an integer")
173
- .positive(
174
- "memory.conflicts.resolverLlmTimeoutMs must be a positive integer",
175
- )
176
- .default(12000),
177
- relevanceThreshold: z
178
- .number({ error: "memory.conflicts.relevanceThreshold must be a number" })
179
- .min(0, "memory.conflicts.relevanceThreshold must be >= 0")
180
- .max(1, "memory.conflicts.relevanceThreshold must be <= 1")
181
- .default(0.3),
182
- conflictableKinds: z
183
- .array(
184
- z.enum(VALID_MEMORY_ITEM_KINDS, {
185
- error: `memory.conflicts.conflictableKinds entries must be one of: ${VALID_MEMORY_ITEM_KINDS.join(
186
- ", ",
187
- )}`,
188
- }),
189
- )
190
- .nonempty({
191
- message: "memory.conflicts.conflictableKinds must not be empty",
192
- })
193
- .default([...DEFAULT_CONFLICTABLE_KINDS]),
194
- });
195
-
196
- export const MemoryProfileConfigSchema = z.object({
197
- enabled: z
198
- .boolean({ error: "memory.profile.enabled must be a boolean" })
199
- .default(true),
200
- maxInjectTokens: z
201
- .number({ error: "memory.profile.maxInjectTokens must be a number" })
202
- .int("memory.profile.maxInjectTokens must be an integer")
203
- .positive("memory.profile.maxInjectTokens must be a positive integer")
204
- .default(800),
205
- });
206
-
207
30
  export type MemoryExtractionConfig = z.infer<
208
31
  typeof MemoryExtractionConfigSchema
209
32
  >;
210
33
  export type MemorySummarizationConfig = z.infer<
211
34
  typeof MemorySummarizationConfigSchema
212
35
  >;
213
- export type MemoryEntityConfig = z.infer<typeof MemoryEntityConfigSchema>;
214
- export type MemoryConflictsConfig = z.infer<typeof MemoryConflictsConfigSchema>;
215
- export type MemoryProfileConfig = z.infer<typeof MemoryProfileConfigSchema>;