feat: Initialize Workspace with metadata fields

- Initialize `children`, `created`, `updated`, `is_saved`
- Add `time` import for timestamp fields
- Remove unused `ui.console` import
- Update package version constant to `1.0.0`
This commit is contained in:
Mahmoud-Emad
2025-09-08 15:45:17 +03:00
parent eeb5e207f2
commit ff92f6eff2
2 changed files with 8 additions and 3 deletions

View File

@@ -2,8 +2,8 @@ module heroprompt
import freeflowuniverse.herolib.core.base
import freeflowuniverse.herolib.core.playbook { PlayBook }
import freeflowuniverse.herolib.ui.console
import json
import time
__global (
heroprompt_global map[string]&Workspace
@@ -23,8 +23,13 @@ pub mut:
pub fn new(args ArgsGet) !&Workspace {
mut obj := Workspace{
name: args.name
name: args.name
children: []
created: time.now()
updated: time.now()
is_saved: true
}
set(obj)!
return get(name: args.name)!
}

View File

@@ -3,7 +3,7 @@ module heroprompt
import time
import freeflowuniverse.herolib.core.playbook
pub const version = '0.0.0'
pub const version = '1.0.0'
const singleton = false
const default = true