@agoric/vats 0.15.1 → 0.15.2-calypso-dev-84eb287.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 +3 -0
- package/index.d.ts +6 -0
- package/index.d.ts.map +1 -0
- package/index.js +9 -0
- package/package.json +43 -48
- package/scripts/build-bundles.js +19 -0
- package/src/bridge-target.d.ts +193 -0
- package/src/bridge-target.d.ts.map +1 -0
- package/src/bridge-target.js +316 -0
- package/src/bridge.d.ts +14 -4
- package/src/bridge.d.ts.map +1 -1
- package/src/bridge.js +45 -16
- package/src/centralSupply.d.ts +3 -3
- package/src/centralSupply.d.ts.map +1 -1
- package/src/centralSupply.js +3 -5
- package/src/core/README.md +1 -1
- package/src/core/basic-behaviors.d.ts +24 -39
- package/src/core/basic-behaviors.d.ts.map +1 -1
- package/src/core/basic-behaviors.js +63 -63
- package/src/core/boot-chain.d.ts +178 -44
- package/src/core/boot-chain.d.ts.map +1 -1
- package/src/core/boot-chain.js +5 -5
- package/src/core/boot-sim.d.ts +5 -43
- package/src/core/boot-sim.d.ts.map +1 -1
- package/src/core/boot-sim.js +3 -4
- package/src/core/boot-solo.d.ts +5 -43
- package/src/core/boot-solo.d.ts.map +1 -1
- package/src/core/boot-solo.js +4 -5
- package/src/core/chain-behaviors.d.ts +10 -26
- package/src/core/chain-behaviors.d.ts.map +1 -1
- package/src/core/chain-behaviors.js +38 -42
- package/src/core/client-behaviors.d.ts +2 -1
- package/src/core/client-behaviors.d.ts.map +1 -1
- package/src/core/client-behaviors.js +6 -5
- package/src/core/core-eval-env.d.ts +40 -0
- package/src/core/demoIssuers.d.ts +24 -26
- package/src/core/demoIssuers.d.ts.map +1 -1
- package/src/core/demoIssuers.js +37 -37
- package/src/core/lib-boot.d.ts +17 -53
- package/src/core/lib-boot.d.ts.map +1 -1
- package/src/core/lib-boot.js +52 -60
- package/src/core/promise-space.d.ts +4 -7
- package/src/core/promise-space.d.ts.map +1 -1
- package/src/core/promise-space.js +15 -16
- package/src/core/sim-behaviors.d.ts +3 -3
- package/src/core/sim-behaviors.d.ts.map +1 -1
- package/src/core/sim-behaviors.js +1 -1
- package/src/core/startWalletFactory.d.ts +23 -27
- package/src/core/startWalletFactory.d.ts.map +1 -1
- package/src/core/startWalletFactory.js +32 -18
- package/src/core/types-ambient.d.ts +538 -0
- package/src/core/types-ambient.js +1 -0
- package/src/core/utils.d.ts +47 -92
- package/src/core/utils.d.ts.map +1 -1
- package/src/core/utils.js +58 -50
- package/src/crc.d.ts +2 -6
- package/src/crc.d.ts.map +1 -1
- package/src/crc.js +5 -16
- package/src/ibc.d.ts +30 -35
- package/src/ibc.d.ts.map +1 -1
- package/src/ibc.js +740 -491
- package/src/lib-board.d.ts +49 -121
- package/src/lib-board.d.ts.map +1 -1
- package/src/lib-board.js +49 -50
- package/src/localchain.d.ts +195 -0
- package/src/localchain.d.ts.map +1 -0
- package/src/localchain.js +324 -0
- package/src/mintHolder.d.ts +6 -4
- package/src/mintHolder.d.ts.map +1 -1
- package/src/mintHolder.js +19 -21
- package/src/nameHub.d.ts +27 -5
- package/src/nameHub.d.ts.map +1 -1
- package/src/nameHub.js +33 -26
- package/src/priceAuthorityRegistry.d.ts +21 -0
- package/src/priceAuthorityRegistry.d.ts.map +1 -0
- package/src/priceAuthorityRegistry.js +220 -0
- package/src/proposals/kread-proposal.d.ts +15 -0
- package/src/proposals/kread-proposal.d.ts.map +1 -0
- package/src/proposals/kread-proposal.js +24 -0
- package/src/proposals/localchain-proposal.d.ts +62 -0
- package/src/proposals/localchain-proposal.d.ts.map +1 -0
- package/src/proposals/localchain-proposal.js +128 -0
- package/src/proposals/localchain-test.d.ts +25 -0
- package/src/proposals/localchain-test.d.ts.map +1 -0
- package/src/proposals/localchain-test.js +89 -0
- package/src/proposals/namesByAddress-fix-proposal.d.ts +22 -0
- package/src/proposals/namesByAddress-fix-proposal.d.ts.map +1 -0
- package/src/proposals/namesByAddress-fix-proposal.js +55 -0
- package/src/proposals/network-proposal.d.ts +23 -8
- package/src/proposals/network-proposal.d.ts.map +1 -1
- package/src/proposals/network-proposal.js +90 -65
- package/src/proposals/probeZcfBundle.d.ts +26 -0
- package/src/proposals/probeZcfBundle.d.ts.map +1 -0
- package/src/proposals/probeZcfBundle.js +72 -0
- package/src/proposals/restart-vats-proposal.d.ts +4 -2
- package/src/proposals/restart-vats-proposal.d.ts.map +1 -1
- package/src/proposals/restart-vats-proposal.js +20 -8
- package/src/proposals/transfer-proposal.d.ts +37 -0
- package/src/proposals/transfer-proposal.d.ts.map +1 -0
- package/src/proposals/transfer-proposal.js +115 -0
- package/src/proposals/upgrade-bank-proposal.d.ts +27 -0
- package/src/proposals/upgrade-bank-proposal.d.ts.map +1 -0
- package/src/proposals/upgrade-bank-proposal.js +42 -0
- package/src/proposals/upgrade-provisionPool-proposal.d.ts +27 -0
- package/src/proposals/upgrade-provisionPool-proposal.d.ts.map +1 -0
- package/src/proposals/upgrade-provisionPool-proposal.js +67 -0
- package/src/proposals/upgrade-zoe-proposal.d.ts +27 -0
- package/src/proposals/upgrade-zoe-proposal.d.ts.map +1 -0
- package/src/proposals/upgrade-zoe-proposal.js +42 -0
- package/src/proposals/vtransfer-echoer.d.ts +24 -0
- package/src/proposals/vtransfer-echoer.d.ts.map +1 -0
- package/src/proposals/vtransfer-echoer.js +42 -0
- package/src/proposals/zcf-only-proposal.d.ts +33 -0
- package/src/proposals/zcf-only-proposal.d.ts.map +1 -0
- package/src/proposals/zcf-only-proposal.js +36 -0
- package/src/proposals/zcf-proposal.d.ts +30 -0
- package/src/proposals/zcf-proposal.d.ts.map +1 -0
- package/src/proposals/zcf-proposal.js +50 -0
- package/src/repl.d.ts +3 -3
- package/src/repl.d.ts.map +1 -1
- package/src/repl.js +11 -5
- package/src/transfer.d.ts +111 -0
- package/src/transfer.d.ts.map +1 -0
- package/src/transfer.js +260 -0
- package/src/types.d.ts +237 -105
- package/src/types.js +1 -97
- package/src/vat-agoricNames.d.ts +4 -4
- package/src/vat-agoricNames.d.ts.map +1 -1
- package/src/vat-agoricNames.js +2 -4
- package/src/vat-bank.d.ts +217 -149
- package/src/vat-bank.d.ts.map +1 -1
- package/src/vat-bank.js +96 -68
- package/src/vat-board.d.ts +24 -24
- package/src/vat-board.d.ts.map +1 -1
- package/src/vat-board.js +0 -1
- package/src/vat-bridge.d.ts +9 -23
- package/src/vat-bridge.d.ts.map +1 -1
- package/src/vat-bridge.js +1 -2
- package/src/vat-ibc.d.ts +16 -4
- package/src/vat-ibc.d.ts.map +1 -1
- package/src/vat-ibc.js +20 -9
- package/src/vat-localchain.d.ts +37 -0
- package/src/vat-localchain.d.ts.map +1 -0
- package/src/vat-localchain.js +29 -0
- package/src/vat-mints.d.ts +31 -31
- package/src/vat-mints.d.ts.map +1 -1
- package/src/vat-mints.js +6 -7
- package/src/vat-network.d.ts +69 -1
- package/src/vat-network.d.ts.map +1 -1
- package/src/vat-network.js +45 -3
- package/src/vat-priceAuthority.d.ts +4 -4
- package/src/vat-priceAuthority.d.ts.map +1 -1
- package/src/vat-priceAuthority.js +1 -1
- package/src/vat-provisioning.d.ts +6 -6
- package/src/vat-provisioning.d.ts.map +1 -1
- package/src/vat-provisioning.js +15 -12
- package/src/vat-transfer.d.ts +81 -0
- package/src/vat-transfer.d.ts.map +1 -0
- package/src/vat-transfer.js +63 -0
- package/src/vat-zoe.d.ts +4 -1
- package/src/vat-zoe.d.ts.map +1 -1
- package/src/vat-zoe.js +10 -2
- package/src/virtual-purse.d.ts +46 -21
- package/src/virtual-purse.d.ts.map +1 -1
- package/src/virtual-purse.js +57 -46
- package/src/walletFlags.d.ts +2 -2
- package/src/walletFlags.js +1 -2
- package/tools/bank-utils.d.ts +20 -0
- package/tools/bank-utils.d.ts.map +1 -0
- package/tools/bank-utils.js +92 -0
- package/tools/board-utils.d.ts +39 -0
- package/tools/board-utils.d.ts.map +1 -0
- package/tools/board-utils.js +92 -0
- package/tools/boot-test-utils.d.ts +88 -0
- package/tools/boot-test-utils.d.ts.map +1 -0
- package/tools/boot-test-utils.js +157 -0
- package/tools/fake-bridge.d.ts +18 -0
- package/tools/fake-bridge.d.ts.map +1 -0
- package/tools/fake-bridge.js +289 -0
- package/tools/ibc-utils.d.ts +29 -0
- package/tools/ibc-utils.d.ts.map +1 -0
- package/tools/ibc-utils.js +115 -0
- package/decentral-core-config.json +0 -66
- package/decentral-demo-config.json +0 -155
- package/decentral-devnet-config.json +0 -216
- package/decentral-itest-vaults-config.json +0 -210
- package/decentral-main-vaults-config.json +0 -229
- package/decentral-test-vaults-config.json +0 -195
- package/demo-proposals.json +0 -5
- package/exported.js +0 -1
- package/jsconfig.build.json +0 -12
- package/jsconfig.json +0 -13
- package/src/core/types.d.ts +0 -764
- package/src/core/types.d.ts.map +0 -1
- package/src/core/types.js +0 -347
- package/src/provisionPool.d.ts +0 -164
- package/src/provisionPool.d.ts.map +0 -1
- package/src/provisionPool.js +0 -113
- package/src/provisionPoolKit.d.ts +0 -392
- package/src/provisionPoolKit.d.ts.map +0 -1
- package/src/provisionPoolKit.js +0 -464
- package/src/tokens.d.ts +0 -36
- package/src/tokens.d.ts.map +0 -1
- package/src/tokens.js +0 -37
- package/src/types.d.ts.map +0 -1
- package/src/vat-sharing.d.ts +0 -54
- package/src/vat-sharing.d.ts.map +0 -1
- package/src/vat-sharing.js +0 -14
package/README.md
ADDED
package/index.d.ts
ADDED
package/index.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.js"],"names":[],"mappings":""}
|
package/index.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// Ambient types
|
|
2
|
+
import './src/core/types-ambient.js';
|
|
3
|
+
|
|
4
|
+
// eslint-disable-next-line import/export -- no named exports
|
|
5
|
+
export * from './src/types.js';
|
|
6
|
+
export * from './src/nameHub.js';
|
|
7
|
+
export * from './src/bridge.js';
|
|
8
|
+
export { makePromiseSpace } from './src/core/promise-space.js';
|
|
9
|
+
export { makeAgoricNamesAccess } from './src/core/utils.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agoric/vats",
|
|
3
|
-
"version": "0.15.
|
|
3
|
+
"version": "0.15.2-calypso-dev-84eb287.0+84eb287",
|
|
4
4
|
"description": "Agoric's Vat library",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./index.js",
|
|
@@ -8,80 +8,75 @@
|
|
|
8
8
|
"scripts": {
|
|
9
9
|
"build": "yarn build:bundles",
|
|
10
10
|
"build:bundles": "node scripts/build-bundles.js",
|
|
11
|
-
"
|
|
12
|
-
"build:boot-viz": "node src/authorityViz.js >docs/boot.dot && dot -Tsvg docs/boot.dot >docs/boot.dot.svg",
|
|
13
|
-
"build:boot-viz-gov": "node src/authorityViz.js --gov>docs/boot-gov.dot && dot -Tsvg docs/boot-gov.dot >docs/boot-gov.dot.svg",
|
|
14
|
-
"build:boot-viz-sim": "node src/authorityViz.js --sim-chain >docs/boot-sim.dot && dot -Tsvg docs/boot-sim.dot >docs/boot-sim.dot.svg",
|
|
15
|
-
"build:boot-viz-sim-gov": "node src/authorityViz.js --sim-chain --gov >docs/boot-sim-gov.dot && dot -Tsvg docs/boot-sim-gov.dot >docs/boot-sim-gov.dot.svg",
|
|
16
|
-
"build:restart-vats-proposal": "agoric run scripts/restart-vats.js",
|
|
17
|
-
"prepack": "tsc --build jsconfig.build.json",
|
|
11
|
+
"prepack": "tsc --build tsconfig.build.json",
|
|
18
12
|
"postpack": "git clean -f '*.d.ts*'",
|
|
19
13
|
"test": "ava",
|
|
20
14
|
"test:c8": "c8 $C8_OPTIONS ava",
|
|
21
|
-
"test:xs": "
|
|
15
|
+
"test:xs": "exit 0",
|
|
22
16
|
"lint-fix": "yarn lint:eslint --fix",
|
|
23
17
|
"lint": "run-s --continue-on-error lint:*",
|
|
24
|
-
"lint:types": "tsc
|
|
18
|
+
"lint:types": "tsc",
|
|
25
19
|
"lint:eslint": "eslint ."
|
|
26
20
|
},
|
|
27
21
|
"keywords": [],
|
|
28
22
|
"author": "Agoric",
|
|
29
23
|
"license": "Apache-2.0",
|
|
30
24
|
"dependencies": {
|
|
31
|
-
"@agoric/assert": "
|
|
32
|
-
"@agoric/
|
|
33
|
-
"@agoric/
|
|
34
|
-
"@agoric/
|
|
35
|
-
"@agoric/internal": "
|
|
36
|
-
"@agoric/
|
|
37
|
-
"@agoric/
|
|
38
|
-
"@agoric/store": "
|
|
39
|
-
"@agoric/swingset-vat": "
|
|
40
|
-
"@agoric/time": "
|
|
41
|
-
"@agoric/vat-data": "
|
|
42
|
-
"@agoric/
|
|
43
|
-
"@agoric/
|
|
44
|
-
"@
|
|
45
|
-
"@endo/
|
|
46
|
-
"@endo/
|
|
47
|
-
"@endo/marshal": "^
|
|
48
|
-
"@endo/nat": "^
|
|
49
|
-
"@endo/
|
|
50
|
-
"
|
|
25
|
+
"@agoric/assert": "0.6.1-calypso-dev-84eb287.0+84eb287",
|
|
26
|
+
"@agoric/cosmic-proto": "0.4.1-calypso-dev-84eb287.0+84eb287",
|
|
27
|
+
"@agoric/ertp": "0.16.3-calypso-dev-84eb287.0+84eb287",
|
|
28
|
+
"@agoric/governance": "0.10.4-calypso-dev-84eb287.0+84eb287",
|
|
29
|
+
"@agoric/internal": "0.3.3-calypso-dev-84eb287.0+84eb287",
|
|
30
|
+
"@agoric/network": "0.1.1-calypso-dev-84eb287.0+84eb287",
|
|
31
|
+
"@agoric/notifier": "0.6.3-calypso-dev-84eb287.0+84eb287",
|
|
32
|
+
"@agoric/store": "0.9.3-calypso-dev-84eb287.0+84eb287",
|
|
33
|
+
"@agoric/swingset-vat": "0.32.3-calypso-dev-84eb287.0+84eb287",
|
|
34
|
+
"@agoric/time": "0.3.3-calypso-dev-84eb287.0+84eb287",
|
|
35
|
+
"@agoric/vat-data": "0.5.3-calypso-dev-84eb287.0+84eb287",
|
|
36
|
+
"@agoric/vow": "0.1.1-calypso-dev-84eb287.0+84eb287",
|
|
37
|
+
"@agoric/zoe": "0.26.3-calypso-dev-84eb287.0+84eb287",
|
|
38
|
+
"@agoric/zone": "0.2.3-calypso-dev-84eb287.0+84eb287",
|
|
39
|
+
"@endo/far": "^1.1.2",
|
|
40
|
+
"@endo/import-bundle": "^1.1.2",
|
|
41
|
+
"@endo/marshal": "^1.5.0",
|
|
42
|
+
"@endo/nat": "^5.0.7",
|
|
43
|
+
"@endo/patterns": "^1.4.0",
|
|
44
|
+
"@endo/promise-kit": "^1.1.2",
|
|
45
|
+
"import-meta-resolve": "^2.2.1",
|
|
46
|
+
"jessie.js": "^0.3.4"
|
|
51
47
|
},
|
|
52
48
|
"devDependencies": {
|
|
53
|
-
"@agoric/
|
|
54
|
-
"@
|
|
55
|
-
"@
|
|
56
|
-
"
|
|
57
|
-
"
|
|
58
|
-
"@endo/bundle-source": "^2.5.1",
|
|
59
|
-
"@endo/captp": "^3.1.1",
|
|
60
|
-
"@endo/stream": "^0.3.25",
|
|
61
|
-
"ava": "^5.2.0",
|
|
62
|
-
"c8": "^7.13.0",
|
|
63
|
-
"import-meta-resolve": "^2.2.1"
|
|
49
|
+
"@agoric/swingset-liveslots": "0.10.3-calypso-dev-84eb287.0+84eb287",
|
|
50
|
+
"@endo/bundle-source": "^3.2.3",
|
|
51
|
+
"@endo/init": "^1.1.2",
|
|
52
|
+
"ava": "^5.3.0",
|
|
53
|
+
"c8": "^9.1.0"
|
|
64
54
|
},
|
|
65
55
|
"files": [
|
|
66
56
|
"CHANGELOG.md",
|
|
67
57
|
"src/",
|
|
68
|
-
"
|
|
69
|
-
"
|
|
70
|
-
"
|
|
58
|
+
"scripts/",
|
|
59
|
+
"tools/",
|
|
60
|
+
"index.*"
|
|
71
61
|
],
|
|
72
62
|
"publishConfig": {
|
|
73
63
|
"access": "public"
|
|
74
64
|
},
|
|
75
65
|
"engines": {
|
|
76
|
-
"node": "
|
|
66
|
+
"node": "^18.12 || ^20.9"
|
|
77
67
|
},
|
|
78
68
|
"ava": {
|
|
79
69
|
"files": [
|
|
80
|
-
"test
|
|
70
|
+
"test/**/*.test.*"
|
|
71
|
+
],
|
|
72
|
+
"require": [
|
|
73
|
+
"@endo/init/debug.js"
|
|
81
74
|
],
|
|
82
|
-
"concurrency": 2,
|
|
83
75
|
"timeout": "20m",
|
|
84
76
|
"workerThreads": false
|
|
85
77
|
},
|
|
86
|
-
"
|
|
78
|
+
"typeCoverage": {
|
|
79
|
+
"atLeast": 91.21
|
|
80
|
+
},
|
|
81
|
+
"gitHead": "84eb287915c8255d68e845a9b6e10c790f0d54cb"
|
|
87
82
|
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
#! /usr/bin/env node
|
|
2
|
+
import '@endo/init';
|
|
3
|
+
import { createBundles } from '@agoric/internal/src/node/createBundles.js';
|
|
4
|
+
import url from 'url';
|
|
5
|
+
|
|
6
|
+
const dirname = url.fileURLToPath(new URL('.', import.meta.url));
|
|
7
|
+
|
|
8
|
+
// TODO end inter-package filesystem references https://github.com/Agoric/agoric-sdk/issues/8178
|
|
9
|
+
|
|
10
|
+
const sourceToBundle = [
|
|
11
|
+
['@agoric/vats/src/centralSupply.js', '../bundles/bundle-centralSupply.js'],
|
|
12
|
+
['@agoric/vats/src/mintHolder.js', '../bundles/bundle-mintHolder.js'],
|
|
13
|
+
[
|
|
14
|
+
'@agoric/inter-protocol/src/provisionPool.js',
|
|
15
|
+
'../bundles/bundle-provisionPool.js',
|
|
16
|
+
],
|
|
17
|
+
];
|
|
18
|
+
|
|
19
|
+
await createBundles(sourceToBundle, dirname);
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @typedef {object} TargetApp an object representing the app that receives
|
|
3
|
+
* upcalls from the low-level TargetHost on the other side of a bridge
|
|
4
|
+
* @property {(obj: MostlyPureData) => Promise<MostlyPureData>} receiveUpcall
|
|
5
|
+
* receive data from the TargetHost, and return a data result
|
|
6
|
+
*/
|
|
7
|
+
export const TargetAppI: import("@endo/patterns").InterfaceGuard<{
|
|
8
|
+
receiveUpcall: import("@endo/patterns").MethodGuard;
|
|
9
|
+
}>;
|
|
10
|
+
/**
|
|
11
|
+
* @typedef {object} TargetHost an object representing the host that receives
|
|
12
|
+
* downcalls from the high-level TargetApp over a bridge
|
|
13
|
+
* @property {(obj: MostlyPureData) => Promise<MostlyPureData>} sendDowncall
|
|
14
|
+
* send data to the TargetHost, which returns a data result
|
|
15
|
+
*/
|
|
16
|
+
export const TargetHostI: import("@endo/patterns").InterfaceGuard<{
|
|
17
|
+
sendDowncall: import("@endo/patterns").MethodGuard;
|
|
18
|
+
}>;
|
|
19
|
+
/**
|
|
20
|
+
* @typedef {object} AppTransformer an object for replacing a TargetApp,
|
|
21
|
+
* generally with a wrapper that intercepts its inputs and/or results to
|
|
22
|
+
* ensure conformance with a protocol and/or interface (e.g., an active tap
|
|
23
|
+
* can encode results of the wrapped TargetApp into an acknowledgement
|
|
24
|
+
* message)
|
|
25
|
+
* @property {(
|
|
26
|
+
* app: ERef<TargetApp>,
|
|
27
|
+
* targetHost: ERef<TargetHost>,
|
|
28
|
+
* ...args: unknown[]
|
|
29
|
+
* ) => ERef<TargetApp>} wrapApp
|
|
30
|
+
*/
|
|
31
|
+
export const AppTransformerI: import("@endo/patterns").InterfaceGuard<{
|
|
32
|
+
wrapApp: import("@endo/patterns").MethodGuard;
|
|
33
|
+
}>;
|
|
34
|
+
/**
|
|
35
|
+
* @typedef {object} TargetRegistration is an ExoClass of its own, and each
|
|
36
|
+
* instance is an attenuation of a BridgeTargetKit `targetRegistry` facet that
|
|
37
|
+
* has access to internal state thereof but has been scoped down to a single
|
|
38
|
+
* target.
|
|
39
|
+
* @property {() => Promise<void>} revoke performs unregistration (and sends the
|
|
40
|
+
* corresponding "BRIDGE_TARGET_UNREGISTER" message to the targetHost).
|
|
41
|
+
* @property {(targetApp: ERef<TargetApp>) => Promise<void>} updateTargetApp
|
|
42
|
+
* replaces the app associated with the target (but with no corresponding
|
|
43
|
+
* message).
|
|
44
|
+
*/
|
|
45
|
+
export const TargetRegistrationI: import("@endo/patterns").InterfaceGuard<{
|
|
46
|
+
updateTargetApp: import("@endo/patterns").MethodGuard;
|
|
47
|
+
revoke: import("@endo/patterns").MethodGuard;
|
|
48
|
+
}>;
|
|
49
|
+
export function prepareTargetRegistration(zone: import("@agoric/base-zone").Zone): (target: string, registry: TargetRegistry, args: unknown[] | null) => import("@endo/exo").Guarded<{
|
|
50
|
+
/**
|
|
51
|
+
* Atomically point the registration at a different app.
|
|
52
|
+
*
|
|
53
|
+
* @param {TargetApp} app new app to handle messages for the target
|
|
54
|
+
*/
|
|
55
|
+
updateTargetApp(app: TargetApp): Promise<void>;
|
|
56
|
+
/** Atomically delete the registration. */
|
|
57
|
+
revoke(): Promise<void>;
|
|
58
|
+
}>;
|
|
59
|
+
export function prepareBridgeTargetKit(zone: import("@agoric/base-zone").Zone, makeTargetRegistration: ReturnType<typeof prepareTargetRegistration>): (manager: import("./types").ScopedBridgeManager<import("@agoric/internal").BridgeIdValue>, inboundEventType: string, appTransformer?: AppTransformer | undefined) => import("@endo/exo").GuardedKit<{
|
|
60
|
+
bridgeHandler: {
|
|
61
|
+
fromBridge(obj: any): Promise<any>;
|
|
62
|
+
};
|
|
63
|
+
targetHost: {
|
|
64
|
+
sendDowncall(obj: any): Promise<any>;
|
|
65
|
+
};
|
|
66
|
+
targetRegistry: {
|
|
67
|
+
/**
|
|
68
|
+
* Register an app to handle messages for a target.
|
|
69
|
+
*
|
|
70
|
+
* @param {string} target
|
|
71
|
+
* @param {TargetApp} app
|
|
72
|
+
* @param {unknown[]} [args]
|
|
73
|
+
* @returns {Promise<TargetRegistration>} power to set or delete the
|
|
74
|
+
* registration
|
|
75
|
+
*/
|
|
76
|
+
register(target: string, app: TargetApp, args?: unknown[] | undefined): Promise<TargetRegistration>;
|
|
77
|
+
/**
|
|
78
|
+
* Update the app that handles messages for a target.
|
|
79
|
+
*
|
|
80
|
+
* @param {string} target
|
|
81
|
+
* @param {TargetApp} app
|
|
82
|
+
* @param {unknown[]} [args]
|
|
83
|
+
* @returns {Promise<void>}
|
|
84
|
+
*/
|
|
85
|
+
reregister(target: string, app: TargetApp, args?: unknown[] | undefined): Promise<void>;
|
|
86
|
+
/**
|
|
87
|
+
* Unregister the target, bypassing the attenuated `TargetRegistration`
|
|
88
|
+
* API.
|
|
89
|
+
*
|
|
90
|
+
* @param {string} target
|
|
91
|
+
* @returns {Promise<void>}
|
|
92
|
+
*/
|
|
93
|
+
unregister(target: string): Promise<void>;
|
|
94
|
+
};
|
|
95
|
+
}>;
|
|
96
|
+
export function prepareBridgeTargetModule(zone: import("@agoric/base-zone").Zone): {
|
|
97
|
+
makeBridgeTargetKit: (manager: import("./types").ScopedBridgeManager<import("@agoric/internal").BridgeIdValue>, inboundEventType: string, appTransformer?: AppTransformer | undefined) => import("@endo/exo").GuardedKit<{
|
|
98
|
+
bridgeHandler: {
|
|
99
|
+
fromBridge(obj: any): Promise<any>;
|
|
100
|
+
};
|
|
101
|
+
targetHost: {
|
|
102
|
+
sendDowncall(obj: any): Promise<any>;
|
|
103
|
+
};
|
|
104
|
+
targetRegistry: {
|
|
105
|
+
/**
|
|
106
|
+
* Register an app to handle messages for a target.
|
|
107
|
+
*
|
|
108
|
+
* @param {string} target
|
|
109
|
+
* @param {TargetApp} app
|
|
110
|
+
* @param {unknown[]} [args]
|
|
111
|
+
* @returns {Promise<TargetRegistration>} power to set or delete the
|
|
112
|
+
* registration
|
|
113
|
+
*/
|
|
114
|
+
register(target: string, app: TargetApp, args?: unknown[] | undefined): Promise<TargetRegistration>;
|
|
115
|
+
/**
|
|
116
|
+
* Update the app that handles messages for a target.
|
|
117
|
+
*
|
|
118
|
+
* @param {string} target
|
|
119
|
+
* @param {TargetApp} app
|
|
120
|
+
* @param {unknown[]} [args]
|
|
121
|
+
* @returns {Promise<void>}
|
|
122
|
+
*/
|
|
123
|
+
reregister(target: string, app: TargetApp, args?: unknown[] | undefined): Promise<void>;
|
|
124
|
+
/**
|
|
125
|
+
* Unregister the target, bypassing the attenuated `TargetRegistration`
|
|
126
|
+
* API.
|
|
127
|
+
*
|
|
128
|
+
* @param {string} target
|
|
129
|
+
* @returns {Promise<void>}
|
|
130
|
+
*/
|
|
131
|
+
unregister(target: string): Promise<void>;
|
|
132
|
+
};
|
|
133
|
+
}>;
|
|
134
|
+
};
|
|
135
|
+
/**
|
|
136
|
+
* ideally should be PureData, but that type is
|
|
137
|
+
* too restrictive to work out-of-the-box.
|
|
138
|
+
*/
|
|
139
|
+
export type MostlyPureData = any;
|
|
140
|
+
/**
|
|
141
|
+
* an object representing the app that receives
|
|
142
|
+
* upcalls from the low-level TargetHost on the other side of a bridge
|
|
143
|
+
*/
|
|
144
|
+
export type TargetApp = {
|
|
145
|
+
/**
|
|
146
|
+
* receive data from the TargetHost, and return a data result
|
|
147
|
+
*/
|
|
148
|
+
receiveUpcall: (obj: MostlyPureData) => Promise<MostlyPureData>;
|
|
149
|
+
};
|
|
150
|
+
/**
|
|
151
|
+
* an object representing the host that receives
|
|
152
|
+
* downcalls from the high-level TargetApp over a bridge
|
|
153
|
+
*/
|
|
154
|
+
export type TargetHost = {
|
|
155
|
+
/**
|
|
156
|
+
* send data to the TargetHost, which returns a data result
|
|
157
|
+
*/
|
|
158
|
+
sendDowncall: (obj: MostlyPureData) => Promise<MostlyPureData>;
|
|
159
|
+
};
|
|
160
|
+
/**
|
|
161
|
+
* an object for replacing a TargetApp,
|
|
162
|
+
* generally with a wrapper that intercepts its inputs and/or results to
|
|
163
|
+
* ensure conformance with a protocol and/or interface (e.g., an active tap
|
|
164
|
+
* can encode results of the wrapped TargetApp into an acknowledgement
|
|
165
|
+
* message)
|
|
166
|
+
*/
|
|
167
|
+
export type AppTransformer = {
|
|
168
|
+
wrapApp: (app: ERef<TargetApp>, targetHost: ERef<TargetHost>, ...args: unknown[]) => ERef<TargetApp>;
|
|
169
|
+
};
|
|
170
|
+
/**
|
|
171
|
+
* is an ExoClass of its own, and each
|
|
172
|
+
* instance is an attenuation of a BridgeTargetKit `targetRegistry` facet that
|
|
173
|
+
* has access to internal state thereof but has been scoped down to a single
|
|
174
|
+
* target.
|
|
175
|
+
*/
|
|
176
|
+
export type TargetRegistration = {
|
|
177
|
+
/**
|
|
178
|
+
* performs unregistration (and sends the
|
|
179
|
+
* corresponding "BRIDGE_TARGET_UNREGISTER" message to the targetHost).
|
|
180
|
+
*/
|
|
181
|
+
revoke: () => Promise<void>;
|
|
182
|
+
/**
|
|
183
|
+
* replaces the app associated with the target (but with no corresponding
|
|
184
|
+
* message).
|
|
185
|
+
*/
|
|
186
|
+
updateTargetApp: (targetApp: ERef<TargetApp>) => Promise<void>;
|
|
187
|
+
};
|
|
188
|
+
export type TargetRegistry = {
|
|
189
|
+
register: (target: string, targetApp: ERef<TargetApp>, args?: unknown[]) => Promise<TargetRegistration>;
|
|
190
|
+
reregister: (target: string, targetApp: ERef<TargetApp>, args?: unknown[]) => Promise<void>;
|
|
191
|
+
unregister: (target: string) => Promise<void>;
|
|
192
|
+
};
|
|
193
|
+
//# sourceMappingURL=bridge-target.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bridge-target.d.ts","sourceRoot":"","sources":["bridge-target.js"],"names":[],"mappings":"AAYA;;;;;GAKG;AAEH;;GAEG;AAEH;;;;;GAKG;AAEH;;GAEG;AAEH;;;;;;;;;;;GAWG;AAEH;;GAOG;AAEH;;;;;;;;;;GAUG;AAEH;;;GAGG;AA4BI,gDADK,OAAO,mBAAmB,EAAE,IAAI;IAiBtC;;;;OAIG;yBADQ,SAAS;IAapB,0CAA0C;;GAW7C;AAyBI,6CAHI,OAAO,mBAAmB,EAAE,IAAI,0BAChC,UAAU,CAAC,OAAO,yBAAyB,CAAC;;;;;;;;QA6C/C;;;;;;;;WAQG;yBALQ,MAAM,OACN,SAAS,iCAEP,OAAO,CAAC,kBAAkB,CAAC;QAoCxC;;;;;;;WAOG;2BAJQ,MAAM,OACN,SAAS,iCAEP,OAAO,CAAC,IAAI,CAAC;QAyB1B;;;;;;WAMG;2BAFQ,MAAM,GACJ,OAAO,CAAC,IAAI,CAAC;;GAc/B;AAII,gDADK,OAAO,mBAAmB,EAAE,IAAI;;;;;;;;;YA/FpC;;;;;;;;eAQG;6BALQ,MAAM,OACN,SAAS,iCAEP,OAAO,CAAC,kBAAkB,CAAC;YAoCxC;;;;;;;eAOG;+BAJQ,MAAM,OACN,SAAS,iCAEP,OAAO,CAAC,IAAI,CAAC;YAyB1B;;;;;;eAMG;+BAFQ,MAAM,GACJ,OAAO,CAAC,IAAI,CAAC;;;EA0BjC;;;;;6BApTY,GAAG;;;;;;;;;mBASF,CAAC,GAAG,EAAE,cAAc,KAAK,OAAO,CAAC,cAAc,CAAC;;;;;;;;;;kBAWhD,CAAC,GAAG,EAAE,cAAc,KAAK,OAAO,CAAC,cAAc,CAAC;;;;;;;;;;aAchD,CACb,GAAO,EAAE,IAAI,CAAC,SAAS,CAAC,EACxB,UAAc,EAAE,IAAI,CAAC,UAAU,CAAC,EAChC,GAAO,IAAI,EAAE,OAAO,EAAE,KACf,IAAI,CAAC,SAAS,CAAC;;;;;;;;;;;;;YAiBT,MAAM,OAAO,CAAC,IAAI,CAAC;;;;;qBAEnB,CAAC,SAAS,EAAE,IAAI,CAAC,SAAS,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC;;;cAY7C,CACb,MAAU,EAAE,MAAM,EAClB,SAAa,EAAE,IAAI,CAAC,SAAS,CAAC,EAC9B,IAAQ,CAAC,EAAE,OAAO,EAAE,KACb,OAAO,CAAC,kBAAkB,CAAC;gBACrB,CACb,MAAU,EAAE,MAAM,EAClB,SAAa,EAAE,IAAI,CAAC,SAAS,CAAC,EAC9B,IAAQ,CAAC,EAAE,OAAO,EAAE,KACb,OAAO,CAAC,IAAI,CAAC;gBACP,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC"}
|