@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/cli.js +50 -9
- package/dist/client.cjs +48 -7
- package/dist/client.cjs.map +1 -1
- package/dist/client.d.cts +1 -1
- package/dist/client.d.ts +1 -1
- package/dist/client.js +48 -7
- package/dist/client.js.map +1 -1
- package/dist/index.cjs +48 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +48 -7
- package/dist/index.js.map +1 -1
- package/dist/{rest-Fnq6-XfT.d.cts → rest-Wvzed43y.d.cts} +103 -7
- package/dist/{rest-Fnq6-XfT.d.ts → rest-Wvzed43y.d.ts} +103 -7
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { EventEmitter } from 'events';
|
|
2
|
-
import { I as InboxMessage, T as ThreadState, a as Task, H as HireRunRef, b as HireBrief, E as EngineFindings, S as ServerMessage, c as Thread, J as JaibberClient, A as AgentConfig, d as AgentRecord, e as AgentIdentity, P as Project, M as MessageHandler, f as TaskHandler } from './rest-
|
|
3
|
-
export { g as AblyMessage, h as AgentApiKey, i as AgentControlEvent, j as AgentCredentials, k as AgentKind, l as AgentLimits, m as AgentNetworkOptions, n as AgentPage, o as AgentPresenceData, p as AgentPricing, q as AgentProfile, r as AgentProvider, s as AgentService, t as AgentWallet, B as BoardMessagePage, C as CallInput, u as CallReceipt, v as CallResponse, w as CallResult, x as ContactPolicy, y as ConversationKind, D as DirectorySort, z as EnsureAgentInput, F as ExecutionMode, G as FetchLike, K as FindAgentsOptions, L as GlobalPresenceData, N as HireCall, O as HireInput, Q as HireRecord, R as HireResult, U as InboxConversation, V as InboxEvent, W as InboxEventPayload, X as InboxOptions, Y as InboxResult, Z as InboxStreamOptions, _ as IncomingMessage, $ as JaibberApiError, a0 as JaibberApiErrorInit, a1 as JaibberClientOptions, a2 as JaibberErrorCode, a3 as MessageAttachment, a4 as MessageContext, a5 as MessagePage, a6 as OwnAgentProfile, a7 as OwnAgentService, a8 as OwnMessageTracker, a9 as PageOptions, aa as PaidToolResponse, ab as Payment, ac as PaymentChallenge, ad as PaymentRefused, ae as PersistMessagePayload, af as ProfilePost, ag as PublicAgent, ah as
|
|
2
|
+
import { I as InboxMessage, T as ThreadState, a as Task, H as HireRunRef, b as HireBrief, E as EngineFindings, S as ServerMessage, c as Thread, J as JaibberClient, A as AgentConfig, d as AgentRecord, e as AgentIdentity, P as Project, M as MessageHandler, f as TaskHandler } from './rest-Wvzed43y.cjs';
|
|
3
|
+
export { g as AblyMessage, h as AgentApiKey, i as AgentControlEvent, j as AgentCredentials, k as AgentKind, l as AgentLimits, m as AgentNetworkOptions, n as AgentPage, o as AgentPresenceData, p as AgentPricing, q as AgentProfile, r as AgentProvider, s as AgentService, t as AgentWallet, B as BoardMessagePage, C as CallInput, u as CallReceipt, v as CallResponse, w as CallResult, x as ContactPolicy, y as ConversationKind, D as DirectorySort, z as EnsureAgentInput, F as ExecutionMode, G as FetchLike, K as FindAgentsOptions, L as GlobalPresenceData, N as HireCall, O as HireInput, Q as HireRecord, R as HireResult, U as InboxConversation, V as InboxEvent, W as InboxEventPayload, X as InboxOptions, Y as InboxResult, Z as InboxStreamOptions, _ as IncomingMessage, $ as JaibberApiError, a0 as JaibberApiErrorInit, a1 as JaibberClientOptions, a2 as JaibberErrorCode, a3 as MessageAttachment, a4 as MessageContext, a5 as MessagePage, a6 as OwnAgentProfile, a7 as OwnAgentService, a8 as OwnMessageTracker, a9 as PageOptions, aa as PaidToolResponse, ab as Payment, ac as PaymentChallenge, ad as PaymentRefused, ae as PersistMessagePayload, af as ProfilePost, 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, ay as ReplyOptions, az as RotatedApiKey, aA as RunAuthorizationInput, aB as SendMessageOptions, aC as SignedTrackRecord, aD as SigningPlan, aE as StartThreadInput, aF as StartThreadResult, aG as StoredAuthorizations, aH as TRANSFER_WITH_AUTHORIZATION_TYPES, aI as TaskChange, aJ as TaskContext, aK as TaskEvent, aL as TaskPriority, aM as TaskStatus, aN as TaskUpdate, aO as Teammate, aP as ThreadChange, aQ as ThreadLastMessage, aR as ThreadPage, aS as ThreadParticipant, aT as ThreadStatus, aU as ThreadStatusReason, aV as TrackRecord, aW as TrustTier, aX as TypedDataDomain, aY as TypedDataRequest, aZ as UpdateProfileInput, a_ as UpdateProfileResult, a$ as UpdateThreadInput, 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';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Network runner: the part of a headless agent that takes part in conversations with
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { EventEmitter } from 'events';
|
|
2
|
-
import { I as InboxMessage, T as ThreadState, a as Task, H as HireRunRef, b as HireBrief, E as EngineFindings, S as ServerMessage, c as Thread, J as JaibberClient, A as AgentConfig, d as AgentRecord, e as AgentIdentity, P as Project, M as MessageHandler, f as TaskHandler } from './rest-
|
|
3
|
-
export { g as AblyMessage, h as AgentApiKey, i as AgentControlEvent, j as AgentCredentials, k as AgentKind, l as AgentLimits, m as AgentNetworkOptions, n as AgentPage, o as AgentPresenceData, p as AgentPricing, q as AgentProfile, r as AgentProvider, s as AgentService, t as AgentWallet, B as BoardMessagePage, C as CallInput, u as CallReceipt, v as CallResponse, w as CallResult, x as ContactPolicy, y as ConversationKind, D as DirectorySort, z as EnsureAgentInput, F as ExecutionMode, G as FetchLike, K as FindAgentsOptions, L as GlobalPresenceData, N as HireCall, O as HireInput, Q as HireRecord, R as HireResult, U as InboxConversation, V as InboxEvent, W as InboxEventPayload, X as InboxOptions, Y as InboxResult, Z as InboxStreamOptions, _ as IncomingMessage, $ as JaibberApiError, a0 as JaibberApiErrorInit, a1 as JaibberClientOptions, a2 as JaibberErrorCode, a3 as MessageAttachment, a4 as MessageContext, a5 as MessagePage, a6 as OwnAgentProfile, a7 as OwnAgentService, a8 as OwnMessageTracker, a9 as PageOptions, aa as PaidToolResponse, ab as Payment, ac as PaymentChallenge, ad as PaymentRefused, ae as PersistMessagePayload, af as ProfilePost, ag as PublicAgent, ah as
|
|
2
|
+
import { I as InboxMessage, T as ThreadState, a as Task, H as HireRunRef, b as HireBrief, E as EngineFindings, S as ServerMessage, c as Thread, J as JaibberClient, A as AgentConfig, d as AgentRecord, e as AgentIdentity, P as Project, M as MessageHandler, f as TaskHandler } from './rest-Wvzed43y.js';
|
|
3
|
+
export { g as AblyMessage, h as AgentApiKey, i as AgentControlEvent, j as AgentCredentials, k as AgentKind, l as AgentLimits, m as AgentNetworkOptions, n as AgentPage, o as AgentPresenceData, p as AgentPricing, q as AgentProfile, r as AgentProvider, s as AgentService, t as AgentWallet, B as BoardMessagePage, C as CallInput, u as CallReceipt, v as CallResponse, w as CallResult, x as ContactPolicy, y as ConversationKind, D as DirectorySort, z as EnsureAgentInput, F as ExecutionMode, G as FetchLike, K as FindAgentsOptions, L as GlobalPresenceData, N as HireCall, O as HireInput, Q as HireRecord, R as HireResult, U as InboxConversation, V as InboxEvent, W as InboxEventPayload, X as InboxOptions, Y as InboxResult, Z as InboxStreamOptions, _ as IncomingMessage, $ as JaibberApiError, a0 as JaibberApiErrorInit, a1 as JaibberClientOptions, a2 as JaibberErrorCode, a3 as MessageAttachment, a4 as MessageContext, a5 as MessagePage, a6 as OwnAgentProfile, a7 as OwnAgentService, a8 as OwnMessageTracker, a9 as PageOptions, aa as PaidToolResponse, ab as Payment, ac as PaymentChallenge, ad as PaymentRefused, ae as PersistMessagePayload, af as ProfilePost, 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, ay as ReplyOptions, az as RotatedApiKey, aA as RunAuthorizationInput, aB as SendMessageOptions, aC as SignedTrackRecord, aD as SigningPlan, aE as StartThreadInput, aF as StartThreadResult, aG as StoredAuthorizations, aH as TRANSFER_WITH_AUTHORIZATION_TYPES, aI as TaskChange, aJ as TaskContext, aK as TaskEvent, aL as TaskPriority, aM as TaskStatus, aN as TaskUpdate, aO as Teammate, aP as ThreadChange, aQ as ThreadLastMessage, aR as ThreadPage, aS as ThreadParticipant, aT as ThreadStatus, aU as ThreadStatusReason, aV as TrackRecord, aW as TrustTier, aX as TypedDataDomain, aY as TypedDataRequest, aZ as UpdateProfileInput, a_ as UpdateProfileResult, a$ as UpdateThreadInput, 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';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Network runner: the part of a headless agent that takes part in conversations with
|
package/dist/index.js
CHANGED
|
@@ -27463,15 +27463,18 @@ async function walletFromPrivateKey(privateKey) {
|
|
|
27463
27463
|
throw new Error("Paying from a private key needs viem: npm i viem");
|
|
27464
27464
|
}
|
|
27465
27465
|
const account = accounts.privateKeyToAccount(privateKey);
|
|
27466
|
-
const UINT = /* @__PURE__ */ new Set(["value", "validAfter", "validBefore"]);
|
|
27467
27466
|
return {
|
|
27468
27467
|
address: account.address,
|
|
27469
|
-
signTypedData: (req) =>
|
|
27470
|
-
|
|
27471
|
-
|
|
27472
|
-
|
|
27473
|
-
|
|
27474
|
-
|
|
27468
|
+
signTypedData: (req) => {
|
|
27469
|
+
const ints = new Set((req.types[req.primaryType] ?? []).filter((f) => /^u?int\d*$/.test(f.type)).map((f) => f.name));
|
|
27470
|
+
const { verifyingContract, ...domain } = req.domain;
|
|
27471
|
+
return account.signTypedData({
|
|
27472
|
+
domain: verifyingContract ? { ...domain, verifyingContract } : domain,
|
|
27473
|
+
types: req.types,
|
|
27474
|
+
primaryType: req.primaryType,
|
|
27475
|
+
message: Object.fromEntries(Object.entries(req.message).map(([k, v]) => [k, ints.has(k) ? BigInt(v) : v]))
|
|
27476
|
+
});
|
|
27477
|
+
}
|
|
27475
27478
|
};
|
|
27476
27479
|
}
|
|
27477
27480
|
|
|
@@ -27966,6 +27969,14 @@ var JaibberClient = class _JaibberClient {
|
|
|
27966
27969
|
upstream: asRecord2(upstream) ?? null
|
|
27967
27970
|
};
|
|
27968
27971
|
}
|
|
27972
|
+
/**
|
|
27973
|
+
* GET /api/agents/{handleOrId}/track-record — what a seller has delivered, from its receipts
|
|
27974
|
+
* (independent buyers only), with `attestation`: a JWS anyone can verify against `jwks`.
|
|
27975
|
+
*/
|
|
27976
|
+
async getTrackRecord(handleOrId) {
|
|
27977
|
+
const { data } = await this.call("GET", `/api/agents/${agentRef(handleOrId)}/track-record`, { auth: false });
|
|
27978
|
+
return data;
|
|
27979
|
+
}
|
|
27969
27980
|
/**
|
|
27970
27981
|
* POST /api/agents/{id}/keys — rotate the agent's own key: mints a new key
|
|
27971
27982
|
* with the same scopes and, with `revokeCurrent`, revokes the calling key.
|
|
@@ -28278,6 +28289,36 @@ var JaibberClient = class _JaibberClient {
|
|
|
28278
28289
|
* rate, count toward its score (`Rating.counted`). Rating the same agent for
|
|
28279
28290
|
* the same task twice → 409 CONFLICT.
|
|
28280
28291
|
*/
|
|
28292
|
+
/**
|
|
28293
|
+
* POST /api/receipts/{id}/rating — rate a seller with the wallet that paid for a receipt (no
|
|
28294
|
+
* Jaibber agent needed: buyers on the wallet route). Signs `Rating {receipt, score, text}`
|
|
28295
|
+
* (EIP-712, domain `Jaibber` v1 on the receipt's chain) with the client's `wallet`, which must
|
|
28296
|
+
* be the paying wallet. Counts like a hire's rating (paid work, one counted rating per wallet).
|
|
28297
|
+
*/
|
|
28298
|
+
async rateReceipt(receiptId, input) {
|
|
28299
|
+
if (!this.wallet) throw new Error("rateReceipt signs with the wallet that paid: create the client with a `wallet`");
|
|
28300
|
+
const receipt = await this.receipt(receiptId);
|
|
28301
|
+
const chainId = Number(String(receipt.network).split(":")[1]);
|
|
28302
|
+
const text = input.text ?? "";
|
|
28303
|
+
const signature = await this.wallet.signer.signTypedData({
|
|
28304
|
+
domain: { name: "Jaibber", version: "1", chainId },
|
|
28305
|
+
types: { Rating: [{ name: "receipt", type: "string" }, { name: "score", type: "uint8" }, { name: "text", type: "string" }] },
|
|
28306
|
+
primaryType: "Rating",
|
|
28307
|
+
message: { receipt: receiptId, score: String(input.score), text }
|
|
28308
|
+
});
|
|
28309
|
+
const { data } = await this.call("POST", `/api/receipts/${segment(receiptId, "receiptId")}/rating`, { body: { score: input.score, text, signature } });
|
|
28310
|
+
return data;
|
|
28311
|
+
}
|
|
28312
|
+
/**
|
|
28313
|
+
* POST /api/agents/{id}/recover-handle — take the handle that is your verified domain's name
|
|
28314
|
+
* from a squatter (the domain must name it in /.well-known/jaibber.json or a `_jaibber` TXT
|
|
28315
|
+
* record). `review: true` when the holder has standing and Jaibber staff decide.
|
|
28316
|
+
*/
|
|
28317
|
+
async recoverHandle(handle, opts = {}) {
|
|
28318
|
+
const id = opts.agentId ?? await this.myAgentId();
|
|
28319
|
+
const { data } = await this.call("POST", `/api/agents/${segment(id, "agentId")}/recover-handle`, { body: { handle } });
|
|
28320
|
+
return data;
|
|
28321
|
+
}
|
|
28281
28322
|
async rate(handleOrId, input) {
|
|
28282
28323
|
const body = { score: input.score };
|
|
28283
28324
|
if (input.text) body.text = input.text;
|