@gholl-studio/pier-connector 0.3.11 → 0.3.12
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/cli.ts +5 -0
- package/src/config.ts +5 -0
- package/src/inbound.ts +9 -0
- package/src/index.ts +5 -0
- package/src/job-handler.ts +5 -0
- package/src/robot.ts +5 -0
- package/src/types/pier-sdk.d.ts +5 -0
- package/src/types.ts +5 -0
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gholl-studio/pier-connector",
|
|
3
3
|
"author": "gholl",
|
|
4
|
-
"version": "0.3.
|
|
4
|
+
"version": "0.3.12",
|
|
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.ts",
|
package/src/cli.ts
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import fs from 'fs';
|
|
2
2
|
import path from 'path';
|
|
3
|
+
/**
|
|
4
|
+
* @file cli.ts
|
|
5
|
+
* @description Handles the plugin's CLI command registrations and setup interaction logic.
|
|
6
|
+
*/
|
|
7
|
+
|
|
3
8
|
import type { PierPluginApi } from './types.js';
|
|
4
9
|
|
|
5
10
|
export function registerCli(api: PierPluginApi, stats: any) {
|
package/src/config.ts
CHANGED
package/src/inbound.ts
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file inbound.ts
|
|
3
|
+
* @description Manages inbound message processing, agent routing resolution, and session context propagation.
|
|
4
|
+
*/
|
|
5
|
+
|
|
1
6
|
import type { PierPluginApi, InboundMessage } from './types.js';
|
|
2
7
|
import { truncate } from './job-handler.js';
|
|
3
8
|
|
|
@@ -105,6 +110,7 @@ export async function handleInbound(
|
|
|
105
110
|
|
|
106
111
|
const ctxPayload = api.runtime.channel.reply.finalizeInboundContext({
|
|
107
112
|
AgentId: finalAgentId,
|
|
113
|
+
agentId: finalAgentId, // Redundant for compatibility
|
|
108
114
|
Body: inbound.body,
|
|
109
115
|
BodyForAgent: inbound.body,
|
|
110
116
|
RawBody: inbound.body,
|
|
@@ -124,12 +130,15 @@ export async function handleInbound(
|
|
|
124
130
|
MessageId: jobId,
|
|
125
131
|
Metadata: {
|
|
126
132
|
...metadata,
|
|
133
|
+
agentId: finalAgentId, // Pinning in metadata
|
|
127
134
|
accountId: robot.accountId,
|
|
128
135
|
pierJobId: jobId,
|
|
129
136
|
routingSource: routingSource
|
|
130
137
|
}
|
|
131
138
|
});
|
|
132
139
|
|
|
140
|
+
logger.info(`[pier-connector:trace] FULL DISPATCH CONTEXT for job ${jobId}: ${JSON.stringify(ctxPayload)}`);
|
|
141
|
+
|
|
133
142
|
const { dispatcher, markDispatchIdle } = api.runtime.channel.reply.createReplyDispatcherWithTyping({
|
|
134
143
|
deliver: async (payload: any) => {
|
|
135
144
|
const currentMeta = robot.activeNodeJobs.get(jobId);
|
package/src/index.ts
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file index.ts
|
|
3
|
+
* @description Main entry point for the Pier Connector plugin. Orchestrates robots, tools, and channel registration.
|
|
4
|
+
*/
|
|
5
|
+
|
|
1
6
|
import { definePluginEntry } from 'openclaw/plugin-sdk/plugin-entry';
|
|
2
7
|
import { protocol } from '@gholl-studio/pier-sdk';
|
|
3
8
|
const { createRequestPayload } = protocol;
|
package/src/job-handler.ts
CHANGED
package/src/robot.ts
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file robot.ts
|
|
3
|
+
* @description Implements the PierRobot class, managing NATS connectivity, heartbeat, and job lifecycle.
|
|
4
|
+
*/
|
|
5
|
+
|
|
1
6
|
import { PierClient, protocol } from '@gholl-studio/pier-sdk';
|
|
2
7
|
const { createRequestPayload, createResultPayload, createErrorPayload } = protocol;
|
|
3
8
|
import { parseJob, safeRespond, truncate } from './job-handler.js';
|
package/src/types/pier-sdk.d.ts
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file pier-sdk.d.ts
|
|
3
|
+
* @description TypeScript declaration file for the @gholl-studio/pier-sdk to support plugin compilation.
|
|
4
|
+
*/
|
|
5
|
+
|
|
1
6
|
declare module '@gholl-studio/pier-sdk' {
|
|
2
7
|
export class PierClient {
|
|
3
8
|
constructor(config: { apiUrl: string; natsUrl?: string; logger?: any });
|
package/src/types.ts
CHANGED