arkitekt-next 0.9.4__py3-none-any.whl → 0.10.2__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.
Potentially problematic release.
This version of arkitekt-next might be problematic. Click here for more details.
- arkitekt_next/__blok__.py +2 -2
- arkitekt_next/__init__.py +38 -37
- arkitekt_next/apps/__init__.py +1 -1
- arkitekt_next/apps/{types.py → protocols.py} +22 -9
- arkitekt_next/apps/service/fakts_next.py +15 -30
- arkitekt_next/base_models.py +3 -3
- arkitekt_next/bloks/admin.py +0 -2
- arkitekt_next/bloks/base.py +2 -0
- arkitekt_next/bloks/channel.py +27 -0
- arkitekt_next/bloks/services/channel.py +12 -0
- arkitekt_next/builders.py +9 -8
- arkitekt_next/cli/commands/call/main.py +2 -1
- arkitekt_next/cli/commands/call/remote.py +4 -1
- arkitekt_next/cli/commands/inspect/requirements.py +3 -8
- arkitekt_next/cli/commands/inspect/templates.py +6 -9
- arkitekt_next/cli/commands/run/dev.py +3 -4
- arkitekt_next/cli/commands/run/utils.py +1 -1
- arkitekt_next/cli/ui.py +2 -4
- arkitekt_next/cli/utils.py +1 -1
- arkitekt_next/constants.py +0 -2
- arkitekt_next/init_registry.py +16 -92
- arkitekt_next/qt/builders.py +2 -2
- arkitekt_next/qt/magic_bar.py +1 -1
- arkitekt_next/qt/types.py +1 -1
- arkitekt_next/service_registry.py +52 -46
- arkitekt_next/tqdm.py +68 -7
- arkitekt_next/utils.py +7 -6
- {arkitekt_next-0.9.4.dist-info → arkitekt_next-0.10.2.dist-info}/METADATA +40 -39
- {arkitekt_next-0.9.4.dist-info → arkitekt_next-0.10.2.dist-info}/RECORD +45 -44
- {arkitekt_next-0.9.4.dist-info → arkitekt_next-0.10.2.dist-info}/WHEEL +1 -1
- arkitekt_next-0.10.2.dist-info/entry_points.txt +2 -0
- arkitekt_next/cli/configs/base.yaml +0 -867
- arkitekt_next-0.9.4.dist-info/entry_points.txt +0 -3
- {arkitekt_next-0.9.4.dist-info → arkitekt_next-0.10.2.dist-info/licenses}/LICENSE +0 -0
arkitekt_next/__blok__.py
CHANGED
|
@@ -23,9 +23,10 @@ from arkitekt_next.bloks.self_signed import SelfSignedBlok
|
|
|
23
23
|
from arkitekt_next.bloks.kraph import KraphBlok
|
|
24
24
|
from arkitekt_next.bloks.local_sign import LocalSignBlok
|
|
25
25
|
from arkitekt_next.bloks.elektro import ElektroBlok
|
|
26
|
+
from blok.blok import Blok
|
|
26
27
|
|
|
27
28
|
|
|
28
|
-
def get_bloks():
|
|
29
|
+
def get_bloks() -> list[Blok]:
|
|
29
30
|
return [
|
|
30
31
|
AdminBlok(),
|
|
31
32
|
ArkitektBlok(),
|
|
@@ -53,4 +54,3 @@ def get_bloks():
|
|
|
53
54
|
LocalSignBlok(),
|
|
54
55
|
ElektroBlok(),
|
|
55
56
|
]
|
|
56
|
-
|
arkitekt_next/__init__.py
CHANGED
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
from .builders import easy, interactive
|
|
2
|
+
from .apps.protocols import App
|
|
3
|
+
from fakts_next.helpers import afakt, fakt
|
|
4
|
+
from .init_registry import init, InitHookRegisty, get_current_init_hook_registry
|
|
5
|
+
from .service_registry import (
|
|
6
|
+
require,
|
|
7
|
+
ServiceBuilderRegistry,
|
|
8
|
+
get_default_service_registry,
|
|
9
|
+
)
|
|
10
|
+
|
|
11
|
+
|
|
1
12
|
def missing_install(name: str, error: Exception):
|
|
2
13
|
def real_missing_install(*args, **kwargs):
|
|
3
14
|
raise ImportError(
|
|
@@ -8,27 +19,34 @@ def missing_install(name: str, error: Exception):
|
|
|
8
19
|
|
|
9
20
|
|
|
10
21
|
try:
|
|
11
|
-
from rekuest_next.register import register
|
|
12
|
-
from rekuest_next.agents.hooks import background
|
|
13
|
-
from rekuest_next.agents.hooks import startup
|
|
22
|
+
from rekuest_next.register import register
|
|
23
|
+
from rekuest_next.agents.hooks.background import background
|
|
24
|
+
from rekuest_next.agents.hooks.startup import startup
|
|
14
25
|
from rekuest_next.agents.context import context
|
|
15
|
-
from rekuest_next.state.
|
|
16
|
-
from rekuest_next.actors.
|
|
17
|
-
from rekuest_next.actors.
|
|
18
|
-
from rekuest_next.actors.
|
|
19
|
-
from rekuest_next.register import test, benchmark
|
|
26
|
+
from rekuest_next.state.decorator import state
|
|
27
|
+
from rekuest_next.actors.context import abreakpoint, breakpoint
|
|
28
|
+
from rekuest_next.actors.context import progress, aprogress
|
|
29
|
+
from rekuest_next.actors.context import log, alog
|
|
20
30
|
from rekuest_next.structures.model import model
|
|
21
|
-
from rekuest_next.
|
|
22
|
-
|
|
31
|
+
from rekuest_next.remote import (
|
|
32
|
+
call,
|
|
33
|
+
acall,
|
|
34
|
+
acall_raw,
|
|
35
|
+
iterate,
|
|
36
|
+
aiterate,
|
|
37
|
+
aiterate_raw,
|
|
38
|
+
find,
|
|
39
|
+
)
|
|
23
40
|
except ImportError as e:
|
|
24
41
|
raise e
|
|
25
|
-
|
|
42
|
+
structure = missing_install("rekuest_next", e)
|
|
26
43
|
register = missing_install("rekuest_next", e)
|
|
27
44
|
background = missing_install("rekuest_next", e)
|
|
28
45
|
abreakpoint = missing_install("rekuest_next", e)
|
|
29
46
|
breakpoint = missing_install("rekuest_next", e)
|
|
30
47
|
startup = missing_install("rekuest_next", e)
|
|
31
48
|
context = missing_install("rekuest_next", e)
|
|
49
|
+
find = missing_install("rekuest_next", e)
|
|
32
50
|
state = missing_install("rekuest_next", e)
|
|
33
51
|
progress = missing_install("rekuest_next", e)
|
|
34
52
|
aprogress = missing_install("rekuest_next", e)
|
|
@@ -40,16 +58,9 @@ except ImportError as e:
|
|
|
40
58
|
acall_raw = missing_install("rekuest_next", e)
|
|
41
59
|
find = missing_install("rekuest_next", e)
|
|
42
60
|
afind = missing_install("rekuest_next", e)
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
from fakts_next.helpers import afakt, fakt
|
|
47
|
-
from .init_registry import init, InitHookRegisty, get_current_init_hook_registry
|
|
48
|
-
from .service_registry import (
|
|
49
|
-
require,
|
|
50
|
-
ServiceBuilderRegistry,
|
|
51
|
-
get_current_service_registry,
|
|
52
|
-
)
|
|
61
|
+
aiterate_raw = missing_install("rekuest_next", e)
|
|
62
|
+
aiterate = missing_install("rekuest_next", e)
|
|
63
|
+
iterate = missing_install("rekuest_next", e)
|
|
53
64
|
|
|
54
65
|
|
|
55
66
|
__all__ = [
|
|
@@ -57,39 +68,29 @@ __all__ = [
|
|
|
57
68
|
"require",
|
|
58
69
|
"easy",
|
|
59
70
|
"interactive",
|
|
60
|
-
"publicqt",
|
|
61
|
-
"jupy",
|
|
62
71
|
"log",
|
|
63
72
|
"alog",
|
|
64
73
|
"afakt",
|
|
65
74
|
"fakt",
|
|
66
75
|
"progress",
|
|
67
76
|
"aprogress",
|
|
68
|
-
"scheduler",
|
|
69
|
-
"register_structure",
|
|
70
|
-
"requirement",
|
|
71
77
|
"ServiceBuilderRegistry",
|
|
72
|
-
"
|
|
78
|
+
"get_default_service_registry",
|
|
73
79
|
"register",
|
|
74
|
-
"group",
|
|
75
|
-
"useGuardian",
|
|
76
|
-
"useInstanceID",
|
|
77
80
|
"find",
|
|
78
|
-
"
|
|
81
|
+
"breakpoint",
|
|
82
|
+
"abreakpoint",
|
|
83
|
+
"aiterate",
|
|
84
|
+
"iterate",
|
|
85
|
+
"aiterate_raw",
|
|
79
86
|
"call",
|
|
80
|
-
"call_raw",
|
|
81
87
|
"acall",
|
|
82
88
|
"acall_raw",
|
|
83
89
|
"model",
|
|
84
|
-
"test",
|
|
85
|
-
"benchmark",
|
|
86
|
-
"useUser",
|
|
87
|
-
"next",
|
|
88
90
|
"state",
|
|
89
91
|
"context",
|
|
90
92
|
"background",
|
|
91
93
|
"startup",
|
|
92
|
-
"register_next",
|
|
93
94
|
"init",
|
|
94
95
|
"InitHookRegisty",
|
|
95
96
|
"get_current_init_hook_registry",
|
arkitekt_next/apps/__init__.py
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"""
|
|
2
2
|
This module contains the types for the apps
|
|
3
3
|
depending on the builder used.
|
|
4
|
-
|
|
5
4
|
This module imports all the apps and their types
|
|
6
5
|
and sets them as attributes on the App class, if they are available.
|
|
7
6
|
If they are not available, they are set to Any, so that we can add
|
|
@@ -11,12 +10,17 @@ an import exception to the app.
|
|
|
11
10
|
"""
|
|
12
11
|
|
|
13
12
|
import logging
|
|
14
|
-
from typing import
|
|
13
|
+
from typing import Any, Dict, TYPE_CHECKING
|
|
14
|
+
from koil import unkoil
|
|
15
15
|
from arkitekt_next.base_models import Manifest
|
|
16
16
|
from koil.composition import Composition
|
|
17
17
|
from fakts_next import Fakts
|
|
18
18
|
from herre_next import Herre
|
|
19
|
-
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
if TYPE_CHECKING:
|
|
22
|
+
from rekuest_next.rekuest import RekuestNext
|
|
23
|
+
|
|
20
24
|
|
|
21
25
|
logger = logging.getLogger(__name__)
|
|
22
26
|
|
|
@@ -29,18 +33,27 @@ class App(Composition):
|
|
|
29
33
|
manifest: Manifest
|
|
30
34
|
services: Dict[str, Any]
|
|
31
35
|
|
|
36
|
+
@property
|
|
37
|
+
def rekuest(self) -> "RekuestNext":
|
|
38
|
+
"""Get the rekuest service"""
|
|
39
|
+
if "rekuest" not in self.services:
|
|
40
|
+
raise ValueError("Rekuest service is not available")
|
|
41
|
+
return self.services["rekuest"]
|
|
42
|
+
|
|
32
43
|
def run(self):
|
|
33
|
-
|
|
34
|
-
return self.services["rekuest"].run()
|
|
44
|
+
return unkoil(self.rekuest.arun)
|
|
35
45
|
|
|
36
|
-
def
|
|
37
|
-
|
|
46
|
+
async def arun(self):
|
|
47
|
+
return await self.rekuest.arun()
|
|
38
48
|
|
|
39
|
-
|
|
49
|
+
def run_detached(self):
|
|
50
|
+
"""Run the app detached"""
|
|
51
|
+
return self.rekuest.run_detached()
|
|
40
52
|
|
|
41
53
|
def register(self, *args, **kwargs):
|
|
42
54
|
"""Register a service"""
|
|
43
|
-
|
|
55
|
+
|
|
56
|
+
self.rekuest.register(*args, **kwargs)
|
|
44
57
|
|
|
45
58
|
async def __aenter__(self):
|
|
46
59
|
await super().__aenter__()
|
|
@@ -4,41 +4,35 @@ from fakts_next.fakts import Fakts
|
|
|
4
4
|
from fakts_next.grants.hard import HardFakts
|
|
5
5
|
from fakts_next.grants.remote import RemoteGrant
|
|
6
6
|
from fakts_next.grants.remote.discovery.well_known import WellKnownDiscovery
|
|
7
|
-
from fakts_next.grants.remote import RemoteGrant
|
|
8
7
|
from fakts_next.grants.remote.demanders.static import StaticDemander
|
|
9
|
-
from fakts_next.grants.remote.demanders.device_code import
|
|
8
|
+
from fakts_next.grants.remote.demanders.device_code import (
|
|
9
|
+
ClientKind,
|
|
10
|
+
DeviceCodeDemander,
|
|
11
|
+
)
|
|
10
12
|
from fakts_next.grants.remote.claimers.post import ClaimEndpointClaimer
|
|
11
13
|
from fakts_next.grants.remote.demanders.redeem import RedeemDemander
|
|
12
14
|
from fakts_next.cache.file import FileCache
|
|
13
15
|
from arkitekt_next.base_models import Manifest
|
|
14
16
|
|
|
15
17
|
|
|
16
|
-
class ArkitektNextFaktsQt(Fakts):
|
|
17
|
-
grant: RemoteGrant
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
class ArkitektNextFaktsNext(Fakts):
|
|
21
|
-
pass
|
|
22
|
-
|
|
23
|
-
|
|
24
18
|
def build_arkitekt_next_fakts_next(
|
|
25
19
|
manifest: Manifest,
|
|
26
20
|
url: Optional[str] = None,
|
|
27
21
|
no_cache: bool = False,
|
|
28
22
|
headless: bool = False,
|
|
29
|
-
|
|
30
|
-
) -> ArkitektNextFaktsNext:
|
|
23
|
+
) -> Fakts:
|
|
31
24
|
identifier = manifest.identifier
|
|
32
25
|
version = manifest.version
|
|
26
|
+
if url is None:
|
|
27
|
+
raise ValueError("URL must be provided")
|
|
33
28
|
|
|
34
29
|
demander = DeviceCodeDemander(
|
|
35
30
|
manifest=manifest,
|
|
36
|
-
redirect_uri="http://127.0.0.1:6767",
|
|
37
31
|
open_browser=not headless,
|
|
38
|
-
requested_client_kind=
|
|
32
|
+
requested_client_kind=ClientKind.DEVELOPMENT,
|
|
39
33
|
)
|
|
40
34
|
|
|
41
|
-
return
|
|
35
|
+
return Fakts(
|
|
42
36
|
grant=RemoteGrant(
|
|
43
37
|
demander=demander,
|
|
44
38
|
discovery=WellKnownDiscovery(url=url, auto_protocols=["https", "http"]),
|
|
@@ -47,22 +41,15 @@ def build_arkitekt_next_fakts_next(
|
|
|
47
41
|
cache=FileCache(
|
|
48
42
|
cache_file=f".arkitekt_next/cache/{identifier}-{version}_fakts_cache.json",
|
|
49
43
|
hash=manifest.hash() + url,
|
|
50
|
-
skip_cache=no_cache,
|
|
51
44
|
),
|
|
52
45
|
)
|
|
53
46
|
|
|
54
47
|
|
|
55
|
-
def build_arkitekt_next_redeem_fakts_next(
|
|
56
|
-
manifest: Manifest,
|
|
57
|
-
redeem_token: str,
|
|
58
|
-
url,
|
|
59
|
-
no_cache: Optional[bool] = False,
|
|
60
|
-
headless=False,
|
|
61
|
-
):
|
|
48
|
+
def build_arkitekt_next_redeem_fakts_next(manifest: Manifest, redeem_token: str, url):
|
|
62
49
|
identifier = manifest.identifier
|
|
63
50
|
version = manifest.version
|
|
64
51
|
|
|
65
|
-
return
|
|
52
|
+
return Fakts(
|
|
66
53
|
grant=RemoteGrant(
|
|
67
54
|
demander=RedeemDemander(token=redeem_token, manifest=manifest),
|
|
68
55
|
discovery=WellKnownDiscovery(url=url, auto_protocols=["https", "http"]),
|
|
@@ -83,9 +70,9 @@ def build_arkitekt_next_token_fakts_next(
|
|
|
83
70
|
identifier = manifest.identifier
|
|
84
71
|
version = manifest.version
|
|
85
72
|
|
|
86
|
-
return
|
|
73
|
+
return Fakts(
|
|
87
74
|
grant=RemoteGrant(
|
|
88
|
-
demander=StaticDemander(token=token),
|
|
75
|
+
demander=StaticDemander(token=token), # type: ignore
|
|
89
76
|
discovery=WellKnownDiscovery(url=url, auto_protocols=["https", "http"]),
|
|
90
77
|
claimer=ClaimEndpointClaimer(),
|
|
91
78
|
),
|
|
@@ -97,11 +84,9 @@ def build_arkitekt_next_token_fakts_next(
|
|
|
97
84
|
|
|
98
85
|
|
|
99
86
|
def build_local_fakts(manifest, fakts):
|
|
100
|
-
|
|
101
87
|
identifier = manifest.identifier
|
|
102
88
|
version = manifest.version
|
|
103
89
|
|
|
104
|
-
return
|
|
90
|
+
return Fakts(
|
|
105
91
|
grant=HardFakts(fakts=fakts),
|
|
106
|
-
|
|
107
|
-
)
|
|
92
|
+
)
|
arkitekt_next/base_models.py
CHANGED
|
@@ -43,7 +43,7 @@ class Manifest(BaseModel):
|
|
|
43
43
|
requirements: Optional[List[Requirement]] = Field(default_factory=list)
|
|
44
44
|
""" Requirements that this app has TODO: What are the requirements? """
|
|
45
45
|
model_config = ConfigDict(extra="forbid")
|
|
46
|
-
|
|
46
|
+
|
|
47
47
|
description: Optional[str] = None
|
|
48
48
|
""" A human readable description of the app """
|
|
49
49
|
|
|
@@ -74,8 +74,8 @@ class Manifest(BaseModel):
|
|
|
74
74
|
# Hash the JSON encoded dictionary
|
|
75
75
|
return sha256(json_dd.encode()).hexdigest()
|
|
76
76
|
|
|
77
|
-
@field_validator("identifier")
|
|
78
|
-
def check_identifier(cls, v):
|
|
77
|
+
@field_validator("identifier", mode="after")
|
|
78
|
+
def check_identifier(cls, v: str) -> str:
|
|
79
79
|
assert "/" not in v, "The identifier should not contain a /"
|
|
80
80
|
assert len(v) > 0, "The identifier should not be empty"
|
|
81
81
|
assert len(v) < 256, "The identifier should not be longer than 256 characters"
|
arkitekt_next/bloks/admin.py
CHANGED
arkitekt_next/bloks/base.py
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
from arkitekt_next.bloks.services.channel import ChannelService
|
|
1
2
|
from blok import blok, InitContext, Option
|
|
2
3
|
from blok.tree import YamlFile, Repo
|
|
3
4
|
from typing import Any, Optional, Protocol
|
|
@@ -62,6 +63,7 @@ class BaseArkitektService:
|
|
|
62
63
|
redis: RedisService,
|
|
63
64
|
s3: S3Service,
|
|
64
65
|
config: ConfigService,
|
|
66
|
+
channel: ChannelService,
|
|
65
67
|
mount: MountService,
|
|
66
68
|
admin: AdminService,
|
|
67
69
|
secret: SecretService,
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
from pydantic import BaseModel
|
|
2
|
+
from typing import Dict, Any
|
|
3
|
+
from blok import blok, InitContext, Option
|
|
4
|
+
from arkitekt_next.bloks.services.channel import ChannelService
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
@blok(ChannelService, description="The current channel of the application")
|
|
8
|
+
class ChannelBlok:
|
|
9
|
+
def __init__(self) -> None:
|
|
10
|
+
self.name = "default"
|
|
11
|
+
|
|
12
|
+
def preflight(self, init: InitContext):
|
|
13
|
+
for key, value in init.kwargs.items():
|
|
14
|
+
setattr(self, key, value)
|
|
15
|
+
|
|
16
|
+
def retrieve(self):
|
|
17
|
+
return self.name
|
|
18
|
+
|
|
19
|
+
def get_options(self):
|
|
20
|
+
with_name = Option(
|
|
21
|
+
subcommand="name",
|
|
22
|
+
help="Which channel name to use",
|
|
23
|
+
default=self.name,
|
|
24
|
+
show_default=True,
|
|
25
|
+
)
|
|
26
|
+
|
|
27
|
+
return [with_name]
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
from typing import Dict, Any, Protocol
|
|
2
|
+
from blok import blok, InitContext, Option
|
|
3
|
+
from blok import service
|
|
4
|
+
from dataclasses import dataclass
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
@service("live.arkitekt.channel")
|
|
9
|
+
class ChannelService(Protocol):
|
|
10
|
+
|
|
11
|
+
def retrieve_channel(self) -> str:
|
|
12
|
+
return str
|
arkitekt_next/builders.py
CHANGED
|
@@ -11,14 +11,14 @@ from arkitekt_next.apps.service.fakts_next import (
|
|
|
11
11
|
from arkitekt_next.apps.service.herre import build_arkitekt_next_herre_next
|
|
12
12
|
from .utils import create_arkitekt_next_folder
|
|
13
13
|
from .base_models import Manifest
|
|
14
|
-
from .apps.
|
|
15
|
-
from .service_registry import ServiceBuilderRegistry,
|
|
14
|
+
from .apps.protocols import App
|
|
15
|
+
from .service_registry import ServiceBuilderRegistry, get_default_service_registry
|
|
16
16
|
from .init_registry import InitHookRegisty, get_current_init_hook_registry
|
|
17
17
|
from arkitekt_next.constants import DEFAULT_ARKITEKT_URL
|
|
18
18
|
|
|
19
19
|
|
|
20
20
|
def easy(
|
|
21
|
-
identifier: str = None,
|
|
21
|
+
identifier: str | None = None,
|
|
22
22
|
version: str = "0.0.1",
|
|
23
23
|
logo: Optional[str] = None,
|
|
24
24
|
scopes: Optional[List[str]] = None,
|
|
@@ -28,7 +28,6 @@ def easy(
|
|
|
28
28
|
token: Optional[str] = None,
|
|
29
29
|
no_cache: bool = False,
|
|
30
30
|
redeem_token: Optional[str] = None,
|
|
31
|
-
app_kind: str = "development",
|
|
32
31
|
service_registry: Optional[ServiceBuilderRegistry] = None,
|
|
33
32
|
init_hook_registry: Optional[InitHookRegisty] = None,
|
|
34
33
|
fakts: Optional[str] = None,
|
|
@@ -100,9 +99,14 @@ def easy(
|
|
|
100
99
|
NextApp
|
|
101
100
|
A built app, that can be used to interact with the ArkitektNext server
|
|
102
101
|
"""
|
|
103
|
-
service_registry = service_registry or
|
|
102
|
+
service_registry = service_registry or get_default_service_registry()
|
|
104
103
|
init_hook_registry = init_hook_registry or get_current_init_hook_registry()
|
|
105
104
|
|
|
105
|
+
if init_hook_registry is None:
|
|
106
|
+
raise ValueError(
|
|
107
|
+
"No init hook registry found. Please provide a init hook registry or use the default one."
|
|
108
|
+
)
|
|
109
|
+
|
|
106
110
|
if identifier is None:
|
|
107
111
|
identifier = __file__.split("/")[-1].replace(".py", "")
|
|
108
112
|
|
|
@@ -135,8 +139,6 @@ def easy(
|
|
|
135
139
|
manifest=manifest,
|
|
136
140
|
redeem_token=redeem_token,
|
|
137
141
|
url=url,
|
|
138
|
-
no_cache=no_cache,
|
|
139
|
-
headless=headless,
|
|
140
142
|
)
|
|
141
143
|
else:
|
|
142
144
|
fakts_next = build_arkitekt_next_fakts_next(
|
|
@@ -144,7 +146,6 @@ def easy(
|
|
|
144
146
|
url=url,
|
|
145
147
|
no_cache=no_cache,
|
|
146
148
|
headless=headless,
|
|
147
|
-
client_kind=app_kind,
|
|
148
149
|
)
|
|
149
150
|
|
|
150
151
|
herre_next = build_arkitekt_next_herre_next(fakts_next=fakts_next)
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
from click import Context
|
|
1
2
|
import rich_click as click
|
|
2
3
|
|
|
3
4
|
|
|
@@ -7,7 +8,7 @@ from .remote import remote
|
|
|
7
8
|
|
|
8
9
|
@click.group()
|
|
9
10
|
@click.pass_context
|
|
10
|
-
def call(ctx):
|
|
11
|
+
def call(ctx: Context) -> None:
|
|
11
12
|
"""Inspects your arkitekt_next app
|
|
12
13
|
|
|
13
14
|
Inspects various parts of your arkitekt_next app. This is useful for debugging
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
from click import Context
|
|
1
2
|
import rich_click as click
|
|
2
3
|
from arkitekt_next.cli.options import *
|
|
3
4
|
import asyncio
|
|
@@ -49,7 +50,9 @@ async def call_app(
|
|
|
49
50
|
help="The hash of the node to run",
|
|
50
51
|
type=str,
|
|
51
52
|
)
|
|
52
|
-
def remote(
|
|
53
|
+
def remote(
|
|
54
|
+
ctx: Context, entrypoint=None, builder=None, args=None, hash=str, **builder_kwargs
|
|
55
|
+
):
|
|
53
56
|
"""ALlows you to run a get the output of a node in a remote app.
|
|
54
57
|
|
|
55
58
|
This is useful for debugging and testing. In this mode the app itself will not
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
from arkitekt_next import
|
|
1
|
+
from arkitekt_next import get_default_service_registry
|
|
2
2
|
import rich_click as click
|
|
3
3
|
from importlib import import_module
|
|
4
|
-
from arkitekt_next.apps.
|
|
4
|
+
from arkitekt_next.apps.protocols import App
|
|
5
5
|
from arkitekt_next.cli.commands.run.utils import import_builder
|
|
6
6
|
from arkitekt_next.cli.vars import get_console, get_manifest
|
|
7
7
|
from arkitekt_next.cli.options import with_builder
|
|
@@ -48,7 +48,6 @@ def requirements(
|
|
|
48
48
|
entrypoint_file = f"{manifest.entrypoint}.py"
|
|
49
49
|
os.path.realpath(entrypoint_file)
|
|
50
50
|
|
|
51
|
-
|
|
52
51
|
entrypoint = manifest.entrypoint
|
|
53
52
|
|
|
54
53
|
with console.status("Loading entrypoint module..."):
|
|
@@ -58,13 +57,9 @@ def requirements(
|
|
|
58
57
|
console.print(f"Could not find entrypoint module {entrypoint}")
|
|
59
58
|
raise e
|
|
60
59
|
|
|
61
|
-
|
|
62
|
-
service_registry = get_current_service_registry()
|
|
63
|
-
|
|
64
|
-
|
|
60
|
+
service_registry = get_default_service_registry()
|
|
65
61
|
|
|
66
62
|
x = [item.model_dump(by_alias=True) for item in service_registry.get_requirements()]
|
|
67
|
-
|
|
68
63
|
|
|
69
64
|
if machine_readable:
|
|
70
65
|
print("--START_REQUIREMENTS--" + json.dumps(x) + "--END_REQUIREMENTS--")
|
|
@@ -2,7 +2,7 @@ import asyncio
|
|
|
2
2
|
from pydantic import BaseModel
|
|
3
3
|
import rich_click as click
|
|
4
4
|
from importlib import import_module
|
|
5
|
-
from arkitekt_next.apps.
|
|
5
|
+
from arkitekt_next.apps.protocols import App
|
|
6
6
|
from arkitekt_next.cli.commands.run.utils import import_builder
|
|
7
7
|
from arkitekt_next.cli.vars import get_console, get_manifest
|
|
8
8
|
from arkitekt_next.cli.options import with_builder
|
|
@@ -18,7 +18,6 @@ except ImportError:
|
|
|
18
18
|
pass
|
|
19
19
|
|
|
20
20
|
|
|
21
|
-
|
|
22
21
|
@click.command("prod")
|
|
23
22
|
@click.pass_context
|
|
24
23
|
@click.option(
|
|
@@ -77,17 +76,15 @@ def templates(
|
|
|
77
76
|
)
|
|
78
77
|
|
|
79
78
|
rekuest = app.services.get("rekuest")
|
|
80
|
-
|
|
81
|
-
registry =
|
|
79
|
+
|
|
80
|
+
registry = get_default_definition_registry()
|
|
82
81
|
global_list = []
|
|
83
82
|
if registry is None:
|
|
84
83
|
raise Exception("No default registry found")
|
|
85
|
-
|
|
86
|
-
to_be_created_templates = tuple(
|
|
87
|
-
x.model_dump() for x in registry.templates.values()
|
|
88
|
-
)
|
|
84
|
+
|
|
85
|
+
to_be_created_templates = tuple(x.model_dump() for x in registry.templates.values())
|
|
89
86
|
global_list.extend(to_be_created_templates)
|
|
90
|
-
|
|
87
|
+
|
|
91
88
|
console.print(f"Templates to be created: {len(global_list)}")
|
|
92
89
|
|
|
93
90
|
if rekuest is None:
|
|
@@ -9,14 +9,13 @@ import os
|
|
|
9
9
|
import sys
|
|
10
10
|
import inspect
|
|
11
11
|
from rekuest_next.definition.registry import get_default_definition_registry
|
|
12
|
-
from rekuest_next.agents.hooks import get_default_hook_registry
|
|
12
|
+
from rekuest_next.agents.hooks.registry import get_default_hook_registry
|
|
13
13
|
from typing import MutableSet, Tuple, Any, Set
|
|
14
14
|
from arkitekt_next.cli.ui import construct_changes_group, construct_app_group
|
|
15
15
|
from arkitekt_next.cli.commands.run.utils import import_builder
|
|
16
16
|
from arkitekt_next.cli.types import Manifest
|
|
17
|
-
from arkitekt_next.apps.
|
|
17
|
+
from arkitekt_next.apps.protocols import App
|
|
18
18
|
import rich_click as click
|
|
19
|
-
import os
|
|
20
19
|
from arkitekt_next.cli.options import (
|
|
21
20
|
with_fakts_next_url,
|
|
22
21
|
with_builder,
|
|
@@ -105,7 +104,7 @@ async def run_app(app: App) -> None:
|
|
|
105
104
|
raise Exception("No rekuest service found. We need this to run the app.")
|
|
106
105
|
|
|
107
106
|
async with app:
|
|
108
|
-
await rekuest.
|
|
107
|
+
await rekuest.arun()
|
|
109
108
|
|
|
110
109
|
|
|
111
110
|
def reload_modules(reloadable_modules) -> None:
|
arkitekt_next/cli/ui.py
CHANGED
|
@@ -11,7 +11,6 @@ try:
|
|
|
11
11
|
except ImportError:
|
|
12
12
|
get_default_definition_registry = lambda: None
|
|
13
13
|
pass
|
|
14
|
-
|
|
15
14
|
|
|
16
15
|
|
|
17
16
|
def construct_codegen_welcome_panel() -> Panel:
|
|
@@ -71,12 +70,11 @@ def construct_app_group(app: App) -> Group:
|
|
|
71
70
|
rekuest = app.services.get("rekuest")
|
|
72
71
|
if rekuest is None:
|
|
73
72
|
return Group(panel_header, service_tree)
|
|
74
|
-
|
|
73
|
+
|
|
75
74
|
default = get_default_definition_registry()
|
|
76
75
|
if default is not None:
|
|
77
|
-
for key, template in default.
|
|
76
|
+
for key, template in default.implementations.items():
|
|
78
77
|
actor_tree.add(key + "-" + template.definition.name)
|
|
79
|
-
|
|
80
78
|
|
|
81
79
|
panel_group = Group(panel_header, service_tree, actor_tree)
|
|
82
80
|
|
arkitekt_next/cli/utils.py
CHANGED
arkitekt_next/constants.py
CHANGED