@jsm-mit/sultana-agent-tools-package 0.11.0 → 0.12.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/dist/customer/texts.d.ts
CHANGED
|
@@ -31,7 +31,8 @@ export interface CustomerTexts {
|
|
|
31
31
|
leadSoon: string;
|
|
32
32
|
leadExtended: string;
|
|
33
33
|
leadAround(day: string, time: string): string;
|
|
34
|
-
|
|
34
|
+
/** `asked` and `now` as "RRRR-MM-DD GG:MM" — the model sees which date it got wrong. */
|
|
35
|
+
momentPassed(asked: string, now: string): string;
|
|
35
36
|
probesFailed: string;
|
|
36
37
|
nothingFree(radius: string): string;
|
|
37
38
|
found(lead: string, shown: number, total: number): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"texts.d.ts","sourceRoot":"","sources":["../../src/customer/texts.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,MAAM,WAAW,aAAa;IAC1B,QAAQ,EAAE;QACN,eAAe,EAAE,MAAM,CAAC;QACxB,WAAW,EAAE,MAAM,CAAC;QACpB,QAAQ,EAAE,MAAM,CAAC;QACjB,YAAY,EAAE,MAAM,CAAC;QACrB,IAAI,EAAE,MAAM,CAAC;QACb,gBAAgB,EAAE,MAAM,CAAC;QACzB,MAAM,EAAE,MAAM,CAAC;KAClB,CAAC;IACF,iBAAiB,EAAE,MAAM,CAAC;IAC1B,iBAAiB,EAAE,MAAM,CAAC;IAE1B,UAAU,EAAE,MAAM,CAAC;IACnB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,cAAc,EAAE,MAAM,CAAC;IACvB,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAAC;IACpC,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IAC9B,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IAE/B,mBAAmB,EAAE,MAAM,CAAC;IAC5B,mBAAmB,EAAE,MA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,CAAA;KAAE,GAAG,MAAM,CAAC;IACnI,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;IAC/B,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAAC;IAChD,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IACjC,UAAU,EAAE,MAAM,CAAC;IAEnB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IAChC,UAAU,EAAE,MAAM,CAAC;IAEnB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,WAAW,CAAC,KAAK,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,GAAG,MAAM,CAAC;IACvF,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IAC1B,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;IACjC,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;IAChC,YAAY,EAAE,MAAM,CAAC;CACxB;AA8ID,gGAAgG;AAChG,wBAAgB,kBAAkB,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAG/D;AAED,wBAAgB,aAAa,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,aAAa,CAE5D"}
|
package/dist/customer/texts.js
CHANGED
|
@@ -22,7 +22,7 @@ const PL = {
|
|
|
22
22
|
leadSoon: "Najbliższe wolne terminy:",
|
|
23
23
|
leadExtended: "W najbliższej godzinie nic wolnego, na które klient zdąży. Najbliższe terminy:",
|
|
24
24
|
leadAround: (day, time) => `Wolne terminy w okolicach ${day} ${time}:`,
|
|
25
|
-
momentPassed:
|
|
25
|
+
momentPassed: (asked, now) => `Termin ${asked} już minął — teraz jest ${now}. Sprawdź, czy dobrze przeliczyłeś datę (np. „jutro” = dzień po ${now.slice(0, 10)}), i szukaj jeszcze raz. Klienta pytaj o inny termin tylko wtedy, gdy to on podał godzinę, która minęła.`,
|
|
26
26
|
probesFailed: "Nie udało się sprawdzić terminów — kanister nie odpowiadał. Spróbuj ponownie za chwilę.",
|
|
27
27
|
nothingFree: (radius) => `Nic wolnego w promieniu ${radius}. Zaproponuj inną godzinę, inny dzień albo większy promień.`,
|
|
28
28
|
found: (lead, shown, total) => `${lead} ${shown} salon(y).${total > shown ? ` Pokazuję ${shown} z ${total} salonów.` : ""} Terminy to początek wizyty; inne godziny w danym salonie sprawdź przez get_free_times.`,
|
|
@@ -79,7 +79,7 @@ const EN = {
|
|
|
79
79
|
leadSoon: "The nearest free slots:",
|
|
80
80
|
leadExtended: "Nothing free within the next hour that the customer can reach in time. The nearest slots:",
|
|
81
81
|
leadAround: (day, time) => `Free slots around ${day} ${time}:`,
|
|
82
|
-
momentPassed:
|
|
82
|
+
momentPassed: (asked, now) => `${asked} has already passed — it is ${now} now. Check the date you computed ("tomorrow" = the day after ${now.slice(0, 10)}) and search again. Ask the customer for another time only when the time they gave has really passed.`,
|
|
83
83
|
probesFailed: "The slots could not be checked — the canister did not answer. Try again in a moment.",
|
|
84
84
|
nothingFree: (radius) => `Nothing free within ${radius}. Suggest another time, another day or a larger radius.`,
|
|
85
85
|
found: (lead, shown, total) => `${lead} ${shown} salon(s).${total > shown ? ` Showing ${shown} of ${total} salons.` : ""} A slot is the start of the visit; check other times in a salon with get_free_times.`,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../src/customer/tools.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAI7D,OAAO,EAAW,KAAK,SAAS,EAAmB,MAAM,aAAa,CAAC;AACvE,OAAO,EAAmB,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AAQ,CAAC,EAAE,MAAM,CAAC;IAClB,2FAA2F;IAC3F,OAAO,CAAC,EAAE,eAAe,CAAC;IAC1B,qFAAqF;IACrF,KAAK,CAAC,EAAE,aAAa,CAAC;CACzB;AAmED,wBAAgB,eAAe,CAAC,OAAO,EAAE,oBAAoB,GAAG,SAAS,CAyFxE;AAUD,wBAAgB,YAAY,CAAC,OAAO,EAAE,oBAAoB,GAAG,SAAS,CAmCrE;AAkCD,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,oBAAoB,GAAG,SAAS,CA4CzE;AAED,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,oBAAoB,EAAE,aAAa,EAAE,iBAAiB,GAAG,SAAS,GAAG,SAAS,CAsF1H;AA+CD,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,oBAAoB,GAAG,SAAS,CAqC/E;AAED,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,oBAAoB,EAAE,aAAa,EAAE,iBAAiB,GAAG,SAAS,GAAG,SAAS,CA6C5H"}
|
package/dist/customer/tools.js
CHANGED
|
@@ -118,7 +118,7 @@ export function searchSlotsTool(context) {
|
|
|
118
118
|
// Only moments of the asked day's grid that are still ahead.
|
|
119
119
|
.filter((moment) => moment > now.getTime() && onSlotGrid(new Date(moment).getMinutes()));
|
|
120
120
|
if (moments.length === 0)
|
|
121
|
-
return err("invalid_arguments", texts.momentPassed);
|
|
121
|
+
return err("invalid_arguments", texts.momentPassed(`${day} ${timeOfMinutes(at)}`, localStampOf(now)));
|
|
122
122
|
found = await port.searchAtMoments(location, serviceTypeIds, radiusKm, moments);
|
|
123
123
|
lead = texts.leadAround(day, timeOfMinutes(at));
|
|
124
124
|
}
|
|
@@ -307,8 +307,9 @@ export function bookAppointmentTool(context, confirmations) {
|
|
|
307
307
|
if (refusal)
|
|
308
308
|
return refusal;
|
|
309
309
|
const startAt = momentOf(day, startMinutes);
|
|
310
|
-
|
|
311
|
-
|
|
310
|
+
const now = context.now();
|
|
311
|
+
if (startAt <= now.getTime())
|
|
312
|
+
return err("invalid_arguments", texts.momentPassed(`${day} ${timeOfMinutes(startMinutes)}`, localStampOf(now)));
|
|
312
313
|
const service = await findService(port, texts, salonId, serviceId);
|
|
313
314
|
if ("status" in service)
|
|
314
315
|
return service;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jsm-mit/sultana-agent-tools-package",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.12.0",
|
|
4
4
|
"description": "Agent tool layer for Sultana: framework-agnostic tools over the Sultana core canister wrapper — a salon owner's set (services, promos, schedule) and a customer's set (search, free times, booking), each with a read-only set that needs no identity.",
|
|
5
5
|
"homepage": "https://github.com/JSM-Sultana/sultana-agent-tools-package#readme",
|
|
6
6
|
"bugs": {
|