{
  "name": "m365-api",
  "version": "0.1.1",
  "type": "module",
  "description": "Local API adapter for Microsoft 365 Copilot Code models and reasoning effort",
  "engines": {
    "node": ">=24"
  },
  "scripts": {
    "start": "node scripts/cli.mjs start",
    "start:background": "node scripts/cli.mjs start",
    "test": "node --test test/*.test.mjs",
    "auth:import": "node scripts/cli.mjs auth:import",
    "auth:login": "node scripts/cli.mjs login",
    "claude:install": "node scripts/cli.mjs setup",
    "claude:configure": "node scripts/cli.mjs claude:configure",
    "claude:desktop:configure": "node scripts/cli.mjs claude:desktop:configure",
    "claude:mcp:allow": "node scripts/cli.mjs claude:mcp:allow",
    "check": "node --check src/server.mjs && node --check src/client.mjs && node --check src/auth.mjs && node --check src/anthropic.mjs && node --check src/response-parameters.mjs && node --check src/partial-text.mjs && node --check src/text-smoother.mjs && node --check src/device-login.mjs && node --check src/browser-login.mjs && node --check src/claude-config.mjs && node --check src/claude-discovery.mjs && node --check src/conversation-store.mjs && node --check src/transcript-state.mjs && node --check src/reply-cache.mjs && node --check src/compaction.mjs && node --check src/upstream-context.mjs && node --check src/images.mjs && node --check src/files.mjs && node --check src/completions.mjs && node --check public/app.js && node --check scripts/install-claude.mjs && node --check scripts/configure-claude.mjs && node --check scripts/configure-claude-desktop.mjs && node --check scripts/login.mjs && node --check scripts/start.mjs && node --check scripts/ensure-dependencies.mjs && node --check scripts/spawn-background.mjs && node --check src/gateway-config.mjs && node --check scripts/service.mjs && node --check scripts/cli.mjs && node --check src/installation.mjs && node --check src/release.mjs && node --check scripts/package-install.mjs && node --check scripts/package-launcher.mjs && node --check scripts/postinstall.mjs && node --check scripts/prepare-package.mjs && node --check scripts/runtime-check.mjs && node --check scripts/runtime-update.mjs && node --check scripts/release-artifact.mjs && node --check scripts/smoke-package.mjs && node --check scripts/github-release.mjs && node --check scripts/pack-release.mjs",
    "setup": "node scripts/cli.mjs setup",
    "stop": "node scripts/cli.mjs stop",
    "restart": "node scripts/cli.mjs restart",
    "status": "node scripts/cli.mjs status",
    "update": "node scripts/cli.mjs update",
    "startup": "node scripts/cli.mjs startup",
    "startup:remove": "node scripts/cli.mjs startup:remove",
    "start:foreground": "node scripts/cli.mjs start --foreground",
    "prepack": "node scripts/prepare-package.mjs",
    "postinstall": "node scripts/postinstall.mjs",
    "runtime:check": "node scripts/runtime-check.mjs"
  },
  "dependencies": {
    "@modelcontextprotocol/sdk": "1.32.1",
    "@playwright/cli": "0.1.22",
    "@playwright/mcp": "0.0.83",
    "ajv": "8.20.0",
    "ajv-formats": "3.0.1"
  },
  "bin": {
    "m365-api": "scripts/cli.mjs"
  },
  "license": "MIT",
  "repository": {
    "type": "git",
    "url": "https://github.com/shaowei_microsoft/m365-api.git"
  },
  "homepage": "https://m365api.claxlink.top",
  "bugs": {
    "url": "https://github.com/shaowei_microsoft/m365-api/issues"
  },
  "files": [
    "src/",
    "scripts/",
    "public/",
    "README.md",
    "README.zh-CN.md",
    "LICENSE",
    ".env.example",
    ".github/assets/",
    "package-mode.json",
    "templates/",
    "docs/reference.md",
    "docs/reference.zh-CN.md",
    "docs/publishing.md",
    "docs/publishing.zh-CN.md",
    "CONTRIBUTING.md",
    "CONTRIBUTING.zh-CN.md"
  ],
  "bundleDependencies": true,
  "publishConfig": {
    "access": "public"
  },
  "readme": "[![简体中文](.github/assets/lang-zh-CN.svg)](https://github.com/shaowei_microsoft/m365-api/blob/main/README.zh-CN.md)\n\n# m365-api\n\nConnect Microsoft 365 Copilot Code to Claude CLI, Claude Desktop, and OpenAI-compatible clients.\n\n## Quick start (Windows PowerShell)\n\nInstall **Node.js 24+, Edge**, and your preferred Claude client. Your work account must have access to the [Microsoft 365 Copilot Code page](https://copilot.cloud.microsoft/code?origindomain=microsoft365&es=SSR&redirfrom=mcmToCcm#/sessions).\n\n```powershell\nnpm install -g m365-api\nm365-api setup\n```\n\nSetup asks for a port, initially **8787**, saves it, configures the discovered Claude clients, and starts the gateway. It prints the absolute gateway and client configuration paths. Choose a port directly with:\n\n```powershell\nm365-api setup --port 8787\n```\n\nIf your network cannot reach npmjs, install the same package with its bundled dependencies from the distribution site:\n\n```powershell\nnpm install -g https://m365api.claxlink.top/releases/latest.tgz --no-audit --no-fund\n```\n\nThe first startup attempts silent Microsoft sign-in. If interaction or MFA is required:\n\n```powershell\nm365-api login --headed\nm365-api start\n```\n\n## Existing Git installations\n\nGlobal npm installation detects the old source deployment from its registered user PATH or startup entry. It preserves the account, saved port, conversation mappings and attachments, removes only the old m365-api PATH registration, and replaces existing m365-api startup entries with a stable launcher. The source directory remains intact. A previously running gateway is restarted after validation; active client connections block migration. Unrelated PATH entries, startup items, Claude settings and MCP configuration are preserved.\n\n**Reopen your terminal** after migration. If there are multiple source installations, select the intended one with `m365-api migrate --legacy-root <path>`. npm installs using `--ignore-scripts` defer installation until the command first runs. Local dependency installations do not migrate your machine.\n\n## Usage\n\n```powershell\nclaude --model opus --effort max\nclaude --model sonnet --effort max\n```\n\nIn Claude Desktop, restart and use the selected `m365-api` profile, displayed as **M365APP**. Open **Code** and select a local project.\n\n| Interface | Default address |\n|---|---|\n| Web interface / Claude base URL | http://127.0.0.1:8787 |\n| OpenAI base URL | http://127.0.0.1:8787/v1 |\n\nUse the address shown by setup or status if you selected another port. Upload files through the web interface or compatible Claude / Anthropic file APIs; see [reference](docs/reference.md).\n\n## Common commands\n\n| Action | Command |\n|---|---|\n| Configure clients and start | `m365-api setup` |\n| Start / stop / restart | `m365-api start` / `m365-api stop` / `m365-api restart` |\n| Show status and configuration paths | `m365-api status` |\n| Check for an update | `m365-api update --check-only` |\n| Download, verify and apply an update | `m365-api update` |\n| Run in the foreground | `m365-api start --foreground` |\n| Preview client configuration | `m365-api setup --check-only` |\n| Enable / disable startup | `m365-api startup` / `m365-api startup:remove` |\n| Sign in interactively | `m365-api login --headed` |\n\nStopping interrupts active requests and does not disable startup. New npm installations do not enable startup automatically; existing startup settings are preserved during migration. Development-only command registration and test commands are available from Git checkouts.\n\n## Updates and data\n\nnpm installations keep data under **%LOCALAPPDATA%\\m365-api** on Windows. The saved settings are in `.env`; credentials, conversations and attachments are under `.local`. `M365_API_HOME` selects another data directory. Setup and status show the actual absolute configuration path.\n\n`m365-api update` downloads a complete runtime from **m365api.claxlink.top**, verifies its SHA-512 digest, stages it alongside the current version and performs a self-check before switching. It requires no Git or npm-registry access. A running gateway is restarted and health-checked; failure attempts to restore the previous version and service. User data is shared across runtime versions. Existing client connections block a restart. Preview does not change files or stop the gateway.\n\nTo use another distribution source, run `m365-api update --source <HTTPS URL>`. Package installation inherits your npm registry settings; the runtime distribution address is configured separately. Node.js and Edge remain system prerequisites.\n\nFor source development, configuration, file APIs and limitations, see the [reference](docs/reference.md) and [contribution guide](CONTRIBUTING.md).\n",
  "readmeFilename": "README.md"
}
