boondmanager-mcp-server 2.16.0 → 2.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +57 -4
- package/dist/config/access-policy.d.ts.map +1 -1
- package/dist/config/access-policy.js +6 -18
- package/dist/config/access-policy.js.map +1 -1
- package/dist/config/dictionary-overrides.d.ts.map +1 -1
- package/dist/config/dictionary-overrides.js +2 -12
- package/dist/config/dictionary-overrides.js.map +1 -1
- package/dist/config/env.d.ts +63 -0
- package/dist/config/env.d.ts.map +1 -0
- package/dist/config/env.js +116 -0
- package/dist/config/env.js.map +1 -0
- package/dist/config/profiles.d.ts +22 -8
- package/dist/config/profiles.d.ts.map +1 -1
- package/dist/config/profiles.js +48 -4
- package/dist/config/profiles.js.map +1 -1
- package/dist/config/transport-kind.d.ts +8 -0
- package/dist/config/transport-kind.d.ts.map +1 -0
- package/dist/config/transport-kind.js +13 -0
- package/dist/config/transport-kind.js.map +1 -0
- package/dist/constants.d.ts +20 -2
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +32 -1
- package/dist/constants.js.map +1 -1
- package/dist/icons.d.ts.map +1 -1
- package/dist/icons.js +6 -1
- package/dist/icons.js.map +1 -1
- package/dist/index.js +32 -20
- package/dist/index.js.map +1 -1
- package/dist/instructions.d.ts +1 -1
- package/dist/instructions.d.ts.map +1 -1
- package/dist/instructions.js +6 -6
- package/dist/instructions.js.map +1 -1
- package/dist/prompts/index.d.ts +19 -1
- package/dist/prompts/index.d.ts.map +1 -1
- package/dist/prompts/index.js +495 -25
- package/dist/prompts/index.js.map +1 -1
- package/dist/prompts/periods.d.ts +45 -0
- package/dist/prompts/periods.d.ts.map +1 -0
- package/dist/prompts/periods.js +154 -0
- package/dist/prompts/periods.js.map +1 -0
- package/dist/resources/index.d.ts +14 -0
- package/dist/resources/index.d.ts.map +1 -1
- package/dist/resources/index.js +285 -0
- package/dist/resources/index.js.map +1 -1
- package/dist/resources/templates.d.ts +1 -1
- package/dist/resources/templates.d.ts.map +1 -1
- package/dist/resources/templates.js +2 -0
- package/dist/resources/templates.js.map +1 -1
- package/dist/schema-dialect.js.map +1 -1
- package/dist/schemas/filter-aliases.d.ts +1 -1
- package/dist/schemas/filter-aliases.d.ts.map +1 -1
- package/dist/schemas/filter-aliases.js +101 -2
- package/dist/schemas/filter-aliases.js.map +1 -1
- package/dist/schemas/index.d.ts +1045 -163
- package/dist/schemas/index.d.ts.map +1 -1
- package/dist/schemas/index.js +979 -330
- package/dist/schemas/index.js.map +1 -1
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +10 -3
- package/dist/server.js.map +1 -1
- package/dist/services/boond-client.d.ts +29 -213
- package/dist/services/boond-client.d.ts.map +1 -1
- package/dist/services/boond-client.js +29 -1168
- package/dist/services/boond-client.js.map +1 -1
- package/dist/services/dictionary.d.ts +27 -3
- package/dist/services/dictionary.d.ts.map +1 -1
- package/dist/services/dictionary.js +60 -23
- package/dist/services/dictionary.js.map +1 -1
- package/dist/services/document-text.d.ts +32 -0
- package/dist/services/document-text.d.ts.map +1 -0
- package/dist/services/document-text.js +120 -0
- package/dist/services/document-text.js.map +1 -0
- package/dist/services/format/detail.d.ts +16 -0
- package/dist/services/format/detail.d.ts.map +1 -0
- package/dist/services/format/detail.js +36 -0
- package/dist/services/format/detail.js.map +1 -0
- package/dist/services/format/html.d.ts +19 -0
- package/dist/services/format/html.d.ts.map +1 -0
- package/dist/services/format/html.js +87 -0
- package/dist/services/format/html.js.map +1 -0
- package/dist/services/format/list.d.ts +3 -0
- package/dist/services/format/list.d.ts.map +1 -0
- package/dist/services/format/list.js +44 -0
- package/dist/services/format/list.js.map +1 -0
- package/dist/services/format/summary.d.ts +23 -0
- package/dist/services/format/summary.d.ts.map +1 -0
- package/dist/services/format/summary.js +194 -0
- package/dist/services/format/summary.js.map +1 -0
- package/dist/services/format/tab.d.ts +9 -0
- package/dist/services/format/tab.d.ts.map +1 -0
- package/dist/services/format/tab.js +32 -0
- package/dist/services/format/tab.js.map +1 -0
- package/dist/services/http/auth.d.ts +44 -0
- package/dist/services/http/auth.d.ts.map +1 -0
- package/dist/services/http/auth.js +146 -0
- package/dist/services/http/auth.js.map +1 -0
- package/dist/services/http/download.d.ts +60 -0
- package/dist/services/http/download.d.ts.map +1 -0
- package/dist/services/http/download.js +160 -0
- package/dist/services/http/download.js.map +1 -0
- package/dist/services/http/errors.d.ts +45 -0
- package/dist/services/http/errors.d.ts.map +1 -0
- package/dist/services/http/errors.js +188 -0
- package/dist/services/http/errors.js.map +1 -0
- package/dist/services/http/rate-limit.d.ts +40 -0
- package/dist/services/http/rate-limit.d.ts.map +1 -0
- package/dist/services/http/rate-limit.js +92 -0
- package/dist/services/http/rate-limit.js.map +1 -0
- package/dist/services/http/retry.d.ts +46 -0
- package/dist/services/http/retry.d.ts.map +1 -0
- package/dist/services/http/retry.js +101 -0
- package/dist/services/http/retry.js.map +1 -0
- package/dist/services/http/transport.d.ts +85 -0
- package/dist/services/http/transport.d.ts.map +1 -0
- package/dist/services/http/transport.js +283 -0
- package/dist/services/http/transport.js.map +1 -0
- package/dist/services/logger.d.ts +53 -2
- package/dist/services/logger.d.ts.map +1 -1
- package/dist/services/logger.js +82 -21
- package/dist/services/logger.js.map +1 -1
- package/dist/services/oauth.d.ts +12 -0
- package/dist/services/oauth.d.ts.map +1 -1
- package/dist/services/oauth.js +21 -8
- package/dist/services/oauth.js.map +1 -1
- package/dist/services/rate-limiter.d.ts +9 -2
- package/dist/services/rate-limiter.d.ts.map +1 -1
- package/dist/services/rate-limiter.js +18 -6
- package/dist/services/rate-limiter.js.map +1 -1
- package/dist/services/request-context.d.ts +47 -0
- package/dist/services/request-context.d.ts.map +1 -0
- package/dist/services/request-context.js +112 -0
- package/dist/services/request-context.js.map +1 -0
- package/dist/services/search.d.ts +26 -0
- package/dist/services/search.d.ts.map +1 -0
- package/dist/services/search.js +98 -0
- package/dist/services/search.js.map +1 -0
- package/dist/services/update-checker.d.ts.map +1 -1
- package/dist/services/update-checker.js +15 -8
- package/dist/services/update-checker.js.map +1 -1
- package/dist/services/upload-source.d.ts +31 -0
- package/dist/services/upload-source.d.ts.map +1 -0
- package/dist/services/upload-source.js +180 -0
- package/dist/services/upload-source.js.map +1 -0
- package/dist/tools/absences.d.ts +9 -0
- package/dist/tools/absences.d.ts.map +1 -1
- package/dist/tools/absences.js +65 -20
- package/dist/tools/absences.js.map +1 -1
- package/dist/tools/actions.d.ts.map +1 -1
- package/dist/tools/actions.js +11 -27
- package/dist/tools/actions.js.map +1 -1
- package/dist/tools/advantages.d.ts +2 -0
- package/dist/tools/advantages.d.ts.map +1 -1
- package/dist/tools/advantages.js +66 -13
- package/dist/tools/advantages.js.map +1 -1
- package/dist/tools/alerts.d.ts +18 -0
- package/dist/tools/alerts.d.ts.map +1 -0
- package/dist/tools/alerts.js +82 -0
- package/dist/tools/alerts.js.map +1 -0
- package/dist/tools/application.d.ts +2 -1
- package/dist/tools/application.d.ts.map +1 -1
- package/dist/tools/application.js +9 -3
- package/dist/tools/application.js.map +1 -1
- package/dist/tools/candidates.d.ts +7 -0
- package/dist/tools/candidates.d.ts.map +1 -1
- package/dist/tools/candidates.js +96 -1
- package/dist/tools/candidates.js.map +1 -1
- package/dist/tools/contacts.d.ts.map +1 -1
- package/dist/tools/contacts.js +3 -7
- package/dist/tools/contacts.js.map +1 -1
- package/dist/tools/contracts.d.ts +22 -0
- package/dist/tools/contracts.d.ts.map +1 -1
- package/dist/tools/contracts.js +185 -52
- package/dist/tools/contracts.js.map +1 -1
- package/dist/tools/crud-factory.d.ts +33 -2
- package/dist/tools/crud-factory.d.ts.map +1 -1
- package/dist/tools/crud-factory.js +45 -17
- package/dist/tools/crud-factory.js.map +1 -1
- package/dist/tools/deliveries.d.ts +3 -0
- package/dist/tools/deliveries.d.ts.map +1 -1
- package/dist/tools/deliveries.js +50 -94
- package/dist/tools/deliveries.js.map +1 -1
- package/dist/tools/description-builders.d.ts +0 -1
- package/dist/tools/description-builders.d.ts.map +1 -1
- package/dist/tools/description-builders.js +47 -4
- package/dist/tools/description-builders.js.map +1 -1
- package/dist/tools/documents.d.ts.map +1 -1
- package/dist/tools/documents.js +113 -27
- package/dist/tools/documents.js.map +1 -1
- package/dist/tools/expenses.d.ts.map +1 -1
- package/dist/tools/expenses.js +2 -11
- package/dist/tools/expenses.js.map +1 -1
- package/dist/tools/find.d.ts +61 -0
- package/dist/tools/find.d.ts.map +1 -0
- package/dist/tools/find.js +221 -0
- package/dist/tools/find.js.map +1 -0
- package/dist/tools/flags.d.ts +5 -0
- package/dist/tools/flags.d.ts.map +1 -1
- package/dist/tools/flags.js +116 -1
- package/dist/tools/flags.js.map +1 -1
- package/dist/tools/forms.d.ts +5 -0
- package/dist/tools/forms.d.ts.map +1 -0
- package/dist/tools/forms.js +64 -0
- package/dist/tools/forms.js.map +1 -0
- package/dist/tools/groupments.d.ts +5 -0
- package/dist/tools/groupments.d.ts.map +1 -0
- package/dist/tools/groupments.js +68 -0
- package/dist/tools/groupments.js.map +1 -0
- package/dist/tools/inactivities.d.ts +5 -0
- package/dist/tools/inactivities.d.ts.map +1 -0
- package/dist/tools/inactivities.js +59 -0
- package/dist/tools/inactivities.js.map +1 -0
- package/dist/tools/index.d.ts +4 -0
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +4 -0
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/invoices.d.ts.map +1 -1
- package/dist/tools/invoices.js +27 -2
- package/dist/tools/invoices.js.map +1 -1
- package/dist/tools/linked-entity-filters.d.ts +48 -0
- package/dist/tools/linked-entity-filters.d.ts.map +1 -0
- package/dist/tools/linked-entity-filters.js +64 -0
- package/dist/tools/linked-entity-filters.js.map +1 -0
- package/dist/tools/notifications.d.ts.map +1 -1
- package/dist/tools/notifications.js +0 -5
- package/dist/tools/notifications.js.map +1 -1
- package/dist/tools/orders.d.ts.map +1 -1
- package/dist/tools/orders.js +33 -4
- package/dist/tools/orders.js.map +1 -1
- package/dist/tools/parameter-disclosure.js.map +1 -1
- package/dist/tools/payments.d.ts +3 -0
- package/dist/tools/payments.d.ts.map +1 -1
- package/dist/tools/payments.js +43 -109
- package/dist/tools/payments.js.map +1 -1
- package/dist/tools/positionings.d.ts.map +1 -1
- package/dist/tools/positionings.js +9 -39
- package/dist/tools/positionings.js.map +1 -1
- package/dist/tools/projects.d.ts.map +1 -1
- package/dist/tools/projects.js +5 -12
- package/dist/tools/projects.js.map +1 -1
- package/dist/tools/provider-invoices.d.ts +2 -0
- package/dist/tools/provider-invoices.d.ts.map +1 -1
- package/dist/tools/provider-invoices.js +30 -111
- package/dist/tools/provider-invoices.js.map +1 -1
- package/dist/tools/purchases.d.ts +2 -0
- package/dist/tools/purchases.d.ts.map +1 -1
- package/dist/tools/purchases.js +50 -104
- package/dist/tools/purchases.js.map +1 -1
- package/dist/tools/registration-decorators.d.ts +28 -0
- package/dist/tools/registration-decorators.d.ts.map +1 -1
- package/dist/tools/registration-decorators.js +107 -0
- package/dist/tools/registration-decorators.js.map +1 -1
- package/dist/tools/resources.d.ts.map +1 -1
- package/dist/tools/resources.js +27 -5
- package/dist/tools/resources.js.map +1 -1
- package/dist/tools/rights.d.ts +101 -0
- package/dist/tools/rights.d.ts.map +1 -0
- package/dist/tools/rights.js +75 -0
- package/dist/tools/rights.js.map +1 -0
- package/dist/tools/tab-tools.js +3 -3
- package/dist/tools/tab-tools.js.map +1 -1
- package/dist/tools/timesheets.d.ts +29 -0
- package/dist/tools/timesheets.d.ts.map +1 -1
- package/dist/tools/timesheets.js +196 -126
- package/dist/tools/timesheets.js.map +1 -1
- package/dist/tools/todolists.d.ts +2 -0
- package/dist/tools/todolists.d.ts.map +1 -1
- package/dist/tools/todolists.js +64 -1
- package/dist/tools/todolists.js.map +1 -1
- package/dist/tools/usage-guidance.d.ts.map +1 -1
- package/dist/tools/usage-guidance.js +12 -3
- package/dist/tools/usage-guidance.js.map +1 -1
- package/dist/tools/validations.d.ts +9 -0
- package/dist/tools/validations.d.ts.map +1 -1
- package/dist/tools/validations.js +86 -9
- package/dist/tools/validations.js.map +1 -1
- package/dist/tools/workflows.js +1 -1
- package/dist/tools/workflows.js.map +1 -1
- package/dist/transports/http.d.ts +116 -0
- package/dist/transports/http.d.ts.map +1 -1
- package/dist/transports/http.js +422 -92
- package/dist/transports/http.js.map +1 -1
- package/dist/types.d.ts +3 -3
- package/dist/types.d.ts.map +1 -1
- package/manifest.json +2 -2
- package/package.json +6 -5
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { apiRequest, formatDetailResponse } from "../services/boond-client.js";
|
|
3
|
+
import { EntityIdSchema } from "../schemas/index.js";
|
|
4
|
+
import { isDomainAllowed } from "../config/access-policy.js";
|
|
5
|
+
import { composeDescription } from "./description-builders.js";
|
|
6
|
+
/**
|
|
7
|
+
* `boond_rights_get` (issue #257): what the authenticated user may do on one
|
|
8
|
+
* record, from `GET /{collection}/{id}/rights` — a route the RAML documents on
|
|
9
|
+
* every entity below and that no tool exposed. A 403 avoided is cheaper than a
|
|
10
|
+
* 403 explained: the model can tell the user "vous n'avez pas le droit de
|
|
11
|
+
* supprimer cette facture" before trying.
|
|
12
|
+
*
|
|
13
|
+
* One tool parameterised by entity rather than 25 `*_rights` tabs: the route
|
|
14
|
+
* shape is identical everywhere and the payload is rendered as-is.
|
|
15
|
+
*/
|
|
16
|
+
export const RIGHTS_ENTITIES = {
|
|
17
|
+
candidate: { path: "/candidates", domain: "candidates" },
|
|
18
|
+
resource: { path: "/resources", domain: "resources" },
|
|
19
|
+
contact: { path: "/contacts", domain: "contacts" },
|
|
20
|
+
company: { path: "/companies", domain: "companies" },
|
|
21
|
+
opportunity: { path: "/opportunities", domain: "opportunities" },
|
|
22
|
+
project: { path: "/projects", domain: "projects" },
|
|
23
|
+
action: { path: "/actions", domain: "actions" },
|
|
24
|
+
positioning: { path: "/positionings", domain: "positionings" },
|
|
25
|
+
invoice: { path: "/invoices", domain: "invoices" },
|
|
26
|
+
order: { path: "/orders", domain: "orders" },
|
|
27
|
+
delivery: { path: "/deliveries", domain: "deliveries" },
|
|
28
|
+
purchase: { path: "/purchases", domain: "purchases" },
|
|
29
|
+
payment: { path: "/payments", domain: "payments" },
|
|
30
|
+
providerInvoice: { path: "/provider-invoices", domain: "provider-invoices" },
|
|
31
|
+
product: { path: "/products", domain: "products" },
|
|
32
|
+
contract: { path: "/contracts", domain: "contracts" },
|
|
33
|
+
advantage: { path: "/advantages", domain: "advantages" },
|
|
34
|
+
timesReport: { path: "/times-reports", domain: "timesheets" },
|
|
35
|
+
expensesReport: { path: "/expenses-reports", domain: "expenses" },
|
|
36
|
+
absencesReport: { path: "/absences-reports", domain: "absences" },
|
|
37
|
+
agency: { path: "/agencies", domain: "agencies" },
|
|
38
|
+
};
|
|
39
|
+
const ALL_RIGHTS_ENTITIES = Object.keys(RIGHTS_ENTITIES);
|
|
40
|
+
export function registerRightsTool(server, policy) {
|
|
41
|
+
const entities = ALL_RIGHTS_ENTITIES.filter((e) => !policy || isDomainAllowed(policy, RIGHTS_ENTITIES[e].domain));
|
|
42
|
+
const [first, ...rest] = entities;
|
|
43
|
+
if (first === undefined)
|
|
44
|
+
return;
|
|
45
|
+
const RightsSchema = z
|
|
46
|
+
.object({
|
|
47
|
+
entity: z.enum([first, ...rest]).describe("Type de l'enregistrement."),
|
|
48
|
+
id: EntityIdSchema.describe("ID numérique de l'enregistrement."),
|
|
49
|
+
})
|
|
50
|
+
.strict();
|
|
51
|
+
server.registerTool("boond_rights_get", {
|
|
52
|
+
title: "Droits de l'utilisateur sur un enregistrement",
|
|
53
|
+
description: composeDescription({
|
|
54
|
+
purpose: "Renvoie les droits de l'utilisateur authentifié sur un enregistrement précis (lecture, écriture, suppression, actions du workflow…), tels que BoondManager les publie sur `GET /{entité}/{id}/rights`.",
|
|
55
|
+
when: "avant un `*_update` ou un `*_delete` dont l'issue est incertaine (fiche d'une autre agence, document validé, facture clôturée) — un 403 évité coûte moins qu'un 403 expliqué.",
|
|
56
|
+
instead: "`boond://application/current-user/rights` pour les droits *globaux* par entité (création, périmètre) ; cet outil est le droit sur **un** enregistrement.",
|
|
57
|
+
behaviour: [
|
|
58
|
+
"Lecture seule ; le payload est rendu tel quel — les clés varient selon l'entité (`canWrite`, `canDelete`, `canValidate`…) et n'ont pas été normalisées, la RAML ne les documente pas.",
|
|
59
|
+
"Les entités proposées suivent la politique d'accès du serveur.",
|
|
60
|
+
],
|
|
61
|
+
returns: "JSON des droits sur l'enregistrement.",
|
|
62
|
+
}),
|
|
63
|
+
inputSchema: RightsSchema,
|
|
64
|
+
annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
|
|
65
|
+
}, async (params) => {
|
|
66
|
+
const { entity, id } = params;
|
|
67
|
+
const response = await apiRequest(`${RIGHTS_ENTITIES[entity].path}/${id}/rights`);
|
|
68
|
+
return {
|
|
69
|
+
content: [
|
|
70
|
+
{ type: "text", text: `Droits sur ${entity} #${id} :\n\n${formatDetailResponse(response)}` },
|
|
71
|
+
],
|
|
72
|
+
};
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
//# sourceMappingURL=rights.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rights.js","sourceRoot":"","sources":["../../src/tools/rights.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,UAAU,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAC/E,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,eAAe,EAAqB,MAAM,4BAA4B,CAAC;AAEhF,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAE/D;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,SAAS,EAAE,EAAE,IAAI,EAAE,aAAa,EAAE,MAAM,EAAE,YAAY,EAAE;IACxD,QAAQ,EA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Y,EAAE,IAAI,EAAE,eAAe,EAAE,KAAK,EAAE,cAAc,EAAE,IAAI,EAAE,aAAa,EAAE,KAAK,EAAE;KACxG,EACD,KAAK,EAAE,MAAM,EAAE,EAAE;QACf,MAAM,EAAE,MAAM,EAAE,EAAE,EAAE,GAAG,MAAM,CAAC;QAC9B,MAAM,QAAQ,GAAG,MAAM,UAAU,CAAC,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC,IAAI,IAAI,EAAE,SAAS,CAAC,CAAC;QAClF,OAAO;YACL,OAAO,EAAE;gBACP,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,cAAc,MAAM,KAAK,EAAE,SAAS,oBAAoB,CAAC,QAAQ,CAAC,EAAE,EAAE;aACtG;SACF,CAAC;IACJ,CAAC,CACF,CAAC;AACJ,CAAC"}
|
package/dist/tools/tab-tools.js
CHANGED
|
@@ -2,7 +2,7 @@ import { apiRequest, formatTabResponse } from "../services/boond-client.js";
|
|
|
2
2
|
import { IdSchema } from "../schemas/index.js";
|
|
3
3
|
import { tabDescription } from "./description-builders.js";
|
|
4
4
|
/**
|
|
5
|
-
* The
|
|
5
|
+
* The 48 entity-tab tools (`boond_candidates_technical_data`,
|
|
6
6
|
* `boond_companies_invoices`, …) were six byte-identical registration loops in
|
|
7
7
|
* six domain files, each with its own copy of the `TabDefinition` interface and
|
|
8
8
|
* its own hand-typed description ending in a redundant `Args: - id (string)`
|
|
@@ -30,9 +30,9 @@ export function registerTabTools(server, opts, tabs) {
|
|
|
30
30
|
entityNamePlural: opts.entityNamePlural,
|
|
31
31
|
prefix: opts.prefix,
|
|
32
32
|
subject: tab.subject,
|
|
33
|
-
content: tab.content,
|
|
33
|
+
...(tab.content !== undefined ? { content: tab.content } : {}),
|
|
34
34
|
returns: tab.returns,
|
|
35
|
-
behaviour: tab.behaviour,
|
|
35
|
+
...(tab.behaviour !== undefined ? { behaviour: tab.behaviour } : {}),
|
|
36
36
|
}),
|
|
37
37
|
inputSchema: IdSchema,
|
|
38
38
|
annotations: TAB_TOOL_ANNOTATIONS,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tab-tools.js","sourceRoot":"","sources":["../../src/tools/tab-tools.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAC5E,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAE/C,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAG3D;;;;;;;;;;;;;GAaG;AAEH,MAAM,oBAAoB,GAAG;IAC3B,YAAY,EAAE,IAAI;IAClB,eAAe,EAAE,KAAK;IACtB,cAAc,EAAE,IAAI;IACpB,aAAa,EAAE,KAAK;CACZ,CAAC;AAuBX,MAAM,UAAU,gBAAgB,CAAC,MAAiB,EAAE,IAAqB,EAAE,IAAqB;IAC9F,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;QACvB,MAAM,CAAC,YAAY,CACjB,GAAG,IAAI,CAAC,MAAM,IAAI,GAAG,CAAC,IAAI,EAAE,EAC5B;YACE,KAAK,EAAE,GAAG,CAAC,KAAK;YAChB,WAAW,EAAE,cAAc,CAAC;gBAC1B,UAAU,EAAE,IAAI,CAAC,UAAU;gBAC3B,gBAAgB,EAAE,IAAI,CAAC,gBAAgB;gBACvC,MAAM,EAAE,IAAI,CAAC,MAAM;gBACnB,OAAO,EAAE,GAAG,CAAC,OAAO;gBACpB,OAAO,EAAE,GAAG,CAAC,OAAO;
|
|
1
|
+
{"version":3,"file":"tab-tools.js","sourceRoot":"","sources":["../../src/tools/tab-tools.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAC5E,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAE/C,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAG3D;;;;;;;;;;;;;GAaG;AAEH,M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EAAE,IAAI,EAAE,CAAC;aAC3C,CAAC;QACJ,CAAC,CACF,CAAC;IACJ,CAAC;AACH,CAAC"}
|
|
@@ -1,3 +1,32 @@
|
|
|
1
1
|
import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
2
|
+
import type { TimesheetLineInput } from "../schemas/index.js";
|
|
3
|
+
import type { JsonApiResource, JsonApiResponse } from "../types.js";
|
|
4
|
+
/**
|
|
5
|
+
* One CRA line, as the API stores it: nested `workUnitType`, `project`,
|
|
6
|
+
* `delivery`, `batch` objects around the flat ids the schema takes. A missing
|
|
7
|
+
* project / delivery / batch is sent as `null`, which is how the API itself
|
|
8
|
+
* represents an absence line (`GET /times-reports/{id}` → `"project": null`).
|
|
9
|
+
*/
|
|
10
|
+
export declare function buildTimeLine(line: TimesheetLineInput): Record<string, unknown>;
|
|
11
|
+
/** Build the `/times-reports` payload: convenience ids → relationships, lines → nested objects. */
|
|
12
|
+
export declare function buildTimesheetBody(params: Record<string, unknown>): unknown;
|
|
13
|
+
/**
|
|
14
|
+
* Render `/times-reports/default` down to what a caller needs to write lines.
|
|
15
|
+
*
|
|
16
|
+
* The response is the only place the work-unit-type codes are published — on
|
|
17
|
+
* the included **resource** (`workUnitTypesAllowed`), not on the agency and not
|
|
18
|
+
* in `/application/dictionary` — together with the (project, delivery) pairs
|
|
19
|
+
* chargeable that month and the `plannedTimes` derived from the deliveries'
|
|
20
|
+
* planning, which are the lines a filled CRA usually repeats.
|
|
21
|
+
*/
|
|
22
|
+
export declare function formatTimesheetDefaults(response: JsonApiResponse): string;
|
|
23
|
+
/**
|
|
24
|
+
* One line per times report. The rows carry no name / title, so the generic
|
|
25
|
+
* summary would print a bare `[timesreport #id]`; this names the window, the
|
|
26
|
+
* state and the totals instead. Truncation, the `shown/total` banner and the
|
|
27
|
+
* `fields` projection come from `formatListResponse` (#243) — this file used
|
|
28
|
+
* to carry its own formatter that cut mid-line and crashed on `data: null`.
|
|
29
|
+
*/
|
|
30
|
+
export declare function timesheetSummary(item: JsonApiResource): string;
|
|
2
31
|
export declare function registerTimesheetTools(server: McpServer): void;
|
|
3
32
|
//# sourceMappingURL=timesheets.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"timesheets.d.ts","sourceRoot":"","sources":["../../src/tools/timesheets.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;
|
|
1
|
+
{"version":3,"file":"timesheets.d.ts","sourceRoot":"","sources":["../../src/tools/timesheets.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAQzE,OAAO,KAAK,EAAiD,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAS7G,OAAO,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAGpE;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,kBAAkB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAS/E;AAED,mGAAmG;AACnG,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAW3E;AAgBD;;;;;;;;GAQG;AACH,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,eAAe,GAAG,MAAM,CAqFzE;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,eAAe,GAAG,MAAM,CAY9D;AASD,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CAiH9D"}
|
package/dist/tools/timesheets.js
CHANGED
|
@@ -1,105 +1,209 @@
|
|
|
1
|
-
import { ResourceTimesheetSchema, TimesheetSearchSchema,
|
|
2
|
-
import { apiRequest,
|
|
3
|
-
import {
|
|
4
|
-
import { buildJsonApiBody } from "./crud-factory.js";
|
|
5
|
-
import { CHARACTER_LIMIT } from "../constants.js";
|
|
6
|
-
import { z } from "zod";
|
|
1
|
+
import { ResourceTimesheetSchema, TimesheetCreateSchema, TimesheetDefaultSchema, TimesheetSearchSchema, TimesheetUpdateSchema, } from "../schemas/index.js";
|
|
2
|
+
import { apiRequest, formatListResponse } from "../services/boond-client.js";
|
|
3
|
+
import { buildJsonApiBody, registerCreateTool, registerGetTool, registerSearchTool, registerUpdateTool, } from "./crud-factory.js";
|
|
7
4
|
import { composeDescription } from "./description-builders.js";
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
5
|
+
/**
|
|
6
|
+
* One CRA line, as the API stores it: nested `workUnitType`, `project`,
|
|
7
|
+
* `delivery`, `batch` objects around the flat ids the schema takes. A missing
|
|
8
|
+
* project / delivery / batch is sent as `null`, which is how the API itself
|
|
9
|
+
* represents an absence line (`GET /times-reports/{id}` → `"project": null`).
|
|
10
|
+
*/
|
|
11
|
+
export function buildTimeLine(line) {
|
|
12
|
+
const { workUnitTypeReference, projectId, deliveryId, batchId, ...rest } = line;
|
|
13
|
+
return {
|
|
14
|
+
...Object.fromEntries(Object.entries(rest).filter(([, v]) => v !== undefined)),
|
|
15
|
+
workUnitType: { reference: workUnitTypeReference },
|
|
16
|
+
project: projectId === undefined ? null : { id: projectId },
|
|
17
|
+
delivery: deliveryId === undefined ? null : { id: deliveryId },
|
|
18
|
+
batch: batchId === undefined ? null : { id: batchId },
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
/** Build the `/times-reports` payload: convenience ids → relationships, lines → nested objects. */
|
|
22
|
+
export function buildTimesheetBody(params) {
|
|
23
|
+
const { id, resourceId, agencyId, regularTimes, exceptionalTimes, ...attrs } = params;
|
|
24
|
+
const attributes = { ...attrs };
|
|
25
|
+
if (regularTimes !== undefined)
|
|
26
|
+
attributes.regularTimes = regularTimes.map(buildTimeLine);
|
|
27
|
+
if (exceptionalTimes !== undefined) {
|
|
28
|
+
attributes.exceptionalTimes = exceptionalTimes.map(buildTimeLine);
|
|
28
29
|
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
if (attrs.startDate)
|
|
33
|
-
parts.push(`Du: ${attrs.startDate}`);
|
|
34
|
-
if (attrs.endDate)
|
|
35
|
-
parts.push(`Au: ${attrs.endDate}`);
|
|
36
|
-
if (attrs.state !== undefined)
|
|
37
|
-
parts.push(`Statut: ${attrs.state}`);
|
|
38
|
-
if (attrs.totalDays !== undefined)
|
|
39
|
-
parts.push(`Jours: ${attrs.totalDays}`);
|
|
40
|
-
if (attrs.totalHours !== undefined)
|
|
41
|
-
parts.push(`Heures: ${attrs.totalHours}`);
|
|
42
|
-
return parts.join(" | ");
|
|
30
|
+
return buildJsonApiBody("timesreport", attributes, id, {
|
|
31
|
+
resource: resourceId ? { id: String(resourceId), type: "resource" } : undefined,
|
|
32
|
+
agency: agencyId ? { id: String(agencyId), type: "agency" } : undefined,
|
|
43
33
|
});
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Render `/times-reports/default` down to what a caller needs to write lines.
|
|
37
|
+
*
|
|
38
|
+
* The response is the only place the work-unit-type codes are published — on
|
|
39
|
+
* the included **resource** (`workUnitTypesAllowed`), not on the agency and not
|
|
40
|
+
* in `/application/dictionary` — together with the (project, delivery) pairs
|
|
41
|
+
* chargeable that month and the `plannedTimes` derived from the deliveries'
|
|
42
|
+
* planning, which are the lines a filled CRA usually repeats.
|
|
43
|
+
*/
|
|
44
|
+
export function formatTimesheetDefaults(response) {
|
|
45
|
+
const entity = Array.isArray(response.data) ? response.data[0] : response.data;
|
|
46
|
+
if (!entity)
|
|
47
|
+
return "Aucune donnée par défaut retournée pour cette ressource / ce mois.";
|
|
48
|
+
const attrs = entity.attributes ?? {};
|
|
49
|
+
const included = response.included ?? [];
|
|
50
|
+
const byType = (type) => included.filter((i) => i.type === type);
|
|
51
|
+
const resourceRef = entity.relationships?.resource?.data;
|
|
52
|
+
const agencyRef = entity.relationships?.agency?.data;
|
|
53
|
+
const resource = byType("resource").find((r) => r.id === resourceRef?.id) ?? byType("resource")[0];
|
|
54
|
+
const agency = byType("agency").find((a) => a.id === agencyRef?.id) ?? byType("agency")[0];
|
|
55
|
+
const resourceAttrs = resource?.attributes ?? {};
|
|
56
|
+
const agencyAttrs = agency?.attributes ?? {};
|
|
57
|
+
const lines = [
|
|
58
|
+
`CRA — ressource #${resource?.id ?? resourceRef?.id ?? "?"}${resourceAttrs.firstName || resourceAttrs.lastName ? ` (${[resourceAttrs.firstName, resourceAttrs.lastName].filter(Boolean).join(" ")})` : ""}, mois ${String(attrs.term ?? "?")}`,
|
|
59
|
+
`Agence: #${agency?.id ?? "?"}${agencyAttrs.name ? ` (${String(agencyAttrs.name)})` : ""} | Unité d'œuvre: ${String(attrs.workUnitRate ?? agencyAttrs.workUnitRate ?? "?")} | Calendrier: ${String(agencyAttrs.calendar ?? "?")}`,
|
|
60
|
+
];
|
|
61
|
+
const types = resourceAttrs.workUnitTypesAllowed ?? [];
|
|
62
|
+
lines.push("", `Types d'unité d'œuvre autorisés (${types.length}) — utiliser \`reference\` comme \`workUnitTypeReference\` :`);
|
|
63
|
+
lines.push(...(types.length
|
|
64
|
+
? types.map((t) => ` reference=${t.reference} | ${t.name ?? ""} | ${t.activityType ?? ""}`)
|
|
65
|
+
: [" (aucun type publié pour cette ressource)"]));
|
|
66
|
+
const projects = byType("project");
|
|
67
|
+
lines.push("", `Imputations possibles (${projects.length}) — \`projectId\` / \`deliveryId\` :`);
|
|
68
|
+
if (projects.length === 0) {
|
|
69
|
+
lines.push(" (aucune imputation disponible pour cette ressource sur ce mois — seules des absences peuvent être saisies)");
|
|
70
|
+
}
|
|
71
|
+
else {
|
|
72
|
+
for (const p of projects) {
|
|
73
|
+
const ref = p.attributes?.reference ?? p.attributes?.title ?? "";
|
|
74
|
+
const refs = (name) => (p.relationships?.[name]?.data ?? []).map((d) => `#${d.id}`);
|
|
75
|
+
const deliveryIds = refs("deliveries");
|
|
76
|
+
const batchIds = refs("batches");
|
|
77
|
+
const parts = [
|
|
78
|
+
` projectId=${p.id}`,
|
|
79
|
+
String(ref),
|
|
80
|
+
`deliveryId ∈ ${deliveryIds.length ? deliveryIds.join(", ") : "(aucune prestation — imputation impossible)"}`,
|
|
81
|
+
];
|
|
82
|
+
if (batchIds.length)
|
|
83
|
+
parts.push(`batchId ∈ ${batchIds.join(", ")}`);
|
|
84
|
+
lines.push(parts.join(" | "));
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
const planned = attrs.plannedTimes ?? [];
|
|
88
|
+
const totalPlanned = planned.reduce((n, t) => n + (Number(t.duration) || 0), 0);
|
|
89
|
+
lines.push("", `Planning prévu (${planned.length} ligne(s), ${totalPlanned} unité(s)) — base de saisie à confirmer jour par jour :`);
|
|
90
|
+
if (planned.length === 0) {
|
|
91
|
+
lines.push(" (aucune ligne planifiée)");
|
|
92
|
+
}
|
|
93
|
+
else {
|
|
94
|
+
const byKey = new Map();
|
|
95
|
+
for (const t of planned) {
|
|
96
|
+
const key = `projectId=${t.project?.id ?? "-"} | deliveryId=${t.delivery?.id ?? "-"} | workUnitTypeReference=${t.workUnitType?.reference ?? "-"} (${t.workUnitType?.name ?? ""})`;
|
|
97
|
+
const day = t.startDate ?? "";
|
|
98
|
+
const cur = byKey.get(key) ?? { count: 0, duration: 0, first: day, last: day };
|
|
99
|
+
cur.count += 1;
|
|
100
|
+
cur.duration += Number(t.duration) || 0;
|
|
101
|
+
if (day && (cur.first === "" || day < cur.first))
|
|
102
|
+
cur.first = day;
|
|
103
|
+
if (day && day > cur.last)
|
|
104
|
+
cur.last = day;
|
|
105
|
+
byKey.set(key, cur);
|
|
106
|
+
}
|
|
107
|
+
for (const [key, v] of byKey)
|
|
108
|
+
lines.push(` ${key} : ${v.count} jour(s), ${v.duration} unité(s), du ${v.first} au ${v.last}`);
|
|
48
109
|
}
|
|
49
|
-
|
|
50
|
-
|
|
110
|
+
const absences = attrs.absencesTimes ?? [];
|
|
111
|
+
if (absences.length) {
|
|
112
|
+
lines.push("", `Absences déjà posées sur le mois (${absences.length}) — ne pas les ressaisir :`);
|
|
113
|
+
for (const t of absences)
|
|
114
|
+
lines.push(` ${t.startDate ?? "?"} | ${t.duration ?? "?"} | ${t.workUnitType?.name ?? ""} (reference=${t.workUnitType?.reference ?? "?"})`);
|
|
51
115
|
}
|
|
52
|
-
return
|
|
116
|
+
return lines.join("\n");
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* One line per times report. The rows carry no name / title, so the generic
|
|
120
|
+
* summary would print a bare `[timesreport #id]`; this names the window, the
|
|
121
|
+
* state and the totals instead. Truncation, the `shown/total` banner and the
|
|
122
|
+
* `fields` projection come from `formatListResponse` (#243) — this file used
|
|
123
|
+
* to carry its own formatter that cut mid-line and crashed on `data: null`.
|
|
124
|
+
*/
|
|
125
|
+
export function timesheetSummary(item) {
|
|
126
|
+
const attrs = item.attributes ?? {};
|
|
127
|
+
const parts = [`[timesreport #${item.id}]`];
|
|
128
|
+
if (attrs.term)
|
|
129
|
+
parts.push(`Mois: ${attrs.term}`);
|
|
130
|
+
if (attrs.startDate)
|
|
131
|
+
parts.push(`Du: ${attrs.startDate}`);
|
|
132
|
+
if (attrs.endDate)
|
|
133
|
+
parts.push(`Au: ${attrs.endDate}`);
|
|
134
|
+
if (attrs.state !== undefined)
|
|
135
|
+
parts.push(`Statut: ${attrs.state}`);
|
|
136
|
+
if (attrs.totalDays !== undefined)
|
|
137
|
+
parts.push(`Jours: ${attrs.totalDays}`);
|
|
138
|
+
if (attrs.totalHours !== undefined)
|
|
139
|
+
parts.push(`Heures: ${attrs.totalHours}`);
|
|
140
|
+
return parts.join(" | ");
|
|
53
141
|
}
|
|
142
|
+
const OPTS = {
|
|
143
|
+
entityName: "feuille de temps",
|
|
144
|
+
entityNamePlural: "feuilles de temps",
|
|
145
|
+
apiPath: "/times-reports",
|
|
146
|
+
prefix: "boond_timesheets",
|
|
147
|
+
};
|
|
54
148
|
export function registerTimesheetTools(server) {
|
|
55
|
-
server.registerTool("
|
|
56
|
-
title: "
|
|
149
|
+
server.registerTool("boond_timesheets_default", {
|
|
150
|
+
title: "Référentiels de saisie d'un CRA",
|
|
57
151
|
description: composeDescription({
|
|
58
|
-
purpose: "
|
|
59
|
-
when: "
|
|
60
|
-
instead: "
|
|
152
|
+
purpose: "Renvoie ce qu'il faut savoir avant d'écrire le CRA d'une ressource sur un mois : types d'unité d'œuvre autorisés, couples projet/prestation imputables, planning prévu et absences déjà posées.",
|
|
153
|
+
when: "AVANT `boond_timesheets_create` / `boond_timesheets_update` — les codes `workUnitTypeReference` ne sont publiés nulle part ailleurs (ni dans `boond_application_dictionary`, ni sur `boond_agencies_get`).",
|
|
154
|
+
instead: "aucun autre outil ne donne ces codes ; `boond_timesheets_get` pour relire un CRA existant.",
|
|
61
155
|
behaviour: [
|
|
62
|
-
"`
|
|
63
|
-
"
|
|
156
|
+
"Lecture seule (`GET /times-reports/default`). La réponse brute est réduite : les types viennent de la ressource incluse (`workUnitTypesAllowed`), les imputations des projets inclus, le planning de `plannedTimes`.",
|
|
157
|
+
"Une ressource sans imputation ce mois-là ne peut saisir que des absences.",
|
|
64
158
|
],
|
|
65
|
-
returns: "
|
|
159
|
+
returns: "texte : agence, types d'unité d'œuvre (reference | libellé | activityType), imputations `projectId` / `deliveryId` (et `batchId`), planning prévu agrégé par imputation, absences déjà posées.",
|
|
66
160
|
}),
|
|
67
|
-
inputSchema:
|
|
161
|
+
inputSchema: TimesheetDefaultSchema,
|
|
68
162
|
annotations: {
|
|
69
|
-
readOnlyHint:
|
|
163
|
+
readOnlyHint: true,
|
|
70
164
|
destructiveHint: false,
|
|
71
|
-
idempotentHint:
|
|
165
|
+
idempotentHint: true,
|
|
72
166
|
openWorldHint: false,
|
|
73
167
|
},
|
|
74
168
|
}, async (params) => {
|
|
75
|
-
const { resourceId,
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
169
|
+
const query = { resource: params.resourceId, term: params.term };
|
|
170
|
+
if (params.agencyId)
|
|
171
|
+
query.agency = params.agencyId;
|
|
172
|
+
const response = await apiRequest("/times-reports/default", "GET", undefined, query);
|
|
173
|
+
return { content: [{ type: "text", text: formatTimesheetDefaults(response) }] };
|
|
174
|
+
});
|
|
175
|
+
registerCreateTool(server, OPTS, TimesheetCreateSchema, buildTimesheetBody, {
|
|
176
|
+
title: "Créer une feuille de temps",
|
|
177
|
+
description: composeDescription({
|
|
178
|
+
purpose: "Crée la feuille de temps (CRA) d'un mois pour une ressource, avec ses lignes jour par jour.",
|
|
179
|
+
when: "pour ouvrir le CRA d'un couple (ressource, mois) qui n'existe pas encore, après `boond_timesheets_default`.",
|
|
180
|
+
instead: "`boond_timesheets_search` (`startMonth`/`endMonth` + `resourceId`) d'abord : l'API ne déduplique pas, deux CRA peuvent coexister sur le même mois ; `boond_timesheets_update` si le CRA existe déjà.",
|
|
181
|
+
behaviour: [
|
|
182
|
+
"Un CRA est un conteneur mensuel (`term` + `resource`) ; les lignes vont dans `regularTimes[]` (production et absences) et `exceptionalTimes[]` — chaque ligne = un jour, une durée, un type d'unité d'œuvre, et pour la production un couple `projectId` / `deliveryId` imputable.",
|
|
183
|
+
"`state` n'est pas un champ d'écriture : il est piloté par le workflow de validation (`boond_validations_search`).",
|
|
184
|
+
"Écriture non idempotente. Modèle d'écriture établi en lecture depuis l'API (forme des CRA existants et de `/times-reports/default`), pas encore éprouvé en écriture sur un tenant de test — voir CLAUDE.md.",
|
|
91
185
|
],
|
|
92
|
-
|
|
186
|
+
returns: "confirmation, ID créé (`structuredContent.id`) et fiche du CRA.",
|
|
187
|
+
}),
|
|
188
|
+
});
|
|
189
|
+
registerUpdateTool(server, OPTS, TimesheetUpdateSchema, buildTimesheetBody, {
|
|
190
|
+
method: "PUT",
|
|
191
|
+
title: "Modifier une feuille de temps",
|
|
192
|
+
description: composeDescription({
|
|
193
|
+
purpose: "Met à jour un CRA existant : commentaires, clôture, ou remplacement complet de ses lignes.",
|
|
194
|
+
when: "pour compléter ou corriger le CRA d'un mois déjà ouvert (trouvé via `boond_timesheets_search`).",
|
|
195
|
+
instead: "`boond_timesheets_create` si aucun CRA n'existe encore pour ce couple (ressource, mois).",
|
|
196
|
+
behaviour: [
|
|
197
|
+
"Mise à jour partielle sur les champs simples, MAIS `regularTimes` / `exceptionalTimes` **remplacent le tableau entier** : relire le CRA (`boond_timesheets_get`), fusionner, renvoyer la liste complète — envoyer une seule ligne efface le mois.",
|
|
198
|
+
"`state` n'est pas un champ d'écriture (workflow de validation).",
|
|
199
|
+
],
|
|
200
|
+
returns: "confirmation et fiche du CRA mis à jour.",
|
|
201
|
+
}),
|
|
93
202
|
});
|
|
94
203
|
// Get timesheets for a specific resource
|
|
95
204
|
server.registerTool("boond_resources_timesheets", {
|
|
96
205
|
title: "Feuilles de temps d'une ressource",
|
|
97
|
-
description: `Récupère les feuilles de temps (times reports) d'une ressource par son ID, avec filtre optionnel par mois/année.
|
|
98
|
-
|
|
99
|
-
Args:
|
|
100
|
-
- resourceId (string): ID de la ressource
|
|
101
|
-
- month (number, optional): Mois (1-12), défaut: mois courant
|
|
102
|
-
- year (number, optional): Année (ex: 2025), défaut: année courante
|
|
206
|
+
description: `Récupère les feuilles de temps (times reports) d'une ressource par son ID, avec filtre optionnel par mois/année (défaut : mois courant).
|
|
103
207
|
|
|
104
208
|
Returns: Liste des feuilles de temps de la ressource avec jours/heures et statut.`,
|
|
105
209
|
inputSchema: ResourceTimesheetSchema,
|
|
@@ -116,63 +220,29 @@ Returns: Liste des feuilles de temps de la ressource avec jours/heures et statut
|
|
|
116
220
|
if (params.year !== undefined)
|
|
117
221
|
queryParams["year"] = params.year;
|
|
118
222
|
const response = await apiRequest(`/resources/${params.resourceId}/times-reports`, "GET", undefined, queryParams);
|
|
119
|
-
const text =
|
|
223
|
+
const text = formatListResponse(response, "feuille de temps", undefined, timesheetSummary);
|
|
120
224
|
return {
|
|
121
225
|
content: [{ type: "text", text }],
|
|
122
226
|
};
|
|
123
227
|
});
|
|
124
|
-
// Search all timesheets
|
|
125
|
-
|
|
228
|
+
// Search all timesheets — the factory hands `timesheetSummary` to the list
|
|
229
|
+
// formatter and to `structuredContent` alike (#243).
|
|
230
|
+
registerSearchTool(server, OPTS, {
|
|
231
|
+
schema: TimesheetSearchSchema,
|
|
232
|
+
summaryFn: timesheetSummary,
|
|
126
233
|
title: "Rechercher des feuilles de temps",
|
|
127
|
-
description: `Recherche des feuilles de temps (CRA mensuels) dans BoondManager.
|
|
234
|
+
description: `Recherche des feuilles de temps (CRA mensuels) dans BoondManager, par mois, ressource, état de validation (\`validationStates\` : waitingForValidation / validated / rejected) et périmètre (\`perimeter*\`).
|
|
128
235
|
|
|
129
236
|
⚠️ \`startMonth\` et \`endMonth\` (format YYYY-MM) sont requis par l'API — passer YYYY-MM-DD ou les omettre renvoie un 422.
|
|
130
237
|
|
|
131
|
-
|
|
132
|
-
- startMonth (string, requis): Mois de début YYYY-MM (ex: '2025-01')
|
|
133
|
-
- endMonth (string, requis): Mois de fin YYYY-MM (ex: '2025-03')
|
|
134
|
-
- keywords (string, optional): Mots-clés
|
|
135
|
-
- page (number): Numéro de page (défaut: 1)
|
|
136
|
-
- pageSize (number): Résultats par page (défaut: 30)
|
|
137
|
-
|
|
138
|
-
Returns: Liste des feuilles de temps correspondantes.`,
|
|
139
|
-
inputSchema: TimesheetSearchSchema,
|
|
140
|
-
annotations: {
|
|
141
|
-
readOnlyHint: true,
|
|
142
|
-
destructiveHint: false,
|
|
143
|
-
idempotentHint: true,
|
|
144
|
-
openWorldHint: true,
|
|
145
|
-
},
|
|
146
|
-
}, async (params, extra) => {
|
|
147
|
-
const query = buildSearchQuery(params);
|
|
148
|
-
const response = await apiSearch("/times-reports", query, progressReporterFrom(extra));
|
|
149
|
-
const text = formatTimesheetSummary(response);
|
|
150
|
-
return {
|
|
151
|
-
content: [{ type: "text", text }],
|
|
152
|
-
};
|
|
238
|
+
Returns: Liste des feuilles de temps correspondantes (une ligne par CRA : mois, période, statut, totaux).`,
|
|
153
239
|
});
|
|
154
|
-
|
|
155
|
-
|
|
240
|
+
registerGetTool(server, OPTS, {
|
|
241
|
+
withTab: false,
|
|
156
242
|
title: "Détails d'une feuille de temps",
|
|
157
|
-
description: `Récupère les informations détaillées d'une feuille de temps par son ID.
|
|
158
|
-
|
|
159
|
-
Args:
|
|
160
|
-
- id (string): Identifiant unique de la feuille de temps
|
|
243
|
+
description: `Récupère les informations détaillées d'une feuille de temps (CRA mensuel) par son ID.
|
|
161
244
|
|
|
162
245
|
Returns: Données JSON complètes de la feuille de temps (jours, heures, statut, détails).`,
|
|
163
|
-
inputSchema: TimesheetGetSchema,
|
|
164
|
-
annotations: {
|
|
165
|
-
readOnlyHint: true,
|
|
166
|
-
destructiveHint: false,
|
|
167
|
-
idempotentHint: true,
|
|
168
|
-
openWorldHint: false,
|
|
169
|
-
},
|
|
170
|
-
}, async (params) => {
|
|
171
|
-
const response = await apiRequest(`/times-reports/${params.id}`);
|
|
172
|
-
const text = formatDetailResponse(response);
|
|
173
|
-
return {
|
|
174
|
-
content: [{ type: "text", text }],
|
|
175
|
-
};
|
|
176
246
|
});
|
|
177
247
|
}
|
|
178
248
|
//# sourceMappingURL=timesheets.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"timesheets.js","sourceRoot":"","sources":["../../src/tools/timesheets.ts"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{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CAAC,cAAc,MAAM,CAAC,UAAU,gBAAgB,EAAE,KAAK,EAAE,SAAS,EAAE,WAAW,CAAC,CAAC;QAClH,MAAM,IAAI,GAAG,kBAAkB,CAAC,QAAQ,EAAE,kBAAkB,EAAE,SAAS,EAAE,gBAAgB,CAAC,CAAC;QAC3F,OAAO;YACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,CAAC;SAC3C,CAAC;IACJ,CAAC,CACF,CAAC;IAEF,2EAA2E;IAC3E,qDAAqD;IACrD,kBAAkB,CAAC,MAAM,EAAE,IAAI,EAAE;QAC/B,MAAM,EAAE,qBAAqB;QAC7B,SAAS,EAAE,gBAAgB;QAC3B,KAAK,EAAE,kCAAkC;QACzC,WAAW,EAAE;;;;0GAIyF;KACvG,CAAC,CAAC;IAEH,eAAe,CAAC,MAAM,EAAE,IAAI,EAAE;QAC5B,OAAO,EAAE,KAAK;QACd,KAAK,EAAE,gCAAgC;QACvC,WAAW,EAAE;;yFAEwE;KACtF,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
2
|
+
/** `/todolists` payload (issue #254): `agencyIds` → `agencies` relationship, the rest as attributes (`models.todolist`). */
|
|
3
|
+
export declare function buildTodolistBody(params: Record<string, unknown>): unknown;
|
|
2
4
|
export declare function registerTodolistTools(server: McpServer): void;
|
|
3
5
|
//# sourceMappingURL=todolists.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"todolists.d.ts","sourceRoot":"","sources":["../../src/tools/todolists.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;
|
|
1
|
+
{"version":3,"file":"todolists.d.ts","sourceRoot":"","sources":["../../src/tools/todolists.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAiCzE,4HAA4H;AAC5H,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAO1E;AAED,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CA6C7D"}
|