mise API - v0.0.0
    Preparing search index...

    Module @fnndsc/salsa

    Main entry point for the Salsa library.

     ____        _
    / ___| __ _| |___ __ _
    \___ \ / _` | / __|/ _` |
    ___) | (_| | \__ \ (_| |
    |____/ \__,_|_|___/\__,_|

    Salsa Abstracts Logic Service Assets

    salsa is the logic layer of the ChRIS interface ecosystem. It encapsulates high-level business intents and operational logic, serving as the bridge between user-facing interfaces (chell, chili) and the underlying infrastructure (cumin and chrisapi).

    npm install @fnndsc/salsa
    

    Requires Node.js ≥ 20.12. Ships with TypeScript type definitions. Depends on @fnndsc/cumin.

    import { files_listAll, fileContent_get, vfsDispatcher } from "@fnndsc/salsa";

    // Salsa returns pure data / typed objects — no CLI dependencies
    const listing = await files_listAll({ limit: 1000, offset: 0 }, "files", "/home/chris");
    const content = await fileContent_get("/home/chris/uploads/notes.txt");

    See Key Modules for the full intent catalogue.

    • Consolidate Business Logic: Centralises intents such as "list directory", "upload file", "register plugin", "fetch feed note". All frontends share identical behaviour.
    • Frontend Agnostic: No CLI-specific dependencies (commander, process.stdout). Returns pure data or typed objects.
    • Virtual Filesystem: Owns the VFS dispatcher that maps ChRIS API resources onto Unix-style paths — see VFS below.
    [ ChELL (REPL) ]  [ Chili (CLI) ]  [ Web App ]  [ Mobile App ]
           |                 |               |              |
           +-----------------+---------------+              |
                             |                              |
                             v                              v
                  [      Salsa (Logic / Intents)        ]  <-- YOU ARE HERE
                             |
                             v
                  [      Cumin (State / Infrastructure) ]
                             |
                             v
                  [      @fnndsc/chrisapi (Client)      ]
    
    Function Description
    vfsDispatcher Routes list/read calls to the correct VFS provider by path prefix
    files_list List a directory (paginated)
    files_listAll Full directory listing (all pages)
    fileContent_get Read remote file content
    files_uploadPath Upload a local file or directory tree to ChRIS
    files_touch Create an empty file
    files_mkdir Create a directory
    files_rm Delete a file or directory
    files_cp / files_mv Copy / move
    Function Description
    plugins_list / plugins_listAll Fetch plugin list
    plugin_checkExists Check if a plugin is already registered
    plugin_registerWithAdmin Register a plugin via the admin endpoint
    plugin_assignToComputeResources Assign plugin to compute environments
    plugins_searchPeers Search peer ChRIS stores (e.g. cube.chrisproject.org)
    plugin_importFromStore Import a plugin from peer store data
    plugin_searchPeersByImage Resolve a Docker image to a peer-store plugin
    Function Description
    feeds_list / feeds_listAll Fetch feeds
    feedNote_get / feedNote_update Read or update the singleton note on a feed
    feedComments_list List comments on a feed
    feedComment_create / feedComment_update / feedComment_delete Comment CRUD
    Function Description
    pipelines_list List registered pipelines
    workflow_create Instantiate a pipeline as a workflow on a feed
    Function Description
    job_cancel(id) Cancel a running/scheduled instance (PUT {status: cancelled})
    job_delete(id) Delete a terminal instance record
    job_statusFetch(id) Live-fetch current status from API (bypasses cache)
    job_logFetch(id) Fetch stdout/stderr log for an instance
    procCache_refresh([feedID]) Rebuild the /proc job cache, optionally scoped to one feed

    vfsDispatcher translates a ChRIS path into a provider call. Each provider handles a path prefix and maps API resources onto filesystem semantics:

    Path prefix Provider Backed by
    /home/<user>/ HomeVfsProvider ChRIS user-file API
    /home/<user>/feeds/ FeedVfsProvider Feed resources
    /bin BinVfsProvider Registered plugins (virtual executables)
    /usr/bin UsrBinVfsProvider Built-in shell commands (whoami, whereami)
    /etc EtcVfsProvider Config files (compute.yaml, group, passwd, cube)
    /net/pacs/queries/ PacsVfsProvider PACS query results
    /proc/jobs/ ProcVfsProvider Job monitoring DAG (backed by ProcCache in cumin)
    *.chrislink resolved by dispatcher Symlinks to other ChRIS paths

    Providers implement a common interface: list(path) → Result<VFSItem[]> and read(path) → Result<string>.

    ProcVfsProvider mirrors the computation DAG of every visible feed. Each plugin instance is a directory; virtual files inside expose live status, params, and log:

    /proc/jobs/feed_123/
    ├── status ← aggregate: running | finishedSuccessfully | finishedWithError
    ├── title
    └── pl-dircopy_456/ ← type=job in VFSItem; ls -l shows colour-coded status
    ├── status ← live API fetch if non-terminal
    ├── params ← complete effective key=value run parameters, cached permanently
    ├── log ← never cached; decoded from CUBE's `raw` response
    └── pl-fshack_789/
    └── …

    The cache (ProcCache in cumin) holds flat topology maps for O(1) lookup and O(depth) path reconstruction. The daemon restores this normalized graph from an identity-scoped local checkpoint, validates visible feeds, then reconciles only new, changed, and active feeds; proc refresh explicitly runs the paginated global CUBE sweep. Terminal status persists; active status remains live. Freshness is visit-driven: revisiting a feed merges the nodes created or finished since the last visit (min_end_date from a per-feed cursor) and re-sweeps the active ones, a settled feed is re-checked at most once per ten minutes, and a /proc/jobs visit picks up feeds newer than the highest known id (walking the whole index once the roster is ten minutes old). params reads the complete PluginInstance.parameters collection, rather than instance-detail metadata. Logs remain uncached: ChELL decodes CUBE's base64/zlib-compressed PluginInstance.raw response and reads compute.logs; it never fetches from a spoke.

    npm run build
    
    npm run test
    

    MIT — part of the ChRIS Project.


    -30-

    CubeVfsDispatcher
    EtcVfsProvider
    NativeVfsProvider
    PacsVfsProvider
    VFSDispatcher
    AdminCredentials
    ConnectOptions
    ContextOptions
    CpOptions
    CubePluginRow
    DataFactsIO
    DescriptorChecked
    DicomFolderIO
    DicomFolderListing
    DicomGeometry
    DicomGray
    DicomSeriesOptions
    DicomSeriesSummary
    DicomTag
    DicomTagSet
    DicomTagsSummary
    DicomVaryingTag
    DockerAnswer
    FeedComment
    FeedCreationResult
    FeedGraph
    FeedNode
    FeedNote
    FeedShareOptions
    FileShareOptions
    FolderPathHolder
    FsItem
    GroupMember
    GroupReference
    ImageReference
    IndexDescriptor
    LocalAccount
    LocalCheck
    PeerStorePlugin
    PipelineDiagram
    PipelineDiagramArgument
    PipelineDiagramNode
    PipelineInvocationBinding
    PipelineInvocationPrepareOptions
    PipelineManifest
    PipelineManifestGetOptions
    PipelineManifestNode
    PipelineManifestParameterDefault
    PipelinePackage
    PipelineParameterDefinition
    PipelineRecord
    PipelineRunOptions
    PluginAddOptions
    PluginAddResult
    PluginExecutionResult
    PluginImportResult
    PluginIndex
    PluginInput
    PluginReadmeDocument
    PluginRegistrationData
    PluginRegistrationResponse
    PluginSearchOptions
    PreparedPipelineInvocation
    PreparedWorkflowNode
    ProcLocation
    ProcTopologyStatus
    QueryFolderNameParts
    RetrieveTask
    RetrieveWatchEvents
    SyncPlan
    SyncPlanEntry
    SyncReceipt
    SyncResult
    SyncSeams
    TarArchive
    TarFile
    ValidateFinding
    ValidateOptions
    ValidateReport
    ValidateRuleState
    VFSItem
    VFSProvider
    WorkflowResult
    DicomGrayOutcome
    DicomSeriesOrder
    DicomTagGroup
    DockerRun
    ElevationCredentials
    FeedTopologyReadiness
    GroupMembershipResult
    GroupReferenceResult
    ListingOutcome
    LocalAccountAction
    PathHolder
    PipelineReadiness
    PluginAddNote
    PluginAddOutcome
    PluginIndexSource
    ProcTopologyState
    Result
    RetrieveProgressStatus
    RetrieveStatus
    SyncGroup
    UploadAnswer
    ValidateRuleNumber
    DATA_FACTS_READER
    DICOM_HEADER_PREFIX_BYTES
    DICOM_PHI_TAGS
    DICOM_TAG_GROUPS
    dicomFolderIO_default
    docker_run
    ETC_KEEP_MS
    FEED_RECHECK_MS
    FEED_VISIT_COALESCE_MS
    POOL_WIDTH
    PROC_TAGS_PREFIX
    ROSTER_DELTA_PAGE
    ROSTER_FULL_WALK_MS
    STOOD_IN_FIELDS
    SYNC_ADD_GROUPS
    SYNC_GROUPS
    syncSeams_cube
    TRANSFER_SYNTAX_NAMES
    VALIDATE_RULES
    vfsDispatcher
    answer_standIn
    birthDate_convertToYear
    chrisRow_convertToItem
    computeNames_resolve
    computeResourceFields_get
    computeResources_list
    computeResources_listAll
    connect_do
    context_getFull
    context_getSingle
    context_set
    criteria_standIn
    dataFactsIO_build
    dataFormat_deriveFromName
    date_convertToMonth
    descriptorDrift_find
    descriptorFromImage_extract
    descriptors_checkLocal
    dicomFiles_sample
    dicomFolder_list
    dicomHeader_get
    dicomHeaderCache_clear
    dicomHeaderPrefix_get
    dicomSeries_summarize
    dicomSlice_gray
    dicomTag_find
    dicomTags_read
    dicomTags_summarize
    dictionary_formatAsCLI
    docker_isAvailable
    dockerImage_ensure
    elevation_do
    feed_create
    feed_delete
    feedCached_isSettled
    feedComment_create
    feedComment_delete
    feedComment_update
    feedComments_list
    feedDataFacts_read
    feedFields_get
    feedGraph_build
    feedGraphData_ensure
    feedInstances_ensureLoaded
    feedInstances_ensureStarted
    feedJoins_ensure
    feedMeta_ensure
    feedNote_get
    feedNote_update
    feeds_list
    feeds_listAll
    feeds_share
    feedStatus_refresh
    feedVisit_sync
    field_standIn
    fileContent_get
    fileContent_getBinary
    fileContent_getBinaryStream
    fileFields_get
    files_copy
    files_copyRecursively
    files_create
    files_delete
    files_getGroup
    files_getSingle
    files_list
    files_listAll
    files_listOutcome
    files_listRecursive
    files_mkdir
    files_move
    files_path_isDirectory
    files_share
    files_touch
    files_uploadPath
    folderByPath_delete
    folderPath_holder
    folderUID_get
    groupFields_get
    groupMembers_getAll
    groupReference_resolve
    groups_list
    groups_listAll
    groupUser_add
    groupUser_remove
    image_resolve
    imageReference_parse
    items_mapPooled
    job_cancel
    job_delete
    job_feedID_get
    job_logFetch
    job_statusFetch
    jobs_find
    jobs_statusBatch
    localAccount_action
    localAccount_adminAccessEnsure
    localAccount_create
    localAccount_find
    logout_do
    nameStandIn_derive
    nodeJoins_resolve
    pacsQueries_create
    pacsQueries_list
    pacsQuery_resultDecode
    pacsRetrieve_create
    pacsRetrieve_delete
    pacsRetrieve_statusForQuery
    pacsRetrieves_list
    pacsServers_list
    pathHolders_find
    pipeline_getContent
    pipeline_readiness
    pipeline_run
    pipeline_sourceGet
    pipelineDiagram_get
    pipelineFields_get
    pipelineInvocation_prepare
    pipelineManifest_get
    pipelineManifestBySlug_get
    pipelinePackage_find
    pipelinePackages_all
    pipelinePackages_restore
    pipelinePackages_sweep
    pipelinePackagesPath_get
    pipelines_getAll
    pipelines_list
    pipelines_listAll
    plugin_add
    plugin_addDescriptor
    plugin_addJson
    plugin_assignToComputeResources
    plugin_checkExists
    plugin_delete
    plugin_executeInPlace
    plugin_importFromStore
    plugin_readme
    plugin_register
    plugin_registerWithAdmin
    plugin_run
    plugin_searchPeersByImage
    pluginFields_get
    pluginIndex_load
    pluginIndex_validate
    pluginIndexArchive_read
    pluginIndexSource_format
    pluginIndexSource_parse
    pluginInput_detect
    pluginInstanceFields_get
    pluginInstances_list
    pluginInstances_listAll
    pluginMeta_documentationUrlGet
    pluginMeta_pluginIDFromSearch
    pluginMeta_readmeContentFetch
    pluginMetaFields_get
    pluginMetas_list
    pluginMetas_listAll
    pluginReadme_fetchFromRepository
    pluginReadmeDocument_fetch
    plugins_list
    plugins_listAll
    plugins_overview
    plugins_searchableToIDs
    plugins_searchPeers
    procCache_refresh
    procDataFacts_feed
    procDataFacts_settled
    procDataFacts_start
    procDataFacts_sweep
    procFeed_ensureLoaded
    procFeed_probe
    procFeed_refreshStart
    procPipelineBackfill_status
    procRoster_bootSync
    procRoster_sync
    procRoster_syncStart
    procTarget_locate
    procTarget_parse
    procTopology_await
    procTopology_reconcileFeeds
    procTopology_retry
    procTopology_status
    procTopology_warmup
    procTopologyCatchup_await
    procTopologyCatchup_enqueue
    procTopologyCatchup_status
    procVisitState_reset
    queryFolderName_build
    queryId_extractFromFolder
    queryLabel_extractFromFolder
    retrieve_confirmLoop
    retrieve_fireAndWatch
    retrieveProgress_classify
    retrieveTask_make
    retrieveTasks_fire
    retrieveTasks_skipComplete
    signature_compute
    sourceFeed_parse
    store_list
    storeImport_isSupported
    storeName_extractFromUrl
    syncPlan_apply
    syncPlan_build
    syncPlanAdds_list
    tagFields_get
    tagGroup_derive
    tags_list
    tags_listAll
    tagValue_decode
    tarArchive_read
    token_derive
    version_compare
    workflowFields_get
    workflowJobs_get
    workflows_list
    workflows_listAll