@sylphx/sdk 0.32.0 → 0.32.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.
- package/README.md +20 -0
- package/dist/access.d.ts +34 -0
- package/dist/access.js +14 -2
- package/dist/access.js.map +1 -1
- package/dist/agents.d.ts +1564 -0
- package/dist/agents.js +1096 -0
- package/dist/agents.js.map +1 -0
- package/dist/ai.js +1 -1
- package/dist/artifacts.js +1 -1
- package/dist/assets.js +1 -1
- package/dist/auth/client.js +1 -1
- package/dist/auth/end-user-keys-mock.d.ts +83 -0
- package/dist/auth/end-user-keys-mock.js +427 -0
- package/dist/auth/end-user-keys-mock.js.map +1 -0
- package/dist/auth/end-user-keys.d.ts +219 -0
- package/dist/auth/end-user-keys.js +240 -0
- package/dist/auth/end-user-keys.js.map +1 -0
- package/dist/auth/verify.js +1 -1
- package/dist/auth.d.ts +201 -2
- package/dist/auth.js +148 -2
- package/dist/auth.js.map +1 -1
- package/dist/billing.d.ts +86 -8
- package/dist/billing.js +39 -1
- package/dist/billing.js.map +1 -1
- package/dist/broker.js +1 -1
- package/dist/build.d.ts +361 -28
- package/dist/build.js +302 -10
- package/dist/build.js.map +1 -1
- package/dist/common.js +1 -1
- package/dist/config/flags.js +1 -1
- package/dist/config.js +1 -1
- package/dist/connections.js +1 -1
- package/dist/data.d.ts +52 -0
- package/dist/data.js +57 -1
- package/dist/data.js.map +1 -1
- package/dist/entitlement.js +1 -1
- package/dist/events/realtime.js +1 -1
- package/dist/events/webhooks.js +1 -1
- package/dist/events.js +1 -1
- package/dist/flags.d.ts +18 -0
- package/dist/flags.js +44 -0
- package/dist/flags.js.map +1 -0
- package/dist/hosting.js +1 -1
- package/dist/ids.d.ts +152 -2
- package/dist/ids.js +32 -2
- package/dist/ids.js.map +1 -1
- package/dist/index.d.ts +14 -1
- package/dist/index.js +20 -2
- package/dist/index.js.map +1 -1
- package/dist/keys.js +1 -1
- package/dist/knowledge.d.ts +1192 -0
- package/dist/knowledge.js +1002 -0
- package/dist/knowledge.js.map +1 -0
- package/dist/localization.js +1 -1
- package/dist/methods.js +1563 -40
- package/dist/methods.js.map +1 -1
- package/dist/money.d.ts +1687 -7
- package/dist/money.js +1269 -1
- package/dist/money.js.map +1 -1
- package/dist/network.js +1 -1
- package/dist/notify.d.ts +346 -1
- package/dist/notify.js +249 -1
- package/dist/notify.js.map +1 -1
- package/dist/observability.d.ts +138 -0
- package/dist/observability.js +89 -1
- package/dist/observability.js.map +1 -1
- package/dist/realtime.d.ts +404 -0
- package/dist/realtime.js +312 -0
- package/dist/realtime.js.map +1 -0
- package/dist/release.js +1 -1
- package/dist/runners.js +1 -1
- package/dist/runtime.js +1 -1
- package/dist/sandboxes.js +1 -1
- package/dist/secrets.d.ts +336 -0
- package/dist/secrets.js +268 -1
- package/dist/secrets.js.map +1 -1
- package/dist/workflows.d.ts +119 -3
- package/dist/workflows.js +144 -4
- package/dist/workflows.js.map +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,1192 @@
|
|
|
1
|
+
import * as runtime from './runtime.js';
|
|
2
|
+
import './common.js';
|
|
3
|
+
import type * as common from './common.js';
|
|
4
|
+
/** The request of AskEntities. */
|
|
5
|
+
export interface AskEntitiesRequest {
|
|
6
|
+
/** The environment whose graph to ask. */
|
|
7
|
+
parent: string;
|
|
8
|
+
/** The question, in natural language; 1 to 4000 characters. */
|
|
9
|
+
question: string;
|
|
10
|
+
/**
|
|
11
|
+
* The spaces to answer from, as resource names; default every space the
|
|
12
|
+
* caller may read. At most 50.
|
|
13
|
+
*/
|
|
14
|
+
spaces?: string[];
|
|
15
|
+
/** Answer about the graph as it was valid at this time; default now. */
|
|
16
|
+
validTime?: string;
|
|
17
|
+
}
|
|
18
|
+
/** The response of AskEntities. */
|
|
19
|
+
export interface AskEntitiesResponse {
|
|
20
|
+
/**
|
|
21
|
+
* The answer, built only from the context pack. Empty when the pack holds
|
|
22
|
+
* nothing that answers the question.
|
|
23
|
+
*/
|
|
24
|
+
answer?: string;
|
|
25
|
+
/** The episodes the answer cites. */
|
|
26
|
+
citations?: Citation[];
|
|
27
|
+
/** The context pack the answer was built from. */
|
|
28
|
+
context?: ContextPack;
|
|
29
|
+
}
|
|
30
|
+
/** A Citation points at an episode a result comes from. */
|
|
31
|
+
export interface Citation {
|
|
32
|
+
/** The episode. */
|
|
33
|
+
episode?: string;
|
|
34
|
+
/** The episode's space. */
|
|
35
|
+
space?: string;
|
|
36
|
+
/** The passage of the episode that supports the result. */
|
|
37
|
+
snippet?: string;
|
|
38
|
+
/** The fused relevance score, higher is more relevant. */
|
|
39
|
+
score?: number;
|
|
40
|
+
/** When the episode happened. */
|
|
41
|
+
occurTime?: string;
|
|
42
|
+
}
|
|
43
|
+
/** The request of CloseRelation. */
|
|
44
|
+
export interface CloseRelationRequest {
|
|
45
|
+
/** The fact to close. */
|
|
46
|
+
name: string;
|
|
47
|
+
/** When the fact stopped holding in the world; default now. */
|
|
48
|
+
validEndTime?: string;
|
|
49
|
+
/** Close only if the current etag matches. */
|
|
50
|
+
etag?: string;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* A ContextPack is what recall found: entities, facts with their time, and
|
|
54
|
+
* citations, all readable by the caller.
|
|
55
|
+
*/
|
|
56
|
+
export interface ContextPack {
|
|
57
|
+
/** The entities, most relevant first. */
|
|
58
|
+
entities?: Entity[];
|
|
59
|
+
/** The facts, most relevant first, with their valid and recorded time. */
|
|
60
|
+
facts?: Relation[];
|
|
61
|
+
/** The episodes the facts and entities come from. */
|
|
62
|
+
citations?: Citation[];
|
|
63
|
+
}
|
|
64
|
+
/** The request of CreateEntity. */
|
|
65
|
+
export interface CreateEntityRequest {
|
|
66
|
+
/** The parent to create in. */
|
|
67
|
+
parent: string;
|
|
68
|
+
/**
|
|
69
|
+
* The entity id, the final name segment; the server assigns one when
|
|
70
|
+
* empty.
|
|
71
|
+
*/
|
|
72
|
+
entityId?: string;
|
|
73
|
+
/** The entity to create; only caller-writable fields are read. */
|
|
74
|
+
entity: Entity;
|
|
75
|
+
/** Validate and return the result without writing anything. */
|
|
76
|
+
validateOnly?: boolean;
|
|
77
|
+
}
|
|
78
|
+
/** The request of CreateEpisode. */
|
|
79
|
+
export interface CreateEpisodeRequest {
|
|
80
|
+
/** The parent to create in. */
|
|
81
|
+
parent: string;
|
|
82
|
+
/**
|
|
83
|
+
* The episode id, the final name segment; the server assigns one when
|
|
84
|
+
* empty.
|
|
85
|
+
*/
|
|
86
|
+
episodeId?: string;
|
|
87
|
+
/** The episode to create; only caller-writable fields are read. */
|
|
88
|
+
episode: Episode;
|
|
89
|
+
/** Validate and return the result without writing anything. */
|
|
90
|
+
validateOnly?: boolean;
|
|
91
|
+
/**
|
|
92
|
+
* Record the episode without extraction, for content that is already
|
|
93
|
+
* structured or must not be read by a model.
|
|
94
|
+
*/
|
|
95
|
+
skipExtraction?: boolean;
|
|
96
|
+
}
|
|
97
|
+
/** The request of CreateKnowledgeSchema. */
|
|
98
|
+
export interface CreateKnowledgeSchemaRequest {
|
|
99
|
+
/** The parent to create in. */
|
|
100
|
+
parent: string;
|
|
101
|
+
/**
|
|
102
|
+
* The knowledge schema id, the final name segment; the server assigns one when
|
|
103
|
+
* empty.
|
|
104
|
+
*/
|
|
105
|
+
knowledgeSchemaId?: string;
|
|
106
|
+
/** The knowledge schema to create; only caller-writable fields are read. */
|
|
107
|
+
knowledgeSchema: KnowledgeSchema;
|
|
108
|
+
/** Validate and return the result without writing anything. */
|
|
109
|
+
validateOnly?: boolean;
|
|
110
|
+
}
|
|
111
|
+
/** The request of CreateRelation. */
|
|
112
|
+
export interface CreateRelationRequest {
|
|
113
|
+
/** The parent to create in. */
|
|
114
|
+
parent: string;
|
|
115
|
+
/**
|
|
116
|
+
* The relation id, the final name segment; the server assigns one when
|
|
117
|
+
* empty.
|
|
118
|
+
*/
|
|
119
|
+
relationId?: string;
|
|
120
|
+
/** The relation to create; only caller-writable fields are read. */
|
|
121
|
+
relation: Relation;
|
|
122
|
+
/** Validate and return the result without writing anything. */
|
|
123
|
+
validateOnly?: boolean;
|
|
124
|
+
}
|
|
125
|
+
/** The request of CreateSpace. */
|
|
126
|
+
export interface CreateSpaceRequest {
|
|
127
|
+
/** The parent to create in. */
|
|
128
|
+
parent: string;
|
|
129
|
+
/**
|
|
130
|
+
* The space id, the final name segment; the server assigns one when
|
|
131
|
+
* empty.
|
|
132
|
+
*/
|
|
133
|
+
spaceId?: string;
|
|
134
|
+
/** The space to create; only caller-writable fields are read. */
|
|
135
|
+
space: Space;
|
|
136
|
+
/** Validate and return the result without writing anything. */
|
|
137
|
+
validateOnly?: boolean;
|
|
138
|
+
}
|
|
139
|
+
/** The request of DeleteEntity. */
|
|
140
|
+
export interface DeleteEntityRequest {
|
|
141
|
+
/** The name of the entity to delete. */
|
|
142
|
+
name: string;
|
|
143
|
+
/** Delete only if the current etag matches. */
|
|
144
|
+
etag?: string;
|
|
145
|
+
/** Succeed when the entity does not exist. */
|
|
146
|
+
allowMissing?: boolean;
|
|
147
|
+
/** Validate without deleting anything. */
|
|
148
|
+
validateOnly?: boolean;
|
|
149
|
+
/** Also delete the episodes this person wrote (a data-rights erasure). */
|
|
150
|
+
force?: boolean;
|
|
151
|
+
}
|
|
152
|
+
/** The request of DeleteEpisode. */
|
|
153
|
+
export interface DeleteEpisodeRequest {
|
|
154
|
+
/** The name of the episode to delete. */
|
|
155
|
+
name: string;
|
|
156
|
+
/** Delete only if the current etag matches. */
|
|
157
|
+
etag?: string;
|
|
158
|
+
/** Succeed when the episode does not exist. */
|
|
159
|
+
allowMissing?: boolean;
|
|
160
|
+
/** Validate without deleting anything. */
|
|
161
|
+
validateOnly?: boolean;
|
|
162
|
+
}
|
|
163
|
+
/** The request of DeleteKnowledgeSchema. */
|
|
164
|
+
export interface DeleteKnowledgeSchemaRequest {
|
|
165
|
+
/** The name of the knowledge schema to delete. */
|
|
166
|
+
name: string;
|
|
167
|
+
/** Delete only if the current etag matches. */
|
|
168
|
+
etag?: string;
|
|
169
|
+
/** Succeed when the knowledge schema does not exist. */
|
|
170
|
+
allowMissing?: boolean;
|
|
171
|
+
/** Validate without deleting anything. */
|
|
172
|
+
validateOnly?: boolean;
|
|
173
|
+
}
|
|
174
|
+
/** The request of DeleteRelation. */
|
|
175
|
+
export interface DeleteRelationRequest {
|
|
176
|
+
/** The name of the relation to delete. */
|
|
177
|
+
name: string;
|
|
178
|
+
/** Delete only if the current etag matches. */
|
|
179
|
+
etag?: string;
|
|
180
|
+
/** Succeed when the relation does not exist. */
|
|
181
|
+
allowMissing?: boolean;
|
|
182
|
+
/** Validate without deleting anything. */
|
|
183
|
+
validateOnly?: boolean;
|
|
184
|
+
}
|
|
185
|
+
/** The request of DeleteSpace. */
|
|
186
|
+
export interface DeleteSpaceRequest {
|
|
187
|
+
/** The name of the space to delete. */
|
|
188
|
+
name: string;
|
|
189
|
+
/** Delete only if the current etag matches. */
|
|
190
|
+
etag?: string;
|
|
191
|
+
/** Succeed when the space does not exist. */
|
|
192
|
+
allowMissing?: boolean;
|
|
193
|
+
/** Validate without deleting anything. */
|
|
194
|
+
validateOnly?: boolean;
|
|
195
|
+
/**
|
|
196
|
+
* Also delete the space's episodes and facts; without it, a space that
|
|
197
|
+
* holds records is refused with `INVALID_STATE`.
|
|
198
|
+
*/
|
|
199
|
+
force?: boolean;
|
|
200
|
+
}
|
|
201
|
+
/**
|
|
202
|
+
* An Entity is a thing with identity: a typed node with a title, aliases,
|
|
203
|
+
* properties and external ids. Its identity is one per graph (the
|
|
204
|
+
* environment), so one person is one entity across every space; it is
|
|
205
|
+
* visible to a reader who may read its home space or at least one of its
|
|
206
|
+
* facts.
|
|
207
|
+
*/
|
|
208
|
+
export interface Entity {
|
|
209
|
+
/** `orgs/{org}/projects/{project}/envs/{env}/entities/{entity}`. */
|
|
210
|
+
name?: string;
|
|
211
|
+
/** `ken_<26 base32>`; never reused. */
|
|
212
|
+
readonly uid?: string;
|
|
213
|
+
/** Resource metadata. */
|
|
214
|
+
meta?: common.ResourceMeta;
|
|
215
|
+
/**
|
|
216
|
+
* The type: a core type (`person`, `organisation`, `customer`, `contact`,
|
|
217
|
+
* `product`, `project`, `document`, `decision`, `playbook`, `case`,
|
|
218
|
+
* `topic`) or a type of an accepted Knowledge Schema, `<schema>.<type>`.
|
|
219
|
+
*/
|
|
220
|
+
entityType?: string;
|
|
221
|
+
/** The name people use for it. */
|
|
222
|
+
title?: string;
|
|
223
|
+
/** Other names it is known by; at most 50. */
|
|
224
|
+
aliases?: string[];
|
|
225
|
+
/** Properties, valid against the type's JSON Schema. */
|
|
226
|
+
properties?: Record<string, unknown>;
|
|
227
|
+
/**
|
|
228
|
+
* Identifiers in other systems. Two writes with the same external id in
|
|
229
|
+
* one graph are the same entity (deterministic resolution). At most 50.
|
|
230
|
+
*/
|
|
231
|
+
externalIds?: ExternalId[];
|
|
232
|
+
/** The space the entity was first stated in. */
|
|
233
|
+
space?: string;
|
|
234
|
+
/** Where it came from and who wrote it. */
|
|
235
|
+
readonly provenance?: Provenance;
|
|
236
|
+
/** Whether the entity stands on its own or was merged into another. */
|
|
237
|
+
readonly lifecycle?: EntityLifecycle;
|
|
238
|
+
/**
|
|
239
|
+
* The entity this one was merged into, while `lifecycle` is
|
|
240
|
+
* `ENTITY_LIFECYCLE_MERGED`.
|
|
241
|
+
*/
|
|
242
|
+
readonly survivor?: string;
|
|
243
|
+
/** The entities merged into this one; each can be split back out. */
|
|
244
|
+
readonly mergedEntities?: string[];
|
|
245
|
+
/** When the entity was first recorded. */
|
|
246
|
+
readonly createTime?: string;
|
|
247
|
+
/** When the entity last changed. */
|
|
248
|
+
readonly updateTime?: string;
|
|
249
|
+
}
|
|
250
|
+
/** An EntityTypeDefinition is one entity type of a schema. */
|
|
251
|
+
export interface EntityTypeDefinition {
|
|
252
|
+
/**
|
|
253
|
+
* The type id within the schema, snake_case; entities name it
|
|
254
|
+
* `<schema>.<type>`.
|
|
255
|
+
*/
|
|
256
|
+
typeId?: string;
|
|
257
|
+
/**
|
|
258
|
+
* What the type is, for people and for extraction; at most 1000
|
|
259
|
+
* characters.
|
|
260
|
+
*/
|
|
261
|
+
description?: string;
|
|
262
|
+
/** The JSON Schema (2020-12) an entity's `properties` must satisfy. */
|
|
263
|
+
propertiesSchema?: Record<string, unknown>;
|
|
264
|
+
/**
|
|
265
|
+
* The external id kinds that resolve entities of this type
|
|
266
|
+
* deterministically, for example `email` and `phone` for a contact.
|
|
267
|
+
*/
|
|
268
|
+
matchKinds?: string[];
|
|
269
|
+
}
|
|
270
|
+
/**
|
|
271
|
+
* An Episode is the source of everything in the graph: one write as it
|
|
272
|
+
* happened (a note, a message, a step result, a document chunk, an imported
|
|
273
|
+
* row), with its provenance. Creating one is `remember`; extraction reads it
|
|
274
|
+
* afterwards and proposes entities and relations that cite it.
|
|
275
|
+
*/
|
|
276
|
+
export interface Episode {
|
|
277
|
+
/** `orgs/{org}/projects/{project}/envs/{env}/spaces/{space}/episodes/{episode}`. */
|
|
278
|
+
name?: string;
|
|
279
|
+
/** `epi_<26 base32>`; never reused. */
|
|
280
|
+
readonly uid?: string;
|
|
281
|
+
/** Resource metadata. */
|
|
282
|
+
meta?: common.ResourceMeta;
|
|
283
|
+
/** What the episode is. */
|
|
284
|
+
kind?: EpisodeKind;
|
|
285
|
+
/**
|
|
286
|
+
* The text as written, at most 64 KiB. An episode has `text`, `data`, or
|
|
287
|
+
* both.
|
|
288
|
+
*/
|
|
289
|
+
text?: string;
|
|
290
|
+
/**
|
|
291
|
+
* Structured content, for a caller that already knows the shape (an
|
|
292
|
+
* imported row, a form).
|
|
293
|
+
*/
|
|
294
|
+
data?: Record<string, unknown>;
|
|
295
|
+
/** When it happened in the world; default the time it was recorded. */
|
|
296
|
+
occurTime?: string;
|
|
297
|
+
/** Where it came from and who wrote it. */
|
|
298
|
+
provenance?: Provenance;
|
|
299
|
+
/**
|
|
300
|
+
* The entities the caller says the episode is about, as resource names;
|
|
301
|
+
* extraction adds the ones it finds. At most 50.
|
|
302
|
+
*/
|
|
303
|
+
entities?: string[];
|
|
304
|
+
/** Where extraction stands. */
|
|
305
|
+
readonly extraction?: Extraction;
|
|
306
|
+
/** When the episode was recorded. */
|
|
307
|
+
readonly createTime?: string;
|
|
308
|
+
}
|
|
309
|
+
/** An ExternalId is an entity's identifier in another system. */
|
|
310
|
+
export interface ExternalId {
|
|
311
|
+
/**
|
|
312
|
+
* The kind of identifier: `email`, `phone`, `auth_subject`,
|
|
313
|
+
* `channel_user`, `account`, or a caller's own kind.
|
|
314
|
+
*/
|
|
315
|
+
kind?: string;
|
|
316
|
+
/** The identifier, normalised (a lowercase email, an E.164 phone number). */
|
|
317
|
+
value?: string;
|
|
318
|
+
}
|
|
319
|
+
/** The request of GetEntity. */
|
|
320
|
+
export interface GetEntityRequest {
|
|
321
|
+
/** The name of the entity to get. */
|
|
322
|
+
name: string;
|
|
323
|
+
}
|
|
324
|
+
/** The request of GetEpisode. */
|
|
325
|
+
export interface GetEpisodeRequest {
|
|
326
|
+
/** The name of the episode to get. */
|
|
327
|
+
name: string;
|
|
328
|
+
}
|
|
329
|
+
/** The request of GetKnowledgeSchema. */
|
|
330
|
+
export interface GetKnowledgeSchemaRequest {
|
|
331
|
+
/** The name of the knowledge_schema to get. */
|
|
332
|
+
name: string;
|
|
333
|
+
}
|
|
334
|
+
/** The request of GetRelation. */
|
|
335
|
+
export interface GetRelationRequest {
|
|
336
|
+
/** The name of the relation to get. */
|
|
337
|
+
name: string;
|
|
338
|
+
}
|
|
339
|
+
/** The request of GetSpace. */
|
|
340
|
+
export interface GetSpaceRequest {
|
|
341
|
+
/** The name of the space to get. */
|
|
342
|
+
name: string;
|
|
343
|
+
}
|
|
344
|
+
/**
|
|
345
|
+
* A Knowledge Schema is a published, versioned set of types a graph accepts:
|
|
346
|
+
* entity types with a JSON Schema each, and relation types. A type pack (the
|
|
347
|
+
* customer pack) is a schema, not code. The core schema is built in.
|
|
348
|
+
*/
|
|
349
|
+
export interface KnowledgeSchema {
|
|
350
|
+
/** `orgs/{org}/projects/{project}/envs/{env}/knowledge_schemas/{knowledge_schema}`. */
|
|
351
|
+
name?: string;
|
|
352
|
+
/** `ksch_<26 base32>`; never reused. */
|
|
353
|
+
readonly uid?: string;
|
|
354
|
+
/** Resource metadata. */
|
|
355
|
+
meta?: common.ResourceMeta;
|
|
356
|
+
/** Desired state. */
|
|
357
|
+
spec?: KnowledgeSchemaSpec;
|
|
358
|
+
/** Observed state. */
|
|
359
|
+
readonly status?: KnowledgeSchemaStatus;
|
|
360
|
+
}
|
|
361
|
+
/** KnowledgeSchemaSpec is the caller-writable state of a Knowledge Schema. */
|
|
362
|
+
export interface KnowledgeSchemaSpec {
|
|
363
|
+
/** The entity types; at most 200. */
|
|
364
|
+
entityTypes?: EntityTypeDefinition[];
|
|
365
|
+
/** The relation types; at most 500. */
|
|
366
|
+
relationTypes?: RelationTypeDefinition[];
|
|
367
|
+
}
|
|
368
|
+
/** KnowledgeSchemaStatus is the observed state of a Knowledge Schema. */
|
|
369
|
+
export interface KnowledgeSchemaStatus {
|
|
370
|
+
/** The generation this status was computed from. */
|
|
371
|
+
readonly observedGeneration?: string;
|
|
372
|
+
/** Ready, Reconciling, Stalled. */
|
|
373
|
+
readonly conditions?: common.Condition[];
|
|
374
|
+
/**
|
|
375
|
+
* The published revision; each accepted update adds one. A record keeps
|
|
376
|
+
* the revision it was validated against.
|
|
377
|
+
*/
|
|
378
|
+
readonly revision?: string;
|
|
379
|
+
}
|
|
380
|
+
/** The request of ListEntities. */
|
|
381
|
+
export interface ListEntitiesRequest {
|
|
382
|
+
/** The parent to list in. */
|
|
383
|
+
parent: string;
|
|
384
|
+
/** At most this many; default 50, clamped to 1000. */
|
|
385
|
+
pageSize?: number;
|
|
386
|
+
/** `next_page_token` of the previous page. */
|
|
387
|
+
pageToken?: string;
|
|
388
|
+
/** AIP-160 filter, limited to `entity_type` and `lifecycle`. */
|
|
389
|
+
filter?: string;
|
|
390
|
+
}
|
|
391
|
+
/** The response of ListEntities. */
|
|
392
|
+
export interface ListEntitiesResponse {
|
|
393
|
+
/** The page. */
|
|
394
|
+
entities?: Entity[];
|
|
395
|
+
/** The token of the next page; empty on the last page. */
|
|
396
|
+
nextPageToken?: string;
|
|
397
|
+
}
|
|
398
|
+
/** The request of ListEpisodes. */
|
|
399
|
+
export interface ListEpisodesRequest {
|
|
400
|
+
/** The parent to list in. */
|
|
401
|
+
parent: string;
|
|
402
|
+
/** At most this many; default 50, clamped to 1000. */
|
|
403
|
+
pageSize?: number;
|
|
404
|
+
/** `next_page_token` of the previous page. */
|
|
405
|
+
pageToken?: string;
|
|
406
|
+
/**
|
|
407
|
+
* AIP-160 filter, limited to `kind` and `extraction`; for example
|
|
408
|
+
* `kind = EPISODE_KIND_NOTE AND extraction = EXTRACTION_DONE`.
|
|
409
|
+
*/
|
|
410
|
+
filter?: string;
|
|
411
|
+
}
|
|
412
|
+
/** The response of ListEpisodes. */
|
|
413
|
+
export interface ListEpisodesResponse {
|
|
414
|
+
/** The page. */
|
|
415
|
+
episodes?: Episode[];
|
|
416
|
+
/** The token of the next page; empty on the last page. */
|
|
417
|
+
nextPageToken?: string;
|
|
418
|
+
}
|
|
419
|
+
/** The request of ListKnowledgeSchemas. */
|
|
420
|
+
export interface ListKnowledgeSchemasRequest {
|
|
421
|
+
/** The parent to list in. */
|
|
422
|
+
parent: string;
|
|
423
|
+
/** At most this many; default 50, clamped to 1000. */
|
|
424
|
+
pageSize?: number;
|
|
425
|
+
/** `next_page_token` of the previous page. */
|
|
426
|
+
pageToken?: string;
|
|
427
|
+
/** AIP-160 filter over labels and filterable fields. */
|
|
428
|
+
filter?: string;
|
|
429
|
+
/** AIP-132 ordering over filterable fields. */
|
|
430
|
+
orderBy?: string;
|
|
431
|
+
}
|
|
432
|
+
/** The response of ListKnowledgeSchemas. */
|
|
433
|
+
export interface ListKnowledgeSchemasResponse {
|
|
434
|
+
/** The page. */
|
|
435
|
+
knowledgeSchemas?: KnowledgeSchema[];
|
|
436
|
+
/** The token of the next page; empty on the last page. */
|
|
437
|
+
nextPageToken?: string;
|
|
438
|
+
}
|
|
439
|
+
/** The request of ListRelations. */
|
|
440
|
+
export interface ListRelationsRequest {
|
|
441
|
+
/** The parent to list in. */
|
|
442
|
+
parent: string;
|
|
443
|
+
/** At most this many; default 50, clamped to 1000. */
|
|
444
|
+
pageSize?: number;
|
|
445
|
+
/** `next_page_token` of the previous page. */
|
|
446
|
+
pageToken?: string;
|
|
447
|
+
/**
|
|
448
|
+
* AIP-160 filter, limited to `subject`, `predicate`, `object` and
|
|
449
|
+
* `provenance.channel`.
|
|
450
|
+
*/
|
|
451
|
+
filter?: string;
|
|
452
|
+
/**
|
|
453
|
+
* List facts as they were valid at this time, including facts closed
|
|
454
|
+
* since; default now.
|
|
455
|
+
*/
|
|
456
|
+
validTime?: string;
|
|
457
|
+
/** Also list facts that a newer record replaced. */
|
|
458
|
+
showSuperseded?: boolean;
|
|
459
|
+
}
|
|
460
|
+
/** The response of ListRelations. */
|
|
461
|
+
export interface ListRelationsResponse {
|
|
462
|
+
/** The page. */
|
|
463
|
+
relations?: Relation[];
|
|
464
|
+
/** The token of the next page; empty on the last page. */
|
|
465
|
+
nextPageToken?: string;
|
|
466
|
+
}
|
|
467
|
+
/** The request of ListSpaces. */
|
|
468
|
+
export interface ListSpacesRequest {
|
|
469
|
+
/** The parent to list in. */
|
|
470
|
+
parent: string;
|
|
471
|
+
/** At most this many; default 50, clamped to 1000. */
|
|
472
|
+
pageSize?: number;
|
|
473
|
+
/** `next_page_token` of the previous page. */
|
|
474
|
+
pageToken?: string;
|
|
475
|
+
/** AIP-160 filter over labels and filterable fields. */
|
|
476
|
+
filter?: string;
|
|
477
|
+
/** AIP-132 ordering over filterable fields. */
|
|
478
|
+
orderBy?: string;
|
|
479
|
+
}
|
|
480
|
+
/** The response of ListSpaces. */
|
|
481
|
+
export interface ListSpacesResponse {
|
|
482
|
+
/** The page. */
|
|
483
|
+
spaces?: Space[];
|
|
484
|
+
/** The token of the next page; empty on the last page. */
|
|
485
|
+
nextPageToken?: string;
|
|
486
|
+
}
|
|
487
|
+
/** The request of MergeEntity. */
|
|
488
|
+
export interface MergeEntityRequest {
|
|
489
|
+
/** The entity that survives the merge. */
|
|
490
|
+
name: string;
|
|
491
|
+
/** The entities to merge into it; 1 to 20. */
|
|
492
|
+
entities: string[];
|
|
493
|
+
/**
|
|
494
|
+
* Why they are the same, recorded with the merge; at most 1000
|
|
495
|
+
* characters.
|
|
496
|
+
*/
|
|
497
|
+
reason?: string;
|
|
498
|
+
}
|
|
499
|
+
/** The request of ProfileEntity. */
|
|
500
|
+
export interface ProfileEntityRequest {
|
|
501
|
+
/** The entity. */
|
|
502
|
+
name: string;
|
|
503
|
+
/** The profile as it was valid at this time; default now. */
|
|
504
|
+
validTime?: string;
|
|
505
|
+
/** At most this many recent episodes; default 20, clamped to 100. */
|
|
506
|
+
maxEpisodes?: number;
|
|
507
|
+
}
|
|
508
|
+
/** The response of ProfileEntity. */
|
|
509
|
+
export interface ProfileEntityResponse {
|
|
510
|
+
/** The entity. */
|
|
511
|
+
entity?: Entity;
|
|
512
|
+
/** Its current facts, as subject or object. */
|
|
513
|
+
facts?: Relation[];
|
|
514
|
+
/** The other entities those facts name. */
|
|
515
|
+
relatedEntities?: Entity[];
|
|
516
|
+
/** The most recent episodes about the entity. */
|
|
517
|
+
recentEpisodes?: Citation[];
|
|
518
|
+
}
|
|
519
|
+
/**
|
|
520
|
+
* Provenance says where a record came from and who wrote it. A record with
|
|
521
|
+
* no source is refused.
|
|
522
|
+
*/
|
|
523
|
+
export interface Provenance {
|
|
524
|
+
/**
|
|
525
|
+
* The principal the write is attributed to, as a share subject
|
|
526
|
+
* (`user:<id>`, `end_user:<id>`): the member or end user an agent or app
|
|
527
|
+
* acts for. Set by the server from the caller's credential.
|
|
528
|
+
*/
|
|
529
|
+
readonly principal?: string;
|
|
530
|
+
/**
|
|
531
|
+
* The caller that made the write when it is not the principal: an agent
|
|
532
|
+
* (`agent:<id>`), an app key (`api_key:<id>`) or a connector.
|
|
533
|
+
*/
|
|
534
|
+
readonly actor?: string;
|
|
535
|
+
/** The path the write took. */
|
|
536
|
+
readonly channel?: Channel;
|
|
537
|
+
/**
|
|
538
|
+
* How the content was produced; default `SOURCE_METHOD_STATED`. Only the
|
|
539
|
+
* service writes `SOURCE_METHOD_EXTRACTED`.
|
|
540
|
+
*/
|
|
541
|
+
method?: SourceMethod;
|
|
542
|
+
/**
|
|
543
|
+
* References to where the content came from: a run and step, a work item,
|
|
544
|
+
* a message, a URL. At most 20.
|
|
545
|
+
*/
|
|
546
|
+
references?: SourceRef[];
|
|
547
|
+
/** For an extracted record, the model id that extracted it. */
|
|
548
|
+
readonly model?: string;
|
|
549
|
+
/** For an extracted record, the extractor's confidence, 0 to 1. */
|
|
550
|
+
readonly confidence?: number;
|
|
551
|
+
}
|
|
552
|
+
/** The request of RecallEntities. */
|
|
553
|
+
export interface RecallEntitiesRequest {
|
|
554
|
+
/** The environment whose graph to search. */
|
|
555
|
+
parent: string;
|
|
556
|
+
/** What to recall, in natural language; 1 to 4000 characters. */
|
|
557
|
+
query: string;
|
|
558
|
+
/**
|
|
559
|
+
* The spaces to search, as resource names; default every space the caller
|
|
560
|
+
* may read. At most 50.
|
|
561
|
+
*/
|
|
562
|
+
spaces?: string[];
|
|
563
|
+
/** Only entities of these types; default every type. */
|
|
564
|
+
entityTypes?: string[];
|
|
565
|
+
/** Recall the graph as it was valid at this time; default now. */
|
|
566
|
+
validTime?: string;
|
|
567
|
+
/** How many hops to expand from the top entities, 0 to 2; default 2. */
|
|
568
|
+
maxHops?: number;
|
|
569
|
+
/** At most this many facts in the pack; default 30, clamped to 200. */
|
|
570
|
+
maxFacts?: number;
|
|
571
|
+
}
|
|
572
|
+
/** The response of RecallEntities. */
|
|
573
|
+
export interface RecallEntitiesResponse {
|
|
574
|
+
/** The context pack. */
|
|
575
|
+
context?: ContextPack;
|
|
576
|
+
}
|
|
577
|
+
/**
|
|
578
|
+
* A Relation is a fact: a typed, directed edge between two entities, or a
|
|
579
|
+
* value about one entity. Facts are bi-temporal: `valid_start_time` and
|
|
580
|
+
* `valid_end_time` say when it holds in the world, `create_time` and
|
|
581
|
+
* `supersede_time` when it was learned and replaced. A change closes the old
|
|
582
|
+
* fact; nothing is overwritten. Every fact cites at least one episode.
|
|
583
|
+
*/
|
|
584
|
+
export interface Relation {
|
|
585
|
+
/** `orgs/{org}/projects/{project}/envs/{env}/spaces/{space}/relations/{relation}`. */
|
|
586
|
+
name?: string;
|
|
587
|
+
/** `krel_<26 base32>`; never reused. */
|
|
588
|
+
readonly uid?: string;
|
|
589
|
+
/** Resource metadata. */
|
|
590
|
+
meta?: common.ResourceMeta;
|
|
591
|
+
/** The entity the fact is about. */
|
|
592
|
+
subject?: string;
|
|
593
|
+
/**
|
|
594
|
+
* The relation type, snake_case, for example `works_at` or `prefers`; a
|
|
595
|
+
* core predicate or one of an accepted Knowledge Schema.
|
|
596
|
+
*/
|
|
597
|
+
predicate?: string;
|
|
598
|
+
/** The other entity, for an edge. A fact has `object`, `value`, or both. */
|
|
599
|
+
object?: string;
|
|
600
|
+
/** The value, for a fact about one entity. */
|
|
601
|
+
value?: unknown;
|
|
602
|
+
/** The fact as one sentence, used for search and shown with citations. */
|
|
603
|
+
statement?: string;
|
|
604
|
+
/** When the fact starts to hold in the world; default when it was recorded. */
|
|
605
|
+
validStartTime?: string;
|
|
606
|
+
/** When the fact stopped holding in the world; unset while it holds. */
|
|
607
|
+
validEndTime?: string;
|
|
608
|
+
/**
|
|
609
|
+
* The episodes the fact comes from. A structured write with none records
|
|
610
|
+
* its own episode and cites it; an extracted fact cites the episodes it was
|
|
611
|
+
* read from.
|
|
612
|
+
*/
|
|
613
|
+
episodes?: string[];
|
|
614
|
+
/** Where it came from and who wrote it. */
|
|
615
|
+
readonly provenance?: Provenance;
|
|
616
|
+
/** The fact that replaced this one, once it is superseded. */
|
|
617
|
+
readonly successor?: string;
|
|
618
|
+
/** When the fact was recorded. */
|
|
619
|
+
readonly createTime?: string;
|
|
620
|
+
/** When the fact was replaced by a newer record; unset while current. */
|
|
621
|
+
readonly supersedeTime?: string;
|
|
622
|
+
}
|
|
623
|
+
/** A RelationTypeDefinition is one relation type of a schema. */
|
|
624
|
+
export interface RelationTypeDefinition {
|
|
625
|
+
/**
|
|
626
|
+
* The predicate within the schema, snake_case; relations name it
|
|
627
|
+
* `<schema>.<predicate>`.
|
|
628
|
+
*/
|
|
629
|
+
predicate?: string;
|
|
630
|
+
/** What the relation means; at most 1000 characters. */
|
|
631
|
+
description?: string;
|
|
632
|
+
/** The entity types the subject may have; empty is any. */
|
|
633
|
+
subjectTypes?: string[];
|
|
634
|
+
/** The entity types the object may have; empty is a value fact or any. */
|
|
635
|
+
objectTypes?: string[];
|
|
636
|
+
}
|
|
637
|
+
/** A SourceRef points at where a record's content came from. */
|
|
638
|
+
export interface SourceRef {
|
|
639
|
+
/** A URI: a URL, or a URN of a platform record such as a Workflows run step. */
|
|
640
|
+
uri?: string;
|
|
641
|
+
/** A short label to show with a citation. */
|
|
642
|
+
label?: string;
|
|
643
|
+
}
|
|
644
|
+
/**
|
|
645
|
+
* A Space is the permission container of the graph: a workspace, a project, a
|
|
646
|
+
* team, one end user's private space, one agent's private space. Every
|
|
647
|
+
* Episode and Relation lives in exactly one space, and a principal sees a
|
|
648
|
+
* record only through a space it may read. Read and write are the share
|
|
649
|
+
* relations `reader`, `writer` and `owner` on the space, inherited through
|
|
650
|
+
* `parent`.
|
|
651
|
+
*/
|
|
652
|
+
export interface Space {
|
|
653
|
+
/** `orgs/{org}/projects/{project}/envs/{env}/spaces/{space}`. */
|
|
654
|
+
name?: string;
|
|
655
|
+
/** `spc_<26 base32>`; never reused. */
|
|
656
|
+
readonly uid?: string;
|
|
657
|
+
/** Resource metadata. */
|
|
658
|
+
meta?: common.ResourceMeta;
|
|
659
|
+
/** Desired state. */
|
|
660
|
+
spec?: SpaceSpec;
|
|
661
|
+
/** Observed state. */
|
|
662
|
+
readonly status?: SpaceStatus;
|
|
663
|
+
}
|
|
664
|
+
/** A SpaceGrant is one share tuple on a space: `space:<id>#<role>@<subject>`. */
|
|
665
|
+
export interface SpaceGrant {
|
|
666
|
+
/** The role granted. */
|
|
667
|
+
role?: SpaceRole;
|
|
668
|
+
/**
|
|
669
|
+
* The share subject: `user:<id>`, `end_user:<id>`, `agent:<id>`, or a
|
|
670
|
+
* userset such as `workspace:<id>#member`.
|
|
671
|
+
*/
|
|
672
|
+
subject?: string;
|
|
673
|
+
}
|
|
674
|
+
/** SpaceSpec is the caller-writable state of a Space. */
|
|
675
|
+
export interface SpaceSpec {
|
|
676
|
+
/** What the space holds. */
|
|
677
|
+
kind?: SpaceKind;
|
|
678
|
+
/**
|
|
679
|
+
* The space this one inherits grants from, for example a project space
|
|
680
|
+
* under its workspace space. A reader of the parent reads this space.
|
|
681
|
+
*/
|
|
682
|
+
parent?: string;
|
|
683
|
+
/**
|
|
684
|
+
* The principal a private space belongs to, as a share subject:
|
|
685
|
+
* `end_user:<id>` for `SPACE_KIND_END_USER`, `agent:<id>` or
|
|
686
|
+
* `agent:<id>/end_user:<id>` for `SPACE_KIND_AGENT`. Empty for a shared
|
|
687
|
+
* space. The owner is granted `owner` on the space.
|
|
688
|
+
*/
|
|
689
|
+
owner?: string;
|
|
690
|
+
/**
|
|
691
|
+
* Who may read and write the space, beyond `owner` and what `parent`
|
|
692
|
+
* grants; at most 200. A repeated grant is stored once.
|
|
693
|
+
*/
|
|
694
|
+
grants?: SpaceGrant[];
|
|
695
|
+
/**
|
|
696
|
+
* The space holds customer personal data. Its records are never sent in
|
|
697
|
+
* embeddings outside the cell's model routes, and enter a context pack or
|
|
698
|
+
* an answer that spans spaces only for a reader that holds `reader` on
|
|
699
|
+
* this space directly. Only deterministic entity matches apply to it.
|
|
700
|
+
*/
|
|
701
|
+
sensitive?: boolean;
|
|
702
|
+
/**
|
|
703
|
+
* The Knowledge Schemas whose types the space accepts, as resource names;
|
|
704
|
+
* the core schema is always accepted. At most 20.
|
|
705
|
+
*/
|
|
706
|
+
schemas?: string[];
|
|
707
|
+
}
|
|
708
|
+
/** SpaceStatus is the observed state of a Space. */
|
|
709
|
+
export interface SpaceStatus {
|
|
710
|
+
/** The generation this status was computed from. */
|
|
711
|
+
readonly observedGeneration?: string;
|
|
712
|
+
/** Ready, Reconciling, Stalled. */
|
|
713
|
+
readonly conditions?: common.Condition[];
|
|
714
|
+
/** The number of episodes in the space. */
|
|
715
|
+
readonly episodeCount?: string;
|
|
716
|
+
/** The number of current facts in the space. */
|
|
717
|
+
readonly factCount?: string;
|
|
718
|
+
/** When a record of the space was last written. */
|
|
719
|
+
readonly lastWriteTime?: string;
|
|
720
|
+
}
|
|
721
|
+
/** The request of SplitEntity. */
|
|
722
|
+
export interface SplitEntityRequest {
|
|
723
|
+
/** The entity a merge folded the other into. */
|
|
724
|
+
name: string;
|
|
725
|
+
/** The merged entity to restore. */
|
|
726
|
+
entity: string;
|
|
727
|
+
}
|
|
728
|
+
/** The response of SplitEntity. */
|
|
729
|
+
export interface SplitEntityResponse {
|
|
730
|
+
/** The entity that was merged into, after the split. */
|
|
731
|
+
survivor?: Entity;
|
|
732
|
+
/** The restored entity. */
|
|
733
|
+
restored?: Entity;
|
|
734
|
+
}
|
|
735
|
+
/** The request of UpdateEntity. */
|
|
736
|
+
export interface UpdateEntityRequest {
|
|
737
|
+
/** The entity to update; `name` identifies it. */
|
|
738
|
+
entity: Entity;
|
|
739
|
+
/** The fields to write; unset writes every populated field. */
|
|
740
|
+
updateMask?: string;
|
|
741
|
+
/**
|
|
742
|
+
* Create the entity when no entity matches (`upsert_entity`): the name, or
|
|
743
|
+
* else `external_ids`, identifies it.
|
|
744
|
+
*/
|
|
745
|
+
allowMissing?: boolean;
|
|
746
|
+
/** Validate and return the result without writing anything. */
|
|
747
|
+
validateOnly?: boolean;
|
|
748
|
+
}
|
|
749
|
+
/** The request of UpdateKnowledgeSchema. */
|
|
750
|
+
export interface UpdateKnowledgeSchemaRequest {
|
|
751
|
+
/** The knowledge schema to update; `name` identifies it. */
|
|
752
|
+
knowledgeSchema: KnowledgeSchema;
|
|
753
|
+
/** The fields to write; unset writes every populated field. */
|
|
754
|
+
updateMask?: string;
|
|
755
|
+
/** Create the knowledge schema when it does not exist (declarative upsert). */
|
|
756
|
+
allowMissing?: boolean;
|
|
757
|
+
/** Validate and return the result without writing anything. */
|
|
758
|
+
validateOnly?: boolean;
|
|
759
|
+
}
|
|
760
|
+
/** The request of UpdateSpace. */
|
|
761
|
+
export interface UpdateSpaceRequest {
|
|
762
|
+
/** The space to update; `name` identifies it. */
|
|
763
|
+
space: Space;
|
|
764
|
+
/** The fields to write; unset writes every populated field. */
|
|
765
|
+
updateMask?: string;
|
|
766
|
+
/** Create the space when it does not exist (declarative upsert). */
|
|
767
|
+
allowMissing?: boolean;
|
|
768
|
+
/** Validate and return the result without writing anything. */
|
|
769
|
+
validateOnly?: boolean;
|
|
770
|
+
}
|
|
771
|
+
/** Channel is the path a write took. */
|
|
772
|
+
export type Channel = 'api' | 'tool' | 'import' | 'extraction' | (string & {});
|
|
773
|
+
/** EntityLifecycle is whether an entity stands on its own. */
|
|
774
|
+
export type EntityLifecycle = 'active' | 'merged' | (string & {});
|
|
775
|
+
/** EpisodeKind is what an episode is. */
|
|
776
|
+
export type EpisodeKind = 'note' | 'message' | 'step_result' | 'document_chunk' | 'imported_row' | 'structured' | (string & {});
|
|
777
|
+
/** Extraction is where reading an episode for entities and relations stands. */
|
|
778
|
+
export type Extraction = 'pending' | 'done' | 'failed' | 'skipped' | (string & {});
|
|
779
|
+
/** SourceMethod is how a record's content was produced. */
|
|
780
|
+
export type SourceMethod = 'stated' | 'extracted' | 'imported' | (string & {});
|
|
781
|
+
/** SpaceKind is what a space holds. */
|
|
782
|
+
export type SpaceKind = 'workspace' | 'project' | 'team' | 'end_user' | 'agent' | 'shared' | (string & {});
|
|
783
|
+
/** SpaceRole is a share relation on a space. */
|
|
784
|
+
export type SpaceRole = 'reader' | 'writer' | 'owner' | (string & {});
|
|
785
|
+
/**
|
|
786
|
+
* KnowledgeService is Sylphx Knowledge: one permission-aware knowledge graph
|
|
787
|
+
* that people, apps and agents write while they work and read through search
|
|
788
|
+
* with citations. Episodes are the sources; entities and relations (facts)
|
|
789
|
+
* are what is known, each with provenance and valid and recorded time.
|
|
790
|
+
* Every record lives in one Space, and a caller sees a record only through a
|
|
791
|
+
* space it may read, so a context pack or an answer never cites a source the
|
|
792
|
+
* caller cannot open.
|
|
793
|
+
*
|
|
794
|
+
* Namespace of Sylphx Knowledge on `Sylphx`.
|
|
795
|
+
*/
|
|
796
|
+
export declare class KnowledgeApi {
|
|
797
|
+
private readonly client;
|
|
798
|
+
/** The `spaces` collection. */
|
|
799
|
+
readonly spaces: SpacesCollection;
|
|
800
|
+
/** The `knowledge_schemas` collection. */
|
|
801
|
+
readonly knowledgeSchemas: KnowledgeSchemasCollection;
|
|
802
|
+
/** The `episodes` collection. */
|
|
803
|
+
readonly episodes: EpisodesCollection;
|
|
804
|
+
/** The `entities` collection. */
|
|
805
|
+
readonly entities: EntitiesCollection;
|
|
806
|
+
/** The `relations` collection. */
|
|
807
|
+
readonly relations: RelationsCollection;
|
|
808
|
+
constructor(client: runtime.Client);
|
|
809
|
+
/**
|
|
810
|
+
* Records an episode and returns at once (`remember`); extraction reads
|
|
811
|
+
* it afterwards.
|
|
812
|
+
*
|
|
813
|
+
* `POST /v1/{parent=orgs/*\/projects/*\/envs/*\/spaces/*}/episodes` · permission `knowledge:write` · effect `write`
|
|
814
|
+
*
|
|
815
|
+
* Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `UNKNOWN_FIELD`, `INVALID_FIELD`, `RESOURCE_ALREADY_EXISTS`, `RATE_LIMITED`, `SPEND_LIMIT_REACHED`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
|
|
816
|
+
*
|
|
817
|
+
* Short name of `sx.knowledge.episodes.create`.
|
|
818
|
+
*/
|
|
819
|
+
remember(request: CreateEpisodeRequest): Promise<Episode>;
|
|
820
|
+
/**
|
|
821
|
+
* Returns one entity's profile in one call (`entity`): the entity, its
|
|
822
|
+
* current facts in both directions, the entities they name and the recent
|
|
823
|
+
* episodes about it, trimmed to what the caller may see. A read with a
|
|
824
|
+
* request body.
|
|
825
|
+
*
|
|
826
|
+
* `POST /v1/{name=orgs/*\/projects/*\/envs/*\/entities/*}:profile` · permission `knowledge:read` · effect `read`
|
|
827
|
+
*
|
|
828
|
+
* Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `INVALID_FIELD`.
|
|
829
|
+
*
|
|
830
|
+
* Short name of `sx.knowledge.entities.profile`.
|
|
831
|
+
*/
|
|
832
|
+
entity(request: ProfileEntityRequest): Promise<ProfileEntityResponse>;
|
|
833
|
+
/**
|
|
834
|
+
* Searches the graph (`recall`): hybrid lexical and semantic search over
|
|
835
|
+
* episodes and facts, fused by reciprocal rank, then at most two hops of
|
|
836
|
+
* expansion from the top entities. Returns a context pack with citations,
|
|
837
|
+
* built only from records the caller may see.
|
|
838
|
+
*
|
|
839
|
+
* `POST /v1/{parent=orgs/*\/projects/*\/envs/*}/entities:recall` · permission `knowledge:read` · effect `read`
|
|
840
|
+
*
|
|
841
|
+
* Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `RATE_LIMITED`.
|
|
842
|
+
*
|
|
843
|
+
* Short name of `sx.knowledge.entities.recall`.
|
|
844
|
+
*/
|
|
845
|
+
recall(request: RecallEntitiesRequest): Promise<RecallEntitiesResponse>;
|
|
846
|
+
/**
|
|
847
|
+
* Answers a question through Sylphx AI (`ask`), from a context pack built
|
|
848
|
+
* only from records the caller may see, with citations to its episodes.
|
|
849
|
+
*
|
|
850
|
+
* `POST /v1/{parent=orgs/*\/projects/*\/envs/*}/entities:ask` · permission `knowledge:read` · effect `read`
|
|
851
|
+
*
|
|
852
|
+
* Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `RATE_LIMITED`, `SPEND_LIMIT_REACHED`.
|
|
853
|
+
*
|
|
854
|
+
* Short name of `sx.knowledge.entities.ask`.
|
|
855
|
+
*/
|
|
856
|
+
ask(request: AskEntitiesRequest): Promise<AskEntitiesResponse>;
|
|
857
|
+
/**
|
|
858
|
+
* Records a fact in a space (`relate`). A fact that contradicts a current
|
|
859
|
+
* one with the same subject and a single-valued predicate closes the older
|
|
860
|
+
* fact; nothing is overwritten.
|
|
861
|
+
*
|
|
862
|
+
* `POST /v1/{parent=orgs/*\/projects/*\/envs/*\/spaces/*}/relations` · permission `knowledge:write` · effect `write`
|
|
863
|
+
*
|
|
864
|
+
* Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `UNKNOWN_FIELD`, `INVALID_FIELD`, `RESOURCE_ALREADY_EXISTS`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
|
|
865
|
+
*
|
|
866
|
+
* Short name of `sx.knowledge.relations.create`.
|
|
867
|
+
*/
|
|
868
|
+
relate(request: CreateRelationRequest): Promise<Relation>;
|
|
869
|
+
/**
|
|
870
|
+
* Closes a fact (`close_fact`): it stopped holding in the world at
|
|
871
|
+
* `valid_end_time`. The fact stays readable for questions about the time
|
|
872
|
+
* before the close.
|
|
873
|
+
*
|
|
874
|
+
* `POST /v1/{name=orgs/*\/projects/*\/envs/*\/spaces/*\/relations/*}:close` · permission `knowledge:write` · effect `write`
|
|
875
|
+
*
|
|
876
|
+
* Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `INVALID_FIELD`, `INVALID_STATE`, `ETAG_MISMATCH`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
|
|
877
|
+
*
|
|
878
|
+
* Short name of `sx.knowledge.relations.close`.
|
|
879
|
+
*/
|
|
880
|
+
closeFact(request: CloseRelationRequest): Promise<Relation>;
|
|
881
|
+
}
|
|
882
|
+
/** `spaces` of Sylphx Knowledge: Resource type `knowledge.sylphx.com/Space`. */
|
|
883
|
+
export declare class SpacesCollection {
|
|
884
|
+
private readonly client;
|
|
885
|
+
constructor(client: runtime.Client);
|
|
886
|
+
/**
|
|
887
|
+
* Gets a space.
|
|
888
|
+
*
|
|
889
|
+
* `GET /v1/{name=orgs/*\/projects/*\/envs/*\/spaces/*}` · permission `knowledge:read` · effect `read`
|
|
890
|
+
*
|
|
891
|
+
* Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`.
|
|
892
|
+
*/
|
|
893
|
+
get(request: GetSpaceRequest): Promise<Space>;
|
|
894
|
+
/**
|
|
895
|
+
* Lists spaces.
|
|
896
|
+
*
|
|
897
|
+
* `GET /v1/{parent=orgs/*\/projects/*\/envs/*}/spaces` · permission `knowledge:read` · effect `read`
|
|
898
|
+
*
|
|
899
|
+
* Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `PAGE_TOKEN_MISMATCH`.
|
|
900
|
+
*/
|
|
901
|
+
list(request: ListSpacesRequest): Promise<ListSpacesResponse>;
|
|
902
|
+
/** Every item of every page of `list`. */
|
|
903
|
+
listAll(request: ListSpacesRequest): AsyncGenerator<Space>;
|
|
904
|
+
/**
|
|
905
|
+
* Creates a space.
|
|
906
|
+
*
|
|
907
|
+
* `POST /v1/{parent=orgs/*\/projects/*\/envs/*}/spaces` · permission `knowledge:write` · effect `write`
|
|
908
|
+
*
|
|
909
|
+
* Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `UNKNOWN_FIELD`, `INVALID_FIELD`, `RESOURCE_ALREADY_EXISTS`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`, `PLAN_LIMIT_REACHED`.
|
|
910
|
+
*/
|
|
911
|
+
create(request: CreateSpaceRequest): Promise<Space>;
|
|
912
|
+
/**
|
|
913
|
+
* Updates a space.
|
|
914
|
+
*
|
|
915
|
+
* `PATCH /v1/{space.name=orgs/*\/projects/*\/envs/*\/spaces/*}` · permission `knowledge:write` · effect `write`
|
|
916
|
+
*
|
|
917
|
+
* Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `UNKNOWN_FIELD`, `INVALID_FIELD`, `ETAG_MISMATCH`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
|
|
918
|
+
*/
|
|
919
|
+
update(request: UpdateSpaceRequest): Promise<Space>;
|
|
920
|
+
/**
|
|
921
|
+
* Deletes a space. A space that still holds records is refused with
|
|
922
|
+
* `INVALID_STATE` unless `force` is set, which deletes its episodes and
|
|
923
|
+
* facts too.
|
|
924
|
+
*
|
|
925
|
+
* `DELETE /v1/{name=orgs/*\/projects/*\/envs/*\/spaces/*}` · permission `knowledge:write` · effect `destructive`
|
|
926
|
+
*
|
|
927
|
+
* Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `INVALID_STATE`, `ETAG_MISMATCH`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
|
|
928
|
+
*/
|
|
929
|
+
delete(request: DeleteSpaceRequest): Promise<Record<string, never>>;
|
|
930
|
+
}
|
|
931
|
+
/** `knowledge_schemas` of Sylphx Knowledge: Resource type `knowledge.sylphx.com/KnowledgeSchema`. */
|
|
932
|
+
export declare class KnowledgeSchemasCollection {
|
|
933
|
+
private readonly client;
|
|
934
|
+
constructor(client: runtime.Client);
|
|
935
|
+
/**
|
|
936
|
+
* Gets a knowledge schema.
|
|
937
|
+
*
|
|
938
|
+
* `GET /v1/{name=orgs/*\/projects/*\/envs/*\/knowledge_schemas/*}` · permission `knowledge:read` · effect `read`
|
|
939
|
+
*
|
|
940
|
+
* Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`.
|
|
941
|
+
*/
|
|
942
|
+
get(request: GetKnowledgeSchemaRequest): Promise<KnowledgeSchema>;
|
|
943
|
+
/**
|
|
944
|
+
* Lists knowledge schemas.
|
|
945
|
+
*
|
|
946
|
+
* `GET /v1/{parent=orgs/*\/projects/*\/envs/*}/knowledge_schemas` · permission `knowledge:read` · effect `read`
|
|
947
|
+
*
|
|
948
|
+
* Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `PAGE_TOKEN_MISMATCH`.
|
|
949
|
+
*/
|
|
950
|
+
list(request: ListKnowledgeSchemasRequest): Promise<ListKnowledgeSchemasResponse>;
|
|
951
|
+
/** Every item of every page of `list`. */
|
|
952
|
+
listAll(request: ListKnowledgeSchemasRequest): AsyncGenerator<KnowledgeSchema>;
|
|
953
|
+
/**
|
|
954
|
+
* Creates a knowledge schema.
|
|
955
|
+
*
|
|
956
|
+
* `POST /v1/{parent=orgs/*\/projects/*\/envs/*}/knowledge_schemas` · permission `knowledge:write` · effect `write`
|
|
957
|
+
*
|
|
958
|
+
* Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `UNKNOWN_FIELD`, `INVALID_FIELD`, `RESOURCE_ALREADY_EXISTS`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`, `PLAN_LIMIT_REACHED`.
|
|
959
|
+
*/
|
|
960
|
+
create(request: CreateKnowledgeSchemaRequest): Promise<KnowledgeSchema>;
|
|
961
|
+
/**
|
|
962
|
+
* Updates a knowledge schema. An accepted update publishes a new
|
|
963
|
+
* revision; a change that would invalidate existing records is refused
|
|
964
|
+
* with `INVALID_FIELD`.
|
|
965
|
+
*
|
|
966
|
+
* `PATCH /v1/{knowledge_schema.name=orgs/*\/projects/*\/envs/*\/knowledge_schemas/*}` · permission `knowledge:write` · effect `write`
|
|
967
|
+
*
|
|
968
|
+
* Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `UNKNOWN_FIELD`, `INVALID_FIELD`, `ETAG_MISMATCH`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
|
|
969
|
+
*/
|
|
970
|
+
update(request: UpdateKnowledgeSchemaRequest): Promise<KnowledgeSchema>;
|
|
971
|
+
/**
|
|
972
|
+
* Deletes a knowledge schema. A schema a space still accepts is refused
|
|
973
|
+
* with `RESOURCE_IN_USE`.
|
|
974
|
+
*
|
|
975
|
+
* `DELETE /v1/{name=orgs/*\/projects/*\/envs/*\/knowledge_schemas/*}` · permission `knowledge:write` · effect `destructive`
|
|
976
|
+
*
|
|
977
|
+
* Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `RESOURCE_IN_USE`, `ETAG_MISMATCH`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
|
|
978
|
+
*/
|
|
979
|
+
delete(request: DeleteKnowledgeSchemaRequest): Promise<Record<string, never>>;
|
|
980
|
+
}
|
|
981
|
+
/** `episodes` of Sylphx Knowledge: Resource type `knowledge.sylphx.com/Episode`. */
|
|
982
|
+
export declare class EpisodesCollection {
|
|
983
|
+
private readonly client;
|
|
984
|
+
constructor(client: runtime.Client);
|
|
985
|
+
/**
|
|
986
|
+
* Gets an episode.
|
|
987
|
+
*
|
|
988
|
+
* `GET /v1/{name=orgs/*\/projects/*\/envs/*\/spaces/*\/episodes/*}` · permission `knowledge:read` · effect `read`
|
|
989
|
+
*
|
|
990
|
+
* Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`.
|
|
991
|
+
*/
|
|
992
|
+
get(request: GetEpisodeRequest): Promise<Episode>;
|
|
993
|
+
/**
|
|
994
|
+
* Lists a space's episodes, newest first. The filter is limited to
|
|
995
|
+
* `kind` and `extraction`.
|
|
996
|
+
*
|
|
997
|
+
* `GET /v1/{parent=orgs/*\/projects/*\/envs/*\/spaces/*}/episodes` · permission `knowledge:read` · effect `read`
|
|
998
|
+
*
|
|
999
|
+
* Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `PAGE_TOKEN_MISMATCH`.
|
|
1000
|
+
*/
|
|
1001
|
+
list(request: ListEpisodesRequest): Promise<ListEpisodesResponse>;
|
|
1002
|
+
/** Every item of every page of `list`. */
|
|
1003
|
+
listAll(request: ListEpisodesRequest): AsyncGenerator<Episode>;
|
|
1004
|
+
/**
|
|
1005
|
+
* Records an episode and returns at once (`remember`); extraction reads
|
|
1006
|
+
* it afterwards.
|
|
1007
|
+
*
|
|
1008
|
+
* `POST /v1/{parent=orgs/*\/projects/*\/envs/*\/spaces/*}/episodes` · permission `knowledge:write` · effect `write`
|
|
1009
|
+
*
|
|
1010
|
+
* Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `UNKNOWN_FIELD`, `INVALID_FIELD`, `RESOURCE_ALREADY_EXISTS`, `RATE_LIMITED`, `SPEND_LIMIT_REACHED`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
|
|
1011
|
+
*
|
|
1012
|
+
* Also `sx.knowledge.remember`.
|
|
1013
|
+
*/
|
|
1014
|
+
create(request: CreateEpisodeRequest): Promise<Episode>;
|
|
1015
|
+
/**
|
|
1016
|
+
* Deletes an episode, the facts that cite only it, and its search and
|
|
1017
|
+
* embedding entries; facts that also cite other episodes are re-scored.
|
|
1018
|
+
*
|
|
1019
|
+
* `DELETE /v1/{name=orgs/*\/projects/*\/envs/*\/spaces/*\/episodes/*}` · permission `knowledge:write` · effect `destructive`
|
|
1020
|
+
*
|
|
1021
|
+
* Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `ETAG_MISMATCH`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
|
|
1022
|
+
*/
|
|
1023
|
+
delete(request: DeleteEpisodeRequest): Promise<Record<string, never>>;
|
|
1024
|
+
}
|
|
1025
|
+
/** `entities` of Sylphx Knowledge: Resource type `knowledge.sylphx.com/Entity`. */
|
|
1026
|
+
export declare class EntitiesCollection {
|
|
1027
|
+
private readonly client;
|
|
1028
|
+
constructor(client: runtime.Client);
|
|
1029
|
+
/**
|
|
1030
|
+
* Gets an entity.
|
|
1031
|
+
*
|
|
1032
|
+
* `GET /v1/{name=orgs/*\/projects/*\/envs/*\/entities/*}` · permission `knowledge:read` · effect `read`
|
|
1033
|
+
*
|
|
1034
|
+
* Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`.
|
|
1035
|
+
*/
|
|
1036
|
+
get(request: GetEntityRequest): Promise<Entity>;
|
|
1037
|
+
/**
|
|
1038
|
+
* Lists the entities the caller may see. The filter is limited to
|
|
1039
|
+
* `entity_type` and `lifecycle`.
|
|
1040
|
+
*
|
|
1041
|
+
* `GET /v1/{parent=orgs/*\/projects/*\/envs/*}/entities` · permission `knowledge:read` · effect `read`
|
|
1042
|
+
*
|
|
1043
|
+
* Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `PAGE_TOKEN_MISMATCH`.
|
|
1044
|
+
*/
|
|
1045
|
+
list(request: ListEntitiesRequest): Promise<ListEntitiesResponse>;
|
|
1046
|
+
/** Every item of every page of `list`. */
|
|
1047
|
+
listAll(request: ListEntitiesRequest): AsyncGenerator<Entity>;
|
|
1048
|
+
/**
|
|
1049
|
+
* Creates an entity in a space. An entity whose external id already
|
|
1050
|
+
* names one in the graph is refused with `RESOURCE_ALREADY_EXISTS`, which
|
|
1051
|
+
* names it; use Update with `allow_missing` to upsert.
|
|
1052
|
+
*
|
|
1053
|
+
* `POST /v1/{parent=orgs/*\/projects/*\/envs/*}/entities` · permission `knowledge:write` · effect `write`
|
|
1054
|
+
*
|
|
1055
|
+
* Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `UNKNOWN_FIELD`, `INVALID_FIELD`, `RESOURCE_ALREADY_EXISTS`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
|
|
1056
|
+
*/
|
|
1057
|
+
create(request: CreateEntityRequest): Promise<Entity>;
|
|
1058
|
+
/**
|
|
1059
|
+
* Updates an entity. With `allow_missing` it is the structured upsert
|
|
1060
|
+
* (`upsert_entity`): an entity matched by `external_ids` is updated,
|
|
1061
|
+
* otherwise one is created.
|
|
1062
|
+
*
|
|
1063
|
+
* `PATCH /v1/{entity.name=orgs/*\/projects/*\/envs/*\/entities/*}` · permission `knowledge:write` · effect `write`
|
|
1064
|
+
*
|
|
1065
|
+
* Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `UNKNOWN_FIELD`, `INVALID_FIELD`, `ETAG_MISMATCH`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
|
|
1066
|
+
*/
|
|
1067
|
+
update(request: UpdateEntityRequest): Promise<Entity>;
|
|
1068
|
+
/**
|
|
1069
|
+
* Deletes an entity and every fact about it. With `force` it is a
|
|
1070
|
+
* data-rights erasure: the episodes the person wrote are deleted too, with
|
|
1071
|
+
* their search and embedding entries.
|
|
1072
|
+
*
|
|
1073
|
+
* `DELETE /v1/{name=orgs/*\/projects/*\/envs/*\/entities/*}` · permission `knowledge:write` · effect `destructive`
|
|
1074
|
+
*
|
|
1075
|
+
* Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `ETAG_MISMATCH`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
|
|
1076
|
+
*/
|
|
1077
|
+
delete(request: DeleteEntityRequest): Promise<Record<string, never>>;
|
|
1078
|
+
/**
|
|
1079
|
+
* Merges other entities into this one: their facts and external ids
|
|
1080
|
+
* resolve to it. The merge is recorded and reversible with `:split`; it is
|
|
1081
|
+
* never a silent rewrite.
|
|
1082
|
+
*
|
|
1083
|
+
* `POST /v1/{name=orgs/*\/projects/*\/envs/*\/entities/*}:merge` · permission `knowledge:write` · effect `write`
|
|
1084
|
+
*
|
|
1085
|
+
* Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `INVALID_FIELD`, `INVALID_STATE`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
|
|
1086
|
+
*/
|
|
1087
|
+
merge(request: MergeEntityRequest): Promise<Entity>;
|
|
1088
|
+
/**
|
|
1089
|
+
* Splits a merged entity back out of this one, with the facts and
|
|
1090
|
+
* external ids it brought.
|
|
1091
|
+
*
|
|
1092
|
+
* `POST /v1/{name=orgs/*\/projects/*\/envs/*\/entities/*}:split` · permission `knowledge:write` · effect `write`
|
|
1093
|
+
*
|
|
1094
|
+
* Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `INVALID_FIELD`, `INVALID_STATE`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
|
|
1095
|
+
*/
|
|
1096
|
+
split(request: SplitEntityRequest): Promise<SplitEntityResponse>;
|
|
1097
|
+
/**
|
|
1098
|
+
* Returns one entity's profile in one call (`entity`): the entity, its
|
|
1099
|
+
* current facts in both directions, the entities they name and the recent
|
|
1100
|
+
* episodes about it, trimmed to what the caller may see. A read with a
|
|
1101
|
+
* request body.
|
|
1102
|
+
*
|
|
1103
|
+
* `POST /v1/{name=orgs/*\/projects/*\/envs/*\/entities/*}:profile` · permission `knowledge:read` · effect `read`
|
|
1104
|
+
*
|
|
1105
|
+
* Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `INVALID_FIELD`.
|
|
1106
|
+
*
|
|
1107
|
+
* Also `sx.knowledge.entity`.
|
|
1108
|
+
*/
|
|
1109
|
+
profile(request: ProfileEntityRequest): Promise<ProfileEntityResponse>;
|
|
1110
|
+
/**
|
|
1111
|
+
* Searches the graph (`recall`): hybrid lexical and semantic search over
|
|
1112
|
+
* episodes and facts, fused by reciprocal rank, then at most two hops of
|
|
1113
|
+
* expansion from the top entities. Returns a context pack with citations,
|
|
1114
|
+
* built only from records the caller may see.
|
|
1115
|
+
*
|
|
1116
|
+
* `POST /v1/{parent=orgs/*\/projects/*\/envs/*}/entities:recall` · permission `knowledge:read` · effect `read`
|
|
1117
|
+
*
|
|
1118
|
+
* Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `RATE_LIMITED`.
|
|
1119
|
+
*
|
|
1120
|
+
* Also `sx.knowledge.recall`.
|
|
1121
|
+
*/
|
|
1122
|
+
recall(request: RecallEntitiesRequest): Promise<RecallEntitiesResponse>;
|
|
1123
|
+
/**
|
|
1124
|
+
* Answers a question through Sylphx AI (`ask`), from a context pack built
|
|
1125
|
+
* only from records the caller may see, with citations to its episodes.
|
|
1126
|
+
*
|
|
1127
|
+
* `POST /v1/{parent=orgs/*\/projects/*\/envs/*}/entities:ask` · permission `knowledge:read` · effect `read`
|
|
1128
|
+
*
|
|
1129
|
+
* Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `RATE_LIMITED`, `SPEND_LIMIT_REACHED`.
|
|
1130
|
+
*
|
|
1131
|
+
* Also `sx.knowledge.ask`.
|
|
1132
|
+
*/
|
|
1133
|
+
ask(request: AskEntitiesRequest): Promise<AskEntitiesResponse>;
|
|
1134
|
+
}
|
|
1135
|
+
/** `relations` of Sylphx Knowledge: Resource type `knowledge.sylphx.com/Relation`. */
|
|
1136
|
+
export declare class RelationsCollection {
|
|
1137
|
+
private readonly client;
|
|
1138
|
+
constructor(client: runtime.Client);
|
|
1139
|
+
/**
|
|
1140
|
+
* Gets a relation.
|
|
1141
|
+
*
|
|
1142
|
+
* `GET /v1/{name=orgs/*\/projects/*\/envs/*\/spaces/*\/relations/*}` · permission `knowledge:read` · effect `read`
|
|
1143
|
+
*
|
|
1144
|
+
* Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`.
|
|
1145
|
+
*/
|
|
1146
|
+
get(request: GetRelationRequest): Promise<Relation>;
|
|
1147
|
+
/**
|
|
1148
|
+
* Lists a space's facts. The filter is limited to `subject`, `predicate`,
|
|
1149
|
+
* `object` and `provenance.channel`; superseded facts are listed only with
|
|
1150
|
+
* `show_superseded`.
|
|
1151
|
+
*
|
|
1152
|
+
* `GET /v1/{parent=orgs/*\/projects/*\/envs/*\/spaces/*}/relations` · permission `knowledge:read` · effect `read`
|
|
1153
|
+
*
|
|
1154
|
+
* Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `PAGE_TOKEN_MISMATCH`.
|
|
1155
|
+
*/
|
|
1156
|
+
list(request: ListRelationsRequest): Promise<ListRelationsResponse>;
|
|
1157
|
+
/** Every item of every page of `list`. */
|
|
1158
|
+
listAll(request: ListRelationsRequest): AsyncGenerator<Relation>;
|
|
1159
|
+
/**
|
|
1160
|
+
* Records a fact in a space (`relate`). A fact that contradicts a current
|
|
1161
|
+
* one with the same subject and a single-valued predicate closes the older
|
|
1162
|
+
* fact; nothing is overwritten.
|
|
1163
|
+
*
|
|
1164
|
+
* `POST /v1/{parent=orgs/*\/projects/*\/envs/*\/spaces/*}/relations` · permission `knowledge:write` · effect `write`
|
|
1165
|
+
*
|
|
1166
|
+
* Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `UNKNOWN_FIELD`, `INVALID_FIELD`, `RESOURCE_ALREADY_EXISTS`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
|
|
1167
|
+
*
|
|
1168
|
+
* Also `sx.knowledge.relate`.
|
|
1169
|
+
*/
|
|
1170
|
+
create(request: CreateRelationRequest): Promise<Relation>;
|
|
1171
|
+
/**
|
|
1172
|
+
* Deletes a fact. Deletion is for data that must go; a fact that stopped
|
|
1173
|
+
* being true is closed with `:close`.
|
|
1174
|
+
*
|
|
1175
|
+
* `DELETE /v1/{name=orgs/*\/projects/*\/envs/*\/spaces/*\/relations/*}` · permission `knowledge:write` · effect `destructive`
|
|
1176
|
+
*
|
|
1177
|
+
* Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `ETAG_MISMATCH`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
|
|
1178
|
+
*/
|
|
1179
|
+
delete(request: DeleteRelationRequest): Promise<Record<string, never>>;
|
|
1180
|
+
/**
|
|
1181
|
+
* Closes a fact (`close_fact`): it stopped holding in the world at
|
|
1182
|
+
* `valid_end_time`. The fact stays readable for questions about the time
|
|
1183
|
+
* before the close.
|
|
1184
|
+
*
|
|
1185
|
+
* `POST /v1/{name=orgs/*\/projects/*\/envs/*\/spaces/*\/relations/*}:close` · permission `knowledge:write` · effect `write`
|
|
1186
|
+
*
|
|
1187
|
+
* Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `INVALID_FIELD`, `INVALID_STATE`, `ETAG_MISMATCH`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
|
|
1188
|
+
*
|
|
1189
|
+
* Also `sx.knowledge.closeFact`.
|
|
1190
|
+
*/
|
|
1191
|
+
close(request: CloseRelationRequest): Promise<Relation>;
|
|
1192
|
+
}
|