@topolo/sdk 0.2.8 → 0.2.9

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.d.cts CHANGED
@@ -32,39 +32,41 @@ interface AgentIdentity {
32
32
  }
33
33
 
34
34
  declare const SERVICES: {
35
- readonly agent: "https://topolo-agent-worker.topolo.workers.dev";
35
+ readonly agent: "https://agent-api.topolo.app";
36
36
  readonly auth: "https://auth.topolo.app";
37
37
  readonly books: "https://books.topolo.app";
38
38
  readonly bugfix: "https://bugfix.topolo.app";
39
- readonly bytes: "https://r2-media-manager-worker.topolo.workers.dev";
39
+ readonly bytes: "https://bytes-api.topolo.app";
40
40
  readonly calendar: "https://calendar.topolo.app";
41
- readonly capacity: "https://topolo-capacity.topolo.workers.dev";
41
+ readonly capacity: "https://capacity.topolo.app";
42
42
  readonly chat: "https://chat.topolo.app";
43
- readonly commerce: "https://topolo-commerce-api.topolo.workers.dev";
43
+ readonly commerce: "https://commerce-api.topolo.app";
44
44
  readonly compose: "https://compose.topolo.app";
45
45
  readonly crm: "https://crm-api.topolo.app";
46
46
  readonly customer_success: "https://customer-success.topolo.app";
47
- readonly feed: "https://topolo-feed-api.topolo.app";
47
+ readonly feed: "https://feed-api.topolo.app";
48
48
  readonly flow: "https://flow.topolo.app";
49
- readonly forecast: "https://forecast-worker-production.topolo.workers.dev";
49
+ readonly forecast: "https://forecast-api.topolo.app";
50
50
  readonly forms: "https://forms.topolo.app";
51
51
  readonly insights: "https://insights.topolo.app";
52
52
  readonly inventory: "https://inventory.topolo.app";
53
- readonly learn: "https://topololearn-api.topolo.workers.dev";
53
+ readonly learn: "https://learn-api.topolo.app";
54
54
  readonly mail: "https://mail.topolo.app";
55
- readonly mdm: "https://topolo-mdm-api.topolo.app";
55
+ readonly mdm: "https://mdm-api.topolo.app";
56
56
  readonly messaging: "https://messages.topolo.app";
57
- readonly nexus: "https://topolo-nexus-gateway.topolo.workers.dev";
57
+ readonly nexus: "https://nexus-api.topolo.app";
58
58
  readonly notify: "https://notify.topolo.app";
59
59
  readonly one: "https://one.topolo.app";
60
- readonly pay: "https://topolo-pay.topolo.workers.dev";
60
+ readonly "one.ai": "https://ai.one.topolo.app";
61
+ readonly p2p: "https://p2p.topolo.app";
62
+ readonly pay: "https://pay.topolo.app";
61
63
  readonly people: "https://people.topolo.app";
62
64
  readonly "quro.api": "https://api.ol0.me";
63
65
  readonly "quro.redirect": "https://ol0.me";
64
66
  readonly roadmapper: "https://roadmapper-api.topolo.app";
65
67
  readonly sign: "https://sign.topolo.app";
66
- readonly social_studio: "https://topolo-social-studio-api.topolo.workers.dev";
67
- readonly socialize: "https://socialize-prod-api.topolo.workers.dev";
68
+ readonly social_studio: "https://studio-api.topolo.app";
69
+ readonly socialize: "https://socialize-api.topolo.app";
68
70
  readonly support: "https://support.topolo.app";
69
71
  readonly survey: "https://survey.topolo.app";
70
72
  readonly voice: "https://voice.topolo.app";
@@ -85,7 +87,7 @@ declare const APPLICATIONS: {
85
87
  readonly name: "topoloadmin";
86
88
  readonly kind: "pages";
87
89
  readonly apiUrl: null;
88
- readonly domains: readonly [];
90
+ readonly domains: readonly ["admin.topolo.app"];
89
91
  readonly routes: readonly [];
90
92
  readonly serviceId: null;
91
93
  }];
@@ -101,14 +103,14 @@ declare const APPLICATIONS: {
101
103
  readonly name: "topolo-agent";
102
104
  readonly kind: "pages";
103
105
  readonly apiUrl: null;
104
- readonly domains: readonly [];
106
+ readonly domains: readonly ["agent.topolo.app"];
105
107
  readonly routes: readonly [];
106
108
  readonly serviceId: null;
107
109
  }, {
108
110
  readonly name: "topolo-agent-worker";
109
111
  readonly kind: "worker";
110
- readonly apiUrl: "https://topolo-agent-worker.topolo.workers.dev";
111
- readonly domains: readonly [];
112
+ readonly apiUrl: "https://agent-api.topolo.app";
113
+ readonly domains: readonly ["agent-api.topolo.app"];
112
114
  readonly routes: readonly [];
113
115
  readonly serviceId: "agent";
114
116
  }];
