libraryPackage manifestv2.0.4

lib.cli-runtime

Deterministic command-pack discovery and registration for ContractSpec CLI hosts

@lssm-tech/lib.cli-runtime
Source, release and verification context

Source snapshot bcc79fcc · Declared package version 2.0.4. This page combines the checked-in package guide and manifest; commands and runtime behavior were not executed in this review.

Package source ↗ Manifest ↗
servernode
EXPLORE THE PACKAGE

See where this package fits.

Follow a declared connection, inspect an import, then open the source guide when you need the detail.

THIS PACKAGElib.cli-runtimeplatform

Arrows point from a package to its direct dependency. Each count is derived from the captured manifests.

23 déclarations · les 6 premières affichéesSELECT TO INSPECT

@lssm-tech/lib.cli-runtime

Deterministic command-pack discovery and registration for ContractSpec CLI hosts.

./workspace/analysis, ./workspace/types, and ./workspace/formatters provide the canonical source scanner, authoring path conventions, structure validator, spec data types, and Markdown/DocBlock rendering used by CLI packs. The analysis leaf also owns the existing semantic diff, snapshot, impact classification, and static DocBlock manifest extraction closure. These implementations retain the original workspace behavior; the TypeScript AST supplier reaches them through the typescript runtime port (see below). @lssm-tech/module.workspace forwards its existing exports to the same files. Use the explicit leaf exports when a consumer needs only parsing or rendering.

The runtime inspects only the consumer's direct dependencies and optionalDependencies. A package participates by declaring contractspec.commandPack metadata in its published package.json.

JSON
{
  "contractspec": {
    "commandPack": {
      "entry": "./dist/command-pack.js",
      "spec": {
        "schemaVersion": 1,
        "id": "contractspec-ai",
        "version": "1.0.0",
        "commands": ["agent", "chat", "llm", "mcp", "vibe"],
        "extends": ["build", "create", "validate"]
      }
    }
  }
}

discoverCommandPacks() applies .contractsrc include and exclude controls; exclusion wins. loadCommandPacks() loads every selected pack before registration, and registerCommandPacks() rejects command conflicts before any pack mutates the Commander program. Package-name ordering makes discovery and registration deterministic.

Utiliser createMissingCommandPackDiagnostic() to render an actionable install hint for known optional commands.

./host-program owns neutral Commander assembly. createCoreHostProgram() accepts explicit identity, core/inline registration, optional hints, and help bindings. createHostProgram() preserves that order, then discovers and loads direct dependency packs, rejects conflicts through the existing registration runtime, and reapplies host help after registration. Concrete command handlers, providers, version lookup, and parsing remain host/composition responsibilities. The existing CLI createCoreProgram() and createProgram(options) signatures remain compatible wrappers over this shared implementation.

./host-command-packs binds concrete registrations to one Commander program. Higher composers call bindHostCommandPackRegistrations() once; optional packs call registerHostCommandPack() with their exact pack ID. Missing/inherited bindings and rebinding are rejected when no portable declaration callback is supplied. Portable packs retain complete registration and help without a composer. Their action callbacks resolve explicitly bound, per-program actions only when selected; missing actions fail with missingHostBinding. The per-program binding store is process-shared, so a self-contained host bundle and separately installed packs observe the same bindings. Concrete registrations belong to higher composers, never to this generic runtime.

./inline-ai-dependencies owns the shared per-program mutable AI dependency object. Higher hosts retain complete structural dependency types and forward configuration synchronously. Existing command callbacks keep the same object and observe later bindings; lookup neither discovers nor invokes a supplier. Its state is process-shared across bundled and installed runtime copies.

Generic host ports

./ports/fs and ./ports/logger expose the canonical filesystem and logger interface closure previously owned by the workspace bundle. These type-only entries preserve the complete existing method and optional-property shapes without loading Commander. The generic concrete adapters and complete adapter aggregate now live in the ./workspace entries; product composition remains higher.

./ports/runtime holds the three runtime ports through which this package reaches suppliers it does not depend on:

Port Used by Supplier the CLI composer binds
typescript DocBlock analysis (extractModuleDocData, analyzePackageDocBlocks, buildPackageDocManifest, evaluateExpression, collectLocalValues), and through it analyzeWorkspaceDocBlocks and the docs-service loaders (loadAuthoredDocBlocksFromSourceFiles, loadPackageAuthoredDocBlocks) behind the doctor and CI docs checks; the Node fallback of loadAuthoredModule @lssm-tech/lib.typescript-runtime (its module namespace satisfies the port)
environment generateWorkspaceEnvExample, generateTargetEnvExample resolveEnvironmentForTarget and buildEnvExample from @lssm-tech/integration.runtime/environment
connectChannel createConnectControlPlaneRuntime when no channel is passed @lssm-tech/integration.runtime/channel

