@vellumai/assistant 0.3.6 → 0.3.8

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 (35) hide show
  1. package/package.json +1 -1
  2. package/src/__tests__/send-endpoint-busy.test.ts +284 -0
  3. package/src/__tests__/subagent-manager-notify.test.ts +3 -3
  4. package/src/config/bundled-skills/media-processing/SKILL.md +81 -14
  5. package/src/config/bundled-skills/media-processing/TOOLS.json +3 -3
  6. package/src/config/bundled-skills/media-processing/services/preprocess.ts +3 -3
  7. package/src/config/defaults.ts +1 -1
  8. package/src/config/env-registry.ts +7 -0
  9. package/src/config/memory-schema.ts +3 -3
  10. package/src/config/schema.ts +1 -1
  11. package/src/daemon/daemon-control.ts +44 -6
  12. package/src/daemon/handlers/sessions.ts +20 -0
  13. package/src/daemon/handlers/subagents.ts +10 -3
  14. package/src/daemon/ipc-contract/sessions.ts +6 -0
  15. package/src/daemon/ipc-contract-inventory.json +2 -0
  16. package/src/daemon/ipc-contract.ts +2 -1
  17. package/src/daemon/lifecycle.ts +16 -0
  18. package/src/daemon/server.ts +8 -0
  19. package/src/daemon/session-queue-manager.ts +13 -11
  20. package/src/daemon/session-surfaces.ts +8 -1
  21. package/src/memory/migrations/016-memory-segments-indexes.ts +5 -4
  22. package/src/memory/migrations/017-memory-items-indexes.ts +5 -3
  23. package/src/memory/retriever.ts +4 -1
  24. package/src/memory/schema.ts +0 -1
  25. package/src/permissions/checker.ts +14 -7
  26. package/src/runtime/assistant-event-hub.ts +3 -1
  27. package/src/runtime/http-server.ts +22 -5
  28. package/src/runtime/http-types.ts +22 -0
  29. package/src/runtime/routes/conversation-routes.ts +77 -1
  30. package/src/runtime/routes/pairing-routes.ts +2 -1
  31. package/src/subagent/manager.ts +6 -6
  32. package/src/tools/browser/browser-execution.ts +4 -1
  33. package/src/tools/executor.ts +12 -9
  34. package/src/tools/subagent/message.ts +9 -2
  35. package/src/util/logger.ts +7 -2
@@ -699,15 +699,18 @@ export class ToolExecutor {
699
699
  } catch (err) {
700
700
  const durationMs = Date.now() - startTime;
701
701
  const msg = err instanceof Error ? err.message : String(err);
702
- const isExpected = err instanceof PermissionDeniedError || err instanceof ToolError || err instanceof TokenExpiredError;
703
-
704
- const errorCategory = err instanceof PermissionDeniedError
705
- ? 'permission_denied' as const
706
- : err instanceof TokenExpiredError
707
- ? 'auth' as const
708
- : err instanceof ToolError
709
- ? 'tool_failure' as const
710
- : 'unexpected' as const;
702
+ const isAbort = err instanceof Error && err.name === 'AbortError';
703
+ const isExpected = isAbort || err instanceof PermissionDeniedError || err instanceof ToolError || err instanceof TokenExpiredError;
704
+
705
+ const errorCategory = isAbort
706
+ ? 'tool_failure' as const
707
+ : err instanceof PermissionDeniedError
708
+ ? 'permission_denied' as const
709
+ : err instanceof TokenExpiredError
710
+ ? 'auth' as const
711
+ : err instanceof ToolError
712
+ ? 'tool_failure' as const
713
+ : 'unexpected' as const;
711
714
 
712
715
  emitLifecycleEvent(context, {
713
716
  type: 'error',
@@ -23,9 +23,16 @@ export async function executeSubagentMessage(
23
23
  };
24
24
  }
25
25
 
26
- const sent = manager.sendMessage(subagentId, content);
26
+ const result = manager.sendMessage(subagentId, content);
27
27
 
28
- if (!sent) {
28
+ if (result === 'queue_full') {
29
+ return {
30
+ content: `Subagent "${subagentId}" message queue is full. Please wait for current messages to be processed.`,
31
+ isError: true,
32
+ };
33
+ }
34
+
35
+ if (result !== 'sent') {
29
36
  return {
30
37
  content: `Could not send message to subagent "${subagentId}". It may not exist or be in a terminal state.`,
31
38
  isError: true,
@@ -1,4 +1,4 @@
1
- import { existsSync, mkdirSync, readdirSync, unlinkSync } from 'node:fs';
1
+ import { chmodSync, existsSync, mkdirSync, readdirSync, unlinkSync } from 'node:fs';
2
2
  import { join } from 'node:path';
3
3
  import { Writable } from 'node:stream';
4
4
  import pino from 'pino';
@@ -67,6 +67,8 @@ function buildRotatingLogger(config: LogFileConfig): pino.Logger {
67
67
  const today = formatDate(new Date());
68
68
  const filePath = logFilePathForDate(config.dir, new Date());
69
69
  const fileStream = pino.destination({ dest: filePath, sync: false, mkdir: true, mode: 0o600 });
70
+ // Tighten permissions on pre-existing log files that may have been created with looser modes
71
+ try { chmodSync(filePath, 0o600); } catch { /* best-effort */ }
70
72
 
71
73
  activeLogDate = today;
72
74
  activeLogFileConfig = config;
@@ -130,7 +132,10 @@ function getRootLogger(): pino.Logger {
130
132
  }
131
133
 
132
134
  try {
133
- const fileStream = pino.destination({ dest: getLogPath(), sync: false, mkdir: true, mode: 0o600 });
135
+ const logPath = getLogPath();
136
+ const fileStream = pino.destination({ dest: logPath, sync: false, mkdir: true, mode: 0o600 });
137
+ // Tighten permissions on pre-existing log files that may have been created with looser modes
138
+ try { chmodSync(logPath, 0o600); } catch { /* best-effort */ }
134
139
 
135
140
  if (getDebugMode()) {
136
141
  const prettyStream = pinoPretty({ destination: 2 });