vantage-peers-mcp 2.4.3 → 2.4.8

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.
Files changed (2) hide show
  1. package/dist/src/tools.js +27 -5
  2. package/package.json +1 -1
package/dist/src/tools.js CHANGED
@@ -865,6 +865,9 @@ export function registerTools(server, convex, oauthCtx) {
865
865
  type: memoryTypeSchema
866
866
  .optional()
867
867
  .describe("Filter to a specific type — omit to return all types"),
868
+ createdBy: assigneeSchema
869
+ .optional()
870
+ .describe("Filter by creator/orchestrator role — mirrors list_tasks pattern for cross-tool consistency."),
868
871
  limit: z
869
872
  .number()
870
873
  .int()
@@ -878,7 +881,7 @@ export function registerTools(server, convex, oauthCtx) {
878
881
  openWorldHint: false,
879
882
  destructiveHint: false,
880
883
  title: "List memories",
881
- }, async ({ namespace, type, limit }) => {
884
+ }, async ({ namespace, type, createdBy, limit }) => {
882
885
  try {
883
886
  const nsDenied = guardRead(namespace);
884
887
  if (nsDenied)
@@ -886,6 +889,7 @@ export function registerTools(server, convex, oauthCtx) {
886
889
  const memories = await convex.query("memories:listMemories", {
887
890
  namespace,
888
891
  type,
892
+ createdBy,
889
893
  limit: limit ?? 20,
890
894
  });
891
895
  const rawList = Array.isArray(memories)
@@ -2058,12 +2062,19 @@ export function registerTools(server, convex, oauthCtx) {
2058
2062
  const fromDenied = guardFrom(orchestrator);
2059
2063
  if (fromDenied)
2060
2064
  return fromDenied;
2065
+ // v2.4.8: derive createdBy from auth context (oauthCtx.userId).
2066
+ // This is the anti-spoof authored-by — distinct from orchestrator
2067
+ // (writer-intent label, client-supplied). On the no-auth path
2068
+ // (master-scope bearer / local dev), oauthCtx is undefined and
2069
+ // createdBy gracefully degrades to undefined (transition period).
2070
+ const createdBy = oauthCtx?.userId;
2061
2071
  const diaryId = await convex.mutation("diary:write", {
2062
2072
  date,
2063
2073
  orchestrator,
2064
2074
  content,
2065
2075
  highlights: toArray(highlights),
2066
2076
  blockers: toArray(blockers),
2077
+ createdBy,
2067
2078
  });
2068
2079
  return {
2069
2080
  content: [
@@ -2133,6 +2144,9 @@ export function registerTools(server, convex, oauthCtx) {
2133
2144
  orchestrator: creatorSchema
2134
2145
  .optional()
2135
2146
  .describe("Filter to a specific orchestrator — omit for all"),
2147
+ createdBy: assigneeSchema
2148
+ .optional()
2149
+ .describe("Filter by auth-derived author (v2.4.8+, anti-spoof). Distinct from `orchestrator` which is the writer-intent label. Pre-v2.4.8 entries are backfilled with orchestrator as best-guess."),
2136
2150
  limit: z
2137
2151
  .number()
2138
2152
  .int()
@@ -2146,16 +2160,24 @@ export function registerTools(server, convex, oauthCtx) {
2146
2160
  openWorldHint: false,
2147
2161
  destructiveHint: false,
2148
2162
  title: "List diary entries",
2149
- }, async ({ orchestrator, limit }) => {
2163
+ }, async ({ orchestrator, createdBy, limit }) => {
2150
2164
  try {
2151
- // Non-master: must scope to own orchestrator id.
2165
+ // v2.4.8: orchestrator (writer-intent) and createdBy (auth-derived
2166
+ // author) are separate filters — NOT aliases. Forward both independently.
2167
+ // Non-master: REQUIRE at least one explicit self-scope — undefined passes
2168
+ // through are forbidden. Mirrors v2.4.7 effectiveOrchestrator shortcircuit:
2169
+ // undefined !== myId → Forbidden. No silent fleet-read for non-master callers.
2152
2170
  if (oauthCtx && !isMasterScope(oauthCtx)) {
2153
- if (orchestrator !== oauthCtx.userId) {
2154
- return mcpError(`Forbidden: list_diaries requires orchestrator='${oauthCtx.userId}' for non-master scope (current: ${oauthCtx.scopeProfile}).`);
2171
+ const myId = oauthCtx.userId;
2172
+ const orchestratorScoped = orchestrator === myId;
2173
+ const createdByScoped = createdBy === myId;
2174
+ if (!orchestratorScoped && !createdByScoped) {
2175
+ return mcpError(`Forbidden: list_diaries requires orchestrator='${myId}' OR createdBy='${myId}' for non-master scope (current scope: ${oauthCtx.scopeProfile}).`);
2155
2176
  }
2156
2177
  }
2157
2178
  const entries = await convex.query("diary:list", {
2158
2179
  orchestrator,
2180
+ createdBy,
2159
2181
  limit: limit ?? 20,
2160
2182
  });
2161
2183
  return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vantage-peers-mcp",
3
- "version": "2.4.3",
3
+ "version": "2.4.8",
4
4
  "description": "MCP server for VantagePeers — shared memory, messaging, and task coordination for AI agent teams",
5
5
  "type": "module",
6
6
  "main": "./dist/server.js",