@dalmasonto/taskflow-mcp 1.0.29 → 1.0.32

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/dist/index.js CHANGED
@@ -146,14 +146,14 @@ if (!httpOnly) {
146
146
  const transport = new StdioServerTransport();
147
147
  await server.connect(transport);
148
148
  const { registerAgent, unregisterAgent } = await import('./agent-registry.js');
149
- const { setAgentName } = await import('./tools/agent-inbox.js');
149
+ const { setAgentName, getAgentName } = await import('./tools/agent-inbox.js');
150
150
  // Auto-register this agent and sync name to agent-inbox tools
151
151
  const agentName = registerAgent();
152
152
  setAgentName(agentName);
153
153
  const agentPid = process.ppid;
154
154
  console.error(`[agent] registered as "${agentName}"`);
155
155
  let cleanup = () => { try {
156
- unregisterAgent(agentName);
156
+ unregisterAgent(getAgentName());
157
157
  }
158
158
  catch { } process.exit(0); };
159
159
  process.on('SIGINT', cleanup);
@@ -178,7 +178,7 @@ if (!httpOnly) {
178
178
  if (tmuxTarget) {
179
179
  const { startTmuxBridge } = await import('./tmux-bridge.js');
180
180
  const stopBridge = startTmuxBridge({
181
- agentName,
181
+ getAgentName,
182
182
  agentPid,
183
183
  tmuxPane: tmuxTarget,
184
184
  });
@@ -1,5 +1,6 @@
1
1
  interface BridgeOptions {
2
- agentName: string;
2
+ /** Returns the current agent name — must be a getter so renames are picked up */
3
+ getAgentName: () => string;
3
4
  agentPid: number;
4
5
  tmuxPane: string;
5
6
  }
@@ -4,7 +4,6 @@ import { getActivePort } from './sse.js';
4
4
  import http from 'http';
5
5
  // ─── SSE Listener (replaces the 3s poller) ───────────────────────────
6
6
  function startSSEListener(options) {
7
- const { agentName, agentPid, tmuxPane } = options;
8
7
  const port = getActivePort();
9
8
  function connect() {
10
9
  const req = http.get(`http://localhost:${port}/events`, (res) => {
@@ -51,7 +50,8 @@ function startSSEListener(options) {
51
50
  connect();
52
51
  }
53
52
  function handleSSEEvent(event, data, options) {
54
- const { agentName, agentPid, tmuxPane } = options;
53
+ const { getAgentName, agentPid, tmuxPane } = options;
54
+ const agentName = getAgentName();
55
55
  const payload = data.payload;
56
56
  if (!payload)
57
57
  return;
@@ -118,7 +118,8 @@ function injectAndMarkDelivered(id, text, tmuxPane) {
118
118
  }
119
119
  }
120
120
  function deliverUndelivered(options) {
121
- const { agentName, agentPid, tmuxPane } = options;
121
+ const { getAgentName, agentPid, tmuxPane } = options;
122
+ const agentName = getAgentName();
122
123
  const db = getDb();
123
124
  const incoming = db.prepare(`SELECT * FROM agent_messages WHERE delivered IS NULL AND (
124
125
  (recipient_name = ? AND status = 'pending') OR
@@ -149,7 +150,7 @@ function deliverUndelivered(options) {
149
150
  */
150
151
  export function startTmuxBridge(options) {
151
152
  startSSEListener(options);
152
- console.error(`[bridge] tmux bridge active for agent "${options.agentName}" on pane ${options.tmuxPane}`);
153
+ console.error(`[bridge] tmux bridge active for agent "${options.getAgentName()}" on pane ${options.tmuxPane}`);
153
154
  return () => {
154
155
  // SSE connection will close when process exits
155
156
  };
@@ -7,4 +7,6 @@ declare let myAgentName: string | null;
7
7
  */
8
8
  export declare function setAgentName(name: string): void;
9
9
  export { myAgentName };
10
+ /** Get the current agent name — used by tmux bridge to track renames */
11
+ export declare function getAgentName(): string;
10
12
  export declare function registerAgentInboxTools(server: McpServer): void;
@@ -30,6 +30,10 @@ function ensureRegistered() {
30
30
  return myAgentName;
31
31
  }
32
32
  export { myAgentName };
33
+ /** Get the current agent name — used by tmux bridge to track renames */
34
+ export function getAgentName() {
35
+ return myAgentName || 'unknown';
36
+ }
33
37
  export function registerAgentInboxTools(server) {
34
38
  server.tool('register_agent', 'Register this agent with a custom name. Optional — agents auto-register on startup using the project folder name. Call this only if you want a specific name.', {
35
39
  name: z.string().optional().describe('Custom agent name. If omitted, uses the project folder name.'),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dalmasonto/taskflow-mcp",
3
- "version": "1.0.29",
3
+ "version": "1.0.32",
4
4
  "description": "MCP server for TaskFlow — manage projects, tasks, timers, analytics via AI agents",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",