@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,1012 @@
1
+ // @generated by sylphx-gen. Do not edit.
2
+ // `sylphx.knowledge.v1`.
3
+ import * as runtime from './runtime.js';
4
+ import './common.js';
5
+ runtime.registerSchemas({
6
+ 'sylphx.knowledge.v1.AskEntitiesRequest': [
7
+ ['validTime', 'valid_time'],
8
+ ],
9
+ 'sylphx.knowledge.v1.AskEntitiesResponse': [
10
+ ['citations', 'citations', 'sylphx.knowledge.v1.Citation'],
11
+ ['context', 'context', 'sylphx.knowledge.v1.ContextPack'],
12
+ ],
13
+ 'sylphx.knowledge.v1.Citation': [
14
+ ['occurTime', 'occur_time'],
15
+ ['sources', 'sources', 'sylphx.knowledge.v1.ClaimSource'],
16
+ ],
17
+ 'sylphx.knowledge.v1.ClaimSource': [
18
+ ['source', 'source', 'sylphx.knowledge.v1.SourceRef'],
19
+ ['currentVersion', 'current_version'],
20
+ ['rereadRequired', 'reread_required'],
21
+ ],
22
+ 'sylphx.knowledge.v1.CloseRelationRequest': [
23
+ ['validEndTime', 'valid_end_time'],
24
+ ],
25
+ 'sylphx.knowledge.v1.ContextPack': [
26
+ ['entities', 'entities', 'sylphx.knowledge.v1.Entity'],
27
+ ['facts', 'facts', 'sylphx.knowledge.v1.Relation'],
28
+ ['citations', 'citations', 'sylphx.knowledge.v1.Citation'],
29
+ ['semanticUnavailable', 'semantic_unavailable'],
30
+ ],
31
+ 'sylphx.knowledge.v1.CreateEntityRequest': [
32
+ ['entityId', 'entity_id'],
33
+ ['entity', 'entity', 'sylphx.knowledge.v1.Entity'],
34
+ ['validateOnly', 'validate_only'],
35
+ ],
36
+ 'sylphx.knowledge.v1.CreateEpisodeRequest': [
37
+ ['episodeId', 'episode_id'],
38
+ ['episode', 'episode', 'sylphx.knowledge.v1.Episode'],
39
+ ['validateOnly', 'validate_only'],
40
+ ['skipExtraction', 'skip_extraction'],
41
+ ],
42
+ 'sylphx.knowledge.v1.CreateKnowledgeSchemaRequest': [
43
+ ['knowledgeSchemaId', 'knowledge_schema_id'],
44
+ ['knowledgeSchema', 'knowledge_schema', 'sylphx.knowledge.v1.KnowledgeSchema'],
45
+ ['validateOnly', 'validate_only'],
46
+ ],
47
+ 'sylphx.knowledge.v1.CreateRelationRequest': [
48
+ ['relationId', 'relation_id'],
49
+ ['relation', 'relation', 'sylphx.knowledge.v1.Relation'],
50
+ ['validateOnly', 'validate_only'],
51
+ ],
52
+ 'sylphx.knowledge.v1.CreateSpaceRequest': [
53
+ ['spaceId', 'space_id'],
54
+ ['space', 'space', 'sylphx.knowledge.v1.Space'],
55
+ ['validateOnly', 'validate_only'],
56
+ ],
57
+ 'sylphx.knowledge.v1.DeleteEntityRequest': [
58
+ ['allowMissing', 'allow_missing'],
59
+ ['validateOnly', 'validate_only'],
60
+ ],
61
+ 'sylphx.knowledge.v1.DeleteEpisodeRequest': [
62
+ ['allowMissing', 'allow_missing'],
63
+ ['validateOnly', 'validate_only'],
64
+ ],
65
+ 'sylphx.knowledge.v1.DeleteKnowledgeSchemaRequest': [
66
+ ['allowMissing', 'allow_missing'],
67
+ ['validateOnly', 'validate_only'],
68
+ ],
69
+ 'sylphx.knowledge.v1.DeleteRelationRequest': [
70
+ ['allowMissing', 'allow_missing'],
71
+ ['validateOnly', 'validate_only'],
72
+ ],
73
+ 'sylphx.knowledge.v1.DeleteSpaceRequest': [
74
+ ['allowMissing', 'allow_missing'],
75
+ ['validateOnly', 'validate_only'],
76
+ ],
77
+ 'sylphx.knowledge.v1.Entity': [
78
+ ['meta', 'meta', 'sylphx.common.v1.ResourceMeta'],
79
+ ['entityType', 'entity_type'],
80
+ ['properties', 'properties', undefined, 'json'],
81
+ ['externalIds', 'external_ids', 'sylphx.knowledge.v1.ExternalId'],
82
+ ['provenance', 'provenance', 'sylphx.knowledge.v1.Provenance'],
83
+ ['mergedEntities', 'merged_entities'],
84
+ ['createTime', 'create_time'],
85
+ ['updateTime', 'update_time'],
86
+ ],
87
+ 'sylphx.knowledge.v1.EntityTypeDefinition': [
88
+ ['typeId', 'type_id'],
89
+ ['propertiesSchema', 'properties_schema', undefined, 'json'],
90
+ ['matchKinds', 'match_kinds'],
91
+ ],
92
+ 'sylphx.knowledge.v1.Episode': [
93
+ ['meta', 'meta', 'sylphx.common.v1.ResourceMeta'],
94
+ ['data', 'data', undefined, 'json'],
95
+ ['occurTime', 'occur_time'],
96
+ ['provenance', 'provenance', 'sylphx.knowledge.v1.Provenance'],
97
+ ['createTime', 'create_time'],
98
+ ],
99
+ 'sylphx.knowledge.v1.ExternalId': [],
100
+ 'sylphx.knowledge.v1.GetEntityRequest': [],
101
+ 'sylphx.knowledge.v1.GetEpisodeRequest': [],
102
+ 'sylphx.knowledge.v1.GetKnowledgeSchemaRequest': [],
103
+ 'sylphx.knowledge.v1.GetRelationRequest': [],
104
+ 'sylphx.knowledge.v1.GetSpaceRequest': [],
105
+ 'sylphx.knowledge.v1.KnowledgeSchema': [
106
+ ['meta', 'meta', 'sylphx.common.v1.ResourceMeta'],
107
+ ['spec', 'spec', 'sylphx.knowledge.v1.KnowledgeSchemaSpec'],
108
+ ['status', 'status', 'sylphx.knowledge.v1.KnowledgeSchemaStatus'],
109
+ ],
110
+ 'sylphx.knowledge.v1.KnowledgeSchemaSpec': [
111
+ ['entityTypes', 'entity_types', 'sylphx.knowledge.v1.EntityTypeDefinition'],
112
+ ['relationTypes', 'relation_types', 'sylphx.knowledge.v1.RelationTypeDefinition'],
113
+ ],
114
+ 'sylphx.knowledge.v1.KnowledgeSchemaStatus': [
115
+ ['observedGeneration', 'observed_generation'],
116
+ ['conditions', 'conditions', 'sylphx.common.v1.Condition'],
117
+ ],
118
+ 'sylphx.knowledge.v1.ListEntitiesRequest': [
119
+ ['pageSize', 'page_size'],
120
+ ['pageToken', 'page_token'],
121
+ ],
122
+ 'sylphx.knowledge.v1.ListEntitiesResponse': [
123
+ ['entities', 'entities', 'sylphx.knowledge.v1.Entity'],
124
+ ['nextPageToken', 'next_page_token'],
125
+ ],
126
+ 'sylphx.knowledge.v1.ListEpisodesRequest': [
127
+ ['pageSize', 'page_size'],
128
+ ['pageToken', 'page_token'],
129
+ ],
130
+ 'sylphx.knowledge.v1.ListEpisodesResponse': [
131
+ ['episodes', 'episodes', 'sylphx.knowledge.v1.Episode'],
132
+ ['nextPageToken', 'next_page_token'],
133
+ ],
134
+ 'sylphx.knowledge.v1.ListKnowledgeSchemasRequest': [
135
+ ['pageSize', 'page_size'],
136
+ ['pageToken', 'page_token'],
137
+ ['orderBy', 'order_by'],
138
+ ],
139
+ 'sylphx.knowledge.v1.ListKnowledgeSchemasResponse': [
140
+ ['knowledgeSchemas', 'knowledge_schemas', 'sylphx.knowledge.v1.KnowledgeSchema'],
141
+ ['nextPageToken', 'next_page_token'],
142
+ ],
143
+ 'sylphx.knowledge.v1.ListRelationsRequest': [
144
+ ['pageSize', 'page_size'],
145
+ ['pageToken', 'page_token'],
146
+ ['validTime', 'valid_time'],
147
+ ['showSuperseded', 'show_superseded'],
148
+ ],
149
+ 'sylphx.knowledge.v1.ListRelationsResponse': [
150
+ ['relations', 'relations', 'sylphx.knowledge.v1.Relation'],
151
+ ['nextPageToken', 'next_page_token'],
152
+ ],
153
+ 'sylphx.knowledge.v1.ListSpacesRequest': [
154
+ ['pageSize', 'page_size'],
155
+ ['pageToken', 'page_token'],
156
+ ['orderBy', 'order_by'],
157
+ ],
158
+ 'sylphx.knowledge.v1.ListSpacesResponse': [
159
+ ['spaces', 'spaces', 'sylphx.knowledge.v1.Space'],
160
+ ['nextPageToken', 'next_page_token'],
161
+ ],
162
+ 'sylphx.knowledge.v1.MergeEntityRequest': [],
163
+ 'sylphx.knowledge.v1.ProfileEntityRequest': [
164
+ ['validTime', 'valid_time'],
165
+ ['maxEpisodes', 'max_episodes'],
166
+ ],
167
+ 'sylphx.knowledge.v1.ProfileEntityResponse': [
168
+ ['entity', 'entity', 'sylphx.knowledge.v1.Entity'],
169
+ ['facts', 'facts', 'sylphx.knowledge.v1.Relation'],
170
+ ['relatedEntities', 'related_entities', 'sylphx.knowledge.v1.Entity'],
171
+ ['recentEpisodes', 'recent_episodes', 'sylphx.knowledge.v1.Citation'],
172
+ ],
173
+ 'sylphx.knowledge.v1.Provenance': [
174
+ ['references', 'references', 'sylphx.knowledge.v1.SourceRef'],
175
+ ],
176
+ 'sylphx.knowledge.v1.RecallEntitiesRequest': [
177
+ ['entityTypes', 'entity_types'],
178
+ ['validTime', 'valid_time'],
179
+ ['maxHops', 'max_hops'],
180
+ ['maxFacts', 'max_facts'],
181
+ ],
182
+ 'sylphx.knowledge.v1.RecallEntitiesResponse': [
183
+ ['context', 'context', 'sylphx.knowledge.v1.ContextPack'],
184
+ ],
185
+ 'sylphx.knowledge.v1.Relation': [
186
+ ['meta', 'meta', 'sylphx.common.v1.ResourceMeta'],
187
+ ['value', 'value', undefined, 'json'],
188
+ ['validStartTime', 'valid_start_time'],
189
+ ['validEndTime', 'valid_end_time'],
190
+ ['provenance', 'provenance', 'sylphx.knowledge.v1.Provenance'],
191
+ ['createTime', 'create_time'],
192
+ ['supersedeTime', 'supersede_time'],
193
+ ['sources', 'sources', 'sylphx.knowledge.v1.ClaimSource'],
194
+ ],
195
+ 'sylphx.knowledge.v1.RelationTypeDefinition': [
196
+ ['subjectTypes', 'subject_types'],
197
+ ['objectTypes', 'object_types'],
198
+ ],
199
+ 'sylphx.knowledge.v1.SourceRef': [
200
+ ['pinnedVersion', 'pinned_version'],
201
+ ],
202
+ 'sylphx.knowledge.v1.Space': [
203
+ ['meta', 'meta', 'sylphx.common.v1.ResourceMeta'],
204
+ ['spec', 'spec', 'sylphx.knowledge.v1.SpaceSpec'],
205
+ ['status', 'status', 'sylphx.knowledge.v1.SpaceStatus'],
206
+ ],
207
+ 'sylphx.knowledge.v1.SpaceGrant': [],
208
+ 'sylphx.knowledge.v1.SpaceSpec': [
209
+ ['grants', 'grants', 'sylphx.knowledge.v1.SpaceGrant'],
210
+ ],
211
+ 'sylphx.knowledge.v1.SpaceStatus': [
212
+ ['observedGeneration', 'observed_generation'],
213
+ ['conditions', 'conditions', 'sylphx.common.v1.Condition'],
214
+ ['episodeCount', 'episode_count'],
215
+ ['factCount', 'fact_count'],
216
+ ['lastWriteTime', 'last_write_time'],
217
+ ],
218
+ 'sylphx.knowledge.v1.SplitEntityRequest': [],
219
+ 'sylphx.knowledge.v1.SplitEntityResponse': [
220
+ ['survivor', 'survivor', 'sylphx.knowledge.v1.Entity'],
221
+ ['restored', 'restored', 'sylphx.knowledge.v1.Entity'],
222
+ ],
223
+ 'sylphx.knowledge.v1.UpdateEntityRequest': [
224
+ ['entity', 'entity', 'sylphx.knowledge.v1.Entity'],
225
+ ['updateMask', 'update_mask'],
226
+ ['allowMissing', 'allow_missing'],
227
+ ['validateOnly', 'validate_only'],
228
+ ],
229
+ 'sylphx.knowledge.v1.UpdateKnowledgeSchemaRequest': [
230
+ ['knowledgeSchema', 'knowledge_schema', 'sylphx.knowledge.v1.KnowledgeSchema'],
231
+ ['updateMask', 'update_mask'],
232
+ ['allowMissing', 'allow_missing'],
233
+ ['validateOnly', 'validate_only'],
234
+ ],
235
+ 'sylphx.knowledge.v1.UpdateSpaceRequest': [
236
+ ['space', 'space', 'sylphx.knowledge.v1.Space'],
237
+ ['updateMask', 'update_mask'],
238
+ ['allowMissing', 'allow_missing'],
239
+ ['validateOnly', 'validate_only'],
240
+ ],
241
+ });
242
+ /**
243
+ * KnowledgeService is Sylphx Knowledge: one permission-aware knowledge graph
244
+ * that people, apps and agents write while they work and read through search
245
+ * with citations. Episodes are the sources; entities and relations (facts)
246
+ * are what is known, each with provenance and valid and recorded time.
247
+ * Every record lives in one Space, and a caller sees a record only through a
248
+ * space it may read, so a context pack or an answer never cites a source the
249
+ * caller cannot open.
250
+ *
251
+ * Namespace of Sylphx Knowledge on `Sylphx`.
252
+ */
253
+ export class KnowledgeApi {
254
+ client;
255
+ /** The `spaces` collection. */
256
+ spaces;
257
+ /** The `knowledge_schemas` collection. */
258
+ knowledgeSchemas;
259
+ /** The `episodes` collection. */
260
+ episodes;
261
+ /** The `entities` collection. */
262
+ entities;
263
+ /** The `relations` collection. */
264
+ relations;
265
+ constructor(client) {
266
+ this.client = client;
267
+ this.spaces = new SpacesCollection(client);
268
+ this.knowledgeSchemas = new KnowledgeSchemasCollection(client);
269
+ this.episodes = new EpisodesCollection(client);
270
+ this.entities = new EntitiesCollection(client);
271
+ this.relations = new RelationsCollection(client);
272
+ }
273
+ /**
274
+ * Records an episode and returns at once (`remember`); extraction reads
275
+ * it afterwards.
276
+ *
277
+ * `POST /v1/{parent=orgs/*\/projects/*\/envs/*\/spaces/*}/episodes` · permission `knowledge:write` · effect `write`
278
+ *
279
+ * 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`.
280
+ *
281
+ * Short name of `sx.knowledge.episodes.create`.
282
+ */
283
+ async remember(request) {
284
+ return this.client.call({
285
+ method: 'POST',
286
+ path: `/v1/${runtime.pathParam(request.parent, 'orgs/*/projects/*/envs/*/spaces/*', 'parent')}/episodes`,
287
+ query: { episode_id: request.episodeId, validate_only: request.validateOnly, skip_extraction: request.skipExtraction },
288
+ body: request.episode ?? {},
289
+ bodyType: 'sylphx.knowledge.v1.Episode',
290
+ responseType: 'sylphx.knowledge.v1.Episode',
291
+ mutation: true,
292
+ });
293
+ }
294
+ /**
295
+ * Returns one entity's profile in one call (`entity`): the entity, its
296
+ * current facts in both directions, the entities they name and the recent
297
+ * episodes about it, trimmed to what the caller may see. A read with a
298
+ * request body.
299
+ *
300
+ * `POST /v1/{name=orgs/*\/projects/*\/envs/*\/entities/*}:profile` · permission `knowledge:read` · effect `read`
301
+ *
302
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `INVALID_FIELD`.
303
+ *
304
+ * Short name of `sx.knowledge.entities.profile`.
305
+ */
306
+ async entity(request) {
307
+ return this.client.call({
308
+ method: 'POST',
309
+ path: `/v1/${runtime.pathParam(request.name, 'orgs/*/projects/*/envs/*/entities/*', 'name')}:profile`,
310
+ body: runtime.omit(request, ['name']),
311
+ bodyType: 'sylphx.knowledge.v1.ProfileEntityRequest',
312
+ responseType: 'sylphx.knowledge.v1.ProfileEntityResponse',
313
+ mutation: true,
314
+ });
315
+ }
316
+ /**
317
+ * Searches the graph (`recall`): hybrid lexical and semantic search over
318
+ * episodes and facts, fused by reciprocal rank, then at most two hops of
319
+ * expansion from the top entities. Returns a context pack with citations,
320
+ * built only from records the caller may see.
321
+ *
322
+ * `POST /v1/{parent=orgs/*\/projects/*\/envs/*}/entities:recall` · permission `knowledge:read` · effect `read`
323
+ *
324
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `RATE_LIMITED`, `INVALID_STATE`, `UNAVAILABLE`, `RESOURCE_NOT_FOUND`.
325
+ *
326
+ * Short name of `sx.knowledge.entities.recall`.
327
+ */
328
+ async recall(request) {
329
+ return this.client.call({
330
+ method: 'POST',
331
+ path: `/v1/${runtime.pathParam(request.parent, 'orgs/*/projects/*/envs/*', 'parent')}/entities:recall`,
332
+ body: runtime.omit(request, ['parent']),
333
+ bodyType: 'sylphx.knowledge.v1.RecallEntitiesRequest',
334
+ responseType: 'sylphx.knowledge.v1.RecallEntitiesResponse',
335
+ mutation: true,
336
+ });
337
+ }
338
+ /**
339
+ * Answers a question through Sylphx AI (`ask`), from a context pack built
340
+ * only from records the caller may see, with citations to its episodes.
341
+ *
342
+ * `POST /v1/{parent=orgs/*\/projects/*\/envs/*}/entities:ask` · permission `knowledge:read` · effect `read`
343
+ *
344
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `RATE_LIMITED`, `SPEND_LIMIT_REACHED`, `INVALID_STATE`, `UNAVAILABLE`, `RESOURCE_NOT_FOUND`.
345
+ *
346
+ * Short name of `sx.knowledge.entities.ask`.
347
+ */
348
+ async ask(request) {
349
+ return this.client.call({
350
+ method: 'POST',
351
+ path: `/v1/${runtime.pathParam(request.parent, 'orgs/*/projects/*/envs/*', 'parent')}/entities:ask`,
352
+ body: runtime.omit(request, ['parent']),
353
+ bodyType: 'sylphx.knowledge.v1.AskEntitiesRequest',
354
+ responseType: 'sylphx.knowledge.v1.AskEntitiesResponse',
355
+ mutation: true,
356
+ });
357
+ }
358
+ /**
359
+ * Records a fact in a space (`relate`). A fact that contradicts a current
360
+ * one with the same subject and a single-valued predicate closes the older
361
+ * fact; nothing is overwritten.
362
+ *
363
+ * `POST /v1/{parent=orgs/*\/projects/*\/envs/*\/spaces/*}/relations` · permission `knowledge:write` · effect `write`
364
+ *
365
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `UNKNOWN_FIELD`, `INVALID_FIELD`, `RESOURCE_ALREADY_EXISTS`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`, `INVALID_STATE`, `UNAVAILABLE`.
366
+ *
367
+ * Short name of `sx.knowledge.relations.create`.
368
+ */
369
+ async relate(request) {
370
+ return this.client.call({
371
+ method: 'POST',
372
+ path: `/v1/${runtime.pathParam(request.parent, 'orgs/*/projects/*/envs/*/spaces/*', 'parent')}/relations`,
373
+ query: { relation_id: request.relationId, validate_only: request.validateOnly },
374
+ body: request.relation ?? {},
375
+ bodyType: 'sylphx.knowledge.v1.Relation',
376
+ responseType: 'sylphx.knowledge.v1.Relation',
377
+ mutation: true,
378
+ });
379
+ }
380
+ /**
381
+ * Closes a fact (`close_fact`): it stopped holding in the world at
382
+ * `valid_end_time`. The fact stays readable for questions about the time
383
+ * before the close.
384
+ *
385
+ * `POST /v1/{name=orgs/*\/projects/*\/envs/*\/spaces/*\/relations/*}:close` · permission `knowledge:write` · effect `write`
386
+ *
387
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `INVALID_FIELD`, `INVALID_STATE`, `ETAG_MISMATCH`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
388
+ *
389
+ * Short name of `sx.knowledge.relations.close`.
390
+ */
391
+ async closeFact(request) {
392
+ return this.client.call({
393
+ method: 'POST',
394
+ path: `/v1/${runtime.pathParam(request.name, 'orgs/*/projects/*/envs/*/spaces/*/relations/*', 'name')}:close`,
395
+ body: runtime.omit(request, ['name']),
396
+ bodyType: 'sylphx.knowledge.v1.CloseRelationRequest',
397
+ responseType: 'sylphx.knowledge.v1.Relation',
398
+ mutation: true,
399
+ });
400
+ }
401
+ }
402
+ /** `spaces` of Sylphx Knowledge: Resource type `knowledge.sylphx.com/Space`. */
403
+ export class SpacesCollection {
404
+ client;
405
+ constructor(client) {
406
+ this.client = client;
407
+ }
408
+ /**
409
+ * Gets a space.
410
+ *
411
+ * `GET /v1/{name=orgs/*\/projects/*\/envs/*\/spaces/*}` · permission `knowledge:read` · effect `read`
412
+ *
413
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`.
414
+ */
415
+ async get(request) {
416
+ return this.client.call({
417
+ method: 'GET',
418
+ path: `/v1/${runtime.pathParam(request.name, 'orgs/*/projects/*/envs/*/spaces/*', 'name')}`,
419
+ responseType: 'sylphx.knowledge.v1.Space',
420
+ mutation: false,
421
+ });
422
+ }
423
+ /**
424
+ * Lists spaces.
425
+ *
426
+ * `GET /v1/{parent=orgs/*\/projects/*\/envs/*}/spaces` · permission `knowledge:read` · effect `read`
427
+ *
428
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `PAGE_TOKEN_MISMATCH`.
429
+ */
430
+ async list(request) {
431
+ return this.client.call({
432
+ method: 'GET',
433
+ path: `/v1/${runtime.pathParam(request.parent, 'orgs/*/projects/*/envs/*', 'parent')}/spaces`,
434
+ query: { page_size: request.pageSize, page_token: request.pageToken, filter: request.filter, order_by: request.orderBy },
435
+ responseType: 'sylphx.knowledge.v1.ListSpacesResponse',
436
+ mutation: false,
437
+ });
438
+ }
439
+ /** Every item of every page of `list`. */
440
+ async *listAll(request) {
441
+ let next = request;
442
+ for (;;) {
443
+ const page = await this.list(next);
444
+ yield* page.spaces ?? [];
445
+ if (page.nextPageToken === undefined || page.nextPageToken === '')
446
+ return;
447
+ next = { ...request, pageToken: page.nextPageToken };
448
+ }
449
+ }
450
+ /**
451
+ * Creates a space.
452
+ *
453
+ * `POST /v1/{parent=orgs/*\/projects/*\/envs/*}/spaces` · permission `knowledge:write` · effect `write`
454
+ *
455
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `UNKNOWN_FIELD`, `INVALID_FIELD`, `RESOURCE_ALREADY_EXISTS`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`, `PLAN_LIMIT_REACHED`.
456
+ */
457
+ async create(request) {
458
+ return this.client.call({
459
+ method: 'POST',
460
+ path: `/v1/${runtime.pathParam(request.parent, 'orgs/*/projects/*/envs/*', 'parent')}/spaces`,
461
+ query: { space_id: request.spaceId, validate_only: request.validateOnly },
462
+ body: request.space ?? {},
463
+ bodyType: 'sylphx.knowledge.v1.Space',
464
+ responseType: 'sylphx.knowledge.v1.Space',
465
+ mutation: true,
466
+ });
467
+ }
468
+ /**
469
+ * Updates a space.
470
+ *
471
+ * `PATCH /v1/{space.name=orgs/*\/projects/*\/envs/*\/spaces/*}` · permission `knowledge:write` · effect `write`
472
+ *
473
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `UNKNOWN_FIELD`, `INVALID_FIELD`, `ETAG_MISMATCH`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
474
+ */
475
+ async update(request) {
476
+ return this.client.call({
477
+ method: 'PATCH',
478
+ path: `/v1/${runtime.pathParam(request.space?.name, 'orgs/*/projects/*/envs/*/spaces/*', 'space.name')}`,
479
+ query: { update_mask: request.updateMask, allow_missing: request.allowMissing, validate_only: request.validateOnly },
480
+ body: request.space ?? {},
481
+ bodyType: 'sylphx.knowledge.v1.Space',
482
+ responseType: 'sylphx.knowledge.v1.Space',
483
+ mutation: true,
484
+ });
485
+ }
486
+ /**
487
+ * Deletes a space. A space that still holds records is refused with
488
+ * `INVALID_STATE` unless `force` is set, which deletes its episodes and
489
+ * facts too.
490
+ *
491
+ * `DELETE /v1/{name=orgs/*\/projects/*\/envs/*\/spaces/*}` · permission `knowledge:write` · effect `destructive`
492
+ *
493
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `INVALID_STATE`, `ETAG_MISMATCH`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
494
+ */
495
+ async delete(request) {
496
+ return this.client.call({
497
+ method: 'DELETE',
498
+ path: `/v1/${runtime.pathParam(request.name, 'orgs/*/projects/*/envs/*/spaces/*', 'name')}`,
499
+ query: { etag: request.etag, allow_missing: request.allowMissing, validate_only: request.validateOnly, force: request.force },
500
+ mutation: true,
501
+ });
502
+ }
503
+ }
504
+ /** `knowledge_schemas` of Sylphx Knowledge: Resource type `knowledge.sylphx.com/KnowledgeSchema`. */
505
+ export class KnowledgeSchemasCollection {
506
+ client;
507
+ constructor(client) {
508
+ this.client = client;
509
+ }
510
+ /**
511
+ * Gets a knowledge schema.
512
+ *
513
+ * `GET /v1/{name=orgs/*\/projects/*\/envs/*\/knowledge_schemas/*}` · permission `knowledge:read` · effect `read`
514
+ *
515
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`.
516
+ */
517
+ async get(request) {
518
+ return this.client.call({
519
+ method: 'GET',
520
+ path: `/v1/${runtime.pathParam(request.name, 'orgs/*/projects/*/envs/*/knowledge_schemas/*', 'name')}`,
521
+ responseType: 'sylphx.knowledge.v1.KnowledgeSchema',
522
+ mutation: false,
523
+ });
524
+ }
525
+ /**
526
+ * Lists knowledge schemas.
527
+ *
528
+ * `GET /v1/{parent=orgs/*\/projects/*\/envs/*}/knowledge_schemas` · permission `knowledge:read` · effect `read`
529
+ *
530
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `PAGE_TOKEN_MISMATCH`.
531
+ */
532
+ async list(request) {
533
+ return this.client.call({
534
+ method: 'GET',
535
+ path: `/v1/${runtime.pathParam(request.parent, 'orgs/*/projects/*/envs/*', 'parent')}/knowledge_schemas`,
536
+ query: { page_size: request.pageSize, page_token: request.pageToken, filter: request.filter, order_by: request.orderBy },
537
+ responseType: 'sylphx.knowledge.v1.ListKnowledgeSchemasResponse',
538
+ mutation: false,
539
+ });
540
+ }
541
+ /** Every item of every page of `list`. */
542
+ async *listAll(request) {
543
+ let next = request;
544
+ for (;;) {
545
+ const page = await this.list(next);
546
+ yield* page.knowledgeSchemas ?? [];
547
+ if (page.nextPageToken === undefined || page.nextPageToken === '')
548
+ return;
549
+ next = { ...request, pageToken: page.nextPageToken };
550
+ }
551
+ }
552
+ /**
553
+ * Creates a knowledge schema.
554
+ *
555
+ * `POST /v1/{parent=orgs/*\/projects/*\/envs/*}/knowledge_schemas` · permission `knowledge:write` · effect `write`
556
+ *
557
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `UNKNOWN_FIELD`, `INVALID_FIELD`, `RESOURCE_ALREADY_EXISTS`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`, `PLAN_LIMIT_REACHED`.
558
+ */
559
+ async create(request) {
560
+ return this.client.call({
561
+ method: 'POST',
562
+ path: `/v1/${runtime.pathParam(request.parent, 'orgs/*/projects/*/envs/*', 'parent')}/knowledge_schemas`,
563
+ query: { knowledge_schema_id: request.knowledgeSchemaId, validate_only: request.validateOnly },
564
+ body: request.knowledgeSchema ?? {},
565
+ bodyType: 'sylphx.knowledge.v1.KnowledgeSchema',
566
+ responseType: 'sylphx.knowledge.v1.KnowledgeSchema',
567
+ mutation: true,
568
+ });
569
+ }
570
+ /**
571
+ * Updates a knowledge schema. An accepted update publishes a new
572
+ * revision; a change that would invalidate existing records is refused
573
+ * with `INVALID_FIELD`.
574
+ *
575
+ * `PATCH /v1/{knowledge_schema.name=orgs/*\/projects/*\/envs/*\/knowledge_schemas/*}` · permission `knowledge:write` · effect `write`
576
+ *
577
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `UNKNOWN_FIELD`, `INVALID_FIELD`, `ETAG_MISMATCH`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
578
+ */
579
+ async update(request) {
580
+ return this.client.call({
581
+ method: 'PATCH',
582
+ path: `/v1/${runtime.pathParam(request.knowledgeSchema?.name, 'orgs/*/projects/*/envs/*/knowledge_schemas/*', 'knowledge_schema.name')}`,
583
+ query: { update_mask: request.updateMask, allow_missing: request.allowMissing, validate_only: request.validateOnly },
584
+ body: request.knowledgeSchema ?? {},
585
+ bodyType: 'sylphx.knowledge.v1.KnowledgeSchema',
586
+ responseType: 'sylphx.knowledge.v1.KnowledgeSchema',
587
+ mutation: true,
588
+ });
589
+ }
590
+ /**
591
+ * Deletes a knowledge schema. A schema a space still accepts is refused
592
+ * with `RESOURCE_IN_USE`.
593
+ *
594
+ * `DELETE /v1/{name=orgs/*\/projects/*\/envs/*\/knowledge_schemas/*}` · permission `knowledge:write` · effect `destructive`
595
+ *
596
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `RESOURCE_IN_USE`, `ETAG_MISMATCH`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
597
+ */
598
+ async delete(request) {
599
+ return this.client.call({
600
+ method: 'DELETE',
601
+ path: `/v1/${runtime.pathParam(request.name, 'orgs/*/projects/*/envs/*/knowledge_schemas/*', 'name')}`,
602
+ query: { etag: request.etag, allow_missing: request.allowMissing, validate_only: request.validateOnly },
603
+ mutation: true,
604
+ });
605
+ }
606
+ }
607
+ /** `episodes` of Sylphx Knowledge: Resource type `knowledge.sylphx.com/Episode`. */
608
+ export class EpisodesCollection {
609
+ client;
610
+ constructor(client) {
611
+ this.client = client;
612
+ }
613
+ /**
614
+ * Gets an episode.
615
+ *
616
+ * `GET /v1/{name=orgs/*\/projects/*\/envs/*\/spaces/*\/episodes/*}` · permission `knowledge:read` · effect `read`
617
+ *
618
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`.
619
+ */
620
+ async get(request) {
621
+ return this.client.call({
622
+ method: 'GET',
623
+ path: `/v1/${runtime.pathParam(request.name, 'orgs/*/projects/*/envs/*/spaces/*/episodes/*', 'name')}`,
624
+ responseType: 'sylphx.knowledge.v1.Episode',
625
+ mutation: false,
626
+ });
627
+ }
628
+ /**
629
+ * Lists a space's episodes, newest first. The filter is limited to
630
+ * `kind` and `extraction`.
631
+ *
632
+ * `GET /v1/{parent=orgs/*\/projects/*\/envs/*\/spaces/*}/episodes` · permission `knowledge:read` · effect `read`
633
+ *
634
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `PAGE_TOKEN_MISMATCH`.
635
+ */
636
+ async list(request) {
637
+ return this.client.call({
638
+ method: 'GET',
639
+ path: `/v1/${runtime.pathParam(request.parent, 'orgs/*/projects/*/envs/*/spaces/*', 'parent')}/episodes`,
640
+ query: { page_size: request.pageSize, page_token: request.pageToken, filter: request.filter },
641
+ responseType: 'sylphx.knowledge.v1.ListEpisodesResponse',
642
+ mutation: false,
643
+ });
644
+ }
645
+ /** Every item of every page of `list`. */
646
+ async *listAll(request) {
647
+ let next = request;
648
+ for (;;) {
649
+ const page = await this.list(next);
650
+ yield* page.episodes ?? [];
651
+ if (page.nextPageToken === undefined || page.nextPageToken === '')
652
+ return;
653
+ next = { ...request, pageToken: page.nextPageToken };
654
+ }
655
+ }
656
+ /**
657
+ * Records an episode and returns at once (`remember`); extraction reads
658
+ * it afterwards.
659
+ *
660
+ * `POST /v1/{parent=orgs/*\/projects/*\/envs/*\/spaces/*}/episodes` · permission `knowledge:write` · effect `write`
661
+ *
662
+ * 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`.
663
+ *
664
+ * Also `sx.knowledge.remember`.
665
+ */
666
+ async create(request) {
667
+ return this.client.call({
668
+ method: 'POST',
669
+ path: `/v1/${runtime.pathParam(request.parent, 'orgs/*/projects/*/envs/*/spaces/*', 'parent')}/episodes`,
670
+ query: { episode_id: request.episodeId, validate_only: request.validateOnly, skip_extraction: request.skipExtraction },
671
+ body: request.episode ?? {},
672
+ bodyType: 'sylphx.knowledge.v1.Episode',
673
+ responseType: 'sylphx.knowledge.v1.Episode',
674
+ mutation: true,
675
+ });
676
+ }
677
+ /**
678
+ * Deletes an episode, the facts that cite only it, and its search and
679
+ * embedding entries; facts that also cite other episodes are re-scored.
680
+ *
681
+ * `DELETE /v1/{name=orgs/*\/projects/*\/envs/*\/spaces/*\/episodes/*}` · permission `knowledge:write` · effect `destructive`
682
+ *
683
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `ETAG_MISMATCH`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
684
+ */
685
+ async delete(request) {
686
+ return this.client.call({
687
+ method: 'DELETE',
688
+ path: `/v1/${runtime.pathParam(request.name, 'orgs/*/projects/*/envs/*/spaces/*/episodes/*', 'name')}`,
689
+ query: { etag: request.etag, allow_missing: request.allowMissing, validate_only: request.validateOnly },
690
+ mutation: true,
691
+ });
692
+ }
693
+ }
694
+ /** `entities` of Sylphx Knowledge: Resource type `knowledge.sylphx.com/Entity`. */
695
+ export class EntitiesCollection {
696
+ client;
697
+ constructor(client) {
698
+ this.client = client;
699
+ }
700
+ /**
701
+ * Gets an entity.
702
+ *
703
+ * `GET /v1/{name=orgs/*\/projects/*\/envs/*\/entities/*}` · permission `knowledge:read` · effect `read`
704
+ *
705
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`.
706
+ */
707
+ async get(request) {
708
+ return this.client.call({
709
+ method: 'GET',
710
+ path: `/v1/${runtime.pathParam(request.name, 'orgs/*/projects/*/envs/*/entities/*', 'name')}`,
711
+ responseType: 'sylphx.knowledge.v1.Entity',
712
+ mutation: false,
713
+ });
714
+ }
715
+ /**
716
+ * Lists the entities the caller may see. The filter is limited to
717
+ * `entity_type` and `lifecycle`.
718
+ *
719
+ * `GET /v1/{parent=orgs/*\/projects/*\/envs/*}/entities` · permission `knowledge:read` · effect `read`
720
+ *
721
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `PAGE_TOKEN_MISMATCH`.
722
+ */
723
+ async list(request) {
724
+ return this.client.call({
725
+ method: 'GET',
726
+ path: `/v1/${runtime.pathParam(request.parent, 'orgs/*/projects/*/envs/*', 'parent')}/entities`,
727
+ query: { page_size: request.pageSize, page_token: request.pageToken, filter: request.filter },
728
+ responseType: 'sylphx.knowledge.v1.ListEntitiesResponse',
729
+ mutation: false,
730
+ });
731
+ }
732
+ /** Every item of every page of `list`. */
733
+ async *listAll(request) {
734
+ let next = request;
735
+ for (;;) {
736
+ const page = await this.list(next);
737
+ yield* page.entities ?? [];
738
+ if (page.nextPageToken === undefined || page.nextPageToken === '')
739
+ return;
740
+ next = { ...request, pageToken: page.nextPageToken };
741
+ }
742
+ }
743
+ /**
744
+ * Creates an entity in a space. An entity whose external id already
745
+ * names one in the graph is refused with `RESOURCE_ALREADY_EXISTS`, which
746
+ * names it; use Update with `allow_missing` to upsert.
747
+ *
748
+ * `POST /v1/{parent=orgs/*\/projects/*\/envs/*}/entities` · permission `knowledge:write` · effect `write`
749
+ *
750
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `UNKNOWN_FIELD`, `INVALID_FIELD`, `RESOURCE_ALREADY_EXISTS`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`, `INVALID_STATE`, `UNAVAILABLE`.
751
+ */
752
+ async create(request) {
753
+ return this.client.call({
754
+ method: 'POST',
755
+ path: `/v1/${runtime.pathParam(request.parent, 'orgs/*/projects/*/envs/*', 'parent')}/entities`,
756
+ query: { entity_id: request.entityId, validate_only: request.validateOnly },
757
+ body: request.entity ?? {},
758
+ bodyType: 'sylphx.knowledge.v1.Entity',
759
+ responseType: 'sylphx.knowledge.v1.Entity',
760
+ mutation: true,
761
+ });
762
+ }
763
+ /**
764
+ * Updates an entity. With `allow_missing` it is the structured upsert
765
+ * (`upsert_entity`): an entity matched by `external_ids` is updated,
766
+ * otherwise one is created.
767
+ *
768
+ * `PATCH /v1/{entity.name=orgs/*\/projects/*\/envs/*\/entities/*}` · permission `knowledge:write` · effect `write`
769
+ *
770
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `UNKNOWN_FIELD`, `INVALID_FIELD`, `ETAG_MISMATCH`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
771
+ */
772
+ async update(request) {
773
+ return this.client.call({
774
+ method: 'PATCH',
775
+ path: `/v1/${runtime.pathParam(request.entity?.name, 'orgs/*/projects/*/envs/*/entities/*', 'entity.name')}`,
776
+ query: { update_mask: request.updateMask, allow_missing: request.allowMissing, validate_only: request.validateOnly },
777
+ body: request.entity ?? {},
778
+ bodyType: 'sylphx.knowledge.v1.Entity',
779
+ responseType: 'sylphx.knowledge.v1.Entity',
780
+ mutation: true,
781
+ });
782
+ }
783
+ /**
784
+ * Deletes an entity and every fact about it. With `force` it is a
785
+ * data-rights erasure: the episodes the person wrote are deleted too, with
786
+ * their search and embedding entries.
787
+ *
788
+ * `DELETE /v1/{name=orgs/*\/projects/*\/envs/*\/entities/*}` · permission `knowledge:write` · effect `destructive`
789
+ *
790
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `ETAG_MISMATCH`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
791
+ */
792
+ async delete(request) {
793
+ return this.client.call({
794
+ method: 'DELETE',
795
+ path: `/v1/${runtime.pathParam(request.name, 'orgs/*/projects/*/envs/*/entities/*', 'name')}`,
796
+ query: { etag: request.etag, allow_missing: request.allowMissing, validate_only: request.validateOnly, force: request.force },
797
+ mutation: true,
798
+ });
799
+ }
800
+ /**
801
+ * Merges other entities into this one: their facts and external ids
802
+ * resolve to it. The merge is recorded and reversible with `:split`; it is
803
+ * never a silent rewrite.
804
+ *
805
+ * `POST /v1/{name=orgs/*\/projects/*\/envs/*\/entities/*}:merge` · permission `knowledge:write` · effect `write`
806
+ *
807
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `INVALID_FIELD`, `INVALID_STATE`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
808
+ */
809
+ async merge(request) {
810
+ return this.client.call({
811
+ method: 'POST',
812
+ path: `/v1/${runtime.pathParam(request.name, 'orgs/*/projects/*/envs/*/entities/*', 'name')}:merge`,
813
+ body: runtime.omit(request, ['name']),
814
+ bodyType: 'sylphx.knowledge.v1.MergeEntityRequest',
815
+ responseType: 'sylphx.knowledge.v1.Entity',
816
+ mutation: true,
817
+ });
818
+ }
819
+ /**
820
+ * Splits a merged entity back out of this one, with the facts and
821
+ * external ids it brought.
822
+ *
823
+ * `POST /v1/{name=orgs/*\/projects/*\/envs/*\/entities/*}:split` · permission `knowledge:write` · effect `write`
824
+ *
825
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `INVALID_FIELD`, `INVALID_STATE`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
826
+ */
827
+ async split(request) {
828
+ return this.client.call({
829
+ method: 'POST',
830
+ path: `/v1/${runtime.pathParam(request.name, 'orgs/*/projects/*/envs/*/entities/*', 'name')}:split`,
831
+ body: runtime.omit(request, ['name']),
832
+ bodyType: 'sylphx.knowledge.v1.SplitEntityRequest',
833
+ responseType: 'sylphx.knowledge.v1.SplitEntityResponse',
834
+ mutation: true,
835
+ });
836
+ }
837
+ /**
838
+ * Returns one entity's profile in one call (`entity`): the entity, its
839
+ * current facts in both directions, the entities they name and the recent
840
+ * episodes about it, trimmed to what the caller may see. A read with a
841
+ * request body.
842
+ *
843
+ * `POST /v1/{name=orgs/*\/projects/*\/envs/*\/entities/*}:profile` · permission `knowledge:read` · effect `read`
844
+ *
845
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `INVALID_FIELD`.
846
+ *
847
+ * Also `sx.knowledge.entity`.
848
+ */
849
+ async profile(request) {
850
+ return this.client.call({
851
+ method: 'POST',
852
+ path: `/v1/${runtime.pathParam(request.name, 'orgs/*/projects/*/envs/*/entities/*', 'name')}:profile`,
853
+ body: runtime.omit(request, ['name']),
854
+ bodyType: 'sylphx.knowledge.v1.ProfileEntityRequest',
855
+ responseType: 'sylphx.knowledge.v1.ProfileEntityResponse',
856
+ mutation: true,
857
+ });
858
+ }
859
+ /**
860
+ * Searches the graph (`recall`): hybrid lexical and semantic search over
861
+ * episodes and facts, fused by reciprocal rank, then at most two hops of
862
+ * expansion from the top entities. Returns a context pack with citations,
863
+ * built only from records the caller may see.
864
+ *
865
+ * `POST /v1/{parent=orgs/*\/projects/*\/envs/*}/entities:recall` · permission `knowledge:read` · effect `read`
866
+ *
867
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `RATE_LIMITED`, `INVALID_STATE`, `UNAVAILABLE`, `RESOURCE_NOT_FOUND`.
868
+ *
869
+ * Also `sx.knowledge.recall`.
870
+ */
871
+ async recall(request) {
872
+ return this.client.call({
873
+ method: 'POST',
874
+ path: `/v1/${runtime.pathParam(request.parent, 'orgs/*/projects/*/envs/*', 'parent')}/entities:recall`,
875
+ body: runtime.omit(request, ['parent']),
876
+ bodyType: 'sylphx.knowledge.v1.RecallEntitiesRequest',
877
+ responseType: 'sylphx.knowledge.v1.RecallEntitiesResponse',
878
+ mutation: true,
879
+ });
880
+ }
881
+ /**
882
+ * Answers a question through Sylphx AI (`ask`), from a context pack built
883
+ * only from records the caller may see, with citations to its episodes.
884
+ *
885
+ * `POST /v1/{parent=orgs/*\/projects/*\/envs/*}/entities:ask` · permission `knowledge:read` · effect `read`
886
+ *
887
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `RATE_LIMITED`, `SPEND_LIMIT_REACHED`, `INVALID_STATE`, `UNAVAILABLE`, `RESOURCE_NOT_FOUND`.
888
+ *
889
+ * Also `sx.knowledge.ask`.
890
+ */
891
+ async ask(request) {
892
+ return this.client.call({
893
+ method: 'POST',
894
+ path: `/v1/${runtime.pathParam(request.parent, 'orgs/*/projects/*/envs/*', 'parent')}/entities:ask`,
895
+ body: runtime.omit(request, ['parent']),
896
+ bodyType: 'sylphx.knowledge.v1.AskEntitiesRequest',
897
+ responseType: 'sylphx.knowledge.v1.AskEntitiesResponse',
898
+ mutation: true,
899
+ });
900
+ }
901
+ }
902
+ /** `relations` of Sylphx Knowledge: Resource type `knowledge.sylphx.com/Relation`. */
903
+ export class RelationsCollection {
904
+ client;
905
+ constructor(client) {
906
+ this.client = client;
907
+ }
908
+ /**
909
+ * Gets a relation.
910
+ *
911
+ * `GET /v1/{name=orgs/*\/projects/*\/envs/*\/spaces/*\/relations/*}` · permission `knowledge:read` · effect `read`
912
+ *
913
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`.
914
+ */
915
+ async get(request) {
916
+ return this.client.call({
917
+ method: 'GET',
918
+ path: `/v1/${runtime.pathParam(request.name, 'orgs/*/projects/*/envs/*/spaces/*/relations/*', 'name')}`,
919
+ responseType: 'sylphx.knowledge.v1.Relation',
920
+ mutation: false,
921
+ });
922
+ }
923
+ /**
924
+ * Lists a space's facts. The filter is limited to `subject`, `predicate`,
925
+ * `object` and `provenance.channel`; superseded facts are listed only with
926
+ * `show_superseded`.
927
+ *
928
+ * `GET /v1/{parent=orgs/*\/projects/*\/envs/*\/spaces/*}/relations` · permission `knowledge:read` · effect `read`
929
+ *
930
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `PAGE_TOKEN_MISMATCH`.
931
+ */
932
+ async list(request) {
933
+ return this.client.call({
934
+ method: 'GET',
935
+ path: `/v1/${runtime.pathParam(request.parent, 'orgs/*/projects/*/envs/*/spaces/*', 'parent')}/relations`,
936
+ query: { page_size: request.pageSize, page_token: request.pageToken, filter: request.filter, valid_time: request.validTime, show_superseded: request.showSuperseded },
937
+ responseType: 'sylphx.knowledge.v1.ListRelationsResponse',
938
+ mutation: false,
939
+ });
940
+ }
941
+ /** Every item of every page of `list`. */
942
+ async *listAll(request) {
943
+ let next = request;
944
+ for (;;) {
945
+ const page = await this.list(next);
946
+ yield* page.relations ?? [];
947
+ if (page.nextPageToken === undefined || page.nextPageToken === '')
948
+ return;
949
+ next = { ...request, pageToken: page.nextPageToken };
950
+ }
951
+ }
952
+ /**
953
+ * Records a fact in a space (`relate`). A fact that contradicts a current
954
+ * one with the same subject and a single-valued predicate closes the older
955
+ * fact; nothing is overwritten.
956
+ *
957
+ * `POST /v1/{parent=orgs/*\/projects/*\/envs/*\/spaces/*}/relations` · permission `knowledge:write` · effect `write`
958
+ *
959
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `UNKNOWN_FIELD`, `INVALID_FIELD`, `RESOURCE_ALREADY_EXISTS`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`, `INVALID_STATE`, `UNAVAILABLE`.
960
+ *
961
+ * Also `sx.knowledge.relate`.
962
+ */
963
+ async create(request) {
964
+ return this.client.call({
965
+ method: 'POST',
966
+ path: `/v1/${runtime.pathParam(request.parent, 'orgs/*/projects/*/envs/*/spaces/*', 'parent')}/relations`,
967
+ query: { relation_id: request.relationId, validate_only: request.validateOnly },
968
+ body: request.relation ?? {},
969
+ bodyType: 'sylphx.knowledge.v1.Relation',
970
+ responseType: 'sylphx.knowledge.v1.Relation',
971
+ mutation: true,
972
+ });
973
+ }
974
+ /**
975
+ * Deletes a fact. Deletion is for data that must go; a fact that stopped
976
+ * being true is closed with `:close`.
977
+ *
978
+ * `DELETE /v1/{name=orgs/*\/projects/*\/envs/*\/spaces/*\/relations/*}` · permission `knowledge:write` · effect `destructive`
979
+ *
980
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `ETAG_MISMATCH`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
981
+ */
982
+ async delete(request) {
983
+ return this.client.call({
984
+ method: 'DELETE',
985
+ path: `/v1/${runtime.pathParam(request.name, 'orgs/*/projects/*/envs/*/spaces/*/relations/*', 'name')}`,
986
+ query: { etag: request.etag, allow_missing: request.allowMissing, validate_only: request.validateOnly },
987
+ mutation: true,
988
+ });
989
+ }
990
+ /**
991
+ * Closes a fact (`close_fact`): it stopped holding in the world at
992
+ * `valid_end_time`. The fact stays readable for questions about the time
993
+ * before the close.
994
+ *
995
+ * `POST /v1/{name=orgs/*\/projects/*\/envs/*\/spaces/*\/relations/*}:close` · permission `knowledge:write` · effect `write`
996
+ *
997
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `INVALID_FIELD`, `INVALID_STATE`, `ETAG_MISMATCH`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
998
+ *
999
+ * Also `sx.knowledge.closeFact`.
1000
+ */
1001
+ async close(request) {
1002
+ return this.client.call({
1003
+ method: 'POST',
1004
+ path: `/v1/${runtime.pathParam(request.name, 'orgs/*/projects/*/envs/*/spaces/*/relations/*', 'name')}:close`,
1005
+ body: runtime.omit(request, ['name']),
1006
+ bodyType: 'sylphx.knowledge.v1.CloseRelationRequest',
1007
+ responseType: 'sylphx.knowledge.v1.Relation',
1008
+ mutation: true,
1009
+ });
1010
+ }
1011
+ }
1012
+ //# sourceMappingURL=knowledge.js.map