@contractspec/lib.product-intent-utils 3.7.6 → 3.7.10

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 CHANGED
@@ -1,41 +1,64 @@
1
1
  # @contractspec/lib.product-intent-utils
2
2
 
3
- Website: https://contractspec.io/
3
+ Website: https://contractspec.io
4
4
 
5
- Utilities for the product-intent workflow: prompt builders, evidence formatting, and strict JSON validators aligned with ContractSpec's product-intent contracts.
5
+ **Prompt builders and validators for product-intent workflows.**
6
6
 
7
- ## What it provides
7
+ ## What It Provides
8
8
 
9
- - Evidence normalization helpers for LLM prompts.
10
- - Prompt builders for insights, opportunity briefs, patch intents, impacts, and task packs.
11
- - Validators that enforce structure, citation correctness, and bounds on model output.
9
+ - **Layer**: lib.
10
+ - **Consumers**: module.product-intent-core, bundles.
11
+ - Related ContractSpec packages include `@contractspec/lib.contracts-integrations`, `@contractspec/lib.contracts-spec`, `@contractspec/lib.schema`, `@contractspec/tool.bun`, `@contractspec/tool.typescript`.
12
+ - Related ContractSpec packages include `@contractspec/lib.contracts-integrations`, `@contractspec/lib.contracts-spec`, `@contractspec/lib.schema`, `@contractspec/tool.bun`, `@contractspec/tool.typescript`.
12
13
 
13
14
  ## Installation
14
15
 
15
- ```bash
16
- bun add @contractspec/lib.product-intent-utils
17
- ```
16
+ `npm install @contractspec/lib.product-intent-utils`
17
+
18
+ or
19
+
20
+ `bun add @contractspec/lib.product-intent-utils`
18
21
 
19
22
  ## Usage
20
23
 
21
- ```ts
22
- import {
23
- formatEvidenceForModel,
24
- promptExtractInsights,
25
- validateInsightExtraction,
26
- } from "@contractspec/lib.product-intent-utils";
27
- import type { EvidenceChunk } from "@contractspec/lib.contracts-spec/product-intent/types";
28
-
29
- const chunks: EvidenceChunk[] = [
30
- { chunkId: "INT-001#c_00", text: "...", meta: { persona: "admin" } },
31
- ];
32
-
33
- const evidenceJSON = formatEvidenceForModel(chunks);
34
- const prompt = promptExtractInsights({
35
- question: "How do we improve activation?",
36
- evidenceJSON,
37
- });
38
-
39
- // modelOutput is the raw JSON string returned by the LLM
40
- const insights = validateInsightExtraction(modelOutput, chunks);
41
- ```
24
+ Import the root entrypoint from `@contractspec/lib.product-intent-utils`, or choose a documented subpath when you only need one part of the package surface.
25
+
26
+ ## Architecture
27
+
28
+ - `src/impact-engine.ts` is part of the package's public or composition surface.
29
+ - `src/index.ts` is the root public barrel and package entrypoint.
30
+ - `src/project-management-sync.ts` is part of the package's public or composition surface.
31
+ - `src/prompts.ts` is part of the package's public or composition surface.
32
+ - `src/ticket-pipeline-runner.ts` is part of the package's public or composition surface.
33
+ - `src/ticket-pipeline.ts` is part of the package's public or composition surface.
34
+ - `src/ticket-prompts.ts` is part of the package's public or composition surface.
35
+
36
+ ## Public Entry Points
37
+
38
+ - Export `.` resolves through `./src/index.ts`.
39
+
40
+ ## Local Commands
41
+
42
+ - `bun run dev` contractspec-bun-build dev
43
+ - `bun run build` — bun run prebuild && bun run build:bundle && bun run build:types
44
+ - `bun run test` — bun test
45
+ - `bun run lint` — bun lint:fix
46
+ - `bun run lint:check` — biome check .
47
+ - `bun run lint:fix` — biome check --write --unsafe --only=nursery/useSortedClasses . && biome check --write .
48
+ - `bun run typecheck` — tsc --noEmit
49
+ - `bun run publish:pkg` — bun publish --tolerate-republish --ignore-scripts --verbose
50
+ - `bun run publish:pkg:canary` — bun publish:pkg --tag canary
51
+ - `bun run clean` — rimraf dist .turbo
52
+ - `bun run build:bundle` — contractspec-bun-build transpile
53
+ - `bun run build:types` — contractspec-bun-build types
54
+ - `bun run prebuild` — contractspec-bun-build prebuild
55
+
56
+ ## Recent Updates
57
+
58
+ - Replace eslint+prettier by biomejs to optimize speed.
59
+
60
+ ## Notes
61
+
62
+ - Prompt templates directly affect AI output quality — test changes against representative inputs.
63
+ - Validation schemas must match contracts-spec definitions; drift causes silent mismatches.
64
+ - Changes here propagate to product-intent-core and all dependent bundles.