Overview

What a field pack is

A field pack is a versioned bundle of built-in semantic field types for the global NT² catalog:

LayerContentsRuns where
Data packFieldTypeDefinition rows, capabilities, manifest slicePublished field-registry resolver, Workers-safe validation, CBF encode/decode
Runtime pack (optional)Svelte editors, validators, formattersNT² Vault in-process via FieldPackHost

Field packs are not:

  • Category template packs — templates only compose existing FieldTypeIds
  • Micro-apps — no iframe, no user install from URL
  • User-defined field types
  • Runtime-downloadable plugins — code ships only through an audited NT² Vault release after review

Why separate open repositories

Domain packs live in open-source Git repositories. NT² maintainers pin audited commits when integrating packs into a Vault release.

flowchart LR
  subgraph open["Open repos"]
    PackA["field-pack-it-assets"]
    PackB["field-pack-financial"]
    API["field-pack-api npm"]
  end
  PackA --> API
  PackB --> API
  PackA --> Release["NT² Vault release"]
  PackB --> Release

Trust model

ConcernField packMicro-app
SourceOpen Git repo → audited pinSigned .nt2app / catalog
Trust boundaryMerge on open repo + NT² release integrationUser install + iframe sandbox
Code executionSame JS context as vault (trusted)postMessage SDK only
CatalogGlobal — all users share one manifest after releasePer-user install set
Decode / syncAll shipped clients must resolve fieldIndexN/A

Normative rule: merging to the open pack repo does not ship to end users. NT² maintainers assign fieldIndex values, merge manifest rows, and ship through a Vault release.


Public API contract

Open pack repositories depend on a published thin contract package:

@nt2/field-pack-api (public npm; types + validators only)

ExportedPurpose
FieldTypeDefinition, FieldTypeId, FieldEditorKind, …Same shapes as @nt2/category-template-api field types
validateFieldDefinition(def)Pack-local CI
validateManifestSlice(slice)Slice shape; no fieldIndex in contributor slice
FIELD_PACK_API_VERSIONPeer dependency alignment

Versioning: pack package.json declares "peerDependencies": { "@nt2/field-pack-api": "^1.0.0" }. Breaking API changes require a major bump and coordinated bumps across open packs.


Open pack repository layout

One domain per repository (recommended), e.g. github.com/nt2-community/field-pack-it-assets.

field-pack-it-assets/
  LICENSE
  README.md
  CONTRIBUTING.md
  package.json
  pack.meta.json
  src/
    definitions.ts
    manifest.slice.json
    index.ts
    runtime/          # Optional — custom editors
      editors/
      register.ts
  .github/workflows/ci.yml

pack.meta.json (normative)

{
  "packId": "it-assets",
  "displayName": "IT asset fields",
  "publisher": "nt2-community",
  "maintainers": ["@org/it-assets-team"],
  "status": "incubating",
  "license": "Apache-2.0",
  "repository": "https://github.com/nt2-community/field-pack-it-assets"
}
FieldMeaning
packIdStable id; matches manifest packId
publishernt2-official or nt2-community / org slug
statusincubating | graduated — see Maturity
maintainersGitHub teams/users for open-repo review

manifest.slice.json (contributor proposal)

{
  "packId": "it-assets",
  "proposedVersion": "1.2.0",
  "rows": [
    { "fieldTypeId": "serverHostname" },
    { "fieldTypeId": "serverIpAddress" }
  ]
}

Contributors must not assign fieldIndex. NT² catalog curators append indices in the published field registry.

Naming

ArtifactConvention
packIdkebab-case, e.g. it-assets, financial
FieldTypeIdcamelCase semantic id, e.g. serverHostname — global uniqueness
Repo namefield-pack-<packId>

Contribution workflow

sequenceDiagram
  participant C as Contributor
  participant O as Open pack repo
  participant M as Pack maintainer
  participant N as NT² catalog curator

  C->>O: PR definitions tests manifest.slice
  O->>O: CI field-pack-api unit tests
  M->>O: Merge
  M->>N: Request index allocation
  N->>N: Release integration review

Open an issue on the pack repo before large additions:

  • Real-world document types covered
  • Proposed FieldTypeId list and capabilities
  • Overlap with existing types in core catalog
  • Need for custom runtime editor vs generic singleLine / date

Catalog curator responds with: approved packId, index allocation plan, reviewer assignment.

Step 2 — Open repository PR

Contributor implements definitions + tests + manifest.slice.json update. See Appendix A.

Step 3 — Release integration

After your open-repo PR merges and is tagged, open an issue on the pack repo requesting NT² release integration. External contributors typically coordinate with pack maintainers and catalog curators for this step.


Maturity: incubating vs graduated

pack.meta.json statusIn merged manifestTemplate pickerRuntime chunk in production
incubatingAfter curator mergeStaging/dev only (or hidden)Staging/dev only
graduatedYesAll environmentsAll environments

Default for new community packs: incubating until NT² signs off on UX, security, and localization.


Security rules

Field runtime code is trusted in-process — stricter than data-only packs.

RuleDetail
No eval, no dynamic import(userUrl)Static paths only
Secret fieldsSet capabilities.screenCaptureProtected, share masks via registry capabilities
DependenciesMinimize deps; new npm deps on open pack require NT² review
No network in editorsNo third-party scripts, fonts, or analytics
Crypto-adjacent typesRequire security review before release

Appendix A — Open pack PR checklist

  • New/changed FieldTypeDefinition rows with capabilities documented
  • manifest.slice.json updated — no fieldIndex
  • Unit tests pass against @nt2/field-pack-api peer range
  • No duplicate fieldTypeId within pack; RFC if near existing core types
  • pack.meta.json packId matches slice
  • Runtime code (if any) uses static import() paths only
  • docs/FIELDS.md updated for user-visible semantics
  • LICENSE file present

Field packs ship through the open pack repository and NT² release process. Contributors work entirely in public repositories.