Skip to content

Commit 4023f53

Browse files
committed
Resolve merge conflicts with upstream main
2 parents 12b440f + 5c8b5ce commit 4023f53

455 files changed

Lines changed: 55998 additions & 11277 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.

.agents/claude-code-cli.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const baseDefinition = createCliAgent({
1010
startCommand: 'claude --dangerously-skip-permissions',
1111
permissionNote:
1212
'Always use `--dangerously-skip-permissions` when testing to avoid permission prompts that would block automated tests.',
13-
model: 'anthropic/claude-opus-4.6',
13+
model: 'anthropic/claude-opus-4.7',
1414
})
1515

1616
// Constants must be inside handleSteps since it gets serialized via .toString()

.agents/codebuff-local-cli.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const baseDefinition = createCliAgent({
1010
startCommand: 'bun --cwd=cli run dev',
1111
permissionNote:
1212
'No permission flags needed for Codebuff local dev server.',
13-
model: 'anthropic/claude-opus-4.6',
13+
model: 'anthropic/claude-opus-4.7',
1414
skipPrepPhase: true,
1515
cliSpecificDocs: `## Codebuff CLI Specific Guidance
1616

.agents/codex-cli.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ const baseDefinition = createCliAgent({
8181
startCommand: 'codex -a never -s danger-full-access',
8282
permissionNote:
8383
'Always use `-a never -s danger-full-access` when testing to avoid approval prompts that would block automated tests.',
84-
model: 'anthropic/claude-opus-4.6',
84+
model: 'anthropic/claude-opus-4.7',
8585
extraInputParams: {
8686
reviewType: {
8787
type: 'string',

.agents/gemini-cli.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const baseDefinition = createCliAgent({
1010
startCommand: 'gemini --yolo',
1111
permissionNote:
1212
'Always use `--yolo` (or `--approval-mode yolo`) when testing to auto-approve all tool actions and avoid prompts that would block automated tests.',
13-
model: 'anthropic/claude-opus-4.6',
13+
model: 'anthropic/claude-opus-4.7',
1414
cliSpecificDocs: `## Gemini CLI Commands
1515
1616
Gemini CLI uses slash commands for navigation:

.agents/types/agent-definition.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,9 @@ export type ModelName =
380380

381381
// Anthropic
382382
| 'anthropic/claude-sonnet-4.6'
383+
| 'anthropic/claude-opus-4.7'
383384
| 'anthropic/claude-opus-4.6'
385+
| 'anthropic/claude-opus-4.5'
384386
| 'anthropic/claude-haiku-4.5'
385387
| 'anthropic/claude-sonnet-4.5'
386388
| 'anthropic/claude-opus-4.1'
@@ -427,8 +429,7 @@ export type ModelName =
427429
// Other open source models
428430
| 'moonshotai/kimi-k2'
429431
| 'moonshotai/kimi-k2:nitro'
430-
| 'moonshotai/kimi-k2.5'
431-
| 'moonshotai/kimi-k2.5:nitro'
432+
| 'moonshotai/kimi-k2.6'
432433
| 'z-ai/glm-5'
433434
| 'z-ai/glm-4.6'
434435
| 'z-ai/glm-4.6:nitro'
@@ -437,6 +438,7 @@ export type ModelName =
437438
| 'z-ai/glm-4.7-flash'
438439
| 'z-ai/glm-4.7-flash:nitro'
439440
| 'minimax/minimax-m2.5'
441+
| 'minimax/minimax-m2.7'
440442
| (string & {})
441443

442444
import type { ToolName, GetToolParams } from './tools'

.agents/types/tools.ts

Lines changed: 27 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ export type ToolName =
1616
| 'read_docs'
1717
| 'read_files'
1818
| 'read_subtree'
19+
| 'render_ui'
1920
| 'run_file_change_hooks'
2021
| 'run_terminal_command'
2122
| 'set_messages'
@@ -47,6 +48,7 @@ export interface ToolParamsMap {
4748
read_docs: ReadDocsParams
4849
read_files: ReadFilesParams
4950
read_subtree: ReadSubtreeParams
51+
render_ui: RenderUiParams
5052
run_file_change_hooks: RunFileChangeHooksParams
5153
run_terminal_command: RunTerminalCommandParams
5254
set_messages: SetMessagesParams
@@ -179,10 +181,10 @@ export interface ProposeStrReplaceParams {
179181
/** Array of replacements to make. */
180182
replacements: {
181183
/** The string to replace. This must be an *exact match* of the string you want to replace, including whitespace and punctuation. */
182-
old: string
183-
/** The string to replace the corresponding old string with. Can be empty to delete. */
184-
new: string
185-
/** Whether to allow multiple replacements of old string. */
184+
oldString: string
185+
/** The string to replace the corresponding oldString with. Can be empty to delete. */
186+
newString: string
187+
/** Whether to allow multiple replacements of oldString. */
186188
allowMultiple?: boolean
187189
}[]
188190
}
@@ -229,6 +231,23 @@ export interface ReadSubtreeParams {
229231
maxTokens?: number
230232
}
231233

234+
/**
235+
* Render a small interactive UI widget in the Codebuff CLI. Currently supports a button that opens a link.
236+
*/
237+
export interface RenderUiParams {
238+
/** The UI widget to render. */
239+
widget: {
240+
/** Widget type. Currently, the only supported widget is button. */
241+
type: 'button'
242+
/** Short button label shown to the user. */
243+
text: string
244+
/** The http:// or https:// URL to open when the user clicks the button. */
245+
link: string
246+
/** Theme-aware color treatment. Use primary for the main action and secondary for lower-emphasis actions. */
247+
variant?: 'primary' | 'secondary'
248+
}
249+
}
250+
232251
/**
233252
* Parameters for run_file_change_hooks tool
234253
*/
@@ -286,10 +305,10 @@ export interface StrReplaceParams {
286305
/** Array of replacements to make. */
287306
replacements: {
288307
/** The string to replace. This must be an *exact match* of the string you want to replace, including whitespace and punctuation. */
289-
old: string
290-
/** The string to replace the corresponding old string with. Can be empty to delete. */
291-
new: string
292-
/** Whether to allow multiple replacements of old string. */
308+
oldString: string
309+
/** The string to replace the corresponding oldString with. Can be empty to delete. */
310+
newString: string
311+
/** Whether to allow multiple replacements of oldString. */
293312
allowMultiple?: boolean
294313
}[]
295314
}

.claude/settings.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"permissions": {
3+
"defaultMode": "auto"
4+
}
5+
}

.github/workflows/bot-sweep.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Freebuff Bot Sweep
2+
3+
# Hourly dry-run sweep over active freebuff sessions. Calls the
4+
# /api/admin/bot-sweep endpoint, which emails james@codebuff.com with a
5+
# ranked list of suspects. No bans are issued — review and run
6+
# scripts/ban-freebuff-bots.ts manually.
7+
8+
on:
9+
schedule:
10+
- cron: '0 * * * *'
11+
workflow_dispatch:
12+
13+
jobs:
14+
sweep:
15+
runs-on: ubuntu-latest
16+
timeout-minutes: 5
17+
steps:
18+
- name: Trigger bot-sweep
19+
env:
20+
BOT_SWEEP_SECRET: ${{ secrets.BOT_SWEEP_SECRET }}
21+
BOT_SWEEP_URL: ${{ vars.BOT_SWEEP_URL || 'https://www.codebuff.com/api/admin/bot-sweep' }}
22+
run: |
23+
set -euo pipefail
24+
if [ -z "$BOT_SWEEP_SECRET" ]; then
25+
echo "BOT_SWEEP_SECRET is not set — skipping."
26+
exit 0
27+
fi
28+
status=$(curl -sS -o /tmp/resp.json -w '%{http_code}' \
29+
-X POST "$BOT_SWEEP_URL" \
30+
-H "Authorization: Bearer $BOT_SWEEP_SECRET" \
31+
-H "Content-Type: application/json" \
32+
--max-time 120)
33+
echo "HTTP $status"
34+
cat /tmp/resp.json
35+
echo
36+
if [ "$status" != "200" ]; then
37+
exit 1
38+
fi

.github/workflows/cli-release-build.yml

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -176,19 +176,31 @@ jobs:
176176
run: |
177177
cd cli/bin
178178
if [[ "${{ runner.os }}" == "Windows" ]]; then
179-
./${{ inputs.binary-name }}.exe --version
179+
BIN="./${{ inputs.binary-name }}.exe"
180180
else
181-
./${{ inputs.binary-name }} --version
181+
BIN="./${{ inputs.binary-name }}"
182182
fi
183183
184+
# Fast path: --version exits synchronously through commander, so it
185+
# only catches early sync failures. Run it for parity with old CI.
186+
"$BIN" --version
187+
188+
# Slow path: keep the binary alive long enough for *async* startup
189+
# failures (e.g. the Parser.init rejection that crashed the
190+
# post-OpenTUI-upgrade Windows build) to surface in stdout/stderr.
191+
bun ../scripts/smoke-binary.ts "$BIN"
192+
184193
- name: Create tarball
185194
shell: bash
186195
run: |
187196
BINARY_FILE="${{ inputs.binary-name }}"
188197
if [[ "${{ runner.os }}" == "Windows" ]]; then
189198
BINARY_FILE="${{ inputs.binary-name }}.exe"
190199
fi
191-
tar -czf ${{ inputs.binary-name }}-${{ matrix.target }}.tar.gz -C cli/bin "$BINARY_FILE"
200+
# Bundle the binary alongside tree-sitter.wasm — the CLI loads
201+
# the wasm as a sibling file at runtime since bun --compile
202+
# asset embedding wasn't reliable on Windows.
203+
tar -czf ${{ inputs.binary-name }}-${{ matrix.target }}.tar.gz -C cli/bin "$BINARY_FILE" tree-sitter.wasm
192204
193205
- name: Upload binary artifact
194206
uses: actions/upload-artifact@v7
@@ -317,13 +329,23 @@ jobs:
317329
shell: bash
318330
run: |
319331
cd cli/bin
320-
./${{ inputs.binary-name }}.exe --version
332+
BIN="./${{ inputs.binary-name }}.exe"
333+
334+
# Sync check — exits via commander before async tasks fire.
335+
"$BIN" --version
336+
337+
# Long-running check — gives async startup failures time to surface.
338+
# This is the step that would have caught the post-OpenTUI-upgrade
339+
# tree-sitter wasm crash on Windows.
340+
bun ../scripts/smoke-binary.ts "$BIN"
321341
322342
- name: Create tarball
323343
shell: bash
324344
run: |
325345
BINARY_FILE="${{ inputs.binary-name }}.exe"
326-
tar -czf ${{ inputs.binary-name }}-win32-x64.tar.gz -C cli/bin "$BINARY_FILE"
346+
# Bundle tree-sitter.wasm next to the binary; see the
347+
# equivalent matrix-job tar step for context.
348+
tar -czf ${{ inputs.binary-name }}-win32-x64.tar.gz -C cli/bin "$BINARY_FILE" tree-sitter.wasm
327349
328350
- name: Upload binary artifact
329351
uses: actions/upload-artifact@v7

.github/workflows/cli-release-prod.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ on:
1212
- patch
1313
- minor
1414
- major
15+
checkout_ref:
16+
description: 'Git ref to build from (commit SHA, branch, or tag). Defaults to latest main.'
17+
required: false
18+
default: ''
19+
type: string
1520

1621
concurrency:
1722
group: cli-prod-release
@@ -80,7 +85,7 @@ jobs:
8085
binary-name: codebuff
8186
new-version: ${{ needs.prepare-and-commit-prod.outputs.new_version }}
8287
artifact-name: updated-package
83-
checkout-ref: ${{ github.sha }}
88+
checkout-ref: ${{ inputs.checkout_ref || github.sha }}
8489
env-overrides: '{"NEXT_PUBLIC_CB_ENVIRONMENT": "prod"}'
8590
secrets: inherit
8691

0 commit comments

Comments
 (0)