@immediately-run/sdk 0.68.0 → 0.68.1

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.
@@ -44,11 +44,12 @@ const DEFAULT_MDX_COMPONENTS = {
44
44
  children,
45
45
  ...properties
46
46
  }) {
47
- const { corpusRoot } = (0, import_react.use)(import_linkSpace.LinkSpaceContext);
47
+ const space = (0, import_react.use)(import_linkSpace.LinkSpaceContext);
48
+ const bundleRoot = space.bundleRoot !== void 0 ? space.bundleRoot : space.corpusRoot ?? null;
48
49
  let mapped = href;
49
- if (href && (href.startsWith(import_linkSpace.FS_PREFIX) || corpusRoot !== null && href.startsWith("/"))) {
50
+ if (href && (href.startsWith(import_linkSpace.FS_PREFIX) || bundleRoot !== null && href.startsWith("/"))) {
50
51
  const [pathPart, frag] = (0, import_urlUtils.splitHash)(href);
51
- const resolution = (0, import_linkSpace.resolveLinkTarget)(pathPart, { corpusRoot });
52
+ const resolution = (0, import_linkSpace.resolveLinkTarget)(pathPart, { bundleRoot });
52
53
  if (resolution.state !== "resolved") {
53
54
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "ir-link-broken", "data-state": "broken", title: `Invalid ${import_linkSpace.FS_PREFIX} link: ${href}`, children });
54
55
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/components/MDXComponents.tsx"],"sourcesContent":["import { ReactNode, use } from 'react';\nimport { Admonition } from './Admonition';\nimport { FS_PREFIX, LinkSpaceContext, resolveLinkTarget } from '../linkSpace';\nimport { splitHash } from '../urlUtils';\nimport { HeadingAnchor } from './HeadingAnchor';\nimport { Link } from './Link';\nimport { WikiLink } from './WikiLink';\n\n// The link primitives moved to ./Link so WikiLink can reuse Link without a\n// MDXComponents ↔ WikiLink import cycle (check:circular). Re-exported here so the\n// public `Link` / `InternalLink` entry points are unchanged.\nexport { InternalLink, Link } from './Link';\nexport { Admonition } from './Admonition';\nexport type { AdmonitionType } from './Admonition';\nexport { HeadingAnchor } from './HeadingAnchor';\nexport { WikiLink } from './WikiLink';\n\n/** Default MDX component overrides passed to {@link MDXProvider} by `boot`. These\n * are the platform's *phantom defaults* (MARKDOWN_SYNTAX_SPEC §11.2): they are\n * always present in the provider — even for a plain-markdown repo that never\n * calls `boot({ mdxComponents })` — so the platform-emitted `Admonition` (§12)\n * and `WikiLink` (§13) components resolve without the MDX missing-reference guard\n * firing, and Markdown links route in-app via {@link Link}. An app overrides any\n * of them by name via `boot({ mdxComponents })`, which *merges* over these\n * defaults (§11.3) — overriding `WikiLink` alone still keeps `a` and `Admonition`. */\nexport const DEFAULT_MDX_COMPONENTS = {\n a({\n href,\n children,\n ...properties\n }: React.DetailedHTMLProps<React.AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>) {\n // R3-273 link spaces, same shared resolver as WikiLink: an `$fs:` href is\n // translated to its mount-absolute path; an ABSOLUTE href is corpus-rooted\n // when an enclosing LinkSpaceContext declares a corpusRoot (a non-corpus app\n // declares none and is untouched). Relative and external hrefs pass through —\n // <Link> already routes same-app hrefs and renders the rest as plain anchors.\n const { corpusRoot } = use(LinkSpaceContext);\n let mapped = href;\n if (href && (href.startsWith(FS_PREFIX) || (corpusRoot !== null && href.startsWith('/')))) {\n const [pathPart, frag] = splitHash(href);\n const resolution = resolveLinkTarget(pathPart, { corpusRoot });\n if (resolution.state !== 'resolved') {\n // Malformed `$fs:` (incl. scheme smuggling) — broken text, never an anchor.\n return (\n <span className=\"ir-link-broken\" data-state=\"broken\" title={`Invalid ${FS_PREFIX} link: ${href}`}>\n {children}\n </span>\n );\n }\n mapped = `${resolution.path}${frag ? `#${frag}` : ''}`;\n }\n return (\n <Link href={mapped} {...properties}>\n {children}\n </Link>\n );\n },\n Admonition,\n HeadingAnchor,\n WikiLink,\n} as Record<string, (props: any) => ReactNode>;\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA4CU;AA5CV,mBAA+B;AAC/B,wBAA2B;AAC3B,uBAA+D;AAC/D,sBAA0B;AAC1B,2BAA8B;AAC9B,kBAAqB;AACrB,sBAAyB;AAKzB,IAAAA,eAAmC;AACnC,IAAAC,qBAA2B;AAE3B,IAAAC,wBAA8B;AAC9B,IAAAC,mBAAyB;AAUlB,MAAM,yBAAyB;AAAA,EACpC,EAAE;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EACL,GAA8F;AAM5F,UAAM,EAAE,WAAW,QAAI,kBAAI,iCAAgB;AAC3C,QAAI,SAAS;AACb,QAAI,SAAS,KAAK,WAAW,0BAAS,KAAM,eAAe,QAAQ,KAAK,WAAW,GAAG,IAAK;AACzF,YAAM,CAAC,UAAU,IAAI,QAAI,2BAAU,IAAI;AACvC,YAAM,iBAAa,oCAAkB,UAAU,EAAE,WAAW,CAAC;AAC7D,UAAI,WAAW,UAAU,YAAY;AAEnC,eACE,4CAAC,UAAK,WAAU,kBAAiB,cAAW,UAAS,OAAO,WAAW,0BAAS,UAAU,IAAI,IAC3F,UACH;AAAA,MAEJ;AACA,eAAS,GAAG,WAAW,IAAI,GAAG,OAAO,IAAI,IAAI,KAAK,EAAE;AAAA,IACtD;AACA,WACE,4CAAC,oBAAK,MAAM,QAAS,GAAG,YACrB,UACH;AAAA,EAEJ;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;","names":["import_Link","import_Admonition","import_HeadingAnchor","import_WikiLink"]}
1
+ {"version":3,"sources":["../../src/components/MDXComponents.tsx"],"sourcesContent":["import { ReactNode, use } from 'react';\nimport { Admonition } from './Admonition';\nimport { FS_PREFIX, LinkSpaceContext, resolveLinkTarget } from '../linkSpace';\nimport { splitHash } from '../urlUtils';\nimport { HeadingAnchor } from './HeadingAnchor';\nimport { Link } from './Link';\nimport { WikiLink } from './WikiLink';\n\n// The link primitives moved to ./Link so WikiLink can reuse Link without a\n// MDXComponents ↔ WikiLink import cycle (check:circular). Re-exported here so the\n// public `Link` / `InternalLink` entry points are unchanged.\nexport { InternalLink, Link } from './Link';\nexport { Admonition } from './Admonition';\nexport type { AdmonitionType } from './Admonition';\nexport { HeadingAnchor } from './HeadingAnchor';\nexport { WikiLink } from './WikiLink';\n\n/** Default MDX component overrides passed to {@link MDXProvider} by `boot`. These\n * are the platform's *phantom defaults* (MARKDOWN_SYNTAX_SPEC §11.2): they are\n * always present in the provider — even for a plain-markdown repo that never\n * calls `boot({ mdxComponents })` — so the platform-emitted `Admonition` (§12)\n * and `WikiLink` (§13) components resolve without the MDX missing-reference guard\n * firing, and Markdown links route in-app via {@link Link}. An app overrides any\n * of them by name via `boot({ mdxComponents })`, which *merges* over these\n * defaults (§11.3) — overriding `WikiLink` alone still keeps `a` and `Admonition`. */\nexport const DEFAULT_MDX_COMPONENTS = {\n a({\n href,\n children,\n ...properties\n }: React.DetailedHTMLProps<React.AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>) {\n // R3-273 link spaces, same shared resolver as WikiLink: an `$fs:` href is\n // translated to its mount-absolute path; an ABSOLUTE href is bundle-rooted\n // when an enclosing LinkSpaceContext declares a bundleRoot (a non-bundle app\n // declares none and is untouched). Relative and external hrefs pass through —\n // <Link> already routes same-app hrefs and renders the rest as plain anchors.\n // R3-482: new-then-old root read — twin of WikiLink's, same presence rule as\n // mdx-plugins' statedBundleRoot (explicit `bundleRoot: null` is a VALUE).\n const space = use(LinkSpaceContext);\n const bundleRoot = space.bundleRoot !== undefined ? space.bundleRoot : space.corpusRoot ?? null;\n let mapped = href;\n if (href && (href.startsWith(FS_PREFIX) || (bundleRoot !== null && href.startsWith('/')))) {\n const [pathPart, frag] = splitHash(href);\n const resolution = resolveLinkTarget(pathPart, { bundleRoot });\n if (resolution.state !== 'resolved') {\n // Malformed `$fs:` (incl. scheme smuggling) — broken text, never an anchor.\n return (\n <span className=\"ir-link-broken\" data-state=\"broken\" title={`Invalid ${FS_PREFIX} link: ${href}`}>\n {children}\n </span>\n );\n }\n mapped = `${resolution.path}${frag ? `#${frag}` : ''}`;\n }\n return (\n <Link href={mapped} {...properties}>\n {children}\n </Link>\n );\n },\n Admonition,\n HeadingAnchor,\n WikiLink,\n} as Record<string, (props: any) => ReactNode>;\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA+CU;AA/CV,mBAA+B;AAC/B,wBAA2B;AAC3B,uBAA+D;AAC/D,sBAA0B;AAC1B,2BAA8B;AAC9B,kBAAqB;AACrB,sBAAyB;AAKzB,IAAAA,eAAmC;AACnC,IAAAC,qBAA2B;AAE3B,IAAAC,wBAA8B;AAC9B,IAAAC,mBAAyB;AAUlB,MAAM,yBAAyB;AAAA,EACpC,EAAE;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EACL,GAA8F;AAQ5F,UAAM,YAAQ,kBAAI,iCAAgB;AAClC,UAAM,aAAa,MAAM,eAAe,SAAY,MAAM,aAAa,MAAM,cAAc;AAC3F,QAAI,SAAS;AACb,QAAI,SAAS,KAAK,WAAW,0BAAS,KAAM,eAAe,QAAQ,KAAK,WAAW,GAAG,IAAK;AACzF,YAAM,CAAC,UAAU,IAAI,QAAI,2BAAU,IAAI;AACvC,YAAM,iBAAa,oCAAkB,UAAU,EAAE,WAAW,CAAC;AAC7D,UAAI,WAAW,UAAU,YAAY;AAEnC,eACE,4CAAC,UAAK,WAAU,kBAAiB,cAAW,UAAS,OAAO,WAAW,0BAAS,UAAU,IAAI,IAC3F,UACH;AAAA,MAEJ;AACA,eAAS,GAAG,WAAW,IAAI,GAAG,OAAO,IAAI,IAAI,KAAK,EAAE;AAAA,IACtD;AACA,WACE,4CAAC,oBAAK,MAAM,QAAS,GAAG,YACrB,UACH;AAAA,EAEJ;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;","names":["import_Link","import_Admonition","import_HeadingAnchor","import_WikiLink"]}
@@ -17,11 +17,12 @@ const DEFAULT_MDX_COMPONENTS = {
17
17
  children,
18
18
  ...properties
19
19
  }) {
20
- const { corpusRoot } = use(LinkSpaceContext);
20
+ const space = use(LinkSpaceContext);
21
+ const bundleRoot = space.bundleRoot !== void 0 ? space.bundleRoot : space.corpusRoot ?? null;
21
22
  let mapped = href;
22
- if (href && (href.startsWith(FS_PREFIX) || corpusRoot !== null && href.startsWith("/"))) {
23
+ if (href && (href.startsWith(FS_PREFIX) || bundleRoot !== null && href.startsWith("/"))) {
23
24
  const [pathPart, frag] = splitHash(href);
24
- const resolution = resolveLinkTarget(pathPart, { corpusRoot });
25
+ const resolution = resolveLinkTarget(pathPart, { bundleRoot });
25
26
  if (resolution.state !== "resolved") {
26
27
  return /* @__PURE__ */ jsx("span", { className: "ir-link-broken", "data-state": "broken", title: `Invalid ${FS_PREFIX} link: ${href}`, children });
27
28
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/components/MDXComponents.tsx"],"sourcesContent":["import { ReactNode, use } from 'react';\nimport { Admonition } from './Admonition';\nimport { FS_PREFIX, LinkSpaceContext, resolveLinkTarget } from '../linkSpace';\nimport { splitHash } from '../urlUtils';\nimport { HeadingAnchor } from './HeadingAnchor';\nimport { Link } from './Link';\nimport { WikiLink } from './WikiLink';\n\n// The link primitives moved to ./Link so WikiLink can reuse Link without a\n// MDXComponents ↔ WikiLink import cycle (check:circular). Re-exported here so the\n// public `Link` / `InternalLink` entry points are unchanged.\nexport { InternalLink, Link } from './Link';\nexport { Admonition } from './Admonition';\nexport type { AdmonitionType } from './Admonition';\nexport { HeadingAnchor } from './HeadingAnchor';\nexport { WikiLink } from './WikiLink';\n\n/** Default MDX component overrides passed to {@link MDXProvider} by `boot`. These\n * are the platform's *phantom defaults* (MARKDOWN_SYNTAX_SPEC §11.2): they are\n * always present in the provider — even for a plain-markdown repo that never\n * calls `boot({ mdxComponents })` — so the platform-emitted `Admonition` (§12)\n * and `WikiLink` (§13) components resolve without the MDX missing-reference guard\n * firing, and Markdown links route in-app via {@link Link}. An app overrides any\n * of them by name via `boot({ mdxComponents })`, which *merges* over these\n * defaults (§11.3) — overriding `WikiLink` alone still keeps `a` and `Admonition`. */\nexport const DEFAULT_MDX_COMPONENTS = {\n a({\n href,\n children,\n ...properties\n }: React.DetailedHTMLProps<React.AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>) {\n // R3-273 link spaces, same shared resolver as WikiLink: an `$fs:` href is\n // translated to its mount-absolute path; an ABSOLUTE href is corpus-rooted\n // when an enclosing LinkSpaceContext declares a corpusRoot (a non-corpus app\n // declares none and is untouched). Relative and external hrefs pass through —\n // <Link> already routes same-app hrefs and renders the rest as plain anchors.\n const { corpusRoot } = use(LinkSpaceContext);\n let mapped = href;\n if (href && (href.startsWith(FS_PREFIX) || (corpusRoot !== null && href.startsWith('/')))) {\n const [pathPart, frag] = splitHash(href);\n const resolution = resolveLinkTarget(pathPart, { corpusRoot });\n if (resolution.state !== 'resolved') {\n // Malformed `$fs:` (incl. scheme smuggling) — broken text, never an anchor.\n return (\n <span className=\"ir-link-broken\" data-state=\"broken\" title={`Invalid ${FS_PREFIX} link: ${href}`}>\n {children}\n </span>\n );\n }\n mapped = `${resolution.path}${frag ? `#${frag}` : ''}`;\n }\n return (\n <Link href={mapped} {...properties}>\n {children}\n </Link>\n );\n },\n Admonition,\n HeadingAnchor,\n WikiLink,\n} as Record<string, (props: any) => ReactNode>;\n"],"mappings":";AA4CU;AA5CV,SAAoB,WAAW;AAC/B,SAAS,kBAAkB;AAC3B,SAAS,WAAW,kBAAkB,yBAAyB;AAC/D,SAAS,iBAAiB;AAC1B,SAAS,qBAAqB;AAC9B,SAAS,YAAY;AACrB,SAAS,gBAAgB;AAKzB,SAAS,cAAc,QAAAA,aAAY;AACnC,SAAS,cAAAC,mBAAkB;AAE3B,SAAS,iBAAAC,sBAAqB;AAC9B,SAAS,YAAAC,iBAAgB;AAUlB,MAAM,yBAAyB;AAAA,EACpC,EAAE;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EACL,GAA8F;AAM5F,UAAM,EAAE,WAAW,IAAI,IAAI,gBAAgB;AAC3C,QAAI,SAAS;AACb,QAAI,SAAS,KAAK,WAAW,SAAS,KAAM,eAAe,QAAQ,KAAK,WAAW,GAAG,IAAK;AACzF,YAAM,CAAC,UAAU,IAAI,IAAI,UAAU,IAAI;AACvC,YAAM,aAAa,kBAAkB,UAAU,EAAE,WAAW,CAAC;AAC7D,UAAI,WAAW,UAAU,YAAY;AAEnC,eACE,oBAAC,UAAK,WAAU,kBAAiB,cAAW,UAAS,OAAO,WAAW,SAAS,UAAU,IAAI,IAC3F,UACH;AAAA,MAEJ;AACA,eAAS,GAAG,WAAW,IAAI,GAAG,OAAO,IAAI,IAAI,KAAK,EAAE;AAAA,IACtD;AACA,WACE,oBAAC,QAAK,MAAM,QAAS,GAAG,YACrB,UACH;AAAA,EAEJ;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;","names":["Link","Admonition","HeadingAnchor","WikiLink"]}
1
+ {"version":3,"sources":["../../src/components/MDXComponents.tsx"],"sourcesContent":["import { ReactNode, use } from 'react';\nimport { Admonition } from './Admonition';\nimport { FS_PREFIX, LinkSpaceContext, resolveLinkTarget } from '../linkSpace';\nimport { splitHash } from '../urlUtils';\nimport { HeadingAnchor } from './HeadingAnchor';\nimport { Link } from './Link';\nimport { WikiLink } from './WikiLink';\n\n// The link primitives moved to ./Link so WikiLink can reuse Link without a\n// MDXComponents ↔ WikiLink import cycle (check:circular). Re-exported here so the\n// public `Link` / `InternalLink` entry points are unchanged.\nexport { InternalLink, Link } from './Link';\nexport { Admonition } from './Admonition';\nexport type { AdmonitionType } from './Admonition';\nexport { HeadingAnchor } from './HeadingAnchor';\nexport { WikiLink } from './WikiLink';\n\n/** Default MDX component overrides passed to {@link MDXProvider} by `boot`. These\n * are the platform's *phantom defaults* (MARKDOWN_SYNTAX_SPEC §11.2): they are\n * always present in the provider — even for a plain-markdown repo that never\n * calls `boot({ mdxComponents })` — so the platform-emitted `Admonition` (§12)\n * and `WikiLink` (§13) components resolve without the MDX missing-reference guard\n * firing, and Markdown links route in-app via {@link Link}. An app overrides any\n * of them by name via `boot({ mdxComponents })`, which *merges* over these\n * defaults (§11.3) — overriding `WikiLink` alone still keeps `a` and `Admonition`. */\nexport const DEFAULT_MDX_COMPONENTS = {\n a({\n href,\n children,\n ...properties\n }: React.DetailedHTMLProps<React.AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>) {\n // R3-273 link spaces, same shared resolver as WikiLink: an `$fs:` href is\n // translated to its mount-absolute path; an ABSOLUTE href is bundle-rooted\n // when an enclosing LinkSpaceContext declares a bundleRoot (a non-bundle app\n // declares none and is untouched). Relative and external hrefs pass through —\n // <Link> already routes same-app hrefs and renders the rest as plain anchors.\n // R3-482: new-then-old root read — twin of WikiLink's, same presence rule as\n // mdx-plugins' statedBundleRoot (explicit `bundleRoot: null` is a VALUE).\n const space = use(LinkSpaceContext);\n const bundleRoot = space.bundleRoot !== undefined ? space.bundleRoot : space.corpusRoot ?? null;\n let mapped = href;\n if (href && (href.startsWith(FS_PREFIX) || (bundleRoot !== null && href.startsWith('/')))) {\n const [pathPart, frag] = splitHash(href);\n const resolution = resolveLinkTarget(pathPart, { bundleRoot });\n if (resolution.state !== 'resolved') {\n // Malformed `$fs:` (incl. scheme smuggling) — broken text, never an anchor.\n return (\n <span className=\"ir-link-broken\" data-state=\"broken\" title={`Invalid ${FS_PREFIX} link: ${href}`}>\n {children}\n </span>\n );\n }\n mapped = `${resolution.path}${frag ? `#${frag}` : ''}`;\n }\n return (\n <Link href={mapped} {...properties}>\n {children}\n </Link>\n );\n },\n Admonition,\n HeadingAnchor,\n WikiLink,\n} as Record<string, (props: any) => ReactNode>;\n"],"mappings":";AA+CU;AA/CV,SAAoB,WAAW;AAC/B,SAAS,kBAAkB;AAC3B,SAAS,WAAW,kBAAkB,yBAAyB;AAC/D,SAAS,iBAAiB;AAC1B,SAAS,qBAAqB;AAC9B,SAAS,YAAY;AACrB,SAAS,gBAAgB;AAKzB,SAAS,cAAc,QAAAA,aAAY;AACnC,SAAS,cAAAC,mBAAkB;AAE3B,SAAS,iBAAAC,sBAAqB;AAC9B,SAAS,YAAAC,iBAAgB;AAUlB,MAAM,yBAAyB;AAAA,EACpC,EAAE;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EACL,GAA8F;AAQ5F,UAAM,QAAQ,IAAI,gBAAgB;AAClC,UAAM,aAAa,MAAM,eAAe,SAAY,MAAM,aAAa,MAAM,cAAc;AAC3F,QAAI,SAAS;AACb,QAAI,SAAS,KAAK,WAAW,SAAS,KAAM,eAAe,QAAQ,KAAK,WAAW,GAAG,IAAK;AACzF,YAAM,CAAC,UAAU,IAAI,IAAI,UAAU,IAAI;AACvC,YAAM,aAAa,kBAAkB,UAAU,EAAE,WAAW,CAAC;AAC7D,UAAI,WAAW,UAAU,YAAY;AAEnC,eACE,oBAAC,UAAK,WAAU,kBAAiB,cAAW,UAAS,OAAO,WAAW,SAAS,UAAU,IAAI,IAC3F,UACH;AAAA,MAEJ;AACA,eAAS,GAAG,WAAW,IAAI,GAAG,OAAO,IAAI,IAAI,KAAK,EAAE;AAAA,IACtD;AACA,WACE,oBAAC,QAAK,MAAM,QAAS,GAAG,YACrB,UACH;AAAA,EAEJ;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;","names":["Link","Admonition","HeadingAnchor","WikiLink"]}
@@ -39,7 +39,8 @@ const WikiLink = ({
39
39
  ...rest
40
40
  }) => {
41
41
  const { filesMetadata } = (0, import_react.use)(import_TinkerableContext.TinkerableContext);
42
- const { corpusRoot } = (0, import_react.use)(import_linkSpace.LinkSpaceContext);
42
+ const space = (0, import_react.use)(import_linkSpace.LinkSpaceContext);
43
+ const bundleRoot = space.bundleRoot !== void 0 ? space.bundleRoot : space.corpusRoot ?? null;
43
44
  const renderContext = (0, import_react.use)(import_Include.RenderExportedComponentContext);
44
45
  const currentFile = renderContext?.evaluationContext?.evaluation?.module?.filepath;
45
46
  const rawTarget = target ?? "";
@@ -51,7 +52,7 @@ const WikiLink = ({
51
52
  if (pathPart === "" && frag) {
52
53
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Link.Link, { href: `#${frag}`, className: "ir-wikilink", "data-state": "anchor", ...rest, children: text });
53
54
  }
54
- const resolution = (0, import_linkSpace.resolveLinkTarget)(pathPart, { currentFile, corpusRoot });
55
+ const resolution = (0, import_linkSpace.resolveLinkTarget)(pathPart, { currentFile, bundleRoot });
55
56
  if (resolution.state === "invalid") {
56
57
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
57
58
  "span",
@@ -79,7 +80,7 @@ const WikiLink = ({
79
80
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "ir-wikilink ir-wikilink-broken", "data-state": "broken", title: `No file at ${resolved}`, ...rest, children: text });
80
81
  }
81
82
  }
82
- const translated = pathPart.startsWith(import_linkSpace.FS_PREFIX) || corpusRoot !== null && pathPart.startsWith("/");
83
+ const translated = pathPart.startsWith(import_linkSpace.FS_PREFIX) || bundleRoot !== null && pathPart.startsWith("/");
83
84
  const href = translated && resolved !== void 0 ? `${resolved}${frag ? `#${frag}` : ""}` : rawTarget;
84
85
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Link.Link, { href, className: "ir-wikilink", "data-state": "resolved", ...rest, children: text });
85
86
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/components/WikiLink.tsx"],"sourcesContent":["import { ReactNode, use } from 'react';\nimport { Link } from './Link';\nimport { RenderExportedComponentContext } from './Include';\nimport { TinkerableContext } from '../TinkerableContext';\nimport { splitHash } from '../urlUtils';\nimport { FS_PREFIX, LinkSpaceContext, resolveLinkTarget } from '../linkSpace';\n\n/** Derive a human label from a target path: basename without the extension. */\nconst labelFromTarget = (target: string): string => {\n const base = target.split(/[\\\\/]/).pop() ?? target;\n return base.replace(/\\.mdx?$/i, '') || target;\n};\n\n/**\n * Default MDX `WikiLink` component — the render target for the `[[target]]` /\n * `[[label|target]]` wiki-link syntax. The transpiler remark plugin (R3-153)\n * compiles that syntax to `<WikiLink target=\"…\" label=\"…\">`, carrying the raw\n * target/label verbatim; **resolution lives here** (MARKDOWN_SYNTAX_SPEC §13.2).\n *\n * Registered in {@link DEFAULT_MDX_COMPONENTS} so wiki-links render even in a\n * plain-markdown repo (§11.2 phantom defaults). Targets are **paths only** —\n * relative (resolved against the current file's directory) or absolute — with\n * **no implicit search path** (§13.3, a deliberate departure from Obsidian).\n *\n * The **current file** — the one the link is *authored in* — is read from the\n * ambient `<Include>` render context. Every MDX file renders through `<Include>`\n * (`FileRouter` renders even the top-level file that way), and Include publishes\n * the rendered module's `EvaluationContext` to its subtree via\n * {@link RenderExportedComponentContext}; the nearest one's\n * `evaluation.module.filepath` is this file's own `/app/…` path. Because that\n * context nests with each `<Include>`, a relative target inside an included\n * fragment resolves against the **fragment**, not the top-level page in the URL.\n *\n * A target may carry a `#fragment` (`[[FILE.mdx#sec-8-9]]`, `[[#sec-8-9]]`): the\n * fragment is **split off** ({@link splitHash}, §13.5) and existence is resolved on\n * the **fragment-stripped path**, so a section citation to an existing file resolves\n * (not \"broken\"). The fragment then rides to navigation, where the scroll-after-nav\n * effect ({@link useScrollAfterNavigation}) lands the reader on the section.\n *\n * The resolved path is checked for **existence** against the live metadata store\n * (keyed by absolute `/app/…` paths) for the states (§13.3, §13.5):\n * - **anchor** — a fragment with no path (`[[#sec-8-9]]`), or a fragment whose path is\n * the current file: a same-page {@link Link} that scrolls in place, no route change.\n * - **self** — the resolved path is the current file (no fragment): inert text, no link.\n * - **broken** — no file at the resolved path (and the store has loaded): rendered\n * as marked text, **not** a throw.\n * - **resolved** — routed through {@link Link} (in-app navigation for a same-app\n * href, a plain `<a>` otherwise), carrying any `#fragment`.\n *\n * The check is **optimistic until the metadata store loads** (an empty store never\n * flashes \"broken\"), and a relative target with no ambient render context (MDX\n * rendered outside `<Include>`) routes optimistically. Such an app overrides this\n * component (§11) for precise resolution.\n */\nexport const WikiLink = ({\n target,\n label,\n children,\n ...rest\n}: {\n target?: string;\n label?: ReactNode;\n children?: ReactNode;\n} & Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, 'href'>): ReactNode => {\n const { filesMetadata } = use(TinkerableContext);\n const { corpusRoot } = use(LinkSpaceContext);\n const renderContext = use(RenderExportedComponentContext);\n const currentFile = renderContext?.evaluationContext?.evaluation?.module?.filepath;\n\n const rawTarget = target ?? '';\n const [pathPart, frag] = splitHash(rawTarget);\n const text = children ?? label ?? (rawTarget ? labelFromTarget(pathPart || frag || rawTarget) : '');\n\n // Defensive: the kernel never emits an empty target, but a hand-written\n // `<WikiLink>` might. Render inert text rather than a link to nowhere.\n if (!rawTarget) {\n return (\n <span className=\"ir-wikilink\" {...rest}>\n {text}\n </span>\n );\n }\n\n // Same-page anchor: a fragment with no path (`[[#sec-8-9]]`). Scroll within the\n // current file — no route change (§13.5). <Link> intercepts a bare `#`-href.\n if (pathPart === '' && frag) {\n return (\n <Link href={`#${frag}`} className=\"ir-wikilink\" data-state=\"anchor\" {...rest}>\n {text}\n </Link>\n );\n }\n\n // R3-273 link spaces: resolution is the SHARED resolver (`linkSpace.ts`) —\n // default space (corpus-rooted absolute targets when an enclosing provider\n // declares a corpusRoot; fs-rooted otherwise) or the explicit `$fs:` prefix.\n // A malformed `$fs:` target renders BROKEN, never an anchor.\n const resolution = resolveLinkTarget(pathPart, { currentFile, corpusRoot });\n if (resolution.state === 'invalid') {\n return (\n <span\n className=\"ir-wikilink ir-wikilink-broken\"\n data-state=\"broken\"\n title={`Invalid ${FS_PREFIX} target: ${pathPart}`}\n {...rest}\n >\n {text}\n </span>\n );\n }\n const resolved = resolution.state === 'resolved' ? resolution.path : undefined;\n const files = filesMetadata ?? {};\n const loaded = Object.keys(files).length > 0;\n\n // `resolved === undefined` ⇒ a relative target with no known current file: route\n // it optimistically (can't check existence or self-ness generically).\n if (resolved !== undefined) {\n if (currentFile && resolved === currentFile) {\n // The target IS this file. With a fragment it is a same-page anchor to another\n // of this file's sections; without one it is an inert self-reference.\n if (frag) {\n return (\n <Link href={`#${frag}`} className=\"ir-wikilink\" data-state=\"anchor\" {...rest}>\n {text}\n </Link>\n );\n }\n return (\n <span className=\"ir-wikilink ir-wikilink-self\" data-state=\"self\" {...rest}>\n {text}\n </span>\n );\n }\n // Existence is checked on the FRAGMENT-STRIPPED path (optimistic until loaded).\n const exists = !loaded || resolved in files;\n if (!exists) {\n return (\n <span className=\"ir-wikilink ir-wikilink-broken\" data-state=\"broken\" title={`No file at ${resolved}`} {...rest}>\n {text}\n </span>\n );\n }\n }\n // Resolved cross-file target: route through <Link>. A space-translated target\n // (`$fs:` prefix, or a corpus-rooted absolute) navigates to the RESOLVED path —\n // the raw text is not a routable path in those shapes; everything else carries\n // the raw target bit-for-bit so its `#fragment` rides through navigation to the\n // scroll-after-nav effect (§13.5). The fragment is re-attached either way.\n const translated = pathPart.startsWith(FS_PREFIX) || (corpusRoot !== null && pathPart.startsWith('/'));\n const href = translated && resolved !== undefined ? `${resolved}${frag ? `#${frag}` : ''}` : rawTarget;\n return (\n <Link href={href} className=\"ir-wikilink\" data-state=\"resolved\" {...rest}>\n {text}\n </Link>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA6EM;AA7EN,mBAA+B;AAC/B,kBAAqB;AACrB,qBAA+C;AAC/C,+BAAkC;AAClC,sBAA0B;AAC1B,uBAA+D;AAG/D,MAAM,kBAAkB,CAAC,WAA2B;AAClD,QAAM,OAAO,OAAO,MAAM,OAAO,EAAE,IAAI,KAAK;AAC5C,SAAO,KAAK,QAAQ,YAAY,EAAE,KAAK;AACzC;AA2CO,MAAM,WAAW,CAAC;AAAA,EACvB;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,MAI+E;AAC7E,QAAM,EAAE,cAAc,QAAI,kBAAI,0CAAiB;AAC/C,QAAM,EAAE,WAAW,QAAI,kBAAI,iCAAgB;AA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IAAK,GAAG,MACvG,gBACH;AAAA,IAEJ;AAAA,EACF;AAMA,QAAM,aAAa,SAAS,WAAW,0BAAS,KAAM,eAAe,QAAQ,SAAS,WAAW,GAAG;AACpG,QAAM,OAAO,cAAc,aAAa,SAAY,GAAG,QAAQ,GAAG,OAAO,IAAI,IAAI,KAAK,EAAE,KAAK;AAC7F,SACE,4CAAC,oBAAK,MAAY,WAAU,eAAc,cAAW,YAAY,GAAG,MACjE,gBACH;AAEJ;","names":[]}
1
+ {"version":3,"sources":["../../src/components/WikiLink.tsx"],"sourcesContent":["import { ReactNode, use } from 'react';\nimport { Link } from './Link';\nimport { RenderExportedComponentContext } from './Include';\nimport { TinkerableContext } from '../TinkerableContext';\nimport { splitHash } from '../urlUtils';\nimport { FS_PREFIX, LinkSpaceContext, resolveLinkTarget } from '../linkSpace';\n\n/** Derive a human label from a target path: basename without the extension. */\nconst labelFromTarget = (target: string): string => {\n const base = target.split(/[\\\\/]/).pop() ?? target;\n return base.replace(/\\.mdx?$/i, '') || target;\n};\n\n/**\n * Default MDX `WikiLink` component — the render target for the `[[target]]` /\n * `[[label|target]]` wiki-link syntax. The transpiler remark plugin (R3-153)\n * compiles that syntax to `<WikiLink target=\"…\" label=\"…\">`, carrying the raw\n * target/label verbatim; **resolution lives here** (MARKDOWN_SYNTAX_SPEC §13.2).\n *\n * Registered in {@link DEFAULT_MDX_COMPONENTS} so wiki-links render even in a\n * plain-markdown repo (§11.2 phantom defaults). Targets are **paths only** —\n * relative (resolved against the current file's directory) or absolute — with\n * **no implicit search path** (§13.3, a deliberate departure from Obsidian).\n *\n * The **current file** — the one the link is *authored in* — is read from the\n * ambient `<Include>` render context. Every MDX file renders through `<Include>`\n * (`FileRouter` renders even the top-level file that way), and Include publishes\n * the rendered module's `EvaluationContext` to its subtree via\n * {@link RenderExportedComponentContext}; the nearest one's\n * `evaluation.module.filepath` is this file's own `/app/…` path. Because that\n * context nests with each `<Include>`, a relative target inside an included\n * fragment resolves against the **fragment**, not the top-level page in the URL.\n *\n * A target may carry a `#fragment` (`[[FILE.mdx#sec-8-9]]`, `[[#sec-8-9]]`): the\n * fragment is **split off** ({@link splitHash}, §13.5) and existence is resolved on\n * the **fragment-stripped path**, so a section citation to an existing file resolves\n * (not \"broken\"). The fragment then rides to navigation, where the scroll-after-nav\n * effect ({@link useScrollAfterNavigation}) lands the reader on the section.\n *\n * The resolved path is checked for **existence** against the live metadata store\n * (keyed by absolute `/app/…` paths) for the states (§13.3, §13.5):\n * - **anchor** — a fragment with no path (`[[#sec-8-9]]`), or a fragment whose path is\n * the current file: a same-page {@link Link} that scrolls in place, no route change.\n * - **self** — the resolved path is the current file (no fragment): inert text, no link.\n * - **broken** — no file at the resolved path (and the store has loaded): rendered\n * as marked text, **not** a throw.\n * - **resolved** — routed through {@link Link} (in-app navigation for a same-app\n * href, a plain `<a>` otherwise), carrying any `#fragment`.\n *\n * The check is **optimistic until the metadata store loads** (an empty store never\n * flashes \"broken\"), and a relative target with no ambient render context (MDX\n * rendered outside `<Include>`) routes optimistically. Such an app overrides this\n * component (§11) for precise resolution.\n */\nexport const WikiLink = ({\n target,\n label,\n children,\n ...rest\n}: {\n target?: string;\n label?: ReactNode;\n children?: ReactNode;\n} & Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, 'href'>): ReactNode => {\n const { filesMetadata } = use(TinkerableContext);\n // R3-482: the link-space root reads new-then-old — `bundleRoot` when the provider\n // states it at all (an explicit `null` is a VALUE: \"no bundle root\", NOT a miss),\n // the deprecated `corpusRoot` spelling only when `bundleRoot` is absent. The same\n // presence rule as mdx-plugins' statedBundleRoot; twin read in MDXComponents.tsx.\n const space = use(LinkSpaceContext);\n const bundleRoot = space.bundleRoot !== undefined ? space.bundleRoot : space.corpusRoot ?? null;\n const renderContext = use(RenderExportedComponentContext);\n const currentFile = renderContext?.evaluationContext?.evaluation?.module?.filepath;\n\n const rawTarget = target ?? '';\n const [pathPart, frag] = splitHash(rawTarget);\n const text = children ?? label ?? (rawTarget ? labelFromTarget(pathPart || frag || rawTarget) : '');\n\n // Defensive: the kernel never emits an empty target, but a hand-written\n // `<WikiLink>` might. Render inert text rather than a link to nowhere.\n if (!rawTarget) {\n return (\n <span className=\"ir-wikilink\" {...rest}>\n {text}\n </span>\n );\n }\n\n // Same-page anchor: a fragment with no path (`[[#sec-8-9]]`). Scroll within the\n // current file — no route change (§13.5). <Link> intercepts a bare `#`-href.\n if (pathPart === '' && frag) {\n return (\n <Link href={`#${frag}`} className=\"ir-wikilink\" data-state=\"anchor\" {...rest}>\n {text}\n </Link>\n );\n }\n\n // R3-273 link spaces: resolution is the SHARED resolver (`linkSpace.ts`) —\n // default space (bundle-rooted absolute targets when an enclosing provider\n // declares a bundleRoot; fs-rooted otherwise) or the explicit `$fs:` prefix.\n // A malformed `$fs:` target renders BROKEN, never an anchor.\n const resolution = resolveLinkTarget(pathPart, { currentFile, bundleRoot });\n if (resolution.state === 'invalid') {\n return (\n <span\n className=\"ir-wikilink ir-wikilink-broken\"\n data-state=\"broken\"\n title={`Invalid ${FS_PREFIX} target: ${pathPart}`}\n {...rest}\n >\n {text}\n </span>\n );\n }\n const resolved = resolution.state === 'resolved' ? resolution.path : undefined;\n const files = filesMetadata ?? {};\n const loaded = Object.keys(files).length > 0;\n\n // `resolved === undefined` ⇒ a relative target with no known current file: route\n // it optimistically (can't check existence or self-ness generically).\n if (resolved !== undefined) {\n if (currentFile && resolved === currentFile) {\n // The target IS this file. With a fragment it is a same-page anchor to another\n // of this file's sections; without one it is an inert self-reference.\n if (frag) {\n return (\n <Link href={`#${frag}`} className=\"ir-wikilink\" data-state=\"anchor\" {...rest}>\n {text}\n </Link>\n );\n }\n return (\n <span className=\"ir-wikilink ir-wikilink-self\" data-state=\"self\" {...rest}>\n {text}\n </span>\n );\n }\n // Existence is checked on the FRAGMENT-STRIPPED path (optimistic until loaded).\n const exists = !loaded || resolved in files;\n if (!exists) {\n return (\n <span className=\"ir-wikilink ir-wikilink-broken\" data-state=\"broken\" title={`No file at ${resolved}`} {...rest}>\n {text}\n </span>\n );\n }\n }\n // Resolved cross-file target: route through <Link>. A space-translated target\n // (`$fs:` prefix, or a bundle-rooted absolute) navigates to the RESOLVED path —\n // the raw text is not a routable path in those shapes; everything else carries\n // the raw target bit-for-bit so its `#fragment` rides through navigation to the\n // scroll-after-nav effect (§13.5). The fragment is re-attached either way.\n const translated = pathPart.startsWith(FS_PREFIX) || (bundleRoot !== null && pathPart.startsWith('/'));\n const href = translated && resolved !== undefined ? `${resolved}${frag ? `#${frag}` : ''}` : rawTarget;\n return (\n <Link href={href} className=\"ir-wikilink\" data-state=\"resolved\" {...rest}>\n {text}\n </Link>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAkFM;AAlFN,mBAA+B;AAC/B,kBAAqB;AACrB,qBAA+C;AAC/C,+BAAkC;AAClC,sBAA0B;AAC1B,uBAA+D;AAG/D,MAAM,kBAAkB,CAAC,WAA2B;AAClD,QAAM,OAAO,OAAO,MAAM,OAAO,EAAE,IAAI,KAAK;AAC5C,SAAO,KAAK,QAAQ,YAAY,EAAE,KAAK;AACzC;AA2CO,MAAM,WAAW,CAAC;AAAA,EACvB;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,MAI+E;AAC7E,QAAM,EAAE,cAAc,QAAI,kBAAI,0CAAiB;AAK/C,QAAM,YAAQ,kBAAI,iCAAgB;AAClC,QAAM,aAAa,MAAM,eAAe,SAAY,MAAM,aAAa,MAAM,cAAc;AAC3F,QAAM,oBAAgB,kBAAI,6CAA8B;AACxD,QAAM,cAAc,eAAe,mBAAmB,YAAY,QAAQ;AAE1E,QAAM,YAAY,UAAU;AAC5B,QAAM,CAAC,UAAU,IAAI,QAAI,2BAAU,SAAS;AAC5C,QAAM,OAAO,YAAY,UAAU,YAAY,gBAAgB,YAAY,QAAQ,SAAS,IAAI;AAIhG,MAAI,CAAC,WAAW;AACd,WACE,4CAAC,UAAK,WAAU,eAA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ACH;AAEJ;","names":[]}
@@ -17,7 +17,8 @@ const WikiLink = ({
17
17
  ...rest
18
18
  }) => {
19
19
  const { filesMetadata } = use(TinkerableContext);
20
- const { corpusRoot } = use(LinkSpaceContext);
20
+ const space = use(LinkSpaceContext);
21
+ const bundleRoot = space.bundleRoot !== void 0 ? space.bundleRoot : space.corpusRoot ?? null;
21
22
  const renderContext = use(RenderExportedComponentContext);
22
23
  const currentFile = renderContext?.evaluationContext?.evaluation?.module?.filepath;
23
24
  const rawTarget = target ?? "";
@@ -29,7 +30,7 @@ const WikiLink = ({
29
30
  if (pathPart === "" && frag) {
30
31
  return /* @__PURE__ */ jsx(Link, { href: `#${frag}`, className: "ir-wikilink", "data-state": "anchor", ...rest, children: text });
31
32
  }
32
- const resolution = resolveLinkTarget(pathPart, { currentFile, corpusRoot });
33
+ const resolution = resolveLinkTarget(pathPart, { currentFile, bundleRoot });
33
34
  if (resolution.state === "invalid") {
34
35
  return /* @__PURE__ */ jsx(
35
36
  "span",
@@ -57,7 +58,7 @@ const WikiLink = ({
57
58
  return /* @__PURE__ */ jsx("span", { className: "ir-wikilink ir-wikilink-broken", "data-state": "broken", title: `No file at ${resolved}`, ...rest, children: text });
58
59
  }
59
60
  }
60
- const translated = pathPart.startsWith(FS_PREFIX) || corpusRoot !== null && pathPart.startsWith("/");
61
+ const translated = pathPart.startsWith(FS_PREFIX) || bundleRoot !== null && pathPart.startsWith("/");
61
62
  const href = translated && resolved !== void 0 ? `${resolved}${frag ? `#${frag}` : ""}` : rawTarget;
62
63
  return /* @__PURE__ */ jsx(Link, { href, className: "ir-wikilink", "data-state": "resolved", ...rest, children: text });
63
64
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/components/WikiLink.tsx"],"sourcesContent":["import { ReactNode, use } from 'react';\nimport { Link } from './Link';\nimport { RenderExportedComponentContext } from './Include';\nimport { TinkerableContext } from '../TinkerableContext';\nimport { splitHash } from '../urlUtils';\nimport { FS_PREFIX, LinkSpaceContext, resolveLinkTarget } from '../linkSpace';\n\n/** Derive a human label from a target path: basename without the extension. */\nconst labelFromTarget = (target: string): string => {\n const base = target.split(/[\\\\/]/).pop() ?? target;\n return base.replace(/\\.mdx?$/i, '') || target;\n};\n\n/**\n * Default MDX `WikiLink` component — the render target for the `[[target]]` /\n * `[[label|target]]` wiki-link syntax. The transpiler remark plugin (R3-153)\n * compiles that syntax to `<WikiLink target=\"…\" label=\"…\">`, carrying the raw\n * target/label verbatim; **resolution lives here** (MARKDOWN_SYNTAX_SPEC §13.2).\n *\n * Registered in {@link DEFAULT_MDX_COMPONENTS} so wiki-links render even in a\n * plain-markdown repo (§11.2 phantom defaults). Targets are **paths only** —\n * relative (resolved against the current file's directory) or absolute — with\n * **no implicit search path** (§13.3, a deliberate departure from Obsidian).\n *\n * The **current file** — the one the link is *authored in* — is read from the\n * ambient `<Include>` render context. Every MDX file renders through `<Include>`\n * (`FileRouter` renders even the top-level file that way), and Include publishes\n * the rendered module's `EvaluationContext` to its subtree via\n * {@link RenderExportedComponentContext}; the nearest one's\n * `evaluation.module.filepath` is this file's own `/app/…` path. Because that\n * context nests with each `<Include>`, a relative target inside an included\n * fragment resolves against the **fragment**, not the top-level page in the URL.\n *\n * A target may carry a `#fragment` (`[[FILE.mdx#sec-8-9]]`, `[[#sec-8-9]]`): the\n * fragment is **split off** ({@link splitHash}, §13.5) and existence is resolved on\n * the **fragment-stripped path**, so a section citation to an existing file resolves\n * (not \"broken\"). The fragment then rides to navigation, where the scroll-after-nav\n * effect ({@link useScrollAfterNavigation}) lands the reader on the section.\n *\n * The resolved path is checked for **existence** against the live metadata store\n * (keyed by absolute `/app/…` paths) for the states (§13.3, §13.5):\n * - **anchor** — a fragment with no path (`[[#sec-8-9]]`), or a fragment whose path is\n * the current file: a same-page {@link Link} that scrolls in place, no route change.\n * - **self** — the resolved path is the current file (no fragment): inert text, no link.\n * - **broken** — no file at the resolved path (and the store has loaded): rendered\n * as marked text, **not** a throw.\n * - **resolved** — routed through {@link Link} (in-app navigation for a same-app\n * href, a plain `<a>` otherwise), carrying any `#fragment`.\n *\n * The check is **optimistic until the metadata store loads** (an empty store never\n * flashes \"broken\"), and a relative target with no ambient render context (MDX\n * rendered outside `<Include>`) routes optimistically. Such an app overrides this\n * component (§11) for precise resolution.\n */\nexport const WikiLink = ({\n target,\n label,\n children,\n ...rest\n}: {\n target?: string;\n label?: ReactNode;\n children?: ReactNode;\n} & Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, 'href'>): ReactNode => {\n const { filesMetadata } = use(TinkerableContext);\n const { corpusRoot } = use(LinkSpaceContext);\n const renderContext = use(RenderExportedComponentContext);\n const currentFile = renderContext?.evaluationContext?.evaluation?.module?.filepath;\n\n const rawTarget = target ?? '';\n const [pathPart, frag] = splitHash(rawTarget);\n const text = children ?? label ?? (rawTarget ? labelFromTarget(pathPart || frag || rawTarget) : '');\n\n // Defensive: the kernel never emits an empty target, but a hand-written\n // `<WikiLink>` might. Render inert text rather than a link to nowhere.\n if (!rawTarget) {\n return (\n <span className=\"ir-wikilink\" {...rest}>\n {text}\n </span>\n );\n }\n\n // Same-page anchor: a fragment with no path (`[[#sec-8-9]]`). Scroll within the\n // current file — no route change (§13.5). <Link> intercepts a bare `#`-href.\n if (pathPart === '' && frag) {\n return (\n <Link href={`#${frag}`} className=\"ir-wikilink\" data-state=\"anchor\" {...rest}>\n {text}\n </Link>\n );\n }\n\n // R3-273 link spaces: resolution is the SHARED resolver (`linkSpace.ts`) —\n // default space (corpus-rooted absolute targets when an enclosing provider\n // declares a corpusRoot; fs-rooted otherwise) or the explicit `$fs:` prefix.\n // A malformed `$fs:` target renders BROKEN, never an anchor.\n const resolution = resolveLinkTarget(pathPart, { currentFile, corpusRoot });\n if (resolution.state === 'invalid') {\n return (\n <span\n className=\"ir-wikilink ir-wikilink-broken\"\n data-state=\"broken\"\n title={`Invalid ${FS_PREFIX} target: ${pathPart}`}\n {...rest}\n >\n {text}\n </span>\n );\n }\n const resolved = resolution.state === 'resolved' ? resolution.path : undefined;\n const files = filesMetadata ?? {};\n const loaded = Object.keys(files).length > 0;\n\n // `resolved === undefined` ⇒ a relative target with no known current file: route\n // it optimistically (can't check existence or self-ness generically).\n if (resolved !== undefined) {\n if (currentFile && resolved === currentFile) {\n // The target IS this file. With a fragment it is a same-page anchor to another\n // of this file's sections; without one it is an inert self-reference.\n if (frag) {\n return (\n <Link href={`#${frag}`} className=\"ir-wikilink\" data-state=\"anchor\" {...rest}>\n {text}\n </Link>\n );\n }\n return (\n <span className=\"ir-wikilink ir-wikilink-self\" data-state=\"self\" {...rest}>\n {text}\n </span>\n );\n }\n // Existence is checked on the FRAGMENT-STRIPPED path (optimistic until loaded).\n const exists = !loaded || resolved in files;\n if (!exists) {\n return (\n <span className=\"ir-wikilink ir-wikilink-broken\" data-state=\"broken\" title={`No file at ${resolved}`} {...rest}>\n {text}\n </span>\n );\n }\n }\n // Resolved cross-file target: route through <Link>. A space-translated target\n // (`$fs:` prefix, or a corpus-rooted absolute) navigates to the RESOLVED path —\n // the raw text is not a routable path in those shapes; everything else carries\n // the raw target bit-for-bit so its `#fragment` rides through navigation to the\n // scroll-after-nav effect (§13.5). The fragment is re-attached either way.\n const translated = pathPart.startsWith(FS_PREFIX) || (corpusRoot !== null && pathPart.startsWith('/'));\n const href = translated && resolved !== undefined ? `${resolved}${frag ? `#${frag}` : ''}` : rawTarget;\n return (\n <Link href={href} className=\"ir-wikilink\" data-state=\"resolved\" {...rest}>\n {text}\n </Link>\n );\n};\n"],"mappings":";AA6EM;AA7EN,SAAoB,WAAW;AAC/B,SAAS,YAAY;AACrB,SAAS,sCAAsC;AAC/C,SAAS,yBAAyB;AAClC,SAAS,iBAAiB;AAC1B,SAAS,WAAW,kBAAkB,yBAAyB;AAG/D,MAAM,kBAAkB,CAAC,WAA2B;AAClD,QAAM,OAAO,OAAO,MAAM,OAAO,EAAE,IAAI,KAAK;AAC5C,SAAO,KAAK,QAAQ,YAAY,EAAE,KAAK;AACzC;AA2CO,MAAM,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GAAG,MAClE,gBACH;AAAA,IAEJ;AAEA,UAAM,SAAS,CAAC,UAAU,YAAY;AACtC,QAAI,CAAC,QAAQ;AACX,aACE,oBAAC,UAAK,WAAU,kCAAiC,cAAW,UAAS,OAAO,cAAc,QAAQ,IAAK,GAAG,MACvG,gBACH;AAAA,IAEJ;AAAA,EACF;AAMA,QAAM,aAAa,SAAS,WAAW,SAAS,KAAM,eAAe,QAAQ,SAAS,WAAW,GAAG;AACpG,QAAM,OAAO,cAAc,aAAa,SAAY,GAAG,QAAQ,GAAG,OAAO,IAAI,IAAI,KAAK,EAAE,KAAK;AAC7F,SACE,oBAAC,QAAK,MAAY,WAAU,eAAc,cAAW,YAAY,GAAG,MACjE,gBACH;AAEJ;","names":[]}
1
+ {"version":3,"sources":["../../src/components/WikiLink.tsx"],"sourcesContent":["import { ReactNode, use } from 'react';\nimport { Link } from './Link';\nimport { RenderExportedComponentContext } from './Include';\nimport { TinkerableContext } from '../TinkerableContext';\nimport { splitHash } from '../urlUtils';\nimport { FS_PREFIX, LinkSpaceContext, resolveLinkTarget } from '../linkSpace';\n\n/** Derive a human label from a target path: basename without the extension. */\nconst labelFromTarget = (target: string): string => {\n const base = target.split(/[\\\\/]/).pop() ?? target;\n return base.replace(/\\.mdx?$/i, '') || target;\n};\n\n/**\n * Default MDX `WikiLink` component — the render target for the `[[target]]` /\n * `[[label|target]]` wiki-link syntax. The transpiler remark plugin (R3-153)\n * compiles that syntax to `<WikiLink target=\"…\" label=\"…\">`, carrying the raw\n * target/label verbatim; **resolution lives here** (MARKDOWN_SYNTAX_SPEC §13.2).\n *\n * Registered in {@link DEFAULT_MDX_COMPONENTS} so wiki-links render even in a\n * plain-markdown repo (§11.2 phantom defaults). Targets are **paths only** —\n * relative (resolved against the current file's directory) or absolute — with\n * **no implicit search path** (§13.3, a deliberate departure from Obsidian).\n *\n * The **current file** — the one the link is *authored in* — is read from the\n * ambient `<Include>` render context. Every MDX file renders through `<Include>`\n * (`FileRouter` renders even the top-level file that way), and Include publishes\n * the rendered module's `EvaluationContext` to its subtree via\n * {@link RenderExportedComponentContext}; the nearest one's\n * `evaluation.module.filepath` is this file's own `/app/…` path. Because that\n * context nests with each `<Include>`, a relative target inside an included\n * fragment resolves against the **fragment**, not the top-level page in the URL.\n *\n * A target may carry a `#fragment` (`[[FILE.mdx#sec-8-9]]`, `[[#sec-8-9]]`): the\n * fragment is **split off** ({@link splitHash}, §13.5) and existence is resolved on\n * the **fragment-stripped path**, so a section citation to an existing file resolves\n * (not \"broken\"). The fragment then rides to navigation, where the scroll-after-nav\n * effect ({@link useScrollAfterNavigation}) lands the reader on the section.\n *\n * The resolved path is checked for **existence** against the live metadata store\n * (keyed by absolute `/app/…` paths) for the states (§13.3, §13.5):\n * - **anchor** — a fragment with no path (`[[#sec-8-9]]`), or a fragment whose path is\n * the current file: a same-page {@link Link} that scrolls in place, no route change.\n * - **self** — the resolved path is the current file (no fragment): inert text, no link.\n * - **broken** — no file at the resolved path (and the store has loaded): rendered\n * as marked text, **not** a throw.\n * - **resolved** — routed through {@link Link} (in-app navigation for a same-app\n * href, a plain `<a>` otherwise), carrying any `#fragment`.\n *\n * The check is **optimistic until the metadata store loads** (an empty store never\n * flashes \"broken\"), and a relative target with no ambient render context (MDX\n * rendered outside `<Include>`) routes optimistically. Such an app overrides this\n * component (§11) for precise resolution.\n */\nexport const WikiLink = ({\n target,\n label,\n children,\n ...rest\n}: {\n target?: string;\n label?: ReactNode;\n children?: ReactNode;\n} & Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, 'href'>): ReactNode => {\n const { filesMetadata } = use(TinkerableContext);\n // R3-482: the link-space root reads new-then-old — `bundleRoot` when the provider\n // states it at all (an explicit `null` is a VALUE: \"no bundle root\", NOT a miss),\n // the deprecated `corpusRoot` spelling only when `bundleRoot` is absent. The same\n // presence rule as mdx-plugins' statedBundleRoot; twin read in MDXComponents.tsx.\n const space = use(LinkSpaceContext);\n const bundleRoot = space.bundleRoot !== undefined ? space.bundleRoot : space.corpusRoot ?? null;\n const renderContext = use(RenderExportedComponentContext);\n const currentFile = renderContext?.evaluationContext?.evaluation?.module?.filepath;\n\n const rawTarget = target ?? '';\n const [pathPart, frag] = splitHash(rawTarget);\n const text = children ?? label ?? (rawTarget ? labelFromTarget(pathPart || frag || rawTarget) : '');\n\n // Defensive: the kernel never emits an empty target, but a hand-written\n // `<WikiLink>` might. Render inert text rather than a link to nowhere.\n if (!rawTarget) {\n return (\n <span className=\"ir-wikilink\" {...rest}>\n {text}\n </span>\n );\n }\n\n // Same-page anchor: a fragment with no path (`[[#sec-8-9]]`). Scroll within the\n // current file — no route change (§13.5). <Link> intercepts a bare `#`-href.\n if (pathPart === '' && frag) {\n return (\n <Link href={`#${frag}`} className=\"ir-wikilink\" data-state=\"anchor\" {...rest}>\n {text}\n </Link>\n );\n }\n\n // R3-273 link spaces: resolution is the SHARED resolver (`linkSpace.ts`) —\n // default space (bundle-rooted absolute targets when an enclosing provider\n // declares a bundleRoot; fs-rooted otherwise) or the explicit `$fs:` prefix.\n // A malformed `$fs:` target renders BROKEN, never an anchor.\n const resolution = resolveLinkTarget(pathPart, { currentFile, bundleRoot });\n if (resolution.state === 'invalid') {\n return (\n <span\n className=\"ir-wikilink ir-wikilink-broken\"\n data-state=\"broken\"\n title={`Invalid ${FS_PREFIX} target: ${pathPart}`}\n {...rest}\n >\n {text}\n </span>\n );\n }\n const resolved = resolution.state === 'resolved' ? resolution.path : undefined;\n const files = filesMetadata ?? {};\n const loaded = Object.keys(files).length > 0;\n\n // `resolved === undefined` ⇒ a relative target with no known current file: route\n // it optimistically (can't check existence or self-ness generically).\n if (resolved !== undefined) {\n if (currentFile && resolved === currentFile) {\n // The target IS this file. With a fragment it is a same-page anchor to another\n // of this file's sections; without one it is an inert self-reference.\n if (frag) {\n return (\n <Link href={`#${frag}`} className=\"ir-wikilink\" data-state=\"anchor\" {...rest}>\n {text}\n </Link>\n );\n }\n return (\n <span className=\"ir-wikilink ir-wikilink-self\" data-state=\"self\" {...rest}>\n {text}\n </span>\n );\n }\n // Existence is checked on the FRAGMENT-STRIPPED path (optimistic until loaded).\n const exists = !loaded || resolved in files;\n if (!exists) {\n return (\n <span className=\"ir-wikilink ir-wikilink-broken\" data-state=\"broken\" title={`No file at ${resolved}`} {...rest}>\n {text}\n </span>\n );\n }\n }\n // Resolved cross-file target: route through <Link>. A space-translated target\n // (`$fs:` prefix, or a bundle-rooted absolute) navigates to the RESOLVED path —\n // the raw text is not a routable path in those shapes; everything else carries\n // the raw target bit-for-bit so its `#fragment` rides through navigation to the\n // scroll-after-nav effect (§13.5). The fragment is re-attached either way.\n const translated = pathPart.startsWith(FS_PREFIX) || (bundleRoot !== null && pathPart.startsWith('/'));\n const href = translated && resolved !== undefined ? `${resolved}${frag ? `#${frag}` : ''}` : rawTarget;\n return (\n <Link href={href} className=\"ir-wikilink\" data-state=\"resolved\" {...rest}>\n {text}\n </Link>\n );\n};\n"],"mappings":";AAkFM;AAlFN,SAAoB,WAAW;AAC/B,SAAS,YAAY;AACrB,SAAS,sCAAsC;AAC/C,SAAS,yBAAyB;AAClC,SAAS,iBAAiB;AAC1B,SAAS,WAAW,kBAAkB,yBAAyB;AAG/D,MAAM,kBAAkB,CAAC,WAA2B;AAClD,QAAM,OAAO,OAAO,MAAM,OAAO,EAAE,IAAI,KAAK;AAC5C,SAAO,KAAK,QAAQ,YAAY,EAAE,KAAK;AACzC;AA2CO,MAAM,WAAW,CAAC;AAAA,EACvB;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,MAI+E;AAC7E,QAAM,EAAE,cAAc,IAAI,IAAI,iBAAiB;AAK/C,QAAM,QAAQ,IAAI,gBAAgB;AAClC,QAAM,aAAa,MAAM,eAAe,SAAY,MAAM,aAAa,MAAM,cAAc;AAC3F,QAAM,gBAAgB,IAAI,8BAA8B;AACxD,QAAM,cAAc,eAAe,mBAAmB,YAAY,QAAQ;AAE1E,QAAM,YAAY,UAAU;AAC5B,QAAM,CAAC,UAAU,IA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cAAc,aAAa,SAAY,GAAG,QAAQ,GAAG,OAAO,IAAI,IAAI,KAAK,EAAE,KAAK;AAC7F,SACE,oBAAC,QAAK,MAAY,WAAU,eAAc,cAAW,YAAY,GAAG,MACjE,gBACH;AAEJ;","names":[]}
@@ -27,7 +27,7 @@ module.exports = __toCommonJS(linkSpace_exports);
27
27
  var import_react = require("react");
28
28
  var import_mdx_plugins = require("@immediately-run/mdx-plugins");
29
29
  const LinkSpaceContext = (0, import_react.createContext)({
30
- corpusRoot: null,
30
+ bundleRoot: null,
31
31
  bundleChrooted: false
32
32
  });
33
33
  // Annotate the CommonJS export names for ESM import in node:
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/linkSpace.ts"],"sourcesContent":["// Link path spaces (R3-273; REPO_CONTENT_DISPATCH_SPEC §9 decision, 2026-08-17).\n// R3-279: the RESOLVER CORE (resolveLinkTarget / normalizeAbsolute / FS_PREFIX /\n// ResolvedLinkTarget) moved to `@immediately-run/mdx-plugins` — beside its parity\n// fixture — and is re-exported here unchanged (API-stable). This module keeps the\n// REACT surface (LinkSpaceContext): the provider a corpus-rendering app wraps its\n// document tree in. Consumers importing from '@immediately-run/sdk/linkSpace' see\n// exactly the same names.\n//\n// A document link's target resolves in one of two spaces:\n//\n// - DEFAULT — the enclosing corpus's virtual filesystem. RELATIVE targets resolve\n// against the authoring file (identical in both spaces); ABSOLUTE targets\n// (`/x/y.mdx`) resolve from the corpus root when an enclosing `LinkSpaceContext`\n// declares one, else from the filesystem root. A non-corpus app declares nothing\n// and keeps today's behavior bit-for-bit (its fs root IS its only root).\n//\n// - `$fs:` — the explicit filesystem space: `$fs:/content/x.mdx` resolves from the\n// root of the filesystem the app reads, escaping corpus-relative addressing.\n//\n// `$fs:` changes ADDRESSING, never REACH: resolution is pure path arithmetic and\n// existence is checked against the same in-mount metadata the default space uses —\n// nothing is fetched, and a link can never name what the app cannot already read.\n// A malformed `$fs:` target (anything not mount-absolute — which also catches\n// scheme smuggling like `$fs:javascript:…`) is INVALID and must render as a broken\n// link, never an anchor.\n//\n// Corpus nesting: `LinkSpaceContext` providers nest, and the NEAREST one wins —\n// which is exactly the innermost-enclosing-corpus rule (bundle encapsulation): a\n// document rendered inside a nested corpus resolves against the nested corpus.\n\nimport { createContext } from 'react';\n\nexport { FS_PREFIX, normalizeAbsolute, resolveLinkTarget } from '@immediately-run/mdx-plugins';\nexport type { ResolvedLinkTarget, LinkSpace } from '@immediately-run/mdx-plugins';\nimport type { LinkSpace as LinkSpaceShape } from '@immediately-run/mdx-plugins';\n\n/** Ambient link space. A corpus-rendering app wraps its document tree in\n * `<LinkSpaceContext value={{ corpusRoot }}>`; nesting a second provider inside a\n * rendered sub-corpus makes the innermost root win. */\nexport const LinkSpaceContext = createContext<LinkSpaceShape>({\n corpusRoot: null,\n bundleChrooted: false,\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA8BA,mBAA8B;AAE9B,yBAAgE;AAOzD,MAAM,uBAAmB,4BAA8B;AAAA,EAC5D,YAAY;AAAA,EACZ,gBAAgB;AAClB,CAAC;","names":[]}
1
+ {"version":3,"sources":["../src/linkSpace.ts"],"sourcesContent":["// Link path spaces (R3-273; REPO_CONTENT_DISPATCH_SPEC §9 decision, 2026-08-17).\n// R3-279: the RESOLVER CORE (resolveLinkTarget / normalizeAbsolute / FS_PREFIX /\n// ResolvedLinkTarget) moved to `@immediately-run/mdx-plugins` — beside its parity\n// fixture — and is re-exported here unchanged (API-stable). This module keeps the\n// REACT surface (LinkSpaceContext): the provider a bundle-rendering app wraps its\n// document tree in. Consumers importing from '@immediately-run/sdk/linkSpace' see\n// exactly the same names.\n//\n// A document link's target resolves in one of two spaces:\n//\n// - DEFAULT — the enclosing bundle's virtual filesystem. RELATIVE targets resolve\n// against the authoring file (identical in both spaces); ABSOLUTE targets\n// (`/x/y.mdx`) resolve from the bundle root when an enclosing `LinkSpaceContext`\n// declares one, else from the filesystem root. A non-bundle app declares nothing\n// and keeps today's behavior bit-for-bit (its fs root IS its only root).\n//\n// - `$fs:` — the explicit filesystem space: `$fs:/content/x.mdx` resolves from the\n// root of the filesystem the app reads, escaping bundle-relative addressing.\n//\n// `$fs:` changes ADDRESSING, never REACH: resolution is pure path arithmetic and\n// existence is checked against the same in-mount metadata the default space uses —\n// nothing is fetched, and a link can never name what the app cannot already read.\n// A malformed `$fs:` target (anything not mount-absolute — which also catches\n// scheme smuggling like `$fs:javascript:…`) is INVALID and must render as a broken\n// link, never an anchor.\n//\n// Bundle nesting: `LinkSpaceContext` providers nest, and the NEAREST one wins —\n// which is exactly the innermost-enclosing-bundle rule (bundle encapsulation): a\n// document rendered inside a nested bundle resolves against the nested bundle.\n\nimport { createContext } from 'react';\n\nexport { FS_PREFIX, normalizeAbsolute, resolveLinkTarget } from '@immediately-run/mdx-plugins';\nexport type { ResolvedLinkTarget, LinkSpace } from '@immediately-run/mdx-plugins';\nimport type { LinkSpace as LinkSpaceShape } from '@immediately-run/mdx-plugins';\n\n/** Ambient link space. A bundle-rendering app wraps its document tree in\n * `<LinkSpaceContext value={{ bundleRoot }}>`; nesting a second provider inside a\n * rendered sub-bundle makes the innermost root win.\n *\n * R3-482: the root's canonical spelling is `bundleRoot`; the deprecated\n * `corpusRoot` field stays in the `LinkSpace` type (mdx-plugins §forever-compat)\n * and is read as the fallback — only when `bundleRoot` is ABSENT, since an\n * explicit `bundleRoot: null` is a value (\"no bundle root\"), not a miss. */\nexport const LinkSpaceContext = createContext<LinkSpaceShape>({\n bundleRoot: null,\n bundleChrooted: false,\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA8BA,mBAA8B;AAE9B,yBAAgE;AAYzD,MAAM,uBAAmB,4BAA8B;AAAA,EAC5D,YAAY;AAAA,EACZ,gBAAgB;AAClB,CAAC;","names":[]}
@@ -2,9 +2,14 @@ import * as react from 'react';
2
2
  import { LinkSpace } from '@immediately-run/mdx-plugins';
3
3
  export { FS_PREFIX, LinkSpace, ResolvedLinkTarget, normalizeAbsolute, resolveLinkTarget } from '@immediately-run/mdx-plugins';
4
4
 
5
- /** Ambient link space. A corpus-rendering app wraps its document tree in
6
- * `<LinkSpaceContext value={{ corpusRoot }}>`; nesting a second provider inside a
7
- * rendered sub-corpus makes the innermost root win. */
5
+ /** Ambient link space. A bundle-rendering app wraps its document tree in
6
+ * `<LinkSpaceContext value={{ bundleRoot }}>`; nesting a second provider inside a
7
+ * rendered sub-bundle makes the innermost root win.
8
+ *
9
+ * R3-482: the root's canonical spelling is `bundleRoot`; the deprecated
10
+ * `corpusRoot` field stays in the `LinkSpace` type (mdx-plugins §forever-compat)
11
+ * and is read as the fallback — only when `bundleRoot` is ABSENT, since an
12
+ * explicit `bundleRoot: null` is a value ("no bundle root"), not a miss. */
8
13
  declare const LinkSpaceContext: react.Context<LinkSpace>;
9
14
 
10
15
  export { LinkSpaceContext };
@@ -2,9 +2,14 @@ import * as react from 'react';
2
2
  import { LinkSpace } from '@immediately-run/mdx-plugins';
3
3
  export { FS_PREFIX, LinkSpace, ResolvedLinkTarget, normalizeAbsolute, resolveLinkTarget } from '@immediately-run/mdx-plugins';
4
4
 
5
- /** Ambient link space. A corpus-rendering app wraps its document tree in
6
- * `<LinkSpaceContext value={{ corpusRoot }}>`; nesting a second provider inside a
7
- * rendered sub-corpus makes the innermost root win. */
5
+ /** Ambient link space. A bundle-rendering app wraps its document tree in
6
+ * `<LinkSpaceContext value={{ bundleRoot }}>`; nesting a second provider inside a
7
+ * rendered sub-bundle makes the innermost root win.
8
+ *
9
+ * R3-482: the root's canonical spelling is `bundleRoot`; the deprecated
10
+ * `corpusRoot` field stays in the `LinkSpace` type (mdx-plugins §forever-compat)
11
+ * and is read as the fallback — only when `bundleRoot` is ABSENT, since an
12
+ * explicit `bundleRoot: null` is a value ("no bundle root"), not a miss. */
8
13
  declare const LinkSpaceContext: react.Context<LinkSpace>;
9
14
 
10
15
  export { LinkSpaceContext };
package/dist/linkSpace.js CHANGED
@@ -2,7 +2,7 @@ import "./chunk-VHAA22YE.js";
2
2
  import { createContext } from "react";
3
3
  import { FS_PREFIX, normalizeAbsolute, resolveLinkTarget } from "@immediately-run/mdx-plugins";
4
4
  const LinkSpaceContext = createContext({
5
- corpusRoot: null,
5
+ bundleRoot: null,
6
6
  bundleChrooted: false
7
7
  });
8
8
  export {
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/linkSpace.ts"],"sourcesContent":["// Link path spaces (R3-273; REPO_CONTENT_DISPATCH_SPEC §9 decision, 2026-08-17).\n// R3-279: the RESOLVER CORE (resolveLinkTarget / normalizeAbsolute / FS_PREFIX /\n// ResolvedLinkTarget) moved to `@immediately-run/mdx-plugins` — beside its parity\n// fixture — and is re-exported here unchanged (API-stable). This module keeps the\n// REACT surface (LinkSpaceContext): the provider a corpus-rendering app wraps its\n// document tree in. Consumers importing from '@immediately-run/sdk/linkSpace' see\n// exactly the same names.\n//\n// A document link's target resolves in one of two spaces:\n//\n// - DEFAULT — the enclosing corpus's virtual filesystem. RELATIVE targets resolve\n// against the authoring file (identical in both spaces); ABSOLUTE targets\n// (`/x/y.mdx`) resolve from the corpus root when an enclosing `LinkSpaceContext`\n// declares one, else from the filesystem root. A non-corpus app declares nothing\n// and keeps today's behavior bit-for-bit (its fs root IS its only root).\n//\n// - `$fs:` — the explicit filesystem space: `$fs:/content/x.mdx` resolves from the\n// root of the filesystem the app reads, escaping corpus-relative addressing.\n//\n// `$fs:` changes ADDRESSING, never REACH: resolution is pure path arithmetic and\n// existence is checked against the same in-mount metadata the default space uses —\n// nothing is fetched, and a link can never name what the app cannot already read.\n// A malformed `$fs:` target (anything not mount-absolute — which also catches\n// scheme smuggling like `$fs:javascript:…`) is INVALID and must render as a broken\n// link, never an anchor.\n//\n// Corpus nesting: `LinkSpaceContext` providers nest, and the NEAREST one wins —\n// which is exactly the innermost-enclosing-corpus rule (bundle encapsulation): a\n// document rendered inside a nested corpus resolves against the nested corpus.\n\nimport { createContext } from 'react';\n\nexport { FS_PREFIX, normalizeAbsolute, resolveLinkTarget } from '@immediately-run/mdx-plugins';\nexport type { ResolvedLinkTarget, LinkSpace } from '@immediately-run/mdx-plugins';\nimport type { LinkSpace as LinkSpaceShape } from '@immediately-run/mdx-plugins';\n\n/** Ambient link space. A corpus-rendering app wraps its document tree in\n * `<LinkSpaceContext value={{ corpusRoot }}>`; nesting a second provider inside a\n * rendered sub-corpus makes the innermost root win. */\nexport const LinkSpaceContext = createContext<LinkSpaceShape>({\n corpusRoot: null,\n bundleChrooted: false,\n});\n"],"mappings":";AA8BA,SAAS,qBAAqB;AAE9B,SAAS,WAAW,mBAAmB,yBAAyB;AAOzD,MAAM,mBAAmB,cAA8B;AAAA,EAC5D,YAAY;AAAA,EACZ,gBAAgB;AAClB,CAAC;","names":[]}
1
+ {"version":3,"sources":["../src/linkSpace.ts"],"sourcesContent":["// Link path spaces (R3-273; REPO_CONTENT_DISPATCH_SPEC §9 decision, 2026-08-17).\n// R3-279: the RESOLVER CORE (resolveLinkTarget / normalizeAbsolute / FS_PREFIX /\n// ResolvedLinkTarget) moved to `@immediately-run/mdx-plugins` — beside its parity\n// fixture — and is re-exported here unchanged (API-stable). This module keeps the\n// REACT surface (LinkSpaceContext): the provider a bundle-rendering app wraps its\n// document tree in. Consumers importing from '@immediately-run/sdk/linkSpace' see\n// exactly the same names.\n//\n// A document link's target resolves in one of two spaces:\n//\n// - DEFAULT — the enclosing bundle's virtual filesystem. RELATIVE targets resolve\n// against the authoring file (identical in both spaces); ABSOLUTE targets\n// (`/x/y.mdx`) resolve from the bundle root when an enclosing `LinkSpaceContext`\n// declares one, else from the filesystem root. A non-bundle app declares nothing\n// and keeps today's behavior bit-for-bit (its fs root IS its only root).\n//\n// - `$fs:` — the explicit filesystem space: `$fs:/content/x.mdx` resolves from the\n// root of the filesystem the app reads, escaping bundle-relative addressing.\n//\n// `$fs:` changes ADDRESSING, never REACH: resolution is pure path arithmetic and\n// existence is checked against the same in-mount metadata the default space uses —\n// nothing is fetched, and a link can never name what the app cannot already read.\n// A malformed `$fs:` target (anything not mount-absolute — which also catches\n// scheme smuggling like `$fs:javascript:…`) is INVALID and must render as a broken\n// link, never an anchor.\n//\n// Bundle nesting: `LinkSpaceContext` providers nest, and the NEAREST one wins —\n// which is exactly the innermost-enclosing-bundle rule (bundle encapsulation): a\n// document rendered inside a nested bundle resolves against the nested bundle.\n\nimport { createContext } from 'react';\n\nexport { FS_PREFIX, normalizeAbsolute, resolveLinkTarget } from '@immediately-run/mdx-plugins';\nexport type { ResolvedLinkTarget, LinkSpace } from '@immediately-run/mdx-plugins';\nimport type { LinkSpace as LinkSpaceShape } from '@immediately-run/mdx-plugins';\n\n/** Ambient link space. A bundle-rendering app wraps its document tree in\n * `<LinkSpaceContext value={{ bundleRoot }}>`; nesting a second provider inside a\n * rendered sub-bundle makes the innermost root win.\n *\n * R3-482: the root's canonical spelling is `bundleRoot`; the deprecated\n * `corpusRoot` field stays in the `LinkSpace` type (mdx-plugins §forever-compat)\n * and is read as the fallback — only when `bundleRoot` is ABSENT, since an\n * explicit `bundleRoot: null` is a value (\"no bundle root\"), not a miss. */\nexport const LinkSpaceContext = createContext<LinkSpaceShape>({\n bundleRoot: null,\n bundleChrooted: false,\n});\n"],"mappings":";AA8BA,SAAS,qBAAqB;AAE9B,SAAS,WAAW,mBAAmB,yBAAyB;AAYzD,MAAM,mBAAmB,cAA8B;AAAA,EAC5D,YAAY;AAAA,EACZ,gBAAgB;AAClB,CAAC;","names":[]}
package/dist/version.cjs CHANGED
@@ -21,7 +21,7 @@ __export(version_exports, {
21
21
  SDK_VERSION: () => SDK_VERSION
22
22
  });
23
23
  module.exports = __toCommonJS(version_exports);
24
- const SDK_VERSION = "0.68.0";
24
+ const SDK_VERSION = "0.68.1";
25
25
  // Annotate the CommonJS export names for ESM import in node:
26
26
  0 && (module.exports = {
27
27
  SDK_VERSION
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/version.ts"],"sourcesContent":["// GENERATED by scripts/gen-version.mjs from package.json — do not edit by hand.\n// Regenerated on every build (prebuild); kept honest by version.test.ts.\n\n/** This SDK's package version, baked from package.json at build (SP2-6). */\nexport const SDK_VERSION = '0.68.0';\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAIO,MAAM,cAAc;","names":[]}
1
+ {"version":3,"sources":["../src/version.ts"],"sourcesContent":["// GENERATED by scripts/gen-version.mjs from package.json — do not edit by hand.\n// Regenerated on every build (prebuild); kept honest by version.test.ts.\n\n/** This SDK's package version, baked from package.json at build (SP2-6). */\nexport const SDK_VERSION = '0.68.1';\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAIO,MAAM,cAAc;","names":[]}
@@ -1,4 +1,4 @@
1
1
  /** This SDK's package version, baked from package.json at build (SP2-6). */
2
- declare const SDK_VERSION = "0.68.0";
2
+ declare const SDK_VERSION = "0.68.1";
3
3
 
4
4
  export { SDK_VERSION };
package/dist/version.d.ts CHANGED
@@ -1,4 +1,4 @@
1
1
  /** This SDK's package version, baked from package.json at build (SP2-6). */
2
- declare const SDK_VERSION = "0.68.0";
2
+ declare const SDK_VERSION = "0.68.1";
3
3
 
4
4
  export { SDK_VERSION };
package/dist/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import "./chunk-VHAA22YE.js";
2
- const SDK_VERSION = "0.68.0";
2
+ const SDK_VERSION = "0.68.1";
3
3
  export {
4
4
  SDK_VERSION
5
5
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/version.ts"],"sourcesContent":["// GENERATED by scripts/gen-version.mjs from package.json — do not edit by hand.\n// Regenerated on every build (prebuild); kept honest by version.test.ts.\n\n/** This SDK's package version, baked from package.json at build (SP2-6). */\nexport const SDK_VERSION = '0.68.0';\n"],"mappings":";AAIO,MAAM,cAAc;","names":[]}
1
+ {"version":3,"sources":["../src/version.ts"],"sourcesContent":["// GENERATED by scripts/gen-version.mjs from package.json — do not edit by hand.\n// Regenerated on every build (prebuild); kept honest by version.test.ts.\n\n/** This SDK's package version, baked from package.json at build (SP2-6). */\nexport const SDK_VERSION = '0.68.1';\n"],"mappings":";AAIO,MAAM,cAAc;","names":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@immediately-run/sdk",
3
- "version": "0.68.0",
3
+ "version": "0.68.1",
4
4
  "description": "Runtime SDK for code executing inside an immediately.run sandbox.",
5
5
  "license": "MIT",
6
6
  "repository": "github:immediately-run/immediately-run-sdk",