@codemieai/code 0.0.18 → 0.0.19
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/dist/agents/core/AgentCLI.d.ts.map +1 -1
- package/dist/agents/core/AgentCLI.js +17 -24
- package/dist/agents/core/AgentCLI.js.map +1 -1
- package/dist/agents/core/BaseAgentAdapter.d.ts +19 -0
- package/dist/agents/core/BaseAgentAdapter.d.ts.map +1 -1
- package/dist/agents/core/BaseAgentAdapter.js +170 -77
- package/dist/agents/core/BaseAgentAdapter.js.map +1 -1
- package/dist/agents/core/types.d.ts +3 -5
- package/dist/agents/core/types.d.ts.map +1 -1
- package/dist/agents/plugins/claude.plugin.d.ts.map +1 -1
- package/dist/agents/plugins/claude.plugin.js +2 -5
- package/dist/agents/plugins/claude.plugin.js.map +1 -1
- package/dist/agents/plugins/codemie-code.plugin.d.ts.map +1 -1
- package/dist/agents/plugins/codemie-code.plugin.js +10 -26
- package/dist/agents/plugins/codemie-code.plugin.js.map +1 -1
- package/dist/agents/plugins/codex.plugin.d.ts +4 -0
- package/dist/agents/plugins/codex.plugin.d.ts.map +1 -1
- package/dist/agents/plugins/codex.plugin.js +222 -20
- package/dist/agents/plugins/codex.plugin.js.map +1 -1
- package/dist/agents/plugins/deepagents.plugin.d.ts.map +1 -1
- package/dist/agents/plugins/deepagents.plugin.js +2 -5
- package/dist/agents/plugins/deepagents.plugin.js.map +1 -1
- package/dist/agents/plugins/gemini.plugin.d.ts.map +1 -1
- package/dist/agents/plugins/gemini.plugin.js +2 -5
- package/dist/agents/plugins/gemini.plugin.js.map +1 -1
- package/dist/providers/core/types.d.ts +0 -5
- package/dist/providers/core/types.d.ts.map +1 -1
- package/dist/providers/plugins/bedrock/bedrock.template.d.ts.map +1 -1
- package/dist/providers/plugins/bedrock/bedrock.template.js +0 -5
- package/dist/providers/plugins/bedrock/bedrock.template.js.map +1 -1
- package/dist/providers/plugins/litellm/litellm.template.d.ts.map +1 -1
- package/dist/providers/plugins/litellm/litellm.template.js +0 -6
- package/dist/providers/plugins/litellm/litellm.template.js.map +1 -1
- package/dist/providers/plugins/ollama/ollama.template.d.ts.map +1 -1
- package/dist/providers/plugins/ollama/ollama.template.js +22 -17
- package/dist/providers/plugins/ollama/ollama.template.js.map +1 -1
- package/dist/providers/plugins/sso/sso.template.d.ts.map +1 -1
- package/dist/providers/plugins/sso/sso.template.js +0 -5
- package/dist/providers/plugins/sso/sso.template.js.map +1 -1
- package/dist/proxy/plugins/sso-auth.plugin.js +7 -2
- package/dist/proxy/plugins/sso-auth.plugin.js.map +1 -1
- package/dist/utils/codemie-proxy.d.ts +1 -0
- package/dist/utils/codemie-proxy.d.ts.map +1 -1
- package/dist/utils/codemie-proxy.js +9 -3
- package/dist/utils/codemie-proxy.js.map +1 -1
- package/dist/utils/config-loader.d.ts +4 -2
- package/dist/utils/config-loader.d.ts.map +1 -1
- package/dist/utils/config-loader.js +43 -33
- package/dist/utils/config-loader.js.map +1 -1
- package/dist/utils/profile.d.ts +12 -0
- package/dist/utils/profile.d.ts.map +1 -0
- package/dist/utils/profile.js +32 -0
- package/dist/utils/profile.js.map +1 -0
- package/package.json +21 -6
- package/scripts/README.md +80 -0
- package/scripts/release.sh +267 -0
- package/scripts/validate-secrets.js +54 -0
- package/dist/utils/ascii-logo.d.ts +0 -21
- package/dist/utils/ascii-logo.d.ts.map +0 -1
- package/dist/utils/ascii-logo.js +0 -85
- package/dist/utils/ascii-logo.js.map +0 -1
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
# Release Scripts
|
|
2
|
+
|
|
3
|
+
Simple automation scripts for CodeMie Code releases following KISS principles.
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
### Main Release Script
|
|
8
|
+
|
|
9
|
+
The `release.sh` script automates the complete release process:
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
# Release specific version
|
|
13
|
+
./scripts/release.sh 0.0.3
|
|
14
|
+
|
|
15
|
+
# Auto-increment patch version (0.0.2 → 0.0.3)
|
|
16
|
+
./scripts/release.sh
|
|
17
|
+
|
|
18
|
+
# Preview what would be done (dry run)
|
|
19
|
+
./scripts/release.sh --dry-run
|
|
20
|
+
|
|
21
|
+
# Preview specific version
|
|
22
|
+
./scripts/release.sh 0.0.3 --dry-run
|
|
23
|
+
|
|
24
|
+
# Show help
|
|
25
|
+
./scripts/release.sh --help
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## What it does
|
|
29
|
+
|
|
30
|
+
The script follows the release process defined in the release-manager documentation:
|
|
31
|
+
|
|
32
|
+
1. **Pre-flight checks**: Validates git status and existing tags
|
|
33
|
+
2. **Version determination**: Auto-increments patch version or uses provided version
|
|
34
|
+
3. **Version update**: Updates `package.json` and `package-lock.json`
|
|
35
|
+
4. **Git operations**: Commits changes, creates annotated tag, pushes to origin
|
|
36
|
+
5. **GitHub release**: Creates GitHub release with auto-generated notes (if `gh` CLI available)
|
|
37
|
+
|
|
38
|
+
## Requirements
|
|
39
|
+
|
|
40
|
+
- `git` - Version control operations
|
|
41
|
+
- `npm` - Package version management
|
|
42
|
+
- `gh` (optional) - GitHub release creation
|
|
43
|
+
|
|
44
|
+
If `gh` CLI is not available, the script will provide a manual link to create the GitHub release.
|
|
45
|
+
|
|
46
|
+
## Release Process
|
|
47
|
+
|
|
48
|
+
Based on CLAUDE.md, the complete release flow is:
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
# From CLAUDE.md:
|
|
52
|
+
git tag -a v0.0.1 -m "Release version 0.0.1" # Create release tag
|
|
53
|
+
git push origin v0.0.1 # Push tag to trigger publish
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
The script automates this by:
|
|
57
|
+
1. Using `npm version` to update package files
|
|
58
|
+
2. Creating proper commit message with Claude Code attribution
|
|
59
|
+
3. Creating annotated git tag
|
|
60
|
+
4. Pushing both commit and tag
|
|
61
|
+
5. Creating GitHub release (triggers npm publish workflow)
|
|
62
|
+
|
|
63
|
+
## Error Handling
|
|
64
|
+
|
|
65
|
+
The script includes basic error handling:
|
|
66
|
+
- Warns about uncommitted changes (allows override)
|
|
67
|
+
- Checks for existing tags (allows override)
|
|
68
|
+
- Validates git repository state
|
|
69
|
+
- Uses `set -e` to exit on errors
|
|
70
|
+
|
|
71
|
+
## Simple by Design
|
|
72
|
+
|
|
73
|
+
Following KISS principles, this script:
|
|
74
|
+
- Is a single file with no dependencies
|
|
75
|
+
- Uses basic bash constructs
|
|
76
|
+
- Provides clear output and prompts
|
|
77
|
+
- Handles the most common release scenarios
|
|
78
|
+
- Can be extended easily if needed
|
|
79
|
+
|
|
80
|
+
The release-manager agent can run this script instead of individual git commands, making releases more reliable and consistent.
|
|
@@ -0,0 +1,267 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# Note: Do NOT use 'set -e' to allow recovery from individual step failures
|
|
3
|
+
|
|
4
|
+
# CodeMie Code Release Script
|
|
5
|
+
# Simple script to automate releases following KISS principles
|
|
6
|
+
# Designed to be resumable - can continue from failed steps
|
|
7
|
+
|
|
8
|
+
DRY_RUN=false
|
|
9
|
+
VERSION=""
|
|
10
|
+
|
|
11
|
+
# Parse arguments
|
|
12
|
+
while [[ $# -gt 0 ]]; do
|
|
13
|
+
case $1 in
|
|
14
|
+
--dry-run) DRY_RUN=true; shift ;;
|
|
15
|
+
--help|-h)
|
|
16
|
+
echo "Usage: $0 [VERSION] [--dry-run]"
|
|
17
|
+
echo "Examples:"
|
|
18
|
+
echo " $0 0.0.3 # Release version 0.0.3"
|
|
19
|
+
echo " $0 --dry-run # Preview next patch release"
|
|
20
|
+
exit 0 ;;
|
|
21
|
+
*) VERSION="$1"; shift ;;
|
|
22
|
+
esac
|
|
23
|
+
done
|
|
24
|
+
|
|
25
|
+
# Get current version from package.json
|
|
26
|
+
CURRENT=$(grep '"version"' package.json | sed 's/.*"version": "\(.*\)".*/\1/')
|
|
27
|
+
echo "Current version in package.json: $CURRENT"
|
|
28
|
+
|
|
29
|
+
# Get latest released tag
|
|
30
|
+
LATEST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "")
|
|
31
|
+
if [[ -n "$LATEST_TAG" ]]; then
|
|
32
|
+
LATEST_VERSION="${LATEST_TAG#v}"
|
|
33
|
+
echo "Latest released version: $LATEST_VERSION"
|
|
34
|
+
else
|
|
35
|
+
LATEST_VERSION=""
|
|
36
|
+
echo "No previous releases found"
|
|
37
|
+
fi
|
|
38
|
+
|
|
39
|
+
# Determine suggested version
|
|
40
|
+
SUGGESTED_VERSION=""
|
|
41
|
+
if [[ -z "$VERSION" ]]; then
|
|
42
|
+
# Check if current package.json version is already ahead of latest release
|
|
43
|
+
if [[ -n "$LATEST_VERSION" && "$CURRENT" != "$LATEST_VERSION" ]]; then
|
|
44
|
+
# package.json is ahead but not released - use it
|
|
45
|
+
SUGGESTED_VERSION="$CURRENT"
|
|
46
|
+
echo "Suggested version (from package.json): $SUGGESTED_VERSION"
|
|
47
|
+
elif [[ -z "$LATEST_VERSION" ]]; then
|
|
48
|
+
# No releases yet - use package.json version
|
|
49
|
+
SUGGESTED_VERSION="$CURRENT"
|
|
50
|
+
echo "Suggested version (initial): $SUGGESTED_VERSION"
|
|
51
|
+
else
|
|
52
|
+
# Auto-increment patch version from latest release
|
|
53
|
+
IFS='.' read -r major minor patch <<< "$LATEST_VERSION"
|
|
54
|
+
SUGGESTED_VERSION="$major.$minor.$((patch + 1))"
|
|
55
|
+
echo "Suggested version (+1 patch): $SUGGESTED_VERSION"
|
|
56
|
+
fi
|
|
57
|
+
|
|
58
|
+
# Prompt user for version (unless in dry-run mode)
|
|
59
|
+
if [[ "$DRY_RUN" == "false" ]]; then
|
|
60
|
+
echo ""
|
|
61
|
+
read -p "Enter release version [$SUGGESTED_VERSION]: " USER_VERSION
|
|
62
|
+
if [[ -n "$USER_VERSION" ]]; then
|
|
63
|
+
VERSION="$USER_VERSION"
|
|
64
|
+
echo "Using custom version: $VERSION"
|
|
65
|
+
else
|
|
66
|
+
VERSION="$SUGGESTED_VERSION"
|
|
67
|
+
echo "Using suggested version: $VERSION"
|
|
68
|
+
fi
|
|
69
|
+
else
|
|
70
|
+
VERSION="$SUGGESTED_VERSION"
|
|
71
|
+
fi
|
|
72
|
+
else
|
|
73
|
+
echo "Version specified via argument: $VERSION"
|
|
74
|
+
fi
|
|
75
|
+
|
|
76
|
+
echo ""
|
|
77
|
+
echo "Target version: $VERSION"
|
|
78
|
+
|
|
79
|
+
# Pre-flight checks
|
|
80
|
+
echo ""
|
|
81
|
+
echo "🔍 Pre-flight checks:"
|
|
82
|
+
|
|
83
|
+
# Check what's already done
|
|
84
|
+
CURRENT_PKG_VERSION=$(grep '"version"' package.json | sed 's/.*"version": "\(.*\)".*/\1/')
|
|
85
|
+
VERSION_UPDATED=false
|
|
86
|
+
VERSION_COMMITTED=false
|
|
87
|
+
TAG_EXISTS=false
|
|
88
|
+
RELEASE_EXISTS=false
|
|
89
|
+
|
|
90
|
+
if [[ "$CURRENT_PKG_VERSION" == "$VERSION" ]]; then
|
|
91
|
+
VERSION_UPDATED=true
|
|
92
|
+
echo "✅ package.json already at version $VERSION"
|
|
93
|
+
else
|
|
94
|
+
echo "⏭️ package.json needs update to $VERSION"
|
|
95
|
+
fi
|
|
96
|
+
|
|
97
|
+
COMMIT_MSG="chore: bump version to $VERSION"
|
|
98
|
+
if git log -1 --pretty=%B | grep -q "$COMMIT_MSG"; then
|
|
99
|
+
VERSION_COMMITTED=true
|
|
100
|
+
echo "✅ Version bump already committed"
|
|
101
|
+
else
|
|
102
|
+
echo "⏭️ Version bump needs to be committed"
|
|
103
|
+
fi
|
|
104
|
+
|
|
105
|
+
if git tag -l "v$VERSION" | grep -q "v$VERSION"; then
|
|
106
|
+
TAG_EXISTS=true
|
|
107
|
+
echo "✅ Tag v$VERSION already exists"
|
|
108
|
+
else
|
|
109
|
+
echo "⏭️ Tag v$VERSION needs to be created"
|
|
110
|
+
fi
|
|
111
|
+
|
|
112
|
+
if command -v gh >/dev/null 2>&1 && gh release view "v$VERSION" >/dev/null 2>&1; then
|
|
113
|
+
RELEASE_EXISTS=true
|
|
114
|
+
echo "✅ GitHub Release v$VERSION already exists"
|
|
115
|
+
elif command -v gh >/dev/null 2>&1; then
|
|
116
|
+
echo "⏭️ GitHub Release needs to be created"
|
|
117
|
+
fi
|
|
118
|
+
|
|
119
|
+
# Check git status
|
|
120
|
+
if ! git diff --quiet || ! git diff --cached --quiet; then
|
|
121
|
+
echo "⚠️ Working directory has uncommitted changes"
|
|
122
|
+
if [[ "$DRY_RUN" == "false" ]]; then
|
|
123
|
+
read -p "Continue anyway? (y/N): " -n 1 -r
|
|
124
|
+
echo
|
|
125
|
+
[[ ! $REPLY =~ ^[Yy]$ ]] && exit 1
|
|
126
|
+
fi
|
|
127
|
+
fi
|
|
128
|
+
|
|
129
|
+
# Show what will be done
|
|
130
|
+
echo ""
|
|
131
|
+
echo "📋 Actions that will be performed:"
|
|
132
|
+
STEP=1
|
|
133
|
+
if [[ "$VERSION_UPDATED" == "false" ]]; then
|
|
134
|
+
echo "$STEP. Update package.json version to $VERSION"
|
|
135
|
+
STEP=$((STEP + 1))
|
|
136
|
+
fi
|
|
137
|
+
if [[ "$VERSION_COMMITTED" == "false" ]]; then
|
|
138
|
+
echo "$STEP. Commit version bump"
|
|
139
|
+
STEP=$((STEP + 1))
|
|
140
|
+
fi
|
|
141
|
+
if [[ "$TAG_EXISTS" == "false" ]]; then
|
|
142
|
+
echo "$STEP. Create git tag v$VERSION"
|
|
143
|
+
STEP=$((STEP + 1))
|
|
144
|
+
fi
|
|
145
|
+
echo "$STEP. Push commit and tag to origin"
|
|
146
|
+
STEP=$((STEP + 1))
|
|
147
|
+
if command -v gh >/dev/null 2>&1 && [[ "$RELEASE_EXISTS" == "false" ]]; then
|
|
148
|
+
echo "$STEP. Create GitHub Release"
|
|
149
|
+
fi
|
|
150
|
+
|
|
151
|
+
# If everything is done, just need to push
|
|
152
|
+
if [[ "$VERSION_UPDATED" == "true" && "$VERSION_COMMITTED" == "true" && "$TAG_EXISTS" == "true" ]]; then
|
|
153
|
+
echo ""
|
|
154
|
+
echo "ℹ️ Version $VERSION is ready - only push and release creation needed"
|
|
155
|
+
fi
|
|
156
|
+
|
|
157
|
+
if [[ "$DRY_RUN" == "true" ]]; then
|
|
158
|
+
echo ""
|
|
159
|
+
echo "🔍 DRY RUN - No changes will be made"
|
|
160
|
+
exit 0
|
|
161
|
+
fi
|
|
162
|
+
|
|
163
|
+
echo ""
|
|
164
|
+
read -p "❓ Proceed with release? (y/N): " -n 1 -r
|
|
165
|
+
echo
|
|
166
|
+
[[ ! $REPLY =~ ^[Yy]$ ]] && exit 1
|
|
167
|
+
|
|
168
|
+
# Execute release
|
|
169
|
+
echo ""
|
|
170
|
+
echo "🚀 Executing release..."
|
|
171
|
+
|
|
172
|
+
# Update version in package.json and package-lock.json
|
|
173
|
+
echo "📝 Updating package versions..."
|
|
174
|
+
CURRENT_PKG_VERSION=$(grep '"version"' package.json | sed 's/.*"version": "\(.*\)".*/\1/')
|
|
175
|
+
if [[ "$CURRENT_PKG_VERSION" == "$VERSION" ]]; then
|
|
176
|
+
echo "⏭️ package.json already at version $VERSION, skipping version update..."
|
|
177
|
+
else
|
|
178
|
+
npm version "$VERSION" --no-git-tag-version || {
|
|
179
|
+
echo "⚠️ Failed to update package version, but continuing..."
|
|
180
|
+
}
|
|
181
|
+
fi
|
|
182
|
+
|
|
183
|
+
# Commit changes
|
|
184
|
+
echo "💾 Committing version bump..."
|
|
185
|
+
COMMIT_MSG="chore: bump version to $VERSION"
|
|
186
|
+
if git log -1 --pretty=%B | grep -q "$COMMIT_MSG"; then
|
|
187
|
+
echo "⏭️ Version bump already committed, skipping commit..."
|
|
188
|
+
else
|
|
189
|
+
git add package.json package-lock.json
|
|
190
|
+
git commit -m "$COMMIT_MSG
|
|
191
|
+
|
|
192
|
+
🤖 Generated with release script" || {
|
|
193
|
+
echo "⚠️ Failed to commit (possibly already committed), continuing..."
|
|
194
|
+
}
|
|
195
|
+
fi
|
|
196
|
+
|
|
197
|
+
# Create tag (skip if exists)
|
|
198
|
+
if git tag -l "v$VERSION" | grep -q "v$VERSION"; then
|
|
199
|
+
echo "⏭️ Tag v$VERSION already exists, skipping tag creation..."
|
|
200
|
+
else
|
|
201
|
+
echo "🏷️ Creating tag v$VERSION..."
|
|
202
|
+
git tag -a "v$VERSION" -m "Release version $VERSION" || {
|
|
203
|
+
echo "⚠️ Failed to create tag, but continuing..."
|
|
204
|
+
}
|
|
205
|
+
fi
|
|
206
|
+
|
|
207
|
+
# Push to origin
|
|
208
|
+
echo "📤 Pushing to origin..."
|
|
209
|
+
git push origin main || {
|
|
210
|
+
echo "⚠️ Failed to push main branch, but continuing..."
|
|
211
|
+
}
|
|
212
|
+
git push origin "v$VERSION" || {
|
|
213
|
+
echo "⚠️ Failed to push tag (possibly already pushed), continuing..."
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
# Create GitHub release if gh CLI is available
|
|
217
|
+
if command -v gh >/dev/null 2>&1; then
|
|
218
|
+
echo "🐱 Creating GitHub Release..."
|
|
219
|
+
|
|
220
|
+
# Check if release already exists
|
|
221
|
+
if gh release view "v$VERSION" >/dev/null 2>&1; then
|
|
222
|
+
echo "⏭️ GitHub Release v$VERSION already exists, skipping..."
|
|
223
|
+
else
|
|
224
|
+
# Generate simple release notes
|
|
225
|
+
LAST_TAG=$(git describe --tags --abbrev=0 HEAD^ 2>/dev/null || echo "")
|
|
226
|
+
if [[ -n "$LAST_TAG" ]]; then
|
|
227
|
+
COMMITS=$(git log "$LAST_TAG..HEAD" --oneline --no-merges | wc -l)
|
|
228
|
+
RANGE="$LAST_TAG..v$VERSION"
|
|
229
|
+
else
|
|
230
|
+
COMMITS=$(git rev-list --count HEAD)
|
|
231
|
+
RANGE="v$VERSION"
|
|
232
|
+
fi
|
|
233
|
+
|
|
234
|
+
# Create release notes
|
|
235
|
+
cat > /tmp/release-notes.md << EOF
|
|
236
|
+
## What's Changed
|
|
237
|
+
|
|
238
|
+
This release includes $COMMITS commits with improvements and updates.
|
|
239
|
+
|
|
240
|
+
### Recent Changes:
|
|
241
|
+
$(git log --oneline --no-merges -10 ${LAST_TAG:+$LAST_TAG..HEAD} | sed 's/^/- /')
|
|
242
|
+
|
|
243
|
+
**Full Changelog**: https://github.com/EPMCDME/codemie-ai/compare/${LAST_TAG:-initial}...v$VERSION
|
|
244
|
+
EOF
|
|
245
|
+
|
|
246
|
+
gh release create "v$VERSION" \
|
|
247
|
+
--title "Release v$VERSION" \
|
|
248
|
+
--notes-file /tmp/release-notes.md \
|
|
249
|
+
--latest || {
|
|
250
|
+
echo "⚠️ Failed to create GitHub release, but continuing..."
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
rm -f /tmp/release-notes.md
|
|
254
|
+
echo "✅ GitHub Release created"
|
|
255
|
+
fi
|
|
256
|
+
else
|
|
257
|
+
echo "⚠️ GitHub CLI not available - create release manually at:"
|
|
258
|
+
echo " https://github.com/EPMCDME/codemie-ai/releases/new?tag=v$VERSION"
|
|
259
|
+
fi
|
|
260
|
+
|
|
261
|
+
echo ""
|
|
262
|
+
echo "🎉 Release v$VERSION completed successfully!"
|
|
263
|
+
echo ""
|
|
264
|
+
echo "📦 Next steps:"
|
|
265
|
+
echo "• Monitor GitHub Actions for npm publish: https://github.com/EPMCDME/codemie-ai/actions"
|
|
266
|
+
echo "• Package will be available: npm install @codemieai/code@$VERSION"
|
|
267
|
+
echo "• View release: https://github.com/EPMCDME/codemie-ai/releases/tag/v$VERSION"
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Cross-platform secrets detection using Gitleaks
|
|
4
|
+
* Works on Windows, macOS, and Linux
|
|
5
|
+
*
|
|
6
|
+
* This script runs Gitleaks in a Docker container for local validation.
|
|
7
|
+
* CI uses the official gitleaks-action@v2 for better GitHub integration.
|
|
8
|
+
* Both share the same .gitleaks.toml configuration.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import { spawn } from 'child_process';
|
|
12
|
+
import { platform } from 'os';
|
|
13
|
+
import { resolve } from 'path';
|
|
14
|
+
import { existsSync } from 'fs';
|
|
15
|
+
|
|
16
|
+
const isWindows = platform() === 'win32';
|
|
17
|
+
const projectPath = resolve(process.cwd());
|
|
18
|
+
|
|
19
|
+
// Check if .gitleaks.toml exists
|
|
20
|
+
const configPath = resolve(projectPath, '.gitleaks.toml');
|
|
21
|
+
const hasConfig = existsSync(configPath);
|
|
22
|
+
|
|
23
|
+
const args = [
|
|
24
|
+
'run',
|
|
25
|
+
'--rm',
|
|
26
|
+
'-v',
|
|
27
|
+
`${projectPath}:/path`,
|
|
28
|
+
'ghcr.io/gitleaks/gitleaks:latest',
|
|
29
|
+
'detect',
|
|
30
|
+
'--source=/path',
|
|
31
|
+
'--verbose',
|
|
32
|
+
'--no-git'
|
|
33
|
+
];
|
|
34
|
+
|
|
35
|
+
// Add config file if it exists
|
|
36
|
+
if (hasConfig) {
|
|
37
|
+
args.push('--config=/path/.gitleaks.toml');
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
console.log('Running Gitleaks secrets detection...');
|
|
41
|
+
|
|
42
|
+
const gitleaks = spawn('docker', args, {
|
|
43
|
+
stdio: 'inherit',
|
|
44
|
+
shell: isWindows
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
gitleaks.on('close', (code) => {
|
|
48
|
+
process.exit(code);
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
gitleaks.on('error', (err) => {
|
|
52
|
+
console.error('Failed to run Gitleaks:', err.message);
|
|
53
|
+
process.exit(1);
|
|
54
|
+
});
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Renders the CodeMie ASCII logo with configuration details
|
|
3
|
-
*/
|
|
4
|
-
export declare function renderCodeMieLogo(config: {
|
|
5
|
-
profile?: string;
|
|
6
|
-
provider?: string;
|
|
7
|
-
model?: string;
|
|
8
|
-
agent?: string;
|
|
9
|
-
cliVersion?: string;
|
|
10
|
-
sessionId?: string;
|
|
11
|
-
}): string;
|
|
12
|
-
/**
|
|
13
|
-
* Compact version for narrow terminals
|
|
14
|
-
*/
|
|
15
|
-
export declare function renderCompactLogo(config: {
|
|
16
|
-
profile?: string;
|
|
17
|
-
provider?: string;
|
|
18
|
-
model?: string;
|
|
19
|
-
agent?: string;
|
|
20
|
-
}): string;
|
|
21
|
-
//# sourceMappingURL=ascii-logo.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ascii-logo.d.ts","sourceRoot":"","sources":["../../src/utils/ascii-logo.ts"],"names":[],"mappings":"AAkBA;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE;IACxC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,GAAG,MAAM,CAyCT;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE;IACxC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,GAAG,MAAM,CA4BT"}
|
package/dist/utils/ascii-logo.js
DELETED
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
import chalk from 'chalk';
|
|
2
|
-
import gradient from 'gradient-string';
|
|
3
|
-
/**
|
|
4
|
-
* CodeMie CLI ASCII Logo with aligned column layout
|
|
5
|
-
*
|
|
6
|
-
* Displays the AI/Run CodeMie CLI logo with configuration details
|
|
7
|
-
*/
|
|
8
|
-
const LOGO_ASCII = String.raw `
|
|
9
|
-
██████╗ ██████╗ ██████╗ ███████╗███╗ ███╗██╗███████╗ ██████╗██╗ ██╗
|
|
10
|
-
██╔════╝██╔═══██╗██╔══██╗██╔════╝████╗ ████║██║██╔════╝ ██╔════╝██║ ██║
|
|
11
|
-
██║ ██║ ██║██║ ██║█████╗ ██╔████╔██║██║█████╗ ██║ ██║ ██║
|
|
12
|
-
██║ ██║ ██║██║ ██║██╔══╝ ██║╚██╔╝██║██║██╔══╝ ██║ ██║ ██║
|
|
13
|
-
╚██████╗╚██████╔╝██████╔╝███████╗██║ ╚═╝ ██║██║███████╗ ╚██████╗███████╗██║
|
|
14
|
-
╚═════╝ ╚═════╝ ╚═════╝ ╚══════╝╚═╝ ╚═╝╚═╝╚══════╝ ╚═════╝╚══════╝╚═╝
|
|
15
|
-
`;
|
|
16
|
-
/**
|
|
17
|
-
* Renders the CodeMie ASCII logo with configuration details
|
|
18
|
-
*/
|
|
19
|
-
export function renderCodeMieLogo(config) {
|
|
20
|
-
const codeMieGradient = gradient([
|
|
21
|
-
'#ff00ff', // Bright magenta
|
|
22
|
-
'#cc00ff', // Purple-magenta
|
|
23
|
-
'#9933ff', // Purple
|
|
24
|
-
'#6666ff', // Blue-purple
|
|
25
|
-
'#00ccff' // Cyan
|
|
26
|
-
]);
|
|
27
|
-
// Build complete output with logo and info
|
|
28
|
-
const outputLines = [];
|
|
29
|
-
outputLines.push(''); // Empty line for spacing
|
|
30
|
-
// Add ASCII logo
|
|
31
|
-
outputLines.push(LOGO_ASCII);
|
|
32
|
-
outputLines.push(''); // Empty line for spacing
|
|
33
|
-
// Configuration details
|
|
34
|
-
if (config.cliVersion) {
|
|
35
|
-
outputLines.push(`CLI Version │ ${config.cliVersion}`);
|
|
36
|
-
}
|
|
37
|
-
if (config.profile) {
|
|
38
|
-
outputLines.push(`Profile │ ${config.profile}`);
|
|
39
|
-
}
|
|
40
|
-
if (config.provider) {
|
|
41
|
-
outputLines.push(`Provider │ ${config.provider}`);
|
|
42
|
-
}
|
|
43
|
-
if (config.model) {
|
|
44
|
-
outputLines.push(`Model │ ${config.model}`);
|
|
45
|
-
}
|
|
46
|
-
if (config.agent) {
|
|
47
|
-
outputLines.push(`Agent │ ${config.agent}`);
|
|
48
|
-
}
|
|
49
|
-
if (config.sessionId) {
|
|
50
|
-
outputLines.push(`Session │ ${config.sessionId}`);
|
|
51
|
-
}
|
|
52
|
-
outputLines.push(''); // Empty line for spacing
|
|
53
|
-
// Apply gradient to entire output
|
|
54
|
-
return codeMieGradient(outputLines.join('\n'));
|
|
55
|
-
}
|
|
56
|
-
/**
|
|
57
|
-
* Compact version for narrow terminals
|
|
58
|
-
*/
|
|
59
|
-
export function renderCompactLogo(config) {
|
|
60
|
-
const codeMieGradient = gradient([
|
|
61
|
-
'#ff00ff', // Bright magenta
|
|
62
|
-
'#cc00ff', // Purple-magenta
|
|
63
|
-
'#9933ff', // Purple
|
|
64
|
-
'#6666ff', // Blue-purple
|
|
65
|
-
'#00ccff' // Cyan
|
|
66
|
-
]);
|
|
67
|
-
const compactAscii = `
|
|
68
|
-
╔════════════════════╗
|
|
69
|
-
║ AI/Run CodeMie ║
|
|
70
|
-
║ CLI ║
|
|
71
|
-
╚════════════════════╝`;
|
|
72
|
-
const output = [];
|
|
73
|
-
output.push('');
|
|
74
|
-
output.push(codeMieGradient(compactAscii));
|
|
75
|
-
output.push('');
|
|
76
|
-
if (config.profile && config.provider) {
|
|
77
|
-
output.push(chalk.white(`${config.profile} │ ${config.provider}`));
|
|
78
|
-
}
|
|
79
|
-
if (config.model) {
|
|
80
|
-
output.push(chalk.white(`Model: ${config.model}`));
|
|
81
|
-
}
|
|
82
|
-
output.push('');
|
|
83
|
-
return output.join('\n');
|
|
84
|
-
}
|
|
85
|
-
//# sourceMappingURL=ascii-logo.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ascii-logo.js","sourceRoot":"","sources":["../../src/utils/ascii-logo.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC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