@callabens/projectmind 0.1.0-dev.1 → 0.1.0-dev.3
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 +68 -4
- package/dist/apps/cli/src/index.js +403 -9
- package/dist/apps/cli/src/index.js.map +1 -1
- package/dist/packages/core/src/index.d.ts +12 -1
- package/dist/packages/core/src/index.js +1 -1
- package/dist/packages/core/src/index.js.map +1 -1
- package/dist/packages/core/src/schema.d.ts +177 -0
- package/dist/packages/core/src/schema.js +17 -2
- package/dist/packages/core/src/schema.js.map +1 -1
- package/dist/packages/doctor/src/index.d.ts +15 -0
- package/dist/packages/doctor/src/index.js +81 -0
- package/dist/packages/doctor/src/index.js.map +1 -0
- package/dist/packages/evidence/src/index.d.ts +1 -0
- package/dist/packages/evidence/src/index.js +70 -6
- package/dist/packages/evidence/src/index.js.map +1 -1
- package/dist/packages/graph/src/index.js +143 -30
- package/dist/packages/graph/src/index.js.map +1 -1
- package/dist/packages/intent/src/index.d.ts +21 -1
- package/dist/packages/intent/src/index.js +63 -1
- package/dist/packages/intent/src/index.js.map +1 -1
- package/dist/packages/intent/src/templates.d.ts +17 -0
- package/dist/packages/intent/src/templates.js +40 -0
- package/dist/packages/intent/src/templates.js.map +1 -0
- package/dist/packages/mcp/src/index.d.ts +11 -0
- package/dist/packages/mcp/src/index.js +195 -37
- package/dist/packages/mcp/src/index.js.map +1 -1
- package/dist/packages/parser/src/index.d.ts +3 -1
- package/dist/packages/parser/src/index.js +17 -3
- package/dist/packages/parser/src/index.js.map +1 -1
- package/dist/packages/proofpack/src/index.d.ts +87 -0
- package/dist/packages/proofpack/src/index.js +144 -1
- package/dist/packages/proofpack/src/index.js.map +1 -1
- package/dist/packages/report/src/index.d.ts +1 -1
- package/dist/packages/report/src/index.js +6 -3
- package/dist/packages/report/src/index.js.map +1 -1
- package/dist/packages/report/src/pr-comment.d.ts +2 -0
- package/dist/packages/report/src/pr-comment.js +74 -0
- package/dist/packages/report/src/pr-comment.js.map +1 -0
- package/dist/packages/sdk/src/examples/eslint-check.d.ts +1 -0
- package/dist/packages/sdk/src/examples/eslint-check.js +18 -0
- package/dist/packages/sdk/src/examples/eslint-check.js.map +1 -0
- package/dist/packages/sdk/src/scaffold.d.ts +5 -0
- package/dist/packages/sdk/src/scaffold.js +45 -0
- package/dist/packages/sdk/src/scaffold.js.map +1 -0
- package/dist/packages/verifier/src/index.js +5 -2
- package/dist/packages/verifier/src/index.js.map +1 -1
- package/package.json +11 -5
- package/schemas/proofpack-v1.schema.json +46 -1
- package/scripts/demo.mjs +80 -0
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# ProjectMind
|
|
2
2
|
|
|
3
|
-
[](https://github.com/callabens/ProjectMind/actions/workflows/ci.yml)
|
|
4
4
|
[](LICENSE)
|
|
5
5
|
|
|
6
6
|
**Your agent writes code. ProjectMind checks the evidence.**
|
|
@@ -21,11 +21,16 @@ Implemented:
|
|
|
21
21
|
- conservative file-level change and reverse-import impact analysis
|
|
22
22
|
- deterministic Project Constitution enforcement for dependency boundaries and sensitive paths
|
|
23
23
|
- explicit requirement-to-command-and-test evidence bindings
|
|
24
|
+
- optional LCOV-backed source coverage bindings for reviewed requirement paths
|
|
25
|
+
- deterministic read-only binding suggestions with explicit heuristic reasons
|
|
26
|
+
- base-ref-aware binding suggestions for committed branch and PR changes
|
|
27
|
+
- read-only `projectmind doctor` and MCP diagnostics for configuration and binding gaps
|
|
24
28
|
- fresh, single-run evidence tied to Git HEAD and repository content
|
|
25
29
|
- timeouts, bounded logs, fail-closed verification and JSON ProofPacks
|
|
26
|
-
- official MCP SDK stdio
|
|
30
|
+
- official MCP SDK stdio and Streamable HTTP servers, with remote execution and mutations disabled by default
|
|
27
31
|
- reusable generic MCP compatibility pilot and tested Claude Code project configuration
|
|
28
32
|
- GitHub Action with an explicit trust gate, check result, summary and artifact
|
|
33
|
+
- token-separated GitHub PR comments with a requirement-by-requirement status table
|
|
29
34
|
- self-hosted repository pilot: ProjectMind verifies its own reviewed trust-boundary intent in CI
|
|
30
35
|
- development packaging and CI on Node 22 / 24
|
|
31
36
|
- deterministic local Engineering Memory retrieval for decisions, constraints and incidents
|
|
@@ -56,8 +61,18 @@ projectmind --help
|
|
|
56
61
|
|
|
57
62
|
Run the source CLI by absolute path from the root of a trusted Git repository with at least one commit. `init` detects package scripts but does not execute them.
|
|
58
63
|
|
|
64
|
+
For a non-executing guided start, initialize, scan and create a reviewed template intent in one command:
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
projectmind quickstart --template api-contract --title "Keep payments API compatible"
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
Quickstart never runs project commands and refuses to replace an existing active intent.
|
|
71
|
+
|
|
59
72
|
```bash
|
|
60
73
|
node /path/to/ProjectMind/apps/cli/src/index.ts init
|
|
74
|
+
node /path/to/ProjectMind/apps/cli/src/index.ts intent templates
|
|
75
|
+
node /path/to/ProjectMind/apps/cli/src/index.ts intent create --template authentication-regression
|
|
61
76
|
node /path/to/ProjectMind/apps/cli/src/index.ts intent create "Keep login working" --require "Login succeeds"
|
|
62
77
|
node /path/to/ProjectMind/apps/cli/src/index.ts verify
|
|
63
78
|
# NOT_VERIFIED: REQ-1 has no explicit evidence binding; exit 2
|
|
@@ -73,32 +88,81 @@ Use `changes --base <git-ref>` for committed changes against a fetched ref. With
|
|
|
73
88
|
|
|
74
89
|
For a runnable example, see [examples/basic-ts](examples/basic-ts/README.md). The regression suite exercises missing evidence → targeted test added → VERIFIED → failing behavior → NOT_VERIFIED.
|
|
75
90
|
|
|
76
|
-
Run `pnpm demo` for the deterministic recording flow: an unbound passing test fails closed, an exact binding verifies, and a real regression returns the verdict to `NOT_VERIFIED`. See the [demo recording guide](docs/DEMO.md).
|
|
91
|
+
Run `projectmind demo --pace 900` from the installed package, or `pnpm demo -- --pace 900` from a source checkout, for the deterministic recording flow: an unbound passing test fails closed, an exact binding verifies, and a real regression returns the verdict to `NOT_VERIFIED`. See the [demo recording guide](docs/DEMO.md).
|
|
92
|
+
|
|
93
|
+
The completed 21-second trust-gate recording follows the same deterministic `NOT_VERIFIED → VERIFIED → NOT_VERIFIED` flow. Publishing the binary as a GitHub-hosted attachment remains a release task.
|
|
77
94
|
|
|
78
95
|
Free-form claims can carry explicit evidence, intent, and requirement links. `projectmind claim report` reports their historical linkage strength without treating claim text as evidence or changing verification state.
|
|
79
96
|
|
|
80
97
|
## MCP and CI
|
|
81
98
|
|
|
82
99
|
- [Claude Code setup](integrations/claude-code/README.md)
|
|
100
|
+
- [Codex setup](integrations/codex/README.md)
|
|
101
|
+
- [Cursor setup](integrations/cursor/README.md)
|
|
102
|
+
- [VS Code / GitHub Copilot setup](integrations/vscode/README.md)
|
|
103
|
+
|
|
104
|
+
Validate any generated client configuration without launching it: `projectmind integration check <claude-code|codex|cursor|vscode>`. The check fails closed on missing, malformed, drifted, execution-enabled, or PATH-unresolvable settings. It never launches the configured command.
|
|
105
|
+
- [Online MCP / Claude custom connector](docs/ONLINE_MCP.md)
|
|
83
106
|
- [Generic MCP setup](integrations/generic-mcp/README.md)
|
|
84
107
|
- [GitHub Action setup](integrations/github-action/README.md)
|
|
85
108
|
- [Provider SDK v1](docs/PROVIDERS.md)
|
|
86
109
|
- [Engineering Memory Lite](docs/MEMORY.md)
|
|
87
110
|
|
|
88
|
-
The MCP server exposes `projectmind_request_verification`, never a status-setting tool. Execution requires an operator to enable `PROJECTMIND_ALLOW_EXECUTION=1` at server startup.
|
|
111
|
+
Use `projectmind_get_overview` as the first read-only MCP call when an agent needs the project, active intent, and historical verification state together. The MCP server exposes `projectmind_request_verification`, never a status-setting tool. Execution requires an operator to enable `PROJECTMIND_ALLOW_EXECUTION=1` at server startup. The HTTP transport is read-only by default and requires a bearer token before remote execution or repository mutations can be enabled.
|
|
89
112
|
|
|
90
113
|
## Self-hosted pilot
|
|
91
114
|
|
|
92
115
|
This repository checks in its reviewed [ProjectMind configuration](.projectmind/config.json), [Constitution](.projectmind/constitution.json), and [trust-boundary intent](.projectmind/intents/PM-0001.json). CI runs ProjectMind against those contracts and uploads the resulting historical ProofPack. See [self-hosting notes](docs/SELF-HOSTING.md).
|
|
93
116
|
|
|
117
|
+
The released npm preview was also exercised against a pinned revision of the independent public `broofa/airjs` repository. The [sanitized pilot record](docs/pilots/AIRJS.md) documents initialization, an honest unbound `NOT_VERIFIED` result, the explicit testcase binding, the resulting `VERIFIED` ProofPack lineage, and the product gap found during the run.
|
|
118
|
+
|
|
119
|
+
The hosted read-only transport was exercised through a real Claude Web custom connector session. The [sanitized Claude Web pilot](docs/pilots/CLAUDE_WEB.md) records tool discovery, safe reads, blocked execution and the absence of a fabricated verdict.
|
|
120
|
+
|
|
94
121
|
## Principles
|
|
95
122
|
|
|
96
123
|
Local first · Model agnostic · Deterministic core · AI optional · Evidence > claims · No self-verification API · Git native · Open formats · Extensible · Secure by default
|
|
97
124
|
|
|
98
125
|
See [architecture](docs/ARCHITECTURE.md), [Project Constitution](docs/CONSTITUTION.md), [platform support](docs/PLATFORMS.md), [roadmap](ROADMAP.md), [contributing](CONTRIBUTING.md), and [security policy](SECURITY.md).
|
|
99
126
|
|
|
127
|
+
Maintainers tracking the Claude for Open Source milestone should use the [eligibility and application readiness record](docs/CLAUDE_OSS_READINESS.md). It separates completed product work from the program's externally measured eligibility thresholds.
|
|
128
|
+
|
|
100
129
|
Maintainers preparing a package release should follow the fail-closed [release readiness guide](docs/RELEASING.md). The distribution name is not considered confirmed until the intended npm maintainer account controls it.
|
|
101
130
|
|
|
102
131
|
## ProofPack format
|
|
103
132
|
|
|
104
133
|
ProjectMind validates each generated ProofPack against its versioned runtime contract before writing it. Non-TypeScript consumers can use the checked-in [ProofPack v1 JSON Schema](schemas/proofpack-v1.schema.json) and [compatibility fixture](fixtures/proofpack-v1/valid.json). Cross-object lineage checks remain enforced by ProjectMind’s runtime validator.
|
|
134
|
+
|
|
135
|
+
Validate an external ProofPack, including ProjectMind's cross-object lineage checks:
|
|
136
|
+
|
|
137
|
+
```bash
|
|
138
|
+
projectmind proof validate proof.json
|
|
139
|
+
projectmind proof validate proof.json --json
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
Compare two validated ProofPacks to see verdict and requirement-level changes:
|
|
143
|
+
|
|
144
|
+
```bash
|
|
145
|
+
projectmind proof diff before.json after.json
|
|
146
|
+
projectmind proof diff before.json after.json --json
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
Inspect validated local ProofPack history without opening artifact files manually:
|
|
150
|
+
|
|
151
|
+
```bash
|
|
152
|
+
projectmind proof history
|
|
153
|
+
projectmind proof history --intent PM-0001 --limit 10 --json
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
Include a bounded regression/improvement table in a safe PR comment by supplying the previous validated artifact:
|
|
157
|
+
|
|
158
|
+
```bash
|
|
159
|
+
projectmind report pr-comment current.json --previous previous.json
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
Start a standalone Provider SDK v1 package without copying boilerplate by hand:
|
|
163
|
+
|
|
164
|
+
```bash
|
|
165
|
+
projectmind provider scaffold eslint-policy --id com.example.eslint-policy
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
The scaffold never overwrites an existing directory and keeps provider authority limited to validated command definitions.
|
|
@@ -1,15 +1,24 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { isAbsolute, resolve } from "node:path";
|
|
2
|
+
import { delimiter, dirname, isAbsolute, join, resolve } from "node:path";
|
|
3
|
+
import { mkdir, readFile, writeFile } from "node:fs/promises";
|
|
4
|
+
import { existsSync } from "node:fs";
|
|
5
|
+
import { spawnSync } from "node:child_process";
|
|
6
|
+
import { fileURLToPath } from "node:url";
|
|
3
7
|
import { initializeProject, loadConfig } from "../../../packages/core/src/project.js";
|
|
4
8
|
import { buildMindGraph, persistMindGraph } from "../../../packages/graph/src/index.js";
|
|
5
|
-
import { createIntent, bindRequirement } from "../../../packages/intent/src/index.js";
|
|
9
|
+
import { createIntent, bindRequirement, suggestRequirementBindings } from "../../../packages/intent/src/index.js";
|
|
10
|
+
import { createIntentFromTemplate, listIntentTemplates } from "../../../packages/intent/src/templates.js";
|
|
6
11
|
import { summarizeChanges } from "../../../packages/git/src/index.js";
|
|
7
12
|
import { verifyProject } from "../../../packages/verifier/src/project.js";
|
|
8
13
|
import { formatChanges, formatInit, formatIntent, formatVerification } from "../../../packages/report/src/index.js";
|
|
9
|
-
import { runMcpServer } from "../../../packages/mcp/src/index.js";
|
|
14
|
+
import { runMcpHttpServer, runMcpServer } from "../../../packages/mcp/src/index.js";
|
|
10
15
|
import { recordMemory, searchMemory } from "../../../packages/memory/src/index.js";
|
|
11
16
|
import { getClaimReport, recordClaim } from "../../../packages/claims/src/index.js";
|
|
12
17
|
import { PROJECTMIND_VERSION } from "../../../packages/core/src/index.js";
|
|
18
|
+
import { diagnoseProject } from "../../../packages/doctor/src/index.js";
|
|
19
|
+
import { formatPullRequestComment } from "../../../packages/report/src/pr-comment.js";
|
|
20
|
+
import { diffProofPacks, getHistoricalProofStatus, getHistoricalVerificationFeedback, listProofPackHistory, validateProofPack } from "../../../packages/proofpack/src/index.js";
|
|
21
|
+
import { scaffoldProvider } from "../../../packages/sdk/src/scaffold.js";
|
|
13
22
|
function parseArgs(input) {
|
|
14
23
|
const positionals = [];
|
|
15
24
|
const options = new Map();
|
|
@@ -37,7 +46,131 @@ function optionValues(args, key) {
|
|
|
37
46
|
return args.options.get(key) ?? [];
|
|
38
47
|
}
|
|
39
48
|
function help() {
|
|
40
|
-
return `ProjectMind v${PROJECTMIND_VERSION}\n\nCommands:\n init\n scan\n changes\n intent create <
|
|
49
|
+
return `ProjectMind v${PROJECTMIND_VERSION}\n\nCommands:\n init\n quickstart --template <id> [--title <title>]\n demo [--pace <ms>] [--keep]\n doctor [--json]\n scan\n changes\n integration init <claude-code|codex|cursor|vscode>\n integration check <claude-code|codex|cursor|vscode> [--json]\n integration config <claude-code|codex|cursor|vscode|generic> [--json]\n intent templates [--json]\n intent create [title] [--template <id>] [--require <text>] [--preserve <text>] [--out-of-scope <text>]\n intent bind <requirement-id> --command <configured-command> [--test <exact-name>] [--covers <source-path>] [--intent <id>]\n intent suggest [requirement-id] [--intent <id>] [--base <git-ref>] [--json]\n verify [intent-id] [--base <git-ref>]\n proof status [--json]\n proof feedback [--json]\n proof validate <proof.json> [--json]\n proof diff <before.json> <after.json> [--json]\n proof history [--intent <id>] [--limit <1-100>] [--json]\n provider scaffold <name> --id <reverse-domain-id> [--directory <path>]\n report pr-comment [proof-path] [--previous <proof-path>] [--output <path>]\n claim record <text> [--evidence <id>] [--intent <id>] [--requirement <id>]\n claim report\n remember <decision|constraint|incident> <text>\n recall <query> [--type <decision|constraint|incident>] [--limit <1-50>]\n mcp\n mcp-http [--host <host>] [--port <port>]\n`;
|
|
50
|
+
}
|
|
51
|
+
const CODEX_INTEGRATION_TOML = `[mcp_servers.projectmind]
|
|
52
|
+
command = "projectmind"
|
|
53
|
+
args = ["mcp"]
|
|
54
|
+
env = { PROJECTMIND_ALLOW_EXECUTION = "0" }
|
|
55
|
+
`;
|
|
56
|
+
function integrationServer(client) {
|
|
57
|
+
return {
|
|
58
|
+
...(client === "generic" ? {} : { type: "stdio" }),
|
|
59
|
+
command: "projectmind",
|
|
60
|
+
args: ["mcp"],
|
|
61
|
+
env: { PROJECTMIND_ALLOW_EXECUTION: "0" },
|
|
62
|
+
...(client === "claude-code" ? { timeout: 600000 } : {}),
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
function integrationConfig(client) {
|
|
66
|
+
return { mcpServers: { projectmind: integrationServer(client) } };
|
|
67
|
+
}
|
|
68
|
+
async function installIntegration(root, client) {
|
|
69
|
+
if (client === "codex") {
|
|
70
|
+
const relativePath = join(".codex", "config.toml");
|
|
71
|
+
const path = join(root, relativePath);
|
|
72
|
+
let existing = "";
|
|
73
|
+
if (existsSync(path)) {
|
|
74
|
+
existing = await readFile(path, "utf8");
|
|
75
|
+
if (/^\s*\[\s*mcp_servers\s*\.\s*["']?projectmind["']?\s*\]\s*$/m.test(existing)) {
|
|
76
|
+
throw new Error(`${relativePath} already defines mcp_servers.projectmind; review it manually.`);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
const separator = existing.length === 0 || existing.endsWith("\n\n") ? "" : existing.endsWith("\n") ? "\n" : "\n\n";
|
|
80
|
+
await mkdir(dirname(path), { recursive: true });
|
|
81
|
+
await writeFile(path, `${existing}${separator}${CODEX_INTEGRATION_TOML}`, "utf8");
|
|
82
|
+
return relativePath;
|
|
83
|
+
}
|
|
84
|
+
const relativePath = client === "claude-code" ? ".mcp.json" : client === "cursor" ? join(".cursor", "mcp.json") : join(".vscode", "mcp.json");
|
|
85
|
+
const serversKey = client === "vscode" ? "servers" : "mcpServers";
|
|
86
|
+
const path = join(root, relativePath);
|
|
87
|
+
let document = {};
|
|
88
|
+
if (existsSync(path)) {
|
|
89
|
+
const parsed = JSON.parse(await readFile(path, "utf8"));
|
|
90
|
+
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed))
|
|
91
|
+
throw new Error(`${relativePath} must contain a JSON object.`);
|
|
92
|
+
document = parsed;
|
|
93
|
+
}
|
|
94
|
+
const existingServers = document[serversKey];
|
|
95
|
+
if (existingServers !== undefined && (!existingServers || typeof existingServers !== "object" || Array.isArray(existingServers))) {
|
|
96
|
+
throw new Error(`${relativePath} ${serversKey} must be a JSON object.`);
|
|
97
|
+
}
|
|
98
|
+
const servers = { ...(existingServers ?? {}) };
|
|
99
|
+
if (servers.projectmind !== undefined)
|
|
100
|
+
throw new Error(`${relativePath} already defines ${serversKey}.projectmind; review it manually.`);
|
|
101
|
+
servers.projectmind = integrationServer(client);
|
|
102
|
+
await mkdir(dirname(path), { recursive: true });
|
|
103
|
+
await writeFile(path, `${JSON.stringify({ ...document, [serversKey]: servers }, null, 2)}\n`, "utf8");
|
|
104
|
+
return relativePath;
|
|
105
|
+
}
|
|
106
|
+
function resolveExecutable(command) {
|
|
107
|
+
if (isAbsolute(command) || command.includes("/") || command.includes("\\\\"))
|
|
108
|
+
return existsSync(command) ? command : undefined;
|
|
109
|
+
const extensions = process.platform === "win32" ? (process.env.PATHEXT ?? ".COM;.EXE;.BAT;.CMD").split(";") : [""];
|
|
110
|
+
for (const directory of (process.env.PATH ?? "").split(delimiter).filter(Boolean)) {
|
|
111
|
+
for (const extension of extensions) {
|
|
112
|
+
const candidate = join(directory, process.platform === "win32" ? `${command}${extension.toLowerCase()}` : command);
|
|
113
|
+
if (existsSync(candidate))
|
|
114
|
+
return candidate;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
return undefined;
|
|
118
|
+
}
|
|
119
|
+
async function checkIntegration(root, client) {
|
|
120
|
+
const relativePath = client === "claude-code" ? ".mcp.json" : client === "codex" ? join(".codex", "config.toml") : client === "cursor" ? join(".cursor", "mcp.json") : join(".vscode", "mcp.json");
|
|
121
|
+
const path = join(root, relativePath);
|
|
122
|
+
const issues = [];
|
|
123
|
+
if (!existsSync(path)) {
|
|
124
|
+
issues.push({ code: "CONFIG_MISSING", message: `${relativePath} does not exist. Run projectmind integration init ${client}.` });
|
|
125
|
+
return { client, path: relativePath, status: "NEEDS_ATTENTION", issues };
|
|
126
|
+
}
|
|
127
|
+
if (client === "codex") {
|
|
128
|
+
const source = await readFile(path, "utf8");
|
|
129
|
+
const table = source.match(/^\s*\[\s*mcp_servers\s*\.\s*["']?projectmind["']?\s*\]\s*$([\s\S]*?)(?=^\s*\[|$(?![\s\S]))/m)?.[1] ?? "";
|
|
130
|
+
if (!table)
|
|
131
|
+
issues.push({ code: "SERVER_MISSING", message: "mcp_servers.projectmind is not configured." });
|
|
132
|
+
else {
|
|
133
|
+
if (!/^\s*command\s*=\s*"projectmind"\s*$/m.test(table))
|
|
134
|
+
issues.push({ code: "COMMAND_MISMATCH", message: "ProjectMind must launch with command = \"projectmind\"." });
|
|
135
|
+
if (!/^\s*args\s*=\s*\[\s*"mcp"\s*\]\s*$/m.test(table))
|
|
136
|
+
issues.push({ code: "ARGS_MISMATCH", message: "ProjectMind must launch with args = [\"mcp\"]." });
|
|
137
|
+
if (!/PROJECTMIND_ALLOW_EXECUTION\s*=\s*"0"/.test(table))
|
|
138
|
+
issues.push({ code: "EXECUTION_NOT_DISABLED", message: "PROJECTMIND_ALLOW_EXECUTION must be \"0\" for the safe default." });
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
else {
|
|
142
|
+
let document;
|
|
143
|
+
try {
|
|
144
|
+
const parsed = JSON.parse(await readFile(path, "utf8"));
|
|
145
|
+
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed))
|
|
146
|
+
throw new Error("top level is not an object");
|
|
147
|
+
document = parsed;
|
|
148
|
+
}
|
|
149
|
+
catch {
|
|
150
|
+
issues.push({ code: "CONFIG_INVALID", message: `${relativePath} is not a valid JSON object.` });
|
|
151
|
+
return { client, path: relativePath, status: "NEEDS_ATTENTION", issues };
|
|
152
|
+
}
|
|
153
|
+
const serversKey = client === "vscode" ? "servers" : "mcpServers";
|
|
154
|
+
const servers = document[serversKey];
|
|
155
|
+
const entry = servers && typeof servers === "object" && !Array.isArray(servers) ? servers.projectmind : undefined;
|
|
156
|
+
if (!entry || typeof entry !== "object" || Array.isArray(entry))
|
|
157
|
+
issues.push({ code: "SERVER_MISSING", message: `${serversKey}.projectmind is not configured.` });
|
|
158
|
+
else {
|
|
159
|
+
const server = entry;
|
|
160
|
+
if (server.type !== "stdio")
|
|
161
|
+
issues.push({ code: "TRANSPORT_MISMATCH", message: "ProjectMind must use the stdio transport." });
|
|
162
|
+
if (server.command !== "projectmind")
|
|
163
|
+
issues.push({ code: "COMMAND_MISMATCH", message: "ProjectMind must launch with the projectmind command." });
|
|
164
|
+
if (!Array.isArray(server.args) || server.args.length !== 1 || server.args[0] !== "mcp")
|
|
165
|
+
issues.push({ code: "ARGS_MISMATCH", message: "ProjectMind must launch with the single mcp argument." });
|
|
166
|
+
const env = server.env;
|
|
167
|
+
if (!env || typeof env !== "object" || Array.isArray(env) || env.PROJECTMIND_ALLOW_EXECUTION !== "0")
|
|
168
|
+
issues.push({ code: "EXECUTION_NOT_DISABLED", message: "PROJECTMIND_ALLOW_EXECUTION must be \"0\" for the safe default." });
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
if (!resolveExecutable("projectmind"))
|
|
172
|
+
issues.push({ code: "COMMAND_NOT_FOUND", message: "The projectmind command is not available on PATH. Install @callabens/projectmind globally or fix the configured command." });
|
|
173
|
+
return { client, path: relativePath, status: issues.length === 0 ? "READY" : "NEEDS_ATTENTION", issues };
|
|
41
174
|
}
|
|
42
175
|
async function main() {
|
|
43
176
|
const root = resolve(process.cwd());
|
|
@@ -47,6 +180,18 @@ async function main() {
|
|
|
47
180
|
console.log(help());
|
|
48
181
|
return;
|
|
49
182
|
}
|
|
183
|
+
if (command === "demo") {
|
|
184
|
+
const cliDirectory = dirname(fileURLToPath(import.meta.url));
|
|
185
|
+
const candidates = [resolve(cliDirectory, "../../../scripts/demo.mjs"), resolve(cliDirectory, "../../../../scripts/demo.mjs")];
|
|
186
|
+
const demoPath = candidates.find((candidate) => existsSync(candidate));
|
|
187
|
+
if (!demoPath)
|
|
188
|
+
throw new Error("Packaged demo runner is missing.");
|
|
189
|
+
const result = spawnSync(process.execPath, [demoPath, ...process.argv.slice(3)], { stdio: "inherit" });
|
|
190
|
+
if (result.error)
|
|
191
|
+
throw result.error;
|
|
192
|
+
process.exitCode = result.status ?? 1;
|
|
193
|
+
return;
|
|
194
|
+
}
|
|
50
195
|
if (command === "init") {
|
|
51
196
|
const config = await initializeProject(root);
|
|
52
197
|
const graph = await buildMindGraph(root, config);
|
|
@@ -54,6 +199,78 @@ async function main() {
|
|
|
54
199
|
console.log(formatInit(config, graph));
|
|
55
200
|
return;
|
|
56
201
|
}
|
|
202
|
+
if (command === "quickstart") {
|
|
203
|
+
const templateId = optionValues(args, "template")[0];
|
|
204
|
+
if (!templateId)
|
|
205
|
+
throw new Error("Usage: projectmind quickstart --template <id> [--title <title>]");
|
|
206
|
+
if (!listIntentTemplates().some((template) => template.id === templateId))
|
|
207
|
+
throw new Error(`Unknown intent template: ${templateId}`);
|
|
208
|
+
if (existsSync(join(root, ".projectmind", "current-intent.json")))
|
|
209
|
+
throw new Error("Quickstart will not replace an existing active intent. Use intent create explicitly.");
|
|
210
|
+
const config = await initializeProject(root);
|
|
211
|
+
const graph = await buildMindGraph(root, config);
|
|
212
|
+
await persistMindGraph(root, graph);
|
|
213
|
+
const title = optionValues(args, "title")[0];
|
|
214
|
+
const intent = await createIntentFromTemplate(root, templateId, { ...(title ? { title } : {}) });
|
|
215
|
+
console.log([
|
|
216
|
+
formatInit(config, graph),
|
|
217
|
+
"",
|
|
218
|
+
formatIntent(intent),
|
|
219
|
+
"",
|
|
220
|
+
"No verification commands were executed.",
|
|
221
|
+
"Next: review .projectmind/config.json, then run projectmind intent suggest.",
|
|
222
|
+
].join("\n"));
|
|
223
|
+
return;
|
|
224
|
+
}
|
|
225
|
+
if (command === "doctor") {
|
|
226
|
+
const report = await diagnoseProject(root);
|
|
227
|
+
if (args.options.has("json"))
|
|
228
|
+
console.log(JSON.stringify(report, null, 2));
|
|
229
|
+
else
|
|
230
|
+
console.log([
|
|
231
|
+
`ProjectMind doctor: ${report.status}`,
|
|
232
|
+
`Project: ${report.projectName ?? "unknown"}`,
|
|
233
|
+
`Intent: ${report.intentId ?? "none"}`,
|
|
234
|
+
"",
|
|
235
|
+
...(report.diagnostics.length ? report.diagnostics.map((item) => `${item.severity.toUpperCase()} ${item.code}: ${item.message}${item.remedy ? `\n ${item.remedy}` : ""}`) : ["No configuration or binding problems found."]),
|
|
236
|
+
].join("\n"));
|
|
237
|
+
if (report.status !== "READY")
|
|
238
|
+
process.exitCode = 2;
|
|
239
|
+
return;
|
|
240
|
+
}
|
|
241
|
+
if (command === "integration" && subcommand === "check") {
|
|
242
|
+
const client = rest[0];
|
|
243
|
+
if (client !== "claude-code" && client !== "codex" && client !== "cursor" && client !== "vscode")
|
|
244
|
+
throw new Error("Usage: projectmind integration check <claude-code|codex|cursor|vscode> [--json]");
|
|
245
|
+
const report = await checkIntegration(root, client);
|
|
246
|
+
if (args.options.has("json"))
|
|
247
|
+
console.log(JSON.stringify(report, null, 2));
|
|
248
|
+
else
|
|
249
|
+
console.log([`Integration ${client}: ${report.status}`, `Config: ${report.path}`, ...(report.issues.length ? ["", ...report.issues.map((issue) => `${issue.code}: ${issue.message}`)] : ["Safe project-scoped MCP configuration is present."])].join("\n"));
|
|
250
|
+
if (report.status !== "READY")
|
|
251
|
+
process.exitCode = 2;
|
|
252
|
+
return;
|
|
253
|
+
}
|
|
254
|
+
if (command === "integration" && subcommand === "config") {
|
|
255
|
+
const client = rest[0];
|
|
256
|
+
if (client !== "claude-code" && client !== "codex" && client !== "cursor" && client !== "vscode" && client !== "generic")
|
|
257
|
+
throw new Error("Usage: projectmind integration config <claude-code|codex|cursor|vscode|generic> [--json]");
|
|
258
|
+
if (client === "codex") {
|
|
259
|
+
console.log(args.options.has("json") ? JSON.stringify({ path: ".codex/config.toml", content: CODEX_INTEGRATION_TOML }) : CODEX_INTEGRATION_TOML.trimEnd());
|
|
260
|
+
return;
|
|
261
|
+
}
|
|
262
|
+
const config = client === "vscode" ? { servers: { projectmind: integrationServer(client) } } : integrationConfig(client);
|
|
263
|
+
console.log(args.options.has("json") ? JSON.stringify(config) : JSON.stringify(config, null, 2));
|
|
264
|
+
return;
|
|
265
|
+
}
|
|
266
|
+
if (command === "integration" && subcommand === "init") {
|
|
267
|
+
const client = rest[0];
|
|
268
|
+
if (client !== "claude-code" && client !== "codex" && client !== "cursor" && client !== "vscode")
|
|
269
|
+
throw new Error("Usage: projectmind integration init <claude-code|codex|cursor|vscode>");
|
|
270
|
+
const path = await installIntegration(root, client);
|
|
271
|
+
console.log(`Configured ProjectMind for ${client} in ${path}. Execution remains disabled.`);
|
|
272
|
+
return;
|
|
273
|
+
}
|
|
57
274
|
if (command === "scan") {
|
|
58
275
|
const config = await loadConfig(root);
|
|
59
276
|
const graph = await buildMindGraph(root, config);
|
|
@@ -70,19 +287,45 @@ async function main() {
|
|
|
70
287
|
}
|
|
71
288
|
if (command === "intent" && subcommand === "create") {
|
|
72
289
|
const title = rest.join(" ").trim();
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
290
|
+
const templateId = optionValues(args, "template")[0];
|
|
291
|
+
if (!title && !templateId)
|
|
292
|
+
throw new Error("Intent title or --template is required.");
|
|
293
|
+
const intent = templateId ? await createIntentFromTemplate(root, templateId, {
|
|
294
|
+
...(title ? { title } : {}),
|
|
295
|
+
requirements: optionValues(args, "require"),
|
|
296
|
+
preserve: optionValues(args, "preserve"),
|
|
297
|
+
outOfScope: optionValues(args, "out-of-scope"),
|
|
298
|
+
}) : await createIntent(root, title, optionValues(args, "require"), optionValues(args, "preserve"), optionValues(args, "out-of-scope"));
|
|
76
299
|
console.log(formatIntent(intent));
|
|
77
300
|
return;
|
|
78
301
|
}
|
|
302
|
+
if (command === "intent" && subcommand === "templates") {
|
|
303
|
+
const templates = listIntentTemplates();
|
|
304
|
+
if (args.options.has("json"))
|
|
305
|
+
console.log(JSON.stringify(templates, null, 2));
|
|
306
|
+
else
|
|
307
|
+
console.log(["Intent templates", "", ...templates.map((template) => `${template.id}\n ${template.description}\n ${template.requirements.length} requirements · evidence: ${template.evidenceKinds.join(", ")}`)].join("\n"));
|
|
308
|
+
return;
|
|
309
|
+
}
|
|
79
310
|
if (command === "intent" && subcommand === "bind") {
|
|
80
311
|
const requirementId = rest[0];
|
|
81
312
|
const configuredCommand = optionValues(args, "command")[0];
|
|
82
313
|
if (!requirementId || !configuredCommand)
|
|
83
314
|
throw new Error("Usage: intent bind REQ-1 --command <configured-command>");
|
|
84
|
-
const intent = await bindRequirement(root, requirementId, configuredCommand, optionValues(args, "intent")[0], optionValues(args, "test"));
|
|
85
|
-
console.log(formatIntent(intent));
|
|
315
|
+
const intent = await bindRequirement(root, requirementId, configuredCommand, optionValues(args, "intent")[0], optionValues(args, "test"), optionValues(args, "covers"));
|
|
316
|
+
console.log(formatIntent(intent, `Requirement ${requirementId} bound in intent ${intent.id}`));
|
|
317
|
+
return;
|
|
318
|
+
}
|
|
319
|
+
if (command === "intent" && subcommand === "suggest") {
|
|
320
|
+
const report = await suggestRequirementBindings(root, rest[0], optionValues(args, "intent")[0], optionValues(args, "base")[0]);
|
|
321
|
+
if (args.options.has("json"))
|
|
322
|
+
console.log(JSON.stringify(report, null, 2));
|
|
323
|
+
else
|
|
324
|
+
console.log(report.suggestions.length ? [
|
|
325
|
+
`Binding suggestions for ${report.intentId} (heuristic; not evidence)`,
|
|
326
|
+
...report.suggestions.map((item) => `${item.requirementId} score=${item.score} ${item.testName}\n ${item.command}\n ${item.testPath}\n ${item.reasons.map((reason) => `${reason.kind}:${reason.value}`).join(", ")}`),
|
|
327
|
+
...report.diagnostics.map((item) => `Note: ${item}`),
|
|
328
|
+
].join("\n") : `No binding suggestions for ${report.intentId}.\n${report.diagnostics.join("\n")}`);
|
|
86
329
|
return;
|
|
87
330
|
}
|
|
88
331
|
if (command === "verify") {
|
|
@@ -92,6 +335,135 @@ async function main() {
|
|
|
92
335
|
process.exitCode = 2;
|
|
93
336
|
return;
|
|
94
337
|
}
|
|
338
|
+
if (command === "proof" && subcommand === "diff") {
|
|
339
|
+
const [beforePath, afterPath] = rest;
|
|
340
|
+
if (!beforePath || !afterPath)
|
|
341
|
+
throw new Error("Usage: projectmind proof diff <before.json> <after.json> [--json]");
|
|
342
|
+
const diff = diffProofPacks(JSON.parse(await readFile(resolve(root, beforePath), "utf8")), JSON.parse(await readFile(resolve(root, afterPath), "utf8")));
|
|
343
|
+
if (args.options.has("json"))
|
|
344
|
+
console.log(JSON.stringify(diff, null, 2));
|
|
345
|
+
else
|
|
346
|
+
console.log([
|
|
347
|
+
`ProofPack diff: ${diff.project}`,
|
|
348
|
+
`Verdict: ${diff.before.status} -> ${diff.after.status}${diff.verdictChanged ? " (changed)" : ""}`,
|
|
349
|
+
`Requirements: ${diff.summary.added} added, ${diff.summary.removed} removed, ${diff.summary.changed} changed, ${diff.summary.unchanged} unchanged`,
|
|
350
|
+
"",
|
|
351
|
+
...diff.requirements.map((item) => `${item.change.padEnd(9)} ${item.requirementId} ${item.before} -> ${item.after}${item.statementBefore !== item.statementAfter ? " statement changed" : ""}`),
|
|
352
|
+
].join("\n"));
|
|
353
|
+
return;
|
|
354
|
+
}
|
|
355
|
+
if (command === "proof" && subcommand === "status") {
|
|
356
|
+
const status = await getHistoricalProofStatus(root);
|
|
357
|
+
if (args.options.has("json"))
|
|
358
|
+
console.log(JSON.stringify(status, null, 2));
|
|
359
|
+
else if (status.status === "NOT_AVAILABLE" || status.status === "INVALID_ARTIFACT") {
|
|
360
|
+
console.log(`Historical ProofPack: ${status.status}\n${status.reason}`);
|
|
361
|
+
}
|
|
362
|
+
else
|
|
363
|
+
console.log([
|
|
364
|
+
`Historical ProofPack: ${status.status}`,
|
|
365
|
+
`Proof: ${status.proofId}`,
|
|
366
|
+
`Intent: ${status.intentId}`,
|
|
367
|
+
`Recorded verdict: ${status.recordedVerdict}`,
|
|
368
|
+
`Created: ${status.createdAt}`,
|
|
369
|
+
"No checks were executed and no verdict was refreshed.",
|
|
370
|
+
].join("\n"));
|
|
371
|
+
if (status.status !== "MATCHING_REPOSITORY_STATE")
|
|
372
|
+
process.exitCode = 2;
|
|
373
|
+
return;
|
|
374
|
+
}
|
|
375
|
+
if (command === "proof" && subcommand === "feedback") {
|
|
376
|
+
const feedback = await getHistoricalVerificationFeedback(root);
|
|
377
|
+
if (args.options.has("json"))
|
|
378
|
+
console.log(JSON.stringify(feedback, null, 2));
|
|
379
|
+
else if (feedback.status === "NOT_AVAILABLE") {
|
|
380
|
+
console.log(`Verification feedback: ${feedback.status}\n${feedback.reason}\nNext: ${feedback.nextAction}`);
|
|
381
|
+
}
|
|
382
|
+
else if (feedback.status === "INVALID_ARTIFACT") {
|
|
383
|
+
console.log(`Verification feedback: ${feedback.status}\n${feedback.reason}\nNext: ${feedback.nextAction}`);
|
|
384
|
+
}
|
|
385
|
+
else
|
|
386
|
+
console.log([
|
|
387
|
+
`Verification feedback: ${feedback.status}`,
|
|
388
|
+
`Recorded verdict: ${feedback.recordedVerdict}`,
|
|
389
|
+
...feedback.requirements.map((item) => `${item.status.padEnd(10)} ${item.requirementId} ${item.statement}`),
|
|
390
|
+
...feedback.reasons.map((reason) => `Reason: ${reason}`),
|
|
391
|
+
`Next: ${feedback.nextAction}`,
|
|
392
|
+
"No checks were executed and no verdict was refreshed.",
|
|
393
|
+
].join("\n"));
|
|
394
|
+
if (feedback.status !== "MATCHING_REPOSITORY_STATE" || feedback.recordedVerdict !== "VERIFIED")
|
|
395
|
+
process.exitCode = 2;
|
|
396
|
+
return;
|
|
397
|
+
}
|
|
398
|
+
if (command === "proof" && subcommand === "validate") {
|
|
399
|
+
const proofPath = rest[0];
|
|
400
|
+
if (!proofPath)
|
|
401
|
+
throw new Error("Usage: projectmind proof validate <proof.json> [--json]");
|
|
402
|
+
const proof = validateProofPack(JSON.parse(await readFile(resolve(root, proofPath), "utf8")));
|
|
403
|
+
const result = {
|
|
404
|
+
valid: true,
|
|
405
|
+
version: proof.version,
|
|
406
|
+
proofId: proof.id,
|
|
407
|
+
project: proof.project,
|
|
408
|
+
intentId: proof.intent.id,
|
|
409
|
+
status: proof.verification.status,
|
|
410
|
+
commit: proof.commit ?? null,
|
|
411
|
+
createdAt: proof.createdAt,
|
|
412
|
+
requirements: proof.verification.requirements.length,
|
|
413
|
+
evidence: proof.evidence.length,
|
|
414
|
+
};
|
|
415
|
+
if (args.options.has("json"))
|
|
416
|
+
console.log(JSON.stringify(result, null, 2));
|
|
417
|
+
else
|
|
418
|
+
console.log([
|
|
419
|
+
`VALID ProofPack v${result.version}`,
|
|
420
|
+
`Proof: ${result.proofId}`,
|
|
421
|
+
`Project: ${result.project}`,
|
|
422
|
+
`Intent: ${result.intentId}`,
|
|
423
|
+
`Verdict: ${result.status}`,
|
|
424
|
+
`Commit: ${result.commit ?? "working-tree"}`,
|
|
425
|
+
`Requirements: ${result.requirements}`,
|
|
426
|
+
`Evidence records: ${result.evidence}`,
|
|
427
|
+
].join("\n"));
|
|
428
|
+
return;
|
|
429
|
+
}
|
|
430
|
+
if (command === "proof" && subcommand === "history") {
|
|
431
|
+
const rawLimit = optionValues(args, "limit")[0];
|
|
432
|
+
const limit = rawLimit === undefined ? 20 : Number(rawLimit);
|
|
433
|
+
if (!Number.isInteger(limit) || limit < 1 || limit > 100)
|
|
434
|
+
throw new Error("Proof history limit must be an integer from 1 to 100.");
|
|
435
|
+
const intentId = optionValues(args, "intent")[0];
|
|
436
|
+
const entries = await listProofPackHistory(root, { ...(intentId ? { intentId } : {}), limit });
|
|
437
|
+
if (args.options.has("json"))
|
|
438
|
+
console.log(JSON.stringify(entries, null, 2));
|
|
439
|
+
else
|
|
440
|
+
console.log(entries.length ? [
|
|
441
|
+
`ProofPack history (${entries.length})`,
|
|
442
|
+
"",
|
|
443
|
+
...entries.map((entry) => `${entry.createdAt} ${entry.status.padEnd(18)} ${entry.intentId} ${entry.proofId}${entry.commit ? ` ${entry.commit.slice(0, 10)}` : ""}`),
|
|
444
|
+
].join("\n") : "No ProofPack history found.");
|
|
445
|
+
return;
|
|
446
|
+
}
|
|
447
|
+
if (command === "report" && subcommand === "pr-comment") {
|
|
448
|
+
const proofPath = resolve(root, rest[0] ?? join(".projectmind", "latest-proof.json"));
|
|
449
|
+
const previousPath = optionValues(args, "previous")[0];
|
|
450
|
+
const body = formatPullRequestComment(JSON.parse(await readFile(proofPath, "utf8")), ...(previousPath ? [JSON.parse(await readFile(resolve(root, previousPath), "utf8"))] : []));
|
|
451
|
+
const output = optionValues(args, "output")[0];
|
|
452
|
+
if (output)
|
|
453
|
+
await writeFile(resolve(root, output), `${body}\n`, "utf8");
|
|
454
|
+
else
|
|
455
|
+
console.log(body);
|
|
456
|
+
return;
|
|
457
|
+
}
|
|
458
|
+
if (command === "provider" && subcommand === "scaffold") {
|
|
459
|
+
const name = rest[0];
|
|
460
|
+
const providerId = optionValues(args, "id")[0];
|
|
461
|
+
if (!name || !providerId)
|
|
462
|
+
throw new Error("Usage: projectmind provider scaffold <name> --id <reverse-domain-id> [--directory <path>]");
|
|
463
|
+
const result = await scaffoldProvider(root, name, providerId, optionValues(args, "directory")[0]);
|
|
464
|
+
console.log([`Provider scaffold created: ${result.directory}`, ...result.files.map((path) => ` ${path}`)].join("\n"));
|
|
465
|
+
return;
|
|
466
|
+
}
|
|
95
467
|
if (command === "remember") {
|
|
96
468
|
const type = subcommand;
|
|
97
469
|
const text = rest.join(" ").trim();
|
|
@@ -157,6 +529,28 @@ async function main() {
|
|
|
157
529
|
await runMcpServer(mcpRoot, { allowExecution: process.env.PROJECTMIND_ALLOW_EXECUTION === "1" });
|
|
158
530
|
return;
|
|
159
531
|
}
|
|
532
|
+
if (command === "mcp-http") {
|
|
533
|
+
if (process.env.CLAUDE_PROJECT_DIR && !isAbsolute(process.env.CLAUDE_PROJECT_DIR)) {
|
|
534
|
+
throw new Error("CLAUDE_PROJECT_DIR must be an absolute path.");
|
|
535
|
+
}
|
|
536
|
+
const mcpRoot = process.env.CLAUDE_PROJECT_DIR ? resolve(process.env.CLAUDE_PROJECT_DIR) : root;
|
|
537
|
+
const rawPort = optionValues(args, "port")[0] ?? process.env.PORT ?? "3000";
|
|
538
|
+
const port = Number(rawPort);
|
|
539
|
+
if (!Number.isInteger(port) || port < 0 || port > 65_535)
|
|
540
|
+
throw new Error("MCP HTTP port must be an integer from 0 to 65535.");
|
|
541
|
+
const host = optionValues(args, "host")[0] ?? process.env.HOST ?? "127.0.0.1";
|
|
542
|
+
const server = await runMcpHttpServer(mcpRoot, {
|
|
543
|
+
host,
|
|
544
|
+
port,
|
|
545
|
+
...(process.env.PROJECTMIND_MCP_TOKEN ? { authToken: process.env.PROJECTMIND_MCP_TOKEN } : {}),
|
|
546
|
+
allowExecution: process.env.PROJECTMIND_ALLOW_EXECUTION === "1",
|
|
547
|
+
allowMutations: process.env.PROJECTMIND_ALLOW_MUTATIONS === "1",
|
|
548
|
+
});
|
|
549
|
+
const address = server.address();
|
|
550
|
+
const boundPort = typeof address === "object" && address ? address.port : port;
|
|
551
|
+
console.log(`ProjectMind MCP HTTP listening at http://${host}:${boundPort}/mcp`);
|
|
552
|
+
return;
|
|
553
|
+
}
|
|
160
554
|
throw new Error(`Unknown command.\n\n${help()}`);
|
|
161
555
|
}
|
|
162
556
|
main().catch((error) => {
|