@mastra/azure 0.0.0 → 0.2.0-alpha.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/CHANGELOG.md CHANGED
@@ -1,5 +1,27 @@
1
1
  # @mastra/azure
2
2
 
3
+ ## 0.2.0-alpha.1
4
+
5
+ ### Minor Changes
6
+
7
+ - Added `AzureBlobStore`, a content-addressable blob store backed by Azure Blob Storage for skill versioning. Available alongside the existing `AzureBlobFilesystem` from `@mastra/azure/blob`. ([#15853](https://github.com/mastra-ai/mastra/pull/15853))
8
+
9
+ ```typescript
10
+ import { AzureBlobStore } from '@mastra/azure/blob';
11
+
12
+ const blobs = new AzureBlobStore({
13
+ container: 'my-skill-blobs',
14
+ connectionString: process.env.AZURE_STORAGE_CONNECTION_STRING,
15
+ });
16
+ ```
17
+
18
+ Supports the same authentication methods as `AzureBlobFilesystem`: connection string, account key, SAS token, `DefaultAzureCredential`, and anonymous access. A matching `azureBlobStoreProvider` descriptor is also exported for MastraEditor.
19
+
20
+ ### Patch Changes
21
+
22
+ - Updated dependencies [[`28caa5b`](https://github.com/mastra-ai/mastra/commit/28caa5b032358545af2589ed90636eccb4dd9d2f), [`7d056b6`](https://github.com/mastra-ai/mastra/commit/7d056b6ecf603cacaa0f663ff1df025ed885b6c1), [`26f1f94`](https://github.com/mastra-ai/mastra/commit/26f1f9490574b864ba1ecedf2c9632e0767a23bd)]:
23
+ - @mastra/core@1.29.0-alpha.5
24
+
3
25
  ## 0.2.0-alpha.0
4
26
 
5
27
  ### Minor Changes
package/LICENSE.md ADDED
@@ -0,0 +1,30 @@
1
+ Portions of this software are licensed as follows:
2
+
3
+ - All content that resides under any directory named "ee/" within this
4
+ repository, including but not limited to:
5
+ - `packages/core/src/auth/ee/`
6
+ - `packages/server/src/server/auth/ee/`
7
+ is licensed under the license defined in `ee/LICENSE`.
8
+
9
+ - All third-party components incorporated into the Mastra Software are
10
+ licensed under the original license provided by the owner of the
11
+ applicable component.
12
+
13
+ - Content outside of the above-mentioned directories or restrictions is
14
+ available under the "Apache License 2.0" as defined below.
15
+
16
+ # Apache License 2.0
17
+
18
+ Copyright (c) 2025 Kepler Software, Inc.
19
+
20
+ Licensed under the Apache License, Version 2.0 (the "License");
21
+ you may not use this file except in compliance with the License.
22
+ You may obtain a copy of the License at
23
+
24
+ http://www.apache.org/licenses/LICENSE-2.0
25
+
26
+ Unless required by applicable law or agreed to in writing, software
27
+ distributed under the License is distributed on an "AS IS" BASIS,
28
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
29
+ See the License for the specific language governing permissions and
30
+ limitations under the License.
package/README.md ADDED
@@ -0,0 +1,79 @@
1
+ # @mastra/azure
2
+
3
+ Azure Blob Storage filesystem and content-addressable blob store provider for Mastra workspaces.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm install @mastra/azure
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ ```typescript
14
+ import { Agent } from '@mastra/core/agent';
15
+ import { Workspace } from '@mastra/core/workspace';
16
+ import { AzureBlobFilesystem } from '@mastra/azure/blob';
17
+
18
+ const workspace = new Workspace({
19
+ filesystem: new AzureBlobFilesystem({
20
+ container: 'my-container',
21
+ connectionString: process.env.AZURE_STORAGE_CONNECTION_STRING,
22
+ }),
23
+ });
24
+
25
+ const agent = new Agent({
26
+ name: 'my-agent',
27
+ model: 'anthropic/claude-opus-4-5',
28
+ workspace,
29
+ });
30
+ ```
31
+
32
+ ### Account key
33
+
34
+ ```typescript
35
+ const filesystem = new AzureBlobFilesystem({
36
+ container: 'my-container',
37
+ accountName: process.env.AZURE_STORAGE_ACCOUNT_NAME,
38
+ accountKey: process.env.AZURE_STORAGE_ACCOUNT_KEY,
39
+ });
40
+ ```
41
+
42
+ ### Shared access signature
43
+
44
+ ```typescript
45
+ const filesystem = new AzureBlobFilesystem({
46
+ container: 'my-container',
47
+ accountName: process.env.AZURE_STORAGE_ACCOUNT_NAME,
48
+ sasToken: process.env.AZURE_STORAGE_SAS_TOKEN,
49
+ });
50
+ ```
51
+
52
+ ### DefaultAzureCredential
53
+
54
+ Requires `@azure/identity` to be installed.
55
+
56
+ ```typescript
57
+ const filesystem = new AzureBlobFilesystem({
58
+ container: 'my-container',
59
+ accountName: process.env.AZURE_STORAGE_ACCOUNT_NAME,
60
+ useDefaultCredential: true,
61
+ });
62
+ ```
63
+
64
+ ## Blob Store
65
+
66
+ `AzureBlobStore` is a content-addressable blob store backed by Azure Blob Storage, used for skill versioning.
67
+
68
+ ```typescript
69
+ import { AzureBlobStore } from '@mastra/azure/blob';
70
+
71
+ const blobs = new AzureBlobStore({
72
+ container: 'my-skill-blobs',
73
+ connectionString: process.env.AZURE_STORAGE_CONNECTION_STRING,
74
+ });
75
+ ```
76
+
77
+ ## Documentation
78
+
79
+ For more information, see the [Mastra Workspaces documentation](https://mastra.ai/docs/workspace/overview).
@@ -0,0 +1,84 @@
1
+ import { BlobStore } from '@mastra/core/storage';
2
+ import type { StorageBlobEntry } from '@mastra/core/storage';
3
+ /**
4
+ * Configuration for AzureBlobStore.
5
+ */
6
+ export interface AzureBlobStoreOptions {
7
+ /** Azure Blob container name */
8
+ container: string;
9
+ /** Storage account name (required unless using connectionString) */
10
+ accountName?: string;
11
+ /** Storage account key */
12
+ accountKey?: string;
13
+ /** SAS token for authentication */
14
+ sasToken?: string;
15
+ /** Full connection string (takes priority over accountName/accountKey) */
16
+ connectionString?: string;
17
+ /**
18
+ * Use DefaultAzureCredential from @azure/identity for authentication.
19
+ * Requires @azure/identity to be installed as a peer dependency.
20
+ */
21
+ useDefaultCredential?: boolean;
22
+ /** Custom endpoint URL (e.g. for the Azurite emulator) */
23
+ endpoint?: string;
24
+ /**
25
+ * Key prefix for all blob objects.
26
+ * Defaults to 'mastra_skill_blobs/'.
27
+ */
28
+ prefix?: string;
29
+ }
30
+ /**
31
+ * Azure Blob Storage-backed content-addressable blob store for skill versioning.
32
+ *
33
+ * Each blob is stored as a block blob keyed by its SHA-256 hash. Metadata
34
+ * (size, mimeType, createdAt) is stored as Azure blob metadata.
35
+ *
36
+ * Since blobs are content-addressable, writes are idempotent — the same hash
37
+ * always maps to the same content, so overwrites are safe and equivalent to
38
+ * a no-op.
39
+ *
40
+ * @example Connection string
41
+ * ```typescript
42
+ * import { AzureBlobStore } from '@mastra/azure/blob';
43
+ *
44
+ * const blobs = new AzureBlobStore({
45
+ * container: 'my-skill-blobs',
46
+ * connectionString: process.env.AZURE_STORAGE_CONNECTION_STRING!,
47
+ * });
48
+ * ```
49
+ *
50
+ * @example Account key
51
+ * ```typescript
52
+ * import { AzureBlobStore } from '@mastra/azure/blob';
53
+ *
54
+ * const blobs = new AzureBlobStore({
55
+ * container: 'my-skill-blobs',
56
+ * accountName: process.env.AZURE_STORAGE_ACCOUNT_NAME!,
57
+ * accountKey: process.env.AZURE_STORAGE_ACCOUNT_KEY!,
58
+ * });
59
+ * ```
60
+ */
61
+ export declare class AzureBlobStore extends BlobStore {
62
+ private readonly containerName;
63
+ private readonly accountName?;
64
+ private readonly accountKey?;
65
+ private readonly sasToken?;
66
+ private readonly connectionString?;
67
+ private readonly useDefaultCredential;
68
+ private readonly endpoint?;
69
+ private readonly prefix;
70
+ private _containerClient;
71
+ constructor(options: AzureBlobStoreOptions);
72
+ private getContainerClient;
73
+ private toKey;
74
+ init(): Promise<void>;
75
+ put(entry: StorageBlobEntry): Promise<void>;
76
+ get(hash: string): Promise<StorageBlobEntry | null>;
77
+ has(hash: string): Promise<boolean>;
78
+ delete(hash: string): Promise<boolean>;
79
+ putMany(entries: StorageBlobEntry[]): Promise<void>;
80
+ getMany(hashes: string[]): Promise<Map<string, StorageBlobEntry>>;
81
+ dangerouslyClearAll(): Promise<void>;
82
+ private deleteBlobBatch;
83
+ }
84
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/blob/blob-store/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAE7D;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,gCAAgC;IAChC,SAAS,EAAE,MAAM,CAAC;IAClB,oEAAoE;IACpE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,0BAA0B;IAC1B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,mCAAmC;IACnC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,0EAA0E;IAC1E,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B;;;OAGG;IACH,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,0DAA0D;IAC1D,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAmBD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,qBAAa,cAAe,SAAQ,SAAS;IAC3C,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAS;IACvC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAS;IACtC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAS;IACrC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAS;IACnC,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAC,CAAS;IAC3C,OAAO,CAAC,QAAQ,CAAC,oBAAoB,CAAU;IAC/C,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAS;IACnC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAS;IAEhC,OAAO,CAAC,gBAAgB,CAAgC;gBAE5C,OAAO,EAAE,qBAAqB;YAY5B,kBAAkB;IA8ChC,OAAO,CAAC,KAAK;IAIP,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAIrB,GAAG,CAAC,KAAK,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC;IAkB3C,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC;IAuBnD,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAanC,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAOtC,OAAO,CAAC,OAAO,EAAE,gBAAgB,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAOnD,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;IAajE,mBAAmB,IAAI,OAAO,CAAC,IAAI,CAAC;YAiB5B,eAAe;CAI9B"}
@@ -1,16 +1,24 @@
1
1
  'use strict';
2
2
 
3
- var chunkLLH5EI3J_cjs = require('../chunk-LLH5EI3J.cjs');
3
+ var chunkJLBSGA65_cjs = require('../chunk-JLBSGA65.cjs');
4
4
 
5
5
 
6
6
 
7
7
  Object.defineProperty(exports, "AzureBlobFilesystem", {
8
8
  enumerable: true,
9
- get: function () { return chunkLLH5EI3J_cjs.AzureBlobFilesystem; }
9
+ get: function () { return chunkJLBSGA65_cjs.AzureBlobFilesystem; }
10
+ });
11
+ Object.defineProperty(exports, "AzureBlobStore", {
12
+ enumerable: true,
13
+ get: function () { return chunkJLBSGA65_cjs.AzureBlobStore; }
10
14
  });
11
15
  Object.defineProperty(exports, "azureBlobFilesystemProvider", {
12
16
  enumerable: true,
13
- get: function () { return chunkLLH5EI3J_cjs.azureBlobFilesystemProvider; }
17
+ get: function () { return chunkJLBSGA65_cjs.azureBlobFilesystemProvider; }
18
+ });
19
+ Object.defineProperty(exports, "azureBlobStoreProvider", {
20
+ enumerable: true,
21
+ get: function () { return chunkJLBSGA65_cjs.azureBlobStoreProvider; }
14
22
  });
15
23
  //# sourceMappingURL=index.cjs.map
16
24
  //# sourceMappingURL=index.cjs.map
@@ -1,8 +1,9 @@
1
1
  /**
2
- * @mastra/azure/blob - Azure Blob Storage Filesystem Provider
2
+ * @mastra/azure/blob - Azure Blob Storage Filesystem & Blob Store Provider
3
3
  *
4
- * A filesystem implementation backed by Azure Blob Storage.
4
+ * A filesystem and content-addressable blob store backed by Azure Blob Storage.
5
5
  */
6
6
  export { AzureBlobFilesystem, type AzureBlobFilesystemOptions, type AzureBlobMountConfig } from './filesystem/index.js';
7
- export { azureBlobFilesystemProvider } from './provider.js';
7
+ export { AzureBlobStore, type AzureBlobStoreOptions } from './blob-store/index.js';
8
+ export { azureBlobFilesystemProvider, azureBlobStoreProvider } from './provider.js';
8
9
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/blob/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,mBAAmB,EAAE,KAAK,0BAA0B,EAAE,KAAK,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAC/G,OAAO,EAAE,2BAA2B,EAAE,MAAM,YAAY,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/blob/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,mBAAmB,EAAE,KAAK,0BAA0B,EAAE,KAAK,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAC/G,OAAO,EAAE,cAAc,EAAE,KAAK,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAC1E,OAAO,EAAE,2BAA2B,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC"}
@@ -1,3 +1,3 @@
1
- export { AzureBlobFilesystem, azureBlobFilesystemProvider } from '../chunk-VFZDLQDB.js';
1
+ export { AzureBlobFilesystem, AzureBlobStore, azureBlobFilesystemProvider, azureBlobStoreProvider } from '../chunk-DBBJ2YM7.js';
2
2
  //# sourceMappingURL=index.js.map
3
3
  //# sourceMappingURL=index.js.map
@@ -1,4 +1,6 @@
1
- import type { FilesystemProvider } from '@mastra/core/editor';
1
+ import type { BlobStoreProvider, FilesystemProvider } from '@mastra/core/editor';
2
+ import type { AzureBlobStoreOptions } from './blob-store/index.js';
2
3
  import type { AzureBlobFilesystemOptions } from './filesystem/index.js';
3
4
  export declare const azureBlobFilesystemProvider: FilesystemProvider<AzureBlobFilesystemOptions>;
5
+ export declare const azureBlobStoreProvider: BlobStoreProvider<AzureBlobStoreOptions>;
4
6
  //# sourceMappingURL=provider.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../../src/blob/provider.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAE9D,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,cAAc,CAAC;AAE/D,eAAO,MAAM,2BAA2B,EAAE,kBAAkB,CAAC,0BAA0B,CAwBtF,CAAC"}
1
+ {"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../../src/blob/provider.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAEjF,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAE1D,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,cAAc,CAAC;AAE/D,eAAO,MAAM,2BAA2B,EAAE,kBAAkB,CAAC,0BAA0B,CAwBtF,CAAC;AAEF,eAAO,MAAM,sBAAsB,EAAE,iBAAiB,CAAC,qBAAqB,CAuB3E,CAAC"}
@@ -1,5 +1,6 @@
1
1
  import { BlobServiceClient, StorageSharedKeyCredential, BlobSASPermissions } from '@azure/storage-blob';
2
2
  import { MastraFilesystem, PermissionError, FileNotFoundError, FileExistsError } from '@mastra/core/workspace';
3
+ import { BlobStore } from '@mastra/core/storage';
3
4
 
4
5
  // src/blob/filesystem/index.ts
5
6
  var MIME_TYPES = {
@@ -537,6 +538,167 @@ var AzureBlobFilesystem = class extends MastraFilesystem {
537
538
  this._containerClient = null;
538
539
  }
539
540
  };
541
+ function trimSlashes2(s) {
542
+ let start = 0;
543
+ let end = s.length;
544
+ while (start < end && s[start] === "/") start++;
545
+ while (end > start && s[end - 1] === "/") end--;
546
+ return s.slice(start, end);
547
+ }
548
+ function isNotFoundError2(error) {
549
+ if (!error || typeof error !== "object") return false;
550
+ return error.statusCode === 404;
551
+ }
552
+ var BATCH_DELETE_SIZE = 256;
553
+ var AzureBlobStore = class extends BlobStore {
554
+ containerName;
555
+ accountName;
556
+ accountKey;
557
+ sasToken;
558
+ connectionString;
559
+ useDefaultCredential;
560
+ endpoint;
561
+ prefix;
562
+ _containerClient = null;
563
+ constructor(options) {
564
+ super();
565
+ this.containerName = options.container;
566
+ this.accountName = options.accountName;
567
+ this.accountKey = options.accountKey;
568
+ this.sasToken = options.sasToken;
569
+ this.connectionString = options.connectionString;
570
+ this.useDefaultCredential = options.useDefaultCredential ?? false;
571
+ this.endpoint = options.endpoint;
572
+ this.prefix = options.prefix ? trimSlashes2(options.prefix) + "/" : "mastra_skill_blobs/";
573
+ }
574
+ async getContainerClient() {
575
+ if (this._containerClient) return this._containerClient;
576
+ let serviceClient;
577
+ if (this.connectionString) {
578
+ serviceClient = BlobServiceClient.fromConnectionString(this.connectionString);
579
+ } else {
580
+ if (!this.endpoint && !this.accountName) {
581
+ throw new Error(
582
+ "Azure Blob Storage requires either a connectionString, or an accountName/endpoint. Provide at least one of: connectionString, accountName, or endpoint."
583
+ );
584
+ }
585
+ const baseUrl = this.endpoint ?? `https://${this.accountName}.blob.core.windows.net`;
586
+ if (this.accountName && this.accountKey) {
587
+ const credential = new StorageSharedKeyCredential(this.accountName, this.accountKey);
588
+ serviceClient = new BlobServiceClient(baseUrl, credential);
589
+ } else if (this.sasToken) {
590
+ const sas = this.sasToken.replace(/^\?+/, "");
591
+ const separator = baseUrl.includes("?") ? "&" : "?";
592
+ serviceClient = new BlobServiceClient(`${baseUrl}${separator}${sas}`);
593
+ } else if (this.useDefaultCredential) {
594
+ try {
595
+ const identity = await import('@azure/identity');
596
+ const credential = new identity.DefaultAzureCredential();
597
+ serviceClient = new BlobServiceClient(baseUrl, credential);
598
+ } catch {
599
+ throw new Error(
600
+ "DefaultAzureCredential requires @azure/identity to be installed. Install it with: npm install @azure/identity"
601
+ );
602
+ }
603
+ } else {
604
+ serviceClient = new BlobServiceClient(baseUrl);
605
+ }
606
+ }
607
+ this._containerClient = serviceClient.getContainerClient(this.containerName);
608
+ return this._containerClient;
609
+ }
610
+ toKey(hash) {
611
+ return this.prefix + hash;
612
+ }
613
+ async init() {
614
+ }
615
+ async put(entry) {
616
+ const containerClient = await this.getContainerClient();
617
+ const blobClient = containerClient.getBlockBlobClient(this.toKey(entry.hash));
618
+ const now = entry.createdAt ?? /* @__PURE__ */ new Date();
619
+ const buffer = Buffer.from(entry.content, "utf-8");
620
+ await blobClient.uploadData(buffer, {
621
+ blobHTTPHeaders: {
622
+ blobContentType: entry.mimeType ?? "application/octet-stream"
623
+ },
624
+ metadata: {
625
+ size: String(entry.size),
626
+ createdat: now.toISOString(),
627
+ ...entry.mimeType ? { mimetype: entry.mimeType } : {}
628
+ }
629
+ });
630
+ }
631
+ async get(hash) {
632
+ const containerClient = await this.getContainerClient();
633
+ const blobClient = containerClient.getBlockBlobClient(this.toKey(hash));
634
+ try {
635
+ const buffer = await blobClient.downloadToBuffer();
636
+ const properties = await blobClient.getProperties();
637
+ const metadata = properties.metadata ?? {};
638
+ const content = buffer.toString("utf-8");
639
+ return {
640
+ hash,
641
+ content,
642
+ size: metadata.size != null ? Number(metadata.size) : Buffer.byteLength(content, "utf-8"),
643
+ mimeType: metadata.mimetype || properties.contentType || void 0,
644
+ createdAt: metadata.createdat ? new Date(metadata.createdat) : /* @__PURE__ */ new Date()
645
+ };
646
+ } catch (error) {
647
+ if (isNotFoundError2(error)) return null;
648
+ throw error;
649
+ }
650
+ }
651
+ async has(hash) {
652
+ const containerClient = await this.getContainerClient();
653
+ const blobClient = containerClient.getBlockBlobClient(this.toKey(hash));
654
+ try {
655
+ await blobClient.getProperties();
656
+ return true;
657
+ } catch (error) {
658
+ if (isNotFoundError2(error)) return false;
659
+ throw error;
660
+ }
661
+ }
662
+ async delete(hash) {
663
+ const containerClient = await this.getContainerClient();
664
+ const blobClient = containerClient.getBlockBlobClient(this.toKey(hash));
665
+ const response = await blobClient.deleteIfExists();
666
+ return response.succeeded;
667
+ }
668
+ async putMany(entries) {
669
+ if (entries.length === 0) return;
670
+ await Promise.all(entries.map((entry) => this.put(entry)));
671
+ }
672
+ async getMany(hashes) {
673
+ const result = /* @__PURE__ */ new Map();
674
+ if (hashes.length === 0) return result;
675
+ const entries = await Promise.all(hashes.map((hash) => this.get(hash)));
676
+ for (const entry of entries) {
677
+ if (entry) {
678
+ result.set(entry.hash, entry);
679
+ }
680
+ }
681
+ return result;
682
+ }
683
+ async dangerouslyClearAll() {
684
+ const containerClient = await this.getContainerClient();
685
+ let batch = [];
686
+ for await (const blob of containerClient.listBlobsFlat({ prefix: this.prefix })) {
687
+ batch.push(blob.name);
688
+ if (batch.length >= BATCH_DELETE_SIZE) {
689
+ await this.deleteBlobBatch(containerClient, batch);
690
+ batch = [];
691
+ }
692
+ }
693
+ if (batch.length > 0) {
694
+ await this.deleteBlobBatch(containerClient, batch);
695
+ }
696
+ }
697
+ async deleteBlobBatch(containerClient, blobNames) {
698
+ const blobClients = blobNames.map((name) => containerClient.getBlobClient(name));
699
+ await containerClient.getBlobBatchClient().deleteBlobs(blobClients);
700
+ }
701
+ };
540
702
 
541
703
  // src/blob/provider.ts
542
704
  var azureBlobFilesystemProvider = {
@@ -564,7 +726,31 @@ var azureBlobFilesystemProvider = {
564
726
  },
565
727
  createFilesystem: (config) => new AzureBlobFilesystem(config)
566
728
  };
729
+ var azureBlobStoreProvider = {
730
+ id: "azure-blob",
731
+ name: "Azure Blob Store",
732
+ description: "Content-addressable blob storage backed by Azure Blob Storage",
733
+ configSchema: {
734
+ type: "object",
735
+ required: ["container"],
736
+ properties: {
737
+ container: { type: "string", description: "Azure Blob container name" },
738
+ accountName: { type: "string", description: "Storage account name" },
739
+ accountKey: { type: "string", description: "Storage account key" },
740
+ sasToken: { type: "string", description: "Shared Access Signature token" },
741
+ connectionString: { type: "string", description: "Full connection string (overrides other auth options)" },
742
+ useDefaultCredential: {
743
+ type: "boolean",
744
+ description: "Use DefaultAzureCredential (requires @azure/identity)",
745
+ default: false
746
+ },
747
+ prefix: { type: "string", description: "Key prefix for blob objects (default: mastra_skill_blobs/)" },
748
+ endpoint: { type: "string", description: "Custom endpoint URL (for Azurite emulator)" }
749
+ }
750
+ },
751
+ createBlobStore: (config) => new AzureBlobStore(config)
752
+ };
567
753
 
568
- export { AzureBlobFilesystem, azureBlobFilesystemProvider };
569
- //# sourceMappingURL=chunk-VFZDLQDB.js.map
570
- //# sourceMappingURL=chunk-VFZDLQDB.js.map
754
+ export { AzureBlobFilesystem, AzureBlobStore, azureBlobFilesystemProvider, azureBlobStoreProvider };
755
+ //# sourceMappingURL=chunk-DBBJ2YM7.js.map
756
+ //# sourceMappingURL=chunk-DBBJ2YM7.js.map