@imenam/mcp-organizer 1.0.20 → 1.0.22

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.
Files changed (119) hide show
  1. package/README.md +110 -32
  2. package/dist/shared/logic/attachments.d.ts +28 -0
  3. package/dist/shared/logic/attachments.js +52 -0
  4. package/dist/shared/logic/documents.d.ts +20 -0
  5. package/dist/shared/logic/documents.js +33 -0
  6. package/dist/shared/logic/line-diff.d.ts +13 -0
  7. package/dist/shared/logic/line-diff.js +66 -0
  8. package/dist/shared/logic/notes.d.ts +12 -0
  9. package/dist/shared/logic/notes.js +23 -0
  10. package/dist/shared/logic/timer.d.ts +69 -0
  11. package/dist/shared/logic/timer.js +87 -0
  12. package/dist/shared/schemas/agent-api.schema.d.ts +10 -29
  13. package/dist/shared/schemas/agent-api.schema.js +4 -15
  14. package/dist/shared/schemas/agent-tools.schema.d.ts +648 -2
  15. package/dist/shared/schemas/agent-tools.schema.js +158 -8
  16. package/dist/shared/schemas/api.schema.d.ts +7 -0
  17. package/dist/shared/schemas/api.schema.js +6 -0
  18. package/dist/shared/schemas/documents-api.schema.d.ts +47 -0
  19. package/dist/shared/schemas/documents-api.schema.js +36 -0
  20. package/dist/shared/schemas/entities.schema.d.ts +107 -54
  21. package/dist/shared/schemas/entities.schema.js +81 -10
  22. package/dist/shared/schemas/enums.schema.d.ts +19 -3
  23. package/dist/shared/schemas/enums.schema.js +8 -2
  24. package/dist/shared/schemas/gui-api.schema.d.ts +1 -0
  25. package/dist/shared/schemas/gui-api.schema.js +2 -0
  26. package/dist/shared/schemas/history-api.schema.d.ts +961 -0
  27. package/dist/shared/schemas/history-api.schema.js +104 -0
  28. package/dist/shared/schemas/notes-api.schema.d.ts +54 -0
  29. package/dist/shared/schemas/notes-api.schema.js +38 -0
  30. package/dist/shared/schemas/notifications-api.schema.d.ts +12 -0
  31. package/dist/shared/schemas/notifications-api.schema.js +4 -1
  32. package/dist/shared/schemas/tasks-api.schema.d.ts +39 -0
  33. package/dist/shared/schemas/tasks-api.schema.js +5 -0
  34. package/dist/shared/schemas/timers-api.schema.d.ts +119 -0
  35. package/dist/shared/schemas/timers-api.schema.js +44 -0
  36. package/dist/shared/schemas/views-api.schema.d.ts +16 -0
  37. package/dist/shared/schemas/views-api.schema.js +4 -2
  38. package/dist/src/agent-api/attachments.d.ts +2 -0
  39. package/dist/src/agent-api/attachments.js +96 -0
  40. package/dist/src/agent-api/documents.d.ts +3 -0
  41. package/dist/src/agent-api/documents.js +42 -0
  42. package/dist/src/agent-api/files.d.ts +35 -0
  43. package/dist/src/agent-api/files.js +86 -0
  44. package/dist/src/agent-api/history.d.ts +3 -0
  45. package/dist/src/agent-api/history.js +103 -0
  46. package/dist/src/agent-api/notes.d.ts +3 -0
  47. package/dist/src/agent-api/notes.js +39 -0
  48. package/dist/src/agent-api/requests.js +2 -1
  49. package/dist/src/agent-api/router.d.ts +2 -2
  50. package/dist/src/agent-api/router.js +9 -4
  51. package/dist/src/agent-api/tasks.js +13 -5
  52. package/dist/src/agent-api/timers.d.ts +2 -0
  53. package/dist/src/agent-api/timers.js +170 -0
  54. package/dist/src/agent-api/types.d.ts +7 -2
  55. package/dist/src/agent-api/views.js +15 -30
  56. package/dist/src/cli/backup.js +3 -3
  57. package/dist/src/core/accounts.d.ts +12 -5
  58. package/dist/src/core/accounts.js +28 -10
  59. package/dist/src/core/agent-files.d.ts +41 -0
  60. package/dist/src/core/agent-files.js +102 -0
  61. package/dist/src/core/agent.d.ts +29 -3
  62. package/dist/src/core/agent.js +129 -1
  63. package/dist/src/core/attachments.d.ts +6 -3
  64. package/dist/src/core/attachments.js +9 -4
  65. package/dist/src/core/board-views.js +4 -4
  66. package/dist/src/core/document-text.d.ts +18 -0
  67. package/dist/src/core/document-text.js +119 -0
  68. package/dist/src/core/documents.d.ts +22 -0
  69. package/dist/src/core/documents.js +167 -0
  70. package/dist/src/core/history-events.d.ts +34 -0
  71. package/dist/src/core/history-events.js +236 -0
  72. package/dist/src/core/history.d.ts +3 -1
  73. package/dist/src/core/history.js +59 -12
  74. package/dist/src/core/migrations.js +153 -0
  75. package/dist/src/core/notes.d.ts +23 -0
  76. package/dist/src/core/notes.js +78 -0
  77. package/dist/src/core/notifications.d.ts +48 -5
  78. package/dist/src/core/notifications.js +209 -33
  79. package/dist/src/core/password-reset.d.ts +37 -0
  80. package/dist/src/core/password-reset.js +56 -0
  81. package/dist/src/core/requests.d.ts +13 -7
  82. package/dist/src/core/requests.js +26 -14
  83. package/dist/src/core/snapshots.d.ts +3 -3
  84. package/dist/src/core/snapshots.js +5 -1
  85. package/dist/src/core/space-history.d.ts +18 -0
  86. package/dist/src/core/space-history.js +86 -0
  87. package/dist/src/core/spaces.d.ts +1 -1
  88. package/dist/src/core/spaces.js +4 -4
  89. package/dist/src/core/store.d.ts +154 -11
  90. package/dist/src/core/store.js +479 -52
  91. package/dist/src/core/task-history.d.ts +9 -5
  92. package/dist/src/core/task-history.js +17 -25
  93. package/dist/src/core/tasks.d.ts +2 -2
  94. package/dist/src/core/tasks.js +13 -2
  95. package/dist/src/core/timers.d.ts +33 -0
  96. package/dist/src/core/timers.js +101 -0
  97. package/dist/src/core/versions.d.ts +22 -0
  98. package/dist/src/core/versions.js +106 -0
  99. package/dist/src/gui-api.d.ts +4 -1
  100. package/dist/src/gui-api.js +87 -8
  101. package/dist/src/mcp/client.d.ts +7 -4
  102. package/dist/src/mcp/client.js +31 -4
  103. package/dist/src/mcp/start.d.ts +1 -1
  104. package/dist/src/mcp/start.js +14 -9
  105. package/dist/src/mcp/tools.d.ts +11 -0
  106. package/dist/src/mcp/tools.js +182 -5
  107. package/dist/src/mcp/upload.d.ts +22 -0
  108. package/dist/src/mcp/upload.js +79 -0
  109. package/dist/src/server/app.d.ts +4 -2
  110. package/dist/src/server/app.js +58 -8
  111. package/dist/src/server/login-limiter.d.ts +27 -1
  112. package/dist/src/server/login-limiter.js +31 -1
  113. package/dist/src/server/start.js +1 -0
  114. package/gui/dist/assets/index-C1f7hOcM.js +104 -0
  115. package/gui/dist/assets/index-CfMiwPSL.css +1 -0
  116. package/gui/dist/index.html +2 -2
  117. package/package.json +3 -1
  118. package/gui/dist/assets/index-9c9BlfUi.js +0 -99
  119. package/gui/dist/assets/index-DH23A5aa.css +0 -1
