@pmcollab/coworkstream-details
v6.0.0
Published
Rich category templates and reusable building blocks for @pmcollab/coworkstream.
Readme
@pmcollab/coworkstream-details
Rich category templates and reusable building blocks for @pmcollab/coworkstream.
Two kinds of exports. Read this before you depend on anything from this package.
Category templates — fork-friendly, NOT a stable API
DecisionDetails, PreparedDetails, SignalDetails, DraftDetails, ConsolidatedDetails, AuditDetails, IncidentDetails.
These are rich starting points designed to be forked into your codebase. Behavior, layout, and props will evolve across major versions. Don't deep-import or wrap them in production paths you can't easily update.
The recommended adoption pattern is:
npm install @pmcollab/coworkstream-details.- Try the components via
renderDetailsByCategory. - Once you know which 1-3 you want to keep, copy them into your repo (
src/components/details/ContosoDecision.jsx) and rename. You now own them; we can't break you.
See FORKING.md for the full pattern.
Building blocks — stable API
MultiAgentPositions, RiskAssessment, SimilarPastDecisions, VisibleReasoning, AgentLearning, DecisionFeedback, EditableParameters, WcosAlert.
These are depended-on sub-components that the templates compose internally. They're props-driven, fully decoupled, and follow semver. Safe to import directly long-term — they're how a forked ContosoDecision keeps using our work even after diverging the wrapper.
Quick start
import { WorkStream } from '@pmcollab/coworkstream'
import { renderDetailsByCategory } from '@pmcollab/coworkstream-details'
<WorkStream items={items} renderDetails={renderDetailsByCategory} />Use building blocks directly
import {
MultiAgentPositions,
RiskAssessment,
WcosAlert,
} from '@pmcollab/coworkstream-details'
function MyCustomDetails({ item }) {
return (
<>
<WcosAlert verdict={item.meta.wcos?.verdict} reasons={item.meta.wcos?.reasons} />
{item.isMultiAgent && <MultiAgentPositions multiAgent={item.multiAgent} />}
{item.meta.risk && <RiskAssessment risk={item.meta.risk} item={item} />}
</>
)
}What's in _fork-stubs.js?
The templates reference Zustand-style hooks and a toast library. The package ships with no-op stubs in src/_fork-stubs.js so the components render without runtime errors when consumed as-is. Fork the components or shadow this module to wire your real state and notifications. See FORKING.md.
Peer dependencies
react >=18@pmcollab/coworkstream >=0.1framer-motion >=10(used by some animated panels)
License
Commercial. See LICENSE in the repository root.
