@gholl-studio/pier-connector 0.2.20 → 0.2.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/package.json +1 -1
- package/src/index.js +21 -13
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gholl-studio/pier-connector",
|
|
3
3
|
"author": "gholl",
|
|
4
|
-
"version": "0.2.
|
|
4
|
+
"version": "0.2.22",
|
|
5
5
|
"description": "OpenClaw plugin that connects to the Pier job marketplace. Automatically fetches, executes, and reports distributed tasks for rewards.",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "src/index.js",
|
package/src/index.js
CHANGED
|
@@ -372,19 +372,25 @@ export default function register(api) {
|
|
|
372
372
|
const config = getActiveConfig();
|
|
373
373
|
const replySubject = `jobs.job.${jobId}.msg`;
|
|
374
374
|
|
|
375
|
-
//
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
375
|
+
// Pre-hiring Radio Silence:
|
|
376
|
+
// Only publish to the job channel if this node is hired (targeted)
|
|
377
|
+
// This prevents open market bidders from spamming the task chat with "Thinking..." messages.
|
|
378
|
+
if (metadata?.isTargeted) {
|
|
379
|
+
const chatPayload = {
|
|
380
|
+
id: crypto.randomUUID ? crypto.randomUUID() : (Math.random().toString(36).substring(2)),
|
|
381
|
+
job_id: jobId,
|
|
382
|
+
sender_id: config.nodeId || 'anonymous',
|
|
383
|
+
sender_type: 'node',
|
|
384
|
+
content: text,
|
|
385
|
+
created_at: new Date().toISOString(),
|
|
386
|
+
auth_token: config.secretKey // Secure token for backend validation
|
|
387
|
+
};
|
|
388
|
+
|
|
389
|
+
await js.publish(replySubject, new TextEncoder().encode(JSON.stringify(chatPayload)));
|
|
390
|
+
logger.info(`[pier-connector] 💬 Agent reply published directly to NATS chat for job ${jobId}`);
|
|
391
|
+
} else {
|
|
392
|
+
logger.debug(`[pier-connector] 🤫 Pre-hiring radio silence: suppressed chat for job ${jobId}`);
|
|
393
|
+
}
|
|
388
394
|
} catch (err) {
|
|
389
395
|
logger.error(`[pier-connector] Failed to publish realtime reply to NATS: ${err.message}`);
|
|
390
396
|
}
|
|
@@ -893,12 +899,14 @@ export default function register(api) {
|
|
|
893
899
|
let finalText = job.task;
|
|
894
900
|
if (!isTargeted) {
|
|
895
901
|
finalText = `【PIER MARKETPLACE OPEN JOB】
|
|
902
|
+
Job ID: ${job.id}
|
|
896
903
|
Task description:
|
|
897
904
|
${job.task}
|
|
898
905
|
|
|
899
906
|
=== CRITICAL WARNING ===
|
|
900
907
|
You MUST NOT execute or solve this task directly! This is a public request for proposals.
|
|
901
908
|
You MUST reply by calling the \`pier_bid_task\` tool to submit a pitch explaining why you are best suited, and optionally your price.
|
|
909
|
+
You MUST use the Job ID provided above when calling the tool.
|
|
902
910
|
Any direct answer will be considered a failure to follow protocol.`;
|
|
903
911
|
}
|
|
904
912
|
|