@taloswork/ose-shared 0.1.12 → 0.1.13
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/package.json +3 -3
- package/skills/document/SKILL.md +33 -45
- package/skills/document/bin/deck-build.cjs +10482 -272
- package/skills/document/bin/deck-chart.cjs +21 -12
- package/skills/document/bin/deck-plan.cjs +11654 -42
- package/skills/document/bin/deck-qa.cjs +95 -21
- package/skills/document/bin/deck-scenario.cjs +20 -3
- package/skills/document/bin/deck-styles.cjs +1604 -0
- package/skills/document/bin/doc-convert.cjs +182 -257
- package/skills/document/bin/doc-fill.cjs +140 -19
- package/skills/document/bin/doc-gen.cjs +1903 -281
- package/skills/document/bin/doc-validate.cjs +127 -52
- package/skills/document/bin/docx-defaults.cjs +9907 -0
- package/skills/document/bin/html2pptx.cjs +35949 -31972
- package/skills/document/bin/pdf-form.cjs +8 -0
- package/skills/document/bin/pdf-ops.cjs +8 -0
- package/skills/document/bin/pptx-notes.cjs +10038 -0
- package/skills/document/bin/pptx-tokenize.cjs +19 -4
- package/skills/document/bin/template-skin.cjs +10910 -0
- package/skills/document/bin-reference.md +15 -10
- package/skills/document/catalog.json +33 -32
- package/skills/document/content-pipeline.md +79 -44
- package/skills/document/deck-design.md +55 -32
- package/skills/document/generated-visuals.md +99 -0
- package/skills/document/layouts/MAINTAINERS.md +33 -0
- package/skills/document/layouts/README.md +20 -20
- package/skills/document/layouts/big-stat.tpl +1 -1
- package/skills/document/layouts/capacity.json +1 -1
- package/skills/document/layouts/cards-3.tpl +1 -1
- package/skills/document/layouts/chart-full.tpl +1 -1
- package/skills/document/layouts/chart-kpi.tpl +1 -1
- package/skills/document/layouts/comparison.tpl +1 -1
- package/skills/document/layouts/data-table.tpl +1 -1
- package/skills/document/layouts/funnel.tpl +1 -1
- package/skills/document/layouts/gantt.tpl +1 -1
- package/skills/document/layouts/hub-flow.tpl +4 -0
- package/skills/document/layouts/icon-row.tpl +1 -1
- package/skills/document/layouts/image-grid.tpl +1 -1
- package/skills/document/layouts/matrix-2x2.tpl +1 -1
- package/skills/document/layouts/mock-qa.tpl +4 -0
- package/skills/document/layouts/profiles.json +2 -2
- package/skills/document/layouts/pyramid.tpl +1 -1
- package/skills/document/layouts/radar.tpl +1 -1
- package/skills/document/layouts/ring-progress.tpl +1 -1
- package/skills/document/layouts/slots.json +1 -1
- package/skills/document/layouts/steps-vertical.tpl +1 -1
- package/skills/document/layouts/steps.tpl +1 -1
- package/skills/document/layouts/three-kpi.tpl +1 -1
- package/skills/document/layouts/timeline.tpl +1 -1
- package/skills/document/layouts/toc-panel.tpl +1 -1
- package/skills/document/layouts/two-kpi.tpl +2 -2
- package/skills/document/layouts/versus.tpl +1 -1
- package/skills/document/packs/README.md +1 -1
- package/skills/document/pdf.md +13 -0
- package/skills/document/rewrite.md +23 -8
- package/skills/document/scenarios.json +19 -2
- package/skills/document/scenarios.schema.json +1 -0
- package/skills/document/styles/_backdrops/rimlight.html +3 -2
- package/skills/document/styles/_contract-defaults.css +6 -1
- package/skills/document/styles/_samples/_groups/biz-premium.webp +0 -0
- package/skills/document/styles/_samples/mckinsey.webp +0 -0
- package/skills/document/styles/mckinsey/backdrop.html +7 -5
- package/skills/grill-me/SKILL.md +6 -0
- package/skills/grill-me/agents/openai.yaml +5 -0
- package/skills/grilling/SKILL.md +28 -0
- package/skills/grilling/agents/openai.yaml +3 -0
|
@@ -9790,9 +9790,9 @@ var require_load = __commonJS({
|
|
|
9790
9790
|
var require_lib3 = __commonJS({
|
|
9791
9791
|
"node_modules/jszip/lib/index.js"(exports2, module2) {
|
|
9792
9792
|
"use strict";
|
|
9793
|
-
function
|
|
9794
|
-
if (!(this instanceof
|
|
9795
|
-
return new
|
|
9793
|
+
function JSZip7() {
|
|
9794
|
+
if (!(this instanceof JSZip7)) {
|
|
9795
|
+
return new JSZip7();
|
|
9796
9796
|
}
|
|
9797
9797
|
if (arguments.length) {
|
|
9798
9798
|
throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");
|
|
@@ -9801,7 +9801,7 @@ var require_lib3 = __commonJS({
|
|
|
9801
9801
|
this.comment = null;
|
|
9802
9802
|
this.root = "";
|
|
9803
9803
|
this.clone = function() {
|
|
9804
|
-
var newObj = new
|
|
9804
|
+
var newObj = new JSZip7();
|
|
9805
9805
|
for (var i in this) {
|
|
9806
9806
|
if (typeof this[i] !== "function") {
|
|
9807
9807
|
newObj[i] = this[i];
|
|
@@ -9810,16 +9810,16 @@ var require_lib3 = __commonJS({
|
|
|
9810
9810
|
return newObj;
|
|
9811
9811
|
};
|
|
9812
9812
|
}
|
|
9813
|
-
|
|
9814
|
-
|
|
9815
|
-
|
|
9816
|
-
|
|
9817
|
-
|
|
9818
|
-
|
|
9819
|
-
return new
|
|
9813
|
+
JSZip7.prototype = require_object();
|
|
9814
|
+
JSZip7.prototype.loadAsync = require_load();
|
|
9815
|
+
JSZip7.support = require_support();
|
|
9816
|
+
JSZip7.defaults = require_defaults();
|
|
9817
|
+
JSZip7.version = "3.10.1";
|
|
9818
|
+
JSZip7.loadAsync = function(content, options) {
|
|
9819
|
+
return new JSZip7().loadAsync(content, options);
|
|
9820
9820
|
};
|
|
9821
|
-
|
|
9822
|
-
module2.exports =
|
|
9821
|
+
JSZip7.external = require_external();
|
|
9822
|
+
module2.exports = JSZip7;
|
|
9823
9823
|
}
|
|
9824
9824
|
});
|
|
9825
9825
|
|
|
@@ -9850,6 +9850,7 @@ __export(pdf_extract_exports, {
|
|
|
9850
9850
|
extractPdfText: () => extractPdfText,
|
|
9851
9851
|
extractPdfTextLines: () => extractPdfTextLines,
|
|
9852
9852
|
pdfNeedsPassword: () => pdfNeedsPassword,
|
|
9853
|
+
pngPixels: () => pngPixels,
|
|
9853
9854
|
renderPdfPages: () => renderPdfPages,
|
|
9854
9855
|
scanPdfSignals: () => scanPdfSignals,
|
|
9855
9856
|
textMathHint: () => textMathHint,
|
|
@@ -10143,6 +10144,13 @@ async function renderPdfPages(bytes, pages, scale = 2, maxEdge) {
|
|
|
10143
10144
|
}
|
|
10144
10145
|
return out;
|
|
10145
10146
|
}
|
|
10147
|
+
async function pngPixels(png) {
|
|
10148
|
+
const mupdf = await loadMupdf();
|
|
10149
|
+
const pix = new mupdf.Image(png).toPixmap();
|
|
10150
|
+
const width = pix.getWidth(), height = pix.getHeight();
|
|
10151
|
+
const channels = pix.getStride() / width;
|
|
10152
|
+
return { width, height, channels, data: pix.getPixels() };
|
|
10153
|
+
}
|
|
10146
10154
|
async function extractPdfImages(bytes, pages) {
|
|
10147
10155
|
const { doc } = await openDoc(bytes);
|
|
10148
10156
|
const total = doc.countPages();
|
|
@@ -28124,6 +28132,14 @@ function decodePng(bytes) {
|
|
|
28124
28132
|
}
|
|
28125
28133
|
}
|
|
28126
28134
|
|
|
28135
|
+
// packages/core/dist/document/readable-type.js
|
|
28136
|
+
var MIN_FONT_PT = 10;
|
|
28137
|
+
var LABEL_MAX_CHARS = 24;
|
|
28138
|
+
var MIN_LABEL_FONT_PT = 8;
|
|
28139
|
+
function readableFloorPt(text) {
|
|
28140
|
+
return [...text.trim()].length <= LABEL_MAX_CHARS ? MIN_LABEL_FONT_PT : MIN_FONT_PT;
|
|
28141
|
+
}
|
|
28142
|
+
|
|
28127
28143
|
// packages/core/dist/document/text-slack.js
|
|
28128
28144
|
var SLACK_CJK_RE = /[\u3000-\u303F\u3400-\u9FFF\uF900-\uFAFF\uFF00-\uFFEF]/;
|
|
28129
28145
|
var PCT = { single: { cjk: 0.22, latin: 0.16 }, multi: { cjk: 0.1, latin: 0.06 } };
|
|
@@ -28319,9 +28335,7 @@ function lintSlideXml(slideXml, slideNumber, masterBg, expectedLang = detectDeck
|
|
|
28319
28335
|
var EMU_PER_INCH = 914400;
|
|
28320
28336
|
var DEFAULT_CANVAS = { w: 12192e3, h: 6858e3 };
|
|
28321
28337
|
var OFFCANVAS_TOL = EMU_PER_INCH / 10;
|
|
28322
|
-
var MIN_FONT_HUNDREDTHS =
|
|
28323
|
-
var LABEL_MAX_CHARS = 24;
|
|
28324
|
-
var MIN_LABEL_FONT_HUNDREDTHS = 800;
|
|
28338
|
+
var MIN_FONT_HUNDREDTHS = MIN_FONT_PT * 100;
|
|
28325
28339
|
var CHART_TEXT_RE = new RegExp(`<p:cNvPr\\b[^>]*\\bname="${CHART_TEXT_NAME}\\b`);
|
|
28326
28340
|
var OVERLAP_RATIO = 0.3;
|
|
28327
28341
|
function firstBox(block) {
|
|
@@ -28423,7 +28437,7 @@ function lintSlideGeometry(slideXml, slideNumber, canvas = DEFAULT_CANVAS) {
|
|
|
28423
28437
|
continue;
|
|
28424
28438
|
const text = unescXml(raw).trim();
|
|
28425
28439
|
const sz = /<a:rPr\b[^>]*\bsz="(\d+)"/.exec(run)?.[1];
|
|
28426
|
-
const floor =
|
|
28440
|
+
const floor = readableFloorPt(text) * 100;
|
|
28427
28441
|
if (sz && +sz < floor && (!smallest || +sz < smallest.sz)) {
|
|
28428
28442
|
smallest = { sz: +sz, text, floor };
|
|
28429
28443
|
}
|
|
@@ -28859,8 +28873,43 @@ init_pdf_extract();
|
|
|
28859
28873
|
var import_node_path3 = require("node:path");
|
|
28860
28874
|
|
|
28861
28875
|
// packages/core/dist/document/doc-validate.js
|
|
28862
|
-
var
|
|
28876
|
+
var import_jszip5 = __toESM(require_lib3(), 1);
|
|
28863
28877
|
var import_pdf_lib2 = __toESM(require_cjs(), 1);
|
|
28878
|
+
|
|
28879
|
+
// packages/core/dist/document/pptx-notes.js
|
|
28880
|
+
var import_jszip3 = __toESM(require_lib3(), 1);
|
|
28881
|
+
var REL_NS = "http://schemas.openxmlformats.org/officeDocument/2006/relationships";
|
|
28882
|
+
var NOTES_SLIDE_REL = `${REL_NS}/notesSlide`;
|
|
28883
|
+
var NOTES_MASTER_REL = `${REL_NS}/notesMaster`;
|
|
28884
|
+
var SLIDE_REL = `${REL_NS}/slide`;
|
|
28885
|
+
async function notesKeynoteIssues(zip) {
|
|
28886
|
+
const out = [];
|
|
28887
|
+
for (const p of Object.keys(zip.files).filter((p2) => /^ppt\/notesSlides\/notesSlide\d+\.xml$/.test(p2)).sort()) {
|
|
28888
|
+
const xml = await zip.file(p).async("string");
|
|
28889
|
+
if (!/<p:clrMapOvr\b/.test(xml))
|
|
28890
|
+
out.push(p);
|
|
28891
|
+
}
|
|
28892
|
+
return out;
|
|
28893
|
+
}
|
|
28894
|
+
async function unlistedNotesMaster(zip) {
|
|
28895
|
+
const relsFile = zip.file("ppt/_rels/presentation.xml.rels");
|
|
28896
|
+
const presFile = zip.file("ppt/presentation.xml");
|
|
28897
|
+
if (!relsFile || !presFile)
|
|
28898
|
+
return null;
|
|
28899
|
+
const rel = new RegExp(`<Relationship\\b[^>]*Type="${NOTES_MASTER_REL}"[^>]*>`).exec(await relsFile.async("string"))?.[0];
|
|
28900
|
+
const rid = rel ? /\bId="([^"]+)"/.exec(rel)?.[1] : void 0;
|
|
28901
|
+
if (!rid)
|
|
28902
|
+
return null;
|
|
28903
|
+
return /<p:notesMasterId\b/.test(await presFile.async("string")) ? null : rid;
|
|
28904
|
+
}
|
|
28905
|
+
|
|
28906
|
+
// packages/core/dist/document/docx-defaults.js
|
|
28907
|
+
var import_jszip4 = __toESM(require_lib3(), 1);
|
|
28908
|
+
function hasDefaultParagraphStyle(stylesXml) {
|
|
28909
|
+
return [...stylesXml.matchAll(/<w:style\b[^>]*>/g)].some(([tag]) => /\bw:type="paragraph"/.test(tag) && /\bw:default="(1|true|on)"/.test(tag));
|
|
28910
|
+
}
|
|
28911
|
+
|
|
28912
|
+
// packages/core/dist/document/doc-validate.js
|
|
28864
28913
|
function looksLikePdf(bytes) {
|
|
28865
28914
|
const head = Buffer.from(bytes.subarray(0, 1024)).toString("latin1");
|
|
28866
28915
|
return head.includes("%PDF-");
|
|
@@ -29040,7 +29089,7 @@ async function validateOoxml(bytes) {
|
|
|
29040
29089
|
const result = (kind) => ({ ok: errors.length === 0, kind, errors, warnings });
|
|
29041
29090
|
let zip;
|
|
29042
29091
|
try {
|
|
29043
|
-
zip = await
|
|
29092
|
+
zip = await import_jszip5.default.loadAsync(Buffer.from(bytes));
|
|
29044
29093
|
} catch (e) {
|
|
29045
29094
|
errors.push({ code: "zip-unreadable", message: `not a readable OOXML zip: ${e.message}` });
|
|
29046
29095
|
return result("unknown");
|
|
@@ -29108,6 +29157,30 @@ async function validateOoxml(bytes) {
|
|
|
29108
29157
|
}
|
|
29109
29158
|
}
|
|
29110
29159
|
}
|
|
29160
|
+
if (root.kind === "pptx") {
|
|
29161
|
+
const bad = await notesKeynoteIssues(zip);
|
|
29162
|
+
if (bad.length) {
|
|
29163
|
+
errors.push({
|
|
29164
|
+
code: "notes-keynote",
|
|
29165
|
+
part: bad[0],
|
|
29166
|
+
message: `${bad.length} notes slide(s) lack <p:clrMapOvr> (${bad.slice(0, 3).join(", ")}${bad.length > 3 ? ", \u2026" : ""}) \u2014 Keynote refuses the whole file ("\u6587\u4EF6\u683C\u5F0F\u65E0\u6548"). Repair with \`pptx-notes <in.pptx> {} <out.pptx>\`; write notes with pptx-notes, never by hand`
|
|
29167
|
+
});
|
|
29168
|
+
}
|
|
29169
|
+
}
|
|
29170
|
+
if (root.kind === "pptx" && await unlistedNotesMaster(zip)) {
|
|
29171
|
+
errors.push({
|
|
29172
|
+
code: "notes-keynote",
|
|
29173
|
+
part: "ppt/presentation.xml",
|
|
29174
|
+
message: 'the notes master is not listed in <p:notesMasterIdLst> (python-pptx leaves it out) \u2014 Keynote refuses the whole file ("\u6587\u4EF6\u683C\u5F0F\u65E0\u6548"). Repair with `pptx-notes <in.pptx> {} <out.pptx>`'
|
|
29175
|
+
});
|
|
29176
|
+
}
|
|
29177
|
+
if (root.kind === "docx" && has("word/styles.xml") && !hasDefaultParagraphStyle(await text("word/styles.xml"))) {
|
|
29178
|
+
errors.push({
|
|
29179
|
+
code: "docx-default-style",
|
|
29180
|
+
part: "word/styles.xml",
|
|
29181
|
+
message: 'no default paragraph style (w:default="1", usually "Normal") \u2014 Word fills the gap, but Pages lays every unstyled paragraph out like the one before it (a centred title turns the whole body huge and centred). Repair with `docx-defaults <in.docx> <out.docx>`; docx from doc-gen already has it'
|
|
29182
|
+
});
|
|
29183
|
+
}
|
|
29111
29184
|
return result(root.kind);
|
|
29112
29185
|
}
|
|
29113
29186
|
|
|
@@ -29115,7 +29188,7 @@ async function validateOoxml(bytes) {
|
|
|
29115
29188
|
var import_node_path2 = require("node:path");
|
|
29116
29189
|
var import_node_url2 = require("node:url");
|
|
29117
29190
|
var import_promises = require("node:fs/promises");
|
|
29118
|
-
var
|
|
29191
|
+
var import_jszip6 = __toESM(require_lib3(), 1);
|
|
29119
29192
|
var _xmllint = null;
|
|
29120
29193
|
function loadXmllint() {
|
|
29121
29194
|
if (!_xmllint) {
|
|
@@ -29171,7 +29244,7 @@ function errText(e) {
|
|
|
29171
29244
|
}
|
|
29172
29245
|
async function validateOoxmlStrict(bytes, schemaDir) {
|
|
29173
29246
|
const [{ validateXML }, schemas] = await Promise.all([loadXmllint(), loadSchemaSet(schemaDir)]);
|
|
29174
|
-
const zip = await
|
|
29247
|
+
const zip = await import_jszip6.default.loadAsync(Buffer.from(bytes));
|
|
29175
29248
|
const checked = [];
|
|
29176
29249
|
const skipped = [];
|
|
29177
29250
|
const errors = [];
|
|
@@ -29319,6 +29392,7 @@ async function main() {
|
|
|
29319
29392
|
const requireOffice = args.includes("--require-office");
|
|
29320
29393
|
const usage = "usage: deck-qa <file.pptx> [--json] [--rendered <office.pdf> | --final [--cache-dir <dir>] [--require-office]]";
|
|
29321
29394
|
if (!file) die(usage, 64);
|
|
29395
|
+
if (/\.html?$/i.test(file)) die("deck-qa checks the exported .pptx, not the HTML. While authoring: `html2pptx deck.html --preview-dir <dir> --style <id>` (previews to look at); the lint runs on every export \u2014 `html2pptx deck.html out.pptx --style <id>` prints it as `qa`. Sign off once with `deck-qa out.pptx --final`.", 64);
|
|
29322
29396
|
if (!/\.pptx$/i.test(file)) die("deck-qa only lints .pptx decks", 64);
|
|
29323
29397
|
if (rendered && !/\.pdf$/i.test(rendered)) die("--rendered takes the .pdf doc-convert wrote for this deck", 64);
|
|
29324
29398
|
if (final && rendered) die("--final renders the deck itself; drop --rendered", 64);
|
|
@@ -13,8 +13,8 @@ var SCENARIO_MATRIX = {
|
|
|
13
13
|
"\u6545\u4E8B\u9A71\u52A8"
|
|
14
14
|
],
|
|
15
15
|
"density": [
|
|
16
|
-
"\
|
|
17
|
-
"\u5927\u6570\u5B57"
|
|
16
|
+
"\u4E2D",
|
|
17
|
+
"\u5927\u6570\u5B57+\u4E00\u53E5\u89E3\u91CA"
|
|
18
18
|
],
|
|
19
19
|
"requiredSections": [
|
|
20
20
|
{
|
|
@@ -490,6 +490,11 @@ var SCENARIO_MATRIX = {
|
|
|
490
490
|
{
|
|
491
491
|
"id": "\u5DE5\u4F5C\u6C47\u62A5",
|
|
492
492
|
"subtitle": "\u5468\u6708\u5B63\u62A5",
|
|
493
|
+
"aliases": [
|
|
494
|
+
"\u5468\u62A5",
|
|
495
|
+
"\u6708\u62A5",
|
|
496
|
+
"\u5B63\u62A5"
|
|
497
|
+
],
|
|
493
498
|
"tone": [
|
|
494
499
|
"\u5BA2\u89C2",
|
|
495
500
|
"\u7B80\u6D01",
|
|
@@ -612,6 +617,9 @@ var SCENARIO_MATRIX = {
|
|
|
612
617
|
},
|
|
613
618
|
{
|
|
614
619
|
"id": "\u9879\u76EE\u7ACB\u9879/\u8BC4\u5BA1",
|
|
620
|
+
"aliases": [
|
|
621
|
+
"\u7ACB\u9879"
|
|
622
|
+
],
|
|
615
623
|
"tone": [
|
|
616
624
|
"\u4E25\u8C28",
|
|
617
625
|
"\u8BF4\u670D"
|
|
@@ -681,6 +689,9 @@ var SCENARIO_MATRIX = {
|
|
|
681
689
|
},
|
|
682
690
|
{
|
|
683
691
|
"id": "\u5E74\u5EA6\u603B\u7ED3/\u5E74\u4F1A",
|
|
692
|
+
"aliases": [
|
|
693
|
+
"\u5E74\u7EC8\u603B\u7ED3"
|
|
694
|
+
],
|
|
684
695
|
"tone": [
|
|
685
696
|
"\u632F\u594B",
|
|
686
697
|
"\u4EEA\u5F0F\u611F"
|
|
@@ -884,6 +895,9 @@ var SCENARIO_MATRIX = {
|
|
|
884
895
|
},
|
|
885
896
|
{
|
|
886
897
|
"id": "\u653F\u52A1/\u515A\u653F\u6C47\u62A5",
|
|
898
|
+
"aliases": [
|
|
899
|
+
"\u653F\u52A1\u6C47\u62A5"
|
|
900
|
+
],
|
|
887
901
|
"tone": [
|
|
888
902
|
"\u4E25\u8083",
|
|
889
903
|
"\u89C4\u8303"
|
|
@@ -944,6 +958,9 @@ var SCENARIO_MATRIX = {
|
|
|
944
958
|
},
|
|
945
959
|
{
|
|
946
960
|
"id": "\u516C\u53F8/\u4EA7\u54C1\u4ECB\u7ECD",
|
|
961
|
+
"aliases": [
|
|
962
|
+
"\u516C\u53F8\u4ECB\u7ECD"
|
|
963
|
+
],
|
|
947
964
|
"tone": [
|
|
948
965
|
"\u54C1\u724C",
|
|
949
966
|
"\u81EA\u4FE1",
|
|
@@ -1305,7 +1322,7 @@ function findScenario(m, text2) {
|
|
|
1305
1322
|
return exact;
|
|
1306
1323
|
let best;
|
|
1307
1324
|
for (const row2 of m.scenarios) {
|
|
1308
|
-
const aliases = [...row2.id.split("/"), ...(row2.subtitle ?? "").split(/[\s/]+/)];
|
|
1325
|
+
const aliases = [...row2.id.split("/"), ...(row2.subtitle ?? "").split(/[\s/]+/), ...row2.aliases ?? []];
|
|
1309
1326
|
for (const alias of aliases) {
|
|
1310
1327
|
const a = alias.trim().toLowerCase();
|
|
1311
1328
|
if (a.length < 2 || !hay.includes(a))
|