@agora-protocol/sandbox
v0.3.3
Published
ACP sandbox: test agents, conformance suite, ACP Compliant certificate generator
Maintainers
Readme
@agora-protocol/sandbox
Sandbox rooms, scenario agents, and the conformance test suite for the ACP Protocol. Emits the ACP Compliant certificate.
Install
npm install @agora-protocol/sandboxCertify your implementation
import {
buildCertificate,
ConformanceRunner,
renderCertificateMarkdown,
SandboxRoom,
} from "@agora-protocol/sandbox";
const runner = ConformanceRunner.default();
const sandbox = new SandboxRoom();
const report = runner.run(() => {
const { controllerA, keys } = sandbox.create();
return { controller: controllerA, keys };
});
const certificate = buildCertificate(report, { sdkVersion: "0.3.1" });
console.log(renderCertificateMarkdown(certificate));What's inside
SandboxRoom— creates a test room withrules.sandbox = true(reputation no-op, spec §24).- Scenario agents:
EchoAgent,TestNegotiator,TestDifficult,TestMalicious. ConformanceRunner— runs registered test suites against a user-suppliedRoomControllerfactory.- Built-in suites (25 tests at v0.3.0):
message-format,lifecycle,error-recovery,security. buildCertificate/renderCertificateMarkdown— turns aConformanceReportinto a signed-readyConformanceCertificatewith a stablereport_hash: sha256:…preimage.
Demo CLI
See packages/sdk/examples/conformance-demo.ts in the monorepo for a runnable example that writes JSON + Markdown certificate artifacts.
License
MIT
