@jaibber/sdk 0.10.2 → 0.10.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/client.d.cts CHANGED
@@ -1 +1 @@
1
- export { h as AgentApiKey, e as AgentIdentity, n as AgentPage, p as AgentPricing, q as AgentProfile, d as AgentRecord, s as AgentService, B as BoardMessagePage, C as CallInput, u as CallReceipt, v as CallResponse, w as CallResult, x as ContactPolicy, y as ConversationKind, D as DirectorySort, E as EngineFindings, z as EnsureAgentInput, G as FetchLike, K as FindAgentsOptions, b as HireBrief, N as HireCall, O as HireInput, Q as HireRecord, R as HireResult, H as HireRunRef, U as InboxConversation, V as InboxEvent, W as InboxEventPayload, I as InboxMessage, X as InboxOptions, Y as InboxResult, Z as InboxStreamOptions, $ as JaibberApiError, a0 as JaibberApiErrorInit, J as JaibberClient, a1 as JaibberClientOptions, a2 as JaibberErrorCode, a5 as MessagePage, a6 as OwnAgentProfile, a7 as OwnAgentService, a9 as PageOptions, aa as PaidToolResponse, ab as Payment, ac as PaymentChallenge, ad as PaymentRefused, ae as PersistMessagePayload, af as ProfilePost, P as Project, ag as PublicAgent, ah as PublicBoard, ai as PublicMessage, aj as PublicMessageAuthor, ak as RateInput, al as Rating, am as RatingPage, an as RatingRater, ao as ReadBoardOptions, ap as ReadMessagesOptions, aq as Readiness, ar as ReadinessStatus, as as ReadinessStep, at as ReadinessStepId, au as Receipt, av as RegisterAgentInput, aw as RegisterAgentResult, ay as RotatedApiKey, az as RunAuthorizationInput, aA as SendMessageOptions, S as ServerMessage, aB as SigningPlan, aC as StartThreadInput, aD as StartThreadResult, aE as StoredAuthorizations, aF as TRANSFER_WITH_AUTHORIZATION_TYPES, a as Task, aG as TaskChange, aJ as TaskPriority, aK as TaskStatus, aL as TaskUpdate, c as Thread, aO as ThreadLastMessage, aP as ThreadPage, aQ as ThreadParticipant, aT as TrustTier, aU as TypedDataDomain, aV as TypedDataRequest, aW as UpdateProfileInput, aX as UpdateProfileResult, aZ as UpstreamInput, a_ as UpstreamKind, a$ as UpstreamToolInfo, b0 as VerificationOutcome, b1 as VerifyDomainResult, b2 as WalletInput, b3 as WalletOptions, b4 as WhoAmI, b5 as WorkHistory, b6 as X402Signer, b7 as isBanned, b8 as isContactNotAllowed, b9 as isJaibberApiError, ba as isPaymentRequired, bb as isRateLimited, bc as paymentTermsOf, bd as signExactPayment, be as signRunAuthorizations, bf as walletFromPrivateKey } from './rest-Fnq6-XfT.cjs';
1
+ export { h as AgentApiKey, e as AgentIdentity, n as AgentPage, p as AgentPricing, q as AgentProfile, d as AgentRecord, s as AgentService, B as BoardMessagePage, C as CallInput, u as CallReceipt, v as CallResponse, w as CallResult, x as ContactPolicy, y as ConversationKind, D as DirectorySort, E as EngineFindings, z as EnsureAgentInput, G as FetchLike, K as FindAgentsOptions, b as HireBrief, N as HireCall, O as HireInput, Q as HireRecord, R as HireResult, H as HireRunRef, U as InboxConversation, V as InboxEvent, W as InboxEventPayload, I as InboxMessage, X as InboxOptions, Y as InboxResult, Z as InboxStreamOptions, $ as JaibberApiError, a0 as JaibberApiErrorInit, J as JaibberClient, a1 as JaibberClientOptions, a2 as JaibberErrorCode, a5 as MessagePage, a6 as OwnAgentProfile, a7 as OwnAgentService, a9 as PageOptions, aa as PaidToolResponse, ab as Payment, ac as PaymentChallenge, ad as PaymentRefused, ae as PersistMessagePayload, af as ProfilePost, P as Project, ag as PublicAgent, ah as PublicAgentStats, ai as PublicBoard, aj as PublicMessage, ak as PublicMessageAuthor, al as RateInput, am as Rating, an as RatingPage, ao as RatingRater, ap as ReadBoardOptions, aq as ReadMessagesOptions, ar as Readiness, as as ReadinessStatus, at as ReadinessStep, au as ReadinessStepId, av as Receipt, aw as RegisterAgentInput, ax as RegisterAgentResult, az as RotatedApiKey, aA as RunAuthorizationInput, aB as SendMessageOptions, S as ServerMessage, aC as SignedTrackRecord, aD as SigningPlan, aE as StartThreadInput, aF as StartThreadResult, aG as StoredAuthorizations, aH as TRANSFER_WITH_AUTHORIZATION_TYPES, a as Task, aI as TaskChange, aL as TaskPriority, aM as TaskStatus, aN as TaskUpdate, c as Thread, aQ as ThreadLastMessage, aR as ThreadPage, aS as ThreadParticipant, aV as TrackRecord, aW as TrustTier, aX as TypedDataDomain, aY as TypedDataRequest, aZ as UpdateProfileInput, a_ as UpdateProfileResult, b0 as UpstreamInput, b1 as UpstreamKind, b2 as UpstreamToolInfo, b3 as VerificationOutcome, b4 as VerifyDomainResult, b5 as WalletInput, b6 as WalletOptions, b7 as WhoAmI, b8 as WorkHistory, b9 as X402Signer, ba as isBanned, bb as isContactNotAllowed, bc as isJaibberApiError, bd as isPaymentRequired, be as isRateLimited, bf as paymentTermsOf, bg as signExactPayment, bh as signRunAuthorizations, bi as walletFromPrivateKey } from './rest-Wvzed43y.cjs';
package/dist/client.d.ts CHANGED
@@ -1 +1 @@
1
- export { h as AgentApiKey, e as AgentIdentity, n as AgentPage, p as AgentPricing, q as AgentProfile, d as AgentRecord, s as AgentService, B as BoardMessagePage, C as CallInput, u as CallReceipt, v as CallResponse, w as CallResult, x as ContactPolicy, y as ConversationKind, D as DirectorySort, E as EngineFindings, z as EnsureAgentInput, G as FetchLike, K as FindAgentsOptions, b as HireBrief, N as HireCall, O as HireInput, Q as HireRecord, R as HireResult, H as HireRunRef, U as InboxConversation, V as InboxEvent, W as InboxEventPayload, I as InboxMessage, X as InboxOptions, Y as InboxResult, Z as InboxStreamOptions, $ as JaibberApiError, a0 as JaibberApiErrorInit, J as JaibberClient, a1 as JaibberClientOptions, a2 as JaibberErrorCode, a5 as MessagePage, a6 as OwnAgentProfile, a7 as OwnAgentService, a9 as PageOptions, aa as PaidToolResponse, ab as Payment, ac as PaymentChallenge, ad as PaymentRefused, ae as PersistMessagePayload, af as ProfilePost, P as Project, ag as PublicAgent, ah as PublicBoard, ai as PublicMessage, aj as PublicMessageAuthor, ak as RateInput, al as Rating, am as RatingPage, an as RatingRater, ao as ReadBoardOptions, ap as ReadMessagesOptions, aq as Readiness, ar as ReadinessStatus, as as ReadinessStep, at as ReadinessStepId, au as Receipt, av as RegisterAgentInput, aw as RegisterAgentResult, ay as RotatedApiKey, az as RunAuthorizationInput, aA as SendMessageOptions, S as ServerMessage, aB as SigningPlan, aC as StartThreadInput, aD as StartThreadResult, aE as StoredAuthorizations, aF as TRANSFER_WITH_AUTHORIZATION_TYPES, a as Task, aG as TaskChange, aJ as TaskPriority, aK as TaskStatus, aL as TaskUpdate, c as Thread, aO as ThreadLastMessage, aP as ThreadPage, aQ as ThreadParticipant, aT as TrustTier, aU as TypedDataDomain, aV as TypedDataRequest, aW as UpdateProfileInput, aX as UpdateProfileResult, aZ as UpstreamInput, a_ as UpstreamKind, a$ as UpstreamToolInfo, b0 as VerificationOutcome, b1 as VerifyDomainResult, b2 as WalletInput, b3 as WalletOptions, b4 as WhoAmI, b5 as WorkHistory, b6 as X402Signer, b7 as isBanned, b8 as isContactNotAllowed, b9 as isJaibberApiError, ba as isPaymentRequired, bb as isRateLimited, bc as paymentTermsOf, bd as signExactPayment, be as signRunAuthorizations, bf as walletFromPrivateKey } from './rest-Fnq6-XfT.js';
1
+ export { h as AgentApiKey, e as AgentIdentity, n as AgentPage, p as AgentPricing, q as AgentProfile, d as AgentRecord, s as AgentService, B as BoardMessagePage, C as CallInput, u as CallReceipt, v as CallResponse, w as CallResult, x as ContactPolicy, y as ConversationKind, D as DirectorySort, E as EngineFindings, z as EnsureAgentInput, G as FetchLike, K as FindAgentsOptions, b as HireBrief, N as HireCall, O as HireInput, Q as HireRecord, R as HireResult, H as HireRunRef, U as InboxConversation, V as InboxEvent, W as InboxEventPayload, I as InboxMessage, X as InboxOptions, Y as InboxResult, Z as InboxStreamOptions, $ as JaibberApiError, a0 as JaibberApiErrorInit, J as JaibberClient, a1 as JaibberClientOptions, a2 as JaibberErrorCode, a5 as MessagePage, a6 as OwnAgentProfile, a7 as OwnAgentService, a9 as PageOptions, aa as PaidToolResponse, ab as Payment, ac as PaymentChallenge, ad as PaymentRefused, ae as PersistMessagePayload, af as ProfilePost, P as Project, ag as PublicAgent, ah as PublicAgentStats, ai as PublicBoard, aj as PublicMessage, ak as PublicMessageAuthor, al as RateInput, am as Rating, an as RatingPage, ao as RatingRater, ap as ReadBoardOptions, aq as ReadMessagesOptions, ar as Readiness, as as ReadinessStatus, at as ReadinessStep, au as ReadinessStepId, av as Receipt, aw as RegisterAgentInput, ax as RegisterAgentResult, az as RotatedApiKey, aA as RunAuthorizationInput, aB as SendMessageOptions, S as ServerMessage, aC as SignedTrackRecord, aD as SigningPlan, aE as StartThreadInput, aF as StartThreadResult, aG as StoredAuthorizations, aH as TRANSFER_WITH_AUTHORIZATION_TYPES, a as Task, aI as TaskChange, aL as TaskPriority, aM as TaskStatus, aN as TaskUpdate, c as Thread, aQ as ThreadLastMessage, aR as ThreadPage, aS as ThreadParticipant, aV as TrackRecord, aW as TrustTier, aX as TypedDataDomain, aY as TypedDataRequest, aZ as UpdateProfileInput, a_ as UpdateProfileResult, b0 as UpstreamInput, b1 as UpstreamKind, b2 as UpstreamToolInfo, b3 as VerificationOutcome, b4 as VerifyDomainResult, b5 as WalletInput, b6 as WalletOptions, b7 as WhoAmI, b8 as WorkHistory, b9 as X402Signer, ba as isBanned, bb as isContactNotAllowed, bc as isJaibberApiError, bd as isPaymentRequired, be as isRateLimited, bf as paymentTermsOf, bg as signExactPayment, bh as signRunAuthorizations, bi as walletFromPrivateKey } from './rest-Wvzed43y.js';
package/dist/client.js CHANGED
@@ -27460,15 +27460,18 @@ async function walletFromPrivateKey(privateKey) {
27460
27460
  throw new Error("Paying from a private key needs viem: npm i viem");
27461
27461
  }
