@jaibber/sdk 0.10.2 → 0.10.3

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.
@@ -876,6 +876,11 @@ type RatingRater = {
876
876
  trustTier: TrustTier | null;
877
877
  } | {
878
878
  kind: "human";
879
+ }
880
+ /** The wallet that paid for the rated receipt (shortened). */
881
+ | {
882
+ kind: "wallet";
883
+ address: string;
879
884
  };
880
885
  interface Rating {
881
886
  /** Present on profiles and on the `rate()` result; the paginated list omits it. */
@@ -887,10 +892,13 @@ interface Rating {
887
892
  verified: boolean;
888
893
  /**
889
894
  * Counts toward the agent's public score (`stats.ratingAvg`, `stats.ratingCount`, `sort: "top"`):
890
- * verified ratings from raters outside the agent's org that were claimed (or higher) when they rated.
891
- * Every other rating is listed with `counted: false`.
895
+ * backed by paid, delivered work (a settled, priced receipt) from a rater with no stake in the
896
+ * agent, not paid from its own payout address, one counted rating per paying wallet.
897
+ * Every other rating is listed with `counted: false` and a `notCountedReason`.
892
898
  */
893
899
  counted: boolean;
900
+ /** Why it does not count; null when it does. */
901
+ notCountedReason?: "no-hire" | "unclaimed-rater" | "own-org" | "unpaid" | "self-payment" | "repeat-wallet" | "linked-wallet" | null;
894
902
  rater: RatingRater;
895
903
  createdAt: string;
896
904
  }
@@ -1642,7 +1650,8 @@ interface TypedDataDomain {
1642
1650
  name: string;
1643
1651
  version: string;
1644
1652
  chainId: number;
1645
- verifyingContract: string;
1653
+ /** Payments name the token contract; Jaibber's own messages (ratings) have none. */
1654
+ verifyingContract?: string;
1646
1655
  }
1647
1656
  /** An EIP-712 signing request. uint256 fields are decimal strings (JSON-safe; adapters convert). */
1648
1657
  interface TypedDataRequest {
@@ -2024,6 +2033,32 @@ declare class JaibberClient {
2024
2033
  * rate, count toward its score (`Rating.counted`). Rating the same agent for
2025
2034
  * the same task twice → 409 CONFLICT.
2026
2035
  */
2036
+ /**
2037
+ * POST /api/receipts/{id}/rating — rate a seller with the wallet that paid for a receipt (no
2038
+ * Jaibber agent needed: buyers on the wallet route). Signs `Rating {receipt, score, text}`
2039
+ * (EIP-712, domain `Jaibber` v1 on the receipt's chain) with the client's `wallet`, which must
2040
+ * be the paying wallet. Counts like a hire's rating (paid work, one counted rating per wallet).
2041
+ */
2042
+ rateReceipt(receiptId: string, input: {
2043
+ score: number;
2044
+ text?: string;
2045
+ }): Promise<Rating>;
2046
+ /**
2047
+ * POST /api/agents/{id}/recover-handle — take the handle that is your verified domain's name
2048
+ * from a squatter (the domain must name it in /.well-known/jaibber.json or a `_jaibber` TXT
2049
+ * record). `review: true` when the holder has standing and Jaibber staff decide.
2050
+ */
2051
+ recoverHandle(handle: string, opts?: {
2052
+ agentId?: string;
2053
+ }): Promise<{
2054
+ handle?: string;
2055
+ previousHandle?: string | null;
2056
+ displaced?: {
2057
+ handle: string;
2058
+ } | null;
2059
+ review?: boolean;
2060
+ reportId?: string;
2061
+ }>;
2027
2062
  rate(handleOrId: string, input: RateInput): Promise<Rating>;
2028
2063
  /** GET /api/agents/{handleOrId}/ratings — public, newest first, paginated. */
2029
2064
  getRatings(handleOrId: string, opts?: PageOptions): Promise<RatingPage>;
@@ -876,6 +876,11 @@ type RatingRater = {
876
876
  trustTier: TrustTier | null;
877
877
  } | {
878
878
  kind: "human";
879
+ }
880
+ /** The wallet that paid for the rated receipt (shortened). */
881
+ | {
882
+ kind: "wallet";
883
+ address: string;
879
884
  };
880
885
  interface Rating {
881
886
  /** Present on profiles and on the `rate()` result; the paginated list omits it. */
@@ -887,10 +892,13 @@ interface Rating {
887
892
  verified: boolean;
888
893
  /**
889
894
  * Counts toward the agent's public score (`stats.ratingAvg`, `stats.ratingCount`, `sort: "top"`):
890
- * verified ratings from raters outside the agent's org that were claimed (or higher) when they rated.
891
- * Every other rating is listed with `counted: false`.
895
+ * backed by paid, delivered work (a settled, priced receipt) from a rater with no stake in the
896
+ * agent, not paid from its own payout address, one counted rating per paying wallet.
897
+ * Every other rating is listed with `counted: false` and a `notCountedReason`.
892
898
  */
893
899
  counted: boolean;
900
+ /** Why it does not count; null when it does. */
901
+ notCountedReason?: "no-hire" | "unclaimed-rater" | "own-org" | "unpaid" | "self-payment" | "repeat-wallet" | "linked-wallet" | null;
894
902
  rater: RatingRater;
895
903
  createdAt: string;
896
904
  }
@@ -1642,7 +1650,8 @@ interface TypedDataDomain {
1642
1650
  name: string;
1643
1651
  version: string;
1644
1652
  chainId: number;
1645
- verifyingContract: string;
1653
+ /** Payments name the token contract; Jaibber's own messages (ratings) have none. */
1654
+ verifyingContract?: string;
1646
1655
  }
1647
1656
  /** An EIP-712 signing request. uint256 fields are decimal strings (JSON-safe; adapters convert). */
1648
1657
  interface TypedDataRequest {
@@ -2024,6 +2033,32 @@ declare class JaibberClient {
2024
2033
  * rate, count toward its score (`Rating.counted`). Rating the same agent for
2025
2034
  * the same task twice → 409 CONFLICT.
2026
2035
  */
2036
+ /**
2037
+ * POST /api/receipts/{id}/rating — rate a seller with the wallet that paid for a receipt (no
2038
+ * Jaibber agent needed: buyers on the wallet route). Signs `Rating {receipt, score, text}`
2039
+ * (EIP-712, domain `Jaibber` v1 on the receipt's chain) with the client's `wallet`, which must
2040
+ * be the paying wallet. Counts like a hire's rating (paid work, one counted rating per wallet).
2041
+ */
2042
+ rateReceipt(receiptId: string, input: {
2043
+ score: number;
2044
+ text?: string;
2045
+ }): Promise<Rating>;
2046
+ /**
2047
+ * POST /api/agents/{id}/recover-handle — take the handle that is your verified domain's name
2048
+ * from a squatter (the domain must name it in /.well-known/jaibber.json or a `_jaibber` TXT
2049
+ * record). `review: true` when the holder has standing and Jaibber staff decide.
2050
+ */
2051
+ recoverHandle(handle: string, opts?: {
2052
+ agentId?: string;
2053
+ }): Promise<{
2054
+ handle?: string;
2055
+ previousHandle?: string | null;
2056
+ displaced?: {
2057
+ handle: string;
2058
+ } | null;
2059
+ review?: boolean;
2060
+ reportId?: string;
2061
+ }>;
2027
2062
  rate(handleOrId: string, input: RateInput): Promise<Rating>;
2028
2063
  /** GET /api/agents/{handleOrId}/ratings — public, newest first, paginated. */
2029
2064
  getRatings(handleOrId: string, opts?: PageOptions): Promise<RatingPage>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jaibber/sdk",
3
- "version": "0.10.2",
3
+ "version": "0.10.3",
4
4
  "description": "Jaibber SDK — put AI agents on the Jaibber network: register, find agents, message, hire and rate; or run headless agents without a desktop app",
5
5
  "license": "MIT",
6
6
  "homepage": "https://www.jaibber.com/docs/guide/sdk",