agent-theatre 1.3.2 → 1.3.3
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/dist/cli.js +11 -3
- package/dist/cli.js.map +1 -1
- package/dist/index.js +11 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/web/assets/browserAll-DMruipHl.js +2 -0
- package/web/assets/{browserAll-eGDH56DF.js.map → browserAll-DMruipHl.js.map} +1 -1
- package/web/assets/{index-HehktIj0.js → index-CSVCrpUG.js} +4 -4
- package/web/assets/index-CSVCrpUG.js.map +1 -0
- package/web/assets/webworkerAll-DVbAiE6j.js +2 -0
- package/web/assets/{webworkerAll-2M7wVkAJ.js.map → webworkerAll-DVbAiE6j.js.map} +1 -1
- package/web/index.html +1 -1
- package/web/assets/browserAll-eGDH56DF.js +0 -2
- package/web/assets/index-HehktIj0.js.map +0 -1
- package/web/assets/webworkerAll-2M7wVkAJ.js +0 -2
package/dist/index.js
CHANGED
|
@@ -360,9 +360,17 @@ function hookPayloadToEvents(payload, opts = {}) {
|
|
|
360
360
|
}
|
|
361
361
|
function noteOf(text) {
|
|
362
362
|
if (!text) return {};
|
|
363
|
-
const
|
|
364
|
-
if (!
|
|
365
|
-
|
|
363
|
+
const clean = text.replace(/```[\s\S]*?```/g, " ").replace(/`([^`]*)`/g, "$1").replace(/\[([^\]]+)\]\([^)]*\)/g, "$1").replace(/\*+|#+|>+/g, "").replace(/(^|\s)_+|_+(?=\s|$)/g, "$1").replace(/^\s*[-•\d.)]+\s+/gm, "").replace(/\s+/g, " ").trim();
|
|
364
|
+
if (!clean) return {};
|
|
365
|
+
const sentences = clean.match(/[^.!?]+[.!?]+(?=\s|$)|[^.!?]+$/g)?.map((x) => x.trim()).filter(Boolean) ?? [clean];
|
|
366
|
+
const questions = sentences.filter((x) => x.endsWith("?"));
|
|
367
|
+
let note = questions.length ? questions[questions.length - 1] : sentences[0];
|
|
368
|
+
if (!questions.length) for (const next of sentences.slice(1)) {
|
|
369
|
+
if (!/[.!?]$/.test(next) || note.length + next.length + 1 > 160) break;
|
|
370
|
+
note = `${note} ${next}`;
|
|
371
|
+
}
|
|
372
|
+
if (note.length > 200) note = note.slice(0, 197).replace(/\s+\S*$/, "") + "\u2026";
|
|
373
|
+
return { note };
|
|
366
374
|
}
|
|
367
375
|
var ROW_TYPES = /* @__PURE__ */ new Set(["user", "assistant", "system"]);
|
|
368
376
|
var obj3 = (x) => x && typeof x === "object" ? x : {};
|