@t4dhg/mcp-factorial 10.0.0 → 10.2.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 +46 -28
- package/dist/api/documents.js +11 -11
- package/dist/api/documents.js.map +1 -1
- package/dist/api/index.d.ts +1 -1
- package/dist/api/index.d.ts.map +1 -1
- package/dist/api/index.js +1 -1
- package/dist/api/index.js.map +1 -1
- package/dist/api/time-off.d.ts +6 -0
- package/dist/api/time-off.d.ts.map +1 -1
- package/dist/api/time-off.js +16 -5
- package/dist/api/time-off.js.map +1 -1
- package/dist/attendance/backfill.d.ts +10 -2
- package/dist/attendance/backfill.d.ts.map +1 -1
- package/dist/attendance/backfill.js +24 -6
- package/dist/attendance/backfill.js.map +1 -1
- package/dist/attendance/gate.js +1 -1
- package/dist/attendance/gate.js.map +1 -1
- package/dist/attendance/planner.d.ts +72 -2
- package/dist/attendance/planner.d.ts.map +1 -1
- package/dist/attendance/planner.js +174 -6
- package/dist/attendance/planner.js.map +1 -1
- package/dist/attendance/report.d.ts +36 -0
- package/dist/attendance/report.d.ts.map +1 -0
- package/dist/attendance/report.js +62 -0
- package/dist/attendance/report.js.map +1 -0
- package/dist/confirmation.d.ts.map +1 -1
- package/dist/confirmation.js +3 -2
- package/dist/confirmation.js.map +1 -1
- package/dist/http-client.d.ts +45 -1
- package/dist/http-client.d.ts.map +1 -1
- package/dist/http-client.js +47 -3
- package/dist/http-client.js.map +1 -1
- package/dist/prompts/attendance.d.ts +38 -0
- package/dist/prompts/attendance.d.ts.map +1 -0
- package/dist/prompts/attendance.js +366 -0
- package/dist/prompts/attendance.js.map +1 -0
- package/dist/tools/attendance.d.ts.map +1 -1
- package/dist/tools/attendance.js +89 -18
- package/dist/tools/attendance.js.map +1 -1
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +4 -1
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/shared.d.ts +1 -1
- package/dist/tools/shared.d.ts.map +1 -1
- package/dist/tools/shared.js +1 -0
- package/dist/tools/shared.js.map +1 -1
- package/llms.txt +5 -2
- package/package.json +1 -1
package/dist/http-client.d.ts
CHANGED
|
@@ -56,12 +56,41 @@ export declare function factorialRequest<T>(endpoint: string, options?: WriteReq
|
|
|
56
56
|
export interface ApiResponse<T> {
|
|
57
57
|
data: T;
|
|
58
58
|
}
|
|
59
|
+
/**
|
|
60
|
+
* Pagination block Factorial attaches to every list response. Verified live on
|
|
61
|
+
* 2026-09-06 on API 2026-07-01: `has_next_page`, `has_previous_page`, `total`
|
|
62
|
+
* and `limit` are always present; the first page also carries `start_cursor`
|
|
63
|
+
* and `end_cursor`; endpoints that return everything at once (shifts) say
|
|
64
|
+
* `paginateable: false` with `limit: null`. There is no `current_page` or
|
|
65
|
+
* `total_pages`.
|
|
66
|
+
*/
|
|
67
|
+
export interface ApiListMeta {
|
|
68
|
+
has_next_page?: boolean;
|
|
69
|
+
has_previous_page?: boolean;
|
|
70
|
+
total?: number;
|
|
71
|
+
limit?: number | null;
|
|
72
|
+
paginateable?: boolean;
|
|
73
|
+
start_cursor?: string;
|
|
74
|
+
end_cursor?: string;
|
|
75
|
+
}
|
|
59
76
|
/**
|
|
60
77
|
* Wrapper type for list API responses
|
|
61
78
|
*/
|
|
62
79
|
export interface ApiListResponse<T> {
|
|
63
80
|
data: T[];
|
|
81
|
+
meta?: ApiListMeta;
|
|
82
|
+
}
|
|
83
|
+
/** One page of a list endpoint, with the pagination block the API sent */
|
|
84
|
+
export interface ApiPage<T> {
|
|
85
|
+
data: T[];
|
|
86
|
+
meta?: ApiListMeta;
|
|
64
87
|
}
|
|
88
|
+
/**
|
|
89
|
+
* Safety cap on the exhaustive read. At 100 items a page this is 100,000
|
|
90
|
+
* records, far beyond any real query this server makes; it exists so that an
|
|
91
|
+
* endpoint that never turns `has_next_page` off cannot spin forever.
|
|
92
|
+
*/
|
|
93
|
+
export declare const MAX_LIST_PAGES = 1000;
|
|
65
94
|
/**
|
|
66
95
|
* Extract a single record from a response.
|
|
67
96
|
*
|
|
@@ -78,7 +107,22 @@ export declare function unwrapRecord<T>(response: unknown): T;
|
|
|
78
107
|
*/
|
|
79
108
|
export declare function fetchOne<T>(endpoint: string, options?: RequestOptions): Promise<T>;
|
|
80
109
|
/**
|
|
81
|
-
*
|
|
110
|
+
* Read exactly one page of a list endpoint and return it with its meta.
|
|
111
|
+
* This is for user-facing pagers that expose page and limit to the caller.
|
|
112
|
+
* Anything that needs the whole result set must use fetchList.
|
|
113
|
+
*/
|
|
114
|
+
export declare function fetchPage<T>(endpoint: string, options?: RequestOptions): Promise<ApiPage<T>>;
|
|
115
|
+
/**
|
|
116
|
+
* Read a list endpoint exhaustively.
|
|
117
|
+
*
|
|
118
|
+
* Factorial pages list endpoints at 100 items by default and reports the
|
|
119
|
+
* remainder in `meta.has_next_page`, so a single request silently truncates
|
|
120
|
+
* anything longer than a page: a 249-day window of estimated_times came back
|
|
121
|
+
* as the first 100 days and nothing else (found 2026-09-06). This follows
|
|
122
|
+
* `has_next_page` until it is false. Filters in `options.params` travel with
|
|
123
|
+
* every page; a caller-supplied `page` is where the read starts and a
|
|
124
|
+
* caller-supplied `limit` is kept. A response without `meta` is taken as
|
|
125
|
+
* complete, which is what endpoints marked `paginateable: false` also say.
|
|
82
126
|
*/
|
|
83
127
|
export declare function fetchList<T>(endpoint: string, options?: RequestOptions): Promise<T[]>;
|
|
84
128
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http-client.d.ts","sourceRoot":"","sources":["../src/http-client.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAkBH;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,KAAK,GAAG,MAAM,GAAG,KAAK,GAAG,OAAO,GAAG,QAAQ,CAAC;AAErE;;GAEG;AACH,+EAA+E;AAC/E,MAAM,MAAM,eAAe,GACvB,MAAM,GACN,MAAM,GACN,OAAO,GACP,SAAS,GACT,KAAK,CAAC,MAAM,GAAG,MAAM,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EAAE,IAAI,CAAC,mBAAmB,EAAE,QAAQ,GAAG,MAAM,CAAC,GACrD,OAAO,CAAC,CAAC,CAAC,CAOZ;AAED;;GAEG;AACH,wBAAsB,QAAQ,CAAC,CAAC,EAC9B,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,OAAO,CAAC,EAAE,IAAI,CAAC,mBAAmB,EAAE,QAAQ,GAAG,MAAM,CAAC,GACrD,OAAO,CAAC,CAAC,CAAC,CAOZ;AAED;;GAEG;AACH,wBAAsB,SAAS,CAC7B,QAAQ,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE,IAAI,CAAC,mBAAmB,EAAE,QAAQ,GAAG,MAAM,CAAC,GACrD,OAAO,CAAC,IAAI,CAAC,CAKf;AAED;;;GAGG;AACH,wBAAsB,UAAU,CAAC,CAAC,EAChC,QAAQ,EAAE,MAAM,EAChB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC9B,OAAO,CAAC,EAAE,IAAI,CAAC,mBAAmB,EAAE,QAAQ,GAAG,MAAM,CAAC,GACrD,OAAO,CAAC,CAAC,CAAC,CAOZ"}
|
package/dist/http-client.js
CHANGED
|
@@ -207,6 +207,12 @@ export async function factorialRequest(endpoint, options = {}) {
|
|
|
207
207
|
}
|
|
208
208
|
throw lastError ?? new NetworkError('Request failed after all retries');
|
|
209
209
|
}
|
|
210
|
+
/**
|
|
211
|
+
* Safety cap on the exhaustive read. At 100 items a page this is 100,000
|
|
212
|
+
* records, far beyond any real query this server makes; it exists so that an
|
|
213
|
+
* endpoint that never turns `has_next_page` off cannot spin forever.
|
|
214
|
+
*/
|
|
215
|
+
export const MAX_LIST_PAGES = 1000;
|
|
210
216
|
/**
|
|
211
217
|
* Extract a single record from a response.
|
|
212
218
|
*
|
|
@@ -237,11 +243,49 @@ export async function fetchOne(endpoint, options) {
|
|
|
237
243
|
return unwrapRecord(response);
|
|
238
244
|
}
|
|
239
245
|
/**
|
|
240
|
-
*
|
|
246
|
+
* Read exactly one page of a list endpoint and return it with its meta.
|
|
247
|
+
* This is for user-facing pagers that expose page and limit to the caller.
|
|
248
|
+
* Anything that needs the whole result set must use fetchList.
|
|
241
249
|
*/
|
|
242
|
-
export async function
|
|
250
|
+
export async function fetchPage(endpoint, options) {
|
|
243
251
|
const response = await factorialRequest(endpoint, options);
|
|
244
|
-
return response
|
|
252
|
+
return { data: response?.data ?? [], meta: response?.meta };
|
|
253
|
+
}
|
|
254
|
+
/**
|
|
255
|
+
* Read a list endpoint exhaustively.
|
|
256
|
+
*
|
|
257
|
+
* Factorial pages list endpoints at 100 items by default and reports the
|
|
258
|
+
* remainder in `meta.has_next_page`, so a single request silently truncates
|
|
259
|
+
* anything longer than a page: a 249-day window of estimated_times came back
|
|
260
|
+
* as the first 100 days and nothing else (found 2026-09-06). This follows
|
|
261
|
+
* `has_next_page` until it is false. Filters in `options.params` travel with
|
|
262
|
+
* every page; a caller-supplied `page` is where the read starts and a
|
|
263
|
+
* caller-supplied `limit` is kept. A response without `meta` is taken as
|
|
264
|
+
* complete, which is what endpoints marked `paginateable: false` also say.
|
|
265
|
+
*/
|
|
266
|
+
export async function fetchList(endpoint, options) {
|
|
267
|
+
const params = options?.params ?? {};
|
|
268
|
+
const startPage = typeof params.page === 'number' && params.page > 0 ? params.page : 1;
|
|
269
|
+
const all = [];
|
|
270
|
+
let page = startPage;
|
|
271
|
+
for (;;) {
|
|
272
|
+
// The first request goes out exactly as the caller built it; only the
|
|
273
|
+
// follow-up pages add `page`, so endpoints that ignore it never see it.
|
|
274
|
+
const response = await factorialRequest(endpoint, page === startPage ? options : { ...options, params: { ...params, page } });
|
|
275
|
+
const batch = response?.data ?? [];
|
|
276
|
+
all.push(...batch);
|
|
277
|
+
const more = response?.meta?.has_next_page === true && batch.length > 0;
|
|
278
|
+
if (!more)
|
|
279
|
+
break;
|
|
280
|
+
page += 1;
|
|
281
|
+
if (page - startPage >= MAX_LIST_PAGES) {
|
|
282
|
+
throw new Error(`fetchList(${endpoint}): more than ${MAX_LIST_PAGES} pages, refusing to continue`);
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
if (page > startPage) {
|
|
286
|
+
debug(`fetchList(${endpoint}): read ${all.length} records across ${page - startPage + 1} pages`);
|
|
287
|
+
}
|
|
288
|
+
return all;
|
|
245
289
|
}
|
|
246
290
|
// ============================================================================
|
|
247
291
|
// Write Operation Helpers
|
package/dist/http-client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http-client.js","sourceRoot":"","sources":["../src/http-client.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAC1D,OAAO,EACL,mBAAmB,EACnB,kBAAkB,EAClB,aAAa,EACb,cAAc,EACd,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,eAAe,EACf,aAAa,EACb,wBAAwB,EACxB,gBAAgB,EAChB,sBAAsB,GACvB,MAAM,aAAa,CAAC;AAyCrB;;GAEG;AACH,SAAS,KAAK,CAAC,EAAU;IACvB,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC;AACzD,CAAC;AAED;;;;;GAKG;AACH,SAAS,eAAe,CAAC,OAAe,EAAE,SAAS,GAAG,IAAI;IACxD,MAAM,gBAAgB,GAAG,SAAS,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,OAAO,GAAG,CAAC,CAAC,CAAC;IAC9D,MAAM,QAAQ,GAAG,KAAK,CAAC,CAAC,oBAAoB;IAC5C,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,gBAAgB,EAAE,QAAQ,CAAC,CAAC;IACnD,oBAAoB;IACpB,MAAM,MAAM,GAAG,KAAK,GAAG,GAAG,GAAG,CAAC,IAAI,CAAC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the registro horario guide.
|
|
3
|
+
*
|
|
4
|
+
* A prompt is a procedure the user invokes (a slash command in Claude Code,
|
|
5
|
+
* an entry in the prompt menu elsewhere). Each one here pre-reads the facts
|
|
6
|
+
* the procedure starts from, states the exact tool calls that follow with
|
|
7
|
+
* their arguments filled in, and spells out the decision rules, so that a
|
|
8
|
+
* small model can carry the workflow through without having to design it.
|
|
9
|
+
* Nothing is written by a prompt itself; writes happen only through the
|
|
10
|
+
* factorial_attendance tool and its confirmation gate.
|
|
11
|
+
*
|
|
12
|
+
* The guide resource (factorial://guides/registro-horario) is the same
|
|
13
|
+
* knowledge for a model that discovers resources on its own.
|
|
14
|
+
*/
|
|
15
|
+
import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
16
|
+
import { type Segment } from '../attendance/planner.js';
|
|
17
|
+
export declare const GUIDE_URI = "factorial://guides/registro-horario";
|
|
18
|
+
/**
|
|
19
|
+
* Parse the `segments` prompt argument. Prompt arguments are strings, so the
|
|
20
|
+
* daily pattern arrives as "09:00-14:00, 15:00-18:00" (comma, semicolon or
|
|
21
|
+
* whitespace separated) or as the JSON array the tool takes.
|
|
22
|
+
*/
|
|
23
|
+
export declare function parseSegmentsArg(text: string): Segment[];
|
|
24
|
+
/** First day of the month of `today` up to `today`, the default audit window */
|
|
25
|
+
export declare function defaultWindow(today: string): {
|
|
26
|
+
start_on: string;
|
|
27
|
+
end_on: string;
|
|
28
|
+
};
|
|
29
|
+
export declare const REGISTRO_HORARIO_GUIDE: string;
|
|
30
|
+
export interface AttendancePromptDeps {
|
|
31
|
+
now?: () => Date;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Register the three attendance prompts and the guide resource on a server.
|
|
35
|
+
* `deps.now` exists for tests; the server uses the wall clock.
|
|
36
|
+
*/
|
|
37
|
+
export declare function registerAttendancePrompts(server: McpServer, deps?: AttendancePromptDeps): void;
|
|
38
|
+
//# sourceMappingURL=attendance.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"attendance.d.ts","sourceRoot":"","sources":["../../src/prompts/attendance.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAKzE,OAAO,EAIL,KAAK,OAAO,EACb,MAAM,0BAA0B,CAAC;AAGlC,eAAO,MAAM,SAAS,wCAAwC,CAAC;AAI/D;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,EAAE,CAqCxD;AAkBD,gFAAgF;AAChF,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAEjF;AAuCD,eAAO,MAAM,sBAAsB,QA8ClC,CAAC;AAEF,MAAM,WAAW,oBAAoB;IACnC,GAAG,CAAC,EAAE,MAAM,IAAI,CAAC;CAClB;AAED;;;GAGG;AACH,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,SAAS,EAAE,IAAI,GAAE,oBAAyB,QA0O3F"}
|
|
@@ -0,0 +1,366 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Attendance prompts and the registro horario guide.
|
|
3
|
+
*
|
|
4
|
+
* A prompt is a procedure the user invokes (a slash command in Claude Code,
|
|
5
|
+
* an entry in the prompt menu elsewhere). Each one here pre-reads the facts
|
|
6
|
+
* the procedure starts from, states the exact tool calls that follow with
|
|
7
|
+
* their arguments filled in, and spells out the decision rules, so that a
|
|
8
|
+
* small model can carry the workflow through without having to design it.
|
|
9
|
+
* Nothing is written by a prompt itself; writes happen only through the
|
|
10
|
+
* factorial_attendance tool and its confirmation gate.
|
|
11
|
+
*
|
|
12
|
+
* The guide resource (factorial://guides/registro-horario) is the same
|
|
13
|
+
* knowledge for a model that discovers resources on its own.
|
|
14
|
+
*/
|
|
15
|
+
import * as z from 'zod';
|
|
16
|
+
import { localToday } from '../api/attendance.js';
|
|
17
|
+
import { buildLedger, findGaps } from '../attendance/backfill.js';
|
|
18
|
+
import { resolveEmployeeName, resolveTargetEmployeeId } from '../attendance/identity.js';
|
|
19
|
+
import { DEFAULT_TOLERANCE_MINUTES, hours, validateSegments, } from '../attendance/planner.js';
|
|
20
|
+
import { formatAudit, formatGaps, ledgerRow } from '../attendance/report.js';
|
|
21
|
+
export const GUIDE_URI = 'factorial://guides/registro-horario';
|
|
22
|
+
const SEGMENT = /^([01]\d|2[0-3]):[0-5]\d-([01]\d|2[0-3]):[0-5]\d$/;
|
|
23
|
+
/**
|
|
24
|
+
* Parse the `segments` prompt argument. Prompt arguments are strings, so the
|
|
25
|
+
* daily pattern arrives as "09:00-14:00, 15:00-18:00" (comma, semicolon or
|
|
26
|
+
* whitespace separated) or as the JSON array the tool takes.
|
|
27
|
+
*/
|
|
28
|
+
export function parseSegmentsArg(text) {
|
|
29
|
+
const trimmed = text.trim();
|
|
30
|
+
if (trimmed === '') {
|
|
31
|
+
throw new Error('segments is required, for example "09:00-14:00, 15:00-18:00"');
|
|
32
|
+
}
|
|
33
|
+
let segments;
|
|
34
|
+
if (trimmed.startsWith('[')) {
|
|
35
|
+
const parsed = JSON.parse(trimmed);
|
|
36
|
+
if (!Array.isArray(parsed))
|
|
37
|
+
throw new Error('segments JSON must be an array');
|
|
38
|
+
segments = parsed.map((item) => {
|
|
39
|
+
if (item === null ||
|
|
40
|
+
typeof item !== 'object' ||
|
|
41
|
+
typeof item.clock_in !== 'string' ||
|
|
42
|
+
typeof item.clock_out !== 'string') {
|
|
43
|
+
throw new Error('each segment needs clock_in and clock_out as "HH:MM" strings');
|
|
44
|
+
}
|
|
45
|
+
return { clock_in: item.clock_in, clock_out: item.clock_out };
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
segments = trimmed
|
|
50
|
+
.split(/[,;\s]+/)
|
|
51
|
+
.filter(part => part !== '')
|
|
52
|
+
.map(part => {
|
|
53
|
+
if (!SEGMENT.test(part)) {
|
|
54
|
+
throw new Error(`Segment "${part}" must be HH:MM-HH:MM in 24-hour company local time, ` +
|
|
55
|
+
'for example "09:00-14:00, 15:00-18:00"');
|
|
56
|
+
}
|
|
57
|
+
const [clock_in, clock_out] = part.split('-');
|
|
58
|
+
return { clock_in, clock_out };
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
validateSegments(segments);
|
|
62
|
+
return segments;
|
|
63
|
+
}
|
|
64
|
+
/** Sum of a daily pattern in minutes */
|
|
65
|
+
function patternMinutes(segments) {
|
|
66
|
+
return segments.reduce((sum, s) => {
|
|
67
|
+
const [ih, im] = s.clock_in.split(':').map(Number);
|
|
68
|
+
const [oh, om] = s.clock_out.split(':').map(Number);
|
|
69
|
+
return sum + (oh * 60 + om) - (ih * 60 + im);
|
|
70
|
+
}, 0);
|
|
71
|
+
}
|
|
72
|
+
function parseOptionalInt(value, name) {
|
|
73
|
+
if (value === undefined || value.trim() === '')
|
|
74
|
+
return undefined;
|
|
75
|
+
const n = Number(value);
|
|
76
|
+
if (!Number.isInteger(n) || n < 0)
|
|
77
|
+
throw new Error(`${name} must be a non-negative integer`);
|
|
78
|
+
return n;
|
|
79
|
+
}
|
|
80
|
+
/** First day of the month of `today` up to `today`, the default audit window */
|
|
81
|
+
export function defaultWindow(today) {
|
|
82
|
+
return { start_on: `${today.slice(0, 7)}-01`, end_on: today };
|
|
83
|
+
}
|
|
84
|
+
function resolveWindow(startOn, endOn, today) {
|
|
85
|
+
const fallback = defaultWindow(today);
|
|
86
|
+
return {
|
|
87
|
+
start_on: startOn && startOn.trim() !== '' ? startOn.trim() : fallback.start_on,
|
|
88
|
+
end_on: endOn && endOn.trim() !== '' ? endOn.trim() : fallback.end_on,
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
function toolCall(args) {
|
|
92
|
+
return `factorial_attendance(${JSON.stringify(args)})`;
|
|
93
|
+
}
|
|
94
|
+
function userMessage(text) {
|
|
95
|
+
return { messages: [{ role: 'user', content: { type: 'text', text } }] };
|
|
96
|
+
}
|
|
97
|
+
/** Pre-read the data a procedure starts from; on failure, say so instead of failing the prompt */
|
|
98
|
+
async function preRead(label, read) {
|
|
99
|
+
try {
|
|
100
|
+
return await read();
|
|
101
|
+
}
|
|
102
|
+
catch (error) {
|
|
103
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
104
|
+
return (`The server could not pre-read ${label}: ${message}\n` +
|
|
105
|
+
'Run the corresponding factorial_attendance call yourself before continuing.');
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
const STATUS_LEGEND = [
|
|
109
|
+
'Statuses: complete (tracked within tolerance of expected), missing (hours short), over (hours in',
|
|
110
|
+
'excess), weekend, bank_holiday, on_leave (approved full-day leave), half_day_leave (approved half',
|
|
111
|
+
'day; the other half may be missing), not_workable (the contract expects 0 minutes), no_contract_data',
|
|
112
|
+
'(Factorial returned nothing for the date; usually before the start of employment, never a fact about',
|
|
113
|
+
'hours), future (after today, never written).',
|
|
114
|
+
].join(' ');
|
|
115
|
+
export const REGISTRO_HORARIO_GUIDE = `# Registro horario with factorial_attendance
|
|
116
|
+
|
|
117
|
+
This guide is for the model driving the tool. Every step below is a call to the \`factorial_attendance\` tool with an \`action\`. Times are HH:MM in company local time. Dates are YYYY-MM-DD.
|
|
118
|
+
|
|
119
|
+
## What the data means
|
|
120
|
+
|
|
121
|
+
- **Expected** minutes come from the employee's contract pattern (\`estimated_times\`).
|
|
122
|
+
- **Tracked** minutes come from the shift records on file (\`worked_times\`, \`shifts\`).
|
|
123
|
+
- **Day type** and bank holidays come from the company calendar in Factorial (\`worked_times.day_type\`).
|
|
124
|
+
- **Leave** comes from approved \`timeoff/leaves\` records. Pending or rejected leave does not count.
|
|
125
|
+
- ${STATUS_LEGEND}
|
|
126
|
+
- Every \`gaps\`, \`audit\` and bulk preview starts with a **Data read** line saying how many days of the window have contract data and how many leave and shift records were read. If it reports uncovered days that do not precede the start of employment, stop and report; do not write.
|
|
127
|
+
- The server reads every page of every list, so a window of any length is read completely. There is no need to split a range into chunks unless the result is too large to read; if it is, use \`format: "summary"\` on \`audit\` or split by month.
|
|
128
|
+
|
|
129
|
+
## Workflow A: audit and report
|
|
130
|
+
|
|
131
|
+
1. \`audit\` with \`start_on\`, \`end_on\` (default \`format\` is \`summary\`: only the days needing attention).
|
|
132
|
+
2. Read the Data read line first. Then report: expected vs tracked for the window, the list of \`missing\` days with how much is missing on each, any \`over\` days, any \`half_day_leave\` days whose worked half is untracked, and any \`no_contract_data\` days with the warning above.
|
|
133
|
+
3. Write nothing. An audit is read-only.
|
|
134
|
+
|
|
135
|
+
## Workflow B: fill what is missing
|
|
136
|
+
|
|
137
|
+
1. \`gaps\` for the window to see which workdays are short and by how much.
|
|
138
|
+
2. Ask the person for their usual daily pattern if you do not have it, as segments such as \`[{"clock_in":"09:00","clock_out":"14:00"},{"clock_in":"15:00","clock_out":"18:00"}]\`. Never invent hours; the record is a legal document of time actually worked.
|
|
139
|
+
3. \`log_range\` with \`start_on\`, \`end_on\`, \`segments\`, and usually \`jitter_minutes\` (5 to 10) and an \`observations\` note saying why the records are being entered now. The first call returns a **preview** and a \`confirmation_token\`; nothing is written. The preview skips weekends, bank holidays, approved leave, days the contract does not expect work, future dates, days without contract data, and any segment overlapping an existing shift.
|
|
140
|
+
4. Show the preview to the person and ask them to confirm. Only then repeat the identical call with \`confirmation_token\`. The token lasts 15 minutes and matches exactly that plan. A bulk write always needs this step; there is no way around it and you must not look for one.
|
|
141
|
+
5. Days the person did not work in the range (sick without a leave record, a day off) must be excluded: either narrow the range, or run \`log_range\` on the sub-ranges around them. Days worked outside the pattern (a Saturday, a half day) are written one by one with \`log_days\`, which takes explicit dates and segments and skips only future dates, approved leave and overlaps.
|
|
142
|
+
6. If the write stops part way, the result says where. Re-running the identical call is safe: the planner re-reads existing shifts and writes only what is still missing.
|
|
143
|
+
7. \`audit\` the same window again and report what changed. Every workday should now read \`complete\`.
|
|
144
|
+
|
|
145
|
+
## Workflow C: today's record (for a daily routine)
|
|
146
|
+
|
|
147
|
+
1. \`status\` to see whether the employee is clocked in. If a shift is open, do not write; report it.
|
|
148
|
+
2. \`audit\` with \`start_on\` and \`end_on\` both set to today. If the status for today is \`complete\`, \`weekend\`, \`bank_holiday\`, \`on_leave\` or \`not_workable\`, there is nothing to do; report in one line.
|
|
149
|
+
3. If today is \`missing\`, \`log_days\` with \`days: [{"date": today, "segments": [...]}]\`, the person's stated pattern, and \`jitter_minutes\`. Then repeat the same call with the returned \`confirmation_token\` in the same session, only if the target is the configured identity (\`FACTORIAL_EMPLOYEE_ID\`). For anyone else, stop and ask.
|
|
150
|
+
4. Report in one line what was written or why nothing was.
|
|
151
|
+
|
|
152
|
+
MCP has no scheduler. To run this daily, schedule it in the client: in Claude Code, \`/schedule\` creates a routine that invokes the \`attendance_today\` prompt, and \`/loop\` repeats it while a session is open; any cron can run \`claude -p\` with the prompt as its input.
|
|
153
|
+
|
|
154
|
+
## Rules that always apply
|
|
155
|
+
|
|
156
|
+
- Never write hours for someone other than the person asking unless they name that employee explicitly; the tool requires a confirmation token for it, and so should you.
|
|
157
|
+
- Never pass a \`confirmation_token\` without the person having seen the preview it belongs to, except in Workflow C for the configured identity.
|
|
158
|
+
- Never delete or overwrite records to make an audit look right. Report discrepancies instead.
|
|
159
|
+
- Prefer \`jitter_minutes\` when reconstructing approximate hours, so a month does not read 09:00 on every line. Records still carry \`source: "api"\`.
|
|
160
|
+
- The records carry the \`observations\` note; write in it why they were entered (for example "Entered from calendar records on 2026-09-06").
|
|
161
|
+
`;
|
|
162
|
+
/**
|
|
163
|
+
* Register the three attendance prompts and the guide resource on a server.
|
|
164
|
+
* `deps.now` exists for tests; the server uses the wall clock.
|
|
165
|
+
*/
|
|
166
|
+
export function registerAttendancePrompts(server, deps = {}) {
|
|
167
|
+
const today = () => localToday((deps.now ?? (() => new Date()))());
|
|
168
|
+
server.registerResource('registro_horario_guide', GUIDE_URI, {
|
|
169
|
+
title: 'Registro horario guide',
|
|
170
|
+
description: "How to audit, fill and maintain an employee's registro horario (attendance record) with " +
|
|
171
|
+
'the factorial_attendance tool: what the data means, the three workflows, and the rules.',
|
|
172
|
+
mimeType: 'text/markdown',
|
|
173
|
+
}, uri => ({
|
|
174
|
+
contents: [{ uri: uri.href, mimeType: 'text/markdown', text: REGISTRO_HORARIO_GUIDE }],
|
|
175
|
+
}));
|
|
176
|
+
server.registerPrompt('attendance_audit', {
|
|
177
|
+
title: 'Audit registro horario',
|
|
178
|
+
description: "Audit an employee's registro horario for a date window and report what is missing, in " +
|
|
179
|
+
'excess or inconsistent. Read-only. Defaults to the current month up to today and to ' +
|
|
180
|
+
'FACTORIAL_EMPLOYEE_ID.',
|
|
181
|
+
argsSchema: {
|
|
182
|
+
start_on: z
|
|
183
|
+
.string()
|
|
184
|
+
.optional()
|
|
185
|
+
.describe('Start date YYYY-MM-DD (default: 1st of this month)'),
|
|
186
|
+
end_on: z.string().optional().describe('End date YYYY-MM-DD (default: today)'),
|
|
187
|
+
employee_id: z.string().optional().describe('Employee ID (default: FACTORIAL_EMPLOYEE_ID)'),
|
|
188
|
+
},
|
|
189
|
+
}, async ({ start_on, end_on, employee_id }) => {
|
|
190
|
+
const employeeId = resolveTargetEmployeeId(parseOptionalInt(employee_id, 'employee_id'));
|
|
191
|
+
const name = await resolveEmployeeName(employeeId);
|
|
192
|
+
const window = resolveWindow(start_on, end_on, today());
|
|
193
|
+
const report = await preRead('the audit', async () => {
|
|
194
|
+
const { ledger, coverage } = await buildLedger(employeeId, window.start_on, window.end_on);
|
|
195
|
+
return formatAudit({
|
|
196
|
+
employee: { id: employeeId, name },
|
|
197
|
+
startOn: window.start_on,
|
|
198
|
+
endOn: window.end_on,
|
|
199
|
+
ledger,
|
|
200
|
+
coverage,
|
|
201
|
+
toleranceMinutes: DEFAULT_TOLERANCE_MINUTES,
|
|
202
|
+
format: 'summary',
|
|
203
|
+
});
|
|
204
|
+
});
|
|
205
|
+
return userMessage([
|
|
206
|
+
`Audit the registro horario of ${name} (${employeeId}) from ${window.start_on} to ${window.end_on} and report on it.`,
|
|
207
|
+
'',
|
|
208
|
+
'The audit has already been run for you:',
|
|
209
|
+
'',
|
|
210
|
+
report,
|
|
211
|
+
'',
|
|
212
|
+
'Do this:',
|
|
213
|
+
'1. Read the Data read line. If it names days without contract data that are not before the start of employment, say so first and treat the audit as unreliable.',
|
|
214
|
+
'2. Report expected vs tracked hours for the window and the count of days per status.',
|
|
215
|
+
'3. List every missing day with the hours missing on it, grouped by month. List over days. Mention half_day_leave days whose worked half has no record.',
|
|
216
|
+
'4. If nothing needs attention, say so in one line.',
|
|
217
|
+
'5. Write nothing. This is a read-only report. If the person then wants to fill the gaps, use the attendance_fill prompt or follow Workflow B in the guide (' +
|
|
218
|
+
GUIDE_URI +
|
|
219
|
+
').',
|
|
220
|
+
'',
|
|
221
|
+
`To see every day rather than only the exceptions: ${toolCall({ action: 'audit', employee_id: employeeId, start_on: window.start_on, end_on: window.end_on, format: 'table' })}`,
|
|
222
|
+
STATUS_LEGEND,
|
|
223
|
+
].join('\n'));
|
|
224
|
+
});
|
|
225
|
+
server.registerPrompt('attendance_fill', {
|
|
226
|
+
title: 'Fill missing registro horario',
|
|
227
|
+
description: "Find the workdays with missing hours in a window and enter them with the employee's daily " +
|
|
228
|
+
'pattern, through a preview the person confirms. Defaults to the current month up to today ' +
|
|
229
|
+
'and to FACTORIAL_EMPLOYEE_ID.',
|
|
230
|
+
argsSchema: {
|
|
231
|
+
segments: z
|
|
232
|
+
.string()
|
|
233
|
+
.describe('Daily pattern in company local time, e.g. "09:00-14:00, 15:00-18:00"'),
|
|
234
|
+
start_on: z
|
|
235
|
+
.string()
|
|
236
|
+
.optional()
|
|
237
|
+
.describe('Start date YYYY-MM-DD (default: 1st of this month)'),
|
|
238
|
+
end_on: z.string().optional().describe('End date YYYY-MM-DD (default: today)'),
|
|
239
|
+
employee_id: z.string().optional().describe('Employee ID (default: FACTORIAL_EMPLOYEE_ID)'),
|
|
240
|
+
observations: z
|
|
241
|
+
.string()
|
|
242
|
+
.optional()
|
|
243
|
+
.describe('Note stored on every record, e.g. why the hours are being entered now'),
|
|
244
|
+
jitter_minutes: z
|
|
245
|
+
.string()
|
|
246
|
+
.optional()
|
|
247
|
+
.describe('Vary each time by up to this many minutes (default 8, 0 for exact times)'),
|
|
248
|
+
},
|
|
249
|
+
}, async ({ segments, start_on, end_on, employee_id, observations, jitter_minutes }) => {
|
|
250
|
+
const employeeId = resolveTargetEmployeeId(parseOptionalInt(employee_id, 'employee_id'));
|
|
251
|
+
const name = await resolveEmployeeName(employeeId);
|
|
252
|
+
const window = resolveWindow(start_on, end_on, today());
|
|
253
|
+
const pattern = parseSegmentsArg(segments);
|
|
254
|
+
const jitter = parseOptionalInt(jitter_minutes, 'jitter_minutes') ?? 8;
|
|
255
|
+
const note = observations && observations.trim() !== ''
|
|
256
|
+
? observations.trim()
|
|
257
|
+
: `Entered with the daily pattern on ${today()}`;
|
|
258
|
+
const gapsReport = await preRead('the gaps', async () => {
|
|
259
|
+
const { gaps, coverage } = await findGaps(employeeId, window.start_on, window.end_on);
|
|
260
|
+
return formatGaps({
|
|
261
|
+
employee: { id: employeeId, name },
|
|
262
|
+
startOn: window.start_on,
|
|
263
|
+
endOn: window.end_on,
|
|
264
|
+
gaps,
|
|
265
|
+
coverage,
|
|
266
|
+
});
|
|
267
|
+
});
|
|
268
|
+
const rangeCall = {
|
|
269
|
+
action: 'log_range',
|
|
270
|
+
employee_id: employeeId,
|
|
271
|
+
start_on: window.start_on,
|
|
272
|
+
end_on: window.end_on,
|
|
273
|
+
segments: pattern,
|
|
274
|
+
jitter_minutes: jitter,
|
|
275
|
+
observations: note,
|
|
276
|
+
};
|
|
277
|
+
return userMessage([
|
|
278
|
+
`Fill the missing registro horario of ${name} (${employeeId}) from ${window.start_on} to ${window.end_on} with the daily pattern ${pattern.map(s => `${s.clock_in}-${s.clock_out}`).join(' and ')} (${hours(patternMinutes(pattern))} a day).`,
|
|
279
|
+
'',
|
|
280
|
+
'The gaps have already been read for you:',
|
|
281
|
+
'',
|
|
282
|
+
gapsReport,
|
|
283
|
+
'',
|
|
284
|
+
'Do this, in order:',
|
|
285
|
+
'1. Read the Data read line. If it names days without contract data that are not before the start of employment, stop and report; do not write.',
|
|
286
|
+
'2. Tell the person which days are short and ask whether any of them were not worked (illness without a leave record, a day off). Exclude such days by narrowing the range or by running the call on the sub-ranges around them. Never invent hours.',
|
|
287
|
+
`3. Preview the write. Nothing is written by this call: ${toolCall(rangeCall)}`,
|
|
288
|
+
'4. Show the person the preview: how many days and records, the hours, and every skipped day with its reason. Ask them to confirm.',
|
|
289
|
+
'5. Only after they confirm, repeat exactly the same call adding the confirmation_token from the preview. The token lasts 15 minutes and matches only that plan. If it expired, run the preview again.',
|
|
290
|
+
'6. If the result says the write stopped part way, re-run the identical call; the planner writes only what is still missing.',
|
|
291
|
+
`7. Verify: ${toolCall({ action: 'audit', employee_id: employeeId, start_on: window.start_on, end_on: window.end_on })} and report what changed. Every workday should read complete.`,
|
|
292
|
+
'',
|
|
293
|
+
'For days worked outside the pattern (a Saturday, a half day next to half-day leave), write them one by one with action log_days, for example ' +
|
|
294
|
+
toolCall({
|
|
295
|
+
action: 'log_days',
|
|
296
|
+
employee_id: employeeId,
|
|
297
|
+
days: [{ date: window.end_on, segments: pattern.slice(0, 1) }],
|
|
298
|
+
observations: note,
|
|
299
|
+
}) +
|
|
300
|
+
', with the same preview and confirmation steps.',
|
|
301
|
+
'',
|
|
302
|
+
`Full guide: ${GUIDE_URI}`,
|
|
303
|
+
].join('\n'));
|
|
304
|
+
});
|
|
305
|
+
server.registerPrompt('attendance_today', {
|
|
306
|
+
title: "Record today's registro horario",
|
|
307
|
+
description: "Enter today's hours for the configured employee if today is a workday with nothing " +
|
|
308
|
+
'tracked yet. Made for a daily routine (Claude Code /schedule or a cron running claude -p). ' +
|
|
309
|
+
'Does nothing on weekends, bank holidays, leave, or when a shift is open or today is complete.',
|
|
310
|
+
argsSchema: {
|
|
311
|
+
segments: z
|
|
312
|
+
.string()
|
|
313
|
+
.describe('Daily pattern in company local time, e.g. "09:00-14:00, 15:00-18:00"'),
|
|
314
|
+
employee_id: z.string().optional().describe('Employee ID (default: FACTORIAL_EMPLOYEE_ID)'),
|
|
315
|
+
observations: z.string().optional().describe('Note stored on the records'),
|
|
316
|
+
jitter_minutes: z
|
|
317
|
+
.string()
|
|
318
|
+
.optional()
|
|
319
|
+
.describe('Vary each time by up to this many minutes (default 8, 0 for exact times)'),
|
|
320
|
+
},
|
|
321
|
+
}, async ({ segments, employee_id, observations, jitter_minutes }) => {
|
|
322
|
+
const explicit = parseOptionalInt(employee_id, 'employee_id');
|
|
323
|
+
const employeeId = resolveTargetEmployeeId(explicit);
|
|
324
|
+
const name = await resolveEmployeeName(employeeId);
|
|
325
|
+
const date = today();
|
|
326
|
+
const pattern = parseSegmentsArg(segments);
|
|
327
|
+
const jitter = parseOptionalInt(jitter_minutes, 'jitter_minutes') ?? 8;
|
|
328
|
+
const note = observations && observations.trim() !== '' ? observations.trim() : 'Daily record';
|
|
329
|
+
const todayReport = await preRead("today's ledger", async () => {
|
|
330
|
+
const { ledger, coverage } = await buildLedger(employeeId, date, date);
|
|
331
|
+
const [row] = ledger;
|
|
332
|
+
return (`Today ${date} for ${name} (${employeeId}): status ${row.status}` +
|
|
333
|
+
(row.shifts.length
|
|
334
|
+
? `, shifts on record ${row.shifts.map(s => `${s.clock_in}-${s.clock_out ?? 'open'}`).join(' ')}`
|
|
335
|
+
: ', no shifts on record') +
|
|
336
|
+
`.\n${ledgerRow(row)}\n` +
|
|
337
|
+
`Data read: contract data for ${coverage.days_with_contract_data} of 1 day, ${coverage.leave_records} leave records, ${coverage.shift_records} shift records.`);
|
|
338
|
+
});
|
|
339
|
+
const daysCall = {
|
|
340
|
+
action: 'log_days',
|
|
341
|
+
employee_id: employeeId,
|
|
342
|
+
days: [{ date, segments: pattern }],
|
|
343
|
+
jitter_minutes: jitter,
|
|
344
|
+
observations: note,
|
|
345
|
+
};
|
|
346
|
+
return userMessage([
|
|
347
|
+
`Record today's registro horario (${date}) for ${name} (${employeeId}) with the pattern ${pattern.map(s => `${s.clock_in}-${s.clock_out}`).join(' and ')} (${hours(patternMinutes(pattern))}), if and only if today is a workday with nothing tracked yet.`,
|
|
348
|
+
'',
|
|
349
|
+
"Today's ledger has already been read for you:",
|
|
350
|
+
'',
|
|
351
|
+
todayReport,
|
|
352
|
+
'',
|
|
353
|
+
'Decide as follows:',
|
|
354
|
+
`1. ${toolCall({ action: 'status', employee_id: employeeId })}. If the employee is clocked in (an open shift), write nothing and report that a shift is open.`,
|
|
355
|
+
'2. If the status above is complete, weekend, bank_holiday, on_leave, not_workable or future, write nothing and report in one line why.',
|
|
356
|
+
'3. If the status is no_contract_data, write nothing and report that Factorial has no contract data for today.',
|
|
357
|
+
'4. If the status is half_day_leave, write nothing and report it; the worked half needs a person to say which half it was.',
|
|
358
|
+
`5. If the status is missing and no shift is on record, preview the write: ${toolCall(daysCall)}. Then, in this same session, repeat the identical call adding the confirmation_token from the preview. This unattended confirmation is allowed only when the employee is the configured identity (FACTORIAL_EMPLOYEE_ID)${explicit !== undefined ? '; an explicit employee_id was given, so confirm that it is the configured identity before proceeding, and otherwise stop and ask' : ''}.`,
|
|
359
|
+
'6. If the status is missing but a shift is already on record for today, write nothing and report the partial day; a person decides how to complete it.',
|
|
360
|
+
`7. Verify with ${toolCall({ action: 'audit', employee_id: employeeId, start_on: date, end_on: date })} and report in one line what was written or why nothing was.`,
|
|
361
|
+
'',
|
|
362
|
+
`Full guide: ${GUIDE_URI}`,
|
|
363
|
+
].join('\n'));
|
|
364
|
+
});
|
|
365
|
+
}
|
|
366
|
+
//# sourceMappingURL=attendance.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"attendance.js","sourceRoot":"","sources":["../../src/prompts/attendance.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAGH,OAAO,KAAK,CAAC,MAAM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WAAW;YACX,EAAE;YACF,oBAAoB;YACpB,MAAM,QAAQ,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,WAAW,EAAE,UAAU,EAAE,CAAC,iGAAiG;YAC9J,wIAAwI;YACxI,+GAA+G;YAC/G,2HAA2H;YAC3H,6EAA6E,QAAQ,CAAC,QAAQ,CAAC,4NAA4N,QAAQ,KAAK,SAAS,CAAC,CAAC,CAAC,kIAAkI,CAAC,CAAC,CAAC,EAAE,GAAG;YAC9d,wJAAwJ;YACxJ,kBAAkB,QAAQ,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,8DAA8D;YACpK,EAAE;YACF,eAAe,SAAS,EAAE;SAC3B,CAAC,IAAI,CAAC,IAAI,CAAC,CACb,CAAC;IACJ,CAAC,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"attendance.d.ts","sourceRoot":"","sources":["../../src/tools/attendance.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;
|
|
1
|
+
{"version":3,"file":"attendance.d.ts","sourceRoot":"","sources":["../../src/tools/attendance.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAoFzE,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,SAAS,QAicvD"}
|