/** * datasetStore.js — durable, queryable structured-artifact store skill. * * WHAT IT IS * ────────── * A hand-written multi-tool skill (same shape as kvMemory.js / reviewMemory.js / * github.js): `serverName`, `allowedTools`, `tools[]`, `handleToolCall`, and a * `resolve()` that spawns the GENERIC bin/mcp-skill.mjs. Unlike kv-memory (a * key→value MEMORY for picking up where a prior run left off), this is a durable * STRUCTURED-RECORD store: an agent appends arbitrary JSON records to a named * store and later runs SQL-style queries/aggregations over them — e.g. to * accumulate metrics across runs and produce a report. * * STORES v2 — NAME-BASED RESOLUTION (the shared contract) * ──────────────────────────────────────────────────────── * Stores are auto-provisioned at DEPLOY and resolved at runtime BY NAME via env: * - The run carries one `ZIBBY_STORE__ = ` per bound store. * - The agent reads the injected "AVAILABLE STORES" prompt catalog (name + * description), picks one, and passes the chosen logical `name` to the tool. * - This name→storeId env map is BOTH the allowlist AND the resolver: the * agent can only ever write to a declared/bound name (anti-fragmentation). * * BACKEND (already built — NO change here) * ───────────────────────────────────────── * Two routes on the SAME base URL kv-memory uses (getAccountApiUrl(), prod * https://api-prod.zibby.app), authed with the SAME Bearer project token * (getSessionToken()): * - POST {base}/datasets/stores/{storeId}/append body { record, agent } * → { ok, id, ts } * - POST {base}/datasets/stores/{storeId}/query body { select?, where?, * groupBy?, orderBy?, limit?, since?, until?, agent? } * → { ok, rowCount, columns, rows } * Plus the per-type data routes on the same base: /sql (sqlite stores) and * /put /get /list /delete (file stores — blob storage by relative path). * The `storeId` lives in the URL path. Tenancy (account + project) is enforced * SERVER-SIDE from the Bearer token — the skill NEVER sends account/project. * * AUTOMATIC PER-AGENT TAGGING * ──────────────────────────── * Appends default `agent` to the writing agent's namespace (WORKFLOW_TYPE, * falling back to the literal 'agent'), so records are auto-tagged with who * wrote them and `query`'s optional `agent` filter can scope to one writer. * * AUTH — identical to kvMemory.js / reviewMemory.js * ────────────────────────────────────────────────── * Calls ZIBBY'S OWN backend with PROJECT_API_TOKEN (Bearer) against * ZIBBY_ACCOUNT_API_URL (default api-prod.zibby.app). Mirrors * @zibby/core/backend-client.js getSessionToken()/getAccountApiUrl() rather than * importing a non-existent helper, so the auth model stays identical. */ export declare function __clearEnsuredStores(): void; export declare const datasetStoreSkill: any;