@agent-foundry/studio 1.0.0 → 1.0.2
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/README.md +180 -47
- package/dist/bff/client.d.ts +168 -0
- package/dist/bff/client.d.ts.map +1 -0
- package/dist/bff/client.js +288 -0
- package/dist/bff/client.js.map +1 -0
- package/dist/bff/index.d.ts +27 -0
- package/dist/bff/index.d.ts.map +1 -0
- package/dist/bff/index.js +26 -0
- package/dist/bff/index.js.map +1 -0
- package/dist/bff/types.d.ts +168 -0
- package/dist/bff/types.d.ts.map +1 -0
- package/dist/bff/types.js +8 -0
- package/dist/bff/types.js.map +1 -0
- package/dist/db/deployments.d.ts +67 -1
- package/dist/db/deployments.d.ts.map +1 -1
- package/dist/db/deployments.js +92 -1
- package/dist/db/deployments.js.map +1 -1
- package/dist/db/index.d.ts +17 -0
- package/dist/db/index.d.ts.map +1 -1
- package/dist/db/index.js +17 -0
- package/dist/db/index.js.map +1 -1
- package/dist/db/projects.d.ts +54 -1
- package/dist/db/projects.d.ts.map +1 -1
- package/dist/db/projects.js +79 -1
- package/dist/db/projects.js.map +1 -1
- package/dist/index.d.ts +14 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +16 -2
- package/dist/index.js.map +1 -1
- package/dist/types/deployment.d.ts +56 -0
- package/dist/types/deployment.d.ts.map +1 -1
- package/dist/types/project.d.ts +6 -0
- package/dist/types/project.d.ts.map +1 -1
- package/package.json +14 -4
- package/src/bff/client.ts +412 -0
- package/src/bff/index.ts +32 -0
- package/src/bff/types.ts +212 -0
- package/src/db/deployments.ts +99 -1
- package/src/db/index.ts +17 -0
- package/src/db/projects.ts +86 -1
- package/src/db/schema.sql +35 -52
- package/src/index.ts +18 -2
- package/src/types/deployment.ts +75 -0
- package/src/types/project.ts +7 -0
package/src/index.ts
CHANGED
|
@@ -2,7 +2,18 @@
|
|
|
2
2
|
* @agent-foundry/studio
|
|
3
3
|
*
|
|
4
4
|
* Full SDK for Agent Foundry Build Studio.
|
|
5
|
-
* Provides types, Alibaba Cloud OSS upload utilities, and Supabase database client.
|
|
5
|
+
* Provides types, Alibaba Cloud OSS upload utilities, BFF API client, and Supabase database client.
|
|
6
|
+
*
|
|
7
|
+
* ## Recommended Usage Pattern (Hybrid Approach)
|
|
8
|
+
*
|
|
9
|
+
* - **Write operations**: Use BFF client (`@agent-foundry/studio/bff`)
|
|
10
|
+
* - **Read operations**: Use Supabase client (`@agent-foundry/studio/db`)
|
|
11
|
+
* - **File uploads**: Use DirectUploader (`@agent-foundry/studio/oss`)
|
|
12
|
+
*
|
|
13
|
+
* This pattern ensures:
|
|
14
|
+
* - Security: Write operations go through BFF with service_role (bypasses RLS)
|
|
15
|
+
* - Performance: Read operations use direct Supabase connection
|
|
16
|
+
* - Consistency: All writes are validated server-side
|
|
6
17
|
*/
|
|
7
18
|
|
|
8
19
|
// Re-export all types
|
|
@@ -11,7 +22,12 @@ export * from './types';
|
|
|
11
22
|
// Re-export OSS utilities
|
|
12
23
|
export * from './oss';
|
|
13
24
|
|
|
14
|
-
// Re-export
|
|
25
|
+
// Re-export BFF API client (recommended for write operations)
|
|
26
|
+
// Note: Use '@agent-foundry/studio/bff' for full BFF types
|
|
27
|
+
export { createBFFClient, BFFAPIError } from './bff';
|
|
28
|
+
export type { BFFClient, BFFClientConfig } from './bff';
|
|
29
|
+
|
|
30
|
+
// Re-export database client (recommended for read operations only)
|
|
15
31
|
export * from './db';
|
|
16
32
|
|
|
17
33
|
// Re-export utilities
|
package/src/types/deployment.ts
CHANGED
|
@@ -68,6 +68,12 @@ export interface Deployment {
|
|
|
68
68
|
/** Public access URL for the deployed app */
|
|
69
69
|
ossUrl?: string;
|
|
70
70
|
|
|
71
|
+
/**
|
|
72
|
+
* Artifact ID created when publishing to Feed.
|
|
73
|
+
* Set when user publishes deployment to AF ecosystem.
|
|
74
|
+
*/
|
|
75
|
+
artifactId?: string;
|
|
76
|
+
|
|
71
77
|
/** Total bundle size in bytes */
|
|
72
78
|
bundleSizeBytes?: number;
|
|
73
79
|
|
|
@@ -104,6 +110,7 @@ export interface UpdateDeploymentInput {
|
|
|
104
110
|
ossBucket?: string;
|
|
105
111
|
ossKey?: string;
|
|
106
112
|
ossUrl?: string;
|
|
113
|
+
artifactId?: string;
|
|
107
114
|
bundleSizeBytes?: number;
|
|
108
115
|
buildLog?: string;
|
|
109
116
|
errorMessage?: string;
|
|
@@ -145,3 +152,71 @@ export interface DeploymentProgress {
|
|
|
145
152
|
message?: string;
|
|
146
153
|
timestamp: string;
|
|
147
154
|
}
|
|
155
|
+
|
|
156
|
+
// =============================================================================
|
|
157
|
+
// Publish to Feed Types
|
|
158
|
+
// =============================================================================
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* App manifest for publishing to Feed
|
|
162
|
+
*/
|
|
163
|
+
export interface AppManifest {
|
|
164
|
+
/** App name */
|
|
165
|
+
name: string;
|
|
166
|
+
|
|
167
|
+
/** App version */
|
|
168
|
+
version: string;
|
|
169
|
+
|
|
170
|
+
/** Entry point path (default: "/index.html") */
|
|
171
|
+
entry?: string;
|
|
172
|
+
|
|
173
|
+
/** Minimum shell version required */
|
|
174
|
+
minShellVersion?: string;
|
|
175
|
+
|
|
176
|
+
/** App capabilities */
|
|
177
|
+
capabilities?: {
|
|
178
|
+
bridge?: string[];
|
|
179
|
+
network?: string[];
|
|
180
|
+
storage?: string[];
|
|
181
|
+
};
|
|
182
|
+
|
|
183
|
+
/** App permissions */
|
|
184
|
+
permissions?: Array<{
|
|
185
|
+
name: string;
|
|
186
|
+
reason: string;
|
|
187
|
+
}>;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
/**
|
|
191
|
+
* Input for publishing a project to Feed
|
|
192
|
+
*/
|
|
193
|
+
export interface PublishInput {
|
|
194
|
+
/** Specific deployment ID to publish (defaults to latest) */
|
|
195
|
+
deploymentId?: string;
|
|
196
|
+
|
|
197
|
+
/** App manifest override */
|
|
198
|
+
manifest?: AppManifest;
|
|
199
|
+
|
|
200
|
+
/** App status in registry */
|
|
201
|
+
status?: 'canary' | 'stable';
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
/**
|
|
205
|
+
* Result of publishing to Feed
|
|
206
|
+
*/
|
|
207
|
+
export interface PublishResult {
|
|
208
|
+
/** Registered app ID */
|
|
209
|
+
appId: string;
|
|
210
|
+
|
|
211
|
+
/** Created artifact ID */
|
|
212
|
+
artifactId: string;
|
|
213
|
+
|
|
214
|
+
/** Deployment that was published */
|
|
215
|
+
deploymentId: string;
|
|
216
|
+
|
|
217
|
+
/** Share URL for the app */
|
|
218
|
+
shareUrl: string;
|
|
219
|
+
|
|
220
|
+
/** Direct entry URL (OSS) */
|
|
221
|
+
entryUrl: string;
|
|
222
|
+
}
|
package/src/types/project.ts
CHANGED
|
@@ -49,6 +49,13 @@ export interface StudioProject {
|
|
|
49
49
|
/** Optional project description */
|
|
50
50
|
description?: string;
|
|
51
51
|
|
|
52
|
+
/**
|
|
53
|
+
* Registered app ID after publishing to Feed.
|
|
54
|
+
* Format: com.agentfoundry.studio.{user_prefix}.{slug}
|
|
55
|
+
* Set after first successful publish.
|
|
56
|
+
*/
|
|
57
|
+
appId?: string;
|
|
58
|
+
|
|
52
59
|
/** Local filesystem path to project root */
|
|
53
60
|
rootPath: string;
|
|
54
61
|
|