chore: initialize qiming workspace repository

This commit is contained in:
Codex
2026-05-29 14:22:48 +08:00
commit bfd67a0f2c
10750 changed files with 1885711 additions and 0 deletions

View File

@@ -0,0 +1,13 @@
diff --git a/lib/agents.js b/lib/agents.js
index 45ec59c4c13757379095131c4f0a5ea6f7284f45..0763b031e355a755ec6a26f98461aa3f63b8339b 100644
--- a/lib/agents.js
+++ b/lib/agents.js
@@ -32,7 +32,7 @@ module.exports = class Agent extends AgentBase {
}
get proxy () {
- return this.#proxy ? { url: this.#proxy } : {}
+ return this.#proxy ? { url: this.#proxy.toString() } : {}
}
#getProxy (options) {

View File

@@ -0,0 +1,16 @@
diff --git a/dist/vendors/convert.js b/dist/vendors/convert.js
index 0d615eebfd7cd646937ec1b29f8332db73586ec1..7b146f903c07a9377d676753691cba67781879be 100644
--- a/dist/vendors/convert.js
+++ b/dist/vendors/convert.js
@@ -74,7 +74,10 @@ function convertToOpenAPISchema(jsonSchema, context) {
$ref: `#/components/schemas/${id}`
};
} else if (_jsonSchema.$ref) {
- const { $ref, $defs } = _jsonSchema;
+ const { $ref, $defs, ...rest } = _jsonSchema;
+ if ($ref.includes("://")) {
+ return Object.keys(rest).length > 0 ? rest : { type: "string" };
+ }
const ref = $ref.split("/").pop();
context.components.schemas = {
...context.components.schemas,

View File

@@ -0,0 +1,120 @@
#!/usr/bin/env bash
set -euo pipefail
# opencode Korean IME Fix Installer
# https://github.com/anomalyco/opencode/issues/14371
#
# Patches opencode to prevent Korean (and other CJK) IME last character
# truncation when pressing Enter in Kitty and other terminals.
#
# Usage:
# curl -fsSL https://raw.githubusercontent.com/claudianus/opencode/fix-zhipuai-coding-plan-thinking/patches/install-korean-ime-fix.sh | bash
# # or from a cloned repo:
# ./patches/install-korean-ime-fix.sh
RED='\033[0;31m'
GREEN='\033[0;32m'
ORANGE='\033[38;5;214m'
MUTED='\033[0;2m'
NC='\033[0m'
OPENCODE_DIR="${OPENCODE_DIR:-$HOME/.opencode}"
OPENCODE_SRC="${OPENCODE_SRC:-$HOME/.opencode-src}"
FORK_REPO="${FORK_REPO:-https://github.com/claudianus/opencode.git}"
FORK_BRANCH="${FORK_BRANCH:-fix-zhipuai-coding-plan-thinking}"
info() { echo -e "${MUTED}$*${NC}"; }
warn() { echo -e "${ORANGE}$*${NC}"; }
err() { echo -e "${RED}$*${NC}" >&2; }
ok() { echo -e "${GREEN}$*${NC}"; }
need() {
if ! command -v "$1" >/dev/null 2>&1; then
err "Error: $1 is required but not installed."
exit 1
fi
}
need git
need bun
# ── 1. Clone or update fork ────────────────────────────────────────────
if [ -d "$OPENCODE_SRC/.git" ]; then
info "Updating existing source at $OPENCODE_SRC ..."
git -C "$OPENCODE_SRC" fetch origin "$FORK_BRANCH"
git -C "$OPENCODE_SRC" checkout "$FORK_BRANCH"
git -C "$OPENCODE_SRC" reset --hard "origin/$FORK_BRANCH"
else
info "Cloning fork (shallow) to $OPENCODE_SRC ..."
git clone --depth 1 --branch "$FORK_BRANCH" "$FORK_REPO" "$OPENCODE_SRC"
fi
# ── 2. Verify the IME fix is present in source ────────────────────────
PROMPT_FILE="$OPENCODE_SRC/packages/opencode/src/cli/cmd/tui/component/prompt/index.tsx"
if [ ! -f "$PROMPT_FILE" ]; then
err "Prompt file not found: $PROMPT_FILE"
exit 1
fi
if grep -q "setTimeout(() => setTimeout" "$PROMPT_FILE"; then
ok "IME fix already present in source."
else
warn "IME fix not found. Applying patch ..."
# Apply the fix: replace onSubmit={submit} with double-deferred version
sed -i 's|onSubmit={submit}|onSubmit={() => {\n // IME: double-defer so the last composed character (e.g. Korean\n // hangul) is flushed to plainText before we read it for submission.\n setTimeout(() => setTimeout(() => submit(), 0), 0)\n }}|' "$PROMPT_FILE"
if grep -q "setTimeout(() => setTimeout" "$PROMPT_FILE"; then
ok "Patch applied."
else
err "Failed to apply patch. The source may have changed."
exit 1
fi
fi
# ── 3. Install dependencies ────────────────────────────────────────────
info "Installing dependencies (this may take a minute) ..."
cd "$OPENCODE_SRC"
bun install --frozen-lockfile 2>/dev/null || bun install
# ── 4. Build (current platform only) ──────────────────────────────────
info "Building opencode for current platform ..."
cd "$OPENCODE_SRC/packages/opencode"
bun run build --single
# ── 5. Install binary ──────────────────────────────────────────────────
mkdir -p "$OPENCODE_DIR/bin"
PLATFORM=$(uname -s | tr '[:upper:]' '[:lower:]')
ARCH=$(uname -m)
[ "$ARCH" = "aarch64" ] && ARCH="arm64"
[ "$ARCH" = "x86_64" ] && ARCH="x64"
[ "$PLATFORM" = "darwin" ] && true
[ "$PLATFORM" = "linux" ] && true
BUILT_BINARY="$OPENCODE_SRC/packages/opencode/dist/opencode-${PLATFORM}-${ARCH}/bin/opencode"
if [ ! -f "$BUILT_BINARY" ]; then
BUILT_BINARY=$(find "$OPENCODE_SRC/packages/opencode/dist" -name "opencode" -type f -executable 2>/dev/null | head -1)
fi
if [ -f "$BUILT_BINARY" ]; then
if [ -f "$OPENCODE_DIR/bin/opencode" ]; then
cp "$OPENCODE_DIR/bin/opencode" "$OPENCODE_DIR/bin/opencode.bak.$(date +%Y%m%d%H%M%S)"
fi
cp "$BUILT_BINARY" "$OPENCODE_DIR/bin/opencode"
chmod +x "$OPENCODE_DIR/bin/opencode"
ok "Installed to $OPENCODE_DIR/bin/opencode"
else
err "Build failed - binary not found in dist/"
info "Try running manually:"
echo " cd $OPENCODE_SRC/packages/opencode && bun run build --single"
exit 1
fi
echo ""
ok "Done! Korean IME fix is now active."
echo ""
info "To uninstall and revert to the official release:"
echo " curl -fsSL https://opencode.ai/install | bash"
echo ""
info "To update (re-pull and rebuild):"
echo " $0"

View File

@@ -0,0 +1,58 @@
diff --git a/Users/brendonovich/github.com/anomalyco/opencode/node_modules/solid-js/.bun-tag-6fcb6b48d6947d2c b/.bun-tag-6fcb6b48d6947d2c
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/Users/brendonovich/github.com/anomalyco/opencode/node_modules/solid-js/.bun-tag-b272f631c12927b0 b/.bun-tag-b272f631c12927b0
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/dist/dev.cjs b/dist/dev.cjs
index 7104749486e4361e8c4ee7836a8046582cec7aa1..0501eb1ec5d13b81ecb13a5ac1a82db42502b976 100644
--- a/dist/dev.cjs
+++ b/dist/dev.cjs
@@ -764,6 +764,8 @@ function runComputation(node, value, time) {
if (node.updatedAt != null && "observers" in node) {
writeSignal(node, nextValue, true);
} else if (Transition && Transition.running && node.pure) {
+ // On first computation during transition, also set committed value #2046
+ if (!Transition.sources.has(node)) node.value = nextValue;
Transition.sources.add(node);
node.tValue = nextValue;
} else node.value = nextValue;
diff --git a/dist/dev.js b/dist/dev.js
index ea5e4bc2fd4f0b3922a73d9134439529dc81339f..4b3ec07e624d20fdd23d6941a4fdde6d3a78cca3 100644
--- a/dist/dev.js
+++ b/dist/dev.js
@@ -762,6 +762,8 @@ function runComputation(node, value, time) {
if (node.updatedAt != null && "observers" in node) {
writeSignal(node, nextValue, true);
} else if (Transition && Transition.running && node.pure) {
+ // On first computation during transition, also set committed value #2046
+ if (!Transition.sources.has(node)) node.value = nextValue;
Transition.sources.add(node);
node.tValue = nextValue;
} else node.value = nextValue;
diff --git a/dist/solid.cjs b/dist/solid.cjs
index 7c133a2b254678a84fd61d719fbeffad766e1331..2f68c99f2698210cc0bac62f074cc8cd3beb2881 100644
--- a/dist/solid.cjs
+++ b/dist/solid.cjs
@@ -717,6 +717,8 @@ function runComputation(node, value, time) {
if (node.updatedAt != null && "observers" in node) {
writeSignal(node, nextValue, true);
} else if (Transition && Transition.running && node.pure) {
+ // On first computation during transition, also set committed value #2046
+ if (!Transition.sources.has(node)) node.value = nextValue;
Transition.sources.add(node);
node.tValue = nextValue;
} else node.value = nextValue;
diff --git a/dist/solid.js b/dist/solid.js
index 656fd26e7e5c794aa22df19c2377ff5c0591fc29..f08e9f5a7157c3506e5b6922fe2ef991335a80be 100644
--- a/dist/solid.js
+++ b/dist/solid.js
@@ -715,6 +715,8 @@ function runComputation(node, value, time) {
if (node.updatedAt != null && "observers" in node) {
writeSignal(node, nextValue, true);
} else if (Transition && Transition.running && node.pure) {
+ // On first computation during transition, also set committed value #2046
+ if (!Transition.sources.has(node)) node.value = nextValue;
Transition.sources.add(node);
node.tValue = nextValue;
} else node.value = nextValue;