This commit is contained in:
2025-08-24 13:56:54 +02:00
parent 9398d653d3
commit 2253ef71e6
23 changed files with 64 additions and 131 deletions

6
.zed/keymap.json Normal file
View File

@@ -0,0 +1,6 @@
{
"context": "Workspace",
"bindings": {
"cmd-r": ["task::Spawn", { "task_name": "ET", "reveal_target": "center" }]
}
}

47
.zed/tasks.json Normal file
View File

@@ -0,0 +1,47 @@
[
{
"label": "ET",
"command": "for i in {1..5}; do echo \"Hello $i/5\"; sleep 1; done",
//"args": [],
// Env overrides for the command, will be appended to the terminal's environment from the settings.
"env": { "foo": "bar" },
// Current working directory to spawn the command into, defaults to current project root.
//"cwd": "/path/to/working/directory",
// Whether to use a new terminal tab or reuse the existing one to spawn the process, defaults to `false`.
"use_new_terminal": true,
// Whether to allow multiple instances of the same task to be run, or rather wait for the existing ones to finish, defaults to `false`.
"allow_concurrent_runs": false,
// What to do with the terminal pane and tab, after the command was started:
// * `always` — always show the task's pane, and focus the corresponding tab in it (default)
// * `no_focus` — always show the task's pane, add the task's tab in it, but don't focus it
// * `never` — do not alter focus, but still add/reuse the task's tab in its pane
"reveal": "always",
// What to do with the terminal pane and tab, after the command has finished:
// * `never` — Do nothing when the command finishes (default)
// * `always` — always hide the terminal tab, hide the pane also if it was the last tab in it
// * `on_success` — hide the terminal tab on task success only, otherwise behaves similar to `always`
"hide": "never",
// Which shell to use when running a task inside the terminal.
// May take 3 values:
// 1. (default) Use the system's default terminal configuration in /etc/passwd
// "shell": "system"
// 2. A program:
// "shell": {
// "program": "sh"
// }
// 3. A program with arguments:
// "shell": {
// "with_arguments": {
// "program": "/bin/bash",
// "args": ["--login"]
// }
// }
"shell": "system",
// Whether to show the task line in the output of the spawned task, defaults to `true`.
"show_summary": true,
// Whether to show the command line in the output of the spawned task, defaults to `true`.
// "show_output": true,
// Represents the tags for inline runnable indicators, or spawning multiple tasks at once.
"tags": ["DODO"]
}
]

10
examples/osal/tmux.vsh Executable file
View File

@@ -0,0 +1,10 @@
#!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run
import freeflowuniverse.herolib.osal.tmux
mut t := tmux.new()!
t.session_delete('main')!
println(t)
t.window_new(name: 'test', cmd: 'mc', reset: true)!
println(t)

View File

@@ -1 +0,0 @@
tmux

View File

@@ -1,15 +0,0 @@
module main
import freeflowuniverse.herolib.osal.tmux
fn do() ! {
mut t := tmux.new()!
t.session_delete('main')!
println(t)
t.window_new(name: 'test', cmd: 'mc', reset: true)!
println(t)
}
fn main() {
do() or { panic(err) }
}

View File

@@ -1,2 +0,0 @@
0263829989b6fd954f72baaf2fc64bc2e2f01d692d4de72986ea808f6e99813f|1662456738|1|test2.md
87428fc522803d31065e7bce3cf03fe475096631e5e07bbd7a0fde60c4cf25c7|1662456738|1|test.md

View File

@@ -1,5 +0,0 @@
a3a5e715f0cc574a73c3f9bebb6bc24f32ffd5b67b387244c2c909da779a1478|1662456738|1|test3.md
ef2d127de37b942baad06145e54b0c619a1f22327b2ebbcfbec78f5564afe39d|1662456824|2|test3.md
e7f6c011776e8db7cd330b54174fd76f7d0216b612387a5ffcfb81e6f0919683|1662456824|3|test3.md
ef2d127de37b942baad06145e54b0c619a1f22327b2ebbcfbec78f5564afe39d|1662457271|4|test3.md
ca978112ca1bbdcafac231b39a23dc4da786eff8147c4e72b9807785afee48bb|1662457271|5|test3.md

View File

@@ -1,33 +0,0 @@
module main
import freeflowuniverse.herolib.vault
import freeflowuniverse.herolib.core.pathlib
import os
const testdir2 = os.dir(@FILE) + '/easy'
fn do() ? {
mut v := vault.do(testdir2)?
remember := v.hash()
mut p := pathlib.get('${testdir2}/subdir/subsudir/test3.md')
p.write('5')?
mut v2 := vault.do(testdir2)? // will remember the change
p.write('a')?
mut v3 := vault.do(testdir2)? // will remember the change
println(v3.superlist())
println(v3.hash())
// restore to the original scan
mut v4 := vault.restore(0)?
remember3 := v.hash()
assert remember == remember3
v3.delete()?
}
fn main() {
do() or { panic(err) }
}

View File

@@ -1,26 +0,0 @@
module main
import freeflowuniverse.herolib.core.pathlib
import freeflowuniverse.herolib.vault
import os
const testdir = os.dir(@FILE) + '/../../pathlib/examples/test_path'
fn do() ? {
// just to check it exists
mut p := pathlib.get_dir(testdir, false)?
p.absolute()
println(p)
// will load the vault, doesn't process files yet
// mut vault1 := vault.scan('myvault', mut p)?
// println(vault)
// vault1.delete()?
mut vault2 := vault.scan('myvault', mut p)?
vault2.shelve()?
// println(vault2)
vault2.delete()?
}
fn main() {
do() or { panic(err) }
}

View File

@@ -1,22 +0,0 @@
module datamodel
// typically 1GB of memory, but can be adjusted based based on size of machine
@[heap]
pub struct ComputeSlice {
pub mut:
nodeid u32 // the node in the grid, there is an object describing the node
id int // the id of the slice in the node
mem_gb f64
storage_gb f64
passmark int
vcores int
cpu_oversubscription int
storage_oversubscription int
price_range []f64 = [0.0, 0.0]
gpus u8 // nr of GPU's see node to know what GPU's are
price_cc f64 // price per slice (even if the grouped one)
pricing_policy PricingPolicy
sla_policy SLAPolicy
}

View File

@@ -1,16 +0,0 @@
module datamodel
// 1GB of storage
@[heap]
pub struct StorageSlice {
pub mut:
nodeid u32 // the node in the grid
id int // the id of the slice in the node, are tracked in the node itself
price_cc f64 // price per slice (even if the grouped one)
pricing_policy PricingPolicy //copied from node which is part of nodegroup
sla_policy SLAPolicy
}