@celljs/ta-share 4.28.0 → 4.29.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/host/index.mjs +48 -2
- package/package.json +4 -4
- package/web/index.js +48 -2
package/host/index.mjs
CHANGED
|
@@ -2484,6 +2484,40 @@ var TaAgentSummary;
|
|
|
2484
2484
|
}
|
|
2485
2485
|
TaAgentSummary2.strip = strip;
|
|
2486
2486
|
})(TaAgentSummary || (TaAgentSummary = {}));
|
|
2487
|
+
var TaPictureNote;
|
|
2488
|
+
(function(TaPictureNote2) {
|
|
2489
|
+
TaPictureNote2.OPEN = "<pictures>";
|
|
2490
|
+
TaPictureNote2.CLOSE = "</pictures>";
|
|
2491
|
+
const BLOCK = /[ \t]*<pictures>([\s\S]*?)(?:<\/pictures>|$)|<p(?:i(?:c(?:t(?:u(?:r(?:es?)?)?)?)?)?)?$/gi;
|
|
2492
|
+
const ROW = /(?:^|\s)[-*]?\s*p(\d+)\s*[::]\s*/gi;
|
|
2493
|
+
function take(text) {
|
|
2494
|
+
const told = new Map;
|
|
2495
|
+
if (!/<p/i.test(text)) {
|
|
2496
|
+
return { said: text, told };
|
|
2497
|
+
}
|
|
2498
|
+
const said = text.replace(BLOCK, (_all, body) => {
|
|
2499
|
+
const rows = [...(body !== null && body !== undefined ? body : "").matchAll(ROW)];
|
|
2500
|
+
rows.forEach((row, index) => {
|
|
2501
|
+
var _a;
|
|
2502
|
+
var _b, _c;
|
|
2503
|
+
const end = (_b = (_a = rows[index + 1]) === null || _a === undefined ? undefined : _a.index) !== null && _b !== undefined ? _b : body === null || body === undefined ? undefined : body.length;
|
|
2504
|
+
const what = body === null || body === undefined ? undefined : body.slice(((_c = row.index) !== null && _c !== undefined ? _c : 0) + row[0].length, end).trim();
|
|
2505
|
+
if (what) {
|
|
2506
|
+
told.set(Number(row[1]), what);
|
|
2507
|
+
}
|
|
2508
|
+
});
|
|
2509
|
+
return "";
|
|
2510
|
+
});
|
|
2511
|
+
return { said: said === text ? text : said.replace(/\n{3,}/g, `
|
|
2512
|
+
|
|
2513
|
+
`).trim(), told };
|
|
2514
|
+
}
|
|
2515
|
+
TaPictureNote2.take = take;
|
|
2516
|
+
function strip(text) {
|
|
2517
|
+
return take(text).said;
|
|
2518
|
+
}
|
|
2519
|
+
TaPictureNote2.strip = strip;
|
|
2520
|
+
})(TaPictureNote || (TaPictureNote = {}));
|
|
2487
2521
|
var TaSkillUse;
|
|
2488
2522
|
(function(TaSkillUse2) {
|
|
2489
2523
|
const BLOCK = /^<skill name="([^"]+)" location="([^"]+)">\n([\s\S]*?)\n<\/skill>(?:\n\n([\s\S]+))?$/;
|
|
@@ -2601,7 +2635,8 @@ var TaSaid;
|
|
|
2601
2635
|
["image note", /\[Image: original \d+x\d+|\[Image converted from /],
|
|
2602
2636
|
["skill", /<skill name="|<\/skill>/],
|
|
2603
2637
|
["task note", /<\/?task_(?:update|adopted|renamed)\b/],
|
|
2604
|
-
["summary", /<\/?(?:conversation_history_summary|summary)>/]
|
|
2638
|
+
["summary", /<\/?(?:conversation_history_summary|summary)>/],
|
|
2639
|
+
["pictures described", /<\/?pictures>/]
|
|
2605
2640
|
];
|
|
2606
2641
|
function text(content, joiner = `
|
|
2607
2642
|
`) {
|
|
@@ -2612,7 +2647,7 @@ var TaSaid;
|
|
|
2612
2647
|
}
|
|
2613
2648
|
TaSaid2.text = text;
|
|
2614
2649
|
function words(role, text2, options = {}) {
|
|
2615
|
-
const said = role === "user" ? userWords(text2) : TaAgentSummary.strip(text2);
|
|
2650
|
+
const said = role === "user" ? userWords(text2) : TaPictureNote.strip(TaAgentSummary.strip(text2));
|
|
2616
2651
|
return withoutFences(said, (language) => options.cards === false && CARD.test(language), true).trim();
|
|
2617
2652
|
}
|
|
2618
2653
|
TaSaid2.words = words;
|
|
@@ -2731,6 +2766,17 @@ Switched to voice.`, said: "Switched to voice." },
|
|
|
2731
2766
|
{ mark: "a card alone", role: "assistant", text: '```ta-glance\n{"status":"done","blocks":[]}\n```' },
|
|
2732
2767
|
{ mark: "a proposal", role: "assistant", text: 'Committed.\n\n```ta-propose\n{"kind":"git.push","title":"Push"}\n```', said: "Committed." },
|
|
2733
2768
|
{ mark: "what a call says aloud", role: "assistant", text: "All fixed.\n\n```ta-say\nIt is fixed.\n```", said: "All fixed." },
|
|
2769
|
+
{
|
|
2770
|
+
mark: "pictures described after the answer",
|
|
2771
|
+
role: "assistant",
|
|
2772
|
+
text: `The left one.
|
|
2773
|
+
|
|
2774
|
+
<pictures> p1: two cats on a sofa. p2: a chart of sales, "Q4". </pictures>`,
|
|
2775
|
+
said: "The left one."
|
|
2776
|
+
},
|
|
2777
|
+
{ mark: "pictures described as it streams", role: "assistant", text: `The left one.
|
|
2778
|
+
<pictures>
|
|
2779
|
+
p1: two ca`, said: "The left one." },
|
|
2734
2780
|
{ mark: "a tag not known yet", role: "assistant", text: `<system-reminder>
|
|
2735
2781
|
</system-reminder>
|
|
2736
2782
|
Ready.`, said: "Ready." }
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@celljs/ta-share",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.29.0",
|
|
4
4
|
"description": "A pi package for Ta: share a conversation, a page or a file by a link, public, with a password or for yourself, end to end through the relay; open and import what others share",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"pi-package"
|
|
@@ -27,9 +27,9 @@
|
|
|
27
27
|
"watch": "tsc -b -w --preserveWatchOutput"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"@celljs/ta-protocol": "4.
|
|
31
|
-
"@celljs/ta-relay": "4.
|
|
32
|
-
"@celljs/ta-web": "4.
|
|
30
|
+
"@celljs/ta-protocol": "4.29.0",
|
|
31
|
+
"@celljs/ta-relay": "4.29.0",
|
|
32
|
+
"@celljs/ta-web": "4.29.0",
|
|
33
33
|
"@types/react": "^19.3.0"
|
|
34
34
|
},
|
|
35
35
|
"publishConfig": {
|
package/web/index.js
CHANGED
|
@@ -1535,6 +1535,40 @@ var TaAgentSummary;
|
|
|
1535
1535
|
}
|
|
1536
1536
|
TaAgentSummary2.strip = strip;
|
|
1537
1537
|
})(TaAgentSummary || (TaAgentSummary = {}));
|
|
1538
|
+
var TaPictureNote;
|
|
1539
|
+
(function(TaPictureNote2) {
|
|
1540
|
+
TaPictureNote2.OPEN = "<pictures>";
|
|
1541
|
+
TaPictureNote2.CLOSE = "</pictures>";
|
|
1542
|
+
const BLOCK = /[ \t]*<pictures>([\s\S]*?)(?:<\/pictures>|$)|<p(?:i(?:c(?:t(?:u(?:r(?:es?)?)?)?)?)?)?$/gi;
|
|
1543
|
+
const ROW = /(?:^|\s)[-*]?\s*p(\d+)\s*[::]\s*/gi;
|
|
1544
|
+
function take(text) {
|
|
1545
|
+
const told = new Map;
|
|
1546
|
+
if (!/<p/i.test(text)) {
|
|
1547
|
+
return { said: text, told };
|
|
1548
|
+
}
|
|
1549
|
+
const said = text.replace(BLOCK, (_all, body) => {
|
|
1550
|
+
const rows = [...(body !== null && body !== undefined ? body : "").matchAll(ROW)];
|
|
1551
|
+
rows.forEach((row, index) => {
|
|
1552
|
+
var _a;
|
|
1553
|
+
var _b, _c;
|
|
1554
|
+
const end = (_b = (_a = rows[index + 1]) === null || _a === undefined ? undefined : _a.index) !== null && _b !== undefined ? _b : body === null || body === undefined ? undefined : body.length;
|
|
1555
|
+
const what = body === null || body === undefined ? undefined : body.slice(((_c = row.index) !== null && _c !== undefined ? _c : 0) + row[0].length, end).trim();
|
|
1556
|
+
if (what) {
|
|
1557
|
+
told.set(Number(row[1]), what);
|
|
1558
|
+
}
|
|
1559
|
+
});
|
|
1560
|
+
return "";
|
|
1561
|
+
});
|
|
1562
|
+
return { said: said === text ? text : said.replace(/\n{3,}/g, `
|
|
1563
|
+
|
|
1564
|
+
`).trim(), told };
|
|
1565
|
+
}
|
|
1566
|
+
TaPictureNote2.take = take;
|
|
1567
|
+
function strip(text) {
|
|
1568
|
+
return take(text).said;
|
|
1569
|
+
}
|
|
1570
|
+
TaPictureNote2.strip = strip;
|
|
1571
|
+
})(TaPictureNote || (TaPictureNote = {}));
|
|
1538
1572
|
var TaSkillUse;
|
|
1539
1573
|
(function(TaSkillUse2) {
|
|
1540
1574
|
const BLOCK = /^<skill name="([^"]+)" location="([^"]+)">\n([\s\S]*?)\n<\/skill>(?:\n\n([\s\S]+))?$/;
|
|
@@ -1652,7 +1686,8 @@ var TaSaid;
|
|
|
1652
1686
|
["image note", /\[Image: original \d+x\d+|\[Image converted from /],
|
|
1653
1687
|
["skill", /<skill name="|<\/skill>/],
|
|
1654
1688
|
["task note", /<\/?task_(?:update|adopted|renamed)\b/],
|
|
1655
|
-
["summary", /<\/?(?:conversation_history_summary|summary)>/]
|
|
1689
|
+
["summary", /<\/?(?:conversation_history_summary|summary)>/],
|
|
1690
|
+
["pictures described", /<\/?pictures>/]
|
|
1656
1691
|
];
|
|
1657
1692
|
function text(content, joiner = `
|
|
1658
1693
|
`) {
|
|
@@ -1663,7 +1698,7 @@ var TaSaid;
|
|
|
1663
1698
|
}
|
|
1664
1699
|
TaSaid2.text = text;
|
|
1665
1700
|
function words(role, text2, options = {}) {
|
|
1666
|
-
const said = role === "user" ? userWords(text2) : TaAgentSummary.strip(text2);
|
|
1701
|
+
const said = role === "user" ? userWords(text2) : TaPictureNote.strip(TaAgentSummary.strip(text2));
|
|
1667
1702
|
return withoutFences(said, (language) => options.cards === false && CARD.test(language), true).trim();
|
|
1668
1703
|
}
|
|
1669
1704
|
TaSaid2.words = words;
|
|
@@ -1782,6 +1817,17 @@ Switched to voice.`, said: "Switched to voice." },
|
|
|
1782
1817
|
{ mark: "a card alone", role: "assistant", text: '```ta-glance\n{"status":"done","blocks":[]}\n```' },
|
|
1783
1818
|
{ mark: "a proposal", role: "assistant", text: 'Committed.\n\n```ta-propose\n{"kind":"git.push","title":"Push"}\n```', said: "Committed." },
|
|
1784
1819
|
{ mark: "what a call says aloud", role: "assistant", text: "All fixed.\n\n```ta-say\nIt is fixed.\n```", said: "All fixed." },
|
|
1820
|
+
{
|
|
1821
|
+
mark: "pictures described after the answer",
|
|
1822
|
+
role: "assistant",
|
|
1823
|
+
text: `The left one.
|
|
1824
|
+
|
|
1825
|
+
<pictures> p1: two cats on a sofa. p2: a chart of sales, "Q4". </pictures>`,
|
|
1826
|
+
said: "The left one."
|
|
1827
|
+
},
|
|
1828
|
+
{ mark: "pictures described as it streams", role: "assistant", text: `The left one.
|
|
1829
|
+
<pictures>
|
|
1830
|
+
p1: two ca`, said: "The left one." },
|
|
1785
1831
|
{ mark: "a tag not known yet", role: "assistant", text: `<system-reminder>
|
|
1786
1832
|
</system-reminder>
|
|
1787
1833
|
Ready.`, said: "Ready." }
|