Feat/examples helpers#10
Open
Ang-dot wants to merge 11 commits into
Open
Conversation
Plan covers a runnable src/examples/helpers/acpHelperFunctions.ts that exercises every public read API on AcpAgent, AcpJobApi, AcpChatTransport, and JobSession — a v2 analog of v1's examples/acp-base/helpers/ reference. Co-authored-by: Cursor <cursoragent@cursor.com>
Scaffolds src/examples/helpers/ as a runnable cheat-sheet of the SDK's public read APIs, modeled on Virtual-Protocol/acp-node v1's examples/acp-base/helpers/ reference. Co-authored-by: Cursor <cursoragent@cursor.com>
Sets up the script's skeleton: env loading, agent creation, the subsection() formatter, and a guarded main() that always calls agent.stop() before exit. Subsections are added in follow-up commits. Co-authored-by: Cursor <cursoragent@cursor.com>
Demonstrates getAddress, getSupportedChainIds, getMe, getAgentByWalletAddress, and browseAgents. The seller-lookup branch is guarded behind SELLER_WALLET_ADDRESS so the script runs without it. Co-authored-by: Cursor <cursoragent@cursor.com>
Walks through agent.getApi().getActiveJobs(), per-job agent.getApi().getJob(chainId, jobId), and agent.getTransport().getHistory(chainId, jobId) — the v2 analog of v1's getActiveJobs / getJobById / getMemoById trio (memos became unified JobRoomEntry history in v2). Co-authored-by: Cursor <cursoragent@cursor.com>
Calls agent.start() to populate agent.sessions, then exercises every public read on JobSession: status, roles, entries, availableTools(), fetchJob(), toContext(), toMessages(). agent.stop() in the finally block keeps SSE cleanup tight. Co-authored-by: Cursor <cursoragent@cursor.com>
Adds a guarded subsection covering getProposedSubscriptionTerms, getSubscriptionExpiry, and isSubscriptionActive. Skipped cleanly when no subscription-hook session is in scope so non-subscription wallets aren't penalized. Co-authored-by: Cursor <cursoragent@cursor.com>
Adds a subsection exercising agent.resolveAssetToken and agent.resolveRawAssetToken — the path devs need when handling tokens beyond AssetToken.usdc(...). Skipped cleanly when no token-bearing session is in scope. Co-authored-by: Cursor <cursoragent@cursor.com>
Adds helpers/ to the variants table and a short pointer paragraph explaining when to use the read-API showcase script. Co-authored-by: Cursor <cursoragent@cursor.com>
…stic - Fix runtime bug: AcpJob has `id: bigint`, not `jobId`. The subscription subsection now logs `subscriptionSession.jobId` (the JobSession's string id) instead of `job.jobId` which would print "undefined". - Tighten the subscription-session heuristic to prefer the strict `clientSubscription != null` signal, falling back to the prior hookConfigs / env-override checks. - Document a file-scoped tsc command in the helpers README, since the repo's root tsconfig excludes src/examples from --noEmit checks. - Fix two minor "Expected output" drifts in the helpers README to match the script's actual subsection title and per-session output shape. Surfaced by the final code-quality review (the masked tsc bug went nine commits unflagged because the root tsconfig exclude meant tsc never compiled the new file). Co-authored-by: Cursor <cursoragent@cursor.com>
Mirror the AcpJob.id vs job.jobId fix and the tightened subscription heuristic into the plan doc, and update Task 9's verification step to use a file-scoped tsc invocation that actually type-checks src/examples/helpers/acpHelperFunctions.ts (the root tsconfig excludes src/examples* from --noEmit). Co-authored-by: Cursor <cursoragent@cursor.com>
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.
No description provided.