@projitive/mcp 1.0.8 → 1.1.1
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/output/package.json +4 -1
- package/output/source/{helpers/catch → common}/catch.js +6 -6
- package/output/source/{helpers/catch → common}/catch.test.js +6 -6
- package/output/source/common/confidence.js +231 -0
- package/output/source/common/confidence.test.js +205 -0
- package/output/source/common/errors.js +120 -0
- package/output/source/{helpers/files → common}/files.js +1 -1
- package/output/source/{helpers/files → common}/files.test.js +1 -1
- package/output/source/common/index.js +10 -0
- package/output/source/{helpers/linter/codes.js → common/linter.js} +13 -0
- package/output/source/{helpers/markdown → common}/markdown.test.js +1 -1
- package/output/source/{helpers/response → common}/response.test.js +1 -1
- package/output/source/common/types.js +7 -0
- package/output/source/common/utils.js +39 -0
- package/output/source/design-context.js +51 -500
- package/output/source/index.js +8 -193
- package/output/source/index.test.js +116 -0
- package/output/source/prompts/index.js +9 -0
- package/output/source/prompts/quickStart.js +94 -0
- package/output/source/prompts/taskDiscovery.js +190 -0
- package/output/source/prompts/taskExecution.js +161 -0
- package/output/source/resources/designs.js +108 -0
- package/output/source/resources/designs.test.js +154 -0
- package/output/source/resources/governance.js +40 -0
- package/output/source/resources/index.js +6 -0
- package/output/source/resources/readme.test.js +167 -0
- package/output/source/{reports.js → resources/reports.js} +5 -3
- package/output/source/resources/reports.test.js +149 -0
- package/output/source/tools/index.js +8 -0
- package/output/source/{projitive.js → tools/project.js} +4 -6
- package/output/source/tools/project.test.js +322 -0
- package/output/source/{roadmap.js → tools/roadmap.js} +4 -7
- package/output/source/tools/roadmap.test.js +103 -0
- package/output/source/{tasks.js → tools/task.js} +577 -22
- package/output/source/tools/task.test.js +473 -0
- package/output/source/types.js +67 -0
- package/package.json +4 -1
- package/output/source/designs.js +0 -38
- package/output/source/helpers/artifacts/index.js +0 -1
- package/output/source/helpers/catch/index.js +0 -1
- package/output/source/helpers/files/index.js +0 -1
- package/output/source/helpers/index.js +0 -6
- package/output/source/helpers/linter/index.js +0 -2
- package/output/source/helpers/linter/linter.js +0 -6
- package/output/source/helpers/markdown/index.js +0 -1
- package/output/source/helpers/response/index.js +0 -1
- package/output/source/projitive.test.js +0 -111
- package/output/source/roadmap.test.js +0 -11
- package/output/source/tasks.test.js +0 -152
- /package/output/source/{helpers/artifacts → common}/artifacts.js +0 -0
- /package/output/source/{helpers/artifacts → common}/artifacts.test.js +0 -0
- /package/output/source/{helpers/linter → common}/linter.test.js +0 -0
- /package/output/source/{helpers/markdown → common}/markdown.js +0 -0
- /package/output/source/{helpers/response → common}/response.js +0 -0
- /package/output/source/{readme.js → resources/readme.js} +0 -0
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export * from "./errors.js";
|
|
2
|
+
export * from "./types.js";
|
|
3
|
+
export * from "./utils.js";
|
|
4
|
+
export * from "./markdown.js";
|
|
5
|
+
export * from "./files.js";
|
|
6
|
+
export * from "./response.js";
|
|
7
|
+
export * from "./confidence.js";
|
|
8
|
+
export * from "./catch.js";
|
|
9
|
+
export * from "./artifacts.js";
|
|
10
|
+
export * from "./linter.js";
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
export function renderLintSuggestions(suggestions) {
|
|
2
|
+
return suggestions.map((item) => {
|
|
3
|
+
const suffix = item.fixHint ? ` ${item.fixHint}` : "";
|
|
4
|
+
return `- [${item.code}] ${item.message}${suffix}`;
|
|
5
|
+
});
|
|
6
|
+
}
|
|
1
7
|
export const TASK_LINT_CODES = {
|
|
2
8
|
DUPLICATE_ID: "TASK_DUPLICATE_ID",
|
|
3
9
|
IN_PROGRESS_OWNER_EMPTY: "TASK_IN_PROGRESS_OWNER_EMPTY",
|
|
@@ -11,6 +17,13 @@ export const TASK_LINT_CODES = {
|
|
|
11
17
|
FILTER_EMPTY: "TASK_FILTER_EMPTY",
|
|
12
18
|
CONTEXT_HOOK_HEAD_MISSING: "TASK_CONTEXT_HOOK_HEAD_MISSING",
|
|
13
19
|
CONTEXT_HOOK_FOOTER_MISSING: "TASK_CONTEXT_HOOK_FOOTER_MISSING",
|
|
20
|
+
// Spec v1.1.0 - Blocker Categorization
|
|
21
|
+
BLOCKED_WITHOUT_BLOCKER: "TASK_BLOCKED_WITHOUT_BLOCKER",
|
|
22
|
+
BLOCKER_TYPE_INVALID: "TASK_BLOCKER_TYPE_INVALID",
|
|
23
|
+
BLOCKER_DESCRIPTION_EMPTY: "TASK_BLOCKER_DESCRIPTION_EMPTY",
|
|
24
|
+
IN_PROGRESS_WITHOUT_SUBSTATE: "TASK_IN_PROGRESS_WITHOUT_SUBSTATE",
|
|
25
|
+
SUBSTATE_PHASE_INVALID: "TASK_SUBSTATE_PHASE_INVALID",
|
|
26
|
+
SUBSTATE_CONFIDENCE_INVALID: "TASK_SUBSTATE_CONFIDENCE_INVALID",
|
|
14
27
|
};
|
|
15
28
|
export const ROADMAP_LINT_CODES = {
|
|
16
29
|
IDS_EMPTY: "ROADMAP_IDS_EMPTY",
|
|
@@ -2,7 +2,7 @@ import fs from "node:fs/promises";
|
|
|
2
2
|
import os from "node:os";
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import { afterEach, describe, expect, it } from "vitest";
|
|
5
|
-
import { findTextReferences, readMarkdownSections } from
|
|
5
|
+
import { findTextReferences, readMarkdownSections } from './markdown.js';
|
|
6
6
|
const tempPaths = [];
|
|
7
7
|
async function createTempDir() {
|
|
8
8
|
const dir = await fs.mkdtemp(path.join(os.tmpdir(), "projitive-mcp-test-"));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { describe, expect, it } from "vitest";
|
|
2
|
-
import { asText, nextCallSection, renderErrorMarkdown, renderToolResponseMarkdown, summarySection, } from
|
|
2
|
+
import { asText, nextCallSection, renderErrorMarkdown, renderToolResponseMarkdown, summarySection, } from './response.js';
|
|
3
3
|
describe("response helpers", () => {
|
|
4
4
|
it("wraps markdown text as MCP text content", () => {
|
|
5
5
|
const result = asText("# hello");
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
// Common utility functions
|
|
2
|
+
import fs from "node:fs/promises";
|
|
3
|
+
import path from "node:path";
|
|
4
|
+
/**
|
|
5
|
+
* Safely read Markdown file content, return fallback if file doesn't exist or is empty
|
|
6
|
+
*/
|
|
7
|
+
export async function readMarkdownOrFallback(relativePath, fallbackTitle, repoRoot = process.cwd()) {
|
|
8
|
+
const absolutePath = path.resolve(repoRoot, relativePath);
|
|
9
|
+
try {
|
|
10
|
+
const content = await fs.readFile(absolutePath, "utf-8");
|
|
11
|
+
if (content.trim().length > 0) {
|
|
12
|
+
return content;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
catch (error) {
|
|
16
|
+
if (error.code !== "ENOENT") {
|
|
17
|
+
console.error(`Failed to read file: ${absolutePath}`, error);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
return [
|
|
21
|
+
`# ${fallbackTitle}`,
|
|
22
|
+
"",
|
|
23
|
+
`- file: ${relativePath}`,
|
|
24
|
+
"- status: missing-or-empty",
|
|
25
|
+
"- next: create this file or ensure it has readable markdown content",
|
|
26
|
+
].join("\n");
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Capitalize first letter
|
|
30
|
+
*/
|
|
31
|
+
export function capitalizeFirstLetter(str) {
|
|
32
|
+
return str.split(/[-_]/).map(part => part.charAt(0).toUpperCase() + part.slice(1)).join('');
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Format title
|
|
36
|
+
*/
|
|
37
|
+
export function formatTitle(str) {
|
|
38
|
+
return str.split(/[-_]/).map(part => part.charAt(0).toUpperCase() + part.slice(1)).join(' ');
|
|
39
|
+
}
|