viveworker 0.4.0 ā 0.4.1
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/scripts/a2a-cli.mjs +13 -4
- package/scripts/a2a-handler.mjs +33 -17
- package/scripts/viveworker-bridge.mjs +2 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "viveworker",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.1",
|
|
4
4
|
"description": "Local mobile companion for Codex Desktop and Claude Desktop ā approvals, code review, Moltbook drafts, and A2A (Agent-to-Agent) task relay on your LAN.",
|
|
5
5
|
"author": "Yuta Hoshino <hoshino.lireneo@gmail.com>",
|
|
6
6
|
"license": "MIT",
|
package/scripts/a2a-cli.mjs
CHANGED
|
@@ -34,7 +34,7 @@ export async function runA2ACli(args) {
|
|
|
34
34
|
case "setup":
|
|
35
35
|
return handleSetup(args.slice(1));
|
|
36
36
|
default:
|
|
37
|
-
console.log("Usage: viveworker a2a setup --user-id <id> [--relay-url <url>] [--timeout <seconds>]");
|
|
37
|
+
console.log("Usage: viveworker a2a setup --user-id <id> [--description <text>] [--skills <csv>] [--relay-url <url>] [--timeout <seconds>]");
|
|
38
38
|
if (cmd && cmd !== "help" && cmd !== "--help") {
|
|
39
39
|
throw new Error(`Unknown command: ${cmd}`);
|
|
40
40
|
}
|
|
@@ -50,6 +50,8 @@ async function handleSetup(args) {
|
|
|
50
50
|
const userId = flags["user-id"] || flags["userId"];
|
|
51
51
|
const relayUrl = (flags["relay-url"] || flags["relayUrl"] || DEFAULT_RELAY_URL).replace(/\/$/u, "");
|
|
52
52
|
const timeout = Number(flags["timeout"]) || DEFAULT_TIMEOUT;
|
|
53
|
+
const description = flags["description"] || "";
|
|
54
|
+
const skillsRaw = flags["skills"] || "";
|
|
53
55
|
|
|
54
56
|
if (!userId) {
|
|
55
57
|
throw new Error("--user-id is required\nUsage: viveworker a2a setup --user-id <id>");
|
|
@@ -57,7 +59,10 @@ async function handleSetup(args) {
|
|
|
57
59
|
|
|
58
60
|
console.log(`\nš viveworker A2A Relay Setup`);
|
|
59
61
|
console.log(` Relay: ${relayUrl}`);
|
|
60
|
-
console.log(` User ID: ${userId}
|
|
62
|
+
console.log(` User ID: ${userId}`);
|
|
63
|
+
if (description) console.log(` Desc: ${description}`);
|
|
64
|
+
if (skillsRaw) console.log(` Skills: ${skillsRaw}`);
|
|
65
|
+
console.log();
|
|
61
66
|
|
|
62
67
|
// Step 1: Create setup session
|
|
63
68
|
console.log("ā³ Creating setup session...");
|
|
@@ -122,12 +127,16 @@ async function handleSetup(args) {
|
|
|
122
127
|
// File may not exist
|
|
123
128
|
}
|
|
124
129
|
|
|
125
|
-
const
|
|
130
|
+
const envVars = {
|
|
126
131
|
A2A_API_KEY: result.a2aApiKey,
|
|
127
132
|
A2A_RELAY_URL: result.relayUrl,
|
|
128
133
|
A2A_RELAY_USER_ID: result.userId,
|
|
129
134
|
A2A_RELAY_REGISTER_SECRET: result.registerSecret,
|
|
130
|
-
}
|
|
135
|
+
};
|
|
136
|
+
if (description) envVars.A2A_DESCRIPTION = description;
|
|
137
|
+
if (skillsRaw) envVars.A2A_SKILLS = skillsRaw;
|
|
138
|
+
|
|
139
|
+
const updated = upsertEnvText(currentEnv, envVars);
|
|
131
140
|
|
|
132
141
|
await fs.mkdir(path.dirname(A2A_ENV_FILE), { recursive: true, mode: 0o700 });
|
|
133
142
|
await fs.writeFile(A2A_ENV_FILE, updated, { mode: 0o600 });
|
package/scripts/a2a-handler.mjs
CHANGED
|
@@ -18,22 +18,22 @@ import crypto from "node:crypto";
|
|
|
18
18
|
|
|
19
19
|
export function buildAgentCard(config) {
|
|
20
20
|
const baseUrl = config.a2aPublicUrl || config.publicBaseUrl || `http://localhost:${config.port || 7860}`;
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
skills
|
|
21
|
+
|
|
22
|
+
// Custom description from A2A_DESCRIPTION env var (set during setup)
|
|
23
|
+
const description = config.a2aDescription ||
|
|
24
|
+
"LAN-connected AI companion that bridges Codex and Claude Desktop. " +
|
|
25
|
+
"Can execute coding tasks, file operations, and code reviews with human approval.";
|
|
26
|
+
|
|
27
|
+
// Custom skills from A2A_SKILLS env var (comma-separated tags ā skill objects)
|
|
28
|
+
let skills;
|
|
29
|
+
if (config.a2aSkills) {
|
|
30
|
+
skills = config.a2aSkills.split(",").map((s) => s.trim()).filter(Boolean).map((tag) => ({
|
|
31
|
+
id: tag,
|
|
32
|
+
name: tag,
|
|
33
|
+
description: tag,
|
|
34
|
+
}));
|
|
35
|
+
} else {
|
|
36
|
+
skills = [
|
|
37
37
|
{
|
|
38
38
|
id: "code-task",
|
|
39
39
|
name: "Code Task",
|
|
@@ -57,7 +57,23 @@ export function buildAgentCard(config) {
|
|
|
57
57
|
required: ["target"],
|
|
58
58
|
},
|
|
59
59
|
},
|
|
60
|
-
]
|
|
60
|
+
];
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
return {
|
|
64
|
+
schemaVersion: "1.0",
|
|
65
|
+
humanReadableId: `viveworker/${config.a2aRelayUserId || "viveworker"}`,
|
|
66
|
+
agentVersion: config.version || "0.3.0",
|
|
67
|
+
name: "viveworker",
|
|
68
|
+
description,
|
|
69
|
+
url: `${baseUrl.replace(/\/$/u, "")}/a2a`,
|
|
70
|
+
provider: { name: "viveworker" },
|
|
71
|
+
capabilities: {
|
|
72
|
+
a2aVersion: "0.2.3",
|
|
73
|
+
streaming: false,
|
|
74
|
+
pushNotifications: false,
|
|
75
|
+
},
|
|
76
|
+
skills,
|
|
61
77
|
authSchemes: [{ scheme: "apiKey", in: "header", name: "X-A2A-Key" }],
|
|
62
78
|
};
|
|
63
79
|
}
|
|
@@ -13787,6 +13787,8 @@ function buildConfig(cli) {
|
|
|
13787
13787
|
moltbookApiKey: cleanText(process.env.MOLTBOOK_API_KEY || readMoltbookEnvKey() || ""),
|
|
13788
13788
|
a2aApiKey: cleanText(process.env.A2A_API_KEY || readA2AEnvKey() || ""),
|
|
13789
13789
|
a2aPublicUrl: cleanText(process.env.A2A_PUBLIC_URL || ""),
|
|
13790
|
+
a2aDescription: cleanText(process.env.A2A_DESCRIPTION || ""),
|
|
13791
|
+
a2aSkills: cleanText(process.env.A2A_SKILLS || ""),
|
|
13790
13792
|
a2aRelayUrl: cleanText(process.env.A2A_RELAY_URL || ""),
|
|
13791
13793
|
a2aRelayUserId: cleanText(process.env.A2A_RELAY_USER_ID || ""),
|
|
13792
13794
|
a2aRelaySecret: cleanText(process.env.A2A_RELAY_SECRET || ""),
|