@lssm-tech/bundle.workspace binds all three when its root entry is imported and whenever it creates a program, so every ContractSpec CLI host (contractspec, sdd, the app CLI) and every library host of that bundle (the VS Code extension, the JetBrains bridge) is covered. Other programmatic callers, including direct callers of the @lssm-tech/module.workspace DocBlock analysis forwards, bind them first:

ts
import { bindCliRuntimePorts } from '@lssm-tech/lib.cli-runtime/ports/runtime';
import * as typescript from '@lssm-tech/lib.typescript-runtime';

bindCliRuntimePorts({ typescript });

An unbound port throws CliRuntimePortError (code: 'missingHostBinding') naming the port and its consumer. Bindings are process-shared, so a bundled host copy and separately installed command packs see the same suppliers. Any code in the process can rebind a port, so governance-critical callers such as the Connect hook pass the channel to createConnectControlPlaneRuntime explicitly.

Shared command helper compatibility

The additive ./connect/io and ./utils/errors entries own the existing CLI stdin, actor-reference, argument-validation, verdict-exit-code and error-message helpers. Their signatures, explicit environment keys and error behavior are unchanged. The workspace CLI's previous paths forward to these same functions. Moving these helpers does not authorize Connect decisions or runtime effects.

The narrow ./workspace/detection, ./utils/config, ./logging/application and ./connect/catalog-fetch entries retain the existing concrete workspace detection, config precedence, logger identities and explicit catalog fetch behavior. ./example-catalog/registry supplies metadata-only discovery through the original Foundation ExampleRegistry class, and ./example-catalog/stub (createExampleStubPlan) plans the lightweight .contractspec/examples/<key> manifest/README stub that hosts write. Runnable examples and preview imports stay in examples/registry; production command discovery loads only the generated literals. scripts/generate-example-registry.ts owns those literals and writes them to this canonical owner, while retaining the preview outputs in the example registry. No catalog entries have changed in this relocation.

./workspace/templates/defaults (generateDefaultSpecContent) owns the default scaffold for every file-posture authoring target. The CLI create command, the IDE wizards and the MCP contracts.create tool share it; bundle.workspace re-exports it. Each scaffold parses as TypeScript and passes validateSpecStructure (the presentation scaffold still uses the legacy content block). ./workspace/templates/visual-scenario.template owns generateVisualScenarioSpec; module.workspace forwards to it.

Workspace authoring runtime ownership

Compatibility: generic concrete Node filesystem/git/watcher/logger adapters, authored-module loading, discovery and deterministic authoring services move into ./workspace lower entries. Existing bundle entries forward to those same implementations and preserve defaults and signatures. No provider or product command composition moves into this closure. Scanner and render dependencies must use the canonical lower source owner; no module or bundle back-edge is admitted. Source migration requires source-bound adoption and affected-consumer qualification before acceptance.

The generic setup managed-Markdown helpers, AGENTS/usage targets and config generators also use the lower ./workspace/services/setup owner. Compatibility forwards preserve markers, user-owned content, package/workspace scope and emitted guidance byte-for-byte. The schema reference remains relative to explicitly supplied configRoot/workspaceRoot and names the existing contractspec package artifact; relocation adds no source or generated-schema fallback.

./workspace/services/connect (also ./workspace/services/connect/index) owns Connect host-hook run modes: run-mode resolution from the host permission mode, connect.runModes and operator grants (run-mode), action criticality grading with operator-only path and shell-command detection (run-mode-criticality), and the worktree-bound grant store (run-mode-grant). Generated AGENTS/usage guidance tells agents that connect mode set|clear and hook settings are operator-only.

