@celljs/ta-office 0.0.0-stage → 4.39.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/README.en.md ADDED
@@ -0,0 +1,12 @@
1
+ # Cell - Ta Office
2
+
3
+ A pi package that comes with Ta (on by default; turn it off in Settings → Extensions of the web client): documents, slides and sheets. Design: `docs/design/ta-works.md` 7.8.
4
+
5
+ - **Three blocks**: under Ta serve, every turn's system prompt has a `<ta-office>` section: for a document, slides or a sheet, Ta writes a `ta-doc` (Markdown, `<!-- pagebreak -->` starts a page), `ta-slides` (Markdown, a slide at each `---`, each may say `<!-- layout: title|content|two|image|number -->`) or `ta-sheet` (JSON, a cell starting with `=` is a formula) block, drawn in the reply as a document, 16:9 slides (swiped through, presented full screen) and a sheet (its column and row names held, sorted by a tap on a column).
6
+ - **Formulas**: a sheet works out a small set itself: arithmetic, comparisons, `&`, percent, references and ranges (`Sheet!A1` too), SUM/AVERAGE/COUNT/MIN/MAX/IF/ROUND; any other formula shows as written, "worked out once exported".
7
+ - **Point at a part for Ta to change**: by the headings above it in a document (`h:2.1/p:3`), by slide and box (`slide:4/box:title`), by a cell or a range dragged across (`B2:D9`): its place and its source go to Ta.
8
+ - **Change it in place**: kept as a work, its page's Edit lets the user change words (headings, paragraphs, lists, the boxes of a slide) and the values of cells, with no model; `@celljs/ta-works` keeps each change as a version by the user (those of half a minute as one) and refuses one made on an older version. Formulas are Ta's to change.
9
+ - **Export**: "Export as Word / PowerPoint / Excel" under each block, minimal OOXML written by hand (on `ZipUtil` of `@celljs/ta-protocol`), no dependency; a sheet keeps its values, its formulas as written and what Ta worked them out to (Excel works them out again as it opens it).
10
+ - **Files opened**: a .docx, .pptx or .xlsx of the workspace, from "Open in Ta" of its menu or a link of a reply, is read into such a block in a tab of the workbench (pictures, styles and charts left out), to keep as a work or export. Ta has the tools `office_read` and `office_write` too.
11
+
12
+ Reading: `web-src/office-read.ts`; writing: `web-src/office-write.ts`; the prompt: `web-src/office-prompt.ts`.
package/README.md CHANGED
@@ -1,3 +1,12 @@
1
- # Temporary Holding Version
1
+ # Cell - Ta Office
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Ta 自带的 pi 包(默认开启,可在 Web 客户端的 设置 → 扩展 关闭):文档、幻灯片和表格。设计见 `docs/design/ta-works.md` 第 7.8 节。
4
+
5
+ - **三种块**:在 Ta 服务下,每一轮的系统提示里多一段 `<ta-office>`:要写文档、幻灯片或表格时,Ta 写成 `ta-doc`(Markdown,`<!-- pagebreak -->` 分页)、`ta-slides`(Markdown,`---` 分页,每页可写 `<!-- layout: title|content|two|image|number -->`)或 `ta-sheet`(JSON,`=` 开头的格是公式)代码块,回复里直接画成文档、16:9 幻灯片(左右滑翻页、可全屏放映)和表格(列名行号固定、点列名排序)。
6
+ - **公式**:表格只自算一小组:四则运算、比较、`&`、百分号、单元格与范围引用(含 `Sheet!A1`)、SUM/AVERAGE/COUNT/MIN/MAX/IF/ROUND;其他公式原样显示并标"导出后计算"。
7
+ - **圈一块让 Ta 改**:三种块都可以指着改:文档按标题路径(`h:2.1/p:3`)、幻灯片按页和文本框(`slide:4/box:title`)、表格按单元格或拖出来的范围(`B2:D9`),把位置和那一块的原文交给 Ta。
8
+ - **点着直接改**:存成作品后,在作品页点「修改」,文字(标题、段落、列表、幻灯片文本框)和单元格的值可以就地改,不调用模型;改动由 `@celljs/ta-works` 存成一版(`by: user`,半分钟内的改动合成一版),有更新版本时拒绝并显示最新的。公式不能直接改,交给 Ta。
9
+ - **导出**:块下面的「导出为 Word / PowerPoint / Excel」,手写最小 OOXML(共用 `@celljs/ta-protocol` 的 `ZipUtil`),不加依赖;表格写值、公式原文和 Ta 算出的值(Excel 打开时会重算)。
10
+ - **打开已有文件**:工作区里的 .docx / .pptx / .xlsx 在文件菜单「在 Ta 里打开」,或回复里的文件链接,会读成上面三种块显示在工作台的标签页里(图片、样式、图表不带过来),下面可以「存下来」成作品、导出。Ta 也有 `office_read` / `office_write` 两个工具读写这些文件。
11
+
12
+ 读取见 `web-src/office-read.ts`,写出见 `web-src/office-write.ts`,提示词见 `web-src/office-prompt.ts`。