@okostream/mcp 0.12.0 → 0.12.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/dist/tools/workspaces.js +10 -6
- package/dist/version.js +1 -1
- package/package.json +1 -1
package/dist/tools/workspaces.js
CHANGED
|
@@ -10,7 +10,7 @@ import { z } from "zod";
|
|
|
10
10
|
import { requireConfirm, safeString, serialize, textResult } from "../utils.js";
|
|
11
11
|
import { authed, inviteUrl } from "./context.js";
|
|
12
12
|
import { destructiveTool, idempotentWriteTool, MAX_WORKSPACE_INVITE_CODE_LENGTH, MAX_WORKSPACE_NAME_LENGTH, readOnlyTool, toolDescription, unknownRecordSchema, updateOutputSchema, workspaceAccessOutputSchema, workspacePermissionsSchema, workspacesOutputSchema, writeTool } from "./schemas.js";
|
|
13
|
-
import { addDoc, collection, deleteDoc, doc, getDoc, getDocs,
|
|
13
|
+
import { addDoc, collection, deleteDoc, doc, getDoc, getDocs, query, serverTimestamp, setDoc, updateDoc, where } from "firebase/firestore";
|
|
14
14
|
import { firestore, functions } from "../firebase.js";
|
|
15
15
|
import { httpsCallable } from "firebase/functions";
|
|
16
16
|
import { listVisibleWorkspaces, normalizeWorkspacePermissions, randomInviteCode, readWorkspaceForOwner } from "./workspaceAccess.js";
|
|
@@ -99,11 +99,15 @@ export function registerWorkspaceTools(server) {
|
|
|
99
99
|
// доступа не имеет, проверка не увидит — но владелец пространства
|
|
100
100
|
// получает grant на все его события через CF18, так что для владельца,
|
|
101
101
|
// а только он сюда и доходит (`readWorkspaceForOwner` выше), совпадает.
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
102
|
+
// 🔴 Удаление идёт через CF57, а не `deleteDoc`: голое удаление корневого
|
|
103
|
+
// документа оставляло живыми подколлекцию shares, зеркала
|
|
104
|
+
// workspaceMembers и grants — участники сохраняли доступ, а убрать это
|
|
105
|
+
// было уже нельзя, потому что правило shares проверяет владельца через
|
|
106
|
+
// get() исчезнувшего родителя. Проверку «в пространстве нет событий»
|
|
107
|
+
// функция делает сама, полным запросом, а не по индексу этого ключа.
|
|
108
|
+
const removeWorkspace = httpsCallable(functions, "deleteWorkspaceCompletely");
|
|
109
|
+
const removed = await removeWorkspace({ workspaceId });
|
|
110
|
+
return textResult({ ...removed.data, workspaceId, deleted: true });
|
|
107
111
|
});
|
|
108
112
|
server.registerTool("oko_list_workspace_access", {
|
|
109
113
|
title: "List workspace access",
|
package/dist/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// Generated by scripts/generateMcpVersion.mjs from mcp/package.json. Do not edit.
|
|
2
|
-
export const OKO_MCP_VERSION = "0.12.
|
|
2
|
+
export const OKO_MCP_VERSION = "0.12.1";
|