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

@draftline/client

v0.1.14

Published

Typed Draftline client for Tauri host applications.

Readme

Draftline client

client/ contains the TypeScript command client used by Workbench and host apps. It wraps Tauri invoke calls and mirrors the serializable shapes from draftline::tauri_contract.

The client also exposes the stable Draftline workspace event channel used by configured Tauri hosts:

const client = createDraftlineClient();
const unlisten = await client.subscribeWorkspaceEvents((event) => {
  if (event.kind === 'history_changed' || event.kind === 'dirty_changed') {
    // Refresh product UI from inspectWorkspace.
  }
});

Remote merge flows use the same typed DTOs as draftline::tauri_contract. Call preflightMergeIncoming first; if it returns conflicts and a token with can_merge_cleanly: false, use createMergeConflictViewModel to render file/field groups and createWholeFileUseContentResolutions when the product UI offers whole-file "use ours/theirs/base" actions. Those helpers emit explicit use_content resolutions so the submitted payload matches the content the user reviewed:

await client.mergeIncomingWithResolutions({
  workspace_path: workspacePath,
  remote: 'origin',
  label: 'Resolve teammate changes',
  token: preflight.token,
  resolutions: createWholeFileUseContentResolutions(preflight, 'theirs'),
});

For host code, createDraftlineHostFacade binds a client to one workspace path and exposes product-level operations such as save, selectedSave, diffWorkspaceFile, previewWorkspaceFile, fetchRemote, mergeIncoming, mergeIncomingWithResolutions, history cleanup preview/apply/undo, recovery repair/rollback, and remote variation adoption without repeating request DTO plumbing in every component.

Pending history cleanup

After applyHistoryCleanup, Draftline persists pending cleanup state until the cleanup is published, undone, or explicitly abandoned. Host apps should call listPendingHistoryCleanups or facade pendingHistoryCleanups on workspace load/refresh and route normal sync UI to publishPendingHistoryCleanup or undoPendingHistoryCleanup while a pending record exists.

Normal sync operations return a structured history_cleanup_blocked error when they would invalidate pending cleanup state. Use isHistoryCleanupBlockedError to narrow the error and read details.operation, details.diagnostics, and the safe next actions.

Workspace graph integration

@draftline/client exports the graph DTOs and helper return types directly, including WorkspaceGraph, WorkspaceGraphNode, WorkspaceGraphRef, WorkspaceGraphActionHint, WorkspaceGraphBoundary, WorkspaceGraphSearchResult, WorkspaceGraphPath, WorkspaceGraphNodeDetail, and WorkspaceGraphCompareSummary.

Prefer bounded graph calls for product UI:

const facade = createDraftlineHostFacade({ workspacePath });

const overview = await facade.workspaceGraphOverview({
  max_nodes: 80,
  recent_nodes: 40,
});
const refs = await facade.workspaceGraphRefs();
const focus = await facade.workspaceGraphNeighborhood(versionId, 2);

Use workspaceGraphRefs for cheap ref/badge refreshes, overview or workspaceGraphForVariation for default panels, and workspaceGraphAroundVersion, workspaceGraphNeighborhood, searchWorkspaceGraph, workspaceGraphPath, and workspaceGraphCommonAncestor for focused expansion. Reserve the full workspaceGraph call for explicit expanded history views.

Treat graph node IDs as opaque. Use the path/common-ancestor helpers for graph relationships instead of parsing IDs. Bounded results can be partial; use was_pruned, has_more, next_cursor, and each node's boundary fields to render hidden edges. Layout hints are advisory for stable rendering within a graph snapshot. Node and ref action_hints include stable action IDs, command names, workspace-switch/version-creating flags, and a disabled_reason when an action is unsafe.

Build from the repository root:

npm run client:build