@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.
- package/README.md +56 -15
- package/dist/agents/core/BaseAgentAdapter.d.ts.map +1 -1
- package/dist/agents/core/BaseAgentAdapter.js +3 -0
- package/dist/agents/core/BaseAgentAdapter.js.map +1 -1
- package/dist/agents/plugins/claude/claude.plugin.d.ts.map +1 -1
- package/dist/agents/plugins/claude/claude.plugin.js +18 -0
- package/dist/agents/plugins/claude/claude.plugin.js.map +1 -1
- package/dist/agents/plugins/claude/plugin/.claude-plugin/plugin.json +1 -1
- package/dist/agents/plugins/claude/plugin/commands/README.md +2 -31
- package/dist/agents/plugins/claude/plugin/commands/codemie-catchup.md +5 -0
- package/dist/agents/plugins/claude/plugin/commands/codemie-init.md +42 -43
- package/dist/agents/plugins/claude/plugin/commands/codemie-subagents.md +5 -0
- package/dist/agents/plugins/claude/plugin/commands/handoff.md +56 -0
- package/dist/agents/plugins/claude/plugin/commands/memory-refresh.md +5 -0
- package/dist/agents/plugins/claude/plugin/hooks/hooks.json +1 -1
- package/dist/agents/plugins/claude/plugin/scripts/bash/rtk-rewrite.sh +101 -0
- package/dist/agents/plugins/claude/plugin/skills/msgraph/README.md +4 -1
- package/dist/agents/plugins/claude/plugin/skills/msgraph/SKILL.md +27 -8
- package/dist/agents/plugins/claude/plugin/skills/msgraph/scripts/msgraph.js +63 -3
- package/dist/agents/plugins/claude/plugin/skills/report-issue/SKILL.md +1 -0
- package/dist/assets/demo.gif +0 -0
- package/dist/assets/skills-sh-egress-guard.cjs +166 -0
- package/dist/cli/commands/assistants/setup/constants.d.ts +1 -25
- package/dist/cli/commands/assistants/setup/constants.d.ts.map +1 -1
- package/dist/cli/commands/assistants/setup/constants.js +1 -20
- package/dist/cli/commands/assistants/setup/constants.js.map +1 -1
- package/dist/cli/commands/assistants/setup/generators/claude-agent-generator.d.ts +4 -4
- package/dist/cli/commands/assistants/setup/generators/claude-agent-generator.d.ts.map +1 -1
- package/dist/cli/commands/assistants/setup/generators/claude-agent-generator.js +11 -10
- package/dist/cli/commands/assistants/setup/generators/claude-agent-generator.js.map +1 -1
- package/dist/cli/commands/assistants/setup/generators/claude-skill-generator.d.ts +4 -4
- package/dist/cli/commands/assistants/setup/generators/claude-skill-generator.d.ts.map +1 -1
- package/dist/cli/commands/assistants/setup/generators/claude-skill-generator.js +11 -9
- package/dist/cli/commands/assistants/setup/generators/claude-skill-generator.js.map +1 -1
- package/dist/cli/commands/assistants/setup/helpers.d.ts +4 -18
- package/dist/cli/commands/assistants/setup/helpers.d.ts.map +1 -1
- package/dist/cli/commands/assistants/setup/helpers.js +10 -60
- package/dist/cli/commands/assistants/setup/helpers.js.map +1 -1
- package/dist/cli/commands/assistants/setup/index.d.ts +0 -8
- package/dist/cli/commands/assistants/setup/index.d.ts.map +1 -1
- package/dist/cli/commands/assistants/setup/index.js +20 -164
- package/dist/cli/commands/assistants/setup/index.js.map +1 -1
- package/dist/cli/commands/assistants/setup/selection/actions.d.ts +1 -30
- package/dist/cli/commands/assistants/setup/selection/actions.d.ts.map +1 -1
- package/dist/cli/commands/assistants/setup/selection/actions.js +1 -320
- package/dist/cli/commands/assistants/setup/selection/actions.js.map +1 -1
- package/dist/cli/commands/assistants/setup/selection/constants.d.ts +3 -65
- package/dist/cli/commands/assistants/setup/selection/constants.d.ts.map +1 -1
- package/dist/cli/commands/assistants/setup/selection/constants.js +4 -81
- package/dist/cli/commands/assistants/setup/selection/constants.js.map +1 -1
- package/dist/cli/commands/assistants/setup/selection/index.d.ts +1 -9
- package/dist/cli/commands/assistants/setup/selection/index.d.ts.map +1 -1
- package/dist/cli/commands/assistants/setup/selection/index.js +14 -34
- package/dist/cli/commands/assistants/setup/selection/index.js.map +1 -1
- package/dist/cli/commands/assistants/setup/selection/interactive-prompt.d.ts +1 -19
- package/dist/cli/commands/assistants/setup/selection/interactive-prompt.d.ts.map +1 -1
- package/dist/cli/commands/assistants/setup/selection/interactive-prompt.js +1 -338
- package/dist/cli/commands/assistants/setup/selection/interactive-prompt.js.map +1 -1
- package/dist/cli/commands/assistants/setup/selection/types.d.ts +7 -23
- package/dist/cli/commands/assistants/setup/selection/types.d.ts.map +1 -1
- package/dist/cli/commands/assistants/setup/selection/ui.d.ts +0 -8
- package/dist/cli/commands/assistants/setup/selection/ui.d.ts.map +1 -1
- package/dist/cli/commands/assistants/setup/selection/ui.js +7 -123
- package/dist/cli/commands/assistants/setup/selection/ui.js.map +1 -1
- package/dist/cli/commands/doctor/index.d.ts.map +1 -1
- package/dist/cli/commands/doctor/index.js +10 -1
- package/dist/cli/commands/doctor/index.js.map +1 -1
- package/dist/cli/commands/proxy/connectors/desktop-managed-mcp-servers.json +50 -0
- package/dist/cli/commands/proxy/connectors/desktop.d.ts +13 -3
- package/dist/cli/commands/proxy/connectors/desktop.d.ts.map +1 -1
- package/dist/cli/commands/proxy/connectors/desktop.js +47 -4
- package/dist/cli/commands/proxy/connectors/desktop.js.map +1 -1
- package/dist/cli/commands/proxy/index.d.ts.map +1 -1
- package/dist/cli/commands/proxy/index.js +89 -52
- package/dist/cli/commands/proxy/index.js.map +1 -1
- package/dist/cli/commands/setup.d.ts.map +1 -1
- package/dist/cli/commands/setup.js +2 -0
- package/dist/cli/commands/setup.js.map +1 -1
- package/dist/cli/commands/shared/constants.d.ts +15 -0
- package/dist/cli/commands/shared/constants.d.ts.map +1 -0
- package/dist/cli/commands/shared/constants.js +10 -0
- package/dist/cli/commands/shared/constants.js.map +1 -0
- package/dist/cli/commands/shared/helpers.d.ts +12 -0
- package/dist/cli/commands/shared/helpers.d.ts.map +1 -0
- package/dist/cli/commands/shared/helpers.js +54 -0
- package/dist/cli/commands/shared/helpers.js.map +1 -0
- package/dist/cli/commands/shared/prompts/storage-scope.d.ts +6 -0
- package/dist/cli/commands/shared/prompts/storage-scope.d.ts.map +1 -0
- package/dist/cli/commands/shared/prompts/storage-scope.js +84 -0
- package/dist/cli/commands/shared/prompts/storage-scope.js.map +1 -0
- package/dist/cli/commands/shared/selection/actions.d.ts +40 -0
- package/dist/cli/commands/shared/selection/actions.d.ts.map +1 -0
- package/dist/cli/commands/shared/selection/actions.js +264 -0
- package/dist/cli/commands/shared/selection/actions.js.map +1 -0
- package/dist/cli/commands/shared/selection/constants.d.ts +68 -0
- package/dist/cli/commands/shared/selection/constants.d.ts.map +1 -0
- package/dist/cli/commands/shared/selection/constants.js +70 -0
- package/dist/cli/commands/shared/selection/constants.js.map +1 -0
- package/dist/cli/commands/shared/selection/interactive-prompt.d.ts +16 -0
- package/dist/cli/commands/shared/selection/interactive-prompt.d.ts.map +1 -0
- package/dist/cli/commands/shared/selection/interactive-prompt.js +276 -0
- package/dist/cli/commands/shared/selection/interactive-prompt.js.map +1 -0
- package/dist/cli/commands/shared/selection/types.d.ts +31 -0
- package/dist/cli/commands/shared/selection/types.d.ts.map +1 -0
- package/dist/cli/commands/shared/selection/types.js +2 -0
- package/dist/cli/commands/shared/selection/types.js.map +1 -0
- package/dist/cli/commands/shared/selection/ui.d.ts +9 -0
- package/dist/cli/commands/shared/selection/ui.d.ts.map +1 -0
- package/dist/cli/commands/shared/selection/ui.js +92 -0
- package/dist/cli/commands/shared/selection/ui.js.map +1 -0
- package/dist/cli/commands/skills/add.d.ts +9 -0
- package/dist/cli/commands/skills/add.d.ts.map +1 -0
- package/dist/cli/commands/skills/add.js +187 -0
- package/dist/cli/commands/skills/add.js.map +1 -0
- package/dist/cli/commands/skills/find.d.ts +17 -0
- package/dist/cli/commands/skills/find.d.ts.map +1 -0
- package/dist/cli/commands/skills/find.js +94 -0
- package/dist/cli/commands/skills/find.js.map +1 -0
- package/dist/cli/commands/skills/index.d.ts +10 -0
- package/dist/cli/commands/skills/index.d.ts.map +1 -0
- package/dist/cli/commands/skills/index.js +23 -0
- package/dist/cli/commands/skills/index.js.map +1 -0
- package/dist/cli/commands/skills/lib/agent-detection.d.ts +27 -0
- package/dist/cli/commands/skills/lib/agent-detection.d.ts.map +1 -0
- package/dist/cli/commands/skills/lib/agent-detection.js +50 -0
- package/dist/cli/commands/skills/lib/agent-detection.js.map +1 -0
- package/dist/cli/commands/skills/lib/error-classify.d.ts +14 -0
- package/dist/cli/commands/skills/lib/error-classify.d.ts.map +1 -0
- package/dist/cli/commands/skills/lib/error-classify.js +64 -0
- package/dist/cli/commands/skills/lib/error-classify.js.map +1 -0
- package/dist/cli/commands/skills/lib/require-auth.d.ts +17 -0
- package/dist/cli/commands/skills/lib/require-auth.d.ts.map +1 -0
- package/dist/cli/commands/skills/lib/require-auth.js +44 -0
- package/dist/cli/commands/skills/lib/require-auth.js.map +1 -0
- package/dist/cli/commands/skills/lib/result-render.d.ts +26 -0
- package/dist/cli/commands/skills/lib/result-render.d.ts.map +1 -0
- package/dist/cli/commands/skills/lib/result-render.js +77 -0
- package/dist/cli/commands/skills/lib/result-render.js.map +1 -0
- package/dist/cli/commands/skills/lib/run-skills-cli.d.ts +46 -0
- package/dist/cli/commands/skills/lib/run-skills-cli.d.ts.map +1 -0
- package/dist/cli/commands/skills/lib/run-skills-cli.js +217 -0
- package/dist/cli/commands/skills/lib/run-skills-cli.js.map +1 -0
- package/dist/cli/commands/skills/lib/sanitize.d.ts +17 -0
- package/dist/cli/commands/skills/lib/sanitize.d.ts.map +1 -0
- package/dist/cli/commands/skills/lib/sanitize.js +73 -0
- package/dist/cli/commands/skills/lib/sanitize.js.map +1 -0
- package/dist/cli/commands/skills/lib/skills-metrics.d.ts +74 -0
- package/dist/cli/commands/skills/lib/skills-metrics.d.ts.map +1 -0
- package/dist/cli/commands/skills/lib/skills-metrics.js +268 -0
- package/dist/cli/commands/skills/lib/skills-metrics.js.map +1 -0
- package/dist/cli/commands/skills/lib/skills-search-client.d.ts +36 -0
- package/dist/cli/commands/skills/lib/skills-search-client.d.ts.map +1 -0
- package/dist/cli/commands/skills/lib/skills-search-client.js +147 -0
- package/dist/cli/commands/skills/lib/skills-search-client.js.map +1 -0
- package/dist/cli/commands/skills/lib/skills-sh-telemetry.d.ts +10 -0
- package/dist/cli/commands/skills/lib/skills-sh-telemetry.d.ts.map +1 -0
- package/dist/cli/commands/skills/lib/skills-sh-telemetry.js +33 -0
- package/dist/cli/commands/skills/lib/skills-sh-telemetry.js.map +1 -0
- package/dist/cli/commands/skills/list.d.ts +13 -0
- package/dist/cli/commands/skills/list.d.ts.map +1 -0
- package/dist/cli/commands/skills/list.js +55 -0
- package/dist/cli/commands/skills/list.js.map +1 -0
- package/dist/cli/commands/skills/remove.d.ts +11 -0
- package/dist/cli/commands/skills/remove.d.ts.map +1 -0
- package/dist/cli/commands/skills/remove.js +93 -0
- package/dist/cli/commands/skills/remove.js.map +1 -0
- package/dist/cli/commands/skills/setup/constants.d.ts +2 -0
- package/dist/cli/commands/skills/setup/constants.d.ts.map +1 -0
- package/dist/cli/commands/skills/setup/constants.js +2 -0
- package/dist/cli/commands/skills/setup/constants.js.map +1 -0
- package/dist/cli/commands/skills/setup/data.d.ts +28 -0
- package/dist/cli/commands/skills/setup/data.d.ts.map +1 -0
- package/dist/cli/commands/skills/setup/data.js +79 -0
- package/dist/cli/commands/skills/setup/data.js.map +1 -0
- package/dist/cli/commands/skills/setup/generators/claude-skill-generator.d.ts +12 -0
- package/dist/cli/commands/skills/setup/generators/claude-skill-generator.d.ts.map +1 -0
- package/dist/cli/commands/skills/setup/generators/claude-skill-generator.js +94 -0
- package/dist/cli/commands/skills/setup/generators/claude-skill-generator.js.map +1 -0
- package/dist/cli/commands/skills/setup/helpers.d.ts +12 -0
- package/dist/cli/commands/skills/setup/helpers.d.ts.map +1 -0
- package/dist/cli/commands/skills/setup/helpers.js +31 -0
- package/dist/cli/commands/skills/setup/helpers.js.map +1 -0
- package/dist/cli/commands/skills/setup/index.d.ts +5 -0
- package/dist/cli/commands/skills/setup/index.d.ts.map +1 -0
- package/dist/cli/commands/skills/setup/index.js +137 -0
- package/dist/cli/commands/skills/setup/index.js.map +1 -0
- package/dist/cli/commands/skills/setup/selection/actions.d.ts +2 -0
- package/dist/cli/commands/skills/setup/selection/actions.d.ts.map +1 -0
- package/dist/cli/commands/skills/setup/selection/actions.js +2 -0
- package/dist/cli/commands/skills/setup/selection/actions.js.map +1 -0
- package/dist/cli/commands/skills/setup/selection/constants.d.ts +11 -0
- package/dist/cli/commands/skills/setup/selection/constants.d.ts.map +1 -0
- package/dist/cli/commands/skills/setup/selection/constants.js +11 -0
- package/dist/cli/commands/skills/setup/selection/constants.js.map +1 -0
- package/dist/cli/commands/skills/setup/selection/index.d.ts +13 -0
- package/dist/cli/commands/skills/setup/selection/index.d.ts.map +1 -0
- package/dist/cli/commands/skills/setup/selection/index.js +113 -0
- package/dist/cli/commands/skills/setup/selection/index.js.map +1 -0
- package/dist/cli/commands/skills/setup/selection/interactive-prompt.d.ts +2 -0
- package/dist/cli/commands/skills/setup/selection/interactive-prompt.d.ts.map +1 -0
- package/dist/cli/commands/skills/setup/selection/interactive-prompt.js +2 -0
- package/dist/cli/commands/skills/setup/selection/interactive-prompt.js.map +1 -0
- package/dist/cli/commands/skills/setup/selection/types.d.ts +13 -0
- package/dist/cli/commands/skills/setup/selection/types.d.ts.map +1 -0
- package/dist/cli/commands/skills/setup/selection/types.js +2 -0
- package/dist/cli/commands/skills/setup/selection/types.js.map +1 -0
- package/dist/cli/commands/skills/setup/selection/ui.d.ts +3 -0
- package/dist/cli/commands/skills/setup/selection/ui.d.ts.map +1 -0
- package/dist/cli/commands/skills/setup/selection/ui.js +68 -0
- package/dist/cli/commands/skills/setup/selection/ui.js.map +1 -0
- package/dist/cli/commands/skills/setup/sync.d.ts +13 -0
- package/dist/cli/commands/skills/setup/sync.d.ts.map +1 -0
- package/dist/cli/commands/skills/setup/sync.js +46 -0
- package/dist/cli/commands/skills/setup/sync.js.map +1 -0
- package/dist/cli/commands/skills/update.d.ts +7 -0
- package/dist/cli/commands/skills/update.d.ts.map +1 -0
- package/dist/cli/commands/skills/update.js +71 -0
- package/dist/cli/commands/skills/update.js.map +1 -0
- package/dist/cli/first-time.d.ts.map +1 -1
- package/dist/cli/first-time.js +4 -0
- package/dist/cli/first-time.js.map +1 -1
- package/dist/cli/index.js +2 -0
- package/dist/cli/index.js.map +1 -1
- package/dist/env/types.d.ts +14 -0
- package/dist/env/types.d.ts.map +1 -1
- package/dist/env/types.js.map +1 -1
- package/dist/providers/core/types.d.ts +1 -1
- package/dist/providers/core/types.d.ts.map +1 -1
- package/dist/providers/plugins/anthropic-subscription/anthropic-subscription.template.d.ts.map +1 -1
- package/dist/providers/plugins/anthropic-subscription/anthropic-subscription.template.js +26 -2
- package/dist/providers/plugins/anthropic-subscription/anthropic-subscription.template.js.map +1 -1
- package/dist/providers/plugins/sso/proxy/plugins/claude-request-normalizer.plugin.d.ts +31 -0
- package/dist/providers/plugins/sso/proxy/plugins/claude-request-normalizer.plugin.d.ts.map +1 -0
- package/dist/providers/plugins/sso/proxy/plugins/claude-request-normalizer.plugin.js +148 -0
- package/dist/providers/plugins/sso/proxy/plugins/claude-request-normalizer.plugin.js.map +1 -0
- package/dist/providers/plugins/sso/proxy/plugins/index.d.ts +12 -13
- package/dist/providers/plugins/sso/proxy/plugins/index.d.ts.map +1 -1
- package/dist/providers/plugins/sso/proxy/plugins/index.js +15 -17
- package/dist/providers/plugins/sso/proxy/plugins/index.js.map +1 -1
- package/dist/providers/plugins/sso/sso.http-client.d.ts +1 -1
- package/dist/providers/plugins/sso/sso.http-client.js +3 -3
- package/dist/providers/plugins/sso/sso.http-client.js.map +1 -1
- package/dist/providers/plugins/sso/sso.models.js +2 -2
- package/dist/providers/plugins/sso/sso.models.js.map +1 -1
- package/dist/providers/plugins/sso/sso.setup-steps.d.ts.map +1 -1
- package/dist/providers/plugins/sso/sso.setup-steps.js +6 -10
- package/dist/providers/plugins/sso/sso.setup-steps.js.map +1 -1
- package/dist/utils/config.d.ts +14 -3
- package/dist/utils/config.d.ts.map +1 -1
- package/dist/utils/config.js +95 -5
- package/dist/utils/config.js.map +1 -1
- package/package.json +22 -10
- package/scripts/copy-plugins.js +5 -0
- package/scripts/sonar/package.json +3 -0
- package/scripts/sonar/run-local-sonar.js +405 -0
- package/dist/agents/plugins/claude/plugin/commands/codemie-commit.md +0 -31
- package/dist/agents/plugins/claude/plugin/scripts/bash/rtk-auto-wrapper.sh +0 -81
- package/dist/providers/plugins/sso/proxy/plugins/claude-thinking-transformer.plugin.d.ts +0 -30
- package/dist/providers/plugins/sso/proxy/plugins/claude-thinking-transformer.plugin.d.ts.map +0 -1
- package/dist/providers/plugins/sso/proxy/plugins/claude-thinking-transformer.plugin.js +0 -111
- 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.
|
|
@@ -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,
|
|
6
|
-
the user asks about their emails, inbox, unread messages,
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
authentication, token caching,
|
|
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
|
|
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
|
|
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;
|
|
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
|
|
83
|
-
|
|
84
|
-
|
|
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', {
|