@rallycry/conveyor-agent 10.11.1 → 10.12.0

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.
@@ -2444,7 +2444,17 @@ var PtyChatEventPayloadSchema = z2.discriminatedUnion("kind", [
2444
2444
  kind: z2.literal("tool_use"),
2445
2445
  name: z2.string().max(200),
2446
2446
  // Compact preview: JSON.stringify(input) truncated agent-side.
2447
- input: z2.string().max(2e3)
2447
+ input: z2.string().max(2e3),
2448
+ // Transcript tool_use block id — lets the client pair the tool_result.
2449
+ id: z2.string().max(100).optional()
2450
+ }),
2451
+ z2.object({
2452
+ kind: z2.literal("tool_result"),
2453
+ // tool_use block id this result answers (absent on malformed records).
2454
+ toolUseId: z2.string().max(100).optional(),
2455
+ // Compact output preview, truncated agent-side.
2456
+ output: z2.string().max(2e3),
2457
+ isError: z2.boolean().optional()
2448
2458
  }),
2449
2459
  z2.object({ kind: z2.literal("turn_end") })
2450
2460
  ]);
@@ -2823,7 +2833,9 @@ var UpdateProjectTagRequestSchema = z4.object({
2823
2833
  var PostToProjectChatRequestSchema = z4.object({
2824
2834
  projectId: z4.string(),
2825
2835
  content: z4.string().min(1).max(2e4),
2826
- requestingUserId: z4.string().optional()
2836
+ requestingUserId: z4.string().optional(),
2837
+ /** Marks the post so the server can persist it beyond chat (tag-audit summaries land in tag history). */
2838
+ kind: z4.enum(["tag_audit_summary"]).optional()
2827
2839
  });
2828
2840
  var StartTagAuditRequestSchema = z4.object({
2829
2841
  projectId: z4.string(),
@@ -3632,6 +3644,7 @@ function matchUsageLimitBanner(text, now = Date.now()) {
3632
3644
  // src/harness/pty/chat-record-mapper.ts
3633
3645
  var TEXT_MAX = 16e3;
3634
3646
  var TOOL_INPUT_MAX = 1900;
3647
+ var TOOL_OUTPUT_MAX = 1900;
3635
3648
  function isRecord2(value) {
3636
3649
  return typeof value === "object" && value !== null;
3637
3650
  }
@@ -3681,16 +3694,42 @@ function mapAssistant2(record) {
3681
3694
  const name = stringField2(raw, "name");
3682
3695
  if (name) {
3683
3696
  const input = "input" in raw ? raw.input : void 0;
3684
- events.push({
3697
+ const event = {
3685
3698
  kind: "tool_use",
3686
3699
  name: truncate(name, 200),
3687
3700
  input: JSON.stringify(input ?? {}).slice(0, TOOL_INPUT_MAX)
3688
- });
3701
+ };
3702
+ const id = stringField2(raw, "id");
3703
+ if (id !== void 0) event.id = id;
3704
+ events.push(event);
3689
3705
  }
3690
3706
  }
3691
3707
  }
3692
3708
  return events;
3693
3709
  }
3710
+ function toolResultText(block) {
3711
+ const content = block.content;
3712
+ if (typeof content === "string") return content;
3713
+ if (isUnknownArray2(content)) {
3714
+ return content.filter((b) => isRecord2(b) && b.type === "text").map((b) => typeof b.text === "string" ? b.text : "").filter((t) => t.length > 0).join("\n");
3715
+ }
3716
+ return "";
3717
+ }
3718
+ function mapToolResults(content) {
3719
+ const events = [];
3720
+ for (const raw of content) {
3721
+ if (!isRecord2(raw) || raw.type !== "tool_result") continue;
3722
+ const event = {
3723
+ kind: "tool_result",
3724
+ output: truncate(toolResultText(raw), TOOL_OUTPUT_MAX),
3725
+ isError: raw.is_error === true
3726
+ };
3727
+ const toolUseId = stringField2(raw, "tool_use_id");
3728
+ if (toolUseId !== void 0) event.toolUseId = toolUseId;
3729
+ events.push(event);
3730
+ }
3731
+ return events;
3732
+ }
3694
3733
  function mapUser(record) {
3695
3734
  const message = record.message;
3696
3735
  if (!isRecord2(message)) return [];
@@ -3700,7 +3739,7 @@ function mapUser(record) {
3700
3739
  text = content;
3701
3740
  } else if (isUnknownArray2(content)) {
3702
3741
  const hasToolResult = content.some((b) => isRecord2(b) && b.type === "tool_result");
3703
- if (hasToolResult) return [];
3742
+ if (hasToolResult) return mapToolResults(content);
3704
3743
  text = content.filter((b) => isRecord2(b) && b.type === "text").map((b) => typeof b.text === "string" ? b.text : "").filter((t) => t.length > 0).join("\n");
3705
3744
  } else {
3706
3745
  return [];
@@ -11792,4 +11831,4 @@ export {
11792
11831
  runStartCommand,
11793
11832
  unshallowRepo
11794
11833
  };
11795
- //# sourceMappingURL=chunk-N7CLCSZR.js.map
11834
+ //# sourceMappingURL=chunk-CXNWRIS7.js.map