@beeos-ai/bma-sdk 0.3.0 → 0.4.0

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/README.md CHANGED
@@ -47,3 +47,6 @@ It also exports the extension field types `ModelConfigOverride`
47
47
  (`agent.model.api_url/api_key/api_format`), `MCPServerBMAAuth`
48
48
  (`mcp_servers[].bma_auth`), `IDEMPOTENCY_KEY_HEADER`, and `bmaSequence(event)`
49
49
  for `bma_sequence` resume cursors.
50
+
51
+ The executor protocol (executor, harness and agent ends) is the separate
52
+ package [`@beeos-ai/bma-executor-sdk`](../executor/typescript).
@@ -4,6 +4,17 @@ export type { paths as FacadeExtensionPaths };
4
4
  export type DesktopStream = components["schemas"]["DesktopStream"];
5
5
  export type SessionFile = components["schemas"]["SessionFile"];
6
6
  export type SessionFilePage = components["schemas"]["SessionFilePage"];
7
+ /** BMA extension: a project file mounted into a session. */
8
+ export type FileResource = components["schemas"]["FileResource"];
9
+ export type FileResourcePage = components["schemas"]["FileResourcePage"];
10
+ export type DeletedSessionResource = components["schemas"]["DeletedSessionResource"];
11
+ /** BMA extension: one downloaded session file with its response metadata. */
12
+ export interface SessionFileContent {
13
+ content: Uint8Array;
14
+ contentType: string | null;
15
+ filename: string | null;
16
+ digest: string | null;
17
+ }
7
18
  /** BMA extension: session `agent.model` object with a write-only credential override. */
8
19
  export type ModelConfigOverride = components["schemas"]["ModelConfigOverride"];
9
20
  /** BMA extension: `mcp_servers[].bma_auth`. */
@@ -49,4 +60,12 @@ export declare class FacadeExtensionsClient {
49
60
  limit?: number;
50
61
  page?: string;
51
62
  }): Promise<SessionFilePage>;
63
+ /** BMA extension: GET /v1/sessions/{session_id}/files/{file_id}/content. */
64
+ downloadSessionFile(sessionId: string, fileId: string): Promise<SessionFileContent>;
65
+ /** BMA extension: POST /v1/sessions/{session_id}/resources. */
66
+ addSessionResource(sessionId: string, fileId: string, mountPath?: string): Promise<FileResource>;
67
+ /** BMA extension: GET /v1/sessions/{session_id}/resources. */
68
+ listSessionResources(sessionId: string): Promise<FileResourcePage>;
69
+ /** BMA extension: DELETE /v1/sessions/{session_id}/resources/{resource_id}. */
70
+ deleteSessionResource(sessionId: string, resourceId: string): Promise<DeletedSessionResource>;
52
71
  }
@@ -1,12 +1,18 @@
1
1
  // BMA extensions to the Anthropic Managed Agents API.
2
2
  //
3
3
  // The standard facade routes (/v1/agents, /v1/environments, /v1/sessions,
4
- // events, events/stream, /v1/memory_stores) are served by the official
5
- // Anthropic SDKs pointed at a BMA deployment. Everything in this module is a
4
+ // events, events/stream, /v1/files, /v1/memory_stores) are served by the
5
+ // official Anthropic SDKs pointed at a BMA deployment. Everything in this module is a
6
6
  // BMA extension that is NOT part of the Anthropic contract. Types come from
7
7
  // src/generated/facade-extensions.ts, generated from
8
8
  // contracts/bma/facade-extensions.openapi.yaml.
9
9
  import createClient from "openapi-fetch";
10
+ function dispositionFilename(value) {
11
+ if (!value)
12
+ return null;
13
+ const match = /filename\*?=(?:UTF-8'')?"?([^";]+)"?/i.exec(value);
14
+ return match?.[1] ? decodeURIComponent(match[1]) : null;
15
+ }
10
16
  /** BMA extension header forwarded on session create and send-events. */
11
17
  export const IDEMPOTENCY_KEY_HEADER = "Idempotency-Key";
