mirror of
https://github.com/deepseek-ai/deepseek-harness
synced 2026-08-15 21:04:50 +00:00
Minimal Electron shell over the DSH JSON-RPC runtime — a first-look at what a ChatGPT.app-style host on top of the DeepSeek Harness looks like, with the harness's normally-invisible internals (trace timeline, context surface, subagent tree, compaction, plugin registry, rubrics) brought forward as first-class UI surfaces so plugin authors and researchers can see what the agent is actually doing. Runs against three keyless-to-live profiles (stdio-echo works on master out of the box; daemon-echo / daemon-vibe-echo activate once the daemon-demo lands; stdio-deepseek and daemon-vibe hit the real DeepSeek API when you supply a key). HARNESS_DEV auto-resolves to the in-repo runtime when this shell ships under examples/desktop/, so a fresh clone launches without config; env DSH_DEV_ROOT overrides for custom layouts, and a sibling deepseek-harness-dev/ checkout is the original dev workflow. Cold-clone gate (P0 fixes for first-time-clone usability): - HARNESS_DEV: 3-candidate resolver (env → walk-up in-repo marker → sibling), unit-tested via mock fs so ordering is locked without needing either real layout on disk. - config yml leaves rewritten at assemble time so the sibling-clone paths (../../deepseek-harness-dev/examples/echo-agent/…) become the in-repo paths (../../echo-agent/…) in the released tree — source yml stays usable for local dev, released tree ships a working shape. - pnpm-workspace.yaml allowBuilds.electron = true (was placeholder). - missing-key card in stdio-deepseek offers a one-click switch to stdio-echo (the keyless profile that works on master) rather than daemon-echo (blocked on the not-yet-shipped daemon-demo). - assemble-oss-release.sh rewrites the source-side breadcrumb name 'dsh-desktop-demo' → 'dsh-desktop' for the released package.json. FOUC guard on the onboarding gate (41fc5df carried) keeps the first-launch splash from flashing before the runtime probe finishes. Test suite (1634 tests in source, 3990 in the runtime repo) covers resolver ordering, renderer classifiers, trace timeline shape, compaction diff rendering, rubric parity, and the missing-key onboarding paths.
72 lines
2.8 KiB
Python
72 lines
2.8 KiB
Python
#!/usr/bin/env python3
|
|
# Regenerate src/renderer/rubrics-seed.js from fixtures/rubrics/*.md +
|
|
# fixtures/annotation/sample-sessions.json. Run after editing any of those.
|
|
#
|
|
# Rationale: the renderer runs from file:// with strict CSP, so it cannot
|
|
# fetch() the .md and .json files at runtime. Inlining them into a small
|
|
# `-seed.js` script keeps the fixtures as the source of truth while giving
|
|
# the renderer a synchronous, dependency-free path to them. Same pattern
|
|
# as src/renderer/debug-fixtures.js.
|
|
|
|
import json
|
|
import os
|
|
import sys
|
|
|
|
ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
|
RUBRICS_DIR = os.path.join(ROOT, "fixtures", "rubrics")
|
|
SAMPLES_PATH = os.path.join(ROOT, "fixtures", "annotation", "sample-sessions.json")
|
|
OUT = os.path.join(ROOT, "src", "renderer", "rubrics-seed.js")
|
|
|
|
RUBRIC_ORDER = [
|
|
"bug-fix.md",
|
|
"svg-generation.md",
|
|
"multi-turn-feedback.md",
|
|
"code-review.md",
|
|
# Typed-primitive fixtures (LangSmith FeedbackSchema parity) — one
|
|
# rubric per primitive so the demo drawer can showcase all three
|
|
# scoring shapes without needing a real evaluator.
|
|
"correctness-score.md",
|
|
"intent-triage.md",
|
|
"passes-bench.md",
|
|
]
|
|
|
|
|
|
def main() -> int:
|
|
rubrics = []
|
|
for name in RUBRIC_ORDER:
|
|
path = os.path.join(RUBRICS_DIR, name)
|
|
with open(path, "r", encoding="utf-8") as f:
|
|
rubrics.append(f.read())
|
|
with open(SAMPLES_PATH, "r", encoding="utf-8") as f:
|
|
samples = json.load(f)
|
|
lines = []
|
|
lines.append("// Auto-inlined fixture seeds for the Rubrics + Annotation pages.")
|
|
lines.append("// Renderer runs at file:// so we inline the SKILL.md blobs and sample")
|
|
lines.append("// sessions here instead of relying on fetch(). To refresh:")
|
|
lines.append("// python3 scripts/regen-rubrics-seed.py")
|
|
lines.append("//")
|
|
lines.append("// The 4 rubrics live at fixtures/rubrics/*.md; the sample sessions live at")
|
|
lines.append("// fixtures/annotation/sample-sessions.json.")
|
|
lines.append("")
|
|
lines.append("'use strict'")
|
|
lines.append("")
|
|
lines.append("const RUBRICS_SEED = " + json.dumps(rubrics, ensure_ascii=False, indent=2))
|
|
lines.append("")
|
|
lines.append("const ANNOTATION_SAMPLES = " + json.dumps(samples, ensure_ascii=False, indent=2))
|
|
lines.append("")
|
|
lines.append("if (typeof window !== 'undefined') {")
|
|
lines.append(" window.__dshRubricsSeed = RUBRICS_SEED")
|
|
lines.append(" window.__dshAnnotationSamples = ANNOTATION_SAMPLES")
|
|
lines.append("}")
|
|
lines.append("if (typeof module !== 'undefined' && module.exports) {")
|
|
lines.append(" module.exports = { RUBRICS_SEED, ANNOTATION_SAMPLES }")
|
|
lines.append("}")
|
|
with open(OUT, "w", encoding="utf-8") as f:
|
|
f.write("\n".join(lines) + "\n")
|
|
print("wrote", OUT)
|
|
return 0
|
|
|
|
|
|
if __name__ == "__main__":
|
|
sys.exit(main())
|