@botiverse/porthole 0.15.2 → 0.16.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.
Files changed (109) hide show
  1. package/CHANGELOG.md +89 -0
  2. package/dist/bridge/bridge.d.ts +1 -8
  3. package/dist/bridge/bridge.js +0 -7
  4. package/dist/check/page-source.js +1 -1
  5. package/dist/check/page.js +1 -1
  6. package/dist/compile/policy.d.ts +0 -7
  7. package/dist/compile/policy.js +1 -10
  8. package/dist/config/capabilities.d.ts +8 -14
  9. package/dist/config/capabilities.js +4 -5
  10. package/dist/config/schema.d.ts +2 -13
  11. package/dist/config/validate.js +0 -24
  12. package/dist/conformance/behavior.js +26 -37
  13. package/dist/conformance/clipboard.js +47 -1
  14. package/dist/conformance/harness-source.js +1 -1
  15. package/dist/displays/displays.js +1 -3
  16. package/dist/guide/limits.js +1 -1
  17. package/dist/guide/runtime.js +1 -1
  18. package/dist/host/create-host.d.ts +1 -1
  19. package/dist/host/create-host.js +6 -51
  20. package/dist/host/door.d.ts +1 -1
  21. package/dist/host/locate.d.ts +1 -1
  22. package/dist/host/locate.js +2 -2
  23. package/dist/host/outcome.d.ts +5 -12
  24. package/dist/host/outcome.js +8 -16
  25. package/dist/host/types.d.ts +6 -22
  26. package/dist/index.d.ts +2 -4
  27. package/dist/index.js +2 -4
  28. package/dist/isolation/served.d.ts +9 -14
  29. package/dist/isolation/served.js +17 -31
  30. package/dist/isolation/types.d.ts +2 -19
  31. package/dist/isolation/types.js +0 -17
  32. package/dist/platform/focus-field.d.ts +11 -0
  33. package/dist/platform/focus-field.js +18 -0
  34. package/dist/platform/types.d.ts +6 -22
  35. package/dist/platform/web.js +8 -98
  36. package/dist/presets/presets.d.ts +0 -2
  37. package/dist/presets/presets.js +0 -1
  38. package/dist/react/frame.d.ts +0 -8
  39. package/dist/react/frame.js +0 -4
  40. package/dist/runtime/contract.d.ts +2 -2
  41. package/dist/runtime/contract.js +2 -2
  42. package/dist/runtime/types.generated.js +6 -6
  43. package/dist/server/files.js +7 -23
  44. package/dist/server/host.d.ts +1 -1
  45. package/dist/server/index.d.ts +1 -1
  46. package/dist/server/index.js +4 -6
  47. package/dist/server/naming.js +1 -1
  48. package/dist/server/pages.d.ts +9 -2
  49. package/dist/server/pages.js +28 -8
  50. package/dist/server/server.js +28 -166
  51. package/dist/server/types.d.ts +7 -7
  52. package/dist/shell/plan.js +2 -2
  53. package/dist/shell/runtime.js +1 -9
  54. package/docs/ADOPTING.md +42 -135
  55. package/docs/ARCHITECTURE.md +0 -33
  56. package/docs/DECISIONS.md +296 -9
  57. package/docs/DESIGN.md +27 -50
  58. package/docs/THREAT_MODEL.md +140 -242
  59. package/package.json +1 -1
  60. package/src/bridge/bridge.ts +1 -17
  61. package/src/check/page.ts +1 -1
  62. package/src/compile/policy.ts +1 -11
  63. package/src/config/capabilities.ts +8 -14
  64. package/src/config/schema.ts +2 -13
  65. package/src/config/validate.ts +0 -28
  66. package/src/conformance/behavior.ts +50 -52
  67. package/src/conformance/clipboard.ts +56 -1
  68. package/src/displays/displays.ts +1 -3
  69. package/src/guide/limits.ts +1 -1
  70. package/src/guide/runtime.ts +1 -1
  71. package/src/host/create-host.ts +6 -52
  72. package/src/host/door.ts +1 -1
  73. package/src/host/locate.ts +2 -2
  74. package/src/host/outcome.ts +8 -21
  75. package/src/host/types.ts +6 -20
  76. package/src/index.ts +2 -4
  77. package/src/isolation/served.ts +18 -37
  78. package/src/isolation/types.ts +2 -24
  79. package/src/platform/focus-field.ts +18 -0
  80. package/src/platform/types.ts +6 -21
  81. package/src/platform/web.ts +8 -116
  82. package/src/presets/presets.ts +0 -3
  83. package/src/react/frame.tsx +0 -10
  84. package/src/runtime/contract.ts +4 -4
  85. package/src/runtime/types.generated.ts +6 -6
  86. package/src/server/files.ts +4 -19
  87. package/src/server/host.ts +1 -1
  88. package/src/server/index.ts +4 -16
  89. package/src/server/naming.ts +1 -1
  90. package/src/server/pages.ts +38 -12
  91. package/src/server/server.ts +29 -189
  92. package/src/server/types.ts +7 -7
  93. package/src/shell/plan.ts +2 -2
  94. package/src/shell/runtime.ts +1 -9
  95. package/types/runtime/v1/artifact.d.ts +2 -3
  96. package/types/runtime/v1/assets.d.ts +1 -1
  97. package/types/runtime/v1/chat.d.ts +2 -2
  98. package/types/runtime/v1/comments.d.ts +1 -1
  99. package/types/runtime/v1/downloads.d.ts +2 -2
  100. package/types/runtime/v1/links.d.ts +2 -2
  101. package/dist/platform/focus-guard.d.ts +0 -252
  102. package/dist/platform/focus-guard.js +0 -764
  103. package/dist/server/nested.d.ts +0 -66
  104. package/dist/server/nested.js +0 -120
  105. package/dist/shell/frame.d.ts +0 -28
  106. package/dist/shell/frame.js +0 -338
  107. package/src/platform/focus-guard.ts +0 -999
  108. package/src/server/nested.ts +0 -156
  109. package/src/shell/frame.ts +0 -371
