@hasna/connectors 1.3.5 → 1.3.6
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/bin/index.js +1 -1
- package/bin/mcp.js +1 -27
- package/package.json +1 -1
package/bin/index.js
CHANGED
|
@@ -11858,7 +11858,7 @@ import chalk2 from "chalk";
|
|
|
11858
11858
|
// package.json
|
|
11859
11859
|
var package_default = {
|
|
11860
11860
|
name: "@hasna/connectors",
|
|
11861
|
-
version: "1.3.
|
|
11861
|
+
version: "1.3.6",
|
|
11862
11862
|
description: "Open source connector library - Install API connectors with a single command",
|
|
11863
11863
|
type: "module",
|
|
11864
11864
|
bin: {
|
package/bin/mcp.js
CHANGED
|
@@ -27089,7 +27089,7 @@ init_strip();
|
|
|
27089
27089
|
// package.json
|
|
27090
27090
|
var package_default = {
|
|
27091
27091
|
name: "@hasna/connectors",
|
|
27092
|
-
version: "1.3.
|
|
27092
|
+
version: "1.3.6",
|
|
27093
27093
|
description: "Open source connector library - Install API connectors with a single command",
|
|
27094
27094
|
type: "module",
|
|
27095
27095
|
bin: {
|
|
@@ -27795,32 +27795,6 @@ server.registerTool("get_rate_budget", {
|
|
|
27795
27795
|
const result = getRateBudget(agent_id, connector, limit);
|
|
27796
27796
|
return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
|
|
27797
27797
|
});
|
|
27798
|
-
var _agentReg = new Map;
|
|
27799
|
-
server.tool("register_agent", "Register this agent session. Returns agent_id for use in heartbeat/set_focus.", { name: exports_external.string(), session_id: exports_external.string().optional() }, async (a) => {
|
|
27800
|
-
const existing = [..._agentReg.values()].find((x) => x.name === a.name);
|
|
27801
|
-
if (existing) {
|
|
27802
|
-
existing.last_seen_at = new Date().toISOString();
|
|
27803
|
-
return { content: [{ type: "text", text: JSON.stringify(existing) }] };
|
|
27804
|
-
}
|
|
27805
|
-
const id = Math.random().toString(36).slice(2, 10);
|
|
27806
|
-
const ag = { id, name: a.name, last_seen_at: new Date().toISOString() };
|
|
27807
|
-
_agentReg.set(id, ag);
|
|
27808
|
-
return { content: [{ type: "text", text: JSON.stringify(ag) }] };
|
|
27809
|
-
});
|
|
27810
|
-
server.tool("heartbeat", "Update last_seen_at to signal agent is active.", { agent_id: exports_external.string() }, async (a) => {
|
|
27811
|
-
const ag = _agentReg.get(a.agent_id);
|
|
27812
|
-
if (!ag)
|
|
27813
|
-
return { content: [{ type: "text", text: `Agent not found: ${a.agent_id}` }], isError: true };
|
|
27814
|
-
ag.last_seen_at = new Date().toISOString();
|
|
27815
|
-
return { content: [{ type: "text", text: `\u2665 ${ag.name} \u2014 active` }] };
|
|
27816
|
-
});
|
|
27817
|
-
server.tool("set_focus", "Set active project context for this agent session.", { agent_id: exports_external.string(), project_id: exports_external.string().optional() }, async (a) => {
|
|
27818
|
-
const ag = _agentReg.get(a.agent_id);
|
|
27819
|
-
if (!ag)
|
|
27820
|
-
return { content: [{ type: "text", text: `Agent not found: ${a.agent_id}` }], isError: true };
|
|
27821
|
-
ag.project_id = a.project_id;
|
|
27822
|
-
return { content: [{ type: "text", text: a.project_id ? `Focus: ${a.project_id}` : "Focus cleared" }] };
|
|
27823
|
-
});
|
|
27824
27798
|
async function main() {
|
|
27825
27799
|
const transport = new StdioServerTransport;
|
|
27826
27800
|
await server.connect(transport);
|