@slope-dev/slope 1.13.0 → 1.13.2
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 +118 -189
- package/dist/adapters.d.ts +15 -0
- package/dist/adapters.d.ts.map +1 -0
- package/dist/adapters.js +17 -0
- package/dist/adapters.js.map +1 -0
- package/dist/cli/commands/guard.d.ts +19 -0
- package/dist/cli/commands/guard.d.ts.map +1 -1
- package/dist/cli/commands/guard.js +89 -1
- package/dist/cli/commands/guard.js.map +1 -1
- package/dist/cli/commands/hook.d.ts +5 -0
- package/dist/cli/commands/hook.d.ts.map +1 -1
- package/dist/cli/commands/hook.js +59 -83
- package/dist/cli/commands/hook.js.map +1 -1
- package/dist/cli/commands/init.d.ts +13 -4
- package/dist/cli/commands/init.d.ts.map +1 -1
- package/dist/cli/commands/init.js +309 -16
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/cli/commands/metaphor.d.ts +3 -0
- package/dist/cli/commands/metaphor.d.ts.map +1 -0
- package/dist/cli/commands/metaphor.js +100 -0
- package/dist/cli/commands/metaphor.js.map +1 -0
- package/dist/cli/commands/roadmap.d.ts.map +1 -1
- package/dist/cli/commands/roadmap.js +94 -1
- package/dist/cli/commands/roadmap.js.map +1 -1
- package/dist/cli/commands/store.d.ts +2 -0
- package/dist/cli/commands/store.d.ts.map +1 -0
- package/dist/cli/commands/store.js +204 -0
- package/dist/cli/commands/store.js.map +1 -0
- package/dist/cli/guards/branch-before-commit.d.ts +7 -0
- package/dist/cli/guards/branch-before-commit.d.ts.map +1 -0
- package/dist/cli/guards/branch-before-commit.js +43 -0
- package/dist/cli/guards/branch-before-commit.js.map +1 -0
- package/dist/cli/guards/stop-check.d.ts +4 -0
- package/dist/cli/guards/stop-check.d.ts.map +1 -1
- package/dist/cli/guards/stop-check.js +50 -16
- package/dist/cli/guards/stop-check.js.map +1 -1
- package/dist/cli/index.js +20 -1
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/registry.d.ts.map +1 -1
- package/dist/cli/registry.js +2 -0
- package/dist/cli/registry.js.map +1 -1
- package/dist/cli/store.d.ts +9 -0
- package/dist/cli/store.d.ts.map +1 -1
- package/dist/cli/store.js +29 -0
- package/dist/cli/store.js.map +1 -1
- package/dist/cli/template-generator.d.ts +1 -1
- package/dist/cli/template-generator.d.ts.map +1 -1
- package/dist/cli/template-generator.js +5 -3
- package/dist/cli/template-generator.js.map +1 -1
- package/dist/core/adapters/claude-code.d.ts +28 -0
- package/dist/core/adapters/claude-code.d.ts.map +1 -0
- package/dist/core/adapters/claude-code.js +148 -0
- package/dist/core/adapters/claude-code.js.map +1 -0
- package/dist/core/adapters/cline.d.ts +36 -0
- package/dist/core/adapters/cline.d.ts.map +1 -0
- package/dist/core/adapters/cline.js +279 -0
- package/dist/core/adapters/cline.js.map +1 -0
- package/dist/core/adapters/cursor.d.ts +38 -0
- package/dist/core/adapters/cursor.d.ts.map +1 -0
- package/dist/core/adapters/cursor.js +143 -0
- package/dist/core/adapters/cursor.js.map +1 -0
- package/dist/core/adapters/generic.d.ts +29 -0
- package/dist/core/adapters/generic.d.ts.map +1 -0
- package/dist/core/adapters/generic.js +142 -0
- package/dist/core/adapters/generic.js.map +1 -0
- package/dist/core/adapters/windsurf.d.ts +37 -0
- package/dist/core/adapters/windsurf.d.ts.map +1 -0
- package/dist/core/adapters/windsurf.js +170 -0
- package/dist/core/adapters/windsurf.js.map +1 -0
- package/dist/core/config.d.ts +3 -0
- package/dist/core/config.d.ts.map +1 -1
- package/dist/core/config.js +9 -0
- package/dist/core/config.js.map +1 -1
- package/dist/core/guard.d.ts +10 -3
- package/dist/core/guard.d.ts.map +1 -1
- package/dist/core/guard.js +33 -59
- package/dist/core/guard.js.map +1 -1
- package/dist/core/harness.d.ts +61 -0
- package/dist/core/harness.d.ts.map +1 -0
- package/dist/core/harness.js +88 -0
- package/dist/core/harness.js.map +1 -0
- package/dist/core/index.d.ts +15 -5
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +13 -3
- package/dist/core/index.js.map +1 -1
- package/dist/core/interview.js +1 -1
- package/dist/core/interview.js.map +1 -1
- package/dist/core/metaphor.d.ts +14 -0
- package/dist/core/metaphor.d.ts.map +1 -1
- package/dist/core/metaphor.js +14 -0
- package/dist/core/metaphor.js.map +1 -1
- package/dist/core/plugins.d.ts +12 -0
- package/dist/core/plugins.d.ts.map +1 -1
- package/dist/core/plugins.js +58 -1
- package/dist/core/plugins.js.map +1 -1
- package/dist/core/roadmap.d.ts.map +1 -1
- package/dist/core/roadmap.js +5 -4
- package/dist/core/roadmap.js.map +1 -1
- package/dist/core/store-health.d.ts +11 -0
- package/dist/core/store-health.d.ts.map +1 -0
- package/dist/core/store-health.js +26 -0
- package/dist/core/store-health.js.map +1 -0
- package/dist/core/store.d.ts +10 -0
- package/dist/core/store.d.ts.map +1 -1
- package/dist/core/store.js.map +1 -1
- package/dist/mcp/index.d.ts +2 -2
- package/dist/mcp/index.d.ts.map +1 -1
- package/dist/mcp/index.js +55 -6
- package/dist/mcp/index.js.map +1 -1
- package/dist/mcp/index.test.js +7 -4
- package/dist/mcp/index.test.js.map +1 -1
- package/dist/mcp/registry.d.ts.map +1 -1
- package/dist/mcp/registry.js +32 -3
- package/dist/mcp/registry.js.map +1 -1
- package/dist/mcp/sandbox.d.ts.map +1 -1
- package/dist/mcp/sandbox.js +7 -1
- package/dist/mcp/sandbox.js.map +1 -1
- package/dist/store/index.d.ts +8 -2
- package/dist/store/index.d.ts.map +1 -1
- package/dist/store/index.js +27 -3
- package/dist/store/index.js.map +1 -1
- package/dist/store-pg/index.d.ts +3 -0
- package/dist/store-pg/index.d.ts.map +1 -1
- package/dist/store-pg/index.js +49 -1
- package/dist/store-pg/index.js.map +1 -1
- package/package.json +16 -7
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
// SLOPE GenericAdapter — fallback adapter for any harness without a dedicated adapter.
|
|
2
|
+
// Outputs simple JSON, generates a guards manifest, and creates shell-based dispatcher.
|
|
3
|
+
import { existsSync, writeFileSync, mkdirSync } from 'node:fs';
|
|
4
|
+
import { join } from 'node:path';
|
|
5
|
+
import { registerAdapter, resolveToolMatcher } from '../harness.js';
|
|
6
|
+
/** Generic tool name map — uses common operation names */
|
|
7
|
+
const GENERIC_TOOLS = {
|
|
8
|
+
read_file: 'read_file',
|
|
9
|
+
write_file: 'write_file',
|
|
10
|
+
search_files: 'search_files',
|
|
11
|
+
search_content: 'search_content',
|
|
12
|
+
execute_command: 'execute_command',
|
|
13
|
+
create_subagent: 'create_subagent',
|
|
14
|
+
exit_plan: 'exit_plan',
|
|
15
|
+
};
|
|
16
|
+
/** Generic adapter — works with any harness via shell scripts and JSON manifest. */
|
|
17
|
+
export class GenericAdapter {
|
|
18
|
+
id = 'generic';
|
|
19
|
+
displayName = 'Generic (Shell)';
|
|
20
|
+
toolNames = GENERIC_TOOLS;
|
|
21
|
+
supportedEvents = new Set(['PreToolUse', 'PostToolUse', 'Stop']);
|
|
22
|
+
supportsContextInjection = false;
|
|
23
|
+
hooksConfigPath(_cwd) {
|
|
24
|
+
return null;
|
|
25
|
+
}
|
|
26
|
+
formatPreToolOutput(result) {
|
|
27
|
+
const action = result.decision === 'deny' ? 'deny'
|
|
28
|
+
: result.decision === 'ask' ? 'ask'
|
|
29
|
+
: result.context ? 'context'
|
|
30
|
+
: 'allow';
|
|
31
|
+
return {
|
|
32
|
+
action,
|
|
33
|
+
...(result.context && { message: result.context }),
|
|
34
|
+
...(result.blockReason && { reason: result.blockReason }),
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
formatPostToolOutput(result) {
|
|
38
|
+
return {
|
|
39
|
+
action: result.blockReason ? 'deny' : result.context ? 'context' : 'allow',
|
|
40
|
+
...(result.context && { message: result.context }),
|
|
41
|
+
...(result.blockReason && { reason: result.blockReason }),
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
formatStopOutput(result) {
|
|
45
|
+
return {
|
|
46
|
+
action: result.blockReason ? 'deny' : 'allow',
|
|
47
|
+
...(result.blockReason && { reason: result.blockReason }),
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
generateHooksConfig(guards, guardScriptPath) {
|
|
51
|
+
return guards.map(g => {
|
|
52
|
+
// Resolve matcher via toolCategories (harness-agnostic) with fallback to raw matcher
|
|
53
|
+
const matcher = resolveToolMatcher(this, 'toolCategories' in g ? g.toolCategories : undefined) ?? g.matcher;
|
|
54
|
+
return {
|
|
55
|
+
name: g.name,
|
|
56
|
+
description: g.description,
|
|
57
|
+
hookEvent: g.hookEvent,
|
|
58
|
+
...(matcher && { matcher }),
|
|
59
|
+
level: g.level,
|
|
60
|
+
command: `${guardScriptPath} ${g.name}`,
|
|
61
|
+
};
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
installGuards(cwd, guards) {
|
|
65
|
+
const hooksDir = join(cwd, '.slope', 'hooks');
|
|
66
|
+
mkdirSync(hooksDir, { recursive: true });
|
|
67
|
+
// Create the guard dispatcher script
|
|
68
|
+
const dispatcherPath = join(hooksDir, 'slope-guard.sh');
|
|
69
|
+
if (!existsSync(dispatcherPath)) {
|
|
70
|
+
const script = [
|
|
71
|
+
'#!/usr/bin/env bash',
|
|
72
|
+
'# SLOPE guard dispatcher — routes hook events to slope guard handlers',
|
|
73
|
+
'# Auto-generated by slope hook add --level=full --harness=generic',
|
|
74
|
+
'#',
|
|
75
|
+
'# Usage: ./slope-guard.sh <guard-name>',
|
|
76
|
+
'# Reads JSON from stdin, outputs JSON to stdout.',
|
|
77
|
+
'# See guards-manifest.json for available guards.',
|
|
78
|
+
'',
|
|
79
|
+
'# === SLOPE MANAGED (do not edit above this line) ===',
|
|
80
|
+
'slope guard "$@"',
|
|
81
|
+
'# === SLOPE END ===',
|
|
82
|
+
'',
|
|
83
|
+
].join('\n');
|
|
84
|
+
writeFileSync(dispatcherPath, script, { mode: 0o755 });
|
|
85
|
+
console.log(` Created ${dispatcherPath}`);
|
|
86
|
+
}
|
|
87
|
+
// Generate guards manifest
|
|
88
|
+
const manifestPath = join(hooksDir, 'guards-manifest.json');
|
|
89
|
+
const manifest = this.generateHooksConfig(guards, './slope-guard.sh');
|
|
90
|
+
writeFileSync(manifestPath, JSON.stringify(manifest, null, 2) + '\n');
|
|
91
|
+
console.log(` Created ${manifestPath}`);
|
|
92
|
+
// Generate README
|
|
93
|
+
const readmePath = join(hooksDir, 'README.md');
|
|
94
|
+
if (!existsSync(readmePath)) {
|
|
95
|
+
const readme = [
|
|
96
|
+
'# SLOPE Guard Hooks',
|
|
97
|
+
'',
|
|
98
|
+
'This directory contains SLOPE guard hooks for use with any AI coding harness.',
|
|
99
|
+
'',
|
|
100
|
+
'## Files',
|
|
101
|
+
'',
|
|
102
|
+
'- `slope-guard.sh` — Dispatcher script that routes guard names to `slope guard`',
|
|
103
|
+
'- `guards-manifest.json` — Machine-readable list of all installed guards',
|
|
104
|
+
'',
|
|
105
|
+
'## Integration',
|
|
106
|
+
'',
|
|
107
|
+
'To wire these guards into your harness:',
|
|
108
|
+
'',
|
|
109
|
+
'1. Configure your harness to call `slope-guard.sh <guard-name>` at the appropriate hook event',
|
|
110
|
+
'2. Pass the hook context as JSON on stdin',
|
|
111
|
+
'3. Read the JSON response from stdout',
|
|
112
|
+
'',
|
|
113
|
+
'### Hook Events',
|
|
114
|
+
'',
|
|
115
|
+
'- **PreToolUse** — Before a tool executes (can allow, deny, or inject context)',
|
|
116
|
+
'- **PostToolUse** — After a tool executes (can block or inject context)',
|
|
117
|
+
'- **Stop** — Before session ends (can block to prevent premature exit)',
|
|
118
|
+
'- **PreCompact** — Before context compaction (extract state before compression)',
|
|
119
|
+
'',
|
|
120
|
+
'### Response Format',
|
|
121
|
+
'',
|
|
122
|
+
'```json',
|
|
123
|
+
'{ "action": "allow" | "deny" | "context", "message": "...", "reason": "..." }',
|
|
124
|
+
'```',
|
|
125
|
+
'',
|
|
126
|
+
'See `guards-manifest.json` for the full list of guards and their hook events.',
|
|
127
|
+
'',
|
|
128
|
+
].join('\n');
|
|
129
|
+
writeFileSync(readmePath, readme);
|
|
130
|
+
console.log(` Created ${readmePath}`);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
detect(_cwd) {
|
|
134
|
+
// Generic is the fallback — only used when no other adapter matches
|
|
135
|
+
return true;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
/** Singleton instance */
|
|
139
|
+
export const genericAdapter = new GenericAdapter();
|
|
140
|
+
// Auto-register on import
|
|
141
|
+
registerAdapter(genericAdapter);
|
|
142
|
+
//# sourceMappingURL=generic.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generic.js","sourceRoot":"","sources":["../../../src/core/adapters/generic.ts"],"names":[],"mappings":"AAAA,uFAAuF;AACvF,wFAAwF;AAExF,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAC/D,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAGpE,0DAA0D;AAC1D,MAAM,aAAa,GAAgB;IACjC,SAAS,EAAE,WAAW;IACtB,UAAU,EAAE,YAAY;IACxB,YAAY,EAAE,cAAc;IAC5B,cAAc,EAAE,gBAAgB;IAChC,eAAe,EAAE,iBAAiB;IAClC,eAAe,EAAE,iBAAiB;IAClC,SAAS,EAAE,WAAW;CACvB,CAAC;AAYF,oFAAoF;AACpF,MAAM,OAAO,cAAc;IAChB,EAAE,GAAG,SAAkB,CAAC;IACxB,WAAW,GAAG,iBAAiB,CAAC;IAChC,SAAS,GAAgB,aAAa,CAAC;IACvC,eAAe,GAAG,IAAI,GAAG,CAAC,CAAC,YAAY,EAAE,aAAa,EAAE,MAAM,CAAC,CAAC,CAAC;IACjE,wBAAwB,GAAG,KAAK,CAAC;IAE1C,eAAe,CAAC,IAAY;QAC1B,OAAO,IAAI,CAAC;IACd,CAAC;IAED,mBAAmB,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c,GAAG,IAAI,cAAc,EAAE,CAAC;AAEnD,0BAA0B;AAC1B,eAAe,CAAC,cAAc,CAAC,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { HarnessAdapter, ToolNameMap } from '../harness.js';
|
|
2
|
+
import type { GuardResult, AnyGuardDefinition } from '../guard.js';
|
|
3
|
+
/** Windsurf hook entry in .windsurf/hooks.json */
|
|
4
|
+
export interface WindsurfHookEntry {
|
|
5
|
+
event: string;
|
|
6
|
+
matcher?: string;
|
|
7
|
+
command: string;
|
|
8
|
+
timeout?: number;
|
|
9
|
+
description?: string;
|
|
10
|
+
}
|
|
11
|
+
/** Windsurf hooks config shape */
|
|
12
|
+
export interface WindsurfHooksConfig {
|
|
13
|
+
hooks: WindsurfHookEntry[];
|
|
14
|
+
}
|
|
15
|
+
/** Windsurf hook output (JSON from adapter, translated to exit codes by dispatcher) */
|
|
16
|
+
export interface WindsurfHookOutput {
|
|
17
|
+
action: 'allow' | 'deny';
|
|
18
|
+
message?: string;
|
|
19
|
+
}
|
|
20
|
+
/** Windsurf adapter — formats guard output for Windsurf's exit-code-based hook system. */
|
|
21
|
+
export declare class WindsurfAdapter implements HarnessAdapter {
|
|
22
|
+
readonly id: "windsurf";
|
|
23
|
+
readonly displayName = "Windsurf";
|
|
24
|
+
readonly toolNames: ToolNameMap;
|
|
25
|
+
readonly supportedEvents: Set<string>;
|
|
26
|
+
readonly supportsContextInjection = false;
|
|
27
|
+
hooksConfigPath(cwd: string): string | null;
|
|
28
|
+
formatPreToolOutput(result: GuardResult): WindsurfHookOutput;
|
|
29
|
+
formatPostToolOutput(result: GuardResult): WindsurfHookOutput;
|
|
30
|
+
formatStopOutput(result: GuardResult): WindsurfHookOutput;
|
|
31
|
+
generateHooksConfig(guards: AnyGuardDefinition[], guardScriptPath: string): WindsurfHooksConfig;
|
|
32
|
+
installGuards(cwd: string, guards: AnyGuardDefinition[]): void;
|
|
33
|
+
detect(cwd: string): boolean;
|
|
34
|
+
}
|
|
35
|
+
/** Singleton instance */
|
|
36
|
+
export declare const windsurfAdapter: WindsurfAdapter;
|
|
37
|
+
//# sourceMappingURL=windsurf.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"windsurf.d.ts","sourceRoot":"","sources":["../../../src/core/adapters/windsurf.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAEjE,OAAO,KAAK,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAanE,kDAAkD;AAClD,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,kCAAkC;AAClC,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,iBAAiB,EAAE,CAAC;CAC5B;AAED,uFAAuF;AACvF,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE,OAAO,GAAG,MAAM,CAAC;IACzB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAYD,0FAA0F;AAC1F,qBAAa,eAAgB,YAAW,cAAc;IACpD,QAAQ,CAAC,EAAE,EAAG,UAAU,CAAU;IAClC,QAAQ,CAAC,WAAW,cAAc;IAClC,QAAQ,CAAC,SAAS,EAAE,WAAW,CAAkB;IACjD,QAAQ,CAAC,eAAe,cAA0C;IAClE,QAAQ,CAAC,wBAAwB,SAAS;IAE1C,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI;IAI3C,mBAAmB,CAAC,MAAM,EAAE,WAAW,GAAG,kBAAkB;IAW5D,oBAAoB,CAAC,MAAM,EAAE,WAAW,GAAG,kBAAkB;IAU7D,gBAAgB,CAAC,MAAM,EAAE,WAAW,GAAG,kBAAkB;IAWzD,mBAAmB,CAAC,MAAM,EAAE,kBAAkB,EAAE,EAAE,eAAe,EAAE,MAAM,GAAG,mBAAmB;IAsB/F,aAAa,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,kBAAkB,EAAE,GAAG,IAAI;IAkF9D,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO;CAG7B;AAED,yBAAyB;AACzB,eAAO,MAAM,eAAe,iBAAwB,CAAC"}
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
// SLOPE WindsurfAdapter — adapts guard framework to Windsurf's Cascade hook system.
|
|
2
|
+
// Windsurf uses exit-code-based blocking: 0 = allow, 2 = block.
|
|
3
|
+
// The adapter itself is JSON-in/JSON-out; the dispatcher script translates to exit codes.
|
|
4
|
+
//
|
|
5
|
+
// Limitation: Windsurf cannot inject additionalContext into the agent's context.
|
|
6
|
+
// Guards can block but not add guidance. No on-stop event support.
|
|
7
|
+
import { existsSync, writeFileSync, readFileSync, mkdirSync } from 'node:fs';
|
|
8
|
+
import { join } from 'node:path';
|
|
9
|
+
import { registerAdapter, resolveToolMatcher } from '../harness.js';
|
|
10
|
+
/** Windsurf tool name mappings */
|
|
11
|
+
const WINDSURF_TOOLS = {
|
|
12
|
+
read_file: 'read_file',
|
|
13
|
+
write_file: 'create_file|edit_file',
|
|
14
|
+
search_files: 'find_files',
|
|
15
|
+
search_content: 'search',
|
|
16
|
+
execute_command: 'run_command',
|
|
17
|
+
create_subagent: 'create_subagent',
|
|
18
|
+
exit_plan: 'exit_plan',
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Map SLOPE hook events to Windsurf hook events.
|
|
22
|
+
* Stop is intentionally omitted — Windsurf has no session-end hook.
|
|
23
|
+
* PreCompact is intentionally omitted — Windsurf has no pre-compaction hook.
|
|
24
|
+
*/
|
|
25
|
+
const HOOK_EVENT_MAP = {
|
|
26
|
+
PreToolUse: 'pre-tool-use',
|
|
27
|
+
PostToolUse: 'post-tool-use',
|
|
28
|
+
};
|
|
29
|
+
/** Windsurf adapter — formats guard output for Windsurf's exit-code-based hook system. */
|
|
30
|
+
export class WindsurfAdapter {
|
|
31
|
+
id = 'windsurf';
|
|
32
|
+
displayName = 'Windsurf';
|
|
33
|
+
toolNames = WINDSURF_TOOLS;
|
|
34
|
+
supportedEvents = new Set(['PreToolUse', 'PostToolUse']);
|
|
35
|
+
supportsContextInjection = false;
|
|
36
|
+
hooksConfigPath(cwd) {
|
|
37
|
+
return join(cwd, '.windsurf', 'hooks.json');
|
|
38
|
+
}
|
|
39
|
+
formatPreToolOutput(result) {
|
|
40
|
+
if (result.decision === 'deny' || result.blockReason) {
|
|
41
|
+
return {
|
|
42
|
+
action: 'deny',
|
|
43
|
+
...(result.blockReason && { message: result.blockReason }),
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
// 'ask' and context-only fall through to 'allow' — Windsurf can't inject context or prompt
|
|
47
|
+
return { action: 'allow' };
|
|
48
|
+
}
|
|
49
|
+
formatPostToolOutput(result) {
|
|
50
|
+
if (result.blockReason) {
|
|
51
|
+
return {
|
|
52
|
+
action: 'deny',
|
|
53
|
+
message: result.blockReason,
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
return { action: 'allow' };
|
|
57
|
+
}
|
|
58
|
+
formatStopOutput(result) {
|
|
59
|
+
// Windsurf doesn't support stop hooks, but format consistently
|
|
60
|
+
if (result.blockReason) {
|
|
61
|
+
return {
|
|
62
|
+
action: 'deny',
|
|
63
|
+
message: result.blockReason,
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
return { action: 'allow' };
|
|
67
|
+
}
|
|
68
|
+
generateHooksConfig(guards, guardScriptPath) {
|
|
69
|
+
const hooks = [];
|
|
70
|
+
for (const g of guards) {
|
|
71
|
+
const windsurfEvent = HOOK_EVENT_MAP[g.hookEvent];
|
|
72
|
+
if (!windsurfEvent)
|
|
73
|
+
continue; // Skip unsupported hook events (e.g., Stop)
|
|
74
|
+
const matcher = resolveToolMatcher(this, 'toolCategories' in g ? g.toolCategories : undefined) ?? g.matcher;
|
|
75
|
+
const entry = {
|
|
76
|
+
event: windsurfEvent,
|
|
77
|
+
command: `${guardScriptPath} ${g.name}`,
|
|
78
|
+
timeout: 10000,
|
|
79
|
+
description: `SLOPE: ${g.description}`,
|
|
80
|
+
};
|
|
81
|
+
if (matcher)
|
|
82
|
+
entry.matcher = matcher;
|
|
83
|
+
hooks.push(entry);
|
|
84
|
+
}
|
|
85
|
+
return { hooks };
|
|
86
|
+
}
|
|
87
|
+
installGuards(cwd, guards) {
|
|
88
|
+
const hooksDir = join(cwd, '.windsurf', 'hooks');
|
|
89
|
+
mkdirSync(hooksDir, { recursive: true });
|
|
90
|
+
// Create the exit-code dispatcher script
|
|
91
|
+
// This wraps `slope guard`, reads JSON output, and translates to exit codes
|
|
92
|
+
const dispatcherPath = join(hooksDir, 'slope-guard.sh');
|
|
93
|
+
if (!existsSync(dispatcherPath)) {
|
|
94
|
+
const script = [
|
|
95
|
+
'#!/usr/bin/env bash',
|
|
96
|
+
'# SLOPE guard dispatcher for Windsurf — translates JSON to exit codes',
|
|
97
|
+
'# Auto-generated by slope hook add --level=full --harness=windsurf',
|
|
98
|
+
'#',
|
|
99
|
+
'# Windsurf exit-code protocol:',
|
|
100
|
+
'# exit 0 = allow (tool proceeds)',
|
|
101
|
+
'# exit 2 = block (tool denied)',
|
|
102
|
+
'# other = error (logged, tool proceeds)',
|
|
103
|
+
'',
|
|
104
|
+
'# === SLOPE MANAGED (do not edit above this line) ===',
|
|
105
|
+
'OUTPUT=$(slope guard "$@" 2>"${SLOPE_GUARD_LOG:-/dev/null}")',
|
|
106
|
+
'if [ $? -ne 0 ]; then',
|
|
107
|
+
' exit 0 # Guard errored — allow tool to proceed',
|
|
108
|
+
'fi',
|
|
109
|
+
'# Parse action from JSON (handles both compact and prettified output)',
|
|
110
|
+
'ACTION=$(echo "$OUTPUT" | grep -o \'"action"[[:space:]]*:[[:space:]]*"[^"]*"\' | head -1 | cut -d\'"\' -f4)',
|
|
111
|
+
'',
|
|
112
|
+
'if [ "$ACTION" = "deny" ]; then',
|
|
113
|
+
' exit 2',
|
|
114
|
+
'fi',
|
|
115
|
+
'exit 0',
|
|
116
|
+
'# === SLOPE END ===',
|
|
117
|
+
'',
|
|
118
|
+
].join('\n');
|
|
119
|
+
writeFileSync(dispatcherPath, script, { mode: 0o755 });
|
|
120
|
+
console.log(` Created ${dispatcherPath}`);
|
|
121
|
+
}
|
|
122
|
+
// Generate hooks config and merge into .windsurf/hooks.json
|
|
123
|
+
const guardScript = '.windsurf/hooks/slope-guard.sh';
|
|
124
|
+
const hooksConfig = this.generateHooksConfig(guards, guardScript);
|
|
125
|
+
const configPath = join(cwd, '.windsurf', 'hooks.json');
|
|
126
|
+
let existing = { hooks: [] };
|
|
127
|
+
if (existsSync(configPath)) {
|
|
128
|
+
try {
|
|
129
|
+
existing = JSON.parse(readFileSync(configPath, 'utf8'));
|
|
130
|
+
if (!Array.isArray(existing.hooks))
|
|
131
|
+
existing.hooks = [];
|
|
132
|
+
}
|
|
133
|
+
catch { /* start fresh */ }
|
|
134
|
+
}
|
|
135
|
+
// Merge — avoid duplicates by checking command + event
|
|
136
|
+
for (const entry of hooksConfig.hooks) {
|
|
137
|
+
const isDuplicate = existing.hooks.some(e => e.command === entry.command && e.event === entry.event);
|
|
138
|
+
if (!isDuplicate) {
|
|
139
|
+
existing.hooks.push(entry);
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
writeFileSync(configPath, JSON.stringify(existing, null, 2) + '\n');
|
|
143
|
+
console.log(` Updated ${configPath} with guard hooks`);
|
|
144
|
+
// Generate guards manifest for reference
|
|
145
|
+
const manifestPath = join(hooksDir, 'guards-manifest.json');
|
|
146
|
+
const manifest = guards
|
|
147
|
+
.filter(g => HOOK_EVENT_MAP[g.hookEvent])
|
|
148
|
+
.map(g => {
|
|
149
|
+
const matcher = resolveToolMatcher(this, 'toolCategories' in g ? g.toolCategories : undefined) ?? g.matcher;
|
|
150
|
+
return {
|
|
151
|
+
name: g.name,
|
|
152
|
+
description: g.description,
|
|
153
|
+
hookEvent: g.hookEvent,
|
|
154
|
+
...(matcher && { matcher }),
|
|
155
|
+
level: g.level,
|
|
156
|
+
command: `${guardScript} ${g.name}`,
|
|
157
|
+
};
|
|
158
|
+
});
|
|
159
|
+
writeFileSync(manifestPath, JSON.stringify(manifest, null, 2) + '\n');
|
|
160
|
+
console.log(` Created ${manifestPath}`);
|
|
161
|
+
}
|
|
162
|
+
detect(cwd) {
|
|
163
|
+
return existsSync(join(cwd, '.windsurf'));
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
/** Singleton instance */
|
|
167
|
+
export const windsurfAdapter = new WindsurfAdapter();
|
|
168
|
+
// Auto-register on import
|
|
169
|
+
registerAdapter(windsurfAdapter);
|
|
170
|
+
//# sourceMappingURL=windsurf.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"windsurf.js","sourceRoot":"","sources":["../../../src/core/adapters/windsurf.ts"],"names":[],"mappings":"AAAA,oFAAoF;AACpF,gEAAgE;AAChE,0FAA0F;AAC1F,EAAE;AACF,iFAAiF;AACjF,mEAAmE;AAEnE,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAC7E,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAGpE,kCAAkC;AAClC,MAAM,cAAc,GAAgB;IAClC,SAAS,EAAE,WAAW;IACtB,UAAU,EAAE,uBAAuB;IACnC,YAAY,EAAE,YAAY;IAC1B,cAAc,EAAE,QAAQ;IACxB,eAAe,EAAE,aAAa;IAC9B,eAAe,EAAE,iBAAiB;IAClC,SAAS,EAAE,WAAW;CACvB,CAAC;AAsBF;;;;GAIG;AACH,MAAM,cAAc,GAAkF;IACpG,UAA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Aa,YAAY,EAAE,CAAC,CAAC;IAC3C,CAAC;IAED,MAAM,CAAC,GAAW;QAChB,OAAO,UAAU,CAAC,IAAI,CAAC,GAAG,EAAE,WAAW,CAAC,CAAC,CAAC;IAC5C,CAAC;CACF;AAED,yBAAyB;AACzB,MAAM,CAAC,MAAM,eAAe,GAAG,IAAI,eAAe,EAAE,CAAC;AAErD,0BAA0B;AAC1B,eAAe,CAAC,eAAe,CAAC,CAAC"}
|
package/dist/core/config.d.ts
CHANGED
|
@@ -30,6 +30,7 @@ export interface SlopeConfig {
|
|
|
30
30
|
subagentAllowModels?: string[];
|
|
31
31
|
pushCommitThreshold?: number;
|
|
32
32
|
handoffsDir?: string;
|
|
33
|
+
allowMainCommitPatterns?: string[];
|
|
33
34
|
};
|
|
34
35
|
orchestration?: {
|
|
35
36
|
escalation?: EscalationConfig;
|
|
@@ -53,5 +54,7 @@ export interface SlopeConfig {
|
|
|
53
54
|
}
|
|
54
55
|
export declare function loadConfig(cwd?: string): SlopeConfig;
|
|
55
56
|
export declare function createConfig(cwd?: string): string;
|
|
57
|
+
/** Write a complete SlopeConfig to .slope/config.json. Expects a full config object (use loadConfig() to read-modify-write). */
|
|
58
|
+
export declare function saveConfig(config: SlopeConfig, cwd?: string): string;
|
|
56
59
|
export declare function resolveConfigPath(config: SlopeConfig, relativePath: string, cwd?: string): string;
|
|
57
60
|
//# sourceMappingURL=config.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/core/config.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAElD,MAAM,WAAW,WAAW;IAC1B,YAAY,EAAE,MAAM,CAAC;IACrB,gBAAgB,EAAE,MAAM,CAAC;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,gBAAgB,EAAE,MAAM,CA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,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QACjC,aAAa,CAAC,EAAE,MAAM,CAAC;KACxB,CAAC;IACF,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE;QACT,gBAAgB,EAAE,MAAM,CAAC;QACzB,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB,CAAC;CACH;AAqBD,wBAAgB,UAAU,CAAC,GAAG,GAAE,MAAsB,GAAG,WAAW,CAWnE;AAED,wBAAgB,YAAY,CAAC,GAAG,GAAE,MAAsB,GAAG,MAAM,CAQhE;AAED,gIAAgI;AAChI,wBAAgB,UAAU,CAAC,MAAM,EAAE,WAAW,EAAE,GAAG,GAAE,MAAsB,GAAG,MAAM,CAMnF;AAED,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,EAAE,GAAG,GAAE,MAAsB,GAAG,MAAM,CAEhH"}
|
package/dist/core/config.js
CHANGED
|
@@ -39,6 +39,15 @@ export function createConfig(cwd = process.cwd()) {
|
|
|
39
39
|
writeFileSync(configPath, JSON.stringify(DEFAULT_CONFIG, null, 2) + '\n');
|
|
40
40
|
return configPath;
|
|
41
41
|
}
|
|
42
|
+
/** Write a complete SlopeConfig to .slope/config.json. Expects a full config object (use loadConfig() to read-modify-write). */
|
|
43
|
+
export function saveConfig(config, cwd = process.cwd()) {
|
|
44
|
+
const dir = join(cwd, CONFIG_DIR);
|
|
45
|
+
if (!existsSync(dir))
|
|
46
|
+
mkdirSync(dir, { recursive: true });
|
|
47
|
+
const configPath = join(dir, CONFIG_FILE);
|
|
48
|
+
writeFileSync(configPath, JSON.stringify(config, null, 2) + '\n');
|
|
49
|
+
return configPath;
|
|
50
|
+
}
|
|
42
51
|
export function resolveConfigPath(config, relativePath, cwd = process.cwd()) {
|
|
43
52
|
return join(cwd, relativePath);
|
|
44
53
|
}
|
package/dist/core/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/core/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAC7E,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/core/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAC7E,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAyDjC,MAAM,cAAc,GAAgB;IAClC,YAAY,EAAE,aAAa;IAC3B,gBAAgB,EAAE,eAAe;IACjC,SAAS,EAAE,CAAC;IACZ,gBAAgB,EAAE,2BAA2B;IAC7C,YAAY,EAAE,sBAAsB;IACpC,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE,oBAAoB;IAChC,WAAW,EAAE,2BAA2B;IACxC,SAAS,EAAE,mBAAmB;IAC9B,UAAU,EAAE,oBAAoB;IAChC,eAAe,EAAE,0BAA0B;IAC3C,eAAe,EAAE,oBAAoB;IACrC,QAAQ,EAAE,MAAM;CACjB,CAAC;AAEF,MAAM,UAAU,GAAG,QAAQ,CAAC;AAC5B,MAAM,WAAW,GAAG,aAAa,CAAC;AAElC,MAAM,UAAU,UAAU,CAAC,MAAc,OAAO,CAAC,GAAG,EAAE;IACpD,MAAM,UAAU,GAAG,IAAI,CAAC,GAAG,EAAE,UAAU,EAAE,WAAW,CAAC,CAAC;IACtD,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC;QAC5B,OAAO,EAAE,GAAG,cAAc,EAAE,CAAC;IAC/B,CAAC;IACD,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,UAAU,EAAE,MA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IACtG,OAAO,IAAI,CAAC,GAAG,EAAE,YAAY,CAAC,CAAC;AACjC,CAAC"}
|
package/dist/core/guard.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ToolCategory } from './harness.js';
|
|
1
2
|
/** Input from Claude Code PreToolUse/PostToolUse hooks (JSON on stdin) */
|
|
2
3
|
export interface HookInput {
|
|
3
4
|
session_id: string;
|
|
@@ -44,14 +45,16 @@ export interface GuardResult {
|
|
|
44
45
|
blockReason?: string;
|
|
45
46
|
}
|
|
46
47
|
/** Known guard names */
|
|
47
|
-
export type GuardName = 'explore' | 'hazard' | 'commit-nudge' | 'scope-drift' | 'compaction' | 'stop-check' | 'subagent-gate' | 'push-nudge' | 'workflow-gate' | 'review-tier' | 'version-check' | 'stale-flows' | 'next-action' | 'pr-review' | 'transcript';
|
|
48
|
+
export type GuardName = 'explore' | 'hazard' | 'commit-nudge' | 'scope-drift' | 'compaction' | 'stop-check' | 'subagent-gate' | 'push-nudge' | 'workflow-gate' | 'review-tier' | 'version-check' | 'stale-flows' | 'next-action' | 'pr-review' | 'transcript' | 'branch-before-commit';
|
|
48
49
|
/** Guard registration entry */
|
|
49
50
|
export interface GuardDefinition {
|
|
50
51
|
name: GuardName;
|
|
51
52
|
description: string;
|
|
52
53
|
/** Which hook event this guard fires on */
|
|
53
54
|
hookEvent: 'PreToolUse' | 'PostToolUse' | 'Stop' | 'PreCompact';
|
|
54
|
-
/**
|
|
55
|
+
/** Harness-agnostic tool categories this guard matches (adapter resolves to tool names) */
|
|
56
|
+
toolCategories?: ToolCategory[];
|
|
57
|
+
/** Regex matcher for tool name (PreToolUse/PostToolUse only) — computed from toolCategories via adapter */
|
|
55
58
|
matcher?: string;
|
|
56
59
|
/** Which --level installs this guard */
|
|
57
60
|
level: 'scoring' | 'full';
|
|
@@ -80,6 +83,8 @@ export interface GuidanceConfig {
|
|
|
80
83
|
pushCommitThreshold?: number;
|
|
81
84
|
/** Directory for compaction handoff files (default '.slope/handoffs') */
|
|
82
85
|
handoffsDir?: string;
|
|
86
|
+
/** Commit message patterns allowed on main/master (branch-before-commit guard) */
|
|
87
|
+
allowMainCommitPatterns?: string[];
|
|
83
88
|
}
|
|
84
89
|
/** All guard definitions */
|
|
85
90
|
export declare const GUARD_DEFINITIONS: GuardDefinition[];
|
|
@@ -89,6 +94,8 @@ export interface CustomGuardDefinition {
|
|
|
89
94
|
description: string;
|
|
90
95
|
hookEvent: 'PreToolUse' | 'PostToolUse' | 'Stop' | 'PreCompact';
|
|
91
96
|
matcher?: string;
|
|
97
|
+
/** Harness-agnostic tool categories this guard applies to */
|
|
98
|
+
toolCategories?: ToolCategory[];
|
|
92
99
|
level: 'scoring' | 'full';
|
|
93
100
|
command: string;
|
|
94
101
|
}
|
|
@@ -110,7 +117,7 @@ export declare function formatPostToolUseOutput(result: GuardResult): PostToolUs
|
|
|
110
117
|
export declare function formatStopOutput(result: GuardResult): StopOutput;
|
|
111
118
|
/**
|
|
112
119
|
* Generate Claude Code settings.json hooks configuration for installed guards.
|
|
113
|
-
*
|
|
120
|
+
* Delegates to ClaudeCodeAdapter.generateHooksConfig().
|
|
114
121
|
*/
|
|
115
122
|
export declare function generateClaudeCodeHooksConfig(guards: AnyGuardDefinition[], guardScriptPath: string): Record<string, Array<{
|
|
116
123
|
matcher?: string;
|
package/dist/core/guard.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"guard.d.ts","sourceRoot":"","sources":["../../src/core/guard.ts"],"names":[],"mappings":"AAGA,0EAA0E;AAC1E,MAAM,WAAW,SAAS;IACxB,UAAU,EAAE,MAAM,CAAC;IACnB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,GAAG,EAAE,MAAM,CAAC;IACZ,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,eAAe,EAAE,MAAM,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE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