@codemieai/code 0.0.47 → 0.0.49

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.
@@ -5,5 +5,5 @@
5
5
  "name": "AI/Run CodeMie",
6
6
  "email": "support@codemieai.com"
7
7
  },
8
- "version": "1.0.13"
8
+ "version": "1.0.15"
9
9
  }
@@ -6,30 +6,24 @@ Work with your Microsoft 365 account from Claude Code — emails, calendar, Shar
6
6
 
7
7
  ## Quick Start
8
8
 
9
- ### 1. Install dependencies
9
+ ### 1. Log in (first time only)
10
10
 
11
11
  ```bash
12
- pip install msal requests
13
- ```
14
-
15
- ### 2. Log in (first time only)
16
-
17
- ```bash
18
- python .codemie/claude-plugin/skills/msgraph/msgraph.py login
12
+ node ~/.codemie/claude-plugin/skills/msgraph/scripts/msgraph.js login
19
13
  ```
20
14
 
21
15
  You'll see a message like:
22
16
  ```
23
- ==============================
17
+ ============================================================
24
18
  To sign in, use a web browser to open the page https://microsoft.com/devicelogin
25
19
  and enter the code ABCD-1234 to authenticate.
26
- ==============================
20
+ ============================================================
27
21
  ```
28
22
 
29
23
  Open the URL in your browser, enter the code, and sign in with your Microsoft account.
30
24
  Your token is cached at `~/.ms_graph_token_cache.json` — you won't need to log in again until it expires (tokens refresh automatically).
31
25
 
32
- ### 3. Ask Claude anything
26
+ ### 2. Ask Claude anything
33
27
 
34
28
  After logging in, just ask Claude naturally:
35
29
 
@@ -43,10 +37,17 @@ Claude will use this skill automatically.
43
37
 
44
38
  ---
45
39
 
40
+ ## No dependencies required
41
+
42
+ The CLI uses **only built-in Node.js modules** — no `pip install`, no `npm install`.
43
+ Node.js >= 18 is the only requirement, which CodeMie already provides.
44
+
45
+ ---
46
+
46
47
  ## CLI Reference
47
48
 
48
49
  ```
49
- python .codemie/claude-plugin/skills/msgraph/msgraph.py <command> [options]
50
+ node .codemie/claude-plugin/skills/msgraph/scripts/msgraph.js <command> [options]
50
51
  ```
51
52
 
52
53
  ### Auth commands
@@ -78,54 +79,54 @@ Add `--json` to any command for machine-readable JSON output.
78
79
 
