/** * Agent-native onboarding contract. * * Two artefacts, one source: * * 1. `AGENT_SERVER_INSTRUCTIONS` — the MCP `instructions` string returned by * `initialize`. Every MCP client hands this to the model before the first * tool call, so it is the only onboarding channel that costs the human * zero configuration. It deliberately contains NO counts: a number in a * per-session prompt is a number that drifts. It teaches the *mechanism* * for finding the current numbers instead. * * 2. `captureAgentOnboardingDescriptor()` — the machine-readable descriptor * written to `docs/agent-onboarding.json` by * `scripts/generate-agent-onboarding.mjs`. It is captured through the real * MCP SDK against the real registration path, so the tool lists in it * cannot drift from the server: `npm run gate:agent-onboarding` re-captures * and byte-compares. * * Nothing here registers a tool, a resource or a prompt. The surface counts the * conformance baseline and the public capability contract already pin are * unchanged by this module, on purpose. */ export declare const AGENT_ONBOARDING_CONTRACT_VERSION = 1; /** Where an API key actually comes from — a deep link, not a navigation * instruction, so the human has one click instead of a hunt. * * Verified against the ERP: `settingsSectionToPath` renders `/settings/` * and `api` is in `ALL_SETTINGS_SECTIONS`, so this URL resolves to the * ApiKeysSettings panel. The old index.ts wording ("Settings > Developers > * API Keys") pointed at a section that does not exist. */ export declare const API_KEY_LOCATION = "https://app.frihet.io/settings/api"; export declare const AGENT_SERVER_INSTRUCTIONS = "Frihet ERP \u2014 real business and fiscal records. Read freely, propose before you mutate.\n\nAUTH\n- Local (stdio): FRIHET_API_KEY=fri_... \u2014 create one at https://app.frihet.io/settings/api.\n- No key yet: FRIHET_DEMO=1 serves example fixtures. No network call, nothing persisted, demo_-prefixed IDs, fiscal actions simulated.\n- Hosted: https://mcp.frihet.io/mcp \u2014 OAuth 2.1 + PKCE, or Authorization: Bearer fri_...\n\nORIENT BEFORE ACTING (read-only)\n- get_business_context \u2014 fiscal zone, currency, IRPF/IVA defaults, plan limits. Call this first; the correct tax treatment depends on it.\n- Resources frihet://tax/rates and frihet://tax/calendar carry the Spanish rate table (IVA / IGIC / IPSI) and the filing deadlines. Read them instead of recalling a rate.\n\nCAPABILITY DISCOVERY\n- Every tool in tools/list carries _meta[\"io.frihet/capability\"] = {callability, writesFrihet, externalInteraction, externalSideEffects}. Read it before you call.\n- callability is a conservative fact, not a promise: api_dependent | runtime_checked | deferred | unavailable | local. Registration does NOT mean the backing API is enabled for this workspace; deferred and unavailable tools will refuse.\n- Large surface: set FRIHET_TOOL_MODE=grouped for progressive disclosure (list_tool_groups, search_tools, describe_tool) instead of loading every schema.\n\nTHE SAFE WORKFLOW \u2014 draft, show, stop\n- create_invoice defaults to status=draft: no fiscal number, no hash, nothing submitted to a tax authority. create_quote and create_credit_note are drafts too.\n- Build the draft, read it back, present it to the human, and stop there. Issuing is a separate, human-authorised step.\n\nHUMAN AUTHORITY \u2014 do not call unprompted\n- Any tool whose capability shows a non-empty externalSideEffects reaches outside Frihet \u2014 email to a client, webhook delivery, money movement, or a submission to AEAT / VeriFactu / TicketBAI / FACe. You cannot undo those.\n- Several also take confirm=true. That flag records the human's decision. Never set it to satisfy your own plan; ask, then pass what you were told.\n- delete_invoice does not always delete: an issued invoice is CANCELLED (status=cancelled) because VeriFactu forbids breaking the hash chain. Same for quotes.\n\nWHEN A CALL FAILS\n- Errors carry sanitized remediation text \u2014 read it, do not guess. 401 = key; 403 = scope or plan; 429 = wait Retry-After seconds.\n- After 409 IDEMPOTENCY_REQUEST_IN_PROGRESS, do NOT retry with a fresh Idempotency-Key. Read the resource back and decide from its actual state; a new key would create a second fiscal document.\n\nMachine-readable version of this contract: https://github.com/Frihet-io/frihet-mcp/blob/main/docs/agent-onboarding.json"; export interface AgentOnboardingDescriptor { onboardingContractVersion: number; server: { mcpName: string; npmPackage: string; remoteEndpoint: string; transport: readonly string[]; }; auth: { envVar: string; keyFormat: string; obtainAt: string; remoteMethods: readonly string[]; noAuthTrial: { env: Record; persists: false; network: false; }; }; /** One verified command per client. Every `command` here was executed against * the real binary in an isolated HOME before being written down. */ quickstart: Record; capabilityDiscovery: { metaKey: string; callabilityValues: readonly string[]; groupedModeEnv: Record; counts: { toolNames: number; readOnly: number; writesFrihet: number; externalInteraction: number; destructive: number; resources: number; prompts: number; }; }; safeWorkflow: { description: string; steps: readonly { call: string; kind: string; note: string; }[]; }; humanAuthority: { rule: string; confirmRequired: readonly string[]; externalSideEffects: readonly { tool: string; effects: readonly string[]; }[]; }; errors: readonly { condition: string; meaning: string; agentAction: string; }[]; } export declare function captureAgentOnboardingDescriptor(): Promise; export declare function serializeAgentOnboardingDescriptor(descriptor: AgentOnboardingDescriptor): string; //# sourceMappingURL=agent-onboarding.d.ts.map