@ghostspeak/sdk 2.0.7 → 2.0.8

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.
Files changed (54) hide show
  1. package/README.md +145 -2
  2. package/dist/{GhostSpeakClient-CWmGaM9Q.d.ts → GhostSpeakClient-bnXwUPHI.d.ts} +10 -6
  3. package/dist/{StakingModule-C5rzuOWb.d.ts → StakingModule-DunDShLq.d.ts} +263 -343
  4. package/dist/{agent-5YLZ7DAC.js → agent-S42FIMR7.js} +3 -3
  5. package/dist/{agent-5YLZ7DAC.js.map → agent-S42FIMR7.js.map} +1 -1
  6. package/dist/browser-CI5_6Gzk.d.ts +234 -0
  7. package/dist/browser.d.ts +3 -64
  8. package/dist/browser.js +9 -9
  9. package/dist/{chunk-SFTSZ3LC.js → chunk-46QWY3MG.js} +3 -3
  10. package/dist/{chunk-SFTSZ3LC.js.map → chunk-46QWY3MG.js.map} +1 -1
  11. package/dist/{chunk-G7S6B6WB.js → chunk-5QBSC4T4.js} +7 -7
  12. package/dist/{chunk-G7S6B6WB.js.map → chunk-5QBSC4T4.js.map} +1 -1
  13. package/dist/{chunk-IHVDQ4YI.js → chunk-5QZVFUXB.js} +201 -256
  14. package/dist/chunk-5QZVFUXB.js.map +1 -0
  15. package/dist/{chunk-E3FD2CNY.js → chunk-6XCCMJ6M.js} +19 -23
  16. package/dist/chunk-6XCCMJ6M.js.map +1 -0
  17. package/dist/{chunk-JV2SWONF.js → chunk-A7ALCVUI.js} +3 -3
  18. package/dist/{chunk-JV2SWONF.js.map → chunk-A7ALCVUI.js.map} +1 -1
  19. package/dist/{chunk-AL3HQN73.js → chunk-AWMGX3OX.js} +172 -112
  20. package/dist/chunk-AWMGX3OX.js.map +1 -0
  21. package/dist/{chunk-S74EH3KD.js → chunk-IQM5RASO.js} +637 -25
  22. package/dist/chunk-IQM5RASO.js.map +1 -0
  23. package/dist/{chunk-SZGFSCNU.js → chunk-JYXSOXCP.js} +467 -299
  24. package/dist/chunk-JYXSOXCP.js.map +1 -0
  25. package/dist/{chunk-C5CDA3WX.js → chunk-OXA7MECJ.js} +476 -3
  26. package/dist/chunk-OXA7MECJ.js.map +1 -0
  27. package/dist/{chunk-KB6CKIUK.js → chunk-QLRWUHN2.js} +3 -3
  28. package/dist/{chunk-KB6CKIUK.js.map → chunk-QLRWUHN2.js.map} +1 -1
  29. package/dist/client.d.ts +2 -3
  30. package/dist/client.js +9 -9
  31. package/dist/{createAgentAuthorization-ULG47ZJI.js → createAgentAuthorization-KGZNXZBT.js} +4 -4
  32. package/dist/{createAgentAuthorization-ULG47ZJI.js.map → createAgentAuthorization-KGZNXZBT.js.map} +1 -1
  33. package/dist/generated-QJREJQ2C.js +9 -0
  34. package/dist/{generated-EG5USUFG.js.map → generated-QJREJQ2C.js.map} +1 -1
  35. package/dist/index.d.ts +209 -231
  36. package/dist/index.js +231 -521
  37. package/dist/index.js.map +1 -1
  38. package/dist/metafile-esm.json +1 -1
  39. package/dist/minimal/core-minimal.d.ts +266 -184
  40. package/dist/minimal/core-minimal.js +6 -6
  41. package/dist/minimal/core-minimal.js.map +1 -1
  42. package/dist/{revokeAuthorization-OK7E7OK3.js → revokeAuthorization-2ZRO6GUZ.js} +4 -4
  43. package/dist/{revokeAuthorization-OK7E7OK3.js.map → revokeAuthorization-2ZRO6GUZ.js.map} +1 -1
  44. package/dist/{updateReputationWithAuth-Y4ONEVSP.js → updateReputationWithAuth-PCEUOCFV.js} +4 -4
  45. package/dist/{updateReputationWithAuth-Y4ONEVSP.js.map → updateReputationWithAuth-PCEUOCFV.js.map} +1 -1
  46. package/dist/utils.js +9 -9
  47. package/package.json +4 -4
  48. package/dist/chunk-AL3HQN73.js.map +0 -1
  49. package/dist/chunk-C5CDA3WX.js.map +0 -1
  50. package/dist/chunk-E3FD2CNY.js.map +0 -1
  51. package/dist/chunk-IHVDQ4YI.js.map +0 -1
  52. package/dist/chunk-S74EH3KD.js.map +0 -1
  53. package/dist/chunk-SZGFSCNU.js.map +0 -1
  54. package/dist/generated-EG5USUFG.js +0 -9
