@hegel-dev/companion 1.0.8 → 1.0.9

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.
Files changed (57) hide show
  1. package/README.md +13 -2
  2. package/dist/commands/cleanup.d.ts +3 -0
  3. package/dist/commands/cleanup.d.ts.map +1 -0
  4. package/dist/commands/cleanup.js +51 -0
  5. package/dist/commands/cleanup.js.map +1 -0
  6. package/dist/commands/init.d.ts +3 -0
  7. package/dist/commands/init.d.ts.map +1 -0
  8. package/dist/commands/init.js +142 -0
  9. package/dist/commands/init.js.map +1 -0
  10. package/dist/commands/types.d.ts +22 -0
  11. package/dist/commands/types.d.ts.map +1 -0
  12. package/dist/commands/types.js +23 -0
  13. package/dist/commands/types.js.map +1 -0
  14. package/dist/commands/update.d.ts +3 -0
  15. package/dist/commands/update.d.ts.map +1 -0
  16. package/dist/commands/update.js +90 -0
  17. package/dist/commands/update.js.map +1 -0
  18. package/dist/config.d.ts +0 -2
  19. package/dist/config.d.ts.map +1 -1
  20. package/dist/config.js +0 -1
  21. package/dist/config.js.map +1 -1
  22. package/dist/hook.d.ts +0 -17
  23. package/dist/hook.d.ts.map +1 -1
  24. package/dist/hook.js +3 -26
  25. package/dist/hook.js.map +1 -1
  26. package/dist/hooks-generator.d.ts +0 -4
  27. package/dist/hooks-generator.d.ts.map +1 -1
  28. package/dist/hooks-generator.js +2 -7
  29. package/dist/hooks-generator.js.map +1 -1
  30. package/dist/prompts.d.ts +2 -2
  31. package/dist/prompts.d.ts.map +1 -1
  32. package/dist/prompts.js +4 -24
  33. package/dist/prompts.js.map +1 -1
  34. package/dist/setup.d.ts +9 -90
  35. package/dist/setup.d.ts.map +1 -1
  36. package/dist/setup.js +24 -548
  37. package/dist/setup.js.map +1 -1
  38. package/dist/utils/install.d.ts +13 -0
  39. package/dist/utils/install.d.ts.map +1 -0
  40. package/dist/utils/install.js +112 -0
  41. package/dist/utils/install.js.map +1 -0
  42. package/dist/utils/package-manager.d.ts +11 -0
  43. package/dist/utils/package-manager.d.ts.map +1 -0
  44. package/dist/utils/package-manager.js +44 -0
  45. package/dist/utils/package-manager.js.map +1 -0
  46. package/dist/utils/path.d.ts +15 -0
  47. package/dist/utils/path.d.ts.map +1 -0
  48. package/dist/utils/path.js +20 -0
  49. package/dist/utils/path.js.map +1 -0
  50. package/dist/utils/workspace.d.ts +13 -0
  51. package/dist/utils/workspace.d.ts.map +1 -0
  52. package/dist/utils/workspace.js +79 -0
  53. package/dist/utils/workspace.js.map +1 -0
  54. package/hegel-vscode/hegel-companion-1.0.9.vsix +0 -0
  55. package/hegel.config.schema.json +0 -5
  56. package/package.json +1 -1
  57. package/hegel-vscode/hegel-companion-1.0.8.vsix +0 -0
@@ -31,10 +31,6 @@ export declare function readExistingHash(hooksFilePath: string): Promise<string
31
31
  * the sessionStart hot-reload check.
32
32
  */
33
33
  export declare function generateHooksConfig(config: HegelConfig): HooksConfig;
