Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -196,10 +196,10 @@ evaluation_results/*
src/dataset_generation/update_generated_types.py

# Ignore everything in the data folder
src/os_assistant/tools/agentic_rag/data/*
src/dagent/tools/agentic_rag/data/*

# Except the folder itself (optional)
!src/os_assistant/tools/agentic_rag/data/
!src/dagent/tools/agentic_rag/data/

# Except this specific file
!src/os_assistant/tools/agentic_rag/data/example.sqlite
!src/dagent/tools/agentic_rag/data/example.sqlite
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ setup_and_pull:
uv run setup_and_pull_general.py

docker_build:
docker build -t os_assistant_dev .
docker build -t dagent_dev .
# --build-arg FILE_ID=1TDkZPvfC_x1dh5C6EX8ayKTEdYfx1Wb3

docker_run:
docker run -it --rm --name os_assistant_dev_container os_assistant_dev
docker run -it --rm --name dagent_dev_container dagent_dev

streamlit_run:
uv run streamlit run streamlit_app/app.py
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
[![PythonVersion](https://img.shields.io/badge/python-3.12-blue)](https://img.shields.io/badge/python-3.12%20%7C%203.9%20%7C%203.10-blue)
<!-- [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black) -->

# os_assistant
This is a modern template for a python project with the pyproject.toml with some fields to change based on project. It also has tox configured, docs dir for github pages, .github dir with tox-gh-actions configured and more.
# DAgent
This project is an attempt to make a personal assistant that is aware of the device it is running on using the latest agentic technology. The architecture we use for the workflow graph is very simple and easily augmented in the future.

## Prerequisites
Make sure [uv](https://docs.astral.sh/uv/getting-started/installation/#installation-methods) is installed. Here is the install script on macOS and Linux
Expand Down
94 changes: 62 additions & 32 deletions docs/index.html
Original file line number Diff line number Diff line change
@@ -1,31 +1,44 @@
<!doctype html>
<html lang="en">

<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>os_assistant — modern Python project template</title>
<meta name="description" content="os_assistant: a modern Python project template with uv, tox, pre-commit, GitHub Pages docs/, and a CLI (osassis)."/>
<title>DAgent</title>
<meta name="description" content="DAgent: A device-aware assistant." />
<link rel="icon" href="favicon.svg" type="image/svg+xml" />
<link rel="manifest" href="manifest.webmanifest" />
<!-- Social previews -->
<meta property="og:title" content="os_assistant — modern Python project template" />
<meta property="og:description" content="uv-based workflow, tox, pre-commit, GitHub Actions, docs/ for GitHub Pages, and a CLI (osassis)." />
<meta property="og:title" content="DAgent: A device-aware assistant" />
<!-- <meta property="og:description" content="uv-based workflow, tox, pre-commit, GitHub Actions, docs/ for GitHub Pages, and a CLI (dagent)." /> -->
<meta property="og:type" content="website" />
<meta property="og:url" content="https://<your-user>.github.io/<your-repo>/" />
<meta property="og:image" content="og.png" />
<link rel="preload" href="styles.css" as="style" />
<link rel="stylesheet" href="styles.css" />
<style>
/* minor badge tweaks to look nice against dark bg */
.badges img { vertical-align: middle; }
.kbd { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: rgba(255,255,255,.06); border:1px solid #1d2030; border-radius:6px; padding:.1rem .35rem; }
.badges img {
vertical-align: middle;
}

.kbd {
font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
background: rgba(255, 255, 255, .06);
border: 1px solid #1d2030;
border-radius: 6px;
padding: .1rem .35rem;
}
</style>
</head>

<body>
<header class="site-header container">
<a class="brand" href="./" aria-label="os_assistant home">
<svg width="28" height="28" viewBox="0 0 24 24" aria-hidden="true"><path d="M12 2l9 5v10l-9 5-9-5V7l9-5z" fill="currentColor"/></svg>
<span>os_assistant</span>
<a class="brand" href="./" aria-label="dagent home">
<svg width="28" height="28" viewBox="0 0 24 24" aria-hidden="true">
<path d="M12 2l9 5v10l-9 5-9-5V7l9-5z" fill="currentColor" />
</svg>
<span>dagent</span>
</a>
<nav class="nav">
<a href="#quickstart">Quickstart</a>
Expand All @@ -40,14 +53,16 @@
<!-- Hero -->
<section class="hero container">
<h1>A modern Python template with <span class="accent">uv</span>, tox & a real CLI</h1>
<p class="lead">Ready-to-develop structure (pyproject, tox, pre-commit), a <code>docs/</code> site for GitHub Pages, and a typed CLI: <code>osassis</code>.</p>
<p class="lead">Ready-to-develop structure (pyproject, tox, pre-commit), a <code>docs/</code> site for GitHub
Pages, and a typed CLI: <code>dagent</code>.</p>

<div class="badges" style="margin:12px 0 6px;">
<a href="https://opensource.org/license/mit/">
<img alt="license: MIT" src="https://img.shields.io/badge/license-MIT-blue">
</a>
<a href="https://github.com/omar-abdelgawad/python-project-template/actions">
<img alt="Tests" src="https://github.com/omar-abdelgawad/python-project-template/actions/workflows/tests.yml/badge.svg">
<img alt="Tests"
src="https://github.com/omar-abdelgawad/python-project-template/actions/workflows/tests.yml/badge.svg">
</a>
<img alt="Python versions" src="https://img.shields.io/badge/python-3.10%20%7C%203.11%20%7C%203.12-blue">
</div>
Expand All @@ -58,12 +73,12 @@ <h1>A modern Python template with <span class="accent">uv</span>, tox & a real C
</div>

<pre class="code-block" aria-label="shell example"><code>$ git clone &lt;repo_url&gt;
$ cd os_assistant
$ cd dagent
$ uv sync
$ pre-commit install
$ cp .env.example .env
$ python setup_and_pull_general.py
$ osassis chat</code></pre>
$ dagent chat</code></pre>
</section>

<!-- Why/Features -->
Expand All @@ -76,11 +91,14 @@ <h3>Clean project setup</h3>
</article>
<article class="card">
<h3>uv workflow</h3>
<p>Fast env + deps (<a href="https://docs.astral.sh/uv/getting-started/installation/#installation-methods">uv</a>). Works cross-platform; plays nice with CI.</p>
<p>Fast env + deps (<a
href="https://docs.astral.sh/uv/getting-started/installation/#installation-methods">uv</a>). Works
cross-platform; plays nice with CI.</p>
</article>
<article class="card">
<h3>Quality gates</h3>
<p><code>tox</code> runs <code>pytest</code>, <code>ruff</code>, <code>mypy</code>. Pre-commit keeps diffs clean.</p>
<p><code>tox</code> runs <code>pytest</code>, <code>ruff</code>, <code>mypy</code>. Pre-commit keeps diffs
clean.</p>
</article>
<article class="card">
<h3>Docs-ready</h3>
Expand All @@ -101,7 +119,7 @@ <h3>Install</h3>
<ol class="steps">
<li><strong>Clone and enter:</strong>
<pre class="code-block"><code>git clone &lt;repo_url&gt;
cd os_assistant</code></pre>
cd dagent</code></pre>
</li>
<li><strong>Sync deps (creates venv):</strong>
<pre class="code-block"><code>uv sync</code></pre>
Expand All @@ -111,58 +129,66 @@ <h3>Install</h3>
<pre class="code-block"><code>pre-commit install</code></pre>
</li>
<li><strong>Configure environment:</strong>
<details class="details"><summary>Linux/macOS</summary>
<details class="details">
<summary>Linux/macOS</summary>
<pre class="code-block"><code>cp .env.example .env</code></pre>
</details>
<details class="details"><summary>Windows (CMD)</summary>
<details class="details">
<summary>Windows (CMD)</summary>
<pre class="code-block"><code>copy .env.example .env</code></pre>
</details>
<p>Edit <code>.env</code> → set <code>MODEL_BASE_URL</code> (your ngrok link), e.g.:</p>
<pre class="code-block"><code>MODEL_BASE_URL=https://your-ngrok-link.ngrok.io</code></pre>
</li>
<li><strong>Setup & pull models:</strong>
<pre class="code-block"><code>python setup_and_pull_general.py</code></pre>
<small>Script: loads <code>.env</code>, sets <code>OLLAMA_HOST</code> from <code>MODEL_BASE_URL</code>, runs <code>ollama pull</code> for required models.</small>
<small>Script: loads <code>.env</code>, sets <code>OLLAMA_HOST</code> from <code>MODEL_BASE_URL</code>, runs
<code>ollama pull</code> for required models.</small>
</li>
</ol>
</section>

<!-- CLI -->
<section id="cli" class="container">
<h2>CLI usage — <code>osassis</code></h2>
<h2>CLI usage — <code>dagent</code></h2>

<h3>Interactive Chat</h3>
<pre class="code-block"><code>osassis chat</code></pre>
<pre class="code-block"><code>dagent chat</code></pre>

<h3>System Tracing</h3>
<p>Start tracing file system events in a directory:</p>
<pre class="code-block"><code>osassis trace start file_system --dir path/to/watch</code></pre>
<pre class="code-block"><code>dagent trace start file_system --dir path/to/watch</code></pre>
<p>View trace logs with time filtering:</p>
<pre class="code-block"><code>osassis trace show file_system --start "yesterday" --end "now"</code></pre>
<pre class="code-block"><code>dagent trace show file_system --start "yesterday" --end "now"</code></pre>
<p>Clear logs for a tracing domain:</p>
<pre class="code-block"><code>osassis trace clear file_system</code></pre>
<pre class="code-block"><code>dagent trace clear file_system</code></pre>
</section>

<!-- Build -->
<section id="build" class="container">
<h2>Build (dev editable)</h2>
<p>Editable install via <code>uv pip</code>:</p>
<pre class="code-block"><code>uv pip install -e .</code></pre>
<p>We also use <a href="https://www.gnu.org/software/make/">make</a> as a simple task runner (check the <code>Makefile</code>).</p>
<p>We also use <a href="https://www.gnu.org/software/make/">make</a> as a simple task runner (check the
<code>Makefile</code>).
</p>
</section>

<!-- Testing -->
<section id="testing" class="container">
<h2>Testing with tox</h2>
<p><code>tox</code> creates isolated envs and runs <code>pytest</code>, <code>ruff</code>, and <code>mypy</code>:</p>
<p><code>tox</code> creates isolated envs and runs <code>pytest</code>, <code>ruff</code>, and <code>mypy</code>:
</p>
<pre class="code-block"><code>make tox</code></pre>

<details class="details" style="margin-top:8px;">
<summary>CI badges</summary>
<div class="badges" style="margin:10px 0 0;">
<a href="https://opensource.org/license/mit/"><img alt="license: MIT" src="https://img.shields.io/badge/license-MIT-blue"></a>
<a href="https://opensource.org/license/mit/"><img alt="license: MIT"
src="https://img.shields.io/badge/license-MIT-blue"></a>
<a href="https://github.com/omar-abdelgawad/python-project-template/actions">
<img alt="Tests" src="https://github.com/omar-abdelgawad/python-project-template/actions/workflows/tests.yml/badge.svg">
<img alt="Tests"
src="https://github.com/omar-abdelgawad/python-project-template/actions/workflows/tests.yml/badge.svg">
</a>
<img alt="Python versions" src="https://img.shields.io/badge/python-3.10%20%7C%203.11%20%7C%203.12-blue">
</div>
Expand All @@ -178,20 +204,24 @@ <h2>FAQ</h2>
</details>
<details class="faq">
<summary>What’s the <code>setup_and_pull_general.py</code> script doing?</summary>
<p>Loads <code>.env</code>, exports <code>OLLAMA_HOST</code> from <code>MODEL_BASE_URL</code>, and pulls required models via <code>ollama pull</code>.</p>
<p>Loads <code>.env</code>, exports <code>OLLAMA_HOST</code> from <code>MODEL_BASE_URL</code>, and pulls
required models via <code>ollama pull</code>.</p>
</details>
<details class="faq">
<summary>Where do docs come from?</summary>
<p>This page is served from <code>docs/</code> on GitHub Pages. Add more static pages under <code>docs/</code> as you grow.</p>
<p>This page is served from <code>docs/</code> on GitHub Pages. Add more static pages under <code>docs/</code>
as you grow.</p>
</details>
</section>
</main>

<footer class="site-footer container">
<span>© <span id="year"></span> os_assistant • <a href="https://github.com/omar-abdelgawad/python-project-template">GitHub</a></span>
<span>© <span id="year"></span> dagent • <a
href="https://github.com/omar-abdelgawad/python-project-template">GitHub</a></span>
<span><a href="mailto:team@example.com">team@example.com</a></span>
</footer>

<script src="script.js"></script>
</body>
</html>

</html>
12 changes: 8 additions & 4 deletions docs/manifest.webmanifest
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
{
"name": "os_assistant",
"short_name": "os_assistant",
"name": "dagent",
"short_name": "dagent",
"start_url": ".",
"display": "standalone",
"background_color": "#0b0c10",
"theme_color": "#6ee7b7",
"icons": [
{ "src": "favicon.svg", "sizes": "any", "type": "image/svg+xml" }
{
"src": "favicon.svg",
"sizes": "any",
"type": "image/svg+xml"
}
]
}
}
16 changes: 8 additions & 8 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ build-backend = "setuptools.build_meta"
where = ["src"] # list of folders that contain the packages (["."] by default)