@@ -750,6 +750,31 @@ var PRIVACY_CONSTANTS = {
750
750
 
751
751
  // src/types/index.ts
752
752
  init_reputation_tags();
753
+
754
+ // src/types/api-types.ts
755
+ var GhostNotFoundError = class extends Error {
756
+ constructor(address2) {
757
+ super(`Ghost not found: ${address2}`);
758
+ this.name = "GhostNotFoundError";
759
+ }
760
+ };
761
+ var ExternalIdNotFoundError = class extends Error {
762
+ constructor(platform, externalId) {
763
+ super(`No Ghost found for ${platform}:${externalId}`);
764
+ this.platform = platform;
765
+ this.externalId = externalId;
766
+ this.name = "ExternalIdNotFoundError";
767
+ }
768
+ };
769
+
770
+ // src/types/index.ts
771
+ var GhostSpeakError = class extends Error {
772
+ constructor(message, code) {
773
+ super(message);
774
+ this.code = code;
775
+ this.name = "GhostSpeakError";
776
+ }
777
+ };
753
778
  function isIPFSUploadResponse(data) {
754
779
  if (typeof data !== "object" || data === null) return false;
755
780
  const obj = data;
@@ -1112,6 +1137,224 @@ var instructionAccountMappings = {
1112
1137
  }
1113
1138
  ]
1114
1139
  },
