@agenticprimitives/content-storage 0.1.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/CLAUDE.md +55 -0
- package/LICENSE +21 -0
- package/README.md +69 -0
- package/dist/access.d.ts +64 -0
- package/dist/access.d.ts.map +1 -0
- package/dist/access.js +30 -0
- package/dist/access.js.map +1 -0
- package/dist/anchors.d.ts +31 -0
- package/dist/anchors.d.ts.map +1 -0
- package/dist/anchors.js +12 -0
- package/dist/anchors.js.map +1 -0
- package/dist/bundle.d.ts +39 -0
- package/dist/bundle.d.ts.map +1 -0
- package/dist/bundle.js +57 -0
- package/dist/bundle.js.map +1 -0
- package/dist/canonicalization.d.ts +5 -0
- package/dist/canonicalization.d.ts.map +1 -0
- package/dist/canonicalization.js +11 -0
- package/dist/canonicalization.js.map +1 -0
- package/dist/containment.d.ts +40 -0
- package/dist/containment.d.ts.map +1 -0
- package/dist/containment.js +53 -0
- package/dist/containment.js.map +1 -0
- package/dist/context.d.ts +28 -0
- package/dist/context.d.ts.map +1 -0
- package/dist/context.js +27 -0
- package/dist/context.js.map +1 -0
- package/dist/index.d.ts +33 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +51 -0
- package/dist/index.js.map +1 -0
- package/dist/manifest.d.ts +38 -0
- package/dist/manifest.d.ts.map +1 -0
- package/dist/manifest.js +70 -0
- package/dist/manifest.js.map +1 -0
- package/dist/publish.d.ts +62 -0
- package/dist/publish.d.ts.map +1 -0
- package/dist/publish.js +81 -0
- package/dist/publish.js.map +1 -0
- package/dist/receipts.d.ts +21 -0
- package/dist/receipts.d.ts.map +1 -0
- package/dist/receipts.js +13 -0
- package/dist/receipts.js.map +1 -0
- package/dist/relations.d.ts +23 -0
- package/dist/relations.d.ts.map +1 -0
- package/dist/relations.js +19 -0
- package/dist/relations.js.map +1 -0
- package/dist/release.d.ts +56 -0
- package/dist/release.d.ts.map +1 -0
- package/dist/release.js +30 -0
- package/dist/release.js.map +1 -0
- package/dist/resolver.d.ts +42 -0
- package/dist/resolver.d.ts.map +1 -0
- package/dist/resolver.js +58 -0
- package/dist/resolver.js.map +1 -0
- package/dist/storage-port.d.ts +81 -0
- package/dist/storage-port.d.ts.map +1 -0
- package/dist/storage-port.js +2 -0
- package/dist/storage-port.js.map +1 -0
- package/dist/types.d.ts +121 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/dist/versioning.d.ts +22 -0
- package/dist/versioning.d.ts.map +1 -0
- package/dist/versioning.js +13 -0
- package/dist/versioning.js.map +1 -0
- package/dist/wire.d.ts +88 -0
- package/dist/wire.d.ts.map +1 -0
- package/dist/wire.js +81 -0
- package/dist/wire.js.map +1 -0
- package/package.json +57 -0
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { BlobRef } from './types.js';
|
|
2
|
+
export type ArtifactSource = 'blob' | 'graphdb' | 'vault' | 'external';
|
|
3
|
+
/** A parsed `retrievalPointer` = `<scheme>:<locator>`. */
|
|
4
|
+
export interface ResolvedPointer {
|
|
5
|
+
source: ArtifactSource;
|
|
6
|
+
scheme: string;
|
|
7
|
+
/** Everything after the first `:` — scheme-specific (e.g. `sha256:…`, `faith/ontology`, `0x…/record`). */
|
|
8
|
+
locator: string;
|
|
9
|
+
pointer: string;
|
|
10
|
+
}
|
|
11
|
+
/** Parse a `retrievalPointer` into its source + locator. Fail-closed: an unknown scheme throws. */
|
|
12
|
+
export declare function parseRetrievalPointer(pointer: string): ResolvedPointer;
|
|
13
|
+
/** Convenience: which source a pointer names, without throwing on the locator shape. */
|
|
14
|
+
export declare function artifactSourceOf(pointer: string): ArtifactSource;
|
|
15
|
+
/** Mint a `blob:` pointer for a ciphertext hash (the only scheme this package OWNS; others are
|
|
16
|
+
* minted by their source — GraphDB/vault). */
|
|
17
|
+
export declare function blobPointer(ciphertextSha256Hex: string): BlobRef;
|
|
18
|
+
/**
|
|
19
|
+
* A source-specific resolver: fetches an artifact's bytes for pointers of its `source`. App-injected
|
|
20
|
+
* per source (ADR-0037) — a `blob` resolver wraps this package's `StoragePort`; a `graphdb` resolver
|
|
21
|
+
* serializes a named graph to Turtle; a `vault` resolver reads a JSON-LD record. The entitlement gate
|
|
22
|
+
* (access.ts / spec 335 §7) runs BEFORE `resolve`, uniformly, regardless of source.
|
|
23
|
+
*/
|
|
24
|
+
export interface ArtifactResolver {
|
|
25
|
+
readonly source: ArtifactSource;
|
|
26
|
+
resolve(pointer: ResolvedPointer): Promise<ReadableStream>;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Routes a pointer to the resolver registered for its source. This is the uniform read seam the
|
|
30
|
+
* delivery plane (spec 335 §12) calls after the origin authorizes — the caller never needs to know
|
|
31
|
+
* whether the `.ttl` came from GraphDB or the blob store.
|
|
32
|
+
*/
|
|
33
|
+
export declare class ArtifactResolverRegistry {
|
|
34
|
+
private readonly bySource;
|
|
35
|
+
constructor(resolvers?: ArtifactResolver[]);
|
|
36
|
+
register(resolver: ArtifactResolver): void;
|
|
37
|
+
resolverFor(source: ArtifactSource): ArtifactResolver;
|
|
38
|
+
/** Resolve an artifact's bytes by its `retrievalPointer`, routing to the right source. Async so a
|
|
39
|
+
* bad pointer / missing resolver surfaces as a rejected promise, not a synchronous throw. */
|
|
40
|
+
resolve(pointer: string): Promise<ReadableStream>;
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=resolver.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolver.d.ts","sourceRoot":"","sources":["../src/resolver.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAY1C,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,SAAS,GAAG,OAAO,GAAG,UAAU,CAAC;AAavE,0DAA0D;AAC1D,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,cAAc,CAAC;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,0GAA0G;IAC1G,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,mGAAmG;AACnG,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,MAAM,GAAG,eAAe,CAOtE;AAED,wFAAwF;AACxF,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,cAAc,CAEhE;AAED;+CAC+C;AAC/C,wBAAgB,WAAW,CAAC,mBAAmB,EAAE,MAAM,GAAG,OAAO,CAEhE;AAED;;;;;GAKG;AACH,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,MAAM,EAAE,cAAc,CAAC;IAChC,OAAO,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;CAC5D;AAED;;;;GAIG;AACH,qBAAa,wBAAwB;IACnC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAA+C;gBAC5D,SAAS,GAAE,gBAAgB,EAAO;IAG9C,QAAQ,CAAC,QAAQ,EAAE,gBAAgB,GAAG,IAAI;IAG1C,WAAW,CAAC,MAAM,EAAE,cAAc,GAAG,gBAAgB;IAKrD;kGAC8F;IACxF,OAAO,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC;CAIxD"}
|
package/dist/resolver.js
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
const SCHEME_SOURCE = {
|
|
2
|
+
blob: 'blob',
|
|
3
|
+
graphdb: 'graphdb',
|
|
4
|
+
vault: 'vault',
|
|
5
|
+
content: 'external',
|
|
6
|
+
https: 'external',
|
|
7
|
+
http: 'external',
|
|
8
|
+
ipfs: 'external',
|
|
9
|
+
ar: 'external',
|
|
10
|
+
};
|
|
11
|
+
/** Parse a `retrievalPointer` into its source + locator. Fail-closed: an unknown scheme throws. */
|
|
12
|
+
export function parseRetrievalPointer(pointer) {
|
|
13
|
+
const i = pointer.indexOf(':');
|
|
14
|
+
if (i <= 0)
|
|
15
|
+
throw new Error(`invalid retrievalPointer (no scheme): ${pointer}`);
|
|
16
|
+
const scheme = pointer.slice(0, i).toLowerCase();
|
|
17
|
+
const source = SCHEME_SOURCE[scheme];
|
|
18
|
+
if (!source)
|
|
19
|
+
throw new Error(`unknown artifact source scheme: ${scheme}`);
|
|
20
|
+
return { source, scheme, locator: pointer.slice(i + 1), pointer };
|
|
21
|
+
}
|
|
22
|
+
/** Convenience: which source a pointer names, without throwing on the locator shape. */
|
|
23
|
+
export function artifactSourceOf(pointer) {
|
|
24
|
+
return parseRetrievalPointer(pointer).source;
|
|
25
|
+
}
|
|
26
|
+
/** Mint a `blob:` pointer for a ciphertext hash (the only scheme this package OWNS; others are
|
|
27
|
+
* minted by their source — GraphDB/vault). */
|
|
28
|
+
export function blobPointer(ciphertextSha256Hex) {
|
|
29
|
+
return `blob:sha256:${ciphertextSha256Hex}`;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Routes a pointer to the resolver registered for its source. This is the uniform read seam the
|
|
33
|
+
* delivery plane (spec 335 §12) calls after the origin authorizes — the caller never needs to know
|
|
34
|
+
* whether the `.ttl` came from GraphDB or the blob store.
|
|
35
|
+
*/
|
|
36
|
+
export class ArtifactResolverRegistry {
|
|
37
|
+
bySource = new Map();
|
|
38
|
+
constructor(resolvers = []) {
|
|
39
|
+
for (const r of resolvers)
|
|
40
|
+
this.register(r);
|
|
41
|
+
}
|
|
42
|
+
register(resolver) {
|
|
43
|
+
this.bySource.set(resolver.source, resolver);
|
|
44
|
+
}
|
|
45
|
+
resolverFor(source) {
|
|
46
|
+
const r = this.bySource.get(source);
|
|
47
|
+
if (!r)
|
|
48
|
+
throw new Error(`no artifact resolver registered for source "${source}"`);
|
|
49
|
+
return r;
|
|
50
|
+
}
|
|
51
|
+
/** Resolve an artifact's bytes by its `retrievalPointer`, routing to the right source. Async so a
|
|
52
|
+
* bad pointer / missing resolver surfaces as a rejected promise, not a synchronous throw. */
|
|
53
|
+
async resolve(pointer) {
|
|
54
|
+
const parsed = parseRetrievalPointer(pointer);
|
|
55
|
+
return this.resolverFor(parsed.source).resolve(parsed);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=resolver.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolver.js","sourceRoot":"","sources":["../src/resolver.ts"],"names":[],"mappings":"AAcA,MAAM,aAAa,GAAmC;IACpD,IAAI,EAAE,MAAM;IACZ,OAAO,EAAE,SAAS;IAClB,KAAK,EAAE,OAAO;IACd,OAAO,EAAE,UAAU;IACnB,KAAK,EAAE,UAAU;IACjB,IAAI,EAAE,UAAU;IAChB,IAAI,EAAE,UAAU;IAChB,EAAE,EAAE,UAAU;CACf,CAAC;AAWF,mGAAmG;AACnG,MAAM,UAAU,qBAAqB,CAAC,OAAe;IACnD,MAAM,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IAC/B,IAAI,CAAC,IAAI,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,yCAAyC,OAAO,EAAE,CAAC,CAAC;IAChF,MAAM,MAAM,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;IACjD,MAAM,MAAM,GAAG,aAAa,CAAC,MAAM,CAAC,CAAC;IACrC,IAAI,CAAC,MAAM;QAAE,MAAM,IAAI,KAAK,CAAC,mCAAmC,MAAM,EAAE,CAAC,CAAC;IAC1E,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC;AACpE,CAAC;AAED,wFAAwF;AACxF,MAAM,UAAU,gBAAgB,CAAC,OAAe;IAC9C,OAAO,qBAAqB,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC;AAC/C,CAAC;AAED;+CAC+C;AAC/C,MAAM,UAAU,WAAW,CAAC,mBAA2B;IACrD,OAAO,eAAe,mBAAmB,EAAE,CAAC;AAC9C,CAAC;AAaD;;;;GAIG;AACH,MAAM,OAAO,wBAAwB;IAClB,QAAQ,GAAG,IAAI,GAAG,EAAoC,CAAC;IACxE,YAAY,YAAgC,EAAE;QAC5C,KAAK,MAAM,CAAC,IAAI,SAAS;YAAE,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;IAC9C,CAAC;IACD,QAAQ,CAAC,QAA0B;QACjC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IAC/C,CAAC;IACD,WAAW,CAAC,MAAsB;QAChC,MAAM,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QACpC,IAAI,CAAC,CAAC;YAAE,MAAM,IAAI,KAAK,CAAC,+CAA+C,MAAM,GAAG,CAAC,CAAC;QAClF,OAAO,CAAC,CAAC;IACX,CAAC;IACD;kGAC8F;IAC9F,KAAK,CAAC,OAAO,CAAC,OAAe;QAC3B,MAAM,MAAM,GAAG,qBAAqB,CAAC,OAAO,CAAC,CAAC;QAC9C,OAAO,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IACzD,CAAC;CACF"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import type { BlobRef, ContentArtifact } from './types.js';
|
|
2
|
+
/** Options for storing bytes. */
|
|
3
|
+
export interface PutOpts {
|
|
4
|
+
/** Media type of the plaintext (`text/markdown`, `text/turtle`, `image/png`, …). */
|
|
5
|
+
mimeType: string;
|
|
6
|
+
/** Envelope-encrypt before upload (default true → the provider only ever holds ciphertext). */
|
|
7
|
+
encrypt?: boolean;
|
|
8
|
+
/** KMS key id (KEK) to wrap the per-object DEK with; required when `encrypt` is true. */
|
|
9
|
+
kekId?: string;
|
|
10
|
+
/** Opaque, non-sensitive metadata tags stored alongside the blob. */
|
|
11
|
+
metadata?: Record<string, string>;
|
|
12
|
+
}
|
|
13
|
+
/** Metadata about a stored blob (no bytes). */
|
|
14
|
+
export interface BlobStat {
|
|
15
|
+
ref: BlobRef;
|
|
16
|
+
/** `sha256(ciphertext)` — the storage integrity key the ref addresses. */
|
|
17
|
+
contentHash: string;
|
|
18
|
+
size: number;
|
|
19
|
+
mimeType: string;
|
|
20
|
+
provider: string;
|
|
21
|
+
encrypted: boolean;
|
|
22
|
+
createdAt: string;
|
|
23
|
+
}
|
|
24
|
+
/** A presigned direct-to-storage upload target (spec 335 §9). */
|
|
25
|
+
export interface PresignedUpload {
|
|
26
|
+
url: string;
|
|
27
|
+
ref: BlobRef;
|
|
28
|
+
/** Headers the client MUST send with the PUT (e.g. content-type, sse params). */
|
|
29
|
+
headers?: Record<string, string>;
|
|
30
|
+
expiresAt: string;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* The LOW-LEVEL provider port — the one truly provider-specific seam, app-injected (ADR-0037).
|
|
34
|
+
* Build to the S3 API so a single adapter covers S3 / R2 / GCS-interop / B2 / Tigris / Wasabi /
|
|
35
|
+
* MinIO; a separate adapter covers CAS (IPFS/Arweave). It moves *opaque bytes* only: it never
|
|
36
|
+
* encrypts, decrypts, or evaluates authority. Objects are addressed by `sha256(ciphertext)`.
|
|
37
|
+
*/
|
|
38
|
+
export interface StorageProvider {
|
|
39
|
+
/** Opaque platform tag the manifest routes on (`r2` | `s3` | `gcs` | `b2` | `ipfs` | …). */
|
|
40
|
+
readonly platform: string;
|
|
41
|
+
putBlob(key: string, bytes: Uint8Array, opts?: {
|
|
42
|
+
mimeType?: string;
|
|
43
|
+
metadata?: Record<string, string>;
|
|
44
|
+
}): Promise<void>;
|
|
45
|
+
getBlob(key: string): Promise<ReadableStream>;
|
|
46
|
+
headBlob(key: string): Promise<{
|
|
47
|
+
size: number;
|
|
48
|
+
mimeType?: string;
|
|
49
|
+
} | null>;
|
|
50
|
+
deleteBlob(key: string): Promise<void>;
|
|
51
|
+
presignGetUrl(key: string, ttlSeconds: number): Promise<string>;
|
|
52
|
+
presignPutUrl(key: string, ttlSeconds: number, opts?: {
|
|
53
|
+
mimeType?: string;
|
|
54
|
+
}): Promise<PresignedUpload>;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* The HIGH-LEVEL, envelope-aware port apps use (spec 335 §5). It composes:
|
|
58
|
+
* `content-primitives` commitment + `vault` seal/open (KMS `DekWrapper`) + `StorageProvider` bytes.
|
|
59
|
+
* Encryption is handled AT THE PORT BOUNDARY — callers pass/receive plaintext; the provider never
|
|
60
|
+
* sees it. Refs are opaque + content-addressed (`blob:sha256:<hex-of-ciphertext>`).
|
|
61
|
+
*/
|
|
62
|
+
export interface StoragePort {
|
|
63
|
+
/** Envelope-encrypt (unless `opts.encrypt === false`), content-address, upload ciphertext,
|
|
64
|
+
* persist the descriptor; returns the CAS ref + the stored artifact record. */
|
|
65
|
+
put(bytes: Uint8Array, opts: PutOpts): Promise<{
|
|
66
|
+
ref: BlobRef;
|
|
67
|
+
artifact: ContentArtifact;
|
|
68
|
+
}>;
|
|
69
|
+
/** Fetch ciphertext, unwrap the DEK via KMS, decrypt, verify hash + GCM tag. Entitlement-gated
|
|
70
|
+
* by the caller (spec 335 §7) BEFORE this runs. */
|
|
71
|
+
get(ref: BlobRef): Promise<ReadableStream>;
|
|
72
|
+
/** Short-TTL signed URL to the *stored bytes* (ciphertext). Decryption stays client-side. */
|
|
73
|
+
presignGet(ref: BlobRef, ttlSeconds: number): Promise<string>;
|
|
74
|
+
/** Signed URL for a direct client → store upload (bytes bypass the app tier). */
|
|
75
|
+
presignPut(opts: PutOpts, ttlSeconds: number): Promise<PresignedUpload>;
|
|
76
|
+
/** Tombstone the descriptor; an orphan-GC sweep reclaims unreferenced blobs. */
|
|
77
|
+
delete(ref: BlobRef): Promise<void>;
|
|
78
|
+
/** Metadata only, no bytes. */
|
|
79
|
+
stat(ref: BlobRef): Promise<BlobStat>;
|
|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AAC,IAAI,CAAC,CAAC;IACpC,+BAA+B;IAC/B,IAAI,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;CACvC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"storage-port.js","sourceRoot":"","sources":["../src/storage-port.ts"],"names":[],"mappings":""}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import type { Address, Hex } from '@agenticprimitives/types';
|
|
2
|
+
/** Opaque, content-addressed store reference: `blob:sha256:<hex-of-CIPHERTEXT>` (spec 335 §6.3).
|
|
3
|
+
* Never hand-built — minted by the `StoragePort` and resolved back through it. */
|
|
4
|
+
export type BlobRef = string;
|
|
5
|
+
/** Access posture of the underlying artifact — a policy input, never a legal grant
|
|
6
|
+
* (mirrors content-primitives `AccessPolicy`). `public` needs no grant; the rest are gated. */
|
|
7
|
+
export type ArtifactAccessPolicy = 'public' | 'licensed' | 'private';
|
|
8
|
+
/** SHA-256 commitment to the canonicalized plaintext — the content-primitives `contentCommitment`
|
|
9
|
+
* value, repo-wide. Integrity + change-detection + citation. NEVER the bytes (ADR-0033 R3). */
|
|
10
|
+
export interface ArtifactCommitment {
|
|
11
|
+
algorithm: 'sha-256';
|
|
12
|
+
/** Digest of the normalized plaintext (hex). */
|
|
13
|
+
value: Hex;
|
|
14
|
+
}
|
|
15
|
+
/** Per-chunk encryption metadata for seekable encrypted media (spec 335 §9): fixed-size chunks
|
|
16
|
+
* encrypted independently (AES-CTR per segment / CENC) so a client can decrypt an arbitrary range.
|
|
17
|
+
* Absent ⇒ the whole object is a single AES-256-GCM sealing (download-then-play only). */
|
|
18
|
+
export interface MediaChunking {
|
|
19
|
+
scheme: 'aes-256-ctr-segment-v1' | 'cenc-v1';
|
|
20
|
+
chunkSize: number;
|
|
21
|
+
chunkCount: number;
|
|
22
|
+
}
|
|
23
|
+
/** The storage half of the envelope — mirrors the vault `VaultObjectEnvelopeV1.crypto` fields
|
|
24
|
+
* (`ciphertextRef`/`wrappedDekRef`/`aadHash`) plus the blob descriptors (spec 335 §4.1/§6). */
|
|
25
|
+
export interface ArtifactStorage {
|
|
26
|
+
/** Opaque platform tag the `StoragePort` routes on (`r2` | `s3` | `gcs` | `b2` | `ipfs` | …). */
|
|
27
|
+
provider: string;
|
|
28
|
+
/** Ciphertext byte length. */
|
|
29
|
+
size: number;
|
|
30
|
+
/** Media type: `text/markdown`, `text/turtle`, `application/ld+json`, `image/png`, `video/mp4`, … */
|
|
31
|
+
mimeType: string;
|
|
32
|
+
/** True ⇒ client-side envelope-encrypted (default); the store holds only ciphertext. */
|
|
33
|
+
encrypted: boolean;
|
|
34
|
+
/** Vault `crypto.wrappedDekRef` — location of the KMS-wrapped per-object DEK. */
|
|
35
|
+
wrappedDekRef?: string;
|
|
36
|
+
/** KMS key id (KEK) that wrapped the DEK. */
|
|
37
|
+
dekKid?: string;
|
|
38
|
+
/** `sha256:…` — the vault AAD binding (owner + resource + classification). */
|
|
39
|
+
aadHash?: string;
|
|
40
|
+
/** Present for seekable encrypted media (§9). */
|
|
41
|
+
chunking?: MediaChunking;
|
|
42
|
+
}
|
|
43
|
+
/** Binary/media descriptors for rendering + range planning (spec 335 §4.1). */
|
|
44
|
+
export interface ArtifactMedia {
|
|
45
|
+
width?: number;
|
|
46
|
+
height?: number;
|
|
47
|
+
durationMs?: number;
|
|
48
|
+
/** A poster/thumbnail artifact for video. */
|
|
49
|
+
poster?: BlobRef;
|
|
50
|
+
}
|
|
51
|
+
/** Structural mirror of `@agenticprimitives/content-primitives` `ContentDescriptor` — the FRBR Item.
|
|
52
|
+
* Replace with a direct import/extends when the content-primitives dependency is wired (spec 335 §12). */
|
|
53
|
+
export interface ArtifactDescriptor {
|
|
54
|
+
/** Stable, issuer-scoped descriptor id. */
|
|
55
|
+
id: string;
|
|
56
|
+
/** The scheme-independent canonical locus this describes (content-primitives `canonicalId`). */
|
|
57
|
+
canonicalId: Hex;
|
|
58
|
+
/** Opaque app content type, e.g. `skill.md`, `ontology.ttl`, `doc.md`. */
|
|
59
|
+
contentType: string;
|
|
60
|
+
/** Issuer Smart Agent address (trust roots here — ADR-0010). */
|
|
61
|
+
issuer: Address;
|
|
62
|
+
issuedAt: string;
|
|
63
|
+
status: 'active' | 'revoked' | 'superseded';
|
|
64
|
+
version?: string;
|
|
65
|
+
accessPolicy: ArtifactAccessPolicy;
|
|
66
|
+
/** Signature over the descriptor hash (issuer ERC-1271, or a delegated key). */
|
|
67
|
+
signature: Hex;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* A stored FRBR Item: a descriptor whose `retrievalPointer` resolves into the managed store,
|
|
71
|
+
* plus the storage envelope. `commitment` is REQUIRED for stored artifacts (integrity is not
|
|
72
|
+
* optional here). Nothing here holds plaintext.
|
|
73
|
+
*/
|
|
74
|
+
export interface ContentArtifact {
|
|
75
|
+
descriptor: ArtifactDescriptor;
|
|
76
|
+
/** `blob:sha256:<hex-of-ciphertext>` — resolved by the `StoragePort`. */
|
|
77
|
+
retrievalPointer: BlobRef;
|
|
78
|
+
commitment: ArtifactCommitment;
|
|
79
|
+
storage: ArtifactStorage;
|
|
80
|
+
media?: ArtifactMedia;
|
|
81
|
+
}
|
|
82
|
+
/** What a bundle IS — a skill directory (SKILL.md + its queries/code/media, à la Claude skill
|
|
83
|
+
* management) or a rich document directory (a `.md` + its images/video). Both are `at:Container`s. */
|
|
84
|
+
export type BundleKind = 'skill' | 'doc';
|
|
85
|
+
/** The ROLE a member plays inside a bundle — richer than primary-vs-attachment. Drives how a consumer
|
|
86
|
+
* (or an LLM) treats each file: the SKILL.md body, an executable SPARQL query, a code segment, a
|
|
87
|
+
* schema/ontology, structured data, or media/asset. */
|
|
88
|
+
export type BundleMemberRole = 'skill-md' | 'doc-md' | 'sparql' | 'code' | 'schema' | 'data' | 'media' | 'asset';
|
|
89
|
+
/**
|
|
90
|
+
* FRBR Manifestation — a bundle DIRECTORY bound into one versioned, signed manifest (mirrors
|
|
91
|
+
* content-primitives `CorpusManifest`): a Merkle `containmentRoot` over the member descriptor
|
|
92
|
+
* commitments. A skill isn't a single file — it's a directory of a SKILL.md plus the SPARQL queries,
|
|
93
|
+
* code segments, schemas, and media that realize it (Claude skill management models a skill this way);
|
|
94
|
+
* a rich doc is a `.md` plus its images/video. The bundle IS an `at:Container` (spec 335 §7.2): its
|
|
95
|
+
* `containmentRoot` equals `containment.containmentRoot(memberCommitments)`, and a grant on its
|
|
96
|
+
* `canonicalId` cascades to every member. Publish by advancing one immutable snapshot root (§4.2/§8).
|
|
97
|
+
*/
|
|
98
|
+
export interface ArtifactBundle {
|
|
99
|
+
/** keccak/sha over `${issuer}/${edition}/${version}` — the manifest id. */
|
|
100
|
+
bundleRef: Hex;
|
|
101
|
+
/** The bundle's canonical identity — e.g. `skillRef('skill:<ns>/<name>')` for a skill directory.
|
|
102
|
+
* This is what a grant on the whole bundle addresses (its container resource). */
|
|
103
|
+
canonicalId?: Hex;
|
|
104
|
+
/** What the bundle is — a skill directory or a rich-document directory. */
|
|
105
|
+
bundleKind?: BundleKind;
|
|
106
|
+
issuer: Address;
|
|
107
|
+
edition: string;
|
|
108
|
+
version: string;
|
|
109
|
+
/** Merkle root over the member artifact commitments — identical to `containmentRoot(members)`. */
|
|
110
|
+
containmentRoot: Hex;
|
|
111
|
+
accessPolicy: ArtifactAccessPolicy;
|
|
112
|
+
/** The primary body: the SKILL.md (skill) or the doc `.md` — role `skill-md` / `doc-md`. */
|
|
113
|
+
primary: ContentArtifact;
|
|
114
|
+
/** The supporting members: SPARQL queries, code, schemas, data, media. */
|
|
115
|
+
members: ContentArtifact[];
|
|
116
|
+
/** Logical-path → BlobRef map (e.g. `./queries/find.rq`, `./img/fig1.png`). */
|
|
117
|
+
assetMap: Record<string, BlobRef>;
|
|
118
|
+
/** Logical-path → role, so each member is typed (skill-md / sparql / code / schema / data / media). */
|
|
119
|
+
roles: Record<string, BundleMemberRole>;
|
|
120
|
+
}
|
|
121
|
+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4FAA4F;IAC5F,OAAO,EAAE,eAAe,CAAC;IACzB,0EAA0E;IAC1E,OAAO,EAAE,eAAe,EAAE,CAAC;IAC3B,+EAA+E;IAC/E,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClC,uGAAuG;IACvG,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;CACzC"}
|
package/dist/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { Address, Hex } from '@agenticprimitives/types';
|
|
2
|
+
export type VersionStatus = 'draft' | 'published' | 'superseded' | 'revoked';
|
|
3
|
+
export interface VersionManifest {
|
|
4
|
+
/** The artifact/skill's location-independent canonical identity (e.g. skillRef('skill:ns/name')). */
|
|
5
|
+
canonicalId: Hex;
|
|
6
|
+
version: string;
|
|
7
|
+
edition?: string;
|
|
8
|
+
/** The issuer SA authorizing this version (authority anchors here — ADR-0010). */
|
|
9
|
+
issuer: Address;
|
|
10
|
+
/** ISO-8601 timestamp (passed in — the pure layer holds no ambient clock). */
|
|
11
|
+
issuedAt: string;
|
|
12
|
+
status: VersionStatus;
|
|
13
|
+
/** This version's content commitment — a leaf commitment or a bundle `containmentRoot`. */
|
|
14
|
+
contentRoot: Hex;
|
|
15
|
+
/** The `versionId` of the prior version — the append-only back-link. */
|
|
16
|
+
predecessor?: Hex;
|
|
17
|
+
}
|
|
18
|
+
/** The version's stable identity — reproducible from its identity-bearing fields alone. */
|
|
19
|
+
export declare function versionId(m: VersionManifest): Hex;
|
|
20
|
+
/** Recompute + compare — the integrity check that a manifest wasn't altered under a claimed id. */
|
|
21
|
+
export declare function verifyVersionId(m: VersionManifest, id: Hex): boolean;
|
|
22
|
+
//# sourceMappingURL=versioning.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"versioning.d.ts","sourceRoot":"","sources":["../src/versioning.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,0BAA0B,CAAC;AAO7D,MAAM,MAAM,aAAa,GAAG,OAAO,GAAG,WAAW,GAAG,YAAY,GAAG,SAAS,CAAC;AAE7E,MAAM,WAAW,eAAe;IAC9B,qGAAqG;IACrG,WAAW,EAAE,GAAG,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,kFAAkF;IAClF,MAAM,EAAE,OAAO,CAAC;IAChB,8EAA8E;IAC9E,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,aAAa,CAAC;IACtB,2FAA2F;IAC3F,WAAW,EAAE,GAAG,CAAC;IACjB,wEAAwE;IACxE,WAAW,CAAC,EAAE,GAAG,CAAC;CACnB;AAMD,2FAA2F;AAC3F,wBAAgB,SAAS,CAAC,CAAC,EAAE,eAAe,GAAG,GAAG,CAEjD;AACD,mGAAmG;AACnG,wBAAgB,eAAe,CAAC,CAAC,EAAE,eAAe,EAAE,EAAE,EAAE,GAAG,GAAG,OAAO,CAEpE"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { canonicalDigest } from './canonicalization.js';
|
|
2
|
+
const idFields = (m) => ({
|
|
3
|
+
canonicalId: m.canonicalId, version: m.version, edition: m.edition ?? null, issuer: m.issuer, contentRoot: m.contentRoot,
|
|
4
|
+
});
|
|
5
|
+
/** The version's stable identity — reproducible from its identity-bearing fields alone. */
|
|
6
|
+
export function versionId(m) {
|
|
7
|
+
return canonicalDigest(idFields(m));
|
|
8
|
+
}
|
|
9
|
+
/** Recompute + compare — the integrity check that a manifest wasn't altered under a claimed id. */
|
|
10
|
+
export function verifyVersionId(m, id) {
|
|
11
|
+
return versionId(m) === id;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=versioning.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"versioning.js","sourceRoot":"","sources":["../src/versioning.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAwBxD,MAAM,QAAQ,GAAG,CAAC,CAAkB,EAAE,EAAE,CAAC,CAAC;IACxC,WAAW,EAAE,CAAC,CAAC,WAAW,EAAE,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE,OAAO,EAAE,CAAC,CAAC,OAAO,IAAI,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,WAAW,EAAE,CAAC,CAAC,WAAW;CACzH,CAAC,CAAC;AAEH,2FAA2F;AAC3F,MAAM,UAAU,SAAS,CAAC,CAAkB;IAC1C,OAAO,eAAe,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;AACtC,CAAC;AACD,mGAAmG;AACnG,MAAM,UAAU,eAAe,CAAC,CAAkB,EAAE,EAAO;IACzD,OAAO,SAAS,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC;AAC7B,CAAC"}
|
package/dist/wire.d.ts
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import type { Address, Hex } from '@agenticprimitives/types';
|
|
2
|
+
export declare const A2A_CONTENT_INTENTS: {
|
|
3
|
+
readonly accessRequest: "content.access.request";
|
|
4
|
+
readonly patchPropose: "content.patch.propose";
|
|
5
|
+
readonly replicaRequest: "content.replica.request";
|
|
6
|
+
readonly ownershipTransferPropose: "content.ownership.transfer.propose";
|
|
7
|
+
readonly skillPublishRequest: "skill.publish.request";
|
|
8
|
+
readonly skillInstallRequest: "skill.install.request";
|
|
9
|
+
readonly vaultExportRequest: "vault.export.request";
|
|
10
|
+
};
|
|
11
|
+
export type A2AContentIntent = (typeof A2A_CONTENT_INTENTS)[keyof typeof A2A_CONTENT_INTENTS];
|
|
12
|
+
export interface ContentAccessRequest {
|
|
13
|
+
intent: 'content.access.request';
|
|
14
|
+
/** The `ap-vault://` resource (or `container:`/`artifact:` id) the requester wants. */
|
|
15
|
+
resource: string;
|
|
16
|
+
requester: Address;
|
|
17
|
+
actions: string[];
|
|
18
|
+
purpose?: string;
|
|
19
|
+
}
|
|
20
|
+
export interface ContentPatchProposal {
|
|
21
|
+
intent: 'content.patch.propose';
|
|
22
|
+
resource: string;
|
|
23
|
+
proposer: Address;
|
|
24
|
+
/** The proposed new content commitment / bundle root (the owner reviews before accepting). */
|
|
25
|
+
proposedRoot: Hex;
|
|
26
|
+
note?: string;
|
|
27
|
+
}
|
|
28
|
+
export interface SkillPublishRequest {
|
|
29
|
+
intent: 'skill.publish.request';
|
|
30
|
+
canonicalId: Hex;
|
|
31
|
+
releaseId: Hex;
|
|
32
|
+
publisher: Address;
|
|
33
|
+
}
|
|
34
|
+
export interface VaultExportRequest {
|
|
35
|
+
intent: 'vault.export.request';
|
|
36
|
+
vaultId: string;
|
|
37
|
+
requester: Address;
|
|
38
|
+
}
|
|
39
|
+
export type A2AContentMessage = ContentAccessRequest | ContentPatchProposal | SkillPublishRequest | VaultExportRequest;
|
|
40
|
+
export declare const AP_VAULT_SCHEME = "ap-vault";
|
|
41
|
+
export type VaultResourceKind = 'artifacts' | 'containers' | 'versions' | 'skills' | 'releases' | 'threads' | 'evidence';
|
|
42
|
+
export interface VaultResourceRef {
|
|
43
|
+
vaultId: string;
|
|
44
|
+
kind: VaultResourceKind;
|
|
45
|
+
id: string;
|
|
46
|
+
/** One nested segment, e.g. a skill's release: `.../skills/<id>/releases/<sub.id>`. */
|
|
47
|
+
sub?: {
|
|
48
|
+
kind: VaultResourceKind;
|
|
49
|
+
id: string;
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
/** Build an `ap-vault://<vaultId>/<kind>/<id>[/<sub.kind>/<sub.id>]` MCP resource id. */
|
|
53
|
+
export declare function vaultResourceId(ref: VaultResourceRef): string;
|
|
54
|
+
/** Parse an `ap-vault://` resource id, or null if malformed / not the ap-vault scheme. */
|
|
55
|
+
export declare function parseVaultResourceId(uri: string): VaultResourceRef | null;
|
|
56
|
+
export declare const CONTENT_RECORD_FAMILY: "content";
|
|
57
|
+
/** The vault record listing a principal's content — its catalog. */
|
|
58
|
+
export declare const CONTENT_CATALOG_RECORD: "vault:content.catalog";
|
|
59
|
+
/**
|
|
60
|
+
* Lower an `ap-vault://` ref to the flat MCP vault record string, e.g.
|
|
61
|
+
* `ap-vault://<sa>/artifacts/<id>` → `vault:content.artifact.<id>`,
|
|
62
|
+
* `ap-vault://<sa>/skills/<id>/releases/<rid>` → `vault:content.skill.<id>.release.<rid>`.
|
|
63
|
+
* FAIL-CLOSED: the ref's `vaultId` MUST equal the authenticated `principal` — a token may only address
|
|
64
|
+
* its OWN vault (the owner SA is the vault; there is no cross-vault addressing at the MCP layer).
|
|
65
|
+
*/
|
|
66
|
+
export declare function toVaultRecordResource(ref: VaultResourceRef, principal: string): string;
|
|
67
|
+
/** The anchored record-scope caveat that cascades a container grant to its whole subtree:
|
|
68
|
+
* `vault:content.container.<path>:*` (matched by `vaultRecordScopeAllows`). */
|
|
69
|
+
export declare function containerRecordScope(path: string): string;
|
|
70
|
+
export interface RepresentationCapability {
|
|
71
|
+
/** The `ap-vault://` resource this capability releases. */
|
|
72
|
+
resource: string;
|
|
73
|
+
/** The SA allowed to redeem it (audience-bound — not transferable). */
|
|
74
|
+
audience: Address;
|
|
75
|
+
issuedAt: string;
|
|
76
|
+
expiresAt: string;
|
|
77
|
+
contentType?: string;
|
|
78
|
+
/** Optional byte range for a ranged read. */
|
|
79
|
+
range?: {
|
|
80
|
+
start: number;
|
|
81
|
+
end: number;
|
|
82
|
+
};
|
|
83
|
+
/** Opaque redemption reference minted by the owning vault — NOT storage credentials. */
|
|
84
|
+
redemptionRef: string;
|
|
85
|
+
}
|
|
86
|
+
/** Is a representation capability still valid for `audience` at `nowIso`? Fail-closed on expiry/audience. */
|
|
87
|
+
export declare function isRepresentationValid(cap: RepresentationCapability, audience: Address, nowIso: string): boolean;
|
|
88
|
+
//# s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M,EAAE,MAAM,GAAG,OAAO,CAE/G"}
|
package/dist/wire.js
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
// The A2A + MCP content-fabric wire profiles (ADR-0055, spec 335 §13). A2A carries principal-to-principal
|
|
2
|
+
// INTENT; MCP is a vault's resource/tool boundary. Acceptance of an A2A request never authorizes the
|
|
3
|
+
// operation — the receiving vault re-evaluates delegation + entitlement + mandate + audience + resource +
|
|
4
|
+
// action + time + status (fail-closed). These are the payload/resource-id shapes, not the transport.
|
|
5
|
+
// ── A2A content intents ──
|
|
6
|
+
export const A2A_CONTENT_INTENTS = {
|
|
7
|
+
accessRequest: 'content.access.request',
|
|
8
|
+
patchPropose: 'content.patch.propose',
|
|
9
|
+
replicaRequest: 'content.replica.request',
|
|
10
|
+
ownershipTransferPropose: 'content.ownership.transfer.propose',
|
|
11
|
+
skillPublishRequest: 'skill.publish.request',
|
|
12
|
+
skillInstallRequest: 'skill.install.request',
|
|
13
|
+
vaultExportRequest: 'vault.export.request',
|
|
14
|
+
};
|
|
15
|
+
// ── MCP `ap-vault://` resource ids — the only normal app-facing content boundary ──
|
|
16
|
+
export const AP_VAULT_SCHEME = 'ap-vault';
|
|
17
|
+
/** Build an `ap-vault://<vaultId>/<kind>/<id>[/<sub.kind>/<sub.id>]` MCP resource id. */
|
|
18
|
+
export function vaultResourceId(ref) {
|
|
19
|
+
const base = `${AP_VAULT_SCHEME}://${ref.vaultId}/${ref.kind}/${encodeURIComponent(ref.id)}`;
|
|
20
|
+
return ref.sub ? `${base}/${ref.sub.kind}/${encodeURIComponent(ref.sub.id)}` : base;
|
|
21
|
+
}
|
|
22
|
+
const KINDS = new Set(['artifacts', 'containers', 'versions', 'skills', 'releases', 'threads', 'evidence']);
|
|
23
|
+
/** Parse an `ap-vault://` resource id, or null if malformed / not the ap-vault scheme. */
|
|
24
|
+
export function parseVaultResourceId(uri) {
|
|
25
|
+
const prefix = `${AP_VAULT_SCHEME}://`;
|
|
26
|
+
if (!uri.startsWith(prefix))
|
|
27
|
+
return null;
|
|
28
|
+
const rest = uri.slice(prefix.length);
|
|
29
|
+
const slash = rest.indexOf('/');
|
|
30
|
+
if (slash <= 0)
|
|
31
|
+
return null;
|
|
32
|
+
const vaultId = rest.slice(0, slash);
|
|
33
|
+
const parts = rest.slice(slash + 1).split('/');
|
|
34
|
+
if (parts.length !== 2 && parts.length !== 4)
|
|
35
|
+
return null;
|
|
36
|
+
const [kind, id, subKind, subId] = parts;
|
|
37
|
+
if (!kind || !id || !KINDS.has(kind))
|
|
38
|
+
return null;
|
|
39
|
+
const ref = { vaultId, kind: kind, id: decodeURIComponent(id) };
|
|
40
|
+
if (parts.length === 4) {
|
|
41
|
+
if (!subKind || !subId || !KINDS.has(subKind))
|
|
42
|
+
return null;
|
|
43
|
+
ref.sub = { kind: subKind, id: decodeURIComponent(subId) };
|
|
44
|
+
}
|
|
45
|
+
return ref;
|
|
46
|
+
}
|
|
47
|
+
// ── Lowering `ap-vault://` → the flat, principal-keyed MCP vault record string ──
|
|
48
|
+
// An MCP vault (the `demo-mcp` pattern) has NO `vaultId` in the resource: the token PRINCIPAL is the
|
|
49
|
+
// vault, and records are flat `vault:<recordType>` strings matched by anchored prefix. The `ap-vault://`
|
|
50
|
+
// id is the app/A2A-facing addressing layer; at the A2A edge it lowers to a `vault:content.*` record so
|
|
51
|
+
// the id never reaches MCP raw. All content records share one namespace: `content`.
|
|
52
|
+
export const CONTENT_RECORD_FAMILY = 'content';
|
|
53
|
+
/** The vault record listing a principal's content — its catalog. */
|
|
54
|
+
export const CONTENT_CATALOG_RECORD = `vault:${CONTENT_RECORD_FAMILY}.catalog`;
|
|
55
|
+
const SINGULAR = {
|
|
56
|
+
artifacts: 'artifact', containers: 'container', versions: 'version', skills: 'skill', releases: 'release', threads: 'thread', evidence: 'evidence',
|
|
57
|
+
};
|
|
58
|
+
/**
|
|
59
|
+
* Lower an `ap-vault://` ref to the flat MCP vault record string, e.g.
|
|
60
|
+
* `ap-vault://<sa>/artifacts/<id>` → `vault:content.artifact.<id>`,
|
|
61
|
+
* `ap-vault://<sa>/skills/<id>/releases/<rid>` → `vault:content.skill.<id>.release.<rid>`.
|
|
62
|
+
* FAIL-CLOSED: the ref's `vaultId` MUST equal the authenticated `principal` — a token may only address
|
|
63
|
+
* its OWN vault (the owner SA is the vault; there is no cross-vault addressing at the MCP layer).
|
|
64
|
+
*/
|
|
65
|
+
export function toVaultRecordResource(ref, principal) {
|
|
66
|
+
if (ref.vaultId.toLowerCase() !== principal.toLowerCase()) {
|
|
67
|
+
throw new Error(`vault resource principal mismatch: ${ref.vaultId} ≠ ${principal} (a token may only address its own vault)`);
|
|
68
|
+
}
|
|
69
|
+
const base = `vault:${CONTENT_RECORD_FAMILY}.${SINGULAR[ref.kind]}.${ref.id}`;
|
|
70
|
+
return ref.sub ? `${base}.${SINGULAR[ref.sub.kind]}.${ref.sub.id}` : base;
|
|
71
|
+
}
|
|
72
|
+
/** The anchored record-scope caveat that cascades a container grant to its whole subtree:
|
|
73
|
+
* `vault:content.container.<path>:*` (matched by `vaultRecordScopeAllows`). */
|
|
74
|
+
export function containerRecordScope(path) {
|
|
75
|
+
return `vault:${CONTENT_RECORD_FAMILY}.container.${path.replace(/^\/+|\/+$/g, '')}:*`;
|
|
76
|
+
}
|
|
77
|
+
/** Is a representation capability still valid for `audience` at `nowIso`? Fail-closed on expiry/audience. */
|
|
78
|
+
export function isRepresentationValid(cap, audience, nowIso) {
|
|
79
|
+
return cap.audience.toLowerCase() === audience.toLowerCase() && new Date(nowIso).getTime() < new Date(cap.expiresAt).getTime();
|
|
80
|
+
}
|
|
81
|
+
//# sourceMappingURL=wire.js.map
|
package/dist/wire.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wire.js","sourceRoot":"","sources":["../src/wire.ts"],"names":[],"mappings":"AAEA,0GAA0G;AAC1G,qGAAqG;AACrG,0GAA0G;AAC1G,qGAAqG;AAErG,4BAA4B;AAC5B,MAAM,CA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primitives/content-storage",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Managed storage for Content Artifacts (SKILL.md, .ttl, .md, JSON-LD, images/video): the StoragePort provider abstraction + ContentArtifact/ArtifactBundle model that stores a content-primitives descriptor's bytes in a client-side-envelope-encrypted, content-addressed blob store, entitlement-gated and provenance-anchored. Provider-agnostic (S3 API); the concrete driver is app-injected (ADR-0037). See spec 335.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/agentictrustlabs/agenticprimitives.git",
|
|
9
|
+
"directory": "packages/content-storage"
|
|
10
|
+
},
|
|
11
|
+
"homepage": "https://github.com/agentictrustlabs/agenticprimitives/tree/master/packages/content-storage",
|
|
12
|
+
"bugs": {
|
|
13
|
+
"url": "https://github.com/agentictrustlabs/agenticprimitives/issues"
|
|
14
|
+
},
|
|
15
|
+
"type": "module",
|
|
16
|
+
"main": "./dist/index.js",
|
|
17
|
+
"types": "./dist/index.d.ts",
|
|
18
|
+
"exports": {
|
|
19
|
+
".": {
|
|
20
|
+
"types": "./dist/index.d.ts",
|
|
21
|
+
"import": "./dist/index.js"
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
"files": [
|
|
25
|
+
"LICENSE",
|
|
26
|
+
"dist",
|
|
27
|
+
"README.md",
|
|
28
|
+
"CLAUDE.md"
|
|
29
|
+
],
|
|
30
|
+
"publishConfig": {
|
|
31
|
+
"access": "public"
|
|
32
|
+
},
|
|
33
|
+
"peerDependencies": {
|
|
34
|
+
"@agenticprimitives/types": "1.0.0-alpha.20",
|
|
35
|
+
"@agenticprimitives/content-primitives": "1.0.0-alpha.21"
|
|
36
|
+
},
|
|
37
|
+
"devDependencies": {
|
|
38
|
+
"@types/node": "^22.7.0",
|
|
39
|
+
"vitest": "^4.1.8"
|
|
40
|
+
},
|
|
41
|
+
"keywords": [
|
|
42
|
+
"content",
|
|
43
|
+
"artifact",
|
|
44
|
+
"storage",
|
|
45
|
+
"vault",
|
|
46
|
+
"envelope-encryption",
|
|
47
|
+
"content-addressed",
|
|
48
|
+
"agentic"
|
|
49
|
+
],
|
|
50
|
+
"scripts": {
|
|
51
|
+
"build": "tsc -p tsconfig.build.json",
|
|
52
|
+
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
53
|
+
"test": "vitest run",
|
|
54
|
+
"test:watch": "vitest",
|
|
55
|
+
"clean": "rm -rf dist"
|
|
56
|
+
}
|
|
57
|
+
}
|