@getpaseo/protocol 0.3.1 → 0.4.0-beta.2

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.
@@ -1,7 +1,10 @@
1
1
  export declare const PARENT_AGENT_ID_LABEL = "paseo.parent-agent-id";
2
+ export declare function getOpenAgentTabLabel(clientId: string): string;
3
+ export declare function isOpenAgentTabLabel(label: string): boolean;
2
4
  export interface AgentLabelSource {
3
5
  labels?: Record<string, unknown> | null;
4
6
  }
5
7
  export declare function getParentAgentIdFromLabels(labels: Record<string, unknown> | null | undefined): string | null;
6
8
  export declare function isDelegatedAgent(agent: AgentLabelSource): boolean;
9
+ export declare function hasOpenAgentTab(labels: Record<string, unknown> | null | undefined): boolean;
7
10
  //# sourceMappingURL=agent-labels.d.ts.map
@@ -1,4 +1,11 @@
1
1
  export const PARENT_AGENT_ID_LABEL = "paseo.parent-agent-id";
2
+ const OPEN_AGENT_TAB_LABEL_PREFIX = "paseo.open-agent-tab.";
3
+ export function getOpenAgentTabLabel(clientId) {
4
+ return `${OPEN_AGENT_TAB_LABEL_PREFIX}${clientId}`;
5
+ }
6
+ export function isOpenAgentTabLabel(label) {
7
+ return label.startsWith(OPEN_AGENT_TAB_LABEL_PREFIX);
8
+ }
2
9
  export function getParentAgentIdFromLabels(labels) {
3
10
  const parentAgentId = labels?.[PARENT_AGENT_ID_LABEL];
4
11
  return typeof parentAgentId === "string" && parentAgentId.trim().length > 0
@@ -8,4 +15,7 @@ export function getParentAgentIdFromLabels(labels) {
8
15
  export function isDelegatedAgent(agent) {
9
16
  return getParentAgentIdFromLabels(agent.labels) !== null;
10
17
  }
18
+ export function hasOpenAgentTab(labels) {
19
+ return Object.entries(labels ?? {}).some(([label, value]) => isOpenAgentTabLabel(label) && value === "true");
20
+ }
11
21
  //# sourceMappingURL=agent-labels.js.map
@@ -284,6 +284,13 @@ export interface CompactionTimelineItem {
284
284
  trigger?: "auto" | "manual";
285
285
  preTokens?: number;
286
286
  }
287
+ export interface AgentTaskItem {
288
+ text: string;
289
+ completed: boolean;
290
+ id?: string;
291
+ status?: "pending" | "in_progress" | "completed";
292
+ activeForm?: string;
293
+ }
287
294
  export type AgentTimelineItem = {
288
295
  type: "user_message";
289
296
  text: string;
@@ -298,10 +305,7 @@ export type AgentTimelineItem = {
298
305
  text: string;
299
306
  } | ToolCallTimelineItem | {
300
307
  type: "todo";
301
- items: {
302
- text: string;
303
- completed: boolean;
304
- }[];
308
+ items: AgentTaskItem[];
305
309
  } | {
306
310
  type: "error";
307
311
  message: string;
@@ -1,5 +1,6 @@
1
1
  import { z } from "zod";
2
2
  import { ChatMessageSchema, ChatRoomDetailSchema } from "./types.js";
3
+ // COMPAT(chatRooms): retained after the v0.3.0 feature removal; remove after 2027-02-09 when mixed-version peers no longer send legacy messages.
3
4
  export const ChatCreateRequestSchema = z.object({
4
5
  type: z.literal("chat/create"),
5
6
  requestId: z.string(),
@@ -1,4 +1,5 @@
1
1
  import { z } from "zod";
2
+ // COMPAT(chatRooms): retained after the v0.3.0 feature removal; remove after 2027-02-09 when mixed-version peers no longer send legacy messages.
2
3
  export const ChatRoomSchema = z.object({
3
4
  id: z.string(),
4
5
  name: z.string(),