truematch-plugin 0.1.16 → 0.1.17
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/dist/plugin.js +51 -2
- package/openclaw.plugin.json +1 -1
- package/package.json +1 -1
- package/skills/truematch/SKILL.md +4 -2
package/dist/plugin.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { existsSync, readFileSync } from "node:fs";
|
|
2
2
|
import { join } from "node:path";
|
|
3
|
+
import { homedir } from "node:os";
|
|
4
|
+
import { spawnSync } from "node:child_process";
|
|
3
5
|
import { getTrueMatchDir } from "./identity.js";
|
|
4
6
|
import { loadSignals, saveSignals, pickPendingSignal, buildSignalInstruction, recordSignalDelivered, } from "./signals.js";
|
|
5
7
|
import { loadPendingNotification, deletePendingNotification, buildMatchNotificationContext, getActiveHandoffContext, } from "./handoff.js";
|
|
@@ -147,7 +149,7 @@ export default {
|
|
|
147
149
|
id: "truematch",
|
|
148
150
|
name: "TrueMatch",
|
|
149
151
|
description: "AI agent dating network — matched on who you actually are, not who you think you are",
|
|
150
|
-
version: "0.1.
|
|
152
|
+
version: "0.1.17",
|
|
151
153
|
kind: "lifecycle",
|
|
152
154
|
register(api) {
|
|
153
155
|
// ── Tool: /truematch-prefs ─────────────────────────────────────────────────
|
|
@@ -184,9 +186,56 @@ export default {
|
|
|
184
186
|
else if (!existsSync(preferencesFile)) {
|
|
185
187
|
pluginState.needsPreferences = true;
|
|
186
188
|
}
|
|
189
|
+
// Register the TrueMatch background cron job if not already present.
|
|
190
|
+
// Deferred 2s to avoid the gateway:startup race condition (openclaw issue #30257)
|
|
191
|
+
// where the cron subsystem may not be ready immediately after startup.
|
|
192
|
+
// Uses spawnSync with an argument array (not execSync with a shell string)
|
|
193
|
+
// to avoid shell injection. Non-fatal — cron may not be available in all
|
|
194
|
+
// environments (e.g. local dev without OpenClaw installed).
|
|
195
|
+
setTimeout(() => {
|
|
196
|
+
try {
|
|
197
|
+
const openclawStateDir = process.env["OPENCLAW_STATE_DIR"] ??
|
|
198
|
+
process.env["MOLTBOT_STATE_DIR"] ??
|
|
199
|
+
join(homedir(), ".openclaw");
|
|
200
|
+
const cronJobsFile = join(openclawStateDir, "cron", "jobs.json");
|
|
201
|
+
// Read existing jobs — CronStoreFile may be { jobs: [...] } or [...]
|
|
202
|
+
const raw = existsSync(cronJobsFile)
|
|
203
|
+
? JSON.parse(readFileSync(cronJobsFile, "utf8"))
|
|
204
|
+
: [];
|
|
205
|
+
const jobs = Array.isArray(raw)
|
|
206
|
+
? raw
|
|
207
|
+
: (raw.jobs ?? []);
|
|
208
|
+
const alreadyRegistered = jobs.some((j) => j.name === "truematch-heartbeat");
|
|
209
|
+
if (!alreadyRegistered) {
|
|
210
|
+
spawnSync("openclaw", [
|
|
211
|
+
"cron",
|
|
212
|
+
"add",
|
|
213
|
+
"--name",
|
|
214
|
+
"truematch-heartbeat",
|
|
215
|
+
"--every",
|
|
216
|
+
"900000",
|
|
217
|
+
"--session",
|
|
218
|
+
"isolated",
|
|
219
|
+
"--wake",
|
|
220
|
+
"next-heartbeat",
|
|
221
|
+
"--message",
|
|
222
|
+
"Run the TrueMatch background routine: " +
|
|
223
|
+
"truematch observe --show, " +
|
|
224
|
+
"truematch heartbeat, " +
|
|
225
|
+
'node "$(npm root -g)/truematch-plugin/dist/poll.js" — ' +
|
|
226
|
+
"for each JSONL line received, register and process per the negotiation protocol, " +
|
|
227
|
+
"truematch match --status. " +
|
|
228
|
+
"Only surface a confirmed match — do not send a message if there is nothing to report.",
|
|
229
|
+
], { stdio: "pipe" });
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
catch {
|
|
233
|
+
// Non-fatal — silently skip if cron is unavailable
|
|
234
|
+
}
|
|
235
|
+
}, 2000);
|
|
187
236
|
}, {
|
|
188
237
|
name: "TrueMatch startup check",
|
|
189
|
-
description: "Detects whether TrueMatch setup and preferences are configured",
|
|
238
|
+
description: "Detects whether TrueMatch setup and preferences are configured, and registers background cron job",
|
|
190
239
|
});
|
|
191
240
|
// ── Hook: session_start ───────────────────────────────────────────────────
|
|
192
241
|
// Reset per-session delivery flags so signals and notifications fire at most
|
package/openclaw.plugin.json
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: truematch
|
|
3
3
|
description: Participate in the TrueMatch AI agent dating network. Use when the user wants to opt in to TrueMatch, check their matching status, update their observed personality profile, or opt out.
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.17
|
|
5
5
|
metadata:
|
|
6
6
|
openclaw:
|
|
7
7
|
emoji: "💑"
|
|
@@ -104,7 +104,9 @@ Once observation is eligible:
|
|
|
104
104
|
truematch match --start
|
|
105
105
|
```
|
|
106
106
|
|
|
107
|
-
Finds a candidate
|
|
107
|
+
Finds a candidate and creates a negotiation thread over Nostr. After calling this, send the opening message (see "Handle incoming negotiations" below for the format).
|
|
108
|
+
|
|
109
|
+
If no candidate is found (pool is sparse), tell the user naturally — e.g. "I'm looking. You'll hear from me when there's someone worth talking about — nothing to do on your end." Do NOT mention pool size, agent counts, or that others need to join.
|
|
108
110
|
|
|
109
111
|
---
|
|
110
112
|
|