Repository navigation
Conversation
…release 0.2.9 CLI and MCP read WBOT_API_KEY lazily from env, then the wbot auth set store (a custom Source), then the team test tenant key via latch only when WBOT_PLATFORM_URL targets the test origin. @Schema lists the sources; a missing key fails with value_unavailable before any network request.
Contributor
Author
|
Closing: wbot is out of scope for the argc value-source migration (no support / migration tracking for this tool). |
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
Migrates the platform API key lookup to
@celados/argc8.1defineValueSource(CR 8.1, celados/argc#20). This also releases 0.2.9, following the convention of earlier dependency-bump PRs (#7, #8).WBOT_API_KEYis declared once inpackages/wbot/wbot-values.ts. Sources are tried in this order:env WBOT_API_KEY: for automation and CI.wbot auth setstore ($XDG_CONFIG_HOME/wbot/credentials.json), now a customSourceinwbot-config.ts.wbot / test / platform-tenant-key. This source is used only whenWBOT_PLATFORM_URLishttps://wbot-api-test.celados.com.Other changes:
@schema,--help,auth set, and MCP startup do not touch any source. The CLI passesvalues: wbotValuestocli(), so@schemalists these sources undervalues:.createWbotPlatformClient.wbot-mcp.tsnow takes the client factory as an injected parameter and no longer imports the config module. MCP tool errors return the structured argc envelope instead of the bareDOMAIN_ERRORmessage.RUNTIME_ERRORwith a sentence. It now raisesDOMAIN_ERROR/value_unavailablewith atried:list. The store source reportsnot_configured,invalid_credentials(without echoing the file), orunreadable_credentials, each with a hint to runwbot auth set. CHANGELOG, README, and BDD are updated.wbot-config.tsstays free of runtime argc imports because@celados/argc/valuesuses theBunglobal, and vitest workers run on Node.Decisions
wbot auth setis how external users log in. Following the principle that an application owns its credentials and does not depend on latch, the store stays as the source between env and latch. The repo has no internal documentation about copying keys from Vaultwarden into the store or rendering.env, so no docs needed deleting.onlyForTestPlatform, which reports a miss withnot_test_platformfor any other target. A production call therefore never gets the test key, and external users never run latch. If latch is not installed, the source simply reports a miss.WBOT_API_KEYuses the vault key instead.@schemaandvalue_unavailableshow the vault item id and name. These are not secrets, but they appear in a public client.Test plan
bun run check,bun run typecheck,bun run test(120 passed),bun run verify:package(0.2.9 artifact),bun test packages/wbot/scriptsAuthorizationheader on a fake server); the latch source is reached only on the test target (NODE_ENV=test, so latch is never actually called);@schemalistsvalues:.$TMPDIR, with an emptyXDG_CONFIG_HOMEand noWBOT_API_KEY, ranWBOT_PLATFORM_URL=https://wbot-api-test.celados.com wbot conversations.list '{"limit":1}'. It succeeded with the key from latch's agent profile. MCPlist_conversationssucceeded the same way.