@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.
- package/dist/cmd/auth/index.d.ts.map +1 -1
- package/dist/cmd/auth/index.js +2 -0
- package/dist/cmd/auth/index.js.map +1 -1
- package/dist/cmd/auth/machine/index.d.ts +2 -0
- package/dist/cmd/auth/machine/index.d.ts.map +1 -0
- package/dist/cmd/auth/machine/index.js +16 -0
- package/dist/cmd/auth/machine/index.js.map +1 -0
- package/dist/cmd/auth/machine/setup.d.ts +2 -0
- package/dist/cmd/auth/machine/setup.d.ts.map +1 -0
- package/dist/cmd/auth/machine/setup.js +87 -0
- package/dist/cmd/auth/machine/setup.js.map +1 -0
- package/dist/cmd/cloud/db/index.js +1 -1
- package/dist/cmd/cloud/db/index.js.map +1 -1
- package/dist/cmd/cloud/index.d.ts.map +1 -1
- package/dist/cmd/cloud/index.js +2 -0
- package/dist/cmd/cloud/index.js.map +1 -1
- package/dist/cmd/cloud/keyvalue/create-namespace.d.ts.map +1 -1
- package/dist/cmd/cloud/keyvalue/create-namespace.js +2 -1
- package/dist/cmd/cloud/keyvalue/create-namespace.js.map +1 -1
- package/dist/cmd/cloud/keyvalue/delete-namespace.d.ts.map +1 -1
- package/dist/cmd/cloud/keyvalue/delete-namespace.js +2 -1
- package/dist/cmd/cloud/keyvalue/delete-namespace.js.map +1 -1
- package/dist/cmd/cloud/keyvalue/delete.d.ts.map +1 -1
- package/dist/cmd/cloud/keyvalue/delete.js +2 -1
- package/dist/cmd/cloud/keyvalue/delete.js.map +1 -1
- package/dist/cmd/cloud/keyvalue/get.d.ts.map +1 -1
- package/dist/cmd/cloud/keyvalue/get.js +2 -1
- package/dist/cmd/cloud/keyvalue/get.js.map +1 -1
- package/dist/cmd/cloud/keyvalue/keys.d.ts.map +1 -1
- package/dist/cmd/cloud/keyvalue/keys.js +2 -1
- package/dist/cmd/cloud/keyvalue/keys.js.map +1 -1
- package/dist/cmd/cloud/keyvalue/list-namespaces.d.ts.map +1 -1
- package/dist/cmd/cloud/keyvalue/list-namespaces.js +2 -1
- package/dist/cmd/cloud/keyvalue/list-namespaces.js.map +1 -1
- package/dist/cmd/cloud/keyvalue/repl.js +1 -1
- package/dist/cmd/cloud/keyvalue/repl.js.map +1 -1
- package/dist/cmd/cloud/keyvalue/search.d.ts.map +1 -1
- package/dist/cmd/cloud/keyvalue/search.js +2 -1
- package/dist/cmd/cloud/keyvalue/search.js.map +1 -1
- package/dist/cmd/cloud/keyvalue/set.d.ts.map +1 -1
- package/dist/cmd/cloud/keyvalue/set.js +2 -1
- package/dist/cmd/cloud/keyvalue/set.js.map +1 -1
- package/dist/cmd/cloud/keyvalue/stats.d.ts.map +1 -1
- package/dist/cmd/cloud/keyvalue/stats.js +2 -1
- package/dist/cmd/cloud/keyvalue/stats.js.map +1 -1
- package/dist/cmd/cloud/keyvalue/util.d.ts +5 -6
- package/dist/cmd/cloud/keyvalue/util.d.ts.map +1 -1
- package/dist/cmd/cloud/keyvalue/util.js +8 -4
- package/dist/cmd/cloud/keyvalue/util.js.map +1 -1
- package/dist/cmd/cloud/machine/delete.d.ts +2 -0
- package/dist/cmd/cloud/machine/delete.d.ts.map +1 -0
- package/dist/cmd/cloud/machine/delete.js +84 -0
- package/dist/cmd/cloud/machine/delete.js.map +1 -0
- package/dist/cmd/cloud/machine/deployments.d.ts +2 -0
- package/dist/cmd/cloud/machine/deployments.d.ts.map +1 -0
- package/dist/cmd/cloud/machine/deployments.js +86 -0
- package/dist/cmd/cloud/machine/deployments.js.map +1 -0
- package/dist/cmd/cloud/machine/get.d.ts +2 -0
- package/dist/cmd/cloud/machine/get.d.ts.map +1 -0
- package/dist/cmd/cloud/machine/get.js +104 -0
- package/dist/cmd/cloud/machine/get.js.map +1 -0
- package/dist/cmd/cloud/machine/index.d.ts +2 -0
- package/dist/cmd/cloud/machine/index.d.ts.map +1 -0
- package/dist/cmd/cloud/machine/index.js +22 -0
- package/dist/cmd/cloud/machine/index.js.map +1 -0
- package/dist/cmd/cloud/machine/list.d.ts +2 -0
- package/dist/cmd/cloud/machine/list.d.ts.map +1 -0
- package/dist/cmd/cloud/machine/list.js +73 -0
- package/dist/cmd/cloud/machine/list.js.map +1 -0
- package/dist/cmd/cloud/queue/index.js +1 -1
- package/dist/cmd/cloud/queue/index.js.map +1 -1
- package/dist/cmd/cloud/redis/index.js +1 -1
- package/dist/cmd/cloud/redis/index.js.map +1 -1
- package/dist/cmd/cloud/sandbox/get.d.ts.map +1 -1
- package/dist/cmd/cloud/sandbox/get.js +25 -18
- package/dist/cmd/cloud/sandbox/get.js.map +1 -1
- package/dist/cmd/cloud/sandbox/index.js +1 -1
- package/dist/cmd/cloud/sandbox/index.js.map +1 -1
- package/dist/cmd/cloud/sandbox/list.d.ts.map +1 -1
- package/dist/cmd/cloud/sandbox/list.js +40 -9
- package/dist/cmd/cloud/sandbox/list.js.map +1 -1
- package/dist/cmd/cloud/sandbox/snapshot/get.d.ts.map +1 -1
- package/dist/cmd/cloud/sandbox/snapshot/get.js +16 -0
- package/dist/cmd/cloud/sandbox/snapshot/get.js.map +1 -1
- package/dist/cmd/cloud/storage/index.js +1 -1
- package/dist/cmd/cloud/storage/index.js.map +1 -1
- package/dist/cmd/cloud/stream/index.js +1 -1
- package/dist/cmd/cloud/stream/index.js.map +1 -1
- package/dist/cmd/cloud/vector/delete-namespace.d.ts.map +1 -1
- package/dist/cmd/cloud/vector/delete-namespace.js +2 -1
- package/dist/cmd/cloud/vector/delete-namespace.js.map +1 -1
- package/dist/cmd/cloud/vector/delete.d.ts.map +1 -1
- package/dist/cmd/cloud/vector/delete.js +2 -1
- package/dist/cmd/cloud/vector/delete.js.map +1 -1
- package/dist/cmd/cloud/vector/get.d.ts.map +1 -1
- package/dist/cmd/cloud/vector/get.js +2 -1
- package/dist/cmd/cloud/vector/get.js.map +1 -1
- package/dist/cmd/cloud/vector/index.js +1 -1
- package/dist/cmd/cloud/vector/index.js.map +1 -1
- package/dist/cmd/cloud/vector/list-namespaces.d.ts.map +1 -1
- package/dist/cmd/cloud/vector/list-namespaces.js +2 -1
- package/dist/cmd/cloud/vector/list-namespaces.js.map +1 -1
- package/dist/cmd/cloud/vector/search.d.ts.map +1 -1
- package/dist/cmd/cloud/vector/search.js +2 -1
- package/dist/cmd/cloud/vector/search.js.map +1 -1
- package/dist/cmd/cloud/vector/stats.d.ts.map +1 -1
- package/dist/cmd/cloud/vector/stats.js +2 -1
- package/dist/cmd/cloud/vector/stats.js.map +1 -1
- package/dist/cmd/cloud/vector/upsert.d.ts.map +1 -1
- package/dist/cmd/cloud/vector/upsert.js +2 -1
- package/dist/cmd/cloud/vector/upsert.js.map +1 -1
- package/dist/cmd/cloud/vector/util.d.ts +7 -8
- package/dist/cmd/cloud/vector/util.d.ts.map +1 -1
- package/dist/cmd/cloud/vector/util.js +7 -7
- package/dist/cmd/cloud/vector/util.js.map +1 -1
- package/dist/cmd/setup/index.d.ts.map +1 -1
- package/dist/cmd/setup/index.js +7 -2
- package/dist/cmd/setup/index.js.map +1 -1
- package/dist/config.d.ts +7 -2
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +13 -4
- package/dist/config.js.map +1 -1
- package/dist/env-util.d.ts +1 -1
- package/dist/env-util.d.ts.map +1 -1
- package/dist/env-util.js +1 -1
- package/dist/env-util.js.map +1 -1
- package/package.json +6 -6
- package/src/cmd/auth/index.ts +2 -0
- package/src/cmd/auth/machine/index.ts +16 -0
- package/src/cmd/auth/machine/setup.ts +104 -0
- package/src/cmd/cloud/db/index.ts +1 -1
- package/src/cmd/cloud/index.ts +2 -0
- package/src/cmd/cloud/keyvalue/create-namespace.ts +2 -1
- package/src/cmd/cloud/keyvalue/delete-namespace.ts +2 -1
- package/src/cmd/cloud/keyvalue/delete.ts +2 -1
- package/src/cmd/cloud/keyvalue/get.ts +2 -1
- package/src/cmd/cloud/keyvalue/keys.ts +2 -1
- package/src/cmd/cloud/keyvalue/list-namespaces.ts +2 -1
- package/src/cmd/cloud/keyvalue/repl.ts +1 -1
- package/src/cmd/cloud/keyvalue/search.ts +2 -1
- package/src/cmd/cloud/keyvalue/set.ts +2 -1
- package/src/cmd/cloud/keyvalue/stats.ts +2 -1
- package/src/cmd/cloud/keyvalue/util.ts +15 -7
- package/src/cmd/cloud/machine/delete.ts +91 -0
- package/src/cmd/cloud/machine/deployments.ts +94 -0
- package/src/cmd/cloud/machine/get.ts +110 -0
- package/src/cmd/cloud/machine/index.ts +22 -0
- package/src/cmd/cloud/machine/list.ts +80 -0
- package/src/cmd/cloud/queue/index.ts +1 -1
- package/src/cmd/cloud/redis/index.ts +1 -1
- package/src/cmd/cloud/sandbox/get.ts +28 -19
- package/src/cmd/cloud/sandbox/index.ts +1 -1
- package/src/cmd/cloud/sandbox/list.ts +44 -9
- package/src/cmd/cloud/sandbox/snapshot/get.ts +18 -0
- package/src/cmd/cloud/storage/index.ts +1 -1
- package/src/cmd/cloud/stream/index.ts +1 -1
- package/src/cmd/cloud/vector/delete-namespace.ts +2 -1
- package/src/cmd/cloud/vector/delete.ts +2 -1
- package/src/cmd/cloud/vector/get.ts +2 -1
- package/src/cmd/cloud/vector/index.ts +1 -1
- package/src/cmd/cloud/vector/list-namespaces.ts +2 -1
- package/src/cmd/cloud/vector/search.ts +2 -1
- package/src/cmd/cloud/vector/stats.ts +2 -1
- package/src/cmd/cloud/vector/upsert.ts +2 -1
- package/src/cmd/cloud/vector/util.ts +15 -12
- package/src/cmd/setup/index.ts +7 -2
- package/src/config.ts +19 -4
- 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
|
-
|
|
17
|
-
|
|
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.
|
|
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
|
-
|
|
131
|
-
|
|
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,
|
|
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,
|
|
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,
|
|
19
|
+
requires: { auth: true, region: true },
|
|
20
|
+
optional: { project: true },
|
|
20
21
|
idempotent: true,
|
|
21
22
|
examples: [
|
|
22
23
|
{
|
|
@@ -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,
|
|
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,
|
|
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,
|
|
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,
|
|
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 {
|
|
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
|
|
6
|
+
export function createStorageAdapter(ctx: {
|
|
8
7
|
logger: Logger;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
project
|
|
8
|
+
auth: AuthData;
|
|
9
|
+
region: string;
|
|
10
|
+
project?: ProjectConfig;
|
|
11
|
+
options: GlobalOptions;
|
|
12
12
|
}) {
|
|
13
|
-
const
|
|
14
|
-
if (!
|
|
15
|
-
tui.fatal(
|
|
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 ${
|
|
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.
|
|
30
|
+
const urls = getServiceUrls(ctx.region);
|
|
28
31
|
const baseUrl = urls.catalyst;
|
|
29
32
|
return new VectorStorageService(baseUrl, adapter);
|
|
30
33
|
}
|
package/src/cmd/setup/index.ts
CHANGED
|
@@ -37,9 +37,14 @@ export const command = createCommand({
|
|
|
37
37
|
message: 'Validating your identity',
|
|
38
38
|
clearOnSuccess: true,
|
|
39
39
|
callback: async () => {
|
|
40
|
-
|
|
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:
|
|
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(
|
|
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
|
-
|
|
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)
|