@a2hmarket/a2hmarket 1.0.0 → 1.0.2
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/openclaw.plugin.json +1 -1
- package/package.json +4 -1
- package/scripts/install.mjs +4 -3
- package/src/tools/order.ts +4 -2
- package/src/tools/send.ts +6 -3
- package/src/tools/tempo-payment.ts +2 -1
package/openclaw.plugin.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@a2hmarket/a2hmarket",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"files": [
|
|
6
6
|
"index.ts",
|
|
@@ -27,6 +27,9 @@
|
|
|
27
27
|
"extensions": [
|
|
28
28
|
"./index.ts"
|
|
29
29
|
],
|
|
30
|
+
"compat": {
|
|
31
|
+
"pluginApi": ">=2026.3.0"
|
|
32
|
+
},
|
|
30
33
|
"build": {
|
|
31
34
|
"openclawVersion": "2026.3.24"
|
|
32
35
|
},
|
package/scripts/install.mjs
CHANGED
|
@@ -26,7 +26,8 @@ const CREDS_FILE = join(CREDS_DIR, "credentials.json");
|
|
|
26
26
|
const A2H_STORE_DIR = join(homedir(), ".a2h_store");
|
|
27
27
|
const A2H_CONFIG_DIR = join(A2H_STORE_DIR, "a2h_config");
|
|
28
28
|
const A2H_DATA_DIR = join(A2H_STORE_DIR, "a2h_data");
|
|
29
|
-
const NPM_SPEC = "@a2hmarket/a2hmarket";
|
|
29
|
+
const NPM_SPEC = "@a2hmarket/a2hmarket"; // npm package name (for npx entry point)
|
|
30
|
+
const CLAWHUB_SPEC = "clawhub:a2hmarket"; // clawhub package name (for openclaw install)
|
|
30
31
|
|
|
31
32
|
const AUTH_API_URL = "https://web.a2hmarket.ai";
|
|
32
33
|
const LOGIN_URL = "https://a2hmarket.ai";
|
|
@@ -366,7 +367,7 @@ async function runUpdate() {
|
|
|
366
367
|
execSync(`rm -rf "${extDir}"`, { stdio: "pipe" });
|
|
367
368
|
}
|
|
368
369
|
log(` Installing new version...`);
|
|
369
|
-
execSync(`yes 2>/dev/null | openclaw plugins install ${
|
|
370
|
+
execSync(`yes 2>/dev/null | openclaw plugins install ${CLAWHUB_SPEC} 2>&1`, { encoding: "utf-8", stdio: "pipe" });
|
|
370
371
|
log(` ${CHECK} Update complete`);
|
|
371
372
|
} catch (err) {
|
|
372
373
|
log(` ${CROSS} Update failed: ${err.message}`);
|
|
@@ -684,7 +685,7 @@ async function main() {
|
|
|
684
685
|
execSync(`rm -rf "${extDir}"`, { stdio: "pipe" });
|
|
685
686
|
}
|
|
686
687
|
log(` Installing...`);
|
|
687
|
-
execSync(`yes 2>/dev/null | openclaw plugins install ${
|
|
688
|
+
execSync(`yes 2>/dev/null | openclaw plugins install ${CLAWHUB_SPEC} 2>&1`, {
|
|
688
689
|
encoding: "utf-8",
|
|
689
690
|
stdio: "pipe",
|
|
690
691
|
});
|
package/src/tools/order.ts
CHANGED
|
@@ -6,7 +6,8 @@ export function registerOrderTools(api: OpenClawPluginApi, client: A2HApiClient)
|
|
|
6
6
|
api.registerTool({
|
|
7
7
|
name: "a2h_order_create",
|
|
8
8
|
description:
|
|
9
|
-
"Create a new order (seller side). order_type=2: seller takes buyer's demand task. order_type=3: buyer purchases seller's service."
|
|
9
|
+
"Create a new order (seller side). order_type=2: seller takes buyer's demand task. order_type=3: buyer purchases seller's service. " +
|
|
10
|
+
"REQUIRES human approval first — call a2h_create_approval(peer_id=customer_id) and wait for approval before calling this tool.",
|
|
10
11
|
parameters: {
|
|
11
12
|
type: "object",
|
|
12
13
|
properties: {
|
|
@@ -47,7 +48,8 @@ export function registerOrderTools(api: OpenClawPluginApi, client: A2HApiClient)
|
|
|
47
48
|
api.registerTool({
|
|
48
49
|
name: "a2h_order_action",
|
|
49
50
|
description:
|
|
50
|
-
"Perform an action on an order: confirm (buyer), reject (buyer), cancel (seller), confirm-received (seller confirms payment), confirm-service-completed (buyer confirms delivery)."
|
|
51
|
+
"Perform an action on an order: confirm (buyer), reject (buyer), cancel (seller), confirm-received (seller confirms payment), confirm-service-completed (buyer confirms delivery). " +
|
|
52
|
+
"All actions require human approval first — call a2h_create_approval before this tool.",
|
|
51
53
|
parameters: {
|
|
52
54
|
type: "object",
|
|
53
55
|
properties: {
|
package/src/tools/send.ts
CHANGED
|
@@ -10,9 +10,12 @@ export function registerSendTool(api: OpenClawPluginApi, creds: A2HCredentials)
|
|
|
10
10
|
api.registerTool({
|
|
11
11
|
name: "a2h_send",
|
|
12
12
|
description:
|
|
13
|
-
"Send an A2A message to another agent.
|
|
14
|
-
"
|
|
15
|
-
"
|
|
13
|
+
"Send an A2A message to another agent. Use this for ALL messages to other agents — " +
|
|
14
|
+
"both proactive outreach AND replies to inbound messages. " +
|
|
15
|
+
"Your text output only notifies the human; it does NOT reach the other agent. " +
|
|
16
|
+
"To actually send a reply, you MUST call a2h_send with target_agent_id from the message prefix. " +
|
|
17
|
+
"When discussing a specific service/demand post, include works_id. " +
|
|
18
|
+
"For order-related messages, include orderId in extra_payload so the recipient can match the order. " +
|
|
16
19
|
"Supports text, works_id, payment QR code, attachment, and arbitrary extra payload fields.",
|
|
17
20
|
parameters: {
|
|
18
21
|
type: "object",
|
|
@@ -158,7 +158,8 @@ export function registerTempoPaymentTools(
|
|
|
158
158
|
name: "a2h_tempo_transfer",
|
|
159
159
|
description:
|
|
160
160
|
"Send an on-chain AlphaUSD payment on Tempo blockchain. " +
|
|
161
|
-
"The tool
|
|
161
|
+
"The tool verifies you are the buyer (rejects if you are the seller). " +
|
|
162
|
+
"REQUIRES human approval first — call a2h_create_approval before this tool and wait for approval. " +
|
|
162
163
|
"Use the sellerAddress, amount_cents, and memo from the seller's checkout/payment info.",
|
|
163
164
|
parameters: {
|
|
164
165
|
type: "object",
|