@vellumai/assistant 0.6.1 → 0.6.2

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 (115) hide show
  1. package/docker-entrypoint.sh +12 -2
  2. package/node_modules/@vellumai/ces-contracts/src/handles.ts +7 -9
  3. package/openapi.yaml +1 -1
  4. package/package.json +1 -1
  5. package/src/__tests__/assistant-event-hub.test.ts +30 -0
  6. package/src/__tests__/checker.test.ts +104 -170
  7. package/src/__tests__/cli-command-risk-guard.test.ts +1 -1
  8. package/src/__tests__/context-overflow-approval.test.ts +5 -5
  9. package/src/__tests__/conversation-analysis-routes.test.ts +169 -0
  10. package/src/__tests__/conversation-directories-parse.test.ts +105 -0
  11. package/src/__tests__/credential-execution-approval-bridge.test.ts +0 -2
  12. package/src/__tests__/init-feature-flag-overrides.test.ts +167 -0
  13. package/src/__tests__/inline-command-runner.test.ts +7 -5
  14. package/src/__tests__/log-export-workspace.test.ts +190 -0
  15. package/src/__tests__/managed-credential-catalog-cli.test.ts +12 -14
  16. package/src/__tests__/navigate-settings-tab.test.ts +14 -1
  17. package/src/__tests__/notification-broadcaster.test.ts +65 -0
  18. package/src/__tests__/onboarding-template-contract.test.ts +5 -4
  19. package/src/__tests__/pkb-autoinject.test.ts +96 -0
  20. package/src/__tests__/require-fresh-approval.test.ts +0 -2
  21. package/src/__tests__/sandbox-diagnostics.test.ts +1 -32
  22. package/src/__tests__/terminal-sandbox.test.ts +1 -1
  23. package/src/__tests__/terminal-tools.test.ts +2 -5
  24. package/src/__tests__/test-preload.ts +14 -0
  25. package/src/__tests__/tool-domain-event-publisher.test.ts +0 -1
  26. package/src/__tests__/tool-executor-lifecycle-events.test.ts +1 -8
  27. package/src/__tests__/tool-executor.test.ts +0 -1
  28. package/src/__tests__/transport-hints-queue.test.ts +77 -0
  29. package/src/__tests__/trust-store.test.ts +4 -4
  30. package/src/__tests__/workspace-migration-030-seed-pkb-autoinject.test.ts +168 -0
  31. package/src/__tests__/workspace-policy.test.ts +2 -7
  32. package/src/agent/loop.ts +0 -29
  33. package/src/channels/types.ts +5 -0
  34. package/src/cli/__tests__/run-assistant-command.ts +34 -7
  35. package/src/cli/__tests__/unknown-command.test.ts +33 -0
  36. package/src/cli/commands/default-action.ts +68 -1
  37. package/src/cli/commands/oauth/__tests__/connect.test.ts +27 -0
  38. package/src/cli/commands/oauth/connect.ts +11 -0
  39. package/src/cli/commands/platform/__tests__/connect.test.ts +1 -1
  40. package/src/cli/commands/platform/__tests__/disconnect.test.ts +1 -1
  41. package/src/cli/commands/platform/__tests__/status.test.ts +1 -1
  42. package/src/cli/program.ts +9 -2
  43. package/src/config/assistant-feature-flags.ts +59 -55
  44. package/src/config/bundled-skills/app-builder/SKILL.md +87 -4
  45. package/src/config/bundled-skills/gmail/SKILL.md +11 -6
  46. package/src/config/bundled-skills/gmail/TOOLS.json +1 -1
  47. package/src/config/bundled-skills/gmail/tools/gmail-sender-digest.ts +2 -1
  48. package/src/config/bundled-skills/settings/TOOLS.json +1 -1
  49. package/src/config/bundled-skills/settings/tools/navigate-settings-tab.ts +8 -3
  50. package/src/config/feature-flag-registry.json +2 -2
  51. package/src/config/schemas/services.ts +8 -0
  52. package/src/credential-execution/approval-bridge.ts +0 -1
  53. package/src/credential-execution/managed-catalog.ts +3 -7
  54. package/src/daemon/config-watcher.ts +6 -2
  55. package/src/daemon/context-overflow-approval.ts +0 -1
  56. package/src/daemon/conversation-agent-loop.ts +33 -12
  57. package/src/daemon/conversation-attachments.ts +0 -1
  58. package/src/daemon/conversation-messaging.ts +3 -0
  59. package/src/daemon/conversation-process.ts +18 -2
  60. package/src/daemon/conversation-queue-manager.ts +8 -0
  61. package/src/daemon/conversation-runtime-assembly.ts +64 -7
  62. package/src/daemon/conversation-surfaces.ts +65 -0
  63. package/src/daemon/conversation-tool-setup.ts +0 -3
  64. package/src/daemon/conversation.ts +3 -5
  65. package/src/daemon/handlers/conversations.ts +2 -1
  66. package/src/daemon/handlers/shared.ts +7 -0
  67. package/src/daemon/lifecycle.ts +21 -1
  68. package/src/daemon/message-types/conversations.ts +4 -0
  69. package/src/daemon/message-types/messages.ts +0 -1
  70. package/src/daemon/message-types/notifications.ts +12 -0
  71. package/src/daemon/message-types/settings.ts +12 -0
  72. package/src/daemon/server.ts +21 -24
  73. package/src/daemon/transport-hints.ts +33 -0
  74. package/src/index.ts +1 -1
  75. package/src/memory/conversation-crud.ts +15 -10
  76. package/src/memory/conversation-directories.ts +39 -0
  77. package/src/memory/conversation-group-migration.ts +65 -5
  78. package/src/memory/embedding-local.ts +1 -1
  79. package/src/memory/graph/capability-seed.ts +3 -5
  80. package/src/memory/group-crud.ts +25 -9
  81. package/src/messaging/provider.ts +1 -1
  82. package/src/notifications/broadcaster.ts +6 -0
  83. package/src/notifications/conversation-pairing.ts +12 -4
  84. package/src/notifications/emit-signal.ts +14 -0
  85. package/src/notifications/signal.ts +11 -0
  86. package/src/oauth/platform-connection.test.ts +2 -2
  87. package/src/oauth/seed-providers.ts +1 -0
  88. package/src/permissions/checker.ts +3 -3
  89. package/src/permissions/defaults.ts +7 -8
  90. package/src/permissions/prompter.ts +0 -2
  91. package/src/platform/client.ts +1 -1
  92. package/src/prompts/templates/BOOTSTRAP.md +14 -5
  93. package/src/prompts/templates/SOUL.md +11 -11
  94. package/src/runtime/assistant-event-hub.ts +22 -0
  95. package/src/runtime/auth/token-service.ts +8 -0
  96. package/src/runtime/routes/conversation-analysis-routes.ts +18 -6
  97. package/src/runtime/routes/conversation-routes.ts +9 -3
  98. package/src/runtime/routes/group-routes.ts +22 -8
  99. package/src/runtime/routes/log-export/AGENTS.md +104 -0
  100. package/src/runtime/routes/log-export/__tests__/workspace-allowlist-error-contract.test.ts +103 -0
  101. package/src/runtime/routes/log-export/__tests__/workspace-allowlist.test.ts +716 -0
  102. package/src/runtime/routes/log-export/workspace-allowlist.ts +458 -0
  103. package/src/runtime/routes/log-export-routes.ts +18 -3
  104. package/src/skills/inline-command-runner.ts +12 -14
  105. package/src/tools/permission-checker.ts +0 -18
  106. package/src/tools/secret-detection-handler.ts +0 -1
  107. package/src/tools/skills/sandbox-runner.ts +3 -6
  108. package/src/tools/terminal/sandbox-diagnostics.ts +4 -4
  109. package/src/tools/terminal/sandbox.ts +4 -1
  110. package/src/tools/terminal/shell.ts +3 -5
  111. package/src/tools/types.ts +0 -3
  112. package/src/watcher/provider-types.ts +1 -1
  113. package/src/workspace/migrations/029-seed-pkb.ts +1 -0
  114. package/src/workspace/migrations/030-seed-pkb-autoinject.ts +73 -0
  115. package/src/workspace/migrations/registry.ts +2 -0
