@agentuity/server 0.0.64 → 0.0.66
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/README.md +1 -1
- package/dist/api/api.d.ts +5 -9
- package/dist/api/api.d.ts.map +1 -1
- package/dist/api/api.js +41 -20
- package/dist/api/api.js.map +1 -1
- package/dist/api/db/index.d.ts +5 -0
- package/dist/api/db/index.d.ts.map +1 -0
- package/dist/api/db/index.js +5 -0
- package/dist/api/db/index.js.map +1 -0
- package/dist/api/db/logs.d.ts +39 -0
- package/dist/api/db/logs.d.ts.map +1 -0
- package/dist/api/db/logs.js +59 -0
- package/dist/api/db/logs.js.map +1 -0
- package/dist/api/db/query.d.ts +26 -0
- package/dist/api/db/query.d.ts.map +1 -0
- package/dist/api/db/query.js +49 -0
- package/dist/api/db/query.js.map +1 -0
- package/dist/api/db/tables.d.ts +30 -0
- package/dist/api/db/tables.d.ts.map +1 -0
- package/dist/api/db/tables.js +59 -0
- package/dist/api/db/tables.js.map +1 -0
- package/dist/api/db/util.d.ts +31 -0
- package/dist/api/db/util.d.ts.map +1 -0
- package/dist/api/db/util.js +4 -0
- package/dist/api/db/util.js.map +1 -0
- package/dist/api/index.d.ts +1 -0
- package/dist/api/index.d.ts.map +1 -1
- package/dist/api/index.js +1 -0
- package/dist/api/index.js.map +1 -1
- package/dist/api/region/resources.d.ts +2 -0
- package/dist/api/region/resources.d.ts.map +1 -1
- package/dist/api/region/resources.js +1 -0
- package/dist/api/region/resources.js.map +1 -1
- package/dist/config.d.ts +1 -1
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +16 -3
- package/dist/config.js.map +1 -1
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +7 -2
- package/dist/server.js.map +1 -1
- package/package.json +2 -2
- package/src/api/api.ts +54 -24
- package/src/api/db/index.ts +10 -0
- package/src/api/db/logs.ts +75 -0
- package/src/api/db/query.ts +67 -0
- package/src/api/db/tables.ts +92 -0
- package/src/api/db/util.ts +9 -0
- package/src/api/index.ts +1 -0
- package/src/api/region/resources.ts +1 -0
- package/src/config.ts +18 -3
- package/src/server.ts +6 -2
package/src/config.ts
CHANGED
|
@@ -9,14 +9,29 @@ export interface ServiceUrls {
|
|
|
9
9
|
/**
|
|
10
10
|
* Get service URLs from environment variables with fallback defaults
|
|
11
11
|
*/
|
|
12
|
-
export function getServiceUrls(): ServiceUrls {
|
|
13
|
-
const transportUrl = process.env.AGENTUITY_TRANSPORT_URL || '
|
|
12
|
+
export function getServiceUrls(region?: string): ServiceUrls {
|
|
13
|
+
const transportUrl = process.env.AGENTUITY_TRANSPORT_URL || buildRegionalURL(region, 'catalyst');
|
|
14
14
|
|
|
15
15
|
return {
|
|
16
16
|
keyvalue: process.env.AGENTUITY_KEYVALUE_URL || transportUrl,
|
|
17
17
|
objectstore: process.env.AGENTUITY_OBJECTSTORE_URL || transportUrl,
|
|
18
|
-
stream: process.env.AGENTUITY_STREAM_URL || '
|
|
18
|
+
stream: process.env.AGENTUITY_STREAM_URL || buildRegionalURL(region, 'streams'),
|
|
19
19
|
vector: process.env.AGENTUITY_VECTOR_URL || transportUrl,
|
|
20
20
|
catalyst: process.env.AGENTUITY_CATALYST_URL || transportUrl,
|
|
21
21
|
};
|
|
22
22
|
}
|
|
23
|
+
|
|
24
|
+
function getDomainSuffix(region?: string) {
|
|
25
|
+
if (region === 'local') {
|
|
26
|
+
return 'agentuity.io';
|
|
27
|
+
}
|
|
28
|
+
return 'agentuity.cloud';
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function buildRegionalURL(region?: string, hostname?: string) {
|
|
32
|
+
const suffix = getDomainSuffix(region);
|
|
33
|
+
if (suffix === 'agentuity.io') {
|
|
34
|
+
return `https://${hostname}.${suffix}`;
|
|
35
|
+
}
|
|
36
|
+
return `https://${hostname}-${region}.${suffix}`;
|
|
37
|
+
}
|
package/src/server.ts
CHANGED
|
@@ -56,7 +56,11 @@ const redactHeaders = (kv: Record<string, string>): string => {
|
|
|
56
56
|
const _k = k.toLowerCase();
|
|
57
57
|
const v = kv[k];
|
|
58
58
|
if (sensitiveHeaders.has(_k)) {
|
|
59
|
-
|
|
59
|
+
if (_k === 'authorization' && v.startsWith('Bearer ')) {
|
|
60
|
+
values.push(`${_k}=Bearer ${redact(v.substring(7))}`);
|
|
61
|
+
} else {
|
|
62
|
+
values.push(`${_k}=${redact(v)}`);
|
|
63
|
+
}
|
|
60
64
|
} else {
|
|
61
65
|
values.push(`${_k}=${v}`);
|
|
62
66
|
}
|
|
@@ -117,7 +121,7 @@ class ServerFetchAdapter implements FetchAdapter {
|
|
|
117
121
|
response: res,
|
|
118
122
|
};
|
|
119
123
|
}
|
|
120
|
-
const data = await fromResponse<T>(
|
|
124
|
+
const data = await fromResponse<T>(res);
|
|
121
125
|
return {
|
|
122
126
|
ok: true,
|
|
123
127
|
data,
|