Skip to content

Commit 20d02f9

Browse files
committed
Merge branch 'main' into copilot/fix-8
2 parents 4c9d7b4 + c7074b1 commit 20d02f9

149 files changed

Lines changed: 15525 additions & 1915 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.

.claude/CLAUDE.md

Lines changed: 409 additions & 0 deletions
Large diffs are not rendered by default.

.claude/settings.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"statusLine": {
3+
"type": "command",
4+
"command": "bash /mnt/e/tpen3-interfaces/.claude/statusline-command.sh"
5+
},
6+
"env": {
7+
"CLAUDE_CODE_MAX_OUTPUT_TOKENS": "500000",
8+
"CLAUDE_CODE_DISABLE_TERMINAL_TITLE": "1",
9+
"MAX_MCP_OUTPUT_TOKENS": "500000",
10+
"DISABLE_ERROR_REPORTING": "0",
11+
"DISABLE_NON_ESSENTIAL_MODEL_CALLS": "0",
12+
"DISABLE_PROMPT_CACHING": "0",
13+
"MAX_THINKING_TOKENS": "500000",
14+
"BASH_MAX_TIMEOUT_MS": "3000000",
15+
"OPENCODE_DISABLE_PRUNE": "true",
16+
"OPENCODE_DISABLE_AUTOCOMPACT": "true"
17+
}
18+
}

.claude/statusline-command.sh

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
#!/bin/bash
2+
3+
# Read JSON input
4+
input=$(cat)
5+
6+
# Extract data from JSON
7+
cwd=$(echo "$input" | jq -r '.workspace.current_dir')
8+
cost=$(echo "$input" | jq -r '.cost.total_cost_usd // 0')
9+
api_duration=$(echo "$input" | jq -r '.cost.total_api_duration_ms // 0')
10+
total_duration=$(echo "$input" | jq -r '.cost.total_duration_ms // 0')
11+
lines_added=$(echo "$input" | jq -r '.cost.total_lines_added // 0')
12+
lines_removed=$(echo "$input" | jq -r '.cost.total_lines_removed // 0')
13+
model_display=$(echo "$input" | jq -r '.model.display_name // "unknown"')
14+
15+
# Calculate API duration in seconds
16+
api_duration_sec=$(echo "scale=1; $api_duration / 1000" | bc -l 2>/dev/null || echo "0")
17+
18+
# Get git branch if in a git repository
19+
git_branch=""
20+
if git -C "$cwd" rev-parse --git-dir > /dev/null 2>&1; then
21+
branch=$(git -C "$cwd" -c core.fileMode=false branch --show-current 2>/dev/null)
22+
if [ -n "$branch" ]; then
23+
git_branch="($branch)"
24+
fi
25+
fi
26+
27+
# Build the enhanced status line
28+
# Format: (branch) model $cost | API: Xs | +L/-L
29+
30+
# Cyan for git branch
31+
if [ -n "$git_branch" ]; then
32+
printf '\033[36m%s\033[0m ' "$git_branch"
33+
fi
34+
35+
# Magenta for model name
36+
printf '\033[35m%s\033[0m ' "$model_display"
37+
38+
# Bold yellow for cost (live updating token usage proxy)
39+
printf '\033[1;33m$%.4f\033[0m' "$cost"
40+
41+
# Green for API time (shows compute usage)
42+
if [ "$api_duration" != "0" ]; then
43+
printf ' \033[32m| API: %ss\033[0m' "$api_duration_sec"
44+
fi
45+
46+
# White for code changes (productivity)
47+
if [ "$lines_added" != "0" ] || [ "$lines_removed" != "0" ]; then
48+
printf ' \033[37m| +%s/-%s\033[0m' "$lines_added" "$lines_removed"
49+
fi
50+
51+
printf '\n'

