@agentuity/server 0.0.43 → 0.0.45

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 (101) hide show
  1. package/dist/api/api.d.ts +28 -12
  2. package/dist/api/api.d.ts.map +1 -1
  3. package/dist/api/api.js +208 -84
  4. package/dist/api/api.js.map +1 -1
  5. package/dist/api/index.d.ts +1 -0
  6. package/dist/api/index.d.ts.map +1 -1
  7. package/dist/api/index.js +1 -0
  8. package/dist/api/index.js.map +1 -1
  9. package/dist/api/org/list.d.ts +14 -8
  10. package/dist/api/org/list.d.ts.map +1 -1
  11. package/dist/api/org/list.js +8 -3
  12. package/dist/api/org/list.js.map +1 -1
  13. package/dist/api/project/create.d.ts +15 -7
  14. package/dist/api/project/create.d.ts.map +1 -1
  15. package/dist/api/project/create.js +8 -3
  16. package/dist/api/project/create.js.map +1 -1
  17. package/dist/api/project/delete.d.ts.map +1 -1
  18. package/dist/api/project/delete.js +1 -1
  19. package/dist/api/project/delete.js.map +1 -1
  20. package/dist/api/project/deploy.d.ts +184 -0
  21. package/dist/api/project/deploy.d.ts.map +1 -0
  22. package/dist/api/project/deploy.js +160 -0
  23. package/dist/api/project/deploy.js.map +1 -0
  24. package/dist/api/project/env-delete.d.ts.map +1 -1
  25. package/dist/api/project/env-delete.js +2 -2
  26. package/dist/api/project/env-delete.js.map +1 -1
  27. package/dist/api/project/env-update.d.ts.map +1 -1
  28. package/dist/api/project/env-update.js +4 -2
  29. package/dist/api/project/env-update.js.map +1 -1
  30. package/dist/api/project/exists.d.ts +7 -5
  31. package/dist/api/project/exists.d.ts.map +1 -1
  32. package/dist/api/project/exists.js +1 -1
  33. package/dist/api/project/exists.js.map +1 -1
  34. package/dist/api/project/get.d.ts +7 -12
  35. package/dist/api/project/get.d.ts.map +1 -1
  36. package/dist/api/project/get.js +5 -4
  37. package/dist/api/project/get.js.map +1 -1
  38. package/dist/api/project/index.d.ts +1 -0
  39. package/dist/api/project/index.d.ts.map +1 -1
  40. package/dist/api/project/index.js +1 -0
  41. package/dist/api/project/index.js.map +1 -1
  42. package/dist/api/project/list.d.ts +20 -8
  43. package/dist/api/project/list.d.ts.map +1 -1
  44. package/dist/api/project/list.js +9 -6
  45. package/dist/api/project/list.js.map +1 -1
  46. package/dist/api/region/create.d.ts +46 -0
  47. package/dist/api/region/create.d.ts.map +1 -0
  48. package/dist/api/region/create.js +35 -0
  49. package/dist/api/region/create.js.map +1 -0
  50. package/dist/api/region/delete.d.ts +38 -0
  51. package/dist/api/region/delete.d.ts.map +1 -0
  52. package/dist/api/region/delete.js +31 -0
  53. package/dist/api/region/delete.js.map +1 -0
  54. package/dist/api/region/index.d.ts +5 -0
  55. package/dist/api/region/index.d.ts.map +1 -0
  56. package/dist/api/region/index.js +5 -0
  57. package/dist/api/region/index.js.map +1 -0
  58. package/dist/api/region/list.d.ts +27 -0
  59. package/dist/api/region/list.d.ts.map +1 -0
  60. package/dist/api/region/list.js +21 -0
  61. package/dist/api/region/list.js.map +1 -0
  62. package/dist/api/region/resources.d.ts +53 -0
  63. package/dist/api/region/resources.d.ts.map +1 -0
  64. package/dist/api/region/resources.js +35 -0
  65. package/dist/api/region/resources.js.map +1 -0
  66. package/dist/api/user/whoami.d.ts +18 -8
  67. package/dist/api/user/whoami.d.ts.map +1 -1
  68. package/dist/api/user/whoami.js +9 -6
  69. package/dist/api/user/whoami.js.map +1 -1
  70. package/dist/config.d.ts +1 -0
  71. package/dist/config.d.ts.map +1 -1
  72. package/dist/config.js +1 -0
  73. package/dist/config.js.map +1 -1
  74. package/dist/logger.d.ts.map +1 -1
  75. package/dist/logger.js +4 -1
  76. package/dist/logger.js.map +1 -1
  77. package/dist/server.js +2 -2
  78. package/dist/server.js.map +1 -1
  79. package/package.json +4 -2
  80. package/src/api/api-example.md +16 -11
  81. package/src/api/api.ts +254 -93
  82. package/src/api/index.ts +1 -0
  83. package/src/api/org/list.ts +13 -10
  84. package/src/api/project/create.ts +14 -9
  85. package/src/api/project/delete.ts +2 -2
  86. package/src/api/project/deploy.ts +224 -0
  87. package/src/api/project/env-delete.ts +2 -2
  88. package/src/api/project/env-update.ts +9 -7
  89. package/src/api/project/exists.ts +1 -1
  90. package/src/api/project/get.ts +12 -12
  91. package/src/api/project/index.ts +1 -0
  92. package/src/api/project/list.ts +20 -15
  93. package/src/api/region/create.ts +55 -0
  94. package/src/api/region/delete.ts +49 -0
  95. package/src/api/region/index.ts +4 -0
  96. package/src/api/region/list.ts +31 -0
  97. package/src/api/region/resources.ts +51 -0
  98. package/src/api/user/whoami.ts +13 -12
  99. package/src/config.ts +2 -0
  100. package/src/logger.ts +5 -1
  101. package/src/server.ts +2 -2
