mainsequence 4.4.11__tar.gz → 4.4.13__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.
- {mainsequence-4.4.11/mainsequence.egg-info → mainsequence-4.4.13}/PKG-INFO +1 -1
- mainsequence-4.4.13/agent_scaffold/skills/a2a_communication/SKILL.md +301 -0
- {mainsequence-4.4.11 → mainsequence-4.4.13}/mainsequence/cli/api.py +137 -11
- {mainsequence-4.4.11 → mainsequence-4.4.13}/mainsequence/cli/cli.py +386 -5
- {mainsequence-4.4.11 → mainsequence-4.4.13}/mainsequence/client/agent_runtime_models.py +298 -28
- {mainsequence-4.4.11 → mainsequence-4.4.13/mainsequence.egg-info}/PKG-INFO +1 -1
- {mainsequence-4.4.11 → mainsequence-4.4.13}/pyproject.toml +1 -1
- {mainsequence-4.4.11 → mainsequence-4.4.13}/tests/test_cli.py +365 -3
- {mainsequence-4.4.11 → mainsequence-4.4.13}/tests/test_filter_normalization.py +238 -0
- mainsequence-4.4.11/agent_scaffold/skills/a2a_communication/SKILL.md +0 -157
- {mainsequence-4.4.11 → mainsequence-4.4.13}/LICENSE +0 -0
- {mainsequence-4.4.11 → mainsequence-4.4.13}/README.md +0 -0
- {mainsequence-4.4.11 → mainsequence-4.4.13}/agent_scaffold/AGENTS.md +0 -0
- {mainsequence-4.4.11 → mainsequence-4.4.13}/agent_scaffold/skills/application_surfaces/api_surfaces/SKILL.md +0 -0
- {mainsequence-4.4.11 → mainsequence-4.4.13}/agent_scaffold/skills/command_center/adapter_from_api/SKILL.md +0 -0
- {mainsequence-4.4.11 → mainsequence-4.4.13}/agent_scaffold/skills/command_center/api_mock_prototyping/SKILL.md +0 -0
- {mainsequence-4.4.11 → mainsequence-4.4.13}/agent_scaffold/skills/command_center/connections/SKILL.md +0 -0
- {mainsequence-4.4.11 → mainsequence-4.4.13}/agent_scaffold/skills/command_center/widgets/app_components/SKILL.md +0 -0
- {mainsequence-4.4.11 → mainsequence-4.4.13}/agent_scaffold/skills/command_center/widgets/tables/SKILL.md +0 -0
- {mainsequence-4.4.11 → mainsequence-4.4.13}/agent_scaffold/skills/command_center/widgets/tabular_transform/SKILL.md +0 -0
- {mainsequence-4.4.11 → mainsequence-4.4.13}/agent_scaffold/skills/command_center/workspace_analysis/SKILL.md +0 -0
- {mainsequence-4.4.11 → mainsequence-4.4.13}/agent_scaffold/skills/command_center/workspace_builder/SKILL.md +0 -0
- {mainsequence-4.4.11 → mainsequence-4.4.13}/agent_scaffold/skills/command_center/workspace_design/SKILL.md +0 -0
- {mainsequence-4.4.11 → mainsequence-4.4.13}/agent_scaffold/skills/dashboards/streamlit/SKILL.md +0 -0
- {mainsequence-4.4.11 → mainsequence-4.4.13}/agent_scaffold/skills/data_access/exploration/SKILL.md +0 -0
- {mainsequence-4.4.11 → mainsequence-4.4.13}/agent_scaffold/skills/data_publishing/data_nodes/SKILL.md +0 -0
- {mainsequence-4.4.11 → mainsequence-4.4.13}/agent_scaffold/skills/data_publishing/meta_table_migrations/SKILL.md +0 -0
- {mainsequence-4.4.11 → mainsequence-4.4.13}/agent_scaffold/skills/data_publishing/meta_tables/SKILL.md +0 -0
- {mainsequence-4.4.11 → mainsequence-4.4.13}/agent_scaffold/skills/maintenance/bug_auditor/SKILL.md +0 -0
- {mainsequence-4.4.11 → mainsequence-4.4.13}/agent_scaffold/skills/ms-markets/SKILL.md +0 -0
- {mainsequence-4.4.11 → mainsequence-4.4.13}/agent_scaffold/skills/platform_operations/access_control_and_sharing/SKILL.md +0 -0
- {mainsequence-4.4.11 → mainsequence-4.4.13}/agent_scaffold/skills/platform_operations/orchestration_and_releases/SKILL.md +0 -0
- {mainsequence-4.4.11 → mainsequence-4.4.13}/agent_scaffold/skills/project_builder/SKILL.md +0 -0
- {mainsequence-4.4.11 → mainsequence-4.4.13}/agent_scaffold/skills/project_to_agent/SKILL.md +0 -0
- {mainsequence-4.4.11 → mainsequence-4.4.13}/mainsequence/__init__.py +0 -0
- {mainsequence-4.4.11 → mainsequence-4.4.13}/mainsequence/__main__.py +0 -0
- {mainsequence-4.4.11 → mainsequence-4.4.13}/mainsequence/bootstrap.py +0 -0
- {mainsequence-4.4.11 → mainsequence-4.4.13}/mainsequence/cli/__init__.py +0 -0
- {mainsequence-4.4.11 → mainsequence-4.4.13}/mainsequence/cli/browser_auth.py +0 -0
- {mainsequence-4.4.11 → mainsequence-4.4.13}/mainsequence/cli/config.py +0 -0
- {mainsequence-4.4.11 → mainsequence-4.4.13}/mainsequence/cli/docker_utils.py +0 -0
- {mainsequence-4.4.11 → mainsequence-4.4.13}/mainsequence/cli/doctor.py +0 -0
- {mainsequence-4.4.11 → mainsequence-4.4.13}/mainsequence/cli/local_ops.py +0 -0
- {mainsequence-4.4.11 → mainsequence-4.4.13}/mainsequence/cli/migrations.py +0 -0
- {mainsequence-4.4.11 → mainsequence-4.4.13}/mainsequence/cli/model_filters.py +0 -0
- {mainsequence-4.4.11 → mainsequence-4.4.13}/mainsequence/cli/project_status.py +0 -0
- {mainsequence-4.4.11 → mainsequence-4.4.13}/mainsequence/cli/pydantic_cli.py +0 -0
- {mainsequence-4.4.11 → mainsequence-4.4.13}/mainsequence/cli/sdk_utils.py +0 -0
- {mainsequence-4.4.11 → mainsequence-4.4.13}/mainsequence/cli/ssh_utils.py +0 -0
- {mainsequence-4.4.11 → mainsequence-4.4.13}/mainsequence/cli/ui.py +0 -0
- {mainsequence-4.4.11 → mainsequence-4.4.13}/mainsequence/client/__init__.py +0 -0
- {mainsequence-4.4.11 → mainsequence-4.4.13}/mainsequence/client/base.py +0 -0
- {mainsequence-4.4.11 → mainsequence-4.4.13}/mainsequence/client/client.py +0 -0
- {mainsequence-4.4.11 → mainsequence-4.4.13}/mainsequence/client/command_center/__init__.py +0 -0
- {mainsequence-4.4.11 → mainsequence-4.4.13}/mainsequence/client/command_center/app_component.py +0 -0
- {mainsequence-4.4.11 → mainsequence-4.4.13}/mainsequence/client/command_center/connections.py +0 -0
- {mainsequence-4.4.11 → mainsequence-4.4.13}/mainsequence/client/command_center/contracts/__init__.py +0 -0
- {mainsequence-4.4.11 → mainsequence-4.4.13}/mainsequence/client/command_center/contracts/adapter_from_api.py +0 -0
- {mainsequence-4.4.11 → mainsequence-4.4.13}/mainsequence/client/command_center/contracts/response_mapping.py +0 -0
- {mainsequence-4.4.11 → mainsequence-4.4.13}/mainsequence/client/command_center/contracts/table_visuals.py +0 -0
- {mainsequence-4.4.11 → mainsequence-4.4.13}/mainsequence/client/command_center/contracts/tabular.py +0 -0
- {mainsequence-4.4.11 → mainsequence-4.4.13}/mainsequence/client/command_center/contracts/ui.py +0 -0
- {mainsequence-4.4.11 → mainsequence-4.4.13}/mainsequence/client/command_center/data_models.py +0 -0
- {mainsequence-4.4.11 → mainsequence-4.4.13}/mainsequence/client/command_center/providers/__init__.py +0 -0
- {mainsequence-4.4.11 → mainsequence-4.4.13}/mainsequence/client/command_center/providers/adapter_from_api.py +0 -0
- {mainsequence-4.4.11 → mainsequence-4.4.13}/mainsequence/client/command_center/widgets/__init__.py +0 -0
- {mainsequence-4.4.11 → mainsequence-4.4.13}/mainsequence/client/command_center/widgets/bindings.py +0 -0
- {mainsequence-4.4.11 → mainsequence-4.4.13}/mainsequence/client/command_center/widgets/connection_query.py +0 -0
- {mainsequence-4.4.11 → mainsequence-4.4.13}/mainsequence/client/command_center/widgets/registry.py +0 -0
- {mainsequence-4.4.11 → mainsequence-4.4.13}/mainsequence/client/command_center/widgets/table.py +0 -0
- {mainsequence-4.4.11 → mainsequence-4.4.13}/mainsequence/client/command_center/widgets/tabular_transform.py +0 -0
- {mainsequence-4.4.11 → mainsequence-4.4.13}/mainsequence/client/command_center/workspace.py +0 -0
- {mainsequence-4.4.11 → mainsequence-4.4.13}/mainsequence/client/command_center/workspace_snapshot.py +0 -0
- {mainsequence-4.4.11 → mainsequence-4.4.13}/mainsequence/client/command_center/workspaces/__init__.py +0 -0
- {mainsequence-4.4.11 → mainsequence-4.4.13}/mainsequence/client/command_center/workspaces/documents.py +0 -0
- {mainsequence-4.4.11 → mainsequence-4.4.13}/mainsequence/client/command_center/workspaces/mounted_widgets.py +0 -0
- {mainsequence-4.4.11 → mainsequence-4.4.13}/mainsequence/client/compute_validation.py +0 -0
- {mainsequence-4.4.11 → mainsequence-4.4.13}/mainsequence/client/data_sources_interfaces/__init__.py +0 -0
- {mainsequence-4.4.11 → mainsequence-4.4.13}/mainsequence/client/data_sources_interfaces/duckdb.py +0 -0
- {mainsequence-4.4.11 → mainsequence-4.4.13}/mainsequence/client/data_sources_interfaces/local_paths.py +0 -0
- {mainsequence-4.4.11 → mainsequence-4.4.13}/mainsequence/client/data_sources_interfaces/sqlite.py +0 -0
- {mainsequence-4.4.11 → mainsequence-4.4.13}/mainsequence/client/dtype_codec.py +0 -0
- {mainsequence-4.4.11 → mainsequence-4.4.13}/mainsequence/client/exceptions.py +0 -0
- {mainsequence-4.4.11 → mainsequence-4.4.13}/mainsequence/client/fastapi/__init__.py +0 -0
- {mainsequence-4.4.11 → mainsequence-4.4.13}/mainsequence/client/fastapi/auth.py +0 -0
- {mainsequence-4.4.11 → mainsequence-4.4.13}/mainsequence/client/metatables/__init__.py +0 -0
- {mainsequence-4.4.11 → mainsequence-4.4.13}/mainsequence/client/metatables/core.py +0 -0
- {mainsequence-4.4.11 → mainsequence-4.4.13}/mainsequence/client/models_foundry.py +0 -0
- {mainsequence-4.4.11 → mainsequence-4.4.13}/mainsequence/client/models_helpers.py +0 -0
- {mainsequence-4.4.11 → mainsequence-4.4.13}/mainsequence/client/models_user.py +0 -0
- {mainsequence-4.4.11 → mainsequence-4.4.13}/mainsequence/client/utils.py +0 -0
- {mainsequence-4.4.11 → mainsequence-4.4.13}/mainsequence/defaults.py +0 -0
- {mainsequence-4.4.11 → mainsequence-4.4.13}/mainsequence/instrumentation/__init__.py +0 -0
- {mainsequence-4.4.11 → mainsequence-4.4.13}/mainsequence/instrumentation/utils.py +0 -0
- {mainsequence-4.4.11 → mainsequence-4.4.13}/mainsequence/logconf.py +0 -0
- {mainsequence-4.4.11 → mainsequence-4.4.13}/mainsequence/meta_tables/__init__.py +0 -0
- {mainsequence-4.4.11 → mainsequence-4.4.13}/mainsequence/meta_tables/__main__.py +0 -0
- {mainsequence-4.4.11 → mainsequence-4.4.13}/mainsequence/meta_tables/compiled_sql/__init__.py +0 -0
- {mainsequence-4.4.11 → mainsequence-4.4.13}/mainsequence/meta_tables/compiled_sql/v1.py +0 -0
- {mainsequence-4.4.11 → mainsequence-4.4.13}/mainsequence/meta_tables/data_nodes/__init__.py +0 -0
- {mainsequence-4.4.11 → mainsequence-4.4.13}/mainsequence/meta_tables/data_nodes/build_operations.py +0 -0
- {mainsequence-4.4.11 → mainsequence-4.4.13}/mainsequence/meta_tables/data_nodes/data_nodes.py +0 -0
- {mainsequence-4.4.11 → mainsequence-4.4.13}/mainsequence/meta_tables/data_nodes/models.py +0 -0
- {mainsequence-4.4.11 → mainsequence-4.4.13}/mainsequence/meta_tables/data_nodes/namespacing.py +0 -0
- {mainsequence-4.4.11 → mainsequence-4.4.13}/mainsequence/meta_tables/data_nodes/persist_managers.py +0 -0
- {mainsequence-4.4.11 → mainsequence-4.4.13}/mainsequence/meta_tables/data_nodes/run_operations.py +0 -0
- {mainsequence-4.4.11 → mainsequence-4.4.13}/mainsequence/meta_tables/data_nodes/utils.py +0 -0
- {mainsequence-4.4.11 → mainsequence-4.4.13}/mainsequence/meta_tables/future_registry.py +0 -0
- {mainsequence-4.4.11 → mainsequence-4.4.13}/mainsequence/meta_tables/hashing.py +0 -0
- {mainsequence-4.4.11 → mainsequence-4.4.13}/mainsequence/meta_tables/migrations/__init__.py +0 -0
- {mainsequence-4.4.11 → mainsequence-4.4.13}/mainsequence/meta_tables/migrations/alembic.py +0 -0
- {mainsequence-4.4.11 → mainsequence-4.4.13}/mainsequence/meta_tables/migrations/env.py +0 -0
- {mainsequence-4.4.11 → mainsequence-4.4.13}/mainsequence/meta_tables/migrations/provider.py +0 -0
- {mainsequence-4.4.11 → mainsequence-4.4.13}/mainsequence/meta_tables/migrations/registry.py +0 -0
- {mainsequence-4.4.11 → mainsequence-4.4.13}/mainsequence/meta_tables/migrations/scaffold.py +0 -0
- {mainsequence-4.4.11 → mainsequence-4.4.13}/mainsequence/meta_tables/migrations/templates/__init__.py +0 -0
- {mainsequence-4.4.11 → mainsequence-4.4.13}/mainsequence/meta_tables/migrations/templates/env.py.mako +0 -0
- {mainsequence-4.4.11 → mainsequence-4.4.13}/mainsequence/meta_tables/migrations/templates/script.py.mako +0 -0
- {mainsequence-4.4.11 → mainsequence-4.4.13}/mainsequence/meta_tables/pydantic_metadata.py +0 -0
- {mainsequence-4.4.11 → mainsequence-4.4.13}/mainsequence/meta_tables/schema_names.py +0 -0
- {mainsequence-4.4.11 → mainsequence-4.4.13}/mainsequence/meta_tables/sqlalchemy_contracts.py +0 -0
- {mainsequence-4.4.11 → mainsequence-4.4.13}/mainsequence/runtime_flags.py +0 -0
- {mainsequence-4.4.11 → mainsequence-4.4.13}/mainsequence/scaffold_skills.py +0 -0
- {mainsequence-4.4.11 → mainsequence-4.4.13}/mainsequence.egg-info/SOURCES.txt +0 -0
- {mainsequence-4.4.11 → mainsequence-4.4.13}/mainsequence.egg-info/dependency_links.txt +0 -0
- {mainsequence-4.4.11 → mainsequence-4.4.13}/mainsequence.egg-info/entry_points.txt +0 -0
- {mainsequence-4.4.11 → mainsequence-4.4.13}/mainsequence.egg-info/requires.txt +0 -0
- {mainsequence-4.4.11 → mainsequence-4.4.13}/mainsequence.egg-info/top_level.txt +0 -0
- {mainsequence-4.4.11 → mainsequence-4.4.13}/setup.cfg +0 -0
- {mainsequence-4.4.11 → mainsequence-4.4.13}/tests/test_auth_precedence.py +0 -0
- {mainsequence-4.4.11 → mainsequence-4.4.13}/tests/test_build_operations_hashing.py +0 -0
- {mainsequence-4.4.11 → mainsequence-4.4.13}/tests/test_cli_browser_auth.py +0 -0
- {mainsequence-4.4.11 → mainsequence-4.4.13}/tests/test_cli_migrations.py +0 -0
- {mainsequence-4.4.11 → mainsequence-4.4.13}/tests/test_client.py +0 -0
- {mainsequence-4.4.11 → mainsequence-4.4.13}/tests/test_command_center_app_component_models.py +0 -0
- {mainsequence-4.4.11 → mainsequence-4.4.13}/tests/test_command_center_data_models.py +0 -0
- {mainsequence-4.4.11 → mainsequence-4.4.13}/tests/test_command_center_models.py +0 -0
- {mainsequence-4.4.11 → mainsequence-4.4.13}/tests/test_command_center_table_contracts.py +0 -0
- {mainsequence-4.4.11 → mainsequence-4.4.13}/tests/test_command_center_tabular_transform.py +0 -0
- {mainsequence-4.4.11 → mainsequence-4.4.13}/tests/test_data_access_mixin_dimension_audit.py +0 -0
- {mainsequence-4.4.11 → mainsequence-4.4.13}/tests/test_data_node_storage_dimension_queries.py +0 -0
- {mainsequence-4.4.11 → mainsequence-4.4.13}/tests/test_data_node_update_flow.py +0 -0
- {mainsequence-4.4.11 → mainsequence-4.4.13}/tests/test_dependency_extras.py +0 -0
- {mainsequence-4.4.11 → mainsequence-4.4.13}/tests/test_duckdb_interface_dimensions.py +0 -0
- {mainsequence-4.4.11 → mainsequence-4.4.13}/tests/test_instrumentation.py +0 -0
- {mainsequence-4.4.11 → mainsequence-4.4.13}/tests/test_logconf.py +0 -0
- {mainsequence-4.4.11 → mainsequence-4.4.13}/tests/test_meta_table_migrations.py +0 -0
- {mainsequence-4.4.11 → mainsequence-4.4.13}/tests/test_meta_tables_client_models.py +0 -0
- {mainsequence-4.4.11 → mainsequence-4.4.13}/tests/test_meta_tables_sqlalchemy_contracts.py +0 -0
- {mainsequence-4.4.11 → mainsequence-4.4.13}/tests/test_models_user_request_bound_auth.py +0 -0
- {mainsequence-4.4.11 → mainsequence-4.4.13}/tests/test_pod_project_resolution.py +0 -0
- {mainsequence-4.4.11 → mainsequence-4.4.13}/tests/test_project_batch_jobs_from_file.py +0 -0
- {mainsequence-4.4.11 → mainsequence-4.4.13}/tests/test_run_configuration.py +0 -0
- {mainsequence-4.4.11 → mainsequence-4.4.13}/tests/test_scaffold_skills.py +0 -0
- {mainsequence-4.4.11 → mainsequence-4.4.13}/tests/test_schema_names.py +0 -0
- {mainsequence-4.4.11 → mainsequence-4.4.13}/tests/test_secret_client_model.py +0 -0
- {mainsequence-4.4.11 → mainsequence-4.4.13}/tests/test_source_table_configuration.py +0 -0
- {mainsequence-4.4.11 → mainsequence-4.4.13}/tests/test_sqlite_interface_dimensions.py +0 -0
- {mainsequence-4.4.11 → mainsequence-4.4.13}/tests/test_update_runner_uid_runtime.py +0 -0
- {mainsequence-4.4.11 → mainsequence-4.4.13}/tests/test_update_statistics.py +0 -0
- {mainsequence-4.4.11 → mainsequence-4.4.13}/tests/test_update_uid_guards.py +0 -0
- {mainsequence-4.4.11 → mainsequence-4.4.13}/tests/test_workspace_snapshot.py +0 -0
|
@@ -0,0 +1,301 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: a2a_communication
|
|
3
|
+
description: Canonical guidance for discovering other agents and communicating with them through Main Sequence's session-scoped A2A flow.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# A2A Communication
|
|
7
|
+
|
|
8
|
+
Use this skill whenever you need to discover another agent, inspect available A2A
|
|
9
|
+
candidates, or send a request to another agent through Main Sequence's A2A flow.
|
|
10
|
+
|
|
11
|
+
## Canonical Rule
|
|
12
|
+
|
|
13
|
+
A2A transport is session-scoped.
|
|
14
|
+
|
|
15
|
+
If you already have the target `AgentSession` UID, send to that session directly:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
mainsequence agent session a2a_chat <target_agent_session_uid> --message "..." --json
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Do not pass the target agent UID when sending to an existing session. The session is
|
|
22
|
+
already bound to its agent.
|
|
23
|
+
|
|
24
|
+
Only these backend A2A transport endpoints are part of this skill:
|
|
25
|
+
|
|
26
|
+
- `POST /orm/api/agents/v1/sessions/{session_uid}/runtime_ready/`
|
|
27
|
+
- `POST /orm/api/agents/v1/sessions/{session_uid}/a2a_chat/`
|
|
28
|
+
|
|
29
|
+
Do not invent wrapper endpoints or wrapper commands. Do not manually extract runtime RPC
|
|
30
|
+
URLs, runtime bearer tokens, or call target runtime health/chat endpoints with `curl`.
|
|
31
|
+
|
|
32
|
+
## When To Use
|
|
33
|
+
|
|
34
|
+
- When the user asks which agents can help.
|
|
35
|
+
- When another agent may be better suited to answer or assist.
|
|
36
|
+
- Before starting an A2A discovery flow.
|
|
37
|
+
- Before sending an A2A request to an existing target session.
|
|
38
|
+
- When a request explicitly arrives through the A2A channel.
|
|
39
|
+
|
|
40
|
+
## Core Invariants
|
|
41
|
+
|
|
42
|
+
- A2A does not expand your role or scope.
|
|
43
|
+
- Use `mainsequence agent search ... --json` as the canonical discovery source.
|
|
44
|
+
- Use `mainsequence agent session a2a_chat ...` as the canonical CLI send command.
|
|
45
|
+
- Use `AgentSession.send_a2a_chat(...)` as the canonical Python send helper.
|
|
46
|
+
- Use `mainsequence agent session wait_runtime_ready ...` only when you need an explicit
|
|
47
|
+
readiness check separate from sending.
|
|
48
|
+
- Do not expose or copy runtime bearer tokens into prompts, logs, or user-facing answers.
|
|
49
|
+
|
|
50
|
+
## Discovery Flow
|
|
51
|
+
|
|
52
|
+
1. Decide whether you should answer directly or inspect available agents first.
|
|
53
|
+
2. Build a bounded discovery intent:
|
|
54
|
+
- what help is needed
|
|
55
|
+
- optional agent hint
|
|
56
|
+
- required response format if relevant
|
|
57
|
+
3. Turn that intent into a discovery prompt with these sections when relevant:
|
|
58
|
+
- `Intent: ...`
|
|
59
|
+
- `Preferred agent hint: ...`
|
|
60
|
+
- `Required response format: ...`
|
|
61
|
+
4. Run:
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
mainsequence agent search "<discoveryPrompt>" --limit 10 --json
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
5. Treat the CLI output as authoritative.
|
|
68
|
+
6. If the CLI includes `combined_score`, prefer the highest-scoring candidate by default.
|
|
69
|
+
7. If the user asked only which agents are available, summarize the candidates and stop.
|
|
70
|
+
Include agent name, stable unique id, and a short summary of relevant skills or
|
|
71
|
+
capabilities.
|
|
72
|
+
|
|
73
|
+
## Getting A Target Session
|
|
74
|
+
|
|
75
|
+
If you already have the target session UID, skip this section.
|
|
76
|
+
|
|
77
|
+
If no target session exists yet, allocate or reuse one explicitly:
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
mainsequence agent allocate_a2a_target_session \
|
|
81
|
+
<target_agent_uid> \
|
|
82
|
+
<caller_agent_session_uid> \
|
|
83
|
+
--json
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
For retries or reconnects in the same delegated conversation, reuse the returned
|
|
87
|
+
`handle_unique_id`:
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
mainsequence agent allocate_a2a_target_session \
|
|
91
|
+
<target_agent_uid> \
|
|
92
|
+
<caller_agent_session_uid> \
|
|
93
|
+
--handle-unique-id <handle_unique_id> \
|
|
94
|
+
--json
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
The allocation response includes:
|
|
98
|
+
|
|
99
|
+
- `handle_unique_id`: persist this for retries in the same delegated conversation
|
|
100
|
+
- `agent_session_uid`: use this as `<target_agent_session_uid>` for A2A chat
|
|
101
|
+
- `session`: the target backend `AgentSession` payload
|
|
102
|
+
|
|
103
|
+
Allocation is separate from sending. Do not combine these into a fake one-step command.
|
|
104
|
+
|
|
105
|
+
## Communication Flow With CLI
|
|
106
|
+
|
|
107
|
+
1. Decide whether actual A2A communication is needed.
|
|
108
|
+
2. If your agent type is `orchestrator` and the request is user-originated, obtain user
|
|
109
|
+
confirmation before sending the A2A request.
|
|
110
|
+
3. Build a bounded request:
|
|
111
|
+
- clearly scoped task
|
|
112
|
+
- required response format or output schema if needed
|
|
113
|
+
4. Ensure you have the target session UID.
|
|
114
|
+
5. Send the request through the backend-managed session command:
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
mainsequence agent session a2a_chat \
|
|
118
|
+
<target_agent_session_uid> \
|
|
119
|
+
--message "Review the current portfolio drift." \
|
|
120
|
+
--timeout 120 \
|
|
121
|
+
--json
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
For raw A2A JSON-RPC:
|
|
125
|
+
|
|
126
|
+
```bash
|
|
127
|
+
mainsequence agent session a2a_chat \
|
|
128
|
+
<target_agent_session_uid> \
|
|
129
|
+
--a2a-payload-file request.json \
|
|
130
|
+
--timeout 120 \
|
|
131
|
+
--json
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
The command handles:
|
|
135
|
+
|
|
136
|
+
- optional runtime readiness waiting
|
|
137
|
+
- backend transport to the target runtime
|
|
138
|
+
- task polling until stable when enabled
|
|
139
|
+
- normalized response extraction
|
|
140
|
+
|
|
141
|
+
Do not manually call:
|
|
142
|
+
|
|
143
|
+
- `mainsequence agent session resolve_runtime_access ...` for normal A2A
|
|
144
|
+
- `curl "$RPC_URL/health"`
|
|
145
|
+
- `curl "$RPC_URL/api/a2a/chat"`
|
|
146
|
+
|
|
147
|
+
## Communication Flow With Python
|
|
148
|
+
|
|
149
|
+
Use the session-scoped SDK helper when running inside an agent runtime or project code:
|
|
150
|
+
|
|
151
|
+
```python
|
|
152
|
+
from mainsequence.client.agent_runtime_models import AgentSession
|
|
153
|
+
|
|
154
|
+
result = AgentSession.send_a2a_chat(
|
|
155
|
+
target_agent_session_uid,
|
|
156
|
+
message="Review the current portfolio drift.",
|
|
157
|
+
runtime_ready_timeout_seconds=60,
|
|
158
|
+
runtime_ready_poll_interval_seconds=2,
|
|
159
|
+
timeout=120,
|
|
160
|
+
)
|
|
161
|
+
|
|
162
|
+
text = result.normalized.text if result.normalized is not None else ""
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
For raw A2A JSON-RPC:
|
|
166
|
+
|
|
167
|
+
```python
|
|
168
|
+
result = AgentSession.send_a2a_chat(
|
|
169
|
+
target_agent_session_uid,
|
|
170
|
+
a2a_payload={
|
|
171
|
+
"jsonrpc": "2.0",
|
|
172
|
+
"id": "request-1",
|
|
173
|
+
"method": "message/send",
|
|
174
|
+
"params": {
|
|
175
|
+
"message": {
|
|
176
|
+
"kind": "message",
|
|
177
|
+
"messageId": "message-1",
|
|
178
|
+
"role": "user",
|
|
179
|
+
"parts": [
|
|
180
|
+
{
|
|
181
|
+
"kind": "text",
|
|
182
|
+
"text": "Review the current portfolio drift.",
|
|
183
|
+
}
|
|
184
|
+
],
|
|
185
|
+
}
|
|
186
|
+
},
|
|
187
|
+
},
|
|
188
|
+
timeout=120,
|
|
189
|
+
)
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
If no target session exists yet in Python, allocation is still a separate step:
|
|
193
|
+
|
|
194
|
+
```python
|
|
195
|
+
from mainsequence.client.agent_runtime_models import Agent, AgentSession
|
|
196
|
+
|
|
197
|
+
target_agent = Agent.get_by_uid(target_agent_uid)
|
|
198
|
+
allocation = target_agent.allocate_a2a_target_session(
|
|
199
|
+
caller_agent_session_uid=caller_agent_session_uid,
|
|
200
|
+
handle_unique_id=existing_handle_unique_id,
|
|
201
|
+
timeout=120,
|
|
202
|
+
)
|
|
203
|
+
|
|
204
|
+
target_session_uid = allocation["agent_session_uid"]
|
|
205
|
+
result = AgentSession.send_a2a_chat(
|
|
206
|
+
target_session_uid,
|
|
207
|
+
message="Review the current portfolio drift.",
|
|
208
|
+
timeout=120,
|
|
209
|
+
)
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
## Runtime Readiness
|
|
213
|
+
|
|
214
|
+
Normally, `a2a_chat` asks the backend to wait for runtime readiness before sending.
|
|
215
|
+
|
|
216
|
+
Use an explicit readiness check only when debugging or when you need to separate readiness
|
|
217
|
+
from message sending:
|
|
218
|
+
|
|
219
|
+
```bash
|
|
220
|
+
mainsequence agent session wait_runtime_ready \
|
|
221
|
+
<target_agent_session_uid> \
|
|
222
|
+
--timeout-seconds 60 \
|
|
223
|
+
--poll-interval-seconds 2 \
|
|
224
|
+
--json
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
Python equivalent:
|
|
228
|
+
|
|
229
|
+
```python
|
|
230
|
+
from mainsequence.client.agent_runtime_models import AgentSession
|
|
231
|
+
|
|
232
|
+
ready = AgentSession.wait_until_runtime_ready(
|
|
233
|
+
target_agent_session_uid,
|
|
234
|
+
timeout_seconds=60,
|
|
235
|
+
poll_interval_seconds=2,
|
|
236
|
+
timeout=120,
|
|
237
|
+
)
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
## Low-Level Runtime Debugging
|
|
241
|
+
|
|
242
|
+
Use runtime access resolution only for debugging:
|
|
243
|
+
|
|
244
|
+
```bash
|
|
245
|
+
mainsequence agent session resolve_runtime_access <target_agent_session_uid> --json
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
This returns runtime access metadata and is not the normal communication path.
|
|
249
|
+
|
|
250
|
+
## Handle Reuse
|
|
251
|
+
|
|
252
|
+
`handle_unique_id` is the stable delegated-conversation reuse key returned by allocation.
|
|
253
|
+
|
|
254
|
+
- If the delegated conversation is new, omit `--handle-unique-id` during allocation.
|
|
255
|
+
- The backend generates and returns a new `handle_unique_id`; persist it immediately.
|
|
256
|
+
- If you retry because of timeout, disconnect, readiness delay, stream restart, or runtime
|
|
257
|
+
error recovery, allocate again with the same `handle_unique_id`.
|
|
258
|
+
- Reusing the same handle tells the backend to return the same delegated `AgentSession`.
|
|
259
|
+
- Allocate a fresh handle only when you intentionally want a new delegated conversation.
|
|
260
|
+
|
|
261
|
+
## Deterministic Execution Path
|
|
262
|
+
|
|
263
|
+
1. Build the discovery prompt.
|
|
264
|
+
2. Run `mainsequence agent search "<discoveryPrompt>" --limit <n> --json`.
|
|
265
|
+
3. Parse the JSON output.
|
|
266
|
+
4. Normalize candidates.
|
|
267
|
+
5. Select the preferred candidate.
|
|
268
|
+
6. Get or allocate the target session UID.
|
|
269
|
+
7. Send with `mainsequence agent session a2a_chat <target_agent_session_uid> ... --json`
|
|
270
|
+
or `AgentSession.send_a2a_chat(...)`.
|
|
271
|
+
8. Persist `handle_unique_id` from allocation for retries.
|
|
272
|
+
9. Treat `normalized.text` as the primary concise target-agent answer when present.
|
|
273
|
+
|
|
274
|
+
## Role-Specific Behavior
|
|
275
|
+
|
|
276
|
+
### Orchestrator Agent
|
|
277
|
+
|
|
278
|
+
- May discover candidates without confirmation.
|
|
279
|
+
- Must get user confirmation before sending a real A2A request for user-originated requests.
|
|
280
|
+
- Should offer A2A briefly when another agent may be better suited.
|
|
281
|
+
|
|
282
|
+
### Runtime-Owned Child Or Executor Agent
|
|
283
|
+
|
|
284
|
+
- May use bounded A2A within the active task scope without separate user confirmation.
|
|
285
|
+
- Should keep the request tightly scoped to the current project or active task.
|
|
286
|
+
|
|
287
|
+
## A2A Response Behavior
|
|
288
|
+
|
|
289
|
+
- If the request is marked as A2A, respond agent-to-agent rather than user-to-agent.
|
|
290
|
+
- If a response format or output schema is specified, follow it exactly.
|
|
291
|
+
- If no response format is specified, return a concise machine-usable response.
|
|
292
|
+
- Keep A2A responses concise and machine-usable when the caller requested that shape.
|
|
293
|
+
|
|
294
|
+
## Do Not
|
|
295
|
+
|
|
296
|
+
- Do not let A2A broaden your scope.
|
|
297
|
+
- Do not replace CLI discovery with ad hoc local prompt-file inspection.
|
|
298
|
+
- Do not send another agent work when discovery alone was the requested goal.
|
|
299
|
+
- Do not manually extract `rpc_url` or `token` for normal A2A communication.
|
|
300
|
+
- Do not call target runtime `/health` or `/api/a2a/chat` directly for normal A2A communication.
|
|
301
|
+
- Do not invent one-step commands that require both target agent UID and target session behavior.
|
|
@@ -598,11 +598,7 @@ def get_logged_user_details() -> dict[str, Any]:
|
|
|
598
598
|
try:
|
|
599
599
|
who = authed("GET", AUTH_PATHS["ping"])
|
|
600
600
|
data = who.json() if who.ok else {}
|
|
601
|
-
user_uid = (
|
|
602
|
-
data.get("uid")
|
|
603
|
-
or (data.get("user") or {}).get("uid")
|
|
604
|
-
or data.get("user_uid")
|
|
605
|
-
)
|
|
601
|
+
user_uid = data.get("uid") or (data.get("user") or {}).get("uid") or data.get("user_uid")
|
|
606
602
|
if user_uid in (None, ""):
|
|
607
603
|
raise ApiError("Could not determine the authenticated user uid.")
|
|
608
604
|
|
|
@@ -1239,6 +1235,62 @@ def get_agent_latest_session(
|
|
|
1239
1235
|
raise ApiError(f"Agent latest session fetch failed: {e}") from e
|
|
1240
1236
|
|
|
1241
1237
|
|
|
1238
|
+
def list_agent_sessions(
|
|
1239
|
+
*,
|
|
1240
|
+
timeout: int | None = None,
|
|
1241
|
+
filters: dict[str, Any] | None = None,
|
|
1242
|
+
agent_uid: str | None = None,
|
|
1243
|
+
agent_unique_id: str | None = None,
|
|
1244
|
+
) -> list[dict[str, Any]]:
|
|
1245
|
+
"""
|
|
1246
|
+
List agent sessions via SDK client model, optionally scoped to one agent.
|
|
1247
|
+
"""
|
|
1248
|
+
if agent_uid and agent_unique_id:
|
|
1249
|
+
raise ApiError("Pass either agent_uid or agent_unique_id, not both.")
|
|
1250
|
+
|
|
1251
|
+
session_filters = dict(filters or {})
|
|
1252
|
+
if agent_uid:
|
|
1253
|
+
session_filters["agent_uid"] = str(agent_uid)
|
|
1254
|
+
elif agent_unique_id:
|
|
1255
|
+
try:
|
|
1256
|
+
agent = _run_sdk_model_operation(
|
|
1257
|
+
module_name="mainsequence.client.agent_runtime_models",
|
|
1258
|
+
class_name="Agent",
|
|
1259
|
+
operation=lambda ClientAgent: ClientAgent.get_by_agent_unique_id(
|
|
1260
|
+
str(agent_unique_id), timeout=timeout
|
|
1261
|
+
),
|
|
1262
|
+
)
|
|
1263
|
+
except Exception as e:
|
|
1264
|
+
err_name = type(e).__name__
|
|
1265
|
+
if err_name in {"DoesNotExist", "NotFoundError"}:
|
|
1266
|
+
raise ApiError(f"Agent not found for agent_unique_id={agent_unique_id!r}") from e
|
|
1267
|
+
if isinstance(e, (ApiError, NotLoggedIn)):
|
|
1268
|
+
raise
|
|
1269
|
+
raise ApiError(
|
|
1270
|
+
f"Agent lookup failed for agent_unique_id={agent_unique_id!r}: {e}"
|
|
1271
|
+
) from e
|
|
1272
|
+
|
|
1273
|
+
resolved_agent = _sdk_object_to_dict(agent)
|
|
1274
|
+
resolved_agent_uid = str(resolved_agent.get("uid") or "").strip()
|
|
1275
|
+
if not resolved_agent_uid:
|
|
1276
|
+
raise ApiError(f"Agent lookup returned no uid for agent_unique_id={agent_unique_id!r}")
|
|
1277
|
+
session_filters["agent_uid"] = resolved_agent_uid
|
|
1278
|
+
|
|
1279
|
+
try:
|
|
1280
|
+
payload = _run_sdk_model_operation(
|
|
1281
|
+
module_name="mainsequence.client.agent_runtime_models",
|
|
1282
|
+
class_name="AgentSession",
|
|
1283
|
+
operation=lambda ClientAgentSession: ClientAgentSession.filter(
|
|
1284
|
+
timeout=timeout, **session_filters
|
|
1285
|
+
),
|
|
1286
|
+
)
|
|
1287
|
+
return [_sdk_object_to_dict(item) for item in list(payload or [])]
|
|
1288
|
+
except Exception as e:
|
|
1289
|
+
if isinstance(e, (ApiError, NotLoggedIn)):
|
|
1290
|
+
raise
|
|
1291
|
+
raise ApiError(f"Agent sessions fetch failed: {e}") from e
|
|
1292
|
+
|
|
1293
|
+
|
|
1242
1294
|
def get_agent_session(
|
|
1243
1295
|
agent_session_uid: str,
|
|
1244
1296
|
*,
|
|
@@ -1291,6 +1343,76 @@ def resolve_agent_session_runtime_access(
|
|
|
1291
1343
|
raise ApiError(f"Agent session runtime access resolve failed: {e}") from e
|
|
1292
1344
|
|
|
1293
1345
|
|
|
1346
|
+
def wait_agent_session_runtime_ready(
|
|
1347
|
+
agent_session_uid: str,
|
|
1348
|
+
*,
|
|
1349
|
+
timeout_seconds: float = 60,
|
|
1350
|
+
poll_interval_seconds: float = 2,
|
|
1351
|
+
timeout: int | None = None,
|
|
1352
|
+
) -> dict[str, Any]:
|
|
1353
|
+
"""
|
|
1354
|
+
Wait for one agent session runtime through SDK client model.
|
|
1355
|
+
"""
|
|
1356
|
+
try:
|
|
1357
|
+
ready = _run_sdk_model_operation(
|
|
1358
|
+
module_name="mainsequence.client.agent_runtime_models",
|
|
1359
|
+
class_name="AgentSession",
|
|
1360
|
+
operation=lambda ClientAgentSession: ClientAgentSession.wait_until_runtime_ready(
|
|
1361
|
+
str(agent_session_uid),
|
|
1362
|
+
timeout_seconds=timeout_seconds,
|
|
1363
|
+
poll_interval_seconds=poll_interval_seconds,
|
|
1364
|
+
timeout=timeout,
|
|
1365
|
+
),
|
|
1366
|
+
)
|
|
1367
|
+
return _sdk_object_to_dict(ready)
|
|
1368
|
+
except Exception as e:
|
|
1369
|
+
err_name = type(e).__name__
|
|
1370
|
+
if err_name == "NotFoundError":
|
|
1371
|
+
raise ApiError(f"Agent session not found: {agent_session_uid}") from e
|
|
1372
|
+
if isinstance(e, (ApiError, NotLoggedIn)):
|
|
1373
|
+
raise
|
|
1374
|
+
raise ApiError(f"Agent session runtime readiness failed: {e}") from e
|
|
1375
|
+
|
|
1376
|
+
|
|
1377
|
+
def send_agent_session_a2a_chat(
|
|
1378
|
+
agent_session_uid: str,
|
|
1379
|
+
*,
|
|
1380
|
+
message: str | None = None,
|
|
1381
|
+
a2a_payload: dict[str, Any] | None = None,
|
|
1382
|
+
wait_for_runtime: bool = True,
|
|
1383
|
+
runtime_ready_timeout_seconds: float = 60,
|
|
1384
|
+
runtime_ready_poll_interval_seconds: float = 2,
|
|
1385
|
+
poll_task_until_stable: bool = True,
|
|
1386
|
+
timeout: int | None = None,
|
|
1387
|
+
) -> dict[str, Any]:
|
|
1388
|
+
"""
|
|
1389
|
+
Send an A2A request to one existing agent session through SDK client model.
|
|
1390
|
+
"""
|
|
1391
|
+
try:
|
|
1392
|
+
chat = _run_sdk_model_operation(
|
|
1393
|
+
module_name="mainsequence.client.agent_runtime_models",
|
|
1394
|
+
class_name="AgentSession",
|
|
1395
|
+
operation=lambda ClientAgentSession: ClientAgentSession.send_a2a_chat(
|
|
1396
|
+
str(agent_session_uid),
|
|
1397
|
+
message=message,
|
|
1398
|
+
a2a_payload=a2a_payload,
|
|
1399
|
+
wait_for_runtime=wait_for_runtime,
|
|
1400
|
+
runtime_ready_timeout_seconds=runtime_ready_timeout_seconds,
|
|
1401
|
+
runtime_ready_poll_interval_seconds=runtime_ready_poll_interval_seconds,
|
|
1402
|
+
poll_task_until_stable=poll_task_until_stable,
|
|
1403
|
+
timeout=timeout,
|
|
1404
|
+
),
|
|
1405
|
+
)
|
|
1406
|
+
return _sdk_object_to_dict(chat)
|
|
1407
|
+
except Exception as e:
|
|
1408
|
+
err_name = type(e).__name__
|
|
1409
|
+
if err_name == "NotFoundError":
|
|
1410
|
+
raise ApiError(f"Agent session not found: {agent_session_uid}") from e
|
|
1411
|
+
if isinstance(e, (ApiError, NotLoggedIn)):
|
|
1412
|
+
raise
|
|
1413
|
+
raise ApiError(f"Agent session A2A chat failed: {e}") from e
|
|
1414
|
+
|
|
1415
|
+
|
|
1294
1416
|
def list_agent_users_can_view(
|
|
1295
1417
|
agent_uid: str,
|
|
1296
1418
|
*,
|
|
@@ -3226,11 +3348,11 @@ def _adapter_from_api_public_config_payload(
|
|
|
3226
3348
|
dedupe_in_flight: bool | None = None,
|
|
3227
3349
|
) -> dict[str, Any]:
|
|
3228
3350
|
public_config_model = _adapter_from_api_public_config_model()
|
|
3229
|
-
normalized_api_base_url =
|
|
3351
|
+
normalized_api_base_url = (
|
|
3352
|
+
api_base_url.strip() if isinstance(api_base_url, str) else api_base_url
|
|
3353
|
+
)
|
|
3230
3354
|
normalized_debug_api_base_url = (
|
|
3231
|
-
debug_api_base_url.strip()
|
|
3232
|
-
if isinstance(debug_api_base_url, str)
|
|
3233
|
-
else debug_api_base_url
|
|
3355
|
+
debug_api_base_url.strip() if isinstance(debug_api_base_url, str) else debug_api_base_url
|
|
3234
3356
|
)
|
|
3235
3357
|
normalized_api_base_url = normalized_api_base_url or None
|
|
3236
3358
|
normalized_debug_api_base_url = normalized_debug_api_base_url or None
|
|
@@ -3274,7 +3396,9 @@ def _adapter_from_api_public_config_payload(
|
|
|
3274
3396
|
try:
|
|
3275
3397
|
if public_config is not None:
|
|
3276
3398
|
payload = dict(public_config)
|
|
3277
|
-
payload.update(
|
|
3399
|
+
payload.update(
|
|
3400
|
+
{key: value for key, value in alias_updates.items() if value is not None}
|
|
3401
|
+
)
|
|
3278
3402
|
config = public_config_model.model_validate(payload)
|
|
3279
3403
|
elif normalized_debug_api_base_url is not None:
|
|
3280
3404
|
config = public_config_model.direct(
|
|
@@ -3293,7 +3417,9 @@ def _adapter_from_api_public_config_payload(
|
|
|
3293
3417
|
"Adapter from API public config is required. Provide api_base_url, "
|
|
3294
3418
|
"debug_api_base_url, or public_config."
|
|
3295
3419
|
)
|
|
3296
|
-
payload.update(
|
|
3420
|
+
payload.update(
|
|
3421
|
+
{key: value for key, value in alias_updates.items() if value is not None}
|
|
3422
|
+
)
|
|
3297
3423
|
config = public_config_model.model_validate(payload)
|
|
3298
3424
|
except ApiError:
|
|
3299
3425
|
raise
|