@hegel-dev/companion 1.0.11 → 1.0.13

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,112 +1,129 @@
1
- # Hegel Companion
2
-
3
- **Dialectical companion for AI-assisted development.**
4
-
5
- Hegel sits alongside your Cursor IDE sessions and provides real-time critical thinking oversight — catching lazy prompts, flagging overconfident AI responses, tracking session quality degradation, and nudging you to maintain engineering rigor.
6
-
7
- Named after Georg Wilhelm Friedrich Hegel's dialectical method: every thesis (your prompt) deserves an antithesis (critical review) before reaching synthesis (better code).
8
-
9
- ## Two-Layer Analysis
10
-
11
- ### Layer 1: Fast Rule-Based Checks (command hooks)
12
- Runs in milliseconds, zero cost. Always active.
13
-
14
- - Detects vague/lazy prompts ("fix it", "do the same", single-word confirmations)
15
- - Catches prompt quality degradation over the session
16
- - Flags rapid-fire prompting without review pauses
17
- - Tracks scope creep and untested changes
18
- - Detects overconfident AI language and sycophancy patterns
19
- - Session fatigue warnings
20
- - Tuned heuristics for common workflows: attached-plan execution (fewer spurious `missing-criteria` nags), release/install/consumer threads (fewer spurious `context-drift` flags), and pruning stale test warnings after later verification evidence
21
-
22
- ### Layer 2: LLM Deep Analysis (prompt hooks)
23
- Uses your Cursor subscription models. Optional, configurable.
24
-
25
- - **Important Limitation:** Because of how Cursor currently implements `type: "prompt"` hooks, Layer 2 LLM evaluations are only presented as ephemeral blocking UI popups in the chat. They are *not* recorded in the session history and do not appear in the Hegel dashboard or MCP tools.
26
- - When you pick a concrete model in settings (anything other than `auto`), setup regenerates `.cursor/hooks.json` so Layer 2 hooks request that routing ID explicitly.
27
- - Nuanced prompt quality evaluation beyond pattern matching
28
- - Contextual assessment of whether a prompt has enough detail for its intent
29
- - AI response review for missing edge cases, security blind spots, and scope creep
30
- - Detects when you're blindly continuing from a previous AI response
31
-
32
- ## Setup
33
-
34
- ### Installation
35
-
36
- Install the package and run the setup CLI from your Cursor project root. Hegel automatically detects and supports `npm`, `pnpm`, `yarn`, and `bun` based on your project lockfiles.
37
-
38
- Using npm as an example:
39
-
40
- ```bash
41
- npm install --save-dev @hegel-dev/companion
42
- npx hegel-companion init .
43
- ```
44
-
45
- Or, for a one-shot install without adding a dependency:
46
-
47
- ```bash
48
- npx @hegel-dev/companion init .
49
- ```
50
-
51
- > **Note:** This package was previously published as `hegel-companion`. That name is now deprecated — use `@hegel-dev/companion` for new installs. The CLI command (`hegel-companion`) is unchanged.
52
-
53
- The bundled sidebar VSIX declares **`engines.vscode` ^1.105.0** with **`@types/vscode` ~1.105.0**, aligned with Cursor builds that report VS Code **1.105.x** (see `hegel-vscode/package.json`).
54
-
55
- This single command will:
56
- 1. Generate `.cursor/hooks.json` to wire up the analysis layers.
57
- 2. Scaffold a default `hegel.config.json` in your project root.
58
- 3. Register the `hegel-mcp` server in `.cursor/mcp.json`.
59
- 4. Install the Hegel Cursor extension for the sidebar dashboard.
60
- 5. Add a `.cursor/rules/hegel-companion.mdc` rule so the AI knows how to use the MCP tools.
61
-
62
- ### Update An Existing Install
63
-
64
- For projects that already have Hegel installed:
65
-
66
- ```bash
67
- npm install @hegel-dev/companion@latest
68
- npx hegel-companion update .
69
- ```
70
-
71
- If an older local install does not recognize `update`, run the same two commands
72
- above. The first command upgrades the CLI; the second refreshes hooks, MCP, and
73
- the bundled sidebar extension.
74
-
75
- ### Clean Up Old Sessions
76
-
77
- To recompute session states and prune stale concerns or bugs from older versions, run:
78
-
79
- ```bash
80
- npx hegel-companion cleanup .
81
- ```
82
-
83
- ### Configure
84
-
85
- The easiest way to configure Hegel is through the **Cursor Settings UI**:
86
-
87
- 1. Open Settings (`Cmd/Ctrl + ,`)
88
- 2. Search for **"Hegel"**
89
- 3. Adjust your model, strictness, and other preferences.
90
-
91
- These settings automatically sync to a `hegel.config.json` file in your project root, which you can commit to version control to share team-wide standards.
92
-
93
- *(Note: Configuration changes are automatically detected when you start a new chat session).*
94
-
95
- ## Architecture
96
-
97
- Hegel operates as a local, privacy-first system:
98
- - **Hooks**: Intercepts prompts and responses via Cursor's `.cursor/hooks.json`.
99
- - **State**: Session state is stored locally in `.hegel-state/` as JSON files.
100
- - **MCP Server**: Provides `hegel-status` and `hegel-review` tools to the AI.
101
- - **Cursor Extension**: Reads the local state to power the sidebar dashboard and status bar.
102
-
103
- ## Philosophy
104
-
105
- > "The owl of Minerva spreads its wings only with the falling of the dusk."
106
- > Hegel, *Philosophy of Right*
107
-
108
- Unlike Minerva's owl, Hegel doesn't wait for dusk. It watches in real time, helping you think critically *during* the creative process, not only in retrospect.
109
-
110
- ## License
111
-
112
- MIT
1
+ # Hegel Companion
2
+
3
+ **Dialectical companion for AI-assisted development.**
4
+
5
+ Hegel sits alongside your Cursor IDE sessions and provides real-time critical thinking oversight — catching lazy prompts, flagging overconfident AI responses, tracking session quality degradation, and nudging you to maintain engineering rigor.
6
+
7
+ Named after Georg Wilhelm Friedrich Hegel's dialectical method: every thesis (your prompt) deserves an antithesis (critical review) before reaching synthesis (better code).
8
+
9
+ ## Two-Layer Analysis
10
+
11
+ ### Layer 1: Fast Rule-Based Checks (command hooks)
12
+ Runs in milliseconds, zero cost. Always active.
13
+
14
+ - Detects vague/lazy prompts ("fix it", "do the same", single-word confirmations)
15
+ - Catches prompt quality degradation over the session
16
+ - Flags rapid-fire prompting without review pauses
17
+ - Tracks scope creep and untested changes
18
+ - Detects overconfident AI language and sycophancy patterns
19
+ - Session fatigue warnings
20
+ - Tuned heuristics for common workflows: attached-plan execution (fewer spurious `missing-criteria` nags), release/install/consumer threads (fewer spurious `context-drift` flags), and pruning stale test warnings after later verification evidence
21
+
22
+ ### Layer 2: LLM Deep Analysis (prompt hooks)
23
+ Uses your Cursor subscription models. Optional, configurable.
24
+
25
+ - **Important Limitation:** Because of how Cursor currently implements `type: "prompt"` hooks, Layer 2 LLM evaluations are only presented as ephemeral blocking UI popups in the chat. They are *not* recorded in the session history and do not appear in the Hegel dashboard or MCP tools.
26
+ - When you pick a concrete model in settings (anything other than `auto`), setup regenerates `.cursor/hooks.json` so Layer 2 hooks request that routing ID explicitly.
27
+ - Nuanced prompt quality evaluation beyond pattern matching
28
+ - Contextual assessment of whether a prompt has enough detail for its intent
29
+ - AI response review for missing edge cases, security blind spots, and scope creep
30
+ - Detects when you're blindly continuing from a previous AI response
31
+
32
+ ## Setup
33
+
34
+ ### Installation
35
+
36
+ Install the package and run the setup CLI from your Cursor project root. Hegel automatically detects and supports `npm`, `pnpm`, `yarn`, and `bun` based on your project lockfiles.
37
+
38
+ Using npm as an example:
39
+
40
+ ```bash
41
+ npm install --save-dev @hegel-dev/companion
42
+ npx hegel-companion init .
43
+ ```
44
+
45
+ Or, for a one-shot install without adding a dependency:
46
+
47
+ ```bash
48
+ npx @hegel-dev/companion init .
49
+ ```
50
+
51
+ > **Note:** This package was previously published as `hegel-companion`. That name is now deprecated — use `@hegel-dev/companion` for new installs. The CLI command (`hegel-companion`) is unchanged.
52
+
53
+ The bundled sidebar VSIX declares **`engines.vscode` ^1.105.0** with **`@types/vscode` ~1.105.0**, aligned with Cursor builds that report VS Code **1.105.x** (see `hegel-vscode/package.json`).
54
+
55
+ This single command will:
56
+ 1. Generate `.cursor/hooks.json` to wire up the analysis layers.
57
+ 2. Scaffold a default `hegel.config.json` in your project root.
58
+ 3. Register the `hegel-mcp` server in `.cursor/mcp.json`.
59
+ 4. Install the Hegel Cursor extension for the sidebar dashboard.
60
+ 5. Add a `.cursor/rules/hegel-companion.mdc` rule so the AI knows how to use the MCP tools.
61
+
62
+ ### Update An Existing Install
63
+
64
+ For projects that already have Hegel installed:
65
+
66
+ ```bash
67
+ npm install @hegel-dev/companion@latest
68
+ npx hegel-companion update .
69
+ ```
70
+
71
+ If an older local install does not recognize `update`, run the same two commands
72
+ above. The first command upgrades the CLI; the second refreshes hooks, MCP, and
73
+ the bundled sidebar extension.
74
+
75
+ ### Clean Up Old Sessions
76
+
77
+ To recompute session states and prune stale concerns or bugs from older versions, run:
78
+
79
+ ```bash
80
+ npx hegel-companion cleanup .
81
+ ```
82
+
83
+ ### Uninstall
84
+
85
+ To completely remove Hegel from a project, run:
86
+
87
+ ```bash
88
+ npx hegel-companion uninstall .
89
+ ```
90
+
91
+ This command will:
92
+ 1. Remove `hegel.config.json` and `.hegel-state/`.
93
+ 2. Remove `.cursor/rules/hegel-companion.mdc`.
94
+ 3. Clean up `.cursor/hooks.json` and `.cursor/mcp.json` (removing them entirely if they are empty).
95
+ 4. Clean up Hegel-specific settings from `.vscode/settings.json`.
96
+ 5. Clean up Hegel-specific entries from `.gitignore`.
97
+ 6. Uninstall the VS Code extension from Cursor.
98
+ 7. Uninstall the `@hegel-dev/companion` npm package.
99
+
100
+ ### Configure
101
+
102
+ The easiest way to configure Hegel is through the **Cursor Settings UI**:
103
+
104
+ 1. Open Settings (`Cmd/Ctrl + ,`)
105
+ 2. Search for **"Hegel"**
106
+ 3. Adjust your model, strictness, and other preferences.
107
+
108
+ These settings automatically sync to a `hegel.config.json` file in your project root, which you can commit to version control to share team-wide standards.
109
+
110
+ *(Note: Configuration changes are automatically detected when you start a new chat session).*
111
+
112
+ ## Architecture
113
+
114
+ Hegel operates as a local, privacy-first system:
115
+ - **Hooks**: Intercepts prompts and responses via Cursor's `.cursor/hooks.json`.
116
+ - **State**: Session state is stored locally in `.hegel-state/` as JSON files.
117
+ - **MCP Server**: Provides `hegel-status` and `hegel-review` tools to the AI.
118
+ - **Cursor Extension**: Reads the local state to power the sidebar dashboard and status bar.
119
+
120
+ ## Philosophy
121
+
122
+ > "The owl of Minerva spreads its wings only with the falling of the dusk."
123
+ > — Hegel, *Philosophy of Right*
124
+
125
+ Unlike Minerva's owl, Hegel doesn't wait for dusk. It watches in real time, helping you think critically *during* the creative process, not only in retrospect.
126
+
127
+ ## License
128
+
129
+ MIT
@@ -0,0 +1,3 @@
1
+ import type { SetupDeps } from "./types.js";
2
+ export declare function runUninstall(argv?: string[], deps?: SetupDeps): Promise<number>;
3
+ //# sourceMappingURL=uninstall.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"uninstall.d.ts","sourceRoot":"","sources":["../../src/commands/uninstall.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAK5C,wBAAsB,YAAY,CAChC,IAAI,GAAE,MAAM,EAAiB,EAC7B,IAAI,GAAE,SAAuB,GAC5B,OAAO,CAAC,MAAM,CAAC,CA8JjB"}
@@ -0,0 +1,163 @@
1
+ import { resolve, join } from "node:path";
2
+ import { defaultDeps } from "./types.js";
3
+ import { uninstallPackage } from "../utils/package-manager.js";
4
+ import { execCommandSync, getCursorCliCandidates } from "../utils/install.js";
5
+ export async function runUninstall(argv = process.argv, deps = defaultDeps) {
6
+ const rest = argv.slice(2);
7
+ const positional = rest.filter((a) => !a.startsWith("--"));
8
+ const targetDir = positional[1] ?? ".";
9
+ const projectPath = resolve(targetDir);
10
+ const skipNpm = rest.includes("--skip-npm");
11
+ deps.log(`Uninstalling Hegel from ${projectPath}...`);
12
+ // 1. Remove files and directories
13
+ const toRemove = [
14
+ "hegel.config.json",
15
+ ".hegel-state",
16
+ join(".cursor", "rules", "hegel-companion.mdc")
17
+ ];
18
+ for (const relPath of toRemove) {
19
+ const p = join(projectPath, relPath);
20
+ try {
21
+ await deps.rm(p, { recursive: true, force: true });
22
+ deps.log(` Removed ${relPath}`);
23
+ }
24
+ catch {
25
+ // ignore
26
+ }
27
+ }
28
+ // 2. Clean up hooks.json
29
+ const hooksPath = join(projectPath, ".cursor", "hooks.json");
30
+ try {
31
+ const content = await deps.readFile(hooksPath, "utf-8");
32
+ const parsed = JSON.parse(content);
33
+ if (parsed._hegel) {
34
+ delete parsed._hegel;
35
+ // Remove Hegel hooks (we know them by command ending in dist/hook.js)
36
+ if (parsed.hooks) {
37
+ for (const event of Object.keys(parsed.hooks)) {
38
+ parsed.hooks[event] = parsed.hooks[event].filter((h) => !(h.command && h.command.includes("dist/hook.js")) && !(h.prompt && h.prompt.includes("You are Hegel")));
39
+ if (parsed.hooks[event].length === 0) {
40
+ delete parsed.hooks[event];
41
+ }
42
+ }
43
+ }
44
+ if (Object.keys(parsed.hooks || {}).length === 0) {
45
+ await deps.rm(hooksPath, { force: true });
46
+ deps.log(` Removed empty .cursor/hooks.json`);
47
+ }
48
+ else {
49
+ await deps.writeFile(hooksPath, JSON.stringify(parsed, null, 2) + "\n", "utf-8");
50
+ deps.log(` Cleaned Hegel entries from .cursor/hooks.json`);
51
+ }
52
+ }
53
+ }
54
+ catch {
55
+ // ignore
56
+ }
57
+ // 3. Clean up mcp.json
58
+ const mcpPath = join(projectPath, ".cursor", "mcp.json");
59
+ try {
60
+ const content = await deps.readFile(mcpPath, "utf-8");
61
+ const parsed = JSON.parse(content);
62
+ if (parsed.mcpServers && parsed.mcpServers["hegel-mcp"]) {
63
+ delete parsed.mcpServers["hegel-mcp"];
64
+ if (Object.keys(parsed.mcpServers).length === 0) {
65
+ await deps.rm(mcpPath, { force: true });
66
+ deps.log(` Removed empty .cursor/mcp.json`);
67
+ }
68
+ else {
69
+ await deps.writeFile(mcpPath, JSON.stringify(parsed, null, 2) + "\n", "utf-8");
70
+ deps.log(` Cleaned hegel-mcp from .cursor/mcp.json`);
71
+ }
72
+ }
73
+ }
74
+ catch {
75
+ // ignore
76
+ }
77
+ // 4. Uninstall VS Code extension
78
+ deps.log(` Uninstalling VS Code extension...`);
79
+ try {
80
+ execCommandSync("cursor", ["--uninstall-extension", "hegel.hegel-companion"], deps, { stdio: "ignore" });
81
+ deps.log(` Uninstalled extension hegel.hegel-companion`);
82
+ }
83
+ catch {
84
+ // Try fallback candidates
85
+ const candidates = getCursorCliCandidates(deps.platform, deps.env);
86
+ let uninstalled = false;
87
+ for (const cand of candidates) {
88
+ try {
89
+ await deps.access(cand);
90
+ execCommandSync(cand, ["--uninstall-extension", "hegel.hegel-companion"], deps, { stdio: "ignore" });
91
+ deps.log(` Uninstalled extension hegel.hegel-companion via ${cand}`);
92
+ uninstalled = true;
93
+ break;
94
+ }
95
+ catch {
96
+ // ignore
97
+ }
98
+ }
99
+ if (!uninstalled) {
100
+ deps.log(` Could not automatically uninstall extension. Run manually: cursor --uninstall-extension hegel.hegel-companion`);
101
+ }
102
+ }
103
+ // 5. Uninstall npm package
104
+ if (!skipNpm) {
105
+ deps.log(` Uninstalling @hegel-dev/companion package...`);
106
+ try {
107
+ await uninstallPackage("@hegel-dev/companion", projectPath, deps);
108
+ }
109
+ catch (err) {
110
+ deps.log(` Failed to uninstall package: ${err instanceof Error ? err.message : String(err)}`);
111
+ }
112
+ }
113
+ // 6. Clean up .vscode/settings.json
114
+ const settingsPath = join(projectPath, ".vscode", "settings.json");
115
+ try {
116
+ const content = await deps.readFile(settingsPath, "utf-8");
117
+ const parsed = JSON.parse(content);
118
+ let changed = false;
119
+ for (const key of Object.keys(parsed)) {
120
+ if (key.startsWith("hegel.")) {
121
+ delete parsed[key];
122
+ changed = true;
123
+ }
124
+ }
125
+ if (changed) {
126
+ if (Object.keys(parsed).length === 0) {
127
+ await deps.rm(settingsPath, { force: true });
128
+ deps.log(` Removed empty .vscode/settings.json`);
129
+ }
130
+ else {
131
+ await deps.writeFile(settingsPath, JSON.stringify(parsed, null, 2) + "\n", "utf-8");
132
+ deps.log(` Cleaned Hegel entries from .vscode/settings.json`);
133
+ }
134
+ }
135
+ }
136
+ catch {
137
+ // ignore
138
+ }
139
+ // 7. Clean up .gitignore
140
+ const gitignorePath = join(projectPath, ".gitignore");
141
+ try {
142
+ const content = await deps.readFile(gitignorePath, "utf-8");
143
+ const lines = content.split(/\r?\n/);
144
+ const toRemoveLines = new Set([
145
+ ".hegel-state",
146
+ ".hegel-state/",
147
+ "hegel.config.json",
148
+ "hegel-mcp",
149
+ "hegel-mcp/"
150
+ ]);
151
+ const filtered = lines.filter(line => !toRemoveLines.has(line.trim()));
152
+ if (filtered.length !== lines.length) {
153
+ await deps.writeFile(gitignorePath, filtered.join("\n"), "utf-8");
154
+ deps.log(` Cleaned Hegel entries from .gitignore`);
155
+ }
156
+ }
157
+ catch {
158
+ // ignore
159
+ }
160
+ deps.log(`✅ Hegel uninstalled successfully.`);
161
+ return 0;
162
+ }
163
+ //# sourceMappingURL=uninstall.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"uninstall.js","sourceRoot":"","sources":["../../src/commands/uninstall.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAE1C,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,eAAe,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAE9E,MAAM,CAAC,KAAK,UAAU,YAAY,CAChC,OAAiB,OAAO,CAAC,IAAI,EAC7B,OAAkB,WAAW;IAE7B,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IAC3B,MAAM,UAAU,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC;IAC3D,MAAM,SAAS,GAAG,UAAU,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC;IACvC,MAAM,WAAW,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;IACvC,MAAM,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC;IAE5C,IAAI,CAAC,GAAG,CAAC,2BAA2B,WAAW,KAAK,CAAC,CAAC;IAEtD,kCAAkC;IAClC,MAAM,QAAQ,GAAG;QACf,mBAAmB;QACnB,cAAc;QACd,IAAI,CAAC,SAAS,EAAE,OAAO,EAAE,qBAAqB,CAAC;KAChD,CAAC;IAEF,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;QAC/B,MAAM,CAAC,GAAG,IAAI,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC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/path.js";
7
7
  import { runUpdate } from "./commands/update.js";
