@contractspec/example.product-intent 3.7.5 → 3.7.7
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/.turbo/turbo-build.log +2 -2
- package/AGENTS.md +44 -20
- package/CHANGELOG.md +12 -0
- package/README.md +60 -44
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/load-evidence.js +1 -1
- package/dist/node/index.js +1 -1
- package/dist/node/load-evidence.js +1 -1
- package/dist/node/posthog-signals.js +1 -1
- package/dist/node/script.js +1 -1
- package/dist/node/sync-actions.js +4 -4
- package/dist/posthog-signals.d.ts +1 -1
- package/dist/posthog-signals.js +1 -1
- package/dist/script.js +1 -1
- package/dist/sync-actions.js +4 -4
- package/package.json +11 -10
- package/src/docs/product-intent.docblock.ts +21 -21
- package/src/example.ts +26 -26
- package/src/index.ts +12 -12
- package/src/load-evidence.test.ts +6 -6
- package/src/load-evidence.ts +49 -49
- package/src/posthog-signals.ts +253 -253
- package/src/product-intent.feature.ts +13 -13
- package/src/script.ts +191 -191
- package/src/sync-actions.ts +185 -185
- package/tsconfig.json +7 -7
- package/tsdown.config.js +7 -13
package/.turbo/turbo-build.log
CHANGED
|
@@ -3,7 +3,7 @@ $ bun run prebuild && bun run build:bundle && bun run build:types
|
|
|
3
3
|
$ contractspec-bun-build prebuild
|
|
4
4
|
$ contractspec-bun-build transpile
|
|
5
5
|
[contractspec-bun-build] transpile target=bun root=src entries=9 noBundle=false
|
|
6
|
-
Bundled 9 modules in
|
|
6
|
+
Bundled 9 modules in 33ms
|
|
7
7
|
|
|
8
8
|
docs/index.js 1.41 KB (entry point)
|
|
9
9
|
./sync-actions.js 15.97 KB (entry point)
|
|
@@ -16,7 +16,7 @@ Bundled 9 modules in 59ms
|
|
|
16
16
|
./posthog-signals.js 7.59 KB (entry point)
|
|
17
17
|
|
|
18
18
|
[contractspec-bun-build] transpile target=node root=src entries=9 noBundle=false
|
|
19
|
-
Bundled 9 modules in
|
|
19
|
+
Bundled 9 modules in 27ms
|
|
20
20
|
|
|
21
21
|
docs/index.js 1.40 KB (entry point)
|
|
22
22
|
./sync-actions.js 15.97 KB (entry point)
|
package/AGENTS.md
CHANGED
|
@@ -1,33 +1,57 @@
|
|
|
1
|
-
# AI Agent Guide
|
|
1
|
+
# AI Agent Guide — `@contractspec/example.product-intent`
|
|
2
2
|
|
|
3
3
|
Scope: `packages/examples/product-intent/*`
|
|
4
4
|
|
|
5
|
-
Product intent example: evidence ingestion
|
|
5
|
+
Product intent example: evidence ingestion and prompt-ready outputs.
|
|
6
6
|
|
|
7
7
|
## Quick Context
|
|
8
8
|
|
|
9
|
-
-
|
|
10
|
-
-
|
|
9
|
+
- Layer: `example`.
|
|
10
|
+
- Package visibility: published package.
|
|
11
|
+
- Primary consumers are example explorers, template authors, and documentation readers.
|
|
12
|
+
- Related packages: `@contractspec/integration.providers-impls`, `@contractspec/lib.ai-agent`, `@contractspec/lib.analytics`, `@contractspec/lib.contracts-integrations`, `@contractspec/lib.contracts-spec`, `@contractspec/lib.product-intent-utils`, ...
|
|
11
13
|
|
|
12
|
-
##
|
|
14
|
+
## Architecture
|
|
13
15
|
|
|
14
|
-
-
|
|
15
|
-
-
|
|
16
|
-
-
|
|
17
|
-
-
|
|
16
|
+
- `src/docs/` contains docblocks and documentation-facing exports.
|
|
17
|
+
- `src/example.ts` is the runnable example entrypoint.
|
|
18
|
+
- `src/index.ts` is the root public barrel and package entrypoint.
|
|
19
|
+
- `src/load-evidence.test.ts` is part of the package's public or composition surface.
|
|
20
|
+
- `src/load-evidence.ts` is part of the package's public or composition surface.
|
|
21
|
+
- `src/posthog-signals.ts` is part of the package's public or composition surface.
|
|
22
|
+
- `src/product-intent.feature.ts` defines a feature entrypoint.
|
|
18
23
|
|
|
19
|
-
## Public
|
|
24
|
+
## Public Surface
|
|
20
25
|
|
|
21
|
-
- `.`
|
|
22
|
-
- `./
|
|
23
|
-
- `./
|
|
24
|
-
- `./
|
|
25
|
-
- `./
|
|
26
|
-
- `./
|
|
26
|
+
- Export `.` resolves through `./src/index.ts`.
|
|
27
|
+
- Export `./docs` resolves through `./src/docs/index.ts`.
|
|
28
|
+
- Export `./docs/product-intent.docblock` resolves through `./src/docs/product-intent.docblock.ts`.
|
|
29
|
+
- Export `./example` resolves through `./src/example.ts`.
|
|
30
|
+
- Export `./load-evidence` resolves through `./src/load-evidence.ts`.
|
|
31
|
+
- Export `./posthog-signals` resolves through `./src/posthog-signals.ts`.
|
|
32
|
+
- Export `./product-intent.feature` resolves through `./src/product-intent.feature.ts`.
|
|
33
|
+
- Export `./script` resolves through `./src/script.ts`.
|
|
34
|
+
- Export `./sync-actions` resolves through `./src/sync-actions.ts`.
|
|
35
|
+
|
|
36
|
+
## Guardrails
|
|
37
|
+
|
|
38
|
+
- Keep the example package demonstrative, buildable, and aligned with the exported feature surface.
|
|
39
|
+
- Do not add hidden production assumptions that are not actually implemented in the example.
|
|
40
|
+
- Changes here can affect downstream packages such as `@contractspec/integration.providers-impls`, `@contractspec/lib.ai-agent`, `@contractspec/lib.analytics`, `@contractspec/lib.contracts-integrations`, `@contractspec/lib.contracts-spec`, `@contractspec/lib.product-intent-utils`, ....
|
|
41
|
+
- Changes here can affect downstream packages such as `@contractspec/integration.providers-impls`, `@contractspec/lib.ai-agent`, `@contractspec/lib.analytics`, `@contractspec/lib.contracts-integrations`, `@contractspec/lib.contracts-spec`, `@contractspec/lib.product-intent-utils`, ...
|
|
27
42
|
|
|
28
43
|
## Local Commands
|
|
29
44
|
|
|
30
|
-
-
|
|
31
|
-
-
|
|
32
|
-
-
|
|
33
|
-
-
|
|
45
|
+
- `bun run dev` — contractspec-bun-build dev
|
|
46
|
+
- `bun run build` — bun run prebuild && bun run build:bundle && bun run build:types
|
|
47
|
+
- `bun run test` — bun test
|
|
48
|
+
- `bun run lint` — bun lint:fix
|
|
49
|
+
- `bun run lint:check` — biome check .
|
|
50
|
+
- `bun run lint:fix` — biome check --write --unsafe --only=nursery/useSortedClasses . && biome check --write .
|
|
51
|
+
- `bun run typecheck` — tsc --noEmit
|
|
52
|
+
- `bun run publish:pkg` — bun publish --tolerate-republish --ignore-scripts --verbose
|
|
53
|
+
- `bun run publish:pkg:canary` — bun publish:pkg --tag canary
|
|
54
|
+
- `bun run clean` — rimraf dist .turbo
|
|
55
|
+
- `bun run build:bundle` — contractspec-bun-build transpile
|
|
56
|
+
- `bun run build:types` — contractspec-bun-build types
|
|
57
|
+
- `bun run prebuild` — contractspec-bun-build prebuild
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @contractspec/example.product-intent
|
|
2
2
|
|
|
3
|
+
## 3.7.6
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- fix: release manifest
|
|
8
|
+
- Updated dependencies
|
|
9
|
+
- @contractspec/integration.providers-impls@3.7.6
|
|
10
|
+
- @contractspec/lib.contracts-integrations@3.7.6
|
|
11
|
+
- @contractspec/lib.product-intent-utils@3.7.6
|
|
12
|
+
- @contractspec/lib.contracts-spec@3.7.6
|
|
13
|
+
- @contractspec/lib.ai-agent@7.0.6
|
|
14
|
+
|
|
3
15
|
## 3.7.5
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -1,58 +1,74 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @contractspec/example.product-intent
|
|
2
2
|
|
|
3
|
-
Website: https://contractspec.io
|
|
3
|
+
Website: https://contractspec.io
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
**Product intent example: evidence ingestion and prompt-ready outputs.**
|
|
6
6
|
|
|
7
|
-
## What
|
|
7
|
+
## What This Demonstrates
|
|
8
8
|
|
|
9
|
-
-
|
|
10
|
-
-
|
|
11
|
-
-
|
|
12
|
-
-
|
|
13
|
-
-
|
|
14
|
-
-
|
|
9
|
+
- Evidence loading and ingestion pipeline.
|
|
10
|
+
- PostHog signal extraction for product analytics.
|
|
11
|
+
- Action synchronization across tools.
|
|
12
|
+
- Script-based execution pattern.
|
|
13
|
+
- `src/docs/` contains docblocks and documentation-facing exports.
|
|
14
|
+
- `src/docs/` contains docblocks and documentation-facing exports.
|
|
15
15
|
|
|
16
|
-
## Running
|
|
16
|
+
## Running Locally
|
|
17
17
|
|
|
18
|
-
From
|
|
18
|
+
From `packages/examples/product-intent`:
|
|
19
|
+
- `bun run dev`
|
|
20
|
+
- `bun run build`
|
|
21
|
+
- `bun run test`
|
|
22
|
+
- `bun run typecheck`
|
|
19
23
|
|
|
20
|
-
|
|
21
|
-
bun install
|
|
22
|
-
export CONTRACTSPEC_AI_PROVIDER="mistral" # or openai/anthropic/gemini/ollama
|
|
23
|
-
export MISTRAL_API_KEY="your_key" # if using mistral
|
|
24
|
-
# export OPENAI_API_KEY="your_key" # if using openai
|
|
25
|
-
# export CONTRACTSPEC_AI_MODEL="model-id" # optional override
|
|
26
|
-
# export CONTRACTSPEC_AI_TEMPERATURE="0" # default is 0 for determinism
|
|
27
|
-
# export CONTRACTSPEC_AI_MAX_ATTEMPTS="2" # retry invalid JSON
|
|
28
|
-
bun tsx packages/examples/product-intent/src/script.ts
|
|
29
|
-
```
|
|
24
|
+
## Usage
|
|
30
25
|
|
|
31
|
-
|
|
32
|
-
If validation fails, inspect the JSONL trace log and artifacts in `packages/examples/product-intent/logs/run-*/`.
|
|
26
|
+
Use `@contractspec/example.product-intent` as a reference implementation, or import its exported surfaces into a workspace that composes ContractSpec examples and bundles.
|
|
33
27
|
|
|
34
|
-
##
|
|
28
|
+
## Architecture
|
|
35
29
|
|
|
36
|
-
|
|
30
|
+
- `src/docs/` contains docblocks and documentation-facing exports.
|
|
31
|
+
- `src/example.ts` is the runnable example entrypoint.
|
|
32
|
+
- `src/index.ts` is the root public barrel and package entrypoint.
|
|
33
|
+
- `src/load-evidence.test.ts` is part of the package's public or composition surface.
|
|
34
|
+
- `src/load-evidence.ts` is part of the package's public or composition surface.
|
|
35
|
+
- `src/posthog-signals.ts` is part of the package's public or composition surface.
|
|
36
|
+
- `src/product-intent.feature.ts` defines a feature entrypoint.
|
|
37
37
|
|
|
38
|
-
|
|
39
|
-
export CONTRACTSPEC_PM_PROVIDER="linear" # or jira/notion
|
|
40
|
-
export CONTRACTSPEC_PM_DRY_RUN="true" # set to false to create real items
|
|
41
|
-
export LINEAR_API_KEY="your_key"
|
|
42
|
-
export LINEAR_TEAM_ID="team_id"
|
|
43
|
-
export LINEAR_PROJECT_ID="project_id" # optional
|
|
44
|
-
export LINEAR_LABEL_IDS="label1,label2" # optional
|
|
38
|
+
## Public Entry Points
|
|
45
39
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
40
|
+
- Export `.` resolves through `./src/index.ts`.
|
|
41
|
+
- Export `./docs` resolves through `./src/docs/index.ts`.
|
|
42
|
+
- Export `./docs/product-intent.docblock` resolves through `./src/docs/product-intent.docblock.ts`.
|
|
43
|
+
- Export `./example` resolves through `./src/example.ts`.
|
|
44
|
+
- Export `./load-evidence` resolves through `./src/load-evidence.ts`.
|
|
45
|
+
- Export `./posthog-signals` resolves through `./src/posthog-signals.ts`.
|
|
46
|
+
- Export `./product-intent.feature` resolves through `./src/product-intent.feature.ts`.
|
|
47
|
+
- Export `./script` resolves through `./src/script.ts`.
|
|
48
|
+
- Export `./sync-actions` resolves through `./src/sync-actions.ts`.
|
|
51
49
|
|
|
52
|
-
|
|
53
|
-
# export NOTION_API_KEY="secret"
|
|
54
|
-
# export NOTION_DATABASE_ID="database_id"
|
|
55
|
-
# export NOTION_SUMMARY_PARENT_PAGE_ID="parent_page_id" # optional
|
|
50
|
+
## Local Commands
|
|
56
51
|
|
|
57
|
-
bun
|
|
58
|
-
|
|
52
|
+
- `bun run dev` — contractspec-bun-build dev
|
|
53
|
+
- `bun run build` — bun run prebuild && bun run build:bundle && bun run build:types
|
|
54
|
+
- `bun run test` — bun test
|
|
55
|
+
- `bun run lint` — bun lint:fix
|
|
56
|
+
- `bun run lint:check` — biome check .
|
|
57
|
+
- `bun run lint:fix` — biome check --write --unsafe --only=nursery/useSortedClasses . && biome check --write .
|
|
58
|
+
- `bun run typecheck` — tsc --noEmit
|
|
59
|
+
- `bun run publish:pkg` — bun publish --tolerate-republish --ignore-scripts --verbose
|
|
60
|
+
- `bun run publish:pkg:canary` — bun publish:pkg --tag canary
|
|
61
|
+
- `bun run clean` — rimraf dist .turbo
|
|
62
|
+
- `bun run build:bundle` — contractspec-bun-build transpile
|
|
63
|
+
- `bun run build:types` — contractspec-bun-build types
|
|
64
|
+
- `bun run prebuild` — contractspec-bun-build prebuild
|
|
65
|
+
|
|
66
|
+
## Recent Updates
|
|
67
|
+
|
|
68
|
+
- Replace eslint+prettier by biomejs to optimize speed.
|
|
69
|
+
- Stability.
|
|
70
|
+
- Missing contract layers.
|
|
71
|
+
|
|
72
|
+
## Notes
|
|
73
|
+
|
|
74
|
+
- Works alongside `@contractspec/integration.providers-impls`, `@contractspec/lib.ai-agent`, `@contractspec/lib.analytics`, `@contractspec/lib.contracts-integrations`, `@contractspec/lib.contracts-spec`, ...
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { default as example } from './example';
|
|
2
|
-
export { DEFAULT_CHUNK_SIZE, DEFAULT_EVIDENCE_ROOT, DEFAULT_TRANSCRIPT_DIRS, loadEvidenceChunks, loadEvidenceChunksWithSignals, } from './load-evidence';
|
|
3
2
|
export type { EvidenceLoadOptions, EvidenceLoadWithSignalsOptions, } from './load-evidence';
|
|
4
|
-
export {
|
|
3
|
+
export { DEFAULT_CHUNK_SIZE, DEFAULT_EVIDENCE_ROOT, DEFAULT_TRANSCRIPT_DIRS, loadEvidenceChunks, loadEvidenceChunksWithSignals, } from './load-evidence';
|
|
5
4
|
export type { PosthogEvidenceOptions } from './posthog-signals';
|
|
5
|
+
export { loadPosthogEvidenceChunks, resolvePosthogEvidenceOptionsFromEnv, } from './posthog-signals';
|
|
6
6
|
export * from './product-intent.feature';
|
package/dist/index.js
CHANGED
|
@@ -31,8 +31,8 @@ var example = defineExample({
|
|
|
31
31
|
var example_default = example;
|
|
32
32
|
|
|
33
33
|
// src/posthog-signals.ts
|
|
34
|
-
import { FunnelAnalyzer } from "@contractspec/lib.analytics/funnel";
|
|
35
34
|
import { PosthogAnalyticsProvider } from "@contractspec/integration.providers-impls/impls/posthog";
|
|
35
|
+
import { FunnelAnalyzer } from "@contractspec/lib.analytics/funnel";
|
|
36
36
|
async function loadPosthogEvidenceChunks(options) {
|
|
37
37
|
const chunks = [];
|
|
38
38
|
const range = resolveRange(options.dateRange);
|
package/dist/load-evidence.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
// src/posthog-signals.ts
|
|
3
|
-
import { FunnelAnalyzer } from "@contractspec/lib.analytics/funnel";
|
|
4
3
|
import { PosthogAnalyticsProvider } from "@contractspec/integration.providers-impls/impls/posthog";
|
|
4
|
+
import { FunnelAnalyzer } from "@contractspec/lib.analytics/funnel";
|
|
5
5
|
async function loadPosthogEvidenceChunks(options) {
|
|
6
6
|
const chunks = [];
|
|
7
7
|
const range = resolveRange(options.dateRange);
|
package/dist/node/index.js
CHANGED
|
@@ -30,8 +30,8 @@ var example = defineExample({
|
|
|
30
30
|
var example_default = example;
|
|
31
31
|
|
|
32
32
|
// src/posthog-signals.ts
|
|
33
|
-
import { FunnelAnalyzer } from "@contractspec/lib.analytics/funnel";
|
|
34
33
|
import { PosthogAnalyticsProvider } from "@contractspec/integration.providers-impls/impls/posthog";
|
|
34
|
+
import { FunnelAnalyzer } from "@contractspec/lib.analytics/funnel";
|
|
35
35
|
async function loadPosthogEvidenceChunks(options) {
|
|
36
36
|
const chunks = [];
|
|
37
37
|
const range = resolveRange(options.dateRange);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// src/posthog-signals.ts
|
|
2
|
-
import { FunnelAnalyzer } from "@contractspec/lib.analytics/funnel";
|
|
3
2
|
import { PosthogAnalyticsProvider } from "@contractspec/integration.providers-impls/impls/posthog";
|
|
3
|
+
import { FunnelAnalyzer } from "@contractspec/lib.analytics/funnel";
|
|
4
4
|
async function loadPosthogEvidenceChunks(options) {
|
|
5
5
|
const chunks = [];
|
|
6
6
|
const range = resolveRange(options.dateRange);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// src/posthog-signals.ts
|
|
2
|
-
import { FunnelAnalyzer } from "@contractspec/lib.analytics/funnel";
|
|
3
2
|
import { PosthogAnalyticsProvider } from "@contractspec/integration.providers-impls/impls/posthog";
|
|
3
|
+
import { FunnelAnalyzer } from "@contractspec/lib.analytics/funnel";
|
|
4
4
|
async function loadPosthogEvidenceChunks(options) {
|
|
5
5
|
const chunks = [];
|
|
6
6
|
const range = resolveRange(options.dateRange);
|
package/dist/node/script.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// src/posthog-signals.ts
|
|
2
|
-
import { FunnelAnalyzer } from "@contractspec/lib.analytics/funnel";
|
|
3
2
|
import { PosthogAnalyticsProvider } from "@contractspec/integration.providers-impls/impls/posthog";
|
|
3
|
+
import { FunnelAnalyzer } from "@contractspec/lib.analytics/funnel";
|
|
4
4
|
async function loadPosthogEvidenceChunks(options) {
|
|
5
5
|
const chunks = [];
|
|
6
6
|
const range = resolveRange(options.dateRange);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// src/posthog-signals.ts
|
|
2
|
-
import { FunnelAnalyzer } from "@contractspec/lib.analytics/funnel";
|
|
3
2
|
import { PosthogAnalyticsProvider } from "@contractspec/integration.providers-impls/impls/posthog";
|
|
3
|
+
import { FunnelAnalyzer } from "@contractspec/lib.analytics/funnel";
|
|
4
4
|
async function loadPosthogEvidenceChunks(options) {
|
|
5
5
|
const chunks = [];
|
|
6
6
|
const range = resolveRange(options.dateRange);
|
|
@@ -306,6 +306,9 @@ async function loadEvidenceChunksWithSignals(options = {}) {
|
|
|
306
306
|
}
|
|
307
307
|
|
|
308
308
|
// src/sync-actions.ts
|
|
309
|
+
import { JiraProjectManagementProvider } from "@contractspec/integration.providers-impls/impls/jira";
|
|
310
|
+
import { LinearProjectManagementProvider } from "@contractspec/integration.providers-impls/impls/linear";
|
|
311
|
+
import { NotionProjectManagementProvider } from "@contractspec/integration.providers-impls/impls/notion";
|
|
309
312
|
import { createAgentJsonRunner } from "@contractspec/lib.ai-agent/agent/json-runner";
|
|
310
313
|
import {
|
|
311
314
|
buildProjectManagementSyncPayload,
|
|
@@ -315,9 +318,6 @@ import {
|
|
|
315
318
|
impactEngine,
|
|
316
319
|
suggestPatch
|
|
317
320
|
} from "@contractspec/lib.product-intent-utils";
|
|
318
|
-
import { LinearProjectManagementProvider } from "@contractspec/integration.providers-impls/impls/linear";
|
|
319
|
-
import { JiraProjectManagementProvider } from "@contractspec/integration.providers-impls/impls/jira";
|
|
320
|
-
import { NotionProjectManagementProvider } from "@contractspec/integration.providers-impls/impls/notion";
|
|
321
321
|
var QUESTION = "Which activation and onboarding friction should we prioritize next?";
|
|
322
322
|
function resolveProvider() {
|
|
323
323
|
const raw = (process.env.CONTRACTSPEC_PM_PROVIDER ?? "").toLowerCase();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import type { FunnelDefinition } from '@contractspec/lib.analytics';
|
|
1
2
|
import type { AnalyticsReader, DateRangeInput } from '@contractspec/lib.contracts-integrations';
|
|
2
3
|
import type { EvidenceChunk } from '@contractspec/lib.contracts-spec/product-intent/types';
|
|
3
|
-
import type { FunnelDefinition } from '@contractspec/lib.analytics';
|
|
4
4
|
export interface PosthogEvidenceOptions {
|
|
5
5
|
reader: AnalyticsReader;
|
|
6
6
|
dateRange?: DateRangeInput;
|
package/dist/posthog-signals.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
// src/posthog-signals.ts
|
|
3
|
-
import { FunnelAnalyzer } from "@contractspec/lib.analytics/funnel";
|
|
4
3
|
import { PosthogAnalyticsProvider } from "@contractspec/integration.providers-impls/impls/posthog";
|
|
4
|
+
import { FunnelAnalyzer } from "@contractspec/lib.analytics/funnel";
|
|
5
5
|
async function loadPosthogEvidenceChunks(options) {
|
|
6
6
|
const chunks = [];
|
|
7
7
|
const range = resolveRange(options.dateRange);
|
package/dist/script.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
// src/posthog-signals.ts
|
|
3
|
-
import { FunnelAnalyzer } from "@contractspec/lib.analytics/funnel";
|
|
4
3
|
import { PosthogAnalyticsProvider } from "@contractspec/integration.providers-impls/impls/posthog";
|
|
4
|
+
import { FunnelAnalyzer } from "@contractspec/lib.analytics/funnel";
|
|
5
5
|
async function loadPosthogEvidenceChunks(options) {
|
|
6
6
|
const chunks = [];
|
|
7
7
|
const range = resolveRange(options.dateRange);
|
package/dist/sync-actions.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
// src/posthog-signals.ts
|
|
3
|
-
import { FunnelAnalyzer } from "@contractspec/lib.analytics/funnel";
|
|
4
3
|
import { PosthogAnalyticsProvider } from "@contractspec/integration.providers-impls/impls/posthog";
|
|
4
|
+
import { FunnelAnalyzer } from "@contractspec/lib.analytics/funnel";
|
|
5
5
|
async function loadPosthogEvidenceChunks(options) {
|
|
6
6
|
const chunks = [];
|
|
7
7
|
const range = resolveRange(options.dateRange);
|
|
@@ -307,6 +307,9 @@ async function loadEvidenceChunksWithSignals(options = {}) {
|
|
|
307
307
|
}
|
|
308
308
|
|
|
309
309
|
// src/sync-actions.ts
|
|
310
|
+
import { JiraProjectManagementProvider } from "@contractspec/integration.providers-impls/impls/jira";
|
|
311
|
+
import { LinearProjectManagementProvider } from "@contractspec/integration.providers-impls/impls/linear";
|
|
312
|
+
import { NotionProjectManagementProvider } from "@contractspec/integration.providers-impls/impls/notion";
|
|
310
313
|
import { createAgentJsonRunner } from "@contractspec/lib.ai-agent/agent/json-runner";
|
|
311
314
|
import {
|
|
312
315
|
buildProjectManagementSyncPayload,
|
|
@@ -316,9 +319,6 @@ import {
|
|
|
316
319
|
impactEngine,
|
|
317
320
|
suggestPatch
|
|
318
321
|
} from "@contractspec/lib.product-intent-utils";
|
|
319
|
-
import { LinearProjectManagementProvider } from "@contractspec/integration.providers-impls/impls/linear";
|
|
320
|
-
import { JiraProjectManagementProvider } from "@contractspec/integration.providers-impls/impls/jira";
|
|
321
|
-
import { NotionProjectManagementProvider } from "@contractspec/integration.providers-impls/impls/notion";
|
|
322
322
|
var QUESTION = "Which activation and onboarding friction should we prioritize next?";
|
|
323
323
|
function resolveProvider() {
|
|
324
324
|
const raw = (process.env.CONTRACTSPEC_PM_PROVIDER ?? "").toLowerCase();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contractspec/example.product-intent",
|
|
3
|
-
"version": "3.7.
|
|
3
|
+
"version": "3.7.7",
|
|
4
4
|
"description": "Product intent example: evidence ingestion and prompt-ready outputs.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"contractspec",
|
|
@@ -76,23 +76,24 @@
|
|
|
76
76
|
"dev": "contractspec-bun-build dev",
|
|
77
77
|
"clean": "rimraf dist .turbo",
|
|
78
78
|
"lint": "bun lint:fix",
|
|
79
|
-
"lint:fix": "
|
|
80
|
-
"lint:check": "
|
|
79
|
+
"lint:fix": "biome check --write --unsafe --only=nursery/useSortedClasses . && biome check --write .",
|
|
80
|
+
"lint:check": "biome check .",
|
|
81
81
|
"test": "bun test",
|
|
82
82
|
"prebuild": "contractspec-bun-build prebuild",
|
|
83
83
|
"typecheck": "tsc --noEmit"
|
|
84
84
|
},
|
|
85
85
|
"dependencies": {
|
|
86
|
-
"@contractspec/lib.
|
|
87
|
-
"@contractspec/lib.contracts-
|
|
88
|
-
"@contractspec/lib.
|
|
89
|
-
"@contractspec/lib.
|
|
90
|
-
"@contractspec/
|
|
86
|
+
"@contractspec/lib.analytics": "3.7.7",
|
|
87
|
+
"@contractspec/lib.contracts-spec": "4.0.0",
|
|
88
|
+
"@contractspec/lib.contracts-integrations": "3.7.7",
|
|
89
|
+
"@contractspec/lib.ai-agent": "7.0.7",
|
|
90
|
+
"@contractspec/lib.product-intent-utils": "3.7.7",
|
|
91
|
+
"@contractspec/integration.providers-impls": "3.7.7"
|
|
91
92
|
},
|
|
92
93
|
"devDependencies": {
|
|
93
|
-
"@contractspec/tool.typescript": "3.7.
|
|
94
|
+
"@contractspec/tool.typescript": "3.7.6",
|
|
94
95
|
"typescript": "^5.9.3",
|
|
95
|
-
"@contractspec/tool.bun": "3.7.
|
|
96
|
+
"@contractspec/tool.bun": "3.7.6"
|
|
96
97
|
},
|
|
97
98
|
"publishConfig": {
|
|
98
99
|
"access": "public",
|
|
@@ -2,36 +2,36 @@ import type { DocBlock } from '@contractspec/lib.contracts-spec/docs';
|
|
|
2
2
|
import { registerDocBlocks } from '@contractspec/lib.contracts-spec/docs';
|
|
3
3
|
|
|
4
4
|
const blocks: DocBlock[] = [
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
5
|
+
{
|
|
6
|
+
id: 'docs.examples.product-intent',
|
|
7
|
+
title: 'Product Intent Discovery',
|
|
8
|
+
summary:
|
|
9
|
+
'Evidence-ingestion example for turning product signals into prompt-ready discovery outputs.',
|
|
10
|
+
kind: 'reference',
|
|
11
|
+
visibility: 'public',
|
|
12
|
+
route: '/docs/examples/product-intent',
|
|
13
|
+
tags: ['product-intent', 'discovery', 'evidence', 'example'],
|
|
14
|
+
body: `## Included assets
|
|
15
15
|
- Product-intent feature and example manifest.
|
|
16
16
|
- Evidence loading helpers and PostHog signal ingestion.
|
|
17
17
|
- Sync actions and script entrypoints for discovery workflows.
|
|
18
18
|
|
|
19
19
|
## Use case
|
|
20
20
|
Use this example when you need a lightweight pattern for evidence-backed product discovery before it becomes a larger workflow or template.`,
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
id: 'docs.examples.product-intent.usage',
|
|
24
|
+
title: 'Product Intent Usage',
|
|
25
|
+
summary: 'How to use the product-intent example for evidence ingestion.',
|
|
26
|
+
kind: 'usage',
|
|
27
|
+
visibility: 'public',
|
|
28
|
+
route: '/docs/examples/product-intent/usage',
|
|
29
|
+
tags: ['product-intent', 'usage'],
|
|
30
|
+
body: `## Usage
|
|
31
31
|
1. Load evidence sources with the helpers in this package.
|
|
32
32
|
2. Transform product signals into the product-intent workflow inputs.
|
|
33
33
|
3. Export the resulting discovery outputs into the next planning step or agent prompt.`,
|
|
34
|
-
|
|
34
|
+
},
|
|
35
35
|
];
|
|
36
36
|
|
|
37
37
|
registerDocBlocks(blocks);
|
package/src/example.ts
CHANGED
|
@@ -1,32 +1,32 @@
|
|
|
1
1
|
import { defineExample } from '@contractspec/lib.contracts-spec/examples';
|
|
2
2
|
|
|
3
3
|
const example = defineExample({
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
4
|
+
meta: {
|
|
5
|
+
key: 'product-intent',
|
|
6
|
+
version: '1.0.0',
|
|
7
|
+
title: 'Product Intent Discovery',
|
|
8
|
+
description:
|
|
9
|
+
'Evidence ingestion and product-intent workflow for PM discovery.',
|
|
10
|
+
kind: 'script',
|
|
11
|
+
visibility: 'public',
|
|
12
|
+
stability: 'experimental',
|
|
13
|
+
owners: ['@platform.core'],
|
|
14
|
+
tags: ['product-intent', 'discovery', 'pm', 'evidence', 'llm'],
|
|
15
|
+
},
|
|
16
|
+
docs: {
|
|
17
|
+
rootDocId: 'docs.examples.product-intent',
|
|
18
|
+
usageDocId: 'docs.examples.product-intent.usage',
|
|
19
|
+
},
|
|
20
|
+
entrypoints: {
|
|
21
|
+
packageName: '@contractspec/example.product-intent',
|
|
22
|
+
docs: './docs',
|
|
23
|
+
},
|
|
24
|
+
surfaces: {
|
|
25
|
+
templates: false,
|
|
26
|
+
sandbox: { enabled: false, modes: [] },
|
|
27
|
+
studio: { enabled: false, installable: false },
|
|
28
|
+
mcp: { enabled: false },
|
|
29
|
+
},
|
|
30
30
|
});
|
|
31
31
|
|
|
32
32
|
export default example;
|
package/src/index.ts
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
export { default as example } from './example';
|
|
2
|
-
export {
|
|
3
|
-
DEFAULT_CHUNK_SIZE,
|
|
4
|
-
DEFAULT_EVIDENCE_ROOT,
|
|
5
|
-
DEFAULT_TRANSCRIPT_DIRS,
|
|
6
|
-
loadEvidenceChunks,
|
|
7
|
-
loadEvidenceChunksWithSignals,
|
|
8
|
-
} from './load-evidence';
|
|
9
2
|
export type {
|
|
10
|
-
|
|
11
|
-
|
|
3
|
+
EvidenceLoadOptions,
|
|
4
|
+
EvidenceLoadWithSignalsOptions,
|
|
12
5
|
} from './load-evidence';
|
|
13
6
|
export {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
7
|
+
DEFAULT_CHUNK_SIZE,
|
|
8
|
+
DEFAULT_EVIDENCE_ROOT,
|
|
9
|
+
DEFAULT_TRANSCRIPT_DIRS,
|
|
10
|
+
loadEvidenceChunks,
|
|
11
|
+
loadEvidenceChunksWithSignals,
|
|
12
|
+
} from './load-evidence';
|
|
17
13
|
export type { PosthogEvidenceOptions } from './posthog-signals';
|
|
14
|
+
export {
|
|
15
|
+
loadPosthogEvidenceChunks,
|
|
16
|
+
resolvePosthogEvidenceOptionsFromEnv,
|
|
17
|
+
} from './posthog-signals';
|
|
18
18
|
export * from './product-intent.feature';
|
|
@@ -6,11 +6,11 @@ import { loadEvidenceChunks } from './load-evidence';
|
|
|
6
6
|
const moduleDir = path.dirname(fileURLToPath(import.meta.url));
|
|
7
7
|
|
|
8
8
|
describe('loadEvidenceChunks', () => {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
it('loads evidence chunks from the example dataset', () => {
|
|
10
|
+
const evidenceRoot = path.join(moduleDir, '../evidence');
|
|
11
|
+
const chunks = loadEvidenceChunks({ evidenceRoot, chunkSize: 2000 });
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
expect(chunks.length).toBeGreaterThan(0);
|
|
14
|
+
expect(chunks.some((chunk) => chunk.chunkId.startsWith('INT-'))).toBe(true);
|
|
15
|
+
});
|
|
16
16
|
});
|