Skip to content

Feat/examples helpers#10

Open
Ang-dot wants to merge 11 commits into
mainfrom
feat/examples-helpers
Open

Feat/examples helpers#10
Ang-dot wants to merge 11 commits into
mainfrom
feat/examples-helpers

Conversation

@Ang-dot
Copy link
Copy Markdown
Contributor

@Ang-dot Ang-dot commented May 7, 2026

No description provided.

Ang-dot and others added 11 commits May 7, 2026 16:35
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant