@sylphx/sdk 0.32.0 → 0.32.2

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