./workspace-services/llm/index and ./workspace-services/vibe/index own the original reusable LLM authoring and workflow services. ./authoring-mcp/* owns the original contracts, CLI, documentation, and internal MCP builders and transport helpers. Existing workspace and library bundle imports forward to these same functions and registries. Concrete AI providers, command actions, and environment-bound operation clients remain in their integration owners.

Portable filesystem and logging contracts now have one canonical owner in @lssm-tech/lib.utils-typescript/ports/fs and /ports/logger. Their complete interfaces are unchanged. Existing CLI /ports/fs and /ports/logger imports remain compatible type exports; Builder delivery uses the portable contracts directly and no longer depends on the CLI host.

Adoption catalog selection ignores version build metadata when comparing release precedence. For the same release, registry, installed, local mirror, and embedded candidates retain their existing source priority. Inventory digests, hash validation, split-brain detection, and stale diagnostics remain unchanged.

The Node filesystem adapter schedules overlapping glob traversals in FIFO order when running under Bun on Windows. Each adapter owns its queue; patterns, options, sorted discovery results and rejection values remain unchanged. Node and other platforms retain concurrent traversal. This bounds overlapping native filesystem traversal without narrowing workspace discovery.

Declared capabilities.

Lib Cli Runtime

Deterministic command-pack discovery and registration for ContractSpec CLI hosts

Use it to

  • Adopt deterministic command-pack discovery and registration for contractspec cli hosts

Requires

  • TypeScript

Choose another boundary when

  • The @lssm-tech/lib.cli-runtime package constraints do not match the target runtime or platform.

@lssm-tech/lib.cli-runtime

@lssm-tech/lib.cli-runtime/command-pack

@lssm-tech/lib.cli-runtime/command-pack-discovery

@lssm-tech/lib.cli-runtime/command-pack-registration

@lssm-tech/lib.cli-runtime/command-pack-types

@lssm-tech/lib.cli-runtime/host-programcreateCoreHostProgram, createHostProgram

@lssm-tech/lib.cli-runtime/inline-ai-dependenciesconfigureInlineAiDependencies, configureInlineSnapshotClient, getInlineAiDependencies

@lssm-tech/lib.cli-runtime/ports/fs

@lssm-tech/lib.cli-runtime/ports/logger

@lssm-tech/lib.cli-runtime/connect/io

@lssm-tech/lib.cli-runtime/utils/errors

@lssm-tech/lib.cli-runtime/workspace/detection

@lssm-tech/lib.cli-runtime/utils/config

@lssm-tech/lib.cli-runtime/logging/application

@lssm-tech/lib.cli-runtime/connect/catalog-fetch

@lssm-tech/lib.cli-runtime/example-catalog/registry

@lssm-tech/lib.cli-runtime/example-catalog/builtins

@lssm-tech/lib.cli-runtime/example-catalog/stub

@lssm-tech/lib.cli-runtime/workspace/analysis

@lssm-tech/lib.cli-runtime/workspace/types

@lssm-tech/lib.cli-runtime/workspace/formatters

@lssm-tech/lib.cli-runtime/workspace/adapters

@lssm-tech/lib.cli-runtime/workspace/adapters/factory

@lssm-tech/lib.cli-runtime/workspace/adapters/fs

@lssm-tech/lib.cli-runtime/workspace/adapters/fs.bun

@lssm-tech/lib.cli-runtime/workspace/adapters/fs.node

@lssm-tech/lib.cli-runtime/workspace/adapters/git

@lssm-tech/lib.cli-runtime/workspace/adapters/logger

@lssm-tech/lib.cli-runtime/workspace/adapters/watcher

@lssm-tech/lib.cli-runtime/workspace/authoring-types

@lssm-tech/lib.cli-runtime/workspace/ports/ai

@lssm-tech/lib.cli-runtime/workspace/ports/git

@lssm-tech/lib.cli-runtime/workspace/ports/logger

@lssm-tech/lib.cli-runtime/workspace/ports/watcher

@lssm-tech/lib.cli-runtime/workspace/services/adoption

@lssm-tech/lib.cli-runtime/workspace/services/adoption/catalog

@lssm-tech/lib.cli-runtime/workspace/services/adoption/catalog-core

@lssm-tech/lib.cli-runtime/workspace/services/adoption/catalog-entry

@lssm-tech/lib.cli-runtime/workspace/services/adoption/catalog-loader

@lssm-tech/lib.cli-runtime/workspace/services/adoption/catalog-mirror

@lssm-tech/lib.cli-runtime/workspace/services/adoption/catalog-runtime

@lssm-tech/lib.cli-runtime/workspace/services/adoption/catalog-shared

@lssm-tech/lib.cli-runtime/workspace/services/adoption/catalog-solutions

@lssm-tech/lib.cli-runtime/workspace/services/adoption/catalog-ui

@lssm-tech/lib.cli-runtime/workspace/services/adoption/pending-upgrades

@lssm-tech/lib.cli-runtime/workspace/services/adoption/resolve

@lssm-tech/lib.cli-runtime/workspace/services/adoption/tokens

@lssm-tech/lib.cli-runtime/workspace/services/adoption/types

@lssm-tech/lib.cli-runtime/workspace/services/adoption/workspace

@lssm-tech/lib.cli-runtime/workspace/services/adoption/workspace-scan

@lssm-tech/lib.cli-runtime/workspace/services/build

@lssm-tech/lib.cli-runtime/workspace/services/can-help

@lssm-tech/lib.cli-runtime/workspace/services/can-help/corpus

@lssm-tech/lib.cli-runtime/workspace/services/can-help/injection

@lssm-tech/lib.cli-runtime/workspace/services/can-help/leverage

@lssm-tech/lib.cli-runtime/workspace/services/can-help/metrics

@lssm-tech/lib.cli-runtime/workspace/services/can-help/query

@lssm-tech/lib.cli-runtime/workspace/services/can-help/report

@lssm-tech/lib.cli-runtime/workspace/services/can-help/types

@lssm-tech/lib.cli-runtime/workspace/services/can-help/vectorize

@lssm-tech/lib.cli-runtime/workspace/services/contractsrc-schema-ref

@lssm-tech/lib.cli-runtime/workspace/services/delete

@lssm-tech/lib.cli-runtime/workspace/services/discover

@lssm-tech/lib.cli-runtime/workspace/services/discovery-path

@lssm-tech/lib.cli-runtime/workspace/services/docs

@lssm-tech/lib.cli-runtime/workspace/services/docs/docblock-audit

@lssm-tech/lib.cli-runtime/workspace/services/docs/docs-service

@lssm-tech/lib.cli-runtime/workspace/services/drift

@lssm-tech/lib.cli-runtime/workspace/services/generate-artifacts

@lssm-tech/lib.cli-runtime/workspace/services/impact

@lssm-tech/lib.cli-runtime/workspace/services/impact/formatters

@lssm-tech/lib.cli-runtime/workspace/services/impact/impact-detection-service

@lssm-tech/lib.cli-runtime/workspace/services/impact/types

@lssm-tech/lib.cli-runtime/workspace/services/implementation/discovery

@lssm-tech/lib.cli-runtime/workspace/services/implementation/types

@lssm-tech/lib.cli-runtime/workspace/services/list

@lssm-tech/lib.cli-runtime/workspace/services/module-loader

@lssm-tech/lib.cli-runtime/workspace/services/modules/module-resolver

@lssm-tech/lib.cli-runtime/workspace/services/onboarding

@lssm-tech/lib.cli-runtime/workspace/services/onboarding/catalog

@lssm-tech/lib.cli-runtime/workspace/services/onboarding/journey

@lssm-tech/lib.cli-runtime/workspace/services/onboarding/render

@lssm-tech/lib.cli-runtime/workspace/services/onboarding/service

@lssm-tech/lib.cli-runtime/workspace/services/onboarding/types

@lssm-tech/lib.cli-runtime/workspace/services/package-scaffold

@lssm-tech/lib.cli-runtime/workspace/services/setup/config-generators

@lssm-tech/lib.cli-runtime/workspace/services/setup/file-merger

@lssm-tech/lib.cli-runtime/workspace/services/setup/gitignore

@lssm-tech/lib.cli-runtime/workspace/services/setup/managed-markdown

@lssm-tech/lib.cli-runtime/workspace/services/setup/presets

@lssm-tech/lib.cli-runtime/workspace/services/setup/targets/agents-md

@lssm-tech/lib.cli-runtime/workspace/services/setup/targets/usage-md

@lssm-tech/lib.cli-runtime/workspace/services/setup/types

@lssm-tech/lib.cli-runtime/workspace/services/update

@lssm-tech/lib.cli-runtime/workspace/services/validate/spec-validator

@lssm-tech/lib.cli-runtime/workspace/templates

@lssm-tech/lib.cli-runtime/workspace/templates/additional-contracts.template

@lssm-tech/lib.cli-runtime/workspace/templates/advanced-contracts.template

@lssm-tech/lib.cli-runtime/workspace/templates/app-config.template

@lssm-tech/lib.cli-runtime/workspace/templates/data-view.template

@lssm-tech/lib.cli-runtime/workspace/templates/data-view-renderer.template

@lssm-tech/lib.cli-runtime/workspace/templates/environment.template

@lssm-tech/lib.cli-runtime/workspace/templates/event.template

@lssm-tech/lib.cli-runtime/workspace/templates/experiment.template

@lssm-tech/lib.cli-runtime/workspace/templates/feature.template

@lssm-tech/lib.cli-runtime/workspace/templates/form.template

@lssm-tech/lib.cli-runtime/workspace/templates/handler.template

@lssm-tech/lib.cli-runtime/workspace/templates/integration.template

@lssm-tech/lib.cli-runtime/workspace/templates/knowledge.template

@lssm-tech/lib.cli-runtime/workspace/templates/migration.template

@lssm-tech/lib.cli-runtime/workspace/templates/operation.template

@lssm-tech/lib.cli-runtime/workspace/templates/presentation.template

@lssm-tech/lib.cli-runtime/workspace/templates/telemetry.template

@lssm-tech/lib.cli-runtime/workspace/templates/theme.template

@lssm-tech/lib.cli-runtime/workspace/templates/workflow.template

@lssm-tech/lib.cli-runtime/workspace/templates/workflow-devkit.template

@lssm-tech/lib.cli-runtime/workspace/templates/workflow-runner.template

@lssm-tech/lib.cli-runtime/workspace/templates/visual-scenario.template

@lssm-tech/lib.cli-runtime/workspace/templates/defaults

@lssm-tech/lib.cli-runtime/workspace/utils/filter

@lssm-tech/lib.cli-runtime/workspace/utils/workspace-manifests

Imports and export paths.

218 entries

These are package-manifest entry points. Named symbols listed above come from the capability catalogue; this is not an exhaustive TypeScript symbol reference.

218 imports · 35 affichés

@lssm-tech/lib.cli-runtime/optional-command-declarations/builder/*
./src/optional-command-declarations/builder/*.ts · source target not verified

Dependencies and related packages.

Runtime dependencies 23
@modelcontextprotocol/sdk
^1.30.0
chokidar
^5.0.0
compare-versions
catalog:data
elysia
catalog:server
glob
catalog:build
js-yaml
^5.4.0
micromatch
^4.0.8
ts-morph
^28.0.0
zod
catalog:
Peer dependencies 1
commander
catalog:server
Development dependencies 6
@types/micromatch
^4.0.10
commander
catalog:server
typescript
catalog:

Package scripts.

Commands declared by this package. Review its setup requirements before running them; no command here was executed by this review.

publish:pkgbun publish --tolerate-republish --ignore-scripts --verbose
publish:pkg:canarybun publish:pkg --tag canary
buildcontractspec-bun-build build
build:bundlecontractspec-bun-build transpile
build:typescontractspec-bun-build types
devcontractspec-bun-build dev
cleanrimraf dist .turbo
lintbun run lint:fix
lint:fixnode ../../../../scripts/biome.cjs check --write .
lint:checknode ../../../../scripts/biome.cjs check .
testbun test
prebuildcontractspec-bun-build prebuild
typechecktsgo --noEmit
Votre vue

Make room for your context.

Shape the presentation around this moment. You can change it whenever you need.

Votre contexte

The different parts of you

Choose a starting point

Un mélange utile de contexte, de visuels et de guidage discret.

Tune each dimension
Each dimension can change independently. Product permissions and available actions stay unchanged.

Support the way you begin and return

Tune your support

Confort de lecture

Choisir votre langue

La langue de l’interface change uniquement le texte. Les marchés, les prix et les parcours conservent leurs propres paramètres.

Couverture des traductions

Une partie du contenu est affichée en anglais.

Navigation151
Graphe616
Catégories378
Portfolio833
Exemples2 035
Aperçu de la source1 542

D’autres traductions seront ajoutées à mesure que le contenu sera relu.

Cette préférence est enregistrée dans ce navigateur.

Rechercher sur le site

Des points de départ utiles

Aucun résultat. Essayez une expression plus courte, un nom d’opération ou un autre périmètre de recherche.

UN PEU DE PLACE POUR EXPLORER

Trouvez quelque chose à explorer.

Ouvrez un aperçu détaillé sur cette page, essayez une autre perspective ou suivez le détail vers sa propre page.

Fonctionnement des aperçus et des commandes
01

Regarder avant de partir

Survolez un lien ou sélectionnez-le avec Tab pour voir un aperçu. Cliquer sur le lien d’origine ou appuyer sur Entrée ouvre toujours sa destination.

02

Rester dans le contexte

Entrez dans l’aperçu pour explorer ses sections. Depuis un lien sélectionné, utilisez Alt + ↓ pour y entrer au clavier. Échap le ferme.

03

Ouvrir les possibilités

Les lignes dépliables, les choix de perspective et les commandes mises en évidence révèlent davantage. Votre vue adapte le confort de lecture et le contexte exploré.

Un bouton séparé pour voir de plus près

Affichez de petits boutons d’aperçu à côté des liens quand l’espace le permet. Touchez l’œil pour examiner ou le lien pour y aller directement. Ce choix reste dans cet onglet.

Aucun historique de navigation n’est collecté. La réduction des animations suit votre appareil et Votre vue.