@agentuity/server 1.0.1 → 1.0.3
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/AGENTS.md +38 -34
- package/dist/api/api.d.ts +32 -2
- package/dist/api/api.d.ts.map +1 -1
- package/dist/api/api.js +14 -2
- package/dist/api/api.js.map +1 -1
- package/dist/api/apikey/create.d.ts +12 -2
- package/dist/api/apikey/create.d.ts.map +1 -1
- package/dist/api/apikey/create.js +2 -2
- package/dist/api/apikey/create.js.map +1 -1
- package/dist/api/apikey/delete.d.ts +9 -0
- package/dist/api/apikey/delete.d.ts.map +1 -1
- package/dist/api/apikey/delete.js +1 -1
- package/dist/api/apikey/delete.js.map +1 -1
- package/dist/api/apikey/get.d.ts +21 -2
- package/dist/api/apikey/get.d.ts.map +1 -1
- package/dist/api/apikey/get.js +2 -2
- package/dist/api/apikey/get.js.map +1 -1
- package/dist/api/apikey/index.d.ts +1 -0
- package/dist/api/apikey/index.d.ts.map +1 -1
- package/dist/api/apikey/index.js +1 -0
- package/dist/api/apikey/index.js.map +1 -1
- package/dist/api/apikey/list.d.ts +1 -2
- package/dist/api/apikey/list.d.ts.map +1 -1
- package/dist/api/apikey/list.js +1 -1
- package/dist/api/apikey/list.js.map +1 -1
- package/dist/api/db/index.d.ts +4 -4
- package/dist/api/db/index.d.ts.map +1 -1
- package/dist/api/db/index.js +4 -4
- package/dist/api/db/index.js.map +1 -1
- package/dist/api/db/logs.d.ts +34 -3
- package/dist/api/db/logs.d.ts.map +1 -1
- package/dist/api/db/logs.js +4 -4
- package/dist/api/db/logs.js.map +1 -1
- package/dist/api/db/query.d.ts +14 -1
- package/dist/api/db/query.d.ts.map +1 -1
- package/dist/api/db/query.js +2 -2
- package/dist/api/db/query.js.map +1 -1
- package/dist/api/db/tables.d.ts +21 -2
- package/dist/api/db/tables.d.ts.map +1 -1
- package/dist/api/db/tables.js +2 -2
- package/dist/api/db/tables.js.map +1 -1
- package/dist/api/eval/get.d.ts +21 -3
- package/dist/api/eval/get.d.ts.map +1 -1
- package/dist/api/eval/get.js +2 -2
- package/dist/api/eval/get.js.map +1 -1
- package/dist/api/eval/index.d.ts +4 -4
- package/dist/api/eval/index.d.ts.map +1 -1
- package/dist/api/eval/index.js +4 -4
- package/dist/api/eval/index.js.map +1 -1
- package/dist/api/eval/list.d.ts +31 -3
- package/dist/api/eval/list.d.ts.map +1 -1
- package/dist/api/eval/list.js +3 -3
- package/dist/api/eval/list.js.map +1 -1
- package/dist/api/eval/run-get.d.ts +27 -3
- package/dist/api/eval/run-get.d.ts.map +1 -1
- package/dist/api/eval/run-get.js +2 -2
- package/dist/api/eval/run-get.js.map +1 -1
- package/dist/api/eval/run-list.d.ts +43 -3
- package/dist/api/eval/run-list.d.ts.map +1 -1
- package/dist/api/eval/run-list.js +3 -3
- package/dist/api/eval/run-list.js.map +1 -1
- 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/machine/machine.d.ts +134 -3
- package/dist/api/machine/machine.d.ts.map +1 -1
- package/dist/api/machine/machine.js +11 -11
- package/dist/api/machine/machine.js.map +1 -1
- package/dist/api/org/env-delete.d.ts +10 -3
- package/dist/api/org/env-delete.d.ts.map +1 -1
- package/dist/api/org/env-delete.js +2 -2
- package/dist/api/org/env-delete.js.map +1 -1
- package/dist/api/org/env-get.d.ts +14 -1
- package/dist/api/org/env-get.d.ts.map +1 -1
- package/dist/api/org/env-get.js +2 -2
- package/dist/api/org/env-get.js.map +1 -1
- package/dist/api/org/env-update.d.ts +10 -3
- package/dist/api/org/env-update.d.ts.map +1 -1
- package/dist/api/org/env-update.js +2 -2
- package/dist/api/org/env-update.js.map +1 -1
- package/dist/api/org/list.d.ts +2 -3
- package/dist/api/org/list.d.ts.map +1 -1
- package/dist/api/org/list.js +2 -2
- package/dist/api/org/list.js.map +1 -1
- package/dist/api/org/resources.d.ts +4 -5
- package/dist/api/org/resources.d.ts.map +1 -1
- package/dist/api/org/resources.js +4 -4
- package/dist/api/org/resources.js.map +1 -1
- package/dist/api/project/agent.d.ts +55 -2
- package/dist/api/project/agent.d.ts.map +1 -1
- package/dist/api/project/agent.js +3 -3
- package/dist/api/project/agent.js.map +1 -1
- package/dist/api/project/create.d.ts +5 -6
- package/dist/api/project/create.d.ts.map +1 -1
- package/dist/api/project/create.js +3 -3
- package/dist/api/project/create.js.map +1 -1
- package/dist/api/project/delete.d.ts +13 -1
- package/dist/api/project/delete.d.ts.map +1 -1
- package/dist/api/project/delete.js +2 -2
- package/dist/api/project/delete.js.map +1 -1
- package/dist/api/project/deploy.d.ts +233 -9
- package/dist/api/project/deploy.d.ts.map +1 -1
- package/dist/api/project/deploy.js +23 -23
- package/dist/api/project/deploy.js.map +1 -1
- package/dist/api/project/deployment.d.ts +163 -3
- package/dist/api/project/deployment.d.ts.map +1 -1
- package/dist/api/project/deployment.js +8 -8
- package/dist/api/project/deployment.js.map +1 -1
- package/dist/api/project/env-delete.d.ts +10 -3
- package/dist/api/project/env-delete.d.ts.map +1 -1
- package/dist/api/project/env-delete.js +6 -2
- package/dist/api/project/env-delete.js.map +1 -1
- package/dist/api/project/env-update.d.ts +17 -3
- package/dist/api/project/env-update.d.ts.map +1 -1
- package/dist/api/project/env-update.js +2 -2
- package/dist/api/project/env-update.js.map +1 -1
- package/dist/api/project/exists.d.ts +4 -5
- package/dist/api/project/exists.d.ts.map +1 -1
- package/dist/api/project/exists.js +3 -3
- package/dist/api/project/exists.js.map +1 -1
- package/dist/api/project/get.d.ts +22 -4
- package/dist/api/project/get.d.ts.map +1 -1
- package/dist/api/project/get.js +3 -3
- package/dist/api/project/get.js.map +1 -1
- package/dist/api/project/list.d.ts +13 -5
- package/dist/api/project/list.d.ts.map +1 -1
- package/dist/api/project/list.js +4 -3
- package/dist/api/project/list.js.map +1 -1
- package/dist/api/project/malware.d.ts +41 -7
- package/dist/api/project/malware.d.ts.map +1 -1
- package/dist/api/project/malware.js +9 -9
- package/dist/api/project/malware.js.map +1 -1
- package/dist/api/project/update-region.d.ts +15 -1
- package/dist/api/project/update-region.d.ts.map +1 -1
- package/dist/api/project/update-region.js +2 -2
- package/dist/api/project/update-region.js.map +1 -1
- package/dist/api/queue/analytics.d.ts +144 -2
- package/dist/api/queue/analytics.d.ts.map +1 -1
- package/dist/api/queue/analytics.js +5 -5
- package/dist/api/queue/analytics.js.map +1 -1
- package/dist/api/queue/destinations.d.ts +96 -2
- package/dist/api/queue/destinations.d.ts.map +1 -1
- package/dist/api/queue/destinations.js +7 -7
- package/dist/api/queue/destinations.js.map +1 -1
- package/dist/api/queue/dlq.d.ts +70 -2
- package/dist/api/queue/dlq.d.ts.map +1 -1
- package/dist/api/queue/dlq.js +5 -5
- package/dist/api/queue/dlq.js.map +1 -1
- package/dist/api/queue/index.d.ts +9 -9
- package/dist/api/queue/index.d.ts.map +1 -1
- package/dist/api/queue/index.js +11 -11
- package/dist/api/queue/index.js.map +1 -1
- package/dist/api/queue/messages.d.ts +173 -2
- package/dist/api/queue/messages.d.ts.map +1 -1
- package/dist/api/queue/messages.js +10 -10
- package/dist/api/queue/messages.js.map +1 -1
- package/dist/api/queue/queues.d.ts +75 -2
- package/dist/api/queue/queues.d.ts.map +1 -1
- package/dist/api/queue/queues.js +6 -6
- package/dist/api/queue/queues.js.map +1 -1
- package/dist/api/queue/sources.d.ts +72 -2
- package/dist/api/queue/sources.d.ts.map +1 -1
- package/dist/api/queue/sources.js +6 -6
- package/dist/api/queue/sources.js.map +1 -1
- package/dist/api/region/create.d.ts +18 -4
- package/dist/api/region/create.d.ts.map +1 -1
- package/dist/api/region/create.js +5 -5
- package/dist/api/region/create.js.map +1 -1
- package/dist/api/region/delete.d.ts +17 -4
- package/dist/api/region/delete.d.ts.map +1 -1
- package/dist/api/region/delete.js +5 -5
- package/dist/api/region/delete.js.map +1 -1
- package/dist/api/region/list.d.ts +2 -3
- package/dist/api/region/list.d.ts.map +1 -1
- package/dist/api/region/list.js +2 -2
- package/dist/api/region/list.js.map +1 -1
- package/dist/api/region/resources.d.ts +2 -3
- package/dist/api/region/resources.d.ts.map +1 -1
- package/dist/api/region/resources.js +2 -2
- package/dist/api/region/resources.js.map +1 -1
- package/dist/api/sandbox/cli-list.d.ts +98 -0
- package/dist/api/sandbox/cli-list.d.ts.map +1 -0
- package/dist/api/sandbox/cli-list.js +63 -0
- package/dist/api/sandbox/cli-list.js.map +1 -0
- package/dist/api/sandbox/create.d.ts +82 -1
- package/dist/api/sandbox/create.d.ts.map +1 -1
- package/dist/api/sandbox/create.js +14 -10
- package/dist/api/sandbox/create.js.map +1 -1
- package/dist/api/sandbox/destroy.d.ts +9 -1
- package/dist/api/sandbox/destroy.d.ts.map +1 -1
- package/dist/api/sandbox/destroy.js +2 -2
- package/dist/api/sandbox/destroy.js.map +1 -1
- package/dist/api/sandbox/execute.d.ts +49 -1
- package/dist/api/sandbox/execute.d.ts.map +1 -1
- package/dist/api/sandbox/execute.js +4 -4
- package/dist/api/sandbox/execute.js.map +1 -1
- package/dist/api/sandbox/execution.d.ts +104 -1
- package/dist/api/sandbox/execution.d.ts.map +1 -1
- package/dist/api/sandbox/execution.js +5 -5
- package/dist/api/sandbox/execution.js.map +1 -1
- package/dist/api/sandbox/files.d.ts +100 -0
- package/dist/api/sandbox/files.d.ts.map +1 -1
- package/dist/api/sandbox/files.js +16 -16
- package/dist/api/sandbox/files.js.map +1 -1
- package/dist/api/sandbox/get.d.ts +233 -1
- package/dist/api/sandbox/get.d.ts.map +1 -1
- package/dist/api/sandbox/get.js +12 -12
- package/dist/api/sandbox/get.js.map +1 -1
- package/dist/api/sandbox/index.d.ts +25 -21
- package/dist/api/sandbox/index.d.ts.map +1 -1
- package/dist/api/sandbox/index.js +13 -11
- package/dist/api/sandbox/index.js.map +1 -1
- package/dist/api/sandbox/list.d.ts +230 -1
- package/dist/api/sandbox/list.d.ts.map +1 -1
- package/dist/api/sandbox/list.js +9 -9
- package/dist/api/sandbox/list.js.map +1 -1
- package/dist/api/sandbox/resolve.d.ts +82 -0
- package/dist/api/sandbox/resolve.d.ts.map +1 -0
- package/dist/api/sandbox/resolve.js +71 -0
- package/dist/api/sandbox/resolve.js.map +1 -0
- package/dist/api/sandbox/run.d.ts.map +1 -1
- package/dist/api/sandbox/run.js +6 -0
- package/dist/api/sandbox/run.js.map +1 -1
- package/dist/api/sandbox/runtime.d.ts +69 -1
- package/dist/api/sandbox/runtime.d.ts.map +1 -1
- package/dist/api/sandbox/runtime.js +5 -5
- package/dist/api/sandbox/runtime.js.map +1 -1
- package/dist/api/sandbox/snapshot.d.ts +202 -9
- package/dist/api/sandbox/snapshot.d.ts.map +1 -1
- package/dist/api/sandbox/snapshot.js +17 -17
- package/dist/api/sandbox/snapshot.js.map +1 -1
- package/dist/api/session/get.d.ts +123 -8
- package/dist/api/session/get.d.ts.map +1 -1
- package/dist/api/session/get.js +8 -8
- package/dist/api/session/get.js.map +1 -1
- package/dist/api/session/index.d.ts +3 -6
- package/dist/api/session/index.d.ts.map +1 -1
- package/dist/api/session/index.js +3 -3
- package/dist/api/session/index.js.map +1 -1
- package/dist/api/session/list.d.ts +2 -2
- package/dist/api/session/list.d.ts.map +1 -1
- package/dist/api/session/list.js +2 -2
- package/dist/api/session/list.js.map +1 -1
- package/dist/api/session/logs.d.ts +19 -2
- package/dist/api/session/logs.d.ts.map +1 -1
- package/dist/api/session/logs.js +4 -4
- package/dist/api/session/logs.js.map +1 -1
- package/dist/api/stream/get.d.ts +58 -0
- package/dist/api/stream/get.d.ts.map +1 -0
- package/dist/api/stream/get.js +40 -0
- package/dist/api/stream/get.js.map +1 -0
- package/dist/api/stream/index.d.ts +4 -0
- package/dist/api/stream/index.d.ts.map +1 -0
- package/dist/api/stream/index.js +4 -0
- package/dist/api/stream/index.js.map +1 -0
- package/dist/api/stream/list.d.ts +107 -0
- package/dist/api/stream/list.d.ts.map +1 -0
- package/dist/api/stream/list.js +71 -0
- package/dist/api/stream/list.js.map +1 -0
- package/dist/api/stream/util.d.ts +23 -0
- package/dist/api/stream/util.d.ts.map +1 -0
- package/dist/api/stream/util.js +3 -0
- package/dist/api/stream/util.js.map +1 -0
- package/dist/api/thread/delete.d.ts +10 -3
- package/dist/api/thread/delete.d.ts.map +1 -1
- package/dist/api/thread/delete.js +2 -2
- package/dist/api/thread/delete.js.map +1 -1
- package/dist/api/thread/get.d.ts +23 -5
- package/dist/api/thread/get.d.ts.map +1 -1
- package/dist/api/thread/get.js +2 -2
- package/dist/api/thread/get.js.map +1 -1
- package/dist/api/thread/index.d.ts +4 -4
- package/dist/api/thread/index.d.ts.map +1 -1
- package/dist/api/thread/index.js +4 -4
- package/dist/api/thread/index.js.map +1 -1
- package/dist/api/thread/list.d.ts +4 -5
- package/dist/api/thread/list.d.ts.map +1 -1
- package/dist/api/thread/list.js +3 -4
- package/dist/api/thread/list.js.map +1 -1
- package/dist/api/user/whoami.d.ts +6 -3
- package/dist/api/user/whoami.d.ts.map +1 -1
- package/dist/api/user/whoami.js +3 -3
- package/dist/api/user/whoami.js.map +1 -1
- package/package.json +4 -4
- package/src/api/api.ts +23 -2
- package/src/api/apikey/create.ts +2 -2
- package/src/api/apikey/delete.ts +1 -1
- package/src/api/apikey/get.ts +2 -2
- package/src/api/apikey/index.ts +1 -0
- package/src/api/apikey/list.ts +1 -1
- package/src/api/db/index.ts +21 -4
- package/src/api/db/logs.ts +7 -7
- package/src/api/db/query.ts +2 -2
- package/src/api/db/tables.ts +3 -3
- package/src/api/eval/get.ts +3 -3
- package/src/api/eval/index.ts +28 -4
- package/src/api/eval/list.ts +4 -4
- package/src/api/eval/run-get.ts +3 -3
- package/src/api/eval/run-list.ts +4 -4
- package/src/api/index.ts +1 -0
- package/src/api/machine/machine.ts +15 -11
- package/src/api/org/env-delete.ts +4 -4
- package/src/api/org/env-get.ts +3 -3
- package/src/api/org/env-update.ts +4 -4
- package/src/api/org/list.ts +2 -2
- package/src/api/org/resources.ts +4 -4
- package/src/api/project/agent.ts +3 -3
- package/src/api/project/create.ts +5 -5
- package/src/api/project/delete.ts +3 -3
- package/src/api/project/deploy.ts +34 -32
- package/src/api/project/deployment.ts +8 -8
- package/src/api/project/env-delete.ts +12 -8
- package/src/api/project/env-update.ts +4 -4
- package/src/api/project/exists.ts +4 -4
- package/src/api/project/get.ts +5 -5
- package/src/api/project/list.ts +14 -14
- package/src/api/project/malware.ts +12 -12
- package/src/api/project/update-region.ts +3 -3
- package/src/api/queue/analytics.ts +15 -11
- package/src/api/queue/destinations.ts +14 -12
- package/src/api/queue/dlq.ts +10 -10
- package/src/api/queue/index.ts +136 -108
- package/src/api/queue/messages.ts +22 -22
- package/src/api/queue/queues.ts +14 -14
- package/src/api/queue/sources.ts +11 -11
- package/src/api/region/create.ts +5 -5
- package/src/api/region/delete.ts +5 -5
- package/src/api/region/list.ts +2 -2
- package/src/api/region/resources.ts +2 -2
- package/src/api/sandbox/cli-list.ts +99 -0
- package/src/api/sandbox/create.ts +18 -14
- package/src/api/sandbox/destroy.ts +4 -4
- package/src/api/sandbox/execute.ts +6 -6
- package/src/api/sandbox/execution.ts +7 -7
- package/src/api/sandbox/files.ts +16 -16
- package/src/api/sandbox/get.ts +15 -15
- package/src/api/sandbox/index.ts +160 -77
- package/src/api/sandbox/list.ts +12 -12
- package/src/api/sandbox/resolve.ts +98 -0
- package/src/api/sandbox/run.ts +6 -1
- package/src/api/sandbox/runtime.ts +7 -7
- package/src/api/sandbox/snapshot.ts +20 -18
- package/src/api/session/get.ts +13 -13
- package/src/api/session/index.ts +3 -6
- package/src/api/session/list.ts +2 -2
- package/src/api/session/logs.ts +4 -4
- package/src/api/stream/get.ts +51 -0
- package/src/api/stream/index.ts +3 -0
- package/src/api/stream/list.ts +111 -0
- package/src/api/stream/util.ts +3 -0
- package/src/api/thread/delete.ts +4 -4
- package/src/api/thread/get.ts +5 -7
- package/src/api/thread/index.ts +4 -4
- package/src/api/thread/list.ts +4 -6
- package/src/api/user/whoami.ts +3 -3
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { type APIClient } from '../api';
|
|
3
|
+
export declare const StreamInfoSchema: z.ZodObject<{
|
|
4
|
+
id: z.ZodString;
|
|
5
|
+
namespace: z.ZodString;
|
|
6
|
+
metadata: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
7
|
+
url: z.ZodString;
|
|
8
|
+
sizeBytes: z.ZodNumber;
|
|
9
|
+
expiresAt: z.ZodNullable<z.ZodString>;
|
|
10
|
+
orgId: z.ZodString;
|
|
11
|
+
projectId: z.ZodNullable<z.ZodString>;
|
|
12
|
+
projectName: z.ZodNullable<z.ZodString>;
|
|
13
|
+
}, z.core.$strip>;
|
|
14
|
+
export declare const StreamListDataSchema: z.ZodObject<{
|
|
15
|
+
streams: z.ZodArray<z.ZodObject<{
|
|
16
|
+
id: z.ZodString;
|
|
17
|
+
namespace: z.ZodString;
|
|
18
|
+
metadata: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
19
|
+
url: z.ZodString;
|
|
20
|
+
sizeBytes: z.ZodNumber;
|
|
21
|
+
expiresAt: z.ZodNullable<z.ZodString>;
|
|
22
|
+
orgId: z.ZodString;
|
|
23
|
+
projectId: z.ZodNullable<z.ZodString>;
|
|
24
|
+
projectName: z.ZodNullable<z.ZodString>;
|
|
25
|
+
}, z.core.$strip>>;
|
|
26
|
+
total: z.ZodNumber;
|
|
27
|
+
}, z.core.$strip>;
|
|
28
|
+
export declare const StreamListResponseSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
29
|
+
success: z.ZodLiteral<false>;
|
|
30
|
+
message: z.ZodString;
|
|
31
|
+
code: z.ZodOptional<z.ZodString>;
|
|
32
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
33
|
+
success: z.ZodLiteral<true>;
|
|
34
|
+
data: z.ZodObject<{
|
|
35
|
+
streams: z.ZodArray<z.ZodObject<{
|
|
36
|
+
id: z.ZodString;
|
|
37
|
+
namespace: z.ZodString;
|
|
38
|
+
metadata: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
39
|
+
url: z.ZodString;
|
|
40
|
+
sizeBytes: z.ZodNumber;
|
|
41
|
+
expiresAt: z.ZodNullable<z.ZodString>;
|
|
42
|
+
orgId: z.ZodString;
|
|
43
|
+
projectId: z.ZodNullable<z.ZodString>;
|
|
44
|
+
projectName: z.ZodNullable<z.ZodString>;
|
|
45
|
+
}, z.core.$strip>>;
|
|
46
|
+
total: z.ZodNumber;
|
|
47
|
+
}, z.core.$strip>;
|
|
48
|
+
}, z.core.$strip>], "success">;
|
|
49
|
+
export type StreamListResponse = z.infer<typeof StreamListResponseSchema>;
|
|
50
|
+
export type StreamListData = z.infer<typeof StreamListDataSchema>;
|
|
51
|
+
export type StreamInfo = z.infer<typeof StreamInfoSchema>;
|
|
52
|
+
export interface StreamListOptions {
|
|
53
|
+
/**
|
|
54
|
+
* Filter by specific project ID
|
|
55
|
+
*/
|
|
56
|
+
projectId?: string;
|
|
57
|
+
/**
|
|
58
|
+
* Filter by specific organization ID
|
|
59
|
+
*/
|
|
60
|
+
orgId?: string;
|
|
61
|
+
/**
|
|
62
|
+
* Filter by stream namespace
|
|
63
|
+
*/
|
|
64
|
+
namespace?: string;
|
|
65
|
+
/**
|
|
66
|
+
* Maximum number of streams to return (default: 100, max: 1000)
|
|
67
|
+
*/
|
|
68
|
+
limit?: number;
|
|
69
|
+
/**
|
|
70
|
+
* Number of streams to skip for pagination
|
|
71
|
+
*/
|
|
72
|
+
offset?: number;
|
|
73
|
+
/**
|
|
74
|
+
* Filter by metadata key-value pairs
|
|
75
|
+
*/
|
|
76
|
+
metadata?: Record<string, string>;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* List streams with optional filtering.
|
|
80
|
+
*
|
|
81
|
+
* If no projectId or orgId is provided, returns streams from all orgs the user is a member of.
|
|
82
|
+
*
|
|
83
|
+
* @param client - The API client
|
|
84
|
+
* @param options - Filtering and pagination options
|
|
85
|
+
* @returns A promise that resolves to the list of streams with metadata
|
|
86
|
+
*
|
|
87
|
+
* @example
|
|
88
|
+
* // List all streams across all orgs
|
|
89
|
+
* const result = await streamList(client);
|
|
90
|
+
* console.log(`Found ${result.total} streams`);
|
|
91
|
+
*
|
|
92
|
+
* @example
|
|
93
|
+
* // List streams for a specific project
|
|
94
|
+
* const result = await streamList(client, { projectId: 'proj_123' });
|
|
95
|
+
*
|
|
96
|
+
* @example
|
|
97
|
+
* // List streams with namespace filter
|
|
98
|
+
* const result = await streamList(client, { namespace: 'agent-logs' });
|
|
99
|
+
*
|
|
100
|
+
* @example
|
|
101
|
+
* // List streams with metadata filter
|
|
102
|
+
* const result = await streamList(client, {
|
|
103
|
+
* metadata: { type: 'export', env: 'production' }
|
|
104
|
+
* });
|
|
105
|
+
*/
|
|
106
|
+
export declare function streamList(client: APIClient, options?: StreamListOptions): Promise<StreamListData>;
|
|
107
|
+
//# sourceMappingURL=list.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../../src/api/stream/list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,KAAK,SAAS,EAAqB,MAAM,QAAQ,CAAC;AAG3D,eAAO,MAAM,gBAAgB;;;;;;;;;;iBAU3B,CAAC;AAEH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;iBAG/B,CAAC;AAEH,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;8BAA0C,CAAC;AAEhF,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAC1E,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAClE,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAE1D,MAAM,WAAW,iBAAiB;IACjC;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAClC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAsB,UAAU,CAC/B,MAAM,EAAE,SAAS,EACjB,OAAO,GAAE,iBAAsB,GAC7B,OAAO,CAAC,cAAc,CAAC,CAyBzB"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { APIResponseSchema } from '../api';
|
|
3
|
+
import { StreamResponseError } from './util';
|
|
4
|
+
export const StreamInfoSchema = z.object({
|
|
5
|
+
id: z.string().describe('the stream id'),
|
|
6
|
+
namespace: z.string().describe('the stream namespace'),
|
|
7
|
+
metadata: z.record(z.string(), z.string()).describe('stream metadata'),
|
|
8
|
+
url: z.string().describe('public URL to access the stream'),
|
|
9
|
+
sizeBytes: z.number().describe('size in bytes'),
|
|
10
|
+
expiresAt: z.string().nullable().describe('ISO 8601 expiration timestamp or null'),
|
|
11
|
+
orgId: z.string().describe('the organization id'),
|
|
12
|
+
projectId: z.string().nullable().describe('the project id'),
|
|
13
|
+
projectName: z.string().nullable().describe('the project name'),
|
|
14
|
+
});
|
|
15
|
+
export const StreamListDataSchema = z.object({
|
|
16
|
+
streams: z.array(StreamInfoSchema).describe('list of streams'),
|
|
17
|
+
total: z.number().describe('total count of matching streams'),
|
|
18
|
+
});
|
|
19
|
+
export const StreamListResponseSchema = APIResponseSchema(StreamListDataSchema);
|
|
20
|
+
/**
|
|
21
|
+
* List streams with optional filtering.
|
|
22
|
+
*
|
|
23
|
+
* If no projectId or orgId is provided, returns streams from all orgs the user is a member of.
|
|
24
|
+
*
|
|
25
|
+
* @param client - The API client
|
|
26
|
+
* @param options - Filtering and pagination options
|
|
27
|
+
* @returns A promise that resolves to the list of streams with metadata
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* // List all streams across all orgs
|
|
31
|
+
* const result = await streamList(client);
|
|
32
|
+
* console.log(`Found ${result.total} streams`);
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* // List streams for a specific project
|
|
36
|
+
* const result = await streamList(client, { projectId: 'proj_123' });
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* // List streams with namespace filter
|
|
40
|
+
* const result = await streamList(client, { namespace: 'agent-logs' });
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* // List streams with metadata filter
|
|
44
|
+
* const result = await streamList(client, {
|
|
45
|
+
* metadata: { type: 'export', env: 'production' }
|
|
46
|
+
* });
|
|
47
|
+
*/
|
|
48
|
+
export async function streamList(client, options = {}) {
|
|
49
|
+
const { projectId, orgId, namespace, limit, offset, metadata } = options;
|
|
50
|
+
const params = new URLSearchParams();
|
|
51
|
+
if (projectId)
|
|
52
|
+
params.set('projectId', projectId);
|
|
53
|
+
if (orgId)
|
|
54
|
+
params.set('orgId', orgId);
|
|
55
|
+
if (namespace)
|
|
56
|
+
params.set('namespace', namespace);
|
|
57
|
+
if (limit !== undefined)
|
|
58
|
+
params.set('limit', limit.toString());
|
|
59
|
+
if (offset !== undefined)
|
|
60
|
+
params.set('offset', offset.toString());
|
|
61
|
+
if (metadata && Object.keys(metadata).length > 0) {
|
|
62
|
+
params.set('metadata', JSON.stringify(metadata));
|
|
63
|
+
}
|
|
64
|
+
const queryString = params.toString();
|
|
65
|
+
const resp = await client.request('GET', `/cli/stream${queryString ? `?${queryString}` : ''}`, StreamListResponseSchema);
|
|
66
|
+
if (resp.success) {
|
|
67
|
+
return resp.data;
|
|
68
|
+
}
|
|
69
|
+
throw new StreamResponseError({ message: resp.message });
|
|
70
|
+
}
|
|
71
|
+
//# sourceMappingURL=list.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list.js","sourceRoot":"","sources":["../../../src/api/stream/list.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export declare const StreamResponseError: {
|
|
2
|
+
new (args?: {
|
|
3
|
+
message?: string;
|
|
4
|
+
cause?: unknown;
|
|
5
|
+
} | undefined): import("@agentuity/core").RichError & {
|
|
6
|
+
readonly _tag: "StreamResponseError";
|
|
7
|
+
} & Readonly<Record<string, never>>;
|
|
8
|
+
readonly defaultMessage?: string;
|
|
9
|
+
} & (<Shape extends {
|
|
10
|
+
[x: string]: any;
|
|
11
|
+
} = Record<string, never>>() => {
|
|
12
|
+
new (args?: (Shape extends Record<string, never> ? {
|
|
13
|
+
message?: string;
|
|
14
|
+
cause?: unknown;
|
|
15
|
+
} : Shape & {
|
|
16
|
+
message?: string;
|
|
17
|
+
cause?: unknown;
|
|
18
|
+
}) | undefined): import("@agentuity/core").RichError & {
|
|
19
|
+
readonly _tag: "StreamResponseError";
|
|
20
|
+
} & Readonly<Shape>;
|
|
21
|
+
readonly defaultMessage?: string;
|
|
22
|
+
});
|
|
23
|
+
//# sourceMappingURL=util.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../../src/api/stream/util.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;EAAyC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"util.js","sourceRoot":"","sources":["../../../src/api/stream/util.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAElD,MAAM,CAAC,MAAM,mBAAmB,GAAG,eAAe,CAAC,qBAAqB,CAAC,CAAC"}
|
|
@@ -1,9 +1,17 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { APIClient } from '../api';
|
|
3
|
-
declare const _ThreadDeleteRequestSchema: z.ZodObject<{
|
|
3
|
+
export declare const _ThreadDeleteRequestSchema: z.ZodObject<{
|
|
4
4
|
id: z.ZodString;
|
|
5
5
|
}, z.core.$strip>;
|
|
6
|
-
|
|
6
|
+
export declare const ThreadDeleteResponseSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
7
|
+
success: z.ZodLiteral<false>;
|
|
8
|
+
message: z.ZodString;
|
|
9
|
+
code: z.ZodOptional<z.ZodString>;
|
|
10
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
11
|
+
success: z.ZodLiteral<true>;
|
|
12
|
+
}, z.core.$strip>], "success">;
|
|
13
|
+
export type ThreadDeleteRequest = z.infer<typeof _ThreadDeleteRequestSchema>;
|
|
14
|
+
export type ThreadDeleteResponse = z.infer<typeof ThreadDeleteResponseSchema>;
|
|
7
15
|
/**
|
|
8
16
|
* Delete a thread by id
|
|
9
17
|
*
|
|
@@ -12,5 +20,4 @@ type ThreadDeleteRequest = z.infer<typeof _ThreadDeleteRequestSchema>;
|
|
|
12
20
|
* @returns
|
|
13
21
|
*/
|
|
14
22
|
export declare function threadDelete(client: APIClient, request: ThreadDeleteRequest): Promise<void>;
|
|
15
|
-
export {};
|
|
16
23
|
//# sourceMappingURL=delete.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"delete.d.ts","sourceRoot":"","sources":["../../../src/api/thread/delete.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,SAAS,EAA2B,MAAM,QAAQ,CAAC;AAG5D,
|
|
1
|
+
{"version":3,"file":"delete.d.ts","sourceRoot":"","sources":["../../../src/api/thread/delete.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,SAAS,EAA2B,MAAM,QAAQ,CAAC;AAG5D,eAAO,MAAM,0BAA0B;;iBAErC,CAAC;AAEH,eAAO,MAAM,0BAA0B;;;;;;8BAA4B,CAAC;AAEpE,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAC7E,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAE9E;;;;;;GAMG;AACH,wBAAsB,YAAY,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC,CAUjG"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { APIResponseSchemaNoData } from '../api';
|
|
3
3
|
import { ThreadResponseError } from './util';
|
|
4
|
-
const _ThreadDeleteRequestSchema = z.object({
|
|
4
|
+
export const _ThreadDeleteRequestSchema = z.object({
|
|
5
5
|
id: z.string().describe('the thread id'),
|
|
6
6
|
});
|
|
7
|
-
const ThreadDeleteResponseSchema = APIResponseSchemaNoData();
|
|
7
|
+
export const ThreadDeleteResponseSchema = APIResponseSchemaNoData();
|
|
8
8
|
/**
|
|
9
9
|
* Delete a thread by id
|
|
10
10
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"delete.js","sourceRoot":"","sources":["../../../src/api/thread/delete.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAa,uBAAuB,EAAE,MAAM,QAAQ,CAAC;AAC5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,QAAQ,CAAC;AAE7C,MAAM,0BAA0B,GAAG,CAAC,CAAC,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"delete.js","sourceRoot":"","sources":["../../../src/api/thread/delete.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAa,uBAAuB,EAAE,MAAM,QAAQ,CAAC;AAC5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,QAAQ,CAAC;AAE7C,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,CAAC,MAAM,CAAC;IAClD,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,eAAe,CAAC;CACxC,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,0BAA0B,GAAG,uBAAuB,EAAE,CAAC;AAKpE;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,YAAY,CAAC,MAAiB,EAAE,OAA4B;IACjF,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,OAAO,CAChC,QAAQ,EACR,sBAAsB,OAAO,CAAC,EAAE,EAAE,EAClC,0BAA0B,CAC1B,CAAC;IAEF,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC;QACnB,MAAM,IAAI,mBAAmB,CAAC,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC;IAC1D,CAAC;AACF,CAAC"}
|
package/dist/api/thread/get.d.ts
CHANGED
|
@@ -1,11 +1,30 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { APIClient } from '../api';
|
|
3
|
-
import {
|
|
4
|
-
declare const _ThreadGetRequestSchema: z.ZodObject<{
|
|
3
|
+
import { type Thread } from './list';
|
|
4
|
+
export declare const _ThreadGetRequestSchema: z.ZodObject<{
|
|
5
5
|
id: z.ZodString;
|
|
6
6
|
}, z.core.$strip>;
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
export declare const ThreadGetResponseSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
8
|
+
success: z.ZodLiteral<false>;
|
|
9
|
+
message: z.ZodString;
|
|
10
|
+
code: z.ZodOptional<z.ZodString>;
|
|
11
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
12
|
+
success: z.ZodLiteral<true>;
|
|
13
|
+
data: z.ZodObject<{
|
|
14
|
+
id: z.ZodString;
|
|
15
|
+
created_at: z.ZodString;
|
|
16
|
+
updated_at: z.ZodString;
|
|
17
|
+
deleted: z.ZodBoolean;
|
|
18
|
+
deleted_at: z.ZodNullable<z.ZodString>;
|
|
19
|
+
deleted_by: z.ZodNullable<z.ZodString>;
|
|
20
|
+
org_id: z.ZodString;
|
|
21
|
+
project_id: z.ZodString;
|
|
22
|
+
user_data: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
23
|
+
metadata: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
24
|
+
}, z.core.$strip>;
|
|
25
|
+
}, z.core.$strip>], "success">;
|
|
26
|
+
export type ThreadGetRequest = z.infer<typeof _ThreadGetRequestSchema>;
|
|
27
|
+
export type ThreadGetResponse = z.infer<typeof ThreadGetResponseSchema>;
|
|
9
28
|
/**
|
|
10
29
|
* Get a single thread by id
|
|
11
30
|
*
|
|
@@ -14,5 +33,4 @@ export type Thread = z.infer<typeof ThreadSchema>;
|
|
|
14
33
|
* @returns
|
|
15
34
|
*/
|
|
16
35
|
export declare function threadGet(client: APIClient, request: ThreadGetRequest): Promise<Thread>;
|
|
17
|
-
export {};
|
|
18
36
|
//# sourceMappingURL=get.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get.d.ts","sourceRoot":"","sources":["../../../src/api/thread/get.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,SAAS,EAAqB,MAAM,QAAQ,CAAC;AACtD,OAAO,
|
|
1
|
+
{"version":3,"file":"get.d.ts","sourceRoot":"","sources":["../../../src/api/thread/get.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,SAAS,EAAqB,MAAM,QAAQ,CAAC;AACtD,OAAO,EAAgB,KAAK,MAAM,EAAE,MAAM,QAAQ,CAAC;AAGnD,eAAO,MAAM,uBAAuB;;iBAElC,CAAC;AAEH,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;8BAAkC,CAAC;AAEvE,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AACvE,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAExE;;;;;;GAMG;AACH,wBAAsB,SAAS,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,MAAM,CAAC,CAY7F"}
|
package/dist/api/thread/get.js
CHANGED
|
@@ -2,10 +2,10 @@ import { z } from 'zod';
|
|
|
2
2
|
import { APIResponseSchema } from '../api';
|
|
3
3
|
import { ThreadSchema } from './list';
|
|
4
4
|
import { ThreadResponseError } from './util';
|
|
5
|
-
const _ThreadGetRequestSchema = z.object({
|
|
5
|
+
export const _ThreadGetRequestSchema = z.object({
|
|
6
6
|
id: z.string().describe('the thread id'),
|
|
7
7
|
});
|
|
8
|
-
const ThreadGetResponseSchema = APIResponseSchema(ThreadSchema);
|
|
8
|
+
export const ThreadGetResponseSchema = APIResponseSchema(ThreadSchema);
|
|
9
9
|
/**
|
|
10
10
|
* Get a single thread by id
|
|
11
11
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get.js","sourceRoot":"","sources":["../../../src/api/thread/get.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAa,iBAAiB,EAAE,MAAM,QAAQ,CAAC;AACtD,OAAO,EAAE,YAAY,
|
|
1
|
+
{"version":3,"file":"get.js","sourceRoot":"","sources":["../../../src/api/thread/get.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAa,iBAAiB,EAAE,MAAM,QAAQ,CAAC;AACtD,OAAO,EAAE,YAAY,EAAe,MAAM,QAAQ,CAAC;AACnD,OAAO,EAAE,mBAAmB,EAAE,MAAM,QAAQ,CAAC;AAE7C,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC/C,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,eAAe,CAAC;CACxC,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,uBAAuB,GAAG,iBAAiB,CAAC,YAAY,CAAC,CAAC;AAKvE;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,SAAS,CAAC,MAAiB,EAAE,OAAyB;IAC3E,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,OAAO,CAChC,KAAK,EACL,sBAAsB,OAAO,CAAC,EAAE,EAAE,EAClC,uBAAuB,CACvB,CAAC;IAEF,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;QAClB,OAAO,IAAI,CAAC,IAAI,CAAC;IAClB,CAAC;IAED,MAAM,IAAI,mBAAmB,CAAC,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC;AAC1D,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
export
|
|
1
|
+
export * from './get';
|
|
2
|
+
export * from './list';
|
|
3
|
+
export * from './delete';
|
|
4
|
+
export * from './util';
|
|
5
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/api/thread/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/api/thread/index.ts"],"names":[],"mappings":"AAAA,cAAc,OAAO,CAAC;AACtB,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC"}
|
package/dist/api/thread/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
export
|
|
1
|
+
export * from './get';
|
|
2
|
+
export * from './list';
|
|
3
|
+
export * from './delete';
|
|
4
|
+
export * from './util';
|
|
5
5
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/api/thread/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/api/thread/index.ts"],"names":[],"mappings":"AAAA,cAAc,OAAO,CAAC;AACtB,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { APIClient } from '../api';
|
|
3
|
-
declare const ThreadSchema: z.ZodObject<{
|
|
3
|
+
export declare const ThreadSchema: z.ZodObject<{
|
|
4
4
|
id: z.ZodString;
|
|
5
5
|
created_at: z.ZodString;
|
|
6
6
|
updated_at: z.ZodString;
|
|
@@ -12,8 +12,7 @@ declare const ThreadSchema: z.ZodObject<{
|
|
|
12
12
|
user_data: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
13
13
|
metadata: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
14
14
|
}, z.core.$strip>;
|
|
15
|
-
export
|
|
16
|
-
declare const ThreadListResponse: z.ZodArray<z.ZodObject<{
|
|
15
|
+
export declare const ThreadListResponseData: z.ZodArray<z.ZodObject<{
|
|
17
16
|
id: z.ZodString;
|
|
18
17
|
created_at: z.ZodString;
|
|
19
18
|
updated_at: z.ZodString;
|
|
@@ -25,7 +24,7 @@ declare const ThreadListResponse: z.ZodArray<z.ZodObject<{
|
|
|
25
24
|
user_data: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
26
25
|
metadata: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
27
26
|
}, z.core.$strip>>;
|
|
28
|
-
declare const ThreadListResponseSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
27
|
+
export declare const ThreadListResponseSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
29
28
|
success: z.ZodLiteral<false>;
|
|
30
29
|
message: z.ZodString;
|
|
31
30
|
code: z.ZodOptional<z.ZodString>;
|
|
@@ -45,7 +44,7 @@ declare const ThreadListResponseSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
45
44
|
}, z.core.$strip>>;
|
|
46
45
|
}, z.core.$strip>], "success">;
|
|
47
46
|
export type ThreadListResponse = z.infer<typeof ThreadListResponseSchema>;
|
|
48
|
-
export type ThreadList = z.infer<typeof
|
|
47
|
+
export type ThreadList = z.infer<typeof ThreadListResponseData>;
|
|
49
48
|
export type Thread = z.infer<typeof ThreadSchema>;
|
|
50
49
|
export interface ThreadListOptions {
|
|
51
50
|
count?: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../../src/api/thread/list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,SAAS,EAAqB,MAAM,QAAQ,CAAC;AAGtD,
|
|
1
|
+
{"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../../src/api/thread/list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,SAAS,EAAqB,MAAM,QAAQ,CAAC;AAGtD,eAAO,MAAM,YAAY;;;;;;;;;;;iBAevB,CAAC;AAEH,eAAO,MAAM,sBAAsB;;;;;;;;;;;kBAAwB,CAAC;AAE5D,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;8BAA4C,CAAC;AAElF,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAC1E,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAChE,MAAM,MAAM,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;AAElD,MAAM,WAAW,iBAAiB;IACjC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnC;AAED;;;;;;GAMG;AACH,wBAAsB,UAAU,CAC/B,MAAM,EAAE,SAAS,EACjB,OAAO,GAAE,iBAAsB,GAC7B,OAAO,CAAC,UAAU,CAAC,CAkBrB"}
|
package/dist/api/thread/list.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { APIResponseSchema } from '../api';
|
|
3
3
|
import { ThreadResponseError } from './util';
|
|
4
|
-
const ThreadSchema = z.object({
|
|
4
|
+
export const ThreadSchema = z.object({
|
|
5
5
|
id: z.string().describe('the thread id'),
|
|
6
6
|
created_at: z.string().describe('the creation timestamp'),
|
|
7
7
|
updated_at: z.string().describe('the last update timestamp'),
|
|
@@ -17,9 +17,8 @@ const ThreadSchema = z.object({
|
|
|
17
17
|
.optional()
|
|
18
18
|
.describe('unencrypted key-value metadata'),
|
|
19
19
|
});
|
|
20
|
-
export
|
|
21
|
-
const
|
|
22
|
-
const ThreadListResponseSchema = APIResponseSchema(ThreadListResponse);
|
|
20
|
+
export const ThreadListResponseData = z.array(ThreadSchema);
|
|
21
|
+
export const ThreadListResponseSchema = APIResponseSchema(ThreadListResponseData);
|
|
23
22
|
/**
|
|
24
23
|
* List threads
|
|
25
24
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list.js","sourceRoot":"","sources":["../../../src/api/thread/list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAa,iBAAiB,EAAE,MAAM,QAAQ,CAAC;AACtD,OAAO,EAAE,mBAAmB,EAAE,MAAM,QAAQ,CAAC;AAE7C,MAAM,YAAY,GAAG,CAAC,CAAC,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"list.js","sourceRoot":"","sources":["../../../src/api/thread/list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAa,iBAAiB,EAAE,MAAM,QAAQ,CAAC;AACtD,OAAO,EAAE,mBAAmB,EAAE,MAAM,QAAQ,CAAC;AAE7C,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,CAAC,MAAM,CAAC;IACpC,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,eAAe,CAAC;IACxC,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,wBAAwB,CAAC;IACzD,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,2BAA2B,CAAC;IAC5D,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,CAAC,+BAA+B,CAAC;IAC9D,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,wBAAwB,CAAC;IACpE,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,wBAAwB,CAAC;IACpE,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,qBAAqB,CAAC;IAClD,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,gBAAgB,CAAC;IACjD,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,uBAAuB,CAAC;IAC7E,QAAQ,EAAE,CAAC;SACT,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC;SAC/B,QAAQ,EAAE;SACV,QAAQ,EAAE;SACV,QAAQ,CAAC,gCAAgC,CAAC;CAC5C,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;AAE5D,MAAM,CAAC,MAAM,wBAAwB,GAAG,iBAAiB,CAAC,sBAAsB,CAAC,CAAC;AAalF;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,UAAU,CAC/B,MAAiB,EACjB,UAA6B,EAAE;IAE/B,MAAM,EAAE,KAAK,GAAG,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAC;IAC3D,MAAM,MAAM,GAAG,IAAI,eAAe,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;IAChE,IAAI,KAAK;QAAE,MAAM,CAAC,GAAG,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;IACtC,IAAI,SAAS;QAAE,MAAM,CAAC,GAAG,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC;IAClD,IAAI,QAAQ;QAAE,MAAM,CAAC,GAAG,CAAC,UAAU,EAAE,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAC;IAE/D,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,OAAO,CAChC,KAAK,EACL,sBAAsB,MAAM,CAAC,QAAQ,EAAE,EAAE,EACzC,wBAAwB,CACxB,CAAC;IAEF,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;QAClB,OAAO,IAAI,CAAC,IAAI,CAAC;IAClB,CAAC;IAED,MAAM,IAAI,mBAAmB,CAAC,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC;AAC1D,CAAC"}
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { APIClient } from '../api';
|
|
3
|
-
declare const
|
|
3
|
+
export declare const OrganizationSchema: z.ZodObject<{
|
|
4
|
+
id: z.ZodString;
|
|
5
|
+
name: z.ZodString;
|
|
6
|
+
}, z.core.$strip>;
|
|
7
|
+
export declare const WhoamiResponse: z.ZodObject<{
|
|
4
8
|
firstName: z.ZodString;
|
|
5
9
|
lastName: z.ZodString;
|
|
6
10
|
organizations: z.ZodArray<z.ZodObject<{
|
|
@@ -8,7 +12,7 @@ declare const WhoamiResponse: z.ZodObject<{
|
|
|
8
12
|
name: z.ZodString;
|
|
9
13
|
}, z.core.$strip>>;
|
|
10
14
|
}, z.core.$strip>;
|
|
11
|
-
declare const WhoamiResponseSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
15
|
+
export declare const WhoamiResponseSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
12
16
|
success: z.ZodLiteral<false>;
|
|
13
17
|
message: z.ZodString;
|
|
14
18
|
code: z.ZodOptional<z.ZodString>;
|
|
@@ -32,5 +36,4 @@ export type User = z.infer<typeof WhoamiResponse>;
|
|
|
32
36
|
* @returns
|
|
33
37
|
*/
|
|
34
38
|
export declare function whoami(client: APIClient): Promise<User>;
|
|
35
|
-
export {};
|
|
36
39
|
//# sourceMappingURL=whoami.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"whoami.d.ts","sourceRoot":"","sources":["../../../src/api/user/whoami.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAqB,SAAS,EAAE,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"whoami.d.ts","sourceRoot":"","sources":["../../../src/api/user/whoami.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAqB,SAAS,EAAE,MAAM,QAAQ,CAAC;AAGtD,eAAO,MAAM,kBAAkB;;;iBAG7B,CAAC;AAEH,eAAO,MAAM,cAAc;;;;;;;iBAIzB,CAAC;AACH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;8BAAoC,CAAC;AAEtE,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAClE,MAAM,MAAM,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAElD;;;;;GAKG;AACH,wBAAsB,MAAM,CAAC,MAAM,EAAE,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,CAM7D"}
|
package/dist/api/user/whoami.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { APIResponseSchema } from '../api';
|
|
3
3
|
import { UserResponseError } from './util';
|
|
4
|
-
const OrganizationSchema = z.object({
|
|
4
|
+
export const OrganizationSchema = z.object({
|
|
5
5
|
id: z.string().describe('the unique id for the organization'),
|
|
6
6
|
name: z.string().describe('the name of the organization'),
|
|
7
7
|
});
|
|
8
|
-
const WhoamiResponse = z.object({
|
|
8
|
+
export const WhoamiResponse = z.object({
|
|
9
9
|
firstName: z.string().describe('the first name of the user'),
|
|
10
10
|
lastName: z.string().describe('the last name of the user'),
|
|
11
11
|
organizations: z.array(OrganizationSchema).describe('the organizations the user is a member of'),
|
|
12
12
|
});
|
|
13
|
-
const WhoamiResponseSchema = APIResponseSchema(WhoamiResponse);
|
|
13
|
+
export const WhoamiResponseSchema = APIResponseSchema(WhoamiResponse);
|
|
14
14
|
/**
|
|
15
15
|
* Get the current authenticated user information
|
|
16
16
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"whoami.js","sourceRoot":"","sources":["../../../src/api/user/whoami.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,iBAAiB,EAAa,MAAM,QAAQ,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,QAAQ,CAAC;AAE3C,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"whoami.js","sourceRoot":"","sources":["../../../src/api/user/whoami.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,iBAAiB,EAAa,MAAM,QAAQ,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,QAAQ,CAAC;AAE3C,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC1C,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,oCAAoC,CAAC;IAC7D,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,8BAA8B,CAAC;CACzD,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAC,MAAM,CAAC;IACtC,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,4BAA4B,CAAC;IAC5D,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,2BAA2B,CAAC;IAC1D,aAAa,EAAE,CAAC,CAAC,KAAK,CAAC,kBAAkB,CAAC,CAAC,QAAQ,CAAC,2CAA2C,CAAC;CAChG,CAAC,CAAC;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,iBAAiB,CAAC,cAAc,CAAC,CAAC;AAKtE;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,MAAM,CAAC,MAAiB;IAC7C,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,GAAG,CAAiB,gBAAgB,EAAE,oBAAoB,CAAC,CAAC;IACtF,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;QAClB,OAAO,IAAI,CAAC,IAAI,CAAC;IAClB,CAAC;IACD,MAAM,IAAI,iBAAiB,CAAC,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC;AACxD,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agentuity/server",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"author": "Agentuity employees and contributors",
|
|
6
6
|
"type": "module",
|
|
@@ -25,12 +25,12 @@
|
|
|
25
25
|
"prepublishOnly": "bun run clean && bun run build"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@agentuity/core": "1.0.
|
|
29
|
-
"@agentuity/schema": "1.0.
|
|
28
|
+
"@agentuity/core": "1.0.3",
|
|
29
|
+
"@agentuity/schema": "1.0.3",
|
|
30
30
|
"zod": "^4.3.5"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
|
-
"@agentuity/test-utils": "1.0.
|
|
33
|
+
"@agentuity/test-utils": "1.0.3",
|
|
34
34
|
"@types/bun": "latest",
|
|
35
35
|
"@types/node": "^22.0.0",
|
|
36
36
|
"bun-types": "latest",
|
package/src/api/api.ts
CHANGED
|
@@ -35,7 +35,7 @@ export interface APIClientConfig {
|
|
|
35
35
|
headers?: Record<string, string>;
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
-
const ZodIssuesSchema = z.array(
|
|
38
|
+
export const ZodIssuesSchema = z.array(
|
|
39
39
|
z.object({
|
|
40
40
|
code: z.string(),
|
|
41
41
|
input: z.unknown().optional(),
|
|
@@ -55,7 +55,7 @@ const toIssues = (issues: z.core.$ZodIssue[]): IssuesType => {
|
|
|
55
55
|
}));
|
|
56
56
|
};
|
|
57
57
|
|
|
58
|
-
const APIErrorSchema = z.object({
|
|
58
|
+
export const APIErrorSchema = z.object({
|
|
59
59
|
success: z.boolean(),
|
|
60
60
|
code: z.string().optional(),
|
|
61
61
|
message: z.string().optional(),
|
|
@@ -115,6 +115,15 @@ export const MisdirectedRequestError = StructuredError(
|
|
|
115
115
|
sessionId?: string | null;
|
|
116
116
|
}>();
|
|
117
117
|
|
|
118
|
+
export const PaymentRequiredError = StructuredError(
|
|
119
|
+
'PaymentRequiredError',
|
|
120
|
+
'This action requires a paid plan. Please upgrade your account to continue.'
|
|
121
|
+
)<{
|
|
122
|
+
url: string;
|
|
123
|
+
sessionId?: string | null;
|
|
124
|
+
upgradeUrl?: string;
|
|
125
|
+
}>();
|
|
126
|
+
|
|
118
127
|
export class APIClient {
|
|
119
128
|
#baseUrl: string;
|
|
120
129
|
#apiKey?: string;
|
|
@@ -602,6 +611,16 @@ export class APIClient {
|
|
|
602
611
|
throw new UpgradeRequiredError({ sessionId });
|
|
603
612
|
}
|
|
604
613
|
|
|
614
|
+
// HTTP 402 Payment Required - user needs to upgrade their plan
|
|
615
|
+
if (response.status === 402) {
|
|
616
|
+
const upgradeUrl = response.headers.get('x-upgrade-url');
|
|
617
|
+
throw new PaymentRequiredError({
|
|
618
|
+
url,
|
|
619
|
+
sessionId,
|
|
620
|
+
upgradeUrl: upgradeUrl ?? undefined,
|
|
621
|
+
});
|
|
622
|
+
}
|
|
623
|
+
|
|
605
624
|
// Check for UPGRADE_REQUIRED error
|
|
606
625
|
if (errorData?.code === 'UPGRADE_REQUIRED') {
|
|
607
626
|
// Skip version check if configured
|
|
@@ -789,6 +808,8 @@ export class APIClient {
|
|
|
789
808
|
return 'The API request was invalid (HTTP 400). Please check your request parameters.';
|
|
790
809
|
case 401:
|
|
791
810
|
return 'Authentication failed (HTTP 401). Please check your credentials or try logging in again.';
|
|
811
|
+
case 402:
|
|
812
|
+
return 'This action requires a paid plan. Please upgrade your account at https://app.agentuity.com/billing to continue.';
|
|
792
813
|
case 403:
|
|
793
814
|
return 'Access denied (HTTP 403). You do not have permission to perform this action.';
|
|
794
815
|
case 404:
|
package/src/api/apikey/create.ts
CHANGED
|
@@ -2,12 +2,12 @@ import { z } from 'zod';
|
|
|
2
2
|
import { APIClient, APIResponseSchema } from '../api';
|
|
3
3
|
import { APIKeyResponseError } from './util';
|
|
4
4
|
|
|
5
|
-
const APIKeyCreateResponseSchema = z.object({
|
|
5
|
+
export const APIKeyCreateResponseSchema = z.object({
|
|
6
6
|
id: z.string().describe('the API key id'),
|
|
7
7
|
value: z.string().describe('the API key value'),
|
|
8
8
|
});
|
|
9
9
|
|
|
10
|
-
const APIKeyCreateFullResponseSchema = APIResponseSchema(APIKeyCreateResponseSchema);
|
|
10
|
+
export const APIKeyCreateFullResponseSchema = APIResponseSchema(APIKeyCreateResponseSchema);
|
|
11
11
|
|
|
12
12
|
type _APIKeyCreateFullResponse = z.infer<typeof APIKeyCreateFullResponseSchema>;
|
|
13
13
|
|
package/src/api/apikey/delete.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { z } from 'zod';
|
|
|
2
2
|
import { APIClient, APIResponseSchema } from '../api';
|
|
3
3
|
import { APIKeyResponseError } from './util';
|
|
4
4
|
|
|
5
|
-
const APIKeyDeleteResponseSchema = APIResponseSchema(
|
|
5
|
+
export const APIKeyDeleteResponseSchema = APIResponseSchema(
|
|
6
6
|
z.number().describe('number of rows affected')
|
|
7
7
|
);
|
|
8
8
|
|