@agentuity/cli 0.1.19 → 0.1.21

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 (168) hide show
  1. package/dist/cmd/auth/index.d.ts.map +1 -1
  2. package/dist/cmd/auth/index.js +2 -0
  3. package/dist/cmd/auth/index.js.map +1 -1
  4. package/dist/cmd/auth/machine/index.d.ts +2 -0
  5. package/dist/cmd/auth/machine/index.d.ts.map +1 -0
  6. package/dist/cmd/auth/machine/index.js +16 -0
  7. package/dist/cmd/auth/machine/index.js.map +1 -0
  8. package/dist/cmd/auth/machine/setup.d.ts +2 -0
  9. package/dist/cmd/auth/machine/setup.d.ts.map +1 -0
  10. package/dist/cmd/auth/machine/setup.js +87 -0
  11. package/dist/cmd/auth/machine/setup.js.map +1 -0
  12. package/dist/cmd/cloud/db/index.js +1 -1
  13. package/dist/cmd/cloud/db/index.js.map +1 -1
  14. package/dist/cmd/cloud/index.d.ts.map +1 -1
  15. package/dist/cmd/cloud/index.js +2 -0
  16. package/dist/cmd/cloud/index.js.map +1 -1
  17. package/dist/cmd/cloud/keyvalue/create-namespace.d.ts.map +1 -1
  18. package/dist/cmd/cloud/keyvalue/create-namespace.js +2 -1
  19. package/dist/cmd/cloud/keyvalue/create-namespace.js.map +1 -1
  20. package/dist/cmd/cloud/keyvalue/delete-namespace.d.ts.map +1 -1
  21. package/dist/cmd/cloud/keyvalue/delete-namespace.js +2 -1
  22. package/dist/cmd/cloud/keyvalue/delete-namespace.js.map +1 -1
  23. package/dist/cmd/cloud/keyvalue/delete.d.ts.map +1 -1
  24. package/dist/cmd/cloud/keyvalue/delete.js +2 -1
  25. package/dist/cmd/cloud/keyvalue/delete.js.map +1 -1
  26. package/dist/cmd/cloud/keyvalue/get.d.ts.map +1 -1
  27. package/dist/cmd/cloud/keyvalue/get.js +2 -1
  28. package/dist/cmd/cloud/keyvalue/get.js.map +1 -1
  29. package/dist/cmd/cloud/keyvalue/keys.d.ts.map +1 -1
  30. package/dist/cmd/cloud/keyvalue/keys.js +2 -1
  31. package/dist/cmd/cloud/keyvalue/keys.js.map +1 -1
  32. package/dist/cmd/cloud/keyvalue/list-namespaces.d.ts.map +1 -1
  33. package/dist/cmd/cloud/keyvalue/list-namespaces.js +2 -1
  34. package/dist/cmd/cloud/keyvalue/list-namespaces.js.map +1 -1
  35. package/dist/cmd/cloud/keyvalue/repl.js +1 -1
  36. package/dist/cmd/cloud/keyvalue/repl.js.map +1 -1
  37. package/dist/cmd/cloud/keyvalue/search.d.ts.map +1 -1
  38. package/dist/cmd/cloud/keyvalue/search.js +2 -1
  39. package/dist/cmd/cloud/keyvalue/search.js.map +1 -1
  40. package/dist/cmd/cloud/keyvalue/set.d.ts.map +1 -1
  41. package/dist/cmd/cloud/keyvalue/set.js +2 -1
  42. package/dist/cmd/cloud/keyvalue/set.js.map +1 -1
  43. package/dist/cmd/cloud/keyvalue/stats.d.ts.map +1 -1
  44. package/dist/cmd/cloud/keyvalue/stats.js +2 -1
  45. package/dist/cmd/cloud/keyvalue/stats.js.map +1 -1
  46. package/dist/cmd/cloud/keyvalue/util.d.ts +5 -6
  47. package/dist/cmd/cloud/keyvalue/util.d.ts.map +1 -1
  48. package/dist/cmd/cloud/keyvalue/util.js +8 -4
  49. package/dist/cmd/cloud/keyvalue/util.js.map +1 -1
  50. package/dist/cmd/cloud/machine/delete.d.ts +2 -0
  51. package/dist/cmd/cloud/machine/delete.d.ts.map +1 -0
  52. package/dist/cmd/cloud/machine/delete.js +84 -0
  53. package/dist/cmd/cloud/machine/delete.js.map +1 -0
  54. package/dist/cmd/cloud/machine/deployments.d.ts +2 -0
  55. package/dist/cmd/cloud/machine/deployments.d.ts.map +1 -0
  56. package/dist/cmd/cloud/machine/deployments.js +86 -0
  57. package/dist/cmd/cloud/machine/deployments.js.map +1 -0
  58. package/dist/cmd/cloud/machine/get.d.ts +2 -0
  59. package/dist/cmd/cloud/machine/get.d.ts.map +1 -0
  60. package/dist/cmd/cloud/machine/get.js +104 -0
  61. package/dist/cmd/cloud/machine/get.js.map +1 -0
  62. package/dist/cmd/cloud/machine/index.d.ts +2 -0
  63. package/dist/cmd/cloud/machine/index.d.ts.map +1 -0
  64. package/dist/cmd/cloud/machine/index.js +22 -0
  65. package/dist/cmd/cloud/machine/index.js.map +1 -0
  66. package/dist/cmd/cloud/machine/list.d.ts +2 -0
  67. package/dist/cmd/cloud/machine/list.d.ts.map +1 -0
  68. package/dist/cmd/cloud/machine/list.js +73 -0
  69. package/dist/cmd/cloud/machine/list.js.map +1 -0
  70. package/dist/cmd/cloud/queue/index.js +1 -1
  71. package/dist/cmd/cloud/queue/index.js.map +1 -1
  72. package/dist/cmd/cloud/redis/index.js +1 -1
  73. package/dist/cmd/cloud/redis/index.js.map +1 -1
  74. package/dist/cmd/cloud/sandbox/get.d.ts.map +1 -1
  75. package/dist/cmd/cloud/sandbox/get.js +25 -18
  76. package/dist/cmd/cloud/sandbox/get.js.map +1 -1
  77. package/dist/cmd/cloud/sandbox/index.js +1 -1
  78. package/dist/cmd/cloud/sandbox/index.js.map +1 -1
  79. package/dist/cmd/cloud/sandbox/list.d.ts.map +1 -1
  80. package/dist/cmd/cloud/sandbox/list.js +40 -9
  81. package/dist/cmd/cloud/sandbox/list.js.map +1 -1
  82. package/dist/cmd/cloud/sandbox/snapshot/get.d.ts.map +1 -1
  83. package/dist/cmd/cloud/sandbox/snapshot/get.js +16 -0
  84. package/dist/cmd/cloud/sandbox/snapshot/get.js.map +1 -1
  85. package/dist/cmd/cloud/storage/index.js +1 -1
  86. package/dist/cmd/cloud/storage/index.js.map +1 -1
  87. package/dist/cmd/cloud/stream/index.js +1 -1
  88. package/dist/cmd/cloud/stream/index.js.map +1 -1
  89. package/dist/cmd/cloud/vector/delete-namespace.d.ts.map +1 -1
  90. package/dist/cmd/cloud/vector/delete-namespace.js +2 -1
  91. package/dist/cmd/cloud/vector/delete-namespace.js.map +1 -1
  92. package/dist/cmd/cloud/vector/delete.d.ts.map +1 -1
  93. package/dist/cmd/cloud/vector/delete.js +2 -1
  94. package/dist/cmd/cloud/vector/delete.js.map +1 -1
  95. package/dist/cmd/cloud/vector/get.d.ts.map +1 -1
  96. package/dist/cmd/cloud/vector/get.js +2 -1
  97. package/dist/cmd/cloud/vector/get.js.map +1 -1
  98. package/dist/cmd/cloud/vector/index.js +1 -1
  99. package/dist/cmd/cloud/vector/index.js.map +1 -1
  100. package/dist/cmd/cloud/vector/list-namespaces.d.ts.map +1 -1
  101. package/dist/cmd/cloud/vector/list-namespaces.js +2 -1
  102. package/dist/cmd/cloud/vector/list-namespaces.js.map +1 -1
  103. package/dist/cmd/cloud/vector/search.d.ts.map +1 -1
  104. package/dist/cmd/cloud/vector/search.js +2 -1
  105. package/dist/cmd/cloud/vector/search.js.map +1 -1
  106. package/dist/cmd/cloud/vector/stats.d.ts.map +1 -1
  107. package/dist/cmd/cloud/vector/stats.js +2 -1
  108. package/dist/cmd/cloud/vector/stats.js.map +1 -1
  109. package/dist/cmd/cloud/vector/upsert.d.ts.map +1 -1
  110. package/dist/cmd/cloud/vector/upsert.js +2 -1
  111. package/dist/cmd/cloud/vector/upsert.js.map +1 -1
  112. package/dist/cmd/cloud/vector/util.d.ts +7 -8
  113. package/dist/cmd/cloud/vector/util.d.ts.map +1 -1
  114. package/dist/cmd/cloud/vector/util.js +7 -7
  115. package/dist/cmd/cloud/vector/util.js.map +1 -1
  116. package/dist/cmd/setup/index.d.ts.map +1 -1
  117. package/dist/cmd/setup/index.js +7 -2
  118. package/dist/cmd/setup/index.js.map +1 -1
  119. package/dist/config.d.ts +7 -2
  120. package/dist/config.d.ts.map +1 -1
  121. package/dist/config.js +13 -4
  122. package/dist/config.js.map +1 -1
  123. package/dist/env-util.d.ts +1 -1
  124. package/dist/env-util.d.ts.map +1 -1
  125. package/dist/env-util.js +1 -1
  126. package/dist/env-util.js.map +1 -1
  127. package/package.json +6 -6
  128. package/src/cmd/auth/index.ts +2 -0
  129. package/src/cmd/auth/machine/index.ts +16 -0
  130. package/src/cmd/auth/machine/setup.ts +104 -0
  131. package/src/cmd/cloud/db/index.ts +1 -1
  132. package/src/cmd/cloud/index.ts +2 -0
  133. package/src/cmd/cloud/keyvalue/create-namespace.ts +2 -1
  134. package/src/cmd/cloud/keyvalue/delete-namespace.ts +2 -1
  135. package/src/cmd/cloud/keyvalue/delete.ts +2 -1
  136. package/src/cmd/cloud/keyvalue/get.ts +2 -1
  137. package/src/cmd/cloud/keyvalue/keys.ts +2 -1
  138. package/src/cmd/cloud/keyvalue/list-namespaces.ts +2 -1
  139. package/src/cmd/cloud/keyvalue/repl.ts +1 -1
  140. package/src/cmd/cloud/keyvalue/search.ts +2 -1
  141. package/src/cmd/cloud/keyvalue/set.ts +2 -1
  142. package/src/cmd/cloud/keyvalue/stats.ts +2 -1
  143. package/src/cmd/cloud/keyvalue/util.ts +15 -7
  144. package/src/cmd/cloud/machine/delete.ts +91 -0
  145. package/src/cmd/cloud/machine/deployments.ts +94 -0
  146. package/src/cmd/cloud/machine/get.ts +110 -0
  147. package/src/cmd/cloud/machine/index.ts +22 -0
  148. package/src/cmd/cloud/machine/list.ts +80 -0
  149. package/src/cmd/cloud/queue/index.ts +1 -1
  150. package/src/cmd/cloud/redis/index.ts +1 -1
  151. package/src/cmd/cloud/sandbox/get.ts +28 -19
  152. package/src/cmd/cloud/sandbox/index.ts +1 -1
  153. package/src/cmd/cloud/sandbox/list.ts +44 -9
  154. package/src/cmd/cloud/sandbox/snapshot/get.ts +18 -0
  155. package/src/cmd/cloud/storage/index.ts +1 -1
  156. package/src/cmd/cloud/stream/index.ts +1 -1
  157. package/src/cmd/cloud/vector/delete-namespace.ts +2 -1
  158. package/src/cmd/cloud/vector/delete.ts +2 -1
  159. package/src/cmd/cloud/vector/get.ts +2 -1
  160. package/src/cmd/cloud/vector/index.ts +1 -1
  161. package/src/cmd/cloud/vector/list-namespaces.ts +2 -1
  162. package/src/cmd/cloud/vector/search.ts +2 -1
  163. package/src/cmd/cloud/vector/stats.ts +2 -1
  164. package/src/cmd/cloud/vector/upsert.ts +2 -1
  165. package/src/cmd/cloud/vector/util.ts +15 -12
  166. package/src/cmd/setup/index.ts +7 -2
  167. package/src/config.ts +19 -4
  168. package/src/env-util.ts +1 -1
