amicooked 0.1.5 → 0.1.7

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.
@@ -4,3 +4,12 @@ export function serverInstructions() {
4
4
  const match = SKILL_MD.match(/<!-- server-instructions -->([\s\S]*?)<!-- \/server-instructions -->/);
5
5
  return (match?.[1] ?? "").trim();
6
6
  }
7
+ /**
8
+ * A section of SKILL.md marked `<!-- tool:NAME -->`, returned inside that tool's result. Some apps (Claude Desktop)
9
+ * never show a local server's instructions to the model, but every app shows tool results, so guidance that must
10
+ * always hold travels this way. SKILL.md stays the one place it's written.
11
+ */
12
+ export function toolGuide(tool) {
13
+ const match = SKILL_MD.match(new RegExp(`<!-- tool:${tool} -->([\\s\\S]*?)<!-- /tool:${tool} -->`));
14
+ return (match?.[1] ?? "").trim();
15
+ }
package/dist/skill.js CHANGED
@@ -1,2 +1,2 @@
1
1
  // Generated from skill/SKILL.md by scripts/sync-skill.mjs. Don't edit by hand.
2
- export const SKILL_MD = "---\nname: amicooked\ndescription: Use when a student asks about their D2L Brightspace courses, grades, deadlines, assignments, announcements or course files, asks \"am I cooked?\", or wants to set up Am I Cooked.\n---\n\n# Am I Cooked\n\nAm I Cooked connects an AI assistant to a student's D2L Brightspace account (Avenue to Learn, LEARN, onQ, OWL Brightspace, CourseLink, MyLearningSpace and others). It runs on the student's own computer and is read-only.\n\n## Setting it up (for agents)\n\n**First, check that you can run commands on the student's computer.** Setup installs a program there, so it only works from an agent with a terminal, like Claude Code, Codex or the ChatGPT desktop app. If you're on a website (chatgpt.com, claude.ai, gemini.google.com), in a phone app, or in a chat with no command tool, don't try. Tell the student instead:\n\n- Get an app that can do it: Claude Desktop (https://claude.ai/download) or the ChatGPT app (https://chatgpt.com/download), then paste the same request there. Or install it themselves by pasting this into Terminal (Mac): `curl -fsSL https://amicooked-mcp.vercel.app/install.sh | sh`, or this into PowerShell (Windows): `irm https://amicooked-mcp.vercel.app/install.ps1 | iex`.\n- Either way, it ends by opening their AI app, ready to ask \"am I cooked?\".\n\nIf you can run commands:\n\n1. Ask the student which school they go to. Presets: mcmaster, waterloo, western, queens, guelph, laurier, tmu, uottawa, carleton, brock, windsor, laurentian, lakehead. Any other Brightspace school works with the URL they log in through.\n2. Install it:\n - macOS / Linux: `curl -fsSL https://amicooked-mcp.vercel.app/install.sh | sh -s -- --no-setup`\n - Windows (PowerShell): `$env:AMICOOKED_NO_SETUP=1; irm https://amicooked-mcp.vercel.app/install.ps1 | iex`\n - With Node.js installed, `npx -y amicooked@0` works in place of `amicooked` below.\n3. Run setup with flags, and a long command timeout (at least 5 minutes), because the student signs in through a browser window that opens:\n `amicooked setup --school mcmaster --clients desktop,code`\n Use `--school https://...` for schools without a preset. Add `chatgpt-desktop` to `--clients` if they use the ChatGPT desktop app, then tell them to restart it. ChatGPT and Claude on the web or on phones aren't supported.\n4. Tell the student to sign in to their school in the browser window. Never ask for their password; you never need it.\n5. Setup ends with a \"Next\" list: one line per app saying it's open and ready, needs a restart, needs opening, or needs installing (with a link). Tell the student each line as written. If you're running inside Claude Desktop, they need to quit it; Am I Cooked then reopens it with everything set up.\n6. If something fails, run `amicooked status` and read what it says.\n\n<!-- server-instructions -->\n## Answering questions\n\n- Start broad questions (\"am I cooked?\", \"what should I work on?\", \"how am I doing?\", \"what's due?\") with `am_i_cooked`. It covers every current course in one call.\n- Other tools take a course code directly, like `course: \"3BB4\"`. Only call `get_my_courses` when a code is ambiguous or the student asks what they're enrolled in.\n- Check `get_announcements` for a course before a final verdict on it; deadlines and exam details often change there.\n- To read slides, handouts or assignment PDFs: `get_course_content` to find the file, then `download_file`. Use `read_file` for files already downloaded.\n- If a tool says a login window opened, tell the student to sign in there and ask again.\n\n## The verdict\n\nUse `summary.heatLabel` from `am_i_cooked` to set the tone. Be playful, never mean, and always useful.\n\n| heatLabel | Tone |\n|---|---|\n| raw | Relaxed. Nothing urgent; maybe get ahead on something. |\n| warming up | Light nudge. One or two things to handle soon. |\n| toasty | Focused. A real plan for the next few days. |\n| cooked | Direct and supportive. Triage what matters most. |\n| well done | Calm and practical. Damage control, and who to talk to. |\n\n1. Lead with a one-line verdict, e.g. \"Toasty, not cooked.\"\n2. Then the top 3 actions, each with course, item and due time in the student's local time (D2L times are UTC).\n3. Say whether a grade is `final_calculated` or `estimated_from_items`; estimates ignore dropped and bonus items.\n - For an estimate, say how much is left, like \"67.6% so far. 60% of your grade is still to come.\" Use `weightRemaining` for that number.\n - Name the `keyItems` when a grade needs explaining, with their weight: \"the midterm (59.5%, worth 25%) is pulling it down.\"\n - Never work weights out backwards from a result. Use the `weight` values the tools return.\n - `basis: \"points\"` means the gradebook has no weights. Say the estimate is by points and the real weighting may differ. If the student asks how the grade is calculated, find the course outline with `get_course_content` and read the weights from it.\n4. `late_window_open` means a missed assignment can still be submitted: say so first, it's the easiest win.\n5. If `partial_data` appears, mention that some of a course couldn't be loaded.\n6. For grades under 60%, suggest office hours, the TA, or an academic advisor.\n\n## Integrity\n\nAm I Cooked only reads. Help the student understand material and plan their time, but don't write graded work for them to submit.\n<!-- /server-instructions -->\n";
2
+ export const SKILL_MD = "---\nname: amicooked\ndescription: Use when a student asks about their D2L Brightspace courses, grades, deadlines, assignments, announcements or course files, asks \"am I cooked?\", or wants to set up Am I Cooked. Also use when they want to study for one of their courses, like preparing for a test, midterm or exam, \"quiz me\", or reviewing or summarising lectures, so the questions come from their own course material.\n---\n\n# Am I Cooked\n\nAm I Cooked connects an AI assistant to a student's D2L Brightspace account (Avenue to Learn, LEARN, onQ, OWL Brightspace, CourseLink, MyLearningSpace and others). It runs on the student's own computer and is read-only.\n\n## Setting it up (for agents)\n\n**First, check that you can run commands on the student's computer.** Setup installs a program there, so it only works from an agent with a terminal, like Claude Code, Codex or the ChatGPT desktop app. If you're on a website (chatgpt.com, claude.ai, gemini.google.com), in a phone app, or in a chat with no command tool, don't try. Tell the student instead:\n\n- Get an app that can do it: Claude Desktop (https://claude.ai/download) or the ChatGPT app (https://chatgpt.com/download), then paste the same request there. Or install it themselves by pasting this into Terminal (Mac): `curl -fsSL https://amicooked-mcp.vercel.app/install.sh | sh`, or this into PowerShell (Windows): `irm https://amicooked-mcp.vercel.app/install.ps1 | iex`.\n- Either way, it ends by opening their AI app, ready to ask \"am I cooked?\".\n\nIf you can run commands:\n\n1. Ask the student which school they go to. Presets: mcmaster, waterloo, western, queens, guelph, laurier, tmu, uottawa, carleton, brock, windsor, laurentian, lakehead. Any other Brightspace school works with the URL they log in through.\n2. Install it:\n - macOS / Linux: `curl -fsSL https://amicooked-mcp.vercel.app/install.sh | sh -s -- --no-setup`\n - Windows (PowerShell): `$env:AMICOOKED_NO_SETUP=1; irm https://amicooked-mcp.vercel.app/install.ps1 | iex`\n - With Node.js installed, `npx -y amicooked@0` works in place of `amicooked` below.\n3. Run setup with flags, and a long command timeout (at least 5 minutes), because the student signs in through a browser window that opens:\n `amicooked setup --school mcmaster --clients desktop,code`\n Use `--school https://...` for schools without a preset. Add `chatgpt-desktop` to `--clients` if they use the ChatGPT desktop app, then tell them to restart it. ChatGPT and Claude on the web or on phones aren't supported.\n4. Tell the student to sign in to their school in the browser window. Never ask for their password; you never need it.\n5. Setup ends with a \"Next\" list: one line per app saying it's open and ready, needs a restart, needs opening, or needs installing (with a link). Tell the student each line as written. If you're running inside Claude Desktop, they need to quit it; Am I Cooked then reopens it with everything set up.\n6. If something fails, run `amicooked status` and read what it says.\n\n<!-- server-instructions -->\n## Answering questions\n\n- Start broad questions (\"am I cooked?\", \"what should I work on?\", \"how am I doing?\", \"what's due?\") with `am_i_cooked`. It covers every current course in one call.\n- Other tools take a course code directly, like `course: \"3BB4\"`. Only call `get_my_courses` when a code is ambiguous or the student asks what they're enrolled in.\n- Check `get_announcements` for a course before a final verdict on it; deadlines and exam details often change there.\n- To read slides, handouts or assignment PDFs: `get_course_content` to find the file, then `download_file`. Use `read_file` for files already downloaded.\n- If a tool says a login window opened, tell the student to sign in there and ask again.\n\n## Studying\n\nWhen a student wants to study, review or be quizzed on one of their courses, use their own course material, not a generic version of the subject.\n\n1. Find the course from their words: a code like \"3O03\" or a name like \"linear optimization\" both work as `course`.\n2. Check `get_announcements` for what the test covers (chapters, weeks, format, allowed aids). If nothing says, ask which weeks or topics to cover.\n3. Open those weeks with `get_course_content` and read the slides or notes with `download_file`.\n4. Build questions from that material, using the course's own notation and examples, and say which lecture each topic comes from.\n5. If the material can't be loaded, say so, then fall back to general questions and say they're general.\n\n## The verdict\n\nUse `summary.heatLabel` from `am_i_cooked` to set the tone. Be playful, never mean, and always useful.\n\n| heatLabel | Tone |\n|---|---|\n| raw | Relaxed. Nothing urgent; maybe get ahead on something. |\n| warming up | Light nudge. One or two things to handle soon. |\n| toasty | Focused. A real plan for the next few days. |\n| cooked | Direct and supportive. Triage what matters most. |\n| well done | Calm and practical. Damage control, and who to talk to. |\n\n1. Lead with a one-line verdict, e.g. \"Toasty, not cooked.\"\n2. Then the top 3 actions, each with course, item and due time in the student's local time (D2L times are UTC).\n3. Say whether a grade is `final_calculated` or `estimated_from_items`; estimates ignore dropped and bonus items.\n - For an estimate, say how much is left, like \"67.6% so far. 60% of your grade is still to come.\" Use `weightRemaining` for that number.\n - Name the `keyItems` when a grade needs explaining, with their weight: \"the midterm (59.5%, worth 25%) is pulling it down.\"\n - Never work weights out backwards from a result. Use the `weight` values the tools return.\n - `basis: \"points\"` means the gradebook has no weights. Say the estimate is by points and the real weighting may differ. If the student asks how the grade is calculated, find the course outline with `get_course_content` and read the weights from it.\n4. `late_window_open` means a missed assignment can still be submitted: say so first, it's the easiest win.\n5. If `partial_data` appears, mention that some of a course couldn't be loaded.\n6. For grades under 60%, suggest office hours, the TA, or an academic advisor.\n\n<!-- tool:am_i_cooked -->\n## Show it, don't just say it\n\nAnswer \"am I cooked?\" and any overview of grades or deadlines visually, not in paragraphs, and with no emoji. Use the student's local time (D2L times are UTC).\n\n1. Put `summary.heatBar` (like `Heat ██░░░░░░░░ 2/10 · warming up`) on its own line, then one sentence of verdict in the tone for `summary.heatLabel`: raw is relaxed, warming up a light nudge, toasty focused, cooked direct and supportive, well done calm and practical.\n2. A table with one row per course that has a grade or something due: Course | Grade so far | Still to come | Next due | Status. Use each course's `status` as given (On track, Watch, Needs work), mark estimated grades \"(est.)\", and take Still to come from `grade.weightRemaining`. Leave out courses with neither, and say how many.\n3. A \"Next 7 days\" table, soonest first: When | Course | Item | Submitted. Put overdue work first, with when its late window closes if `stillOpenUntil` is set.\n4. If your app can draw charts, add one, like each course's grade so far as a bar. Otherwise skip it; never paste chart code.\n5. End with the top 3 actions as a numbered list, then one line on anything important from announcements.\n\nKeep tables to about six rows. For one course, use the same style in miniature, like a small table of graded items with their weights.\n<!-- /tool:am_i_cooked -->\n\n## Integrity\n\nAm I Cooked only reads. Help the student understand material and plan their time, but don't write graded work for them to submit.\n<!-- /server-instructions -->\n";
@@ -5,7 +5,7 @@ import { marshalContentModule, marshalToc, marshalTopic, } from "../utils/marsha
5
5
  import { json } from "./types.js";
