Repository navigation
Support Kernel wallet payment methods and payment_request items - #261
Draft
hiroTamada wants to merge 1 commit into
Draft
hiroTamada wants to merge 1 commit into
hiroTamada wants to merge 1 commit into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch had an error being 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.
Warning
Blocked on the
@onkernel/sdk0.133.0 release. This code is written against the 0.133.0 types, but 0.133.0 is not published yet;package.jsonandbun.lockstill pin 0.132.0. A git pin to the release PR head does not install cleanly with bun (the SDK'spreparebuild is skipped, so the package has nodist/), so the dependency is left unchanged. Until the bump, CI's Type check fails on the new SDK types (payment_requestitems, theadd_payment_method/remove_payment_methodoperation params); tests pass on both versions. Before merge:bun add @onkernel/sdk@0.133.0, commitpackage.json+bun.lock, and re-run CI.Summary
The Kernel API now supports multiple cards per Kernel wallet and
payment_requestpurchase items, gated per organization. This updates the vault tools to match, keeping the original single-card Kernel wallet contract working for organizations without the flags.Wallets (
manage_vault_wallets)add_payment_methodandremove_payment_method(withpayment_method_id) actions. Each one fetches the wallet first and submits only if it is a Kernel wallet that advertises the operation, matching howauthorizeworks inmanage_vault_cards. The result returns the projected payment method or removal status, apayment_methodsobservation hint, and guidance.add_payment_methodreturns thecard_enrollmenturl, but the embeddedcapture_tokenis still never returned.insufficient_scope, 409purchase_unresolved/provider_revocation_pendingand 429Retry-Afterpass through.vaults:write.destructiveHintis nowtrue, because removal deletes a stored card.Cards (
manage_vault_cards)item_type(cardby default, orpayment_request) for create/update. Link and Kernel can createpayment_requestitems; AgentCard is refused locally. Updates to a payment request sendtype: payment_request; card updates still omittype.payment_method_id. If omitted, the API selects the default cardcardand never another card. A Kernelpayment_requestrequires it.authorizealso acceptspayment_requestitems.Responses and
manage_vault_itemsstatus,status_reason,expires_atandaction(name,url,expires_at, withoutcapture_token). Item state projectspayment_method_idandfunding_status. Event data projectsitem_type,providerandpayment_method_id_present.payment_methodandpayment_method_id, so invokingadd_payment_method/remove_payment_methodthroughmanage_vault_itemsrenders and gets guidance.payment_requestitems are treated like cards in guidance, invocation hints, recovery_required handling, Link authorize error mapping and theconfirm_transactionamount/currency check.remove_payment_methodhint listsrequired_inputs: ["payment_method_id"].reconnect_requiredwallets refuse payment and deletion until upgraded, per the current API description. Kernel purchase guidance explainsfunding_status.docs/vault-payments.md.Entitlements, tool names, registration, analytics and deprecated-params handling do not enumerate vault operations or item types, so they are unchanged.
Tests
Run locally with
@onkernel/sdk0.133.0 built from the release PR head and swapped intonode_modules, without committing it:bunx tsc --noEmit --incremental false: passes on 0.133.0. On the pinned 0.132.0 it fails only where the new SDK types are used.bun test: 1161 pass, 0 fail on both 0.133.0 and 0.132.0.bun run check:managed-auth-app: passes.bunx prettier --checkon changed files: passes. Repo-widebun run format:checkfails only onAGENTS.md, which this PR does not touch.git diff --check: clean.bun run lintwas not run; it is broken under Next.js 16 perAGENTS.md.Not run: no live MCP calls against the Kernel API with the flags on.