@@ -1,24 +1,36 @@
1
1
  import { z } from 'zod';
2
2
  import { APIClient } from '../api';
3
- declare const ProjectListResponseSchema: z.ZodObject<{
4
- success: z.ZodBoolean;
5
- message: z.ZodOptional<z.ZodString>;
6
- data: z.ZodOptional<z.ZodArray<z.ZodObject<{
3
+ declare const ProjectListResponse: z.ZodArray<z.ZodObject<{
4
+ id: z.ZodString;
5
+ name: z.ZodString;
6
+ description: z.ZodOptional<z.ZodString>;
7
+ orgId: z.ZodString;
8
+ orgName: z.ZodString;
9
+ latestDeploymentId: z.ZodNullable<z.ZodString>;
10
+ }, z.core.$strip>>;
11
+ declare const ProjectListResponseSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
12
+ success: z.ZodLiteral<false>;
13
+ message: z.ZodString;
14
+ }, z.core.$strip>, z.ZodObject<{
15
+ success: z.ZodLiteral<true>;
16
+ data: z.ZodArray<z.ZodObject<{
7
17
  id: z.ZodString;
8
18
  name: z.ZodString;
9
19
  description: z.ZodOptional<z.ZodString>;
10
20
  orgId: z.ZodString;
11
21
  orgName: z.ZodString;
12
- }, z.core.$strip>>>;
13
- }, z.core.$strip>;
22
+ latestDeploymentId: z.ZodNullable<z.ZodString>;
23
+ }, z.core.$strip>>;
24
+ }, z.core.$strip>], "success">;
14
25
  export type ProjectListResponse = z.infer<typeof ProjectListResponseSchema>;
15
- export type ProjectList = NonNullable<ProjectListResponse['data']>;
26
+ export type ProjectList = z.infer<typeof ProjectListResponse>;
16
27
  /**
17
28
  * List all projects
18
29
  *
19
30
  * @param client
31
+ * @param hasDeployment if true, filter by projects with at least one deployment
20
32
  * @returns
21
33
  */
22
- export declare function projectList(client: APIClient): Promise<ProjectList>;
34
+ export declare function projectList(client: APIClient, hasDeployment?: boolean): Promise<ProjectList>;
23
35
  export {};
24
36
  //# sourceMappingURL=list.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../../src/api/project/list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,SAAS,EAAqB,MAAM,QAAQ,CAAC;AAEtD,QAAA,MAAM,yBAAyB;;;;;;;;;;iBAU9B,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAC5E,MAAM,MAAM,WAAW,GAAG,WAAW,CAAC,mBAAmB,CAAC,MAAM,CAAC,CAAC,CAAC;AAEnE;;;;;GAKG;AACH,wBAAsB,WAAW,CAAC,MAAM,EAAE,SAAS,GAAG,OAAO,CAAC,WAAW,CAAC,CAYzE"}
1
+ {"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../../src/api/project/list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,SAAS,EAAqB,MAAM,QAAQ,CAAC;AAEtD,QAAA,MAAM,mBAAmB;;;;;;;kBASxB,CAAC;AAEF,QAAA,MAAM,yBAAyB;;;;;;;;;;;;;8BAAyC,CAAC;AAEzE,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAC5E,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAE9D;;;;;;GAMG;AACH,wBAAsB,WAAW,CAChC,MAAM,EAAE,SAAS,EACjB,aAAa,CAAC,EAAE,OAAO,GACrB,OAAO,CAAC,WAAW,CAAC,CAYtB"}
@@ -1,23 +1,26 @@
1
1
  import { z } from 'zod';
2
2
  import { APIResponseSchema } from '../api';
3
- const ProjectListResponseSchema = APIResponseSchema(z.array(z.object({
3
+ const ProjectListResponse = z.array(z.object({
4
4
  id: z.string().describe('the project id'),
5
5
  name: z.string().describe('the project name'),
6
6
  description: z.string().optional().describe('the project description'),
7
7
  orgId: z.string().describe('the organization id that this project is registered with'),
8
8
  orgName: z.string().describe('the organization name'),
9
- })));
9
+ latestDeploymentId: z.string().nullable().describe('the latest deployment id'),
10
+ }));
11
+ const ProjectListResponseSchema = APIResponseSchema(ProjectListResponse);
10
12
  /**
11
13
  * List all projects
12
14
  *
13
15
  * @param client
16
+ * @param hasDeployment if true, filter by projects with at least one deployment
14
17
  * @returns
15
18
  */
