@gholl-studio/pier-connector 0.2.35 → 0.2.36

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/index.js +12 -2
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.35",
4
+ "version": "0.2.36",
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
@@ -49,10 +49,17 @@ export default function register(api) {
49
49
  }];
50
50
  }
51
51
 
52
- return Object.entries(rawAccounts).map(([id, account]) => ({
52
+ const configs = Object.entries(rawAccounts).map(([id, account]) => ({
53
53
  accountId: id,
54
54
  ...mergedCfgFrom(legacyCfg, account)
55
55
  }));
56
+
57
+ logger.info(`[pier-connector] Loaded ${configs.length} account(s): ${configs.map(c => c.accountId).join(', ')}`);
58
+ configs.forEach(c => {
59
+ if (c.agentId) logger.info(`[pier-connector] Account '${c.accountId}' has explicit agentId binding: ${c.agentId}`);
60
+ });
61
+
62
+ return configs;
56
63
  }
57
64
 
58
65
  function mergedCfgFrom(legacy, account) {
@@ -161,6 +168,9 @@ export default function register(api) {
161
168
  peer: { kind: 'direct', id: jobId }
162
169
  });
163
170
 
171
+ const finalAgentId = this.config.agentId || route.agentId;
172
+ logger.info(`[pier-connector] Routing account '${inbound.accountId}' -> agent '${finalAgentId}' (Source: ${this.config.agentId ? 'account-config' : (route.agentId ? 'global-bindings' : 'default-routing')})`);
173
+
164
174
  const dynamicSessionKey = `pier-job-${jobId}`;
165
175
  const metadata = this.activeNodeJobs.get(jobId);
166
176
  let injectedPrompt = "";
@@ -218,7 +228,7 @@ export default function register(api) {
218
228
 
219
229
  const { dispatcher, markDispatchIdle } = api.runtime.channel.reply.createReplyDispatcherWithTyping({
220
230
  cfg: api.runtime.config,
221
- agentId: this.config.agentId || route.agentId,
231
+ agentId: finalAgentId,
222
232
  deliver: async (payload) => {
223
233
  const currentMeta = this.activeNodeJobs.get(jobId);
224
234
  await pierChannel.outbound.sendText({