@loams/client 0.1.0 → 0.1.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 (56) hide show
  1. package/README.md +104 -4
  2. package/dist/app.d.ts +149 -0
  3. package/dist/app.js +317 -0
  4. package/dist/builders/filter.d.ts +96 -0
  5. package/dist/builders/filter.js +190 -0
  6. package/dist/builders/schema.d.ts +50 -0
  7. package/dist/builders/schema.js +92 -0
  8. package/dist/builders/search.d.ts +159 -0
  9. package/dist/builders/search.js +307 -0
  10. package/dist/gen/facade.d.ts +267 -2
  11. package/dist/gen/facade.js +194 -0
  12. package/dist/handle.d.ts +67 -0
  13. package/dist/handle.js +107 -0
  14. package/dist/index.d.ts +13 -5
  15. package/dist/index.js +13 -3
  16. package/dist/loams.d.ts +78 -3
  17. package/dist/loams.js +84 -6
  18. package/dist/node.js +1 -1
  19. package/dist/runtime/batch.d.ts +29 -0
  20. package/dist/runtime/batch.js +95 -0
  21. package/dist/runtime/call.d.ts +63 -9
  22. package/dist/runtime/call.js +243 -41
  23. package/dist/runtime/consistency.d.ts +65 -11
  24. package/dist/runtime/consistency.js +212 -46
  25. package/dist/runtime/errors.d.ts +29 -2
  26. package/dist/runtime/errors.js +26 -0
  27. package/dist/runtime/machine-key.d.ts +33 -0
  28. package/dist/runtime/machine-key.js +174 -0
  29. package/dist/runtime/pagination.js +8 -2
  30. package/dist/runtime/subscribe.d.ts +37 -0
  31. package/dist/runtime/subscribe.js +128 -0
  32. package/dist/runtime/token-source.d.ts +1 -1
  33. package/dist/runtime/token-source.js +1 -1
  34. package/dist/runtime/transports.d.ts +22 -1
  35. package/dist/runtime/transports.js +28 -2
  36. package/dist/vendor/proto/collection-v1.d.ts +3 -0
  37. package/dist/vendor/proto/collection-v1.js +7 -0
  38. package/dist/vendor/proto/gen/loams/auth/v1/auth_pb.d.ts +7 -2
  39. package/dist/vendor/proto/gen/loams/auth/v1/auth_pb.js +5 -1
  40. package/dist/vendor/proto/gen/loams/collection/v1/collection_pb.d.ts +1610 -0
  41. package/dist/vendor/proto/gen/loams/collection/v1/collection_pb.js +399 -0
  42. package/dist/vendor/proto/gen/loams/collection/v1/document_pb.d.ts +1054 -0
  43. package/dist/vendor/proto/gen/loams/collection/v1/document_pb.js +327 -0
  44. package/dist/vendor/proto/gen/loams/collection/v1/query_pb.d.ts +2101 -0
  45. package/dist/vendor/proto/gen/loams/collection/v1/query_pb.js +608 -0
  46. package/dist/vendor/proto/gen/loams/graph/v1/graph_pb.d.ts +2299 -0
  47. package/dist/vendor/proto/gen/loams/graph/v1/graph_pb.js +596 -0
  48. package/dist/vendor/proto/gen/loams/instance/v1/instance_pb.d.ts +23 -7
  49. package/dist/vendor/proto/gen/loams/instance/v1/instance_pb.js +20 -5
  50. package/dist/vendor/proto/gen/loams/operations/v1/operations_pb.d.ts +399 -0
  51. package/dist/vendor/proto/gen/loams/operations/v1/operations_pb.js +118 -0
  52. package/dist/vendor/proto/gen/loams/sql/v1/sql_pb.d.ts +182 -0
  53. package/dist/vendor/proto/gen/loams/sql/v1/sql_pb.js +72 -0
  54. package/dist/vendor/proto/gen/loams/stream/v1/stream_pb.d.ts +688 -0
  55. package/dist/vendor/proto/gen/loams/stream/v1/stream_pb.js +180 -0
  56. package/package.json +2 -2
