@honcho-ai/core 1.5.1 → 1.6.1

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.
Files changed (74) hide show
  1. package/CHANGELOG.md +48 -0
  2. package/index.d.mts +2 -2
  3. package/index.d.ts +2 -2
  4. package/index.d.ts.map +1 -1
  5. package/index.js.map +1 -1
  6. package/index.mjs.map +1 -1
  7. package/package.json +1 -1
  8. package/resources/index.d.ts +1 -1
  9. package/resources/index.d.ts.map +1 -1
  10. package/resources/index.js.map +1 -1
  11. package/resources/index.mjs.map +1 -1
  12. package/resources/workspaces/index.d.ts +4 -3
  13. package/resources/workspaces/index.d.ts.map +1 -1
  14. package/resources/workspaces/index.js +4 -1
  15. package/resources/workspaces/index.js.map +1 -1
  16. package/resources/workspaces/index.mjs +1 -0
  17. package/resources/workspaces/index.mjs.map +1 -1
  18. package/resources/workspaces/observations.d.ts +156 -0
  19. package/resources/workspaces/observations.d.ts.map +1 -0
  20. package/resources/workspaces/observations.js +58 -0
  21. package/resources/workspaces/observations.js.map +1 -0
  22. package/resources/workspaces/observations.mjs +53 -0
  23. package/resources/workspaces/observations.mjs.map +1 -0
  24. package/resources/workspaces/peers/index.d.ts +1 -1
  25. package/resources/workspaces/peers/index.d.ts.map +1 -1
  26. package/resources/workspaces/peers/index.js.map +1 -1
  27. package/resources/workspaces/peers/index.mjs.map +1 -1
  28. package/resources/workspaces/peers/peers.d.ts +190 -5
  29. package/resources/workspaces/peers/peers.d.ts.map +1 -1
  30. package/resources/workspaces/peers/peers.js +20 -0
  31. package/resources/workspaces/peers/peers.js.map +1 -1
  32. package/resources/workspaces/peers/peers.mjs +20 -0
  33. package/resources/workspaces/peers/peers.mjs.map +1 -1
  34. package/resources/workspaces/sessions/index.d.ts +1 -1
  35. package/resources/workspaces/sessions/index.d.ts.map +1 -1
  36. package/resources/workspaces/sessions/index.js.map +1 -1
  37. package/resources/workspaces/sessions/index.mjs.map +1 -1
  38. package/resources/workspaces/sessions/messages.d.ts +31 -1
  39. package/resources/workspaces/sessions/messages.d.ts.map +1 -1
  40. package/resources/workspaces/sessions/messages.js +1 -1
  41. package/resources/workspaces/sessions/messages.js.map +1 -1
  42. package/resources/workspaces/sessions/messages.mjs +1 -1
  43. package/resources/workspaces/sessions/messages.mjs.map +1 -1
  44. package/resources/workspaces/sessions/peers.d.ts +4 -6
  45. package/resources/workspaces/sessions/peers.d.ts.map +1 -1
  46. package/resources/workspaces/sessions/peers.js.map +1 -1
  47. package/resources/workspaces/sessions/peers.mjs.map +1 -1
  48. package/resources/workspaces/sessions/sessions.d.ts +77 -10
  49. package/resources/workspaces/sessions/sessions.d.ts.map +1 -1
  50. package/resources/workspaces/sessions/sessions.js +7 -1
  51. package/resources/workspaces/sessions/sessions.js.map +1 -1
  52. package/resources/workspaces/sessions/sessions.mjs +7 -1
  53. package/resources/workspaces/sessions/sessions.mjs.map +1 -1
  54. package/resources/workspaces/workspaces.d.ts +116 -11
  55. package/resources/workspaces/workspaces.d.ts.map +1 -1
  56. package/resources/workspaces/workspaces.js +18 -0
  57. package/resources/workspaces/workspaces.js.map +1 -1
  58. package/resources/workspaces/workspaces.mjs +18 -0
  59. package/resources/workspaces/workspaces.mjs.map +1 -1
  60. package/src/index.ts +12 -0
  61. package/src/resources/index.ts +6 -0
  62. package/src/resources/workspaces/index.ts +25 -1
  63. package/src/resources/workspaces/observations.ts +238 -0
  64. package/src/resources/workspaces/peers/index.ts +4 -1
  65. package/src/resources/workspaces/peers/peers.ts +255 -5
  66. package/src/resources/workspaces/sessions/index.ts +1 -0
  67. package/src/resources/workspaces/sessions/messages.ts +37 -1
  68. package/src/resources/workspaces/sessions/peers.ts +4 -6
  69. package/src/resources/workspaces/sessions/sessions.ts +87 -5
  70. package/src/resources/workspaces/workspaces.ts +181 -3
  71. package/src/version.ts +1 -1
  72. package/version.d.ts +1 -1
  73. package/version.js +1 -1
  74. package/version.mjs +1 -1
