import type { Money } from './beacon-mcp-tools-v1.js'; export type { Money }; export declare const BEACON_ASSETS_REGISTRY_PATH: "/v1/beacon/assets/registry"; /** PATCH single asset — 实现端按此模板拼接 :asset_id */ export declare const BEACON_ASSETS_REGISTRY_ITEM_PATH: "/v1/beacon/assets/registry/:asset_id"; /** 跨工作空间的契约版本标记 */ export declare const BEACON_ASSETS_PROTOCOL_VERSION: "v1"; /** * 资产类型。 * 与 beacon-mcp-tools-v1.ts AssetCategory 几乎一致,本契约多一个 'vps'(因为 * Web Dashboard 用户会录入 VPS 续费,但 MCP tool 暂不直接 query VPS)。 */ export type AssetType = 'domain' | 'ssl' | 'vps' | 'card' | 'api_balance' | 'subscription'; /** 严重度阶梯,与 beacon-mcp-tools-v1.ts AssetSeverity 对齐 */ export type AssetSeverity = 'low' | 'medium' | 'high' | 'critical' | 'emergency'; /** * 监控状态机: * active ↔ paused (用户主动暂停 / 恢复) * active → expired (Brain cron 自动迁移,过期日已过) * expired → active (用户在 PATCH 中 reset 续费日期 → 自动复活为 active) */ export type AssetMonitorStatus = 'active' | 'paused' | 'expired'; /** * 资产清单 row。POST 创建时 asset_id 由 Brain 生成;PATCH 更新时必传 asset_id。 */ export interface AssetEntry { /** UUID 或语义化 id;client / Web 都按此 key 缓存与去重 */ asset_id: string; asset_type: AssetType; /** 用户可读名字,e.g. 'skillfm.com' / 'aws-vps-tokyo' */ asset_name: string; /** 服务商,e.g. 'godaddy' / 'aws' / 'visa-7799' */ provider?: string; /** ISO 8601 UTC,过期 / 续费 / 余额耗尽时点 */ expires_at: string; /** 续费预估成本(可选) */ estimated_renewal_cost?: Money; /** 监控状态,见 §2 状态机 */ monitor_status: AssetMonitorStatus; /** Brain 计算字段:距今天数(可负,负值表示已过期 N 天) */ days_remaining?: number; /** Brain 计算字段:严重度;client 用此渲染颜色 */ severity?: AssetSeverity; /** 续费 / 充值 / 更新跳转链接 */ action_url?: string; /** * 任意去敏机读字段。⚠️ 与 beacon-usage-v1.ts 同样的 BYOK 红线 — 禁止 cookie / api_key / * payment_card_no 等敏感原文(只允许 e.g. 'last4': '7799' / 'auto_renew': true)。 */ metadata?: Record; /** ISO 8601 UTC */ created_at?: string; updated_at?: string; } /** 请求 query params */ export interface BeaconAssetsListRequestQuery { /** 默认 30 天内;Free 用户 handler 强制 ≤ 7 */ withinDays?: number; /** 'all' = 全部分类;省略亦视作 'all' */ category?: AssetType | 'all'; /** 默认 active;internal 工具可置 'all' 看含 paused / expired */ monitor_status?: AssetMonitorStatus | 'all'; /** 仅返回 severity ≥ 此值;handler 比 enum order */ min_severity?: AssetSeverity; } /** 请求 headers */ export interface BeaconAssetsRequestHeaders { /** v0.2 一致:长效 agent_token(client) 或 Web Dashboard session token */ 'X-Agent-Token': string; 'X-Skillfm-Local-Version'?: string; 'Content-Type'?: 'application/json'; Accept?: 'application/json'; } /** 200 OK 响应 */ export interface BeaconAssetsListResponse { /** * Free 用户 handler 端只返回 critical+ 且 ≤ 7 天的子集,且部分字段(metadata / * estimated_renewal_cost)被 mask;Pro 用户返回全集。client 不应自行二次过滤。 */ items: AssetEntry[]; /** 服务端时间戳,client 可用作 etag */ generated_at: string; /** Free 用户专属:升级 hint(中英) */ pro_upgrade_hint?: { en: string; zh: string; }; } /** 创建资产请求 body — asset_id 由 Brain 生成,故请求中**不**带 */ export interface BeaconAssetsCreateRequest { asset_type: AssetType; asset_name: string; expires_at: string; provider?: string; estimated_renewal_cost?: Money; /** 默认 'active' */ monitor_status?: AssetMonitorStatus; action_url?: string; metadata?: Record; } /** 201 Created 响应 — Brain 回填 asset_id + severity + days_remaining */ export interface BeaconAssetsCreateResponse { asset: AssetEntry; } /** * PATCH 请求 body — 全部字段都是可选,只更新提供的字段。 * 典型用法: * - { expires_at: '2027-04-30T00:00:00Z' } 用户续了一年 * - { monitor_status: 'paused' } 临时暂停某资产监控 * - { monitor_status: 'active', expires_at: ... } 从 expired 复活 */ export interface BeaconAssetsPatchRequest { asset_name?: string; provider?: string; expires_at?: string; estimated_renewal_cost?: Money; monitor_status?: AssetMonitorStatus; action_url?: string; metadata?: Record; } /** 200 OK 响应 — 返回更新后的 full row */ export interface BeaconAssetsPatchResponse { asset: AssetEntry; } export declare const BEACON_ASSETS_ERROR_CODES: { readonly AUTH_MISSING_TOKEN: "BEACON.ASSETS.AUTH.MISSING_TOKEN"; readonly AUTH_BAD_TOKEN: "BEACON.ASSETS.AUTH.BAD_TOKEN"; readonly BAD_REQUEST: "BEACON.ASSETS.BAD_REQUEST"; readonly NOT_FOUND: "BEACON.ASSETS.NOT_FOUND"; /** Free 用户视图但请求超 7 天范围 → handler 端可选静默截断或返回此错误 */ readonly FREE_TIER_LIMIT: "BEACON.ASSETS.FREE_TIER_LIMIT"; /** 状态机非法迁移(极少见,client 通常被允许 active↔paused) */ readonly ILLEGAL_TRANSITION: "BEACON.ASSETS.ILLEGAL_TRANSITION"; /** metadata 含 BYOK 黑名单字段(对齐 beacon-usage-v1.ts) */ readonly BYOK_VIOLATION: "BEACON.ASSETS.BYOK_VIOLATION"; readonly RATE_LIMITED: "BEACON.ASSETS.RATE_LIMITED"; readonly INTERNAL: "BEACON.ASSETS.INTERNAL"; }; export type BeaconAssetsErrorCode = (typeof BEACON_ASSETS_ERROR_CODES)[keyof typeof BEACON_ASSETS_ERROR_CODES]; export interface BeaconAssetsErrorResponse { ok: false; error: { code: BeaconAssetsErrorCode; message: string; details?: Record; }; } export type BeaconAssetsListEnvelope = { ok: true; data: BeaconAssetsListResponse; } | BeaconAssetsErrorResponse; export type BeaconAssetsCreateEnvelope = { ok: true; data: BeaconAssetsCreateResponse; } | BeaconAssetsErrorResponse; export type BeaconAssetsPatchEnvelope = { ok: true; data: BeaconAssetsPatchResponse; } | BeaconAssetsErrorResponse; //# sourceMappingURL=beacon-assets-v1.d.ts.map