6
6
  export const getCourseContent = {
7
7
  name: "get_course_content",
8
- description: "A course's content: modules, lectures, readings and files with their IDs. With no IDs you get the whole outline; pass moduleId to open one section, or topicId for one item's details and URL (then use download_file to read it).",
8
+ description: "A course's content: modules, lectures, readings and files with their IDs. With no IDs you get the whole outline; pass moduleId to open one section, or topicId for one item's details and URL (then use download_file to read it). Also the place to start when a student wants to study or be quizzed on a course: find the lectures the test covers here.",
9
9
  schema: {
10
10
  ...courseParams,
11
11
  moduleId: z.coerce.number().optional().describe("Open one module/section from the outline"),
@@ -1,3 +1,4 @@
1
+ import { toolGuide } from "../instructions.js";
1
2
  import { z } from "zod";
2
3
  import { getToken } from "../auth.js";
3
4
  import { client, D2LApiError } from "../client.js";
@@ -230,6 +231,19 @@ async function fetchCourseData(course, w) {
230
231
  ]);
231
232
  return { finalGrade, gradeItems, folders, events, news, errors };
232
233
  }
234
+ /** Ten blocks filled to the score, e.g. "Heat ██░░░░░░░░ 2/10 · warming up". */
235
+ export function heatBar(heat, label) {
236
+ const filled = Math.max(0, Math.min(10, Math.round(heat)));
237
+ return `Heat ${"█".repeat(filled)}${"░".repeat(10 - filled)} ${filled}/10 · ${label}`;
238
+ }
239
+ /** One word for a course's table row, from the same signals the heat score uses. */
240
+ export function courseStatus(signals) {
241
+ if (signals.includes("overdue_work") || signals.includes("grade_below_60"))
242
+ return "Needs work";
243
+ if (signals.includes("grade_below_70") || signals.includes("heavy_week"))
244
+ return "Watch";
245
+ return "On track";
246
+ }
233
247
  export async function amICooked(args) {
234
248
  // Log in once up front so a fan-out over every course doesn't race to open login windows
235
249
  await getToken();
@@ -257,6 +271,7 @@ export async function amICooked(args) {
257
271
  summary: {
258
272
  heat,
259
273
  heatLabel,
274
+ heatBar: heatBar(heat, heatLabel),
260
275
  reasons,
261
276
  courses: courses.length,
262
277
  dueSoon: courses.reduce((n, c) => n + c.dueSoon.length, 0),
@@ -264,8 +279,9 @@ export async function amICooked(args) {
264
279
  newAnnouncements: courses.reduce((n, c) => n + c.announcements.count, 0),
265
280
  lowestGrade: lowest ? { course: lowest.code, percent: lowest.grade.percent, source: lowest.grade.source } : null,
266
281
  },
267
- courses: courses.sort((a, b) => a.code.localeCompare(b.code)),
282
+ courses: courses.sort((a, b) => a.code.localeCompare(b.code)).map((c) => ({ ...c, status: courseStatus(c.signals) })),
268
283
  skippedCourses: skipped,
284
+ howToPresent: toolGuide("am_i_cooked"),
269
285
  notes: [
270
286
  "Times are UTC; convert to the student's local time.",
271
287
  "estimated_from_items grades ignore dropped or bonus items, so treat them as rough.",
@@ -276,7 +292,7 @@ export async function amICooked(args) {
276
292
  }
277
293
  export const amICookedTool = {
278
294
  name: "am_i_cooked",
279
- description: 'One-call overview across all current courses: grade so far, what is due soon, overdue unsubmitted work, and new announcements, plus a heat score (0-10: raw, warming up, toasty, cooked, well done). Start here for "am I cooked?", "what should I work on?", "how am I doing?" or "what\'s due this week?".',
295
+ description: 'One-call overview across all current courses: grade so far, what is due soon, overdue unsubmitted work, and new announcements, plus a heat score (0-10: raw, warming up, toasty, cooked, well done). Start here for "am I cooked?", "what should I work on?", "how am I doing?" or "what\'s due this week?". The result includes howToPresent: follow it (heat bar, a table per course, the next 7 days, top 3 actions).',
280
296
  schema: {
281
297
  daysAhead: z.coerce.number().min(1).max(60).optional().describe("How far ahead to look for due dates (default 7)"),
282
298
  overdueDaysBack: z.coerce.number().min(0).max(60).optional().describe("How far back to look for missed work (default 14)"),
@@ -10,7 +10,7 @@ export const getMyCourses = {
10
10
  };
11
11
  export const getMyGrades = {
12
12
  name: "get_my_grades",
13
- description: 'Your grade items for one course: item name, points earned and possible, percentage, weight toward the final grade (when the gradebook has weights) and instructor feedback. Use for "what did I get on the midterm?" or "what\'s my grade in 3BB4?". For an overview across all courses, use am_i_cooked.',
13
+ description: 'Your grade items for one course: item name, points earned and possible, percentage, weight toward the final grade (when the gradebook has weights) and instructor feedback. Use for "what did I get on the midterm?" or "what\'s my grade in 3BB4?". For an overview across all courses, use am_i_cooked. Show them as a small table with each item\'s weight, and explain a grade from those weights; never work weights out backwards.',
14
14
  schema: { ...courseParams },
15
15
  handler: async (args) => {
16
16
  const grades = (await client.getMyGradeValues(await resolveCourse(args)));
@@ -19,7 +19,7 @@ export const getMyGrades = {
19
19
  };
20
20
  export const getAnnouncements = {
21
21
  name: "get_announcements",
22
- description: "Announcements (news) your instructors posted in one course: title, body, date, attachments. Check these before giving a verdict, since deadlines and exam details often change here.",
22
+ description: "Announcements (news) your instructors posted in one course: title, body, date, attachments. Check these before giving a verdict, since deadlines and exam details often change here. When a student wants to study, check here first for what the test covers.",
23
23
  schema: { ...courseParams },
24
24
  handler: async (args) => {
25
25
  const news = (await client.getNews(await resolveCourse(args)));
@@ -121,7 +121,7 @@ function findLibraryFile(query) {
121
121
  }
122
122
  export const downloadFileTool = {
123
123
  name: "download_file",
124
- description: "Download a course file (slides, handouts, assignment PDFs) and return its text. Pass the file URL from get_course_content (e.g. /content/enforced/12345-COURSE/week7.pdf). Files are saved once into the student's course folder and served from disk afterwards. Set refresh=true only if the student says the file changed.",
124
+ description: "Download a course file (slides, handouts, assignment PDFs) and return its text. Pass the file URL from get_course_content (e.g. /content/enforced/12345-COURSE/week7.pdf). Saved once, then served from disk. Set refresh=true only if the student says the file changed. Use it to read lecture slides before quizzing a student or summarising what a test covers. Help the student understand the material; don't write graded work for them to submit.",
125
125
  schema: {
126
126
  url: z.string().describe("File URL or path from get_course_content"),
127
127
  refresh: z.boolean().optional().describe("Re-check D2L for a newer version"),
package/dist/version.js CHANGED
@@ -1,2 +1,2 @@
1
1
  // Must match package.json; a unit test checks this
2
- export const VERSION = "0.1.5";
2
+ export const VERSION = "0.1.7";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "amicooked",
3
- "version": "0.1.5",
3
+ "version": "0.1.7",
4
4
  "description": "Ask your AI if you're cooked. A local MCP server for D2L Brightspace: grades, deadlines and announcements in Claude and ChatGPT.",
5
5
  "type": "module",
6
6
  "bin": {
package/skill/SKILL.md CHANGED
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: amicooked
3
- description: Use when a student asks about their D2L Brightspace courses, grades, deadlines, assignments, announcements or course files, asks "am I cooked?", or wants to set up Am I Cooked.
3
+ description: Use when a student asks about their D2L Brightspace courses, grades, deadlines, assignments, announcements or course files, asks "am I cooked?", or wants to set up Am I Cooked. Also use when they want to study for one of their courses, like preparing for a test, midterm or exam, "quiz me", or reviewing or summarising lectures, so the questions come from their own course material.
4
4
  ---
5
5
 
6
6
  # Am I Cooked
@@ -37,6 +37,16 @@ If you can run commands:
37
37
  - To read slides, handouts or assignment PDFs: `get_course_content` to find the file, then `download_file`. Use `read_file` for files already downloaded.
38
38
  - If a tool says a login window opened, tell the student to sign in there and ask again.
39
39
 
40
+ ## Studying
41
+
42
+ When a student wants to study, review or be quizzed on one of their courses, use their own course material, not a generic version of the subject.
43
+
44
+ 1. Find the course from their words: a code like "3O03" or a name like "linear optimization" both work as `course`.
45
+ 2. Check `get_announcements` for what the test covers (chapters, weeks, format, allowed aids). If nothing says, ask which weeks or topics to cover.
46
+ 3. Open those weeks with `get_course_content` and read the slides or notes with `download_file`.
47
+ 4. Build questions from that material, using the course's own notation and examples, and say which lecture each topic comes from.
48
+ 5. If the material can't be loaded, say so, then fall back to general questions and say they're general.
49
+
40
50
  ## The verdict
41
51
 
42
52
  Use `summary.heatLabel` from `am_i_cooked` to set the tone. Be playful, never mean, and always useful.
@@ -60,6 +70,20 @@ Use `summary.heatLabel` from `am_i_cooked` to set the tone. Be playful, never me
60
70
  5. If `partial_data` appears, mention that some of a course couldn't be loaded.
61
71
  6. For grades under 60%, suggest office hours, the TA, or an academic advisor.
62
72
 
73
+ <!-- tool:am_i_cooked -->
74
+ ## Show it, don't just say it
75
+
76
+ Answer "am I cooked?" and any overview of grades or deadlines visually, not in paragraphs, and with no emoji. Use the student's local time (D2L times are UTC).
77
+
78
+ 1. Put `summary.heatBar` (like `Heat ██░░░░░░░░ 2/10 · warming up`) on its own line, then one sentence of verdict in the tone for `summary.heatLabel`: raw is relaxed, warming up a light nudge, toasty focused, cooked direct and supportive, well done calm and practical.
79
+ 2. A table with one row per course that has a grade or something due: Course | Grade so far | Still to come | Next due | Status. Use each course's `status` as given (On track, Watch, Needs work), mark estimated grades "(est.)", and take Still to come from `grade.weightRemaining`. Leave out courses with neither, and say how many.
80
+ 3. A "Next 7 days" table, soonest first: When | Course | Item | Submitted. Put overdue work first, with when its late window closes if `stillOpenUntil` is set.
81
+ 4. If your app can draw charts, add one, like each course's grade so far as a bar. Otherwise skip it; never paste chart code.
82
+ 5. End with the top 3 actions as a numbered list, then one line on anything important from announcements.
83
+
84
+ Keep tables to about six rows. For one course, use the same style in miniature, like a small table of graded items with their weights.
85
+ <!-- /tool:am_i_cooked -->
86
+
63
87
  ## Integrity
64
88
 
65
89
  Am I Cooked only reads. Help the student understand material and plan their time, but don't write graded work for them to submit.