@saleso.innovations/bridge 0.1.19 → 0.1.20
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/README.md +1 -1
- package/dist/cronWatcher.d.ts.map +1 -1
- package/dist/cronWatcher.js +16 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -34,7 +34,7 @@ This installs the latest package, refreshes the CLI symlink, and restarts `cleos
|
|
|
34
34
|
To pin a specific release (e.g. after a Cleos update):
|
|
35
35
|
|
|
36
36
|
```bash
|
|
37
|
-
curl -fsSL https://amicable-elephant-407.convex.site/update-bridge.sh | bash -s -- 0.1.
|
|
37
|
+
curl -fsSL https://amicable-elephant-407.convex.site/update-bridge.sh | bash -s -- 0.1.20
|
|
38
38
|
```
|
|
39
39
|
|
|
40
40
|
## Manual usage
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cronWatcher.d.ts","sourceRoot":"","sources":["../src/cronWatcher.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAIjD,eAAO,MAAM,sBAAsB,QAA+C,CAAC;AAEnF,eAAO,MAAM,oBAAoB,QAAmD,CAAC;
|
|
1
|
+
{"version":3,"file":"cronWatcher.d.ts","sourceRoot":"","sources":["../src/cronWatcher.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAIjD,eAAO,MAAM,sBAAsB,QAA+C,CAAC;AAEnF,eAAO,MAAM,oBAAoB,QAAmD,CAAC;AAerF,KAAK,kBAAkB,GAAG;IACxB,OAAO,EAAE,aAAa,CAAC;IACvB,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;IACnF,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;CACrC,CAAC;AAEF,wBAAgB,kBAAkB,IAAI,GAAG,CAAC,MAAM,CAAC,CAQhD;AAED,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,GAAG,CAAC,MAAM,CAAC,GAAG,IAAI,CAGhE;AAED,wBAAgB,mBAAmB,IAAI,MAAM,CAI5C;AAED,wBAAgB,mBAAmB,CAAC,OAAO,GAAE,MAA+B,GAAG,MAAM,EAAE,CAoBtF;AAED,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAE1D;AAED,wBAAgB,oBAAoB,CAAC,SAAS,GAAE,GAAG,CAAC,MAAM,CAAwB,GAAG,MAAM,EAAE,CAE5F;AA6KD,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,kBAAkB,GAAG,MAAM,IAAI,CA4BxE;AAED,wBAAsB,eAAe,CAAC,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,OAAO,GAAG,OAAO,CAAC;IAC1F,cAAc,EAAE,MAAM,CAAC;IACvB,aAAa,EAAE,MAAM,CAAC;IACtB,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,MAAM,CAAC;CACxB,CAAC,CAmBD"}
|
package/dist/cronWatcher.js
CHANGED
|
@@ -8,6 +8,11 @@ const HERMES_CRON_JOBS_FILE = join(homedir(), ".hermes", "cron", "jobs.json");
|
|
|
8
8
|
export const DELIVERED_INDEX_PATH = join(homedir(), ".cleos", "cron-delivered.json");
|
|
9
9
|
const POLL_INTERVAL_MS = 5_000;
|
|
10
10
|
const FILE_SETTLE_MS = 750;
|
|
11
|
+
// Keep in sync with isSilentHermesCronOutput in @repo/backend-types.
|
|
12
|
+
const SILENT_CRON_OUTPUT_PATTERN = /\bstatus:\s*silent\b/i;
|
|
13
|
+
function isSilentHermesCronOutput(content) {
|
|
14
|
+
return SILENT_CRON_OUTPUT_PATTERN.test(content.trim());
|
|
15
|
+
}
|
|
11
16
|
export function readDeliveredIndex() {
|
|
12
17
|
try {
|
|
13
18
|
const parsed = JSON.parse(readFileSync(DELIVERED_INDEX_PATH, "utf8"));
|
|
@@ -136,6 +141,17 @@ async function deliverPendingFiles(session, delivered, conversationRef, options)
|
|
|
136
141
|
writeDeliveredIndex(delivered);
|
|
137
142
|
continue;
|
|
138
143
|
}
|
|
144
|
+
if (isSilentHermesCronOutput(content)) {
|
|
145
|
+
delivered.add(key);
|
|
146
|
+
writeDeliveredIndex(delivered);
|
|
147
|
+
console.log(JSON.stringify({
|
|
148
|
+
event: "cleos-bridge.cron-skipped-silent",
|
|
149
|
+
jobId,
|
|
150
|
+
jobName,
|
|
151
|
+
file: key,
|
|
152
|
+
}));
|
|
153
|
+
continue;
|
|
154
|
+
}
|
|
139
155
|
let retriedAfterConversationRefresh = false;
|
|
140
156
|
let deliveredSuccessfully = false;
|
|
141
157
|
while (true) {
|