feishu-codex-console 1.0.0-beta.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.env.example +101 -0
- package/.feishu-codex-policy.example.json +11 -0
- package/.feishu-codex-runbooks.example.json +36 -0
- package/CHANGELOG.md +129 -0
- package/CODE_OF_CONDUCT.md +7 -0
- package/CONTRIBUTING.md +52 -0
- package/LICENSE +21 -0
- package/README.en.md +81 -0
- package/README.md +398 -0
- package/ROADMAP.md +40 -0
- package/SECURITY.md +53 -0
- package/dist/account-quota-card.js +233 -0
- package/dist/account-quota.js +125 -0
- package/dist/app-server-client.js +281 -0
- package/dist/card-session.js +166 -0
- package/dist/codex-events.js +1 -0
- package/dist/codex-runner.js +875 -0
- package/dist/config.js +198 -0
- package/dist/confirmation-card.js +135 -0
- package/dist/control-card.js +345 -0
- package/dist/conversation-turn-session.js +209 -0
- package/dist/data-maintenance.js +71 -0
- package/dist/device-card.js +460 -0
- package/dist/device-health.js +94 -0
- package/dist/diagnostics.js +253 -0
- package/dist/doctor.js +250 -0
- package/dist/fallback-card-session.js +37 -0
- package/dist/health-file.js +75 -0
- package/dist/index.js +4330 -0
- package/dist/lark-cli.js +558 -0
- package/dist/lark-retry.js +34 -0
- package/dist/maintenance.js +140 -0
- package/dist/model-capabilities.js +31 -0
- package/dist/onboarding-card.js +312 -0
- package/dist/permission-lease.js +22 -0
- package/dist/policy.js +506 -0
- package/dist/progress.js +267 -0
- package/dist/project-card.js +303 -0
- package/dist/project-overview-card.js +182 -0
- package/dist/project-overview.js +278 -0
- package/dist/project-policy.js +160 -0
- package/dist/project-registry.js +259 -0
- package/dist/project-status.js +45 -0
- package/dist/project-workspace.js +55 -0
- package/dist/quota-card.js +94 -0
- package/dist/recovery-policy.js +26 -0
- package/dist/redaction.js +67 -0
- package/dist/remote-ready.js +112 -0
- package/dist/response-card.js +139 -0
- package/dist/result-card.js +166 -0
- package/dist/review-card.js +452 -0
- package/dist/runbook-card.js +272 -0
- package/dist/runbooks.js +191 -0
- package/dist/runtime-card.js +337 -0
- package/dist/session-card.js +128 -0
- package/dist/session-naming.js +14 -0
- package/dist/smoke.js +28 -0
- package/dist/state-backup.js +302 -0
- package/dist/state-store.js +874 -0
- package/dist/task-card.js +640 -0
- package/dist/task-center-card.js +176 -0
- package/dist/task-failure.js +43 -0
- package/dist/task-intent.js +76 -0
- package/dist/task-queue.js +187 -0
- package/dist/task-reconciliation.js +80 -0
- package/dist/task-review.js +497 -0
- package/dist/team-card.js +275 -0
- package/dist/team-directory.js +54 -0
- package/dist/team-policy.js +93 -0
- package/dist/types.js +1 -0
- package/dist/version.js +9 -0
- package/dist/workspace-session.js +64 -0
- package/docs/ARCHITECTURE.md +54 -0
- package/docs/COMPATIBILITY.md +55 -0
- package/docs/CONFIGURATION.md +88 -0
- package/docs/DEMO.md +45 -0
- package/docs/GOOD_FIRST_ISSUES.md +23 -0
- package/docs/INSTALLATION.md +207 -0
- package/docs/OPEN_SOURCE_PRODUCT_PLAN.md +113 -0
- package/docs/PRODUCT_REQUIREMENTS_MAP.md +591 -0
- package/docs/RELEASE_CHECKLIST.md +65 -0
- package/docs/TEAM_DEPLOYMENT.md +35 -0
- package/docs/TROUBLESHOOTING.md +130 -0
- package/docs/V4_WORKSPACE_SESSION_FLOW.md +232 -0
- package/docs/requirements/D10_MAINTENANCE_AND_ECOSYSTEM.md +103 -0
- package/docs/requirements/D1_INSTALLATION_AND_FIRST_CONNECTION.md +479 -0
- package/docs/requirements/D2_DEVICE_AND_CONNECTIVITY.md +54 -0
- package/docs/requirements/D3_PROJECTS_AND_SESSIONS.md +107 -0
- package/docs/requirements/D4_REMOTE_TASK_EXECUTION.md +102 -0
- package/docs/requirements/D5_CODEX_NATIVE_INTERACTIONS.md +99 -0
- package/docs/requirements/D6_RESULTS_AND_CODE_REVIEW.md +100 -0
- package/docs/requirements/D7_SECURITY_GOVERNANCE.md +106 -0
- package/docs/requirements/D8_RELIABILITY_AND_RECOVERY.md +182 -0
- package/docs/requirements/D9_TEAM_COLLABORATION.md +129 -0
- package/package.json +76 -0
- package/scripts/capability-probe.mjs +113 -0
- package/scripts/cli.mjs +919 -0
- package/scripts/config-file.mjs +137 -0
- package/scripts/discovery-lib.mjs +78 -0
- package/scripts/install-card.mjs +37 -0
- package/scripts/install-detection.mjs +126 -0
- package/scripts/install-state.mjs +107 -0
- package/scripts/launchd.mjs +161 -0
- package/scripts/migrate-legacy.mjs +97 -0
- package/scripts/package-smoke.mjs +163 -0
- package/scripts/release-dist-tag.mjs +7 -0
- package/scripts/runbook-template.mjs +36 -0
- package/scripts/service-health.mjs +110 -0
- package/scripts/service.mjs +24 -0
- package/scripts/setup-lib.mjs +118 -0
- package/scripts/systemd.mjs +96 -0
- package/scripts/upgrade-lib.mjs +99 -0
- package/scripts/verify-release.mjs +37 -0
package/.env.example
ADDED
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
# Configuration contract version. New releases migrate older versions explicitly
|
|
2
|
+
# and refuse unknown future versions instead of guessing.
|
|
3
|
+
BRIDGE_CONFIG_VERSION=1
|
|
4
|
+
|
|
5
|
+
# Required: one or more authorized Feishu user open_ids, comma-separated.
|
|
6
|
+
ALLOWED_FEISHU_OPEN_IDS=ou_replace_me
|
|
7
|
+
|
|
8
|
+
# Team roles. ALLOWED_FEISHU_OPEN_IDS are operators. When the admin list is
|
|
9
|
+
# empty, all operators are treated as admins for backward-compatible personal
|
|
10
|
+
# installs. Viewers may inspect dashboards but cannot start or mutate tasks.
|
|
11
|
+
FEISHU_ADMIN_OPEN_IDS=
|
|
12
|
+
FEISHU_VIEWER_OPEN_IDS=
|
|
13
|
+
|
|
14
|
+
# Optional product-facing member names. Cards never expose raw open_ids; when a
|
|
15
|
+
# label is missing, the bridge shows a stable anonymous member code instead.
|
|
16
|
+
FEISHU_MEMBER_LABELS_JSON={"ou_replace_me":"Alice"}
|
|
17
|
+
|
|
18
|
+
# Group chats are isolated per member by default so teammates never share a
|
|
19
|
+
# Codex thread, selected project, queue, or settings by accident. Use "chat"
|
|
20
|
+
# only when the entire group intentionally collaborates in one shared context.
|
|
21
|
+
FEISHU_GROUP_SESSION_SCOPE=member
|
|
22
|
+
|
|
23
|
+
# Optional project ACL JSON. Keys may be an absolute path, project name,
|
|
24
|
+
# display path, or "*"; values are Feishu open_id arrays. Admins always bypass
|
|
25
|
+
# project ACLs. When empty, every authorized member sees every discovered project.
|
|
26
|
+
FEISHU_PROJECT_ACL_JSON=
|
|
27
|
+
|
|
28
|
+
# Optional: restrict use to selected chats. Empty allows authorized private
|
|
29
|
+
# chats; in danger-full-access mode, group chats remain blocked until listed.
|
|
30
|
+
ALLOWED_FEISHU_CHAT_IDS=
|
|
31
|
+
|
|
32
|
+
# Default project when a chat has not selected one yet.
|
|
33
|
+
CODEX_WORKDIR=/absolute/path/to/a/git/repository
|
|
34
|
+
|
|
35
|
+
# Mirror local projects saved in the Codex app. The state-file override is
|
|
36
|
+
# optional; by default it uses $CODEX_HOME/.codex-global-state.json.
|
|
37
|
+
CODEX_SYNC_SAVED_PROJECTS=true
|
|
38
|
+
CODEX_PROJECT_STATE_FILE=
|
|
39
|
+
|
|
40
|
+
# Optional additional roots scanned recursively for Git repositories. Use
|
|
41
|
+
# commas for multiple roots. Empty means only scan CODEX_WORKDIR in addition to
|
|
42
|
+
# the exact projects saved in Codex.
|
|
43
|
+
CODEX_PROJECT_ROOTS=
|
|
44
|
+
CODEX_PROJECT_SCAN_DEPTH=8
|
|
45
|
+
MAX_CODEX_PROJECTS=200
|
|
46
|
+
|
|
47
|
+
# Modes: read-only, workspace-write, danger-full-access. Full access can run
|
|
48
|
+
# arbitrary local commands; use a strict sender allowlist and keep the external
|
|
49
|
+
# action confirmation gate enabled.
|
|
50
|
+
CODEX_SANDBOX_MODE=workspace-write
|
|
51
|
+
# Maximum default for non-admin operators. It cannot exceed CODEX_SANDBOX_MODE.
|
|
52
|
+
# When the service maximum is danger-full-access, this defaults to workspace-write.
|
|
53
|
+
CODEX_OPERATOR_SANDBOX_MODE=workspace-write
|
|
54
|
+
CODEX_SKIP_GIT_REPO_CHECK=false
|
|
55
|
+
CODEX_NETWORK_ACCESS=false
|
|
56
|
+
CODEX_WEB_SEARCH_MODE=disabled
|
|
57
|
+
# Disabled by default for predictable remote-task cost. Enable only when the
|
|
58
|
+
# team explicitly wants Codex subagent workflows.
|
|
59
|
+
CODEX_MULTI_AGENT_ENABLED=false
|
|
60
|
+
|
|
61
|
+
# Optional Codex overrides. Empty values use the local Codex defaults.
|
|
62
|
+
CODEX_CLI_PATH=
|
|
63
|
+
CODEX_MODEL=
|
|
64
|
+
CODEX_REASONING_EFFORT=
|
|
65
|
+
CODEX_TIMEOUT_MS=1200000
|
|
66
|
+
|
|
67
|
+
# Codex receives a minimized child-process environment, so bridge credentials
|
|
68
|
+
# and common token/password variables are not inherited. Explicitly list only
|
|
69
|
+
# project-specific variables that a confirmed workflow truly needs.
|
|
70
|
+
CODEX_ALLOWED_ENV_VARS=
|
|
71
|
+
|
|
72
|
+
# Different chats may run concurrently; one chat remains strictly serial.
|
|
73
|
+
MAX_CONCURRENT_TASKS=2
|
|
74
|
+
MAX_QUEUED_PER_CONVERSATION=5
|
|
75
|
+
|
|
76
|
+
# Feishu attachment limits. Images are passed directly to Codex; common text
|
|
77
|
+
# and source files are decoded up to MAX_TEXT_ATTACHMENT_BYTES.
|
|
78
|
+
MAX_ATTACHMENT_BYTES=20971520
|
|
79
|
+
MAX_TEXT_ATTACHMENT_BYTES=131072
|
|
80
|
+
ATTACHMENT_RETENTION_HOURS=72
|
|
81
|
+
|
|
82
|
+
# External-action confirmation cards expire and are persisted across restarts.
|
|
83
|
+
EXTERNAL_CONFIRMATION_TTL_MINUTES=10
|
|
84
|
+
|
|
85
|
+
# Used to remove the leading @mention from group-chat prompts.
|
|
86
|
+
FEISHU_BOT_MENTION_NAMES=你的飞书机器人名称
|
|
87
|
+
|
|
88
|
+
MAX_REPLY_CHARS=12000
|
|
89
|
+
MAX_SEEN_EVENTS=2000
|
|
90
|
+
# Distinguishes multiple installations for LaunchAgent/systemd service names.
|
|
91
|
+
BRIDGE_INSTANCE_ID=default
|
|
92
|
+
# Runtime data can live outside the Git checkout. Defaults to ./var.
|
|
93
|
+
BRIDGE_DATA_DIR=
|
|
94
|
+
# Optional explicit file overrides. The legacy JSON path is read once for migration only.
|
|
95
|
+
BRIDGE_DATABASE_FILE=
|
|
96
|
+
BRIDGE_STATE_FILE=
|
|
97
|
+
FEISHU_COMPLETION_NOTIFICATIONS=false
|
|
98
|
+
# Show the interactive guide once per new private chat or isolated group member.
|
|
99
|
+
FEISHU_AUTO_ONBOARDING=true
|
|
100
|
+
MAX_LOG_BYTES=10485760
|
|
101
|
+
LOG_MESSAGE_CONTENT=false
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 1,
|
|
3
|
+
"runbooks": [
|
|
4
|
+
{
|
|
5
|
+
"id": "verify",
|
|
6
|
+
"name": "测试并修复",
|
|
7
|
+
"description": "运行项目已有测试,定位失败原因并完成必要修复",
|
|
8
|
+
"prompt": "运行当前项目已有的测试与静态检查,修复发现的问题,并总结修改内容与验证结果。",
|
|
9
|
+
"sandboxMode": "workspace-write",
|
|
10
|
+
"reasoningEffort": "high"
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
"id": "inspect-module",
|
|
14
|
+
"name": "检查指定模块",
|
|
15
|
+
"description": "对指定模块做只读结构、风险和测试覆盖检查",
|
|
16
|
+
"prompt": "只读检查 {{module}} 模块,说明它的职责、主要依赖、潜在风险和测试覆盖缺口,不修改文件。",
|
|
17
|
+
"sandboxMode": "read-only",
|
|
18
|
+
"parameters": [
|
|
19
|
+
{
|
|
20
|
+
"name": "module",
|
|
21
|
+
"label": "模块",
|
|
22
|
+
"description": "仓库内的目录或模块名",
|
|
23
|
+
"required": true
|
|
24
|
+
}
|
|
25
|
+
]
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"id": "refresh-docs",
|
|
29
|
+
"name": "刷新项目文档",
|
|
30
|
+
"description": "根据当前代码更新项目内已有文档并检查链接",
|
|
31
|
+
"prompt": "检查当前实现与项目文档的一致性,更新过期说明并验证文档内的本地链接。完成后只汇报变更与验证结果。",
|
|
32
|
+
"sandboxMode": "workspace-write",
|
|
33
|
+
"reasoningEffort": "medium"
|
|
34
|
+
}
|
|
35
|
+
]
|
|
36
|
+
}
|
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes are recorded here. Versions follow Semantic Versioning while the public API stabilizes.
|
|
4
|
+
|
|
5
|
+
## 1.0.0-beta.6 - 2026-07-17
|
|
6
|
+
|
|
7
|
+
### Fixed
|
|
8
|
+
|
|
9
|
+
- Task-review baselines now serialize index-backed Git reads, disable optional index locks, and bypass the untracked cache so freshly created pre-existing files are captured consistently on Linux.
|
|
10
|
+
|
|
11
|
+
## 1.0.0-beta.5 - 2026-07-17
|
|
12
|
+
|
|
13
|
+
### Fixed
|
|
14
|
+
|
|
15
|
+
- Task-review baselines now use streamed SHA-256 content fingerprints instead of filesystem timestamps, preventing unchanged pre-existing files from being attributed to a Codex task on Linux or after metadata-only timestamp changes.
|
|
16
|
+
- Added cross-platform regression coverage for dirty-worktree attribution before publishing.
|
|
17
|
+
|
|
18
|
+
## 1.0.0-beta.4 - 2026-07-17
|
|
19
|
+
|
|
20
|
+
### Added
|
|
21
|
+
|
|
22
|
+
- Native Codex account quota summaries in the device and model control centers, plus a dedicated detail card for independent limit buckets, remaining percentage, reset time, plan, and available reset count; `额度`, `/usage`, and `/quota` open the live view.
|
|
23
|
+
- Local task-intent routing for answers, read-only analysis, content/file writing, and code changes, with mode-specific cards, retry copy, validation states, and sandbox clamping.
|
|
24
|
+
- Zero-token local project overview for `读取项目` / `/overview`, with bounded Git, README, package, language, and directory inspection.
|
|
25
|
+
- Accurate per-task token accounting across every model call, split into new input, cached input, output, and model-call count.
|
|
26
|
+
- Cost-safe subagent defaults: multi-agent tools are disabled unless a deployment explicitly sets `CODEX_MULTI_AGENT_ENABLED=true`.
|
|
27
|
+
- Public `feishu-codex-console` package with `feishu-codex-console` and backward-compatible `feishu-codex-bridge` CLIs.
|
|
28
|
+
- Read-only Feishu message discovery that automatically captures the installer operator and conversation IDs.
|
|
29
|
+
- Resumable non-sensitive installation state; existing config, service, runtime-data, and health detection; atomic configuration updates; private backups; and preservation of unknown advanced settings.
|
|
30
|
+
- Feishu Bot/message/card-event capability probes with concrete remediation, plus an end-to-end installation success card.
|
|
31
|
+
- Private service health heartbeats that verify the live PID, both Feishu event consumers, instance identity, and the exact loaded configuration before installation can complete.
|
|
32
|
+
- A non-destructive `migrate --from <source>` flow for old repository-local `.env` installs that preserves advanced settings and reuses legacy runtime data.
|
|
33
|
+
- Personal-safe, team-safe, and power-user setup presets with explicit full-access confirmation.
|
|
34
|
+
- Private per-user configuration and data directories that work with macOS LaunchAgent and Linux systemd.
|
|
35
|
+
- Installation guide and open-source product roadmap.
|
|
36
|
+
- Clean tarball installation smoke test plus protected npm provenance and GitHub Release workflow.
|
|
37
|
+
- Package-level recovery coverage that interrupts initialization before configuration write and verifies a second run resumes from the saved safe checkpoint.
|
|
38
|
+
- Ubuntu/macOS CI and release preflight matrices, plus maintainer release and operator troubleshooting guides.
|
|
39
|
+
- Truthful device availability states with status sampling time, per-member last-success time, hidden controls when callbacks are unavailable, and an explicit Codex reconnect action.
|
|
40
|
+
- Persisted device-console card references that refresh in place after restart, plus rate-limited recovery notices after a meaningful unexpected outage.
|
|
41
|
+
- Per-member project favorites and recent usage, consistent ranked numeric selection, searchable path-aware project choices, and current Git branch/dirty/ahead/behind status.
|
|
42
|
+
- Impact-aware project switching with native card confirmation and explicit text confirmation whenever tasks, queues, or saved Codex context would be interrupted.
|
|
43
|
+
- Automatic names for newly created native Codex threads based on the first task.
|
|
44
|
+
- Live queue-position updates, task-card model/reasoning/thread context, and visible steering counts for follow-up messages.
|
|
45
|
+
- A per-task stop control in the task center, accurate member/admin task scopes, and read-only cards without false mutation controls.
|
|
46
|
+
- Actionable timeout, policy, permission, connection, and queue failure guidance, plus explicit file-impact copy for stopped work.
|
|
47
|
+
- Safe restart semantics that recover untouched queued work but mark previously running work interrupted instead of replaying potentially destructive commands.
|
|
48
|
+
- Capability-aware model controls with a semantic native-default option, per-model reasoning choices, task-time fallback for removed capabilities, and a read-only compatibility mode when the Codex catalog is unavailable.
|
|
49
|
+
- One-shot audited runtime approvals and questions with explicit scope/expiry copy, stale-card recovery guidance, cancellation, and ownership enforcement.
|
|
50
|
+
- End-to-end secret-question protection that removes remote answer controls, blocks text/card forwarding, and redacts message-content logging.
|
|
51
|
+
- Run-start Git baselines with dirty-worktree attribution, file fingerprints, additions/deletions, post-task staleness detection, and safe fallback for legacy or non-Git work.
|
|
52
|
+
- A read-only CardKit review center with paginated files and per-file diffs, task-card/task-center entry points, and explicit mixed-worktree guidance.
|
|
53
|
+
- Structured test evidence from actual commands and exit codes; the latest rerun wins, missing tests stay visible, and a completed turn with failing tests is no longer styled as success.
|
|
54
|
+
- Sensitive review-path blocking plus token, password, bearer credential, and private-key redaction for Diff and test excerpts.
|
|
55
|
+
- Time-bounded full-access leases for the next task, 30 minutes, or the current Codex thread, bound to the member, conversation, project, and session with automatic safe fallback.
|
|
56
|
+
- Repository-local `.feishu-codex-policy.json` controls that can lower the sandbox ceiling, allowlist external actions, or deny them, with validation at confirmation, enqueue, and execution time.
|
|
57
|
+
- Shared credential redaction across runtime logs, doctor output, durable text replies, audit summaries, task/approval/confirmation cards, test excerpts, and review diffs.
|
|
58
|
+
- A unified Card 2.0 response shell for controls, approvals, runtime questions, long-running work, and exceptional recovery states, with reliable text fallback.
|
|
59
|
+
- Feishu API timeout, `Retry-After`, transient-error retry, backoff, and outbound API health reporting.
|
|
60
|
+
- `doctor --fix` for safe local runtime repairs and private redacted JSON diagnostic bundles.
|
|
61
|
+
- Verified SQLite runtime backups, backup listing, service stop/restart, and guarded rollback commands.
|
|
62
|
+
- Automatic pre-migration SQLite snapshots, explicit schema versions, integrity checks, and rollback when schema or state conversion fails.
|
|
63
|
+
- Conservative startup reconciliation across persisted task status, CardKit phase, start time, and Codex thread evidence.
|
|
64
|
+
- Terminal-result fallback when a task card cannot be updated, even when proactive completion notifications are disabled.
|
|
65
|
+
- Explicit task initiator/current-controller state with friendly member labels, group handoff, initiator reclaim, administrator takeover, ACL revalidation, restart recovery, and audited control changes.
|
|
66
|
+
- A privacy-preserving team dashboard for member status, project load, task outcomes and token usage without prompts, results, paths or raw open IDs.
|
|
67
|
+
- Repository-local `.feishu-codex-runbooks.json` templates with parameters, defaults, model/reasoning hints, permission lowering, safe one-click execution, and failure-closed external-action validation.
|
|
68
|
+
- Explicit config/version compatibility metadata, a safe package upgrade preview/execution path, verified service rollback, and a private support-bundle command.
|
|
69
|
+
- An installed-package `init-runbooks` command that creates a reviewed starter without overwriting team-owned catalogs.
|
|
70
|
+
- English onboarding, configuration/compatibility/demo references, a public Roadmap, scoped Good First Issue guidance, and release-contract verification.
|
|
71
|
+
|
|
72
|
+
### Changed
|
|
73
|
+
|
|
74
|
+
- First-run onboarding is now one adaptive welcome card instead of a four-step wizard. It exposes one primary action for offline, missing-project, viewer, or ready states; realistic prompt examples and a short optional team convention replace configuration-heavy setup screens.
|
|
75
|
+
- Conversational replies now promote concise lead conclusions into native Feishu rich-text titles, keep loading states visually quiet, and avoid leaking leading Markdown syntax into the chat-list preview.
|
|
76
|
+
- Questions and read-only analysis now use one editable Feishu Markdown reply instead of a full success task card; the final answer hides task, model, permission, thread, and token metadata.
|
|
77
|
+
- Top-level group prompts now start isolated reply-thread sessions. Later replies use Feishu `root_id`/`thread_id` context to resume the same Codex thread, while new topics inherit project and preferences without inheriting old Codex context or temporary permission leases.
|
|
78
|
+
- Routine acknowledgements now use native Markdown. Card 2.0 is reserved for controls, approvals, questions, file/code execution, and exceptional states.
|
|
79
|
+
- Questions and analysis no longer create Git baselines, consume temporary full-access leases, show missing-test warnings, or expose empty review actions; content and code tasks retain file-aware verification.
|
|
80
|
+
- Completed tasks now keep one canonical card: a compact result summary opens the full answer or validation in place, irrelevant review actions stay hidden, and successful card updates no longer produce duplicate result messages by default.
|
|
81
|
+
- Local absolute-path Markdown links are rendered as safe file labels in Feishu while external links remain clickable.
|
|
82
|
+
- Reasoning-effort labels now match the Codex interface and hide internal enum values from visible controls.
|
|
83
|
+
- Package metadata now includes a publishable binary, runtime file allowlist, and prepack build.
|
|
84
|
+
- A conversation can explicitly return to the native Codex default even when the deployment pins a global model.
|
|
85
|
+
- `CODEX_SANDBOX_MODE=danger-full-access` is now a service/role ceiling; persistent conversation settings are clamped to workspace write and require an explicit temporary lease for each elevated scope.
|
|
86
|
+
- Task control is now distinct from task ownership; existing task records automatically assign control to their original initiator.
|
|
87
|
+
- Ordinary acknowledgements and validation feedback now stay on the lightweight native message surface; consequential controls and exceptional recovery states use the semantic Card 2.0 shell.
|
|
88
|
+
|
|
89
|
+
### Fixed
|
|
90
|
+
|
|
91
|
+
- Native conversational replies now edit rich-text messages through the Feishu `PUT` message API instead of the card-only `PATCH` API. Progressive updates respect Feishu's 20-edit limit and reserve capacity for the terminal answer.
|
|
92
|
+
- Team task cards now use CardKit-compliant element IDs in every collaboration state; contract coverage includes the dynamic team panel.
|
|
93
|
+
- If a full task card is unavailable, its lightweight fallback card now updates in place from queued to running to terminal state instead of posting separate accepted and completed messages.
|
|
94
|
+
|
|
95
|
+
## 1.0.0-beta.2 - 2026-07-16
|
|
96
|
+
|
|
97
|
+
### Added
|
|
98
|
+
|
|
99
|
+
- Native three-step Feishu Card 2.0 onboarding for connection, workspace/model setup, and the first task.
|
|
100
|
+
- Automatic first-run onboarding with per-member SQLite progress, completion, dismissal, and manual restart.
|
|
101
|
+
- Direct onboarding shortcuts to the device console, project workspace, model settings, sessions, and task center.
|
|
102
|
+
- A viewer-specific read-only onboarding path and `FEISHU_AUTO_ONBOARDING` deployment control.
|
|
103
|
+
|
|
104
|
+
### Fixed
|
|
105
|
+
|
|
106
|
+
- macOS service reinstalls no longer force-start a second bridge process while the new LaunchAgent is registering its Feishu event consumers.
|
|
107
|
+
|
|
108
|
+
## 1.0.0-beta.1 - 2026-07-16
|
|
109
|
+
|
|
110
|
+
### Added
|
|
111
|
+
|
|
112
|
+
- Codex-native model catalog, model selection, reasoning-effort selection, and per-conversation sandbox profiles.
|
|
113
|
+
- Historical session browser, thread resume, context compaction, and task center.
|
|
114
|
+
- Team roles: administrator, operator, and viewer.
|
|
115
|
+
- Per-member group isolation, task/card/thread ownership, project ACLs, and a bounded SQLite audit log.
|
|
116
|
+
- Automatic steering for follow-up messages and explicit `/queue` for independent work.
|
|
117
|
+
- Proactive completion notifications backed by the durable text outbox.
|
|
118
|
+
- Configurable instance/data paths plus macOS LaunchAgent and Linux systemd user services.
|
|
119
|
+
- Bundled `@larksuite/cli`, MIT license, contribution guide, conduct policy, architecture docs, and GitHub templates.
|
|
120
|
+
|
|
121
|
+
### Changed
|
|
122
|
+
|
|
123
|
+
- Persisted state schema upgraded from version 5 to 6 with automatic migration.
|
|
124
|
+
- Non-admin operators default to `workspace-write` when the service maximum is `danger-full-access`.
|
|
125
|
+
- Group chats default to one Codex context per member.
|
|
126
|
+
|
|
127
|
+
## 0.8.0 - 2026-07-15
|
|
128
|
+
|
|
129
|
+
- Persistent Codex app-server, native approvals and questions, SQLite recovery, CardKit 2.0 task/device cards, and macOS Remote Ready.
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# Code of Conduct
|
|
2
|
+
|
|
3
|
+
We want this project to be a practical, welcoming place for people building secure developer tools.
|
|
4
|
+
|
|
5
|
+
Be respectful, assume good intent, discuss technical tradeoffs with evidence, and make space for contributors with different backgrounds and experience levels. Harassment, threats, discriminatory language, deliberate exposure of private information, and sustained personal attacks are not acceptable.
|
|
6
|
+
|
|
7
|
+
Project maintainers may edit or remove contributions and restrict participation when behavior puts people or the project at risk. Report conduct concerns privately to the maintainers through GitHub rather than escalating them in a public thread.
|
package/CONTRIBUTING.md
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# Contributing
|
|
2
|
+
|
|
3
|
+
Thanks for helping make Feishu Codex Bridge safer and easier to self-host.
|
|
4
|
+
|
|
5
|
+
## Before opening a change
|
|
6
|
+
|
|
7
|
+
- Search existing issues and pull requests.
|
|
8
|
+
- For security vulnerabilities, follow `SECURITY.md` instead of opening a public issue.
|
|
9
|
+
- Keep the bridge self-hosted and outbound-only by default. Features that require a public inbound endpoint need an explicit threat model.
|
|
10
|
+
- Do not commit Feishu credentials, Codex login data, `.env`, SQLite files, logs, attachments, real open IDs, or absolute personal paths.
|
|
11
|
+
|
|
12
|
+
## Local development
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
npm ci
|
|
16
|
+
cp .env.example .env
|
|
17
|
+
npm run check
|
|
18
|
+
npm test
|
|
19
|
+
npm run build
|
|
20
|
+
npm run test:package
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
`npm run doctor` and `npm run smoke:codex` use local credentials, so they are optional for contributors who only change pure code or cards.
|
|
24
|
+
|
|
25
|
+
## Code map
|
|
26
|
+
|
|
27
|
+
| Area | Main files | Required evidence |
|
|
28
|
+
|---|---|---|
|
|
29
|
+
| Feishu routing and task lifecycle | `src/index.ts`, `src/task-queue.ts` | ownership, deduplication, queue, and restart tests |
|
|
30
|
+
| Card 2.0 presentation | `src/*-card.ts`, `src/response-card.ts` | focused card test plus `test/card-contract.test.ts` |
|
|
31
|
+
| Identity and permissions | `src/team-policy.ts`, `src/project-policy.ts`, `src/policy.ts` | allow and deny cases; no real member IDs |
|
|
32
|
+
| Persistence and recovery | `src/state-store.ts`, `src/state-backup.ts` | old-state migration, interruption, integrity, and rollback tests |
|
|
33
|
+
| Codex integration | `src/app-server-client.ts`, `src/model-capabilities.ts` | normalized fixtures; do not require experimental methods for core flows |
|
|
34
|
+
| Installer and service | `scripts/cli.mjs`, `scripts/*d.mjs` | pure helper tests and `npm run test:package` |
|
|
35
|
+
|
|
36
|
+
Start with [good first issues](docs/GOOD_FIRST_ISSUES.md) if you do not have a live Feishu test tenant. Product decisions and subsystem acceptance criteria live in [the requirements map](docs/PRODUCT_REQUIREMENTS_MAP.md).
|
|
37
|
+
|
|
38
|
+
## Pull requests
|
|
39
|
+
|
|
40
|
+
- Keep each pull request focused and explain the user-visible behavior.
|
|
41
|
+
- Add or update tests for policy, persistence, app-server normalization, or CardKit contracts.
|
|
42
|
+
- Preserve backward migration from earlier persisted state versions.
|
|
43
|
+
- New CardKit `element_id` values must start with a letter, contain only letters/numbers/underscores, remain at most 20 characters, and be unique within a card.
|
|
44
|
+
- Document new environment variables in `.env.example` and `README.md`.
|
|
45
|
+
- Keep documented CLI/config/runbook/policy behavior backward compatible within `1.x`; otherwise propose a migration and version change first.
|
|
46
|
+
- Run `npm run check && npm test && npm run build && npm run test:package && npm audit` before requesting review.
|
|
47
|
+
|
|
48
|
+
Changes to cross-user authorization, external commands, full access, migrations, backup/rollback, redaction, or release workflows are security-sensitive. Describe the threat and failure behavior in the pull request and include both a denied path and a recovery path.
|
|
49
|
+
|
|
50
|
+
Maintainers additionally run `npm run release:check -- v<version>` and the real macOS/Linux/Feishu checklist. Contributors should not publish packages or create release tags from a pull request.
|
|
51
|
+
|
|
52
|
+
By contributing, you agree that your contribution is licensed under the MIT License in this repository.
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Feishu Codex Bridge contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.en.md
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
# Feishu Codex Console
|
|
2
|
+
|
|
3
|
+
Use Feishu to safely continue working with Codex on your own computer—without exposing SSH, an HTTP server, or a webhook port.
|
|
4
|
+
|
|
5
|
+
The bridge is local-first and outbound-only. It maps a local Codex thread to a durable Feishu workspace session: direct messages continue one context, while a top-level group prompt starts a dedicated reply thread that keeps its own project and Codex context. SQLite preserves executions, queues, approvals, review state, and team ownership behind that conversation.
|
|
6
|
+
|
|
7
|
+
## Quick start
|
|
8
|
+
|
|
9
|
+
Requirements: macOS or Linux, Node.js 22+, a local `codex login`, and a Feishu custom app with Bot, long-connection message events, and CardKit enabled.
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npx feishu-codex-console init
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
The guided installer validates the environment and Feishu capabilities, discovers your member/chat identity from one test message, writes a private configuration, installs a LaunchAgent or systemd user service, waits for both event consumers, and sends the first product card.
|
|
16
|
+
|
|
17
|
+
In Feishu, send:
|
|
18
|
+
|
|
19
|
+
```text
|
|
20
|
+
新手引导
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
The adaptive welcome card shows only the next useful action: inspect the connection when the device is offline, select an authorized project when none is ready, or start immediately with realistic examples. Team use stays a short optional tip—one project per group, new work as a new message, and follow-ups in replies—while deployment settings stay out of the member experience.
|
|
24
|
+
|
|
25
|
+
## Core commands
|
|
26
|
+
|
|
27
|
+
| Feishu message | Purpose |
|
|
28
|
+
|---|---|
|
|
29
|
+
| `控制台` / `状态` | Device, Codex, compact account-quota summary, queue, power, permission, and current project |
|
|
30
|
+
| `额度` / `/usage` / `/quota` | Full native account quota windows, reset times, plan, and available resets |
|
|
31
|
+
| `项目` / `/projects` | Search, select, favorite, and inspect authorized projects |
|
|
32
|
+
| `读取项目` / `/overview` | Build a local Git/package/file snapshot without starting Codex or spending AI tokens |
|
|
33
|
+
| `设置` / `/settings` | Model, reasoning effort, sandbox, and temporary full-access leases |
|
|
34
|
+
| `会话` / `/sessions` | Resume, compact, or start a native Codex thread |
|
|
35
|
+
| `任务` / `/tasks` | Active, queued, interrupted, and recent tasks |
|
|
36
|
+
| `团队` / `/team` | Privacy-preserving team workload and outcomes |
|
|
37
|
+
| `运行手册` / `/runbooks` | Reviewed repository task templates |
|
|
38
|
+
| `追加 <request>` | Steer the current Codex turn |
|
|
39
|
+
| `排队 <task>` | Create a separate queued task |
|
|
40
|
+
| `停止` | Stop current work without pretending written files were reverted |
|
|
41
|
+
|
|
42
|
+
Questions and read-only analysis use one editable Feishu Markdown reply that evolves from a compact working state into the final answer. Cards are reserved for controls, approvals, questions, long-running file/code work, and failures; reliable text remains the final delivery fallback.
|
|
43
|
+
|
|
44
|
+
Ordinary messages are routed locally as answers, read-only analysis, file/content writing, or code work. Questions and analysis cannot consume a write/full-access lease or create fake test/review states; only explicit code work expects test evidence. `读取项目` stays a deterministic local snapshot with zero AI tokens.
|
|
45
|
+
|
|
46
|
+
## Team and safety model
|
|
47
|
+
|
|
48
|
+
- Group-level controls are isolated per member by default. Inside a Feishu reply thread, all messages resolve to the same workspace session and Codex thread; execution control still requires explicit ownership or handoff.
|
|
49
|
+
- Administrators, operators, and viewers have separate capabilities; project ACLs hide unauthorized workspaces.
|
|
50
|
+
- Tasks keep an immutable initiator and explicit current controller for audited handoff, reclaim, and admin takeover.
|
|
51
|
+
- `danger-full-access` is a ceiling, not a permanent default. Members use temporary leases, while commit, push, release, deployment, and PR mutations still require confirmation.
|
|
52
|
+
- Repository policy and runbooks can only lower permissions. Secret questions cannot be answered through Feishu.
|
|
53
|
+
- Runtime logs, diagnostics, cards, reviews, and text fallbacks share credential redaction. Code and prompts are not uploaded as telemetry.
|
|
54
|
+
|
|
55
|
+
## Operations
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
feishu-codex-bridge doctor --fix
|
|
59
|
+
feishu-codex-bridge support-bundle
|
|
60
|
+
feishu-codex-bridge backup
|
|
61
|
+
feishu-codex-bridge version
|
|
62
|
+
npx feishu-codex-console@latest upgrade --config /absolute/path/default.env
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
An upgrade is a read-only preview until `--yes` is added. It blocks live-task replacement, creates a verified database backup, checks the new package, validates service health, and attempts automatic data/service rollback on failure.
|
|
66
|
+
|
|
67
|
+
## Documentation
|
|
68
|
+
|
|
69
|
+
- [Installation](docs/INSTALLATION.md)
|
|
70
|
+
- [Configuration](docs/CONFIGURATION.md)
|
|
71
|
+
- [Compatibility and upgrades](docs/COMPATIBILITY.md)
|
|
72
|
+
- [Product demo](docs/DEMO.md)
|
|
73
|
+
- [Security](SECURITY.md)
|
|
74
|
+
- [Architecture](docs/ARCHITECTURE.md)
|
|
75
|
+
- [V4 workspace-session interaction model](docs/V4_WORKSPACE_SESSION_FLOW.md)
|
|
76
|
+
- [Roadmap](ROADMAP.md)
|
|
77
|
+
- [Contributing](CONTRIBUTING.md)
|
|
78
|
+
|
|
79
|
+
The detailed product documentation is currently Chinese-first; this English entry covers the complete installation, safety, and operations path.
|
|
80
|
+
|
|
81
|
+
MIT licensed. Security issues should be reported privately through GitHub Security Advisories, not a public issue.
|