16
- export async function projectList(client) {
17
- const resp = await client.request('GET', '/cli/project', ProjectListResponseSchema);
18
- if (resp.data) {
19
+ export async function projectList(client, hasDeployment) {
20
+ const resp = await client.request('GET', `/cli/project${hasDeployment ? '?hasDeployment=true' : ''}`, ProjectListResponseSchema);
21
+ if (resp.success) {
19
22
  return resp.data;
20
23
  }
21
- throw new Error(resp.message ?? 'failed to list projects');
24
+ throw new Error(resp.message);
22
25
  }
23
26
  //# sourceMappingURL=list.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"list.js","sourceRoot":"","sources":["../../../src/api/project/list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAa,iBAAiB,EAAE,MAAM,QAAQ,CAAC;AAEtD,MAAM,yBAAyB,GAAG,iBAAiB,CAClD,CAAC,CAAC,KAAK,CACN,CAAC,CAAC,MAAM,CAAC;IACR,EAAE,EAAE,CAAC,C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IACtE,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,0DAA0D,CAAC;IACtF,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,uBAAuB,CAAC;IACrD,kBAAkB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,0BAA0B,CAAC;CAC9E,CAAC,CACF,CAAC;AAEF,MAAM,yBAAyB,GAAG,iBAAiB,CAAC,mBAAmB,CAAC,CAAC;AAKzE;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW,CAChC,MAAiB,EACjB,aAAuB;IAEvB,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,OAAO,CAChC,KAAK,EACL,eAAe,aAAa,CAAC,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,EAAE,EAAE,EAC3D,yBAAyB,CACzB,CAAC;IAEF,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;QAClB,OAAO,IAAI,CAAC,IAAI,CAAC;IAClB,CAAC;IAED,MAAM,IAAI,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;AAC/B,CAAC"}
@@ -0,0 +1,46 @@
1
+ import { z } from 'zod';
2
+ import { APIClient } from '../api';
3
+ declare const CreateResourcesRequest: z.ZodObject<{
4
+ resources: z.ZodArray<z.ZodObject<{
5
+ type: z.ZodEnum<{
6
+ db: "db";
7
+ s3: "s3";
8
+ }>;
9
+ name: z.ZodOptional<z.ZodString>;
10
+ }, z.core.$strip>>;
11
+ }, z.core.$strip>;
12
+ declare const CreatedResource: z.ZodObject<{
13
+ type: z.ZodString;
14
+ name: z.ZodString;
15
+ }, z.core.$strip>;
16
+ declare const CreateResourcesResponseSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
17
+ success: z.ZodLiteral<false>;
18
+ message: z.ZodString;
19
+ }, z.core.$strip>, z.ZodObject<{
20
+ success: z.ZodLiteral<true>;
21
+ data: z.ZodObject<{
22
+ created: z.ZodArray<z.ZodObject<{
23
+ type: z.ZodString;
24
+ name: z.ZodString;
25
+ }, z.core.$strip>>;
26
+ }, z.core.$strip>;
27
+ }, z.core.$strip>], "success">;
28
+ export type CreateResourcesRequest = z.infer<typeof CreateResourcesRequest>;
29
+ export type CreateResourcesResponse = z.infer<typeof CreateResourcesResponseSchema>;
30
+ export type CreatedResource = z.infer<typeof CreatedResource>;
31
+ /**
32
+ * Create one or more resources (DB or S3) for an organization in a specific region
33
+ * Requires CLI authentication
34
+ *
35
+ * @param client - Catalyst API client
36
+ * @param orgId - Organization ID
37
+ * @param region - Cloud region
38
+ * @param resources - Array of resources to create
39
+ * @returns
40
+ */
41
+ export declare function createResources(client: APIClient, orgId: string, region: string, resources: Array<{
42
+ type: 'db' | 's3';
43
+ name?: string;
44
+ }>): Promise<CreatedResource[]>;
45
+ export {};
46
+ //# sourceMappingURL=create.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../../src/api/region/create.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAqB,SAAS,EAAE,MAAM,QAAQ,CAAC;AAOtD,QAAA,MAAM,sBAAsB;;;;;;;;iBAE1B,CAAC;AAEH,QAAA,MAAM,eAAe;;;iBAGnB,CAAC;AAMH,QAAA,MAAM,6BAA6B;;;;;;;;;;;8BAA6C,CAAC;AAEjF,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAC5E,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,6BAA6B,CAAC,CAAC;AACpF,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAE9D;;;;;;;;;GASG;AACH,wBAAsB,eAAe,CACpC,MAAM,EAAE,SAAS,EACjB,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,KAAK,CAAC;IAAE,IAAI,EAAE,IAAI,GAAG,IAAI,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,GACpD,OAAO,CAAC,eAAe,EAAE,CAAC,CAY5B"}
@@ -0,0 +1,35 @@
1
+ import { z } from 'zod';
2
+ import { APIResponseSchema } from '../api';
3
+ const ResourceSpec = z.object({
4
+ type: z.enum(['db', 's3']).describe('the resource type'),
5
+ name: z.string().optional().describe('optional custom name for db'),
6
+ });
7
+ const CreateResourcesRequest = z.object({
8
+ resources: z.array(ResourceSpec).describe('list of resources to create'),
9
+ });
10
+ const CreatedResource = z.object({
11
+ type: z.string().describe('the resource type'),
12
+ name: z.string().describe('the resource name'),
13
+ });
14
+ const CreateResourcesResponse = z.object({
15
+ created: z.array(CreatedResource),
16
+ });
17
+ const CreateResourcesResponseSchema = APIResponseSchema(CreateResourcesResponse);
18
+ /**
19
+ * Create one or more resources (DB or S3) for an organization in a specific region
20
+ * Requires CLI authentication
21
+ *
22
+ * @param client - Catalyst API client
23
+ * @param orgId - Organization ID
24
+ * @param region - Cloud region
25
+ * @param resources - Array of resources to create
26
+ * @returns
27
+ */
28
+ export async function createResources(client, orgId, region, resources) {
29
+ const resp = await client.request('POST', `/resource/2025-11-16/${orgId}/${region}`, CreateResourcesResponseSchema, { resources }, CreateResourcesRequest);
30
+ if (resp.success) {
31
+ return resp.data.created;
32
+ }
33
+ throw new Error('message' in resp ? resp.message : 'Failed to create resources');
34
+ }
35
+ //# sourceMappingURL=create.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create.js","sourceRoot":"","sources":["../../../src/api/region/create.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,iBAAiB,EAAa,MAAM,QAAQ,CAAC;AAEtD,MAAM,YAAY,GAAG,CAAC,CAAC,MAAM,CAAC;I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,OAAO,CAAC,CAAC,CAAC,4BAA4B,CAAC,CAAC;AAClF,CAAC"}
@@ -0,0 +1,38 @@
1
+ import { z } from 'zod';
2
+ import { APIClient } from '../api';
3
+ declare const DeleteResourcesRequest: z.ZodObject<{
4
+ resources: z.ZodArray<z.ZodObject<{
5
+ type: z.ZodEnum<{
6
+ db: "db";
7
+ s3: "s3";
8
+ }>;
9
+ name: z.ZodString;
10
+ }, z.core.$strip>>;
11
+ }, z.core.$strip>;
12
+ declare const DeleteResourcesResponseSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
13
+ success: z.ZodLiteral<false>;
14
+ message: z.ZodString;
15
+ }, z.core.$strip>, z.ZodObject<{
16
+ success: z.ZodLiteral<true>;
17
+ data: z.ZodObject<{
18
+ deleted: z.ZodArray<z.ZodString>;
19
+ }, z.core.$strip>;
20
+ }, z.core.$strip>], "success">;
21
+ export type DeleteResourcesRequest = z.infer<typeof DeleteResourcesRequest>;
22
+ export type DeleteResourcesResponse = z.infer<typeof DeleteResourcesResponseSchema>;
23
+ /**
24
+ * Delete one or more resources (DB or S3) for an organization in a specific region
25
+ * Requires CLI authentication
26
+ *
27
+ * @param client - Catalyst API client
28
+ * @param orgId - Organization ID
29
+ * @param region - Cloud region
30
+ * @param resources - Array of resources to delete
31
+ * @returns
32
+ */
33
+ export declare function deleteResources(client: APIClient, orgId: string, region: string, resources: Array<{
34
+ type: 'db' | 's3';
35
+ name: string;
36
+ }>): Promise<string[]>;
37
+ export {};
38
+ //# sourceMappingURL=delete.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"delete.d.ts","sourceRoot":"","sources":["../../../src/api/region/delete.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAqB,SAAS,EAAE,MAAM,QAAQ,CAAC;AAOtD,QAAA,MAAM,sBAAsB;;;;;;;;iBAE1B,CAAC;AAMH,QAAA,MAAM,6BAA6B;;;;;;;;8BAA6C,CAAC;AAEjF,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAC5E,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,6BAA6B,CAAC,CAAC;AAEpF;;;;;;;;;GASG;AACH,wBAAsB,eAAe,CACpC,MAAM,EAAE,SAAS,EACjB,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,KAAK,CAAC;IAAE,IAAI,EAAE,IAAI,GAAG,IAAI,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,GACnD,OAAO,CAAC,MAAM,EAAE,CAAC,CAYnB"}
@@ -0,0 +1,31 @@
1
+ import { z } from 'zod';
2
+ import { APIResponseSchema } from '../api';
3
+ const DeleteResourceSpec = z.object({
4
+ type: z.enum(['db', 's3']).describe('the resource type'),
5
+ name: z.string().describe('the resource name (bucket_name for S3, db_name for DB)'),
6
+ });
7
+ const DeleteResourcesRequest = z.object({
8
+ resources: z.array(DeleteResourceSpec).describe('list of resources to delete'),
9
+ });
10
+ const DeleteResourcesResponse = z.object({
11
+ deleted: z.array(z.string()).describe('list of deleted resource names'),
12
+ });
13
+ const DeleteResourcesResponseSchema = APIResponseSchema(DeleteResourcesResponse);
14
+ /**
15
+ * Delete one or more resources (DB or S3) for an organization in a specific region
16
+ * Requires CLI authentication
17
+ *
18
+ * @param client - Catalyst API client
19
+ * @param orgId - Organization ID
20
+ * @param region - Cloud region
21
+ * @param resources - Array of resources to delete
22
+ * @returns
23
+ */
24
+ export async function deleteResources(client, orgId, region, resources) {
25
+ const resp = await client.request('DELETE', `/resource/2025-11-16/${orgId}/${region}`, DeleteResourcesResponseSchema, { resources }, DeleteResourcesRequest);
26
+ if (resp.success) {
27
+ return resp.data.deleted;
28
+ }
29
+ throw new Error('message' in resp ? resp.message : 'Failed to delete resources');
30
+ }
31
+ //# sourceMappingURL=delete.js.map
@@ -0,0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SAAS,IAAI,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,4BAA4B,CAAC,CAAC;AAClF,CAAC"}
@@ -0,0 +1,5 @@
1
+ export * from './list';
2
+ export * from './resources';
3
+ export * from './create';
4
+ export * from './delete';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/api/region/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC"}
@@ -0,0 +1,5 @@
1
+ export * from './list';
2
+ export * from './resources';
3
+ export * from './create';
4
+ export * from './delete';
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/api/region/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC"}
@@ -0,0 +1,27 @@
1
+ import { z } from 'zod';
2
+ import { APIClient } from '../api';
3
+ declare const ListRegionsResponse: z.ZodArray<z.ZodObject<{
4
+ region: z.ZodString;
5
+ description: z.ZodString;
6
+ }, z.core.$strip>>;
7
+ declare const ListRegionsResponseSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
8
+ success: z.ZodLiteral<false>;
9
+ message: z.ZodString;
10
+ }, z.core.$strip>, z.ZodObject<{
11
+ success: z.ZodLiteral<true>;
12
+ data: z.ZodArray<z.ZodObject<{
13
+ region: z.ZodString;
14
+ description: z.ZodString;
15
+ }, z.core.$strip>>;
16
+ }, z.core.$strip>], "success">;
17
+ export type ListRegionsResponse = z.infer<typeof ListRegionsResponseSchema>;
18
+ export type RegionList = z.infer<typeof ListRegionsResponse>;
19
+ /**
20
+ * List all available cloud regions
21
+ *
22
+ * @param client
23
+ * @returns
24
+ */
25
+ export declare function listRegions(client: APIClient): Promise<RegionList>;
26
+ export {};
27
+ //# sourceMappingURL=list.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../../src/api/region/list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAqB,SAAS,EAAE,MAAM,QAAQ,CAAC;AAEtD,QAAA,MAAM,mBAAmB;;;kBAKxB,CAAC;AACF,QAAA,MAAM,yBAAyB;;;;;;;;;8BAAyC,CAAC;AAEzE,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAC5E,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAE7D;;;;;GAKG;AACH,wBAAsB,WAAW,CAAC,MAAM,EAAE,SAAS,GAAG,OAAO,CAAC,UAAU,CAAC,CAUxE"}
@@ -0,0 +1,21 @@
1
+ import { z } from 'zod';
2
+ import { APIResponseSchema } from '../api';
3
+ const ListRegionsResponse = z.array(z.object({
4
+ region: z.string().describe('the region identifier'),
5
+ description: z.string().describe('the human-readable description of the region'),
6
+ }));
7
+ const ListRegionsResponseSchema = APIResponseSchema(ListRegionsResponse);
8
+ /**
9
+ * List all available cloud regions
10
+ *
11
+ * @param client
12
+ * @returns
13
+ */
14
+ export async function listRegions(client) {
15
+ const resp = await client.request('GET', '/cli/region', ListRegionsResponseSchema);
16
+ if (resp.success) {
17
+ return resp.data;
18
+ }
19
+ throw new Error(resp.message);
20
+ }
21
+ //# sourceMappingURL=list.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list.js","sourceRoot":"","sources":["../../../src/api/region/list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,iBAAiB,EAAa,MAAM,QAAQ,CAAC;AAEtD,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAClC,CAAC,CAAC,MAAM,CAAC;IACR,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,uBAAuB,CAAC;IACpD,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,8CAA8C,CAAC;CAChF,CAAC,CACF,CAAC;AACF,MAAM,yBAAyB,GAAG,iBAAiB,CAAC,mBAAmB,CAAC,CAAC;AAKzE;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,MAAiB;IAClD,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,OAAO,CAChC,KAAK,EACL,aAAa,EACb,yBAAyB,CACzB,CAAC;IACF,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;QAClB,OAAO,IAAI,CAAC,IAAI,CAAC;IAClB,CAAC;IACD,MAAM,IAAI,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;AAC/B,CAAC"}
@@ -0,0 +1,53 @@
1
+ import { z } from 'zod';
2
+ import { APIClient } from '../api';
3
+ declare const ResourceListResponse: z.ZodObject<{
4
+ s3: z.ZodArray<z.ZodObject<{
5
+ bucket_name: z.ZodString;
6
+ access_key: z.ZodOptional<z.ZodNullable<z.ZodString>>;
7
+ secret_key: z.ZodOptional<z.ZodNullable<z.ZodString>>;
8
+ region: z.ZodOptional<z.ZodNullable<z.ZodString>>;
9
+ endpoint: z.ZodOptional<z.ZodNullable<z.ZodString>>;
10
+ cname: z.ZodOptional<z.ZodNullable<z.ZodString>>;
11
+ }, z.core.$strip>>;
12
+ db: z.ZodArray<z.ZodObject<{
13
+ name: z.ZodString;
14
+ username: z.ZodOptional<z.ZodNullable<z.ZodString>>;
15
+ password: z.ZodOptional<z.ZodNullable<z.ZodString>>;
16
+ url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
17
+ }, z.core.$strip>>;
18
+ }, z.core.$strip>;
19
+ declare const ResourceListResponseSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
20
+ success: z.ZodLiteral<false>;
21
+ message: z.ZodString;
22
+ }, z.core.$strip>, z.ZodObject<{
23
+ success: z.ZodLiteral<true>;
24
+ data: z.ZodObject<{
25
+ s3: z.ZodArray<z.ZodObject<{
26
+ bucket_name: z.ZodString;
27
+ access_key: z.ZodOptional<z.ZodNullable<z.ZodString>>;
28
+ secret_key: z.ZodOptional<z.ZodNullable<z.ZodString>>;
29
+ region: z.ZodOptional<z.ZodNullable<z.ZodString>>;
30
+ endpoint: z.ZodOptional<z.ZodNullable<z.ZodString>>;
31
+ cname: z.ZodOptional<z.ZodNullable<z.ZodString>>;
32
+ }, z.core.$strip>>;
33
+ db: z.ZodArray<z.ZodObject<{
34
+ name: z.ZodString;
35
+ username: z.ZodOptional<z.ZodNullable<z.ZodString>>;
36
+ password: z.ZodOptional<z.ZodNullable<z.ZodString>>;
37
+ url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
38
+ }, z.core.$strip>>;
39
+ }, z.core.$strip>;
40
+ }, z.core.$strip>], "success">;
41
+ export type ResourceListResponse = z.infer<typeof ResourceListResponseSchema>;
42
+ export type ResourceList = z.infer<typeof ResourceListResponse>;
43
+ /**
44
+ * List all resources for a given organization and region
45
+ *
46
+ * @param client
47
+ * @param orgId
48
+ * @param region
49
+ * @returns
50
+ */
51
+ export declare function listResources(client: APIClient, orgId: string, region: string): Promise<ResourceList>;
52
+ export {};
53
+ //# sourceMappingURL=resources.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resources.d.ts","sourceRoot":"","sources":["../../../src/api/region/resources.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAqB,SAAS,EAAE,MAAM,QAAQ,CAAC;AAEtD,QAAA,MAAM,oBAAoB;;;;;;;;;;;;;;;iBAmBxB,CAAC;AACH,QAAA,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;8BAA0C,CAAC;AAE3E,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAC9E,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAEhE;;;;;;;GAOG;AACH,wBAAsB,aAAa,CAClC,MAAM,EAAE,SAAS,EACjB,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,GACZ,OAAO,CAAC,YAAY,CAAC,CAUvB"}
@@ -0,0 +1,35 @@
1
+ import { z } from 'zod';
2
+ import { APIResponseSchema } from '../api';
3
+ const ResourceListResponse = z.object({
4
+ s3: z.array(z.object({
5
+ bucket_name: z.string().describe('the S3 bucket name'),
6
+ access_key: z.string().nullable().optional().describe('the S3 access key'),
7
+ secret_key: z.string().nullable().optional().describe('the S3 secret key'),
8
+ region: z.string().nullable().optional().describe('the S3 region'),
9
+ endpoint: z.string().nullable().optional().describe('the S3 endpoint'),
10
+ cname: z.string().nullable().optional().describe('the S3 CNAME'),
11
+ })),
12
+ db: z.array(z.object({
13
+ name: z.string().describe('the database name'),
14
+ username: z.string().nullable().optional().describe('the database username'),
15
+ password: z.string().nullable().optional().describe('the database password'),
16
+ url: z.string().nullable().optional().describe('the full database connection URL'),
17
+ })),
18
+ });
19
+ const ResourceListResponseSchema = APIResponseSchema(ResourceListResponse);
20
+ /**
21
+ * List all resources for a given organization and region
22
+ *
23
+ * @param client
24
+ * @param orgId
25
+ * @param region
26
+ * @returns
27
+ */
28
+ export async function listResources(client, orgId, region) {
29
+ const resp = await client.request('GET', `/resource/2025-03-17/${orgId}/${region}`, ResourceListResponseSchema);
30
+ if (resp.success) {
31
+ return resp.data;
32
+ }
33
+ throw new Error(resp.message);
34
+ }
35
+ //# sourceMappingURL=resources.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resources.js","sourceRoot":"","sources":["../../../src/api/region/resources.ts"],"names":[],"mappings":"AA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,uBAAuB,CAAC;QAC5E,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,kCAAkC,CAAC;KAClF,CAAC,CACF;CACD,CAAC,CAAC;AACH,MAAM,0BAA0B,GAAG,iBAAiB,CAAC,oBAAoB,CAAC,CAAC;AAK3E;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa,CAClC,MAAiB,EACjB,KAAa,EACb,MAAc;IAEd,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,OAAO,CAChC,KAAK,EACL,wBAAwB,KAAK,IAAI,MAAM,EAAE,EACzC,0BAA0B,CAC1B,CAAC;IACF,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;QAClB,OAAO,IAAI,CAAC,IAAI,CAAC;IAClB,CAAC;IACD,MAAM,IAAI,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;AAC/B,CAAC"}
@@ -1,25 +1,35 @@
1
1
  import { z } from 'zod';
