@poe-platform/safe-bash 0.1.795 → 0.1.797
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/safe-bash/command-chunks/{chunk-PSF3BSSL.js → chunk-2PX5B7T5.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-LHBMH66Z.js → chunk-C2DUYVYZ.js} +3 -3
- package/dist/safe-bash/command-chunks/{model-store-5DAJJVFE.js → model-store-L35QTZMJ.js} +1 -1
- package/dist/safe-bash/command-chunks/{src-5NDYOAT6.js → src-UJOWAS2S.js} +1 -1
- package/dist/safe-bash/full-core.browser.js +1 -1
- package/dist/safe-bash-command-mmdc/arguments.d.ts +1 -1
- package/dist/safe-bash-command-mmdc/command.d.ts +9 -0
- package/dist/safe-bash-command-mmdc/contracts.d.ts +34 -2
- package/dist/safe-bash-command-mmdc/index.d.ts +1 -1
- package/dist/safe-bash-command-mmdc/index.js +4417 -3968
- package/dist/safe-bash-command-mmdc/png.d.ts +1 -1
- package/dist/safe-bash-command-pandoc/command.js +1 -1
- package/dist/safe-bash-command-pandoc/index.js +1 -1
- package/package.json +2 -2
|
@@ -8422,7 +8422,7 @@ var DocumentXmlEditor = class _DocumentXmlEditor {
|
|
|
8422
8422
|
}
|
|
8423
8423
|
}
|
|
8424
8424
|
#stage(token, value, original, escape) {
|
|
8425
|
-
if (value.length > (this.#limits.maxBytes ??
|
|
8425
|
+
if (value.length > (this.#limits.maxBytes ?? Infinity))
|
|
8426
8426
|
throw new ResourceLimitError("XML output byte limit exceeded.");
|
|
8427
8427
|
this.#budget.charge("work", value.length * 8);
|
|
8428
8428
|
this.#budget.charge("retainedBytes", value.length * 12);
|
|
@@ -8463,7 +8463,7 @@ var DocumentXmlEditor = class _DocumentXmlEditor {
|
|
|
8463
8463
|
}
|
|
8464
8464
|
const patches = [...this.#patches].map(([token, value]) => ({ ...this.#spans.get(token), value }));
|
|
8465
8465
|
patches.sort((a, b) => a.start - b.start);
|
|
8466
|
-
const maxBytes = this.#limits.maxBytes ??
|
|
8466
|
+
const maxBytes = this.#limits.maxBytes ?? Infinity;
|
|
8467
8467
|
let length2 = this.#source.length;
|
|
8468
8468
|
for (const patch of patches) length2 += patch.value.length - (patch.end - patch.start);
|
|
8469
8469
|
const utf8 = this.#document.encoding === "UTF-8";
|
|
@@ -13145,7 +13145,7 @@ var PackageView = class {
|
|
|
13145
13145
|
if (input == null) throw new InputTypeError("Expected explicit package input.");
|
|
13146
13146
|
if (settings2.template !== void 0) throw new InputTypeError("A context template conflicts with package input.");
|
|
13147
13147
|
const admitted2 = await admitDocumentModel(input, settings2);
|
|
13148
|
-
const { ModelStore: ModelStore2 } = await import("./model-store-
|
|
13148
|
+
const { ModelStore: ModelStore2 } = await import("./model-store-L35QTZMJ.js");
|
|
13149
13149
|
const store = new ModelStore2(admitted2.archive, admitted2.settings, admitted2.archive.mainPart, admitted2.source);
|
|
13150
13150
|
store.package.after_unmarshal();
|
|
13151
13151
|
return store.package;
|
|
@@ -10409,7 +10409,7 @@ var pdf_default = {
|
|
|
10409
10409
|
};
|
|
10410
10410
|
var attr2 = ["", [], []];
|
|
10411
10411
|
async function modelContext(ctx) {
|
|
10412
|
-
const { DocumentBudget } = await import("./src-
|
|
10412
|
+
const { DocumentBudget } = await import("./src-UJOWAS2S.js");
|
|
10413
10413
|
const l = ctx.limits;
|
|
10414
10414
|
const signal = ctx.signal ?? new AbortController().signal;
|
|
10415
10415
|
return { signal, budget: new DocumentBudget({
|
|
@@ -10443,7 +10443,7 @@ async function guarded(ctx, action) {
|
|
|
10443
10443
|
}
|
|
10444
10444
|
var docxReader = { format: "docx", async read(input, ctx) {
|
|
10445
10445
|
return guarded(ctx, async () => {
|
|
10446
|
-
const { Document: openDocument, Paragraph, Run } = await import("./src-
|
|
10446
|
+
const { Document: openDocument, Paragraph, Run } = await import("./src-UJOWAS2S.js");
|
|
10447
10447
|
const model = await openDocument(input.bytes, await modelContext(ctx));
|
|
10448
10448
|
const paragraph = (p) => {
|
|
10449
10449
|
const inlines2 = [];
|
|
@@ -10505,7 +10505,7 @@ var docxWriter = { format: "docx", async write(document, ctx) {
|
|
|
10505
10505
|
else if (block2.t === "CodeBlock") blocks3.push({ kind: "paragraph", text: block2.c[1] });
|
|
10506
10506
|
else throw new PandocError("E_UNSUPPORTED_FEATURE", "write", `Unsupported DOCX block: ${block2.t}`, "docx");
|
|
10507
10507
|
}
|
|
10508
|
-
const { createDocumentArchive, writeDocumentArchive } = await import("./src-
|
|
10508
|
+
const { createDocumentArchive, writeDocumentArchive } = await import("./src-UJOWAS2S.js");
|
|
10509
10509
|
const mc = await modelContext(ctx);
|
|
10510
10510
|
const archiveContext = { signal: mc.signal, budget: mc.budget };
|
|
10511
10511
|
const archive = await createDocumentArchive({ content: { version: 1, blocks: blocks3 } }, archiveContext);
|
|
@@ -1253,7 +1253,7 @@ import {
|
|
|
1253
1253
|
parseMmdcArguments,
|
|
1254
1254
|
renderMermaidSvg
|
|
1255
1255
|
} from "../safe-bash-command-mmdc/index.js";
|
|
1256
|
-
import { MMDC_HELP_TEXT as MMDC_HELP_TEXT2, MMDC_VERSION as MMDC_VERSION2, MermaidBudget, MermaidError, admitMermaidLimits, darkThemeTokens, decodePngToRgba, defaultMermaidLimits, encodeRgbaToPng, getEmbeddedFont, getGlyphOutline, layoutMermaid, lightThemeTokens, measureLineWidth, measureTextBlock, mmdcCommand, normalizeLabelText, parseCssColor, parseMermaid, parseMmdcArguments as parseMmdcArguments2, rasterizeScene, renderMermaidPng, renderMermaidPngAsync, renderMermaidSvg as renderMermaidSvg2, renderMermaidSvgAsync, resolveMermaidTheme, runMmdc, serializeSceneToSvg, verifySceneGeometry } from "../safe-bash-command-mmdc/index.js";
|
|
1256
|
+
import { MMDC_HELP_TEXT as MMDC_HELP_TEXT2, MMDC_VERSION as MMDC_VERSION2, MermaidBudget, MermaidError, admitMermaidLimits, darkThemeTokens, decodePngToRgba, defaultMermaidLimits, encodeRgbaToPng, getEmbeddedFont, getGlyphOutline, layoutMermaid, lightThemeTokens, measureLineWidth, measureTextBlock, mmdcCommand, normalizeLabelText, parseCssColor, parseMermaid, parseMmdcArguments as parseMmdcArguments2, rasterizeScene, renderMermaidPdf, renderMermaidPng, renderMermaidPngAsync, renderMermaidSvg as renderMermaidSvg2, renderMermaidSvgAsync, resolveMermaidTheme, runMmdc, serializeSceneToSvg, verifySceneGeometry } from "../safe-bash-command-mmdc/index.js";
|
|
1257
1257
|
var utf8Decoder = new TextDecoder("utf-8", { fatal: true });
|
|
1258
1258
|
function createMmdcCommand(settings4) {
|
|
1259
1259
|
syncCommandEvaluators.evalSyncMmdc = evalSyncMmdc;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type MermaidThemeMode } from "./contracts.js";
|
|
2
|
-
export type MmdcOutputFormat = "svg" | "png";
|
|
2
|
+
export type MmdcOutputFormat = "svg" | "png" | "pdf";
|
|
3
3
|
export interface MmdcParsedArguments {
|
|
4
4
|
readonly action: "render" | "help" | "version";
|
|
5
5
|
readonly input: string;
|
|
@@ -25,6 +25,14 @@ export interface MmdcResult {
|
|
|
25
25
|
readonly error?: MermaidError | FsError | undefined;
|
|
26
26
|
readonly accounting: MermaidAccounting;
|
|
27
27
|
}
|
|
28
|
+
export interface MermaidPdfResult {
|
|
29
|
+
readonly pdf: Uint8Array;
|
|
30
|
+
readonly width: number;
|
|
31
|
+
readonly height: number;
|
|
32
|
+
readonly family: MermaidSvgResult["family"];
|
|
33
|
+
readonly accounting: MermaidAccounting;
|
|
34
|
+
}
|
|
35
|
+
export declare function renderMermaidPdfSteps(source: string, options?: MermaidPngRenderOptions): Generator<void, MermaidPdfResult, void>;
|
|
28
36
|
export type MmdcPlugin = VirtualShellPlugin & readonly CommandDefinition[];
|
|
29
37
|
export declare function renderMermaidSvgSteps(source: string, options?: MermaidRenderOptions): Generator<void, MermaidSvgResult, void>;
|
|
30
38
|
export declare function renderMermaidSvg(source: string, options?: MermaidRenderOptions): MermaidSvgResult;
|
|
@@ -38,3 +46,4 @@ export type MmdcCommandsOptions = MmdcSettings;
|
|
|
38
46
|
export declare function createMmdcCommands(options?: MmdcCommandsOptions): readonly CommandDefinition[];
|
|
39
47
|
export declare function renderMermaidPngAsync(source: string, options?: MermaidPngRenderOptions): Promise<MermaidPngResult>;
|
|
40
48
|
export declare function renderMermaidSvgAsync(source: string, options?: MermaidRenderOptions): Promise<MermaidSvgResult>;
|
|
49
|
+
export declare function renderMermaidPdf(source: string, options?: MermaidPngRenderOptions): MermaidPdfResult;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type DiagramFamily = "flowchart" | "sequence" | "state" | "class" | "er";
|
|
1
|
+
export type DiagramFamily = "flowchart" | "sequence" | "state" | "class" | "er" | "pie";
|
|
2
2
|
export type FlowDirection = "TB" | "TD" | "BT" | "LR" | "RL";
|
|
3
3
|
export type MermaidThemeMode = "light" | "dark" | "default" | "neutral" | "forest" | "base";
|
|
4
4
|
export type MermaidErrorCode = "E_SYNTAX" | "E_UNSUPPORTED" | "E_CONFIG" | "E_ARGUMENT" | "E_LIMIT" | "E_CANCELLED" | "E_IO";
|
|
@@ -126,7 +126,18 @@ export interface CompartmentMember {
|
|
|
126
126
|
readonly badge?: "PK" | "FK" | "UK" | undefined;
|
|
127
127
|
readonly isMethod?: boolean | undefined;
|
|
128
128
|
}
|
|
129
|
+
export interface DiagramStyle {
|
|
130
|
+
readonly fill?: string | undefined;
|
|
131
|
+
readonly stroke?: string | undefined;
|
|
132
|
+
readonly color?: string | undefined;
|
|
133
|
+
readonly strokeWidth?: number | undefined;
|
|
134
|
+
}
|
|
129
135
|
export interface DocumentNode {
|
|
136
|
+
readonly links?: readonly {
|
|
137
|
+
readonly label: string;
|
|
138
|
+
readonly href: string;
|
|
139
|
+
}[] | undefined;
|
|
140
|
+
readonly href?: string | undefined;
|
|
130
141
|
readonly id: string;
|
|
131
142
|
readonly label: string;
|
|
132
143
|
readonly shape: NodeShape;
|
|
@@ -135,13 +146,16 @@ export interface DocumentNode {
|
|
|
135
146
|
readonly attributes?: readonly CompartmentMember[] | undefined;
|
|
136
147
|
readonly methods?: readonly CompartmentMember[] | undefined;
|
|
137
148
|
readonly accent?: boolean | undefined;
|
|
149
|
+
readonly style?: DiagramStyle | undefined;
|
|
150
|
+
readonly classes?: readonly string[] | undefined;
|
|
138
151
|
readonly span?: MermaidSourceSpan | undefined;
|
|
139
152
|
}
|
|
140
153
|
export interface DocumentGroup {
|
|
141
154
|
readonly id: string;
|
|
142
155
|
readonly label: string;
|
|
143
156
|
readonly parentId?: string | undefined;
|
|
144
|
-
readonly kind: "subgraph" | "compositeState" | "namespace" | "sequenceBlock";
|
|
157
|
+
readonly kind: "subgraph" | "compositeState" | "namespace" | "sequenceBlock" | "participantBox";
|
|
158
|
+
readonly fill?: string | undefined;
|
|
145
159
|
readonly blockKeyword?: "loop" | "alt" | "opt" | undefined;
|
|
146
160
|
readonly branches?: readonly {
|
|
147
161
|
readonly label: string;
|
|
@@ -162,6 +176,7 @@ export interface DocumentEdge {
|
|
|
162
176
|
readonly activateTarget?: boolean | undefined;
|
|
163
177
|
readonly deactivateSource?: boolean | undefined;
|
|
164
178
|
readonly sequenceIndex?: number | undefined;
|
|
179
|
+
readonly style?: DiagramStyle | undefined;
|
|
165
180
|
readonly span?: MermaidSourceSpan | undefined;
|
|
166
181
|
}
|
|
167
182
|
export interface DocumentNote {
|
|
@@ -181,6 +196,12 @@ export interface SequenceActivationEvent {
|
|
|
181
196
|
export interface MermaidDocument {
|
|
182
197
|
readonly family: DiagramFamily;
|
|
183
198
|
readonly direction: FlowDirection;
|
|
199
|
+
readonly config?: Record<string, unknown> | undefined;
|
|
200
|
+
readonly slices?: readonly {
|
|
201
|
+
label: string;
|
|
202
|
+
value: number;
|
|
203
|
+
}[] | undefined;
|
|
204
|
+
readonly showData?: boolean | undefined;
|
|
184
205
|
readonly title?: string | undefined;
|
|
185
206
|
readonly description?: string | undefined;
|
|
186
207
|
readonly nodes: readonly DocumentNode[];
|
|
@@ -200,6 +221,7 @@ export interface Rect {
|
|
|
200
221
|
readonly height: number;
|
|
201
222
|
}
|
|
202
223
|
export interface SceneTextLine {
|
|
224
|
+
readonly href?: string | undefined;
|
|
203
225
|
readonly text: string;
|
|
204
226
|
readonly width: number;
|
|
205
227
|
readonly x: number;
|
|
@@ -228,6 +250,7 @@ export interface SceneDivider {
|
|
|
228
250
|
readonly stroke: string;
|
|
229
251
|
}
|
|
230
252
|
export interface SceneNode {
|
|
253
|
+
readonly href?: string | undefined;
|
|
231
254
|
readonly id: string;
|
|
232
255
|
readonly shape: NodeShape;
|
|
233
256
|
readonly x: number;
|
|
@@ -362,6 +385,15 @@ export interface MermaidScene {
|
|
|
362
385
|
readonly backgroundColor: string;
|
|
363
386
|
readonly title?: string | undefined;
|
|
364
387
|
readonly description?: string | undefined;
|
|
388
|
+
readonly slices?: readonly {
|
|
389
|
+
points: readonly Point[];
|
|
390
|
+
fill: string;
|
|
391
|
+
cx: number;
|
|
392
|
+
cy: number;
|
|
393
|
+
radius: number;
|
|
394
|
+
startAngle: number;
|
|
395
|
+
endAngle: number;
|
|
396
|
+
}[] | undefined;
|
|
365
397
|
readonly groups: readonly SceneGroup[];
|
|
366
398
|
readonly lifelines: readonly SceneLifeline[];
|
|
367
399
|
readonly activations: readonly SceneActivation[];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { admitMermaidLimits, defaultMermaidLimits, MermaidBudget, MermaidError, type CompartmentMember, type DiagramFamily, type DocumentEdge, type DocumentGroup, type DocumentNode, type DocumentNote, type EdgeLineStyle, type EdgeMarkerKind, type FlowDirection, type MermaidAccounting, type MermaidDocument, type MermaidErrorCode, type MermaidLayoutOptions, type MermaidLimits, type MermaidParseOptions, type MermaidPngRenderOptions, type MermaidPngResult, type MermaidRenderOptions, type MermaidScene, type MermaidSourceSpan, type MermaidSvgResult, type MermaidThemeMode, type MermaidThemeTokens, type MmdcSettings, type NodeShape, type PathSegment, type Point, type Rect, type SceneActivation, type SceneBadge, type SceneDivider, type SceneEdge, type SceneGroup, type SceneLabelPill, type SceneLifeline, type SceneMarker, type SceneNode, type SceneNote, type SceneTextLine, type SequenceActivationEvent } from "./contracts.js";
|
|
2
2
|
export { MMDC_HELP_TEXT, MMDC_VERSION, parseMmdcArguments, type MmdcOutputFormat, type MmdcParsedArguments } from "./arguments.js";
|
|
3
|
-
export { createMmdcCommand, mmdcCommand, mmdcCommands, renderMermaidPng, renderMermaidPngAsync, renderMermaidSvg, renderMermaidSvgAsync, runMmdc, type MmdcPlugin, type MmdcResult, type MmdcRunOptions } from "./command.js";
|
|
3
|
+
export { createMmdcCommand, mmdcCommand, mmdcCommands, renderMermaidPdf, type MermaidPdfResult, renderMermaidPng, renderMermaidPngAsync, renderMermaidSvg, renderMermaidSvgAsync, runMmdc, type MmdcPlugin, type MmdcResult, type MmdcRunOptions } from "./command.js";
|
|
4
4
|
export { getEmbeddedFont, getGlyphOutline, type EmbeddedFont, type GlyphOutline } from "./font.js";
|
|
5
5
|
export { verifySceneGeometry, type GeometryReport } from "./geometry.js";
|
|
6
6
|
export { layoutMermaid } from "./layout.js";
|