export const cameraCapturePhotoDependencyDeclarations = [
    {
        dependencyId: "runtime.execEngine.computeruse.captureCameraPhoto",
        kind: "runtime",
        required: true,
        description: "Runtime-owned camera photo capture support exposed through BaseToolExecutorPort.computeruse.captureCameraPhoto.",
    },
    {
        dependencyId: "runtime.governancePlane.toolInvocationGrant",
        kind: "permission",
        required: true,
        description: "dryRun:false requires an affirmative runtime guard before camera photo capture.",
    },
    {
        dependencyId: "runtime.artifactStore.cameraPhoto",
        kind: "runtime",
        required: true,
        description: "Runtime owns camera frame acquisition, artifact persistence, MIME typing, redaction, and cleanup.",
    },
];
export function createRuntimeCameraCapturePhotoProvider(executor) {
    const captureCameraPhoto = executor?.computeruse?.captureCameraPhoto;
    if (captureCameraPhoto === undefined)
        return undefined;
    return async (request) => {
        const result = await captureCameraPhoto({
            cameraId: request.target.cameraId,
            purpose: request.target.purpose,
            outputFormat: request.target.outputFormat,
            metadata: {
                runtimeId: request.context.runtimeId,
                sessionId: request.context.sessionId,
                invocationId: request.context.invocationId,
                permissionLeaseId: request.target.permissionLeaseId,
                auditMetadata: request.context.auditMetadata,
            },
        });
        if (!result.ok) {
            throw new Error(result.error.message);
        }
        return {
            artifactId: result.output.artifactId,
            mimeType: result.output.mimeType,
            metadata: {
                ...(result.output.metadata ?? {}),
                ...(result.metadata ?? {}),
            },
        };
    };
}
