@mcp-b/do-runtime 0.1.0 → 0.1.2

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/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.1.2
4
+
5
+ ### Patch Changes
6
+
7
+ - 5f26eb1: Expose the held input lock on `ActorContainer` as `hasCurrent()` so a host stub can identify the calling actor from a lock-holding continuation and route the call through its `awaitIo`.
8
+
9
+ ## 0.1.1
10
+
11
+ ### Patch Changes
12
+
13
+ - 5972b65: Preserve the native `ReadableStream` brand when gating response body reads so Chromium accepts tee branches as `Response` bodies.
14
+
3
15
  ## 0.1.0 — 2026-08-20
4
16
 
5
17
  - Port workerd-style actor identity, input/output gates, SQLite KV and SQL, alarms, facets, Worker Loader, loopback exports, WebSockets, and gated host primitives to TypeScript.
package/dist/index.js CHANGED
@@ -3679,34 +3679,27 @@ function gateResponseBody(ctx, response) {
3679
3679
  */
3680
3680
  var BYOB_READER_UNGATABLE_MESSAGE = "getReader({ mode: 'byob' }): a BYOB reader cannot be gated by this runtime, because `ReadableStream.getReader` is the only seam it has and a byte stream's `read(view)` returns the caller's own buffer. Read the body through `arrayBuffer()` or a default reader.";
3681
3681
  function gateReadableStream(ctx, stream) {
3682
- const bound = /* @__PURE__ */ new Map();
3683
- return new Proxy(stream, { get(subject, property) {
3684
- const cached = bound.get(property);
3685
- if (cached !== void 0) return cached;
3686
- if (property === "getReader") {
3687
- const getReader = (options) => {
3682
+ const getReader = stream.getReader.bind(stream);
3683
+ const tee = stream.tee.bind(stream);
3684
+ Object.defineProperties(stream, {
3685
+ getReader: {
3686
+ configurable: true,
3687
+ writable: true,
3688
+ value(options) {
3688
3689
  if (options?.mode === "byob") throw new Error(BYOB_READER_UNGATABLE_MESSAGE);
3689
- return gateReader(ctx, subject.getReader());
3690
- };
3691
- bound.set(property, getReader);
3692
- return getReader;
3693
- }
3694
- if (property === "tee") {
3695
- const tee = () => {
3696
- const [a, b] = subject.tee();
3690
+ return gateReader(ctx, getReader());
3691
+ }
3692
+ },
3693
+ tee: {
3694
+ configurable: true,
3695
+ writable: true,
3696
+ value() {
3697
+ const [a, b] = tee();
3697
3698
  return [gateReadableStream(ctx, a), gateReadableStream(ctx, b)];
3698
- };
3699
- bound.set(property, tee);
3700
- return tee;
3701
- }
3702
- const value = Reflect.get(subject, property, subject);
3703
- if (typeof value === "function") {
3704
- const method = value.bind(subject);
3705
- bound.set(property, method);
3706
- return method;
3699
+ }
3707
3700
  }
3708
- return value;
3709
- } });
3701
+ });
3702
+ return stream;
3710
3703
  }
3711
3704
  function gateReader(ctx, reader) {
3712
3705
  return new Proxy(reader, { get(subject, property) {
@@ -6914,6 +6907,9 @@ var ActorContainerImpl = class {
6914
6907
  isCurrentSlice() {
6915
6908
  return this.#ctx.isCurrentSlice();
6916
6909
  }
6910
+ hasCurrent() {
6911
+ return this.#ctx.hasCurrent();
6912
+ }
6917
6913
  /**
6918
6914
  * ← `ActorContainer::start` (`server.c++:2854-2957`) as far as the class
6919
6915
  * instance, plus decision 4's boot semantics.