How bytefolk/digital-employee works
Digital Employee is a local-first workspace for addressing work to positions in a digital organization, with context and permission boundaries. The main workflow is: a user selects a position and sends a turn through the Workbench; the turn engine assembles context, applies policy, invokes a model/host, and returns an answer with evidence. Separate capabilities cover employee packages, organization setup and delegation, CLI run/evaluation/deploy, and optional channels and memory. The README documents several links whose implementation was not sampled; those are represented only where the workflow is explicit.
Main entry points: turn-executor.ts Turn executor · turn-run.ts Turn runner · bin.ts CLI entry · index.ts Deploy command
Components 22
Workspace and CLI
- CLI entry
apps/cli/bin.ts - Workbench server
apps/cli/workbench/server.ts - Turn runner
apps/cli/turn/turn-run.ts - Deploy command
apps/cli/deploy/index.ts
Organization and packages
- Employee package
packages/core/src/employee-package.ts - Hiring flow
apps/cli/hire.ts - Organization model
apps/cli/org/model.ts - Org permissions
apps/cli/org/permissions.ts
Turn engine
- Turn executor
packages/engine/src/turn-executor.ts - Context assembly
packages/engine/src/context-assembler.ts - Approval policy
packages/engine/src/approval.ts - Turn evidence
packages/engine/src/turn-evidence.ts - Model port
packages/engine/src/model-port.ts
Hosts and channels
- Host runtime
apps/cli/host-runtime.ts - Agent host adapters
apps/cli/agent-hosts.ts - DingTalk channel
connectors/channels/dingtalk/index.ts
Context and sources
- Memory adapter
packages/core/src/mem-http-memory-adapter.ts - Lexical retriever
packages/core/src/lexical-retriever.ts - Git source
connectors/sources/git/index.ts
Other components
- Business user
- Model service
- External agent host
Connections 22
- Business user → Workbench server: sends turn
- Workbench server → Turn runner: runs turn
- Turn runner → Turn executor: executes turn
- Turn executor → Context assembly: assembles context
- Turn executor → Org permissions: checks permissions
- Turn executor → Approval policy: applies policy
- Turn executor → Model port: requests completion
- Model port → Agent host adapters: selects host
- Agent host adapters → External agent host: invokes host
- Model port → Model service: calls model
- Turn executor → Turn evidence: records evidence
- Turn runner → Workbench server: returns output
- CLI entry → Turn runner: dispatches turn
- CLI entry → Deploy command: dispatches deploy
- Deploy command → Agent host adapters: probes hosts
- Deploy command → DingTalk channel: configures channel
- CLI entry → Hiring flow: dispatches hiring
- Hiring flow → Employee package: creates package
- Hiring flow → Organization model: sets position
- Context assembly → Memory adapter: recalls context
- Context assembly → Lexical retriever: retrieves evidence
- Lexical retriever → Git source: reads documents