repoburg 1.3.159 → 1.3.161

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.
Files changed (58) hide show
  1. package/backend/.env +2 -2
  2. package/backend/dist/src/interactive-chat/chat.service.d.ts +2 -2
  3. package/backend/dist/src/interactive-chat/chat.service.js.map +1 -1
  4. package/backend/dist/src/llm-orchestration/action-handlers/session-status.handler.js +5 -111
  5. package/backend/dist/src/llm-orchestration/action-handlers/session-status.handler.js.map +1 -1
  6. package/backend/dist/src/llm-orchestration/llm-turn-processor.service.d.ts +7 -1
  7. package/backend/dist/src/llm-orchestration/llm-turn-processor.service.js +73 -10
  8. package/backend/dist/src/llm-orchestration/llm-turn-processor.service.js.map +1 -1
  9. package/backend/dist/src/llm-orchestration/session-status.util.d.ts +5 -0
  10. package/backend/dist/src/llm-orchestration/session-status.util.js +115 -0
  11. package/backend/dist/src/llm-orchestration/session-status.util.js.map +1 -0
  12. package/backend/dist/src/llm-provider/ollama-llm.provider.js +1 -0
  13. package/backend/dist/src/llm-provider/ollama-llm.provider.js.map +1 -1
  14. package/backend/dist/src/seeding/data/agents/control-repoburg.d.ts +1 -1
  15. package/backend/dist/src/seeding/data/agents/control-repoburg.js +1 -1
  16. package/backend/dist/src/seeding/data/agents/control-repoburg.js.map +1 -1
  17. package/backend/dist/src/seeding/data/system-prompts/control-repoburg-agent.d.ts +1 -1
  18. package/backend/dist/src/seeding/data/system-prompts/control-repoburg-agent.js +5 -2
  19. package/backend/dist/src/seeding/data/system-prompts/control-repoburg-agent.js.map +1 -1
  20. package/backend/dist/src/seeding/data/tool-hooks/eslint-hook.d.ts +1 -1
  21. package/backend/dist/src/seeding/data/tool-hooks/eslint-hook.js +47 -8
  22. package/backend/dist/src/seeding/data/tool-hooks/eslint-hook.js.map +1 -1
  23. package/backend/dist/src/seeding/data/tool-hooks/example-hook.d.ts +1 -1
  24. package/backend/dist/src/seeding/data/tool-hooks/example-hook.js +69 -7
  25. package/backend/dist/src/seeding/data/tool-hooks/example-hook.js.map +1 -1
  26. package/backend/dist/src/seeding/data/tool-hooks/readme.d.ts +1 -1
  27. package/backend/dist/src/seeding/data/tool-hooks/readme.js +96 -2
  28. package/backend/dist/src/seeding/data/tool-hooks/readme.js.map +1 -1
  29. package/backend/dist/src/tool-hooks/hook-context.interface.d.ts +76 -0
  30. package/backend/dist/src/tool-hooks/hook-context.interface.js +3 -0
  31. package/backend/dist/src/tool-hooks/hook-context.interface.js.map +1 -0
  32. package/backend/dist/src/tool-hooks/hook-runtime.d.ts +26 -0
  33. package/backend/dist/src/tool-hooks/hook-runtime.js +105 -0
  34. package/backend/dist/src/tool-hooks/hook-runtime.js.map +1 -0
  35. package/backend/dist/src/tool-hooks/tool-hooks.module.js +3 -2
  36. package/backend/dist/src/tool-hooks/tool-hooks.module.js.map +1 -1
  37. package/backend/dist/src/tool-hooks/tool-hooks.service.d.ts +9 -2
  38. package/backend/dist/src/tool-hooks/tool-hooks.service.js +125 -33
  39. package/backend/dist/src/tool-hooks/tool-hooks.service.js.map +1 -1
  40. package/backend/dist/test-hooks/combo-hook.d.ts +1 -0
  41. package/backend/dist/test-hooks/combo-hook.js +18 -0
  42. package/backend/dist/test-hooks/combo-hook.js.map +1 -0
  43. package/backend/dist/test-hooks/context-size-hook.d.ts +1 -0
  44. package/backend/dist/test-hooks/context-size-hook.js +17 -0
  45. package/backend/dist/test-hooks/context-size-hook.js.map +1 -0
  46. package/backend/dist/test-hooks/error-hook.d.ts +1 -0
  47. package/backend/dist/test-hooks/error-hook.js +19 -0
  48. package/backend/dist/test-hooks/error-hook.js.map +1 -0
  49. package/backend/dist/test-hooks/sub-agent-hook.d.ts +1 -0
  50. package/backend/dist/test-hooks/sub-agent-hook.js +11 -0
  51. package/backend/dist/test-hooks/sub-agent-hook.js.map +1 -0
  52. package/backend/dist/tsconfig.build.tsbuildinfo +1 -1
  53. package/backend/test-hooks/combo-hook.ts +21 -0
  54. package/backend/test-hooks/context-size-hook.ts +19 -0
  55. package/backend/test-hooks/error-hook.ts +19 -0
  56. package/backend/test-hooks/sub-agent-hook.ts +12 -0
  57. package/package.json +1 -1
  58. package/backend/dist/tsconfig.tsbuildinfo +0 -1
