Download src/agents/subagents/spawn/execution-identity-spawn-context.ts from SaylorTwift/openclaw: direct link, hf CLI and curl.
- Browser
- Download file 727 Bytes
-
https://huggingface.co/SaylorTwift/openclaw/resolve/main/src/agents/subagents/spawn/execution-identity-spawn-context.ts
- Command line
-
hf download hf://SaylorTwift/openclaw/src/agents/subagents/spawn/execution-identity-spawn-context.ts
-
curl -L -o execution-identity-spawn-context.ts https://huggingface.co/SaylorTwift/openclaw/resolve/main/src/agents/subagents/spawn/execution-identity-spawn-context.ts
727 Bytes
| import type { ExecutionIdentityAdmissionToken } from "../../../audit/execution-identity-admission.js"; | |
| const parentExecutionIdentities = new WeakMap<object, ExecutionIdentityAdmissionToken>(); | |
| /** Carry exact parent provenance without adding it to public spawn context types. */ | |
| export function withParentExecutionIdentity<T extends object>( | |
| context: T, | |
| token: ExecutionIdentityAdmissionToken | undefined, | |
| ): T { | |
| if (!token) { | |
| return context; | |
| } | |
| const carried = { ...context }; | |
| parentExecutionIdentities.set(carried, token); | |
| return carried; | |
| } | |
| export function readParentExecutionIdentity( | |
| context: object, | |
| ): ExecutionIdentityAdmissionToken | undefined { | |
| return parentExecutionIdentities.get(context); | |
| } | |