@@ -172,14 +174,14 @@ declare const APPLICATIONS: {
172
174
  readonly name: "bytes";
173
175
  readonly kind: "pages";
174
176
  readonly apiUrl: null;
175
- readonly domains: readonly [];
177
+ readonly domains: readonly ["bytes.topolo.app"];
176
178
  readonly routes: readonly [];
177
179
  readonly serviceId: null;
178
180
  }, {
179
181
  readonly name: "r2-media-manager-worker";
180
182
  readonly kind: "worker";
181
- readonly apiUrl: "https://r2-media-manager-worker.topolo.workers.dev";
182
- readonly domains: readonly [];
183
+ readonly apiUrl: "https://bytes-api.topolo.app";
184
+ readonly domains: readonly ["bytes-api.topolo.app"];
183
185
  readonly routes: readonly [];
184
186
  readonly serviceId: "bytes";
185
187
  }];
@@ -210,8 +212,8 @@ declare const APPLICATIONS: {
210
212
  readonly deployTargets: readonly [{
211
213
  readonly name: "topolo-capacity";
212
214
  readonly kind: "worker";
213
- readonly apiUrl: "https://topolo-capacity.topolo.workers.dev";
214
- readonly domains: readonly ["capacity.topolo.app", "topolo-capacity.topolo.workers.dev"];
215
+ readonly apiUrl: "https://capacity.topolo.app";
216
+ readonly domains: readonly ["capacity.topolo.app"];
215
217
  readonly routes: readonly [];
216
218
  readonly serviceId: "capacity";
217
219
  }];
@@ -260,29 +262,29 @@ declare const APPLICATIONS: {
260
262
  readonly deployTargets: readonly [{
261
263
  readonly name: "topolo-commerce-api";
262
264
  readonly kind: "worker";
263
- readonly apiUrl: "https://topolo-commerce-api.topolo.workers.dev";
264
- readonly domains: readonly ["topolo-commerce-api.topolo.workers.dev"];
265
+ readonly apiUrl: "https://commerce-api.topolo.app";
266
+ readonly domains: readonly ["commerce-api.topolo.app"];
265
267
  readonly routes: readonly [];
266
268
  readonly serviceId: "commerce";
267
269
  }, {
268
270
  readonly name: "topolo-commerce-guest-web";
269
271
  readonly kind: "pages";
270
272
  readonly apiUrl: null;
271
- readonly domains: readonly ["guest.topolo.app", "topolo-commerce-guest-web.pages.dev"];
273
+ readonly domains: readonly ["guest.topolo.app"];
272
274
  readonly routes: readonly [];
273
275
  readonly serviceId: null;
274
276
  }, {
275
277
  readonly name: "topolo-commerce-ops-web";
276
278
  readonly kind: "pages";
277
279
  readonly apiUrl: null;
278
- readonly domains: readonly ["commerce.topolo.app", "topolo-commerce-ops-web.pages.dev"];
280
+ readonly domains: readonly ["commerce.topolo.app"];
279
281
  readonly routes: readonly [];
280
282
  readonly serviceId: null;
281
283
  }, {
282
284
  readonly name: "topolo-commerce-station-web";
283
285
  readonly kind: "pages";
284
286
  readonly apiUrl: null;
285
- readonly domains: readonly ["station-commerce.topolo.app", "topolo-commerce-station-web.pages.dev"];
287
+ readonly domains: readonly ["station-commerce.topolo.app"];
286
288
  readonly routes: readonly [];
287
289
  readonly serviceId: null;
288
290
  }];
@@ -314,14 +316,14 @@ declare const APPLICATIONS: {
314
316
  readonly name: "topolo-crm-frontend";
315
317
  readonly kind: "pages";
316
318
  readonly apiUrl: null;
317
- readonly domains: readonly [];
319
+ readonly domains: readonly ["crm.topolo.app"];
318
320
  readonly routes: readonly [];
319
321
  readonly serviceId: null;
320
322
  }, {
321
323
  readonly name: "topolo-crm-worker";
322
324
  readonly kind: "worker";
323
325
  readonly apiUrl: "https://crm-api.topolo.app";
324
- readonly domains: readonly [];
326
+ readonly domains: readonly ["crm-api.topolo.app"];
325
327
  readonly routes: readonly [];
326
328
  readonly serviceId: "crm";
327
329
  }];
@@ -378,22 +380,22 @@ declare const APPLICATIONS: {
378
380
  readonly id: "feed";
379
381
  readonly appDir: "TopoloFeed";
380
382
  readonly name: "TopoloFeed";
381
- readonly packageName: null;
382
- readonly productionUrl: "https://topolo-feed-api.topolo.app";
383
+ readonly packageName: "topolo-feed";
384
+ readonly productionUrl: "https://feed-api.topolo.app";
383
385
  readonly services: readonly ["feed"];
384
386
  readonly deployTargets: readonly [{
385
387
  readonly name: "topolo-feed-analytics-api";
386
388
  readonly kind: "worker";
387
- readonly apiUrl: "https://topolo-feed-analytics-api.topolo.app";
388
- readonly domains: readonly ["topolo-feed-analytics-api.topolo.app"];
389
- readonly routes: readonly ["topolo-feed-analytics-api.topolo.app"];
389
+ readonly apiUrl: "https://feed-analytics-api.topolo.app";
390
+ readonly domains: readonly ["feed-analytics-api.topolo.app"];
391
+ readonly routes: readonly ["feed-analytics-api.topolo.app"];
390
392
  readonly serviceId: null;
391
393
  }, {
392
394
  readonly name: "topolo-feed-api";
393
395
  readonly kind: "worker";
394
- readonly apiUrl: "https://topolo-feed-api.topolo.app";
395
- readonly domains: readonly ["topolo-feed-api.topolo.app"];
396
- readonly routes: readonly ["topolo-feed-api.topolo.app"];
396
+ readonly apiUrl: "https://feed-api.topolo.app";
397
+ readonly domains: readonly ["feed-api.topolo.app"];
398
+ readonly routes: readonly ["feed-api.topolo.app"];
397
399
  readonly serviceId: "feed";
398
400
  }];
399
401
  };
@@ -424,14 +426,14 @@ declare const APPLICATIONS: {
424
426
  readonly name: "forecast";
425
427
  readonly kind: "pages";
426
428
  readonly apiUrl: null;
427
- readonly domains: readonly [];
429
+ readonly domains: readonly ["forecast.topolo.app"];
428
430
  readonly routes: readonly [];
429
431
  readonly serviceId: null;
430
432
  }, {
431
433
  readonly name: "forecast-worker-production";
432
434
  readonly kind: "worker";
433
- readonly apiUrl: "https://forecast-worker-production.topolo.workers.dev";
434
- readonly domains: readonly [];
435
+ readonly apiUrl: "https://forecast-api.topolo.app";
436
+ readonly domains: readonly ["forecast-api.topolo.app"];
435
437
  readonly routes: readonly [];
436
438
  readonly serviceId: "forecast";
437
439
  }];
