@celljs/ta-cron 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.
- package/extension/index.mjs +22 -1
- package/package.json +3 -3
package/extension/index.mjs
CHANGED
|
@@ -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_KEEP_MARK = "[ta:keep]";
|
|
32
53
|
var TA_ASK_ENTRY = "ta-ask";
|
|
@@ -929,7 +950,7 @@ function activate(pi) {
|
|
|
929
950
|
host: answer?.host,
|
|
930
951
|
scheduler: answer?.service
|
|
931
952
|
}));
|
|
932
|
-
const isRun = (ctx) => ctx.getSystemPrompt()
|
|
953
|
+
const isRun = (ctx) => TaHostUtil.marked(ctx.getSystemPrompt(), RUN_MARK);
|
|
933
954
|
const scheduler = async (ctx) => {
|
|
934
955
|
if (isRun(ctx)) {
|
|
935
956
|
throw new Error(NOT_IN_RUN);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@celljs/ta-cron",
|
|
3
|
-
"version": "4.13.
|
|
3
|
+
"version": "4.13.1",
|
|
4
4
|
"description": "A pi package for Ta: prompts that run on a schedule, once, every so often or by a cron expression, each run in a conversation of its own in the Ta service",
|
|
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.
|
|
31
|
-
"@celljs/ta-web": "4.13.
|
|
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": {
|