@theaiplatform/miniapp-sdk 0.0.1 → 0.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 +45 -1
- package/THIRD_PARTY_NOTICES.md +3 -1
- package/config-schema.json +543 -30
- package/dist/config.d.ts +4 -1
- package/dist/index.d.ts +103 -2
- package/dist/index.js +1 -0
- package/dist/mcp.d.ts +27 -0
- package/dist/mcp.js +4 -0
- package/dist/rspack/css-entry-loader.cjs +1 -1
- package/dist/rspack/html-loader.cjs +1 -1
- package/dist/rspack/index.js +133 -5
- package/dist/sdk.d.ts +84 -1
- package/dist/surface.d.ts +1 -1
- package/dist/ui/styles.css +67 -0
- package/dist/ui/tailwind.css +1 -0
- package/dist/ui/wasm.d.ts +660 -0
- package/dist/ui/wasm.js +2714 -0
- package/dist/ui.d.ts +160 -0
- package/dist/ui.js +200 -7
- package/dist/web.d.ts +84 -1
- package/examples/wasm-ui/Cargo.lock +248 -0
- package/examples/wasm-ui/Cargo.toml +18 -0
- package/examples/wasm-ui/README.md +19 -0
- package/examples/wasm-ui/src/lib.rs +190 -0
- package/package.json +17 -2
- package/ui-components.json +6 -1
package/dist/config.d.ts
CHANGED
|
@@ -9,6 +9,9 @@ export declare type JsonSchema = {
|
|
|
9
9
|
readonly [key: string]: unknown;
|
|
10
10
|
};
|
|
11
11
|
|
|
12
|
+
/** Closed discovery taxonomy accepted by `presentation.categories`. */
|
|
13
|
+
export declare type MiniAppCategory = 'productivity' | 'developer-tools' | 'creativity' | 'communication' | 'data-and-analytics' | 'business' | 'education' | 'media-and-entertainment' | 'utilities' | 'other';
|
|
14
|
+
|
|
12
15
|
export declare type ToolDefinition<TArguments = unknown, TResult = unknown> = {
|
|
13
16
|
displayName?: string;
|
|
14
17
|
description: string;
|
|
@@ -28,7 +31,7 @@ export declare type UIEntrypoint = {
|
|
|
28
31
|
};
|
|
29
32
|
|
|
30
33
|
/**
|
|
31
|
-
* @capability
|
|
34
|
+
* @capability miniapp-platform
|
|
32
35
|
*/
|
|
33
36
|
export declare type UIEntrypointType = 'workspace-left-sidebar' | 'workspace-left-sidebar-item' | 'chat-right-sidebar' | 'chat-right-sidebar-item';
|
|
34
37
|
|
package/dist/index.d.ts
CHANGED
|
@@ -28,6 +28,9 @@ export declare type CreateProjectResult = {
|
|
|
28
28
|
|
|
29
29
|
export declare function defineApp<const TConfig extends AppConfig>(config: TConfig): TConfig;
|
|
30
30
|
|
|
31
|
+
/** Preserve the inferred tool signatures for a package-runtime MCP server. */
|
|
32
|
+
export declare function defineMcpServer<const TServer extends McpServerDefinition>(server: TServer): TServer;
|
|
33
|
+
|
|
31
34
|
export declare type GetChannelAccessOptions = {
|
|
32
35
|
workspaceId?: string;
|
|
33
36
|
channelId: string;
|
|
@@ -105,12 +108,27 @@ export declare type ListWorkflowsResult = {
|
|
|
105
108
|
workflows: MiniAppWorkflow[];
|
|
106
109
|
};
|
|
107
110
|
|
|
111
|
+
/** The tools exposed by one package-runtime MCP server. */
|
|
112
|
+
export declare type McpServerDefinition = {
|
|
113
|
+
tools: Record<string, McpServerToolDefinition>;
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
/** One tool implemented by a package-runtime MCP server. */
|
|
117
|
+
export declare type McpServerToolDefinition<TArguments extends MiniAppJsonValue = MiniAppJsonValue, TResult extends MiniAppJsonValue = MiniAppJsonValue> = {
|
|
118
|
+
description: string;
|
|
119
|
+
inputSchema: JsonSchema;
|
|
120
|
+
execute(arguments_: TArguments): MiniAppMaybePromise<TResult>;
|
|
121
|
+
};
|
|
122
|
+
|
|
108
123
|
export declare type MiniAppAuthApi = {
|
|
109
124
|
getUserProfile(): MiniAppMaybePromise<MiniAppUserProfile | null>;
|
|
110
125
|
};
|
|
111
126
|
|
|
127
|
+
/** Closed discovery taxonomy accepted by `presentation.categories`. */
|
|
128
|
+
export declare type MiniAppCategory = 'productivity' | 'developer-tools' | 'creativity' | 'communication' | 'data-and-analytics' | 'business' | 'education' | 'media-and-entertainment' | 'utilities' | 'other';
|
|
129
|
+
|
|
112
130
|
/**
|
|
113
|
-
* @capability
|
|
131
|
+
* @capability miniapp-platform
|
|
114
132
|
*/
|
|
115
133
|
export declare type MiniAppChannel = {
|
|
116
134
|
roomId: string;
|
|
@@ -154,6 +172,85 @@ export declare type MiniAppCreateSpecialistResult = {
|
|
|
154
172
|
isActive: boolean;
|
|
155
173
|
};
|
|
156
174
|
|
|
175
|
+
/** Metadata-only access to host-managed credentials in the active workspace. */
|
|
176
|
+
export declare type MiniAppCredentialsApi = {
|
|
177
|
+
listHttp(): MiniAppMaybePromise<MiniAppHttpCredentialMetadata[]>;
|
|
178
|
+
};
|
|
179
|
+
|
|
180
|
+
/** Host-mediated bounded HTTP(S); browser fetch is not the authority. */
|
|
181
|
+
export declare type MiniAppHttpApi = {
|
|
182
|
+
request(input: MiniAppHttpRequestInput, options?: MiniAppHttpRequestOptions): MiniAppMaybePromise<MiniAppHttpResponse>;
|
|
183
|
+
};
|
|
184
|
+
|
|
185
|
+
/** Metadata-only stored HTTP credential. Secret fields never cross IPC. */
|
|
186
|
+
export declare type MiniAppHttpCredentialMetadata = {
|
|
187
|
+
id: string;
|
|
188
|
+
credentialType: MiniAppHttpCredentialType;
|
|
189
|
+
displayName: string;
|
|
190
|
+
metadataFields: Record<string, string>;
|
|
191
|
+
};
|
|
192
|
+
|
|
193
|
+
export declare type MiniAppHttpCredentialType = 'http_bearer' | 'http_basic' | 'http_header_auth' | 'http_api_key';
|
|
194
|
+
|
|
195
|
+
export declare type MiniAppHttpHeader = {
|
|
196
|
+
name: string;
|
|
197
|
+
value: string;
|
|
198
|
+
};
|
|
199
|
+
|
|
200
|
+
export declare type MiniAppHttpHeaderInput = {
|
|
201
|
+
name: string;
|
|
202
|
+
value: string;
|
|
203
|
+
/** Defaults to true when omitted. */
|
|
204
|
+
enabled?: boolean;
|
|
205
|
+
};
|
|
206
|
+
|
|
207
|
+
export declare type MiniAppHttpQueryInput = {
|
|
208
|
+
name: string;
|
|
209
|
+
value: string;
|
|
210
|
+
/** Defaults to true when omitted. */
|
|
211
|
+
enabled?: boolean;
|
|
212
|
+
};
|
|
213
|
+
|
|
214
|
+
export declare type MiniAppHttpRequestInput = {
|
|
215
|
+
method: string;
|
|
216
|
+
url: string;
|
|
217
|
+
query?: MiniAppHttpQueryInput[];
|
|
218
|
+
headers?: MiniAppHttpHeaderInput[];
|
|
219
|
+
body?: string | null;
|
|
220
|
+
/** Defaults to 30 seconds and is capped by the host at 120 seconds. */
|
|
221
|
+
timeoutMs?: number | null;
|
|
222
|
+
/** Defaults to 5 MiB and is capped by the host at 10 MiB. */
|
|
223
|
+
responseBodyLimitBytes?: number | null;
|
|
224
|
+
/**
|
|
225
|
+
* Defaults to false. The host follows at most ten same-origin redirects;
|
|
226
|
+
* cross-origin redirects require a separate request and grant.
|
|
227
|
+
*/
|
|
228
|
+
followRedirects?: boolean | null;
|
|
229
|
+
};
|
|
230
|
+
|
|
231
|
+
export declare type MiniAppHttpRequestOptions = {
|
|
232
|
+
/**
|
|
233
|
+
* Opaque host-managed credential reference. Secret material never enters
|
|
234
|
+
* miniapp JavaScript.
|
|
235
|
+
*/
|
|
236
|
+
credentialRef?: string;
|
|
237
|
+
};
|
|
238
|
+
|
|
239
|
+
export declare type MiniAppHttpResponse = {
|
|
240
|
+
finalUrl: string;
|
|
241
|
+
status: number;
|
|
242
|
+
statusText: string;
|
|
243
|
+
/** Ordered entries; duplicate response header names remain separate. */
|
|
244
|
+
headers: MiniAppHttpHeader[];
|
|
245
|
+
bodyText: string | null;
|
|
246
|
+
bodyBase64: string | null;
|
|
247
|
+
bodyKind: 'text' | 'binary';
|
|
248
|
+
bodyTruncated: boolean;
|
|
249
|
+
sizeBytes: number;
|
|
250
|
+
elapsedMs: number;
|
|
251
|
+
contentType: string | null;
|
|
252
|
+
};
|
|
253
|
+
|
|
157
254
|
/** JSON-compatible values accepted by public miniapp operations. */
|
|
158
255
|
export declare type MiniAppJsonValue = null | boolean | number | string | MiniAppJsonValue[] | {
|
|
159
256
|
[key: string]: MiniAppJsonValue;
|
|
@@ -247,6 +344,10 @@ export declare type MiniAppPlatformApi = {
|
|
|
247
344
|
chat: MiniAppChatApi;
|
|
248
345
|
storage: MiniAppStorageApi;
|
|
249
346
|
presence: MiniAppPresenceApi;
|
|
347
|
+
/** Desktop host capability; feature-detect before use on portable targets. */
|
|
348
|
+
http?: MiniAppHttpApi;
|
|
349
|
+
/** Desktop host capability; feature-detect before use on portable targets. */
|
|
350
|
+
credentials?: MiniAppCredentialsApi;
|
|
250
351
|
/** Browser capabilities appear only when the selected target supports them. */
|
|
251
352
|
auth?: MiniAppAuthApi;
|
|
252
353
|
vfs?: MiniAppVfsApi;
|
|
@@ -529,7 +630,7 @@ export declare type UIEntrypoint = {
|
|
|
529
630
|
};
|
|
530
631
|
|
|
531
632
|
/**
|
|
532
|
-
* @capability
|
|
633
|
+
* @capability miniapp-platform
|
|
533
634
|
*/
|
|
534
635
|
export declare type UIEntrypointType = 'workspace-left-sidebar' | 'workspace-left-sidebar-item' | 'chat-right-sidebar' | 'chat-right-sidebar-item';
|
|
535
636
|
|
package/dist/index.js
CHANGED
package/dist/mcp.d.ts
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/** Preserve the inferred tool signatures for a package-runtime MCP server. */
|
|
2
|
+
export declare function defineMcpServer<const TServer extends McpServerDefinition>(server: TServer): TServer;
|
|
3
|
+
|
|
4
|
+
declare type JsonSchema = {
|
|
5
|
+
readonly [key: string]: unknown;
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
/** The tools exposed by one package-runtime MCP server. */
|
|
9
|
+
export declare type McpServerDefinition = {
|
|
10
|
+
tools: Record<string, McpServerToolDefinition>;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
/** One tool implemented by a package-runtime MCP server. */
|
|
14
|
+
export declare type McpServerToolDefinition<TArguments extends MiniAppJsonValue = MiniAppJsonValue, TResult extends MiniAppJsonValue = MiniAppJsonValue> = {
|
|
15
|
+
description: string;
|
|
16
|
+
inputSchema: JsonSchema;
|
|
17
|
+
execute(arguments_: TArguments): MiniAppMaybePromise<TResult>;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
/** JSON-compatible values accepted by public miniapp operations. */
|
|
21
|
+
declare type MiniAppJsonValue = null | boolean | number | string | MiniAppJsonValue[] | {
|
|
22
|
+
[key: string]: MiniAppJsonValue;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
declare type MiniAppMaybePromise<T> = T | Promise<T>;
|
|
26
|
+
|
|
27
|
+
export { }
|
package/dist/mcp.js
ADDED