2
2
  import { APIClient } from '../api';
3
- declare const WhoamiResponseSchema: z.ZodObject<{
4
- success: z.ZodBoolean;
5
- message: z.ZodOptional<z.ZodString>;
6
- data: z.ZodOptional<z.ZodObject<{
3
+ declare const WhoamiResponse: z.ZodObject<{
4
+ firstName: z.ZodString;
5
+ lastName: z.ZodString;
6
+ organizations: z.ZodArray<z.ZodObject<{
7
+ id: z.ZodString;
8
+ name: z.ZodString;
9
+ }, z.core.$strip>>;
10
+ }, z.core.$strip>;
11
+ declare const WhoamiResponseSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
12
+ success: z.ZodLiteral<false>;
13
+ message: z.ZodString;
14
+ }, z.core.$strip>, z.ZodObject<{
15
+ success: z.ZodLiteral<true>;
16
+ data: z.ZodObject<{
7
17
  firstName: z.ZodString;
8
18
  lastName: z.ZodString;
9
19
  organizations: z.ZodArray<z.ZodObject<{
10
20
  id: z.ZodString;
11
21
  name: z.ZodString;
12
22
  }, z.core.$strip>>;
13
- }, z.core.$strip>>;
14
- }, z.core.$strip>;
23
+ }, z.core.$strip>;
24
+ }, z.core.$strip>], "success">;
15
25
  export type WhoamiResponse = z.infer<typeof WhoamiResponseSchema>;
