github hashintel/hash @hashintel/petrinaut-core@0.0.5

latest releases: @blockprotocol/graph@0.5.1, @hashintel/refractive@0.0.5, @blockprotocol/type-system@0.2.3...
3 hours ago

Patch Changes

  • Scenarios can store an ad-hoc definition (initialState.type: "adhoc") that compiles to a generated code-mode scenario and optimization bindings. An LSP session type-checks its value expressions, and bundled example scenarios are editable this way. (@kube, #9284)

  • Transition kernels, lambdas and differential equations can be written as a bare function body ending in return. The export default module form still works. (@kube, #9370)

  • Add in-browser optimization that runs Optuna in a Pyodide worker, downloaded from jsDelivr and PyPI unless pyodide.indexURL says otherwise. The ./optimization entry adds parseOptimizationManifest, isUnknownOptimizationRunError and PETRINAUT_OPTIMIZATION_UNKNOWN_RUN_ERROR_CODE, and the main entry adds createReadableStore. (@kube, #9515)

  • Expose explicit browser and headless diagnostics for captured definitions, and start document observation only when subscribed. (@lunelson, #9667)

  • Add a command registry for host-rendered command palettes: createCommandRegistry and combineCommandRegistries in core, and CommandRegistryProvider, useCommand, useCommands and formatShortcutKeys in @hashintel/petrinaut/react. (@kube, #9457)

  • The layout module exports canvas geometry: compactNodeDimensions, classicNodeDimensions, getComponentInstanceHeight, getBoundsOfCenteredBoxes, getMinZoomForBounds and ZOOM_PADDING. Classic places are 104 × 104 and classic transitions 180 × 60. (@kube, #9352)

  • Register the createExperiment AI tool with its validated request schema. (@kube, #9678)

  • State constraint expressions accept a trailing semicolon and no explicit return, and a constraint with separate statements reports the missing return. (@kube, #9725)

  • Add the @hashintel/petrinaut-core/experiments entry point with an ExperimentBackend interface, a worker-pool backend and selectExperimentBackend. ExperimentRequest accepts per-run overrides in runs. (@kube, #9178)

  • createJsonDocHandle accepts SDCPNInput, a loose authoring form of SDCPN whose omitted extension fields the new normalizeSDCPN fills with defaults. Both are exported from the package root. (@kube, #8926)

  • File import defaults a place's colorId, dynamicsEnabled and differentialEquationId, and an arc's weight, instead of rejecting a file that omits them. (@kube, #9715)

  • Transitions with weighted coloured input arcs, or with lambdas that read no tokens, do far less work per frame. Trajectories are unchanged for every seed. (@kube, #9386)

  • Metric specs can sample every run that has not errored with sampleRuns: "notErrored". (@kube, #9685)

  • Add constraint margin and state-indicator evaluators, an optional manifest constraintPolicy, and aggregateTime support in getRunValues. (@kube, #9604)

  • Export PetrinautOptimizationDirection, the objective's maximize | minimize union, from the package root and the /optimization entry. (@kube, #9653)

  • Experiments split their runs across Web Workers, one per logical core minus one, with identical results at any worker count. experimentShardCount on ExperimentsProvider and shardCount on createMonteCarloExperiment cap the parallelism. (@kube, #9162)

  • Removes petrinautAiPrompt; hosts compose their own system prompt from petrinautAiCapabilityGuidance or its parts, petrinautAiCapabilitySections. (@kube, #9949)

  • selectionItemTypes and canonicalizeSelection are available from the dependency-free @hashintel/petrinaut-core/selection entry, so hosts can validate selections from a URL or request. (@kube, #9426)

  • Export petrinautDiagnosticsContextMessageId, the id of the diagnostics message the assistant appends after client tool results. (@lunelson, #9854)

  • Adds hashPetrinautDocument, a structural hash of a net that ignores the order of object keys and can leave out layout and other non-semantic parts. (@kube, #9935)

  • Entity, net and subnet ids are UUIDs: documents with other ids get stable UUIDs when they load, older ids still resolve, and petrinautIdSchema validates and converts an id field. (@kube, #9958)

  • Places can declare a maximum token capacity, and a transition cannot fire if it would take an output place over capacity. (@kube, #9177)

  • An AI edit that leaves the document unchanged is reported as not applied. (@lunelson, #9537)

  • Net identifiers named after Object.prototype members, such as __proto__, are rejected at import and before simulation. Place visualizer code runs under the same sandbox as scenario code. (@kube, #9222)

  • Mark Space as the default starting place in the Probabilistic Satellite Launcher example. (@kube, #9764)

  • Scenario code runs in an interpreter instead of new Function, and is stricter: == is strict, conditions take booleans, unknown place names are errors, and only .map, .reduce and .concat array methods are available. (@kube, #9332)

  • SDCPN elements accept an optional description, and transitions, subnets, component instances and the net root accept an optional host-defined metadata record of JSON values. (@CiaranMn, #9484)

  • The AI assistant's documentation adds the ad-hoc scenarios, Preview, code editor and simulation panel guides, and describes snapshot validation and its diagnostics. (@kube, #9723)

  • Distribution frames carry the extent of their bins. (@kube, #9478)

  • Optimization trials run their seeded replicates in parallel, and the CLI's --threads <n> bounds the number of workers. (@kube, #9358)

  • Add validated experiment request and result schemas and a runExperiment host interface for up to 100,000 runs. (@kube, #9676)

  • Add the Vaccination Campaign example, an SIR model with vaccination and contact reduction built for optimization demos. (@kube, #9516)

  • Reject arc creation when the referenced transition does not exist instead of treating it as an unchanged mutation. (@lunelson, #9722)

  • Add a WebGPU backend for experiments that matches the CPU engine's semantics and falls back to the CPU for nets it cannot run. A Compilation panel shows the compiled conditions, kernels and equations. (@kube, #9179)

  • Nets and optimization manifests can be imported and exported in YAML and JSON. (@kube, #9379)

Don't miss a new hash release

NewReleases is sending notifications on new releases.