@vellumai/assistant 0.5.12 → 0.5.13

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 (31) hide show
  1. package/Dockerfile +41 -9
  2. package/node_modules/@vellumai/ces-contracts/src/index.ts +7 -0
  3. package/node_modules/@vellumai/ces-contracts/src/rpc.ts +5 -0
  4. package/openapi.yaml +1 -1
  5. package/package.json +1 -1
  6. package/src/__tests__/first-greeting.test.ts +7 -0
  7. package/src/__tests__/navigate-settings-tab.test.ts +6 -2
  8. package/src/__tests__/platform.test.ts +3 -168
  9. package/src/__tests__/skill-feature-flags.test.ts +8 -0
  10. package/src/__tests__/skill-secret-handling-guard.test.ts +212 -0
  11. package/src/__tests__/token-estimator-accuracy.benchmark.test.ts +1 -1
  12. package/src/cli/commands/platform/__tests__/connect.test.ts +224 -0
  13. package/src/cli/commands/platform/__tests__/disconnect.test.ts +237 -0
  14. package/src/cli/commands/platform/__tests__/status.test.ts +246 -0
  15. package/src/config/bundled-skills/messaging/SKILL.md +1 -1
  16. package/src/config/bundled-skills/settings/TOOLS.json +5 -3
  17. package/src/config/bundled-skills/settings/tools/navigate-settings-tab.ts +4 -2
  18. package/src/config/feature-flag-registry.json +1 -1
  19. package/src/credential-execution/client.ts +14 -2
  20. package/src/daemon/first-greeting.ts +6 -1
  21. package/src/daemon/lifecycle.ts +13 -8
  22. package/src/index.ts +0 -12
  23. package/src/memory/conversation-queries.ts +6 -6
  24. package/src/memory/journal-memory.ts +8 -2
  25. package/src/prompts/journal-context.ts +4 -1
  26. package/src/prompts/system-prompt.ts +11 -0
  27. package/src/runtime/http-server.ts +7 -15
  28. package/src/runtime/migrations/rebind-secrets-screen.ts +2 -2
  29. package/src/runtime/routes/secret-routes.ts +9 -2
  30. package/src/tools/browser/browser-manager.ts +2 -2
  31. package/src/util/platform.ts +1 -91
@@ -1,9 +1,4 @@
1
- import {
2
- chmodSync,
3
- existsSync,
4
- mkdirSync,
5
- readFileSync,
6
- } from "node:fs";
1
+ import { chmodSync, existsSync, mkdirSync, readFileSync } from "node:fs";
7
2
  import { homedir } from "node:os";
8
3
  import { join } from "node:path";
9
4
 
@@ -44,90 +39,6 @@ export function getClipboardCommand(): string | null {
44
39
  return null;
45
40
  }
46
41
 
47
-
48
- /**
49
- * Resolve the instance data directory from the lockfile.
50
- *
51
- * Checks both ~/.vellum.lock.json (current) and ~/.vellum.lockfile.json
52
- * (legacy) to support installs that haven't migrated the filename.
53
- *
54
- * Reads the lockfile from homedir() directly (NOT via readLockfile() which
55
- * depends on BASE_DATA_DIR) to avoid circular dependency — this function is
56
- * called at CLI bootstrap before BASE_DATA_DIR is set.
57
- *
58
- * Resolution:
59
- * - If activeAssistant matches a local assistant, returns its instanceDir.
60
- * - If there is exactly one local assistant and no activeAssistant, returns
61
- * its instanceDir (auto-select).
62
- * - Returns undefined in all other cases (no lockfile, no local assistants,
63
- * multiple local assistants with no active selection, malformed JSON).
64
- *
65
- * Synchronous (uses readFileSync) since it runs at bootstrap before any async
66
- * context. Never throws — catches all errors and returns undefined for
67
- * graceful degradation.
68
- */
69
- export function resolveInstanceDataDir(): string | undefined {
70
- try {
71
- const home = homedir();
72
- const candidates = [
73
- join(home, ".vellum.lock.json"),
74
- join(home, ".vellum.lockfile.json"),
75
- ];
76
-
77
- let raw: unknown;
78
- for (const lockPath of candidates) {
79
- if (!existsSync(lockPath)) continue;
80
- try {
81
- const parsed = JSON.parse(readFileSync(lockPath, "utf-8"));
82
- if (parsed && typeof parsed === "object" && !Array.isArray(parsed)) {
83
- raw = parsed;
84
- break;
85
- }
86
- } catch {
87
- // Malformed JSON; try next candidate
88
- }
89
- }
90
- if (!raw || typeof raw !== "object" || Array.isArray(raw)) return undefined;
91
- const lockData = raw as Record<string, unknown>;
92
-
93
- const assistants = lockData.assistants as
94
- | Array<Record<string, unknown>>
95
- | undefined;
96
- if (!Array.isArray(assistants)) return undefined;
97
-
98
- const localAssistants = assistants.filter(
99
- (a) => a.cloud === "local" || a.cloud === undefined,
100
- );
101
- if (localAssistants.length === 0) return undefined;
102
-
103
- const activeAssistant = lockData.activeAssistant as string | undefined;
104
-
105
- if (activeAssistant) {
106
- const match = localAssistants.find(
107
- (a) => a.assistantId === activeAssistant,
108
- );
109
- if (match) {
110
- const resources = match.resources as
111
- | Record<string, unknown>
112
- | undefined;
113
- return resources?.instanceDir as string | undefined;
114
- }
115
- return undefined;
116
- }
117
-
118
- if (localAssistants.length === 1) {
119
- const resources = localAssistants[0].resources as
120
- | Record<string, unknown>
121
- | undefined;
122
- return resources?.instanceDir as string | undefined;
123
- }
124
-
125
- return undefined;
126
- } catch {
127
- return undefined;
128
- }
129
- }
130
-
131
42
  /**
132
43
  * Normalize an assistant ID to its canonical form for DB operations.
133
44
  *
@@ -147,7 +58,6 @@ export function normalizeAssistantId(assistantId: string): string {
147
58
  return assistantId;
148
59
  }
149
60
 
150
-
151
61
  /**
152
62
  * Returns the root ~/.vellum directory. User-facing files (config, prompt
153
63
  * files, skills) and runtime files (socket, PID) live here.