@t2000/sdk 10.36.0 → 10.37.0
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/README.md +4 -0
- package/dist/index.cjs +563 -367
- package/dist/index.d.cts +309 -92
- package/dist/index.d.ts +309 -92
- package/dist/index.js +534 -367
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -33,9 +33,6 @@ interface ChatResult {
|
|
|
33
33
|
content: string;
|
|
34
34
|
model: string;
|
|
35
35
|
usage?: ChatUsage;
|
|
36
|
-
/** Confidential calls (`phala/*`) return a TEE attestation receipt id —
|
|
37
|
-
* fetch + verify it at `/v1/aci/receipts/{id}`. Absent for ZDR models. */
|
|
38
|
-
receiptId?: string;
|
|
39
36
|
/** The verbatim OpenAI-shaped response body. */
|
|
40
37
|
raw: unknown;
|
|
41
38
|
}
|
|
@@ -55,9 +52,7 @@ interface ApiModel {
|
|
|
55
52
|
declare function chatCompletion(params: ChatParams): Promise<ChatResult>;
|
|
56
53
|
/** Streaming chat completion — yields assistant text deltas as they arrive
|
|
57
54
|
* (parses the OpenAI SSE `data:` frames). */
|
|
58
|
-
declare function chatCompletionStream(params: ChatParams): AsyncGenerator<string,
|
|
59
|
-
receiptId?: string;
|
|
60
|
-
}, unknown>;
|
|
55
|
+
declare function chatCompletionStream(params: ChatParams): AsyncGenerator<string, void, unknown>;
|
|
61
56
|
/** List Private Inference model catalog (`GET /v1/models`). The key is sent when
|
|
62
57
|
* available but not required (the catalog may be public). */
|
|
63
58
|
declare function listModels(opts?: {
|
|
@@ -65,66 +60,6 @@ declare function listModels(opts?: {
|
|
|
65
60
|
apiBase?: string;
|
|
66
61
|
}): Promise<ApiModel[]>;
|
|
67
62
|
|
|
68
|
-
type CheckStatus = 'pass' | 'fail' | 'skip';
|
|
69
|
-
type TrustMode = 'trustless' | 'receipt-asserted' | 'roadmap';
|
|
70
|
-
interface VerifyCheck {
|
|
71
|
-
name: string;
|
|
72
|
-
status: CheckStatus;
|
|
73
|
-
detail: string;
|
|
74
|
-
trust: TrustMode;
|
|
75
|
-
}
|
|
76
|
-
interface VerifyAnchor {
|
|
77
|
-
txDigest: string;
|
|
78
|
-
anchoredAtMs?: string;
|
|
79
|
-
anchoredBy?: string;
|
|
80
|
-
explorer: string;
|
|
81
|
-
}
|
|
82
|
-
/** A typed TCB claim from the attested upstream (dstack ACI §tcb-and-claims). */
|
|
83
|
-
interface UpstreamClaim {
|
|
84
|
-
name: string;
|
|
85
|
-
status: string;
|
|
86
|
-
source?: string;
|
|
87
|
-
}
|
|
88
|
-
interface VerifyUpstream {
|
|
89
|
-
provider?: string;
|
|
90
|
-
modelId?: string;
|
|
91
|
-
result?: string;
|
|
92
|
-
tcbStatus?: string;
|
|
93
|
-
/** The attested-session id (`as_…`) — resolve at GET /v1/aci/sessions/{id}. */
|
|
94
|
-
sessionId?: string;
|
|
95
|
-
/** Typed TCB claims (tee_attested, tcb_up_to_date, gpu_attested, …). */
|
|
96
|
-
claims?: UpstreamClaim[];
|
|
97
|
-
}
|
|
98
|
-
interface VerifyResult {
|
|
99
|
-
receiptId: string;
|
|
100
|
-
/** True iff the receipt resolved AND its on-chain Sui anchor matches. */
|
|
101
|
-
verified: boolean;
|
|
102
|
-
/** The trustless core: an on-chain ReceiptAnchored event matches the receipt. */
|
|
103
|
-
anchorVerified: boolean;
|
|
104
|
-
checks: VerifyCheck[];
|
|
105
|
-
wireHash?: string;
|
|
106
|
-
workloadId?: string;
|
|
107
|
-
upstream?: VerifyUpstream;
|
|
108
|
-
anchor?: VerifyAnchor;
|
|
109
|
-
}
|
|
110
|
-
interface VerifyOptions {
|
|
111
|
-
/** Override the API base (default `api.audric.ai/v1`). */
|
|
112
|
-
apiBase?: string;
|
|
113
|
-
/** Sui network for the trustless anchor read (default `mainnet`). */
|
|
114
|
-
network?: 'mainnet' | 'testnet';
|
|
115
|
-
/** Confidential model id for fetching the attested receipt-signing key
|
|
116
|
-
* (default `phala/glm-5.2`; the gateway key is workload-wide). */
|
|
117
|
-
model?: string;
|
|
118
|
-
/** Skip the local DCAP quote verification (the slower, network-bound check). */
|
|
119
|
-
skipQuote?: boolean;
|
|
120
|
-
}
|
|
121
|
-
/**
|
|
122
|
-
* Verify a confidential response by its receipt id. Reads the signed receipt
|
|
123
|
-
* (public), its on-chain Sui anchor (trustless), and reports a per-check result
|
|
124
|
-
* that FAILS CLOSED on any forgery or mismatch.
|
|
125
|
-
*/
|
|
126
|
-
declare function verifyReceipt(receiptId: string, opts?: VerifyOptions): Promise<VerifyResult>;
|
|
127
|
-
|
|
128
63
|
interface LimitsConfig {
|
|
129
64
|
/** Caps any single outbound write (send | swap | pay) by USD value. */
|
|
130
65
|
perTxUsd?: number;
|
|
@@ -285,19 +220,13 @@ declare class T2000 extends EventEmitter<T2000Events> {
|
|
|
285
220
|
pay(options: PayOptions): Promise<PayResult>;
|
|
286
221
|
/** Non-streaming chat completion against Private Inference. */
|
|
287
222
|
chat(params: ChatParams): Promise<ChatResult>;
|
|
288
|
-
/** Streaming chat completion — async-iterate the assistant text deltas
|
|
289
|
-
|
|
290
|
-
chatStream(params: ChatParams): AsyncGenerator<string, {
|
|
291
|
-
receiptId?: string;
|
|
292
|
-
}, unknown>;
|
|
223
|
+
/** Streaming chat completion — async-iterate the assistant text deltas. */
|
|
224
|
+
chatStream(params: ChatParams): AsyncGenerator<string, void, unknown>;
|
|
293
225
|
/** The Private Inference model catalog (`GET /v1/models`). */
|
|
294
226
|
models(opts?: {
|
|
295
227
|
apiKey?: string;
|
|
296
228
|
apiBase?: string;
|
|
297
229
|
}): Promise<ApiModel[]>;
|
|
298
|
-
/** Verify a confidential response by receipt id — checks the signed receipt
|
|
299
|
-
* + its trustless on-chain Sui anchor. Fails closed on any mismatch. */
|
|
300
|
-
verify(receiptId: string, opts?: VerifyOptions): Promise<VerifyResult>;
|
|
301
230
|
swap(params: {
|
|
302
231
|
from: string;
|
|
303
232
|
to: string;
|
|
@@ -587,20 +516,6 @@ declare function customHireEnvelope(brief: string, title: string | undefined, no
|
|
|
587
516
|
* legacy name) with a usable brief must upload as-is, never double-wrap. */
|
|
588
517
|
declare function isCustomHireEnvelope(text: string): boolean;
|
|
589
518
|
|
|
590
|
-
/** The public row shape /v1/open-jobs returns — the indexer read-model of
|
|
591
|
-
* on-chain Openings. `id` is the Opening OBJECT id (0x…). Buyer addresses
|
|
592
|
-
* never appear (registered-agent buyers surface by id); the claiming seller
|
|
593
|
-
* is public. Title + brief are public by design. */
|
|
594
|
-
/** A host-installed veto on sponsored open-board transactions (S.930).
|
|
595
|
-
*
|
|
596
|
-
* Called twice per verb: once with no `txBytes` before the prepare request
|
|
597
|
-
* (so an untrusted API host can be refused before it learns the address),
|
|
598
|
-
* and once with the prepared bytes before they are signed. Throwing from
|
|
599
|
-
* either aborts the verb.
|
|
600
|
-
*
|
|
601
|
-
* The SDK deliberately ships NO default policy: package-id verification
|
|
602
|
-
* needs non-env literals and a notion of "the canonical host", both of which
|
|
603
|
-
* belong to the host application. Unset = today's behavior. */
|
|
604
519
|
type SponsoredTxGuard = (ctx: {
|
|
605
520
|
base: string;
|
|
606
521
|
action: string;
|
|
@@ -608,10 +523,16 @@ type SponsoredTxGuard = (ctx: {
|
|
|
608
523
|
}) => void;
|
|
609
524
|
/** Install (or clear, with `null`) the sponsored-tx guard. */
|
|
610
525
|
declare function setSponsoredTxGuard(guard: SponsoredTxGuard | null): void;
|
|
526
|
+
|
|
611
527
|
interface OpenJobRow {
|
|
612
528
|
id: string;
|
|
613
529
|
title: string | null;
|
|
614
|
-
|
|
530
|
+
/** The full task — DETAIL-ROUTE ONLY (S.1156): present on `getOpenJob`,
|
|
531
|
+
* absent on `listOpenJobs` rows (the board stays bounded). */
|
|
532
|
+
brief?: string | null;
|
|
533
|
+
/** One bounded line of the brief (≤140 chars) on BOARD rows — a gist for
|
|
534
|
+
* picking which opening to read, never the task itself. */
|
|
535
|
+
briefPreview?: string | null;
|
|
615
536
|
maxUsdc: number;
|
|
616
537
|
slaMinutes: number;
|
|
617
538
|
status: 'open' | 'claimed' | 'cancelled' | 'refunded' | 'expired';
|
|
@@ -639,9 +560,24 @@ interface OpenJobFilter {
|
|
|
639
560
|
query?: string;
|
|
640
561
|
buyer?: string;
|
|
641
562
|
limit?: number;
|
|
563
|
+
/** Page start (0-based) — feed a page's `nextOffset` back in. */
|
|
564
|
+
offset?: number;
|
|
565
|
+
}
|
|
566
|
+
/** One page of the board (S.1156) — HONEST about the rest: `total` counts
|
|
567
|
+
* every matching opening, `returned` the rows in this page, `truncated` +
|
|
568
|
+
* `nextOffset` say how to page. One page is never the whole board. */
|
|
569
|
+
interface OpenJobsPage {
|
|
570
|
+
total: number;
|
|
571
|
+
returned: number;
|
|
572
|
+
truncated: boolean;
|
|
573
|
+
nextOffset?: number;
|
|
574
|
+
openJobs: OpenJobRow[];
|
|
642
575
|
}
|
|
643
|
-
/** Browse the Open board (GET /v1/open-jobs — public, no key needed).
|
|
644
|
-
|
|
576
|
+
/** Browse the Open board (GET /v1/open-jobs — public, no key needed).
|
|
577
|
+
* Returns the page envelope, not a bare list — read `truncated` before
|
|
578
|
+
* treating the rows as the whole board. A degraded body (no counts)
|
|
579
|
+
* normalizes to `total = returned`, never an invented total. */
|
|
580
|
+
declare function listOpenJobs(base: string, filter?: OpenJobFilter): Promise<OpenJobsPage>;
|
|
645
581
|
/** Fetch one opening by id (0x… object id; legacy UUIDs still resolve
|
|
646
582
|
* during the Phase 2 drain window). */
|
|
647
583
|
declare function getOpenJob(base: string, id: string): Promise<OpenJobRow>;
|
|
@@ -685,6 +621,287 @@ declare function cancelOpenJob(base: string, signer: TransactionSigner, openingI
|
|
|
685
621
|
* only ever go back to the buyer. */
|
|
686
622
|
declare function refundOpenJob(base: string, signer: TransactionSigner, openingId: string): Promise<string>;
|
|
687
623
|
|
|
624
|
+
interface CommerceClientOptions {
|
|
625
|
+
/** The seller's signer — a keypair (`KeypairSigner`) or zkLogin Passport. */
|
|
626
|
+
signer: TransactionSigner;
|
|
627
|
+
/** API base (default `https://api.t2000.ai/v1`). Callers pointing at a
|
|
628
|
+
* custom host must pin it themselves — see `setSponsoredTxGuard`. */
|
|
629
|
+
apiBase?: string;
|
|
630
|
+
}
|
|
631
|
+
/** The directory categories `/v1/agent/profile` accepts — the server is the
|
|
632
|
+
* authority and rejects off-enum values; this mirror fails fast locally. */
|
|
633
|
+
declare const AGENT_CATEGORIES: readonly ["ai-models", "data-feeds", "finance", "research", "dev-tools", "creative", "travel", "comms", "other"];
|
|
634
|
+
type AgentCategory = (typeof AGENT_CATEGORIES)[number];
|
|
635
|
+
interface RegisterResult {
|
|
636
|
+
address: string;
|
|
637
|
+
/** True when the address was already an Agent ID — nothing was signed. */
|
|
638
|
+
alreadyRegistered: boolean;
|
|
639
|
+
/** The register tx digest (absent when already registered). */
|
|
640
|
+
digest?: string;
|
|
641
|
+
}
|
|
642
|
+
/** POST /v1/agent/profile — every field optional; omitted = untouched. */
|
|
643
|
+
interface ProfileUpdateInput {
|
|
644
|
+
/** Display name (≤60 chars). */
|
|
645
|
+
name?: string;
|
|
646
|
+
/** https image URL. */
|
|
647
|
+
imageUrl?: string;
|
|
648
|
+
/** Short description (≤500 chars). */
|
|
649
|
+
description?: string;
|
|
650
|
+
category?: AgentCategory | string;
|
|
651
|
+
website?: string;
|
|
652
|
+
twitter?: string;
|
|
653
|
+
github?: string;
|
|
654
|
+
}
|
|
655
|
+
/** The public profile row (GET /v1/agents/:address) — the fields a seller
|
|
656
|
+
* flow reads back. Extra server fields pass through untouched. */
|
|
657
|
+
interface AgentProfile {
|
|
658
|
+
address: string;
|
|
659
|
+
name?: string | null;
|
|
660
|
+
numericId?: number | null;
|
|
661
|
+
category?: string | null;
|
|
662
|
+
active?: boolean;
|
|
663
|
+
[key: string]: unknown;
|
|
664
|
+
}
|
|
665
|
+
/** POST /v1/agent/service action "upsert" — a FULL upsert (omitted
|
|
666
|
+
* optionals take the server defaults: review 1440 min, split 8000 bps). */
|
|
667
|
+
interface ServiceUpsertInput {
|
|
668
|
+
/** 2–48 chars of [a-z0-9-]; derive one with `slugify`. */
|
|
669
|
+
slug: string;
|
|
670
|
+
/** ≤80 chars. */
|
|
671
|
+
name: string;
|
|
672
|
+
/** ≤2000 chars. */
|
|
673
|
+
description: string;
|
|
674
|
+
/** Fixed price in USDC — within the escrow job bounds. */
|
|
675
|
+
priceUsdc: number;
|
|
676
|
+
/** Delivery window once hired (minutes). */
|
|
677
|
+
slaMinutes: number;
|
|
678
|
+
/** What the buyer receives (≤1000 chars). */
|
|
679
|
+
deliverable: string;
|
|
680
|
+
/** REQUIRED by the API: the questions buyers answer at hire — free text,
|
|
681
|
+
* or an object of field names → hints. */
|
|
682
|
+
requirements: string | Record<string, unknown>;
|
|
683
|
+
reviewWindowMinutes?: number;
|
|
684
|
+
rejectSplitBps?: number;
|
|
685
|
+
/** "create" refuses a LIVE slug (409) — the safe default for new
|
|
686
|
+
* listings; "update" (the API default) overwrites. */
|
|
687
|
+
mode?: 'create' | 'update';
|
|
688
|
+
/** Gallery (S.1114) — omitted keeps the live set; [] clears it. */
|
|
689
|
+
examples?: unknown[];
|
|
690
|
+
}
|
|
691
|
+
interface ServiceWriteResult {
|
|
692
|
+
address: string;
|
|
693
|
+
slug: string;
|
|
694
|
+
/** The API's response body, verbatim. */
|
|
695
|
+
response: Record<string, unknown>;
|
|
696
|
+
}
|
|
697
|
+
declare const SERVICE_TIERS: readonly ["basic", "standard", "premium"];
|
|
698
|
+
type ServiceTier = (typeof SERVICE_TIERS)[number];
|
|
699
|
+
/** One tier of a package — price + deliverable are the tier's own; the
|
|
700
|
+
* rest defaults to the package-level values. */
|
|
701
|
+
interface PackageTierInput {
|
|
702
|
+
tier: ServiceTier;
|
|
703
|
+
priceUsdc: number;
|
|
704
|
+
deliverable: string;
|
|
705
|
+
slaMinutes?: number;
|
|
706
|
+
description?: string;
|
|
707
|
+
reviewWindowMinutes?: number;
|
|
708
|
+
rejectSplitBps?: number;
|
|
709
|
+
}
|
|
710
|
+
interface CreatePackageInput {
|
|
711
|
+
/** The package name — every tier carries it; the tier lives in the slug. */
|
|
712
|
+
name: string;
|
|
713
|
+
description: string;
|
|
714
|
+
requirements: string | Record<string, unknown>;
|
|
715
|
+
/** Default delivery window for tiers that don't set their own. */
|
|
716
|
+
slaMinutes: number;
|
|
717
|
+
/** All three tiers, in any order; each tier at most once. */
|
|
718
|
+
tiers: PackageTierInput[];
|
|
719
|
+
/** Override the derived base slug (`packageBaseSlug(slugify(name))`). */
|
|
720
|
+
baseSlug?: string;
|
|
721
|
+
reviewWindowMinutes?: number;
|
|
722
|
+
rejectSplitBps?: number;
|
|
723
|
+
}
|
|
724
|
+
interface CreatePackageResult {
|
|
725
|
+
address: string;
|
|
726
|
+
base: string;
|
|
727
|
+
tiers: {
|
|
728
|
+
tier: ServiceTier;
|
|
729
|
+
slug: string;
|
|
730
|
+
priceUsdc: number;
|
|
731
|
+
}[];
|
|
732
|
+
}
|
|
733
|
+
interface EndpointIssue {
|
|
734
|
+
code?: string;
|
|
735
|
+
message?: string;
|
|
736
|
+
}
|
|
737
|
+
interface EndpointRoute {
|
|
738
|
+
method?: string;
|
|
739
|
+
path?: string;
|
|
740
|
+
url?: string;
|
|
741
|
+
priceUsdc?: string | null;
|
|
742
|
+
summary?: string | null;
|
|
743
|
+
probeOk?: boolean;
|
|
744
|
+
issues?: EndpointIssue[];
|
|
745
|
+
}
|
|
746
|
+
interface EndpointListing {
|
|
747
|
+
address: string;
|
|
748
|
+
/** The primary paid URL (null after a remove). */
|
|
749
|
+
endpoint: string | null;
|
|
750
|
+
listed: boolean;
|
|
751
|
+
probe: {
|
|
752
|
+
ok?: boolean;
|
|
753
|
+
amount?: string | null;
|
|
754
|
+
currency?: string | null;
|
|
755
|
+
issues?: EndpointIssue[];
|
|
756
|
+
} | null;
|
|
757
|
+
origin: string | null;
|
|
758
|
+
primary: {
|
|
759
|
+
path?: string;
|
|
760
|
+
url?: string;
|
|
761
|
+
} | null;
|
|
762
|
+
routes: EndpointRoute[];
|
|
763
|
+
digest?: string;
|
|
764
|
+
}
|
|
765
|
+
/** `/v1/agents/resolve` — `#93` · `93` · `@handle` · `name.sui` · `0x…`. */
|
|
766
|
+
interface AgentRef {
|
|
767
|
+
address: string;
|
|
768
|
+
numericId?: number | null;
|
|
769
|
+
name?: string;
|
|
770
|
+
}
|
|
771
|
+
|
|
772
|
+
declare class CommerceClient {
|
|
773
|
+
readonly signer: TransactionSigner;
|
|
774
|
+
readonly apiBase: string;
|
|
775
|
+
constructor(options: CommerceClientOptions);
|
|
776
|
+
/** This signer's wallet address. */
|
|
777
|
+
get address(): string;
|
|
778
|
+
/** Register the wallet as an on-chain Agent ID (sponsored; idempotent). */
|
|
779
|
+
register(): Promise<RegisterResult>;
|
|
780
|
+
/** Set public profile fields (signed, no gas). */
|
|
781
|
+
updateProfile(input: ProfileUpdateInput): Promise<{
|
|
782
|
+
address: string;
|
|
783
|
+
}>;
|
|
784
|
+
/** The sell gate — set `category` or confirm the live one; throws when
|
|
785
|
+
* neither exists. Returns the category in force. */
|
|
786
|
+
ensureCategory(category?: string): Promise<string>;
|
|
787
|
+
/** This seller's public profile (null when unregistered). */
|
|
788
|
+
profile(): Promise<AgentProfile | null>;
|
|
789
|
+
/** List (or fully re-write) one service — `mode: "create"` refuses a live slug. */
|
|
790
|
+
upsertService(input: ServiceUpsertInput): Promise<ServiceWriteResult>;
|
|
791
|
+
/** Take a service off the board (funded jobs keep settling on-chain). */
|
|
792
|
+
retireService(input: {
|
|
793
|
+
slug: string;
|
|
794
|
+
} | string): Promise<ServiceWriteResult>;
|
|
795
|
+
/** Three tiers under one name — `{base}-basic|standard|premium`. */
|
|
796
|
+
createPackage(input: CreatePackageInput): Promise<CreatePackageResult>;
|
|
797
|
+
/** Sell an x402 API (origin or one 402 URL) — live-probed, sponsored. */
|
|
798
|
+
listEndpoint(endpoint: string, opts?: {
|
|
799
|
+
primary?: string;
|
|
800
|
+
}): Promise<EndpointListing>;
|
|
801
|
+
/** Clear the x402 listing. */
|
|
802
|
+
removeEndpoint(): Promise<EndpointListing>;
|
|
803
|
+
/** `#93` · `@handle` · `name.sui` · `0x…` → wallet (marketplace refs only). */
|
|
804
|
+
resolveRef(q: string): Promise<AgentRef>;
|
|
805
|
+
}
|
|
806
|
+
|
|
807
|
+
/** The exact bytes the service rail hashes — `JSON.stringify(payload)`,
|
|
808
|
+
* key order as given (the server hashes the payload it receives). */
|
|
809
|
+
declare function servicePayloadSha256(payload: unknown): Promise<string>;
|
|
810
|
+
declare function profileChallengeMessage(nonce: string): string;
|
|
811
|
+
declare function serviceChallengeMessage(nonce: string, payloadHash: string): string;
|
|
812
|
+
/** One fresh nonce for `address`. */
|
|
813
|
+
declare function fetchChallengeNonce(apiBase: string, address: string): Promise<string>;
|
|
814
|
+
/** Nonce → signed message → `{ nonce, signature }` ready to POST. */
|
|
815
|
+
declare function signChallenge(apiBase: string, signer: TransactionSigner, message: (nonce: string) => string | Promise<string>): Promise<{
|
|
816
|
+
nonce: string;
|
|
817
|
+
signature: string;
|
|
818
|
+
}>;
|
|
819
|
+
|
|
820
|
+
type PrepareBody = {
|
|
821
|
+
nonce?: string;
|
|
822
|
+
txBytes?: string;
|
|
823
|
+
probe?: EndpointListing['probe'];
|
|
824
|
+
origin?: string | null;
|
|
825
|
+
primary?: {
|
|
826
|
+
path?: string;
|
|
827
|
+
url?: string;
|
|
828
|
+
} | null;
|
|
829
|
+
routes?: EndpointRoute[];
|
|
830
|
+
issues?: EndpointIssue[];
|
|
831
|
+
};
|
|
832
|
+
/** The probe findings as the lines the CLI prints — origin expands carry
|
|
833
|
+
* per-route findings, single probes the flat issue list. */
|
|
834
|
+
declare function endpointIssueLines(prep: PrepareBody): string[];
|
|
835
|
+
/** List an API origin (expands via {origin}/openapi.json) or one 402 URL. */
|
|
836
|
+
declare function listEndpoint(apiBase: string, signer: TransactionSigner, endpoint: string, opts?: {
|
|
837
|
+
primary?: string;
|
|
838
|
+
}): Promise<EndpointListing>;
|
|
839
|
+
/** Clear the listing (registry update with an empty endpoint). */
|
|
840
|
+
declare function removeEndpoint(apiBase: string, signer: TransactionSigner): Promise<EndpointListing>;
|
|
841
|
+
|
|
842
|
+
/** The wire payload for an upsert — key order is the signed bytes, so it
|
|
843
|
+
* is fixed here and nowhere else. */
|
|
844
|
+
declare function serviceUpsertPayload(input: ServiceUpsertInput): Record<string, unknown>;
|
|
845
|
+
declare function upsertService(apiBase: string, signer: TransactionSigner, input: ServiceUpsertInput): Promise<ServiceWriteResult>;
|
|
846
|
+
declare function retireService(apiBase: string, signer: TransactionSigner, slug: string): Promise<ServiceWriteResult>;
|
|
847
|
+
|
|
848
|
+
/** The three upsert payload inputs for a package, Basic → Premium (pure —
|
|
849
|
+
* unit-pinned; `createPackage` only adds the signer). */
|
|
850
|
+
declare function planPackage(input: CreatePackageInput): {
|
|
851
|
+
base: string;
|
|
852
|
+
tiers: {
|
|
853
|
+
tier: ServiceTier;
|
|
854
|
+
slug: string;
|
|
855
|
+
input: Parameters<typeof upsertService>[2];
|
|
856
|
+
}[];
|
|
857
|
+
};
|
|
858
|
+
declare function createPackage(apiBase: string, signer: TransactionSigner, input: CreatePackageInput): Promise<CreatePackageResult>;
|
|
859
|
+
|
|
860
|
+
/** The API's slug grammar: 2–48 chars of [a-z0-9-], alphanumeric first. */
|
|
861
|
+
declare const SERVICE_SLUG_RE: RegExp;
|
|
862
|
+
/** Strip leading/trailing dashes in linear time (a `^-+|-+$` regex is
|
|
863
|
+
* polynomial on dash runs — CodeQL js/polynomial-redos). */
|
|
864
|
+
declare function trimDashes(s: string): string;
|
|
865
|
+
/** The CLI's name → slug rule (lowercase, runs of non-alphanumerics → `-`,
|
|
866
|
+
* trimmed, 48-char cap). */
|
|
867
|
+
declare function slugify(name: string): string;
|
|
868
|
+
/** `{base}-standard` is the longest tier slug; slugs cap at 48 chars, so a
|
|
869
|
+
* package base may be at most 48 - "-standard".length. */
|
|
870
|
+
declare const MAX_TIER_BASE_LENGTH: number;
|
|
871
|
+
declare function parseServiceTierSlug(slug: string): {
|
|
872
|
+
base: string;
|
|
873
|
+
tier: ServiceTier;
|
|
874
|
+
} | null;
|
|
875
|
+
/** Truncate a slugified name into a valid package base (trailing dashes
|
|
876
|
+
* shed so `{base}-basic` never carries `--`). Empty in → empty out —
|
|
877
|
+
* callers validate. */
|
|
878
|
+
declare function packageBaseSlug(slugified: string): string;
|
|
879
|
+
/** The three tier slugs for a base, Basic → Standard → Premium. */
|
|
880
|
+
declare function packageTierSlugs(base: string): {
|
|
881
|
+
tier: ServiceTier;
|
|
882
|
+
slug: string;
|
|
883
|
+
}[];
|
|
884
|
+
|
|
885
|
+
declare function parseAgentCategory(raw: string): string;
|
|
886
|
+
declare function updateProfile(apiBase: string, signer: TransactionSigner, input: ProfileUpdateInput): Promise<{
|
|
887
|
+
address: string;
|
|
888
|
+
}>;
|
|
889
|
+
/** The seller category gate: `category` given → set it (signed, no gas);
|
|
890
|
+
* otherwise the live profile category satisfies the gate; neither → a
|
|
891
|
+
* precise refusal naming both fixes. */
|
|
892
|
+
declare function ensureCategory(apiBase: string, signer: TransactionSigner, category?: string): Promise<string>;
|
|
893
|
+
|
|
894
|
+
declare function registerAgent(apiBase: string, signer: TransactionSigner): Promise<RegisterResult>;
|
|
895
|
+
|
|
896
|
+
/** The resolve URL for a ref (pure — unit-pinned). */
|
|
897
|
+
declare function agentResolveUrl(q: string, apiBase?: string): string;
|
|
898
|
+
/** Resolve an agent ref to its wallet. Throws `T2000Error` with the server's
|
|
899
|
+
* own sentence on a miss, so every surface explains it identically. */
|
|
900
|
+
declare function resolveAgentRef(q: string, apiBase?: string): Promise<AgentRef>;
|
|
901
|
+
/** The public profile row (GET /v1/agents/:address). Null when the address
|
|
902
|
+
* is not a registered Agent ID. */
|
|
903
|
+
declare function getAgentProfile(address: string, apiBase?: string): Promise<AgentProfile | null>;
|
|
904
|
+
|
|
688
905
|
/** The shared `Opening` object minted by an Open post. */
|
|
689
906
|
declare const OPENING_TYPE_MARKER = "::opening::Opening<";
|
|
690
907
|
/** The escrow `Job` object minted by a hire or an Open claim. */
|
|
@@ -1223,4 +1440,4 @@ declare function fullHandle(label: string, parentName?: string): string;
|
|
|
1223
1440
|
*/
|
|
1224
1441
|
declare function displayHandle(label: string, parentName?: string): string;
|
|
1225
1442
|
|
|
1226
|
-
export { AUDRIC_PARENT, AUDRIC_PARENT_NAME, AUDRIC_PARENT_NFT_ID, type ApiModel, type AppenderContext, BalanceResponse, type BuildAddLeafParams, type BuildRevokeLeafParams, type ChatMessage, type ChatParams, type ChatResult, type ChatUsage, type
|
|
1443
|
+
export { AGENT_CATEGORIES, AUDRIC_PARENT, AUDRIC_PARENT_NAME, AUDRIC_PARENT_NFT_ID, type AgentCategory, type AgentProfile, type AgentRef, type ApiModel, type AppenderContext, BalanceResponse, type BuildAddLeafParams, type BuildRevokeLeafParams, type ChatMessage, type ChatParams, type ChatResult, type ChatUsage, CommerceClient, type CommerceClientOptions, type ComposeTxOptions, type ComposeTxResult, type CreatePackageInput, type CreatePackageResult, DEFAULT_API_BASE, type DailySpend, DepositInfo, ESCROW_JOB_TYPE_MARKER, type EndpointIssue, type EndpointListing, type EndpointRoute, InvalidAddressError, type LabelValidationResult, type LimitAssertInput, LimitEnforcer, LimitExceededError, type LimitKind, type LimitOperation, type LimitsConfig, type LimitsFile, MAX_TIER_BASE_LENGTH, type NormalizedAddress, OPENING_TYPE_MARKER, type OpenJobFilter, type OpenJobRow, type OpenJobsPage, OverlayFeeConfig, type PackageTierInput, PayOptions, PayResult, PaymentRequest, type ProfileUpdateInput, type RegisterResult, SERVICE_SLUG_RE, SERVICE_TIERS, SPONSORED_PYTH_DEPENDENT_PROVIDERS, SUINS_NAME_REGEX, SUI_ADDRESS_REGEX, SUI_ADDRESS_STRICT_REGEX, SendResult, type SendTransferInput, SendableAsset, SerializedCetusRoute, type ServiceTier, type ServiceUpsertInput, type ServiceWriteResult, type SponsoredTxGuard, type StepPreview, SuinsNotRegisteredError, type SuinsParent, SuinsRpcError, SupportedAsset, type SwapExecuteInput, SwapQuoteResult, SwapResult, SwapRouteResult, T2000, T2000Error, T2000Options, TransactionRecord, TransactionSigner, WRITE_APPENDER_REGISTRY, type WriteStep, type WriteToolName, X402Probe, ZkLoginProof, agentResolveUrl, approxUsdValue, assertLimitConfig, buildAddLeafTx, buildRevokeLeafTx, cancelOpenJob, canonicalizeRecipientInput, chatCompletion, chatCompletionStream, claimOpenJob, clearLimits, composeTx, createPackage, customHireEnvelope, dailySpentToday, deriveAllowedAddressesFromPtb, displayHandle, endpointIssueLines, ensureCategory, exportPrivateKey, fetchChallengeNonce, fullHandle, generateKeypair, getAddress, getAgentProfile, getLimits, getOpenJob, getSponsoredSwapProviders, getSwapQuote, hasLimits, isCustomHireEnvelope, keypairFromPrivateKey, listEndpoint, listModels, listOpenJobs, loadKey, looksLikeSuiNs, normalizeAddressInput, packageBaseSlug, packageTierSlugs, parseAgentCategory, parseServiceTierSlug, planPackage, postOpenJob, profileChallengeMessage, queryBalance, readLimitsFile, recordDailySpend, refundOpenJob, registerAgent, removeEndpoint, resolveAddressToSuinsViaRpc, resolveAgentRef, resolveCreatedObjectId, resolveSuinsViaRpc, retireService, saveBech32, saveKey, serviceChallengeMessage, servicePayloadSha256, serviceUpsertPayload, setLimits, setSponsoredTxGuard, signChallenge, slugify, submitJobReview, trimDashes, updateProfile, upsertService, validateLabel, walletExists, writeLimitsFile };
|