Normalize agent attachment output (#122)

This commit is contained in:
Eyejoker
2026-05-02 19:50:32 +09:00
committed by GitHub
parent 9e45534de0
commit d3c02265e5
16 changed files with 414 additions and 124 deletions

View File

@@ -1,5 +1,5 @@
import {
normalizeEjclawStructuredOutput,
normalizeAgentOutput,
type RunnerOutputAttachment,
} from 'ejclaw-runners-shared';
@@ -28,7 +28,7 @@ export interface SendMessageIpcPayload {
export function buildSendMessageIpcPayload(
input: SendMessageIpcPayloadInput,
): SendMessageIpcPayload {
const normalized = normalizeEjclawStructuredOutput(input.text);
const normalized = normalizeAgentOutput(input.text);
const output =
normalized.output?.visibility === 'public' ? normalized.output : null;
const text = output?.text ?? normalized.result ?? '';

View File

@@ -3,7 +3,7 @@ import path from 'path';
import {
extractImageTagPaths,
normalizeEjclawStructuredOutput,
normalizeAgentOutput,
type RunnerStructuredOutput,
writeProtocolOutput,
} from 'ejclaw-runners-shared';
@@ -151,7 +151,7 @@ export function normalizeStructuredOutput(result: string | null): {
result: string | null;
output?: RunnerOutput['output'];
} {
return normalizeEjclawStructuredOutput(result);
return normalizeAgentOutput(result);
}
export function extractAssistantText(message: unknown): string | null {