@mccaskie-labs/workbench-config 0.1.15 → 0.1.16
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/CHANGELOG.md
CHANGED
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "./schema.json",
|
|
3
|
+
"format": 1,
|
|
4
|
+
"component": "country",
|
|
5
|
+
"title": "Country packs and the one formatter",
|
|
6
|
+
"summary": "workbench-country writes dates, times, numbers and money the way readers in the Philippines, Australia, the UK and the US expect, from one pack per country, and gives each pack's spelling for the Gateway. It runs in the app itself, with no Gateway call and no cost.",
|
|
7
|
+
"status": "built",
|
|
8
|
+
"surfaces": {
|
|
9
|
+
"package": [
|
|
10
|
+
"COUNTRY_PACKS",
|
|
11
|
+
"countryPackFor",
|
|
12
|
+
"audiencePack",
|
|
13
|
+
"checkPack",
|
|
14
|
+
"CountryPackError",
|
|
15
|
+
"formatDate",
|
|
16
|
+
"formatDateTime",
|
|
17
|
+
"calendarDayIn",
|
|
18
|
+
"formatNumber",
|
|
19
|
+
"formatMoney",
|
|
20
|
+
"formattingLocale",
|
|
21
|
+
"currencySymbol",
|
|
22
|
+
"currencySymbolFrom",
|
|
23
|
+
"WORLDWIDE",
|
|
24
|
+
"isWorldwide"
|
|
25
|
+
]
|
|
26
|
+
},
|
|
27
|
+
"rules": [
|
|
28
|
+
{
|
|
29
|
+
"id": "country.one-formatter",
|
|
30
|
+
"kind": "must",
|
|
31
|
+
"text": "Write every date, time, number and amount readers see through workbench-country, from the app's audiencePack, not hand-built strings or a bare toLocaleString.",
|
|
32
|
+
"enforced_by": "review",
|
|
33
|
+
"probe": "country.packs"
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"id": "country.month-in-words",
|
|
37
|
+
"kind": "must_not",
|
|
38
|
+
"text": "Write a date readers see as digits only (03/04/2026): the month is always in words, so day-first and month-first readers read it the same way.",
|
|
39
|
+
"enforced_by": "types",
|
|
40
|
+
"probe": "country.packs"
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"id": "country.no-bare-dollar",
|
|
44
|
+
"kind": "must_not",
|
|
45
|
+
"text": "Write an amount with a bare \"$\": Australian dollars are A$ and US dollars US$.",
|
|
46
|
+
"enforced_by": "types",
|
|
47
|
+
"probe": "country.packs"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"id": "country.spelling-from-pack",
|
|
51
|
+
"kind": "must",
|
|
52
|
+
"text": "Pass the pack's spelling as workbench-ai's spelling option, so AI text is spelled for the same readers its dates and money are written for.",
|
|
53
|
+
"enforced_by": "review",
|
|
54
|
+
"probe": "country.spelling"
|
|
55
|
+
}
|
|
56
|
+
],
|
|
57
|
+
"examples": [
|
|
58
|
+
{
|
|
59
|
+
"id": "country.example.format",
|
|
60
|
+
"title": "Write a date and a price for the app's readers",
|
|
61
|
+
"lang": "ts",
|
|
62
|
+
"probe": "country.packs",
|
|
63
|
+
"code": "import { audiencePack, formatDate, formatMoney } from '@mccaskie-labs/workbench-country'\n\nconst pack = audiencePack({ country: 'PH' })\nconst line = `Due ${formatDate('2026-09-26', { pack })}: ${formatMoney(1400, pack)}`\n// \"Due September 26, 2026: ₱1,400\"\nconst reply = await ai.text({ prompt, spelling: pack.spelling })"
|
|
64
|
+
}
|
|
65
|
+
],
|
|
66
|
+
"probes": [
|
|
67
|
+
{
|
|
68
|
+
"id": "country.packs",
|
|
69
|
+
"half": "runtime",
|
|
70
|
+
"expect": "pass",
|
|
71
|
+
"smoke": true,
|
|
72
|
+
"cost_hint_usd": 0,
|
|
73
|
+
"note": "In the Worker itself: formats one calendar date, one moment and one amount for PH, AU, GB and US and compares each with the expected text (September 26, 2026 / 26 September 2026; ₱1,400, A$1,400, £1,400, US$1,400)"
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
"id": "country.spelling",
|
|
77
|
+
"half": "runtime",
|
|
78
|
+
"expect": "pass",
|
|
79
|
+
"cost_hint_usd": 0,
|
|
80
|
+
"note": "Every pack's spelling is one the Gateway accepts (en-PH, en-AU, en-GB, en-US), checked against the ai manifest's spellings; no Gateway call"
|
|
81
|
+
}
|
|
82
|
+
]
|
|
83
|
+
}
|
package/capabilities/schema.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const MANIFEST_VERSION: "
|
|
1
|
+
export declare const MANIFEST_VERSION: "c72ad5ff6960";
|
|
2
2
|
export declare const capabilities: {
|
|
3
3
|
readonly ai: {
|
|
4
4
|
readonly $schema: "./schema.json";
|
|
@@ -356,6 +356,63 @@ export declare const capabilities: {
|
|
|
356
356
|
readonly note: "Manual: run npx workbench-config check in the project";
|
|
357
357
|
}];
|
|
358
358
|
};
|
|
359
|
+
readonly country: {
|
|
360
|
+
readonly $schema: "./schema.json";
|
|
361
|
+
readonly format: 1;
|
|
362
|
+
readonly component: "country";
|
|
363
|
+
readonly title: "Country packs and the one formatter";
|
|
364
|
+
readonly summary: "workbench-country writes dates, times, numbers and money the way readers in the Philippines, Australia, the UK and the US expect, from one pack per country, and gives each pack's spelling for the Gateway. It runs in the app itself, with no Gateway call and no cost.";
|
|
365
|
+
readonly status: "built";
|
|
366
|
+
readonly surfaces: {
|
|
367
|
+
readonly package: readonly ["COUNTRY_PACKS", "countryPackFor", "audiencePack", "checkPack", "CountryPackError", "formatDate", "formatDateTime", "calendarDayIn", "formatNumber", "formatMoney", "formattingLocale", "currencySymbol", "currencySymbolFrom", "WORLDWIDE", "isWorldwide"];
|
|
368
|
+
};
|
|
369
|
+
readonly rules: readonly [{
|
|
370
|
+
readonly id: "country.one-formatter";
|
|
371
|
+
readonly kind: "must";
|
|
372
|
+
readonly text: "Write every date, time, number and amount readers see through workbench-country, from the app's audiencePack, not hand-built strings or a bare toLocaleString.";
|
|
373
|
+
readonly enforced_by: "review";
|
|
374
|
+
readonly probe: "country.packs";
|
|
375
|
+
}, {
|
|
376
|
+
readonly id: "country.month-in-words";
|
|
377
|
+
readonly kind: "must_not";
|
|
378
|
+
readonly text: "Write a date readers see as digits only (03/04/2026): the month is always in words, so day-first and month-first readers read it the same way.";
|
|
379
|
+
readonly enforced_by: "types";
|
|
380
|
+
readonly probe: "country.packs";
|
|
381
|
+
}, {
|
|
382
|
+
readonly id: "country.no-bare-dollar";
|
|
383
|
+
readonly kind: "must_not";
|
|
384
|
+
readonly text: "Write an amount with a bare \"$\": Australian dollars are A$ and US dollars US$.";
|
|
385
|
+
readonly enforced_by: "types";
|
|
386
|
+
readonly probe: "country.packs";
|
|
387
|
+
}, {
|
|
388
|
+
readonly id: "country.spelling-from-pack";
|
|
389
|
+
readonly kind: "must";
|
|
390
|
+
readonly text: "Pass the pack's spelling as workbench-ai's spelling option, so AI text is spelled for the same readers its dates and money are written for.";
|
|
391
|
+
readonly enforced_by: "review";
|
|
392
|
+
readonly probe: "country.spelling";
|
|
393
|
+
}];
|
|
394
|
+
readonly examples: readonly [{
|
|
395
|
+
readonly id: "country.example.format";
|
|
396
|
+
readonly title: "Write a date and a price for the app's readers";
|
|
397
|
+
readonly lang: "ts";
|
|
398
|
+
readonly code: "import { audiencePack, formatDate, formatMoney } from '@mccaskie-labs/workbench-country'\n\nconst pack = audiencePack({ country: 'PH' })\nconst line = `Due ${formatDate('2026-09-26', { pack })}: ${formatMoney(1400, pack)}`\n// \"Due September 26, 2026: ₱1,400\"\nconst reply = await ai.text({ prompt, spelling: pack.spelling })";
|
|
399
|
+
readonly probe: "country.packs";
|
|
400
|
+
}];
|
|
401
|
+
readonly probes: readonly [{
|
|
402
|
+
readonly id: "country.packs";
|
|
403
|
+
readonly half: "runtime";
|
|
404
|
+
readonly expect: "pass";
|
|
405
|
+
readonly smoke: true;
|
|
406
|
+
readonly cost_hint_usd: 0;
|
|
407
|
+
readonly note: "In the Worker itself: formats one calendar date, one moment and one amount for PH, AU, GB and US and compares each with the expected text (September 26, 2026 / 26 September 2026; ₱1,400, A$1,400, £1,400, US$1,400)";
|
|
408
|
+
}, {
|
|
409
|
+
readonly id: "country.spelling";
|
|
410
|
+
readonly half: "runtime";
|
|
411
|
+
readonly expect: "pass";
|
|
412
|
+
readonly cost_hint_usd: 0;
|
|
413
|
+
readonly note: "Every pack's spelling is one the Gateway accepts (en-PH, en-AU, en-GB, en-US), checked against the ai manifest's spellings; no Gateway call";
|
|
414
|
+
}];
|
|
415
|
+
};
|
|
359
416
|
readonly database: {
|
|
360
417
|
readonly $schema: "./schema.json";
|
|
361
418
|
readonly format: 1;
|
package/dist/capabilities.gen.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Generated by `npm run capabilities:build` from capabilities/*.json. Do not edit.
|
|
2
2
|
// check:capabilities fails in Checks when this file is stale.
|
|
3
|
-
export const MANIFEST_VERSION = "
|
|
3
|
+
export const MANIFEST_VERSION = "c72ad5ff6960";
|
|
4
4
|
export const capabilities = {
|
|
5
5
|
"ai": {
|
|
6
6
|
"$schema": "./schema.json",
|
|
@@ -523,6 +523,89 @@ export const capabilities = {
|
|
|
523
523
|
}
|
|
524
524
|
]
|
|
525
525
|
},
|
|
526
|
+
"country": {
|
|
527
|
+
"$schema": "./schema.json",
|
|
528
|
+
"format": 1,
|
|
529
|
+
"component": "country",
|
|
530
|
+
"title": "Country packs and the one formatter",
|
|
531
|
+
"summary": "workbench-country writes dates, times, numbers and money the way readers in the Philippines, Australia, the UK and the US expect, from one pack per country, and gives each pack's spelling for the Gateway. It runs in the app itself, with no Gateway call and no cost.",
|
|
532
|
+
"status": "built",
|
|
533
|
+
"surfaces": {
|
|
534
|
+
"package": [
|
|
535
|
+
"COUNTRY_PACKS",
|
|
536
|
+
"countryPackFor",
|
|
537
|
+
"audiencePack",
|
|
538
|
+
"checkPack",
|
|
539
|
+
"CountryPackError",
|
|
540
|
+
"formatDate",
|
|
541
|
+
"formatDateTime",
|
|
542
|
+
"calendarDayIn",
|
|
543
|
+
"formatNumber",
|
|
544
|
+
"formatMoney",
|
|
545
|
+
"formattingLocale",
|
|
546
|
+
"currencySymbol",
|
|
547
|
+
"currencySymbolFrom",
|
|
548
|
+
"WORLDWIDE",
|
|
549
|
+
"isWorldwide"
|
|
550
|
+
]
|
|
551
|
+
},
|
|
552
|
+
"rules": [
|
|
553
|
+
{
|
|
554
|
+
"id": "country.one-formatter",
|
|
555
|
+
"kind": "must",
|
|
556
|
+
"text": "Write every date, time, number and amount readers see through workbench-country, from the app's audiencePack, not hand-built strings or a bare toLocaleString.",
|
|
557
|
+
"enforced_by": "review",
|
|
558
|
+
"probe": "country.packs"
|
|
559
|
+
},
|
|
560
|
+
{
|
|
561
|
+
"id": "country.month-in-words",
|
|
562
|
+
"kind": "must_not",
|
|
563
|
+
"text": "Write a date readers see as digits only (03/04/2026): the month is always in words, so day-first and month-first readers read it the same way.",
|
|
564
|
+
"enforced_by": "types",
|
|
565
|
+
"probe": "country.packs"
|
|
566
|
+
},
|
|
567
|
+
{
|
|
568
|
+
"id": "country.no-bare-dollar",
|
|
569
|
+
"kind": "must_not",
|
|
570
|
+
"text": "Write an amount with a bare \"$\": Australian dollars are A$ and US dollars US$.",
|
|
571
|
+
"enforced_by": "types",
|
|
572
|
+
"probe": "country.packs"
|
|
573
|
+
},
|
|
574
|
+
{
|
|
575
|
+
"id": "country.spelling-from-pack",
|
|
576
|
+
"kind": "must",
|
|
577
|
+
"text": "Pass the pack's spelling as workbench-ai's spelling option, so AI text is spelled for the same readers its dates and money are written for.",
|
|
578
|
+
"enforced_by": "review",
|
|
579
|
+
"probe": "country.spelling"
|
|
580
|
+
}
|
|
581
|
+
],
|
|
582
|
+
"examples": [
|
|
583
|
+
{
|
|
584
|
+
"id": "country.example.format",
|
|
585
|
+
"title": "Write a date and a price for the app's readers",
|
|
586
|
+
"lang": "ts",
|
|
587
|
+
"code": "import { audiencePack, formatDate, formatMoney } from '@mccaskie-labs/workbench-country'\n\nconst pack = audiencePack({ country: 'PH' })\nconst line = `Due ${formatDate('2026-09-26', { pack })}: ${formatMoney(1400, pack)}`\n// \"Due September 26, 2026: ₱1,400\"\nconst reply = await ai.text({ prompt, spelling: pack.spelling })",
|
|
588
|
+
"probe": "country.packs"
|
|
589
|
+
}
|
|
590
|
+
],
|
|
591
|
+
"probes": [
|
|
592
|
+
{
|
|
593
|
+
"id": "country.packs",
|
|
594
|
+
"half": "runtime",
|
|
595
|
+
"expect": "pass",
|
|
596
|
+
"smoke": true,
|
|
597
|
+
"cost_hint_usd": 0,
|
|
598
|
+
"note": "In the Worker itself: formats one calendar date, one moment and one amount for PH, AU, GB and US and compares each with the expected text (September 26, 2026 / 26 September 2026; ₱1,400, A$1,400, £1,400, US$1,400)"
|
|
599
|
+
},
|
|
600
|
+
{
|
|
601
|
+
"id": "country.spelling",
|
|
602
|
+
"half": "runtime",
|
|
603
|
+
"expect": "pass",
|
|
604
|
+
"cost_hint_usd": 0,
|
|
605
|
+
"note": "Every pack's spelling is one the Gateway accepts (en-PH, en-AU, en-GB, en-US), checked against the ai manifest's spellings; no Gateway call"
|
|
606
|
+
}
|
|
607
|
+
]
|
|
608
|
+
},
|
|
526
609
|
"database": {
|
|
527
610
|
"$schema": "./schema.json",
|
|
528
611
|
"format": 1,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
export declare const COMPONENTS: readonly ["gateway", "ai", "images", "image-search", "config", "email", "email-inbound", "email-sending", "database", "workers", "domains", "dns", "analytics", "access", "r2", "kv", "github"];
|
|
2
|
+
export declare const COMPONENTS: readonly ["gateway", "ai", "images", "image-search", "config", "email", "email-inbound", "email-sending", "database", "workers", "domains", "dns", "analytics", "country", "access", "r2", "kv", "github"];
|
|
3
3
|
export type Component = (typeof COMPONENTS)[number];
|
|
4
4
|
export declare const allowedSchemas: {
|
|
5
5
|
gateway: z.ZodObject<{
|
|
@@ -96,6 +96,7 @@ export declare const capabilitySchema: z.ZodObject<{
|
|
|
96
96
|
ai: "ai";
|
|
97
97
|
analytics: "analytics";
|
|
98
98
|
config: "config";
|
|
99
|
+
country: "country";
|
|
99
100
|
database: "database";
|
|
100
101
|
dns: "dns";
|
|
101
102
|
domains: "domains";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mccaskie-labs/workbench-config",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.16",
|
|
4
4
|
"description": "Workbench app configuration: WORKBENCH_ENV, typed variables that fail by name, secrets that are never printed, and the capabilities manifest.",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"type": "module",
|