@groundtrack/hooks 0.1.6 → 0.1.7

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.
@@ -0,0 +1,7 @@
1
+ /** Canonical managed Groundtrack policy, packaged with the CLI. */
2
+ export declare const AGENT_INSTRUCTION_BODY: string;
3
+ /** Version is derived from the canonical template marker; never define it separately. */
4
+ export declare const AGENT_INSTRUCTION_TEMPLATE_VERSION: number;
5
+ export type AgentInstructionsClient = "claude" | "codex" | "cursor" | "opencode";
6
+ /** Detect the managed policy version available to a client in one repository. */
7
+ export declare function detectAgentInstructionsVersion(repoDir: string, client: AgentInstructionsClient): number | null;
@@ -0,0 +1,29 @@
1
+ export type Client = "claude" | "codex" | "cursor";
2
+ type CheckStatus = "ok" | "advisory" | "issue" | "fixed" | "blocked";
3
+ export type DoctorCheck = {
4
+ id: string;
5
+ label: string;
6
+ status: CheckStatus;
7
+ detail: string;
8
+ file?: string;
9
+ };
10
+ export type DoctorOptions = {
11
+ repoDir: string;
12
+ homeDir: string;
13
+ fix?: boolean;
14
+ clients?: Client[];
15
+ installedHookVersion?: string | null;
16
+ latestVersion?: string | null;
17
+ skipPackageInstall?: boolean;
18
+ };
19
+ export type DoctorResult = {
20
+ version: string;
21
+ clients: Client[];
22
+ aliases: string[];
23
+ checks: DoctorCheck[];
24
+ changedFiles: string[];
25
+ healthy: boolean;
26
+ };
27
+ export declare function compareVersions(left: string, right: string): number;
28
+ export declare function runDoctor(options: DoctorOptions): DoctorResult;
29
+ export {};
@@ -0,0 +1,18 @@
1
+ type HookInput = {
2
+ conversation_id?: unknown;
3
+ cwd?: unknown;
4
+ generation_id?: unknown;
5
+ model?: unknown;
6
+ model_id?: unknown;
7
+ session_id?: unknown;
8
+ transcript_path?: unknown;
9
+ tool_input?: unknown;
10
+ tool_name?: unknown;
11
+ tool_use_id?: unknown;
12
+ workspace_roots?: unknown;
13
+ };
14
+ export type GroundtrackContextTool = "store_event" | "search_experiences";
15
+ export declare function groundtrackContextTool(toolName: unknown): GroundtrackContextTool | null;
16
+ export declare function enrichInput(hookInput: HookInput, clientOverride?: string, tool?: GroundtrackContextTool): Record<string, unknown>;
17
+ export declare function hookOutput(hookInput: HookInput, clientOverride?: string): Record<string, unknown>;
18
+ export {};
@@ -73,7 +73,7 @@ function transcriptModel(transcriptPath) {
73
73
  }
74
74
  return null;
75
75
  }
76
- function groundtrackContextTool(toolName) {
76
+ export function groundtrackContextTool(toolName) {
77
77
  const normalized = nonEmptyString(toolName)?.toLowerCase();
78
78
  if (!normalized)
79
79
  return null;
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ export {};
File without changes
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ export {};
File without changes
@@ -0,0 +1 @@
1
+ export declare function packageVersion(): string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@groundtrack/hooks",
3
- "version": "0.1.6",
3
+ "version": "0.1.7",
4
4
  "description": "Lifecycle hook utilities for Groundtrack MCP clients.",
5
5
  "keywords": [
6
6
  "claude-code",
@@ -8,7 +8,8 @@
8
8
  "cursor",
9
9
  "groundtrack",
10
10
  "hooks",
11
- "mcp"
11
+ "mcp",
12
+ "opencode"
12
13
  ],
13
14
  "license": "MIT",
14
15
  "bin": {
@@ -22,12 +23,24 @@
22
23
  "LICENSE"
23
24
  ],
24
25
  "type": "module",
26
+ "exports": {
27
+ ".": "./dist/enrich-store-event.js",
28
+ "./enrich": {
29
+ "types": "./dist/enrich-store-event.d.ts",
30
+ "default": "./dist/enrich-store-event.js"
31
+ },
32
+ "./agent-instructions": {
33
+ "types": "./dist/agent-instructions.d.ts",
34
+ "default": "./dist/agent-instructions.js"
35
+ },
36
+ "./package.json": "./package.json"
37
+ },
25
38
  "publishConfig": {
26
39
  "access": "public"
27
40
  },
28
41
  "scripts": {
29
42
  "build": "tsc -p tsconfig.json",
30
- "lint": "oxlint .",
43
+ "lint": "vp lint",
31
44
  "prepack": "pnpm run build",
32
45
  "release:patch": "node scripts/release-patch.mjs",
33
46
  "sync:agent-instructions": "node scripts/sync-agent-instructions.mjs",