How azhi-ss/feishu-agent works
Feishu Agent is a CLI/TUI shell around Pi’s agent runtime for natural-language Feishu work via lark-cli. A user initializes local configuration and skills, then starts an interactive or Print session; the CLI selects a project-scoped session, assembles prompts/resources and extensions, and runs the agent. The product also includes high-risk-action guards, optional scheduled automation, and an optional remote bridge. Edges reflect shown imports/calls or README-documented capabilities; several package internals are unsampled, so their links are limited to documented relationships.
Main entry points: cli.ts CLI commands · runtime.ts Session runtime · resources.ts Resource loader · remote-bridge.ts Remote bridge
Components 26
CLI and setup
- CLI commands
src/cli.ts - Initialization
src/init.ts - Readiness checks
src/readiness.ts - Settings storage
src/settings.ts
Agent runtime
- Session runtime
src/runtime.ts - Resource loader
src/resources.ts - Session selection
src/sessions.ts - Task refresh
src/tasks.ts
Skills and safeguards
- Bundled skills
src/default-skills.ts - Official skills sync
src/official-skills.ts - Skill search
src/find-skill.ts - High-risk approval
src/high-risk.ts - Project policy
src/policy.ts - Subagent context
src/subagents.ts
Scheduled automation
- Automation commands
packages/feishu-automation/src/automation-commands.ts - Schedule state
packages/feishu-automation/src/automation.ts - Schedule trigger
packages/feishu-automation/src/automation-trigger.ts - Run supervisor
packages/feishu-automation/src/automation-runner.ts - Service manager
packages/feishu-automation/src/automation-service.ts
Remote bridge
- Remote bridge
packages/feishu-remote/extensions/remote-bridge.ts - Remote gateway
packages/feishu-remote/extensions/remote-gateway.ts - Remote lock
packages/feishu-remote/extensions/remote-lock.ts - Stream cards
packages/feishu-remote/extensions/stream-card.ts
Other components
- Feishu user
- Pi SDK and TUI
- lark-cli
Connections 33
- Feishu user → CLI commands: invokes
README.md - CLI commands → Initialization: initializes
src/cli.ts - CLI commands → Readiness checks: checks readiness
src/cli.ts - CLI commands → Session runtime: starts session
src/cli.ts - CLI commands → Settings storage: dispatches config
src/cli.ts - Initialization → Bundled skills: installs skills
src/init.ts - Initialization → Settings storage: stores preferences
src/init.ts - Readiness checks → lark-cli: checks CLI
README.md - Session runtime → Session selection: selects session
src/runtime.ts - Session runtime → Resource loader: loads resources
src/runtime.ts - Session runtime → Settings storage: loads settings
src/runtime.ts - Session runtime → Pi SDK and TUI: runs agent
src/runtime.ts - Resource loader → High-risk approval: checks approval
src/resources.ts - Resource loader → Subagent context: publishes context
src/resources.ts - Resource loader → Skill search: offers search
src/resources.ts - Resource loader → Bundled skills: loads skills
README.md - CLI commands → Official skills sync: syncs skills
src/cli.ts - Official skills sync → lark-cli: synchronizes from
README.md - High-risk approval → lark-cli: guards writes
README.md - Task refresh → lark-cli: refreshes tasks
src/tasks.ts - CLI commands → Task refresh: refreshes tasks
README.md - Feishu user → Automation commands: schedules work
README.md - Automation commands → Schedule state: reads schedule state
packages/feishu-automation/src/automation-commands.ts - Automation commands → Schedule trigger: manages schedules
README.md - Schedule trigger → Schedule state: reads and settles
packages/feishu-automation/src/automation-trigger.ts - Schedule trigger → Run supervisor: starts scheduled run
packages/feishu-automation/src/automation-trigger.ts - Run supervisor → Schedule state: reads schedule
packages/feishu-automation/src/automation-runner.ts - Run supervisor → CLI commands: launches child
README.md - Service manager → Schedule trigger: supervises trigger
packages/feishu-automation/src/automation-service.ts - Feishu user → Remote bridge: delegates task
README.md - Remote bridge → Remote gateway: routes requests
packages/feishu-remote/extensions/remote-bridge.ts - Remote bridge → Remote lock: uses lock
packages/feishu-remote/extensions/remote-bridge.ts - Remote bridge → Stream cards: renders updates
packages/feishu-remote/extensions/remote-bridge.ts