Skip to content
Pre-alpha / current reality

Pre-alpha. Detection is off until you configure it. SDKs are unpublished. The hosted service is not available yet. Nothing has run against production traffic.

TypeScript / Node

sdks / v1

Create and await ready

@agindow/node 0.1.0-alpha.0, unpublished. Node 22+, ESM/CJS and declarations. The local WASM guest needs wasm32-unknown-unknown and wasm-bindgen CLI 0.2.129 at build time. createAgindow returns an SDK instance. Await sdk.ready, a settling Promise; loading failure remains a bypass and does not become successful protection.

guard, wrap and adapters

sdk.guard(fn, options) retains sync/async behavior, receiver, arguments, original exceptions and no-repair result identity. sdk.wrap selects a supported boundary. sdk.toolAdapter, sdk.clientAdapter and sdk.httpAdapter expose explicit adapters. Module exports guard and wrap use the default instance. HTTP streaming and framework batch paths have explicit capture limits; no universal framework adapter is implied.

configure and mode resolution

sdk.configure changes later calls. Resolution at construction is explicit > environment > nearest JSON .agindowrc > defaults. Calls freeze configuration through completion. Default mode is observe and default engine is NullEngine: no detection or repair. Use operation: write or unknown explicitly for writes; generic callables default to read. Later configure updates can supersede existing guard options for future calls.

Events, audit and explicit remote API

sdk.on returns an unsubscribe callback; sdk.recent returns bounded retained metadata. Optional audit requires explicit tenant options and sdk.drainAudit host delivery. guardRemote is a separate opt-in HTTP API, never the default guard. Write fallbacks require upstream-enforced idempotency. Default-guest selective repair, durable replay and hosted delivery remain unavailable.

Validated TypeScript fixture

Save and run the following after installing the local archive. The deliberate unavailable-engine case is labelled synthetic, preserves identity and emits one bypass.

Continue

Local interfaces are usable before registry publication. Choose the transport explicitly.

import { createAgindow } from '@agindow/node';
const sdk = createAgindow({ mode: 'observe' });
await sdk.ready;
const payload = { id: 'synthetic-customer' };
let calls = 0;
const read = sdk.guard(() => { calls++; return payload; }, { tool: 'vendor.read', operation: 'read' });
const result = read();
if (result !== payload || calls !== 1) throw Error('Fixture identity changed');
// A labelled unavailable-engine fixture produces one bypass without a hosted key.
const unavailable = createAgindow({ mode: 'observe' }, async () => { throw Error('Synthetic loading fault'); });
await unavailable.ready;
const fallback = unavailable.wrap(() => payload);
if (fallback() !== payload || unavailable.recent().filter(e => e.type === 'bypass').length !== 1) throw Error('Missing bypass');
sdk.configure({ mode: 'observe' });
console.log('Synthetic fixture: original result retained; unavailable engine bypassed once.');