34
- /**
35
- * Writes hooks.json to a target project directory.
36
- * Returns true if the file was written, false if no update was needed.
37
- */
38
34
  /**
39
35
  * Writes hooks.json to a target project directory.
40
36
  * Returns true if the file was written, false if no update was needed.
@@ -1 +1 @@
1
- {"version":3,"file":"hooks-generator.d.ts","sourceRoot":"","sources":["../src/hooks-generator.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAO/C,UAAU,SAAS;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,UAAU,WAAW;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,EAAE,CAAC,CAAC;IACnC,MAAM,CAAC,EAAE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AAM,GAAG,IAAI,CAAC,CAQpF;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,WAAW,GAAG,WAAW,CA0DpE;AAED;;;;GAIG;AACH,wBAAsB,cAAc,CAClC,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,WAAW,EACnB,KAAK,UAAQ,GACZ,OAAO,CAAC,OAAO,CAAC,CAclB"}
@@ -14,7 +14,6 @@ export function configHash(config) {
14
14
  const significant = {
15
15
  enableLlmAnalysis: config.enableLlmAnalysis,
16
16
  strictness: config.strictness,
17
- observeOnly: config.observeOnly,
18
17
  model: config.model,
19
18
  timeoutSeconds: config.timeoutSeconds,
20
19
  };
@@ -73,8 +72,8 @@ export function generateHooksConfig(config) {
73
72
  },
74
73
  };
75
74
  if (config.enableLlmAnalysis) {
76
- const promptAnalysis = buildPromptAnalysisPrompt(config.strictness, config.observeOnly);
77
- const responseAnalysis = buildResponseAnalysisPrompt(config.strictness, config.observeOnly);
75
+ const promptAnalysis = buildPromptAnalysisPrompt(config.strictness);
76
+ const responseAnalysis = buildResponseAnalysisPrompt(config.strictness);
78
77
  const promptHook = {
79
78
  type: "prompt",
80
79
  prompt: promptAnalysis,
@@ -94,10 +93,6 @@ export function generateHooksConfig(config) {
94
93
  }
95
94
  return hooks;
96
95
  }
97
- /**
98
- * Writes hooks.json to a target project directory.
99
- * Returns true if the file was written, false if no update was needed.
100
- */
101
96
  /**
102
97
  * Writes hooks.json to a target project directory.
103
98
  * Returns true if the file was written, false if no update was needed.
@@ -1 +1 @@
1
- {"version":3,"file":"hooks-generator.js","sourceRoot":"","sources":["../src/hooks-generator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAC9D,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC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C;IAC3E,OAAO,IAAI,CAAC;AACd,CAAC"}
package/dist/prompts.d.ts CHANGED
@@ -6,6 +6,6 @@
6
6
  * $ARGUMENTS is auto-replaced with the hook input JSON.
7
7
  */
8
8
  export type StrictnessLevel = "relaxed" | "balanced" | "strict";
9
- export declare function buildPromptAnalysisPrompt(strictness: StrictnessLevel, bypass: boolean): string;
10
- export declare function buildResponseAnalysisPrompt(strictness: StrictnessLevel, bypass: boolean): string;
9
+ export declare function buildPromptAnalysisPrompt(strictness: StrictnessLevel): string;
10
+ export declare function buildResponseAnalysisPrompt(strictness: StrictnessLevel): string;
11
11
  //# sourceMappingURL=prompts.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"prompts.d.ts","sourceRoot":"","sources":["../src/prompts.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,MAAM,MAAM,eAAe,GAAG,SAAS,GAAG,UAAU,GAAG,QAAQ,CAAC;AAWhE,wBAAgB,yBAAyB,CAAC,UAAU,EAAE,eAAe,EAAE,MAAM,EAAE,OAAO,GAAG,MAAM,CAqC9F;AAED,wBAAgB,2BAA2B,CAAC,UAAU,EAAE,eAAe,EAAE,MAAM,EAAE,OAAO,GAAG,MAAM,CAmChG"}