8
8
  import { runCleanup } from "./commands/cleanup.js";
9
+ import { runUninstall } from "./commands/uninstall.js";
9
10
  import { type SetupDeps } from "./commands/types.js";
10
- export { runUpdate, runCleanup };
11
+ export { runUpdate, runCleanup, runUninstall };
11
12
  export declare function runSetup(argv?: string[], deps?: SetupDeps): Promise<number>;
12
13
  //# sourceMappingURL=setup.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["../src/setup.ts"],"names":[],"mappings":";AAKA,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,iBAAiB,CAAC;AAIhC,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAe,KAAK,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAElE,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,CAAC;AAEjC,wBAAsB,QAAQ,CAC5B,IAAI,GAAE,MAAM,EAAiB,EAC7B,IAAI,GAAE,SAAuB,GAC5B,OAAO,CAAC,MAAM,CAAC,CAqDjB"}
1
+ {"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["../src/setup.ts"],"names":[],"mappings":";AAKA,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,iBAAiB,CAAC;AAIhC,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAe,KAAK,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAElE,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,YAAY,EAAE,CAAC;AAE/C,wBAAsB,QAAQ,CAC5B,IAAI,GAAE,MAAM,EAAiB,EAC7B,IAAI,GAAE,SAAuB,GAC5B,OAAO,CAAC,MAAM,CAAC,CAyDjB"}
package/dist/setup.js CHANGED
@@ -11,8 +11,9 @@ export * from "./utils/path.js";
11
11
  import { runInit } from "./commands/init.js";
12
12
  import { runUpdate } from "./commands/update.js";
13
13
  import { runCleanup } from "./commands/cleanup.js";
14
+ import { runUninstall } from "./commands/uninstall.js";
14
15
  import { defaultDeps } from "./commands/types.js";
15
- export { runUpdate, runCleanup };
16
+ export { runUpdate, runCleanup, runUninstall };
16
17
  export async function runSetup(argv = process.argv, deps = defaultDeps) {
17
18
  const rest = argv.slice(2);
18
19
  const positional = rest.filter((a) => !a.startsWith("--"));
@@ -23,6 +24,9 @@ export async function runSetup(argv = process.argv, deps = defaultDeps) {
23
24
  if (command === "cleanup") {
24
25
  return runCleanup(argv, deps);
25
26
  }
27
+ if (command === "uninstall") {
28
+ return runUninstall(argv, deps);
29
+ }
26
30
  if (command === "init" && positional[1] === "update") {
27
31
  deps.error("Error: 'update' is a command, not a project path.");
28
32
  deps.error(" If your installed Hegel version does not know `update`, upgrade first:");
@@ -47,9 +51,10 @@ export async function runSetup(argv = process.argv, deps = defaultDeps) {
47
51
  deps.log(" update [project-path] Reinstall @hegel-dev/companion@latest, refresh config,");
48
52
  deps.log(" prune orphan dirs (default path: .)");
49
53
  deps.log(" cleanup [project-path] Prune stale concerns and recompute session states");
54
+ deps.log(" uninstall [project-path] Remove Hegel configuration, hooks, MCP, and extension");
50
55
  deps.log("");
51
56
  deps.log("Use '.' for the current directory. Pass --force on init to bypass safety checks.");
52
- deps.log("Pass --skip-npm on update to skip the dependency upgrade step.");
57
+ deps.log("Pass --skip-npm on update or uninstall to skip the dependency step.");
53
58
  deps.log("");
54
59
  deps.log("Current config:");
55
60
  const config = await deps.loadConfig();
package/dist/setup.js.map CHANGED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K,CAAC;YAAE,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC7C,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;QACf,WAAW,CAAC,KAAK,CAAC,iBAAiB,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QACvF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -1,4 +1,5 @@
1
1
  import { readFile, access } from "node:fs/promises";
2
+ import type { SetupDeps } from "../commands/types.js";
2
3
  /**
3
4
  * Reads the version of @hegel-dev/companion from the consumer's
4
5
  * node_modules/, returning null if not installed (e.g. source-repo mode).
@@ -8,4 +9,5 @@ export declare function readInstalledCompanionVersion(projectPath: string, readF
8
9
  * Detect the package manager used in the project by checking for lockfiles.
9
10
  */
10
11
  export declare function detectPackageManager(projectPath: string, accessFn?: typeof access): Promise<"npm" | "pnpm" | "yarn" | "bun">;
12
+ export declare function uninstallPackage(pkg: string, cwd: string, deps: Pick<SetupDeps, "execFileSync" | "platform">): Promise<void>;
11
13
  //# sourceMappingURL=package-manager.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"package-manager.d.ts","sourceRoot":"","sources":["../../src/utils/package-manager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAGpD;;;GAGG;AACH,wBAAsB,6BAA6B,CACjD,WAAW,EAAE,MAAM,EACnB,UAAU,GAAE,OAAO,QAAmB,GACrC,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CASxB;AAED;;GAEG;AACH,wBAAsB,oBAAoB,CACxC,WAAW,EAAE,MAAM,EACnB,QAAQ,GAAE,OAAO,MAAe,GAC/B,OAAO,CAAC,KAAK,GAAG,MAAM,GAAG,MAAM,GAAG,KAAK,CAAC,CAM1C"}
1
+ {"version":3,"file":"package-manager.d.ts","sourceRoot":"","sources":["../../src/utils/package-manager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAEpD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAGtD;;;GAGG;AACH,wBAAsB,6BAA6B,CACjD,WAAW,EAAE,MAAM,EACnB,UAAU,GAAE,OAAO,QAAmB,GACrC,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CASxB;AAED;;GAEG;AACH,wBAAsB,oBAAoB,CACxC,WAAW,EAAE,MAAM,EACnB,QAAQ,GAAE,OAAO,MAAe,GAC/B,OAAO,CAAC,KAAK,GAAG,MAAM,GAAG,MAAM,GAAG,KAAK,CAAC,CAM1C;AAED,wBAAsB,gBAAgB,CACpC,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,IAAI,CAAC,SAAS,EAAE,cAAc,GAAG,UAAU,CAAC,GACjD,OAAO,CAAC,IAAI,CAAC,CAIf"}
@@ -1,5 +1,6 @@
1
1
  import { readFile, access } from "node:fs/promises";
2
2
  import { join } from "node:path";
3
+ import { execCommandSync } from "./install.js";
3
4
  /**
4
5
  * Reads the version of @hegel-dev/companion from the consumer's
5
6
  * node_modules/, returning null if not installed (e.g. source-repo mode).
@@ -41,4 +42,9 @@ export async function detectPackageManager(projectPath, accessFn = access) {
41
42
  catch { }
42
43
  return "npm";
43
44
  }
45
+ export async function uninstallPackage(pkg, cwd, deps) {
46
+ const pm = await detectPackageManager(cwd);
47
+ const args = pm === "npm" ? ["uninstall", pkg] : ["remove", pkg];
48
+ execCommandSync(pm, args, deps, { stdio: "inherit", cwd });
49
+ }
44
50
  //# sourceMappingURL=package-manager.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"package-manager.js","sourceRoot":"","sources":["../../src/utils/package-manager.ts"],"names":[],"mappings":"AA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,IAAI,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC,CAAC;QAAC,OAAO,MAAM,CAAC;IAAC,CAAC;IAAC,MAAM,CAAC,CAAA,CAAC;IAC/E,IAAI,CAAC;QAAC,MAAM,QAAQ,CAAC,IAAI,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC,CAAC;QAAC,OAAO,KAAK,CAAC;IAAC,CAAC;IAAC,MAAM,CAAC,CAAA,CAAC;IAC9E,IAAI,CAAC;QAAC,MAAM,QAAQ,CAAC,IAAI,CAAC,WAAW,EAAE,UAAU,CAAC,CAAC,CAAC;QAAC,OAAO,KAAK,CAAC;IAAC,CAAC;IAAC,MAAM,CAAC,CAAA,CAAC;IAC7E,OAAO,KAAK,CAAC;AACf,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,gBAAgB,CACpC,GAAW,EACX,GAAW,EACX,IAAkD;IAElD,MAAM,EAAE,GAAG,MAAM,oBAAoB,CAAC,GAAG,CAAC,CAAC;IAC3C,MAAM,IAAI,GAAG,EAAE,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC;IACjE,eAAe,CAAC,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG,EAAE,CAAC,CAAC;AAC7D,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hegel-dev/companion",
3
- "version": "1.0.11",
3
+ "version": "1.0.13",
4
4
  "description": "Dialectical companion for AI-assisted development — real-time critical thinking oversight for Cursor IDE sessions",
5
5
  "type": "module",
6
6
  "publishConfig": {