@celljs/ta-nearby 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.
@@ -31,6 +31,27 @@ var TaHostUtil;
31
31
  });
32
32
  }
33
33
  TaHostUtil2.reach = reach;
34
+ function marked(systemPrompt, mark) {
35
+ return role(systemPrompt).includes(mark);
36
+ }
37
+ TaHostUtil2.marked = marked;
38
+ function role(systemPrompt) {
39
+ if (!systemPrompt) {
40
+ return "";
41
+ }
42
+ const open = `<addendum>
43
+ `;
44
+ const start = systemPrompt.indexOf(open);
45
+ const context = systemPrompt.indexOf(`<project_context>
46
+ `);
47
+ if (start < 0 || context >= 0 && context < start) {
48
+ return "";
49
+ }
50
+ const end = systemPrompt.indexOf(`
51
+ </addendum>`, start);
52
+ return systemPrompt.slice(start + open.length, end < 0 ? undefined : end);
53
+ }
54
+ TaHostUtil2.role = role;
34
55
  })(TaHostUtil || (TaHostUtil = {}));
35
56
  var TA_WITH_OTHERS_MARK = "[ta:speaks-with-others]";
36
57
  var TA_ASK_ENTRY = "ta-ask";
@@ -244,7 +265,7 @@ function activate(pi) {
244
265
  return service2;
245
266
  };
246
267
  pi.on("before_agent_start", async (event, ctx) => {
247
- if (ctx.getSystemPrompt().includes(TA_WITH_OTHERS_MARK)) {
268
+ if (TaHostUtil.marked(ctx.getSystemPrompt(), TA_WITH_OTHERS_MARK)) {
248
269
  return;
249
270
  }
250
271
  const section = (await reach()).service?.section();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@celljs/ta-nearby",
3
- "version": "4.13.0",
3
+ "version": "4.13.1",
4
4
  "description": "A pi package for Ta: the other Ta around on the same network while you let them see you, known to Ta in your conversations, and rooms of those present made in a tap",
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.13.0",
31
- "@celljs/ta-relay": "4.13.0",
32
- "@celljs/ta-web": "4.13.0",
30
+ "@celljs/ta-protocol": "4.13.1",
31
+ "@celljs/ta-relay": "4.13.1",
32
+ "@celljs/ta-web": "4.13.1",
33
33
  "@types/react": "^19.3.0"
34
34
  },
35
35
  "publishConfig": {