@codemieai/code 0.0.58 → 0.1.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 (261) hide show
  1. package/README.md +56 -15
  2. package/dist/agents/core/BaseAgentAdapter.d.ts.map +1 -1
  3. package/dist/agents/core/BaseAgentAdapter.js +3 -0
  4. package/dist/agents/core/BaseAgentAdapter.js.map +1 -1
  5. package/dist/agents/plugins/claude/claude.plugin.d.ts.map +1 -1
  6. package/dist/agents/plugins/claude/claude.plugin.js +18 -0
  7. package/dist/agents/plugins/claude/claude.plugin.js.map +1 -1
  8. package/dist/agents/plugins/claude/plugin/.claude-plugin/plugin.json +1 -1
  9. package/dist/agents/plugins/claude/plugin/commands/README.md +2 -31
  10. package/dist/agents/plugins/claude/plugin/commands/codemie-catchup.md +5 -0
  11. package/dist/agents/plugins/claude/plugin/commands/codemie-init.md +42 -43
  12. package/dist/agents/plugins/claude/plugin/commands/codemie-subagents.md +5 -0
  13. package/dist/agents/plugins/claude/plugin/commands/handoff.md +56 -0
  14. package/dist/agents/plugins/claude/plugin/commands/memory-refresh.md +5 -0
  15. package/dist/agents/plugins/claude/plugin/hooks/hooks.json +1 -1
  16. package/dist/agents/plugins/claude/plugin/scripts/bash/rtk-rewrite.sh +101 -0
  17. package/dist/agents/plugins/claude/plugin/skills/msgraph/README.md +4 -1
  18. package/dist/agents/plugins/claude/plugin/skills/msgraph/SKILL.md +27 -8
  19. package/dist/agents/plugins/claude/plugin/skills/msgraph/scripts/msgraph.js +63 -3
  20. package/dist/agents/plugins/claude/plugin/skills/report-issue/SKILL.md +1 -0
  21. package/dist/assets/demo.gif +0 -0
  22. package/dist/assets/skills-sh-egress-guard.cjs +166 -0
  23. package/dist/cli/commands/assistants/setup/constants.d.ts +1 -25
  24. package/dist/cli/commands/assistants/setup/constants.d.ts.map +1 -1
  25. package/dist/cli/commands/assistants/setup/constants.js +1 -20
  26. package/dist/cli/commands/assistants/setup/constants.js.map +1 -1
  27. package/dist/cli/commands/assistants/setup/generators/claude-agent-generator.d.ts +4 -4
  28. package/dist/cli/commands/assistants/setup/generators/claude-agent-generator.d.ts.map +1 -1
  29. package/dist/cli/commands/assistants/setup/generators/claude-agent-generator.js +11 -10
  30. package/dist/cli/commands/assistants/setup/generators/claude-agent-generator.js.map +1 -1
  31. package/dist/cli/commands/assistants/setup/generators/claude-skill-generator.d.ts +4 -4
  32. package/dist/cli/commands/assistants/setup/generators/claude-skill-generator.d.ts.map +1 -1
  33. package/dist/cli/commands/assistants/setup/generators/claude-skill-generator.js +11 -9
  34. package/dist/cli/commands/assistants/setup/generators/claude-skill-generator.js.map +1 -1
  35. package/dist/cli/commands/assistants/setup/helpers.d.ts +4 -18
  36. package/dist/cli/commands/assistants/setup/helpers.d.ts.map +1 -1
  37. package/dist/cli/commands/assistants/setup/helpers.js +10 -60
  38. package/dist/cli/commands/assistants/setup/helpers.js.map +1 -1
  39. package/dist/cli/commands/assistants/setup/index.d.ts +0 -8
  40. package/dist/cli/commands/assistants/setup/index.d.ts.map +1 -1
  41. package/dist/cli/commands/assistants/setup/index.js +20 -164
  42. package/dist/cli/commands/assistants/setup/index.js.map +1 -1
  43. package/dist/cli/commands/assistants/setup/selection/actions.d.ts +1 -30
  44. package/dist/cli/commands/assistants/setup/selection/actions.d.ts.map +1 -1
  45. package/dist/cli/commands/assistants/setup/selection/actions.js +1 -320
  46. package/dist/cli/commands/assistants/setup/selection/actions.js.map +1 -1
  47. package/dist/cli/commands/assistants/setup/selection/constants.d.ts +3 -65
  48. package/dist/cli/commands/assistants/setup/selection/constants.d.ts.map +1 -1
  49. package/dist/cli/commands/assistants/setup/selection/constants.js +4 -81
  50. package/dist/cli/commands/assistants/setup/selection/constants.js.map +1 -1
  51. package/dist/cli/commands/assistants/setup/selection/index.d.ts +1 -9
  52. package/dist/cli/commands/assistants/setup/selection/index.d.ts.map +1 -1
  53. package/dist/cli/commands/assistants/setup/selection/index.js +14 -34
  54. package/dist/cli/commands/assistants/setup/selection/index.js.map +1 -1
  55. package/dist/cli/commands/assistants/setup/selection/interactive-prompt.d.ts +1 -19
  56. package/dist/cli/commands/assistants/setup/selection/interactive-prompt.d.ts.map +1 -1
  57. package/dist/cli/commands/assistants/setup/selection/interactive-prompt.js +1 -338
  58. package/dist/cli/commands/assistants/setup/selection/interactive-prompt.js.map +1 -1
  59. package/dist/cli/commands/assistants/setup/selection/types.d.ts +7 -23
  60. package/dist/cli/commands/assistants/setup/selection/types.d.ts.map +1 -1
  61. package/dist/cli/commands/assistants/setup/selection/ui.d.ts +0 -8
  62. package/dist/cli/commands/assistants/setup/selection/ui.d.ts.map +1 -1
  63. package/dist/cli/commands/assistants/setup/selection/ui.js +7 -123
  64. package/dist/cli/commands/assistants/setup/selection/ui.js.map +1 -1
  65. package/dist/cli/commands/doctor/index.d.ts.map +1 -1
  66. package/dist/cli/commands/doctor/index.js +10 -1
  67. package/dist/cli/commands/doctor/index.js.map +1 -1
  68. package/dist/cli/commands/proxy/connectors/desktop-managed-mcp-servers.json +50 -0
  69. package/dist/cli/commands/proxy/connectors/desktop.d.ts +13 -3
  70. package/dist/cli/commands/proxy/connectors/desktop.d.ts.map +1 -1
  71. package/dist/cli/commands/proxy/connectors/desktop.js +47 -4
  72. package/dist/cli/commands/proxy/connectors/desktop.js.map +1 -1
  73. package/dist/cli/commands/proxy/index.d.ts.map +1 -1
  74. package/dist/cli/commands/proxy/index.js +89 -52
  75. package/dist/cli/commands/proxy/index.js.map +1 -1
  76. package/dist/cli/commands/setup.d.ts.map +1 -1
  77. package/dist/cli/commands/setup.js +2 -0
  78. package/dist/cli/commands/setup.js.map +1 -1
  79. package/dist/cli/commands/shared/constants.d.ts +15 -0
  80. package/dist/cli/commands/shared/constants.d.ts.map +1 -0
  81. package/dist/cli/commands/shared/constants.js +10 -0
  82. package/dist/cli/commands/shared/constants.js.map +1 -0
  83. package/dist/cli/commands/shared/helpers.d.ts +12 -0
  84. package/dist/cli/commands/shared/helpers.d.ts.map +1 -0
  85. package/dist/cli/commands/shared/helpers.js +54 -0
  86. package/dist/cli/commands/shared/helpers.js.map +1 -0
  87. package/dist/cli/commands/shared/prompts/storage-scope.d.ts +6 -0
  88. package/dist/cli/commands/shared/prompts/storage-scope.d.ts.map +1 -0
  89. package/dist/cli/commands/shared/prompts/storage-scope.js +84 -0
  90. package/dist/cli/commands/shared/prompts/storage-scope.js.map +1 -0
  91. package/dist/cli/commands/shared/selection/actions.d.ts +40 -0
  92. package/dist/cli/commands/shared/selection/actions.d.ts.map +1 -0
  93. package/dist/cli/commands/shared/selection/actions.js +264 -0
  94. package/dist/cli/commands/shared/selection/actions.js.map +1 -0
  95. package/dist/cli/commands/shared/selection/constants.d.ts +68 -0
  96. package/dist/cli/commands/shared/selection/constants.d.ts.map +1 -0
  97. package/dist/cli/commands/shared/selection/constants.js +70 -0
  98. package/dist/cli/commands/shared/selection/constants.js.map +1 -0
  99. package/dist/cli/commands/shared/selection/interactive-prompt.d.ts +16 -0
  100. package/dist/cli/commands/shared/selection/interactive-prompt.d.ts.map +1 -0
  101. package/dist/cli/commands/shared/selection/interactive-prompt.js +276 -0
  102. package/dist/cli/commands/shared/selection/interactive-prompt.js.map +1 -0
  103. package/dist/cli/commands/shared/selection/types.d.ts +31 -0
  104. package/dist/cli/commands/shared/selection/types.d.ts.map +1 -0
  105. package/dist/cli/commands/shared/selection/types.js +2 -0
  106. package/dist/cli/commands/shared/selection/types.js.map +1 -0
  107. package/dist/cli/commands/shared/selection/ui.d.ts +9 -0
  108. package/dist/cli/commands/shared/selection/ui.d.ts.map +1 -0
  109. package/dist/cli/commands/shared/selection/ui.js +92 -0
  110. package/dist/cli/commands/shared/selection/ui.js.map +1 -0
  111. package/dist/cli/commands/skills/add.d.ts +9 -0
  112. package/dist/cli/commands/skills/add.d.ts.map +1 -0
  113. package/dist/cli/commands/skills/add.js +187 -0
  114. package/dist/cli/commands/skills/add.js.map +1 -0
  115. package/dist/cli/commands/skills/find.d.ts +17 -0
  116. package/dist/cli/commands/skills/find.d.ts.map +1 -0
  117. package/dist/cli/commands/skills/find.js +94 -0
  118. package/dist/cli/commands/skills/find.js.map +1 -0
  119. package/dist/cli/commands/skills/index.d.ts +10 -0
  120. package/dist/cli/commands/skills/index.d.ts.map +1 -0
  121. package/dist/cli/commands/skills/index.js +23 -0
  122. package/dist/cli/commands/skills/index.js.map +1 -0
  123. package/dist/cli/commands/skills/lib/agent-detection.d.ts +27 -0
  124. package/dist/cli/commands/skills/lib/agent-detection.d.ts.map +1 -0
  125. package/dist/cli/commands/skills/lib/agent-detection.js +50 -0
  126. package/dist/cli/commands/skills/lib/agent-detection.js.map +1 -0
  127. package/dist/cli/commands/skills/lib/error-classify.d.ts +14 -0
  128. package/dist/cli/commands/skills/lib/error-classify.d.ts.map +1 -0
  129. package/dist/cli/commands/skills/lib/error-classify.js +64 -0
  130. package/dist/cli/commands/skills/lib/error-classify.js.map +1 -0
  131. package/dist/cli/commands/skills/lib/require-auth.d.ts +17 -0
  132. package/dist/cli/commands/skills/lib/require-auth.d.ts.map +1 -0
  133. package/dist/cli/commands/skills/lib/require-auth.js +44 -0
  134. package/dist/cli/commands/skills/lib/require-auth.js.map +1 -0
  135. package/dist/cli/commands/skills/lib/result-render.d.ts +26 -0
  136. package/dist/cli/commands/skills/lib/result-render.d.ts.map +1 -0
  137. package/dist/cli/commands/skills/lib/result-render.js +77 -0
  138. package/dist/cli/commands/skills/lib/result-render.js.map +1 -0
  139. package/dist/cli/commands/skills/lib/run-skills-cli.d.ts +46 -0
  140. package/dist/cli/commands/skills/lib/run-skills-cli.d.ts.map +1 -0
  141. package/dist/cli/commands/skills/lib/run-skills-cli.js +217 -0
  142. package/dist/cli/commands/skills/lib/run-skills-cli.js.map +1 -0
  143. package/dist/cli/commands/skills/lib/sanitize.d.ts +17 -0
  144. package/dist/cli/commands/skills/lib/sanitize.d.ts.map +1 -0
  145. package/dist/cli/commands/skills/lib/sanitize.js +73 -0
  146. package/dist/cli/commands/skills/lib/sanitize.js.map +1 -0
  147. package/dist/cli/commands/skills/lib/skills-metrics.d.ts +74 -0
  148. package/dist/cli/commands/skills/lib/skills-metrics.d.ts.map +1 -0
  149. package/dist/cli/commands/skills/lib/skills-metrics.js +268 -0
  150. package/dist/cli/commands/skills/lib/skills-metrics.js.map +1 -0
  151. package/dist/cli/commands/skills/lib/skills-search-client.d.ts +36 -0
  152. package/dist/cli/commands/skills/lib/skills-search-client.d.ts.map +1 -0
  153. package/dist/cli/commands/skills/lib/skills-search-client.js +147 -0
  154. package/dist/cli/commands/skills/lib/skills-search-client.js.map +1 -0
  155. package/dist/cli/commands/skills/lib/skills-sh-telemetry.d.ts +10 -0
  156. package/dist/cli/commands/skills/lib/skills-sh-telemetry.d.ts.map +1 -0
  157. package/dist/cli/commands/skills/lib/skills-sh-telemetry.js +33 -0
  158. package/dist/cli/commands/skills/lib/skills-sh-telemetry.js.map +1 -0
  159. package/dist/cli/commands/skills/list.d.ts +13 -0
  160. package/dist/cli/commands/skills/list.d.ts.map +1 -0
  161. package/dist/cli/commands/skills/list.js +55 -0
  162. package/dist/cli/commands/skills/list.js.map +1 -0
  163. package/dist/cli/commands/skills/remove.d.ts +11 -0
  164. package/dist/cli/commands/skills/remove.d.ts.map +1 -0
  165. package/dist/cli/commands/skills/remove.js +93 -0
  166. package/dist/cli/commands/skills/remove.js.map +1 -0
  167. package/dist/cli/commands/skills/setup/constants.d.ts +2 -0
  168. package/dist/cli/commands/skills/setup/constants.d.ts.map +1 -0
  169. package/dist/cli/commands/skills/setup/constants.js +2 -0
  170. package/dist/cli/commands/skills/setup/constants.js.map +1 -0
  171. package/dist/cli/commands/skills/setup/data.d.ts +28 -0
  172. package/dist/cli/commands/skills/setup/data.d.ts.map +1 -0
  173. package/dist/cli/commands/skills/setup/data.js +79 -0
  174. package/dist/cli/commands/skills/setup/data.js.map +1 -0
  175. package/dist/cli/commands/skills/setup/generators/claude-skill-generator.d.ts +12 -0
  176. package/dist/cli/commands/skills/setup/generators/claude-skill-generator.d.ts.map +1 -0
  177. package/dist/cli/commands/skills/setup/generators/claude-skill-generator.js +94 -0
  178. package/dist/cli/commands/skills/setup/generators/claude-skill-generator.js.map +1 -0
  179. package/dist/cli/commands/skills/setup/helpers.d.ts +12 -0
  180. package/dist/cli/commands/skills/setup/helpers.d.ts.map +1 -0
  181. package/dist/cli/commands/skills/setup/helpers.js +31 -0
  182. package/dist/cli/commands/skills/setup/helpers.js.map +1 -0
  183. package/dist/cli/commands/skills/setup/index.d.ts +5 -0
  184. package/dist/cli/commands/skills/setup/index.d.ts.map +1 -0
  185. package/dist/cli/commands/skills/setup/index.js +137 -0
  186. package/dist/cli/commands/skills/setup/index.js.map +1 -0
  187. package/dist/cli/commands/skills/setup/selection/actions.d.ts +2 -0
  188. package/dist/cli/commands/skills/setup/selection/actions.d.ts.map +1 -0
  189. package/dist/cli/commands/skills/setup/selection/actions.js +2 -0
  190. package/dist/cli/commands/skills/setup/selection/actions.js.map +1 -0
  191. package/dist/cli/commands/skills/setup/selection/constants.d.ts +11 -0
  192. package/dist/cli/commands/skills/setup/selection/constants.d.ts.map +1 -0
  193. package/dist/cli/commands/skills/setup/selection/constants.js +11 -0
  194. package/dist/cli/commands/skills/setup/selection/constants.js.map +1 -0
  195. package/dist/cli/commands/skills/setup/selection/index.d.ts +13 -0
  196. package/dist/cli/commands/skills/setup/selection/index.d.ts.map +1 -0
  197. package/dist/cli/commands/skills/setup/selection/index.js +113 -0
  198. package/dist/cli/commands/skills/setup/selection/index.js.map +1 -0
  199. package/dist/cli/commands/skills/setup/selection/interactive-prompt.d.ts +2 -0
  200. package/dist/cli/commands/skills/setup/selection/interactive-prompt.d.ts.map +1 -0
  201. package/dist/cli/commands/skills/setup/selection/interactive-prompt.js +2 -0
  202. package/dist/cli/commands/skills/setup/selection/interactive-prompt.js.map +1 -0
  203. package/dist/cli/commands/skills/setup/selection/types.d.ts +13 -0
  204. package/dist/cli/commands/skills/setup/selection/types.d.ts.map +1 -0
  205. package/dist/cli/commands/skills/setup/selection/types.js +2 -0
  206. package/dist/cli/commands/skills/setup/selection/types.js.map +1 -0
  207. package/dist/cli/commands/skills/setup/selection/ui.d.ts +3 -0
  208. package/dist/cli/commands/skills/setup/selection/ui.d.ts.map +1 -0
  209. package/dist/cli/commands/skills/setup/selection/ui.js +68 -0
  210. package/dist/cli/commands/skills/setup/selection/ui.js.map +1 -0
  211. package/dist/cli/commands/skills/setup/sync.d.ts +13 -0
  212. package/dist/cli/commands/skills/setup/sync.d.ts.map +1 -0
  213. package/dist/cli/commands/skills/setup/sync.js +46 -0
  214. package/dist/cli/commands/skills/setup/sync.js.map +1 -0
  215. package/dist/cli/commands/skills/update.d.ts +7 -0
  216. package/dist/cli/commands/skills/update.d.ts.map +1 -0
  217. package/dist/cli/commands/skills/update.js +71 -0
  218. package/dist/cli/commands/skills/update.js.map +1 -0
  219. package/dist/cli/first-time.d.ts.map +1 -1
  220. package/dist/cli/first-time.js +4 -0
  221. package/dist/cli/first-time.js.map +1 -1
  222. package/dist/cli/index.js +2 -0
  223. package/dist/cli/index.js.map +1 -1
  224. package/dist/env/types.d.ts +14 -0
  225. package/dist/env/types.d.ts.map +1 -1
  226. package/dist/env/types.js.map +1 -1
  227. package/dist/providers/core/types.d.ts +1 -1
  228. package/dist/providers/core/types.d.ts.map +1 -1
  229. package/dist/providers/plugins/anthropic-subscription/anthropic-subscription.template.d.ts.map +1 -1
  230. package/dist/providers/plugins/anthropic-subscription/anthropic-subscription.template.js +26 -2
  231. package/dist/providers/plugins/anthropic-subscription/anthropic-subscription.template.js.map +1 -1
  232. package/dist/providers/plugins/sso/proxy/plugins/claude-request-normalizer.plugin.d.ts +31 -0
  233. package/dist/providers/plugins/sso/proxy/plugins/claude-request-normalizer.plugin.d.ts.map +1 -0
  234. package/dist/providers/plugins/sso/proxy/plugins/claude-request-normalizer.plugin.js +148 -0
  235. package/dist/providers/plugins/sso/proxy/plugins/claude-request-normalizer.plugin.js.map +1 -0
  236. package/dist/providers/plugins/sso/proxy/plugins/index.d.ts +12 -13
  237. package/dist/providers/plugins/sso/proxy/plugins/index.d.ts.map +1 -1
  238. package/dist/providers/plugins/sso/proxy/plugins/index.js +15 -17
  239. package/dist/providers/plugins/sso/proxy/plugins/index.js.map +1 -1
  240. package/dist/providers/plugins/sso/sso.http-client.d.ts +1 -1
  241. package/dist/providers/plugins/sso/sso.http-client.js +3 -3
  242. package/dist/providers/plugins/sso/sso.http-client.js.map +1 -1
  243. package/dist/providers/plugins/sso/sso.models.js +2 -2
  244. package/dist/providers/plugins/sso/sso.models.js.map +1 -1
  245. package/dist/providers/plugins/sso/sso.setup-steps.d.ts.map +1 -1
  246. package/dist/providers/plugins/sso/sso.setup-steps.js +6 -10
  247. package/dist/providers/plugins/sso/sso.setup-steps.js.map +1 -1
  248. package/dist/utils/config.d.ts +14 -3
  249. package/dist/utils/config.d.ts.map +1 -1
  250. package/dist/utils/config.js +95 -5
  251. package/dist/utils/config.js.map +1 -1
  252. package/package.json +22 -10
  253. package/scripts/copy-plugins.js +5 -0
  254. package/scripts/sonar/package.json +3 -0
  255. package/scripts/sonar/run-local-sonar.js +405 -0
  256. package/dist/agents/plugins/claude/plugin/commands/codemie-commit.md +0 -31
  257. package/dist/agents/plugins/claude/plugin/scripts/bash/rtk-auto-wrapper.sh +0 -81
  258. package/dist/providers/plugins/sso/proxy/plugins/claude-thinking-transformer.plugin.d.ts +0 -30
  259. package/dist/providers/plugins/sso/proxy/plugins/claude-thinking-transformer.plugin.d.ts.map +0 -1
  260. package/dist/providers/plugins/sso/proxy/plugins/claude-thinking-transformer.plugin.js +0 -111
  261. package/dist/providers/plugins/sso/proxy/plugins/claude-thinking-transformer.plugin.js.map +0 -1
