Connect your AI
Your AI assistant can read and write this wiki, your memories, the domain and the objects through the API. It takes three things: network access, a token and the diesel2 skill.
- Let your AI reach d2. Allow
d2.aiheroapps.com(or*.aiheroapps.com) in your AI's network or web-access settings. In Claude, that's the list of allowed domains for code execution in your project or workspace. - Make a token for it. Reading is open (except in private projects), but saving needs a token. Open Tokens from your user menu in the project (or go to
/tokens), make one for your AI with a name, a level and an expiry, and give it to your AI in the chat when it asks. Never paste it into a topic or a memory; revoke it on the same page when you're done. - Install the diesel2 skill. Open diesel2, press Markdown, and save the text as
SKILL.mdin a folder nameddiesel2. Add that folder to your AI as a skill; in Claude, zip the folder and upload it as a custom skill. - Try it. Ask your AI to "list the topics in my d2 project". It should come back with Home and the rest of your project's topics.
- Let it remember. Ask it to "remember in d2 that I follow copper producers". A new entry appears under ai:memories, where you can read and correct it.
If something goes wrong, see When things go wrong.
Write a wiki topic
- Open the Wiki and press New topic. Names are letters, digits,
-and_, with no spaces. - Write markdown on the left; the preview on the right updates as you type.
- Link a topic with
[[Frostline]]and an object with[[Company:FLR]]. A link to a topic that doesn't exist yet shows in red; click it to create that topic. - Press Save (or โ/Ctrl + S). The first save asks for the write token.
Add a class to the domain
- Open mining-domain and press Edit, or write a Spec topic of your own.
- Add a line such as
$class Drone (@key id: String, @label name: String, owner: <>Company). - Save. The class appears in the model graph and the object browser.
- If the save shows problems, fix them; the object browser's home page also lists the model checks. domain-modelling has the rules.
Add or edit an object
- Open the class in the object browser, for example Company.
- Press New Company, or open an object and press Edit.
- Fill in the form, press Review changes, then Save. Required fields must have a value; a field marked
?in the class can stay empty.
Add an image or a file
- Open Files in the menu and pick one or more files: png, jpg, gif, webp, pdf or txt, up to 5 MB each.
- Add a few tags (they're how you find files again) and tick members only if the public shouldn't see it.
- Press Upload, then Copy markdown on the file and paste it into a topic.
Files are served from cdn.aidieselapps.com, a separate address, so an uploaded file can never act as a page of your project. Your AI can upload them too (the skill explains how).
Try an expression
- Open the Fiddle.
- Type one expression per line, for example
[1, 2, 3] map (x => x * 2), orname = valueto use it on later lines. - Results show on the right. Pick Load an example to see what the language can do.
Write a rule and run it
- Open the Fiddle and pick the Specs tab. hello is open: a rule that answers the message
hello.greet. - Change the greeting, for example
"Hi, ${name}!". The right side checks it as you type. Press Save. - Pick the Stories tab and hello. It sends the message and runs its
$expectlines; the one you just broke shows โ with what it got. - Fix the story's
$expectto match, and it runs again as you type. Save it too. - For more, pick order (guards, a discount, a rejected order) or alerts (lists, notifications, shared flow values). Runs never change your data.
Make your own stylesheet
Don't like the built-in looks? Your AI can make you a new one. A stylesheet is just a Style topic, so all it needs is Connect your AI.
- Ask your AI. For example: "In d2, make me a stylesheet called yahoo: the logo in the top bar says YAHOO, the background is dark green and the fonts are magenta."
- Let it check its work. It saves a topic
Style:yahoo. If d2 reports problems with it, the AI fixes them and saves again. - Pick it. Open Styles, find it under Style topics and press Use this stylesheet. Every page switches, the logo text included.
- Tweak it. Ask for changes ("make the links yellow"), or open the topic and edit its
styleblock yourself. Reload a page to see the result. - Go back any time: press Use this stylesheet on stylesheet-orange1, the default.
Start over
- Go to Home and press the red Reset all button.
- Confirm. The demo domain, its objects and every wiki topic go back to how they started, and everything you added is gone, your Style topics included.
When things go wrong
- "write needs a bearer token" or E_AUTH: the token is missing or wrong. In a browser, the page asks again; for your AI, give it the token again.
- Your AI says the connection is blocked:
d2.aiheroapps.comisn't allowed in its network settings yet (step 1 of Connect your AI). - E_VALIDATION when saving an object: the message names each field that doesn't fit the class. Fix those fields and save again.
- A stylesheet shows "Has errors" on Styles: the list under it says which lines are wrong. Fix the topic, or ask your AI to.
- Your changes vanished: storage is in memory for now, so a redeploy, a restart or Reset all brings back the demo. Keep anything important somewhere else as well.
- Something else: every page has a twin in the API; add
/api/v2in front of the path to see the raw JSON, for example /api/v2/dom/val/Company:FLR.