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

@p31/cognitive-passport-schema

v1.1.0

Published

Cognitive Passport schema — W3C VC-aligned sovereign identity credential for P31

Readme

Cognitive Passport Schema

Version: 1.1.0 License: AGPL-3.0 Status: Production-ready


Overview

The Cognitive Passport is a W3C VC-aligned credential schema for sovereign identity. It captures human-readable accommodation summaries and machine-readable style/role/AI-context blocks that drive personalization across P31 surfaces.

This schema is the source of truth for Cognitive Passport documents. It is:

  • W3C VC 2.0/2.1 aligned — compatible with EUDI Wallet framework
  • Forward-compatible — v1.1.0 is an additive overlay on v1.0.0
  • Machine-readable — drives AI tools, theme engines, and bus bar navigation
  • Human-readable — captures identity, cognition, communication, and accessibility preferences

Schema Structure

{
  "$schema": "p31.cognitivePassport/1.1.0",
  "identity": { ... },
  "cognition": { ... },
  "communication": { ... },
  "accessibility": { ... },
  "stylePreferences": { ... },
  "context": { ... }
}

Blocks (all optional)

| Block | Purpose | Drives | |-------|---------|--------| | identity | Self-description (name, pronouns, role, access level) | Bus bar nav, AI context | | cognition | Processing style, learning preferences, strengths/challenges | AI tools | | communication | Tone, response length, format preferences | PHOS guide register | | accessibility | Screen comfort, motion, contrast, font size, density | p31SubjectPrefs | | stylePreferences | Theme, mode, appearance, glass, animations | p31Theme engine | | context | Current focus, tools used, domain, notes | AI context export |


Usage

As a JSON Schema

{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://p31ca.org/schema/cognitive-passport-v1-1.schema.json",
  "type": "object"
}

In Code

import schema from './spec/cognitive-passport-v1-1.schema.json';

// Validate a passport document
function validatePassport(doc: unknown): boolean {
  // Use AJV or similar JSON Schema validator
  const ajv = new Ajv();
  const validate = ajv.compile(schema);
  return validate(doc);
}

As a W3C VC Credential

The Cognitive Passport can be exported as a W3C Verifiable Credential:

{
  "@context": [
    "https://www.w3.org/2018/credentials/v1",
    "https://www.w3.org/2018/credentials/v2"
  ],
  "type": ["VerifiableCredential", "CognitivePassportCredential"],
  "issuer": "did:key:z6Mk...",
  "credentialSubject": {
    "id": "did:key:z6Mk...",
    "identity": { ... },
    "cognition": { ... },
    "accessibility": { ... }
  }
}

Additivity

All v1.1.0 fields are optional. A v1.0.0 document that omits every v1.1.0 block validates against this schema unchanged.

This means:

  • Existing v1.0.0 documents remain valid
  • New documents can adopt v1.1.0 incrementally
  • Readers gracefully degrade when v1.1.0 blocks are absent

Integration Points

| Surface | Consumes | Drives | |---------|----------|--------| | Bus Bar | identity.accessLevel | Navigation slots | | PHOS Guide | communication.preferredTone + stylePreferences.phosRegister | Greeting/hint/fallback verbosity | | Theme Engine | stylePreferences.theme/mode/appearance | window.p31Theme.setTheme() | | Subject Prefs | accessibility.* | window.p31SubjectPrefs.set() | | AI Context | context.currentFocus/toolsUsed/domain | Copy-for-LLM export buttons |


VC 2.1 Alignment

This schema is forward-compatible with W3C VC Data Model 2.1:

  • Uses @context v1 + v2 URIs
  • Supports validFrom / validUntil timestamps
  • Compatible with StatusList2021 revocation
  • Ready for EUDI Wallet import (December 2026 deadline)

Publishing

npm

npm publish @p31/cognitive-passport-schema

GitHub

git remote add origin https://github.com/p31labs/cognitive-passport-schema.git
git push -u origin main

License

AGPL-3.0 — See LICENSE for details.