mirror of
https://github.com/getpaseo/paseo.git
synced 2026-07-29 12:01:31 +00:00
- Add pino with pino-pretty for structured logging
- Create root logger in index.ts with child loggers per module
- Support log level via PASEO_LOG env var and config.json
- Support log format (pretty/json) via PASEO_LOG_FORMAT and config.json
- Replace all console.* in runtime code with appropriate log levels
- Scripts use process.stdout/stderr for output
- Error logging uses correct pattern: logger.error({ err }, msg)
33 lines
977 B
TypeScript
33 lines
977 B
TypeScript
import { readFileSync } from "fs";
|
|
import { inspect } from "util";
|
|
import { standardizePrompt } from "ai/internal";
|
|
|
|
async function processConversation() {
|
|
try {
|
|
const conversationPath =
|
|
".debug.conversations/ce44c79a-0689-4210-8e00-72c0a627406d-2.json";
|
|
|
|
process.stdout.write(`Loading conversation from: ${conversationPath}\n`);
|
|
|
|
const conversationData: any = JSON.parse(
|
|
readFileSync(conversationPath, "utf-8")
|
|
);
|
|
|
|
process.stdout.write(
|
|
`\nLoaded conversation ${conversationData.conversationId} with ${conversationData.messages.length} messages\n\n`
|
|
);
|
|
|
|
const result = await standardizePrompt({
|
|
prompt: conversationData.messages,
|
|
});
|
|
|
|
process.stdout.write("Standardized prompt result:\n");
|
|
process.stdout.write(inspect(result, { depth: null, colors: true }) + "\n");
|
|
} catch (error) {
|
|
process.stderr.write(`Error processing conversation: ${error}\n`);
|
|
process.exit(1);
|
|
}
|
|
}
|
|
|
|
processConversation();
|