@astramindapp/mcp-server 0.29.0 → 0.29.2

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/server.js CHANGED
@@ -86,7 +86,7 @@ const apiDetail = (e) => {
86
86
  function createMindMcpServer(client) {
87
87
  const server = new mcp_js_1.McpServer({
88
88
  name: "mind",
89
- version: "0.29.0",
89
+ version: "0.29.2",
90
90
  }, {
91
91
  // Returned to every client in the MCP `initialize` response — the first
92
92
  // thing any connecting agent sees about how to integrate with MIND.
@@ -3139,15 +3139,29 @@ function createMindMcpServer(client) {
3139
3139
  // so a client that only ever reads tool descriptions still gets it.
3140
3140
  server.tool("mind_sessions", "Log THIS agent's own live session into MIND Chat → Agents, so Anthony can read the transcript and reply — his reply reaches you on your next turn. Distinct from mind_remember (one durable fact) and mind_train (teaching the KG): this is the live, turn-by-turn session log, mirrored into a MIND document when you close it.\n\n" +
3141
3141
  "PROTOCOL (do this every session): " +
3142
- "1) CONNECT — as soon as mind_context succeeds, call action=open with source_key (your assigned MIND Chat toggle, e.g. \"claude-code-1\"), external_session_id (your runtime's own session id), runtime, title (first user ask, 6-10 words), machine/cwd/repo/branch/model. If `resumed` is true, read `tail` before answering, and answer everything in `pending_replies` first — those arrived while you were away. " +
3142
+ "1) CONNECT — as soon as mind_context succeeds, call action=open with source_key (your assigned MIND Chat toggle, e.g. \"claude-code-1\"), external_session_id (your runtime's own session id), runtime, title (first user ask, 6-10 words), machine/cwd/repo/branch/model. Your real source is derived from runtime x installation (device/platform/env), never the literal source_key — the response's own `source_key` tells you what it actually resolved to. If you're a named agent within a shared runtime (a scheduled job, a persona, a bot on a shared account), pass `agent` (a bare name, or {key,label}) so sessions attribute to WHO ran them, not just where — this works for every runtime, not only shared/cloud ones. If `resumed` is true, read `tail` before answering, and answer everything in `pending_replies` first — those arrived while you were away. " +
3143
3143
  "2) EVERY TURN — after you finish replying, call action=append with the user's message and your final reply (role user / assistant); tool calls go in as role=tool one-line summaries, never raw payloads. Check `pending_replies` on the response and answer them next turn. action=reply is a shortcut for appending a single assistant-role message when you have no user message to log alongside it. " +
3144
3144
  "3) IDLE — MIND marks the session idle after 30 minutes with no append; the next append revives it, nothing to do meanwhile. " +
3145
3145
  "4) TERMINATE — on exit, compaction, or \"done\", call action=close with a summary (what was asked, what shipped with ids/PR numbers, what is still undone); MIND mirrors the transcript into your Sessions folder as a document. " +
3146
3146
  "5) HANDOFF — to pass the conversation to another agent, call action=handoff with to_source_key=<their toggle>; they see it in their session list with the transcript as context. " +
3147
+ "6) SHARE — to let another MIND user follow this session, call action=share with grantee_username and role (\"viewer\" read-only, the default, or \"replier\" which also lets them reply — a reply is a live action that wakes your process via wake_url, so grant it deliberately). It's a live mirror, never a copy: they always see the current transcript, and revoking (action=revoke_share) removes their access immediately. Never share a session with anyone who shouldn't see its full transcript.\n" +
3147
3148
  "Never claim a session is synced without the session_id MIND returned. Never log secrets or raw tool payloads.\n\n" +
3148
- "Actions: open, append, close, list, get, reply (alias for append of one assistant message), inbox (undelivered mind-origin replies), handoff, sources (source_action=list|create|update|delete manages the MIND Chat sidebar toggles — auto-created on first open with an unknown source_key).", {
3149
+ "Actions: open, append, close, list, get, reply (alias for append of one assistant message), inbox (undelivered mind-origin replies), handoff, sources (source_action=list|create|update|delete manages the MIND Chat sidebar toggles — auto-created on first open with an unknown source_key), share (grant another MIND account viewer or replier access — owner only), list_shares (owner only), revoke_share (owner only).", {
3149
3150
  action: zod_1.z
3150
- .enum(["open", "append", "close", "list", "get", "reply", "inbox", "handoff", "sources"])
3151
+ .enum([
3152
+ "open",
3153
+ "append",
3154
+ "close",
3155
+ "list",
3156
+ "get",
3157
+ "reply",
3158
+ "inbox",
3159
+ "handoff",
3160
+ "sources",
3161
+ "share",
3162
+ "list_shares",
3163
+ "revoke_share",
3164
+ ])
3151
3165
  .describe("Which agent-session operation to perform."),
3152
3166
  // open
3153
3167
  source_key: zod_1.z.string().optional().describe("Your assigned MIND Chat sidebar toggle slug, e.g. \"claude-code-1\" — required for open; also filters list; also required for sources action=create (as the new source's key)."),
@@ -3161,6 +3175,20 @@ function createMindMcpServer(client) {
3161
3175
  branch: zod_1.z.string().optional().describe("Git branch — open."),
3162
3176
  model: zod_1.z.string().optional().describe("LLM model in use — open."),
3163
3177
  tags: zod_1.z.array(zod_1.z.string()).optional().describe("Freeform tags — open."),
3178
+ device: zod_1.z
3179
+ .object({
3180
+ kind: zod_1.z.enum(["mac", "linux", "windows", "droplet", "cloud", "container", "ci", "phone", "unknown"]).optional(),
3181
+ label: zod_1.z.string().optional(),
3182
+ host: zod_1.z.string().optional(),
3183
+ })
3184
+ .optional()
3185
+ .describe("Explicit device declaration — open/append. Wins outright over machine/platform/env inference; an out-of-vocabulary `kind` is dropped server-side rather than passed through raw."),
3186
+ platform: zod_1.z.string().optional().describe("Your own platform string (sys.platform / platform.system() / a mobile OS name, e.g. \"darwin\", \"linux\", \"win32\", \"ios\") — open/append. Used to infer device kind when `device` isn't supplied."),
3187
+ env: zod_1.z.record(zod_1.z.string(), zod_1.z.any()).optional().describe("Environment markers you read from your OWN process (GITHUB_ACTIONS, RENDER, KUBERNETES_SERVICE_HOST, DROPLET_ID, DOCKERENV, ...) — open/append. Used to infer device kind (CI runner, cloud, container, droplet) when `device` isn't supplied."),
3188
+ agent: zod_1.z
3189
+ .union([zod_1.z.string(), zod_1.z.object({ key: zod_1.z.string(), label: zod_1.z.string().optional() })])
3190
+ .optional()
3191
+ .describe("Who is actually running this session — an attribute OF the session, never a source key, and unconditional on runtime (a claude-code cron run can carry agent=\"Chief of Staff\" exactly like a grok run carries agent=\"Dae\"). Bare string used as both key and label, or {key, label}. Falls back to a legacy alias for a bot-shaped source_key (\"dae\"→Dae, \"meter\"→Meter, \"grok-bot\"→Helm, \"n8n\"→n8n), then to the runtime's own display name — open only."),
3164
3192
  // append / reply
3165
3193
  session_id: zod_1.z.string().optional().describe("Session id returned by open — required for append/close/get/inbox/handoff."),
3166
3194
  messages: zod_1.z
@@ -3192,6 +3220,10 @@ function createMindMcpServer(client) {
3192
3220
  color: zod_1.z.string().optional().describe("Sidebar chip color — sources action=create/update."),
3193
3221
  wake_url: zod_1.z.string().optional().describe("Optional push endpoint MIND POSTs {session_id, reply} to (fire-and-forget, 5s timeout) when the user replies — sources action=create/update."),
3194
3222
  force: zod_1.z.boolean().optional().describe("sources action=delete: also delete the source's sessions instead of failing 409 when sessions exist."),
3223
+ // share / list_shares / revoke_share
3224
+ grantee_username: zod_1.z.string().optional().describe("MIND username to share with — required for share."),
3225
+ role: zod_1.z.enum(["viewer", "replier"]).optional().describe("Role to grant — share (default \"viewer\"). \"replier\" additionally allows the grantee to reply, which reaches you via wake_url."),
3226
+ share_id: zod_1.z.string().optional().describe("Share grant id (from share or list_shares) — required for revoke_share."),
3195
3227
  }, async (args) => {
3196
3228
  const { action } = args;
3197
3229
  try {
@@ -3214,6 +3246,10 @@ function createMindMcpServer(client) {
3214
3246
  branch: args.branch,
3215
3247
  model: args.model,
3216
3248
  tags: args.tags,
3249
+ device: args.device,
3250
+ platform: args.platform,
3251
+ env: args.env,
3252
+ agent: args.agent,
3217
3253
  }));
3218
3254
  }
3219
3255
  case "append": {
@@ -3317,6 +3353,32 @@ function createMindMcpServer(client) {
3317
3353
  }
3318
3354
  }
3319
3355
  }
3356
+ case "share": {
3357
+ const { session_id, grantee_username } = args;
3358
+ if (!session_id)
3359
+ return err("Error: 'session_id' is required for share.");
3360
+ if (!grantee_username)
3361
+ return err("Error: 'grantee_username' is required for share.");
3362
+ return ok(await client.createAgentSessionShare(session_id, {
3363
+ grantee_username,
3364
+ role: args.role,
3365
+ }));
3366
+ }
3367
+ case "list_shares": {
3368
+ const { session_id } = args;
3369
+ if (!session_id)
3370
+ return err("Error: 'session_id' is required for list_shares.");
3371
+ return ok(await client.listAgentSessionShares(session_id));
3372
+ }
3373
+ case "revoke_share": {
3374
+ const { session_id, share_id } = args;
3375
+ if (!session_id)
3376
+ return err("Error: 'session_id' is required for revoke_share.");
3377
+ if (!share_id)
3378
+ return err("Error: 'share_id' is required for revoke_share.");
3379
+ await client.revokeAgentSessionShare(session_id, share_id);
3380
+ return ok({ ok: true, session_id, share_id });
3381
+ }
3320
3382
  default: {
3321
3383
  const _exhaustive = action;
3322
3384
  return err(`Unknown action: ${_exhaustive}`);