12
18
  /**
@@ -86,5 +92,43 @@ export class FacadeExtensionsClient {
86
92
  params: { path: { session_id: sessionId }, query: { limit: options.limit, page: options.page } },
87
93
  }));
88
94
  }
95
+ /** BMA extension: GET /v1/sessions/{session_id}/files/{file_id}/content. */
96
+ async downloadSessionFile(sessionId, fileId) {
97
+ const result = await this.raw.GET("/v1/sessions/{session_id}/files/{file_id}/content", {
98
+ params: { path: { session_id: sessionId, file_id: fileId } },
99
+ parseAs: "arrayBuffer",
100
+ });
101
+ if (!result.response.ok)
102
+ throw new FacadeApiError(result.response.status, result.error);
103
+ return {
104
+ content: new Uint8Array(result.data),
105
+ contentType: result.response.headers.get("content-type"),
106
+ filename: dispositionFilename(result.response.headers.get("content-disposition")),
107
+ digest: result.response.headers.get("x-bma-file-digest"),
108
+ };
109
+ }
110
+ /** BMA extension: POST /v1/sessions/{session_id}/resources. */
111
+ async addSessionResource(sessionId, fileId, mountPath) {
112
+ return check(await this.raw.POST("/v1/sessions/{session_id}/resources", {
113
+ params: { path: { session_id: sessionId } },
114
+ body: {
115
+ type: "file",
116
+ file_id: fileId,
117
+ ...(mountPath === undefined ? {} : { mount_path: mountPath }),
118
+ },
119
+ }));
120
+ }
121
+ /** BMA extension: GET /v1/sessions/{session_id}/resources. */
122
+ async listSessionResources(sessionId) {
123
+ return check(await this.raw.GET("/v1/sessions/{session_id}/resources", {
124
+ params: { path: { session_id: sessionId } },
125
+ }));
126
+ }
127
+ /** BMA extension: DELETE /v1/sessions/{session_id}/resources/{resource_id}. */
128
+ async deleteSessionResource(sessionId, resourceId) {
129
+ return check(await this.raw.DELETE("/v1/sessions/{session_id}/resources/{resource_id}", {
130
+ params: { path: { session_id: sessionId, resource_id: resourceId } },
131
+ }));
132
+ }
89
133
  }
90
134
  //# sourceMappingURL=facade-extensions.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"facade-extensions.js","sourceRoot":"","sources":["../src/facade-extensions.ts"],"names":[],"mappings":"AAAA,sDAAsD;AACtD,EAAE;AACF,0EAA0E;AAC1E,uEAAuE;AACvE,6EAA6E;AAC7E,4EAA4E;AAC5E,qDAAqD;AACrD,gDAAgD;AAChD,OAAO,YAA6B,MAAM,eAAe,CAAC;AAY1D,wEAAwE;AACxE,MAAM,CAAC,MAAM,sBAAsB,GAAG,iBAAiB,CAAC;AAExD;;;;GAIG;AACH,MAAM,UAAU,WAAW,CAAC,KAAc;IACxC,MAAM,KAAK,GAAI,KAA2C,EAAE,YAAY,CAAC;IACzE,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,MAAM,CAAC,aAAa,CAAC,KAAK,CAAC,IAAI,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC;AACn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,SAAS,EAAE,EAAE;SAC5C,CAAC,CACH,CAAC;IACJ,CAAC;IAED,+EAA+E;IAC/E,KAAK,CAAC,qBAAqB,CAAC,SAAiB,EAAE,UAAkB;QAC/D,OAAO,KAAK,CACV,MAAM,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,mDAAmD,EAAE;YACzE,MAAM,EAAE,EAAE,IAAI,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE,WAAW,EAAE,UAAU,EAAE,EAAE;SACrE,CAAC,CACH,CAAC;IACJ,CAAC;CACF"}
@@ -51,6 +51,77 @@ export interface paths {
51
51
  patch?: never;
52
52
  trace?: never;
53
53
  };