@@ -0,0 +1,56 @@
1
+ ---
2
+ description: Save current session state as strict JSON to docs/handoff-context.md for the next session to resume from.
3
+ ---
4
+
5
+ # Handoff
6
+
7
+ Write current session state to `docs/handoff-context.md` as strict JSON. No preamble, no prose, no fences — pure JSON.
8
+
9
+ ## Procedure
10
+
11
+ 1. `docs/` missing? create (`mkdir -p docs` via Bash).
12
+ 2. Synthesize state from this conversation. Don't re-explore — use context already in memory.
13
+ 3. Write `docs/handoff-context.md` via Write tool. Must parse as valid JSON.
14
+ 4. Confirm ONE line: `Handoff saved: docs/handoff-context.md`.
15
+
16
+ ## Schema (strict — follow exactly)
17
+
18
+ ```json
19
+ {
20
+ "session_started": "ISO8601 best estimate",
21
+ "task": "one sentence — what the user asked for",
22
+ "completed_tasks": [
23
+ "one line each, concrete things finished this session"
24
+ ],
25
+ "current_state": "where things stand right now — in-flight work, files modified, what works, what's broken",
26
+ "constraints_to_preserve": [
27
+ "Quote verbatim. Cover: ruled-out approaches + why, user rules (don't do X, must do Y), technical constraints discovered"
28
+ ],
29
+ "files_touched": [
30
+ {"path": "absolute path", "status": "created|modified|deleted", "summary": "one line"}
31
+ ],
32
+ "issues_discovered": [
33
+ "bugs, gotchas, surprises found this session — and how we worked around them"
34
+ ],
35
+ "open_questions": [
36
+ "unresolved decisions the user must answer before next step"
37
+ ],
38
+ "next_steps": [
39
+ "ordered, specific. First item = literally first action for the new session"
40
+ ],
41
+ "resume_prompt": "one paragraph the user can paste into a fresh session to resume"
42
+ }
43
+ ```
44
+
45
+ ## Rules
46
+
47
+ - **Verbatim constraints**: never paraphrase user rules. Copy exact wording.
48
+ - **Concrete, not vague**: `"fixed token expiry in auth/middleware.ts:42"` not `"fixed auth bug"`.
49
+ - **Ordered `next_steps`**: array order = execution order.
50
+ - **No speculation**: unknown → omit. Empty arrays fine.
51
+ - **Pure JSON**: file must parse. No headings, no fences, no trailing prose.
52
+ - **Overwrite**: always overwrite. One handoff per project.
53
+
54
+ Verify: `head -3` of the output file shows the `---` frontmatter delimiters and the description line.
55
+
56
+ Report DONE or BLOCKED.
@@ -1,3 +1,8 @@
1
+ ---
2
+ description: Detect code changes and update project documentation to reflect current implementation. Only updates docs when changes are materially relevant.
3
+ allowed-tools: Bash, Read, Glob, Grep, Write, Edit
4
+ ---
5
+
1
6
  # Refresh and Audit Project Documentation
