@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.
- package/package.json +1 -1
- package/src/__tests__/send-endpoint-busy.test.ts +284 -0
- package/src/__tests__/subagent-manager-notify.test.ts +3 -3
- package/src/config/bundled-skills/media-processing/SKILL.md +81 -14
- package/src/config/bundled-skills/media-processing/TOOLS.json +3 -3
- package/src/config/bundled-skills/media-processing/services/preprocess.ts +3 -3
- package/src/config/defaults.ts +1 -1
- package/src/config/env-registry.ts +7 -0
- package/src/config/memory-schema.ts +3 -3
- package/src/config/schema.ts +1 -1
- package/src/daemon/daemon-control.ts +44 -6
- package/src/daemon/handlers/sessions.ts +20 -0
- package/src/daemon/handlers/subagents.ts +10 -3
- package/src/daemon/ipc-contract/sessions.ts +6 -0
- package/src/daemon/ipc-contract-inventory.json +2 -0
- package/src/daemon/ipc-contract.ts +2 -1
- package/src/daemon/lifecycle.ts +16 -0
- package/src/daemon/server.ts +8 -0
- package/src/daemon/session-queue-manager.ts +13 -11
- package/src/daemon/session-surfaces.ts +8 -1
- package/src/memory/migrations/016-memory-segments-indexes.ts +5 -4
- package/src/memory/migrations/017-memory-items-indexes.ts +5 -3
- package/src/memory/retriever.ts +4 -1
- package/src/memory/schema.ts +0 -1
- package/src/permissions/checker.ts +14 -7
- package/src/runtime/assistant-event-hub.ts +3 -1
- package/src/runtime/http-server.ts +22 -5
- package/src/runtime/http-types.ts +22 -0
- package/src/runtime/routes/conversation-routes.ts +77 -1
- package/src/runtime/routes/pairing-routes.ts +2 -1
- package/src/subagent/manager.ts +6 -6
- package/src/tools/browser/browser-execution.ts +4 -1
- package/src/tools/executor.ts +12 -9
- package/src/tools/subagent/message.ts +9 -2
- package/src/util/logger.ts +7 -2
package/src/tools/executor.ts
CHANGED
|
@@ -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
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
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
|
|
26
|
+
const result = manager.sendMessage(subagentId, content);
|
|
27
27
|
|
|
28
|
-
if (
|
|
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,
|
package/src/util/logger.ts
CHANGED
|
@@ -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
|
|
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 });
|