Decree commited on
Commit
6f3820e
Β·
1 Parent(s): acb199d

Fix: Remove --host flag for zeroclaw, fix Marimo duplicate imports

Browse files
Files changed (2) hide show
  1. Dockerfile +1 -1
  2. marimo_sandbox.py +20 -24
Dockerfile CHANGED
@@ -77,7 +77,7 @@ ACCOUNTS_EOF
77
  omniroute start --port $OMNIROUTE_PORT --accounts /app/.omniroute/accounts.json &
78
  sleep 3
79
  echo "Starting Agent Zero on port 80..."
80
- zeroclaw gateway --host 127.0.0.1 --port 80 --config /app/.zeroclaw/config.toml &
81
  sleep 5
82
  echo "Starting Marimo on port $MARIMO_PORT..."
83
  marimo run /app/marimo_sandbox.py --host 127.0.0.1 --port $MARIMO_PORT --headless &
 
77
  omniroute start --port $OMNIROUTE_PORT --accounts /app/.omniroute/accounts.json &
78
  sleep 3
79
  echo "Starting Agent Zero on port 80..."
80
+ zeroclaw gateway --port 80 --config /app/.zeroclaw/config.toml &
81
  sleep 5
82
  echo "Starting Marimo on port $MARIMO_PORT..."
83
  marimo run /app/marimo_sandbox.py --host 127.0.0.1 --port $MARIMO_PORT --headless &
marimo_sandbox.py CHANGED
@@ -13,9 +13,9 @@ app = marimo.App()
13
  def _():
14
  import marimo as mo
15
  import os
16
-
17
  WORKSPACE = os.environ.get("WORKSPACE", "/app/workspace")
18
- return WORKSPACE, mo
19
 
20
 
21
  @app.cell
@@ -30,13 +30,13 @@ def _(mo):
30
  def _(mo):
31
  """Code Editor Cell"""
32
  mo.md("### πŸ’» Code Editor")
33
-
34
  code_editor = mo.ui.code_editor(
35
  language="python",
36
  value="# Write your code here\nprint('Hello from Marimo Zero!')",
37
  label=""
38
  )
39
-
40
  def run_code(code):
41
  import sys
42
  from io import StringIO
@@ -53,9 +53,9 @@ def _(mo):
53
  return mo.md(f"❌ Error:\n```\n{str(e)}\n```")
54
  finally:
55
  sys.stdout = old_stdout
56
-
57
  result = run_code(code_editor.value)
