Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion conformance/driver-ct/deltic/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ gate (`../../../scripts/check-deltic-pin.sh`):
the SAME `@deltic/runtime/embedder` version (the module-identity
constraint: deltic's `wasi-shims` imports that specifier by bare name
internally, so every config resolving it must agree, or the embedder
module loads twice and `instanceof WitError` stops holding across
module loads twice and `instanceof ComponentException` stops holding across
the boundary).
- [`browser/deno.json`](browser/deno.json) — the SAME pins again, with
the npm WebRTC backends stubbed out (never executed in a page).
Expand Down
8 changes: 4 additions & 4 deletions conformance/driver-ct/deltic/browser/deno.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
"//": "The browser-bundle import map: identical deltic pins to ../deno.json, with the npm WebRTC backends mapped to ./stub.ts (never executed in a page; see stub.ts). deltic ships as exact-pinned JSR prereleases; the pin gate (`just deltic-check`) asserts one version repo-wide.",
"minimumDependencyAge": { "age": "P1D", "exclude": ["jsr:@deltic/*"] },
"imports": {
"@deltic/ct-runner": "jsr:@deltic/ct-runner@0.1.0-pre.ga67ee83",
"@deltic/runtime/embedder": "jsr:@deltic/runtime@0.1.0-pre.ga67ee83/embedder",
"@deltic/runtime/shim": "jsr:@deltic/runtime@0.1.0-pre.ga67ee83/shim",
"@deltic/wasi-shims": "jsr:@deltic/wasi-shims@0.1.0-pre.ga67ee83",
"@deltic/ct-runner": "jsr:@deltic/ct-runner@0.1.0-pre.g078aa15",
"@deltic/runtime/embedder": "jsr:@deltic/runtime@0.1.0-pre.g078aa15/embedder",
"@deltic/runtime/shim": "jsr:@deltic/runtime@0.1.0-pre.g078aa15/shim",
"@deltic/wasi-shims": "jsr:@deltic/wasi-shims@0.1.0-pre.g078aa15",
"node-datachannel": "./stub.ts",
"node-datachannel/polyfill": "./stub.ts",
"werift": "./stub.ts"
Expand Down
38 changes: 23 additions & 15 deletions conformance/driver-ct/deltic/browser/deno.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions conformance/driver-ct/deltic/deno.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"//": "MODULE-IDENTITY CONSTRAINT: deltic's wasi-shims module imports @deltic/runtime/embedder by bare specifier internally. Every config in this repo (this file AND deltic-impl/deno.json AND browser/deno.json) must map that specifier to the IDENTICAL exact-pinned JSR version, or the embedder module loads twice and `instanceof WitError` stops holding across the module boundary. deltic ships as exact-pinned JSR prereleases: the hash names the upstream commit; the lock carries integrity and --frozen enforces it; the pin gate (`just deltic-check`) asserts one version repo-wide. The npm mappings mirror deltic-impl/deno.json: the host module's bare `node-datachannel/polyfill` / `werift` specifiers resolve against THIS config when run.ts is the entry module.",
"//": "MODULE-IDENTITY CONSTRAINT: deltic's wasi-shims module imports @deltic/runtime/embedder by bare specifier internally. Every config in this repo (this file AND deltic-impl/deno.json AND browser/deno.json) must map that specifier to the IDENTICAL exact-pinned JSR version, or the embedder module loads twice and `instanceof ComponentException` stops holding across the module boundary. deltic ships as exact-pinned JSR prereleases: the hash names the upstream commit; the lock carries integrity and --frozen enforces it; the pin gate (`just deltic-check`) asserts one version repo-wide. The npm mappings mirror deltic-impl/deno.json: the host module's bare `node-datachannel/polyfill` / `werift` specifiers resolve against THIS config when run.ts is the entry module.",
"nodeModulesDir": "auto",
"minimumDependencyAge": { "age": "P1D", "exclude": ["jsr:@deltic/*"] },
"imports": {
"@deltic/ct-runner": "jsr:@deltic/ct-runner@0.1.0-pre.ga67ee83",
"@deltic/runtime/embedder": "jsr:@deltic/runtime@0.1.0-pre.ga67ee83/embedder",
"@deltic/runtime/shim": "jsr:@deltic/runtime@0.1.0-pre.ga67ee83/shim",
"@deltic/wasi-shims": "jsr:@deltic/wasi-shims@0.1.0-pre.ga67ee83",
"@deltic/translator": "jsr:@deltic/translator@0.1.0-pre.ga67ee83",
"@deltic/ct-runner": "jsr:@deltic/ct-runner@0.1.0-pre.g078aa15",
"@deltic/runtime/embedder": "jsr:@deltic/runtime@0.1.0-pre.g078aa15/embedder",
"@deltic/runtime/shim": "jsr:@deltic/runtime@0.1.0-pre.g078aa15/shim",
"@deltic/wasi-shims": "jsr:@deltic/wasi-shims@0.1.0-pre.g078aa15",
"@deltic/translator": "jsr:@deltic/translator@0.1.0-pre.g078aa15",
"node-datachannel": "npm:node-datachannel@0.32.3",
"node-datachannel/polyfill": "npm:node-datachannel@0.32.3/polyfill",
"werift": "npm:werift@0.22.2"
Expand Down
48 changes: 28 additions & 20 deletions conformance/driver-ct/deltic/deno.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion conformance/driver-ct/deltic/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
// `@deltic/runtime/embedder` by bare specifier internally; this leg's
// `deno.json` AND `deltic-impl/deno.json` (AND `browser/deno.json`) must
// map that specifier to the IDENTICAL pinned JSR version, or the embedder
// module loads twice and `instanceof WitError` stops holding across the
// module loads twice and `instanceof ComponentException` stops holding across the
// module boundary.

import { Translator } from "@deltic/runtime/shim";
Expand Down
8 changes: 4 additions & 4 deletions conformance/driver-ct/deltic/signaling.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
// `conformance-signalingd` (see `conformance/signaling/PROTOCOL.md`). The
// deltic analogue of the retired jco `signaling.js` (see git history) — same endpoints, same long-poll
// discipline; only the boundary conventions differ (`throw new
// WitError({ tag, val })` rather than a bare `{ tag, val }` payload, per
// ComponentException({ kind, value })` rather than a bare `{ tag, val }` payload, per
// deltic's contracts/embedder-api.md §"Error model").
//
// Blob payloads are opaque here; the conformance guest owns the encoding.
// Failures are thrown as the WIT `error` variant's `other` case, which the
// runtime lifts into the `result<_, error>` the mailbox interface declares.

import { WitError } from "@deltic/runtime/embedder";
import { ComponentException } from "@deltic/runtime/embedder";

/** The mailbox interface's WIT id (conformance/wit/deps/conformance-signaling). */
export const MAILBOX_INTERFACE = "conformance:signaling/mailbox@0.1.0";
Expand Down Expand Up @@ -118,8 +118,8 @@ export class Session {
}

/** Map a host-side mailbox failure to the guest-visible `error.other`. */
function mailboxError(detail: string): WitError {
return new WitError({ tag: "other", val: `mailbox: ${detail}` });
function mailboxError(detail: string): ComponentException {
return new ComponentException({ kind: "other", value: `mailbox: ${detail}` });
}

/**
Expand Down
4 changes: 2 additions & 2 deletions deltic-impl/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ port of the browser-first reference host `jco-impl/webrtc.js` **at
commit 65bc15b** (retired with the jco legs;
`git show 65bc15b:jco-impl/webrtc.js`): the same
behavioral reference host, rewritten over deltic's embedder API (typed
`Stream<T>` / `ReadableStream` rather than jco streams, and `WitError`
`Stream<T>` / `ReadableStream` rather than jco streams, and `ComponentException`
throws rather than `throw { tag, val }`). It was developed as deltic's
own `ports/webrtc` reference-host port and is upstreamed here per
[lann/deltic#14](https://github.com/lann/deltic/issues/14); the WIT
Expand Down Expand Up @@ -44,7 +44,7 @@ byte-identical with the one in
[`conformance/driver-ct/deltic/deno.json`](../conformance/driver-ct/deltic/deno.json)
(and its `browser/deno.json`): deltic's `wasi-shims` imports that
specifier by bare name internally, so two divergent mappings load the
embedder module twice and `instanceof WitError` stops holding across
embedder module twice and `instanceof ComponentException` stops holding across
the module boundary. The bump procedure lives in
[`conformance/driver-ct/deltic/README.md`](../conformance/driver-ct/deltic/README.md);
`just deltic-check` asserts all three configs agree on one version
Expand Down
4 changes: 2 additions & 2 deletions deltic-impl/deno.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
"name": "@polymorph/webrtc-datachannels-deltic",
"version": "0.0.0",
"exports": "./src/webrtc.ts",
"//": "MODULE-IDENTITY CONSTRAINT: deltic's wasi-shims module imports @deltic/runtime/embedder by bare specifier internally. Every config in this repo (this file AND conformance/driver-ct/deltic/deno.json AND conformance/driver-ct/deltic/browser/deno.json) must map that specifier to the IDENTICAL exact-pinned JSR version, or the embedder module loads twice and `instanceof WitError` stops holding across the module boundary. deltic ships as exact-pinned JSR prereleases: the hash in the version names the upstream commit; the lock carries integrity and --frozen enforces it; the pin gate (`just deltic-check`) asserts one version repo-wide.",
"//": "MODULE-IDENTITY CONSTRAINT: deltic's wasi-shims module imports @deltic/runtime/embedder by bare specifier internally. Every config in this repo (this file AND conformance/driver-ct/deltic/deno.json AND conformance/driver-ct/deltic/browser/deno.json) must map that specifier to the IDENTICAL exact-pinned JSR version, or the embedder module loads twice and `instanceof ComponentException` stops holding across the module boundary. deltic ships as exact-pinned JSR prereleases: the hash in the version names the upstream commit; the lock carries integrity and --frozen enforces it; the pin gate (`just deltic-check`) asserts one version repo-wide.",
"nodeModulesDir": "auto",
"minimumDependencyAge": { "age": "P1D", "exclude": ["jsr:@deltic/*"] },
"imports": {
"@deltic/runtime/embedder": "jsr:@deltic/runtime@0.1.0-pre.ga67ee83/embedder",
"@deltic/runtime/embedder": "jsr:@deltic/runtime@0.1.0-pre.g078aa15/embedder",
"node-datachannel": "npm:node-datachannel@0.32.3",
"node-datachannel/polyfill": "npm:node-datachannel@0.32.3/polyfill",
"werift": "npm:werift@0.22.2"
Expand Down
15 changes: 11 additions & 4 deletions deltic-impl/deno.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 13 additions & 13 deletions deltic-impl/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,32 +3,32 @@
//
// Authority: wit/webrtc.wit `interface types` (polymorph-webrtc-datachannels,
// read-only reference). Enums are kebab-case string literal unions; variants
// are `{ tag, val? }`; records are plain camelCase objects.
// are `{ kind, value? }`; records are plain camelCase objects.

import type { Stream, StreamSource } from "@deltic/runtime/embedder";

// --- error -----------------------------------------------------------------

export type WebrtcError =
| { tag: "closed" }
| { tag: "timed-out" }
| { tag: "invalid-signaling"; val: string }
| { tag: "receiving-via-stream" }
| { tag: "receive-buffer-overflow" }
| { tag: "other"; val: string };
| { kind: "closed" }
| { kind: "timed-out" }
| { kind: "invalid-signaling"; value: string }
| { kind: "receiving-via-stream" }
| { kind: "receive-buffer-overflow" }
| { kind: "other"; value: string };

// --- message -----------------------------------------------------------------

export type Message =
| { tag: "binary"; val: Uint8Array }
| { tag: "string"; val: string };
| { kind: "binary"; value: Uint8Array }
| { kind: "string"; value: string };

export const Message = {
binary(bytes: Uint8Array): Message {
return { tag: "binary", val: bytes };
return { kind: "binary", value: bytes };
},
string(text: string): Message {
return { tag: "string", val: text };
return { kind: "string", value: text };
},
};

Expand Down Expand Up @@ -84,8 +84,8 @@ export interface IceCandidate {
// --- config-error ------------------------------------------------------------------

export type ConfigError =
| { tag: "not-supported" }
| { tag: "invalid"; val: string };
| { kind: "not-supported" }
| { kind: "invalid"; value: string };

// --- ice-server --------------------------------------------------------------------

Expand Down
Loading
Loading