Repository navigation
feat(cli): add beam project call - #4897
Open
ali-beamable wants to merge 1 commit into
Open
ali-beamable wants to merge 1 commit into
ali-beamable wants to merge 1 commit into
Conversation
Calling a [ClientCallable] endpoint as a player used to need a game
client or a browser. `beam project call <service> <method>` POSTs the
--payload JSON object to /basic/{cid}.{pid}.micro_{service}/{method}
with X-BEAM-SCOPE and the player's bearer token, matching the web SDK's
makeMicroServiceRequest.
--as guest (default) creates a new guest; any other value is exchanged
as a player refresh token. --target local sends this machine's routing
key (micro_{service}:{key}), remote sends none, and auto (default)
discovers a locally running instance for a second and uses its routing
key, falling back to the deployed service.
The result carries status, body, target, routingKey, url, playerId and
the refreshToken to reuse the same player. A non-2xx response is still
reported, then the command exits non-zero. An invalid --payload fails
before any guest is created. Covered by ProjectCallFlows; Unity bindings and
changelog are updated.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SR1QFkbVnMgqpzAeej2HHv
Contributor
|
Lightbeam link |
This branch has not been deployed
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.
Ticket
None. This comes from an agent-friendliness review of building a web game with the CLI and Web SDK.
Brief Description
The command is
beam project call <Service> <Method> [--payload <json>] [--as guest|<refresh-token>] [--target auto|local|remote]. It calls a[ClientCallable]endpoint as a player, so an agent can play a whole match from the CLI instead of automating a browser.POST /basic/{cid}.{pid}.micro_{service}/{method}withX-BEAM-SCOPEand the player's bearer token, matching the Web SDK'smakeMicroServiceRequest.--payloadmust be a JSON object keyed by parameter name (default{}). It is validated before any guest is created.--as:guest(the default) creates a new guest player. Anything else is exchanged as a player refresh token.--target:localsends this machine's routing key.remotesends none, so the call goes to the deployed service.auto(the default) looks for about 1s for a locally running instance and uses it if found, otherwise the deployed service.status,body,target,routingKey,url,playerId, andrefreshToken(pass it to--asto stay the same player). A non-2xx response is reported, then the command exits non-zero.MicroserviceHttpCallerservice, becauseCliRequesteralways signs as the CLI's admin user and can't use a player token.generate-interface.Checklist
Notes
ProjectCallFlowscovers a guest call with the route, payload and headers; a refresh token with local routing; a non-2xx status; invalid payloads; and the route/header builders.autodiscovery path, and calls against a live realm or a running service.🤖 Generated with Claude Code
https://claude.ai/code/session_01SR1QFkbVnMgqpzAeej2HHv
Generated by Claude Code