Skip to content

Instantly share code, notes, and snippets.

View laiso's full-sized avatar
☀️

laiso laiso

☀️
View GitHub Profile
@laiso
laiso / anth_proxy.ts
Last active July 28, 2025 16:56
anth_proxy.ts: OpenAI compatible interface for Anthropic Client.
/**
* OpenAI compatible interface for Anthropic Client.
*
* Usage:
* ANTH_PROXY_API_KEY=XXX bun run anth_proxy.ts.ts https://api.openai.com/v1/chat/completions qwen/qwen3-coder:free
* ANTHROPIC_BASE_URL=http://localhost:3000 claude -p 'write a sample code in main.ts'
*
* LICENSE: MIT
* Inspired by https://github.com/kiyo-e/claude-code-proxy
*/
import csv
import json
import sys
import ast
def find_task_by_id(filename, task_id):
with open(filename, 'r', encoding='utf-8') as file:
reader = csv.DictReader(file)
fieldnames = reader.fieldnames
id_columns = [col for col in fieldnames if 'id' in col.lower()]
@laiso
laiso / REPORT.md
Last active July 24, 2025 06:15
Cursor Background Agentsのコンテナ環境下でGUIアプリケーションの動作能力

目的

Cursor Background Agentsのコンテナ環境下でGUIアプリケーションの動作能力を検証する

実施日

2024年7月24日

検証環境

  • OS: Ubuntu 25.04 (Linux 6.12.8+)
  • 環境: CursorBackground コンテナ環境
  • Node.js: v22.15.0

Design Document

Overview

This design addresses the cursor inconsistency issue in the Settings menu, specifically after using the "Copy URL to clipboard" feature. The problem occurs when the confirmation message appears after copying, and hovering over this non-clickable element incorrectly displays a pointer cursor instead of the default cursor. This creates a misleading user experience as it suggests the element is clickable when it is not.

Architecture

The New Expensify application uses React Native for cross-platform development with React Native Web for the web implementation. Cursor styles in the web version are controlled through:

@laiso
laiso / task-agent.ts
Created July 13, 2025 13:59
A mimic of the Task Tool from Claude Code.
import Anthropic from '@anthropic-ai/sdk';
import { z } from 'zod';
import { join } from 'path';
import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'fs';
// ============================================================================
// TYPE DEFINITIONS
// ============================================================================
export const TodoStatus = z.enum(['pending', 'in_progress', 'completed']);
#! /usr/bin/env node
import { execFileSync } from "node:child_process";
import { readFileSync, existsSync } from "node:fs";
import path from "node:path";
import os from "node:os";
try {
const input = JSON.parse(readFileSync(process.stdin.fd, 'utf8'));
if (!input.transcript_path) {
❯ docker run \
  --tmpfs /tmp/claude:rw,nosuid,size=1m \
  -e CREDS=$(security find-generic-password -a $USER -w -s "Claude Code-credentials") \
  -e HOME=/home/node \
  claude-code:latest sh -c '
    echo "$CREDS" > /tmp/claude/.credentials.json
    chmod 600 /tmp/claude/.credentials.json
    ln -s /tmp/claude/.credentials.json ~/.claude/.credentials.json
 claude -p hi
@laiso
laiso / Dockerfile
Last active June 22, 2025 02:15
Benchmarks CLI agents (Claude Code, Codex CLI, Goose CLI and Aider) on Exercism TypeScript programming exercises https://github.com/exercism/typescript/tree/main/exercises/practice
FROM node:22
ARG TZ
ENV TZ="$TZ"
# Install basic development tools and iptables/ipset
RUN apt update && apt install -y less \
git \
procps \
sudo \
@laiso
laiso / README.md
Last active June 7, 2025 10:18
Custom AI editor tool override API with OpenAI Chat Completion compatibility

This project creates a custom code generation tool API for AI editors (VS Code, Cursor). The main purpose is to override Tool Use functionality in AI editors and implement custom code generation logic, while maintaining full compatibility with Chat Completions API and Ollama API so existing editor configurations can be used as-is.

The supported environment includes VS Code and Cursor editors, with deployment capability on Cloudflare Workers. The API must support streaming=true for real-time responses. Tool Call detailed tracking and log output are provided for debugging purposes.

This code was created with reference to the Vercel V0 API design. https://vercel.com/docs/v0/api

npm create cloudflare@latest
@laiso
laiso / claude-pr.yml
Created May 31, 2025 09:39
claude-code-action-example-ios: .github/workflows/claude-pr.yml
name: Run Claude Code
on:
workflow_dispatch:
inputs:
test_prompt:
description: "Test prompt for Claude"
required: false
default: "List the files in the current directory starting with 'package'"