Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 25 additions & 25 deletions packages/opencode/src/cli/cmd/github.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,9 @@ type IssueQueryResponse = {
}
}

const AGENT_USERNAME = "opencode-agent[bot]"
const AGENT_USERNAME = "altimate-code-agent[bot]"
const AGENT_REACTION = "eyes"
const WORKFLOW_FILE = ".github/workflows/opencode.yml"
const WORKFLOW_FILE = ".github/workflows/altimate-code.yml"

// Event categories for routing
// USER_EVENTS: triggered by user actions, have actor/issueId, support reactions/comments
Expand Down Expand Up @@ -242,7 +242,7 @@ export const GithubInstallCommand = cmd({
"",
" 3. Go to a GitHub issue and comment `/oc summarize` to see the agent in action",
"",
" Learn more about the GitHub agent - https://opencode.ai/docs/github/#usage-examples",
" Learn more about the GitHub agent - https://altimate-code.dev/docs/github/#usage-examples",
].join("\n"),
)
}
Expand All @@ -266,7 +266,7 @@ export const GithubInstallCommand = cmd({

async function promptProvider() {
const priority: Record<string, number> = {
opencode: 0,
"altimate-code": 0,
anthropic: 1,
openai: 2,
google: 3,
Expand Down Expand Up @@ -324,7 +324,7 @@ export const GithubInstallCommand = cmd({
if (installation) return s.stop("GitHub app already installed")

// Open browser
const url = "https://github.com/apps/opencode-agent"
const url = "https://github.com/apps/altimate-code-agent"
const command =
process.platform === "darwin"
? `open "${url}"`
Expand Down Expand Up @@ -361,7 +361,7 @@ export const GithubInstallCommand = cmd({

async function getInstallation() {
return await fetch(
`https://api.opencode.ai/get_github_app_installation?owner=${app.owner}&repo=${app.repo}`,
`https://api.altimate-code.dev/get_github_app_installation?owner=${app.owner}&repo=${app.repo}`,
)
.then((res) => res.json())
.then((data) => data.installation)
Expand All @@ -376,7 +376,7 @@ export const GithubInstallCommand = cmd({

await Filesystem.write(
path.join(app.root, WORKFLOW_FILE),
`name: opencode
`name: altimate-code

on:
issue_comment:
Expand All @@ -385,12 +385,12 @@ on:
types: [created]

jobs:
opencode:
altimate-code:
if: |
contains(github.event.comment.body, ' /oc') ||
startsWith(github.event.comment.body, '/oc') ||
contains(github.event.comment.body, ' /opencode') ||
startsWith(github.event.comment.body, '/opencode')
contains(github.event.comment.body, ' /altimate-code') ||
startsWith(github.event.comment.body, '/altimate-code')
runs-on: ubuntu-latest
permissions:
id-token: write
Expand All @@ -403,8 +403,8 @@ jobs:
with:
persist-credentials: false

- name: Run opencode
uses: anomalyco/opencode/github@latest${envStr}
- name: Run altimate-code
uses: altimate/altimate-code/github@latest${envStr}
with:
model: ${provider}/${model}`,
)
Expand Down Expand Up @@ -474,7 +474,7 @@ export const GithubRunCommand = cmd({
? (payload as IssueCommentEvent | IssuesEvent).issue.number
: (payload as PullRequestEvent | PullRequestReviewCommentEvent).pull_request.number
const runUrl = `/${owner}/${repo}/actions/runs/${runId}`
const shareBaseUrl = isMock ? "https://dev.opencode.ai" : "https://opencode.ai"
const shareBaseUrl = isMock ? "https://dev.altimate-code.dev" : "https://altimate-code.dev"

let appToken: string
let octoRest: Octokit
Expand Down Expand Up @@ -522,7 +522,7 @@ export const GithubRunCommand = cmd({
await addReaction(commentType)
}

// Setup opencode session
// Setup altimate-code session
const repoData = await fetchRepo()
session = await Session.create({
permission: [
Expand All @@ -540,7 +540,7 @@ export const GithubRunCommand = cmd({
await Session.share(session.id)
return session.id.slice(-8)
})()
console.log("opencode session", session.id)
console.log("altimate-code session", session.id)

// Handle event types:
// REPO_EVENTS (schedule, workflow_dispatch): no issue/PR context, output to logs/PR only
Expand Down Expand Up @@ -713,7 +713,7 @@ export const GithubRunCommand = cmd({

function normalizeOidcBaseUrl(): string {
const value = process.env["OIDC_BASE_URL"]
if (!value) return "https://api.opencode.ai"
if (!value) return "https://api.altimate-code.dev"
return value.replace(/\/+$/, "")
}

Expand Down Expand Up @@ -762,7 +762,7 @@ export const GithubRunCommand = cmd({
}

const reviewContext = getReviewCommentContext()
const mentions = (process.env["MENTIONS"] || "/opencode,/oc")
const mentions = (process.env["MENTIONS"] || "/altimate-code,/oc")
.split(",")
.map((m) => m.trim().toLowerCase())
.filter(Boolean)
Expand Down Expand Up @@ -909,7 +909,7 @@ export const GithubRunCommand = cmd({
}

async function chat(message: string, files: PromptFiles = []) {
console.log("Sending message to opencode...")
console.log("Sending message to altimate-code...")

const result = await SessionPrompt.prompt({
sessionID: session.id,
Expand Down Expand Up @@ -1005,7 +1005,7 @@ export const GithubRunCommand = cmd({

async function getOidcToken() {
try {
return await core.getIDToken("opencode-github-action")
return await core.getIDToken("altimate-code-github-action")
} catch (error) {
console.error("Failed to get OIDC token:", error instanceof Error ? error.message : error)
throw new Error(
Expand Down Expand Up @@ -1107,9 +1107,9 @@ export const GithubRunCommand = cmd({
.join("")
if (type === "schedule" || type === "dispatch") {
const hex = crypto.randomUUID().slice(0, 6)
return `opencode/${type}-${hex}-${timestamp}`
return `altimate-code/${type}-${hex}-${timestamp}`
}
return `opencode/${type}${issueId}-${timestamp}`
return `altimate-code/${type}${issueId}-${timestamp}`
}

async function pushToNewBranch(summary: string, branch: string, commit: boolean, isSchedule: boolean) {
Expand Down Expand Up @@ -1388,9 +1388,9 @@ Co-authored-by: ${actor} <${actor}@users.noreply.github.com>"`
const titleAlt = encodeURIComponent(session.title.substring(0, 50))
const title64 = Buffer.from(session.title.substring(0, 700), "utf8").toString("base64")

return `<a href="${shareBaseUrl}/s/${shareId}"><img width="200" alt="${titleAlt}" src="https://social-cards.sst.dev/opencode-share/${title64}.png?model=${providerID}/${modelID}&version=${session.version}&id=${shareId}" /></a>\n`
return `<a href="${shareBaseUrl}/s/${shareId}"><img width="200" alt="${titleAlt}" src="https://social-cards.sst.dev/altimate-code-share/${title64}.png?model=${providerID}/${modelID}&version=${session.version}&id=${shareId}" /></a>\n`
})()
const shareUrl = shareId ? `[opencode session](${shareBaseUrl}/s/${shareId})&nbsp;&nbsp;|&nbsp;&nbsp;` : ""
const shareUrl = shareId ? `[altimate-code session](${shareBaseUrl}/s/${shareId})&nbsp;&nbsp;|&nbsp;&nbsp;` : ""
return `\n\n${image}${shareUrl}[github run](${runUrl})`
}

Expand Down Expand Up @@ -1451,7 +1451,7 @@ query($owner: String!, $repo: String!, $number: Int!) {
return [
"<github_action_context>",
"You are running as a GitHub Action. Important:",
"- Git push and PR creation are handled AUTOMATICALLY by the opencode infrastructure after your response",
"- Git push and PR creation are handled AUTOMATICALLY by the altimate-code infrastructure after your response",
"- Do NOT include warnings or disclaimers about GitHub tokens, workflow permissions, or PR creation capabilities",
"- Do NOT suggest manual steps for creating PRs or pushing code - this happens automatically",
"- Focus only on the code changes and your analysis/response",
Expand Down Expand Up @@ -1589,7 +1589,7 @@ query($owner: String!, $repo: String!, $number: Int!) {
return [
"<github_action_context>",
"You are running as a GitHub Action. Important:",
"- Git push and PR creation are handled AUTOMATICALLY by the opencode infrastructure after your response",
"- Git push and PR creation are handled AUTOMATICALLY by the altimate-code infrastructure after your response",
"- Do NOT include warnings or disclaimers about GitHub tokens, workflow permissions, or PR creation capabilities",
"- Do NOT suggest manual steps for creating PRs or pushing code - this happens automatically",
"- Focus only on the code changes and your analysis/response",
Expand Down
14 changes: 10 additions & 4 deletions packages/opencode/src/cli/cmd/tui/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ import { TuiEvent } from "./event"
import { KVProvider, useKV } from "./context/kv"
import { Provider } from "@/provider/provider"
import { ArgsProvider, useArgs, type Args } from "./context/args"
import { TuiConfigProvider } from "@tui/context/tui-config"
import type { TuiConfig } from "@/config/tui"
import open from "open"
import { writeHeapSnapshot } from "v8"
import { PromptRefProvider, usePromptRef } from "./context/prompt"
Expand Down Expand Up @@ -108,6 +110,7 @@ export function tui(input: {
fetch?: typeof fetch
headers?: RequestInit["headers"]
events?: EventSource
tuiConfig?: TuiConfig.Info
onExit?: () => Promise<void>
}) {
// promise to prevent immediate exit
Expand All @@ -116,6 +119,7 @@ export function tui(input: {
win32DisableProcessedInput()

const mode = await getTerminalBackgroundColor()
const tuiConfig = input.tuiConfig ?? {}

// Re-clear after getTerminalBackgroundColor() — setRawMode(false) restores
// the original console mode which re-enables ENABLE_PROCESSED_INPUT.
Expand Down Expand Up @@ -146,9 +150,10 @@ export function tui(input: {
events={input.events}
>
<SyncProvider>
<ThemeProvider mode={mode}>
<LocalProvider>
<KeybindProvider>
<TuiConfigProvider config={tuiConfig}>
<ThemeProvider mode={mode}>
<LocalProvider>
<KeybindProvider>
<PromptStashProvider>
<DialogProvider>
<CommandProvider>
Expand All @@ -164,7 +169,8 @@ export function tui(input: {
</PromptStashProvider>
</KeybindProvider>
</LocalProvider>
</ThemeProvider>
</ThemeProvider>
</TuiConfigProvider>
</SyncProvider>
</SDKProvider>
</RouteProvider>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export function DialogStatus() {
<Match when={item.status === "failed" && item}>{(val) => val().error}</Match>
<Match when={item.status === "disabled"}>Disabled in configuration</Match>
<Match when={(item.status as string) === "needs_auth"}>
Needs authentication (run: opencode mcp auth {key})
Needs authentication (run: altimate mcp auth {key})
</Match>
<Match when={(item.status as string) === "needs_client_registration" && item}>
{(val) => (val() as { error: string }).error}
Expand Down
4 changes: 2 additions & 2 deletions packages/opencode/src/cli/cmd/tui/component/logo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ export function Logo() {
<For each={logo.left}>
{(line, index) => (
<box flexDirection="row" gap={1}>
<box flexDirection="row">{renderLine(line, theme.textMuted, false)}</box>
<box flexDirection="row">{renderLine(logo.right[index()], theme.text, true)}</box>
<box flexDirection="row">{renderLine(line, theme.primary, false)}</box>
<box flexDirection="row">{renderLine(logo.right[index()], theme.accent, true)}</box>
</box>
)}
</For>
Expand Down
Loading
Loading