27462
27462
  const account = accounts.privateKeyToAccount(privateKey);
27463
- const UINT = /* @__PURE__ */ new Set(["value", "validAfter", "validBefore"]);
27464
27463
  return {
27465
27464
  address: account.address,
27466
- signTypedData: (req) => account.signTypedData({
27467
- domain: { ...req.domain, verifyingContract: req.domain.verifyingContract },
27468
- types: req.types,
27469
- primaryType: req.primaryType,
27470
- message: Object.fromEntries(Object.entries(req.message).map(([k, v]) => [k, UINT.has(k) ? BigInt(v) : v]))
27471
- })
27465
+ signTypedData: (req) => {
27466
+ const ints = new Set((req.types[req.primaryType] ?? []).filter((f) => /^u?int\d*$/.test(f.type)).map((f) => f.name));
27467
+ const { verifyingContract, ...domain } = req.domain;
27468
+ return account.signTypedData({
27469
+ domain: verifyingContract ? { ...domain, verifyingContract } : domain,
27470
+ types: req.types,
27471
+ primaryType: req.primaryType,
27472
+ message: Object.fromEntries(Object.entries(req.message).map(([k, v]) => [k, ints.has(k) ? BigInt(v) : v]))
27473
+ });
27474
+ }
27472
27475
  };
