@amodalai/runtime 0.1.25 → 0.1.26
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/dist/src/__tests__/providers.test.d.ts +6 -0
- package/dist/src/__tests__/providers.test.js +209 -0
- package/dist/src/__tests__/providers.test.js.map +1 -0
- package/dist/src/__tests__/sse-contract.test.d.ts +6 -0
- package/dist/src/__tests__/sse-contract.test.js +464 -0
- package/dist/src/__tests__/sse-contract.test.js.map +1 -0
- package/dist/src/__tests__/tools.test.d.ts +6 -0
- package/dist/src/__tests__/tools.test.js +583 -0
- package/dist/src/__tests__/tools.test.js.map +1 -0
- package/dist/src/agent/agent-types.d.ts +2 -2
- package/dist/src/agent/config-watcher.test.js +18 -14
- package/dist/src/agent/config-watcher.test.js.map +1 -1
- package/dist/src/agent/local-server.test.js +17 -13
- package/dist/src/agent/local-server.test.js.map +1 -1
- package/dist/src/agent/proactive/proactive-runner.js +6 -1
- package/dist/src/agent/proactive/proactive-runner.js.map +1 -1
- package/dist/src/agent/routes/admin-chat.js +1 -0
- package/dist/src/agent/routes/admin-chat.js.map +1 -1
- package/dist/src/agent/routes/automations.js +2 -0
- package/dist/src/agent/routes/automations.js.map +1 -1
- package/dist/src/agent/routes/evals.js +1 -0
- package/dist/src/agent/routes/evals.js.map +1 -1
- package/dist/src/agent/routes/files.js +3 -0
- package/dist/src/agent/routes/files.js.map +1 -1
- package/dist/src/agent/routes/inspect.js +4 -1
- package/dist/src/agent/routes/inspect.js.map +1 -1
- package/dist/src/agent/routes/stores.js +4 -0
- package/dist/src/agent/routes/stores.js.map +1 -1
- package/dist/src/agent/routes/task.js +1 -0
- package/dist/src/agent/routes/task.js.map +1 -1
- package/dist/src/agent/routes/webhooks.js +1 -0
- package/dist/src/agent/routes/webhooks.js.map +1 -1
- package/dist/src/config.d.ts +96 -0
- package/dist/src/config.js +221 -0
- package/dist/src/config.js.map +1 -0
- package/dist/src/config.test.d.ts +6 -0
- package/dist/src/config.test.js +235 -0
- package/dist/src/config.test.js.map +1 -0
- package/dist/src/errors.d.ts +145 -0
- package/dist/src/errors.js +218 -0
- package/dist/src/errors.js.map +1 -0
- package/dist/src/errors.test.d.ts +6 -0
- package/dist/src/errors.test.js +203 -0
- package/dist/src/errors.test.js.map +1 -0
- package/dist/src/index.d.ts +6 -1
- package/dist/src/index.js +5 -1
- package/dist/src/index.js.map +1 -1
- package/dist/src/logger.d.ts +15 -31
- package/dist/src/logger.js +19 -78
- package/dist/src/logger.js.map +1 -1
- package/dist/src/logger.test.d.ts +6 -0
- package/dist/src/logger.test.js +198 -0
- package/dist/src/logger.test.js.map +1 -0
- package/dist/src/routes/ai-stream.js +4 -1
- package/dist/src/routes/ai-stream.js.map +1 -1
- package/dist/src/routes/chat-stream.js +3 -1
- package/dist/src/routes/chat-stream.js.map +1 -1
- package/dist/src/routes/chat.js +1 -0
- package/dist/src/routes/chat.js.map +1 -1
- package/dist/src/routes/webhooks.js +3 -1
- package/dist/src/routes/webhooks.js.map +1 -1
- package/dist/src/server.test.js +66 -62
- package/dist/src/server.test.js.map +1 -1
- package/dist/src/session/session-manager.test.js +28 -24
- package/dist/src/session/session-manager.test.js.map +1 -1
- package/dist/src/session/session-runner.test.js +22 -18
- package/dist/src/session/session-runner.test.js.map +1 -1
- package/dist/src/stores/pglite-store-backend.js +6 -0
- package/dist/src/stores/pglite-store-backend.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -2
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Amodal Labs, Inc.
|
|
4
|
+
* SPDX-License-Identifier: MIT
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* A discriminated result type for operations that can fail.
|
|
8
|
+
* Forces callers to handle both success and error cases.
|
|
9
|
+
*/
|
|
10
|
+
export type Result<T, E = Error> = {
|
|
11
|
+
ok: true;
|
|
12
|
+
value: T;
|
|
13
|
+
} | {
|
|
14
|
+
ok: false;
|
|
15
|
+
error: E;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Base error class for all Amodal runtime errors.
|
|
19
|
+
*
|
|
20
|
+
* Every error carries:
|
|
21
|
+
* - `code` — a unique, stable string for programmatic matching
|
|
22
|
+
* - `context` — structured data about what was happening when the error occurred
|
|
23
|
+
* - `cause` — the underlying error (standard Error.cause)
|
|
24
|
+
*/
|
|
25
|
+
export declare class AmodalError extends Error {
|
|
26
|
+
readonly code: string;
|
|
27
|
+
readonly context: Record<string, unknown>;
|
|
28
|
+
constructor(code: string, message: string, context?: Record<string, unknown>, cause?: unknown);
|
|
29
|
+
/**
|
|
30
|
+
* Serialize to a structured object suitable for logging or JSON responses.
|
|
31
|
+
*/
|
|
32
|
+
toJSON(): Record<string, unknown>;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Error from an LLM provider call (Anthropic, OpenAI, Google, etc.).
|
|
36
|
+
*/
|
|
37
|
+
export declare class ProviderError extends AmodalError {
|
|
38
|
+
readonly provider: string;
|
|
39
|
+
readonly statusCode?: number;
|
|
40
|
+
readonly retryable: boolean;
|
|
41
|
+
constructor(message: string, options: {
|
|
42
|
+
provider: string;
|
|
43
|
+
statusCode?: number;
|
|
44
|
+
retryable?: boolean;
|
|
45
|
+
cause?: unknown;
|
|
46
|
+
context?: Record<string, unknown>;
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Thrown on 429 rate limit responses.
|
|
51
|
+
*/
|
|
52
|
+
export declare class RateLimitError extends ProviderError {
|
|
53
|
+
readonly retryAfterMs?: number;
|
|
54
|
+
constructor(message: string, options: {
|
|
55
|
+
provider: string;
|
|
56
|
+
retryAfterMs?: number;
|
|
57
|
+
cause?: unknown;
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Thrown when a provider request times out.
|
|
62
|
+
*/
|
|
63
|
+
export declare class ProviderTimeoutError extends ProviderError {
|
|
64
|
+
constructor(message: string, options: {
|
|
65
|
+
provider: string;
|
|
66
|
+
cause?: unknown;
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Error during tool execution (custom tools, store tools, request tool, etc.).
|
|
71
|
+
*/
|
|
72
|
+
export declare class ToolExecutionError extends AmodalError {
|
|
73
|
+
readonly toolName: string;
|
|
74
|
+
readonly callId: string;
|
|
75
|
+
constructor(message: string, options: {
|
|
76
|
+
toolName: string;
|
|
77
|
+
callId: string;
|
|
78
|
+
cause?: unknown;
|
|
79
|
+
context?: Record<string, unknown>;
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Error from a store backend operation (PGLite, Postgres, etc.).
|
|
84
|
+
*/
|
|
85
|
+
export declare class StoreError extends AmodalError {
|
|
86
|
+
readonly store: string;
|
|
87
|
+
readonly operation: string;
|
|
88
|
+
constructor(message: string, options: {
|
|
89
|
+
store: string;
|
|
90
|
+
operation: string;
|
|
91
|
+
cause?: unknown;
|
|
92
|
+
context?: Record<string, unknown>;
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Error from a connection request (REST API calls, MCP, etc.).
|
|
97
|
+
*/
|
|
98
|
+
export declare class ConnectionError extends AmodalError {
|
|
99
|
+
readonly connection: string;
|
|
100
|
+
readonly action: string;
|
|
101
|
+
constructor(message: string, options: {
|
|
102
|
+
connection: string;
|
|
103
|
+
action: string;
|
|
104
|
+
cause?: unknown;
|
|
105
|
+
context?: Record<string, unknown>;
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Error in session lifecycle (creation, destroy, state transitions).
|
|
110
|
+
*/
|
|
111
|
+
export declare class SessionError extends AmodalError {
|
|
112
|
+
readonly sessionId: string;
|
|
113
|
+
constructor(message: string, options: {
|
|
114
|
+
sessionId: string;
|
|
115
|
+
cause?: unknown;
|
|
116
|
+
context?: Record<string, unknown>;
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Error during context compaction (summarization, truncation).
|
|
121
|
+
*/
|
|
122
|
+
export declare class CompactionError extends AmodalError {
|
|
123
|
+
readonly stage: string;
|
|
124
|
+
constructor(message: string, options: {
|
|
125
|
+
stage: string;
|
|
126
|
+
cause?: unknown;
|
|
127
|
+
context?: Record<string, unknown>;
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Error in configuration loading or validation.
|
|
132
|
+
* Includes a `suggestion` field with actionable fix instructions.
|
|
133
|
+
*/
|
|
134
|
+
export declare class ConfigError extends AmodalError {
|
|
135
|
+
readonly key: string;
|
|
136
|
+
readonly suggestion: string;
|
|
137
|
+
constructor(message: string, options: {
|
|
138
|
+
key: string;
|
|
139
|
+
suggestion?: string;
|
|
140
|
+
cause?: unknown;
|
|
141
|
+
context?: Record<string, unknown>;
|
|
142
|
+
});
|
|
143
|
+
/** Format as a multi-line error message for CLI output. */
|
|
144
|
+
format(): string;
|
|
145
|
+
}
|
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Amodal Labs, Inc.
|
|
4
|
+
* SPDX-License-Identifier: MIT
|
|
5
|
+
*/
|
|
6
|
+
// ---------------------------------------------------------------------------
|
|
7
|
+
// Base error
|
|
8
|
+
// ---------------------------------------------------------------------------
|
|
9
|
+
/**
|
|
10
|
+
* Base error class for all Amodal runtime errors.
|
|
11
|
+
*
|
|
12
|
+
* Every error carries:
|
|
13
|
+
* - `code` — a unique, stable string for programmatic matching
|
|
14
|
+
* - `context` — structured data about what was happening when the error occurred
|
|
15
|
+
* - `cause` — the underlying error (standard Error.cause)
|
|
16
|
+
*/
|
|
17
|
+
export class AmodalError extends Error {
|
|
18
|
+
code;
|
|
19
|
+
context;
|
|
20
|
+
constructor(code, message, context = {}, cause) {
|
|
21
|
+
super(message, { cause });
|
|
22
|
+
this.name = 'AmodalError';
|
|
23
|
+
this.code = code;
|
|
24
|
+
this.context = context;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Serialize to a structured object suitable for logging or JSON responses.
|
|
28
|
+
*/
|
|
29
|
+
toJSON() {
|
|
30
|
+
return {
|
|
31
|
+
name: this.name,
|
|
32
|
+
code: this.code,
|
|
33
|
+
message: this.message,
|
|
34
|
+
context: this.context,
|
|
35
|
+
...(this.cause instanceof Error
|
|
36
|
+
? { cause: { name: this.cause.name, message: this.cause.message } }
|
|
37
|
+
: this.cause !== undefined
|
|
38
|
+
? { cause: String(this.cause) }
|
|
39
|
+
: {}),
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
// ---------------------------------------------------------------------------
|
|
44
|
+
// Provider errors
|
|
45
|
+
// ---------------------------------------------------------------------------
|
|
46
|
+
/**
|
|
47
|
+
* Error from an LLM provider call (Anthropic, OpenAI, Google, etc.).
|
|
48
|
+
*/
|
|
49
|
+
export class ProviderError extends AmodalError {
|
|
50
|
+
provider;
|
|
51
|
+
statusCode;
|
|
52
|
+
retryable;
|
|
53
|
+
constructor(message, options) {
|
|
54
|
+
super('PROVIDER_ERROR', message, {
|
|
55
|
+
provider: options.provider,
|
|
56
|
+
statusCode: options.statusCode,
|
|
57
|
+
...options.context,
|
|
58
|
+
}, options.cause);
|
|
59
|
+
this.name = 'ProviderError';
|
|
60
|
+
this.provider = options.provider;
|
|
61
|
+
this.statusCode = options.statusCode;
|
|
62
|
+
this.retryable = options.retryable ?? false;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Thrown on 429 rate limit responses.
|
|
67
|
+
*/
|
|
68
|
+
export class RateLimitError extends ProviderError {
|
|
69
|
+
retryAfterMs;
|
|
70
|
+
constructor(message, options) {
|
|
71
|
+
super(message, {
|
|
72
|
+
provider: options.provider,
|
|
73
|
+
statusCode: 429,
|
|
74
|
+
retryable: true,
|
|
75
|
+
cause: options.cause,
|
|
76
|
+
context: { retryAfterMs: options.retryAfterMs },
|
|
77
|
+
});
|
|
78
|
+
this.name = 'RateLimitError';
|
|
79
|
+
this.retryAfterMs = options.retryAfterMs;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Thrown when a provider request times out.
|
|
84
|
+
*/
|
|
85
|
+
export class ProviderTimeoutError extends ProviderError {
|
|
86
|
+
constructor(message, options) {
|
|
87
|
+
super(message, {
|
|
88
|
+
provider: options.provider,
|
|
89
|
+
retryable: true,
|
|
90
|
+
cause: options.cause,
|
|
91
|
+
});
|
|
92
|
+
this.name = 'ProviderTimeoutError';
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
// ---------------------------------------------------------------------------
|
|
96
|
+
// Tool errors
|
|
97
|
+
// ---------------------------------------------------------------------------
|
|
98
|
+
/**
|
|
99
|
+
* Error during tool execution (custom tools, store tools, request tool, etc.).
|
|
100
|
+
*/
|
|
101
|
+
export class ToolExecutionError extends AmodalError {
|
|
102
|
+
toolName;
|
|
103
|
+
callId;
|
|
104
|
+
constructor(message, options) {
|
|
105
|
+
super('TOOL_EXECUTION_ERROR', message, {
|
|
106
|
+
toolName: options.toolName,
|
|
107
|
+
callId: options.callId,
|
|
108
|
+
...options.context,
|
|
109
|
+
}, options.cause);
|
|
110
|
+
this.name = 'ToolExecutionError';
|
|
111
|
+
this.toolName = options.toolName;
|
|
112
|
+
this.callId = options.callId;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
// ---------------------------------------------------------------------------
|
|
116
|
+
// Store errors
|
|
117
|
+
// ---------------------------------------------------------------------------
|
|
118
|
+
/**
|
|
119
|
+
* Error from a store backend operation (PGLite, Postgres, etc.).
|
|
120
|
+
*/
|
|
121
|
+
export class StoreError extends AmodalError {
|
|
122
|
+
store;
|
|
123
|
+
operation;
|
|
124
|
+
constructor(message, options) {
|
|
125
|
+
super('STORE_ERROR', message, {
|
|
126
|
+
store: options.store,
|
|
127
|
+
operation: options.operation,
|
|
128
|
+
...options.context,
|
|
129
|
+
}, options.cause);
|
|
130
|
+
this.name = 'StoreError';
|
|
131
|
+
this.store = options.store;
|
|
132
|
+
this.operation = options.operation;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
// ---------------------------------------------------------------------------
|
|
136
|
+
// Connection errors
|
|
137
|
+
// ---------------------------------------------------------------------------
|
|
138
|
+
/**
|
|
139
|
+
* Error from a connection request (REST API calls, MCP, etc.).
|
|
140
|
+
*/
|
|
141
|
+
export class ConnectionError extends AmodalError {
|
|
142
|
+
connection;
|
|
143
|
+
action;
|
|
144
|
+
constructor(message, options) {
|
|
145
|
+
super('CONNECTION_ERROR', message, {
|
|
146
|
+
connection: options.connection,
|
|
147
|
+
action: options.action,
|
|
148
|
+
...options.context,
|
|
149
|
+
}, options.cause);
|
|
150
|
+
this.name = 'ConnectionError';
|
|
151
|
+
this.connection = options.connection;
|
|
152
|
+
this.action = options.action;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
// ---------------------------------------------------------------------------
|
|
156
|
+
// Session errors
|
|
157
|
+
// ---------------------------------------------------------------------------
|
|
158
|
+
/**
|
|
159
|
+
* Error in session lifecycle (creation, destroy, state transitions).
|
|
160
|
+
*/
|
|
161
|
+
export class SessionError extends AmodalError {
|
|
162
|
+
sessionId;
|
|
163
|
+
constructor(message, options) {
|
|
164
|
+
super('SESSION_ERROR', message, {
|
|
165
|
+
sessionId: options.sessionId,
|
|
166
|
+
...options.context,
|
|
167
|
+
}, options.cause);
|
|
168
|
+
this.name = 'SessionError';
|
|
169
|
+
this.sessionId = options.sessionId;
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
// ---------------------------------------------------------------------------
|
|
173
|
+
// Compaction errors
|
|
174
|
+
// ---------------------------------------------------------------------------
|
|
175
|
+
/**
|
|
176
|
+
* Error during context compaction (summarization, truncation).
|
|
177
|
+
*/
|
|
178
|
+
export class CompactionError extends AmodalError {
|
|
179
|
+
stage;
|
|
180
|
+
constructor(message, options) {
|
|
181
|
+
super('COMPACTION_ERROR', message, {
|
|
182
|
+
stage: options.stage,
|
|
183
|
+
...options.context,
|
|
184
|
+
}, options.cause);
|
|
185
|
+
this.name = 'CompactionError';
|
|
186
|
+
this.stage = options.stage;
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
// ---------------------------------------------------------------------------
|
|
190
|
+
// Config errors
|
|
191
|
+
// ---------------------------------------------------------------------------
|
|
192
|
+
/**
|
|
193
|
+
* Error in configuration loading or validation.
|
|
194
|
+
* Includes a `suggestion` field with actionable fix instructions.
|
|
195
|
+
*/
|
|
196
|
+
export class ConfigError extends AmodalError {
|
|
197
|
+
key;
|
|
198
|
+
suggestion;
|
|
199
|
+
constructor(message, options) {
|
|
200
|
+
super('CONFIG_ERROR', message, {
|
|
201
|
+
key: options.key,
|
|
202
|
+
...options.context,
|
|
203
|
+
}, options.cause);
|
|
204
|
+
this.name = 'ConfigError';
|
|
205
|
+
this.key = options.key;
|
|
206
|
+
this.suggestion = options.suggestion ?? '';
|
|
207
|
+
}
|
|
208
|
+
/** Format as a multi-line error message for CLI output. */
|
|
209
|
+
format() {
|
|
210
|
+
const lines = [`Config error: ${this.message}`];
|
|
211
|
+
if (this.key)
|
|
212
|
+
lines.push(` Key: ${this.key}`);
|
|
213
|
+
if (this.suggestion)
|
|
214
|
+
lines.push(` Fix: ${this.suggestion}`);
|
|
215
|
+
return lines.join('\n');
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
//# sourceMappingURL=errors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/errors.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAcH,8EAA8E;AAC9E,aAAa;AACb,8EAA8E;AAE9E;;;;;;;GAOG;AACH,MAAM,OAAO,WAAY,SAAQ,KAAK;IAC3B,IAAI,CAAS;IACb,OAAO,CAA0B;IAE1C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vB,IAAI,CAAC,UAAU,GAAG,OAAO,CAAC,UAAU,IAAI,EAAE,CAAC;IAC7C,CAAC;IAED,2DAA2D;IAC3D,MAAM;QACJ,MAAM,KAAK,GAAG,CAAC,iBAAiB,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC;QAChD,IAAI,IAAI,CAAC,GAAG;YAAE,KAAK,CAAC,IAAI,CAAC,UAAU,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC;QAC/C,IAAI,IAAI,CAAC,UAAU;YAAE,KAAK,CAAC,IAAI,CAAC,UAAU,IAAI,CAAC,UAAU,EAAE,CAAC,CAAC;QAC7D,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC1B,CAAC;CACF"}
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Amodal Labs, Inc.
|
|
4
|
+
* SPDX-License-Identifier: MIT
|
|
5
|
+
*/
|
|
6
|
+
import { describe, it, expect } from 'vitest';
|
|
7
|
+
import { AmodalError, ProviderError, RateLimitError, ProviderTimeoutError, ToolExecutionError, StoreError, ConnectionError, SessionError, CompactionError, ConfigError, } from './errors.js';
|
|
8
|
+
describe('AmodalError', () => {
|
|
9
|
+
it('carries code, message, and context', () => {
|
|
10
|
+
const err = new AmodalError('TEST_CODE', 'something broke', { foo: 'bar' });
|
|
11
|
+
expect(err.code).toBe('TEST_CODE');
|
|
12
|
+
expect(err.message).toBe('something broke');
|
|
13
|
+
expect(err.context).toEqual({ foo: 'bar' });
|
|
14
|
+
expect(err.name).toBe('AmodalError');
|
|
15
|
+
expect(err).toBeInstanceOf(Error);
|
|
16
|
+
});
|
|
17
|
+
it('defaults context to empty object', () => {
|
|
18
|
+
const err = new AmodalError('X', 'msg');
|
|
19
|
+
expect(err.context).toEqual({});
|
|
20
|
+
});
|
|
21
|
+
it('preserves cause chain', () => {
|
|
22
|
+
const cause = new Error('root cause');
|
|
23
|
+
const err = new AmodalError('X', 'wrapped', {}, cause);
|
|
24
|
+
expect(err.cause).toBe(cause);
|
|
25
|
+
});
|
|
26
|
+
it('serializes to JSON with cause', () => {
|
|
27
|
+
const cause = new Error('root');
|
|
28
|
+
const err = new AmodalError('TEST', 'msg', { k: 1 }, cause);
|
|
29
|
+
const json = err.toJSON();
|
|
30
|
+
expect(json).toEqual({
|
|
31
|
+
name: 'AmodalError',
|
|
32
|
+
code: 'TEST',
|
|
33
|
+
message: 'msg',
|
|
34
|
+
context: { k: 1 },
|
|
35
|
+
cause: { name: 'Error', message: 'root' },
|
|
36
|
+
});
|
|
37
|
+
});
|
|
38
|
+
it('serializes to JSON without cause', () => {
|
|
39
|
+
const err = new AmodalError('TEST', 'msg');
|
|
40
|
+
const json = err.toJSON();
|
|
41
|
+
expect(json).not.toHaveProperty('cause');
|
|
42
|
+
});
|
|
43
|
+
it('serializes non-Error cause as string', () => {
|
|
44
|
+
const err = new AmodalError('TEST', 'msg', {}, 'string cause');
|
|
45
|
+
expect(err.toJSON()['cause']).toBe('string cause');
|
|
46
|
+
});
|
|
47
|
+
});
|
|
48
|
+
describe('ProviderError', () => {
|
|
49
|
+
it('has correct code and provider fields', () => {
|
|
50
|
+
const err = new ProviderError('API failed', { provider: 'anthropic', statusCode: 500 });
|
|
51
|
+
expect(err.code).toBe('PROVIDER_ERROR');
|
|
52
|
+
expect(err.provider).toBe('anthropic');
|
|
53
|
+
expect(err.statusCode).toBe(500);
|
|
54
|
+
expect(err.retryable).toBe(false);
|
|
55
|
+
expect(err.name).toBe('ProviderError');
|
|
56
|
+
expect(err).toBeInstanceOf(AmodalError);
|
|
57
|
+
expect(err.context['provider']).toBe('anthropic');
|
|
58
|
+
expect(err.context['statusCode']).toBe(500);
|
|
59
|
+
});
|
|
60
|
+
it('defaults retryable to false', () => {
|
|
61
|
+
const err = new ProviderError('fail', { provider: 'openai' });
|
|
62
|
+
expect(err.retryable).toBe(false);
|
|
63
|
+
});
|
|
64
|
+
});
|
|
65
|
+
describe('RateLimitError', () => {
|
|
66
|
+
it('is a retryable ProviderError with 429 status', () => {
|
|
67
|
+
const err = new RateLimitError('slow down', { provider: 'anthropic', retryAfterMs: 5000 });
|
|
68
|
+
expect(err.statusCode).toBe(429);
|
|
69
|
+
expect(err.retryable).toBe(true);
|
|
70
|
+
expect(err.retryAfterMs).toBe(5000);
|
|
71
|
+
expect(err.name).toBe('RateLimitError');
|
|
72
|
+
expect(err).toBeInstanceOf(ProviderError);
|
|
73
|
+
expect(err).toBeInstanceOf(AmodalError);
|
|
74
|
+
});
|
|
75
|
+
});
|
|
76
|
+
describe('ProviderTimeoutError', () => {
|
|
77
|
+
it('is a retryable ProviderError', () => {
|
|
78
|
+
const err = new ProviderTimeoutError('timed out', { provider: 'google' });
|
|
79
|
+
expect(err.retryable).toBe(true);
|
|
80
|
+
expect(err.name).toBe('ProviderTimeoutError');
|
|
81
|
+
expect(err).toBeInstanceOf(ProviderError);
|
|
82
|
+
});
|
|
83
|
+
});
|
|
84
|
+
describe('ToolExecutionError', () => {
|
|
85
|
+
it('carries tool name and call ID in context', () => {
|
|
86
|
+
const err = new ToolExecutionError('tool crashed', {
|
|
87
|
+
toolName: 'fetch_deals',
|
|
88
|
+
callId: 'call_123',
|
|
89
|
+
context: { args: { limit: 10 } },
|
|
90
|
+
});
|
|
91
|
+
expect(err.code).toBe('TOOL_EXECUTION_ERROR');
|
|
92
|
+
expect(err.toolName).toBe('fetch_deals');
|
|
93
|
+
expect(err.callId).toBe('call_123');
|
|
94
|
+
expect(err.context['toolName']).toBe('fetch_deals');
|
|
95
|
+
expect(err.context['args']).toEqual({ limit: 10 });
|
|
96
|
+
expect(err).toBeInstanceOf(AmodalError);
|
|
97
|
+
});
|
|
98
|
+
});
|
|
99
|
+
describe('StoreError', () => {
|
|
100
|
+
it('carries store name and operation', () => {
|
|
101
|
+
const cause = new Error('PGLite crash');
|
|
102
|
+
const err = new StoreError('write failed', {
|
|
103
|
+
store: 'alerts',
|
|
104
|
+
operation: 'put',
|
|
105
|
+
cause,
|
|
106
|
+
context: { key: 'alert-1' },
|
|
107
|
+
});
|
|
108
|
+
expect(err.code).toBe('STORE_ERROR');
|
|
109
|
+
expect(err.store).toBe('alerts');
|
|
110
|
+
expect(err.operation).toBe('put');
|
|
111
|
+
expect(err.context['key']).toBe('alert-1');
|
|
112
|
+
expect(err.cause).toBe(cause);
|
|
113
|
+
expect(err).toBeInstanceOf(AmodalError);
|
|
114
|
+
});
|
|
115
|
+
});
|
|
116
|
+
describe('ConnectionError', () => {
|
|
117
|
+
it('carries connection name and action', () => {
|
|
118
|
+
const err = new ConnectionError('auth failed', {
|
|
119
|
+
connection: 'typefully',
|
|
120
|
+
action: 'POST /social-sets',
|
|
121
|
+
});
|
|
122
|
+
expect(err.code).toBe('CONNECTION_ERROR');
|
|
123
|
+
expect(err.connection).toBe('typefully');
|
|
124
|
+
expect(err.action).toBe('POST /social-sets');
|
|
125
|
+
expect(err).toBeInstanceOf(AmodalError);
|
|
126
|
+
});
|
|
127
|
+
});
|
|
128
|
+
describe('SessionError', () => {
|
|
129
|
+
it('carries session ID', () => {
|
|
130
|
+
const err = new SessionError('session expired', {
|
|
131
|
+
sessionId: 'sess_abc',
|
|
132
|
+
context: { tenantId: 'tenant_1' },
|
|
133
|
+
});
|
|
134
|
+
expect(err.code).toBe('SESSION_ERROR');
|
|
135
|
+
expect(err.sessionId).toBe('sess_abc');
|
|
136
|
+
expect(err.context['tenantId']).toBe('tenant_1');
|
|
137
|
+
expect(err).toBeInstanceOf(AmodalError);
|
|
138
|
+
});
|
|
139
|
+
});
|
|
140
|
+
describe('CompactionError', () => {
|
|
141
|
+
it('carries stage', () => {
|
|
142
|
+
const err = new CompactionError('summarization failed', { stage: 'pre_summarize' });
|
|
143
|
+
expect(err.code).toBe('COMPACTION_ERROR');
|
|
144
|
+
expect(err.stage).toBe('pre_summarize');
|
|
145
|
+
expect(err).toBeInstanceOf(AmodalError);
|
|
146
|
+
});
|
|
147
|
+
});
|
|
148
|
+
describe('ConfigError', () => {
|
|
149
|
+
it('carries config key', () => {
|
|
150
|
+
const err = new ConfigError('missing API key', {
|
|
151
|
+
key: 'providers.primary.apiKey',
|
|
152
|
+
context: { checked: ['env:ANTHROPIC_API_KEY', 'amodal.json'] },
|
|
153
|
+
});
|
|
154
|
+
expect(err.code).toBe('CONFIG_ERROR');
|
|
155
|
+
expect(err.key).toBe('providers.primary.apiKey');
|
|
156
|
+
expect(err.context['checked']).toEqual(['env:ANTHROPIC_API_KEY', 'amodal.json']);
|
|
157
|
+
expect(err).toBeInstanceOf(AmodalError);
|
|
158
|
+
});
|
|
159
|
+
it('formats a multi-line error with key and suggestion', () => {
|
|
160
|
+
const err = new ConfigError('API key not found', {
|
|
161
|
+
key: 'models.main.provider',
|
|
162
|
+
suggestion: 'Set ANTHROPIC_API_KEY in your .env file.',
|
|
163
|
+
});
|
|
164
|
+
expect(err.format()).toBe('Config error: API key not found\n' +
|
|
165
|
+
' Key: models.main.provider\n' +
|
|
166
|
+
' Fix: Set ANTHROPIC_API_KEY in your .env file.');
|
|
167
|
+
});
|
|
168
|
+
it('formats without suggestion when omitted', () => {
|
|
169
|
+
const err = new ConfigError('bad value', { key: 'stores.backend' });
|
|
170
|
+
expect(err.suggestion).toBe('');
|
|
171
|
+
expect(err.format()).toBe('Config error: bad value\n Key: stores.backend');
|
|
172
|
+
});
|
|
173
|
+
});
|
|
174
|
+
describe('unique error codes', () => {
|
|
175
|
+
it('each subclass has a distinct code', () => {
|
|
176
|
+
const codes = [
|
|
177
|
+
new ProviderError('', { provider: '' }),
|
|
178
|
+
new ToolExecutionError('', { toolName: '', callId: '' }),
|
|
179
|
+
new StoreError('', { store: '', operation: '' }),
|
|
180
|
+
new ConnectionError('', { connection: '', action: '' }),
|
|
181
|
+
new SessionError('', { sessionId: '' }),
|
|
182
|
+
new CompactionError('', { stage: '' }),
|
|
183
|
+
new ConfigError('', { key: '' }),
|
|
184
|
+
].map(e => e.code);
|
|
185
|
+
expect(new Set(codes).size).toBe(codes.length);
|
|
186
|
+
});
|
|
187
|
+
});
|
|
188
|
+
describe('Result type', () => {
|
|
189
|
+
it('narrows on ok check', () => {
|
|
190
|
+
const success = { ok: true, value: 42 };
|
|
191
|
+
const failure = {
|
|
192
|
+
ok: false,
|
|
193
|
+
error: new StoreError('not found', { store: 'alerts', operation: 'get' }),
|
|
194
|
+
};
|
|
195
|
+
if (success.ok) {
|
|
196
|
+
expect(success.value).toBe(42);
|
|
197
|
+
}
|
|
198
|
+
if (!failure.ok) {
|
|
199
|
+
expect(failure.error.store).toBe('alerts');
|
|
200
|
+
}
|
|
201
|
+
});
|
|
202
|
+
});
|
|
203
|
+
//# sourceMappingURL=errors.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.test.js","sourceRoot":"","sources":["../../src/errors.test.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAC,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAC,MAAM,QAAQ,CAAC;AAC5C,OAAO,EACL,WAAW,EACX,aAAa,EACb,cAAc,EACd,oBAAoB,EACpB,kBAAkB,EAClB,UAAU,EACV,eAAe,EACf,YAAY,EACZ,eAAe,EACf,WAAW,GACZ,MAAM,aAAa,CAAC;AAGrB,QAAQ,CAAC,aAAa,EAAE,GAAG,EAAE;IAC3B,EAAE,CAAC,oCAAoC,EAAE,GAAG,EAAE;QAC5C,MAAM,GAAG,GAAG,IAAI,WAAW,CAAC,WAAW,EAAE,iBAAiB,EAAE,EAAC,GAAG,EAAE,KAAK,EAAC,CAAC,CAAC;QAC1E,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QACnC,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC;QAC5C,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,EAAC,GAAG,EAAE,KAAK,EAA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,GAAG,EAAE;QAC7B,MAAM,OAAO,GAA+B,EAAC,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,EAAC,CAAC;QAClE,MAAM,OAAO,GAA+B;YAC1C,EAAE,EAAE,KAAK;YACT,KAAK,EAAE,IAAI,UAAU,CAAC,WAAW,EAAE,EAAC,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,EAAC,CAAC;SACxE,CAAC;QAEF,IAAI,OAAO,CAAC,EAAE,EAAE,CAAC;YACf,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACjC,CAAC;QACD,IAAI,CAAC,OAAO,CAAC,EAAE,EAAE,CAAC;YAChB,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAC7C,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
package/dist/src/index.d.ts
CHANGED
|
@@ -26,4 +26,9 @@ export type { StreamHooks } from './session/session-runner.js';
|
|
|
26
26
|
export { runMessage } from './session/session-runner.js';
|
|
27
27
|
export { routeOutput } from './output/output-router.js';
|
|
28
28
|
export { errorHandler } from './middleware/error-handler.js';
|
|
29
|
-
export {
|
|
29
|
+
export { AmodalError, ProviderError, RateLimitError, ProviderTimeoutError, ToolExecutionError, StoreError, ConnectionError, SessionError, CompactionError, ConfigError, } from './errors.js';
|
|
30
|
+
export type { Result } from './errors.js';
|
|
31
|
+
export { log, setLogLevel, getLogLevel, setLogFormat, getLogFormat, setSanitize, LogLevel, initLogLevel, interceptConsole, verbosityToLogLevel, createLogger } from './logger.js';
|
|
32
|
+
export type { Logger, LoggerConfig, LogFormat } from './logger.js';
|
|
33
|
+
export { loadConfig } from './config.js';
|
|
34
|
+
export type { AgentConfig, ConfigOverrides, LoadConfigOptions, McpServerConfig } from './config.js';
|
package/dist/src/index.js
CHANGED
|
@@ -25,8 +25,12 @@ export { runMessage } from './session/session-runner.js';
|
|
|
25
25
|
export { routeOutput } from './output/output-router.js';
|
|
26
26
|
// Error handler
|
|
27
27
|
export { errorHandler } from './middleware/error-handler.js';
|
|
28
|
+
// Typed error classes
|
|
29
|
+
export { AmodalError, ProviderError, RateLimitError, ProviderTimeoutError, ToolExecutionError, StoreError, ConnectionError, SessionError, CompactionError, ConfigError, } from './errors.js';
|
|
28
30
|
// Logger
|
|
29
|
-
export { log, setLogLevel, getLogLevel, LogLevel, initLogLevel, interceptConsole, verbosityToLogLevel } from './logger.js';
|
|
31
|
+
export { log, setLogLevel, getLogLevel, setLogFormat, getLogFormat, setSanitize, LogLevel, initLogLevel, interceptConsole, verbosityToLogLevel, createLogger } from './logger.js';
|
|
32
|
+
// Config
|
|
33
|
+
export { loadConfig } from './config.js';
|
|
30
34
|
// ---------------------------------------------------------------------------
|
|
31
35
|
// Environment variable parsing
|
|
32
36
|
// ---------------------------------------------------------------------------
|
package/dist/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,YAAY,EAAuB,MAAM,aAAa,CAAC;AAChE,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAElC,MAAM,CAAC,MAAM,cAAc,GAAG,OAAO,CAAC;AAEtC,0BAA0B;AAC1B,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAG3C,OAAO,EAAE,oBAAoB,EAA8B,MAAM,uBAAuB,CAAC;AAEzF,aAAa;AACb,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAE5D,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAE9D,OAAO,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC;AAGxE,gBAAgB;AAChB,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAGlE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