Skip to content
Closed
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
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,7 @@ playground
tmp
dist
.turbo
opencode-lsp-test/
.serena/

.serena/
Comment on lines +13 to +16
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Remove duplicate .serena/ entry.

The .serena/ directory is listed twice (lines 14 and 16). Remove one of the duplicate entries to keep the .gitignore file clean.

Apply this diff to remove the duplicate:

 opencode-lsp-test/
 .serena/
-
-.serena/
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
opencode-lsp-test/
.serena/
.serena/
opencode-lsp-test/
.serena/
🤖 Prompt for AI Agents
In .gitignore around lines 13 to 16, there is a duplicate entry for ".serena/"
(appears on lines 14 and 16); remove the redundant second ".serena/" line so the
directory is only listed once, leaving a single ".serena/" entry and preserving
other entries and spacing.

2 changes: 1 addition & 1 deletion .husky/pre-push
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#!/bin/sh
bun run typecheck
bun typecheck
929 changes: 720 additions & 209 deletions bun.lock

Large diffs are not rendered by default.

166 changes: 166 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,166 @@
import tseslint from '@typescript-eslint/eslint-plugin';
import tsParser from '@typescript-eslint/parser';
import functional from 'eslint-plugin-functional';
import importPlugin from 'eslint-plugin-import';
import promise from 'eslint-plugin-promise';
import sonarjs from 'eslint-plugin-sonarjs';
import ava from 'eslint-plugin-ava';
Comment on lines +1 to +7

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Declare required ESLint plugins

The new ESLint config imports eslint-plugin-functional, eslint-plugin-import, eslint-plugin-promise, eslint-plugin-sonarjs, and eslint-plugin-ava, but none of these packages are listed in any workspace package.json. Running ESLint will fail with “Cannot find module …” before any linting occurs. Add these plugins (and ESLint itself if needed) to the repo’s devDependencies so the configuration can load.

Useful? React with 👍 / 👎.


