@celljs/ta-extensions 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.
Files changed (2) hide show
  1. package/package.json +4 -4
  2. package/web/index.js +21 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@celljs/ta-extensions",
3
- "version": "4.13.0",
3
+ "version": "4.13.1",
4
4
  "description": "A pi package for Ta: the page of extensions, where the user makes one by saying what it should do, and hands extensions on or takes them in as one file",
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-harness": "4.13.0",
31
- "@celljs/ta-protocol": "4.13.0",
32
- "@celljs/ta-web": "4.13.0",
30
+ "@celljs/ta-harness": "4.13.1",
31
+ "@celljs/ta-protocol": "4.13.1",
32
+ "@celljs/ta-web": "4.13.1",
33
33
  "@types/react": "^19.3.0"
34
34
  },
35
35
  "publishConfig": {
package/web/index.js CHANGED
@@ -842,6 +842,27 @@ var TaHostUtil;
842
842
  });
843
843
  }
844
844
  TaHostUtil2.reach = reach;
845
+ function marked(systemPrompt, mark) {
846
+ return role(systemPrompt).includes(mark);
847
+ }
848
+ TaHostUtil2.marked = marked;
849
+ function role(systemPrompt) {
850
+ if (!systemPrompt) {
851
+ return "";
852
+ }
853
+ const open = `<addendum>
854
+ `;
855
+ const start = systemPrompt.indexOf(open);
856
+ const context = systemPrompt.indexOf(`<project_context>
857
+ `);
858
+ if (start < 0 || context >= 0 && context < start) {
859
+ return "";
860
+ }
861
+ const end = systemPrompt.indexOf(`
862
+ </addendum>`, start);
863
+ return systemPrompt.slice(start + open.length, end < 0 ? undefined : end);
864
+ }
865
+ TaHostUtil2.role = role;
845
866
  })(TaHostUtil || (TaHostUtil = {}));
846
867
  var TA_ASK_ENTRY = "ta-ask";
847
868
  var TaAskUtil;