@bitefoundry/onenote 0.1.3 → 0.2.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.
- package/LICENSE +21 -0
- package/README.md +163 -132
- package/docs/API.md +114 -0
- package/docs/MCP.md +124 -0
- package/docs/NPM.md +172 -142
- package/docs/openapi.yaml +314 -0
- package/package.json +50 -49
- package/scripts/postinstall.mjs +7 -11
- package/bin/note.js +0 -4
package/package.json
CHANGED
|
@@ -1,49 +1,50 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@bitefoundry/onenote",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "Microsoft OneNote terminal client & AI agent toolkit — Notebooks, Sections, Pages, XHTML/Markdown & Resources (CLI, TUI, HTTP API, MCP)",
|
|
5
|
-
"repository": {
|
|
6
|
-
"type": "git",
|
|
7
|
-
"url": "git+https://github.com/BiteFoundry/onenote.git"
|
|
8
|
-
},
|
|
9
|
-
"license": "MIT",
|
|
10
|
-
"bin": {
|
|
11
|
-
"onenote": "bin/onenote.js"
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
"docs/
|
|
19
|
-
"
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
"onenote",
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
"microsoft-
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
"@bitefoundry/onenote-win32-
|
|
44
|
-
"@bitefoundry/onenote-
|
|
45
|
-
"@bitefoundry/onenote-darwin-
|
|
46
|
-
"@bitefoundry/onenote-
|
|
47
|
-
"@bitefoundry/onenote-linux-
|
|
48
|
-
|
|
49
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@bitefoundry/onenote",
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "Microsoft OneNote terminal client & AI agent toolkit — Notebooks, Sections, Pages, XHTML/Markdown & Resources (CLI, TUI, HTTP API, MCP)",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "git+https://github.com/BiteFoundry/onenote.git"
|
|
8
|
+
},
|
|
9
|
+
"license": "MIT",
|
|
10
|
+
"bin": {
|
|
11
|
+
"onenote": "bin/onenote.js"
|
|
12
|
+
},
|
|
13
|
+
"files": [
|
|
14
|
+
"bin/onenote.js",
|
|
15
|
+
"scripts/postinstall.mjs",
|
|
16
|
+
"docs/NPM.md",
|
|
17
|
+
"docs/API.md",
|
|
18
|
+
"docs/MCP.md",
|
|
19
|
+
"docs/openapi.yaml",
|
|
20
|
+
"README.md"
|
|
21
|
+
],
|
|
22
|
+
"engines": {
|
|
23
|
+
"node": ">=18"
|
|
24
|
+
},
|
|
25
|
+
"keywords": [
|
|
26
|
+
"microsoft-onenote",
|
|
27
|
+
"onenote",
|
|
28
|
+
"note",
|
|
29
|
+
"microsoft-365",
|
|
30
|
+
"microsoft-graph",
|
|
31
|
+
"notebooks",
|
|
32
|
+
"markdown",
|
|
33
|
+
"cli",
|
|
34
|
+
"tui",
|
|
35
|
+
"mcp"
|
|
36
|
+
],
|
|
37
|
+
"scripts": {
|
|
38
|
+
"postinstall": "node scripts/postinstall.mjs",
|
|
39
|
+
"sync-version": "node scripts/sync-version.mjs",
|
|
40
|
+
"build:npm": "node scripts/build-npm.mjs"
|
|
41
|
+
},
|
|
42
|
+
"optionalDependencies": {
|
|
43
|
+
"@bitefoundry/onenote-win32-x64": "0.2.0",
|
|
44
|
+
"@bitefoundry/onenote-win32-arm64": "0.2.0",
|
|
45
|
+
"@bitefoundry/onenote-darwin-x64": "0.2.0",
|
|
46
|
+
"@bitefoundry/onenote-darwin-arm64": "0.2.0",
|
|
47
|
+
"@bitefoundry/onenote-linux-x64": "0.2.0",
|
|
48
|
+
"@bitefoundry/onenote-linux-arm64": "0.2.0"
|
|
49
|
+
}
|
|
50
|
+
}
|
package/scripts/postinstall.mjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
// Zero-Node-Process npm native binary linker.
|
|
3
3
|
//
|
|
4
|
-
// On Unix (linux/darwin): replaces installed `bin/onenote.js`
|
|
4
|
+
// On Unix (linux/darwin): replaces installed `bin/onenote.js` with
|
|
5
5
|
// hardlinks/symlinks directly to `@bitefoundry/onenote-<platform>-<arch>/bin/onenote` so npm's
|
|
6
6
|
// bin symlink execve's the native Rust binary directly (0ms Node startup, 0MB Node RSS).
|
|
7
7
|
//
|
|
8
|
-
// On Windows (win32): creates
|
|
9
|
-
// and rewrites npm's
|
|
8
|
+
// On Windows (win32): creates a native `bin/onenote.exe` hardlink (fallback copy)
|
|
9
|
+
// and rewrites npm's `onenote[.cmd|.ps1]` shims when present to invoke
|
|
10
10
|
// the native executable directly without spawning `node.exe`.
|
|
11
11
|
|
|
12
12
|
import fs from 'node:fs';
|
|
@@ -14,7 +14,7 @@ import path from 'node:path';
|
|
|
14
14
|
import { createRequire } from 'node:module';
|
|
15
15
|
import { fileURLToPath } from 'node:url';
|
|
16
16
|
|
|
17
|
-
const BIN_NAMES = ['onenote'
|
|
17
|
+
const BIN_NAMES = ['onenote'];
|
|
18
18
|
const PKG_ROOT = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');
|
|
19
19
|
|
|
20
20
|
function linkOrCopyFile(source, destination) {
|
|
@@ -95,10 +95,7 @@ function collectWindowsShimDirs(pkgRoot, env = process.env) {
|
|
|
95
95
|
|
|
96
96
|
function shimReferencesLauncher(content, name) {
|
|
97
97
|
const normalized = content.replace(/\\/g, '/').toLowerCase();
|
|
98
|
-
return (
|
|
99
|
-
normalized.includes('@bitefoundry/onenote') &&
|
|
100
|
-
normalized.includes(`bin/${name}.js`)
|
|
101
|
-
);
|
|
98
|
+
return normalized.includes(`/@bitefoundry/onenote/bin/${name}.js"`);
|
|
102
99
|
}
|
|
103
100
|
|
|
104
101
|
function rewriteWindowsShims(shimDir, pkgRoot) {
|
|
@@ -135,11 +132,10 @@ function rewriteWindowsShims(shimDir, pkgRoot) {
|
|
|
135
132
|
const ps1Body = [
|
|
136
133
|
'#!/usr/bin/env pwsh',
|
|
137
134
|
'$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent',
|
|
138
|
-
`$exePath = Join-Path $basedir '${relWin.replace(/'/g, "''")}'`,
|
|
139
135
|
'if ($MyInvocation.ExpectingInput) {',
|
|
140
|
-
|
|
136
|
+
` $input | & "$basedir/${relPosix}" $args`,
|
|
141
137
|
'} else {',
|
|
142
|
-
|
|
138
|
+
` & "$basedir/${relPosix}" $args`,
|
|
143
139
|
'}',
|
|
144
140
|
'exit $LASTEXITCODE',
|
|
145
141
|
'',
|
package/bin/note.js
DELETED