@myagentroam/protocol 0.10.67 → 0.11.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.
- package/dist/index.d.ts +15 -14
- package/dist/index.js +1 -0
- package/dist/web-push.d.ts +7 -0
- package/dist/web-push.js +1 -0
- package/dist/workbench-notification.d.ts +260 -0
- package/dist/workbench-notification.js +41 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -15,6 +15,7 @@ export * from './terminal-direct.js';
|
|
|
15
15
|
export * from './mail-notification.js';
|
|
16
16
|
export * from './notification-channels.js';
|
|
17
17
|
export * from './web-push.js';
|
|
18
|
+
export * from './workbench-notification.js';
|
|
18
19
|
export * from './model-usage.js';
|
|
19
20
|
export * from './management-pagination.js';
|
|
20
21
|
export declare const healthStatusSchema: z.ZodObject<{
|
|
@@ -4226,20 +4227,20 @@ export declare const promptCompletionContextInputSchema: z.ZodObject<{
|
|
|
4226
4227
|
sessionId: string | null;
|
|
4227
4228
|
workbenchConnectionId: string;
|
|
4228
4229
|
runner: "mar-agent" | "codex" | "claude-code" | "opencode";
|
|
4229
|
-
pageEpoch: string;
|
|
4230
4230
|
target: {
|
|
4231
4231
|
kind: "WORKSPACE";
|
|
4232
4232
|
workspaceId: string;
|
|
4233
4233
|
};
|
|
4234
|
+
pageEpoch: string;
|
|
4234
4235
|
}, {
|
|
4235
4236
|
sessionId: string | null;
|
|
4236
4237
|
workbenchConnectionId: string;
|
|
4237
4238
|
runner: "mar-agent" | "codex" | "claude-code" | "opencode";
|
|
4238
|
-
pageEpoch: string;
|
|
4239
4239
|
target: {
|
|
4240
4240
|
kind: "WORKSPACE";
|
|
4241
4241
|
workspaceId: string;
|
|
4242
4242
|
};
|
|
4243
|
+
pageEpoch: string;
|
|
4243
4244
|
}>;
|
|
4244
4245
|
export type PromptCompletionContextInput = z.infer<typeof promptCompletionContextInputSchema>;
|
|
4245
4246
|
export declare const promptCompletionGenerateInputSchema: z.ZodObject<{
|
|
@@ -21841,15 +21842,15 @@ export declare const hostedConversationSnapshotSchema: z.ZodEffects<z.ZodObject<
|
|
|
21841
21842
|
code: string;
|
|
21842
21843
|
message: string;
|
|
21843
21844
|
} | null;
|
|
21844
|
-
models: {
|
|
21845
|
-
[x: string]: any;
|
|
21846
|
-
}[];
|
|
21847
21845
|
run: {
|
|
21848
21846
|
status: "SUCCEEDED" | "FAILED" | "CANCELLED" | "STARTING" | "RUNNING" | "CANCELLING" | "INTERRUPTED";
|
|
21849
21847
|
id: string;
|
|
21850
21848
|
startedAt: number | null;
|
|
21851
21849
|
completedAt: number | null;
|
|
21852
21850
|
} | null;
|
|
21851
|
+
models: {
|
|
21852
|
+
[x: string]: any;
|
|
21853
|
+
}[];
|
|
21853
21854
|
snapshotSequence: number;
|
|
21854
21855
|
turns: {
|
|
21855
21856
|
status: "SUCCEEDED" | "FAILED" | "CANCELLED" | "RUNNING" | "INTERRUPTED" | "PREPARING" | "WAITING_INPUT" | "WAITING_APPROVAL" | "LOST";
|
|
@@ -22489,15 +22490,15 @@ export declare const hostedConversationSnapshotSchema: z.ZodEffects<z.ZodObject<
|
|
|
22489
22490
|
code: string;
|
|
22490
22491
|
message: string;
|
|
22491
22492
|
} | null;
|
|
22492
|
-
models: {
|
|
22493
|
-
[x: string]: any;
|
|
22494
|
-
}[];
|
|
22495
22493
|
run: {
|
|
22496
22494
|
status: "SUCCEEDED" | "FAILED" | "CANCELLED" | "STARTING" | "RUNNING" | "CANCELLING" | "INTERRUPTED";
|
|
22497
22495
|
id: string;
|
|
22498
22496
|
startedAt: number | null;
|
|
22499
22497
|
completedAt: number | null;
|
|
22500
22498
|
} | null;
|
|
22499
|
+
models: {
|
|
22500
|
+
[x: string]: any;
|
|
22501
|
+
}[];
|
|
22501
22502
|
snapshotSequence: number;
|
|
22502
22503
|
turns: {
|
|
22503
22504
|
status: "SUCCEEDED" | "FAILED" | "CANCELLED" | "RUNNING" | "INTERRUPTED" | "PREPARING" | "WAITING_INPUT" | "WAITING_APPROVAL" | "LOST";
|
|
@@ -23137,15 +23138,15 @@ export declare const hostedConversationSnapshotSchema: z.ZodEffects<z.ZodObject<
|
|
|
23137
23138
|
code: string;
|
|
23138
23139
|
message: string;
|
|
23139
23140
|
} | null;
|
|
23140
|
-
models: {
|
|
23141
|
-
[x: string]: any;
|
|
23142
|
-
}[];
|
|
23143
23141
|
run: {
|
|
23144
23142
|
status: "SUCCEEDED" | "FAILED" | "CANCELLED" | "STARTING" | "RUNNING" | "CANCELLING" | "INTERRUPTED";
|
|
23145
23143
|
id: string;
|
|
23146
23144
|
startedAt: number | null;
|
|
23147
23145
|
completedAt: number | null;
|
|
23148
23146
|
} | null;
|
|
23147
|
+
models: {
|
|
23148
|
+
[x: string]: any;
|
|
23149
|
+
}[];
|
|
23149
23150
|
snapshotSequence: number;
|
|
23150
23151
|
turns: {
|
|
23151
23152
|
status: "SUCCEEDED" | "FAILED" | "CANCELLED" | "RUNNING" | "INTERRUPTED" | "PREPARING" | "WAITING_INPUT" | "WAITING_APPROVAL" | "LOST";
|
|
@@ -23785,15 +23786,15 @@ export declare const hostedConversationSnapshotSchema: z.ZodEffects<z.ZodObject<
|
|
|
23785
23786
|
code: string;
|
|
23786
23787
|
message: string;
|
|
23787
23788
|
} | null;
|
|
23788
|
-
models: {
|
|
23789
|
-
[x: string]: any;
|
|
23790
|
-
}[];
|
|
23791
23789
|
run: {
|
|
23792
23790
|
status: "SUCCEEDED" | "FAILED" | "CANCELLED" | "STARTING" | "RUNNING" | "CANCELLING" | "INTERRUPTED";
|
|
23793
23791
|
id: string;
|
|
23794
23792
|
startedAt: number | null;
|
|
23795
23793
|
completedAt: number | null;
|
|
23796
23794
|
} | null;
|
|
23795
|
+
models: {
|
|
23796
|
+
[x: string]: any;
|
|
23797
|
+
}[];
|
|
23797
23798
|
snapshotSequence: number;
|
|
23798
23799
|
turns: {
|
|
23799
23800
|
status: "SUCCEEDED" | "FAILED" | "CANCELLED" | "RUNNING" | "INTERRUPTED" | "PREPARING" | "WAITING_INPUT" | "WAITING_APPROVAL" | "LOST";
|
package/dist/index.js
CHANGED
|
@@ -20,6 +20,7 @@ export * from './terminal-direct.js';
|
|
|
20
20
|
export * from './mail-notification.js';
|
|
21
21
|
export * from './notification-channels.js';
|
|
22
22
|
export * from './web-push.js';
|
|
23
|
+
export * from './workbench-notification.js';
|
|
23
24
|
export * from './model-usage.js';
|
|
24
25
|
export * from './management-pagination.js';
|
|
25
26
|
export const healthStatusSchema = z.object({
|
package/dist/web-push.d.ts
CHANGED
|
@@ -28,6 +28,7 @@ export declare const webPushSubscriptionSchema: z.ZodObject<{
|
|
|
28
28
|
expirationTime?: number | null | undefined;
|
|
29
29
|
}>;
|
|
30
30
|
export declare const webPushRegistrationSchema: z.ZodObject<{
|
|
31
|
+
clientKind: z.ZodLiteral<"mobile">;
|
|
31
32
|
clientToken: z.ZodString;
|
|
32
33
|
subscription: z.ZodObject<{
|
|
33
34
|
endpoint: z.ZodString;
|
|
@@ -61,6 +62,7 @@ export declare const webPushRegistrationSchema: z.ZodObject<{
|
|
|
61
62
|
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
62
63
|
}, "strict", z.ZodTypeAny, {
|
|
63
64
|
enabled: boolean;
|
|
65
|
+
clientKind: "mobile";
|
|
64
66
|
clientToken: string;
|
|
65
67
|
subscription: {
|
|
66
68
|
keys: {
|
|
@@ -72,6 +74,7 @@ export declare const webPushRegistrationSchema: z.ZodObject<{
|
|
|
72
74
|
};
|
|
73
75
|
bindingVersion?: number | undefined;
|
|
74
76
|
}, {
|
|
77
|
+
clientKind: "mobile";
|
|
75
78
|
clientToken: string;
|
|
76
79
|
subscription: {
|
|
77
80
|
keys: {
|
|
@@ -86,6 +89,7 @@ export declare const webPushRegistrationSchema: z.ZodObject<{
|
|
|
86
89
|
}>;
|
|
87
90
|
export type WebPushRegistration = z.input<typeof webPushRegistrationSchema>;
|
|
88
91
|
export declare const webPushClientRequestSchema: z.ZodObject<{
|
|
92
|
+
clientKind: z.ZodLiteral<"mobile">;
|
|
89
93
|
clientToken: z.ZodString;
|
|
90
94
|
subscription: z.ZodObject<{
|
|
91
95
|
endpoint: z.ZodString;
|
|
@@ -121,6 +125,7 @@ export declare const webPushClientRequestSchema: z.ZodObject<{
|
|
|
121
125
|
expectedAccount: z.ZodString;
|
|
122
126
|
}, "strict", z.ZodTypeAny, {
|
|
123
127
|
enabled: boolean;
|
|
128
|
+
clientKind: "mobile";
|
|
124
129
|
clientToken: string;
|
|
125
130
|
subscription: {
|
|
126
131
|
keys: {
|
|
@@ -133,6 +138,7 @@ export declare const webPushClientRequestSchema: z.ZodObject<{
|
|
|
133
138
|
expectedAccount: string;
|
|
134
139
|
bindingVersion?: number | undefined;
|
|
135
140
|
}, {
|
|
141
|
+
clientKind: "mobile";
|
|
136
142
|
clientToken: string;
|
|
137
143
|
subscription: {
|
|
138
144
|
keys: {
|
|
@@ -147,6 +153,7 @@ export declare const webPushClientRequestSchema: z.ZodObject<{
|
|
|
147
153
|
bindingVersion?: number | undefined;
|
|
148
154
|
}>;
|
|
149
155
|
export declare const webPushClientResolveSchema: z.ZodObject<Pick<{
|
|
156
|
+
clientKind: z.ZodLiteral<"mobile">;
|
|
150
157
|
clientToken: z.ZodString;
|
|
151
158
|
subscription: z.ZodObject<{
|
|
152
159
|
endpoint: z.ZodString;
|
package/dist/web-push.js
CHANGED
|
@@ -13,6 +13,7 @@ export const webPushSubscriptionSchema = z
|
|
|
13
13
|
.strict();
|
|
14
14
|
export const webPushRegistrationSchema = z
|
|
15
15
|
.object({
|
|
16
|
+
clientKind: z.literal('mobile'),
|
|
16
17
|
clientToken: z.string().regex(/^[A-Za-z0-9_-]{43}$/u),
|
|
17
18
|
subscription: webPushSubscriptionSchema,
|
|
18
19
|
bindingVersion: z.number().int().positive().safe().optional(),
|
|
@@ -0,0 +1,260 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const notificationTargetSchema: z.ZodDiscriminatedUnion<"targetType", [z.ZodObject<{
|
|
3
|
+
targetType: z.ZodLiteral<"WORKSPACE_SESSION">;
|
|
4
|
+
nodeId: z.ZodString;
|
|
5
|
+
workspaceId: z.ZodString;
|
|
6
|
+
sessionId: z.ZodString;
|
|
7
|
+
sessionName: z.ZodOptional<z.ZodString>;
|
|
8
|
+
}, "strict", z.ZodTypeAny, {
|
|
9
|
+
sessionId: string;
|
|
10
|
+
workspaceId: string;
|
|
11
|
+
nodeId: string;
|
|
12
|
+
targetType: "WORKSPACE_SESSION";
|
|
13
|
+
sessionName?: string | undefined;
|
|
14
|
+
}, {
|
|
15
|
+
sessionId: string;
|
|
16
|
+
workspaceId: string;
|
|
17
|
+
nodeId: string;
|
|
18
|
+
targetType: "WORKSPACE_SESSION";
|
|
19
|
+
sessionName?: string | undefined;
|
|
20
|
+
}>, z.ZodObject<{
|
|
21
|
+
targetType: z.ZodLiteral<"HOSTED_CONVERSATION">;
|
|
22
|
+
nodeId: z.ZodString;
|
|
23
|
+
conversationId: z.ZodString;
|
|
24
|
+
conversationName: z.ZodString;
|
|
25
|
+
}, "strict", z.ZodTypeAny, {
|
|
26
|
+
nodeId: string;
|
|
27
|
+
targetType: "HOSTED_CONVERSATION";
|
|
28
|
+
conversationId: string;
|
|
29
|
+
conversationName: string;
|
|
30
|
+
}, {
|
|
31
|
+
nodeId: string;
|
|
32
|
+
targetType: "HOSTED_CONVERSATION";
|
|
33
|
+
conversationId: string;
|
|
34
|
+
conversationName: string;
|
|
35
|
+
}>]>;
|
|
36
|
+
export declare const serverNotificationSchema: z.ZodObject<{
|
|
37
|
+
id: z.ZodString;
|
|
38
|
+
kind: z.ZodEnum<["run", "approval", "plan", "user-input", "schedule", "agent"]>;
|
|
39
|
+
title: z.ZodString;
|
|
40
|
+
message: z.ZodString;
|
|
41
|
+
createdAt: z.ZodNumber;
|
|
42
|
+
updatedAt: z.ZodNumber;
|
|
43
|
+
expiresAt: z.ZodNumber;
|
|
44
|
+
read: z.ZodBoolean;
|
|
45
|
+
target: z.ZodDiscriminatedUnion<"targetType", [z.ZodObject<{
|
|
46
|
+
targetType: z.ZodLiteral<"WORKSPACE_SESSION">;
|
|
47
|
+
nodeId: z.ZodString;
|
|
48
|
+
workspaceId: z.ZodString;
|
|
49
|
+
sessionId: z.ZodString;
|
|
50
|
+
sessionName: z.ZodOptional<z.ZodString>;
|
|
51
|
+
}, "strict", z.ZodTypeAny, {
|
|
52
|
+
sessionId: string;
|
|
53
|
+
workspaceId: string;
|
|
54
|
+
nodeId: string;
|
|
55
|
+
targetType: "WORKSPACE_SESSION";
|
|
56
|
+
sessionName?: string | undefined;
|
|
57
|
+
}, {
|
|
58
|
+
sessionId: string;
|
|
59
|
+
workspaceId: string;
|
|
60
|
+
nodeId: string;
|
|
61
|
+
targetType: "WORKSPACE_SESSION";
|
|
62
|
+
sessionName?: string | undefined;
|
|
63
|
+
}>, z.ZodObject<{
|
|
64
|
+
targetType: z.ZodLiteral<"HOSTED_CONVERSATION">;
|
|
65
|
+
nodeId: z.ZodString;
|
|
66
|
+
conversationId: z.ZodString;
|
|
67
|
+
conversationName: z.ZodString;
|
|
68
|
+
}, "strict", z.ZodTypeAny, {
|
|
69
|
+
nodeId: string;
|
|
70
|
+
targetType: "HOSTED_CONVERSATION";
|
|
71
|
+
conversationId: string;
|
|
72
|
+
conversationName: string;
|
|
73
|
+
}, {
|
|
74
|
+
nodeId: string;
|
|
75
|
+
targetType: "HOSTED_CONVERSATION";
|
|
76
|
+
conversationId: string;
|
|
77
|
+
conversationName: string;
|
|
78
|
+
}>]>;
|
|
79
|
+
}, "strict", z.ZodTypeAny, {
|
|
80
|
+
message: string;
|
|
81
|
+
expiresAt: number;
|
|
82
|
+
kind: "run" | "approval" | "plan" | "user-input" | "schedule" | "agent";
|
|
83
|
+
id: string;
|
|
84
|
+
createdAt: number;
|
|
85
|
+
updatedAt: number;
|
|
86
|
+
title: string;
|
|
87
|
+
read: boolean;
|
|
88
|
+
target: {
|
|
89
|
+
sessionId: string;
|
|
90
|
+
workspaceId: string;
|
|
91
|
+
nodeId: string;
|
|
92
|
+
targetType: "WORKSPACE_SESSION";
|
|
93
|
+
sessionName?: string | undefined;
|
|
94
|
+
} | {
|
|
95
|
+
nodeId: string;
|
|
96
|
+
targetType: "HOSTED_CONVERSATION";
|
|
97
|
+
conversationId: string;
|
|
98
|
+
conversationName: string;
|
|
99
|
+
};
|
|
100
|
+
}, {
|
|
101
|
+
message: string;
|
|
102
|
+
expiresAt: number;
|
|
103
|
+
kind: "run" | "approval" | "plan" | "user-input" | "schedule" | "agent";
|
|
104
|
+
id: string;
|
|
105
|
+
createdAt: number;
|
|
106
|
+
updatedAt: number;
|
|
107
|
+
title: string;
|
|
108
|
+
read: boolean;
|
|
109
|
+
target: {
|
|
110
|
+
sessionId: string;
|
|
111
|
+
workspaceId: string;
|
|
112
|
+
nodeId: string;
|
|
113
|
+
targetType: "WORKSPACE_SESSION";
|
|
114
|
+
sessionName?: string | undefined;
|
|
115
|
+
} | {
|
|
116
|
+
nodeId: string;
|
|
117
|
+
targetType: "HOSTED_CONVERSATION";
|
|
118
|
+
conversationId: string;
|
|
119
|
+
conversationName: string;
|
|
120
|
+
};
|
|
121
|
+
}>;
|
|
122
|
+
export declare const notificationCreatedSchema: z.ZodObject<{
|
|
123
|
+
type: z.ZodLiteral<"notification.created">;
|
|
124
|
+
notification: z.ZodObject<{
|
|
125
|
+
id: z.ZodString;
|
|
126
|
+
kind: z.ZodEnum<["run", "approval", "plan", "user-input", "schedule", "agent"]>;
|
|
127
|
+
title: z.ZodString;
|
|
128
|
+
message: z.ZodString;
|
|
129
|
+
createdAt: z.ZodNumber;
|
|
130
|
+
updatedAt: z.ZodNumber;
|
|
131
|
+
expiresAt: z.ZodNumber;
|
|
132
|
+
read: z.ZodBoolean;
|
|
133
|
+
target: z.ZodDiscriminatedUnion<"targetType", [z.ZodObject<{
|
|
134
|
+
targetType: z.ZodLiteral<"WORKSPACE_SESSION">;
|
|
135
|
+
nodeId: z.ZodString;
|
|
136
|
+
workspaceId: z.ZodString;
|
|
137
|
+
sessionId: z.ZodString;
|
|
138
|
+
sessionName: z.ZodOptional<z.ZodString>;
|
|
139
|
+
}, "strict", z.ZodTypeAny, {
|
|
140
|
+
sessionId: string;
|
|
141
|
+
workspaceId: string;
|
|
142
|
+
nodeId: string;
|
|
143
|
+
targetType: "WORKSPACE_SESSION";
|
|
144
|
+
sessionName?: string | undefined;
|
|
145
|
+
}, {
|
|
146
|
+
sessionId: string;
|
|
147
|
+
workspaceId: string;
|
|
148
|
+
nodeId: string;
|
|
149
|
+
targetType: "WORKSPACE_SESSION";
|
|
150
|
+
sessionName?: string | undefined;
|
|
151
|
+
}>, z.ZodObject<{
|
|
152
|
+
targetType: z.ZodLiteral<"HOSTED_CONVERSATION">;
|
|
153
|
+
nodeId: z.ZodString;
|
|
154
|
+
conversationId: z.ZodString;
|
|
155
|
+
conversationName: z.ZodString;
|
|
156
|
+
}, "strict", z.ZodTypeAny, {
|
|
157
|
+
nodeId: string;
|
|
158
|
+
targetType: "HOSTED_CONVERSATION";
|
|
159
|
+
conversationId: string;
|
|
160
|
+
conversationName: string;
|
|
161
|
+
}, {
|
|
162
|
+
nodeId: string;
|
|
163
|
+
targetType: "HOSTED_CONVERSATION";
|
|
164
|
+
conversationId: string;
|
|
165
|
+
conversationName: string;
|
|
166
|
+
}>]>;
|
|
167
|
+
}, "strict", z.ZodTypeAny, {
|
|
168
|
+
message: string;
|
|
169
|
+
expiresAt: number;
|
|
170
|
+
kind: "run" | "approval" | "plan" | "user-input" | "schedule" | "agent";
|
|
171
|
+
id: string;
|
|
172
|
+
createdAt: number;
|
|
173
|
+
updatedAt: number;
|
|
174
|
+
title: string;
|
|
175
|
+
read: boolean;
|
|
176
|
+
target: {
|
|
177
|
+
sessionId: string;
|
|
178
|
+
workspaceId: string;
|
|
179
|
+
nodeId: string;
|
|
180
|
+
targetType: "WORKSPACE_SESSION";
|
|
181
|
+
sessionName?: string | undefined;
|
|
182
|
+
} | {
|
|
183
|
+
nodeId: string;
|
|
184
|
+
targetType: "HOSTED_CONVERSATION";
|
|
185
|
+
conversationId: string;
|
|
186
|
+
conversationName: string;
|
|
187
|
+
};
|
|
188
|
+
}, {
|
|
189
|
+
message: string;
|
|
190
|
+
expiresAt: number;
|
|
191
|
+
kind: "run" | "approval" | "plan" | "user-input" | "schedule" | "agent";
|
|
192
|
+
id: string;
|
|
193
|
+
createdAt: number;
|
|
194
|
+
updatedAt: number;
|
|
195
|
+
title: string;
|
|
196
|
+
read: boolean;
|
|
197
|
+
target: {
|
|
198
|
+
sessionId: string;
|
|
199
|
+
workspaceId: string;
|
|
200
|
+
nodeId: string;
|
|
201
|
+
targetType: "WORKSPACE_SESSION";
|
|
202
|
+
sessionName?: string | undefined;
|
|
203
|
+
} | {
|
|
204
|
+
nodeId: string;
|
|
205
|
+
targetType: "HOSTED_CONVERSATION";
|
|
206
|
+
conversationId: string;
|
|
207
|
+
conversationName: string;
|
|
208
|
+
};
|
|
209
|
+
}>;
|
|
210
|
+
}, "strict", z.ZodTypeAny, {
|
|
211
|
+
type: "notification.created";
|
|
212
|
+
notification: {
|
|
213
|
+
message: string;
|
|
214
|
+
expiresAt: number;
|
|
215
|
+
kind: "run" | "approval" | "plan" | "user-input" | "schedule" | "agent";
|
|
216
|
+
id: string;
|
|
217
|
+
createdAt: number;
|
|
218
|
+
updatedAt: number;
|
|
219
|
+
title: string;
|
|
220
|
+
read: boolean;
|
|
221
|
+
target: {
|
|
222
|
+
sessionId: string;
|
|
223
|
+
workspaceId: string;
|
|
224
|
+
nodeId: string;
|
|
225
|
+
targetType: "WORKSPACE_SESSION";
|
|
226
|
+
sessionName?: string | undefined;
|
|
227
|
+
} | {
|
|
228
|
+
nodeId: string;
|
|
229
|
+
targetType: "HOSTED_CONVERSATION";
|
|
230
|
+
conversationId: string;
|
|
231
|
+
conversationName: string;
|
|
232
|
+
};
|
|
233
|
+
};
|
|
234
|
+
}, {
|
|
235
|
+
type: "notification.created";
|
|
236
|
+
notification: {
|
|
237
|
+
message: string;
|
|
238
|
+
expiresAt: number;
|
|
239
|
+
kind: "run" | "approval" | "plan" | "user-input" | "schedule" | "agent";
|
|
240
|
+
id: string;
|
|
241
|
+
createdAt: number;
|
|
242
|
+
updatedAt: number;
|
|
243
|
+
title: string;
|
|
244
|
+
read: boolean;
|
|
245
|
+
target: {
|
|
246
|
+
sessionId: string;
|
|
247
|
+
workspaceId: string;
|
|
248
|
+
nodeId: string;
|
|
249
|
+
targetType: "WORKSPACE_SESSION";
|
|
250
|
+
sessionName?: string | undefined;
|
|
251
|
+
} | {
|
|
252
|
+
nodeId: string;
|
|
253
|
+
targetType: "HOSTED_CONVERSATION";
|
|
254
|
+
conversationId: string;
|
|
255
|
+
conversationName: string;
|
|
256
|
+
};
|
|
257
|
+
};
|
|
258
|
+
}>;
|
|
259
|
+
export type NotificationTarget = Readonly<z.infer<typeof notificationTargetSchema>>;
|
|
260
|
+
export type ServerNotification = Readonly<z.infer<typeof serverNotificationSchema>>;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
const identity = z.string().min(1).max(256);
|
|
3
|
+
const timestamp = z.number().int().nonnegative().safe();
|
|
4
|
+
export const notificationTargetSchema = z.discriminatedUnion('targetType', [
|
|
5
|
+
z
|
|
6
|
+
.object({
|
|
7
|
+
targetType: z.literal('WORKSPACE_SESSION'),
|
|
8
|
+
nodeId: identity,
|
|
9
|
+
workspaceId: identity,
|
|
10
|
+
sessionId: identity,
|
|
11
|
+
sessionName: z.string().optional()
|
|
12
|
+
})
|
|
13
|
+
.strict(),
|
|
14
|
+
z
|
|
15
|
+
.object({
|
|
16
|
+
targetType: z.literal('HOSTED_CONVERSATION'),
|
|
17
|
+
nodeId: identity,
|
|
18
|
+
conversationId: identity,
|
|
19
|
+
conversationName: z.string()
|
|
20
|
+
})
|
|
21
|
+
.strict()
|
|
22
|
+
]);
|
|
23
|
+
export const serverNotificationSchema = z
|
|
24
|
+
.object({
|
|
25
|
+
id: identity,
|
|
26
|
+
kind: z.enum(['run', 'approval', 'plan', 'user-input', 'schedule', 'agent']),
|
|
27
|
+
title: z.string(),
|
|
28
|
+
message: z.string().max(4000),
|
|
29
|
+
createdAt: timestamp,
|
|
30
|
+
updatedAt: timestamp,
|
|
31
|
+
expiresAt: timestamp,
|
|
32
|
+
read: z.boolean(),
|
|
33
|
+
target: notificationTargetSchema
|
|
34
|
+
})
|
|
35
|
+
.strict();
|
|
36
|
+
export const notificationCreatedSchema = z
|
|
37
|
+
.object({
|
|
38
|
+
type: z.literal('notification.created'),
|
|
39
|
+
notification: serverNotificationSchema
|
|
40
|
+
})
|
|
41
|
+
.strict();
|