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

@continuum-dev/adapters

v0.1.1

Published

Protocol adapters for the Continuum continuity runtime

Readme

@continuum/adapters

Protocol adapter layer for the Continuum SDK.

Transforms external UI schema formats into Continuum's ViewDefinition and NodeValue shapes. Ships with a built-in adapter for Google's A2UI (Agent-to-User Interface) protocol.

Installation

npm install @continuum/adapters

ProtocolAdapter Interface

interface ProtocolAdapter<TExternalView, TExternalData = unknown> {
  name: string;
  toView(external: TExternalView): ViewDefinition;
  fromView?(snapshot: ViewDefinition): TExternalView;
  toState?(externalData: TExternalData): Record<string, NodeValue>;
  fromState?(state: Record<string, NodeValue>): TExternalData;
}

| Method | Required | Description | |---|---|---| | name | yes | Identifier for this adapter (for example, a2ui) | | toView | yes | Convert external view format into a ViewDefinition | | fromView | no | Convert a ViewDefinition back to external format | | toState | no | Convert external data payload into Continuum NodeValue map | | fromState | no | Convert Continuum state map back to external data format |

Built-in: A2UI Adapter

a2uiAdapter transforms Google A2UI JSON into Continuum nodes.

import { a2uiAdapter } from '@continuum/adapters';

const view = a2uiAdapter.toView({
  id: 'my-form',
  version: '1.0',
  fields: [
    { name: 'email', type: 'TextInput', label: 'Email' },
    { name: 'agree', type: 'Switch', label: 'I Agree' },
  ],
});

// Use with a session
session.pushView(view);

Type Mapping

| A2UI Type | Continuum Node Type | dataType | |---|---|---| | TextInput | field | string | | TextArea | field | string | | Dropdown | field | string | | SelectionInput | field | string | | Switch | field | boolean | | Toggle | field | boolean | | DateInput | field | string | | Section | group | n/a | | Card | group | n/a | | unknown | field | string |

A2UI Types

interface A2UIForm {
  id?: string;
  version?: string;
  title?: string;
  fields: A2UIField[];
}

interface A2UIField {
  name?: string;
  type: A2UIFieldType | string;
  label?: string;
  options?: A2UIOption[];
  fields?: A2UIField[];
}

interface A2UIOption {
  id: string;
  label: string;
}

type A2UIFieldType =
  | 'TextInput'
  | 'TextArea'
  | 'Dropdown'
  | 'SelectionInput'
  | 'Switch'
  | 'Toggle'
  | 'DateInput'
  | 'Section'
  | 'Card';

Round-trip

const form: A2UIForm = { fields: [{ name: 'email', type: 'TextInput' }] };

const view = a2uiAdapter.toView(form);
const backToForm = a2uiAdapter.fromView(view);

const state = a2uiAdapter.toState({ email: '[email protected]', agree: true });
const backToData = a2uiAdapter.fromState(state);

Utility Exports

createDefaultNodeValue(dataType)

Returns a default NodeValue value for the provided data type.

createDefaultNodeValue('boolean'); // { value: false }
createDefaultNodeValue('number'); // { value: 0 }
createDefaultNodeValue('string'); // { value: '' }
createDefaultNodeValue('any-unknown'); // { value: '' }

valueForDataType

Alias for createDefaultNodeValue.

const defaultValue = valueForDataType('number');

Writing a Custom Adapter

import type { ProtocolAdapter } from '@continuum/adapters';
import type { ViewDefinition, NodeValue } from '@continuum/contract';

interface MyFormat {
  widgets: { uid: string; kind: string }[];
}

export const myAdapter: ProtocolAdapter<MyFormat> = {
  name: 'my-protocol',

  toView(external: MyFormat): ViewDefinition {
    return {
      viewId: 'my-app',
      version: '1.0',
      nodes: external.widgets.map((w) => ({
        id: w.uid,
        type: 'field',
        key: w.uid,
        dataType: 'string',
      })),
    };
  },
};

Links