import { G as PersonaIdentity, K as PersonaVoiceOverride, U as PersonaDocument, W as PersonaFrontMatter } from "./config-DS0HTIUU.mjs"; import { A as ProfileSecretPurpose, C as inlineProfile, D as ProfileBrowserFingerprint, E as ProfileBrowserBinding, M as ProfileVaultSecretReference, O as ProfileBrowserMode, S as applyProfileEnvironment, T as replaceProfileEnvironment, _ as ProfileDiagnostic, a as commitGlobalProfileRootAsync, b as ProfileSettings, c as loadProfileManagementCatalogAsync, d as readPersonaFilesAsync, f as resolveProfileAsync, g as PERSONA_FILES, h as ManagedProfile, i as buildPersonaPromptAsync, j as ProfileSecretReference, k as ProfileIntegrationBinding, l as loadProfilesAsync, m as InlineProfileInput, n as PersonaFileRead, o as listProfileNamesAsync, p as AgentProfile, r as ProfileCatalogChangedError, s as loadProfileCatalogAsync, t as GlobalProfileRootPlan, u as planGlobalProfileRootAsync, v as ProfileManagementCatalog, w as personaPromptHeader, x as ProfileWake, y as ProfileOrigin } from "./index-DATCA6lI.mjs"; import { a as resolveProfile, i as loadProfiles, n as listProfileNames, r as loadProfileCatalog, t as buildPersonaPrompt } from "./sync-D2G0uTSX.mjs"; import { FileSystem } from "@agimon-ai/po-core/platform"; //#region src/services/personaFrontMatter/type.d.ts /** * The identity fields a person may change in a persona's `profile.md`. * * Absent leaves a field as it is and `null` removes it. `role` and `icon` are deliberately not editable: * `role` decides whether a coordinator profile may be rewritten, and the icon is a separate file. */ interface PersonaIdentityEdit { readonly name?: string | null; /** The whole voice override: fields left out of it are removed. An empty override removes the voice. */ readonly voice?: PersonaVoiceOverride | null; } //#endregion //#region src/services/personaFrontMatter/index.d.ts /** * Splits a recognised identity block off a persona document. * * Never throws: a malformed avatar must not make a persona unloadable, so an * unparseable or unrecognised block leaves the document exactly as it arrived. */ export declare function parsePersonaFrontMatter(content: string): PersonaDocument; /** * Changes the name and voice a persona declares in `profile.md`, returning the next file text, or undefined when it * would not change. The persona text after the block, `icon`, `role`, unknown keys and comments are kept, and * text without an identity block gets a new one in front, leaving whatever it opened with exactly as it was. * * Refuses, rather than guesses, when the text opens with a fenced block that names an identity key but does not * read as an identity block (broken YAML, repeated keys), when removing fields would leave an unrecognised block, * and when the result would not read back as the requested identity over the same persona text. * * The caller still owns whether the profile keeps persona text: a `profile.md` holding only an identity block * leaves the persona empty unless `SOUL.md` or `AGENTS.md` supplies it. */ export declare function editPersonaFrontMatter(content: string, edit: PersonaIdentityEdit): string | undefined; //#endregion //#region src/services/personaIcon/sync.d.ts /** * Resolves an icon declared in persona front-matter, or undefined when it is * missing, unreadable, not an allowed image, escapes the persona directory, or * exceeds the data-URL ceiling. * * @deprecated Node-only sync shim; use readPersonaIconAsync. Removed in M2. */ export declare function readPersonaIcon(personaPath: string, iconRelative: string): string | undefined; //#endregion //#region src/services/personaIcon/index.d.ts type IoContext = Parameters[1]; /** * Reads a persona icon into a bounded `data:` URL. * * The icon travels inside the journalled identity entry rather than through an * HTTP route. A route would leave a request-time filesystem resolution reachable * from the browser for the life of a session, defended on every request forever; * this resolves the path once, server side, at the moment the profile loads. * * The path comes from user-authored front-matter, so it is confined the same way * `buildPersonaPrompt` confines persona files: a symlink must not read outside * the persona directory. * * Every failure is silent and returns undefined. An avatar is decoration, and a * broken one must never stop a persona from loading. That includes a host whose * filesystem lacks the persona entirely, such as the edge. */ export declare function readPersonaIconAsync(fs: FileSystem, personaPath: string, iconRelative: string, context: IoContext): Promise; //#endregion //#region src/services/profileBinding/index.d.ts /** Browser-level defaults only. Every alias still requires its own exact recipient origins. */ export declare const PROFILE_SOCIAL_BROWSER_ORIGINS: readonly string[]; /** Explicit vault aliases only. Templates never name a namespace or key themselves. */ export declare function parseProfileVaultSecrets(value: unknown, location?: string): Readonly>; /** Validates and deeply freezes a detached metadata snapshot. No provider SDK or secret is loaded. */ export declare function parseProfileBinding(value: unknown, location?: string): ProfileIntegrationBinding; //#endregion //#region src/services/profileEdit/type.d.ts /** The proactive check-in as it is written in YAML, such as `{ period: '6h', prompt: 'Check in on open work' }`. */ interface ProfileWakeEdit { readonly period: string; readonly prompt?: string; } /** * The settings a profile may change. Absent leaves a key as it is and `null` removes it. * `wake` replaces the whole check-in, so a prompt left out of it is removed. */ interface ProfileSettingsEdit { readonly preset?: string | null; readonly domains?: readonly string[] | null; readonly wake?: ProfileWakeEdit | null; readonly timezone?: string | null; } /** Edits one explicit entry of a personal `profiles.yaml`, in the catalog or the older flat form. */ interface ProfileEntryEditInput { /** Current text of the profiles.yaml that declares the entry. */ readonly text: string; readonly filePath: string; readonly baseDirectory: string; readonly name: string; readonly edit: ProfileSettingsEdit; } /** Edits the `profile.yaml` sidecar of a discovered profile. */ interface ProfileSidecarEditInput { /** Current text of the sidecar, or undefined when the profile has none yet. */ readonly text?: string; readonly name: string; readonly edit: ProfileSettingsEdit; } /** Sets or clears `defaultProfile` in a personal `profiles.yaml`. */ interface ProfileDefaultEditInput { /** Current text of the profiles.yaml, or undefined when the file does not exist. */ readonly text?: string; readonly filePath: string; readonly baseDirectory: string; /** The profile a run starts on, or null to remove the declaration. */ readonly profile: string | null; } //#endregion //#region src/services/profileEdit/index.d.ts /** * Applies `edit` to the explicit entry `name` of a profiles.yaml. The entry must already exist: this edits a * profile's settings and never declares one. Returns undefined when the settings already hold the requested values. */ export declare function editProfileEntryText(input: ProfileEntryEditInput): string | undefined; /** * Applies `edit` to the `profile.yaml` sidecar of a discovered profile, creating it as `version: 1` when the profile * has none. An existing sidecar that does not parse is never rewritten. Returns undefined when nothing changes. */ export declare function editProfileSidecarText(input: ProfileSidecarEditInput): string | undefined; /** * Sets or clears `defaultProfile` in a personal profiles.yaml. A missing or empty file is created in the catalog * form, and a flat-form file moves under `entries` so the default can be declared. Whether the named profile exists * is the caller's concern: a name a plugin source may still deliver is a valid request. Returns undefined when the * file already declares what was asked. */ export declare function editDefaultProfileText(input: ProfileDefaultEditInput): string | undefined; //#endregion export { type AgentProfile, type GlobalProfileRootPlan, type InlineProfileInput, type ManagedProfile, PERSONA_FILES, type PersonaFileRead, type PersonaFrontMatter, type PersonaIdentity, type PersonaVoiceOverride, type ProfileBrowserBinding, type ProfileBrowserFingerprint, type ProfileBrowserMode, ProfileCatalogChangedError, type ProfileDiagnostic, type ProfileIntegrationBinding, type ProfileManagementCatalog, type ProfileOrigin, type ProfileSecretPurpose, type ProfileSecretReference, type ProfileSettings, type ProfileVaultSecretReference, type ProfileWake, applyProfileEnvironment, buildPersonaPrompt, buildPersonaPromptAsync, commitGlobalProfileRootAsync, inlineProfile, listProfileNames, listProfileNamesAsync, loadProfileCatalog, loadProfileCatalogAsync, loadProfileManagementCatalogAsync, loadProfiles, loadProfilesAsync, personaPromptHeader, planGlobalProfileRootAsync, readPersonaFilesAsync, replaceProfileEnvironment, resolveProfile, resolveProfileAsync }; //# sourceMappingURL=profiles.d.mts.map