@ghostspeak/sdk 1.6.0 → 1.6.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/.tsbuildinfo +1 -1
- package/dist/index.d.ts +18 -10
- package/dist/index.js +15 -12
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -12280,6 +12280,14 @@ interface RetryConfig {
|
|
|
12280
12280
|
backoffMultiplier?: number;
|
|
12281
12281
|
retryableErrors?: string[];
|
|
12282
12282
|
}
|
|
12283
|
+
interface AgentWithAddress {
|
|
12284
|
+
address: Address$1;
|
|
12285
|
+
data: Agent;
|
|
12286
|
+
}
|
|
12287
|
+
interface ServiceListingWithAddress {
|
|
12288
|
+
address: Address$1;
|
|
12289
|
+
data: ServiceListing;
|
|
12290
|
+
}
|
|
12283
12291
|
interface EmergencyConfig {
|
|
12284
12292
|
emergencyDelay?: bigint;
|
|
12285
12293
|
emergencyThreshold?: number;
|
|
@@ -12479,10 +12487,10 @@ declare class SimpleRpcClient {
|
|
|
12479
12487
|
getProgramAccounts(programId: Address$1, options?: {
|
|
12480
12488
|
filters?: unknown[];
|
|
12481
12489
|
commitment?: Commitment;
|
|
12482
|
-
}): Promise<
|
|
12490
|
+
}): Promise<{
|
|
12483
12491
|
pubkey: Address$1;
|
|
12484
12492
|
account: AccountInfo;
|
|
12485
|
-
}
|
|
12493
|
+
}[]>;
|
|
12486
12494
|
private parseAccountInfo;
|
|
12487
12495
|
}
|
|
12488
12496
|
|
|
@@ -12562,7 +12570,7 @@ declare abstract class BaseInstructions {
|
|
|
12562
12570
|
* Centralizes program account scanning pattern
|
|
12563
12571
|
* NOTE: Temporarily simplified due to RPC client complexity
|
|
12564
12572
|
*/
|
|
12565
|
-
protected getDecodedProgramAccounts<T>(decoderImportName: string,
|
|
12573
|
+
protected getDecodedProgramAccounts<T>(decoderImportName: string, _filters?: unknown[], _commitment?: Commitment$1): Promise<{
|
|
12566
12574
|
address: Address$1;
|
|
12567
12575
|
data: T;
|
|
12568
12576
|
}[]>;
|
|
@@ -12619,20 +12627,20 @@ declare class AgentInstructions extends BaseInstructions {
|
|
|
12619
12627
|
/**
|
|
12620
12628
|
* Search agents by capabilities using centralized pattern
|
|
12621
12629
|
*/
|
|
12622
|
-
searchByCapabilities(capabilities: string[]): Promise<
|
|
12630
|
+
searchByCapabilities(capabilities: string[]): Promise<AgentWithAddress[]>;
|
|
12623
12631
|
/**
|
|
12624
12632
|
* List agents (alias for getAllAgents for CLI compatibility)
|
|
12625
12633
|
*/
|
|
12626
12634
|
list(options?: {
|
|
12627
12635
|
limit?: number;
|
|
12628
12636
|
offset?: number;
|
|
12629
|
-
}): Promise<
|
|
12637
|
+
}): Promise<AgentWithAddress[]>;
|
|
12630
12638
|
/**
|
|
12631
12639
|
* Search agents (alias for searchByCapabilities for CLI compatibility)
|
|
12632
12640
|
*/
|
|
12633
12641
|
search(options: {
|
|
12634
12642
|
capabilities: string[];
|
|
12635
|
-
}): Promise<
|
|
12643
|
+
}): Promise<AgentWithAddress[]>;
|
|
12636
12644
|
/**
|
|
12637
12645
|
* Find the PDA for an agent account
|
|
12638
12646
|
*/
|
|
@@ -12648,7 +12656,7 @@ declare class AgentInstructions extends BaseInstructions {
|
|
|
12648
12656
|
*/
|
|
12649
12657
|
listByOwner(options: {
|
|
12650
12658
|
owner: Address$1;
|
|
12651
|
-
}): Promise<
|
|
12659
|
+
}): Promise<AgentWithAddress[]>;
|
|
12652
12660
|
/**
|
|
12653
12661
|
* Get agent status details
|
|
12654
12662
|
*/
|
|
@@ -12771,7 +12779,7 @@ declare class MarketplaceInstructions extends BaseInstructions {
|
|
|
12771
12779
|
/**
|
|
12772
12780
|
* Get all active service listings
|
|
12773
12781
|
*/
|
|
12774
|
-
getServiceListings(): Promise<
|
|
12782
|
+
getServiceListings(): Promise<ServiceListingWithAddress[]>;
|
|
12775
12783
|
/**
|
|
12776
12784
|
* Get all active job postings
|
|
12777
12785
|
*/
|
|
@@ -12779,7 +12787,7 @@ declare class MarketplaceInstructions extends BaseInstructions {
|
|
|
12779
12787
|
/**
|
|
12780
12788
|
* Search service listings by category
|
|
12781
12789
|
*/
|
|
12782
|
-
searchServicesByCategory(category: string): Promise<
|
|
12790
|
+
searchServicesByCategory(category: string): Promise<ServiceListingWithAddress[]>;
|
|
12783
12791
|
/**
|
|
12784
12792
|
* Search job postings by budget range
|
|
12785
12793
|
*/
|
|
@@ -14234,7 +14242,7 @@ declare class GhostSpeakClient {
|
|
|
14234
14242
|
/**
|
|
14235
14243
|
* Get all active service listings
|
|
14236
14244
|
*/
|
|
14237
|
-
getServiceListings(): Promise<
|
|
14245
|
+
getServiceListings(): Promise<ServiceListingWithAddress[]>;
|
|
14238
14246
|
/**
|
|
14239
14247
|
* Get all active job postings
|
|
14240
14248
|
*/
|
package/dist/index.js
CHANGED
|
@@ -21106,7 +21106,7 @@ var SimpleRpcClient = class {
|
|
|
21106
21106
|
* Simulate transaction
|
|
21107
21107
|
*/
|
|
21108
21108
|
async simulateTransaction(transaction, options) {
|
|
21109
|
-
return
|
|
21109
|
+
return this.rpc.simulateTransaction(transaction, {
|
|
21110
21110
|
commitment: options?.commitment ?? this.commitment,
|
|
21111
21111
|
replaceRecentBlockhash: options?.replaceRecentBlockhash ?? false
|
|
21112
21112
|
}).send();
|
|
@@ -21486,7 +21486,7 @@ var BaseInstructions = class {
|
|
|
21486
21486
|
* Centralizes program account scanning pattern
|
|
21487
21487
|
* NOTE: Temporarily simplified due to RPC client complexity
|
|
21488
21488
|
*/
|
|
21489
|
-
async getDecodedProgramAccounts(decoderImportName,
|
|
21489
|
+
async getDecodedProgramAccounts(decoderImportName, _filters = [], _commitment = this.commitment) {
|
|
21490
21490
|
console.warn(`getDecodedProgramAccounts temporarily disabled - using placeholder`);
|
|
21491
21491
|
return [];
|
|
21492
21492
|
}
|
|
@@ -21627,17 +21627,19 @@ var AgentInstructions = class extends BaseInstructions {
|
|
|
21627
21627
|
*/
|
|
21628
21628
|
async searchByCapabilities(capabilities) {
|
|
21629
21629
|
const accounts = await this.getDecodedProgramAccounts("getAgentDecoder");
|
|
21630
|
-
return accounts.
|
|
21631
|
-
(
|
|
21632
|
-
(capability) =>
|
|
21630
|
+
return accounts.filter(
|
|
21631
|
+
({ data }) => capabilities.some(
|
|
21632
|
+
(capability) => data.capabilities?.includes(capability)
|
|
21633
21633
|
)
|
|
21634
|
-
);
|
|
21634
|
+
).map(({ address: address2, data }) => ({ address: address2, data }));
|
|
21635
21635
|
}
|
|
21636
21636
|
/**
|
|
21637
21637
|
* List agents (alias for getAllAgents for CLI compatibility)
|
|
21638
21638
|
*/
|
|
21639
21639
|
async list(options = {}) {
|
|
21640
|
-
|
|
21640
|
+
const agents = await this.getAllAgents(options.limit ?? 100, options.offset ?? 0);
|
|
21641
|
+
const accounts = await this.getDecodedProgramAccounts("getAgentDecoder");
|
|
21642
|
+
return accounts.filter(({ data }) => agents.some((a) => JSON.stringify(a) === JSON.stringify(data))).map(({ address: address2, data }) => ({ address: address2, data }));
|
|
21641
21643
|
}
|
|
21642
21644
|
/**
|
|
21643
21645
|
* Search agents (alias for searchByCapabilities for CLI compatibility)
|
|
@@ -21663,7 +21665,7 @@ var AgentInstructions = class extends BaseInstructions {
|
|
|
21663
21665
|
*/
|
|
21664
21666
|
async listByOwner(options) {
|
|
21665
21667
|
const accounts = await this.getDecodedProgramAccounts("getAgentDecoder");
|
|
21666
|
-
return accounts.
|
|
21668
|
+
return accounts.filter(({ data }) => data.owner?.toString() === options.owner.toString()).map(({ address: address2, data }) => ({ address: address2, data }));
|
|
21667
21669
|
}
|
|
21668
21670
|
/**
|
|
21669
21671
|
* Get agent status details
|
|
@@ -21919,7 +21921,7 @@ var MarketplaceInstructions = class extends BaseInstructions {
|
|
|
21919
21921
|
*/
|
|
21920
21922
|
async getServiceListings() {
|
|
21921
21923
|
const accounts = await this.getDecodedProgramAccounts("getServiceListingDecoder");
|
|
21922
|
-
return accounts.
|
|
21924
|
+
return accounts.filter(({ data }) => data.isActive).map(({ address: address2, data }) => ({ address: address2, data }));
|
|
21923
21925
|
}
|
|
21924
21926
|
/**
|
|
21925
21927
|
* Get all active job postings
|
|
@@ -21933,9 +21935,10 @@ var MarketplaceInstructions = class extends BaseInstructions {
|
|
|
21933
21935
|
*/
|
|
21934
21936
|
async searchServicesByCategory(category) {
|
|
21935
21937
|
const allListings = await this.getServiceListings();
|
|
21936
|
-
return allListings.filter(
|
|
21937
|
-
|
|
21938
|
-
|
|
21938
|
+
return allListings.filter(({ data }) => {
|
|
21939
|
+
const service = data;
|
|
21940
|
+
return service.serviceType?.toLowerCase().includes(category.toLowerCase()) || service.tags?.some((tag) => tag.toLowerCase().includes(category.toLowerCase()));
|
|
21941
|
+
});
|
|
21939
21942
|
}
|
|
21940
21943
|
/**
|
|
21941
21944
|
* Search job postings by budget range
|