@glie/mcp-polaris 0.7.0 → 0.8.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.
Files changed (3) hide show
  1. package/README.md +39 -5
  2. package/dist/index.js +229 -38
  3. package/package.json +2 -2
package/README.md CHANGED
@@ -47,15 +47,49 @@ it. The same token authenticates this server and the `polaris` CLI as you.
47
47
 
48
48
  ## Tools
49
49
 
50
- `polaris.me`, `polaris.project.*`, `polaris.milestone.*` (incl. `update` to
51
- refine a spec), `polaris.task.*` (incl. `update`, `transition`, `approve`),
52
- `polaris.stack.*` (`list` / `get` / `release` for the approval Release Candidate
53
- flow), `polaris.agent.*`, `polaris.claude_md.get`, `polaris.framework.list`, plus
54
- read-only context from the feed: `polaris.activity.list` (what happened) and
50
+ **Roadmap.** `polaris.me`, `polaris.project.*`, `polaris.milestone.*` (incl.
51
+ `update` to refine a spec, `attachment_*` to list/attach/remove the visual
52
+ references anchored in its body), `polaris.task.*` (incl. `update`,
53
+ `transition`, `approve`, `schedule`, `attachment_*` — same as the milestone's,
54
+ plus how a milestone reference gets forwarded here via
55
+ `source_attachment_id`), `polaris.stack.*` (`list` / `get` / `release` for the
56
+ approval Release Candidate flow), `polaris.agent.*`, `polaris.team.*`,
57
+ `polaris.claude_md.get`, `polaris.framework.list`.
58
+
59
+ **Helpdesk.** `polaris.ticket.*` (the customer conversation: `reply`, `pass`,
60
+ `frame_issue`, `link_issue`) and `polaris.issue.*` (the problem: `open`,
61
+ `transition`, `add_task`). N tickets can dedup onto one issue, and one issue
62
+ fans out into N tasks.
63
+
64
+ **Context, read-only.** `polaris.activity.list` (what happened) and
55
65
  `polaris.chat.get` / `polaris.chat.messages` (comments agents left on a scope).
56
66
 
57
67
  Run `tools/list` against the server for the full, current set.
58
68
 
69
+ ## Marketing creatives
70
+
71
+ A task inside an mkt campaign is a creative, and `polaris.task.create` takes the
72
+ four axes that describe one:
73
+
74
+ | Field | What it says | Values |
75
+ | --------- | --------------------------- | ----------------------------------------------- |
76
+ | `medium` | what the piece is | `image` / `video` / `text` |
77
+ | `surface` | where it publishes | `feed` / `stories` / `reels` / `shorts` / `article` / `newsletter` |
78
+ | `slides` | how many images it carries | 2 to 10, images only. A carousel is an image with plural |
79
+ | `aspect` | how it is framed | `1:1` / `4:5` / `9:16` / `16:9` / `2:3` |
80
+
81
+ Plus `channel` (Instagram, TikTok, LinkedIn, ...) and `scheduled_date`, the day
82
+ it publishes.
83
+
84
+ The pairs are checked at creation, not patched over at generation time: a
85
+ carousel with no `slides` is refused (it would ship a single image under a name
86
+ that promises several), `slides` on a non-image piece is refused, and an
87
+ `aspect` that the surface does not accept is refused. Omit `aspect` to take the
88
+ channel's usual one.
89
+
90
+ `format` is still written and read, as the label the board and the agents use,
91
+ but it is derived from the axes rather than defining them.
92
+
59
93
  ## License
60
94
 
61
95
  Apache-2.0
