Skip to content

Commit 00f17f0

Browse files
committed
Local v2.0.2 state
0 parents  commit 00f17f0

604 files changed

Lines changed: 106856 additions & 0 deletions

File tree

Some content is hidden

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

.dockerignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
node_modules

.env.example

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Environment Variables for Production API Tests
2+
# Copy this file to .env and fill in your actual API keys
3+
4+
# Enable production test mode
5+
PRODUCTION_TEST_MODE=true
6+
7+
# GPT-5 Codex Test Configuration
8+
TEST_GPT5_API_KEY=your_gpt5_api_key_here
9+
TEST_GPT5_BASE_URL=http://127.0.0.1:3000/openai
10+
11+
# MiniMax Codex Test Configuration
12+
TEST_MINIMAX_API_KEY=your_minimax_api_key_here
13+
TEST_MINIMAX_BASE_URL=https://api.minimaxi.com/v1
14+
15+
# WARNING:
16+
# - Never commit .env files to version control!
17+
# - The .env file is already in .gitignore
18+
# - API keys should be kept secret and secure

.eslintrc.cjs

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
module.exports = {
2+
extends: ['eslint:recommended'],
3+
parser: '@typescript-eslint/parser',
4+
plugins: ['@typescript-eslint', 'react-hooks'],
5+
root: true,
6+
env: {
7+
node: true,
8+
es2022: true,
9+
},
10+
parserOptions: {
11+
ecmaVersion: 2022,
12+
sourceType: 'module',
13+
},
14+
rules: {
15+
'no-unused-vars': 'off',
16+
'no-empty': 'off',
17+
'no-empty-pattern': 'off',
18+
'no-undef': 'off',
19+
'no-mixed-spaces-and-tabs': 'off',
20+
'no-control-regex': 'off',
21+
'no-constant-condition': 'off',
22+
'no-extra-boolean-cast': 'off',
23+
'no-extra-semi': 'off',
24+
'no-redeclare': 'off',
25+
'no-inner-declarations': 'off',
26+
'no-useless-catch': 'off',
27+
'no-unreachable': 'off',
28+
'no-case-declarations': 'off',
29+
'no-useless-escape': 'off',
30+
'no-prototype-builtins': 'off',
31+
'require-yield': 'off',
32+
'@typescript-eslint/no-unused-vars': 'off',
33+
'@typescript-eslint/no-explicit-any': 'off',
34+
},
35+
ignorePatterns: [
36+
'dist/',
37+
'node_modules/',
38+
'vendor/',
39+
'cli.js',
40+
'cli-acp.js',
41+
],
42+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: "[BUG]"
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
## Bug Description
11+
<!-- NOTE: from v0.0.18, you can submit a bug from the app by typing /bug, it'll open a window to github issue create, with the model info pre-filled -->
12+
13+
14+
## App and Environment Info
15+
Kode Version: <!-- kode --version -->
16+
OS: <!-- macos/win -->
17+
18+
## Models <!-- get from /config or from ~/.kode.json -->
19+
baseURL:
20+
name:
21+
maxTokens:
22+
reasoning effort:

.github/workflows/ci.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
concurrency:
10+
group: ci-${{ github.ref }}
11+
cancel-in-progress: true
12+
13+
jobs:
14+
test:
15+
name: ${{ matrix.os }}
16+
runs-on: ${{ matrix.os }}
17+
strategy:
18+
fail-fast: false
19+
matrix:
20+
os: [ubuntu-latest, macos-latest, windows-latest]
21+
env:
22+
KODE_SKIP_BINARY_DOWNLOAD: "1"
23+
steps:
24+
- name: Checkout
25+
uses: actions/checkout@v4
26+
27+
- name: Setup Bun
28+
uses: oven-sh/setup-bun@v1
29+
with:
30+
bun-version: latest
31+
32+
- name: Install
33+
run: bun install
34+
35+
- name: Format
36+
run: bun run format:check
37+
38+
- name: Typecheck
39+
run: bun run typecheck
40+
41+
- name: Test
42+
run: bun test
43+
44+
- name: Build
45+
run: bun run build
46+

.github/workflows/dev-release.yml

Lines changed: 177 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,177 @@
1+
name: Dev Release (main)
2+
3+
on:
4+
push:
5+
branches: [main]
6+
7+
concurrency:
8+
group: dev-release-${{ github.ref }}
9+
cancel-in-progress: false
10+
11+
jobs:
12+
compute-version:
13+
runs-on: ubuntu-latest
14+
outputs:
15+
dev_version: ${{ steps.version.outputs.dev_version }}
16+
tag_name: ${{ steps.version.outputs.tag_name }}
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@v4
20+
21+
- name: Setup Node.js
22+
uses: actions/setup-node@v4
23+
with:
24+
node-version: '20.18.1'
25+
26+
- name: Compute dev version
27+
id: version
28+
run: |
29+
BASE_VERSION=$(node -p "require('./package.json').version")
30+
DEV_VERSION="${BASE_VERSION}-dev.${{ github.run_number }}"
31+
echo "dev_version=${DEV_VERSION}" >> "${GITHUB_OUTPUT}"
32+
echo "tag_name=v${DEV_VERSION}" >> "${GITHUB_OUTPUT}"
33+
echo "Dev version: ${DEV_VERSION}"
34+
35+
build-binaries:
36+
needs: compute-version
37+
strategy:
38+
fail-fast: false
39+
matrix:
40+
include:
41+
- os: ubuntu-latest
42+
target: bun-linux-x64
43+
asset: kode-linux-x64
44+
- os: ubuntu-latest
45+
target: bun-linux-arm64
46+
asset: kode-linux-arm64
47+
- os: macos-latest
48+
target: bun-darwin-x64
49+
asset: kode-darwin-x64
50+
- os: macos-latest
51+
target: bun-darwin-arm64
52+
asset: kode-darwin-arm64
53+
- os: windows-latest
54+
target: bun-windows-x64
55+
asset: kode-win32-x64.exe
56+
runs-on: ${{ matrix.os }}
57+
env:
58+
KODE_SKIP_BINARY_DOWNLOAD: "1"
59+
steps:
60+
- name: Checkout
61+
uses: actions/checkout@v4
62+
63+
- name: Setup Node.js
64+
uses: actions/setup-node@v4
65+
with:
66+
node-version: '20.18.1'
67+
68+
- name: Setup Bun
69+
uses: oven-sh/setup-bun@v1
70+
with:
71+
bun-version: latest
72+
73+
- name: Install
74+
run: bun install
75+
76+
- name: Set package.json version (dev)
77+
run: |
78+
node - <<'NODE'
79+
const fs = require('node:fs')
80+
const pkg = JSON.parse(fs.readFileSync('package.json', 'utf8'))
81+
pkg.version = process.env.DEV_VERSION
82+
fs.writeFileSync('package.json', JSON.stringify(pkg, null, 2) + '\n')
83+
NODE
84+
env:
85+
DEV_VERSION: ${{ needs.compute-version.outputs.dev_version }}
86+
87+
- name: Build binary
88+
run: bun build src/entrypoints/index.ts --compile --target=${{ matrix.target }} --format=esm --outfile=${{ matrix.asset }}
89+
90+
- name: Make binary executable
91+
if: runner.os != 'Windows'
92+
run: chmod +x ${{ matrix.asset }}
93+
94+
- name: Upload binary artifact
95+
uses: actions/upload-artifact@v4
96+
with:
97+
name: ${{ matrix.asset }}
98+
path: ${{ matrix.asset }}
99+
if-no-files-found: error
100+
101+
publish-npm:
102+
needs: compute-version
103+
runs-on: ubuntu-latest
104+
env:
105+
KODE_SKIP_BINARY_DOWNLOAD: "1"
106+
steps:
107+
- name: Checkout
108+
uses: actions/checkout@v4
109+
110+
- name: Setup Node.js
111+
uses: actions/setup-node@v4
112+
with:
113+
node-version: '20.18.1'
114+
registry-url: 'https://registry.npmjs.org'
115+
116+
- name: Setup Bun
117+
uses: oven-sh/setup-bun@v1
118+
with:
119+
bun-version: latest
120+
121+
- name: Install
122+
run: bun install
123+
124+
- name: Set package.json version (dev)
125+
run: |
126+
node - <<'NODE'
127+
const fs = require('node:fs')
128+
const pkg = JSON.parse(fs.readFileSync('package.json', 'utf8'))
129+
pkg.version = process.env.DEV_VERSION
130+
fs.writeFileSync('package.json', JSON.stringify(pkg, null, 2) + '\n')
131+
NODE
132+
env:
133+
DEV_VERSION: ${{ needs.compute-version.outputs.dev_version }}
134+
135+
- name: Typecheck
136+
run: bun run typecheck
137+
138+
- name: Test
139+
run: bun test
140+
141+
- name: Build (npm)
142+
run: bun run build:npm
143+
144+
- name: Prepublish check
145+
run: bun run scripts/prepublish-check.js
146+
147+
- name: Publish npm (dist-tag: dev)
148+
run: npm publish --tag dev --access public --ignore-scripts
149+
env:
150+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
151+
152+
prerelease:
153+
needs: [compute-version, build-binaries, publish-npm]
154+
runs-on: ubuntu-latest
155+
permissions:
156+
contents: write
157+
steps:
158+
- name: Download binary artifacts
159+
uses: actions/download-artifact@v4
160+
with:
161+
path: artifacts
162+
163+
- name: Create checksums
164+
run: |
165+
find artifacts -type f -maxdepth 2 -print0 | sort -z | xargs -0 shasum -a 256 > checksums-sha256.txt
166+
echo "Checksums:"
167+
head -n 20 checksums-sha256.txt
168+
169+
- name: Create GitHub prerelease
170+
uses: softprops/action-gh-release@v2
171+
with:
172+
tag_name: ${{ needs.compute-version.outputs.tag_name }}
173+
name: ${{ needs.compute-version.outputs.tag_name }}
174+
prerelease: true
175+
files: |
176+
artifacts/**/*
177+
checksums-sha256.txt

0 commit comments

Comments
 (0)