doorae-cluster 0.2.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- doorae_cluster-0.2.0/.gitignore +21 -0
- doorae_cluster-0.2.0/CHANGELOG.md +75 -0
- doorae_cluster-0.2.0/LICENSE +201 -0
- doorae_cluster-0.2.0/Makefile +38 -0
- doorae_cluster-0.2.0/PKG-INFO +47 -0
- doorae_cluster-0.2.0/README.md +18 -0
- doorae_cluster-0.2.0/alembic.ini +36 -0
- doorae_cluster-0.2.0/docs/api.md +54 -0
- doorae_cluster-0.2.0/docs/architecture.md +103 -0
- doorae_cluster-0.2.0/docs/deployment.md +73 -0
- doorae_cluster-0.2.0/doorae/__init__.py +3 -0
- doorae_cluster-0.2.0/doorae/__main__.py +6 -0
- doorae_cluster-0.2.0/doorae/agent_files.py +91 -0
- doorae_cluster-0.2.0/doorae/api/__init__.py +1 -0
- doorae_cluster-0.2.0/doorae/api/v1/__init__.py +1 -0
- doorae_cluster-0.2.0/doorae/api/v1/agents.py +732 -0
- doorae_cluster-0.2.0/doorae/api/v1/invites.py +341 -0
- doorae_cluster-0.2.0/doorae/api/v1/machines.py +464 -0
- doorae_cluster-0.2.0/doorae/api/v1/projects.py +64 -0
- doorae_cluster-0.2.0/doorae/api/v1/saved.py +140 -0
- doorae_cluster-0.2.0/doorae/api/v1/search.py +79 -0
- doorae_cluster-0.2.0/doorae/api/v1/tasks.py +135 -0
- doorae_cluster-0.2.0/doorae/app.py +356 -0
- doorae_cluster-0.2.0/doorae/auth/__init__.py +1 -0
- doorae_cluster-0.2.0/doorae/auth/dependencies.py +196 -0
- doorae_cluster-0.2.0/doorae/auth/invite_token.py +51 -0
- doorae_cluster-0.2.0/doorae/auth/jwt.py +154 -0
- doorae_cluster-0.2.0/doorae/auth/machine_token.py +36 -0
- doorae_cluster-0.2.0/doorae/auth/password.py +21 -0
- doorae_cluster-0.2.0/doorae/auth/routes.py +351 -0
- doorae_cluster-0.2.0/doorae/auth/token.py +40 -0
- doorae_cluster-0.2.0/doorae/cli.py +135 -0
- doorae_cluster-0.2.0/doorae/config.py +43 -0
- doorae_cluster-0.2.0/doorae/db/__init__.py +1 -0
- doorae_cluster-0.2.0/doorae/db/engine.py +38 -0
- doorae_cluster-0.2.0/doorae/db/migrations/env.py +82 -0
- doorae_cluster-0.2.0/doorae/db/migrations/versions/001_initial.py +156 -0
- doorae_cluster-0.2.0/doorae/db/migrations/versions/002_machine_scheduling.py +102 -0
- doorae_cluster-0.2.0/doorae/db/migrations/versions/003_agent_token.py +38 -0
- doorae_cluster-0.2.0/doorae/db/migrations/versions/004_nullable_message_participant.py +150 -0
- doorae_cluster-0.2.0/doorae/db/migrations/versions/005_agent_files_and_agents_md.py +66 -0
- doorae_cluster-0.2.0/doorae/db/migrations/versions/006_room_description.py +29 -0
- doorae_cluster-0.2.0/doorae/db/migrations/versions/007_reasoning_effort.py +28 -0
- doorae_cluster-0.2.0/doorae/db/migrations/versions/008_saved_activity_tasks_fts.py +94 -0
- doorae_cluster-0.2.0/doorae/db/migrations/versions/009_agent_generation_restart.py +30 -0
- doorae_cluster-0.2.0/doorae/db/migrations/versions/010_room_representative.py +29 -0
- doorae_cluster-0.2.0/doorae/db/migrations/versions/011_machine_activity_logs.py +37 -0
- doorae_cluster-0.2.0/doorae/db/migrations/versions/012_agent_model.py +27 -0
- doorae_cluster-0.2.0/doorae/db/migrations/versions/013_guest_users.py +223 -0
- doorae_cluster-0.2.0/doorae/db/migrations/versions/014_room_invite_links.py +75 -0
- doorae_cluster-0.2.0/doorae/db/models.py +486 -0
- doorae_cluster-0.2.0/doorae/db/repository.py +70 -0
- doorae_cluster-0.2.0/doorae/dependencies.py +70 -0
- doorae_cluster-0.2.0/doorae/engines/__init__.py +19 -0
- doorae_cluster-0.2.0/doorae/engines/catalog.py +163 -0
- doorae_cluster-0.2.0/doorae/guest/__init__.py +5 -0
- doorae_cluster-0.2.0/doorae/guest/anonymize.py +170 -0
- doorae_cluster-0.2.0/doorae/messages/__init__.py +1 -0
- doorae_cluster-0.2.0/doorae/messages/router.py +52 -0
- doorae_cluster-0.2.0/doorae/messages/service.py +46 -0
- doorae_cluster-0.2.0/doorae/observability/__init__.py +1 -0
- doorae_cluster-0.2.0/doorae/observability/logging.py +24 -0
- doorae_cluster-0.2.0/doorae/observability/metrics.py +79 -0
- doorae_cluster-0.2.0/doorae/orchestration/__init__.py +1 -0
- doorae_cluster-0.2.0/doorae/orchestration/rules.py +169 -0
- doorae_cluster-0.2.0/doorae/rooms/__init__.py +1 -0
- doorae_cluster-0.2.0/doorae/rooms/router.py +601 -0
- doorae_cluster-0.2.0/doorae/rooms/service.py +136 -0
- doorae_cluster-0.2.0/doorae/scheduler/__init__.py +1 -0
- doorae_cluster-0.2.0/doorae/scheduler/lifecycle.py +367 -0
- doorae_cluster-0.2.0/doorae/scheduler/machine_bus.py +71 -0
- doorae_cluster-0.2.0/doorae/scheduler/placement.py +88 -0
- doorae_cluster-0.2.0/doorae/ws/__init__.py +1 -0
- doorae_cluster-0.2.0/doorae/ws/handler.py +400 -0
- doorae_cluster-0.2.0/doorae/ws/machine_handler.py +215 -0
- doorae_cluster-0.2.0/doorae/ws/manager.py +82 -0
- doorae_cluster-0.2.0/doorae/ws/protocol.py +124 -0
- doorae_cluster-0.2.0/frontend/index.html +18 -0
- doorae_cluster-0.2.0/frontend/package-lock.json +5119 -0
- doorae_cluster-0.2.0/frontend/package.json +39 -0
- doorae_cluster-0.2.0/frontend/src/App.tsx +49 -0
- doorae_cluster-0.2.0/frontend/src/components/AdminMachines.tsx +802 -0
- doorae_cluster-0.2.0/frontend/src/components/AgentEditDialog.tsx +527 -0
- doorae_cluster-0.2.0/frontend/src/components/AgentHistoryDialog.tsx +63 -0
- doorae_cluster-0.2.0/frontend/src/components/AgentRoomsDialog.tsx +151 -0
- doorae_cluster-0.2.0/frontend/src/components/ChatArea.tsx +76 -0
- doorae_cluster-0.2.0/frontend/src/components/CreateRoomDialog.tsx +82 -0
- doorae_cluster-0.2.0/frontend/src/components/CreateSubRoomDialog.tsx +279 -0
- doorae_cluster-0.2.0/frontend/src/components/LoginForm.tsx +123 -0
- doorae_cluster-0.2.0/frontend/src/components/ManageRoomAgentsDialog.tsx +189 -0
- doorae_cluster-0.2.0/frontend/src/components/MarkdownContent.tsx +102 -0
- doorae_cluster-0.2.0/frontend/src/components/MentionPopover.tsx +56 -0
- doorae_cluster-0.2.0/frontend/src/components/MessageBubble.tsx +120 -0
- doorae_cluster-0.2.0/frontend/src/components/MessageInput.tsx +202 -0
- doorae_cluster-0.2.0/frontend/src/components/ParticipantListPopover.tsx +172 -0
- doorae_cluster-0.2.0/frontend/src/components/RoomEditDialog.tsx +113 -0
- doorae_cluster-0.2.0/frontend/src/components/RoomHeader.tsx +162 -0
- doorae_cluster-0.2.0/frontend/src/components/RoomInviteDialog.tsx +326 -0
- doorae_cluster-0.2.0/frontend/src/components/RoomSettingsMenu.tsx +179 -0
- doorae_cluster-0.2.0/frontend/src/components/SearchDialog.tsx +102 -0
- doorae_cluster-0.2.0/frontend/src/components/Sidebar.tsx +430 -0
- doorae_cluster-0.2.0/frontend/src/components/TaskPanel.tsx +149 -0
- doorae_cluster-0.2.0/frontend/src/components/TypingIndicator.tsx +41 -0
- doorae_cluster-0.2.0/frontend/src/components/ui/avatar.tsx +44 -0
- doorae_cluster-0.2.0/frontend/src/components/ui/badge.tsx +34 -0
- doorae_cluster-0.2.0/frontend/src/components/ui/button.tsx +58 -0
- doorae_cluster-0.2.0/frontend/src/components/ui/card.tsx +61 -0
- doorae_cluster-0.2.0/frontend/src/components/ui/chat/chat-bubble.tsx +109 -0
- doorae_cluster-0.2.0/frontend/src/components/ui/chat/chat-input.tsx +22 -0
- doorae_cluster-0.2.0/frontend/src/components/ui/chat/chat-message-list.tsx +46 -0
- doorae_cluster-0.2.0/frontend/src/components/ui/chat/hooks/useAutoScroll.tsx +106 -0
- doorae_cluster-0.2.0/frontend/src/components/ui/chat/index.ts +4 -0
- doorae_cluster-0.2.0/frontend/src/components/ui/chat/message-loading.tsx +44 -0
- doorae_cluster-0.2.0/frontend/src/components/ui/dialog.tsx +87 -0
- doorae_cluster-0.2.0/frontend/src/components/ui/input.tsx +21 -0
- doorae_cluster-0.2.0/frontend/src/components/ui/label.tsx +20 -0
- doorae_cluster-0.2.0/frontend/src/components/ui/scroll-area.tsx +43 -0
- doorae_cluster-0.2.0/frontend/src/components/ui/separator.tsx +23 -0
- doorae_cluster-0.2.0/frontend/src/components/ui/table.tsx +99 -0
- doorae_cluster-0.2.0/frontend/src/components/ui/tabs.tsx +52 -0
- doorae_cluster-0.2.0/frontend/src/hooks/useAgents.ts +214 -0
- doorae_cluster-0.2.0/frontend/src/hooks/useAuth.ts +68 -0
- doorae_cluster-0.2.0/frontend/src/hooks/useMachines.ts +190 -0
- doorae_cluster-0.2.0/frontend/src/hooks/useRooms.ts +325 -0
- doorae_cluster-0.2.0/frontend/src/hooks/useWebSocket.ts +118 -0
- doorae_cluster-0.2.0/frontend/src/index.css +388 -0
- doorae_cluster-0.2.0/frontend/src/lib/api.ts +11 -0
- doorae_cluster-0.2.0/frontend/src/lib/mentions.ts +34 -0
- doorae_cluster-0.2.0/frontend/src/lib/utils.ts +6 -0
- doorae_cluster-0.2.0/frontend/src/main.tsx +8 -0
- doorae_cluster-0.2.0/frontend/src/pages/AdminMachinesPage.tsx +32 -0
- doorae_cluster-0.2.0/frontend/src/pages/ChatPage.tsx +423 -0
- doorae_cluster-0.2.0/frontend/src/pages/GuestInvitePage.tsx +120 -0
- doorae_cluster-0.2.0/frontend/src/pages/GuestRoomPage.tsx +250 -0
- doorae_cluster-0.2.0/frontend/src/pages/LoginPage.tsx +27 -0
- doorae_cluster-0.2.0/frontend/src/vite-env.d.ts +1 -0
- doorae_cluster-0.2.0/frontend/tsconfig.app.json +7 -0
- doorae_cluster-0.2.0/frontend/tsconfig.json +23 -0
- doorae_cluster-0.2.0/frontend/tsconfig.tsbuildinfo +1 -0
- doorae_cluster-0.2.0/frontend/vite.config.ts +24 -0
- doorae_cluster-0.2.0/pyproject.toml +60 -0
- doorae_cluster-0.2.0/scripts/e2e_full_pipeline.py +345 -0
- doorae_cluster-0.2.0/scripts/e2e_multiprocess.py +214 -0
- doorae_cluster-0.2.0/scripts/e2e_real_chat.py +250 -0
- doorae_cluster-0.2.0/tests/__init__.py +0 -0
- doorae_cluster-0.2.0/tests/conftest.py +57 -0
- doorae_cluster-0.2.0/tests/test_agent_files_validation.py +93 -0
- doorae_cluster-0.2.0/tests/test_agents_api.py +960 -0
- doorae_cluster-0.2.0/tests/test_auth.py +116 -0
- doorae_cluster-0.2.0/tests/test_auth_routes.py +160 -0
- doorae_cluster-0.2.0/tests/test_cli_env.py +109 -0
- doorae_cluster-0.2.0/tests/test_config.py +88 -0
- doorae_cluster-0.2.0/tests/test_declarative_reconcile.py +265 -0
- doorae_cluster-0.2.0/tests/test_e2e_materialize.py +301 -0
- doorae_cluster-0.2.0/tests/test_e2e_real_conversation.py +230 -0
- doorae_cluster-0.2.0/tests/test_e2e_scenario.py +391 -0
- doorae_cluster-0.2.0/tests/test_engine_catalog.py +158 -0
- doorae_cluster-0.2.0/tests/test_guest_anonymize.py +197 -0
- doorae_cluster-0.2.0/tests/test_guest_auth.py +534 -0
- doorae_cluster-0.2.0/tests/test_guest_filtering.py +326 -0
- doorae_cluster-0.2.0/tests/test_guest_ws.py +335 -0
- doorae_cluster-0.2.0/tests/test_invites.py +514 -0
- doorae_cluster-0.2.0/tests/test_lifecycle.py +421 -0
- doorae_cluster-0.2.0/tests/test_machine_handler.py +317 -0
- doorae_cluster-0.2.0/tests/test_machine_token.py +40 -0
- doorae_cluster-0.2.0/tests/test_machines_api.py +495 -0
- doorae_cluster-0.2.0/tests/test_mention_parsing.py +44 -0
- doorae_cluster-0.2.0/tests/test_migrations.py +504 -0
- doorae_cluster-0.2.0/tests/test_models.py +297 -0
- doorae_cluster-0.2.0/tests/test_orchestration.py +79 -0
- doorae_cluster-0.2.0/tests/test_placement.py +185 -0
- doorae_cluster-0.2.0/tests/test_projects.py +103 -0
- doorae_cluster-0.2.0/tests/test_rooms.py +872 -0
- doorae_cluster-0.2.0/tests/test_ws_handler.py +579 -0
- doorae_cluster-0.2.0/uv.lock +1403 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
__pycache__/
|
|
2
|
+
*.py[cod]
|
|
3
|
+
*.egg-info/
|
|
4
|
+
dist/
|
|
5
|
+
build/
|
|
6
|
+
.venv/
|
|
7
|
+
.ruff_cache/
|
|
8
|
+
.pytest_cache/
|
|
9
|
+
.mypy_cache/
|
|
10
|
+
*.db
|
|
11
|
+
.env
|
|
12
|
+
|
|
13
|
+
# Vite build output (served by FastAPI)
|
|
14
|
+
doorae/static/
|
|
15
|
+
|
|
16
|
+
# Node
|
|
17
|
+
frontend/node_modules/
|
|
18
|
+
frontend/dist/
|
|
19
|
+
|
|
20
|
+
# Vite cache
|
|
21
|
+
.vite/
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
# CHANGELOG
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
## v0.2.0 (2026-04-15)
|
|
5
|
+
|
|
6
|
+
### Features — anonymous guest participation (RFC #22)
|
|
7
|
+
|
|
8
|
+
- Allow anonymous guest rows on users table
|
|
9
|
+
([#24](https://github.com/e7217/doorae/pull/24))
|
|
10
|
+
- Room invite links with admin-only lifecycle
|
|
11
|
+
([#25](https://github.com/e7217/doorae/pull/25))
|
|
12
|
+
- Guest identity + /auth/guest + forbid_guest gate
|
|
13
|
+
([#26](https://github.com/e7217/doorae/pull/26))
|
|
14
|
+
- Guest branch in the WebSocket send path
|
|
15
|
+
([#27](https://github.com/e7217/doorae/pull/27))
|
|
16
|
+
- Trim the guest read surface
|
|
17
|
+
([#28](https://github.com/e7217/doorae/pull/28))
|
|
18
|
+
- Guest lifecycle job + metrics + final docs
|
|
19
|
+
([#31](https://github.com/e7217/doorae/pull/31))
|
|
20
|
+
|
|
21
|
+
### Features — membership / UI
|
|
22
|
+
|
|
23
|
+
- Notify agent of dynamic room join via add_participant
|
|
24
|
+
([#17](https://github.com/e7217/doorae/pull/17))
|
|
25
|
+
- Notify user on add_participant via WS
|
|
26
|
+
([#19](https://github.com/e7217/doorae/pull/19))
|
|
27
|
+
- Show room participant list in a header popover
|
|
28
|
+
([#32](https://github.com/e7217/doorae/pull/32))
|
|
29
|
+
- Allow admins to remove room participants
|
|
30
|
+
([#40](https://github.com/e7217/doorae/pull/40))
|
|
31
|
+
|
|
32
|
+
### Fixes
|
|
33
|
+
|
|
34
|
+
- Machine deletion cascade and error surfacing
|
|
35
|
+
([#1](https://github.com/e7217/doorae/pull/1))
|
|
36
|
+
- Delete agent's DM room when the agent is deleted
|
|
37
|
+
([#12](https://github.com/e7217/doorae/pull/12))
|
|
38
|
+
|
|
39
|
+
### Docs
|
|
40
|
+
|
|
41
|
+
- WS frame tables in §1.5 synced with protocol.py
|
|
42
|
+
([#21](https://github.com/e7217/doorae/pull/21))
|
|
43
|
+
- Anonymous guest participation RFC (design §11)
|
|
44
|
+
([#23](https://github.com/e7217/doorae/pull/23))
|
|
45
|
+
|
|
46
|
+
## v0.1.0 (2026-04-14)
|
|
47
|
+
|
|
48
|
+
### Chores
|
|
49
|
+
|
|
50
|
+
- Switch license to Apache-2.0 and update author
|
|
51
|
+
([`a4f1d0a`](https://github.com/e7217/doorae-cluster/commit/a4f1d0a8ddd6b1641dd08ed63c42f60b66576635))
|
|
52
|
+
|
|
53
|
+
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
|
54
|
+
|
|
55
|
+
### Continuous Integration
|
|
56
|
+
|
|
57
|
+
- Add python-semantic-release for automatic versioning
|
|
58
|
+
([`eb5269a`](https://github.com/e7217/doorae-cluster/commit/eb5269a8799737008802d19f9838470dddfce195))
|
|
59
|
+
|
|
60
|
+
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
|
61
|
+
|
|
62
|
+
### Features
|
|
63
|
+
|
|
64
|
+
- Initial release — doorae-cluster v0.2.0
|
|
65
|
+
([`47bed32`](https://github.com/e7217/doorae-cluster/commit/47bed3254a656e208e1d765b6e8ece22707043f2))
|
|
66
|
+
|
|
67
|
+
Extracted from e7217/doorae monorepo (formerly doorae-server). Renamed package doorae-server →
|
|
68
|
+
doorae-cluster.
|
|
69
|
+
|
|
70
|
+
Includes: - FastAPI chat server with WebSocket + REST API - SQLAlchemy async DB with Alembic
|
|
71
|
+
migrations (11 versions) - Auth system (JWT, machine tokens, admin/owner roles) - Agent & machine
|
|
72
|
+
management APIs - React/Vite frontend (SPA) - Prometheus observability - doorae-machine dependency
|
|
73
|
+
via GitHub source
|
|
74
|
+
|
|
75
|
+
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to the Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by the Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding any notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. Please also get an in-depth
|
|
186
|
+
understanding of "Why should I apply the Apache License" FAQ at
|
|
187
|
+
<http://www.apache.org/foundation/license-faq.html>
|
|
188
|
+
|
|
189
|
+
Copyright 2024 Changyong Um
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
.PHONY: install dev server server-dev frontend test lint migrate e2e clean
|
|
2
|
+
|
|
3
|
+
install: ## Install all dependencies
|
|
4
|
+
uv sync --dev
|
|
5
|
+
cd frontend && npm install
|
|
6
|
+
|
|
7
|
+
DEV_PORT ?= 8001
|
|
8
|
+
|
|
9
|
+
dev: ## Run server + frontend concurrently (dev mode)
|
|
10
|
+
$(MAKE) -j2 server-dev frontend
|
|
11
|
+
|
|
12
|
+
server: ## Run backend server
|
|
13
|
+
uv run doorae-server
|
|
14
|
+
|
|
15
|
+
server-dev: ## Run backend server in dev mode (reload, port 8001)
|
|
16
|
+
uv run uvicorn doorae.app:create_app --factory --reload --host 0.0.0.0 --port $(DEV_PORT) --log-level debug
|
|
17
|
+
|
|
18
|
+
frontend: ## Run frontend dev server
|
|
19
|
+
cd frontend && npm install --silent && npm run dev
|
|
20
|
+
|
|
21
|
+
test: ## Run backend tests
|
|
22
|
+
uv run pytest -v
|
|
23
|
+
|
|
24
|
+
lint: ## Run linter
|
|
25
|
+
uv run ruff check doorae tests
|
|
26
|
+
|
|
27
|
+
migrate: ## Run alembic migrations
|
|
28
|
+
uv run alembic upgrade head
|
|
29
|
+
|
|
30
|
+
e2e: ## Run full E2E pipeline test
|
|
31
|
+
uv run python scripts/e2e_full_pipeline.py
|
|
32
|
+
|
|
33
|
+
clean: ## Remove build artifacts and caches
|
|
34
|
+
rm -rf dist/ .pytest_cache/ __pycache__/
|
|
35
|
+
find . -type d -name __pycache__ -exec rm -rf {} +
|
|
36
|
+
|
|
37
|
+
help: ## Show this help
|
|
38
|
+
@grep -E '^[a-zA-Z_-]+:.*##' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*## "}; {printf " \033[36m%-16s\033[0m %s\n", $$1, $$2}'
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: doorae-cluster
|
|
3
|
+
Version: 0.2.0
|
|
4
|
+
Summary: Lightweight multi-agent chat server
|
|
5
|
+
Author: Changyong Um
|
|
6
|
+
License-Expression: Apache-2.0
|
|
7
|
+
License-File: LICENSE
|
|
8
|
+
Requires-Python: >=3.11
|
|
9
|
+
Requires-Dist: aiosqlite>=0.19
|
|
10
|
+
Requires-Dist: alembic>=1.13
|
|
11
|
+
Requires-Dist: argon2-cffi>=23.1
|
|
12
|
+
Requires-Dist: click>=8.1
|
|
13
|
+
Requires-Dist: fastapi<0.120,>=0.110
|
|
14
|
+
Requires-Dist: prometheus-client>=0.20
|
|
15
|
+
Requires-Dist: pydantic-settings>=2.2
|
|
16
|
+
Requires-Dist: pydantic<3.0,>=2.6
|
|
17
|
+
Requires-Dist: python-jose[cryptography]>=3.3
|
|
18
|
+
Requires-Dist: sqlalchemy[asyncio]<2.1,>=2.0
|
|
19
|
+
Requires-Dist: structlog>=24.1
|
|
20
|
+
Requires-Dist: uvicorn[standard]>=0.29
|
|
21
|
+
Provides-Extra: dev
|
|
22
|
+
Requires-Dist: doorae-machine; extra == 'dev'
|
|
23
|
+
Requires-Dist: httpx>=0.27; extra == 'dev'
|
|
24
|
+
Requires-Dist: mypy>=1.9; extra == 'dev'
|
|
25
|
+
Requires-Dist: pytest-asyncio>=0.23; extra == 'dev'
|
|
26
|
+
Requires-Dist: pytest>=8.0; extra == 'dev'
|
|
27
|
+
Requires-Dist: ruff>=0.3; extra == 'dev'
|
|
28
|
+
Description-Content-Type: text/markdown
|
|
29
|
+
|
|
30
|
+
# doorae-server
|
|
31
|
+
|
|
32
|
+
Lightweight multi-agent chat server built with FastAPI, SQLite, and WebSocket.
|
|
33
|
+
|
|
34
|
+
## Quick Start
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
pip install -e ".[dev]"
|
|
38
|
+
doorae-server init
|
|
39
|
+
doorae-server
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Development
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
pip install -e ".[dev]"
|
|
46
|
+
pytest
|
|
47
|
+
```
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# doorae-server
|
|
2
|
+
|
|
3
|
+
Lightweight multi-agent chat server built with FastAPI, SQLite, and WebSocket.
|
|
4
|
+
|
|
5
|
+
## Quick Start
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pip install -e ".[dev]"
|
|
9
|
+
doorae-server init
|
|
10
|
+
doorae-server
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Development
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
pip install -e ".[dev]"
|
|
17
|
+
pytest
|
|
18
|
+
```
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
[alembic]
|
|
2
|
+
script_location = doorae/db/migrations
|
|
3
|
+
sqlalchemy.url = sqlite+aiosqlite:///%(here)s/doorae.db
|
|
4
|
+
|
|
5
|
+
[loggers]
|
|
6
|
+
keys = root,sqlalchemy,alembic
|
|
7
|
+
|
|
8
|
+
[handlers]
|
|
9
|
+
keys = console
|
|
10
|
+
|
|
11
|
+
[formatters]
|
|
12
|
+
keys = generic
|
|
13
|
+
|
|
14
|
+
[logger_root]
|
|
15
|
+
level = WARN
|
|
16
|
+
handlers = console
|
|
17
|
+
|
|
18
|
+
[logger_sqlalchemy]
|
|
19
|
+
level = WARN
|
|
20
|
+
handlers =
|
|
21
|
+
qualname = sqlalchemy.engine
|
|
22
|
+
|
|
23
|
+
[logger_alembic]
|
|
24
|
+
level = INFO
|
|
25
|
+
handlers =
|
|
26
|
+
qualname = alembic
|
|
27
|
+
|
|
28
|
+
[handler_console]
|
|
29
|
+
class = StreamHandler
|
|
30
|
+
args = (sys.stderr,)
|
|
31
|
+
level = NOTSET
|
|
32
|
+
formatter = generic
|
|
33
|
+
|
|
34
|
+
[formatter_generic]
|
|
35
|
+
format = %(levelname)-5.5s [%(name)s] %(message)s
|
|
36
|
+
datefmt = %H:%M:%S
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# REST API Reference
|
|
2
|
+
|
|
3
|
+
Base URL: `/api/v1`
|
|
4
|
+
|
|
5
|
+
## Auth
|
|
6
|
+
|
|
7
|
+
| Method | Path | 설명 |
|
|
8
|
+
|--------|------|------|
|
|
9
|
+
| POST | `/auth/register` | 유저 등록 (첫 유저는 admin) |
|
|
10
|
+
| POST | `/auth/login` | 로그인 → JWT 토큰 반환 |
|
|
11
|
+
| GET | `/auth/dev-token` | 개발 모드 자동 로그인 |
|
|
12
|
+
| GET | `/auth/me` | 현재 유저 정보 |
|
|
13
|
+
|
|
14
|
+
## Rooms
|
|
15
|
+
|
|
16
|
+
| Method | Path | 설명 |
|
|
17
|
+
|--------|------|------|
|
|
18
|
+
| GET | `/rooms` | 룸 목록 |
|
|
19
|
+
| POST | `/rooms` | 룸 생성 |
|
|
20
|
+
| GET | `/rooms/{id}` | 룸 상세 |
|
|
21
|
+
| POST | `/rooms/{id}/sub-rooms` | 서브룸 생성 |
|
|
22
|
+
|
|
23
|
+
## Agents
|
|
24
|
+
|
|
25
|
+
| Method | Path | 설명 |
|
|
26
|
+
|--------|------|------|
|
|
27
|
+
| GET | `/agents` | 에이전트 목록 |
|
|
28
|
+
| POST | `/agents` | 에이전트 생성 |
|
|
29
|
+
| PATCH | `/agents/{id}` | 에이전트 수정 |
|
|
30
|
+
| DELETE | `/agents/{id}` | 에이전트 삭제 |
|
|
31
|
+
| POST | `/agents/{id}/spawn` | 에이전트 spawn |
|
|
32
|
+
| POST | `/agents/{id}/kill` | 에이전트 kill |
|
|
33
|
+
| PUT | `/agents/{id}/files` | 에이전트 파일(manifest) 업데이트 |
|
|
34
|
+
|
|
35
|
+
## Machines
|
|
36
|
+
|
|
37
|
+
| Method | Path | 설명 |
|
|
38
|
+
|--------|------|------|
|
|
39
|
+
| GET | `/machines` | 머신 목록 |
|
|
40
|
+
| POST | `/machines/register` | 머신 등록 |
|
|
41
|
+
| GET | `/machines/{id}` | 머신 상세 |
|
|
42
|
+
|
|
43
|
+
## Messages
|
|
44
|
+
|
|
45
|
+
| Method | Path | 설명 |
|
|
46
|
+
|--------|------|------|
|
|
47
|
+
| GET | `/rooms/{id}/messages` | 메시지 히스토리 |
|
|
48
|
+
|
|
49
|
+
## WebSocket
|
|
50
|
+
|
|
51
|
+
| Path | 설명 |
|
|
52
|
+
|------|------|
|
|
53
|
+
| `/ws/chat` | 유저/에이전트 채팅 연결 |
|
|
54
|
+
| `/ws/machines/{id}` | 머신 데몬 연결 |
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
# doorae-cluster Architecture
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
doorae-cluster는 다중 에이전트 채팅 서버이다. FastAPI + SQLite + WebSocket 기반으로, 유저와 에이전트가 룸에서 대화하고 머신에 에이전트를 스케줄링한다.
|
|
6
|
+
|
|
7
|
+
## Package Structure
|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
doorae/
|
|
11
|
+
├── app.py # FastAPI 앱 팩토리
|
|
12
|
+
├── cli.py # CLI 엔트리포인트 (doorae-server)
|
|
13
|
+
├── config.py # 설정 (DooraeSettings, pydantic-settings)
|
|
14
|
+
├── dependencies.py # FastAPI 의존성 주입
|
|
15
|
+
├── agent_files.py # 에이전트 파일/manifest 관리
|
|
16
|
+
│
|
|
17
|
+
├── auth/ # 인증
|
|
18
|
+
│ ├── routes.py # /api/v1/auth (register, login, dev-token, me)
|
|
19
|
+
│ ├── dependencies.py # JWT 검증, Identity 추출
|
|
20
|
+
│ ├── jwt.py # JWT 토큰 생성/검증
|
|
21
|
+
│ └── password.py # argon2 패스워드 해싱
|
|
22
|
+
│
|
|
23
|
+
├── api/v1/ # REST API
|
|
24
|
+
│ ├── agents.py # 에이전트 CRUD, 파일 관리
|
|
25
|
+
│ ├── machines.py # 머신 등록, 상태 조회
|
|
26
|
+
│ ├── projects.py # 프로젝트 관리
|
|
27
|
+
│ ├── tasks.py # 태스크 보드
|
|
28
|
+
│ ├── saved.py # 저장된 메시지
|
|
29
|
+
│ └── search.py # 전문 검색
|
|
30
|
+
│
|
|
31
|
+
├── ws/ # WebSocket
|
|
32
|
+
│ ├── handler.py # 유저/에이전트 WebSocket 핸들러
|
|
33
|
+
│ └── machine_handler.py # 머신 데몬 WebSocket 핸들러
|
|
34
|
+
│
|
|
35
|
+
├── rooms/ # 룸 관리
|
|
36
|
+
│ └── router.py # 룸 CRUD, 서브룸
|
|
37
|
+
│
|
|
38
|
+
├── messages/ # 메시지
|
|
39
|
+
│ └── router.py # 메시지 전송, 히스토리
|
|
40
|
+
│
|
|
41
|
+
├── scheduler/ # 스케줄러
|
|
42
|
+
│ ├── lifecycle.py # 에이전트 생명주기 (spawn/kill 결정)
|
|
43
|
+
│ └── machine_bus.py # 머신 연결 관리, spawn 명령 전달
|
|
44
|
+
│
|
|
45
|
+
├── orchestration/ # 오케스트레이션
|
|
46
|
+
│
|
|
47
|
+
├── observability/ # 모니터링 (Prometheus 메트릭)
|
|
48
|
+
│
|
|
49
|
+
├── db/ # 데이터베이스
|
|
50
|
+
│ ├── models.py # SQLAlchemy 모델
|
|
51
|
+
│ └── migrations/ # Alembic 마이그레이션
|
|
52
|
+
│
|
|
53
|
+
└── static/ # 프론트엔드 빌드 출력
|
|
54
|
+
|
|
55
|
+
frontend/ # React + Vite + shadcn/ui
|
|
56
|
+
├── src/
|
|
57
|
+
│ ├── pages/ # 페이지 컴포넌트
|
|
58
|
+
│ ├── components/ # UI 컴포넌트
|
|
59
|
+
│ └── lib/ # API 클라이언트, 유틸
|
|
60
|
+
└── vite.config.ts # Vite 설정 (API 프록시 포함)
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## Core Flow
|
|
64
|
+
|
|
65
|
+
```
|
|
66
|
+
브라우저/클라이언트
|
|
67
|
+
│
|
|
68
|
+
├── REST API (/api/v1/*) → FastAPI 라우터
|
|
69
|
+
│
|
|
70
|
+
└── WebSocket (/ws/chat) → handler.py
|
|
71
|
+
│
|
|
72
|
+
├── 메시지 브로드캐스트 (룸 참여자)
|
|
73
|
+
│
|
|
74
|
+
└── 에이전트 응답 수신/전달
|
|
75
|
+
|
|
76
|
+
머신 데몬
|
|
77
|
+
│
|
|
78
|
+
└── WebSocket (/ws/machines/{id}) → machine_handler.py
|
|
79
|
+
│
|
|
80
|
+
├── 하트비트 수신
|
|
81
|
+
├── spawn/kill 명령 전송
|
|
82
|
+
└── 에이전트 상태 보고 수신
|
|
83
|
+
|
|
84
|
+
스케줄러
|
|
85
|
+
│
|
|
86
|
+
└── lifecycle.py
|
|
87
|
+
│
|
|
88
|
+
├── 에이전트 spawn 요청 → 머신 선택 (bin-pack)
|
|
89
|
+
└── spawn 명령 → machine_handler → 머신 데몬
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
## Authentication
|
|
93
|
+
|
|
94
|
+
3종 토큰 체계:
|
|
95
|
+
- **User JWT**: 유저 로그인 시 발급, REST API + WebSocket 인증
|
|
96
|
+
- **Agent Token**: 에이전트별 발급, 서버 접속 시 사용
|
|
97
|
+
- **Machine Token**: 머신 등록 시 발급, 데몬 WebSocket 인증
|
|
98
|
+
|
|
99
|
+
## Database
|
|
100
|
+
|
|
101
|
+
SQLite + aiosqlite (비동기). Alembic으로 마이그레이션 관리.
|
|
102
|
+
|
|
103
|
+
주요 테이블: users, rooms, machines, agents, agent_tokens, machine_tokens, messages, participants, agent_files, tasks
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# Deployment Guide
|
|
2
|
+
|
|
3
|
+
## 개발 환경
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
cd doorae-cluster
|
|
7
|
+
make install # 백엔드 + 프론트엔드 의존성 설치
|
|
8
|
+
make migrate # DB 마이그레이션
|
|
9
|
+
make dev # 서버(8001) + 프론트엔드(5173) 동시 실행
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
브라우저에서 `http://localhost:5173` 접속.
|
|
13
|
+
|
|
14
|
+
## 프로덕션
|
|
15
|
+
|
|
16
|
+
### 서버 실행
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
uvx doorae-cluster --host 0.0.0.0 --port 8000
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
또는 직접 설치:
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
pip install doorae-cluster
|
|
26
|
+
doorae-server init # ~/.doorae/ 초기화, JWT 시크릿 생성
|
|
27
|
+
doorae-server migrate # DB 마이그레이션
|
|
28
|
+
doorae-server --host 0.0.0.0 --port 8000
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
### 환경변수
|
|
32
|
+
|
|
33
|
+
| 변수 | 기본값 | 설명 |
|
|
34
|
+
|------|--------|------|
|
|
35
|
+
| `DOORAE_JWT_SECRET` | (필수) | JWT 서명 키 |
|
|
36
|
+
| `DOORAE_DB_URL` | `sqlite+aiosqlite:///~/.doorae/doorae.db` | DB 연결 문자열 |
|
|
37
|
+
| `DOORAE_HOST` | `127.0.0.1` | 서버 바인딩 주소 |
|
|
38
|
+
| `DOORAE_PORT` | `8000` | 서버 포트 |
|
|
39
|
+
| `DOORAE_LOG_LEVEL` | `INFO` | 로그 레벨 |
|
|
40
|
+
| `DOORAE_DEV` | `false` | 개발 모드 (dev-token 활성화) |
|
|
41
|
+
|
|
42
|
+
### 프론트엔드 빌드
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
cd frontend
|
|
46
|
+
npm install
|
|
47
|
+
npm run build # → ../doorae/static/ 에 출력
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
빌드 후 서버가 정적 파일을 직접 서빙한다.
|
|
51
|
+
|
|
52
|
+
### 역방향 프록시 (nginx)
|
|
53
|
+
|
|
54
|
+
```nginx
|
|
55
|
+
server {
|
|
56
|
+
listen 443 ssl;
|
|
57
|
+
server_name doorae.example.com;
|
|
58
|
+
|
|
59
|
+
location / {
|
|
60
|
+
proxy_pass http://127.0.0.1:8000;
|
|
61
|
+
proxy_http_version 1.1;
|
|
62
|
+
proxy_set_header Upgrade $http_upgrade;
|
|
63
|
+
proxy_set_header Connection "upgrade";
|
|
64
|
+
proxy_set_header Host $host;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
WebSocket 업그레이드 헤더 설정이 필수.
|
|
70
|
+
|
|
71
|
+
### 첫 유저 등록
|
|
72
|
+
|
|
73
|
+
서버 시작 후 첫 번째로 등록하는 유저가 자동으로 admin 권한을 받는다.
|