@gleanwork/api-client 0.17.2 → 0.17.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/dist/commonjs/__tests__/messages.test.js +1 -1
- package/dist/commonjs/__tests__/messages.test.js.map +1 -1
- package/dist/commonjs/__tests__/search.test.js +0 -4
- package/dist/commonjs/__tests__/search.test.js.map +1 -1
- package/dist/commonjs/__tests__/summarize.test.js +2 -4
- package/dist/commonjs/__tests__/summarize.test.js.map +1 -1
- package/dist/commonjs/lib/config.d.ts +3 -3
- package/dist/commonjs/lib/config.js +3 -3
- package/dist/commonjs/lib/http.d.ts +1 -1
- package/dist/commonjs/lib/http.d.ts.map +1 -1
- package/dist/commonjs/lib/http.js +1 -1
- package/dist/commonjs/lib/http.js.map +1 -1
- package/dist/commonjs/lib/security.d.ts +5 -4
- package/dist/commonjs/lib/security.d.ts.map +1 -1
- package/dist/commonjs/lib/security.js +6 -7
- package/dist/commonjs/lib/security.js.map +1 -1
- package/dist/commonjs/models/components/actionpreview.d.ts +28 -0
- package/dist/commonjs/models/components/actionpreview.d.ts.map +1 -0
- package/dist/commonjs/models/components/actionpreview.js +61 -0
- package/dist/commonjs/models/components/actionpreview.js.map +1 -0
- package/dist/commonjs/models/components/authcontext.d.ts +25 -0
- package/dist/commonjs/models/components/authcontext.d.ts.map +1 -0
- package/dist/commonjs/models/components/authcontext.js +59 -0
- package/dist/commonjs/models/components/authcontext.js.map +1 -0
- package/dist/commonjs/models/components/chatmessagefragment.d.ts +23 -0
- package/dist/commonjs/models/components/chatmessagefragment.d.ts.map +1 -1
- package/dist/commonjs/models/components/chatmessagefragment.js +6 -0
- package/dist/commonjs/models/components/chatmessagefragment.js.map +1 -1
- package/dist/commonjs/models/components/index.d.ts +4 -0
- package/dist/commonjs/models/components/index.d.ts.map +1 -1
- package/dist/commonjs/models/components/index.js +4 -0
- package/dist/commonjs/models/components/index.js.map +1 -1
- package/dist/commonjs/models/components/listentitiesrequest.d.ts +4 -4
- package/dist/commonjs/models/components/listentitiesrequest.d.ts.map +1 -1
- package/dist/commonjs/models/components/listentitiesrequest.js +4 -5
- package/dist/commonjs/models/components/listentitiesrequest.js.map +1 -1
- package/dist/commonjs/models/components/servertoolrequest.d.ts +75 -0
- package/dist/commonjs/models/components/servertoolrequest.d.ts.map +1 -0
- package/dist/commonjs/models/components/servertoolrequest.js +92 -0
- package/dist/commonjs/models/components/servertoolrequest.js.map +1 -0
- package/dist/commonjs/models/components/servertoolresponse.d.ts +117 -0
- package/dist/commonjs/models/components/servertoolresponse.d.ts.map +1 -0
- package/dist/commonjs/models/components/servertoolresponse.js +113 -0
- package/dist/commonjs/models/components/servertoolresponse.js.map +1 -0
- package/dist/esm/__tests__/messages.test.js +1 -1
- package/dist/esm/__tests__/messages.test.js.map +1 -1
- package/dist/esm/__tests__/search.test.js +0 -4
- package/dist/esm/__tests__/search.test.js.map +1 -1
- package/dist/esm/__tests__/summarize.test.js +2 -4
- package/dist/esm/__tests__/summarize.test.js.map +1 -1
- package/dist/esm/lib/config.d.ts +3 -3
- package/dist/esm/lib/config.js +3 -3
- package/dist/esm/lib/http.d.ts +1 -1
- package/dist/esm/lib/http.d.ts.map +1 -1
- package/dist/esm/lib/http.js +1 -1
- package/dist/esm/lib/http.js.map +1 -1
- package/dist/esm/lib/security.d.ts +5 -4
- package/dist/esm/lib/security.d.ts.map +1 -1
- package/dist/esm/lib/security.js +4 -5
- package/dist/esm/lib/security.js.map +1 -1
- package/dist/esm/models/components/actionpreview.d.ts +28 -0
- package/dist/esm/models/components/actionpreview.d.ts.map +1 -0
- package/dist/esm/models/components/actionpreview.js +23 -0
- package/dist/esm/models/components/actionpreview.js.map +1 -0
- package/dist/esm/models/components/authcontext.d.ts +25 -0
- package/dist/esm/models/components/authcontext.d.ts.map +1 -0
- package/dist/esm/models/components/authcontext.js +21 -0
- package/dist/esm/models/components/authcontext.js.map +1 -0
- package/dist/esm/models/components/chatmessagefragment.d.ts +23 -0
- package/dist/esm/models/components/chatmessagefragment.d.ts.map +1 -1
- package/dist/esm/models/components/chatmessagefragment.js +6 -0
- package/dist/esm/models/components/chatmessagefragment.js.map +1 -1
- package/dist/esm/models/components/index.d.ts +4 -0
- package/dist/esm/models/components/index.d.ts.map +1 -1
- package/dist/esm/models/components/index.js +4 -0
- package/dist/esm/models/components/index.js.map +1 -1
- package/dist/esm/models/components/listentitiesrequest.d.ts +4 -4
- package/dist/esm/models/components/listentitiesrequest.d.ts.map +1 -1
- package/dist/esm/models/components/listentitiesrequest.js +3 -4
- package/dist/esm/models/components/listentitiesrequest.js.map +1 -1
- package/dist/esm/models/components/servertoolrequest.d.ts +75 -0
- package/dist/esm/models/components/servertoolrequest.d.ts.map +1 -0
- package/dist/esm/models/components/servertoolrequest.js +54 -0
- package/dist/esm/models/components/servertoolrequest.js.map +1 -0
- package/dist/esm/models/components/servertoolresponse.d.ts +117 -0
- package/dist/esm/models/components/servertoolresponse.d.ts.map +1 -0
- package/dist/esm/models/components/servertoolresponse.js +75 -0
- package/dist/esm/models/components/servertoolresponse.js.map +1 -0
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/__tests__/messages.test.ts +1 -1
- package/src/__tests__/search.test.ts +0 -4
- package/src/__tests__/summarize.test.ts +2 -4
- package/src/lib/config.ts +3 -3
- package/src/lib/http.ts +3 -1
- package/src/lib/security.ts +10 -5
- package/src/models/components/actionpreview.ts +61 -0
- package/src/models/components/authcontext.ts +56 -0
- package/src/models/components/chatmessagefragment.ts +37 -0
- package/src/models/components/index.ts +4 -0
- package/src/models/components/listentitiesrequest.ts +11 -6
- package/src/models/components/servertoolrequest.ts +138 -0
- package/src/models/components/servertoolresponse.ts +188 -0
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import * as z from "zod/v3";
|
|
2
|
+
import { OpenEnum } from "../../types/enums.js";
|
|
3
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
4
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
5
|
+
import { AuthContext, AuthContext$Outbound } from "./authcontext.js";
|
|
6
|
+
/**
|
|
7
|
+
* The type of request made to the user.
|
|
8
|
+
*/
|
|
9
|
+
export declare const ServerToolResponseRequestType: {
|
|
10
|
+
/**
|
|
11
|
+
* Request for approving execution of the tool.
|
|
12
|
+
*/
|
|
13
|
+
readonly Execution: "EXECUTION";
|
|
14
|
+
/**
|
|
15
|
+
* Request for authenticating to a tool, provided as a (tool) suggestion.
|
|
16
|
+
*/
|
|
17
|
+
readonly AuthenticationSuggestion: "AUTHENTICATION_SUGGESTION";
|
|
18
|
+
/**
|
|
19
|
+
* Suggestion to vote for enabling an available-but-not-enabled tool.
|
|
20
|
+
*/
|
|
21
|
+
readonly VoteSuggestion: "VOTE_SUGGESTION";
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* The type of request made to the user.
|
|
25
|
+
*/
|
|
26
|
+
export type ServerToolResponseRequestType = OpenEnum<typeof ServerToolResponseRequestType>;
|
|
27
|
+
/**
|
|
28
|
+
* Scope of the approval grant. Only applicable when isGranted is true and requestType is EXECUTION.
|
|
29
|
+
*
|
|
30
|
+
* @remarks
|
|
31
|
+
*/
|
|
32
|
+
export declare const GrantScope: {
|
|
33
|
+
/**
|
|
34
|
+
* Approve only the current tool request. Future tool execution requests still require approval.
|
|
35
|
+
*/
|
|
36
|
+
readonly CurrentRequest: "CURRENT_REQUEST";
|
|
37
|
+
/**
|
|
38
|
+
* Approve the current tool request and auto-approve all future same tool requests in this chat session.
|
|
39
|
+
*/
|
|
40
|
+
readonly CurrentSession: "CURRENT_SESSION";
|
|
41
|
+
/**
|
|
42
|
+
* Approve the current tool request and auto-approve all future same tool requests across all chat sessions.
|
|
43
|
+
*/
|
|
44
|
+
readonly Always: "ALWAYS";
|
|
45
|
+
};
|
|
46
|
+
/**
|
|
47
|
+
* Scope of the approval grant. Only applicable when isGranted is true and requestType is EXECUTION.
|
|
48
|
+
*
|
|
49
|
+
* @remarks
|
|
50
|
+
*/
|
|
51
|
+
export type GrantScope = OpenEnum<typeof GrantScope>;
|
|
52
|
+
/**
|
|
53
|
+
* Response to a server tool request. The applicable fields depend on requestType:
|
|
54
|
+
*
|
|
55
|
+
* @remarks
|
|
56
|
+
*
|
|
57
|
+
* For EXECUTION requests:
|
|
58
|
+
* - isGranted: whether tool execution is approved
|
|
59
|
+
* - reason: optional explanation
|
|
60
|
+
*
|
|
61
|
+
* For AUTHENTICATION_SUGGESTION requests:
|
|
62
|
+
* - isGranted: whether auth completed successfully (true=connected, false=skipped)
|
|
63
|
+
* - authContext: contains serverId or actionPackId for identifying the authenticated entity
|
|
64
|
+
* - reason: optional explanation for skip
|
|
65
|
+
*
|
|
66
|
+
* For VOTE_SUGGESTION requests:
|
|
67
|
+
* - voted: whether the user voted for this tool
|
|
68
|
+
*/
|
|
69
|
+
export type ServerToolResponse = {
|
|
70
|
+
/**
|
|
71
|
+
* The type of request made to the user.
|
|
72
|
+
*/
|
|
73
|
+
requestType: ServerToolResponseRequestType;
|
|
74
|
+
/**
|
|
75
|
+
* Unique identifier for this request.
|
|
76
|
+
*/
|
|
77
|
+
requestId: string;
|
|
78
|
+
/**
|
|
79
|
+
* Whether tool request is granted (indicates approval for execution, or completion for auth).
|
|
80
|
+
*/
|
|
81
|
+
isGranted?: boolean | undefined;
|
|
82
|
+
/**
|
|
83
|
+
* Scope of the approval grant. Only applicable when isGranted is true and requestType is EXECUTION.
|
|
84
|
+
*
|
|
85
|
+
* @remarks
|
|
86
|
+
*/
|
|
87
|
+
grantScope?: GrantScope | undefined;
|
|
88
|
+
/**
|
|
89
|
+
* Context for authentication responses, containing identifiers for the entity being authenticated.
|
|
90
|
+
*
|
|
91
|
+
* @remarks
|
|
92
|
+
*/
|
|
93
|
+
authContext?: AuthContext | undefined;
|
|
94
|
+
};
|
|
95
|
+
/** @internal */
|
|
96
|
+
export declare const ServerToolResponseRequestType$inboundSchema: z.ZodType<ServerToolResponseRequestType, z.ZodTypeDef, unknown>;
|
|
97
|
+
/** @internal */
|
|
98
|
+
export declare const ServerToolResponseRequestType$outboundSchema: z.ZodType<string, z.ZodTypeDef, ServerToolResponseRequestType>;
|
|
99
|
+
/** @internal */
|
|
100
|
+
export declare const GrantScope$inboundSchema: z.ZodType<GrantScope, z.ZodTypeDef, unknown>;
|
|
101
|
+
/** @internal */
|
|
102
|
+
export declare const GrantScope$outboundSchema: z.ZodType<string, z.ZodTypeDef, GrantScope>;
|
|
103
|
+
/** @internal */
|
|
104
|
+
export declare const ServerToolResponse$inboundSchema: z.ZodType<ServerToolResponse, z.ZodTypeDef, unknown>;
|
|
105
|
+
/** @internal */
|
|
106
|
+
export type ServerToolResponse$Outbound = {
|
|
107
|
+
requestType: string;
|
|
108
|
+
requestId: string;
|
|
109
|
+
isGranted?: boolean | undefined;
|
|
110
|
+
grantScope: string;
|
|
111
|
+
authContext?: AuthContext$Outbound | undefined;
|
|
112
|
+
};
|
|
113
|
+
/** @internal */
|
|
114
|
+
export declare const ServerToolResponse$outboundSchema: z.ZodType<ServerToolResponse$Outbound, z.ZodTypeDef, ServerToolResponse>;
|
|
115
|
+
export declare function serverToolResponseToJSON(serverToolResponse: ServerToolResponse): string;
|
|
116
|
+
export declare function serverToolResponseFromJSON(jsonString: string): SafeParseResult<ServerToolResponse, SDKValidationError>;
|
|
117
|
+
//# sourceMappingURL=servertoolresponse.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"servertoolresponse.d.ts","sourceRoot":"","sources":["../../../../src/models/components/servertoolresponse.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAG5B,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AACrE,OAAO,EACL,WAAW,EAEX,oBAAoB,EAErB,MAAM,kB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gBAAgB;AAChB,eAAO,MAAM,gCAAgC,EAAE,CAAC,CAAC,OAAO,CACtD,kBAAkB,EAClB,CAAC,CAAC,UAAU,EACZ,OAAO,CAOP,CAAC;AACH,gBAAgB;AAChB,MAAM,MAAM,2BAA2B,GAAG;IACxC,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAChC,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,oBAAoB,GAAG,SAAS,CAAC;CAChD,CAAC;AAEF,gBAAgB;AAChB,eAAO,MAAM,iCAAiC,EAAE,CAAC,CAAC,OAAO,CACvD,2BAA2B,EAC3B,CAAC,CAAC,UAAU,EACZ,kBAAkB,CAOlB,CAAC;AAEH,wBAAgB,wBAAwB,CACtC,kBAAkB,EAAE,kBAAkB,GACrC,MAAM,CAIR;AACD,wBAAgB,0BAA0B,CACxC,UAAU,EAAE,MAAM,GACjB,eAAe,CAAC,kBAAkB,EAAE,kBAAkB,CAAC,CAMzD"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 9d3c25ee1ce8
|
|
4
|
+
*/
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
7
|
+
import * as openEnums from "../../types/enums.js";
|
|
8
|
+
import { AuthContext$inboundSchema, AuthContext$outboundSchema, } from "./authcontext.js";
|
|
9
|
+
/**
|
|
10
|
+
* The type of request made to the user.
|
|
11
|
+
*/
|
|
12
|
+
export const ServerToolResponseRequestType = {
|
|
13
|
+
/**
|
|
14
|
+
* Request for approving execution of the tool.
|
|
15
|
+
*/
|
|
16
|
+
Execution: "EXECUTION",
|
|
17
|
+
/**
|
|
18
|
+
* Request for authenticating to a tool, provided as a (tool) suggestion.
|
|
19
|
+
*/
|
|
20
|
+
AuthenticationSuggestion: "AUTHENTICATION_SUGGESTION",
|
|
21
|
+
/**
|
|
22
|
+
* Suggestion to vote for enabling an available-but-not-enabled tool.
|
|
23
|
+
*/
|
|
24
|
+
VoteSuggestion: "VOTE_SUGGESTION",
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* Scope of the approval grant. Only applicable when isGranted is true and requestType is EXECUTION.
|
|
28
|
+
*
|
|
29
|
+
* @remarks
|
|
30
|
+
*/
|
|
31
|
+
export const GrantScope = {
|
|
32
|
+
/**
|
|
33
|
+
* Approve only the current tool request. Future tool execution requests still require approval.
|
|
34
|
+
*/
|
|
35
|
+
CurrentRequest: "CURRENT_REQUEST",
|
|
36
|
+
/**
|
|
37
|
+
* Approve the current tool request and auto-approve all future same tool requests in this chat session.
|
|
38
|
+
*/
|
|
39
|
+
CurrentSession: "CURRENT_SESSION",
|
|
40
|
+
/**
|
|
41
|
+
* Approve the current tool request and auto-approve all future same tool requests across all chat sessions.
|
|
42
|
+
*/
|
|
43
|
+
Always: "ALWAYS",
|
|
44
|
+
};
|
|
45
|
+
/** @internal */
|
|
46
|
+
export const ServerToolResponseRequestType$inboundSchema = openEnums.inboundSchema(ServerToolResponseRequestType);
|
|
47
|
+
/** @internal */
|
|
48
|
+
export const ServerToolResponseRequestType$outboundSchema = openEnums.outboundSchema(ServerToolResponseRequestType);
|
|
49
|
+
/** @internal */
|
|
50
|
+
export const GrantScope$inboundSchema = openEnums.inboundSchema(GrantScope);
|
|
51
|
+
/** @internal */
|
|
52
|
+
export const GrantScope$outboundSchema = openEnums.outboundSchema(GrantScope);
|
|
53
|
+
/** @internal */
|
|
54
|
+
export const ServerToolResponse$inboundSchema = z.object({
|
|
55
|
+
requestType: ServerToolResponseRequestType$inboundSchema,
|
|
56
|
+
requestId: z.string(),
|
|
57
|
+
isGranted: z.boolean().optional(),
|
|
58
|
+
grantScope: GrantScope$inboundSchema.default("CURRENT_REQUEST"),
|
|
59
|
+
authContext: AuthContext$inboundSchema.optional(),
|
|
60
|
+
});
|
|
61
|
+
/** @internal */
|
|
62
|
+
export const ServerToolResponse$outboundSchema = z.object({
|
|
63
|
+
requestType: ServerToolResponseRequestType$outboundSchema,
|
|
64
|
+
requestId: z.string(),
|
|
65
|
+
isGranted: z.boolean().optional(),
|
|
66
|
+
grantScope: GrantScope$outboundSchema.default("CURRENT_REQUEST"),
|
|
67
|
+
authContext: AuthContext$outboundSchema.optional(),
|
|
68
|
+
});
|
|
69
|
+
export function serverToolResponseToJSON(serverToolResponse) {
|
|
70
|
+
return JSON.stringify(ServerToolResponse$outboundSchema.parse(serverToolResponse));
|
|
71
|
+
}
|
|
72
|
+
export function serverToolResponseFromJSON(jsonString) {
|
|
73
|
+
return safeParse(jsonString, (x) => ServerToolResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ServerToolResponse' from JSON`);
|
|
74
|
+
}
|
|
75
|
+
//# sourceMappingURL=servertoolresponse.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"servertoolresponse.js","sourceRoot":"","sources":["../../../../src/models/components/servertoolresponse.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,KAAK,SAAS,MAAM,sBAAsB,CAAC;AAIlD,OAAO,EAEL,yBAAyB,EAEzB,0BAA0B,GAC3B,MAAM,kBAAkB,CAAC;AAE1B;;GAEG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAG;IAC3C;;OAEG;IACH,SAAS,EAAE,WAAW;IACtB;;OAEG;IACH,wBAAwB,EAAE,2BAA2B;IACrD;;OAEG;IACH,cAAc,EAAE,iBAAiB;CACzB,CAAC;AAQX;;;;GAIG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB;;OAEG;IACH,cAAc,EAAE,iBAAiB;IACjC;;OAEG;IACH,cAAc,EA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C,CAC5D,CAAC;AACJ,CAAC;AACD,MAAM,UAAU,0BAA0B,CACxC,UAAkB;IAElB,OAAO,SAAS,CACd,UAAU,EACV,CAAC,CAAC,EAAE,EAAE,CAAC,gCAAgC,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAC5D,gDAAgD,CACjD,CAAC;AACJ,CAAC"}
|
package/jsr.json
CHANGED
package/package.json
CHANGED
|
@@ -19,12 +19,10 @@ test("Summarize Summarize", async () => {
|
|
|
19
19
|
const result = await glean.client.documents.summarize({
|
|
20
20
|
documentSpecs: [
|
|
21
21
|
{
|
|
22
|
-
|
|
23
|
-
contentId: 602763,
|
|
22
|
+
url: "https://dim-glider.com/",
|
|
24
23
|
},
|
|
25
24
|
{
|
|
26
|
-
|
|
27
|
-
contentId: 602763,
|
|
25
|
+
id: "<id>",
|
|
28
26
|
},
|
|
29
27
|
],
|
|
30
28
|
});
|
package/src/lib/config.ts
CHANGED
|
@@ -73,8 +73,8 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
|
|
|
73
73
|
export const SDK_METADATA = {
|
|
74
74
|
language: "typescript",
|
|
75
75
|
openapiDocVersion: "0.9.0",
|
|
76
|
-
sdkVersion: "0.17.
|
|
77
|
-
genVersion: "2.916.
|
|
76
|
+
sdkVersion: "0.17.3",
|
|
77
|
+
genVersion: "2.916.4",
|
|
78
78
|
userAgent:
|
|
79
|
-
"speakeasy-sdk/typescript 0.17.
|
|
79
|
+
"speakeasy-sdk/typescript 0.17.3 2.916.4 0.9.0 @gleanwork/api-client",
|
|
80
80
|
} as const;
|
package/src/lib/http.ts
CHANGED
|
@@ -46,8 +46,10 @@ export class HTTPClient {
|
|
|
46
46
|
private requestHooks: BeforeRequestHook[] = [];
|
|
47
47
|
private requestErrorHooks: RequestErrorHook[] = [];
|
|
48
48
|
private responseHooks: ResponseHook[] = [];
|
|
49
|
+
private options: HTTPClientOptions;
|
|
49
50
|
|
|
50
|
-
constructor(
|
|
51
|
+
constructor(options: HTTPClientOptions = {}) {
|
|
52
|
+
this.options = options;
|
|
51
53
|
this.fetcher = options.fetcher || DEFAULT_FETCHER;
|
|
52
54
|
}
|
|
53
55
|
|
package/src/lib/security.ts
CHANGED
|
@@ -14,17 +14,22 @@ type OAuth2PasswordFlow = {
|
|
|
14
14
|
tokenURL: string;
|
|
15
15
|
};
|
|
16
16
|
|
|
17
|
-
export
|
|
18
|
-
Incomplete
|
|
19
|
-
UnrecognisedSecurityType
|
|
20
|
-
}
|
|
17
|
+
export const SecurityErrorCode = {
|
|
18
|
+
Incomplete: "incomplete",
|
|
19
|
+
UnrecognisedSecurityType: "unrecognized_security_type",
|
|
20
|
+
} as const;
|
|
21
|
+
export type SecurityErrorCode =
|
|
22
|
+
(typeof SecurityErrorCode)[keyof typeof SecurityErrorCode];
|
|
21
23
|
|
|
22
24
|
export class SecurityError extends Error {
|
|
25
|
+
public code: SecurityErrorCode;
|
|
26
|
+
|
|
23
27
|
constructor(
|
|
24
|
-
|
|
28
|
+
code: SecurityErrorCode,
|
|
25
29
|
message: string,
|
|
26
30
|
) {
|
|
27
31
|
super(message);
|
|
32
|
+
this.code = code;
|
|
28
33
|
this.name = "SecurityError";
|
|
29
34
|
}
|
|
30
35
|
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 225adf458c37
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import * as z from "zod/v3";
|
|
7
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
8
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
9
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Preview information for an action being executed.
|
|
13
|
+
*/
|
|
14
|
+
export type ActionPreview = {
|
|
15
|
+
/**
|
|
16
|
+
* Markdown preview describing what the action will do.
|
|
17
|
+
*/
|
|
18
|
+
markdown?: string | undefined;
|
|
19
|
+
/**
|
|
20
|
+
* Short summary of what this specific tool invocation will do.
|
|
21
|
+
*/
|
|
22
|
+
description?: string | undefined;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
/** @internal */
|
|
26
|
+
export const ActionPreview$inboundSchema: z.ZodType<
|
|
27
|
+
ActionPreview,
|
|
28
|
+
z.ZodTypeDef,
|
|
29
|
+
unknown
|
|
30
|
+
> = z.object({
|
|
31
|
+
markdown: z.string().optional(),
|
|
32
|
+
description: z.string().optional(),
|
|
33
|
+
});
|
|
34
|
+
/** @internal */
|
|
35
|
+
export type ActionPreview$Outbound = {
|
|
36
|
+
markdown?: string | undefined;
|
|
37
|
+
description?: string | undefined;
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
/** @internal */
|
|
41
|
+
export const ActionPreview$outboundSchema: z.ZodType<
|
|
42
|
+
ActionPreview$Outbound,
|
|
43
|
+
z.ZodTypeDef,
|
|
44
|
+
ActionPreview
|
|
45
|
+
> = z.object({
|
|
46
|
+
markdown: z.string().optional(),
|
|
47
|
+
description: z.string().optional(),
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
export function actionPreviewToJSON(actionPreview: ActionPreview): string {
|
|
51
|
+
return JSON.stringify(ActionPreview$outboundSchema.parse(actionPreview));
|
|
52
|
+
}
|
|
53
|
+
export function actionPreviewFromJSON(
|
|
54
|
+
jsonString: string,
|
|
55
|
+
): SafeParseResult<ActionPreview, SDKValidationError> {
|
|
56
|
+
return safeParse(
|
|
57
|
+
jsonString,
|
|
58
|
+
(x) => ActionPreview$inboundSchema.parse(JSON.parse(x)),
|
|
59
|
+
`Failed to parse 'ActionPreview' from JSON`,
|
|
60
|
+
);
|
|
61
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: e7ecc07941dc
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import * as z from "zod/v3";
|
|
7
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
8
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
9
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Context for authentication responses, containing identifiers for the entity being authenticated.
|
|
13
|
+
*
|
|
14
|
+
* @remarks
|
|
15
|
+
*/
|
|
16
|
+
export type AuthContext = {
|
|
17
|
+
/**
|
|
18
|
+
* ID of the MCP server (populated when toolType is MCP).
|
|
19
|
+
*/
|
|
20
|
+
serverId?: string | undefined;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
/** @internal */
|
|
24
|
+
export const AuthContext$inboundSchema: z.ZodType<
|
|
25
|
+
AuthContext,
|
|
26
|
+
z.ZodTypeDef,
|
|
27
|
+
unknown
|
|
28
|
+
> = z.object({
|
|
29
|
+
serverId: z.string().optional(),
|
|
30
|
+
});
|
|
31
|
+
/** @internal */
|
|
32
|
+
export type AuthContext$Outbound = {
|
|
33
|
+
serverId?: string | undefined;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
/** @internal */
|
|
37
|
+
export const AuthContext$outboundSchema: z.ZodType<
|
|
38
|
+
AuthContext$Outbound,
|
|
39
|
+
z.ZodTypeDef,
|
|
40
|
+
AuthContext
|
|
41
|
+
> = z.object({
|
|
42
|
+
serverId: z.string().optional(),
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
export function authContextToJSON(authContext: AuthContext): string {
|
|
46
|
+
return JSON.stringify(AuthContext$outboundSchema.parse(authContext));
|
|
47
|
+
}
|
|
48
|
+
export function authContextFromJSON(
|
|
49
|
+
jsonString: string,
|
|
50
|
+
): SafeParseResult<AuthContext, SDKValidationError> {
|
|
51
|
+
return safeParse(
|
|
52
|
+
jsonString,
|
|
53
|
+
(x) => AuthContext$inboundSchema.parse(JSON.parse(x)),
|
|
54
|
+
`Failed to parse 'AuthContext' from JSON`,
|
|
55
|
+
);
|
|
56
|
+
}
|
|
@@ -25,6 +25,18 @@ import {
|
|
|
25
25
|
QuerySuggestion$Outbound,
|
|
26
26
|
QuerySuggestion$outboundSchema,
|
|
27
27
|
} from "./querysuggestion.js";
|
|
28
|
+
import {
|
|
29
|
+
ServerToolRequest,
|
|
30
|
+
ServerToolRequest$inboundSchema,
|
|
31
|
+
ServerToolRequest$Outbound,
|
|
32
|
+
ServerToolRequest$outboundSchema,
|
|
33
|
+
} from "./servertoolrequest.js";
|
|
34
|
+
import {
|
|
35
|
+
ServerToolResponse,
|
|
36
|
+
ServerToolResponse$inboundSchema,
|
|
37
|
+
ServerToolResponse$Outbound,
|
|
38
|
+
ServerToolResponse$outboundSchema,
|
|
39
|
+
} from "./servertoolresponse.js";
|
|
28
40
|
import {
|
|
29
41
|
StructuredResult,
|
|
30
42
|
StructuredResult$inboundSchema,
|
|
@@ -61,6 +73,25 @@ export type ChatMessageFragment = {
|
|
|
61
73
|
* Information about the source for a ChatMessage.
|
|
62
74
|
*/
|
|
63
75
|
citation?: ChatMessageCitation | undefined;
|
|
76
|
+
serverToolRequest?: ServerToolRequest | undefined;
|
|
77
|
+
/**
|
|
78
|
+
* Response to a server tool request. The applicable fields depend on requestType:
|
|
79
|
+
*
|
|
80
|
+
* @remarks
|
|
81
|
+
*
|
|
82
|
+
* For EXECUTION requests:
|
|
83
|
+
* - isGranted: whether tool execution is approved
|
|
84
|
+
* - reason: optional explanation
|
|
85
|
+
*
|
|
86
|
+
* For AUTHENTICATION_SUGGESTION requests:
|
|
87
|
+
* - isGranted: whether auth completed successfully (true=connected, false=skipped)
|
|
88
|
+
* - authContext: contains serverId or actionPackId for identifying the authenticated entity
|
|
89
|
+
* - reason: optional explanation for skip
|
|
90
|
+
*
|
|
91
|
+
* For VOTE_SUGGESTION requests:
|
|
92
|
+
* - voted: whether the user voted for this tool
|
|
93
|
+
*/
|
|
94
|
+
serverToolResponse?: ServerToolResponse | undefined;
|
|
64
95
|
};
|
|
65
96
|
|
|
66
97
|
/** @internal */
|
|
@@ -76,6 +107,8 @@ export const ChatMessageFragment$inboundSchema: z.ZodType<
|
|
|
76
107
|
file: ChatFile$inboundSchema.optional(),
|
|
77
108
|
action: ToolInfo$inboundSchema.optional(),
|
|
78
109
|
citation: ChatMessageCitation$inboundSchema.optional(),
|
|
110
|
+
serverToolRequest: ServerToolRequest$inboundSchema.optional(),
|
|
111
|
+
serverToolResponse: ServerToolResponse$inboundSchema.optional(),
|
|
79
112
|
});
|
|
80
113
|
/** @internal */
|
|
81
114
|
export type ChatMessageFragment$Outbound = {
|
|
@@ -86,6 +119,8 @@ export type ChatMessageFragment$Outbound = {
|
|
|
86
119
|
file?: ChatFile$Outbound | undefined;
|
|
87
120
|
action?: ToolInfo$Outbound | undefined;
|
|
88
121
|
citation?: ChatMessageCitation$Outbound | undefined;
|
|
122
|
+
serverToolRequest?: ServerToolRequest$Outbound | undefined;
|
|
123
|
+
serverToolResponse?: ServerToolResponse$Outbound | undefined;
|
|
89
124
|
};
|
|
90
125
|
|
|
91
126
|
/** @internal */
|
|
@@ -101,6 +136,8 @@ export const ChatMessageFragment$outboundSchema: z.ZodType<
|
|
|
101
136
|
file: ChatFile$outboundSchema.optional(),
|
|
102
137
|
action: ToolInfo$outboundSchema.optional(),
|
|
103
138
|
citation: ChatMessageCitation$outboundSchema.optional(),
|
|
139
|
+
serverToolRequest: ServerToolRequest$outboundSchema.optional(),
|
|
140
|
+
serverToolResponse: ServerToolResponse$outboundSchema.optional(),
|
|
104
141
|
});
|
|
105
142
|
|
|
106
143
|
export function chatMessageFragmentToJSON(
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
export * from "./actionauthtype.js";
|
|
7
7
|
export * from "./actionpackauthstatus.js";
|
|
8
8
|
export * from "./actionpackauthstatusresponse.js";
|
|
9
|
+
export * from "./actionpreview.js";
|
|
9
10
|
export * from "./actionsummary.js";
|
|
10
11
|
export * from "./activity.js";
|
|
11
12
|
export * from "./activityevent.js";
|
|
@@ -38,6 +39,7 @@ export * from "./answerresult.js";
|
|
|
38
39
|
export * from "./appresult.js";
|
|
39
40
|
export * from "./assistantinsightsresponse.js";
|
|
40
41
|
export * from "./authconfig.js";
|
|
42
|
+
export * from "./authcontext.js";
|
|
41
43
|
export * from "./authorizeactionpackrequest.js";
|
|
42
44
|
export * from "./authorizeactionpackresponse.js";
|
|
43
45
|
export * from "./authorizetoolserverrequest.js";
|
|
@@ -414,6 +416,8 @@ export * from "./seenfeedbackinfo.js";
|
|
|
414
416
|
export * from "./sensitivecontentoptions.js";
|
|
415
417
|
export * from "./sensitiveexpression.js";
|
|
416
418
|
export * from "./sensitiveinfotype.js";
|
|
419
|
+
export * from "./servertoolrequest.js";
|
|
420
|
+
export * from "./servertoolresponse.js";
|
|
417
421
|
export * from "./sessioninfo.js";
|
|
418
422
|
export * from "./share.js";
|
|
419
423
|
export * from "./sharingoptions.js";
|
|
@@ -43,7 +43,7 @@ export type ListEntitiesRequestIncludeField = ClosedEnum<
|
|
|
43
43
|
/**
|
|
44
44
|
* The type of request being made.
|
|
45
45
|
*/
|
|
46
|
-
export const
|
|
46
|
+
export const ListEntitiesRequestRequestType = {
|
|
47
47
|
/**
|
|
48
48
|
* Used by default for all requests and satisfies all standard use cases for list requests. Limited to 10000 entities.
|
|
49
49
|
*/
|
|
@@ -56,7 +56,9 @@ export const RequestType = {
|
|
|
56
56
|
/**
|
|
57
57
|
* The type of request being made.
|
|
58
58
|
*/
|
|
59
|
-
export type
|
|
59
|
+
export type ListEntitiesRequestRequestType = ClosedEnum<
|
|
60
|
+
typeof ListEntitiesRequestRequestType
|
|
61
|
+
>;
|
|
60
62
|
|
|
61
63
|
export type ListEntitiesRequest = {
|
|
62
64
|
filter?: Array<FacetFilter> | undefined;
|
|
@@ -92,7 +94,7 @@ export type ListEntitiesRequest = {
|
|
|
92
94
|
/**
|
|
93
95
|
* The type of request being made.
|
|
94
96
|
*/
|
|
95
|
-
requestType?:
|
|
97
|
+
requestType?: ListEntitiesRequestRequestType | undefined;
|
|
96
98
|
};
|
|
97
99
|
|
|
98
100
|
/** @internal */
|
|
@@ -106,8 +108,9 @@ export const ListEntitiesRequestIncludeField$outboundSchema: z.ZodNativeEnum<
|
|
|
106
108
|
> = z.nativeEnum(ListEntitiesRequestIncludeField);
|
|
107
109
|
|
|
108
110
|
/** @internal */
|
|
109
|
-
export const
|
|
110
|
-
|
|
111
|
+
export const ListEntitiesRequestRequestType$outboundSchema: z.ZodNativeEnum<
|
|
112
|
+
typeof ListEntitiesRequestRequestType
|
|
113
|
+
> = z.nativeEnum(ListEntitiesRequestRequestType);
|
|
111
114
|
|
|
112
115
|
/** @internal */
|
|
113
116
|
export type ListEntitiesRequest$Outbound = {
|
|
@@ -139,7 +142,9 @@ export const ListEntitiesRequest$outboundSchema: z.ZodType<
|
|
|
139
142
|
pageSize: z.number().int().optional(),
|
|
140
143
|
cursor: z.string().optional(),
|
|
141
144
|
source: z.string().optional(),
|
|
142
|
-
requestType:
|
|
145
|
+
requestType: ListEntitiesRequestRequestType$outboundSchema.default(
|
|
146
|
+
"STANDARD",
|
|
147
|
+
),
|
|
143
148
|
});
|
|
144
149
|
|
|
145
150
|
export function listEntitiesRequestToJSON(
|