intentdocs 0.8.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 +261 -0
- package/bin/intent.js +2 -0
- package/dist/chunk-4OWPN2RE.js +249 -0
- package/dist/chunk-6FGYJ3W2.js +140 -0
- package/dist/chunk-6XKB6RTU.js +123 -0
- package/dist/chunk-ICOMMHKG.js +48 -0
- package/dist/chunk-IKF3ZLHK.js +621 -0
- package/dist/chunk-ITQUQYWB.js +21 -0
- package/dist/chunk-PCNDP5SX.js +34 -0
- package/dist/chunk-WPVDURTJ.js +79 -0
- package/dist/complexity-NSSYVT54.js +79 -0
- package/dist/import-prd-CKV3R67G.js +134 -0
- package/dist/index.js +2821 -0
- package/dist/keys-EDWET3WG.js +90 -0
- package/dist/log-TT2UCJP7.js +94 -0
- package/dist/map-extract-I3AACTGL.js +98 -0
- package/dist/map-import-IYUMRASO.js +358 -0
- package/dist/map-schema-JVL3O2TJ.js +114 -0
- package/dist/prompt-WAWCRGHN.js +16 -0
- package/dist/research-6SXJ37TI.js +59 -0
- package/dist/scope-OGKQ472D.js +10 -0
- package/dist/setup-SOI2HQAL.js +11 -0
- package/package.json +43 -0
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
// src/commands/map-schema.ts
|
|
2
|
+
var SCHEMA = {
|
|
3
|
+
$schema: "https://json-schema.org/draft/2020-12/schema",
|
|
4
|
+
title: "IntentDocs Story Map",
|
|
5
|
+
description: "Schema for storymap.json files produced by `intent map extract` and consumed by `intent map import`.",
|
|
6
|
+
type: "object",
|
|
7
|
+
required: ["schema_version", "source", "product_summary", "backbone"],
|
|
8
|
+
additionalProperties: false,
|
|
9
|
+
properties: {
|
|
10
|
+
schema_version: {
|
|
11
|
+
type: "string",
|
|
12
|
+
const: "1"
|
|
13
|
+
},
|
|
14
|
+
source: {
|
|
15
|
+
type: "string",
|
|
16
|
+
description: 'Origin identifier, e.g. "brownfield-extraction".'
|
|
17
|
+
},
|
|
18
|
+
product_summary: {
|
|
19
|
+
type: "string",
|
|
20
|
+
maxLength: 1e3,
|
|
21
|
+
description: "One-paragraph plain-text summary of the product."
|
|
22
|
+
},
|
|
23
|
+
backbone: {
|
|
24
|
+
type: "array",
|
|
25
|
+
minItems: 1,
|
|
26
|
+
maxItems: 20,
|
|
27
|
+
items: {
|
|
28
|
+
type: "object",
|
|
29
|
+
required: ["activity", "tasks"],
|
|
30
|
+
additionalProperties: false,
|
|
31
|
+
properties: {
|
|
32
|
+
activity: { type: "string", maxLength: 200 },
|
|
33
|
+
tasks: {
|
|
34
|
+
type: "array",
|
|
35
|
+
minItems: 1,
|
|
36
|
+
maxItems: 30,
|
|
37
|
+
items: {
|
|
38
|
+
type: "object",
|
|
39
|
+
required: ["task", "stories"],
|
|
40
|
+
additionalProperties: false,
|
|
41
|
+
properties: {
|
|
42
|
+
task: { type: "string", maxLength: 200 },
|
|
43
|
+
stories: {
|
|
44
|
+
type: "array",
|
|
45
|
+
minItems: 1,
|
|
46
|
+
maxItems: 50,
|
|
47
|
+
items: {
|
|
48
|
+
type: "object",
|
|
49
|
+
required: ["story", "evidence", "confidence"],
|
|
50
|
+
additionalProperties: false,
|
|
51
|
+
properties: {
|
|
52
|
+
story: {
|
|
53
|
+
type: "string",
|
|
54
|
+
maxLength: 500,
|
|
55
|
+
pattern: "^As an? ",
|
|
56
|
+
description: 'Must start with "As a " or "As an " followed by a role.'
|
|
57
|
+
},
|
|
58
|
+
evidence: { type: "string", maxLength: 500 },
|
|
59
|
+
plan_gate: {
|
|
60
|
+
type: ["string", "null"],
|
|
61
|
+
enum: ["free", "pro", "team", null]
|
|
62
|
+
},
|
|
63
|
+
confidence: {
|
|
64
|
+
type: "string",
|
|
65
|
+
enum: ["high", "medium", "low"]
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
data_model: {
|
|
77
|
+
type: "array",
|
|
78
|
+
description: "Optional data model entities."
|
|
79
|
+
},
|
|
80
|
+
build_order: {
|
|
81
|
+
type: "array",
|
|
82
|
+
description: "Optional ordered build phases."
|
|
83
|
+
},
|
|
84
|
+
critical_assumptions: {
|
|
85
|
+
type: "array",
|
|
86
|
+
items: { type: "string" },
|
|
87
|
+
description: "Assumptions that, if wrong, invalidate the plan."
|
|
88
|
+
},
|
|
89
|
+
open_questions: {
|
|
90
|
+
type: "array",
|
|
91
|
+
maxItems: 50,
|
|
92
|
+
items: { type: "string", maxLength: 500 },
|
|
93
|
+
description: "Unresolved questions for the product owner."
|
|
94
|
+
},
|
|
95
|
+
stack: {
|
|
96
|
+
type: "object",
|
|
97
|
+
properties: {
|
|
98
|
+
framework: { type: "string" },
|
|
99
|
+
auth: { type: "string" },
|
|
100
|
+
database: { type: "string" },
|
|
101
|
+
payments: { type: "string" },
|
|
102
|
+
ai: { type: "string" }
|
|
103
|
+
},
|
|
104
|
+
additionalProperties: false,
|
|
105
|
+
description: "Detected or declared tech stack."
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
};
|
|
109
|
+
function mapSchema() {
|
|
110
|
+
console.log(JSON.stringify(SCHEMA, null, 2));
|
|
111
|
+
}
|
|
112
|
+
export {
|
|
113
|
+
mapSchema
|
|
114
|
+
};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ask,
|
|
3
|
+
closePrompt
|
|
4
|
+
} from "./chunk-WPVDURTJ.js";
|
|
5
|
+
import {
|
|
6
|
+
isPlanGated,
|
|
7
|
+
printUpgradeMessage
|
|
8
|
+
} from "./chunk-ITQUQYWB.js";
|
|
9
|
+
import {
|
|
10
|
+
apiUrl
|
|
11
|
+
} from "./chunk-6XKB6RTU.js";
|
|
12
|
+
import {
|
|
13
|
+
requireConfig
|
|
14
|
+
} from "./chunk-ICOMMHKG.js";
|
|
15
|
+
import "./chunk-PCNDP5SX.js";
|
|
16
|
+
|
|
17
|
+
// src/commands/research.ts
|
|
18
|
+
import ora from "ora";
|
|
19
|
+
async function research(query) {
|
|
20
|
+
const config = requireConfig();
|
|
21
|
+
if (!query) {
|
|
22
|
+
query = await ask(" What do you want to research?\n > ");
|
|
23
|
+
if (!query?.trim()) {
|
|
24
|
+
console.log(" Query required.");
|
|
25
|
+
closePrompt();
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
closePrompt();
|
|
29
|
+
}
|
|
30
|
+
const spinner = ora(" Researching...").start();
|
|
31
|
+
try {
|
|
32
|
+
const res = await fetch(apiUrl(config, "/research"), {
|
|
33
|
+
method: "POST",
|
|
34
|
+
headers: { "Content-Type": "application/json" },
|
|
35
|
+
body: JSON.stringify({ query })
|
|
36
|
+
});
|
|
37
|
+
if (!res.ok) {
|
|
38
|
+
if (isPlanGated(res.status)) {
|
|
39
|
+
spinner.fail(" Research is not available on your plan");
|
|
40
|
+
printUpgradeMessage();
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
spinner.fail(" Research failed");
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
const result = await res.json();
|
|
47
|
+
spinner.succeed(` Research complete
|
|
48
|
+
`);
|
|
49
|
+
console.log(` Query: ${result.query}
|
|
50
|
+
`);
|
|
51
|
+
console.log(result.research);
|
|
52
|
+
console.log();
|
|
53
|
+
} catch (err) {
|
|
54
|
+
spinner.fail(` Error: ${err.message}`);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
export {
|
|
58
|
+
research
|
|
59
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "intentdocs",
|
|
3
|
+
"version": "0.8.0",
|
|
4
|
+
"description": "CLI for intentdocs.com — intent-driven development: connect your codebase to your product specs",
|
|
5
|
+
"bin": {
|
|
6
|
+
"intent": "bin/intent.js"
|
|
7
|
+
},
|
|
8
|
+
"scripts": {
|
|
9
|
+
"build": "tsup --clean && chmod +x dist/index.js && chmod +x bin/intent.js",
|
|
10
|
+
"dev": "tsup --watch",
|
|
11
|
+
"test": "vitest run",
|
|
12
|
+
"prepublishOnly": "npm run build"
|
|
13
|
+
},
|
|
14
|
+
"type": "module",
|
|
15
|
+
"files": [
|
|
16
|
+
"dist",
|
|
17
|
+
"bin",
|
|
18
|
+
"README.md"
|
|
19
|
+
],
|
|
20
|
+
"keywords": [
|
|
21
|
+
"intentdocs",
|
|
22
|
+
"intent-driven-development",
|
|
23
|
+
"spec-driven-development",
|
|
24
|
+
"story-map",
|
|
25
|
+
"claude-code",
|
|
26
|
+
"mcp"
|
|
27
|
+
],
|
|
28
|
+
"author": "intentdocs.com",
|
|
29
|
+
"license": "MIT",
|
|
30
|
+
"dependencies": {
|
|
31
|
+
"@modelcontextprotocol/sdk": "^1.0.0",
|
|
32
|
+
"commander": "^12.0.0",
|
|
33
|
+
"chalk": "^5.3.0",
|
|
34
|
+
"ora": "^8.0.0",
|
|
35
|
+
"posthog-node": "^4.0.0"
|
|
36
|
+
},
|
|
37
|
+
"devDependencies": {
|
|
38
|
+
"tsup": "^8.0.0",
|
|
39
|
+
"typescript": "^5.4.0",
|
|
40
|
+
"@types/node": "^20.0.0",
|
|
41
|
+
"vitest": "^4.1.2"
|
|
42
|
+
}
|
|
43
|
+
}
|