@@ -6,6 +6,45 @@ import { sandboxList } from '@agentuity/server';
6
6
  import { getGlobalCatalystAPIClient } from '../../../config';
7
7
  import type { SandboxStatus } from '@agentuity/core';
8
8
 
9
+ const SandboxRuntimeInfoSchema = z.object({
10
+ id: z.string().describe('Runtime ID'),
11
+ name: z.string().describe('Runtime name'),
12
+ iconUrl: z.string().optional().describe('URL for runtime icon'),
13
+ brandColor: z.string().optional().describe('Brand color for the runtime'),
14
+ tags: z.array(z.string()).optional().describe('Runtime tags'),
15
+ });
16
+
17
+ const SandboxSnapshotUserInfoSchema = z.object({
18
+ id: z.string().describe('User ID'),
19
+ firstName: z.string().optional().describe("User's first name"),
20
+ lastName: z.string().optional().describe("User's last name"),
21
+ });
22
+
23
+ const SandboxSnapshotOrgInfoSchema = z.object({
24
+ id: z.string().describe('Organization ID'),
25
+ name: z.string().describe('Organization name'),
26
+ slug: z.string().optional().describe('Organization slug'),
27
+ });
28
+
29
+ const SandboxSnapshotInfoSchema = z.discriminatedUnion('public', [
30
+ z.object({
31
+ id: z.string().describe('Snapshot ID'),
32
+ name: z.string().optional().describe('Snapshot name'),
33
+ tag: z.string().nullable().optional().describe('Snapshot tag'),
34
+ fullName: z.string().optional().describe('Full name with org slug'),
35
+ public: z.literal(true).describe('Public snapshot'),
36
+ org: SandboxSnapshotOrgInfoSchema.describe('Organization that owns the public snapshot'),
37
+ }),
38
+ z.object({
39
+ id: z.string().describe('Snapshot ID'),
40
+ name: z.string().optional().describe('Snapshot name'),
41
+ tag: z.string().nullable().optional().describe('Snapshot tag'),
42
+ fullName: z.string().optional().describe('Full name with org slug'),
43
+ public: z.literal(false).describe('Private snapshot'),
44
+ user: SandboxSnapshotUserInfoSchema.describe('User who created the private snapshot'),
45
+ }),
46
+ ]);
47
+
9
48
  const SandboxInfoSchema = z.object({
10
49
  sandboxId: z.string().describe('Sandbox ID'),
11
50
  name: z.string().optional().describe('Sandbox name'),
@@ -13,10 +52,8 @@ const SandboxInfoSchema = z.object({
13
52
  status: z.string().describe('Current status'),
14
53
  createdAt: z.string().describe('Creation timestamp'),
15
54
  region: z.string().optional().describe('Region where sandbox is running'),
16
- runtimeId: z.string().optional().describe('Runtime ID'),
17
- runtimeName: z.string().optional().describe('Runtime name'),
18
- snapshotId: z.string().optional().describe('Snapshot ID sandbox was created from'),
19
- snapshotTag: z.string().optional().describe('Snapshot tag sandbox was created from'),
55
+ runtime: SandboxRuntimeInfoSchema.optional().describe('Runtime information'),
56
+ snapshot: SandboxSnapshotInfoSchema.optional().describe('Snapshot information'),
20
57
  executions: z.number().describe('Number of executions'),
21
58
  });
22
59
 
@@ -100,7 +137,7 @@ export const listSubcommand = createCommand({
100
137
  return {
101
138
  ID: sandbox.sandboxId,
102
139
  Name: sandbox.name || '-',
103
- Runtime: sandbox.runtimeName || '-',
140
+ Runtime: sandbox.runtime?.name || '-',
104
141
  Status: sandbox.status,
105
142
  'Created At': sandbox.createdAt,
106
143
  Executions: sandbox.executions,
@@ -127,10 +164,8 @@ export const listSubcommand = createCommand({
127
164
  status: s.status,
128
165
  createdAt: s.createdAt,
129
166
  region: s.region,
130
- runtimeId: s.runtimeId,
131
- runtimeName: s.runtimeName,
132
- snapshotId: s.snapshotId,
133
- snapshotTag: s.snapshotTag,
167
+ runtime: s.runtime,
168
+ snapshot: s.snapshot,
134
169
  executions: s.executions,
135
170
  })),
136
171
  total: result.total,
@@ -15,11 +15,29 @@ const SnapshotFileSchema = z.object({
15
15
  mode: z.number(),
16
16
  });
17
17
 
18
+ const SandboxRuntimeInfoSchema = z.object({
19
+ id: z.string().describe('Runtime ID'),
20
+ name: z.string().describe('Runtime name'),
21
+ iconUrl: z.string().optional().describe('URL for runtime icon'),
22
+ brandColor: z.string().optional().describe('Brand color for the runtime'),
23
+ tags: z.array(z.string()).optional().describe('Runtime tags'),
24
+ });
25
+
26
+ const SandboxSnapshotInfoSchema = z.object({
27
+ id: z.string().describe('Snapshot ID'),
28
+ name: z.string().optional().describe('Snapshot name'),
29
+ tag: z.string().optional().describe('Snapshot tag'),
30
+ fullName: z.string().optional().describe('Full name with org slug'),
31
+ public: z.boolean().describe('Whether snapshot is public'),
32
+ });
33
+
18
34
  const SandboxInfoSchema = z.object({
19
35
  sandboxId: z.string().describe('Sandbox ID'),
20
36
  status: z.string().describe('Current status'),
21
37
  createdAt: z.string().describe('Creation timestamp'),
22
38
  executions: z.number().describe('Number of executions'),
39
+ runtime: SandboxRuntimeInfoSchema.optional().describe('Runtime information'),
40
+ snapshot: SandboxSnapshotInfoSchema.optional().describe('Snapshot information'),
23
41
  });
24
42
 
25
43
  const SnapshotGetResponseSchema = z.object({
@@ -10,7 +10,7 @@ import { getCommand } from '../../../command-prefix';
10
10
  export const storageCommand = createCommand({
11
11
  name: 'storage',
12
12
  aliases: ['s3'],
13
- description: 'Manage storage resources',
13
+ description: 'Manage S3 compatible managed storage resources',
14
14
  tags: ['slow', 'requires-auth', 'requires-deployment'],
15
15
  examples: [
16
16
  { command: getCommand('cloud storage list'), description: 'List all storage resources' },
@@ -7,7 +7,7 @@ import { getCommand } from '../../../command-prefix';
7
7
  export const streamCommand = createCommand({
8
8
  name: 'stream',
9
9
  aliases: ['streams'],
10
- description: 'Manage streams',
10
+ description: 'Manage durable streams',
11
11
  tags: ['slow', 'requires-auth'],
12
12
  examples: [
13
13
  { command: getCommand('cloud stream list'), description: 'List all streams' },
@@ -11,7 +11,8 @@ export const deleteNamespaceSubcommand = createCommand({
11
11
  description: 'Delete a vector namespace and all its vectors',
12
12
  tags: ['destructive', 'deletes-resource', 'slow', 'requires-auth'],
13
13
  idempotent: true,
14
- requires: { auth: true, project: true },
14
+ requires: { auth: true, region: true },
15
+ optional: { project: true },
15
16
  examples: [
16
17
  {
17
18
  command: getCommand('vector delete-namespace staging'),
@@ -18,7 +18,8 @@ export const deleteSubcommand = createCommand({
18
18
  aliases: ['del', 'rm'],
19
19
  description: 'Delete one or more vectors by key',
20
20
  tags: ['destructive', 'deletes-resource', 'slow', 'requires-auth'],
21
- requires: { auth: true, project: true },
21
+ requires: { auth: true, region: true },
22
+ optional: { project: true },
22
23
  idempotent: true,
23
24
  examples: [
24
25
  {
@@ -16,7 +16,8 @@ export const getSubcommand = createCommand({
16
16
  name: 'get',
17
17
  description: 'Get a specific vector entry by key',
18
18
  tags: ['read-only', 'fast', 'requires-auth'],
19
- requires: { auth: true, project: true },
19
+ requires: { auth: true, region: true },
20
+ optional: { project: true },
20
21
  idempotent: true,
21
22
  examples: [
22
23
  {
@@ -34,7 +34,7 @@ export const vectorCommand = createCommand({
34
34
  listNamespacesSubcommand,
35
35
  deleteNamespaceSubcommand,
36
36
  ],
37
- requires: { auth: true, project: true },
37
+ requires: { auth: true },
38
38
  });
39
39
 
40
40
  export default vectorCommand;
@@ -11,7 +11,8 @@ export const listNamespacesSubcommand = createCommand({
11
11
  aliases: ['namespaces', 'ns'],
12
12
  description: 'List all vector namespaces',
13
13
  tags: ['read-only', 'fast', 'requires-auth'],
14
- requires: { auth: true, project: true },
14
+ requires: { auth: true, region: true },
15
+ optional: { project: true },
15
16
  examples: [
16
17
  { command: getCommand('vector list-namespaces'), description: 'List all namespaces' },
17
18
  { command: getCommand('vector namespaces'), description: 'List namespaces (using alias)' },
@@ -22,7 +22,8 @@ export const searchSubcommand = createCommand({
22
22
  aliases: ['list', 'ls'],
23
23
  description: 'Search for vectors using semantic similarity',
24
24
  tags: ['read-only', 'slow', 'requires-auth'],
25
- requires: { auth: true, project: true },
25
+ requires: { auth: true, region: true },
26
+ optional: { project: true },
26
27
  idempotent: true,
27
28
  examples: [
28
29
  {
@@ -42,7 +42,8 @@ export const statsSubcommand = createCommand({
42
42
  name: 'stats',
43
43
  description: 'Get statistics for vector storage',
44
44
  tags: ['read-only', 'fast', 'requires-auth'],
45
- requires: { auth: true, project: true },
45
+ requires: { auth: true, region: true },
46
+ optional: { project: true },
46
47
  idempotent: true,
47
48
  examples: [
48
49
  { command: getCommand('vector stats'), description: 'Show stats for all namespaces' },
@@ -26,7 +26,8 @@ export const upsertSubcommand = createCommand({
26
26
  description: 'Add or update vectors in the vector storage',
27
27
  tags: ['mutating', 'updates-resource', 'slow', 'requires-auth'],
28
28
  idempotent: true,
29
- requires: { auth: true, project: true },
29
+ requires: { auth: true, region: true },
30
+ optional: { project: true },
30
31
  examples: [
31
32
  {
32
33
  command: getCommand('vector upsert products doc1 --document "Comfortable office chair"'),
@@ -1,30 +1,33 @@
1
- import { Logger, VectorStorageService } from '@agentuity/core';
1
+ import { type Logger, VectorStorageService } from '@agentuity/core';
2
2
  import { createServerFetchAdapter, getServiceUrls } from '@agentuity/server';
3
- import { loadProjectSDKKey } from '../../../config';
4
- import type { Config } from '../../../types';
3
+ import type { AuthData, GlobalOptions, ProjectConfig } from '../../../types';
5
4
  import * as tui from '../../../tui';
6
5
 
7
- export async function createStorageAdapter(ctx: {
6
+ export function createStorageAdapter(ctx: {
8
7
  logger: Logger;
9
- projectDir: string;
10
- config: Config | null;
11
- project: { region: string };
8
+ auth: AuthData;
9
+ region: string;
10
+ project?: ProjectConfig;
11
+ options: GlobalOptions;
12
12
  }) {
13
- const sdkKey = await loadProjectSDKKey(ctx.logger, ctx.projectDir);
14
- if (!sdkKey) {
15
- tui.fatal(`Couldn't find the AGENTUITY_SDK_KEY in ${ctx.projectDir} .env file`);
13
+ const orgId = ctx.project?.orgId ?? ctx.options.orgId;
14
+ if (!orgId) {
15
+ tui.fatal(
16
+ 'Organization ID is required. Either run from a project directory or use --org-id flag.'
17
+ );
16
18
  }
17
19
 
18
20
  const adapter = createServerFetchAdapter(
19
21
  {
20
22
  headers: {
21
- Authorization: `Bearer ${sdkKey}`,
23
+ Authorization: `Bearer ${ctx.auth.apiKey}`,
24
+ 'x-agentuity-orgid': orgId,
22
25
  },
23
26
  },
24
27
  ctx.logger
25
28
  );
26
29
 
27
- const urls = getServiceUrls(ctx.project.region);
30
+ const urls = getServiceUrls(ctx.region);
28
31
  const baseUrl = urls.catalyst;
29
32
  return new VectorStorageService(baseUrl, adapter);
30
33
  }
@@ -37,9 +37,14 @@ export const command = createCommand({
37
37
  message: 'Validating your identity',
38
38
  clearOnSuccess: true,
39
39
  callback: async () => {
40
- const newargs = process.argv.map((x) => (x === 'setup' ? 'login' : x));
40
+ // For compiled binaries, process.argv contains virtual paths (/$bunfs/root/...)
41
+ // Use process.execPath which has the actual binary path
42
+ const isCompiledBinary = process.argv[1]?.startsWith('/$bunfs/');
43
+ const cmd = isCompiledBinary
44
+ ? [process.execPath, ...process.argv.slice(2).map((x) => (x === 'setup' ? 'login' : x))]
45
+ : process.argv.map((x) => (x === 'setup' ? 'login' : x));
41
46
  const r = Bun.spawn({
42
- cmd: newargs.concat('--json'),
47
+ cmd: cmd.concat('--json'),
43
48
  stdout: 'pipe',
44
49
  stderr: 'inherit',
45
50
  });
package/src/config.ts CHANGED
@@ -733,10 +733,19 @@ export async function loadProjectSDKKey(
733
733
  logger.trace(`[SDK_KEY] AGENTUITY_SDK_KEY not found in any file`);
734
734
  }
735
735
 
736
- export function getCatalystAPIClient(logger: Logger, auth: AuthData, region: string) {
736
+ export function getCatalystAPIClient(
737
+ logger: Logger,
738
+ auth: AuthData,
739
+ region: string,
740
+ orgId?: string
741
+ ) {
737
742
  const serviceUrls = getServiceUrls(region);
738
743
  const catalystUrl = serviceUrls.catalyst;
739
- return new ServerAPIClient(catalystUrl, logger, auth.apiKey);
744
+ const headers: Record<string, string> = {};
745
+ if (orgId) {
746
+ headers['x-agentuity-orgid'] = orgId;
747
+ }
748
+ return new ServerAPIClient(catalystUrl, logger, auth.apiKey, { headers });
740
749
  }
741
750
 
742
751
  interface RegionsCacheData {
@@ -795,14 +804,20 @@ export async function getDefaultRegion(
795
804
  /**
796
805
  * Get a Catalyst API client for global database operations.
797
806
  * Uses the default region since the admin DB is global.
807
+ *
808
+ * @param logger - Logger instance
809
+ * @param auth - Authentication data
810
+ * @param profileName - Profile name (default: 'production')
811
+ * @param orgId - Optional organization ID for CLI key authentication
798
812
  */
799
813
  export async function getGlobalCatalystAPIClient(
800
814
  logger: Logger,
801
815
  auth: AuthData,
802
- profileName = 'production'
816
+ profileName = 'production',
817
+ orgId?: string
803
818
  ) {
804
819
  const region = await getDefaultRegion(profileName);
805
- return getCatalystAPIClient(logger, auth, region);
820
+ return getCatalystAPIClient(logger, auth, region, orgId);
806
821
  }
807
822
 
808
823
  export function getIONHost(config: Config | null, region: string) {
package/src/env-util.ts CHANGED
@@ -17,7 +17,7 @@ export const PUBLIC_VAR_PREFIXES = ['VITE_', 'AGENTUITY_PUBLIC_', 'PUBLIC_'] as
17
17
  * Specific AGENTUITY_ keys that are allowed to be set by users.
18
18
  * Note: There is also a whitelist in the API that must be kept in sync.
19
19
  */
20
- export const AGENTUITY_ALLOWED_KEYS = ['AGENTUITY_AUTH_SECRET'] as const;
20
+ export const AGENTUITY_ALLOWED_KEYS = ['AGENTUITY_AUTH_SECRET', 'AGENTUITY_CLOUD_BASE_URL'] as const;
21
21
 
22
22
  /**
23
23
  * Check if a key is a public variable (exposed to frontend)