import sys
import os
sys.path.append("/app/agent-node")
from agent_node.skills.shell import ShellSkill

class DummySync:
    def get_session_dir(self, sid):
        return "/tmp"

class DummySandbox:
    def verify(self, cmd):
        return True, "OK"
    @property
    def policy(self):
        return {}

def main():
    s = ShellSkill(sync_mgr=DummySync())
    class Task:
        task_id = "t1"
        payload_json = "pwd\n"
        session_id = "s1"
        trace_id = "tr1"

    def on_event(msg):
        print("ON_EVENT:", msg)

    def on_complete(tid, res, tr):
        print("ON_COMPLETE:", res)

    s.execute(Task(), DummySandbox(), on_complete, on_event)
    import time
    time.sleep(2)

if __name__ == '__main__':
    main()
