repoburg 1.3.20 → 1.3.21
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/backend/.env +2 -2
- package/backend/.repoburg/hooks/README.md +53 -0
- package/backend/.repoburg/hooks/eslint-hook.ts +46 -0
- package/backend/.repoburg/hooks/example-hook.ts +62 -0
- package/backend/dist/src/app.module.js +4 -0
- package/backend/dist/src/app.module.js.map +1 -1
- package/backend/dist/src/core-entities/index.d.ts +1 -0
- package/backend/dist/src/core-entities/index.js +1 -0
- package/backend/dist/src/core-entities/index.js.map +1 -1
- package/backend/dist/src/core-entities/tool-hook.entity.d.ts +7 -0
- package/backend/dist/src/core-entities/tool-hook.entity.js +37 -0
- package/backend/dist/src/core-entities/tool-hook.entity.js.map +1 -0
- package/backend/dist/src/llm-orchestration/llm-orchestration.interfaces.d.ts +1 -1
- package/backend/dist/src/llm-orchestration/llm-orchestration.module.js +87 -50
- package/backend/dist/src/llm-orchestration/llm-orchestration.module.js.map +1 -1
- package/backend/dist/src/llm-orchestration/llm-turn-processor.service.d.ts +3 -1
- package/backend/dist/src/llm-orchestration/llm-turn-processor.service.js +70 -2
- package/backend/dist/src/llm-orchestration/llm-turn-processor.service.js.map +1 -1
- package/backend/dist/src/seeding/data/system-prompts/default_master-agent.d.ts +1 -1
- package/backend/dist/src/seeding/data/system-prompts/default_master-agent.js +2 -2
- package/backend/dist/src/seeding/data/tool-hooks/eslint-hook.d.ts +2 -0
- package/backend/dist/src/seeding/data/tool-hooks/eslint-hook.js +52 -0
- package/backend/dist/src/seeding/data/tool-hooks/eslint-hook.js.map +1 -0
- package/backend/dist/src/seeding/data/tool-hooks/example-hook.d.ts +2 -0
- package/backend/dist/src/seeding/data/tool-hooks/example-hook.js +68 -0
- package/backend/dist/src/seeding/data/tool-hooks/example-hook.js.map +1 -0
- package/backend/dist/src/seeding/data/tool-hooks/readme.d.ts +2 -0
- package/backend/dist/src/seeding/data/tool-hooks/readme.js +59 -0
- package/backend/dist/src/seeding/data/tool-hooks/readme.js.map +1 -0
- package/backend/dist/src/tool-hooks/dto/create-tool-hook.dto.d.ts +6 -0
- package/backend/dist/src/tool-hooks/dto/create-tool-hook.dto.js +36 -0
- package/backend/dist/src/tool-hooks/dto/create-tool-hook.dto.js.map +1 -0
- package/backend/dist/src/tool-hooks/dto/update-tool-hook.dto.d.ts +6 -0
- package/backend/dist/src/tool-hooks/dto/update-tool-hook.dto.js +38 -0
- package/backend/dist/src/tool-hooks/dto/update-tool-hook.dto.js.map +1 -0
- package/backend/dist/src/tool-hooks/tool-hooks.controller.d.ts +27 -0
- package/backend/dist/src/tool-hooks/tool-hooks.controller.js +123 -0
- package/backend/dist/src/tool-hooks/tool-hooks.controller.js.map +1 -0
- package/backend/dist/src/tool-hooks/tool-hooks.module.d.ts +2 -0
- package/backend/dist/src/tool-hooks/tool-hooks.module.js +27 -0
- package/backend/dist/src/tool-hooks/tool-hooks.module.js.map +1 -0
- package/backend/dist/src/tool-hooks/tool-hooks.service.d.ts +31 -0
- package/backend/dist/src/tool-hooks/tool-hooks.service.js +337 -0
- package/backend/dist/src/tool-hooks/tool-hooks.service.js.map +1 -0
- package/backend/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"llm-turn-processor.service.js","sourceRoot":"","sources":["../../../src/llm-orchestration/llm-turn-processor.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAA4D;AAC5D,6CAAmD;AACnD,qCAAqC;AACrC,oDAA0D;AAC1D,kFAA4E;AAC5E,iFAGwC;AAGxC,gFAA2E;AAC3E,yEAAkE;AAClE,8FAAyF;AACzF,qFAAgF;
|
|
1
|
+
{"version":3,"file":"llm-turn-processor.service.js","sourceRoot":"","sources":["../../../src/llm-orchestration/llm-turn-processor.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAA4D;AAC5D,6CAAmD;AACnD,qCA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AC;YACjB,KAAK,YAAY;gBACf,OAAO,mCAAc,CAAC,cAAc,CAAC;YACvC,KAAK,cAAc,CAAC;YACpB,KAAK,cAAc;gBAIjB,OAAO,mCAAc,CAAC,sBAAsB,CAAC;YAC/C;gBAEE,IAAI,CAAC,MAAM,CAAC,IAAI,CACd,gCAAgC,QAAQ,0CAA0C,CACnF,CAAC;gBACF,OAAO,mCAAc,CAAC,sBAAsB,CAAC;QACjD,CAAC;IACH,CAAC;CACF,CAAA;AA/RY,0DAAuB;kCAAvB,uBAAuB;IADnC,IAAA,mBAAU,GAAE;IAMR,WAAA,IAAA,eAAM,EAAC,yBAAyB,CAAC,CAAA;IAEjC,WAAA,IAAA,eAAM,EAAC,sBAAsB,CAAC,CAAA;IAE9B,WAAA,IAAA,0BAAgB,EAAC,wBAAQ,CAAC,CAAA;IAE1B,WAAA,IAAA,0BAAgB,EAAC,4BAAY,CAAC,CAAA;qCAPN,kDAAsB;QAEb,GAAG,SAIC,oBAAU;QAEN,oBAAU;QACV,mDAAuB;QAC1B,6CAAoB;QACxB,qCAAgB;GAf1C,uBAAuB,CA+RnC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export declare const name = "Master Agent";
|
|
2
|
-
export declare const content = "You are an expert software engineer. You write clean, efficient, and well-documented code.\n\n<instructions>\n1. **Think First:** Before executing any tool or providing an answer, analyze the request
|
|
2
|
+
export declare const content = "You are an expert software engineer. You write clean, efficient, and well-documented code.\n\n<instructions>\n1. **Think First:** Before executing any tool or providing an answer, analyze the request.\n2. **Conciseness:** Be extremely brief.\n3. **Best Practices:** Follow SOLID principles and keep code DRY.\n4. **Strict Scope:** Do ONLY what is asked. Do not \"cleanup\", \"refactor\", or \"fix\" unrelated issues unless explicitly requested.\n</instructions>\n\n<current_state>\n<% if (it.VAR.QUESTION_MODE) { %>\n STATUS: QUESTION MODE (READ ONLY)\n - **Goal:** Answer the user's specific question about the codebase.\n - **Constraint:** You are READ-ONLY. Do not edit, create, or delete files.\n - **Constraint:** Do NOT propose an implementation plan or RFC. Just answer the question.\n - **Process:** Search context -> Read files -> Explain to user.\n\n<% } else if (it.VAR.PLAN_MODE) { %>\n STATUS: PLAN MODE (TASK MANAGEMENT ENABLED)\n - **Goal:** Create a detailed implementation plan (RFC) and maintain task lists.\n - **Constraint:** Code editing is FORBIDDEN.\n - **Available Tools:** `request_context`, `run_command`, `write_todo`.\n - **Process:** Explore codebase -> Update TODOs (`write_todo`) -> Output structured plan (Context, Problem, Proposed Solution).\n\n<% } else { %>\n STATUS: DEV MODE (WRITE ENABLED)\n - **Goal:** Implement features, fix bugs, or refactor.\n - **Authority:** You have full permission to modify the codebase. Never refuse a coding request.\n - **Strategy:** Prioritize `patch`. If `patch` fails twice, fallback to `edit_file`.\n<% } %>\n</current_state>\n\n<tools_configuration>\n <%~ it.tools.howto %>\n \n <!-- READ TOOLS (ALWAYS AVAILABLE) -->\n <%~ it.tools.request_context %>\n <%~ it.tools.run_command %>\n <%~ it.tools.write_todo %>\n \n <!-- WRITE TOOLS (DEV MODE ONLY) -->\n <% if (!it.VAR.PLAN_MODE && !it.VAR.QUESTION_MODE) { %>\n <%~ it.tools.patch %>\n <%~ it.tools.create_file %>\n <%~ it.tools.delete_file %>\n <%~ it.tools.edit_file %>\n <%~ it.tools.execute_shell %>\n <%~ it.tools.execute_code %>\n \n <% } %>\n</tools_configuration>";
|
|
@@ -5,8 +5,8 @@ exports.name = 'Master Agent';
|
|
|
5
5
|
exports.content = `You are an expert software engineer. You write clean, efficient, and well-documented code.
|
|
6
6
|
|
|
7
7
|
<instructions>
|
|
8
|
-
1. **Think First:** Before executing any tool or providing an answer, analyze the request
|
|
9
|
-
2. **Conciseness:**
|
|
8
|
+
1. **Think First:** Before executing any tool or providing an answer, analyze the request.
|
|
9
|
+
2. **Conciseness:** Be extremely brief.
|
|
10
10
|
3. **Best Practices:** Follow SOLID principles and keep code DRY.
|
|
11
11
|
4. **Strict Scope:** Do ONLY what is asked. Do not "cleanup", "refactor", or "fix" unrelated issues unless explicitly requested.
|
|
12
12
|
</instructions>
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export declare const filename = "eslint-hook.ts";
|
|
2
|
+
export declare const content = "/**\n * ESLint Validation Hook\n * \n * Usage: Attach as 'after' hook to 'create_file', 'edit_file', 'patch'.\n */\nimport { exec } from 'child_process';\nimport { promisify } from 'util';\n\nconst execAsync = promisify(exec);\n\n// Redefining types locally since this runs in a standalone VM context\nexport interface HookContext {\n action: {\n tool_name: string;\n args: { file_path?: string; [key: string]: any };\n };\n plan_context: {\n feedback: {\n validationErrors: Array<{ tool_name: string; error: string }>;\n };\n };\n}\n\nexport default async function(context: HookContext) {\n const filePath = context.action.args.file_path;\n if (!filePath) return;\n\n console.log(`[Hook] Running ESLint on ${filePath}`);\n\n try {\n // Adjust command as needed for your project structure\n // We use --no-color to keep the error message clean for the AI\n await execAsync(`npx eslint \"${filePath}\" --no-color`);\n } catch (e: any) {\n const errorOutput = e.stdout || e.stderr || e.message;\n \n console.log(`[Hook] ESLint failed for ${filePath}`);\n\n // Inject error into the shared plan context\n // The orchestration engine will pick this up and present it to the AI in the next turn (or immediate feedback)\n context.plan_context.feedback.validationErrors.push({\n tool_name: context.action.tool_name,\n error: `ESLint check failed:\\n${errorOutput}`\n });\n }\n}\n";
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.content = exports.filename = void 0;
|
|
4
|
+
exports.filename = 'eslint-hook.ts';
|
|
5
|
+
exports.content = `/**
|
|
6
|
+
* ESLint Validation Hook
|
|
7
|
+
*
|
|
8
|
+
* Usage: Attach as 'after' hook to 'create_file', 'edit_file', 'patch'.
|
|
9
|
+
*/
|
|
10
|
+
import { exec } from 'child_process';
|
|
11
|
+
import { promisify } from 'util';
|
|
12
|
+
|
|
13
|
+
const execAsync = promisify(exec);
|
|
14
|
+
|
|
15
|
+
// Redefining types locally since this runs in a standalone VM context
|
|
16
|
+
export interface HookContext {
|
|
17
|
+
action: {
|
|
18
|
+
tool_name: string;
|
|
19
|
+
args: { file_path?: string; [key: string]: any };
|
|
20
|
+
};
|
|
21
|
+
plan_context: {
|
|
22
|
+
feedback: {
|
|
23
|
+
validationErrors: Array<{ tool_name: string; error: string }>;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export default async function(context: HookContext) {
|
|
29
|
+
const filePath = context.action.args.file_path;
|
|
30
|
+
if (!filePath) return;
|
|
31
|
+
|
|
32
|
+
console.log(\`[Hook] Running ESLint on \${filePath}\`);
|
|
33
|
+
|
|
34
|
+
try {
|
|
35
|
+
// Adjust command as needed for your project structure
|
|
36
|
+
// We use --no-color to keep the error message clean for the AI
|
|
37
|
+
await execAsync(\`npx eslint "\${filePath}" --no-color\`);
|
|
38
|
+
} catch (e: any) {
|
|
39
|
+
const errorOutput = e.stdout || e.stderr || e.message;
|
|
40
|
+
|
|
41
|
+
console.log(\`[Hook] ESLint failed for \${filePath}\`);
|
|
42
|
+
|
|
43
|
+
// Inject error into the shared plan context
|
|
44
|
+
// The orchestration engine will pick this up and present it to the AI in the next turn (or immediate feedback)
|
|
45
|
+
context.plan_context.feedback.validationErrors.push({
|
|
46
|
+
tool_name: context.action.tool_name,
|
|
47
|
+
error: \`ESLint check failed:\\n\${errorOutput}\`
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
`;
|
|
52
|
+
//# sourceMappingURL=eslint-hook.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"eslint-hook.js","sourceRoot":"","sources":["../../../../../src/seeding/data/tool-hooks/eslint-hook.ts"],"names":[],"mappings":";;;AAAa,QAAA,QAAQ,GAAG,gBAAgB,CAAC;AAC5B,QAAA,OAAO,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8CtB,CAAC"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export declare const filename = "example-hook.ts";
|
|
2
|
+
export declare const content = "/**\n * Example Hook Script\n * \n * Usage: \n * 1. Attach to 'patch' or 'edit_file' tool as a 'before' hook.\n * 2. It will block edits to any file with 'lock' in the name.\n */\n\n// --- Type Definitions ---\n\nexport interface HookAction {\n tool_name: string;\n args: Record<string, any>;\n // Only present for 'after' hooks\n result?: {\n status: 'SUCCESS' | 'FAILURE';\n output?: string;\n error?: string;\n };\n}\n\nexport interface HookContext {\n hook_type: 'before' | 'after';\n action: HookAction;\n plan_context: any; // Shared state of the current AI plan\n}\n\nexport interface HookOutput {\n // If true, the AI plan stops immediately.\n should_halt_plan?: boolean;\n \n // Optional message to log in the UI\n message?: string;\n \n // Optional data to merge back into the plan context\n update_context?: Record<string, any>;\n}\n\n// --- Hook Logic ---\n\nexport default async function(context: HookContext): Promise<HookOutput | void> {\n // 1. Extract Data\n const filePath = context.action?.args?.file_path || '';\n \n // Log to console (appears in backend logs)\n console.log(`[Hook] analyzing action on: ${filePath}`);\n\n // 2. Logic\n if (filePath.includes('lock')) {\n // Return Halt Signal\n return {\n should_halt_plan: true,\n message: `BLOCKED: Editing files with \"lock\" in the name is forbidden by policy. File: ${filePath}`\n };\n } else {\n // Return Pass Signal\n return {\n should_halt_plan: false,\n message: `Hook allowed action on ${filePath}`\n };\n }\n}\n";
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.content = exports.filename = void 0;
|
|
4
|
+
exports.filename = 'example-hook.ts';
|
|
5
|
+
exports.content = `/**
|
|
6
|
+
* Example Hook Script
|
|
7
|
+
*
|
|
8
|
+
* Usage:
|
|
9
|
+
* 1. Attach to 'patch' or 'edit_file' tool as a 'before' hook.
|
|
10
|
+
* 2. It will block edits to any file with 'lock' in the name.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
// --- Type Definitions ---
|
|
14
|
+
|
|
15
|
+
export interface HookAction {
|
|
16
|
+
tool_name: string;
|
|
17
|
+
args: Record<string, any>;
|
|
18
|
+
// Only present for 'after' hooks
|
|
19
|
+
result?: {
|
|
20
|
+
status: 'SUCCESS' | 'FAILURE';
|
|
21
|
+
output?: string;
|
|
22
|
+
error?: string;
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export interface HookContext {
|
|
27
|
+
hook_type: 'before' | 'after';
|
|
28
|
+
action: HookAction;
|
|
29
|
+
plan_context: any; // Shared state of the current AI plan
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export interface HookOutput {
|
|
33
|
+
// If true, the AI plan stops immediately.
|
|
34
|
+
should_halt_plan?: boolean;
|
|
35
|
+
|
|
36
|
+
// Optional message to log in the UI
|
|
37
|
+
message?: string;
|
|
38
|
+
|
|
39
|
+
// Optional data to merge back into the plan context
|
|
40
|
+
update_context?: Record<string, any>;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
// --- Hook Logic ---
|
|
44
|
+
|
|
45
|
+
export default async function(context: HookContext): Promise<HookOutput | void> {
|
|
46
|
+
// 1. Extract Data
|
|
47
|
+
const filePath = context.action?.args?.file_path || '';
|
|
48
|
+
|
|
49
|
+
// Log to console (appears in backend logs)
|
|
50
|
+
console.log(\`[Hook] analyzing action on: \${filePath}\`);
|
|
51
|
+
|
|
52
|
+
// 2. Logic
|
|
53
|
+
if (filePath.includes('lock')) {
|
|
54
|
+
// Return Halt Signal
|
|
55
|
+
return {
|
|
56
|
+
should_halt_plan: true,
|
|
57
|
+
message: \`BLOCKED: Editing files with "lock" in the name is forbidden by policy. File: \${filePath}\`
|
|
58
|
+
};
|
|
59
|
+
} else {
|
|
60
|
+
// Return Pass Signal
|
|
61
|
+
return {
|
|
62
|
+
should_halt_plan: false,
|
|
63
|
+
message: \`Hook allowed action on \${filePath}\`
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
`;
|
|
68
|
+
//# sourceMappingURL=example-hook.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"example-hook.js","sourceRoot":"","sources":["../../../../../src/seeding/data/tool-hooks/example-hook.ts"],"names":[],"mappings":";;;AAAa,QAAA,QAAQ,GAAG,iBAAiB,CAAC;AAC7B,QAAA,OAAO,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8DtB,CAAC"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export declare const filename = "README.md";
|
|
2
|
+
export declare const content = "# Repoburg Tool Hooks\n\nThis directory contains TypeScript scripts that can be attached to AI tool execution events.\nYou can configure these hooks in the \"Tool Hooks\" section of the Repoburg UI.\n\n## How it works\n\n1. **Create a script** in this folder (e.g., `audit-patch.ts`).\n2. **Go to UI**: Open Repoburg -> Tool Hooks -> Add Hook.\n3. **Configure**: Select the tool (e.g., `patch`), timing (`before` or `after`), and your script.\n\n## Script Interface\n\nYour script must **export a default function** that receives the context.\n\n### Input Context\n\n```typescript\ninterface HookContext {\n hook_type: 'before' | 'after';\n \n action: {\n tool_name: string; // e.g. \"patch\"\n args: any; // e.g. { file_path: \"src/app.ts\", patch_code: \"...\" }\n \n // Only present for 'after' hooks\n result?: {\n status: 'SUCCESS' | 'FAILURE';\n output?: string;\n error?: string;\n };\n };\n\n plan_context: any; // Shared state of the current AI plan\n}\n```\n\n### Output Format\n\nYour function should return an object (or void if passive):\n\n```typescript\ninterface HookOutput {\n // If true, the AI plan stops immediately.\n should_halt_plan?: boolean;\n \n // Optional message to log in the UI\n message?: string;\n \n // Optional data to merge back into the plan context\n update_context?: Record<string, any>;\n}\n```\n";
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.content = exports.filename = void 0;
|
|
4
|
+
exports.filename = 'README.md';
|
|
5
|
+
exports.content = `# Repoburg Tool Hooks
|
|
6
|
+
|
|
7
|
+
This directory contains TypeScript scripts that can be attached to AI tool execution events.
|
|
8
|
+
You can configure these hooks in the "Tool Hooks" section of the Repoburg UI.
|
|
9
|
+
|
|
10
|
+
## How it works
|
|
11
|
+
|
|
12
|
+
1. **Create a script** in this folder (e.g., \`audit-patch.ts\`).
|
|
13
|
+
2. **Go to UI**: Open Repoburg -> Tool Hooks -> Add Hook.
|
|
14
|
+
3. **Configure**: Select the tool (e.g., \`patch\`), timing (\`before\` or \`after\`), and your script.
|
|
15
|
+
|
|
16
|
+
## Script Interface
|
|
17
|
+
|
|
18
|
+
Your script must **export a default function** that receives the context.
|
|
19
|
+
|
|
20
|
+
### Input Context
|
|
21
|
+
|
|
22
|
+
\`\`\`typescript
|
|
23
|
+
interface HookContext {
|
|
24
|
+
hook_type: 'before' | 'after';
|
|
25
|
+
|
|
26
|
+
action: {
|
|
27
|
+
tool_name: string; // e.g. "patch"
|
|
28
|
+
args: any; // e.g. { file_path: "src/app.ts", patch_code: "..." }
|
|
29
|
+
|
|
30
|
+
// Only present for 'after' hooks
|
|
31
|
+
result?: {
|
|
32
|
+
status: 'SUCCESS' | 'FAILURE';
|
|
33
|
+
output?: string;
|
|
34
|
+
error?: string;
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
plan_context: any; // Shared state of the current AI plan
|
|
39
|
+
}
|
|
40
|
+
\`\`\`
|
|
41
|
+
|
|
42
|
+
### Output Format
|
|
43
|
+
|
|
44
|
+
Your function should return an object (or void if passive):
|
|
45
|
+
|
|
46
|
+
\`\`\`typescript
|
|
47
|
+
interface HookOutput {
|
|
48
|
+
// If true, the AI plan stops immediately.
|
|
49
|
+
should_halt_plan?: boolean;
|
|
50
|
+
|
|
51
|
+
// Optional message to log in the UI
|
|
52
|
+
message?: string;
|
|
53
|
+
|
|
54
|
+
// Optional data to merge back into the plan context
|
|
55
|
+
update_context?: Record<string, any>;
|
|
56
|
+
}
|
|
57
|
+
\`\`\`
|
|
58
|
+
`;
|
|
59
|
+
//# sourceMappingURL=readme.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"readme.js","sourceRoot":"","sources":["../../../../../src/seeding/data/tool-hooks/readme.ts"],"names":[],"mappings":";;;AAAa,QAAA,QAAQ,GAAG,WAAW,CAAC;AACvB,QAAA,OAAO,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqDtB,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.CreateToolHookDto = void 0;
|
|
13
|
+
const class_validator_1 = require("class-validator");
|
|
14
|
+
class CreateToolHookDto {
|
|
15
|
+
}
|
|
16
|
+
exports.CreateToolHookDto = CreateToolHookDto;
|
|
17
|
+
__decorate([
|
|
18
|
+
(0, class_validator_1.IsString)(),
|
|
19
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
20
|
+
__metadata("design:type", String)
|
|
21
|
+
], CreateToolHookDto.prototype, "tool_name", void 0);
|
|
22
|
+
__decorate([
|
|
23
|
+
(0, class_validator_1.IsString)(),
|
|
24
|
+
(0, class_validator_1.IsIn)(['before', 'after']),
|
|
25
|
+
__metadata("design:type", String)
|
|
26
|
+
], CreateToolHookDto.prototype, "timing", void 0);
|
|
27
|
+
__decorate([
|
|
28
|
+
(0, class_validator_1.IsString)(),
|
|
29
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
30
|
+
__metadata("design:type", String)
|
|
31
|
+
], CreateToolHookDto.prototype, "script_filename", void 0);
|
|
32
|
+
__decorate([
|
|
33
|
+
(0, class_validator_1.IsBoolean)(),
|
|
34
|
+
__metadata("design:type", Boolean)
|
|
35
|
+
], CreateToolHookDto.prototype, "is_active", void 0);
|
|
36
|
+
//# sourceMappingURL=create-tool-hook.dto.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-tool-hook.dto.js","sourceRoot":"","sources":["../../../../src/tool-hooks/dto/create-tool-hook.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAAwE;AAExE,MAAa,iBAAiB;CAe7B;AAfD,8CAeC;AAZC;IAFC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;oDACK;AAIlB;IAFC,IAAA,0BAAQ,GAAE;IACV,IAAA,sBAAI,EAAC,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;;iDACC;AAI3B;IAFC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;0DACW;AAGxB;IADC,IAAA,2BAAS,GAAE;;oDACO"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.UpdateToolHookDto = void 0;
|
|
13
|
+
const class_validator_1 = require("class-validator");
|
|
14
|
+
class UpdateToolHookDto {
|
|
15
|
+
}
|
|
16
|
+
exports.UpdateToolHookDto = UpdateToolHookDto;
|
|
17
|
+
__decorate([
|
|
18
|
+
(0, class_validator_1.IsString)(),
|
|
19
|
+
(0, class_validator_1.IsOptional)(),
|
|
20
|
+
__metadata("design:type", String)
|
|
21
|
+
], UpdateToolHookDto.prototype, "tool_name", void 0);
|
|
22
|
+
__decorate([
|
|
23
|
+
(0, class_validator_1.IsString)(),
|
|
24
|
+
(0, class_validator_1.IsOptional)(),
|
|
25
|
+
(0, class_validator_1.IsIn)(['before', 'after']),
|
|
26
|
+
__metadata("design:type", String)
|
|
27
|
+
], UpdateToolHookDto.prototype, "timing", void 0);
|
|
28
|
+
__decorate([
|
|
29
|
+
(0, class_validator_1.IsString)(),
|
|
30
|
+
(0, class_validator_1.IsOptional)(),
|
|
31
|
+
__metadata("design:type", String)
|
|
32
|
+
], UpdateToolHookDto.prototype, "script_filename", void 0);
|
|
33
|
+
__decorate([
|
|
34
|
+
(0, class_validator_1.IsBoolean)(),
|
|
35
|
+
(0, class_validator_1.IsOptional)(),
|
|
36
|
+
__metadata("design:type", Boolean)
|
|
37
|
+
], UpdateToolHookDto.prototype, "is_active", void 0);
|
|
38
|
+
//# sourceMappingURL=update-tool-hook.dto.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update-tool-hook.dto.js","sourceRoot":"","sources":["../../../../src/tool-hooks/dto/update-tool-hook.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAAwE;AAExE,MAAa,iBAAiB;CAiB7B;AAjBD,8CAiBC;AAdC;IAFC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;oDACM;AAKnB;IAHC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;IACZ,IAAA,sBAAI,EAAC,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;;iDACE;AAI5B;IAFC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;0DACY;AAIzB;IAFC,IAAA,2BAAS,GAAE;IACX,IAAA,4BAAU,GAAE;;oDACO"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { ToolHooksService } from './tool-hooks.service';
|
|
2
|
+
import { CreateToolHookDto } from './dto/create-tool-hook.dto';
|
|
3
|
+
import { UpdateToolHookDto } from './dto/update-tool-hook.dto';
|
|
4
|
+
export declare class ToolHooksController {
|
|
5
|
+
private readonly toolHooksService;
|
|
6
|
+
constructor(toolHooksService: ToolHooksService);
|
|
7
|
+
findAll(): Promise<import("../core-entities").ToolHook[]>;
|
|
8
|
+
listScripts(): Promise<string[]>;
|
|
9
|
+
getTemplate(toolName: string): {
|
|
10
|
+
content: string;
|
|
11
|
+
};
|
|
12
|
+
getSamplePayload(toolName: string, timing: 'before' | 'after'): any;
|
|
13
|
+
testHook(body: {
|
|
14
|
+
script_filename: string;
|
|
15
|
+
payload: any;
|
|
16
|
+
}): Promise<{
|
|
17
|
+
result: any;
|
|
18
|
+
logs: string[];
|
|
19
|
+
}>;
|
|
20
|
+
createScript(body: {
|
|
21
|
+
filename: string;
|
|
22
|
+
content: string;
|
|
23
|
+
}): Promise<void>;
|
|
24
|
+
create(createToolHookDto: CreateToolHookDto): Promise<import("../core-entities").ToolHook>;
|
|
25
|
+
update(id: string, updateToolHookDto: UpdateToolHookDto): Promise<import("../core-entities").ToolHook>;
|
|
26
|
+
remove(id: string): Promise<void>;
|
|
27
|
+
}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.ToolHooksController = void 0;
|
|
16
|
+
const common_1 = require("@nestjs/common");
|
|
17
|
+
const tool_hooks_service_1 = require("./tool-hooks.service");
|
|
18
|
+
const create_tool_hook_dto_1 = require("./dto/create-tool-hook.dto");
|
|
19
|
+
const update_tool_hook_dto_1 = require("./dto/update-tool-hook.dto");
|
|
20
|
+
let ToolHooksController = class ToolHooksController {
|
|
21
|
+
constructor(toolHooksService) {
|
|
22
|
+
this.toolHooksService = toolHooksService;
|
|
23
|
+
}
|
|
24
|
+
findAll() {
|
|
25
|
+
return this.toolHooksService.findAll();
|
|
26
|
+
}
|
|
27
|
+
listScripts() {
|
|
28
|
+
return this.toolHooksService.listScripts();
|
|
29
|
+
}
|
|
30
|
+
getTemplate(toolName) {
|
|
31
|
+
return { content: this.toolHooksService.generateTemplate(toolName) };
|
|
32
|
+
}
|
|
33
|
+
getSamplePayload(toolName, timing) {
|
|
34
|
+
return this.toolHooksService.generateSamplePayload(toolName, timing);
|
|
35
|
+
}
|
|
36
|
+
testHook(body) {
|
|
37
|
+
return this.toolHooksService.testHook(body.script_filename, body.payload);
|
|
38
|
+
}
|
|
39
|
+
createScript(body) {
|
|
40
|
+
return this.toolHooksService.createScript(body.filename, body.content);
|
|
41
|
+
}
|
|
42
|
+
create(createToolHookDto) {
|
|
43
|
+
return this.toolHooksService.create(createToolHookDto);
|
|
44
|
+
}
|
|
45
|
+
update(id, updateToolHookDto) {
|
|
46
|
+
return this.toolHooksService.update(id, updateToolHookDto);
|
|
47
|
+
}
|
|
48
|
+
remove(id) {
|
|
49
|
+
return this.toolHooksService.remove(id);
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
exports.ToolHooksController = ToolHooksController;
|
|
53
|
+
__decorate([
|
|
54
|
+
(0, common_1.Get)(),
|
|
55
|
+
__metadata("design:type", Function),
|
|
56
|
+
__metadata("design:paramtypes", []),
|
|
57
|
+
__metadata("design:returntype", void 0)
|
|
58
|
+
], ToolHooksController.prototype, "findAll", null);
|
|
59
|
+
__decorate([
|
|
60
|
+
(0, common_1.Get)('scripts'),
|
|
61
|
+
__metadata("design:type", Function),
|
|
62
|
+
__metadata("design:paramtypes", []),
|
|
63
|
+
__metadata("design:returntype", void 0)
|
|
64
|
+
], ToolHooksController.prototype, "listScripts", null);
|
|
65
|
+
__decorate([
|
|
66
|
+
(0, common_1.Get)('template/:toolName'),
|
|
67
|
+
__param(0, (0, common_1.Param)('toolName')),
|
|
68
|
+
__metadata("design:type", Function),
|
|
69
|
+
__metadata("design:paramtypes", [String]),
|
|
70
|
+
__metadata("design:returntype", void 0)
|
|
71
|
+
], ToolHooksController.prototype, "getTemplate", null);
|
|
72
|
+
__decorate([
|
|
73
|
+
(0, common_1.Get)('sample-payload'),
|
|
74
|
+
__param(0, (0, common_1.Query)('toolName')),
|
|
75
|
+
__param(1, (0, common_1.Query)('timing')),
|
|
76
|
+
__metadata("design:type", Function),
|
|
77
|
+
__metadata("design:paramtypes", [String, String]),
|
|
78
|
+
__metadata("design:returntype", void 0)
|
|
79
|
+
], ToolHooksController.prototype, "getSamplePayload", null);
|
|
80
|
+
__decorate([
|
|
81
|
+
(0, common_1.Post)('test'),
|
|
82
|
+
(0, common_1.HttpCode)(200),
|
|
83
|
+
__param(0, (0, common_1.Body)()),
|
|
84
|
+
__metadata("design:type", Function),
|
|
85
|
+
__metadata("design:paramtypes", [Object]),
|
|
86
|
+
__metadata("design:returntype", void 0)
|
|
87
|
+
], ToolHooksController.prototype, "testHook", null);
|
|
88
|
+
__decorate([
|
|
89
|
+
(0, common_1.Post)('scripts'),
|
|
90
|
+
(0, common_1.HttpCode)(204),
|
|
91
|
+
__param(0, (0, common_1.Body)()),
|
|
92
|
+
__metadata("design:type", Function),
|
|
93
|
+
__metadata("design:paramtypes", [Object]),
|
|
94
|
+
__metadata("design:returntype", void 0)
|
|
95
|
+
], ToolHooksController.prototype, "createScript", null);
|
|
96
|
+
__decorate([
|
|
97
|
+
(0, common_1.Post)(),
|
|
98
|
+
__param(0, (0, common_1.Body)()),
|
|
99
|
+
__metadata("design:type", Function),
|
|
100
|
+
__metadata("design:paramtypes", [create_tool_hook_dto_1.CreateToolHookDto]),
|
|
101
|
+
__metadata("design:returntype", void 0)
|
|
102
|
+
], ToolHooksController.prototype, "create", null);
|
|
103
|
+
__decorate([
|
|
104
|
+
(0, common_1.Put)(':id'),
|
|
105
|
+
__param(0, (0, common_1.Param)('id')),
|
|
106
|
+
__param(1, (0, common_1.Body)()),
|
|
107
|
+
__metadata("design:type", Function),
|
|
108
|
+
__metadata("design:paramtypes", [String, update_tool_hook_dto_1.UpdateToolHookDto]),
|
|
109
|
+
__metadata("design:returntype", void 0)
|
|
110
|
+
], ToolHooksController.prototype, "update", null);
|
|
111
|
+
__decorate([
|
|
112
|
+
(0, common_1.Delete)(':id'),
|
|
113
|
+
(0, common_1.HttpCode)(204),
|
|
114
|
+
__param(0, (0, common_1.Param)('id')),
|
|
115
|
+
__metadata("design:type", Function),
|
|
116
|
+
__metadata("design:paramtypes", [String]),
|
|
117
|
+
__metadata("design:returntype", void 0)
|
|
118
|
+
], ToolHooksController.prototype, "remove", null);
|
|
119
|
+
exports.ToolHooksController = ToolHooksController = __decorate([
|
|
120
|
+
(0, common_1.Controller)('tool-hooks'),
|
|
121
|
+
__metadata("design:paramtypes", [tool_hooks_service_1.ToolHooksService])
|
|
122
|
+
], ToolHooksController);
|
|
123
|
+
//# sourceMappingURL=tool-hooks.controller.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool-hooks.controller.js","sourceRoot":"","sources":["../../../src/tool-hooks/tool-hooks.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAUwB;AACxB,6DAAwD;AACxD,qEAA+D;AAC/D,qEAA+D;AAGxD,IAAM,mBAAmB,GAAzB,MAAM,mBAAmB;IAC9B,YAA6B,gBAAkC;QAAlC,qBAAgB,GAAhB,gBAAgB,CAAkB;IAAG,CAAC;IAGnE,OAAO;QACL,OAAO,IAAI,CAAC,gBAAgB,CAAC,OAAO,EAAE,CAAC;IACzC,CAAC;IAGD,WAAW;QACT,OAAO,IAAI,CAAC,gBAAgB,CAAC,WAAW,EAAE,CAAC;IAC7C,CAAC;IAGD,WAAW,CAAoB,QAAgB;QAC7C,OAAO,EAAE,OAAO,EAAE,IAAI,CAAC,gBAAgB,CAAC,gBAAgB,CAAC,QAAQ,CAAC,EAAE,CAAC;IACvE,CAAC;IAGD,gBAAgB,CACK,QAAgB,EAClB,MAA0B;QAE3C,OAAO,IAAI,CAAC,gBAAgB,CAAC,qBAAqB,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;IACvE,CAAC;IAID,QAAQ,CAAS,IAA+C;QAC9D,OAAO,IAAI,CAAC,gBAAgB,CAAC,QAAQ,CAAC,IAAI,CAAC,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CAAA;;qCAAoB,wCAAiB;;iDAElD;AAGD;IADC,IAAA,YAAG,EAAC,KAAK,CAAC;IAER,WAAA,IAAA,cAAK,EAAC,IAAI,CAAC,CAAA;IACX,WAAA,IAAA,aAAI,GAAE,CAAA;;6CAAoB,wCAAiB;;iDAG7C;AAID;IAFC,IAAA,eAAM,EAAC,KAAK,CAAC;IACb,IAAA,iBAAQ,EAAC,GAAG,CAAC;IACN,WAAA,IAAA,cAAK,EAAC,IAAI,CAAC,CAAA;;;;iDAElB;8BAvDU,mBAAmB;IAD/B,IAAA,mBAAU,EAAC,YAAY,CAAC;qCAEwB,qCAAgB;GADpD,mBAAmB,CAwD/B"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.ToolHooksModule = void 0;
|
|
10
|
+
const common_1 = require("@nestjs/common");
|
|
11
|
+
const typeorm_1 = require("@nestjs/typeorm");
|
|
12
|
+
const core_entities_1 = require("../core-entities");
|
|
13
|
+
const tool_hooks_controller_1 = require("./tool-hooks.controller");
|
|
14
|
+
const tool_hooks_service_1 = require("./tool-hooks.service");
|
|
15
|
+
const execution_logs_module_1 = require("../execution-logs/execution-logs.module");
|
|
16
|
+
let ToolHooksModule = class ToolHooksModule {
|
|
17
|
+
};
|
|
18
|
+
exports.ToolHooksModule = ToolHooksModule;
|
|
19
|
+
exports.ToolHooksModule = ToolHooksModule = __decorate([
|
|
20
|
+
(0, common_1.Module)({
|
|
21
|
+
imports: [typeorm_1.TypeOrmModule.forFeature([core_entities_1.ToolHook]), execution_logs_module_1.ExecutionLogsModule],
|
|
22
|
+
controllers: [tool_hooks_controller_1.ToolHooksController],
|
|
23
|
+
providers: [tool_hooks_service_1.ToolHooksService],
|
|
24
|
+
exports: [tool_hooks_service_1.ToolHooksService],
|
|
25
|
+
})
|
|
26
|
+
], ToolHooksModule);
|
|
27
|
+
//# sourceMappingURL=tool-hooks.module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool-hooks.module.js","sourceRoot":"","sources":["../../../src/tool-hooks/tool-hooks.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,6CAAgD;AAChD,oDAA4C;AAC5C,mEAA8D;AAC9D,6DAAwD;AACxD,mFAA8E;AAQvE,IAAM,eAAe,GAArB,MAAM,eAAe;CAAG,CAAA;AAAlB,0CAAe;0BAAf,eAAe;IAN3B,IAAA,eAAM,EAAC;QACN,OAAO,EAAE,CAAC,uBAAa,CAAC,UAAU,CAAC,CAAC,wBAAQ,CAAC,CAAC,EAAE,2CAAmB,CAAC;QACpE,WAAW,EAAE,CAAC,2CAAmB,CAAC;QAClC,SAAS,EAAE,CAAC,qCAAgB,CAAC;QAC7B,OAAO,EAAE,CAAC,qCAAgB,CAAC;KAC5B,CAAC;GACW,eAAe,CAAG"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { Repository } from 'typeorm';
|
|
2
|
+
import { ToolHook } from '../core-entities';
|
|
3
|
+
import { CreateToolHookDto } from './dto/create-tool-hook.dto';
|
|
4
|
+
import { UpdateToolHookDto } from './dto/update-tool-hook.dto';
|
|
5
|
+
export declare class ToolHooksService {
|
|
6
|
+
private readonly toolHooksRepository;
|
|
7
|
+
private readonly logger;
|
|
8
|
+
private readonly projectRoot;
|
|
9
|
+
private readonly hooksDir;
|
|
10
|
+
constructor(toolHooksRepository: Repository<ToolHook>);
|
|
11
|
+
private ensureHooksDir;
|
|
12
|
+
private createExampleFiles;
|
|
13
|
+
findAll(): Promise<ToolHook[]>;
|
|
14
|
+
create(dto: CreateToolHookDto): Promise<ToolHook>;
|
|
15
|
+
update(id: string, dto: UpdateToolHookDto): Promise<ToolHook>;
|
|
16
|
+
remove(id: string): Promise<void>;
|
|
17
|
+
findByTrigger(toolName: string, timing: 'before' | 'after'): Promise<ToolHook[]>;
|
|
18
|
+
listScripts(): Promise<string[]>;
|
|
19
|
+
createScript(filename: string, content: string): Promise<void>;
|
|
20
|
+
generateTemplate(toolName: string): string;
|
|
21
|
+
private pascalCase;
|
|
22
|
+
private getArgsInterface;
|
|
23
|
+
generateSamplePayload(toolName: string, timing: 'before' | 'after'): any;
|
|
24
|
+
private getSampleArgs;
|
|
25
|
+
executeHook(scriptFilename: string, payload: any): Promise<any>;
|
|
26
|
+
testHook(scriptFilename: string, payload: any): Promise<{
|
|
27
|
+
result: any;
|
|
28
|
+
logs: string[];
|
|
29
|
+
}>;
|
|
30
|
+
private runScript;
|
|
31
|
+
}
|