@@ -261,11 +261,9 @@ class ShellTool implements Tool {
261
261
  "Executing shell command",
262
262
  );
263
263
 
264
- // Resolve sandbox config early - needed both for proxy env and command wrapping.
265
- const sandboxConfig =
266
- context.sandboxOverride != null
267
- ? { ...config.sandbox, enabled: context.sandboxOverride }
268
- : config.sandbox;
264
+ // The assistant runs exclusively in Docker or platform-managed
265
+ // environments where the container provides isolation.
266
+ const sandboxConfig = { enabled: false } as const;
269
267
 
270
268
  // Acquire proxy session if proxied mode is requested.
271
269
  // `getOrStartSession` serializes per-conversation so concurrent proxied
@@ -34,7 +34,6 @@ export interface ToolPermissionPromptEvent extends ToolLifecycleEventBase {
34
34
  allowlistOptions: AllowlistOption[];
35
35
  scopeOptions: ScopeOption[];
36
36
  diff?: DiffInfo;
37
- sandboxed?: boolean;
38
37
  persistentDecisionsAllowed?: boolean;
39
38
  }
40
39
 
@@ -110,8 +109,6 @@ export interface ToolContext {
110
109
  onOutput?: (chunk: string) => void;
111
110
  /** Abort signal for cooperative cancellation. Tools should check this periodically. */
112
111
  signal?: AbortSignal;
113
- /** Per-conversation sandbox override. When set, takes precedence over the global config. */
114
- sandboxOverride?: boolean;
115
112
  /** Optional callback for tool lifecycle events (start/prompt/deny/execute/error/secret_detected). */
116
113
  onToolLifecycleEvent?: ToolLifecycleEventHandler;
117
114
  /** Optional resolver for proxy tools - delegates execution to an external client. */
@@ -28,7 +28,7 @@ export interface WatcherProvider {
28
28
  id: string;
29
29
  /** Human-readable name. */
30
30
  displayName: string;
31
- /** Credential service required (e.g. 'integration:google'). */
31
+ /** Credential service required (e.g. 'google'). */
32
32
  requiredCredentialService: string;
33
33
 
34
34
  /**
@@ -14,6 +14,7 @@ const INDEX_TEMPLATE = `_ Lines starting with _ are comments - they won't appear
14
14
  - threads.md — Active commitments, follow-ups, and projects in progress
15
15
  - buffer.md — Inbox of recently learned facts (filed periodically)
16
16
 
17
+
17
18
  ## Topics
18
19
  `;
19
20
 
@@ -0,0 +1,73 @@
1
+ import { existsSync, readFileSync, unlinkSync, writeFileSync } from "node:fs";
2
+ import { join } from "node:path";
3
+
4
+ import type { WorkspaceMigration } from "./types.js";
5
+
6
+ const AUTOINJECT_TEMPLATE = `_ Lines starting with _ are comments - they won't appear in the injected context
7
+ _ List one PKB filename per line. These files are loaded into every conversation.
8
+ _ Remove a line to stop autoinjecting that file. Add new filenames to inject more.
9
+
10
+ INDEX.md
11
+ essentials.md
12
+ threads.md
13
+ buffer.md
14
+ `;
15
+
16
+ const INDEX_ENTRY = "- _autoinject.md — Controls which files are loaded into every conversation";
17
+
18
+ export const seedPkbAutoinjectMigration: WorkspaceMigration = {
19
+ id: "030-seed-pkb-autoinject",
20
+ description: "Seed pkb/_autoinject.md for configurable PKB autoinjection",
21
+
22
+ run(workspaceDir: string): void {
23
+ const pkbDir = join(workspaceDir, "pkb");
24
+ if (!existsSync(pkbDir)) return;
25
+
26
+ // Seed _autoinject.md if it doesn't already exist
27
+ const autoinjectPath = join(pkbDir, "_autoinject.md");
28
+ if (!existsSync(autoinjectPath)) {
29
+ writeFileSync(autoinjectPath, AUTOINJECT_TEMPLATE, "utf-8");
30
+ }
31
+
32
+ // Append _autoinject.md entry to INDEX.md if not already present
33
+ const indexPath = join(pkbDir, "INDEX.md");
34
+ if (existsSync(indexPath)) {
35
+ try {
36
+ const indexContent = readFileSync(indexPath, "utf-8");
37
+ if (!indexContent.includes("_autoinject.md")) {
38
+ // Insert after the last "Always Loaded" entry (buffer.md line)
39
+ const bufferLine = "- buffer.md";
40
+ const bufferIdx = indexContent.indexOf(bufferLine);
41
+ if (bufferIdx !== -1) {
42
+ const endOfBufferLine = indexContent.indexOf("\n", bufferIdx);
43
+ const insertAt =
44
+ endOfBufferLine === -1 ? indexContent.length : endOfBufferLine;
45
+ const updated =
46
+ indexContent.slice(0, insertAt) +
47
+ "\n" +
48
+ INDEX_ENTRY +
49
+ indexContent.slice(insertAt);
50
+ writeFileSync(indexPath, updated, "utf-8");
51
+ }
52
+ }
53
+ } catch {
54
+ // INDEX.md unreadable — skip
55
+ }
56
+ }
57
+ },
58
+
59
+ down(workspaceDir: string): void {
60
+ const autoinjectPath = join(workspaceDir, "pkb", "_autoinject.md");
61
+ if (!existsSync(autoinjectPath)) return;
62
+
63
+ try {
64
+ const content = readFileSync(autoinjectPath, "utf-8");
65
+ // Only delete if content matches the template (preserve user edits)
66
+ if (content === AUTOINJECT_TEMPLATE) {
67
+ unlinkSync(autoinjectPath);
68
+ }
69
+ } catch {
70
+ // Unreadable — leave it alone
71
+ }
72
+ },
73
+ };
@@ -26,6 +26,7 @@ import { backfillInstallMetaMigration } from "./026-backfill-install-meta.js";
26
26
  import { removeOrphanedOptimizedImagesCacheMigration } from "./027-remove-orphaned-optimized-images-cache.js";
27
27
  import { recoverConversationsFromDiskViewMigration } from "./028-recover-conversations-from-disk-view.js";
28
28
  import { seedPkbMigration } from "./029-seed-pkb.js";
29
+ import { seedPkbAutoinjectMigration } from "./030-seed-pkb-autoinject.js";
29
30
  import { migrateToWorkspaceVolumeMigration } from "./migrate-to-workspace-volume.js";
30
31
  import type { WorkspaceMigration } from "./types.js";
31
32
 
@@ -63,4 +64,5 @@ export const WORKSPACE_MIGRATIONS: WorkspaceMigration[] = [
63
64
  removeOrphanedOptimizedImagesCacheMigration,
64
65
  recoverConversationsFromDiskViewMigration,
65
66
  seedPkbMigration,
67
+ seedPkbAutoinjectMigration,
66
68
  ];