
Agent Work Registry
Registers agent outputs, removes duplicates and builds the cards that show them.
Install
npx skills add lobehub/lobehub --skill agent-work -g -a claude-code -y- Repository
- lobehub/lobehub83.7k
- Category
- AI and agents
- Updated
- 3d ago
- License
- See repository
- Context cost
- Mediumabout 3,000 tokens
- Runs scripts
- No, instructions only
What it does
Use for the Agent Work output registry: registration, deduplication, cards, skill providers, CLI scanners and Work types.
Agent Works
A Work is a durable record of something an agent produced or touched, a GitHub PR/issue, a Linear issue, an entity file (pptx/xlsx/docx/pdf), a document, a task. Works render as cards under the assistant message that produced them and accumulate versions across operations, so the same PR edited twice shows one card with history.
Two tables (packages/database/src/schemas/work.ts):
works, one row per resource. Identity/dedup key:(resourceType, resourceId)within the user/workspace scope and the share scope (see below).currentVersionIdsoft-references the latest version.work_versions, one row per registration event. Dedup: unique(workId, toolCallId), so a retried registration with the same real tool call id is a no-op. Versions carry provenance (source message, producing tool) and operation-levelcumulativeCost/cumulativeUsage.
Type registry
packages/database/src/models/work/registry.ts is the single registry of Work types (document / external / file / task): WORK_TYPE_ADAPTERS is satisfies Record<WorkType, WorkTypeAdapter>, so a type added to @lobechat/types without an adapter is a compile error.
Read-path compatibility gate: OPT_IN_WORK_TYPES (currently {'file'}) hides newer types from clients that did not opt in (includeFileWorks). Released Electron clients lag by weeks and crash on unknown type descriptors (descriptor.getIcon on undefined), so a request without the opt-in receives exactly the pre-file set. Any NEW Work type must ship behind the same kind of opt-in.
The gate has two kinds of emission points, and both must honor the client's declaration:

