agent-passport-system 2.6.0-alpha.3 → 2.6.0-alpha.4
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 +8 -2
- package/dist/src/core/action-ref.d.ts +5 -0
- package/dist/src/core/action-ref.d.ts.map +1 -1
- package/dist/src/core/action-ref.js +8 -2
- package/dist/src/core/action-ref.js.map +1 -1
- package/dist/src/core/canonical-jcs.d.ts +5 -0
- package/dist/src/core/canonical-jcs.d.ts.map +1 -1
- package/dist/src/core/canonical-jcs.js +7 -0
- package/dist/src/core/canonical-jcs.js.map +1 -1
- package/dist/src/core/tool-integrity.d.ts +219 -0
- package/dist/src/core/tool-integrity.d.ts.map +1 -1
- package/dist/src/core/tool-integrity.js +369 -2
- package/dist/src/core/tool-integrity.js.map +1 -1
- package/dist/src/v2/attribution-primitive/construct.d.ts +8 -1
- package/dist/src/v2/attribution-primitive/construct.d.ts.map +1 -1
- package/dist/src/v2/attribution-primitive/construct.js +11 -3
- package/dist/src/v2/attribution-primitive/construct.js.map +1 -1
- package/dist/src/v2/payment-rails/conformance/binding-harness.d.ts +102 -0
- package/dist/src/v2/payment-rails/conformance/binding-harness.d.ts.map +1 -0
- package/dist/src/v2/payment-rails/conformance/binding-harness.js +360 -0
- package/dist/src/v2/payment-rails/conformance/binding-harness.js.map +1 -0
- package/dist/src/v2/payment-rails/conformance/index.d.ts +2 -0
- package/dist/src/v2/payment-rails/conformance/index.d.ts.map +1 -1
- package/dist/src/v2/payment-rails/conformance/index.js +1 -0
- package/dist/src/v2/payment-rails/conformance/index.js.map +1 -1
- package/dist/src/v2/payment-rails/hooks.d.ts.map +1 -1
- package/dist/src/v2/payment-rails/hooks.js +36 -4
- package/dist/src/v2/payment-rails/hooks.js.map +1 -1
- package/dist/src/v2/payment-rails/stripe-issuing/fixtures/_generate-cross-rail.d.ts +2 -0
- package/dist/src/v2/payment-rails/stripe-issuing/fixtures/_generate-cross-rail.d.ts.map +1 -0
- package/dist/src/v2/payment-rails/stripe-issuing/fixtures/_generate-cross-rail.js +151 -0
- package/dist/src/v2/payment-rails/stripe-issuing/fixtures/_generate-cross-rail.js.map +1 -0
- package/dist/src/v2/payment-rails/types.d.ts +19 -4
- package/dist/src/v2/payment-rails/types.d.ts.map +1 -1
- package/package.json +3 -2
- package/src/v2/payment-rails/README.md +47 -0
- package/src/v2/payment-rails/conformance/binding-fixtures/acp.fixture.json +231 -0
- package/src/v2/payment-rails/conformance/binding-fixtures/ap2.fixture.json +231 -0
- package/src/v2/payment-rails/conformance/binding-fixtures/mpp.fixture.json +231 -0
- package/src/v2/payment-rails/conformance/binding-fixtures/stripe-issuing.fixture.json +231 -0
- package/src/v2/payment-rails/conformance/binding-fixtures/x402.fixture.json +231 -0
- package/src/v2/payment-rails/stripe-issuing/fixtures/_generate-cross-rail.ts +179 -0
- package/src/v2/payment-rails/stripe-issuing/fixtures/permit-receipt-cross-rail.fixture.json +119 -0
- package/src/v2/payment-rails/stripe-issuing/fixtures/permit-receipt-cross-rail.mycelium-companion.json +59 -0
package/README.md
CHANGED
|
@@ -119,9 +119,9 @@ Coordination (task lifecycle with 9-state machine), EU AI Act compliance (signed
|
|
|
119
119
|
|
|
120
120
|
Forward-looking governance. Published, tested, available.
|
|
121
121
|
|
|
122
|
-
|
|
122
|
+
26 v2 constitutional modules: approval fatigue detection, epistemic isolation, blind evaluation, separation of powers, affected-party standing, circuit breakers, constitutional amendment, authority laundering audit, emergence detection.
|
|
123
123
|
|
|
124
|
-
Wave 1 accountability primitives: Ed25519 ActionReceipt, AuthorityBoundaryReceipt, CustodyReceipt, ContestabilityReceipt, APSBundle. RFC 8785 JCS
|
|
124
|
+
Wave 1 accountability primitives: Ed25519 ActionReceipt, AuthorityBoundaryReceipt, CustodyReceipt, ContestabilityReceipt, APSBundle. RFC 8785 JCS canonicalization for cross-implementation receipts and conformance fixtures, content-addressed, byte-match across implementations.
|
|
125
125
|
|
|
126
126
|
Institutional governance: charters, offices, federation, reserves, multi-party approvals.
|
|
127
127
|
|
|
@@ -157,6 +157,12 @@ The composition contract specifies how a verifier MUST cross-check per-request s
|
|
|
157
157
|
- [The Evidence-Safety Gap](https://doi.org/10.5281/zenodo.19914628)
|
|
158
158
|
- IETF Internet-Draft: `draft-pidlisnyi-aps-00`
|
|
159
159
|
|
|
160
|
+
## Contributing
|
|
161
|
+
|
|
162
|
+
- [Contribution path](/CONTRIBUTION_PATH.md)
|
|
163
|
+
- [Open problems](/OPEN_PROBLEMS.md)
|
|
164
|
+
- [Governance surfaces](/GOVERNANCE_SURFACES.md)
|
|
165
|
+
|
|
160
166
|
## Links
|
|
161
167
|
|
|
162
168
|
- [aeoess.com](https://aeoess.com) -- Protocol home
|
|
@@ -5,6 +5,11 @@ import type { ActionIntent } from '../types/policy.js';
|
|
|
5
5
|
* Inputs hashed: agentId, action.type, action.scopeRequired, normalized timestamp.
|
|
6
6
|
* Timestamp defaults to intent.createdAt; falls back to current time.
|
|
7
7
|
*
|
|
8
|
+
* Canonicalization follows RFC 8785 JCS strictly, per draft-pidlisnyi-aps-00
|
|
9
|
+
* §4.1: null/undefined-valued keys are preserved (not stripped) so that
|
|
10
|
+
* cross-engine correlation byte-matches against any other strict-JCS
|
|
11
|
+
* implementation (x402 ecosystem, AgentGraph CTEF, Nobulex, etc.).
|
|
12
|
+
*
|
|
8
13
|
* Returns: lowercase hex SHA-256 digest.
|
|
9
14
|
*/
|
|
10
15
|
export declare function computeActionRef(intent: Pick<ActionIntent, 'agentId' | 'action' | 'createdAt'>): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"action-ref.d.ts","sourceRoot":"","sources":["../../../src/core/action-ref.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"action-ref.d.ts","sourceRoot":"","sources":["../../../src/core/action-ref.ts"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAEtD;;;;;;;;;;;;GAYG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,IAAI,CAAC,YAAY,EAAE,SAAS,GAAG,QAAQ,GAAG,WAAW,CAAC,GAAG,MAAM,CAQvG;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,OAAO,CAE7D"}
|
|
@@ -15,18 +15,24 @@
|
|
|
15
15
|
// systems independently hashing the same request within the same second
|
|
16
16
|
// produce the same action_ref.
|
|
17
17
|
// ══════════════════════════════════════════════════════════════════
|
|
18
|
-
import {
|
|
18
|
+
import { normalizeTimestamp } from './canonical.js';
|
|
19
|
+
import { canonicalHashJCS } from './canonical-jcs.js';
|
|
19
20
|
/**
|
|
20
21
|
* Compute the content-addressed request identity for an ActionIntent.
|
|
21
22
|
*
|
|
22
23
|
* Inputs hashed: agentId, action.type, action.scopeRequired, normalized timestamp.
|
|
23
24
|
* Timestamp defaults to intent.createdAt; falls back to current time.
|
|
24
25
|
*
|
|
26
|
+
* Canonicalization follows RFC 8785 JCS strictly, per draft-pidlisnyi-aps-00
|
|
27
|
+
* §4.1: null/undefined-valued keys are preserved (not stripped) so that
|
|
28
|
+
* cross-engine correlation byte-matches against any other strict-JCS
|
|
29
|
+
* implementation (x402 ecosystem, AgentGraph CTEF, Nobulex, etc.).
|
|
30
|
+
*
|
|
25
31
|
* Returns: lowercase hex SHA-256 digest.
|
|
26
32
|
*/
|
|
27
33
|
export function computeActionRef(intent) {
|
|
28
34
|
const ts = intent.createdAt ?? new Date().toISOString();
|
|
29
|
-
return
|
|
35
|
+
return canonicalHashJCS({
|
|
30
36
|
agentId: intent.agentId,
|
|
31
37
|
actionType: intent.action.type,
|
|
32
38
|
scopeRequired: intent.action.scopeRequired,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"action-ref.js","sourceRoot":"","sources":["../../../src/core/action-ref.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,qEAAqE;AACrE,kDAAkD;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CAAA;AAClF,CAAC"}
|
|
@@ -18,6 +18,11 @@ export interface CanonicalizationTestVector {
|
|
|
18
18
|
sha256_jcs: string;
|
|
19
19
|
sha256_legacy: string;
|
|
20
20
|
}
|
|
21
|
+
/** SHA-256 (lowercase hex) of canonicalizeJCS(obj). Strict-RFC-8785
|
|
22
|
+
* counterpart of canonicalHash() from ./canonical.ts. Use this for any
|
|
23
|
+
* cross-implementation hash whose conformance pin requires strict JCS
|
|
24
|
+
* (e.g. action_ref per draft-pidlisnyi-aps-00 §4.1). */
|
|
25
|
+
export declare function canonicalHashJCS(obj: Record<string, unknown>): string;
|
|
21
26
|
/** Built-in test vectors for cross-language verification */
|
|
22
27
|
export declare function getTestVectors(): CanonicalizationTestVector[];
|
|
23
28
|
//# sourceMappingURL=canonical-jcs.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"canonical-jcs.d.ts","sourceRoot":"","sources":["../../../src/core/canonical-jcs.ts"],"names":[],"mappings":"AAcA;;;;;qEAKqE;AACrE,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAiCtD;AAED;kFACkF;AAClF,wBAAgB,sBAAsB,CACpC,GAAG,EAAE,OAAO,EACZ,eAAe,EAAE,MAAM,GACtB,KAAK,GAAG,QAAQ,GAAG,WAAW,CAMhC;AAYD,mEAAmE;AACnE,MAAM,WAAW,0BAA0B;IACzC,EAAE,EAAE,MAAM,CAAA;IACV,WAAW,EAAE,MAAM,CAAA;IACnB,KAAK,EAAE,OAAO,CAAA;IACd,YAAY,EAAE,MAAM,CAAA;IACpB,eAAe,EAAE,MAAM,CAAA;IACvB,UAAU,EAAE,MAAM,CAAA;IAClB,aAAa,EAAE,MAAM,CAAA;CACtB;AAOD,4DAA4D;AAC5D,wBAAgB,cAAc,IAAI,0BAA0B,EAAE,CAoF7D"}
|
|
1
|
+
{"version":3,"file":"canonical-jcs.d.ts","sourceRoot":"","sources":["../../../src/core/canonical-jcs.ts"],"names":[],"mappings":"AAcA;;;;;qEAKqE;AACrE,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAiCtD;AAED;kFACkF;AAClF,wBAAgB,sBAAsB,CACpC,GAAG,EAAE,OAAO,EACZ,eAAe,EAAE,MAAM,GACtB,KAAK,GAAG,QAAQ,GAAG,WAAW,CAMhC;AAYD,mEAAmE;AACnE,MAAM,WAAW,0BAA0B;IACzC,EAAE,EAAE,MAAM,CAAA;IACV,WAAW,EAAE,MAAM,CAAA;IACnB,KAAK,EAAE,OAAO,CAAA;IACd,YAAY,EAAE,MAAM,CAAA;IACpB,eAAe,EAAE,MAAM,CAAA;IACvB,UAAU,EAAE,MAAM,CAAA;IAClB,aAAa,EAAE,MAAM,CAAA;CACtB;AAOD;;;yDAGyD;AACzD,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAErE;AAED,4DAA4D;AAC5D,wBAAgB,cAAc,IAAI,0BAA0B,EAAE,CAoF7D"}
|
|
@@ -78,6 +78,13 @@ import { createHash } from 'crypto';
|
|
|
78
78
|
function sha256hex(input) {
|
|
79
79
|
return createHash('sha256').update(input, 'utf-8').digest('hex');
|
|
80
80
|
}
|
|
81
|
+
/** SHA-256 (lowercase hex) of canonicalizeJCS(obj). Strict-RFC-8785
|
|
82
|
+
* counterpart of canonicalHash() from ./canonical.ts. Use this for any
|
|
83
|
+
* cross-implementation hash whose conformance pin requires strict JCS
|
|
84
|
+
* (e.g. action_ref per draft-pidlisnyi-aps-00 §4.1). */
|
|
85
|
+
export function canonicalHashJCS(obj) {
|
|
86
|
+
return sha256hex(canonicalizeJCS(obj));
|
|
87
|
+
}
|
|
81
88
|
/** Built-in test vectors for cross-language verification */
|
|
82
89
|
export function getTestVectors() {
|
|
83
90
|
const vectors = [];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"canonical-jcs.js","sourceRoot":"","sources":["../../../src/core/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AAE,4DAA4D,EAC9E;QACE,YAAY,EAAE,YAAY;QAC1B,WAAW,EAAE,sBAAsB;QACnC,WAAW,EAAE,kBAAkB;QAC/B,KAAK,EAAE,CAAC,WAAW,EAAE,mBAAmB,CAAC;QACzC,UAAU,EAAE,GAAG;QACf,oBAAoB,EAAE,IAAI;QAC1B,SAAS,EAAE,sBAAsB;QACjC,SAAS,EAAE,IAAI;QACf,QAAQ,EAAE,CAAC;QACX,YAAY,EAAE,CAAC;QACf,SAAS,EAAE,sBAAsB;KAClC,EACD,iTAAiT,EACjT,oQAAoQ,CAAC,CAAA;IAEvQ,sBAAsB;IACtB,SAAS,CAAC,QAAQ,EAAE,gBAAgB,EAClC,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,EAChC,iCAAiC,EACjC,iCAAiC,CAAC,CAAA;IAEpC,OAAO,OAAO,CAAA;AAChB,CAAC"}
|
|
@@ -72,4 +72,223 @@ export declare function verifyToolIntegrity(input: {
|
|
|
72
72
|
hasWallet: boolean;
|
|
73
73
|
};
|
|
74
74
|
}): ToolIntegrityResult;
|
|
75
|
+
/**
|
|
76
|
+
* Trust roots (D1). The APS-native DID is the default and needs zero
|
|
77
|
+
* external dependency — the Ed25519 key is embedded in the did:key /
|
|
78
|
+
* did:aps identifier itself. `did:web` (domain-anchored) and `raw-key`
|
|
79
|
+
* are accepted external roots so the integrity claim holds for
|
|
80
|
+
* real-world registries.
|
|
81
|
+
*/
|
|
82
|
+
export type ToolTrustRoot = {
|
|
83
|
+
type: 'aps';
|
|
84
|
+
ref: string;
|
|
85
|
+
} | {
|
|
86
|
+
type: 'did:web';
|
|
87
|
+
ref: string;
|
|
88
|
+
} | {
|
|
89
|
+
type: 'raw-key';
|
|
90
|
+
ref: string;
|
|
91
|
+
};
|
|
92
|
+
/** Metadata block — description, declared schema, declared permissions. */
|
|
93
|
+
export interface ToolMetadata {
|
|
94
|
+
description?: string;
|
|
95
|
+
schema?: unknown;
|
|
96
|
+
permissions?: string[];
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Signed tool manifest — the artifact a publisher/registry publishes.
|
|
100
|
+
* Canonical surface for publisher identity, namespace and re-approval.
|
|
101
|
+
*/
|
|
102
|
+
export interface ToolManifest {
|
|
103
|
+
/** Tool name (matches the name in delegation scope) */
|
|
104
|
+
toolName: string;
|
|
105
|
+
/** Optional declared namespace, e.g. `acme/*` */
|
|
106
|
+
namespace?: string;
|
|
107
|
+
/** `sha256:` of the implementation (existing semantics) */
|
|
108
|
+
implementationHash: string;
|
|
109
|
+
/** `sha256:` of the canonicalized metadata block — DISTINCT from
|
|
110
|
+
* implementationHash so a description/schema/permissions change is
|
|
111
|
+
* detectable even when the implementation is byte-identical. */
|
|
112
|
+
metadataHash: string;
|
|
113
|
+
/** Asserted publisher identity (DID). When present, a publisher check runs. */
|
|
114
|
+
publisherDid?: string;
|
|
115
|
+
/** How the publisher key is resolved (D1). Default when absent: APS-native. */
|
|
116
|
+
trustRoot?: ToolTrustRoot;
|
|
117
|
+
/** Asserted attestor identity (DID). When present, the manifest signature
|
|
118
|
+
* is verified against the RESOLVED attestor key — a caller-supplied
|
|
119
|
+
* `attestorPublicKey` cannot override or substitute for it. */
|
|
120
|
+
attestorDid?: string;
|
|
121
|
+
/** How the attestor key is resolved (D1). Default when absent: APS-native. */
|
|
122
|
+
attestorTrustRoot?: ToolTrustRoot;
|
|
123
|
+
/** Monotonic integer; bumped on every substantive revision. */
|
|
124
|
+
metadataVersion: number;
|
|
125
|
+
/** Approval state — `pending-reapproval` blocks verification. */
|
|
126
|
+
approvalState?: 'approved' | 'pending-reapproval';
|
|
127
|
+
/** When this manifest was attested */
|
|
128
|
+
verifiedAt: string;
|
|
129
|
+
/** Ed25519 attestor signature over the canonical manifest body */
|
|
130
|
+
signature: string;
|
|
131
|
+
/** Ed25519 publisher signature over the SAME canonical body, when a
|
|
132
|
+
* publisher identity is asserted */
|
|
133
|
+
publisherSignature?: string;
|
|
134
|
+
}
|
|
135
|
+
/** A signed claim of ownership over a tool-name namespace (anti-typosquat). */
|
|
136
|
+
export interface NamespaceClaim {
|
|
137
|
+
/** Claimed namespace, e.g. `acme/*` */
|
|
138
|
+
namespace: string;
|
|
139
|
+
/** DID of the namespace owner */
|
|
140
|
+
ownerDid: string;
|
|
141
|
+
/** How the owner key resolves (D1) */
|
|
142
|
+
trustRoot: ToolTrustRoot;
|
|
143
|
+
/** Ed25519 signature by the owner over canonical `{namespace, ownerDid}` */
|
|
144
|
+
signature: string;
|
|
145
|
+
}
|
|
146
|
+
/** Result of `verifyToolManifest`. */
|
|
147
|
+
export interface ToolManifestResult {
|
|
148
|
+
/** All checks passed */
|
|
149
|
+
valid: boolean;
|
|
150
|
+
/** Attestor signature over the manifest body is valid (against the
|
|
151
|
+
* authoritative key — resolved when attestorDid is set, else the
|
|
152
|
+
* caller-supplied attestorPublicKey) */
|
|
153
|
+
attestorSignatureValid: boolean;
|
|
154
|
+
/** Manifest signature verified against a RESOLVED attestor identity.
|
|
155
|
+
* True only when `attestorDid` is asserted, resolves, and the signature
|
|
156
|
+
* checks out. False when no attestorDid is asserted (no DID binding). */
|
|
157
|
+
attestorVerified: boolean;
|
|
158
|
+
/** How the attestor key was resolved, or `caller-supplied-key` when no
|
|
159
|
+
* attestorDid is asserted */
|
|
160
|
+
attestorResolutionMethod: string;
|
|
161
|
+
/** Implementation hash matched (true if no current implementation supplied) */
|
|
162
|
+
implementationVerified: boolean;
|
|
163
|
+
/** Metadata hash matched (true if no current metadata supplied) */
|
|
164
|
+
metadataVerified: boolean;
|
|
165
|
+
/** Publisher signature verified (false when no publisher identity asserted) */
|
|
166
|
+
publisherVerified: boolean;
|
|
167
|
+
/** How the publisher key was resolved, or why it was not */
|
|
168
|
+
publisherResolutionMethod: string;
|
|
169
|
+
/** Namespace governance passed (true when no claims supplied or no match) */
|
|
170
|
+
namespaceVerified: boolean;
|
|
171
|
+
/** Tool name collides with a namespace owned by a different DID */
|
|
172
|
+
namespaceViolation: boolean;
|
|
173
|
+
/** Manifest is pending re-approval after a metadata change */
|
|
174
|
+
reapprovalRequired: boolean;
|
|
175
|
+
/** Errors */
|
|
176
|
+
errors: string[];
|
|
177
|
+
}
|
|
178
|
+
/** Optional injected did:web resolver — lets callers (and tests) resolve a
|
|
179
|
+
* did:web document without live network access. Defaults to `resolveDIDWeb`. */
|
|
180
|
+
export interface ToolResolveOpts {
|
|
181
|
+
didWebResolver?: (didWeb: string) => Promise<object>;
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* Create a signed tool manifest. The attestor signs the canonical body; if a
|
|
185
|
+
* publisher private key is supplied, the publisher co-signs the same body.
|
|
186
|
+
*/
|
|
187
|
+
export declare function createToolManifest(input: {
|
|
188
|
+
toolName: string;
|
|
189
|
+
namespace?: string;
|
|
190
|
+
/** Raw implementation content to hash */
|
|
191
|
+
implementation: string | Buffer;
|
|
192
|
+
/** Metadata block to hash (distinct from the implementation) */
|
|
193
|
+
metadata: ToolMetadata;
|
|
194
|
+
attestorPrivateKey: string;
|
|
195
|
+
/** Asserted attestor identity (DID) — when set, the manifest carries it and
|
|
196
|
+
* verification binds the signature to the resolved attestor key */
|
|
197
|
+
attestorDid?: string;
|
|
198
|
+
/** Trust root for resolving the attestor key, optional */
|
|
199
|
+
attestorTrustRoot?: ToolTrustRoot;
|
|
200
|
+
/** Asserted publisher identity, optional */
|
|
201
|
+
publisherDid?: string;
|
|
202
|
+
/** Trust root for resolving the publisher key, optional */
|
|
203
|
+
trustRoot?: ToolTrustRoot;
|
|
204
|
+
/** Publisher private key — when present, the manifest is publisher co-signed */
|
|
205
|
+
publisherPrivateKey?: string;
|
|
206
|
+
/** Monotonic metadata version (default 1) */
|
|
207
|
+
metadataVersion?: number;
|
|
208
|
+
/** Approval state (default 'approved') */
|
|
209
|
+
approvalState?: 'approved' | 'pending-reapproval';
|
|
210
|
+
/** Override timestamp — for deterministic conformance fixtures */
|
|
211
|
+
verifiedAt?: string;
|
|
212
|
+
}): ToolManifest;
|
|
213
|
+
/**
|
|
214
|
+
* Verify a tool manifest — attestor signature, optional implementation and
|
|
215
|
+
* metadata hashes, publisher identity (Part 1b), namespace governance
|
|
216
|
+
* (Part 2) and re-approval state (Part 3). Async because did:web resolution
|
|
217
|
+
* is async; the APS-native and raw-key paths resolve synchronously.
|
|
218
|
+
*/
|
|
219
|
+
export declare function verifyToolManifest(input: {
|
|
220
|
+
manifest: ToolManifest;
|
|
221
|
+
/** Attestor public key — used ONLY when the manifest asserts no
|
|
222
|
+
* `attestorDid`. When `attestorDid` is set the resolved key is
|
|
223
|
+
* authoritative and this key cannot override or substitute for it (G1). */
|
|
224
|
+
attestorPublicKey?: string;
|
|
225
|
+
/** Current implementation to hash-check, optional */
|
|
226
|
+
currentImplementation?: string | Buffer;
|
|
227
|
+
/** Current metadata to hash-check, optional */
|
|
228
|
+
currentMetadata?: ToolMetadata;
|
|
229
|
+
/** Known namespace claims — namespace check runs only when supplied */
|
|
230
|
+
namespaceClaims?: NamespaceClaim[];
|
|
231
|
+
/** Optional injected did:web resolver (offline use / tests) */
|
|
232
|
+
didWebResolver?: (didWeb: string) => Promise<object>;
|
|
233
|
+
}): Promise<ToolManifestResult>;
|
|
234
|
+
/** Create a signed namespace ownership claim. */
|
|
235
|
+
export declare function createNamespaceClaim(input: {
|
|
236
|
+
namespace: string;
|
|
237
|
+
ownerDid: string;
|
|
238
|
+
trustRoot: ToolTrustRoot;
|
|
239
|
+
ownerPrivateKey: string;
|
|
240
|
+
}): NamespaceClaim;
|
|
241
|
+
/**
|
|
242
|
+
* Verify a namespace claim — resolve the owner key via the claim's own trust
|
|
243
|
+
* root and check the owner signature over canonical `{namespace, ownerDid}`.
|
|
244
|
+
* `resolveOpts` carries an optional injected did:web resolver.
|
|
245
|
+
*/
|
|
246
|
+
export declare function verifyNamespaceClaim(claim: NamespaceClaim, resolveOpts?: ToolResolveOpts): Promise<{
|
|
247
|
+
valid: boolean;
|
|
248
|
+
ownerVerified: boolean;
|
|
249
|
+
resolutionMethod: string;
|
|
250
|
+
errors: string[];
|
|
251
|
+
}>;
|
|
252
|
+
/**
|
|
253
|
+
* Revise a tool manifest (Part 3). Produces a new manifest re-signed by the
|
|
254
|
+
* attestor. Hash-delta rule — the concrete link between Part 1a and Part 3:
|
|
255
|
+
* the revision moves to `pending-reapproval` with `metadataVersion + 1` IFF
|
|
256
|
+
* the implementation hash OR the metadata hash differs from the previous
|
|
257
|
+
* manifest. If neither hash changed it is not a substantive revision and the
|
|
258
|
+
* version / approval state are unchanged.
|
|
259
|
+
*
|
|
260
|
+
* The attestor identity (`attestorDid` / `attestorTrustRoot`) is carried
|
|
261
|
+
* forward. If the previous manifest asserts a `publisherDid`, a
|
|
262
|
+
* `publisherPrivateKey` MUST be supplied so the publisher field is re-signed
|
|
263
|
+
* over the revised body — revising a publisher-bearing manifest without it
|
|
264
|
+
* throws rather than emit a manifest with a stale publisher signature.
|
|
265
|
+
*/
|
|
266
|
+
export declare function reviseToolManifest(prevManifest: ToolManifest, changes: {
|
|
267
|
+
implementation?: string | Buffer;
|
|
268
|
+
metadata?: ToolMetadata;
|
|
269
|
+
}, attestorPrivateKey: string, opts?: {
|
|
270
|
+
verifiedAt?: string;
|
|
271
|
+
publisherPrivateKey?: string;
|
|
272
|
+
}): ToolManifest;
|
|
273
|
+
/**
|
|
274
|
+
* Re-approve a manifest pending re-approval (Part 3). Only an attestor can move
|
|
275
|
+
* `pending-reapproval` -> `approved`.
|
|
276
|
+
*
|
|
277
|
+
* The approval is bound to a resolved attestor identity, not merely any
|
|
278
|
+
* caller-provided keypair: the returned manifest carries `attestorDid` /
|
|
279
|
+
* `attestorTrustRoot`, and its signature then verifies against the resolved
|
|
280
|
+
* attestor key in `verifyToolManifest`. If `opts.attestorDid` is omitted the
|
|
281
|
+
* attestor identity already on the manifest is carried forward.
|
|
282
|
+
*
|
|
283
|
+
* If the manifest asserts a `publisherDid`, a `publisherPrivateKey` is required
|
|
284
|
+
* so the publisher field is re-signed over the approved body. Throws if the
|
|
285
|
+
* manifest is not pending re-approval, or on a missing required publisher key.
|
|
286
|
+
*/
|
|
287
|
+
export declare function reapproveToolManifest(manifest: ToolManifest, opts: {
|
|
288
|
+
attestorPrivateKey: string;
|
|
289
|
+
attestorDid?: string;
|
|
290
|
+
attestorTrustRoot?: ToolTrustRoot;
|
|
291
|
+
publisherPrivateKey?: string;
|
|
292
|
+
verifiedAt?: string;
|
|
293
|
+
}): ToolManifest;
|
|
75
294
|
//# sourceMappingURL=tool-integrity.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool-integrity.d.ts","sourceRoot":"","sources":["../../../src/core/tool-integrity.ts"],"names":[],"mappings":"AAiBA,yCAAyC;AACzC,MAAM,WAAW,iBAAiB;IAChC,0DAA0D;IAC1D,QAAQ,EAAE,MAAM,CAAA;IAChB,uFAAuF;IACvF,kBAAkB,EAAE,MAAM,CAAA;IAC1B,6EAA6E;IAC7E,UAAU,EAAE,MAAM,CAAA;IAClB,2CAA2C;IAC3C,UAAU,EAAE,MAAM,CAAA;IAClB,oFAAoF;IACpF,SAAS,EAAE,MAAM,CAAA;CAClB;AAED;yCACyC;AACzC,MAAM,WAAW,gBAAgB;IAC/B,4CAA4C;IAC5C,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,iCAAiC;IACjC,cAAc,CAAC,EAAE,MAAM,EAAE,CAAA;IACzB,gCAAgC;IAChC,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,kDAAkD;IAClD,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,qDAAqD;IACrD,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CACjC;AAED,oDAAoD;AACpD,MAAM,WAAW,mBAAmB;IAClC,yCAAyC;IACzC,KAAK,EAAE,OAAO,CAAA;IACd,8CAA8C;IAC9C,sBAAsB,EAAE,OAAO,CAAA;IAC/B,8CAA8C;IAC9C,sBAAsB,EAAE,OAAO,CAAA;IA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