79
80
  ```bash
80
81
  # List 20 most recent emails
81
- python .codemie/claude-plugin/skills/msgraph/msgraph.py emails --limit 20
82
+ node .codemie/claude-plugin/skills/msgraph/scripts/msgraph.js emails --limit 20
82
83
 
83
84
  # Read a specific email (paste the ID from list output)
84
- python .codemie/claude-plugin/skills/msgraph/msgraph.py emails --read AAMkAGI2...
85
+ node .codemie/claude-plugin/skills/msgraph/scripts/msgraph.js emails --read AAMkAGI2...
85
86
 
86
87
  # Send an email
87
- python .codemie/claude-plugin/skills/msgraph/msgraph.py emails \
88
+ node .codemie/claude-plugin/skills/msgraph/scripts/msgraph.js emails \
88
89
  --send colleague@company.com \
89
90
  --subject "Quick question" \
90
91
  --body "Are you free tomorrow at 2pm?"
91
92
 
92
93
  # Upcoming calendar events
93
- python .codemie/claude-plugin/skills/msgraph/msgraph.py calendar --limit 5
94
+ node .codemie/claude-plugin/skills/msgraph/scripts/msgraph.js calendar --limit 5
94
95
 
95
96
  # Create a meeting
96
- python .codemie/claude-plugin/skills/msgraph/msgraph.py calendar \
97
+ node .codemie/claude-plugin/skills/msgraph/scripts/msgraph.js calendar \
97
98
  --create "Design Review" \
98
99
  --start "2024-03-20T14:00" \
99
100
  --end "2024-03-20T15:00" \
100
101
  --timezone "Europe/Berlin"
101
102
 
102
103
  # List SharePoint sites you follow
103
- python .codemie/claude-plugin/skills/msgraph/msgraph.py sharepoint --sites
104
+ node .codemie/claude-plugin/skills/msgraph/scripts/msgraph.js sharepoint --sites
104
105
 
105
106
  # Browse a site's documents
106
- python .codemie/claude-plugin/skills/msgraph/msgraph.py sharepoint \
107
+ node .codemie/claude-plugin/skills/msgraph/scripts/msgraph.js sharepoint \
107
108
  --site "contoso.sharepoint.com,abc123,def456" \
108
109
  --path "Documents/2024"
109
110
 
110
111
  # Download a OneDrive file
111
- python .codemie/claude-plugin/skills/msgraph/msgraph.py onedrive --download ITEM_ID --output report.xlsx
112
+ node .codemie/claude-plugin/skills/msgraph/scripts/msgraph.js onedrive --download ITEM_ID --output report.xlsx
112
113
 
113
114
  # Upload to OneDrive
114
- python .codemie/claude-plugin/skills/msgraph/msgraph.py onedrive \
115
+ node .codemie/claude-plugin/skills/msgraph/scripts/msgraph.js onedrive \
115
116
  --upload ./presentation.pptx \
116
117
  --dest "Documents/presentations/deck.pptx"
117
118
 
118
119
  # Recent Teams chats
119
- python .codemie/claude-plugin/skills/msgraph/msgraph.py teams --chats
120
+ node .codemie/claude-plugin/skills/msgraph/scripts/msgraph.js teams --chats
120
121
 
121
122
  # Read a chat conversation
122
- python .codemie/claude-plugin/skills/msgraph/msgraph.py teams --messages 19:abc123@thread.v2
123
+ node .codemie/claude-plugin/skills/msgraph/scripts/msgraph.js teams --messages 19:abc123@thread.v2
123
124
 
124
125
  # Search your contacts
125
- python .codemie/claude-plugin/skills/msgraph/msgraph.py people --search "John"
126
+ node .codemie/claude-plugin/skills/msgraph/scripts/msgraph.js people --search "John"
126
127
 
127
128
  # Your manager
128
- python .codemie/claude-plugin/skills/msgraph/msgraph.py org --manager
129
+ node .codemie/claude-plugin/skills/msgraph/scripts/msgraph.js org --manager
129
130
  ```
130
131
 
131
132
  ---
@@ -133,9 +134,9 @@ python .codemie/claude-plugin/skills/msgraph/msgraph.py org --manager
133
134
  ## Token Cache
134
135
 
135
136
  Credentials are stored in `~/.ms_graph_token_cache.json`.
136
- - Access tokens refresh automatically (they last ~1 hour, but MSAL handles renewal)
137
- - Refresh tokens last longer (~90 days by default in Azure)
138
- - Run `logout` to remove the cache: `python msgraph.py logout`
137
+ - Access tokens refresh automatically (they last ~1 hour, silently renewed via refresh token)
138
+ - Refresh tokens last ~90 days by default in Azure
139
+ - Run `logout` to remove the cache: `node msgraph.js logout`
139
140
 
140
141
  ---
141
142
 
@@ -154,6 +155,7 @@ The script requests these Microsoft Graph scopes on first login:
154
155
  | `Chat.Read` / `Chat.ReadWrite` | Teams chats |
155
156
  | `People.Read` | People rankings |
156
157
  | `Contacts.Read` | Outlook contacts |
158
+ | `offline_access` | Silent token refresh |
157
159
 
158
160
  If your organization restricts some permissions, certain commands may return `Permission denied`.
159
161
 
@@ -161,14 +163,14 @@ If your organization restricts some permissions, certain commands may return `Pe
161
163
 
162
164
  ## Troubleshooting
163
165
 
164
- **`ModuleNotFoundError: No module named 'msal'`**
166
+ **`NOT_LOGGED_IN`**
165
167
  ```bash
