KSLModelBundle

The service-provider interface for a self-describing KSL model bundle.

A bundle is a JAR containing one or more KSLBundledModel instances plus the metadata needed to discover, identify, and version them. Bundles are discovered at runtime via java.util.ServiceLoader against this interface; the corresponding registration lives at META-INF/services/ksl.app.bundle.KSLModelBundle inside the JAR.

This interface is GUI-agnostic by design. The four Swing apps are the first consumer, but the same surface is intended to be consumed by a future REST/gRPC host, an MCP server for agent-callable simulation, and a CLI scripting host. Bundle metadata therefore never carries presentation hints (icons, themes, layout); such concerns live in per-consumer sidecars.

Optional metadata (author, homepage, license, tags, recipesFor) has defaulted implementations so the SPI may grow in a backward-compatible fashion: new optional members are added with safe defaults, allowing existing bundle implementations to compile unchanged.

Properties

Link copied to clipboard
open val author: String?

Optional. Bundle author name or organisation.

Link copied to clipboard
abstract val bundleId: String

Globally unique stable identifier for this bundle. Authors are encouraged to use a reverse-DNS-flavoured string (e.g. edu.uark.examples.queueing-101). Used as the persistent key in recent-bundles lists, the on-disk cache layout, and any future catalog index.

Link copied to clipboard
abstract val description: String

Short description, typically two or three sentences.

Link copied to clipboard
abstract val displayName: String

Human-readable name shown in bundle pickers.

Link copied to clipboard
open val homepage: String?

Optional. URL pointing to the bundle's project page or documentation.

Link copied to clipboard
abstract val kslApiVersion: String

The major.minor version of the KSL API the bundle was built against. Loaders may refuse to load (or warn on) a bundle whose kslApiVersion is incompatible with the running KSL build. This is the bundle-level compatibility surface; the descriptor JSON carries its own schema version independently.

Link copied to clipboard
open val license: String?

Optional. License identifier (e.g. an SPDX identifier such as "MIT").

Link copied to clipboard
abstract val models: List<KSLBundledModel>

The models packaged in this bundle. Building this list must not instantiate ksl.simulation.Model objects — that work is deferred to each KSLBundledModel.builder().

Link copied to clipboard
open val tags: Set<String>

Optional. Free-form tags for cataloging and search.

Link copied to clipboard
abstract val version: String

Bundle-author's own version of this bundle's content. Independent of kslApiVersion. Semver is encouraged but not enforced.

Functions

Link copied to clipboard
open fun recipesFor(modelId: String): List<KSLConfigRecipe>

Returns the author-curated KSLConfigRecipe instances for the given model. Default: empty list.