@celljs/ta-glance 4.34.0 → 4.35.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.
@@ -1,3 +1,46 @@
1
+ // ../ta-protocol/esm/common/ask-protocol.js
2
+ var TA_ASK_ENTRY = "ta-ask";
3
+ var TaAskUtil;
4
+ (function(TaAskUtil2) {
5
+ const LENGTH = 120;
6
+ function entry(question) {
7
+ const line = question.replace(/\s+/g, " ").trim();
8
+ return { question: line.length > LENGTH ? `${line.slice(0, LENGTH - 1)}…` : line };
9
+ }
10
+ TaAskUtil2.entry = entry;
11
+ function asking(entries) {
12
+ var _a;
13
+ for (let i = entries.length - 1;i >= 0; i--) {
14
+ const entry2 = entries[i];
15
+ if (entry2.type === "message" && ((_a = entry2.message) === null || _a === undefined ? undefined : _a.role) === "user") {
16
+ return;
17
+ }
18
+ if (entry2.type === "custom" && entry2.customType === TA_ASK_ENTRY) {
19
+ return read(entry2);
20
+ }
21
+ }
22
+ return;
23
+ }
24
+ TaAskUtil2.asking = asking;
25
+ function next(asked, entry2) {
26
+ var _a;
27
+ if (entry2.type === "message" && ((_a = entry2.message) === null || _a === undefined ? undefined : _a.role) === "user") {
28
+ return;
29
+ }
30
+ return entry2.type === "custom" && entry2.customType === TA_ASK_ENTRY ? read(entry2) : asked;
31
+ }
32
+ TaAskUtil2.next = next;
33
+ function read(found) {
34
+ var _a;
35
+ const question = (_a = found.data) === null || _a === undefined ? undefined : _a.question;
36
+ if (typeof question !== "string" || !question.trim()) {
37
+ return;
38
+ }
39
+ const at = found.timestamp ? Date.parse(found.timestamp) : Number.NaN;
40
+ return { question: entry(question).question, at: Number.isNaN(at) ? 0 : at };
41
+ }
42
+ })(TaAskUtil || (TaAskUtil = {}));
43
+
1
44
  // ../ta-protocol/esm/common/glance-protocol.js
2
45
  var NAME = "@celljs/ta-glance";
3
46
  var LANGUAGE = "ta-glance";
@@ -103,47 +146,6 @@ var TaDoubleLookUtil;
103
146
  }
104
147
  TaDoubleLookUtil2.given = given;
105
148
  })(TaDoubleLookUtil || (TaDoubleLookUtil = {}));
106
- var TA_ASK_ENTRY = "ta-ask";
107
- var TaAskUtil;
108
- (function(TaAskUtil2) {
109
- const LENGTH = 120;
110
- function entry(question) {
111
- const line = question.replace(/\s+/g, " ").trim();
112
- return { question: line.length > LENGTH ? `${line.slice(0, LENGTH - 1)}…` : line };
113
- }
114
- TaAskUtil2.entry = entry;
115
- function asking(entries) {
116
- var _a;
117
- for (let i = entries.length - 1;i >= 0; i--) {
118
- const entry2 = entries[i];
119
- if (entry2.type === "message" && ((_a = entry2.message) === null || _a === undefined ? undefined : _a.role) === "user") {
120
- return;
121
- }
122
- if (entry2.type === "custom" && entry2.customType === TA_ASK_ENTRY) {
123
- return read(entry2);
124
- }
125
- }
126
- return;
127
- }
128
- TaAskUtil2.asking = asking;
129
- function next(asked, entry2) {
130
- var _a;
131
- if (entry2.type === "message" && ((_a = entry2.message) === null || _a === undefined ? undefined : _a.role) === "user") {
132
- return;
133
- }
134
- return entry2.type === "custom" && entry2.customType === TA_ASK_ENTRY ? read(entry2) : asked;
135
- }
136
- TaAskUtil2.next = next;
137
- function read(found) {
138
- var _a;
139
- const question = (_a = found.data) === null || _a === undefined ? undefined : _a.question;
140
- if (typeof question !== "string" || !question.trim()) {
141
- return;
142
- }
143
- const at = found.timestamp ? Date.parse(found.timestamp) : Number.NaN;
144
- return { question: entry(question).question, at: Number.isNaN(at) ? 0 : at };
145
- }
146
- })(TaAskUtil || (TaAskUtil = {}));
147
149
 
148
150
  // ../ta-protocol/esm/common/glance-json.js
149
151
  var GlanceJson;
@@ -231,7 +233,7 @@ var GlanceJson;
231
233
  out += char;
232
234
  }
233
235
  continue;
234
- } else if (char === '"' || char === CURLY[1]) {
236
+ } else if (char === '"' || char === CURLY[1] && quote === CURLY[0]) {
235
237
  if (char === '"' && !ends(text, index)) {
236
238
  out += "\\\"";
237
239
  continue;
@@ -294,7 +296,7 @@ var GlanceJson;
294
296
  }
295
297
  if (char === '"' || char === "'" || CURLY.includes(char)) {
296
298
  inString = true;
297
- quote = char === "'" ? "'" : '"';
299
+ quote = char === "'" ? "'" : char === '"' ? '"' : CURLY[0];
298
300
  out += '"';
299
301
  continue;
300
302
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@celljs/ta-glance",
3
- "version": "4.34.0",
3
+ "version": "4.35.0",
4
4
  "description": "A pi package for Ta: replies lead with the answer, short, and show results as cards (key numbers, files, steps, comparisons, choices) rather than paragraphs",
5
5
  "keywords": [
6
6
  "pi-package"
@@ -26,8 +26,8 @@
26
26
  "watch": "tsc -b -w --preserveWatchOutput"
27
27
  },
28
28
  "devDependencies": {
29
- "@celljs/ta-protocol": "4.34.0",
30
- "@celljs/ta-web": "4.34.0",
29
+ "@celljs/ta-protocol": "4.35.0",
30
+ "@celljs/ta-web": "4.35.0",
31
31
  "@types/react": "^19.3.0"
32
32
  },
33
33
  "publishConfig": {
package/web/index.js CHANGED
@@ -84,7 +84,7 @@ var GlanceJson;
84
84
  out += char;
85
85
  }
86
86
  continue;
87
- } else if (char === '"' || char === CURLY[1]) {
87
+ } else if (char === '"' || char === CURLY[1] && quote === CURLY[0]) {
88
88
  if (char === '"' && !ends(text, index)) {
89
89
  out += "\\\"";
90
90
  continue;
@@ -147,7 +147,7 @@ var GlanceJson;
147
147
  }
148
148
  if (char === '"' || char === "'" || CURLY.includes(char)) {
149
149
  inString = true;
150
- quote = char === "'" ? "'" : '"';
150
+ quote = char === "'" ? "'" : char === '"' ? '"' : CURLY[0];
151
151
  out += '"';
152
152
  continue;
153
153
  }