@imenam/mcp-organizer 1.0.11 → 1.0.13
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/README.md +728 -714
- package/dist/shared/schemas/agent-api.schema.d.ts +40 -2
- package/dist/shared/schemas/agent-api.schema.js +12 -3
- package/dist/shared/schemas/agent-tools.schema.d.ts +373 -6
- package/dist/shared/schemas/agent-tools.schema.js +54 -3
- package/dist/shared/schemas/api.schema.d.ts +26 -0
- package/dist/shared/schemas/api.schema.js +9 -0
- package/dist/shared/schemas/entities.schema.d.ts +32 -2
- package/dist/shared/schemas/entities.schema.js +27 -3
- package/dist/shared/schemas/enums.schema.d.ts +4 -2
- package/dist/shared/schemas/enums.schema.js +2 -1
- package/dist/shared/schemas/gui-api.schema.d.ts +6 -3
- package/dist/shared/schemas/gui-api.schema.js +6 -3
- package/dist/shared/schemas/notifications-api.schema.d.ts +29 -7
- package/dist/shared/schemas/notifications-api.schema.js +21 -5
- package/dist/shared/schemas/tasks-api.schema.d.ts +82 -0
- package/dist/shared/schemas/tasks-api.schema.js +35 -0
- package/dist/src/agent-api/requests.d.ts +1 -1
- package/dist/src/agent-api/requests.js +56 -4
- package/dist/src/agent-api/router.js +2 -1
- package/dist/src/agent-api/views.d.ts +2 -0
- package/dist/src/agent-api/views.js +203 -0
- package/dist/src/core/agent.d.ts +5 -1
- package/dist/src/core/agent.js +61 -2
- package/dist/src/core/board-views.d.ts +11 -1
- package/dist/src/core/board-views.js +28 -11
- package/dist/src/core/follow-ups.d.ts +7 -0
- package/dist/src/core/follow-ups.js +15 -0
- package/dist/src/core/history.d.ts +2 -1
- package/dist/src/core/history.js +62 -3
- package/dist/src/core/migrations.js +479 -424
- package/dist/src/core/notifications.js +36 -9
- package/dist/src/core/requests.d.ts +10 -1
- package/dist/src/core/requests.js +41 -3
- package/dist/src/core/snapshots.d.ts +4 -4
- package/dist/src/core/snapshots.js +6 -2
- package/dist/src/core/spaces.d.ts +2 -2
- package/dist/src/core/spaces.js +12 -6
- package/dist/src/core/store.d.ts +43 -6
- package/dist/src/core/store.js +202 -71
- package/dist/src/core/tasks.d.ts +21 -1
- package/dist/src/core/tasks.js +100 -10
- package/dist/src/gui-api.js +14 -7
- package/dist/src/mcp/start.d.ts +1 -1
- package/dist/src/mcp/start.js +4 -3
- package/dist/src/mcp/tools.js +86 -2
- package/dist/src/server/runner.js +4 -18
- package/gui/dist/assets/{index-BLhlceSY.css → index-CVwckTU6.css} +1 -1
- package/gui/dist/assets/index-CkZPrGSS.js +99 -0
- package/gui/dist/index.html +2 -2
- package/package.json +1 -1
- package/gui/dist/assets/index-Em4IQgbR.js +0 -98
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import { MemberRoleSchema, REQUEST_STATUSES, RequestKindSchema, RequestStatusSchema, SpaceKindSchema, TASK_PRIORITIES, TASK_STATUSES, TASK_TYPES, TaskPrioritySchema, TaskStatusSchema, TaskTypeSchema, TestResultValueSchema, } from "./enums.schema.js";
|
|
3
|
-
import { IdSchema, TimestampSchema } from "./entities.schema.js";
|
|
2
|
+
import { BOARD_GROUPINGS, BOARD_LAYOUTS, BoardGroupingSchema, BoardLayoutSchema, MemberRoleSchema, REQUEST_STATUSES, RequestKindSchema, RequestStatusSchema, SpaceKindSchema, TASK_PRIORITIES, TASK_STATUSES, TASK_TYPES, TaskPrioritySchema, TaskStatusSchema, TaskTypeSchema, TestResultValueSchema, } from "./enums.schema.js";
|
|
3
|
+
import { IdSchema, MAX_BOARD_VIEW_NAME_LENGTH, TimestampSchema } from "./entities.schema.js";
|
|
4
4
|
import { MAX_TAG_LENGTH, MAX_TASK_TITLE_LENGTH } from "./tasks-api.schema.js";
|
|
5
5
|
/**
|
|
6
6
|
* API des agents (`/api/agent/*`), partagée par le site et le mode MCP :
|
|
@@ -52,6 +52,13 @@ export const CompleteRequestBodySchema = z
|
|
|
52
52
|
})
|
|
53
53
|
.strict();
|
|
54
54
|
export const FailRequestBodySchema = z.object({ reason: z.string().max(MAX_REASON_LENGTH) }).strict();
|
|
55
|
+
/** `POST requests/:id/follow-ups` : points de la demande d'origine que la suite règle (ou rouvre, avec `done: false`). */
|
|
56
|
+
export const CheckFollowUpsBodySchema = z
|
|
57
|
+
.object({
|
|
58
|
+
follow_ups: z.array(z.string().min(1)).min(1).max(MAX_FOLLOW_UPS),
|
|
59
|
+
done: z.boolean().default(true),
|
|
60
|
+
})
|
|
61
|
+
.strict();
|
|
55
62
|
/** `GET tasks` : recherche par mots et filtres. */
|
|
56
63
|
export const SearchTasksQuerySchema = z
|
|
57
64
|
.object({
|
|
@@ -115,6 +122,23 @@ export const PromoteIdeaBodySchema = z
|
|
|
115
122
|
parent: RefSchema.optional(),
|
|
116
123
|
})
|
|
117
124
|
.strict();
|
|
125
|
+
/** `GET views` : vues de l'auteur de la demande. */
|
|
126
|
+
export const ListViewsQuerySchema = z.object({ request_id: RequestIdSchema }).strict();
|
|
127
|
+
/** Réglages d'une vue tels que l'agent les passe ; `assignees` : identifiants ou adresses e-mail de membres. */
|
|
128
|
+
const ViewSettingsBodySchema = z.object({
|
|
129
|
+
name: z.string().max(MAX_BOARD_VIEW_NAME_LENGTH),
|
|
130
|
+
layout: z.enum(BOARD_LAYOUTS),
|
|
131
|
+
group_by: z.enum(BOARD_GROUPINGS),
|
|
132
|
+
then_by: z.enum(BOARD_GROUPINGS),
|
|
133
|
+
show_empty_groups: z.boolean(),
|
|
134
|
+
statuses: z.array(z.enum(TASK_STATUSES)),
|
|
135
|
+
priorities: z.array(z.enum(TASK_PRIORITIES)),
|
|
136
|
+
assignees: z.array(z.string().min(1)),
|
|
137
|
+
unassigned: z.boolean(),
|
|
138
|
+
});
|
|
139
|
+
export const CreateViewBodySchema = ViewSettingsBodySchema.partial().extend({ request_id: RequestIdSchema, name: ViewSettingsBodySchema.shape.name }).strict();
|
|
140
|
+
export const UpdateViewBodySchema = ViewSettingsBodySchema.partial().extend({ request_id: RequestIdSchema }).strict();
|
|
141
|
+
export const DeleteViewBodySchema = z.object({ request_id: RequestIdSchema }).strict();
|
|
118
142
|
// --- Réponses ---------------------------------------------------------------------
|
|
119
143
|
/** Enveloppe de toute réponse réussie : texte pour l'agent et données structurées. */
|
|
120
144
|
export const AgentEnvelopeSchema = z.object({ text: z.string(), data: z.unknown() });
|
|
@@ -134,6 +158,8 @@ export const AgentTaskSummarySchema = z.object({
|
|
|
134
158
|
assigneeIds: z.array(IdSchema),
|
|
135
159
|
tags: z.array(z.string()),
|
|
136
160
|
});
|
|
161
|
+
/** Point à régler laissé à l'auteur d'une demande, coché ou non. */
|
|
162
|
+
export const AgentFollowUpSchema = z.object({ id: IdSchema, text: z.string(), done: z.boolean() });
|
|
137
163
|
export const AgentRequestSummarySchema = z.object({
|
|
138
164
|
id: IdSchema,
|
|
139
165
|
kind: RequestKindSchema,
|
|
@@ -147,8 +173,10 @@ export const AgentRequestSummarySchema = z.object({
|
|
|
147
173
|
/** Vrai si la demande est prise par le jeton qui appelle. */
|
|
148
174
|
claimedByThisToken: z.boolean(),
|
|
149
175
|
reply: z.string().nullable(),
|
|
150
|
-
followUps: z.array(
|
|
176
|
+
followUps: z.array(AgentFollowUpSchema),
|
|
151
177
|
failureReason: z.string().nullable(),
|
|
178
|
+
/** Demande d'origine dont celle-ci est une suite ; null pour une demande d'origine. */
|
|
179
|
+
parentRequestId: IdSchema.nullable(),
|
|
152
180
|
});
|
|
153
181
|
export const AgentIdeaSchema = z.object({ id: IdSchema, text: z.string(), archived: z.boolean(), promotedTaskKey: z.string().nullable(), createdAt: TimestampSchema });
|
|
154
182
|
export const ListRequestsDataSchema = z.object({ space: AgentSpaceSchema, requests: z.array(AgentRequestSummarySchema) });
|
|
@@ -156,6 +184,10 @@ export const ClaimRequestDataSchema = z.object({
|
|
|
156
184
|
request: AgentRequestSummarySchema,
|
|
157
185
|
/** Échanges précédents de l'auteur dans l'espace, du plus ancien au plus récent, pour une demande de type message. */
|
|
158
186
|
history: z.array(AgentRequestSummarySchema),
|
|
187
|
+
/** Pour une demande confiée par un commentaire de tâche : les commentaires du fil jusqu'à celui-ci, du plus ancien au plus récent ; null sinon. */
|
|
188
|
+
thread: z.array(z.object({ authorName: z.string(), byAgent: z.boolean(), body: z.string(), createdAt: TimestampSchema })).nullable(),
|
|
189
|
+
/** Pour une suite : la demande d'origine (avec ses points) et ses suites précédentes ; null sinon. */
|
|
190
|
+
parent: z.object({ request: AgentRequestSummarySchema, suites: z.array(AgentRequestSummarySchema) }).nullable(),
|
|
159
191
|
/** Instructions personnalisées à suivre : celles du site, puis celles de l'espace ; null quand il n'y en a pas. */
|
|
160
192
|
instructions: z.object({ site: z.string().nullable(), space: z.string().nullable() }),
|
|
161
193
|
space: AgentSpaceSchema,
|
|
@@ -164,6 +196,8 @@ export const ClaimRequestDataSchema = z.object({
|
|
|
164
196
|
ideas: z.array(AgentIdeaSchema),
|
|
165
197
|
});
|
|
166
198
|
export const FinishRequestDataSchema = z.object({ request: AgentRequestSummarySchema, actionCount: z.number().int().min(0) });
|
|
199
|
+
/** Demande d'origine après que la suite a coché ou rouvert ses points. */
|
|
200
|
+
export const CheckFollowUpsDataSchema = z.object({ request: AgentRequestSummarySchema });
|
|
167
201
|
export const ContextDataSchema = z.object({
|
|
168
202
|
space: AgentSpaceSchema,
|
|
169
203
|
members: z.array(AgentMemberSchema),
|
|
@@ -190,6 +224,23 @@ export const ChecklistDataSchema = z.object({
|
|
|
190
224
|
export const CommentDataSchema = z.object({ task: AgentTaskSummarySchema, commentId: IdSchema });
|
|
191
225
|
export const IdeaDataSchema = z.object({ idea: AgentIdeaSchema });
|
|
192
226
|
export const PromoteIdeaDataSchema = z.object({ idea: AgentIdeaSchema, task: AgentTaskSummarySchema });
|
|
227
|
+
/** Vue du tableau de bord d'un membre ; filtres vides : toutes les valeurs. */
|
|
228
|
+
export const AgentViewSchema = z.object({
|
|
229
|
+
id: IdSchema,
|
|
230
|
+
name: z.string(),
|
|
231
|
+
layout: BoardLayoutSchema,
|
|
232
|
+
groupBy: BoardGroupingSchema,
|
|
233
|
+
thenBy: BoardGroupingSchema,
|
|
234
|
+
showEmptyGroups: z.boolean(),
|
|
235
|
+
statuses: z.array(TaskStatusSchema),
|
|
236
|
+
priorities: z.array(TaskPrioritySchema),
|
|
237
|
+
assigneeIds: z.array(IdSchema),
|
|
238
|
+
unassigned: z.boolean(),
|
|
239
|
+
});
|
|
240
|
+
const ViewOwnerSchema = z.object({ id: IdSchema, name: z.string(), email: z.string() });
|
|
241
|
+
/** Vues de l'auteur de la demande, dans l'ordre de ses onglets. */
|
|
242
|
+
export const ViewsDataSchema = z.object({ owner: ViewOwnerSchema, views: z.array(AgentViewSchema) });
|
|
243
|
+
export const ViewDataSchema = z.object({ owner: ViewOwnerSchema, view: AgentViewSchema });
|
|
193
244
|
/** Présence d'un veilleur de notifications pour le jeton. */
|
|
194
245
|
export const AgentWatcherSchema = z.object({ armed: z.boolean(), since: TimestampSchema.nullable(), lastSeen: TimestampSchema.nullable() });
|
|
195
246
|
/**
|
|
@@ -112,6 +112,14 @@ export declare const RenameSpaceRequestSchema: z.ZodObject<{
|
|
|
112
112
|
name: z.ZodString;
|
|
113
113
|
}, z.core.$strip>;
|
|
114
114
|
export type RenameSpaceRequest = z.infer<typeof RenameSpaceRequestSchema>;
|
|
115
|
+
/** Nombre de tâches de l'espace assignées à un membre, par statut. */
|
|
116
|
+
export declare const AssignedTaskCountsSchema: z.ZodObject<{
|
|
117
|
+
todo: z.ZodNumber;
|
|
118
|
+
doing: z.ZodNumber;
|
|
119
|
+
review: z.ZodNumber;
|
|
120
|
+
done: z.ZodNumber;
|
|
121
|
+
}, z.core.$strip>;
|
|
122
|
+
export type AssignedTaskCounts = z.infer<typeof AssignedTaskCountsSchema>;
|
|
115
123
|
export declare const MemberViewSchema: z.ZodObject<{
|
|
116
124
|
userId: z.ZodString;
|
|
117
125
|
email: z.ZodPipe<z.ZodString, z.ZodEmail>;
|
|
@@ -120,6 +128,12 @@ export declare const MemberViewSchema: z.ZodObject<{
|
|
|
120
128
|
member: "member";
|
|
121
129
|
owner: "owner";
|
|
122
130
|
}>;
|
|
131
|
+
assignedTasks: z.ZodObject<{
|
|
132
|
+
todo: z.ZodNumber;
|
|
133
|
+
doing: z.ZodNumber;
|
|
134
|
+
review: z.ZodNumber;
|
|
135
|
+
done: z.ZodNumber;
|
|
136
|
+
}, z.core.$strip>;
|
|
123
137
|
}, z.core.$strip>;
|
|
124
138
|
export type MemberView = z.infer<typeof MemberViewSchema>;
|
|
125
139
|
export declare const PendingInvitationViewSchema: z.ZodObject<{
|
|
@@ -153,6 +167,12 @@ export declare const MembersResponseSchema: z.ZodObject<{
|
|
|
153
167
|
member: "member";
|
|
154
168
|
owner: "owner";
|
|
155
169
|
}>;
|
|
170
|
+
assignedTasks: z.ZodObject<{
|
|
171
|
+
todo: z.ZodNumber;
|
|
172
|
+
doing: z.ZodNumber;
|
|
173
|
+
review: z.ZodNumber;
|
|
174
|
+
done: z.ZodNumber;
|
|
175
|
+
}, z.core.$strip>;
|
|
156
176
|
}, z.core.$strip>>;
|
|
157
177
|
invitations: z.ZodArray<z.ZodObject<{
|
|
158
178
|
id: z.ZodString;
|
|
@@ -206,6 +226,12 @@ export declare const InviteResponseSchema: z.ZodDiscriminatedUnion<[z.ZodObject<
|
|
|
206
226
|
member: "member";
|
|
207
227
|
owner: "owner";
|
|
208
228
|
}>;
|
|
229
|
+
assignedTasks: z.ZodObject<{
|
|
230
|
+
todo: z.ZodNumber;
|
|
231
|
+
doing: z.ZodNumber;
|
|
232
|
+
review: z.ZodNumber;
|
|
233
|
+
done: z.ZodNumber;
|
|
234
|
+
}, z.core.$strip>;
|
|
209
235
|
}, z.core.$strip>;
|
|
210
236
|
}, z.core.$strip>, z.ZodObject<{
|
|
211
237
|
outcome: z.ZodLiteral<"invited">;
|
|
@@ -60,11 +60,20 @@ export const CreateSpaceRequestSchema = z.object({
|
|
|
60
60
|
keyPrefix: z.string().trim().toUpperCase().pipe(KeyPrefixSchema).optional(),
|
|
61
61
|
});
|
|
62
62
|
export const RenameSpaceRequestSchema = z.object({ name: SpaceNameSchema });
|
|
63
|
+
/** Nombre de tâches de l'espace assignées à un membre, par statut. */
|
|
64
|
+
export const AssignedTaskCountsSchema = z.object({
|
|
65
|
+
todo: z.number().int().nonnegative(),
|
|
66
|
+
doing: z.number().int().nonnegative(),
|
|
67
|
+
review: z.number().int().nonnegative(),
|
|
68
|
+
done: z.number().int().nonnegative(),
|
|
69
|
+
});
|
|
63
70
|
export const MemberViewSchema = z.object({
|
|
64
71
|
userId: IdSchema,
|
|
65
72
|
email: EmailSchema,
|
|
66
73
|
displayName: z.string().nullable(),
|
|
67
74
|
role: MemberRoleSchema,
|
|
75
|
+
/** Tâches de l'espace assignées au membre, désassignées s'il quitte l'espace ou en est retiré. */
|
|
76
|
+
assignedTasks: AssignedTaskCountsSchema,
|
|
68
77
|
});
|
|
69
78
|
export const PendingInvitationViewSchema = z.object({
|
|
70
79
|
id: IdSchema,
|
|
@@ -72,6 +72,8 @@ export declare const NotificationPreferencesSchema: z.ZodObject<{
|
|
|
72
72
|
notifyAssignEmail: z.ZodBoolean;
|
|
73
73
|
notifyCommentApp: z.ZodBoolean;
|
|
74
74
|
notifyCommentEmail: z.ZodBoolean;
|
|
75
|
+
notifyFollowUpApp: z.ZodBoolean;
|
|
76
|
+
notifyFollowUpEmail: z.ZodBoolean;
|
|
75
77
|
}, z.core.$strip>;
|
|
76
78
|
export type NotificationPreferences = z.infer<typeof NotificationPreferencesSchema>;
|
|
77
79
|
export declare const UserSettingsSchema: z.ZodObject<{
|
|
@@ -79,6 +81,8 @@ export declare const UserSettingsSchema: z.ZodObject<{
|
|
|
79
81
|
notifyAssignEmail: z.ZodBoolean;
|
|
80
82
|
notifyCommentApp: z.ZodBoolean;
|
|
81
83
|
notifyCommentEmail: z.ZodBoolean;
|
|
84
|
+
notifyFollowUpApp: z.ZodBoolean;
|
|
85
|
+
notifyFollowUpEmail: z.ZodBoolean;
|
|
82
86
|
userId: z.ZodString;
|
|
83
87
|
assistantHistory: z.ZodNumber;
|
|
84
88
|
}, z.core.$strip>;
|
|
@@ -89,6 +93,8 @@ export declare const SpaceNotificationSettingsSchema: z.ZodObject<{
|
|
|
89
93
|
notifyAssignEmail: z.ZodBoolean;
|
|
90
94
|
notifyCommentApp: z.ZodBoolean;
|
|
91
95
|
notifyCommentEmail: z.ZodBoolean;
|
|
96
|
+
notifyFollowUpApp: z.ZodBoolean;
|
|
97
|
+
notifyFollowUpEmail: z.ZodBoolean;
|
|
92
98
|
userId: z.ZodString;
|
|
93
99
|
spaceId: z.ZodString;
|
|
94
100
|
}, z.core.$strip>;
|
|
@@ -232,6 +238,7 @@ export declare const CommentSchema: z.ZodObject<{
|
|
|
232
238
|
createdAt: z.ZodISODateTime;
|
|
233
239
|
editedAt: z.ZodNullable<z.ZodISODateTime>;
|
|
234
240
|
requestId: z.ZodNullable<z.ZodString>;
|
|
241
|
+
replyToCommentId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
235
242
|
}, z.core.$strip>;
|
|
236
243
|
export type Comment = z.infer<typeof CommentSchema>;
|
|
237
244
|
export declare const AttachmentSchema: z.ZodObject<{
|
|
@@ -332,8 +339,9 @@ export declare const AgentRequestSchema: z.ZodObject<{
|
|
|
332
339
|
processing: "processing";
|
|
333
340
|
}>;
|
|
334
341
|
reply: z.ZodNullable<z.ZodString>;
|
|
335
|
-
followUps: z.ZodArray<z.ZodString>;
|
|
336
342
|
failureReason: z.ZodNullable<z.ZodString>;
|
|
343
|
+
parentRequestId: z.ZodNullable<z.ZodString>;
|
|
344
|
+
commentId: z.ZodNullable<z.ZodString>;
|
|
337
345
|
createdAt: z.ZodISODateTime;
|
|
338
346
|
updatedAt: z.ZodISODateTime;
|
|
339
347
|
claimedAt: z.ZodNullable<z.ZodISODateTime>;
|
|
@@ -344,6 +352,21 @@ export declare const AgentRequestSchema: z.ZodObject<{
|
|
|
344
352
|
stoppedBy: z.ZodNullable<z.ZodString>;
|
|
345
353
|
}, z.core.$strip>;
|
|
346
354
|
export type AgentRequest = z.infer<typeof AgentRequestSchema>;
|
|
355
|
+
/**
|
|
356
|
+
* Point que l'auteur d'une demande doit régler, laissé par l'agent en la
|
|
357
|
+
* terminant. Un membre de l'espace le coche (`doneBy`), ou l'agent qui traite
|
|
358
|
+
* une suite de la demande (`doneByRequestId`).
|
|
359
|
+
*/
|
|
360
|
+
export declare const FollowUpSchema: z.ZodObject<{
|
|
361
|
+
id: z.ZodString;
|
|
362
|
+
requestId: z.ZodString;
|
|
363
|
+
position: z.ZodNumber;
|
|
364
|
+
text: z.ZodString;
|
|
365
|
+
doneAt: z.ZodNullable<z.ZodISODateTime>;
|
|
366
|
+
doneBy: z.ZodNullable<z.ZodString>;
|
|
367
|
+
doneByRequestId: z.ZodNullable<z.ZodString>;
|
|
368
|
+
}, z.core.$strip>;
|
|
369
|
+
export type FollowUp = z.infer<typeof FollowUpSchema>;
|
|
347
370
|
export declare const AgentActionSchema: z.ZodObject<{
|
|
348
371
|
id: z.ZodString;
|
|
349
372
|
requestId: z.ZodString;
|
|
@@ -357,6 +380,7 @@ export declare const AgentActionSchema: z.ZodObject<{
|
|
|
357
380
|
board_view: "board_view";
|
|
358
381
|
checklist_item: "checklist_item";
|
|
359
382
|
comment: "comment";
|
|
383
|
+
follow_up: "follow_up";
|
|
360
384
|
idea: "idea";
|
|
361
385
|
invitation: "invitation";
|
|
362
386
|
membership: "membership";
|
|
@@ -515,8 +539,9 @@ export declare const NotificationSchema: z.ZodObject<{
|
|
|
515
539
|
type: z.ZodEnum<{
|
|
516
540
|
assigned: "assigned";
|
|
517
541
|
comment: "comment";
|
|
542
|
+
follow_ups: "follow_ups";
|
|
518
543
|
}>;
|
|
519
|
-
taskId: z.ZodString
|
|
544
|
+
taskId: z.ZodNullable<z.ZodString>;
|
|
520
545
|
actorType: z.ZodEnum<{
|
|
521
546
|
agent: "agent";
|
|
522
547
|
user: "user";
|
|
@@ -545,6 +570,7 @@ export declare const ChangeSchema: z.ZodObject<{
|
|
|
545
570
|
board_view: "board_view";
|
|
546
571
|
checklist_item: "checklist_item";
|
|
547
572
|
comment: "comment";
|
|
573
|
+
follow_up: "follow_up";
|
|
548
574
|
idea: "idea";
|
|
549
575
|
invitation: "invitation";
|
|
550
576
|
membership: "membership";
|
|
@@ -560,6 +586,10 @@ export declare const ChangeSchema: z.ZodObject<{
|
|
|
560
586
|
}>;
|
|
561
587
|
entityId: z.ZodString;
|
|
562
588
|
taskId: z.ZodNullable<z.ZodString>;
|
|
589
|
+
actorType: z.ZodNullable<z.ZodEnum<{
|
|
590
|
+
agent: "agent";
|
|
591
|
+
user: "user";
|
|
592
|
+
}>>;
|
|
563
593
|
at: z.ZodISODateTime;
|
|
564
594
|
}, z.core.$strip>;
|
|
565
595
|
export type Change = z.infer<typeof ChangeSchema>;
|
|
@@ -70,6 +70,9 @@ export const NotificationPreferencesSchema = z.object({
|
|
|
70
70
|
notifyAssignEmail: z.boolean(),
|
|
71
71
|
notifyCommentApp: z.boolean(),
|
|
72
72
|
notifyCommentEmail: z.boolean(),
|
|
73
|
+
/** Demande de l'utilisateur traitée par l'agent avec des points à régler. */
|
|
74
|
+
notifyFollowUpApp: z.boolean(),
|
|
75
|
+
notifyFollowUpEmail: z.boolean(),
|
|
73
76
|
});
|
|
74
77
|
export const UserSettingsSchema = NotificationPreferencesSchema.extend({
|
|
75
78
|
userId: IdSchema,
|
|
@@ -179,6 +182,8 @@ export const CommentSchema = z.object({
|
|
|
179
182
|
editedAt: TimestampSchema.nullable(),
|
|
180
183
|
/** Demande pour laquelle l'agent a écrit le commentaire, au nom de son auteur ; null pour un commentaire d'utilisateur. */
|
|
181
184
|
requestId: IdSchema.nullable(),
|
|
185
|
+
/** Commentaire auquel l'agent répond : celui qui lui a confié la demande ; null sinon (et dans les instantanés antérieurs à ce champ). */
|
|
186
|
+
replyToCommentId: IdSchema.nullable().default(null),
|
|
182
187
|
});
|
|
183
188
|
export const AttachmentSchema = z.object({
|
|
184
189
|
id: IdSchema,
|
|
@@ -247,9 +252,11 @@ export const AgentRequestSchema = z.object({
|
|
|
247
252
|
text: z.string().trim().min(1),
|
|
248
253
|
status: RequestStatusSchema,
|
|
249
254
|
reply: z.string().nullable(),
|
|
250
|
-
/** Points que l'auteur doit encore régler, laissés par l'agent en terminant la demande ; vide quand tout est traité. */
|
|
251
|
-
followUps: z.array(z.string().trim().min(1)),
|
|
252
255
|
failureReason: z.string().nullable(),
|
|
256
|
+
/** Demande d'origine dont celle-ci est une suite ; null pour une demande d'origine. */
|
|
257
|
+
parentRequestId: IdSchema.nullable(),
|
|
258
|
+
/** Commentaire de tâche qui a confié la demande à l'agent (mention @agent) ; null sinon. */
|
|
259
|
+
commentId: IdSchema.nullable(),
|
|
253
260
|
createdAt: TimestampSchema,
|
|
254
261
|
updatedAt: TimestampSchema,
|
|
255
262
|
claimedAt: TimestampSchema.nullable(),
|
|
@@ -261,6 +268,20 @@ export const AgentRequestSchema = z.object({
|
|
|
261
268
|
stoppedAt: TimestampSchema.nullable(),
|
|
262
269
|
stoppedBy: IdSchema.nullable(),
|
|
263
270
|
});
|
|
271
|
+
/**
|
|
272
|
+
* Point que l'auteur d'une demande doit régler, laissé par l'agent en la
|
|
273
|
+
* terminant. Un membre de l'espace le coche (`doneBy`), ou l'agent qui traite
|
|
274
|
+
* une suite de la demande (`doneByRequestId`).
|
|
275
|
+
*/
|
|
276
|
+
export const FollowUpSchema = z.object({
|
|
277
|
+
id: IdSchema,
|
|
278
|
+
requestId: IdSchema,
|
|
279
|
+
position: z.number().int().min(1),
|
|
280
|
+
text: z.string().trim().min(1),
|
|
281
|
+
doneAt: TimestampSchema.nullable(),
|
|
282
|
+
doneBy: IdSchema.nullable(),
|
|
283
|
+
doneByRequestId: IdSchema.nullable(),
|
|
284
|
+
});
|
|
264
285
|
export const AgentActionSchema = z.object({
|
|
265
286
|
id: IdSchema,
|
|
266
287
|
requestId: IdSchema,
|
|
@@ -306,7 +327,8 @@ export const NotificationSchema = z.object({
|
|
|
306
327
|
id: IdSchema,
|
|
307
328
|
userId: IdSchema,
|
|
308
329
|
type: NotificationTypeSchema,
|
|
309
|
-
|
|
330
|
+
/** Tâche concernée ; null pour une notification sur une demande (`follow_ups`). */
|
|
331
|
+
taskId: IdSchema.nullable(),
|
|
310
332
|
actorType: ActorTypeSchema,
|
|
311
333
|
actorId: IdSchema.nullable(),
|
|
312
334
|
requestId: IdSchema.nullable(),
|
|
@@ -327,5 +349,7 @@ export const ChangeSchema = z.object({
|
|
|
327
349
|
entityId: IdSchema,
|
|
328
350
|
/** Tâche concernée : la tâche modifiée, ou celle qui porte l'élément modifié (checklist, commentaire…). */
|
|
329
351
|
taskId: IdSchema.nullable(),
|
|
352
|
+
/** Auteur du changement : un utilisateur ou l'agent ; null quand il n'est pas connu. */
|
|
353
|
+
actorType: ActorTypeSchema.nullable(),
|
|
330
354
|
at: TimestampSchema,
|
|
331
355
|
});
|
|
@@ -113,14 +113,15 @@ export declare const ActorTypeSchema: z.ZodEnum<{
|
|
|
113
113
|
user: "user";
|
|
114
114
|
}>;
|
|
115
115
|
export type ActorType = z.infer<typeof ActorTypeSchema>;
|
|
116
|
-
export declare const NOTIFICATION_TYPES: readonly ["assigned", "comment"];
|
|
116
|
+
export declare const NOTIFICATION_TYPES: readonly ["assigned", "comment", "follow_ups"];
|
|
117
117
|
export declare const NotificationTypeSchema: z.ZodEnum<{
|
|
118
118
|
assigned: "assigned";
|
|
119
119
|
comment: "comment";
|
|
120
|
+
follow_ups: "follow_ups";
|
|
120
121
|
}>;
|
|
121
122
|
export type NotificationType = z.infer<typeof NotificationTypeSchema>;
|
|
122
123
|
/** Types d'entités nommés dans le journal `Change`, les versions et les actions de l'agent. */
|
|
123
|
-
export declare const ENTITY_TYPES: readonly ["user", "user_settings", "space", "membership", "invitation", "task", "tag", "checklist_item", "test_checkpoint", "test_result", "test_review", "comment", "attachment", "idea", "agent_request", "agent_action", "agent_token", "notification", "board_view", "agent_instructions"];
|
|
124
|
+
export declare const ENTITY_TYPES: readonly ["user", "user_settings", "space", "membership", "invitation", "task", "tag", "checklist_item", "test_checkpoint", "test_result", "test_review", "comment", "attachment", "idea", "agent_request", "agent_action", "follow_up", "agent_token", "notification", "board_view", "agent_instructions"];
|
|
124
125
|
export declare const EntityTypeSchema: z.ZodEnum<{
|
|
125
126
|
agent_action: "agent_action";
|
|
126
127
|
agent_instructions: "agent_instructions";
|
|
@@ -130,6 +131,7 @@ export declare const EntityTypeSchema: z.ZodEnum<{
|
|
|
130
131
|
board_view: "board_view";
|
|
131
132
|
checklist_item: "checklist_item";
|
|
132
133
|
comment: "comment";
|
|
134
|
+
follow_up: "follow_up";
|
|
133
135
|
idea: "idea";
|
|
134
136
|
invitation: "invitation";
|
|
135
137
|
membership: "membership";
|
|
@@ -35,7 +35,7 @@ export const AGENT_OPERATIONS = ["create", "update", "delete", "move", "assign"]
|
|
|
35
35
|
export const AgentOperationSchema = z.enum(AGENT_OPERATIONS);
|
|
36
36
|
export const ACTOR_TYPES = ["user", "agent"];
|
|
37
37
|
export const ActorTypeSchema = z.enum(ACTOR_TYPES);
|
|
38
|
-
export const NOTIFICATION_TYPES = ["assigned", "comment"];
|
|
38
|
+
export const NOTIFICATION_TYPES = ["assigned", "comment", "follow_ups"];
|
|
39
39
|
export const NotificationTypeSchema = z.enum(NOTIFICATION_TYPES);
|
|
40
40
|
/** Types d'entités nommés dans le journal `Change`, les versions et les actions de l'agent. */
|
|
41
41
|
export const ENTITY_TYPES = [
|
|
@@ -55,6 +55,7 @@ export const ENTITY_TYPES = [
|
|
|
55
55
|
"idea",
|
|
56
56
|
"agent_request",
|
|
57
57
|
"agent_action",
|
|
58
|
+
"follow_up",
|
|
58
59
|
"agent_token",
|
|
59
60
|
"notification",
|
|
60
61
|
"board_view",
|
|
@@ -43,11 +43,14 @@ export interface ApiResponseData {
|
|
|
43
43
|
export declare const UPSTREAM_ERROR_HEADER = "X-Organizer-Error-Source";
|
|
44
44
|
/** Nom du cookie de session de la GUI. */
|
|
45
45
|
export declare const SESSION_COOKIE_NAME = "organizer_session";
|
|
46
|
-
/**
|
|
46
|
+
/**
|
|
47
|
+
* Réponse de `GET /api/health`, route publique.
|
|
48
|
+
*
|
|
49
|
+
* Ni version de l'application ni version du schéma : elles renseignaient un
|
|
50
|
+
* inconnu sur la version déployée (revue de sécurité du 2026-10-25).
|
|
51
|
+
*/
|
|
47
52
|
export declare const HealthResponseSchema: z.ZodObject<{
|
|
48
53
|
status: z.ZodLiteral<"ok">;
|
|
49
|
-
version: z.ZodString;
|
|
50
|
-
schemaVersion: z.ZodNumber;
|
|
51
54
|
accountsExist: z.ZodBoolean;
|
|
52
55
|
}, z.core.$strip>;
|
|
53
56
|
export type HealthResponse = z.infer<typeof HealthResponseSchema>;
|
|
@@ -10,11 +10,14 @@ export const API_ERROR_KINDS = ["invalid", "unauthorized", "forbidden", "not_fou
|
|
|
10
10
|
export const UPSTREAM_ERROR_HEADER = "X-Organizer-Error-Source";
|
|
11
11
|
/** Nom du cookie de session de la GUI. */
|
|
12
12
|
export const SESSION_COOKIE_NAME = "organizer_session";
|
|
13
|
-
/**
|
|
13
|
+
/**
|
|
14
|
+
* Réponse de `GET /api/health`, route publique.
|
|
15
|
+
*
|
|
16
|
+
* Ni version de l'application ni version du schéma : elles renseignaient un
|
|
17
|
+
* inconnu sur la version déployée (revue de sécurité du 2026-10-25).
|
|
18
|
+
*/
|
|
14
19
|
export const HealthResponseSchema = z.object({
|
|
15
20
|
status: z.literal("ok"),
|
|
16
|
-
version: z.string(),
|
|
17
|
-
schemaVersion: z.number().int(),
|
|
18
21
|
/** Faux tant qu'aucun compte n'existe : la connexion est alors impossible. */
|
|
19
22
|
accountsExist: z.boolean(),
|
|
20
23
|
});
|
|
@@ -3,16 +3,25 @@ import { z } from "zod";
|
|
|
3
3
|
/** Nombre de notifications renvoyées par défaut, et au plus, par page. */
|
|
4
4
|
export declare const NOTIFICATIONS_PAGE_SIZE = 20;
|
|
5
5
|
export declare const MAX_NOTIFICATIONS_PAGE_SIZE = 50;
|
|
6
|
-
/**
|
|
6
|
+
/**
|
|
7
|
+
* Notification telle que l'affiche le menu de la cloche : sur une tâche
|
|
8
|
+
* (assignation, commentaire), ou sur une demande traitée avec des points à
|
|
9
|
+
* régler (`follow_ups`).
|
|
10
|
+
*/
|
|
7
11
|
export declare const NotificationViewSchema: z.ZodObject<{
|
|
8
12
|
id: z.ZodString;
|
|
9
13
|
type: z.ZodEnum<{
|
|
10
14
|
assigned: "assigned";
|
|
11
15
|
comment: "comment";
|
|
16
|
+
follow_ups: "follow_ups";
|
|
12
17
|
}>;
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
18
|
+
spaceId: z.ZodString;
|
|
19
|
+
taskId: z.ZodNullable<z.ZodString>;
|
|
20
|
+
taskKey: z.ZodNullable<z.ZodString>;
|
|
21
|
+
taskTitle: z.ZodNullable<z.ZodString>;
|
|
22
|
+
requestId: z.ZodNullable<z.ZodString>;
|
|
23
|
+
requestExcerpt: z.ZodNullable<z.ZodString>;
|
|
24
|
+
openFollowUps: z.ZodNullable<z.ZodNumber>;
|
|
16
25
|
actorType: z.ZodEnum<{
|
|
17
26
|
agent: "agent";
|
|
18
27
|
user: "user";
|
|
@@ -33,10 +42,15 @@ export declare const NotificationListResponseSchema: z.ZodObject<{
|
|
|
33
42
|
type: z.ZodEnum<{
|
|
34
43
|
assigned: "assigned";
|
|
35
44
|
comment: "comment";
|
|
45
|
+
follow_ups: "follow_ups";
|
|
36
46
|
}>;
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
47
|
+
spaceId: z.ZodString;
|
|
48
|
+
taskId: z.ZodNullable<z.ZodString>;
|
|
49
|
+
taskKey: z.ZodNullable<z.ZodString>;
|
|
50
|
+
taskTitle: z.ZodNullable<z.ZodString>;
|
|
51
|
+
requestId: z.ZodNullable<z.ZodString>;
|
|
52
|
+
requestExcerpt: z.ZodNullable<z.ZodString>;
|
|
53
|
+
openFollowUps: z.ZodNullable<z.ZodNumber>;
|
|
40
54
|
actorType: z.ZodEnum<{
|
|
41
55
|
agent: "agent";
|
|
42
56
|
user: "user";
|
|
@@ -68,6 +82,8 @@ export declare const SettingsResponseSchema: z.ZodObject<{
|
|
|
68
82
|
notifyAssignEmail: z.ZodBoolean;
|
|
69
83
|
notifyCommentApp: z.ZodBoolean;
|
|
70
84
|
notifyCommentEmail: z.ZodBoolean;
|
|
85
|
+
notifyFollowUpApp: z.ZodBoolean;
|
|
86
|
+
notifyFollowUpEmail: z.ZodBoolean;
|
|
71
87
|
assistantHistory: z.ZodNumber;
|
|
72
88
|
email: z.ZodObject<{
|
|
73
89
|
enabled: z.ZodBoolean;
|
|
@@ -84,6 +100,8 @@ export declare const UpdateSettingsRequestSchema: z.ZodObject<{
|
|
|
84
100
|
notifyAssignEmail: z.ZodOptional<z.ZodBoolean>;
|
|
85
101
|
notifyCommentApp: z.ZodOptional<z.ZodBoolean>;
|
|
86
102
|
notifyCommentEmail: z.ZodOptional<z.ZodBoolean>;
|
|
103
|
+
notifyFollowUpApp: z.ZodOptional<z.ZodBoolean>;
|
|
104
|
+
notifyFollowUpEmail: z.ZodOptional<z.ZodBoolean>;
|
|
87
105
|
assistantHistory: z.ZodOptional<z.ZodNumber>;
|
|
88
106
|
}, z.core.$strict>;
|
|
89
107
|
export type UpdateSettingsRequest = z.infer<typeof UpdateSettingsRequestSchema>;
|
|
@@ -96,6 +114,8 @@ export declare const SpaceNotificationSettingsResponseSchema: z.ZodObject<{
|
|
|
96
114
|
notifyAssignEmail: z.ZodBoolean;
|
|
97
115
|
notifyCommentApp: z.ZodBoolean;
|
|
98
116
|
notifyCommentEmail: z.ZodBoolean;
|
|
117
|
+
notifyFollowUpApp: z.ZodBoolean;
|
|
118
|
+
notifyFollowUpEmail: z.ZodBoolean;
|
|
99
119
|
custom: z.ZodBoolean;
|
|
100
120
|
email: z.ZodObject<{
|
|
101
121
|
enabled: z.ZodBoolean;
|
|
@@ -113,6 +133,8 @@ export declare const UpdateSpaceNotificationSettingsRequestSchema: z.ZodObject<{
|
|
|
113
133
|
notifyAssignEmail: z.ZodOptional<z.ZodBoolean>;
|
|
114
134
|
notifyCommentApp: z.ZodOptional<z.ZodBoolean>;
|
|
115
135
|
notifyCommentEmail: z.ZodOptional<z.ZodBoolean>;
|
|
136
|
+
notifyFollowUpApp: z.ZodOptional<z.ZodBoolean>;
|
|
137
|
+
notifyFollowUpEmail: z.ZodOptional<z.ZodBoolean>;
|
|
116
138
|
custom: z.ZodBoolean;
|
|
117
139
|
}, z.core.$strict>;
|
|
118
140
|
export type UpdateSpaceNotificationSettingsRequest = z.infer<typeof UpdateSpaceNotificationSettingsRequestSchema>;
|
|
@@ -5,14 +5,25 @@ import { AssistantHistorySchema, IdSchema, NotificationPreferencesSchema, Timest
|
|
|
5
5
|
/** Nombre de notifications renvoyées par défaut, et au plus, par page. */
|
|
6
6
|
export const NOTIFICATIONS_PAGE_SIZE = 20;
|
|
7
7
|
export const MAX_NOTIFICATIONS_PAGE_SIZE = 50;
|
|
8
|
-
/**
|
|
8
|
+
/**
|
|
9
|
+
* Notification telle que l'affiche le menu de la cloche : sur une tâche
|
|
10
|
+
* (assignation, commentaire), ou sur une demande traitée avec des points à
|
|
11
|
+
* régler (`follow_ups`).
|
|
12
|
+
*/
|
|
9
13
|
export const NotificationViewSchema = z.object({
|
|
10
14
|
id: IdSchema,
|
|
11
15
|
type: NotificationTypeSchema,
|
|
12
|
-
|
|
16
|
+
/** Espace de la tâche ou de la demande. */
|
|
17
|
+
spaceId: IdSchema,
|
|
18
|
+
taskId: IdSchema.nullable(),
|
|
13
19
|
/** Identifiant lisible de la tâche : `ORG-41`. */
|
|
14
|
-
taskKey: z.string(),
|
|
15
|
-
taskTitle: z.string(),
|
|
20
|
+
taskKey: z.string().nullable(),
|
|
21
|
+
taskTitle: z.string().nullable(),
|
|
22
|
+
requestId: IdSchema.nullable(),
|
|
23
|
+
/** Début du texte de la demande, abrégé. */
|
|
24
|
+
requestExcerpt: z.string().nullable(),
|
|
25
|
+
/** Points de la demande encore à régler. */
|
|
26
|
+
openFollowUps: z.number().int().min(0).nullable(),
|
|
16
27
|
actorType: ActorTypeSchema,
|
|
17
28
|
actorId: IdSchema.nullable(),
|
|
18
29
|
/** Nom affiché de l'utilisateur à l'origine de la notification ; null pour l'agent. */
|
|
@@ -42,6 +53,8 @@ export const SettingsResponseSchema = z.object({
|
|
|
42
53
|
notifyAssignEmail: z.boolean(),
|
|
43
54
|
notifyCommentApp: z.boolean(),
|
|
44
55
|
notifyCommentEmail: z.boolean(),
|
|
56
|
+
notifyFollowUpApp: z.boolean(),
|
|
57
|
+
notifyFollowUpEmail: z.boolean(),
|
|
45
58
|
/** Nombre d'échanges précédents transmis à l'agent avec un message de l'assistant. */
|
|
46
59
|
assistantHistory: AssistantHistorySchema,
|
|
47
60
|
/** Envoi des e-mails de notification : `reason` dit pourquoi il n'a pas lieu. */
|
|
@@ -55,6 +68,8 @@ export const UpdateSettingsRequestSchema = z
|
|
|
55
68
|
notifyAssignEmail: z.boolean().optional(),
|
|
56
69
|
notifyCommentApp: z.boolean().optional(),
|
|
57
70
|
notifyCommentEmail: z.boolean().optional(),
|
|
71
|
+
notifyFollowUpApp: z.boolean().optional(),
|
|
72
|
+
notifyFollowUpEmail: z.boolean().optional(),
|
|
58
73
|
assistantHistory: AssistantHistorySchema.optional(),
|
|
59
74
|
})
|
|
60
75
|
.strict()
|
|
@@ -76,4 +91,5 @@ export const SpaceNotificationSettingsResponseSchema = NotificationPreferencesSc
|
|
|
76
91
|
export const UpdateSpaceNotificationSettingsRequestSchema = NotificationPreferencesSchema.partial()
|
|
77
92
|
.extend({ custom: z.boolean() })
|
|
78
93
|
.strict()
|
|
79
|
-
.refine((patch) => patch.custom ||
|
|
94
|
+
.refine((patch) => patch.custom ||
|
|
95
|
+
[patch.notifyAssignApp, patch.notifyAssignEmail, patch.notifyCommentApp, patch.notifyCommentEmail, patch.notifyFollowUpApp, patch.notifyFollowUpEmail].every((value) => value === undefined), "Un espace qui suit les préférences du compte n'a pas de préférences propres.");
|