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 / heredoc.md
Created March 3, 2026 14:17
heredoc issue in VSCode

Heredoc 编码/终端干扰排查与修复

现象

  • 在工具终端执行含中文的 heredoc 时,出现输出截断、内容错乱。
  • 执行包含 ! 的命令时,出现 event not found
  • 终端输出偶发混入控制字符,影响长命令可读性。

结论

@tiye
tiye / ai-slot.md
Created February 28, 2026 04:17
AI 工位 (AI Workstation / AI Slot)

AI 工位(AI Workstation)是一个新兴的企业管理与人力资源概念,指代一种基于标准作业程序(SOP)、由**人工智能代理(AI Agent)**驱动,并深度集成于企业内部协同软件(如钉钉、飞书、Slack 等)的虚拟工作岗位。

与传统的软件自动化不同,“AI 工位”不再被视为一个简单的工具,而是被赋予了职能描述(JD)、内部通讯账号以及明确的任务 KPI,旨在取代原本需要初级或中级员工处理的重复性、逻辑明确的脑力劳动。

1. 核心定义

AI 工位不仅是一套算法,它包含三个核心要素:

  • 详细的 SOP(底层逻辑): 将复杂的业务流程拆解为机器可理解、可执行的步骤。
  • Agent 模式(执行主体): 具备自主规划、工具调用、记忆能力和决策逻辑的 AI 智能体。
  • 企业内协同接入(交互接口): 拥有企业内部账号,能像人类员工一样在 IM 工具中接收指令、发送进度、提交审批或参与讨论。
@tiye
tiye / Caddyfile
Created February 2, 2026 03:30
Proxy on Gemini interactions API
(cors) {
@cors_preflight method OPTIONS
handle @cors_preflight {
header Access-Control-Allow-Origin "{args.0}"
header Access-Control-Allow-Methods "GET, POST, PUT, PATCH, DELETE, OPTIONS"
header Access-Control-Allow-Headers "Content-Type, Authorization, x-goog-api-key, x-goog-api-client, x-stainless-lang, x-stainless-package-version, x-stainless-os, x-stainless-arch, x-stainless-runtime, x-stainless-runtime-version, x-stainless-retry-count, x-stainless-retry-count"
header Access-Control-Max-Age "3600"
respond @cors_preflight 204
}
@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]