@lmmslab/harness 0.85.0 → 0.86.0
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.
- package/README.md +1 -1
- package/package.json +1 -1
- package/python/harness/__init__.py +2 -2
- package/python/harness/bench.py +2 -2
- package/python/harness/builtin/benches/README.md +1 -2
- package/python/harness/builtin/configs/default.toml +4 -19
- package/python/harness/builtin/configs/deploy/example-api.toml +1 -1
- package/python/harness/builtin/configs/models/deepseek-flash.toml +1 -1
- package/python/harness/builtin/configs/models/grok-low.toml +1 -1
- package/python/harness/builtin/configs/models/grok-medium.toml +3 -6
- package/python/harness/builtin/environment/README.md +8 -25
- package/python/harness/builtin/prompts/conversation/core.md +6 -5
- package/python/harness/builtin/prompts/core/core.md +147 -203
- package/python/harness/builtin/prompts/core/pack.toml +0 -1
- package/python/harness/builtin/prompts/reflect/core.md +8 -32
- package/python/harness/builtin/prompts/reflect/pack.toml +2 -4
- package/python/harness/builtin/prompts/shared/agent-skills.md +5 -3
- package/python/harness/builtin/prompts/shared/agents.md +20 -10
- package/python/harness/builtin/prompts/shared/checklist.md +13 -17
- package/python/harness/builtin/prompts/shared/environments.md +20 -15
- package/python/harness/builtin/prompts/shared/learning-goal.md +2 -3
- package/python/harness/builtin/prompts/shared/learning.md +73 -23
- package/python/harness/builtin/prompts/shared/mcp.md +11 -6
- package/python/harness/builtin/prompts/shared/reflex-method.md +243 -0
- package/python/harness/builtin/prompts/shared/units.md +138 -0
- package/python/harness/builtin/prompts/shared/web.md +5 -6
- package/python/harness/builtin/skills/agents/__init__.py +18 -3
- package/python/harness/builtin/skills/agents/skill.toml +3 -3
- package/python/harness/builtin/skills/checklist/__init__.py +34 -32
- package/python/harness/builtin/skills/checklist/skill.toml +9 -9
- package/python/harness/builtin/skills/environments/__init__.py +9 -5
- package/python/harness/builtin/skills/environments/skill.toml +1 -1
- package/python/harness/builtin/skills/experience/skill.toml +1 -1
- package/python/harness/builtin/skills/learning/__init__.py +19 -5
- package/python/harness/builtin/skills/mcp/skill.toml +1 -1
- package/python/harness/builtin/skills/memory/__init__.py +4 -1
- package/python/harness/builtin/skills/memory/skill.toml +0 -5
- package/python/harness/builtin/skills/verify/skill.toml +1 -0
- package/python/harness/builtin/skills/web/__init__.py +4 -1
- package/python/harness/builtin/third_party/sources.toml +2 -40
- package/python/harness/cli.py +16 -25
- package/python/harness/config/__init__.py +2 -2
- package/python/harness/config/agent.py +59 -47
- package/python/harness/core/__init__.py +1 -1
- package/python/harness/core/codec.py +4 -4
- package/python/harness/core/contracts.py +1 -1
- package/python/harness/core/media.py +1 -1
- package/python/harness/core/ports.py +2 -2
- package/python/harness/core/procs.py +1 -1
- package/python/harness/core/remote.py +1 -1
- package/python/harness/core/worker.py +19 -13
- package/python/harness/embodiments.py +53 -44
- package/python/harness/extensions.py +22 -0
- package/python/harness/host/__init__.py +1 -1
- package/python/harness/host/http.py +6 -12
- package/python/harness/host/sessions.py +1 -1
- package/python/harness/host/tasks.py +15 -11
- package/python/harness/host/workspaces.py +36 -8
- package/python/harness/packages/__init__.py +5 -5
- package/python/harness/packages/environments.py +30 -18
- package/python/harness/packages/manager.py +1 -1
- package/python/harness/packages/manifest.py +6 -6
- package/python/harness/packages/provision.py +1 -1
- package/python/harness/packages/sources.py +1 -1
- package/python/harness/paths.py +1 -1
- package/python/harness/runtime/decision/loop.py +95 -5
- package/python/harness/runtime/decision/messages.py +128 -2
- package/python/harness/runtime/decision/model.py +4 -5
- package/python/harness/runtime/decision/prompts.py +20 -32
- package/python/harness/runtime/events.py +7 -5
- package/python/harness/runtime/execution/attached.py +3 -3
- package/python/harness/runtime/execution/entries.py +189 -8
- package/python/harness/runtime/execution/kernel.py +26 -1
- package/python/harness/runtime/execution/results.py +2 -3
- package/python/harness/runtime/execution/session.py +417 -32
- package/python/harness/runtime/execution/skills.py +63 -16
- package/python/harness/runtime/learning/active.py +7 -7
- package/python/harness/runtime/learning/learner.py +3 -2
- package/python/harness/runtime/learning/library.py +9 -4
- package/python/harness/runtime/learning/reflect.py +10 -9
- package/python/harness/runtime/reactive/rules.py +4 -4
- package/python/harness/runtime/reactive/tree.py +506 -25
- package/python/harness/runtime/safety/input.py +1 -1
- package/python/harness/runtime/safety/isolation.py +3 -3
- package/python/harness/runtime/safety/shield.py +4 -50
- package/python/harness/runtime/task/delegation.py +5 -5
- package/python/harness/runtime/task/environments.py +10 -0
- package/python/harness/runtime/task/run.py +222 -27
- package/python/harness/runtime/tick.py +24 -1
- package/python/harness/sdk/__init__.py +2 -5
- package/python/harness/services/registry.py +23 -19
- package/python/harness/settings.py +9 -9
- package/python/harness/builtin/environment/constraints.txt +0 -31
- package/python/harness/builtin/prompts/shared/world.md +0 -1
|
@@ -2,10 +2,10 @@ name = "agents"
|
|
|
2
2
|
summary = "Hand parts of the task to sub-agents that work at the same time, each in a workspace of its own, and wait for their results."
|
|
3
3
|
layer = "base"
|
|
4
4
|
mixin = "skills.agents:Agents"
|
|
5
|
-
exports = ["delegate", "wait_agents", "send_agent", "cancel_agent"]
|
|
5
|
+
exports = ["delegate", "wait_agents", "send_agent", "cancel_agent", "review"]
|
|
6
6
|
# Where the conversation's server can give sub-agents workspaces (the app's assistant
|
|
7
|
-
# enables it while the nesting depth setting allows sub-agents);
|
|
8
|
-
# (
|
|
7
|
+
# enables it while the nesting depth setting allows sub-agents); a kind with one body gives
|
|
8
|
+
# them a place where they only look (Kind.place: a view of the agent's episode, every input refused).
|
|
9
9
|
optional = true
|
|
10
10
|
order = 96
|
|
11
11
|
embodiments = ["*"]
|
|
@@ -1,32 +1,34 @@
|
|
|
1
|
-
"""A plan the user sees while the agent works: the task's steps, checked off as the
|
|
2
|
-
programs do them
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
self.
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
1
|
+
"""A plan the user sees while the agent works: the task's steps, checked off as the
|
|
2
|
+
programs do them, kept as Claude Code keeps its task list (one step in progress, a step
|
|
3
|
+
done only when it is fully done). The steps go to the host as they change (core/spans.py
|
|
4
|
+
notes), so the page shows them while a program still runs, and the host shows the model
|
|
5
|
+
its plan again when it has not touched it for a while (runtime/task/run.py)."""
|
|
6
|
+
|
|
7
|
+
from harness.sdk import spans
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class Checklist:
|
|
11
|
+
def plan(self, *steps):
|
|
12
|
+
"""Show the user your plan: the task's steps in order, short and in their language,
|
|
13
|
+
as strings (or one list). Call it again to change the plan; the steps done so far
|
|
14
|
+
stay checked when their text is the same. Returns the number of steps."""
|
|
15
|
+
if len(steps) == 1 and isinstance(steps[0], (list, tuple)):
|
|
16
|
+
steps = tuple(steps[0])
|
|
17
|
+
items = [" ".join(str(step).split()) for step in steps if str(step).strip()]
|
|
18
|
+
if not items:
|
|
19
|
+
raise ValueError("plan() takes the steps of the task")
|
|
20
|
+
done = {entry["step"] for entry in self.__dict__.get("_plan", []) if entry["done"]}
|
|
21
|
+
self._plan = [{"step": step, "done": step in done} for step in items]
|
|
22
|
+
self._send_plan()
|
|
23
|
+
return len(items)
|
|
24
|
+
|
|
25
|
+
def step_done(self, number):
|
|
26
|
+
"""Check off step `number` of your plan (1 for the first)."""
|
|
27
|
+
steps = self.__dict__.get("_plan") or []
|
|
28
|
+
if not 1 <= int(number) <= len(steps):
|
|
29
|
+
raise ValueError(f"the plan has steps 1 to {len(steps)}" if steps else "call plan() first")
|
|
30
|
+
steps[int(number) - 1]["done"] = True
|
|
31
|
+
self._send_plan()
|
|
32
|
+
|
|
33
|
+
def _send_plan(self):
|
|
34
|
+
spans.note("plan", steps=[dict(entry) for entry in self._plan])
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
name = "checklist"
|
|
2
|
-
summary = "
|
|
3
|
-
layer = "base"
|
|
4
|
-
mixin = "skills.checklist:Checklist"
|
|
5
|
-
exports = ["plan", "step_done"]
|
|
6
|
-
# Only where a user watches (the app's assistant enables it).
|
|
7
|
-
optional = true
|
|
8
|
-
order = 90
|
|
9
|
-
embodiments = ["*"]
|
|
1
|
+
name = "checklist"
|
|
2
|
+
summary = "Keep the task's steps as a list the user watches: one step in progress, checked off when fully done."
|
|
3
|
+
layer = "base"
|
|
4
|
+
mixin = "skills.checklist:Checklist"
|
|
5
|
+
exports = ["plan", "step_done"]
|
|
6
|
+
# Only where a user watches (the app's assistant enables it).
|
|
7
|
+
optional = true
|
|
8
|
+
order = 90
|
|
9
|
+
embodiments = ["*"]
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
"""Another environment for one conversation, and sub-agents on request.
|
|
2
2
|
|
|
3
3
|
A conversation works in the environment its user chose. When a step cannot be done there
|
|
4
|
-
(
|
|
4
|
+
(it needs something only another kind of environment has), the program
|
|
5
5
|
asks for another kind with use_environment(kind, why). The session host decides as the
|
|
6
6
|
user's settings say (environments.attach and its rules): it may ask the user, showing
|
|
7
7
|
`why`; where nobody can be asked and the settings require asking, it refuses with the
|
|
8
|
-
reason. Once taken, that environment's calls are name.call(...) (
|
|
9
|
-
project.run_command, browser.read_page) until release_environment(name) or the end of the
|
|
8
|
+
reason. Once taken, that environment's calls are name.call(...) until release_environment(name) or the end of the
|
|
10
9
|
conversation. The host keeps every attachment and its reason in the trace.
|
|
11
10
|
|
|
12
11
|
Sub-agents are off unless the user switched them on: request_agents(why) asks the user to.
|
|
@@ -21,8 +20,8 @@ class Environments:
|
|
|
21
20
|
|
|
22
21
|
def use_environment(self, kind, why, folder=None):
|
|
23
22
|
"""Take another environment into this conversation: `kind` is one the user's
|
|
24
|
-
installation has (
|
|
25
|
-
sentence the user reads when they are asked. A
|
|
23
|
+
installation has (environment_kinds() lists them), `why` one
|
|
24
|
+
sentence the user reads when they are asked. A kind that works in a folder needs `folder`. Returns the
|
|
26
25
|
environment, whose calls are then kind.call(...); raises ValueError with the reason
|
|
27
26
|
when the user or their settings refuse. None when the user paused first."""
|
|
28
27
|
name = str(kind).strip()
|
|
@@ -41,6 +40,11 @@ class Environments:
|
|
|
41
40
|
print(given.get("about") or f"{name} is attached: call it as {name}.NAME(...)")
|
|
42
41
|
return proxy
|
|
43
42
|
|
|
43
|
+
def environment_kinds(self):
|
|
44
|
+
"""The kinds of environment this conversation can take: [{"kind", "about", "folder"}]
|
|
45
|
+
(folder: it works in one folder, which use_environment is given)."""
|
|
46
|
+
return self._ask_conversation("kinds") or []
|
|
47
|
+
|
|
44
48
|
def release_environment(self, kind):
|
|
45
49
|
"""Give an environment taken with use_environment back. True when it was attached."""
|
|
46
50
|
name = str(kind).strip()
|
|
@@ -2,7 +2,7 @@ name = "environments"
|
|
|
2
2
|
summary = "Take another environment into the conversation when the chosen one cannot do a step, and ask for sub-agents."
|
|
3
3
|
layer = "base"
|
|
4
4
|
mixin = "skills.environments:Environments"
|
|
5
|
-
exports = ["use_environment", "release_environment", "request_agents"]
|
|
5
|
+
exports = ["use_environment", "environment_kinds", "release_environment", "request_agents"]
|
|
6
6
|
# Only where a user started the conversation (the session host enables it).
|
|
7
7
|
optional = true
|
|
8
8
|
order = 97
|
|
@@ -3,7 +3,7 @@ summary = "Experience from practice in the library: how each skill did (runs, su
|
|
|
3
3
|
layer = "base"
|
|
4
4
|
mixin = "skills.experience:Experience"
|
|
5
5
|
exports = ["hint", "keep_hint", "experience"]
|
|
6
|
-
#
|
|
6
|
+
# Only a configuration that names it has it.
|
|
7
7
|
optional = true
|
|
8
8
|
order = 75
|
|
9
9
|
embodiments = ["*"]
|
|
@@ -36,6 +36,15 @@ SETUP = "# setup: stages the scene in the practice sandbox"
|
|
|
36
36
|
SETUP_END = "# the test"
|
|
37
37
|
|
|
38
38
|
|
|
39
|
+
|
|
40
|
+
def _kind_says(session, what) -> bool:
|
|
41
|
+
"""What the kind of the session's embodiment says of `what` (embodiments.Kind), True where it names no kind."""
|
|
42
|
+
from harness.embodiments import KINDS
|
|
43
|
+
|
|
44
|
+
kind = KINDS.get(getattr(session, "embodiment", None))
|
|
45
|
+
return True if kind is None else bool(getattr(kind, what))
|
|
46
|
+
|
|
47
|
+
|
|
39
48
|
class LibraryApi:
|
|
40
49
|
"""The library as a program sees it (`library`)."""
|
|
41
50
|
|
|
@@ -72,8 +81,10 @@ class LibraryApi:
|
|
|
72
81
|
|
|
73
82
|
def propose(self, kind, name, text, test=None, summary="", attachments=None, max_seconds=TEST_SECONDS,
|
|
74
83
|
setup=None):
|
|
75
|
-
"""Store a note, memory, skill or rule proposal.
|
|
76
|
-
|
|
84
|
+
"""Store a note, memory, skill or rule proposal. A skill needs a test and stays
|
|
85
|
+
pending until a trusted host verifies its exact revision; a reactive entry (the lines
|
|
86
|
+
that set nodes of the tree) takes none: it is kept on the trials its nodes had when
|
|
87
|
+
they were set in the tree. An optional
|
|
77
88
|
setup is stored with the test for the verifier. Attachments are {filename: bytes}.
|
|
78
89
|
Returns {"ok", "evidence", "version", "queued"} or {"ok": False, "reason"}."""
|
|
79
90
|
if not self._learning:
|
|
@@ -84,12 +95,15 @@ class LibraryApi:
|
|
|
84
95
|
entry = candidate(kind, name, text, test, summary=summary, attachments=attachments)
|
|
85
96
|
except ValueError as error:
|
|
86
97
|
return {"ok": False, "reason": str(error)}
|
|
98
|
+
if kind == "reactive" and (test or setup):
|
|
99
|
+
return {"ok": False, "reason": "a reactive entry takes no test: it is kept on the trials its nodes had "
|
|
100
|
+
"when they were set in the tree (set_reflex test=)"}
|
|
87
101
|
if setup:
|
|
88
|
-
if kind
|
|
102
|
+
if kind != "skill" or not test:
|
|
89
103
|
return {"ok": False, "reason": "setup requires an executable proposal with a test"}
|
|
90
104
|
test = staged(setup, test)
|
|
91
105
|
if kind in ("skill", "reactive"):
|
|
92
|
-
if not test:
|
|
106
|
+
if not test and kind == "skill":
|
|
93
107
|
return {"ok": False, "reason": f"a {kind} entry needs its test"}
|
|
94
108
|
blind = blind_check(entry.text)
|
|
95
109
|
if blind:
|
|
@@ -118,7 +132,7 @@ class LibraryApi:
|
|
|
118
132
|
|
|
119
133
|
def record(self, name, ok, detail=None, kind="skill"):
|
|
120
134
|
"""How a use of an entry went in play (its uses and success rate)."""
|
|
121
|
-
self._ask("record", wait=
|
|
135
|
+
self._ask("record", wait=_kind_says(self._session, "record_waits"), key=entry_key(kind, name), ok=bool(ok),
|
|
122
136
|
detail=None if detail is None else str(detail)[:200])
|
|
123
137
|
|
|
124
138
|
def __repr__(self):
|
|
@@ -6,5 +6,5 @@ exports = ["mcp_tools", "mcp_call"]
|
|
|
6
6
|
needs = ["mcp"]
|
|
7
7
|
optional = true
|
|
8
8
|
order = 150
|
|
9
|
-
#
|
|
9
|
+
# An agent's configuration names MCP servers as services; the app's, its connectors.
|
|
10
10
|
embodiments = ["*"]
|
|
@@ -117,7 +117,10 @@ class Memory:
|
|
|
117
117
|
|
|
118
118
|
def turn_report(session):
|
|
119
119
|
"""After each program: recent notes and the nearest fresh places."""
|
|
120
|
-
|
|
120
|
+
from harness.embodiments import KINDS
|
|
121
|
+
|
|
122
|
+
kind = KINDS.get(getattr(session, "embodiment", None))
|
|
123
|
+
if kind is not None and not kind.memory_report:
|
|
121
124
|
return None
|
|
122
125
|
here, space = session._memory_here()
|
|
123
126
|
try:
|
|
@@ -6,8 +6,3 @@ exports = ["remember", "recall", "forget"]
|
|
|
6
6
|
required = true
|
|
7
7
|
order = 70
|
|
8
8
|
embodiments = ["*"]
|
|
9
|
-
|
|
10
|
-
[interface.robot]
|
|
11
|
-
summary = "Read-only entries of the library's memory (empty without a library)."
|
|
12
|
-
mixin = "skills.memory:ReadOnlyMemory"
|
|
13
|
-
exports = ["recall"]
|
|
@@ -8,6 +8,7 @@ from html.parser import HTMLParser
|
|
|
8
8
|
import re
|
|
9
9
|
import urllib.request
|
|
10
10
|
|
|
11
|
+
from harness import __version__
|
|
11
12
|
from harness.runtime.execution import control
|
|
12
13
|
|
|
13
14
|
# The most characters of a page one call gives, and the most bytes it reads of one.
|
|
@@ -65,7 +66,9 @@ class Web:
|
|
|
65
66
|
url = str(url).strip()
|
|
66
67
|
if not url.startswith(("http://", "https://")):
|
|
67
68
|
raise ValueError("fetch takes an http or https address")
|
|
68
|
-
|
|
69
|
+
# (It says what it is: a client that poses as a browser is turned away by sites that
|
|
70
|
+
# serve their pages to programs.)
|
|
71
|
+
request = urllib.request.Request(url, headers={"User-Agent": f"the-harness/{__version__}",
|
|
69
72
|
"Accept": "text/html,text/plain,application/json,*/*"})
|
|
70
73
|
with urllib.request.urlopen(request, timeout=30) as response:
|
|
71
74
|
kind = (response.headers.get_content_type() or "").lower()
|
|
@@ -1,40 +1,2 @@
|
|
|
1
|
-
# External source coordinates for optional package provisioning
|
|
2
|
-
|
|
3
|
-
[robodojo]
|
|
4
|
-
url = "https://github.com/RoboDojo-Benchmark/RoboDojo.git"
|
|
5
|
-
path = "third_party/RoboDojo"
|
|
6
|
-
revision = "ee67a1468510da7624a089164402359f2afc72c8"
|
|
7
|
-
|
|
8
|
-
[robodojo.nested]
|
|
9
|
-
XPolicyLab = "41f864e82315e99e772c7b93d6e5e7ba6ef586cd"
|
|
10
|
-
"third_party/IsaacLab" = "afca7b09d60d8beb9c1cb28b43066499940b969b"
|
|
11
|
-
"third_party/curobo" = "895c6517243f8cb091c73c018c8167192d39599a"
|
|
12
|
-
assets = "f8862d5c36e95f207195199ec08c250dc9a78ca1"
|
|
13
|
-
|
|
14
|
-
[robolab]
|
|
15
|
-
url = "https://github.com/NVlabs/RoboLab.git"
|
|
16
|
-
path = "third_party/RoboLab"
|
|
17
|
-
revision = "ad45d4f974725d020f82c2b0d77d78533aeba2b3"
|
|
18
|
-
runtime = "third_party/RoboLab/.venv/bin/python"
|
|
19
|
-
|
|
20
|
-
[sam3]
|
|
21
|
-
url = "https://github.com/Max-Fu/sam3.git"
|
|
22
|
-
path = "third_party/sam3"
|
|
23
|
-
revision = "6fe87d64a5beb9084923d7a9e002741178635b09"
|
|
24
|
-
|
|
25
|
-
[robotwin]
|
|
26
|
-
url = "https://github.com/RoboTwin-Platform/RoboTwin.git"
|
|
27
|
-
path = "third_party/RoboTwin"
|
|
28
|
-
revision = "ea8b21121ebb3cd201ff5b3fe361944ac94eda3f"
|
|
29
|
-
|
|
30
|
-
[osomni]
|
|
31
|
-
url = "https://github.com/OS-Copilot/OS-Omni.git"
|
|
32
|
-
path = "third_party/OS-Omni"
|
|
33
|
-
revision = "1b1dc33087d6d21cb3c0f50c3a0b63ff296f711d"
|
|
34
|
-
runtime = "third_party/OS-Omni/.venv/bin/python"
|
|
35
|
-
|
|
36
|
-
[osworld]
|
|
37
|
-
url = "https://github.com/xlang-ai/OSWorld.git"
|
|
38
|
-
path = "third_party/OSWorld"
|
|
39
|
-
revision = "705623ca18e0055dd995fd5a350d6588cff2caf5"
|
|
40
|
-
runtime = "third_party/OSWorld/.venv/bin/python"
|
|
1
|
+
# External source coordinates for optional package provisioning. The core names none: a package
|
|
2
|
+
# brings a third_party/sources.toml with the sources its services and benches use.
|
package/python/harness/cli.py
CHANGED
|
@@ -85,7 +85,7 @@ def _package_arguments(command):
|
|
|
85
85
|
|
|
86
86
|
|
|
87
87
|
def _levels(section: str):
|
|
88
|
-
"""A settings section's level choices (
|
|
88
|
+
"""A settings section's level choices (those a package registers, such as physical and privacy), or
|
|
89
89
|
None where no package registers the section (then the host checks the value)."""
|
|
90
90
|
from .settings import SCHEMA
|
|
91
91
|
|
|
@@ -181,36 +181,27 @@ def think_sets(args) -> list[str]:
|
|
|
181
181
|
def _workspace_argument(command):
|
|
182
182
|
command.add_argument("--workspace", metavar="KIND",
|
|
183
183
|
help="where the agent works: none (no environment: the conversation, the model and "
|
|
184
|
-
"the connected tools only)
|
|
185
|
-
"
|
|
186
|
-
"
|
|
187
|
-
"
|
|
188
|
-
"
|
|
189
|
-
"--folder) the setting session.environment decides: ask (the default) asks in an "
|
|
190
|
-
"interactive terminal and is an error elsewhere, last takes the last choice, a kind "
|
|
191
|
-
"takes that kind")
|
|
184
|
+
"the connected tools only) or a kind the installed packages give (harness packages "
|
|
185
|
+
"lists them; one that works in a folder takes it with --folder). Without it (and "
|
|
186
|
+
"without --folder) the setting session.environment decides: ask (the default) asks "
|
|
187
|
+
"in an interactive terminal and is an error elsewhere, last takes the last choice, a "
|
|
188
|
+
"kind takes that kind")
|
|
192
189
|
if command.prog.split()[-1] == "run":
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
190
|
+
# The packages' own flags for a run (a host module's run_arguments).
|
|
191
|
+
from . import extensions
|
|
192
|
+
|
|
193
|
+
extensions.run_arguments(command)
|
|
196
194
|
|
|
197
195
|
|
|
198
196
|
def workspace_sets(args) -> list[str]:
|
|
199
|
-
"""harness run --workspace
|
|
200
|
-
worker's options)."""
|
|
197
|
+
"""harness run --workspace, and the packages' own flags, as experiment overrides (the
|
|
198
|
+
worker's options; a host module's run_sets says what its flags stand for)."""
|
|
201
199
|
kind = getattr(args, "workspace", None)
|
|
202
200
|
if args.command != "run" or isinstance(getattr(args, "config", None), str):
|
|
203
201
|
return []
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
sets = [f"worker.workspace={json.dumps(kind)}"] if kind else []
|
|
208
|
-
image = getattr(args, "vm_image", None)
|
|
209
|
-
if image:
|
|
210
|
-
if kind != "display":
|
|
211
|
-
raise ValueError("--vm-image goes with --workspace display")
|
|
212
|
-
sets += ['worker.display_backend="vm"', f"worker.vm.vm_image={json.dumps(str(Path(image).resolve()))}"]
|
|
213
|
-
return sets
|
|
202
|
+
from . import extensions
|
|
203
|
+
|
|
204
|
+
return ([f"worker.workspace={json.dumps(kind)}"] if kind else []) + extensions.run_sets(args)
|
|
214
205
|
|
|
215
206
|
|
|
216
207
|
def physical_sets(args) -> list[str]:
|
|
@@ -340,7 +331,7 @@ def parser(packages: bool = True):
|
|
|
340
331
|
"the services and benches they provide",
|
|
341
332
|
epilog="harness install browser; harness install computer@^0.8; harness install "
|
|
342
333
|
"git:github.com/x/y@main#packages/z; harness install ./my-package --link; "
|
|
343
|
-
"harness install --update (all); harness install
|
|
334
|
+
"harness install --update (all); harness install NAME (a service). With no "
|
|
344
335
|
"names in a folder with harness.toml: the project's packages, from its "
|
|
345
336
|
"harness.lock.")
|
|
346
337
|
install.add_argument("names", nargs="*", help="packages (a registry name with an optional range, a git or archive "
|
|
@@ -48,9 +48,9 @@ def deep_merge(base: dict, override: dict) -> dict:
|
|
|
48
48
|
PATH_KEYS = ("prompt", "runtime.task_descriptions", "runtime.library.path", "agent",
|
|
49
49
|
"overrides.agent.prompt", "overrides.agent.runtime.task_descriptions",
|
|
50
50
|
"overrides.agent.runtime.library.path",
|
|
51
|
-
# The agent's table of each embodiment kind
|
|
51
|
+
# The agent's table of each embodiment kind.
|
|
52
52
|
*(f"{prefix}{kind}.runtime.{key}" for prefix in ("", "overrides.agent.") for kind in KINDS
|
|
53
|
-
|
|
53
|
+
for key in ("task_descriptions", "library.path")))
|
|
54
54
|
|
|
55
55
|
|
|
56
56
|
def _absolutize(tree: dict, base: Path) -> dict:
|