Skip to content

Repository files navigation

DSH-Player2

DSH-Player2 is a public reference application for exploring a trustworthy AI companion inside a real game. Its job is to prove a small, player-controlled experience—not to build an unattended automation tool or a new agent framework.

Relationship to DeepSeek Harness

This project consumes DeepSeek Harness as a plugin platform. All agent capabilities are implemented as plugins or through documented public contracts. DSH-Player2 does not modify, vendor, or import Harness internals.

Getting started

Prerequisites: Stardew Valley with SMAPI 4.5+, the .NET 6 SDK, Node.js, and an existing DeepSeek Harness checkout with this repository's companion plugin available to it. Nothing in this repository clones, downloads, or installs Harness for you.

  1. Install the mod: run dotnet build -p:OS=Windows_NT in stardew-mod/; the SMAPI build package deploys it to the game's Mods/DSHPlayer2 folder.
  2. Attach the Player2 bundle to the DSH profile you actually run: dsh plugin --profile web add ./packages/dsh-host-plugin. This is a one-time profile install, not a game-side launcher or a second DSH runtime.
  3. Start the game through StardewModdingAPI.exe. Player2 automatically wakes the normal DSH web profile (once, only if port 3080 is not already occupied); it uses DSH's existing persistent credential/configuration and owns its normal session logs.
  4. Load a save, create your companion, and play. The game joins %USERPROFILE%/.dsh/player2/bridge; if the mounted DSH plugin does not answer, it displays a traceable error and never invents a local response.

Status

The first runnable vertical slice is implemented for Stardew Valley through a small SMAPI adapter. It observes a bounded world snapshot, asks for permission using native game UI, leaves only a temporary visual receipt on agreement, and retains two player-owned state values for one next-day recall.

The cross-game product core is TypeScript. @dsh-player2/contracts defines the adapter contract and @dsh-player2/runtime enforces proposal and permission flow. The architecture guide explains why Mod, real multiplayer, and visual control are separate adapter modes, not competing product cores.

The SMAPI adapter remains deliberately narrow: it contains no LLM, DSH plugin, companion NPC, game automation, inventory mutation, or multiplayer feature. Its C# rules are a temporary P0 implementation required by the SMAPI host; the future bridge to the TypeScript runtime stays asynchronous and is not enabled until the P0 desktop validation passes.

The 0.0.2 runtime adds a text-only social turn that is unable to execute game actions: it receives a player message and current semantic observations, produces a grounded reply/question/disagreement/suggestion or explicit uncertainty, and may retain exactly one completed or failed receipt for the next game day. @dsh-player2/dsh-companion-plugin makes this a real Harness composition by contributing the NPC's procedural skill, stable social policy, and a monotonic tool guard to DSH. World grounding remains enforced by Player after the model returns.

Run npm run accept:0.0.2 to type-check every package, run the DSH plugin composition tests and runtime tests, then replay the committed social fixture without an API key, game installation, or manual UI steps. The fixture is the acceptance baseline; a live DSH provider must be compared against it rather than replacing it.

The Stardew adapter exposes that text turn with F2 through the native DSH social file bridge. Its response is displayed only after a live DSH session returns valid grounded JSON; an unavailable dispatcher, timeout, malformed response, or bridge failure is an explicit in-game development error with a trace id, never a local question or template.

@dsh-player2/dsh-host-plugin is the live transport: an installable DSH bundle mounted in the already-running profile. It creates Player-scoped agents through DSH's public agent registry, reuses DSH's selected model/credential route, and mounts the companion skill/tool policy only inside those agents. The game never starts a JSON-RPC sidecar or supplies an API key. Every DSH result carries the durable DSH session id and trace id; malformed output is written as an error, never replaced.

The 0.0.3 decision lane makes DSH useful without giving it game authority. A Player-authored, immutable file envelope carries one monotonic sequence, semantic observations, and advertised capabilities. In decision mode the Companion plugin adds game_observe, companion_propose, and game_request_action; the last tool can only write an immutable awaiting-player request. It cannot grant consent or reach GameAdapter.execute. Run npm run accept:0.0.3 for the full keyless social and decision regression, including an actual DSH tool-pipeline replay.

The Stardew host publishes one immutable day turn in the background, polls without blocking the game, shows only a validated DSH proposal through native dialogue, and writes the player's grant plus terminal receipt. It captures direct game facts only — it never turns weather into a fictional task. A timeout, invalid request, unavailable DSH process, or invalid local path is a traceable error; no deterministic local proposal is shown.