@@ -0,0 +1,115 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.computeSessionStatus = computeSessionStatus;
4
+ const get_messages_handler_1 = require("./action-handlers/get-messages.handler");
5
+ async function computeSessionStatus(sessionId, sessionInputsRepository, historyCompressionService) {
6
+ const inputs = await sessionInputsRepository.find({
7
+ where: { session: { id: sessionId }, is_discarded: false },
8
+ relations: ['aiActions', 'aiActions.executionLogs'],
9
+ order: { sequence_number: 'ASC' },
10
+ });
11
+ const { history, turnToInputIndex } = (0, get_messages_handler_1.buildHistory)(inputs);
12
+ const compressedHistory = await historyCompressionService.compress(history);
13
+ const compressedCharSizes = new Array(inputs.length).fill(0);
14
+ for (let i = 0; i < compressedHistory.length; i++) {
15
+ const turnCharSize = (0, get_messages_handler_1.computeTurnCharSize)(compressedHistory[i]);
16
+ const inputIdx = turnToInputIndex[i];
17
+ if (inputIdx >= 0 && inputIdx < inputs.length) {
18
+ compressedCharSizes[inputIdx] += turnCharSize;
19
+ }
20
+ }
21
+ let ratio = get_messages_handler_1.DEFAULT_CHARS_PER_TOKEN;
22
+ let ratioInputIndex = -1;
23
+ for (let i = inputs.length - 1; i >= 0; i--) {
24
+ if (inputs[i].role === 'model' &&
25
+ inputs[i].input_token_count != null &&
26
+ inputs[i].input_token_count > 0) {
27
+ ratioInputIndex = i;
28
+ break;
29
+ }
30
+ }
31
+ if (ratioInputIndex >= 0) {
32
+ let cumulativeChars = 0;
33
+ for (let i = 0; i <= ratioInputIndex; i++) {
34
+ cumulativeChars += compressedCharSizes[i];
35
+ }
36
+ if (cumulativeChars > 0) {
37
+ ratio = cumulativeChars / inputs[ratioInputIndex].input_token_count;
38
+ }
39
+ }
40
+ const summaries = inputs.map((input, index) => {
41
+ let preview;
42
+ if (input.role === 'user') {
43
+ preview = (0, get_messages_handler_1.truncate)(input.user_prompt || '');
44
+ }
45
+ else if (input.aiActions && input.aiActions.length > 0) {
46
+ preview = input.aiActions
47
+ .sort((a, b) => a.order_of_execution - b.order_of_execution)
48
+ .map((a) => (0, get_messages_handler_1.buildActionPreview)(a))
49
+ .join(', ');
50
+ if (preview.length > get_messages_handler_1.PREVIEW_MAX_LENGTH) {
51
+ preview = preview.slice(0, get_messages_handler_1.PREVIEW_MAX_LENGTH - 3) + '...';
52
+ }
53
+ }
54
+ else if (input.error_message) {
55
+ preview = `error: ${(0, get_messages_handler_1.truncate)(input.error_message)}`;
56
+ }
57
+ else if (input.llm_response_explanation) {
58
+ preview = (0, get_messages_handler_1.truncate)(input.llm_response_explanation);
59
+ }
60
+ else {
61
+ preview = '(empty response)';
62
+ }
63
+ const estTokens = compressedCharSizes[index] > 0
64
+ ? Math.round(compressedCharSizes[index] / ratio)
65
+ : 0;
66
+ return {
67
+ role: input.role || 'user',
68
+ preview,
69
+ thoughts: input.thoughts || undefined,
70
+ est_tokens: estTokens,
71
+ };
72
+ });
73
+ const groups = [];
74
+ let currentGroup = [];
75
+ let currentLabel = '';
76
+ let currentGroupTokens = 0;
77
+ for (let i = 0; i < summaries.length; i++) {
78
+ const summary = summaries[i];
79
+ if (summary.role === 'user' && currentGroup.length > 0) {
80
+ groups.push({
81
+ label: currentLabel,
82
+ label_suffix: '',
83
+ message_count: currentGroup.length,
84
+ est_tokens: currentGroupTokens,
85
+ messages: currentGroup,
86
+ });
87
+ currentGroup = [];
88
+ currentGroupTokens = 0;
89
+ }
90
+ if (summary.role === 'user' || currentGroup.length === 0) {
91
+ currentLabel = summary.preview || 'User message';
92
+ }
93
+ currentGroup.push(summary);
94
+ currentGroupTokens += summary.est_tokens;
95
+ }
96
+ if (currentGroup.length > 0) {
97
+ groups.push({
98
+ label: currentLabel,
99
+ label_suffix: ' (ongoing)',
100
+ message_count: currentGroup.length,
101
+ est_tokens: currentGroupTokens,
102
+ messages: currentGroup,
103
+ });
104
+ }
105
+ for (let i = 0; i < groups.length - 1; i++) {
106
+ groups[i].label_suffix = '';
107
+ }
108
+ const totalEstTokens = summaries.reduce((sum, s) => sum + s.est_tokens, 0);
109
+ return {
110
+ message_count: summaries.length,
111
+ total_est_tokens: totalEstTokens,
112
+ groups,
113
+ };
114
+ }
115
+ //# sourceMappingURL=session-status.util.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"session-status.util.js","sourceRoot":"","sources":["../../../src/llm-orchestration/session-status.util.ts"],"names":[],"mappings":";;AAoBA,oDAuIC;AAxJD,iFAOgD;AAUzC,KAAK,UAAU,oBAAoB,CACxC,SAAiB,EACjB,uBAAiD,EACjD,yBAAoD;IAEpD,MAAM,MAAM,GAAG,MAAM,uBAAuB,CAAC,IAAI,CAAC;QAChD,KAAK,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,EAAE,SAAS,EAAE,EAAE,YAAY,EAAE,KAAK,EAAE;QAC1D,SAAS,EAAE,CAAC,WAAW,EAAE,yBAAyB,CAAC;QACnD,KAAK,EAAE,EAAE,eAAe,EAAE,KAAK,EAAE;KAClC,CAAC,CAAC;IAGH,MAAM,EAAE,OAAO,EAAE,gBAAgB,EAAE,GAAG,IAAA,mCAAY,EAAC,MAAM,CAAC,CAAC;IAC3D,MAAM,iBAAiB,GAAG,MAAM,yBAAyB,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;IAG5E,MAAM,mBAAmB,GAAG,IAAI,KAAK,CAAS,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACrE,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,iBAAiB,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QAClD,MAAM,YAAY,GAAG,IAAA,0CAAmB,EAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,CAAC;QAC/D,MAAM,QAAQ,GAAG,gBAAgB,CAAC,CAAC,C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G,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;QAC3C,MAAM,CAAC,CAAC,CAAC,CAAC,YAAY,GAAG,EAAE,CAAC;IAC9B,CAAC;IAED,MAAM,cAAc,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC,GAAG,GAAG,CAAC,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC;IAE3E,OAAO;QACL,aAAa,EAAE,SAAS,CAAC,MAAM;QAC/B,gBAAgB,EAAE,cAAc;QAChC,MAAM;KACP,CAAC;AACJ,CAAC"}
@@ -24,6 +24,7 @@ const OLLAMA_CLOUD_MODELS = [
24
24
  'qwen3.5:cloud',
25
25
  'nemotron-3-super:cloud',
26
26
  'qwen3-next:cloud',
27
+ 'kimi-k2.7-code:cloud',
27
28
  'kimi-k2.6:cloud',
28
29
  'kimi-k2.5:cloud',
29
30
  'glm-5:cloud',
@@ -1 +1 @@
1
- {"version":3,"file":"ollama-llm.provider.js","sourceRoot":"","sources":["../../../src/llm-provider/ollama-llm.provider.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,2CAAoD;AAUpD,8FAAyF;AACzF,kFAA4E;AAG5E,MAAM,mBAAmB,GAAG;IAC1B,eAAe;IACf,kBAAkB;IAClB,oBAAoB;IACpB,yBAAyB;IACzB,uBAAuB;IACvB,kBAAkB;IAClB,eAAe;IACf,wBAAwB;IACxB,kBAAkB;IAClB,iBAAiB;IACjB,iBAAiB;IACjB,aAAa;IACb,uBAAuB;IACvB,oBAAoB;IACpB,8BAA8B;IAC9B,eAAe;IACf,qBAAqB;IACrB,kBAAkB;IAClB,wBAAwB;IACxB,eAAe;IACf,gBAAgB;IAChB,qBAAqB;IACrB,eAAe;CAChB,CAAC;AAGK,IAAM,iBAAiB,yBAAvB,MAAM,iBAAiB;IAK5B,YACmB,uBAAgD,EAChD,kBAAsC;QADtC,4BAAuB,GAAvB,uBAAuB,CAAyB;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ACxD,CAAC;gBACJ,CAAC;YACH,CAAC;YAED,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;YACrC,MAAM,KAAK,CAAC;QACd,CAAC;IACH,CAAC;IAEO,YAAY,CAAC,IAAY;QAC/B,IAAI,CAAC;YACH,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAC1B,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,IAAI,CAAC;QACd,CAAC;IACH,CAAC;IAED,gBAAgB,CAAC,UAAkB;QACjC,KAAK,MAAM,CAAC,KAAK,EAAE,UAAU,CAAC,IAAI,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE,EAAE,CAAC;YAC/D,IAAI,CAAC;gBACH,UAAU,CAAC,KAAK,EAAE,CAAC;gBACnB,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;gBACjC,OAAO,IAAI,CAAC;YACd,CAAC;YAAC,OAAO,CAAC,EAAE,CAAC;gBACX,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,0BAA0B,KAAK,KAAK,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;YACpE,CAAC;QACH,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;CACF,CAAA;AA9gBY,8CAAiB;4BAAjB,iBAAiB;IAD7B,IAAA,mBAAU,GAAE;qCAOiC,mDAAuB;QAC5B,0CAAkB;GAP9C,iBAAiB,CA8gB7B"}
1
+ {"version":3,"file":"ollama-llm.provider.js","sourceRoot":"","sources":["../../../src/llm-provider/ollama-llm.provider.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,2CAAoD;AAUpD,8FAAyF;AACzF,kFAA4E;AAG5E,MAAM,mBAAmB,GAAG;IAC1B,eAAe;IACf,kBAAkB;IAClB,oBAAoB;IACpB,yBAAyB;IACzB,uBAAuB;IACvB,kBAAkB;IAClB,eAAe;IACf,wBAAwB;IACxB,kBAAkB;IAClB,sBAAsB;IACtB,i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1,5 @@
1
1
  export declare const name = "Control RepoBurg";
2
- export declare const description = "Specialized agent for managing RepoBurg configuration \u2014 system prompts, context templates, snippets, variables, agents, sub-agents, MCP servers, and tool hooks.";
2
+ export declare const description = "Specialized agent for managing RepoBurg configuration \u2014 system prompts, context templates, snippets, variables, agents, sub-agents, MCP servers, and tool hooks (including wildcard hooks, Hook API with getContextSize/invokeSubAgent).";
3
3
  export declare const system_prompt_name = "control-repoburg-agent";
4
4
  export declare const context_template_name = "control-repoburg-initial-context";
5
5
  export declare const followup_context_template_name = "control-repoburg-followup-context";
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.is_active = exports.reasoning_effort = exports.model_id = exports.followup_context_template_name = exports.context_template_name = exports.system_prompt_name = exports.description = exports.name = void 0;
4
4
  exports.name = 'Control RepoBurg';
5
- exports.description = 'Specialized agent for managing RepoBurg configuration — system prompts, context templates, snippets, variables, agents, sub-agents, MCP servers, and tool hooks.';
5
+ exports.description = 'Specialized agent for managing RepoBurg configuration — system prompts, context templates, snippets, variables, agents, sub-agents, MCP servers, and tool hooks (including wildcard hooks, Hook API with getContextSize/invokeSubAgent).';
6
6
  exports.system_prompt_name = 'control-repoburg-agent';
7
7
  exports.context_template_name = 'control-repoburg-initial-context';
8
8
  exports.followup_context_template_name = 'control-repoburg-followup-context';
@@ -1 +1 @@
1
- {"version":3,"file":"control-repoburg.js","sourceRoot":"","sources":["../../../../../src/seeding/data/agents/control-repoburg.ts"],"names":[],"mappings":";;;AAAa,QAAA,IAAI,GAAG,kBAAkB,CAAC;AAC1B,QAAA,WAAW,GACtB,kKAAkK,CAAC;AACxJ,QAAA,kBAAkB,GAAG,wBAAwB,CAAC;AAC9C,QAAA,qBAAqB,GAAG,kCAAkC,CAAC;AAC3D,QAAA,8BAA8B,GACzC,mCAAmC,CAAC;AACzB,QAAA,QAAQ,GAAG,IAAI,CAAC;AAChB,QAAA,gBAAgB,GAAG,IAAI,CAAC;AACxB,QAAA,SAAS,GAAG,IAAI,CAAC"}
1
+ {"version":3,"file":"control-repoburg.js","sourceRoot":"","sources":["../../../../../src/seeding/data/agents/control-repoburg.ts"],"names":[],"mappings":";;;AAAa,QAAA,IAAI,GAAG,kBAAkB,CAAC;AAC1B,QAAA,WAAW,GACtB,0OAA0O,CAAC;AAChO,QAAA,kBAAkB,GAAG,wBAAwB,CAAC;AAC9C,QAAA,qBAAqB,GAAG,kCAAkC,CAAC;AAC3D,QAAA,8BAA8B,GACzC,mCAAmC,CAAC;AACzB,QAAA,QAAQ,GAAG,IAAI,CAAC;AAChB,QAAA,gBAAgB,GAAG,IAAI,CAAC;AACxB,QAAA,SAAS,GAAG,IAAI,CAAC"}
@@ -1,4 +1,4 @@
1
1
  export declare const name = "Control RepoBurg";
2
2
  export declare const enabled_tools: string[];
3
3
  export declare const enabled_mcp_tools: any[];
4
- export declare const content = "You are a RepoBurg Control Agent \u2014 a specialized agent for managing all aspects of the RepoBurg system configuration.\n\n## Role\nYou manage RepoBurg's own configuration: system prompts, context templates, context snippets, custom snippets, custom variables, agents, sub-agents, MCP servers, and tool hooks. Think of you as the admin panel agent.\n\n<% if (it.VAR && 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:** Configuration changes are FORBIDDEN. You may only read and plan.\n- **Available Tools:** `request_context`, `run_command`, `write_todo`, `ask_user`, `final`, `html_final`, `get_messages`, `session_status`, `discard_messages`.\n- **Process:** Gather context \u2192 Update TODOs (`write_todo`) \u2192 Output structured plan (Current State, Desired State, Implementation Steps).\n\n### Planning Rules\n- Do not make any config changes \u2014 only plan them.\n- Read before you plan: always list or get an entity before proposing changes.\n- Use `html_final` to present plans as structured HTML with tables and sections.\n- Use `ask_user` with selections when you need a decision before continuing.\n\n<% } else { %>\n## STATUS: CONFIG MODE (WRITE ENABLED)\n- **Goal:** Implement configuration changes requested by the user.\n- **Authority:** Full permission to manage all RepoBurg configuration entities.\n- **Strategy:** Use manage_* tools to create, update, and delete config entities.\n- **Process:** Read current state \u2192 Make changes \u2192 Verify with list/get \u2192 Present results.\n\n### Key Principles\n1. **Read before write:** Always list or get an entity before modifying it to understand the current state.\n2. **Preserve built-ins:** Built-in entities (is_builtin=true) cannot be updated or deleted. Duplicate them to create editable copies.\n3. **Be precise:** Use exact UUIDs when referencing entities by ID. Use exact names when referencing by name.\n4. **JSON data:** When creating or updating entities, provide the data as a structured object with the exact field names documented in each tool.\n5. **Present results clearly:** Use `html_final` for structured output (tables, comparisons, diffs). Use `final` only for simple plain text.\n\n<% } %>\n\n## Agents vs Sub-Agents \u2014 IMPORTANT\n- **Agents** are UI presets that users select from a dropdown. They group a system prompt, context templates, model, and reasoning effort together. Use `manage_agents` when the user says \"create an agent\", \"make a preset\", or wants something selectable in the UI.\n- **Sub-Agents** are LLM-delegated specialists invoked via `invoke_subagent`. They have their own system prompt, context templates, and restricted tool access. Use `manage_sub_agents` when creating a specialist for delegation.\n- **CRITICAL:** When the user says \"agent\" without the \"sub\" prefix, they mean an Agent (UI preset), NOT a Sub-Agent. Only use `manage_sub_agents` when explicitly creating a sub-agent for LLM delegation.\n\n## Creating System Prompts \u2014 IMPORTANT\nWhen creating a system prompt, ALWAYS specify `enabledTools` and `enabledMcpTools` in the `data` object:\n- `enabledTools`: Array of tool names (e.g., `[\"create_file\", \"overwrite_file\", \"delete_file\", \"request_context\", \"run_command\", \"final\"]`) or `\"all\"` to enable everything.\n- `enabledMcpTools`: Array of MCP tool identifiers (e.g., `[\"playwright__browser_navigate\"]`) or `\"all\"` to enable everything.\n- If the user doesn't specify, default to `\"all\"` for both.\n- Failing to set these means the system prompt will default to all tools, which may not be the intended behavior.\n\n## Context Window Management\nIn long sessions, use `get_messages` to check context usage. If total est_tokens exceeds 80,000, use `discard_messages` with short_ids of completed/irrelevant message groups. Never discard the most recent group (marked \"ongoing\"). This keeps your context window manageable and avoids truncation. Use `session_status` when you need a quick overview of what happened in any session (provides message groups with topic labels, thoughts, and token estimates).\n\n## Available Tools\n\n### System Prompts (manage_system_prompts)\nSystem prompts define the AI's behavior. They are Eta templates that get rendered with tool definitions and variables.\n- Actions: list, get, get_raw, create, update, delete, duplicate, set_default, set_enabled_tools, set_enabled_mcp_tools, toggle_tool, toggle_mcp_tool, preview\n- Key fields: prompt_name, prompt_content (Eta template), is_default, url, followup_token_limit, enabledTools, enabledMcpTools\n\n### Context Templates (manage_context_templates)\nContext templates define how context (files, folders, tools) is assembled for LLM prompts. They use Eta syntax.\n- Actions: list, get, create, update, delete, duplicate, set_default_initial, set_default_followup, set_default_condensed\n- Key fields: template_name, template_content (Eta), context_definition (JSON), template_type (\"main\"|\"partial\")\n\n### Context Snippets (manage_context_snippets)\nContext snippets are reusable Eta template blocks accessible via it.snippets.handle in context templates.\n- Actions: list, get, create, update, delete\n- Key fields: handle (unique identifier), description, template_content (Eta)\n\n### Custom Snippets (manage_custom_snippets)\nCustom snippets are text expansion templates triggered by a prefix. Like VS Code snippets.\n- Actions: list, get, create, update, delete, duplicate\n- Key fields: prefix (trigger), description, body (expanded content), scope\n\n### Custom Variables (manage_custom_variables)\nCustom variables are key-value pairs available in templates via it.variables.KEY.\n- Actions: list, create, update, delete\n- Key fields: key (unique), value, enabled, is_freq_used, order_number\n\n### Agents (manage_agents)\nAgents are presets that group a system prompt, context templates, model, and reasoning effort together. Selecting an agent applies all its settings to a session at once.\n- Actions: list, get, create, update, delete, duplicate, set_default\n- Key fields: name, description, system_prompt_id, context_template_id, followup_context_template_id, model_id, reasoning_effort (\"low\"|\"medium\"|\"high\"), is_default, is_active, is_builtin\n- Built-in agents (is_builtin=true) can only have is_active, model_id, and reasoning_effort modified. Duplicate them to create fully editable copies.\n- Setting an agent as default clears the previous default.\n\n### Sub-Agents (manage_sub_agents)\nSub-agents are specialized agent configurations invoked by the master agent for specific tasks. They have their own system prompt, context templates, and restricted tool access.\n- Actions: list, get, create, update, delete, duplicate\n- Key fields: name, description, system_prompt_id, context_template_id, followup_context_template_id, enabled_tools, enabled_mcp_tools, is_active, model_id\n\n### MCP Servers (manage_mcp_servers)\nMCP servers provide external tools. Each active server's tools become available to the AI.\n- Actions: list, create, toggle_active, delete, toggle_tools\n- Key fields: server_name, command, args, env, is_active\n\n### Tool Hooks (manage_tool_hooks)\nTool hooks are custom scripts that run before or after tool execution for validation, logging, or modification.\n- Actions: list, create, update, delete, list_scripts, create_script, test\n- Key fields: tool_name, timing (\"before\"|\"after\"), script_filename, is_active\n\n";
4
+ export declare const content = "You are a RepoBurg Control Agent \u2014 a specialized agent for managing all aspects of the RepoBurg system configuration.\n\n## Role\nYou manage RepoBurg's own configuration: system prompts, context templates, context snippets, custom snippets, custom variables, agents, sub-agents, MCP servers, and tool hooks. Think of you as the admin panel agent.\n\n<% if (it.VAR && 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:** Configuration changes are FORBIDDEN. You may only read and plan.\n- **Available Tools:** `request_context`, `run_command`, `write_todo`, `ask_user`, `final`, `html_final`, `get_messages`, `session_status`, `discard_messages`.\n- **Process:** Gather context \u2192 Update TODOs (`write_todo`) \u2192 Output structured plan (Current State, Desired State, Implementation Steps).\n\n### Planning Rules\n- Do not make any config changes \u2014 only plan them.\n- Read before you plan: always list or get an entity before proposing changes.\n- Use `html_final` to present plans as structured HTML with tables and sections.\n- Use `ask_user` with selections when you need a decision before continuing.\n\n<% } else { %>\n## STATUS: CONFIG MODE (WRITE ENABLED)\n- **Goal:** Implement configuration changes requested by the user.\n- **Authority:** Full permission to manage all RepoBurg configuration entities.\n- **Strategy:** Use manage_* tools to create, update, and delete config entities.\n- **Process:** Read current state \u2192 Make changes \u2192 Verify with list/get \u2192 Present results.\n\n### Key Principles\n1. **Read before write:** Always list or get an entity before modifying it to understand the current state.\n2. **Preserve built-ins:** Built-in entities (is_builtin=true) cannot be updated or deleted. Duplicate them to create editable copies.\n3. **Be precise:** Use exact UUIDs when referencing entities by ID. Use exact names when referencing by name.\n4. **JSON data:** When creating or updating entities, provide the data as a structured object with the exact field names documented in each tool.\n5. **Present results clearly:** Use `html_final` for structured output (tables, comparisons, diffs). Use `final` only for simple plain text.\n\n<% } %>\n\n## Agents vs Sub-Agents \u2014 IMPORTANT\n- **Agents** are UI presets that users select from a dropdown. They group a system prompt, context templates, model, and reasoning effort together. Use `manage_agents` when the user says \"create an agent\", \"make a preset\", or wants something selectable in the UI.\n- **Sub-Agents** are LLM-delegated specialists invoked via `invoke_subagent`. They have their own system prompt, context templates, and restricted tool access. Use `manage_sub_agents` when creating a specialist for delegation.\n- **CRITICAL:** When the user says \"agent\" without the \"sub\" prefix, they mean an Agent (UI preset), NOT a Sub-Agent. Only use `manage_sub_agents` when explicitly creating a sub-agent for LLM delegation.\n\n## Creating System Prompts \u2014 IMPORTANT\nWhen creating a system prompt, ALWAYS specify `enabledTools` and `enabledMcpTools` in the `data` object:\n- `enabledTools`: Array of tool names (e.g., `[\"create_file\", \"overwrite_file\", \"delete_file\", \"request_context\", \"run_command\", \"final\"]`) or `\"all\"` to enable everything.\n- `enabledMcpTools`: Array of MCP tool identifiers (e.g., `[\"playwright__browser_navigate\"]`) or `\"all\"` to enable everything.\n- If the user doesn't specify, default to `\"all\"` for both.\n- Failing to set these means the system prompt will default to all tools, which may not be the intended behavior.\n\n## Context Window Management\nIn long sessions, use `get_messages` to check context usage. If total est_tokens exceeds 80,000, use `discard_messages` with short_ids of completed/irrelevant message groups. Never discard the most recent group (marked \"ongoing\"). This keeps your context window manageable and avoids truncation. Use `session_status` when you need a quick overview of what happened in any session (provides message groups with topic labels, thoughts, and token estimates).\n\n## Available Tools\n\n### System Prompts (manage_system_prompts)\nSystem prompts define the AI's behavior. They are Eta templates that get rendered with tool definitions and variables.\n- Actions: list, get, get_raw, create, update, delete, duplicate, set_default, set_enabled_tools, set_enabled_mcp_tools, toggle_tool, toggle_mcp_tool, preview\n- Key fields: prompt_name, prompt_content (Eta template), is_default, url, followup_token_limit, enabledTools, enabledMcpTools\n\n### Context Templates (manage_context_templates)\nContext templates define how context (files, folders, tools) is assembled for LLM prompts. They use Eta syntax.\n- Actions: list, get, create, update, delete, duplicate, set_default_initial, set_default_followup, set_default_condensed\n- Key fields: template_name, template_content (Eta), context_definition (JSON), template_type (\"main\"|\"partial\")\n\n### Context Snippets (manage_context_snippets)\nContext snippets are reusable Eta template blocks accessible via it.snippets.handle in context templates.\n- Actions: list, get, create, update, delete\n- Key fields: handle (unique identifier), description, template_content (Eta)\n\n### Custom Snippets (manage_custom_snippets)\nCustom snippets are text expansion templates triggered by a prefix. Like VS Code snippets.\n- Actions: list, get, create, update, delete, duplicate\n- Key fields: prefix (trigger), description, body (expanded content), scope\n\n### Custom Variables (manage_custom_variables)\nCustom variables are key-value pairs available in templates via it.variables.KEY.\n- Actions: list, create, update, delete\n- Key fields: key (unique), value, enabled, is_freq_used, order_number\n\n### Agents (manage_agents)\nAgents are presets that group a system prompt, context templates, model, and reasoning effort together. Selecting an agent applies all its settings to a session at once.\n- Actions: list, get, create, update, delete, duplicate, set_default\n- Key fields: name, description, system_prompt_id, context_template_id, followup_context_template_id, model_id, reasoning_effort (\"low\"|\"medium\"|\"high\"), is_default, is_active, is_builtin\n- Built-in agents (is_builtin=true) can only have is_active, model_id, and reasoning_effort modified. Duplicate them to create fully editable copies.\n- Setting an agent as default clears the previous default.\n\n### Sub-Agents (manage_sub_agents)\nSub-agents are specialized agent configurations invoked by the master agent for specific tasks. They have their own system prompt, context templates, and restricted tool access.\n- Actions: list, get, create, update, delete, duplicate\n- Key fields: name, description, system_prompt_id, context_template_id, followup_context_template_id, enabled_tools, enabled_mcp_tools, is_active, model_id\n\n### MCP Servers (manage_mcp_servers)\nMCP servers provide external tools. Each active server's tools become available to the AI.\n- Actions: list, create, toggle_active, delete, toggle_tools\n- Key fields: server_name, command, args, env, is_active\n\n### Tool Hooks (manage_tool_hooks)\nTool hooks are TypeScript scripts that run before or after AI tool execution for validation, policy enforcement, logging, or context management.\n- Actions: list, create, update, delete, list_scripts, create_script, test\n- Key fields: tool_name (specific tool or \"*\" for wildcard \u2014 runs for every tool, executes before tool-specific hooks), timing (\"before\"|\"after\"), script_filename, is_active\n- Scripts export a default async function receiving HookContext (hook_type, action with tool_name/args/result, session, plan_context) and returning HookOutput (should_halt_plan to halt, message, update_context). Before hooks that return should_halt_plan:true block the tool. After hooks run regardless of success/failure.\n- HookContext.api provides: getContextSize() \u2192 token count; invokeSubAgent(agentName, prompt) \u2192 run a sub-agent; getSessionStatus() \u2192 message count, token estimates, grouped message summaries. Scripts are transpiled TypeScript with access to require/console/process.\n- Use create_script to write scripts (auto-generates template with full HookContext types), create to register the hook config, test to verify with a sample payload.\n\n";
@@ -117,9 +117,12 @@ MCP servers provide external tools. Each active server's tools become available
117
117
  - Key fields: server_name, command, args, env, is_active
118
118
 
119
119
  ### Tool Hooks (manage_tool_hooks)
120
- Tool hooks are custom scripts that run before or after tool execution for validation, logging, or modification.
120
+ Tool hooks are TypeScript scripts that run before or after AI tool execution for validation, policy enforcement, logging, or context management.
121
121
  - Actions: list, create, update, delete, list_scripts, create_script, test
122
- - Key fields: tool_name, timing ("before"|"after"), script_filename, is_active
122
+ - Key fields: tool_name (specific tool or "*" for wildcard — runs for every tool, executes before tool-specific hooks), timing ("before"|"after"), script_filename, is_active
123
+ - Scripts export a default async function receiving HookContext (hook_type, action with tool_name/args/result, session, plan_context) and returning HookOutput (should_halt_plan to halt, message, update_context). Before hooks that return should_halt_plan:true block the tool. After hooks run regardless of success/failure.
124
+ - HookContext.api provides: getContextSize() → token count; invokeSubAgent(agentName, prompt) → run a sub-agent; getSessionStatus() → message count, token estimates, grouped message summaries. Scripts are transpiled TypeScript with access to require/console/process.
125
+ - Use create_script to write scripts (auto-generates template with full HookContext types), create to register the hook config, test to verify with a sample payload.
123
126
 
124
127
  `;
125
128
  //# sourceMappingURL=control-repoburg-agent.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"control-repoburg-agent.js","sourceRoot":"","sources":["../../../../../src/seeding/data/system-prompts/control-repoburg-agent.ts"],"names":[],"mappings":";;;AAAa,QAAA,IAAI,GAAG,kBAAkB,CAAC;AAC1B,QAAA,aAAa,GAAG;IAC3B,iBAAiB;IACjB,aAAa;IACb,YAAY;IACZ,uBAAuB;IACvB,0BAA0B;IAC1B,yBAAyB;IACzB,wBAAwB;IACxB,yBAAyB;IACzB,eAAe;IACf,mBAAmB;IACnB,oBAAoB;IACpB,mBAAmB;IACnB,OAAO;IACP,YAAY;IACZ,UAAU;IACV,cAAc;IACd,gBAAgB;IAChB,kBAAkB;CACnB,CAAC;AACW,QAAA,iBAAiB,GAAG,EAAE,CAAC;AACvB,QAAA,OAAO,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkGtB,CAAC"}
1
+ {"version":3,"file":"control-repoburg-agent.js","sourceRoot":"","sources":["../../../../../src/seeding/data/system-prompts/control-repoburg-agent.ts"],"names":[],"mappings":";;;AAAa,QAAA,IAAI,GAAG,kBAAkB,CAAC;AAC1B,QAAA,aAAa,GAAG;IAC3B,iBAAiB;IACjB,aAAa;IACb,YAAY;IACZ,uBAAuB;IACvB,0BAA0B;IAC1B,yBAAyB;IACzB,wBAAwB;IACxB,yBAAyB;IACzB,eAAe;IACf,mBAAmB;IACnB,oBAAoB;IACpB,mBAAmB;IACnB,OAAO;IACP,YAAY;IACZ,UAAU;IACV,cAAc;IACd,gBAAgB;IAChB,kBAAkB;CACnB,CAAC;AACW,QAAA,iBAAiB,GAAG,EAAE,CAAC;AACvB,QAAA,OAAO,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqGtB,CAAC"}
@@ -1,2 +1,2 @@
1
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', 'overwrite_file', 'patch'.\n * \n * With native tool calling, errors should be returned in the result object\n * instead of pushing to validationErrors. This hook is kept for reference\n * but may need adjustment based on your use case.\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 result?: {\n status: 'SUCCESS' | 'FAILURE';\n output?: string;\n error?: string;\n };\n };\n plan_context: {\n flags: {\n should_halt: boolean;\n halt_reason?: 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 error message clean for AI\n await execAsync(`npx eslint \"${filePath}\" --no-color`);\n console.log(`[Hook] ESLint passed for ${filePath}`);\n } catch (e: any) {\n const errorOutput = e.stdout || e.stderr || e.message;\n \n console.log(`[Hook] ESLint failed for ${filePath}`);\n\n // Log the error - it will be captured in execution logs\n // The AI will see this in the tool result via native tool calling\n console.error(`ESLint check failed:\\n${errorOutput}`);\n \n // Optionally halt the plan if ESLint fails critically\n // context.plan_context.flags.should_halt = true;\n // context.plan_context.flags.halt_reason = `ESLint failed: ${errorOutput}`;\n }\n}\n";
2
+ export declare const content = "/**\n * ESLint Validation Hook\n * \n * Usage: Attach as 'after' hook to 'create_file', 'overwrite_file', 'patch'.\n * \n * With native tool calling, errors should be returned in the result object\n * instead of pushing to validationErrors. This hook is kept for reference\n * but may need adjustment based on your use case.\n */\nimport { exec } from 'child_process';\nimport { promisify } from 'util';\n\nconst execAsync = promisify(exec);\n\nexport interface HookContext {\n hook_type: 'before' | 'after';\n action: {\n tool_name: string;\n args: { file_path?: string; [key: string]: any };\n result?: {\n status: 'SUCCESS' | 'FAILURE';\n output?: string;\n error?: string;\n };\n };\n plan_context: {\n originalParsedActions: Array<{ tool_name: string; arguments: any }>;\n feedback: {\n validationErrors: Array<{ tool_name: string; error: string }>;\n invalidToolErrors: Array<{ tool_name: string; arguments: any }>;\n };\n flags: {\n should_halt: boolean;\n halt_reason?: string;\n is_final?: boolean;\n follow_up_initiated?: boolean;\n };\n };\n session: {\n id: string;\n };\n api: {\n getContextSize(): Promise<number>;\n invokeSubAgent(agentName: string, prompt: string, options?: { sessionId?: string }): Promise<{\n content: string;\n success: boolean;\n childSessionId: string;\n iterations: number;\n }>;\n getSessionStatus(): Promise<{\n message_count: number;\n total_est_tokens: number;\n groups: Array<{\n label: string;\n label_suffix: string;\n message_count: number;\n est_tokens: number;\n messages: Array<{\n role: string;\n preview: string;\n thoughts?: string;\n est_tokens: number;\n }>;\n }>;\n }>;\n };\n}\n\nexport interface HookOutput {\n should_halt_plan?: boolean;\n message?: string;\n update_context?: Record<string, any>;\n}\n\nexport default async function(context: HookContext): Promise<HookOutput | void> {\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 error message clean for AI\n await execAsync(`npx eslint \"${filePath}\" --no-color`);\n console.log(`[Hook] ESLint passed for ${filePath}`);\n } catch (e: any) {\n const errorOutput = e.stdout || e.stderr || e.message;\n \n console.log(`[Hook] ESLint failed for ${filePath}`);\n console.error(`ESLint check failed:\\n${errorOutput}`);\n \n return {\n should_halt_plan: false,\n message: `ESLint check failed for ${filePath}: ${errorOutput.substring(0, 200)}`\n };\n }\n}\n";
@@ -16,8 +16,8 @@ import { promisify } from 'util';
16
16
 
17
17
  const execAsync = promisify(exec);
18
18
 
19
- // Redefining types locally since this runs in a standalone VM context
20
19
  export interface HookContext {
20
+ hook_type: 'before' | 'after';
21
21
  action: {
22
22
  tool_name: string;
23
23
  args: { file_path?: string; [key: string]: any };
@@ -28,14 +28,55 @@ export interface HookContext {
28
28
  };
29
29
  };
30
30
  plan_context: {
31
+ originalParsedActions: Array<{ tool_name: string; arguments: any }>;
32
+ feedback: {
33
+ validationErrors: Array<{ tool_name: string; error: string }>;
34
+ invalidToolErrors: Array<{ tool_name: string; arguments: any }>;
35
+ };
31
36
  flags: {
32
37
  should_halt: boolean;
33
38
  halt_reason?: string;
39
+ is_final?: boolean;
40
+ follow_up_initiated?: boolean;
34
41
  };
35
42
  };
43
+ session: {
44
+ id: string;
45
+ };
46
+ api: {
47
+ getContextSize(): Promise<number>;
48
+ invokeSubAgent(agentName: string, prompt: string, options?: { sessionId?: string }): Promise<{
49
+ content: string;
50
+ success: boolean;
51
+ childSessionId: string;
52
+ iterations: number;
53
+ }>;
54
+ getSessionStatus(): Promise<{
55
+ message_count: number;
56
+ total_est_tokens: number;
57
+ groups: Array<{
58
+ label: string;
59
+ label_suffix: string;
60
+ message_count: number;
61
+ est_tokens: number;
62
+ messages: Array<{
63
+ role: string;
64
+ preview: string;
65
+ thoughts?: string;
66
+ est_tokens: number;
67
+ }>;
68
+ }>;
69
+ }>;
70
+ };
36
71
  }
37
72
 
38
- export default async function(context: HookContext) {
73
+ export interface HookOutput {
74
+ should_halt_plan?: boolean;
75
+ message?: string;
76
+ update_context?: Record<string, any>;
77
+ }
78
+
79
+ export default async function(context: HookContext): Promise<HookOutput | void> {
39
80
  const filePath = context.action.args.file_path;
40
81
  if (!filePath) return;
41
82
 
@@ -50,14 +91,12 @@ export default async function(context: HookContext) {
50
91
  const errorOutput = e.stdout || e.stderr || e.message;
51
92
 
52
93
  console.log(\`[Hook] ESLint failed for \${filePath}\`);
53
-
54
- // Log the error - it will be captured in execution logs
55
- // The AI will see this in the tool result via native tool calling
56
94
  console.error(\`ESLint check failed:\\n\${errorOutput}\`);
57
95
 
58
- // Optionally halt the plan if ESLint fails critically
59
- // context.plan_context.flags.should_halt = true;
60
- // context.plan_context.flags.halt_reason = \`ESLint failed: \${errorOutput}\`;
96
+ return {
97
+ should_halt_plan: false,
98
+ message: \`ESLint check failed for \${filePath}: \${errorOutput.substring(0, 200)}\`
99
+ };
61
100
  }
62
101
  }
63
102
  `;
@@ -1 +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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0DtB,CAAC"}
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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiGtB,CAAC"}
@@ -1,2 +1,2 @@
1
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 'overwrite_file' tool as a 'before' hook.\n* 2. It will block edits to any file with 'lock' in the name.\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 current AI plan\n}\n\nexport interface HookOutput {\n // If true, AI plan stops immediately.\n should_halt_plan?: boolean;\n \n // Optional message to log in UI\n message?: string;\n \n // Optional data to merge back into 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";
2
+ export declare const content = "/**\n * Example Hook Script\n * \n * Usage: \n * 1. Attach to 'patch' or 'overwrite_file' tool as a 'before' hook.\n * 2. It will block edits to any file with 'lock' in the name.\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 HookPlanContext {\n originalParsedActions: Array<{ tool_name: string; arguments: any }>;\n feedback: {\n validationErrors: Array<{ tool_name: string; error: string }>;\n invalidToolErrors: Array<{ tool_name: string; arguments: any }>;\n };\n flags: {\n should_halt: boolean;\n halt_reason?: string;\n is_final?: boolean;\n follow_up_initiated?: boolean;\n };\n}\n\nexport interface HookSession {\n id: string;\n}\n\nexport interface HookSubAgentResult {\n content: string;\n success: boolean;\n childSessionId: string;\n iterations: number;\n}\n\nexport interface HookSessionStatusGroup {\n label: string;\n label_suffix: string;\n message_count: number;\n est_tokens: number;\n messages: Array<{\n role: string;\n preview: string;\n thoughts?: string;\n est_tokens: number;\n }>;\n}\n\nexport interface HookSessionStatus {\n message_count: number;\n total_est_tokens: number;\n groups: HookSessionStatusGroup[];\n}\n\nexport interface HookApi {\n /** Get the current context size in tokens for the session */\n getContextSize(): Promise<number>;\n /** Invoke a sub-agent synchronously (blocks until complete) */\n invokeSubAgent(agentName: string, prompt: string, options?: { sessionId?: string }): Promise<HookSubAgentResult>;\n /** Get session status: message count, token estimates, grouped message summaries */\n getSessionStatus(): Promise<HookSessionStatus>;\n}\n\nexport interface HookContext {\n hook_type: 'before' | 'after';\n action: HookAction;\n plan_context: HookPlanContext;\n session: HookSession;\n api: HookApi;\n}\n\nexport interface HookOutput {\n // If true, AI plan stops immediately.\n should_halt_plan?: boolean;\n \n // Optional message to log in UI\n message?: string;\n \n // Optional data to merge back into 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 // Example: Check context size and compress if too large\n // const contextSize = await context.api.getContextSize();\n // if (contextSize > 70000) {\n // const result = await context.api.invokeSubAgent('compress-agent', 'Compress conversation history');\n // return { message: `Context was ${contextSize} tokens. Compress-agent result: ${result.content}` };\n // }\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";
@@ -3,12 +3,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.content = exports.filename = void 0;
4
4
  exports.filename = 'example-hook.ts';
5
5
  exports.content = `/**
6
- * Example Hook Script
7
- *
8
- * Usage:
9
- * 1. Attach to 'patch' or 'overwrite_file' tool as a 'before' hook.
10
- * 2. It will block edits to any file with 'lock' in the name.
11
- */
6
+ * Example Hook Script
7
+ *
8
+ * Usage:
9
+ * 1. Attach to 'patch' or 'overwrite_file' tool as a 'before' hook.
10
+ * 2. It will block edits to any file with 'lock' in the name.
11
+ */
12
12
  // --- Type Definitions ---
13
13
 
14
14
  export interface HookAction {
@@ -22,10 +22,65 @@ export interface HookAction {
22
22
  };
23
23
  }
24
24
 
25
+ export interface HookPlanContext {
26
+ originalParsedActions: Array<{ tool_name: string; arguments: any }>;
27
+ feedback: {
28
+ validationErrors: Array<{ tool_name: string; error: string }>;
29
+ invalidToolErrors: Array<{ tool_name: string; arguments: any }>;
30
+ };
31
+ flags: {
32
+ should_halt: boolean;
33
+ halt_reason?: string;
34
+ is_final?: boolean;
35
+ follow_up_initiated?: boolean;
36
+ };
37
+ }
38
+
39
+ export interface HookSession {
40
+ id: string;
41
+ }
42
+
43
+ export interface HookSubAgentResult {
44
+ content: string;
45
+ success: boolean;
46
+ childSessionId: string;
47
+ iterations: number;
48
+ }
49
+
50
+ export interface HookSessionStatusGroup {
51
+ label: string;
52
+ label_suffix: string;
53
+ message_count: number;
54
+ est_tokens: number;
55
+ messages: Array<{
56
+ role: string;
57
+ preview: string;
58
+ thoughts?: string;
59
+ est_tokens: number;
60
+ }>;
61
+ }
62
+
63
+ export interface HookSessionStatus {
64
+ message_count: number;
65
+ total_est_tokens: number;
66
+ groups: HookSessionStatusGroup[];
67
+ }
68
+
69
+ export interface HookApi {
70
+ /** Get the current context size in tokens for the session */
71
+ getContextSize(): Promise<number>;
72
+ /** Invoke a sub-agent synchronously (blocks until complete) */
73
+ invokeSubAgent(agentName: string, prompt: string, options?: { sessionId?: string }): Promise<HookSubAgentResult>;
74
+ /** Get session status: message count, token estimates, grouped message summaries */
75
+ getSessionStatus(): Promise<HookSessionStatus>;
76
+ }
77
+
25
78
  export interface HookContext {
26
79
  hook_type: 'before' | 'after';
27
80
  action: HookAction;
28
- plan_context: any; // Shared state of current AI plan
81
+ plan_context: HookPlanContext;
82
+ session: HookSession;
83
+ api: HookApi;
29
84
  }
30
85
 
31
86
  export interface HookOutput {
@@ -48,6 +103,13 @@ export default async function(context: HookContext): Promise<HookOutput | void>
48
103
  // Log to console (appears in backend logs)
49
104
  console.log(\`[Hook] analyzing action on: \${filePath}\`);
50
105
 
106
+ // Example: Check context size and compress if too large
107
+ // const contextSize = await context.api.getContextSize();
108
+ // if (contextSize > 70000) {
109
+ // const result = await context.api.invokeSubAgent('compress-agent', 'Compress conversation history');
110
+ // return { message: \`Context was \${contextSize} tokens. Compress-agent result: \${result.content}\` };
111
+ // }
112
+
51
113
  // 2. Logic
52
114
  if (filePath.includes('lock')) {
53
115
  // Return Halt Signal
@@ -1 +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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6DtB,CAAC"}
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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2HtB,CAAC"}
@@ -1,2 +1,2 @@
1
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";
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## Wildcard Hooks\n\nYou can use `*` as the tool name to create a hook that runs for **every** tool.\nWildcard hooks always execute **before** tool-specific hooks.\n\n**Example:** A `*` before-hook runs before every tool action:\n\n| Hook Config | Execution Order |\n|-------------|----------------|\n| `*` before \u2192 `audit.ts` | Runs 1st |\n| `create_file` before \u2192 `validate.ts` | Runs 2nd |\n\nThis is useful for:\n- **Logging/auditing** all tool actions\n- **Context size checks** before any action\n- **Global policies** that apply regardless of tool type\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\", or any tool name for wildcard hooks\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: {\n originalParsedActions: Array<{ tool_name: string; arguments: any }>;\n feedback: {\n validationErrors: Array<{ tool_name: string; error: string }>;\n invalidToolErrors: Array<{ tool_name: string; arguments: any }>;\n };\n flags: {\n should_halt: boolean;\n halt_reason?: string;\n is_final?: boolean;\n follow_up_initiated?: boolean;\n };\n };\n\n session: {\n id: string; // Current session ID\n };\n\n api: {\n // Get the token count of the current session's conversation history\n getContextSize(): Promise<number>;\n\n // Invoke a sub-agent synchronously (blocks until the sub-agent completes)\n invokeSubAgent(agentName: string, prompt: string, options?: { sessionId?: string }): Promise<{\n content: string;\n success: boolean;\n childSessionId: string;\n iterations: number;\n }>;\n\n // Get session status: message count, token estimates, grouped message summaries\n getSessionStatus(): Promise<{\n message_count: number;\n total_est_tokens: number;\n groups: Array<{\n label: string;\n label_suffix: string;\n message_count: number;\n est_tokens: number;\n messages: Array<{\n role: string;\n preview: string;\n thoughts?: string;\n est_tokens: number;\n }>;\n }>;\n }>;\n };\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\n### Examples\n\n**Block edits to locked files (wildcard hook):**\n\n```typescript\nexport default async function(context: HookContext): Promise<HookOutput> {\n const filePath = context.action?.args?.file_path || '';\n if (filePath.includes('lock')) {\n return {\n should_halt_plan: true,\n message: 'BLOCKED: Editing locked files is forbidden.'\n };\n }\n return { should_halt_plan: false };\n}\n```\n\n**Auto-compress context when it grows too large (wildcard hook):**\n\n```typescript\nexport default async function(context: HookContext): Promise<HookOutput> {\n const status = await context.api.getSessionStatus();\n if (status.total_est_tokens > 70000) {\n const result = await context.api.invokeSubAgent('compress-agent', 'Compress conversation history');\n return { message: 'Context was ' + status.total_est_tokens + ' tokens. Compressed.' };\n }\n return { should_halt_plan: false };\n}\n```\n";