@@ -0,0 +1,307 @@
1
+ // The search builder (SDKP §2.4): a `loams.collection.v1.SearchRequest`, one
2
+ // verb at a time.
3
+ //
4
+ // const request = Search.on('notes')
5
+ // .text('refund', { fields: ['body'] })
6
+ // .vector('embedding', [0.1, 0.2, 0.3, 0.4], { k: 10 })
7
+ // .fuse(rrf(60))
8
+ // .filter(Filter.eq('tags', 'policy'))
9
+ // .highlight('body')
10
+ // .select({ include: ['title'] })
11
+ // .limit(5);
12
+ // const answer = await loams.search.query(request.build());
13
+ //
14
+ // Each verb is pure: it returns a new builder and leaves the old one as it
15
+ // was, so a base query can be shared and specialised. `toJson()` is the
16
+ // request's proto3 JSON, which is how the builder corpus spells each case;
17
+ // `build()` decodes it into the generated message, refusing the requests the
18
+ // builder can tell are wrong (a weighted fusion with the wrong number of
19
+ // weights) before any network call.
20
+ var _a;
21
+ import { fromJson, toJson } from '@bufbuild/protobuf';
22
+ import { ValueSchema } from '@bufbuild/protobuf/wkt';
23
+ import { Code } from '@connectrpc/connect';
24
+ import { SearchRequestSchema } from '../vendor/proto/gen/loams/collection/v1/query_pb.js';
25
+ import { ConsistencyToken } from '../runtime/consistency.js';
26
+ import { InvalidArgumentError } from '../runtime/errors.js';
27
+ import { Filter } from './filter.js';
28
+ /** Reciprocal-rank fusion; `k` absent is the engine's 60. */
29
+ export function rrf(k) {
30
+ return { rrf: k === undefined ? {} : { k } };
31
+ }
32
+ /** Distance-based score fusion, with the engine's parameters. */
33
+ export function dbsf() {
34
+ return { dbsf: {} };
35
+ }
36
+ /** A weighted sum, one weight per retriever in the order they were added. */
37
+ export function weighted(...weights) {
38
+ return { weightedSum: { weights } };
39
+ }
40
+ /** The fusions, as one namespace. */
41
+ export const Fusion = { rrf, dbsf, weighted };
42
+ const order = (value) => (value === 'asc' ? 'SORT_ORDER_ASC' : 'SORT_ORDER_DESC');
43
+ /** The sort keys. The primary key ascending always breaks ties on the server,
44
+ * but `queryAll` needs it spelled out to page. */
45
+ export const Sort = {
46
+ /** By score; descending unless told otherwise. */
47
+ score(direction) {
48
+ return { score: direction === undefined ? {} : { order: order(direction) } };
49
+ },
50
+ /** By primary key; ascending unless told otherwise. */
51
+ pk(direction) {
52
+ return { pk: direction === undefined ? {} : { order: order(direction) } };
53
+ },
54
+ /** By a fast field. `missing` puts documents without it first or last. */
55
+ field(name, direction, missing) {
56
+ const key = { field: name };
57
+ if (direction !== undefined) {
58
+ key.order = order(direction);
59
+ }
60
+ if (missing !== undefined) {
61
+ key.missing = missing === 'first' ? 'MISSING_ORDER_FIRST' : 'MISSING_ORDER_LAST';
62
+ }
63
+ return { field: key };
64
+ },
65
+ };
66
+ /** The proto3 JSON of a `loams.collection.v1.Consistency`. */
67
+ export function consistencyJson(level) {
68
+ if (level === 'strong') {
69
+ return { freshness: 'FRESHNESS_STRONG' };
70
+ }
71
+ if (level === 'eventual') {
72
+ return { freshness: 'FRESHNESS_EVENTUAL' };
73
+ }
74
+ const token = typeof level === 'string' ? ConsistencyToken.parse(level) : level;
75
+ return { atLeast: token.toString() };
76
+ }
77
+ function sortValueJson(value) {
78
+ if (value !== null &&
79
+ typeof value === 'object' &&
80
+ !Array.isArray(value) &&
81
+ value.$typeName === 'google.protobuf.Value') {
82
+ return toJson(ValueSchema, value);
83
+ }
84
+ return value;
85
+ }
86
+ function textQuery(text, fields) {
87
+ if (typeof text !== 'string') {
88
+ return text;
89
+ }
90
+ if (fields === undefined || fields.length === 0) {
91
+ return Filter.queryString(text);
92
+ }
93
+ if (fields.length === 1) {
94
+ return Filter.match(fields[0], text);
95
+ }
96
+ return Filter.multiMatch(fields, text);
97
+ }
98
+ /** The search builder. */
99
+ export class Search {
100
+ #json;
101
+ constructor(json) {
102
+ this.#json = json;
103
+ }
104
+ /** A search of `collection` (a name or an alias). */
105
+ static on(collection, options = {}) {
106
+ return new _a({
107
+ ...(options.namespace === undefined ? {} : { namespace: options.namespace }),
108
+ collection,
109
+ });
110
+ }
111
+ /** A builder over an existing request's proto3 JSON. */
112
+ static fromJson(json) {
113
+ return new _a(structuredClone(json));
114
+ }
115
+ #with(patch) {
116
+ return new _a({ ...structuredClone(this.#json), ...patch });
117
+ }
118
+ #retrievers() {
119
+ return this.#json.retrievers ?? [];
120
+ }
121
+ /** The namespace, when it is not the client's default. */
122
+ namespace(namespace) {
123
+ return this.#with({ namespace });
124
+ }
125
+ /** A text retriever. A string is a `match`/`multi_match`/`query_string`
126
+ * by `fields`; a `Filter` (`match`, `multiMatch`, `phrase`…) is used as is. */
127
+ text(text, options = {}) {
128
+ const retriever = { query: textQuery(text, options.fields) };
129
+ if (options.k !== undefined) {
130
+ retriever.k = options.k;
131
+ }
132
+ return this.#with({ retrievers: [...this.#retrievers(), { text: retriever }] });
133
+ }
134
+ /** A dense-vector kNN retriever on `field`. */
135
+ vector(field, values, options = {}) {
136
+ const retriever = { field, query: [...values] };
137
+ if (options.k !== undefined) {
138
+ retriever.k = options.k;
139
+ }
140
+ const params = {};
141
+ for (const key of ['exact', 'nprobes', 'refineFactor', 'ef', 'oversampling', 'distance']) {
142
+ if (options[key] !== undefined) {
143
+ params[key] = options[key];
144
+ }
145
+ }
146
+ if (Object.keys(params).length > 0) {
147
+ retriever.params = params;
148
+ }
149
+ if (options.filter !== undefined) {
150
+ retriever.filter = options.filter;
151
+ }
152
+ return this.#with({ retrievers: [...this.#retrievers(), { vector: retriever }] });
153
+ }
154
+ /** A sparse-vector retriever: `{indices, values}`, or a term-to-weight map
155
+ * whose keys are the indices. */
156
+ sparse(field, terms, options = {}) {
157
+ const query = 'indices' in terms && Array.isArray(terms.indices)
158
+ ? { indices: [...terms.indices], values: [...terms.values] }
159
+ : (() => {
160
+ const entries = Object.entries(terms);
161
+ return { indices: entries.map(([index]) => Number(index)), values: entries.map(([, v]) => v) };
162
+ })();
163
+ const retriever = { field, query };
164
+ if (options.k !== undefined) {
165
+ retriever.k = options.k;
166
+ }
167
+ if (options.filter !== undefined) {
168
+ retriever.filter = options.filter;
169
+ }
170
+ return this.#with({ retrievers: [...this.#retrievers(), { sparse: retriever }] });
171
+ }
172
+ /** How the retrievers' ranked lists combine: `rrf()`, `dbsf()` or
173
+ * `weighted(…)`. */
174
+ fuse(fusion) {
175
+ return this.#with({ fusion });
176
+ }
177
+ /** The filter every candidate must match. */
178
+ filter(filter) {
179
+ return this.#with({ filter });
180
+ }
181
+ /** The sort, replacing any earlier one. */
182
+ sort(...keys) {
183
+ return this.#with({ sort: keys });
184
+ }
185
+ /** The window size; the engine's default is 10. */
186
+ limit(limit) {
187
+ return this.#with({ limit });
188
+ }
189
+ /** How many hits to skip before the window. */
190
+ offset(offset) {
191
+ return this.#with({ offset });
192
+ }
193
+ /** The page after the hit whose `sortValues` these are. */
194
+ after(sortValues) {
195
+ return this.#with({ searchAfter: sortValues.map(sortValueJson) });
196
+ }
197
+ /** Drops hits scoring below `score`. */
198
+ minScore(score) {
199
+ return this.#with({ scoreThreshold: score });
200
+ }
201
+ /** What to return of each hit. */
202
+ select(options) {
203
+ const select = {};
204
+ if (options.noSource === true) {
205
+ select.source = 'none';
206
+ }
207
+ else if (options.include !== undefined || options.exclude !== undefined) {
208
+ const source = {};
209
+ if (options.include !== undefined) {
210
+ source.include = [...options.include];
211
+ }
212
+ if (options.exclude !== undefined) {
213
+ source.exclude = [...options.exclude];
214
+ }
215
+ select.source = source;
216
+ }
217
+ if (options.vectors !== undefined) {
218
+ select.vectors = [...options.vectors];
219
+ }
220
+ if (options.fields !== undefined) {
221
+ select.fields = [...options.fields];
222
+ }
223
+ return this.#with({ select });
224
+ }
225
+ /** Highlights `field` in each hit; call once per field. */
226
+ highlight(field, options = {}) {
227
+ const entry = { field };
228
+ if (options.pre !== undefined) {
229
+ entry.preTag = options.pre;
230
+ }
231
+ if (options.post !== undefined) {
232
+ entry.postTag = options.post;
233
+ }
234
+ if (options.fragmentSize !== undefined) {
235
+ entry.fragmentSize = options.fragmentSize;
236
+ }
237
+ if (options.fragments !== undefined) {
238
+ entry.numberOfFragments = options.fragments;
239
+ }
240
+ const existing = this.#json.highlight?.fields ?? [];
241
+ return this.#with({ highlight: { fields: [...existing, entry] } });
242
+ }
243
+ /** Groups the hits by `field`: `size` hits per group, `limit` groups. */
244
+ groupBy(field, options = {}) {
245
+ const group = { field };
246
+ if (options.size !== undefined) {
247
+ group.groupSize = options.size;
248
+ }
249
+ if (options.limit !== undefined) {
250
+ group.limit = options.limit;
251
+ }
252
+ return this.#with({ groupBy: group });
253
+ }
254
+ /** Walks `graph` from the top hits and returns their neighbours. */
255
+ expand(graph, options = {}) {
256
+ const spec = { graph };
257
+ const copy = ['fromField', 'seedLabel', 'seeds', 'hops', 'limitPerSeed', 'limit'];
258
+ for (const key of copy) {
259
+ if (options[key] !== undefined) {
260
+ spec[key] = options[key];
261
+ }
262
+ }
263
+ if (options.direction !== undefined) {
264
+ spec.direction = `EXPAND_DIRECTION_${options.direction.toUpperCase()}`;
265
+ }
266
+ if (options.edgeTypes !== undefined) {
267
+ spec.edgeTypes = [...options.edgeTypes];
268
+ }
269
+ if (options.output !== undefined) {
270
+ spec.output = `EXPAND_OUTPUT_${options.output.toUpperCase()}`;
271
+ }
272
+ return this.#with({ expandSpec: spec });
273
+ }
274
+ /** How fresh the read must be. */
275
+ consistency(level) {
276
+ return this.#with({ consistency: consistencyJson(level) });
277
+ }
278
+ /** The collection searched. */
279
+ get collection() {
280
+ return this.#json.collection;
281
+ }
282
+ /** Whether the sort ends in a primary-key tiebreaker, which `queryAll`
283
+ * needs to page without skipping or repeating a hit. */
284
+ get hasTiebreak() {
285
+ const sort = this.#json.sort;
286
+ const last = sort?.[sort.length - 1];
287
+ return last !== undefined && 'pk' in last;
288
+ }
289
+ /** The request's proto3 JSON. */
290
+ toJson() {
291
+ return structuredClone(this.#json);
292
+ }
293
+ /** The request as the generated message, checked. */
294
+ build() {
295
+ const weights = this.#json.fusion?.weightedSum
296
+ ?.weights;
297
+ const retrievers = this.#retrievers().length;
298
+ if (weights !== undefined && weights.length !== retrievers) {
299
+ throw new InvalidArgumentError(`a weighted fusion needs one weight per retriever: ${weights.length} weights for ${retrievers} retrievers`, {
300
+ code: Code.InvalidArgument,
301
+ metadata: { field: 'fusion.weighted_sum.weights' },
302
+ });
303
+ }
304
+ return fromJson(SearchRequestSchema, this.#json);
305
+ }
306
+ }
307
+ _a = Search;
@@ -9,8 +9,13 @@ import type { DescService } from '@bufbuild/protobuf';
9
9
  import type { CallOptions } from '../runtime/call.js';
10
10
  import type { AddTeamMemberRequestSchema, AddTeamMemberResponse, CreateAgentRequestSchema, CreateAgentResponse, CreateEnvironmentRequestSchema, CreateEnvironmentResponse, CreateInvitationRequestSchema, CreateInvitationResponse, CreateKeyRequestSchema, CreateKeyResponse, CreateProjectRequestSchema, CreateProjectResponse, CreateServiceAccountRequestSchema, CreateServiceAccountResponse, CreateTeamRequestSchema, CreateTeamResponse, CreateTrustPolicyRequestSchema, CreateTrustPolicyResponse, GetAgentRequestSchema, GetAgentResponse, GetEnvironmentActivityRequestSchema, GetEnvironmentActivityResponse, GetEnvironmentRequestSchema, GetEnvironmentResponse, GetOrgRequestSchema, GetOrgResponse, GetProjectRequestSchema, GetProjectResponse, GetTeamRequestSchema, GetTeamResponse, GrantAccessRequestSchema, GrantAccessResponse, ListAccessRequestSchema, ListAccessResponse, ListAgentTokensRequestSchema, ListAgentTokensResponse, ListAgentsRequestSchema, ListAgentsResponse, ListAuditEventsRequestSchema, ListAuditEventsResponse, ListEnvironmentsRequestSchema, ListEnvironmentsResponse, ListInvitationsRequestSchema, ListInvitationsResponse, ListKeysRequestSchema, ListKeysResponse, ListMembersRequestSchema, ListMembersResponse, ListProjectsRequestSchema, ListProjectsResponse, ListServiceAccountsRequestSchema, ListServiceAccountsResponse, ListTeamsRequestSchema, ListTeamsResponse, ListTrustPoliciesRequestSchema, ListTrustPoliciesResponse, RemoveMemberRequestSchema, RemoveMemberResponse, ResumeAgentRequestSchema, ResumeAgentResponse, RevokeKeyRequestSchema, RevokeKeyResponse, RevokeTokenRequestSchema, RevokeTokenResponse, SuspendAgentRequestSchema, SuspendAgentResponse, UpdateAgentRequestSchema, UpdateAgentResponse, UpdateOrgRequestSchema, UpdateOrgResponse, WatchAuditEventsRequestSchema, WatchAuditEventsResponse } from '../vendor/proto/admin.js';
11
11
  import type { CompleteSetupRequestSchema, CompleteSetupResponse, CreateSessionRequestSchema, CreateSessionResponse, DecideConsentRequestSchema, DecideConsentResponse, DeleteSessionRequestSchema, DeleteSessionResponse, GetSessionRequestSchema, GetSessionResponse, ListProvidersRequestSchema, ListProvidersResponse } from '../vendor/proto/gen/loams/auth/v1/auth_pb.js';
12
+ import type { AddFieldsRequestSchema, AddFieldsResponse, CollectionInfo, CountDocumentsRequestSchema, CountDocumentsResponse, CreateCollectionRequestSchema, CreateNamespaceRequestSchema, CreateNamespaceResponse, DeleteByFilterRequestSchema, DropCollectionRequestSchema, DropCollectionResponse, FilterWriteResponse, GetCollectionRequestSchema, GetDocumentsRequestSchema, GetDocumentsResponse, ListCollectionsRequestSchema, ListCollectionsResponse, ListNamespacesRequestSchema, ListNamespacesResponse, ListVersionsRequestSchema, ListVersionsResponse, PatchByFilterRequestSchema, ScanPlan, ScanRequestSchema, ScrollDocumentsRequestSchema, ScrollDocumentsResponse, SearchRequestSchema, SearchResponse, SetHotRequestSchema, SetHotResponse, UpdateAliasesRequestSchema, UpdateAliasesResponse, WarmCollectionRequestSchema, WarmCollectionResponse, WriteDocumentsRequestSchema, WriteDocumentsResponse } from '../vendor/proto/collection-v1.js';
13
+ import type { CreateGraphRequestSchema, DeleteGraphRequestSchema, ExecuteBatchRequestSchema, ExecuteBatchResponse, ExecuteRequestSchema, ExecuteResponse, ExecuteStreamRequestSchema, ExplainRequestSchema, GetGraphRequestSchema, GetSchemaRequestSchema, Graph, GraphSchema, ListGraphsRequestSchema, ListGraphsResponse, Plan, ResultChunk, UpdateGraphRequestSchema } from '../vendor/proto/gen/loams/graph/v1/graph_pb.js';
12
14
  import type { GetInstanceRequestSchema, GetInstanceResponse, WhoAmIRequestSchema, WhoAmIResponse } from '../vendor/proto/gen/loams/instance/v1/instance_pb.js';
13
15
  import type { ActivateDeploymentRequestSchema, ActivateDeploymentResponse, AuthenticateRequestSchema, AuthenticateResponse, CreateAppRequestSchema, CreateAppResponse, DeleteAppRequestSchema, DeleteAppResponse, DeployRequestSchema, DeployResponse, GetAppRequestSchema, GetAppResponse, GetDeploymentRequestSchema, GetDeploymentResponse, GetIndexStatusRequestSchema, GetIndexStatusResponse, ListAppsRequestSchema, ListAppsResponse, ListDeploymentsRequestSchema, ListDeploymentsResponse, ModifyQuerySetRequestSchema, ModifyQuerySetResponse, MutateRequestSchema, MutateResponse, QueryRequestSchema, QueryResponse, TailLogsRequestSchema, TailLogsResponse, Transition, UpdateAppRequestSchema, UpdateAppResponse, WatchRequestSchema } from '@loams/live/live';
16
+ import type { QueryArrowRequestSchema, QueryArrowResponse, QueryRequestSchema as SqlV1QueryRequestSchema, QueryResponse as SqlV1QueryResponse } from '../vendor/proto/gen/loams/sql/v1/sql_pb.js';
17
+ import type { CreateStreamRequestSchema, CreateStreamResponse, DescribeStreamRequestSchema, DescribeStreamResponse, FetchCloudEventsRequestSchema, FetchCloudEventsResponse, FetchRequestSchema, FetchResponse, ListStreamsRequestSchema, ListStreamsResponse, ProduceCloudEventsRequestSchema, ProduceCloudEventsResponse, ProduceRequestSchema, ProduceResponse } from '../vendor/proto/gen/loams/stream/v1/stream_pb.js';
18
+ import type { Operation } from '../vendor/proto/gen/loams/operations/v1/operations_pb.js';
14
19
  /**
15
20
  * `loams.admin.agents` — Agents, their tokens and trust policies, and service accounts.
16
21
  *
@@ -257,6 +262,149 @@ export interface AuthModule {
257
262
  */
258
263
  listProviders(request: MessageInitShape<typeof ListProvidersRequestSchema>, options?: CallOptions): Promise<ListProvidersResponse>;
259
264
  }
265
+ /**
266
+ * `loams.collections` — Collections: schema, aliases, versions, scan plans and the hot tier.
267
+ *
268
+ * Wraps `loams.collection.v1.CollectionService`.
269
+ */
270
+ export interface CollectionsModule {
271
+ /** The SDK module, as it appears on `loams.collections`. */
272
+ readonly module: 'collections';
273
+ /** The service behind the module. */
274
+ readonly service: 'loams.collection.v1.CollectionService';
275
+ /** Whether the package's wire contract may still change. */
276
+ readonly unstable: false;
277
+ /**
278
+ * `loams.collection.v1.CollectionService/AddFields`, retried: safe.
279
+ */
280
+ addFields(request: MessageInitShape<typeof AddFieldsRequestSchema>, options?: CallOptions): Promise<AddFieldsResponse>;
281
+ /**
282
+ * `loams.collection.v1.CollectionService/CreateCollection`, retried: safe.
283
+ */
284
+ create(request: MessageInitShape<typeof CreateCollectionRequestSchema>, options?: CallOptions): Promise<CollectionInfo>;
285
+ /**
286
+ * `loams.collection.v1.CollectionService/DropCollection`, retried: safe.
287
+ */
288
+ drop(request: MessageInitShape<typeof DropCollectionRequestSchema>, options?: CallOptions): Promise<DropCollectionResponse>;
289
+ /**
290
+ * `loams.collection.v1.CollectionService/GetCollection`, retried: safe.
291
+ */
292
+ get(request: MessageInitShape<typeof GetCollectionRequestSchema>, options?: CallOptions): Promise<CollectionInfo>;
293
+ /**
294
+ * `loams.collection.v1.CollectionService/ListCollections`, retried: safe. AIP-158: page with `collections` and follow `next_page_token` through `loams.paginate`.
295
+ */
296
+ list(request: MessageInitShape<typeof ListCollectionsRequestSchema>, options?: CallOptions): Promise<ListCollectionsResponse>;
297
+ /**
298
+ * `loams.collection.v1.CollectionService/ListVersions`, retried: safe. AIP-158: page with `versions` and follow `next_page_token` through `loams.paginate`.
299
+ */
300
+ listVersions(request: MessageInitShape<typeof ListVersionsRequestSchema>, options?: CallOptions): Promise<ListVersionsResponse>;
301
+ /**
302
+ * `loams.collection.v1.CollectionService/Scan`, retried: manual.
303
+ */
304
+ scan(request: MessageInitShape<typeof ScanRequestSchema>, options?: CallOptions): Promise<ScanPlan>;
305
+ /**
306
+ * `loams.collection.v1.CollectionService/SetHot`, retried: safe.
307
+ */
308
+ setHot(request: MessageInitShape<typeof SetHotRequestSchema>, options?: CallOptions): Promise<SetHotResponse>;
309
+ /**
310
+ * `loams.collection.v1.CollectionService/UpdateAliases`, retried: safe.
311
+ */
312
+ updateAliases(request: MessageInitShape<typeof UpdateAliasesRequestSchema>, options?: CallOptions): Promise<UpdateAliasesResponse>;
313
+ /**
314
+ * `loams.collection.v1.CollectionService/WarmCollection`, retried: safe.
315
+ */
316
+ warm(request: MessageInitShape<typeof WarmCollectionRequestSchema>, options?: CallOptions): Promise<WarmCollectionResponse>;
317
+ }
318
+ /**
319
+ * `loams.documents` — Documents: write, get, scroll, count, delete by filter and patch by filter.
320
+ *
321
+ * Wraps `loams.collection.v1.DocumentService`.
322
+ */
323
+ export interface DocumentsModule {
324
+ /** The SDK module, as it appears on `loams.documents`. */
325
+ readonly module: 'documents';
326
+ /** The service behind the module. */
327
+ readonly service: 'loams.collection.v1.DocumentService';
328
+ /** Whether the package's wire contract may still change. */
329
+ readonly unstable: false;
330
+ /**
331
+ * `loams.collection.v1.DocumentService/CountDocuments`, retried: safe.
332
+ */
333
+ count(request: MessageInitShape<typeof CountDocumentsRequestSchema>, options?: CallOptions): Promise<CountDocumentsResponse>;
334
+ /**
335
+ * `loams.collection.v1.DocumentService/DeleteByFilter`, retried: manual.
336
+ */
337
+ deleteByFilter(request: MessageInitShape<typeof DeleteByFilterRequestSchema>, options?: CallOptions): Promise<FilterWriteResponse>;
338
+ /**
339
+ * `loams.collection.v1.DocumentService/GetDocuments`, retried: safe.
340
+ */
341
+ get(request: MessageInitShape<typeof GetDocumentsRequestSchema>, options?: CallOptions): Promise<GetDocumentsResponse>;
342
+ /**
343
+ * `loams.collection.v1.DocumentService/PatchByFilter`, retried: manual.
344
+ */
345
+ patchByFilter(request: MessageInitShape<typeof PatchByFilterRequestSchema>, options?: CallOptions): Promise<FilterWriteResponse>;
346
+ /**
347
+ * `loams.collection.v1.DocumentService/ScrollDocuments`, retried: safe.
348
+ */
349
+ scroll(request: MessageInitShape<typeof ScrollDocumentsRequestSchema>, options?: CallOptions): Promise<ScrollDocumentsResponse>;
350
+ /**
351
+ * `loams.collection.v1.DocumentService/WriteDocuments`, retried: manual.
352
+ */
353
+ write(request: MessageInitShape<typeof WriteDocumentsRequestSchema>, options?: CallOptions): Promise<WriteDocumentsResponse>;
354
+ }
355
+ /**
356
+ * `loams.graph` — Loams Graph: stored property graphs, queried with GQL.
357
+ *
358
+ * Wraps `loams.graph.v1.GraphAdminService`. Its wire contract may still change, so `buf breaking` skips it and an SDK marks it experimental (§44 §10.3).
359
+ */
360
+ export interface GraphModule {
361
+ /** The SDK module, as it appears on `loams.graph`. */
362
+ readonly module: 'graph';
363
+ /** The service behind the module. */
364
+ readonly service: 'loams.graph.v1.GraphAdminService';
365
+ /** Whether the package's wire contract may still change. */
366
+ readonly unstable: true;
367
+ /**
368
+ * `loams.graph.v1.GraphAdminService/CreateGraph`, retried: manual.
369
+ */
370
+ create(request: MessageInitShape<typeof CreateGraphRequestSchema>, options?: CallOptions): Promise<Graph>;
371
+ /**
372
+ * `loams.graph.v1.GraphAdminService/DeleteGraph`, retried: manual.
373
+ */
374
+ delete(request: MessageInitShape<typeof DeleteGraphRequestSchema>, options?: CallOptions): Promise<Operation>;
375
+ /**
376
+ * `loams.graph.v1.GraphService/Explain`, retried: safe.
377
+ */
378
+ explain(request: MessageInitShape<typeof ExplainRequestSchema>, options?: CallOptions): Promise<Plan>;
379
+ /**
380
+ * `loams.graph.v1.GraphAdminService/GetGraph`, retried: safe.
381
+ */
382
+ get(request: MessageInitShape<typeof GetGraphRequestSchema>, options?: CallOptions): Promise<Graph>;
383
+ /**
384
+ * `loams.graph.v1.GraphAdminService/ListGraphs`, retried: safe. AIP-158: page with `graphs` and follow `next_page_token` through `loams.paginate`.
385
+ */
386
+ list(request: MessageInitShape<typeof ListGraphsRequestSchema>, options?: CallOptions): Promise<ListGraphsResponse>;
387
+ /**
388
+ * `loams.graph.v1.GraphService/Execute`, retried: manual.
389
+ */
390
+ query(request: MessageInitShape<typeof ExecuteRequestSchema>, options?: CallOptions): Promise<ExecuteResponse>;
391
+ /**
392
+ * `loams.graph.v1.GraphService/ExecuteBatch`, retried: manual.
393
+ */
394
+ queryBatch(request: MessageInitShape<typeof ExecuteBatchRequestSchema>, options?: CallOptions): Promise<ExecuteBatchResponse>;
395
+ /**
396
+ * `loams.graph.v1.GraphService/ExecuteStream`, retried: manual.
397
+ */
398
+ queryStream(request: MessageInitShape<typeof ExecuteStreamRequestSchema>, options?: CallOptions): AsyncIterable<ResultChunk>;
399
+ /**
400
+ * `loams.graph.v1.GraphAdminService/GetSchema`, retried: safe.
401
+ */
402
+ schema(request: MessageInitShape<typeof GetSchemaRequestSchema>, options?: CallOptions): Promise<GraphSchema>;
403
+ /**
404
+ * `loams.graph.v1.GraphAdminService/UpdateGraph`, retried: manual.
405
+ */
406
+ update(request: MessageInitShape<typeof UpdateGraphRequestSchema>, options?: CallOptions): Promise<Graph>;
407
+ }
260
408
  /**
261
409
  * `loams.instance` — What this instance is, and who the caller is on it.
262
410
  *
@@ -360,6 +508,106 @@ export interface LiveAdminModule {
360
508
  */
361
509
  updateApp(request: MessageInitShape<typeof UpdateAppRequestSchema>, options?: CallOptions): Promise<UpdateAppResponse>;
362
510
  }
511
+ /**
512
+ * `loams.namespaces` — Namespaces: the container every collection and stream lives in.
513
+ *
514
+ * Wraps `loams.collection.v1.NamespaceService`.
515
+ */
516
+ export interface NamespacesModule {
517
+ /** The SDK module, as it appears on `loams.namespaces`. */
518
+ readonly module: 'namespaces';
519
+ /** The service behind the module. */
520
+ readonly service: 'loams.collection.v1.NamespaceService';
521
+ /** Whether the package's wire contract may still change. */
522
+ readonly unstable: false;
523
+ /**
524
+ * `loams.collection.v1.NamespaceService/CreateNamespace`, retried: safe.
525
+ */
526
+ create(request: MessageInitShape<typeof CreateNamespaceRequestSchema>, options?: CallOptions): Promise<CreateNamespaceResponse>;
527
+ /**
528
+ * `loams.collection.v1.NamespaceService/ListNamespaces`, retried: safe. AIP-158: page with `namespaces` and follow `next_page_token` through `loams.paginate`.
529
+ */
530
+ list(request: MessageInitShape<typeof ListNamespacesRequestSchema>, options?: CallOptions): Promise<ListNamespacesResponse>;
531
+ }
532
+ /**
533
+ * `loams.search` — Queries: one search over one collection, dense, sparse, text or hybrid.
534
+ *
535
+ * Wraps `loams.collection.v1.QueryService`.
536
+ */
537
+ export interface SearchModule {
538
+ /** The SDK module, as it appears on `loams.search`. */
539
+ readonly module: 'search';
540
+ /** The service behind the module. */
541
+ readonly service: 'loams.collection.v1.QueryService';
542
+ /** Whether the package's wire contract may still change. */
543
+ readonly unstable: false;
544
+ /**
545
+ * `loams.collection.v1.QueryService/Search`, retried: safe.
546
+ */
547
+ query(request: MessageInitShape<typeof SearchRequestSchema>, options?: CallOptions): Promise<SearchResponse>;
548
+ }
549
+ /**
550
+ * `loams.sql` — SQL: one read-only statement over a namespace's collections, with parameters.
551
+ *
552
+ * Wraps `loams.sql.v1.SqlService`.
553
+ */
554
+ export interface SqlModule {
555
+ /** The SDK module, as it appears on `loams.sql`. */
556
+ readonly module: 'sql';
557
+ /** The service behind the module. */
558
+ readonly service: 'loams.sql.v1.SqlService';
559
+ /** Whether the package's wire contract may still change. */
560
+ readonly unstable: false;
561
+ /**
562
+ * `loams.sql.v1.SqlService/Query`, retried: safe.
563
+ */
564
+ query(request: MessageInitShape<typeof SqlV1QueryRequestSchema>, options?: CallOptions): Promise<SqlV1QueryResponse>;
565
+ /**
566
+ * `loams.sql.v1.SqlService/QueryArrow`, retried: safe.
567
+ */
568
+ queryArrow(request: MessageInitShape<typeof QueryArrowRequestSchema>, options?: CallOptions): Promise<QueryArrowResponse>;
569
+ }
570
+ /**
571
+ * `loams.streams` — Streams: create, list and describe a namespace's logs; produce and fetch records and CloudEvents.
572
+ *
573
+ * Wraps `loams.stream.v1.StreamService`.
574
+ */
575
+ export interface StreamsModule {
576
+ /** The SDK module, as it appears on `loams.streams`. */
577
+ readonly module: 'streams';
578
+ /** The service behind the module. */
579
+ readonly service: 'loams.stream.v1.StreamService';
580
+ /** Whether the package's wire contract may still change. */
581
+ readonly unstable: false;
582
+ /**
583
+ * `loams.stream.v1.StreamService/CreateStream`, retried: safe.
584
+ */
585
+ create(request: MessageInitShape<typeof CreateStreamRequestSchema>, options?: CallOptions): Promise<CreateStreamResponse>;
586
+ /**
587
+ * `loams.stream.v1.StreamService/Fetch`, retried: safe.
588
+ */
589
+ fetch(request: MessageInitShape<typeof FetchRequestSchema>, options?: CallOptions): Promise<FetchResponse>;
590
+ /**
591
+ * `loams.stream.v1.StreamService/FetchCloudEvents`, retried: safe.
592
+ */
593
+ fetchEvents(request: MessageInitShape<typeof FetchCloudEventsRequestSchema>, options?: CallOptions): Promise<FetchCloudEventsResponse>;
594
+ /**
595
+ * `loams.stream.v1.StreamService/DescribeStream`, retried: safe.
596
+ */
597
+ get(request: MessageInitShape<typeof DescribeStreamRequestSchema>, options?: CallOptions): Promise<DescribeStreamResponse>;
598
+ /**
599
+ * `loams.stream.v1.StreamService/ListStreams`, retried: safe. AIP-158: page with `streams` and follow `next_page_token` through `loams.paginate`.
600
+ */
601
+ list(request: MessageInitShape<typeof ListStreamsRequestSchema>, options?: CallOptions): Promise<ListStreamsResponse>;
602
+ /**
603
+ * `loams.stream.v1.StreamService/Produce`, retried: manual.
604
+ */
605
+ produce(request: MessageInitShape<typeof ProduceRequestSchema>, options?: CallOptions): Promise<ProduceResponse>;
606
+ /**
607
+ * `loams.stream.v1.StreamService/ProduceCloudEvents`, retried: manual.
608
+ */
609
+ produceEvents(request: MessageInitShape<typeof ProduceCloudEventsRequestSchema>, options?: CallOptions): Promise<ProduceCloudEventsResponse>;
610
+ }
363
611
  /**
364
612
  * A second facade name for the same RPCs, exposed as `loams.tables`.
365
613
  *
@@ -381,6 +629,23 @@ export interface TablesModule {
381
629
  */
382
630
  query(request: MessageInitShape<typeof QueryRequestSchema>, options?: CallOptions): Promise<QueryResponse>;
383
631
  }