1140
+ "auto_create_ghost": {
1141
+ "name": "auto_create_ghost",
1142
+ "expectedAccounts": [
1143
+ {
1144
+ "name": "agent_account",
1145
+ "pda": true
1146
+ },
1147
+ {
1148
+ "name": "authority",
1149
+ "pda": false
1150
+ },
1151
+ {
1152
+ "name": "system_program",
1153
+ "pda": false
1154
+ }
1155
+ ],
1156
+ "accounts": [
1157
+ {
1158
+ "name": "agent_account",
1159
+ "writable": true,
1160
+ "signer": false,
1161
+ "optional": false,
1162
+ "docs": [],
1163
+ "pda": {
1164
+ "seeds": [
1165
+ {
1166
+ "kind": "const",
1167
+ "value": [
1168
+ 97,
1169
+ 103,
1170
+ 101,
1171
+ 110,
1172
+ 116
1173
+ ]
1174
+ },
1175
+ {
1176
+ "kind": "arg",
1177
+ "path": "payment_address"
1178
+ }
1179
+ ]
1180
+ }
1181
+ },
1182
+ {
1183
+ "name": "authority",
1184
+ "writable": true,
1185
+ "signer": true,
1186
+ "optional": false,
1187
+ "docs": []
1188
+ },
1189
+ {
1190
+ "name": "system_program",
1191
+ "writable": false,
1192
+ "signer": false,
1193
+ "optional": false,
1194
+ "docs": [],
1195
+ "address": "11111111111111111111111111111111"
1196
+ }
1197
+ ],
1198
+ "docs": 'Auto-create a Ghost from discovered x402 transaction (indexer service only) Used by the off-chain indexer service when it discovers a new agent via x402 payment transactions. Creates an Unregistered Ghost. Parameters: - payment_address: The x402_payment_address (merchant address) of the discovered agent - first_tx_signature: Transaction signature where this agent was first discovered - discovery_source: Source identifier (e.g., "http:payai", "blockchain:direct") - initial_ghost_score: Optional initial Ghost Score from backfill metrics',
1199
+ "discriminator": [
1200
+ 50,
1201
+ 170,
1202
+ 232,
1203
+ 73,
1204
+ 238,
1205
+ 200,
1206
+ 180,
1207
+ 16
1208
+ ],
1209
+ "args": [
1210
+ {
1211
+ "name": "payment_address",
1212
+ "type": "pubkey"
1213
+ },
1214
+ {
1215
+ "name": "first_tx_signature",
1216
+ "type": "string"
1217
+ },
1218
+ {
1219
+ "name": "discovery_source",
1220
+ "type": "string"
1221
+ },
1222
+ {
1223
+ "name": "initial_ghost_score",
1224
+ "type": {
1225
+ "option": "u64"
1226
+ }
1227
+ }
1228
+ ]
1229
+ },
1230
+ "claim_ghost": {
1231
+ "name": "claim_ghost",
1232
+ "expectedAccounts": [
1233
+ {
1234
+ "name": "agent_account",
1235
+ "pda": false
1236
+ },
1237
+ {
1238
+ "name": "did_document",
1239
+ "pda": true
1240
+ },
1241
+ {
1242
+ "name": "sas_attestation",
1243
+ "pda": false
1244
+ },
1245
+ {
1246
+ "name": "claimer",
1247
+ "pda": false
1248
+ },
1249
+ {
1250
+ "name": "system_program",
1251
+ "pda": false
1252
+ }
1253
+ ],
1254
+ "accounts": [
1255
+ {
1256
+ "name": "agent_account",
1257
+ "writable": true,
1258
+ "signer": false,
1259
+ "optional": false,
1260
+ "docs": []
1261
+ },
1262
+ {
1263
+ "name": "did_document",
1264
+ "writable": true,
1265
+ "signer": false,
1266
+ "optional": false,
1267
+ "docs": [
1268
+ "DID document to create for this Ghost",
1269
+ 'Seeds: [b"did_document", agent_account.x402_payment_address.as_ref()]'
1270
+ ],
1271
+ "pda": {
1272
+ "seeds": [
1273
+ {
1274
+ "kind": "const",
1275
+ "value": [
1276
+ 100,
1277
+ 105,
1278
+ 100,
1279
+ 95,
1280
+ 100,
1281
+ 111,
1282
+ 99,
1283
+ 117,
1284
+ 109,
1285
+ 101,
1286
+ 110,
1287
+ 116
1288
+ ]
1289
+ },
1290
+ {
1291
+ "kind": "account",
1292
+ "path": "agent_account.x402_payment_address",
1293
+ "account": "Agent"
1294
+ }
1295
+ ]
1296
+ }
1297
+ },
1298
+ {
1299
+ "name": "sas_attestation",
1300
+ "writable": false,
1301
+ "signer": false,
1302
+ "optional": false,
1303
+ "docs": [
1304
+ "SAS Attestation proving ownership of x402_payment_address",
1305
+ 'PDA: [b"attestation", sas_credential, sas_schema, x402_payment_address]'
1306
+ ]
1307
+ },
1308
+ {
1309
+ "name": "claimer",
1310
+ "writable": true,
1311
+ "signer": true,
1312
+ "optional": false,
1313
+ "docs": [
1314
+ "The claimer must have created a SAS attestation proving they own x402_payment_address"
1315
+ ]
1316
+ },
1317
+ {
1318
+ "name": "system_program",
1319
+ "writable": false,
1320
+ "signer": false,
1321
+ "optional": false,
1322
+ "docs": [],
1323
+ "address": "11111111111111111111111111111111"
1324
+ }
1325
+ ],
1326
+ "docs": 'Claim ownership of a Ghost using Solana Attestation Service (SAS) Security: Uses SAS for trustless ownership verification. The claimer must have created a SAS attestation proving they own the x402_payment_address. Auto-creates: DID document with did:sol:<network>:<address> format Transitions: Unregistered/Registered \u2192 Claimed SAS Attestation Requirements: - Credential: GhostSpeak ownership credential (issuer) - Schema: Ghost ownership schema defining attestation data structure - Nonce: x402_payment_address (ensures PDA uniqueness) - Data: Contains x402_payment_address as proof of ownership Parameters: - sas_credential: Pubkey of the SAS Credential (issuer) for ownership attestations - sas_schema: Pubkey of the SAS Schema defining the ownership attestation format - ipfs_metadata_uri: Optional IPFS URI for agent metadata (ipfs://...) - network: Network identifier ("devnet", "mainnet-beta", "testnet")',
1327
+ "discriminator": [
1328
+ 149,
1329
+ 107,
1330
+ 35,
1331
+ 233,
1332
+ 252,
1333
+ 101,
1334
+ 148,
1335
+ 225
1336
+ ],
1337
+ "args": [
1338
+ {
1339
+ "name": "sas_credential",
1340
+ "type": "pubkey"
1341
+ },
1342
+ {
1343
+ "name": "sas_schema",
1344
+ "type": "pubkey"
1345
+ },
1346
+ {
1347
+ "name": "ipfs_metadata_uri",
1348
+ "type": {
1349
+ "option": "string"
1350
+ }
1351
+ },
1352
+ {
1353
+ "name": "network",
1354
+ "type": "string"
1355
+ }
1356
+ ]
1357
+ },
1115
1358
  "create_agent_authorization": {
1116
1359
  "name": "create_agent_authorization",
1117
1360
  "expectedAccounts": [
@@ -3206,6 +3449,111 @@ var instructionAccountMappings = {
3206
3449
  }
3207
3450
  ]
3208
3451
  },
3452
+ "link_external_id": {
3453
+ "name": "link_external_id",
3454
+ "expectedAccounts": [
3455
+ {
3456
+ "name": "agent_account",
3457
+ "pda": false
3458
+ },
3459
+ {
3460
+ "name": "external_id_mapping",
3461
+ "pda": true
3462
+ },
3463
+ {
3464
+ "name": "authority",
3465
+ "pda": false
3466
+ },
3467
+ {
3468
+ "name": "system_program",
3469
+ "pda": false
3470
+ }
3471
+ ],
3472
+ "accounts": [
3473
+ {
3474
+ "name": "agent_account",
3475
+ "writable": true,
3476
+ "signer": false,
3477
+ "optional": false,
3478
+ "docs": []
3479
+ },
3480
+ {
3481
+ "name": "external_id_mapping",
3482
+ "writable": true,
3483
+ "signer": false,
3484
+ "optional": false,
3485
+ "docs": [],
3486
+ "pda": {
3487
+ "seeds": [
3488
+ {
3489
+ "kind": "const",
3490
+ "value": [
3491
+ 101,
3492
+ 120,
3493
+ 116,
3494
+ 101,
3495
+ 114,
3496
+ 110,
3497
+ 97,
3498
+ 108,
3499
+ 95,
3500
+ 105,
3501
+ 100
3502
+ ]
3503
+ },
3504
+ {
3505
+ "kind": "arg",
3506
+ "path": "platform"
3507
+ },
3508
+ {
3509
+ "kind": "arg",
3510
+ "path": "external_id"
3511
+ }
3512
+ ]
3513
+ }
3514
+ },
3515
+ {
3516
+ "name": "authority",
3517
+ "writable": true,
3518
+ "signer": true,
3519
+ "optional": false,
3520
+ "docs": []
3521
+ },
3522
+ {
3523
+ "name": "system_program",
3524
+ "writable": false,
3525
+ "signer": false,
3526
+ "optional": false,
3527
+ "docs": [],
3528
+ "address": "11111111111111111111111111111111"
3529
+ }
3530
+ ],
3531
+ "docs": 'Link a platform-specific external ID to a Ghost Creates a cross-platform identity mapping for this Ghost. Only the Ghost owner can link external IDs. Parameters: - platform: Platform identifier (e.g., "payai", "eliza", "github") (max 32 chars) - external_id: Platform-specific agent ID (max 128 chars) - verified: Whether this external ID has been verified',
3532
+ "discriminator": [
3533
+ 156,
3534
+ 102,
3535
+ 141,
3536
+ 155,
3537
+ 175,
3538
+ 13,
3539
+ 29,
3540
+ 86
3541
+ ],
3542
+ "args": [
3543
+ {
3544
+ "name": "platform",
3545
+ "type": "string"
3546
+ },
3547
+ {
3548
+ "name": "external_id",
3549
+ "type": "string"
3550
+ },
3551
+ {
3552
+ "name": "verified",
3553
+ "type": "bool"
3554
+ }
3555
+ ]
3556
+ },
3209
3557
  "manage_agent_status": {
3210
3558
  "name": "manage_agent_status",
3211
3559
  "expectedAccounts": [
@@ -3778,6 +4126,71 @@ var instructionAccountMappings = {
3778
4126
  }
3779
4127
  ]
3780
4128
  },
