New neutral module for workspace
This commit is contained in:
parent
e5e40281af
commit
26dfdaccc3
18
lib/workspace.py
Normal file
18
lib/workspace.py
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
import os
|
||||||
|
|
||||||
|
# Pemilik tunggal state workspace sesi agent.
|
||||||
|
# Modul lain (tools.coder, tools.syshendrik, tools.vision, interfaces.tui)
|
||||||
|
# membaca/mengganti workspace lewat getter/setter di sini, bukan menyimpan
|
||||||
|
# salinan state sendiri, agar tidak ada dua sumber kebenaran.
|
||||||
|
|
||||||
|
CURRENT_WORKSPACE = os.getcwd()
|
||||||
|
|
||||||
|
def get_current_workspace():
|
||||||
|
global CURRENT_WORKSPACE
|
||||||
|
return CURRENT_WORKSPACE
|
||||||
|
|
||||||
|
def set_current_workspace(path):
|
||||||
|
global CURRENT_WORKSPACE
|
||||||
|
# chdir dulu agar state hanya ter-update ketika perpindahan benar-benar sukses
|
||||||
|
os.chdir(path)
|
||||||
|
CURRENT_WORKSPACE = path
|
||||||
Loading…
Reference in New Issue
Block a user