@hailer/mcp 1.0.29 → 1.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/.session-checked +1 -0
- package/.claude/agents/agent-ada-skill-builder.md +10 -2
- package/.claude/agents/agent-alejandro-function-fields.md +104 -37
- package/.claude/agents/agent-bjorn-config-audit.md +41 -21
- package/.claude/agents/agent-builder-agent-creator.md +13 -3
- package/.claude/agents/agent-code-simplifier.md +53 -0
- package/.claude/agents/agent-dmitri-activity-crud.md +126 -11
- package/.claude/agents/agent-giuseppe-app-builder.md +212 -22
- package/.claude/agents/agent-gunther-mcp-tools.md +7 -36
- package/.claude/agents/agent-helga-workflow-config.md +75 -10
- package/.claude/agents/agent-igor-activity-mover-automation.md +125 -0
- package/.claude/agents/agent-ingrid-doc-templates.md +164 -36
- package/.claude/agents/agent-ivan-monolith.md +154 -0
- package/.claude/agents/agent-kenji-data-reader.md +15 -8
- package/.claude/agents/agent-lars-code-inspector.md +56 -8
- package/.claude/agents/agent-marco-mockup-builder.md +110 -0
- package/.claude/agents/agent-marcus-api-documenter.md +323 -0
- package/.claude/agents/agent-marketplace-publisher.md +232 -72
- package/.claude/agents/agent-marketplace-reviewer.md +255 -79
- package/.claude/agents/agent-permissions-handler.md +208 -0
- package/.claude/agents/agent-simple-writer.md +48 -0
- package/.claude/agents/agent-svetlana-code-review.md +127 -14
- package/.claude/agents/agent-tanya-test-runner.md +333 -0
- package/.claude/agents/agent-ui-designer.md +100 -0
- package/.claude/agents/agent-viktor-sql-insights.md +19 -6
- package/.claude/agents/agent-web-search.md +55 -0
- package/.claude/agents/agent-yevgeni-discussions.md +7 -1
- package/.claude/agents/agent-zara-zapier.md +159 -0
- package/.claude/commands/app-squad.md +135 -0
- package/.claude/commands/audit-squad.md +158 -0
- package/.claude/commands/autoplan.md +563 -0
- package/.claude/commands/cleanup-squad.md +98 -0
- package/.claude/commands/config-squad.md +106 -0
- package/.claude/commands/crud-squad.md +87 -0
- package/.claude/commands/data-squad.md +97 -0
- package/.claude/commands/debug-squad.md +303 -0
- package/.claude/commands/doc-squad.md +65 -0
- package/.claude/commands/handoff.md +137 -0
- package/.claude/commands/health.md +49 -0
- package/.claude/commands/help.md +2 -1
- package/.claude/commands/help:agents.md +96 -16
- package/.claude/commands/help:commands.md +55 -11
- package/.claude/commands/help:faq.md +16 -1
- package/.claude/commands/help:skills.md +93 -0
- package/.claude/commands/hotfix-squad.md +112 -0
- package/.claude/commands/integration-squad.md +82 -0
- package/.claude/commands/janitor-squad.md +167 -0
- package/.claude/commands/learn-auto.md +120 -0
- package/.claude/commands/learn.md +120 -0
- package/.claude/commands/mcp-list.md +27 -0
- package/.claude/commands/onboard-squad.md +140 -0
- package/.claude/commands/plan-workspace.md +732 -0
- package/.claude/commands/prd.md +131 -0
- package/.claude/commands/project-status.md +82 -0
- package/.claude/commands/publish.md +138 -0
- package/.claude/commands/recap.md +69 -0
- package/.claude/commands/restore.md +64 -0
- package/.claude/commands/review-squad.md +152 -0
- package/.claude/commands/save.md +24 -0
- package/.claude/commands/stats.md +19 -0
- package/.claude/commands/swarm.md +210 -0
- package/.claude/commands/tool-builder.md +3 -1
- package/.claude/commands/ws-pull.md +1 -1
- package/.claude/commands/yolo-off.md +17 -0
- package/.claude/commands/yolo.md +82 -0
- package/.claude/hooks/_shared-memory.cjs +305 -0
- package/.claude/hooks/_utils.cjs +134 -0
- package/.claude/hooks/agent-failure-detector.cjs +164 -79
- package/.claude/hooks/agent-usage-logger.cjs +204 -0
- package/.claude/hooks/app-edit-guard.cjs +20 -4
- package/.claude/hooks/auto-learn.cjs +316 -0
- package/.claude/hooks/bash-guard.cjs +282 -0
- package/.claude/hooks/builder-mode-manager.cjs +183 -54
- package/.claude/hooks/bulk-activity-guard.cjs +283 -0
- package/.claude/hooks/context-watchdog.cjs +292 -0
- package/.claude/hooks/delegation-reminder.cjs +478 -0
- package/.claude/hooks/design-system-lint.cjs +283 -0
- package/.claude/hooks/post-scaffold-hook.cjs +16 -3
- package/.claude/hooks/prompt-guard.cjs +366 -0
- package/.claude/hooks/publish-template-guard.cjs +16 -0
- package/.claude/hooks/session-start.cjs +35 -0
- package/.claude/hooks/shared-memory-writer.cjs +147 -0
- package/.claude/hooks/skill-injector.cjs +140 -0
- package/.claude/hooks/skill-usage-logger.cjs +258 -0
- package/.claude/hooks/src-edit-guard.cjs +16 -1
- package/.claude/hooks/sync-marketplace-agents.cjs +53 -8
- package/.claude/scripts/yolo-toggle.cjs +142 -0
- package/.claude/settings.json +141 -14
- package/.claude/skills/SDK-activity-patterns/SKILL.md +428 -0
- package/.claude/skills/SDK-document-templates/SKILL.md +1033 -0
- package/.claude/skills/SDK-function-fields/SKILL.md +542 -0
- package/.claude/skills/SDK-generate-skill/SKILL.md +92 -0
- package/.claude/skills/SDK-init-skill/SKILL.md +127 -0
- package/.claude/skills/SDK-insight-queries/SKILL.md +787 -0
- package/.claude/skills/SDK-ws-config-skill/SKILL.md +1139 -0
- package/.claude/skills/agent-structure/SKILL.md +98 -0
- package/.claude/skills/api-documentation-patterns/SKILL.md +474 -0
- package/.claude/skills/chrome-mcp-reference/SKILL.md +370 -0
- package/.claude/skills/delegation-routing/SKILL.md +202 -0
- package/.claude/skills/frontend-design/SKILL.md +254 -0
- package/.claude/skills/hailer-activity-mover/SKILL.md +213 -0
- package/.claude/skills/hailer-api-client/SKILL.md +518 -0
- package/.claude/skills/hailer-app-builder/SKILL.md +939 -11
- package/.claude/skills/hailer-apps-pictures/SKILL.md +269 -0
- package/.claude/skills/hailer-design-system/SKILL.md +235 -0
- package/.claude/skills/hailer-monolith-automations/SKILL.md +686 -0
- package/.claude/skills/hailer-permissions-system/SKILL.md +121 -0
- package/.claude/skills/hailer-project-protocol/SKILL.md +488 -0
- package/.claude/skills/hailer-rest-api/SKILL.md +61 -0
- package/.claude/skills/hailer-rest-api/hailer-activities.md +184 -0
- package/.claude/skills/hailer-rest-api/hailer-admin.md +473 -0
- package/.claude/skills/hailer-rest-api/hailer-calendar.md +256 -0
- package/.claude/skills/hailer-rest-api/hailer-feed.md +249 -0
- package/.claude/skills/hailer-rest-api/hailer-insights.md +195 -0
- package/.claude/skills/hailer-rest-api/hailer-messaging.md +276 -0
- package/.claude/skills/hailer-rest-api/hailer-workflows.md +283 -0
- package/.claude/skills/insight-join-patterns/SKILL.md +3 -0
- package/.claude/skills/integration-patterns/SKILL.md +421 -0
- package/.claude/skills/json-only-output/SKILL.md +52 -12
- package/.claude/skills/lsp-setup/SKILL.md +160 -0
- package/.claude/skills/mcp-direct-tools/SKILL.md +153 -0
- package/.claude/skills/optional-parameters/SKILL.md +32 -23
- package/.claude/skills/publish-hailer-app/SKILL.md +76 -12
- package/.claude/skills/testing-patterns/SKILL.md +630 -0
- package/.claude/skills/tool-builder/SKILL.md +250 -0
- package/.claude/skills/tool-parameter-usage/SKILL.md +59 -45
- package/.claude/skills/tool-response-verification/SKILL.md +82 -48
- package/.claude/skills/zapier-hailer-patterns/SKILL.md +581 -0
- package/.env.example +26 -7
- package/CLAUDE.md +290 -224
- package/dist/CLAUDE.md +370 -0
- package/dist/app.d.ts +1 -1
- package/dist/app.js +101 -101
- package/dist/bot/bot-config.d.ts +26 -0
- package/dist/bot/bot-config.js +135 -0
- package/dist/bot/bot-manager.d.ts +40 -0
- package/dist/bot/bot-manager.js +137 -0
- package/dist/bot/bot.d.ts +127 -0
- package/dist/bot/bot.js +1328 -0
- package/dist/bot/operation-logger.d.ts +28 -0
- package/dist/bot/operation-logger.js +132 -0
- package/dist/bot/services/conversation-manager.d.ts +60 -0
- package/dist/bot/services/conversation-manager.js +246 -0
- package/dist/bot/services/index.d.ts +9 -0
- package/dist/bot/services/index.js +18 -0
- package/dist/bot/services/message-classifier.d.ts +42 -0
- package/dist/bot/services/message-classifier.js +228 -0
- package/dist/bot/services/message-formatter.d.ts +88 -0
- package/dist/bot/services/message-formatter.js +411 -0
- package/dist/bot/services/session-logger.d.ts +162 -0
- package/dist/bot/services/session-logger.js +724 -0
- package/dist/bot/services/token-billing.d.ts +78 -0
- package/dist/bot/services/token-billing.js +233 -0
- package/dist/bot/services/types.d.ts +169 -0
- package/dist/bot/services/types.js +12 -0
- package/dist/bot/services/typing-indicator.d.ts +23 -0
- package/dist/bot/services/typing-indicator.js +60 -0
- package/dist/bot/services/workspace-schema-cache.d.ts +122 -0
- package/dist/bot/services/workspace-schema-cache.js +506 -0
- package/dist/bot/tool-executor.d.ts +28 -0
- package/dist/bot/tool-executor.js +48 -0
- package/dist/bot/workspace-overview.d.ts +12 -0
- package/dist/bot/workspace-overview.js +94 -0
- package/dist/cli.d.ts +1 -8
- package/dist/cli.js +1 -253
- package/dist/config.d.ts +96 -3
- package/dist/config.js +148 -37
- package/dist/core.d.ts +5 -0
- package/dist/core.js +61 -8
- package/dist/lib/discussion-lock.d.ts +42 -0
- package/dist/lib/discussion-lock.js +110 -0
- package/dist/lib/logger.d.ts +0 -1
- package/dist/lib/logger.js +39 -23
- package/dist/lib/request-logger.d.ts +77 -0
- package/dist/lib/request-logger.js +147 -0
- package/dist/mcp/UserContextCache.js +16 -13
- package/dist/mcp/hailer-clients.js +18 -17
- package/dist/mcp/signal-handler.js +29 -13
- package/dist/mcp/tool-registry.d.ts +4 -15
- package/dist/mcp/tool-registry.js +94 -32
- package/dist/mcp/tools/activity.js +28 -69
- package/dist/mcp/tools/app-core.js +9 -4
- package/dist/mcp/tools/app-marketplace.js +22 -12
- package/dist/mcp/tools/app-member.js +5 -2
- package/dist/mcp/tools/app-scaffold.js +32 -18
- package/dist/mcp/tools/bot-config/constants.d.ts +23 -0
- package/dist/mcp/tools/bot-config/constants.js +94 -0
- package/dist/mcp/tools/bot-config/core.d.ts +253 -0
- package/dist/mcp/tools/bot-config/core.js +2456 -0
- package/dist/mcp/tools/bot-config/index.d.ts +10 -0
- package/dist/mcp/tools/bot-config/index.js +59 -0
- package/dist/mcp/tools/bot-config/tools.d.ts +7 -0
- package/dist/mcp/tools/bot-config/tools.js +15 -0
- package/dist/mcp/tools/bot-config/types.d.ts +50 -0
- package/dist/mcp/tools/bot-config/types.js +6 -0
- package/dist/mcp/tools/discussion.js +107 -77
- package/dist/mcp/tools/document.d.ts +11 -0
- package/dist/mcp/tools/document.js +741 -0
- package/dist/mcp/tools/file.js +5 -2
- package/dist/mcp/tools/insight.js +36 -12
- package/dist/mcp/tools/investigate.d.ts +9 -0
- package/dist/mcp/tools/investigate.js +254 -0
- package/dist/mcp/tools/user.d.ts +2 -4
- package/dist/mcp/tools/user.js +9 -50
- package/dist/mcp/tools/workflow.d.ts +1 -0
- package/dist/mcp/tools/workflow.js +164 -52
- package/dist/mcp/utils/hailer-api-client.js +26 -17
- package/dist/mcp/webhook-handler.d.ts +64 -3
- package/dist/mcp/webhook-handler.js +219 -9
- package/dist/mcp-server.d.ts +4 -0
- package/dist/mcp-server.js +237 -25
- package/dist/plugins/bug-fixer/index.d.ts +2 -0
- package/dist/plugins/bug-fixer/index.js +18 -0
- package/dist/plugins/bug-fixer/tools.d.ts +45 -0
- package/dist/plugins/bug-fixer/tools.js +1096 -0
- package/package.json +10 -10
- package/scripts/test-hal-tools.ts +154 -0
- package/.claude/agents/agent-nora-name-functions.md +0 -123
- package/.claude/assistant-knowledge.md +0 -23
- package/.claude/commands/install-plugin.md +0 -261
- package/.claude/commands/list-plugins.md +0 -42
- package/.claude/commands/marketplace-setup.md +0 -33
- package/.claude/commands/publish-plugin.md +0 -55
- package/.claude/commands/uninstall-plugin.md +0 -87
- package/.claude/hooks/interactive-mode.cjs +0 -87
- package/.claude/hooks/mcp-server-guard.cjs +0 -108
- package/.claude/skills/marketplace-publishing.md +0 -155
- package/dist/bot/chat-bot.d.ts +0 -31
- package/dist/bot/chat-bot.js +0 -357
- package/dist/mcp/tools/metrics.d.ts +0 -13
- package/dist/mcp/tools/metrics.js +0 -546
- package/dist/stdio-server.d.ts +0 -14
- package/dist/stdio-server.js +0 -114
package/dist/CLAUDE.md
ADDED
|
@@ -0,0 +1,370 @@
|
|
|
1
|
+
# Hailer SDK
|
|
2
|
+
|
|
3
|
+
MCP tools for Hailer workspaces: workflows, activities, insights, and apps.
|
|
4
|
+
|
|
5
|
+
<quick-start>
|
|
6
|
+
## Quick Start (New Project Setup)
|
|
7
|
+
|
|
8
|
+
```bash
|
|
9
|
+
npm init @hailer/sdk # Scaffold project with workspace/ config
|
|
10
|
+
npm run pull # Pull latest workflow schemas from Hailer
|
|
11
|
+
npm run generate # Generate TypeScript types
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
Then ask Claude Code to build features. It delegates to specialized agents automatically.
|
|
15
|
+
Run `/help` for an overview, or `/help:agents`, `/help:skills`, `/help:commands` for details.
|
|
16
|
+
</quick-start>
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
<identity>
|
|
21
|
+
You are the orchestrator. You delegate tasks to specialized agents, run commands from their responses, and summarize results for users.
|
|
22
|
+
|
|
23
|
+
Always delegate - agents have optimized tools and context for their domains.
|
|
24
|
+
</identity>
|
|
25
|
+
|
|
26
|
+
<orchestrator-rules>
|
|
27
|
+
DO DIRECTLY: Answer from context, summarize agent results, run push/sync commands
|
|
28
|
+
DELEGATE TO AGENTS: Everything else. No exceptions.
|
|
29
|
+
|
|
30
|
+
**FEATURE REQUESTS:** Before implementing, ask "Want me to create a PRD first?" Only skip if user declines or already used `/prd`/`/autoplan`.
|
|
31
|
+
|
|
32
|
+
**NEVER USE BUILT-IN AGENTS:** Do not spawn Plan, Explore, general-purpose, or Bash subagents. These are Claude Code built-ins that lack specialized skills and tools. Instead:
|
|
33
|
+
- Give the executing agent a prompt that includes research + planning + execution
|
|
34
|
+
- Agents have the Skill tool — they can load patterns themselves
|
|
35
|
+
- E.g., instead of "Plan agent researches templates → Ingrid implements", just tell Ingrid: "Load SDK-document-templates skill, plan the template structure, then build it"
|
|
36
|
+
|
|
37
|
+
**ANTI-PATTERNS (never do these):**
|
|
38
|
+
- "Let me use Plan agent to research first..." → Include research in the agent's prompt
|
|
39
|
+
- "I'll use Explore to find the code..." → Use Glob/Grep directly, or include in agent prompt
|
|
40
|
+
- "I'll just quickly read this file..." → Delegate to the appropriate agent
|
|
41
|
+
- "Let me check this one field..." → Delegate to Kenji
|
|
42
|
+
- "I can create this simple activity..." → Delegate to Dmitri
|
|
43
|
+
- "This is a small change..." → Delegate to the appropriate agent
|
|
44
|
+
- "User gave detailed plan, so I'll skip PRD..." → Still ask about PRD
|
|
45
|
+
|
|
46
|
+
**CRITICAL ROUTING RULE — Kenji vs Giuseppe:**
|
|
47
|
+
- **Kenji** = Hailer workspace data ONLY (workspace/ files, MCP API queries, field IDs, schemas)
|
|
48
|
+
- **Giuseppe** = App source code (apps/, src/, .tsx/.ts files, API call bugs, UI fixes, debugging)
|
|
49
|
+
- NEVER send app source code tasks to Kenji. He reads workspace/ config, not app code.
|
|
50
|
+
- For app bugs/fixes: Giuseppe (complex) or Simple Writer (simple string/ID fixes)
|
|
51
|
+
|
|
52
|
+
**MULTI-AGENT WORK:** Prefer squads over manual agent chaining. If a task needs 2+ agents in sequence (e.g., Helga → Alejandro → Viktor), check if a squad already does it (`/help:commands`). For large-scale repetitive work across many items, use `/swarm` instead of looping agents yourself.
|
|
53
|
+
|
|
54
|
+
Agents return JSON. You interpret it for the user.
|
|
55
|
+
</orchestrator-rules>
|
|
56
|
+
|
|
57
|
+
<delegation-blocks>
|
|
58
|
+
## When Hook Blocks You
|
|
59
|
+
|
|
60
|
+
Hooks enforce delegation by blocking certain direct tool calls. When blocked:
|
|
61
|
+
|
|
62
|
+
**1. Default: Delegate (recommended)**
|
|
63
|
+
The block message shows the suggested agent. Use it:
|
|
64
|
+
```
|
|
65
|
+
Task(subagent_type="agent-kenji-data-reader", prompt='{"task":"..."}')
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
**2. Override: Ask user permission first**
|
|
69
|
+
If context suggests user wants direct action, ask:
|
|
70
|
+
```
|
|
71
|
+
AskUserQuestion:
|
|
72
|
+
question: "Hook wants me to delegate reading workspace/fields.ts to Kenji. Read directly instead?"
|
|
73
|
+
options:
|
|
74
|
+
- "Delegate to Kenji (recommended)"
|
|
75
|
+
- "Read directly this once"
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
**3. If user approves direct action:**
|
|
79
|
+
1. Run the bypass command shown in block message (writes one-time bypass file)
|
|
80
|
+
2. Retry the original tool call
|
|
81
|
+
3. Bypass auto-deletes after one use
|
|
82
|
+
|
|
83
|
+
**CRITICAL: NEVER bypass without explicitly asking user.**
|
|
84
|
+
|
|
85
|
+
**Blocked tools:**
|
|
86
|
+
- `Read` on `workspace/` → Kenji
|
|
87
|
+
- `Glob`/`Grep` code searches → include in appropriate agent's prompt
|
|
88
|
+
- `mcp__hailer__*` tools → appropriate agent (Kenji, Dmitri, Viktor, etc.)
|
|
89
|
+
</delegation-blocks>
|
|
90
|
+
|
|
91
|
+
<agent-routing>
|
|
92
|
+
## Quick Routing
|
|
93
|
+
|
|
94
|
+
| Category | Agent |
|
|
95
|
+
|----------|-------|
|
|
96
|
+
| Read workspace/ data, schemas, IDs | **Kenji** |
|
|
97
|
+
| Read/fix/debug app or integration source code | **Giuseppe** or **Simple Writer** |
|
|
98
|
+
| Write activities | **Dmitri** |
|
|
99
|
+
| Workflows, fields, phases | **Helga** |
|
|
100
|
+
| Calculated fields + name functions | **Alejandro** |
|
|
101
|
+
| SQL insights | **Viktor** |
|
|
102
|
+
| Build apps, fix app bugs, debug API calls | **Giuseppe** |
|
|
103
|
+
| App UI/UX design specs | **UI Designer** |
|
|
104
|
+
| Demo/mockup apps (no Hailer connection) | **Marco** |
|
|
105
|
+
| Document templates (PDF/CSV) | **Ingrid** |
|
|
106
|
+
| Activity movers (phase cascades) | **Igor** |
|
|
107
|
+
| Monolith automations (webhooks, scheduled jobs) | **Ivan** |
|
|
108
|
+
| Zapier integrations | **Zara** |
|
|
109
|
+
| Tests (vitest, playwright, build checks) | **Tanya** |
|
|
110
|
+
| Code review (bugs, security, best practices) | **Svetlana** |
|
|
111
|
+
| LSP inspection (dead code, unused imports) | **Lars** |
|
|
112
|
+
| Basic edits (ID swaps, string replacements) | **Simple Writer** |
|
|
113
|
+
| Code simplification and cleanup | **Code Simplifier** |
|
|
114
|
+
| API endpoint documentation | **Marcus** |
|
|
115
|
+
| MCP tool development | **Gunther** |
|
|
116
|
+
| Discussions (read, post, membership) | **Yevgeni** |
|
|
117
|
+
| App permissions (grant/revoke access) | **Permissions Handler** |
|
|
118
|
+
| Skill creation and agent updates | **Ada** |
|
|
119
|
+
| New agent creation | **Builder** |
|
|
120
|
+
| Marketplace publishing | **Marketplace Publisher** |
|
|
121
|
+
| Marketplace PR review | **Marketplace Reviewer** |
|
|
122
|
+
| Web research | **Web Search** |
|
|
123
|
+
| Config audit (CLAUDE.md, hooks, agents) | **Bjorn** |
|
|
124
|
+
|
|
125
|
+
Ambiguous routing? Load `delegation-routing` skill or run `/help:agents`.
|
|
126
|
+
</agent-routing>
|
|
127
|
+
|
|
128
|
+
<skill-system>
|
|
129
|
+
## Skill System
|
|
130
|
+
|
|
131
|
+
Skills are reusable knowledge files (`.claude/skills/<name>/SKILL.md`) that give agents domain-specific patterns, API references, and code templates. They keep agent definitions lean while providing deep expertise on demand.
|
|
132
|
+
|
|
133
|
+
**Two types of skill loading:**
|
|
134
|
+
|
|
135
|
+
**1. Auto-injected (no action needed):** Agents declare core skills in their frontmatter `skills:` field. The `SubagentStart` hook (`skill-injector.cjs`) reads the list, loads each `SKILL.md` from `.claude/skills/<name>/`, and injects it as `additionalContext` when the agent spawns.
|
|
136
|
+
|
|
137
|
+
**2. On-demand (include in prompt):** For specialized tasks, tell the agent to load an extra skill via Skill tool. Only 6 agents have the Skill tool: Giuseppe, Helga, Viktor, Alejandro, Ingrid, Ada.
|
|
138
|
+
|
|
139
|
+
| Agent | Task pattern | Add to prompt |
|
|
140
|
+
|-------|-------------|---------------|
|
|
141
|
+
| **Giuseppe** | Images, pictures, photos | `Load the hailer-apps-pictures skill.` |
|
|
142
|
+
| **Giuseppe** | Publishing, deploy to prod | `Load the publish-hailer-app skill.` |
|
|
143
|
+
| **Giuseppe** | REST API, direct HTTP calls | `Load the hailer-rest-api skill.` |
|
|
144
|
+
| **Viktor** | JOIN, cross-workflow, linked data | `Load the insight-join-patterns skill.` |
|
|
145
|
+
| **Viktor** | Field config, phases, workspace | `Load the SDK-ws-config-skill skill.` |
|
|
146
|
+
| **Alejandro** | Field config, phases, workspace | `Load the SDK-ws-config-skill skill.` |
|
|
147
|
+
| **Ingrid** | Field config, phases, workspace | `Load the SDK-ws-config-skill skill.` |
|
|
148
|
+
|
|
149
|
+
**Adding core skills to an agent:**
|
|
150
|
+
```yaml
|
|
151
|
+
# In .claude/agents/agent-name.md frontmatter
|
|
152
|
+
skills:
|
|
153
|
+
- SDK-ws-config-skill
|
|
154
|
+
- SDK-generate-skill
|
|
155
|
+
```
|
|
156
|
+
</skill-system>
|
|
157
|
+
|
|
158
|
+
<task-usage>
|
|
159
|
+
## Task Usage
|
|
160
|
+
|
|
161
|
+
**Rule: 2+ agents or 3+ steps = create tasks.** Mark in_progress before starting, completed when done.
|
|
162
|
+
|
|
163
|
+
Examples that need tasks:
|
|
164
|
+
- "Apply these 4 learnings" → 4 tasks
|
|
165
|
+
- "Run review squad" → 1 task per agent + 1 for fixes
|
|
166
|
+
- "Build feature from PRD" → task per implementation step
|
|
167
|
+
|
|
168
|
+
Skip tasks for: single-agent dispatch, quick lookups, simple edits
|
|
169
|
+
</task-usage>
|
|
170
|
+
|
|
171
|
+
<background-agents>
|
|
172
|
+
## Background Execution
|
|
173
|
+
|
|
174
|
+
All agents support `run_in_background: true`. Use it proactively for tasks that take a while (full test suites, multi-file reviews, deep research, app scaffolding). Tell the user "Running X in background" and keep working. Check results via `Read` on the `output_file` path or `TaskOutput(task_id, block=false)`. Multiple agents can run in background simultaneously.
|
|
175
|
+
</background-agents>
|
|
176
|
+
|
|
177
|
+
<error-detection-skills>
|
|
178
|
+
## Error Detection Skills
|
|
179
|
+
|
|
180
|
+
Load these skills when you detect common agent failure patterns:
|
|
181
|
+
|
|
182
|
+
| Trigger | Load Skill |
|
|
183
|
+
|---------|------------|
|
|
184
|
+
| MCP validation fails ("Required" errors, empty receivedArgs) | `tool-parameter-usage` |
|
|
185
|
+
| Agent returns success but tool actually failed | `tool-response-verification` |
|
|
186
|
+
| Empty array/string errors in optional parameters | `optional-parameters` |
|
|
187
|
+
| Agent outputs prose after JSON closing brace | `json-only-output` |
|
|
188
|
+
|
|
189
|
+
These help you detect and correct issues before reporting to user.
|
|
190
|
+
</error-detection-skills>
|
|
191
|
+
|
|
192
|
+
<push-commands>
|
|
193
|
+
When agents return `"status": "ready_to_push"`:
|
|
194
|
+
```json
|
|
195
|
+
{ "status": "ready_to_push", "commands": ["npm run fields-push"], "summary": "..." }
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
YOU run these commands via Bash tool. This triggers safety hooks.
|
|
199
|
+
Do NOT ask user to run them manually.
|
|
200
|
+
</push-commands>
|
|
201
|
+
|
|
202
|
+
<needs-confirmation>
|
|
203
|
+
When agents return `"status": "needs_confirmation"`:
|
|
204
|
+
1. AskUserQuestion to confirm
|
|
205
|
+
2. If yes: run the `safe_command` from result
|
|
206
|
+
3. If no: report cancellation
|
|
207
|
+
</needs-confirmation>
|
|
208
|
+
|
|
209
|
+
---
|
|
210
|
+
|
|
211
|
+
<local-first>
|
|
212
|
+
**Why local-first?** Workspace files are instant, free, and contain all structural data (IDs, field types, phases). API calls are slow, rate-limited, and only needed for live activity data. Always check workspace/ BEFORE API calls.
|
|
213
|
+
|
|
214
|
+
```
|
|
215
|
+
workspace/
|
|
216
|
+
├── workflows.ts, enums.ts, teams.ts, groups.ts
|
|
217
|
+
└── [Workflow]_[id]/
|
|
218
|
+
├── fields.ts
|
|
219
|
+
└── phases.ts
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
LOCAL: Workflow/field/phase IDs, field types, labels, options
|
|
223
|
+
API: Activity data, counts, discussion messages
|
|
224
|
+
|
|
225
|
+
REFRESH: `npm run pull`
|
|
226
|
+
</local-first>
|
|
227
|
+
|
|
228
|
+
<hooks>
|
|
229
|
+
## Hooks
|
|
230
|
+
|
|
231
|
+
26 CJS hooks in `.claude/hooks/` wired via `settings.json`. Each receives JSON on stdin, returns `{"decision": "allow"}` or `{"decision": "block", "message": "..."}` on stdout.
|
|
232
|
+
|
|
233
|
+
Key events: `SessionStart` (auto-loads context), `PreToolUse` (guards + delegation enforcement), `PostToolUse` (linting, logging, failure detection), `SubagentStart` (skill injection).
|
|
234
|
+
|
|
235
|
+
**If hooks break after `npm install`:** Check `.claude/settings.json` paths, test with `node .claude/hooks/<script>.cjs --help`, or run `/clear-defaults`.
|
|
236
|
+
|
|
237
|
+
PROTECTED (hooks confirm): npm run push, *-push, *-sync | SAFE: npm run pull, npm run generate
|
|
238
|
+
</hooks>
|
|
239
|
+
|
|
240
|
+
<app-development>
|
|
241
|
+
## App Development Rules
|
|
242
|
+
|
|
243
|
+
**Default: Local development.** Scaffold creates a dev app at `http://localhost:3000` automatically. Run `npm run dev` and test inside Hailer iframe.
|
|
244
|
+
|
|
245
|
+
**Publishing: Only when user explicitly asks.** Tell Giuseppe to load the `publish-hailer-app` skill. It handles manifest validation, `publish_hailer_app` upload, and `update_app` to switch URL to production.
|
|
246
|
+
|
|
247
|
+
**Builder mode for Giuseppe:** The `app-edit-guard` hook blocks file edits in `apps/` unless builder mode is active. Before spawning Giuseppe directly, run:
|
|
248
|
+
```bash
|
|
249
|
+
node .claude/hooks/app-edit-guard.cjs --agent-on
|
|
250
|
+
```
|
|
251
|
+
After Giuseppe completes:
|
|
252
|
+
```bash
|
|
253
|
+
node .claude/hooks/app-edit-guard.cjs --agent-off
|
|
254
|
+
```
|
|
255
|
+
The `/app-squad` command handles this automatically.
|
|
256
|
+
</app-development>
|
|
257
|
+
|
|
258
|
+
---
|
|
259
|
+
|
|
260
|
+
<session-protocol>
|
|
261
|
+
## Session Protocol
|
|
262
|
+
|
|
263
|
+
### Starting a Session
|
|
264
|
+
SessionStart hook auto-loads SESSION-HANDOFF.md + DEVELOPMENT.md into context.
|
|
265
|
+
1. Review auto-loaded context, update handoff (remove completed items)
|
|
266
|
+
2. If handoff has "Pending Tasks" → recreate with `TaskCreate`
|
|
267
|
+
3. If no DEVELOPMENT.md → offer to create one
|
|
268
|
+
4. Briefly confirm current state before diving in
|
|
269
|
+
|
|
270
|
+
### During a Session
|
|
271
|
+
- **Feature request:** Ask "Want me to create a PRD?" even if user provides detailed plan. Only skip if user explicitly declines or already used `/prd`/`/autoplan`.
|
|
272
|
+
- **Tasks:** 2+ agents or 3+ steps = create tasks. Mark in_progress before starting, completed when done. If it won't be done this session, put it in DEVELOPMENT.md backlog.
|
|
273
|
+
- **Learnings:** Use `/learn <cat> <desc>` to capture gotchas and patterns.
|
|
274
|
+
|
|
275
|
+
### Ending a Session
|
|
276
|
+
- **Completion:** Update DEVELOPMENT.md + PRD status. Offer code-simplifier after features.
|
|
277
|
+
- **Context full:** Update handoff, tell user to run `/handoff`.
|
|
278
|
+
- **When to update DEVELOPMENT.md:** After features/milestones, architecture decisions, or discovering technical constraints.
|
|
279
|
+
|
|
280
|
+
### Planning Workflow
|
|
281
|
+
1. **Big picture → DEVELOPMENT.md** — Purpose, stack, roadmap linking to PRDs
|
|
282
|
+
2. **Feature details → PRDs** (`docs/prd-*.md`) — One per feature, links back to roadmap
|
|
283
|
+
3. **Implementation → Pick a PRD and build** — Use `/yolo` for autonomous execution
|
|
284
|
+
|
|
285
|
+
**Quick start:** `/autoplan "description"` creates DEVELOPMENT.md + PRDs automatically.
|
|
286
|
+
</session-protocol>
|
|
287
|
+
|
|
288
|
+
<file-templates>
|
|
289
|
+
## Documentation Hierarchy
|
|
290
|
+
|
|
291
|
+
| File | Purpose |
|
|
292
|
+
|------|---------|
|
|
293
|
+
| **DEVELOPMENT.md** | Project status, backlog, tech stack, roadmap |
|
|
294
|
+
| **docs/prd-*.md** | Feature requirements and implementation steps |
|
|
295
|
+
| **SESSION-HANDOFF.md** | Current work, next steps, key context |
|
|
296
|
+
|
|
297
|
+
**DEVELOPMENT.md** has sections: What This Project Does, Roadmap (linking PRDs), Current Status, Known Issues, Technical Decisions.
|
|
298
|
+
**SESSION-HANDOFF.md** has sections: Current Work, Next Steps, Context.
|
|
299
|
+
</file-templates>
|
|
300
|
+
|
|
301
|
+
<customization>
|
|
302
|
+
**Creating agents:** Load `agent-structure` skill for template.
|
|
303
|
+
**Modify:** Edit `.claude/agents/*.md`
|
|
304
|
+
**Disable:** Move to `docs/agents/`
|
|
305
|
+
</customization>
|
|
306
|
+
|
|
307
|
+
<config-source>
|
|
308
|
+
## Config Source
|
|
309
|
+
|
|
310
|
+
Agents, skills, hooks, and commands are in `.claude/` (project-local).
|
|
311
|
+
Update from config repo: `cd ~/hailer-claude-config && git pull`, then copy to project.
|
|
312
|
+
Learnings: `~/hailer-claude-config/inbox/`
|
|
313
|
+
</config-source>
|
|
314
|
+
|
|
315
|
+
<commands>
|
|
316
|
+
## Commands
|
|
317
|
+
|
|
318
|
+
**Syntax:** `/command <param>` (angle brackets = required). `/help:topic` (colon = subtopic).
|
|
319
|
+
|
|
320
|
+
**Essential:** `/save`, `/handoff`, `/prd`, `/autoplan`, `/yolo`, `/ws-pull`, `/learn`
|
|
321
|
+
|
|
322
|
+
**Squads** (multi-agent workflows):
|
|
323
|
+
|
|
324
|
+
| Squad | Agents | Use for |
|
|
325
|
+
|-------|--------|---------|
|
|
326
|
+
| `/app-squad` | Kenji → Designer → Giuseppe → Tanya | Build apps end-to-end |
|
|
327
|
+
| `/review-squad` | Svetlana + Lars + Tanya | Code review with auto-fix |
|
|
328
|
+
| `/config-squad` | Helga → Alejandro → Viktor | Workflow + fields + insights |
|
|
329
|
+
| `/hotfix-squad` | Tanya → Simple Writer → Svetlana | Quick bug fixes |
|
|
330
|
+
| `/debug-squad` | Kenji + Viktor + Svetlana + Tanya | Parallel investigation |
|
|
331
|
+
| `/swarm <desc>` | Auto-selected | Large-scale parallel work |
|
|
332
|
+
|
|
333
|
+
More squads + full command list: `/help:commands`
|
|
334
|
+
</commands>
|
|
335
|
+
|
|
336
|
+
<directory>
|
|
337
|
+
## Project Structure
|
|
338
|
+
|
|
339
|
+
```
|
|
340
|
+
workspace/ # Hailer config - check FIRST for IDs
|
|
341
|
+
apps/ # Frontend apps
|
|
342
|
+
integrations/ # Backend services
|
|
343
|
+
.claude/ # Agents, hooks, skills, commands (project-local)
|
|
344
|
+
DEVELOPMENT.md # Project status
|
|
345
|
+
```
|
|
346
|
+
</directory>
|
|
347
|
+
|
|
348
|
+
<sdk-gotchas>
|
|
349
|
+
## Hailer SDK Quick Reference
|
|
350
|
+
|
|
351
|
+
Common pitfalls that cause debugging loops - check these FIRST:
|
|
352
|
+
|
|
353
|
+
| Gotcha | Correct | Wrong |
|
|
354
|
+
|--------|---------|-------|
|
|
355
|
+
| Activity field updates | `{type: "string", value: "x"}` wrapper | Raw value `"x"` |
|
|
356
|
+
| `linkedfrom` in isolated-vm | Does NOT work - use ActivityLink field instead | Trying cross-link resolution |
|
|
357
|
+
| Code in isolated-vm | Plain JavaScript only | TypeScript syntax (`as`, type annotations) |
|
|
358
|
+
| Phase transitions | Exact string: `"Uudet"` → `"Tehty"` | Guessed names |
|
|
359
|
+
| Field IDs | Read from workspace/ files | Guessing from labels |
|
|
360
|
+
| Dropdown values | `{data: [{value, label}]}` | `{options: [...]}` |
|
|
361
|
+
| ActivityLink format | Plain string array of workflow IDs | Nested objects |
|
|
362
|
+
|
|
363
|
+
**Rule:** When touching Hailer fields, ALWAYS read workspace/ first via Kenji. Never guess IDs or formats.
|
|
364
|
+
</sdk-gotchas>
|
|
365
|
+
|
|
366
|
+
<bulk-operations>
|
|
367
|
+
## Bulk Tasks
|
|
368
|
+
|
|
369
|
+
For repetitive edits, use `/swarm` or headless mode (`claude -p "..." --allowedTools "Edit,Read,Grep,Glob"`). Act first — grep to find instances, then edit immediately.
|
|
370
|
+
</bulk-operations>
|
package/dist/app.d.ts
CHANGED
package/dist/app.js
CHANGED
|
@@ -3,21 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const core_1 = require("./core");
|
|
4
4
|
const config_1 = require("./config");
|
|
5
5
|
const logger_1 = require("./lib/logger");
|
|
6
|
-
const tool_registry_1 = require("./mcp/tool-registry");
|
|
7
|
-
const stdio_server_1 = require("./stdio-server");
|
|
8
6
|
const logger = (0, logger_1.createLogger)({ component: 'app' });
|
|
9
|
-
// Detect transport mode:
|
|
10
|
-
// - MCP_TRANSPORT=stdio - explicit stdio mode
|
|
11
|
-
// - MCP_TRANSPORT=http - explicit HTTP mode
|
|
12
|
-
// - No TTY on stdin - Claude Desktop spawned process, use stdio
|
|
13
|
-
// - TTY on stdin - manual terminal run, use HTTP
|
|
14
|
-
const transportMode = process.env.MCP_TRANSPORT || (process.stdin.isTTY ? 'http' : 'stdio');
|
|
15
|
-
const isStdioMode = transportMode === 'stdio';
|
|
16
|
-
logger.info('Transport mode detected', {
|
|
17
|
-
mode: transportMode,
|
|
18
|
-
isTTY: process.stdin.isTTY,
|
|
19
|
-
isStdioMode
|
|
20
|
-
});
|
|
21
7
|
const file_1 = require("./mcp/tools/file");
|
|
22
8
|
const activity_1 = require("./mcp/tools/activity");
|
|
23
9
|
const discussion_1 = require("./mcp/tools/discussion");
|
|
@@ -25,104 +11,118 @@ const user_1 = require("./mcp/tools/user");
|
|
|
25
11
|
const workflow_1 = require("./mcp/tools/workflow");
|
|
26
12
|
const insight_1 = require("./mcp/tools/insight");
|
|
27
13
|
const app_1 = require("./mcp/tools/app");
|
|
28
|
-
|
|
29
|
-
//
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
core.addTool(tool);
|
|
40
|
-
}
|
|
41
|
-
};
|
|
42
|
-
logger.info('Registering tools...');
|
|
43
|
-
logger.info('Nuclear tools status', { enabled: config_1.environment.ENABLE_NUCLEAR_TOOLS });
|
|
44
|
-
addTool(file_1.uploadFilesTool);
|
|
45
|
-
addTool(file_1.downloadFileTool);
|
|
46
|
-
addTool(activity_1.listActivitiesTool);
|
|
47
|
-
addTool(activity_1.showActivityByIdTool);
|
|
48
|
-
addTool(activity_1.createActivityTool);
|
|
49
|
-
addTool(activity_1.updateActivityTool);
|
|
14
|
+
// Bot config and bug-fixer tools are dynamically imported only when MCP_CLIENT_ENABLED=true
|
|
15
|
+
// This allows the npm package to work without these modules
|
|
16
|
+
const core = new core_1.Core();
|
|
17
|
+
logger.debug('Registering tools...');
|
|
18
|
+
logger.debug('Nuclear tools status', { enabled: config_1.environment.ENABLE_NUCLEAR_TOOLS });
|
|
19
|
+
core.addTool(file_1.uploadFilesTool);
|
|
20
|
+
core.addTool(file_1.downloadFileTool);
|
|
21
|
+
core.addTool(activity_1.listActivitiesTool);
|
|
22
|
+
core.addTool(activity_1.showActivityByIdTool);
|
|
23
|
+
core.addTool(activity_1.createActivityTool);
|
|
24
|
+
core.addTool(activity_1.updateActivityTool);
|
|
50
25
|
// core.addTool(searchActivitiesTool);
|
|
51
26
|
// core.addTool(filterActivitiesTool);
|
|
52
27
|
// core.addTool(activityToolsGuideTool);
|
|
53
|
-
addTool(discussion_1.listMyDiscussionsTool);
|
|
54
|
-
addTool(discussion_1.fetchDiscussionMessagesTool);
|
|
55
|
-
addTool(discussion_1.fetchPreviousDiscussionMessagesTool);
|
|
56
|
-
addTool(discussion_1.joinDiscussionTool);
|
|
57
|
-
addTool(discussion_1.leaveDiscussionTool);
|
|
58
|
-
addTool(discussion_1.addDiscussionMessageTool);
|
|
59
|
-
addTool(discussion_1.inviteDiscussionMembersTool);
|
|
60
|
-
addTool(discussion_1.getActivityFromDiscussionTool);
|
|
61
|
-
addTool(user_1.
|
|
62
|
-
addTool(user_1.
|
|
63
|
-
addTool(
|
|
64
|
-
addTool(
|
|
65
|
-
addTool(workflow_1.
|
|
66
|
-
addTool(workflow_1.
|
|
67
|
-
addTool(workflow_1.
|
|
28
|
+
core.addTool(discussion_1.listMyDiscussionsTool);
|
|
29
|
+
core.addTool(discussion_1.fetchDiscussionMessagesTool);
|
|
30
|
+
core.addTool(discussion_1.fetchPreviousDiscussionMessagesTool);
|
|
31
|
+
core.addTool(discussion_1.joinDiscussionTool);
|
|
32
|
+
core.addTool(discussion_1.leaveDiscussionTool);
|
|
33
|
+
core.addTool(discussion_1.addDiscussionMessageTool);
|
|
34
|
+
core.addTool(discussion_1.inviteDiscussionMembersTool);
|
|
35
|
+
core.addTool(discussion_1.getActivityFromDiscussionTool);
|
|
36
|
+
core.addTool(user_1.searchWorkspaceUsersTool);
|
|
37
|
+
core.addTool(user_1.getWorkspaceBalanceTool);
|
|
38
|
+
// core.addTool(hailerGetInitTool);
|
|
39
|
+
// core.addTool(validateUserIdTool);
|
|
40
|
+
core.addTool(workflow_1.getWorkflowSchemaTool);
|
|
41
|
+
core.addTool(workflow_1.listWorkflowPhasesTool);
|
|
42
|
+
core.addTool(workflow_1.listWorkflowsTool);
|
|
43
|
+
core.addTool(workflow_1.installWorkflowTool);
|
|
68
44
|
if (config_1.environment.ENABLE_NUCLEAR_TOOLS) {
|
|
69
|
-
addTool(workflow_1.removeWorkflowTool);
|
|
45
|
+
core.addTool(workflow_1.removeWorkflowTool);
|
|
70
46
|
}
|
|
71
|
-
addTool(workflow_1.updateWorkflowFieldTool);
|
|
72
|
-
addTool(workflow_1.updateWorkflowPhaseTool);
|
|
73
|
-
addTool(workflow_1.testFunctionFieldTool);
|
|
74
|
-
addTool(workflow_1.listWorkflowsMinimalTool);
|
|
75
|
-
addTool(workflow_1.countActivitiesTool);
|
|
76
|
-
addTool(
|
|
77
|
-
addTool(insight_1.
|
|
78
|
-
addTool(insight_1.
|
|
79
|
-
addTool(insight_1.
|
|
47
|
+
core.addTool(workflow_1.updateWorkflowFieldTool);
|
|
48
|
+
core.addTool(workflow_1.updateWorkflowPhaseTool);
|
|
49
|
+
core.addTool(workflow_1.testFunctionFieldTool);
|
|
50
|
+
core.addTool(workflow_1.listWorkflowsMinimalTool);
|
|
51
|
+
core.addTool(workflow_1.countActivitiesTool);
|
|
52
|
+
core.addTool(workflow_1.coreInitTool);
|
|
53
|
+
core.addTool(insight_1.createInsightTool);
|
|
54
|
+
core.addTool(insight_1.previewInsightTool);
|
|
55
|
+
core.addTool(insight_1.getInsightDataTool);
|
|
56
|
+
core.addTool(insight_1.updateInsightTool);
|
|
80
57
|
if (config_1.environment.ENABLE_NUCLEAR_TOOLS) {
|
|
81
|
-
addTool(insight_1.removeInsightTool);
|
|
58
|
+
core.addTool(insight_1.removeInsightTool);
|
|
82
59
|
}
|
|
83
|
-
addTool(insight_1.listInsightsTool);
|
|
84
|
-
addTool(app_1.createAppTool);
|
|
85
|
-
addTool(app_1.listAppsTool);
|
|
86
|
-
addTool(app_1.updateAppTool);
|
|
60
|
+
core.addTool(insight_1.listInsightsTool);
|
|
61
|
+
core.addTool(app_1.createAppTool);
|
|
62
|
+
core.addTool(app_1.listAppsTool);
|
|
63
|
+
core.addTool(app_1.updateAppTool);
|
|
87
64
|
if (config_1.environment.ENABLE_NUCLEAR_TOOLS) {
|
|
88
|
-
addTool(app_1.removeAppTool);
|
|
65
|
+
core.addTool(app_1.removeAppTool);
|
|
89
66
|
}
|
|
90
|
-
addTool(app_1.addAppMemberTool);
|
|
91
|
-
addTool(app_1.removeAppMemberTool);
|
|
92
|
-
addTool(app_1.scaffoldHailerAppTool);
|
|
93
|
-
addTool(app_1.publishHailerAppTool);
|
|
67
|
+
core.addTool(app_1.addAppMemberTool);
|
|
68
|
+
core.addTool(app_1.removeAppMemberTool);
|
|
69
|
+
core.addTool(app_1.scaffoldHailerAppTool);
|
|
70
|
+
core.addTool(app_1.publishHailerAppTool);
|
|
94
71
|
// Marketplace template tools
|
|
95
|
-
addTool(app_1.listTemplatesTool);
|
|
96
|
-
addTool(app_1.createTemplateTool);
|
|
97
|
-
addTool(app_1.installTemplateTool);
|
|
98
|
-
addTool(app_1.getTemplateTool);
|
|
99
|
-
addTool(app_1.publishTemplateTool);
|
|
100
|
-
addTool(app_1.getProductTool);
|
|
101
|
-
addTool(app_1.getProductManifestTool);
|
|
72
|
+
core.addTool(app_1.listTemplatesTool);
|
|
73
|
+
core.addTool(app_1.createTemplateTool);
|
|
74
|
+
core.addTool(app_1.installTemplateTool);
|
|
75
|
+
core.addTool(app_1.getTemplateTool);
|
|
76
|
+
core.addTool(app_1.publishTemplateTool);
|
|
77
|
+
core.addTool(app_1.getProductTool);
|
|
78
|
+
core.addTool(app_1.getProductManifestTool);
|
|
102
79
|
// Marketplace app tools
|
|
103
|
-
addTool(app_1.publishAppTool);
|
|
104
|
-
addTool(app_1.installMarketplaceAppTool);
|
|
105
|
-
//
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
//
|
|
121
|
-
core.
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
80
|
+
core.addTool(app_1.publishAppTool);
|
|
81
|
+
core.addTool(app_1.installMarketplaceAppTool);
|
|
82
|
+
// Bot-internal tools - dynamically imported only when MCP_CLIENT_ENABLED=true
|
|
83
|
+
// This allows npm package to work without bot-config and bug-fixer modules
|
|
84
|
+
if (config_1.environment.MCP_CLIENT_ENABLED) {
|
|
85
|
+
// Dynamic import bot-config tools
|
|
86
|
+
const { listBotsConfigTool, enableBotTool, disableBotTool, checkSpecialistStatusTool } = require('./bot-config');
|
|
87
|
+
core.addTool(listBotsConfigTool);
|
|
88
|
+
core.addTool(enableBotTool);
|
|
89
|
+
core.addTool(disableBotTool);
|
|
90
|
+
core.addTool(checkSpecialistStatusTool);
|
|
91
|
+
// Dynamic import bug-fixer tools
|
|
92
|
+
const {
|
|
93
|
+
// Low-level tools
|
|
94
|
+
bugFixerFindAppTool, bugFixerListFilesTool, bugFixerReadFileTool, bugFixerWriteFileTool, bugFixerApplyFixTool, bugFixerRunBuildTool, bugFixerGitStatusTool, bugFixerGitPullTool, bugFixerGitCommitTool, bugFixerGitPushTool, bugFixerGitRevertTool, bugFixerPublishAppTool,
|
|
95
|
+
// High-level workflow tools (LLM-driven)
|
|
96
|
+
bugFixerAnalyzeBugTool, bugFixerStartFixTool, bugFixerMarkDeclinedTool, bugFixerPublishFixTool, bugFixerRetryFixTool, markBugDeclinedTool, markBugFixedTool } = require('./plugins/bug-fixer');
|
|
97
|
+
// Low-level tools
|
|
98
|
+
core.addTool(bugFixerFindAppTool);
|
|
99
|
+
core.addTool(bugFixerListFilesTool);
|
|
100
|
+
core.addTool(bugFixerReadFileTool);
|
|
101
|
+
core.addTool(bugFixerWriteFileTool);
|
|
102
|
+
core.addTool(bugFixerApplyFixTool);
|
|
103
|
+
core.addTool(bugFixerRunBuildTool);
|
|
104
|
+
core.addTool(bugFixerGitStatusTool);
|
|
105
|
+
core.addTool(bugFixerGitPullTool);
|
|
106
|
+
core.addTool(bugFixerGitCommitTool);
|
|
107
|
+
core.addTool(bugFixerGitPushTool);
|
|
108
|
+
core.addTool(bugFixerGitRevertTool);
|
|
109
|
+
core.addTool(bugFixerPublishAppTool);
|
|
110
|
+
// High-level workflow tools (LLM-driven)
|
|
111
|
+
core.addTool(bugFixerAnalyzeBugTool);
|
|
112
|
+
core.addTool(bugFixerStartFixTool);
|
|
113
|
+
core.addTool(bugFixerMarkDeclinedTool);
|
|
114
|
+
core.addTool(bugFixerPublishFixTool);
|
|
115
|
+
core.addTool(bugFixerRetryFixTool);
|
|
116
|
+
core.addTool(markBugDeclinedTool);
|
|
117
|
+
core.addTool(markBugFixedTool);
|
|
118
|
+
logger.debug('Bot-internal tools registered (MCP_CLIENT_ENABLED=true)');
|
|
125
119
|
}
|
|
126
|
-
|
|
120
|
+
logger.debug('All tools registered successfully');
|
|
121
|
+
// Start the application
|
|
122
|
+
core.start().catch((error) => {
|
|
123
|
+
logger.error('Failed to start Hailer MCP application', error);
|
|
124
|
+
process.exit(1);
|
|
125
|
+
});
|
|
126
|
+
// Export core for testing and external access
|
|
127
127
|
exports.default = core;
|
|
128
128
|
//# sourceMappingURL=app.js.map
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bot Config Reader
|
|
3
|
+
*
|
|
4
|
+
* Simple config reader for .bot-config/*.json files.
|
|
5
|
+
* Extracts orchestrator credentials into a flat BotConfig interface.
|
|
6
|
+
*/
|
|
7
|
+
export interface BotConfig {
|
|
8
|
+
workspaceId: string;
|
|
9
|
+
workspaceName: string;
|
|
10
|
+
email: string;
|
|
11
|
+
password: string;
|
|
12
|
+
displayName?: string;
|
|
13
|
+
enabled: boolean;
|
|
14
|
+
apiHost: string;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Load all bot configs from .bot-config/*.json files.
|
|
18
|
+
* Extracts orchestrator credentials into flat BotConfig objects.
|
|
19
|
+
*/
|
|
20
|
+
export declare function loadBotConfigs(): BotConfig[];
|
|
21
|
+
/**
|
|
22
|
+
* Save a BotConfig to .bot-config/{workspaceId}.json.
|
|
23
|
+
* Preserves the existing file structure, updating orchestrator credentials.
|
|
24
|
+
*/
|
|
25
|
+
export declare function saveBotConfig(config: BotConfig): void;
|
|
26
|
+
//# sourceMappingURL=bot-config.d.ts.map
|