Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions docs/current-status.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,11 @@ dogfood 证据。
- 入口:`deepseek`、`deepseek chat`、`deepseek run`、`deepseek tui`、`deepseek exec`。
- TUI:Plan / Agent / YOLO 模式、approval modal、command palette、session/thread 视图、
MCP 管理、setup/onboarding、provider/model picker。
- 首跑:`deepseek quickstart` 以只读方式展示 workspace config、API key env、TTY 状态、
下一步命令和 starter tasks;`--json` 可用于安装验证和自动化排障。
- 首跑:`deepseek quickstart` 以只读方式展示 workspace config、API key env、model/base
URL、TTY 状态、下一步命令和 starter tasks;`deepseek config provider
[show|list|<name> [model]]`、`deepseek config model [show|list|<model>]` 和
`deepseek config auth [ENV] --stdin` 已支持 provider/model 选择与安全 `.env` 写入;
`--json` 可用于安装验证和自动化排障。
- REPL:raw-mode line editor、history、session list/load completion、SIGINT cancel、
`/save`、`/load`、`/sessions`、custom slash commands。
- Runtime:`.dscode/runtime/` 下持久化 sessions、threads、turns、items、events、
Expand Down Expand Up @@ -106,8 +109,10 @@ dogfood 证据。
已手动发布并验证。
3. 在干净 Linux/macOS 机器上安装 systemd/launchd user services,记录
`service-doctor --installed` 和 `service-smoke --installed` 证据。
4. 补真实 VS Code CLI runner 或 manual GUI fixture 证据。
5. 持续和 Claude Code CLI / Codex CLI / DeepSeek-TUI 做核心 loop 对照,只保留会影响真实用户使用的差距。
4. 产出并审核基于 `docs/demo/record-2048-demo.sh` 的 30-60 秒 GIF/MP4,
展示从空 repo 到可玩 2048 的 model-backed 可视化流程。
5. 补真实 VS Code CLI runner 或 manual GUI fixture 证据。
6. 持续和 Claude Code CLI / Codex CLI / DeepSeek-TUI 做核心 loop 对照,只保留会影响真实用户使用的差距。

## 推荐公开表述

Expand Down
32 changes: 32 additions & 0 deletions docs/demo/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ model-backed transcript. It shows the source-evidence loop: failing `cargo test`
`deepseek exec`, a one-line Rust patch, and passing `cargo test`. A polished GIF
or MP4 can still be added later for launch pages.

`record-2048-demo.sh` captures a more visual launch demo: an empty disposable
web repository, a model-backed `deepseek exec` run that builds a playable 2048
game with plain HTML/CSS/JS, file validation, `git diff --stat`, and an
optional local preview server for browser gameplay capture.

## Model-Backed Demo Capture

