/** * {report:X} 参照の構文解釈と実行時解決。 * * 従来は reportDir との単純な文字列連結(存在チェックなし)だったため、 * resume 境界(producer 実行後に resume を挟むと旧 run の reports/ が * 引き継がれない)で consumer の参照が黙って壊れ、エージェントが実在しない * パスを探して詰んでいた(v3-r4)。ここでは path containment / 存在 / * 通常ファイル(symlink 拒否)を検証する。欠落は実行を止めず、明示的な * 欠落文に置換する。 * * doctor の静的解析({report:X} 抽出)もこの parser を共用し、静的解析と * 実行時の構文解釈を揃える。 */ export declare const REPORT_REFERENCE_PATTERN: RegExp; /** テキストから {report:X} の参照名を抽出する(doctor と実行時で共用)。 */ export declare function extractReportReferences(text: string | undefined): string[]; export interface ResolveReportReferenceContext { /** 参照しているステップ名(エラーメッセージ用) */ readonly stepName: string; /** * run の reports ルート(engine から明示的に渡す — パス文字列からの推測は * しない)。workflow_call の子(`reports/subworkflows//` の * 名前空間付き reportDir)に限り、親成果物への read-only フォールバック * 解決に使う。 */ readonly reportsRootDir?: string; /** 元 run 座標で解決済みの resume snapshot 対応を引く論理 consumer key。 */ readonly resumeReportConsumerKey?: string; /** * 存在検証を無効化する(`takt prompt` のプレビューなど、実 run が存在しない * 文脈のみ)。containment 検証は常に行う。 */ readonly validateExistence?: boolean; } /** * 解決結果のスコープ。`parent-run-readonly` は workflow_call の子が親 run の * 成果物を参照した場合で、**読み取り専用参照**である — レポートの書き込み * (phase 2 / writeReportFile)はこのリゾルバを通らず、常に自分の名前空間付き * reportDir へ書くため、親レポートが書き込み対象になることはない。 */ export type ResolvedReportReferenceScope = 'step' | 'parent-run-readonly' | 'resume-snapshot-readonly' | 'missing'; export interface ResolvedReportReference { readonly content: string; readonly scope: ResolvedReportReferenceScope; } export interface ResolvedReportReferencePath { readonly path: string; readonly scope: Exclude; } export declare function formatMissingReportReference(reference: string): string; /** * {report:X} を実パスへ解決する。containment / 存在 / 通常ファイル * (symlink 拒否)を検証する。無いファイルだけは欠落文に置換する。 * `path` は従来と同じ `${dir}/${reference}` 形式(プロンプト本文の互換性維持)。 * * 探索順は、現在の workflow 名前空間、resume snapshot の consumer exact mapping、 * 直近の親 workflow から run の reports ルート。親候補は * `context.reportsRootDir` から構造検証した名前空間だけを使う。その場合 `scope` は * `parent-run-readonly` — 親成果物の読み取り専用参照であり、書き込みは常に自分の * reportDir に対して行われる。 */ export declare function resolveReportReferenceDetailed(reportDir: string, reference: string, context: ResolveReportReferenceContext): ResolvedReportReference; export declare function resolveReportReferencePath(reportDir: string, reference: string, context: ResolveReportReferenceContext): ResolvedReportReferencePath | undefined; export declare function resolveReportReference(reportDir: string, reference: string, context: ResolveReportReferenceContext): string; //# sourceMappingURL=report-reference.d.ts.map