166
- pip install msal requests
168
+ node .codemie/claude-plugin/skills/msgraph/scripts/msgraph.js login
167
169
  ```
168
170
 
169
- **`NOT_LOGGED_IN`**
171
+ **`TOKEN_EXPIRED`**
170
172
  ```bash
171
- python .codemie/claude-plugin/skills/msgraph/msgraph.py login
173
+ node .codemie/claude-plugin/skills/msgraph/scripts/msgraph.js login
172
174
  ```
173
175
 
174
176
  **`Permission denied (403)`**
@@ -176,8 +178,5 @@ Your organization may have restricted that Graph API permission. Contact your IT
176
178
 
177
179
  **`Authentication expired (401)`**
178
180
  ```bash
179
- python .codemie/claude-plugin/skills/msgraph/msgraph.py login
181
+ node .codemie/claude-plugin/skills/msgraph/scripts/msgraph.js login
180
182
  ```
181
-
182
- **Token cache is at wrong path**
183
- Edit `CACHE_FILE` at the top of `msgraph.py` to change the location.
@@ -2,25 +2,27 @@
2
2
  name: msgraph
3
3
  description: >
4
4
  Work with Microsoft 365 services via the Graph API — emails, calendar events, SharePoint sites,
5
- Teams chats, OneDrive files, contacts, and org chart. Use this skill whenever the user asks
6
- about their emails, inbox, unread messages, meetings, calendar, Teams messages or chats,
7
- SharePoint documents, OneDrive files, colleagues, manager, direct reports, or any personal/
8
- organizational Microsoft data. Invoke proactively any time the user mentions Outlook, Teams,
9
- SharePoint, OneDrive, or wants to interact with their Microsoft 365 account. The skill uses
10
- a local Python CLI (msgraph.py) that handles authentication, token caching, and all API calls.
5
+ Teams chats, OneDrive files, OneNote notebooks, contacts, and org chart. Use this skill whenever
6
+ the user asks about their emails, inbox, unread messages, meetings, calendar, Teams messages or
7
+ chats, SharePoint documents, OneDrive files, OneNote notes or notebooks, colleagues, manager,
8
+ direct reports, or any personal/organizational Microsoft data. Invoke proactively any time the
9
+ user mentions Outlook, Teams, SharePoint, OneDrive, OneNote, or wants to interact with their
10
+ Microsoft 365 account. The skill uses a local Node.js CLI (msgraph.js) that handles
11
+ authentication, token caching, and all API calls.
11
12
  ---
12
13
 
13
14
  # Microsoft Graph API Skill
14
15
 
15
16
  This skill lets you interact with Microsoft 365 services on behalf of the user using the
16
- Microsoft Graph API. The Python CLI at `scripts/msgraph.py` handles everything.
17
+ Microsoft Graph API. The Node.js CLI at `scripts/msgraph.js` handles everything — no Python
18
+ or extra packages needed, only the Node.js that CodeMie already requires.
17
19
 
18
20
  ## Setup & Authentication
19
21
 
20
22
  **Check login status first** — always run this before any other command:
21
23
 
22
24
  ```bash
23
- python scripts/msgraph.py status
25
+ node ${CLAUDE_PLUGIN_ROOT}/skills/msgraph/scripts/msgraph.js status
24
26
  ```
25
27
 
26
28
  **Output interpretation:**
@@ -31,7 +33,7 @@ python scripts/msgraph.py status
31
33
  ### Login Flow (first time or after expiry)
32
34
 
33
35
  ```bash
34
- python scripts/msgraph.py login
36
+ node ${CLAUDE_PLUGIN_ROOT}/skills/msgraph/scripts/msgraph.js login
35
37
  ```
36
38
 
37
39
  This starts the **Device Code Flow** — it will print a URL and a short code like:
@@ -49,7 +51,7 @@ If status returns `NOT_LOGGED_IN` or `TOKEN_EXPIRED`, tell the user:
49
51
 
50
52
  > "You need to log in to Microsoft first. Run this command in your terminal:
51
53
  > ```