Use `record-model-backed-demo.sh` to capture real model-backed CLI evidence
Expand Down Expand Up @@ -61,3 +66,30 @@ The verifier can be checked without a model call:
docs/demo/verify-model-backed-demo.js --self-test
docs/demo/render-model-backed-demo-svg.js --self-test
```

## 2048 Launch Demo Capture

Dry-run the 2048 capture plan without creating a repo or spending model calls:

```bash
docs/demo/record-2048-demo.sh --dry-run
docs/demo/record-2048-demo.sh --redaction-self-test
```

Record a real model-backed transcript:

```bash
printf '%s\n' '<deepseek-api-key>' > /tmp/deepseek-2048.key
chmod 600 /tmp/deepseek-2048.key
DEEPSEEK_2048_KEY_FILE=/tmp/deepseek-2048.key docs/demo/record-2048-demo.sh
```

Record with a local preview server for GIF/MP4 capture:

```bash
DEEPSEEK_2048_KEY_FILE=/tmp/deepseek-2048.key docs/demo/record-2048-demo.sh --serve
```

The script prints the disposable demo repo and transcript path. Keep raw
transcripts only after reviewing them for local paths and generated content
quality. Use `--cleanup` only after recording any browser gameplay you need.
269 changes: 269 additions & 0 deletions docs/demo/record-2048-demo.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,269 @@
#!/usr/bin/env bash
set -euo pipefail

usage() {
cat <<'EOF'
Usage: docs/demo/record-2048-demo.sh [--dry-run] [--serve] [--cleanup] [--api-key-stdin] [--redaction-self-test] [--help]

Records a model-backed DeepSeekCode launch demo against an empty disposable
web repo:
empty repo -> deepseek exec builds a playable 2048 game -> validate files ->
git diff --stat -> optional local preview server.

Environment:
DEEPSEEK_API_KEY Required for model-backed demo evidence.
DEEPSEEK_2048_KEY_FILE Read DEEPSEEK_API_KEY from a first-line key file
outside this repository when DEEPSEEK_API_KEY is unset.
DEEPSEEK_2048_BIN DeepSeekCode binary to run. Defaults to
target/debug/deepseek, then PATH deepseek, then
builds target/debug/deepseek.
DEEPSEEK_2048_BUDGET Agent step budget. Defaults to 16.
DEEPSEEK_2048_OUT Transcript path. Defaults to a timestamped file
in docs/demo/.
DEEPSEEK_2048_WORKDIR Parent directory for the disposable repo.
DEEPSEEK_2048_PROMPT Override the coding task prompt.

The transcript is source evidence for GIF/MP4 capture. Review generated media
before committing it. Do not publish a run unless it used a real model call.
EOF
}

dry_run=0
serve=0
cleanup=0
api_key_stdin=0
redaction_self_test=0

while [[ $# -gt 0 ]]; do
case "$1" in
--dry-run)
dry_run=1
shift
;;
--serve)
serve=1
shift
;;
--cleanup)
cleanup=1
shift
;;
--api-key-stdin)
api_key_stdin=1
shift
;;
--redaction-self-test)
redaction_self_test=1
shift
;;
--help|-h)
usage
exit 0
;;
*)
echo "unknown argument: $1" >&2
usage >&2
exit 2
;;
esac
done

script_dir=$(CDPATH= cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)
repo_root=$(CDPATH= cd -- "$script_dir/../.." && pwd)
run_id=$(date +%Y%m%d-%H%M%S)
demo_budget=${DEEPSEEK_2048_BUDGET:-16}
demo_out=${DEEPSEEK_2048_OUT:-"$repo_root/docs/demo/deepseek-code-2048-demo-$run_id.log"}
work_parent=${DEEPSEEK_2048_WORKDIR:-"${TMPDIR:-/tmp}"}
demo_repo="$work_parent/deepseek-code-2048-demo-$run_id"
demo_prompt=${DEEPSEEK_2048_PROMPT:-"Build a playable 2048 web game in this empty repository using plain HTML, CSS, and JavaScript. Create index.html, styles.css, and app.js. Requirements: a 4x4 board, keyboard arrow controls, tile merging, score tracking, random new tiles, win/game-over messaging, and a restart button. Keep the UI polished but lightweight. After writing files, run a validation command that verifies index.html, styles.css, and app.js exist and prints their byte sizes."}

redact_demo_stream() {
awk '
function redact_all(line, needle, replacement, out, pos) {
if (length(needle) == 0) {
return line
}
out = ""
while ((pos = index(line, needle)) > 0) {
out = out substr(line, 1, pos - 1) replacement
line = substr(line, pos + length(needle))
}
return out line
}
BEGIN {
names[1] = "DEEPSEEK_API_KEY"
names[2] = "OPENAI_API_KEY"
names[3] = "ANTHROPIC_API_KEY"
names[4] = "DEEPSEEK_2048_KEY_FILE"
for (i = 1; i <= 4; i++) {
value = ENVIRON[names[i]]
if (length(value) > 0) {
count += 1
secrets[count] = value
replacements[count] = "<" names[i] ":redacted>"
}
}
}
{
line = $0
for (i = 1; i <= count; i++) {
line = redact_all(line, secrets[i], replacements[i])
}
print line
}
'
}

if [[ "$redaction_self_test" -eq 1 ]]; then
previous_key_set=0
previous_key_value=
if [[ -n "${DEEPSEEK_API_KEY+x}" ]]; then
previous_key_set=1
previous_key_value=$DEEPSEEK_API_KEY
fi
export DEEPSEEK_API_KEY="${DEEPSEEK_API_KEY:-demo-secret-for-redaction}"
test_secret=$DEEPSEEK_API_KEY
output=$(printf 'before %s after\n' "$test_secret" | redact_demo_stream)
if [[ "$previous_key_set" -eq 1 ]]; then
DEEPSEEK_API_KEY=$previous_key_value
export DEEPSEEK_API_KEY
else
unset DEEPSEEK_API_KEY
fi
if [[ "$output" == *"$test_secret"* ]]; then
echo "redaction self-test failed: secret remained in output" >&2
exit 1
fi
if [[ "$output" != *"<DEEPSEEK_API_KEY:redacted>"* ]]; then
echo "redaction self-test failed: redaction marker missing" >&2
exit 1
fi
echo "redaction self-test ok"
exit 0
fi

if [[ "$dry_run" -eq 1 ]]; then
echo "DeepSeekCode 2048 demo dry run"
echo "repo_root: $repo_root"
echo "demo_repo: $demo_repo"
echo "transcript: $demo_out"
echo "budget: $demo_budget"
echo "serve: $serve"
echo "prompt: $demo_prompt"
echo "status: dry-run only; no API call, repository creation, or transcript write"
exit 0
fi

if [[ -z "${DEEPSEEK_API_KEY:-}" && -n "${DEEPSEEK_2048_KEY_FILE:-}" ]]; then
if [[ ! -f "$DEEPSEEK_2048_KEY_FILE" ]]; then
echo "DEEPSEEK_2048_KEY_FILE does not exist: $DEEPSEEK_2048_KEY_FILE" >&2
exit 1
fi
key_file_dir=$(CDPATH= cd -- "$(dirname -- "$DEEPSEEK_2048_KEY_FILE")" && pwd)
key_file_abs="$key_file_dir/$(basename -- "$DEEPSEEK_2048_KEY_FILE")"
case "$key_file_abs" in
"$repo_root"/*)
echo "DEEPSEEK_2048_KEY_FILE must live outside this repository: $key_file_abs" >&2
exit 1
;;
esac
IFS= read -r DEEPSEEK_API_KEY < "$key_file_abs"
export DEEPSEEK_API_KEY
fi

if [[ -z "${DEEPSEEK_API_KEY:-}" && "$api_key_stdin" -eq 1 ]]; then
IFS= read -r DEEPSEEK_API_KEY
export DEEPSEEK_API_KEY
fi

if [[ -z "${DEEPSEEK_API_KEY:-}" ]]; then
echo "DEEPSEEK_API_KEY is required for model-backed 2048 demo evidence." >&2
echo "Use DEEPSEEK_2048_KEY_FILE outside the repo or --api-key-stdin to avoid putting the key in shell history." >&2
exit 1
fi

if [[ -n "${DEEPSEEK_2048_BIN:-}" ]]; then
deepseek_bin=$DEEPSEEK_2048_BIN
elif [[ -x "$repo_root/target/debug/deepseek" ]]; then
deepseek_bin="$repo_root/target/debug/deepseek"
elif command -v deepseek >/dev/null 2>&1; then
deepseek_bin=$(command -v deepseek)
else
echo "target/debug/deepseek not found; building debug binary" >&2
cargo build --manifest-path "$repo_root/Cargo.toml" --bin deepseek
deepseek_bin="$repo_root/target/debug/deepseek"
fi

if [[ ! -x "$deepseek_bin" ]]; then
echo "DeepSeekCode binary is not executable: $deepseek_bin" >&2
exit 1
fi

mkdir -p "$demo_repo"
mkdir -p "$(dirname -- "$demo_out")"

git -C "$demo_repo" init -q
git -C "$demo_repo" config user.email "demo@deepseekcode.local"
git -C "$demo_repo" config user.name "DeepSeekCode Demo"
cat > "$demo_repo/README.md" <<'EOF'
# DeepSeekCode 2048 Demo

This disposable repository starts empty except for this README. The demo asks
DeepSeekCode to build a playable 2048 web game with plain HTML, CSS, and
JavaScript.
EOF
git -C "$demo_repo" add README.md
git -C "$demo_repo" commit -q -m "Create empty 2048 demo repo"

run_session() {
cd "$demo_repo"
echo "DeepSeekCode 2048 model-backed demo"
echo "workspace: $demo_repo"
echo
echo "$ find . -maxdepth 2 -type f | sort"
find . -maxdepth 2 -type f | sort
echo
echo "$ DSCODE_AUTO_APPROVE_WRITES=1 DSCODE_AUTO_APPROVE_SHELL=1 $deepseek_bin exec --budget $demo_budget \"<2048 prompt>\""
DSCODE_AUTO_APPROVE_WRITES=1 \
DSCODE_AUTO_APPROVE_SHELL=1 \
"$deepseek_bin" exec --budget "$demo_budget" "$demo_prompt"
echo
echo "$ test -s index.html && test -s styles.css && test -s app.js"
test -s index.html && test -s styles.css && test -s app.js
echo
echo "$ wc -c index.html styles.css app.js"
wc -c index.html styles.css app.js
echo
echo "$ git diff --stat"
git diff --stat
echo
echo "$ git diff -- index.html styles.css app.js | sed -n '1,220p'"
git diff -- index.html styles.css app.js | sed -n '1,220p'
if [[ "$serve" -eq 1 ]]; then
echo
echo "$ python3 -m http.server 4173"
echo "Preview URL: http://127.0.0.1:4173"
echo "Stop the server with Ctrl+C after recording browser gameplay."
python3 -m http.server 4173
else
echo
echo "Preview command: cd $demo_repo && python3 -m http.server 4173"
echo "Preview URL: http://127.0.0.1:4173"
fi
}

set +e
run_session 2>&1 | redact_demo_stream | tee "$demo_out"
session_status=${PIPESTATUS[0]}
Comment on lines +256 to +257
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Propagate transcript pipeline failures

The script stores only PIPESTATUS[0] after run_session | redact_demo_stream | tee "$demo_out", so it reports success whenever run_session succeeds even if redaction or tee fails (for example, output path not writable or disk full). In those cases the command can exit 0 with a missing/partial transcript, which breaks launch-evidence automation and hides capture failures.

Useful? React with 👍 / 👎.

set -e

echo
echo "transcript: $demo_out"
echo "demo repo: $demo_repo"

if [[ "$cleanup" -eq 1 ]]; then
rm -rf "$demo_repo"
echo "demo repo removed"
fi

exit "$session_status"
2 changes: 2 additions & 0 deletions docs/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -567,6 +567,8 @@ curl http://127.0.0.1:8765/runtime
- `deepseek update release-smoke [--version ... --repo ... --base-url ... --platform ... --out ... --keep-workdir --json]`:下载、校验并执行当前平台 release binary install smoke
- `deepseek update publish-status [--dist ... --npm-dist ... --live-evidence-verification ... --strict --json]`:检查 npm/Homebrew 发布所需 token、tap 配置、平台包、release checksum 和 online dogfood evidence
- `deepseek pr live-status <pr> [--require-write --json]`:只读检查真实 GitHub PR 是否具备 live review/retry fixture 前置条件
- `deepseek config provider [show|list|<name> [model]]` / `deepseek config model [show|list|<model>]`:查看或切换首跑 provider/model 配置;例如 `deepseek config provider deepseek pro`
- `deepseek config auth [ENV] --stdin`:从 stdin 安全写入 `.env`,避免把 API key 放进 shell argv
- `deepseek config network allow|deny <host>`:把网络 host 策略写回项目 `.dscode/config.toml`,用于持久化 web/search/fetch 的允许或拒绝规则
- `deepseek agents run-task <task-id>`:认领并执行 pending durable runtime task,写回同一 thread 的 turns/items/usage/status
- `deepseek agents daemon [--interval-ms 1000] [--budget N]`:本地轮询 `.dscode/runtime`,触发到期 automation、执行 thread-linked pending task,并自动追加 non-destructive compaction summary
Expand Down
20 changes: 15 additions & 5 deletions docs/launch/demo-script.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# Demo Script

Use this to record a 30-60 second launch demo. The goal is to show the product
working, not to explain every feature.
working, not to explain every feature. For the most visual launch asset, start
with the 2048 recorder in [../demo/README.md](../demo/README.md).

## Recording Setup

Expand All @@ -16,11 +17,11 @@ working, not to explain every feature.

1. Install or verify the CLI.
2. Run first-run checks.
3. Open a small repo.
4. Ask DeepSeekCode to inspect the repo and make a bounded change.
3. Open an empty 2048 demo repo or a small disposable code repo.
4. Ask DeepSeekCode to make a bounded change or generate the playable 2048 app.
5. Approve file/shell actions.
6. Show the diff.
7. Run tests.
6. Show the generated files or diff.
7. Run tests, validation, or local browser preview.
8. Close with the GitHub repo URL.

## Command Flow
Expand All @@ -47,6 +48,13 @@ git diff --stat
git diff
```

For the 2048 launch asset:

```bash
DEEPSEEK_2048_KEY_FILE=/tmp/deepseek-2048.key docs/demo/record-2048-demo.sh
DEEPSEEK_2048_KEY_FILE=/tmp/deepseek-2048.key docs/demo/record-2048-demo.sh --serve
```

If a live model call is too slow for a public recording, use the committed
model-backed SVG in the README and record a shorter install/quickstart clip.

Expand All @@ -59,6 +67,8 @@ model-backed SVG in the README and record a shorter install/quickstart clip.
- The agent reads repo context before editing.
- File changes are reviewable with `git diff`.
- Tests or checks run in the same terminal loop.
- The 2048 demo reaches a visual, playable result rather than only a terminal
transcript.
- The project is public beta and asks for real terminal-workflow feedback.

## Social Preview Brief
Expand Down
Loading
Loading