4129
+ "register_ghost_metadata": {
4130
+ "name": "register_ghost_metadata",
4131
+ "expectedAccounts": [
4132
+ {
4133
+ "name": "agent_account",
4134
+ "pda": false
4135
+ },
4136
+ {
4137
+ "name": "authority",
4138
+ "pda": false
4139
+ }
4140
+ ],
4141
+ "accounts": [
4142
+ {
4143
+ "name": "agent_account",
4144
+ "writable": true,
4145
+ "signer": false,
4146
+ "optional": false,
4147
+ "docs": []
4148
+ },
4149
+ {
4150
+ "name": "authority",
4151
+ "writable": true,
4152
+ "signer": true,
4153
+ "optional": false,
4154
+ "docs": [
4155
+ "Anyone can add metadata to an Unregistered Ghost",
4156
+ "Claiming proves ownership later"
4157
+ ]
4158
+ }
4159
+ ],
4160
+ "docs": "Register metadata for an Unregistered Ghost Adds name, description, capabilities, and service endpoint to a discovered Ghost. Transitions: Unregistered \u2192 Registered Anyone can add metadata to an Unregistered Ghost. Parameters: - name: Agent name (max 64 chars) - description: Agent description (max 128 chars) - capabilities: List of capabilities (max 5) - service_endpoint: Optional HTTP endpoint for the agent service",
4161
+ "discriminator": [
4162
+ 34,
4163
+ 233,
4164
+ 111,
4165
+ 236,
4166
+ 212,
4167
+ 22,
4168
+ 26,
4169
+ 254
4170
+ ],
4171
+ "args": [
4172
+ {
4173
+ "name": "name",
4174
+ "type": "string"
4175
+ },
4176
+ {
4177
+ "name": "description",
4178
+ "type": "string"
4179
+ },
4180
+ {
4181
+ "name": "capabilities",
4182
+ "type": {
4183
+ "vec": "string"
4184
+ }
4185
+ },
4186
+ {
4187
+ "name": "service_endpoint",
4188
+ "type": {
4189
+ "option": "string"
4190
+ }
4191
+ }
4192
+ ]
4193
+ },
3781
4194
  "reset_reentrancy_guard": {
3782
4195
  "name": "reset_reentrancy_guard",
3783
4196
  "expectedAccounts": [
@@ -5224,6 +5637,66 @@ var instructionAccountMappings = {
5224
5637
  }
5225
5638
  ]
5226
5639
  },