52
- > python scripts/msgraph.py login
54
+ > node ${CLAUDE_PLUGIN_ROOT}/skills/msgraph/scripts/msgraph.js login
53
55
  > ```
54
56
  > A code and URL will appear — open the URL in your browser and enter the code."
55
57
 
@@ -61,59 +63,59 @@ If status returns `NOT_LOGGED_IN` or `TOKEN_EXPIRED`, tell the user:
61
63
 
62
64
  ```bash
63
65
  # Your profile
64
- python scripts/msgraph.py me
66
+ node ${CLAUDE_PLUGIN_ROOT}/skills/msgraph/scripts/msgraph.js me
65
67
 
66
68
  # Your manager
67
- python scripts/msgraph.py org --manager
69
+ node ${CLAUDE_PLUGIN_ROOT}/skills/msgraph/scripts/msgraph.js org --manager
68
70
 
69
71
  # Your direct reports
70
- python scripts/msgraph.py org --reports
72
+ node ${CLAUDE_PLUGIN_ROOT}/skills/msgraph/scripts/msgraph.js org --reports
71
73
  ```
72
74
 
73
75
  ### Emails
74
76
 
75
77
  ```bash
76
78
  # List recent emails (default 10)
77
- python scripts/msgraph.py emails
79
+ node ${CLAUDE_PLUGIN_ROOT}/skills/msgraph/scripts/msgraph.js emails
78
80
 
79
81
  # More emails
80
- python scripts/msgraph.py emails --limit 25
82
+ node ${CLAUDE_PLUGIN_ROOT}/skills/msgraph/scripts/msgraph.js emails --limit 25
81
83
 
82
84
  # Unread only
83
- python scripts/msgraph.py emails --unread
85
+ node ${CLAUDE_PLUGIN_ROOT}/skills/msgraph/scripts/msgraph.js emails --unread
84
86
 
85
87
  # Search emails
86
- python scripts/msgraph.py emails --search "invoice Q4"
88
+ node ${CLAUDE_PLUGIN_ROOT}/skills/msgraph/scripts/msgraph.js emails --search "invoice Q4"
87
89
 
88
90
  # Read a specific email by ID (copy ID from list output)
89
- python scripts/msgraph.py emails --read MESSAGE_ID
91
+ node ${CLAUDE_PLUGIN_ROOT}/skills/msgraph/scripts/msgraph.js emails --read MESSAGE_ID
90
92
 
91
93
  # Send an email
92
- python scripts/msgraph.py emails --send recipient@example.com --subject "Hello" --body "Message text"
94
+ node ${CLAUDE_PLUGIN_ROOT}/skills/msgraph/scripts/msgraph.js emails --send recipient@example.com --subject "Hello" --body "Message text"
93
95
 
94
96
  # Browse specific folder (inbox, sentitems, drafts, deleteditems, junkemail)
95
- python scripts/msgraph.py emails --folder sentitems --limit 5
97
+ node ${CLAUDE_PLUGIN_ROOT}/skills/msgraph/scripts/msgraph.js emails --folder sentitems --limit 5
96
98
 
97
99
  # Machine-readable JSON output
98
- python scripts/msgraph.py emails --json
100
+ node ${CLAUDE_PLUGIN_ROOT}/skills/msgraph/scripts/msgraph.js emails --json
99
101
  ```
100
102
 
101
103
  ### Calendar
102
104
 
103
105
  ```bash
104
106
  # Upcoming events (default 10)
105
- python scripts/msgraph.py calendar
107
+ node ${CLAUDE_PLUGIN_ROOT}/skills/msgraph/scripts/msgraph.js calendar
106
108
 
107
109
  # More events
108
- python scripts/msgraph.py calendar --limit 20
110
+ node ${CLAUDE_PLUGIN_ROOT}/skills/msgraph/scripts/msgraph.js calendar --limit 20
109
111
 
110
112
  # Create an event
111
- python scripts/msgraph.py calendar --create "Team Standup" \
113
+ node ${CLAUDE_PLUGIN_ROOT}/skills/msgraph/scripts/msgraph.js calendar --create "Team Standup" \
112
114
  --start "2024-03-20T09:00" --end "2024-03-20T09:30" \
113
115
  --location "Teams" --timezone "Europe/Berlin"
