@databricks/sdk-agentkit 0.0.3 → 0.0.5
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/dist/package.js +1 -1
- package/dist/v1/client.d.ts +19 -1
- package/dist/v1/client.d.ts.map +1 -1
- package/dist/v1/client.js +185 -1
- package/dist/v1/client.js.map +1 -1
- package/dist/v1/index.d.ts +2 -2
- package/dist/v1/index.js +2 -2
- package/dist/v1/model.d.ts +141 -1
- package/dist/v1/model.d.ts.map +1 -1
- package/dist/v1/model.js +91 -1
- package/dist/v1/model.js.map +1 -1
- package/package.json +3 -3
package/dist/package.js
CHANGED
package/dist/v1/client.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AppendSessionItemsRequest, AppendSessionItemsResponse, ClearSessionItemsRequest, ClearSessionItemsResponse, CreateManagedMemoryEntryRequest, CreateManagedMemoryStoreRequest, CreateSessionRequest, CreateSessionStoreRequest, DeleteManagedMemoryEntryRequest, DeleteManagedMemoryStoreRequest, DeleteSessionRequest, DeleteSessionStoreRequest, ExtractMemoriesRequest, ExtractMemoriesResponse, ForkSessionRequest, ForkSessionResponse, GetManagedMemoryEntryRequest, GetManagedMemoryStoreRequest, GetSessionRequest, GetSessionStoreRequest, ListManagedMemoryEntriesRequest, ListManagedMemoryEntriesResponse, ListManagedMemoryStoresRequest, ListManagedMemoryStoresResponse, ListSessionItemsRequest, ListSessionItemsResponse, ListSessionStoresRequest, ListSessionStoresResponse, ListSessionsRequest, ListSessionsResponse, ManagedMemoryEntry, ManagedMemoryEntrySearchResult, ManagedMemoryStore, PopSessionItemRequest, PopSessionItemResponse, SearchManagedMemoryEntriesRequest, SearchManagedMemoryEntriesResponse, Session, SessionItem, SessionStore, UpdateManagedMemoryEntryRequest, UpdateManagedMemoryStoreRequest, UpdateSessionRequest, UpdateSessionStoreRequest } from "./model.js";
|
|
1
|
+
import { AppendSessionItemsRequest, AppendSessionItemsResponse, ClearSessionItemsRequest, ClearSessionItemsResponse, CreateManagedMemoryEntryRequest, CreateManagedMemoryStoreRequest, CreateSessionRequest, CreateSessionStoreRequest, DeleteManagedMemoryEntryRequest, DeleteManagedMemoryStoreRequest, DeleteSessionRequest, DeleteSessionStoreRequest, ExtractMemoriesRequest, ExtractMemoriesResponse, ForkSessionRequest, ForkSessionResponse, GetManagedMemoryEntryRequest, GetManagedMemoryStoreRequest, GetMemoryStorePermissionRequest, GetSessionRequest, GetSessionStorePermissionRequest, GetSessionStoreRequest, GrantMemoryStorePermissionRequest, GrantMemoryStorePermissionResponse, GrantSessionStorePermissionRequest, GrantSessionStorePermissionResponse, ListManagedMemoryEntriesRequest, ListManagedMemoryEntriesResponse, ListManagedMemoryStoresRequest, ListManagedMemoryStoresResponse, ListMemoryStorePermissionsRequest, ListMemoryStorePermissionsResponse, ListSessionItemsRequest, ListSessionItemsResponse, ListSessionStorePermissionsRequest, ListSessionStorePermissionsResponse, ListSessionStoresRequest, ListSessionStoresResponse, ListSessionsRequest, ListSessionsResponse, ManagedMemoryEntry, ManagedMemoryEntrySearchResult, ManagedMemoryStore, MemoryStorePermission, PopSessionItemRequest, PopSessionItemResponse, RevokeMemoryStorePermissionRequest, RevokeMemoryStorePermissionResponse, RevokeSessionStorePermissionRequest, RevokeSessionStorePermissionResponse, SearchManagedMemoryEntriesRequest, SearchManagedMemoryEntriesResponse, Session, SessionItem, SessionStore, SessionStorePermission, UpdateManagedMemoryEntryRequest, UpdateManagedMemoryStoreRequest, UpdateSessionRequest, UpdateSessionStoreRequest } from "./model.js";
|
|
2
2
|
import { CallOptions } from "@databricks/sdk-options/call";
|
|
3
3
|
import { ClientOptions } from "@databricks/sdk-options/client";
|
|
4
4
|
|
|
@@ -66,10 +66,18 @@ declare class AgentKitClient {
|
|
|
66
66
|
* exist in the caller's workspace.
|
|
67
67
|
*/
|
|
68
68
|
getMemoryStore(req: GetManagedMemoryStoreRequest, options?: CallOptions): Promise<ManagedMemoryStore>;
|
|
69
|
+
/** Retrieves the current caller's effective memory store permission. Returns PERMISSION_LEVEL_UNSPECIFIED when the caller has no access. */
|
|
70
|
+
getMemoryStorePermission(req: GetMemoryStorePermissionRequest, options?: CallOptions): Promise<MemoryStorePermission>;
|
|
69
71
|
/** Gets a session by resource name. */
|
|
70
72
|
getSession(req: GetSessionRequest, options?: CallOptions): Promise<Session>;
|
|
71
73
|
/** Gets a session store by resource name. */
|
|
72
74
|
getSessionStore(req: GetSessionStoreRequest, options?: CallOptions): Promise<SessionStore>;
|
|
75
|
+
/** Retrieves the current caller's effective session store permission. Returns PERMISSION_LEVEL_UNSPECIFIED when the caller has no access. */
|
|
76
|
+
getSessionStorePermission(req: GetSessionStorePermissionRequest, options?: CallOptions): Promise<SessionStorePermission>;
|
|
77
|
+
/** Grants a READ or WRITE permission on a memory store to a principal. Only the owner or a workspace admin may grant permissions. */
|
|
78
|
+
grantMemoryStorePermission(req: GrantMemoryStorePermissionRequest, options?: CallOptions): Promise<GrantMemoryStorePermissionResponse>;
|
|
79
|
+
/** Grants a READ or WRITE permission on a session store to a principal. Only the owner or a workspace admin may grant permissions. */
|
|
80
|
+
grantSessionStorePermission(req: GrantSessionStorePermissionRequest, options?: CallOptions): Promise<GrantSessionStorePermissionResponse>;
|
|
73
81
|
/**
|
|
74
82
|
* Lists memory entries for one actor. An exact `path` filters entries across sessions,
|
|
75
83
|
* ignoring session metadata. Otherwise, `session_id` and `path_prefix` restrict the actor
|
|
@@ -77,12 +85,18 @@ declare class AgentKitClient {
|
|
|
77
85
|
*/
|
|
78
86
|
listMemories(req: ListManagedMemoryEntriesRequest, options?: CallOptions): Promise<ListManagedMemoryEntriesResponse>;
|
|
79
87
|
listMemoriesIter(req: ListManagedMemoryEntriesRequest, options?: CallOptions): AsyncGenerator<ManagedMemoryEntry>;
|
|
88
|
+
/** Lists explicit memory store grants. Only the owner or a workspace admin may list permissions. */
|
|
89
|
+
listMemoryStorePermissions(req: ListMemoryStorePermissionsRequest, options?: CallOptions): Promise<ListMemoryStorePermissionsResponse>;
|
|
90
|
+
listMemoryStorePermissionsIter(req: ListMemoryStorePermissionsRequest, options?: CallOptions): AsyncGenerator<MemoryStorePermission>;
|
|
80
91
|
/** Lists memory stores in the caller's workspace. */
|
|
81
92
|
listMemoryStores(req: ListManagedMemoryStoresRequest, options?: CallOptions): Promise<ListManagedMemoryStoresResponse>;
|
|
82
93
|
listMemoryStoresIter(req: ListManagedMemoryStoresRequest, options?: CallOptions): AsyncGenerator<ManagedMemoryStore>;
|
|
83
94
|
/** Lists items in a session. */
|
|
84
95
|
listSessionItems(req: ListSessionItemsRequest, options?: CallOptions): Promise<ListSessionItemsResponse>;
|
|
85
96
|
listSessionItemsIter(req: ListSessionItemsRequest, options?: CallOptions): AsyncGenerator<SessionItem>;
|
|
97
|
+
/** Lists explicit session store grants. Only the owner or a workspace admin may list permissions. */
|
|
98
|
+
listSessionStorePermissions(req: ListSessionStorePermissionsRequest, options?: CallOptions): Promise<ListSessionStorePermissionsResponse>;
|
|
99
|
+
listSessionStorePermissionsIter(req: ListSessionStorePermissionsRequest, options?: CallOptions): AsyncGenerator<SessionStorePermission>;
|
|
86
100
|
/** Lists session stores. */
|
|
87
101
|
listSessionStores(req: ListSessionStoresRequest, options?: CallOptions): Promise<ListSessionStoresResponse>;
|
|
88
102
|
listSessionStoresIter(req: ListSessionStoresRequest, options?: CallOptions): AsyncGenerator<SessionStore>;
|
|
@@ -91,6 +105,10 @@ declare class AgentKitClient {
|
|
|
91
105
|
listSessionsIter(req: ListSessionsRequest, options?: CallOptions): AsyncGenerator<Session>;
|
|
92
106
|
/** Pops the newest item from a session. */
|
|
93
107
|
popSessionItem(req: PopSessionItemRequest, options?: CallOptions): Promise<PopSessionItemResponse>;
|
|
108
|
+
/** Removes a principal's explicit READ and WRITE grants on a memory store. Only the owner or a workspace admin may revoke permissions. Ownership and inherited access are unaffected. */
|
|
109
|
+
revokeMemoryStorePermission(req: RevokeMemoryStorePermissionRequest, options?: CallOptions): Promise<RevokeMemoryStorePermissionResponse>;
|
|
110
|
+
/** Removes a principal's explicit READ and WRITE grants on a session store. Only the owner or a workspace admin may revoke permissions. Ownership and inherited access are unaffected. */
|
|
111
|
+
revokeSessionStorePermission(req: RevokeSessionStorePermissionRequest, options?: CallOptions): Promise<RevokeSessionStorePermissionResponse>;
|
|
94
112
|
/**
|
|
95
113
|
* Searches memory entries by text query for one actor. Returns matching entries and
|
|
96
114
|
* scores ranked by relevance; `view` controls whether each returned entry includes content.
|
package/dist/v1/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","names":[],"sources":["../../src/v1/client.ts"],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"client.d.ts","names":[],"sources":["../../src/v1/client.ts"],"mappings":";;;;;cA8Ha,cAAA;EAAA,iBACM,OAAA;EAAA,iBACA,MAAA;EAAA,iBAIA,SAAA;EAAA,QAIT,MAAA;cAEI,OAAA,EAAS,aAAA;EAAA,QAUb,aAAA;EAQI;EAFN,kBAAA,CACJ,GAAA,EAAK,yBAAA,EACL,OAAA,GAAU,WAAA,GACT,OAAA,CAAQ,0BAAA;EAAR;EA2BG,iBAAA,CACJ,GAAA,EAAK,wBAAA,EACL,OAAA,GAAU,WAAA,GACT,OAAA,CAAQ,yBAAA;EADC;;;;;;;EAkCN,YAAA,CACJ,GAAA,EAAK,+BAAA,EACL,OAAA,GAAU,WAAA,GACT,OAAA,CAAQ,kBAAA;EA4CC;EAFN,iBAAA,CACJ,GAAA,EAAK,+BAAA,EACL,OAAA,GAAU,WAAA,GACT,OAAA,CAAQ,kBAAA;EAAR;EA0CG,aAAA,CACJ,GAAA,EAAK,oBAAA,EACL,OAAA,GAAU,WAAA,GACT,OAAA,CAAQ,OAAA;EADC;EAwCN,kBAAA,CACJ,GAAA,EAAK,yBAAA,EACL,OAAA,GAAU,WAAA,GACT,OAAA,CAAQ,YAAA;EA1CR;;;;EAoFG,YAAA,CACJ,GAAA,EAAK,+BAAA,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AU,WAAA,GACT,cAAA,CAAe,OAAA;EAhRP;EA+RL,cAAA,CACJ,GAAA,EAAK,qBAAA,EACL,OAAA,GAAU,WAAA,GACT,OAAA,CAAQ,sBAAA;EA5PJ;EAuRD,2BAAA,CACJ,GAAA,EAAK,kCAAA,EACL,OAAA,GAAU,WAAA,GACT,OAAA,CAAQ,mCAAA;EAxRO;EAyTZ,4BAAA,CACJ,GAAA,EAAK,mCAAA,EACL,OAAA,GAAU,WAAA,GACT,OAAA,CAAQ,oCAAA;EA5SJ;;;;EAgVD,cAAA,CACJ,GAAA,EAAK,iCAAA,EACL,OAAA,GAAU,WAAA,GACT,OAAA,CAAQ,kCAAA;EAgCJ,kBAAA,CACL,GAAA,EAAK,iCAAA,EACL,OAAA,GAAU,WAAA,GACT,cAAA,CAAe,8BAAA;EA5UA;EA2VZ,YAAA,CACJ,GAAA,EAAK,+BAAA,EACL,OAAA,GAAU,WAAA,GACT,OAAA,CAAQ,kBAAA;EA9UJ;EAwXD,iBAAA,CACJ,GAAA,EAAK,+BAAA,EACL,OAAA,GAAU,WAAA,GACT,OAAA,CAAQ,kBAAA;EAzXA;EAmaL,aAAA,CACJ,GAAA,EAAK,oBAAA,EACL,OAAA,GAAU,WAAA,GACT,OAAA,CAAQ,OAAA;EAhYJ;EAuaD,kBAAA,CACJ,GAAA,EAAK,yBAAA,EACL,OAAA,GAAU,WAAA,GACT,OAAA,CAAQ,YAAA;AAAA"}
|
package/dist/v1/client.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { resolveClientConfig } from "./transport.js";
|
|
2
2
|
import { buildHttpRequest, executeCall, executeHttpCall, marshalRequest, parseResponse } from "./utils.js";
|
|
3
3
|
import { name, version } from "../package.js";
|
|
4
|
-
import { marshalAppendSessionItemsRequestSchema, marshalClearSessionItemsRequestSchema, marshalExtractMemoriesRequestSchema, marshalForkSessionRequestSchema, marshalManagedMemoryEntrySchema, marshalManagedMemoryStoreSchema, marshalPopSessionItemRequestSchema, marshalSearchManagedMemoryEntriesRequestSchema, marshalSessionSchema, marshalSessionStoreSchema, unmarshalAppendSessionItemsResponseSchema, unmarshalClearSessionItemsResponseSchema, unmarshalExtractMemoriesResponseSchema, unmarshalForkSessionResponseSchema, unmarshalListManagedMemoryEntriesResponseSchema, unmarshalListManagedMemoryStoresResponseSchema, unmarshalListSessionItemsResponseSchema, unmarshalListSessionStoresResponseSchema, unmarshalListSessionsResponseSchema, unmarshalManagedMemoryEntrySchema, unmarshalManagedMemoryStoreSchema, unmarshalPopSessionItemResponseSchema, unmarshalSearchManagedMemoryEntriesResponseSchema, unmarshalSessionSchema, unmarshalSessionStoreSchema } from "./model.js";
|
|
4
|
+
import { marshalAppendSessionItemsRequestSchema, marshalClearSessionItemsRequestSchema, marshalExtractMemoriesRequestSchema, marshalForkSessionRequestSchema, marshalGrantMemoryStorePermissionRequestSchema, marshalGrantSessionStorePermissionRequestSchema, marshalManagedMemoryEntrySchema, marshalManagedMemoryStoreSchema, marshalPopSessionItemRequestSchema, marshalRevokeMemoryStorePermissionRequestSchema, marshalRevokeSessionStorePermissionRequestSchema, marshalSearchManagedMemoryEntriesRequestSchema, marshalSessionSchema, marshalSessionStoreSchema, unmarshalAppendSessionItemsResponseSchema, unmarshalClearSessionItemsResponseSchema, unmarshalExtractMemoriesResponseSchema, unmarshalForkSessionResponseSchema, unmarshalGrantMemoryStorePermissionResponseSchema, unmarshalGrantSessionStorePermissionResponseSchema, unmarshalListManagedMemoryEntriesResponseSchema, unmarshalListManagedMemoryStoresResponseSchema, unmarshalListMemoryStorePermissionsResponseSchema, unmarshalListSessionItemsResponseSchema, unmarshalListSessionStorePermissionsResponseSchema, unmarshalListSessionStoresResponseSchema, unmarshalListSessionsResponseSchema, unmarshalManagedMemoryEntrySchema, unmarshalManagedMemoryStoreSchema, unmarshalMemoryStorePermissionSchema, unmarshalPopSessionItemResponseSchema, unmarshalRevokeMemoryStorePermissionResponseSchema, unmarshalRevokeSessionStorePermissionResponseSchema, unmarshalSearchManagedMemoryEntriesResponseSchema, unmarshalSessionSchema, unmarshalSessionStorePermissionSchema, unmarshalSessionStoreSchema } from "./model.js";
|
|
5
5
|
import { VERSION } from "@databricks/sdk-auth";
|
|
6
6
|
import { createDefault } from "@databricks/sdk-core/clientinfo";
|
|
7
7
|
import { NoOpLogger } from "@databricks/sdk-core/logger";
|
|
@@ -341,6 +341,25 @@ var AgentKitClient = class {
|
|
|
341
341
|
if (resp === void 0) throw new Error("operation completed without a result.");
|
|
342
342
|
return resp;
|
|
343
343
|
}
|
|
344
|
+
/** Retrieves the current caller's effective memory store permission. Returns PERMISSION_LEVEL_UNSPECIFIED when the caller has no access. */
|
|
345
|
+
async getMemoryStorePermission(req, options) {
|
|
346
|
+
const { host, workspaceId, httpClient } = await this.resolveConfig();
|
|
347
|
+
const url = `${host}/api/2.0/agents/${req.name ?? ""}/permissions/self`;
|
|
348
|
+
let resp;
|
|
349
|
+
const call = async (callSignal) => {
|
|
350
|
+
const headers = new Headers();
|
|
351
|
+
if (workspaceId !== void 0) headers.set("X-Databricks-Workspace-Id", workspaceId);
|
|
352
|
+
headers.set("User-Agent", this.userAgent);
|
|
353
|
+
resp = parseResponse(await executeHttpCall({
|
|
354
|
+
request: buildHttpRequest("GET", url, headers, callSignal),
|
|
355
|
+
httpClient,
|
|
356
|
+
logger: this.logger
|
|
357
|
+
}), unmarshalMemoryStorePermissionSchema);
|
|
358
|
+
};
|
|
359
|
+
await executeCall(call, options);
|
|
360
|
+
if (resp === void 0) throw new Error("operation completed without a result.");
|
|
361
|
+
return resp;
|
|
362
|
+
}
|
|
344
363
|
/** Gets a session by resource name. */
|
|
345
364
|
async getSession(req, options) {
|
|
346
365
|
const { host, workspaceId, httpClient } = await this.resolveConfig();
|
|
@@ -379,6 +398,65 @@ var AgentKitClient = class {
|
|
|
379
398
|
if (resp === void 0) throw new Error("operation completed without a result.");
|
|
380
399
|
return resp;
|
|
381
400
|
}
|
|
401
|
+
/** Retrieves the current caller's effective session store permission. Returns PERMISSION_LEVEL_UNSPECIFIED when the caller has no access. */
|
|
402
|
+
async getSessionStorePermission(req, options) {
|
|
403
|
+
const { host, workspaceId, httpClient } = await this.resolveConfig();
|
|
404
|
+
const url = `${host}/api/2.0/agents/${req.name ?? ""}/permissions/self`;
|
|
405
|
+
let resp;
|
|
406
|
+
const call = async (callSignal) => {
|
|
407
|
+
const headers = new Headers();
|
|
408
|
+
if (workspaceId !== void 0) headers.set("X-Databricks-Workspace-Id", workspaceId);
|
|
409
|
+
headers.set("User-Agent", this.userAgent);
|
|
410
|
+
resp = parseResponse(await executeHttpCall({
|
|
411
|
+
request: buildHttpRequest("GET", url, headers, callSignal),
|
|
412
|
+
httpClient,
|
|
413
|
+
logger: this.logger
|
|
414
|
+
}), unmarshalSessionStorePermissionSchema);
|
|
415
|
+
};
|
|
416
|
+
await executeCall(call, options);
|
|
417
|
+
if (resp === void 0) throw new Error("operation completed without a result.");
|
|
418
|
+
return resp;
|
|
419
|
+
}
|
|
420
|
+
/** Grants a READ or WRITE permission on a memory store to a principal. Only the owner or a workspace admin may grant permissions. */
|
|
421
|
+
async grantMemoryStorePermission(req, options) {
|
|
422
|
+
const { host, workspaceId, httpClient } = await this.resolveConfig();
|
|
423
|
+
const url = `${host}/api/2.0/agents/${req.name ?? ""}/permissions:grant`;
|
|
424
|
+
const body = marshalRequest(req, marshalGrantMemoryStorePermissionRequestSchema);
|
|
425
|
+
let resp;
|
|
426
|
+
const call = async (callSignal) => {
|
|
427
|
+
const headers = new Headers({ "Content-Type": "application/json" });
|
|
428
|
+
if (workspaceId !== void 0) headers.set("X-Databricks-Workspace-Id", workspaceId);
|
|
429
|
+
headers.set("User-Agent", this.userAgent);
|
|
430
|
+
resp = parseResponse(await executeHttpCall({
|
|
431
|
+
request: buildHttpRequest("POST", url, headers, callSignal, body),
|
|
432
|
+
httpClient,
|
|
433
|
+
logger: this.logger
|
|
434
|
+
}), unmarshalGrantMemoryStorePermissionResponseSchema);
|
|
435
|
+
};
|
|
436
|
+
await executeCall(call, options);
|
|
437
|
+
if (resp === void 0) throw new Error("operation completed without a result.");
|
|
438
|
+
return resp;
|
|
439
|
+
}
|
|
440
|
+
/** Grants a READ or WRITE permission on a session store to a principal. Only the owner or a workspace admin may grant permissions. */
|
|
441
|
+
async grantSessionStorePermission(req, options) {
|
|
442
|
+
const { host, workspaceId, httpClient } = await this.resolveConfig();
|
|
443
|
+
const url = `${host}/api/2.0/agents/${req.name ?? ""}/permissions:grant`;
|
|
444
|
+
const body = marshalRequest(req, marshalGrantSessionStorePermissionRequestSchema);
|
|
445
|
+
let resp;
|
|
446
|
+
const call = async (callSignal) => {
|
|
447
|
+
const headers = new Headers({ "Content-Type": "application/json" });
|
|
448
|
+
if (workspaceId !== void 0) headers.set("X-Databricks-Workspace-Id", workspaceId);
|
|
449
|
+
headers.set("User-Agent", this.userAgent);
|
|
450
|
+
resp = parseResponse(await executeHttpCall({
|
|
451
|
+
request: buildHttpRequest("POST", url, headers, callSignal, body),
|
|
452
|
+
httpClient,
|
|
453
|
+
logger: this.logger
|
|
454
|
+
}), unmarshalGrantSessionStorePermissionResponseSchema);
|
|
455
|
+
};
|
|
456
|
+
await executeCall(call, options);
|
|
457
|
+
if (resp === void 0) throw new Error("operation completed without a result.");
|
|
458
|
+
return resp;
|
|
459
|
+
}
|
|
382
460
|
/**
|
|
383
461
|
* Lists memory entries for one actor. An exact `path` filters entries across sessions,
|
|
384
462
|
* ignoring session metadata. Otherwise, `session_id` and `path_prefix` restrict the actor
|
|
@@ -420,6 +498,39 @@ var AgentKitClient = class {
|
|
|
420
498
|
pageReq.pageToken = resp.nextPageToken;
|
|
421
499
|
}
|
|
422
500
|
}
|
|
501
|
+
/** Lists explicit memory store grants. Only the owner or a workspace admin may list permissions. */
|
|
502
|
+
async listMemoryStorePermissions(req, options) {
|
|
503
|
+
const { host, workspaceId, httpClient } = await this.resolveConfig();
|
|
504
|
+
const url = `${host}/api/2.0/agents/${req.parent ?? ""}/permissions`;
|
|
505
|
+
const params = new URLSearchParams();
|
|
506
|
+
if (req.pageSize !== void 0) params.append("page_size", String(req.pageSize));
|
|
507
|
+
if (req.pageToken !== void 0) params.append("page_token", req.pageToken);
|
|
508
|
+
const query = params.toString();
|
|
509
|
+
const fullUrl = query !== "" ? `${url}?${query}` : url;
|
|
510
|
+
let resp;
|
|
511
|
+
const call = async (callSignal) => {
|
|
512
|
+
const headers = new Headers();
|
|
513
|
+
if (workspaceId !== void 0) headers.set("X-Databricks-Workspace-Id", workspaceId);
|
|
514
|
+
headers.set("User-Agent", this.userAgent);
|
|
515
|
+
resp = parseResponse(await executeHttpCall({
|
|
516
|
+
request: buildHttpRequest("GET", fullUrl, headers, callSignal),
|
|
517
|
+
httpClient,
|
|
518
|
+
logger: this.logger
|
|
519
|
+
}), unmarshalListMemoryStorePermissionsResponseSchema);
|
|
520
|
+
};
|
|
521
|
+
await executeCall(call, options);
|
|
522
|
+
if (resp === void 0) throw new Error("operation completed without a result.");
|
|
523
|
+
return resp;
|
|
524
|
+
}
|
|
525
|
+
async *listMemoryStorePermissionsIter(req, options) {
|
|
526
|
+
const pageReq = { ...req };
|
|
527
|
+
for (;;) {
|
|
528
|
+
const resp = await this.listMemoryStorePermissions(pageReq, options);
|
|
529
|
+
for (const item of resp.memoryStorePermissions ?? []) yield item;
|
|
530
|
+
if (resp.nextPageToken === void 0 || resp.nextPageToken === "") return;
|
|
531
|
+
pageReq.pageToken = resp.nextPageToken;
|
|
532
|
+
}
|
|
533
|
+
}
|
|
423
534
|
/** Lists memory stores in the caller's workspace. */
|
|
424
535
|
async listMemoryStores(req, options) {
|
|
425
536
|
const { host, workspaceId, httpClient } = await this.resolveConfig();
|
|
@@ -487,6 +598,39 @@ var AgentKitClient = class {
|
|
|
487
598
|
pageReq.pageToken = resp.nextPageToken;
|
|
488
599
|
}
|
|
489
600
|
}
|
|
601
|
+
/** Lists explicit session store grants. Only the owner or a workspace admin may list permissions. */
|
|
602
|
+
async listSessionStorePermissions(req, options) {
|
|
603
|
+
const { host, workspaceId, httpClient } = await this.resolveConfig();
|
|
604
|
+
const url = `${host}/api/2.0/agents/${req.parent ?? ""}/permissions`;
|
|
605
|
+
const params = new URLSearchParams();
|
|
606
|
+
if (req.pageSize !== void 0) params.append("page_size", String(req.pageSize));
|
|
607
|
+
if (req.pageToken !== void 0) params.append("page_token", req.pageToken);
|
|
608
|
+
const query = params.toString();
|
|
609
|
+
const fullUrl = query !== "" ? `${url}?${query}` : url;
|
|
610
|
+
let resp;
|
|
611
|
+
const call = async (callSignal) => {
|
|
612
|
+
const headers = new Headers();
|
|
613
|
+
if (workspaceId !== void 0) headers.set("X-Databricks-Workspace-Id", workspaceId);
|
|
614
|
+
headers.set("User-Agent", this.userAgent);
|
|
615
|
+
resp = parseResponse(await executeHttpCall({
|
|
616
|
+
request: buildHttpRequest("GET", fullUrl, headers, callSignal),
|
|
617
|
+
httpClient,
|
|
618
|
+
logger: this.logger
|
|
619
|
+
}), unmarshalListSessionStorePermissionsResponseSchema);
|
|
620
|
+
};
|
|
621
|
+
await executeCall(call, options);
|
|
622
|
+
if (resp === void 0) throw new Error("operation completed without a result.");
|
|
623
|
+
return resp;
|
|
624
|
+
}
|
|
625
|
+
async *listSessionStorePermissionsIter(req, options) {
|
|
626
|
+
const pageReq = { ...req };
|
|
627
|
+
for (;;) {
|
|
628
|
+
const resp = await this.listSessionStorePermissions(pageReq, options);
|
|
629
|
+
for (const item of resp.sessionStorePermissions ?? []) yield item;
|
|
630
|
+
if (resp.nextPageToken === void 0 || resp.nextPageToken === "") return;
|
|
631
|
+
pageReq.pageToken = resp.nextPageToken;
|
|
632
|
+
}
|
|
633
|
+
}
|
|
490
634
|
/** Lists session stores. */
|
|
491
635
|
async listSessionStores(req, options) {
|
|
492
636
|
const { host, workspaceId, httpClient } = await this.resolveConfig();
|
|
@@ -575,6 +719,46 @@ var AgentKitClient = class {
|
|
|
575
719
|
if (resp === void 0) throw new Error("operation completed without a result.");
|
|
576
720
|
return resp;
|
|
577
721
|
}
|
|
722
|
+
/** Removes a principal's explicit READ and WRITE grants on a memory store. Only the owner or a workspace admin may revoke permissions. Ownership and inherited access are unaffected. */
|
|
723
|
+
async revokeMemoryStorePermission(req, options) {
|
|
724
|
+
const { host, workspaceId, httpClient } = await this.resolveConfig();
|
|
725
|
+
const url = `${host}/api/2.0/agents/${req.name ?? ""}/permissions:revoke`;
|
|
726
|
+
const body = marshalRequest(req, marshalRevokeMemoryStorePermissionRequestSchema);
|
|
727
|
+
let resp;
|
|
728
|
+
const call = async (callSignal) => {
|
|
729
|
+
const headers = new Headers({ "Content-Type": "application/json" });
|
|
730
|
+
if (workspaceId !== void 0) headers.set("X-Databricks-Workspace-Id", workspaceId);
|
|
731
|
+
headers.set("User-Agent", this.userAgent);
|
|
732
|
+
resp = parseResponse(await executeHttpCall({
|
|
733
|
+
request: buildHttpRequest("POST", url, headers, callSignal, body),
|
|
734
|
+
httpClient,
|
|
735
|
+
logger: this.logger
|
|
736
|
+
}), unmarshalRevokeMemoryStorePermissionResponseSchema);
|
|
737
|
+
};
|
|
738
|
+
await executeCall(call, options);
|
|
739
|
+
if (resp === void 0) throw new Error("operation completed without a result.");
|
|
740
|
+
return resp;
|
|
741
|
+
}
|
|
742
|
+
/** Removes a principal's explicit READ and WRITE grants on a session store. Only the owner or a workspace admin may revoke permissions. Ownership and inherited access are unaffected. */
|
|
743
|
+
async revokeSessionStorePermission(req, options) {
|
|
744
|
+
const { host, workspaceId, httpClient } = await this.resolveConfig();
|
|
745
|
+
const url = `${host}/api/2.0/agents/${req.name ?? ""}/permissions:revoke`;
|
|
746
|
+
const body = marshalRequest(req, marshalRevokeSessionStorePermissionRequestSchema);
|
|
747
|
+
let resp;
|
|
748
|
+
const call = async (callSignal) => {
|
|
749
|
+
const headers = new Headers({ "Content-Type": "application/json" });
|
|
750
|
+
if (workspaceId !== void 0) headers.set("X-Databricks-Workspace-Id", workspaceId);
|
|
751
|
+
headers.set("User-Agent", this.userAgent);
|
|
752
|
+
resp = parseResponse(await executeHttpCall({
|
|
753
|
+
request: buildHttpRequest("POST", url, headers, callSignal, body),
|
|
754
|
+
httpClient,
|
|
755
|
+
logger: this.logger
|
|
756
|
+
}), unmarshalRevokeSessionStorePermissionResponseSchema);
|
|
757
|
+
};
|
|
758
|
+
await executeCall(call, options);
|
|
759
|
+
if (resp === void 0) throw new Error("operation completed without a result.");
|
|
760
|
+
return resp;
|
|
761
|
+
}
|
|
578
762
|
/**
|
|
579
763
|
* Searches memory entries by text query for one actor. Returns matching entries and
|
|
580
764
|
* scores ranked by relevance; `view` controls whether each returned entry includes content.
|