UNPKG

@promptbook/remote-server

Version:

Promptbook: Create persistent AI agents that turn your company's scattered knowledge into action

52 lines (51 loc) 1.83 kB
/** * Header used for same-server TEAM calls that may access private teammate agents. * * @private internal Agents Server access wiring */ export declare const TEAM_INTERNAL_AGENT_ACCESS_HEADER = "x-promptbook-team-agent-access-token"; /** * Options for creating same-server TEAM access headers. * * @private internal Agents Server access wiring */ export type TeamInternalAgentAccessHeadersOptions = { /** * URL of the teammate agent that is about to be contacted. */ readonly agentUrl: string; /** * Origin of the current Agents Server. */ readonly localServerUrl?: string; /** * Resolved internal access token carried by the runtime context. */ readonly accessToken?: string | null; }; /** * Resolves the internal token used by same-server TEAM calls. * * @returns Hashed token, or `null` when the server does not have a private secret. * * @private internal Agents Server access wiring */ export declare function resolveTeamInternalAgentAccessToken(): string | null; /** * Creates request headers for same-server TEAM calls. * * @param options - Target agent URL, local server URL, and resolved access token. * @returns Header map when the target is same-origin; otherwise an empty map. * * @private internal Agents Server access wiring */ export declare function createTeamInternalAgentAccessHeaders(options: TeamInternalAgentAccessHeadersOptions): Record<string, string>; /** * Checks whether an incoming header carries the current same-server TEAM access token. * * @param value - Raw request header value. * @returns `true` only when the server has a private token and the value matches it. * * @private internal Agents Server access wiring */ export declare function isTeamInternalAgentAccessToken(value: string | null | undefined): boolean;