chad-code 1.3.6 → 1.3.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package.json",
3
- "version": "1.3.6",
3
+ "version": "1.3.8",
4
4
  "name": "chad-code",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -25,7 +25,6 @@
25
25
  "devDependencies": {
26
26
  "@babel/core": "7.28.4",
27
27
  "@octokit/webhooks-types": "7.6.1",
28
- "@opencode-ai/script": "workspace:*",
29
28
  "@parcel/watcher-darwin-arm64": "2.5.1",
30
29
  "@parcel/watcher-darwin-x64": "2.5.1",
31
30
  "@parcel/watcher-linux-arm64-glibc": "2.5.1",
@@ -34,17 +33,17 @@
34
33
  "@parcel/watcher-linux-x64-musl": "2.5.1",
35
34
  "@parcel/watcher-win32-x64": "2.5.1",
36
35
  "@standard-schema/spec": "1.0.0",
37
- "@tsconfig/bun": "catalog:",
36
+ "@tsconfig/bun": "1.0.9",
38
37
  "@types/babel__core": "7.20.5",
39
- "@types/bun": "catalog:",
38
+ "@types/bun": "1.3.4",
40
39
  "@types/turndown": "5.0.5",
41
40
  "@types/yargs": "17.0.33",
42
41
  "@typescript-eslint/eslint-plugin": "8.52.0",
43
42
  "@typescript-eslint/parser": "8.52.0",
44
- "@typescript/native-preview": "catalog:",
43
+ "@typescript/native-preview": "7.0.0-dev.20251207.1",
45
44
  "eslint": "9.39.2",
46
45
  "jimp": "1.6.0",
47
- "typescript": "catalog:",
46
+ "typescript": "5.8.2",
48
47
  "vscode-languageserver-types": "3.17.5",
49
48
  "why-is-node-running": "3.2.2",
50
49
  "zod-to-json-schema": "3.24.5"
@@ -58,51 +57,49 @@
58
57
  "@ai-sdk/provider-utils": "3.0.19",
59
58
  "@clack/prompts": "1.0.0-alpha.1",
60
59
  "@hono/standard-validator": "0.1.5",
61
- "@hono/zod-validator": "catalog:",
60
+ "@hono/zod-validator": "0.4.2",
62
61
  "@modelcontextprotocol/sdk": "1.15.1",
63
62
  "@octokit/graphql": "9.0.2",
64
- "@octokit/rest": "catalog:",
65
- "@openauthjs/openauth": "catalog:",
66
- "@opencode-ai/plugin": "workspace:*",
67
- "@opencode-ai/script": "workspace:*",
68
- "@opencode-ai/sdk": "workspace:*",
69
- "@opencode-ai/util": "workspace:*",
63
+ "@octokit/rest": "22.0.0",
64
+ "@openauthjs/openauth": "0.0.0-20250322224806",
65
+ "@opencode-ai/plugin": "1.1.13",
66
+ "@opencode-ai/sdk": "1.1.13",
70
67
  "@opentui/core": "0.1.68",
71
68
  "@opentui/solid": "0.1.68",
72
69
  "@parcel/watcher": "2.5.1",
73
- "@pierre/diffs": "catalog:",
70
+ "@pierre/diffs": "1.0.2",
74
71
  "@solid-primitives/event-bus": "1.1.2",
75
72
  "@solid-primitives/scheduled": "1.5.2",
76
73
  "@standard-schema/spec": "1.0.0",
77
74
  "@zip.js/zip.js": "2.7.62",
78
- "ai": "catalog:",
75
+ "ai": "5.0.97",
79
76
  "bonjour-service": "1.3.0",
80
77
  "bun-pty": "0.4.4",
81
78
  "chokidar": "4.0.3",
82
79
  "clipboardy": "4.0.0",
83
80
  "decimal.js": "10.5.0",
84
- "diff": "catalog:",
81
+ "diff": "8.0.2",
85
82
  "fuzzysort": "3.1.0",
86
83
  "gray-matter": "4.0.3",
87
- "hono": "catalog:",
88
- "hono-openapi": "catalog:",
84
+ "hono": "4.10.7",
85
+ "hono-openapi": "1.1.2",
89
86
  "ignore": "7.0.5",
90
87
  "jsonc-parser": "3.3.1",
91
88
  "minimatch": "10.0.3",
92
89
  "open": "10.1.2",
93
90
  "opentui-spinner": "0.0.6",
94
91
  "partial-json": "0.1.7",
95
- "remeda": "catalog:",
96
- "solid-js": "catalog:",
92
+ "remeda": "2.26.0",
93
+ "solid-js": "1.9.10",
97
94
  "strip-ansi": "7.1.2",
98
95
  "tree-sitter-bash": "0.25.0",
99
96
  "turndown": "7.2.0",
100
- "ulid": "catalog:",
97
+ "ulid": "3.0.1",
101
98
  "vscode-jsonrpc": "8.2.1",
102
99
  "web-tree-sitter": "0.25.10",
103
100
  "xdg-basedir": "5.1.0",
104
101
  "yargs": "18.0.0",
105
- "zod": "catalog:",
102
+ "zod": "4.1.8",
106
103
  "zod-to-json-schema": "3.24.5"
107
104
  }