package/src/index.ts CHANGED
@@ -9,14 +9,20 @@ import * as Uploads from "./uploads.js";
9
9
  import * as API from "./resources/index.js";
10
10
  import { KeyCreateParams, KeyCreateResponse, Keys } from "./resources/keys.js";
11
11
  import {
12
+ DeriverConfiguration,
12
13
  DeriverStatus,
14
+ DreamConfiguration,
13
15
  MessageSearchOptions,
16
+ PeerCardConfiguration,
17
+ SummaryConfiguration,
14
18
  Workspace,
19
+ WorkspaceConfiguration,
15
20
  WorkspaceDeriverStatusParams,
16
21
  WorkspaceGetOrCreateParams,
17
22
  WorkspaceListParams,
18
23
  WorkspaceSearchParams,
19
24
  WorkspaceSearchResponse,
25
+ WorkspaceTriggerDreamParams,
20
26
  WorkspaceUpdateParams,
21
27
  Workspaces,
22
28
  WorkspacesPage,
@@ -218,9 +224,14 @@ export declare namespace Honcho {
218
224
 
219
225
  export {
220
226
  Workspaces as Workspaces,
227
+ type DeriverConfiguration as DeriverConfiguration,
221
228
  type DeriverStatus as DeriverStatus,
229
+ type DreamConfiguration as DreamConfiguration,
222
230
  type MessageSearchOptions as MessageSearchOptions,
231
+ type PeerCardConfiguration as PeerCardConfiguration,
232
+ type SummaryConfiguration as SummaryConfiguration,
223
233
  type Workspace as Workspace,
234
+ type WorkspaceConfiguration as WorkspaceConfiguration,
224
235
  type WorkspaceSearchResponse as WorkspaceSearchResponse,
225
236
  WorkspacesPage as WorkspacesPage,
226
237
  type WorkspaceUpdateParams as WorkspaceUpdateParams,
@@ -228,6 +239,7 @@ export declare namespace Honcho {
228
239
  type WorkspaceDeriverStatusParams as WorkspaceDeriverStatusParams,
229
240
  type WorkspaceGetOrCreateParams as WorkspaceGetOrCreateParams,
230
241
  type WorkspaceSearchParams as WorkspaceSearchParams,
242
+ type WorkspaceTriggerDreamParams as WorkspaceTriggerDreamParams,
231
243
  };
232
244
 
233
245
  export {
@@ -4,13 +4,19 @@ export { Keys, type KeyCreateResponse, type KeyCreateParams } from "./keys.js";
4
4
  export {
5
5
  WorkspacesPage,
6
6
  Workspaces,
7
+ type DeriverConfiguration,
7
8
  type DeriverStatus,
9
+ type DreamConfiguration,
8
10
  type MessageSearchOptions,
11
+ type PeerCardConfiguration,
12
+ type SummaryConfiguration,
9
13
  type Workspace,
14
+ type WorkspaceConfiguration,
10
15
  type WorkspaceSearchResponse,
11
16
  type WorkspaceUpdateParams,
12
17
  type WorkspaceListParams,
13
18
  type WorkspaceDeriverStatusParams,
14
19
  type WorkspaceGetOrCreateParams,
15
20
  type WorkspaceSearchParams,
21
+ type WorkspaceTriggerDreamParams,
16
22
  } from "./workspaces/workspaces.js";
@@ -1,28 +1,46 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
+ export {
4
+ ObservationsPage,
5
+ Observations,
6
+ type ObservationCreate,
7
+ type ObservationGet,
8
+ type ObservationQuery,
9
+ type PageObservation,
10
+ type ObservationCreateResponse,
11
+ type ObservationDeleteResponse,
12
+ type ObservationQueryResponse,
13
+ type ObservationCreateParams,
14
+ type ObservationListParams,
15
+ type ObservationQueryParams,
16
+ } from "./observations.js";
3
17
  export {
4
18
  PeersPage,
5
19
  Peers,
6
20
  type PagePeer,
7
21
  type PageSession,
8
22
  type Peer,
9
- type SessionGet,
10
23
  type PeerCardResponse,
24
+ type SessionGet,
11
25
  type PeerChatResponse,
26
+ type PeerGetContextResponse,
12
27
  type PeerSearchResponse,
13
28
  type PeerWorkingRepresentationResponse,
14
29
  type PeerUpdateParams,
15
30
  type PeerListParams,
16
31
  type PeerCardParams,
17
32
  type PeerChatParams,
33
+ type PeerGetContextParams,
18
34
  type PeerGetOrCreateParams,
19
35
  type PeerSearchParams,
36
+ type PeerSetCardParams,
20
37
  type PeerWorkingRepresentationParams,
21
38
  } from "./peers/index.js";
22
39
  export {
23
40
  SessionsPage,
24
41
  Sessions,
25
42
  type Session,
43
+ type SessionConfiguration,
26
44
  type Summary,
27
45
  type SessionDeleteResponse,
28
46
  type SessionGetContextResponse,
@@ -47,13 +65,19 @@ export {
47
65
  export {
48
66
  WorkspacesPage,
49
67
  Workspaces,
68
+ type DeriverConfiguration,
50
69
  type DeriverStatus,
70
+ type DreamConfiguration,
51
71
  type MessageSearchOptions,
72
+ type PeerCardConfiguration,
73
+ type SummaryConfiguration,
52
74
  type Workspace,
75
+ type WorkspaceConfiguration,
53
76
  type WorkspaceSearchResponse,
54
77
  type WorkspaceUpdateParams,
55
78
  type WorkspaceListParams,
56
79
  type WorkspaceDeriverStatusParams,
57
80
  type WorkspaceGetOrCreateParams,
58
81
  type WorkspaceSearchParams,
82
+ type WorkspaceTriggerDreamParams,
59
83
  } from "./workspaces.js";
@@ -0,0 +1,238 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from "../../resource.js";
4
+ import { isRequestOptions } from "../../core.js";
5
+ import * as Core from "../../core.js";
6
+ import { Page, type PageParams } from "../../pagination.js";
7
+
8
+ export class Observations extends APIResource {
9
+ /**
10
+ * Create one or more observations.
11
+ *
12
+ * Creates observations (theory-of-mind facts) for the specified observer/observed
13
+ * peer pairs. Each observation must reference existing peers and a session within
14
+ * the workspace. Embeddings are automatically generated for semantic search.
15
+ *
16
+ * Maximum of 100 observations per request.
17
+ */
18
+ create(
19
+ workspaceId: string,
20
+ body: ObservationCreateParams,
21
+ options?: Core.RequestOptions,
22
+ ): Core.APIPromise<ObservationCreateResponse> {
23
+ return this._client.post(`/v2/workspaces/${workspaceId}/observations`, { body, ...options });
24
+ }
25
+
26
+ /**
27
+ * List all observations using custom filters. Observations are listed by recency
28
+ * unless `reverse` is set to `true`.
29
+ *
30
+ * Observations can be filtered by session_id, observer_id and observed_id using
31
+ * the filters parameter.
32
+ */
33
+ list(
34
+ workspaceId: string,
35
+ params?: ObservationListParams,
36
+ options?: Core.RequestOptions,
37
+ ): Core.PagePromise<ObservationsPage, Observations>;
38
+ list(workspaceId: string, options?: Core.RequestOptions): Core.PagePromise<ObservationsPage, Observations>;
39
+ list(
40
+ workspaceId: string,
41
+ params: ObservationListParams | Core.RequestOptions = {},
42
+ options?: Core.RequestOptions,
43
+ ): Core.PagePromise<ObservationsPage, Observations> {
44
+ if (isRequestOptions(params)) {
45
+ return this.list(workspaceId, {}, params);
46
+ }
47
+ const { page, reverse, size, ...body } = params;
48
+ return this._client.getAPIList(`/v2/workspaces/${workspaceId}/observations/list`, ObservationsPage, {
49
+ query: { page, reverse, size },
50
+ body,
51
+ method: 'post',
52
+ ...options,
53
+ });
54
+ }
55
+
56
+ /**
57
+ * Delete a specific observation.
58
+ *
59
+ * This permanently deletes the observation (document) from the theory-of-mind
60
+ * system. This action cannot be undone.
61
+ */
62
+ delete(
63
+ workspaceId: string,
64
+ observationId: string,
65
+ options?: Core.RequestOptions,
66
+ ): Core.APIPromise<unknown> {
67
+ return this._client.delete(`/v2/workspaces/${workspaceId}/observations/${observationId}`, options);
68
+ }
69
+
70
+ /**
71
+ * Query observations using semantic search.
72
+ *
73
+ * Performs vector similarity search on observations to find semantically relevant
74
+ * results. Observer and observed are required for semantic search and must be
75
+ * provided in filters.
76
+ */
77
+ query(
78
+ workspaceId: string,
79
+ body: ObservationQueryParams,
80
+ options?: Core.RequestOptions,
81
+ ): Core.APIPromise<ObservationQueryResponse> {
82
+ return this._client.post(`/v2/workspaces/${workspaceId}/observations/query`, { body, ...options });
83
+ }
84
+ }
85
+
86
+ export class ObservationsPage extends Page<Observations> {}
87
+
88
+ /**
89
+ * Schema for creating a single observation
90
+ */
91
+ export interface ObservationCreate {
92
+ content: string;
93
+
94
+ /**
95
+ * The peer being observed
96
+ */
97
+ observed_id: string;
98
+
99
+ /**
100
+ * The peer making the observation
101
+ */
102
+ observer_id: string;
103
+
104
+ /**
105
+ * The session this observation relates to
106
+ */
107
+ session_id: string;
108
+ }
109
+
110
+ /**
111
+ * Schema for listing observations with optional filters
112
+ */
113
+ export interface ObservationGet {
114
+ filters?: { [key: string]: unknown } | null;
115
+ }
116
+
117
+ /**
118
+ * Query parameters for semantic search of observations
119
+ */
120
+ export interface ObservationQuery {
121
+ /**
122
+ * Semantic search query
123
+ */
124
+ query: string;
125
+
126
+ /**
127
+ * Maximum cosine distance threshold for results
128
+ */
129
+ distance?: number | null;
130
+
131
+ /**
132
+ * Additional filters to apply
133
+ */
134
+ filters?: { [key: string]: unknown } | null;
135
+
136
+ /**
137
+ * Number of results to return
138
+ */
139
+ top_k?: number;
140
+ }
141
+
142
+ /**
143
+ * Observation response - external view of a document
144
+ */
145
+ export interface Observations {
146
+ id: string;
147
+
148
+ content: string;
149
+
150
+ created_at: string;
151
+
152
+ /**
153
+ * The peer being observed
154
+ */
155
+ observed_id: string;
156
+
157
+ /**
158
+ * The peer who made the observation
159
+ */
160
+ observer_id: string;
161
+
162
+ session_id: string;
163
+ }
164
+
165
+ export interface PageObservation {
166
+ items: Array<Observations>;
167
+
168
+ page: number;
169
+
170
+ size: number;
171
+
172
+ pages?: number;
173
+
174
+ total?: number;
175
+ }
176
+
177
+ export type ObservationCreateResponse = Array<Observations>;
178
+
179
+ export type ObservationDeleteResponse = unknown;
180
+
181
+ export type ObservationQueryResponse = Array<Observations>;
182
+
183
+ export interface ObservationCreateParams {
184
+ observations: Array<ObservationCreate>;
185
+ }
186
+
187
+ export interface ObservationListParams extends PageParams {
188
+ /**
189
+ * Query param: Whether to reverse the order of results
190
+ */
191
+ reverse?: boolean | null;
192
+
193
+ /**
194
+ * Body param:
195
+ */
196
+ filters?: { [key: string]: unknown } | null;
197
+ }
198
+
199
+ export interface ObservationQueryParams {
200
+ /**
201
+ * Semantic search query
202
+ */
203
+ query: string;
204
+
205
+ /**
206
+ * Maximum cosine distance threshold for results
207
+ */
208
+ distance?: number | null;
209
+
210
+ /**
211
+ * Additional filters to apply
212
+ */
213
+ filters?: { [key: string]: unknown } | null;
214
+
215
+ /**
216
+ * Number of results to return
217
+ */
218
+ top_k?: number;
219
+ }
220
+
221
+ Observations.ObservationsPage = ObservationsPage;
222
+
223
+ export declare namespace Observations {
224
+ export {
225
+ type ObservationCreate as ObservationCreate,
226
+ type ObservationGet as ObservationGet,
227
+ type ObservationQuery as ObservationQuery,
228
+ type Observations as Observations,
229
+ type PageObservation as PageObservation,
230
+ type ObservationCreateResponse as ObservationCreateResponse,
231
+ type ObservationDeleteResponse as ObservationDeleteResponse,
232
+ type ObservationQueryResponse as ObservationQueryResponse,
233
+ ObservationsPage as ObservationsPage,
234
+ type ObservationCreateParams as ObservationCreateParams,
235
+ type ObservationListParams as ObservationListParams,
236
+ type ObservationQueryParams as ObservationQueryParams,
237
+ };
238
+ }
@@ -6,17 +6,20 @@ export {
6
6
  type PagePeer,
7
7
  type PageSession,
8
8
  type Peer,
9
- type SessionGet,
10
9
  type PeerCardResponse,
10
+ type SessionGet,
11
11
  type PeerChatResponse,
12
+ type PeerGetContextResponse,
12
13
  type PeerSearchResponse,
13
14
  type PeerWorkingRepresentationResponse,
14
15
  type PeerUpdateParams,
15
16
  type PeerListParams,
16
17
  type PeerCardParams,
17
18
  type PeerChatParams,
19
+ type PeerGetContextParams,
18
20
  type PeerGetOrCreateParams,
19
21
  type PeerSearchParams,
22
+ type PeerSetCardParams,
20
23
  type PeerWorkingRepresentationParams,
21
24
  } from "./peers.js";
22
25
  export { Sessions, type SessionListParams } from "./sessions.js";
@@ -87,6 +87,40 @@ export class Peers extends APIResource {
87
87
  return this._client.post(`/v2/workspaces/${workspaceId}/peers/${peerId}/chat`, { body, ...options });
88
88
  }
89
89
 
90
+ /**
91
+ * Get context for a peer, including their representation and peer card.
92
+ *
93
+ * This endpoint returns the working representation and peer card for a peer. If a
94
+ * target is specified, returns the context for the target from the observer peer's
95
+ * perspective. If no target is specified, returns the peer's own context
96
+ * (self-observation).
97
+ *
98
+ * This is useful for getting all the context needed about a peer without making
99
+ * multiple API calls.
100
+ */
101
+ getContext(
102
+ workspaceId: string,
103
+ peerId: string,
104
+ query?: PeerGetContextParams,
105
+ options?: Core.RequestOptions,
106
+ ): Core.APIPromise<PeerGetContextResponse>;
107
+ getContext(
108
+ workspaceId: string,
109
+ peerId: string,
110
+ options?: Core.RequestOptions,
111
+ ): Core.APIPromise<PeerGetContextResponse>;
112
+ getContext(
113
+ workspaceId: string,
114
+ peerId: string,
115
+ query: PeerGetContextParams | Core.RequestOptions = {},
116
+ options?: Core.RequestOptions,
117
+ ): Core.APIPromise<PeerGetContextResponse> {
118
+ if (isRequestOptions(query)) {
119
+ return this.getContext(workspaceId, peerId, {}, query);
120
+ }
121
+ return this._client.get(`/v2/workspaces/${workspaceId}/peers/${peerId}/context`, { query, ...options });
122
+ }
123
+
90
124
  /**
91
125
  * Get a Peer by ID
92
126
  *
@@ -113,6 +147,26 @@ export class Peers extends APIResource {
113
147
  return this._client.post(`/v2/workspaces/${workspaceId}/peers/${peerId}/search`, { body, ...options });
114
148
  }
115
149
 
150
+ /**
151
+ * Set a peer card for a specific peer relationship.
152
+ *
153
+ * Sets the peer card that the observer peer has for the target peer. If no target
154
+ * is specified, sets the observer's own peer card.
155
+ */
156
+ setCard(
157
+ workspaceId: string,
158
+ peerId: string,
159
+ params: PeerSetCardParams,
160
+ options?: Core.RequestOptions,
161
+ ): Core.APIPromise<PeerCardResponse> {
162
+ const { target, ...body } = params;
163
+ return this._client.put(`/v2/workspaces/${workspaceId}/peers/${peerId}/card`, {
164
+ query: { target },
165
+ body,
166
+ ...options,
167
+ });
168
+ }
169
+
116
170
  /**
117
171
  * Get a peer's working representation for a session.
118
172
  *
@@ -172,10 +226,6 @@ export interface Peer {
172
226
  metadata?: { [key: string]: unknown };
173
227
  }
174
228
 
175
- export interface SessionGet {
176
- filters?: { [key: string]: unknown } | null;
177
- }
178
-
179
229
  export interface PeerCardResponse {
180
230
  /**
181
231
  * The peer card content, or None if not found
@@ -183,10 +233,130 @@ export interface PeerCardResponse {
183
233
  peer_card?: Array<string> | null;
184
234
  }
185
235
 
236
+ export interface SessionGet {
237
+ filters?: { [key: string]: unknown } | null;
238
+ }
239
+
186
240
  export interface PeerChatResponse {
187
241
  content: string;
188
242
  }
189
243
 
244
+ /**
245
+ * Context for a peer, including representation and peer card.
246
+ */
247
+ export interface PeerGetContextResponse {
248
+ /**
249
+ * The ID of the peer
250
+ */
251
+ peer_id: string;
252
+
253
+ /**
254
+ * The ID of the target peer being observed
255
+ */
256
+ target_id: string;
257
+
258
+ /**
259
+ * The peer card for the target peer from the observer's perspective
260
+ */
261
+ peer_card?: Array<string> | null;
262
+
263
+ /**
264
+ * A Representation is a traversable and diffable map of observations. At the base,
265
+ * we have a list of explicit observations, derived from a peer's messages.
266
+ *
267
+ * From there, deductive observations can be made by establishing logical
268
+ * relationships between explicit observations.
269
+ *
270
+ * In the future, we can add more levels of reasoning on top of these.
271
+ *
272
+ * All of a peer's observations are stored as documents in a collection. These
273
+ * documents can be queried in various ways to produce this Representation object.
274
+ *
275
+ * Additionally, a "working representation" is a version of this data structure
276
+ * representing the most recent observations within a single session.
277
+ *
278
+ * A representation can have a maximum number of observations, which is applied
279
+ * individually to each level of reasoning. If a maximum is set, observations are
280
+ * added and removed in FIFO order.
281
+ */
282
+ representation?: PeerGetContextResponse.Representation | null;
283
+ }
284
+
285
+ export namespace PeerGetContextResponse {
286
+ /**
287
+ * A Representation is a traversable and diffable map of observations. At the base,
288
+ * we have a list of explicit observations, derived from a peer's messages.
289
+ *
290
+ * From there, deductive observations can be made by establishing logical
291
+ * relationships between explicit observations.
292
+ *
293
+ * In the future, we can add more levels of reasoning on top of these.
294
+ *
295
+ * All of a peer's observations are stored as documents in a collection. These
296
+ * documents can be queried in various ways to produce this Representation object.
297
+ *
298
+ * Additionally, a "working representation" is a version of this data structure
299
+ * representing the most recent observations within a single session.
300
+ *
301
+ * A representation can have a maximum number of observations, which is applied
302
+ * individually to each level of reasoning. If a maximum is set, observations are
303
+ * added and removed in FIFO order.
304
+ */
305
+ export interface Representation {
306
+ /**
307
+ * Conclusions that MUST be true given explicit facts and premises - strict logical
308
+ * necessities. Each deduction should have premises and a single conclusion.
309
+ */
310
+ deductive?: Array<Representation.Deductive>;
311
+
312
+ /**
313
+ * Facts LITERALLY stated by the user - direct quotes or clear paraphrases only, no
314
+ * interpretation or inference. Example: ['The user is 25 years old', 'The user has
315
+ * a dog']
316
+ */
317
+ explicit?: Array<Representation.Explicit>;
318
+ }
319
+
320
+ export namespace Representation {
321
+ /**
322
+ * Deductive observation with multiple premises and one conclusion, plus metadata.
323
+ */
324
+ export interface Deductive {
325
+ /**
326
+ * The deductive conclusion
327
+ */
328
+ conclusion: string;
329
+
330
+ created_at: string;
331
+
332
+ message_ids: Array<number>;
333
+
334
+ session_name: string;
335
+
336
+ /**
337
+ * Supporting premises or evidence for this conclusion
338
+ */
339
+ premises?: Array<string>;
340
+ }
341
+
342
+ /**
343
+ * Explicit observation with content and metadata.
344
+ */
345
+ export interface Explicit {
346
+ /**
347
+ * The explicit observation
348
+ */
349
+ content: string;
350
+
351
+ created_at: string;
352
+
353
+ message_ids: Array<number>;
354
+
355
+ session_name: string;
356
+ }
357
+ }
358
+ }
359
+
190
360
  export type PeerSearchResponse = Array<MessagesAPI.Message>;
191
361
 
192
362
  export type PeerWorkingRepresentationResponse = { [key: string]: unknown };
@@ -231,6 +401,41 @@ export interface PeerChatParams {
231
401
  target?: string | null;
232
402
  }
233
403
 
404
+ export interface PeerGetContextParams {
405
+ /**
406
+ * Whether to include the most derived observations in the representation
407
+ */
408
+ include_most_derived?: boolean;
409
+
410
+ /**
411
+ * Maximum number of observations to include in the representation
412
+ */
413
+ max_observations?: number | null;
414
+
415
+ /**
416
+ * Only used if `search_query` is provided. Maximum distance for semantically
417
+ * relevant observations
418
+ */
419
+ search_max_distance?: number | null;
420
+
421
+ /**
422
+ * Optional query to curate the representation around semantic search results
423
+ */
424
+ search_query?: string | null;
425
+
426
+ /**
427
+ * Only used if `search_query` is provided. Number of semantic-search-retrieved
428
+ * observations to include
429
+ */
430
+ search_top_k?: number | null;
431
+
432
+ /**
433
+ * The target peer to get context for. If not provided, returns the peer's own
434
+ * context (self-observation)
435
+ */
436
+ target?: string | null;
437
+ }
438
+
234
439
  export interface PeerGetOrCreateParams {
235
440
  id: string;
236
441
 
@@ -256,7 +461,49 @@ export interface PeerSearchParams {
256
461
  limit?: number;
257
462
  }
258
463
 
464
+ export interface PeerSetCardParams {
465
+ /**
466
+ * Body param: The peer card content to set
467
+ */
468
+ peer_card: Array<string>;
469
+
470
+ /**
471
+ * Query param: The peer whose card to set. If not provided, sets the observer's
472
+ * own card
473
+ */
474
+ target?: string | null;
475
+ }
476
+
259
477
  export interface PeerWorkingRepresentationParams {
478
+ /**
479
+ * Only used if `search_query` is provided. Whether to include the most derived
480
+ * observations in the representation
481
+ */
482
+ include_most_derived?: boolean | null;
483
+
484
+ /**
485
+ * Only used if `search_query` is provided. Maximum number of observations to
486
+ * include in the representation
487
+ */
488
+ max_observations?: number | null;
489
+
490
+ /**
491
+ * Only used if `search_query` is provided. Maximum distance to search for
492
+ * semantically relevant observations
493
+ */
494
+ search_max_distance?: number | null;
495
+
496
+ /**
497
+ * Optional input to curate the representation around semantic search results
498
+ */
499
+ search_query?: string | null;
500
+
501
+ /**
502
+ * Only used if `search_query` is provided. Number of semantic-search-retrieved
503
+ * observations to include in the representation
504
+ */
505
+ search_top_k?: number | null;
506
+
260
507
  /**
261
508
  * Get the working representation within this session
262
509
  */
@@ -277,9 +524,10 @@ export declare namespace Peers {
277
524
  type PagePeer as PagePeer,
278
525
  type PageSession as PageSession,
279
526
  type Peer as Peer,
280
- type SessionGet as SessionGet,
281
527
  type PeerCardResponse as PeerCardResponse,
528
+ type SessionGet as SessionGet,
282
529
  type PeerChatResponse as PeerChatResponse,
530
+ type PeerGetContextResponse as PeerGetContextResponse,
283
531
  type PeerSearchResponse as PeerSearchResponse,
284
532
  type PeerWorkingRepresentationResponse as PeerWorkingRepresentationResponse,
285
533
  PeersPage as PeersPage,
@@ -287,8 +535,10 @@ export declare namespace Peers {
287
535
  type PeerListParams as PeerListParams,
288
536
  type PeerCardParams as PeerCardParams,
289
537
  type PeerChatParams as PeerChatParams,
538
+ type PeerGetContextParams as PeerGetContextParams,
290
539
  type PeerGetOrCreateParams as PeerGetOrCreateParams,
291
540
  type PeerSearchParams as PeerSearchParams,
541
+ type PeerSetCardParams as PeerSetCardParams,
292
542
  type PeerWorkingRepresentationParams as PeerWorkingRepresentationParams,
293
543
  };
294
544