New:Introducing Socket Scanning for VS Code Marketplace Extensions.Learn more →
Get Started

@maple-kit/core

Package Overview
Dependencies
Maintainers
1
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@maple-kit/core

Server SDK, overlay and connector contracts for Maple

latest
Source
npmnpm
Version
0.23.0
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

@maple-kit/core

The server SDK, the overlay controller, the build plugins and the connector contracts for Maple — visual review comments on deployed previews, written for people and read by agents.

Pre-release. Every package here is 0.x and makes no compatibility promise.

Install

npm install @maple-kit/core @babel/core

@babel/core is an optional peer that only the JSX tagger uses; skip it if you never set tagger: true.

Most applications also install @maple-kit/ui for the overlay a reviewer sees. Core is the part that runs on your server and in your build.

On deployed previews

A browser opens a pull request's preview URL, and the review comments already left on the page appear on it one by one.

Maple runs on the preview URL your CI already builds, so anyone holding the link can comment. The route is mounted inside your own application, on your own origin, at /api/maple/*: no hosted service, and nothing added to your connect-src.

// vite.config.ts
import { createCommentStore } from "@maple-kit/core";
import { githubStore } from "@maple-kit/core/connectors";
import { maple } from "@maple-kit/core/vite";

export default defineConfig({
  plugins: [
    maple({
      tagger: process.env.MAPLE_PREVIEW === "1",
      route: {
        // Local development only: every comment is written as this one token.
        store: createCommentStore(githubStore({ owner, repo, token: process.env.GITHUB_TOKEN! })),
      },
    }),
  ],
});

A shared token is for trying it locally. A preview other people review builds the store per request from each reviewer's own token, with the resolver in docs/github-auth.md.

Next.js wraps its config in withMaple from @maple-kit/core/next and mounts createMapleHandler from @maple-kit/core/route at app/api/maple/[...maple]/route.ts. Any other server mounts the same handler: it is Web-standard Request in, Response out.

The file and the line

In developer mode, hovering the page shows each element's component name and its file, line and column.

On a preview build the tagger marks every JSX element with the file, line and column it was written at, so a comment reaches an agent pointing at source rather than at a selector. A production build strips every mark; withMaple makes taking one half without the other impossible by accident.

Connectors

A comment flows into Maple and out to the connectors wired today, GitHub and a classifier, while Linear and Bitbucket wait as coming soon.

Maple stores nothing itself. Comments live in what you already run, starting with the pull request itself. A connector is one file of plain Promise-returning methods, and its capabilities are exactly the methods it defines:

KindRequiredOptional
storelist, appendappendMany, setStatus, head, watch, approvals, approve, unapprove
mediaputBlob, getUrlremove
observabilitygetReplayLinkfetchEvents
identityresolveUser—
gatepublishread
classifier—score, classify, plan

Bundled today: githubStore and githubGate, and keywordClassifier, which scores and plans offline with no credential. A model-backed classifier is @maple-kit/classifier.

Every connector runs the shared contract suite from @maple-kit/core/testing (runStoreContract, runClassifierContract, …). That entry declares vitest as an optional peer: it registers its tests against whichever runner you invoke, so it has to be yours.

The merge gate

A pull request's checks: maple/visual-review fails with two comments open, they resolve, the check passes and the merge button wakes up.

maple/visual-review fails while a comment is open and, with requireApproval, until somebody says they looked. The decision lives in @maple-kit/core/gate, independent of any forge; githubGate publishes it as a check run.

Entrypoints

ImportWhat it is
@maple-kit/coreComment types, the connector contracts, createCommentStore
@maple-kit/core/routeThe SDK route a host application mounts at /api/maple/*
@maple-kit/core/viteThe Vite plugin: tagger transform plus the mounted route
@maple-kit/core/nextwithMaple, both halves of the Next case
@maple-kit/core/loaderThe Turbopack loader the Next path uses
@maple-kit/core/clientThe framework-free reviewer controller the bindings wrap
@maple-kit/core/overlayThe shadow-root host, the pickers and the anchor cascade
@maple-kit/core/anchorAnchoring and re-anchoring, five rungs with four orphan reasons
@maple-kit/core/connectorsThe bundled connectors and the classifier's default pillars
@maple-kit/core/gateThe merge gate's decision, independent of any forge
@maple-kit/core/mockMaple Mock's recipe: parse, encode, link, and read a plan
@maple-kit/core/flagswithFlagUse, recordFlagUse: flags a server read, in a header
@maple-kit/core/launchdarklyA Node server SDK hook that feeds recordFlagUse
@maple-kit/core/authGitHub Device Flow, including the slow_down back-off
@maple-kit/core/exportMarkdown with a visible ```maple fence
@maple-kit/core/screenshotPaste, drop and file capture, with snapdom as an optional peer
@maple-kit/core/taggerThe JSX tagger that turns a comment into file:line
@maple-kit/core/loggercreateLogger({ sinks })
@maple-kit/core/configStandard Schema validation of Maple's own options
@maple-kit/core/testingThe shared connector contract suite. Needs vitest

Documentation

Licence

Apache-2.0. See LICENSE and NOTICE.

FAQs

Package last updated on 14 Oct 2026

Related posts