refactor: Normalize tool file and export names to match tool names#1024
Draft
jirispilka wants to merge 3 commits into
Draft
refactor: Normalize tool file and export names to match tool names#1024jirispilka wants to merge 3 commits into
jirispilka wants to merge 3 commits into
Conversation
d099543 to
8ea4493
Compare
Each tool carried three vocabularies: file name, export const, and the wire tool name. Collapse to one derived from the wire name — file = snake_case of the wire name, export = camelCase of the wire name with no `Tool` suffix. Wire contract (HelperTools enum values) is untouched, so this is renames only with no behavior change. Renames the three `*_collection.ts` files to their tool names and normalizes the ToolEntry exports (`addTool`→`addActor`, `getUser*List`→ `get*List`, dropped `Tool`/`default`/`apps` prefixes, call-actor pair → `callActorDefault`/`callActorApps`). `index_internals.ts` re-exports `addActor` directly; coordinated in lockstep with apify-mcp-server-internal. `getActorRunLog` is left as-is: its wire name is the frozen, out-of-scope enum value `get-actor-log`, so applying the rule would produce a name the issue never listed. Private zod schema consts are out of scope (export and file names only). Closes #977. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YEYUpGUBagZi4m14YbyJua
The internals export was renamed addTool -> addActor. apify-mcp-server-internal still imports addTool from a pinned published version, so re-export addActor as addTool to keep that consumer building. Decouples the two repos' merges; remove the alias once internal migrates off addTool. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YEYUpGUBagZi4m14YbyJua
Rebase onto master picked up tools.add_actor.test.ts and three new cases in tools.get_actor_run.response.test.ts that still referenced the old export names. Update them to addActor / getActorRun. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YEYUpGUBagZi4m14YbyJua
0314831 to
d8f222c
Compare
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.
What we're solving
Each tool carried three vocabularies — file name, export const, and the wire tool name (the only name users see). E.g.
dataset_collection.tsexportedgetUserDatasetsListfor the toolget-dataset-list, and export suffixes were inconsistent (...Toolsometimes, bare otherwise). This collapses all three to one vocabulary derived from the wire name. Closes #977.How
Pure rename, no behavior change. File = snake_case of the wire name; export = camelCase of the wire name with no
Toolsuffix.HelperToolsenum values (the wire contract) are untouched.git mvthe three*_collection.tsfiles →get_dataset_list.ts,get_key_value_store_list.ts,get_actor_run_list.ts(+ matching test files).ToolEntryexports:addTool→addActor,getUser*List→get*List, dropTool/default/appsprefixes on single-variant exports, and name the two-variant call-actor paircallActorDefault/callActorApps.index_internals.tsexportsaddActor(canonical) and re-exports it as a deprecatedaddToolalias, soapify-mcp-server-internalkeeps building against its pinned published version. The alias decouples the two repos' merges and is removed once internal migrates offaddTool(companion PR updates its integration suite).Rebased onto
master; the domain regroup (#1019) is already merged, so this diff is the rename only.Alternatives considered
apify-mcp-server-internalto bump the package version and switch imports in the same release window. Chose the deprecatedaddToolalias instead so the two repos merge independently and internal migrates on its own schedule.getActorRunLog/get_actor_run_log.ts. Left as-is: its wire name is the frozen, out-of-scope enum valueget-actor-log, so applying the rule strictly would producegetActorLog— a name the issue never listed and that reads worse. Flagged separately.getUserDatasetsListArgs,addToolArgsSchema, etc.). Out of scope: the issue coversToolEntryexport names and file names only.Verification
pnpm run type-check,lint,test:unit(968 pass),check:agents,formatall green after rebasing ontomaster. Wire names are untouched — an earlier mcpc probe of both stdio sessions confirmed all tool names unchanged and no behavior change.🤖 Generated with Claude Code
https://claude.ai/code/session_01YEYUpGUBagZi4m14YbyJua
Generated by Claude Code