@@ -0,0 +1,104 @@
1
+ import { z } from "zod";
2
+ import { ActorTypeSchema, MemberRoleSchema, TaskPrioritySchema, TaskStatusSchema, TaskTypeSchema } from "./enums.schema.js";
3
+ import { IdSchema, TimestampSchema } from "./entities.schema.js";
4
+ /** Historique des événements : celui d'une tâche (modale du détail) et celui d'un espace (page Historique). */
5
+ /** Catégories d'événements, filtre « Type d'événement » de l'historique de l'espace. */
6
+ export const HISTORY_CATEGORIES = ["task", "idea", "member", "note", "document"];
7
+ export const HistoryCategorySchema = z.enum(HISTORY_CATEGORIES);
8
+ export const MAX_HISTORY_PAGE = 100;
9
+ export const DEFAULT_HISTORY_PAGE = 50;
10
+ /** Personne nommée par un événement ; `id` est null pour une adresse invitée sans compte connu. */
11
+ export const HistoryPersonSchema = z.object({ id: IdSchema.nullable(), name: z.string() });
12
+ /** Tâche nommée par un événement : sa clé et son titre, existante ou supprimée. */
13
+ export const HistoryTaskRefSchema = z.object({ id: IdSchema, key: z.string(), title: z.string(), deleted: z.boolean() });
14
+ /** Ligne d'un diff de texte : inchangée, ajoutée ou retirée. */
15
+ export const DiffLineSchema = z.object({ kind: z.enum(["same", "add", "del"]), text: z.string() });
16
+ /** Changement élémentaire d'un événement, que la GUI met en phrase. */
17
+ export const HistoryChangeSchema = z.discriminatedUnion("kind", [
18
+ z.object({ kind: z.literal("created") }),
19
+ z.object({ kind: z.literal("deleted") }),
20
+ z.object({ kind: z.literal("restored") }),
21
+ z.object({ kind: z.literal("title"), from: z.string(), to: z.string() }),
22
+ z.object({ kind: z.literal("status"), from: TaskStatusSchema, to: TaskStatusSchema }),
23
+ z.object({ kind: z.literal("priority"), from: TaskPrioritySchema, to: TaskPrioritySchema }),
24
+ z.object({ kind: z.literal("type"), from: TaskTypeSchema, to: TaskTypeSchema }),
25
+ /** Description : lignes ajoutées et retirées ; `lines` porte le diff complet dans l'historique d'une tâche, null dans celui de l'espace. */
26
+ z.object({ kind: z.literal("description"), added: z.number().int().min(0), removed: z.number().int().min(0), lines: z.array(DiffLineSchema).nullable() }),
27
+ z.object({ kind: z.literal("assignees"), added: z.array(HistoryPersonSchema), removed: z.array(HistoryPersonSchema) }),
28
+ z.object({ kind: z.literal("tags"), added: z.array(z.string()), removed: z.array(z.string()) }),
29
+ z.object({ kind: z.literal("parent"), from: HistoryTaskRefSchema.nullable(), to: HistoryTaskRefSchema.nullable() }),
30
+ z.object({ kind: z.literal("tested"), from: HistoryTaskRefSchema.nullable(), to: HistoryTaskRefSchema.nullable() }),
31
+ z.object({ kind: z.literal("checklist"), action: z.enum(["added", "removed", "checked", "unchecked", "edited"]), text: z.string(), previous: z.string().nullable() }),
32
+ z.object({ kind: z.literal("checkpoint"), action: z.enum(["added", "removed", "edited"]), text: z.string(), previous: z.string().nullable() }),
33
+ z.object({
34
+ kind: z.literal("idea"),
35
+ action: z.enum(["created", "deleted", "restored", "edited", "archived", "unarchived", "promoted"]),
36
+ text: z.string(),
37
+ previous: z.string().nullable(),
38
+ task: HistoryTaskRefSchema.nullable(),
39
+ }),
40
+ z.object({ kind: z.literal("member"), action: z.enum(["created_space", "joined", "added", "left", "removed", "role"]), person: HistoryPersonSchema, role: MemberRoleSchema }),
41
+ z.object({ kind: z.literal("invitation"), action: z.enum(["invited", "revoked", "declined"]), person: HistoryPersonSchema }),
42
+ z.object({ kind: z.literal("note"), action: z.enum(["created", "renamed", "edited", "deleted", "restored"]), noteId: IdSchema, title: z.string(), previous: z.string().nullable() }),
43
+ z.object({ kind: z.literal("document"), action: z.enum(["added", "replaced", "described", "deleted", "restored"]), filename: z.string() }),
44
+ ]);
45
+ /**
46
+ * Événement de l'historique : une version d'une entité, faite par une
47
+ * mutation. Pour l'agent, `actor` nomme le membre pour qui il agit (l'auteur
48
+ * de la demande) et `request` la demande traitée. `task` est la tâche
49
+ * concernée, `version` le numéro de version de la tâche que l'événement a
50
+ * produite (cible de « Restaurer »), `restorable` vrai pour la suppression
51
+ * d'une tâche toujours supprimée.
52
+ */
53
+ export const HistoryEventSchema = z.object({
54
+ id: z.string(),
55
+ seq: z.number().int().min(1),
56
+ at: TimestampSchema,
57
+ category: HistoryCategorySchema,
58
+ actor: z.object({ type: ActorTypeSchema, id: IdSchema.nullable(), name: z.string() }),
59
+ request: z.object({ id: IdSchema, text: z.string() }).nullable(),
60
+ task: HistoryTaskRefSchema.nullable(),
61
+ version: z.number().int().min(1).nullable(),
62
+ restorable: z.boolean(),
63
+ changes: z.array(HistoryChangeSchema).min(1),
64
+ });
65
+ /** Historique d'une tâche, du plus récent au plus ancien ; `currentVersion` est la version de son état actuel. */
66
+ export const TaskHistoryResponseSchema = z.object({
67
+ task: HistoryTaskRefSchema,
68
+ currentVersion: z.number().int().min(1),
69
+ events: z.array(HistoryEventSchema),
70
+ });
71
+ /** Requête de l'historique d'un espace : auteur (`agent` ou un identifiant de membre), catégories, date de début, curseur. */
72
+ export const SpaceHistoryQuerySchema = z
73
+ .object({
74
+ actor: z.string().min(1).optional(),
75
+ categories: z
76
+ .string()
77
+ .optional()
78
+ .transform((raw, ctx) => {
79
+ if (raw === undefined)
80
+ return undefined;
81
+ const values = raw.split(",").filter((value) => value !== "");
82
+ const unknown = values.filter((value) => !HISTORY_CATEGORIES.includes(value));
83
+ if (unknown.length > 0)
84
+ ctx.addIssue({ code: "custom", message: `catégorie inconnue : ${unknown.join(", ")} (attendu : ${HISTORY_CATEGORIES.join(", ")})` });
85
+ return values;
86
+ }),
87
+ since: TimestampSchema.optional(),
88
+ before: z.coerce.number().int().min(1).optional(),
89
+ limit: z.coerce.number().int().min(1).max(MAX_HISTORY_PAGE).default(DEFAULT_HISTORY_PAGE),
90
+ })
91
+ .strict();
92
+ /**
93
+ * Page de l'historique d'un espace : événements du plus récent au plus
94
+ * ancien, nombre total de ceux qui passent les filtres, curseur de la page
95
+ * suivante (null à la fin) et auteurs proposés par le filtre.
96
+ */
97
+ export const SpaceHistoryResponseSchema = z.object({
98
+ events: z.array(HistoryEventSchema),
99
+ total: z.number().int().min(0),
100
+ nextBefore: z.number().int().min(1).nullable(),
101
+ authors: z.array(HistoryPersonSchema.extend({ id: IdSchema })),
102
+ });
103
+ /** Réponse de la restauration d'une tâche supprimée. */
104
+ export const RestoreTaskResponseSchema = z.object({ task: HistoryTaskRefSchema });
@@ -0,0 +1,54 @@
1
+ import { z } from "zod";
2
+ /** Corps des requêtes et des réponses de la page Notes de la GUI. */
3
+ export declare const MAX_NOTE_TITLE_LENGTH = 200;
4
+ export declare const MAX_NOTE_BODY_LENGTH = 50000;
5
+ export declare const MAX_NOTE_INSTRUCTION_LENGTH = 2000;
6
+ export declare const NoteTitleSchema: z.ZodString;
7
+ export declare const NoteBodySchema: z.ZodString;
8
+ /** Note telle que l'affiche la page Notes. */
9
+ export declare const NoteViewSchema: z.ZodObject<{
10
+ id: z.ZodString;
11
+ spaceId: z.ZodString;
12
+ title: z.ZodString;
13
+ body: z.ZodString;
14
+ authorId: z.ZodString;
15
+ authorName: z.ZodString;
16
+ updatedByName: z.ZodString;
17
+ createdAt: z.ZodISODateTime;
18
+ updatedAt: z.ZodISODateTime;
19
+ }, z.core.$strip>;
20
+ export type NoteView = z.infer<typeof NoteViewSchema>;
21
+ export declare const NoteListResponseSchema: z.ZodObject<{
22
+ notes: z.ZodArray<z.ZodObject<{
23
+ id: z.ZodString;
24
+ spaceId: z.ZodString;
25
+ title: z.ZodString;
26
+ body: z.ZodString;
27
+ authorId: z.ZodString;
28
+ authorName: z.ZodString;
29
+ updatedByName: z.ZodString;
30
+ createdAt: z.ZodISODateTime;
31
+ updatedAt: z.ZodISODateTime;
32
+ }, z.core.$strip>>;
33
+ }, z.core.$strip>;
34
+ export type NoteListResponse = z.infer<typeof NoteListResponseSchema>;
35
+ export declare const CreateNoteRequestSchema: z.ZodObject<{
36
+ title: z.ZodString;
37
+ body: z.ZodDefault<z.ZodString>;
38
+ }, z.core.$strip>;
39
+ export type CreateNoteRequest = z.infer<typeof CreateNoteRequestSchema>;
40
+ export declare const UpdateNoteRequestSchema: z.ZodObject<{
41
+ title: z.ZodOptional<z.ZodString>;
42
+ body: z.ZodOptional<z.ZodString>;
43
+ }, z.core.$strip>;
44
+ export type UpdateNoteRequest = z.infer<typeof UpdateNoteRequestSchema>;
45
+ /** « Envoyer à l'agent » : consigne facultative ajoutée à la référence de la note. */
46
+ export declare const SendNoteRequestSchema: z.ZodObject<{
47
+ instruction: z.ZodDefault<z.ZodString>;
48
+ }, z.core.$strip>;
49
+ export type SendNoteRequest = z.infer<typeof SendNoteRequestSchema>;
50
+ /** Demande créée par « Envoyer à l'agent ». */
51
+ export declare const SendNoteResponseSchema: z.ZodObject<{
52
+ requestId: z.ZodString;
53
+ }, z.core.$strip>;
54
+ export type SendNoteResponse = z.infer<typeof SendNoteResponseSchema>;
@@ -0,0 +1,38 @@
1
+ import { z } from "zod";
2
+ import { IdSchema, TimestampSchema } from "./entities.schema.js";
3
+ /** Corps des requêtes et des réponses de la page Notes de la GUI. */
4
+ export const MAX_NOTE_TITLE_LENGTH = 200;
5
+ export const MAX_NOTE_BODY_LENGTH = 50_000;
6
+ export const MAX_NOTE_INSTRUCTION_LENGTH = 2_000;
7
+ export const NoteTitleSchema = z
8
+ .string()
9
+ .trim()
10
+ .min(1, "Le titre est vide : donnez un titre à la note.")
11
+ .max(MAX_NOTE_TITLE_LENGTH, `Le titre dépasse ${MAX_NOTE_TITLE_LENGTH} caractères.`);
12
+ export const NoteBodySchema = z.string().max(MAX_NOTE_BODY_LENGTH, `La note dépasse ${MAX_NOTE_BODY_LENGTH} caractères.`);
13
+ /** Note telle que l'affiche la page Notes. */
14
+ export const NoteViewSchema = z.object({
15
+ id: IdSchema,
16
+ spaceId: IdSchema,
17
+ title: z.string(),
18
+ body: z.string(),
19
+ authorId: IdSchema,
20
+ authorName: z.string(),
21
+ updatedByName: z.string(),
22
+ createdAt: TimestampSchema,
23
+ updatedAt: TimestampSchema,
24
+ });
25
+ export const NoteListResponseSchema = z.object({
26
+ /** Notes de l'espace, de la plus récemment modifiée à la plus ancienne. */
27
+ notes: z.array(NoteViewSchema),
28
+ });
29
+ export const CreateNoteRequestSchema = z.object({ title: NoteTitleSchema, body: NoteBodySchema.default("") });
30
+ export const UpdateNoteRequestSchema = z
31
+ .object({ title: NoteTitleSchema.optional(), body: NoteBodySchema.optional() })
32
+ .refine((patch) => patch.title !== undefined || patch.body !== undefined, "Rien à modifier : donnez le titre ou le contenu.");
33
+ /** « Envoyer à l'agent » : consigne facultative ajoutée à la référence de la note. */
34
+ export const SendNoteRequestSchema = z.object({
35
+ instruction: z.string().trim().max(MAX_NOTE_INSTRUCTION_LENGTH, `La consigne dépasse ${MAX_NOTE_INSTRUCTION_LENGTH} caractères.`).default(""),
36
+ });
37
+ /** Demande créée par « Envoyer à l'agent ». */
38
+ export const SendNoteResponseSchema = z.object({ requestId: IdSchema });
@@ -85,6 +85,12 @@ export declare const SettingsResponseSchema: z.ZodObject<{
85
85
  notifyFollowUpApp: z.ZodBoolean;
86
86
  notifyFollowUpEmail: z.ZodBoolean;
87
87
  assistantHistory: z.ZodNumber;
88
+ pomodoro: z.ZodObject<{
89
+ workMinutes: z.ZodNumber;
90
+ shortBreakMinutes: z.ZodNumber;
91
+ longBreakMinutes: z.ZodNumber;
92
+ cycles: z.ZodNumber;
93
+ }, z.core.$strip>;
88
94
  email: z.ZodObject<{
89
95
  enabled: z.ZodBoolean;
90
96
  reason: z.ZodNullable<z.ZodString>;
@@ -103,6 +109,12 @@ export declare const UpdateSettingsRequestSchema: z.ZodObject<{
103
109
  notifyFollowUpApp: z.ZodOptional<z.ZodBoolean>;
104
110
  notifyFollowUpEmail: z.ZodOptional<z.ZodBoolean>;
105
111
  assistantHistory: z.ZodOptional<z.ZodNumber>;
112
+ pomodoro: z.ZodOptional<z.ZodObject<{
113
+ workMinutes: z.ZodNumber;
114
+ shortBreakMinutes: z.ZodNumber;
115
+ longBreakMinutes: z.ZodNumber;
116
+ cycles: z.ZodNumber;
117
+ }, z.core.$strip>>;
106
118
  }, z.core.$strict>;
107
119
  export type UpdateSettingsRequest = z.infer<typeof UpdateSettingsRequestSchema>;
108
120
  /**
@@ -1,6 +1,6 @@
1
1
  import { z } from "zod";
2
2
  import { ActorTypeSchema, NotificationTypeSchema } from "./enums.schema.js";
3
- import { AssistantHistorySchema, IdSchema, NotificationPreferencesSchema, TimestampSchema } from "./entities.schema.js";
3
+ import { AssistantHistorySchema, IdSchema, NotificationPreferencesSchema, PomodoroSettingsSchema, TimestampSchema } from "./entities.schema.js";
4
4
  /** Corps des requêtes et des réponses des notifications et des paramètres de la GUI. */
5
5
  /** Nombre de notifications renvoyées par défaut, et au plus, par page. */
6
6
  export const NOTIFICATIONS_PAGE_SIZE = 20;
@@ -57,6 +57,8 @@ export const SettingsResponseSchema = z.object({
57
57
  notifyFollowUpEmail: z.boolean(),
58
58
  /** Nombre d'échanges précédents transmis à l'agent avec un message de l'assistant. */
59
59
  assistantHistory: AssistantHistorySchema,
60
+ /** Réglages pomodoro proposés au démarrage d'un chrono. */
61
+ pomodoro: PomodoroSettingsSchema,
60
62
  /** Envoi des e-mails de notification : `reason` dit pourquoi il n'a pas lieu. */
61
63
  email: z.object({ enabled: z.boolean(), reason: z.string().nullable() }),
62
64
  /** Dictée vocale : `reason` dit pourquoi elle est indisponible. */
@@ -71,6 +73,7 @@ export const UpdateSettingsRequestSchema = z
71
73
  notifyFollowUpApp: z.boolean().optional(),
72
74
  notifyFollowUpEmail: z.boolean().optional(),
73
75
  assistantHistory: AssistantHistorySchema.optional(),
76
+ pomodoro: PomodoroSettingsSchema.optional(),
74
77
  })
75
78
  .strict()
76
79
  .refine((patch) => Object.values(patch).some((value) => value !== undefined), "Aucune modification demandée.");
@@ -68,6 +68,10 @@ export declare const TaskNodeSchema: z.ZodObject<{
68
68
  done: z.ZodNumber;
69
69
  total: z.ZodNumber;
70
70
  }, z.core.$strip>;
71
+ questions: z.ZodObject<{
72
+ done: z.ZodNumber;
73
+ total: z.ZodNumber;
74
+ }, z.core.$strip>;
71
75
  test: z.ZodNullable<z.ZodObject<{
72
76
  total: z.ZodNumber;
73
77
  verified: z.ZodNumber;
@@ -156,6 +160,10 @@ export declare const BoardResponseSchema: z.ZodObject<{
156
160
  done: z.ZodNumber;
157
161
  total: z.ZodNumber;
158
162
  }, z.core.$strip>;
163
+ questions: z.ZodObject<{
164
+ done: z.ZodNumber;
165
+ total: z.ZodNumber;
166
+ }, z.core.$strip>;
159
167
  test: z.ZodNullable<z.ZodObject<{
160
168
  total: z.ZodNumber;
161
169
  verified: z.ZodNumber;
@@ -526,6 +534,10 @@ export declare const TaskDetailResponseSchema: z.ZodObject<{
526
534
  done: z.ZodNumber;
527
535
  total: z.ZodNumber;
528
536
  }, z.core.$strip>;
537
+ questions: z.ZodObject<{
538
+ done: z.ZodNumber;
539
+ total: z.ZodNumber;
540
+ }, z.core.$strip>;
529
541
  test: z.ZodNullable<z.ZodObject<{
530
542
  total: z.ZodNumber;
531
543
  verified: z.ZodNumber;
@@ -679,6 +691,30 @@ export declare const TaskDetailResponseSchema: z.ZodObject<{
679
691
  actionId: z.ZodString;
680
692
  at: z.ZodISODateTime;
681
693
  }, z.core.$strip>>;
694
+ time: z.ZodObject<{
695
+ serverNow: z.ZodISODateTime;
696
+ totalMs: z.ZodNumber;
697
+ sessions: z.ZodArray<z.ZodObject<{
698
+ id: z.ZodString;
699
+ taskId: z.ZodString;
700
+ userId: z.ZodString;
701
+ userName: z.ZodString;
702
+ mode: z.ZodEnum<{
703
+ free: "free";
704
+ pomodoro: "pomodoro";
705
+ }>;
706
+ pomodoro: z.ZodNullable<z.ZodObject<{
707
+ workMinutes: z.ZodNumber;
708
+ shortBreakMinutes: z.ZodNumber;
709
+ longBreakMinutes: z.ZodNumber;
710
+ cycles: z.ZodNumber;
711
+ }, z.core.$strip>>;
712
+ startedAt: z.ZodISODateTime;
713
+ endedAt: z.ZodNullable<z.ZodISODateTime>;
714
+ runningSince: z.ZodNullable<z.ZodISODateTime>;
715
+ elapsedMs: z.ZodNumber;
716
+ }, z.core.$strip>>;
717
+ }, z.core.$strip>;
682
718
  }, z.core.$strip>;
683
719
  export type TaskDetailResponse = z.infer<typeof TaskDetailResponseSchema>;
684
720
  export declare const CreateTaskRequestSchema: z.ZodObject<{
@@ -828,10 +864,12 @@ export declare const ChangesResponseSchema: z.ZodObject<{
828
864
  board_view: "board_view";
829
865
  checklist_item: "checklist_item";
830
866
  comment: "comment";
867
+ document: "document";
831
868
  follow_up: "follow_up";
832
869
  idea: "idea";
833
870
  invitation: "invitation";
834
871
  membership: "membership";
872
+ note: "note";
835
873
  notification: "notification";
836
874
  space: "space";
837
875
  tag: "tag";
@@ -840,6 +878,7 @@ export declare const ChangesResponseSchema: z.ZodObject<{
840
878
  test_checkpoint: "test_checkpoint";
841
879
  test_result: "test_result";
842
880
  test_review: "test_review";
881
+ time_session: "time_session";
843
882
  user: "user";
844
883
  user_settings: "user_settings";
845
884
  }>;
@@ -1,5 +1,6 @@
1
1
  import { z } from "zod";
2
2
  import { RequestStatusSchema, TaskPrioritySchema, TaskStatusSchema, TaskTypeSchema, TestResultValueSchema } from "./enums.schema.js";
3
+ import { TaskTimeSchema } from "./timers-api.schema.js";
3
4
  import { ChangeSchema, EmailSchema, IdSchema, MAX_OTHER_ANSWER_LENGTH, PositionSchema, TimestampSchema } from "./entities.schema.js";
4
5
  /** Corps des requêtes et des réponses de l'API des tâches de la GUI. */
5
6
  /** Taille maximale d'une pièce jointe : 20 Mo. */
@@ -45,6 +46,8 @@ export const TaskNodeSchema = z.object({
45
46
  subtasks: ProgressSchema,
46
47
  /** Éléments cochés de la checklist ; 0/0 pour une tâche de test. */
47
48
  checklist: ProgressSchema,
49
+ /** Questions répondues (une proposition choisie ou une réponse libre) sur le total des questions. */
50
+ questions: ProgressSchema,
48
51
  /** Bilan des points de vérification d'une tâche de test ; null pour une tâche standard. */
49
52
  test: TestSummarySchema.nullable(),
50
53
  get children() {
@@ -221,6 +224,8 @@ export const TaskDetailResponseSchema = z.object({
221
224
  tags: z.array(TagViewSchema),
222
225
  /** Dernière modification de la tâche quand elle vient de l'agent : l'action à annuler et sa date. */
223
226
  agentEdit: z.object({ actionId: IdSchema, at: TimestampSchema }).nullable(),
227
+ /** Temps passé : sessions de chrono de tous les membres. */
228
+ time: TaskTimeSchema,
224
229
  });
225
230
  // --- Requêtes ---
226
231
  export const CreateTaskRequestSchema = z.object({
@@ -0,0 +1,119 @@
1
+ import { z } from "zod";
2
+ /** Corps des requêtes et des réponses du chrono des tâches, côté GUI. */
3
+ /** Session de chrono telle que l'affiche la GUI ; les durées se calculent avec `shared/logic/timer.ts`. */
4
+ export declare const TimeSessionViewSchema: z.ZodObject<{
5
+ id: z.ZodString;
6
+ taskId: z.ZodString;
7
+ userId: z.ZodString;
8
+ userName: z.ZodString;
9
+ mode: z.ZodEnum<{
10
+ free: "free";
11
+ pomodoro: "pomodoro";
12
+ }>;
13
+ pomodoro: z.ZodNullable<z.ZodObject<{
14
+ workMinutes: z.ZodNumber;
15
+ shortBreakMinutes: z.ZodNumber;
16
+ longBreakMinutes: z.ZodNumber;
17
+ cycles: z.ZodNumber;
18
+ }, z.core.$strip>>;
19
+ startedAt: z.ZodISODateTime;
20
+ endedAt: z.ZodNullable<z.ZodISODateTime>;
21
+ runningSince: z.ZodNullable<z.ZodISODateTime>;
22
+ elapsedMs: z.ZodNumber;
23
+ }, z.core.$strip>;
24
+ export type TimeSessionView = z.infer<typeof TimeSessionViewSchema>;
25
+ /** Temps passé sur une tâche : toutes ses sessions, et le total compté à `serverNow`. */
26
+ export declare const TaskTimeSchema: z.ZodObject<{
27
+ serverNow: z.ZodISODateTime;
28
+ totalMs: z.ZodNumber;
29
+ sessions: z.ZodArray<z.ZodObject<{
30
+ id: z.ZodString;
31
+ taskId: z.ZodString;
32
+ userId: z.ZodString;
33
+ userName: z.ZodString;
34
+ mode: z.ZodEnum<{
35
+ free: "free";
36
+ pomodoro: "pomodoro";
37
+ }>;
38
+ pomodoro: z.ZodNullable<z.ZodObject<{
39
+ workMinutes: z.ZodNumber;
40
+ shortBreakMinutes: z.ZodNumber;
41
+ longBreakMinutes: z.ZodNumber;
42
+ cycles: z.ZodNumber;
43
+ }, z.core.$strip>>;
44
+ startedAt: z.ZodISODateTime;
45
+ endedAt: z.ZodNullable<z.ZodISODateTime>;
46
+ runningSince: z.ZodNullable<z.ZodISODateTime>;
47
+ elapsedMs: z.ZodNumber;
48
+ }, z.core.$strip>>;
49
+ }, z.core.$strip>;
50
+ export type TaskTime = z.infer<typeof TaskTimeSchema>;
51
+ /** Session active de l'utilisateur, avec sa tâche et son espace. */
52
+ export declare const ActiveTimerViewSchema: z.ZodObject<{
53
+ id: z.ZodString;
54
+ taskId: z.ZodString;
55
+ userId: z.ZodString;
56
+ userName: z.ZodString;
57
+ mode: z.ZodEnum<{
58
+ free: "free";
59
+ pomodoro: "pomodoro";
60
+ }>;
61
+ pomodoro: z.ZodNullable<z.ZodObject<{
62
+ workMinutes: z.ZodNumber;
63
+ shortBreakMinutes: z.ZodNumber;
64
+ longBreakMinutes: z.ZodNumber;
65
+ cycles: z.ZodNumber;
66
+ }, z.core.$strip>>;
67
+ startedAt: z.ZodISODateTime;
68
+ endedAt: z.ZodNullable<z.ZodISODateTime>;
69
+ runningSince: z.ZodNullable<z.ZodISODateTime>;
70
+ elapsedMs: z.ZodNumber;
71
+ taskKey: z.ZodString;
72
+ taskTitle: z.ZodString;
73
+ spaceId: z.ZodString;
74
+ spaceName: z.ZodString;
75
+ }, z.core.$strip>;
76
+ export type ActiveTimerView = z.infer<typeof ActiveTimerViewSchema>;
77
+ /** `GET timers` et réponse des actions du chrono : sessions actives de l'utilisateur, en marche d'abord. */
78
+ export declare const TimersResponseSchema: z.ZodObject<{
79
+ serverNow: z.ZodISODateTime;
80
+ timers: z.ZodArray<z.ZodObject<{
81
+ id: z.ZodString;
82
+ taskId: z.ZodString;
83
+ userId: z.ZodString;
84
+ userName: z.ZodString;
85
+ mode: z.ZodEnum<{
86
+ free: "free";
87
+ pomodoro: "pomodoro";
88
+ }>;
89
+ pomodoro: z.ZodNullable<z.ZodObject<{
90
+ workMinutes: z.ZodNumber;
91
+ shortBreakMinutes: z.ZodNumber;
92
+ longBreakMinutes: z.ZodNumber;
93
+ cycles: z.ZodNumber;
94
+ }, z.core.$strip>>;
95
+ startedAt: z.ZodISODateTime;
96
+ endedAt: z.ZodNullable<z.ZodISODateTime>;
97
+ runningSince: z.ZodNullable<z.ZodISODateTime>;
98
+ elapsedMs: z.ZodNumber;
99
+ taskKey: z.ZodString;
100
+ taskTitle: z.ZodString;
101
+ spaceId: z.ZodString;
102
+ spaceName: z.ZodString;
103
+ }, z.core.$strip>>;
104
+ }, z.core.$strip>;
105
+ export type TimersResponse = z.infer<typeof TimersResponseSchema>;
106
+ /** `POST tasks/:taskId/timer` : démarre un chrono libre, ou un pomodoro (réglages de l'utilisateur sans `pomodoro`). */
107
+ export declare const StartTimerRequestSchema: z.ZodObject<{
108
+ mode: z.ZodEnum<{
109
+ free: "free";
110
+ pomodoro: "pomodoro";
111
+ }>;
112
+ pomodoro: z.ZodOptional<z.ZodObject<{
113
+ workMinutes: z.ZodNumber;
114
+ shortBreakMinutes: z.ZodNumber;
115
+ longBreakMinutes: z.ZodNumber;
116
+ cycles: z.ZodNumber;
117
+ }, z.core.$strip>>;
118
+ }, z.core.$strict>;
119
+ export type StartTimerRequest = z.infer<typeof StartTimerRequestSchema>;
@@ -0,0 +1,44 @@
1
+ import { z } from "zod";
2
+ import { TimerModeSchema } from "./enums.schema.js";
3
+ import { IdSchema, PomodoroSettingsSchema, TimestampSchema } from "./entities.schema.js";
4
+ /** Corps des requêtes et des réponses du chrono des tâches, côté GUI. */
5
+ /** Session de chrono telle que l'affiche la GUI ; les durées se calculent avec `shared/logic/timer.ts`. */
6
+ export const TimeSessionViewSchema = z.object({
7
+ id: IdSchema,
8
+ taskId: IdSchema,
9
+ userId: IdSchema,
10
+ userName: z.string(),
11
+ mode: TimerModeSchema,
12
+ pomodoro: PomodoroSettingsSchema.nullable(),
13
+ startedAt: TimestampSchema,
14
+ endedAt: TimestampSchema.nullable(),
15
+ runningSince: TimestampSchema.nullable(),
16
+ elapsedMs: z.number().int().min(0),
17
+ });
18
+ /** Temps passé sur une tâche : toutes ses sessions, et le total compté à `serverNow`. */
19
+ export const TaskTimeSchema = z.object({
20
+ /** Heure du serveur à la lecture : la GUI en tire le décalage de son horloge. */
21
+ serverNow: TimestampSchema,
22
+ totalMs: z.number().int().min(0),
23
+ sessions: z.array(TimeSessionViewSchema),
24
+ });
25
+ /** Session active de l'utilisateur, avec sa tâche et son espace. */
26
+ export const ActiveTimerViewSchema = TimeSessionViewSchema.extend({
27
+ taskKey: z.string(),
28
+ taskTitle: z.string(),
29
+ spaceId: IdSchema,
30
+ spaceName: z.string(),
31
+ });
32
+ /** `GET timers` et réponse des actions du chrono : sessions actives de l'utilisateur, en marche d'abord. */
33
+ export const TimersResponseSchema = z.object({
34
+ serverNow: TimestampSchema,
35
+ timers: z.array(ActiveTimerViewSchema),
36
+ });
37
+ /** `POST tasks/:taskId/timer` : démarre un chrono libre, ou un pomodoro (réglages de l'utilisateur sans `pomodoro`). */
38
+ export const StartTimerRequestSchema = z
39
+ .object({
40
+ mode: TimerModeSchema,
41
+ pomodoro: PomodoroSettingsSchema.optional(),
42
+ })
43
+ .strict()
44
+ .refine((input) => input.mode === "pomodoro" || input.pomodoro === undefined, "Un chrono libre n'a pas de réglages pomodoro.");
@@ -35,6 +35,10 @@ export declare const BoardViewViewSchema: z.ZodObject<{
35
35
  assigneeIds: z.ZodArray<z.ZodString>;
36
36
  unassigned: z.ZodBoolean;
37
37
  tagIds: z.ZodArray<z.ZodString>;
38
+ types: z.ZodArray<z.ZodEnum<{
39
+ standard: "standard";
40
+ test: "test";
41
+ }>>;
38
42
  id: z.ZodString;
39
43
  }, z.core.$strip>;
40
44
  export type BoardViewView = z.infer<typeof BoardViewViewSchema>;
@@ -73,6 +77,10 @@ export declare const BoardViewListResponseSchema: z.ZodObject<{
73
77
  assigneeIds: z.ZodArray<z.ZodString>;
74
78
  unassigned: z.ZodBoolean;
75
79
  tagIds: z.ZodArray<z.ZodString>;
80
+ types: z.ZodArray<z.ZodEnum<{
81
+ standard: "standard";
82
+ test: "test";
83
+ }>>;
76
84
  id: z.ZodString;
77
85
  }, z.core.$strip>>;
78
86
  }, z.core.$strip>;
@@ -111,6 +119,10 @@ export declare const CreateBoardViewRequestSchema: z.ZodObject<{
111
119
  assigneeIds: z.ZodArray<z.ZodString>;
112
120
  unassigned: z.ZodBoolean;
113
121
  tagIds: z.ZodArray<z.ZodString>;
122
+ types: z.ZodArray<z.ZodEnum<{
123
+ standard: "standard";
124
+ test: "test";
125
+ }>>;
114
126
  }, z.core.$strict>;
115
127
  export type CreateBoardViewRequest = z.infer<typeof CreateBoardViewRequestSchema>;
116
128
  /** Réglages à changer ; la vue obtenue doit rester valide. */
@@ -147,5 +159,9 @@ export declare const UpdateBoardViewRequestSchema: z.ZodObject<{
147
159
  assigneeIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
148
160
  unassigned: z.ZodOptional<z.ZodBoolean>;
149
161
  tagIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
162
+ types: z.ZodOptional<z.ZodArray<z.ZodEnum<{
163
+ standard: "standard";
164
+ test: "test";
165
+ }>>>;
150
166
  }, z.core.$strict>;
151
167
  export type UpdateBoardViewRequest = z.infer<typeof UpdateBoardViewRequestSchema>;
@@ -1,5 +1,5 @@
1
1
  import { z } from "zod";
2
- import { BoardGroupingSchema, BoardLayoutSchema, TaskPrioritySchema, TaskStatusSchema } from "./enums.schema.js";
2
+ import { BoardGroupingSchema, BoardLayoutSchema, TaskPrioritySchema, TaskStatusSchema, TaskTypeSchema } from "./enums.schema.js";
3
3
  import { IdSchema, MAX_BOARD_VIEW_NAME_LENGTH } from "./entities.schema.js";
4
4
  /** Corps des requêtes et des réponses des vues du tableau de bord de la GUI. */
5
5
  export const BoardViewNameSchema = z
@@ -13,7 +13,8 @@ export const BoardViewNameSchema = z
13
13
  * groupes vides, filtres (vides : toutes les valeurs ; `assigneeIds` : membres
14
14
  * de l'espace dont la vue montre les tâches ; `unassigned` : la vue montre
15
15
  * aussi les tâches sans assigné ; `tagIds` : tags de l'espace dont la vue
16
- * montre les tâches).
16
+ * montre les tâches ; `types` : types de tâche, standard ou test, que la vue
17
+ * montre).
17
18
  */
18
19
  const BoardViewSettingsSchema = z.object({
19
20
  name: BoardViewNameSchema,
@@ -26,6 +27,7 @@ const BoardViewSettingsSchema = z.object({
26
27
  assigneeIds: z.array(IdSchema),
27
28
  unassigned: z.boolean(),
28
29
  tagIds: z.array(IdSchema),
30
+ types: z.array(TaskTypeSchema),
29
31
  });
30
32
  /** Vue du tableau de bord telle que l'affiche la GUI. */
31
33
  export const BoardViewViewSchema = BoardViewSettingsSchema.extend({ id: IdSchema });
@@ -0,0 +1,2 @@
1
+ import { type AgentRoute } from "./types.js";
2
+ export declare const attachmentRoutes: AgentRoute[];