@mastra/client-js 1.15.3-alpha.2 → 1.16.0-alpha.3
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/CHANGELOG.md +11 -0
- package/dist/client.d.ts +2 -1
- package/dist/client.d.ts.map +1 -1
- package/dist/docs/SKILL.md +1 -1
- package/dist/docs/assets/SOURCE_MAP.json +1 -1
- package/dist/index.cjs +52 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +52 -0
- package/dist/index.js.map +1 -1
- package/dist/resources/channels.d.ts +63 -0
- package/dist/resources/channels.d.ts.map +1 -0
- package/dist/resources/index.d.ts +1 -0
- package/dist/resources/index.d.ts.map +1 -1
- package/package.json +4 -4
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import type { ClientOptions } from '../types.js';
|
|
2
|
+
import { BaseResource } from './base.js';
|
|
3
|
+
export interface ChannelPlatformInfo {
|
|
4
|
+
id: string;
|
|
5
|
+
name: string;
|
|
6
|
+
isConfigured: boolean;
|
|
7
|
+
connectOptionsSchema?: Record<string, unknown>;
|
|
8
|
+
}
|
|
9
|
+
export interface ChannelInstallationInfo {
|
|
10
|
+
id: string;
|
|
11
|
+
platform: string;
|
|
12
|
+
agentId: string;
|
|
13
|
+
status: 'active' | 'pending';
|
|
14
|
+
displayName?: string;
|
|
15
|
+
installedAt?: string;
|
|
16
|
+
}
|
|
17
|
+
export interface ChannelConnectOAuth {
|
|
18
|
+
type: 'oauth';
|
|
19
|
+
authorizationUrl: string;
|
|
20
|
+
installationId: string;
|
|
21
|
+
}
|
|
22
|
+
export interface ChannelConnectDeepLink {
|
|
23
|
+
type: 'deep_link';
|
|
24
|
+
url: string;
|
|
25
|
+
installationId: string;
|
|
26
|
+
}
|
|
27
|
+
export interface ChannelConnectImmediate {
|
|
28
|
+
type: 'immediate';
|
|
29
|
+
installationId: string;
|
|
30
|
+
}
|
|
31
|
+
export type ChannelConnectResult = ChannelConnectOAuth | ChannelConnectDeepLink | ChannelConnectImmediate;
|
|
32
|
+
export declare class Channels extends BaseResource {
|
|
33
|
+
constructor(options: ClientOptions);
|
|
34
|
+
/**
|
|
35
|
+
* Lists all registered channel platforms and their configuration status.
|
|
36
|
+
* @returns Array of available platforms
|
|
37
|
+
*/
|
|
38
|
+
listPlatforms(): Promise<ChannelPlatformInfo[]>;
|
|
39
|
+
/**
|
|
40
|
+
* Lists installations for a given platform, optionally filtered by agent.
|
|
41
|
+
* @param platform - Platform identifier (e.g., "slack")
|
|
42
|
+
* @param agentId - Optional agent ID to filter by (client-side)
|
|
43
|
+
* @returns Array of installations
|
|
44
|
+
*/
|
|
45
|
+
listInstallations(platform: string, agentId?: string): Promise<ChannelInstallationInfo[]>;
|
|
46
|
+
/**
|
|
47
|
+
* Connects an agent to a channel platform.
|
|
48
|
+
* @param platform - Platform identifier (e.g., "slack")
|
|
49
|
+
* @param agentId - Agent to connect
|
|
50
|
+
* @param options - Platform-specific connection options
|
|
51
|
+
* @returns Discriminated connect result — check `type` for the authorization flow
|
|
52
|
+
*/
|
|
53
|
+
connect(platform: string, agentId: string, options?: Record<string, unknown>): Promise<ChannelConnectResult>;
|
|
54
|
+
/**
|
|
55
|
+
* Disconnects an agent from a channel platform.
|
|
56
|
+
* @param platform - Platform identifier (e.g., "slack")
|
|
57
|
+
* @param agentId - Agent to disconnect
|
|
58
|
+
*/
|
|
59
|
+
disconnect(platform: string, agentId: string): Promise<{
|
|
60
|
+
success: boolean;
|
|
61
|
+
}>;
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=channels.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"channels.d.ts","sourceRoot":"","sources":["../../src/resources/channels.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAE9C,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;A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G,OAAO,CAAC,oBAAoB,CAAC;IAO5G;;;;OAIG;IACH,UAAU,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,OAAO,EAAE,OAAO,CAAA;KAAE,CAAC;CAK7E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/resources/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,iBAAiB,CAAC;AAChC,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,aAAa,CAAC;AAC5B,cAAc,QAAQ,CAAC;AACvB,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,OAAO,CAAC;AACtB,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,sBAAsB,CAAC;AACrC,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/resources/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,iBAAiB,CAAC;AAChC,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,aAAa,CAAC;AAC5B,cAAc,QAAQ,CAAC;AACvB,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,OAAO,CAAC;AACtB,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,sBAAsB,CAAC;AACrC,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mastra/client-js",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.16.0-alpha.3",
|
|
4
4
|
"description": "The official TypeScript library for the Mastra Client API",
|
|
5
5
|
"author": "",
|
|
6
6
|
"type": "module",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"@ai-sdk/ui-utils": "^1.2.11",
|
|
38
38
|
"@lukeed/uuid": "^2.0.1",
|
|
39
39
|
"json-schema": "^0.4.0",
|
|
40
|
-
"@mastra/core": "1.31.0-alpha.
|
|
40
|
+
"@mastra/core": "1.31.0-alpha.3",
|
|
41
41
|
"@mastra/schema-compat": "1.2.9"
|
|
42
42
|
},
|
|
43
43
|
"peerDependencies": {
|
|
@@ -53,10 +53,10 @@
|
|
|
53
53
|
"typescript": "^6.0.3",
|
|
54
54
|
"vitest": "4.1.5",
|
|
55
55
|
"zod": "^4.3.6",
|
|
56
|
+
"@internal/ai-sdk-v4": "0.0.36",
|
|
56
57
|
"@internal/ai-sdk-v5": "0.0.36",
|
|
57
|
-
"@internal/types-builder": "0.0.64",
|
|
58
58
|
"@internal/lint": "0.0.89",
|
|
59
|
-
"@internal/
|
|
59
|
+
"@internal/types-builder": "0.0.64"
|
|
60
60
|
},
|
|
61
61
|
"engines": {
|
|
62
62
|
"node": ">=22.13.0"
|