feat(cli): add oxlint and adopt authoritative SDK types#21
Merged
LucasRoesler merged 7 commits intomainfrom Feb 26, 2026
Merged
feat(cli): add oxlint and adopt authoritative SDK types#21LucasRoesler merged 7 commits intomainfrom
LucasRoesler merged 7 commits intomainfrom
Conversation
Replace hand-rolled SDK types with the upstream package types. Key changes: PermissionResult gains interrupt/updatedPermissions fields; SDKResultMessage is split into SDKResultSuccess and SDKResultError; SDKSystemMessage now has required fields; new message types added (SDKStatusMessage, SDKCompactBoundaryMessage, etc.); CanUseTool callback receives full context (suggestions, blockedPath, toolUseID, agentID); canCallTool renamed to canUseTool; permissionHandler gains cancelPendingWithInterrupt().
Adds oxlint as a dev dependency in the CLI workspace with a `lint` script. Wires it into the root package.json and the CI test workflow so it runs on every PR after typecheck. Fixes all 49 violations reported by the initial run: unused imports, unused variables, dead code (codexRemoteLauncher helpers, formatAskUserQuestionAnswers), unnecessary spread fallbacks, and two no-control-regex suppressions for legitimate terminal escape sequences.
- QueryPrompt: narrow AsyncIterable<SDKMessage> to AsyncIterable<SDKUserMessage> to match the actual constraint of the SDK query() function - SDKControlResponse: add missing response? field to match the wire format - claudeRemote: fix misleading comment on the SDKMessage cast
5d7026e to
3811e4f
Compare
Switches from `runner start` (detaches as daemon) to `runner start-sync` (foreground) run as a background job, so both server and runner PIDs are tracked and killed cleanly on Ctrl+C without needing `runner stop`.
LucasRoesler
commented
Feb 24, 2026
Inline type imports (import('pkg').Type) in interface/type positions are
an anti-pattern. Hoists all occurrences to explicit top-level import type
statements for clarity and consistency.
…er objects - ClaudeRemoteOptions: extracts the claudeRemote() opts parameter (9 fields) - CanCallTool: names the HAPI-specific canCallTool signature (CanUseTool + EnhancedMode) - SessionOptions: extracts the Session constructor opts (17 fields) - LocalRemoteLoopOptions / LocalRemoteSessionOptions: extracts the two overlapping loop opts types in loopBase.ts, sharing fields via extension - permissionHandler.handleToolCall: replaces the 6-field inline options object with Parameters<CanUseTool>[2], referencing the SDK type directly
- Replace Record<string, any> for mcpServers with McpServerConfig from the SDK (5 occurrences: loop.ts, session.ts x2, claudeRemote.ts, claudeLocal.ts); re-export McpServerConfig from sdk/types.ts and index.ts - Extract ClaudeLocalOptions interface from claudeLocal.ts inline opts - Extract BuildSessionMetadataOptions from sessionFactory.ts inline opts - Extract GetOrCreateSessionOptions and GetOrCreateMachineOptions from ApiClient method signatures in api.ts - Fix runLocalRemoteSession to use destructuring rest instead of manually re-spreading all 5 inherited fields from LocalRemoteLoopOptions - Replace console.log with logger.debug in sessionFactory.bootstrapSession
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
@anthropic-ai/claude-agent-sdkto replace hand-rolled SDK type definitions, keeping HAPI in sync with the upstream CLI wire formatoxlintto the CLI workspace and wires it into CI (test.yml) so it runs on every PR aftertypecheckTest plan
bun run typecheckpassesbun run lintpasses with 0 warnings and 0 errorsbun run testpasses (183 tests, 0 failures)Testsjob passes with the new lint step