nuagent 0.2.2__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.
Files changed (29) hide show
  1. {nuagent-0.2.2 → nuagent-0.2.4}/PKG-INFO +4 -4
  2. {nuagent-0.2.2 → nuagent-0.2.4}/pyproject.toml +4 -4
  3. {nuagent-0.2.2 → nuagent-0.2.4}/src/nuagent/__init__.py +1 -1
  4. {nuagent-0.2.2 → nuagent-0.2.4}/src/nuagent/core/loop.py +1 -1
  5. {nuagent-0.2.2 → nuagent-0.2.4}/src/nuagent/planes/chat.py +10 -5
  6. {nuagent-0.2.2 → nuagent-0.2.4}/src/nuagent/planes/engine.py +1 -1
  7. {nuagent-0.2.2 → nuagent-0.2.4}/src/nuagent/planes/ext.py +2 -2
  8. {nuagent-0.2.2 → nuagent-0.2.4}/src/nuagent/presets/backends/cc.py +1 -1
  9. {nuagent-0.2.2 → nuagent-0.2.4}/.gitignore +0 -0
  10. {nuagent-0.2.2 → nuagent-0.2.4}/README.md +0 -0
  11. {nuagent-0.2.2 → nuagent-0.2.4}/src/nuagent/core/__init__.py +0 -0
  12. {nuagent-0.2.2 → nuagent-0.2.4}/src/nuagent/core/program.py +0 -0
  13. {nuagent-0.2.2 → nuagent-0.2.4}/src/nuagent/planes/__init__.py +0 -0
  14. {nuagent-0.2.2 → nuagent-0.2.4}/src/nuagent/planes/settings.py +0 -0
  15. {nuagent-0.2.2 → nuagent-0.2.4}/src/nuagent/planes/state.py +0 -0
  16. {nuagent-0.2.2 → nuagent-0.2.4}/src/nuagent/planes/store.py +0 -0
  17. {nuagent-0.2.2 → nuagent-0.2.4}/src/nuagent/presets/__init__.py +0 -0
  18. {nuagent-0.2.2 → nuagent-0.2.4}/src/nuagent/presets/backends/__init__.py +0 -0
  19. {nuagent-0.2.2 → nuagent-0.2.4}/src/nuagent/presets/backends/llm.py +0 -0
  20. {nuagent-0.2.2 → nuagent-0.2.4}/src/nuagent/presets/store/__init__.py +0 -0
  21. {nuagent-0.2.2 → nuagent-0.2.4}/src/nuagent/presets/store/kv.py +0 -0
  22. {nuagent-0.2.2 → nuagent-0.2.4}/src/nuagent/presets/store/mem.py +0 -0
  23. {nuagent-0.2.2 → nuagent-0.2.4}/src/nuagent/prompt/__init__.py +0 -0
  24. {nuagent-0.2.2 → nuagent-0.2.4}/src/nuagent/prompt/catalogue.py +0 -0
  25. {nuagent-0.2.2 → nuagent-0.2.4}/src/nuagent/prompt/section.py +0 -0
  26. {nuagent-0.2.2 → nuagent-0.2.4}/src/nuagent/prompt/surface.py +0 -0
  27. {nuagent-0.2.2 → nuagent-0.2.4}/src/nuagent/protocol/__init__.py +0 -0
  28. {nuagent-0.2.2 → nuagent-0.2.4}/src/nuagent/protocol/observation.py +0 -0
  29. {nuagent-0.2.2 → 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.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.6.5
9
+ Requires-Dist: nucore>=0.7.0
10
10
  Requires-Dist: nuskills>=0.2.0
11
- Requires-Dist: nustd[kv]>=0.6.5
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.5.4; extra == 'space'
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.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.6.5",
16
- "nustd[kv]>=0.6.5",
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.5.4",
32
+ "nuspace>=0.6.3",
33
33
  ]
34
34
 
35
35
  [project.urls]
@@ -21,7 +21,7 @@ if TYPE_CHECKING:
21
21
 
22
22
  __all__ = ["__version__", "extension"]
23
23
 
24
- __version__ = "0.2.2"
24
+ __version__ = "0.2.4"
25
25
 
26
26
 
27
27
  def extension() -> Extension:
@@ -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
- EMPTY, the loop condition is never true, and no turn runs.
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, Space
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(nu.list(Space.kernel.planes_running[engine].runs))
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
 
@@ -192,7 +197,7 @@ def _paged(plane: object) -> str:
192
197
  class Builds(ScalarQuery):
193
198
  """True when ``prog`` builds as cell ``cell_id`` of ``plane_id`` would, and validates. Raises when not.
194
199
 
195
- Construction runs the snippet's module code in this process, offered the
200
+ Construction runs the prog's module code in this process, offered the
196
201
  ``plane`` and ``cell`` a run offers, as the kernel would on the page.
197
202
  What fails raises ``ValueError``, with the construction's diagnostic or
198
203
  the validation's message.
@@ -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).fallback(""),
167
+ program=nu.str(Chat.program.fallback("")),
168
168
  kind=Chat.outcome.kind.fallback(""),
169
169
  observation=nu.str(told["content"]),
170
170
  )
@@ -11,7 +11,7 @@ cells the agent adds are its own source, not shims.
11
11
  from __future__ import annotations
12
12
 
13
13
  import nu
14
- from nuspace import Plane
14
+ from nuspace import PlaneSpec
15
15
 
16
16
 
17
17
  __all__ = ["COMPOSER", "PLANE", "said_prog"]
@@ -31,7 +31,7 @@ def said_prog(at: nu.IntArg) -> nu.Str:
31
31
  return nu.Str(head) + nu.str(at) + ")\n"
32
32
 
33
33
 
34
- PLANE = Plane(
34
+ PLANE = PlaneSpec(
35
35
  "chat",
36
36
  "Chat",
37
37
  icon="messages-square",
@@ -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.is_empty(), self.sid.set(nustd.cc.NewSession()))
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