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

@xtalpi/science-manual-service-sdk

v0.0.1

Published

Validation and normalization SDK for XtalPi Science manual services.

Readme

@xtalpi/science-manual-service-sdk

XtalPi Science 人工服务输入校验与规范化 SDK。

当前初始化版本支持以下服务类型:

library_design
library_synthesis_quote

本包保持为纯 TypeScript 领域包,不依赖 NestJS、TypeORM、Space App Entity、数据库或 OSS。

安装

pnpm add @xtalpi/science-manual-service-sdk

使用

import { ManualServiceSdk } from '@xtalpi/science-manual-service-sdk';

const sdk = new ManualServiceSdk();

const result = await sdk.validateAndNormalizeInput({
  serviceType: 'library_design',
  parameters: {
    entry_mode: 'scaffold_bb',
  },
});

SDK 支持库设计和库合成报价的服务专属字段校验、默认值补齐、错误明细和输入规范化。

库合成报价可通过可选 context 校验候选数据集及候选分子归属:

const result = await sdk.validateAndNormalizeInput({
  serviceType: 'library_synthesis_quote',
  parameters: {
    candidate_dataset_id: 'ds_enumeration_002',
    items: [
      {
        record_id: 'Q001',
        molecule_id: 'mol_001',
        amount_mg: 10,
      },
    ],
  },
  context: {
    candidateDatasets: [
      {
        dataset_id: 'ds_enumeration_002',
        candidates: [{ molecule_id: 'mol_001' }],
      },
    ],
  },
});
  • 不传 context 时只执行字段格式校验,不校验数据集存在性和分子归属。
  • 传入空的 candidateDatasets 表示调用方已查询,但没有可用候选数据集。
  • candidateDatasets 由调用方根据 Tenant、Owner、来源 Request、完成状态和可用状态查询后传入;SDK 不访问数据库或鉴权上下文。
  • SDK 使用 dataset_id 匹配 candidate_dataset_id,使用 candidates[].molecule_id 校验 items[].molecule_id,不使用 record_id 替代候选分子标识。

开发

pnpm typecheck
pnpm test
pnpm build
pnpm check

构建产物同时支持:

  • ESM:dist/esm/index.js
  • CommonJS:dist/cjs/index.cjs
  • TypeScript 类型声明:dist/esm/index.d.ts

执行 pnpm publish 前会通过 prepublishOnly 自动运行类型检查、测试和构建。