@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.
Files changed (51) hide show
  1. package/README.md +1 -1
  2. package/dist/api/api.d.ts +5 -9
  3. package/dist/api/api.d.ts.map +1 -1
  4. package/dist/api/api.js +41 -20
  5. package/dist/api/api.js.map +1 -1
  6. package/dist/api/db/index.d.ts +5 -0
  7. package/dist/api/db/index.d.ts.map +1 -0
  8. package/dist/api/db/index.js +5 -0
  9. package/dist/api/db/index.js.map +1 -0
  10. package/dist/api/db/logs.d.ts +39 -0
  11. package/dist/api/db/logs.d.ts.map +1 -0
  12. package/dist/api/db/logs.js +59 -0
  13. package/dist/api/db/logs.js.map +1 -0
  14. package/dist/api/db/query.d.ts +26 -0
  15. package/dist/api/db/query.d.ts.map +1 -0
  16. package/dist/api/db/query.js +49 -0
  17. package/dist/api/db/query.js.map +1 -0
  18. package/dist/api/db/tables.d.ts +30 -0
  19. package/dist/api/db/tables.d.ts.map +1 -0
  20. package/dist/api/db/tables.js +59 -0
  21. package/dist/api/db/tables.js.map +1 -0
  22. package/dist/api/db/util.d.ts +31 -0
  23. package/dist/api/db/util.d.ts.map +1 -0
  24. package/dist/api/db/util.js +4 -0
  25. package/dist/api/db/util.js.map +1 -0
  26. package/dist/api/index.d.ts +1 -0
  27. package/dist/api/index.d.ts.map +1 -1
  28. package/dist/api/index.js +1 -0
  29. package/dist/api/index.js.map +1 -1
  30. package/dist/api/region/resources.d.ts +2 -0
  31. package/dist/api/region/resources.d.ts.map +1 -1
  32. package/dist/api/region/resources.js +1 -0
  33. package/dist/api/region/resources.js.map +1 -1
  34. package/dist/config.d.ts +1 -1
  35. package/dist/config.d.ts.map +1 -1
  36. package/dist/config.js +16 -3
  37. package/dist/config.js.map +1 -1
  38. package/dist/server.d.ts.map +1 -1
  39. package/dist/server.js +7 -2
  40. package/dist/server.js.map +1 -1
  41. package/package.json +2 -2
  42. package/src/api/api.ts +54 -24
  43. package/src/api/db/index.ts +10 -0
  44. package/src/api/db/logs.ts +75 -0
  45. package/src/api/db/query.ts +67 -0
  46. package/src/api/db/tables.ts +92 -0
  47. package/src/api/db/util.ts +9 -0
  48. package/src/api/index.ts +1 -0
  49. package/src/api/region/resources.ts +1 -0
  50. package/src/config.ts +18 -3
  51. 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 || 'https://agentuity.ai';
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 || 'https://streams.agentuity.cloud',
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
- values.push(`${_k}=${redact(v)}`);
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>(method, url, res);
124
+ const data = await fromResponse<T>(res);
121
125
  return {
122
126
  ok: true,
123
127
  data,