@rallycry/conveyor-agent 7.2.15 → 7.2.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,33 @@
1
+ // src/tools/helpers.ts
2
+ function textResult(text) {
3
+ return { content: [{ type: "text", text }] };
4
+ }
5
+ function imageBlock(data, mimeType) {
6
+ return { type: "image", data, mimeType };
7
+ }
8
+ function isImageMimeType(mimeType) {
9
+ return mimeType.startsWith("image/");
10
+ }
11
+ var cliEventFormatters = {
12
+ thinking: (e) => e.message ?? "",
13
+ tool_use: (e) => `${e.tool}: ${e.input?.slice(0, 1e3) ?? ""}`,
14
+ tool_result: (e) => `${e.tool} \u2192 ${e.output?.slice(0, 500) ?? ""}${e.isError ? " [ERROR]" : ""}`,
15
+ message: (e) => e.content ?? "",
16
+ error: (e) => `ERROR: ${e.message ?? ""}`,
17
+ completed: (e) => `Completed: ${e.summary ?? ""} (cost: $${e.costUsd ?? "?"}, duration: ${e.durationMs ?? "?"}ms)`,
18
+ setup_output: (e) => `[${e.stream ?? "stdout"}] ${e.data ?? ""}`,
19
+ start_command_output: (e) => `[${e.stream ?? "stdout"}] ${e.data ?? ""}`,
20
+ turn_end: (e) => `Turn complete (${e.toolCalls?.length ?? 0} tool calls)`
21
+ };
22
+ function formatCliEvent(e) {
23
+ const formatter = cliEventFormatters[e.type];
24
+ return formatter ? formatter(e) : JSON.stringify(e);
25
+ }
26
+
27
+ export {
28
+ textResult,
29
+ imageBlock,
30
+ isImageMimeType,
31
+ formatCliEvent
32
+ };
33
+ //# sourceMappingURL=chunk-FDWECEDJ.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/tools/helpers.ts"],"sourcesContent":["/** Shared result helpers for MCP tool handlers. */\n\nexport function textResult(text: string): { content: { type: \"text\"; text: string }[] } {\n return { content: [{ type: \"text\" as const, text }] };\n}\n\nexport function imageBlock(\n data: string,\n mimeType: string,\n): { type: \"image\"; data: string; mimeType: string } {\n return { type: \"image\" as const, data, mimeType };\n}\n\nexport function isImageMimeType(mimeType: string): boolean {\n return mimeType.startsWith(\"image/\");\n}\n\n// ── Event formatting for CLI logs ─────────────────────────────────────\n\ntype EventRecord = Record<string, unknown>;\n\nconst cliEventFormatters: Record<string, (e: EventRecord) => string> = {\n thinking: (e) => (e.message as string) ?? \"\",\n tool_use: (e) => `${e.tool}: ${(e.input as string)?.slice(0, 1000) ?? \"\"}`,\n tool_result: (e) =>\n `${e.tool} → ${(e.output as string)?.slice(0, 500) ?? \"\"}${e.isError ? \" [ERROR]\" : \"\"}`,\n message: (e) => (e.content as string) ?? \"\",\n error: (e) => `ERROR: ${(e.message as string) ?? \"\"}`,\n completed: (e) =>\n `Completed: ${(e.summary as string) ?? \"\"} (cost: $${e.costUsd ?? \"?\"}, duration: ${e.durationMs ?? \"?\"}ms)`,\n setup_output: (e) => `[${(e.stream as string) ?? \"stdout\"}] ${(e.data as string) ?? \"\"}`,\n start_command_output: (e) => `[${(e.stream as string) ?? \"stdout\"}] ${(e.data as string) ?? \"\"}`,\n turn_end: (e) => `Turn complete (${(e.toolCalls as unknown[])?.length ?? 0} tool calls)`,\n};\n\nexport function formatCliEvent(e: EventRecord): string {\n const formatter = cliEventFormatters[e.type as string];\n return formatter ? formatter(e) : JSON.stringify(e);\n}\n"],"mappings":";AAEO,SAAS,WAAW,MAA6D;AACtF,SAAO,EAAE,SAAS,CAAC,EAAE,MAAM,QAAiB,KAAK,CAAC,EAAE;AACtD;AAEO,SAAS,WACd,MACA,UACmD;AACnD,SAAO,EAAE,MAAM,SAAkB,MAAM,SAAS;AAClD;AAEO,SAAS,gBAAgB,UAA2B;AACzD,SAAO,SAAS,WAAW,QAAQ;AACrC;AAMA,IAAM,qBAAiE;AAAA,EACrE,UAAU,CAAC,MAAO,EAAE,WAAsB;AAAA,EAC1C,UAAU,CAAC,MAAM,GAAG,EAAE,IAAI,KAAM,EAAE,OAAkB,MAAM,GAAG,GAAI,KAAK,EAAE;AAAA,EACxE,aAAa,CAAC,MACZ,GAAG,EAAE,IAAI,WAAO,EAAE,QAAmB,MAAM,GAAG,GAAG,KAAK,EAAE,GAAG,EAAE,UAAU,aAAa,EAAE;AAAA,EACxF,SAAS,CAAC,MAAO,EAAE,WAAsB;AAAA,EACzC,OAAO,CAAC,MAAM,UAAW,EAAE,WAAsB,EAAE;AAAA,EACnD,WAAW,CAAC,MACV,cAAe,EAAE,WAAsB,EAAE,YAAY,EAAE,WAAW,GAAG,eAAe,EAAE,cAAc,GAAG;AAAA,EACzG,cAAc,CAAC,MAAM,IAAK,EAAE,UAAqB,QAAQ,KAAM,EAAE,QAAmB,EAAE;AAAA,EACtF,sBAAsB,CAAC,MAAM,IAAK,EAAE,UAAqB,QAAQ,KAAM,EAAE,QAAmB,EAAE;AAAA,EAC9F,UAAU,CAAC,MAAM,kBAAmB,EAAE,WAAyB,UAAU,CAAC;AAC5E;AAEO,SAAS,eAAe,GAAwB;AACrD,QAAM,YAAY,mBAAmB,EAAE,IAAc;AACrD,SAAO,YAAY,UAAU,CAAC,IAAI,KAAK,UAAU,CAAC;AACpD;","names":[]}