tide-commander 0.52.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.
Files changed (140) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +364 -0
  3. package/dist/assets/characters/Textures/colormap.png +0 -0
  4. package/dist/assets/characters/character-female-a.glb +0 -0
  5. package/dist/assets/characters/character-female-b.glb +0 -0
  6. package/dist/assets/characters/character-female-c.glb +0 -0
  7. package/dist/assets/characters/character-female-d.glb +0 -0
  8. package/dist/assets/characters/character-female-e.glb +0 -0
  9. package/dist/assets/characters/character-female-f.glb +0 -0
  10. package/dist/assets/characters/character-male-a-processed.gltf +11862 -0
  11. package/dist/assets/characters/character-male-a.glb +0 -0
  12. package/dist/assets/characters/character-male-b.glb +0 -0
  13. package/dist/assets/characters/character-male-c.glb +0 -0
  14. package/dist/assets/characters/character-male-d.glb +0 -0
  15. package/dist/assets/characters/character-male-e.glb +0 -0
  16. package/dist/assets/characters/character-male-f.glb +0 -0
  17. package/dist/assets/icons/icon-192.png +0 -0
  18. package/dist/assets/icons/icon-512.png +0 -0
  19. package/dist/assets/landing-Cc0MDBAK.css +1 -0
  20. package/dist/assets/main-BIpLsrUu.css +1 -0
  21. package/dist/assets/main-DMTRw3br.js +276 -0
  22. package/dist/assets/textures/concrete_floor_worn_001_diff_1k.jpg +0 -0
  23. package/dist/assets/textures/logo-blanco.png +0 -0
  24. package/dist/assets/vendor-react-uS-d4TUT.js +17 -0
  25. package/dist/assets/vendor-three-4iQNXcoo.js +3828 -0
  26. package/dist/assets/web-BZdi2lG9.js +1 -0
  27. package/dist/assets/web-yHsOO1Qb.js +1 -0
  28. package/dist/index.html +38 -0
  29. package/dist/manifest.json +39 -0
  30. package/dist/src/packages/landing/index.html +463 -0
  31. package/dist/src/packages/server/app.js +87 -0
  32. package/dist/src/packages/server/auth/index.js +121 -0
  33. package/dist/src/packages/server/claude/backend.js +578 -0
  34. package/dist/src/packages/server/claude/index.js +8 -0
  35. package/dist/src/packages/server/claude/runner/internal-events.js +22 -0
  36. package/dist/src/packages/server/claude/runner/process-lifecycle.js +208 -0
  37. package/dist/src/packages/server/claude/runner/recovery-store.js +72 -0
  38. package/dist/src/packages/server/claude/runner/resource-monitor.js +51 -0
  39. package/dist/src/packages/server/claude/runner/restart-policy.js +69 -0
  40. package/dist/src/packages/server/claude/runner/stdout-pipeline.js +153 -0
  41. package/dist/src/packages/server/claude/runner/watchdog.js +114 -0
  42. package/dist/src/packages/server/claude/runner.js +310 -0
  43. package/dist/src/packages/server/claude/session-loader.js +898 -0
  44. package/dist/src/packages/server/claude/types.js +5 -0
  45. package/dist/src/packages/server/cli.js +113 -0
  46. package/dist/src/packages/server/codex/backend.js +119 -0
  47. package/dist/src/packages/server/codex/index.js +2 -0
  48. package/dist/src/packages/server/codex/json-event-parser.js +612 -0
  49. package/dist/src/packages/server/data/builtin-skills/bitbucket-pr.js +298 -0
  50. package/dist/src/packages/server/data/builtin-skills/full-notifications.js +49 -0
  51. package/dist/src/packages/server/data/builtin-skills/git-captain.js +304 -0
  52. package/dist/src/packages/server/data/builtin-skills/index.js +61 -0
  53. package/dist/src/packages/server/data/builtin-skills/pm2-logs.js +354 -0
  54. package/dist/src/packages/server/data/builtin-skills/send-message-to-agent.js +51 -0
  55. package/dist/src/packages/server/data/builtin-skills/server-logs.js +124 -0
  56. package/dist/src/packages/server/data/builtin-skills/streaming-exec.js +94 -0
  57. package/dist/src/packages/server/data/builtin-skills/types.js +4 -0
  58. package/dist/src/packages/server/data/builtin-skills.js +6 -0
  59. package/dist/src/packages/server/data/index.js +890 -0
  60. package/dist/src/packages/server/data/snapshots.js +371 -0
  61. package/dist/src/packages/server/index.js +96 -0
  62. package/dist/src/packages/server/prompts/tide-commander.js +13 -0
  63. package/dist/src/packages/server/routes/agents.js +406 -0
  64. package/dist/src/packages/server/routes/config.js +347 -0
  65. package/dist/src/packages/server/routes/custom-models.js +170 -0
  66. package/dist/src/packages/server/routes/exec.js +269 -0
  67. package/dist/src/packages/server/routes/files.js +995 -0
  68. package/dist/src/packages/server/routes/index.js +38 -0
  69. package/dist/src/packages/server/routes/notifications.js +81 -0
  70. package/dist/src/packages/server/routes/permissions.js +115 -0
  71. package/dist/src/packages/server/routes/snapshots.js +224 -0
  72. package/dist/src/packages/server/routes/stt.js +99 -0
  73. package/dist/src/packages/server/routes/tts.js +166 -0
  74. package/dist/src/packages/server/routes/voice-assistant.js +310 -0
  75. package/dist/src/packages/server/runtime/claude-runtime-provider.js +10 -0
  76. package/dist/src/packages/server/runtime/codex-runtime-provider.js +11 -0
  77. package/dist/src/packages/server/runtime/index.js +2 -0
  78. package/dist/src/packages/server/runtime/types.js +6 -0
  79. package/dist/src/packages/server/services/agent-lifecycle-service.js +82 -0
  80. package/dist/src/packages/server/services/agent-service.js +410 -0
  81. package/dist/src/packages/server/services/boss-message-service.js +430 -0
  82. package/dist/src/packages/server/services/boss-service.js +553 -0
  83. package/dist/src/packages/server/services/building-service.js +867 -0
  84. package/dist/src/packages/server/services/claude-service.js +5 -0
  85. package/dist/src/packages/server/services/custom-class-service.js +323 -0
  86. package/dist/src/packages/server/services/database-service.js +914 -0
  87. package/dist/src/packages/server/services/docker-service.js +865 -0
  88. package/dist/src/packages/server/services/fileTracker.js +242 -0
  89. package/dist/src/packages/server/services/index.js +21 -0
  90. package/dist/src/packages/server/services/permission-service.js +258 -0
  91. package/dist/src/packages/server/services/pm2-service.js +435 -0
  92. package/dist/src/packages/server/services/runtime-command-execution.js +168 -0
  93. package/dist/src/packages/server/services/runtime-events.js +357 -0
  94. package/dist/src/packages/server/services/runtime-service.js +308 -0
  95. package/dist/src/packages/server/services/runtime-status-sync.js +104 -0
  96. package/dist/src/packages/server/services/runtime-subagents.js +50 -0
  97. package/dist/src/packages/server/services/runtime-watchdog.js +74 -0
  98. package/dist/src/packages/server/services/secrets-service.js +206 -0
  99. package/dist/src/packages/server/services/skill-service.js +508 -0
  100. package/dist/src/packages/server/services/subordinate-context-service.js +223 -0
  101. package/dist/src/packages/server/services/supervisor-claude.js +132 -0
  102. package/dist/src/packages/server/services/supervisor-prompts.js +80 -0
  103. package/dist/src/packages/server/services/supervisor-service.js +659 -0
  104. package/dist/src/packages/server/services/work-plan-service.js +476 -0
  105. package/dist/src/packages/server/setup.js +86 -0
  106. package/dist/src/packages/server/utils/index.js +4 -0
  107. package/dist/src/packages/server/utils/logger.js +302 -0
  108. package/dist/src/packages/server/utils/string.js +39 -0
  109. package/dist/src/packages/server/utils/tool-formatting.js +139 -0
  110. package/dist/src/packages/server/utils/unicode.js +46 -0
  111. package/dist/src/packages/server/websocket/handler.js +290 -0
  112. package/dist/src/packages/server/websocket/handlers/agent-handler.js +515 -0
  113. package/dist/src/packages/server/websocket/handlers/boss-handler.js +116 -0
  114. package/dist/src/packages/server/websocket/handlers/boss-response-handler.js +250 -0
  115. package/dist/src/packages/server/websocket/handlers/building-handler.js +298 -0
  116. package/dist/src/packages/server/websocket/handlers/command-handler.js +217 -0
  117. package/dist/src/packages/server/websocket/handlers/custom-class-handler.js +68 -0
  118. package/dist/src/packages/server/websocket/handlers/database-handler.js +223 -0
  119. package/dist/src/packages/server/websocket/handlers/notification-handler.js +25 -0
  120. package/dist/src/packages/server/websocket/handlers/permission-handler.js +21 -0
  121. package/dist/src/packages/server/websocket/handlers/secrets-handler.js +61 -0
  122. package/dist/src/packages/server/websocket/handlers/skill-handler.js +148 -0
  123. package/dist/src/packages/server/websocket/handlers/supervisor-handler.js +44 -0
  124. package/dist/src/packages/server/websocket/handlers/sync-handler.js +19 -0
  125. package/dist/src/packages/server/websocket/handlers/types.js +4 -0
  126. package/dist/src/packages/server/websocket/listeners/boss-listeners.js +21 -0
  127. package/dist/src/packages/server/websocket/listeners/index.js +32 -0
  128. package/dist/src/packages/server/websocket/listeners/permission-listeners.js +19 -0
  129. package/dist/src/packages/server/websocket/listeners/runtime-listeners.js +196 -0
  130. package/dist/src/packages/server/websocket/listeners/skill-listeners.js +51 -0
  131. package/dist/src/packages/server/websocket/listeners/supervisor-listeners.js +37 -0
  132. package/dist/src/packages/shared/agent-types.js +54 -0
  133. package/dist/src/packages/shared/building-types.js +43 -0
  134. package/dist/src/packages/shared/common-types.js +1 -0
  135. package/dist/src/packages/shared/database-types.js +8 -0
  136. package/dist/src/packages/shared/types/snapshot.js +7 -0
  137. package/dist/src/packages/shared/types.js +12 -0
  138. package/dist/src/packages/shared/websocket-messages.js +1 -0
  139. package/dist/sw.js +37 -0
  140. package/package.json +90 -0
