@slates/client 1.0.0-rc.11 → 1.0.0-rc.12
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/index.d.cts +10 -0
- package/dist/index.d.ts +10 -0
- package/package.json +4 -4
- package/src/client.test.ts +55 -2
package/dist/index.d.cts
CHANGED
|
@@ -54,6 +54,11 @@ declare class SlatesProtocolClient {
|
|
|
54
54
|
name: string;
|
|
55
55
|
inputSchema: Record<string, any>;
|
|
56
56
|
outputSchema: Record<string, any>;
|
|
57
|
+
docs: {
|
|
58
|
+
name: string;
|
|
59
|
+
url: string;
|
|
60
|
+
type?: "docs.action.general" | undefined;
|
|
61
|
+
}[];
|
|
57
62
|
type: "action.tool";
|
|
58
63
|
capabilities: Record<string, never>;
|
|
59
64
|
description?: string | undefined;
|
|
@@ -75,6 +80,11 @@ declare class SlatesProtocolClient {
|
|
|
75
80
|
name: string;
|
|
76
81
|
inputSchema: Record<string, any>;
|
|
77
82
|
outputSchema: Record<string, any>;
|
|
83
|
+
docs: {
|
|
84
|
+
name: string;
|
|
85
|
+
url: string;
|
|
86
|
+
type?: "docs.action.general" | undefined;
|
|
87
|
+
}[];
|
|
78
88
|
type: "action.trigger";
|
|
79
89
|
capabilities: Record<string, never>;
|
|
80
90
|
invocation: {
|
package/dist/index.d.ts
CHANGED
|
@@ -54,6 +54,11 @@ declare class SlatesProtocolClient {
|
|
|
54
54
|
name: string;
|
|
55
55
|
inputSchema: Record<string, any>;
|
|
56
56
|
outputSchema: Record<string, any>;
|
|
57
|
+
docs: {
|
|
58
|
+
name: string;
|
|
59
|
+
url: string;
|
|
60
|
+
type?: "docs.action.general" | undefined;
|
|
61
|
+
}[];
|
|
57
62
|
type: "action.tool";
|
|
58
63
|
capabilities: Record<string, never>;
|
|
59
64
|
description?: string | undefined;
|
|
@@ -75,6 +80,11 @@ declare class SlatesProtocolClient {
|
|
|
75
80
|
name: string;
|
|
76
81
|
inputSchema: Record<string, any>;
|
|
77
82
|
outputSchema: Record<string, any>;
|
|
83
|
+
docs: {
|
|
84
|
+
name: string;
|
|
85
|
+
url: string;
|
|
86
|
+
type?: "docs.action.general" | undefined;
|
|
87
|
+
}[];
|
|
78
88
|
type: "action.trigger";
|
|
79
89
|
capabilities: Record<string, never>;
|
|
80
90
|
invocation: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@slates/client",
|
|
3
|
-
"version": "1.0.0-rc.
|
|
3
|
+
"version": "1.0.0-rc.12",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -31,9 +31,9 @@
|
|
|
31
31
|
"biome:check": "biome check --write src"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@slates/proto": "1.0.0-rc.
|
|
35
|
-
"@slates/provider": "1.0.0-rc.
|
|
36
|
-
"@slates/provider-handler": "1.0.0-rc.
|
|
34
|
+
"@slates/proto": "1.0.0-rc.11",
|
|
35
|
+
"@slates/provider": "1.0.0-rc.15",
|
|
36
|
+
"@slates/provider-handler": "1.0.0-rc.17"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"@slates/tsconfig": "1.0.0-rc.1",
|
package/src/client.test.ts
CHANGED
|
@@ -32,7 +32,13 @@ let createDemoSlate = () => {
|
|
|
32
32
|
})
|
|
33
33
|
).getDefaultConfig(() => ({
|
|
34
34
|
prefix: 'Hello'
|
|
35
|
-
}))
|
|
35
|
+
})).docs([
|
|
36
|
+
{
|
|
37
|
+
type: 'docs.config.general',
|
|
38
|
+
name: 'Demo config docs',
|
|
39
|
+
url: 'https://example.com/docs/config'
|
|
40
|
+
}
|
|
41
|
+
]);
|
|
36
42
|
|
|
37
43
|
let demoAuth = SlateAuth.create<{ token: string }>()
|
|
38
44
|
.output(
|
|
@@ -47,6 +53,13 @@ let createDemoSlate = () => {
|
|
|
47
53
|
inputSchema: z.object({
|
|
48
54
|
token: z.string()
|
|
49
55
|
}),
|
|
56
|
+
docs: [
|
|
57
|
+
{
|
|
58
|
+
type: 'docs.auth.token',
|
|
59
|
+
name: 'Demo token auth docs',
|
|
60
|
+
url: 'https://example.com/docs/auth/token'
|
|
61
|
+
}
|
|
62
|
+
],
|
|
50
63
|
getDefaultInput: async () => ({
|
|
51
64
|
token: 'default-token'
|
|
52
65
|
}),
|
|
@@ -71,13 +84,26 @@ let createDemoSlate = () => {
|
|
|
71
84
|
key: 'demo-slate',
|
|
72
85
|
name: 'Demo Slate',
|
|
73
86
|
description: 'A tiny test slate',
|
|
87
|
+
docs: [
|
|
88
|
+
{
|
|
89
|
+
name: 'Demo provider docs',
|
|
90
|
+
url: 'https://example.com/docs/provider'
|
|
91
|
+
}
|
|
92
|
+
],
|
|
74
93
|
config: demoConfig,
|
|
75
94
|
auth: demoAuth
|
|
76
95
|
});
|
|
77
96
|
|
|
78
97
|
let echoTool = SlateTool.create(spec, {
|
|
79
98
|
key: 'echo',
|
|
80
|
-
name: 'Echo'
|
|
99
|
+
name: 'Echo',
|
|
100
|
+
docs: [
|
|
101
|
+
{
|
|
102
|
+
type: 'docs.action.general',
|
|
103
|
+
name: 'Echo tool docs',
|
|
104
|
+
url: 'https://example.com/docs/actions/echo'
|
|
105
|
+
}
|
|
106
|
+
]
|
|
81
107
|
})
|
|
82
108
|
.input(
|
|
83
109
|
z.object({
|
|
@@ -408,10 +434,23 @@ describe('@slates/client local transport', () => {
|
|
|
408
434
|
|
|
409
435
|
let provider = await client.identify();
|
|
410
436
|
expect(provider.provider.id).toBe('demo-slate');
|
|
437
|
+
expect(provider.docs).toEqual([
|
|
438
|
+
{
|
|
439
|
+
name: 'Demo provider docs',
|
|
440
|
+
url: 'https://example.com/docs/provider'
|
|
441
|
+
}
|
|
442
|
+
]);
|
|
411
443
|
|
|
412
444
|
let actions = await client.listTools();
|
|
413
445
|
expect(actions).toHaveLength(1);
|
|
414
446
|
expect(actions[0]!.id).toBe('echo');
|
|
447
|
+
expect(actions[0]!.docs).toEqual([
|
|
448
|
+
{
|
|
449
|
+
type: 'docs.action.general',
|
|
450
|
+
name: 'Echo tool docs',
|
|
451
|
+
url: 'https://example.com/docs/actions/echo'
|
|
452
|
+
}
|
|
453
|
+
]);
|
|
415
454
|
expect(actions[0]!.scopes).toEqual({
|
|
416
455
|
AND: [
|
|
417
456
|
{
|
|
@@ -422,6 +461,13 @@ describe('@slates/client local transport', () => {
|
|
|
422
461
|
|
|
423
462
|
let configSchema = await client.getConfigSchema();
|
|
424
463
|
expect(configSchema.schema.properties.prefix.type).toBe('string');
|
|
464
|
+
expect(configSchema.docs).toEqual([
|
|
465
|
+
{
|
|
466
|
+
type: 'docs.config.general',
|
|
467
|
+
name: 'Demo config docs',
|
|
468
|
+
url: 'https://example.com/docs/config'
|
|
469
|
+
}
|
|
470
|
+
]);
|
|
425
471
|
|
|
426
472
|
let defaultConfig = await client.getDefaultConfig();
|
|
427
473
|
expect(defaultConfig.config).toEqual({ prefix: 'Hello' });
|
|
@@ -429,6 +475,13 @@ describe('@slates/client local transport', () => {
|
|
|
429
475
|
let authMethods = await client.listAuthMethods();
|
|
430
476
|
expect(authMethods.authenticationMethods).toHaveLength(1);
|
|
431
477
|
expect(authMethods.authenticationMethods[0]!.type).toBe('auth.token');
|
|
478
|
+
expect(authMethods.authenticationMethods[0]!.docs).toEqual([
|
|
479
|
+
{
|
|
480
|
+
type: 'docs.auth.token',
|
|
481
|
+
name: 'Demo token auth docs',
|
|
482
|
+
url: 'https://example.com/docs/auth/token'
|
|
483
|
+
}
|
|
484
|
+
]);
|
|
432
485
|
|
|
433
486
|
let defaultInput = await client.getDefaultAuthInput('token_auth');
|
|
434
487
|
expect(defaultInput.input).toEqual({ token: 'default-token' });
|