@nokai/cli 1.0.0
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/LICENSE +21 -0
- package/README.md +193 -0
- package/dist/connection-manager.d.ts +45 -0
- package/dist/connection-manager.d.ts.map +1 -0
- package/dist/connection-manager.js +262 -0
- package/dist/connection-manager.js.map +1 -0
- package/dist/crypto.d.ts +8 -0
- package/dist/crypto.d.ts.map +1 -0
- package/dist/crypto.js +42 -0
- package/dist/crypto.js.map +1 -0
- package/dist/db.d.ts +47 -0
- package/dist/db.d.ts.map +1 -0
- package/dist/db.js +195 -0
- package/dist/db.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +9 -0
- package/dist/index.js.map +1 -0
- package/dist/message-protocol.d.ts +9 -0
- package/dist/message-protocol.d.ts.map +1 -0
- package/dist/message-protocol.js +85 -0
- package/dist/message-protocol.js.map +1 -0
- package/dist/peer-connection.d.ts +40 -0
- package/dist/peer-connection.d.ts.map +1 -0
- package/dist/peer-connection.js +159 -0
- package/dist/peer-connection.js.map +1 -0
- package/dist/profile.d.ts +11 -0
- package/dist/profile.d.ts.map +1 -0
- package/dist/profile.js +62 -0
- package/dist/profile.js.map +1 -0
- package/dist/server.d.ts +2 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +185 -0
- package/dist/server.js.map +1 -0
- package/dist/shared/constants.d.ts +20 -0
- package/dist/shared/constants.d.ts.map +1 -0
- package/dist/shared/constants.js +23 -0
- package/dist/shared/constants.js.map +1 -0
- package/dist/shared/index.d.ts +3 -0
- package/dist/shared/index.d.ts.map +1 -0
- package/dist/shared/index.js +19 -0
- package/dist/shared/index.js.map +1 -0
- package/dist/shared/types.d.ts +128 -0
- package/dist/shared/types.d.ts.map +1 -0
- package/dist/shared/types.js +41 -0
- package/dist/shared/types.js.map +1 -0
- package/dist/signaling-client.d.ts +19 -0
- package/dist/signaling-client.d.ts.map +1 -0
- package/dist/signaling-client.js +83 -0
- package/dist/signaling-client.js.map +1 -0
- package/dist/tools/approve.d.ts +30 -0
- package/dist/tools/approve.d.ts.map +1 -0
- package/dist/tools/approve.js +46 -0
- package/dist/tools/approve.js.map +1 -0
- package/dist/tools/ask.d.ts +29 -0
- package/dist/tools/ask.d.ts.map +1 -0
- package/dist/tools/ask.js +43 -0
- package/dist/tools/ask.js.map +1 -0
- package/dist/tools/audit.d.ts +24 -0
- package/dist/tools/audit.d.ts.map +1 -0
- package/dist/tools/audit.js +39 -0
- package/dist/tools/audit.js.map +1 -0
- package/dist/tools/connect.d.ts +15 -0
- package/dist/tools/connect.d.ts.map +1 -0
- package/dist/tools/connect.js +62 -0
- package/dist/tools/connect.js.map +1 -0
- package/dist/tools/connections.d.ts +13 -0
- package/dist/tools/connections.d.ts.map +1 -0
- package/dist/tools/connections.js +34 -0
- package/dist/tools/connections.js.map +1 -0
- package/dist/tools/disconnect.d.ts +19 -0
- package/dist/tools/disconnect.d.ts.map +1 -0
- package/dist/tools/disconnect.js +23 -0
- package/dist/tools/disconnect.js.map +1 -0
- package/dist/tools/history.d.ts +24 -0
- package/dist/tools/history.d.ts.map +1 -0
- package/dist/tools/history.js +47 -0
- package/dist/tools/history.js.map +1 -0
- package/dist/tools/join.d.ts +22 -0
- package/dist/tools/join.d.ts.map +1 -0
- package/dist/tools/join.js +60 -0
- package/dist/tools/join.js.map +1 -0
- package/dist/tools/permissions.d.ts +24 -0
- package/dist/tools/permissions.d.ts.map +1 -0
- package/dist/tools/permissions.js +32 -0
- package/dist/tools/permissions.js.map +1 -0
- package/dist/tools/profile-tool.d.ts +29 -0
- package/dist/tools/profile-tool.d.ts.map +1 -0
- package/dist/tools/profile-tool.js +72 -0
- package/dist/tools/profile-tool.js.map +1 -0
- package/dist/tools/reconnect.d.ts +22 -0
- package/dist/tools/reconnect.d.ts.map +1 -0
- package/dist/tools/reconnect.js +88 -0
- package/dist/tools/reconnect.js.map +1 -0
- package/dist/tools/respond.d.ts +37 -0
- package/dist/tools/respond.d.ts.map +1 -0
- package/dist/tools/respond.js +31 -0
- package/dist/tools/respond.js.map +1 -0
- package/dist/tools/tell.d.ts +29 -0
- package/dist/tools/tell.d.ts.map +1 -0
- package/dist/tools/tell.js +45 -0
- package/dist/tools/tell.js.map +1 -0
- package/package.json +54 -0
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.permissionsToolDefinition = void 0;
|
|
4
|
+
exports.handlePermissions = handlePermissions;
|
|
5
|
+
exports.permissionsToolDefinition = {
|
|
6
|
+
name: "nokai_permissions",
|
|
7
|
+
description: "View or change the permission level for a connection. Levels: read-only (default), read-write (allows actions), ask-only (only explicit questions).",
|
|
8
|
+
inputSchema: {
|
|
9
|
+
type: "object",
|
|
10
|
+
properties: {
|
|
11
|
+
peer: { type: "string", description: "Name of the peer" },
|
|
12
|
+
level: { type: "string", description: "New permission level: read-only, read-write, or ask-only. Omit to view current level." },
|
|
13
|
+
},
|
|
14
|
+
required: ["peer"],
|
|
15
|
+
},
|
|
16
|
+
};
|
|
17
|
+
async function handlePermissions(args, db) {
|
|
18
|
+
const conn = db.getConnectionByPeerName(args.peer);
|
|
19
|
+
if (!conn) {
|
|
20
|
+
return `No connection found with "${args.peer}".`;
|
|
21
|
+
}
|
|
22
|
+
if (!args.level) {
|
|
23
|
+
return `Permission for ${args.peer}: **${conn.permission}**\n\nAvailable levels:\n- **read-only**: Can answer questions only\n- **read-write**: Can answer questions and make code changes\n- **ask-only**: Can only respond to explicit questions`;
|
|
24
|
+
}
|
|
25
|
+
const validLevels = ["read-only", "read-write", "ask-only"];
|
|
26
|
+
if (!validLevels.includes(args.level)) {
|
|
27
|
+
return `Invalid permission level "${args.level}". Use: read-only, read-write, or ask-only.`;
|
|
28
|
+
}
|
|
29
|
+
db.updatePermission(conn.id, args.level);
|
|
30
|
+
return `Permission for ${args.peer} updated to **${args.level}**.`;
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=permissions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"permissions.js","sourceRoot":"","sources":["../../src/tools/permissions.ts"],"names":[],"mappings":";;;AAiBA,8CAoBC;AAlCY,QAAA,yBAAyB,GAAG;IACvC,IAAI,EAAE,mBAAmB;IACzB,WAAW,EACT,qJAAqJ;IACvJ,WAAW,EAAE;QACX,IAAI,EAAE,QAAiB;QACvB,UAAU,EAAE;YACV,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,kBAAkB,EAAE;YACzD,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,uFAAuF,EAAE;SAChI;QACD,QAAQ,EAAE,CAAC,MAAM,CAAC;KACnB;CACF,CAAC;AAEK,KAAK,UAAU,iBAAiB,CACrC,IAAsC,EACtC,EAAW;IAEX,MAAM,IAAI,GAAG,EAAE,CAAC,uBAAuB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACnD,IAAI,CAAC,IAAI,EAAE,CAAC;QACV,OAAO,6BAA6B,IAAI,CAAC,IAAI,IAAI,CAAC;IACpD,CAAC;IAED,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC;QAChB,OAAO,kBAAkB,IAAI,CAAC,IAAI,OAAO,IAAI,CAAC,UAAU,2LAA2L,CAAC;IACtP,CAAC;IAED,MAAM,WAAW,GAAiB,CAAC,WAAW,EAAE,YAAY,EAAE,UAAU,CAAC,CAAC;IAC1E,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAmB,CAAC,EAAE,CAAC;QACpD,OAAO,6BAA6B,IAAI,CAAC,KAAK,6CAA6C,CAAC;IAC9F,CAAC;IAED,EAAE,CAAC,gBAAgB,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,KAAmB,CAAC,CAAC;IACvD,OAAO,kBAAkB,IAAI,CAAC,IAAI,iBAAiB,IAAI,CAAC,KAAK,KAAK,CAAC;AACrE,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { AgentProfile } from "../shared/index.js";
|
|
2
|
+
export declare const profileToolDefinition: {
|
|
3
|
+
name: string;
|
|
4
|
+
description: string;
|
|
5
|
+
inputSchema: {
|
|
6
|
+
type: "object";
|
|
7
|
+
properties: {
|
|
8
|
+
action: {
|
|
9
|
+
type: string;
|
|
10
|
+
description: string;
|
|
11
|
+
};
|
|
12
|
+
name: {
|
|
13
|
+
type: string;
|
|
14
|
+
description: string;
|
|
15
|
+
};
|
|
16
|
+
description: {
|
|
17
|
+
type: string;
|
|
18
|
+
description: string;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
required: string[];
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
export declare function handleProfile(args: {
|
|
25
|
+
action: string;
|
|
26
|
+
name?: string;
|
|
27
|
+
description?: string;
|
|
28
|
+
}, profile: AgentProfile, dir?: string): Promise<string>;
|
|
29
|
+
//# sourceMappingURL=profile-tool.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"profile-tool.d.ts","sourceRoot":"","sources":["../../src/tools/profile-tool.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAGvD,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;CAajC,CAAC;AAEF,wBAAsB,aAAa,CACjC,IAAI,EAAE;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,CAAA;CAAE,EAC7D,OAAO,EAAE,YAAY,EACrB,GAAG,CAAC,EAAE,MAAM,GACX,OAAO,CAAC,MAAM,CAAC,CAuDjB"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.profileToolDefinition = void 0;
|
|
4
|
+
exports.handleProfile = handleProfile;
|
|
5
|
+
const profile_js_1 = require("../profile.js");
|
|
6
|
+
exports.profileToolDefinition = {
|
|
7
|
+
name: "nokai_profile",
|
|
8
|
+
description: "View or update your agent profile and capability card. Capabilities tell other agents what codebases and technologies you know about.",
|
|
9
|
+
inputSchema: {
|
|
10
|
+
type: "object",
|
|
11
|
+
properties: {
|
|
12
|
+
action: { type: "string", description: "view, add_capability, remove_capability, or clear_capabilities" },
|
|
13
|
+
name: { type: "string", description: "Capability name (for add/remove)" },
|
|
14
|
+
description: { type: "string", description: "Capability description (for add)" },
|
|
15
|
+
},
|
|
16
|
+
required: ["action"],
|
|
17
|
+
},
|
|
18
|
+
};
|
|
19
|
+
async function handleProfile(args, profile, dir) {
|
|
20
|
+
switch (args.action) {
|
|
21
|
+
case "view": {
|
|
22
|
+
const caps = (0, profile_js_1.loadProfileCapabilities)(dir);
|
|
23
|
+
let result = `## Agent Profile: ${profile.name}\n\n`;
|
|
24
|
+
result += `Device ID: ${profile.deviceId}\n`;
|
|
25
|
+
result += `Public Key: ${profile.publicKey.slice(0, 16)}...\n\n`;
|
|
26
|
+
if (caps.length === 0) {
|
|
27
|
+
result += "No capabilities defined. Use `nokai_profile` with action `add_capability` to describe what your codebase does.";
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
result += "### Capabilities\n\n";
|
|
31
|
+
for (const cap of caps) {
|
|
32
|
+
result += `- **${cap.name}**: ${cap.description}\n`;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
return result;
|
|
36
|
+
}
|
|
37
|
+
case "add_capability": {
|
|
38
|
+
if (!args.name || !args.description) {
|
|
39
|
+
return "Error: Both `name` and `description` are required for add_capability.";
|
|
40
|
+
}
|
|
41
|
+
const caps = (0, profile_js_1.loadProfileCapabilities)(dir);
|
|
42
|
+
const existing = caps.findIndex((c) => c.name === args.name);
|
|
43
|
+
if (existing >= 0) {
|
|
44
|
+
caps[existing].description = args.description;
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
caps.push({ name: args.name, description: args.description });
|
|
48
|
+
}
|
|
49
|
+
(0, profile_js_1.updateProfileCapabilities)(caps, dir);
|
|
50
|
+
return `Capability "${args.name}" added to your profile.`;
|
|
51
|
+
}
|
|
52
|
+
case "remove_capability": {
|
|
53
|
+
if (!args.name) {
|
|
54
|
+
return "Error: `name` is required for remove_capability.";
|
|
55
|
+
}
|
|
56
|
+
const caps = (0, profile_js_1.loadProfileCapabilities)(dir);
|
|
57
|
+
const filtered = caps.filter((c) => c.name !== args.name);
|
|
58
|
+
if (filtered.length === caps.length) {
|
|
59
|
+
return `Capability "${args.name}" not found.`;
|
|
60
|
+
}
|
|
61
|
+
(0, profile_js_1.updateProfileCapabilities)(filtered, dir);
|
|
62
|
+
return `Capability "${args.name}" removed from your profile.`;
|
|
63
|
+
}
|
|
64
|
+
case "clear_capabilities": {
|
|
65
|
+
(0, profile_js_1.updateProfileCapabilities)([], dir);
|
|
66
|
+
return "All capabilities cleared.";
|
|
67
|
+
}
|
|
68
|
+
default:
|
|
69
|
+
return `Unknown action "${args.action}". Use: view, add_capability, remove_capability, or clear_capabilities.`;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
//# sourceMappingURL=profile-tool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"profile-tool.js","sourceRoot":"","sources":["../../src/tools/profile-tool.ts"],"names":[],"mappings":";;;AAkBA,sCA2DC;AA5ED,8CAAyG;AAE5F,QAAA,qBAAqB,GAAG;IACnC,IAAI,EAAE,eAAe;IACrB,WAAW,EACT,uIAAuI;IACzI,WAAW,EAAE;QACX,IAAI,EAAE,QAAiB;QACvB,UAAU,EAAE;YACV,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,gEAAgE,EAAE;YACzG,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,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0,0 +1,22 @@
|
|
|
1
|
+
import type { AgentProfile } from "../shared/index.js";
|
|
2
|
+
import type { ConnectionManager } from "../connection-manager.js";
|
|
3
|
+
import type { SignalingClient } from "../signaling-client.js";
|
|
4
|
+
import { type PeerConnectionConfig } from "../peer-connection.js";
|
|
5
|
+
export declare const reconnectToolDefinition: {
|
|
6
|
+
name: string;
|
|
7
|
+
description: string;
|
|
8
|
+
inputSchema: {
|
|
9
|
+
type: "object";
|
|
10
|
+
properties: {
|
|
11
|
+
peer: {
|
|
12
|
+
type: string;
|
|
13
|
+
description: string;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
required: string[];
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
export declare function handleReconnect(args: {
|
|
20
|
+
peer: string;
|
|
21
|
+
}, profile: AgentProfile, signalingClient: SignalingClient, connectionManager: ConnectionManager, pcConfig?: PeerConnectionConfig): Promise<string>;
|
|
22
|
+
//# sourceMappingURL=reconnect.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reconnect.d.ts","sourceRoot":"","sources":["../../src/tools/reconnect.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEvD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAkB,KAAK,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAElF,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;CAWnC,CAAC;AAEF,wBAAsB,eAAe,CACnC,IAAI,EAAE;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,EACtB,OAAO,EAAE,YAAY,EACrB,eAAe,EAAE,eAAe,EAChC,iBAAiB,EAAE,iBAAiB,EACpC,QAAQ,CAAC,EAAE,oBAAoB,GAC9B,OAAO,CAAC,MAAM,CAAC,CA0FjB"}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.reconnectToolDefinition = void 0;
|
|
4
|
+
exports.handleReconnect = handleReconnect;
|
|
5
|
+
const index_js_1 = require("../shared/index.js");
|
|
6
|
+
const peer_connection_js_1 = require("../peer-connection.js");
|
|
7
|
+
exports.reconnectToolDefinition = {
|
|
8
|
+
name: "nokai_reconnect",
|
|
9
|
+
description: "Reconnect to a previously connected peer. No new OTP needed — the peer will be asked to confirm. If no peer name given, lists saved connections.",
|
|
10
|
+
inputSchema: {
|
|
11
|
+
type: "object",
|
|
12
|
+
properties: {
|
|
13
|
+
peer: { type: "string", description: "Name of the saved peer to reconnect to (leave empty to list saved connections)" },
|
|
14
|
+
},
|
|
15
|
+
required: ["peer"],
|
|
16
|
+
},
|
|
17
|
+
};
|
|
18
|
+
async function handleReconnect(args, profile, signalingClient, connectionManager, pcConfig) {
|
|
19
|
+
// If no peer specified, list saved connections
|
|
20
|
+
if (!args.peer) {
|
|
21
|
+
const saved = connectionManager.getSavedConnections();
|
|
22
|
+
if (saved.length === 0) {
|
|
23
|
+
return "No saved connections. Use nokai_connect to create a new connection.";
|
|
24
|
+
}
|
|
25
|
+
let result = "## Saved Connections (available for reconnection)\n\n";
|
|
26
|
+
for (const conn of saved) {
|
|
27
|
+
result += `- **${conn.peerName}** (last connected: ${conn.lastConnected || "never"})\n`;
|
|
28
|
+
}
|
|
29
|
+
result += `\nUse \`nokai_reconnect\` with a peer name to reconnect.`;
|
|
30
|
+
return result;
|
|
31
|
+
}
|
|
32
|
+
// Check if already connected
|
|
33
|
+
const active = connectionManager.getActiveConnections();
|
|
34
|
+
if (active.some((a) => a.peerName === args.peer)) {
|
|
35
|
+
return `Already connected to ${args.peer}. Use nokai_ask to send questions.`;
|
|
36
|
+
}
|
|
37
|
+
// Find saved connection
|
|
38
|
+
const conn = connectionManager.findSavedConnection(args.peer);
|
|
39
|
+
if (!conn) {
|
|
40
|
+
return `No saved connection with "${args.peer}". Use nokai_connect to create a new connection.`;
|
|
41
|
+
}
|
|
42
|
+
if (!signalingClient.isConnected()) {
|
|
43
|
+
return "Error: Not connected to signaling server. Please try again.";
|
|
44
|
+
}
|
|
45
|
+
return new Promise((resolve) => {
|
|
46
|
+
const timeout = setTimeout(() => {
|
|
47
|
+
resolve(`Reconnection request sent to ${args.peer}, but they haven't responded yet.\n` +
|
|
48
|
+
`They may be offline. The request will be retried when they come online.`);
|
|
49
|
+
}, index_js_1.RECONNECT_TIMEOUT_MS);
|
|
50
|
+
// Listen for the peer to accept (server sends otp_matched on reconnect accept)
|
|
51
|
+
signalingClient.once("otp_matched", async (matchData) => {
|
|
52
|
+
clearTimeout(timeout);
|
|
53
|
+
const pc = new peer_connection_js_1.PeerConnection(pcConfig);
|
|
54
|
+
pc.onIceCandidate((candidate) => {
|
|
55
|
+
signalingClient.signal(matchData.peerId, { type: "ice", ...candidate });
|
|
56
|
+
});
|
|
57
|
+
signalingClient.on("signal", (signalData) => {
|
|
58
|
+
if (signalData.from === matchData.peerId) {
|
|
59
|
+
if (signalData.data.type === "ice") {
|
|
60
|
+
pc.addIceCandidate({
|
|
61
|
+
candidate: signalData.data.candidate,
|
|
62
|
+
mid: signalData.data.mid,
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
else if (signalData.data.type === "answer") {
|
|
66
|
+
pc.acceptAnswer({
|
|
67
|
+
type: "answer",
|
|
68
|
+
sdp: signalData.data.sdp,
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
const offer = await pc.createOffer();
|
|
74
|
+
signalingClient.signal(matchData.peerId, { type: "offer", sdp: offer.sdp });
|
|
75
|
+
await pc.waitForDataChannel();
|
|
76
|
+
connectionManager.reactivateConnection(conn.id, (msg) => pc.send(msg));
|
|
77
|
+
connectionManager.setPeerClose(conn.id, () => pc.close());
|
|
78
|
+
pc.onMessage((msg) => connectionManager.handleIncomingMessage(conn.id, msg));
|
|
79
|
+
resolve(`Reconnected with ${args.peer}!\n` +
|
|
80
|
+
`Connection ID: ${conn.id}\n` +
|
|
81
|
+
`Permission: ${conn.permission}\n` +
|
|
82
|
+
`You can now use nokai_ask to send questions to ${args.peer}.`);
|
|
83
|
+
});
|
|
84
|
+
// Send reconnect request
|
|
85
|
+
signalingClient.reconnectRequest(conn.peerPublicKey, profile.name, profile.publicKey, profile.deviceId);
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
//# sourceMappingURL=reconnect.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reconnect.js","sourceRoot":"","sources":["../../src/tools/reconnect.ts"],"names":[],"mappings":";;;AAmBA,0CAgGC;AAlHD,iDAA0D;AAG1D,8DAAkF;AAErE,QAAA,uBAAuB,GAAG;IACrC,IAAI,EAAE,iBAAiB;IACvB,WAAW,EACT,kJAAkJ;IACpJ,WAAW,EAAE;QACX,IAAI,EAAE,QAAiB;QACvB,UAAU,EAAE;YACV,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,gFAAgF,EAAE;SACxH;QACD,QAAQ,EAAE,CAAC,MAAM,CAAC;KACnB;CACF,CAAC;AAEK,KAAK,UAAU,eAAe,CACnC,IAAsB,EACtB,OAAqB,EACrB,eAAgC,EAChC,iBAAoC,EACpC,QAA+B;IAE/B,+CAA+C;IAC/C,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;QACf,MAAM,KAAK,GAAG,iBAAiB,CAAC,mBAAmB,EAAE,CAAC;QACtD,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACvB,OAAO,qEAAqE,CAAC;QAC/E,CAAC;QACD,IAAI,MAAM,GAAG,uDAAuD,CAAC;QACrE,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;YACzB,MAAM,IAAI,OAAO,IAAI,CAAC,QAAQ,uBAAu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AAqB,CAAC,IAAI,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC,CAAC;YAE7E,OAAO,CACL,oBAAoB,IAAI,CAAC,IAAI,KAAK;gBAClC,kBAAkB,IAAI,CAAC,EAAE,IAAI;gBAC7B,eAAe,IAAI,CAAC,UAAU,IAAI;gBAClC,kDAAkD,IAAI,CAAC,IAAI,GAAG,CAC/D,CAAC;QACJ,CAAC,CAAC,CAAC;QAEH,yBAAyB;QACzB,eAAe,CAAC,gBAAgB,CAC9B,IAAI,CAAC,aAAa,EAClB,OAAO,CAAC,IAAI,EACZ,OAAO,CAAC,SAAS,EACjB,OAAO,CAAC,QAAQ,CACjB,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { ConnectionManager } from "../connection-manager.js";
|
|
2
|
+
export declare const respondToolDefinition: {
|
|
3
|
+
name: string;
|
|
4
|
+
description: string;
|
|
5
|
+
inputSchema: {
|
|
6
|
+
type: "object";
|
|
7
|
+
properties: {
|
|
8
|
+
peer: {
|
|
9
|
+
type: string;
|
|
10
|
+
description: string;
|
|
11
|
+
};
|
|
12
|
+
reply_to: {
|
|
13
|
+
type: string;
|
|
14
|
+
description: string;
|
|
15
|
+
};
|
|
16
|
+
response: {
|
|
17
|
+
type: string;
|
|
18
|
+
description: string;
|
|
19
|
+
};
|
|
20
|
+
source_files: {
|
|
21
|
+
type: string;
|
|
22
|
+
items: {
|
|
23
|
+
type: string;
|
|
24
|
+
};
|
|
25
|
+
description: string;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
required: string[];
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
export declare function handleRespond(args: {
|
|
32
|
+
peer: string;
|
|
33
|
+
reply_to: string;
|
|
34
|
+
response: string;
|
|
35
|
+
source_files?: string[];
|
|
36
|
+
}, connectionManager: ConnectionManager): Promise<string>;
|
|
37
|
+
//# sourceMappingURL=respond.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"respond.d.ts","sourceRoot":"","sources":["../../src/tools/respond.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAElE,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiBjC,CAAC;AAEF,wBAAsB,aAAa,CACjC,IAAI,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,YAAY,CAAC,EAAE,MAAM,EAAE,CAAA;CAAE,EACnF,iBAAiB,EAAE,iBAAiB,GACnC,OAAO,CAAC,MAAM,CAAC,CAOjB"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.respondToolDefinition = void 0;
|
|
4
|
+
exports.handleRespond = handleRespond;
|
|
5
|
+
exports.respondToolDefinition = {
|
|
6
|
+
name: "nokai_respond",
|
|
7
|
+
description: "Reply to an incoming question from a connected peer. Read the local codebase to find the answer, then use this tool to send the response back.",
|
|
8
|
+
inputSchema: {
|
|
9
|
+
type: "object",
|
|
10
|
+
properties: {
|
|
11
|
+
peer: { type: "string", description: "Name of the peer to respond to" },
|
|
12
|
+
reply_to: { type: "string", description: "Message ID of the question being answered" },
|
|
13
|
+
response: { type: "string", description: "Your response" },
|
|
14
|
+
source_files: {
|
|
15
|
+
type: "array", items: { type: "string" },
|
|
16
|
+
description: "Optional list of source files referenced",
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
required: ["peer", "reply_to", "response"],
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
async function handleRespond(args, connectionManager) {
|
|
23
|
+
try {
|
|
24
|
+
connectionManager.sendResponse(args.peer, args.reply_to, args.response, args.source_files);
|
|
25
|
+
return `Response sent to ${args.peer}.`;
|
|
26
|
+
}
|
|
27
|
+
catch (err) {
|
|
28
|
+
return `Error: ${err.message}`;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=respond.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"respond.js","sourceRoot":"","sources":["../../src/tools/respond.ts"],"names":[],"mappings":";;;AAqBA,sCAUC;AA7BY,QAAA,qBAAqB,GAAG;IACnC,IAAI,EAAE,eAAe;IACrB,WAAW,EACT,gJAAgJ;IAClJ,WAAW,EAAE;QACX,IAAI,EAAE,QAAiB;QACvB,UAAU,EAAE;YACV,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,gCAAgC,EAAE;YACvE,QAAQ,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,2CAA2C,EAAE;YACtF,QAAQ,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,eAAe,EAAE;YAC1D,YAAY,EAAE;gBACZ,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;gBACxC,WAAW,EAAE,0CAA0C;aACxD;SACF;QACD,QAAQ,EAAE,CAAC,MAAM,EAAE,UAAU,EAAE,UAAU,CAAC;KAC3C;CACF,CAAC;AAEK,KAAK,UAAU,aAAa,CACjC,IAAmF,EACnF,iBAAoC;IAEpC,IAAI,CAAC;QACH,iBAAiB,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC;QAC3F,OAAO,oBAAoB,IAAI,CAAC,IAAI,GAAG,CAAC;IAC1C,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,OAAO,UAAW,GAAa,CAAC,OAAO,EAAE,CAAC;IAC5C,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { ConnectionManager } from "../connection-manager.js";
|
|
2
|
+
export declare const tellToolDefinition: {
|
|
3
|
+
name: string;
|
|
4
|
+
description: string;
|
|
5
|
+
inputSchema: {
|
|
6
|
+
type: "object";
|
|
7
|
+
properties: {
|
|
8
|
+
peer: {
|
|
9
|
+
type: string;
|
|
10
|
+
description: string;
|
|
11
|
+
};
|
|
12
|
+
instruction: {
|
|
13
|
+
type: string;
|
|
14
|
+
description: string;
|
|
15
|
+
};
|
|
16
|
+
context: {
|
|
17
|
+
type: string;
|
|
18
|
+
description: string;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
required: string[];
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
export declare function handleTell(args: {
|
|
25
|
+
peer: string;
|
|
26
|
+
instruction: string;
|
|
27
|
+
context?: string;
|
|
28
|
+
}, connectionManager: ConnectionManager): Promise<string>;
|
|
29
|
+
//# sourceMappingURL=tell.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tell.d.ts","sourceRoot":"","sources":["../../src/tools/tell.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAElE,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;CAa9B,CAAC;AAEF,wBAAsB,UAAU,CAC9B,IAAI,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,EAC7D,iBAAiB,EAAE,iBAAiB,GACnC,OAAO,CAAC,MAAM,CAAC,CA6BjB"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.tellToolDefinition = void 0;
|
|
4
|
+
exports.handleTell = handleTell;
|
|
5
|
+
exports.tellToolDefinition = {
|
|
6
|
+
name: "nokai_tell",
|
|
7
|
+
description: "Send an action request to a connected peer's AI agent. Requires read-write permission on the connection. Use this to request code changes, endpoint additions, or other actions.",
|
|
8
|
+
inputSchema: {
|
|
9
|
+
type: "object",
|
|
10
|
+
properties: {
|
|
11
|
+
peer: { type: "string", description: "Name of the connected peer" },
|
|
12
|
+
instruction: { type: "string", description: "What you want the peer's agent to do" },
|
|
13
|
+
context: { type: "string", description: "Optional context about why this action is needed" },
|
|
14
|
+
},
|
|
15
|
+
required: ["peer", "instruction"],
|
|
16
|
+
},
|
|
17
|
+
};
|
|
18
|
+
async function handleTell(args, connectionManager) {
|
|
19
|
+
try {
|
|
20
|
+
const msg = connectionManager.sendAction(args.peer, args.instruction, args.context);
|
|
21
|
+
return new Promise((resolve) => {
|
|
22
|
+
const timeout = setTimeout(() => {
|
|
23
|
+
resolve(`Action request sent to ${args.peer} (message ID: ${msg.id}).\n` +
|
|
24
|
+
`Waiting for result... The peer's agent is processing your request.`);
|
|
25
|
+
}, 60000);
|
|
26
|
+
connectionManager.onIncomingMessage((incomingMsg, peerName) => {
|
|
27
|
+
if (peerName === args.peer && incomingMsg.type === "action_result" && "replyTo" in incomingMsg && incomingMsg.replyTo === msg.id) {
|
|
28
|
+
clearTimeout(timeout);
|
|
29
|
+
const success = "success" in incomingMsg && incomingMsg.success;
|
|
30
|
+
let result = success
|
|
31
|
+
? `Action completed by ${args.peer}:\n\n${incomingMsg.content}`
|
|
32
|
+
: `Action failed by ${args.peer}:\n\n${incomingMsg.content}`;
|
|
33
|
+
if ("sourceFiles" in incomingMsg && incomingMsg.sourceFiles) {
|
|
34
|
+
result += `\n\nFiles changed: ${incomingMsg.sourceFiles.join(", ")}`;
|
|
35
|
+
}
|
|
36
|
+
resolve(result);
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
catch (err) {
|
|
42
|
+
return `Error: ${err.message}`;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=tell.js.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E,CAAC;oBACjI,YAAY,CAAC,OAAO,CAAC,CAAC;oBACtB,MAAM,OAAO,GAAG,SAAS,IAAI,WAAW,IAAI,WAAW,CAAC,OAAO,CAAC;oBAChE,IAAI,MAAM,GAAG,OAAO;wBAClB,CAAC,CAAC,uBAAuB,IAAI,CAAC,IAAI,QAAQ,WAAW,CAAC,OAAO,EAAE;wBAC/D,CAAC,CAAC,oBAAoB,IAAI,CAAC,IAAI,QAAQ,WAAW,CAAC,OAAO,EAAE,CAAC;oBAC/D,IAAI,aAAa,IAAI,WAAW,IAAI,WAAW,CAAC,WAAW,EAAE,CAAC;wBAC5D,MAAM,IAAI,sBAAsB,WAAW,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;oBACvE,CAAC;oBACD,OAAO,CAAC,MAAM,CAAC,CAAC;gBAClB,CAAC;YACH,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,OAAO,UAAW,GAAa,CAAC,OAAO,EAAE,CAAC;IAC5C,CAAC;AACH,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@nokai/cli",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "NokAI — Connecting AIs. Peer-to-peer communication between AI coding assistants via MCP.",
|
|
5
|
+
"private": false,
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"bin": {
|
|
9
|
+
"nokai": "dist/index.js"
|
|
10
|
+
},
|
|
11
|
+
"keywords": [
|
|
12
|
+
"mcp",
|
|
13
|
+
"claude",
|
|
14
|
+
"ai",
|
|
15
|
+
"peer-to-peer",
|
|
16
|
+
"webrtc",
|
|
17
|
+
"coding-assistant",
|
|
18
|
+
"claude-code",
|
|
19
|
+
"cursor",
|
|
20
|
+
"windsurf",
|
|
21
|
+
"copilot"
|
|
22
|
+
],
|
|
23
|
+
"author": "heiisenberrg",
|
|
24
|
+
"license": "MIT",
|
|
25
|
+
"repository": {
|
|
26
|
+
"type": "git",
|
|
27
|
+
"url": "https://github.com/heiisenberrg/nokAI.git"
|
|
28
|
+
},
|
|
29
|
+
"files": [
|
|
30
|
+
"dist/**/*",
|
|
31
|
+
"README.md",
|
|
32
|
+
"LICENSE"
|
|
33
|
+
],
|
|
34
|
+
"scripts": {
|
|
35
|
+
"build": "tsc",
|
|
36
|
+
"dev": "tsx src/index.ts",
|
|
37
|
+
"test": "vitest run",
|
|
38
|
+
"test:watch": "vitest"
|
|
39
|
+
},
|
|
40
|
+
"dependencies": {
|
|
41
|
+
"@modelcontextprotocol/sdk": "^1.0.0",
|
|
42
|
+
"better-sqlite3": "^11.0.0",
|
|
43
|
+
"node-datachannel": "^0.12.0",
|
|
44
|
+
"ws": "^8.18.0",
|
|
45
|
+
"zod": "^3.23.0"
|
|
46
|
+
},
|
|
47
|
+
"devDependencies": {
|
|
48
|
+
"@types/better-sqlite3": "^7.6.0",
|
|
49
|
+
"@types/ws": "^8.5.0",
|
|
50
|
+
"tsx": "^4.0.0",
|
|
51
|
+
"typescript": "^5.5.0",
|
|
52
|
+
"vitest": "^4.1.4"
|
|
53
|
+
}
|
|
54
|
+
}
|