feat: explore_api result analysis in atp-compiler - #70
Merged
Conversation
…ations/filterExploreResult)
Discovery-side counterpart to analyzeApiCalls: a client/gateway proxying a
remote ATP server it doesn't run itself can now collect the {apiGroup,
operationId} leaves in an explore_api result and narrow that result to an
allow-list, without hand-rolling ATP's directory/function shape and
/apiGroup/... path convention itself.
- collectExploreOperations / collectExploreOperationsFromValue: derive
DetectedApiCall[] from an ExploreResult (or an array of them, matching
explore_api's paths input shape).
- filterExploreResult / filterExploreResultValue: narrow a result to an
allow-list. A denied function result returns null (mirrors
ExplorerService.explore()'s own convention) rather than a synthesized
stand-in, leaving wire representation to the caller.
maslo55555
approved these changes
Aug 10, 2026
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
Adds the discovery-side counterpart to
analyzeApiCalls: a client/gateway that proxies a remote ATP server it doesn't run itself (e.g. mcp-gateway talking to hosted ATP endpoints) needs to re-check anexplore_apiresult against its own grant model before handing it to an agent. Today that means hand-rolling ATP's directory/function result shape and/apiGroup/...path convention client-side. This moves that parsing intoatp-compiler, whereanalyzeApiCallsalready lives for the mirror-image case (execute_code's request payload instead ofexplore_api's response payload).New exports (
@mondaydotcomorg/atp-compiler)collectExploreOperations(result: ExploreResult): DetectedApiCall[]— every{apiGroup, operationId}leaf reachable in a directory listing or direct function result.collectExploreOperationsFromValue(value: unknown): DetectedApiCall[]— same, over an already-JSON-parsed payload that may be a single result or an array (mirrorsexplore_api'spaths: string | string[]input).filterExploreResult(result, allowedOperations): ExploreResult | null— narrows a result to an allow-list. A denied function result returnsnullrather than a synthesized stand-in, mirroringExplorerService.explore()'s own convention in atp-server — callers decide how "not visible" should look on the wire.filterExploreResultValue(value, allowedOperations): unknown— same, over the array/single-result payload shape.Notes
DetectedApiCall(already exported fromanalyzeApiCalls) rather than introducing a parallel type, since both are the same{apiGroup, operationId}identity.analyzeApiCalls. Callers own resolving the allow-list and deciding what anullbecomes on the wire.explore_apicall into them (no eager recursion/guessing).Test plan
yarn jestinpackages/atp-compiler— 351/351 passing (15 new)yarn lint(tsc --noEmit) cleanyarn buildcleaneslint 'packages/atp-compiler/src/**/*.ts'— zero new warnings/errors (all findings pre-existing, none in the new file)prettier --checkclean🤖 Generated with Claude Code
Related: https://monday.monday.com/boards/4775886076/views/106679500/pulses/12733098176