feat(mcp): подготовить сервер и доступ к приёмке
This commit is contained in:
commit
bf3d50e1ff
3835 files changed
+537122
No files matched your search
@@ -0,0 +1,9 @@
|
||||
import {createHash} from 'node:crypto'
|
||||
|
||||
/** Exact writer-profile v1 canonical bytes. Pure value codec; no trust/authority. */
|
||||
export function canonical(value:unknown):string {
|
||||
return JSON.stringify(value,(_key,item:unknown)=>item&&typeof item==='object'&&!Array.isArray(item)
|
||||
?Object.fromEntries(Object.entries(item).sort(([a],[b])=>a<b?-1:a>b?1:0)):item)
|
||||
}
|
||||
export const sha=(value:Uint8Array|string)=>createHash('sha256').update(value).digest('hex')
|
||||
export const bytes=(value:unknown)=>Buffer.from(canonical(value)+'\n','utf8')
|
||||
Reference in new issue
Block a user