@cat-factory/prompt-fragments 0.6.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Igor Savin
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,42 @@
1
+ # @cat-factory/prompt-fragments
2
+
3
+ The **built-in tier** of best-practice prompt fragments — small, curated guidance
4
+ snippets that get folded into an agent's system prompt at run time
5
+ (`composeSystemPrompt`). This package is **plain, build-static data**: no I/O, no
6
+ framework. It is the source of truth for the shipped defaults and the seed for the
7
+ tenant-scoped [prompt-fragment library](../../docs/adr/0006-prompt-fragment-library.md).
8
+
9
+ ## What's here
10
+
11
+ - `src/collections/*.ts` — fragments authored per topic. Today: `node`, `react`,
12
+ `acceptance`. Each exports an array of `PromptFragment`.
13
+ - `src/index.ts` — merges the collections into a single `FRAGMENTS` registry plus
14
+ `FRAGMENTS_BY_ID` and `getFragment(id)` for O(1) lookup during composition.
15
+
16
+ A `PromptFragment` (shape defined in [`@cat-factory/contracts`](../contracts))
17
+ carries an `id`, `version`, `title`, optional `category`, a `summary` (used by the
18
+ relevance selector), the `body` (injected text), and an optional `appliesTo`
19
+ hint (`blockTypes` / `agentKinds`).
20
+
21
+ ## How it's used
22
+
23
+ - The Worker serves this catalog **read-only** at `GET /prompt-fragments`; the SPA
24
+ shows it in the per-block fragment picker.
25
+ - A block stores selected `fragmentIds[]`; at run time core composes the chosen
26
+ bodies into the system prompt.
27
+ - When the optional library is enabled, this becomes the **built-in tier** of a
28
+ three-tier merge (built-in ∪ account ∪ workspace); ids here can be shadowed or
29
+ suppressed by higher tiers. See
30
+ [ADR 0006](../../docs/adr/0006-prompt-fragment-library.md).
31
+
32
+ ## Adding a collection
33
+
34
+ 1. Create `src/collections/<topic>.ts` and export an array of `PromptFragment`.
35
+ 2. Spread it into `FRAGMENTS` in `src/index.ts`.
36
+ 3. Keep ids **globally unique and stable** — blocks persist them, so a renamed id
37
+ silently drops a selection (unknown ids are skipped, never error).
38
+
39
+ ```bash
40
+ pnpm --filter @cat-factory/prompt-fragments build # tsc → dist/
41
+ pnpm --filter @cat-factory/prompt-fragments typecheck
42
+ ```
@@ -0,0 +1,3 @@
1
+ import type { PromptFragment } from '@cat-factory/contracts';
2
+ export declare const acceptanceFragments: PromptFragment[];
3
+ //# sourceMappingURL=acceptance.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"acceptance.d.ts","sourceRoot":"","sources":["../../src/collections/acceptance.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAA;AAU5D,eAAO,MAAM,mBAAmB,EAAE,cAAc,EAuD/C,CAAA"}
@@ -0,0 +1,63 @@
1
+ // Best-practice fragments for the acceptance-testing track: authoring the
2
+ // structured Given/When/Then acceptance scenarios as part of the service spec (the
3
+ // `spec-writer`), and turning the derived Gherkin into runnable tests (the
4
+ // `playwright` step). The runnable-tests step uses Playwright for user-facing blocks
5
+ // and the project's own test framework for backend blocks, so there is one fragment
6
+ // per surface, scoped by block type. Selected per block, these bodies are injected
7
+ // verbatim into the relevant agents' system prompts.
8
+ export const acceptanceFragments = [
9
+ {
10
+ id: 'acceptance.scenarios',
11
+ version: '1.0.0',
12
+ title: 'Acceptance scenarios',
13
+ category: 'Acceptance testing',
14
+ summary: 'Given/When/Then scenarios tied to requirements, asserting observable behaviour.',
15
+ body: [
16
+ 'Acceptance scenario standards:',
17
+ '- Trace every scenario back to a stated requirement; do not test behaviour nobody asked for.',
18
+ '- Write each scenario as a titled Given / When / Then with a single clear When and concrete, observable Then assertions.',
19
+ '- Cover the happy path, the meaningful alternative flows, error handling and boundary conditions — in that order of priority.',
20
+ '- Keep scenarios independent and deterministic: each sets up its own state and asserts user-visible outcomes, never internals.',
21
+ '- Call out any requirement that is ambiguous or untestable instead of guessing at the intended behaviour.',
22
+ ].join('\n'),
23
+ appliesTo: { agentKinds: ['spec-writer'] },
24
+ },
25
+ {
26
+ id: 'playwright.e2e',
27
+ version: '1.0.0',
28
+ title: 'Playwright end-to-end tests',
29
+ category: 'Acceptance testing',
30
+ summary: 'User-facing locators, web-first assertions, isolated and idempotent test files.',
31
+ body: [
32
+ 'Playwright end-to-end test standards:',
33
+ '- Map one `test` to one acceptance scenario and name it after the scenario so coverage is traceable.',
34
+ '- Be additive: only add tests for scenarios that lack one; never duplicate or silently rewrite an existing test.',
35
+ '- Select elements by user-facing locators (getByRole, getByLabel, getByText), not brittle CSS or XPath.',
36
+ '- Rely on web-first auto-retrying assertions (expect(locator)…) and await every action; never use fixed sleeps.',
37
+ '- Keep each test isolated and deterministic — fresh state per test, no ordering dependencies between tests.',
38
+ '- Target the environment URL from the run context and read credentials from the harness; never hard-code secrets or hosts.',
39
+ ].join('\n'),
40
+ appliesTo: { blockTypes: ['frontend', 'environment'], agentKinds: ['playwright'] },
41
+ },
42
+ {
43
+ id: 'acceptance.backend-tests',
44
+ version: '1.0.0',
45
+ title: 'Backend acceptance tests',
46
+ category: 'Acceptance testing',
47
+ summary: "Acceptance tests in the project's own framework, driven through public backend interfaces.",
48
+ body: [
49
+ 'Backend acceptance test standards:',
50
+ "- Write the tests with the project's existing test framework — discover it from the repo (test config, dev dependencies, the tests already present); do not introduce a new framework, and do not use Playwright or a browser for behaviour with no UI.",
51
+ '- Map one test to one acceptance scenario and name it after the scenario so coverage is traceable.',
52
+ '- Be additive: only add tests for scenarios that lack one; never duplicate or silently rewrite an existing test.',
53
+ '- Drive the system through its outermost public interface (HTTP/API calls, queue messages, exported functions) and assert on observable behaviour, never on internals.',
54
+ '- Keep each test isolated and deterministic — fresh state per test, no ordering dependencies; await async work instead of fixed sleeps.',
55
+ '- Target the system at the URL / entry point from the run context and read credentials from the harness; never hard-code secrets or hosts.',
56
+ ].join('\n'),
57
+ appliesTo: {
58
+ blockTypes: ['service', 'api', 'database', 'queue', 'integration', 'external'],
59
+ agentKinds: ['playwright'],
60
+ },
61
+ },
62
+ ];
63
+ //# sourceMappingURL=acceptance.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"acceptance.js","sourceRoot":"","sources":["../../src/collections/acceptance.ts"],"names":[],"mappings":"AAEA,0EAA0E;AAC1E,mFAAmF;AACnF,2EAA2E;AAC3E,qFAAqF;AACrF,oFAAoF;AACpF,mFAAmF;AACnF,qDAAqD;AAErD,MAAM,CAAC,MAAM,mBAAmB,GAAqB;IACnD;QACE,EAAE,EAAE,sBAAsB;QAC1B,OAAO,EAAE,OAAO;QAChB,KAAK,EAAE,sBAAsB;QAC7B,QAAQ,EAAE,oBAAoB;QAC9B,OAAO,EAAE,iFAAiF;QAC1F,IAAI,EAAE;YACJ,gCAAgC;YAChC,8FAA8F;YAC9F,0HAA0H;YAC1H,+HAA+H;YAC/H,gIAAgI;YAChI,2GAA2G;SAC5G,CAAC,IAAI,CAAC,IAAI,CAAC;QACZ,SAAS,EAAE,EAAE,UAAU,EAAE,CAAC,aAAa,CAAC,EAAE;KAC3C;IACD;QACE,EAAE,EAAE,gBAAgB;QACpB,OAAO,EAAE,OAAO;QAChB,KAAK,EAAE,6BAA6B;QACpC,QAAQ,EAAE,oBAAoB;QAC9B,OAAO,EAAE,iFAAiF;QAC1F,IAAI,EAAE;YACJ,uCAAuC;YACvC,sGAAsG;YACtG,kHAAkH;YAClH,yGAAyG;YACzG,iHAAiH;YACjH,6GAA6G;YAC7G,4HAA4H;SAC7H,CAAC,IAAI,CAAC,IAAI,CAAC;QACZ,SAAS,EAAE,EAAE,UAAU,EAAE,CAAC,UAAU,EAAE,aAAa,CAAC,EAAE,UAAU,EAAE,CAAC,YAAY,CAAC,EAAE;KACnF;IACD;QACE,EAAE,EAAE,0BAA0B;QAC9B,OAAO,EAAE,OAAO;QAChB,KAAK,EAAE,0BAA0B;QACjC,QAAQ,EAAE,oBAAoB;QAC9B,OAAO,EACL,4FAA4F;QAC9F,IAAI,EAAE;YACJ,oCAAoC;YACpC,yPAAyP;YACzP,oGAAoG;YACpG,kHAAkH;YAClH,wKAAwK;YACxK,yIAAyI;YACzI,4IAA4I;SAC7I,CAAC,IAAI,CAAC,IAAI,CAAC;QACZ,SAAS,EAAE;YACT,UAAU,EAAE,CAAC,SAAS,EAAE,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,aAAa,EAAE,UAAU,CAAC;YAC9E,UAAU,EAAE,CAAC,YAAY,CAAC;SAC3B;KACF;CACF,CAAA"}
@@ -0,0 +1,3 @@
1
+ import type { PromptFragment } from '@cat-factory/contracts';
2
+ export declare const nodeFragments: PromptFragment[];
3
+ //# sourceMappingURL=node.d.ts.map
@@ -0,0 +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,EAiCzC,CAAA"}
@@ -0,0 +1,38 @@
1
+ // Best-practice fragments for Node.js / backend work. Each fragment's `body` is
2
+ // injected verbatim into the agent system prompt when selected, so keep it
3
+ // concise, imperative and standalone.
4
+ export const nodeFragments = [
5
+ {
6
+ id: 'node.performance',
7
+ version: '1.0.0',
8
+ title: 'Node.js performance',
9
+ category: 'Node',
10
+ summary: 'Avoid event-loop blocking, stream large payloads, cache hot paths.',
11
+ body: [
12
+ 'Node.js performance standards:',
13
+ '- Never block the event loop: move CPU-bound work to worker threads or break it into async chunks.',
14
+ '- Prefer streaming (Readable/Writable streams) over buffering large payloads in memory.',
15
+ '- Reuse connections and clients (HTTP agents, DB pools); do not create them per request.',
16
+ '- Cache expensive, idempotent computations and hot lookups; set explicit TTLs.',
17
+ '- Measure before optimising: profile with --prof / clinic and quote concrete numbers, not guesses.',
18
+ ].join('\n'),
19
+ appliesTo: { blockTypes: ['service', 'api', 'queue', 'integration'] },
20
+ },
21
+ {
22
+ id: 'node.best-practices',
23
+ version: '1.0.0',
24
+ title: 'Node.js best practices',
25
+ category: 'Node',
26
+ summary: 'Async/await error handling, config via env, structured logging, graceful shutdown.',
27
+ body: [
28
+ 'Node.js best practices:',
29
+ '- Use async/await with explicit try/catch; never leave promises unhandled.',
30
+ '- Read configuration from the environment; never hard-code secrets or hosts.',
31
+ '- Validate all external input at the boundary before it reaches domain logic.',
32
+ '- Emit structured (JSON) logs with correlation ids; do not log secrets.',
33
+ '- Handle SIGTERM/SIGINT for graceful shutdown: stop accepting work, drain, then exit.',
34
+ ].join('\n'),
35
+ appliesTo: { blockTypes: ['service', 'api', 'queue', 'integration', 'external'] },
36
+ },
37
+ ];
38
+ //# sourceMappingURL=node.js.map
@@ -0,0 +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,aAAa,CAAC,EAAE;KACtE;IACD;QACE,EAAE,EAAE,qBAAqB;QACzB,OAAO,EAAE,OAAO;QAChB,KAAK,EAAE,wBAAwB;QAC/B,QAAQ,EAAE,MAAM;QAChB,OAAO,EAAE,oFAAoF;QAC7F,IAAI,EAAE;YACJ,yBAAyB;YACzB,4EAA4E;YAC5E,8EAA8E;YAC9E,+EAA+E;YAC/E,yEAAyE;YACzE,uFAAuF;SACxF,CAAC,IAAI,CAAC,IAAI,CAAC;QACZ,SAAS,EAAE,EAAE,UAAU,EAAE,CAAC,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE,aAAa,EAAE,UAAU,CAAC,EAAE;KAClF;CACF,CAAA"}
@@ -0,0 +1,3 @@
1
+ import type { PromptFragment } from '@cat-factory/contracts';
2
+ export declare const reactFragments: PromptFragment[];
3
+ //# sourceMappingURL=react.d.ts.map
@@ -0,0 +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,EAiB1C,CAAA"}
@@ -0,0 +1,20 @@
1
+ // Best-practice fragments for React / frontend work.
2
+ export const reactFragments = [
3
+ {
4
+ id: 'react.state-management',
5
+ version: '1.0.0',
6
+ title: 'React state management',
7
+ category: 'React',
8
+ summary: 'Keep state local, lift only when shared, derive instead of duplicating.',
9
+ body: [
10
+ 'React state management standards:',
11
+ '- Keep state as local as possible; lift it up only when two components genuinely share it.',
12
+ '- Derive values during render instead of storing duplicated/denormalised state.',
13
+ '- Reach for a global store only for truly cross-cutting state; prefer context/props otherwise.',
14
+ '- Keep server state (fetched data) separate from UI state; use a data-fetching cache for it.',
15
+ '- Make effects depend on exactly what they use, and clean them up to avoid leaks.',
16
+ ].join('\n'),
17
+ appliesTo: { blockTypes: ['frontend'] },
18
+ },
19
+ ];
20
+ //# sourceMappingURL=react.js.map
@@ -0,0 +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"}
@@ -0,0 +1,23 @@
1
+ import type { PromptFragment } from '@cat-factory/contracts';
2
+ export type { PromptFragment } from '@cat-factory/contracts';
3
+ export declare const FRAGMENTS: PromptFragment[];
4
+ /** Fragments keyed by id for O(1) lookup during prompt composition. */
5
+ export declare const FRAGMENTS_BY_ID: ReadonlyMap<string, PromptFragment>;
6
+ /** Register a custom prompt fragment into the universal pool. Re-registering an id replaces it. */
7
+ export declare function registerPromptFragment(fragment: PromptFragment): void;
8
+ /** Register several custom prompt fragments at once. */
9
+ export declare function registerPromptFragments(fragments: Iterable<PromptFragment>): void;
10
+ /** Drop all registered fragments. Intended for tests that exercise registration. */
11
+ export declare function clearRegisteredPromptFragments(): void;
12
+ /**
13
+ * The universal fragment pool: the built-in catalog plus any deployment-registered
14
+ * fragments, with a registered id shadowing the built-in of the same id. This is what
15
+ * the catalog endpoint serves and what a service's fragment selection is drawn from.
16
+ */
17
+ export declare function universalFragments(): PromptFragment[];
18
+ /**
19
+ * Resolve a fragment by id, or `undefined` if no such fragment exists. Checks the
20
+ * deployment-registered fragments first (override-by-id) then the built-in catalog.
21
+ */
22
+ export declare function getFragment(id: string): PromptFragment | undefined;
23
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAA;AAc5D,YAAY,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAA;AAE5D,eAAO,MAAM,SAAS,EAAE,cAAc,EAIrC,CAAA;AAED,uEAAuE;AACvE,eAAO,MAAM,eAAe,EAAE,WAAW,CAAC,MAAM,EAAE,cAAc,CAE/D,CAAA;AAYD,mGAAmG;AACnG,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,cAAc,GAAG,IAAI,CAErE;AAED,wDAAwD;AACxD,wBAAgB,uBAAuB,CAAC,SAAS,EAAE,QAAQ,CAAC,cAAc,CAAC,GAAG,IAAI,CAEjF;AAED,oFAAoF;AACpF,wBAAgB,8BAA8B,IAAI,IAAI,CAErD;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,IAAI,cAAc,EAAE,CAMrD;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,EAAE,EAAE,MAAM,GAAG,cAAc,GAAG,SAAS,CAElE"}
package/dist/index.js ADDED
@@ -0,0 +1,55 @@
1
+ import { acceptanceFragments } from './collections/acceptance.js';
2
+ import { nodeFragments } from './collections/node.js';
3
+ import { reactFragments } from './collections/react.js';
4
+ export const FRAGMENTS = [
5
+ ...nodeFragments,
6
+ ...reactFragments,
7
+ ...acceptanceFragments,
8
+ ];
9
+ /** Fragments keyed by id for O(1) lookup during prompt composition. */
10
+ export const FRAGMENTS_BY_ID = new Map(FRAGMENTS.map((fragment) => [fragment.id, fragment]));
11
+ // Installation-level extension point for the universal fragment pool, mirroring the
12
+ // custom-agent (`registerAgentKind`) and model-provider registry seams. A deployment —
13
+ // e.g. a proprietary org package — adds extra best-practice fragments once at startup
14
+ // (an import side effect); every `getFragment` lookup and the `GET /prompt-fragments`
15
+ // catalog then see them, so a service's fragment selection can draw on them without the
16
+ // core packages knowing they exist. Registering an id that already exists in the
17
+ // built-in catalog overrides it (later registration wins), so a deployment can refine a
18
+ // shipped fragment's body in place.
19
+ const registered = new Map();
20
+ /** Register a custom prompt fragment into the universal pool. Re-registering an id replaces it. */
21
+ export function registerPromptFragment(fragment) {
22
+ registered.set(fragment.id, fragment);
23
+ }
24
+ /** Register several custom prompt fragments at once. */
25
+ export function registerPromptFragments(fragments) {
26
+ for (const fragment of fragments)
27
+ registerPromptFragment(fragment);
28
+ }
29
+ /** Drop all registered fragments. Intended for tests that exercise registration. */
30
+ export function clearRegisteredPromptFragments() {
31
+ registered.clear();
32
+ }
33
+ /**
34
+ * The universal fragment pool: the built-in catalog plus any deployment-registered
35
+ * fragments, with a registered id shadowing the built-in of the same id. This is what
36
+ * the catalog endpoint serves and what a service's fragment selection is drawn from.
37
+ */
38
+ export function universalFragments() {
39
+ if (registered.size === 0)
40
+ return [...FRAGMENTS];
41
+ const byId = new Map();
42
+ for (const fragment of FRAGMENTS)
43
+ byId.set(fragment.id, fragment);
44
+ for (const fragment of registered.values())
45
+ byId.set(fragment.id, fragment);
46
+ return [...byId.values()];
47
+ }
48
+ /**
49
+ * Resolve a fragment by id, or `undefined` if no such fragment exists. Checks the
50
+ * deployment-registered fragments first (override-by-id) then the built-in catalog.
51
+ */
52
+ export function getFragment(id) {
53
+ return registered.get(id) ?? FRAGMENTS_BY_ID.get(id);
54
+ }
55
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAA;AACjE,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAA;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAA;AAavD,MAAM,CAAC,MAAM,SAAS,GAAqB;IACzC,GAAG,aAAa;IAChB,GAAG,cAAc;IACjB,GAAG,mBAAmB;CACvB,CAAA;AAED,uEAAuE;AACvE,MAAM,CAAC,MAAM,eAAe,GAAwC,IAAI,GAAG,CACzE,SAAS,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,QAAQ,CAAC,EAAE,EAAE,QAAQ,CAAC,CAAC,CACrD,CAAA;AAED,oFAAoF;AACpF,uFAAuF;AACvF,sFAAsF;AACtF,sFAAsF;AACtF,wFAAwF;AACxF,iFAAiF;AACjF,wFAAwF;AACxF,oCAAoC;AACpC,MAAM,UAAU,GAAG,IAAI,GAAG,EAA0B,CAAA;AAEpD,mGAAmG;AACnG,MAAM,UAAU,sBAAsB,CAAC,QAAwB;IAC7D,UAAU,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,EAAE,QAAQ,CAAC,CAAA;AACvC,CAAC;AAED,wDAAwD;AACxD,MAAM,UAAU,uBAAuB,CAAC,SAAmC;IACzE,KAAK,MAAM,QAAQ,IAAI,SAAS;QAAE,sBAAsB,CAAC,QAAQ,CAAC,CAAA;AACpE,CAAC;AAED,oFAAoF;AACpF,MAAM,UAAU,8BAA8B;IAC5C,UAAU,CAAC,KAAK,EAAE,CAAA;AACpB,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,kBAAkB;IAChC,IAAI,UAAU,CAAC,IAAI,KAAK,CAAC;QAAE,OAAO,CAAC,GAAG,SAAS,CAAC,CAAA;IAChD,MAAM,IAAI,GAAG,IAAI,GAAG,EAA0B,CAAA;IAC9C,KAAK,MAAM,QAAQ,IAAI,SAAS;QAAE,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,EAAE,QAAQ,CAAC,CAAA;IACjE,KAAK,MAAM,QAAQ,IAAI,UAAU,CAAC,MAAM,EAAE;QAAE,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,EAAE,QAAQ,CAAC,CAAA;IAC3E,OAAO,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,CAAA;AAC3B,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,WAAW,CAAC,EAAU;IACpC,OAAO,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,eAAe,CAAC,GAAG,CAAC,EAAE,CAAC,CAAA;AACtD,CAAC"}
package/package.json ADDED
@@ -0,0 +1,31 @@
1
+ {
2
+ "name": "@cat-factory/prompt-fragments",
3
+ "version": "0.6.0",
4
+ "description": "Curated, versioned best-practice prompt fragments injected into agent system prompts.",
5
+ "files": [
6
+ "dist"
7
+ ],
8
+ "type": "module",
9
+ "main": "./dist/index.js",
10
+ "types": "./dist/index.d.ts",
11
+ "exports": {
12
+ ".": {
13
+ "types": "./dist/index.d.ts",
14
+ "default": "./dist/index.js"
15
+ },
16
+ "./package.json": "./package.json"
17
+ },
18
+ "publishConfig": {
19
+ "access": "public"
20
+ },
21
+ "dependencies": {
22
+ "@cat-factory/contracts": "0.6.0"
23
+ },
24
+ "devDependencies": {
25
+ "typescript": "7.0.1-rc"
26
+ },
27
+ "scripts": {
28
+ "build": "tsc -b tsconfig.build.json",
29
+ "typecheck": "tsc -p tsconfig.json --noEmit"
30
+ }
31
+ }