@agentuity/server 0.0.43 → 0.0.44
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/api/api.d.ts +28 -12
- package/dist/api/api.d.ts.map +1 -1
- package/dist/api/api.js +208 -84
- package/dist/api/api.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/org/list.d.ts +14 -8
- package/dist/api/org/list.d.ts.map +1 -1
- package/dist/api/org/list.js +8 -3
- package/dist/api/org/list.js.map +1 -1
- package/dist/api/project/create.d.ts +15 -7
- package/dist/api/project/create.d.ts.map +1 -1
- package/dist/api/project/create.js +8 -3
- package/dist/api/project/create.js.map +1 -1
- package/dist/api/project/delete.d.ts.map +1 -1
- package/dist/api/project/delete.js +1 -1
- package/dist/api/project/delete.js.map +1 -1
- package/dist/api/project/deploy.d.ts +184 -0
- package/dist/api/project/deploy.d.ts.map +1 -0
- package/dist/api/project/deploy.js +160 -0
- package/dist/api/project/deploy.js.map +1 -0
- package/dist/api/project/env-delete.d.ts.map +1 -1
- package/dist/api/project/env-delete.js +2 -2
- package/dist/api/project/env-delete.js.map +1 -1
- package/dist/api/project/env-update.d.ts.map +1 -1
- package/dist/api/project/env-update.js +4 -2
- package/dist/api/project/env-update.js.map +1 -1
- package/dist/api/project/exists.d.ts +7 -5
- package/dist/api/project/exists.d.ts.map +1 -1
- package/dist/api/project/exists.js +1 -1
- package/dist/api/project/exists.js.map +1 -1
- package/dist/api/project/get.d.ts +7 -12
- package/dist/api/project/get.d.ts.map +1 -1
- package/dist/api/project/get.js +5 -4
- package/dist/api/project/get.js.map +1 -1
- package/dist/api/project/index.d.ts +1 -0
- package/dist/api/project/index.d.ts.map +1 -1
- package/dist/api/project/index.js +1 -0
- package/dist/api/project/index.js.map +1 -1
- package/dist/api/project/list.d.ts +20 -8
- package/dist/api/project/list.d.ts.map +1 -1
- package/dist/api/project/list.js +9 -6
- package/dist/api/project/list.js.map +1 -1
- package/dist/api/region/create.d.ts +46 -0
- package/dist/api/region/create.d.ts.map +1 -0
- package/dist/api/region/create.js +35 -0
- package/dist/api/region/create.js.map +1 -0
- package/dist/api/region/delete.d.ts +38 -0
- package/dist/api/region/delete.d.ts.map +1 -0
- package/dist/api/region/delete.js +31 -0
- package/dist/api/region/delete.js.map +1 -0
- package/dist/api/region/index.d.ts +5 -0
- package/dist/api/region/index.d.ts.map +1 -0
- package/dist/api/region/index.js +5 -0
- package/dist/api/region/index.js.map +1 -0
- package/dist/api/region/list.d.ts +27 -0
- package/dist/api/region/list.d.ts.map +1 -0
- package/dist/api/region/list.js +21 -0
- package/dist/api/region/list.js.map +1 -0
- package/dist/api/region/resources.d.ts +53 -0
- package/dist/api/region/resources.d.ts.map +1 -0
- package/dist/api/region/resources.js +35 -0
- package/dist/api/region/resources.js.map +1 -0
- package/dist/api/user/whoami.d.ts +18 -8
- package/dist/api/user/whoami.d.ts.map +1 -1
- package/dist/api/user/whoami.js +9 -6
- package/dist/api/user/whoami.js.map +1 -1
- package/dist/config.d.ts +1 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +1 -0
- package/dist/config.js.map +1 -1
- package/dist/logger.d.ts.map +1 -1
- package/dist/logger.js +4 -1
- package/dist/logger.js.map +1 -1
- package/dist/server.js +2 -2
- package/dist/server.js.map +1 -1
- package/package.json +4 -2
- package/src/api/api-example.md +16 -11
- package/src/api/api.ts +254 -93
- package/src/api/index.ts +1 -0
- package/src/api/org/list.ts +13 -10
- package/src/api/project/create.ts +14 -9
- package/src/api/project/delete.ts +2 -2
- package/src/api/project/deploy.ts +224 -0
- package/src/api/project/env-delete.ts +2 -2
- package/src/api/project/env-update.ts +9 -7
- package/src/api/project/exists.ts +1 -1
- package/src/api/project/get.ts +12 -12
- package/src/api/project/index.ts +1 -0
- package/src/api/project/list.ts +20 -15
- package/src/api/region/create.ts +55 -0
- package/src/api/region/delete.ts +49 -0
- package/src/api/region/index.ts +4 -0
- package/src/api/region/list.ts +31 -0
- package/src/api/region/resources.ts +51 -0
- package/src/api/user/whoami.ts +13 -12
- package/src/config.ts +2 -0
- package/src/logger.ts +5 -1
- package/src/server.ts +2 -2
package/src/api/user/whoami.ts
CHANGED
|
@@ -6,18 +6,15 @@ const OrganizationSchema = z.object({
|
|
|
6
6
|
name: z.string().describe('the name of the organization'),
|
|
7
7
|
});
|
|
8
8
|
|
|
9
|
-
const
|
|
10
|
-
z.
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
.describe('the organizations the user is a member of'),
|
|
16
|
-
})
|
|
17
|
-
);
|
|
9
|
+
const WhoamiResponse = z.object({
|
|
10
|
+
firstName: z.string().describe('the first name of the user'),
|
|
11
|
+
lastName: z.string().describe('the last name of the user'),
|
|
12
|
+
organizations: z.array(OrganizationSchema).describe('the organizations the user is a member of'),
|
|
13
|
+
});
|
|
14
|
+
const WhoamiResponseSchema = APIResponseSchema(WhoamiResponse);
|
|
18
15
|
|
|
19
16
|
export type WhoamiResponse = z.infer<typeof WhoamiResponseSchema>;
|
|
20
|
-
export type User =
|
|
17
|
+
export type User = z.infer<typeof WhoamiResponse>;
|
|
21
18
|
|
|
22
19
|
/**
|
|
23
20
|
* Get the current authenticated user information
|
|
@@ -25,6 +22,10 @@ export type User = NonNullable<WhoamiResponse['data']>;
|
|
|
25
22
|
* @param client
|
|
26
23
|
* @returns
|
|
27
24
|
*/
|
|
28
|
-
export async function whoami(client: APIClient): Promise<
|
|
29
|
-
|
|
25
|
+
export async function whoami(client: APIClient): Promise<User> {
|
|
26
|
+
const resp = await client.request<WhoamiResponse>('GET', '/cli/auth/user', WhoamiResponseSchema);
|
|
27
|
+
if (resp.success) {
|
|
28
|
+
return resp.data;
|
|
29
|
+
}
|
|
30
|
+
throw new Error(resp.message);
|
|
30
31
|
}
|
package/src/config.ts
CHANGED
|
@@ -3,6 +3,7 @@ export interface ServiceUrls {
|
|
|
3
3
|
objectstore: string;
|
|
4
4
|
stream: string;
|
|
5
5
|
vector: string;
|
|
6
|
+
catalyst: string;
|
|
6
7
|
}
|
|
7
8
|
|
|
8
9
|
/**
|
|
@@ -16,5 +17,6 @@ export function getServiceUrls(): ServiceUrls {
|
|
|
16
17
|
objectstore: process.env.AGENTUITY_OBJECTSTORE_URL || transportUrl,
|
|
17
18
|
stream: process.env.AGENTUITY_STREAM_URL || 'https://streams.agentuity.cloud',
|
|
18
19
|
vector: process.env.AGENTUITY_VECTOR_URL || transportUrl,
|
|
20
|
+
catalyst: process.env.AGENTUITY_CATALYST_URL || transportUrl,
|
|
19
21
|
};
|
|
20
22
|
}
|
package/src/logger.ts
CHANGED
|
@@ -32,7 +32,11 @@ function shouldUseColors(): boolean {
|
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
// Check if stdout is a TTY
|
|
35
|
-
if (process.stdout
|
|
35
|
+
if (!process.stdout || typeof process.stdout.isTTY === 'undefined') {
|
|
36
|
+
return false;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
if (!process.stdout.isTTY) {
|
|
36
40
|
return false;
|
|
37
41
|
}
|
|
38
42
|
|
package/src/server.ts
CHANGED
|
@@ -66,7 +66,7 @@ class ServerFetchAdapter implements FetchAdapter {
|
|
|
66
66
|
response: res,
|
|
67
67
|
};
|
|
68
68
|
}
|
|
69
|
-
const data = await fromResponse<T>(res);
|
|
69
|
+
const data = await fromResponse<T>(url, res);
|
|
70
70
|
return {
|
|
71
71
|
ok: true,
|
|
72
72
|
data,
|
|
@@ -79,7 +79,7 @@ class ServerFetchAdapter implements FetchAdapter {
|
|
|
79
79
|
response: res,
|
|
80
80
|
} as FetchErrorResponse;
|
|
81
81
|
}
|
|
82
|
-
const err = await toServiceException(res);
|
|
82
|
+
const err = await toServiceException(url, res);
|
|
83
83
|
throw err;
|
|
84
84
|
}
|
|
85
85
|
async invoke<T>(
|