@@ -501,8 +503,8 @@ declare const APPLICATIONS: {
501
503
  }, {
502
504
  readonly name: "topololearn-api";
503
505
  readonly kind: "worker";
504
- readonly apiUrl: "https://topololearn-api.topolo.workers.dev";
505
- readonly domains: readonly ["topololearn-api.topolo.workers.dev"];
506
+ readonly apiUrl: "https://learn-api.topolo.app";
507
+ readonly domains: readonly ["learn-api.topolo.app"];
506
508
  readonly routes: readonly [];
507
509
  readonly serviceId: "learn";
508
510
  }];
@@ -542,15 +544,15 @@ declare const APPLICATIONS: {
542
544
  readonly deployTargets: readonly [{
543
545
  readonly name: "topolo-mdm-api";
544
546
  readonly kind: "worker";
545
- readonly apiUrl: "https://topolo-mdm-api.topolo.app";
546
- readonly domains: readonly ["topolo-mdm-api.topolo.app"];
547
- readonly routes: readonly ["topolo-mdm-api.topolo.app"];
547
+ readonly apiUrl: "https://mdm-api.topolo.app";
548
+ readonly domains: readonly ["mdm-api.topolo.app"];
549
+ readonly routes: readonly ["mdm-api.topolo.app"];
548
550
  readonly serviceId: "mdm";
549
551
  }, {
550
552
  readonly name: "topolo-mdm-console";
551
553
  readonly kind: "pages";
552
554
  readonly apiUrl: null;
553
- readonly domains: readonly ["mdm.topolo.app", "topolo-mdm-console.pages.dev"];
555
+ readonly domains: readonly ["mdm.topolo.app"];
554
556
  readonly routes: readonly ["mdm.topolo.app"];
555
557
  readonly serviceId: null;
556
558
  }];
@@ -589,14 +591,14 @@ declare const APPLICATIONS: {
589
591
  readonly name: "topolo-nexus-dashboard";
590
592
  readonly kind: "pages";
591
593
  readonly apiUrl: null;
592
- readonly domains: readonly ["nexus.topolo.app", "topolo-nexus-dashboard.pages.dev"];
594
+ readonly domains: readonly ["nexus.topolo.app"];
593
595
  readonly routes: readonly [];
594
596
  readonly serviceId: null;
595
597
  }, {
596
598
  readonly name: "topolo-nexus-gateway";
597
599
  readonly kind: "worker";
598
- readonly apiUrl: "https://topolo-nexus-gateway.topolo.workers.dev";
599
- readonly domains: readonly ["topolo-nexus-gateway.topolo.workers.dev"];
600
+ readonly apiUrl: "https://nexus-api.topolo.app";
601
+ readonly domains: readonly ["nexus-api.topolo.app"];
600
602
  readonly routes: readonly [];
601
603
  readonly serviceId: "nexus";
602
604
  }];