54
+ "/v1/sessions/{session_id}/files/{file_id}/content": {
55
+ parameters: {
56
+ query?: never;
57
+ header?: never;
58
+ path?: never;
59
+ cookie?: never;
60
+ };
61
+ /**
62
+ * Download one session file (BMA extension)
63
+ * @description Streams one file's bytes. `file_id` is the `id` returned by the upload
64
+ * or list operations. The response carries `Content-Type`,
65
+ * `Content-Length` and `Content-Disposition` when known, and
66
+ * `X-BMA-File-Digest` with the sha256 of the bytes. A file of another
67
+ * session, or an unknown id, is a 404 `not_found_error`.
68
+ */
69
+ get: operations["downloadSessionFile"];
70
+ put?: never;
71
+ post?: never;
72
+ delete?: never;
73
+ options?: never;
74
+ head?: never;
75
+ patch?: never;
76
+ trace?: never;
77
+ };
78
+ "/v1/sessions/{session_id}/resources": {
79
+ parameters: {
80
+ query?: never;
81
+ header?: never;
82
+ path?: never;
83
+ cookie?: never;
84
+ };
85
+ /** List the session's mounted file resources (BMA extension) */
86
+ get: operations["listSessionResources"];
87
+ put?: never;
88
+ /**
89
+ * Mount one project file into the session (BMA extension)
90
+ * @description Mounts an uploaded project file by reference. The Anthropic contract
91
+ * mounts files through `resources` on `POST /v1/sessions`; this extension
92
+ * mounts into an existing session. The file is read-only at `mount_path`
93
+ * (default `/mnt/session/uploads/<file_id>`), and the response `file_id`
94
+ * is the session instance created for the mount, not the project file's
95
+ * own id.
96
+ */
97
+ post: operations["addSessionResource"];
98
+ delete?: never;
99
+ options?: never;
100
+ head?: never;
101
+ patch?: never;
102
+ trace?: never;
103
+ };
104
+ "/v1/sessions/{session_id}/resources/{resource_id}": {
105
+ parameters: {
106
+ query?: never;
107
+ header?: never;
108
+ path?: never;
109
+ cookie?: never;
110
+ };
111
+ get?: never;
112
+ put?: never;
113
+ post?: never;
114
+ /**
115
+ * Unmount one file resource from the session (BMA extension)
116
+ * @description Removes the mount and releases the session instance. The project file
117
+ * itself is kept; other sessions that mounted it keep their instances.
118
+ */
119
+ delete: operations["deleteSessionResource"];
120
+ options?: never;
121
+ head?: never;
122
+ patch?: never;
123
+ trace?: never;
124
+ };
54
125
  }
55
126
  export type webhooks = Record<string, never>;
