@zemerik/gemini-assist 1.1.1-beta
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/.env.example +8 -0
- package/.github/ISSUE_TEMPLATE/bug_report.md +50 -0
- package/.github/ISSUE_TEMPLATE/feature_request.md +35 -0
- package/.github/ISSUE_TEMPLATE/question.md +29 -0
- package/.github/dependabot.yml +49 -0
- package/.github/labels.yml +129 -0
- package/.github/pull_request_template.md +46 -0
- package/.github/stale.yml +25 -0
- package/.github/workflows/ci.yml +192 -0
- package/.github/workflows/release.yml +71 -0
- package/.rustignore +5 -0
- package/Cargo.toml +19 -0
- package/LICENSE +0 -0
- package/README.md +220 -0
- package/README_RUST.md +134 -0
- package/RELEASE_NOTES.md +124 -0
- package/bin/gemini-assist.js +136 -0
- package/build.rs +3 -0
- package/gitignore +1 -0
- package/index.d.ts +13 -0
- package/index.js +317 -0
- package/napi.config.json +33 -0
- package/package.json +63 -0
- package/scripts/postinstall.js +11 -0
- package/src/gemini.js +127 -0
- package/src/gemini_client.rs +159 -0
- package/src/lib.rs +58 -0
- package/src/rust/gemini_client.rs +157 -0
- package/src/rust/lib.rs +57 -0
- package/src/utils.js +62 -0
package/.env.example
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: 🐛 Bug Report
|
|
3
|
+
about: Create a report to help us improve Gemini Assist
|
|
4
|
+
title: '[BUG] '
|
|
5
|
+
labels: ['bug', 'needs-triage']
|
|
6
|
+
assignees: ''
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## 🐛 Bug Description
|
|
10
|
+
<!-- A clear and concise description of what the bug is -->
|
|
11
|
+
|
|
12
|
+
## 🔄 Steps to Reproduce
|
|
13
|
+
1.
|
|
14
|
+
2.
|
|
15
|
+
3.
|
|
16
|
+
|
|
17
|
+
## ✅ Expected Behavior
|
|
18
|
+
<!-- A clear and concise description of what you expected to happen -->
|
|
19
|
+
|
|
20
|
+
## ❌ Actual Behavior
|
|
21
|
+
<!-- A clear and concise description of what actually happened -->
|
|
22
|
+
|
|
23
|
+
## 📋 Environment Information
|
|
24
|
+
- **OS**: [e.g., macOS 14.0, Ubuntu 22.04, Windows 11]
|
|
25
|
+
- **Gemini Assist Version**: [e.g., 1.1.1-beta]
|
|
26
|
+
- **Node.js Version**: [e.g., 18.17.0]
|
|
27
|
+
- **Rust Version** (if using Rust bindings): [e.g., 1.75.0]
|
|
28
|
+
- **NPM Version**: [e.g., 9.0.0]
|
|
29
|
+
|
|
30
|
+
## 📁 Configuration
|
|
31
|
+
<!-- If applicable, share relevant parts of your .env file (REMOVE YOUR API KEY!) -->
|
|
32
|
+
|
|
33
|
+
```json
|
|
34
|
+
{
|
|
35
|
+
// Your configuration here
|
|
36
|
+
}
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## 📝 Additional Context
|
|
40
|
+
<!-- Add any other context about the problem here -->
|
|
41
|
+
|
|
42
|
+
## 🔍 Possible Solution
|
|
43
|
+
<!-- If you have suggestions on a fix for the bug -->
|
|
44
|
+
|
|
45
|
+
## 📸 Screenshots
|
|
46
|
+
<!-- If applicable, add screenshots to help explain your problem -->
|
|
47
|
+
|
|
48
|
+
---
|
|
49
|
+
|
|
50
|
+
**Thank you for reporting this issue! 🚀**
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ✨ Feature Request
|
|
3
|
+
about: Suggest an idea for Gemini Assist
|
|
4
|
+
title: '[FEATURE] '
|
|
5
|
+
labels: ['enhancement', 'needs-triage']
|
|
6
|
+
assignees: ''
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## 🎯 Problem Statement
|
|
10
|
+
<!-- A clear and concise description of what problem this feature would solve -->
|
|
11
|
+
|
|
12
|
+
## 💡 Proposed Solution
|
|
13
|
+
<!-- A clear and concise description of what you want to happen -->
|
|
14
|
+
|
|
15
|
+
## 🔄 Alternative Solutions
|
|
16
|
+
<!-- A clear and concise description of any alternative solutions or features you've considered -->
|
|
17
|
+
|
|
18
|
+
## 📋 Use Case
|
|
19
|
+
<!-- Describe the use case for this feature -->
|
|
20
|
+
|
|
21
|
+
## 🎨 Mockups/Examples
|
|
22
|
+
<!-- If applicable, add mockups, examples, or screenshots -->
|
|
23
|
+
|
|
24
|
+
## 📚 Additional Context
|
|
25
|
+
<!-- Add any other context or references about the feature request here -->
|
|
26
|
+
|
|
27
|
+
## 🔧 Implementation Ideas
|
|
28
|
+
<!-- If you have ideas about how this could be implemented -->
|
|
29
|
+
|
|
30
|
+
## 📊 Impact
|
|
31
|
+
<!-- How would this feature benefit users? -->
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
**Thank you for your feature request! 🚀**
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ❓ Question
|
|
3
|
+
about: Ask a question about Gemini Assist
|
|
4
|
+
title: '[QUESTION] '
|
|
5
|
+
labels: ['question', 'needs-triage']
|
|
6
|
+
assignees: ''
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## ❓ Question
|
|
10
|
+
<!-- What would you like to know? -->
|
|
11
|
+
|
|
12
|
+
## 📋 Context
|
|
13
|
+
<!-- Provide some context for your question -->
|
|
14
|
+
|
|
15
|
+
## 🔍 What I've Tried
|
|
16
|
+
<!-- Describe what you've already tried -->
|
|
17
|
+
|
|
18
|
+
## 📁 Relevant Configuration
|
|
19
|
+
<!-- If applicable, share relevant parts of your configuration -->
|
|
20
|
+
|
|
21
|
+
## 📚 Documentation Check
|
|
22
|
+
<!-- Have you checked the README and other documentation? -->
|
|
23
|
+
|
|
24
|
+
## 🔗 Related Issues
|
|
25
|
+
<!-- Link to any related issues or discussions -->
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
**Thank you for your question! We're here to help! 🚀**
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
version: 2
|
|
2
|
+
updates:
|
|
3
|
+
# Enable version updates for Rust
|
|
4
|
+
- package-ecosystem: "cargo"
|
|
5
|
+
directory: "/"
|
|
6
|
+
schedule:
|
|
7
|
+
interval: "weekly"
|
|
8
|
+
day: "monday"
|
|
9
|
+
time: "09:00"
|
|
10
|
+
open-pull-requests-limit: 10
|
|
11
|
+
reviewers:
|
|
12
|
+
- "Zemerik"
|
|
13
|
+
assignees:
|
|
14
|
+
- "Zemerik"
|
|
15
|
+
commit-message:
|
|
16
|
+
prefix: "chore"
|
|
17
|
+
include: "scope"
|
|
18
|
+
|
|
19
|
+
# Enable version updates for GitHub Actions
|
|
20
|
+
- package-ecosystem: "github-actions"
|
|
21
|
+
directory: "/"
|
|
22
|
+
schedule:
|
|
23
|
+
interval: "weekly"
|
|
24
|
+
day: "monday"
|
|
25
|
+
time: "09:00"
|
|
26
|
+
open-pull-requests-limit: 10
|
|
27
|
+
reviewers:
|
|
28
|
+
- "Zemerik"
|
|
29
|
+
assignees:
|
|
30
|
+
- "Zemerik"
|
|
31
|
+
commit-message:
|
|
32
|
+
prefix: "chore"
|
|
33
|
+
include: "scope"
|
|
34
|
+
|
|
35
|
+
# Enable version updates for npm (if you add any npm dependencies later)
|
|
36
|
+
- package-ecosystem: "npm"
|
|
37
|
+
directory: "/"
|
|
38
|
+
schedule:
|
|
39
|
+
interval: "weekly"
|
|
40
|
+
day: "monday"
|
|
41
|
+
time: "09:00"
|
|
42
|
+
open-pull-requests-limit: 10
|
|
43
|
+
reviewers:
|
|
44
|
+
- "Zemerik"
|
|
45
|
+
assignees:
|
|
46
|
+
- "Zemerik"
|
|
47
|
+
commit-message:
|
|
48
|
+
prefix: "chore"
|
|
49
|
+
include: "scope"
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
# Labels for issues and pull requests
|
|
2
|
+
labels:
|
|
3
|
+
# Bug labels
|
|
4
|
+
- name: bug
|
|
5
|
+
color: d73a4a
|
|
6
|
+
description: Something isn't working
|
|
7
|
+
- name: bug/critical
|
|
8
|
+
color: b60205
|
|
9
|
+
description: Critical bug that needs immediate attention
|
|
10
|
+
- name: bug/regression
|
|
11
|
+
color: d73a4a
|
|
12
|
+
description: A bug that was introduced in a recent release
|
|
13
|
+
|
|
14
|
+
# Feature labels
|
|
15
|
+
- name: enhancement
|
|
16
|
+
color: 0366d6
|
|
17
|
+
description: New feature or request
|
|
18
|
+
- name: feature/request
|
|
19
|
+
color: 0366d6
|
|
20
|
+
description: Feature request from users
|
|
21
|
+
- name: feature/planned
|
|
22
|
+
color: 0e8a16
|
|
23
|
+
description: Feature that is planned for future release
|
|
24
|
+
|
|
25
|
+
# Documentation labels
|
|
26
|
+
- name: documentation
|
|
27
|
+
color: 0075ca
|
|
28
|
+
description: Improvements or additions to documentation
|
|
29
|
+
- name: docs/readme
|
|
30
|
+
color: 0075ca
|
|
31
|
+
description: README documentation updates
|
|
32
|
+
- name: docs/api
|
|
33
|
+
color: 0075ca
|
|
34
|
+
description: API documentation updates
|
|
35
|
+
|
|
36
|
+
# Good for contributors
|
|
37
|
+
- name: good first issue
|
|
38
|
+
color: 7057ff
|
|
39
|
+
description: Good for newcomers
|
|
40
|
+
- name: help wanted
|
|
41
|
+
color: 008672
|
|
42
|
+
description: Extra attention is needed
|
|
43
|
+
|
|
44
|
+
# Priority labels
|
|
45
|
+
- name: priority/high
|
|
46
|
+
color: b60205
|
|
47
|
+
description: High priority issue
|
|
48
|
+
- name: priority/medium
|
|
49
|
+
color: fbca04
|
|
50
|
+
description: Medium priority issue
|
|
51
|
+
- name: priority/low
|
|
52
|
+
color: 0e8a16
|
|
53
|
+
description: Low priority issue
|
|
54
|
+
|
|
55
|
+
# Status labels
|
|
56
|
+
- name: status/blocked
|
|
57
|
+
color: d93f0b
|
|
58
|
+
description: Blocked by another issue
|
|
59
|
+
- name: status/in-progress
|
|
60
|
+
color: 1d76db
|
|
61
|
+
description: Work in progress
|
|
62
|
+
- name: status/needs-review
|
|
63
|
+
color: fbca04
|
|
64
|
+
description: Needs review
|
|
65
|
+
- name: status/ready
|
|
66
|
+
color: 0e8a16
|
|
67
|
+
description: Ready for implementation
|
|
68
|
+
|
|
69
|
+
# Type labels
|
|
70
|
+
- name: type/bug
|
|
71
|
+
color: d73a4a
|
|
72
|
+
description: Bug report
|
|
73
|
+
- name: type/feature
|
|
74
|
+
color: 0366d6
|
|
75
|
+
description: Feature request
|
|
76
|
+
- name: type/question
|
|
77
|
+
color: cc317c
|
|
78
|
+
description: Question or support request
|
|
79
|
+
- name: type/security
|
|
80
|
+
color: b60205
|
|
81
|
+
description: Security vulnerability
|
|
82
|
+
|
|
83
|
+
# Component labels
|
|
84
|
+
- name: component/cli
|
|
85
|
+
color: 5319e7
|
|
86
|
+
description: CLI interface
|
|
87
|
+
- name: component/rust
|
|
88
|
+
color: 5319e7
|
|
89
|
+
description: Rust implementation
|
|
90
|
+
- name: component/js
|
|
91
|
+
color: 5319e7
|
|
92
|
+
description: JavaScript implementation
|
|
93
|
+
- name: component/api
|
|
94
|
+
color: 5319e7
|
|
95
|
+
description: Gemini API integration
|
|
96
|
+
- name: component/napi
|
|
97
|
+
color: 5319e7
|
|
98
|
+
description: Node-API bindings
|
|
99
|
+
|
|
100
|
+
# Maintenance labels
|
|
101
|
+
- name: maintenance
|
|
102
|
+
color: 0366d6
|
|
103
|
+
description: Maintenance tasks
|
|
104
|
+
- name: refactor
|
|
105
|
+
color: 0366d6
|
|
106
|
+
description: Code refactoring
|
|
107
|
+
- name: performance
|
|
108
|
+
color: 0e8a16
|
|
109
|
+
description: Performance improvements
|
|
110
|
+
- name: testing
|
|
111
|
+
color: 0075ca
|
|
112
|
+
description: Testing related changes
|
|
113
|
+
|
|
114
|
+
# Special labels
|
|
115
|
+
- name: pinned
|
|
116
|
+
color: 5319e7
|
|
117
|
+
description: Pinned issue
|
|
118
|
+
- name: duplicate
|
|
119
|
+
color: cfd3d7
|
|
120
|
+
description: Duplicate issue
|
|
121
|
+
- name: wontfix
|
|
122
|
+
color: cfd3d7
|
|
123
|
+
description: Will not be fixed
|
|
124
|
+
- name: invalid
|
|
125
|
+
color: cfd3d7
|
|
126
|
+
description: Invalid issue
|
|
127
|
+
- name: needs-triage
|
|
128
|
+
color: fbca04
|
|
129
|
+
description: Needs triage
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
## 📋 Pull Request Description
|
|
2
|
+
|
|
3
|
+
### 🎯 What does this PR do?
|
|
4
|
+
<!-- Provide a brief description of the changes -->
|
|
5
|
+
|
|
6
|
+
### 🔍 Type of Change
|
|
7
|
+
- [ ] 🐛 Bug fix (non-breaking change which fixes an issue)
|
|
8
|
+
- [ ] ✨ New feature (non-breaking change which adds functionality)
|
|
9
|
+
- [ ] 💥 Breaking change (fix or feature that would cause existing functionality to not work as expected)
|
|
10
|
+
- [ ] 📚 Documentation update
|
|
11
|
+
- [ ] 🧹 Code refactoring
|
|
12
|
+
- [ ] ⚡ Performance improvement
|
|
13
|
+
- [ ] 🧪 Test addition or update
|
|
14
|
+
- [ ] 🔧 Build system or external dependency change
|
|
15
|
+
|
|
16
|
+
### 📝 Checklist
|
|
17
|
+
- [ ] I have read the [Contributing Guidelines](CONTRIBUTING.md) (if available)
|
|
18
|
+
- [ ] My code follows the project's style guidelines
|
|
19
|
+
- [ ] I have performed a self-review of my own code
|
|
20
|
+
- [ ] I have commented my code, particularly in hard-to-understand areas
|
|
21
|
+
- [ ] I have made corresponding changes to the documentation
|
|
22
|
+
- [ ] My changes generate no new warnings
|
|
23
|
+
- [ ] I have tested the changes locally
|
|
24
|
+
- [ ] I have tested the CLI functionality manually
|
|
25
|
+
- [ ] If Rust changes, I have run `cargo test` and `cargo clippy`
|
|
26
|
+
- [ ] If JavaScript changes, I have tested with Node.js >=14.0.0
|
|
27
|
+
|
|
28
|
+
### 🧪 Testing
|
|
29
|
+
- [ ] I have tested this change locally
|
|
30
|
+
- [ ] I have tested the CLI in both interactive and single-query modes
|
|
31
|
+
- [ ] I have verified Rust bindings still work (if applicable)
|
|
32
|
+
- [ ] I have verified JavaScript fallback works (if applicable)
|
|
33
|
+
|
|
34
|
+
### 📸 Screenshots (if applicable)
|
|
35
|
+
<!-- Add screenshots to help explain your changes -->
|
|
36
|
+
|
|
37
|
+
### 🔗 Related Issues
|
|
38
|
+
<!-- Link to any related issues -->
|
|
39
|
+
Closes #(issue number)
|
|
40
|
+
|
|
41
|
+
### 📋 Additional Notes
|
|
42
|
+
<!-- Any additional information that reviewers should know -->
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
**Thank you for contributing to Gemini Assist!**
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Number of days of inactivity before an issue becomes stale
|
|
2
|
+
daysUntilStale: 60
|
|
3
|
+
# Number of days of inactivity before a stale issue is closed
|
|
4
|
+
daysUntilClose: 7
|
|
5
|
+
# Issues with these labels will never be considered stale
|
|
6
|
+
exemptLabels:
|
|
7
|
+
- pinned
|
|
8
|
+
- security
|
|
9
|
+
- bug
|
|
10
|
+
- enhancement
|
|
11
|
+
- documentation
|
|
12
|
+
- good first issue
|
|
13
|
+
- help wanted
|
|
14
|
+
# Label to use when marking an issue as stale
|
|
15
|
+
staleLabel: no-issue-activity
|
|
16
|
+
# Comment to post when marking an issue as stale. Set to `false` to disable
|
|
17
|
+
markComment: >
|
|
18
|
+
This issue has been automatically marked as stale because it has not had
|
|
19
|
+
recent activity. It will be closed if no further activity occurs. Thank you
|
|
20
|
+
for your contributions.
|
|
21
|
+
# Comment to post when closing a stale issue. Set to `false` to disable
|
|
22
|
+
closeComment: >
|
|
23
|
+
This issue has been automatically closed due to inactivity. If you believe
|
|
24
|
+
this issue is still relevant, please feel free to reopen it or create a new
|
|
25
|
+
one.
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
name: CI/CD Pipeline
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [ main, develop ]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [ main ]
|
|
8
|
+
|
|
9
|
+
env:
|
|
10
|
+
CARGO_TERM_COLOR: always
|
|
11
|
+
NODE_VERSION: '18'
|
|
12
|
+
|
|
13
|
+
jobs:
|
|
14
|
+
test-js:
|
|
15
|
+
name: Test JavaScript
|
|
16
|
+
runs-on: ubuntu-latest
|
|
17
|
+
|
|
18
|
+
steps:
|
|
19
|
+
- name: Checkout code
|
|
20
|
+
uses: actions/checkout@v6
|
|
21
|
+
|
|
22
|
+
- name: Setup Node.js
|
|
23
|
+
uses: actions/setup-node@v6
|
|
24
|
+
with:
|
|
25
|
+
node-version: ${{ env.NODE_VERSION }}
|
|
26
|
+
cache: 'npm'
|
|
27
|
+
|
|
28
|
+
- name: Install dependencies
|
|
29
|
+
run: npm ci
|
|
30
|
+
|
|
31
|
+
- name: Run ESLint (if configured)
|
|
32
|
+
run: npm run lint || echo "No lint script configured"
|
|
33
|
+
continue-on-error: true
|
|
34
|
+
|
|
35
|
+
- name: Test package structure
|
|
36
|
+
run: |
|
|
37
|
+
node -e "const pkg = require('./package.json'); console.log('Package:', pkg.name, pkg.version)"
|
|
38
|
+
test -f bin/gemini-assist.js && echo "✓ CLI binary exists"
|
|
39
|
+
test -f src/gemini.js && echo "✓ Gemini client exists"
|
|
40
|
+
|
|
41
|
+
test-rust:
|
|
42
|
+
name: Test Rust
|
|
43
|
+
runs-on: ubuntu-latest
|
|
44
|
+
strategy:
|
|
45
|
+
matrix:
|
|
46
|
+
rust: [stable]
|
|
47
|
+
target: [x86_64-unknown-linux-gnu]
|
|
48
|
+
|
|
49
|
+
steps:
|
|
50
|
+
- name: Checkout code
|
|
51
|
+
uses: actions/checkout@v6
|
|
52
|
+
|
|
53
|
+
- name: Install Rust toolchain
|
|
54
|
+
uses: dtolnay/rust-toolchain@stable
|
|
55
|
+
with:
|
|
56
|
+
toolchain: ${{ matrix.rust }}
|
|
57
|
+
target: ${{ matrix.target }}
|
|
58
|
+
|
|
59
|
+
- name: Cache Rust dependencies
|
|
60
|
+
uses: actions/cache@v4
|
|
61
|
+
with:
|
|
62
|
+
path: |
|
|
63
|
+
~/.cargo/registry
|
|
64
|
+
~/.cargo/git
|
|
65
|
+
target
|
|
66
|
+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
|
|
67
|
+
restore-keys: |
|
|
68
|
+
${{ runner.os }}-cargo-
|
|
69
|
+
|
|
70
|
+
- name: Run Rust tests
|
|
71
|
+
run: cargo test --verbose
|
|
72
|
+
|
|
73
|
+
- name: Run clippy
|
|
74
|
+
run: cargo clippy -- -D warnings
|
|
75
|
+
continue-on-error: true
|
|
76
|
+
|
|
77
|
+
- name: Check formatting
|
|
78
|
+
run: cargo fmt -- --check
|
|
79
|
+
|
|
80
|
+
build-rust-bindings:
|
|
81
|
+
name: Build Rust Bindings
|
|
82
|
+
runs-on: ${{ matrix.os }}
|
|
83
|
+
strategy:
|
|
84
|
+
matrix:
|
|
85
|
+
os: [ubuntu-latest, macos-latest, windows-latest]
|
|
86
|
+
include:
|
|
87
|
+
- os: ubuntu-latest
|
|
88
|
+
target: x86_64-unknown-linux-gnu
|
|
89
|
+
- os: macos-latest
|
|
90
|
+
target: x86_64-apple-darwin
|
|
91
|
+
- os: macos-latest
|
|
92
|
+
target: aarch64-apple-darwin
|
|
93
|
+
- os: windows-latest
|
|
94
|
+
target: x86_64-pc-windows-msvc
|
|
95
|
+
|
|
96
|
+
steps:
|
|
97
|
+
- name: Checkout code
|
|
98
|
+
uses: actions/checkout@v6
|
|
99
|
+
|
|
100
|
+
- name: Setup Node.js
|
|
101
|
+
uses: actions/setup-node@v6
|
|
102
|
+
with:
|
|
103
|
+
node-version: ${{ env.NODE_VERSION }}
|
|
104
|
+
cache: 'npm'
|
|
105
|
+
|
|
106
|
+
- name: Install dependencies
|
|
107
|
+
run: npm ci
|
|
108
|
+
|
|
109
|
+
- name: Install Rust toolchain
|
|
110
|
+
uses: dtolnay/rust-toolchain@stable
|
|
111
|
+
with:
|
|
112
|
+
target: ${{ matrix.target }}
|
|
113
|
+
|
|
114
|
+
- name: Install napi-rs CLI
|
|
115
|
+
run: npm install -g @napi-rs/cli
|
|
116
|
+
|
|
117
|
+
- name: Cache Rust dependencies
|
|
118
|
+
uses: actions/cache@v4
|
|
119
|
+
with:
|
|
120
|
+
path: |
|
|
121
|
+
~/.cargo/registry
|
|
122
|
+
~/.cargo/git
|
|
123
|
+
target
|
|
124
|
+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
|
|
125
|
+
restore-keys: |
|
|
126
|
+
${{ runner.os }}-cargo-
|
|
127
|
+
|
|
128
|
+
- name: Build Rust bindings
|
|
129
|
+
run: npm run build
|
|
130
|
+
continue-on-error: true
|
|
131
|
+
|
|
132
|
+
publish-npm:
|
|
133
|
+
name: Publish to NPM
|
|
134
|
+
runs-on: ubuntu-latest
|
|
135
|
+
needs: [test-js, test-rust]
|
|
136
|
+
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
|
|
137
|
+
|
|
138
|
+
steps:
|
|
139
|
+
- name: Checkout code
|
|
140
|
+
uses: actions/checkout@v6
|
|
141
|
+
|
|
142
|
+
- name: Setup Node.js
|
|
143
|
+
uses: actions/setup-node@v6
|
|
144
|
+
with:
|
|
145
|
+
node-version: ${{ env.NODE_VERSION }}
|
|
146
|
+
registry-url: 'https://registry.npmjs.org'
|
|
147
|
+
cache: 'npm'
|
|
148
|
+
|
|
149
|
+
- name: Install dependencies
|
|
150
|
+
run: npm ci
|
|
151
|
+
|
|
152
|
+
- name: Install Rust toolchain
|
|
153
|
+
uses: dtolnay/rust-toolchain@stable
|
|
154
|
+
|
|
155
|
+
- name: Build Rust bindings
|
|
156
|
+
run: npm run build
|
|
157
|
+
continue-on-error: true
|
|
158
|
+
|
|
159
|
+
- name: Publish to NPM
|
|
160
|
+
run: npm publish --access public
|
|
161
|
+
env:
|
|
162
|
+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
163
|
+
|
|
164
|
+
security:
|
|
165
|
+
name: Security Audit
|
|
166
|
+
runs-on: ubuntu-latest
|
|
167
|
+
|
|
168
|
+
steps:
|
|
169
|
+
- name: Checkout code
|
|
170
|
+
uses: actions/checkout@v6
|
|
171
|
+
|
|
172
|
+
- name: Setup Node.js
|
|
173
|
+
uses: actions/setup-node@v6
|
|
174
|
+
with:
|
|
175
|
+
node-version: ${{ env.NODE_VERSION }}
|
|
176
|
+
cache: 'npm'
|
|
177
|
+
|
|
178
|
+
- name: Install dependencies
|
|
179
|
+
run: npm ci
|
|
180
|
+
|
|
181
|
+
- name: Run npm audit
|
|
182
|
+
run: npm audit --audit-level=moderate
|
|
183
|
+
continue-on-error: true
|
|
184
|
+
|
|
185
|
+
- name: Install Rust toolchain
|
|
186
|
+
uses: dtolnay/rust-toolchain@stable
|
|
187
|
+
|
|
188
|
+
- name: Run cargo audit
|
|
189
|
+
uses: rustsec/audit-check@v1.4.0
|
|
190
|
+
with:
|
|
191
|
+
token: ${{ secrets.GITHUB_TOKEN }}
|
|
192
|
+
continue-on-error: true
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
name: Release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- 'v*'
|
|
7
|
+
|
|
8
|
+
env:
|
|
9
|
+
CARGO_TERM_COLOR: always
|
|
10
|
+
NODE_VERSION: '18'
|
|
11
|
+
|
|
12
|
+
jobs:
|
|
13
|
+
release:
|
|
14
|
+
name: Create Release
|
|
15
|
+
runs-on: ubuntu-latest
|
|
16
|
+
|
|
17
|
+
steps:
|
|
18
|
+
- name: Checkout code
|
|
19
|
+
uses: actions/checkout@v6
|
|
20
|
+
with:
|
|
21
|
+
fetch-depth: 0
|
|
22
|
+
|
|
23
|
+
- name: Setup Node.js
|
|
24
|
+
uses: actions/setup-node@v6
|
|
25
|
+
with:
|
|
26
|
+
node-version: ${{ env.NODE_VERSION }}
|
|
27
|
+
registry-url: 'https://registry.npmjs.org'
|
|
28
|
+
cache: 'npm'
|
|
29
|
+
|
|
30
|
+
- name: Install dependencies
|
|
31
|
+
run: npm ci
|
|
32
|
+
|
|
33
|
+
- name: Install Rust toolchain
|
|
34
|
+
uses: dtolnay/rust-toolchain@stable
|
|
35
|
+
|
|
36
|
+
- name: Cache Rust dependencies
|
|
37
|
+
uses: actions/cache@v4
|
|
38
|
+
with:
|
|
39
|
+
path: |
|
|
40
|
+
~/.cargo/registry
|
|
41
|
+
~/.cargo/git
|
|
42
|
+
target
|
|
43
|
+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
|
|
44
|
+
restore-keys: |
|
|
45
|
+
${{ runner.os }}-cargo-
|
|
46
|
+
|
|
47
|
+
- name: Get version from tag
|
|
48
|
+
id: get_version
|
|
49
|
+
run: |
|
|
50
|
+
VERSION=${GITHUB_REF#refs/tags/v}
|
|
51
|
+
echo "version=$VERSION" >> $GITHUB_OUTPUT
|
|
52
|
+
echo "Tag version: $VERSION"
|
|
53
|
+
|
|
54
|
+
- name: Build Rust bindings for multiple platforms
|
|
55
|
+
run: npm run build
|
|
56
|
+
continue-on-error: true
|
|
57
|
+
|
|
58
|
+
- name: Create GitHub Release
|
|
59
|
+
uses: softprops/action-gh-release@v1
|
|
60
|
+
with:
|
|
61
|
+
name: Gemini Assist v${{ steps.get_version.outputs.version }}
|
|
62
|
+
body_path: RELEASE_NOTES.md
|
|
63
|
+
draft: false
|
|
64
|
+
prerelease: ${{ contains(github.ref, 'beta') || contains(github.ref, 'alpha') || contains(github.ref, 'rc') }}
|
|
65
|
+
env:
|
|
66
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
67
|
+
|
|
68
|
+
- name: Publish to NPM
|
|
69
|
+
run: npm publish --access public
|
|
70
|
+
env:
|
|
71
|
+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
package/.rustignore
ADDED
package/Cargo.toml
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
[package]
|
|
2
|
+
name = "gemini-assist-rs"
|
|
3
|
+
version = "1.1.1-beta"
|
|
4
|
+
edition = "2021"
|
|
5
|
+
|
|
6
|
+
[lib]
|
|
7
|
+
crate-type = ["cdylib", "rlib"]
|
|
8
|
+
|
|
9
|
+
[build-dependencies]
|
|
10
|
+
napi-build = "2"
|
|
11
|
+
|
|
12
|
+
[dependencies]
|
|
13
|
+
napi = { version = "2", features = ["napi8", "tokio_rt", "serde-json"] }
|
|
14
|
+
napi-derive = "2"
|
|
15
|
+
tokio = { version = "1", features = ["full"] }
|
|
16
|
+
reqwest = { version = "0.11", features = ["json"] }
|
|
17
|
+
serde = { version = "1", features = ["derive"] }
|
|
18
|
+
serde_json = "1"
|
|
19
|
+
anyhow = "1"
|
package/LICENSE
ADDED
|
File without changes
|