Thai Token Optimizer (TTO) v2.0 คือระบบแบบ local-first ในรูปแบบ CLI + hooks + adapters สำหรับลดการใช้ token ภาษาไทย พร้อมรักษาความถูกต้องทางเทคนิค ข้อจำกัดด้านความปลอดภัย และความสามารถในการทำซ้ำผลลัพธ์
┌────────────────────────────────────────────────────────────────────────────┐
│ Thai Token Optimizer v2.0 │
│ package version: 2.0.0 │
│ principle: reduce token without losing safety/correctness/constraints │
└────────────────────────────────────────────────────────────────────────────┘
┌─ เริ่มต้นที่นี่ ──────────────────────────────────────────────────────────┐
│ 1) คุณค่าหลักของระบบ 4) การติดตั้ง 5) เส้นทางเริ่มต้นเร็ว │
│ 2) ตารางการผสานระบบ 6) ชุดคำสั่ง 7) Workflow แบบภาพ │
│ 3) สถาปัตยกรรมระบบ 8) โหมดและโปรไฟล์ 9) การปรับเฉพาะบุคคล │
├─ ขั้นสูง ─────────────────────────────────────────────────────────────────┤
│ 10) MTP / Speculative 11) Fleet Analytics 12) Backup/Rollback │
│ 13) Terminal UI 14) Policy and Config 15) CI Pipeline │
├─ การปฏิบัติการ ───────────────────────────────────────────────────────────┤
│ 16) การลด token จริง 17) Runtime Artifacts 18) การแก้ปัญหา │
│ 19) การพัฒนา 20) Safety Checklist 22) Shell Proxy Mode │
│ 21) License │
└────────────────────────────────────────────────────────────────────────────┘
┌────────────────────────────── ก่อนใช้ ────────────────────────────────────┐
│ prompt/คำตอบภาษาไทยยาว ซ้ำ เปลืองค่าใช้จ่าย และปะปนกับคำสั่ง │
└───────────────────────────────────┬────────────────────────────────────────┘
v
┌─────────────────────────────── TTO v2 ─────────────────────────────────────┐
│ ภาษาไทยกระชับ + รักษาโค้ดแบบ code-aware + safety mode + วินัย rollback │
└───────────────────────────────────┬────────────────────────────────────────┘
v
┌────────────────────────────── หลังใช้ ────────────────────────────────────┐
│ token น้อยลง โดยคำสั่ง path version และ constraints ยังถูกต้องครบถ้วน │
└────────────────────────────────────────────────────────────────────────────┘
TTO ลด token ที่สูญเปล่า พร้อมปกป้องสิ่งต่อไปนี้:
- คำสั่งที่ต้องตรงทุกตัวอักษร
- code fences และ inline code
- path และ URL
- version และ config keys
- hard constraints
- คำสั่งที่สำคัญด้านความปลอดภัย
- ความสามารถในการ rollback เพื่อทำซ้ำได้
กฎหลัก:
ลด token ได้ แต่ห้ามลดความถูกต้อง ความปลอดภัย หรือเงื่อนไขสำคัญ
┌─ การบีบอัด ───────────────┬─ ความปลอดภัย ────────────┬─ การปฏิบัติการ ───┐
│ ลบคำฟุ่มเฟือย │ ตัวจำแนกประเภทงาน │ doctor │
│ ลบความหมายซ้ำ │ safe mode │ quality score │
│ Aggressive Log Dedup │ hard-constraint lock │ coach mode │
│ Dynamic Masking │ preservation checker │ ops scan │
│ Sequence Detection │ rollback-first workflow │ fleet audit │
│ Smart Middle-Truncation │ budget optimizer │ context audit │
│ MTP speculative candidates │ │ tto proxy (ใหม่) │
└────────────────────────────┴──────────────────────────┴──────────────────┘
| เป้าหมาย | ประเภทการผสานระบบ | คำสั่งติดตั้ง |
|---|---|---|
| Codex | hooks + AGENTS injection | tto install codex |
| Claude Code | hooks ใน settings | tto install claude |
| Gemini CLI | extension + hooks | tto install gemini |
| OpenCode | native plugin + config | tto install opencode |
| OpenClaw | managed hook + config | tto install openclaw |
| Hermes Agent | shell hooks + plugin hooks + config | tto install hermes |
| Cursor | rule adapter | tto install cursor |
| Aider | rule adapter | tto install aider |
| Cline | rule adapter | tto install cline |
| Roo Code | rule adapter | tto install roo |
ติดตั้งทั้งหมด:
tto install all┌────────────────────────────────────────────────────────────────────────────┐
│ USER / AGENT INPUT │
│ prompt text | hook payload | file input | benchmark corpus | session log │
└───────────────────────────────────┬────────────────────────────────────────┘
v
┌────────────────────────────────────────────────────────────────────────────┐
│ CONTROL AND RISK LAYER │
│ mode tracker -> profile selector -> safety classifier -> policy defaults │
└───────────────────────────────────┬────────────────────────────────────────┘
v
┌────────────────────────────────────────────────────────────────────────────┐
│ COMPRESSION PIPELINE │
│ code-aware parser │
│ semantic analyzer │
│ personalization dictionary │
│ semantic dedup + repeated phrase collapse │
│ selective window + budget optimizer │
│ MTP speculative candidate families │
└───────────────────────────────────┬────────────────────────────────────────┘
v
┌────────────────────────────────────────────────────────────────────────────┐
│ VERIFICATION LAYER │
│ constraint locker -> preservation checker -> safety fallback -> reports │
└───────────────────────────────────┬────────────────────────────────────────┘
v
┌────────────────────────────────────────────────────────────────────────────┐
│ OUTPUT AND OPERATIONS │
│ CLI text/json/pretty | hook context | dashboard | fleet | ci artifacts │
└────────────────────────────────────────────────────────────────────────────┘
ไฟล์ runtime หลัก:
bin/thai-token-optimizer.jshooks/tto-compressor.jshooks/tto-budget-compressor.jshooks/tto-code-aware-parser.jshooks/tto-constraint-locker.jshooks/tto-preservation-checker.jshooks/tto-safety-classifier.jshooks/tto-ui.jshooks/tto-runtime-analytics.jshooks/tto-fleet-audit.js
- Node.js
>=18
npm install
npm testnode bin/thai-token-optimizer.js status --prettynpm link
tto status --pretty┌────────────┐ ┌────────────┐ ┌───────────────┐ ┌────────────┐
│ backup │ > │ install │ > │ install-agents│ > │ doctor │
└────────────┘ └────────────┘ └───────────────┘ └──────┬─────┘
v
┌────────────┐
│ tto auto │
└──────┬─────┘
v
┌────────────┐
│ agent chat │
└────────────┘
tto backup all
tto install all
tto install-agents
tto doctor --pretty
tto autoใน chat/session:
token thai auto
MODE
on|auto | lite | full | safe | off|stop
STATUS/UI
status [--pretty]
ui
dashboard [--view overview|quality|waste|trend|agents|doctor|fleet]
COMPRESSION
compress [--pretty] [--level auto|lite|full|safe] [--budget N]
[--target codex|claude] [--check] [--speculative|--no-speculative]
[--diagnostics] [text|file]
rewrite
estimate [--target codex|claude] [--exact] <text>
preserve <originalFile> <optimizedFile>
classify [--pretty] <text>
HEALTH / QUALITY
doctor [target] [--pretty]
quality [--pretty]
coach [--pretty] [--apply quick|safe]
OPS / FLEET
ops [--pretty] | scan|audit|context|quality|drift|validate [options]
fleet [--roots dir1,dir2] [--pretty] [--doctor]
[--doctor-target all|codex|claude|gemini|opencode|openclaw|hermes]
[--calibration] [--calibration-limit N] [--session-scan]
context [--pretty]
CALIBRATION / CHECKPOINT / CACHE
calibration status|record|from-stats|clear [--pretty]
checkpoint status|list|capture|restore|precompact|postcompact [--pretty]
cache stats|clear [--pretty]
BACKUP / INSTALL
backup [target]
backups
rollback [latest|id|target] [--dry-run]
install <target|all>
uninstall <target|all>
install-agents [codex]
PERSONALIZATION
keep <word>
forget <word>
dictionary
BENCHMARK
benchmark [--pretty] [--strict] [--default-policy] [--mtp]
┌────────┐ ┌──────────┐ ┌──────────────────┐ ┌──────────────┐ ┌────────┐
│ input │ > │ classify │ > │ compress / MTP │ > │ preservation │ > │ output │
└────────┘ └──────────┘ └──────────────────┘ └──────────────┘ └────────┘
tto compress --pretty --level auto --target codex --budget 500 --check prompt.txttto compress --speculative --diagnostics "..."tto compress --no-speculative "..."tto classify --pretty "DROP TABLE users production secret"tto doctor --pretty
tto doctor codex --pretty
tto doctor --citto benchmark --pretty --strict --default-policy --mtptto fleet --pretty --roots /path/repoA,/path/repoB --doctor --calibration --session-scantto ops --pretty
tto ops scan --prettytto calibration status --pretty
tto calibration record --estimated 1000 --real 1200 --target codex
tto calibration from-stats --real-total 24000 --samples 20 --target codextto checkpoint status --pretty
tto checkpoint capture --pretty "before major rewrite"
tto checkpoint restore latest --pretty
tto cache stats --pretty
tto cache clearโหมด:
auto: ค่าเริ่มต้นแบบปรับตัวได้lite: กระชับ แต่มีคำอธิบายเพิ่มเล็กน้อยfull: ผลลัพธ์แน่นขึ้นสำหรับงานความเสี่ยงต่ำsafe: ผลลัพธ์ที่ให้ความปลอดภัยเป็นอันดับแรกoff: ปิดพฤติกรรม optimizer
คำสั่ง:
tto auto
tto lite
tto full
tto safe
tto offโปรไฟล์:
tto profile list
tto profile show
tto profile codingUser dictionary = คำที่ห้ามถูกบีบอัดหรือตัดออก
tto keep "คำเฉพาะของทีม"
tto forget "คำเฉพาะของทีม"
tto dictionaryพฤติกรรม:
- dictionary แบบ local ที่ถูกบันทึกคงอยู่
- ผสานกับการปกป้องแบบ code-aware
- รองรับอักขระพิเศษได้อย่างปลอดภัย
กลุ่ม candidate:
baselinesemantic_dedupselective_windowdedup_plus_selective
┌────────────┐ ┌────────────────┐ ┌──────────────────┐ ┌──────────────────────┐
│ baseline │ │ semantic_dedup │ │ selective_window │ │ dedup_plus_selective │
└─────┬──────┘ └────────┬───────┘ └────────┬─────────┘ └──────────┬───────────┘
└──────────────────┴──────────────────┴───────────────────────┘
v
┌─────────────────────────────┐
│ preservation + budget score │
└──────────────┬──────────────┘
v
┌─────────────────────────────┐
│ selected candidate + reason │
└─────────────────────────────┘
พฤติกรรมสำคัญ:
- ลำดับความสำคัญของ
--speculativeและ--no-speculative - diagnostics พร้อม selected family/level/reason
- กรณีคะแนน preservation เท่ากัน จะให้ความสำคัญกับ
dedup_plus_selective - benchmark gates สำหรับ preservation, hit-rate, slowdown, enhanced gain, fixture guard, action routing
คำสั่ง:
tto compress --speculative --diagnostics "..."
tto benchmark --strict --default-policy --mtpfleet รวมสัญญาณข้ามโปรเจกต์:
- สถานะ benchmark
- สุขภาพจาก doctor
- ช่องว่าง calibration
- ผลรวม session scan
- สิ่งที่ detector พบ และ waste/cost โดยประมาณ
adapter สำหรับ parser ของ session:
- Codex
- Claude
- OpenClaw
- Hermes
- OpenCode
สคริปต์ที่เกี่ยวข้อง:
npm run fleet:fixtures
npm run fleet:history
npm run fleet:gatetto backup all
tto backup codextto backupstto rollback latest --dry-run
tto rollback latest
tto rollback codextto uninstall codex
tto uninstall alltto ui
├─ overview
├─ quality
├─ waste
├─ trend
├─ agents
├─ doctor
└─ fleet
ตัวอย่างรูปแบบ dashboard:
┌────────────────────────────────────────────────────────────────────────────┐
│ Thai Token Optimizer v2.0.0 │
├────────────────────────────────────────────────────────────────────────────┤
│ Mode auto Profile coding Safety strict │
│ Doctor PASS/WARN Quality S/A/B/C/F MTP PASS/FAIL │
│ Saving tokens reduced while preserving commands, paths, versions │
├────────────────────────────────────────────────────────────────────────────┤
│ Commands tto doctor --pretty | tto benchmark --strict --default-policy │
│ Views overview | quality | waste | trend | agents | doctor | fleet │
└────────────────────────────────────────────────────────────────────────────┘
tto ui
tto dashboard --view overview
tto dashboard --view quality
tto dashboard --view waste
tto dashboard --view trend
tto dashboard --view agents
tto dashboard --view doctor
tto dashboard --view fleetตัวอย่างต่อไปนี้มาจากการรันคำสั่งจริงของ TTO v2 ผ่าน terminal renderer ปัจจุบัน ไม่ใช่ mock UI ค่าในแต่ละเครื่องอาจเปลี่ยนตาม local state, adapter ที่ติดตั้ง, benchmark artifacts และ policy ที่ใช้งาน
ใช้ตรวจสถานะเร็วที่สุดว่า TTO เปิดอยู่หรือไม่ อยู่ mode/profile/safety ใด และควรรันคำสั่งถัดไปอะไร
tto status --pretty╭──────────────────────────────────────────────────────────────────────╮
│ ⚡ Thai Token Optimizer v2.0.0 │
├──────────────────────────────────────────────────────────────────────┤
│ Compact Thai responses for AI coding agents │
│ │
│ Status ● ACTIVE │
│ Mode auto │
│ Profile coding │
│ Safety strict │
│ Version 2.0.0 │
│ │
│ Token Saving ░░░░░░░░░░░░░░░░░░░░ 0% │
│ │
│ Quick Commands │
│ tto auto tto compress --pretty --budget 500 prompt.txt │
│ tto doctor tto benchmark --pretty --strict --default-policy │
╰──────────────────────────────────────────────────────────────────────╯
ใช้หลัง benchmark หรือ CI เพื่อดูคะแนนคุณภาพรวม พร้อมสถานะ strict gate, MTP gate, routing gate, weak signals และ suggested actions
tto quality --pretty╭────────────────────────────────────────────────────────────────────────────────╮
│ 🧠 TTO Quality Score │
├────────────────────────────────────────────────────────────────────────────────┤
│ Score ███████████████░ 95.8/100 │
│ Grade S │
│ Strict Gate PASS │
│ MTP Gate PASS │
│ Routing Gate PASS │
│ │
│ Weak Signals │
│ • low_saving_cluster │
│ • tool_cascade │
│ │
│ Suggested Actions │
│ • add_tool_circuit_breaker: After 2 consecutive tool failures, stop retri… │
│ • tune_selective_window: Increase selective-window aggressiveness for low… │
╰────────────────────────────────────────────────────────────────────────────────╯
ใช้เมื่ออยากเห็นผลบีบอัดแบบอ่านง่าย มี token ก่อน/หลัง, จำนวน token ที่ประหยัด, preservation score, risk และตัวอย่าง optimized prompt
tto compress --pretty --level auto --target codex --budget 120 --check "..."╭────────────────────────────────────────────────────────────────────────────────╮
│ ✂️ Prompt Compression Result │
├────────────────────────────────────────────────────────────────────────────────┤
│ Target codex │
│ Mode auto │
│ Budget 120 tokens │
│ │
│ Before 53 tokens │
│ After 48 tokens │
│ Saved 5 tokens │
│ Ratio ██░░░░░░░░░░░░░░░░░░ 9.4% │
│ │
│ Preservation ████████████████████ 100% │
│ Risk low │
│ Missing 0 │
│ │
│ Optimized │
│ อธิบายวิธีใช้งาน Thai Token Optimizer v2.0 ละเอียด โดยต้องคงคำสั่ง tto doct… │
╰────────────────────────────────────────────────────────────────────────────────╯
ใช้เป็นหน้าจอหลักสำหรับ release/CI confidence เพราะรวม strict regression gate และ MTP comparison ในจุดเดียว
tto benchmark --pretty --strict --default-policy --mtp╭────────────────────────────────────────────────────────────────────────────────╮
│ 📊 Thai Token Optimizer v2.0.0 Benchmark │
├────────────────────────────────────────────────────────────────────────────────┤
│ Samples 8 │
│ Average Save ██░░░░░░░░░░░░░░░░░░ 12% │
│ Preservation ████████████████████ 100% │
│ Strict Gate PASS │
│ │
│ MTP Compare ON │
│ Normal ms 1.3 (p95 3.7) │
│ Spec ms 11.3 (p95 16) │
│ Delta ms 10 │
│ Spec Hits 7/8 (87.5%) │
│ MTP Gate PASS │
╰────────────────────────────────────────────────────────────────────────────────╯
ใช้ audit หลายโปรเจกต์หรือหลาย agent พร้อมดู benchmark, calibration, session scan, detector, cost และ coverage ในมุมองค์กร
tto fleet --pretty --calibration --session-scan╭────────────────────────────────────────────────────────────────────────────────╮
│ 🌐 Fleet / Organization View │
├────────────────────────────────────────────────────────────────────────────────┤
│ Projects 1 │
│ Benchmarks 1 │
│ Strict PASS 1 │
│ MTP PASS 1 │
│ Route PASS 1 │
│ Avg Quality 90 │
│ Avg Saving 12% │
│ Waste total 2 │
│ Calibration ON (limit 50) │
│ SessionScan ON │
│ Runs/Cost 0 runs | input 0 | cost ~$0 │
│ Detectors 0 findings | waste 0 tok | ~$0/mo │
│ │
│ Coverage Codex:1 Claude:1 CI:1 │
╰────────────────────────────────────────────────────────────────────────────────╯
ใช้เมื่อระบบยังผ่านคุณภาพรวม แต่มี weak signals หรือ anti-patterns ที่ควรแก้ต่อแบบมีแผน ไม่ต้องเดาเองจากตัวเลขดิบ
tto coach --pretty╭────────────────────────────────────────────────────────────────────────────────╮
│ 🧭 TTO Coach Mode (Guided Remediation) │
├────────────────────────────────────────────────────────────────────────────────┤
│ Health Score ███████████████░ 95.8/100 │
│ Health Grade S │
│ Summary grade=S; weak=2; antiPatterns=2 │
│ │
│ Anti-patterns │
│ • tool_cascade | medium | agent-runtime-owner | Repeated tool cycles may add … │
│ • low_saving_cluster | medium | compression-engine-owner | Low-value narrativ… │
│ │
│ Fix Plan │
│ • step-1 | medium | developer | Run `tto quality --pretty` and `tto… │
│ • step-2 | medium | developer | Capture checkpoint before optimizat… │
│ • step-3b | medium | agent-runtime-owner | After repeated tool cycles, stop a… │
│ • step-3d | medium | compression-engine-owner | Tune selective compression fo… │
│ │
│ Applied NO │
│ • no auto-remediation │
╰────────────────────────────────────────────────────────────────────────────────╯
tto config path
tto config get
tto config set benchmarkStrict.mtpRepeats 9policy controls ประกอบด้วย:
- strict saving gate
- MTP preservation/hit-rate/slowdown thresholds
- enhanced corpus minimum gain
- detector thresholds สำหรับ routing
npm run ciลำดับ CI ปัจจุบันจาก package.json:
1) npm run test:ci
2) node bin/thai-token-optimizer.js benchmark --strict --default-policy --mtp
3) node bin/thai-token-optimizer.js doctor --ci
การเปรียบเทียบจริงล่าสุดในเครื่อง (without TTO เทียบกับ with TTO, 18 กรณี):
┌──────────────────────┬────────┬───────────────┬──────────────┐
│ Mode │ Tokens │ Saved │ Preservation │
├──────────────────────┼────────┼───────────────┼──────────────┤
│ without TTO │ 1789 │ baseline │ n/a │
│ with TTO normal │ 1344 │ -445 / -24.9% │ 100% min │
│ with TTO MTP/spec │ 1334 │ -455 / -25.4% │ 100% min │
└──────────────────────┴────────┴───────────────┴──────────────┘
┌──────────────────┬────────────────────────────────┬────────────────────────────────────────────────┬───────────────────────────────────────────┐
│ หัวข้อเปรียบเทียบ │ ภาษาไทย (Thai) │ ภาษาอังกฤษ (English) │ Mixed Language (ไทยผสมอังกฤษ) │
├──────────────────┼────────────────────────────────┼────────────────────────────────────────────────┼───────────────────────────────────────────┤
│ อัตราการลดเฉลี่ย │ 30% - 50% │ 15% - 98% (Logs/ALD) │ 25% - 60% │
│ กลไกหลัก │ Filler Removal / สรุปความประโยค │ Aggressive Log Dedup / Sequence Detection │ Technical Anchor Compression │
│ สิ่งที่ถูกลดออก │ คำสุภาพ, คำเชื่อม, วลีเกริ่นนำ │ Repeated Logs, Timestamps, Stack Traces │ ภาษาไทยรอบข้าง Technical terms │
│ สิ่งที่ถูกรักษาไว้ │ ใจความสำคัญ, ตัวเลข, หน่วย │ Code, Paths, Versions, JSON Keys │ Technical terms และ Constraints ทั้ง 2 ภาษา │
└──────────────────┴────────────────────────────────┴────────────────────────────────────────────────┴───────────────────────────────────────────┘
ระบบบีบอัด Log ขั้นสูงที่สามารถลด Token ได้ถึง 98%++ สำหรับข้อมูลเชิงเทคนิค:
- Dynamic Masking: ปกปิดข้อมูลตัวแปร (Timestamp, UUID, Hex, IPs) อัตโนมัติเพื่อให้เห็นโครงสร้างที่แท้จริง
- Sequence Detection: ตรวจจับชุดลำดับบรรทัดที่ซ้ำกัน (เช่น
[RUN]ตามด้วย[PASS]) แม้ข้อมูลภายในจะเปลี่ยน - Maximum Capacity: สามารถลด Log ปริมาณมหาศาล (1,000+ บรรทัด) เหลือเพียง 1-2 บรรทัดสรุป
เทคนิคการจัดการ Token เมื่อข้อมูลยาวเกินงบประมาณ (Budget) โดยไม่ใช้วิธีตัดท้ายทิ้งเพียงอย่างเดียว:
- Head-Tail Preservation: รักษา "จุดประสงค์" (ตอนต้น) และ "ผลลัพธ์" (ตอนท้าย) ไว้เสมอ
- Context Continuity: เจาะรูเฉพาะส่วนกลางที่เป็นรายละเอียดปลีกย่อย ช่วยให้ AI Agent ไม่เสียตรรกะการทำงาน
- Iterative Pruning: ย่อรายละเอียดแบบเป็นลำดับขั้นเพื่อให้พอดีกับ Budget ที่จำกัดมากที่สุด
หมายเหตุ:
- prompt ที่เข้มงวดด้านเทคนิค/ความปลอดภัย อาจตั้งใจลด token ได้น้อย
- estimator อาจเป็นแบบ heuristic เว้นแต่ติดตั้ง exact tokenizer dependencies แล้ว
┌─ Local State ──────────────────────────────────────────────────────────────┐
│ state.json mode/profile/speculative flags │
│ stats.jsonl runtime stats │
│ dictionary.json personalization words from tto keep │
│ policy.json benchmark and compression policy │
├─ Runtime Analytics ────────────────────────────────────────────────────────┤
│ checkpoint JSONL checkpoint lifecycle │
│ cache read log repeated read analytics │
│ calibration JSONL estimated vs real token gap │
├─ Benchmark Artifacts ──────────────────────────────────────────────────────┤
│ benchmarks/regression_report.md │
│ benchmarks/regression_report.json │
│ benchmarks/regression_history.jsonl │
│ benchmarks/fleet_history.jsonl │
└────────────────────────────────────────────────────────────────────────────┘
UserPromptSubmit hook failed
error: hook returned invalid user prompt submit JSON output
tto doctor codex --pretty
node --test tests/test_codex_triggers.js tests/test_tracker.jsStop hook failed
error: hook returned invalid stop hook JSON output
tto doctor --pretty
node --test tests/test_activate.js tests/test_pretty_ui.jsnpm run test:ciตรวจสอบ artifacts:
benchmarks/regression_report.mdbenchmarks/regression_report.json
ไดเรกทอรีสำคัญ:
thai-token-optimizer/
├── bin/ CLI entrypoint
├── hooks/ core engine, hooks, analytics, UI
├── adapters/ integration installers
├── benchmarks/ corpora, reports, gates
├── tests/ regression and integration tests
├── .codex-plugin/
├── .claude-plugin/
├── .github/
├── README.md
├── AGENTS.md
├── MANUAL.md
├── package.json
└── LICENSE
การรันทดสอบแบบเจาะจง:
node --test tests/test_mtp_speculative.js tests/test_mtp_benchmark.js tests/test_mtp_detectors.js
node --test tests/test_pretty_ui.js tests/test_fleet_auditor.js[1] classify risk
[2] backup first
[3] dry-run when available
[4] apply change
[5] verify result
[6] keep rollback ready
ตัวอย่าง:
tto backup all
tto rollback latest --dry-run
tto doctor --prettyTTO-Proxy ใช้ครอบคำสั่ง Shell เพื่อบีบอัด Output ภาษาไทยหรือ Log ที่ซ้ำซ้อนก่อนที่ AI Agent จะได้อ่าน ช่วยประหยัด Input Token ตั้งแต่ "ต้นน้ำ"
tto proxy <command> [args...]
tto run <command> [args...]ตัวอย่าง:
tto proxy npm run test
tto run git statusคุณสามารถตั้งค่าให้ Agent เรียกใช้ TTO-Proxy อัตโนมัติสำหรับคำสั่ง Bash (เช่นใน .claude/settings.json):
{
"tools": {
"BashCommand": {
"wrapper": "tto proxy --silent --"
}
}
}TTO-Proxy มาพร้อมกับฟีเจอร์ "Lenses" หรือฟิลเตอร์เฉพาะทางสำหรับแต่ละคำสั่ง (เช่น git, docker, npm) เพื่อการบีบอัดที่แม่นยำยิ่งขึ้น:
- Git Lens: รู้วิธีอ่านและแปล Output ของ
git statusภาษาไทยที่ยาวและเป็นทางการ ให้กลายเป็นสัญลักษณ์ทางเทคนิคที่สั้นกระชับ (เช่นไฟล์ที่ถูกแก้ไขแต่ยังไม่ได้จัดเตรียมสำหรับการ commit→[!] ไม่ได้ stage:หรือ[M]) - ความแม่นยำสูง: ตัด "น้ำ" ออกจากคำสั่งเฉพาะทางก่อนที่จะส่งให้ ALD/SMT ช่วยลด Token ได้กว่า 90%
- รองรับ Mixed Language: ทำงานได้อย่างสมบูรณ์แบบไม่ว่า Tool จะพ่น Output ออกมาเป็นภาษาไทย, ภาษาอังกฤษ, หรือผสมกัน โดยยังคงรักษา Path และข้อมูลเทคนิคไว้ 100%
MIT License
ดู LICENSE