npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@shashimadushan/docx-editor-react-native-agent

v0.1.0

Published

AI agent plugin for @shashimadushan/docx-editor-react-native — adds the "@" mention / "Edit with AI" agent to the mobile DOCX editor. Install it only if you want an agent; don't, and none of its code is in your app bundle.

Readme

@shashimadushan/docx-editor-react-native-agent

The AI agent for @shashimadushan/docx-editor-react-native — the in-document "@" mention and "Edit with AI" flow, the 67-tool agent loop, and the host-executed tool bridge — packaged as a plugin.

Install it only if you want an agent. Don't, and none of this code is in your app bundle: this is the mobile equivalent of not installing @shashimadushan/docx-editor-agent on the web.

pnpm add @shashimadushan/docx-editor-react-native-agent

Usage

import { DocxEditorView } from '@shashimadushan/docx-editor-react-native';
import { agentPlugin } from '@shashimadushan/docx-editor-react-native-agent';

<DocxEditorView
  plugins={[agentPlugin({ baseUrl: 'https://your-app.com/api/agent' })]}
/>;

baseUrl points at your own backend — never a provider URL or key. The plugin builds a BackendAdapter inside the WebView; your server holds the provider key. See @shashimadushan/docx-editor-agent's handleAgentChat server helper, and examples/demo/app/api/agent/chat/route.ts for a working route.

Two things to get right on a device:

  • Use your machine's LAN IP, not localhost. The simulator/device is a separate network peer.
  • Send Access-Control-Allow-Origin: *. The WebView loads the editor from a local file, so its origin is an opaque file:// one your server can't allowlist by name. This is safe here — the adapter always uses credentials: 'omit', so no cookies are ever sent; put your auth token in headers instead.

Options

| Option | What it does | |---|---| | baseUrl | Your agent backend's URL. Required. | | headers | Extra headers on every agent request (e.g. { Authorization: … }). | | tools | Schema-only specs for host-executed tools. The LLM sees them like built-ins; when it calls one, the WebView round-trips to DocxEditorView's onAgentToolCall prop — so the tool runs in your native code, with your SDKs and session. Ship the same specs to your backend so its registry matches. | | presentation | 'host' suppresses the in-document mention bubble; run activity goes to DocxEditorView's onAgentActivity and prompts come in via handle.sendAgentMessage(), so you can render the conversation in your own native sheet (AgentSheet in the core package's native/ entry is a ready-made one). Default 'webview'. |

All four are live-patchable: they travel over the editor's config channel, so changing them after mount reaches the running agent with no WebView reload. The plugin's script is fixed at mount — adding or removing a plugin needs a remount.

Migrating from agentBaseUrl

-<DocxEditorView
-  agentBaseUrl={AGENT_URL}
-  agentHeaders={{ Authorization: token }}
-  agentTools={[myTool]}
-  agentPresentation="host"
-  onAgentToolCall={run}
-  onAgentActivity={log}
-/>
+<DocxEditorView
+  plugins={[agentPlugin({
+    baseUrl: AGENT_URL,
+    headers: { Authorization: token },
+    tools: [myTool],
+    presentation: 'host',
+  })]}
+  onAgentToolCall={run}
+  onAgentActivity={log}
+/>

onAgentToolCall and onAgentActivity stay on DocxEditorView: they're the host half of the contract, running your native code. The deprecated props still populate the plugin's config as a fallback, so an app that installs this package without rewriting its JSX keeps working — but they warn, and on their own (without this package installed) they no longer do anything, because the agent isn't in the core bundle to switch on anymore.

How it works

See ARCHITECTURE_PLAN.md §5B in the core package. In short: web/ builds an IIFE chunk with React and the editor package left external, mapped to globals the core bundle exposes; src/index.ts embeds that chunk as a string and wraps it in a DocxEditorHost.register(...) call; DocxEditorView injects it ahead of the core bundle, which drains the queue once it has a runtime to hand over. One React, one TipTap, one ProseMirror in the page — which is why the chunk is ~174 kB rather than megabytes.

requiresHost is checked at load time against the core's HOST_RUNTIME_VERSION; a mismatch reports one clear error through DocxEditorView's onError and the editor mounts without the agent.

License

MIT