1
+ {"version":3,"file":"prompts.d.ts","sourceRoot":"","sources":["../src/prompts.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,MAAM,MAAM,eAAe,GAAG,SAAS,GAAG,UAAU,GAAG,QAAQ,CAAC;AAWhE,wBAAgB,yBAAyB,CAAC,UAAU,EAAE,eAAe,GAAG,MAAM,CA0B7E;AAED,wBAAgB,2BAA2B,CAAC,UAAU,EAAE,eAAe,GAAG,MAAM,CAwB/E"}
package/dist/prompts.js CHANGED
@@ -10,22 +10,12 @@ const STRICTNESS_GUIDANCE = {
10
10
  balanced: "Flag prompts that lack specificity, miss acceptance criteria for significant tasks, or skip verification after major changes. Allow clear, purposeful prompts even if brief.",
11
11
  strict: "Scrutinize every prompt rigorously. Question assumptions, demand explicit acceptance criteria, flag any missing context, and challenge prompts that don't reference specific files or behaviors.",
12
12
  };
13
- export function buildPromptAnalysisPrompt(strictness, bypass) {
14
- const bypassBlock = bypass
15
- ? `## OBSERVE-ONLY MODE (ACTIVE)
16
-
17
- You are in observe-only mode. This is a hard rule that overrides everything below.
18
- - **You MUST always return ok=true.** Never return ok=false. Never block the prompt.
19
- - Still provide your full analysis in the reason field so it gets logged for tuning.
20
- - Format the reason as: "OBSERVE: <your analysis here>"
21
-
22
- `
23
- : "";
13
+ export function buildPromptAnalysisPrompt(strictness) {
24
14
  return `You are Hegel, a dialectical critical thinking companion for AI-assisted software development.
25
15
 
26
16
  Your role: analyze the developer's prompt BEFORE it reaches the AI coding assistant. You are the antithesis — challenging the thesis (the prompt) so the developer reaches a better synthesis.
27
17
 
28
- ${bypassBlock}## Evaluation criteria
18
+ ## Evaluation criteria
29
19
 
30
20
  1. **Clarity**: Is the intent specific enough for an AI to act on without guessing?
31
21
  2. **Context**: Does the prompt reference concrete files, functions, behaviors, or error messages — or does it rely on ambiguous pronouns and implicit context?
@@ -47,22 +37,12 @@ Analyze the user prompt provided in $ARGUMENTS (the "prompt" field).
47
37
  - Do NOT flag follow-up directives that reference items from a previous AI response (e.g., "fix #3 and #5" referencing a numbered list the AI just provided).
48
38
  - Focus on prompts that will lead to CODE CHANGES without sufficient guidance.`;
49
39
  }
50
- export function buildResponseAnalysisPrompt(strictness, bypass) {
51
- const bypassBlock = bypass
52
- ? `## OBSERVE-ONLY MODE (ACTIVE)
53
-
54
- You are in observe-only mode. This is a hard rule that overrides everything below.
55
- - **You MUST always return ok=true.** Never return ok=false. Never block the response.
56
- - Still provide your full analysis in the reason field so it gets logged for tuning.
57
- - Format the reason as: "OBSERVE: <your analysis here>"
58
-
59
- `
60
- : "";
40
+ export function buildResponseAnalysisPrompt(strictness) {
61
41
  return `You are Hegel, a dialectical critical thinking companion reviewing an AI coding assistant's response.
62
42
 
63
43
  Your role: identify red flags in the AI's output that the developer should be aware of before accepting the changes.
64
44
 
65
- ${bypassBlock}## What to look for
45
+ ## What to look for
66
46
 
67
47
  1. **Overconfidence**: Claims like "this will definitely work" or "all issues resolved" without caveats
68
48
  2. **Missing edge cases**: The AI solved the happy path but didn't mention error handling, boundary conditions, or failure modes
@@ -1 +1 @@
1
- {"version":3,"file":"prompts.js","sourceRoot":"","sources":["../src/prompts.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,MAAM,mBAAmB,GAAoC;IAC3D,OAAO,EACL,oKAAoK;IACtK,QAAQ,EACN,8KAA8K;IAChL,MAAM,EACJ,kMAAkM;CACrM,CAAC;AAEF,MAAM,UAAU,yBAAyB,CAAC,UAA2B,EAAE,MAAe;IACpF,MAAM,WAAW,GAAG,MAAM;QACxB,CAAC,CAAC;;;;;;;CAOL;QACG,CAAC,CAAC,EAAE,CAAC;IAEP,OAAO;;;;EAIP,WAAW;;;;;;;;uBAQU,UAAU;EAC/B,mBAAmB,CAAC,UAAU,CAAC;;;;;;;;;;;+EAW8C,CAAC;AAChF,CAAC;AAED,MAAM,UAAU,2BAA2B,CAAC,UAA2B,EAAE,MAAe;IACtF,MAAM,WAAW,GAAG,MAAM;QACxB,CAAC,CAAC;;;;;;;CAOL;QACG,CAAC,CAAC,EAAE,CAAC;IAEP,OAAO;;;;EAIP,WAAW;;;;;;;;;uBASU,UAAU;EAC/B,mBAAmB,CAAC,UAAU,CAAC;;;;;;;;uGAQsE,CAAC;AACxG,CAAC"}
1
+ {"version":3,"file":"prompts.js","sourceRoot":"","sources":["../src/prompts.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,MAAM,mBAAmB,GAAoC;IAC3D,OAAO,EACL,oKAAoK;IACtK,QAAQ,EACN,8KAA8K;IAChL,MAAM,EACJ,kMAAkM;CACrM,CAAC;AAEF,MAAM,UAAU,yBAAyB,CAAC,UAA2B;IACnE,OAAO;;;;;;;;;;;;uBAYc,UAAU;EAC/B,mBAAmB,CAAC,UAAU,CAAC;;;;;;;;;;;+EAW8C,CAAC;AAChF,CAAC;AAED,MAAM,UAAU,2BAA2B,CAAC,UAA2B;IACrE,OAAO;;;;;;;;;;;;;uBAac,UAAU;EAC/B,mBAAmB,CAAC,UAAU,CAAC;;;;;;;;uGAQsE,CAAC;AACxG,CAAC"}
package/dist/setup.d.ts CHANGED
@@ -1,93 +1,12 @@
1
1
  #!/usr/bin/env node
2
- import { mkdir, writeFile, readdir, readFile, access, rm } from "node:fs/promises";
3
- import { execFileSync } from "node:child_process";
4
- import { writeHooksFile } from "./hooks-generator.js";
5
- import type { HegelConfig } from "./config.js";
6
- export declare const COMPANION_RULE = "# Hegel Companion Rule\n\nYou are working in a project that uses Hegel, a dialectical companion for AI-assisted development.\nHegel monitors your prompts and responses for quality, context drift, and session health.\n\n## MCP Tools Available\n\nYou have access to the `hegel-mcp` server which provides two tools:\n1. `hegel-status`: Fetch the real-time health status of the current session.\n2. `hegel-review`: Fetch a comprehensive retrospective of the session.\n\n## When to use these tools\n\n- **Proactive Self-Correction**: If the user seems frustrated, repeats the same prompt, or if you feel the conversation is losing focus, call `hegel-status` to check if Hegel has flagged `context-drift` or `prompt-degradation`. Adjust your behavior accordingly.\n- **End-of-Task Summaries**: When completing a significant multi-step task, call `hegel-review` and append a brief session health summary to your final response.\n- **Transparency**: If Hegel blocks a prompt or flags a critical concern, acknowledge it and help the user formulate a better prompt.\n";
7
- interface SetupDeps {
8
- loadConfig: (workspaceRoot?: string) => Promise<HegelConfig>;
9
- writeHooksFile: typeof writeHooksFile;
10
- mkdir: typeof mkdir;
11
- writeFile: typeof writeFile;
12
- readdir: typeof readdir;
13
- readFile: typeof readFile;
14
- access: typeof access;
15
- rm: typeof rm;
16
- execFileSync: typeof execFileSync;
17
- log: (message: string) => void;
18
- error: (message: string) => void;
19
- resolveHegelRoot: () => string;
20
- platform?: NodeJS.Platform;
21
- env?: NodeJS.ProcessEnv;
22
- }
23
- /**
24
- * Walks up from `startDir` (exclusive) looking for an ancestor that already
25
- * contains a Hegel install (hegel.config.json + .cursor/hooks.json).
26
- * Returns the ancestor path if found, or null. Stops at the filesystem root.
27
- */
28
- export declare function findAncestorHegelInstall(startDir: string, accessFn?: typeof access): Promise<string | null>;
2
+ export * from "./commands/types.js";
3
+ export * from "./utils/workspace.js";
4
+ export * from "./utils/install.js";
5
+ export * from "./utils/package-manager.js";
6
+ export * from "./utils/path.js";
7
+ import { runUpdate } from "./commands/update.js";
8
+ import { runCleanup } from "./commands/cleanup.js";
9
+ import { type SetupDeps } from "./commands/types.js";
10
+ export { runUpdate, runCleanup };
29
11
  export declare function runSetup(argv?: string[], deps?: SetupDeps): Promise<number>;
30
- /**
31
- * Result of attempting to install the bundled VS Code extension.
32
- *
33
- * In 1.0.0–1.0.2 this was a silent `try { ... } catch { log("Could not ...") }`,
34
- * which meant `cursor` CLI ENOENT (the common failure when running from a
35
- * non-Cursor terminal) surfaced only as a one-liner mid-output that users
36
- * missed. 1.0.3 makes the failure loud, actionable, and appended at the end
37
- * of the init output so it is the last thing on screen. 1.0.4 auto-discovers
38
- * well-known Cursor install paths when the CLI isn't on PATH so the user
39
- * doesn't have to switch shells — see getCursorCliCandidates below.
40
- */
41
- export type ExtensionInstallStatus = "installed" | "vsix-not-found" | "cursor-cli-missing" | "install-failed";
42
- export interface ExtensionInstallResult {
43
- status: ExtensionInstallStatus;
44
- vsixPath?: string;
45
- reason?: string;
46
- /** Non-PATH absolute path used, if auto-discovery kicked in. */
47
- usedCursorPath?: string;
48
- }
49
- /**
50
- * Well-known absolute paths where Cursor installs the `cursor` CLI shim.
51
- * Returned in priority order — first existing candidate wins. We intentionally
52
- * probe only well-documented install locations: user-scoped first (most
53
- * common), then system-scoped.
54
- *
55
- * Windows candidates end in .cmd because Node's execFileSync needs the shim,
56
- * not the Electron binary (Cursor.exe) which would try to launch a second IDE
57
- * window rather than run the CLI.
58
- */
59
- export declare function getCursorCliCandidates(platform?: NodeJS.Platform, env?: NodeJS.ProcessEnv): string[];
60
- export declare function installVsCodeExtension(vscodeDir: string, deps: SetupDeps): Promise<ExtensionInstallResult>;
61
- interface PruneResult {
62
- pruned: string[];
63
- skipped: {
64
- path: string;
65
- reason: string;
66
- }[];
67
- }
68
- /**
69
- * Removes orphan Hegel installs left behind by past CLI mistakes
70
- * (`init hegel-mcp`, `init init`). Only removes a candidate dir if it
71
- * contains a Hegel marker file — never deletes user code directories that
72
- * happen to share the name.
73
- */
74
- export declare function pruneOrphanInstalls(projectPath: string, deps: Pick<SetupDeps, "access" | "rm" | "log">): Promise<PruneResult>;
75
- /**
76
- * Reads the version of @hegel-dev/companion from the consumer's
77
- * node_modules/, returning null if not installed (e.g. source-repo mode).
78
- */
79
- export declare function readInstalledCompanionVersion(projectPath: string, readFileFn?: typeof readFile): Promise<string | null>;
80
- /**
81
- * `update` subcommand. Single-step refresh path for downstream projects:
82
- * 1. Refuses if no Hegel install present (hint to use `init`).
83
- * 2. Detects source-repo mode and skips npm install in that case.
84
- * 3. Runs `npm install @hegel-dev/companion@latest` (skippable via --skip-npm).
85
- * 4. Re-runs setup with --force so hooks.json regenerates, MCP re-registers,
86
- * and the bundled VSIX is reinstalled (with 1.0.4 auto-discovery).
87
- * 5. Prunes orphan `hegel-mcp/` and `init/` directories left over from past
88
- * CLI mistakes (only when those dirs contain a Hegel marker file).
89
- * 6. Prints the new installed version + the Cursor full-quit reminder.
90
- */
91
- export declare function runUpdate(argv?: string[], deps?: SetupDeps): Promise<number>;
92
- export {};
93
12
  //# sourceMappingURL=setup.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["../src/setup.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AACnF,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAGlD,OAAO,EAAE,cAAc,EAAc,MAAM,sBAAsB,CAAC;AAClE,O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