@taloswork/ose-shared 0.1.5 → 0.1.6
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
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@taloswork/ose-shared",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.6",
|
|
4
4
|
"description": "Talos cross-OSE shared library — skills + MCP servers auto-loaded into every OSE (P93 2026-07-27).",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
@@ -10,6 +10,6 @@
|
|
|
10
10
|
"publishConfig": {
|
|
11
11
|
"access": "public"
|
|
12
12
|
},
|
|
13
|
-
"_talosPublishHash": "sha256-
|
|
14
|
-
"_talosPublishedAt": "2026-09-
|
|
13
|
+
"_talosPublishHash": "sha256-CLI4WbNNvJRRbZYx7qniS0d-cVs5XiJlcU904jHxDww",
|
|
14
|
+
"_talosPublishedAt": "2026-09-06T18:53:54.545Z"
|
|
15
15
|
}
|
|
@@ -147660,6 +147660,7 @@ async function imagesToPptx(imagesBase64Png) {
|
|
|
147660
147660
|
}
|
|
147661
147661
|
|
|
147662
147662
|
// packages/core/dist/document/html-pptx-walker.js
|
|
147663
|
+
var DOCUMENT_CAPTURE_DENSITY = 2;
|
|
147663
147664
|
var LAYOUT_WALKER_JS = `
|
|
147664
147665
|
(() => {
|
|
147665
147666
|
const sections = [...document.querySelectorAll("section.slide")];
|
|
@@ -148118,13 +148119,22 @@ async function withHeadlessPage(html, fn) {
|
|
|
148118
148119
|
if (!chromium) return null;
|
|
148119
148120
|
const browser2 = await chromium.launch();
|
|
148120
148121
|
try {
|
|
148121
|
-
const page = await browser2.newPage({
|
|
148122
|
+
const page = await browser2.newPage({
|
|
148123
|
+
viewport: { width: 1280, height: 720 },
|
|
148124
|
+
deviceScaleFactor: DOCUMENT_CAPTURE_DENSITY
|
|
148125
|
+
});
|
|
148122
148126
|
await page.setContent(html, { waitUntil: "load" });
|
|
148123
148127
|
await page.evaluate("document.fonts && document.fonts.ready").catch(() => {
|
|
148124
148128
|
});
|
|
148125
148129
|
const adapter = {
|
|
148126
148130
|
evaluate: (script) => page.evaluate(script),
|
|
148127
|
-
screenshot: (clip) =>
|
|
148131
|
+
screenshot: async (clip) => {
|
|
148132
|
+
const png = await page.screenshot({ clip });
|
|
148133
|
+
const w = png.readUInt32BE(16), h = png.readUInt32BE(20);
|
|
148134
|
+
const want = [clip.width * DOCUMENT_CAPTURE_DENSITY, clip.height * DOCUMENT_CAPTURE_DENSITY];
|
|
148135
|
+
if (w !== want[0] || h !== want[1]) throw new Error(`captured ${w}x${h}, expected ${want[0]}x${want[1]}`);
|
|
148136
|
+
return png;
|
|
148137
|
+
}
|
|
148128
148138
|
};
|
|
148129
148139
|
return await fn(adapter);
|
|
148130
148140
|
} finally {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
---
|
|
2
|
-
name: image-
|
|
2
|
+
name: image-layout
|
|
3
3
|
description: "Use this skill whenever the user wants EXISTING images combined or altered as pixels — 拼图 / 拼接 / 拼一张 / 宫格 / 九宫格 / 长图 / 对比图 / 前后对比 / 加水印 / 加标签 / 加边框 / 裁剪 / 圆角 / 缩放, or stitch / combine / merge images / collage / contact sheet / side-by-side / before-after / watermark / label / crop / round corners / resize. Examples: 'combine these four into one picture', '把生成的几张图拼成九宫格', 'add a caption under each'. Method: HTML+CSS rendered by this skill's bin/html2img.cjs. The mechanical test: if the images do not exist as files yet, this is NOT the skill. Do NOT trigger for: generating NEW images, INCLUDING when the request names a layout word — '生成一张九宫格的图' asks for ONE generated picture whose COMPOSITION is a grid, not for tiling existing files; documents / PDF / PowerPoint (document skill); Xiaohongshu cards (talos-xhs-ops); or upscaling / background removal / content-aware fill, which need a model, not CSS."
|
|
4
4
|
license: Proprietary. LICENSE.txt has complete terms
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
# Image
|
|
7
|
+
# Image layout
|
|
8
8
|
|
|
9
9
|
Combining or restyling images that **already exist** — as files on disk. You
|
|
10
10
|
write a layout in HTML+CSS; Chromium renders it to one PNG.
|
|
@@ -43,6 +43,21 @@ bin/html2img.cjs <in.html> <out.png> [--width N] [--max-height N]
|
|
|
43
43
|
|
|
44
44
|
Then deliver the result with `present_file` — one call, the composed image.
|
|
45
45
|
|
|
46
|
+
## Where the images are
|
|
47
|
+
|
|
48
|
+
Pictures the user attached to the turn are **already on disk**: in `attachments/`
|
|
49
|
+
relative to your working directory (the session workspace), named `image_0.png`,
|
|
50
|
+
`image_1.png`, … — or by their original filename when they had one. The prompt
|
|
51
|
+
also carries an `[Attachment on disk: <path>]` marker for each.
|
|
52
|
+
|
|
53
|
+
```
|
|
54
|
+
ls attachments/
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Start there. **Do not scan the filesystem for them** (`find / -name "*.png"` and
|
|
58
|
+
friends): it is slow, it burns the turn, and the answer was one `ls` away.
|
|
59
|
+
Write your HTML in that same directory so the `<img src>` paths stay short.
|
|
60
|
+
|
|
46
61
|
## Rules that keep the output right
|
|
47
62
|
|
|
48
63
|
- **Give every cell an explicit pixel size.** The canvas width is arithmetic, and
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
"use strict";
|
|
3
3
|
|
|
4
|
-
// apps/admin/data/skills.lib/image-
|
|
4
|
+
// apps/admin/data/skills.lib/image-layout/bin-src/html2img.mjs
|
|
5
5
|
var import_promises = require("node:fs/promises");
|
|
6
6
|
var import_node_path2 = require("node:path");
|
|
7
7
|
|
|
@@ -53,7 +53,7 @@ function localFileUrl(ref, baseDir) {
|
|
|
53
53
|
return (0, import_node_fs.existsSync)(path) ? (0, import_node_url.pathToFileURL)(path).href : void 0;
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
-
// apps/admin/data/skills.lib/image-
|
|
56
|
+
// apps/admin/data/skills.lib/image-layout/bin-src/html2img.mjs
|
|
57
57
|
function die(msg, code = 1) {
|
|
58
58
|
process.stderr.write(`html2img: ${msg}
|
|
59
59
|
`);
|
|
File without changes
|