114
116
 
115
117
  # Check availability for a time window
116
- python scripts/msgraph.py calendar --availability \
118
+ node ${CLAUDE_PLUGIN_ROOT}/skills/msgraph/scripts/msgraph.js calendar --availability \
117
119
  --start "2024-03-20T09:00:00" --end "2024-03-20T18:00:00"
118
120
  ```
119
121
 
@@ -121,64 +123,90 @@ python scripts/msgraph.py calendar --availability \
121
123
 
122
124
  ```bash
123
125
  # List followed/joined SharePoint sites
124
- python scripts/msgraph.py sharepoint --sites
126
+ node ${CLAUDE_PLUGIN_ROOT}/skills/msgraph/scripts/msgraph.js sharepoint --sites
125
127
 
126
128
  # Browse files in a specific site (use ID from --sites output)
127
- python scripts/msgraph.py sharepoint --site SITE_ID
129
+ node ${CLAUDE_PLUGIN_ROOT}/skills/msgraph/scripts/msgraph.js sharepoint --site SITE_ID
128
130
 
129
131
  # Browse a subfolder within a site
130
- python scripts/msgraph.py sharepoint --site SITE_ID --path "Documents/Reports"
132
+ node ${CLAUDE_PLUGIN_ROOT}/skills/msgraph/scripts/msgraph.js sharepoint --site SITE_ID --path "Documents/Reports"
131
133
 
132
134
  # Download a file
133
- python scripts/msgraph.py sharepoint --download ITEM_ID --output report.xlsx
135
+ node ${CLAUDE_PLUGIN_ROOT}/skills/msgraph/scripts/msgraph.js sharepoint --download ITEM_ID --output report.xlsx
134
136
  ```
135
137
 
136
138
  ### Teams
137
139
 
138
140
  ```bash
139
141
  # List all Teams chats
140
- python scripts/msgraph.py teams --chats
142
+ node ${CLAUDE_PLUGIN_ROOT}/skills/msgraph/scripts/msgraph.js teams --chats
141
143
 
142
144
  # Read messages from a chat (use chat ID from --chats output)
143
- python scripts/msgraph.py teams --messages CHAT_ID
145
+ node ${CLAUDE_PLUGIN_ROOT}/skills/msgraph/scripts/msgraph.js teams --messages CHAT_ID
144
146
 
145
147
  # Send a message to a chat
146
- python scripts/msgraph.py teams --send "Hello team!" --chat-id CHAT_ID
148
+ node ${CLAUDE_PLUGIN_ROOT}/skills/msgraph/scripts/msgraph.js teams --send "Hello team!" --chat-id CHAT_ID
147
149
 
148
150
  # List teams you're a member of
149
- python scripts/msgraph.py teams --teams-list
151
+ node ${CLAUDE_PLUGIN_ROOT}/skills/msgraph/scripts/msgraph.js teams --teams-list
150
152
  ```
151
153
 
152
154
  ### OneDrive
153
155
 
154
156
  ```bash
155
157
  # List root files
156
- python scripts/msgraph.py onedrive
158
+ node ${CLAUDE_PLUGIN_ROOT}/skills/msgraph/scripts/msgraph.js onedrive
157
159
 
158
160
  # Browse a folder
159
- python scripts/msgraph.py onedrive --path "Documents"
161
+ node ${CLAUDE_PLUGIN_ROOT}/skills/msgraph/scripts/msgraph.js onedrive --path "Documents"
160
162
 
161
163
  # Upload a file
162
- python scripts/msgraph.py onedrive --upload ./report.pdf --dest "Documents/report.pdf"
164
+ node ${CLAUDE_PLUGIN_ROOT}/skills/msgraph/scripts/msgraph.js onedrive --upload ./report.pdf --dest "Documents/report.pdf"
163
165
 
164
166
  # Download a file by ID
165
- python scripts/msgraph.py onedrive --download ITEM_ID --output local_copy.pdf
167
+ node ${CLAUDE_PLUGIN_ROOT}/skills/msgraph/scripts/msgraph.js onedrive --download ITEM_ID --output local_copy.pdf
166
168
 
