/** * The one line the harness posts to the owner when an agent finished * owner-requested work and never reported it (crewly#1357). * * The owner thread is not a log: the line names the deliverable in plain * words, in the owner's language, with no work item ids, links, file names, * codecs, sizes or "Results:" dumps. On 2026-10-17 the fallback posted * "Ella finished: Results: " * into a video thread; the owner's reaction: 我还是收到agent发的这种message. * * Pure functions only. * * @module services/orc/owner-completion-report.text */ /** Languages the fallback line is written in. */ export type OwnerLanguage = 'en' | 'zh'; /** * Which language the owner writes in, from a sample of their text: Chinese * when at least {@link OWNER_COMPLETION_REPORT_CONSTANTS.OWNER_LANGUAGE_CJK_MIN_RATIO} * of its letters are CJK, else English. An empty sample is English. * * @param sample - The owner's own words (one or several messages) * @returns `zh` or `en` * * @example * ```typescript * detectOwnerLanguage('什么是投资'); // 'zh' * detectOwnerLanguage('Record a short demo'); // 'en' * ``` */ export declare function detectOwnerLanguage(sample: string | readonly string[] | null | undefined): OwnerLanguage; /** * The deliverable a work item title or summary names, in plain words: its * first clause with links, ids, paths, file names, code spans, markers and * parentheses holding digits removed. * * @param text - Title or summary * @returns The plain phrase (possibly empty), at most {@link OWNER_COMPLETION_REPORT_CONSTANTS.DELIVERABLE_MAX_CHARS} characters * * @example * ```typescript * plainDeliverable('Screen recording of the tutorial page (1080p, 42 MB) — https://x.test/a.mp4'); * // 'Screen recording of the tutorial page' * ``` */ export declare function plainDeliverable(text: string | undefined | null): string; /** * The deliverables of a chain, de-duplicated, at most * {@link OWNER_COMPLETION_REPORT_CONSTANTS.MAX_TITLES}. * * @param texts - Titles / summaries of the finished work, in order * @returns Plain phrases (possibly empty) */ export declare function plainDeliverables(texts: readonly (string | undefined | null)[]): string[]; /** * The deliverables of a chain written in the owner's language, plain-worded. * A phrase in another language is left out: a Chinese line never embeds an * English WorkItem title ("Atlas 做完了Website-plan PDF built and posted in * Steve thread", crewly#1376), and the line then names no deliverable. * * @param texts - Titles / summaries of the finished work, in order * @param language - The owner's language * @returns Plain phrases in that language (possibly none) */ export declare function plainDeliverablesIn(texts: readonly (string | undefined | null)[], language: OwnerLanguage): string[]; /** * Join phrases the way the language does ("a, b and c" / "a、b和c"). * * @param phrases - Plain phrases * @param language - Owner language * @returns One list phrase */ export declare function joinDeliverables(phrases: readonly string[], language: OwnerLanguage): string; /** Inputs of {@link fallbackLine}. */ export interface FallbackLineInput { /** The responsible agent's display name */ agentName: string; /** Titles / summaries of the finished work */ deliverables: readonly (string | undefined | null)[]; /** The owner's language */ language: OwnerLanguage; } /** * The one sentence posted for the agent, plus the short "sent by Crewly" * marker, in the owner's language. It names only deliverables written in * that language and promises nothing: "details later" was a promise nobody * owned (crewly#1376). * * @param input - Agent name, deliverables, language * @returns Two lines: the sentence and the marker * * @example * ```typescript * fallbackLine({ agentName: 'Ella', deliverables: ['排期里 5 张卡的文案', '教程页的录屏'], language: 'zh' }); * // 'Ella 做完了排期里 5 张卡的文案和教程页的录屏。\n— 由 Crewly 代发' * ``` */ export declare function fallbackLine(input: FallbackLineInput): string; /** Inputs of {@link leadFallbackLine}. */ export interface LeadFallbackLineInput { /** Who did the work (display name) */ workerName: string; /** Titles / summaries of the finished work */ deliverables: readonly (string | undefined | null)[]; /** The owner's language */ language: OwnerLanguage; /** Link to the thread the owner approved it in, when it is a Slack thread */ approvalLink?: string | null; } /** * The line the harness posts in the team channel, as the team lead, when the * lead never reported team work the orchestrator delegated for the owner * (crewly#1371): who finished what the owner approved, and where the owner * approved it; plus the short "sent by Crewly" marker. * * @param input - Worker name, deliverables, language, approval link * @returns The lines * * @example * ```typescript * leadFallbackLine({ workerName: 'Dana', deliverables: ['两个账号的教程文案'], language: 'zh', approvalLink: 'https://slack.com/archives/D1/p1' }); * // 'Dana 做完了你批准的两个账号的教程文案。\n批准的对话:https://slack.com/archives/D1/p1\n— 由 Crewly 代发' * ``` */ export declare function leadFallbackLine(input: LeadFallbackLineInput): string; //# sourceMappingURL=owner-completion-report.text.d.ts.map