// Copyright (c) 未来飞马 // // MIT License — Copyright (c) 2026 Fmode (未来飞马) // // Trademark Notice: // The MIT license grants copyright permissions for source code only. // It does NOT grant any rights to use trademarks including "未来飞马", // "Harness Loop", "RSI", and associated slogan "让AI进化提前发生,让AI落地快人一步". // Any use of these trademarks requires separate written permission. /** * skill-agent-log-s3 公共 SDK 入口 * * 数字生命自报运行日志到个人 S3 空间,走云函数免密钥通道。 * * @example Node.js * import { resolveIdentity, uploadJson, ENDPOINTS } from 'skill-agent-log-s3'; * const id = resolveIdentity(); * const { publicUrl } = await uploadJson({ sessionToken: id.sessionToken, key: 'log/20260923/1400.json', content: metrics }); * * @example Browser (不支持指标采集,仅支持上传) * import { uploadJson } from 'skill-agent-log-s3/browser'; */ export { resolveIdentity, identitySummary } from './identity.mjs'; export { getUploadUrl, uploadJson, listOldLogs, ENDPOINTS } from './upload.mjs'; /** 生成当前时刻的日志路径 log//.json */ export function makeLogKey(now = new Date()) { const pad = n => String(n).padStart(2, '0'); const d = `${now.getFullYear()}${pad(now.getMonth() + 1)}${pad(now.getDate())}`; const t = `${pad(now.getHours())}${pad(now.getMinutes())}`; return `log/${d}/${t}.json`; }