16
- export type User = NonNullable<WhoamiResponse['data']>;
26
+ export type User = z.infer<typeof WhoamiResponse>;
17
27
  /**
18
28
  * Get the current authenticated user information
19
29
  *
20
30
  * @param client
21
31
  * @returns
22
32
  */
23
- export declare function whoami(client: APIClient): Promise<WhoamiResponse>;
33
+ export declare function whoami(client: APIClient): Promise<User>;
24
34
  export {};
25
35
  //# 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;AAOtD,QAAA,MAAM,oBAAoB;;;;;;;;;;;iBAQzB,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAClE,MAAM,MAAM,IAAI,GAAG,WAAW,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,CAAC;AAEvD;;;;;GAKG;AACH,wBAAsB,MAAM,CAAC,MAAM,EAAE,SAAS,GAAG,OAAO,CAAC,cAAc,CAAC,CAEvE"}
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;AAOtD,QAAA,MAAM,cAAc;;;;;;;iBAIlB,CAAC;AACH,QAAA,MAAM,oBAAoB;;;;;;;;;;;;;8BAAoC,CAAC;AAE/D,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"}
@@ -4,13 +4,12 @@ const OrganizationSchema = z.object({
4
4
  id: z.string().describe('the unique id for the organization'),
5
5
  name: z.string().describe('the name of the organization'),
6
6
  });