58
-
59
  mo.vstack([
60
  code_editor,
61
  mo.ui.run_button(label="▢️ Run"),
@@ -65,62 +65,58 @@ def _(mo):
65
 
66
 
67
  @app.cell
68
- def _(mo, WORKSPACE):
69
  """File Browser Cell"""
70
  mo.md("### πŸ“ Workspace Files")
71
-
72
- import os
73
-
74
  def list_files():
75
  if not os.path.exists(WORKSPACE):
76
  return mo.md("⚠️ Workspace not found")
77
-
78
  files = os.listdir(WORKSPACE)
79
  if not files:
80
  return mo.md("πŸ“­ Empty workspace")
81
-
82
  file_list = "\n".join([f"- πŸ“„ `{f}`" for f in sorted(files)])
83
  return mo.md(file_list)
84
-
85
  list_files()
86
  return
87
 
88
 
89
  @app.cell
90
- def _(mo, WORKSPACE):
91
  """File Editor Cell"""
92
  mo.md("### ✏️ File Editor")
93
-
94
- import os
95
-
96
  filename = mo.ui.text(
97
  label="Filename:",
98
  value="example.md",
99
  full_width=False
100
  )
101
-
102
  filepath = os.path.join(WORKSPACE, filename.value)
103
-
104
  def read_file(name):
105
  path = os.path.join(WORKSPACE, name)
106
  if os.path.exists(path):
107
  with open(path, 'r') as f:
108
  return f.read()
109
  return "# New file\n\nStart writing..."
110
-
111
  content = mo.ui.text_area(
112
  label="Content:",
113
  value=read_file(filename.value),
114
  full_width=True,
115
  height=300
116
  )
117
-
118
  def save_file(name, text):
119
  path = os.path.join(WORKSPACE, name)
120
  with open(path, 'w') as f:
121
  f.write(text)
122
  return mo.md(f"βœ… Saved to `{path}`")
123
-
124
  mo.vstack([
125
  filename,
126
  content,
@@ -134,10 +130,10 @@ def _(mo, WORKSPACE):
134
  def _(mo):
135
  """Terminal Output Cell"""
136
  mo.md("### πŸ“Š Output")
137
-
138
  mo.md("""
139
  View execution results, plots, and outputs here.
140
-
141
  **Tip:** Use `print()` in code cells to see output here.
142
  """)
143
  return
 
13
  def _():
14
  import marimo as mo
15
  import os
16
+
17
  WORKSPACE = os.environ.get("WORKSPACE", "/app/workspace")
18
+ return WORKSPACE, mo, os
19
 
20
 
21
  @app.cell
 
30
  def _(mo):
31
  """Code Editor Cell"""
32
  mo.md("### πŸ’» Code Editor")
33
+
34
  code_editor = mo.ui.code_editor(
35
  language="python",
36
  value="# Write your code here\nprint('Hello from Marimo Zero!')",
37
  label=""
38
  )
39
+
40
  def run_code(code):
41
  import sys
42
  from io import StringIO
 
53
  return mo.md(f"❌ Error:\n```\n{str(e)}\n```")
54
  finally:
55
  sys.stdout = old_stdout
56
+
57
  result = run_code(code_editor.value)
58
+
59
  mo.vstack([
60
  code_editor,
61
  mo.ui.run_button(label="▢️ Run"),
 
65
 
66
 
67
  @app.cell
68
+ def _(mo, WORKSPACE, os):
69
  """File Browser Cell"""
70
  mo.md("### πŸ“ Workspace Files")
71
+
 
 
72
  def list_files():
73
  if not os.path.exists(WORKSPACE):
74
  return mo.md("⚠️ Workspace not found")
75
+
76
  files = os.listdir(WORKSPACE)
77
  if not files:
78
  return mo.md("πŸ“­ Empty workspace")
79
+
80
  file_list = "\n".join([f"- πŸ“„ `{f}`" for f in sorted(files)])
81
  return mo.md(file_list)
82
+
83
  list_files()
84
  return
85
 
86
 
87
  @app.cell
88
+ def _(mo, WORKSPACE, os):
89
  """File Editor Cell"""
90
  mo.md("### ✏️ File Editor")
91
+
 
 
92
  filename = mo.ui.text(
93
  label="Filename:",
94
  value="example.md",
95
  full_width=False
96
  )
97
+
98
  filepath = os.path.join(WORKSPACE, filename.value)
99
+
100
  def read_file(name):
101
  path = os.path.join(WORKSPACE, name)
102
  if os.path.exists(path):
103
  with open(path, 'r') as f:
104
  return f.read()
105
  return "# New file\n\nStart writing..."
106
+
107
  content = mo.ui.text_area(
108
  label="Content:",
109
  value=read_file(filename.value),
110
  full_width=True,
111
  height=300
112
  )
113
+
114
  def save_file(name, text):
115
  path = os.path.join(WORKSPACE, name)
116
  with open(path, 'w') as f:
117
  f.write(text)
118
  return mo.md(f"βœ… Saved to `{path}`")
119
+
120
  mo.vstack([
121
  filename,
122
  content,
 
130
  def _(mo):
131
  """Terminal Output Cell"""
132
  mo.md("### πŸ“Š Output")
133
+
134
  mo.md("""
135
  View execution results, plots, and outputs here.
136
+
137
  **Tip:** Use `print()` in code cells to see output here.
138
  """)
139
  return