| saw_name | [SAW:wave1:agent-E] Part 1: Intent aliases (cmd/agent-lsp/tools_aliases.go) |
|---|
IMPL Doc: /Users/dayna.blackwell/code/agent-lsp/docs/IMPL/IMPL-agent-dx-improvements.yaml
cmd/agent-lsp/tools_aliases.gocmd/agent-lsp/tools_analysis.go
Part 1: Intent aliases (cmd/agent-lsp/tools_aliases.go)
Create a new file registering alias tool names. Use addToolWithPhaseCheck.
Aliases:
blast_radius-> same handler asget_change_impact(GetChangeImpactArgs)callers-> wraps find_callers, forces direction="incoming"explore-> callstools.HandleExploreSymbol(GetInfoOnLocationArgs)safe_edit-> callstools.HandleSafeApplyEdit(SafeApplyEditArgs)
Define registerAliasTools(d toolDeps).
Note: tools.HandleExploreSymbol and tools.HandleSafeApplyEdit are created by
Agents B and C. Code compiles only after merge. Write correct references.
Part 2: Add indexed field to analysis responses (cmd/agent-lsp/tools_analysis.go)
Modify 3 tool handler wrappers to call tools.AppendIndexedField:
get_change_impactfind_referencesfind_symbol
Change pattern:
r, err := tools.HandleGetChangeImpact(ctx, d.cs.get(), toolArgsToMap(args))
r = tools.AppendIndexedField(r, d.cs.get())
return makeCallToolResult(r), nil, errNote: tools.AppendIndexedField is created by Agent A. Compiles after merge.
go vet ./cmd/agent-lsp/ 2>&1 || truePostconditions:
grep -c "blast_radius\|\"callers\"\|\"explore\"\|\"safe_edit\"" cmd/agent-lsp/tools_aliases.go
# Expected: >= 4
grep -c "AppendIndexedField" cmd/agent-lsp/tools_analysis.go
# Expected: >= 3
grep -c "func registerAliasTools" cmd/agent-lsp/tools_aliases.go
# Expected: 1- Do NOT modify cmd/agent-lsp/tools_navigation.go
- Do NOT modify internal/tools/ files
- Do NOT modify cmd/agent-lsp/server.go (Wave 2)
- Do NOT modify files outside your ownership list
Helper function that appends an "indexed" boolean field to tool response JSON. Queries the LSP client's IsWorkspaceLoaded() and injects the field into the response content's JSON object.
func AppendIndexedField(result types.ToolResult, client *lsp.LSPClient) types.ToolResult
Composite handler combining inspect_symbol + find_callers + get_symbol_source + find_references into one call. Returns structured JSON with sections: type_info, source, callers, references, test_callers.
func HandleExploreSymbol(ctx context.Context, client *lsp.LSPClient, args map[string]any) (types.ToolResult, error)
Combines preview_edit + apply_edit when net_delta == 0. Returns applied=true on success or applied=false with preview diagnostics when net_delta > 0.
func HandleSafeApplyEdit(ctx context.Context, client *lsp.LSPClient, sessionMgr *session.SessionManager, args map[string]any) (types.ToolResult, error)
Internal helper that retrieves diagnostics for a file and returns error/warning counts. Used by symbol_edit handlers to auto-append diagnostic counts after edits.
func getDiagnosticsForFile(ctx context.Context, client *lsp.LSPClient, filePath string) (errors int, warnings int)
Level: standard
- build:
go build ./...(required: true) - lint:
go vet ./...(required: true) - test:
go test ./internal/... ./cmd/...(required: true)