/** * kvMemory.js — general-purpose, per-agent persistent key-value skill. * * WHAT IT IS * ────────── * A hand-written multi-tool skill (same shape as reviewMemory.js / github.js): * `serverName`, `allowedTools`, `tools[]`, `handleToolCall`, and a `resolve()` * that spawns the GENERIC bin/mcp-skill.mjs. It gives ANY agent (github-ai-scout * for dedup, future agents, etc.) a durable key→value store across stateless * Fargate runs. * * RELATIONSHIP TO review-memory (REUSE, NOT FORK) * ─────────────────────────────────────────────── * This skill hits the EXACT SAME backend route, ops, auth, and DDB table as * reviewMemory.js — POST {base}/credits/review-memory with a body { op, ... } * where op ∈ 'store' | 'recall' | 'recall-prefix' (served by the CreditsApi * nested stack; basePath '/credits' stripped → handler sees '/review-memory'). * There is NO backend change and NO new table. review-memory.js is left 100% * untouched. * * THE ONE BEHAVIORAL ADDITION — AUTOMATIC PER-AGENT NAMESPACING * ───────────────────────────────────────────────────────────── * review-memory makes the caller pass a `scope` STRING verbatim, and per-agent * isolation today is a CONVENTION (each caller manually prefixes its scope). * This skill removes that footgun: the agent-facing tools take a PLAIN `key` * (or `keyPrefix`), and the skill itself derives the backend scope: * * effective backend scope = `${WORKFLOW_TYPE}:${key}` * * `WORKFLOW_TYPE` is injected into every Fargate run by the workflow-executor * (backend/src/services/workflow-executor.js). If it's absent (local dev, a * runtime that doesn't set it) we fall back to the literal `'agent'` so the * skill NEVER crashes. Two different workflow types therefore land on disjoint * SKs for the same key (e.g. 'github-ai-scout:seen#42' vs * 'github-code-review:seen#42'), and both live in a distinct SK space from * review-memory's 'review:...' scopes — zero collision in the same per-project * partition (PK = `#`, derived by the backend from the * Bearer token, never from anything the skill sends). * * AUTH — identical to 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 const kvMemorySkill: any;