7
- const WhoamiResponseSchema = APIResponseSchema(z.object({
7
+ const WhoamiResponse = z.object({
8
8
  firstName: z.string().describe('the first name of the user'),
9
9
  lastName: z.string().describe('the last name of the user'),
10
- organizations: z
11
- .array(OrganizationSchema)
12
- .describe('the organizations the user is a member of'),
13
- }));
10
+ organizations: z.array(OrganizationSchema).describe('the organizations the user is a member of'),
11
+ });
12
+ const WhoamiResponseSchema = APIResponseSchema(WhoamiResponse);
14
13
  /**
15
14
  * Get the current authenticated user information
16
15
  *
@@ -18,6 +17,10 @@ const WhoamiResponseSchema = APIResponseSchema(z.object({
18
17
  * @returns
19
18
  */
20
19
  export async function whoami(client) {
21
- return client.request('GET', '/cli/auth/user', WhoamiResponseSchema);
20
+ const resp = await client.request('GET', '/cli/auth/user', WhoamiResponseSchema);
21
+ if (resp.success) {
22
+ return resp.data;
23
+ }
24
+ throw new Error(resp.message);
22
25
  }
23
26
  //# sourceMappingURL=whoami.js.map
@@ -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;AAEtD,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC;IACnC,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,oCAAoC,CAAC;IAC7D,IAAI,EAAE,CAAC,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AQ,CAAC,2CAA2C,CAAC;CAChG,CAAC,CAAC;AACH,MAAM,oBAAoB,GAAG,iBAAiB,CAAC,cAAc,CAAC,CAAC;AAK/D;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,MAAM,CAAC,MAAiB;IAC7C,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,OAAO,CAAiB,KAAK,EAAE,gBAAgB,EAAE,oBAAoB,CAAC,CAAC;IACjG,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;QAClB,OAAO,IAAI,CAAC,IAAI,CAAC;IAClB,CAAC;IACD,MAAM,IAAI,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;AAC/B,CAAC"}
package/dist/config.d.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
  * Get service URLs from environment variables with fallback defaults
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,WAAW;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;CACf;AAED;;GAEG;AACH,wBAAgB,cAAc,IAAI,WAAW,CAS5C"}
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,WAAW;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;CACjB;AAED;;GAEG;AACH,wBAAgB,cAAc,IAAI,WAAW,CAU5C"}
package/dist/config.js CHANGED
@@ -8,6 +8,7 @@ export function getServiceUrls() {
8
8
  objectstore: process.env.AGENTUITY_OBJECTSTORE_URL || transportUrl,
9
9
  stream: process.env.AGENTUITY_STREAM_URL || 'https://streams.agentuity.cloud',
10
10
  vector: process.env.AGENTUITY_VECTOR_URL || transportUrl,
11
+ catalyst: process.env.AGENTUITY_CATALYST_URL || transportUrl,
11
12
  };
