@poe-platform/safe-bash 0.1.758 → 0.1.760
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/image-ast/index.browser.js +41 -16
- package/dist/image-ast/index.js +41 -16
- package/dist/pdf-ast/ast.d.ts +8 -3
- package/dist/pdf-ast/index.js +45 -19
- package/dist/safe-bash/chunks/{chunk-WNWIBBJZ.js → chunk-CRQDMBQA.js} +130 -9
- package/dist/safe-bash/command-chunks/{chunk-L2C5TIII.js → chunk-MC4XXPQJ.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-TCAGGM44.js → chunk-S3SCPBHC.js} +41 -17
- package/dist/safe-bash/command-chunks/{chunk-XYCWDGOG.js → chunk-UCI6ZQFB.js} +1 -1
- package/dist/safe-bash/commands/python/index.browser.js +1 -1
- package/dist/safe-bash/commands/python/index.d.ts +1 -1
- package/dist/safe-bash/commands/python/llm-capability.d.ts +7 -3
- package/dist/safe-bash/commands/python/llm-capability.js +149 -10
- package/dist/safe-bash/commands/python/shell-capability.js +10 -2
- package/dist/safe-bash/core.browser.js +1 -1
- package/dist/safe-bash-command-ffmpeg/index.js +3513 -3500
- package/dist/safe-bash-command-gh/index.js +128 -27
- package/dist/safe-bash-command-imagemagick/index.js +2 -2
- package/dist/safe-bash-command-pandoc/command.js +3 -3
- package/dist/safe-bash-command-pandoc/index.js +3 -3
- package/dist/safe-bash-command-pdfimages/index.js +41 -16
- package/dist/safe-bash-command-pdfinfo/index.js +45 -19
- package/dist/safe-bash-command-pdftk/index.js +41 -16
- package/dist/safe-bash-command-pdftoppm/index.js +45 -19
- package/dist/safe-bash-command-pdftotext/index.js +41 -16
- package/dist/safe-bash-command-qpdf/index.js +41 -16
- package/dist/safe-bash-command-sips/index.js +2 -2
- package/dist/safe-bash-command-soffice/index.js +1 -1
- package/dist/safe-bash-command-ssconvert/index.js +63 -38
- package/dist/safe-bash-command-wkhtmltopdf/index.js +42 -16
- package/dist/safe-bash-io-engine/internal.d.ts +2 -2
- package/dist/safe-bash-mcp/index.d.ts +1 -1
- package/package.json +2 -2
- package/third-party/pdf-ast/THIRD_PARTY_NOTICES.md +22 -0
|
@@ -2488,6 +2488,19 @@ function formatCommandOutputSync(options) {
|
|
|
2488
2488
|
}
|
|
2489
2489
|
|
|
2490
2490
|
// packages/safe-bash-command-gh/dist/commands/issue.js
|
|
2491
|
+
function extractRepoAndSelectorFromIssueArg(selector, explicitRepoFlag) {
|
|
2492
|
+
if (selector?.startsWith("https://") || selector?.startsWith("http://")) {
|
|
2493
|
+
const url = new URL(selector);
|
|
2494
|
+
const parts = url.pathname.split("/");
|
|
2495
|
+
if (parts.length === 5 && parts[1] && parts[2] && parts[3] === "issues" && parts[4] && Number.isSafeInteger(Number(parts[4])) && Number(parts[4]) > 0) {
|
|
2496
|
+
return {
|
|
2497
|
+
repoOverride: explicitRepoFlag ?? `${url.host}/${parts[1]}/${parts[2]}`,
|
|
2498
|
+
selector: parts[4]
|
|
2499
|
+
};
|
|
2500
|
+
}
|
|
2501
|
+
}
|
|
2502
|
+
return { repoOverride: explicitRepoFlag, selector };
|
|
2503
|
+
}
|
|
2491
2504
|
var ISSUE_JSON_FIELDS = [
|
|
2492
2505
|
"assignees",
|
|
2493
2506
|
"author",
|
|
@@ -2643,9 +2656,10 @@ async function handleIssueCommand(env, rawArgs) {
|
|
|
2643
2656
|
if (subcommand === "view") {
|
|
2644
2657
|
const schemas = [{ short: "c", long: "comments", type: "boolean" }];
|
|
2645
2658
|
const parsed = parseCommandArgs(restArgs, schemas);
|
|
2646
|
-
const
|
|
2659
|
+
const { repoOverride, selector } = extractRepoAndSelectorFromIssueArg(parsed.positionals[0], parsed.repoFlag);
|
|
2660
|
+
const coords = await resolveRepoFromContext(context, repoOverride, backend.defaultHost, backend.getActiveUser());
|
|
2647
2661
|
const repo = backend.getOrCreateRepo(coords.owner, coords.name);
|
|
2648
|
-
const issue = backend.resolveIssue(repo,
|
|
2662
|
+
const issue = backend.resolveIssue(repo, selector ?? "1");
|
|
2649
2663
|
if (getBoolFlag(parsed, "web")) {
|
|
2650
2664
|
if (openBrowser)
|
|
2651
2665
|
await openBrowser(issue.url);
|
|
@@ -2691,9 +2705,10 @@ ${c.body}
|
|
|
2691
2705
|
{ short: "r", long: "reason", type: "string" }
|
|
2692
2706
|
];
|
|
2693
2707
|
const parsed = parseCommandArgs(restArgs, schemas);
|
|
2694
|
-
const
|
|
2708
|
+
const { repoOverride, selector } = extractRepoAndSelectorFromIssueArg(parsed.positionals[0], parsed.repoFlag);
|
|
2709
|
+
const coords = await resolveRepoFromContext(context, repoOverride, backend.defaultHost, backend.getActiveUser());
|
|
2695
2710
|
const repo = backend.getOrCreateRepo(coords.owner, coords.name);
|
|
2696
|
-
const issue = backend.resolveIssue(repo,
|
|
2711
|
+
const issue = backend.resolveIssue(repo, selector ?? "1");
|
|
2697
2712
|
const commentText = getStringFlag(parsed, "comment");
|
|
2698
2713
|
if (commentText) {
|
|
2699
2714
|
const id = backend.nextId();
|
|
@@ -2726,14 +2741,54 @@ ${c.body}
|
|
|
2726
2741
|
if (subcommand === "comment") {
|
|
2727
2742
|
const schemas = [
|
|
2728
2743
|
{ short: "b", long: "body", type: "string" },
|
|
2729
|
-
{ short: "F", long: "body-file", type: "string" }
|
|
2744
|
+
{ short: "F", long: "body-file", type: "string" },
|
|
2745
|
+
{ long: "edit-last", type: "boolean" },
|
|
2746
|
+
{ long: "delete-last", type: "boolean" },
|
|
2747
|
+
{ long: "create-if-none", type: "boolean" }
|
|
2730
2748
|
];
|
|
2731
2749
|
const parsed = parseCommandArgs(restArgs, schemas);
|
|
2732
|
-
const
|
|
2750
|
+
const { repoOverride, selector } = extractRepoAndSelectorFromIssueArg(parsed.positionals[0], parsed.repoFlag);
|
|
2751
|
+
const coords = await resolveRepoFromContext(context, repoOverride, backend.defaultHost, backend.getActiveUser());
|
|
2733
2752
|
const repo = backend.getOrCreateRepo(coords.owner, coords.name);
|
|
2734
|
-
const issue = backend.resolveIssue(repo,
|
|
2753
|
+
const issue = backend.resolveIssue(repo, selector ?? "1");
|
|
2754
|
+
const activeUser = backend.getActiveUser();
|
|
2755
|
+
let lastIndex = -1;
|
|
2756
|
+
for (let index = issue.comments.length - 1; index >= 0; index--) {
|
|
2757
|
+
if (issue.comments[index].author.login === activeUser) {
|
|
2758
|
+
lastIndex = index;
|
|
2759
|
+
break;
|
|
2760
|
+
}
|
|
2761
|
+
}
|
|
2762
|
+
if (getBoolFlag(parsed, "delete-last")) {
|
|
2763
|
+
if (lastIndex < 0) {
|
|
2764
|
+
await writeErr("no comments found for current user\n");
|
|
2765
|
+
return 1;
|
|
2766
|
+
}
|
|
2767
|
+
issue.comments.splice(lastIndex, 1);
|
|
2768
|
+
issue.updatedAt = backend.isoNow();
|
|
2769
|
+
await writeOut("Comment deleted\n");
|
|
2770
|
+
return 0;
|
|
2771
|
+
}
|
|
2735
2772
|
const bodyFile = getStringFlag(parsed, "body-file");
|
|
2736
2773
|
const body = bodyFile !== void 0 ? bodyFile === "-" ? stdinText : decodeUtf8(await context.fs.readFile(resolvePath2(context.cwd, bodyFile), { signal: context.signal })) : getStringFlag(parsed, "body") ?? "";
|
|
2774
|
+
if (!body) {
|
|
2775
|
+
await writeErr("body cannot be blank; provide -b/--body or -F/--body-file\n");
|
|
2776
|
+
return 1;
|
|
2777
|
+
}
|
|
2778
|
+
if (getBoolFlag(parsed, "edit-last")) {
|
|
2779
|
+
if (lastIndex >= 0) {
|
|
2780
|
+
const previous = issue.comments[lastIndex];
|
|
2781
|
+
issue.comments[lastIndex] = { ...previous, body, updatedAt: backend.isoNow() };
|
|
2782
|
+
issue.updatedAt = issue.comments[lastIndex].updatedAt;
|
|
2783
|
+
await writeOut(`${previous.url}
|
|
2784
|
+
`);
|
|
2785
|
+
return 0;
|
|
2786
|
+
}
|
|
2787
|
+
if (!getBoolFlag(parsed, "create-if-none")) {
|
|
2788
|
+
await writeErr("no comments found for current user to edit\n");
|
|
2789
|
+
return 1;
|
|
2790
|
+
}
|
|
2791
|
+
}
|
|
2737
2792
|
const id = backend.nextId();
|
|
2738
2793
|
const ts = backend.isoNow();
|
|
2739
2794
|
const c = {
|
|
@@ -2745,6 +2800,7 @@ ${c.body}
|
|
|
2745
2800
|
url: `${issue.url}#issuecomment-${id}`
|
|
2746
2801
|
};
|
|
2747
2802
|
issue.comments.push(c);
|
|
2803
|
+
issue.updatedAt = ts;
|
|
2748
2804
|
await writeOut(`${c.url}
|
|
2749
2805
|
`);
|
|
2750
2806
|
return 0;
|
|
@@ -2753,19 +2809,26 @@ ${c.body}
|
|
|
2753
2809
|
const schemas = [
|
|
2754
2810
|
{ short: "t", long: "title", type: "string" },
|
|
2755
2811
|
{ short: "b", long: "body", type: "string" },
|
|
2812
|
+
{ short: "F", long: "body-file", type: "string" },
|
|
2813
|
+
{ short: "m", long: "milestone", type: "string" },
|
|
2814
|
+
{ long: "remove-milestone", type: "boolean" },
|
|
2815
|
+
{ long: "add-project", type: "string[]" },
|
|
2816
|
+
{ long: "remove-project", type: "string[]" },
|
|
2756
2817
|
{ long: "add-label", type: "string[]" },
|
|
2757
2818
|
{ long: "remove-label", type: "string[]" },
|
|
2758
2819
|
{ long: "add-assignee", type: "string[]" },
|
|
2759
2820
|
{ long: "remove-assignee", type: "string[]" }
|
|
2760
2821
|
];
|
|
2761
2822
|
const parsed = parseCommandArgs(restArgs, schemas);
|
|
2762
|
-
const
|
|
2823
|
+
const { repoOverride, selector } = extractRepoAndSelectorFromIssueArg(parsed.positionals[0], parsed.repoFlag);
|
|
2824
|
+
const coords = await resolveRepoFromContext(context, repoOverride, backend.defaultHost, backend.getActiveUser());
|
|
2763
2825
|
const repo = backend.getOrCreateRepo(coords.owner, coords.name);
|
|
2764
|
-
const issue = backend.resolveIssue(repo,
|
|
2826
|
+
const issue = backend.resolveIssue(repo, selector ?? "1");
|
|
2765
2827
|
const title = getStringFlag(parsed, "title");
|
|
2766
2828
|
if (title !== void 0)
|
|
2767
2829
|
issue.title = title;
|
|
2768
|
-
const
|
|
2830
|
+
const bodyFile = getStringFlag(parsed, "body-file");
|
|
2831
|
+
const body = bodyFile !== void 0 ? bodyFile === "-" ? stdinText : decodeUtf8(await context.fs.readFile(resolvePath2(context.cwd, bodyFile), { signal: context.signal })) : getStringFlag(parsed, "body");
|
|
2769
2832
|
if (body !== void 0)
|
|
2770
2833
|
issue.body = body;
|
|
2771
2834
|
for (const lblName of getStringArrayFlag(parsed, "add-label")) {
|
|
@@ -2783,15 +2846,38 @@ ${c.body}
|
|
|
2783
2846
|
if (rmLabels.length > 0) {
|
|
2784
2847
|
issue.labels = issue.labels.filter((l) => !rmLabels.includes(l.name.toLowerCase()));
|
|
2785
2848
|
}
|
|
2849
|
+
for (const login of getStringArrayFlag(parsed, "add-assignee")) {
|
|
2850
|
+
const resolved = login === "@me" ? backend.getActiveUser() : login;
|
|
2851
|
+
if (!issue.assignees.some((a) => a.login.toLowerCase() === resolved.toLowerCase())) {
|
|
2852
|
+
issue.assignees.push({ login: resolved });
|
|
2853
|
+
}
|
|
2854
|
+
}
|
|
2855
|
+
const removeAssignees = getStringArrayFlag(parsed, "remove-assignee").map((login) => (login === "@me" ? backend.getActiveUser() : login).toLowerCase());
|
|
2856
|
+
issue.assignees = issue.assignees.filter((a) => !removeAssignees.includes(a.login.toLowerCase()));
|
|
2857
|
+
const milestone = getStringFlag(parsed, "milestone");
|
|
2858
|
+
if (getBoolFlag(parsed, "remove-milestone")) {
|
|
2859
|
+
issue.milestone = null;
|
|
2860
|
+
} else if (milestone !== void 0) {
|
|
2861
|
+
issue.milestone = { id: backend.nextId(), number: 1, title: milestone, description: "", state: "open" };
|
|
2862
|
+
}
|
|
2863
|
+
for (const title2 of getStringArrayFlag(parsed, "add-project")) {
|
|
2864
|
+
if (!issue.projectItems.some((project) => project.title === title2)) {
|
|
2865
|
+
issue.projectItems.push({ title: title2 });
|
|
2866
|
+
}
|
|
2867
|
+
}
|
|
2868
|
+
const removeProjects = getStringArrayFlag(parsed, "remove-project");
|
|
2869
|
+
issue.projectItems = issue.projectItems.filter((project) => !removeProjects.includes(project.title));
|
|
2870
|
+
issue.updatedAt = backend.isoNow();
|
|
2786
2871
|
await writeOut(`${issue.url}
|
|
2787
2872
|
`);
|
|
2788
2873
|
return 0;
|
|
2789
2874
|
}
|
|
2790
2875
|
if (subcommand === "delete") {
|
|
2791
2876
|
const parsed = parseCommandArgs(restArgs, []);
|
|
2792
|
-
const
|
|
2877
|
+
const { repoOverride, selector } = extractRepoAndSelectorFromIssueArg(parsed.positionals[0], parsed.repoFlag);
|
|
2878
|
+
const coords = await resolveRepoFromContext(context, repoOverride, backend.defaultHost, backend.getActiveUser());
|
|
2793
2879
|
const repo = backend.getOrCreateRepo(coords.owner, coords.name);
|
|
2794
|
-
const issue = backend.resolveIssue(repo,
|
|
2880
|
+
const issue = backend.resolveIssue(repo, selector ?? "1");
|
|
2795
2881
|
repo.issues.delete(issue.number);
|
|
2796
2882
|
await writeOut(`\u2713 Deleted issue #${issue.number}
|
|
2797
2883
|
`);
|
|
@@ -2799,9 +2885,10 @@ ${c.body}
|
|
|
2799
2885
|
}
|
|
2800
2886
|
if (subcommand === "pin" || subcommand === "unpin") {
|
|
2801
2887
|
const parsed = parseCommandArgs(restArgs, []);
|
|
2802
|
-
const
|
|
2888
|
+
const { repoOverride, selector } = extractRepoAndSelectorFromIssueArg(parsed.positionals[0], parsed.repoFlag);
|
|
2889
|
+
const coords = await resolveRepoFromContext(context, repoOverride, backend.defaultHost, backend.getActiveUser());
|
|
2803
2890
|
const repo = backend.getOrCreateRepo(coords.owner, coords.name);
|
|
2804
|
-
const issue = backend.resolveIssue(repo,
|
|
2891
|
+
const issue = backend.resolveIssue(repo, selector ?? "1");
|
|
2805
2892
|
issue.isPinned = subcommand === "pin";
|
|
2806
2893
|
await writeOut(`\u2713 ${subcommand === "pin" ? "Pinned" : "Unpinned"} issue #${issue.number}
|
|
2807
2894
|
`);
|
|
@@ -2809,9 +2896,10 @@ ${c.body}
|
|
|
2809
2896
|
}
|
|
2810
2897
|
if (subcommand === "lock" || subcommand === "unlock") {
|
|
2811
2898
|
const parsed = parseCommandArgs(restArgs, [{ short: "r", long: "reason", type: "string" }]);
|
|
2812
|
-
const
|
|
2899
|
+
const { repoOverride, selector } = extractRepoAndSelectorFromIssueArg(parsed.positionals[0], parsed.repoFlag);
|
|
2900
|
+
const coords = await resolveRepoFromContext(context, repoOverride, backend.defaultHost, backend.getActiveUser());
|
|
2813
2901
|
const repo = backend.getOrCreateRepo(coords.owner, coords.name);
|
|
2814
|
-
const issue = backend.resolveIssue(repo,
|
|
2902
|
+
const issue = backend.resolveIssue(repo, selector ?? "1");
|
|
2815
2903
|
issue.locked = subcommand === "lock";
|
|
2816
2904
|
await writeOut(`\u2713 ${subcommand === "lock" ? "Locked" : "Unlocked"} issue #${issue.number}
|
|
2817
2905
|
`);
|
|
@@ -2819,9 +2907,10 @@ ${c.body}
|
|
|
2819
2907
|
}
|
|
2820
2908
|
if (subcommand === "transfer") {
|
|
2821
2909
|
const parsed = parseCommandArgs(restArgs, []);
|
|
2822
|
-
const
|
|
2910
|
+
const { repoOverride, selector } = extractRepoAndSelectorFromIssueArg(parsed.positionals[0], parsed.repoFlag);
|
|
2911
|
+
const coords = await resolveRepoFromContext(context, repoOverride, backend.defaultHost, backend.getActiveUser());
|
|
2823
2912
|
const repo = backend.getOrCreateRepo(coords.owner, coords.name);
|
|
2824
|
-
const issue = backend.resolveIssue(repo,
|
|
2913
|
+
const issue = backend.resolveIssue(repo, selector ?? "1");
|
|
2825
2914
|
const destSpec = parsed.positionals[1];
|
|
2826
2915
|
if (!destSpec) {
|
|
2827
2916
|
await writeErr("destination repository required\n");
|
|
@@ -2848,9 +2937,10 @@ ${c.body}
|
|
|
2848
2937
|
{ short: "l", long: "list", type: "boolean" }
|
|
2849
2938
|
];
|
|
2850
2939
|
const parsed = parseCommandArgs(restArgs, schemas);
|
|
2851
|
-
const
|
|
2940
|
+
const { repoOverride, selector } = extractRepoAndSelectorFromIssueArg(parsed.positionals[0], parsed.repoFlag);
|
|
2941
|
+
const coords = await resolveRepoFromContext(context, repoOverride, backend.defaultHost, backend.getActiveUser());
|
|
2852
2942
|
const repo = backend.getOrCreateRepo(coords.owner, coords.name);
|
|
2853
|
-
const issue = backend.resolveIssue(repo,
|
|
2943
|
+
const issue = backend.resolveIssue(repo, selector ?? "1");
|
|
2854
2944
|
if (getBoolFlag(parsed, "list")) {
|
|
2855
2945
|
await writeOut(issue.linkedBranches.map((b) => `${b} ${repo.url}/tree/${b}`).join("\n") + (issue.linkedBranches.length > 0 ? "\n" : ""));
|
|
2856
2946
|
return 0;
|
|
@@ -8902,13 +8992,14 @@ Copyright (c) ${coords.owner}
|
|
|
8902
8992
|
const parsed = parseCommandArgs(rest, [{ short: "c", long: "comments", type: "boolean" }]);
|
|
8903
8993
|
if (parsed.help || getBoolFlag(parsed, "web"))
|
|
8904
8994
|
return void 0;
|
|
8905
|
-
const
|
|
8995
|
+
const { repoOverride, selector } = extractRepoAndSelectorFromIssueArg(parsed.positionals[0], parsed.repoFlag);
|
|
8996
|
+
const coords = resolveRepoSync(repoOverride, env, backend.defaultHost, backend.getActiveUser(), cwd, readFileSync);
|
|
8906
8997
|
if (!coords)
|
|
8907
8998
|
return void 0;
|
|
8908
8999
|
const repo = backend.getOrCreateRepo(coords.owner, coords.name);
|
|
8909
9000
|
let issue;
|
|
8910
9001
|
try {
|
|
8911
|
-
issue = backend.resolveIssue(repo,
|
|
9002
|
+
issue = backend.resolveIssue(repo, selector ?? "1");
|
|
8912
9003
|
} catch {
|
|
8913
9004
|
return void 0;
|
|
8914
9005
|
}
|
|
@@ -8944,13 +9035,14 @@ ${c.body}
|
|
|
8944
9035
|
{ short: "c", long: "comment", type: "string" },
|
|
8945
9036
|
{ short: "r", long: "reason", type: "string" }
|
|
8946
9037
|
]);
|
|
8947
|
-
const
|
|
9038
|
+
const { repoOverride, selector } = extractRepoAndSelectorFromIssueArg(parsed.positionals[0], parsed.repoFlag);
|
|
9039
|
+
const coords = resolveRepoSync(repoOverride, env, backend.defaultHost, backend.getActiveUser(), cwd, readFileSync);
|
|
8948
9040
|
if (!coords)
|
|
8949
9041
|
return void 0;
|
|
8950
9042
|
const repo = backend.getOrCreateRepo(coords.owner, coords.name);
|
|
8951
9043
|
let issue;
|
|
8952
9044
|
try {
|
|
8953
|
-
issue = backend.resolveIssue(repo,
|
|
9045
|
+
issue = backend.resolveIssue(repo, selector ?? "1");
|
|
8954
9046
|
} catch {
|
|
8955
9047
|
return void 0;
|
|
8956
9048
|
}
|
|
@@ -8980,17 +9072,26 @@ ${c.body}
|
|
|
8980
9072
|
`;
|
|
8981
9073
|
}
|
|
8982
9074
|
if (sub === "comment") {
|
|
8983
|
-
const parsed = parseCommandArgs(rest, [
|
|
9075
|
+
const parsed = parseCommandArgs(rest, [
|
|
9076
|
+
{ short: "b", long: "body", type: "string" },
|
|
9077
|
+
{ short: "F", long: "body-file", type: "string" },
|
|
9078
|
+
{ long: "edit-last", type: "boolean" },
|
|
9079
|
+
{ long: "delete-last", type: "boolean" },
|
|
9080
|
+
{ long: "create-if-none", type: "boolean" }
|
|
9081
|
+
]);
|
|
9082
|
+
if (["body-file", "edit-last", "delete-last", "create-if-none"].some((flag) => parsed.flags.has(flag)))
|
|
9083
|
+
return void 0;
|
|
8984
9084
|
const body = getStringFlag(parsed, "body");
|
|
8985
9085
|
if (body === void 0)
|
|
8986
9086
|
return void 0;
|
|
8987
|
-
const
|
|
9087
|
+
const { repoOverride, selector } = extractRepoAndSelectorFromIssueArg(parsed.positionals[0], parsed.repoFlag);
|
|
9088
|
+
const coords = resolveRepoSync(repoOverride, env, backend.defaultHost, backend.getActiveUser(), cwd, readFileSync);
|
|
8988
9089
|
if (!coords)
|
|
8989
9090
|
return void 0;
|
|
8990
9091
|
const repo = backend.getOrCreateRepo(coords.owner, coords.name);
|
|
8991
9092
|
let issue;
|
|
8992
9093
|
try {
|
|
8993
|
-
issue = backend.resolveIssue(repo,
|
|
9094
|
+
issue = backend.resolveIssue(repo, selector ?? "1");
|
|
8994
9095
|
} catch {
|
|
8995
9096
|
return void 0;
|
|
8996
9097
|
}
|
|
@@ -28,8 +28,8 @@ import {
|
|
|
28
28
|
thresholdImage,
|
|
29
29
|
tintImage,
|
|
30
30
|
trimImage
|
|
31
|
-
} from "../safe-bash/command-chunks/chunk-
|
|
32
|
-
import "../safe-bash/command-chunks/chunk-
|
|
31
|
+
} from "../safe-bash/command-chunks/chunk-UCI6ZQFB.js";
|
|
32
|
+
import "../safe-bash/command-chunks/chunk-S3SCPBHC.js";
|
|
33
33
|
import {
|
|
34
34
|
init_buffer
|
|
35
35
|
} from "../safe-bash/command-chunks/chunk-HX3SHTCE.js";
|
|
@@ -2,11 +2,11 @@ import {
|
|
|
2
2
|
createPandocCommand,
|
|
3
3
|
createPandocCommands,
|
|
4
4
|
pandocCommands
|
|
5
|
-
} from "../safe-bash/command-chunks/chunk-
|
|
5
|
+
} from "../safe-bash/command-chunks/chunk-MC4XXPQJ.js";
|
|
6
6
|
import "../safe-bash/command-chunks/chunk-MKQVQMXO.js";
|
|
7
7
|
import "../safe-bash/command-chunks/chunk-RDV7UCYZ.js";
|
|
8
|
-
import "../safe-bash/command-chunks/chunk-
|
|
9
|
-
import "../safe-bash/command-chunks/chunk-
|
|
8
|
+
import "../safe-bash/command-chunks/chunk-UCI6ZQFB.js";
|
|
9
|
+
import "../safe-bash/command-chunks/chunk-S3SCPBHC.js";
|
|
10
10
|
import "../safe-bash/command-chunks/chunk-Y2KHC6TZ.js";
|
|
11
11
|
import "../safe-bash/command-chunks/chunk-YGYOVXTO.js";
|
|
12
12
|
import "../safe-bash/command-chunks/chunk-I5GLTNVH.js";
|
|
@@ -21,11 +21,11 @@ import {
|
|
|
21
21
|
readDocument,
|
|
22
22
|
resolveConversionArgs,
|
|
23
23
|
writeDocument
|
|
24
|
-
} from "../safe-bash/command-chunks/chunk-
|
|
24
|
+
} from "../safe-bash/command-chunks/chunk-MC4XXPQJ.js";
|
|
25
25
|
import "../safe-bash/command-chunks/chunk-MKQVQMXO.js";
|
|
26
26
|
import "../safe-bash/command-chunks/chunk-RDV7UCYZ.js";
|
|
27
|
-
import "../safe-bash/command-chunks/chunk-
|
|
28
|
-
import "../safe-bash/command-chunks/chunk-
|
|
27
|
+
import "../safe-bash/command-chunks/chunk-UCI6ZQFB.js";
|
|
28
|
+
import "../safe-bash/command-chunks/chunk-S3SCPBHC.js";
|
|
29
29
|
import {
|
|
30
30
|
createLuaFilterCapability
|
|
31
31
|
} from "../safe-bash/command-chunks/chunk-Y2KHC6TZ.js";
|
|
@@ -656,6 +656,7 @@ var messages_default = {
|
|
|
656
656
|
"-5": "buffer error",
|
|
657
657
|
"-6": "incompatible version"
|
|
658
658
|
};
|
|
659
|
+
var Z_BUF_ERROR = -5;
|
|
659
660
|
var MAX_MEM_LEVEL = 9;
|
|
660
661
|
var HEAP_SIZE = 573;
|
|
661
662
|
var MIN_MATCH = 3;
|
|
@@ -22547,22 +22548,31 @@ function decodeFlate(bytes, parms, maxDecodedBytes = DEFAULT_MAX_DECODED_BYTES)
|
|
|
22547
22548
|
inflated = new BoundedFlateStream(bytes, maxDecodedBytes).getBytes();
|
|
22548
22549
|
} catch (error) {
|
|
22549
22550
|
if (error instanceof PdfError && error.code === "E_LIMIT") throw error;
|
|
22551
|
+
const wrapped = bytes[0] === 31 && bytes[1] === 139 || bytes.length >= 2 && (bytes[0] & 15) === 8 && bytes[0] >>> 4 <= 7 && (bytes[0] << 8 | bytes[1]) % 31 === 0;
|
|
22550
22552
|
const decoder = new Inflate({
|
|
22551
|
-
raw: !
|
|
22553
|
+
raw: !wrapped,
|
|
22552
22554
|
chunkSize: Math.max(1, Math.min(64 * 1024, maxDecodedBytes + 1))
|
|
22553
22555
|
});
|
|
22556
|
+
const chunks = [];
|
|
22554
22557
|
let length = 0;
|
|
22555
22558
|
decoder.onData = (chunk) => {
|
|
22556
22559
|
length += chunk.length;
|
|
22557
22560
|
if (length > maxDecodedBytes) {
|
|
22558
22561
|
throw new PdfError("E_LIMIT", "FlateDecode output exceeds maximum decoded byte budget");
|
|
22559
22562
|
}
|
|
22560
|
-
|
|
22563
|
+
chunks.push(chunk);
|
|
22561
22564
|
};
|
|
22562
|
-
|
|
22565
|
+
const complete = decoder.push(bytes, true);
|
|
22566
|
+
const truncated = wrapped && decoder.err === Z_BUF_ERROR && length > 0;
|
|
22567
|
+
if ((!complete || decoder.err || !decoder.ended) && !truncated) {
|
|
22563
22568
|
throw new PdfError("E_CAPABILITY", "Invalid FlateDecode compressed stream");
|
|
22564
22569
|
}
|
|
22565
|
-
inflated =
|
|
22570
|
+
inflated = new Uint8Array(length);
|
|
22571
|
+
let offset = 0;
|
|
22572
|
+
for (const chunk of chunks) {
|
|
22573
|
+
inflated.set(chunk, offset);
|
|
22574
|
+
offset += chunk.length;
|
|
22575
|
+
}
|
|
22566
22576
|
}
|
|
22567
22577
|
return applyPredictor(inflated, parms);
|
|
22568
22578
|
}
|
|
@@ -34796,7 +34806,7 @@ function resolvePageFonts(doc, resourcesDict) {
|
|
|
34796
34806
|
const glyphNames = buildFontEncodingGlyphNamesMap(encNode);
|
|
34797
34807
|
const widths = /* @__PURE__ */ new Map();
|
|
34798
34808
|
let defaultWidth = 556;
|
|
34799
|
-
const isTwoByteCid = subtype === "Type0"
|
|
34809
|
+
const isTwoByteCid = subtype === "Type0";
|
|
34800
34810
|
let fontMatrix;
|
|
34801
34811
|
let charProcs;
|
|
34802
34812
|
let fontResources;
|
|
@@ -36249,7 +36259,7 @@ function evaluateContentStreamToDisplayList(params) {
|
|
|
36249
36259
|
const [x, y] = transformPoint(st.ctm, seg.x, seg.y);
|
|
36250
36260
|
transformedSegments.push({ kind: "cubic", x1, y1, x2, y2, x, y });
|
|
36251
36261
|
} else if (seg.kind === "rect") {
|
|
36252
|
-
if (hasRotOrShear) {
|
|
36262
|
+
if (hasRotOrShear || seg.width * st.ctm[0] < 0 || seg.height * st.ctm[3] < 0) {
|
|
36253
36263
|
const [p0x, p0y] = transformPoint(st.ctm, seg.x, seg.y);
|
|
36254
36264
|
const [p1x, p1y] = transformPoint(st.ctm, seg.x + seg.width, seg.y);
|
|
36255
36265
|
const [p2x, p2y] = transformPoint(st.ctm, seg.x + seg.width, seg.y + seg.height);
|
|
@@ -36282,7 +36292,12 @@ function evaluateContentStreamToDisplayList(params) {
|
|
|
36282
36292
|
transformedSegments.push({ kind: "close" });
|
|
36283
36293
|
}
|
|
36284
36294
|
}
|
|
36285
|
-
|
|
36295
|
+
const applyClip = () => {
|
|
36296
|
+
if (!node.clip) return;
|
|
36297
|
+
st.clipPaths = [...st.clipPaths ?? [], {
|
|
36298
|
+
segments: transformedSegments,
|
|
36299
|
+
fillRule: node.clip === "W*" ? "evenodd" : "nonzero"
|
|
36300
|
+
}];
|
|
36286
36301
|
let cMinX = Infinity, cMinY = Infinity, cMaxX = -Infinity, cMaxY = -Infinity;
|
|
36287
36302
|
for (const s of transformedSegments) {
|
|
36288
36303
|
if (s.kind === "move" || s.kind === "line") {
|
|
@@ -36310,8 +36325,11 @@ function evaluateContentStreamToDisplayList(params) {
|
|
|
36310
36325
|
Math.min(st.clipRect[3], cMaxY)
|
|
36311
36326
|
] : [cMinX, cMinY, cMaxX, cMaxY];
|
|
36312
36327
|
}
|
|
36328
|
+
};
|
|
36329
|
+
if (node.paint === "n") {
|
|
36330
|
+
applyClip();
|
|
36331
|
+
break;
|
|
36313
36332
|
}
|
|
36314
|
-
if (node.paint === "n") break;
|
|
36315
36333
|
const isFill = ["f", "F", "f*", "B", "B*", "b", "b*"].includes(node.paint);
|
|
36316
36334
|
const isStroke = ["S", "s", "B", "B*", "b", "b*"].includes(node.paint);
|
|
36317
36335
|
let evaluatedFillPattern = false;
|
|
@@ -36444,7 +36462,10 @@ function evaluateContentStreamToDisplayList(params) {
|
|
|
36444
36462
|
}
|
|
36445
36463
|
}
|
|
36446
36464
|
}
|
|
36447
|
-
if (evaluatedFillPattern && !isStroke)
|
|
36465
|
+
if (evaluatedFillPattern && !isStroke) {
|
|
36466
|
+
applyClip();
|
|
36467
|
+
break;
|
|
36468
|
+
}
|
|
36448
36469
|
const fillRule = node.paint.includes("*") ? "evenodd" : "nonzero";
|
|
36449
36470
|
const ctmScale = Math.max(1e-6, Math.hypot(st.ctm[0], st.ctm[1]));
|
|
36450
36471
|
const scaledStrokeWidth = st.strokeWidth === 0 ? 0 : st.strokeWidth * ctmScale;
|
|
@@ -36464,6 +36485,7 @@ function evaluateContentStreamToDisplayList(params) {
|
|
|
36464
36485
|
...st.dashPhase !== void 0 ? { dashPhase: st.dashPhase } : {},
|
|
36465
36486
|
...st.clipRect ? { clipRect: [...st.clipRect] } : {}
|
|
36466
36487
|
} });
|
|
36488
|
+
applyClip();
|
|
36467
36489
|
break;
|
|
36468
36490
|
}
|
|
36469
36491
|
case "xobject": {
|
|
@@ -39941,8 +39963,8 @@ function segmentsToScreenEdges(segments, pageHeight, scale, closeSubpaths = fals
|
|
|
39941
39963
|
if (closeSubpaths && hasOpenSubpath && (curX !== startX || curY !== startY)) {
|
|
39942
39964
|
edges.push({ x0: curX, y0: curY, x1: startX, y1: startY });
|
|
39943
39965
|
}
|
|
39944
|
-
const [rx0, ry0] = toScreen(seg.x, seg.y
|
|
39945
|
-
const [rx1, ry1] = toScreen(seg.x + seg.width, seg.y);
|
|
39966
|
+
const [rx0, ry0] = toScreen(seg.x, seg.y);
|
|
39967
|
+
const [rx1, ry1] = toScreen(seg.x + seg.width, seg.y + seg.height);
|
|
39946
39968
|
edges.push(
|
|
39947
39969
|
{ x0: rx0, y0: ry0, x1: rx1, y1: ry0 },
|
|
39948
39970
|
{ x0: rx1, y0: ry0, x1: rx1, y1: ry1 },
|
|
@@ -40085,21 +40107,24 @@ function renderDisplayListToBitmap(displayList, options = {}) {
|
|
|
40085
40107
|
}
|
|
40086
40108
|
const aaVec = options.antialiasVector !== false;
|
|
40087
40109
|
const aaTxt = options.antialiasText !== false;
|
|
40088
|
-
|
|
40110
|
+
let cachedClips;
|
|
40111
|
+
let cachedClipMask;
|
|
40089
40112
|
const imageClipMasks = /* @__PURE__ */ new Map();
|
|
40090
40113
|
for (const original of paintOperations(displayList)) {
|
|
40091
40114
|
if (original.kind === "glyph" && (original.value.renderMode === 3 || !original.value.outline && !original.value.unicode.trim())) continue;
|
|
40092
40115
|
const operation = original.kind === "glyph" ? { kind: "path", value: glyphPaint(original.value) } : original;
|
|
40093
40116
|
const clips = original.value.clipPaths;
|
|
40094
|
-
let clipMask = clips
|
|
40117
|
+
let clipMask = clips && clips === cachedClips ? cachedClipMask : void 0;
|
|
40095
40118
|
if (clips && !clipMask) {
|
|
40096
40119
|
clipMask = new Uint8Array(width * height * 4).fill(255);
|
|
40097
|
-
for (const
|
|
40120
|
+
for (const clip of clips) {
|
|
40121
|
+
const { segments, fillRule } = "segments" in clip ? clip : { segments: clip, fillRule: "nonzero" };
|
|
40098
40122
|
const layer = new Uint8Array(width * height * 4);
|
|
40099
|
-
fillEdgesScanline4x4(layer, width, height, segmentsToScreenEdges(segments, displayList.height, scale, true), { r: 1, g: 1, b: 1 });
|
|
40123
|
+
fillEdgesScanline4x4(layer, width, height, segmentsToScreenEdges(segments, displayList.height, scale, true), { r: 1, g: 1, b: 1 }, 1, fillRule);
|
|
40100
40124
|
for (let i = 3; i < layer.length; i += 4) clipMask[i] = Math.round(clipMask[i] * layer[i] / 255);
|
|
40101
40125
|
}
|
|
40102
|
-
|
|
40126
|
+
cachedClips = clips;
|
|
40127
|
+
cachedClipMask = clipMask;
|
|
40103
40128
|
}
|
|
40104
40129
|
const imageClips = original.value.clipImages;
|
|
40105
40130
|
if (imageClips) {
|