@@ -7,8 +7,8 @@ import { randomBytes } from "./crypto.js";
7
7
  import { isHostLabel, reservedLabels } from "./naming.js";
8
8
  import { doorResponse, doorStatusResponse, enterPage, pageScript, SESSION_PATH, statusPage, tabOnlyPage, } from "./pages.js";
9
9
  import { libraryFile } from "./libraries.js";
10
- import { isNavigation, ownLoad, serveAsset, serveFile, ticketPage } from "./files.js";
11
- import { isNestedLabel, nestedAncestors, nestedLabelOf, nestedFileCsp, nestedShellResponse, PORTHOLE_LABEL_PREFIX, } from "./nested.js";
10
+ import { ownLoad, serveAsset, serveFile, ticketPage } from "./files.js";
11
+ import { PORTHOLE_LABEL_PREFIX } from "../isolation/served.js";
12
12
  import { DEFAULT_ENTRY } from "../files/paths.js";
13
13
  import { isPagePath } from "../files/types.js";
14
14
  import { isPortholeCookie, setsPortholeCookie } from "./proxy.js";
@@ -47,10 +47,8 @@ const BASE = /^\/(?:(?!\.{1,2}\/)[A-Za-z0-9._:~-]{1,200}\/){0,16}$/u;
47
47
  const ENTER_PATH = "/__porthole/enter";
48
48
  /** Where a redirect entry's code is redeemed, before its clean address (P068). */
49
49
  const ENTRY_PATH = "/__porthole/entry";
50
- /** How long a nested page's ticket from its clean address to its shell's label lasts (P114). */
51
- const HOP_SECONDS = 60;
52
50
  /**
53
- * A path below a file set's base, as a hop's ticket carries it (P114): a relative path of URL path
51
+ * A path below a file set's base, as a ticket carries it (a page of a set, P125): a relative path of URL path
54
52
  * characters, no empty segment but a last one, no dot segment (encoded or not), no query.
55
53
  */
56
54
  const isPageRest = (rest) => typeof rest === "string" &&
@@ -264,29 +262,12 @@ export function createServer(options) {
264
262
  }
265
263
  return label;
266
264
  };
267
- /**
268
- * The label an instance is served on: its scope's, or a nested page's shell's own (P114), on
269
- * which nothing but nested pages' shells, their pages and those pages' files is ever served.
270
- * Every other display of the scope runs agent-made content on the scope's origin with
271
- * `allow-same-origin`: on that origin, the shell's realm (its word to the host, the page's
272
- * sealed address) would be theirs.
273
- */
274
- const labelFor = (instance) => {
275
- const label = nameOf(instance.scope);
276
- if (instance.document.kind !== "artifact" || compiledFor(instance)?.config.nested !== true) {
277
- return label;
278
- }
279
- const own = nestedLabelOf(label);
280
- if (isReserved(own)) {
281
- throw new TypeError(`content.reserved holds ${own}, a nested page's shell's label: reserve no ${PORTHOLE_LABEL_PREFIX} label`);
282
- }
283
- return own;
284
- };
285
- /** Whether a request's label may be one this server named (a nested page's shell's, P114). */
265
+ /** The label an instance is served on: its scope's. */
266
+ const labelFor = (instance) => nameOf(instance.scope);
267
+ /** Whether a request's label may be one this server named: never one of Porthole's own. */
286
268
  const ours = (label) => !isReserved(label) &&
287
- (isNestedLabel(label) ||
288
- (!label.startsWith(PORTHOLE_LABEL_PREFIX) &&
289
- (content.name === undefined ? LABEL.test(label) : isHostLabel(label))));
269
+ !label.startsWith(PORTHOLE_LABEL_PREFIX) &&
270
+ (content.name === undefined ? LABEL.test(label) : isHostLabel(label));
290
271
  const secure = content.scheme === "https";
291
272
  const defaultPort = secure ? 443 : 80;
292
273
  const portPart = content.port === undefined || content.port === defaultPort ? "" : `:${content.port}`;
@@ -294,7 +275,6 @@ export function createServer(options) {
294
275
  const contentSource = `${content.scheme}://*.${domain}${portPart}`;
295
276
  const sampleHost = `${keys.label("")}.${domain}`;
296
277
  const sampleOrigin = originOfLabel(keys.label(""));
297
- const sampleNestedOrigin = originOfLabel(nestedLabelOf(keys.label("")));
298
278
  const authorize = options.authorize;
299
279
  const authorizeTtl = authorize?.ttlSeconds ?? 0;
300
280
  if (!Number.isInteger(authorizeTtl) || authorizeTtl < 0 || authorizeTtl > 300) {
@@ -448,9 +428,7 @@ export function createServer(options) {
448
428
  if (config.isolation !== "domain" || !MODES[kind].includes(config.mode)) {
449
429
  throw new TypeError(`The config ${JSON.stringify(name)} (${config.mode}, ${config.isolation}) can't serve a ${kind}: it needs ${MODES[kind].join(" or ")} mode with domain isolation`);
450
430
  }
451
- // A nested page's shell is on a label of its own (P114): its frame source is the same.
452
- const samples = config.nested === true ? [sampleOrigin, sampleNestedOrigin] : [sampleOrigin];
453
- if (!samples.every((sample) => config.contentOrigins.some((source) => originMatchesSource(sample, source)))) {
431
+ if (!config.contentOrigins.some((source) => originMatchesSource(sampleOrigin, source))) {
454
432
  throw new TypeError(`The config ${JSON.stringify(name)}'s contentOrigins don't include this server's (${contentSource})`);
455
433
  }
456
434
  return each;
@@ -523,7 +501,6 @@ export function createServer(options) {
523
501
  }
524
502
  return {
525
503
  html: config.shellDocument({ origins, document: stored.html, cspMeta: false }),
526
- document: stored.html,
527
504
  compiled: config,
528
505
  assets: true,
529
506
  };
@@ -752,8 +729,8 @@ export function createServer(options) {
752
729
  return best;
753
730
  }
754
731
  /**
755
- * A taken ticket, if it is good for `label`'s origin: its instance's own (a nested page's shell's,
756
- * P114), or for an entry code (`entry`) its scope's, where a clean address is.
732
+ * A taken ticket, if it is good for `label`'s origin: its instance's own, or for an entry code
733
+ * (`entry`) its scope's, where a clean address is.
757
734
  */
758
735
  async function take(ticket, label, entry = false) {
759
736
  if (ticket === null || ticket.length === 0 || ticket.length > 128) {
@@ -893,17 +870,14 @@ export function createServer(options) {
893
870
  if (await sealedEmbed(label, token)) {
894
871
  return page(401, "This has ended", "Content here opens for a while. Open it again from the page that showed it.", method, "session", undefined, true);
895
872
  }
896
- // In a nested page's frame (P111) its shell frames it and hears it, on this origin; a
897
- // config without nesting never frames this address but at the host.
898
- return statusPage(401, "This has ended", "Content here opens for a while. Open it again from the app that showed it.", nestedAncestors(origin, frameAncestors), method, "session", [...options.hostOrigins, origin]);
873
+ return statusPage(401, "This has ended", "Content here opens for a while. Open it again from the app that showed it.", frameAncestors, method, "session", options.hostOrigins);
899
874
  }
900
875
  // An asset of this artifact's library, at the frame's own sealed address (P091): every engine
901
876
  // sends a frame's path, where some send no Referer that names it.
902
877
  const blob = SEALED_ASSET.exec(rest)?.[1];
903
878
  if (blob !== undefined) {
904
- // A nested page loads no assets (its config refuses them): none on its shell's label (P114).
905
879
  const none = () => page(404, "Not found", "This address names no content.", method, undefined, undefined, access.embed === true);
906
- if (options.assets === undefined || isNestedLabel(label)) {
880
+ if (options.assets === undefined) {
907
881
  return none();
908
882
  }
909
883
  return (await assetFor(request, label, access, blob)) ?? none();
@@ -972,7 +946,7 @@ export function createServer(options) {
972
946
  if (access === null) {
973
947
  return page(401, "This link has been used", "Content here opens once per link. Open it again from the app that showed it.", method, "session");
974
948
  }
975
- // A nested page's hop from its clean address (P114): the page below its base it was entered at.
949
+ // The page below its base the ticket was issued for (a page of a set, P125).
976
950
  const asked = cookie === null ? undefined : record?.page;
977
951
  const rest = isPageRest(asked) ? asked : undefined;
978
952
  return serveAccess(request, access, cookie, undefined, rest);
@@ -989,8 +963,7 @@ export function createServer(options) {
989
963
  /**
990
964
  * A served display's door (P125): its own ticket's, taken once, for this instance on this
991
965
  * origin; then the door's answer for that ticket's grant (`answerDoor`, the one `doorAnswer`
992
- * gives, P126). No other ticket opens it, and a nested page's shell's label serves none
993
- * (`serveShellLabel`).
966
+ * gives, P126). No other ticket opens it.
994
967
  */
995
968
  async function serveDoor(request, url, label, key) {
996
969
  const method = request.method.toUpperCase();
@@ -1005,8 +978,7 @@ export function createServer(options) {
1005
978
  record.embed === true ||
1006
979
  record.entry !== undefined ||
1007
980
  record.instance.document.kind === "external" ||
1008
- keys.instanceKey(record.instance) !== key ||
1009
- compiledFor(record.instance)?.config.nested === true) {
981
+ keys.instanceKey(record.instance) !== key) {
1010
982
  return doorSays(401, "session", method);
1011
983
  }
1012
984
  }
@@ -1061,7 +1033,7 @@ export function createServer(options) {
1061
1033
  * (`at`) a path under a file set's base (P081).
1062
1034
  */
1063
1035
  async function serveAccess(request, access, cookie, at,
1064
- /** A nested page's path below its files' base, from its hop's ticket (P114). */
1036
+ /** The page below its files' base its ticket was issued for (a page of a set, P125). */
1065
1037
  pageAt) {
1066
1038
  const method = request.method.toUpperCase();
1067
1039
  const refusal = await denied(request, access);
@@ -1087,55 +1059,8 @@ export function createServer(options) {
1087
1059
  ("files" in served ? ticketPage(served.files, pageAt) === null : pageAt !== undefined)) {
1088
1060
  return missing();
1089
1061
  }
1090
- // A nested page (P111): the address the host frames (a ticket's, a cookie's, an entered
1091
- // one's) answers Porthole's shell, which frames the page at its sealed files' address; only
1092
- // that address, below the sealed prefix, answers the page and its files, without a cookie.
1093
- const nested = served.compiled.config.nested === true;
1094
- const sealedAt = at !== undefined && at.base.startsWith(FILES_PREFIX);
1095
- if (nested && !sealedAt) {
1096
- if (!isNavigation(request)) {
1097
- return page(404, "Not found", "This page's files are at its own address.", method);
1098
- }
1099
- // Its shell is served on its own label alone (P114): a clean address, entered on the scope's
1100
- // label (P068), goes there with a one-time ticket of its own, for what is left of its session.
1101
- const own = originOfLabel(labelFor(access.instance));
1102
- if (access.origin !== own) {
1103
- return hop(access, own, "files" in served && at !== undefined ? at.rest : "");
1104
- }
1105
- const sealed = await sealFiles(access);
1106
- let rest = "";
1107
- if ("files" in served) {
1108
- const entry = served.files.entry ?? DEFAULT_ENTRY;
1109
- rest =
1110
- pageAt !== undefined
1111
- ? pageAt
1112
- : at !== undefined && at.rest !== ""
1113
- ? at.rest
1114
- : entry.includes("/")
1115
- ? entry
1116
- .split("/")
1117
- .map((segment) => encodeURIComponent(segment))
1118
- .join("/")
1119
- : "";
1120
- }
1121
- const shell = nestedShellResponse(served.compiled, {
1122
- origin: access.origin,
1123
- origins: options.hostOrigins,
1124
- framedBy,
1125
- page: `${access.origin}${sealed.base}${rest}`,
1126
- renew: { url: `${access.origin}${sealed.base}__porthole/renew`, expires: sealed.expires },
1127
- method,
1128
- });
1129
- if (cookie !== null) {
1130
- shell.headers.set("set-cookie", cookie);
1131
- }
1132
- return shell;
1133
- }
1134
- // Below the sealed prefix, a nested page and its files are framed by its shell too. An embed
1135
- // session is never nested (`issue`): its answers are framed by any page (P143).
1136
- const ancestors = nested
1137
- ? nestedAncestors(access.origin, frameAncestors)
1138
- : ancestorsFor(access);
1062
+ // An embed session's answers are framed by any page (P143).
1063
+ const ancestors = ancestorsFor(access);
1139
1064
  // Whom its pages hear and tell: the host origins, or no one for an embed session (P143).
1140
1065
  const hostOrigins = embed ? [] : options.hostOrigins;
1141
1066
  if ("files" in served) {
@@ -1189,48 +1114,11 @@ export function createServer(options) {
1189
1114
  const directives = served.assets
1190
1115
  ? assetCspDirectives(config, cspDirectives, access.origin)
1191
1116
  : cspDirectives;
1192
- const headers = documentHeaders(nested ? nestedFileCsp("page", directives) : servedDocumentCsp(config, directives), servedPermissionsPolicy(config), ancestors);
1117
+ const headers = documentHeaders(servedDocumentCsp(config, directives), servedPermissionsPolicy(config), ancestors);
1193
1118
  if (cookie !== null) {
1194
1119
  headers.set("set-cookie", cookie);
1195
1120
  }
1196
- // A nested page's document takes messages from its shell, on its own origin (P111).
1197
- const html = nested
1198
- ? served.compiled.shellDocument({
1199
- origins: [access.origin],
1200
- document: served.document ?? "",
1201
- cspMeta: false,
1202
- })
1203
- : served.html;
1204
- return new Response(method === "HEAD" ? null : html, { status: 200, headers });
1205
- }
1206
- /**
1207
- * A nested page entered at its clean address (P114), whose shell is never served there: on to the
1208
- * shell's own label, with a one-time ticket for the same access (its viewer, its subject, what is
1209
- * left of its session) and the path below its base it was entered at. Only this server's own
1210
- * answer carries the ticket, as `issue`'s frame address does; the host's check already let the
1211
- * request in.
1212
- */
1213
- async function hop(access, own, rest) {
1214
- const now = Date.now();
1215
- const ticket = newTicket();
1216
- await tickets.put(ticketId(ticket), {
1217
- instance: access.instance,
1218
- viewer: access.viewer,
1219
- expiresAt: now + HOP_SECONDS * 1_000,
1220
- sessionSeconds: Math.min(MAX_SESSION_SECONDS, Math.max(1, Math.floor((access.expiresAt - now) / 1_000))),
1221
- ...(access.anonymous === true ? { anonymous: true } : {}),
1222
- ...(access.subject === undefined ? {} : { subject: access.subject }),
1223
- ...(isPageRest(rest) ? { page: rest } : {}),
1224
- });
1225
- return new Response(null, {
1226
- status: 303,
1227
- headers: {
1228
- location: `${own}${PREFIX}d/${keys.instanceKey(access.instance)}?ticket=${ticket}`,
1229
- "cache-control": "no-store",
1230
- "referrer-policy": "no-referrer",
1231
- "x-robots-tag": "noindex, nofollow",
1232
- },
1233
- });
1121
+ return new Response(method === "HEAD" ? null : served.html, { status: 200, headers });
1234
1122
  }
1235
1123
  /**
1236
1124
  * An asset at `/_blob/<id>` (P089, after the review): a request carrying an access to an
@@ -1619,34 +1507,12 @@ export function createServer(options) {
1619
1507
  return page(502, "The app didn't answer", "Its server couldn't be reached.", method);
1620
1508
  }
1621
1509
  }
1622
- /**
1623
- * A nested page's shell's own label (P114): Porthole's shell at a frame's address, its page and
1624
- * that page's files below the sealed prefix, and Porthole's status pages (and their script).
1625
- * Nothing else: no clean address, entry, asset, library or app, so no agent-made content ever
1626
- * runs on this origin with it (every file below the prefix carries a sandbox without it).
1627
- */
1628
- async function serveShellLabel(request, url, label) {
1629
- const method = request.method.toUpperCase();
1630
- const script = pageScript(url.pathname);
1631
- if (script !== null) {
1632
- return script;
1633
- }
1634
- const document = DOCUMENT_PATH.exec(url.pathname);
1635
- if (document?.[1] !== undefined) {
1636
- return serveDocument(request, url, label, document[1]);
1637
- }
1638
- const sealed = FILES_PATH.exec(url.pathname);
1639
- if (sealed?.[1] !== undefined) {
1640
- return serveSealed(request, url, label, sealed[1], sealed[2]);
1641
- }
1642
- return page(404, "Nothing here", "This address names no content.", method);
1643
- }
1644
1510
  /** A grant, checked for an instance (`issue`'s rules, and `doorAnswer`'s, P126). */
1645
1511
  function checkGrant(clean, grant) {
1646
1512
  const anonymous = grant.anonymous === true;
1647
1513
  // An embedded document (P143): a public page with no host, which any page may frame. Only
1648
1514
  // where the host opted in, and only as narrow as that: anonymous, no level, no user, an
1649
- // artifact's page that isn't nested.
1515
+ // artifact's page.
1650
1516
  // Read as given: a host's grant is checked here, not trusted to its type.
1651
1517
  const asked = grant.embed;
1652
1518
  const embed = asked !== undefined;
@@ -1660,8 +1526,8 @@ export function createServer(options) {
1660
1526
  if (!anonymous || grant.level !== undefined || grant.user !== undefined) {
1661
1527
  throw new TypeError("An embed grant is anonymous, with no viewer, level or user: it has no host to give them to (P143)");
1662
1528
  }
1663
- if (clean.document.kind !== "artifact" || compiledFor(clean)?.config.nested === true) {
1664
- throw new TypeError("An embed grant opens an artifact's page that isn't nested: never a url-mode app, a served shell, the sandbox proxy or a nested display (P143)");
1529
+ if (clean.document.kind !== "artifact") {
1530
+ throw new TypeError("An embed grant opens an artifact's page: never a url-mode app, a served shell or the sandbox proxy (P143)");
1665
1531
  }
1666
1532
  }
1667
1533
  if (anonymous) {
@@ -1737,11 +1603,11 @@ export function createServer(options) {
1737
1603
  }
1738
1604
  /**
1739
1605
  * Whether an instance's frame has a door (P125): a document framed on its scope's origin, where
1740
- * the scope's other displays run content (a served shell, a page that isn't nested, the sandbox
1741
- * proxy). A nested page's frame is its shell, on a label of its own; a url-mode app has none.
1606
+ * the scope's other displays run content (a served shell, a page, the sandbox proxy). A
1607
+ * url-mode app has none.
1742
1608
  */
1743
1609
  function hasDoor(instance) {
1744
- return instance.document.kind !== "external" && compiledFor(instance)?.config.nested !== true;
1610
+ return instance.document.kind !== "external";
1745
1611
  }
1746
1612
  const underDomain = (host) => host === domain || host.endsWith(`.${domain}`);
1747
1613
  /**
@@ -1795,7 +1661,6 @@ export function createServer(options) {
1795
1661
  throw new TypeError("A frame's page is a relative path below an artifact's files (no . or ..)");
1796
1662
  }
1797
1663
  const { clean, key, ticket, door } = await mint(instance, grant, undefined, below);
1798
- // A nested page's frame is its shell, on the shell's own label (P114).
1799
1664
  const origin = originOfLabel(labelFor(clean));
1800
1665
  const path = clean.document.kind === "external"
1801
1666
  ? `${ENTER_PATH}?ticket=${ticket}`
@@ -1817,7 +1682,7 @@ export function createServer(options) {
1817
1682
  const clean = cleanInstance(instance);
1818
1683
  check(clean);
1819
1684
  if (!hasDoor(clean)) {
1820
- throw new TypeError("This instance has no door (P125): a nested page's frame is its shell, a url-mode app has none");
1685
+ throw new TypeError("This instance has no door (P125): a url-mode app has none");
1821
1686
  }
1822
1687
  const below = at.page;
1823
1688
  if (below !== undefined && (!isPageRest(below) || clean.document.kind !== "artifact")) {
@@ -1943,9 +1808,6 @@ export function createServer(options) {
1943
1808
  if (!ours(label)) {
1944
1809
  return page(404, "Nothing here", "This address names no content.", method);
1945
1810
  }
1946
- if (isNestedLabel(label)) {
1947
- return await serveShellLabel(request, url, label);
1948
- }
1949
1811
  if (url.pathname === ENTER_PATH) {
1950
1812
  return await enter(request, url, label);
1951
1813
  }
@@ -78,8 +78,8 @@ export type Grant = ({
78
78
  /**
79
79
  * An embedded document (P143): a public page that any site may frame, with no host. Only where
80
80
  * the server opted in (`ServerOptions.embeds`), only with `anonymous: true` and no `level` or
81
- * `user`, and only for an artifact's page that isn't nested (never a url-mode app, a served shell,
82
- * the sandbox proxy or a nested display); anything else throws at `issue`. Carried signed in the
81
+ * `user`, and only for an artifact's page (never a url-mode app, a served shell or the sandbox
82
+ * proxy); anything else throws at `issue`. Carried signed in the
83
83
  * session (and in a frame's sealed files' address), so it is never added to a session or taken
84
84
  * from one. Every answer of such a session says `frame-ancestors *` (no other session's changes),
85
85
  * its shell's plan names no host (it asks no host, hears none and tells no parent anything; the
@@ -110,14 +110,14 @@ export interface TicketRecord {
110
110
  readonly pinned?: boolean;
111
111
  };
112
112
  /**
113
- * A nested page's ticket from its clean address to its shell's own label (P114): the path below
114
- * its files' base the shell opens (the entry page when absent).
113
+ * The page below its files' base the ticket was issued for (a page of a set, P125): the entry
114
+ * page when absent.
115
115
  */
116
116
  readonly page?: string;
117
117
  /**
118
118
  * A door's ticket (P125): `issue` mints one beside the content's, for the same grant and as
119
- * long, for a display whose frame is on its scope's origin (a served shell, a page that isn't
120
- * nested, the sandbox proxy). Taken only at the door (`/__porthole/door/<key>`), never at the
119
+ * long, for a display whose frame is on its scope's origin (a served shell, a page, the sandbox
120
+ * proxy). Taken only at the door (`/__porthole/door/<key>`), never at the
121
121
  * content's address; the door takes no other.
122
122
  */
123
123
  readonly door?: true;
@@ -378,7 +378,7 @@ export interface PortholeServer {
378
378
  * is what `authorize.check` is handed (and gives the method: HEAD has no body, a method other
379
379
  * than GET or HEAD is 405); default, a GET of the door on the instance's origin. Throws, as
380
380
  * `issue` does, for an instance or grant `issue` would refuse, and for an instance with no door
381
- * (a nested page, a url-mode app).
381
+ * (a url-mode app).
382
382
  */
383
383
  doorAnswer(instance: InstanceRef, grant: Grant, request?: Request,
384
384
  /** The page below a file set's base the frame opens at, as `issue`'s `at` (P125). */
@@ -38,8 +38,8 @@ export function shellPlan(config) {
38
38
  themeVariables: Object.keys(config.theme.variables),
39
39
  themeEvent: config.theme.event,
40
40
  themeDocuments: config.theme.documents ?? "declared",
41
- // An opaque origin has no storage: an opaque frame's, and a nested page's (P111).
42
- storage: config.isolation === "opaque" || config.nested === true ? "memory" : "native",
41
+ // An opaque origin has no storage.
42
+ storage: config.isolation === "opaque" ? "memory" : "native",
43
43
  maxErrorReports: config.limits.maxErrorReports,
44
44
  maxPromptChars: config.limits.maxPromptChars,
45
45
  maxCopyChars: MAX_COPY_CHARS,
@@ -271,8 +271,6 @@ export const SHELL_RUNTIME = String.raw `(() => {
271
271
  // takes the next load for that page, not for content that left). Anything else stays stopped:
272
272
  // another path of the origin, a file that isn't a page, another origin.
273
273
  let navigating = (_url) => {};
274
- // A nested page's files' address renewed by its shell (P111), which the shell's message gives.
275
- let adoptFiles = (_base) => false;
276
274
  let filesBase = plan.files && typeof plan.files.base === "string" ? plan.files.base : null;
277
275
  // Every address the page's files had (P083: a sealed one is renewed): what reports say as "./".
278
276
  const filesBases = filesBase === null ? [] : [filesBase];
@@ -1652,7 +1650,7 @@ export const SHELL_RUNTIME = String.raw `(() => {
1652
1650
  // modules keep the address they loaded from; the server serves their own loads till the session
1653
1651
  // ends.
1654
1652
  const replace = History.prototype.replaceState;
1655
- // The files' origin, read from the address itself: a nested page's own origin is opaque (P111).
1653
+ // The files' origin, read from the address itself.
1656
1654
  const filesOrigin = filesBase === null ? null : new NativeURL(filesBase).origin;
1657
1655
  // A renewed sealed address (P083): one segment under the same origin's sealed prefix, checked
1658
1656
  // through the platform's own functions (content may have replaced a prototype's, and the base
@@ -1672,7 +1670,6 @@ export const SHELL_RUNTIME = String.raw `(() => {
1672
1670
  filesBases.push(base);
1673
1671
  return true;
1674
1672
  };
1675
- adoptFiles = adopt;
1676
1673
  if (filesBase !== null && typeof plan.files.expires === "number") {
1677
1674
  const nativeFetch = window.fetch.bind(window);
1678
1675
  const renewIn = (expires) => Math.max(30000, expires - Date.now() - 300000);
@@ -2242,11 +2239,6 @@ export const SHELL_RUNTIME = String.raw `(() => {
2242
2239
  case "ui/notifications/tool-input":
2243
2240
  void render(params.arguments);
2244
2241
  break;
2245
- case "porthole/files-renewed":
2246
- // From the page's parent only (the listener's check): a nested page's shell renewed its
2247
- // files' sealed address, which this page can't (its loads aren't its origin's own, P111).
2248
- adoptFiles(params.base);
2249
- break;
2250
2242
  case "ui/notifications/host-context-changed":
2251
2243
  applyTheme(params);
2252
2244
  break;