@@ -623,19 +625,19 @@ declare const APPLICATIONS: {
623
625
  readonly name: "topolo-oneclick-sso";
624
626
  readonly packageName: "topolo-oneclick-sso";
625
627
  readonly productionUrl: "https://one.topolo.app";
626
- readonly services: readonly ["one"];
628
+ readonly services: readonly ["one", "one.ai"];
627
629
  readonly deployTargets: readonly [{
628
630
  readonly name: "ai-chat-rag";
629
631
  readonly kind: "worker";
630
- readonly apiUrl: null;
631
- readonly domains: readonly ["ai-chat-rag.topolo.workers.dev"];
632
+ readonly apiUrl: "https://ai.one.topolo.app";
633
+ readonly domains: readonly ["ai.one.topolo.app"];
632
634
  readonly routes: readonly [];
633
- readonly serviceId: null;
635
+ readonly serviceId: "one.ai";
634
636
  }, {
635
637
  readonly name: "topoloone";
636
638
  readonly kind: "pages";
637
639
  readonly apiUrl: null;
638
- readonly domains: readonly ["oneclick-dashboard.pages.dev"];
640
+ readonly domains: readonly ["one.topolo.app"];
639
641
  readonly routes: readonly [];
640
642
  readonly serviceId: null;
641
643
  }, {
@@ -649,11 +651,27 @@ declare const APPLICATIONS: {
649
651
  readonly name: "topoloone-worker";
650
652
  readonly kind: "worker";
651
653
  readonly apiUrl: "https://one.topolo.app";
652
- readonly domains: readonly [];
654
+ readonly domains: readonly ["one.topolo.app"];
653
655
  readonly routes: readonly ["one.topolo.app/*"];
654
656
  readonly serviceId: "one";
655
657
  }];
656
658
  };
659
+ readonly p2p: {
660
+ readonly id: "p2p";
661
+ readonly appDir: "TopoloP2P";
662
+ readonly name: "topolo-p2p";
663
+ readonly packageName: "topolo-p2p";
664
+ readonly productionUrl: "https://p2p.topolo.app";
665
+ readonly services: readonly ["p2p"];
666
+ readonly deployTargets: readonly [{
667
+ readonly name: "topolo-p2p";
668
+ readonly kind: "worker";
669
+ readonly apiUrl: "https://p2p.topolo.app";
670
+ readonly domains: readonly ["p2p.topolo.app"];
671
+ readonly routes: readonly ["p2p.topolo.app"];
672
+ readonly serviceId: "p2p";
673
+ }];
674
+ };
657
675
  readonly pay: {
658
676
  readonly id: "pay";
659
677
  readonly appDir: "TopoloPay";
@@ -664,8 +682,8 @@ declare const APPLICATIONS: {
664
682
  readonly deployTargets: readonly [{
665
683
  readonly name: "topolo-pay";
666
684
  readonly kind: "worker";
667
- readonly apiUrl: "https://topolo-pay.topolo.workers.dev";
668
- readonly domains: readonly [];
685
+ readonly apiUrl: "https://pay.topolo.app";
686
+ readonly domains: readonly ["pay.topolo.app"];
669
687
  readonly routes: readonly [];
670
688
  readonly serviceId: "pay";
671
689
  }];
@@ -697,21 +715,21 @@ declare const APPLICATIONS: {
697
715
  readonly name: "quro-api";
698
716
  readonly kind: "worker";
699
717
  readonly apiUrl: "https://api.ol0.me";
700
- readonly domains: readonly [];
718
+ readonly domains: readonly ["api.ol0.me"];
701
719
  readonly routes: readonly [];
702
720
  readonly serviceId: "quro.api";
703
721
  }, {
704
722
  readonly name: "quro-redirect-system";
705
723
  readonly kind: "worker";
706
724
  readonly apiUrl: "https://ol0.me";
707
- readonly domains: readonly [];
725
+ readonly domains: readonly ["ol0.me"];
708
726
  readonly routes: readonly ["ol0.me/*"];
709
727
  readonly serviceId: "quro.redirect";
710
728
  }, {
711
729
  readonly name: "quro-ui";
712
730
  readonly kind: "pages";
713
731
  readonly apiUrl: null;
714
- readonly domains: readonly [];
732
+ readonly domains: readonly ["quro.topolo.app"];
715
733
  readonly routes: readonly [];
716
734
  readonly serviceId: null;
717
735
  }];
@@ -766,14 +784,14 @@ declare const APPLICATIONS: {
766
784
  readonly name: "topolo-social-studio";
767
785
  readonly kind: "pages";
768
786
  readonly apiUrl: null;
769
- readonly domains: readonly [];
787
+ readonly domains: readonly ["studio.topolo.app"];
770
788
  readonly routes: readonly [];
771
789
  readonly serviceId: null;
772
790
  }, {
773
791
  readonly name: "topolo-social-studio-api";
774
792
  readonly kind: "worker";
775
- readonly apiUrl: "https://topolo-social-studio-api.topolo.workers.dev";
776
- readonly domains: readonly [];
793
+ readonly apiUrl: "https://studio-api.topolo.app";
794
+ readonly domains: readonly ["studio-api.topolo.app"];
777
795
  readonly routes: readonly [];
778
796
  readonly serviceId: "social_studio";
779
797
  }, {
@@ -796,14 +814,14 @@ declare const APPLICATIONS: {
796
814
  readonly name: "socialize";
797
815
  readonly kind: "pages";
798
816
  readonly apiUrl: null;
799
- readonly domains: readonly [];
817
+ readonly domains: readonly ["socialize.topolo.app"];
800
818
  readonly routes: readonly [];
801
819
  readonly serviceId: null;
802
820
  }, {
803
821
  readonly name: "socialize-prod-api";
804
822
  readonly kind: "worker";
805
- readonly apiUrl: "https://socialize-prod-api.topolo.workers.dev";
806
- readonly domains: readonly [];
823
+ readonly apiUrl: "https://socialize-api.topolo.app";
824
+ readonly domains: readonly ["socialize-api.topolo.app"];
807
825
  readonly routes: readonly [];
808
826
  readonly serviceId: "socialize";
809
827
  }, {
@@ -1225,6 +1243,232 @@ declare class IdentityModule {
1225
1243
  whoami(): Promise<CredentialIntrospection>;
1226
1244
  }
1227
1245
 
1246
+ type P2PPricingModel = 'free' | 'fixed' | 'metered' | 'quote' | 'invoice';
1247
+ interface P2PCapability {
1248
+ capability_id: string;
1249
+ publisher_org_id: string;
1250
+ app_id: string;
1251
+ service_id: string;
1252
+ name: string;
1253
+ description: string;
1254
+ category: string;
1255
+ pricing_model: P2PPricingModel;
1256
+ pricing_amount_minor: number | null;
1257
+ currency: string | null;
1258
+ requires_human_approval: boolean;
1259
+ supported_contexts: string[];
1260
+ trust_level: string;
1261
+ source_revision: string;
1262
+ synced_at: number;
1263
+ input_schema?: Record<string, unknown>;
1264
+ output_schema?: Record<string, unknown>;
1265
+ }
1266
+ interface PublishCapabilityInput {
1267
+ capability_id: string;
1268
+ publisher_org_id: string;
1269
+ app_id: string;
1270
+ service_id: string;
1271
+ name: string;
1272
+ description: string;
1273
+ category: string;
1274
+ pricing_model: P2PPricingModel;
1275
+ pricing_amount_minor?: number | null;
1276
+ currency?: string | null;
1277
+ requires_human_approval?: boolean;
1278
+ supported_contexts: string[];
1279
+ trust_level?: string;
1280
+ public_directory_visible: boolean;
1281
+ source_revision: string;
1282
+ input_schema?: Record<string, unknown>;
1283
+ output_schema?: Record<string, unknown>;
1284
+ /** Set when the caller is the platform P2P service publishing on behalf of another org. */
1285
+ acting_for_org_id?: string;
1286
+ }
1287
+ interface P2PActionRequestInput {
1288
+ capability_id: string;
1289
+ idempotency_key: string;
1290
+ inputs?: Record<string, unknown>;
1291
+ }
1292
+ interface P2PActionRow {
1293
+ request_id: string;
1294
+ buyer_org_id: string;
1295
+ seller_org_id: string;
1296
+ capability_id: string;
1297
+ initiating_principal_id: string;
1298
+ inputs: Record<string, unknown>;
1299
+ pricing_snapshot: Record<string, unknown>;
1300
+ state: string;
1301
+ policy_decision_id: string | null;
1302
+ idempotency_key: string;
1303
+ created_at: number;
1304
+ updated_at: number;
1305
+ capability: {
1306
+ name: string | null;
1307
+ category: string | null;
1308
+ pricing_model: string | null;
1309
+ pricing_amount_minor: number | null;
1310
+ currency: string | null;
1311
+ };
1312
+ run: P2PActionRun | null;
1313
+ }
1314
+ interface P2PActionRun {
1315
+ run_id: string;
1316
+ state: string;
1317
+ result: Record<string, unknown> | null;
1318
+ error: string | null;
1319
+ started_at: number | null;
1320
+ completed_at: number | null;
1321
+ updated_at: number;
1322
+ }
1323
+ interface P2PActionRequestResult {
1324
+ decision: string;
1325
+ idempotent: boolean;
1326
+ request: P2PActionRow;
1327
+ run: P2PActionRun | null;
1328
+ }
1329
+ interface P2PActionDetail {
1330
+ action: P2PActionRow;
1331
+ policy_decision: {
1332
+ decision_id: string;
1333
+ decision: string;
1334
+ rationale: string;
1335
+ policy_snapshot: Record<string, unknown>;
1336
+ created_at: number;
1337
+ } | null;
1338
+ ledger_entries: P2PLedgerEntry[];
1339
+ holds: P2PHold[];
1340
+ }
1341
+ interface P2PHold {
1342
+ hold_id: string;
1343
+ request_id: string;
1344
+ buyer_org_id: string;
1345
+ seller_org_id: string;
1346
+ ledger_entry_id: string | null;
1347
+ reason: string;
1348
+ status: 'active' | 'released' | 'disputed' | 'expired';
1349
+ release_after: number | null;
1350
+ released_at: number | null;
1351
+ created_at: number;
1352
+ updated_at: number;
1353
+ }
1354
+ interface P2PLedgerEntry {
1355
+ entry_id: string;
1356
+ request_id: string;
1357
+ capability_id: string;
1358
+ pricing_component: string;
1359
+ buyer_org_id: string;
1360
+ seller_org_id: string;
1361
+ initiating_principal_id: string;
1362
+ executing_principal_id: string;
1363
+ policy_decision_id: string;
1364
+ amount_minor: number;
1365
+ currency: string;
1366
+ audit_correlation_id: string;
1367
+ settlement_batch_id: string | null;
1368
+ created_at: number;
1369
+ }
1370
+ interface P2PPolicy {
1371
+ organization_id: string;
1372
+ auto_approve_under_minor: number;
1373
+ agent_spend_limit_minor_per_day: number;
1374
+ human_approval_threshold_minor: number;
1375
+ unknown_counterparty_requires_approval: boolean;
1376
+ blocked_capability_ids: string[];
1377
+ trusted_counterparty_org_ids: string[];
1378
+ updated_at: number | null;
1379
+ }
1380
+ interface P2PConnection {
1381
+ connection_id: string;
1382
+ organization_id?: string;
1383
+ counterparty_org_id: string;
1384
+ status: 'pending' | 'active' | 'suspended' | 'revoked';
1385
+ initiated_by_principal_id: string;
1386
+ created_at: number;
1387
+ updated_at: number;
1388
+ }
1389
+ interface P2PSettlementGroup {
1390
+ buyer_org_id: string;
1391
+ seller_org_id: string;
1392
+ currency: string;
1393
+ total_minor: number;
1394
+ line_items: Array<{
1395
+ entry_id: string;
1396
+ request_id: string;
1397
+ capability_id: string;
1398
+ pricing_component: string;
1399
+ amount_minor: number;
1400
+ audit_correlation_id: string;
1401
+ }>;
1402
+ }
1403
+ interface P2PSettlementBatch {
1404
+ batch_id: string;
1405
+ buyer_org_id: string;
1406
+ seller_org_id: string;
1407
+ currency: string;
1408
+ total_minor: number;
1409
+ trigger: string;
1410
+ pay_settlement_id: string | null;
1411
+ status: string;
1412
+ created_at: number;
1413
+ updated_at: number;
1414
+ }
1415
+ /**
1416
+ * P2P module — typed wrapper over the TopoloP2P HTTP API.
1417
+ *
1418
+ * Cross-org isolation: `requestAction`, `respondAction`, `completeAction`,
1419
+ * etc. all derive the buyer/seller org from the auth credential. There is
1420
+ * intentionally no `orgId` parameter on per-org reads.
1421
+ *
1422
+ * Mutating calls go through TopoloClient's `confirm: true` write guardrail.
1423
+ */
1424
+ declare class P2PModule {
1425
+ private readonly client;
1426
+ constructor(client: TopoloClient);
1427
+ listDirectory(options?: {
1428
+ limit?: number;
1429
+ }): Promise<P2PCapability[]>;
1430
+ getCapability(capabilityId: string): Promise<P2PCapability | null>;
1431
+ publishCapability(input: PublishCapabilityInput): Promise<P2PCapability>;
1432
+ listActions(options?: {
1433
+ state?: string;
1434
+ limit?: number;
1435
+ }): Promise<P2PActionRow[]>;
1436
+ getAction(requestId: string): Promise<P2PActionDetail | null>;
1437
+ requestAction(input: P2PActionRequestInput): Promise<P2PActionRequestResult>;
1438
+ respondAction(requestId: string, response: 'accepted' | 'rejected' | 'approved' | 'quoted', extras?: Record<string, unknown>): Promise<P2PActionRow>;
1439
+ completeAction(requestId: string, result?: Record<string, unknown>): Promise<P2PActionRow>;
1440
+ disputeAction(requestId: string, reason: string): Promise<P2PActionRow>;
1441
+ getPolicy(): Promise<P2PPolicy>;
1442
+ updatePolicy(policy: Partial<Omit<P2PPolicy, 'organization_id' | 'updated_at'>>): Promise<P2PPolicy>;
1443
+ listConnections(): Promise<P2PConnection[]>;
1444
+ createConnection(counterpartyOrgId: string, options?: {
1445
+ status?: 'pending' | 'active' | 'suspended';
1446
+ }): Promise<P2PConnection>;
1447
+ revokeConnection(connectionId: string): Promise<void>;
1448
+ listLedger(): Promise<P2PLedgerEntry[]>;
1449
+ previewSettlements(filters?: Partial<{
1450
+ buyer_org_id: string;
1451
+ seller_org_id: string;
1452
+ currency: string;
1453
+ }>): Promise<P2PSettlementGroup[]>;
1454
+ createSettlement(filters?: Partial<{
1455
+ buyer_org_id: string;
1456
+ seller_org_id: string;
1457
+ currency: string;
1458
+ trigger: 'threshold' | 'schedule' | 'manual' | 'invoice' | 'delivery';
1459
+ }>): Promise<{
1460
+ batch: P2PSettlementBatch;
1461
+ group: P2PSettlementGroup;
1462
+ }>;
1463
+ releaseHold(holdId: string, resolution: 'buyer' | 'seller', options?: {
1464
+ reason?: string;
1465
+ }): Promise<{
1466
+ hold: P2PHold;
1467
+ resolution: 'buyer' | 'seller';
1468
+ cancel_entries: P2PLedgerEntry[];
1469
+ }>;
1470
+ }
1471
+
1228
1472
  interface DeviceAuthorizationResponse {
1229
1473
  device_code: string;
1230
1474
  user_code: string;
@@ -1430,4 +1674,4 @@ declare function createTopolo(options: TopoloClientOptions): {
1430
1674
  };
1431
1675
  type Topolo = ReturnType<typeof createTopolo>;
1432
1676
 
1433
- export { APPLICATIONS, APPLICATION_REQUIREMENTS, APPLICATION_REQUIREMENTS_VERSION, type AgentIdentity, type ApplicationCatalogEntry, type ApplicationDeployTarget, type ApplicationId, type ApplicationRequirement, type ApplicationRequirementAudit, type ApplicationRequirementFinding, type ApplicationRequirementMigrationItem, type ApplicationRequirementScope, type ApplicationRequirementScore, type ApplicationRequirementStatus, type ApplicationRequirementsAuditReport, type CredentialIntrospection, type CrmContactSummary, CrmModule, DEFAULT_SERVICE_URLS, type DeviceAuthorizationResponse, IdentityModule, type ListContactsOptions, type ListContactsResult, type OAuthHelperOptions, PLATFORM_SERVICE_IDS, type RequestOptions, type ServiceId, TOPOLO_WIDGET_ENDPOINT, TOPOLO_WIDGET_REFRESH_INTERVAL_MS, type TokenResponse, type Topolo, TopoloAuthError, type TopoloChartWidget, TopoloClient, type TopoloClientOptions, type TopoloCredential, type TopoloDebugEvent, TopoloHttpError, type TopoloNotificationsWidget, TopoloOAuth, TopoloPermissionError, type TopoloQuickActionsWidget, type TopoloRecentActivityWidget, TopoloSdkError, type TopoloStatsWidget, type TopoloWidget, type TopoloWidgetActionItem, type TopoloWidgetActivityItem, type TopoloWidgetApiResponse, type TopoloWidgetBase, type TopoloWidgetConfig, type TopoloWidgetDraft, type TopoloWidgetMetric, type TopoloWidgetNotificationItem, type TopoloWidgetResponseOptions, type TopoloWidgetSnapshotMetadata, type TopoloWidgetSnapshotMetric, type TopoloWidgetType, type TopoloWidgetValidationResult, applicationRequirementScopes, auditAllApplicationRequirements, auditApplicationRequirements, createTopolo, createTopoloWidgetError, createTopoloWidgetResponse, defineTopoloChartWidget, defineTopoloNotificationsWidget, defineTopoloQuickActionsWidget, defineTopoloRecentActivityWidget, defineTopoloStatsWidget, requirementsForApplication, resolveServiceUrl, validateTopoloWidgetResponse };
1677
+ export { APPLICATIONS, APPLICATION_REQUIREMENTS, APPLICATION_REQUIREMENTS_VERSION, type AgentIdentity, type ApplicationCatalogEntry, type ApplicationDeployTarget, type ApplicationId, type ApplicationRequirement, type ApplicationRequirementAudit, type ApplicationRequirementFinding, type ApplicationRequirementMigrationItem, type ApplicationRequirementScope, type ApplicationRequirementScore, type ApplicationRequirementStatus, type ApplicationRequirementsAuditReport, type CredentialIntrospection, type CrmContactSummary, CrmModule, DEFAULT_SERVICE_URLS, type DeviceAuthorizationResponse, IdentityModule, type ListContactsOptions, type ListContactsResult, type OAuthHelperOptions, type P2PActionDetail, type P2PActionRequestInput, type P2PActionRequestResult, type P2PActionRow, type P2PActionRun, type P2PCapability, type P2PConnection, type P2PHold, type P2PLedgerEntry, P2PModule, type P2PPolicy, type P2PPricingModel, type P2PSettlementBatch, type P2PSettlementGroup, PLATFORM_SERVICE_IDS, type PublishCapabilityInput, type RequestOptions, type ServiceId, TOPOLO_WIDGET_ENDPOINT, TOPOLO_WIDGET_REFRESH_INTERVAL_MS, type TokenResponse, type Topolo, TopoloAuthError, type TopoloChartWidget, TopoloClient, type TopoloClientOptions, type TopoloCredential, type TopoloDebugEvent, TopoloHttpError, type TopoloNotificationsWidget, TopoloOAuth, TopoloPermissionError, type TopoloQuickActionsWidget, type TopoloRecentActivityWidget, TopoloSdkError, type TopoloStatsWidget, type TopoloWidget, type TopoloWidgetActionItem, type TopoloWidgetActivityItem, type TopoloWidgetApiResponse, type TopoloWidgetBase, type TopoloWidgetConfig, type TopoloWidgetDraft, type TopoloWidgetMetric, type TopoloWidgetNotificationItem, type TopoloWidgetResponseOptions, type TopoloWidgetSnapshotMetadata, type TopoloWidgetSnapshotMetric, type TopoloWidgetType, type TopoloWidgetValidationResult, applicationRequirementScopes, auditAllApplicationRequirements, auditApplicationRequirements, createTopolo, createTopoloWidgetError, createTopoloWidgetResponse, defineTopoloChartWidget, defineTopoloNotificationsWidget, defineTopoloQuickActionsWidget, defineTopoloRecentActivityWidget, defineTopoloStatsWidget, requirementsForApplication, resolveServiceUrl, validateTopoloWidgetResponse };