2
7
 
3
8
  **Purpose**: Intelligently detect code changes and update documentation to reflect current implementation.
@@ -104,7 +104,7 @@
104
104
  "hooks": [
105
105
  {
106
106
  "type": "command",
107
- "command": "~/.codemie/claude-plugin/scripts/bash/rtk-auto-wrapper.sh"
107
+ "command": "~/.codemie/claude-plugin/scripts/bash/rtk-rewrite.sh"
108
108
  }
109
109
  ]
110
110
  }
@@ -0,0 +1,101 @@
1
+ #!/usr/bin/env bash
2
+ # rtk-hook-version: 3
3
+ # RTK Claude Code hook — rewrites commands to use rtk for token savings.
4
+ # Requires: rtk >= 0.23.0, jq
5
+ #
6
+ # This is a thin delegating hook: all rewrite logic lives in `rtk rewrite`,
7
+ # which is the single source of truth (src/discover/registry.rs).
8
+ # To add or change rewrite rules, edit the Rust registry — not this file.
9
+ #
10
+ # Exit code protocol for `rtk rewrite`:
11
+ # 0 + stdout Rewrite found, no deny/ask rule matched → auto-allow
12
+ # 1 No RTK equivalent → pass through unchanged
13
+ # 2 Deny rule matched → pass through (Claude Code native deny handles it)
14
+ # 3 + stdout Ask rule matched → rewrite but let Claude Code prompt the user
15
+
16
+ if ! command -v jq &>/dev/null; then
17
+ echo "[rtk] WARNING: jq is not installed. Hook cannot rewrite commands. Install jq: https://jqlang.github.io/jq/download/" >&2
18
+ exit 0
19
+ fi
20
+
21
+ if ! command -v rtk &>/dev/null; then
22
+ echo "[rtk] WARNING: rtk is not installed or not in PATH. Hook cannot rewrite commands. Install: https://github.com/rtk-ai/rtk#installation" >&2
23
+ exit 0
24
+ fi
25
+
26
+ # Version guard: rtk rewrite was added in 0.23.0.
27
+ # Older binaries: warn once and exit cleanly (no silent failure).
28
+ # Cache the version check to avoid spawning multiple processes on every hook call.
29
+ CACHE_DIR=${XDG_CACHE_HOME:-$HOME/.cache}
30
+ CACHE_FILE="$CACHE_DIR/rtk-hook-version-ok"
31
+ if [ ! -f "$CACHE_FILE" ]; then
32
+ RTK_VERSION_RAW=$(rtk --version 2>/dev/null)
33
+ RTK_VERSION=${RTK_VERSION_RAW#rtk }
34
+ RTK_VERSION=${RTK_VERSION%% *}
35
+ if [ -n "$RTK_VERSION" ]; then
36
+ IFS=. read -r MAJOR MINOR PATCH <<<"$RTK_VERSION"
37
+ # Require >= 0.23.0
38
+ if [ "$MAJOR" -eq 0 ] && [ "$MINOR" -lt 23 ]; then
39
+ echo "[rtk] WARNING: rtk $RTK_VERSION is too old (need >= 0.23.0). Upgrade: cargo install rtk" >&2
40
+ exit 0
41
+ fi
42
+ fi
43
+ mkdir -p "$CACHE_DIR" 2>/dev/null
44
+ touch "$CACHE_FILE" 2>/dev/null
45
+ fi
46
+
47
+ INPUT=$(cat)
48
+ CMD=$(jq -r '.tool_input.command // empty' <<<"$INPUT")
49
+
50
+ if [ -z "$CMD" ]; then
51
+ exit 0
52
+ fi
53
+
54
+ # Delegate all rewrite + permission logic to the Rust binary.
55
+ REWRITTEN=$(rtk rewrite "$CMD" 2>/dev/null)
56
+ EXIT_CODE=$?
57
+
58
+ case $EXIT_CODE in
59
+ 0)
60
+ # Rewrite found, no permission rules matched — safe to auto-allow.
61
+ # If the output is identical, the command was already using RTK.
62
+ [ "$CMD" = "$REWRITTEN" ] && exit 0
63
+ ;;
64
+ 1)
65
+ # No RTK equivalent — pass through unchanged.
66
+ exit 0
67
+ ;;
68
+ 2)
69
+ # Deny rule matched — let Claude Code's native deny rule handle it.
70
+ exit 0
71
+ ;;
72
+ 3)
73
+ # Ask rule matched — rewrite the command but do NOT auto-allow so that
74
+ # Claude Code prompts the user for confirmation.
75
+ ;;
76
+ *)
77
+ exit 0
78
+ ;;
79
+ esac
80
+
81
+ if [ "$EXIT_CODE" -eq 3 ]; then
82
+ # Ask: rewrite the command, omit permissionDecision so Claude Code prompts.
83
+ jq -c --arg cmd "$REWRITTEN" \
84
+ '.tool_input.command = $cmd | {
85
+ "hookSpecificOutput": {
86
+ "hookEventName": "PreToolUse",
87
+ "updatedInput": .tool_input
88
+ }
89
+ }' <<<"$INPUT"
90
+ else
91
+ # Allow: rewrite the command and auto-allow.
92
+ jq -c --arg cmd "$REWRITTEN" \
93
+ '.tool_input.command = $cmd | {
94
+ "hookSpecificOutput": {
95
+ "hookEventName": "PreToolUse",
96
+ "permissionDecision": "allow",
97
+ "permissionDecisionReason": "RTK auto-rewrite",
98
+ "updatedInput": .tool_input
99
+ }
100
+ }' <<<"$INPUT"
101
+ fi
@@ -151,8 +151,11 @@ The script requests these Microsoft Graph scopes on first login:
151
151
  | `Mail.Send` | Sending emails |