@@ -0,0 +1,298 @@
1
+ export const bitbucketPR = {
2
+ slug: 'bitbucket-pr',
3
+ name: 'Bitbucket PR',
4
+ description: 'Create pull requests on Bitbucket using curl. Use this skill when asked to create PRs, merge requests, or submit code for review on Bitbucket.',
5
+ allowedTools: ['Bash(curl:*)', 'Bash(git:*)', 'Read', 'Grep', 'Glob'],
6
+ content: `# Bitbucket Pull Request Creator
7
+
8
+ Create pull requests on Bitbucket Cloud using curl API requests.
9
+
10
+ ## Required Secrets
11
+
12
+ This skill requires the following secrets to be configured in Tide Commander's Toolbox > Secrets:
13
+
14
+ | Secret Key | Description |
15
+ |------------|-------------|
16
+ | \`BITBUCKET_USERNAME\` | Your Bitbucket username |
17
+ | \`BITBUCKET_APP_PASSWORD\` | Bitbucket App Password with repo and PR permissions |
18
+
19
+ **Setting up Bitbucket App Password:**
20
+ 1. Go to Bitbucket Settings > App passwords
21
+ 2. Create a new app password with permissions:
22
+ - Repositories: Read, Write
23
+ - Pull Requests: Read, Write
24
+ 3. Add it to Tide Commander secrets as \`BITBUCKET_APP_PASSWORD\`
25
+
26
+ Once configured, use the placeholders \`{{BITBUCKET_USERNAME}}\` and \`{{BITBUCKET_APP_PASSWORD}}\` in your curl commands.
27
+
28
+ ---
29
+
30
+ ## Integration with Streaming Exec
31
+
32
+ For long-running git operations (like pushing large branches), use the **Streaming Command Execution** skill to stream output to the terminal. Example:
33
+
34
+ \`\`\`bash
35
+ curl -s -X POST http://localhost:5174/api/exec \\
36
+ -H "Content-Type: application/json" \\
37
+ -d '{"agentId":"YOUR_AGENT_ID","command":"git push -u origin feature-branch"}'
38
+ \`\`\`
39
+
40
+ ---
41
+
42
+ ## Workflow: Create Pull Request
43
+
44
+ When asked to "create PR", "make pull request", "submit for review" on Bitbucket:
45
+
46
+ ### Step 1: Gather Information
47
+
48
+ First, collect the required information:
49
+
50
+ \`\`\`bash
51
+ # Get current branch
52
+ CURRENT_BRANCH=$(git branch --show-current)
53
+ echo "Source branch: $CURRENT_BRANCH"
54
+
55
+ # Get remote URL to extract workspace/repo
56
+ git remote -v
57
+
58
+ # Check for unpushed commits
59
+ git status
60
+ \`\`\`
61
+
62
+ **Extract workspace and repo from remote URL:**
63
+ - HTTPS: \`https://bitbucket.org/WORKSPACE/REPO.git\`
64
+ - SSH: \`git@bitbucket.org:WORKSPACE/REPO.git\`
65
+
66
+ ### Step 2: Ensure Branch is Pushed
67
+
68
+ \`\`\`bash
69
+ # Push current branch to remote
70
+ git push -u origin $(git branch --show-current)
71
+ \`\`\`
72
+
73
+ ### Step 3: Gather PR Details
74
+
75
+ Ask the user for (or infer from context):
76
+ - **Title**: Brief description of the change
77
+ - **Description**: Detailed explanation
78
+ - **Target branch**: Usually \`main\` or \`master\`
79
+ - **Reviewers**: Optional, Bitbucket account IDs
80
+
81
+ ### Step 4: Create the Pull Request
82
+
83
+ \`\`\`bash
84
+ curl -s -X POST \\
85
+ -u "{{BITBUCKET_USERNAME}}:{{BITBUCKET_APP_PASSWORD}}" \\
86
+ -H "Content-Type: application/json" \\
87
+ "https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/pullrequests" \\
88
+ -d '{
89
+ "title": "PR_TITLE",
90
+ "description": "PR_DESCRIPTION",
91
+ "source": {
92
+ "branch": {
93
+ "name": "SOURCE_BRANCH"
94
+ }
95
+ },
96
+ "destination": {
97
+ "branch": {
98
+ "name": "TARGET_BRANCH"
99
+ }
100
+ },
101
+ "close_source_branch": true
102
+ }'
103
+ \`\`\`
104
+
105
+ **Replace placeholders:**
106
+ - \`{workspace}\`: Bitbucket workspace (e.g., "mycompany")
107
+ - \`{repo_slug}\`: Repository name (e.g., "my-project")
108
+ - \`PR_TITLE\`: Title of the PR
109
+ - \`PR_DESCRIPTION\`: Description in markdown
110
+ - \`SOURCE_BRANCH\`: Your feature branch
111
+ - \`TARGET_BRANCH\`: Usually "main" or "master"
112
+
113
+ ### Step 5: Parse Response
114
+
115
+ On success, extract the PR URL from the response:
116
+
117
+ \`\`\`bash
118
+ # Response contains: {"links": {"html": {"href": "https://bitbucket.org/..."}}}
119
+ # Use jq if available, or grep for the URL
120
+ \`\`\`
121
+
122
+ Report the PR URL to the user.
123
+
124
+ ---
125
+
126
+ ## Complete Example Script
127
+
128
+ \`\`\`bash
129
+ # Variables (gather these first)
130
+ WORKSPACE="myworkspace"
131
+ REPO_SLUG="myrepo"
132
+ SOURCE_BRANCH=$(git branch --show-current)
133
+ TARGET_BRANCH="main"
134
+ PR_TITLE="feat: Add new feature"
135
+ PR_DESCRIPTION="## Summary\\n\\n- Added X\\n- Fixed Y\\n\\n## Testing\\n\\n- Ran unit tests"
136
+
137
+ # Create PR using secrets placeholders
138
+ curl -s -X POST \\
139
+ -u "{{BITBUCKET_USERNAME}}:{{BITBUCKET_APP_PASSWORD}}" \\
140
+ -H "Content-Type: application/json" \\
141
+ "https://api.bitbucket.org/2.0/repositories/$WORKSPACE/$REPO_SLUG/pullrequests" \\
142
+ -d "$(cat <<EOF
143
+ {
144
+ "title": "$PR_TITLE",
145
+ "description": "$PR_DESCRIPTION",
146
+ "source": {
147
+ "branch": {
148
+ "name": "$SOURCE_BRANCH"
149
+ }
150
+ },
151
+ "destination": {
152
+ "branch": {
153
+ "name": "$TARGET_BRANCH"
154
+ }
155
+ },
156
+ "close_source_branch": true
157
+ }
158
+ EOF
159
+ )"
160
+ \`\`\`
161
+
162
+ ---
163
+
164
+ ## Add Reviewers
165
+
166
+ To add reviewers, include them in the request:
167
+
168
+ \`\`\`json
169
+ {
170
+ "title": "PR Title",
171
+ "reviewers": [
172
+ {"account_id": "557058:12345678-1234-1234-1234-123456789012"},
173
+ {"account_id": "557058:abcdefgh-abcd-abcd-abcd-abcdefghijkl"}
174
+ ],
175
+ ...
176
+ }
177
+ \`\`\`
178
+
179
+ **Find reviewer account IDs:**
180
+ \`\`\`bash
181
+ # List workspace members
182
+ curl -s -u "{{BITBUCKET_USERNAME}}:{{BITBUCKET_APP_PASSWORD}}" \\
183
+ "https://api.bitbucket.org/2.0/workspaces/{workspace}/members"
184
+ \`\`\`
185
+
186
+ ---
187
+
188
+ ## Other Useful API Endpoints
189
+
190
+ ### List Open PRs
191
+
192
+ \`\`\`bash
193
+ curl -s -u "{{BITBUCKET_USERNAME}}:{{BITBUCKET_APP_PASSWORD}}" \\
194
+ "https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/pullrequests?state=OPEN"
195
+ \`\`\`
196
+
197
+ ### Get PR Details
198
+
199
+ \`\`\`bash
200
+ curl -s -u "{{BITBUCKET_USERNAME}}:{{BITBUCKET_APP_PASSWORD}}" \\
201
+ "https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/pullrequests/{pr_id}"
202
+ \`\`\`
203
+
204
+ ### Approve a PR
205
+
206
+ \`\`\`bash
207
+ curl -s -X POST \\
208
+ -u "{{BITBUCKET_USERNAME}}:{{BITBUCKET_APP_PASSWORD}}" \\
209
+ "https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/pullrequests/{pr_id}/approve"
210
+ \`\`\`
211
+
212
+ ### Merge a PR
213
+
214
+ \`\`\`bash
215
+ curl -s -X POST \\
216
+ -u "{{BITBUCKET_USERNAME}}:{{BITBUCKET_APP_PASSWORD}}" \\
217
+ -H "Content-Type: application/json" \\
218
+ "https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/pullrequests/{pr_id}/merge" \\
219
+ -d '{
220
+ "merge_strategy": "squash",
221
+ "close_source_branch": true,
222
+ "message": "Merged PR: Title"
223
+ }'
224
+ \`\`\`
225
+
226
+ **Merge strategies:**
227
+ - \`merge_commit\`: Standard merge
228
+ - \`squash\`: Squash all commits
229
+ - \`fast_forward\`: Fast-forward if possible
230
+
231
+ ### Decline a PR
232
+
233
+ \`\`\`bash
234
+ curl -s -X POST \\
235
+ -u "{{BITBUCKET_USERNAME}}:{{BITBUCKET_APP_PASSWORD}}" \\
236
+ "https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/pullrequests/{pr_id}/decline"
237
+ \`\`\`
238
+
239
+ ### Add Comment to PR
240
+
241
+ \`\`\`bash
242
+ curl -s -X POST \\
243
+ -u "{{BITBUCKET_USERNAME}}:{{BITBUCKET_APP_PASSWORD}}" \\
244
+ -H "Content-Type: application/json" \\
245
+ "https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/pullrequests/{pr_id}/comments" \\
246
+ -d '{
247
+ "content": {
248
+ "raw": "Your comment here"
249
+ }
250
+ }'
251
+ \`\`\`
252
+
253
+ ---
254
+
255
+ ## Error Handling
256
+
257
+ Common errors and solutions:
258
+
259
+ | HTTP Code | Meaning | Solution |
260
+ |-----------|---------|----------|
261
+ | 401 | Unauthorized | Check BITBUCKET_USERNAME and BITBUCKET_APP_PASSWORD secrets |
262
+ | 403 | Forbidden | App password lacks permissions |
263
+ | 404 | Not Found | Check workspace/repo slug |
264
+ | 400 | Bad Request | Check JSON payload format |
265
+ | 409 | Conflict | PR already exists for this branch |
266
+
267
+ **Debug requests:**
268
+ \`\`\`bash
269
+ # Add -v for verbose output
270
+ curl -v -X POST ...
271
+ \`\`\`
272
+
273
+ ---
274
+
275
+ ## Safety Rules
276
+
277
+ 1. **NEVER commit credentials** to the repository - always use \`{{SECRET}}\` placeholders
278
+ 2. **ALWAYS verify** the target branch before creating PR
279
+ 3. **ALWAYS push** the source branch before creating PR
280
+ 4. **CHECK** for existing PRs before creating duplicates
281
+ 5. **CONFIRM** with user before merging or declining PRs
282
+
283
+ ---
284
+
285
+ ## Quick Reference
286
+
287
+ | Action | Endpoint | Method |
288
+ |--------|----------|--------|
289
+ | Create PR | \`/pullrequests\` | POST |
290
+ | List PRs | \`/pullrequests\` | GET |
291
+ | Get PR | \`/pullrequests/{id}\` | GET |
292
+ | Approve | \`/pullrequests/{id}/approve\` | POST |
293
+ | Merge | \`/pullrequests/{id}/merge\` | POST |
294
+ | Decline | \`/pullrequests/{id}/decline\` | POST |
295
+ | Comment | \`/pullrequests/{id}/comments\` | POST |
296
+
297
+ Base URL: \`https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}\``,
298
+ };
@@ -0,0 +1,49 @@
1
+ export const fullNotifications = {
2
+ slug: 'full-notifications',
3
+ name: 'Full Notifications',
4
+ description: 'Send notification via browser, android or in-app',
5
+ allowedTools: ['Bash(curl:*)', 'Bash(gdbus:*)'],
6
+ content: `# Task Completion Notifications (MANDATORY)
7
+
8
+ **IMPORTANT: You MUST send a notification automatically whenever you complete a task. This is not optional.**
9
+
10
+ ## Trigger Conditions (Act Immediately)
11
+ 1. **Task Completed** - Right after finishing any user request
12
+ 2. **Blocking Error** - When you cannot proceed
13
+ 3. **Awaiting Input** - When you need user decision
14
+
15
+ ## Command Template
16
+ \`\`\`bash
17
+ curl -s -X POST http://localhost:5174/api/notify -H "Content-Type: application/json" -d '{"agentId":"YOUR_AGENT_ID","title":"TITLE","message":"MESSAGE"}' & gdbus call --session --dest=org.freedesktop.Notifications --object-path=/org/freedesktop/Notifications --method=org.freedesktop.Notifications.Notify 'Tide Commander' 0 'ICON' 'TITLE' 'MESSAGE' '[]' '{}' 5000
18
+ \`\`\`
19
+
20
+ ## Examples by Type
21
+
22
+ **Task Complete:**
23
+ \`\`\`bash
24
+ curl -s -X POST http://localhost:5174/api/notify -H "Content-Type: application/json" -d '{"agentId":"YOUR_AGENT_ID","title":"Task Complete","message":"Build succeeded"}' & gdbus call --session --dest=org.freedesktop.Notifications --object-path=/org/freedesktop/Notifications --method=org.freedesktop.Notifications.Notify 'Tide Commander' 0 'dialog-information' 'Task Complete' 'Build succeeded' '[]' '{}' 5000
25
+ \`\`\`
26
+
27
+ **Error/Attention Needed:**
28
+ \`\`\`bash
29
+ curl -s -X POST http://localhost:5174/api/notify -H "Content-Type: application/json" -d '{"agentId":"YOUR_AGENT_ID","title":"Error","message":"Build failed"}' & gdbus call --session --dest=org.freedesktop.Notifications --object-path=/org/freedesktop/Notifications --method=org.freedesktop.Notifications.Notify 'Tide Commander' 0 'dialog-warning' 'Error' 'Build failed' '[]' '{}' 5000
30
+ \`\`\`
31
+
32
+ **Input Required:**
33
+ \`\`\`bash
34
+ curl -s -X POST http://localhost:5174/api/notify -H "Content-Type: application/json" -d '{"agentId":"YOUR_AGENT_ID","title":"Input Needed","message":"Which database?"}' & gdbus call --session --dest=org.freedesktop.Notifications --object-path=/org/freedesktop/Notifications --method=org.freedesktop.Notifications.Notify 'Tide Commander' 0 'dialog-question' 'Input Needed' 'Which database?' '[]' '{}' 5000
35
+ \`\`\`
36
+
37
+ ## Icons (gdbus)
38
+ - \`dialog-information\` - Task complete
39
+ - \`dialog-warning\` - Error/attention needed
40
+ - \`dialog-question\` - Input required
41
+
42
+ ## Rules
43
+ - Replace \`YOUR_AGENT_ID\` with your actual agent ID from the system prompt
44
+ - Keep messages under 50 characters
45
+ - **IMPORTANT: Do NOT use exclamation marks (!) in messages** - they cause bash history expansion errors
46
+ - Send notification as your FINAL action after completing work
47
+ - Do NOT skip this step - the user relies on notifications
48
+ - The \`&\` runs both commands in parallel (curl for mobile/browser, gdbus for Linux desktop)`,
49
+ };
@@ -0,0 +1,304 @@
1
+ export const gitCaptain = {
2
+ slug: 'git-captain',
3
+ name: 'Git Captain',
4
+ description: 'Use this skill for Git operations: committing changes, updating versions, managing changelogs, creating tags, pulling remote changes, and handling merge conflicts safely.',
5
+ allowedTools: ['Bash(git:*)', 'Bash(npm:*)', 'Read', 'Edit', 'Grep', 'Glob'],
6
+ content: `# Git Captain
7
+
8
+ A comprehensive Git workflow skill for version management, changelogs, tagging, and safe collaboration.
9
+
10
+ ## Core Principles
11
+
12
+ 1. **Never force push** to shared branches (main, master, develop)
13
+ 2. **Never auto-resolve conflicts** - always report them to the user
14
+ 3. **Always verify** the current branch before operations
15
+ 4. **Always show diffs** before committing
16
+ 5. **Keep changelogs organized** and human-readable
17
+
18
+ ---
19
+
20
+ ## Workflow: Upload Changes (Commit, Version, Changelog, Tag)
21
+
22
+ When asked to "upload changes", "release", "bump version", or similar:
23
+
24
+ ### Step 1: Check Current State
25
+
26
+ \`\`\`bash
27
+ # Check we're on the right branch and have no conflicts
28
+ git status
29
+ git branch --show-current
30
+ \`\`\`
31
+
32
+ If there are untracked files or changes, list them for the user.
33
+
34
+ ### Step 2: Pull Latest Changes First
35
+
36
+ \`\`\`bash
37
+ # Always pull before pushing to avoid conflicts
38
+ git pull --rebase origin $(git branch --show-current)
39
+ \`\`\`
40
+
41
+ **If conflicts occur:** STOP immediately and report to user:
42
+ > "Merge conflicts detected. Please resolve these manually:
43
+ > [list conflicting files]
44
+ > After resolving, run \`git add <files>\` and \`git rebase --continue\`"
45
+
46
+ ### Step 3: Review Changes
47
+
48
+ \`\`\`bash
49
+ # Show what will be committed
50
+ git diff --stat
51
+ git diff
52
+ \`\`\`
53
+
54
+ Present a summary of changes to the user.
55
+
56
+ ### Step 4: Determine Version Bump
57
+
58
+ Ask the user or infer from changes:
59
+ - **patch** (0.0.X): Bug fixes, small changes
60
+ - **minor** (0.X.0): New features, non-breaking changes
61
+ - **major** (X.0.0): Breaking changes, major rewrites
62
+
63
+ Read current version from \`package.json\`:
64
+ \`\`\`bash
65
+ cat package.json | grep '"version"'
66
+ \`\`\`
67
+
68
+ ### Step 5: Update Version
69
+
70
+ \`\`\`bash
71
+ # Use npm version (updates package.json and creates git tag)
72
+ npm version <patch|minor|major> --no-git-tag-version
73
+ \`\`\`
74
+
75
+ Or manually edit package.json if npm is not available.
76
+
77
+ ### Step 6: Update Changelog
78
+
79
+ Look for \`CHANGELOG.md\` in the project root. If it doesn't exist, create one.
80
+
81
+ **Changelog Format:**
82
+ \`\`\`markdown
83
+ # Changelog
84
+
85
+ All notable changes to this project will be documented in this file.
86
+
87
+ ## [X.Y.Z] - YYYY-MM-DD
88
+
89
+ ### Added
90
+ - New feature descriptions
91
+
92
+ ### Changed
93
+ - Changes to existing functionality
94
+
95
+ ### Fixed
96
+ - Bug fixes
97
+
98
+ ### Removed
99
+ - Removed features
100
+
101
+ ### Security
102
+ - Security-related changes
103
+
104
+ ### Deprecated
105
+ - Features that will be removed in future versions
106
+ \`\`\`
107
+
108
+ **How to categorize commits:**
109
+ - \`feat:\` or \`add:\` -> Added
110
+ - \`fix:\` or \`bugfix:\` -> Fixed
111
+ - \`change:\` or \`update:\` or \`refactor:\` -> Changed
112
+ - \`remove:\` or \`delete:\` -> Removed
113
+ - \`security:\` -> Security
114
+ - \`deprecate:\` -> Deprecated
115
+
116
+ Read recent commits to summarize:
117
+ \`\`\`bash
118
+ git log --oneline -20
119
+ \`\`\`
120
+
121
+ ### Step 7: Stage and Commit
122
+
123
+ \`\`\`bash
124
+ # Stage all changes including version and changelog
125
+ git add package.json CHANGELOG.md
126
+ git add -A # or specific files
127
+
128
+ # Create commit with conventional format
129
+ git commit -m "chore(release): v<VERSION>
130
+
131
+ - Summary of main changes
132
+ - Another change
133
+
134
+ Co-Authored-By: Claude <noreply@anthropic.com>"
135
+ \`\`\`
136
+
137
+ ### Step 8: Create Tag
138
+
139
+ \`\`\`bash
140
+ # Create annotated tag
141
+ git tag -a v<VERSION> -m "Release v<VERSION>
142
+
143
+ Highlights:
144
+ - Main feature or fix
145
+ - Another highlight"
146
+ \`\`\`
147
+
148
+ ### Step 9: Push Changes and Tags
149
+
150
+ \`\`\`bash
151
+ # Push commits
152
+ git push origin $(git branch --show-current)
153
+
154
+ # Push tags
155
+ git push origin v<VERSION>
156
+ \`\`\`
157
+
158
+ ### Step 10: Create GitHub Release
159
+
160
+ After pushing the tag, create a GitHub release to make it visible in the "Releases" tab:
161
+
162
+ \`\`\`bash
163
+ # Create GitHub release with notes
164
+ gh release create v<VERSION> --notes "<RELEASE_NOTES>"
165
+ \`\`\`
166
+
167
+ **Release notes format:**
168
+ \`\`\`markdown
169
+ ## Highlights
170
+
171
+ ### ✨ Feature Name
172
+ Brief description of what was added.
173
+
174
+ ### 🐛 Bug Fixes
175
+ Description of bugs fixed.
176
+
177
+ ## Changes
178
+ - Bullet point of changes
179
+ - Another change
180
+
181
+ ## Technical Details
182
+ - Technical implementation note
183
+ - Architecture changes
184
+ \`\`\`
185
+
186
+ ---
187
+
188
+ ## Workflow: Download Changes (Pull/Sync)
189
+
190
+ When asked to "pull", "sync", "download changes", or "update from remote":
191
+
192
+ ### Step 1: Stash Local Changes (if any)
193
+
194
+ \`\`\`bash
195
+ git status
196
+ # If there are uncommitted changes:
197
+ git stash push -m "Auto-stash before pull $(date +%Y%m%d-%H%M%S)"
198
+ \`\`\`
199
+
200
+ ### Step 2: Fetch and Pull
201
+
202
+ \`\`\`bash
203
+ git fetch origin
204
+ git pull --rebase origin $(git branch --show-current)
205
+ \`\`\`
206
+
207
+ ### Step 3: Handle Conflicts
208
+
209
+ **If conflicts occur:** STOP and report to user:
210
+
211
+ > "Merge conflicts detected during pull. The following files have conflicts:
212
+ >
213
+ > [list files from \`git diff --name-only --diff-filter=U\`]
214
+ >
215
+ > **Do not attempt to auto-resolve.** Please:
216
+ > 1. Open each file and look for \`<<<<<<<\`, \`=======\`, \`>>>>>>>\` markers
217
+ > 2. Decide which changes to keep
218
+ > 3. Remove the conflict markers
219
+ > 4. Run \`git add <resolved-files>\`
220
+ > 5. Run \`git rebase --continue\`
221
+ >
222
+ > If you want to abort: \`git rebase --abort\`"
223
+
224
+ ### Step 4: Restore Stashed Changes
225
+
226
+ \`\`\`bash
227
+ # If we stashed earlier
228
+ git stash pop
229
+ \`\`\`
230
+
231
+ If stash pop causes conflicts, report to user.
232
+
233
+ ---
234
+
235
+ ## Workflow: Check Status
236
+
237
+ When asked about git status, branch info, or repository state:
238
+
239
+ \`\`\`bash
240
+ # Comprehensive status check
241
+ echo "=== Branch ===" && git branch -vv
242
+ echo ""
243
+ echo "=== Status ===" && git status -sb
244
+ echo ""
245
+ echo "=== Recent Commits ===" && git log --oneline -5
246
+ echo ""
247
+ echo "=== Remote ===" && git remote -v
248
+ \`\`\`
249
+
250
+ ---
251
+
252
+ ## Safety Rules
253
+
254
+ 1. **NEVER run these commands without explicit user permission:**
255
+ - \`git push --force\` or \`git push -f\`
256
+ - \`git reset --hard\`
257
+ - \`git clean -fd\`
258
+ - \`git checkout .\` (discards all changes)
259
+ - \`git branch -D\` (force delete branch)
260
+
261
+ 2. **ALWAYS stop and report to user when:**
262
+ - Merge conflicts are detected
263
+ - Rebase conflicts occur
264
+ - Push is rejected
265
+ - Branch is behind remote by many commits (>10)
266
+
267
+ 3. **ALWAYS verify before destructive operations:**
268
+ - Confirm branch name before pushing
269
+ - Show diff before committing
270
+ - List files before \`git add -A\`
271
+
272
+ ---
273
+
274
+ ## Quick Reference Commands
275
+
276
+ | Action | Command |
277
+ |--------|---------|
278
+ | Check status | \`git status -sb\` |
279
+ | View diff | \`git diff\` |
280
+ | View staged diff | \`git diff --cached\` |
281
+ | Recent commits | \`git log --oneline -10\` |
282
+ | Current branch | \`git branch --show-current\` |
283
+ | List branches | \`git branch -a\` |
284
+ | List tags | \`git tag -l\` |
285
+ | Undo last commit (keep changes) | \`git reset --soft HEAD~1\` |
286
+ | Discard file changes | \`git checkout -- <file>\` |
287
+ | Create branch | \`git checkout -b <name>\` |
288
+ | Switch branch | \`git checkout <name>\` |
289
+
290
+ ---
291
+
292
+ ## Version Number Guidelines
293
+
294
+ - **0.x.x** - Pre-release, API may change
295
+ - **1.0.0** - First stable release
296
+ - **x.Y.0** - New features added (backwards compatible)
297
+ - **x.x.Z** - Bug fixes only
298
+
299
+ When in doubt about version type, ask the user:
300
+ > "What type of release is this?
301
+ > - **patch** (bug fixes only)
302
+ > - **minor** (new features, no breaking changes)
303
+ > - **major** (breaking changes)"`,
304
+ };
@@ -0,0 +1,61 @@
1
+ /**
2
+ * Built-in Skills
3
+ *
4
+ * These are core Tide Commander skills that ship with the application.
5
+ * They cannot be modified or deleted by users.
6
+ */
7
+ // Import individual skills
8
+ import { fullNotifications } from './full-notifications.js';
9
+ import { sendMessageToAgent } from './send-message-to-agent.js';
10
+ import { gitCaptain } from './git-captain.js';
11
+ import { serverLogs } from './server-logs.js';
12
+ import { streamingExec } from './streaming-exec.js';
13
+ import { bitbucketPR } from './bitbucket-pr.js';
14
+ import { pm2Logs } from './pm2-logs.js';
15
+ /**
16
+ * All built-in skills that ship with Tide Commander
17
+ */
18
+ export const BUILTIN_SKILLS = [
19
+ fullNotifications,
20
+ sendMessageToAgent,
21
+ gitCaptain,
22
+ serverLogs,
23
+ streamingExec,
24
+ bitbucketPR,
25
+ pm2Logs,
26
+ ];
27
+ /**
28
+ * Get the ID for a built-in skill based on its slug
29
+ * Built-in skills use a predictable ID format: "builtin-{slug}"
30
+ */
31
+ export function getBuiltinSkillId(slug) {
32
+ return `builtin-${slug}`;
33
+ }
34
+ /**
35
+ * Check if a skill ID is a built-in skill
36
+ */
37
+ export function isBuiltinSkillId(id) {
38
+ return id.startsWith('builtin-');
39
+ }
40
+ /**
41
+ * Convert a built-in skill definition to a full Skill object
42
+ */
43
+ export function createBuiltinSkill(definition) {
44
+ const now = Date.now();
45
+ return {
46
+ id: getBuiltinSkillId(definition.slug),
47
+ slug: definition.slug,
48
+ name: definition.name,
49
+ description: definition.description,
50
+ content: definition.content,
51
+ allowedTools: definition.allowedTools,
52
+ model: definition.model,
53
+ context: definition.context,
54
+ assignedAgentIds: [],
55
+ assignedAgentClasses: definition.assignedAgentClasses || [],
56
+ enabled: true,
57
+ builtin: true,
58
+ createdAt: now,
59
+ updatedAt: now,
60
+ };
61
+ }