@bitefoundry/sharepoint 0.1.4 → 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 ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 BiteFoundry
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -21,7 +21,7 @@
21
21
 
22
22
  | Capability | Details |
23
23
  | --- | --- |
24
- | **Minimal-Chrome 3-Pane TUI** | Dual-persona explorer (`sharepoint`/`sp` & `onedrive`/`od`) with collapsible Sites, Document Libraries & OneDrive sidebar, sorted file list, live Inspector (metadata, version history, Markdown/YAML/JSON/code preview), Link Extractor (`u`), File Picker with `zoxide` (`Ctrl+F`), Context Menu (`.`), and 6 themes. |
24
+ | **Minimal-Chrome 3-Pane TUI** | Dual-persona explorer (`sharepoint` and `bitefoundry-onedrive`) with collapsible Sites, Document Libraries & OneDrive sidebar, sorted file list, live Inspector (metadata, version history, Markdown/YAML/JSON/code preview), Link Extractor (`u`), File Picker with `zoxide` (`Ctrl+F`), Context Menu (`.`), and 6 themes. |
25
25
  | **High-Res Terminal Images** | Inline Inspector thumbnails & fullscreen HD previews (`v` / `Alt+v`) with 80ms protocol probing for **Kitty**, **iTerm2**, **Sixel** (Floyd-Steinberg dithering), and **24-bit Unicode Half-Blocks** + `Ctrl+V` instant clipboard PNG upload. |
26
26
  | **Local SQLite FTS5 + IPC Daemon** | WAL-mode SQLite cache with 4-reader pool, hybrid local FTS5 + remote Graph search (`/`), streaming chunked uploads (`> 4 MiB`), and a shared background sync daemon (`sharepoint daemon start`). |
27
27
  | **4-in-1 Agent Interface** | Interactive **TUI**, scriptable `--json` **CLI**, local **HTTP JSON API** (`sharepoint serve`, port `8790`), and stdio **MCP Server** (`sharepoint mcp`, 19 tools). |
@@ -38,12 +38,33 @@ npm i -g @bitefoundry/sharepoint
38
38
  sharepoint login
39
39
 
40
40
  # 3. Launch the interactive 3-pane TUI in either persona
41
- sharepoint # SharePoint Sites & Document Libraries (alias: sp)
42
- onedrive # Personal OneDrive: My Files, Recent, Shared (alias: od)
41
+ sharepoint # SharePoint sites and document libraries
42
+ bitefoundry-onedrive # Personal OneDrive, including My Files, Recent, and Shared
43
43
  ```
44
44
 
45
- > Required Microsoft Graph delegated scopes: `Files.ReadWrite.All`, `Sites.ReadWrite.All`, `User.Read`, `offline_access`.
46
- > Prefer building from source? Run `cargo build --release` and see [docs/NPM.md](docs/NPM.md) for external token brokers & environment variables.
45
+ Build both commands with `cargo install --locked --path .` from a checkout. Both executables are also available in the same GitHub release archive. [Install and upgrade](docs/NPM.md)
46
+
47
+ ### Company-managed Microsoft Entra sign-in
48
+
49
+ `sharepoint login` uses the public Microsoft Graph Command Line Tools client by default. To use a company-owned app, register it as a public client and configure the `http://localhost` redirect URI. Enable public client flows for headless `--device-code` sign-in. [Company app registration guide](https://github.com/BiteFoundry/teams/blob/master/docs/ENTERPRISE.md)
50
+
51
+ Add the Microsoft Graph delegated permissions your users need and have your Entra administrator grant consent where required.
52
+
53
+ | Feature | Delegated scopes |
54
+ | --- | --- |
55
+ | Profile and session refresh | `User.Read`, `offline_access` |
56
+ | Read and edit OneDrive files | `Files.Read`, `Files.ReadWrite` |
57
+ | Read and edit files the user can access across drives | `Files.Read.All`, `Files.ReadWrite.All` |
58
+ | Browse SharePoint sites and libraries, and write to those libraries | `Sites.Read.All`, `Sites.ReadWrite.All` |
59
+
60
+ The default sign-in requests all scopes in the table. Set `scopes` in `config.toml` to request a narrower set that matches your workflow.
61
+
62
+ ```sh
63
+ sharepoint login --client-id YOUR_APP_ID --tenant-id YOUR_TENANT_ID
64
+ sharepoint whoami --json
65
+ ```
66
+
67
+ For persistent environment configuration, set `SHAREPOINT_CLIENT_ID` and `SHAREPOINT_TENANT_ID`. The OneDrive launcher uses the same credentials.
47
68
 
