generated from MetaMask/metamask-module-template
-
Notifications
You must be signed in to change notification settings - Fork 6
feat(extension): Add distributed object capability programming #43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
7c534a3
feat(extension): Add distributed object capability programming
rekmarks 14ad89c
test(extension): Manually envelope messages mocked directly through p…
grypez 7e0d182
types(extension): Distinguish VatId and MessageId with type aliases.
grypez ea7c2d5
feat(extension): Add generator for vat unresolved messages.
grypez 20616ef
chore(extension): The types are well again.
grypez a5aafd3
test(extension): Prevent an unlikely future headache.
grypez 87112df
refactor(extension,streams): Generify StreamPair to allow MessagePort…
grypez 979b9b3
test(extension): Add capTp frangooly unit test.
grypez c01440c
chore: Update @endo/eventual-send@^1.2.4
grypez 324c051
types(extension): Strengthen message and envelope types.
grypez 9496c1b
test(extension): Test cover capTp usage errors.
grypez 0006d3a
test(extension): Add dev-console tests.
grypez ccf3c1e
refactor(extension): Avert a name collision with design doc.
grypez 19f16cb
feat(extension): Give vats individual message counters.
grypez c32f62b
refactor(extension): Use ExtensionTarget enum.
grypez f566a66
docs(extension): Flatten a transitive explanation.
grypez 5b595ae
chore(packages): Remove unused @endo/lockdown dependency.
grypez bf7be4b
chore: Remove unused code.
grypez 7dd0cbc
fix(extension): Organize dev-console priority in trusted-prelude.
grypez ad535fa
refactor: Label command envelopes 'command'.
grypez f430c10
test: Use it.each for multi-case test.
grypez 447acf9
docs: Clarify explanation for ts-ignore statements.
grypez 5074743
refactor: Move unresolved messages into VatRecord.
grypez c55469c
refactor: s/ExtensionTarget/ExtensionMessageTarget/g
grypez File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,2 @@ | ||
| import './dev-console.js'; | ||
| import './endoify.js'; | ||
| import './dev-console.js'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| import { describe, it, expect } from 'vitest'; | ||
| import '@ocap/shims/endoify'; | ||
| import './dev-console.js'; | ||
|
|
||
| describe('vat-console', () => { | ||
| describe('kernel', () => { | ||
| it('is available on globalThis', async () => { | ||
| expect(kernel).toBeDefined(); | ||
| }); | ||
|
|
||
| it('has expected property descriptors', async () => { | ||
| expect( | ||
| Object.getOwnPropertyDescriptor(globalThis, 'kernel'), | ||
| ).toMatchObject({ | ||
| configurable: false, | ||
| enumerable: true, | ||
| writable: false, | ||
| }); | ||
| }); | ||
| }); | ||
| }); | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| import { isObject } from '@metamask/utils'; | ||
|
|
||
| import type { WrappedIframeMessage } from './message.js'; | ||
| import { isWrappedIframeMessage } from './message.js'; | ||
|
|
||
| export enum EnvelopeLabel { | ||
| Command = 'command', | ||
| CapTp = 'capTp', | ||
| } | ||
|
|
||
| export type StreamEnvelope = | ||
| | { | ||
| label: EnvelopeLabel.Command; | ||
| content: WrappedIframeMessage; | ||
| } | ||
| | { label: EnvelopeLabel.CapTp; content: unknown }; | ||
|
|
||
| export const isStreamEnvelope = (value: unknown): value is StreamEnvelope => | ||
| isObject(value) && | ||
| (value.label === EnvelopeLabel.CapTp || | ||
| (value.label === EnvelopeLabel.Command && | ||
| isWrappedIframeMessage(value.content))); |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.