@saw-protocol/observer-console
v1.0.8
Published
Terminal-based Observer implementation for the SAW Protocol
Downloads
1,053
Readme
@saw-protocol/observer-console
The primary diagnostic tool and local IObserver implementation for the SAWP Protocol.
By default, it hooks into the overarching Protocol SDK and elegantly logs explicit, color-coded execution pipelines seamlessly to your command-line interface. Everything executed across the Wallet, Policy Engine, and Sandbox is tracked independently giving complete transparency to what the autonomous Agent is modifying over time.
Installation
npm install @saw-protocol/observer-consoleExample Usage
import { ConsoleObserver } from "@saw-protocol/observer-console";
const observer = new ConsoleObserver();
// ... Once plugged into the SAWP SDK, it automatically logs colored entries!
// -------------------------------------------------------------------------
// [SAWP OBSERVER] Receipt Captured
// Agent ID: did:sol:agentAlice
// Wallet: EBNxXgPqFvHh3fH4FjP1oP1...
// Outcome: success
// Signature: 4b1VbU2jV3f... (Solana Tx)
// Policies: 3 checks run (0 failed)
// -------------------------------------------------------------------------
// You can query explicitly against the observer in-memory array!
const agentReceipts = await observer.query({
agentId: "did:sol:agentAlice",
outcome: "failed", // Only show failing intent receipts
});
// Or subscribe to specific Agent Execution pipelines dynamically!
const unsubscribeFn = observer.subscribe("did:sol:agentAlice", (receipt) => {
if (receipt.outcome === "sandboxViolation") {
console.error("Critical System Warning: Sandbox was breached cleanly.");
}
});