@celljs/ta-initiative 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_WITH_OTHERS_MARK = "[ta:speaks-with-others]";
32
53
  var TA_ASK_ENTRY = "ta-ask";
@@ -560,11 +581,11 @@ function activate(pi) {
560
581
  const status = await found?.service?.reviewStatus();
561
582
  const file = ctx.sessionManager.getSessionFile();
562
583
  const here = !!file && status?.file === file;
563
- const system = ctx.getSystemPrompt?.() ?? "";
584
+ const role = TaHostUtil.role(ctx.getSystemPrompt?.());
564
585
  shown = [];
565
586
  proposed = 0;
566
587
  reviewing = here;
567
- proposing = !!found?.service && !!file && !system.includes(CRON_RUN_MARK) && !system.includes(TA_WITH_OTHERS_MARK);
588
+ proposing = !!found?.service && !!file && !role.includes(CRON_RUN_MARK) && !role.includes(TA_WITH_OTHERS_MARK);
568
589
  tool(ProposeTool.NAME, here || proposing);
569
590
  tool(PaceTool.NAME, here && !!status?.settings.auto);
570
591
  tool(ProfileTool.NAME, here && !!status?.settings.learn);
@@ -572,7 +593,7 @@ function activate(pi) {
572
593
  if (!status || !found?.service) {
573
594
  return;
574
595
  }
575
- const profile = status.settings.learn && since === undefined && status.profile && !ctx.getSystemPrompt?.().includes(TA_WITH_OTHERS_MARK);
596
+ const profile = status.settings.learn && since === undefined && status.profile && !TaHostUtil.marked(ctx.getSystemPrompt?.(), TA_WITH_OTHERS_MARK);
576
597
  if (profile) {
577
598
  event.systemPromptOptions.sections = {
578
599
  ...event.systemPromptOptions.sections,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@celljs/ta-initiative",
3
- "version": "4.13.0",
3
+ "version": "4.13.1",
4
4
  "description": "A pi package for Ta: what Ta does on its own and how far, by kind and by the user's trust; proposals other packages offer, the user's suggestions to decide or undo, and a weekly review that keeps the scheduled tasks and learns 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": {