@vallum/marketplace 0.0.0-prerelease → 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/README.md +7 -0
- package/dist/index.d.ts +38 -0
- package/dist/index.js +93 -2
- package/package.json +7 -7
package/README.md
CHANGED
|
@@ -7,3 +7,10 @@ registry profiles, policy compatibility, contract template metadata, receipts,
|
|
|
7
7
|
manifests, and standards bridge evidence. It does not operate a marketplace,
|
|
8
8
|
onboard providers, settle payments, custody funds, verify providers, moderate
|
|
9
9
|
listings, or contact live IOTA/x402/AP2/A2A services.
|
|
10
|
+
|
|
11
|
+
It also exposes a status-only production review snapshot builder. The snapshot
|
|
12
|
+
tracks the required provider, moderation, access-control, settlement, dispute,
|
|
13
|
+
operations, incident-response, and redaction review checks as `pending`,
|
|
14
|
+
`passed`, or `blocked`, with redacted notes and explicit blocker codes. Missing
|
|
15
|
+
operator checks remain pending; a local snapshot is preparation material, not
|
|
16
|
+
production marketplace proof.
|
package/dist/index.d.ts
CHANGED
|
@@ -6,6 +6,10 @@ import { type AgentProfileStatus } from "@vallum/registry";
|
|
|
6
6
|
export type MarketplaceEvidenceLevel = "mock" | "local" | "testnet" | "live";
|
|
7
7
|
export type MarketplaceProfileLabel = AgentProfileStatus | "unverified";
|
|
8
8
|
export type MarketplaceRole = "buyer" | "provider" | "operator" | "reviewer";
|
|
9
|
+
export type MarketplaceProductionEnvironment = "local" | "testnet" | "production";
|
|
10
|
+
export type MarketplaceProductionReviewStatus = "pending" | "passed" | "blocked";
|
|
11
|
+
export type MarketplaceProductionReviewResult = "pending-operator-proof" | "passed" | "blocked";
|
|
12
|
+
export type MarketplaceProductionReviewCheckId = "provider-onboarding-review" | "provider-verification-review" | "provider-capability-review" | "moderation-abuse-review" | "session-auth-review" | "receipt-access-review" | "payment-settlement-review" | "settlement-reconciliation-review" | "dispute-workflow-review" | "operations-incident-review" | "incident-response-review" | "redaction-review";
|
|
9
13
|
export type MarketplaceReceipt = EscrowReceipt | PayPerCallReceipt | DataLicenseReceipt | ServiceBountyReceipt | ReputationReceipt | SubscriptionReceipt;
|
|
10
14
|
export interface MarketplaceViewer {
|
|
11
15
|
readonly principalId: string;
|
|
@@ -17,6 +21,17 @@ export interface MarketplaceStandardsEvidence {
|
|
|
17
21
|
readonly referenceId: string;
|
|
18
22
|
readonly metadata?: Record<string, unknown>;
|
|
19
23
|
}
|
|
24
|
+
export interface MarketplaceProductionReviewCheckInput {
|
|
25
|
+
readonly id: MarketplaceProductionReviewCheckId;
|
|
26
|
+
readonly status: MarketplaceProductionReviewStatus;
|
|
27
|
+
readonly observedAt?: Date | string;
|
|
28
|
+
readonly note?: string;
|
|
29
|
+
}
|
|
30
|
+
export interface CreateMarketplaceProductionReviewSnapshotInput {
|
|
31
|
+
readonly environment: MarketplaceProductionEnvironment;
|
|
32
|
+
readonly checks?: readonly MarketplaceProductionReviewCheckInput[];
|
|
33
|
+
readonly generatedAt?: Date;
|
|
34
|
+
}
|
|
20
35
|
export interface MarketplaceProviderListingInput {
|
|
21
36
|
readonly providerId: string;
|
|
22
37
|
readonly profile: unknown;
|
|
@@ -116,12 +131,35 @@ export interface MarketplaceReadModelDemoResult {
|
|
|
116
131
|
readonly buyerReceiptAllowed: boolean;
|
|
117
132
|
readonly strangerReceiptAllowed: boolean;
|
|
118
133
|
readonly disputeBundleHash: string;
|
|
134
|
+
readonly productionReviewResult: MarketplaceProductionReviewResult;
|
|
135
|
+
readonly productionReviewPendingChecks: readonly MarketplaceProductionReviewCheckId[];
|
|
119
136
|
readonly logLeaksSecretMaterial: boolean;
|
|
120
137
|
}
|
|
138
|
+
export interface MarketplaceProductionReviewSnapshot {
|
|
139
|
+
readonly schemaVersion: 1;
|
|
140
|
+
readonly kind: "vallum.marketplace-production-review-snapshot";
|
|
141
|
+
readonly result: MarketplaceProductionReviewResult;
|
|
142
|
+
readonly environment: MarketplaceProductionEnvironment;
|
|
143
|
+
readonly generatedAt: string;
|
|
144
|
+
readonly requiredCheckIds: readonly MarketplaceProductionReviewCheckId[];
|
|
145
|
+
readonly passedCheckIds: readonly MarketplaceProductionReviewCheckId[];
|
|
146
|
+
readonly pendingCheckIds: readonly MarketplaceProductionReviewCheckId[];
|
|
147
|
+
readonly blockedCheckIds: readonly MarketplaceProductionReviewCheckId[];
|
|
148
|
+
readonly blockerCodes: readonly string[];
|
|
149
|
+
readonly checks: readonly MarketplaceProductionReviewCheck[];
|
|
150
|
+
readonly boundaries: readonly string[];
|
|
151
|
+
}
|
|
152
|
+
export interface MarketplaceProductionReviewCheck {
|
|
153
|
+
readonly id: MarketplaceProductionReviewCheckId;
|
|
154
|
+
readonly status: MarketplaceProductionReviewStatus;
|
|
155
|
+
readonly observedAt?: string;
|
|
156
|
+
readonly note?: string;
|
|
157
|
+
}
|
|
121
158
|
type MarketplaceWorkflow = "escrow" | "pay_per_call" | "data_license" | "service_bounty" | "reputation_receipt" | "subscription";
|
|
122
159
|
export declare function createMarketplaceProviderListing(input: MarketplaceProviderListingInput): MarketplaceProviderListing;
|
|
123
160
|
export declare function createMarketplaceReceiptView(input: CreateMarketplaceReceiptViewInput): MarketplaceReceiptViewResult;
|
|
124
161
|
export declare function createDisputeEvidenceBundle(input: CreateDisputeEvidenceBundleInput): MarketplaceDisputeEvidenceBundle;
|
|
162
|
+
export declare function createMarketplaceProductionReviewSnapshot(input: CreateMarketplaceProductionReviewSnapshotInput): MarketplaceProductionReviewSnapshot;
|
|
125
163
|
export declare function runMarketplaceReadModelDemo(): MarketplaceReadModelDemoResult;
|
|
126
164
|
export declare function formatMarketplaceReadModelDemoResult(result: MarketplaceReadModelDemoResult): string;
|
|
127
165
|
export declare class MarketplaceAccessError extends Error {
|
package/dist/index.js
CHANGED
|
@@ -4,6 +4,25 @@ import { validManifestFixture } from "@vallum/manifest";
|
|
|
4
4
|
import { evaluateProfileCapabilityPolicy, } from "@vallum/policy-gateway";
|
|
5
5
|
import { approveServiceBountyReceipt, completeServiceBountyReceipt, createServiceBountyReceipt, releaseServiceBountyReceipt, sponsorServiceBountyReceipt, submitServiceBountyReceipt, } from "@vallum/receipts";
|
|
6
6
|
import { validateAgentProfile, validAgentProfileFixture, } from "@vallum/registry";
|
|
7
|
+
const MARKETPLACE_PRODUCTION_REVIEW_CHECKS = [
|
|
8
|
+
"provider-onboarding-review",
|
|
9
|
+
"provider-verification-review",
|
|
10
|
+
"provider-capability-review",
|
|
11
|
+
"moderation-abuse-review",
|
|
12
|
+
"session-auth-review",
|
|
13
|
+
"receipt-access-review",
|
|
14
|
+
"payment-settlement-review",
|
|
15
|
+
"settlement-reconciliation-review",
|
|
16
|
+
"dispute-workflow-review",
|
|
17
|
+
"operations-incident-review",
|
|
18
|
+
"incident-response-review",
|
|
19
|
+
"redaction-review",
|
|
20
|
+
];
|
|
21
|
+
const MARKETPLACE_PRODUCTION_REVIEW_BOUNDARIES = [
|
|
22
|
+
"This snapshot is status-only and does not prove production marketplace readiness by itself.",
|
|
23
|
+
"Missing checks stay pending until an operator-approved review supplies passing evidence.",
|
|
24
|
+
"Do not include provider records, session data, authorization headers, payment credentials, raw payloads, moderation evidence, sensitive prompt text, signatures, or local secret paths.",
|
|
25
|
+
];
|
|
7
26
|
export function createMarketplaceProviderListing(input) {
|
|
8
27
|
const validation = validateAgentProfile(input.profile, { now: input.now });
|
|
9
28
|
const profile = validation.ok ? validation.profile : undefined;
|
|
@@ -87,6 +106,41 @@ export function createDisputeEvidenceBundle(input) {
|
|
|
87
106
|
...redacted,
|
|
88
107
|
};
|
|
89
108
|
}
|
|
109
|
+
export function createMarketplaceProductionReviewSnapshot(input) {
|
|
110
|
+
const supplied = new Map();
|
|
111
|
+
for (const check of input.checks ?? []) {
|
|
112
|
+
supplied.set(check.id, check);
|
|
113
|
+
}
|
|
114
|
+
const checks = MARKETPLACE_PRODUCTION_REVIEW_CHECKS.map((id) => {
|
|
115
|
+
const check = supplied.get(id);
|
|
116
|
+
return {
|
|
117
|
+
id,
|
|
118
|
+
status: check?.status ?? "pending",
|
|
119
|
+
...(check?.observedAt ? { observedAt: isoString(check.observedAt) } : {}),
|
|
120
|
+
...(check?.note ? { note: redactString(check.note) } : {}),
|
|
121
|
+
};
|
|
122
|
+
});
|
|
123
|
+
const passedCheckIds = checks.filter((check) => check.status === "passed").map((check) => check.id);
|
|
124
|
+
const pendingCheckIds = checks.filter((check) => check.status === "pending").map((check) => check.id);
|
|
125
|
+
const blockedCheckIds = checks.filter((check) => check.status === "blocked").map((check) => check.id);
|
|
126
|
+
return {
|
|
127
|
+
schemaVersion: 1,
|
|
128
|
+
kind: "vallum.marketplace-production-review-snapshot",
|
|
129
|
+
result: productionReviewResult({ pendingCheckIds, blockedCheckIds }),
|
|
130
|
+
environment: input.environment,
|
|
131
|
+
generatedAt: (input.generatedAt ?? new Date()).toISOString(),
|
|
132
|
+
requiredCheckIds: MARKETPLACE_PRODUCTION_REVIEW_CHECKS,
|
|
133
|
+
passedCheckIds,
|
|
134
|
+
pendingCheckIds,
|
|
135
|
+
blockedCheckIds,
|
|
136
|
+
blockerCodes: [
|
|
137
|
+
...pendingCheckIds.map((id) => `MARKETPLACE_${constantCase(id)}_PENDING`),
|
|
138
|
+
...blockedCheckIds.map((id) => `MARKETPLACE_${constantCase(id)}_BLOCKED`),
|
|
139
|
+
],
|
|
140
|
+
checks,
|
|
141
|
+
boundaries: MARKETPLACE_PRODUCTION_REVIEW_BOUNDARIES,
|
|
142
|
+
};
|
|
143
|
+
}
|
|
90
144
|
export function runMarketplaceReadModelDemo() {
|
|
91
145
|
const now = new Date("2026-06-10T12:00:00.000Z");
|
|
92
146
|
const receipt = appendMarketplaceDiagnosticEvent(createReleasedServiceBountyReceipt({
|
|
@@ -142,13 +196,33 @@ export function runMarketplaceReadModelDemo() {
|
|
|
142
196
|
standardsEvidence: [{ protocol: "a2a", status: "local", referenceId: "a2a-local-server-smoke" }],
|
|
143
197
|
viewer: { principalId: "operator:demo", role: "operator" },
|
|
144
198
|
});
|
|
145
|
-
const
|
|
199
|
+
const productionReview = createMarketplaceProductionReviewSnapshot({
|
|
200
|
+
environment: "local",
|
|
201
|
+
generatedAt: now,
|
|
202
|
+
checks: [
|
|
203
|
+
{
|
|
204
|
+
id: "receipt-access-review",
|
|
205
|
+
status: "passed",
|
|
206
|
+
observedAt: now,
|
|
207
|
+
note: "Local receipt access model passed without session-id=session_secret_123.",
|
|
208
|
+
},
|
|
209
|
+
{
|
|
210
|
+
id: "redaction-review",
|
|
211
|
+
status: "passed",
|
|
212
|
+
observedAt: now,
|
|
213
|
+
note: "Local redaction removed private prompt and Bearer abc.def.ghi values.",
|
|
214
|
+
},
|
|
215
|
+
],
|
|
216
|
+
});
|
|
217
|
+
const serialized = JSON.stringify({ listing, buyer, stranger, bundle, productionReview });
|
|
146
218
|
return {
|
|
147
219
|
providerProfileLabel: listing.profileLabel,
|
|
148
220
|
policyAllowed: listing.policyCompatibility.allowed,
|
|
149
221
|
buyerReceiptAllowed: buyer.allowed,
|
|
150
222
|
strangerReceiptAllowed: stranger.allowed,
|
|
151
223
|
disputeBundleHash: bundle.bundleHash,
|
|
224
|
+
productionReviewResult: productionReview.result,
|
|
225
|
+
productionReviewPendingChecks: productionReview.pendingCheckIds,
|
|
152
226
|
logLeaksSecretMaterial: responseLeaks(serialized),
|
|
153
227
|
};
|
|
154
228
|
}
|
|
@@ -160,6 +234,8 @@ export function formatMarketplaceReadModelDemoResult(result) {
|
|
|
160
234
|
`buyerReceipt.allowed=${result.buyerReceiptAllowed}`,
|
|
161
235
|
`strangerReceipt.allowed=${result.strangerReceiptAllowed}`,
|
|
162
236
|
`dispute.bundleHash=${result.disputeBundleHash}`,
|
|
237
|
+
`productionReview.result=${result.productionReviewResult}`,
|
|
238
|
+
`productionReview.pendingChecks=${result.productionReviewPendingChecks.length}`,
|
|
163
239
|
`logLeaksSecretMaterial=${result.logLeaksSecretMaterial}`,
|
|
164
240
|
].join("\n");
|
|
165
241
|
}
|
|
@@ -326,6 +402,19 @@ function visibility(viewer) {
|
|
|
326
402
|
return "reviewer";
|
|
327
403
|
return "party";
|
|
328
404
|
}
|
|
405
|
+
function productionReviewResult(input) {
|
|
406
|
+
if (input.blockedCheckIds.length > 0)
|
|
407
|
+
return "blocked";
|
|
408
|
+
if (input.pendingCheckIds.length > 0)
|
|
409
|
+
return "pending-operator-proof";
|
|
410
|
+
return "passed";
|
|
411
|
+
}
|
|
412
|
+
function isoString(value) {
|
|
413
|
+
return value instanceof Date ? value.toISOString() : value;
|
|
414
|
+
}
|
|
415
|
+
function constantCase(value) {
|
|
416
|
+
return value.replace(/[^a-z0-9]+/gi, "_").replace(/^_+|_+$/g, "").toUpperCase();
|
|
417
|
+
}
|
|
329
418
|
function pickString(record, key) {
|
|
330
419
|
const value = stringValue(record[key]);
|
|
331
420
|
return value ? { [key]: value } : {};
|
|
@@ -352,12 +441,14 @@ function redactString(value) {
|
|
|
352
441
|
return value
|
|
353
442
|
.replace(/Bearer\s+[A-Za-z0-9._-]+/gi, "[REDACTED]")
|
|
354
443
|
.replace(/private prompt[^,.]*/gi, "[REDACTED]")
|
|
444
|
+
.replace(/\bsession[-_ ]?id\s*[:=]\s*[A-Za-z0-9._:-]+/gi, "[REDACTED]")
|
|
445
|
+
.replace(/\b(token|credential|authorization|payment secret)\s*[:=]\s*[A-Za-z0-9._:-]+/gi, "[REDACTED]")
|
|
355
446
|
.replace(/signer_ref[\w:-]*/gi, "[REDACTED]")
|
|
356
447
|
.replace(/wallet_[\w:-]*/gi, "[REDACTED]")
|
|
357
448
|
.replace(/payment-secret/gi, "[REDACTED]");
|
|
358
449
|
}
|
|
359
450
|
function responseLeaks(text) {
|
|
360
|
-
return /private prompt|Bearer abc|signer_ref|wallet_demo|payment-secret|secret provider|PRIVATE KEY|BEGIN PRIVATE/i.test(text);
|
|
451
|
+
return /private prompt|Bearer abc|signer_ref|wallet_demo|payment-secret|session_secret|secret provider|PRIVATE KEY|BEGIN PRIVATE/i.test(text);
|
|
361
452
|
}
|
|
362
453
|
function stableStringify(value) {
|
|
363
454
|
if (Array.isArray(value))
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vallum/marketplace",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.1.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -12,11 +12,11 @@
|
|
|
12
12
|
},
|
|
13
13
|
"license": "Apache-2.0",
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@vallum/contracts-metadata": "0.
|
|
16
|
-
"@vallum/manifest": "0.
|
|
17
|
-
"@vallum/policy-gateway": "0.
|
|
18
|
-
"@vallum/receipts": "0.
|
|
19
|
-
"@vallum/registry": "0.
|
|
15
|
+
"@vallum/contracts-metadata": "0.1.0",
|
|
16
|
+
"@vallum/manifest": "0.1.0",
|
|
17
|
+
"@vallum/policy-gateway": "0.1.0",
|
|
18
|
+
"@vallum/receipts": "0.1.0",
|
|
19
|
+
"@vallum/registry": "0.1.0"
|
|
20
20
|
},
|
|
21
21
|
"description": "Read-only local marketplace evidence views for Vallum.",
|
|
22
22
|
"files": [
|
|
@@ -34,6 +34,6 @@
|
|
|
34
34
|
},
|
|
35
35
|
"publishConfig": {
|
|
36
36
|
"access": "public",
|
|
37
|
-
"tag": "
|
|
37
|
+
"tag": "latest"
|
|
38
38
|
}
|
|
39
39
|
}
|