82 Commits
Author SHA1 Message Date
Kellyvv 2a3d14402d docs: remove app icon from README header 2026-04-06 05:51:18 +08:00
Kellyvv 2a462839d0 merge: develop → main 2026-04-06 05:49:01 +08:00
Kellyvv 67b2567e65 docs: centered README header — icon, banner, badges, nav links 2026-04-06 05:48:59 +08:00
Kellyvv 82964c8c1c merge: develop → main 2026-04-06 05:40:59 +08:00
Kellyvv 137e0fa5d1 docs: add banner image to README top, update model download flow (empty shell + on-device download) 2026-04-06 05:40:56 +08:00
Kellyvv ba1ed99a89 merge: develop → main 2026-04-06 05:05:57 +08:00
Kellyvv dd76a4718a docs: remove 关键目录/project structure section 2026-04-06 05:05:55 +08:00
Kellyvv 4675d72464 merge: develop → main 2026-04-06 05:04:47 +08:00
Kellyvv 342e7be66d docs: remove execution chain section 2026-04-06 05:03:42 +08:00
Kellyvv 9754635033 merge: develop → main (calendar/reminders/contacts skills, multi-model, README bilingual) 2026-04-06 04:29:04 +08:00
Kellyvv b1e486f21c docs: full sync README_EN with Chinese version — all sections, clean formatting 2026-04-06 04:28:28 +08:00
Kellyvv 33cc497789 docs: add image understanding to capabilities table 2026-04-06 04:26:43 +08:00
Kellyvv 1f5e6d33cd docs: add git clone as step 1 in quick start 2026-04-06 04:24:17 +08:00
Kellyvv 71dffe15cf docs: clean README — remove bold/icons/rules, drop 助手/LLM explanation paragraph 2026-04-06 04:23:12 +08:00
Kellyvv 9f960a79cc docs: fix README — single skill examples only, AI Agent positioning 2026-04-06 04:14:29 +08:00
Kellyvv 993cc6639d docs: AI Agent (not AI assistant) 2026-04-06 04:12:39 +08:00
Kellyvv e177bc06f3 docs: rewrite README — product-focused, bilingual (zh default / en) 2026-04-06 04:12:18 +08:00
Kellyvv 150964c660 chore: remove development team from tracked project settings 2026-04-06 04:05:40 +08:00
Kellyvv 4f469108de docs: rewrite README for quick start and roadmap 2026-04-06 04:03:54 +08:00
Kellyvv 9b579c91a3 docs: update README — model setup options (E2B only / E4B only / both) 2026-04-06 03:50:51 +08:00
Kellyvv 95553ee653 feat: major agent upgrade — multi-model, calendar/reminders/contacts skills
Agent:
- Rewrite load_skill follow-up: inject skill instructions into system
  block (buildLoadedSkillPrompt) instead of appending as user message
- Add auto tool-call shortcut for single no-arg skills
  (autoToolCallForLoadedSkills) — skips second LLM round
- Add Chinese date parsing (parseBasicChineseDate, detectDateInQuestion)
- Add heuristic argument inference (heuristicArgumentsForTool)
- Add looksLikePromptEcho / looksLikeStructuredIntermediateOutput filters
- Add renderToolResultLocally for zero-inference result formatting
- Add permission management API (AppPermissionKind, permissionStatuses,
  requestPermission)
- Add applyModelSelection() for runtime model switching

PromptBuilder:
- Replace buildFollowUp+buildForcedSkillContinuation with:
  buildLoadedSkillPrompt (skill in system block, cleaner prefill)
  buildToolAnswerPrompt (minimal tool-result answer prompt)
- Add extractSystemBlock / injectIntoSystemBlock helpers

MLXLocalLLMService:
- Add BundledModelOption struct
- Support multiple models (E2B + E4B) via availableModels array
- modelPath now dynamic based on selectedModel

ToolRegistry:
- Add calendar-create-event (EventKit, write-only access)
- Add reminders-create (EventKit, full access, EKAlarm for notifications)
  - ensureWritableReminderCalendar: auto-creates reminder list if needed
- Add contacts-upsert (Contacts, dedup by phone number)
- Fix: CNContacts .limited case treated as .granted
- Fix: reminders EKAlarm required for notification to fire

SkillLoader:
- Add calendar, reminders, contacts default SKILL.md entries

Info.plist:
- Add NSCalendarsWriteOnlyAccessUsageDescription
- Add NSCalendarsUsageDescription
- Add NSRemindersFullAccessUsageDescription
- Add NSRemindersUsageDescription
- Add NSContactsUsageDescription

ConfigurationsView:
- Add model picker (E2B / E4B)
- Add permissions panel (AppPermissionKind list with request support)
2026-04-06 03:49:21 +08:00
Kellyvv d5744708ba chore: remove all MediaPipe/E4B/LiteRT legacy references
- Delete doc/HOW_TO_BUILD_E4B_IOS_APP.md (entirely obsolete)
- Podfile: remove MediaPipeTasksGenAI/C pods (not used, code uses MLX SPM)
- pod install: regenerated Podfile.lock (1 pod: Yams only)
- README.md: remove E4B from hardware requirements
- LLMEngine.swift: clean MediaPipe from comments
- MLXLocalLLMService.swift: replace E4B → E2B in inline comments
- PromptBuilder.swift: replace E4B → E2B in inline comments
- AgentEngine.swift: replace LiteRT-LM comment with MLX
- doc/iphone_agent_permissions_*.md: replace E4B → Gemma 4
2026-04-06 02:24:50 +08:00
Kellyvv 649ad2162c revert: restore original PromptBuilder.swift completely 2026-04-06 02:18:04 +08:00
Kellyvv 80c49e39c4 revert: restore original kDefaultSystemPrompt
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.
2026-04-06 02:12:37 +08:00
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