feat: register isphere file receive list tool

This commit is contained in:
zhaoyilun
2026-07-10 00:53:04 +08:00
parent fe242145bb
commit bd03cf5d83
9 changed files with 327 additions and 34 deletions

View File

@@ -1341,7 +1341,7 @@ Implemented and verified in this loop:
- Output shape: `ok`, `mode`, `files`, `next_cursor`, and `audit`, aligned with `docs/mcp-core-tools-contract.md`.
- Default empty source returns `ok: true`, `mode: "list"`, `files: []`.
- [ ] **Step 1: Write failing MCP tool test**
- [x] **Step 1: Write failing MCP tool test**
Create `internal/tools/isphere_files_test.go` and run:
@@ -1351,15 +1351,15 @@ go test ./internal/tools -run TestISphereReceiveFilesToolReturnsLogBackedFiles -
Expected initial failure: file receive tool registration does not exist.
- [ ] **Step 2: Implement file tool registration**
- [x] **Step 2: Implement file tool registration**
Register `isphere_receive_files` with source injection for tests. Use `ListFilesFromMessages` and return a contract-shaped map with minimal audit metadata.
- [ ] **Step 3: Wire server and verification**
- [x] **Step 3: Wire server and verification**
Register file receive in server construction. Update server tool-count tests and `scripts/verify-go-mcp.ps1` to expect eight tools and call `isphere_receive_files` against default empty source and synthetic configured file-transfer fixture.
- [ ] **Step 4: Run full verification and commit**
- [x] **Step 4: Run full verification and commit**
Run:
@@ -1374,6 +1374,56 @@ Expected: all exit 0. Remove any generated root `isphere-mcp.exe` after build. C
---
## Loop C14 Result
Implemented and verified in this loop:
- `internal/tools.RegisterISphereFileTools(server, source)` registers `isphere_receive_files` over the same receive-message source used by receive/contact/group tools.
- `internal/mcpserver.NewServerWithReceiveSource` now exposes eight tools: four WinHelper tools plus `isphere_receive_messages`, `isphere_search_contacts`, `isphere_search_groups`, and `isphere_receive_files`.
- `scripts/verify-go-mcp.ps1` now expects eight tools, allows the file-list read tool, and verifies default empty file results plus configured synthetic file-transfer extraction.
- `isphere_receive_files` currently supports list mode only; download/cache mapping remains deferred because C12 found no message-to-cache hash link.
- Verification completed for C14 with affected package tests and `powershell -NoProfile -ExecutionPolicy Bypass -File scripts/verify-go-mcp.ps1`; full verification is run again before commit.
---
## Loop C15: Send message source evidence precheck
**Goal:** Before implementing `isphere_send_message`, identify the lowest-risk connector path and preview/audit shape from existing bridge/API, local data, UIA, or network evidence; do not implement write-capable behavior without a validated connector decision.
**Planned files:**
- Modify: `docs/source-discovery/capability-source-matrix.md`
- Modify: `docs/current-status-card.md`
- Modify: `docs/superpowers/plans/2026-07-09-stage-c-log-backed-receive-messages-loop.md`
- Optionally create a focused source-discovery note under `docs/source-discovery/` if evidence is non-trivial.
**Planned behavior:**
- Inspect existing docs/contracts and committed helper/UIA/source-discovery artifacts for a send-message source candidate.
- Rank candidate connector paths: existing bridge/API/local service, UIA draft/send path, network/protocol path, or blocked pending internal sandbox evidence.
- If a safe connector exists, write C16 around preview-first `isphere_send_message` design or implementation.
- If evidence is insufficient, mark send-message blocked on live/internal-sandbox connector evidence and choose the next read hardening node.
- [ ] **Step 1: Inspect current source evidence for send-message connector candidates**
Use committed docs and generated selector/source-discovery reports only. Do not infer a write path from unrelated read evidence.
- [ ] **Step 2: Update matrix and next loop**
Record whether send-message implementation can proceed, and rewrite C16 accordingly.
- [ ] **Step 3: Verify docs-only change and commit**
Run:
```powershell
git diff --check
go test ./...
powershell -NoProfile -ExecutionPolicy Bypass -File scripts/verify-go-mcp.ps1
```
Expected: all exit 0. Commit exact C15 paths only.
---
## Self-Review
- Spec coverage: the plan follows the user's cyclic requirement: plan first, implement one loop at a time, update the next loop after each result, and ask only on blockers.