@gholl-studio/pier-connector 0.2.18 → 0.2.19
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 +28 -11
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.19",
|
|
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
|
@@ -189,16 +189,32 @@ export default function register(api) {
|
|
|
189
189
|
});
|
|
190
190
|
|
|
191
191
|
const dynamicSessionKey = `pier-job-${jobId}`;
|
|
192
|
-
const
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
192
|
+
const metadata = activeNodeJobs.get(jobId);
|
|
193
|
+
let injectedPrompt = "";
|
|
194
|
+
|
|
195
|
+
if (metadata && metadata.isTargeted === false) {
|
|
196
|
+
injectedPrompt = [
|
|
197
|
+
"=========================================",
|
|
198
|
+
"CRITICAL DIRECTIVE - OPEN BIDDING MARKETPLACE",
|
|
199
|
+
"=========================================",
|
|
200
|
+
"You are an autonomous AI worker on Pier. This job currently has NO assigned worker.",
|
|
201
|
+
"1. DO NOT directly solve the user's task or output the final answer right now.",
|
|
202
|
+
"2. You MUST USE the `pier_bid_task` tool to send a pitch/bid to the employer explaining why you are best equipped to solve this, and state your price.",
|
|
203
|
+
"3. Stop executing after submitting the bid.",
|
|
204
|
+
inbound.systemPrompt ? `\nEmployer Guidelines:\n${inbound.systemPrompt}` : ""
|
|
205
|
+
].join('\n');
|
|
206
|
+
} else {
|
|
207
|
+
injectedPrompt = [
|
|
208
|
+
"=========================================",
|
|
209
|
+
"CRITICAL DIRECTIVE - PIER TRADING NETWORK",
|
|
210
|
+
"=========================================",
|
|
211
|
+
"You are an autonomous AI worker on Pier.",
|
|
212
|
+
"1. You MUST USE the `pier_finish_task` tool to submit the final result when your work is complete.",
|
|
213
|
+
"2. If you need to negotiate or clarify requirements with the employer, use `pier_chat`.",
|
|
214
|
+
"3. Do not just wait in silence. Always officially finish the task if the employer's goal is met.",
|
|
215
|
+
inbound.systemPrompt ? `\nEmployer Guidelines:\n${inbound.systemPrompt}` : ""
|
|
216
|
+
].join('\n');
|
|
217
|
+
}
|
|
202
218
|
|
|
203
219
|
const ctxPayload = api.runtime.channel.reply.finalizeInboundContext({
|
|
204
220
|
Body: inbound.text,
|
|
@@ -870,7 +886,8 @@ export default function register(api) {
|
|
|
870
886
|
pierNatsMsg: msg,
|
|
871
887
|
pierStartTime: performance.now(),
|
|
872
888
|
pierMeta: job.meta,
|
|
873
|
-
isRealtimeMsg: false
|
|
889
|
+
isRealtimeMsg: false,
|
|
890
|
+
isTargeted: isTargeted
|
|
874
891
|
});
|
|
875
892
|
|
|
876
893
|
const inbound = {
|