@celljs/ta-bots 4.13.0 → 4.13.1

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.
@@ -27,6 +27,27 @@ var TaHostUtil;
27
27
  });
28
28
  }
29
29
  TaHostUtil2.reach = reach;
30
+ function marked(systemPrompt, mark) {
31
+ return role(systemPrompt).includes(mark);
32
+ }
33
+ TaHostUtil2.marked = marked;
34
+ function role(systemPrompt) {
35
+ if (!systemPrompt) {
36
+ return "";
37
+ }
38
+ const open = `<addendum>
39
+ `;
40
+ const start = systemPrompt.indexOf(open);
41
+ const context = systemPrompt.indexOf(`<project_context>
42
+ `);
43
+ if (start < 0 || context >= 0 && context < start) {
44
+ return "";
45
+ }
46
+ const end = systemPrompt.indexOf(`
47
+ </addendum>`, start);
48
+ return systemPrompt.slice(start + open.length, end < 0 ? undefined : end);
49
+ }
50
+ TaHostUtil2.role = role;
30
51
  })(TaHostUtil || (TaHostUtil = {}));
31
52
  var TA_ASK_ENTRY = "ta-ask";
32
53
  var TaAskUtil;
package/host/index.mjs CHANGED
@@ -452,6 +452,27 @@ var TaHostUtil;
452
452
  });
453
453
  }
454
454
  TaHostUtil2.reach = reach;
455
+ function marked(systemPrompt, mark) {
456
+ return role(systemPrompt).includes(mark);
457
+ }
458
+ TaHostUtil2.marked = marked;
459
+ function role(systemPrompt) {
460
+ if (!systemPrompt) {
461
+ return "";
462
+ }
463
+ const open = `<addendum>
464
+ `;
465
+ const start = systemPrompt.indexOf(open);
466
+ const context = systemPrompt.indexOf(`<project_context>
467
+ `);
468
+ if (start < 0 || context >= 0 && context < start) {
469
+ return "";
470
+ }
471
+ const end = systemPrompt.indexOf(`
472
+ </addendum>`, start);
473
+ return systemPrompt.slice(start + open.length, end < 0 ? undefined : end);
474
+ }
475
+ TaHostUtil2.role = role;
455
476
  })(TaHostUtil || (TaHostUtil = {}));
456
477
  var TA_DOUBLE_FILE = { name: "@celljs/ta-web", key: "assistant.file" };
457
478
  var TA_ASK_ENTRY = "ta-ask";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@celljs/ta-bots",
3
- "version": "4.13.0",
3
+ "version": "4.13.1",
4
4
  "description": "A pi package for Ta: bots of WeChat (ClawBot) and WeCom connected to the double, an agent or a conversation, messages and files both ways",
5
5
  "keywords": [
6
6
  "pi-package"
@@ -27,8 +27,8 @@
27
27
  "watch": "tsc -b -w --preserveWatchOutput"
28
28
  },
29
29
  "devDependencies": {
30
- "@celljs/ta-protocol": "4.13.0",
31
- "@celljs/ta-web": "4.13.0",
30
+ "@celljs/ta-protocol": "4.13.1",
31
+ "@celljs/ta-web": "4.13.1",
32
32
  "@types/react": "^19.3.0"
33
33
  },
34
34
  "publishConfig": {