@1medium/cli 1.4.0 → 1.6.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/package.json +1 -1
- package/src/mcp-server.js +9 -3
- package/src/session-state.js +9 -9
package/package.json
CHANGED
package/src/mcp-server.js
CHANGED
|
@@ -54,7 +54,7 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
|
54
54
|
},
|
|
55
55
|
{
|
|
56
56
|
name: "org_get",
|
|
57
|
-
description: "Get the currently active organization",
|
|
57
|
+
description: "Get the currently active organization. NOTE: Sessions start with NO org selected to prevent cross-contamination between terminals. Use org_list and org_set first, or config_reset to load saved defaults.",
|
|
58
58
|
inputSchema: {
|
|
59
59
|
type: "object",
|
|
60
60
|
properties: {},
|
|
@@ -142,7 +142,7 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
|
142
142
|
},
|
|
143
143
|
{
|
|
144
144
|
name: "task_update",
|
|
145
|
-
description: "Update an existing task",
|
|
145
|
+
description: "Update an existing task. Can also move task to a different project.",
|
|
146
146
|
inputSchema: {
|
|
147
147
|
type: "object",
|
|
148
148
|
properties: {
|
|
@@ -163,6 +163,10 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
|
163
163
|
enum: ["P1", "P2", "P3", "P4"],
|
|
164
164
|
description: "New priority",
|
|
165
165
|
},
|
|
166
|
+
project_id: {
|
|
167
|
+
type: "string",
|
|
168
|
+
description: "Move task to a different project (provide project ID)",
|
|
169
|
+
},
|
|
166
170
|
},
|
|
167
171
|
required: ["id"],
|
|
168
172
|
},
|
|
@@ -584,13 +588,15 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
584
588
|
if (args.title) payload.title = args.title;
|
|
585
589
|
if (args.body) payload.body_md = args.body;
|
|
586
590
|
if (args.priority) payload.priority = args.priority;
|
|
591
|
+
if (args.project_id) payload.project_id = args.project_id;
|
|
587
592
|
|
|
588
593
|
result = await api.updateTask(args.id, payload);
|
|
594
|
+
const movedMsg = args.project_id ? `\n Moved to project: ${args.project_id}` : "";
|
|
589
595
|
return {
|
|
590
596
|
content: [
|
|
591
597
|
{
|
|
592
598
|
type: "text",
|
|
593
|
-
text: `Task updated:\n ID: ${result.task.id}\n Title: ${result.task.title}\n Priority: ${result.task.priority}`,
|
|
599
|
+
text: `Task updated:\n ID: ${result.task.id}\n Title: ${result.task.title}\n Priority: ${result.task.priority}${movedMsg}`,
|
|
594
600
|
},
|
|
595
601
|
],
|
|
596
602
|
};
|
package/src/session-state.js
CHANGED
|
@@ -4,10 +4,13 @@
|
|
|
4
4
|
* Session-scoped state for MCP server
|
|
5
5
|
*
|
|
6
6
|
* This module wraps the persistent config with an in-memory layer for session-scoped keys.
|
|
7
|
-
*
|
|
8
|
-
* org/space/project selections.
|
|
7
|
+
* Each Claude Code tab runs its own MCP server process with ISOLATED session state.
|
|
9
8
|
*
|
|
10
|
-
* Session-
|
|
9
|
+
* IMPORTANT: Session state starts EMPTY - no org/space/project is pre-selected.
|
|
10
|
+
* This prevents cross-contamination when working on multiple projects in different terminals.
|
|
11
|
+
* Use config_reset to load from persistent config if you want the saved defaults.
|
|
12
|
+
*
|
|
13
|
+
* Session-scoped keys (in-memory only, start empty):
|
|
11
14
|
* - orgId, orgName, spaceId, spaceName, projectId, projectName
|
|
12
15
|
*
|
|
13
16
|
* Persistent keys (always read/write from config file):
|
|
@@ -26,14 +29,11 @@ const SESSION_KEYS = [
|
|
|
26
29
|
"projectName",
|
|
27
30
|
];
|
|
28
31
|
|
|
29
|
-
// In-memory session state, initialized from config
|
|
32
|
+
// In-memory session state - starts empty, NOT initialized from config
|
|
33
|
+
// Each MCP server process (each Claude Code tab) starts with no org/project context
|
|
34
|
+
// User must explicitly set org/project or call config_reset to load from persistent config
|
|
30
35
|
const sessionState = {};
|
|
31
36
|
|
|
32
|
-
// Initialize session state from config on module load
|
|
33
|
-
for (const key of SESSION_KEYS) {
|
|
34
|
-
sessionState[key] = config.get(key);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
37
|
/**
|
|
38
38
|
* Get a config value
|
|
39
39
|
* Session-scoped keys return from memory; others fall through to persistent config
|