The historical dispatcher remains only as a keyless replay fixture. Production Player2 uses the mounted @dsh-player2/dsh-host-plugin: it watches the DSH-owned bridge inside the active Harness process and drives dedicated DSH sessions directly. Completion is the persisted request file validated against the schema, never the model's final message; a failed turn writes an immediate outbox/error-N.json with the DSH trace id, and it has no write path to grant, receipt, or consent files.

The 0.0.6 recall lane gives that relationship a searchable past. In decision mode the Companion plugin adds companion_recall: a read-only projection of the newest Player-persisted receipts into a bounded, newest-first digest the model may consult before proposing. Recalled outcomes are history — they cannot be cited as observations, they expose no write path, and they never grant authority — while damaged receipt files inside the scanned window are skipped and counted rather than rewritten. This is receipt-backed memory inside DSH: the receipt stays the fact source, the digest is a replaceable index, and the Player-owned settled state remains authoritative.

The 0.0.7 presence capability gives the companion a body without giving it power. The Player capability surface became a small catalog: every turn advertises visual-receipt and companion-presence, each with its own validated scope. Granting a presence proposal draws Stardew Valley's own player character template — the vanilla farmer base spritesheet, no custom art — beside the agreed tile for the same bounded, temporary lifetime as the marker. Nothing is added to the world's state; the receipt records only that the presence was shown. npm run accept:0.0.7 adds the presence golden replay and the unattended dual-end harness (npm run replay:dual): a headless C# host and a Node model process drive one real bridge directory through publish → request → scripted consent → receipt → recall with no game, no API key, and no human steps.

The 0.0.8 companion experience makes the slice playable. Every decision turn now carries a player-authored companion identity: on a save's first day the mod asks who the companion is through native question dialogue, remembers the choice on the farmer, and the DSH side uses that name and role over its configured ones — the chosen name appears in the chat, receipt, and recall HUD lines. The chat window became a bounded, multiplayer-ChatBox-style transcript with scrollback, input recall, and per-save persistence. All fixed UI strings moved into SMAPI's standard i18n folder with Simplified Chinese templates. Startup no longer requires a terminal or any key/config duplication: the mounted DSH bundle owns the bridge and exposes missing/broken native feedback as an actionable traceable error.

The 0.1.0 autonomy switch and farmer-teammate perception land together. Every decision turn now also carries a bounded self observation — the farmer's name, money, and inventory projection — so the companion plans as a teammate that can actually see the backpack it plans with, in both the decision lane and the chat. The companion.autonomy switch (P2-0011) has two tiers resolved where the plugin mounts, with nearest-scope shadowing (agent → preset recommendation → consult default); an invalid tier fails the mount loudly instead of degrading. consult keeps the proposal → native consent → receipt chain unchanged. full lets the character order grounded executions without per-action consent: the Player host executes each validated order through the same game-mechanics receipts, writes every receipt with an explicit autonomous marker (no grant file, because no player answer exists), reports the outcome in the HUD afterwards, and the DSH side still never reaches GameAdapter.execute. Receipts remain the experience-layer fact source in both tiers, and actions still only run through game mechanics — the ruling in person-deposit-model-v2 §6.6. npm run accept:0.1.0 adds the autonomous golden replay and an unattended dual-end autonomous cycle to the 0.0.8 gate chain.

Verification baseline

The reproducible keyless acceptance command for this version is npm run accept:0.1.0. It runs workspace type checks and tests, social and decision fixture replays, dispatcher and dual-end bridge cycles (including full autonomy), and the pure C# rule tests. The first dual-end run on a clean machine may restore and compile the .NET headless host before publishing its bridge file; the replay waits for that cold start and does not require a game installation or API key. node scripts/verify-docs.mjs is the standalone documentation and local-link check used by CI.

Contributing

Read AGENTS.md for the project boundaries and CONTRIBUTING.md before proposing a change. Please do not open a pull request that changes DeepSeek Harness as a side effect of Player2 work.

The current continuous-integration policy separates TypeScript and pure C# checks from the local SMAPI build that requires a legally installed copy of Stardew Valley.

License

A license has not yet been selected. Do not assume permission to reuse the repository contents until one is published.

About

No description, website, or topics provided.

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages