- Add changelog entry covering ModelScope mirror and the memory-management
rework (dynamic budget from headroom, dropped prompt-length subtraction).
- Fix stale path references after the MLX/Tools refactor:
LLM/MLXLocalLLMService.swift → LLM/MLX/MLXLocalLLMService.swift
Skills/ToolRegistry.swift → Tools/ToolRegistry.swift
- Custom skill snippet now shows the new \`type:\` field with device/content
guidance, and notes the load-time allowed-tools validation.
- Add ModelScope mirror links to the reference list in both READMEs.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Default release build is the empty-shell IPA — model files live under
Models/ for local development but are no longer copied into the .app
bundle. Users still download Gemma weights at first launch via the
in-app downloader (ModelScope / hf-mirror / huggingface.co fallback).
Keep PBXFileReference + group children so Models/ stays browsable in
Xcode, but remove the BuildFile entry from PBXResourcesBuildPhase.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Xcode auto-injected the local team identifier when files were added to
the project. Strip it again so the repo stays signing-agnostic.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Major restructuring of the agent stack to support content-type skills,
data-driven runtime budgets, and the new translate skill.
LLM/MLX/
- Split MLXLocalLLMService.swift (1500 → 700 lines) into Core/, Gemma4/,
Installation/ subdirectories
- New BundledModel: LinearBudgetFormula replaces tier tables, model
parameters fully data-driven via ModelRuntimeProfile
- New RuntimeBudgets: pure functions for text/thinking/multimodal budgets,
zero hardcoded model IDs
- Drop adjustedTextOutputTokens prepared-subtraction (chunked prefill made
it obsolete and triggered false-positive truncation on long prompts)
Skills/
- Add SkillType (.device / .content) metadata, parsed from SKILL.md
frontmatter
- New translate skill (type: content, no tools) with anaphora handling
- Trim translate (4563→1804), device (2357→1680), calendar (2169→1790)
- contacts SKILL.md adds multi-turn disambiguation + cancel guidance,
semantics owned by body not framework
- SkillRegistry validates allowed-tools against ToolRegistry at load time
Agent/
- ToolCallParser becomes registry-aware: drops tool_call names not in
ToolRegistry or protocol set (load_skill / list_skills); ToolRegistry
is now the single white list, validation moves to parser boundary
- Router sticky routing uses semantic user-turn boundary instead of
fixed suffix(4); correctly handles long agent loops
- AgentEngine system prompt template differentiates device vs content
skills with explicit invocation rules
- SYSPROMPT.md auto-migration: old single-placeholder template backed up
to .bak when new dual-placeholder is detected
- PromptBuilder.buildLoadedSkillPrompt receives availableTools list,
explicitly tells model which tools (or none) are callable
Tools/
- ToolRegistry split into Helpers/Stores/AppPermissions/Handlers/* for
separation of concerns
- Mark Tools/Handlers/* with explicit allowed argument signatures
UI/
- Add long-press copy contextMenu on user and assistant bubbles
- Enable .textSelection on user bubble
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace the plain "下载中 X/Y" badge with a small progress bar that
visualises file-count progress while a model is downloading. UI-only
change — does not touch the download path itself.
Inspired by @gclsoft's PR #3.
Co-Authored-By: Peter <gclsoft@qq.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The 'optimization' broke model behavior — Gemma 4 needs
the literal <tool_call> example in system prompt to understand
the correct output format. Reverted to original.
- Remove literal <tool_call> block from system turn
(was being carried into buildFollowUp systemBlock, confusing
the model into thinking it had already made a tool call)
- Condense instructions from ~110 tokens to ~55 tokens
(halves prefill cost for the system block in every follow-up round)
- Rewrite as bullet rules instead of paragraph prose
Root cause: <|turn>model trailing newline made Gemma 4 treat
the model turn as already completed, causing immediate EOS.
Fixes:
- Remove blank line after <|turn>model in buildFollowUp (isLoadSkill path)
- Remove blank line after <|turn>model in buildFollowUp (tool result path)
- Remove blank line after <|turn>model in buildForcedSkillContinuation
- Fix systemBlock range: ...upperBound → ..<upperBound (off-by-one)
Result: model now generates tool_call after skill is loaded
Replaces remote XCRemoteSwiftPackageReference with local XCLocalSwiftPackageReference.
The mlx-swift-lm/ directory is now self-contained in this repo — anyone who
clones PhoneClaw gets MLXLMCommon, MLXLLM, MLXVLM without any network dependency.
- Remove personal Team ID (ZP4QNJ35TH) and Bundle ID (com.zxw.*)
from project.pbxproj; replaced with empty team and com.example.phoneclaw
- Rewrite README.md for open-source (remove local paths, update to MLX architecture)
- Fix doc/HOW_TO_BUILD_E4B_IOS_APP.md: remove /Users/zxw/ hardcoded paths
- Delete LiteRT-LM/ (unused C API reference, never integrated)
- Delete _mediapipe-samples/ (reference only, not part of build)
- Delete _mlx-swift-lm/ (local clone, replaced with remote SPM reference)
- Convert _mlx-swift-lm from XCLocalSwiftPackageReference to remote
XCRemoteSwiftPackageReference → https://github.com/ml-explore/mlx-swift-lm (branch: main)
- Update .gitignore to reflect removed directories