@celljs/ta-recall 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_KEEP_MARK = "[ta:keep]";
@@ -677,7 +698,7 @@ function activate(pi) {
677
698
  asked = undefined;
678
699
  draft = undefined;
679
700
  briefing = false;
680
- if (event.messageType === "custom" || typeof event.prompt !== "string" || ctx.getSystemPrompt?.().includes(TA_WITH_OTHERS_MARK)) {
701
+ if (event.messageType === "custom" || typeof event.prompt !== "string" || TaHostUtil.marked(ctx.getSystemPrompt?.(), TA_WITH_OTHERS_MARK)) {
681
702
  return;
682
703
  }
683
704
  if (event.prompt.includes(BRIEF_MARK)) {
package/host/index.mjs CHANGED
@@ -32,6 +32,27 @@ var TaHostUtil;
32
32
  });
33
33
  }
34
34
  TaHostUtil2.reach = reach;
35
+ function marked(systemPrompt, mark) {
36
+ return role(systemPrompt).includes(mark);
37
+ }
38
+ TaHostUtil2.marked = marked;
39
+ function role(systemPrompt) {
40
+ if (!systemPrompt) {
41
+ return "";
42
+ }
43
+ const open = `<addendum>
44
+ `;
45
+ const start = systemPrompt.indexOf(open);
46
+ const context = systemPrompt.indexOf(`<project_context>
47
+ `);
48
+ if (start < 0 || context >= 0 && context < start) {
49
+ return "";
50
+ }
51
+ const end = systemPrompt.indexOf(`
52
+ </addendum>`, start);
53
+ return systemPrompt.slice(start + open.length, end < 0 ? undefined : end);
54
+ }
55
+ TaHostUtil2.role = role;
35
56
  })(TaHostUtil || (TaHostUtil = {}));
36
57
  var TA_BRIEF_SOURCE = "brief";
37
58
  var TA_ASK_ENTRY = "ta-ask";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@celljs/ta-recall",
3
- "version": "4.13.0",
3
+ "version": "4.13.1",
4
4
  "description": "A pi package for Ta: asks earlier conversations what was done, offers to keep a request asked again as an extension (steps, a card, a page), and writes a daily brief of what got done and what waits for the user",
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": {
package/web/index.js CHANGED
@@ -702,6 +702,27 @@ var TaHostUtil;
702
702
  });
703
703
  }
704
704
  TaHostUtil2.reach = reach;
705
+ function marked(systemPrompt, mark) {
706
+ return role(systemPrompt).includes(mark);
707
+ }
708
+ TaHostUtil2.marked = marked;
709
+ function role(systemPrompt) {
710
+ if (!systemPrompt) {
711
+ return "";
712
+ }
713
+ const open = `<addendum>
714
+ `;
715
+ const start = systemPrompt.indexOf(open);
716
+ const context = systemPrompt.indexOf(`<project_context>
717
+ `);
718
+ if (start < 0 || context >= 0 && context < start) {
719
+ return "";
720
+ }
721
+ const end = systemPrompt.indexOf(`
722
+ </addendum>`, start);
723
+ return systemPrompt.slice(start + open.length, end < 0 ? undefined : end);
724
+ }
725
+ TaHostUtil2.role = role;
705
726
  })(TaHostUtil || (TaHostUtil = {}));
706
727
  var TA_KEEP_MARK = "[ta:keep]";
707
728
  var TA_ASK_ENTRY = "ta-ask";