.github/workflows/claude.yaml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Claude Code
2+
on:
3+
issues:
4+
types: [opened]
5+
issue_comment:
6+
types: [created]
7+
pull_request_review:
8+
types: [submitted]
9+
pull_request_review_comment:
10+
types: [created]
11+
12+
jobs:
13+
claude:
14+
if: |
15+
(github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude')) ||
16+
(github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) ||
17+
(github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude')) ||
18+
(github.event_name == 'issues' && (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude')))
19+
runs-on: ubuntu-latest
20+
permissions:
21+
contents: write
22+
pull-requests: write
23+
issues: write
24+
id-token: write
25+
actions: read
26+
steps:
27+
- name: Checkout repository
28+
uses: actions/checkout@v5
29+
with:
30+
fetch-depth: 0
31+
32+
- name: Run Claude Code
33+
id: claude
34+
uses: anthropics/claude-code-action@v1
35+
with:
36+
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
37+
show_full_output: true
38+
# trigger_phrase: "claude do the needful"

.github/workflows/dev-preview.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Dev Preview Build (PR)
2+
3+
on:
4+
pull_request:
5+
branches: [ main ]
6+
7+
permissions:
8+
contents: read
9+
pull-requests: write
10+
11+
concurrency:
12+
group: pages-dev-preview-${{ github.event.pull_request.number }}
13+
cancel-in-progress: true
14+
15+
jobs:
16+
build-and-deploy:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v4
21+
22+
- name: Set TPEN_ENV=dev
23+
run: echo "TPEN_ENV=dev" >> $GITHUB_ENV
24+
25+
- name: Generate runtime env file (dev)
26+
run: echo "window.TPEN_ENV='dev'" > config.env.js
27+
28+
- name: Setup Ruby
29+
uses: ruby/setup-ruby@v1
30+
with:
31+
ruby-version: '3.1'
32+
33+
- name: Install Jekyll and dependencies
34+
run: |
35+
gem install bundler jekyll
36+
gem install jekyll-theme-modernist
37+
gem install jekyll-redirect-from
38+
39+
- name: Build with Jekyll
40+
env:
41+
TPEN_ENV: dev
42+
run: jekyll build --source ./ --destination ./_site
43+
44+
- name: Deploy to Netlify
45+
uses: nwtgck/actions-netlify@v3.0
46+
with:
47+
publish-dir: './_site'
48+
production-deploy: false
49+
github-token: ${{ secrets.GITHUB_TOKEN }}
50+
deploy-message: "Deploy from PR #${{ github.event.pull_request.number }}"
51+
enable-pull-request-comment: true
52+
enable-commit-comment: false
53+
overwrites-pull-request-comment: true
54+
github-deployment-environment: ''
55+
github-deployment-description: ''
56+
env:
57+
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
58+
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
59+
timeout-minutes: 5

.github/workflows/prod-deploy.yml

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
name: Production Deploy (main)
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
7+
permissions:
8+
contents: read
9+
pages: write
10+
id-token: write
11+
12+
concurrency:
13+
group: pages-prod
14+
cancel-in-progress: false
15+
16+
env:
17+
SERVICES_URL: https://api.t-pen.org
18+
RERUM_URL: https://store.rerum.io/v1
19+
20+
jobs:
21+
smoke:
22+
runs-on: ubuntu-latest
23+
steps:
24+
- name: Checkout
25+
uses: actions/checkout@v4
26+
27+
- name: Set TPEN_ENV=prod
28+
run: echo "TPEN_ENV=prod" >> $GITHUB_ENV
29+
30+
- name: Generate runtime env file (prod)
31+
run: echo "window.TPEN_ENV='prod'" > config.env.js
32+
33+
- name: Install curl and jq
34+
run: sudo apt-get update && sudo apt-get install -y curl jq
35+
36+
- name: Smoke test TPEN services API health
37+
run: |
38+
set -e
39+
echo "Testing $SERVICES_URL API availability"
40+
# Simple HEAD check to verify API is responding
41+
curl -fsI --retry 3 --retry-delay 2 "$SERVICES_URL" >/dev/null || {
42+
echo "API health check failed - $SERVICES_URL not responding"
43+
exit 1
44+
}
45+
echo "✓ TPEN services API is reachable"
46+
47+
- name: Smoke test RERUM store reachability
48+
run: |
49+
set -e
50+
echo "HEAD $RERUM_URL"
51+
curl -fsI --retry 3 --retry-delay 2 "$RERUM_URL" >/dev/null
52+
53+
build:
54+
needs: smoke
55+
runs-on: ubuntu-latest
56+
env:
57+
TPEN_ENV: prod
58+
steps:
59+
- name: Checkout
60+
uses: actions/checkout@v4
61+
62+
- name: Ensure TPEN_ENV=prod
63+
run: echo "TPEN_ENV=prod" >> $GITHUB_ENV
64+
65+
- name: Setup Pages
66+
uses: actions/configure-pages@v5
67+
68+
- name: Build with Jekyll
69+
uses: actions/jekyll-build-pages@v1
70+
with:
71+
source: ./
72+
destination: ./_site
73+
74+
- name: Upload artifact
75+
uses: actions/upload-pages-artifact@v3
76+
with:
77+
path: _site
78+
79+
deploy:
80+
needs: build
81+
runs-on: ubuntu-latest
82+
environment:
83+
name: github-pages
84+
url: ${{ steps.deployment.outputs.page_url }}
85+
steps:
86+
- name: Deploy to GitHub Pages (Production)
87+
id: deployment
88+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)