@nextop-os/workspace-file-manager
v0.0.16
Published
Reusable workspace file manager service, session state, host contracts, and optional React UI.
Readme
@nextop-os/workspace-file-manager
Reusable workspace file manager service, session state, host contracts, and optional React UI.
Hosts compose the package through createWorkspaceFileManagerService() and
createSession(...). A session owns the shared file-manager data state, shared
interaction state, preview flow, upload flow, and activation flow for one
workspace-scoped instance.
Hosts provide backend capabilities through WorkspaceFileManagerHost. The
package keeps shared state in logical workspace paths such as
/workspace/src/index.ts and does not depend on nextopd, TSH, TACH, VM paths,
or host absolute paths.
This package is intentionally a reusable frontend workspace-domain surface, not only a transport-agnostic data kernel. Shared session orchestration, preview flow, upload flow, activation flow, and React-facing interaction state may live here when they are part of the reusable file-manager experience across hosts.
The shared surface owns host-neutral file preview classification,
activation-target shaping, shared view-model derivation, and the host contract
needed to drive those flows so different hosts can integrate primarily by
implementing WorkspaceFileManagerHost instead of rebuilding workflow around
the shared UI.
Hosts now provide one app-level i18n runtime and scope it into the file-manager namespace, rather than hand-assembling package-local message objects.
What stays outside this package is concrete host integration: desktop preload calls, nextopd transport wiring, host absolute paths, and product-specific integration details belong in the owning host adapter.
Host Reuse Pattern
When another host wants to reuse this package:
- Implement
WorkspaceFileManagerHostin the consuming host. - Keep host transport, local-file picking, and environment-specific capabilities in that host adapter.
- Create one host-level i18n runtime that merges:
- host-owned product i18n resources
workspaceFileManagerI18nResources- any other shared package i18n resources needed by the same surface
- Scope that runtime into the file-manager namespace with
createWorkspaceFileManagerI18nRuntime(...). - Override wording in the host runtime when the host intentionally owns the product phrasing; otherwise fall back to the package defaults.
This keeps the package reusable across different hosts without pushing host transport wiring or product wording into the shared package.
