@sylphx/sdk 0.31.0 → 0.32.1

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