Skip to content

Instantly share code, notes, and snippets.

View tiye's full-sized avatar
💭
Make Cirru great again!

题叶 tiye

💭
Make Cirru great again!
View GitHub Profile
@tiye
tiye / suggestion.md
Created October 13, 2025 16:26
Some suggestion from GPT 4.1 about how to make agent focused

如果你要模仿 Claude CODE 和 Gemini CLI 自己实现一个 agent 命令行,并且希望你的 Agent 能够持续进行多轮对话,并且始终准确围绕用户提出的任务持续探索和行动,你需要从以下几个方面做优化:


1. 高质量的任务上下文维护与“记忆”设计

  • 对话历史管理
    • 保存所有轮次的用户输入、Agent回复、工具调用请求与结果,并设计合适的“摘要”或“压缩”机制,避免 prompt 长度溢出。
    • 优化历史内容选择,确保每轮对话都能带上最相关的任务信息(如目标描述、关键中间结果、约束条件)。
@tiye
tiye / edit.md
Last active July 21, 2025 03:54
Trick to override baseUrl for Gemini CLI

find in node_modules/

  • in @google/gemini-cli-core/dist/src/core/contentGenerator.js edit createContentGenerator, add baseUrl in httpOptions.
  • in @google/gemini-cli-core/dist/src/core/geminiChat.js edit contentGenerator.generateContent, add httpOptions as well
@tiye
tiye / Try.metal
Last active July 12, 2025 07:13
用于 https://github.com/Triadica/CompositorDemo 计算粒子轨迹的脚本
/*
This file provides a compute function that can be dyanamically loaded
*/
#include <metal_stdlib>
#include <simd/simd.h>
using namespace metal;
typedef struct {
1
00:00:00,833 --> 00:00:05,433
[音乐]
2
00:00:07,733 --> 00:00:12,100
[音乐]
3
00:00:12,733 --> 00:00:18,166
@tiye
tiye / spatial-events.swift
Created March 30, 2025 15:36
spatial-events.swift
```
LampsRenderer received spatial event: SpatialEventCollection(events: [
SwiftUI.SpatialEventCollection.Event.ID(value: 1): SwiftUI.SpatialEventCollection.Event(
id: SwiftUI.SpatialEventCollection.Event.ID(value: 1),
timestamp: 66374.834269625,
kind: SwiftUI.SpatialEventCollection.Event.Kind.indirectPinch,
location: (0.0, 0.0),
phase: SwiftUI.SpatialEventCollection.Event.Phase.active,
modifierKeys: SwiftUI.EventModifiers(rawValue: 0),
_inputDevicePose: Optional(SwiftUI.SpatialEventCollection.Event.InputDevicePose(
const inner_width: f32 = {%inner_width%};
const inner_height: f32 = {%inner_height%};
const PI: f32 = 3.1415926535897932384626433832795;
@fragment
fn fragment_main(vs_out: VertexOut) -> @location(0) vec4<f32> {
// provide (x,y) in pixels, center is (0,0)
let pos = vs_out.pos;
let x = pos.x * inner_width * 0.5;
@tiye
tiye / config.toml
Created March 5, 2025 12:33
Custom config toml
# Use different pre-set defaults than the global defaults.
#
# See `src/bootstrap/defaults` for more information.
# Note that this has no default value (x.py uses the defaults in `config.example.toml`).
profile = 'dist'
[llvm]
download-ci-llvm = false
[build]
@tiye
tiye / rust-compile.log
Created March 5, 2025 07:14
some logs compiling Rust locally
Building bootstrap
Finished `dev` profile [unoptimized] target(s) in 0.98s
WARNING: The `change-id` is missing in the `config.toml`. This means that you will not be able to track the major changes made to the bootstrap configurations.
NOTE: to silence this warning, add `change-id = 127866` at the top of `config.toml`
Building stage0 library artifacts (aarch64-apple-darwin)
Compiling cc v1.0.99
Compiling core v0.0.0 (/Users/jon.chen/work/container/rust/library/core)
Compiling libc v0.2.155
Compiling memchr v2.5.0
Compiling std v0.0.0 (/Users/jon.chen/work/container/rust/library/std)
@tiye
tiye / AttractorView.swift
Last active February 6, 2025 10:14
outdated demo of attractor rendering in visionOS
import Metal
import RealityKit
import SwiftUI
struct AttractorView: View {
let rootEntity: Entity = Entity()
let allSize: Int = 200000
var vertexCapacity: Int {
return allSize * 4
}
@tiye
tiye / cp.sh
Created January 17, 2025 17:59
Calcit command for copy oneliner
caps download calcit-lang/calcit-clipboard@main
cr eval --dep calcit-clipboard/ 'thread-first (range 100) (map inc) (.join-str "|,") clipboard.core/copy!'