export default [
{
ignores: [
'**/dist/**',
'**/.cache/**',
'./scripts/**',
'./templates/**',
'./eslint.config.ts',
'**/pseudo/**',
'packages/smartgpt-bridge/src/fixtures',
],
},
{
files: ['**/*.{ts,tsx}'],
languageOptions: {
parser: tsParser,
parserOptions: {
projectService: true, // uses your tsconfig.* automatically
allowDefaultProject: true,
ecmaVersion: 'latest',
sourceType: 'module',
},
},
plugins: {
'@typescript-eslint': tseslint,
functional,
import: importPlugin,
sonarjs,
promise,
ava,
},
rules: {
'sonarjs/cognitive-complexity': ['error', 15],
'sonarjs/no-collapsible-if': 'warn',
'sonarjs/no-inverted-boolean-check': 'warn',
'max-lines': ['error', { max: 300, skipBlankLines: true, skipComments: true }],
'max-lines-per-function': ['error', { max: 50, IIFEs: true }],
'max-params': ['error', 4],
complexity: ['error', 15],
Comment on lines +44 to +47
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

Verify that complexity and size limits align with existing codebase.

The configuration enforces strict limits:

  • Max 300 lines per file
  • Max 50 lines per function
  • Max 4 parameters
  • Cyclomatic complexity ≤ 15
  • Cognitive complexity ≤ 15

These are quite strict and may require significant refactoring of existing code.

Before enforcing these limits, verify the current state of the codebase:

Consider starting with warnings instead of errors to assess the impact:

-      'max-lines': ['error', { max: 300, skipBlankLines: true, skipComments: true }],
-      'max-lines-per-function': ['error', { max: 50, IIFEs: true }],
+      'max-lines': ['warn', { max: 300, skipBlankLines: true, skipComments: true }],
+      'max-lines-per-function': ['warn', { max: 50, IIFEs: true }],

🏁 Script executed:

#!/bin/bash
# Find large files and functions
echo "Files over 300 lines:"
fd -e ts -e tsx -x wc -l {} \; | awk '$1 > 300 {print $0}' | sort -rn | head -20

echo ""
echo "Sample of functions that might exceed limits:"
# This is a heuristic - proper analysis would need AST parsing
rg -n "^(export )?(async )?function" --type ts -A 60 | grep -E "^[0-9]+-.*function" | head -10

Length of output: 968


I need to gather more information about function lengths, generated files, and whether the eslint config already excludes certain files.


🏁 Script executed:

#!/bin/bash
# Check for .eslintignore or ignorePatterns in eslint config
echo "=== Checking ESLint exclusions ==="
if [ -f .eslintignore ]; then
  echo ".eslintignore exists:"
  cat .eslintignore
else
  echo "No .eslintignore file found"
fi

echo ""
echo "=== Checking eslint.config.mjs for ignorePatterns ==="
grep -n "ignore" ./eslint.config.mjs | head -20

echo ""
echo "=== Generated files check ==="
echo "Generated TypeScript files (.gen.ts):"
fd -e gen.ts | head -10

Length of output: 855


🏁 Script executed:

#!/bin/bash
# Better function length analysis using AST patterns
echo "=== Functions over 50 lines (sample) ==="
# Search for function declarations and count lines until next function or export
ast-grep --pattern $'function $_ ($_) {
  $$$
}' -A 60 | head -100

Length of output: 5471


🏁 Script executed:

#!/bin/bash
# Check eslint.config.mjs structure to understand current configuration
echo "=== Current eslint.config.mjs context ==="
cat ./eslint.config.mjs | head -60

Length of output: 2007


I need to verify whether the .gen.ts files are auto-generated and if they should be excluded from linting.


🏁 Script executed:

#!/bin/bash
# Check if .gen.ts files are auto-generated (look for generation markers)
echo "=== Checking .gen.ts files for generation markers ==="
rg -n "generated|do not edit|auto-generated" packages/sdk/js/src/gen/types.gen.ts -A 2 -B 2 | head -20

echo ""
echo "=== Check build config for code generation ==="
fd -e "package.json" | xargs grep -l "codegen\|generate" | head -5

Length of output: 186


🏁 Script executed:

#!/bin/bash
# Check if non-generated files can realistically fit within limits
echo "=== Largest non-.gen.ts files ==="
fd -e ts -e tsx ! -path "*/.gen.ts" -x wc -l {} \; | awk '$1 > 300 {print $0}' | sort -rn | head -15

Length of output: 202


🏁 Script executed:

#!/bin/bash
echo "=== Largest non-generated files (excluding .gen.ts) ==="
fd -e ts -e tsx -x wc -l {} \; | grep -v "\.gen\.ts" | awk '$1 > 300 {print $0}' | sort -rn | head -15

Length of output: 740


Exclude auto-generated files and consider starting with warnings for linting limits.

The configuration enforces strict limits that will require codebase refactoring:

  • File size: 15+ non-generated files exceed 300 lines (largest: 4,454 lines for web icons)
  • Function size: Functions exceed 50-line limit (e.g., ~60+ lines observed in scripts)
  • Parameters/complexity: Max 4 parameters and complexity ≤ 15

Two critical issues:

  1. Add .gen.ts exclusion: Auto-generated files (e.g., packages/sdk/js/src/gen/*.gen.ts generated by @hey-api/openapi-ts) must be excluded from these rules since they're not handwritten code.

  2. Consider starting with warn instead of error: This allows development to continue while violations are addressed incrementally:

    -      'max-lines': ['error', { max: 300, skipBlankLines: true, skipComments: true }],
    -      'max-lines-per-function': ['error', { max: 50, IIFEs: true }],
    +      'max-lines': ['warn', { max: 300, skipBlankLines: true, skipComments: true }],
    +      'max-lines-per-function': ['warn', { max: 50, IIFEs: true }],

Committable suggestion skipped: line range outside the PR's diff.

🤖 Prompt for AI Agents
In eslint.config.mjs around lines 44 to 47, the current rules ('max-lines',
'max-lines-per-function', 'max-params', 'complexity') are applied as errors and
do not exclude generated files; update the config to exclude auto-generated
files (e.g., add a pattern like packages/sdk/js/src/gen/**/*.gen.ts to the
appropriate ignoreFiles or overrides.excludePatterns) so those .gen.ts files are
not checked, and change the rule severities from 'error' to 'warn' (at least
initially) for the listed rules so violations surface as warnings while the
codebase is remediated.

// TypeScript strictness (lint-side)
'@typescript-eslint/no-unnecessary-type-assertion': 'error',
'@typescript-eslint/no-floating-promises': 'error',
'@typescript-eslint/explicit-module-boundary-types': 'error',

'@typescript-eslint/no-explicit-any': 'error',
'@typescript-eslint/prefer-readonly-parameter-types': [
'warn',
{
// these avoid most transient-symbol pitfalls
ignoreInferredTypes: true,
checkParameterProperties: false,
// optional: if DOM/3rd-party types cause noise, allow them:
// allow: [{ from: "lib", name: ["HTMLElement", "Event"] }]
},
],
'no-var': 'error',
'prefer-const': 'error',
"import/no-dynamic-require": "error",
'no-restricted-syntax': [
'error',
{
selector: "CallExpression[callee.name='require']",
message: 'ESM only',
},
{
selector: "MemberExpression[object.name='module'][property.name='exports']",
message: 'ESM only',
},
{
selector: 'ClassDeclaration',
message: 'Class declarations are not allowed.',
},
{
selector: 'ClassExpression',
message: 'Class expressions are not allowed.',
},
Comment on lines +67 to +84
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

Reconsider the ban on class declarations and expressions.

Lines 78-84 completely prohibit class usage, which is extremely restrictive and may conflict with third-party libraries, framework requirements, or legitimate use cases (e.g., custom errors, builder patterns).

While functional programming has benefits, a complete ban on classes might be too extreme for a real-world project. Consider:

  1. If classes are truly unwanted in your codebase, ensure this aligns with team consensus and existing code patterns
  2. If this rule is too strict, either remove it or allow classes in specific contexts:
-        {
-          selector: 'ClassDeclaration',
-          message: 'Class declarations are not allowed.',
-        },
-        {
-          selector: 'ClassExpression',
-          message: 'Class expressions are not allowed.',
-        },

Check if classes are already used in the codebase:

If classes are found, you'll need to refactor them or adjust this rule.


🏁 Script executed:

#!/bin/bash
# Search for existing class usage
echo "Searching for class declarations in TypeScript files..."
ast-grep --pattern 'class $_ { $$$ }'

Length of output: 4439



🏁 Script executed:

#!/bin/bash
# Check eslint.config.mjs for ignore patterns and file scope
echo "=== Checking eslint.config.mjs for ignores and scope ==="
cat eslint.config.mjs | head -100

Length of output: 3401


🏁 Script executed:

#!/bin/bash
# Search for more class usages to get full picture
echo "=== Searching for all class declarations ==="
rg -n "^\s*(export\s+)?(abstract\s+)?class\s+" --type=ts --type=js -g '!node_modules' -g '!dist' | head -20

Length of output: 1594


🏁 Script executed:

#!/bin/bash
# Check if there are any ESLint ignores or overrides for generated files
echo "=== Checking for ESLint ignores in package.json or other configs ==="
find . -maxdepth 2 -type f \( -name ".eslintignore" -o -name "eslintrc*" -o -name "package.json" \) ! -path '*/node_modules/*' -exec echo "File: {}" \; -exec cat {} \; 2>/dev/null | head -150

Length of output: 2712


The class ban rule will cause linting failures on existing codebase—critical conflict.

The ESLint config applies to all TypeScript files across the repository without ignoring the real source code. However, classes already exist extensively throughout:

  • Real source: packages/opencode/src/util/queue.ts (AsyncQueue), packages/opencode/src/util/error.ts (NamedError), packages/opencode/src/acp/session.ts (ACPSessionManager), packages/opencode/src/acp/agent.ts (Agent), and custom error classes in multiple files
  • Generated code: packages/sdk/js/src/gen/sdk.gen.ts (20+ generated classes)

Enabling this rule will break the linting pipeline. Either:

  1. Remove the ClassDeclaration and ClassExpression selectors from no-restricted-syntax
  2. Add packages/sdk/js/src/gen/** to ignores for generated code
  3. Refactor all existing classes (20+) to remove class usage
🤖 Prompt for AI Agents
In eslint.config.mjs around lines 67-84, the added 'no-restricted-syntax'
selectors banning ClassDeclaration and ClassExpression will cause repo-wide lint
failures because many real and generated files use classes; fix by removing the
ClassDeclaration and ClassExpression selector entries from this rule, and add an
ignore/override for generated code (e.g., add packages/sdk/js/src/gen/** to the
ignorePatterns or create an override that disables this rule for that glob) so
existing classes keep linting clean; alternatively restrict the rule to only
target specific files where classes must be banned rather than applying it
globally.

],
// FP: immutability & purity
'functional/no-let': 'error',
'functional/no-try-statements': 'warn', // flip to "warn" if you want
'functional/prefer-immutable-types': [
'warn',
{
enforcement: 'ReadonlyDeep',
ignoreInferredTypes: true, // avoids noise on inferred literals
},
],
'@typescript-eslint/no-unsafe-assignment': 'error',
'@typescript-eslint/no-unsafe-call': 'error',
'@typescript-eslint/no-unsafe-member-access': 'error',
'@typescript-eslint/no-unsafe-argument': 'error',
'@typescript-eslint/switch-exhaustiveness-check': 'error',
'functional/immutable-data': ['warn', { ignoreClasses: 'fieldsOnly' }],
'functional/no-loop-statements': 'warn',
'functional/no-method-signature': 'off', // keep TS ergonomics
'functional/prefer-tacit': 'off', // readability first

// Side-effect control
'promise/no-return-wrap': 'warn',
'promise/param-names': 'warn',

// Imports hygiene
'import/first': 'warn',
'import/no-default-export': 'warn',
'import/no-cycle': ['warn', { maxDepth: 1 }],
'import/order': [
'warn',
{
groups: ['builtin', 'external', 'internal', 'parent', 'sibling', 'index', 'object'],
'newlines-between': 'always',
},
],
'no-restricted-imports': [
'error',
{
paths: [
{
name: '@promethean/persistence',
importNames: ['ContextStore'],
message: 'Use makeContextStore (functional) instead of class ContextStore.',
},
{
name: '@promethean/agents/agent-context',
importNames: ['DefaultContextManager', 'ContextManager'],
message:
'This is agent state, not LLM conversation. Import makeAgentStateManager (or LegacyAgentStateManager alias) instead.',
},
],
},
],
Comment on lines +121 to +138
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

Remove or update references to non-existent @promethean packages.

The no-restricted-imports rules reference @promethean/persistence and @promethean/agents/agent-context packages that don't exist in this repository (based on package.json showing @opencode-ai/* packages).

These rules will either fail to load or never trigger. They appear to be copied from another project's configuration.

Verify if these packages exist:

If these packages don't exist, remove these restriction rules:

      'no-restricted-imports': [
        'error',
        {
-          paths: [
-            {
-              name: '@promethean/persistence',
-              importNames: ['ContextStore'],
-              message: 'Use makeContextStore (functional) instead of class ContextStore.',
-            },
-            {
-              name: '@promethean/agents/agent-context',
-              importNames: ['DefaultContextManager', 'ContextManager'],
-              message:
-                'This is agent state, not LLM conversation. Import makeAgentStateManager (or LegacyAgentStateManager alias) instead.',
-            },
-          ],
+          paths: [],
        },
      ],

🏁 Script executed:

#!/bin/bash
# Search for @promethean packages in the codebase
echo "Searching for @promethean package usage..."
rg -n "@promethean/(persistence|agents)" --type ts --type js

echo ""
echo "Available workspace packages:"
cat package.json | jq -r '.workspaces.packages[]'

Length of output: 134



---

🏁 Script executed:

```shell
#!/bin/bash
# Get actual package names and structure
echo "Checking package.json for actual package dependencies:"
cat package.json | jq '.dependencies | keys[] | select(startswith("@")) | .[0:20]' 2>/dev/null | head -20

echo ""
echo "Checking workspace package.json files for context-related packages:"
find packages -name package.json -maxdepth 3 | xargs grep -l "ContextStore\|ContextManager\|persistence\|agent-context" 2>/dev/null || echo "No matches found"

echo ""
echo "Listing actual workspace packages:"
ls -d packages/*/package.json 2>/dev/null | head -10

Length of output: 265


Remove references to non-existent @promethean packages in no-restricted-imports rules.

The restricted import rules reference @promethean/persistence and @promethean/agents/agent-context, which do not exist in this repository. Verification confirms no usage of these packages anywhere in the codebase. These rules will never trigger and appear to be copied from another project's configuration.

Remove these restriction rules from lines 125-133:

      'no-restricted-imports': [
        'error',
        {
          paths: [
-           {
-             name: '@promethean/persistence',
-             importNames: ['ContextStore'],
-             message: 'Use makeContextStore (functional) instead of class ContextStore.',
-           },
-           {
-             name: '@promethean/agents/agent-context',
-             importNames: ['DefaultContextManager', 'ContextManager'],
-             message:
-               'This is agent state, not LLM conversation. Import makeAgentStateManager (or LegacyAgentStateManager alias) instead.',
-           },
          ],
        },
      ],
🤖 Prompt for AI Agents
eslint.config.mjs lines 121-138: remove the two no-restricted-imports entries
that reference non-existent packages (@promethean/persistence with importNames
['ContextStore'] and @promethean/agents/agent-context with importNames
['DefaultContextManager','ContextManager']). Edit the no-restricted-imports rule
to delete those path objects so the rule only contains valid restrictions for
packages present in this repo, and ensure the surrounding array/formatting
remains valid (comma separation and trailing commas) after removal.

},
},
{
files: ['**/src/scripts/**/*.ts'],
rules: {
// Loosen function length for script utilities
'max-lines-per-function': ['warn', { max: 100, IIFEs: true }],
},
},
{
files: ['**/*.test.{ts,tsx,js}', '**/*.spec.{ts,tsx,js}', '**/tests/**/*.{ts,tsx,js}'],
plugins: { ava },
rules: {
'ava/no-only-test': 'error',
'ava/no-identical-title': 'error',
'ava/test-title': 'warn',
// your existing no-restricted-syntax for setTimeout
'no-restricted-syntax': [
'error',
{
selector: "CallExpression[callee.name='setTimeout'][arguments.0.type='Identifier']",
message:
'Use sleep from @promethean/test-utils instead of setTimeout for sleeps in tests.',
},
],
},
},
];
45 changes: 45 additions & 0 deletions lint-errors.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
// File with various linting errors