12
13
  }
13
14
  //# sourceMappingURL=config.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAOA;;GAEG;AACH,MAAM,UAAU,cAAc;IAC7B,MAAM,YAAY,GAAG,OAAO,CAAC,GAAG,CAAC,uBAAuB,IAAI,sBAAsB,CAAC;IAEnF,OAAO;QACN,QAAQ,EAAE,OAAO,CAAC,GAAG,CAAC,sBAAsB,IAAI,YAAY;QAC5D,WAAW,EAAE,OAAO,CAAC,GAAG,CAAC,yBAAyB,IAAI,YAAY;QAClE,MAAM,EAAE,OAAO,CAAC,GAAG,CAAC,oBAAoB,IAAI,iCAAiC;QAC7E,MAAM,EAAE,OAAO,CAAC,GAAG,CAAC,oBAAoB,IAAI,YAAY;KACxD,CAAC;AACH,CAAC"}
1
+ {"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAQA;;GAEG;AACH,MAAM,UAAU,cAAc;IAC7B,MAAM,YAAY,GAAG,OAAO,CAAC,GAAG,CAAC,uBAAuB,IAAI,sBAAsB,CAAC;IAEnF,OAAO;QACN,QAAQ,EAAE,OAAO,CAAC,GAAG,CAAC,sBAAsB,IAAI,YAAY;QAC5D,WAAW,EAAE,OAAO,CAAC,GAAG,CAAC,yBAAyB,IAAI,YAAY;QAClE,MAAM,EAAE,OAAO,CAAC,GAAG,CAAC,oBAAoB,IAAI,iCAAiC;QAC7E,MAAM,EAAE,OAAO,CAAC,GAAG,CAAC,oBAAoB,IAAI,YAAY;QACxD,QAAQ,EAAE,OAAO,CAAC,GAAG,CAAC,sBAAsB,IAAI,YAAY;KAC5D,CAAC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gCrB,OAAO,CAAC,GAAG;IA+CX,KAAK,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI;IAIjD,KAAK,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI;IAIjD,IAAI,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI;IAIhD,IAAI,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI;IAIhD,KAAK,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI;IAIjD,KAAK,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,KAAK;IAKlD,KAAK,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM;CAM5C;AAED;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAC3B,KAAK,GAAE,QAAiB,EACxB,aAAa,GAAE,OAAe,EAC9B,WAAW,GAAE,WAAoB,EACjC,OAAO,GAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAM,GACnC,MAAM,CAER"}
package/dist/logger.js CHANGED
@@ -25,7 +25,10 @@ function shouldUseColors() {
25
25
  return false;
26
26
  }
27
27
  // Check if stdout is a TTY
28
- if (process.stdout && typeof process.stdout.isTTY !== 'undefined' && !process.stdout.isTTY) {
28
+ if (!process.stdout || typeof process.stdout.isTTY === 'undefined') {
29
+ return false;
30
+ }
31
+ if (!process.stdout.isTTY) {
29
32
  return false;
30
33
  }
31
34
  return true;