feat: add plan mode (enter/exit/completion check/verification gate/periodic hints)
This commit is contained in:
@@ -1,13 +1,8 @@
|
||||
"""Desktop Pet with Skin System — Cross-platform with True Transparency"""
|
||||
import os
|
||||
import re
|
||||
import sys
|
||||
import json
|
||||
import threading
|
||||
import os, re, sys, json, threading, io
|
||||
from http.server import HTTPServer, BaseHTTPRequestHandler
|
||||
from urllib.parse import urlparse, parse_qs
|
||||
from PIL import Image, ImageDraw, ImageFont, ImageOps
|
||||
import io
|
||||
|
||||
PORT = 51983
|
||||
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
|
||||
@@ -784,7 +779,7 @@ if __name__ == '__main__':
|
||||
pass
|
||||
|
||||
if sys.platform == 'darwin':
|
||||
pet = MacPet()
|
||||
pet = MacPet('vita')
|
||||
pet.run()
|
||||
else:
|
||||
pet = WinPet('vita')
|
||||
|
||||
@@ -56,9 +56,9 @@ def render_sidebar():
|
||||
agent._pet_req = _pet_req
|
||||
if not hasattr(agent, '_turn_end_hooks'): agent._turn_end_hooks = {}
|
||||
def _pet_hook(ctx):
|
||||
parts = [f"🔄 Turn {ctx.get('turn','?')}"]
|
||||
parts = [f"Turn {ctx.get('turn','?')}"]
|
||||
if ctx.get('summary'): parts.append(ctx['summary'])
|
||||
if ctx.get('exit_reason'): parts.append('✅ 任务已完成')
|
||||
if ctx.get('exit_reason'): parts.append('任务已完成')
|
||||
_pet_req(f'msg={quote(chr(10).join(parts))}')
|
||||
if ctx.get('exit_reason'): _pet_req('state=idle')
|
||||
agent._turn_end_hooks['pet'] = _pet_hook
|
||||
|
||||
Reference in New Issue
Block a user