import { Ib, IbGibAddr } from "@ibgib/ts-gib/dist/types.mjs"; import { IbGib_V1 } from "@ibgib/ts-gib/dist/V1/types.mjs"; import { MetaspaceService } from "@ibgib/core-gib/dist/witness/space/metaspace/metaspace-types.mjs"; import { SpaceId } from "@ibgib/core-gib/dist/witness/space/space-types.mjs"; import { SpecialIbGibType } from "@ibgib/core-gib/dist/common/other/other-types.mjs"; import { IbGibSpaceAny } from "@ibgib/core-gib/dist/witness/space/space-base-v1.mjs"; import { TagIbGib_V1 } from "@ibgib/core-gib/dist/common/tag/tag-types.mjs"; import { AgentWitnessAny } from "./agent-one-file.mjs"; import { TextSource } from "./agent-constants.mjs"; import { AddlMetadataTextForAgentTextInfo, AgentIbInfo, AgentWitnessData_V1, AgentWitnessIbGib_V1, CreateConcreteAgentWitnessFactory, CreateNewAgentArg } from "./agent-types.mjs"; import { CommentIbGib_V1 } from "@ibgib/core-gib/dist/common/comment/comment-types.mjs"; /** * helper that gets/creates the agents tag in the given {@link space}, or in the * default local user space if {@link space} is falsy. * @returns agents tag ibgib */ export declare function getTag_Agents({ metaspace, space, createIfNone, }: { metaspace: MetaspaceService; space: IbGibSpaceAny | undefined; createIfNone?: boolean; }): Promise; /** * gets agents of a certain {@link type} in the local space corresponding to * {@link spaceId} (or default local user space if falsy) via the agents tag. */ export declare function getAgents({ metaspace, type, spaceId, space, }: { metaspace: MetaspaceService; type: SpecialIbGibType; spaceId?: SpaceId; space?: IbGibSpaceAny; }): Promise; /** * i'm updating the index proactively so we don't need to rely on jit getLatest * any time we want to get the agent. */ export declare function updateAgentIndex({ metaspace, type, space, newAgentIbGib, }: { metaspace: MetaspaceService; type: SpecialIbGibType; space: IbGibSpaceAny; newAgentIbGib: AgentWitnessIbGib_V1; }): Promise; /** * Generates a consistent special name for the agent index ibGib based on the * domain ibGib's primitive ancestor's ib or the ibGibAddr's ib atom. * * RIGHT NOW I"M PRIORITIZING THE ATOM. I THINK IT ALWAYS RETURNS THE ATOM, I.E., THE FIRST SPACE-DELIMITED PIECE OF THE `ib`. * * I am doing this because the project ibgib actually forks from a comment * ibgib, so its primitive ancestor is "comment^gib". * * ## notes * * We are trying to get a special ibgib index that maps from ibgibs (the domain) * to what local agent is registered to handle that ibgib's timeline. * * Concretely, we're working on the project ibgibs and we need a way to get at * the agent that is assigned to that project. But we can't just mut8 the * project itself because this would cause issues once the project is spread out * among multiple execution contexts (similar to "remotes" in git). * * So we will have a special ibgib registered with the local space which will * act as this index that maps ibgib -> handling agent. This function helps get * the *name* of that special indexing ibgib. * * This can be driven either by the ibgib itself, via the last primitive ancestor * ibgib's address, or via the ib's atom (the first space-delimited term in the * `ib` metadata). * * So if an ancestor is [comment^gib, specialComment^gib, specialComment * abc123^ABC123.DEF456] (where the abc123 things are representative of the full * hashes 64 characters long atow since we're using sha256), then the *last* * primitive address is specialComment^gib. */ export declare function getAgentIndexNameFromIbGib({ ibGib, ibGibAddr, defaultNameIfError, }: { ibGib?: IbGib_V1; ibGibAddr?: IbGibAddr; /** * if truthy and an error is produced, then this will be returned. */ defaultNameIfError?: string; }): string; /** * Registers a domain ibGib with its associated agent ibGib in the special agent index ibGib. * This creates or updates a mapping from the domain ibGib's TJP address to the agent's address. */ export declare function registerDomainIbGibWithAgentIndex({ domainIbGib, agentIbGib, metaspace, space, }: { domainIbGib: IbGib_V1; agentIbGib: AgentWitnessIbGib_V1; metaspace: MetaspaceService; space: IbGibSpaceAny; }): Promise; /** * Retrieves the agent ibGib associated with a domain ibGib from the special agent index ibGib. * * may have to change this to require the ibgib, not give an optional * domainIbGibAddr */ export declare function getAgentForDomainIbGib({ ibGib, metaspace, space, }: { ibGib: IbGib_V1; metaspace: MetaspaceService; space: IbGibSpaceAny; }): Promise; /** * @internal * @returns factory to create concrete agent witnesses per given {@link arg} */ export declare function getConcreteAgentFactory(arg: CreateNewAgentArg): CreateConcreteAgentWitnessFactory; /** * creates a begin/end tag composed of the {@link tagText} paired with an * optional random id around the given {@link contentText}. The begin/end tags * will be on their own line with {@link contentText} on the lines between. * * @example * [MY_TAG|XBDWZ begin] * contentText * [MY_TAG|XBDWZ end] * @returns */ export declare function taggifyForPrompt({ tagText, contentText, randomIdLength, }: { /** * the tag itself */ tagText: string; /** * text to be surrounded by the tags' begin and end markers. */ contentText: string; /** * length of random characters to pair with tag. if 0 or undefined, then no * id will be generated. */ randomIdLength?: number | undefined; }): string; /** * ATOW we specify if the text is from ai or human, as well as timestampInTicks. * @returns metadata text to be included in the comment ibgib's ib. * @see {@link parseAddlMetadataTextForAgentText} */ export declare function getAddlMetadataTextForAgentText({ textSrc, other, }: { /** * @see {@link AddTextInfo.textSrc} */ textSrc: TextSource; /** * if you have other underscore-delimited text, include that here. */ other?: string; }): string; /** * ATOW we specify if the text is from ai or human, as well as timestampInTicks. * @returns metadata text to be included in the comment ibgib's ib. * @see {@link getAddlMetadataTextForAgentText} */ export declare function parseAddlMetadataTextForAgentText({ addlMetadataText, ifError, }: { addlMetadataText: string; ifError: 'throw' | 'warn' | 'ignore'; }): AddlMetadataTextForAgentTextInfo; /** * builds the agent witness' ib based on given {@link data} * @see {@link parseAgentIb} */ export declare function getAgentIb({ data, }: { /** agent data, should be valid */ data: AgentWitnessData_V1; }): string; /** * @returns parsed info from an ib * @see {@link getAgentIb} */ export declare function parseAgentIb({ ib, }: { ib: Ib; }): AgentIbInfo; /** * Validates a comment ibgib to ensure that it is usable in an agent witness * context, especially that it includes the expected metadata format in its * `ib`. * * @param {CommentIbGib_V1} ibGib - The comment ibgib to validate. * @returns {string[]} An array of error messages if validation fails, or an empty array if no errors. */ export declare function validateAgentWitnessCommentIbGib({ ibGib, }: { ibGib: CommentIbGib_V1; }): Promise; //# sourceMappingURL=agent-helpers.d.mts.map