@t2000/sdk 10.37.0 → 10.37.1
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/index.cjs +16 -2
- package/dist/index.d.cts +18 -5
- package/dist/index.d.ts +18 -5
- package/dist/index.js +13 -3
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -4006,8 +4006,15 @@ function trimDashes(s) {
|
|
|
4006
4006
|
while (end > start && s.charCodeAt(end - 1) === 45) end -= 1;
|
|
4007
4007
|
return s.slice(start, end);
|
|
4008
4008
|
}
|
|
4009
|
+
var MAX_SLUG_LENGTH = 48;
|
|
4010
|
+
function slugifyUnbounded(name) {
|
|
4011
|
+
return trimDashes(name.toLowerCase().replaceAll(/[^a-z0-9]+/g, "-"));
|
|
4012
|
+
}
|
|
4013
|
+
function slugifyLoner(name) {
|
|
4014
|
+
return slugifyUnbounded(name).slice(0, MAX_SLUG_LENGTH);
|
|
4015
|
+
}
|
|
4009
4016
|
function slugify(name) {
|
|
4010
|
-
return
|
|
4017
|
+
return slugifyLoner(name);
|
|
4011
4018
|
}
|
|
4012
4019
|
var TIER_SLUG_RE = /^(.+)-(basic|standard|premium)$/;
|
|
4013
4020
|
var MAX_TIER_BASE_LENGTH = 48 - "-standard".length;
|
|
@@ -4024,6 +4031,9 @@ function packageBaseSlug(slugified) {
|
|
|
4024
4031
|
while (end > 0 && cut.charCodeAt(end - 1) === 45) end -= 1;
|
|
4025
4032
|
return cut.slice(0, end);
|
|
4026
4033
|
}
|
|
4034
|
+
function packageBaseFromName(name) {
|
|
4035
|
+
return packageBaseSlug(slugifyUnbounded(name));
|
|
4036
|
+
}
|
|
4027
4037
|
function packageTierSlugs(base) {
|
|
4028
4038
|
return SERVICE_TIERS.map((tier) => ({ tier, slug: `${base}-${tier}` }));
|
|
4029
4039
|
}
|
|
@@ -4121,7 +4131,7 @@ function planPackage(input) {
|
|
|
4121
4131
|
if (!name) {
|
|
4122
4132
|
throw invalidInput("name is required.");
|
|
4123
4133
|
}
|
|
4124
|
-
const base =
|
|
4134
|
+
const base = input.baseSlug ? packageBaseSlug(input.baseSlug.trim().toLowerCase()) : packageBaseFromName(name);
|
|
4125
4135
|
if (!base || !SERVICE_SLUG_RE.test(`${base}-basic`)) {
|
|
4126
4136
|
throw invalidInput(
|
|
4127
4137
|
"Could not derive a package slug from the name \u2014 pass baseSlug (a-z, 0-9, dashes)."
|
|
@@ -4836,6 +4846,7 @@ exports.MAX_DELIVER_HORIZON_MS = MAX_DELIVER_HORIZON_MS;
|
|
|
4836
4846
|
exports.MAX_JOB_USDC = MAX_JOB_USDC;
|
|
4837
4847
|
exports.MAX_OPEN_WINDOW_MS = MAX_OPEN_WINDOW_MS;
|
|
4838
4848
|
exports.MAX_REVIEW_WINDOW_MS = MAX_REVIEW_WINDOW_MS;
|
|
4849
|
+
exports.MAX_SLUG_LENGTH = MAX_SLUG_LENGTH;
|
|
4839
4850
|
exports.MAX_TIER_BASE_LENGTH = MAX_TIER_BASE_LENGTH;
|
|
4840
4851
|
exports.MIN_JOB_USDC = MIN_JOB_USDC;
|
|
4841
4852
|
exports.MIST_PER_SUI = MIST_PER_SUI;
|
|
@@ -4966,6 +4977,7 @@ exports.mistToSui = mistToSui;
|
|
|
4966
4977
|
exports.normalizeAddressInput = normalizeAddressInput;
|
|
4967
4978
|
exports.normalizeAsset = normalizeAsset;
|
|
4968
4979
|
exports.normalizeCoinType = normalizeCoinType;
|
|
4980
|
+
exports.packageBaseFromName = packageBaseFromName;
|
|
4969
4981
|
exports.packageBaseSlug = packageBaseSlug;
|
|
4970
4982
|
exports.packageTierSlugs = packageTierSlugs;
|
|
4971
4983
|
exports.parseAgentCategory = parseAgentCategory;
|
|
@@ -5015,6 +5027,8 @@ exports.setSponsoredTxGuard = setSponsoredTxGuard;
|
|
|
5015
5027
|
exports.signChallenge = signChallenge;
|
|
5016
5028
|
exports.simulateTransaction = simulateTransaction;
|
|
5017
5029
|
exports.slugify = slugify;
|
|
5030
|
+
exports.slugifyLoner = slugifyLoner;
|
|
5031
|
+
exports.slugifyUnbounded = slugifyUnbounded;
|
|
5018
5032
|
exports.stableToRaw = stableToRaw;
|
|
5019
5033
|
exports.submitJobReview = submitJobReview;
|
|
5020
5034
|
exports.suiToMist = suiToMist;
|
package/dist/index.d.cts
CHANGED
|
@@ -665,7 +665,7 @@ interface AgentProfile {
|
|
|
665
665
|
/** POST /v1/agent/service action "upsert" — a FULL upsert (omitted
|
|
666
666
|
* optionals take the server defaults: review 1440 min, split 8000 bps). */
|
|
667
667
|
interface ServiceUpsertInput {
|
|
668
|
-
/** 2–48 chars of [a-z0-9-]; derive one with `slugify
|
|
668
|
+
/** 2–48 chars of [a-z0-9-]; derive one with `slugify` (loner, 48-cap). */
|
|
669
669
|
slug: string;
|
|
670
670
|
/** ≤80 chars. */
|
|
671
671
|
name: string;
|
|
@@ -716,7 +716,8 @@ interface CreatePackageInput {
|
|
|
716
716
|
slaMinutes: number;
|
|
717
717
|
/** All three tiers, in any order; each tier at most once. */
|
|
718
718
|
tiers: PackageTierInput[];
|
|
719
|
-
/** Override the derived base slug (`
|
|
719
|
+
/** Override the derived base slug (default: `packageBaseFromName(name)` =
|
|
720
|
+
* `packageBaseSlug(slugifyUnbounded(name))` — never a 48-capped slug first). */
|
|
720
721
|
baseSlug?: string;
|
|
721
722
|
reviewWindowMinutes?: number;
|
|
722
723
|
rejectSplitBps?: number;
|
|
@@ -862,8 +863,16 @@ declare const SERVICE_SLUG_RE: RegExp;
|
|
|
862
863
|
/** Strip leading/trailing dashes in linear time (a `^-+|-+$` regex is
|
|
863
864
|
* polynomial on dash runs — CodeQL js/polynomial-redos). */
|
|
864
865
|
declare function trimDashes(s: string): string;
|
|
865
|
-
/** The
|
|
866
|
-
|
|
866
|
+
/** The API's slug cap (SERVICE_SLUG_RE: 2–48 chars). */
|
|
867
|
+
declare const MAX_SLUG_LENGTH = 48;
|
|
868
|
+
/** Lowercase kebab, edge dashes trimmed, NO length cap — the input to BOTH
|
|
869
|
+
* budgets below. */
|
|
870
|
+
declare function slugifyUnbounded(name: string): string;
|
|
871
|
+
/** Single-listing (loner) slug — the full 48-char budget. */
|
|
872
|
+
declare function slugifyLoner(name: string): string;
|
|
873
|
+
/** The CLI's name → slug rule for LONERS (`t2 service create`): lowercase,
|
|
874
|
+
* runs of non-alphanumerics → `-`, trimmed, 48-char cap. Loner-only — a
|
|
875
|
+
* package base must come from `packageBaseFromName`, never from this. */
|
|
867
876
|
declare function slugify(name: string): string;
|
|
868
877
|
/** `{base}-standard` is the longest tier slug; slugs cap at 48 chars, so a
|
|
869
878
|
* package base may be at most 48 - "-standard".length. */
|
|
@@ -876,6 +885,10 @@ declare function parseServiceTierSlug(slug: string): {
|
|
|
876
885
|
* shed so `{base}-basic` never carries `--`). Empty in → empty out —
|
|
877
886
|
* callers validate. */
|
|
878
887
|
declare function packageBaseSlug(slugified: string): string;
|
|
888
|
+
/** Package base from a display name — unbounded kebab, THEN the tier-base
|
|
889
|
+
* budget (trailing dashes shed), so every `{base}-{tier}` is a valid slug
|
|
890
|
+
* with its suffix intact. Mirrors console `packageBaseFromName`. */
|
|
891
|
+
declare function packageBaseFromName(name: string): string;
|
|
879
892
|
/** The three tier slugs for a base, Basic → Standard → Premium. */
|
|
880
893
|
declare function packageTierSlugs(base: string): {
|
|
881
894
|
tier: ServiceTier;
|
|
@@ -1440,4 +1453,4 @@ declare function fullHandle(label: string, parentName?: string): string;
|
|
|
1440
1453
|
*/
|
|
1441
1454
|
declare function displayHandle(label: string, parentName?: string): string;
|
|
1442
1455
|
|
|
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 };
|
|
1456
|
+
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_SLUG_LENGTH, 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, packageBaseFromName, 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, slugifyLoner, slugifyUnbounded, submitJobReview, trimDashes, updateProfile, upsertService, validateLabel, walletExists, writeLimitsFile };
|
package/dist/index.d.ts
CHANGED
|
@@ -665,7 +665,7 @@ interface AgentProfile {
|
|
|
665
665
|
/** POST /v1/agent/service action "upsert" — a FULL upsert (omitted
|
|
666
666
|
* optionals take the server defaults: review 1440 min, split 8000 bps). */
|
|
667
667
|
interface ServiceUpsertInput {
|
|
668
|
-
/** 2–48 chars of [a-z0-9-]; derive one with `slugify
|
|
668
|
+
/** 2–48 chars of [a-z0-9-]; derive one with `slugify` (loner, 48-cap). */
|
|
669
669
|
slug: string;
|
|
670
670
|
/** ≤80 chars. */
|
|
671
671
|
name: string;
|
|
@@ -716,7 +716,8 @@ interface CreatePackageInput {
|
|
|
716
716
|
slaMinutes: number;
|
|
717
717
|
/** All three tiers, in any order; each tier at most once. */
|
|
718
718
|
tiers: PackageTierInput[];
|
|
719
|
-
/** Override the derived base slug (`
|
|
719
|
+
/** Override the derived base slug (default: `packageBaseFromName(name)` =
|
|
720
|
+
* `packageBaseSlug(slugifyUnbounded(name))` — never a 48-capped slug first). */
|
|
720
721
|
baseSlug?: string;
|
|
721
722
|
reviewWindowMinutes?: number;
|
|
722
723
|
rejectSplitBps?: number;
|
|
@@ -862,8 +863,16 @@ declare const SERVICE_SLUG_RE: RegExp;
|
|
|
862
863
|
/** Strip leading/trailing dashes in linear time (a `^-+|-+$` regex is
|
|
863
864
|
* polynomial on dash runs — CodeQL js/polynomial-redos). */
|
|
864
865
|
declare function trimDashes(s: string): string;
|
|
865
|
-
/** The
|
|
866
|
-
|
|
866
|
+
/** The API's slug cap (SERVICE_SLUG_RE: 2–48 chars). */
|
|
867
|
+
declare const MAX_SLUG_LENGTH = 48;
|
|
868
|
+
/** Lowercase kebab, edge dashes trimmed, NO length cap — the input to BOTH
|
|
869
|
+
* budgets below. */
|
|
870
|
+
declare function slugifyUnbounded(name: string): string;
|
|
871
|
+
/** Single-listing (loner) slug — the full 48-char budget. */
|
|
872
|
+
declare function slugifyLoner(name: string): string;
|
|
873
|
+
/** The CLI's name → slug rule for LONERS (`t2 service create`): lowercase,
|
|
874
|
+
* runs of non-alphanumerics → `-`, trimmed, 48-char cap. Loner-only — a
|
|
875
|
+
* package base must come from `packageBaseFromName`, never from this. */
|
|
867
876
|
declare function slugify(name: string): string;
|
|
868
877
|
/** `{base}-standard` is the longest tier slug; slugs cap at 48 chars, so a
|
|
869
878
|
* package base may be at most 48 - "-standard".length. */
|
|
@@ -876,6 +885,10 @@ declare function parseServiceTierSlug(slug: string): {
|
|
|
876
885
|
* shed so `{base}-basic` never carries `--`). Empty in → empty out —
|
|
877
886
|
* callers validate. */
|
|
878
887
|
declare function packageBaseSlug(slugified: string): string;
|
|
888
|
+
/** Package base from a display name — unbounded kebab, THEN the tier-base
|
|
889
|
+
* budget (trailing dashes shed), so every `{base}-{tier}` is a valid slug
|
|
890
|
+
* with its suffix intact. Mirrors console `packageBaseFromName`. */
|
|
891
|
+
declare function packageBaseFromName(name: string): string;
|
|
879
892
|
/** The three tier slugs for a base, Basic → Standard → Premium. */
|
|
880
893
|
declare function packageTierSlugs(base: string): {
|
|
881
894
|
tier: ServiceTier;
|
|
@@ -1440,4 +1453,4 @@ declare function fullHandle(label: string, parentName?: string): string;
|
|
|
1440
1453
|
*/
|
|
1441
1454
|
declare function displayHandle(label: string, parentName?: string): string;
|
|
1442
1455
|
|
|
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 };
|
|
1456
|
+
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_SLUG_LENGTH, 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, packageBaseFromName, 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, slugifyLoner, slugifyUnbounded, submitJobReview, trimDashes, updateProfile, upsertService, validateLabel, walletExists, writeLimitsFile };
|
package/dist/index.js
CHANGED
|
@@ -4000,8 +4000,15 @@ function trimDashes(s) {
|
|
|
4000
4000
|
while (end > start && s.charCodeAt(end - 1) === 45) end -= 1;
|
|
4001
4001
|
return s.slice(start, end);
|
|
4002
4002
|
}
|
|
4003
|
+
var MAX_SLUG_LENGTH = 48;
|
|
4004
|
+
function slugifyUnbounded(name) {
|
|
4005
|
+
return trimDashes(name.toLowerCase().replaceAll(/[^a-z0-9]+/g, "-"));
|
|
4006
|
+
}
|
|
4007
|
+
function slugifyLoner(name) {
|
|
4008
|
+
return slugifyUnbounded(name).slice(0, MAX_SLUG_LENGTH);
|
|
4009
|
+
}
|
|
4003
4010
|
function slugify(name) {
|
|
4004
|
-
return
|
|
4011
|
+
return slugifyLoner(name);
|
|
4005
4012
|
}
|
|
4006
4013
|
var TIER_SLUG_RE = /^(.+)-(basic|standard|premium)$/;
|
|
4007
4014
|
var MAX_TIER_BASE_LENGTH = 48 - "-standard".length;
|
|
@@ -4018,6 +4025,9 @@ function packageBaseSlug(slugified) {
|
|
|
4018
4025
|
while (end > 0 && cut.charCodeAt(end - 1) === 45) end -= 1;
|
|
4019
4026
|
return cut.slice(0, end);
|
|
4020
4027
|
}
|
|
4028
|
+
function packageBaseFromName(name) {
|
|
4029
|
+
return packageBaseSlug(slugifyUnbounded(name));
|
|
4030
|
+
}
|
|
4021
4031
|
function packageTierSlugs(base) {
|
|
4022
4032
|
return SERVICE_TIERS.map((tier) => ({ tier, slug: `${base}-${tier}` }));
|
|
4023
4033
|
}
|
|
@@ -4115,7 +4125,7 @@ function planPackage(input) {
|
|
|
4115
4125
|
if (!name) {
|
|
4116
4126
|
throw invalidInput("name is required.");
|
|
4117
4127
|
}
|
|
4118
|
-
const base =
|
|
4128
|
+
const base = input.baseSlug ? packageBaseSlug(input.baseSlug.trim().toLowerCase()) : packageBaseFromName(name);
|
|
4119
4129
|
if (!base || !SERVICE_SLUG_RE.test(`${base}-basic`)) {
|
|
4120
4130
|
throw invalidInput(
|
|
4121
4131
|
"Could not derive a package slug from the name \u2014 pass baseSlug (a-z, 0-9, dashes)."
|
|
@@ -4789,4 +4799,4 @@ function displayHandle(label, parentName = AUDRIC_PARENT_NAME) {
|
|
|
4789
4799
|
// src/index.ts
|
|
4790
4800
|
init_preflight();
|
|
4791
4801
|
|
|
4792
|
-
export { A2A_ESCROW_FEE_CONFIG_ID, A2A_ESCROW_LATEST_PACKAGE_ID, A2A_ESCROW_OPENING_PACKAGE_ID, A2A_ESCROW_PACKAGE_ID, A2A_ESCROW_PACKAGE_V2_ID, A2A_ESCROW_PACKAGE_V3_ID, A2A_ESCROW_PACKAGE_V6_ID, A2A_ESCROW_PACKAGE_V7_ID, A2A_ESCROW_PACKAGE_V8_ID, A2A_SCORE_BOARD_ID, AGENT_CATEGORIES, AUDRIC_PARENT, AUDRIC_PARENT_NAME, AUDRIC_PARENT_NFT_ID, CETUS_USDC_SUI_POOL, CLOCK_ID, COIN_REGISTRY, CommerceClient, DEFAULT_ACTIVITY_REPORT_URL, DEFAULT_API_BASE, DEFAULT_COMMERCE_API_BASE, DEFAULT_GRPC_URL, DEFAULT_NETWORK, ESCROW_JOB_TYPE_MARKER, ETH_TYPE, GASLESS_MIN_STABLE_AMOUNT, GASLESS_STABLE_TYPES, GAS_RESERVE_MIN, IKA_TYPE, InvalidAddressError, JOB_STATES, KNOWN_TARGETS, KeypairSigner, LABEL_PATTERNS, LOFI_TYPE, LimitEnforcer, LimitExceededError, MAINNET_A2A_ESCROW_LATEST_PACKAGE_ID, MAINNET_A2A_ESCROW_OPENING_PACKAGE_ID, MAINNET_A2A_ESCROW_PACKAGE_ID, MAINNET_A2A_SCORE_BOARD_ID, MANIFEST_TYPE, MAX_DELIVER_HORIZON_MS, MAX_JOB_USDC, MAX_OPEN_WINDOW_MS, MAX_REVIEW_WINDOW_MS, MAX_TIER_BASE_LENGTH, MIN_JOB_USDC, MIST_PER_SUI, NAVX_TYPE, OPENING_CLAIM_POLICIES, OPENING_CLAIM_POLICY_ANY_ACTIVE, OPENING_CLAIM_POLICY_PROVEN, OPENING_CLAIM_POLICY_PROVEN_4STAR, OPENING_TYPE_MARKER, OPERATION_ASSETS, OVERLAY_FEE_RATE, PREFLIGHT_MAX_AMOUNT, PREFLIGHT_OK, PROVEN_MIN_AVG_STARS_X10, PROVEN_MIN_REVIEWS, REVIEW_MAX_STARS, REVIEW_MIN_STARS, SENDABLE_ASSETS, SERVICE_SLUG_RE, SERVICE_TIERS, SPONSORED_PYTH_DEPENDENT_PROVIDERS, STABLE_ASSETS, SUINS_NAME_REGEX, SUI_ADDRESS_REGEX, SUI_ADDRESS_STRICT_REGEX, SUI_DECIMALS, SUI_TYPE, SUPPORTED_ASSETS, SuinsNotRegisteredError, SuinsRpcError, T2000, T2000Error, T2000_OVERLAY_FEE_WALLET, TOKEN_MAP, USDC_DECIMALS, USDC_TYPE, USDE_TYPE, USDSUI_TYPE, USDT_TYPE, WAL_TYPE, WBTC_TYPE, WRITE_APPENDER_REGISTRY, ZkLoginSigner, addSendToTx, addSwapToTx, agentResolveUrl, approxUsdValue, assertAllowedAsset, assertBuyerRequirements, assertLimitConfig, buildAddLeafTx, buildCancelOpeningTx, buildClaimOpeningTx, buildCreateEmptyScoreTx, buildCreateJobTx, buildCreateOpeningTx, buildDeclineJobTx, buildDeliverJobTx, buildRefundJobTx, buildRefundUnclaimedTx, buildRejectJobTx, buildReleaseJobTx, buildRevokeLeafTx, buildSendTx, buildSubmitFirstReviewTx, buildSubmitReviewTx, buildSwapTx, cancelOpenJob, canonicalizeRecipientInput, chatCompletion, chatCompletionStream, checkPositiveAmount, checkSuiAddress, claimOpenJob, claimPolicyLabel, claimPolicyRequirement, classifyAction, classifyLabel, classifySendAsset, classifyTransaction, clearLimits, composeTx, createPackage, customHireEnvelope, dailySpentToday, deriveAgentScoreId, deriveAllowedAddressesFromPtb, deserializeCetusRoute, displayHandle, endpointIssueLines, ensureCategory, executeTx, exportPrivateKey, extractAllUserLegs, extractTransferDetails, extractTxCommands, extractTxSender, fallbackLabel, fetchAllCoins, fetchChallengeNonce, fetchService, findSwapRoute, formatAssetAmount, formatSui, formatUsd, fullHandle, generateKeypair, getAddress, getAgentProfile, getAgentScore, getCoinMeta, getDecimals, getDecimalsForCoinType, getJob, getJobSpec, getLimits, getOpenJob, getOpening, getSponsoredSwapProviders, getSuiClient, getSuiGrpcClient, getSwapQuote, hasLimits, invalidSendAssetMessage, isAllowedAsset, isCetusRouteFresh, isCustomHireEnvelope, isInRegistry, jobActionsFor, keypairFromPrivateKey, listEndpoint, listModels, listOpenJobs, listServices, loadKey, looksLikeSuiNs, mapMoveAbortCode, mapWalletError, meetsClaimPolicy, mistToSui, normalizeAddressInput, normalizeAsset, normalizeCoinType, packageBaseSlug, packageTierSlugs, parseAgentCategory, parseServiceTierSlug, parseSuiRpcTx, payWithX402, planPackage, postOpenJob, preflightCreateJob, preflightCreateOpening, preflightFail, preflightPay, preflightSend, preflightSwap, probeX402, profileChallengeMessage, putJobSpec, queryBalance, queryHistory, queryTransaction, rawToStable, rawToUsdc, readLimitsFile, recordDailySpend, refineLendingLabel, refundOpenJob, registerAgent, removeEndpoint, reportX402Activity, resolveAddressToSuinsViaRpc, resolveAgentRef, resolveCreatedObjectId, resolveSuinsViaRpc, resolveSymbol, resolveTokenType, retireService, saveBech32, saveKey, selectAndSplitCoin, selectSuiCoin, serializeCetusRoute, serviceChallengeMessage, servicePayloadSha256, serviceUpsertPayload, setLimits, setSponsoredTxGuard, signChallenge, simulateTransaction, slugify, stableToRaw, submitJobReview, suiToMist, throwIfSimulationFailed, trimDashes, truncateAddress, updateProfile, upsertService, usdcToRaw, validateAddress, validateLabel, verifyCetusRouteCoinMatch, verifyJobForSeller, walletExists, writeLimitsFile };
|
|
4802
|
+
export { A2A_ESCROW_FEE_CONFIG_ID, A2A_ESCROW_LATEST_PACKAGE_ID, A2A_ESCROW_OPENING_PACKAGE_ID, A2A_ESCROW_PACKAGE_ID, A2A_ESCROW_PACKAGE_V2_ID, A2A_ESCROW_PACKAGE_V3_ID, A2A_ESCROW_PACKAGE_V6_ID, A2A_ESCROW_PACKAGE_V7_ID, A2A_ESCROW_PACKAGE_V8_ID, A2A_SCORE_BOARD_ID, AGENT_CATEGORIES, AUDRIC_PARENT, AUDRIC_PARENT_NAME, AUDRIC_PARENT_NFT_ID, CETUS_USDC_SUI_POOL, CLOCK_ID, COIN_REGISTRY, CommerceClient, DEFAULT_ACTIVITY_REPORT_URL, DEFAULT_API_BASE, DEFAULT_COMMERCE_API_BASE, DEFAULT_GRPC_URL, DEFAULT_NETWORK, ESCROW_JOB_TYPE_MARKER, ETH_TYPE, GASLESS_MIN_STABLE_AMOUNT, GASLESS_STABLE_TYPES, GAS_RESERVE_MIN, IKA_TYPE, InvalidAddressError, JOB_STATES, KNOWN_TARGETS, KeypairSigner, LABEL_PATTERNS, LOFI_TYPE, LimitEnforcer, LimitExceededError, MAINNET_A2A_ESCROW_LATEST_PACKAGE_ID, MAINNET_A2A_ESCROW_OPENING_PACKAGE_ID, MAINNET_A2A_ESCROW_PACKAGE_ID, MAINNET_A2A_SCORE_BOARD_ID, MANIFEST_TYPE, MAX_DELIVER_HORIZON_MS, MAX_JOB_USDC, MAX_OPEN_WINDOW_MS, MAX_REVIEW_WINDOW_MS, MAX_SLUG_LENGTH, MAX_TIER_BASE_LENGTH, MIN_JOB_USDC, MIST_PER_SUI, NAVX_TYPE, OPENING_CLAIM_POLICIES, OPENING_CLAIM_POLICY_ANY_ACTIVE, OPENING_CLAIM_POLICY_PROVEN, OPENING_CLAIM_POLICY_PROVEN_4STAR, OPENING_TYPE_MARKER, OPERATION_ASSETS, OVERLAY_FEE_RATE, PREFLIGHT_MAX_AMOUNT, PREFLIGHT_OK, PROVEN_MIN_AVG_STARS_X10, PROVEN_MIN_REVIEWS, REVIEW_MAX_STARS, REVIEW_MIN_STARS, SENDABLE_ASSETS, SERVICE_SLUG_RE, SERVICE_TIERS, SPONSORED_PYTH_DEPENDENT_PROVIDERS, STABLE_ASSETS, SUINS_NAME_REGEX, SUI_ADDRESS_REGEX, SUI_ADDRESS_STRICT_REGEX, SUI_DECIMALS, SUI_TYPE, SUPPORTED_ASSETS, SuinsNotRegisteredError, SuinsRpcError, T2000, T2000Error, T2000_OVERLAY_FEE_WALLET, TOKEN_MAP, USDC_DECIMALS, USDC_TYPE, USDE_TYPE, USDSUI_TYPE, USDT_TYPE, WAL_TYPE, WBTC_TYPE, WRITE_APPENDER_REGISTRY, ZkLoginSigner, addSendToTx, addSwapToTx, agentResolveUrl, approxUsdValue, assertAllowedAsset, assertBuyerRequirements, assertLimitConfig, buildAddLeafTx, buildCancelOpeningTx, buildClaimOpeningTx, buildCreateEmptyScoreTx, buildCreateJobTx, buildCreateOpeningTx, buildDeclineJobTx, buildDeliverJobTx, buildRefundJobTx, buildRefundUnclaimedTx, buildRejectJobTx, buildReleaseJobTx, buildRevokeLeafTx, buildSendTx, buildSubmitFirstReviewTx, buildSubmitReviewTx, buildSwapTx, cancelOpenJob, canonicalizeRecipientInput, chatCompletion, chatCompletionStream, checkPositiveAmount, checkSuiAddress, claimOpenJob, claimPolicyLabel, claimPolicyRequirement, classifyAction, classifyLabel, classifySendAsset, classifyTransaction, clearLimits, composeTx, createPackage, customHireEnvelope, dailySpentToday, deriveAgentScoreId, deriveAllowedAddressesFromPtb, deserializeCetusRoute, displayHandle, endpointIssueLines, ensureCategory, executeTx, exportPrivateKey, extractAllUserLegs, extractTransferDetails, extractTxCommands, extractTxSender, fallbackLabel, fetchAllCoins, fetchChallengeNonce, fetchService, findSwapRoute, formatAssetAmount, formatSui, formatUsd, fullHandle, generateKeypair, getAddress, getAgentProfile, getAgentScore, getCoinMeta, getDecimals, getDecimalsForCoinType, getJob, getJobSpec, getLimits, getOpenJob, getOpening, getSponsoredSwapProviders, getSuiClient, getSuiGrpcClient, getSwapQuote, hasLimits, invalidSendAssetMessage, isAllowedAsset, isCetusRouteFresh, isCustomHireEnvelope, isInRegistry, jobActionsFor, keypairFromPrivateKey, listEndpoint, listModels, listOpenJobs, listServices, loadKey, looksLikeSuiNs, mapMoveAbortCode, mapWalletError, meetsClaimPolicy, mistToSui, normalizeAddressInput, normalizeAsset, normalizeCoinType, packageBaseFromName, packageBaseSlug, packageTierSlugs, parseAgentCategory, parseServiceTierSlug, parseSuiRpcTx, payWithX402, planPackage, postOpenJob, preflightCreateJob, preflightCreateOpening, preflightFail, preflightPay, preflightSend, preflightSwap, probeX402, profileChallengeMessage, putJobSpec, queryBalance, queryHistory, queryTransaction, rawToStable, rawToUsdc, readLimitsFile, recordDailySpend, refineLendingLabel, refundOpenJob, registerAgent, removeEndpoint, reportX402Activity, resolveAddressToSuinsViaRpc, resolveAgentRef, resolveCreatedObjectId, resolveSuinsViaRpc, resolveSymbol, resolveTokenType, retireService, saveBech32, saveKey, selectAndSplitCoin, selectSuiCoin, serializeCetusRoute, serviceChallengeMessage, servicePayloadSha256, serviceUpsertPayload, setLimits, setSponsoredTxGuard, signChallenge, simulateTransaction, slugify, slugifyLoner, slugifyUnbounded, stableToRaw, submitJobReview, suiToMist, throwIfSimulationFailed, trimDashes, truncateAddress, updateProfile, upsertService, usdcToRaw, validateAddress, validateLabel, verifyCetusRouteCoinMatch, verifyJobForSeller, walletExists, writeLimitsFile };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@t2000/sdk",
|
|
3
|
-
"version": "10.37.
|
|
3
|
+
"version": "10.37.1",
|
|
4
4
|
"engines": {
|
|
5
5
|
"node": ">=20"
|
|
6
6
|
},
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"@phala/dcap-qvl": "^0.5.2",
|
|
56
56
|
"bn.js": "^5.2.1",
|
|
57
57
|
"eventemitter3": "^5",
|
|
58
|
-
"@t2000/sui-x402": "10.37.
|
|
58
|
+
"@t2000/sui-x402": "10.37.1"
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
|
61
61
|
"@types/bn.js": "^5.1.5",
|