Release seal-home 0.3.0 skill workflow
This commit is contained in:
1 parent
0ff2aeebbb
commit
871bef3e4f
8 files changed
+599
-22
No files matched your search
@@ -0,0 +1,175 @@
|
||||
---
|
||||
name: seal-home
|
||||
description: Use when working with Seal Home / seal-home approval automation: querying Seal enterprise identity, approval rules, approval knowledge documents, approval style preferences, approval run history, simulation batch records, and Langfuse trace/session bridge hints. Prefer this skill when the user mentions Seal, seal_home MCP, 合思/易快报 approval runs, approval rule/document maintenance, approval simulations, or debugging Seal approval execution traces.
|
||||
---
|
||||
|
||||
# Seal Home
|
||||
|
||||
## Quick Start
|
||||
|
||||
Run commands from the seal-home repository root:
|
||||
|
||||
```bash
|
||||
bun run cli -- help
|
||||
bun run cli -- tools list
|
||||
```
|
||||
|
||||
Use CLI for broad or detailed operations. Use MCP for narrow, high-frequency agent entry points only. The CLI intentionally exposes the full fine-grained tool list; MCP intentionally advertises a small surface to reduce model context.
|
||||
|
||||
## Decision Guide
|
||||
|
||||
- For current identity or tenant: use `bun run cli -- tool seal_whoami`.
|
||||
- For configured enterprises: use `bun run cli -- corps list`.
|
||||
- For source-derived enterprise config: use `bun run cli -- source config`.
|
||||
- For daily approval run questions: use `bun run cli -- approval-runs summary --date YYYY-MM-DD --timezone Asia/Shanghai`.
|
||||
- For approval run lookup by document SN, ID, status, mode, or trace: use `bun run cli -- approval-runs search`.
|
||||
- For Langfuse lookup hints: use `bun run cli -- approval-runs bridge`.
|
||||
- For one simulation batch: use `bun run cli -- simulation batch-records <batchId>`.
|
||||
- For approval rule/document/style maintenance: use `bun run cli -- tool <toolName> --json '{...}'`.
|
||||
|
||||
## Task Playbooks
|
||||
|
||||
### Diagnose one approval document
|
||||
|
||||
Use when the user gives a 合思/易快报单号, Seal source document SN, source document ID, or asks why one approval did or did not pass.
|
||||
|
||||
1. Search runs:
|
||||
|
||||
```bash
|
||||
bun run cli -- approval-runs search --query <document-or-trace-key> --limit 50
|
||||
```
|
||||
|
||||
2. If a likely record is found, get bridge hints:
|
||||
|
||||
```bash
|
||||
bun run cli -- approval-runs bridge --sourceDocumentSN <sourceDocumentSN>
|
||||
```
|
||||
|
||||
3. Report `status`, `taskMode`, `finalExecutionMode`, `recordId`, `simulationBatchId`, `langfuseTraceId`, and `langfuseSessionFallback`. If `langfuseTraceId` is absent, tell the caller to use the session fallback.
|
||||
|
||||
### Summarize one day of approval runs
|
||||
|
||||
Use explicit local date and timezone:
|
||||
|
||||
```bash
|
||||
bun run cli -- approval-runs summary --date YYYY-MM-DD --timezone Asia/Shanghai --limit 100
|
||||
```
|
||||
|
||||
Report matched count, status counts, task mode counts, and the most relevant failed or simulated records. If `matched` is unexpectedly low, rerun with broader `limit` or targeted `query`.
|
||||
|
||||
### Inspect a simulation batch
|
||||
|
||||
```bash
|
||||
bun run cli -- simulation batch-records <batchId>
|
||||
```
|
||||
|
||||
Summarize count, statuses, source document identifiers, and bridge hints. For failures, preserve record IDs so another tool can inspect the trace.
|
||||
|
||||
### Search approval knowledge
|
||||
|
||||
Use for "which rule/document mentions X" or before changing rule/document content:
|
||||
|
||||
```bash
|
||||
bun run cli -- tool seal_approval_search --json '{"keywords":["关键词"],"matchMode":"any","maxResults":20}'
|
||||
```
|
||||
|
||||
Use `areas` to narrow to `rules`, `documents`, or `preferences`. Use `refresh:true` when recent edits may not be reflected in the in-memory cache.
|
||||
|
||||
### Update approval rules
|
||||
|
||||
Write workflow:
|
||||
|
||||
1. Read current rules with `seal_approval_rules_list` or `seal_approval_context_get`.
|
||||
2. Identify the exact rule ID or create payload.
|
||||
3. Present the intended change and ask for confirmation.
|
||||
4. Run `seal_approval_rule_create`, `seal_approval_rule_update`, or `seal_approval_rule_delete`.
|
||||
5. Read rules again to verify.
|
||||
6. Publish only when explicitly requested, using `seal_approval_rule_version_publish` with a clear `versionName`.
|
||||
|
||||
### Update approval documents
|
||||
|
||||
Write workflow:
|
||||
|
||||
1. List or fetch the target document.
|
||||
2. Present the intended title/purpose/content/status/scenario/tag change.
|
||||
3. Ask for confirmation.
|
||||
4. Run `seal_approval_document_create` or `seal_approval_document_update`.
|
||||
5. Fetch the document again to verify.
|
||||
|
||||
There is no dedicated delete command in the current CLI. If deactivation is intended and the API supports it, update with `enabled:false`.
|
||||
|
||||
### Update style preferences
|
||||
|
||||
Read first:
|
||||
|
||||
```bash
|
||||
bun run cli -- tool seal_approval_style_preferences_get
|
||||
```
|
||||
|
||||
Then update only explicit fields:
|
||||
|
||||
```bash
|
||||
bun run cli -- tool seal_approval_style_preferences_update --json '{"tone":"...","language":"..."}'
|
||||
```
|
||||
|
||||
Verify by reading again.
|
||||
|
||||
## Important Fields
|
||||
|
||||
- `sourceDocumentSN`: external source document number, often the easiest 合思/易快报 lookup key.
|
||||
- `sourceDocumentId`: external source document ID.
|
||||
- `status`: run status such as completed or failed.
|
||||
- `taskMode`: execution mode category such as assisted or simulation.
|
||||
- `finalExecutionMode`: final mode chosen by the approval agent.
|
||||
- `recordId`: Seal approval run record ID.
|
||||
- `simulationBatchId`: simulation batch identifier when the run came from a batch.
|
||||
- `langfuseTraceId`: direct Langfuse trace lookup key when present.
|
||||
- `langfuseSessionFallback`: fallback session key, usually `hosecloud-{sourceDocumentSN}`, when direct trace ID is absent.
|
||||
|
||||
## MCP Boundary
|
||||
|
||||
The MCP server advertises only these tools:
|
||||
|
||||
- `seal_corp_switch`
|
||||
- `seal_whoami`
|
||||
- `seal_approval_search`
|
||||
- `seal_approval_context_get`
|
||||
- `seal_runs_search`
|
||||
- `seal_action`
|
||||
|
||||
Do not add every backend API operation as an MCP tool. Add stable, frequent read operations directly; route low-frequency management through `seal_action` or CLI.
|
||||
|
||||
`seal_action` examples:
|
||||
|
||||
```json
|
||||
{ "action": "help", "payload": { "topic": "rule" } }
|
||||
{ "action": "rule.create", "payload": { "description": "...", "scope": "...", "strictness": "SHOULD_FOLLOW" } }
|
||||
{ "action": "doc.update", "payload": { "documentId": "...", "content": "..." } }
|
||||
{ "action": "runs.summary", "payload": { "date": "2026-06-09", "timezone": "Asia/Shanghai" } }
|
||||
{ "action": "langfuse.bridge.get", "payload": { "sourceDocumentSN": "B26001887" } }
|
||||
```
|
||||
|
||||
## CLI Patterns
|
||||
|
||||
Read `references/cli.md` when you need the full tool list, parameter examples, or maintenance commands.
|
||||
|
||||
Preferred command forms:
|
||||
|
||||
```bash
|
||||
bun run cli -- approval-runs summary --date 2026-06-09 --timezone Asia/Shanghai
|
||||
bun run cli -- approval-runs search --query B26001887 --limit 20 --includeBridge true
|
||||
bun run cli -- approval-runs bridge --sourceDocumentSN B26001887
|
||||
bun run cli -- tool seal_approval_search --json '{"keywords":["差旅","发票"],"areas":["rules","documents"]}'
|
||||
```
|
||||
|
||||
## Output Handling
|
||||
|
||||
CLI output is JSON on stdout. Parse JSON instead of scraping text. Keep broad responses compact: avoid `includeBridge true` unless trace/session bridge rows are needed.
|
||||
|
||||
For date-based questions, use explicit dates and timezone. Default timezone is usually `Asia/Shanghai`; pass it explicitly when answering business questions.
|
||||
|
||||
## Safety
|
||||
|
||||
Rule, document, style preference, and publish actions mutate Seal configuration. Before running write operations, make sure the target enterprise is clear and the requested payload is explicit. Prefer listing or fetching the current state before update/delete/publish.
|
||||
|
||||
For public or shared use, assume the CLI runs locally with the user's own credentials. Do not send real `enterprises/*.json` files to GitHub, chat, logs, or tickets.
|
||||
@@ -0,0 +1,4 @@
|
||||
interface:
|
||||
display_name: "Seal Home"
|
||||
short_description: "Use Seal approval context and run diagnostics"
|
||||
default_prompt: "Use $seal-home to inspect Seal approval rules, documents, run history, and Langfuse trace hints."
|
||||
@@ -0,0 +1,190 @@
|
||||
# Seal Home CLI Reference
|
||||
|
||||
Run from the repository root:
|
||||
|
||||
```bash
|
||||
bun run cli -- <command>
|
||||
```
|
||||
|
||||
## Top-Level Commands
|
||||
|
||||
```bash
|
||||
bun run cli -- tools list
|
||||
bun run cli -- corps list [--corp <corpId>]
|
||||
bun run cli -- source config [--corp <corpId>]
|
||||
bun run cli -- tool <toolName> [--corp <corpId>] [--json '{"key":"value"}']
|
||||
bun run cli -- approval-runs summary [--date YYYY-MM-DD] [--timezone Asia/Shanghai]
|
||||
bun run cli -- approval-runs search [--query text] [--limit 20] [--includeBridge true]
|
||||
bun run cli -- approval-runs bridge [--sourceDocumentSN B26001887]
|
||||
bun run cli -- simulation batch-records <batchId>
|
||||
```
|
||||
|
||||
## Fine-Grained Tools
|
||||
|
||||
Identity and session:
|
||||
|
||||
- `seal_whoami`
|
||||
- `seal_session_get`
|
||||
|
||||
Approval rule maintenance:
|
||||
|
||||
- `seal_approval_rules_list`
|
||||
- `seal_approval_rule_create`
|
||||
- `seal_approval_rule_update`
|
||||
- `seal_approval_rule_delete`
|
||||
- `seal_approval_rule_versions_list`
|
||||
- `seal_approval_rule_version_publish`
|
||||
|
||||
Approval knowledge documents:
|
||||
|
||||
- `seal_approval_documents_list`
|
||||
- `seal_approval_document_get`
|
||||
- `seal_approval_document_create`
|
||||
- `seal_approval_document_update`
|
||||
|
||||
Approval search and context:
|
||||
|
||||
- `seal_approval_search`
|
||||
- `seal_approval_context_get`
|
||||
|
||||
Style preferences:
|
||||
|
||||
- `seal_approval_style_preferences_get`
|
||||
- `seal_approval_style_preferences_update`
|
||||
|
||||
Approval runs, simulations, and Langfuse bridge:
|
||||
|
||||
- `seal_approval_runs_search`
|
||||
- `seal_approval_runs_summary`
|
||||
- `seal_simulation_batch_records_get`
|
||||
- `seal_approval_run_langfuse_bridge_get`
|
||||
|
||||
## Common Examples
|
||||
|
||||
Search approval content:
|
||||
|
||||
```bash
|
||||
bun run cli -- tool seal_approval_search --json '{"keywords":["关键词"],"matchMode":"any","maxResults":20}'
|
||||
```
|
||||
|
||||
Get aggregated approval context:
|
||||
|
||||
```bash
|
||||
bun run cli -- tool seal_approval_context_get --json '{"documentLimit":20}'
|
||||
```
|
||||
|
||||
Create a draft approval rule:
|
||||
|
||||
```bash
|
||||
bun run cli -- tool seal_approval_rule_create --json '{"description":"规则描述","scope":"适用场景","strictness":"SHOULD_FOLLOW"}'
|
||||
```
|
||||
|
||||
Update an approval document:
|
||||
|
||||
```bash
|
||||
bun run cli -- tool seal_approval_document_update --json '{"documentId":"doc-id","content":"Markdown 内容"}'
|
||||
```
|
||||
|
||||
Summarize one local date:
|
||||
|
||||
```bash
|
||||
bun run cli -- approval-runs summary --date 2026-06-09 --timezone Asia/Shanghai --limit 100
|
||||
```
|
||||
|
||||
Find a run and include Langfuse bridge rows:
|
||||
|
||||
```bash
|
||||
bun run cli -- approval-runs search --query B26001887 --limit 20 --includeBridge true
|
||||
```
|
||||
|
||||
Resolve Langfuse trace/session hints:
|
||||
|
||||
```bash
|
||||
bun run cli -- approval-runs bridge --sourceDocumentSN B26001887
|
||||
```
|
||||
|
||||
Read simulation batch records:
|
||||
|
||||
```bash
|
||||
bun run cli -- simulation batch-records <batchId>
|
||||
```
|
||||
|
||||
## Write Operation Payloads
|
||||
|
||||
Create a rule:
|
||||
|
||||
```json
|
||||
{
|
||||
"description": "规则描述",
|
||||
"scope": "适用场景",
|
||||
"strictness": "MUST_FOLLOW | SHOULD_FOLLOW | SUGGESTION"
|
||||
}
|
||||
```
|
||||
|
||||
Update a rule:
|
||||
|
||||
```json
|
||||
{
|
||||
"ruleId": "rule-id",
|
||||
"description": "可选",
|
||||
"scope": "可选",
|
||||
"strictness": "SHOULD_FOLLOW"
|
||||
}
|
||||
```
|
||||
|
||||
Publish a rule version:
|
||||
|
||||
```json
|
||||
{
|
||||
"versionName": "版本名称"
|
||||
}
|
||||
```
|
||||
|
||||
Create a document:
|
||||
|
||||
```json
|
||||
{
|
||||
"title": "标题",
|
||||
"purpose": "用途",
|
||||
"content": "Markdown 内容",
|
||||
"contentType": "text/markdown",
|
||||
"status": "可选",
|
||||
"scenarios": ["场景"],
|
||||
"tags": ["标签"]
|
||||
}
|
||||
```
|
||||
|
||||
Update a document:
|
||||
|
||||
```json
|
||||
{
|
||||
"documentId": "doc-id",
|
||||
"title": "可选",
|
||||
"purpose": "可选",
|
||||
"content": "可选",
|
||||
"enabled": true,
|
||||
"scenarios": ["可选"],
|
||||
"tags": ["可选"]
|
||||
}
|
||||
```
|
||||
|
||||
Update style preferences:
|
||||
|
||||
```json
|
||||
{
|
||||
"tone": "可选",
|
||||
"language": "可选",
|
||||
"detailLevel": "可选",
|
||||
"outputFormat": "可选",
|
||||
"examples": ["可选"],
|
||||
"prohibitedPhrases": ["可选"],
|
||||
"customInstructions": "可选"
|
||||
}
|
||||
```
|
||||
|
||||
## Failure Handling
|
||||
|
||||
- If no run is found by `sourceDocumentSN`, retry with `sourceDocumentId` or a broader `query`.
|
||||
- If date-based summaries look wrong, pass `--timezone Asia/Shanghai` and an explicit `--date`.
|
||||
- If `langfuseTraceId` is missing, use `langfuseSessionFallback`.
|
||||
- If a write operation fails, report the raw JSON error and do not retry with guessed payloads.
|
||||
Reference in new issue
Block a user