@immediately-run/sdk 0.50.0 → 0.51.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.
- package/dist/generated/protocol.d.cts +1 -0
- package/dist/generated/protocol.d.ts +1 -0
- package/dist/index.d.cts +3 -6
- package/dist/index.d.ts +3 -6
- package/dist/linkSpace.cjs +4 -36
- package/dist/linkSpace.cjs.map +1 -1
- package/dist/linkSpace.d.cts +3 -60
- package/dist/linkSpace.d.ts +3 -60
- package/dist/linkSpace.js +1 -33
- package/dist/linkSpace.js.map +1 -1
- package/dist/safeContent/SafeContent.cjs +2 -27
- package/dist/safeContent/SafeContent.cjs.map +1 -1
- package/dist/safeContent/SafeContent.d.cts +1 -13
- package/dist/safeContent/SafeContent.d.ts +1 -13
- package/dist/safeContent/SafeContent.js +1 -26
- package/dist/safeContent/SafeContent.js.map +1 -1
- package/dist/safeContent/index.cjs +3 -23
- package/dist/safeContent/index.cjs.map +1 -1
- package/dist/safeContent/index.d.cts +1 -6
- package/dist/safeContent/index.d.ts +1 -6
- package/dist/safeContent/index.js +1 -14
- package/dist/safeContent/index.js.map +1 -1
- package/dist/safeContent/mdastDeps.cjs +7 -2
- package/dist/safeContent/mdastDeps.js +7 -2
- package/dist/safeContent/parseSafeMdast.cjs +2 -53
- package/dist/safeContent/parseSafeMdast.cjs.map +1 -1
- package/dist/safeContent/parseSafeMdast.d.cts +1 -45
- package/dist/safeContent/parseSafeMdast.d.ts +1 -45
- package/dist/safeContent/parseSafeMdast.js +1 -42
- package/dist/safeContent/parseSafeMdast.js.map +1 -1
- package/dist/safeContent/renderMdast.cjs +2 -133
- package/dist/safeContent/renderMdast.cjs.map +1 -1
- package/dist/safeContent/renderMdast.d.cts +1 -27
- package/dist/safeContent/renderMdast.d.ts +1 -27
- package/dist/safeContent/renderMdast.js +1 -132
- package/dist/safeContent/renderMdast.js.map +1 -1
- package/dist/safeContent/sanitizeUrl.cjs +2 -12
- package/dist/safeContent/sanitizeUrl.cjs.map +1 -1
- package/dist/safeContent/sanitizeUrl.d.cts +1 -9
- package/dist/safeContent/sanitizeUrl.d.ts +1 -9
- package/dist/safeContent/sanitizeUrl.js +1 -11
- package/dist/safeContent/sanitizeUrl.js.map +1 -1
- package/dist/safeContent/wikilink.cjs +3 -35
- package/dist/safeContent/wikilink.cjs.map +1 -1
- package/dist/safeContent/wikilink.d.cts +1 -21
- package/dist/safeContent/wikilink.d.ts +1 -21
- package/dist/safeContent/wikilink.js +1 -33
- package/dist/safeContent/wikilink.js.map +1 -1
- package/dist/version.cjs +1 -1
- package/dist/version.cjs.map +1 -1
- package/dist/version.d.cts +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/version.js.map +1 -1
- package/package.json +6 -4
package/dist/index.d.cts
CHANGED
|
@@ -5,7 +5,7 @@ export { Include, RenderExportedComponent } from './components/Include.cjs';
|
|
|
5
5
|
export { SafeInclude } from './components/SafeInclude.cjs';
|
|
6
6
|
export { SourceCache, SourceReader, createSourceCache } from './sourceCache.cjs';
|
|
7
7
|
export { DEFAULT_MDX_COMPONENTS } from './components/MDXComponents.cjs';
|
|
8
|
-
export {
|
|
8
|
+
export { LinkSpaceContext } from './linkSpace.cjs';
|
|
9
9
|
export { MountImage, MountImageProps } from './components/MountImage.cjs';
|
|
10
10
|
export { Route, RouteProps, Routes } from './components/Routes.cjs';
|
|
11
11
|
export { ObjectUrlState, useAllMetadata, useFileMetadata, useMetadataQuery, useObjectUrl } from './hooks.cjs';
|
|
@@ -40,12 +40,9 @@ export { LOADING_TIMINGS, LoadingRegion, Skeleton, SkeletonArchetype, SkeletonRo
|
|
|
40
40
|
export { StreamError, StreamFrame, StreamTransport, consumeStream, protocolStream } from './protocolStream.cjs';
|
|
41
41
|
export { ATTENDED_FIRST_FRAME_MS, ATTENDED_TIMEOUT_MS, Attendance, BoundedCallOptions, CallBounds, DeadlineBound, NETWORK_TIMEOUT_MS, PENDING_NOTICE_MS, PendingAttention, PendingState, ProtocolCancelledError, ProtocolTimeoutError, STREAM_IDLE_TIMEOUT_MS, SuspendableDeadline, UNATTENDED_TIMEOUT_MS, attendanceOf, attendanceReason, boundsFor, createSuspendableDeadline, firstFrameBoundsFor, firstFrameTimeoutFor, timeoutFor } from './protocolDeadline.cjs';
|
|
42
42
|
export { EvaluationContext, FileQueryResult, FilesMetadata, Metadata, MetadataQueryEntry, MetadataQueryFunction, MetadataQueryRecord, MetadataQueryResult, ModuleExports } from './sandboxTypes.cjs';
|
|
43
|
-
export
|
|
44
|
-
export { RenderMdastOptions, SafeContentComponents, renderMdast } from './safeContent/renderMdast.cjs';
|
|
45
|
-
export { ParseSafeMdastOptions, SafeMdastNode, SafeMdxAttribute, parseSafeMdast } from './safeContent/parseSafeMdast.cjs';
|
|
46
|
-
export { sanitizeUrl } from './safeContent/sanitizeUrl.cjs';
|
|
47
|
-
export { WikiLinkToken, WikiPart, parseWikiInner, splitWikiLinks } from './safeContent/wikilink.cjs';
|
|
43
|
+
export * from '@immediately-run/safe-content';
|
|
48
44
|
export { Admonition, AdmonitionType } from './components/Admonition.cjs';
|
|
45
|
+
export { FS_PREFIX, LinkSpace, ResolvedLinkTarget, normalizeAbsolute, resolveLinkTarget } from '@immediately-run/mdx-plugins';
|
|
49
46
|
export { GrantRecord, Member, ResolvedUser, Role, SpaceInfo, getSpaceMembers, inviteToSpace, listAllSpaces, listGrants, listSpaces, lookupUser, revokeGrant, setSpaceRole, unshareSpace } from './generated/spaces.cjs';
|
|
50
47
|
export { HeadingAnchor } from './components/HeadingAnchor.cjs';
|
|
51
48
|
export { ImmediatelyRunGlobal, getHostRuntime } from './hostRuntime.cjs';
|
package/dist/index.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ export { Include, RenderExportedComponent } from './components/Include.js';
|
|
|
5
5
|
export { SafeInclude } from './components/SafeInclude.js';
|
|
6
6
|
export { SourceCache, SourceReader, createSourceCache } from './sourceCache.js';
|
|
7
7
|
export { DEFAULT_MDX_COMPONENTS } from './components/MDXComponents.js';
|
|
8
|
-
export {
|
|
8
|
+
export { LinkSpaceContext } from './linkSpace.js';
|
|
9
9
|
export { MountImage, MountImageProps } from './components/MountImage.js';
|
|
10
10
|
export { Route, RouteProps, Routes } from './components/Routes.js';
|
|
11
11
|
export { ObjectUrlState, useAllMetadata, useFileMetadata, useMetadataQuery, useObjectUrl } from './hooks.js';
|
|
@@ -40,12 +40,9 @@ export { LOADING_TIMINGS, LoadingRegion, Skeleton, SkeletonArchetype, SkeletonRo
|
|
|
40
40
|
export { StreamError, StreamFrame, StreamTransport, consumeStream, protocolStream } from './protocolStream.js';
|
|
41
41
|
export { ATTENDED_FIRST_FRAME_MS, ATTENDED_TIMEOUT_MS, Attendance, BoundedCallOptions, CallBounds, DeadlineBound, NETWORK_TIMEOUT_MS, PENDING_NOTICE_MS, PendingAttention, PendingState, ProtocolCancelledError, ProtocolTimeoutError, STREAM_IDLE_TIMEOUT_MS, SuspendableDeadline, UNATTENDED_TIMEOUT_MS, attendanceOf, attendanceReason, boundsFor, createSuspendableDeadline, firstFrameBoundsFor, firstFrameTimeoutFor, timeoutFor } from './protocolDeadline.js';
|
|
42
42
|
export { EvaluationContext, FileQueryResult, FilesMetadata, Metadata, MetadataQueryEntry, MetadataQueryFunction, MetadataQueryRecord, MetadataQueryResult, ModuleExports } from './sandboxTypes.js';
|
|
43
|
-
export
|
|
44
|
-
export { RenderMdastOptions, SafeContentComponents, renderMdast } from './safeContent/renderMdast.js';
|
|
45
|
-
export { ParseSafeMdastOptions, SafeMdastNode, SafeMdxAttribute, parseSafeMdast } from './safeContent/parseSafeMdast.js';
|
|
46
|
-
export { sanitizeUrl } from './safeContent/sanitizeUrl.js';
|
|
47
|
-
export { WikiLinkToken, WikiPart, parseWikiInner, splitWikiLinks } from './safeContent/wikilink.js';
|
|
43
|
+
export * from '@immediately-run/safe-content';
|
|
48
44
|
export { Admonition, AdmonitionType } from './components/Admonition.js';
|
|
45
|
+
export { FS_PREFIX, LinkSpace, ResolvedLinkTarget, normalizeAbsolute, resolveLinkTarget } from '@immediately-run/mdx-plugins';
|
|
49
46
|
export { GrantRecord, Member, ResolvedUser, Role, SpaceInfo, getSpaceMembers, inviteToSpace, listAllSpaces, listGrants, listSpaces, lookupUser, revokeGrant, setSpaceRole, unshareSpace } from './generated/spaces.js';
|
|
50
47
|
export { HeadingAnchor } from './components/HeadingAnchor.js';
|
|
51
48
|
export { ImmediatelyRunGlobal, getHostRuntime } from './hostRuntime.js';
|
package/dist/linkSpace.cjs
CHANGED
|
@@ -18,50 +18,18 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
19
|
var linkSpace_exports = {};
|
|
20
20
|
__export(linkSpace_exports, {
|
|
21
|
-
FS_PREFIX: () => FS_PREFIX,
|
|
21
|
+
FS_PREFIX: () => import_mdx_plugins.FS_PREFIX,
|
|
22
22
|
LinkSpaceContext: () => LinkSpaceContext,
|
|
23
|
-
normalizeAbsolute: () => normalizeAbsolute,
|
|
24
|
-
resolveLinkTarget: () => resolveLinkTarget
|
|
23
|
+
normalizeAbsolute: () => import_mdx_plugins.normalizeAbsolute,
|
|
24
|
+
resolveLinkTarget: () => import_mdx_plugins.resolveLinkTarget
|
|
25
25
|
});
|
|
26
26
|
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
30
|
corpusRoot: null,
|
|
31
31
|
bundleChrooted: false
|
|
32
32
|
});
|
|
33
|
-
const normalizeAbsolute = (path) => {
|
|
34
|
-
const out = [];
|
|
35
|
-
for (const seg of path.split("/")) {
|
|
36
|
-
if (seg === "" || seg === ".") continue;
|
|
37
|
-
if (seg === "..") out.pop();
|
|
38
|
-
else out.push(seg);
|
|
39
|
-
}
|
|
40
|
-
return "/" + out.join("/");
|
|
41
|
-
};
|
|
42
|
-
function resolveCorpusAbsolute(path, corpusRoot) {
|
|
43
|
-
const inner = normalizeAbsolute(path);
|
|
44
|
-
if (corpusRoot === null || corpusRoot === "/") return { state: "resolved", path: inner };
|
|
45
|
-
return { state: "resolved", path: normalizeAbsolute(corpusRoot + inner) };
|
|
46
|
-
}
|
|
47
|
-
function resolveLinkTarget(raw, opts = {}) {
|
|
48
|
-
if (raw.startsWith(FS_PREFIX)) {
|
|
49
|
-
const rest = raw.slice(FS_PREFIX.length);
|
|
50
|
-
if (!rest.startsWith("/")) return { state: "invalid" };
|
|
51
|
-
if (opts.bundleChrooted) return resolveCorpusAbsolute(rest, opts.corpusRoot ?? null);
|
|
52
|
-
return { state: "resolved", path: normalizeAbsolute(rest) };
|
|
53
|
-
}
|
|
54
|
-
if (raw.startsWith("/")) {
|
|
55
|
-
const corpusRoot = opts.corpusRoot ?? null;
|
|
56
|
-
if (corpusRoot !== null) {
|
|
57
|
-
return resolveCorpusAbsolute(raw, corpusRoot);
|
|
58
|
-
}
|
|
59
|
-
return { state: "resolved", path: normalizeAbsolute(raw) };
|
|
60
|
-
}
|
|
61
|
-
if (!opts.currentFile) return { state: "unresolvable" };
|
|
62
|
-
const dir = opts.currentFile.slice(0, opts.currentFile.lastIndexOf("/"));
|
|
63
|
-
return { state: "resolved", path: normalizeAbsolute(`${dir}/${raw}`) };
|
|
64
|
-
}
|
|
65
33
|
// Annotate the CommonJS export names for ESM import in node:
|
|
66
34
|
0 && (module.exports = {
|
|
67
35
|
FS_PREFIX,
|
package/dist/linkSpace.cjs.map
CHANGED
|
@@ -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//\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
|
|
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":[]}
|
package/dist/linkSpace.d.cts
CHANGED
|
@@ -1,67 +1,10 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
|
+
import { LinkSpace } from '@immediately-run/mdx-plugins';
|
|
3
|
+
export { FS_PREFIX, LinkSpace, ResolvedLinkTarget, normalizeAbsolute, resolveLinkTarget } from '@immediately-run/mdx-plugins';
|
|
2
4
|
|
|
3
|
-
declare const FS_PREFIX = "$fs:";
|
|
4
|
-
interface LinkSpace {
|
|
5
|
-
/** Absolute filesystem path of the enclosing corpus's root (e.g. `/app/content`),
|
|
6
|
-
* or `null` when the document is not corpus-hosted (default). */
|
|
7
|
-
corpusRoot: string | null;
|
|
8
|
-
/**
|
|
9
|
-
* True when the filesystem this document resolves against is **chroot'd to the
|
|
10
|
-
* bundle** — i.e. the port the app holds was scoped to the bundle's subtree, so
|
|
11
|
-
* the mount root and the bundle root are the same directory
|
|
12
|
-
* (`BUNDLE_LAYERS_SPEC §9`; the `T2`/`T4` wrapper, R3-319 / BL-2).
|
|
13
|
-
*
|
|
14
|
-
* Under that grant `$fs:` **collapses to the scoped root**: `$fs:/p` and `/p`
|
|
15
|
-
* name the same byte, because there is no longer any "mount-absolute" space
|
|
16
|
-
* outside the bundle for `$fs:` to reach into. Without this flag the resolver
|
|
17
|
-
* would hand back a mount-absolute path that the chroot then re-roots anyway —
|
|
18
|
-
* a link that renders as valid and resolves somewhere the author did not mean.
|
|
19
|
-
*
|
|
20
|
-
* **This is an invariant to CREATE, not one to inherit** (`BUNDLE_LAYERS_SPEC
|
|
21
|
-
* §11`): the shipped resolver reads `{currentFile, corpusRoot}` and nothing
|
|
22
|
-
* else, so `$fs:` is bundle-anchored only if something says so. It lives here,
|
|
23
|
-
* in the resolver, rather than as a rule each caller applies by passing
|
|
24
|
-
* `corpusRoot: '/'` — an invariant the arithmetic carries cannot be forgotten
|
|
25
|
-
* at one call site out of five.
|
|
26
|
-
*/
|
|
27
|
-
bundleChrooted?: boolean;
|
|
28
|
-
}
|
|
29
5
|
/** Ambient link space. A corpus-rendering app wraps its document tree in
|
|
30
6
|
* `<LinkSpaceContext value={{ corpusRoot }}>`; nesting a second provider inside a
|
|
31
7
|
* rendered sub-corpus makes the innermost root win. */
|
|
32
8
|
declare const LinkSpaceContext: react.Context<LinkSpace>;
|
|
33
|
-
/** Collapse `.`/`..`/empty segments into a clean absolute path. `..` can never
|
|
34
|
-
* climb above the root — a (virtual) root's parent is itself, which is what keeps
|
|
35
|
-
* both the mount space and the corpus space closed under traversal. */
|
|
36
|
-
declare const normalizeAbsolute: (path: string) => string;
|
|
37
|
-
type ResolvedLinkTarget =
|
|
38
|
-
/** Resolved to an absolute filesystem path (existence NOT checked here). */
|
|
39
|
-
{
|
|
40
|
-
state: 'resolved';
|
|
41
|
-
path: string;
|
|
42
|
-
}
|
|
43
|
-
/** A relative target with no known authoring file — the caller may route
|
|
44
|
-
* optimistically (it cannot check existence or self-ness generically). */
|
|
45
|
-
| {
|
|
46
|
-
state: 'unresolvable';
|
|
47
|
-
}
|
|
48
|
-
/** A malformed `$fs:` target (not mount-absolute; includes scheme smuggling).
|
|
49
|
-
* Callers MUST render this broken/inert — never as an anchor. */
|
|
50
|
-
| {
|
|
51
|
-
state: 'invalid';
|
|
52
|
-
};
|
|
53
|
-
/**
|
|
54
|
-
* Resolve a raw link target (a wikilink target or an in-app href's path half —
|
|
55
|
-
* fragment already split off) to an absolute filesystem path. THE shared resolver:
|
|
56
|
-
* the default `WikiLink`, the markdown `a` override, and safe-content consumers
|
|
57
|
-
* all route through this one function so the two render pipelines cannot drift.
|
|
58
|
-
*/
|
|
59
|
-
declare function resolveLinkTarget(raw: string, opts?: {
|
|
60
|
-
currentFile?: string;
|
|
61
|
-
corpusRoot?: string | null;
|
|
62
|
-
/** See `LinkSpace.bundleChrooted`. Under a bundle-chroot'd grant `$fs:`
|
|
63
|
-
* resolves in the corpus space, because they are the same space. */
|
|
64
|
-
bundleChrooted?: boolean;
|
|
65
|
-
}): ResolvedLinkTarget;
|
|
66
9
|
|
|
67
|
-
export {
|
|
10
|
+
export { LinkSpaceContext };
|
package/dist/linkSpace.d.ts
CHANGED
|
@@ -1,67 +1,10 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
|
+
import { LinkSpace } from '@immediately-run/mdx-plugins';
|
|
3
|
+
export { FS_PREFIX, LinkSpace, ResolvedLinkTarget, normalizeAbsolute, resolveLinkTarget } from '@immediately-run/mdx-plugins';
|
|
2
4
|
|
|
3
|
-
declare const FS_PREFIX = "$fs:";
|
|
4
|
-
interface LinkSpace {
|
|
5
|
-
/** Absolute filesystem path of the enclosing corpus's root (e.g. `/app/content`),
|
|
6
|
-
* or `null` when the document is not corpus-hosted (default). */
|
|
7
|
-
corpusRoot: string | null;
|
|
8
|
-
/**
|
|
9
|
-
* True when the filesystem this document resolves against is **chroot'd to the
|
|
10
|
-
* bundle** — i.e. the port the app holds was scoped to the bundle's subtree, so
|
|
11
|
-
* the mount root and the bundle root are the same directory
|
|
12
|
-
* (`BUNDLE_LAYERS_SPEC §9`; the `T2`/`T4` wrapper, R3-319 / BL-2).
|
|
13
|
-
*
|
|
14
|
-
* Under that grant `$fs:` **collapses to the scoped root**: `$fs:/p` and `/p`
|
|
15
|
-
* name the same byte, because there is no longer any "mount-absolute" space
|
|
16
|
-
* outside the bundle for `$fs:` to reach into. Without this flag the resolver
|
|
17
|
-
* would hand back a mount-absolute path that the chroot then re-roots anyway —
|
|
18
|
-
* a link that renders as valid and resolves somewhere the author did not mean.
|
|
19
|
-
*
|
|
20
|
-
* **This is an invariant to CREATE, not one to inherit** (`BUNDLE_LAYERS_SPEC
|
|
21
|
-
* §11`): the shipped resolver reads `{currentFile, corpusRoot}` and nothing
|
|
22
|
-
* else, so `$fs:` is bundle-anchored only if something says so. It lives here,
|
|
23
|
-
* in the resolver, rather than as a rule each caller applies by passing
|
|
24
|
-
* `corpusRoot: '/'` — an invariant the arithmetic carries cannot be forgotten
|
|
25
|
-
* at one call site out of five.
|
|
26
|
-
*/
|
|
27
|
-
bundleChrooted?: boolean;
|
|
28
|
-
}
|
|
29
5
|
/** Ambient link space. A corpus-rendering app wraps its document tree in
|
|
30
6
|
* `<LinkSpaceContext value={{ corpusRoot }}>`; nesting a second provider inside a
|
|
31
7
|
* rendered sub-corpus makes the innermost root win. */
|
|
32
8
|
declare const LinkSpaceContext: react.Context<LinkSpace>;
|
|
33
|
-
/** Collapse `.`/`..`/empty segments into a clean absolute path. `..` can never
|
|
34
|
-
* climb above the root — a (virtual) root's parent is itself, which is what keeps
|
|
35
|
-
* both the mount space and the corpus space closed under traversal. */
|
|
36
|
-
declare const normalizeAbsolute: (path: string) => string;
|
|
37
|
-
type ResolvedLinkTarget =
|
|
38
|
-
/** Resolved to an absolute filesystem path (existence NOT checked here). */
|
|
39
|
-
{
|
|
40
|
-
state: 'resolved';
|
|
41
|
-
path: string;
|
|
42
|
-
}
|
|
43
|
-
/** A relative target with no known authoring file — the caller may route
|
|
44
|
-
* optimistically (it cannot check existence or self-ness generically). */
|
|
45
|
-
| {
|
|
46
|
-
state: 'unresolvable';
|
|
47
|
-
}
|
|
48
|
-
/** A malformed `$fs:` target (not mount-absolute; includes scheme smuggling).
|
|
49
|
-
* Callers MUST render this broken/inert — never as an anchor. */
|
|
50
|
-
| {
|
|
51
|
-
state: 'invalid';
|
|
52
|
-
};
|
|
53
|
-
/**
|
|
54
|
-
* Resolve a raw link target (a wikilink target or an in-app href's path half —
|
|
55
|
-
* fragment already split off) to an absolute filesystem path. THE shared resolver:
|
|
56
|
-
* the default `WikiLink`, the markdown `a` override, and safe-content consumers
|
|
57
|
-
* all route through this one function so the two render pipelines cannot drift.
|
|
58
|
-
*/
|
|
59
|
-
declare function resolveLinkTarget(raw: string, opts?: {
|
|
60
|
-
currentFile?: string;
|
|
61
|
-
corpusRoot?: string | null;
|
|
62
|
-
/** See `LinkSpace.bundleChrooted`. Under a bundle-chroot'd grant `$fs:`
|
|
63
|
-
* resolves in the corpus space, because they are the same space. */
|
|
64
|
-
bundleChrooted?: boolean;
|
|
65
|
-
}): ResolvedLinkTarget;
|
|
66
9
|
|
|
67
|
-
export {
|
|
10
|
+
export { LinkSpaceContext };
|
package/dist/linkSpace.js
CHANGED
|
@@ -1,42 +1,10 @@
|
|
|
1
1
|
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
5
|
corpusRoot: null,
|
|
6
6
|
bundleChrooted: false
|
|
7
7
|
});
|
|
8
|
-
const normalizeAbsolute = (path) => {
|
|
9
|
-
const out = [];
|
|
10
|
-
for (const seg of path.split("/")) {
|
|
11
|
-
if (seg === "" || seg === ".") continue;
|
|
12
|
-
if (seg === "..") out.pop();
|
|
13
|
-
else out.push(seg);
|
|
14
|
-
}
|
|
15
|
-
return "/" + out.join("/");
|
|
16
|
-
};
|
|
17
|
-
function resolveCorpusAbsolute(path, corpusRoot) {
|
|
18
|
-
const inner = normalizeAbsolute(path);
|
|
19
|
-
if (corpusRoot === null || corpusRoot === "/") return { state: "resolved", path: inner };
|
|
20
|
-
return { state: "resolved", path: normalizeAbsolute(corpusRoot + inner) };
|
|
21
|
-
}
|
|
22
|
-
function resolveLinkTarget(raw, opts = {}) {
|
|
23
|
-
if (raw.startsWith(FS_PREFIX)) {
|
|
24
|
-
const rest = raw.slice(FS_PREFIX.length);
|
|
25
|
-
if (!rest.startsWith("/")) return { state: "invalid" };
|
|
26
|
-
if (opts.bundleChrooted) return resolveCorpusAbsolute(rest, opts.corpusRoot ?? null);
|
|
27
|
-
return { state: "resolved", path: normalizeAbsolute(rest) };
|
|
28
|
-
}
|
|
29
|
-
if (raw.startsWith("/")) {
|
|
30
|
-
const corpusRoot = opts.corpusRoot ?? null;
|
|
31
|
-
if (corpusRoot !== null) {
|
|
32
|
-
return resolveCorpusAbsolute(raw, corpusRoot);
|
|
33
|
-
}
|
|
34
|
-
return { state: "resolved", path: normalizeAbsolute(raw) };
|
|
35
|
-
}
|
|
36
|
-
if (!opts.currentFile) return { state: "unresolvable" };
|
|
37
|
-
const dir = opts.currentFile.slice(0, opts.currentFile.lastIndexOf("/"));
|
|
38
|
-
return { state: "resolved", path: normalizeAbsolute(`${dir}/${raw}`) };
|
|
39
|
-
}
|
|
40
8
|
export {
|
|
41
9
|
FS_PREFIX,
|
|
42
10
|
LinkSpaceContext,
|
package/dist/linkSpace.js.map
CHANGED
|
@@ -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//\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
|
|
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":[]}
|
|
@@ -18,35 +18,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
19
|
var SafeContent_exports = {};
|
|
20
20
|
__export(SafeContent_exports, {
|
|
21
|
-
SafeContent: () => SafeContent
|
|
21
|
+
SafeContent: () => import_safe_content.SafeContent
|
|
22
22
|
});
|
|
23
23
|
module.exports = __toCommonJS(SafeContent_exports);
|
|
24
|
-
var
|
|
25
|
-
var import_parseSafeMdast = require("./parseSafeMdast");
|
|
26
|
-
var import_renderMdast = require("./renderMdast");
|
|
27
|
-
function SafeContent({ source, fallback = null, ...options }) {
|
|
28
|
-
const [tree, setTree] = (0, import_react.useState)(null);
|
|
29
|
-
const runId = (0, import_react.useRef)(0);
|
|
30
|
-
(0, import_react.useEffect)(() => {
|
|
31
|
-
const id = ++runId.current;
|
|
32
|
-
setTree(null);
|
|
33
|
-
let cancelled = false;
|
|
34
|
-
(0, import_parseSafeMdast.parseSafeMdast)(source).then((parsed) => {
|
|
35
|
-
if (!cancelled && runId.current === id) setTree(parsed);
|
|
36
|
-
}).catch(() => {
|
|
37
|
-
if (!cancelled && runId.current === id) setTree(null);
|
|
38
|
-
});
|
|
39
|
-
return () => {
|
|
40
|
-
cancelled = true;
|
|
41
|
-
};
|
|
42
|
-
}, [source]);
|
|
43
|
-
const rendered = (0, import_react.useMemo)(
|
|
44
|
-
() => tree ? (0, import_renderMdast.renderMdast)(tree, options) : null,
|
|
45
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
46
|
-
[tree, options.components, options.resolveWikiLink]
|
|
47
|
-
);
|
|
48
|
-
return tree ? rendered : fallback;
|
|
49
|
-
}
|
|
24
|
+
var import_safe_content = require("@immediately-run/safe-content");
|
|
50
25
|
// Annotate the CommonJS export names for ESM import in node:
|
|
51
26
|
0 && (module.exports = {
|
|
52
27
|
SafeContent
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/safeContent/SafeContent.tsx"],"sourcesContent":["
|
|
1
|
+
{"version":3,"sources":["../../src/safeContent/SafeContent.tsx"],"sourcesContent":["// R3-279 (phase 3): re-export shim — the implementation lives in\n// `@immediately-run/safe-content`; this subpath keeps working byte-compatibly.\nexport { SafeContent } from '@immediately-run/safe-content';\nexport type { SafeContentProps } from '@immediately-run/safe-content';\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,0BAA4B;","names":[]}
|
|
@@ -1,13 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { RenderMdastOptions } from './renderMdast.cjs';
|
|
3
|
-
import './parseSafeMdast.cjs';
|
|
4
|
-
|
|
5
|
-
interface SafeContentProps extends RenderMdastOptions {
|
|
6
|
-
/** The untrusted Markdown/MDX-syntax source to render as data. */
|
|
7
|
-
source: string;
|
|
8
|
-
/** Rendered while the async parse is in flight (default: nothing). */
|
|
9
|
-
fallback?: ReactNode;
|
|
10
|
-
}
|
|
11
|
-
declare function SafeContent({ source, fallback, ...options }: SafeContentProps): ReactNode;
|
|
12
|
-
|
|
13
|
-
export { SafeContent, type SafeContentProps };
|
|
1
|
+
export { SafeContent, SafeContentProps } from '@immediately-run/safe-content';
|
|
@@ -1,13 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { RenderMdastOptions } from './renderMdast.js';
|
|
3
|
-
import './parseSafeMdast.js';
|
|
4
|
-
|
|
5
|
-
interface SafeContentProps extends RenderMdastOptions {
|
|
6
|
-
/** The untrusted Markdown/MDX-syntax source to render as data. */
|
|
7
|
-
source: string;
|
|
8
|
-
/** Rendered while the async parse is in flight (default: nothing). */
|
|
9
|
-
fallback?: ReactNode;
|
|
10
|
-
}
|
|
11
|
-
declare function SafeContent({ source, fallback, ...options }: SafeContentProps): ReactNode;
|
|
12
|
-
|
|
13
|
-
export { SafeContent, type SafeContentProps };
|
|
1
|
+
export { SafeContent, SafeContentProps } from '@immediately-run/safe-content';
|
|
@@ -1,30 +1,5 @@
|
|
|
1
1
|
import "../chunk-VHAA22YE.js";
|
|
2
|
-
import {
|
|
3
|
-
import { parseSafeMdast } from "./parseSafeMdast";
|
|
4
|
-
import { renderMdast } from "./renderMdast";
|
|
5
|
-
function SafeContent({ source, fallback = null, ...options }) {
|
|
6
|
-
const [tree, setTree] = useState(null);
|
|
7
|
-
const runId = useRef(0);
|
|
8
|
-
useEffect(() => {
|
|
9
|
-
const id = ++runId.current;
|
|
10
|
-
setTree(null);
|
|
11
|
-
let cancelled = false;
|
|
12
|
-
parseSafeMdast(source).then((parsed) => {
|
|
13
|
-
if (!cancelled && runId.current === id) setTree(parsed);
|
|
14
|
-
}).catch(() => {
|
|
15
|
-
if (!cancelled && runId.current === id) setTree(null);
|
|
16
|
-
});
|
|
17
|
-
return () => {
|
|
18
|
-
cancelled = true;
|
|
19
|
-
};
|
|
20
|
-
}, [source]);
|
|
21
|
-
const rendered = useMemo(
|
|
22
|
-
() => tree ? renderMdast(tree, options) : null,
|
|
23
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
24
|
-
[tree, options.components, options.resolveWikiLink]
|
|
25
|
-
);
|
|
26
|
-
return tree ? rendered : fallback;
|
|
27
|
-
}
|
|
2
|
+
import { SafeContent } from "@immediately-run/safe-content";
|
|
28
3
|
export {
|
|
29
4
|
SafeContent
|
|
30
5
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/safeContent/SafeContent.tsx"],"sourcesContent":["
|
|
1
|
+
{"version":3,"sources":["../../src/safeContent/SafeContent.tsx"],"sourcesContent":["// R3-279 (phase 3): re-export shim — the implementation lives in\n// `@immediately-run/safe-content`; this subpath keeps working byte-compatibly.\nexport { SafeContent } from '@immediately-run/safe-content';\nexport type { SafeContentProps } from '@immediately-run/safe-content';\n"],"mappings":";AAEA,SAAS,mBAAmB;","names":[]}
|
|
@@ -3,10 +3,6 @@ var __defProp = Object.defineProperty;
|
|
|
3
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
5
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
6
|
var __copyProps = (to, from, except, desc) => {
|
|
11
7
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
8
|
for (let key of __getOwnPropNames(from))
|
|
@@ -15,29 +11,13 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
15
11
|
}
|
|
16
12
|
return to;
|
|
17
13
|
};
|
|
14
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
18
15
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
16
|
var safeContent_exports = {};
|
|
20
|
-
__export(safeContent_exports, {
|
|
21
|
-
SafeContent: () => import_SafeContent.SafeContent,
|
|
22
|
-
parseSafeMdast: () => import_parseSafeMdast.parseSafeMdast,
|
|
23
|
-
parseWikiInner: () => import_wikilink.parseWikiInner,
|
|
24
|
-
renderMdast: () => import_renderMdast.renderMdast,
|
|
25
|
-
sanitizeUrl: () => import_sanitizeUrl.sanitizeUrl,
|
|
26
|
-
splitWikiLinks: () => import_wikilink.splitWikiLinks
|
|
27
|
-
});
|
|
28
17
|
module.exports = __toCommonJS(safeContent_exports);
|
|
29
|
-
|
|
30
|
-
var import_renderMdast = require("./renderMdast");
|
|
31
|
-
var import_parseSafeMdast = require("./parseSafeMdast");
|
|
32
|
-
var import_sanitizeUrl = require("./sanitizeUrl");
|
|
33
|
-
var import_wikilink = require("./wikilink");
|
|
18
|
+
__reExport(safeContent_exports, require("@immediately-run/safe-content"), module.exports);
|
|
34
19
|
// Annotate the CommonJS export names for ESM import in node:
|
|
35
20
|
0 && (module.exports = {
|
|
36
|
-
|
|
37
|
-
parseSafeMdast,
|
|
38
|
-
parseWikiInner,
|
|
39
|
-
renderMdast,
|
|
40
|
-
sanitizeUrl,
|
|
41
|
-
splitWikiLinks
|
|
21
|
+
...require("@immediately-run/safe-content")
|
|
42
22
|
});
|
|
43
23
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/safeContent/index.ts"],"sourcesContent":["// Safe content rendering — non-executable MDX (TRUST_MODES_SPEC §5.1, AGENT_AUTHORING\n// §10). The host/SDK-owned renderer an INTERPRETER app uses to render untrusted\n// Markdown/MDX-syntax content as data, with **no evaluator anywhere in the pipeline**.\n// This is the mandatory terminal for the MDX-from-mount gate (§10 delta 1) — a shared\n// (multi-writer / M3) board or wiki entry MUST render through here, never compiled MDX.\n//\n// It is a **T2 tool, not a platform gate**: it stops content executing as code; it does\n// not certify anything to the host, and CO-4 data-fencing is still required for anything\n// that *reads* the content (the agent case).\n
|
|
1
|
+
{"version":3,"sources":["../../src/safeContent/index.ts"],"sourcesContent":["// Safe content rendering — non-executable MDX (TRUST_MODES_SPEC §5.1, AGENT_AUTHORING\n// §10). The host/SDK-owned renderer an INTERPRETER app uses to render untrusted\n// Markdown/MDX-syntax content as data, with **no evaluator anywhere in the pipeline**.\n// This is the mandatory terminal for the MDX-from-mount gate (§10 delta 1) — a shared\n// (multi-writer / M3) board or wiki entry MUST render through here, never compiled MDX.\n//\n// It is a **T2 tool, not a platform gate**: it stops content executing as code; it does\n// not certify anything to the host, and CO-4 data-fencing is still required for anything\n// that *reads* the content (the agent case).\n//\n// R3-279 (phase 3): the implementation now lives in `@immediately-run/safe-content`\n// (the S3 content-framework tier's first extraction). This module — and every sibling\n// subpath below — is a byte-compat RE-EXPORT: `api-snapshot.json` is unchanged, every\n// existing `@immediately-run/sdk/safeContent/*` import keeps working, and no consumer\n// changes anywhere.\nexport * from '@immediately-run/safe-content';\n"],"mappings":";;;;;;;;;;;;;;;AAAA;AAAA;AAeA,gCAAc,0CAfd;","names":[]}
|
|
@@ -1,6 +1 @@
|
|
|
1
|
-
export
|
|
2
|
-
export { RenderMdastOptions, SafeContentComponents, renderMdast } from './renderMdast.cjs';
|
|
3
|
-
export { ParseSafeMdastOptions, SafeMdastNode, SafeMdxAttribute, parseSafeMdast } from './parseSafeMdast.cjs';
|
|
4
|
-
export { sanitizeUrl } from './sanitizeUrl.cjs';
|
|
5
|
-
export { WikiLinkToken, WikiPart, parseWikiInner, splitWikiLinks } from './wikilink.cjs';
|
|
6
|
-
import 'react';
|
|
1
|
+
export * from '@immediately-run/safe-content';
|
|
@@ -1,6 +1 @@
|
|
|
1
|
-
export
|
|
2
|
-
export { RenderMdastOptions, SafeContentComponents, renderMdast } from './renderMdast.js';
|
|
3
|
-
export { ParseSafeMdastOptions, SafeMdastNode, SafeMdxAttribute, parseSafeMdast } from './parseSafeMdast.js';
|
|
4
|
-
export { sanitizeUrl } from './sanitizeUrl.js';
|
|
5
|
-
export { WikiLinkToken, WikiPart, parseWikiInner, splitWikiLinks } from './wikilink.js';
|
|
6
|
-
import 'react';
|
|
1
|
+
export * from '@immediately-run/safe-content';
|
|
@@ -1,15 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
import { SafeContent } from "./SafeContent";
|
|
3
|
-
import { renderMdast } from "./renderMdast";
|
|
4
|
-
import { parseSafeMdast } from "./parseSafeMdast";
|
|
5
|
-
import { sanitizeUrl } from "./sanitizeUrl";
|
|
6
|
-
import { splitWikiLinks, parseWikiInner } from "./wikilink";
|
|
7
|
-
export {
|
|
8
|
-
SafeContent,
|
|
9
|
-
parseSafeMdast,
|
|
10
|
-
parseWikiInner,
|
|
11
|
-
renderMdast,
|
|
12
|
-
sanitizeUrl,
|
|
13
|
-
splitWikiLinks
|
|
14
|
-
};
|
|
1
|
+
export * from "@immediately-run/safe-content";
|
|
15
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/safeContent/index.ts"],"sourcesContent":["// Safe content rendering — non-executable MDX (TRUST_MODES_SPEC §5.1, AGENT_AUTHORING\n// §10). The host/SDK-owned renderer an INTERPRETER app uses to render untrusted\n// Markdown/MDX-syntax content as data, with **no evaluator anywhere in the pipeline**.\n// This is the mandatory terminal for the MDX-from-mount gate (§10 delta 1) — a shared\n// (multi-writer / M3) board or wiki entry MUST render through here, never compiled MDX.\n//\n// It is a **T2 tool, not a platform gate**: it stops content executing as code; it does\n// not certify anything to the host, and CO-4 data-fencing is still required for anything\n// that *reads* the content (the agent case).\n
|
|
1
|
+
{"version":3,"sources":["../../src/safeContent/index.ts"],"sourcesContent":["// Safe content rendering — non-executable MDX (TRUST_MODES_SPEC §5.1, AGENT_AUTHORING\n// §10). The host/SDK-owned renderer an INTERPRETER app uses to render untrusted\n// Markdown/MDX-syntax content as data, with **no evaluator anywhere in the pipeline**.\n// This is the mandatory terminal for the MDX-from-mount gate (§10 delta 1) — a shared\n// (multi-writer / M3) board or wiki entry MUST render through here, never compiled MDX.\n//\n// It is a **T2 tool, not a platform gate**: it stops content executing as code; it does\n// not certify anything to the host, and CO-4 data-fencing is still required for anything\n// that *reads* the content (the agent case).\n//\n// R3-279 (phase 3): the implementation now lives in `@immediately-run/safe-content`\n// (the S3 content-framework tier's first extraction). This module — and every sibling\n// subpath below — is a byte-compat RE-EXPORT: `api-snapshot.json` is unchanged, every\n// existing `@immediately-run/sdk/safeContent/*` import keeps working, and no consumer\n// changes anywhere.\nexport * from '@immediately-run/safe-content';\n"],"mappings":"AAeA,cAAc;","names":[]}
|