dooers-protocol 0.1.0__py3-none-any.whl
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.
- dooers_protocol/__init__.py +5 -0
- dooers_protocol/agents.py +71 -0
- dooers_protocol/audit.py +32 -0
- dooers_protocol/auth.py +17 -0
- dooers_protocol/errors.py +25 -0
- dooers_protocol/push.py +31 -0
- dooers_protocol/py.typed +0 -0
- dooers_protocol-0.1.0.dist-info/METADATA +39 -0
- dooers_protocol-0.1.0.dist-info/RECORD +10 -0
- dooers_protocol-0.1.0.dist-info/WHEEL +4 -0
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"""Agent records, create requests, and the dooers.yaml manifest schema (core v2)."""
|
|
2
|
+
|
|
3
|
+
from datetime import datetime
|
|
4
|
+
from typing import Literal
|
|
5
|
+
|
|
6
|
+
from pydantic import BaseModel, ConfigDict
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class AgentRecord(BaseModel):
|
|
10
|
+
agent_id: str
|
|
11
|
+
name: str
|
|
12
|
+
owner_user_id: str | None = None
|
|
13
|
+
organization_id: str | None = None
|
|
14
|
+
host_url: str | None = None
|
|
15
|
+
created_at: datetime | None = None
|
|
16
|
+
updated_at: datetime | None = None
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
class CreateAgentRequest(BaseModel):
|
|
20
|
+
organization_id: str
|
|
21
|
+
name: str
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
class WhatsAppConfig(BaseModel):
|
|
25
|
+
"""Optional WhatsApp inbound. `path` is appended to the deployed host."""
|
|
26
|
+
model_config = ConfigDict(extra="forbid")
|
|
27
|
+
enabled: bool = False
|
|
28
|
+
path: str | None = None
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
class ProfileConfig(BaseModel):
|
|
32
|
+
"""Listing/marketing profile (maps to core `profile`)."""
|
|
33
|
+
model_config = ConfigDict(extra="forbid")
|
|
34
|
+
summary: str | None = None
|
|
35
|
+
image_url: str | None = None
|
|
36
|
+
capabilities: list[str] = []
|
|
37
|
+
tools: list[str] = []
|
|
38
|
+
usage_limits: list[str] = []
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
class SuggestedPrompt(BaseModel):
|
|
42
|
+
"""A shortcut shown below the chat greeting."""
|
|
43
|
+
model_config = ConfigDict(extra="forbid")
|
|
44
|
+
title: str
|
|
45
|
+
prompt: str
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
class UiConfig(BaseModel):
|
|
49
|
+
"""Dooers chat-UI chrome (maps to core `settings.dooersUi_settings`)."""
|
|
50
|
+
model_config = ConfigDict(extra="forbid")
|
|
51
|
+
hide_mic: bool | None = None
|
|
52
|
+
hide_textinput: bool | None = None
|
|
53
|
+
hide_attachments: bool | None = None
|
|
54
|
+
suggested_prompts: list[SuggestedPrompt] = []
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
class AgentManifest(BaseModel):
|
|
58
|
+
"""Schema of `dooers.yaml`. Written by `dooers agents create`, applied by `dooers push`."""
|
|
59
|
+
model_config = ConfigDict(extra="forbid")
|
|
60
|
+
protocol_version: str
|
|
61
|
+
agent_id: str
|
|
62
|
+
name: str
|
|
63
|
+
organization_id: str
|
|
64
|
+
description: str | None = None
|
|
65
|
+
# Path your agent serves the SDK messages endpoint on (e.g. "/" or "/agent").
|
|
66
|
+
# Combined with the deployed host → serverConfig.apiMessagesUrl.
|
|
67
|
+
message_path: str | None = None
|
|
68
|
+
message_scheme: Literal["wss", "https"] = "wss"
|
|
69
|
+
whatsapp: WhatsAppConfig | None = None
|
|
70
|
+
profile: ProfileConfig | None = None
|
|
71
|
+
ui: UiConfig | None = None
|
dooers_protocol/audit.py
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"""Audit + infra-manifest shapes used by the auditor pipeline step.
|
|
2
|
+
|
|
3
|
+
In the POC, the auditor step returns AuditReport(passed=True, findings=[]).
|
|
4
|
+
These shapes are committed now so the future real auditor implementation
|
|
5
|
+
drops in without touching callers.
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
from typing import Literal
|
|
9
|
+
|
|
10
|
+
from pydantic import BaseModel
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class AuditFinding(BaseModel):
|
|
14
|
+
severity: Literal["info", "warning", "error"]
|
|
15
|
+
category: str
|
|
16
|
+
message: str
|
|
17
|
+
file: str | None = None
|
|
18
|
+
line: int | None = None
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
class InfraManifest(BaseModel):
|
|
22
|
+
"""What infrastructure the agent code declares (or is detected to need)."""
|
|
23
|
+
|
|
24
|
+
needs_db: bool = False
|
|
25
|
+
needs_redis: bool = False
|
|
26
|
+
detected_endpoints: list[str] = []
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
class AuditReport(BaseModel):
|
|
30
|
+
passed: bool
|
|
31
|
+
findings: list[AuditFinding] = []
|
|
32
|
+
required_infra: InfraManifest = InfraManifest()
|
dooers_protocol/auth.py
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"""Auth-related wire shapes (session, whoami)."""
|
|
2
|
+
|
|
3
|
+
from pydantic import BaseModel
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class AuthSession(BaseModel):
|
|
7
|
+
"""A verified session returned by core's /session/verify."""
|
|
8
|
+
|
|
9
|
+
user_id: str
|
|
10
|
+
email: str
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class WhoamiResponse(BaseModel):
|
|
14
|
+
"""Response shape for `dooers whoami`."""
|
|
15
|
+
|
|
16
|
+
user_id: str
|
|
17
|
+
email: str
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"""Common error envelope returned by dooers-push for non-2xx responses."""
|
|
2
|
+
|
|
3
|
+
from enum import Enum
|
|
4
|
+
|
|
5
|
+
from pydantic import BaseModel
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class ErrorCode(str, Enum):
|
|
9
|
+
unauthenticated = "unauthenticated"
|
|
10
|
+
forbidden = "forbidden"
|
|
11
|
+
not_found = "not_found"
|
|
12
|
+
archive_too_large = "archive_too_large"
|
|
13
|
+
audit_failed = "audit_failed"
|
|
14
|
+
build_failed = "build_failed"
|
|
15
|
+
build_timeout = "build_timeout"
|
|
16
|
+
core_unreachable = "core_unreachable"
|
|
17
|
+
lb_registration_failed = "lb_registration_failed"
|
|
18
|
+
internal = "internal"
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
class ErrorEnvelope(BaseModel):
|
|
22
|
+
error_code: ErrorCode
|
|
23
|
+
message: str
|
|
24
|
+
correlation_id: str
|
|
25
|
+
details: dict = {}
|
dooers_protocol/push.py
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"""Push request/response shapes and build status enum."""
|
|
2
|
+
|
|
3
|
+
from enum import Enum
|
|
4
|
+
|
|
5
|
+
from pydantic import BaseModel
|
|
6
|
+
|
|
7
|
+
from dooers_protocol.audit import AuditReport
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class BuildStatus(str, Enum):
|
|
11
|
+
queued = "queued"
|
|
12
|
+
building = "building"
|
|
13
|
+
deploying = "deploying"
|
|
14
|
+
succeeded = "succeeded"
|
|
15
|
+
failed = "failed"
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
class PushRequest(BaseModel):
|
|
19
|
+
agent_id: str
|
|
20
|
+
tag: str = "latest"
|
|
21
|
+
env: str = "prod"
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
class PushResponse(BaseModel):
|
|
25
|
+
agent_id: str
|
|
26
|
+
build_id: str
|
|
27
|
+
image: str
|
|
28
|
+
status: BuildStatus
|
|
29
|
+
url: str | None = None
|
|
30
|
+
error: str | None = None
|
|
31
|
+
audit: AuditReport | None = None
|
dooers_protocol/py.typed
ADDED
|
File without changes
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: dooers-protocol
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Dooers — wire protocol shared between CLI and dooers-push service
|
|
5
|
+
Project-URL: Repository, https://github.com/Dooers-ai/dooers-cli
|
|
6
|
+
Author-email: Dooers <dev@dooers.ai>
|
|
7
|
+
License-Expression: MIT
|
|
8
|
+
Keywords: cli,dooers,protocol,pydantic
|
|
9
|
+
Requires-Python: >=3.10
|
|
10
|
+
Requires-Dist: pydantic>=2.13.2
|
|
11
|
+
Provides-Extra: dev
|
|
12
|
+
Requires-Dist: build>=1.4.3; extra == 'dev'
|
|
13
|
+
Requires-Dist: mypy>=1.20.1; extra == 'dev'
|
|
14
|
+
Requires-Dist: poethepoet>=0.44.0; extra == 'dev'
|
|
15
|
+
Requires-Dist: pytest-cov>=7.1.0; extra == 'dev'
|
|
16
|
+
Requires-Dist: pytest>=9.0.3; extra == 'dev'
|
|
17
|
+
Requires-Dist: ruff>=0.15.11; extra == 'dev'
|
|
18
|
+
Description-Content-Type: text/markdown
|
|
19
|
+
|
|
20
|
+
# dooers-protocol
|
|
21
|
+
|
|
22
|
+
Shared Pydantic models defining the wire contract between any Dooers client (`dooers-cli`, future SDKs) and the `dooers-push` Cloud Run service.
|
|
23
|
+
|
|
24
|
+
`PROTOCOL_VERSION` is exported from the package root.
|
|
25
|
+
|
|
26
|
+
## Modules
|
|
27
|
+
|
|
28
|
+
- `auth` — `AuthSession`, `WhoamiResponse`.
|
|
29
|
+
- `agents` — `AgentRecord`, `CreateAgentRequest`, `AgentManifest` (the `dooers.yaml` schema).
|
|
30
|
+
- `push` — `PushRequest`, `PushResponse`, `BuildStatus`.
|
|
31
|
+
- `audit` — `AuditReport`, `AuditFinding`, `InfraManifest` (used by the auditor pipeline step).
|
|
32
|
+
- `errors` — `ErrorCode`, `ErrorEnvelope`.
|
|
33
|
+
|
|
34
|
+
## Use
|
|
35
|
+
|
|
36
|
+
```python
|
|
37
|
+
from dooers_protocol import PROTOCOL_VERSION
|
|
38
|
+
from dooers_protocol.push import PushResponse, BuildStatus
|
|
39
|
+
```
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
dooers_protocol/__init__.py,sha256=TkaFhARBgFVD_L9ZIMyqzzxApIl3-ldlKwLB4S4o1Ck,136
|
|
2
|
+
dooers_protocol/agents.py,sha256=MfJgzX8qfO0BWyyTaZOKA4vmrJm7RYO0CsxaLS3CSew,2156
|
|
3
|
+
dooers_protocol/audit.py,sha256=gsadgIN0XvdRVTn2G03nXSXjn9k-c4Tdd4yyWNGFmGs,841
|
|
4
|
+
dooers_protocol/auth.py,sha256=oKkwPGwcCWbinhVybWxl3eXq_gRKWENc1d1G2EAvI98,326
|
|
5
|
+
dooers_protocol/errors.py,sha256=6bqare_c1-QMk9MNxZHFgsMhwlfAoVzBEZQVUUOCAus,650
|
|
6
|
+
dooers_protocol/push.py,sha256=u5F5SxOeBnCW5lWh7fVhQgQakqNt7LJ0qcClzoQO0_c,615
|
|
7
|
+
dooers_protocol/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
8
|
+
dooers_protocol-0.1.0.dist-info/METADATA,sha256=DksjmYAWb_P0BL3J4rfGHxtj5BkB9lh8R-ZBG6rlJVE,1398
|
|
9
|
+
dooers_protocol-0.1.0.dist-info/WHEEL,sha256=mffPy8wBnZQn2VnJUU5jE99KsxaSfiyMHV9Yt0aLVxs,87
|
|
10
|
+
dooers_protocol-0.1.0.dist-info/RECORD,,
|