@honcho-ai/core 1.1.0 → 1.3.0
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 +56 -0
- package/README.md +45 -0
- package/core.d.ts +2 -2
- package/core.d.ts.map +1 -1
- package/core.js +5 -3
- package/core.js.map +1 -1
- package/core.mjs +5 -3
- package/core.mjs.map +1 -1
- package/index.d.mts +4 -2
- package/index.d.ts +4 -2
- package/index.d.ts.map +1 -1
- package/index.js.map +1 -1
- package/index.mjs.map +1 -1
- package/package.json +1 -5
- package/resources/index.d.ts +1 -1
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs.map +1 -1
- package/resources/workspaces/index.d.ts +3 -3
- package/resources/workspaces/index.d.ts.map +1 -1
- package/resources/workspaces/index.js.map +1 -1
- package/resources/workspaces/index.mjs.map +1 -1
- package/resources/workspaces/peers/index.d.ts +1 -2
- package/resources/workspaces/peers/index.d.ts.map +1 -1
- package/resources/workspaces/peers/index.js +1 -3
- package/resources/workspaces/peers/index.js.map +1 -1
- package/resources/workspaces/peers/index.mjs +0 -1
- package/resources/workspaces/peers/index.mjs.map +1 -1
- package/resources/workspaces/peers/peers.d.ts +31 -21
- package/resources/workspaces/peers/peers.d.ts.map +1 -1
- package/resources/workspaces/peers/peers.js +7 -20
- package/resources/workspaces/peers/peers.js.map +1 -1
- package/resources/workspaces/peers/peers.mjs +6 -19
- package/resources/workspaces/peers/peers.mjs.map +1 -1
- package/resources/workspaces/peers/sessions.d.ts +1 -1
- package/resources/workspaces/peers/sessions.d.ts.map +1 -1
- package/resources/workspaces/sessions/index.d.ts +3 -3
- package/resources/workspaces/sessions/index.d.ts.map +1 -1
- package/resources/workspaces/sessions/index.js.map +1 -1
- package/resources/workspaces/sessions/index.mjs.map +1 -1
- package/resources/workspaces/sessions/messages.d.ts +14 -4
- package/resources/workspaces/sessions/messages.d.ts.map +1 -1
- package/resources/workspaces/sessions/messages.js +32 -1
- package/resources/workspaces/sessions/messages.js.map +1 -1
- package/resources/workspaces/sessions/messages.mjs +9 -1
- package/resources/workspaces/sessions/messages.mjs.map +1 -1
- package/resources/workspaces/sessions/peers.d.ts +5 -33
- package/resources/workspaces/sessions/peers.d.ts.map +1 -1
- package/resources/workspaces/sessions/peers.js.map +1 -1
- package/resources/workspaces/sessions/peers.mjs.map +1 -1
- package/resources/workspaces/sessions/sessions.d.ts +29 -36
- package/resources/workspaces/sessions/sessions.d.ts.map +1 -1
- package/resources/workspaces/sessions/sessions.js +7 -7
- package/resources/workspaces/sessions/sessions.js.map +1 -1
- package/resources/workspaces/sessions/sessions.mjs +8 -8
- package/resources/workspaces/sessions/sessions.mjs.map +1 -1
- package/resources/workspaces/workspaces.d.ts +44 -30
- package/resources/workspaces/workspaces.d.ts.map +1 -1
- package/resources/workspaces/workspaces.js +4 -12
- package/resources/workspaces/workspaces.js.map +1 -1
- package/resources/workspaces/workspaces.mjs +3 -11
- package/resources/workspaces/workspaces.mjs.map +1 -1
- package/src/core.ts +6 -4
- package/src/index.ts +6 -0
- package/src/resources/index.ts +2 -0
- package/src/resources/workspaces/index.ts +5 -0
- package/src/resources/workspaces/peers/index.ts +2 -6
- package/src/resources/workspaces/peers/peers.ts +39 -36
- package/src/resources/workspaces/peers/sessions.ts +1 -1
- package/src/resources/workspaces/sessions/index.ts +4 -1
- package/src/resources/workspaces/sessions/messages.ts +29 -3
- package/src/resources/workspaces/sessions/peers.ts +5 -37
- package/src/resources/workspaces/sessions/sessions.ts +39 -46
- package/src/resources/workspaces/workspaces.ts +51 -37
- package/src/version.ts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
- package/resources/workspaces/peers/messages.d.ts +0 -37
- package/resources/workspaces/peers/messages.d.ts.map +0 -1
- package/resources/workspaces/peers/messages.js +0 -25
- package/resources/workspaces/peers/messages.js.map +0 -1
- package/resources/workspaces/peers/messages.mjs +0 -21
- package/resources/workspaces/peers/messages.mjs.map +0 -1
- package/src/resources/workspaces/peers/messages.ts +0 -81
|
@@ -24,13 +24,11 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
24
24
|
return result;
|
|
25
25
|
};
|
|
26
26
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
|
-
exports.
|
|
27
|
+
exports.WorkspacesPage = exports.Workspaces = void 0;
|
|
28
28
|
const resource_1 = require("../../resource.js");
|
|
29
29
|
const core_1 = require("../../core.js");
|
|
30
30
|
const PeersAPI = __importStar(require("./peers/peers.js"));
|
|
31
31
|
const peers_1 = require("./peers/peers.js");
|
|
32
|
-
const messages_1 = require("./sessions/messages.js");
|
|
33
|
-
Object.defineProperty(exports, "MessagesPage", { enumerable: true, get: function () { return messages_1.MessagesPage; } });
|
|
34
32
|
const SessionsAPI = __importStar(require("./sessions/sessions.js"));
|
|
35
33
|
const sessions_1 = require("./sessions/sessions.js");
|
|
36
34
|
const pagination_1 = require("../../pagination.js");
|
|
@@ -68,7 +66,7 @@ class Workspaces extends resource_1.APIResource {
|
|
|
68
66
|
* Get a Workspace by ID.
|
|
69
67
|
*
|
|
70
68
|
* If workspace_id is provided as a query parameter, it uses that (must match JWT
|
|
71
|
-
* workspace_id). Otherwise, it uses the workspace_id from the JWT
|
|
69
|
+
* workspace_id). Otherwise, it uses the workspace_id from the JWT.
|
|
72
70
|
*/
|
|
73
71
|
getOrCreate(body, options) {
|
|
74
72
|
return this._client.post('/v2/workspaces', { body, ...options });
|
|
@@ -76,14 +74,8 @@ class Workspaces extends resource_1.APIResource {
|
|
|
76
74
|
/**
|
|
77
75
|
* Search a Workspace
|
|
78
76
|
*/
|
|
79
|
-
search(workspaceId,
|
|
80
|
-
|
|
81
|
-
return this._client.getAPIList(`/v2/workspaces/${workspaceId}/search`, messages_1.MessagesPage, {
|
|
82
|
-
query: { page, size },
|
|
83
|
-
body: body,
|
|
84
|
-
method: 'post',
|
|
85
|
-
...options,
|
|
86
|
-
});
|
|
77
|
+
search(workspaceId, body, options) {
|
|
78
|
+
return this._client.post(`/v2/workspaces/${workspaceId}/search`, { body, ...options });
|
|
87
79
|
}
|
|
88
80
|
}
|
|
89
81
|
exports.Workspaces = Workspaces;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workspaces.js","sourceRoot":"","sources":["../../src/resources/workspaces/workspaces.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;;;;;;;;;;;;;;;;;;;;;;;AAEtF,gDAA6C;AAC7C,wCAA8C;AAE9C,2DAA0C;AAC1C,
|
|
1
|
+
{"version":3,"file":"workspaces.js","sourceRoot":"","sources":["../../src/resources/workspaces/workspaces.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;;;;;;;;;;;;;;;;;;;;;;;AAEtF,gDAA6C;AAC7C,wCAA8C;AAE9C,2DAA0C;AAC1C,4CAgBuB;AAEvB,oEAAmD;AACnD,qDAa6B;AAC7B,oDAAyD;AAEzD,MAAa,UAAW,SAAQ,sBAAW;IAA3C;;QACE,UAAK,GAAmB,IAAI,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACzD,aAAQ,GAAyB,IAAI,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IA8E1E,CAAC;IA5EC;;OAEG;IACH,MAAM,CACJ,WAAmB,EACnB,IAA2B,EAC3B,OAA6B;QAE7B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,kBAAkB,WAAW,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACjF,CAAC;IAUD,IAAI,CACF,SAAoD,EAAE,EACtD,OAA6B;QAE7B,IAAI,IAAA,uBAAgB,EAAC,MAAM,CAAC,EAAE;YAC5B,OAAO,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC;SAC9B;QACD,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,IAAI,EAAE,GAAG,MA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3,6 @@ import { APIResource } from "../../resource.mjs";
|
|
|
3
3
|
import { isRequestOptions } from "../../core.mjs";
|
|
4
4
|
import * as PeersAPI from "./peers/peers.mjs";
|
|
5
5
|
import { Peers, PeersPage, } from "./peers/peers.mjs";
|
|
6
|
-
import { MessagesPage } from "./sessions/messages.mjs";
|
|
7
6
|
import * as SessionsAPI from "./sessions/sessions.mjs";
|
|
8
7
|
import { Sessions as SessionsAPISessions, SessionsPage, } from "./sessions/sessions.mjs";
|
|
9
8
|
import { Page } from "../../pagination.mjs";
|
|
@@ -41,7 +40,7 @@ export class Workspaces extends APIResource {
|
|
|
41
40
|
* Get a Workspace by ID.
|
|
42
41
|
*
|
|
43
42
|
* If workspace_id is provided as a query parameter, it uses that (must match JWT
|
|
44
|
-
* workspace_id). Otherwise, it uses the workspace_id from the JWT
|
|
43
|
+
* workspace_id). Otherwise, it uses the workspace_id from the JWT.
|
|
45
44
|
*/
|
|
46
45
|
getOrCreate(body, options) {
|
|
47
46
|
return this._client.post('/v2/workspaces', { body, ...options });
|
|
@@ -49,14 +48,8 @@ export class Workspaces extends APIResource {
|
|
|
49
48
|
/**
|
|
50
49
|
* Search a Workspace
|
|
51
50
|
*/
|
|
52
|
-
search(workspaceId,
|
|
53
|
-
|
|
54
|
-
return this._client.getAPIList(`/v2/workspaces/${workspaceId}/search`, MessagesPage, {
|
|
55
|
-
query: { page, size },
|
|
56
|
-
body: body,
|
|
57
|
-
method: 'post',
|
|
58
|
-
...options,
|
|
59
|
-
});
|
|
51
|
+
search(workspaceId, body, options) {
|
|
52
|
+
return this._client.post(`/v2/workspaces/${workspaceId}/search`, { body, ...options });
|
|
60
53
|
}
|
|
61
54
|
}
|
|
62
55
|
export class WorkspacesPage extends Page {
|
|
@@ -66,5 +59,4 @@ Workspaces.Peers = Peers;
|
|
|
66
59
|
Workspaces.PeersPage = PeersPage;
|
|
67
60
|
Workspaces.Sessions = SessionsAPISessions;
|
|
68
61
|
Workspaces.SessionsPage = SessionsPage;
|
|
69
|
-
export { MessagesPage };
|
|
70
62
|
//# sourceMappingURL=workspaces.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workspaces.mjs","sourceRoot":"","sources":["../../src/resources/workspaces/workspaces.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OACf,EAAE,gBAAgB,EAAE;OAEpB,KAAK,QAAQ;OACb,
|
|
1
|
+
{"version":3,"file":"workspaces.mjs","sourceRoot":"","sources":["../../src/resources/workspaces/workspaces.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OACf,EAAE,gBAAgB,EAAE;OAEpB,KAAK,QAAQ;OACb,EAaL,KAAK,EACL,SAAS,GAEV;OAEM,KAAK,WAAW;OAChB,EAWL,QAAQ,IAAI,mBAAmB,EAC/B,YAAY,GACb;OACM,EAAE,IAAI,EAAmB;AAEhC,MAAM,OAAO,UAAW,SAAQ,WAAW;IAA3C;;QACE,UAAK,GAAmB,IAAI,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACzD,aAAQ,GAAyB,IAAI,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IA8E1E,CAAC;IA5EC;;OAEG;IACH,MAAM,CACJ,WAAmB,EACnB,IAA2B,EAC3B,OAA6B;QAE7B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,kBAAkB,WAAW,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACjF,CAAC;IAUD,IAAI,CACF,SAAoD,EAAE,EACtD,OAA6B;QAE7B,IAAI,gBAAgB,CAAC,MAAM,CAAC,EAAE;YAC5B,OAAO,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC;SAC9B;QACD,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,IAAI,EAAE,GAAG,MAAM,CAAC;QAC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217
217
|
protected defaultHeaders(opts: FinalRequestOptions): Headers {
|
|
218
218
|
return {
|
|
219
219
|
Accept: 'application/json',
|
|
220
|
-
'Content-Type': 'application/json',
|
|
220
|
+
...(['head', 'get'].includes(opts.method) ? {} : { 'Content-Type': 'application/json' }),
|
|
221
221
|
'User-Agent': this.getUserAgent(),
|
|
222
222
|
...getPlatformHeaders(),
|
|
223
223
|
...this.authHeaders(opts),
|
|
@@ -299,10 +299,10 @@ export abstract class APIClient {
|
|
|
299
299
|
return null;
|
|
300
300
|
}
|
|
301
301
|
|
|
302
|
-
buildRequest<Req>(
|
|
302
|
+
async buildRequest<Req>(
|
|
303
303
|
inputOptions: FinalRequestOptions<Req>,
|
|
304
304
|
{ retryCount = 0 }: { retryCount?: number } = {},
|
|
305
|
-
): { req: RequestInit; url: string; timeout: number } {
|
|
305
|
+
): Promise<{ req: RequestInit; url: string; timeout: number }> {
|
|
306
306
|
const options = { ...inputOptions };
|
|
307
307
|
const { method, path, query, defaultBaseURL, headers: headers = {} } = options;
|
|
308
308
|
|
|
@@ -450,7 +450,9 @@ export abstract class APIClient {
|
|
|
450
450
|
|
|
451
451
|
await this.prepareOptions(options);
|
|
452
452
|
|
|
453
|
-
const { req, url, timeout } = this.buildRequest(options, {
|
|
453
|
+
const { req, url, timeout } = await this.buildRequest(options, {
|
|
454
|
+
retryCount: maxRetries - retriesRemaining,
|
|
455
|
+
});
|
|
454
456
|
|
|
455
457
|
await this.prepareRequest(req, { url, options });
|
|
456
458
|
|
package/src/index.ts
CHANGED
|
@@ -10,11 +10,13 @@ import * as API from "./resources/index.js";
|
|
|
10
10
|
import { KeyCreateParams, KeyCreateResponse, Keys } from "./resources/keys.js";
|
|
11
11
|
import {
|
|
12
12
|
DeriverStatus,
|
|
13
|
+
MessageSearchOptions,
|
|
13
14
|
Workspace,
|
|
14
15
|
WorkspaceDeriverStatusParams,
|
|
15
16
|
WorkspaceGetOrCreateParams,
|
|
16
17
|
WorkspaceListParams,
|
|
17
18
|
WorkspaceSearchParams,
|
|
19
|
+
WorkspaceSearchResponse,
|
|
18
20
|
WorkspaceUpdateParams,
|
|
19
21
|
Workspaces,
|
|
20
22
|
WorkspacesPage,
|
|
@@ -56,6 +58,8 @@ export interface ClientOptions {
|
|
|
56
58
|
*
|
|
57
59
|
* Note that request timeouts are retried by default, so in a worst-case scenario you may wait
|
|
58
60
|
* much longer than this timeout before the promise succeeds or fails.
|
|
61
|
+
*
|
|
62
|
+
* @unit milliseconds
|
|
59
63
|
*/
|
|
60
64
|
timeout?: number | undefined;
|
|
61
65
|
|
|
@@ -214,7 +218,9 @@ export declare namespace Honcho {
|
|
|
214
218
|
export {
|
|
215
219
|
Workspaces as Workspaces,
|
|
216
220
|
type DeriverStatus as DeriverStatus,
|
|
221
|
+
type MessageSearchOptions as MessageSearchOptions,
|
|
217
222
|
type Workspace as Workspace,
|
|
223
|
+
type WorkspaceSearchResponse as WorkspaceSearchResponse,
|
|
218
224
|
WorkspacesPage as WorkspacesPage,
|
|
219
225
|
type WorkspaceUpdateParams as WorkspaceUpdateParams,
|
|
220
226
|
type WorkspaceListParams as WorkspaceListParams,
|
package/src/resources/index.ts
CHANGED
|
@@ -3,10 +3,12 @@
|
|
|
3
3
|
export {
|
|
4
4
|
PeersPage,
|
|
5
5
|
Peers,
|
|
6
|
+
type PagePeer,
|
|
6
7
|
type PageSession,
|
|
7
8
|
type Peer,
|
|
8
9
|
type SessionGet,
|
|
9
10
|
type PeerChatResponse,
|
|
11
|
+
type PeerSearchResponse,
|
|
10
12
|
type PeerWorkingRepresentationResponse,
|
|
11
13
|
type PeerUpdateParams,
|
|
12
14
|
type PeerListParams,
|
|
@@ -21,6 +23,7 @@ export {
|
|
|
21
23
|
type Session,
|
|
22
24
|
type SessionDeleteResponse,
|
|
23
25
|
type SessionGetContextResponse,
|
|
26
|
+
type SessionSearchResponse,
|
|
24
27
|
type SessionUpdateParams,
|
|
25
28
|
type SessionListParams,
|
|
26
29
|
type SessionCloneParams,
|
|
@@ -32,7 +35,9 @@ export {
|
|
|
32
35
|
WorkspacesPage,
|
|
33
36
|
Workspaces,
|
|
34
37
|
type DeriverStatus,
|
|
38
|
+
type MessageSearchOptions,
|
|
35
39
|
type Workspace,
|
|
40
|
+
type WorkspaceSearchResponse,
|
|
36
41
|
type WorkspaceUpdateParams,
|
|
37
42
|
type WorkspaceListParams,
|
|
38
43
|
type WorkspaceDeriverStatusParams,
|
|
@@ -1,18 +1,14 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
export {
|
|
4
|
-
Messages,
|
|
5
|
-
type MessageCreateResponse,
|
|
6
|
-
type MessageCreateParams,
|
|
7
|
-
type MessageListParams,
|
|
8
|
-
} from "./messages.js";
|
|
9
3
|
export {
|
|
10
4
|
PeersPage,
|
|
11
5
|
Peers,
|
|
6
|
+
type PagePeer,
|
|
12
7
|
type PageSession,
|
|
13
8
|
type Peer,
|
|
14
9
|
type SessionGet,
|
|
15
10
|
type PeerChatResponse,
|
|
11
|
+
type PeerSearchResponse,
|
|
16
12
|
type PeerWorkingRepresentationResponse,
|
|
17
13
|
type PeerUpdateParams,
|
|
18
14
|
type PeerListParams,
|
|
@@ -3,18 +3,14 @@
|
|
|
3
3
|
import { APIResource } from "../../../resource.js";
|
|
4
4
|
import { isRequestOptions } from "../../../core.js";
|
|
5
5
|
import * as Core from "../../../core.js";
|
|
6
|
-
import * as MessagesAPI from "./messages.js";
|
|
7
|
-
import { MessageCreateParams, MessageCreateResponse, MessageListParams, Messages } from "./messages.js";
|
|
8
6
|
import * as SessionsAPI from "./sessions.js";
|
|
9
7
|
import { SessionListParams, Sessions } from "./sessions.js";
|
|
10
|
-
import * as
|
|
11
|
-
import { MessagesPage } from "../sessions/messages.js";
|
|
8
|
+
import * as MessagesAPI from "../sessions/messages.js";
|
|
12
9
|
import * as SessionsSessionsAPI from "../sessions/sessions.js";
|
|
13
10
|
import { Page, type PageParams } from "../../../pagination.js";
|
|
14
11
|
|
|
15
12
|
export class Peers extends APIResource {
|
|
16
13
|
sessions: SessionsAPI.Sessions = new SessionsAPI.Sessions(this._client);
|
|
17
|
-
messages: MessagesAPI.Messages = new MessagesAPI.Messages(this._client);
|
|
18
14
|
|
|
19
15
|
/**
|
|
20
16
|
* Update a Peer's name and/or metadata
|
|
@@ -70,7 +66,7 @@ export class Peers extends APIResource {
|
|
|
70
66
|
* Get a Peer by ID
|
|
71
67
|
*
|
|
72
68
|
* If peer_id is provided as a query parameter, it uses that (must match JWT
|
|
73
|
-
* workspace_id). Otherwise, it uses the peer_id from the JWT
|
|
69
|
+
* workspace_id). Otherwise, it uses the peer_id from the JWT.
|
|
74
70
|
*/
|
|
75
71
|
getOrCreate(
|
|
76
72
|
workspaceId: string,
|
|
@@ -86,26 +82,19 @@ export class Peers extends APIResource {
|
|
|
86
82
|
search(
|
|
87
83
|
workspaceId: string,
|
|
88
84
|
peerId: string,
|
|
89
|
-
|
|
85
|
+
body: PeerSearchParams,
|
|
90
86
|
options?: Core.RequestOptions,
|
|
91
|
-
): Core.
|
|
92
|
-
|
|
93
|
-
return this._client.getAPIList(`/v2/workspaces/${workspaceId}/peers/${peerId}/search`, MessagesPage, {
|
|
94
|
-
query: { page, size },
|
|
95
|
-
body,
|
|
96
|
-
method: 'post',
|
|
97
|
-
...options,
|
|
98
|
-
});
|
|
87
|
+
): Core.APIPromise<PeerSearchResponse> {
|
|
88
|
+
return this._client.post(`/v2/workspaces/${workspaceId}/peers/${peerId}/search`, { body, ...options });
|
|
99
89
|
}
|
|
100
90
|
|
|
101
91
|
/**
|
|
102
92
|
* Get a peer's working representation for a session.
|
|
103
93
|
*
|
|
104
94
|
* If a session_id is provided in the body, we get the working representation of
|
|
105
|
-
* the peer in that session.
|
|
106
|
-
*
|
|
107
|
-
*
|
|
108
|
-
* that parameter is ignored. Future releases will allow for this.
|
|
95
|
+
* the peer in that session. If a target is provided, we get the representation of
|
|
96
|
+
* the target from the perspective of the peer. If no target is provided, we get
|
|
97
|
+
* the global representation of the peer.
|
|
109
98
|
*/
|
|
110
99
|
workingRepresentation(
|
|
111
100
|
workspaceId: string,
|
|
@@ -122,6 +111,18 @@ export class Peers extends APIResource {
|
|
|
122
111
|
|
|
123
112
|
export class PeersPage extends Page<Peer> {}
|
|
124
113
|
|
|
114
|
+
export interface PagePeer {
|
|
115
|
+
items: Array<Peer>;
|
|
116
|
+
|
|
117
|
+
page: number;
|
|
118
|
+
|
|
119
|
+
size: number;
|
|
120
|
+
|
|
121
|
+
pages?: number;
|
|
122
|
+
|
|
123
|
+
total?: number;
|
|
124
|
+
}
|
|
125
|
+
|
|
125
126
|
export interface PageSession {
|
|
126
127
|
items: Array<SessionsSessionsAPI.Session>;
|
|
127
128
|
|
|
@@ -147,13 +148,15 @@ export interface Peer {
|
|
|
147
148
|
}
|
|
148
149
|
|
|
149
150
|
export interface SessionGet {
|
|
150
|
-
|
|
151
|
+
filters?: { [key: string]: unknown } | null;
|
|
151
152
|
}
|
|
152
153
|
|
|
153
154
|
export interface PeerChatResponse {
|
|
154
155
|
content: string;
|
|
155
156
|
}
|
|
156
157
|
|
|
158
|
+
export type PeerSearchResponse = Array<MessagesAPI.Message>;
|
|
159
|
+
|
|
157
160
|
export type PeerWorkingRepresentationResponse = { [key: string]: unknown };
|
|
158
161
|
|
|
159
162
|
export interface PeerUpdateParams {
|
|
@@ -166,11 +169,14 @@ export interface PeerListParams extends PageParams {
|
|
|
166
169
|
/**
|
|
167
170
|
* Body param:
|
|
168
171
|
*/
|
|
169
|
-
|
|
172
|
+
filters?: { [key: string]: unknown } | null;
|
|
170
173
|
}
|
|
171
174
|
|
|
172
175
|
export interface PeerChatParams {
|
|
173
|
-
|
|
176
|
+
/**
|
|
177
|
+
* Dialectic API Prompt
|
|
178
|
+
*/
|
|
179
|
+
query: string;
|
|
174
180
|
|
|
175
181
|
/**
|
|
176
182
|
* ID of the session to scope the representation to
|
|
@@ -193,16 +199,21 @@ export interface PeerGetOrCreateParams {
|
|
|
193
199
|
metadata?: { [key: string]: unknown } | null;
|
|
194
200
|
}
|
|
195
201
|
|
|
196
|
-
export interface PeerSearchParams
|
|
202
|
+
export interface PeerSearchParams {
|
|
197
203
|
/**
|
|
198
|
-
*
|
|
204
|
+
* Search query
|
|
199
205
|
*/
|
|
200
206
|
query: string;
|
|
201
207
|
|
|
202
208
|
/**
|
|
203
|
-
*
|
|
209
|
+
* Filters to scope the search
|
|
204
210
|
*/
|
|
205
|
-
|
|
211
|
+
filters?: { [key: string]: unknown } | null;
|
|
212
|
+
|
|
213
|
+
/**
|
|
214
|
+
* Number of results to return
|
|
215
|
+
*/
|
|
216
|
+
limit?: number;
|
|
206
217
|
}
|
|
207
218
|
|
|
208
219
|
export interface PeerWorkingRepresentationParams {
|
|
@@ -220,14 +231,15 @@ export interface PeerWorkingRepresentationParams {
|
|
|
220
231
|
|
|
221
232
|
Peers.PeersPage = PeersPage;
|
|
222
233
|
Peers.Sessions = Sessions;
|
|
223
|
-
Peers.Messages = Messages;
|
|
224
234
|
|
|
225
235
|
export declare namespace Peers {
|
|
226
236
|
export {
|
|
237
|
+
type PagePeer as PagePeer,
|
|
227
238
|
type PageSession as PageSession,
|
|
228
239
|
type Peer as Peer,
|
|
229
240
|
type SessionGet as SessionGet,
|
|
230
241
|
type PeerChatResponse as PeerChatResponse,
|
|
242
|
+
type PeerSearchResponse as PeerSearchResponse,
|
|
231
243
|
type PeerWorkingRepresentationResponse as PeerWorkingRepresentationResponse,
|
|
232
244
|
PeersPage as PeersPage,
|
|
233
245
|
type PeerUpdateParams as PeerUpdateParams,
|
|
@@ -239,13 +251,4 @@ export declare namespace Peers {
|
|
|
239
251
|
};
|
|
240
252
|
|
|
241
253
|
export { Sessions as Sessions, type SessionListParams as SessionListParams };
|
|
242
|
-
|
|
243
|
-
export {
|
|
244
|
-
Messages as Messages,
|
|
245
|
-
type MessageCreateResponse as MessageCreateResponse,
|
|
246
|
-
type MessageCreateParams as MessageCreateParams,
|
|
247
|
-
type MessageListParams as MessageListParams,
|
|
248
|
-
};
|
|
249
254
|
}
|
|
250
|
-
|
|
251
|
-
export { MessagesPage };
|
|
@@ -6,13 +6,15 @@ export {
|
|
|
6
6
|
type Message,
|
|
7
7
|
type MessageCreate,
|
|
8
8
|
type MessageCreateResponse,
|
|
9
|
+
type MessageUploadResponse,
|
|
9
10
|
type MessageCreateParams,
|
|
10
11
|
type MessageUpdateParams,
|
|
11
12
|
type MessageListParams,
|
|
13
|
+
type MessageUploadParams,
|
|
12
14
|
} from "./messages.js";
|
|
13
15
|
export {
|
|
14
16
|
Peers,
|
|
15
|
-
type
|
|
17
|
+
type SessionPeerConfig,
|
|
16
18
|
type PeerSetConfigResponse,
|
|
17
19
|
type PeerListParams,
|
|
18
20
|
type PeerAddParams,
|
|
@@ -26,6 +28,7 @@ export {
|
|
|
26
28
|
type Session,
|
|
27
29
|
type SessionDeleteResponse,
|
|
28
30
|
type SessionGetContextResponse,
|
|
31
|
+
type SessionSearchResponse,
|
|
29
32
|
type SessionUpdateParams,
|
|
30
33
|
type SessionListParams,
|
|
31
34
|
type SessionCloneParams,
|
|
@@ -7,7 +7,7 @@ import { Page, type PageParams } from "../../../pagination.js";
|
|
|
7
7
|
|
|
8
8
|
export class Messages extends APIResource {
|
|
9
9
|
/**
|
|
10
|
-
* Create
|
|
10
|
+
* Create messages for a session with JSON data (original functionality).
|
|
11
11
|
*/
|
|
12
12
|
create(
|
|
13
13
|
workspaceId: string,
|
|
@@ -82,6 +82,22 @@ export class Messages extends APIResource {
|
|
|
82
82
|
{ query: { page, reverse, size }, body, method: 'post', ...options },
|
|
83
83
|
);
|
|
84
84
|
}
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Create messages from uploaded files. Files are converted to text and split into
|
|
88
|
+
* multiple messages.
|
|
89
|
+
*/
|
|
90
|
+
upload(
|
|
91
|
+
workspaceId: string,
|
|
92
|
+
sessionId: string,
|
|
93
|
+
body: MessageUploadParams,
|
|
94
|
+
options?: Core.RequestOptions,
|
|
95
|
+
): Core.APIPromise<MessageUploadResponse> {
|
|
96
|
+
return this._client.post(
|
|
97
|
+
`/v2/workspaces/${workspaceId}/sessions/${sessionId}/messages/upload`,
|
|
98
|
+
Core.multipartFormRequestOptions({ body, ...options }),
|
|
99
|
+
);
|
|
100
|
+
}
|
|
85
101
|
}
|
|
86
102
|
|
|
87
103
|
export class MessagesPage extends Page<Message> {}
|
|
@@ -95,7 +111,7 @@ export interface Message {
|
|
|
95
111
|
|
|
96
112
|
peer_id: string;
|
|
97
113
|
|
|
98
|
-
session_id: string
|
|
114
|
+
session_id: string;
|
|
99
115
|
|
|
100
116
|
token_count: number;
|
|
101
117
|
|
|
@@ -114,6 +130,8 @@ export interface MessageCreate {
|
|
|
114
130
|
|
|
115
131
|
export type MessageCreateResponse = Array<Message>;
|
|
116
132
|
|
|
133
|
+
export type MessageUploadResponse = Array<Message>;
|
|
134
|
+
|
|
117
135
|
export interface MessageCreateParams {
|
|
118
136
|
messages: Array<MessageCreate>;
|
|
119
137
|
}
|
|
@@ -131,7 +149,13 @@ export interface MessageListParams extends PageParams {
|
|
|
131
149
|
/**
|
|
132
150
|
* Body param:
|
|
133
151
|
*/
|
|
134
|
-
|
|
152
|
+
filters?: { [key: string]: unknown } | null;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
export interface MessageUploadParams {
|
|
156
|
+
file: Core.Uploadable;
|
|
157
|
+
|
|
158
|
+
peer_id: string;
|
|
135
159
|
}
|
|
136
160
|
|
|
137
161
|
Messages.MessagesPage = MessagesPage;
|
|
@@ -141,9 +165,11 @@ export declare namespace Messages {
|
|
|
141
165
|
type Message as Message,
|
|
142
166
|
type MessageCreate as MessageCreate,
|
|
143
167
|
type MessageCreateResponse as MessageCreateResponse,
|
|
168
|
+
type MessageUploadResponse as MessageUploadResponse,
|
|
144
169
|
MessagesPage as MessagesPage,
|
|
145
170
|
type MessageCreateParams as MessageCreateParams,
|
|
146
171
|
type MessageUpdateParams as MessageUpdateParams,
|
|
147
172
|
type MessageListParams as MessageListParams,
|
|
173
|
+
type MessageUploadParams as MessageUploadParams,
|
|
148
174
|
};
|
|
149
175
|
}
|
|
@@ -61,7 +61,7 @@ export class Peers extends APIResource {
|
|
|
61
61
|
sessionId: string,
|
|
62
62
|
peerId: string,
|
|
63
63
|
options?: Core.RequestOptions,
|
|
64
|
-
): Core.APIPromise<
|
|
64
|
+
): Core.APIPromise<SessionPeerConfig> {
|
|
65
65
|
return this._client.get(
|
|
66
66
|
`/v2/workspaces/${workspaceId}/sessions/${sessionId}/peers/${peerId}/config`,
|
|
67
67
|
options,
|
|
@@ -115,7 +115,7 @@ export class Peers extends APIResource {
|
|
|
115
115
|
}
|
|
116
116
|
}
|
|
117
117
|
|
|
118
|
-
export interface
|
|
118
|
+
export interface SessionPeerConfig {
|
|
119
119
|
/**
|
|
120
120
|
* Whether other peers in this session should try to form a session-level
|
|
121
121
|
* theory-of-mind representation of this peer
|
|
@@ -133,43 +133,11 @@ export type PeerSetConfigResponse = unknown;
|
|
|
133
133
|
|
|
134
134
|
export interface PeerListParams extends PageParams {}
|
|
135
135
|
|
|
136
|
-
export type PeerAddParams = { [key: string]:
|
|
137
|
-
|
|
138
|
-
export namespace PeerAddParams {
|
|
139
|
-
export interface Body {
|
|
140
|
-
/**
|
|
141
|
-
* Whether other peers in this session should try to form a session-level
|
|
142
|
-
* theory-of-mind representation of this peer
|
|
143
|
-
*/
|
|
144
|
-
observe_me?: boolean | null;
|
|
145
|
-
|
|
146
|
-
/**
|
|
147
|
-
* Whether this peer should form a session-level theory-of-mind representation of
|
|
148
|
-
* other peers in the session
|
|
149
|
-
*/
|
|
150
|
-
observe_others?: boolean;
|
|
151
|
-
}
|
|
152
|
-
}
|
|
136
|
+
export type PeerAddParams = { [key: string]: SessionPeerConfig };
|
|
153
137
|
|
|
154
138
|
export type PeerRemoveParams = Array<string>;
|
|
155
139
|
|
|
156
|
-
export type PeerSetParams = { [key: string]:
|
|
157
|
-
|
|
158
|
-
export namespace PeerSetParams {
|
|
159
|
-
export interface Body {
|
|
160
|
-
/**
|
|
161
|
-
* Whether other peers in this session should try to form a session-level
|
|
162
|
-
* theory-of-mind representation of this peer
|
|
163
|
-
*/
|
|
164
|
-
observe_me?: boolean | null;
|
|
165
|
-
|
|
166
|
-
/**
|
|
167
|
-
* Whether this peer should form a session-level theory-of-mind representation of
|
|
168
|
-
* other peers in the session
|
|
169
|
-
*/
|
|
170
|
-
observe_others?: boolean;
|
|
171
|
-
}
|
|
172
|
-
}
|
|
140
|
+
export type PeerSetParams = { [key: string]: SessionPeerConfig };
|
|
173
141
|
|
|
174
142
|
export interface PeerSetConfigParams {
|
|
175
143
|
/**
|
|
@@ -187,7 +155,7 @@ export interface PeerSetConfigParams {
|
|
|
187
155
|
|
|
188
156
|
export declare namespace Peers {
|
|
189
157
|
export {
|
|
190
|
-
type
|
|
158
|
+
type SessionPeerConfig as SessionPeerConfig,
|
|
191
159
|
type PeerSetConfigResponse as PeerSetConfigResponse,
|
|
192
160
|
type PeerListParams as PeerListParams,
|
|
193
161
|
type PeerAddParams as PeerAddParams,
|