Commit Graph
8 Commits
Author SHA1 Message Date
Kellyvv 24d4098ce6 fix: optimize default system prompt
- 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
2026-04-06 02:08:20 +08:00
Kellyvv 1469a4a795 fix: PromptBuilder — 0 token generation after load_skill
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
2026-04-06 02:06:47 +08:00
Kellyvv 4f113662f4 chore: local dev setup — restore Team ID, fix pbxproj structure
- Restore DEVELOPMENT_TEAM = ZP4QNJ35TH (needed for on-device build)
- Reorder PBXBuildFile / PBXGroup entries for Xcode compatibility
- Fix XCLocalSwiftPackageReference path for Packages/InferenceKit
2026-04-06 02:00:47 +08:00
Kellyvv 7e7f137726 refactor: rename mlx-swift-lm → Packages/InferenceKit 2026-04-06 01:53:57 +08:00
Kellyvv 475bf496e4 feat: vendor mlx-swift-lm as local SPM package (2.7MB, no .git)
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.
2026-04-06 01:53:06 +08:00
Kellyvv abc25eb24f chore: open-source cleanup
- 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
2026-04-06 01:44:55 +08:00
Kellyvv 0f146d4e8f refactor: flatten structure + remove dead code
- Move PhoneClaw/ contents to project root (no more nesting)
- Delete PhoneClawMac/ (nested SPM package, duplicated iOS code)
- Delete LLM/LocalLLMService.swift (dead MediaPipe implementation)
- Delete llm_inference_engine.h + PhoneClaw-Bridging-Header.h (unused)
- Delete Sources/ (empty dir), phoneclaw.code-workspace, TECH_PATH_ANALYSIS.md, project.yml
- Fix project.pbxproj: update INFOPLIST_FILE, CODE_SIGN_ENTITLEMENTS paths
- Fix project.pbxproj: remove SWIFT_OBJC_BRIDGING_HEADER setting
- Fix project.pbxproj: remove LocalLLMService.swift file reference
- Fix project.pbxproj: PhoneClaw group now uses name= instead of path=
2026-04-06 01:33:10 +08:00
Kellyvv d3f7dd78ca feat: initial commit — PhoneClaw on-device AI Agent
- AgentEngine: multi-round tool-chain (up to 10 rounds)
- MLX GPU inference with Gemma 4 E2B (4-bit quantized)
- VLM multimodal support (image input via <|image|> token)
- File-driven Skill system: SKILL.md (YAML frontmatter + body)
- Built-in Skills: clipboard, device, text
- ToolRegistry: iOS native API wrappers
- PromptBuilder: Gemma 4 chat template with function calling
- SwiftUI chat UI with Skill progress cards + thinking animation
- Memory-safe inference: dynamic history depth, GPU cache clearing
- PhoneClawMac: SPM package for macOS port
2026-04-06 01:26:23 +08:00