@databricks/sdk-agentkit 0.0.0-stage → 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +203 -0
- package/README.md +22 -2
- package/dist/package.js +7 -0
- package/dist/package.js.map +1 -0
- package/dist/v1/client.d.ts +111 -0
- package/dist/v1/client.d.ts.map +1 -0
- package/dist/v1/client.js +710 -0
- package/dist/v1/client.js.map +1 -0
- package/dist/v1/index.d.ts +3 -0
- package/dist/v1/index.js +4 -0
- package/dist/v1/model.d.ts +620 -0
- package/dist/v1/model.d.ts.map +1 -0
- package/dist/v1/model.js +405 -0
- package/dist/v1/model.js.map +1 -0
- package/dist/v1/transport.d.ts +37 -0
- package/dist/v1/transport.d.ts.map +1 -0
- package/dist/v1/transport.js +73 -0
- package/dist/v1/transport.js.map +1 -0
- package/dist/v1/utils.d.ts +25 -0
- package/dist/v1/utils.d.ts.map +1 -0
- package/dist/v1/utils.js +87 -0
- package/dist/v1/utils.js.map +1 -0
- package/package.json +44 -4
package/dist/v1/model.js
ADDED
|
@@ -0,0 +1,405 @@
|
|
|
1
|
+
import { Temporal } from "@js-temporal/polyfill";
|
|
2
|
+
import { FieldMask } from "@databricks/sdk-core/wkt";
|
|
3
|
+
import { z } from "zod";
|
|
4
|
+
|
|
5
|
+
//#region src/v1/model.ts
|
|
6
|
+
const jsonValueSchema = z.lazy(() => z.union([
|
|
7
|
+
z.null(),
|
|
8
|
+
z.number(),
|
|
9
|
+
z.string(),
|
|
10
|
+
z.boolean(),
|
|
11
|
+
z.record(z.string(), jsonValueSchema),
|
|
12
|
+
z.array(jsonValueSchema)
|
|
13
|
+
]));
|
|
14
|
+
/** Identifies the source that created a managed memory entry. */
|
|
15
|
+
const ManagedMemoryEntrySourceType = {
|
|
16
|
+
MANAGED_MEMORY_ENTRY_SOURCE_TYPE_AGENT: "MANAGED_MEMORY_ENTRY_SOURCE_TYPE_AGENT",
|
|
17
|
+
MANAGED_MEMORY_ENTRY_SOURCE_TYPE_DREAMER: "MANAGED_MEMORY_ENTRY_SOURCE_TYPE_DREAMER"
|
|
18
|
+
};
|
|
19
|
+
/** Controls how much managed memory entry data is returned. */
|
|
20
|
+
const ManagedMemoryEntryView = {
|
|
21
|
+
MANAGED_MEMORY_ENTRY_VIEW_UNSPECIFIED: "MANAGED_MEMORY_ENTRY_VIEW_UNSPECIFIED",
|
|
22
|
+
MANAGED_MEMORY_ENTRY_VIEW_BASIC: "MANAGED_MEMORY_ENTRY_VIEW_BASIC",
|
|
23
|
+
MANAGED_MEMORY_ENTRY_VIEW_FULL: "MANAGED_MEMORY_ENTRY_VIEW_FULL"
|
|
24
|
+
};
|
|
25
|
+
/** Type of service-managed storage backing a managed memory store. */
|
|
26
|
+
const StorageBackendType = {
|
|
27
|
+
STORAGE_BACKEND_TYPE_UNSPECIFIED: "STORAGE_BACKEND_TYPE_UNSPECIFIED",
|
|
28
|
+
STORAGE_BACKEND_TYPE_LAKEBASE: "STORAGE_BACKEND_TYPE_LAKEBASE"
|
|
29
|
+
};
|
|
30
|
+
const unmarshalAppendSessionItemsResponseSchema = z.object({ session_items: z.array(z.lazy(() => unmarshalSessionItemSchema)).optional() }).transform((d) => ({ sessionItems: d.session_items }));
|
|
31
|
+
const unmarshalClearSessionItemsResponseSchema = z.object({});
|
|
32
|
+
const unmarshalExtractMemoriesResponseSchema = z.object({
|
|
33
|
+
name: z.string().optional(),
|
|
34
|
+
entries: z.array(z.lazy(() => unmarshalManagedMemoryEntrySchema)).optional()
|
|
35
|
+
}).transform((d) => ({
|
|
36
|
+
name: d.name,
|
|
37
|
+
entries: d.entries
|
|
38
|
+
}));
|
|
39
|
+
const unmarshalForkSessionResponseSchema = z.object({ session: z.lazy(() => unmarshalSessionSchema).optional() }).transform((d) => ({ session: d.session }));
|
|
40
|
+
const unmarshalListManagedMemoryEntriesResponseSchema = z.object({
|
|
41
|
+
managed_memory_entries: z.array(z.lazy(() => unmarshalManagedMemoryEntrySchema)).optional(),
|
|
42
|
+
next_page_token: z.string().optional()
|
|
43
|
+
}).transform((d) => ({
|
|
44
|
+
managedMemoryEntries: d.managed_memory_entries,
|
|
45
|
+
nextPageToken: d.next_page_token
|
|
46
|
+
}));
|
|
47
|
+
const unmarshalListManagedMemoryStoresResponseSchema = z.object({
|
|
48
|
+
managed_memory_stores: z.array(z.lazy(() => unmarshalManagedMemoryStoreSchema)).optional(),
|
|
49
|
+
next_page_token: z.string().optional()
|
|
50
|
+
}).transform((d) => ({
|
|
51
|
+
managedMemoryStores: d.managed_memory_stores,
|
|
52
|
+
nextPageToken: d.next_page_token
|
|
53
|
+
}));
|
|
54
|
+
const unmarshalListSessionItemsResponseSchema = z.object({
|
|
55
|
+
session_items: z.array(z.lazy(() => unmarshalSessionItemSchema)).optional(),
|
|
56
|
+
next_page_token: z.string().optional()
|
|
57
|
+
}).transform((d) => ({
|
|
58
|
+
sessionItems: d.session_items,
|
|
59
|
+
nextPageToken: d.next_page_token
|
|
60
|
+
}));
|
|
61
|
+
const unmarshalListSessionStoresResponseSchema = z.object({
|
|
62
|
+
session_stores: z.array(z.lazy(() => unmarshalSessionStoreSchema)).optional(),
|
|
63
|
+
next_page_token: z.string().optional()
|
|
64
|
+
}).transform((d) => ({
|
|
65
|
+
sessionStores: d.session_stores,
|
|
66
|
+
nextPageToken: d.next_page_token
|
|
67
|
+
}));
|
|
68
|
+
const unmarshalListSessionsResponseSchema = z.object({
|
|
69
|
+
sessions: z.array(z.lazy(() => unmarshalSessionSchema)).optional(),
|
|
70
|
+
next_page_token: z.string().optional()
|
|
71
|
+
}).transform((d) => ({
|
|
72
|
+
sessions: d.sessions,
|
|
73
|
+
nextPageToken: d.next_page_token
|
|
74
|
+
}));
|
|
75
|
+
const unmarshalManagedMemoryEntrySchema = z.object({
|
|
76
|
+
name: z.string().optional(),
|
|
77
|
+
actor_id: z.string().optional(),
|
|
78
|
+
session_id: z.string().optional(),
|
|
79
|
+
path: z.string().optional(),
|
|
80
|
+
content: z.string().optional(),
|
|
81
|
+
description: z.string().optional(),
|
|
82
|
+
source_type: z.string().optional(),
|
|
83
|
+
create_time: z.string().transform((s) => Temporal.Instant.from(s)).optional(),
|
|
84
|
+
update_time: z.string().transform((s) => Temporal.Instant.from(s)).optional()
|
|
85
|
+
}).transform((d) => ({
|
|
86
|
+
name: d.name,
|
|
87
|
+
actorId: d.actor_id,
|
|
88
|
+
sessionId: d.session_id,
|
|
89
|
+
path: d.path,
|
|
90
|
+
content: d.content,
|
|
91
|
+
description: d.description,
|
|
92
|
+
sourceType: d.source_type,
|
|
93
|
+
createTime: d.create_time,
|
|
94
|
+
updateTime: d.update_time
|
|
95
|
+
}));
|
|
96
|
+
const unmarshalManagedMemoryEntrySearchResultSchema = z.object({
|
|
97
|
+
managed_memory_entry: z.lazy(() => unmarshalManagedMemoryEntrySchema).optional(),
|
|
98
|
+
score: z.number().optional()
|
|
99
|
+
}).transform((d) => ({
|
|
100
|
+
managedMemoryEntry: d.managed_memory_entry,
|
|
101
|
+
score: d.score
|
|
102
|
+
}));
|
|
103
|
+
const unmarshalManagedMemoryStoreSchema = z.object({
|
|
104
|
+
name: z.string().optional(),
|
|
105
|
+
display_name: z.string().optional(),
|
|
106
|
+
workspace_id: z.union([
|
|
107
|
+
z.number(),
|
|
108
|
+
z.bigint(),
|
|
109
|
+
z.string()
|
|
110
|
+
]).transform((v) => BigInt(v)).optional(),
|
|
111
|
+
storage_backend: z.lazy(() => unmarshalStorageBackendSchema).optional(),
|
|
112
|
+
owner_user_id: z.string().optional(),
|
|
113
|
+
creator_user_id: z.string().optional(),
|
|
114
|
+
description: z.string().optional(),
|
|
115
|
+
create_time: z.string().transform((s) => Temporal.Instant.from(s)).optional(),
|
|
116
|
+
update_time: z.string().transform((s) => Temporal.Instant.from(s)).optional()
|
|
117
|
+
}).transform((d) => ({
|
|
118
|
+
name: d.name,
|
|
119
|
+
displayName: d.display_name,
|
|
120
|
+
workspaceId: d.workspace_id,
|
|
121
|
+
storageBackend: d.storage_backend,
|
|
122
|
+
ownerUserId: d.owner_user_id,
|
|
123
|
+
creatorUserId: d.creator_user_id,
|
|
124
|
+
description: d.description,
|
|
125
|
+
createTime: d.create_time,
|
|
126
|
+
updateTime: d.update_time
|
|
127
|
+
}));
|
|
128
|
+
const unmarshalPopSessionItemResponseSchema = z.object({ item: z.lazy(() => unmarshalSessionItemSchema).optional() }).transform((d) => ({ item: d.item }));
|
|
129
|
+
const unmarshalSearchManagedMemoryEntriesResponseSchema = z.object({
|
|
130
|
+
managed_memory_entries: z.array(z.lazy(() => unmarshalManagedMemoryEntrySchema)).optional(),
|
|
131
|
+
next_page_token: z.string().optional(),
|
|
132
|
+
results: z.array(z.lazy(() => unmarshalManagedMemoryEntrySearchResultSchema)).optional()
|
|
133
|
+
}).transform((d) => ({
|
|
134
|
+
managedMemoryEntries: d.managed_memory_entries,
|
|
135
|
+
nextPageToken: d.next_page_token,
|
|
136
|
+
results: d.results
|
|
137
|
+
}));
|
|
138
|
+
const unmarshalSessionSchema = z.object({
|
|
139
|
+
session_id: z.string().optional(),
|
|
140
|
+
actor_id: z.string().optional(),
|
|
141
|
+
parent_session_id: z.string().optional(),
|
|
142
|
+
root_session_id: z.string().optional(),
|
|
143
|
+
metadata: z.record(z.string(), z.string()).optional(),
|
|
144
|
+
create_time: z.string().transform((s) => Temporal.Instant.from(s)).optional(),
|
|
145
|
+
update_time: z.string().transform((s) => Temporal.Instant.from(s)).optional(),
|
|
146
|
+
last_activity_time: z.string().transform((s) => Temporal.Instant.from(s)).optional(),
|
|
147
|
+
name: z.string().optional()
|
|
148
|
+
}).transform((d) => ({
|
|
149
|
+
sessionId: d.session_id,
|
|
150
|
+
actorId: d.actor_id,
|
|
151
|
+
parentSessionId: d.parent_session_id,
|
|
152
|
+
rootSessionId: d.root_session_id,
|
|
153
|
+
metadata: d.metadata,
|
|
154
|
+
createTime: d.create_time,
|
|
155
|
+
updateTime: d.update_time,
|
|
156
|
+
lastActivityTime: d.last_activity_time,
|
|
157
|
+
name: d.name
|
|
158
|
+
}));
|
|
159
|
+
const unmarshalSessionItemSchema = z.object({
|
|
160
|
+
item_id: z.string().optional(),
|
|
161
|
+
data: jsonValueSchema.optional(),
|
|
162
|
+
create_time: z.string().transform((s) => Temporal.Instant.from(s)).optional()
|
|
163
|
+
}).transform((d) => ({
|
|
164
|
+
itemId: d.item_id,
|
|
165
|
+
data: d.data,
|
|
166
|
+
createTime: d.create_time
|
|
167
|
+
}));
|
|
168
|
+
const unmarshalSessionStoreSchema = z.object({
|
|
169
|
+
creator_user_id: z.string().optional(),
|
|
170
|
+
create_time: z.string().transform((s) => Temporal.Instant.from(s)).optional(),
|
|
171
|
+
update_time: z.string().transform((s) => Temporal.Instant.from(s)).optional(),
|
|
172
|
+
description: z.string().optional(),
|
|
173
|
+
metadata: z.record(z.string(), z.string()).optional(),
|
|
174
|
+
name: z.string().optional()
|
|
175
|
+
}).transform((d) => ({
|
|
176
|
+
creatorUserId: d.creator_user_id,
|
|
177
|
+
createTime: d.create_time,
|
|
178
|
+
updateTime: d.update_time,
|
|
179
|
+
description: d.description,
|
|
180
|
+
metadata: d.metadata,
|
|
181
|
+
name: d.name
|
|
182
|
+
}));
|
|
183
|
+
const unmarshalStorageBackendSchema = z.object({
|
|
184
|
+
backend_type: z.string().optional(),
|
|
185
|
+
backend_id: z.string().optional()
|
|
186
|
+
}).transform((d) => ({
|
|
187
|
+
backendType: d.backend_type,
|
|
188
|
+
backendId: d.backend_id
|
|
189
|
+
}));
|
|
190
|
+
const marshalAppendSessionItemsRequestSchema = z.object({
|
|
191
|
+
items: z.array(z.lazy(() => marshalSessionItemSchema)).optional(),
|
|
192
|
+
parent: z.string().optional()
|
|
193
|
+
}).transform((d) => ({
|
|
194
|
+
items: d.items,
|
|
195
|
+
parent: d.parent
|
|
196
|
+
}));
|
|
197
|
+
const marshalClearSessionItemsRequestSchema = z.object({ parent: z.string().optional() }).transform((d) => ({ parent: d.parent }));
|
|
198
|
+
const marshalExtractMemoriesRequestSchema = z.object({
|
|
199
|
+
memoryStore: z.string().optional(),
|
|
200
|
+
sessionStore: z.string().optional(),
|
|
201
|
+
sessionId: z.string().optional(),
|
|
202
|
+
instructions: z.string().optional(),
|
|
203
|
+
dryRun: z.boolean().optional()
|
|
204
|
+
}).transform((d) => ({
|
|
205
|
+
memory_store: d.memoryStore,
|
|
206
|
+
session_store: d.sessionStore,
|
|
207
|
+
session_id: d.sessionId,
|
|
208
|
+
instructions: d.instructions,
|
|
209
|
+
dry_run: d.dryRun
|
|
210
|
+
}));
|
|
211
|
+
const marshalForkSessionRequestSchema = z.object({
|
|
212
|
+
sourceSessionId: z.string().optional(),
|
|
213
|
+
upToItemId: z.string().optional(),
|
|
214
|
+
sessionId: z.string().optional(),
|
|
215
|
+
actorId: z.string().optional(),
|
|
216
|
+
metadata: z.record(z.string(), z.string()).optional(),
|
|
217
|
+
parent: z.string().optional()
|
|
218
|
+
}).transform((d) => ({
|
|
219
|
+
source_session_id: d.sourceSessionId,
|
|
220
|
+
up_to_item_id: d.upToItemId,
|
|
221
|
+
session_id: d.sessionId,
|
|
222
|
+
actor_id: d.actorId,
|
|
223
|
+
metadata: d.metadata,
|
|
224
|
+
parent: d.parent
|
|
225
|
+
}));
|
|
226
|
+
const marshalManagedMemoryEntrySchema = z.object({
|
|
227
|
+
name: z.string().optional(),
|
|
228
|
+
actorId: z.string().optional(),
|
|
229
|
+
sessionId: z.string().optional(),
|
|
230
|
+
path: z.string().optional(),
|
|
231
|
+
content: z.string().optional(),
|
|
232
|
+
description: z.string().optional(),
|
|
233
|
+
sourceType: z.string().optional(),
|
|
234
|
+
createTime: z.any().transform((d) => d.toString()).optional(),
|
|
235
|
+
updateTime: z.any().transform((d) => d.toString()).optional()
|
|
236
|
+
}).transform((d) => ({
|
|
237
|
+
name: d.name,
|
|
238
|
+
actor_id: d.actorId,
|
|
239
|
+
session_id: d.sessionId,
|
|
240
|
+
path: d.path,
|
|
241
|
+
content: d.content,
|
|
242
|
+
description: d.description,
|
|
243
|
+
source_type: d.sourceType,
|
|
244
|
+
create_time: d.createTime,
|
|
245
|
+
update_time: d.updateTime
|
|
246
|
+
}));
|
|
247
|
+
const marshalManagedMemoryStoreSchema = z.object({
|
|
248
|
+
name: z.string().optional(),
|
|
249
|
+
displayName: z.string().optional(),
|
|
250
|
+
workspaceId: z.bigint().optional(),
|
|
251
|
+
storageBackend: z.lazy(() => marshalStorageBackendSchema).optional(),
|
|
252
|
+
ownerUserId: z.string().optional(),
|
|
253
|
+
creatorUserId: z.string().optional(),
|
|
254
|
+
description: z.string().optional(),
|
|
255
|
+
createTime: z.any().transform((d) => d.toString()).optional(),
|
|
256
|
+
updateTime: z.any().transform((d) => d.toString()).optional()
|
|
257
|
+
}).transform((d) => ({
|
|
258
|
+
name: d.name,
|
|
259
|
+
display_name: d.displayName,
|
|
260
|
+
workspace_id: d.workspaceId,
|
|
261
|
+
storage_backend: d.storageBackend,
|
|
262
|
+
owner_user_id: d.ownerUserId,
|
|
263
|
+
creator_user_id: d.creatorUserId,
|
|
264
|
+
description: d.description,
|
|
265
|
+
create_time: d.createTime,
|
|
266
|
+
update_time: d.updateTime
|
|
267
|
+
}));
|
|
268
|
+
const marshalPopSessionItemRequestSchema = z.object({ parent: z.string().optional() }).transform((d) => ({ parent: d.parent }));
|
|
269
|
+
const marshalSearchManagedMemoryEntriesRequestSchema = z.object({
|
|
270
|
+
parent: z.string().optional(),
|
|
271
|
+
actorId: z.string().optional(),
|
|
272
|
+
query: z.string().optional(),
|
|
273
|
+
limit: z.number().optional(),
|
|
274
|
+
pageSize: z.number().optional(),
|
|
275
|
+
pageToken: z.string().optional(),
|
|
276
|
+
sessionId: z.string().optional(),
|
|
277
|
+
pathPrefix: z.string().optional(),
|
|
278
|
+
view: z.string().optional()
|
|
279
|
+
}).transform((d) => ({
|
|
280
|
+
parent: d.parent,
|
|
281
|
+
actor_id: d.actorId,
|
|
282
|
+
query: d.query,
|
|
283
|
+
limit: d.limit,
|
|
284
|
+
page_size: d.pageSize,
|
|
285
|
+
page_token: d.pageToken,
|
|
286
|
+
session_id: d.sessionId,
|
|
287
|
+
path_prefix: d.pathPrefix,
|
|
288
|
+
view: d.view
|
|
289
|
+
}));
|
|
290
|
+
const marshalSessionSchema = z.object({
|
|
291
|
+
sessionId: z.string().optional(),
|
|
292
|
+
actorId: z.string().optional(),
|
|
293
|
+
parentSessionId: z.string().optional(),
|
|
294
|
+
rootSessionId: z.string().optional(),
|
|
295
|
+
metadata: z.record(z.string(), z.string()).optional(),
|
|
296
|
+
createTime: z.any().transform((d) => d.toString()).optional(),
|
|
297
|
+
updateTime: z.any().transform((d) => d.toString()).optional(),
|
|
298
|
+
lastActivityTime: z.any().transform((d) => d.toString()).optional(),
|
|
299
|
+
name: z.string().optional()
|
|
300
|
+
}).transform((d) => ({
|
|
301
|
+
session_id: d.sessionId,
|
|
302
|
+
actor_id: d.actorId,
|
|
303
|
+
parent_session_id: d.parentSessionId,
|
|
304
|
+
root_session_id: d.rootSessionId,
|
|
305
|
+
metadata: d.metadata,
|
|
306
|
+
create_time: d.createTime,
|
|
307
|
+
update_time: d.updateTime,
|
|
308
|
+
last_activity_time: d.lastActivityTime,
|
|
309
|
+
name: d.name
|
|
310
|
+
}));
|
|
311
|
+
const marshalSessionItemSchema = z.object({
|
|
312
|
+
itemId: z.string().optional(),
|
|
313
|
+
data: jsonValueSchema.optional(),
|
|
314
|
+
createTime: z.any().transform((d) => d.toString()).optional()
|
|
315
|
+
}).transform((d) => ({
|
|
316
|
+
item_id: d.itemId,
|
|
317
|
+
data: d.data,
|
|
318
|
+
create_time: d.createTime
|
|
319
|
+
}));
|
|
320
|
+
const marshalSessionStoreSchema = z.object({
|
|
321
|
+
creatorUserId: z.string().optional(),
|
|
322
|
+
createTime: z.any().transform((d) => d.toString()).optional(),
|
|
323
|
+
updateTime: z.any().transform((d) => d.toString()).optional(),
|
|
324
|
+
description: z.string().optional(),
|
|
325
|
+
metadata: z.record(z.string(), z.string()).optional(),
|
|
326
|
+
name: z.string().optional()
|
|
327
|
+
}).transform((d) => ({
|
|
328
|
+
creator_user_id: d.creatorUserId,
|
|
329
|
+
create_time: d.createTime,
|
|
330
|
+
update_time: d.updateTime,
|
|
331
|
+
description: d.description,
|
|
332
|
+
metadata: d.metadata,
|
|
333
|
+
name: d.name
|
|
334
|
+
}));
|
|
335
|
+
const marshalStorageBackendSchema = z.object({
|
|
336
|
+
backendType: z.string().optional(),
|
|
337
|
+
backendId: z.string().optional()
|
|
338
|
+
}).transform((d) => ({
|
|
339
|
+
backend_type: d.backendType,
|
|
340
|
+
backend_id: d.backendId
|
|
341
|
+
}));
|
|
342
|
+
const managedMemoryEntryFieldMaskSchema = {
|
|
343
|
+
actorId: { wire: "actor_id" },
|
|
344
|
+
content: { wire: "content" },
|
|
345
|
+
createTime: { wire: "create_time" },
|
|
346
|
+
description: { wire: "description" },
|
|
347
|
+
name: { wire: "name" },
|
|
348
|
+
path: { wire: "path" },
|
|
349
|
+
sessionId: { wire: "session_id" },
|
|
350
|
+
sourceType: { wire: "source_type" },
|
|
351
|
+
updateTime: { wire: "update_time" }
|
|
352
|
+
};
|
|
353
|
+
function managedMemoryEntryFieldMask(...paths) {
|
|
354
|
+
return FieldMask.build(paths, managedMemoryEntryFieldMaskSchema);
|
|
355
|
+
}
|
|
356
|
+
const managedMemoryStoreFieldMaskSchema = {
|
|
357
|
+
createTime: { wire: "create_time" },
|
|
358
|
+
creatorUserId: { wire: "creator_user_id" },
|
|
359
|
+
description: { wire: "description" },
|
|
360
|
+
displayName: { wire: "display_name" },
|
|
361
|
+
name: { wire: "name" },
|
|
362
|
+
ownerUserId: { wire: "owner_user_id" },
|
|
363
|
+
storageBackend: {
|
|
364
|
+
wire: "storage_backend",
|
|
365
|
+
children: () => storageBackendFieldMaskSchema
|
|
366
|
+
},
|
|
367
|
+
updateTime: { wire: "update_time" },
|
|
368
|
+
workspaceId: { wire: "workspace_id" }
|
|
369
|
+
};
|
|
370
|
+
function managedMemoryStoreFieldMask(...paths) {
|
|
371
|
+
return FieldMask.build(paths, managedMemoryStoreFieldMaskSchema);
|
|
372
|
+
}
|
|
373
|
+
const sessionFieldMaskSchema = {
|
|
374
|
+
actorId: { wire: "actor_id" },
|
|
375
|
+
createTime: { wire: "create_time" },
|
|
376
|
+
lastActivityTime: { wire: "last_activity_time" },
|
|
377
|
+
metadata: { wire: "metadata" },
|
|
378
|
+
name: { wire: "name" },
|
|
379
|
+
parentSessionId: { wire: "parent_session_id" },
|
|
380
|
+
rootSessionId: { wire: "root_session_id" },
|
|
381
|
+
sessionId: { wire: "session_id" },
|
|
382
|
+
updateTime: { wire: "update_time" }
|
|
383
|
+
};
|
|
384
|
+
function sessionFieldMask(...paths) {
|
|
385
|
+
return FieldMask.build(paths, sessionFieldMaskSchema);
|
|
386
|
+
}
|
|
387
|
+
const sessionStoreFieldMaskSchema = {
|
|
388
|
+
createTime: { wire: "create_time" },
|
|
389
|
+
creatorUserId: { wire: "creator_user_id" },
|
|
390
|
+
description: { wire: "description" },
|
|
391
|
+
metadata: { wire: "metadata" },
|
|
392
|
+
name: { wire: "name" },
|
|
393
|
+
updateTime: { wire: "update_time" }
|
|
394
|
+
};
|
|
395
|
+
function sessionStoreFieldMask(...paths) {
|
|
396
|
+
return FieldMask.build(paths, sessionStoreFieldMaskSchema);
|
|
397
|
+
}
|
|
398
|
+
const storageBackendFieldMaskSchema = {
|
|
399
|
+
backendId: { wire: "backend_id" },
|
|
400
|
+
backendType: { wire: "backend_type" }
|
|
401
|
+
};
|
|
402
|
+
|
|
403
|
+
//#endregion
|
|
404
|
+
export { ManagedMemoryEntrySourceType, ManagedMemoryEntryView, StorageBackendType, managedMemoryEntryFieldMask, managedMemoryStoreFieldMask, marshalAppendSessionItemsRequestSchema, marshalClearSessionItemsRequestSchema, marshalExtractMemoriesRequestSchema, marshalForkSessionRequestSchema, marshalManagedMemoryEntrySchema, marshalManagedMemoryStoreSchema, marshalPopSessionItemRequestSchema, marshalSearchManagedMemoryEntriesRequestSchema, marshalSessionItemSchema, marshalSessionSchema, marshalSessionStoreSchema, marshalStorageBackendSchema, sessionFieldMask, sessionStoreFieldMask, unmarshalAppendSessionItemsResponseSchema, unmarshalClearSessionItemsResponseSchema, unmarshalExtractMemoriesResponseSchema, unmarshalForkSessionResponseSchema, unmarshalListManagedMemoryEntriesResponseSchema, unmarshalListManagedMemoryStoresResponseSchema, unmarshalListSessionItemsResponseSchema, unmarshalListSessionStoresResponseSchema, unmarshalListSessionsResponseSchema, unmarshalManagedMemoryEntrySchema, unmarshalManagedMemoryEntrySearchResultSchema, unmarshalManagedMemoryStoreSchema, unmarshalPopSessionItemResponseSchema, unmarshalSearchManagedMemoryEntriesResponseSchema, unmarshalSessionItemSchema, unmarshalSessionSchema, unmarshalSessionStoreSchema, unmarshalStorageBackendSchema };
|
|
405
|
+
//# sourceMappingURL=model.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"model.js","names":[],"sources":["../../src/v1/model.ts"],"sourcesContent":["// Code generated from API definition by Databricks SDK Generator. DO NOT EDIT.\n\nimport {Temporal} from '@js-temporal/polyfill';\nimport {FieldMask} from '@databricks/sdk-core/wkt';\nimport type {FieldMaskSchema, JsonValue} from '@databricks/sdk-core/wkt';\nimport {z} from 'zod';\n\nconst jsonValueSchema: z.ZodType<JsonValue> = z.lazy(() =>\n z.union([\n z.null(),\n z.number(),\n z.string(),\n z.boolean(),\n z.record(z.string(), jsonValueSchema),\n z.array(jsonValueSchema),\n ])\n);\n\n/** Identifies the source that created a managed memory entry. */\n// eslint-disable-next-line @typescript-eslint/naming-convention -- Enum-style const object.\nexport const ManagedMemoryEntrySourceType = {\n /** The managed memory entry was created by an agent during a live conversation. */\n MANAGED_MEMORY_ENTRY_SOURCE_TYPE_AGENT:\n 'MANAGED_MEMORY_ENTRY_SOURCE_TYPE_AGENT',\n /** The managed memory entry was distilled from prior sessions by the dreamer pipeline. */\n MANAGED_MEMORY_ENTRY_SOURCE_TYPE_DREAMER:\n 'MANAGED_MEMORY_ENTRY_SOURCE_TYPE_DREAMER',\n} as const;\nexport type ManagedMemoryEntrySourceType =\n | (typeof ManagedMemoryEntrySourceType)[keyof typeof ManagedMemoryEntrySourceType]\n | (string & {});\n\n/** Controls how much managed memory entry data is returned. */\n// eslint-disable-next-line @typescript-eslint/naming-convention -- Enum-style const object.\nexport const ManagedMemoryEntryView = {\n /** Default view. Returns all entry fields, including `content`. */\n MANAGED_MEMORY_ENTRY_VIEW_UNSPECIFIED:\n 'MANAGED_MEMORY_ENTRY_VIEW_UNSPECIFIED',\n /** Returns entry metadata without `content`. */\n MANAGED_MEMORY_ENTRY_VIEW_BASIC: 'MANAGED_MEMORY_ENTRY_VIEW_BASIC',\n /** Returns all entry fields, including `content`. */\n MANAGED_MEMORY_ENTRY_VIEW_FULL: 'MANAGED_MEMORY_ENTRY_VIEW_FULL',\n} as const;\nexport type ManagedMemoryEntryView =\n | (typeof ManagedMemoryEntryView)[keyof typeof ManagedMemoryEntryView]\n | (string & {});\n\n/** Type of service-managed storage backing a managed memory store. */\n// eslint-disable-next-line @typescript-eslint/naming-convention -- Enum-style const object.\nexport const StorageBackendType = {\n /** Default value. Returned when the storage backend type is not set. */\n STORAGE_BACKEND_TYPE_UNSPECIFIED: 'STORAGE_BACKEND_TYPE_UNSPECIFIED',\n /** Lakebase-managed storage backing the managed memory store. */\n STORAGE_BACKEND_TYPE_LAKEBASE: 'STORAGE_BACKEND_TYPE_LAKEBASE',\n} as const;\nexport type StorageBackendType =\n | (typeof StorageBackendType)[keyof typeof StorageBackendType]\n | (string & {});\n\n/** Request to append items to a session. */\nexport interface AppendSessionItemsRequest {\n /**\n * Items to append atomically in request order. Concurrent append requests are serialized into one\n * committed order without exposing a numeric sequence in the public contract.\n */\n items?: SessionItem[] | undefined;\n /**\n * Resource name of the containing session, in the form\n * `session-stores/{session_store_id}/sessions/{session_id}`.\n */\n parent?: string | undefined;\n}\n\n/** Response containing appended items. */\nexport interface AppendSessionItemsResponse {\n /** Persisted session items with service-assigned fields. */\n sessionItems?: SessionItem[] | undefined;\n}\n\n/** Request to clear all items from a session. */\nexport interface ClearSessionItemsRequest {\n /**\n * Resource name of the containing session, in the form\n * `session-stores/{session_store_id}/sessions/{session_id}`.\n */\n parent?: string | undefined;\n}\n\n/** Response from clearing items from a session. */\n// eslint-disable-next-line @typescript-eslint/no-empty-object-type\nexport interface ClearSessionItemsResponse {}\n\n/** Request to create a managed memory entry. */\nexport interface CreateManagedMemoryEntryRequest {\n /**\n * Managed memory store that will contain the entry, in the form\n * `memory-stores/{managed_memory_store_id}`.\n */\n parent?: string | undefined;\n /** The managed memory entry to create. */\n managedMemoryEntry?: ManagedMemoryEntry | undefined;\n /** Optional caller-selected managed memory entry ID. The service generates an ID when omitted. */\n managedMemoryEntryId?: string | undefined;\n}\n\n/** Request to create a managed memory store. */\nexport interface CreateManagedMemoryStoreRequest {\n /** The managed memory store to create. */\n managedMemoryStore?: ManagedMemoryStore | undefined;\n /**\n * Caller-provided, workspace-unique managed memory store ID. It must be 3-56 characters, begin\n * with a lowercase letter, contain only lowercase letters, digits, and hyphens, and end with a\n * letter or digit.\n */\n managedMemoryStoreId?: string | undefined;\n}\n\n/** Request to create a session. */\nexport interface CreateSessionRequest {\n /**\n * The session to create. `actor_id` is required. A session with `parent_session_id` is a child and\n * must use its parent's `actor_id`. Independent forks are created only through `ForkSession`.\n */\n session?: Session | undefined;\n /**\n * Optional caller-selected session ID. The service generates a UUID when this field is omitted.\n * The ID must be unique; a collision returns `ALREADY_EXISTS`.\n */\n sessionId?: string | undefined;\n /**\n * Resource name of the containing session store, in the form\n * `session-stores/{session_store_id}`.\n */\n parent?: string | undefined;\n}\n\n/** Request to create a session store. */\nexport interface CreateSessionStoreRequest {\n /** The session store to create. */\n sessionStore?: SessionStore | undefined;\n /**\n * Caller-provided, workspace-unique session store ID. It must be 3-55 characters, begin with a\n * lowercase letter, and contain only lowercase letters, digits, and hyphens.\n */\n sessionStoreId?: string | undefined;\n}\n\n/** Request to delete a managed memory entry by resource name. */\nexport interface DeleteManagedMemoryEntryRequest {\n /**\n * Resource name in the form\n * `memory-stores/{managed_memory_store_id}/entries/{managed_memory_entry_id}`.\n */\n name?: string | undefined;\n}\n\n/** Request to delete a managed memory store by resource name. */\nexport interface DeleteManagedMemoryStoreRequest {\n /** Resource name in the form `memory-stores/{managed_memory_store_id}`. */\n name?: string | undefined;\n}\n\n/** Request to delete a session. */\nexport interface DeleteSessionRequest {\n /**\n * Resource name in the form\n * `session-stores/{session_store_id}/sessions/{session_id}`.\n */\n name?: string | undefined;\n}\n\n/** Request to delete a session store. */\nexport interface DeleteSessionStoreRequest {\n /** Resource name in the form `session-stores/{session_store_id}`. */\n name?: string | undefined;\n}\n\n/** Request to synchronously extract memories from a single session. */\nexport interface ExtractMemoriesRequest {\n /**\n * Managed memory store the extracted entries are written to, in the form\n * `memory-stores/{managed_memory_store_id}`.\n */\n memoryStore?: string | undefined;\n /** Session store containing the session, in the form `session-stores/{session_store_id}`. */\n sessionStore?: string | undefined;\n /** Identifier of the session whose transcript is distilled into memories. */\n sessionId?: string | undefined;\n /** Instructions steering what is extracted from the session. */\n instructions?: string | undefined;\n /**\n * When true, extract and return the entries without writing them to the memory store. Defaults\n * to false, which persists the extracted entries and returns them.\n */\n dryRun?: boolean | undefined;\n}\n\n/** Result of a single-session memory extraction. */\nexport interface ExtractMemoriesResponse {\n /** Correlation identifier for this extraction, for logging and tracing. Not a fetchable resource. */\n name?: string | undefined;\n /** The memory entries written by this extraction. */\n entries?: ManagedMemoryEntry[] | undefined;\n}\n\n/** Request to fork a session. */\nexport interface ForkSessionRequest {\n /** ID of the session to copy. */\n sourceSessionId?: string | undefined;\n /**\n * Optional last item ID to copy through, inclusively. When omitted, the fork atomically copies\n * all items committed before the fork operation begins.\n */\n upToItemId?: string | undefined;\n /** Optional unique ID for the forked session. A collision returns `ALREADY_EXISTS`. */\n sessionId?: string | undefined;\n /** Opaque caller-provided identifier for the application actor associated with the forked session. */\n actorId?: string | undefined;\n /** Optional metadata for the fork. */\n metadata?: Record<string, string> | undefined;\n /**\n * Resource name of the containing session store, in the form\n * `session-stores/{session_store_id}`.\n */\n parent?: string | undefined;\n}\n\n/** Response from forking a session. */\nexport interface ForkSessionResponse {\n /** The newly-created independent top-level session. */\n session?: Session | undefined;\n}\n\n/** Request to retrieve a managed memory entry by resource name. */\nexport interface GetManagedMemoryEntryRequest {\n /**\n * Resource name in the form\n * `memory-stores/{managed_memory_store_id}/entries/{managed_memory_entry_id}`.\n */\n name?: string | undefined;\n /** Controls whether the response includes memory content. Defaults to `FULL`. */\n view?: ManagedMemoryEntryView | undefined;\n}\n\n/** Request to retrieve a managed memory store by resource name. */\nexport interface GetManagedMemoryStoreRequest {\n /** Resource name in the form `memory-stores/{managed_memory_store_id}`. */\n name?: string | undefined;\n}\n\n/** Request to get a session. */\nexport interface GetSessionRequest {\n /**\n * Resource name in the form\n * `session-stores/{session_store_id}/sessions/{session_id}`.\n */\n name?: string | undefined;\n}\n\n/** Request to get a session store. */\nexport interface GetSessionStoreRequest {\n /** Resource name in the form `session-stores/{session_store_id}`. */\n name?: string | undefined;\n}\n\n/**\n * Request to list managed memory entries for one actor, optionally restricted by session and\n * path prefix, or matched by exact path regardless of session.\n */\nexport interface ListManagedMemoryEntriesRequest {\n /**\n * Managed memory store whose entries are listed, in the form\n * `memory-stores/{managed_memory_store_id}`.\n */\n parent?: string | undefined;\n /**\n * Maximum number of entries to return. The service may return fewer entries than requested.\n * Defaults to 10; must be between 1 and 100.\n */\n pageSize?: number | undefined;\n /** Opaque pagination token from a previous ListManagedMemoryEntries response. */\n pageToken?: string | undefined;\n /** Customer-provided identifier for the actor whose entries are listed. */\n actorId?: string | undefined;\n /** Optional path prefix used to restrict entries within the actor partition. */\n pathPrefix?: string | undefined;\n /**\n * Optional session identifier. When set, only entries with this exact `session_id` are\n * returned. Omitted-session (cross-session) entries are not included. Ignored when path is set.\n */\n sessionId?: string | undefined;\n /** Controls whether each returned entry includes memory content. Defaults to `FULL`. */\n view?: ManagedMemoryEntryView | undefined;\n}\n\n/** Response containing managed memory entries. */\nexport interface ListManagedMemoryEntriesResponse {\n /** Managed memory entries matching the request and selected response view. */\n managedMemoryEntries?: ManagedMemoryEntry[] | undefined;\n /** Opaque pagination token. This field is omitted when there are no more results. */\n nextPageToken?: string | undefined;\n}\n\n/** Request to list managed memory stores in the caller's workspace. */\nexport interface ListManagedMemoryStoresRequest {\n /**\n * Maximum number of stores to return. The service may return fewer stores than requested.\n * Defaults to 10; must be between 1 and 100.\n */\n pageSize?: number | undefined;\n /** Opaque pagination token from a previous ListManagedMemoryStores response. */\n pageToken?: string | undefined;\n}\n\n/** Response containing managed memory stores in the caller's workspace. */\nexport interface ListManagedMemoryStoresResponse {\n /** Managed memory stores in the caller's workspace. */\n managedMemoryStores?: ManagedMemoryStore[] | undefined;\n /** Opaque pagination token. This field is omitted when there are no more results. */\n nextPageToken?: string | undefined;\n}\n\n/** Request to list items in a session. */\nexport interface ListSessionItemsRequest {\n /** Maximum number of items to return. Defaults to 10; must be between 1 and 100. */\n pageSize?: number | undefined;\n /** Token returned by a previous list request. */\n pageToken?: string | undefined;\n /**\n * Sort order. Supported values are `create_time asc` and `create_time desc`. The default is\n * `create_time desc`, which returns the most recently appended items first. Equal timestamps are\n * resolved by committed append order in the requested direction.\n */\n orderBy?: string | undefined;\n /**\n * Resource name of the containing session, in the form\n * `session-stores/{session_store_id}/sessions/{session_id}`.\n */\n parent?: string | undefined;\n}\n\n/** Response containing a page of session items. */\nexport interface ListSessionItemsResponse {\n /** Session items in the requested page. */\n sessionItems?: SessionItem[] | undefined;\n /** Token to retrieve the next page. */\n nextPageToken?: string | undefined;\n}\n\n/** Request to list session stores. */\nexport interface ListSessionStoresRequest {\n /** Maximum number of session stores to return. Defaults to 10; must be between 1 and 100. */\n pageSize?: number | undefined;\n /** Token returned by a previous list request. */\n pageToken?: string | undefined;\n}\n\n/** Response containing a page of session stores. */\nexport interface ListSessionStoresResponse {\n /** Session stores in the requested page. */\n sessionStores?: SessionStore[] | undefined;\n /** Token to retrieve the next page. */\n nextPageToken?: string | undefined;\n}\n\n/** Request to list sessions. */\nexport interface ListSessionsRequest {\n /** Maximum number of sessions to return. Defaults to 10; must be between 1 and 100. */\n pageSize?: number | undefined;\n /** Token returned by a previous list request. */\n pageToken?: string | undefined;\n /**\n * Filter expression. Supported fields include `actor_id` and `metadata`; for example,\n * `actor_id = \"support-customer-123\"`.\n */\n filter?: string | undefined;\n /**\n * Sort order. Defaults to `last_activity_time desc`. Page-token continuation is exactly-once when\n * ordering by `create_time` (immutable); ordering by `last_activity_time` is best-effort, because\n * that value changes as a session gains activity, so a session updated between page requests may\n * be repeated or skipped. To enumerate every session exactly once, order by `create_time`.\n */\n orderBy?: string | undefined;\n /**\n * Resource name of the containing session store, in the form\n * `session-stores/{session_store_id}`.\n */\n parent?: string | undefined;\n}\n\n/** Response containing a page of sessions. */\nexport interface ListSessionsResponse {\n /** Sessions in the requested page. */\n sessions?: Session[] | undefined;\n /** Token to retrieve the next page. */\n nextPageToken?: string | undefined;\n}\n\n/** A workspace-scoped entry in a managed memory store. */\nexport interface ManagedMemoryEntry {\n /**\n * Resource name in the form\n * `memory-stores/{managed_memory_store_id}/entries/{managed_memory_entry_id}`.\n */\n name?: string | undefined;\n /** Customer-provided identifier for the actor whose memory this entry represents. */\n actorId?: string | undefined;\n /**\n * Optional identifier for the session associated with this memory entry. When omitted, the\n * entry applies across the actor's sessions.\n */\n sessionId?: string | undefined;\n /**\n * Absolute, case-sensitive path identifying the entry within its actor and optional session.\n * Paths must begin with `/` and must not contain empty, `.` or `..` segments.\n */\n path?: string | undefined;\n /** Optional free-form memory content. */\n content?: string | undefined;\n /** Human-readable description of the memory entry. */\n description?: string | undefined;\n /** Which writer created this entry. Caller sets this on Create; immutable after creation. */\n sourceType?: ManagedMemoryEntrySourceType | undefined;\n /** Time when the entry was created. */\n createTime?: Temporal.Instant | undefined;\n /** Time when the entry was last updated. */\n updateTime?: Temporal.Instant | undefined;\n}\n\n/** One relevance-ranked managed memory search result. */\nexport interface ManagedMemoryEntrySearchResult {\n /** Managed memory entry matching the query. */\n managedMemoryEntry?: ManagedMemoryEntry | undefined;\n /** Relevance score for the result. Higher scores are more relevant. */\n score?: number | undefined;\n}\n\n/** A workspace-scoped managed memory store backed by service-managed storage. */\nexport interface ManagedMemoryStore {\n /** Resource name in the form `memory-stores/{managed_memory_store_id}`. */\n name?: string | undefined;\n /**\n * Deprecated compatibility alias for the caller-provided managed memory store ID. Canonical\n * clients provide the ID through `CreateMemoryStoreRequest.managed_memory_store_id` and use\n * `name` as the resource identifier.\n */\n displayName?: string | undefined;\n /** Workspace that owns the memory store. */\n workspaceId?: bigint | undefined;\n /** Service-managed storage backing this memory store. */\n storageBackend?: StorageBackend | undefined;\n /**\n * Deprecated alias for `creator_user_id`. This identifies the original creator, not a\n * transferable owner. Use `creator_user_id` instead.\n */\n ownerUserId?: string | undefined;\n /**\n * Workspace-local user ID of the authenticated principal that created the store. This is\n * immutable server-set attribution and does not grant access; authorization is evaluated from\n * the authenticated request context.\n */\n creatorUserId?: string | undefined;\n /** Human-readable description of the memory store. */\n description?: string | undefined;\n /** Time when the store was created. */\n createTime?: Temporal.Instant | undefined;\n /** Time when the store was last updated. */\n updateTime?: Temporal.Instant | undefined;\n}\n\n/** Request to pop an item from a session. */\nexport interface PopSessionItemRequest {\n /**\n * Resource name of the containing session, in the form\n * `session-stores/{session_store_id}/sessions/{session_id}`.\n */\n parent?: string | undefined;\n}\n\n/** Response containing the popped item. */\nexport interface PopSessionItemResponse {\n /** Removed item, if any. */\n item?: SessionItem | undefined;\n}\n\n/**\n * Request to search managed memory entries by text query for one actor.\n * Search returns a relevance-ranked top-N result set and does not currently paginate.\n */\nexport interface SearchManagedMemoryEntriesRequest {\n /**\n * Managed memory store whose entries are searched, in the form\n * `memory-stores/{managed_memory_store_id}`.\n */\n parent?: string | undefined;\n /** Customer-provided identifier for the actor whose entries are searched. */\n actorId?: string | undefined;\n /** Free-form search query. */\n query?: string | undefined;\n /** Deprecated alias for `page_size`. When both fields are set, their values must match. */\n limit?: number | undefined;\n /**\n * Maximum number of relevance-ranked entries to return. Defaults to 10 and must be between 1 and\n * 100.\n */\n pageSize?: number | undefined;\n /**\n * Reserved for pagination compatibility. The server currently ignores this field because Search\n * returns a ranked top-N result set.\n */\n pageToken?: string | undefined;\n /**\n * Optional session identifier. When set, only entries with this exact `session_id` are\n * searched. Omitted-session (cross-session) entries are not included.\n */\n sessionId?: string | undefined;\n /**\n * Optional absolute, case-sensitive path prefix used to restrict searched entries within the\n * actor partition. The prefix must begin with `/` and must not contain empty, `.` or `..`\n * segments.\n */\n pathPrefix?: string | undefined;\n /**\n * Controls whether each returned entry includes memory content. Search scores are always\n * returned. Defaults to `FULL`.\n */\n view?: ManagedMemoryEntryView | undefined;\n}\n\n/** Response containing managed memory entries ranked by relevance. */\nexport interface SearchManagedMemoryEntriesResponse {\n /**\n * Deprecated compatibility alias for clients migrating to `results`. This contains the same\n * entries in the same order, but omits their relevance scores.\n */\n managedMemoryEntries?: ManagedMemoryEntry[] | undefined;\n /**\n * Opaque pagination token. Search currently returns an unpaginated ranked top-N result set, so\n * the server does not populate this field.\n */\n nextPageToken?: string | undefined;\n /** Canonical matching entries and relevance scores, ordered most relevant first. */\n results?: ManagedMemoryEntrySearchResult[] | undefined;\n}\n\n/** A durable logical interaction stored within a Session Store. */\nexport interface Session {\n /**\n * Unique session ID. The service generates a UUID unless the caller supplies\n * `CreateSessionRequest.session_id`.\n */\n sessionId?: string | undefined;\n /**\n * Opaque caller-provided identifier for the application actor associated with the session.\n *\n * This is application data and has no <Databricks> authentication or authorization semantics.\n * Use the same value as the Managed Memory Entry `actor_id` when storing memories associated\n * with this actor. Every session must set it. A child session must use the same value as its parent.\n */\n actorId?: string | undefined;\n /**\n * Immediate parent session ID. Set only at creation for child sessions, immutable thereafter, and\n * restricted to the same store.\n */\n parentSessionId?: string | undefined;\n /**\n * Top-level session ID in the spawn tree. This equals `session_id` for a root or fork and is\n * inherited transitively by child sessions.\n */\n rootSessionId?: string | undefined;\n /** Mutable caller-defined string labels. */\n metadata?: Record<string, string> | undefined;\n /** Time when the session was created. */\n createTime?: Temporal.Instant | undefined;\n /** Time when session resource fields last changed. */\n updateTime?: Temporal.Instant | undefined;\n /** Time when the session's item history was last mutated. */\n lastActivityTime?: Temporal.Instant | undefined;\n /** Resource name in the form `session-stores/{session_store_id}/sessions/{session_id}`. */\n name?: string | undefined;\n}\n\n/** A transcript entry in a session's history. */\nexport interface SessionItem {\n /** Stable service-generated item ID. */\n itemId?: string | undefined;\n /**\n * Complete SDK-native, JSON-compatible item. The service stores and returns this value without\n * interpreting provider-specific fields such as `type`, `role`, or `content`.\n */\n data?: JsonValue | undefined;\n /**\n * Server-assigned time when the append commits. Values are nondecreasing within a session. Item\n * listing orders by this timestamp; equal timestamps are resolved by committed append order.\n */\n createTime?: Temporal.Instant | undefined;\n}\n\n/** A workspace-scoped session store. */\nexport interface SessionStore {\n /**\n * Workspace-local user ID of the authenticated principal that created the store. This is\n * immutable server-set attribution and does not grant access; authorization is evaluated from\n * the authenticated request context.\n */\n creatorUserId?: string | undefined;\n /** Time when the store was created. */\n createTime?: Temporal.Instant | undefined;\n /** Time when the store was last updated. */\n updateTime?: Temporal.Instant | undefined;\n /** Human-readable description of the session store. */\n description?: string | undefined;\n /** Mutable caller-defined string labels. */\n metadata?: Record<string, string> | undefined;\n /** Resource name in the form `session-stores/{session_store_id}`. */\n name?: string | undefined;\n}\n\n/** Service-managed storage backing a managed memory store. */\nexport interface StorageBackend {\n /** Type of the storage backend. */\n backendType?: StorageBackendType | undefined;\n /** Backend-specific identifier. For Lakebase, this is the project ID. */\n backendId?: string | undefined;\n}\n\n/** Request to update a managed memory entry. */\nexport interface UpdateManagedMemoryEntryRequest {\n /** The managed memory entry to update. */\n managedMemoryEntry?: ManagedMemoryEntry | undefined;\n /** Fields to update. Only `content` and `description` may be updated. */\n updateMask?: FieldMask<ManagedMemoryEntry> | undefined;\n}\n\n/** Request to update the description and metadata on a managed memory store. */\nexport interface UpdateManagedMemoryStoreRequest {\n /** The managed memory store to update. `name` is taken from the URL. */\n managedMemoryStore?: ManagedMemoryStore | undefined;\n /** Only `description` and `metadata` may be updated. Selecting `metadata` replaces the entire map. */\n updateMask?: FieldMask<ManagedMemoryStore> | undefined;\n}\n\n/** Request to update a session. */\nexport interface UpdateSessionRequest {\n /** Session to update. */\n session?: Session | undefined;\n /**\n * Fields to update. Only `metadata` is mutable; any other path returns\n * `INVALID_PARAMETER_VALUE`.\n */\n updateMask?: FieldMask<Session> | undefined;\n}\n\n/** Request to update a session store. */\nexport interface UpdateSessionStoreRequest {\n /** Session store to update. */\n sessionStore?: SessionStore | undefined;\n /**\n * Fields to update. Only `description` and `metadata` are mutable; any other\n * path returns `INVALID_PARAMETER_VALUE`.\n */\n updateMask?: FieldMask<SessionStore> | undefined;\n}\n\nexport const unmarshalAppendSessionItemsResponseSchema: z.ZodType<AppendSessionItemsResponse> =\n z\n .object({\n session_items: z\n .array(z.lazy(() => unmarshalSessionItemSchema))\n .optional(),\n })\n .transform(d => ({\n sessionItems: d.session_items,\n }));\n\nexport const unmarshalClearSessionItemsResponseSchema: z.ZodType<ClearSessionItemsResponse> =\n z.object({});\n\nexport const unmarshalExtractMemoriesResponseSchema: z.ZodType<ExtractMemoriesResponse> =\n z\n .object({\n name: z.string().optional(),\n entries: z\n .array(z.lazy(() => unmarshalManagedMemoryEntrySchema))\n .optional(),\n })\n .transform(d => ({\n name: d.name,\n entries: d.entries,\n }));\n\nexport const unmarshalForkSessionResponseSchema: z.ZodType<ForkSessionResponse> =\n z\n .object({\n session: z.lazy(() => unmarshalSessionSchema).optional(),\n })\n .transform(d => ({\n session: d.session,\n }));\n\nexport const unmarshalListManagedMemoryEntriesResponseSchema: z.ZodType<ListManagedMemoryEntriesResponse> =\n z\n .object({\n managed_memory_entries: z\n .array(z.lazy(() => unmarshalManagedMemoryEntrySchema))\n .optional(),\n next_page_token: z.string().optional(),\n })\n .transform(d => ({\n managedMemoryEntries: d.managed_memory_entries,\n nextPageToken: d.next_page_token,\n }));\n\nexport const unmarshalListManagedMemoryStoresResponseSchema: z.ZodType<ListManagedMemoryStoresResponse> =\n z\n .object({\n managed_memory_stores: z\n .array(z.lazy(() => unmarshalManagedMemoryStoreSchema))\n .optional(),\n next_page_token: z.string().optional(),\n })\n .transform(d => ({\n managedMemoryStores: d.managed_memory_stores,\n nextPageToken: d.next_page_token,\n }));\n\nexport const unmarshalListSessionItemsResponseSchema: z.ZodType<ListSessionItemsResponse> =\n z\n .object({\n session_items: z\n .array(z.lazy(() => unmarshalSessionItemSchema))\n .optional(),\n next_page_token: z.string().optional(),\n })\n .transform(d => ({\n sessionItems: d.session_items,\n nextPageToken: d.next_page_token,\n }));\n\nexport const unmarshalListSessionStoresResponseSchema: z.ZodType<ListSessionStoresResponse> =\n z\n .object({\n session_stores: z\n .array(z.lazy(() => unmarshalSessionStoreSchema))\n .optional(),\n next_page_token: z.string().optional(),\n })\n .transform(d => ({\n sessionStores: d.session_stores,\n nextPageToken: d.next_page_token,\n }));\n\nexport const unmarshalListSessionsResponseSchema: z.ZodType<ListSessionsResponse> =\n z\n .object({\n sessions: z.array(z.lazy(() => unmarshalSessionSchema)).optional(),\n next_page_token: z.string().optional(),\n })\n .transform(d => ({\n sessions: d.sessions,\n nextPageToken: d.next_page_token,\n }));\n\nexport const unmarshalManagedMemoryEntrySchema: z.ZodType<ManagedMemoryEntry> =\n z\n .object({\n name: z.string().optional(),\n actor_id: z.string().optional(),\n session_id: z.string().optional(),\n path: z.string().optional(),\n content: z.string().optional(),\n description: z.string().optional(),\n source_type: z.string().optional(),\n create_time: z\n .string()\n .transform(s => Temporal.Instant.from(s))\n .optional(),\n update_time: z\n .string()\n .transform(s => Temporal.Instant.from(s))\n .optional(),\n })\n .transform(d => ({\n name: d.name,\n actorId: d.actor_id,\n sessionId: d.session_id,\n path: d.path,\n content: d.content,\n description: d.description,\n sourceType: d.source_type,\n createTime: d.create_time,\n updateTime: d.update_time,\n }));\n\nexport const unmarshalManagedMemoryEntrySearchResultSchema: z.ZodType<ManagedMemoryEntrySearchResult> =\n z\n .object({\n managed_memory_entry: z\n .lazy(() => unmarshalManagedMemoryEntrySchema)\n .optional(),\n score: z.number().optional(),\n })\n .transform(d => ({\n managedMemoryEntry: d.managed_memory_entry,\n score: d.score,\n }));\n\nexport const unmarshalManagedMemoryStoreSchema: z.ZodType<ManagedMemoryStore> =\n z\n .object({\n name: z.string().optional(),\n display_name: z.string().optional(),\n workspace_id: z\n .union([z.number(), z.bigint(), z.string()])\n .transform(v => BigInt(v))\n .optional(),\n storage_backend: z.lazy(() => unmarshalStorageBackendSchema).optional(),\n owner_user_id: z.string().optional(),\n creator_user_id: z.string().optional(),\n description: z.string().optional(),\n create_time: z\n .string()\n .transform(s => Temporal.Instant.from(s))\n .optional(),\n update_time: z\n .string()\n .transform(s => Temporal.Instant.from(s))\n .optional(),\n })\n .transform(d => ({\n name: d.name,\n displayName: d.display_name,\n workspaceId: d.workspace_id,\n storageBackend: d.storage_backend,\n ownerUserId: d.owner_user_id,\n creatorUserId: d.creator_user_id,\n description: d.description,\n createTime: d.create_time,\n updateTime: d.update_time,\n }));\n\nexport const unmarshalPopSessionItemResponseSchema: z.ZodType<PopSessionItemResponse> =\n z\n .object({\n item: z.lazy(() => unmarshalSessionItemSchema).optional(),\n })\n .transform(d => ({\n item: d.item,\n }));\n\nexport const unmarshalSearchManagedMemoryEntriesResponseSchema: z.ZodType<SearchManagedMemoryEntriesResponse> =\n z\n .object({\n managed_memory_entries: z\n .array(z.lazy(() => unmarshalManagedMemoryEntrySchema))\n .optional(),\n next_page_token: z.string().optional(),\n results: z\n .array(z.lazy(() => unmarshalManagedMemoryEntrySearchResultSchema))\n .optional(),\n })\n .transform(d => ({\n managedMemoryEntries: d.managed_memory_entries,\n nextPageToken: d.next_page_token,\n results: d.results,\n }));\n\nexport const unmarshalSessionSchema: z.ZodType<Session> = z\n .object({\n session_id: z.string().optional(),\n actor_id: z.string().optional(),\n parent_session_id: z.string().optional(),\n root_session_id: z.string().optional(),\n metadata: z.record(z.string(), z.string()).optional(),\n create_time: z\n .string()\n .transform(s => Temporal.Instant.from(s))\n .optional(),\n update_time: z\n .string()\n .transform(s => Temporal.Instant.from(s))\n .optional(),\n last_activity_time: z\n .string()\n .transform(s => Temporal.Instant.from(s))\n .optional(),\n name: z.string().optional(),\n })\n .transform(d => ({\n sessionId: d.session_id,\n actorId: d.actor_id,\n parentSessionId: d.parent_session_id,\n rootSessionId: d.root_session_id,\n metadata: d.metadata,\n createTime: d.create_time,\n updateTime: d.update_time,\n lastActivityTime: d.last_activity_time,\n name: d.name,\n }));\n\nexport const unmarshalSessionItemSchema: z.ZodType<SessionItem> = z\n .object({\n item_id: z.string().optional(),\n data: jsonValueSchema.optional(),\n create_time: z\n .string()\n .transform(s => Temporal.Instant.from(s))\n .optional(),\n })\n .transform(d => ({\n itemId: d.item_id,\n data: d.data,\n createTime: d.create_time,\n }));\n\nexport const unmarshalSessionStoreSchema: z.ZodType<SessionStore> = z\n .object({\n creator_user_id: z.string().optional(),\n create_time: z\n .string()\n .transform(s => Temporal.Instant.from(s))\n .optional(),\n update_time: z\n .string()\n .transform(s => Temporal.Instant.from(s))\n .optional(),\n description: z.string().optional(),\n metadata: z.record(z.string(), z.string()).optional(),\n name: z.string().optional(),\n })\n .transform(d => ({\n creatorUserId: d.creator_user_id,\n createTime: d.create_time,\n updateTime: d.update_time,\n description: d.description,\n metadata: d.metadata,\n name: d.name,\n }));\n\nexport const unmarshalStorageBackendSchema: z.ZodType<StorageBackend> = z\n .object({\n backend_type: z.string().optional(),\n backend_id: z.string().optional(),\n })\n .transform(d => ({\n backendType: d.backend_type,\n backendId: d.backend_id,\n }));\n\nexport const marshalAppendSessionItemsRequestSchema: z.ZodType = z\n .object({\n items: z.array(z.lazy(() => marshalSessionItemSchema)).optional(),\n parent: z.string().optional(),\n })\n .transform(d => ({\n items: d.items,\n parent: d.parent,\n }));\n\nexport const marshalClearSessionItemsRequestSchema: z.ZodType = z\n .object({\n parent: z.string().optional(),\n })\n .transform(d => ({\n parent: d.parent,\n }));\n\nexport const marshalExtractMemoriesRequestSchema: z.ZodType = z\n .object({\n memoryStore: z.string().optional(),\n sessionStore: z.string().optional(),\n sessionId: z.string().optional(),\n instructions: z.string().optional(),\n dryRun: z.boolean().optional(),\n })\n .transform(d => ({\n memory_store: d.memoryStore,\n session_store: d.sessionStore,\n session_id: d.sessionId,\n instructions: d.instructions,\n dry_run: d.dryRun,\n }));\n\nexport const marshalForkSessionRequestSchema: z.ZodType = z\n .object({\n sourceSessionId: z.string().optional(),\n upToItemId: z.string().optional(),\n sessionId: z.string().optional(),\n actorId: z.string().optional(),\n metadata: z.record(z.string(), z.string()).optional(),\n parent: z.string().optional(),\n })\n .transform(d => ({\n source_session_id: d.sourceSessionId,\n up_to_item_id: d.upToItemId,\n session_id: d.sessionId,\n actor_id: d.actorId,\n metadata: d.metadata,\n parent: d.parent,\n }));\n\nexport const marshalManagedMemoryEntrySchema: z.ZodType = z\n .object({\n name: z.string().optional(),\n actorId: z.string().optional(),\n sessionId: z.string().optional(),\n path: z.string().optional(),\n content: z.string().optional(),\n description: z.string().optional(),\n sourceType: z.string().optional(),\n createTime: z\n .any()\n .transform((d: Temporal.Instant) => d.toString())\n .optional(),\n updateTime: z\n .any()\n .transform((d: Temporal.Instant) => d.toString())\n .optional(),\n })\n .transform(d => ({\n name: d.name,\n actor_id: d.actorId,\n session_id: d.sessionId,\n path: d.path,\n content: d.content,\n description: d.description,\n source_type: d.sourceType,\n create_time: d.createTime,\n update_time: d.updateTime,\n }));\n\nexport const marshalManagedMemoryStoreSchema: z.ZodType = z\n .object({\n name: z.string().optional(),\n displayName: z.string().optional(),\n workspaceId: z.bigint().optional(),\n storageBackend: z.lazy(() => marshalStorageBackendSchema).optional(),\n ownerUserId: z.string().optional(),\n creatorUserId: z.string().optional(),\n description: z.string().optional(),\n createTime: z\n .any()\n .transform((d: Temporal.Instant) => d.toString())\n .optional(),\n updateTime: z\n .any()\n .transform((d: Temporal.Instant) => d.toString())\n .optional(),\n })\n .transform(d => ({\n name: d.name,\n display_name: d.displayName,\n workspace_id: d.workspaceId,\n storage_backend: d.storageBackend,\n owner_user_id: d.ownerUserId,\n creator_user_id: d.creatorUserId,\n description: d.description,\n create_time: d.createTime,\n update_time: d.updateTime,\n }));\n\nexport const marshalPopSessionItemRequestSchema: z.ZodType = z\n .object({\n parent: z.string().optional(),\n })\n .transform(d => ({\n parent: d.parent,\n }));\n\nexport const marshalSearchManagedMemoryEntriesRequestSchema: z.ZodType = z\n .object({\n parent: z.string().optional(),\n actorId: z.string().optional(),\n query: z.string().optional(),\n limit: z.number().optional(),\n pageSize: z.number().optional(),\n pageToken: z.string().optional(),\n sessionId: z.string().optional(),\n pathPrefix: z.string().optional(),\n view: z.string().optional(),\n })\n .transform(d => ({\n parent: d.parent,\n actor_id: d.actorId,\n query: d.query,\n limit: d.limit,\n page_size: d.pageSize,\n page_token: d.pageToken,\n session_id: d.sessionId,\n path_prefix: d.pathPrefix,\n view: d.view,\n }));\n\nexport const marshalSessionSchema: z.ZodType = z\n .object({\n sessionId: z.string().optional(),\n actorId: z.string().optional(),\n parentSessionId: z.string().optional(),\n rootSessionId: z.string().optional(),\n metadata: z.record(z.string(), z.string()).optional(),\n createTime: z\n .any()\n .transform((d: Temporal.Instant) => d.toString())\n .optional(),\n updateTime: z\n .any()\n .transform((d: Temporal.Instant) => d.toString())\n .optional(),\n lastActivityTime: z\n .any()\n .transform((d: Temporal.Instant) => d.toString())\n .optional(),\n name: z.string().optional(),\n })\n .transform(d => ({\n session_id: d.sessionId,\n actor_id: d.actorId,\n parent_session_id: d.parentSessionId,\n root_session_id: d.rootSessionId,\n metadata: d.metadata,\n create_time: d.createTime,\n update_time: d.updateTime,\n last_activity_time: d.lastActivityTime,\n name: d.name,\n }));\n\nexport const marshalSessionItemSchema: z.ZodType = z\n .object({\n itemId: z.string().optional(),\n data: jsonValueSchema.optional(),\n createTime: z\n .any()\n .transform((d: Temporal.Instant) => d.toString())\n .optional(),\n })\n .transform(d => ({\n item_id: d.itemId,\n data: d.data,\n create_time: d.createTime,\n }));\n\nexport const marshalSessionStoreSchema: z.ZodType = z\n .object({\n creatorUserId: z.string().optional(),\n createTime: z\n .any()\n .transform((d: Temporal.Instant) => d.toString())\n .optional(),\n updateTime: z\n .any()\n .transform((d: Temporal.Instant) => d.toString())\n .optional(),\n description: z.string().optional(),\n metadata: z.record(z.string(), z.string()).optional(),\n name: z.string().optional(),\n })\n .transform(d => ({\n creator_user_id: d.creatorUserId,\n create_time: d.createTime,\n update_time: d.updateTime,\n description: d.description,\n metadata: d.metadata,\n name: d.name,\n }));\n\nexport const marshalStorageBackendSchema: z.ZodType = z\n .object({\n backendType: z.string().optional(),\n backendId: z.string().optional(),\n })\n .transform(d => ({\n backend_type: d.backendType,\n backend_id: d.backendId,\n }));\n\nconst managedMemoryEntryFieldMaskSchema: FieldMaskSchema = {\n actorId: {wire: 'actor_id'},\n content: {wire: 'content'},\n createTime: {wire: 'create_time'},\n description: {wire: 'description'},\n name: {wire: 'name'},\n path: {wire: 'path'},\n sessionId: {wire: 'session_id'},\n sourceType: {wire: 'source_type'},\n updateTime: {wire: 'update_time'},\n};\n\nexport function managedMemoryEntryFieldMask(\n ...paths: string[]\n): FieldMask<ManagedMemoryEntry> {\n return FieldMask.build<ManagedMemoryEntry>(\n paths,\n managedMemoryEntryFieldMaskSchema\n );\n}\n\nconst managedMemoryStoreFieldMaskSchema: FieldMaskSchema = {\n createTime: {wire: 'create_time'},\n creatorUserId: {wire: 'creator_user_id'},\n description: {wire: 'description'},\n displayName: {wire: 'display_name'},\n name: {wire: 'name'},\n ownerUserId: {wire: 'owner_user_id'},\n storageBackend: {\n wire: 'storage_backend',\n children: () => storageBackendFieldMaskSchema,\n },\n updateTime: {wire: 'update_time'},\n workspaceId: {wire: 'workspace_id'},\n};\n\nexport function managedMemoryStoreFieldMask(\n ...paths: string[]\n): FieldMask<ManagedMemoryStore> {\n return FieldMask.build<ManagedMemoryStore>(\n paths,\n managedMemoryStoreFieldMaskSchema\n );\n}\n\nconst sessionFieldMaskSchema: FieldMaskSchema = {\n actorId: {wire: 'actor_id'},\n createTime: {wire: 'create_time'},\n lastActivityTime: {wire: 'last_activity_time'},\n metadata: {wire: 'metadata'},\n name: {wire: 'name'},\n parentSessionId: {wire: 'parent_session_id'},\n rootSessionId: {wire: 'root_session_id'},\n sessionId: {wire: 'session_id'},\n updateTime: {wire: 'update_time'},\n};\n\nexport function sessionFieldMask(...paths: string[]): FieldMask<Session> {\n return FieldMask.build<Session>(paths, sessionFieldMaskSchema);\n}\n\nconst sessionStoreFieldMaskSchema: FieldMaskSchema = {\n createTime: {wire: 'create_time'},\n creatorUserId: {wire: 'creator_user_id'},\n description: {wire: 'description'},\n metadata: {wire: 'metadata'},\n name: {wire: 'name'},\n updateTime: {wire: 'update_time'},\n};\n\nexport function sessionStoreFieldMask(\n ...paths: string[]\n): FieldMask<SessionStore> {\n return FieldMask.build<SessionStore>(paths, sessionStoreFieldMaskSchema);\n}\n\nconst storageBackendFieldMaskSchema: FieldMaskSchema = {\n backendId: {wire: 'backend_id'},\n backendType: {wire: 'backend_type'},\n};\n"],"mappings":";;;;;AAOA,MAAM,kBAAwC,EAAE,WAC9C,EAAE,MAAM;CACN,EAAE,MAAM;CACR,EAAE,QAAQ;CACV,EAAE,QAAQ;CACV,EAAE,SAAS;CACX,EAAE,OAAO,EAAE,QAAQ,EAAE,gBAAgB;CACrC,EAAE,MAAM,gBAAgB;CACzB,CAAC,CACH;;AAID,MAAa,+BAA+B;CAE1C,wCACE;CAEF,0CACE;CACH;;AAOD,MAAa,yBAAyB;CAEpC,uCACE;CAEF,iCAAiC;CAEjC,gCAAgC;CACjC;;AAOD,MAAa,qBAAqB;CAEhC,kCAAkC;CAElC,+BAA+B;CAChC;AAkmBD,MAAa,4CACX,EACG,OAAO,EAC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CAC/B,YAAY,EAAC,MAAM,eAAc;CAClC;AAED,SAAgB,iBAAiB,GAAG,OAAqC;AACvE,QAAO,UAAU,MAAe,OAAO,uBAAuB;;AAGhE,MAAM,8BAA+C;CACnD,YAAY,EAAC,MAAM,eAAc;CACjC,eAAe,EAAC,MAAM,mBAAkB;CACxC,aAAa,EAAC,MAAM,eAAc;CAClC,UAAU,EAAC,MAAM,YAAW;CAC5B,MAAM,EAAC,MAAM,QAAO;CACpB,YAAY,EAAC,MAAM,eAAc;CAClC;AAED,SAAgB,sBACd,GAAG,OACsB;AACzB,QAAO,UAAU,MAAoB,OAAO,4BAA4B;;AAG1E,MAAM,gCAAiD;CACrD,WAAW,EAAC,MAAM,cAAa;CAC/B,aAAa,EAAC,MAAM,gBAAe;CACpC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { HttpClient } from "@databricks/sdk-core/http";
|
|
2
|
+
import { ClientOptions } from "@databricks/sdk-options/client";
|
|
3
|
+
|
|
4
|
+
//#region src/v1/transport.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* The configuration a client needs to issue requests, resolved from
|
|
7
|
+
* {@link ClientOptions} and a configuration profile.
|
|
8
|
+
*/
|
|
9
|
+
interface ResolvedClientConfig {
|
|
10
|
+
/** Host with any trailing slash removed. */
|
|
11
|
+
host: string;
|
|
12
|
+
/**
|
|
13
|
+
* Default account ID for account-level paths that contain an account_id
|
|
14
|
+
* segment. A request's own accountId still wins.
|
|
15
|
+
*/
|
|
16
|
+
accountId?: string;
|
|
17
|
+
/**
|
|
18
|
+
* Workspace ID used to route workspace-level calls on unified hosts (SPOG).
|
|
19
|
+
*/
|
|
20
|
+
workspaceId?: string;
|
|
21
|
+
/** HTTP client with authentication, and any configured timeout, applied. */
|
|
22
|
+
httpClient: HttpClient;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Resolves {@link ClientOptions} into a {@link ResolvedClientConfig}.
|
|
26
|
+
*
|
|
27
|
+
* A configuration profile is always resolved from the config file and
|
|
28
|
+
* environment variables (per options.profileOptions); it supplies host,
|
|
29
|
+
* accountId, workspaceId, and credentials wherever the caller did not set them
|
|
30
|
+
* explicitly. Explicit options always take precedence.
|
|
31
|
+
*
|
|
32
|
+
* @throws if host is neither provided nor present in the resolved profile.
|
|
33
|
+
*/
|
|
34
|
+
declare function resolveClientConfig(options: ClientOptions): Promise<ResolvedClientConfig>;
|
|
35
|
+
//#endregion
|
|
36
|
+
export { ResolvedClientConfig, resolveClientConfig };
|
|
37
|
+
//# sourceMappingURL=transport.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transport.d.ts","names":[],"sources":["../../src/v1/transport.ts"],"mappings":";;;;;;AAkBA;;UAAiB,oBAAA;EAgBO;EAdtB,IAAA;EAMA;;;;EAAA,SAAA;EAQsB;AAaxB;;EAhBE,WAAA;EAiBS;EAdT,UAAA,EAAY,UAAA;AAAA;;;;;;;;;;;iBAaQ,mBAAA,CACpB,OAAA,EAAS,aAAA,GACR,OAAA,CAAQ,oBAAA"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { defaultCredentials } from "@databricks/sdk-auth/credentials";
|
|
2
|
+
import { newFetchHttpClient } from "@databricks/sdk-core/http";
|
|
3
|
+
import { resolve } from "@databricks/sdk-core/profiles";
|
|
4
|
+
|
|
5
|
+
//#region src/v1/transport.ts
|
|
6
|
+
/**
|
|
7
|
+
* Resolves {@link ClientOptions} into a {@link ResolvedClientConfig}.
|
|
8
|
+
*
|
|
9
|
+
* A configuration profile is always resolved from the config file and
|
|
10
|
+
* environment variables (per options.profileOptions); it supplies host,
|
|
11
|
+
* accountId, workspaceId, and credentials wherever the caller did not set them
|
|
12
|
+
* explicitly. Explicit options always take precedence.
|
|
13
|
+
*
|
|
14
|
+
* @throws if host is neither provided nor present in the resolved profile.
|
|
15
|
+
*/
|
|
16
|
+
async function resolveClientConfig(options) {
|
|
17
|
+
const profile = await resolve(options.profileOptions);
|
|
18
|
+
const host = normalizeHost(options.host ?? profile.host);
|
|
19
|
+
if (host === void 0) throw new Error("Host is required.");
|
|
20
|
+
let httpClient = new AuthHttpClient(options.httpClient ?? newFetchHttpClient(), options.credentials ?? defaultCredentials({ profile: {
|
|
21
|
+
...profile,
|
|
22
|
+
host
|
|
23
|
+
} }));
|
|
24
|
+
if (options.timeout !== void 0) httpClient = new TimeoutHttpClient(httpClient, options.timeout);
|
|
25
|
+
const accountId = options.accountId ?? profile.accountId;
|
|
26
|
+
const workspaceId = options.workspaceId ?? profile.workspaceId;
|
|
27
|
+
return {
|
|
28
|
+
host,
|
|
29
|
+
httpClient,
|
|
30
|
+
...accountId !== void 0 && { accountId },
|
|
31
|
+
...workspaceId !== void 0 && { workspaceId }
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
function normalizeHost(host) {
|
|
35
|
+
const trimmed = host?.trim();
|
|
36
|
+
if (trimmed === void 0 || trimmed === "") return;
|
|
37
|
+
return (/^https?:\/\//i.test(trimmed) ? trimmed : `https://${trimmed}`).replace(/\/$/, "");
|
|
38
|
+
}
|
|
39
|
+
/** Wraps an HttpClient and adds authentication headers to requests. */
|
|
40
|
+
var AuthHttpClient = class {
|
|
41
|
+
constructor(base, credentials) {
|
|
42
|
+
this.base = base;
|
|
43
|
+
this.credentials = credentials;
|
|
44
|
+
}
|
|
45
|
+
async send(request) {
|
|
46
|
+
const authHeaders = await this.credentials.authHeaders();
|
|
47
|
+
const headers = new Headers(request.headers);
|
|
48
|
+
for (const h of authHeaders) headers.set(h.key, h.value);
|
|
49
|
+
return this.base.send({
|
|
50
|
+
...request,
|
|
51
|
+
headers
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
/** Wraps an HttpClient and applies a default timeout to requests. */
|
|
56
|
+
var TimeoutHttpClient = class {
|
|
57
|
+
constructor(base, timeout) {
|
|
58
|
+
this.base = base;
|
|
59
|
+
this.timeout = timeout;
|
|
60
|
+
}
|
|
61
|
+
async send(request) {
|
|
62
|
+
const timeoutSignal = AbortSignal.timeout(this.timeout);
|
|
63
|
+
const signal = request.signal !== void 0 ? AbortSignal.any([request.signal, timeoutSignal]) : timeoutSignal;
|
|
64
|
+
return this.base.send({
|
|
65
|
+
...request,
|
|
66
|
+
signal
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
//#endregion
|
|
72
|
+
export { resolveClientConfig };
|
|
73
|
+
//# sourceMappingURL=transport.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transport.js","names":[],"sources":["../../src/v1/transport.ts"],"sourcesContent":["// Code generated from API definition by Databricks SDK Generator. DO NOT EDIT.\n\nimport type {Credentials} from '@databricks/sdk-auth';\nimport {defaultCredentials} from '@databricks/sdk-auth/credentials';\nimport type {\n HttpClient,\n HttpRequest,\n HttpResponse,\n} from '@databricks/sdk-core/http';\nimport {newFetchHttpClient} from '@databricks/sdk-core/http';\nimport type {Profile} from '@databricks/sdk-core/profiles';\nimport {resolve} from '@databricks/sdk-core/profiles';\nimport type {ClientOptions} from '@databricks/sdk-options/client';\n\n/**\n * The configuration a client needs to issue requests, resolved from\n * {@link ClientOptions} and a configuration profile.\n */\nexport interface ResolvedClientConfig {\n /** Host with any trailing slash removed. */\n host: string;\n\n /**\n * Default account ID for account-level paths that contain an account_id\n * segment. A request's own accountId still wins.\n */\n accountId?: string;\n\n /**\n * Workspace ID used to route workspace-level calls on unified hosts (SPOG).\n */\n workspaceId?: string;\n\n /** HTTP client with authentication, and any configured timeout, applied. */\n httpClient: HttpClient;\n}\n\n/**\n * Resolves {@link ClientOptions} into a {@link ResolvedClientConfig}.\n *\n * A configuration profile is always resolved from the config file and\n * environment variables (per options.profileOptions); it supplies host,\n * accountId, workspaceId, and credentials wherever the caller did not set them\n * explicitly. Explicit options always take precedence.\n *\n * @throws if host is neither provided nor present in the resolved profile.\n */\nexport async function resolveClientConfig(\n options: ClientOptions\n): Promise<ResolvedClientConfig> {\n const profile: Profile = await resolve(options.profileOptions);\n\n const host = normalizeHost(options.host ?? profile.host);\n if (host === undefined) {\n throw new Error('Host is required.');\n }\n\n // The provided httpClient (or the default fetch client) is the base wire;\n // authentication and the optional timeout are layered on top of it. The\n // default credential chain reuses the profile resolved above so that the\n // same profileOptions govern host and authentication alike.\n const base = options.httpClient ?? newFetchHttpClient();\n const credentials =\n options.credentials ?? defaultCredentials({profile: {...profile, host}});\n let httpClient: HttpClient = new AuthHttpClient(base, credentials);\n if (options.timeout !== undefined) {\n httpClient = new TimeoutHttpClient(httpClient, options.timeout);\n }\n\n const accountId = options.accountId ?? profile.accountId;\n const workspaceId = options.workspaceId ?? profile.workspaceId;\n\n return {\n host,\n httpClient,\n ...(accountId !== undefined && {accountId}),\n ...(workspaceId !== undefined && {workspaceId}),\n };\n}\n\nfunction normalizeHost(host: string | undefined): string | undefined {\n const trimmed = host?.trim();\n if (trimmed === undefined || trimmed === '') {\n return undefined;\n }\n const absolute = /^https?:\\/\\//i.test(trimmed)\n ? trimmed\n : `https://${trimmed}`;\n return absolute.replace(/\\/$/, '');\n}\n\n/** Wraps an HttpClient and adds authentication headers to requests. */\nclass AuthHttpClient implements HttpClient {\n constructor(\n private readonly base: HttpClient,\n private readonly credentials: Credentials\n ) {}\n\n async send(request: HttpRequest): Promise<HttpResponse> {\n const authHeaders = await this.credentials.authHeaders();\n // Do not modify the original request.\n const headers = new Headers(request.headers);\n for (const h of authHeaders) {\n headers.set(h.key, h.value);\n }\n return this.base.send({...request, headers});\n }\n}\n\n/** Wraps an HttpClient and applies a default timeout to requests. */\nclass TimeoutHttpClient implements HttpClient {\n constructor(\n private readonly base: HttpClient,\n private readonly timeout: number\n ) {}\n\n async send(request: HttpRequest): Promise<HttpResponse> {\n const timeoutSignal = AbortSignal.timeout(this.timeout);\n const signal =\n request.signal !== undefined\n ? AbortSignal.any([request.signal, timeoutSignal])\n : timeoutSignal;\n return this.base.send({...request, signal});\n }\n}\n"],"mappings":";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