27473
27476
  }
27474
27477
 
@@ -27963,6 +27966,14 @@ var JaibberClient = class _JaibberClient {
27963
27966
  upstream: asRecord2(upstream) ?? null
27964
27967
  };
27965
27968
  }
27969
+ /**
27970
+ * GET /api/agents/{handleOrId}/track-record — what a seller has delivered, from its receipts
27971
+ * (independent buyers only), with `attestation`: a JWS anyone can verify against `jwks`.
27972
+ */
27973
+ async getTrackRecord(handleOrId) {
27974
+ const { data } = await this.call("GET", `/api/agents/${agentRef(handleOrId)}/track-record`, { auth: false });
27975
+ return data;
27976
+ }
27966
27977
  /**
27967
27978
  * POST /api/agents/{id}/keys — rotate the agent's own key: mints a new key
27968
27979
  * with the same scopes and, with `revokeCurrent`, revokes the calling key.
@@ -28275,6 +28286,36 @@ var JaibberClient = class _JaibberClient {
28275
28286
  * rate, count toward its score (`Rating.counted`). Rating the same agent for
28276
28287
  * the same task twice → 409 CONFLICT.
28277
28288
  */
28289
+ /**
28290
+ * POST /api/receipts/{id}/rating — rate a seller with the wallet that paid for a receipt (no
28291
+ * Jaibber agent needed: buyers on the wallet route). Signs `Rating {receipt, score, text}`
28292
+ * (EIP-712, domain `Jaibber` v1 on the receipt's chain) with the client's `wallet`, which must
28293
+ * be the paying wallet. Counts like a hire's rating (paid work, one counted rating per wallet).
28294
+ */
28295
+ async rateReceipt(receiptId, input) {
28296
+ if (!this.wallet) throw new Error("rateReceipt signs with the wallet that paid: create the client with a `wallet`");
28297
+ const receipt = await this.receipt(receiptId);
28298
+ const chainId = Number(String(receipt.network).split(":")[1]);
28299
+ const text = input.text ?? "";
28300
+ const signature = await this.wallet.signer.signTypedData({
28301
+ domain: { name: "Jaibber", version: "1", chainId },
28302
+ types: { Rating: [{ name: "receipt", type: "string" }, { name: "score", type: "uint8" }, { name: "text", type: "string" }] },
28303
+ primaryType: "Rating",
28304
+ message: { receipt: receiptId, score: String(input.score), text }
28305
+ });
28306
+ const { data } = await this.call("POST", `/api/receipts/${segment(receiptId, "receiptId")}/rating`, { body: { score: input.score, text, signature } });
28307
+ return data;
28308
+ }
28309
+ /**
28310
+ * POST /api/agents/{id}/recover-handle — take the handle that is your verified domain's name
28311
+ * from a squatter (the domain must name it in /.well-known/jaibber.json or a `_jaibber` TXT
28312
+ * record). `review: true` when the holder has standing and Jaibber staff decide.
28313
+ */
28314
+ async recoverHandle(handle, opts = {}) {
28315
+ const id = opts.agentId ?? await this.myAgentId();
28316
+ const { data } = await this.call("POST", `/api/agents/${segment(id, "agentId")}/recover-handle`, { body: { handle } });
28317
+ return data;
28318
+ }
28278
28319
  async rate(handleOrId, input) {
28279
28320
  const body = { score: input.score };
28280
28321
  if (input.text) body.text = input.text;