/** Amp evidence projection. Cloud owns credentials, scheduling and delivery; * this module owns interpreting provider JSON. Unknown fields stay in raw. */ export type AmpMessage = Record; export type AmpEvidence = { v: 1; source: 'amp'; sessionId: string; eventId: string; lens: 'history'; kind: 'prompt' | 'assistant' | 'tool_call' | 'marker'; ts: string; content: string; actorRole: string | null; /** Calls retain native identities; mixed human/tool messages have separate tool evidence. */ toolCalls?: Array<{ id: string; tool: string; input: unknown; }>; record: { messageId: string; messageVersion: number | null; raw: AmpMessage; toolResults?: Array<{ id: string; status: string | null; output?: unknown; error?: unknown; }>; timestampInferred?: true; }; }; export declare function ampThreadId(value: string): string; /** Native export and External API share message identity; no position ids or current-time timestamps. */ export declare function ampEvidence(threadId: string, messages: unknown[], fallbackTime?: string): AmpEvidence[]; export declare function ampExport(threadId: string, value: unknown): AmpEvidence[]; /** Provider-owned CLI acquisition and remote submission contract. Hosts supply an isolated process runtime. */ export type AmpOperation = /** Bounded recent-thread picker; a host may select any other owned thread by ID and verify via export. */ { kind: 'discover'; } | { kind: 'export'; threadId: string; } | { kind: 'inject'; threadId: string; text: string; }; export declare const AMP_CLI_VERSION = "0.0.1793857728-g655a2c"; export declare const AMP_CLI_BRIDGE = "const {spawnSync}=require('node:child_process');\nlet op;try{op=JSON.parse(process.env.RELAY_AMP_OPERATION)}catch{}\nif(op&&typeof op.threadId==='string'){op.threadId=op.threadId.trim();const prefix='https://ampcode.com/threads/';if(op.threadId.startsWith(prefix))op.threadId=op.threadId.slice(prefix.length);if(op.threadId.endsWith('/'))op.threadId=op.threadId.slice(0,-1)}\nif(!op||!['discover','export','inject'].includes(op.kind)||(op.kind!=='discover'&&(typeof op.threadId!=='string'||!/^T-[A-Za-z0-9-]{6,100}$/.test(op.threadId)))||(op.kind==='inject'&&(typeof op.text!=='string'||!op.text||op.text.includes(String.fromCharCode(0))))){process.stdout.write(JSON.stringify({ok:false,outcome:'rejected',code:'amp_invalid_operation'}));process.exit(0)}\nconst args=['--log-file','/dev/null'];\nif(op.kind==='discover')args.push('threads','search','author:me','--json','--limit','101');\nelse if(op.kind==='export')args.push('threads','export',op.threadId);\nelse if(op.kind==='inject')args.push('threads','continue',op.threadId,'-ox');\nconst r=spawnSync(process.env.RELAY_AMP_CLI_PATH||'/tmp/relay-amp/node_modules/.bin/amp',args,{encoding:'utf8',input:op.kind==='inject'?op.text:undefined,timeout:45000,maxBuffer:16777216,env:{...process.env,RELAY_AMP_OPERATION:''}});\nif(r.error||r.status!==0){process.stdout.write(JSON.stringify({ok:false,outcome:op.kind==='inject'?'unknown':'rejected',code:'amp_command_failed'}));process.exit(0)}\nif(op.kind==='inject')process.stdout.write(JSON.stringify({ok:true,value:{accepted:true}}));\nelse{try{process.stdout.write(JSON.stringify({ok:true,value:JSON.parse(r.stdout)}))}catch{process.stdout.write(JSON.stringify({ok:false,outcome:'rejected',code:'amp_invalid_json'}))}}"; //# sourceMappingURL=amp-source.d.ts.map