167
169
  # File metadata
168
- python scripts/msgraph.py onedrive --info ITEM_ID
170
+ node ${CLAUDE_PLUGIN_ROOT}/skills/msgraph/scripts/msgraph.js onedrive --info ITEM_ID
171
+ ```
172
+
173
+ ### OneNote
174
+
175
+ ```bash
176
+ # List all notebooks
177
+ node ${CLAUDE_PLUGIN_ROOT}/skills/msgraph/scripts/msgraph.js onenote --notebooks
178
+
179
+ # List sections in a notebook (use ID from --notebooks output)
180
+ node ${CLAUDE_PLUGIN_ROOT}/skills/msgraph/scripts/msgraph.js onenote --sections NOTEBOOK_ID
181
+
182
+ # List pages in a section (use ID from --sections output)
183
+ node ${CLAUDE_PLUGIN_ROOT}/skills/msgraph/scripts/msgraph.js onenote --pages SECTION_ID
184
+
185
+ # Read a page's content (use ID from --pages output)
186
+ node ${CLAUDE_PLUGIN_ROOT}/skills/msgraph/scripts/msgraph.js onenote --read PAGE_ID
187
+
188
+ # Search pages across all notebooks
189
+ node ${CLAUDE_PLUGIN_ROOT}/skills/msgraph/scripts/msgraph.js onenote --search "meeting notes"
190
+
191
+ # Create a new page in a section
192
+ node ${CLAUDE_PLUGIN_ROOT}/skills/msgraph/scripts/msgraph.js onenote --create "My Note" \
193
+ --section SECTION_ID --body "Note content here"
194
+
195
+ # Machine-readable JSON output
196
+ node ${CLAUDE_PLUGIN_ROOT}/skills/msgraph/scripts/msgraph.js onenote --notebooks --json
169
197
  ```
170
198
 
171
199
  ### People & Contacts
172
200
 
173
201
  ```bash
174
202
  # Frequent collaborators (AI-ranked by Microsoft)
175
- python scripts/msgraph.py people
203
+ node ${CLAUDE_PLUGIN_ROOT}/skills/msgraph/scripts/msgraph.js people
176
204
 
177
205
  # Search people by name
178
- python scripts/msgraph.py people --search "Alice"
206
+ node ${CLAUDE_PLUGIN_ROOT}/skills/msgraph/scripts/msgraph.js people --search "Alice"
179
207
 
180
208
  # Outlook address book contacts
181
- python scripts/msgraph.py people --contacts
209
+ node ${CLAUDE_PLUGIN_ROOT}/skills/msgraph/scripts/msgraph.js people --contacts
182
210
  ```
183
211
 
184
212
  ---
@@ -204,6 +232,12 @@ python scripts/msgraph.py people --contacts
204
232
  1. Run `teams --chats` → list chats
205
233
  2. User picks a chat → run `teams --messages CHAT_ID`
206
234
 
235
+ ### "Show me my OneNote notes" / "Find a note about X"
236
+ 1. Run `onenote --notebooks` → list notebooks
237
+ 2. Run `onenote --sections NOTEBOOK_ID` → list sections
238
+ 3. Run `onenote --pages SECTION_ID` → list pages, or use `onenote --search "keyword"` to search directly
239
+ 4. Run `onenote --read PAGE_ID` → display page content
240
+
207
241
  ### "Who's my manager?" / "Who reports to me?"
208
242
  - Run `org --manager` or `org --reports`
209
243
 
@@ -224,10 +258,6 @@ This can happen if the user's organization has restricted certain Graph API perm
224
258
 
225
259
  ## Dependencies
226
260
 
227
- The script requires Python 3.10+ and two packages:
228
- ```bash
229
- pip install msal requests
230
- ```
231
-
232
- If `msal` or `requests` are not installed, the script prints the install command and exits.
261
+ **None** — the script uses only built-in Node.js modules (`https`, `fs`, `path`, `os`).
262
+ Node.js >= 18 is required, which is already a CodeMie prerequisite.
233
263
  IMPORTANT: you must work with current date (get it from sh/bash)