@neta-art/cohub-protocol 1.3.0 → 1.5.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.
@@ -19,6 +19,11 @@ export type ContentBlock = {
19
19
  data: string;
20
20
  };
21
21
  _meta?: ContentBlockMeta;
22
+ } | {
23
+ type: "shell_command";
24
+ command: string;
25
+ rawText: string;
26
+ _meta?: ContentBlockMeta;
22
27
  } | {
23
28
  type: "tool_use";
24
29
  id: string;
@@ -1,5 +1,29 @@
1
1
  import type { ContentBlock } from "../core/content.js";
2
2
  import type { Usage } from "../core/usage.js";
3
+ export type SessionForkRecord = {
4
+ id: string;
5
+ spaceId: string;
6
+ parentSessionId: string;
7
+ childSessionId: string;
8
+ rootSessionId: string;
9
+ depth: number;
10
+ anchorSourceSessionId: string;
11
+ anchorTurnId: string;
12
+ anchorSequence: number;
13
+ ancestorSessionIds: string[];
14
+ sessionPath: string[];
15
+ createdBy: string | null;
16
+ createdAt: string;
17
+ };
18
+ export type SessionTurnSegmentRecord = {
19
+ id: string;
20
+ sessionId: string;
21
+ ordinal: number;
22
+ sourceSessionId: string;
23
+ fromSequence: number;
24
+ toSequence: number | null;
25
+ createdAt: string;
26
+ };
3
27
  export type { MessageToolCallsFile, SessionTurnIntent, SessionTurnIntermediateIndex, SessionTurnIntermediateSummary, SessionTurnIndexItem, SessionTurnRecord, SessionTurnStatus, SessionTurnSummary, StoredIntermediateMessage, StoredToolCall, TurnIntermediateMessagesFile, } from "./turn.js";
4
28
  export type SessionPromptInput = {
5
29
  spaceId: string;
@@ -74,10 +98,6 @@ export type SessionRecord = {
74
98
  status: string | null;
75
99
  externalSessionId: string | null;
76
100
  meta: Record<string, unknown> | null;
77
- parentSessionId: string | null;
78
- forkedFromMessageId: string | null;
79
- lineageRootSessionId: string | null;
80
- forkDepth: number;
81
101
  latestMessageText: string | null;
82
102
  lastMessageAt: string | null;
83
103
  lastMessageId: string | null;
@@ -5,6 +5,8 @@ export type SessionTurnIntent = "steer" | "followup";
5
5
  export type SessionTurnSummary = {
6
6
  text?: string | null;
7
7
  finishReason?: "completed" | "failed" | "interrupted";
8
+ reason?: "steer" | "abort" | string;
9
+ continuedByTurnId?: string | null;
8
10
  interruptedByTurnId?: string | null;
9
11
  };
10
12
  export type SessionTurnIntermediateIndex = {
@@ -65,6 +67,8 @@ export type TurnIntermediateMessagesFile = {
65
67
  export type SessionTurnIndexItem = {
66
68
  id: string;
67
69
  sessionId: string;
70
+ sourceSessionId?: string;
71
+ sourceTurnId?: string;
68
72
  sequence: number;
69
73
  status: SessionTurnStatus;
70
74
  startedAt: string | null;
@@ -87,6 +91,8 @@ export type SessionTurnAuthorProfile = {
87
91
  export type SessionTurnRecord = {
88
92
  id: string;
89
93
  sessionId: string;
94
+ sourceSessionId?: string;
95
+ sourceTurnId?: string;
90
96
  userUuid: string | null;
91
97
  sequence: number;
92
98
  status: SessionTurnStatus;
@@ -24,6 +24,11 @@ export declare const contentBlockSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
24
24
  data: z.ZodString;
25
25
  }, z.core.$strip>]>;
26
26
  _meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
27
+ }, z.core.$strip>, z.ZodObject<{
28
+ type: z.ZodLiteral<"shell_command">;
29
+ command: z.ZodString;
30
+ rawText: z.ZodString;
31
+ _meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
27
32
  }, z.core.$strip>, z.ZodObject<{
28
33
  type: z.ZodLiteral<"tool_use">;
29
34
  id: z.ZodString;
@@ -81,6 +86,11 @@ export declare const wsClientEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
81
86
  data: z.ZodString;
82
87
  }, z.core.$strip>]>;
83
88
  _meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
89
+ }, z.core.$strip>, z.ZodObject<{
90
+ type: z.ZodLiteral<"shell_command">;
91
+ command: z.ZodString;
92
+ rawText: z.ZodString;
93
+ _meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
84
94
  }, z.core.$strip>, z.ZodObject<{
85
95
  type: z.ZodLiteral<"tool_use">;
86
96
  id: z.ZodString;
@@ -269,6 +279,8 @@ export type SessionRequestAcceptedEvent = {
269
279
  sessionId: string;
270
280
  payload: {
271
281
  clientMessageId?: string | null;
282
+ turnId?: string | null;
283
+ userMessageId?: string | null;
272
284
  };
273
285
  };
274
286
  export type SessionRequestErrorEvent = {
@@ -386,6 +398,7 @@ export type SessionTurnErrorEvent = {
386
398
  spaceId: string;
387
399
  sessionId: string;
388
400
  payload: {
401
+ turnId?: string | null;
389
402
  anchorUserMessageId: string | null;
390
403
  error: string;
391
404
  };
@@ -21,6 +21,12 @@ export const contentBlockSchema = z.discriminatedUnion("type", [
21
21
  ]),
22
22
  _meta: contentBlockMetaSchema.optional(),
23
23
  }),
24
+ z.object({
25
+ type: z.literal("shell_command"),
26
+ command: z.string(),
27
+ rawText: z.string(),
28
+ _meta: contentBlockMetaSchema.optional(),
29
+ }),
24
30
  z.object({
25
31
  type: z.literal("tool_use"),
26
32
  id: z.string(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@neta-art/cohub-protocol",
3
- "version": "1.3.0",
3
+ "version": "1.5.0",
4
4
  "description": "Shared protocol definitions for the Cohub agent collaboration platform.",
5
5
  "license": "UNLICENSED",
6
6
  "private": false,