152
152
  | `Calendars.Read` / `Calendars.ReadWrite` | Calendar events |
153
153
  | `Files.Read` / `Files.ReadWrite` | OneDrive files |
154
- | `Sites.Read.All` | SharePoint sites |
154
+ | `Sites.Read.All` | SharePoint sites (read) |
155
+ | `Sites.ReadWrite.All` | SharePoint sites (read & write) |
155
156
  | `Chat.Read` / `Chat.ReadWrite` | Teams chats |
157
+ | `ChannelMessage.Read.All` | Read Teams channel messages (requires admin consent) |
158
+ | `ChannelMessage.Send` | Send Teams channel messages |
156
159
  | `People.Read` | People rankings |
157
160
  | `Contacts.Read` | Outlook contacts |
158
161
  | `offline_access` | Silent token refresh |
@@ -1,14 +1,15 @@
1
1
  ---
2
2
  name: msgraph
3
3
  description: >
4
- Work with Microsoft 365 services via the Graph API — emails, calendar events, SharePoint sites,
5
- Teams chats, OneDrive files, OneNote notebooks, contacts, and org chart. Use this skill whenever
6
- the user asks about their emails, inbox, unread messages, meetings, calendar, Teams messages or
7
- chats, SharePoint documents, OneDrive files, OneNote notes or notebooks, colleagues, manager,
8
- direct reports, or any personal/organizational Microsoft data. Invoke proactively any time the
9
- user mentions Outlook, Teams, SharePoint, OneDrive, OneNote, or wants to interact with their
10
- Microsoft 365 account. The skill uses a local Node.js CLI (msgraph.js) that handles
11
- authentication, token caching, and all API calls.
4
+ Work with Microsoft 365 services via the Graph API — emails, calendar events, SharePoint sites
5
+ (read and write), Teams chats and channel messages, OneDrive files, OneNote notebooks, contacts,
6
+ and org chart. Use this skill whenever the user asks about their emails, inbox, unread messages,
7
+ meetings, calendar, Teams messages or chats, channel messages, SharePoint documents, OneDrive
8
+ files, OneNote notes or notebooks, colleagues, manager, direct reports, or any
9
+ personal/organizational Microsoft data. Invoke proactively any time the user mentions Outlook,
10
+ Teams, SharePoint, OneDrive, OneNote, or wants to interact with their Microsoft 365 account.
11
+ The skill uses a local Node.js CLI (msgraph.js) that handles authentication, token caching,
12
+ and all API calls.
12
13
  ---
