npm.io
2.17.0 • Published 2 weeks ago

@x12i/graphenix-authoring-analysis

Licence
MIT
Version
2.17.0
Deps
4
Size
70 kB
Vulns
0
Weekly
0

@x12i/graphenix-authoring-analysis

Studio-facing save/import analysis for the Graphenix authoring phase:

  • GraphProjectDocument envelope validation (graphenix.project/v1)
  • Authoring graph purity — rejects sidecars and forbidden embeds on persist
  • Model config merge-on-save — partial editor drafts → complete profileChoice shapes

Design-time CRUD and base validators remain in @x12i/graphenix-authoring-format.

v1.2.0: mergeModelConfigForPersist and related merge helpers re-export from @x12i/graphenix-authoring-format (canonical model-config module). This package owns envelope validation and save-time graph purity only.

v1.1.0: No supported public legacy-import API.

Install

npm install @x12i/graphenix-authoring-analysis@^1.2.0 \
  @x12i/graphenix-authoring-format@^1.2.0 \
  @x12i/graphenix-executable-contracts@^1.1.0 \
  @x12i/graphenix-core@^2.3.0

Quick start

import {
  createGraphProjectReference,
  validateGraphProject,
  mergeModelConfigForPersist,
  applyModelConfigMergeToGraph,
  stripAuthoringGraphForPersist
} from "@x12i/graphenix-authoring-analysis";

const project = createGraphProjectReference();
const saveCheck = validateGraphProject(project);
if (!saveCheck.valid) throw new Error(saveCheck.errors[0]?.message);

const { graphModelConfig, nodeModelConfigs } = mergeModelConfigForPersist(
  {
    preActionModel: "cheap/default",
    skillModel: "pro/default",
    postActionModel: "cheap/default"
  },
  { "node:research:audience": { skillModel: "cheap/default" } }
);

const graphForSave = stripAuthoringGraphForPersist(
  applyModelConfigMergeToGraph(project.graph, graphModelConfig, nodeModelConfigs)
);

APIs

API Purpose
validateGraphProject Catalox graphs row save validation
validateAuthoringGraphForPersist Stricter authoring graph check (no sidecars)
stripAuthoringGraphForPersist Remove forbidden embeds before save
stripAuthoringGraphForExport Persist strip + remove node.layout for JSON tab
mergeModelConfigForPersist Re-export from authoring-format — merge partial editor state for persist
createGraphProjectReference Reference fixture (content-pipeline + concept)

Docs

See docs/format/guides/ for envelope, purity, and model-config semantics.

  • @x12i/graphenix-authoring-format — design-time validation and CRUD
  • @x12i/graphenix-executable-contracts — shared types including GraphProjectDocument
  • @x12i/graphenix-execute-envelope — Run-time execute request adapter

Keywords