TS API Spec
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 38/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- python, typescript
Research direction
Review the TypeScript API examples around Dimos.connect, subscriptions, QoS, and RPC, then inspect dimos.core.module's web_module and web_init entry points and DimosWebsocket.blueprint. Done means the web-side and module-side interfaces described here work with the shown same-origin setup.
Written by the indexing model from the issue text.
Description
Web side usage
import { Dimos } from "/dimos.js" // will be on JSR
import { decode } from "https://esm.sh/jsr/@dimos/msgs@0.1.4"
const app = await Dimos.connect({
decode, // `decode` doesn't know of some datatype it will be a raw `Uint8Array`
dimosWs: {
host: location.hostname,
port: Number(location.port),
// OPTIONAL:
// whitelist: ["/tf"],
// blacklist: ["/global_map"],
},
})
//
// subscribe
//
const unsub = app.subscribe("/tf", (message) => console.log(message.data, message.ts))
unsub()
// set QoS dynamically
app.setQos("/tf", {
rate: 30, // tells backend to rate limit (not global limit, just this frontend)
reliability: "best_effort", // or "reliable" — buffer in order instead of dropping
durability: "transient_local", // new subscribers get the last value right away
depth: 1, // outbox buffer size
})
// get everything (debug stream-name typos)
app.subscribeAll((m) => console.log(m.stream, m.data))
// just grab one (resolves null after timeoutMs)
const tf = await app.peek("/tf", { timeoutMs: 1000 })
//
// Rpc
//
await app.modules.GO2Connection.standup()
const pose = await app.modules.Localization.get_pose()
Module Side Usage
Any module can provide a frontend without starting its own server
from dimos.core.module import web_module, web_init
@web_module
class MyRobotThing(Module):
# ONLY THIS method is needed for a frontend
@web_init
def _web_init(self) -> dict[str, str | Path]:
return {
# will be available at http://localhost:9669/MyRobotThing/index.html
"index.html": Path(__file__).parent / "index.html", # served at /MyRobotThing
"icon": Path(__file__).parent / "logo.svg", # favicon — any format (SVG/PNG = high-res)
}
#
# normal blah-blah module stuff
#
color_image: Out[Image]
@rpc
def start(self):
super().start()
logger.log("blah blah blah")
Dimos Core
One Websocket Server (not specific to JS/TS) DimosWebsocket
DimosWebsocket.blueprint(
port=9669, # pulls from global_config if not given
host="12.01.20.102", # pulls from global_config if not given
whitelist=[
"global_map",
],
# alternative:
# blacklist=[
#
# ],
)
- This subscribes-all like rerun bridge
- Backend global blacklist/whitelist
- Per-connection QoS/blacklist/whitelist (to avoid flooding frontend)
- Is a general static webpage server
Wire it up alongside the server and your robot, then open the page:
blueprint = autoconnect(
MyRobot.blueprint(),
DimosWebsocket.blueprint(),
MyRobotThing.blueprint()
)
# → http://localhost:9669/MyRobotThing (it loads /dimos.js and connects same-origin)
Synced from DIM-1013 by summer
- Dominant language
- Python
- Stars
- 4.5k
- Forks
- 808
- Avg merge
- 3d 5h
- Merged PRs (30d)
- 233
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from dimensionalOS/dimos
-
bug mac
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
dimensionalOS/dimos#4134 ·
-
bug rust
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
dimensionalOS/dimos#4055 ·
-
bug install
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
dimensionalOS/dimos#3971 ·
-
bug mac
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
dimensionalOS/dimos#3918 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
dimensionalOS/dimos#3898 · 1 comment ·
All issues in dimensionalOS/dimos
Similar issues
-
area/auth bug comp/agent P3 platform/discord type/security
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
NousResearch/hermes-agent#117848 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
bancolombia/sentinel#23 ·
-
test md OpenCI
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
integration:quickjs org:external priority:backlog topic:code-interpreter topic:middleware type:feature
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
langchain-ai/deepagents#6450 ·
-
bug client
Difficulty 2/5 1-3 hours Newbie friendliness 88/100