var unused_var = "this variable is never used"

function badFunction(param1, param2, extra_param) {
var x = 1
var y = 2

if (x == 1) {
console.log("use === instead of ==")
}

var result = param1 + param2
console.log(result)

return
}

function anotherFunction() {
var a = 1,
b = 2,
c = 3
console.log(a, b, c)
}

// Missing semicolons
var obj = {
name: "test",
value: 123,
}

// Trailing whitespace
var spaced = "hello"

// Unused function
function unusedFunction() {
return "never called"
}

// Mixed quotes
var single = "single quotes"
var double = "double quotes"

// Undefined variable
console.log(undefined_variable)
16 changes: 15 additions & 1 deletion opencode.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
{
"$schema": "https://opencode.ai/config.json"
"$schema": "https://opencode.ai/config.json",
"plugin": ["opencode-openai-codex-auth"],
"mcp": {
"weather": {
"type": "local",
"command": ["bun", "x", "@h1deya/mcp-server-weather"]
},
"context7": {
"type": "remote",
"url": "https://mcp.context7.com/mcp",
"headers": {
"CONTEXT7_API_KEY": "{env:CONTEXT7_API_KEY}"
}
}
}
}
10 changes: 7 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
{
"$schema": "https://json.schemastore.org/package.json",
"name": "opencode",
"description": "AI-powered development tool",
"private": true,
"type": "module",
"packageManager": "bun@1.3.0",
"scripts": {
"dev": "bun run packages/opencode/src/index.ts",
"dev": "bun run --cwd packages/opencode --conditions=browser src/index.ts",
"typecheck": "bun turbo typecheck",
"prepare": "husky"
"prepare": "husky",
"random": "echo 'Random script'"
},
"workspaces": {
"packages": [
Expand All @@ -19,6 +21,7 @@
"catalog": {
"@types/bun": "1.3.0",
"@hono/zod-validator": "0.4.2",
"ulid": "3.0.1",
"@kobalte/core": "0.13.11",
"@types/node": "22.13.9",
"@tsconfig/node22": "22.0.2",
Expand Down Expand Up @@ -54,7 +57,8 @@
},
"dependencies": {
"@opencode-ai/script": "workspace:*",
"@opencode-ai/sdk": "workspace:*"
"@opencode-ai/sdk": "workspace:*",
"c8": "10.1.3"
},
"repository": {
"type": "git",
Expand Down
6 changes: 4 additions & 2 deletions packages/console/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,11 @@
},
"dependencies": {
"@ibm/plex": "6.4.1",
"@kobalte/core": "catalog:",
"@openauthjs/openauth": "0.0.0-20250322224806",
"@opencode-ai/console-core": "workspace:*",
"@opencode-ai/console-mail": "workspace:*",
"@openauthjs/openauth": "catalog:",
"@kobalte/core": "catalog:",
"@jsx-email/render": "1.1.1",
"@opencode-ai/console-resource": "workspace:*",
"@solidjs/meta": "^0.29.4",
"@solidjs/router": "^0.15.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/console/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"drizzle-orm": "0.41.0",
"postgres": "3.4.7",
"stripe": "18.0.0",
"ulid": "3.0.0",
"ulid": "catalog:",
"zod": "catalog:"
},
"exports": {
Expand Down
14 changes: 13 additions & 1 deletion packages/desktop/src/context/sync.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@
import type { Message, Agent, Provider, Session, Part, Config, Path, File, FileNode, Project } from "@opencode-ai/sdk"
import type {
Message,
Agent,
Provider,
Session,
Part,
Config,
Path,
File,
FileNode,
Project,
Command,
} from "@opencode-ai/sdk"
import { createStore, produce, reconcile } from "solid-js/store"
import { createMemo } from "solid-js"
import { Binary } from "@/utils/binary"
Expand Down
20 changes: 16 additions & 4 deletions packages/function/src/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -238,10 +238,16 @@ export default new Hono<{ Bindings: Env }>()

// Lookup installation
const octokit = new Octokit({ auth: appAuth.token })
const { data: installation } = await octokit.apps.getRepoInstallation({ owner, repo })
const { data: installation } = await octokit.apps.getRepoInstallation({
owner,
repo,
})

// Get installation token
const installationAuth = await auth({ type: "installation", installationId: installation.id })
const installationAuth = await auth({
type: "installation",
installationId: installation.id,
})

return c.json({ token: installationAuth.token })
})
Expand Down Expand Up @@ -274,10 +280,16 @@ export default new Hono<{ Bindings: Env }>()

// Lookup installation
const appClient = new Octokit({ auth: appAuth.token })
const { data: installation } = await appClient.apps.getRepoInstallation({ owner, repo })
const { data: installation } = await appClient.apps.getRepoInstallation({
owner,
repo,
})

// Get installation token
const installationAuth = await auth({ type: "installation", installationId: installation.id })
const installationAuth = await auth({
type: "installation",
installationId: installation.id,
})

return c.json({ token: installationAuth.token })
} catch (e: any) {
Expand Down
2 changes: 2 additions & 0 deletions packages/opencode/bunfig.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
preload = ["@opentui/solid/preload"]

[test]
preload = ["./test/preload.ts"]
29 changes: 29 additions & 0 deletions packages/opencode/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import js from "@eslint/js"
import typescript from "@typescript-eslint/eslint-plugin"
import typescriptParser from "@typescript-eslint/parser"

export default [
js.configs.recommended,
{
files: ["**/*.ts"],
languageOptions: {
parser: typescriptParser,
parserOptions: {
ecmaVersion: "latest",
sourceType: "module",
},
},
plugins: {
"@typescript-eslint": typescript,
},
rules: {
// Enable some common linting rules to trigger errors
"no-unused-vars": "off", // Turn off base version for TypeScript
"no-console": "error",
"prefer-const": "error",
"no-var": "error",
"@typescript-eslint/no-unused-vars": "error",
"@typescript-eslint/no-explicit-any": "error",
},
},
]
Loading
Loading