@promptbook/remote-client
Version:
Promptbook: Create persistent AI agents that turn your company's scattered knowledge into action
116 lines (115 loc) • 4.4 kB
TypeScript
import type { BookCommitment } from '../../commitments/_base/BookCommitment';
/**
* Supported pseudo-agent kinds.
*
* @private internal utility of pseudo-agent resolution
*/
export type PseudoAgentKind = 'USER' | 'VOID';
/**
* Canonical pseudo-agent URL representing the current human user.
*
* @private internal utility of pseudo-agent resolution
*/
export declare const PSEUDO_AGENT_USER_URL = "https://pseudo-agent.promptbook/user";
/**
* Canonical pseudo-agent URL representing void / nothingness.
*
* @private internal utility of pseudo-agent resolution
*/
export declare const PSEUDO_AGENT_VOID_URL = "https://pseudo-agent.promptbook/void";
/**
* Canonical compact token representation of the `{Void}` pseudo-agent.
*
* @private internal utility of pseudo-agent resolution
*/
export declare const VOID_PSEUDO_AGENT_REFERENCE = "{Void}";
/**
* Normalized alias keys that should resolve to the `{Void}` pseudo-agent.
*
* @private internal utility of pseudo-agent resolution
*/
export declare const VOID_PSEUDO_AGENT_ALIAS_KEYS: readonly ["void", "null", "none", "nil"];
/**
* Resolves pseudo-agent kind from compact reference text.
*
* This accepts compact references in all supported syntaxes:
* `{User}`, `{user}`, `@USER`, `Void`, etc.
*
* @param rawReference - Raw reference token or payload.
* @returns Pseudo-agent kind or `null` when the reference is not pseudo.
*
* @private internal utility of pseudo-agent resolution
*/
export declare function resolvePseudoAgentKindFromReference(rawReference: string): PseudoAgentKind | null;
/**
* Resolves pseudo-agent kind from canonical pseudo-agent URL.
*
* @param agentUrl - URL to inspect.
* @returns Pseudo-agent kind or `null` when the URL is not pseudo.
*
* @private internal utility of pseudo-agent resolution
*/
export declare function resolvePseudoAgentKindFromUrl(agentUrl: string): PseudoAgentKind | null;
/**
* Checks whether a URL points to a pseudo-agent.
*
* @param agentUrl - URL to inspect.
* @returns True when the URL identifies a pseudo-agent.
*
* @private internal utility of pseudo-agent resolution
*/
export declare function isPseudoAgentUrl(agentUrl: string): boolean;
/**
* Creates canonical pseudo-agent URL by pseudo-agent kind.
*
* @param pseudoAgentKind - Pseudo-agent kind.
* @returns Canonical pseudo-agent URL.
*
* @private internal utility of pseudo-agent resolution
*/
export declare function createPseudoAgentUrl(pseudoAgentKind: PseudoAgentKind): string;
/**
* Creates a deterministic human-readable pseudonym for the `{User}` pseudo-agent.
*
* The seed is derived from TEAM commitment text with pseudo-user URLs removed so
* the remaining human instructions influence the resulting name.
*
* @param teamCommitmentContent - TEAM commitment content after reference resolution.
* @returns Deterministic English full name representing pseudo-user in that TEAM context.
*
* @private internal utility of TEAM commitment rendering
*/
export declare function createPseudoUserTeammateLabel(teamCommitmentContent: string): string;
/**
* Returns true when reference should behave as the `{Void}` pseudo-agent.
*
* This keeps backward compatibility with legacy aliases (`VOID`, `NULL`, `NONE`, `NIL`)
* while also supporting compact pseudo-agent references.
*
* @param rawReference - Raw reference content.
* @returns True when the reference maps to void.
*
* @private internal utility of pseudo-agent resolution
*/
export declare function isVoidPseudoAgentReference(rawReference: string): boolean;
/**
* Returns true when reference resolves to the `{User}` pseudo-agent.
*
* @param rawReference - Raw reference content.
* @returns True when the reference maps to user.
*
* @private internal utility of pseudo-agent resolution
*/
export declare function isUserPseudoAgentReference(rawReference: string): boolean;
/**
* Checks whether a pseudo-agent can be used inside the specified commitment.
*
* `USER` is intentionally disallowed in FROM/IMPORT commitments.
*
* @param pseudoAgentKind - Pseudo-agent kind to validate.
* @param commitmentType - Commitment where it is used.
* @returns True when the pseudo-agent is allowed in the commitment.
*
* @private internal utility of pseudo-agent resolution
*/
export declare function isPseudoAgentAllowedInCommitment(pseudoAgentKind: PseudoAgentKind, commitmentType: BookCommitment): boolean;