13
14
 
14
15
  # Microsoft Graph API Skill
@@ -198,6 +199,19 @@ node ${CLAUDE_PLUGIN_ROOT}/skills/msgraph/scripts/msgraph.js onenote --create "M
198
199
  node ${CLAUDE_PLUGIN_ROOT}/skills/msgraph/scripts/msgraph.js onenote --notebooks --json
199
200
  ```
200
201
 
202
+ ### Channels
203
+
204
+ ```bash
205
+ # List channels in a team (use team ID from teams --teams-list)
206
+ node ${CLAUDE_PLUGIN_ROOT}/skills/msgraph/scripts/msgraph.js channels --team-id TEAM_ID --list
207
+
208
+ # Read recent messages in a channel
209
+ node ${CLAUDE_PLUGIN_ROOT}/skills/msgraph/scripts/msgraph.js channels --team-id TEAM_ID --channel-id CHANNEL_ID --messages
210
+
211
+ # Post a message to a channel
212
+ node ${CLAUDE_PLUGIN_ROOT}/skills/msgraph/scripts/msgraph.js channels --team-id TEAM_ID --channel-id CHANNEL_ID --send "Hello channel!"
213
+ ```
214
+
201
215
  ### Transcripts
202
216
 
203
217
  ```bash
@@ -274,6 +288,11 @@ node ${CLAUDE_PLUGIN_ROOT}/skills/msgraph/scripts/msgraph.js people --contacts
274
288
  2. Run `transcripts --meeting MEETING_ID` → lists available transcripts per meeting
275
289
  3. Run `transcripts --meeting MEETING_ID --transcript TRANSCRIPT_ID --output meeting.txt` → saves each transcript
276
290
 