108
105
  }
package/src/bun/index.ts CHANGED
@@ -2,7 +2,7 @@ import z from "zod"
2
2
  import { Global } from "../global"
3
3
  import { Log } from "../util/log"
4
4
  import path from "path"
5
- import { NamedError } from "@opencode-ai/util/error"
5
+ import { NamedError } from "@/util/error"
6
6
  import { readableStreamToText } from "bun"
7
7
  import { createRequire } from "module"
8
8
  import { Lock } from "../util/lock"
@@ -19,7 +19,7 @@ import type {
19
19
  } from "@opencode-ai/sdk/v2"
20
20
  import { createStore, produce, reconcile } from "solid-js/store"
21
21
  import { useSDK } from "@tui/context/sdk"
22
- import { Binary } from "@opencode-ai/util/binary"
22
+ import { Binary } from "@/util/binary"
23
23
  import { createSimpleContext } from "./helper"
24
24
  import type { Snapshot } from "@/snapshot"
25
25
  import { useExit } from "./exit"
package/src/cli/ui.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import z from "zod"
2
2
  import { EOL } from "os"
3
- import { NamedError } from "@opencode-ai/util/error"
3
+ import { NamedError } from "@/util/error"
4
4
 
5
5
  export namespace UI {
6
6
  const LOGO = [
@@ -9,7 +9,7 @@ import { mergeDeep, pipe, unique } from "remeda"
9
9
  import { Global } from "../global"
10
10
  import fs from "fs/promises"
11
11
  import { lazy } from "../util/lazy"
12
- import { NamedError } from "@opencode-ai/util/error"
12
+ import { NamedError } from "@/util/error"
13
13
  import { Flag } from "../flag/flag"
14
14
  import { Auth } from "../auth"
15
15
  import { type ParseError as JsoncParseError, parse as parseJsonc, printParseErrorCode } from "jsonc-parser"
@@ -1,4 +1,4 @@
1
- import { NamedError } from "@opencode-ai/util/error"
1
+ import { NamedError } from "@/util/error"
2
2
  import matter from "gray-matter"
3
3
  import { z } from "zod"
4
4
 
@@ -3,7 +3,7 @@ import path from "path"
3
3
  import { Global } from "../global"
4
4
  import fs from "fs/promises"
5
5
  import z from "zod"
6
- import { NamedError } from "@opencode-ai/util/error"
6
+ import { NamedError } from "@/util/error"
7
7
  import { lazy } from "../util/lazy"
8
8
  import { $ } from "bun"
9
9
 
package/src/ide/index.ts CHANGED
@@ -2,7 +2,7 @@ import { BusEvent } from "@/bus/bus-event"
2
2
  import { Bus } from "@/bus"
3
3
  import { spawn } from "bun"
4
4
  import z from "zod"
5
- import { NamedError } from "@opencode-ai/util/error"
5
+ import { NamedError } from "@/util/error"
6
6
  import { Log } from "../util/log"
7
7
 
8
8
  const SUPPORTED_IDES = [
package/src/index.ts CHANGED
@@ -10,7 +10,7 @@ import { UninstallCommand } from "./cli/cmd/uninstall"
10
10
  import { ModelsCommand } from "./cli/cmd/models"
11
11
  import { UI } from "./cli/ui"
12
12
  import { Installation } from "./installation"
13
- import { NamedError } from "@opencode-ai/util/error"
13
+ import { NamedError } from "@/util/error"
14
14
  import { FormatError } from "./cli/error"
15
15
  import { ServeCommand } from "./cli/cmd/serve"
16
16
  import { DebugCommand } from "./cli/cmd/debug"
@@ -2,7 +2,7 @@ import { BusEvent } from "@/bus/bus-event"
2
2
  import path from "path"
3
3
  import { $ } from "bun"
4
4
  import z from "zod"
5
- import { NamedError } from "@opencode-ai/util/error"
5
+ import { NamedError } from "@/util/error"
6
6
  import { Log } from "../util/log"
7
7
  import { iife } from "@/util/iife"
8
8
  import { Flag } from "../flag/flag"
package/src/lsp/client.ts CHANGED
@@ -8,7 +8,7 @@ import { Log } from "../util/log"
8
8
  import { LANGUAGE_EXTENSIONS } from "./language"
9
9
  import z from "zod"
10
10
  import type { LSPServer } from "./server"
11
- import { NamedError } from "@opencode-ai/util/error"
11
+ import { NamedError } from "@/util/error"
12
12
  import { withTimeout } from "../util/timeout"
13
13
  import { Instance } from "../project/instance"
14
14
  import { Filesystem } from "../util/filesystem"
package/src/mcp/index.ts CHANGED
@@ -11,7 +11,7 @@ import {
11
11
  } from "@modelcontextprotocol/sdk/types.js"
12
12
  import { Config } from "../config/config"
13
13
  import { Log } from "../util/log"
14
- import { NamedError } from "@opencode-ai/util/error"
14
+ import { NamedError } from "@/util/error"
15
15
  import z from "zod/v4"
16
16
  import { Instance } from "../project/instance"
17
17
  import { Installation } from "../installation"
@@ -8,7 +8,7 @@ import { Log } from "../util/log"
8
8
  import { Flag } from "@/flag/flag"
9
9
  import { Session } from "../session"
10
10
  import { work } from "../util/queue"
11
- import { fn } from "@opencode-ai/util/fn"
11
+ import { fn } from "@/util/fn"
12
12
  import { BusEvent } from "@/bus/bus-event"
13
13
  import { iife } from "@/util/iife"
14
14
  import { GlobalBus } from "@/bus/global"
@@ -4,7 +4,7 @@ import { map, filter, pipe, fromEntries, mapValues } from "remeda"
4
4
  import z from "zod"
5
5
  import { fn } from "@/util/fn"
6
6
  import type { AuthOuathResult, Hooks } from "@opencode-ai/plugin"
7
- import { NamedError } from "@opencode-ai/util/error"
7
+ import { NamedError } from "@/util/error"
8
8
  import { Auth } from "@/auth"
9
9
 
10
10
  export namespace ProviderAuth {
@@ -3,7 +3,7 @@ import { Config } from "../config/config"
3
3
  import { mapValues, mergeDeep } from "remeda"
4
4
  import { NoSuchModelError, type Provider as SDK } from "ai"
5
5
  import { Log } from "../util/log"
6
- import { NamedError } from "@opencode-ai/util/error"
6
+ import { NamedError } from "@/util/error"
7
7
  import { Env } from "../env"
8
8
  import { Instance } from "../project/instance"
9
9
  import { createOpenAICompatible } from "@ai-sdk/openai-compatible"
package/src/pty/index.ts CHANGED
@@ -6,7 +6,7 @@ import { Identifier } from "../id/id"
6
6
  import { Log } from "../util/log"
7
7
  import type { WSContext } from "hono/ws"
8
8
  import { Instance } from "../project/instance"
9
- import { lazy } from "@opencode-ai/util/lazy"
9
+ import { lazy } from "@/util/lazy"
10
10
  import { Shell } from "@/shell/shell"
11
11
 
12
12
  export namespace Pty {
@@ -11,7 +11,7 @@ import { Session } from "../session"
11
11
  import z from "zod"
12
12
  import { Provider } from "../provider/provider"
13
13
  import { filter, mapValues, sortBy, pipe } from "remeda"
14
- import { NamedError } from "@opencode-ai/util/error"
14
+ import { NamedError } from "@/util/error"
15
15
  import { ModelsDev } from "../provider/models"
16
16
  import { Ripgrep } from "../file/ripgrep"
17
17
  import { Config } from "../config/config"
@@ -1,6 +1,6 @@
1
1
  import { BusEvent } from "@/bus/bus-event"
2
2
  import z from "zod"
3
- import { NamedError } from "@opencode-ai/util/error"
3
+ import { NamedError } from "@/util/error"
4
4
  import { APICallError, convertToModelMessages, LoadAPIKeyError, type ModelMessage, type UIMessage } from "ai"
5
5
  import { Identifier } from "../id/id"
6
6
  import { LSP } from "../lsp"
@@ -1,5 +1,5 @@
1
1
  import z from "zod"
2
- import { NamedError } from "@opencode-ai/util/error"
2
+ import { NamedError } from "@/util/error"
3
3
 
4
4
  export namespace Message {
5
5
  export const OutputLengthError = NamedError.create("MessageOutputLengthError", z.object({}))
@@ -34,7 +34,7 @@ import { Command } from "../command"
34
34
  import { $, fileURLToPath } from "bun"
35
35
  import { ConfigMarkdown } from "../config/markdown"
36
36
  import { SessionSummary } from "./summary"
37
- import { NamedError } from "@opencode-ai/util/error"
37
+ import { NamedError } from "@/util/error"
38
38
  import { fn } from "@/util/fn"
39
39
  import { SessionProcessor } from "./processor"
40
40
  import { TaskTool } from "@/tool/task"
@@ -1,4 +1,4 @@
1
- import type { NamedError } from "@opencode-ai/util/error"
1
+ import type { NamedError } from "@/util/error"
2
2
  import { MessageV2 } from "./message-v2"
3
3
 
4
4
  export namespace SessionRetry {
@@ -1,7 +1,7 @@
1
1
  import z from "zod"
2
2
  import { Config } from "../config/config"
3
3
  import { Instance } from "../project/instance"
4
- import { NamedError } from "@opencode-ai/util/error"
4
+ import { NamedError } from "@/util/error"
5
5
  import { ConfigMarkdown } from "../config/markdown"
6
6
  import { Log } from "../util/log"
7
7
  import { Global } from "@/global"
@@ -5,7 +5,7 @@ import { Global } from "../global"
5
5
  import { lazy } from "../util/lazy"
6
6
  import { Lock } from "../util/lock"
7
7
  import { $ } from "bun"
8
- import { NamedError } from "@opencode-ai/util/error"
8
+ import { NamedError } from "@/util/error"
9
9
  import z from "zod"
10
10
 
11
11
  export namespace Storage {
@@ -0,0 +1,41 @@
1
+ export namespace Binary {
2
+ export function search<T>(array: T[], id: string, compare: (item: T) => string): { found: boolean; index: number } {
3
+ let left = 0
4
+ let right = array.length - 1
5
+
6
+ while (left <= right) {
7
+ const mid = Math.floor((left + right) / 2)
8
+ const midId = compare(array[mid])
9
+
10
+ if (midId === id) {
11
+ return { found: true, index: mid }
12
+ } else if (midId < id) {
13
+ left = mid + 1
14
+ } else {
15
+ right = mid - 1
16
+ }
17
+ }
18
+
19
+ return { found: false, index: left }
20
+ }
21
+
22
+ export function insert<T>(array: T[], item: T, compare: (item: T) => string): T[] {
23
+ const id = compare(item)
24
+ let left = 0
25
+ let right = array.length
26
+
27
+ while (left < right) {
28
+ const mid = Math.floor((left + right) / 2)
29
+ const midId = compare(array[mid])
30
+
31
+ if (midId < id) {
32
+ left = mid + 1
33
+ } else {
34
+ right = mid
35
+ }
36
+ }
37
+
38
+ array.splice(left, 0, item)
39
+ return array
40
+ }
41
+ }
@@ -0,0 +1,54 @@
1
+ import z from "zod"
2
+
3
+ export abstract class NamedError extends Error {
4
+ abstract schema(): z.core.$ZodType
5
+ abstract toObject(): { name: string; data: any }
6
+
7
+ static create<Name extends string, Data extends z.core.$ZodType>(name: Name, data: Data) {
8
+ const schema = z
9
+ .object({
10
+ name: z.literal(name),
11
+ data,
12
+ })
13
+ .meta({
14
+ ref: name,
15
+ })
16
+ const result = class extends NamedError {
17
+ public static readonly Schema = schema
18
+
19
+ public override readonly name = name as Name
20
+
21
+ constructor(
22
+ public readonly data: z.input<Data>,
23
+ options?: ErrorOptions,
24
+ ) {
25
+ super(name, options)
26
+ this.name = name
27
+ }
28
+
29
+ static isInstance(input: any): input is InstanceType<typeof result> {
30
+ return typeof input === "object" && "name" in input && input.name === name
31
+ }
32
+
33
+ schema() {
34
+ return schema
35
+ }
36
+
37
+ toObject() {
38
+ return {
39
+ name: name,
40
+ data: this.data,
41
+ }
42
+ }
43
+ }
44
+ Object.defineProperty(result, "name", { value: name })
45
+ return result
46
+ }
47
+
48
+ public static readonly Unknown = NamedError.create(
49
+ "UnknownError",
50
+ z.object({
51
+ message: z.string(),
52
+ }),
53
+ )
54
+ }
@@ -2,7 +2,7 @@ import { $ } from "bun"
2
2
  import fs from "fs/promises"
3
3
  import path from "path"
4
4
  import z from "zod"
5
- import { NamedError } from "@opencode-ai/util/error"
5
+ import { NamedError } from "@/util/error"
6
6
  import { Global } from "../global"
7
7
  import { Instance } from "../project/instance"
8
8
  import { Project } from "../project/project"