package/dist/index.js CHANGED
@@ -53,9 +53,11 @@ var INSTRUCTIONS = [
53
53
  "\u2022 polaris.claude_md.get(project_key) \u2014 read the project's conventions BEFORE you touch its tasks.",
54
54
  "",
55
55
  "STATE MACHINES \u2014 transitions are enforced; only legal moves succeed:",
56
- "\u2022 Task: draft \u2192 backlog \u2192 dev \u2192 test \u2192 approval \u2192 release \u2192 done (any \u2192 canceled)",
56
+ "\u2022 Task: draft \u2192 backlog \u2192 dev \u2192 test \u2192 approval \u2192 release \u2192 done (any \u2192 canceled;",
57
+ " canceled \u2192 draft and done \u2192 approval undo the last step)",
57
58
  " dev = an agent implements it & opens a PR \xB7 test = QA \xB7 approval = a human reviews \xB7 release = merged to dev/shipped.",
58
- "\u2022 Milestone: draft \u2192 discovery \u2192 loop \u2192 release \u2192 done (any \u2192 canceled)",
59
+ "\u2022 Milestone: draft \u2192 discovery \u2192 loop \u2192 release \u2192 done (any \u2192 canceled;",
60
+ " canceled \u2192 discovery brings back a milestone closed by mistake)",
59
61
  " discovery = answer the framework Q&A to split it into tasks \xB7 loop = build/test/approve \xB7 release = ship.",
60
62
  "\u2022 Stack (Release Candidate): 2+ approval tasks of ONE milestone on an rc branch, tested & shipped together \u2014",
61
63
  " liquid (assembling) \u2192 blocked (a member conflicts) | frozen (human-resolved) \u2192 released (any \u2192 canceled).",
@@ -80,8 +82,8 @@ var INSTRUCTIONS = [
80
82
  '\u2022 "Break a milestone into tasks" \u2192 polaris.milestone.qa_list / qa_answer (while in discovery)',
81
83
  `\u2022 "Triage support / what's waiting?" \u2192 polaris.ticket.list (status, project_key) \u2014 P1 first`,
82
84
  '\u2022 "Reply to a customer / hand off" \u2192 polaris.ticket.reply then polaris.ticket.pass(to)',
83
- '\u2022 "Turn a report into work" \u2192 polaris.ticket.frame_issue \u2192 polaris.issue.add_task \xD7N',
84
- '\u2022 "Same bug reported again" \u2192 polaris.ticket.link_issue (dedup onto the open issue)',
85
+ '\u2022 "Turn a report into work" \u2192 polaris.ticket.frame_issue \u2192 polaris.issue.add_task \xD7N (framing is HUMAN-only; the helpdesker proposes it)',
86
+ '\u2022 "Same bug reported again" \u2192 polaris.ticket.link_issue (dedup onto the open issue; HUMAN-only) \u2192 say we already have it \u2192 close the duplicate ticket',
85
87
  "",
86
88
  "Identifiers: projects by `key` (string, e.g. saasA); milestones/tasks/agents/stacks by numeric `id`. Writes need a token; reads work anonymously."
87
89
  ].join(`
@@ -128,6 +130,18 @@ var TOOLS = [
128
130
  ]),
129
131
  call: async (args) => (await apiCall("POST", "/api/projects", args)).body
130
132
  },
133
+ {
134
+ name: "polaris.project.arm",
135
+ description: "Arm a project for auto-approval (human-only): while armed, dev work that reaches `approval` CLEAN is approved on your behalf \u2014 no per-task click \u2014 and follows the normal path to release. Escalated tasks, mkt creatives, and support work still wait for a person; a merge that fails leaves the task in `approval`. Idempotent.",
136
+ inputSchema: objSchema({ key: strSchema("project key (e.g. saasA)") }, ["key"]),
137
+ call: async (args) => (await apiCall("POST", `/api/projects/${args.key}/arm`)).body
138
+ },
139
+ {
140
+ name: "polaris.project.disarm",
141
+ description: "Disarm a project (human-only). Immediate effect: the next task to reach `approval` waits for a person again. Work already parked in `approval` is untouched. Idempotent.",
142
+ inputSchema: objSchema({ key: strSchema("project key (e.g. saasA)") }, ["key"]),
143
+ call: async (args) => (await apiCall("POST", `/api/projects/${args.key}/disarm`)).body
144
+ },
131
145
  {
132
146
  name: "polaris.milestone.list",
133
147
  description: "List milestones in a project.",
@@ -142,11 +156,16 @@ var TOOLS = [
142
156
  },
143
157
  {
144
158
  name: "polaris.milestone.update",
145
- description: "Correct or refine a milestone's spec \u2014 PATCH its description_md (and optionally name), same idea as polaris.task.update. Use it to sharpen the brief for better scoping. Needs a token.",
159
+ description: "Correct or refine a milestone's spec \u2014 PATCH its description_md (and optionally name), same idea as polaris.task.update. On a mkt campaign the market can also be corrected, while it is still in draft or discovery: after that the creatives are already bound to accounts. The campaign's rhythm, budget and channels live in the description \u2014 write them there and the briefer reads them. Needs a token.",
146
160
  inputSchema: objSchema({
147
161
  id: intSchema(),
148
162
  name: strSchema(),
149
- description_md: strSchema("full markdown brief; replaces the current description")
163
+ description_md: strSchema("full markdown brief; replaces the current description"),
164
+ market: {
165
+ type: "array",
166
+ items: { type: "string", enum: ["BR", "US", "EU"] },
167
+ description: "mkt: target markets; replaces the current list"
168
+ }
150
169
  }, ["id"]),
151
170
  call: async (args) => {
152
171
  const body = {};
@@ -154,6 +173,8 @@ var TOOLS = [
154
173
  body.name = args.name;
155
174
  if (typeof args.description_md === "string")
156
175
  body.description_md = args.description_md;
176
+ if ("market" in args)
177
+ body.market = args.market;
157
178
  return (await apiCall("PATCH", `/api/milestones/${args.id}`, body)).body;
158
179
  }
159
180
  },
@@ -181,6 +202,60 @@ var TOOLS = [
181
202
  answer_md: args.answer_md
182
203
  })).body
183
204
  },
205
+ {
206
+ name: "polaris.milestone.attachment_list",
207
+ description: "List this milestone's IMAGE attachments \u2014 anchored in its description_md by a `ref:N` marker, or attached but not yet placed in the text. A link is not here: it's plain `[text](url)` markdown written straight into description_md, no row, no marker \u2014 read it off the text like any other prose. Each image carries a `marker` ready to paste into description_md, an `attachment_id` (the underlying file \u2014 pass it to attachment_create elsewhere to attach the SAME image with no re-upload), and an `alt` (a plain description of what it shows, often blank) \u2014 intent (what to do with it) always lives in the description_md text around the marker, never in `alt`.",
208
+ inputSchema: objSchema({ id: intSchema("milestone id") }, ["id"]),
209
+ call: async (args) => (await apiCall("GET", `/api/milestones/${args.id}/attachments`)).body
210
+ },
211
+ {
212
+ name: "polaris.milestone.attachment_presign",
213
+ description: "Step 1 of attaching an image to a milestone: reserve an upload key. Returns file_key + upload_url \u2014 PUT the raw image bytes to upload_url YOURSELF (curl/fetch from your shell; this call does not carry bytes), then call polaris.milestone.attachment_create with the same file_key. A link isn't an attachment at all \u2014 just write `[text](url)` straight into the milestone's description_md.",
214
+ inputSchema: objSchema({
215
+ id: intSchema("milestone id"),
216
+ mime: strSchema("image/png | image/jpeg | image/webp"),
217
+ size_bytes: intSchema()
218
+ }, ["id", "mime", "size_bytes"]),
219
+ call: async (args) => (await apiCall("POST", `/api/milestones/${args.id}/attachments/presign`, {
220
+ mime: args.mime,
221
+ size_bytes: args.size_bytes
222
+ })).body
223
+ },
224
+ {
225
+ name: "polaris.milestone.attachment_create",
226
+ description: "Attach an IMAGE to a milestone. Two shapes: a fresh upload (file_key from attachment_presign + mime + size_bytes + filename, alt optional); or attaching an EXISTING file already uploaded elsewhere (attachment_id \u2014 from another attachment's `attachment_id` field \u2014 alt optional) which is how a milestone reference gets forwarded onto a task without re-uploading its bytes. The same file can be attached to any number of milestones/tasks this way (N:N) \u2014 each attachment gets its own `alt` here, independent of what it says anywhere else it's attached. A link is NOT this call \u2014 write `[text](url)` straight into the milestone's description_md, no attachment row at all. `alt` only describes what the image shows \u2014 it is never an instruction; what to DO with it lives in the body prose around the marker this call returns, which you paste into description_md yourself (an attachment nobody placed in the text is as good as absent). Read that prose to decide: the default, when it just describes what the reference IS, is to pass it along as-is; only when it explicitly asks for something derived (a description, a summary) should you use it as input instead and write that into the task's own text.",
227
+ inputSchema: objSchema({
228
+ id: intSchema("milestone id"),
229
+ alt: strSchema("what the image shows, plainly \u2014 never an instruction"),
230
+ filename: strSchema("required for a fresh upload \u2014 the file's own name"),
231
+ file_key: strSchema("from attachment_presign"),
232
+ mime: strSchema(),
233
+ size_bytes: intSchema(),
234
+ attachment_id: intSchema("attach an EXISTING file (its attachment_id) instead of file_key/mime/size_bytes/filename \u2014 no re-upload")
235
+ }, ["id"]),
236
+ call: async (args) => {
237
+ const { id, ...body } = args;
238
+ return (await apiCall("POST", `/api/milestones/${id}/attachments`, body)).body;
239
+ }
240
+ },
241
+ {
242
+ name: "polaris.milestone.attachment_update",
243
+ description: "Edit the alt text on a milestone attachment \u2014 the only field worth changing after upload; the image itself and its filename stay what was actually uploaded. Only THIS attachment (this milestone) changes \u2014 the same file attached elsewhere keeps its own alt.",
244
+ inputSchema: objSchema({ id: intSchema("milestone id"), seq: intSchema(), alt: strSchema() }, [
245
+ "id",
246
+ "seq",
247
+ "alt"
248
+ ]),
249
+ call: async (args) => (await apiCall("PATCH", `/api/milestones/${args.id}/attachments/${args.seq}`, {
250
+ alt: args.alt
251
+ })).body
252
+ },
253
+ {
254
+ name: "polaris.milestone.attachment_delete",
255
+ description: "Remove an attachment from a milestone by its seq. Only removes it from THIS milestone \u2014 the underlying file, and any other milestone/task it's attached to, are untouched.",
256
+ inputSchema: objSchema({ id: intSchema("milestone id"), seq: intSchema() }, ["id", "seq"]),
257
+ call: async (args) => (await apiCall("DELETE", `/api/milestones/${args.id}/attachments/${args.seq}`)).body
258
+ },
184
259
  {
185
260
  name: "polaris.task.list",
186
261
  description: `Find tasks \u2014 the agent's entry point. Pass assignee_agent_id="self" (or assignee_human_id="self" for a human) to get what is YOURS; add status=dev (etc.) to see only active work. Other filters: milestone_id, product_key, team.`,
@@ -225,7 +300,7 @@ var TOOLS = [
225
300
  milestone_id: intSchema(),
226
301
  name: strSchema(),
227
302
  description_md: strSchema(),
228
- status: strSchema("draft|backlog|dev|test|approval|release (default draft)"),
303
+ status: strSchema("draft \u2014 the only status a task can be created in; it reaches the rest by being moved, one legal step at a time (polaris.task.transition)"),
229
304
  channel: strSchema("mkt: Instagram, TikTok, LinkedIn, \u2026"),
230
305
  format: strSchema("mkt: post, carrossel, reel, story, artigo, \u2026"),
231
306
  slides: intSchema("mkt: REQUIRED when format is a carousel \u2014 how many images the piece has (2..10). " + "It is a contract: the generator delivers exactly this many. Omit for every other format."),
@@ -239,6 +314,60 @@ var TOOLS = [
239
314
  }, ["milestone_id", "name"]),
240
315
  call: async (args) => (await apiCall("POST", "/api/tasks", args)).body
241
316
  },
317
+ {
318
+ name: "polaris.task.attachment_list",
319
+ description: "List this task's IMAGE attachments, including ones a milestone reference forwarded here (attached by attachment_id, no re-upload) plus anything attached directly to this task. A link is not here: it's plain `[text](url)` markdown written straight into the task's description_md, no row, no marker. Each image carries a `marker` ready to paste into description_md, an `attachment_id` (the underlying file \u2014 pass it to attachment_create elsewhere to attach the SAME image with no re-upload), and an `alt` (a plain description of what it shows, often blank) \u2014 intent (what to do with it) always lives in the description_md text around the marker, never in `alt`.",
320
+ inputSchema: objSchema({ id: intSchema("task id") }, ["id"]),
321
+ call: async (args) => (await apiCall("GET", `/api/tasks/${args.id}/attachments`)).body
322
+ },
323
+ {
324
+ name: "polaris.task.attachment_presign",
325
+ description: "Step 1 of attaching an image to a task: reserve an upload key. Returns file_key + upload_url \u2014 PUT the raw image bytes to upload_url YOURSELF (curl/fetch from your shell; this call does not carry bytes), then call polaris.task.attachment_create with the same file_key. A link isn't an attachment at all \u2014 just write `[text](url)` straight into the task's description_md.",
326
+ inputSchema: objSchema({
327
+ id: intSchema("task id"),
328
+ mime: strSchema("image/png | image/jpeg | image/webp"),
329
+ size_bytes: intSchema()
330
+ }, ["id", "mime", "size_bytes"]),
331
+ call: async (args) => (await apiCall("POST", `/api/tasks/${args.id}/attachments/presign`, {
332
+ mime: args.mime,
333
+ size_bytes: args.size_bytes
334
+ })).body
335
+ },
336
+ {
337
+ name: "polaris.task.attachment_create",
338
+ description: "Attach an IMAGE to a task. Two shapes: a fresh upload (file_key from attachment_presign + mime + size_bytes + filename, alt optional); or attaching an EXISTING file already uploaded elsewhere (attachment_id \u2014 from another attachment's `attachment_id` field \u2014 alt optional, no re-upload). This is how the BRIEF forwards a milestone's image onto a task it's planning. The same file can be attached to any number of milestones/tasks (N:N) \u2014 each attachment gets its own `alt` here, independent of what it says anywhere else it's attached. A link is NOT this call: write `[text](url)` straight into the task's description_md \u2014 for a milestone link, just copy the markdown across, there's nothing to attach. `alt` only describes what the image shows \u2014 never an instruction. Read the milestone's OWN body prose around its marker for intent (alt never carries it), and once attached here, paste the `marker` this call returns into the task's description_md yourself, with that instruction right after it \u2014 an attachment nobody placed in the text is as good as absent. Default: forward as-is; only when that prose explicitly asks for something derived (a description, a summary) should you use it as input instead and write that into this task's own description_md.",
339
+ inputSchema: objSchema({
340
+ id: intSchema("task id"),
341
+ alt: strSchema("what the image shows, plainly \u2014 never an instruction"),
342
+ filename: strSchema("required for a fresh upload \u2014 the file's own name"),
343
+ file_key: strSchema("from attachment_presign"),
344
+ mime: strSchema(),
345
+ size_bytes: intSchema(),
346
+ attachment_id: intSchema("attach an EXISTING file (its attachment_id) instead of file_key/mime/size_bytes/filename \u2014 no re-upload")
347
+ }, ["id"]),
348
+ call: async (args) => {
349
+ const { id, ...body } = args;
350
+ return (await apiCall("POST", `/api/tasks/${id}/attachments`, body)).body;
351
+ }
352
+ },
353
+ {
354
+ name: "polaris.task.attachment_update",
355
+ description: "Edit the alt text on a task attachment \u2014 the only field worth changing after upload; the image itself and its filename stay what was actually uploaded. Only THIS attachment (this task) changes \u2014 the same file attached elsewhere keeps its own alt.",
356
+ inputSchema: objSchema({ id: intSchema("task id"), seq: intSchema(), alt: strSchema() }, [
357
+ "id",
358
+ "seq",
359
+ "alt"
360
+ ]),
361
+ call: async (args) => (await apiCall("PATCH", `/api/tasks/${args.id}/attachments/${args.seq}`, {
362
+ alt: args.alt
363
+ })).body
364
+ },
365
+ {
366
+ name: "polaris.task.attachment_delete",
367
+ description: "Remove an attachment from a task by its seq. Only removes it from THIS task \u2014 the underlying file, and any other milestone/task it's attached to, are untouched.",
368
+ inputSchema: objSchema({ id: intSchema("task id"), seq: intSchema() }, ["id", "seq"]),
369
+ call: async (args) => (await apiCall("DELETE", `/api/tasks/${args.id}/attachments/${args.seq}`)).body
370
+ },
242
371
  {
243
372
  name: "polaris.task.update",
244
373
  description: "Correct or refine a task's spec \u2014 PATCH its description_md (and optionally name). For a marketing creative, set asset_url to the produced asset (image/video) so the reviewer can download and review it. It is NOT a log of what was done (leave that as a comment). Needs a token.",
@@ -264,19 +393,19 @@ var TOOLS = [
264
393
  },
265
394
  {
266
395
  name: "polaris.task.transition",
267
- description: "Move a task to its next status when you finish a stage (e.g. dev\u2192test once your PR is up). Enforced flow: draft\u2192backlog\u2192dev\u2192test\u2192approval\u2192release\u2192done (any\u2192canceled). Illegal jumps are rejected. The approval\u2192release gate is polaris.task.approve (human-only).",
396
+ description: "Move a task to its next status when you finish a stage (e.g. dev\u2192test once your PR is up). Enforced flow: draft\u2192backlog\u2192dev\u2192test\u2192approval\u2192release\u2192done (any\u2192canceled). Illegal jumps are rejected. Neither terminal state is a dead end: canceled\u2192draft and done\u2192approval undo the last step, so a mistaken close is recoverable without touching the database. The approval\u2192release gate is polaris.task.approve (human-only).",
268
397
  inputSchema: objSchema({ id: intSchema(), status: strSchema() }, ["id", "status"]),
269
398
  call: async (args) => (await apiCall("POST", `/api/tasks/${args.id}/state`, { status: args.status })).body
270
399
  },
271
400
  {
272
401
  name: "polaris.task.approve",
273
- description: "The human review gate: approve a dev task in `approval` \u2192 it advances toward release. Human-only. NOT valid for mkt creatives (output_type=post/video/etc.) \u2014 use polaris.task.schedule or polaris.task.mark_published instead. To ship several approval tasks together, group them into a stack and use polaris.stack.release.",
402
+ description: "The human review gate: a task in `approval` advances to `release` \u2014 cleared to go out, not gone out. Human-only, and valid for everything: a mkt creative approves the same way, and is then either scheduled (auto-publish at its time) or marked published once it has gone out. To ship several approval tasks together, group them into a stack and use polaris.stack.release.",
274
403
  inputSchema: objSchema({ id: intSchema() }, ["id"]),
275
404
  call: async (args) => (await apiCall("POST", `/api/tasks/${args.id}/approve`)).body
276
405
  },
277
406
  {
278
407
  name: "polaris.task.schedule",
279
- description: "Schedule a mkt creative for publication: approval \u2192 agendado. The creative must be bound to an active social account (resolved from its market + channel) and have a publish_at in the future. Its copy is frozen while scheduled \u2014 editing it requires unscheduling first.",
408
+ description: "Schedule a mkt creative for publication: approval \u2192 agendado, and the publisher takes it to `done` when its time arrives. The creative must be bound to an active social account (resolved from its market + channel) and have a publish_at in the future. Its copy is frozen while scheduled \u2014 editing it requires unscheduling first.",
280
409
  inputSchema: objSchema({ id: intSchema() }, ["id"]),
281
410
  call: async (args) => (await apiCall("POST", `/api/tasks/${args.id}/schedule`)).body
282
411
  },
@@ -288,7 +417,7 @@ var TOOLS = [
288
417
  },
289
418
  {
290
419
  name: "polaris.task.mark_published",
291
- description: "Manually mark a mkt creative as published: approval \u2192 release (bypasses scheduling). Recorded as a manual human action. Use when the post was published outside the scheduler.",
420
+ description: "The creative has gone out: `release` \u2192 `done`, optionally with the permalink of the post. This is the LAST transition, not a shortcut \u2014 approve it into `release` first (cleared to go out), then mark it published once it actually has. Recorded as a manual human action; use it when the post went out outside the scheduler.",
292
421
  inputSchema: objSchema({ id: intSchema() }, ["id"]),
293
422
  call: async (args) => (await apiCall("POST", `/api/tasks/${args.id}/mark-published`)).body
294
423
  },
@@ -366,13 +495,13 @@ var TOOLS = [
366
495
  },
367
496
  {
368
497
  name: "polaris.ticket.frame_issue",
369
- description: "Frame a NEW issue (the problem) from this ticket's conversation \u2014 the helpdesk twin of a milestone. A note is added to the thread. Then decompose it via polaris.issue.add_task.",
498
+ description: "Frame a NEW issue (the problem) from this ticket's conversation \u2014 the helpdesk twin of a milestone. A note is added to the thread. Then decompose it via polaris.issue.add_task. HUMAN ONLY: an agent token gets 403 (agent_cannot_admin) \u2014 the helpdesker proposes the issue during triage and a human validates it with a button.",
370
499
  inputSchema: objSchema({ id: intSchema(), title: strSchema() }, ["id", "title"]),
371
500
  call: async (args) => (await apiCall("POST", `/api/tickets/${args.id}/issues`, { title: args.title })).body
372
501
  },
373
502
  {
374
503
  name: "polaris.ticket.link_issue",
375
- description: "Link this ticket to an EXISTING issue (dedup \u2014 it's a duplicate report of a problem already being worked).",
504
+ description: "Link this ticket to an EXISTING issue (dedup \u2014 it's a duplicate report of a problem already being worked). Then tell the customer we already have the problem, point them to follow it in the product, and close this ticket after sending. HUMAN ONLY: an agent token gets 403 (agent_cannot_admin) \u2014 the helpdesker proposes the link, a human accepts it.",
376
505
  inputSchema: objSchema({ id: intSchema(), issue_id: intSchema() }, ["id", "issue_id"]),
377
506
  call: async (args) => (await apiCall("POST", `/api/tickets/${args.id}/issues/link`, { issue_id: args.issue_id })).body
378
507
  },
@@ -527,6 +656,30 @@ var TOOLS = [
527
656
  return r.body;
528
657
  }
529
658
  },
659
+ {
660
+ name: "polaris.revision.list",
661
+ description: "History of an object's markdown field, newest first \u2014 what the text was BEFORE and AFTER each change, who changed it and how (human, descriptioner, revert). Use it to answer \"what did the descriptioner actually change in this milestone?\", which the activity feed cannot tell you. Scopes: milestone|task|issue|agent use `id`; agent_function uses `key` (e.g. 'planner').",
662
+ inputSchema: objSchema({
663
+ scope: strSchema("milestone|task|issue|agent|agent_function"),
664
+ id: intSchema("object id \u2014 every scope except agent_function"),
665
+ key: strSchema("text key \u2014 agent_function only, e.g. 'planner'")
666
+ }, ["scope"]),
667
+ call: async (args) => {
668
+ const qs = new URLSearchParams;
669
+ qs.set("scope", String(args.scope));
670
+ if (args.id !== undefined && args.id !== null)
671
+ qs.set("id", String(args.id));
672
+ if (args.key !== undefined && args.key !== null)
673
+ qs.set("key", String(args.key));
674
+ return (await apiCall("GET", `/api/revisions?${qs}`)).body;
675
+ }
676
+ },
677
+ {
678
+ name: "polaris.revision.revert",
679
+ description: "Restore a markdown field to its value BEFORE the given revision. Not a rollback \u2014 it writes normally, so it records its own revision with source='revert' and can itself be reverted. Needs a token.",
680
+ inputSchema: objSchema({ id: intSchema("revision id") }, ["id"]),
681
+ call: async (args) => (await apiCall("POST", `/api/revisions/${args.id}/revert`)).body
682
+ },
530
683
  {
531
684
  name: "polaris.chat.get",
532
685
  description: "Resolve the chat thread for a scope (e.g. task 42) and return its id. Idempotent (get-or-create). You rarely need this directly \u2014 polaris.chat.messages takes the scope and resolves the id for you.",
@@ -574,6 +727,55 @@ var TOOLS = [
574
727
  inputSchema: objSchema({ key: strSchema("project key"), content: strSchema("full CLAUDE.md markdown") }, ["key", "content"]),
575
728
  call: async (args) => (await apiCall("PUT", `/api/projects/${args.key}/claude-md`, { content: args.content })).body
576
729
  },
730
+ {
731
+ name: "polaris.presence.list",
732
+ description: "Where a product exists in the world: the channels it publishes on and the directories it is listed in, each with its state (missing \u2192 exists \u2192 connected). Read this before writing a campaign \u2014 a channel that is not connected cannot be published to.",
733
+ inputSchema: objSchema({ key: strSchema("project key") }, ["key"]),
734
+ call: async (args) => (await apiCall("GET", `/api/projects/${args.key}/presences`)).body
735
+ },
736
+ {
737
+ name: "polaris.presence.add",
738
+ description: "Add a place to a project (human-only). kind: channel (we publish there) | listing (we keep an entry there). Idempotent on slug: adding the same place twice fills in what was left empty. Never send a password you were not given.",
739
+ inputSchema: objSchema({
740
+ key: strSchema("project key"),
741
+ kind: strSchema("channel | listing"),
742
+ slug: strSchema("instagram \xB7 linkedin \xB7 reddit \xB7 g2 \xB7 capterra \u2026"),
743
+ label: strSchema("human name, e.g. Instagram"),
744
+ url: strSchema("public profile or listing URL"),
745
+ handle: strSchema("@handle or account name"),
746
+ state: strSchema("missing | exists | connected (channel only)"),
747
+ login_email: strSchema(),
748
+ notes: strSchema()
749
+ }, ["key", "kind", "slug", "label"]),
750
+ call: async (args) => {
751
+ const { key, ...body } = args;
752
+ return (await apiCall("POST", `/api/projects/${key}/presences`, body)).body;
753
+ }
754
+ },
755
+ {
756
+ name: "polaris.presence.update",
757
+ description: "Edit one presence \u2014 its URL, handle, owner, notes or state (human-only).",
758
+ inputSchema: objSchema({
759
+ key: strSchema("project key"),
760
+ id: intSchema("presence id"),
761
+ label: strSchema(),
762
+ url: strSchema(),
763
+ handle: strSchema(),
764
+ state: strSchema("missing | exists | connected"),
765
+ login_email: strSchema(),
766
+ notes: strSchema()
767
+ }, ["key", "id"]),
768
+ call: async (args) => {
769
+ const { key, id, ...body } = args;
770
+ return (await apiCall("PATCH", `/api/projects/${key}/presences/${id}`, body)).body;
771
+ }
772
+ },
773
+ {
774
+ name: "polaris.presence.verify",
775
+ description: "Stamp a presence as CHECKED AGAINST THE TRUTH of the product (human-only). Use it after actually looking: on a directory listing the risk is not staleness, it is the feature checklist claiming something the product does not do.",
776
+ inputSchema: objSchema({ key: strSchema("project key"), id: intSchema() }, ["key", "id"]),
777
+ call: async (args) => (await apiCall("POST", `/api/projects/${args.key}/presences/${args.id}/verify`, {})).body
778
+ },
577
779
  {
578
780
  name: "polaris.agent.create",
579
781
  description: "Create an agent/employee (human-only). function: developer|tester|planner|helpdesker; product = project key; team = dev|mkt; domain optional (roadmap|helpdesk|both).",
@@ -589,12 +791,22 @@ var TOOLS = [
589
791
  },
590
792
  {
591
793
  name: "polaris.agent.update",
592
- description: "Update an agent (human-only): name (rename), domain (roadmap|helpdesk|both), or mantra_md. The stable agent_id_slug never changes.",
794
+ description: "Update an agent (human-only): name (rename), domain (roadmap|helpdesk|both), mantra_md, or resource_limits. The stable agent_id_slug never changes. resource_limits (CPU/RAM/disk, enforced via the agent's systemd unit) is null-or-object: null clears every field back to the default; an object states ALL fields (memory_max_mb, cpu_quota_pct, disk_quota_mb \u2014 each an integer, or null for that field's default). Takes effect on the agent's next re-provision, not instantly.",
593
795
  inputSchema: objSchema({
594
796
  id: intSchema(),
595
797
  name: strSchema(),
596
798
  domain: strSchema("roadmap|helpdesk|both"),
597
- mantra_md: strSchema()
799
+ mantra_md: strSchema(),
800
+ resource_limits: {
801
+ type: ["object", "null"],
802
+ description: "CPU/RAM/disk caps. null = defaults for all fields. Object must state every field (int or null): memory_max_mb, cpu_quota_pct, disk_quota_mb.",
803
+ properties: {
804
+ memory_max_mb: { type: ["integer", "null"] },
805
+ cpu_quota_pct: { type: ["integer", "null"] },
806
+ disk_quota_mb: { type: ["integer", "null"] }
807
+ },
808
+ additionalProperties: false
809
+ }
598
810
  }, ["id"]),
599
811
  call: async (args) => {
600
812
  const { id, ...patch } = args;
@@ -654,7 +866,7 @@ var TOOLS = [
654
866
  },
655
867
  {
656
868
  name: "polaris.milestone.create",
657
- description: "Create a milestone. team=dev|mkt; end_date = deadline (ISO date, required). For a marketing CAMPAIGN (team=mkt) these extra fields carry the plan: market (BR/US/EU), cadence (per-channel rules Discovery expands into dated creatives), max_creatives (cap on that expansion), and paid + platforms + budget for a paid campaign.",
869
+ description: "Create a milestone. team=dev|mkt; end_date = deadline (ISO date, required). For a marketing CAMPAIGN (team=mkt), `market` says which markets it serves \u2014 that is what routes each creative to an account. Everything else about the campaign (rhythm, channels, budget, angle) goes in `description_md`: the briefer reads it and cuts the creatives, each with its own day.",
658
870
  inputSchema: objSchema({
659
871
  project_key: strSchema(),
660
872
  name: strSchema(),
@@ -667,28 +879,7 @@ var TOOLS = [
667
879
  type: "array",
668
880
  items: { type: "string" },
669
881
  description: "mkt: target markets \u2014 any of BR, US, EU"
670
- },
671
- cadence: {
672
- type: "array",
673
- description: "mkt: per-channel cadence rules Discovery expands into dated creatives",
674
- items: {
675
- type: "object",
676
- properties: {
677
- channel: { type: "string", description: "Instagram, TikTok, LinkedIn, \u2026" },
678
- format: { type: "string", description: "post, reel, story, artigo, \u2026" },
679
- n: { type: "integer", description: "count per period" },
680
- per: { type: "string", description: "day | week" }
681
- }
682
- }
683
- },
684
- max_creatives: intSchema("mkt: cap on how many creatives Discovery/cadence may generate"),
685
- paid: { type: "boolean", description: "mkt: is the whole campaign paid?" },
686
- platforms: {
687
- type: "array",
688
- items: { type: "string" },
689
- description: "mkt paid: any of Meta, Google, Reddit, LinkedIn, TikTok, YouTube"
690
- },
691
- budget: { type: "number", description: "mkt: campaign ad-spend budget (\u20AC)" }
882
+ }
692
883
  }, ["project_key", "name", "team", "end_date"]),
693
884
  call: async (args) => (await apiCall("POST", "/api/milestones", args)).body
694
885
  },
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@glie/mcp-polaris",
3
- "version": "0.7.0",
4
- "description": "Model Context Protocol (stdio) server exposing Polaris \u2014 glie's ops platform \u2014 as native tools in Claude Code and any MCP client.",
3
+ "version": "0.8.0",
4
+ "description": "Model Context Protocol (stdio) server exposing Polaris, glie's ops platform, as native tools in Claude Code and any MCP client.",
5
5
  "license": "Apache-2.0",
6
6
  "author": "glie <carlos@glie.ai>",
7
7
  "type": "module",