632
+ /**
633
+ * A second facade name for the same RPCs, exposed as `loams.vector`.
634
+ *
635
+ * Wraps `loams.collection.v1.QueryService`.
636
+ */
637
+ export interface VectorModule {
638
+ /** The SDK module, as it appears on `loams.vector`. */
639
+ readonly module: 'vector';
640
+ /** The service behind the module. */
641
+ readonly service: 'loams.collection.v1.QueryService';
642
+ /** Whether the package's wire contract may still change. */
643
+ readonly unstable: false;
644
+ /**
645
+ * `loams.collection.v1.QueryService/Search`, retried: safe.
646
+ */
647
+ search(request: MessageInitShape<typeof SearchRequestSchema>, options?: CallOptions): Promise<SearchResponse>;
648
+ }
384
649
  /** One facade call, as the runtime dispatches it. */
385
650
  export interface CallBinding {
386
651
  /** The module the call is exposed on. */
@@ -424,13 +689,13 @@ export declare const MODULES: readonly ModuleBinding[];
424
689
  */
425
690
  export declare const SERVICE_DESCRIPTORS: Readonly<Record<string, DescService>>;
426
691
  /** The proto packages this SDK speaks, as `GetInstance.api_versions` names them. */
427
- export declare const PROTO_PACKAGES: readonly ["google.protobuf", "loams.admin.v1", "loams.approvals.v1", "loams.auth.v1", "loams.collection.v1", "loams.devices.v1", "loams.errors.v1", "loams.graph.v1", "loams.house.v1", "loams.instance.v1", "loams.live.v1", "loams.live.worker.v1", "loams.notifications.v1", "loams.operations.v1", "loams.options.v1", "loams.postgres.v1", "loams.repos.v1"];
692
+ export declare const PROTO_PACKAGES: readonly ["google.protobuf", "loams.admin.v1", "loams.approvals.v1", "loams.auth.v1", "loams.collection.v1", "loams.devices.v1", "loams.errors.v1", "loams.graph.v1", "loams.house.v1", "loams.instance.v1", "loams.live.v1", "loams.live.worker.v1", "loams.memory.v1", "loams.notifications.v1", "loams.operations.v1", "loams.options.v1", "loams.postgres.v1", "loams.repos.v1", "loams.sql.v1", "loams.stream.v1"];
428
693
  /**
429
694
  * Every `reason` in `docs/api/reasons.md` (design §44 §7.4, D611). Within
430
695
  * an API major version a reason is never renamed and never removed, so
431
696
  * this union only grows; a caller switching on it is exhaustive.
432
697
  */
433
- export declare const REASONS: readonly ["approval_expired", "approval_already_decided", "approval_stale_revision", "requester_cannot_approve", "decision_proof_invalid", "step_up_required", "reason_required", "invalid_decision", "pairing_expired", "pairing_used", "device_revoked", "push_target_unknown", "not_implemented", "feature_not_in_variant", "house_not_configured", "house_syntax_error", "house_unknown_table", "house_unknown_database", "house_access_denied", "house_read_only", "house_timeout", "house_memory_limit", "house_too_many_queries", "house_quota_exceeded", "house_disabled_function", "house_cancelled", "house_query_not_found", "house_query_failed", "project_not_found", "branch_has_children", "branch_protected", "lsn_out_of_retention", "endpoint_exists_for_branch", "compute_start_failed", "quota_exceeded", "storage_unavailable", "secret_already_issued", "repo_not_found", "repo_already_exists", "repo_deleting", "ref_stale", "ref_protected", "out_of_scope", "object_format_unsupported", "fork_too_deep", "sequencer_unavailable", "idempotency_key_reused", "workspace_not_found", "workspace_fenced", "workspace_read_only", "workspace_name_taken", "object_missing", "secret_detected", "env_unsealed", "env_access_denied", "env_foreign_reference", "live_bad_cursor", "live_worker_crashed", "live_deploy_conflict", "live_schema_violation", "live_index_not_ready", "live_app_disabled", "live_app_exists", "live_function_error", "live_function_timeout", "live_function_out_of_memory", "live_limit_exceeded", "live_app_mismatch", "live_origin_not_allowed", "session_rotate", "session_gone", "node_draining", "role_required", "setup_required", "token_missing", "token_malformed", "token_revoked", "token_not_yet_valid", "token_bad_signature", "token_wrong_audience", "token_wrong_issuer", "token_unknown_key", "token_algorithm_not_allowed", "api_key_invalid", "credential_not_accepted", "credential_in_query_string", "csrf_token_invalid", "principal_not_allowed", "cors_origin_not_allowed", "auth_unavailable", "invalid_argument", "not_found", "already_exists", "permission_denied", "token_expired", "unauthenticated", "failed_precondition", "resource_exhausted", "unavailable", "deadline_exceeded", "aborted", "internal"];
698
+ export declare const REASONS: readonly ["approval_expired", "approval_already_decided", "approval_stale_revision", "requester_cannot_approve", "decision_proof_invalid", "step_up_required", "reason_required", "invalid_decision", "pairing_expired", "pairing_used", "device_revoked", "push_target_unknown", "not_implemented", "feature_not_in_variant", "house_not_configured", "house_syntax_error", "house_unknown_table", "house_unknown_database", "house_access_denied", "house_read_only", "house_timeout", "house_memory_limit", "house_too_many_queries", "house_quota_exceeded", "house_disabled_function", "house_cancelled", "house_query_not_found", "house_query_failed", "project_not_found", "branch_has_children", "branch_protected", "lsn_out_of_retention", "endpoint_exists_for_branch", "compute_start_failed", "quota_exceeded", "storage_unavailable", "secret_already_issued", "repo_not_found", "repo_already_exists", "repo_deleting", "ref_stale", "ref_protected", "out_of_scope", "object_format_unsupported", "fork_too_deep", "sequencer_unavailable", "idempotency_key_reused", "workspace_not_found", "workspace_fenced", "batch_partially_applied", "workspace_read_only", "workspace_name_taken", "object_missing", "secret_detected", "env_unsealed", "env_access_denied", "env_foreign_reference", "memory_store_not_found", "memory_space_not_found", "memory_space_limit", "memory_managed_object", "memory_block_version_mismatch", "memory_block_too_large", "memory_core_budget_exceeded", "memory_content_too_large", "memory_secret_detected", "memory_pii_refused", "memory_model_not_configured", "memory_model_not_local", "memory_token_budget_exhausted", "memory_extraction_failed", "memory_too_many_spaces", "memory_cross_space_write", "memory_not_yet_available", "code_repo_not_indexed", "code_index_building", "code_change_too_large", "code_language_unsupported", "code_scip_invalid", "live_bad_cursor", "live_worker_crashed", "live_deploy_conflict", "live_schema_violation", "filter_conflict", "search_after_needs_tiebreak", "invalid_consistency_token", "namespace_required", "sql_param_count", "live_index_not_ready", "live_app_disabled", "live_app_exists", "live_function_error", "live_function_timeout", "client_deadline_exceeded", "live_function_out_of_memory", "live_limit_exceeded", "result_too_large", "live_app_mismatch", "live_origin_not_allowed", "session_rotate", "session_gone", "node_draining", "role_required", "setup_required", "token_missing", "token_malformed", "token_revoked", "token_not_yet_valid", "token_bad_signature", "token_wrong_audience", "token_wrong_issuer", "token_unknown_key", "token_algorithm_not_allowed", "api_key_invalid", "credential_not_accepted", "credential_in_query_string", "csrf_token_invalid", "principal_not_allowed", "cors_origin_not_allowed", "auth_unavailable", "invalid_argument", "not_found", "already_exists", "permission_denied", "token_expired", "unauthenticated", "failed_precondition", "resource_exhausted", "unavailable", "deadline_exceeded", "aborted", "internal"];
434
699
  /** A stable, machine-readable cause of a failed RPC. */
435
700
  export type Reason = (typeof REASONS)[number];
436
701
  /** The Connect code each reason is raised under, from the same registry. */