@antistud/handrails-cli 0.1.0
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/dist/bin/handrails-rig.d.ts +9 -0
- package/dist/bin/handrails-rig.js +19 -0
- package/dist/bin/handrails-rig.js.map +1 -0
- package/dist/bin/handrails.d.ts +2 -0
- package/dist/bin/handrails.js +10 -0
- package/dist/bin/handrails.js.map +1 -0
- package/dist/src/bridge/daemon.d.ts +50 -0
- package/dist/src/bridge/daemon.js +319 -0
- package/dist/src/bridge/daemon.js.map +1 -0
- package/dist/src/claude/context-manager.d.ts +41 -0
- package/dist/src/claude/context-manager.js +184 -0
- package/dist/src/claude/context-manager.js.map +1 -0
- package/dist/src/claude/reader.d.ts +17 -0
- package/dist/src/claude/reader.js +186 -0
- package/dist/src/claude/reader.js.map +1 -0
- package/dist/src/cli/commands/config.d.ts +2 -0
- package/dist/src/cli/commands/config.js +59 -0
- package/dist/src/cli/commands/config.js.map +1 -0
- package/dist/src/cli/commands/context.d.ts +2 -0
- package/dist/src/cli/commands/context.js +158 -0
- package/dist/src/cli/commands/context.js.map +1 -0
- package/dist/src/cli/commands/daemon.d.ts +2 -0
- package/dist/src/cli/commands/daemon.js +29 -0
- package/dist/src/cli/commands/daemon.js.map +1 -0
- package/dist/src/cli/commands/init.d.ts +2 -0
- package/dist/src/cli/commands/init.js +197 -0
- package/dist/src/cli/commands/init.js.map +1 -0
- package/dist/src/cli/commands/login.d.ts +2 -0
- package/dist/src/cli/commands/login.js +87 -0
- package/dist/src/cli/commands/login.js.map +1 -0
- package/dist/src/cli/commands/rig.d.ts +2 -0
- package/dist/src/cli/commands/rig.js +49 -0
- package/dist/src/cli/commands/rig.js.map +1 -0
- package/dist/src/cli/commands/status.d.ts +2 -0
- package/dist/src/cli/commands/status.js +119 -0
- package/dist/src/cli/commands/status.js.map +1 -0
- package/dist/src/cli/commands/sync.d.ts +2 -0
- package/dist/src/cli/commands/sync.js +149 -0
- package/dist/src/cli/commands/sync.js.map +1 -0
- package/dist/src/cli/index.d.ts +2 -0
- package/dist/src/cli/index.js +62 -0
- package/dist/src/cli/index.js.map +1 -0
- package/dist/src/config/index.d.ts +20 -0
- package/dist/src/config/index.js +131 -0
- package/dist/src/config/index.js.map +1 -0
- package/dist/src/config/schema.d.ts +59 -0
- package/dist/src/config/schema.js +14 -0
- package/dist/src/config/schema.js.map +1 -0
- package/dist/src/handrails/auth.d.ts +15 -0
- package/dist/src/handrails/auth.js +80 -0
- package/dist/src/handrails/auth.js.map +1 -0
- package/dist/src/handrails/client.d.ts +100 -0
- package/dist/src/handrails/client.js +135 -0
- package/dist/src/handrails/client.js.map +1 -0
- package/dist/src/index.d.ts +5 -0
- package/dist/src/index.js +34 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/mcp/server.d.ts +10 -0
- package/dist/src/mcp/server.js +167 -0
- package/dist/src/mcp/server.js.map +1 -0
- package/dist/src/mcp/tools/context-tools.d.ts +8 -0
- package/dist/src/mcp/tools/context-tools.js +111 -0
- package/dist/src/mcp/tools/context-tools.js.map +1 -0
- package/dist/src/mcp/tools/sync-tools.d.ts +9 -0
- package/dist/src/mcp/tools/sync-tools.js +170 -0
- package/dist/src/mcp/tools/sync-tools.js.map +1 -0
- package/dist/src/runner/executor.d.ts +8 -0
- package/dist/src/runner/executor.js +39 -0
- package/dist/src/runner/executor.js.map +1 -0
- package/dist/src/runner/executors/claude-code.d.ts +7 -0
- package/dist/src/runner/executors/claude-code.js +247 -0
- package/dist/src/runner/executors/claude-code.js.map +1 -0
- package/dist/src/runner/executors/codex.d.ts +9 -0
- package/dist/src/runner/executors/codex.js +72 -0
- package/dist/src/runner/executors/codex.js.map +1 -0
- package/dist/src/runner/executors/opencode.d.ts +9 -0
- package/dist/src/runner/executors/opencode.js +71 -0
- package/dist/src/runner/executors/opencode.js.map +1 -0
- package/dist/src/runner/executors/types.d.ts +24 -0
- package/dist/src/runner/executors/types.js +27 -0
- package/dist/src/runner/executors/types.js.map +1 -0
- package/dist/src/runner/index.d.ts +34 -0
- package/dist/src/runner/index.js +234 -0
- package/dist/src/runner/index.js.map +1 -0
- package/dist/src/runner/logger.d.ts +14 -0
- package/dist/src/runner/logger.js +35 -0
- package/dist/src/runner/logger.js.map +1 -0
- package/dist/src/workflow/engine.d.ts +44 -0
- package/dist/src/workflow/engine.js +383 -0
- package/dist/src/workflow/engine.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +46 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sync.js","sourceRoot":"","sources":["../../../../src/cli/commands/sync.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAeA,kDAqHC;AAnID,uCAAyB;AACzB,2CAA6B;AAC7B,yCAA2D;AAC3D,mDAAyD;AAWzD,SAAgB,mBAAmB,CAAC,OAAgB;IAClD,OAAO;SACJ,OAAO,CAAC,MAAM,CAAC;SACf,WAAW,CAAC,wDAAwD,CAAC;SACrE,MAAM,CAAC,qBAAqB,EAAE,qCAAqC,CAAC;SACpE,MAAM,CAAC,WAAW,EAAE,8CAA8C,CAAC;SACnE,MAAM,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE;QACxB,IAAI,CAAC,IAAA,wBAAe,GAAE,EAAE,CAAC;YACvB,OAAO,CAAC,KAAK,CAAC,iDAAiD,CAAC,CAAC;YACjE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;QAED,MAAM,MAAM,GAAG,IAAA,mBAAU,GAAE,CAAC;QAC5B,MAAM,MAAM,GAAG,IAAI,wBAAe,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC;QACjE,MAAM,UAAU,GAAG,OAAO,CAAC,UAAU,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;QACvD,MAAM,WAAW,GAAG,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,WAAW,CAAC,CAA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AAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;YACjH,CAAC;YACD,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;YAChB,OAAO,CAAC,GAAG,CAAC,qEAAqE,CAAC,CAAC;QACrF,CAAC;QAED,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAChB,OAAO,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC;IAChC,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createProgram = createProgram;
|
|
4
|
+
const commander_1 = require("commander");
|
|
5
|
+
const login_1 = require("./commands/login");
|
|
6
|
+
const init_1 = require("./commands/init");
|
|
7
|
+
const status_1 = require("./commands/status");
|
|
8
|
+
const context_1 = require("./commands/context");
|
|
9
|
+
const config_1 = require("./commands/config");
|
|
10
|
+
const daemon_1 = require("./commands/daemon");
|
|
11
|
+
const rig_1 = require("./commands/rig");
|
|
12
|
+
const sync_1 = require("./commands/sync");
|
|
13
|
+
const server_1 = require("../mcp/server");
|
|
14
|
+
function createProgram() {
|
|
15
|
+
const program = new commander_1.Command();
|
|
16
|
+
program
|
|
17
|
+
.name('handrails')
|
|
18
|
+
.description('Power tools for Claude Code — team memory, context sync, and session intelligence')
|
|
19
|
+
.version('0.1.0');
|
|
20
|
+
// Register all commands
|
|
21
|
+
(0, login_1.registerLoginCommand)(program);
|
|
22
|
+
(0, init_1.registerInitCommand)(program);
|
|
23
|
+
(0, status_1.registerStatusCommand)(program);
|
|
24
|
+
(0, context_1.registerContextCommand)(program);
|
|
25
|
+
(0, config_1.registerConfigCommand)(program);
|
|
26
|
+
(0, daemon_1.registerDaemonCommand)(program);
|
|
27
|
+
(0, rig_1.registerRigCommand)(program);
|
|
28
|
+
(0, sync_1.registerSyncCommand)(program);
|
|
29
|
+
// Serve command (MCP server via stdio)
|
|
30
|
+
program
|
|
31
|
+
.command('serve')
|
|
32
|
+
.description('Start the local MCP server (stdio transport, invoked by Claude Code)')
|
|
33
|
+
.action(async () => {
|
|
34
|
+
const server = new server_1.HandrailsLocalServer();
|
|
35
|
+
await server.start();
|
|
36
|
+
});
|
|
37
|
+
// Hook handlers (internal, called by Claude Code hooks)
|
|
38
|
+
program
|
|
39
|
+
.command('hook-stop')
|
|
40
|
+
.description('Internal: called by Claude Code Stop hook')
|
|
41
|
+
.option('--session-id <id>', 'Session ID')
|
|
42
|
+
.action(async (options) => {
|
|
43
|
+
// Phase 5: For now, just append to buffer file
|
|
44
|
+
const fs = require('fs');
|
|
45
|
+
const path = require('path');
|
|
46
|
+
const os = require('os');
|
|
47
|
+
const bufferDir = path.join(os.homedir(), '.handrails');
|
|
48
|
+
const bufferFile = path.join(bufferDir, 'session-buffer.jsonl');
|
|
49
|
+
if (!fs.existsSync(bufferDir)) {
|
|
50
|
+
fs.mkdirSync(bufferDir, { recursive: true });
|
|
51
|
+
}
|
|
52
|
+
const entry = {
|
|
53
|
+
type: 'stop',
|
|
54
|
+
timestamp: new Date().toISOString(),
|
|
55
|
+
sessionId: options.sessionId || null,
|
|
56
|
+
projectPath: process.cwd(),
|
|
57
|
+
};
|
|
58
|
+
fs.appendFileSync(bufferFile, JSON.stringify(entry) + '\n');
|
|
59
|
+
});
|
|
60
|
+
return program;
|
|
61
|
+
}
|
|
62
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/cli/index.ts"],"names":[],"mappings":";;AAWA,sCAwDC;AAnED,yCAAoC;AACpC,4CAAwD;AACxD,0CAAsD;AACtD,8CAA0D;AAC1D,gDAA4D;AAC5D,8CAA0D;AAC1D,8CAA0D;AAC1D,wCAAoD;AACpD,0CAAsD;AACtD,0CAAqD;AAErD,SAAgB,aAAa;IAC3B,MAAM,OAAO,GAAG,IAAI,mBAAO,EAAE,CAAC;I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I,CAAC,SAAS,EAAE,sBAAsB,CAAC,CAAC;QAEhE,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE,CAAC;YAC9B,EAAE,CAAC,SAAS,CAAC,SAAS,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QAC/C,CAAC;QAED,MAAM,KAAK,GAAG;YACZ,IAAI,EAAE,MAAM;YACZ,SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;YACnC,SAAS,EAAE,OAAO,CAAC,SAAS,IAAI,IAAI;YACpC,WAAW,EAAE,OAAO,CAAC,GAAG,EAAE;SAC3B,CAAC;QAEF,EAAE,CAAC,cAAc,CAAC,UAAU,EAAE,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,CAAC;IAC9D,CAAC,CAAC,CAAC;IAEL,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { HandrailsConfig, ProjectConfig, TeamCredential } from './schema';
|
|
2
|
+
declare const CONFIG_DIR: string;
|
|
3
|
+
declare const CONFIG_FILE: string;
|
|
4
|
+
export declare function ensureConfigDir(): void;
|
|
5
|
+
export declare function loadConfig(): HandrailsConfig;
|
|
6
|
+
export declare function saveConfig(config: HandrailsConfig): void;
|
|
7
|
+
export declare function updateConfig(updates: Partial<HandrailsConfig>): HandrailsConfig;
|
|
8
|
+
export declare function getProjectConfig(projectPath: string): ProjectConfig | null;
|
|
9
|
+
export declare function setProjectConfig(projectPath: string, project: ProjectConfig): void;
|
|
10
|
+
export declare function isAuthenticated(): boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Resolve the API key and team for a given project path.
|
|
13
|
+
* Uses the project-specific team if set, otherwise falls back to the default.
|
|
14
|
+
*/
|
|
15
|
+
export declare function resolveProjectCredentials(projectPath: string): TeamCredential | null;
|
|
16
|
+
/**
|
|
17
|
+
* Get all authenticated teams.
|
|
18
|
+
*/
|
|
19
|
+
export declare function getAuthenticatedTeams(): TeamCredential[];
|
|
20
|
+
export { CONFIG_DIR, CONFIG_FILE };
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.CONFIG_FILE = exports.CONFIG_DIR = void 0;
|
|
37
|
+
exports.ensureConfigDir = ensureConfigDir;
|
|
38
|
+
exports.loadConfig = loadConfig;
|
|
39
|
+
exports.saveConfig = saveConfig;
|
|
40
|
+
exports.updateConfig = updateConfig;
|
|
41
|
+
exports.getProjectConfig = getProjectConfig;
|
|
42
|
+
exports.setProjectConfig = setProjectConfig;
|
|
43
|
+
exports.isAuthenticated = isAuthenticated;
|
|
44
|
+
exports.resolveProjectCredentials = resolveProjectCredentials;
|
|
45
|
+
exports.getAuthenticatedTeams = getAuthenticatedTeams;
|
|
46
|
+
const fs = __importStar(require("fs"));
|
|
47
|
+
const path = __importStar(require("path"));
|
|
48
|
+
const os = __importStar(require("os"));
|
|
49
|
+
const schema_1 = require("./schema");
|
|
50
|
+
const CONFIG_DIR = path.join(os.homedir(), '.handrails');
|
|
51
|
+
exports.CONFIG_DIR = CONFIG_DIR;
|
|
52
|
+
const CONFIG_FILE = path.join(CONFIG_DIR, 'config.json');
|
|
53
|
+
exports.CONFIG_FILE = CONFIG_FILE;
|
|
54
|
+
function ensureConfigDir() {
|
|
55
|
+
if (!fs.existsSync(CONFIG_DIR)) {
|
|
56
|
+
fs.mkdirSync(CONFIG_DIR, { recursive: true });
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
function loadConfig() {
|
|
60
|
+
ensureConfigDir();
|
|
61
|
+
if (!fs.existsSync(CONFIG_FILE)) {
|
|
62
|
+
return { ...schema_1.DEFAULT_CONFIG };
|
|
63
|
+
}
|
|
64
|
+
try {
|
|
65
|
+
const raw = fs.readFileSync(CONFIG_FILE, 'utf-8');
|
|
66
|
+
return { ...schema_1.DEFAULT_CONFIG, ...JSON.parse(raw) };
|
|
67
|
+
}
|
|
68
|
+
catch {
|
|
69
|
+
return { ...schema_1.DEFAULT_CONFIG };
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
function saveConfig(config) {
|
|
73
|
+
ensureConfigDir();
|
|
74
|
+
fs.writeFileSync(CONFIG_FILE, JSON.stringify(config, null, 2), 'utf-8');
|
|
75
|
+
}
|
|
76
|
+
function updateConfig(updates) {
|
|
77
|
+
const config = loadConfig();
|
|
78
|
+
const updated = { ...config, ...updates };
|
|
79
|
+
saveConfig(updated);
|
|
80
|
+
return updated;
|
|
81
|
+
}
|
|
82
|
+
function getProjectConfig(projectPath) {
|
|
83
|
+
const config = loadConfig();
|
|
84
|
+
return config.projects[projectPath] || null;
|
|
85
|
+
}
|
|
86
|
+
function setProjectConfig(projectPath, project) {
|
|
87
|
+
const config = loadConfig();
|
|
88
|
+
config.projects[projectPath] = project;
|
|
89
|
+
saveConfig(config);
|
|
90
|
+
}
|
|
91
|
+
function isAuthenticated() {
|
|
92
|
+
const config = loadConfig();
|
|
93
|
+
return !!(config.apiKey && config.teamId);
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Resolve the API key and team for a given project path.
|
|
97
|
+
* Uses the project-specific team if set, otherwise falls back to the default.
|
|
98
|
+
*/
|
|
99
|
+
function resolveProjectCredentials(projectPath) {
|
|
100
|
+
const config = loadConfig();
|
|
101
|
+
const project = config.projects[projectPath];
|
|
102
|
+
// If project has a specific team, look it up
|
|
103
|
+
if (project?.teamId && config.teams[project.teamId]) {
|
|
104
|
+
return config.teams[project.teamId];
|
|
105
|
+
}
|
|
106
|
+
// Fall back to default
|
|
107
|
+
if (config.apiKey && config.teamId) {
|
|
108
|
+
return {
|
|
109
|
+
apiKey: config.apiKey,
|
|
110
|
+
teamId: config.teamId,
|
|
111
|
+
teamName: config.teamName,
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
return null;
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Get all authenticated teams.
|
|
118
|
+
*/
|
|
119
|
+
function getAuthenticatedTeams() {
|
|
120
|
+
const config = loadConfig();
|
|
121
|
+
const teams = Object.values(config.teams);
|
|
122
|
+
// Include the default if not already in the teams map
|
|
123
|
+
if (config.apiKey && config.teamId) {
|
|
124
|
+
const hasDefault = teams.some(t => t.teamId === config.teamId);
|
|
125
|
+
if (!hasDefault) {
|
|
126
|
+
teams.unshift({ apiKey: config.apiKey, teamId: config.teamId, teamName: config.teamName });
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
return teams;
|
|
130
|
+
}
|
|
131
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/config/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAQA,0CAIC;AAED,gCAWC;AAED,gCAGC;AAED,oCAKC;AAED,4CAGC;AAED,4CAIC;AAED,0CAGC;AAMD,8DAmBC;AAKD,sDAaC;AAhGD,uCAAyB;AACzB,2CAA6B;AAC7B,uCAAyB;AACzB,qCAA0F;AAE1F,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,YAAY,CAAC,CAAC;AA6FhD,gCAAU;AA5FnB,MAAM,WAAW,GAAG,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,aAAa,CAAC,CAAC;AA4FpC,kCAAW;AA1FhC,SAAgB,eAAe;IAC7B,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC;QAC/B,EAAE,CAAC,SAAS,CAAC,UAAU,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAChD,CAAC;AACH,CAAC;AAED,SAAgB,UAAU;IACxB,eAAe,EAAE,CAAC;IAClB,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,WAAW,CAAC,EAAE,CAAC;QAChC,OAAO,EAAE,GAAG,uBAAc,EAAE,CAAC;IAC/B,CAAC;IACD,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,EAAE,CAAC,YAAY,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;QAClD,OAAO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+
}
|
|
6
|
+
export interface HandrailsConfig {
|
|
7
|
+
apiUrl: string;
|
|
8
|
+
/** Default API key (used when no project-specific team is set) */
|
|
9
|
+
apiKey: string;
|
|
10
|
+
/** Default team (from the default API key) */
|
|
11
|
+
teamId: string;
|
|
12
|
+
teamName: string;
|
|
13
|
+
/** All authenticated teams, keyed by teamId */
|
|
14
|
+
teams: Record<string, TeamCredential>;
|
|
15
|
+
autoSync: boolean;
|
|
16
|
+
hooksInstalled: boolean;
|
|
17
|
+
projects: Record<string, ProjectConfig>;
|
|
18
|
+
}
|
|
19
|
+
export interface ProjectConfig {
|
|
20
|
+
projectTag: string;
|
|
21
|
+
/** Which team this project belongs to (teamId). Falls back to default if unset. */
|
|
22
|
+
teamId?: string;
|
|
23
|
+
lastSync: string | null;
|
|
24
|
+
}
|
|
25
|
+
export interface SessionIndexEntry {
|
|
26
|
+
sessionId: string;
|
|
27
|
+
fullPath: string;
|
|
28
|
+
fileMtime: number;
|
|
29
|
+
firstPrompt: string;
|
|
30
|
+
summary: string;
|
|
31
|
+
messageCount: number;
|
|
32
|
+
created: string;
|
|
33
|
+
modified: string;
|
|
34
|
+
gitBranch: string;
|
|
35
|
+
projectPath: string;
|
|
36
|
+
isSidechain: boolean;
|
|
37
|
+
}
|
|
38
|
+
export interface SessionIndex {
|
|
39
|
+
version: number;
|
|
40
|
+
entries: SessionIndexEntry[];
|
|
41
|
+
}
|
|
42
|
+
export interface ClaudeSettings {
|
|
43
|
+
hooks?: {
|
|
44
|
+
Stop?: Array<{
|
|
45
|
+
command: string;
|
|
46
|
+
matcher?: string;
|
|
47
|
+
}>;
|
|
48
|
+
PreToolUse?: Array<{
|
|
49
|
+
command: string;
|
|
50
|
+
matcher?: string;
|
|
51
|
+
}>;
|
|
52
|
+
PostToolUse?: Array<{
|
|
53
|
+
command: string;
|
|
54
|
+
matcher?: string;
|
|
55
|
+
}>;
|
|
56
|
+
};
|
|
57
|
+
[key: string]: any;
|
|
58
|
+
}
|
|
59
|
+
export declare const DEFAULT_CONFIG: HandrailsConfig;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DEFAULT_CONFIG = void 0;
|
|
4
|
+
exports.DEFAULT_CONFIG = {
|
|
5
|
+
apiUrl: 'https://mcp.handrails.dev',
|
|
6
|
+
apiKey: '',
|
|
7
|
+
teamId: '',
|
|
8
|
+
teamName: '',
|
|
9
|
+
teams: {},
|
|
10
|
+
autoSync: false,
|
|
11
|
+
hooksInstalled: false,
|
|
12
|
+
projects: {},
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../src/config/schema.ts"],"names":[],"mappings":";;;AAuDa,QAAA,cAAc,GAAoB;IAC7C,MAAM,EAAE,2BAA2B;IACnC,MAAM,EAAE,EAAE;IACV,MAAM,EAAE,EAAE;IACV,QAAQ,EAAE,EAAE;IACZ,KAAK,EAAE,EAAE;IACT,QAAQ,EAAE,KAAK;IACf,cAAc,EAAE,KAAK;IACrB,QAAQ,EAAE,EAAE;CACb,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export interface LoginResult {
|
|
2
|
+
success: boolean;
|
|
3
|
+
teamId?: string;
|
|
4
|
+
teamName?: string;
|
|
5
|
+
error?: string;
|
|
6
|
+
}
|
|
7
|
+
export declare function login(apiKey: string, apiUrl?: string): Promise<LoginResult>;
|
|
8
|
+
export declare function logout(teamId?: string): void;
|
|
9
|
+
export declare function getAuthStatus(): {
|
|
10
|
+
authenticated: boolean;
|
|
11
|
+
teamId?: string;
|
|
12
|
+
teamName?: string;
|
|
13
|
+
apiUrl: string;
|
|
14
|
+
teamCount: number;
|
|
15
|
+
};
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.login = login;
|
|
4
|
+
exports.logout = logout;
|
|
5
|
+
exports.getAuthStatus = getAuthStatus;
|
|
6
|
+
const config_1 = require("../config");
|
|
7
|
+
const client_1 = require("./client");
|
|
8
|
+
async function login(apiKey, apiUrl) {
|
|
9
|
+
const client = new client_1.HandrailsClient(apiUrl, apiKey);
|
|
10
|
+
const validation = await client.validateApiKey();
|
|
11
|
+
if (!validation.valid) {
|
|
12
|
+
return { success: false, error: validation.error };
|
|
13
|
+
}
|
|
14
|
+
const config = (0, config_1.loadConfig)();
|
|
15
|
+
// Store in the teams map
|
|
16
|
+
if (validation.teamId) {
|
|
17
|
+
if (!config.teams)
|
|
18
|
+
config.teams = {};
|
|
19
|
+
config.teams[validation.teamId] = {
|
|
20
|
+
apiKey,
|
|
21
|
+
teamId: validation.teamId,
|
|
22
|
+
teamName: validation.teamName || 'Unknown Team',
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
// Set as default if no default exists yet
|
|
26
|
+
if (!config.apiKey || !config.teamId) {
|
|
27
|
+
config.apiKey = apiKey;
|
|
28
|
+
config.teamId = validation.teamId || '';
|
|
29
|
+
config.teamName = validation.teamName || '';
|
|
30
|
+
}
|
|
31
|
+
if (apiUrl)
|
|
32
|
+
config.apiUrl = apiUrl;
|
|
33
|
+
(0, config_1.saveConfig)(config);
|
|
34
|
+
return {
|
|
35
|
+
success: true,
|
|
36
|
+
teamId: validation.teamId,
|
|
37
|
+
teamName: validation.teamName,
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
function logout(teamId) {
|
|
41
|
+
const config = (0, config_1.loadConfig)();
|
|
42
|
+
if (teamId) {
|
|
43
|
+
delete config.teams[teamId];
|
|
44
|
+
if (config.teamId === teamId) {
|
|
45
|
+
const remaining = Object.values(config.teams);
|
|
46
|
+
if (remaining.length > 0) {
|
|
47
|
+
config.apiKey = remaining[0].apiKey;
|
|
48
|
+
config.teamId = remaining[0].teamId;
|
|
49
|
+
config.teamName = remaining[0].teamName;
|
|
50
|
+
}
|
|
51
|
+
else {
|
|
52
|
+
config.apiKey = '';
|
|
53
|
+
config.teamId = '';
|
|
54
|
+
config.teamName = '';
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
config.apiKey = '';
|
|
60
|
+
config.teamId = '';
|
|
61
|
+
config.teamName = '';
|
|
62
|
+
config.teams = {};
|
|
63
|
+
}
|
|
64
|
+
(0, config_1.saveConfig)(config);
|
|
65
|
+
}
|
|
66
|
+
function getAuthStatus() {
|
|
67
|
+
const config = (0, config_1.loadConfig)();
|
|
68
|
+
const teamCount = Object.keys(config.teams || {}).length;
|
|
69
|
+
const effectiveCount = (config.apiKey && config.teamId && !(config.teams || {})[config.teamId])
|
|
70
|
+
? teamCount + 1
|
|
71
|
+
: Math.max(teamCount, config.apiKey ? 1 : 0);
|
|
72
|
+
return {
|
|
73
|
+
authenticated: !!(config.apiKey && config.teamId),
|
|
74
|
+
teamId: config.teamId || undefined,
|
|
75
|
+
teamName: config.teamName || undefined,
|
|
76
|
+
apiUrl: config.apiUrl,
|
|
77
|
+
teamCount: effectiveCount,
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
//# sourceMappingURL=auth.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth.js","sourceRoot":"","sources":["../../../src/handrails/auth.ts"],"names":[],"mappings":";;AAUA,sBAoCC;AAED,wBAyBC;AAED,sCAoBC;AA/FD,sCAAmD;AACnD,qCAA2C;AASpC,KAAK,UAAU,KAAK,CAAC,MAAc,EAAE,MAAe;IACzD,MAAM,MAAM,GAAG,IAAI,wBAAe,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACnD,MAAM,UAAU,GAAG,MAAM,MAAM,CAAC,cAAc,EAAE,CAAC;IAEjD,IAAI,CAAC,UAAU,CAAC,KAAK,EAAE,CAAC;QACtB,OAAO,EAAE,OAAO,EAAE,KAAK,E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E/C,OAAO;QACL,aAAa,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,IAAI,MAAM,CAAC,MAAM,CAAC;QACjD,MAAM,EAAE,MAAM,CAAC,MAAM,IAAI,SAAS;QAClC,QAAQ,EAAE,MAAM,CAAC,QAAQ,IAAI,SAAS;QACtC,MAAM,EAAE,MAAM,CAAC,MAAM;QACrB,SAAS,EAAE,cAAc;KAC1B,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
export interface HandrailsDocument {
|
|
2
|
+
id: number;
|
|
3
|
+
title: string;
|
|
4
|
+
content: string;
|
|
5
|
+
tokens: number;
|
|
6
|
+
content_preview?: string;
|
|
7
|
+
source_url?: string;
|
|
8
|
+
created_at: string;
|
|
9
|
+
updated_at?: string;
|
|
10
|
+
tags?: Array<{
|
|
11
|
+
id: number;
|
|
12
|
+
name: string;
|
|
13
|
+
color?: string;
|
|
14
|
+
}>;
|
|
15
|
+
}
|
|
16
|
+
export interface SearchResult {
|
|
17
|
+
document_id: number;
|
|
18
|
+
title: string;
|
|
19
|
+
content: string;
|
|
20
|
+
score: number;
|
|
21
|
+
tags?: Array<{
|
|
22
|
+
id: number;
|
|
23
|
+
name: string;
|
|
24
|
+
}>;
|
|
25
|
+
}
|
|
26
|
+
export interface HandrailsCommand {
|
|
27
|
+
id: number;
|
|
28
|
+
name: string;
|
|
29
|
+
description?: string;
|
|
30
|
+
system_prompt: string;
|
|
31
|
+
is_active: boolean;
|
|
32
|
+
arguments?: Array<{
|
|
33
|
+
name: string;
|
|
34
|
+
description?: string;
|
|
35
|
+
type: string;
|
|
36
|
+
required: boolean;
|
|
37
|
+
default_value?: string;
|
|
38
|
+
}>;
|
|
39
|
+
}
|
|
40
|
+
export interface ProjectContextResponse {
|
|
41
|
+
claude_md_template?: string;
|
|
42
|
+
documents: HandrailsDocument[];
|
|
43
|
+
commands: HandrailsCommand[];
|
|
44
|
+
team_name: string;
|
|
45
|
+
}
|
|
46
|
+
export declare class HandrailsClient {
|
|
47
|
+
private http;
|
|
48
|
+
constructor(apiUrl?: string, apiKey?: string);
|
|
49
|
+
validateApiKey(): Promise<{
|
|
50
|
+
valid: boolean;
|
|
51
|
+
teamId?: string;
|
|
52
|
+
teamName?: string;
|
|
53
|
+
error?: string;
|
|
54
|
+
}>;
|
|
55
|
+
searchKnowledge(query: string, limit?: number): Promise<SearchResult[]>;
|
|
56
|
+
storeDocument(title: string, content: string, tagIds?: number[]): Promise<{
|
|
57
|
+
document_id: number;
|
|
58
|
+
}>;
|
|
59
|
+
listDocuments(limit?: number, offset?: number): Promise<{
|
|
60
|
+
documents: HandrailsDocument[];
|
|
61
|
+
total: number;
|
|
62
|
+
}>;
|
|
63
|
+
getDocument(id: string | number): Promise<HandrailsDocument>;
|
|
64
|
+
deleteDocument(id: string | number): Promise<void>;
|
|
65
|
+
listCommands(): Promise<HandrailsCommand[]>;
|
|
66
|
+
listTags(): Promise<Array<{
|
|
67
|
+
id: number;
|
|
68
|
+
name: string;
|
|
69
|
+
color?: string;
|
|
70
|
+
description?: string;
|
|
71
|
+
document_count?: number;
|
|
72
|
+
}>>;
|
|
73
|
+
getTeamMcpServers(): Promise<Array<{
|
|
74
|
+
name: string;
|
|
75
|
+
description?: string;
|
|
76
|
+
package_name: string;
|
|
77
|
+
version?: string;
|
|
78
|
+
command: string;
|
|
79
|
+
args: string[];
|
|
80
|
+
required_env: Array<{
|
|
81
|
+
name: string;
|
|
82
|
+
description?: string;
|
|
83
|
+
required: boolean;
|
|
84
|
+
default?: string;
|
|
85
|
+
}>;
|
|
86
|
+
}>>;
|
|
87
|
+
getProjectContext(projectTag: string): Promise<ProjectContextResponse>;
|
|
88
|
+
getClaudeMdTemplate(projectTag?: string): Promise<string | null>;
|
|
89
|
+
saveClaudeMdTemplate(template: string, projectTag?: string): Promise<void>;
|
|
90
|
+
pushSessionSummaries(sessions: Array<{
|
|
91
|
+
title: string;
|
|
92
|
+
summary: string;
|
|
93
|
+
project: string;
|
|
94
|
+
branch?: string;
|
|
95
|
+
sessionDate: string;
|
|
96
|
+
messageCount: number;
|
|
97
|
+
}>): Promise<{
|
|
98
|
+
stored: number;
|
|
99
|
+
}>;
|
|
100
|
+
}
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.HandrailsClient = void 0;
|
|
7
|
+
const axios_1 = __importDefault(require("axios"));
|
|
8
|
+
const config_1 = require("../config");
|
|
9
|
+
class HandrailsClient {
|
|
10
|
+
constructor(apiUrl, apiKey) {
|
|
11
|
+
const config = (0, config_1.loadConfig)();
|
|
12
|
+
const baseURL = apiUrl || config.apiUrl;
|
|
13
|
+
const key = apiKey || config.apiKey;
|
|
14
|
+
this.http = axios_1.default.create({
|
|
15
|
+
baseURL,
|
|
16
|
+
headers: {
|
|
17
|
+
'x-api-key': key,
|
|
18
|
+
'Content-Type': 'application/json',
|
|
19
|
+
},
|
|
20
|
+
timeout: 30000,
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
async validateApiKey() {
|
|
24
|
+
try {
|
|
25
|
+
const res = await this.http.get('/mcp/usage');
|
|
26
|
+
const data = res.data;
|
|
27
|
+
return {
|
|
28
|
+
valid: true,
|
|
29
|
+
teamId: data.team_id,
|
|
30
|
+
teamName: data.team_name || 'Unknown Team',
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
catch (err) {
|
|
34
|
+
const error = err;
|
|
35
|
+
if (error.response?.status === 401 || error.response?.status === 403) {
|
|
36
|
+
return { valid: false, error: 'Invalid or expired API key' };
|
|
37
|
+
}
|
|
38
|
+
return { valid: false, error: error.message };
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
async searchKnowledge(query, limit = 10) {
|
|
42
|
+
const res = await this.http.post('/mcp/query', { query, limit });
|
|
43
|
+
return res.data.results || [];
|
|
44
|
+
}
|
|
45
|
+
async storeDocument(title, content, tagIds) {
|
|
46
|
+
const body = { title, content };
|
|
47
|
+
if (tagIds?.length)
|
|
48
|
+
body.tag_ids = tagIds;
|
|
49
|
+
const res = await this.http.post('/mcp/store', body);
|
|
50
|
+
return res.data;
|
|
51
|
+
}
|
|
52
|
+
async listDocuments(limit = 50, offset = 0) {
|
|
53
|
+
const res = await this.http.get('/mcp/documents', { params: { limit, offset } });
|
|
54
|
+
return res.data;
|
|
55
|
+
}
|
|
56
|
+
async getDocument(id) {
|
|
57
|
+
const res = await this.http.get(`/mcp/documents/${id}`);
|
|
58
|
+
return res.data;
|
|
59
|
+
}
|
|
60
|
+
async deleteDocument(id) {
|
|
61
|
+
await this.http.delete(`/mcp/documents/${id}`);
|
|
62
|
+
}
|
|
63
|
+
async listCommands() {
|
|
64
|
+
const res = await this.http.get('/mcp/commands');
|
|
65
|
+
return res.data.commands || res.data || [];
|
|
66
|
+
}
|
|
67
|
+
async listTags() {
|
|
68
|
+
const res = await this.http.get('/mcp/tags');
|
|
69
|
+
return res.data.tags || res.data || [];
|
|
70
|
+
}
|
|
71
|
+
async getTeamMcpServers() {
|
|
72
|
+
const res = await this.http.get('/api/cli/mcp-servers');
|
|
73
|
+
return res.data.servers || [];
|
|
74
|
+
}
|
|
75
|
+
// CLI-specific endpoints (requires backend additions)
|
|
76
|
+
async getProjectContext(projectTag) {
|
|
77
|
+
try {
|
|
78
|
+
const res = await this.http.get('/api/cli/project-context', { params: { tag: projectTag } });
|
|
79
|
+
return res.data;
|
|
80
|
+
}
|
|
81
|
+
catch {
|
|
82
|
+
// Fallback: construct from existing endpoints
|
|
83
|
+
const [commands, docs] = await Promise.all([
|
|
84
|
+
this.listCommands().catch(() => []),
|
|
85
|
+
this.searchKnowledge(projectTag, 20).catch(() => []),
|
|
86
|
+
]);
|
|
87
|
+
return {
|
|
88
|
+
documents: docs.map(r => ({
|
|
89
|
+
id: r.document_id,
|
|
90
|
+
title: r.title,
|
|
91
|
+
content: r.content,
|
|
92
|
+
tokens: 0,
|
|
93
|
+
created_at: '',
|
|
94
|
+
})),
|
|
95
|
+
commands,
|
|
96
|
+
team_name: '',
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
async getClaudeMdTemplate(projectTag) {
|
|
101
|
+
try {
|
|
102
|
+
const params = {};
|
|
103
|
+
if (projectTag)
|
|
104
|
+
params.tag = projectTag;
|
|
105
|
+
const res = await this.http.get('/api/cli/claude-md-template', { params });
|
|
106
|
+
return res.data.template || null;
|
|
107
|
+
}
|
|
108
|
+
catch {
|
|
109
|
+
return null;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
async saveClaudeMdTemplate(template, projectTag) {
|
|
113
|
+
await this.http.put('/api/cli/claude-md-template', { template, tag: projectTag });
|
|
114
|
+
}
|
|
115
|
+
async pushSessionSummaries(sessions) {
|
|
116
|
+
try {
|
|
117
|
+
const res = await this.http.post('/api/cli/sessions', { sessions });
|
|
118
|
+
return res.data;
|
|
119
|
+
}
|
|
120
|
+
catch {
|
|
121
|
+
// Fallback: store each as individual document
|
|
122
|
+
let stored = 0;
|
|
123
|
+
for (const session of sessions) {
|
|
124
|
+
try {
|
|
125
|
+
await this.storeDocument(session.title, `**Session Summary** (${session.sessionDate})\n\nBranch: ${session.branch || 'unknown'}\nMessages: ${session.messageCount}\n\n${session.summary}`);
|
|
126
|
+
stored++;
|
|
127
|
+
}
|
|
128
|
+
catch { /* skip failures */ }
|
|
129
|
+
}
|
|
130
|
+
return { stored };
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
exports.HandrailsClient = HandrailsClient;
|
|
135
|
+
//# sourceMappingURL=client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../../src/handrails/client.ts"],"names":[],"mappings":";;;;;;AAAA,kD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