@cat-factory/prompt-fragments 0.14.23 → 0.15.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 +24 -3
- package/dist/collections/design.d.ts.map +1 -1
- package/dist/collections/design.js +1 -0
- package/dist/collections/design.js.map +1 -1
- package/dist/collections/migration.d.ts.map +1 -1
- package/dist/collections/migration.js +3 -0
- package/dist/collections/migration.js.map +1 -1
- package/dist/collections/node.d.ts.map +1 -1
- package/dist/collections/node.js +2 -0
- package/dist/collections/node.js.map +1 -1
- package/dist/collections/react.d.ts.map +1 -1
- package/dist/collections/react.js +1 -0
- package/dist/collections/react.js.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -9,14 +9,14 @@ tenant-scoped [prompt-fragment library](../../docs/adr/0006-prompt-fragment-libr
|
|
|
9
9
|
## What's here
|
|
10
10
|
|
|
11
11
|
- `src/collections/*.ts` — fragments authored per topic. Today: `node`, `react`,
|
|
12
|
-
`acceptance`. Each exports an array of `PromptFragment`.
|
|
12
|
+
`acceptance`, `design`, `style`, `migration`. Each exports an array of `PromptFragment`.
|
|
13
13
|
- `src/index.ts` — merges the collections into a single `FRAGMENTS` registry plus
|
|
14
14
|
`FRAGMENTS_BY_ID` and `getFragment(id)` for O(1) lookup during composition.
|
|
15
15
|
|
|
16
16
|
A `PromptFragment` (shape defined in [`@cat-factory/contracts`](../contracts))
|
|
17
17
|
carries an `id`, `version`, `title`, optional `category`, a `summary` (used by the
|
|
18
|
-
relevance selector), the `body` (injected text),
|
|
19
|
-
hint (`blockTypes` / `agentKinds`).
|
|
18
|
+
relevance selector), the `body` (injected text), an optional condensed `brief`
|
|
19
|
+
(see below), and an optional `appliesTo` hint (`blockTypes` / `agentKinds`).
|
|
20
20
|
|
|
21
21
|
## How it's used
|
|
22
22
|
|
|
@@ -34,6 +34,27 @@ hint (`blockTypes` / `agentKinds`).
|
|
|
34
34
|
suppressed by higher tiers. See
|
|
35
35
|
[ADR 0006](../../docs/adr/0006-prompt-fragment-library.md).
|
|
36
36
|
|
|
37
|
+
### Two-tier bodies: `body` and `brief`
|
|
38
|
+
|
|
39
|
+
An **implementer** kind (`coder` / `fixer` / `ci-fixer` / `conflict-resolver` — the kinds
|
|
40
|
+
carrying the `brief-standards` trait) runs a long agentic loop whose system prompt, standards
|
|
41
|
+
included, is re-sent on **every turn**. Those kinds fold a fragment's optional `brief` — the
|
|
42
|
+
same standard stated tersely — instead of its full `body`. Reviewer / planner / investigator
|
|
43
|
+
kinds keep the full text: they run few turns and benefit from it when judging built work.
|
|
44
|
+
|
|
45
|
+
Two rules govern authoring one:
|
|
46
|
+
|
|
47
|
+
- **A `brief` must not drop a rule, only its elaboration.** It is the same standard compressed,
|
|
48
|
+
not a subset — an agent folding the brief is held to everything the body demands.
|
|
49
|
+
- **`brief` travels WITH the body it condenses** and is never re-resolved by id downstream. A
|
|
50
|
+
higher tier that overrides a built-in id supplies no brief (managed rows have no such column),
|
|
51
|
+
so the override's own full `body` is folded — never the built-in's condensed text over a
|
|
52
|
+
tenant's standard.
|
|
53
|
+
|
|
54
|
+
Omitting `brief` is always safe: the full `body` is used for every kind, unchanged. Fragments
|
|
55
|
+
that can reach an implementer kind carry one; the ones scoped to `spec-writer` / `playwright` /
|
|
56
|
+
document-authoring kinds (which are not implementers) deliberately do not.
|
|
57
|
+
|
|
37
58
|
## Programmatic deployment seams (custom fragments + per-task-type defaults)
|
|
38
59
|
|
|
39
60
|
Two **module-global** registration seams let a deployment (local **or** hosted) extend
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"design.d.ts","sourceRoot":"","sources":["../../src/collections/design.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAA;AAQ5D,eAAO,MAAM,eAAe,EAAE,cAAc,
|
|
1
|
+
{"version":3,"file":"design.d.ts","sourceRoot":"","sources":["../../src/collections/design.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAA;AAQ5D,eAAO,MAAM,eAAe,EAAE,cAAc,EA0B3C,CAAA"}
|
|
@@ -24,6 +24,7 @@ export const designFragments = [
|
|
|
24
24
|
'- Any `### References` URL (e.g. a rendered preview) is reference-only — do not depend on fetching it; the',
|
|
25
25
|
' textual layout/text/tokens above are the authoritative description.',
|
|
26
26
|
].join('\n'),
|
|
27
|
+
brief: 'Design context: build UI from the `.cat-context/` design — follow each block’s `### Layout` for structure; reuse an existing repo component before creating one from the `### Components` inventory; honour `### Design tokens` via the project’s theme system instead of ad-hoc values; `### Text content` is copy, not markup; `### References` URLs are reference-only.',
|
|
27
28
|
appliesTo: { blockTypes: ['frontend'] },
|
|
28
29
|
},
|
|
29
30
|
];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"design.js","sourceRoot":"","sources":["../../src/collections/design.ts"],"names":[],"mappings":"AAEA,uFAAuF;AACvF,uFAAuF;AACvF,uFAAuF;AACvF,yFAAyF;AACzF,wFAAwF;AAExF,MAAM,CAAC,MAAM,eAAe,GAAqB;IAC/C;QACE,EAAE,EAAE,gBAAgB;QACpB,OAAO,EAAE,OAAO;QAChB,KAAK,EAAE,gBAAgB;QACvB,QAAQ,EAAE,QAAQ;QAClB,OAAO,EACL,yGAAyG;QAC3G,IAAI,EAAE;YACJ,8FAA8F;YAC9F,2FAA2F;YAC3F,oGAAoG;YACpG,kCAAkC;YAClC,+GAA+G;YAC/G,6GAA6G;YAC7G,4FAA4F;YAC5F,sGAAsG;YACtG,mFAAmF;YACnF,iFAAiF;YACjF,4GAA4G;YAC5G,uEAAuE;SACxE,CAAC,IAAI,CAAC,IAAI,CAAC;QACZ,SAAS,EAAE,EAAE,UAAU,EAAE,CAAC,UAAU,CAAC,EAAE;KACxC;CACF,CAAA"}
|
|
1
|
+
{"version":3,"file":"design.js","sourceRoot":"","sources":["../../src/collections/design.ts"],"names":[],"mappings":"AAEA,uFAAuF;AACvF,uFAAuF;AACvF,uFAAuF;AACvF,yFAAyF;AACzF,wFAAwF;AAExF,MAAM,CAAC,MAAM,eAAe,GAAqB;IAC/C;QACE,EAAE,EAAE,gBAAgB;QACpB,OAAO,EAAE,OAAO;QAChB,KAAK,EAAE,gBAAgB;QACvB,QAAQ,EAAE,QAAQ;QAClB,OAAO,EACL,yGAAyG;QAC3G,IAAI,EAAE;YACJ,8FAA8F;YAC9F,2FAA2F;YAC3F,oGAAoG;YACpG,kCAAkC;YAClC,+GAA+G;YAC/G,6GAA6G;YAC7G,4FAA4F;YAC5F,sGAAsG;YACtG,mFAAmF;YACnF,iFAAiF;YACjF,4GAA4G;YAC5G,uEAAuE;SACxE,CAAC,IAAI,CAAC,IAAI,CAAC;QACZ,KAAK,EACH,4WAA4W;QAC9W,SAAS,EAAE,EAAE,UAAU,EAAE,CAAC,UAAU,CAAC,EAAE;KACxC;CACF,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"migration.d.ts","sourceRoot":"","sources":["../../src/collections/migration.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAA;AAsB5D,eAAO,MAAM,kBAAkB,EAAE,cAAc,
|
|
1
|
+
{"version":3,"file":"migration.d.ts","sourceRoot":"","sources":["../../src/collections/migration.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAA;AAsB5D,eAAO,MAAM,kBAAkB,EAAE,cAAc,EA+D9C,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB,EAAE,SAAS,MAAM,EAAwC,CAAA;AAE5F;;;;;;;;GAQG;AACH,wBAAgB,uBAAuB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,EAAE,CAInE"}
|
|
@@ -34,6 +34,7 @@ export const migrationFragments = [
|
|
|
34
34
|
'- Finish the job: prove parity on the new target, flip the defaults, and REMOVE the old path. A migration that leaves the legacy code and its dependencies behind is not done.',
|
|
35
35
|
'- Record every non-obvious choice (a strategy per object, a retained legacy path, a compat posture) as an explicit decision, not a silent edit.',
|
|
36
36
|
].join('\n'),
|
|
37
|
+
brief: 'Migration discipline: establish the full blast zone (incl. transitive callers, config, jobs, CI) first; pin observable behaviour with green tests BEFORE the swap; state the compatibility posture deliberately; deliver in small increments keeping the suite green on both technologies; finish by proving parity, flipping defaults and REMOVING the old path; record every non-obvious choice as an explicit decision.',
|
|
37
38
|
appliesTo: { agentKinds: ['spec-writer', 'architect', 'coder', 'tester', 'doc-writer'] },
|
|
38
39
|
},
|
|
39
40
|
{
|
|
@@ -51,6 +52,7 @@ export const migrationFragments = [
|
|
|
51
52
|
'- Establish the baseline first: the behaviour suite must be green on the CURRENT technology before any migration code lands, so a later failure unambiguously means the swap changed behaviour.',
|
|
52
53
|
'- Be additive and traceable: add tests for behaviour that lacks coverage, name each test after the behaviour it pins, and never weaken or delete an existing assertion to make the new target pass.',
|
|
53
54
|
].join('\n'),
|
|
55
|
+
brief: 'Behaviour preservation: characterize at a seam ABOVE the swapped layer so tests survive it; assert observable outcomes, never vendor error codes, implicit ordering or locking mechanics; preserve silently-differing edge semantics (NULL vs empty, precision/rounding, collation, pagination stability, leaked identity values); keep set-based work batched, never an app-side per-row loop; baseline green on the current technology first; be additive — never weaken an assertion to make the new target pass.',
|
|
54
56
|
appliesTo: { agentKinds: ['spec-writer', 'coder', 'tester', 'playwright'] },
|
|
55
57
|
},
|
|
56
58
|
{
|
|
@@ -69,6 +71,7 @@ export const migrationFragments = [
|
|
|
69
71
|
'5. Safety nets and safeguards — the dual-target test harness, the CI legs, the rollback / compatibility posture, and the gated delivery batches.',
|
|
70
72
|
'- Be the single writer of the confidence-case document: append to it, never fork a parallel copy, and keep it the one source of the safety argument.',
|
|
71
73
|
].join('\n'),
|
|
74
|
+
brief: 'Confidence case: an evidence-backed proof a human audits, not a re-derivation — cover (1) expected blast zone plus deltas found since, (2) per-touchpoint coverage grounded in NAMED real tests and what each pins (an ungrounded row is a gap), (3) gaps/waivers each justified against the stated coverage bar, (4) risk mitigations, (5) safety nets (dual-target harness, CI legs, rollback posture, gated batches). Append to the one document; never fork a parallel copy.',
|
|
72
75
|
appliesTo: { agentKinds: ['coder', 'doc-writer'] },
|
|
73
76
|
},
|
|
74
77
|
];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"migration.js","sourceRoot":"","sources":["../../src/collections/migration.ts"],"names":[],"mappings":"AAEA,kFAAkF;AAClF,+EAA+E;AAC/E,6EAA6E;AAC7E,iFAAiF;AACjF,mFAAmF;AACnF,sFAAsF;AACtF,uEAAuE;AACvE,EAAE;AACF,qCAAqC;AACrC,mFAAmF;AACnF,kFAAkF;AAClF,kFAAkF;AAClF,gFAAgF;AAChF,0EAA0E;AAC1E,gFAAgF;AAChF,EAAE;AACF,sFAAsF;AACtF,uFAAuF;AACvF,+DAA+D;AAE/D,MAAM,CAAC,MAAM,kBAAkB,GAAqB;IAClD;QACE,EAAE,EAAE,sBAAsB;QAC1B,OAAO,EAAE,OAAO;QAChB,KAAK,EAAE,sBAAsB;QAC7B,QAAQ,EAAE,WAAW;QACrB,OAAO,EACL,sGAAsG;QACxG,IAAI,EAAE;YACJ,qCAAqC;YACrC,gJAAgJ;YAChJ,sLAAsL;YACtL,8LAA8L;YAC9L,qJAAqJ;YACrJ,uKAAuK;YACvK,gLAAgL;YAChL,iJAAiJ;SAClJ,CAAC,IAAI,CAAC,IAAI,CAAC;QACZ,SAAS,EAAE,EAAE,UAAU,EAAE,CAAC,aAAa,EAAE,WAAW,EAAE,OAAO,EAAE,QAAQ,EAAE,YAAY,CAAC,EAAE;KACzF;IACD;QACE,EAAE,EAAE,kCAAkC;QACtC,OAAO,EAAE,OAAO;QAChB,KAAK,EAAE,wBAAwB;QAC/B,QAAQ,EAAE,WAAW;QACrB,OAAO,EACL,yGAAyG;QAC3G,IAAI,EAAE;YACJ,mDAAmD;YACnD,uMAAuM;YACvM,6QA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rB,OAAO,EACL,gHAAgH;QAClH,IAAI,EAAE;YACJ,qCAAqC;YACrC,yQAAyQ;YACzQ,kHAAkH;YAClH,0OAA0O;YAC1O,oPAAoP;YACpP,+GAA+G;YAC/G,kJAAkJ;YAClJ,sJAAsJ;SACvJ,CAAC,IAAI,CAAC,IAAI,CAAC;QACZ,KAAK,EACH,kdAAkd;QACpd,SAAS,EAAE,EAAE,UAAU,EAAE,CAAC,OAAO,EAAE,YAAY,CAAC,EAAE;KACnD;CACF,CAAA;AAED;;;;;GAKG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAsB,kBAAkB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAA;AAE5F;;;;;;;;GAQG;AACH,MAAM,UAAU,uBAAuB,CAAC,SAAiB;IACvD,OAAO,kBAAkB;SACtB,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,EAAE,UAAU,IAAI,CAAC,CAAC,SAAS,CAAC,UAAU,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;SACrF,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAA;AACrB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../../src/collections/node.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAA;AAM5D,eAAO,MAAM,aAAa,EAAE,cAAc,
|
|
1
|
+
{"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../../src/collections/node.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAA;AAM5D,eAAO,MAAM,aAAa,EAAE,cAAc,EAqCzC,CAAA"}
|
package/dist/collections/node.js
CHANGED
|
@@ -16,6 +16,7 @@ export const nodeFragments = [
|
|
|
16
16
|
'- Cache expensive, idempotent computations and hot lookups; set explicit TTLs.',
|
|
17
17
|
'- Measure before optimising: profile with --prof / clinic and quote concrete numbers, not guesses.',
|
|
18
18
|
].join('\n'),
|
|
19
|
+
brief: 'Node performance: never block the event loop (offload CPU-bound work); stream large payloads instead of buffering; reuse pooled clients/connections; cache hot idempotent lookups with TTLs; profile before optimising.',
|
|
19
20
|
appliesTo: { blockTypes: ['service', 'api', 'queue', 'integration'] },
|
|
20
21
|
},
|
|
21
22
|
{
|
|
@@ -32,6 +33,7 @@ export const nodeFragments = [
|
|
|
32
33
|
'- Emit structured (JSON) logs with correlation ids; do not log secrets.',
|
|
33
34
|
'- Handle SIGTERM/SIGINT for graceful shutdown: stop accepting work, drain, then exit.',
|
|
34
35
|
].join('\n'),
|
|
36
|
+
brief: 'Node best practices: async/await with try/catch (no unhandled promises); config from env, never hard-code secrets; validate external input at the boundary; structured logs with correlation ids, never secrets; graceful SIGTERM/SIGINT shutdown.',
|
|
35
37
|
appliesTo: { blockTypes: ['service', 'api', 'queue', 'integration', 'external'] },
|
|
36
38
|
},
|
|
37
39
|
];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node.js","sourceRoot":"","sources":["../../src/collections/node.ts"],"names":[],"mappings":"AAEA,gFAAgF;AAChF,2EAA2E;AAC3E,sCAAsC;AAEtC,MAAM,CAAC,MAAM,aAAa,GAAqB;IAC7C;QACE,EAAE,EAAE,kBAAkB;QACtB,OAAO,EAAE,OAAO;QAChB,KAAK,EAAE,qBAAqB;QAC5B,QAAQ,EAAE,MAAM;QAChB,OAAO,EAAE,oEAAoE;QAC7E,IAAI,EAAE;YACJ,gCAAgC;YAChC,oGAAoG;YACpG,yFAAyF;YACzF,0FAA0F;YAC1F,gFAAgF;YAChF,oGAAoG;SACrG,CAAC,IAAI,CAAC,IAAI,CAAC;QACZ,SAAS,EAAE,EAAE,UAAU,EAAE,CAAC,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE,aA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uF;SACxF,CAAC,IAAI,CAAC,IAAI,CAAC;QACZ,KAAK,EACH,oPAAoP;QACtP,SAAS,EAAE,EAAE,UAAU,EAAE,CAAC,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE,aAAa,EAAE,UAAU,CAAC,EAAE;KAClF;CACF,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react.d.ts","sourceRoot":"","sources":["../../src/collections/react.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAA;AAI5D,eAAO,MAAM,cAAc,EAAE,cAAc,
|
|
1
|
+
{"version":3,"file":"react.d.ts","sourceRoot":"","sources":["../../src/collections/react.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAA;AAI5D,eAAO,MAAM,cAAc,EAAE,cAAc,EAmB1C,CAAA"}
|
|
@@ -14,6 +14,7 @@ export const reactFragments = [
|
|
|
14
14
|
'- Keep server state (fetched data) separate from UI state; use a data-fetching cache for it.',
|
|
15
15
|
'- Make effects depend on exactly what they use, and clean them up to avoid leaks.',
|
|
16
16
|
].join('\n'),
|
|
17
|
+
brief: 'React state: keep it local, lift only when genuinely shared; derive during render instead of duplicating; global store only for cross-cutting state; keep server state separate (data-fetching cache); effects depend on exactly what they use and clean up.',
|
|
17
18
|
appliesTo: { blockTypes: ['frontend'] },
|
|
18
19
|
},
|
|
19
20
|
];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react.js","sourceRoot":"","sources":["../../src/collections/react.ts"],"names":[],"mappings":"AAEA,qDAAqD;AAErD,MAAM,CAAC,MAAM,cAAc,GAAqB;IAC9C;QACE,EAAE,EAAE,wBAAwB;QAC5B,OAAO,EAAE,OAAO;QAChB,KAAK,EAAE,wBAAwB;QAC/B,QAAQ,EAAE,OAAO;QACjB,OAAO,EAAE,yEAAyE;QAClF,IAAI,EAAE;YACJ,mCAAmC;YACnC,4FAA4F;YAC5F,iFAAiF;YACjF,gGAAgG;YAChG,8FAA8F;YAC9F,mFAAmF;SACpF,CAAC,IAAI,CAAC,IAAI,CAAC;QACZ,SAAS,EAAE,EAAE,UAAU,EAAE,CAAC,UAAU,CAAC,EAAE;KACxC;CACF,CAAA"}
|
|
1
|
+
{"version":3,"file":"react.js","sourceRoot":"","sources":["../../src/collections/react.ts"],"names":[],"mappings":"AAEA,qDAAqD;AAErD,MAAM,CAAC,MAAM,cAAc,GAAqB;IAC9C;QACE,EAAE,EAAE,wBAAwB;QAC5B,OAAO,EAAE,OAAO;QAChB,KAAK,EAAE,wBAAwB;QAC/B,QAAQ,EAAE,OAAO;QACjB,OAAO,EAAE,yEAAyE;QAClF,IAAI,EAAE;YACJ,mCAAmC;YACnC,4FAA4F;YAC5F,iFAAiF;YACjF,gGAAgG;YAChG,8FAA8F;YAC9F,mFAAmF;SACpF,CAAC,IAAI,CAAC,IAAI,CAAC;QACZ,KAAK,EACH,8PAA8P;QAChQ,SAAS,EAAE,EAAE,UAAU,EAAE,CAAC,UAAU,CAAC,EAAE;KACxC;CACF,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cat-factory/prompt-fragments",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.15.0",
|
|
4
4
|
"description": "Curated, versioned best-practice prompt fragments injected into agent system prompts.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"access": "public"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@cat-factory/contracts": "0.
|
|
27
|
+
"@cat-factory/contracts": "0.177.0"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"typescript": "7.0.2",
|