56
127
  export interface components {
@@ -87,6 +158,39 @@ export interface components {
87
158
  data: components["schemas"]["SessionFile"][];
88
159
  next_page: string | null;
89
160
  };
161
+ FileResourceParams: {
162
+ /** @enum {string} */
163
+ type: "file";
164
+ /** @description The project file (`file_...`) to mount. */
165
+ file_id: string;
166
+ /**
167
+ * @description Absolute path below `/mnt/session/uploads` the session's tools read
168
+ * the file at. A path outside it is placed under it. Defaults to
169
+ * `/mnt/session/uploads/<file_id>`.
170
+ */
171
+ mount_path?: string | null;
172
+ };
173
+ FileResource: {
174
+ /** @description Opaque, stable resource id. */
175
+ id: string;
176
+ /** @enum {string} */
177
+ type: "file";
178
+ /** @description The session instance created for the mount. */
179
+ file_id: string;
180
+ mount_path: string;
181
+ /** Format: date-time */
182
+ created_at: string;
183
+ /** Format: date-time */
184
+ updated_at: string;
185
+ };
186
+ FileResourcePage: {
187
+ data: components["schemas"]["FileResource"][];
188
+ };
189
+ DeletedSessionResource: {
190
+ id: string;
191
+ /** @enum {string} */
192
+ type: "session_resource_deleted";
193
+ };
90
194
  ErrorEnvelope: {
91
195
  /** @constant */
92
196
  type: "error";
@@ -269,4 +373,135 @@ export interface operations {
269
373
  default: components["responses"]["Error"];
270
374
  };
271
375
  };
376
+ downloadSessionFile: {
377
+ parameters: {
378
+ query?: never;
379
+ header?: {
380
+ /**
381
+ * @description Project to operate in. Required when the key can read more than one
382
+ * project and the deployment has no default project.
383
+ * `anthropic-workspace-id` is accepted as an alias.
384
+ */
385
+ "x-bma-project-id"?: components["parameters"]["ProjectID"];
386
+ };
387
+ path: {
388
+ session_id: components["parameters"]["SessionID"];
389
+ file_id: string;
390
+ };
391
+ cookie?: never;
392
+ };
393
+ requestBody?: never;
394
+ responses: {
395
+ /** @description The file bytes. */
396
+ 200: {
397
+ headers: {
398
+ /** @description sha256 of the response body. */
399
+ "X-BMA-File-Digest"?: string;
400
+ /** @description Suggested download filename. */
401
+ "Content-Disposition"?: string;
402
+ [name: string]: unknown;
403
+ };
404
+ content: {
405
+ "application/octet-stream": string;
406
+ };
407
+ };
408
+ default: components["responses"]["Error"];
409
+ };
410
+ };
411
+ listSessionResources: {
412
+ parameters: {
413
+ query?: never;
414
+ header?: {
415
+ /**
416
+ * @description Project to operate in. Required when the key can read more than one
417
+ * project and the deployment has no default project.
418
+ * `anthropic-workspace-id` is accepted as an alias.
419
+ */
420
+ "x-bma-project-id"?: components["parameters"]["ProjectID"];
421
+ };
422
+ path: {
423
+ session_id: components["parameters"]["SessionID"];
424
+ };
425
+ cookie?: never;
426
+ };
427
+ requestBody?: never;
428
+ responses: {
429
+ /** @description The session's mounted file resources. */
430
+ 200: {
431
+ headers: {
432
+ [name: string]: unknown;
433
+ };
434
+ content: {
435
+ "application/json": components["schemas"]["FileResourcePage"];
436
+ };
437
+ };
438
+ default: components["responses"]["Error"];
439
+ };
440
+ };
441
+ addSessionResource: {
442
+ parameters: {
443
+ query?: never;
444
+ header?: {
445
+ /**
446
+ * @description Project to operate in. Required when the key can read more than one
447
+ * project and the deployment has no default project.
448
+ * `anthropic-workspace-id` is accepted as an alias.
449
+ */
450
+ "x-bma-project-id"?: components["parameters"]["ProjectID"];
451
+ };
452
+ path: {
453
+ session_id: components["parameters"]["SessionID"];
454
+ };
455
+ cookie?: never;
456
+ };
457
+ requestBody: {
458
+ content: {
459
+ "application/json": components["schemas"]["FileResourceParams"];
460
+ };
461
+ };
462
+ responses: {
463
+ /** @description The mounted resource. */
464
+ 200: {
465
+ headers: {
466
+ [name: string]: unknown;
467
+ };
468
+ content: {
469
+ "application/json": components["schemas"]["FileResource"];
470
+ };
471
+ };
472
+ default: components["responses"]["Error"];
473
+ };
474
+ };
475
+ deleteSessionResource: {
476
+ parameters: {
477
+ query?: never;
478
+ header?: {
479
+ /**
480
+ * @description Project to operate in. Required when the key can read more than one
481
+ * project and the deployment has no default project.
482
+ * `anthropic-workspace-id` is accepted as an alias.
483
+ */
484
+ "x-bma-project-id"?: components["parameters"]["ProjectID"];
485
+ };
486
+ path: {
487
+ session_id: components["parameters"]["SessionID"];
488
+ /** @description The `id` of the mounted resource. */
489
+ resource_id: string;
490
+ };
491
+ cookie?: never;
492
+ };
493
+ requestBody?: never;
494
+ responses: {
495
+ /** @description The resource was removed. */
496
+ 200: {
497
+ headers: {
498
+ [name: string]: unknown;
499
+ };
500
+ content: {
501
+ "application/json": components["schemas"]["DeletedSessionResource"];
502
+ };
503
+ };
504
+ default: components["responses"]["Error"];
505
+ };
506
+ };
272
507
  }