@codemieai/code 0.0.48 → 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.14"
8
+ "version": "1.0.15"
9
9
  }
@@ -9,7 +9,7 @@ Work with your Microsoft 365 account from Claude Code — emails, calendar, Shar
9
9
  ### 1. Log in (first time only)
10
10
 
11
11
  ```bash
12
- node .codemie/claude-plugin/skills/msgraph/scripts/msgraph.js login
12
+ node ~/.codemie/claude-plugin/skills/msgraph/scripts/msgraph.js login
13
13
  ```
14
14
 
15
15
  You'll see a message like:
@@ -2,12 +2,13 @@
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 Node.js CLI (msgraph.js) 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
@@ -169,6 +170,32 @@ node ${CLAUDE_PLUGIN_ROOT}/skills/msgraph/scripts/msgraph.js onedrive --download
169
170
  node ${CLAUDE_PLUGIN_ROOT}/skills/msgraph/scripts/msgraph.js onedrive --info ITEM_ID
170
171
  ```
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
197
+ ```
198
+
172
199
  ### People & Contacts
173
200
 
174
201
  ```bash
@@ -205,6 +232,12 @@ node ${CLAUDE_PLUGIN_ROOT}/skills/msgraph/scripts/msgraph.js people --contacts
205
232
  1. Run `teams --chats` → list chats
206
233
  2. User picks a chat → run `teams --messages CHAT_ID`
207
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
+
208
241
  ### "Who's my manager?" / "Who reports to me?"
209
242
  - Run `org --manager` or `org --reports`
210
243
 
@@ -25,7 +25,9 @@ const SCOPES = [
25
25
  'Calendars.Read', 'Calendars.ReadWrite',
26
26
  'Files.Read', 'Files.ReadWrite',
27
27
  'Sites.Read.All', 'Chat.Read', 'Chat.ReadWrite',
28
- 'People.Read', 'Contacts.Read', 'offline_access',
28
+ 'People.Read', 'Contacts.Read',
29
+ 'Notes.Read', 'Notes.ReadWrite',
30
+ 'offline_access',
29
31
  ].join(' ');
30
32
  const CACHE_FILE = path.join(os.homedir(), '.ms_graph_token_cache.json');
31
33
  const GRAPH_BASE = 'https://graph.microsoft.com/v1.0';
@@ -676,11 +678,98 @@ async function cmdOrg(args) {
676
678
  for (const p of colleagues) console.log(` ${p.displayName}`);
677
679
  }
678
680
 
681
+ async function cmdOnenote(args) {
682
+ const token = await getValidToken();
683
+ const limit = parseInt(args.limit) || 20;
684
+
685
+ if (args.notebooks) {
686
+ const data = await graphGet('/me/onenote/notebooks', token, { $top: limit, $select: 'id,displayName,lastModifiedDateTime' });
687
+ const notebooks = data.value || [];
688
+ if (args.json) { console.log(JSON.stringify(notebooks, null, 2)); return; }
689
+ if (!notebooks.length) { console.log('No notebooks found.'); return; }
690
+ console.log(`\n${'ID'.padEnd(36)} ${'Modified'.padEnd(18)} Name`);
691
+ console.log('─'.repeat(80));
692
+ for (const nb of notebooks)
693
+ console.log(`${(nb.id || '').padEnd(36)} ${fmtDt(nb.lastModifiedDateTime).padEnd(18)} ${nb.displayName || 'N/A'}`);
694
+ return;
695
+ }
696
+
697
+ if (args.sections) {
698
+ const data = await graphGet(`/me/onenote/notebooks/${args.sections}/sections`, token, { $top: limit, $select: 'id,displayName,lastModifiedDateTime' });
699
+ const sections = data.value || [];
700
+ if (args.json) { console.log(JSON.stringify(sections, null, 2)); return; }
701
+ if (!sections.length) { console.log('No sections found.'); return; }
702
+ console.log(`\nSections in notebook ${args.sections.slice(0, 20)}...:`);
703
+ console.log(`${'ID'.padEnd(36)} Name`);
704
+ console.log('─'.repeat(70));
705
+ for (const s of sections)
706
+ console.log(`${(s.id || '').padEnd(36)} ${s.displayName || 'N/A'}`);
707
+ return;
708
+ }
709
+
710
+ if (args.pages) {
711
+ const data = await graphGet(`/me/onenote/sections/${args.pages}/pages`, token, { $top: limit, $select: 'id,title,lastModifiedDateTime' });
712
+ const pages = data.value || [];
713
+ if (args.json) { console.log(JSON.stringify(pages, null, 2)); return; }
714
+ if (!pages.length) { console.log('No pages found.'); return; }
715
+ console.log(`\nPages in section ${args.pages.slice(0, 20)}...:`);
716
+ console.log(`${'ID'.padEnd(36)} ${'Modified'.padEnd(18)} Title`);
717
+ console.log('─'.repeat(80));
718
+ for (const p of pages)
719
+ console.log(`${(p.id || '').padEnd(36)} ${fmtDt(p.lastModifiedDateTime).padEnd(18)} ${p.title || '(untitled)'}`);
720
+ return;
721
+ }
722
+
723
+ if (args.read) {
724
+ const res = await httpsRequest(`${GRAPH_BASE}/me/onenote/pages/${args.read}/content`, { headers: { Authorization: `Bearer ${token}` } });
725
+ if (args.json) { console.log(JSON.stringify({ id: args.read, content: res.body })); return; }
726
+ console.log(stripHtml(res.body));
727
+ return;
728
+ }
729
+
730
+ if (args.search) {
731
+ const data = await graphGet('/me/onenote/pages', token, { $search: `"${args.search}"`, $top: limit, $select: 'id,title,createdDateTime' });
732
+ const pages = data.value || [];
733
+ if (args.json) { console.log(JSON.stringify(pages, null, 2)); return; }
734
+ if (!pages.length) { console.log(`No pages found matching "${args.search}".`); return; }
735
+ console.log(`\nSearch results for "${args.search}" (${pages.length}):`);
736
+ console.log(`${'ID'.padEnd(36)} Title`);
737
+ console.log('─'.repeat(70));
738
+ for (const p of pages)
739
+ console.log(`${(p.id || '').padEnd(36)} ${p.title || '(untitled)'}`);
740
+ return;
741
+ }
742
+
743
+ if (args.create) {
744
+ if (!args.section) {
745
+ console.error('Error: --create requires --section SECTION_ID');
746
+ process.exit(1);
747
+ }
748
+ const htmlBody = `<!DOCTYPE html><html><head><title>${args.create}</title></head><body>${args.body || ''}</body></html>`;
749
+ const res = await httpsRequest(`${GRAPH_BASE}/me/onenote/sections/${args.section}/pages`, {
750
+ method: 'POST',
751
+ headers: {
752
+ Authorization: `Bearer ${token}`,
753
+ 'Content-Type': 'text/html',
754
+ 'Content-Length': Buffer.byteLength(htmlBody),
755
+ },
756
+ }, htmlBody);
757
+ const page = JSON.parse(res.body);
758
+ console.log(`Page created: ${page.title || args.create}`);
759
+ console.log(`ID: ${page.id}`);
760
+ return;
761
+ }
762
+
763
+ console.log('OneNote: --notebooks | --sections NOTEBOOK_ID | --pages SECTION_ID');
764
+ console.log(' --read PAGE_ID | --search QUERY');
765
+ console.log(' --create TITLE --section SECTION_ID [--body CONTENT]');
766
+ }
767
+
679
768
  // ── CLI Parser ────────────────────────────────────────────────────────────────
680
769
  function parseArgs(argv) {
681
770
  // Flags that take no value (boolean)
682
771
  const BOOL = new Set(['json','unread','sites','chats','teamsList','contacts',
683
- 'manager','reports','availability','help']);
772
+ 'manager','reports','availability','notebooks','help']);
684
773
  const args = { _: [] };
685
774
  let i = 0;
686
775
  while (i < argv.length) {
@@ -724,6 +813,9 @@ Data:
724
813
  [--info ID] [--json]
725
814
  people [--contacts] [--search NAME] [--limit N] [--json]
726
815
  org [--manager] [--reports] [--json]
816
+ onenote [--notebooks] [--sections NOTEBOOK_ID] [--pages SECTION_ID]
817
+ [--read PAGE_ID] [--search QUERY] [--limit N] [--json]
818
+ [--create TITLE --section SECTION_ID [--body CONTENT]]
727
819
 
728
820
  Add --json to any command for machine-readable output.
729
821
 
@@ -734,6 +826,12 @@ Examples:
734
826
  node ${name} calendar --create "Standup" --start 2024-03-15T09:00 --end 2024-03-15T09:30
735
827
  node ${name} teams --chats
736
828
  node ${name} onedrive --upload report.pdf --dest "Documents/report.pdf"
829
+ node ${name} onenote --notebooks
830
+ node ${name} onenote --sections NOTEBOOK_ID
831
+ node ${name} onenote --pages SECTION_ID
832
+ node ${name} onenote --read PAGE_ID
833
+ node ${name} onenote --search "meeting notes"
834
+ node ${name} onenote --create "My Note" --section SECTION_ID --body "Content here"
737
835
  `);
738
836
  }
739
837
 
@@ -757,6 +855,7 @@ async function main() {
757
855
  onedrive: () => cmdOnedrive(args),
758
856
  people: () => cmdPeople(args),
759
857
  org: () => cmdOrg(args),
858
+ onenote: () => cmdOnenote(args),
760
859
  help: () => { printHelp(); process.exit(0); },
761
860
  };
762
861
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codemieai/code",
3
- "version": "0.0.48",
3
+ "version": "0.0.49",
4
4
  "description": "Unified AI coding assistant CLI - Manage Claude Code, Gemini & custom agents. Multi-provider support (OpenAI, Azure, LiteLLM, SSO). Built-in LangGraph agent with file operations & git integration.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",