@celljs/ta-rooms 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.
@@ -30,6 +30,27 @@ var TaHostUtil;
30
30
  });
31
31
  }
32
32
  TaHostUtil2.reach = reach;
33
+ function marked(systemPrompt, mark) {
34
+ return role(systemPrompt).includes(mark);
35
+ }
36
+ TaHostUtil2.marked = marked;
37
+ function role(systemPrompt) {
38
+ if (!systemPrompt) {
39
+ return "";
40
+ }
41
+ const open = `<addendum>
42
+ `;
43
+ const start = systemPrompt.indexOf(open);
44
+ const context = systemPrompt.indexOf(`<project_context>
45
+ `);
46
+ if (start < 0 || context >= 0 && context < start) {
47
+ return "";
48
+ }
49
+ const end = systemPrompt.indexOf(`
50
+ </addendum>`, start);
51
+ return systemPrompt.slice(start + open.length, end < 0 ? undefined : end);
52
+ }
53
+ TaHostUtil2.role = role;
33
54
  })(TaHostUtil || (TaHostUtil = {}));
34
55
  var TA_WITH_OTHERS_MARK = "[ta:speaks-with-others]";
35
56
  var TA_ASK_ENTRY = "ta-ask";
@@ -432,7 +453,7 @@ function activate(pi) {
432
453
  answered: !!answer,
433
454
  doubles: answer?.service?.service
434
455
  }));
435
- const isDouble = (ctx) => ctx.getSystemPrompt().includes(ROOM_DOUBLE_MARK);
456
+ const isDouble = (ctx) => TaHostUtil.marked(ctx.getSystemPrompt(), ROOM_DOUBLE_MARK);
436
457
  const turnOf = async (ctx) => {
437
458
  const turn = (await reach()).doubles?.turnOf(ctx.sessionManager.getSessionFile());
438
459
  return turn?.active ? turn : undefined;
@@ -468,7 +489,7 @@ function activate(pi) {
468
489
  options.skills = [];
469
490
  }
470
491
  } else {
471
- const agent = ctx.getSystemPrompt().includes(AGENT_MARK);
492
+ const agent = TaHostUtil.marked(ctx.getSystemPrompt(), AGENT_MARK);
472
493
  const off = new Set([...ROOM_TOOLS, ...agent ? USER_TOOLS : []]);
473
494
  const active = pi.getActiveTools();
474
495
  if (active.some((name) => off.has(name))) {
package/host/index.mjs CHANGED
@@ -287,6 +287,27 @@ var TaHostUtil;
287
287
  });
288
288
  }
289
289
  TaHostUtil2.reach = reach;
290
+ function marked(systemPrompt, mark) {
291
+ return role(systemPrompt).includes(mark);
292
+ }
293
+ TaHostUtil2.marked = marked;
294
+ function role(systemPrompt) {
295
+ if (!systemPrompt) {
296
+ return "";
297
+ }
298
+ const open = `<addendum>
299
+ `;
300
+ const start = systemPrompt.indexOf(open);
301
+ const context = systemPrompt.indexOf(`<project_context>
302
+ `);
303
+ if (start < 0 || context >= 0 && context < start) {
304
+ return "";
305
+ }
306
+ const end = systemPrompt.indexOf(`
307
+ </addendum>`, start);
308
+ return systemPrompt.slice(start + open.length, end < 0 ? undefined : end);
309
+ }
310
+ TaHostUtil2.role = role;
290
311
  })(TaHostUtil || (TaHostUtil = {}));
291
312
  var TA_WITH_OTHERS_MARK = "[ta:speaks-with-others]";
292
313
  var TA_ASK_ENTRY = "ta-ask";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@celljs/ta-rooms",
3
- "version": "4.13.0",
3
+ "version": "4.13.1",
4
4
  "description": "A pi package for Ta: rooms shared with other Ta through the relay, end to end: who asks to join and the owner's answer, your rooms and their members, your Ta friends, and links that invite",
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": {