Files
herolib/lib/data/encoderhero
Mahmoud-Emad f6c077c6b5 refactor: simplify heroprompt workspace selection model
- Introduce HeropromptChild to unify file and dir items
- Replace nested Dir/File structs with a flat `children` list
- Generate prompt content by traversing the filesystem on-demand
- Add `workspace.add_file` for direct file selection
- Simplify `workspace.add_dir` to only add the directory path
2025-08-17 11:41:29 +03:00
..
2024-12-25 09:23:31 +01:00
...
2025-08-06 08:50:32 +02:00
...
2025-02-06 21:09:20 +03:00
2024-12-25 09:23:31 +01:00
2024-12-25 09:23:31 +01:00

hero Encoder


#!/usr/bin/env -S v -n -w -gc none  -cc tcc -d use_openssl -enable-globals run

import freeflowuniverse.herolib.data.encoderhero
import freeflowuniverse.herolib.core.base
import time

struct Person {
mut:
	name     string
	age      int = 20
	birthday time.Time
}

mut person := Person{
    name: 'Bob'
    birthday: time.now()
}
heroscript := encoderhero.encode[Person](person)!

println(heroscript)

person2 := encoderhero.decode[Person](heroscript)!

println(person2)