一键导入
a2a-communication
Canonical guidance for discovering agents and sending session-scoped A2A requests through Main Sequence.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Canonical guidance for discovering agents and sending session-scoped A2A requests through Main Sequence.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | a2a_communication |
| description | Canonical guidance for discovering agents and sending session-scoped A2A requests through Main Sequence. |
Use this skill when you need to discover another agent, create or resolve a
target AgentSession, and send a bounded A2A request.
Use the standard A2A CLI send command. The CLI resolves the target runtime internally and sends a standard A2A message.
AgentSession UID.AgentSession UID for chat.--strict-dictionary when the target answer must be machine-parseable JSON.mainsequence agent search "<discoveryPrompt>" --limit 10 --json
combined_score when present.After selecting the target agent, create or resolve a target session:
mainsequence agent session get_or_create \
<target_agent_uid> \
--handle-unique-id <stable_handle_unique_id> \
--name "<human_readable_session_name>" \
--json
Use the returned session uid as the target AgentSession UID.
If this A2A request originates from an existing caller session, include the parent session UID:
mainsequence agent session get_or_create \
<target_agent_uid> \
--handle-unique-id <stable_handle_unique_id> \
--parent-session-uid <caller_agent_session_uid> \
--name "<human_readable_session_name>" \
--json
Handle rules:
portfolio-review-q2-2026.a2a-risk-summary-<uuid>.For JSON-shaped answers, use:
mainsequence agent session a2a send \
<target_agent_session_uid> \
--message "Return a JSON object with keys: summary, risk_level, next_action." \
--strict-dictionary
For plain text answers, use:
mainsequence agent session a2a send \
<target_agent_session_uid> \
--message "Summarize the current portfolio drift."
For a second message to the same target session, send another chat command
with the same target AgentSession UID:
mainsequence agent session a2a send \
<target_agent_session_uid> \
--message "Now identify the highest priority follow-up."
For repeated communication with the same target agent, use a stable handle. On first use, include the target agent UID so the CLI can create or resolve the target session and cache the returned session UID:
mainsequence agent session a2a send \
<stable_handle_unique_id> \
--target-agent-uid <target_agent_uid> \
--message "Return a JSON object with keys: summary, risk_level, next_action." \
--strict-dictionary
--name is optional and only affects the session if the backend creates it:
mainsequence agent session a2a send \
portfolios \
--target-agent-uid <target_agent_uid> \
--name "Portfolio analysis" \
--message "Return a JSON object with keys: summary, risk_level, next_action." \
--strict-dictionary
After the handle is cached, reuse it without the target agent UID:
mainsequence agent session a2a send \
portfolios \
--message "Now identify the highest priority follow-up." \
--strict-dictionary
A2A can send inline files as raw parts. For PDFs, use --file; the CLI reads
the file bytes, enforces the 15 MiB inline limit, base64 encodes the bytes, and
sends the part with filename and mediaType.
mainsequence agent session a2a send \
<target_agent_session_uid> \
--message "Please summarize this PDF." \
--file report.pdf \
--media-type application/pdf
The same handle shortcut works with files:
mainsequence agent session a2a send \
portfolios \
--message "Please summarize this PDF." \
--file report.pdf \
--media-type application/pdf
For retries of the exact same message and file attachment, reuse the same
--message-id.
In Python, use the backend handle to get or create the target session, then reuse the returned session UID for every message in the same conversation. The binding is:
handle_unique_id -> AgentSession.uid -> A2A message.contextId
Direct SDK flow:
from mainsequence.client.agent_runtime_models import Agent, AgentSession
agent = Agent.get_by_uid(target_agent_uid)
session = agent.get_or_create_session(
handle_unique_id="portfolios",
name="Portfolio analysis",
)
response = AgentSession.send_a2a_message(
session.uid,
message="Return a JSON object with keys: summary, risk_level, next_action.",
strict_dictionary=True,
)
For another message in the same conversation, reuse the same session.uid:
response = AgentSession.send_a2a_message(
session.uid,
message="Now identify the highest priority follow-up.",
strict_dictionary=True,
)
To send a PDF, pass a file attachment. The SDK reads the raw bytes, enforces the
15 MiB inline limit, base64 encodes them, and sends filename plus mediaType:
response = AgentSession.send_a2a_message(
session.uid,
message="Please summarize this PDF.",
files=[
{
"path": "report.pdf",
"media_type": "application/pdf",
"filename": "report.pdf",
}
],
)
Reusable helper:
from mainsequence.client.agent_runtime_models import Agent, AgentSession
def send_to_agent_handle(
target_agent_uid: str,
handle_unique_id: str,
message: str,
*,
name: str | None = None,
files: list[dict[str, str]] | None = None,
strict_dictionary: bool = False,
):
agent = Agent.get_by_uid(target_agent_uid)
session = agent.get_or_create_session(
handle_unique_id=handle_unique_id,
name=name,
)
return AgentSession.send_a2a_message(
session.uid, # The SDK sends this as A2A message.contextId.
message=message,
files=files,
strict_dictionary=strict_dictionary,
)
Use the same handle_unique_id for the same target conversation. Use a new
handle for a different task or conversation.
message.parts from the A2A response.--message-id value so the target can treat it as the same logical message.A2A message id for exact retry value printed with the error.mainsequence agent search "<discoveryPrompt>" --limit <n> --json.mainsequence agent session get_or_create.uid.mainsequence agent session a2a send <target_agent_session_uid> ....message.parts from the CLI output.Use this skill when the task is about operational execution in a Main Sequence project. This skill owns jobs, schedules, batch scheduling files, project images, run inspection, project resources, releases, Streamlit dashboard deployment, and Artifacts as operational inputs. It does not own DataNode producer design, MetaTable schema design, API route contracts, Streamlit dashboard design, or RBAC policy.
Reviews a Main Sequence project for status, blockers, failures, and completion.
Use this skill to bootstrap work in a Main Sequence repository. This skill owns project context verification, docs-first behavior, success-definition discipline, routing between specialized domain skills, and project-state file discipline. It does not own domain implementation semantics.
Use this skill when the task is about selecting, creating, validating, or documenting Command Center connections before workspace widgets consume data. This skill owns connection type discovery, connection instance readiness, query model/output-contract checks, connection-first workspace dataflow, and routing backend adapter gaps. Use this before creating data-consuming widgets. It does not own workspace layout, widget JSON mutation, AppComponent form contracts, or generic FastAPI implementation.
Use this skill when the task is about translating user intent into a Main Sequence Command Center workspace concept. This skill owns workspace design, widget selection, visualization strategy, information architecture, connection-first dataflow planning, and deciding which widgets best express a business idea. It does not mutate workspace JSON, patch mounted widgets, create connections, create FastAPI endpoints, or create project resources/releases.
Use this skill when the task is to discover what `DataNode` or `MetaTable` data already exists on the Main Sequence platform before implementation starts.