nuagent 0.2.3__tar.gz → 0.2.4__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.
- {nuagent-0.2.3 → nuagent-0.2.4}/PKG-INFO +4 -4
- {nuagent-0.2.3 → nuagent-0.2.4}/pyproject.toml +4 -4
- {nuagent-0.2.3 → nuagent-0.2.4}/src/nuagent/__init__.py +1 -1
- {nuagent-0.2.3 → nuagent-0.2.4}/src/nuagent/core/loop.py +1 -1
- {nuagent-0.2.3 → nuagent-0.2.4}/src/nuagent/planes/chat.py +9 -4
- {nuagent-0.2.3 → nuagent-0.2.4}/src/nuagent/planes/engine.py +1 -1
- {nuagent-0.2.3 → nuagent-0.2.4}/src/nuagent/presets/backends/cc.py +1 -1
- {nuagent-0.2.3 → nuagent-0.2.4}/.gitignore +0 -0
- {nuagent-0.2.3 → nuagent-0.2.4}/README.md +0 -0
- {nuagent-0.2.3 → nuagent-0.2.4}/src/nuagent/core/__init__.py +0 -0
- {nuagent-0.2.3 → nuagent-0.2.4}/src/nuagent/core/program.py +0 -0
- {nuagent-0.2.3 → nuagent-0.2.4}/src/nuagent/planes/__init__.py +0 -0
- {nuagent-0.2.3 → nuagent-0.2.4}/src/nuagent/planes/ext.py +0 -0
- {nuagent-0.2.3 → nuagent-0.2.4}/src/nuagent/planes/settings.py +0 -0
- {nuagent-0.2.3 → nuagent-0.2.4}/src/nuagent/planes/state.py +0 -0
- {nuagent-0.2.3 → nuagent-0.2.4}/src/nuagent/planes/store.py +0 -0
- {nuagent-0.2.3 → nuagent-0.2.4}/src/nuagent/presets/__init__.py +0 -0
- {nuagent-0.2.3 → nuagent-0.2.4}/src/nuagent/presets/backends/__init__.py +0 -0
- {nuagent-0.2.3 → nuagent-0.2.4}/src/nuagent/presets/backends/llm.py +0 -0
- {nuagent-0.2.3 → nuagent-0.2.4}/src/nuagent/presets/store/__init__.py +0 -0
- {nuagent-0.2.3 → nuagent-0.2.4}/src/nuagent/presets/store/kv.py +0 -0
- {nuagent-0.2.3 → nuagent-0.2.4}/src/nuagent/presets/store/mem.py +0 -0
- {nuagent-0.2.3 → nuagent-0.2.4}/src/nuagent/prompt/__init__.py +0 -0
- {nuagent-0.2.3 → nuagent-0.2.4}/src/nuagent/prompt/catalogue.py +0 -0
- {nuagent-0.2.3 → nuagent-0.2.4}/src/nuagent/prompt/section.py +0 -0
- {nuagent-0.2.3 → nuagent-0.2.4}/src/nuagent/prompt/surface.py +0 -0
- {nuagent-0.2.3 → nuagent-0.2.4}/src/nuagent/protocol/__init__.py +0 -0
- {nuagent-0.2.3 → nuagent-0.2.4}/src/nuagent/protocol/observation.py +0 -0
- {nuagent-0.2.3 → nuagent-0.2.4}/src/nuagent/protocol/protocol.md +0 -0
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: nuagent
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.4
|
|
4
4
|
Summary: nuagent: the model answers in Nu, Nu runs the answer.
|
|
5
5
|
Project-URL: Repository, https://github.com/nustackdev/nuverse
|
|
6
6
|
Author-email: Gor Arakelyan <gorarkln@gmail.com>
|
|
7
7
|
License-Expression: Apache-2.0
|
|
8
8
|
Requires-Python: >=3.10
|
|
9
|
-
Requires-Dist: nucore>=0.
|
|
9
|
+
Requires-Dist: nucore>=0.7.0
|
|
10
10
|
Requires-Dist: nuskills>=0.2.0
|
|
11
|
-
Requires-Dist: nustd[kv]>=0.
|
|
11
|
+
Requires-Dist: nustd[kv]>=0.7.0
|
|
12
12
|
Provides-Extra: cc
|
|
13
13
|
Requires-Dist: nustd[cc]; extra == 'cc'
|
|
14
14
|
Provides-Extra: llm
|
|
15
15
|
Requires-Dist: nustd[llm]; extra == 'llm'
|
|
16
16
|
Provides-Extra: space
|
|
17
|
-
Requires-Dist: nuspace>=0.
|
|
17
|
+
Requires-Dist: nuspace>=0.6.3; extra == 'space'
|
|
18
18
|
Description-Content-Type: text/markdown
|
|
19
19
|
|
|
20
20
|
# nuagent
|
|
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "nuagent"
|
|
7
|
-
version = "0.2.
|
|
7
|
+
version = "0.2.4"
|
|
8
8
|
description = "nuagent: the model answers in Nu, Nu runs the answer."
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
license = "Apache-2.0"
|
|
@@ -12,8 +12,8 @@ authors = [{ name = "Gor Arakelyan", email = "gorarkln@gmail.com" }]
|
|
|
12
12
|
requires-python = ">=3.10"
|
|
13
13
|
dependencies = [
|
|
14
14
|
# The core needs only nu. The Chat plane for nuspace is the ``space`` extra.
|
|
15
|
-
"nucore>=0.
|
|
16
|
-
"nustd[kv]>=0.
|
|
15
|
+
"nucore>=0.7.0",
|
|
16
|
+
"nustd[kv]>=0.7.0",
|
|
17
17
|
# The generic Nu prose the opening prompt is assembled from.
|
|
18
18
|
"nuskills>=0.2.0",
|
|
19
19
|
]
|
|
@@ -29,7 +29,7 @@ llm = [
|
|
|
29
29
|
]
|
|
30
30
|
# The Chat plane, a nuspace extension: a conversation with an agent in a space.
|
|
31
31
|
space = [
|
|
32
|
-
"nuspace>=0.
|
|
32
|
+
"nuspace>=0.6.3",
|
|
33
33
|
]
|
|
34
34
|
|
|
35
35
|
[project.urls]
|
|
@@ -132,7 +132,7 @@ def seed(store: Store, prompt: StrArg) -> Nu:
|
|
|
132
132
|
|
|
133
133
|
Notes:
|
|
134
134
|
- ``done`` is written False before the first turn. Unset it reads
|
|
135
|
-
|
|
135
|
+
NULL, the loop condition is never true, and no turn runs.
|
|
136
136
|
"""
|
|
137
137
|
opening = nu.Dict.of(role="user", content=prompt)
|
|
138
138
|
return store.bracket(store.session.messages.set(nu.List.of(opening))) >> store.rewrite(
|
|
@@ -30,8 +30,9 @@ import nustd.ui
|
|
|
30
30
|
from nu.lang import ScalarQuery
|
|
31
31
|
from nuagent.protocol import CONSTRUCT, NO_CODE, OK, RUNTIME
|
|
32
32
|
from nuspace import ops
|
|
33
|
+
from nuspace.ops.kernel import plane_live
|
|
33
34
|
from nuspace.ops.utils import MintId
|
|
34
|
-
from nuspace.shapes import Reroot
|
|
35
|
+
from nuspace.shapes import Reroot
|
|
35
36
|
from nuspace.system.devices.web.shell import Shell
|
|
36
37
|
from nuspace.system.devices.web.utils import CellRoot
|
|
37
38
|
from nuspace.system.services import enable_react
|
|
@@ -88,7 +89,7 @@ TITLES = {
|
|
|
88
89
|
|
|
89
90
|
|
|
90
91
|
def ensure(page: nu.StrArg) -> nu.Nu:
|
|
91
|
-
"""The page's engine, its cell, its reaction and the agent settings, each made when missing.
|
|
92
|
+
"""The page's engine, its cell, its lists, its reaction and the agent settings, each made when missing.
|
|
92
93
|
|
|
93
94
|
Idempotent, and safe from two tabs at once: the engine and its cell
|
|
94
95
|
have fixed ids, and the reaction is :func:`enable_react`'s, which is
|
|
@@ -106,8 +107,12 @@ def ensure(page: nu.StrArg) -> nu.Nu:
|
|
|
106
107
|
snap(ops.cell_exists(cell).not_()),
|
|
107
108
|
ops.add_cell(engine, SOURCE, cell_id=cell, name="engine"),
|
|
108
109
|
)
|
|
110
|
+
# The conversation's lists, made with it: the page and the engine read them from the start.
|
|
111
|
+
lists = Chat.inbox.init(nu.List.create()) >> Chat.turns.init(nu.List.create())
|
|
112
|
+
lists = lists >> Chat.messages.init(nu.List.create())
|
|
113
|
+
kept = ops.atomic_state(ops.plane_state(engine, lists))
|
|
109
114
|
reaction = enable_react(inbox_change(engine), engine, imports=IMPORTS)
|
|
110
|
-
return made >> settings.ensure() >> reaction
|
|
115
|
+
return made >> kept >> settings.ensure() >> reaction
|
|
111
116
|
|
|
112
117
|
|
|
113
118
|
def say(engine: nu.StrArg, text: nu.StrArg) -> nu.Nu:
|
|
@@ -150,7 +155,7 @@ def stop(engine: nu.StrArg) -> nu.Nu:
|
|
|
150
155
|
when a call will not let go). What it said so far stays.
|
|
151
156
|
"""
|
|
152
157
|
handled = Chat.cursor.set(Chat.inbox.len()) >> Chat.status.set(STOPPED)
|
|
153
|
-
live = snap(
|
|
158
|
+
live = snap(plane_live(engine))
|
|
154
159
|
stopping = nu.ForEachDo(live, lambda run: ops.plane_stop(nu.Str(run)))
|
|
155
160
|
return ops.atomic_state(ops.plane_state(engine, handled)) >> stopping
|
|
156
161
|
|
|
@@ -164,7 +164,7 @@ def _record(at: nu.Int) -> nu.Nu:
|
|
|
164
164
|
kept = nu.Dict.of(
|
|
165
165
|
at=at,
|
|
166
166
|
reply=Chat.reply.fallback(""),
|
|
167
|
-
program=nu.str(Chat.program
|
|
167
|
+
program=nu.str(Chat.program.fallback("")),
|
|
168
168
|
kind=Chat.outcome.kind.fallback(""),
|
|
169
169
|
observation=nu.str(told["content"]),
|
|
170
170
|
)
|
|
@@ -187,6 +187,6 @@ class ClaudeCode:
|
|
|
187
187
|
elif isinstance(self.sid, str):
|
|
188
188
|
held = nu.Frame(Thread, session, sid=self.sid)
|
|
189
189
|
else:
|
|
190
|
-
minted = nu.IfDo(self.sid.
|
|
190
|
+
minted = nu.IfDo(self.sid.is_null(), self.sid.set(nustd.cc.NewSession()))
|
|
191
191
|
held = minted >> nu.Frame(Thread, session, sid=self.sid)
|
|
192
192
|
return nu.With(nustd.cc.bind(Agent, **self.options), body=held)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|