ms-tau-sdk 2.0.29.dev85__tar.gz → 2.0.30.dev87__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.
- {ms_tau_sdk-2.0.29.dev85 → ms_tau_sdk-2.0.30.dev87}/CHANGELOG.md +25 -0
- {ms_tau_sdk-2.0.29.dev85 → ms_tau_sdk-2.0.30.dev87}/PKG-INFO +1 -1
- {ms_tau_sdk-2.0.29.dev85 → ms_tau_sdk-2.0.30.dev87}/pyproject.toml +1 -1
- {ms_tau_sdk-2.0.29.dev85 → ms_tau_sdk-2.0.30.dev87}/src/ms_tau_sdk/agent_skills/tau_project_customization/SKILL.md +43 -0
- {ms_tau_sdk-2.0.29.dev85 → ms_tau_sdk-2.0.30.dev87}/src/ms_tau_sdk/backend/models.py +7 -0
- {ms_tau_sdk-2.0.29.dev85 → ms_tau_sdk-2.0.30.dev87}/src/ms_tau_sdk/resources/loader.py +41 -5
- ms_tau_sdk-2.0.30.dev87/src/ms_tau_sdk/resources/selection.py +306 -0
- {ms_tau_sdk-2.0.29.dev85 → ms_tau_sdk-2.0.30.dev87}/src/ms_tau_sdk/runtime/extensions.py +22 -5
- {ms_tau_sdk-2.0.29.dev85 → ms_tau_sdk-2.0.30.dev87}/src/ms_tau_sdk/runtime/manager.py +50 -4
- {ms_tau_sdk-2.0.29.dev85 → ms_tau_sdk-2.0.30.dev87}/src/ms_tau_sdk/runtime/session.py +6 -0
- {ms_tau_sdk-2.0.29.dev85 → ms_tau_sdk-2.0.30.dev87}/.gitignore +0 -0
- {ms_tau_sdk-2.0.29.dev85 → ms_tau_sdk-2.0.30.dev87}/README.md +0 -0
- {ms_tau_sdk-2.0.29.dev85 → ms_tau_sdk-2.0.30.dev87}/packages/tau-board/src/ms_tau_board/__init__.py +0 -0
- {ms_tau_sdk-2.0.29.dev85 → ms_tau_sdk-2.0.30.dev87}/packages/tau-board/src/ms_tau_board/app.py +0 -0
- {ms_tau_sdk-2.0.29.dev85 → ms_tau_sdk-2.0.30.dev87}/packages/tau-board/src/ms_tau_board/cli.py +0 -0
- {ms_tau_sdk-2.0.29.dev85 → ms_tau_sdk-2.0.30.dev87}/packages/tau-board/src/ms_tau_board/config.py +0 -0
- {ms_tau_sdk-2.0.29.dev85 → ms_tau_sdk-2.0.30.dev87}/packages/tau-board/src/ms_tau_board/env_file.py +0 -0
- {ms_tau_sdk-2.0.29.dev85 → ms_tau_sdk-2.0.30.dev87}/packages/tau-board/src/ms_tau_board/logs.py +0 -0
- {ms_tau_sdk-2.0.29.dev85 → ms_tau_sdk-2.0.30.dev87}/packages/tau-board/src/ms_tau_board/proxy.py +0 -0
- {ms_tau_sdk-2.0.29.dev85 → ms_tau_sdk-2.0.30.dev87}/packages/tau-board/src/ms_tau_board/state.py +0 -0
- {ms_tau_sdk-2.0.29.dev85 → ms_tau_sdk-2.0.30.dev87}/packages/tau-board/src/ms_tau_board/static/BULMA-LICENSE.txt +0 -0
- {ms_tau_sdk-2.0.29.dev85 → ms_tau_sdk-2.0.30.dev87}/packages/tau-board/src/ms_tau_board/static/app.js +0 -0
- {ms_tau_sdk-2.0.29.dev85 → ms_tau_sdk-2.0.30.dev87}/packages/tau-board/src/ms_tau_board/static/board.css +0 -0
- {ms_tau_sdk-2.0.29.dev85 → ms_tau_sdk-2.0.30.dev87}/packages/tau-board/src/ms_tau_board/static/bulma.min.css +0 -0
- {ms_tau_sdk-2.0.29.dev85 → ms_tau_sdk-2.0.30.dev87}/packages/tau-board/src/ms_tau_board/static/index.html +0 -0
- {ms_tau_sdk-2.0.29.dev85 → ms_tau_sdk-2.0.30.dev87}/src/ms_tau_sdk/__init__.py +0 -0
- {ms_tau_sdk-2.0.29.dev85 → ms_tau_sdk-2.0.30.dev87}/src/ms_tau_sdk/agent_skills/design-agent-icons-and-motion/SKILL.md +0 -0
- {ms_tau_sdk-2.0.29.dev85 → ms_tau_sdk-2.0.30.dev87}/src/ms_tau_sdk/agent_skills/design-agent-icons-and-motion/agents/openai.yaml +0 -0
- {ms_tau_sdk-2.0.29.dev85 → ms_tau_sdk-2.0.30.dev87}/src/ms_tau_sdk/agent_skills/design-agent-icons-and-motion/references/metatables-example.html +0 -0
- {ms_tau_sdk-2.0.29.dev85 → ms_tau_sdk-2.0.30.dev87}/src/ms_tau_sdk/agent_skills/tau_a2a_runtime_adapter/SKILL.md +0 -0
- {ms_tau_sdk-2.0.29.dev85 → ms_tau_sdk-2.0.30.dev87}/src/ms_tau_sdk/agent_skills/tau_local_development/SKILL.md +0 -0
- {ms_tau_sdk-2.0.29.dev85 → ms_tau_sdk-2.0.30.dev87}/src/ms_tau_sdk/agent_skills/tau_repository_integration/SKILL.md +0 -0
- {ms_tau_sdk-2.0.29.dev85 → ms_tau_sdk-2.0.30.dev87}/src/ms_tau_sdk/agent_skills/tau_security_and_access/SKILL.md +0 -0
- {ms_tau_sdk-2.0.29.dev85 → ms_tau_sdk-2.0.30.dev87}/src/ms_tau_sdk/api/__init__.py +0 -0
- {ms_tau_sdk-2.0.29.dev85 → ms_tau_sdk-2.0.30.dev87}/src/ms_tau_sdk/api/a2a.py +0 -0
- {ms_tau_sdk-2.0.29.dev85 → ms_tau_sdk-2.0.30.dev87}/src/ms_tau_sdk/api/chat.py +0 -0
- {ms_tau_sdk-2.0.29.dev85 → ms_tau_sdk-2.0.30.dev87}/src/ms_tau_sdk/api/conversations.py +0 -0
- {ms_tau_sdk-2.0.29.dev85 → ms_tau_sdk-2.0.30.dev87}/src/ms_tau_sdk/api/dependencies.py +0 -0
- {ms_tau_sdk-2.0.29.dev85 → ms_tau_sdk-2.0.30.dev87}/src/ms_tau_sdk/api/health.py +0 -0
- {ms_tau_sdk-2.0.29.dev85 → ms_tau_sdk-2.0.30.dev87}/src/ms_tau_sdk/api/inspection.py +0 -0
- {ms_tau_sdk-2.0.29.dev85 → ms_tau_sdk-2.0.30.dev87}/src/ms_tau_sdk/api/local_chat.py +0 -0
- {ms_tau_sdk-2.0.29.dev85 → ms_tau_sdk-2.0.30.dev87}/src/ms_tau_sdk/api/models.py +0 -0
- {ms_tau_sdk-2.0.29.dev85 → ms_tau_sdk-2.0.30.dev87}/src/ms_tau_sdk/api/request_identity.py +0 -0
- {ms_tau_sdk-2.0.29.dev85 → ms_tau_sdk-2.0.30.dev87}/src/ms_tau_sdk/api/sessions.py +0 -0
- {ms_tau_sdk-2.0.29.dev85 → ms_tau_sdk-2.0.30.dev87}/src/ms_tau_sdk/app.py +0 -0
- {ms_tau_sdk-2.0.29.dev85 → ms_tau_sdk-2.0.30.dev87}/src/ms_tau_sdk/application.py +0 -0
- {ms_tau_sdk-2.0.29.dev85 → ms_tau_sdk-2.0.30.dev87}/src/ms_tau_sdk/backend/__init__.py +0 -0
- {ms_tau_sdk-2.0.29.dev85 → ms_tau_sdk-2.0.30.dev87}/src/ms_tau_sdk/backend/assertions.py +0 -0
- {ms_tau_sdk-2.0.29.dev85 → ms_tau_sdk-2.0.30.dev87}/src/ms_tau_sdk/backend/auth.py +0 -0
- {ms_tau_sdk-2.0.29.dev85 → ms_tau_sdk-2.0.30.dev87}/src/ms_tau_sdk/backend/client.py +0 -0
- {ms_tau_sdk-2.0.29.dev85 → ms_tau_sdk-2.0.30.dev87}/src/ms_tau_sdk/backend/local.py +0 -0
- {ms_tau_sdk-2.0.29.dev85 → ms_tau_sdk-2.0.30.dev87}/src/ms_tau_sdk/backend/mcp.py +0 -0
- {ms_tau_sdk-2.0.29.dev85 → ms_tau_sdk-2.0.30.dev87}/src/ms_tau_sdk/backend/routes.py +0 -0
- {ms_tau_sdk-2.0.29.dev85 → ms_tau_sdk-2.0.30.dev87}/src/ms_tau_sdk/backend/team_memberships.py +0 -0
- {ms_tau_sdk-2.0.29.dev85 → ms_tau_sdk-2.0.30.dev87}/src/ms_tau_sdk/cli.py +0 -0
- {ms_tau_sdk-2.0.29.dev85 → ms_tau_sdk-2.0.30.dev87}/src/ms_tau_sdk/errors.py +0 -0
- {ms_tau_sdk-2.0.29.dev85 → ms_tau_sdk-2.0.30.dev87}/src/ms_tau_sdk/logging.py +0 -0
- {ms_tau_sdk-2.0.29.dev85 → ms_tau_sdk-2.0.30.dev87}/src/ms_tau_sdk/protocols/__init__.py +0 -0
- {ms_tau_sdk-2.0.29.dev85 → ms_tau_sdk-2.0.30.dev87}/src/ms_tau_sdk/protocols/a2a_failure.py +0 -0
- {ms_tau_sdk-2.0.29.dev85 → ms_tau_sdk-2.0.30.dev87}/src/ms_tau_sdk/protocols/a2a_message.py +0 -0
- {ms_tau_sdk-2.0.29.dev85 → ms_tau_sdk-2.0.30.dev87}/src/ms_tau_sdk/protocols/a2a_roles.py +0 -0
- {ms_tau_sdk-2.0.29.dev85 → ms_tau_sdk-2.0.30.dev87}/src/ms_tau_sdk/protocols/assistant_ui.py +0 -0
- {ms_tau_sdk-2.0.29.dev85 → ms_tau_sdk-2.0.30.dev87}/src/ms_tau_sdk/protocols/caller_context.py +0 -0
- {ms_tau_sdk-2.0.29.dev85 → ms_tau_sdk-2.0.30.dev87}/src/ms_tau_sdk/protocols/chat_history.py +0 -0
- {ms_tau_sdk-2.0.29.dev85 → ms_tau_sdk-2.0.30.dev87}/src/ms_tau_sdk/protocols/strict_json.py +0 -0
- {ms_tau_sdk-2.0.29.dev85 → ms_tau_sdk-2.0.30.dev87}/src/ms_tau_sdk/providers/__init__.py +0 -0
- {ms_tau_sdk-2.0.29.dev85 → ms_tau_sdk-2.0.30.dev87}/src/ms_tau_sdk/providers/definitions.py +0 -0
- {ms_tau_sdk-2.0.29.dev85 → ms_tau_sdk-2.0.30.dev87}/src/ms_tau_sdk/providers/factory.py +0 -0
- {ms_tau_sdk-2.0.29.dev85 → ms_tau_sdk-2.0.30.dev87}/src/ms_tau_sdk/providers/tau_compat.py +0 -0
- {ms_tau_sdk-2.0.29.dev85 → ms_tau_sdk-2.0.30.dev87}/src/ms_tau_sdk/resources/SYSTEM.md +0 -0
- {ms_tau_sdk-2.0.29.dev85 → ms_tau_sdk-2.0.30.dev87}/src/ms_tau_sdk/resources/__init__.py +0 -0
- {ms_tau_sdk-2.0.29.dev85 → ms_tau_sdk-2.0.30.dev87}/src/ms_tau_sdk/resources/context_compat.py +0 -0
- {ms_tau_sdk-2.0.29.dev85 → ms_tau_sdk-2.0.30.dev87}/src/ms_tau_sdk/resources/prompts/review-code-repository.md +0 -0
- {ms_tau_sdk-2.0.29.dev85 → ms_tau_sdk-2.0.30.dev87}/src/ms_tau_sdk/runtime/__init__.py +0 -0
- {ms_tau_sdk-2.0.29.dev85 → ms_tau_sdk-2.0.30.dev87}/src/ms_tau_sdk/runtime/deployment_health.py +0 -0
- {ms_tau_sdk-2.0.29.dev85 → ms_tau_sdk-2.0.30.dev87}/src/ms_tau_sdk/runtime/events.py +0 -0
- {ms_tau_sdk-2.0.29.dev85 → ms_tau_sdk-2.0.30.dev87}/src/ms_tau_sdk/runtime/failures.py +0 -0
- {ms_tau_sdk-2.0.29.dev85 → ms_tau_sdk-2.0.30.dev87}/src/ms_tau_sdk/runtime/live_turns.py +0 -0
- {ms_tau_sdk-2.0.29.dev85 → ms_tau_sdk-2.0.30.dev87}/src/ms_tau_sdk/runtime/observability.py +0 -0
- {ms_tau_sdk-2.0.29.dev85 → ms_tau_sdk-2.0.30.dev87}/src/ms_tau_sdk/runtime/provenance.py +0 -0
- {ms_tau_sdk-2.0.29.dev85 → ms_tau_sdk-2.0.30.dev87}/src/ms_tau_sdk/runtime/requester.py +0 -0
- {ms_tau_sdk-2.0.29.dev85 → ms_tau_sdk-2.0.30.dev87}/src/ms_tau_sdk/runtime/snapshots.py +0 -0
- {ms_tau_sdk-2.0.29.dev85 → ms_tau_sdk-2.0.30.dev87}/src/ms_tau_sdk/runtime/task_context.py +0 -0
- {ms_tau_sdk-2.0.29.dev85 → ms_tau_sdk-2.0.30.dev87}/src/ms_tau_sdk/sessions/__init__.py +0 -0
- {ms_tau_sdk-2.0.29.dev85 → ms_tau_sdk-2.0.30.dev87}/src/ms_tau_sdk/sessions/storage.py +0 -0
- {ms_tau_sdk-2.0.29.dev85 → ms_tau_sdk-2.0.30.dev87}/src/ms_tau_sdk/settings.py +0 -0
- {ms_tau_sdk-2.0.29.dev85 → ms_tau_sdk-2.0.30.dev87}/src/ms_tau_sdk/skills.py +0 -0
- {ms_tau_sdk-2.0.29.dev85 → ms_tau_sdk-2.0.30.dev87}/src/ms_tau_sdk/tools/__init__.py +0 -0
- {ms_tau_sdk-2.0.29.dev85 → ms_tau_sdk-2.0.30.dev87}/src/ms_tau_sdk/tools/mainsequence_mcp.py +0 -0
- {ms_tau_sdk-2.0.29.dev85 → ms_tau_sdk-2.0.30.dev87}/src/ms_tau_sdk/tools/mcp_applications.py +0 -0
- {ms_tau_sdk-2.0.29.dev85 → ms_tau_sdk-2.0.30.dev87}/src/ms_tau_sdk/tools/mcp_connection.py +0 -0
- {ms_tau_sdk-2.0.29.dev85 → ms_tau_sdk-2.0.30.dev87}/src/ms_tau_sdk/tools/skill_read.py +0 -0
- {ms_tau_sdk-2.0.29.dev85 → ms_tau_sdk-2.0.30.dev87}/src/ms_tau_sdk/tools/task_control.py +0 -0
|
@@ -1,5 +1,30 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## Unreleased
|
|
4
|
+
|
|
5
|
+
- **Several Agents from one repository each load their own prompt, skills and tools.** An Agent's
|
|
6
|
+
workflow declaration can select, in `harness_agent.spec.runtime_resources`, the system prompt
|
|
7
|
+
file, the skills and the extensions its sessions load from `.tau/`. The platform returns the
|
|
8
|
+
selection at session bootstrap, and the runtime applies it on load and reload. An omitted field
|
|
9
|
+
loads every resource of its kind, an empty list loads none, and `.tau/APPEND_SYSTEM.md`,
|
|
10
|
+
`.tau/AGENTS.md` and `.tau/prompts/` stay shared. The runtime validates the selection strictly
|
|
11
|
+
and fails the session load, before any model call, when a selected file, skill or extension is
|
|
12
|
+
missing, is a symbolic link or does not load; selected extensions count as project extensions
|
|
13
|
+
in every catalog check. The bootstrap request now lists
|
|
14
|
+
`supported_runtime_resources_schema_versions: [1]`, and the load log and inspection payload
|
|
15
|
+
report the selection. A selection limits what the model is given, not what an Agent may do:
|
|
16
|
+
each Agent's grants still decide that. Without a selection nothing changes. It needs the
|
|
17
|
+
matching platform change. See
|
|
18
|
+
[several Agents from one repository](docs/guides/multiple-agents-one-repository.md) and
|
|
19
|
+
[ADR 0026](docs/adrs/0026-per-agent-runtime-resources-from-the-workflow-declaration.md).
|
|
20
|
+
|
|
21
|
+
- **The Security and access guide sets no rule on what caller context holds.** It no longer says
|
|
22
|
+
to refer to a person by an opaque id: what the keys and values mean, including whether one
|
|
23
|
+
refers to a person, is up to whoever designs the application. Caller context stays public, so
|
|
24
|
+
nothing secret or used as proof goes in it, and the
|
|
25
|
+
[trust rule](docs/reference/security-model.md#caller-context) is unchanged. SDK behavior is
|
|
26
|
+
unchanged.
|
|
27
|
+
|
|
3
28
|
## 2.0.29 — 2026-11-07
|
|
4
29
|
|
|
5
30
|
- **Agents receive and pass on caller context (W3C `baggage` and `traceparent`).** A service user,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: ms-tau-sdk
|
|
3
|
-
Version: 2.0.
|
|
3
|
+
Version: 2.0.30.dev87
|
|
4
4
|
Summary: Workspace-bound Tau application primitives for Main Sequence projects
|
|
5
5
|
Project-URL: Changelog, https://github.com/mainsequence-sdk/ms-tau-sdk/blob/development/CHANGELOG.md
|
|
6
6
|
Project-URL: Documentation, https://github.com/mainsequence-sdk/ms-tau-sdk/tree/development/docs
|
|
@@ -49,6 +49,49 @@ because Tau names a skill by its folder. A group folder prefixes the published `
|
|
|
49
49
|
a pack that was published from its own folder moves its skills directly into `.tau/skills` to keep
|
|
50
50
|
its URIs. Development skills stay in `.agents/skills` and are never published.
|
|
51
51
|
|
|
52
|
+
## Several Agents from one repository
|
|
53
|
+
|
|
54
|
+
Each `harness_agent` resource of a branch deploys its own Agent from the same code and image. By
|
|
55
|
+
default every one of them loads the whole `.tau/`. To give an Agent its own prompt, skills and
|
|
56
|
+
tools, add `runtime_resources` to its `harness_agent.spec` in the workflow file:
|
|
57
|
+
|
|
58
|
+
```yaml
|
|
59
|
+
- key: research
|
|
60
|
+
kind: harness_agent
|
|
61
|
+
spec:
|
|
62
|
+
# The Agent's other settings.
|
|
63
|
+
runtime_resources:
|
|
64
|
+
system_prompt: .tau/system_prompts/research.md
|
|
65
|
+
skills: [market-research]
|
|
66
|
+
extensions: [research_tools]
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
- `system_prompt` is a `.md` file under `.tau/`, outside `skills/`, `prompts/` and
|
|
70
|
+
`extensions/`. It replaces `.tau/SYSTEM.md` for that Agent. Keep a folder such as
|
|
71
|
+
`.tau/system_prompts/` for these files.
|
|
72
|
+
- `skills` lists skill folder names, wherever they sit under `.tau/skills/`.
|
|
73
|
+
- `extensions` lists entries directly under `.tau/extensions/`: `name.py` files or extension
|
|
74
|
+
folders.
|
|
75
|
+
- An omitted field loads every resource of its kind. An empty list loads none.
|
|
76
|
+
- `.tau/APPEND_SYSTEM.md`, `.tau/AGENTS.md` and `.tau/prompts/` stay shared by every Agent. Put
|
|
77
|
+
only instructions every Agent should follow there.
|
|
78
|
+
|
|
79
|
+
The unit of tool selection is the extension. Tau loads an extension's tools, hooks, commands and
|
|
80
|
+
prompt sections together and cannot drop single tools. So split tools into extensions by the
|
|
81
|
+
Agents that use them: when one Agent must not see `place_order`, move it out of the extension that
|
|
82
|
+
holds the tools that Agent does get. Keep the business logic in the application package and the
|
|
83
|
+
extensions as thin adapters, so splitting them moves no logic.
|
|
84
|
+
|
|
85
|
+
A wrong selection fails the session load before any model call: a missing prompt, skill or
|
|
86
|
+
extension, a symbolic link, a non-UTF-8 prompt, or an extension that fails to import. After
|
|
87
|
+
changing a selection, check the `runtime.project_resources.load.completed` log of a session of
|
|
88
|
+
that Agent: its `runtime_resources` field lists what was selected.
|
|
89
|
+
|
|
90
|
+
A selection is not an access boundary. Every Agent of the repository runs the same code, and an
|
|
91
|
+
unselected extension stays installed. When two Agents must differ in what they may touch, give
|
|
92
|
+
each its own grants. Local `ms-tau` has no platform bootstrap and always loads the whole `.tau/`.
|
|
93
|
+
See `docs/guides/multiple-agents-one-repository.md` in the SDK repository and ADR 0026.
|
|
94
|
+
|
|
52
95
|
## Agent artwork
|
|
53
96
|
|
|
54
97
|
For optional icon composition and motion guidance, use `design-agent-icons-and-motion` from
|
|
@@ -341,6 +341,9 @@ class TauRuntimeBootstrapRequest(BackendRequestModel):
|
|
|
341
341
|
history_after_sequence: int | None = Field(default=None, ge=0)
|
|
342
342
|
supported_snapshot_schema_versions: list[int] = Field(default_factory=lambda: [2])
|
|
343
343
|
supported_provider_control_schema_versions: list[int] = Field(default_factory=lambda: [1])
|
|
344
|
+
# A runtime that lists a version applies the Agent's `runtime_resources` (ADR 0026). The
|
|
345
|
+
# platform refuses to bootstrap an Agent that declares a selection for any other runtime.
|
|
346
|
+
supported_runtime_resources_schema_versions: list[int] = Field(default_factory=lambda: [1])
|
|
344
347
|
tau_runtime_version: str
|
|
345
348
|
|
|
346
349
|
|
|
@@ -396,6 +399,10 @@ class TauRuntimeBootstrap(BackendModel):
|
|
|
396
399
|
# Declaring an application registers its MCP; the platform resolves it in the Agent's
|
|
397
400
|
# Environment, so the workflow file and the runtime never carry its UID or URL.
|
|
398
401
|
mcp_applications: list[MCPApplication] = Field(default_factory=list)
|
|
402
|
+
# The Agent's selection of `.tau` resources, resolved by the platform from its workflow
|
|
403
|
+
# declaration (ADR 0026). It stays raw here and is validated strictly while the session loads,
|
|
404
|
+
# so a malformed selection fails the load and releases the lease.
|
|
405
|
+
runtime_resources: Any = None
|
|
399
406
|
|
|
400
407
|
|
|
401
408
|
class TauResumeSnapshotUploadRequest(BackendRequestModel):
|
|
@@ -23,13 +23,28 @@ class _SkillsDir(Path):
|
|
|
23
23
|
Tau reads the folders directly in a skills directory, so the skills in a folder without a
|
|
24
24
|
`SKILL.md`, such as `.tau/skills/<group>/<skill>/SKILL.md`, were skipped. Listing them
|
|
25
25
|
beside the direct entries lets Tau read, index, reload and serve them like any other skill.
|
|
26
|
+
|
|
27
|
+
With an Agent's skill selection (ADR 0026, section 3) the listing holds only the selected
|
|
28
|
+
skill folders, whichever group folder holds them.
|
|
26
29
|
"""
|
|
27
30
|
|
|
31
|
+
selected: ClassVar[frozenset[str] | None] = None
|
|
32
|
+
|
|
28
33
|
def iterdir(self) -> Generator[Self]:
|
|
29
34
|
for entry in sorted(Path(self).iterdir()):
|
|
30
|
-
|
|
35
|
+
if self._admits(entry):
|
|
36
|
+
yield self.with_segments(entry)
|
|
31
37
|
if _is_group(entry):
|
|
32
|
-
yield from map(self.with_segments, _skill_folders(entry))
|
|
38
|
+
yield from map(self.with_segments, filter(self._admits, _skill_folders(entry)))
|
|
39
|
+
|
|
40
|
+
def _admits(self, entry: Path) -> bool:
|
|
41
|
+
if self.selected is None:
|
|
42
|
+
return True
|
|
43
|
+
return entry.name in self.selected and _is_skill(entry)
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
def _is_skill(folder: Path) -> bool:
|
|
47
|
+
return folder.is_dir() and (folder / "SKILL.md").exists()
|
|
33
48
|
|
|
34
49
|
|
|
35
50
|
def _is_group(folder: Path) -> bool:
|
|
@@ -59,12 +74,14 @@ class _RepositoryPaths(TauPaths):
|
|
|
59
74
|
|
|
60
75
|
# Read by the project instruction filter of `context_compat`.
|
|
61
76
|
reads_development_resources: ClassVar[bool] = True
|
|
77
|
+
# Replaced by a class that lists only an Agent's selected skills (ADR 0026, section 3).
|
|
78
|
+
skills_dir_class: ClassVar[type[_SkillsDir]] = _SkillsDir
|
|
62
79
|
|
|
63
80
|
def project_skills_dir(self, cwd: Path) -> Path:
|
|
64
|
-
return
|
|
81
|
+
return self.skills_dir_class(super().project_skills_dir(cwd))
|
|
65
82
|
|
|
66
83
|
def project_agents_skills_dir(self, cwd: Path) -> Path:
|
|
67
|
-
return
|
|
84
|
+
return self.skills_dir_class(super().project_agents_skills_dir(cwd))
|
|
68
85
|
|
|
69
86
|
|
|
70
87
|
class _TauOnlyPaths(_RepositoryPaths):
|
|
@@ -91,11 +108,23 @@ class _TauOnlyPaths(_RepositoryPaths):
|
|
|
91
108
|
return self.project_prompts_dir(cwd)
|
|
92
109
|
|
|
93
110
|
|
|
111
|
+
def _with_skill_selection(
|
|
112
|
+
paths_class: type[_RepositoryPaths], skills: frozenset[str]
|
|
113
|
+
) -> type[_RepositoryPaths]:
|
|
114
|
+
skills_dir_class = type("_SelectedSkillsDir", (_SkillsDir,), {"selected": skills})
|
|
115
|
+
return type(
|
|
116
|
+
paths_class.__name__,
|
|
117
|
+
(paths_class,),
|
|
118
|
+
{"__slots__": (), "skills_dir_class": skills_dir_class},
|
|
119
|
+
)
|
|
120
|
+
|
|
121
|
+
|
|
94
122
|
def tau_resource_paths(
|
|
95
123
|
cwd: Path,
|
|
96
124
|
*,
|
|
97
125
|
state_home: Path,
|
|
98
126
|
include_development_resources: bool = False,
|
|
127
|
+
skills: frozenset[str] | None = None,
|
|
99
128
|
) -> TauResourcePaths:
|
|
100
129
|
"""Return SDK defaults plus Tau-native project resource discovery.
|
|
101
130
|
|
|
@@ -109,9 +138,16 @@ def tau_resource_paths(
|
|
|
109
138
|
also admits the repository's `AGENTS.md` files and `.agents/`. The version-locked
|
|
110
139
|
filter that keeps Tau's `AGENTS.md` discovery to `.tau` is installed here, before
|
|
111
140
|
the session that uses these paths loads; it fails on an unreviewed Tau version.
|
|
141
|
+
|
|
142
|
+
`skills`, an Agent's skill selection (ADR 0026), limits every project skill directory
|
|
143
|
+
the scope reads to the named skill folders. `None` lists every project skill.
|
|
112
144
|
"""
|
|
113
145
|
install_project_context_filter()
|
|
114
|
-
paths_class
|
|
146
|
+
paths_class: type[_RepositoryPaths] = (
|
|
147
|
+
_RepositoryPaths if include_development_resources else _TauOnlyPaths
|
|
148
|
+
)
|
|
149
|
+
if skills is not None:
|
|
150
|
+
paths_class = _with_skill_selection(paths_class, skills)
|
|
115
151
|
return TauResourcePaths(
|
|
116
152
|
root=resource_root(),
|
|
117
153
|
cwd=cwd,
|
|
@@ -0,0 +1,306 @@
|
|
|
1
|
+
"""The per-Agent selection of `.tau` resources from session bootstrap (ADR 0026).
|
|
2
|
+
|
|
3
|
+
A repository may deploy several Agents from one branch. The platform resolves each Agent's
|
|
4
|
+
`harness_agent.spec.runtime_resources` and returns it at session bootstrap. This module reads that
|
|
5
|
+
selection strictly, resolves it inside the workspace before Tau runs any project code, and checks
|
|
6
|
+
that the session Tau composed holds exactly what was selected, on load and after every reload.
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
from __future__ import annotations
|
|
10
|
+
|
|
11
|
+
from collections.abc import Iterable, Mapping
|
|
12
|
+
from dataclasses import dataclass
|
|
13
|
+
from pathlib import Path, PurePosixPath
|
|
14
|
+
from typing import Any
|
|
15
|
+
|
|
16
|
+
from pydantic import BaseModel, ConfigDict, ValidationError, field_validator
|
|
17
|
+
from tau_agent.types import JSONValue
|
|
18
|
+
from tau_coding import CodingSession
|
|
19
|
+
from tau_coding.extensions import discover_extensions
|
|
20
|
+
from tau_coding.resources import TauResourcePaths
|
|
21
|
+
|
|
22
|
+
from ms_tau_sdk.errors import ConfigurationError
|
|
23
|
+
|
|
24
|
+
RUNTIME_RESOURCES_SCHEMA_VERSION = 1
|
|
25
|
+
# `.tau/` folders whose files are other resource kinds, never an Agent's system prompt.
|
|
26
|
+
_RESERVED_TAU_FOLDERS = frozenset({"skills", "prompts", "extensions"})
|
|
27
|
+
_EXTENSION_ROOT = PurePosixPath(".tau/extensions")
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
def _single_segment(value: str, *, kind: str) -> str:
|
|
31
|
+
if not value or value in {".", ".."} or "/" in value or "\\" in value or "\x00" in value:
|
|
32
|
+
raise ValueError(f"{kind} {value!r} must be one folder or file name")
|
|
33
|
+
return value
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
def _unique(values: tuple[str, ...], *, kind: str) -> tuple[str, ...]:
|
|
37
|
+
duplicates = sorted({value for value in values if values.count(value) > 1})
|
|
38
|
+
if duplicates:
|
|
39
|
+
raise ValueError(f"{kind} are listed more than once: {', '.join(duplicates)}")
|
|
40
|
+
return values
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
class RuntimeResourceSelection(BaseModel):
|
|
44
|
+
"""The resources one Agent's sessions load from `.tau/`; an omitted field selects all."""
|
|
45
|
+
|
|
46
|
+
model_config = ConfigDict(extra="forbid", frozen=True, strict=True)
|
|
47
|
+
|
|
48
|
+
system_prompt: str | None = None
|
|
49
|
+
skills: tuple[str, ...] | None = None
|
|
50
|
+
extensions: tuple[str, ...] | None = None
|
|
51
|
+
|
|
52
|
+
@field_validator("skills", "extensions", mode="before")
|
|
53
|
+
@classmethod
|
|
54
|
+
def _list_to_tuple(cls, value: object) -> object:
|
|
55
|
+
# JSON carries lists; strict mode would otherwise reject them for a tuple.
|
|
56
|
+
return tuple(value) if isinstance(value, list) else value
|
|
57
|
+
|
|
58
|
+
@field_validator("system_prompt")
|
|
59
|
+
@classmethod
|
|
60
|
+
def _validate_system_prompt(cls, value: str | None) -> str | None:
|
|
61
|
+
if value is None:
|
|
62
|
+
return None
|
|
63
|
+
path = PurePosixPath(value)
|
|
64
|
+
if (
|
|
65
|
+
not value
|
|
66
|
+
or "\\" in value
|
|
67
|
+
or "\x00" in value
|
|
68
|
+
or path.is_absolute()
|
|
69
|
+
or any(part in {".", ".."} for part in value.split("/"))
|
|
70
|
+
or path.as_posix() != value
|
|
71
|
+
):
|
|
72
|
+
raise ValueError(f"system_prompt {value!r} must be a plain workspace-relative path")
|
|
73
|
+
if len(path.parts) < 2 or path.parts[0] != ".tau":
|
|
74
|
+
raise ValueError(f"system_prompt {value!r} must be a file under .tau/")
|
|
75
|
+
if len(path.parts) > 2 and path.parts[1] in _RESERVED_TAU_FOLDERS:
|
|
76
|
+
raise ValueError(
|
|
77
|
+
f"system_prompt {value!r} must be outside .tau/skills, .tau/prompts "
|
|
78
|
+
"and .tau/extensions"
|
|
79
|
+
)
|
|
80
|
+
if path.suffix.lower() != ".md":
|
|
81
|
+
raise ValueError(f"system_prompt {value!r} must be a Markdown (.md) file")
|
|
82
|
+
return value
|
|
83
|
+
|
|
84
|
+
@field_validator("skills")
|
|
85
|
+
@classmethod
|
|
86
|
+
def _validate_skills(cls, value: tuple[str, ...] | None) -> tuple[str, ...] | None:
|
|
87
|
+
if value is None:
|
|
88
|
+
return None
|
|
89
|
+
for name in value:
|
|
90
|
+
_single_segment(name, kind="Skill name")
|
|
91
|
+
return _unique(value, kind="Skills")
|
|
92
|
+
|
|
93
|
+
@field_validator("extensions")
|
|
94
|
+
@classmethod
|
|
95
|
+
def _validate_extensions(cls, value: tuple[str, ...] | None) -> tuple[str, ...] | None:
|
|
96
|
+
if value is None:
|
|
97
|
+
return None
|
|
98
|
+
for entry in value:
|
|
99
|
+
_single_segment(entry, kind="Extension entry")
|
|
100
|
+
if entry.startswith(("_", ".")):
|
|
101
|
+
# Tau never discovers these as project extensions.
|
|
102
|
+
raise ValueError(f"Extension entry {entry!r} must not start with '_' or '.'")
|
|
103
|
+
return _unique(value, kind="Extensions")
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
def parse_runtime_resources(raw: object) -> RuntimeResourceSelection | None:
|
|
107
|
+
"""Read the bootstrap's `runtime_resources`; absent or null keeps the whole `.tau/`."""
|
|
108
|
+
if raw is None:
|
|
109
|
+
return None
|
|
110
|
+
if not isinstance(raw, Mapping):
|
|
111
|
+
raise ConfigurationError("Session bootstrap runtime_resources must be an object")
|
|
112
|
+
fields: dict[str, Any] = {key: value for key, value in raw.items() if value is not None}
|
|
113
|
+
try:
|
|
114
|
+
return RuntimeResourceSelection.model_validate(fields)
|
|
115
|
+
except ValidationError as error:
|
|
116
|
+
problems = "; ".join(
|
|
117
|
+
f"{'.'.join(str(part) for part in issue['loc']) or 'runtime_resources'}: {issue['msg']}"
|
|
118
|
+
for issue in error.errors(include_url=False, include_input=False)
|
|
119
|
+
)
|
|
120
|
+
raise ConfigurationError(
|
|
121
|
+
f"Session bootstrap runtime_resources is invalid: {problems}"
|
|
122
|
+
) from None
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
@dataclass(frozen=True, slots=True)
|
|
126
|
+
class ResolvedRuntimeResources:
|
|
127
|
+
"""A selection resolved inside one workspace, ready for Tau's session configuration."""
|
|
128
|
+
|
|
129
|
+
selection: RuntimeResourceSelection
|
|
130
|
+
cwd: Path
|
|
131
|
+
custom_system_prompt: str | None
|
|
132
|
+
extension_paths: tuple[Path, ...]
|
|
133
|
+
|
|
134
|
+
@property
|
|
135
|
+
def skill_names(self) -> frozenset[str] | None:
|
|
136
|
+
skills = self.selection.skills
|
|
137
|
+
return None if skills is None else frozenset(skills)
|
|
138
|
+
|
|
139
|
+
@property
|
|
140
|
+
def skills_enabled(self) -> bool:
|
|
141
|
+
return self.selection.skills != ()
|
|
142
|
+
|
|
143
|
+
@property
|
|
144
|
+
def project_extensions_enabled(self) -> bool:
|
|
145
|
+
return self.selection.extensions is None
|
|
146
|
+
|
|
147
|
+
def summary(self) -> dict[str, JSONValue]:
|
|
148
|
+
"""The selection for logs and inspection, with paths relative to the workspace."""
|
|
149
|
+
skills: list[JSONValue] | None = (
|
|
150
|
+
None if self.selection.skills is None else [*self.selection.skills]
|
|
151
|
+
)
|
|
152
|
+
extensions: list[JSONValue] | None = (
|
|
153
|
+
None
|
|
154
|
+
if self.selection.extensions is None
|
|
155
|
+
else [(_EXTENSION_ROOT / entry).as_posix() for entry in self.selection.extensions]
|
|
156
|
+
)
|
|
157
|
+
return {
|
|
158
|
+
"systemPrompt": self.selection.system_prompt,
|
|
159
|
+
"skills": skills,
|
|
160
|
+
"extensions": extensions,
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
def verify(self, session: CodingSession) -> None:
|
|
164
|
+
"""Fail unless Tau composed exactly the selected skills and extensions."""
|
|
165
|
+
selected_skills = self.skill_names
|
|
166
|
+
if selected_skills is not None:
|
|
167
|
+
loaded = {skill.name for skill in session.skills}
|
|
168
|
+
missing = selected_skills - loaded
|
|
169
|
+
if missing:
|
|
170
|
+
raise ConfigurationError(
|
|
171
|
+
"Selected skills did not load: " + ", ".join(sorted(missing))
|
|
172
|
+
)
|
|
173
|
+
unexpected = loaded - selected_skills
|
|
174
|
+
if unexpected:
|
|
175
|
+
raise ConfigurationError(
|
|
176
|
+
"Skills outside the selection loaded: " + ", ".join(sorted(unexpected))
|
|
177
|
+
)
|
|
178
|
+
if self.selection.extensions is None:
|
|
179
|
+
return
|
|
180
|
+
entries = dict(zip(self.selection.extensions, self.extension_paths, strict=True))
|
|
181
|
+
loaded_paths = [
|
|
182
|
+
Path(item.path).resolve()
|
|
183
|
+
for item in session.extension_runtime.extension_metadata
|
|
184
|
+
if item.source in {"explicit", "project"} and item.path is not None
|
|
185
|
+
]
|
|
186
|
+
missing_entries = [
|
|
187
|
+
name
|
|
188
|
+
for name, entry in entries.items()
|
|
189
|
+
if not any(_within(path, entry) for path in loaded_paths)
|
|
190
|
+
]
|
|
191
|
+
if missing_entries:
|
|
192
|
+
raise ConfigurationError(
|
|
193
|
+
"Selected extensions did not load: " + ", ".join(sorted(missing_entries))
|
|
194
|
+
)
|
|
195
|
+
# A folder may hold several extension entries; one that failed must not go unnoticed.
|
|
196
|
+
failed_entries = {
|
|
197
|
+
name
|
|
198
|
+
for diagnostic in session.extension_runtime.diagnostics
|
|
199
|
+
if diagnostic.severity == "error" and diagnostic.path is not None
|
|
200
|
+
for name, entry in entries.items()
|
|
201
|
+
if _within(Path(diagnostic.path).resolve(), entry)
|
|
202
|
+
}
|
|
203
|
+
if failed_entries:
|
|
204
|
+
raise ConfigurationError(
|
|
205
|
+
"Selected extensions failed to load: " + ", ".join(sorted(failed_entries))
|
|
206
|
+
)
|
|
207
|
+
if any(
|
|
208
|
+
not any(_within(path, entry) for entry in entries.values()) for path in loaded_paths
|
|
209
|
+
):
|
|
210
|
+
raise ConfigurationError("Extensions outside the selection loaded")
|
|
211
|
+
|
|
212
|
+
|
|
213
|
+
def _within(path: Path, entry: Path) -> bool:
|
|
214
|
+
return path == entry or entry in path.parents
|
|
215
|
+
|
|
216
|
+
|
|
217
|
+
def _no_symbolic_links(path: Path, *, below: Path) -> bool:
|
|
218
|
+
current = path
|
|
219
|
+
while current != below:
|
|
220
|
+
if current.is_symlink():
|
|
221
|
+
return False
|
|
222
|
+
if current.parent == current:
|
|
223
|
+
return False
|
|
224
|
+
current = current.parent
|
|
225
|
+
return True
|
|
226
|
+
|
|
227
|
+
|
|
228
|
+
def _read_system_prompt(relative: str, *, cwd: Path) -> str:
|
|
229
|
+
workspace = cwd.resolve()
|
|
230
|
+
path = workspace / relative
|
|
231
|
+
try:
|
|
232
|
+
if not _no_symbolic_links(path, below=workspace):
|
|
233
|
+
raise ConfigurationError(
|
|
234
|
+
f"Selected system prompt {relative} must not be a symbolic link"
|
|
235
|
+
)
|
|
236
|
+
resolved = path.resolve(strict=True)
|
|
237
|
+
resolved.relative_to(workspace / ".tau")
|
|
238
|
+
if not resolved.is_file():
|
|
239
|
+
raise ConfigurationError(f"Selected system prompt {relative} is not a file")
|
|
240
|
+
raw = resolved.read_bytes()
|
|
241
|
+
except FileNotFoundError:
|
|
242
|
+
raise ConfigurationError(f"Selected system prompt {relative} does not exist") from None
|
|
243
|
+
except ValueError:
|
|
244
|
+
raise ConfigurationError(f"Selected system prompt {relative} is outside .tau/") from None
|
|
245
|
+
except OSError as error:
|
|
246
|
+
raise ConfigurationError(
|
|
247
|
+
f"Selected system prompt {relative} cannot be read: {error.strerror}"
|
|
248
|
+
) from None
|
|
249
|
+
try:
|
|
250
|
+
return raw.decode("utf-8")
|
|
251
|
+
except UnicodeDecodeError:
|
|
252
|
+
raise ConfigurationError(f"Selected system prompt {relative} is not UTF-8") from None
|
|
253
|
+
|
|
254
|
+
|
|
255
|
+
def _resolve_extensions(entries: Iterable[str], *, cwd: Path) -> tuple[Path, ...]:
|
|
256
|
+
entries = tuple(entries)
|
|
257
|
+
if not entries:
|
|
258
|
+
return ()
|
|
259
|
+
workspace = cwd.resolve()
|
|
260
|
+
root = workspace / ".tau" / "extensions"
|
|
261
|
+
if not _no_symbolic_links(root, below=workspace) or not root.is_dir():
|
|
262
|
+
raise ConfigurationError(
|
|
263
|
+
".tau/extensions must be a folder in the workspace to select extensions"
|
|
264
|
+
)
|
|
265
|
+
# The extensions Tau discovers as project extensions; a selection only narrows them.
|
|
266
|
+
discovered, _ = discover_extensions(
|
|
267
|
+
TauResourcePaths(root=root, cwd=workspace),
|
|
268
|
+
include_project_dir=True,
|
|
269
|
+
include_user_dir=False,
|
|
270
|
+
)
|
|
271
|
+
discovered_paths = [entry.path.resolve() for entry in discovered]
|
|
272
|
+
resolved: list[Path] = []
|
|
273
|
+
for name in entries:
|
|
274
|
+
entry = root / name
|
|
275
|
+
relative = (_EXTENSION_ROOT / name).as_posix()
|
|
276
|
+
if entry.is_symlink():
|
|
277
|
+
raise ConfigurationError(f"Selected extension {relative} must not be a symbolic link")
|
|
278
|
+
if not entry.exists():
|
|
279
|
+
raise ConfigurationError(f"Selected extension {relative} does not exist")
|
|
280
|
+
if not any(_within(path, entry) for path in discovered_paths):
|
|
281
|
+
raise ConfigurationError(
|
|
282
|
+
f"Selected extension {relative} is not an extension Tau discovers in "
|
|
283
|
+
".tau/extensions"
|
|
284
|
+
)
|
|
285
|
+
resolved.append(entry)
|
|
286
|
+
return tuple(resolved)
|
|
287
|
+
|
|
288
|
+
|
|
289
|
+
def resolve_runtime_resources(
|
|
290
|
+
selection: RuntimeResourceSelection, *, cwd: Path
|
|
291
|
+
) -> ResolvedRuntimeResources:
|
|
292
|
+
"""Read the selected prompt and resolve the selected extensions before Tau loads."""
|
|
293
|
+
custom_system_prompt = (
|
|
294
|
+
None
|
|
295
|
+
if selection.system_prompt is None
|
|
296
|
+
else _read_system_prompt(selection.system_prompt, cwd=cwd)
|
|
297
|
+
)
|
|
298
|
+
extension_paths = (
|
|
299
|
+
() if selection.extensions is None else _resolve_extensions(selection.extensions, cwd=cwd)
|
|
300
|
+
)
|
|
301
|
+
return ResolvedRuntimeResources(
|
|
302
|
+
selection=selection,
|
|
303
|
+
cwd=cwd,
|
|
304
|
+
custom_system_prompt=custom_system_prompt,
|
|
305
|
+
extension_paths=extension_paths,
|
|
306
|
+
)
|
|
@@ -14,6 +14,9 @@ from ms_tau_sdk.errors import ConfigurationError
|
|
|
14
14
|
from ms_tau_sdk.runtime.snapshots import sha256_json
|
|
15
15
|
|
|
16
16
|
TASK_CONTROL_TOOL_NAMES = frozenset({"task_request_input", "task_request_authorization"})
|
|
17
|
+
# Tau marks the extensions of an Agent's selection `explicit`. The SDK passes explicit paths only
|
|
18
|
+
# from that selection, all under `.tau/extensions/`, so they count as the project's (ADR 0026).
|
|
19
|
+
PROJECT_EXTENSION_SOURCES = frozenset({"project", "explicit"})
|
|
17
20
|
|
|
18
21
|
|
|
19
22
|
def validate_tool_catalog(
|
|
@@ -43,7 +46,7 @@ def validate_tool_catalog(
|
|
|
43
46
|
metadata = session.extension_runtime.extension_metadata
|
|
44
47
|
for owner in set(sources.values()):
|
|
45
48
|
matches = [item for item in metadata if item.name == owner]
|
|
46
|
-
if len(matches) != 1 or matches[0].source
|
|
49
|
+
if len(matches) != 1 or matches[0].source not in PROJECT_EXTENSION_SOURCES:
|
|
47
50
|
raise ConfigurationError("Tool-only runtime includes a non-project extension tool")
|
|
48
51
|
if require_complete_project_catalog and any(
|
|
49
52
|
diagnostic.severity == "error" for diagnostic in session.extension_runtime.diagnostics
|
|
@@ -112,11 +115,22 @@ def _workspace_relative_path(path: Path | None, *, cwd: Path) -> str | None:
|
|
|
112
115
|
|
|
113
116
|
|
|
114
117
|
def project_resources_summary(
|
|
115
|
-
session: CodingSession,
|
|
118
|
+
session: CodingSession,
|
|
119
|
+
*,
|
|
120
|
+
cwd: Path,
|
|
121
|
+
development_resources: bool,
|
|
122
|
+
selection: dict[str, JSONValue] | None = None,
|
|
116
123
|
) -> dict[str, JSONValue]:
|
|
117
|
-
"""The Agent's resources Tau selected from the workspace (
|
|
124
|
+
"""The Agent's resources Tau selected from the workspace (ADRs 0025 and 0026).
|
|
125
|
+
|
|
126
|
+
`selection` is the Agent's own selection from session bootstrap, or `None` when the Agent
|
|
127
|
+
loads the whole `.tau/`. A selected system prompt is passed to Tau as content, so it is listed
|
|
128
|
+
here first, before the files Tau found itself.
|
|
129
|
+
"""
|
|
130
|
+
selected_prompt = selection.get("systemPrompt") if selection is not None else None
|
|
118
131
|
system_prompt_files: list[JSONValue] = [
|
|
119
|
-
|
|
132
|
+
*([selected_prompt] if selected_prompt is not None else []),
|
|
133
|
+
*(_workspace_relative_path(path, cwd=cwd) for path in session.system_prompt_files),
|
|
120
134
|
]
|
|
121
135
|
context_files: list[JSONValue] = [
|
|
122
136
|
_workspace_relative_path(Path(context_file.path), cwd=cwd)
|
|
@@ -132,6 +146,7 @@ def project_resources_summary(
|
|
|
132
146
|
"contextFiles": context_files,
|
|
133
147
|
"skills": skills,
|
|
134
148
|
"promptTemplates": prompt_templates,
|
|
149
|
+
"selection": selection,
|
|
135
150
|
}
|
|
136
151
|
|
|
137
152
|
|
|
@@ -142,10 +157,11 @@ def log_project_resources(
|
|
|
142
157
|
cwd: Path,
|
|
143
158
|
development_resources: bool,
|
|
144
159
|
phase: str,
|
|
160
|
+
selection: dict[str, JSONValue] | None = None,
|
|
145
161
|
) -> None:
|
|
146
162
|
"""Log what Tau selected and reported for the Agent's resources on load or reload."""
|
|
147
163
|
summary = project_resources_summary(
|
|
148
|
-
session, cwd=cwd, development_resources=development_resources
|
|
164
|
+
session, cwd=cwd, development_resources=development_resources, selection=selection
|
|
149
165
|
)
|
|
150
166
|
_resources_logger.info(
|
|
151
167
|
"runtime.project_resources.load.completed",
|
|
@@ -156,6 +172,7 @@ def log_project_resources(
|
|
|
156
172
|
context_files=summary["contextFiles"],
|
|
157
173
|
skill_count=len(session.skills),
|
|
158
174
|
prompt_template_count=len(session.prompt_templates),
|
|
175
|
+
runtime_resources=selection,
|
|
159
176
|
)
|
|
160
177
|
workspace = str(cwd.resolve())
|
|
161
178
|
for diagnostic in session.resource_diagnostics:
|
|
@@ -57,8 +57,15 @@ from ms_tau_sdk.logging import conversation_log_fields
|
|
|
57
57
|
from ms_tau_sdk.protocols.caller_context import caller_context_scope
|
|
58
58
|
from ms_tau_sdk.providers.factory import ProviderFactory
|
|
59
59
|
from ms_tau_sdk.resources.loader import tau_resource_paths
|
|
60
|
+
from ms_tau_sdk.resources.selection import (
|
|
61
|
+
RUNTIME_RESOURCES_SCHEMA_VERSION,
|
|
62
|
+
ResolvedRuntimeResources,
|
|
63
|
+
parse_runtime_resources,
|
|
64
|
+
resolve_runtime_resources,
|
|
65
|
+
)
|
|
60
66
|
from ms_tau_sdk.runtime.events import TauRuntimeEvent
|
|
61
67
|
from ms_tau_sdk.runtime.extensions import (
|
|
68
|
+
PROJECT_EXTENSION_SOURCES,
|
|
62
69
|
TASK_CONTROL_TOOL_NAMES,
|
|
63
70
|
ProjectExtensionState,
|
|
64
71
|
log_project_resources,
|
|
@@ -207,6 +214,8 @@ def _tool_category(coding_session: CodingSession, tool_name: str) -> tuple[str,
|
|
|
207
214
|
if owner is not None:
|
|
208
215
|
metadata = _metadata_for_owner(coding_session, owner)
|
|
209
216
|
source = str(getattr(metadata, "source", "unknown"))
|
|
217
|
+
if source in PROJECT_EXTENSION_SOURCES:
|
|
218
|
+
source = "project"
|
|
210
219
|
return f"{source}_extension", metadata
|
|
211
220
|
if tool_name in TASK_CONTROL_TOOL_NAMES:
|
|
212
221
|
return "protocol", None
|
|
@@ -555,11 +564,11 @@ class SessionRuntimeManager:
|
|
|
555
564
|
extensions: list[dict[str, object]] = []
|
|
556
565
|
for item in metadata:
|
|
557
566
|
path = getattr(item, "path", None)
|
|
558
|
-
is_project = item.source
|
|
567
|
+
is_project = item.source in PROJECT_EXTENSION_SOURCES
|
|
559
568
|
extensions.append(
|
|
560
569
|
{
|
|
561
570
|
"name": item.name,
|
|
562
|
-
"origin": item.source,
|
|
571
|
+
"origin": "project" if is_project else item.source,
|
|
563
572
|
"hidden": item.hidden,
|
|
564
573
|
"entryPath": (
|
|
565
574
|
_repository_relative_path(path, cwd=self.settings.workspace)
|
|
@@ -621,6 +630,11 @@ class SessionRuntimeManager:
|
|
|
621
630
|
coding_session,
|
|
622
631
|
cwd=self.settings.workspace,
|
|
623
632
|
development_resources=self.settings.include_development_resources,
|
|
633
|
+
selection=(
|
|
634
|
+
runtime.runtime_resources.summary()
|
|
635
|
+
if runtime.runtime_resources is not None
|
|
636
|
+
else None
|
|
637
|
+
),
|
|
624
638
|
),
|
|
625
639
|
}
|
|
626
640
|
|
|
@@ -632,7 +646,7 @@ class SessionRuntimeManager:
|
|
|
632
646
|
(
|
|
633
647
|
item
|
|
634
648
|
for item in runtime.coding_session.extension_runtime.extension_metadata
|
|
635
|
-
if item.source
|
|
649
|
+
if item.source in PROJECT_EXTENSION_SOURCES
|
|
636
650
|
and item.path is not None
|
|
637
651
|
and _source_uid(session_uid, item.source_id) == source_uid
|
|
638
652
|
),
|
|
@@ -1032,6 +1046,7 @@ class SessionRuntimeManager:
|
|
|
1032
1046
|
bootstrap_request_uid=bootstrap_request_uid,
|
|
1033
1047
|
supported_snapshot_schema_versions=[SNAPSHOT_SCHEMA_VERSION],
|
|
1034
1048
|
supported_provider_control_schema_versions=[1],
|
|
1049
|
+
supported_runtime_resources_schema_versions=[RUNTIME_RESOURCES_SCHEMA_VERSION],
|
|
1035
1050
|
tau_runtime_version=TAU_RUNTIME_VERSION,
|
|
1036
1051
|
),
|
|
1037
1052
|
)
|
|
@@ -1140,6 +1155,15 @@ class SessionRuntimeManager:
|
|
|
1140
1155
|
None if self.settings.exclude_mainsequence_mcp else await self._get_mcp_client()
|
|
1141
1156
|
)
|
|
1142
1157
|
cwd = self._resolve_cwd()
|
|
1158
|
+
# The Agent's own prompt, skills and extensions (ADR 0026), read and resolved before
|
|
1159
|
+
# Tau runs any project code. Without a selection the Agent loads the whole `.tau/`.
|
|
1160
|
+
selection = parse_runtime_resources(bootstrap.runtime_resources)
|
|
1161
|
+
runtime_resources: ResolvedRuntimeResources | None = (
|
|
1162
|
+
resolve_runtime_resources(selection, cwd=cwd) if selection is not None else None
|
|
1163
|
+
)
|
|
1164
|
+
selection_summary = (
|
|
1165
|
+
runtime_resources.summary() if runtime_resources is not None else None
|
|
1166
|
+
)
|
|
1143
1167
|
project_extension_state = ProjectExtensionState(enabled=True)
|
|
1144
1168
|
tools = []
|
|
1145
1169
|
if self.settings.exclude_base_tools:
|
|
@@ -1184,6 +1208,8 @@ class SessionRuntimeManager:
|
|
|
1184
1208
|
require_complete_project_catalog=require_complete_project_catalog,
|
|
1185
1209
|
reserved_sdk_tool_names=reserved_sdk_tool_names,
|
|
1186
1210
|
)
|
|
1211
|
+
if runtime_resources is not None:
|
|
1212
|
+
runtime_resources.verify(session)
|
|
1187
1213
|
|
|
1188
1214
|
coding_session = await CodingSession.load(
|
|
1189
1215
|
CodingSessionConfig(
|
|
@@ -1204,8 +1230,26 @@ class SessionRuntimeManager:
|
|
|
1204
1230
|
cwd,
|
|
1205
1231
|
state_home=self.settings.tau_state_home,
|
|
1206
1232
|
include_development_resources=(self.settings.include_development_resources),
|
|
1233
|
+
skills=(
|
|
1234
|
+
runtime_resources.skill_names if runtime_resources is not None else None
|
|
1235
|
+
),
|
|
1236
|
+
),
|
|
1237
|
+
custom_system_prompt=(
|
|
1238
|
+
runtime_resources.custom_system_prompt
|
|
1239
|
+
if runtime_resources is not None
|
|
1240
|
+
else None
|
|
1241
|
+
),
|
|
1242
|
+
skills_enabled=(
|
|
1243
|
+
runtime_resources.skills_enabled if runtime_resources is not None else True
|
|
1244
|
+
),
|
|
1245
|
+
project_extensions_enabled=(
|
|
1246
|
+
runtime_resources.project_extensions_enabled
|
|
1247
|
+
if runtime_resources is not None
|
|
1248
|
+
else True
|
|
1249
|
+
),
|
|
1250
|
+
extension_paths=(
|
|
1251
|
+
runtime_resources.extension_paths if runtime_resources is not None else ()
|
|
1207
1252
|
),
|
|
1208
|
-
project_extensions_enabled=True,
|
|
1209
1253
|
trust_override="approve",
|
|
1210
1254
|
)
|
|
1211
1255
|
)
|
|
@@ -1228,6 +1272,7 @@ class SessionRuntimeManager:
|
|
|
1228
1272
|
cwd=cwd,
|
|
1229
1273
|
development_resources=self.settings.include_development_resources,
|
|
1230
1274
|
phase="load",
|
|
1275
|
+
selection=selection_summary,
|
|
1231
1276
|
)
|
|
1232
1277
|
runtime = ActiveSessionRuntime(
|
|
1233
1278
|
session_uid=session_uid,
|
|
@@ -1245,6 +1290,7 @@ class SessionRuntimeManager:
|
|
|
1245
1290
|
project_extension_state=project_extension_state,
|
|
1246
1291
|
validate_tool_catalog=check_catalog,
|
|
1247
1292
|
development_resources=self.settings.include_development_resources,
|
|
1293
|
+
runtime_resources=runtime_resources,
|
|
1248
1294
|
)
|
|
1249
1295
|
state = bootstrap.runtime_state
|
|
1250
1296
|
runtime.runtime_activity = state.runtime_activity or "loading"
|
|
@@ -13,6 +13,7 @@ from tau_coding.reload import CodingReloadSummary
|
|
|
13
13
|
|
|
14
14
|
from ms_tau_sdk.backend.mcp import MainSequenceMCPClient
|
|
15
15
|
from ms_tau_sdk.backend.models import TauTurnCommit
|
|
16
|
+
from ms_tau_sdk.resources.selection import ResolvedRuntimeResources
|
|
16
17
|
from ms_tau_sdk.runtime.events import TauRuntimeEvent, translate_tau_event
|
|
17
18
|
from ms_tau_sdk.runtime.extensions import ProjectExtensionState, log_project_resources
|
|
18
19
|
from ms_tau_sdk.runtime.provenance import PROVENANCE_NAMESPACE, TurnProvenance
|
|
@@ -53,6 +54,8 @@ class ActiveSessionRuntime:
|
|
|
53
54
|
project_extension_state: ProjectExtensionState | None = None
|
|
54
55
|
validate_tool_catalog: Callable[[CodingSession], None] | None = None
|
|
55
56
|
development_resources: bool = False
|
|
57
|
+
# The Agent's selection of `.tau` resources from session bootstrap (ADR 0026), if any.
|
|
58
|
+
runtime_resources: ResolvedRuntimeResources | None = None
|
|
56
59
|
|
|
57
60
|
async def reload(self) -> CodingReloadSummary:
|
|
58
61
|
"""Reload Tau resources and reject an invalid replacement catalog."""
|
|
@@ -68,6 +71,9 @@ class ActiveSessionRuntime:
|
|
|
68
71
|
cwd=self.coding_session.cwd,
|
|
69
72
|
development_resources=self.development_resources,
|
|
70
73
|
phase="reload",
|
|
74
|
+
selection=(
|
|
75
|
+
self.runtime_resources.summary() if self.runtime_resources is not None else None
|
|
76
|
+
),
|
|
71
77
|
)
|
|
72
78
|
return summary
|
|
73
79
|
|
|
File without changes
|
|
File without changes
|
{ms_tau_sdk-2.0.29.dev85 → ms_tau_sdk-2.0.30.dev87}/packages/tau-board/src/ms_tau_board/__init__.py
RENAMED
|
File without changes
|
{ms_tau_sdk-2.0.29.dev85 → ms_tau_sdk-2.0.30.dev87}/packages/tau-board/src/ms_tau_board/app.py
RENAMED
|
File without changes
|
{ms_tau_sdk-2.0.29.dev85 → ms_tau_sdk-2.0.30.dev87}/packages/tau-board/src/ms_tau_board/cli.py
RENAMED
|
File without changes
|
{ms_tau_sdk-2.0.29.dev85 → ms_tau_sdk-2.0.30.dev87}/packages/tau-board/src/ms_tau_board/config.py
RENAMED
|
File without changes
|
{ms_tau_sdk-2.0.29.dev85 → ms_tau_sdk-2.0.30.dev87}/packages/tau-board/src/ms_tau_board/env_file.py
RENAMED
|
File without changes
|
{ms_tau_sdk-2.0.29.dev85 → ms_tau_sdk-2.0.30.dev87}/packages/tau-board/src/ms_tau_board/logs.py
RENAMED
|
File without changes
|
{ms_tau_sdk-2.0.29.dev85 → ms_tau_sdk-2.0.30.dev87}/packages/tau-board/src/ms_tau_board/proxy.py
RENAMED
|
File without changes
|
{ms_tau_sdk-2.0.29.dev85 → ms_tau_sdk-2.0.30.dev87}/packages/tau-board/src/ms_tau_board/state.py
RENAMED
|
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
|
|
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
|
{ms_tau_sdk-2.0.29.dev85 → ms_tau_sdk-2.0.30.dev87}/src/ms_tau_sdk/backend/team_memberships.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{ms_tau_sdk-2.0.29.dev85 → ms_tau_sdk-2.0.30.dev87}/src/ms_tau_sdk/protocols/assistant_ui.py
RENAMED
|
File without changes
|
{ms_tau_sdk-2.0.29.dev85 → ms_tau_sdk-2.0.30.dev87}/src/ms_tau_sdk/protocols/caller_context.py
RENAMED
|
File without changes
|
{ms_tau_sdk-2.0.29.dev85 → ms_tau_sdk-2.0.30.dev87}/src/ms_tau_sdk/protocols/chat_history.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{ms_tau_sdk-2.0.29.dev85 → ms_tau_sdk-2.0.30.dev87}/src/ms_tau_sdk/resources/context_compat.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{ms_tau_sdk-2.0.29.dev85 → ms_tau_sdk-2.0.30.dev87}/src/ms_tau_sdk/runtime/deployment_health.py
RENAMED
|
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
|
{ms_tau_sdk-2.0.29.dev85 → ms_tau_sdk-2.0.30.dev87}/src/ms_tau_sdk/tools/mainsequence_mcp.py
RENAMED
|
File without changes
|
{ms_tau_sdk-2.0.29.dev85 → ms_tau_sdk-2.0.30.dev87}/src/ms_tau_sdk/tools/mcp_applications.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|