crewx 0.3.0 → 0.4.0-dev.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/crewx.js +6 -0
- package/package.json +9 -107
- package/LICENSE +0 -201
- package/README.md +0 -234
- package/crewx.yaml +0 -2069
- package/dist/agent.types.d.ts +0 -117
- package/dist/agent.types.js +0 -16
- package/dist/agent.types.js.map +0 -1
- package/dist/ai-provider.service.d.ts +0 -36
- package/dist/ai-provider.service.js +0 -191
- package/dist/ai-provider.service.js.map +0 -1
- package/dist/ai.service.d.ts +0 -57
- package/dist/ai.service.js +0 -629
- package/dist/ai.service.js.map +0 -1
- package/dist/app.module.d.ts +0 -5
- package/dist/app.module.js +0 -103
- package/dist/app.module.js.map +0 -1
- package/dist/cli/agent.handler.d.ts +0 -2
- package/dist/cli/agent.handler.js +0 -140
- package/dist/cli/agent.handler.js.map +0 -1
- package/dist/cli/chat.handler.d.ts +0 -19
- package/dist/cli/chat.handler.js +0 -431
- package/dist/cli/chat.handler.js.map +0 -1
- package/dist/cli/cli.handler.d.ts +0 -4
- package/dist/cli/cli.handler.js +0 -97
- package/dist/cli/cli.handler.js.map +0 -1
- package/dist/cli/doctor.handler.d.ts +0 -36
- package/dist/cli/doctor.handler.js +0 -382
- package/dist/cli/doctor.handler.js.map +0 -1
- package/dist/cli/execute.handler.d.ts +0 -2
- package/dist/cli/execute.handler.js +0 -319
- package/dist/cli/execute.handler.js.map +0 -1
- package/dist/cli/help.handler.d.ts +0 -2
- package/dist/cli/help.handler.js +0 -10
- package/dist/cli/help.handler.js.map +0 -1
- package/dist/cli/init.handler.d.ts +0 -26
- package/dist/cli/init.handler.js +0 -450
- package/dist/cli/init.handler.js.map +0 -1
- package/dist/cli/mcp.handler.d.ts +0 -3
- package/dist/cli/mcp.handler.js +0 -121
- package/dist/cli/mcp.handler.js.map +0 -1
- package/dist/cli/query.handler.d.ts +0 -2
- package/dist/cli/query.handler.js +0 -380
- package/dist/cli/query.handler.js.map +0 -1
- package/dist/cli/templates.handler.d.ts +0 -2
- package/dist/cli/templates.handler.js +0 -100
- package/dist/cli/templates.handler.js.map +0 -1
- package/dist/cli-options.d.ts +0 -29
- package/dist/cli-options.js +0 -234
- package/dist/cli-options.js.map +0 -1
- package/dist/config/timeout.config.d.ts +0 -14
- package/dist/config/timeout.config.js +0 -34
- package/dist/config/timeout.config.js.map +0 -1
- package/dist/constants.d.ts +0 -4
- package/dist/constants.js +0 -8
- package/dist/constants.js.map +0 -1
- package/dist/conversation/base-conversation-history.provider.d.ts +0 -12
- package/dist/conversation/base-conversation-history.provider.js +0 -45
- package/dist/conversation/base-conversation-history.provider.js.map +0 -1
- package/dist/conversation/cli-conversation-history.provider.d.ts +0 -16
- package/dist/conversation/cli-conversation-history.provider.js +0 -111
- package/dist/conversation/cli-conversation-history.provider.js.map +0 -1
- package/dist/conversation/conversation-config.d.ts +0 -9
- package/dist/conversation/conversation-config.js +0 -25
- package/dist/conversation/conversation-config.js.map +0 -1
- package/dist/conversation/conversation-history.interface.d.ts +0 -25
- package/dist/conversation/conversation-history.interface.js +0 -3
- package/dist/conversation/conversation-history.interface.js.map +0 -1
- package/dist/conversation/conversation-provider.factory.d.ts +0 -10
- package/dist/conversation/conversation-provider.factory.js +0 -50
- package/dist/conversation/conversation-provider.factory.js.map +0 -1
- package/dist/conversation/conversation-storage.service.d.ts +0 -16
- package/dist/conversation/conversation-storage.service.js +0 -220
- package/dist/conversation/conversation-storage.service.js.map +0 -1
- package/dist/conversation/index.d.ts +0 -7
- package/dist/conversation/index.js +0 -24
- package/dist/conversation/index.js.map +0 -1
- package/dist/conversation/slack-conversation-history.provider.d.ts +0 -28
- package/dist/conversation/slack-conversation-history.provider.js +0 -278
- package/dist/conversation/slack-conversation-history.provider.js.map +0 -1
- package/dist/crewx.tool.d.ts +0 -332
- package/dist/crewx.tool.js +0 -1463
- package/dist/crewx.tool.js.map +0 -1
- package/dist/guards/bearer-auth.guard.d.ts +0 -7
- package/dist/guards/bearer-auth.guard.js +0 -44
- package/dist/guards/bearer-auth.guard.js.map +0 -1
- package/dist/health.controller.d.ts +0 -6
- package/dist/health.controller.js +0 -32
- package/dist/health.controller.js.map +0 -1
- package/dist/knowledge/DocumentManager.d.ts +0 -4
- package/dist/knowledge/DocumentManager.js +0 -119
- package/dist/knowledge/DocumentManager.js.map +0 -1
- package/dist/main.d.ts +0 -1
- package/dist/main.js +0 -268
- package/dist/main.js.map +0 -1
- package/dist/mcp.controller.d.ts +0 -8
- package/dist/mcp.controller.js +0 -62
- package/dist/mcp.controller.js.map +0 -1
- package/dist/project.service.d.ts +0 -44
- package/dist/project.service.js +0 -299
- package/dist/project.service.js.map +0 -1
- package/dist/providers/ai-provider.interface.d.ts +0 -50
- package/dist/providers/ai-provider.interface.js +0 -23
- package/dist/providers/ai-provider.interface.js.map +0 -1
- package/dist/providers/base-ai.provider.d.ts +0 -50
- package/dist/providers/base-ai.provider.js +0 -624
- package/dist/providers/base-ai.provider.js.map +0 -1
- package/dist/providers/claude.provider.d.ts +0 -25
- package/dist/providers/claude.provider.js +0 -362
- package/dist/providers/claude.provider.js.map +0 -1
- package/dist/providers/codex.provider.d.ts +0 -17
- package/dist/providers/codex.provider.js +0 -99
- package/dist/providers/codex.provider.js.map +0 -1
- package/dist/providers/copilot.provider.d.ts +0 -25
- package/dist/providers/copilot.provider.js +0 -266
- package/dist/providers/copilot.provider.js.map +0 -1
- package/dist/providers/dynamic-provider.factory.d.ts +0 -55
- package/dist/providers/dynamic-provider.factory.js +0 -587
- package/dist/providers/dynamic-provider.factory.js.map +0 -1
- package/dist/providers/gemini.provider.d.ts +0 -22
- package/dist/providers/gemini.provider.js +0 -147
- package/dist/providers/gemini.provider.js.map +0 -1
- package/dist/services/agent-loader.service.d.ts +0 -29
- package/dist/services/agent-loader.service.js +0 -370
- package/dist/services/agent-loader.service.js.map +0 -1
- package/dist/services/auth.service.d.ts +0 -9
- package/dist/services/auth.service.js +0 -47
- package/dist/services/auth.service.js.map +0 -1
- package/dist/services/config-validator.service.d.ts +0 -28
- package/dist/services/config-validator.service.js +0 -467
- package/dist/services/config-validator.service.js.map +0 -1
- package/dist/services/config.service.d.ts +0 -45
- package/dist/services/config.service.js +0 -180
- package/dist/services/config.service.js.map +0 -1
- package/dist/services/context-enhancement.service.d.ts +0 -13
- package/dist/services/context-enhancement.service.js +0 -169
- package/dist/services/context-enhancement.service.js.map +0 -1
- package/dist/services/document-loader.service.d.ts +0 -16
- package/dist/services/document-loader.service.js +0 -137
- package/dist/services/document-loader.service.js.map +0 -1
- package/dist/services/help.service.d.ts +0 -5
- package/dist/services/help.service.js +0 -117
- package/dist/services/help.service.js.map +0 -1
- package/dist/services/intelligent-compression.service.d.ts +0 -20
- package/dist/services/intelligent-compression.service.js +0 -179
- package/dist/services/intelligent-compression.service.js.map +0 -1
- package/dist/services/mcp-client.service.d.ts +0 -26
- package/dist/services/mcp-client.service.js +0 -81
- package/dist/services/mcp-client.service.js.map +0 -1
- package/dist/services/parallel-processing.service.d.ts +0 -108
- package/dist/services/parallel-processing.service.js +0 -268
- package/dist/services/parallel-processing.service.js.map +0 -1
- package/dist/services/remote-agent.service.d.ts +0 -49
- package/dist/services/remote-agent.service.js +0 -215
- package/dist/services/remote-agent.service.js.map +0 -1
- package/dist/services/result-formatter.service.d.ts +0 -27
- package/dist/services/result-formatter.service.js +0 -126
- package/dist/services/result-formatter.service.js.map +0 -1
- package/dist/services/task-management.service.d.ts +0 -63
- package/dist/services/task-management.service.js +0 -272
- package/dist/services/task-management.service.js.map +0 -1
- package/dist/services/template.service.d.ts +0 -36
- package/dist/services/template.service.js +0 -195
- package/dist/services/template.service.js.map +0 -1
- package/dist/services/tool-call.service.d.ts +0 -53
- package/dist/services/tool-call.service.js +0 -1061
- package/dist/services/tool-call.service.js.map +0 -1
- package/dist/slack/formatters/message.formatter.d.ts +0 -25
- package/dist/slack/formatters/message.formatter.js +0 -246
- package/dist/slack/formatters/message.formatter.js.map +0 -1
- package/dist/slack/slack-bot.d.ts +0 -24
- package/dist/slack/slack-bot.js +0 -467
- package/dist/slack/slack-bot.js.map +0 -1
- package/dist/stderr.logger.d.ts +0 -8
- package/dist/stderr.logger.js +0 -26
- package/dist/stderr.logger.js.map +0 -1
- package/dist/tsconfig.tsbuildinfo +0 -1
- package/dist/utils/config-utils.d.ts +0 -15
- package/dist/utils/config-utils.js +0 -69
- package/dist/utils/config-utils.js.map +0 -1
- package/dist/utils/error-utils.d.ts +0 -3
- package/dist/utils/error-utils.js +0 -27
- package/dist/utils/error-utils.js.map +0 -1
- package/dist/utils/math-utils.d.ts +0 -3
- package/dist/utils/math-utils.js +0 -10
- package/dist/utils/math-utils.js.map +0 -1
- package/dist/utils/mcp-installer.d.ts +0 -20
- package/dist/utils/mcp-installer.js +0 -199
- package/dist/utils/mcp-installer.js.map +0 -1
- package/dist/utils/mention-parser.d.ts +0 -18
- package/dist/utils/mention-parser.js +0 -136
- package/dist/utils/mention-parser.js.map +0 -1
- package/dist/utils/simple-security.d.ts +0 -3
- package/dist/utils/simple-security.js +0 -20
- package/dist/utils/simple-security.js.map +0 -1
- package/dist/utils/stdin-utils.d.ts +0 -27
- package/dist/utils/stdin-utils.js +0 -130
- package/dist/utils/stdin-utils.js.map +0 -1
- package/dist/utils/string-utils.d.ts +0 -1
- package/dist/utils/string-utils.js +0 -10
- package/dist/utils/string-utils.js.map +0 -1
- package/dist/utils/template-processor.d.ts +0 -32
- package/dist/utils/template-processor.js +0 -202
- package/dist/utils/template-processor.js.map +0 -1
- package/dist/version.d.ts +0 -1
- package/dist/version.js +0 -17
- package/dist/version.js.map +0 -1
- package/docs/CLA.md +0 -88
- package/docs/agent-configuration.md +0 -364
- package/docs/agent-registry-strategy.md +0 -348
- package/docs/branding-decision-crewx.md +0 -395
- package/docs/claude-code-docker-guide.md +0 -264
- package/docs/cli-guide.md +0 -439
- package/docs/development.md +0 -595
- package/docs/diagram1.svg +0 -1
- package/docs/guides/agent-best-practices.md +0 -97
- package/docs/guides/bug-management.md +0 -600
- package/docs/guides/git-bug-reference.md +0 -366
- package/docs/mcp-integration.md +0 -187
- package/docs/process/development-workflow.md +0 -84
- package/docs/remote-agents.md +0 -555
- package/docs/roadmap.md +0 -528
- package/docs/rules/branch-protection.md +0 -40
- package/docs/standards/rc-versioning.md +0 -60
- package/docs/standards/report-structure.md +0 -67
- package/docs/template-variables.md +0 -382
- package/docs/templates.md +0 -517
- package/docs/tools.md +0 -583
- package/docs/troubleshooting.md +0 -611
- package/templates/agents/default.yaml +0 -938
- package/templates/agents/minimal.yaml +0 -25
- package/templates/documents/crewcode-manual.md +0 -292
- package/templates/versions.json +0 -19
|
@@ -1,382 +0,0 @@
|
|
|
1
|
-
# Template Variables Reference
|
|
2
|
-
|
|
3
|
-
This document describes the Handlebars variables and helpers available in CrewX agent templates (agents.yaml).
|
|
4
|
-
|
|
5
|
-
All variables are processed by `src/utils/template-processor.ts` using Handlebars templating engine.
|
|
6
|
-
|
|
7
|
-
## Document Variables
|
|
8
|
-
|
|
9
|
-
Access loaded documents from `.crewx/docs/` directory:
|
|
10
|
-
|
|
11
|
-
```handlebars
|
|
12
|
-
{{{documents.doc-name.content}}} # Full document content
|
|
13
|
-
{{{documents.doc-name.toc}}} # Table of contents (headings only)
|
|
14
|
-
{{documents.doc-name.summary}} # Document summary
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
**Example:**
|
|
18
|
-
```yaml
|
|
19
|
-
system_prompt: |
|
|
20
|
-
You are a developer assistant.
|
|
21
|
-
|
|
22
|
-
{{{documents.coding-standards.content}}}
|
|
23
|
-
|
|
24
|
-
Project structure:
|
|
25
|
-
{{{documents.project-structure.toc}}}
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
**Notes:**
|
|
29
|
-
- Document names use hyphens (e.g., `coding-standards`, `project-structure`)
|
|
30
|
-
- Documents are loaded from `.crewx/docs/<doc-name>.md`
|
|
31
|
-
- Use triple braces `{{{ }}}` to preserve formatting (no HTML escaping)
|
|
32
|
-
|
|
33
|
-
## Environment Variables
|
|
34
|
-
|
|
35
|
-
Access environment variables:
|
|
36
|
-
|
|
37
|
-
```handlebars
|
|
38
|
-
{{env.VARIABLE_NAME}} # Read environment variable
|
|
39
|
-
{{#if env.DEBUG}}...{{/if}} # Conditional based on env var
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
**Example:**
|
|
43
|
-
```yaml
|
|
44
|
-
system_prompt: |
|
|
45
|
-
{{#if env.DEBUG}}
|
|
46
|
-
Debug mode is enabled. Provide detailed logs.
|
|
47
|
-
{{else}}
|
|
48
|
-
Production mode. Be concise.
|
|
49
|
-
{{/if}}
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
## Agent Metadata
|
|
53
|
-
|
|
54
|
-
Access current agent properties:
|
|
55
|
-
|
|
56
|
-
```handlebars
|
|
57
|
-
{{agent.id}} # Agent ID (e.g., "claude", "gemini")
|
|
58
|
-
{{agent.name}} # Agent display name
|
|
59
|
-
{{agent.provider}} # Provider (e.g., "claude", "gemini", "copilot")
|
|
60
|
-
{{agent.model}} # Model name (if specified)
|
|
61
|
-
{{agent.workingDirectory}} # Working directory path
|
|
62
|
-
```
|
|
63
|
-
|
|
64
|
-
**Example:**
|
|
65
|
-
```yaml
|
|
66
|
-
system_prompt: |
|
|
67
|
-
You are {{agent.name}} ({{agent.id}}).
|
|
68
|
-
Provider: {{agent.provider}}
|
|
69
|
-
{{#if agent.model}}Model: {{agent.model}}{{/if}}
|
|
70
|
-
```
|
|
71
|
-
|
|
72
|
-
## Mode
|
|
73
|
-
|
|
74
|
-
Detect query vs execute mode:
|
|
75
|
-
|
|
76
|
-
```handlebars
|
|
77
|
-
{{mode}} # "query" or "execute"
|
|
78
|
-
{{#if (eq mode "query")}}...{{/if}} # Query mode condition
|
|
79
|
-
{{#if (eq mode "execute")}}...{{/if}} # Execute mode condition
|
|
80
|
-
```
|
|
81
|
-
|
|
82
|
-
**Example:**
|
|
83
|
-
```yaml
|
|
84
|
-
system_prompt: |
|
|
85
|
-
{{#if (eq mode "query")}}
|
|
86
|
-
Read-only mode. Analyze and explain, but don't modify files.
|
|
87
|
-
{{else}}
|
|
88
|
-
Execute mode. You can modify files and make changes.
|
|
89
|
-
{{/if}}
|
|
90
|
-
```
|
|
91
|
-
|
|
92
|
-
## Platform
|
|
93
|
-
|
|
94
|
-
Detect CLI vs Slack platform:
|
|
95
|
-
|
|
96
|
-
```handlebars
|
|
97
|
-
{{platform}} # "cli" or "slack"
|
|
98
|
-
{{#if (eq platform "slack")}}...{{/if}} # Slack-specific instructions
|
|
99
|
-
```
|
|
100
|
-
|
|
101
|
-
**Example:**
|
|
102
|
-
```yaml
|
|
103
|
-
system_prompt: |
|
|
104
|
-
{{#if (eq platform "slack")}}
|
|
105
|
-
You are in a Slack thread. Keep responses concise.
|
|
106
|
-
{{else}}
|
|
107
|
-
CLI mode. You can provide detailed output.
|
|
108
|
-
{{/if}}
|
|
109
|
-
```
|
|
110
|
-
|
|
111
|
-
## CLI Options
|
|
112
|
-
|
|
113
|
-
Access CLI flags passed to agent:
|
|
114
|
-
|
|
115
|
-
```handlebars
|
|
116
|
-
{{options}} # Array of option strings
|
|
117
|
-
{{#if (contains options "--verbose")}}...{{/if}} # Check for specific flag
|
|
118
|
-
```
|
|
119
|
-
|
|
120
|
-
**Example:**
|
|
121
|
-
```yaml
|
|
122
|
-
system_prompt: |
|
|
123
|
-
{{#if (contains options "--verbose")}}
|
|
124
|
-
Verbose mode enabled. Provide detailed explanations.
|
|
125
|
-
{{/if}}
|
|
126
|
-
```
|
|
127
|
-
|
|
128
|
-
## Conversation History
|
|
129
|
-
|
|
130
|
-
Access previous messages in conversation:
|
|
131
|
-
|
|
132
|
-
```handlebars
|
|
133
|
-
{{messages}} # Array of message objects
|
|
134
|
-
{{messages.length}} # Number of messages
|
|
135
|
-
{{{formatConversation messages platform}}} # Formatted conversation
|
|
136
|
-
```
|
|
137
|
-
|
|
138
|
-
**Message Object Structure:**
|
|
139
|
-
```typescript
|
|
140
|
-
{
|
|
141
|
-
text: string; // Message text
|
|
142
|
-
isAssistant: boolean; // true if assistant, false if user
|
|
143
|
-
metadata?: { // Optional platform metadata
|
|
144
|
-
slack?: { // Slack-specific info
|
|
145
|
-
user_id: string;
|
|
146
|
-
username: string;
|
|
147
|
-
user_profile: {
|
|
148
|
-
display_name: string;
|
|
149
|
-
real_name: string;
|
|
150
|
-
}
|
|
151
|
-
};
|
|
152
|
-
agent_id?: string; // Agent ID for assistant messages
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
```
|
|
156
|
-
|
|
157
|
-
**Default formatConversation Template:**
|
|
158
|
-
```handlebars
|
|
159
|
-
{{{formatConversation messages platform}}}
|
|
160
|
-
```
|
|
161
|
-
|
|
162
|
-
Output format:
|
|
163
|
-
```
|
|
164
|
-
Previous conversation (3 messages):
|
|
165
|
-
**User**: What's the weather?
|
|
166
|
-
**Assistant (@claude)**: The weather is sunny.
|
|
167
|
-
**User**: Thanks!
|
|
168
|
-
```
|
|
169
|
-
|
|
170
|
-
**Custom formatConversation Template:**
|
|
171
|
-
```handlebars
|
|
172
|
-
{{#formatConversation messages platform}}
|
|
173
|
-
<conversation>
|
|
174
|
-
{{#each messages}}
|
|
175
|
-
{{#if isAssistant}}
|
|
176
|
-
[AI]: {{{text}}}
|
|
177
|
-
{{else}}
|
|
178
|
-
[Human]: {{{text}}}
|
|
179
|
-
{{/if}}
|
|
180
|
-
{{/each}}
|
|
181
|
-
</conversation>
|
|
182
|
-
{{/formatConversation}}
|
|
183
|
-
```
|
|
184
|
-
|
|
185
|
-
**Examples:**
|
|
186
|
-
|
|
187
|
-
Simple history check:
|
|
188
|
-
```yaml
|
|
189
|
-
system_prompt: |
|
|
190
|
-
{{#if messages}}
|
|
191
|
-
Previous conversation ({{messages.length}} messages):
|
|
192
|
-
{{#each messages}}
|
|
193
|
-
- {{#if isAssistant}}Assistant{{else}}User{{/if}}: {{{text}}}
|
|
194
|
-
{{/each}}
|
|
195
|
-
{{/if}}
|
|
196
|
-
```
|
|
197
|
-
|
|
198
|
-
Default formatted conversation:
|
|
199
|
-
```yaml
|
|
200
|
-
system_prompt: |
|
|
201
|
-
{{{formatConversation messages platform}}}
|
|
202
|
-
|
|
203
|
-
Based on the conversation above, continue assisting the user.
|
|
204
|
-
```
|
|
205
|
-
|
|
206
|
-
Custom conversation format:
|
|
207
|
-
```yaml
|
|
208
|
-
system_prompt: |
|
|
209
|
-
{{#formatConversation messages platform}}
|
|
210
|
-
# Chat History
|
|
211
|
-
{{#each messages}}
|
|
212
|
-
{{#if isAssistant}}
|
|
213
|
-
**🤖 AI**: {{{truncate text 1000}}}
|
|
214
|
-
{{else}}
|
|
215
|
-
**👤 User**: {{{text}}}
|
|
216
|
-
{{/if}}
|
|
217
|
-
{{/each}}
|
|
218
|
-
{{/formatConversation}}
|
|
219
|
-
```
|
|
220
|
-
|
|
221
|
-
## Tools (Future - Not yet!)
|
|
222
|
-
|
|
223
|
-
Access available MCP tools:
|
|
224
|
-
|
|
225
|
-
```handlebars
|
|
226
|
-
{{tools.list}} # Array of tool objects
|
|
227
|
-
{{tools.count}} # Number of available tools
|
|
228
|
-
{{{tools.json}}} # All tools as JSON string
|
|
229
|
-
```
|
|
230
|
-
|
|
231
|
-
**Tool Object Structure:**
|
|
232
|
-
```typescript
|
|
233
|
-
{
|
|
234
|
-
name: string;
|
|
235
|
-
description: string;
|
|
236
|
-
input_schema: any;
|
|
237
|
-
output_schema?: any;
|
|
238
|
-
}
|
|
239
|
-
```
|
|
240
|
-
|
|
241
|
-
**Example:**
|
|
242
|
-
```yaml
|
|
243
|
-
system_prompt: |
|
|
244
|
-
{{#if tools}}
|
|
245
|
-
You have access to {{tools.count}} MCP tools:
|
|
246
|
-
{{{tools.json}}}
|
|
247
|
-
{{/if}}
|
|
248
|
-
```
|
|
249
|
-
|
|
250
|
-
## Custom Variables (Experimental)
|
|
251
|
-
|
|
252
|
-
Pass custom variables via `vars` context:
|
|
253
|
-
|
|
254
|
-
```handlebars
|
|
255
|
-
{{vars.customKey}} # Access custom variable
|
|
256
|
-
{{#if vars.feature}}...{{/if}} # Conditional on custom var
|
|
257
|
-
```
|
|
258
|
-
|
|
259
|
-
**Note:** Custom variables are set programmatically by CrewX internals, not via YAML configuration.
|
|
260
|
-
|
|
261
|
-
## Handlebars Helpers
|
|
262
|
-
|
|
263
|
-
### Comparison Helpers
|
|
264
|
-
|
|
265
|
-
```handlebars
|
|
266
|
-
{{#if (eq a b)}}...{{/if}} # Equality (===)
|
|
267
|
-
{{#if (ne a b)}}...{{/if}} # Not equal (!==)
|
|
268
|
-
{{#if (contains array value)}}...{{/if}} # Array contains value
|
|
269
|
-
```
|
|
270
|
-
|
|
271
|
-
**Examples:**
|
|
272
|
-
```yaml
|
|
273
|
-
system_prompt: |
|
|
274
|
-
{{#if (eq agent.provider "claude")}}
|
|
275
|
-
Use Claude-specific features.
|
|
276
|
-
{{/if}}
|
|
277
|
-
|
|
278
|
-
{{#if (ne mode "query")}}
|
|
279
|
-
You can modify files.
|
|
280
|
-
{{/if}}
|
|
281
|
-
|
|
282
|
-
{{#if (contains options "--debug")}}
|
|
283
|
-
Debug mode enabled.
|
|
284
|
-
{{/if}}
|
|
285
|
-
```
|
|
286
|
-
|
|
287
|
-
### Logical Helpers
|
|
288
|
-
|
|
289
|
-
```handlebars
|
|
290
|
-
{{#if (and a b)}}...{{/if}} # Logical AND
|
|
291
|
-
{{#if (or a b)}}...{{/if}} # Logical OR
|
|
292
|
-
{{#if (not a)}}...{{/if}} # Logical NOT
|
|
293
|
-
```
|
|
294
|
-
|
|
295
|
-
**Examples:**
|
|
296
|
-
```yaml
|
|
297
|
-
system_prompt: |
|
|
298
|
-
{{#if (and (eq mode "execute") env.ALLOW_WRITES)}}
|
|
299
|
-
You can write files.
|
|
300
|
-
{{/if}}
|
|
301
|
-
|
|
302
|
-
{{#if (or env.DEBUG (contains options "--verbose"))}}
|
|
303
|
-
Verbose output enabled.
|
|
304
|
-
{{/if}}
|
|
305
|
-
|
|
306
|
-
{{#if (not env.PRODUCTION)}}
|
|
307
|
-
Development mode.
|
|
308
|
-
{{/if}}
|
|
309
|
-
```
|
|
310
|
-
|
|
311
|
-
### Data Helpers
|
|
312
|
-
|
|
313
|
-
```handlebars
|
|
314
|
-
{{{json object}}} # JSON.stringify with formatting
|
|
315
|
-
{{truncate text 500}} # Truncate string to max length
|
|
316
|
-
{{length array}} # Array or string length
|
|
317
|
-
```
|
|
318
|
-
|
|
319
|
-
**Examples:**
|
|
320
|
-
```yaml
|
|
321
|
-
system_prompt: |
|
|
322
|
-
Available tools:
|
|
323
|
-
{{{json tools.list}}}
|
|
324
|
-
|
|
325
|
-
Previous context (truncated):
|
|
326
|
-
{{{truncate documents.context.content 1000}}}
|
|
327
|
-
|
|
328
|
-
Message count: {{length messages}}
|
|
329
|
-
```
|
|
330
|
-
|
|
331
|
-
## Complete Example
|
|
332
|
-
|
|
333
|
-
```yaml
|
|
334
|
-
agents:
|
|
335
|
-
- id: crewx_dev
|
|
336
|
-
provider: claude
|
|
337
|
-
system_prompt: |
|
|
338
|
-
You are {{agent.name}}, a developer for the CrewX project.
|
|
339
|
-
|
|
340
|
-
# Project Context
|
|
341
|
-
{{{documents.project-structure.content}}}
|
|
342
|
-
|
|
343
|
-
# Coding Standards
|
|
344
|
-
{{{documents.coding-standards.content}}}
|
|
345
|
-
|
|
346
|
-
# Mode
|
|
347
|
-
{{#if (eq mode "query")}}
|
|
348
|
-
**Query Mode**: Read-only. Analyze and explain without modifications.
|
|
349
|
-
{{else}}
|
|
350
|
-
**Execute Mode**: You can modify files and implement changes.
|
|
351
|
-
{{/if}}
|
|
352
|
-
|
|
353
|
-
# Platform
|
|
354
|
-
{{#if (eq platform "slack")}}
|
|
355
|
-
You are responding in a Slack thread. Keep responses concise.
|
|
356
|
-
{{/if}}
|
|
357
|
-
|
|
358
|
-
# Conversation History
|
|
359
|
-
{{#if messages}}
|
|
360
|
-
{{{formatConversation messages platform}}}
|
|
361
|
-
{{/if}}
|
|
362
|
-
|
|
363
|
-
# Available Tools
|
|
364
|
-
{{#if tools}}
|
|
365
|
-
You have access to {{tools.count}} MCP tools.
|
|
366
|
-
{{/if}}
|
|
367
|
-
|
|
368
|
-
# Environment
|
|
369
|
-
{{#if env.DEBUG}}
|
|
370
|
-
DEBUG mode enabled. Provide detailed logs.
|
|
371
|
-
{{/if}}
|
|
372
|
-
```
|
|
373
|
-
|
|
374
|
-
## Template Loading Order
|
|
375
|
-
|
|
376
|
-
1. **Agent template** (agents.yaml `system_prompt`) is loaded
|
|
377
|
-
2. **Document references** are detected and loaded
|
|
378
|
-
3. **Document content** is processed as Handlebars template (supports nested variables)
|
|
379
|
-
4. **Main template** is compiled and rendered with all context
|
|
380
|
-
|
|
381
|
-
This means documents can also use `{{agent.id}}`, `{{env.VAR}}`, etc. in their content.
|
|
382
|
-
|