hokkoro 0.0.0-stage → 0.1.0
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/README.md +54 -2
- package/bin/hokkoro.js +16 -0
- package/dist/assets/browser-C5uuMlgA.js +1 -0
- package/dist/assets/index-BYiDVHau.js +4523 -0
- package/dist/assets/index-Bd-W7RaG.js +7 -0
- package/dist/index.html +559 -0
- package/dist/models.json +194 -0
- package/dist/ui/icons/alert.png +0 -0
- package/dist/ui/icons/done.png +0 -0
- package/dist/ui/icons/energy.png +0 -0
- package/dist/ui/icons/heart.png +0 -0
- package/dist/ui/icons/inn.png +0 -0
- package/dist/ui/icons/letter.png +0 -0
- package/dist/ui/icons/mail.png +0 -0
- package/dist/ui/icons/maker.png +0 -0
- package/dist/ui/icons/painted/alert.png +0 -0
- package/dist/ui/icons/painted/bookshelf.png +0 -0
- package/dist/ui/icons/painted/close.png +0 -0
- package/dist/ui/icons/painted/demo.png +0 -0
- package/dist/ui/icons/painted/done.png +0 -0
- package/dist/ui/icons/painted/energy.png +0 -0
- package/dist/ui/icons/painted/eye.png +0 -0
- package/dist/ui/icons/painted/hammer.png +0 -0
- package/dist/ui/icons/painted/heart.png +0 -0
- package/dist/ui/icons/painted/inn.png +0 -0
- package/dist/ui/icons/painted/keyboard.png +0 -0
- package/dist/ui/icons/painted/lantern.png +0 -0
- package/dist/ui/icons/painted/letter.png +0 -0
- package/dist/ui/icons/painted/lofi.png +0 -0
- package/dist/ui/icons/painted/mail.png +0 -0
- package/dist/ui/icons/painted/maker.png +0 -0
- package/dist/ui/icons/painted/maptable.png +0 -0
- package/dist/ui/icons/painted/microphone.png +0 -0
- package/dist/ui/icons/painted/notes.png +0 -0
- package/dist/ui/icons/painted/photo.png +0 -0
- package/dist/ui/icons/painted/pin.png +0 -0
- package/dist/ui/icons/painted/quest.png +0 -0
- package/dist/ui/icons/painted/question.png +0 -0
- package/dist/ui/icons/painted/research.png +0 -0
- package/dist/ui/icons/painted/seal.png +0 -0
- package/dist/ui/icons/painted/send.png +0 -0
- package/dist/ui/icons/painted/settings.png +0 -0
- package/dist/ui/icons/painted/sleep.png +0 -0
- package/dist/ui/icons/painted/star.png +0 -0
- package/dist/ui/icons/painted/switcher.png +0 -0
- package/dist/ui/icons/painted/thinking.png +0 -0
- package/dist/ui/icons/painted/time.png +0 -0
- package/dist/ui/icons/painted/workbench.png +0 -0
- package/dist/ui/icons/photo.png +0 -0
- package/dist/ui/icons/quest.png +0 -0
- package/dist/ui/icons/question.png +0 -0
- package/dist/ui/icons/settings.png +0 -0
- package/dist/ui/icons/sleep.png +0 -0
- package/dist/ui/icons/star.png +0 -0
- package/dist/ui/icons/thinking.png +0 -0
- package/dist/ui/icons/time.png +0 -0
- package/dist/ui/src/icon_sheet.png +0 -0
- package/dist/ui/src/icon_sheet_alt.png +0 -0
- package/dist/ui/worlds/academy.jpg +0 -0
- package/dist/ui/worlds/cozy.jpg +0 -0
- package/dist/ui/worlds/factory.jpg +0 -0
- package/dist/ui/worlds/fantasy.jpg +0 -0
- package/dist/ui/worlds/oasis.jpg +0 -0
- package/dist/ui/worlds/office.jpg +0 -0
- package/dist/ui/worlds/scifi.jpg +0 -0
- package/dist/ui/worlds/tower.jpg +0 -0
- package/package.json +56 -4
- package/scripts/bridge/village-hook.mjs +82 -0
- package/server/harness/bridge.js +238 -0
- package/server/harness/demo.js +183 -0
- package/server/harness/keys.js +55 -0
- package/server/harness/npcs.js +89 -0
- package/server/harness/providers.js +158 -0
- package/server/harness/roles.js +44 -0
- package/server/harness/runner.js +184 -0
- package/server/harness/sim.js +142 -0
- package/server/harness/terminal.js +235 -0
- package/server/harness/themes.js +91 -0
- package/server/harness/tools.js +313 -0
- package/server/harness/village.js +971 -0
- package/server/harness/workshop.js +35 -0
- package/server/index.js +330 -0
- package/server/paths.js +12 -0
- package/themes/academy/theme.json +209 -0
- package/themes/cozy/theme.json +225 -0
- package/themes/factory/theme.json +209 -0
- package/themes/fantasy/theme.json +212 -0
- package/themes/oasis/theme.json +189 -0
- package/themes/office/theme.json +205 -0
- package/themes/scifi/theme.json +204 -0
- package/themes/tower/theme.json +199 -0
package/README.md
CHANGED
|
@@ -1,3 +1,55 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Hokkoro
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
A cozy painted village where your AI agents are the villagers. You walk around (or work from desk mode), give
|
|
4
|
+
villagers jobs, approve what they want to do, and read what they deliver as letters. Build a workshop on a plot and a
|
|
5
|
+
new villager moves in. Early access.
|
|
6
|
+
|
|
7
|
+
## Play
|
|
8
|
+
|
|
9
|
+
You need Node 20.11 or newer. In a terminal:
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npx hokkoro
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Your village opens in the browser. Keep the terminal open while you play. Without a key the villagers act it out (demo
|
|
16
|
+
mode); to make them work for real, open Connect in the village and paste an Anthropic API key. Your village (keys,
|
|
17
|
+
residents, workshops, the library, downloaded models) stays on your computer in `~/.hokkoro`. Another port:
|
|
18
|
+
`PORT=8788 npx hokkoro`.
|
|
19
|
+
|
|
20
|
+
## Develop
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
cp .env.example .env # then put an ANTHROPIC_API_KEY in it
|
|
24
|
+
npm install
|
|
25
|
+
npm run dev # server on :8787, client on :5173
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Open http://localhost:5173. WASD or arrows to move, click to walk, E to interact, Esc to close a panel.
|
|
29
|
+
|
|
30
|
+
Release for players: bump `version` in package.json, then `npm run release` (builds, uploads new models to the R2
|
|
31
|
+
bucket hokkoro-assets under their content hash, publishes the app without models to npm as `hokkoro`).
|
|
32
|
+
|
|
33
|
+
## What is where
|
|
34
|
+
|
|
35
|
+
- `server/harness/npcs.js` the villagers: persona, look, home, workshop. Add one here and it appears in the world.
|
|
36
|
+
- `server/harness/tools.js` what villagers can do: say, notebook, ask the player, deliver, message another villager, and
|
|
37
|
+
for the ranger fetch_url (needs the player's approval each time) and dns_lookup.
|
|
38
|
+
- `server/harness/runner.js` one villager turn: a manual tool-use loop on the Anthropic SDK, adaptive thinking, effort
|
|
39
|
+
from `VILLAGE_EFFORT`, prompt caching on the system block.
|
|
40
|
+
- `server/harness/village.js` the state and the orchestration: the Mayor assigns a quest, assignees run in parallel,
|
|
41
|
+
villagers can ask each other (two hops max), talks keep a short memory per villager, every change is an event.
|
|
42
|
+
- `server/index.js` Express + WebSocket. In production it also serves `dist/`.
|
|
43
|
+
- `client/src/world.js` the village meshes. `npc.js` a villager (placeholder body from `look`, swapped for
|
|
44
|
+
`public/models/<id>.glb` when present), name tag, speech bubble, walking. `ui.js` the panels. `main.js` scene,
|
|
45
|
+
camera, player, input.
|
|
46
|
+
|
|
47
|
+
## Models for the villagers
|
|
48
|
+
|
|
49
|
+
Export a GLB per villager (Tripo or anything else) to `client/public/models/<id>.glb` with id one of `mayor`, `scribe`,
|
|
50
|
+
`ranger`, `tinker`, `bard`. It is scaled to 1.7 units tall and placed on the ground. Reload the page.
|
|
51
|
+
|
|
52
|
+
## Cost
|
|
53
|
+
|
|
54
|
+
Every quest is a few model calls (the Mayor, each assignee, any relay). The status line at the top left shows calls and
|
|
55
|
+
tokens for the session. `VILLAGE_MODEL=claude-haiku-5-5` is the cheap setting while iterating on the world.
|
package/bin/hokkoro.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// `npx hokkoro`: start your village on this computer and open it in the browser. Your village (keys, residents,
|
|
3
|
+
// workshops, the library, the downloaded models) lives in ~/.hokkoro, or HOKKORO_HOME; PORT picks another port.
|
|
4
|
+
import os from 'node:os';
|
|
5
|
+
import path from 'node:path';
|
|
6
|
+
|
|
7
|
+
const [major, minor] = process.versions.node.split('.').map(Number);
|
|
8
|
+
if (major < 20 || (major === 20 && minor < 11)) {
|
|
9
|
+
console.error(`Hokkoro needs Node 20.11 or newer (this is ${process.versions.node}). Get it at https://nodejs.org`);
|
|
10
|
+
process.exit(1);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
process.env.NODE_ENV = 'production';
|
|
14
|
+
process.env.VILLAGE_DATA ||= process.env.HOKKORO_HOME || path.join(os.homedir(), '.hokkoro');
|
|
15
|
+
process.env.VILLAGE_OPEN ??= '1';
|
|
16
|
+
await import('../server/index.js');
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{g as c}from"./index-Bd-W7RaG.js";function f(t,i){for(var o=0;o<i.length;o++){const e=i[o];if(typeof e!="string"&&!Array.isArray(e)){for(const r in e)if(r!=="default"&&!(r in t)){const s=Object.getOwnPropertyDescriptor(e,r);s&&Object.defineProperty(t,r,s.get?s:{enumerable:!0,get:()=>e[r]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var n,a;function b(){return a||(a=1,n=function(){throw new Error("ws does not work in the browser. Browser clients must use the native WebSocket object")}),n}var u=b();const w=c(u),p=f({__proto__:null,default:w},[u]);export{p as b};
|