48
69
  ---
49
70
 
@@ -74,15 +95,15 @@ onedrive # Personal OneDrive: My Files, Recent, Shared (alias: od)
74
95
  ```sh
75
96
  sharepoint sites --json
76
97
  sharepoint drives --site "Acme Engineering" --json
77
- onedrive ls /Projects/Platform-v4 --json --compact
78
- onedrive info /Projects/Platform-v4/deploy-pipeline.yaml --versions --versions-limit 5 --json --compact
79
- onedrive cat /Projects/Platform-v4/deploy-pipeline.yaml
98
+ bitefoundry-onedrive ls /Projects/Platform-v4 --json --compact
99
+ bitefoundry-onedrive info /Projects/Platform-v4/deploy-pipeline.yaml --versions --versions-limit 5 --json --compact
100
+ bitefoundry-onedrive cat /Projects/Platform-v4/deploy-pipeline.yaml
80
101
  sharepoint upload ./q4-architecture-deck.pdf /RFCs --site "Acme Engineering" --json
81
102
  sharepoint share /api-gateway-rfc.md --site "Acme Engineering" --type view --scope organization --json
82
103
  sharepoint search "gateway" --remote --json
83
104
  ```
84
105
 
85
- `sharepoint --help` and `onedrive --help` list the commands that support `--json`.
106
+ `sharepoint --help` and `bitefoundry-onedrive --help` list the commands that support `--json`.
86
107
  For `ls` and `info`, `--json --compact` returns the drive and item IDs, name,
87
108
  file or folder flag, byte size, and modification time. Compact `info` also includes the eTag.
88
109
  `info --versions` reads all available history by default. `--versions-limit` caps
@@ -151,10 +172,10 @@ Full tool catalog & schemas: [docs/MCP.md](docs/MCP.md).
151
172
  | --- | --- | --- |
152
173
  | [`@bitefoundry/teams`](https://www.npmjs.com/package/@bitefoundry/teams) | `teams` | Microsoft Teams chats, channels, threads & meetings |
153
174
  | [`@bitefoundry/outlook`](https://www.npmjs.com/package/@bitefoundry/outlook) | `outlook` | Microsoft Outlook mail, calendar & contacts |
154
- | [`@bitefoundry/onenote`](https://www.npmjs.com/package/@bitefoundry/onenote) | `onenote`, `note` | Microsoft OneNote notebooks, sections, pages & XHTML/Markdown |
155
- | **`@bitefoundry/sharepoint`** | `sharepoint`, `sp`, `onedrive`, `od` | Microsoft SharePoint sites, document libraries & OneDrive files |
156
- | [`@bitefoundry/atlassian`](https://www.npmjs.com/package/@bitefoundry/atlassian) | `atlassian`, `jira`, `confluence`, `conf` | Atlassian Jira issues, boards, sprints & Confluence pages |
157
- | [`@bitefoundry/notion`](https://www.npmjs.com/package/@bitefoundry/notion) | `notion`, `nt` | Notion pages, databases, blocks & Markdown sync |
175
+ | [`@bitefoundry/onenote`](https://www.npmjs.com/package/@bitefoundry/onenote) | `onenote` | Microsoft OneNote notebooks, sections, pages & XHTML/Markdown |
176
+ | **`@bitefoundry/sharepoint`** | `sharepoint`, `bitefoundry-onedrive` | Microsoft SharePoint sites, document libraries & OneDrive files |
177
+ | [`@bitefoundry/atlassian`](https://www.npmjs.com/package/@bitefoundry/atlassian) | `atlassian`, `confluence`, `conf` | Atlassian Jira issues, boards, sprints & Confluence pages |
178
+ | [`@bitefoundry/notion`](https://www.npmjs.com/package/@bitefoundry/notion) | `notion` | Notion pages, databases, blocks & Markdown sync |
158
179
 
159
180
  ---
160
181
 
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env node
2
+ 'use strict';
3
+
4
+ require('./launch.js').launch('bitefoundry-onedrive', 'onedrive');
package/bin/launch.js ADDED
@@ -0,0 +1,114 @@
1
+ #!/usr/bin/env node
2
+ 'use strict';
3
+
4
+ const fs = require('node:fs');
5
+ const os = require('node:os');
6
+ const path = require('node:path');
7
+ const { spawn } = require('node:child_process');
8
+
9
+ const SUPPORTED = [
10
+ 'win32-x64',
11
+ 'win32-arm64',
12
+ 'darwin-x64',
13
+ 'darwin-arm64',
14
+ 'linux-x64',
15
+ 'linux-arm64',
16
+ ];
17
+
18
+ function launch(commandName, persona) {
19
+ function fail(message) {
20
+ process.stderr.write(`${commandName}: ${message}\n`);
21
+ process.exit(1);
22
+ }
23
+
24
+ const platform = process.platform;
25
+ const arch = process.arch;
26
+ const platformKey = `${platform}-${arch}`;
27
+ const packageName = `@bitefoundry/sharepoint-${platformKey}`;
28
+ const binaryName = platform === 'win32' ? 'sharepoint.exe' : 'sharepoint';
29
+
30
+ let packageDir = null;
31
+ try {
32
+ packageDir = path.dirname(require.resolve(`${packageName}/package.json`));
33
+ } catch {
34
+ packageDir = null;
35
+ }
36
+
37
+ const binaryPath = packageDir ? path.join(packageDir, 'bin', binaryName) : null;
38
+
39
+ if (!binaryPath || !fs.existsSync(binaryPath)) {
40
+ const fallbackNpx =
41
+ commandName === 'sharepoint'
42
+ ? ' npx --yes @bitefoundry/sharepoint'
43
+ : ` npx --yes -p @bitefoundry/sharepoint ${commandName}`;
44
+ const lines = [
45
+ `no prebuilt binary found for ${platformKey}.`,
46
+ '',
47
+ `Expected the optional dependency "${packageName}" to provide:`,
48
+ ` ${binaryPath || `node_modules/${packageName}/bin/${binaryName}`}`,
49
+ '',
50
+ `Supported platforms: ${SUPPORTED.join(', ')}`,
51
+ '',
52
+ 'Try one of:',
53
+ ' npm install -g @bitefoundry/sharepoint --include=optional',
54
+ ' npm install @bitefoundry/sharepoint --include=optional',
55
+ fallbackNpx,
56
+ '',
57
+ 'If you are on an unsupported platform (for example Alpine/musl Linux),',
58
+ 'build from source with Cargo:',
59
+ ' cargo build --release',
60
+ ];
61
+ fail(lines.join('\n'));
62
+ }
63
+
64
+ // npm does not guarantee the executable bit survives packaging, so make sure
65
+ // the binary is runnable before spawning it.
66
+ if (platform !== 'win32') {
67
+ try {
68
+ fs.chmodSync(binaryPath, 0o755);
69
+ } catch {
70
+ // Read-only install; spawn will report EACCES if the bit is missing.
71
+ }
72
+ }
73
+
74
+ const child = spawn(binaryPath, process.argv.slice(2), {
75
+ stdio: 'inherit',
76
+ windowsHide: false,
77
+ env: {
78
+ ...process.env,
79
+ SHAREPOINT_PERSONA: persona,
80
+ },
81
+ });
82
+
83
+ child.on('error', (err) => {
84
+ fail(`failed to launch ${binaryPath}: ${err.message}`);
85
+ });
86
+
87
+ // Forward termination signals to the child process.
88
+ for (const signal of ['SIGINT', 'SIGTERM', 'SIGHUP']) {
89
+ const handler = () => {
90
+ if (!child.killed) {
91
+ try {
92
+ child.kill(signal);
93
+ } catch {
94
+ // Child already exited.
95
+ }
96
+ }
97
+ };
98
+ try {
99
+ process.on(signal, handler);
100
+ } catch {
101
+ // Signal not supported on this platform.
102
+ }
103
+ }
104
+
105
+ child.on('exit', (code, signal) => {
106
+ if (signal) {
107
+ const number = os.constants.signals[signal] || 1;
108
+ process.exit(128 + number);
109
+ }
110
+ process.exit(code === null ? 1 : code);
111
+ });
112
+ }
113
+
114
+ module.exports = { launch };
package/bin/sharepoint.js CHANGED
@@ -1,121 +1,4 @@
1
1
  #!/usr/bin/env node
2
2
  'use strict';
3
3
 
4
- const fs = require('node:fs');
5
- const os = require('node:os');
6
- const path = require('node:path');
7
- const { spawn } = require('node:child_process');
8
-
9
- const SUPPORTED = [
10
- 'win32-x64',
11
- 'win32-arm64',
12
- 'darwin-x64',
13
- 'darwin-arm64',
14
- 'linux-x64',
15
- 'linux-arm64',
16
- ];
17
-
18
- function launch(
19
- commandName = 'sharepoint',
20
- persona = process.env.SHAREPOINT_PERSONA || 'sharepoint',
21
- ) {
22
- function fail(message) {
23
- process.stderr.write(`${commandName}: ${message}\n`);
24
- process.exit(1);
25
- }
26
-
27
- const platform = process.platform;
28
- const arch = process.arch;
29
- const platformKey = `${platform}-${arch}`;
30
- const packageName = `@bitefoundry/sharepoint-${platformKey}`;
31
- const binaryName = platform === 'win32' ? 'sharepoint.exe' : 'sharepoint';
32
-
33
- let packageDir = null;
34
- try {
35
- packageDir = path.dirname(require.resolve(`${packageName}/package.json`));
36
- } catch {
37
- packageDir = null;
38
- }
39
-
40
- const binaryPath = packageDir ? path.join(packageDir, 'bin', binaryName) : null;
41
-
42
- if (!binaryPath || !fs.existsSync(binaryPath)) {
43
- const fallbackNpx =
44
- commandName === 'sharepoint'
45
- ? ' npx --yes @bitefoundry/sharepoint'
46
- : ` npx --yes -p @bitefoundry/sharepoint ${commandName}`;
47
- const lines = [
48
- `no prebuilt binary found for ${platformKey}.`,
49
- '',
50
- `Expected the optional dependency "${packageName}" to provide:`,
51
- ` ${binaryPath || `node_modules/${packageName}/bin/${binaryName}`}`,
52
- '',
53
- `Supported platforms: ${SUPPORTED.join(', ')}`,
54
- '',
55
- 'Try one of:',
56
- ' npm install -g @bitefoundry/sharepoint --include=optional',
57
- ' npm install @bitefoundry/sharepoint --include=optional',
58
- fallbackNpx,
59
- '',
60
- 'If you are on an unsupported platform (for example Alpine/musl Linux),',
61
- 'build from source with Cargo:',
62
- ' cargo build --release',
63
- ];
64
- fail(lines.join('\n'));
65
- }
66
-
67
- // npm does not guarantee the executable bit survives packaging, so make sure
68
- // the binary is runnable before spawning it.
69
- if (platform !== 'win32') {
70
- try {
71
- fs.chmodSync(binaryPath, 0o755);
72
- } catch {
73
- // Read-only install; spawn will report EACCES if the bit is missing.
74
- }
75
- }
76
-
77
- const child = spawn(binaryPath, process.argv.slice(2), {
78
- stdio: 'inherit',
79
- windowsHide: false,
80
- env: {
81
- ...process.env,
82
- SHAREPOINT_PERSONA: persona,
83
- },
84
- });
85
-
86
- child.on('error', (err) => {
87
- fail(`failed to launch ${binaryPath}: ${err.message}`);
88
- });
89
-
90
- // Forward termination signals to the child process.
91
- for (const signal of ['SIGINT', 'SIGTERM', 'SIGHUP']) {
92
- const handler = () => {
93
- if (!child.killed) {
94
- try {
95
- child.kill(signal);
96
- } catch {
97
- // Child already exited.
98
- }
99
- }
100
- };
101
- try {
102
- process.on(signal, handler);
103
- } catch {
104
- // Signal not supported on this platform.
105
- }
106
- }
107
-
108
- child.on('exit', (code, signal) => {
109
- if (signal) {
110
- const number = os.constants.signals[signal] || 1;
111
- process.exit(128 + number);
112
- }
113
- process.exit(code === null ? 1 : code);
114
- });
115
- }
116
-
117
- module.exports = { launch };
118
-
119
- if (require.main === module) {
120
- launch('sharepoint', process.env.SHAREPOINT_PERSONA || 'sharepoint');
121
- }
4
+ require('./launch.js').launch('sharepoint', process.env.SHAREPOINT_PERSONA || 'sharepoint');
package/docs/NPM.md CHANGED
@@ -1,12 +1,47 @@
1
1
  # `@bitefoundry/sharepoint` npm Packaging
2
2
 
3
- `@bitefoundry/sharepoint` ships a single prebuilt native Rust binary across 6 optional platform packages (`win32-x64`, `win32-arm64`, `darwin-x64`, `darwin-arm64`, `linux-x64`, `linux-arm64`) with 4 launchers:
3
+ `@bitefoundry/sharepoint` ships one native Rust binary per supported platform (`win32-x64`, `win32-arm64`, `darwin-x64`, `darwin-arm64`, `linux-x64`, `linux-arm64`). A single install provides two commands.
4
4
 
5
- - `sharepoint` / `sp`: SharePoint Sites & Document Libraries persona
6
- - `onedrive` / `od`: Personal OneDrive persona (`SHAREPOINT_PERSONA=onedrive` + `argv[0]` detection)
5
+ - `sharepoint` opens SharePoint sites and document libraries.
6
+ - `bitefoundry-onedrive` opens personal OneDrive.
7
7
 
8
- ## Zero-Node-Process Linking
9
- `scripts/postinstall.mjs` hardlinks the platform binary directly to `bin/{sharepoint,sp,onedrive,od}` so invocations run with 0ms Node.js overhead while preserving persona detection via `argv[0]`.
8
+ ## Install
9
+
10
+ ```sh
11
+ npm install -g @bitefoundry/sharepoint
12
+ sharepoint --version
13
+ bitefoundry-onedrive --version
14
+ ```
15
+
16
+ Run `cargo install --locked --path .` from a source checkout to install both native commands. For a standalone install, extract both executables from the platform archive on the [GitHub releases page](https://github.com/BiteFoundry/sharepoint/releases) and add their directory to `PATH`. Windows adds `.exe` to both names.
17
+
18
+ ## Upgrade scripts and MCP clients
19
+
20
+ Update SharePoint scripts that used `sp` and OneDrive scripts that used `od` or `onedrive`.
21
+
22
+ ```sh
23
+ # Previous invocation
24
+ sp sites --json
25
+ od ls /Documents --json
26
+ onedrive recent --json
27
+
28
+ # Current invocation
29
+ sharepoint sites --json
30
+ bitefoundry-onedrive ls /Documents --json
31
+ bitefoundry-onedrive recent --json
32
+ ```
33
+
34
+ In a OneDrive MCP configuration, change `{"command":"onedrive","args":["mcp"]}` or `{"command":"od","args":["mcp"]}` to `{"command":"bitefoundry-onedrive","args":["mcp"]}`. For SharePoint, change `{"command":"sp","args":["mcp"]}` to `{"command":"sharepoint","args":["mcp"]}`.
35
+
36
+ If you installed the PowerShell profile launchers, rerun `scripts/install-profile.ps1` and restart the shell. npm removes the previous package's global launchers during an upgrade. If you manually replaced one of its launcher files with another program's launcher, move that file to a separate `PATH` directory before upgrading.
37
+
38
+ For a standalone upgrade, `sharepoint update` and the previous `onedrive update` can replace their current executables in place. To adopt the new OneDrive command name, copy `bitefoundry-onedrive` from the release archive into your `PATH`.
39
+
40
+ ## Native launchers
41
+
42
+ On Unix, `scripts/postinstall.mjs` links the platform binary behind both npm commands. On Windows it links or copies the executable and updates the package's npm shims. The native executable selects the mode from its launcher name. When native linking is unavailable, the JavaScript launchers resolve the installed platform package and set the mode before starting the executable.
43
+
44
+ For interactive sign-in and delegated Microsoft Graph scopes, see [Company-managed Microsoft Entra sign-in](../README.md#company-managed-microsoft-entra-sign-in).
10
45
 
11
46
  ## Release Verification
12
47
  ```bash
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bitefoundry/sharepoint",
3
- "version": "0.1.4",
3
+ "version": "0.2.0",
4
4
  "description": "Unified Microsoft SharePoint & OneDrive terminal client & AI agent toolkit — Sites, Document Libraries & Personal Files (CLI, TUI, HTTP API, MCP)",
5
5
  "repository": {
6
6
  "type": "git",
@@ -9,15 +9,12 @@
9
9
  "license": "MIT",
10
10
  "bin": {
11
11
  "sharepoint": "bin/sharepoint.js",
12
- "sp": "bin/sp.js",
13
- "onedrive": "bin/onedrive.js",
14
- "od": "bin/od.js"
12
+ "bitefoundry-onedrive": "bin/bitefoundry-onedrive.js"
15
13
  },
16
14
  "files": [
17
15
  "bin/sharepoint.js",
18
- "bin/sp.js",
19
- "bin/onedrive.js",
20
- "bin/od.js",
16
+ "bin/bitefoundry-onedrive.js",
17
+ "bin/launch.js",
21
18
  "scripts/postinstall.mjs",
22
19
  "docs/NPM.md",
23
20
  "docs/API.md",
@@ -46,11 +43,11 @@
46
43
  "build:npm": "node scripts/build-npm.mjs"
47
44
  },
48
45
  "optionalDependencies": {
49
- "@bitefoundry/sharepoint-win32-x64": "0.1.4",
50
- "@bitefoundry/sharepoint-win32-arm64": "0.1.4",
51
- "@bitefoundry/sharepoint-darwin-x64": "0.1.4",
52
- "@bitefoundry/sharepoint-darwin-arm64": "0.1.4",
53
- "@bitefoundry/sharepoint-linux-x64": "0.1.4",
54
- "@bitefoundry/sharepoint-linux-arm64": "0.1.4"
46
+ "@bitefoundry/sharepoint-win32-x64": "0.2.0",
47
+ "@bitefoundry/sharepoint-win32-arm64": "0.2.0",
48
+ "@bitefoundry/sharepoint-darwin-x64": "0.2.0",
49
+ "@bitefoundry/sharepoint-darwin-arm64": "0.2.0",
50
+ "@bitefoundry/sharepoint-linux-x64": "0.2.0",
51
+ "@bitefoundry/sharepoint-linux-arm64": "0.2.0"
55
52
  }
56
53
  }
@@ -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/{sharepoint,sp,onedrive,od}.js` with
4
+ // On Unix (linux/darwin): replaces installed `bin/{sharepoint,bitefoundry-onedrive}.js` with
5
5
  // hardlinks/symlinks directly to `@bitefoundry/sharepoint-<platform>-<arch>/bin/sharepoint` so npm's
6
6
  // bin symlink execve's the native Rust binary directly (0ms Node startup, 0MB Node RSS),
7
- // with persona inferred cleanly from `argv[0]` (`onedrive`/`od` vs `sharepoint`/`sp`).
7
+ // with the persona selected by `argv[0]`.
8
8
  //
9
- // On Windows (win32): creates NTFS hardlinks (fallback copy) `bin/{sharepoint,sp,onedrive,od}.exe`
9
+ // On Windows (win32): creates NTFS hardlinks (fallback copy) `bin/{sharepoint,bitefoundry-onedrive}.exe`
10
10
  // and rewrites npm's `.bin/<name>[.cmd|.ps1]` shims when present to invoke `<name>.exe`
11
11
  // directly without spawning `node.exe`.
12
12
 
@@ -15,7 +15,7 @@ import path from 'node:path';
15
15
  import { createRequire } from 'node:module';
16
16
  import { fileURLToPath } from 'node:url';
17
17
 
18
- const BIN_NAMES = ['sharepoint', 'sp', 'onedrive', 'od'];
18
+ const BIN_NAMES = ['sharepoint', 'bitefoundry-onedrive'];
19
19
  const PKG_ROOT = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');
20
20
 
21
21
  function linkOrCopyFile(source, destination) {
@@ -94,10 +94,7 @@ function collectWindowsShimDirs(pkgRoot, env = process.env) {
94
94
 
95
95
  function shimReferencesLauncher(content, name) {
96
96
  const normalized = content.replace(/\\/g, '/').toLowerCase();
97
- return (
98
- normalized.includes('@bitefoundry/sharepoint') &&
99
- normalized.includes(`bin/${name}.js`)
100
- );
97
+ return normalized.includes(`/@bitefoundry/sharepoint/bin/${name}.js"`);
101
98
  }
102
99
 
103
100
  function rewriteWindowsShims(shimDir, pkgRoot) {
@@ -134,11 +131,10 @@ function rewriteWindowsShims(shimDir, pkgRoot) {
134
131
  const ps1Body = [
135
132
  '#!/usr/bin/env pwsh',
136
133
  '$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent',
137
- `$exePath = Join-Path $basedir '${relWin.replace(/'/g, "''")}'`,
138
134
  'if ($MyInvocation.ExpectingInput) {',
139
- ' $input | & $exePath @args',
135
+ ` $input | & "$basedir/${relPosix}" $args`,
140
136
  '} else {',
141
- ' & $exePath @args',
137
+ ` & "$basedir/${relPosix}" $args`,
142
138
  '}',
143
139
  'exit $LASTEXITCODE',
144
140
  '',
package/bin/od.js DELETED
@@ -1,4 +0,0 @@
1
- #!/usr/bin/env node
2
- 'use strict';
3
-
4
- require('./sharepoint.js').launch('od', 'onedrive');
package/bin/onedrive.js DELETED
@@ -1,4 +0,0 @@
1
- #!/usr/bin/env node
2
- 'use strict';
3
-
4
- require('./sharepoint.js').launch('onedrive', 'onedrive');
package/bin/sp.js DELETED
@@ -1,4 +0,0 @@
1
- #!/usr/bin/env node
2
- 'use strict';
3
-
4
- require('./sharepoint.js').launch('sp', process.env.SHAREPOINT_PERSONA || 'sharepoint');