truematch-plugin 0.1.20 → 0.1.22
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/index.js +0 -0
- package/dist/plugin.d.ts +1 -1
- package/dist/plugin.js +7 -10
- package/openclaw.plugin.json +3 -3
- package/package.json +9 -11
- package/scripts/bridge.sh +0 -0
package/dist/index.js
CHANGED
|
File without changes
|
package/dist/plugin.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ interface PluginHookBeforePromptBuildResult {
|
|
|
10
10
|
}
|
|
11
11
|
interface PluginAPI {
|
|
12
12
|
on(event: "before_prompt_build", handler: (event: PluginEvent) => PluginHookBeforePromptBuildResult | void | Promise<PluginHookBeforePromptBuildResult | void>): void;
|
|
13
|
-
on(event: "session_start" | "session_end", handler: (event: PluginEvent) => void | Promise<void>): void;
|
|
13
|
+
on(event: "session_start" | "session_end" | "gateway_start" | "gateway_stop", handler: (event: PluginEvent) => void | Promise<void>): void;
|
|
14
14
|
registerHook(event: string, handler: (event: PluginEvent) => void, meta?: {
|
|
15
15
|
name?: string;
|
|
16
16
|
description?: string;
|
package/dist/plugin.js
CHANGED
|
@@ -14,7 +14,7 @@ import { loadPreferences, savePreferences, formatPreferences, } from "./preferen
|
|
|
14
14
|
* The `register(api)` function wires up lifecycle hooks and tools.
|
|
15
15
|
*
|
|
16
16
|
* Hooks registered:
|
|
17
|
-
*
|
|
17
|
+
* gateway_start — detects first-run and missing preferences at boot
|
|
18
18
|
* session_start — resets per-session delivery flags
|
|
19
19
|
* before_prompt_build — injects match notification, handoff context, observation signal
|
|
20
20
|
* command:new — on /new: runs setup, preferences, or observation update
|
|
@@ -42,7 +42,7 @@ function getSessionFlags(sessionKey) {
|
|
|
42
42
|
}
|
|
43
43
|
return flags;
|
|
44
44
|
}
|
|
45
|
-
// Module-scoped flags set at
|
|
45
|
+
// Module-scoped flags set at gateway_start, consumed at first command:new.
|
|
46
46
|
// Resets on every gateway restart (correct — sentinel file prevents repeat prompts).
|
|
47
47
|
const pluginState = {
|
|
48
48
|
needsSetup: false,
|
|
@@ -146,10 +146,10 @@ async function handleUpdatePrefs(rawArgs) {
|
|
|
146
146
|
`Current preferences: ${formatPreferences(prefs)}`);
|
|
147
147
|
}
|
|
148
148
|
export default {
|
|
149
|
-
id: "truematch",
|
|
149
|
+
id: "truematch-plugin",
|
|
150
150
|
name: "TrueMatch",
|
|
151
151
|
description: "AI agent dating network — matched on who you actually are, not who you think you are",
|
|
152
|
-
version: "0.1.
|
|
152
|
+
version: "0.1.22",
|
|
153
153
|
kind: "lifecycle",
|
|
154
154
|
register(api) {
|
|
155
155
|
// ── Tool: /truematch-prefs ─────────────────────────────────────────────────
|
|
@@ -174,10 +174,10 @@ export default {
|
|
|
174
174
|
return { content: [{ type: "text", text }] };
|
|
175
175
|
},
|
|
176
176
|
});
|
|
177
|
-
// ── Hook:
|
|
177
|
+
// ── Hook: gateway_start ────────────────────────────────────────────────────
|
|
178
178
|
// Fires once per gateway process, after channels and hooks load.
|
|
179
179
|
// Use it to detect setup state so command:new can prompt appropriately.
|
|
180
|
-
api.
|
|
180
|
+
api.on("gateway_start", (_event) => {
|
|
181
181
|
const identityFile = join(getTrueMatchDir(), "identity.json");
|
|
182
182
|
const preferencesFile = join(getTrueMatchDir(), "preferences.json");
|
|
183
183
|
if (!existsSync(identityFile)) {
|
|
@@ -189,7 +189,7 @@ export default {
|
|
|
189
189
|
// Register the TrueMatch background cron job if not already present.
|
|
190
190
|
// Writes directly to jobs.json — the documented approach for plugin-side
|
|
191
191
|
// cron registration (no api.registerCron() exists in the PluginAPI).
|
|
192
|
-
// Deferred to avoid
|
|
192
|
+
// Deferred to avoid a jobs.json write race during gateway startup.
|
|
193
193
|
// Delay is configurable via TRUEMATCH_CRON_REGISTER_DELAY_MS. Defaults to 2s.
|
|
194
194
|
const cronDelay = parseInt(process.env["TRUEMATCH_CRON_REGISTER_DELAY_MS"] ?? "2000", 10);
|
|
195
195
|
setTimeout(() => {
|
|
@@ -237,9 +237,6 @@ export default {
|
|
|
237
237
|
// Non-fatal — silently skip on any file I/O or JSON errors
|
|
238
238
|
}
|
|
239
239
|
}, cronDelay);
|
|
240
|
-
}, {
|
|
241
|
-
name: "TrueMatch startup check",
|
|
242
|
-
description: "Detects whether TrueMatch setup and preferences are configured, and registers background cron job",
|
|
243
240
|
});
|
|
244
241
|
// ── Hook: session_start ───────────────────────────────────────────────────
|
|
245
242
|
// Reset per-session delivery flags so signals and notifications fire at most
|
package/openclaw.plugin.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
|
-
"id": "truematch",
|
|
3
|
-
"name": "truematch",
|
|
4
|
-
"version": "0.1.
|
|
2
|
+
"id": "truematch-plugin",
|
|
3
|
+
"name": "truematch-plugin",
|
|
4
|
+
"version": "0.1.22",
|
|
5
5
|
"description": "AI agent dating network — matched on who you actually are, not who you think you are",
|
|
6
6
|
"homepage": "https://clawmatch.org",
|
|
7
7
|
"kind": "lifecycle",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "truematch-plugin",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.22",
|
|
4
4
|
"description": "TrueMatch OpenClaw plugin — AI agent dating network skill",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -38,14 +38,6 @@
|
|
|
38
38
|
"scripts/",
|
|
39
39
|
"openclaw.plugin.json"
|
|
40
40
|
],
|
|
41
|
-
"scripts": {
|
|
42
|
-
"build": "tsc",
|
|
43
|
-
"dev": "tsc --watch",
|
|
44
|
-
"prepublishOnly": "pnpm run build",
|
|
45
|
-
"release": "bumpp --tag 'plugin-v%s' && pnpm publish --no-git-checks",
|
|
46
|
-
"test": "vitest run",
|
|
47
|
-
"test:watch": "vitest"
|
|
48
|
-
},
|
|
49
41
|
"dependencies": {
|
|
50
42
|
"@noble/curves": "^2.0.1",
|
|
51
43
|
"nostr-tools": "^2.10.0"
|
|
@@ -59,10 +51,16 @@
|
|
|
59
51
|
"engines": {
|
|
60
52
|
"node": ">=20"
|
|
61
53
|
},
|
|
62
|
-
"packageManager": "pnpm@9.0.0",
|
|
63
54
|
"openclaw": {
|
|
64
55
|
"extensions": [
|
|
65
56
|
"./dist/plugin.js"
|
|
66
57
|
]
|
|
58
|
+
},
|
|
59
|
+
"scripts": {
|
|
60
|
+
"build": "tsc",
|
|
61
|
+
"dev": "tsc --watch",
|
|
62
|
+
"release": "bumpp --tag 'plugin-v%s' && pnpm publish --no-git-checks",
|
|
63
|
+
"test": "vitest run",
|
|
64
|
+
"test:watch": "vitest"
|
|
67
65
|
}
|
|
68
|
-
}
|
|
66
|
+
}
|
package/scripts/bridge.sh
CHANGED
|
File without changes
|