amicooked 0.1.4 → 0.1.6
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/README.md +3 -0
- package/dist/cli/setup.js +19 -15
- package/dist/skill.js +1 -1
- package/dist/telemetry.js +39 -0
- package/dist/tools/content.js +1 -1
- package/dist/tools/files.js +1 -1
- package/dist/version.js +1 -1
- package/package.json +3 -2
- package/skill/SKILL.md +29 -1
package/README.md
CHANGED
|
@@ -68,6 +68,8 @@ amicooked uninstall disconnect apps (--purge deletes your login and settings)
|
|
|
68
68
|
|
|
69
69
|
Your settings and login live in `~/.amicooked`; downloaded files go to `~/Downloads/amicooked`.
|
|
70
70
|
|
|
71
|
+
The first time setup finishes on a computer, it sends one anonymous count: your school's preset name (or "custom") and your OS. Nothing from Brightspace, no IP or ID is stored. Set `AMICOOKED_NO_TELEMETRY=1` or `DO_NOT_TRACK=1` to turn it off.
|
|
72
|
+
|
|
71
73
|
## Development
|
|
72
74
|
|
|
73
75
|
```sh
|
|
@@ -76,6 +78,7 @@ npm test
|
|
|
76
78
|
npm run build # TypeScript to dist/
|
|
77
79
|
npm run build:bin # standalone binaries in build/ (uses Bun)
|
|
78
80
|
node dist/cli.js setup
|
|
81
|
+
npm run stats # installs, npm downloads, setups, repo traffic
|
|
79
82
|
```
|
|
80
83
|
|
|
81
84
|
`skill/SKILL.md` is the single source for the agent skill; `npm run sync:skill` copies it (and `install/`) into `src/skill.ts` and `site/`.
|
package/dist/cli/setup.js
CHANGED
|
@@ -16,6 +16,7 @@ import { getConfig, writeConfig } from "../config.js";
|
|
|
16
16
|
import { listCourses } from "../courseResolver.js";
|
|
17
17
|
import { detectSchool, findPreset, PRESETS } from "../schools.js";
|
|
18
18
|
import { amICooked } from "../tools/cooked.js";
|
|
19
|
+
import { reportSetup } from "../telemetry.js";
|
|
19
20
|
const PUBLIC_IDS = ["desktop", "code", "chatgpt-desktop"];
|
|
20
21
|
const CLIENT_IDS = [...PUBLIC_IDS, "chatgpt"];
|
|
21
22
|
const ALIASES = { codex: "chatgpt-desktop", "chatgpt-app": "chatgpt-desktop", "chatgpt-web": "chatgpt" };
|
|
@@ -104,7 +105,7 @@ async function missingApp(app, name, url) {
|
|
|
104
105
|
if (ok === true)
|
|
105
106
|
openUrl(url);
|
|
106
107
|
}
|
|
107
|
-
return { app, next: `install ${name} from ${url}, then run \`amicooked setup\` again.`, ready: false };
|
|
108
|
+
return { app, next: `install ${name} from ${url}, then run \`amicooked setup\` again.`, ready: false, connected: false };
|
|
108
109
|
}
|
|
109
110
|
/**
|
|
110
111
|
* Connects a desktop app and leaves it open with the new config loaded, or says exactly what's left.
|
|
@@ -115,10 +116,10 @@ async function connectDesktopApp(app, label, write, current) {
|
|
|
115
116
|
if (current()) {
|
|
116
117
|
// Already set up. Make sure it's open; no restart needed
|
|
117
118
|
if (isRunning(app))
|
|
118
|
-
return { app: label, next: `already set up. ${ask}`, ready: true };
|
|
119
|
+
return { app: label, next: `already set up. ${ask}`, ready: true, connected: true };
|
|
119
120
|
return open(app)
|
|
120
|
-
? { app: label, next: `already set up, and opening now. ${ask}`, ready: true }
|
|
121
|
-
: { app: label, next: `already set up. Open ${app.name} and ask: am I cooked?`, ready: false };
|
|
121
|
+
? { app: label, next: `already set up, and opening now. ${ask}`, ready: true, connected: true }
|
|
122
|
+
: { app: label, next: `already set up. Open ${app.name} and ask: am I cooked?`, ready: false, connected: true };
|
|
122
123
|
}
|
|
123
124
|
let running = isRunning(app);
|
|
124
125
|
const inside = running && isRunningInside(app);
|
|
@@ -134,14 +135,14 @@ async function connectDesktopApp(app, label, write, current) {
|
|
|
134
135
|
// Quitting it would save its old config over ours, so a background helper waits for the quit, writes
|
|
135
136
|
// the config again and reopens the app
|
|
136
137
|
return scheduleAfterQuit()
|
|
137
|
-
? { app: label, next: `quit ${app.name} ${quitHow()}. Am I Cooked finishes setting it up and reopens it. Then ask it: am I cooked?`, ready: false }
|
|
138
|
-
: { app: label, next: `quit ${app.name} ${quitHow()}, then run \`amicooked setup\` again.`, ready: false };
|
|
138
|
+
? { app: label, next: `quit ${app.name} ${quitHow()}. Am I Cooked finishes setting it up and reopens it. Then ask it: am I cooked?`, ready: false, connected: true }
|
|
139
|
+
: { app: label, next: `quit ${app.name} ${quitHow()}, then run \`amicooked setup\` again.`, ready: false, connected: false };
|
|
139
140
|
}
|
|
140
141
|
if (running)
|
|
141
|
-
return { app: label, next: `quit ${app.name} ${quitHow()} and open it again. Then ask it: am I cooked?`, ready: false };
|
|
142
|
+
return { app: label, next: `quit ${app.name} ${quitHow()} and open it again. Then ask it: am I cooked?`, ready: false, connected: true };
|
|
142
143
|
return open(app)
|
|
143
|
-
? { app: label, next: `set up, and opening now. ${ask}`, ready: true }
|
|
144
|
-
: { app: label, next: `set up. Open ${app.name} and ask: am I cooked?`, ready: false };
|
|
144
|
+
? { app: label, next: `set up, and opening now. ${ask}`, ready: true, connected: true }
|
|
145
|
+
: { app: label, next: `set up. Open ${app.name} and ask: am I cooked?`, ready: false, connected: true };
|
|
145
146
|
}
|
|
146
147
|
async function configureClients(clients) {
|
|
147
148
|
const outcomes = [];
|
|
@@ -149,7 +150,7 @@ async function configureClients(clients) {
|
|
|
149
150
|
if (clients.includes("desktop")) {
|
|
150
151
|
const dir = claudeDesktopDir();
|
|
151
152
|
if (!desktopAppsSupported()) {
|
|
152
|
-
outcomes.push({ app: "Claude Desktop", next: `isn't available on Linux. Use Claude Code instead: ${CLAUDE_CODE_DOWNLOAD}`, ready: false });
|
|
153
|
+
outcomes.push({ app: "Claude Desktop", next: `isn't available on Linux. Use Claude Code instead: ${CLAUDE_CODE_DOWNLOAD}`, ready: false, connected: false });
|
|
153
154
|
}
|
|
154
155
|
else if (!dir) {
|
|
155
156
|
outcomes.push(await missingApp("Claude Desktop", "Claude Desktop", APPS.claude.download));
|
|
@@ -162,7 +163,7 @@ async function configureClients(clients) {
|
|
|
162
163
|
if (!(error instanceof InvalidConfigError))
|
|
163
164
|
throw error;
|
|
164
165
|
p.log.warn(`${error.message}\nAdd this to it yourself:\n${manualSnippet(launch)}`);
|
|
165
|
-
outcomes.push({ app: "Claude Desktop", next: "add the snippet above to its config, then restart it.", ready: false });
|
|
166
|
+
outcomes.push({ app: "Claude Desktop", next: "add the snippet above to its config, then restart it.", ready: false, connected: false });
|
|
166
167
|
}
|
|
167
168
|
}
|
|
168
169
|
}
|
|
@@ -174,12 +175,12 @@ async function configureClients(clients) {
|
|
|
174
175
|
installClaudeCode(launch);
|
|
175
176
|
installSkill();
|
|
176
177
|
// Claude Code loads servers when a session starts, so an agent already running needs a new one
|
|
177
|
-
outcomes.push({ app: "Claude Code", next: "set up. Start a new Claude Code session and ask: am I cooked?", ready: true });
|
|
178
|
+
outcomes.push({ app: "Claude Code", next: "set up. Start a new Claude Code session and ask: am I cooked?", ready: true, connected: true });
|
|
178
179
|
}
|
|
179
180
|
}
|
|
180
181
|
if (clients.includes("chatgpt-desktop")) {
|
|
181
182
|
if (!hasCodex() && !desktopAppsSupported()) {
|
|
182
|
-
outcomes.push({ app: "ChatGPT app", next: `isn't available on Linux. Use Claude Code instead: ${CLAUDE_CODE_DOWNLOAD}`, ready: false });
|
|
183
|
+
outcomes.push({ app: "ChatGPT app", next: `isn't available on Linux. Use Claude Code instead: ${CLAUDE_CODE_DOWNLOAD}`, ready: false, connected: false });
|
|
183
184
|
}
|
|
184
185
|
else if (!hasCodex()) {
|
|
185
186
|
outcomes.push(await missingApp("ChatGPT app", "the ChatGPT app", APPS.chatgpt.download));
|
|
@@ -193,7 +194,7 @@ async function configureClients(clients) {
|
|
|
193
194
|
}
|
|
194
195
|
}
|
|
195
196
|
if (clients.includes("chatgpt") && !process.env.AMICOOKED_TUNNEL_API) {
|
|
196
|
-
outcomes.push({ app: "ChatGPT on the web", next: "isn't available yet. Use the ChatGPT app instead: `--clients chatgpt-desktop`.", ready: false });
|
|
197
|
+
outcomes.push({ app: "ChatGPT on the web", next: "isn't available yet. Use the ChatGPT app instead: `--clients chatgpt-desktop`.", ready: false, connected: false });
|
|
197
198
|
}
|
|
198
199
|
else if (clients.includes("chatgpt")) {
|
|
199
200
|
const spin = p.spinner();
|
|
@@ -202,7 +203,7 @@ async function configureClients(clients) {
|
|
|
202
203
|
const { url, pairingCode } = await installChatGPT();
|
|
203
204
|
spin.stop("ChatGPT: running in the background");
|
|
204
205
|
p.note(chatgptSteps(url, pairingCode), "Connect ChatGPT");
|
|
205
|
-
outcomes.push({ app: "ChatGPT on the web", next: "finish connecting with the steps above, then ask: am I cooked?", ready: false });
|
|
206
|
+
outcomes.push({ app: "ChatGPT on the web", next: "finish connecting with the steps above, then ask: am I cooked?", ready: false, connected: true });
|
|
206
207
|
}
|
|
207
208
|
catch (error) {
|
|
208
209
|
spin.stop(`ChatGPT: ${error instanceof Error ? error.message : error}`);
|
|
@@ -270,12 +271,15 @@ export async function setup(options) {
|
|
|
270
271
|
}
|
|
271
272
|
const detected = { desktop: Boolean(claudeDesktopDir()), code: hasClaudeCode(), "chatgpt-desktop": hasCodex(), chatgpt: false };
|
|
272
273
|
const outcomes = await configureClients(await chooseClients(options.clients, detected, Boolean(options.yes)));
|
|
274
|
+
// Count the setup only if an app was connected. Started now so it runs alongside the first report
|
|
275
|
+
const reported = outcomes.some((o) => o.connected) ? reportSetup(school.id) : undefined;
|
|
273
276
|
if (options.login !== false)
|
|
274
277
|
await firstRoast();
|
|
275
278
|
const { steps, outro } = finishMessage(outcomes);
|
|
276
279
|
if (steps)
|
|
277
280
|
p.note(steps, "Next");
|
|
278
281
|
p.outro(outro);
|
|
282
|
+
await reported;
|
|
279
283
|
return 0;
|
|
280
284
|
}
|
|
281
285
|
catch (error) {
|
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## Show it, don't just say it\n\nAnswer \"am I cooked?\" (and any overview of grades or deadlines) visually, not as paragraphs. Use the student's local time throughout.\n\n1. **Verdict line with a heat bar**, ten blocks filled to the score: `Heat ██░░░░░░░░ 2/10 · warming up`. Then one sentence of verdict.\n2. **One table, one row per course:**\n\n | Course | Grade so far | Still to come | Next due | Status |\n |---|---|---|---|---|\n | 3DB3 Databases | 74.9% (est.) | 58% | A3 group signup, Fri 11:59 pm | Watch |\n\n Status is On track, Watch, or Needs work, from the course's `signals` (overdue work or a grade under 60% is Needs work; under 70%, or several things due soon, is Watch). Leave out courses with no grades and nothing due, and say how many you left out.\n3. **A \"Next 7 days\" list or table**, soonest first: when, course, item, and whether it's submitted. Put overdue items with an open late window at the top.\n4. **A chart, when your app can draw one** (artifacts, canvas, a chart or visualization tool): for example each course's grade so far as a bar with the still-to-come share shaded, or the week's deadlines on a timeline. Skip it if your app can't render charts; never paste chart code for the student to run.\n5. **Then the top 3 actions** as a short numbered list, and one line on anything worth knowing from announcements.\n\nKeep it scannable: short cells, no more than about six rows per table, and no emoji. Use the same style, in miniature, for single-course questions, like a small table of that course's graded items with their weights.\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";
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import * as fs from "fs";
|
|
2
|
+
import * as path from "path";
|
|
3
|
+
import { homeDir } from "./config.js";
|
|
4
|
+
import { findPreset } from "./schools.js";
|
|
5
|
+
/** Counts finished setups; see site/api/e.js. */
|
|
6
|
+
export const REPORT_URL = "https://amicooked-mcp.vercel.app/api/e";
|
|
7
|
+
export function telemetryOff(env = process.env) {
|
|
8
|
+
const on = (v) => Boolean(v) && v !== "0" && v !== "false";
|
|
9
|
+
return on(env.AMICOOKED_NO_TELEMETRY) || on(env.DO_NOT_TRACK);
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Sends one anonymous "setup finished" count, the first time setup finishes on this computer. It carries the
|
|
13
|
+
* school preset id (or "custom", never the URL) and the platform. A marker file in ~/.amicooked stops repeat
|
|
14
|
+
* setups being counted again, so nothing identifying is sent. Never throws and gives up after 1.5 s.
|
|
15
|
+
*/
|
|
16
|
+
export async function reportSetup(schoolId, options = {}) {
|
|
17
|
+
const { env = process.env, fetchImpl = fetch, platform = `${process.platform}-${process.arch}` } = options;
|
|
18
|
+
if (telemetryOff(env))
|
|
19
|
+
return false;
|
|
20
|
+
const marker = path.join(homeDir(), "setup-reported");
|
|
21
|
+
if (fs.existsSync(marker))
|
|
22
|
+
return false;
|
|
23
|
+
try {
|
|
24
|
+
const res = await fetchImpl(REPORT_URL, {
|
|
25
|
+
method: "POST",
|
|
26
|
+
headers: { "content-type": "application/json" },
|
|
27
|
+
body: JSON.stringify({ e: "setup", school: findPreset(schoolId)?.id ?? "custom", platform }),
|
|
28
|
+
signal: AbortSignal.timeout(1500),
|
|
29
|
+
});
|
|
30
|
+
if (!res.ok)
|
|
31
|
+
return false;
|
|
32
|
+
fs.mkdirSync(path.dirname(marker), { recursive: true });
|
|
33
|
+
fs.writeFileSync(marker, "");
|
|
34
|
+
return true;
|
|
35
|
+
}
|
|
36
|
+
catch {
|
|
37
|
+
return false;
|
|
38
|
+
}
|
|
39
|
+
}
|
package/dist/tools/content.js
CHANGED
|
@@ -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"),
|
package/dist/tools/files.js
CHANGED
|
@@ -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). 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. Use it to read lecture slides before quizzing a student or summarising what a test covers.",
|
|
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.
|
|
2
|
+
export const VERSION = "0.1.6";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "amicooked",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.6",
|
|
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": {
|
|
@@ -21,7 +21,8 @@
|
|
|
21
21
|
"prepack": "npm run build",
|
|
22
22
|
"build:bin": "node scripts/sync-skill.mjs && node scripts/build-binaries.mjs",
|
|
23
23
|
"preversion": "npm test",
|
|
24
|
-
"version": "node scripts/sync-version.mjs && git add src/version.ts"
|
|
24
|
+
"version": "node scripts/sync-version.mjs && git add src/version.ts",
|
|
25
|
+
"stats": "node --env-file-if-exists=.env.local scripts/stats.mjs"
|
|
25
26
|
},
|
|
26
27
|
"keywords": [
|
|
27
28
|
"mcp",
|
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,24 @@ 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
|
+
## Show it, don't just say it
|
|
74
|
+
|
|
75
|
+
Answer "am I cooked?" (and any overview of grades or deadlines) visually, not as paragraphs. Use the student's local time throughout.
|
|
76
|
+
|
|
77
|
+
1. **Verdict line with a heat bar**, ten blocks filled to the score: `Heat ██░░░░░░░░ 2/10 · warming up`. Then one sentence of verdict.
|
|
78
|
+
2. **One table, one row per course:**
|
|
79
|
+
|
|
80
|
+
| Course | Grade so far | Still to come | Next due | Status |
|
|
81
|
+
|---|---|---|---|---|
|
|
82
|
+
| 3DB3 Databases | 74.9% (est.) | 58% | A3 group signup, Fri 11:59 pm | Watch |
|
|
83
|
+
|
|
84
|
+
Status is On track, Watch, or Needs work, from the course's `signals` (overdue work or a grade under 60% is Needs work; under 70%, or several things due soon, is Watch). Leave out courses with no grades and nothing due, and say how many you left out.
|
|
85
|
+
3. **A "Next 7 days" list or table**, soonest first: when, course, item, and whether it's submitted. Put overdue items with an open late window at the top.
|
|
86
|
+
4. **A chart, when your app can draw one** (artifacts, canvas, a chart or visualization tool): for example each course's grade so far as a bar with the still-to-come share shaded, or the week's deadlines on a timeline. Skip it if your app can't render charts; never paste chart code for the student to run.
|
|
87
|
+
5. **Then the top 3 actions** as a short numbered list, and one line on anything worth knowing from announcements.
|
|
88
|
+
|
|
89
|
+
Keep it scannable: short cells, no more than about six rows per table, and no emoji. Use the same style, in miniature, for single-course questions, like a small table of that course's graded items with their weights.
|
|
90
|
+
|
|
63
91
|
## Integrity
|
|
64
92
|
|
|
65
93
|
Am I Cooked only reads. Help the student understand material and plan their time, but don't write graded work for them to submit.
|