291
+ ### "Post a message to a Teams channel"
292
+ 1. Run `teams --teams-list` → get the team ID
293
+ 2. Run `channels --team-id TEAM_ID --list` → get the channel ID
294
+ 3. Run `channels --team-id TEAM_ID --channel-id CHANNEL_ID --send "message"`
295
+
277
296
  ### "Who's my manager?" / "Who reports to me?"
278
297
  - Run `org --manager` or `org --reports`
279
298
 
@@ -40,7 +40,8 @@ const SCOPES = [
40
40
  'User.Read', 'Mail.Read', 'Mail.Send',
41
41
  'Calendars.Read', 'Calendars.ReadWrite',
42
42
  'Files.Read', 'Files.ReadWrite',
43
- 'Sites.Read.All', 'Chat.Read', 'Chat.ReadWrite',
43
+ 'Sites.Read.All', 'Sites.ReadWrite.All', 'Chat.Read', 'Chat.ReadWrite',
44
+ 'ChannelMessage.Read.All', 'ChannelMessage.Send',
44
45
  'OnlineMeetingTranscript.Read.All', 'OnlineMeetings.Read',
45
46
  'People.Read', 'Contacts.Read', 'offline_access',
46
47
  'Notes.Read', 'Notes.ReadWrite',
@@ -667,7 +668,7 @@ async function cmdTeams(args) {
667
668
  }
668
669
 
669
670
  if (args.send && args.chatId) {
670
- const res = await graphPost(`/me/chats/${args.chatId}/messages`, token, { body: { content: args.send } });
671
+ const res = await graphPost(`/me/chats/${args.chatId}/messages`, token, { body: { contentType: 'html', content: args.send } });
671
672
  console.log(`Message sent. ID: ${res.id}`);
672
673
  return;
673
674
  }
@@ -684,6 +685,61 @@ async function cmdTeams(args) {
684
685
  console.log(' --lookup-user EMAIL | --dm EMAIL --send MSG | --teams-list');
685
686
  }
686
687
 
688
+ async function cmdChannels(args) {
689
+ const token = await getValidToken();
690
+ const limit = parseInt(args.limit) || 20;
691
+
692
+ if (!args.teamId) {
693
+ console.error('Error: --team-id TEAM_ID is required');
694
+ console.log('channels --team-id ID --list');
695
+ console.log(' --team-id ID --channel-id ID --messages [--limit N]');
696
+ console.log(' --team-id ID --channel-id ID --send MSG');
697
+ process.exit(1);
698
+ }
699
+
700
+ if (args.list) {
701
+ const data = await graphGet(`/teams/${args.teamId}/channels`, token, { $select: 'id,displayName,description' });
702
+ const channels = data.value || [];
703
+ if (args.json) { console.log(JSON.stringify(channels, null, 2)); return; }
704
+ console.log(`\n${'ID'.padEnd(50)} Name`);
705
+ console.log('─'.repeat(80));
706
+ for (const c of channels)
707
+ console.log(`${(c.id || '').padEnd(50)} ${c.displayName || 'N/A'}`);
708
+ return;
709
+ }
710
+
711
+ if (!args.channelId) {
712
+ console.error('Error: --channel-id CHANNEL_ID is required');
713
+ process.exit(1);
714
+ }
715
+
716
+ if (args.messages) {
717
+ const data = await graphGet(`/teams/${args.teamId}/channels/${args.channelId}/messages`, token, { $top: limit });
718
+ const msgs = data.value || [];
719
+ if (args.json) { console.log(JSON.stringify(msgs, null, 2)); return; }
720
+ console.log(`\nMessages in channel ${args.channelId.slice(0, 30)}...:`);
721
+ console.log('─'.repeat(60));
722
+ for (const m of [...msgs].reverse()) {
723
+ const sender = m.from?.user?.displayName || 'System';
724
+ const body = stripHtml(m.body?.content || '').slice(0, 200);
725
+ console.log(`[${fmtDt(m.createdDateTime)}] ${sender}: ${body}`);
726
+ }
727
+ return;
728
+ }
729
+
730
+ if (args.send) {
731
+ const res = await graphPost(`/teams/${args.teamId}/channels/${args.channelId}/messages`, token, {
732
+ body: { contentType: 'html', content: args.send },
733
+ });
734
+ console.log(`Message sent. ID: ${res.id}`);
735
+ return;
736
+ }
737
+
738
+ console.log('channels --team-id ID --list');
739
+ console.log(' --team-id ID --channel-id ID --messages [--limit N]');
740
+ console.log(' --team-id ID --channel-id ID --send MSG');
741
+ }
742
+
687
743
  async function cmdTranscripts(args) {
688
744
  const token = await getValidToken();
689
745
 
@@ -1098,7 +1154,7 @@ async function cmdOnenote(args) {
1098
1154
  // ── CLI Parser ────────────────────────────────────────────────────────────────
1099
1155
  function parseArgs(argv) {
1100
1156
  const BOOL = new Set(['json','unread','sites','chats','teamsList','contacts',
1101
- 'manager','reports','availability','notebooks','list','vtt','help','force']);
1157
+ 'manager','reports','availability','notebooks','list','messages','vtt','help','force']);
1102
1158
  const args = { _: [] };
1103
1159
  let i = 0;
1104
1160
  while (i < argv.length) {
@@ -1140,6 +1196,9 @@ Data:
1140
1196
  sharepoint [--sites] [--site ID [--path P]] [--download ID [--output FILE]] [--json]
1141
1197
  teams [--chats] [--messages CHAT_ID] [--send MSG --chat-id ID] [--teams-list]
1142
1198
  [--lookup-user EMAIL] [--dm EMAIL --send MSG] [--json]
1199
+ channels --team-id ID --list
1200
+ --team-id ID --channel-id ID --messages [--limit N]
1201
+ --team-id ID --channel-id ID --send MSG [--json]
1143
1202
  onedrive [--path P] [--upload FILE [--dest PATH]] [--download ID [--output FILE]]
1144
1203
  [--info ID] [--json]
1145
1204
  people [--contacts] [--search NAME] [--limit N] [--json]
@@ -1170,6 +1229,7 @@ async function main() {
1170
1229
  emails: () => cmdEmails(args),
1171
1230
  calendar: () => cmdCalendar(args),
1172
1231
  sharepoint: () => cmdSharepoint(args),
1232
+ channels: () => cmdChannels(args),
1173
1233
  teams: () => cmdTeams(args),
1174
1234
  onedrive: () => cmdOnedrive(args),
1175
1235
  people: () => cmdPeople(args),
@@ -10,6 +10,7 @@ description: >-
10
10
  automatically collects diagnostic context (OS, Node.js, CLI version, installed agents,
11
11
  active profile, codemie doctor output, recent debug logs) and creates a structured GitHub
12
12
  issue via `gh issue create` with a user-confirmed preview step before submission.
13
+ allowed-tools: [Bash, Read, Grep]
13
14
  ---
14
15
 
15
16
  # Report Issue to CodeMie Code
Binary file
@@ -0,0 +1,166 @@
1
+ /**
2
+ * skills.sh egress guard
3
+ *
4
+ * Loaded into the upstream `skills` CLI child process via `NODE_OPTIONS=--require`.
5
+ * Wraps `globalThis.fetch` and rejects only requests targeting the upstream
6
+ * telemetry/audit host so legitimate skill source fetches still work.
7
+ *
8
+ * Blocked: add-skill.vercel.sh
9
+ */
10
+
11
+ 'use strict';
12
+
13
+ const { stripVTControlCharacters } = require('node:util');
14
+
15
+ const BLOCKED_HOST = 'add-skill.vercel.sh';
16
+ const ERROR_MESSAGE = `Request to ${BLOCKED_HOST} blocked by codemie skill wrapper (CODEMIE_SKILL_EGRESS_BLOCKED)`;
17
+ const TELEMETRY_MARKER = 'CODEMIE_SKILLS_SH_TELEMETRY';
18
+
19
+ const originalFetch = globalThis.fetch;
20
+
21
+ if (typeof originalFetch === 'function') {
22
+ globalThis.fetch = function patchedFetch(input, init) {
23
+ try {
24
+ const url = extractUrl(input);
25
+ if (url && shouldForcePublicRepoProbe(url)) {
26
+ // Upstream sends selected skill names only for repos it classifies as
27
+ // public. CodeMie captures that payload locally and blocks the outbound
28
+ // telemetry request below, so force the probe public without leaking the
29
+ // repo visibility decision to add-skill.vercel.sh.
30
+ return Promise.resolve(
31
+ new globalThis.Response(JSON.stringify({ private: false }), {
32
+ status: 200,
33
+ headers: { 'Content-Type': 'application/json' },
34
+ })
35
+ );
36
+ }
37
+ if (url && isBlockedHost(url)) {
38
+ emitTelemetryPayload(url);
39
+ return Promise.reject(new Error(ERROR_MESSAGE));
40
+ }
41
+ } catch {
42
+ // If URL parsing fails for an unexpected input shape, fall through
43
+ // to the original fetch rather than blocking unrelated traffic.
44
+ }
45
+ return originalFetch.call(this, input, init);
46
+ };
47
+ }
48
+
49
+ if (process.env.CODEMIE_CAPTURE_SKILLS_SH_UPDATE_STDOUT === '1') {
50
+ patchStdoutForUpdateResults();
51
+ }
52
+
53
+ function extractUrl(input) {
54
+ if (!input) {
55
+ return null;
56
+ }
57
+ if (typeof input === 'string') {
58
+ return input;
59
+ }
60
+ if (typeof globalThis.URL !== 'undefined' && input instanceof globalThis.URL) {
61
+ return input.href;
62
+ }
63
+ if (typeof input === 'object' && typeof input.url === 'string') {
64
+ return input.url;
65
+ }
66
+ return null;
67
+ }
68
+
69
+ function isBlockedHost(rawUrl) {
70
+ let parsed;
71
+ try {
72
+ parsed = new globalThis.URL(rawUrl);
73
+ } catch {
74
+ return false;
75
+ }
76
+ return parsed.host === BLOCKED_HOST || parsed.hostname === BLOCKED_HOST;
77
+ }
78
+
79
+ function shouldForcePublicRepoProbe(rawUrl) {
80
+ if (process.env.CODEMIE_CAPTURE_SKILLS_SH_INSTALL_TELEMETRY !== '1') {
81
+ return false;
82
+ }
83
+
84
+ let parsed;
85
+ try {
86
+ parsed = new globalThis.URL(rawUrl);
87
+ } catch {
88
+ return false;
89
+ }
90
+
91
+ return (
92
+ parsed.hostname === 'api.github.com' &&
93
+ /^\/repos\/[^/]+\/[^/]+$/.test(parsed.pathname)
94
+ );
95
+ }
96
+
97
+ function emitTelemetryPayload(rawUrl) {
98
+ let parsed;
99
+ try {
100
+ parsed = new globalThis.URL(rawUrl);
101
+ } catch {
102
+ return;
103
+ }
104
+
105
+ if (parsed.pathname !== '/t') {
106
+ return;
107
+ }
108
+
109
+ const payload = {};
110
+ for (const [key, value] of parsed.searchParams.entries()) {
111
+ payload[key] = value;
112
+ }
113
+
114
+ try {
115
+ emitPayload(payload);
116
+ } catch {
117
+ // Debug/capture output must never affect the upstream command.
118
+ }
119
+ }
120
+
121
+ function patchStdoutForUpdateResults() {
122
+ const originalWrite = process.stdout.write.bind(process.stdout);
123
+ let buffered = '';
124
+
125
+ process.stdout.write = function patchedStdoutWrite(chunk, encoding, callback) {
126
+ try {
127
+ // `skills update` does not expose structured per-skill results. It does
128
+ // print one stable success line per updated skill, even in interactive
129
+ // mode where stdout is inherited by the parent. Intercepting stdout in
130
+ // the child lets CodeMie capture those success names without parsing the
131
+ // human terminal stream in the parent process.
132
+ buffered += Buffer.isBuffer(chunk) ? chunk.toString('utf-8') : String(chunk);
133
+ const lines = buffered.split(/\r?\n/);
134
+ buffered = lines.pop() || '';
135
+ for (const line of lines) {
136
+ captureUpdatedSkillLine(line);
137
+ }
138
+ } catch {
139
+ // Output capture must not affect normal CLI rendering.
140
+ }
141
+
142
+ return originalWrite(chunk, encoding, callback);
143
+ };
144
+ }
145
+
146
+ function captureUpdatedSkillLine(rawLine) {
147
+ const line = stripVTControlCharacters(rawLine).trim();
148
+ const match = /^✓\s+Updated\s+(.+)$/.exec(line);
149
+ if (!match) {
150
+ return;
151
+ }
152
+
153
+ const skill = match[1].trim();
154
+ if (!skill || /^\d+\s+skill\(s\)$/.test(skill)) {
155
+ return;
156
+ }
157
+
158
+ emitPayload({
159
+ event: 'update',
160
+ skills: skill,
161
+ });
162
+ }
163
+
164
+ function emitPayload(payload) {
165
+ process.stderr.write(`${TELEMETRY_MARKER} ${JSON.stringify(payload)}\n`);
166
+ }
@@ -1,26 +1,2 @@
1
- /**
2
- * Shared constants for setup command
3
- *
4
- * Constants used across selection, configuration, and summary modules
5
- */
6
- /**
7
- * Color palette used across all setup UI components
8
- */
9
- export declare const COLOR: {
10
- readonly PURPLE: {
11
- readonly r: 177;
12
- readonly g: 185;
13
- readonly b: 249;
14
- };
15
- };
16
- /**
17
- * Action types for user interactions
18
- */
19
- export declare const ACTION_TYPE: {
20
- readonly CANCEL: "cancel";
21
- readonly APPLY: "apply";
22
- readonly UPDATE: "update";
23
- readonly BACK: "back";
24
- };
25
- export type ActionType = typeof ACTION_TYPE[keyof typeof ACTION_TYPE];
1
+ export { COLOR, ACTION_TYPE, type ActionType } from '../../../../cli/commands/shared/constants.js';
26
2
  //# sourceMappingURL=constants.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../../src/cli/commands/assistants/setup/constants.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;GAEG;AACH,eAAO,MAAM,KAAK;;;;;;CAER,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,WAAW;;;;;CAKd,CAAC;AAEX,MAAM,MAAM,UAAU,GAAG,OAAO,WAAW,CAAC,MAAM,OAAO,WAAW,CAAC,CAAC"}
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../../src/cli/commands/assistants/setup/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,KAAK,UAAU,EAAE,MAAM,oCAAoC,CAAC"}
@@ -1,21 +1,2 @@
1
- /**
2
- * Shared constants for setup command
3
- *
4
- * Constants used across selection, configuration, and summary modules
5
- */
6
- /**
7
- * Color palette used across all setup UI components
8
- */
9
- export const COLOR = {
10
- PURPLE: { r: 177, g: 185, b: 249 },
11
- };
12
- /**
13
- * Action types for user interactions
14
- */
15
- export const ACTION_TYPE = {
16
- CANCEL: 'cancel',
17
- APPLY: 'apply',
18
- UPDATE: 'update',
19
- BACK: 'back',
20
- };
1
+ export { COLOR, ACTION_TYPE } from '../../../../cli/commands/shared/constants.js';
21
2
  //# sourceMappingURL=constants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../src/cli/commands/assistants/setup/constants.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;GAEG;AACH,MAAM,CAAC,MAAM,KAAK,GAAG;IACpB,MAAM,EAAE,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAW;CAClC,CAAC;AAEX;;GAEG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG;IAC1B,MAAM,EAAE,QAAQ;IAChB,KAAK,EAAE,OAAO;IACd,MAAM,EAAE,QAAQ;IAChB,IAAI,EAAE,MAAM;CACH,CAAC"}
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../src/cli/commands/assistants/setup/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,WAAW,EAAmB,MAAM,oCAAoC,CAAC"}
@@ -15,12 +15,12 @@ export declare function createClaudeSubagentMetadata(assistant: Assistant): stri
15
15
  export declare function createClaudeSubagentContent(assistant: Assistant): string;
16
16
  /**
17
17
  * Register Claude subagent
18
- * Creates subagent file in ~/.claude/agents/
18
+ * Creates subagent file in ~/.claude/agents/ (global) or {cwd}/.claude/agents/ (local)
19
19
  */
20
- export declare function registerClaudeSubagent(assistant: Assistant): Promise<void>;
20
+ export declare function registerClaudeSubagent(assistant: Assistant, scope?: 'global' | 'local', workingDir?: string): Promise<void>;
21
21
  /**
22
22
  * Unregister Claude subagent
23
- * Removes subagent file from ~/.claude/agents/
23
+ * Removes subagent file from ~/.claude/agents/ (global) or {cwd}/.claude/agents/ (local)
24
24
  */
25
- export declare function unregisterClaudeSubagent(slug: string): Promise<void>;
25
+ export declare function unregisterClaudeSubagent(slug: string, scope?: 'global' | 'local', workingDir?: string): Promise<void>;
26
26
  //# sourceMappingURL=claude-agent-generator.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"claude-agent-generator.d.ts","sourceRoot":"","sources":["../../../../../../src/cli/commands/assistants/setup/generators/claude-agent-generator.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAMH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAG7C;;GAEG;AACH,wBAAgB,4BAA4B,CAAC,SAAS,EAAE,SAAS,GAAG,MAAM,CAezE;AAED;;GAEG;AACH,wBAAgB,2BAA2B,CAAC,SAAS,EAAE,SAAS,GAAG,MAAM,CA6CxE;AAWD;;;GAGG;AACH,wBAAsB,sBAAsB,CAAC,SAAS,EAAE,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,CAsBhF;AAED;;;GAGG;AACH,wBAAsB,wBAAwB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAe1E"}
1
+ {"version":3,"file":"claude-agent-generator.d.ts","sourceRoot":"","sources":["../../../../../../src/cli/commands/assistants/setup/generators/claude-agent-generator.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAMH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAG7C;;GAEG;AACH,wBAAgB,4BAA4B,CAAC,SAAS,EAAE,SAAS,GAAG,MAAM,CAezE;AAED;;GAEG;AACH,wBAAgB,2BAA2B,CAAC,SAAS,EAAE,SAAS,GAAG,MAAM,CA6CxE;AAYD;;;GAGG;AACH,wBAAsB,sBAAsB,CAAC,SAAS,EAAE,SAAS,EAAE,KAAK,GAAE,QAAQ,GAAG,OAAkB,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAsB3I;AAED;;;GAGG;AACH,wBAAsB,wBAAwB,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,GAAE,QAAQ,GAAG,OAAkB,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAerI"}
@@ -78,17 +78,18 @@ export function createClaudeSubagentContent(assistant) {
78
78
  /**
79
79
  * Get subagent file path for a given slug
80
80
  */
81
- function getSubagentFilePath(slug) {
82
- const homeDir = os.homedir();
83
- const fileName = `${slug}.md`;
84
- return path.join(homeDir, '.claude', 'agents', fileName);
81
+ function getSubagentFilePath(slug, scope = 'global', workingDir) {
82
+ const agentsDir = scope === 'local' && workingDir
83
+ ? path.join(workingDir, '.claude', 'agents')
84
+ : path.join(os.homedir(), '.claude', 'agents');
85
+ return path.join(agentsDir, `${slug}.md`);
85
86
  }
86
87
  /**
87
88
  * Register Claude subagent
88
- * Creates subagent file in ~/.claude/agents/
89
+ * Creates subagent file in ~/.claude/agents/ (global) or {cwd}/.claude/agents/ (local)
89
90
  */
90
- export async function registerClaudeSubagent(assistant) {
91
- const subagentPath = getSubagentFilePath(assistant.slug);
91
+ export async function registerClaudeSubagent(assistant, scope = 'global', workingDir) {
92
+ const subagentPath = getSubagentFilePath(assistant.slug, scope, workingDir);
92
93
  const claudeAgentsDir = path.dirname(subagentPath);
93
94
  logger.debug('Registering Claude subagent', {
94
95
  assistantId: assistant.id,
@@ -108,10 +109,10 @@ export async function registerClaudeSubagent(assistant) {
108
109
  }
109
110
  /**
110
111
  * Unregister Claude subagent
111
- * Removes subagent file from ~/.claude/agents/
112
+ * Removes subagent file from ~/.claude/agents/ (global) or {cwd}/.claude/agents/ (local)
112
113
  */
113
- export async function unregisterClaudeSubagent(slug) {
114
- const subagentPath = getSubagentFilePath(slug);
114
+ export async function unregisterClaudeSubagent(slug, scope = 'global', workingDir) {
115
+ const subagentPath = getSubagentFilePath(slug, scope, workingDir);
115
116
  try {
116
117
  await fs.unlink(subagentPath);
117
118
  logger.debug('Claude subagent unregistered', {