truematch-plugin 0.1.0 → 0.1.2

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/handoff.js CHANGED
@@ -180,9 +180,9 @@ export function getActiveHandoffContext() {
180
180
  const active = handoffs.sort((a, b) => new Date(b.created_at).getTime() - new Date(a.created_at).getTime())[0];
181
181
  if (!active)
182
182
  return null;
183
- // Check consent expiry for pending_consent state
184
- if (active.status === "pending_consent" && active.consent_at) {
185
- const age = Date.now() - new Date(active.consent_at).getTime();
183
+ // Expire if user hasn't consented within 72 hours of the match being presented
184
+ if (active.status === "pending_consent" && !active.consent_at) {
185
+ const age = Date.now() - new Date(active.created_at).getTime();
186
186
  if (age > CONSENT_EXPIRY_MS) {
187
187
  // Silently expire
188
188
  saveHandoffState({ ...active, status: "expired" });
package/dist/index.js CHANGED
@@ -182,7 +182,16 @@ async function cmdObserve() {
182
182
  console.error("Invalid JSON");
183
183
  process.exit(1);
184
184
  }
185
- await saveObservation(obs);
185
+ try {
186
+ await saveObservation(obs);
187
+ }
188
+ catch (err) {
189
+ console.error(`Failed to save observation — check JSON schema matches ObservationSummary.\n` +
190
+ `Each dimension needs: { confidence, observation_count, behavioral_context_diversity }\n` +
191
+ `Dimensions: attachment, core_values, communication, emotional_regulation, humor, life_velocity, dealbreakers, conflict_resolution, interdependence_model\n` +
192
+ `Error: ${err instanceof Error ? err.message : String(err)}`);
193
+ process.exit(1);
194
+ }
186
195
  console.log(`ObservationSummary saved. Eligible: ${isEligible(obs)}`);
187
196
  return;
188
197
  }
package/dist/plugin.js CHANGED
@@ -1,7 +1,8 @@
1
1
  import { execSync } from "node:child_process";
2
2
  import { existsSync, readFileSync, writeFileSync } from "node:fs";
3
- import { join } from "node:path";
3
+ import { join, dirname } from "node:path";
4
4
  import { homedir } from "node:os";
5
+ import { fileURLToPath } from "node:url";
5
6
  import { loadSignals, saveSignals, pickPendingSignal, buildSignalInstruction, recordSignalDelivered, } from "./signals.js";
6
7
  import { loadPendingNotification, deletePendingNotification, buildMatchNotificationContext, getActiveHandoffContext, } from "./handoff.js";
7
8
  const TRUEMATCH_DIR = join(homedir(), ".truematch");
@@ -301,13 +302,13 @@ export default {
301
302
  `Say /truematch-prefs and we can do it there."`);
302
303
  return;
303
304
  }
304
- // Update observation summary from Claude's existing memory
305
+ // Update observation summary from Claude's existing memory.
306
+ // Use an absolute path to the CLI entry point so this works regardless
307
+ // of whether the truematch bin is on PATH in Claude's process environment.
308
+ const cliPath = join(dirname(fileURLToPath(import.meta.url)), "index.js");
305
309
  let output;
306
310
  try {
307
- output = execSync("truematch observe --update", {
308
- encoding: "utf8",
309
- timeout: 5000,
310
- });
311
+ output = execSync(`${process.execPath} ${JSON.stringify(cliPath)} observe --update`, { encoding: "utf8", timeout: 5000 });
311
312
  }
312
313
  catch {
313
314
  // truematch not set up yet — silently skip
package/dist/poll.js CHANGED
@@ -91,6 +91,7 @@ async function main() {
91
91
  const pool = new SimplePool();
92
92
  const seenEventIds = new Set();
93
93
  const outputLines = [];
94
+ let cappedAtLimit = false;
94
95
  await new Promise((resolve) => {
95
96
  let eoseCount = 0;
96
97
  let settled = false;
@@ -126,7 +127,10 @@ async function main() {
126
127
  return;
127
128
  eventCount++;
128
129
  if (eventCount > MAX_EVENTS) {
129
- process.stderr.write(`poll: MAX_EVENTS (${MAX_EVENTS}) cap reached — consider reducing POLL_INTERVAL\n`);
130
+ if (!cappedAtLimit) {
131
+ cappedAtLimit = true;
132
+ process.stderr.write(`poll: MAX_EVENTS (${MAX_EVENTS}) cap reached — watermark will not advance, consider reducing POLL_INTERVAL\n`);
133
+ }
130
134
  return;
131
135
  }
132
136
  const senderNpub = event.pubkey;
@@ -174,8 +178,12 @@ async function main() {
174
178
  for (const line of outputLines) {
175
179
  process.stdout.write(line + "\n");
176
180
  }
177
- // Advance watermark AFTER writing output (not before)
178
- savePollState({ last_poll_at: nowSeconds });
181
+ // Only advance watermark when all events were processed.
182
+ // If the cap was hit, leave the watermark unchanged so the next poll
183
+ // re-fetches from the same point — avoiding silent message loss.
184
+ if (!cappedAtLimit) {
185
+ savePollState({ last_poll_at: nowSeconds });
186
+ }
179
187
  // Explicitly exit — SimplePool holds WebSocket connections open indefinitely,
180
188
  // which would block bridge.sh's polling loop if we don't force termination.
181
189
  process.exit(0);
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "truematch-plugin",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "TrueMatch OpenClaw plugin — AI agent dating network skill",
5
5
  "license": "MIT",
6
6
  "repository": {
7
7
  "type": "git",
8
- "url": "https://github.com/goeldivyam/truematch"
8
+ "url": "git+https://github.com/goeldivyam/truematch.git"
9
9
  },
10
10
  "homepage": "https://clawmatch.org",
11
11
  "keywords": [