@gholl-studio/pier-connector 0.2.49 → 0.2.50

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 -7
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.49",
4
+ "version": "0.2.50",
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
@@ -38,11 +38,15 @@ export default function register(api) {
38
38
  // ── resolve plugin config ──────────────────────────────────────────
39
39
 
40
40
  function resolveConfigs() {
41
- const rawAccounts = api.config?.channels?.['pier']?.accounts || {};
42
- const legacyCfg = api.config?.plugins?.entries?.['pier-connector']?.config || {};
41
+ const globalAccounts = api.runtime?.config?.channels?.['pier']?.accounts || {};
42
+ const pluginAccounts = api.config?.channels?.['pier']?.accounts || {};
43
+ const rawAccounts = { ...globalAccounts, ...pluginAccounts };
43
44
 
44
- // If no accounts defined, fallback to 'default' using legacy/env config
45
+ const legacyCfg = api.config?.plugins?.entries?.['pier-connector']?.config || api.config || {};
46
+
47
+ // If no accounts defined at all, fallback to 'default' using legacy/env config
45
48
  if (Object.keys(rawAccounts).length === 0) {
49
+ logger.info(`[pier-connector] No accounts found in global or plugin config. Falling back to default.`);
46
50
  return [{
47
51
  accountId: 'default',
48
52
  ...mergedCfgFrom(legacyCfg, {})
@@ -163,10 +167,11 @@ export default function register(api) {
163
167
 
164
168
  logger.info(`[pier-connector:trace] receiveIncoming triggered. inbound.accountId='${inbound.accountId}', inbound.senderId='${inbound.senderId}'`);
165
169
 
170
+ const globalConfig = api.runtime?.config || {};
166
171
  const route = api.runtime.channel.routing.resolveAgentRoute({
167
- cfg: api.runtime.config,
172
+ cfg: globalConfig,
168
173
  channel: 'pier',
169
- account: inbound.accountId, // Fixed: parameter name should be 'account'
174
+ account: inbound.accountId,
170
175
  peer: { kind: 'direct', id: jobId }
171
176
  });
172
177
 
@@ -177,8 +182,8 @@ export default function register(api) {
177
182
  let routingSource = 'account-config';
178
183
 
179
184
  // 2. Robust manual parse (safeguard against OpenClaw core parsing bugs)
180
- if (!finalAgentId && api.runtime?.config) {
181
- const cfg = api.runtime.config;
185
+ if (!finalAgentId) {
186
+ const cfg = globalConfig;
182
187
  const bs = Array.isArray(cfg.bindings) ? cfg.bindings : [];
183
188
  const al = Array.isArray(cfg.agents?.list) ? cfg.agents.list : [];
184
189