5640
+ "update_ghost_score": {
5641
+ "name": "update_ghost_score",
5642
+ "expectedAccounts": [
5643
+ {
5644
+ "name": "agent_account",
5645
+ "pda": false
5646
+ },
5647
+ {
5648
+ "name": "authority",
5649
+ "pda": false
5650
+ }
5651
+ ],
5652
+ "accounts": [
5653
+ {
5654
+ "name": "agent_account",
5655
+ "writable": true,
5656
+ "signer": false,
5657
+ "optional": false,
5658
+ "docs": []
5659
+ },
5660
+ {
5661
+ "name": "authority",
5662
+ "writable": false,
5663
+ "signer": true,
5664
+ "optional": false,
5665
+ "docs": [
5666
+ "Authority allowed to update scores (could be governance/oracle)"
5667
+ ]
5668
+ }
5669
+ ],
5670
+ "docs": "Update Ghost Score from off-chain calculation Called by the reputation oracle/calculator service. Updates the weighted Ghost Score and optionally the reputation components. Parameters: - new_score: New Ghost Score (0-1000) - components: Optional reputation component breakdown",
5671
+ "discriminator": [
5672
+ 213,
5673
+ 152,
5674
+ 5,
5675
+ 80,
5676
+ 163,
5677
+ 224,
5678
+ 151,
5679
+ 120
5680
+ ],
5681
+ "args": [
5682
+ {
5683
+ "name": "new_score",
5684
+ "type": "u64"
5685
+ },
5686
+ {
5687
+ "name": "components",
5688
+ "type": {
5689
+ "option": {
5690
+ "vec": {
5691
+ "defined": {
5692
+ "name": "ReputationComponent"
5693
+ }
5694
+ }
5695
+ }
5696
+ }
5697
+ }
5698
+ ]
5699
+ },
5227
5700
  "update_protocol_config": {
5228
5701
  "name": "update_protocol_config",
5229
5702
  "expectedAccounts": [
@@ -7309,6 +7782,6 @@ var ReputationCalculator = class {
7309
7782
  }
7310
7783
  };
7311
7784
 
7312
- export { ASSOCIATED_TOKEN_PROGRAM_ADDRESS, BadgeType, BehaviorTag, ComplianceTag, DEFAULT_TAG_DECAY, GhostSpeakSDKError, INSTRUCTION_MAPPINGS, IPFSClient, InstructionValidationError, NATIVE_MINT_ADDRESS, PRIVACY_CONSTANTS, PrivacyMode, PrivacyPresets, REPUTATION_CONSTANTS, ReputationCalculator, ReputationTagEngine, ReputationTier2 as ReputationTier, SYSTEM_PROGRAM_ADDRESS, ScoreRange, SkillTag, TAG_CONSTANTS, TOKEN_2022_PROGRAM_ADDRESS, TOKEN_PROGRAM_ADDRESS, TagCategory, TagConfidenceLevel, VisibilityLevel, createAccountMismatchError, createErrorContext, debugInstructionCall, enhanceErrorMessage, enhanceTransactionError, extractInstructionName, generateAccountValidationError, getAccountRequirements, getInstructionMapping, getPDAAccounts, getRequiredSigners, getWritableAccounts, init_reputation_tag_engine, init_reputation_tags, ipfs_client_exports, isKnownInstruction, logEnhancedError, reputation_tag_engine_exports, validateInstructionAccounts, validatePreconditions, withEnhancedErrors, withEnhancedErrorsSync };
7313
- //# sourceMappingURL=chunk-C5CDA3WX.js.map
7314
- //# sourceMappingURL=chunk-C5CDA3WX.js.map
7785
+ export { ASSOCIATED_TOKEN_PROGRAM_ADDRESS, BadgeType, BehaviorTag, ComplianceTag, DEFAULT_TAG_DECAY, ExternalIdNotFoundError, GhostNotFoundError, GhostSpeakError, GhostSpeakSDKError, INSTRUCTION_MAPPINGS, IPFSClient, InstructionValidationError, NATIVE_MINT_ADDRESS, PRIVACY_CONSTANTS, PrivacyMode, PrivacyPresets, REPUTATION_CONSTANTS, ReputationCalculator, ReputationTagEngine, ReputationTier2 as ReputationTier, SYSTEM_PROGRAM_ADDRESS, ScoreRange, SkillTag, TAG_CONSTANTS, TOKEN_2022_PROGRAM_ADDRESS, TOKEN_PROGRAM_ADDRESS, TagCategory, TagConfidenceLevel, VisibilityLevel, createAccountMismatchError, createErrorContext, debugInstructionCall, enhanceErrorMessage, enhanceTransactionError, extractInstructionName, generateAccountValidationError, getAccountRequirements, getInstructionMapping, getPDAAccounts, getRequiredSigners, getWritableAccounts, init_reputation_tag_engine, init_reputation_tags, ipfs_client_exports, isKnownInstruction, logEnhancedError, reputation_tag_engine_exports, validateInstructionAccounts, validatePreconditions, withEnhancedErrors, withEnhancedErrorsSync };
7786
+ //# sourceMappingURL=chunk-OXA7MECJ.js.map
7787
+ //# sourceMappingURL=chunk-OXA7MECJ.js.map