@imenam/mcp-organizer 1.0.42 → 1.0.44
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 +6 -4
- package/dist/shared/logic/feedback.d.ts +12 -0
- package/dist/shared/logic/feedback.js +37 -0
- package/dist/shared/schemas/agent-api.schema.d.ts +42 -0
- package/dist/shared/schemas/agent-api.schema.js +5 -1
- package/dist/shared/schemas/agent-tools.schema.d.ts +19 -0
- package/dist/shared/schemas/agent-tools.schema.js +3 -0
- package/dist/shared/schemas/entities.schema.d.ts +29 -0
- package/dist/shared/schemas/entities.schema.js +19 -1
- package/dist/shared/schemas/enums.schema.d.ts +33 -2
- package/dist/shared/schemas/enums.schema.js +16 -2
- package/dist/shared/schemas/tasks-api.schema.d.ts +115 -0
- package/dist/shared/schemas/tasks-api.schema.js +41 -2
- package/dist/src/agent-api/tasks.js +9 -3
- package/dist/src/core/agent.js +41 -0
- package/dist/src/core/feedback.d.ts +26 -0
- package/dist/src/core/feedback.js +120 -0
- package/dist/src/core/migrations.js +50 -0
- package/dist/src/core/requests.js +7 -0
- package/dist/src/core/store.d.ts +10 -1
- package/dist/src/core/store.js +34 -1
- package/dist/src/core/tasks.js +7 -2
- package/dist/src/core/text-edits.d.ts +12 -0
- package/dist/src/core/text-edits.js +29 -0
- package/dist/src/gui-api.js +6 -1
- package/dist/src/mcp/start.d.ts +1 -1
- package/dist/src/mcp/start.js +1 -0
- package/dist/src/mcp/tools.js +16 -2
- package/gui/dist/assets/{index-pP-Dvqvt.css → index-CwE72p7-.css} +1 -1
- package/gui/dist/assets/index-DKATg-vt.js +144 -0
- package/gui/dist/index.html +2 -2
- package/package.json +1 -1
- package/gui/dist/assets/index-DRRMjg-Q.js +0 -144
package/dist/src/core/store.js
CHANGED
|
@@ -5,7 +5,7 @@ import { newId } from "./ids.js";
|
|
|
5
5
|
import { WatcherRegistry } from "./watchers.js";
|
|
6
6
|
import { isVisibleVersion, VERSION_SNAPSHOT_SCHEMAS, versionSnapshot } from "./versions.js";
|
|
7
7
|
import { MAX_TASK_DEPTH, TASK_PRIORITIES, TASK_STATUSES, TASK_TYPES, VERSIONED_ENTITY_TYPES, } from "../../shared/schemas/enums.schema.js";
|
|
8
|
-
import { PERSONAL_SPACE_EMOJI, SHARED_SPACE_EMOJIS, AccessLinkSchema, AgentActionSchema, AgentInstructionsSchema, AgentTokenSchema, AgentRequestSchema, AttachmentSchema, RequestAttachmentSchema, BoardViewSchema, ChangeSchema, ChecklistItemSchema, CommentSchema, MAX_QUESTION_OPTIONS, QuestionOptionSchema, TaskQuestionSchema, EntityVersionSchema, FollowUpSchema, IdeaSchema, InvitationSchema, NoteSchema, SpaceDocumentSchema, MembershipSchema, NotificationSchema, SessionSchema, SpaceSchema, TagSchema, TaskSchema, TaskSnapshotSchema, TestCheckpointSchema, TestResultSchema, TestReviewSchema, TimeSessionSchema, UserSchema, UserSettingsSchema, SpaceNotificationSettingsSchema, SpaceCategorySchema, SpacePlacementSchema, } from "../../shared/schemas/entities.schema.js";
|
|
8
|
+
import { PERSONAL_SPACE_EMOJI, SHARED_SPACE_EMOJIS, AccessLinkSchema, AgentActionSchema, AgentInstructionsSchema, AgentTokenSchema, AgentRequestSchema, AttachmentSchema, RequestAttachmentSchema, RequestFeedbackSchema, BoardViewSchema, ChangeSchema, ChecklistItemSchema, CommentSchema, MAX_QUESTION_OPTIONS, QuestionOptionSchema, TaskQuestionSchema, EntityVersionSchema, FollowUpSchema, IdeaSchema, InvitationSchema, NoteSchema, SpaceDocumentSchema, MembershipSchema, NotificationSchema, SessionSchema, SpaceSchema, TagSchema, TaskSchema, TaskSnapshotSchema, TestCheckpointSchema, TestResultSchema, TestReviewSchema, TimeSessionSchema, UserSchema, UserSettingsSchema, SpaceNotificationSettingsSchema, SpaceCategorySchema, SpacePlacementSchema, } from "../../shared/schemas/entities.schema.js";
|
|
9
9
|
import { ClaudeConnectionSchema, NewRunnerSessionSchema, RunnerSessionRecordSchema, RunnerSettingsSchema, } from "../../shared/schemas/admin-api.schema.js";
|
|
10
10
|
import { BroadcastRecordSchema, NewBroadcastSchema } from "../../shared/schemas/broadcast-api.schema.js";
|
|
11
11
|
/** Valide `value` avec `schema` ; une donnée invalide est une erreur métier qui liste les champs fautifs. */
|
|
@@ -424,6 +424,15 @@ function attachmentFromRow(row) {
|
|
|
424
424
|
createdAt: row.created_at,
|
|
425
425
|
});
|
|
426
426
|
}
|
|
427
|
+
function feedbackFromRow(row) {
|
|
428
|
+
return RequestFeedbackSchema.parse({
|
|
429
|
+
requestId: row.request_id,
|
|
430
|
+
targetKind: row.target_kind,
|
|
431
|
+
targetId: row.target_id,
|
|
432
|
+
excerpt: row.excerpt,
|
|
433
|
+
shortcut: row.shortcut,
|
|
434
|
+
});
|
|
435
|
+
}
|
|
427
436
|
function requestAttachmentFromRow(row) {
|
|
428
437
|
return RequestAttachmentSchema.parse({
|
|
429
438
|
id: row.id,
|
|
@@ -1171,6 +1180,19 @@ export class Store {
|
|
|
1171
1180
|
.all({ spaceId, limit });
|
|
1172
1181
|
return rows.map(requestFromRow);
|
|
1173
1182
|
}
|
|
1183
|
+
/** Élément visé par une demande `feedback`, ou null pour une autre demande. */
|
|
1184
|
+
findRequestFeedback(requestId) {
|
|
1185
|
+
const row = this.db.prepare("SELECT * FROM request_feedbacks WHERE request_id = ?").get(requestId);
|
|
1186
|
+
return row ? feedbackFromRow(row) : null;
|
|
1187
|
+
}
|
|
1188
|
+
/** Retours ciblés en attente ou en cours sur une tâche, du plus ancien au plus récent, avec l'élément visé. */
|
|
1189
|
+
listOpenFeedbackRequests(taskId) {
|
|
1190
|
+
const rows = this.db
|
|
1191
|
+
.prepare(`SELECT r.*, f.target_kind, f.target_id, f.excerpt, f.shortcut FROM agent_requests r JOIN request_feedbacks f ON f.request_id = r.id
|
|
1192
|
+
WHERE r.context_task_id = ? AND r.kind = 'feedback' AND r.status IN ('pending', 'processing') ORDER BY r.created_at, r.id`)
|
|
1193
|
+
.all(taskId);
|
|
1194
|
+
return rows.map((row) => ({ request: requestFromRow(row), feedback: feedbackFromRow({ ...row, request_id: row.id }) }));
|
|
1195
|
+
}
|
|
1174
1196
|
/** Demande confiée à l'agent par un commentaire, ou null. */
|
|
1175
1197
|
findRequestOfComment(commentId) {
|
|
1176
1198
|
const row = this.db.prepare("SELECT * FROM agent_requests WHERE comment_id = ? ORDER BY created_at LIMIT 1").get(commentId);
|
|
@@ -2895,6 +2917,14 @@ export class Mutation {
|
|
|
2895
2917
|
text, status, parent_request_id, comment_id, created_at, updated_at)
|
|
2896
2918
|
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`)
|
|
2897
2919
|
.run(request.id, request.authorId, request.targetSpaceId, request.kind, request.contextTaskId, request.contextIdeaId, request.text, request.status, request.parentRequestId, request.commentId, request.createdAt, request.updatedAt);
|
|
2920
|
+
if ((request.kind === "feedback") !== (input.feedback !== undefined))
|
|
2921
|
+
throw new InvariantError("A feedback request, and only one, designates the element it is about.");
|
|
2922
|
+
if (input.feedback) {
|
|
2923
|
+
const feedback = validate(RequestFeedbackSchema, { ...input.feedback, requestId: request.id }, "feedback");
|
|
2924
|
+
this.db
|
|
2925
|
+
.prepare("INSERT INTO request_feedbacks (request_id, target_kind, target_id, excerpt, shortcut) VALUES (?, ?, ?, ?, ?)")
|
|
2926
|
+
.run(feedback.requestId, feedback.targetKind, feedback.targetId, feedback.excerpt, feedback.shortcut);
|
|
2927
|
+
}
|
|
2898
2928
|
this.createdRequestIds.add(request.id);
|
|
2899
2929
|
this.pendingRequestIds.push(request.id);
|
|
2900
2930
|
this.touchRequest(request);
|
|
@@ -3132,6 +3162,9 @@ export class Mutation {
|
|
|
3132
3162
|
const source = status === "done" && finished.commentId !== null ? this.store.findComment(finished.commentId) : null;
|
|
3133
3163
|
if (source)
|
|
3134
3164
|
this.addComment(source.taskId, text, source.id);
|
|
3165
|
+
const discussed = status === "done" && finished.kind === "feedback" && finished.contextTaskId !== null ? this.store.findTask(finished.contextTaskId) : null;
|
|
3166
|
+
if (discussed)
|
|
3167
|
+
this.addComment(discussed.id, text);
|
|
3135
3168
|
return finished;
|
|
3136
3169
|
}
|
|
3137
3170
|
// --- Points à régler ---
|
package/dist/src/core/tasks.js
CHANGED
|
@@ -7,6 +7,7 @@ import { MAX_ATTACHMENT_BYTES, } from "../../shared/schemas/tasks-api.schema.js"
|
|
|
7
7
|
import { summarizeTest } from "../../shared/logic/test-summary.js";
|
|
8
8
|
import { CHECKBOX_CONFLICT, toggleCheckbox } from "../../shared/logic/checkboxes.js";
|
|
9
9
|
import { questionViews } from "./questions.js";
|
|
10
|
+
import { answeredFeedback, openFeedbacks } from "./feedback.js";
|
|
10
11
|
import { testDetail } from "./test-tasks.js";
|
|
11
12
|
import { taskTime } from "./timers.js";
|
|
12
13
|
/**
|
|
@@ -246,6 +247,7 @@ export function getTaskDetail(store, userId, taskId, now = new Date()) {
|
|
|
246
247
|
tags: tagsOf(store, space.id),
|
|
247
248
|
agentEdit: agentEditOf(store, task.id),
|
|
248
249
|
time: taskTime(store, task.id, now),
|
|
250
|
+
feedbacks: openFeedbacks(store, userId, task.id),
|
|
249
251
|
};
|
|
250
252
|
}
|
|
251
253
|
/** Dernière modification de la tâche quand sa dernière version vient de l'agent et que l'action correspondante n'est pas annulée. */
|
|
@@ -398,12 +400,14 @@ function nameOf(store, userId) {
|
|
|
398
400
|
/**
|
|
399
401
|
* Commentaire vu par `userId` : pour un commentaire qui mentionne @agent,
|
|
400
402
|
* l'état de sa demande ; pour la réponse de l'agent, le commentaire auquel
|
|
401
|
-
* elle répond
|
|
403
|
+
* elle répond ou l'élément visé par le retour ciblé auquel elle répond, les
|
|
404
|
+
* points à régler et les modifications de sa demande.
|
|
402
405
|
*/
|
|
403
406
|
function commentView(store, userId, comment) {
|
|
404
407
|
const request = store.findRequestOfComment(comment.id);
|
|
405
408
|
const source = comment.replyToCommentId === null ? null : store.findComment(comment.replyToCommentId);
|
|
406
|
-
const
|
|
409
|
+
const answersFeedback = answeredFeedback(store, comment);
|
|
410
|
+
const answered = comment.requestId === null || (comment.replyToCommentId === null && answersFeedback === null) ? null : store.findAgentRequest(comment.requestId);
|
|
407
411
|
const steers = request !== null && (request.authorId === userId || store.getUser(userId).isAdmin);
|
|
408
412
|
return {
|
|
409
413
|
id: comment.id,
|
|
@@ -425,6 +429,7 @@ function commentView(store, userId, comment) {
|
|
|
425
429
|
}
|
|
426
430
|
: null,
|
|
427
431
|
replyTo: source ? { commentId: source.id, authorName: nameOf(store, source.authorId), excerpt: excerptOf(source.body) } : null,
|
|
432
|
+
answersFeedback,
|
|
428
433
|
reply: answered
|
|
429
434
|
? {
|
|
430
435
|
requestId: answered.id,
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/** Remplacement d'un passage : `search` doit figurer exactement une fois dans le texte au moment où il s'applique. */
|
|
2
|
+
export interface TextEdit {
|
|
3
|
+
search: string;
|
|
4
|
+
replace: string;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Applique les remplacements dans l'ordre, chacun au texte laissé par le
|
|
8
|
+
* précédent ; le reste du texte est conservé tel quel. Un passage introuvable
|
|
9
|
+
* ou présent plusieurs fois refuse l'ensemble : `what` nomme le texte dans
|
|
10
|
+
* l'erreur.
|
|
11
|
+
*/
|
|
12
|
+
export declare function applyTextEdits(text: string, edits: readonly TextEdit[], what: string): string;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { OrganizerError } from "./errors.js";
|
|
2
|
+
/** Nombre d'occurrences de `search` dans `text`, chevauchements compris. */
|
|
3
|
+
function occurrences(text, search) {
|
|
4
|
+
let count = 0;
|
|
5
|
+
for (let at = text.indexOf(search); at !== -1; at = text.indexOf(search, at + 1))
|
|
6
|
+
count++;
|
|
7
|
+
return count;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Applique les remplacements dans l'ordre, chacun au texte laissé par le
|
|
11
|
+
* précédent ; le reste du texte est conservé tel quel. Un passage introuvable
|
|
12
|
+
* ou présent plusieurs fois refuse l'ensemble : `what` nomme le texte dans
|
|
13
|
+
* l'erreur.
|
|
14
|
+
*/
|
|
15
|
+
export function applyTextEdits(text, edits, what) {
|
|
16
|
+
let result = text;
|
|
17
|
+
edits.forEach((edit, index) => {
|
|
18
|
+
const label = edits.length > 1 ? `Edit ${index + 1} of ${edits.length}` : "The edit";
|
|
19
|
+
const count = occurrences(result, edit.search);
|
|
20
|
+
if (count === 0) {
|
|
21
|
+
throw new OrganizerError(`${label}: search text not found in ${what}. Copy it exactly from get_task (the markdown source, not the rendered text, including punctuation and line breaks); nothing was changed.`);
|
|
22
|
+
}
|
|
23
|
+
if (count > 1)
|
|
24
|
+
throw new OrganizerError(`${label}: search text found ${count} times in ${what}. Include more of the surrounding text so that it occurs once; nothing was changed.`);
|
|
25
|
+
const at = result.indexOf(edit.search);
|
|
26
|
+
result = result.slice(0, at) + edit.replace + result.slice(at + edit.search.length);
|
|
27
|
+
});
|
|
28
|
+
return result;
|
|
29
|
+
}
|
package/dist/src/gui-api.js
CHANGED
|
@@ -8,7 +8,8 @@ import { answerQuestion } from "./core/questions.js";
|
|
|
8
8
|
import { listTimers, pauseTimer, resumeTimer, startTimer, stopTimer } from "./core/timers.js";
|
|
9
9
|
import { StartTimerRequestSchema } from "../shared/schemas/timers-api.schema.js";
|
|
10
10
|
import { addCheckpoint, deleteCheckpoint, moveCheckpoint, saveReviewDraft, setTestResult, submitReview, updateCheckpoint } from "./core/test-tasks.js";
|
|
11
|
-
import {
|
|
11
|
+
import { sendFeedback } from "./core/feedback.js";
|
|
12
|
+
import { AddChecklistItemRequestSchema, AnswerQuestionRequestSchema, CheckpointTextRequestSchema, CommentRequestSchema, SendFeedbackRequestSchema, ToggleCheckboxRequestSchema, CreateTaskRequestSchema, MoveAfterRequestSchema, MoveTaskRequestSchema, ReviewDraftRequestSchema, SetAssigneesRequestSchema, SetTagsRequestSchema, SetTestResultRequestSchema, SubmitReviewRequestSchema, TaskFiltersSchema, TaskKeyQuerySchema, UpdateChecklistItemRequestSchema, UpdateTaskRequestSchema, UploadAttachmentRequestSchema, } from "../shared/schemas/tasks-api.schema.js";
|
|
12
13
|
import { getSettings, getSpaceNotificationSettings, listNotifications, markAllNotificationsRead, markNotificationRead, unreadCount, updateSettings, updateSpaceNotificationSettings } from "./core/notifications.js";
|
|
13
14
|
import { NotificationListQuerySchema, UpdateSettingsRequestSchema, UpdateSpaceNotificationSettingsRequestSchema } from "../shared/schemas/notifications-api.schema.js";
|
|
14
15
|
import { cancelRequest, createRequest, createSuite, getRequest, listRequests, relaunchRequest, resendRequest, setFollowUpDone, setRequestDismissed, stopRequest, redoAction, redoRequest, undoAction, undoRequest, updateRequest, } from "./core/requests.js";
|
|
@@ -342,6 +343,10 @@ route("POST", "/tasks/:taskId/review/submit", (ctx, { user, request, params }) =
|
|
|
342
343
|
route("POST", "/tasks/:taskId/comments", (ctx, { user, request, params }) => ({
|
|
343
344
|
body: addComment(ctx.store, user.id, params.taskId, parseBody(CommentRequestSchema, request.body).body),
|
|
344
345
|
}));
|
|
346
|
+
// --- Retours ciblés à l'agent ---------------------------------------------------------
|
|
347
|
+
route("POST", "/tasks/:taskId/feedback", (ctx, { user, request, params }) => ({
|
|
348
|
+
body: sendFeedback(ctx.store, user.id, params.taskId, parseBody(SendFeedbackRequestSchema, request.body)),
|
|
349
|
+
}));
|
|
345
350
|
route("PATCH", "/comments/:commentId", (ctx, { user, request, params }) => ({
|
|
346
351
|
body: updateComment(ctx.store, user.id, params.commentId, parseBody(CommentRequestSchema, request.body).body),
|
|
347
352
|
}));
|
package/dist/src/mcp/start.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type SiteConnection } from "./client.js";
|
|
2
2
|
/** Présentation du serveur transmise au client MCP : concepts et déroulé. */
|
|
3
|
-
export declare const INSTRUCTIONS = "mcp-organizer connects you to an organizer site: a multi-user task manager where people organize tasks in a web app and queue requests for the AI. You, the connected agent, process those requests when the user asks you to. The site never calls an LLM: you are the intelligence.\n\nYour token covers exactly one space, with the rights of the user who created the token. Every tool works on that space.\n\nConcepts:\n- A **space** holds tasks, an idea box, notes and reference documents. A user's **personal space** is private; a **shared space** has one owner and members.\n- A **task** has a title, a markdown description, a status (todo, doing, review, done), a priority (low, medium, high, critical), assignees and tags. Tasks nest on two levels: task > sub-task > sub-sub-task. A task can carry a checklist and test checkpoints that each tester (assignee) marks ok, ko, blocked or untested. Its type, standard or test, is only an indicator of what it is about: it restricts neither. Any task can also carry **questions** you ask the members to settle a point: options to choose from (one, or several), each with a markdown detail, plus a free answer. The members answer on the site; an answer does not notify you. You read the answers with get_task, and act on them only when a member asks you to, in a message or in a comment mentioning @agent.\n- A task has **attachments** (files the members upload), listed by get_task with their id. Members paste screenshots into descriptions, comments, checkpoint comments and free answers to questions: such an image is an attachment of the task, referenced in the text as ``, and get_task flags the comments, checkpoint comments and free answers that contain one. Open with get_attachment the images and PDF files that matter for the request \u2014 a screenshot attached to a failed checkpoint, an image cited in a comment mentioning @agent, a PDF specification: you see an image as it is, and read the text of a PDF (a scanned PDF without a text layer is reported as such). You can attach a file yourself with add_attachment \u2014 a screenshot you took during a test, an export or a report you generated: give the absolute path of the file on your machine in file_path; it is read and uploaded for you, so its content never goes through you. Pass comment to post it in a comment (an image shows as a thumbnail) or append_to_description to reference it in the description.\n- A request can carry **images** its author pasted in its text (``): claim_request lists them with their id. Open them with get_attachment, and attach the ones that explain a task you create or change with copy_attachment, which copies the file on the site: the task then reads without the request.\n- A **note** is a markdown draft a member writes in the space to mature a thought over several sessions. Notes never reach your queue and writing one does not notify you: read them only when a member asks you to, with get_note and search_notes (read-only). A text refers to a note by a link ending in `#/notes/<id>`; when a request links notes, claim_request shows them in full. \"Envoyer \u00E0 l'agent\" on a note queues a message that links it: process the note as that message asks (create or update tasks, ideas\u2026).\n- **Mentions**: a text mentions a task by its key (`ORG-30`), which the site shows as a button with the task's status and its key or current title, and a page of the space by a markdown link to its address, which the site shows as a pill named after the current name of its target (the link text is only a fallback): `[Tableau de bord](#/tableau-de-bord)`. An address without a space designates the space of the text; members' mentions carry it (`#/espaces/<space id>/\u2026`). Addresses: dashboard `#/tableau-de-bord`, one of the reader's views `#/tableau-de-bord/vue/<view id>`, ideas `#/idees`, notes `#/notes`, a note `#/notes/<note id>`, documents `#/documents`, a document `#/documents/<document id>`, the agent page `#/agent` and its tabs `#/agent/file`, `#/agent/en-traitement`, `#/agent/en-attente`, `#/agent/traitees`, `#/agent/annulees`, history `#/historique`, space settings `#/espace`. Write mentions the same way in your descriptions, comments and replies.\n- **Folded blocks**: in a description, a comment or a note, `<details>` on its own line, then `<summary>Title</summary>` on its own line, the markdown content, and `</details>` on its own line show the content folded behind its title until a member clicks it; blocks can nest. Other HTML is shown as text. You can fold secondary content this way (technical details, logs, long excerpts).\n- A **document** is a reference file a member uploads to the space (a report on the project, a specification, a data export\u2026) so that your decisions match the real state of the project. claim_request and get_context list the documents with their description; read the ones that help the request with get_document (read-only, in parts for long files). You read text files (txt, md, csv, json, yaml, xml\u2026) and the text of Word files (.docx) and PDF files; an image comes as the image itself, which you see.\n- A **request** is something a member of your space asked the AI: an idea, a remark, a test review, a message or an idea promotion. It is pending, then processing once you claim it (only your token can then act for it), then done (with your reply and the points left to its author) or failed (with the reason). The points left to the author are checkboxes the members tick off. A **follow-up** is a message a member sends from a handled request: claim_request shows that original request, your reply and its points with their ids, and check_follow_ups ticks off the points the follow-up settles. A member can also hand a request to you by mentioning @agent in a comment of a task: claim_request then shows the task's thread, and complete_request posts your reply as a comment right after theirs.\n- A **batch** is the set of actions you perform for one request. Every action is logged with its before and after state and with your token, and users can undo one action or the whole batch.\n- The **history** of the space records every event, by the members and by you: tasks created, changed (with before and after values) or deleted, checklist items, ideas, members, notes and documents (comments keep their own thread). Members read it on the site and restore an old version of a task, or a deleted task, from there. Read it with get_history when a member asks who changed something or what happened to a task.\n- A **direct action** is a write you make without request_id, when your user asks you directly (in their editor, for example) rather than through a request: it is done in the name of your token's owner and forms its own batch, listed among the requests of the space as a direct action and undoable like any other. The site runner never acts directly: it always passes the request_id of the request it processes.\n- A **view** is a tab of a member's dashboard: a layout (kanban, list, matrix), groupings by status or priority, and filters on status, priority, assignees, tags and task type (standard or test). Each member has their own views in each space.\n- A **timer** measures the time a member spends on a task: a free timer, or a pomodoro that alternates work phases and breaks (default 25 / 5 / 15 min, long break after 4 cycles). Each member has their own timer on a task, only one runs at a time, and the site's clock counts it; only the work phases of a pomodoro count. The time spent on a task is the sum of the sessions of all members: read it with get_task_time. When a member asks you to measure their time, call start_timer (and stop_timer to end it): you act on the timers of the author of the request, like their views.\n- The **scope** of your work is the space of your token: you see and process the requests of all its members, and you never act outside it. You change the views and timers of the author of the request you process, and nobody else's: only when the author owns your token, or when you are the site runner. A direct action on views or timers changes those of your token's owner.\n\nWork loop, when the user asks you to process the queue:\n1. list_requests to see the pending requests of your space.\n2. claim_request on the oldest one: it becomes processing for you and you get its context (text, author, context task, for a message the previous exchanges of its author, task tree, members, recent ideas, reference documents), along with the custom instructions of the site and of the space, which you follow. get_context shows the space at any time.\n3. Read what you need with get_task and search_tasks, with get_attachment for an image of the request or a file attached to a task, with get_history to know who changed what, with get_note for a note the request or a task links, and with get_document for a reference document that helps the request.\n4. Act with create_task, update_task, set_assignees, set_tags, edit_checklist, edit_questions, add_comment, add_attachment, copy_attachment, create_idea, update_idea, promote_idea, with list_views, create_view, update_view, delete_view when the author asks how their board should look, with start_timer and stop_timer when the author asks to measure their time on a task, and with check_follow_ups for a follow-up \u2014 always passing the request_id. Each write is one undoable action of the batch.\n5. complete_request with a short reply in the author's language and, in follow_ups, only what blocks the request and prevents you from completing it, never a point already carried by a task, a checklist item or a question (or fail_request with the reason), then go back to step 1 until no request is pending.\nWhen the queue is empty, tell the user.\n\nDirect work, when the user asks you to change the space outside any request: read with get_context, get_task and search_tasks, then call the write tools without request_id. Do not claim, complete or fail anything: there is no request to close. When something blocks the work and prevents you from completing it, leave it to your user with report_direct.\n\nNotifications: call enable_notifications once at the start of the session and arm the watcher it hands you with Monitor, whatever the command (behind mcp-http-gateway, the gateway relay answers in place of this server and gives its own watcher command). Each request that becomes pending in your space then arrives on its own as one line (kind, author, excerpt, request id), even while you are idle: process it with the work loop above, starting with claim_request. The host stops that watcher after 30 minutes at most: each time it tells you the watcher expired, re-arm it at once with the same Monitor call; otherwise notifications stop for good. A line \"notifications stopped\" means the site refused the token, and a line \"[gateway-watch] \u2026 la veille \u00E9choue\" means the gateway watcher keeps failing: tell the user. wait_for_requests is the waiting tool of the watcher: you do not need to call it.\n\nHow to handle each kind of request:\n- **idea**: classify it. If it belongs to an existing task or sub-task, attach it there (sub-task, checklist item or comment). If it is actionable and important enough, create a task (or sub-task) with a fitting priority. Otherwise, put it in the idea box with create_idea. Prefer existing tasks over duplicates.\n- **test_review**: feed the tester's findings back into the existing tasks (status, checklist, comments, priority of the affected tasks), or create a task for each problem that has none.\n- **remark** and **message**: do whatever is useful \u2014 answer, update or create tasks, comment \u2014 and say what you did in the reply.\n- **idea_promotion**: turn the context idea into a well-formed task with promote_idea.\n\nRules: write titles, descriptions and replies in the language of the users; keep the reply short and factual (markdown is rendered); put anything the members are meant to copy and paste (a command, code, a prompt, an identifier, a URL to reuse) in a fenced markdown code block, which the site shows with a Copy button; never bury in the reply something that blocks the request: it belongs in follow_ups. Errors tell you what to do next; an error about the token (missing, revoked, expired, owner no longer a member) cannot be fixed by retrying: tell the user.";
|
|
3
|
+
export declare const INSTRUCTIONS = "mcp-organizer connects you to an organizer site: a multi-user task manager where people organize tasks in a web app and queue requests for the AI. You, the connected agent, process those requests when the user asks you to. The site never calls an LLM: you are the intelligence.\n\nYour token covers exactly one space, with the rights of the user who created the token. Every tool works on that space.\n\nConcepts:\n- A **space** holds tasks, an idea box, notes and reference documents. A user's **personal space** is private; a **shared space** has one owner and members.\n- A **task** has a title, a markdown description, a status (todo, doing, review, done), a priority (low, medium, high, critical), assignees and tags. Tasks nest on two levels: task > sub-task > sub-sub-task. A task can carry a checklist and test checkpoints that each tester (assignee) marks ok, ko, blocked or untested. Its type, standard or test, is only an indicator of what it is about: it restricts neither. Any task can also carry **questions** you ask the members to settle a point: options to choose from (one, or several), each with a markdown detail, plus a free answer. The members answer on the site; an answer does not notify you. You read the answers with get_task, and act on them only when a member asks you to, in a message or in a comment mentioning @agent.\n- A task has **attachments** (files the members upload), listed by get_task with their id. Members paste screenshots into descriptions, comments, checkpoint comments and free answers to questions: such an image is an attachment of the task, referenced in the text as ``, and get_task flags the comments, checkpoint comments and free answers that contain one. Open with get_attachment the images and PDF files that matter for the request \u2014 a screenshot attached to a failed checkpoint, an image cited in a comment mentioning @agent, a PDF specification: you see an image as it is, and read the text of a PDF (a scanned PDF without a text layer is reported as such). You can attach a file yourself with add_attachment \u2014 a screenshot you took during a test, an export or a report you generated: give the absolute path of the file on your machine in file_path; it is read and uploaded for you, so its content never goes through you. Pass comment to post it in a comment (an image shows as a thumbnail) or append_to_description to reference it in the description.\n- A request can carry **images** its author pasted in its text (``): claim_request lists them with their id. Open them with get_attachment, and attach the ones that explain a task you create or change with copy_attachment, which copies the file on the site: the task then reads without the request.\n- A **note** is a markdown draft a member writes in the space to mature a thought over several sessions. Notes never reach your queue and writing one does not notify you: read them only when a member asks you to, with get_note and search_notes (read-only). A text refers to a note by a link ending in `#/notes/<id>`; when a request links notes, claim_request shows them in full. \"Envoyer \u00E0 l'agent\" on a note queues a message that links it: process the note as that message asks (create or update tasks, ideas\u2026).\n- **Mentions**: a text mentions a task by its key (`ORG-30`), which the site shows as a button with the task's status and its key or current title, and a page of the space by a markdown link to its address, which the site shows as a pill named after the current name of its target (the link text is only a fallback): `[Tableau de bord](#/tableau-de-bord)`. An address without a space designates the space of the text; members' mentions carry it (`#/espaces/<space id>/\u2026`). Addresses: dashboard `#/tableau-de-bord`, one of the reader's views `#/tableau-de-bord/vue/<view id>`, ideas `#/idees`, notes `#/notes`, a note `#/notes/<note id>`, documents `#/documents`, a document `#/documents/<document id>`, the agent page `#/agent` and its tabs `#/agent/file`, `#/agent/en-traitement`, `#/agent/en-attente`, `#/agent/traitees`, `#/agent/annulees`, history `#/historique`, space settings `#/espace`. Write mentions the same way in your descriptions, comments and replies.\n- **Folded blocks**: in a description, a comment or a note, `<details>` on its own line, then `<summary>Title</summary>` on its own line, the markdown content, and `</details>` on its own line show the content folded behind its title until a member clicks it; blocks can nest. Other HTML is shown as text. You can fold secondary content this way (technical details, logs, long excerpts).\n- A **document** is a reference file a member uploads to the space (a report on the project, a specification, a data export\u2026) so that your decisions match the real state of the project. claim_request and get_context list the documents with their description; read the ones that help the request with get_document (read-only, in parts for long files). You read text files (txt, md, csv, json, yaml, xml\u2026) and the text of Word files (.docx) and PDF files; an image comes as the image itself, which you see.\n- A **request** is something a member of your space asked the AI: an idea, a remark, a test review, a message or an idea promotion. It is pending, then processing once you claim it (only your token can then act for it), then done (with your reply and the points left to its author) or failed (with the reason). The points left to the author are checkboxes the members tick off. A **follow-up** is a message a member sends from a handled request: claim_request shows that original request, your reply and its points with their ids, and check_follow_ups ticks off the points the follow-up settles. A member can also hand a request to you by mentioning @agent in a comment of a task: claim_request then shows the task's thread, and complete_request posts your reply as a comment right after theirs.\n- A **batch** is the set of actions you perform for one request. Every action is logged with its before and after state and with your token, and users can undo one action or the whole batch.\n- The **history** of the space records every event, by the members and by you: tasks created, changed (with before and after values) or deleted, checklist items, ideas, members, notes and documents (comments keep their own thread). Members read it on the site and restore an old version of a task, or a deleted task, from there. Read it with get_history when a member asks who changed something or what happened to a task.\n- A **direct action** is a write you make without request_id, when your user asks you directly (in their editor, for example) rather than through a request: it is done in the name of your token's owner and forms its own batch, listed among the requests of the space as a direct action and undoable like any other. The site runner never acts directly: it always passes the request_id of the request it processes.\n- A **view** is a tab of a member's dashboard: a layout (kanban, list, matrix), groupings by status or priority, and filters on status, priority, assignees, tags and task type (standard or test). Each member has their own views in each space.\n- A **timer** measures the time a member spends on a task: a free timer, or a pomodoro that alternates work phases and breaks (default 25 / 5 / 15 min, long break after 4 cycles). Each member has their own timer on a task, only one runs at a time, and the site's clock counts it; only the work phases of a pomodoro count. The time spent on a task is the sum of the sessions of all members: read it with get_task_time. When a member asks you to measure their time, call start_timer (and stop_timer to end it): you act on the timers of the author of the request, like their views.\n- The **scope** of your work is the space of your token: you see and process the requests of all its members, and you never act outside it. You change the views and timers of the author of the request you process, and nobody else's: only when the author owns your token, or when you are the site runner. A direct action on views or timers changes those of your token's owner.\n\nWork loop, when the user asks you to process the queue:\n1. list_requests to see the pending requests of your space.\n2. claim_request on the oldest one: it becomes processing for you and you get its context (text, author, context task, for a message the previous exchanges of its author, task tree, members, recent ideas, reference documents), along with the custom instructions of the site and of the space, which you follow. get_context shows the space at any time.\n3. Read what you need with get_task and search_tasks, with get_attachment for an image of the request or a file attached to a task, with get_history to know who changed what, with get_note for a note the request or a task links, and with get_document for a reference document that helps the request.\n4. Act with create_task, update_task, set_assignees, set_tags, edit_checklist, edit_questions, add_comment, add_attachment, copy_attachment, create_idea, update_idea, promote_idea, with list_views, create_view, update_view, delete_view when the author asks how their board should look, with start_timer and stop_timer when the author asks to measure their time on a task, and with check_follow_ups for a follow-up \u2014 always passing the request_id. Each write is one undoable action of the batch.\n5. complete_request with a short reply in the author's language and, in follow_ups, only what blocks the request and prevents you from completing it, never a point already carried by a task, a checklist item or a question (or fail_request with the reason), then go back to step 1 until no request is pending.\nWhen the queue is empty, tell the user.\n\nDirect work, when the user asks you to change the space outside any request: read with get_context, get_task and search_tasks, then call the write tools without request_id. Do not claim, complete or fail anything: there is no request to close. When something blocks the work and prevents you from completing it, leave it to your user with report_direct.\n\nNotifications: call enable_notifications once at the start of the session and arm the watcher it hands you with Monitor, whatever the command (behind mcp-http-gateway, the gateway relay answers in place of this server and gives its own watcher command). Each request that becomes pending in your space then arrives on its own as one line (kind, author, excerpt, request id), even while you are idle: process it with the work loop above, starting with claim_request. The host stops that watcher after 30 minutes at most: each time it tells you the watcher expired, re-arm it at once with the same Monitor call; otherwise notifications stop for good. A line \"notifications stopped\" means the site refused the token, and a line \"[gateway-watch] \u2026 la veille \u00E9choue\" means the gateway watcher keeps failing: tell the user. wait_for_requests is the waiting tool of the watcher: you do not need to call it.\n\nHow to handle each kind of request:\n- **idea**: classify it. If it belongs to an existing task or sub-task, attach it there (sub-task, checklist item or comment). If it is actionable and important enough, create a task (or sub-task) with a fitting priority. Otherwise, put it in the idea box with create_idea. Prefer existing tasks over duplicates.\n- **test_review**: feed the tester's findings back into the existing tasks (status, checklist, comments, priority of the affected tasks), or create a task for each problem that has none.\n- **remark** and **message**: do whatever is useful \u2014 answer, update or create tasks, comment \u2014 and say what you did in the reply.\n- **idea_promotion**: turn the context idea into a well-formed task with promote_idea.\n- **feedback**: a member's feedback on one element of the context task (claim_request names it, with its text): change that element only \u2014 in a description, replace just the sentences concerned with update_task description_edits \u2014 or answer without changing anything when the feedback asks for information. Your reply is posted as a comment that quotes the element.\n\nRules: write titles, descriptions and replies in the language of the users; keep the reply short and factual (markdown is rendered); put anything the members are meant to copy and paste (a command, code, a prompt, an identifier, a URL to reuse) in a fenced markdown code block, which the site shows with a Copy button; never bury in the reply something that blocks the request: it belongs in follow_ups. Errors tell you what to do next; an error about the token (missing, revoked, expired, owner no longer a member) cannot be fixed by retrying: tell the user.";
|
|
4
4
|
/**
|
|
5
5
|
* Connexion au site d'après `ORGANIZER_URL` et `ORGANIZER_TOKEN` ; une valeur
|
|
6
6
|
* absente ou invalide, ou une URL http vers une autre machine, est une `ConfigError`.
|
package/dist/src/mcp/start.js
CHANGED
|
@@ -47,6 +47,7 @@ How to handle each kind of request:
|
|
|
47
47
|
- **test_review**: feed the tester's findings back into the existing tasks (status, checklist, comments, priority of the affected tasks), or create a task for each problem that has none.
|
|
48
48
|
- **remark** and **message**: do whatever is useful — answer, update or create tasks, comment — and say what you did in the reply.
|
|
49
49
|
- **idea_promotion**: turn the context idea into a well-formed task with promote_idea.
|
|
50
|
+
- **feedback**: a member's feedback on one element of the context task (claim_request names it, with its text): change that element only — in a description, replace just the sentences concerned with update_task description_edits — or answer without changing anything when the feedback asks for information. Your reply is posted as a comment that quotes the element.
|
|
50
51
|
|
|
51
52
|
Rules: write titles, descriptions and replies in the language of the users; keep the reply short and factual (markdown is rendered); put anything the members are meant to copy and paste (a command, code, a prompt, an identifier, a URL to reuse) in a fenced markdown code block, which the site shows with a Copy button; never bury in the reply something that blocks the request: it belongs in follow_ups. Errors tell you what to do next; an error about the token (missing, revoked, expired, owner no longer a member) cannot be fixed by retrying: tell the user.`;
|
|
52
53
|
/** Hôtes de la machine locale, seuls admis en http. */
|
package/dist/src/mcp/tools.js
CHANGED
|
@@ -251,14 +251,28 @@ export const AGENT_TOOLS = [
|
|
|
251
251
|
path: "tasks/{task}",
|
|
252
252
|
definition: {
|
|
253
253
|
name: "update_task",
|
|
254
|
-
description: "Change a task of your space: title, description, status, priority, type, parent (move it under another task, or null to make it top-level), position in its column (after_task) and, for a test task, the task it tests (tested_task_id). Only the given fields change. Read the task with get_task first.",
|
|
254
|
+
description: "Change a task of your space: title, description, status, priority, type, parent (move it under another task, or null to make it top-level), position in its column (after_task) and, for a test task, the task it tests (tested_task_id). Only the given fields change. To change a sentence or a passage of the description, use description_edits rather than rewriting the whole description: the rest of the text, including what members changed meanwhile, stays as it is. Read the task with get_task first.",
|
|
255
255
|
inputSchema: {
|
|
256
256
|
type: "object",
|
|
257
257
|
properties: {
|
|
258
258
|
request_id: REQUEST_ID,
|
|
259
259
|
task: TASK_REF,
|
|
260
260
|
title: { type: "string", maxLength: MAX_TASK_TITLE_LENGTH },
|
|
261
|
-
description: { type: "string", description: "New markdown description (replaces the whole description)." },
|
|
261
|
+
description: { type: "string", description: "New markdown description (replaces the whole description). Not with description_edits." },
|
|
262
|
+
description_edits: {
|
|
263
|
+
type: "array",
|
|
264
|
+
minItems: 1,
|
|
265
|
+
description: "Passages of the markdown description to replace, applied in order: each search text must occur exactly once in the description (copy it from get_task, markdown included), otherwise nothing changes. Not with description.",
|
|
266
|
+
items: {
|
|
267
|
+
type: "object",
|
|
268
|
+
properties: {
|
|
269
|
+
search: { type: "string", minLength: 1, description: "Exact text to find in the current description." },
|
|
270
|
+
replace: { type: "string", description: "Text that replaces it (empty to remove it)." },
|
|
271
|
+
},
|
|
272
|
+
required: ["search", "replace"],
|
|
273
|
+
additionalProperties: false,
|
|
274
|
+
},
|
|
275
|
+
},
|
|
262
276
|
status: { type: "string", enum: [...TASK_STATUSES] },
|
|
263
277
|
priority: { type: "string", enum: [...TASK_PRIORITIES] },
|
|
264
278
|
type: { type: "string", enum: [...TASK_TYPES] },
|