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/cli.js
CHANGED
|
@@ -369,9 +369,17 @@ function hookPayloadToEvents(payload, opts = {}) {
|
|
|
369
369
|
}
|
|
370
370
|
function noteOf(text) {
|
|
371
371
|
if (!text) return {};
|
|
372
|
-
const
|
|
373
|
-
if (!
|
|
374
|
-
|
|
372
|
+
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();
|
|
373
|
+
if (!clean) return {};
|
|
374
|
+
const sentences = clean.match(/[^.!?]+[.!?]+(?=\s|$)|[^.!?]+$/g)?.map((x) => x.trim()).filter(Boolean) ?? [clean];
|
|
375
|
+
const questions = sentences.filter((x) => x.endsWith("?"));
|
|
376
|
+
let note = questions.length ? questions[questions.length - 1] : sentences[0];
|
|
377
|
+
if (!questions.length) for (const next of sentences.slice(1)) {
|
|
378
|
+
if (!/[.!?]$/.test(next) || note.length + next.length + 1 > 160) break;
|
|
379
|
+
note = `${note} ${next}`;
|
|
380
|
+
}
|
|
381
|
+
if (note.length > 200) note = note.slice(0, 197).replace(/\s+\S*$/, "") + "\u2026";
|
|
382
|
+
return { note };
|
|
375
383
|
}
|
|
376
384
|
var ROW_TYPES = /* @__PURE__ */ new Set(["user", "assistant", "system"]);
|
|
377
385
|
var obj3 = (x) => x && typeof x === "object" ? x : {};
|