UNPKG

eve

Version:

Filesystem-first framework for durable backend AI agents that run anywhere.

1 lines 733 B
import{createHash}from"node:crypto";import{INVOCATION_OWNER_ATTRIBUTE,INVOCATION_TOKEN_ATTRIBUTE}from"#internal/invocation/attributes.js";function invocationInputRequestId(e,t){return createHash(`sha256`).update(JSON.stringify([e,t]),`utf8`).digest(`hex`)}function invocationOwnerKey(e){let t=e===null?[`anonymous`]:[e.authenticator,e.issuer??``,e.principalType,e.principalId,e.subject??``];return createHash(`sha256`).update(JSON.stringify(t),`utf8`).digest(`hex`)}function buildInvocationAttributes(e){return{[INVOCATION_OWNER_ATTRIBUTE]:e.ownerKey,[INVOCATION_TOKEN_ATTRIBUTE]:e.continuationToken}}export{INVOCATION_OWNER_ATTRIBUTE,INVOCATION_TOKEN_ATTRIBUTE,buildInvocationAttributes,invocationInputRequestId,invocationOwnerKey};