[project]
name = "os-assistant" # appears on pip list only
name = "dagent" # appears on pip list only
dynamic = ["version"]
dependencies = [
"langchain==0.3.26",
Expand All @@ -24,7 +24,7 @@ dependencies = [
"langchain_huggingface==0.3.0",
"streamlit==1.52.1",
"mcp>=1.0.0",
"Pillow>=10.0.0", # Vision/Image processing support
"Pillow>=10.0.0", # Vision/Image processing support
]

requires-python = ">=3.12"
Expand All @@ -35,29 +35,29 @@ authors = [
{ name = "Ahmed Gamea", email = "Ahmed.gamea@ejust.edu.eg" },
{ name = "Abdelaziz Serour", email = "abdelaziz.serour@ejust.edu.eg" },
]
description = "A Python package for agents that have os-level knowledge."
description = "A Python package for agents that have device-level knowledge."
readme = "README.md"
license = { file = "LICENSE" }
keywords = ["agents", "flow", "llm", "ollama", "knowledge"]
classifiers = ["Programming Language :: Python :: 3.12"]

[project.scripts]
osassis = "os_assistant.__main__:main"
osassis = "dagent.__main__:main"

[dependency-groups]
dev = ["mypy", "ruff", "pytest", "pytest-cov", "tox", "pre-commit"]

[tool.setuptools.package-data]
os_assistant = ["py.typed", "configs/*.yaml", "prompts/**/*.yaml"]
dagent = ["py.typed", "configs/*.yaml", "prompts/**/*.yaml"]
[tool.setuptools.dynamic]
version = { attr = "os_assistant.__version__" }
version = { attr = "dagent.__version__" }

[project.urls]
Repository = "https://github.com/eyad-hussein/os_assistant"
Repository = "https://github.com/AhmedMo1242/os_assistant"

###################################################################################################
[tool.pytest.ini_options]
addopts = "--cov=os_assistant" #include all packages under src directory
addopts = "--cov=dagent" #include all packages under src directory
testpaths = ["tests"]

[tool.mypy]
Expand Down
2 changes: 1 addition & 1 deletion scripts/test_coding_agent.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import argparse

from os_assistant.tools.code_agent.core.run_code import run_code_execution
from dagent.tools.code_agent.core.run_code import run_code_execution

if __name__ == "__main__":
parser = argparse.ArgumentParser(description="Code execution agent")
Expand Down
File renamed without changes.
30 changes: 30 additions & 0 deletions src/dagent/__main__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
from collections.abc import Sequence

from tracer.tracer_core import TracerCore

from dagent.utils import LOGGER

from .command_parser import CommandParser
from .os_assistant import OSAssistant


def main(argv: Sequence[str] | None = None) -> None:
args = CommandParser().parse_args(argv)
LOGGER.debug(f"Parsed arguments: {args}")
match args.command:
case "trace":
tracer = TracerCore()
match args.trace_command:
case "start":
tracer.start_tracing(args.domain, args.dir)
case "show":
tracer.print_logs(args.domain, args.start, args.end)
case "clear":
tracer.clear_logs(args.domain)
case "chat":
assistant = OSAssistant()
assistant.run()


if __name__ == "__main__":
raise SystemExit(main(None))
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading