@varveai/adit-hooks 0.2.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/LICENSE +21 -0
- package/dist/adapters/claude-code.d.ts +9 -0
- package/dist/adapters/claude-code.d.ts.map +1 -0
- package/dist/adapters/claude-code.js +349 -0
- package/dist/adapters/claude-code.js.map +1 -0
- package/dist/adapters/index.d.ts +12 -0
- package/dist/adapters/index.d.ts.map +1 -0
- package/dist/adapters/index.js +29 -0
- package/dist/adapters/index.js.map +1 -0
- package/dist/adapters/opencode.d.ts +18 -0
- package/dist/adapters/opencode.d.ts.map +1 -0
- package/dist/adapters/opencode.js +961 -0
- package/dist/adapters/opencode.js.map +1 -0
- package/dist/adapters/registry.d.ts +31 -0
- package/dist/adapters/registry.d.ts.map +1 -0
- package/dist/adapters/registry.js +102 -0
- package/dist/adapters/registry.js.map +1 -0
- package/dist/adapters/stub.d.ts +24 -0
- package/dist/adapters/stub.d.ts.map +1 -0
- package/dist/adapters/stub.js +60 -0
- package/dist/adapters/stub.js.map +1 -0
- package/dist/adapters/types.d.ts +107 -0
- package/dist/adapters/types.d.ts.map +1 -0
- package/dist/adapters/types.js +8 -0
- package/dist/adapters/types.js.map +1 -0
- package/dist/common/context.d.ts +19 -0
- package/dist/common/context.d.ts.map +1 -0
- package/dist/common/context.js +94 -0
- package/dist/common/context.js.map +1 -0
- package/dist/handlers/index.d.ts +2 -0
- package/dist/handlers/index.d.ts.map +1 -0
- package/dist/handlers/index.js +2 -0
- package/dist/handlers/index.js.map +1 -0
- package/dist/handlers/unified.d.ts +13 -0
- package/dist/handlers/unified.d.ts.map +1 -0
- package/dist/handlers/unified.js +304 -0
- package/dist/handlers/unified.js.map +1 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +32 -0
- package/dist/index.js.map +1 -0
- package/package.json +37 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"opencode.js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AAU,CAAC,EAAE,CAAC;YAC3B,IAAI,CAAC;gBACH,MAAM,OAAO,GAAG,YAAY,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;gBAClD,IAAI,YAAY,CAAC,OAAO,CAAC,EAAE,CAAC;oBAC1B,UAAU,CAAC,UAAU,CAAC,CAAC;gBACzB,CAAC;YACH,CAAC;YAAC,MAAM,CAAC,CAAC,iBAAiB,CAAC,CAAC;QAC/B,CAAC;QAED,uBAAuB;QACvB,MAAM,WAAW,GAAG,IAAI,CAAC,WAAW,EAAE,WAAW,EAAE,UAAU,CAAC,CAAC;QAC/D,IAAI,CAAC;YAAC,UAAU,CAAC,IAAI,CAAC,WAAW,EAAE,YAAY,CAAC,QAAQ,CAAC,CAAC,CAAC;QAAC,CAAC;QAAC,MAAM,CAAC,CAAC,iBAAiB,CAAC,CAAC;QAEzF,sBAAsB;QACtB,IAAI,CAAC;YAAC,UAAU,CAAC,IAAI,CAAC,WAAW,EAAE,WAAW,EAAE,OAAO,EAAE,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC;QAAC,CAAC;QAAC,MAAM,CAAC,CAAC,iBAAiB,CAAC,CAAC;QAE7G,gCAAgC;QAChC,KAAK,MAAM,MAAM,IAAI,oBAAoB,EAAE,CAAC;YAC1C,IAAI,CAAC;gBAAC,UAAU,CAAC,IAAI,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC,CAAC;YAAC,CAAC;YAAC,MAAM,CAAC,CAAC,iBAAiB,CAAC,CAAC;QAC5E,CAAC;IACH,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Platform adapter registry.
|
|
3
|
+
*
|
|
4
|
+
* Discovers, registers, and retrieves platform adapters.
|
|
5
|
+
* Provides both env-var-based detection (for hook dispatching) and
|
|
6
|
+
* directory-based detection (for CLI commands like init/plugin install).
|
|
7
|
+
*/
|
|
8
|
+
import type { Platform } from "@varveai/adit-core";
|
|
9
|
+
import type { PlatformAdapter } from "./types.js";
|
|
10
|
+
/** Get the adapter for a platform */
|
|
11
|
+
export declare function getAdapter(platform: Platform): PlatformAdapter;
|
|
12
|
+
/** List all registered adapters */
|
|
13
|
+
export declare function listAdapters(): PlatformAdapter[];
|
|
14
|
+
/** Register a new adapter (for extensibility) */
|
|
15
|
+
export declare function registerAdapter(adapter: PlatformAdapter): void;
|
|
16
|
+
/**
|
|
17
|
+
* Detect the current platform from environment clues.
|
|
18
|
+
* Falls back to "other" when no platform is detected.
|
|
19
|
+
*/
|
|
20
|
+
export declare function detectPlatform(): Platform;
|
|
21
|
+
/**
|
|
22
|
+
* Detect which platforms are present in a project by checking for their
|
|
23
|
+
* config directories on disk. Falls back to env-based detection if no
|
|
24
|
+
* platform directories are found.
|
|
25
|
+
*
|
|
26
|
+
* This is the preferred detection method for CLI commands (init, plugin
|
|
27
|
+
* install/uninstall) because env vars are only set inside AI tool sessions,
|
|
28
|
+
* whereas config directories persist on disk.
|
|
29
|
+
*/
|
|
30
|
+
export declare function detectPlatforms(projectRoot: string): Platform[];
|
|
31
|
+
//# sourceMappingURL=registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/adapters/registry.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAyBlD,qCAAqC;AACrC,wBAAgB,UAAU,CAAC,QAAQ,EAAE,QAAQ,GAAG,eAAe,CAQ9D;AAED,mCAAmC;AACnC,wBAAgB,YAAY,IAAI,eAAe,EAAE,CAEhD;AAED,iDAAiD;AACjD,wBAAgB,eAAe,CAAC,OAAO,EAAE,eAAe,GAAG,IAAI,CAE9D;AAED;;;GAGG;AACH,wBAAgB,cAAc,IAAI,QAAQ,CA8BzC;AAED;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAAC,WAAW,EAAE,MAAM,GAAG,QAAQ,EAAE,CA4B/D"}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Platform adapter registry.
|
|
3
|
+
*
|
|
4
|
+
* Discovers, registers, and retrieves platform adapters.
|
|
5
|
+
* Provides both env-var-based detection (for hook dispatching) and
|
|
6
|
+
* directory-based detection (for CLI commands like init/plugin install).
|
|
7
|
+
*/
|
|
8
|
+
import { existsSync } from "node:fs";
|
|
9
|
+
import { join } from "node:path";
|
|
10
|
+
import { claudeCodeAdapter } from "./claude-code.js";
|
|
11
|
+
import { cursorAdapter, copilotAdapter, codexAdapter, otherAdapter, } from "./stub.js";
|
|
12
|
+
import { opencodeAdapter } from "./opencode.js";
|
|
13
|
+
/** Registered adapters keyed by platform */
|
|
14
|
+
const adapters = new Map();
|
|
15
|
+
// Register built-in adapters
|
|
16
|
+
adapters.set("claude-code", claudeCodeAdapter);
|
|
17
|
+
// Register OpenCode adapter (fully implemented)
|
|
18
|
+
adapters.set("opencode", opencodeAdapter);
|
|
19
|
+
// Register stub adapters (detected but not yet fully implemented)
|
|
20
|
+
adapters.set("cursor", cursorAdapter);
|
|
21
|
+
adapters.set("copilot", copilotAdapter);
|
|
22
|
+
adapters.set("codex", codexAdapter);
|
|
23
|
+
adapters.set("other", otherAdapter);
|
|
24
|
+
/** Get the adapter for a platform */
|
|
25
|
+
export function getAdapter(platform) {
|
|
26
|
+
const adapter = adapters.get(platform);
|
|
27
|
+
if (!adapter) {
|
|
28
|
+
throw new Error(`No adapter registered for platform "${platform}". Available: ${listAdapters().map((a) => a.platform).join(", ")}`);
|
|
29
|
+
}
|
|
30
|
+
return adapter;
|
|
31
|
+
}
|
|
32
|
+
/** List all registered adapters */
|
|
33
|
+
export function listAdapters() {
|
|
34
|
+
return Array.from(adapters.values());
|
|
35
|
+
}
|
|
36
|
+
/** Register a new adapter (for extensibility) */
|
|
37
|
+
export function registerAdapter(adapter) {
|
|
38
|
+
adapters.set(adapter.platform, adapter);
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Detect the current platform from environment clues.
|
|
42
|
+
* Falls back to "other" when no platform is detected.
|
|
43
|
+
*/
|
|
44
|
+
export function detectPlatform() {
|
|
45
|
+
// Claude Code sets specific env vars
|
|
46
|
+
if (process.env.CLAUDE_CODE || process.env.CLAUDE_PLUGIN_ROOT) {
|
|
47
|
+
return "claude-code";
|
|
48
|
+
}
|
|
49
|
+
// Cursor detection
|
|
50
|
+
if (process.env.CURSOR_SESSION_ID || process.env.CURSOR) {
|
|
51
|
+
return "cursor";
|
|
52
|
+
}
|
|
53
|
+
// GitHub Copilot detection
|
|
54
|
+
if (process.env.GITHUB_COPILOT || process.env.COPILOT_SESSION) {
|
|
55
|
+
return "copilot";
|
|
56
|
+
}
|
|
57
|
+
// OpenCode detection (Go-based AI coding CLI)
|
|
58
|
+
if (process.env.OPENCODE || process.env.OPENCODE_SESSION) {
|
|
59
|
+
return "opencode";
|
|
60
|
+
}
|
|
61
|
+
// Codex detection (OpenAI's AI coding agent)
|
|
62
|
+
if (process.env.CODEX || process.env.CODEX_SESSION) {
|
|
63
|
+
return "codex";
|
|
64
|
+
}
|
|
65
|
+
// No platform env vars detected — return "other" to stay platform-neutral.
|
|
66
|
+
// Callers that need a concrete adapter should check for "other" and handle
|
|
67
|
+
// it explicitly rather than silently assuming a specific platform.
|
|
68
|
+
return "other";
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Detect which platforms are present in a project by checking for their
|
|
72
|
+
* config directories on disk. Falls back to env-based detection if no
|
|
73
|
+
* platform directories are found.
|
|
74
|
+
*
|
|
75
|
+
* This is the preferred detection method for CLI commands (init, plugin
|
|
76
|
+
* install/uninstall) because env vars are only set inside AI tool sessions,
|
|
77
|
+
* whereas config directories persist on disk.
|
|
78
|
+
*/
|
|
79
|
+
export function detectPlatforms(projectRoot) {
|
|
80
|
+
const platforms = new Set();
|
|
81
|
+
// Check for Claude Code config directory
|
|
82
|
+
if (existsSync(join(projectRoot, ".claude"))) {
|
|
83
|
+
platforms.add("claude-code");
|
|
84
|
+
}
|
|
85
|
+
// Check for OpenCode config directory or config file
|
|
86
|
+
if (existsSync(join(projectRoot, ".opencode")) ||
|
|
87
|
+
existsSync(join(projectRoot, "opencode.json")) ||
|
|
88
|
+
existsSync(join(projectRoot, "opencode.jsonc"))) {
|
|
89
|
+
platforms.add("opencode");
|
|
90
|
+
}
|
|
91
|
+
// If no platform directories found, fall back to env detection.
|
|
92
|
+
// This handles cases where adit is run from within an AI tool session
|
|
93
|
+
// (e.g. the AI agent running `adit plugin install`).
|
|
94
|
+
if (platforms.size === 0) {
|
|
95
|
+
const envPlatform = detectPlatform();
|
|
96
|
+
if (envPlatform !== "other") {
|
|
97
|
+
platforms.add(envPlatform);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
return Array.from(platforms);
|
|
101
|
+
}
|
|
102
|
+
//# sourceMappingURL=registry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../../src/adapters/registry.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAGjC,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EACL,aAAa,EACb,cAAc,EACd,YAAY,EACZ,YAAY,GACb,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAEhD,4CAA4C;AAC5C,MAAM,QAAQ,GAAG,IAAI,GAAG,EAA6B,CAAC;AAEtD,6BAA6B;AAC7B,QAAQ,CAAC,GAAG,CAAC,aAAa,EAAE,iBAAiB,CAAC,CAAC;AAE/C,gDAAgD;AAChD,QAAQ,CAAC,GAAG,CAAC,UAAU,EAAE,eAAe,CAAC,CAA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AC;YAC5B,SAAS,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;QAC7B,CAAC;IACH,CAAC;IAED,OAAO,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;AAC/B,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Stub platform adapter.
|
|
3
|
+
*
|
|
4
|
+
* Provides a "not yet supported" adapter for platforms that have been
|
|
5
|
+
* detected but don't have full implementations yet. This is better than
|
|
6
|
+
* throwing at detection time — it gives users a clear error message
|
|
7
|
+
* and documents what's needed to add support.
|
|
8
|
+
*/
|
|
9
|
+
import type { Platform } from "@varveai/adit-core";
|
|
10
|
+
import type { PlatformAdapter } from "./types.js";
|
|
11
|
+
/**
|
|
12
|
+
* Create a stub adapter for a platform that is detected but not yet supported.
|
|
13
|
+
* All methods throw with a clear message explaining the platform is not yet implemented.
|
|
14
|
+
*/
|
|
15
|
+
export declare function createStubAdapter(platform: Platform, displayName: string, envVarHints: string[]): PlatformAdapter;
|
|
16
|
+
/** Cursor — VS Code-based AI coding assistant */
|
|
17
|
+
export declare const cursorAdapter: PlatformAdapter;
|
|
18
|
+
/** GitHub Copilot — AI pair programmer */
|
|
19
|
+
export declare const copilotAdapter: PlatformAdapter;
|
|
20
|
+
/** Codex — OpenAI's AI coding agent */
|
|
21
|
+
export declare const codexAdapter: PlatformAdapter;
|
|
22
|
+
/** Unknown / undetected platform */
|
|
23
|
+
export declare const otherAdapter: PlatformAdapter;
|
|
24
|
+
//# sourceMappingURL=stub.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stub.d.ts","sourceRoot":"","sources":["../../src/adapters/stub.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,KAAK,EACV,eAAe,EAKhB,MAAM,YAAY,CAAC;AAEpB;;;GAGG;AACH,wBAAgB,iBAAiB,CAC/B,QAAQ,EAAE,QAAQ,EAClB,WAAW,EAAE,MAAM,EACnB,WAAW,EAAE,MAAM,EAAE,GACpB,eAAe,CA+CjB;AAED,iDAAiD;AACjD,eAAO,MAAM,aAAa,iBAIzB,CAAC;AAEF,0CAA0C;AAC1C,eAAO,MAAM,cAAc,iBAI1B,CAAC;AAEF,uCAAuC;AACvC,eAAO,MAAM,YAAY,iBAIxB,CAAC;AAEF,oCAAoC;AACpC,eAAO,MAAM,YAAY,iBAIxB,CAAC"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Stub platform adapter.
|
|
3
|
+
*
|
|
4
|
+
* Provides a "not yet supported" adapter for platforms that have been
|
|
5
|
+
* detected but don't have full implementations yet. This is better than
|
|
6
|
+
* throwing at detection time — it gives users a clear error message
|
|
7
|
+
* and documents what's needed to add support.
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Create a stub adapter for a platform that is detected but not yet supported.
|
|
11
|
+
* All methods throw with a clear message explaining the platform is not yet implemented.
|
|
12
|
+
*/
|
|
13
|
+
export function createStubAdapter(platform, displayName, envVarHints) {
|
|
14
|
+
const notSupported = (method) => {
|
|
15
|
+
throw new Error(`${displayName} adapter is not yet implemented (method: ${method}). ` +
|
|
16
|
+
`ADIT detected this platform via environment variables (${envVarHints.join(", ")}). ` +
|
|
17
|
+
`Contributions welcome! See packages/hooks/src/adapters/ for the adapter interface.`);
|
|
18
|
+
};
|
|
19
|
+
return {
|
|
20
|
+
platform,
|
|
21
|
+
displayName,
|
|
22
|
+
hookMappings: [],
|
|
23
|
+
parseInput(_raw, _hookType) {
|
|
24
|
+
return notSupported("parseInput");
|
|
25
|
+
},
|
|
26
|
+
generateHookConfig(_aditBinaryPath) {
|
|
27
|
+
return notSupported("generateHookConfig");
|
|
28
|
+
},
|
|
29
|
+
async validateInstallation(_projectRoot) {
|
|
30
|
+
return {
|
|
31
|
+
valid: false,
|
|
32
|
+
checks: [
|
|
33
|
+
{
|
|
34
|
+
name: `${displayName} support`,
|
|
35
|
+
ok: false,
|
|
36
|
+
detail: `${displayName} adapter is not yet implemented`,
|
|
37
|
+
},
|
|
38
|
+
],
|
|
39
|
+
};
|
|
40
|
+
},
|
|
41
|
+
async installHooks(_projectRoot, _aditBinaryPath) {
|
|
42
|
+
notSupported("installHooks");
|
|
43
|
+
},
|
|
44
|
+
async uninstallHooks(_projectRoot) {
|
|
45
|
+
notSupported("uninstallHooks");
|
|
46
|
+
},
|
|
47
|
+
getResumeCommand(_projectRoot) {
|
|
48
|
+
return null;
|
|
49
|
+
},
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
/** Cursor — VS Code-based AI coding assistant */
|
|
53
|
+
export const cursorAdapter = createStubAdapter("cursor", "Cursor", ["CURSOR_SESSION_ID", "CURSOR"]);
|
|
54
|
+
/** GitHub Copilot — AI pair programmer */
|
|
55
|
+
export const copilotAdapter = createStubAdapter("copilot", "GitHub Copilot", ["GITHUB_COPILOT", "COPILOT_SESSION"]);
|
|
56
|
+
/** Codex — OpenAI's AI coding agent */
|
|
57
|
+
export const codexAdapter = createStubAdapter("codex", "Codex", ["CODEX", "CODEX_SESSION"]);
|
|
58
|
+
/** Unknown / undetected platform */
|
|
59
|
+
export const otherAdapter = createStubAdapter("other", "Unknown Platform", []);
|
|
60
|
+
//# sourceMappingURL=stub.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stub.js","sourceRoot":"","sources":["../../src/adapters/stub.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAWH;;;GAGG;AACH,MAAM,UAAU,iBAAiB,CAC/B,QAAkB,EAClB,WAAmB,EACnB,WAAqB;IAErB,MAAM,YAAY,GAAG,CAAC,MAAc,EAAS,EAAE;QAC7C,MAAM,IAAI,KAAK,CACb,GAAG,WAAW,4CAA4C,MAAM,KAAK;YACnE,0DAA0D,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK;YACrF,oF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GAAG,iBAAiB,CAC3C,OAAO,EACP,kBAAkB,EAClB,EAAE,CACH,CAAC"}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Platform adapter interface.
|
|
3
|
+
*
|
|
4
|
+
* Each AI CLI tool gets an adapter that translates between
|
|
5
|
+
* the platform's hook/event system and ADIT's internal model.
|
|
6
|
+
*/
|
|
7
|
+
import type { Platform } from "@varveai/adit-core";
|
|
8
|
+
/**
|
|
9
|
+
* Adapter that bridges a specific AI platform's hook system
|
|
10
|
+
* with ADIT's internal event model.
|
|
11
|
+
*/
|
|
12
|
+
export interface PlatformAdapter {
|
|
13
|
+
/** Platform identifier */
|
|
14
|
+
readonly platform: Platform;
|
|
15
|
+
/** Human-readable platform name */
|
|
16
|
+
readonly displayName: string;
|
|
17
|
+
/** Hook event mappings: platform event name → ADIT handler */
|
|
18
|
+
readonly hookMappings: HookMapping[];
|
|
19
|
+
/** Parse platform-specific stdin input into ADIT's normalized format */
|
|
20
|
+
parseInput(raw: Record<string, unknown>, hookType: string): NormalizedHookInput;
|
|
21
|
+
/** Generate platform-specific hook configuration */
|
|
22
|
+
generateHookConfig(aditBinaryPath: string): PlatformHookConfig;
|
|
23
|
+
/** Validate that the platform is properly configured */
|
|
24
|
+
validateInstallation(projectRoot: string): Promise<ValidationResult>;
|
|
25
|
+
/** Install/register hooks for this platform */
|
|
26
|
+
installHooks(projectRoot: string, aditBinaryPath: string): Promise<void>;
|
|
27
|
+
/** Uninstall/deregister hooks */
|
|
28
|
+
uninstallHooks(projectRoot: string): Promise<void>;
|
|
29
|
+
/**
|
|
30
|
+
* Get the platform-specific command to resume/continue an AI session.
|
|
31
|
+
*
|
|
32
|
+
* Returns a human-readable command string (e.g., "claude --continue")
|
|
33
|
+
* that the user can run to resume working with the AI agent after
|
|
34
|
+
* restoring a checkpoint. Returns null if the platform does not
|
|
35
|
+
* support a resume command.
|
|
36
|
+
*/
|
|
37
|
+
getResumeCommand?(projectRoot: string): string | null;
|
|
38
|
+
}
|
|
39
|
+
/** Maps a platform event to an ADIT handler */
|
|
40
|
+
export interface HookMapping {
|
|
41
|
+
/** Platform's event name (e.g., "UserPromptSubmit" for Claude) */
|
|
42
|
+
platformEvent: string;
|
|
43
|
+
/** ADIT's internal handler name */
|
|
44
|
+
aditHandler: AditHookType;
|
|
45
|
+
/** Optional matcher (e.g., "Write|Edit" for PostToolUse) */
|
|
46
|
+
matcher?: string;
|
|
47
|
+
}
|
|
48
|
+
/** Normalized hook input — platform-agnostic representation */
|
|
49
|
+
export interface NormalizedHookInput {
|
|
50
|
+
cwd: string;
|
|
51
|
+
hookType: AditHookType;
|
|
52
|
+
/** CLI identifier for upload routing (e.g., "claude-code", "cursor") */
|
|
53
|
+
platformCli?: Platform;
|
|
54
|
+
/** Session ID from the platform (e.g., Claude Code session_id) */
|
|
55
|
+
platformSessionId?: string;
|
|
56
|
+
/** Path to the session transcript file (JSONL) */
|
|
57
|
+
transcriptPath?: string;
|
|
58
|
+
prompt?: string;
|
|
59
|
+
toolName?: string;
|
|
60
|
+
toolInput?: Record<string, unknown>;
|
|
61
|
+
toolOutput?: Record<string, unknown>;
|
|
62
|
+
stopReason?: string;
|
|
63
|
+
/** The assistant's last message text (sent in Stop events) */
|
|
64
|
+
lastAssistantMessage?: string;
|
|
65
|
+
/** Whether the stop hook is active (loop prevention) */
|
|
66
|
+
stopHookActive?: boolean;
|
|
67
|
+
taskId?: string;
|
|
68
|
+
taskSubject?: string;
|
|
69
|
+
taskDescription?: string;
|
|
70
|
+
teammateName?: string;
|
|
71
|
+
teamName?: string;
|
|
72
|
+
notificationMessage?: string;
|
|
73
|
+
notificationTitle?: string;
|
|
74
|
+
notificationType?: string;
|
|
75
|
+
agentId?: string;
|
|
76
|
+
agentType?: string;
|
|
77
|
+
agentTranscriptPath?: string;
|
|
78
|
+
/** Permission mode the AI agent is running in */
|
|
79
|
+
permissionMode?: string;
|
|
80
|
+
/** Which AI model is being used (from SessionStart) */
|
|
81
|
+
model?: string;
|
|
82
|
+
/** Session source: startup, resume, clear, compact (from SessionStart) */
|
|
83
|
+
sessionSource?: string;
|
|
84
|
+
/** Why the session ended: clear, logout, exit, etc. (from SessionEnd) */
|
|
85
|
+
sessionEndReason?: string;
|
|
86
|
+
rawPlatformData?: Record<string, unknown>;
|
|
87
|
+
}
|
|
88
|
+
/** Platform-specific hook configuration output */
|
|
89
|
+
export interface PlatformHookConfig {
|
|
90
|
+
/** Platform-specific config file path (relative to project root) */
|
|
91
|
+
configPath: string;
|
|
92
|
+
/** Configuration content to write */
|
|
93
|
+
content: Record<string, unknown>;
|
|
94
|
+
}
|
|
95
|
+
/** Result of validating a platform installation */
|
|
96
|
+
export interface ValidationResult {
|
|
97
|
+
valid: boolean;
|
|
98
|
+
checks: ValidationCheck[];
|
|
99
|
+
}
|
|
100
|
+
export interface ValidationCheck {
|
|
101
|
+
name: string;
|
|
102
|
+
ok: boolean;
|
|
103
|
+
detail: string;
|
|
104
|
+
}
|
|
105
|
+
/** All ADIT hook types */
|
|
106
|
+
export type AditHookType = "prompt-submit" | "stop" | "session-start" | "session-end" | "task-completed" | "notification" | "subagent-start" | "subagent-stop";
|
|
107
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/adapters/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAEnD;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC9B,0BAA0B;IAC1B,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;IAE5B,mCAAmC;IACnC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAE7B,8DAA8D;IAC9D,QAAQ,CAAC,YAAY,EAAE,WAAW,EAAE,CAAC;IAErC,wEAAwE;IACxE,UAAU,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OA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M,GACN,eAAe,GACf,aAAa,GACb,gBAAgB,GAChB,cAAc,GACd,gBAAgB,GAChB,eAAe,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/adapters/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared hook context — initializes DB, config, and session
|
|
3
|
+
* for any hook handler.
|
|
4
|
+
*
|
|
5
|
+
* Fail-open design: if anything goes wrong during setup,
|
|
6
|
+
* the hook exits silently (exit 0) so the AI agent is never blocked.
|
|
7
|
+
*/
|
|
8
|
+
import { type AditConfig, type AditSession, type Platform } from "@varveai/adit-core";
|
|
9
|
+
import type Database from "better-sqlite3";
|
|
10
|
+
export interface HookContext {
|
|
11
|
+
db: Database.Database;
|
|
12
|
+
config: AditConfig;
|
|
13
|
+
session: AditSession;
|
|
14
|
+
}
|
|
15
|
+
/** Initialize the hook context (DB + session) */
|
|
16
|
+
export declare function initHookContext(cwd: string, platform: Platform, platformSessionId?: string): Promise<HookContext>;
|
|
17
|
+
/** Read hook input from stdin (Claude Code sends JSON) */
|
|
18
|
+
export declare function readStdin(): Promise<Record<string, unknown>>;
|
|
19
|
+
//# sourceMappingURL=context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/common/context.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EASL,KAAK,UAAU,EACf,KAAK,WAAW,EAChB,KAAK,QAAQ,EACd,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,QAAQ,MAAM,gBAAgB,CAAC;AAG3C,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,QAAQ,CAAC,QAAQ,CAAC;IACtB,MAAM,EAAE,UAAU,CAAC;IACnB,OAAO,EAAE,WAAW,CAAC;CACtB;AAED,iDAAiD;AACjD,wBAAsB,eAAe,CACnC,GAAG,EAAE,MAAM,EACX,QAAQ,EAAE,QAAQ,EAClB,iBAAiB,CAAC,EAAE,MAAM,GACzB,OAAO,CAAC,WAAW,CAAC,CA2CtB;AAED,0DAA0D;AAC1D,wBAAsB,SAAS,IAAI,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAuClE"}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared hook context — initializes DB, config, and session
|
|
3
|
+
* for any hook handler.
|
|
4
|
+
*
|
|
5
|
+
* Fail-open design: if anything goes wrong during setup,
|
|
6
|
+
* the hook exits silently (exit 0) so the AI agent is never blocked.
|
|
7
|
+
*/
|
|
8
|
+
import { loadConfig, openDatabase, getActiveSession, getSessionByPlatformSessionId, insertSession, generateId, createClock, serialize, } from "@varveai/adit-core";
|
|
9
|
+
import { getCurrentBranch, getRemoteUrl } from "@varveai/adit-engine";
|
|
10
|
+
/** Initialize the hook context (DB + session) */
|
|
11
|
+
export async function initHookContext(cwd, platform, platformSessionId) {
|
|
12
|
+
const config = loadConfig(cwd);
|
|
13
|
+
const db = openDatabase(config.dbPath);
|
|
14
|
+
// Get or create session — prefer platform session ID lookup
|
|
15
|
+
let session = null;
|
|
16
|
+
if (platformSessionId) {
|
|
17
|
+
session = getSessionByPlatformSessionId(db, platformSessionId);
|
|
18
|
+
}
|
|
19
|
+
if (!session) {
|
|
20
|
+
session = getActiveSession(db, config.projectId, config.clientId);
|
|
21
|
+
}
|
|
22
|
+
if (!session) {
|
|
23
|
+
const id = generateId();
|
|
24
|
+
const now = new Date().toISOString();
|
|
25
|
+
const branch = await getCurrentBranch(cwd);
|
|
26
|
+
const remoteUrl = await getRemoteUrl(cwd);
|
|
27
|
+
insertSession(db, {
|
|
28
|
+
id,
|
|
29
|
+
projectId: config.projectId,
|
|
30
|
+
clientId: config.clientId,
|
|
31
|
+
sessionType: "interactive",
|
|
32
|
+
platform,
|
|
33
|
+
startedAt: now,
|
|
34
|
+
metadataJson: JSON.stringify({
|
|
35
|
+
gitBranch: branch ?? "unknown",
|
|
36
|
+
gitRemoteUrl: remoteUrl ?? undefined,
|
|
37
|
+
workingDirectory: cwd,
|
|
38
|
+
}),
|
|
39
|
+
vclockJson: serialize(createClock(config.clientId)),
|
|
40
|
+
platformSessionId: platformSessionId ?? null,
|
|
41
|
+
});
|
|
42
|
+
// Re-fetch via platform session ID if available, else fall back
|
|
43
|
+
if (platformSessionId) {
|
|
44
|
+
session = getSessionByPlatformSessionId(db, platformSessionId);
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
session = getActiveSession(db, config.projectId, config.clientId);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
return { db, config, session };
|
|
51
|
+
}
|
|
52
|
+
/** Read hook input from stdin (Claude Code sends JSON) */
|
|
53
|
+
export async function readStdin() {
|
|
54
|
+
return new Promise((resolve, reject) => {
|
|
55
|
+
let data = "";
|
|
56
|
+
let settled = false;
|
|
57
|
+
const finish = (fn, value) => {
|
|
58
|
+
if (settled)
|
|
59
|
+
return;
|
|
60
|
+
settled = true;
|
|
61
|
+
fn(value);
|
|
62
|
+
};
|
|
63
|
+
process.stdin.setEncoding("utf-8");
|
|
64
|
+
process.stdin.on("data", (chunk) => {
|
|
65
|
+
data += chunk;
|
|
66
|
+
});
|
|
67
|
+
process.stdin.on("end", () => {
|
|
68
|
+
try {
|
|
69
|
+
finish(resolve, JSON.parse(data));
|
|
70
|
+
}
|
|
71
|
+
catch {
|
|
72
|
+
finish(reject, new Error("Invalid JSON on stdin"));
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
process.stdin.on("error", (err) => finish(reject, err));
|
|
76
|
+
// Hard timeout — always fires after 3 seconds regardless of data state.
|
|
77
|
+
// If data was received but stdin never closed (e.g. parent process didn't
|
|
78
|
+
// close the pipe), try to parse whatever we have instead of hanging forever.
|
|
79
|
+
setTimeout(() => {
|
|
80
|
+
if (data) {
|
|
81
|
+
try {
|
|
82
|
+
finish(resolve, JSON.parse(data));
|
|
83
|
+
}
|
|
84
|
+
catch {
|
|
85
|
+
finish(reject, new Error("Stdin timeout: incomplete JSON"));
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
else {
|
|
89
|
+
finish(reject, new Error("No stdin data received"));
|
|
90
|
+
}
|
|
91
|
+
}, 3000);
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
//# sourceMappingURL=context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../src/common/context.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACL,UAAU,EACV,YAAY,EACZ,gBAAgB,EAChB,6BAA6B,EAC7B,aAAa,EACb,UAAU,EACV,WAAW,EACX,SAAS,GAIV,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAQtE,iDAAiD;AACjD,MAAM,CAAC,KAAK,UAAU,eAAe,CACnC,GAAW,EACX,QAAkB,EAClB,iBAA0B;IAE1B,MAAM,MAAM,GAAG,UAAU,CAAC,GAAG,CAAC,CAAC;IAC/B,MAAM,EAAE,GAAG,YAAY,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IAEvC,4DAA4D;IAC5D,IAAI,OAAO,GAAuB,IAAI,CAAC;IACvC,IAAI,iBAAiB,EAAE,CAAC;QACtB,OAAO,GAAG,6BAA6B,CAAC,EAAE,EAAE,iBAAiB,CAAC,CAAC;IACjE,CAAC;IACD,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,OAAO,GAAG,gBAAgB,CAAC,EAAE,EAAE,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,QAAQ,CAAC,CAAC;IACpE,CAAC;IACD,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,EAAE,GAAG,UAAU,EAAE,CAAC;QACxB,MAAM,GAAG,GA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}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/handlers/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/handlers/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Unified hook dispatcher.
|
|
3
|
+
*
|
|
4
|
+
* Platform-agnostic handler that processes normalized hook input
|
|
5
|
+
* and delegates to the appropriate ADIT handler.
|
|
6
|
+
*/
|
|
7
|
+
import type { NormalizedHookInput } from "../adapters/types.js";
|
|
8
|
+
/**
|
|
9
|
+
* Dispatch a normalized hook input to the appropriate handler.
|
|
10
|
+
* This is the single entry point for all platform hook events.
|
|
11
|
+
*/
|
|
12
|
+
export declare function dispatchHook(input: NormalizedHookInput): Promise<void>;
|
|
13
|
+
//# sourceMappingURL=unified.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unified.d.ts","sourceRoot":"","sources":["../../src/handlers/unified.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAcH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAEhE;;;GAGG;AACH,wBAAsB,YAAY,CAAC,KAAK,EAAE,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC,CAmE5E"}
|