Skip to content

Commit f096b52

Browse files
authored
Merge branch 'menloresearch:dev' into dev
2 parents 6090329 + 5969301 commit f096b52

File tree

90 files changed

+13341
-10373
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

90 files changed

+13341
-10373
lines changed

.claude/commands/dedupe.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
---
2+
allowed-tools: Bash(gh issue view:*), Bash(gh search:*), Bash(gh issue list:*), Bash(gh api:*), Bash(gh issue comment:*)
3+
description: Find duplicate GitHub issues
4+
---
5+
6+
Find up to 3 likely duplicate issues for a given GitHub issue.
7+
8+
To do this, follow these steps precisely:
9+
10+
1. Use an agent to check if the Github issue (a) is closed, (b) does not need to be deduped (eg. because it is broad product feedback without a specific solution, or positive feedback), or (c) already has a duplicates comment that you made earlier. If so, do not proceed.
11+
2. Use an agent to view a Github issue, and ask the agent to return a summary of the issue
12+
3. Then, launch 5 parallel agents to search Github for duplicates of this issue, using diverse keywords and search approaches, using the summary from #1
13+
4. Next, feed the results from #1 and #2 into another agent, so that it can filter out false positives, that are likely not actually duplicates of the original issue. If there are no duplicates remaining, do not proceed.
14+
5. Finally, comment back on the issue with a list of up to three duplicate issues (or zero, if there are no likely duplicates)
15+
16+
Notes (be sure to tell this to your agents, too):
17+
18+
- Use `gh` to interact with Github, rather than web fetch
19+
- Do not use other tools, beyond `gh` (eg. don't use other MCP servers, file edit, etc.)
20+
- Make a todo list first
21+
- For your comment, follow the following format precisely (assuming for this example that you found 3 suspected duplicates):
22+
23+
---
24+
25+
Found 3 possible duplicate issues:
26+
27+
1. <link to issue>
28+
2. <link to issue>
29+
3. <link to issue>
30+
31+
---
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Claude Issue Dedupe
2+
description: Automatically dedupe GitHub issues using Claude Code
3+
on:
4+
issues:
5+
types: [opened]
6+
workflow_dispatch:
7+
inputs:
8+
issue_number:
9+
description: 'Issue number to process for duplicate detection'
10+
required: true
11+
type: string
12+
13+
jobs:
14+
claude-dedupe-issues:
15+
runs-on: ubuntu-latest
16+
timeout-minutes: 10
17+
permissions:
18+
contents: read
19+
issues: write
20+
21+
steps:
22+
- name: Checkout repository
23+
uses: actions/checkout@v4
24+
25+
- name: Run Claude Code dedupe
26+
uses: anthropics/claude-code-base-action@beta
27+
with:
28+
prompt: "/dedupe ${{ github.repository }}/issues/${{ github.event.issue.number || inputs.issue_number }}"
29+
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
30+
claude_env: |
31+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/jan-server-web-ci.yml

Lines changed: 4 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,10 @@ name: Jan Web Server build image and push to Harbor Registry
33
on:
44
push:
55
branches:
6-
- dev
7-
paths:
8-
- '.github/workflows/jan-server-web-ci.yml'
9-
- 'core/**'
10-
- 'web-app/**'
11-
- 'extensions-web/**'
12-
- 'Makefile'
13-
- 'package.json'
14-
- 'Dockerfile'
6+
- dev-web
157
pull_request:
168
branches:
17-
- dev
18-
paths:
19-
- '.github/workflows/jan-server-web-ci.yml'
20-
- 'core/**'
21-
- 'web-app/**'
22-
- 'extensions-web/**'
23-
- 'Makefile'
24-
- 'package.json'
25-
- 'Dockerfile'
9+
- dev-web
2610

2711
jobs:
2812
build-and-preview:
@@ -53,16 +37,14 @@ jobs:
5337
&& sudo apt update
5438
sudo apt-get install -y jq gettext
5539
56-
- name: Set image tag and service name
40+
- name: Set image tag
5741
id: vars
5842
run: |
59-
SERVICE_NAME=jan-server-web
6043
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
6144
IMAGE_TAG="web:preview-${{ github.sha }}"
6245
else
6346
IMAGE_TAG="web:dev-${{ github.sha }}"
6447
fi
65-
echo "SERVICE_NAME=${SERVICE_NAME}" >> $GITHUB_OUTPUT
6648
echo "IMAGE_TAG=${IMAGE_TAG}" >> $GITHUB_OUTPUT
6749
echo "FULL_IMAGE=registry.menlo.ai/jan-server/${IMAGE_TAG}" >> $GITHUB_OUTPUT
6850
@@ -71,45 +53,6 @@ jobs:
7153
docker build -t ${{ steps.vars.outputs.FULL_IMAGE }} .
7254
7355
- name: Push docker image
56+
if: github.event_name == 'push'
7457
run: |
7558
docker push ${{ steps.vars.outputs.FULL_IMAGE }}
76-
77-
- name: Checkout preview URL repo
78-
if: github.event_name == 'pull_request'
79-
uses: actions/checkout@v4
80-
with:
81-
repository: menloresearch/infra-domains
82-
token: ${{ secrets.PAT_SERVICE_ACCOUNT }}
83-
path: preview-repo
84-
85-
- name: Generate preview manifest
86-
if: github.event_name == 'pull_request'
87-
run: |
88-
cd preview-repo/kubernetes
89-
bash template/generate.sh \
90-
template/preview-url-template.yaml \
91-
preview-url/pr-${{ github.sha }}-${{ steps.vars.outputs.SERVICE_NAME }}.yaml \
92-
${{ github.sha }} \
93-
${{ steps.vars.outputs.SERVICE_NAME }} \
94-
${{ steps.vars.outputs.FULL_IMAGE }} \
95-
80
96-
97-
- name: Commit and push preview manifest
98-
if: github.event_name == 'pull_request'
99-
run: |
100-
cd preview-repo
101-
git config user.name "preview-bot"
102-
git config user.email "[email protected]"
103-
git add kubernetes/preview-url/pr-${{ github.sha }}-${{ steps.vars.outputs.SERVICE_NAME }}.yaml
104-
git commit -m "feat(preview): add pr-${{ github.sha }}-${{ steps.vars.outputs.SERVICE_NAME }}.yaml"
105-
git push origin main
106-
sleep 180
107-
108-
- name: Comment preview URL on PR
109-
if: github.event_name == 'pull_request'
110-
env:
111-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
112-
uses: mshick/add-pr-comment@v2
113-
with:
114-
message: |
115-
Preview URL: https://pr-${{ github.sha }}-${{ steps.vars.outputs.SERVICE_NAME }}.menlo.ai
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Jan Web Server deploy to production
2+
3+
on:
4+
push:
5+
branches:
6+
- prod-web
7+
8+
jobs:
9+
build-and-deploy:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: write
13+
deployments: write
14+
pull-requests: write
15+
env:
16+
JAN_API_BASE: "https://api.jan.ai/jan/v1"
17+
CLOUDFLARE_PROJECT_NAME: "jan-server-web"
18+
steps:
19+
- uses: actions/checkout@v4
20+
- uses: actions/setup-node@v3
21+
with:
22+
node-version: 20
23+
24+
- name: Install jq
25+
uses: dcarbone/[email protected]
26+
27+
# - name: Fill env vars
28+
# run: |
29+
# env_example_file=".env.example"
30+
# touch .env
31+
# while IFS= read -r line || [[ -n "$line" ]]; do
32+
# if [[ "$line" == *"="* ]]; then
33+
# var_name=$(echo $line | cut -d '=' -f 1)
34+
# echo $var_name
35+
# var_value="$(jq -r --arg key "$var_name" '.[$key]' <<< "$SECRETS")"
36+
# echo "$var_name=$var_value" >> .env
37+
# fi
38+
# done < "$env_example_file"
39+
# env:
40+
# SECRETS: '${{ toJson(secrets) }}'
41+
42+
- name: Install dependencies
43+
run: make config-yarn && yarn install && yarn build:core && make build-web-app
44+
45+
- name: Publish to Cloudflare Pages Production
46+
uses: cloudflare/pages-action@v1
47+
with:
48+
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
49+
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
50+
projectName: ${{ env.CLOUDFLARE_PROJECT_NAME }}
51+
directory: ./web-app/dist-web
52+
branch: main
53+
# Optional: Enable this if you want to have GitHub Deployments triggered
54+
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Tauri Builder - Nightly / External PRs
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- dev
7+
paths:
8+
- '.github/workflows/jan-tauri-build-nightly-external.yaml'
9+
- '.github/workflows/template-tauri-build-*-external.yml'
10+
- 'src-tauri/**'
11+
- 'core/**'
12+
- 'web-app/**'
13+
- 'extensions/**'
14+
- 'scripts/**'
15+
- 'pre-install/**'
16+
- 'Makefile'
17+
- 'package.json'
18+
- 'mise.toml'
19+
20+
jobs:
21+
get-update-version:
22+
uses: ./.github/workflows/template-get-update-version.yml
23+
24+
build-macos:
25+
uses: ./.github/workflows/template-tauri-build-macos-external.yml
26+
needs: [get-update-version]
27+
with:
28+
ref: ${{ github.ref }}
29+
new_version: ${{ needs.get-update-version.outputs.new_version }}
30+
channel: nightly
31+
32+
build-windows-x64:
33+
uses: ./.github/workflows/template-tauri-build-windows-x64-external.yml
34+
needs: [get-update-version]
35+
with:
36+
ref: ${{ github.ref }}
37+
new_version: ${{ needs.get-update-version.outputs.new_version }}
38+
channel: nightly
39+
40+
build-linux-x64:
41+
uses: ./.github/workflows/template-tauri-build-linux-x64-external.yml
42+
needs: [get-update-version]
43+
with:
44+
ref: ${{ github.ref }}
45+
new_version: ${{ needs.get-update-version.outputs.new_version }}
46+
channel: nightly
47+
disable_updater: false
Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
name: tauri-build-linux-x64-external
2+
on:
3+
workflow_call:
4+
inputs:
5+
ref:
6+
required: true
7+
type: string
8+
default: 'refs/heads/main'
9+
new_version:
10+
required: true
11+
type: string
12+
default: ''
13+
channel:
14+
required: true
15+
type: string
16+
default: 'nightly'
17+
description: 'The channel to use for this job'
18+
disable_updater:
19+
required: false
20+
type: boolean
21+
default: false
22+
description: 'If true, builds both .deb and .appimage but disables auto-updater'
23+
jobs:
24+
build-linux-x64-external:
25+
runs-on: ubuntu-latest
26+
steps:
27+
- name: Getting the repo
28+
uses: actions/checkout@v3
29+
with:
30+
ref: ${{ inputs.ref }}
31+
32+
- name: Free Disk Space Before Build
33+
run: |
34+
echo "Disk space before cleanup:"
35+
df -h
36+
sudo rm -rf /usr/local/.ghcup
37+
sudo rm -rf /opt/hostedtoolcache/CodeQL
38+
sudo rm -rf /usr/local/lib/android/sdk/ndk
39+
sudo rm -rf /usr/share/dotnet
40+
sudo rm -rf /opt/ghc
41+
sudo rm -rf /usr/local/share/boost
42+
sudo apt-get clean
43+
echo "Disk space after cleanup:"
44+
df -h
45+
46+
- name: Replace Icons for Beta Build
47+
if: inputs.channel != 'stable'
48+
shell: bash
49+
run: |
50+
cp .github/scripts/icon-${{ inputs.channel }}.png src-tauri/icons/icon.png
51+
52+
- name: Installing node
53+
uses: actions/setup-node@v1
54+
with:
55+
node-version: 20
56+
57+
- name: Install jq
58+
uses: dcarbone/[email protected]
59+
60+
- name: Install ctoml
61+
run: |
62+
cargo install ctoml
63+
64+
- name: Install Tauri dependencies
65+
run: |
66+
sudo apt update
67+
sudo apt install -y libglib2.0-dev libatk1.0-dev libpango1.0-dev libgtk-3-dev libsoup-3.0-dev libwebkit2gtk-4.1-dev librsvg2-dev libfuse2
68+
69+
- name: Update app version
70+
run: |
71+
echo "Version: ${{ inputs.new_version }}"
72+
jq --arg version "${{ inputs.new_version }}" '.version = $version | .bundle.createUpdaterArtifacts = false' ./src-tauri/tauri.conf.json > /tmp/tauri.conf.json
73+
mv /tmp/tauri.conf.json ./src-tauri/tauri.conf.json
74+
if [ "${{ inputs.channel }}" != "stable" ]; then
75+
jq '.bundle.linux.deb.files = {"usr/bin/bun": "resources/bin/bun",
76+
"usr/lib/Jan-${{ inputs.channel }}/resources/lib/libvulkan.so": "resources/lib/libvulkan.so"}' ./src-tauri/tauri.linux.conf.json > /tmp/tauri.linux.conf.json
77+
mv /tmp/tauri.linux.conf.json ./src-tauri/tauri.linux.conf.json
78+
fi
79+
jq --arg version "${{ inputs.new_version }}" '.version = $version' web-app/package.json > /tmp/package.json
80+
mv /tmp/package.json web-app/package.json
81+
82+
ctoml ./src-tauri/Cargo.toml dependencies.tauri.features[] "devtools"
83+
ctoml ./src-tauri/Cargo.toml package.version "${{ inputs.new_version }}"
84+
85+
if [ "${{ inputs.channel }}" != "stable" ]; then
86+
jq '.plugins.updater.endpoints = ["https://delta.jan.ai/${{ inputs.channel }}/latest.json"]' ./src-tauri/tauri.conf.json > /tmp/tauri.conf.json
87+
mv /tmp/tauri.conf.json ./src-tauri/tauri.conf.json
88+
chmod +x .github/scripts/rename-tauri-app.sh
89+
.github/scripts/rename-tauri-app.sh ./src-tauri/tauri.conf.json ${{ inputs.channel }}
90+
ctoml ./src-tauri/Cargo.toml package.name "Jan-${{ inputs.channel }}"
91+
ctoml ./src-tauri/Cargo.toml dependencies.tauri.features[] "devtools"
92+
chmod +x .github/scripts/rename-workspace.sh
93+
.github/scripts/rename-workspace.sh ./package.json ${{ inputs.channel }}
94+
fi
95+
96+
- name: Build app
97+
run: |
98+
make build
99+
100+
env:
101+
RELEASE_CHANNEL: '${{ inputs.channel }}'
102+
AUTO_UPDATER_DISABLED: ${{ inputs.disable_updater && 'true' || 'false' }}
103+
104+
- name: Upload Artifact
105+
uses: actions/upload-artifact@v4
106+
with:
107+
name: jan-linux-amd64-${{ inputs.new_version }}-deb
108+
path: ./src-tauri/target/release/bundle/deb/*.deb
109+
110+
- name: Upload Artifact
111+
uses: actions/upload-artifact@v4
112+
with:
113+
name: jan-linux-amd64-${{ inputs.new_version }}-AppImage
114+
path: ./src-tauri/target/release/bundle/appimage/*.AppImage

0 commit comments

Comments
 (0)