diff --git a/internal/app/audit_command.go b/internal/app/audit_command.go index 5f241179..71bd2a17 100644 --- a/internal/app/audit_command.go +++ b/internal/app/audit_command.go @@ -87,6 +87,13 @@ func newAuditTailCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "idempotent", }, Contract: helpers.LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "audit", + Name: "tail", + CanonicalPath: "audit.tail", + CLIPath: "audit tail", + PrimaryCLIPath: "audit tail", + }, Description: "查看本地操作审计日志最近 N 条记录", Interface: &contract.InterfaceSpec{ Mode: "local", @@ -148,6 +155,13 @@ func newAuditExportCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "idempotent", }, Contract: helpers.LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "audit", + Name: "export", + CanonicalPath: "audit.export", + CLIPath: "audit export", + PrimaryCLIPath: "audit export", + }, Description: "按日期范围导出本地操作审计日志(jsonl 或 csv)", Interface: &contract.InterfaceSpec{ Mode: "local", @@ -227,6 +241,13 @@ func newAuditVerifyCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "idempotent", }, Contract: helpers.LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "audit", + Name: "verify", + CanonicalPath: "audit.verify", + CLIPath: "audit verify", + PrimaryCLIPath: "audit verify", + }, Description: "校验本地审计日志文件的哈希链完整性", Interface: &contract.InterfaceSpec{ Mode: "local", diff --git a/internal/app/event_command.go b/internal/app/event_command.go index ff316e6e..32b3b1d0 100644 --- a/internal/app/event_command.go +++ b/internal/app/event_command.go @@ -383,6 +383,13 @@ SIGTERM、关 stdin,或先用 dws event stop --dry-run 预览 Confirmation: "not_required", Idempotency: "non_idempotent", }, Contract: helpers.LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "event", + Name: "consume", + CanonicalPath: "event.consume", + CLIPath: "event consume", + PrimaryCLIPath: "event consume", + }, Description: "订阅并持续消费一个或多个兼容的个人事件;Agent 使用 --flatten 输出顶层业务 NDJSON", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -783,6 +790,13 @@ func newEventListCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "idempotent", }, Contract: helpers.LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "event", + Name: "list", + CanonicalPath: "event.list", + CLIPath: "event list", + PrimaryCLIPath: "event list", + }, Description: "列出支持的个人事件目录与状态说明", Interface: &contract.InterfaceSpec{ Mode: "local", @@ -874,6 +888,13 @@ func newEventStatusCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "idempotent", }, Contract: helpers.LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "event", + Name: "status", + CanonicalPath: "event.status", + CLIPath: "event status", + PrimaryCLIPath: "event status", + }, Description: "查看个人事件订阅、本地 bus 与消费进程状态", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -1207,6 +1228,13 @@ func newEventStopCommand() *cobra.Command { return nil }, Contract: helpers.LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "event", + Name: "stop", + CanonicalPath: "event.stop", + CLIPath: "event stop", + PrimaryCLIPath: "event stop", + }, Description: "取消个人事件订阅并停止对应本地消费", DryRun: &contract.DryRunSpec{PreviewKind: "request", RemoteReads: false}, Interface: &contract.InterfaceSpec{ diff --git a/internal/app/event_personal_command.go b/internal/app/event_personal_command.go index 738114d5..a86af7be 100644 --- a/internal/app/event_personal_command.go +++ b/internal/app/event_personal_command.go @@ -186,6 +186,13 @@ func newEventSchemaCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "idempotent", }, Contract: helpers.LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "event", + Name: "schema", + CanonicalPath: "event.schema", + CLIPath: "event schema", + PrimaryCLIPath: "event schema", + }, Description: "查询指定个人事件码的输出字段结构;Agent 应查询 --flatten 模式", Interface: &contract.InterfaceSpec{ Mode: "local", diff --git a/internal/app/mcp_url_command.go b/internal/app/mcp_url_command.go index f8231c06..70a02102 100644 --- a/internal/app/mcp_url_command.go +++ b/internal/app/mcp_url_command.go @@ -90,6 +90,13 @@ func newMCPURLGetCommand(caller edition.ToolCaller) *cobra.Command { Confirmation: "not_required", Idempotency: "idempotent", }, Contract: helpers.LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "mcp", + Name: "url_get", + CanonicalPath: "mcp.url_get", + CLIPath: "mcp url get", + PrimaryCLIPath: "mcp url get", + }, Description: "按 MCP 市场 mcpId 获取当前用户和组织可用的 Streamable HTTP 地址", Interface: &contract.InterfaceSpec{ Mode: "composite", diff --git a/internal/cli/contract_final_assembly_test.go b/internal/cli/contract_final_assembly_test.go index aac07285..1624ceba 100644 --- a/internal/cli/contract_final_assembly_test.go +++ b/internal/cli/contract_final_assembly_test.go @@ -41,6 +41,7 @@ func TestCrossPlatformCoverageRuntimeToolSpecFromContractFinalPassThrough(t *tes }, Identity: &contract.ToolIdentitySpec{ ProductID: "dev", Name: "create_thing", CanonicalPath: "dev.create_thing", + CLIPath: "dev create", PrimaryCLIPath: "dev create", }, }) @@ -120,6 +121,11 @@ func TestCrossPlatformCoverageRuntimeToolSpecFromContractFinalRejectsReviewedSel Command: &cobra.Command{Use: "create"}, } _, err := runtimeToolSpecFromContractFinal(entry, contract.ContractFinalPayload{ + Identity: &contract.ToolIdentitySpec{ + ProductID: "dev", Name: "create_thing", CanonicalPath: "dev.create_thing", + CLIPath: "dev create", PrimaryCLIPath: "dev create", + }, + Selection: &contract.SelectionSpec{AgentSummary: "sum", Reviewed: &reviewed}, }, runtimeSchemaMetadataSources{}) if err == nil { @@ -184,7 +190,11 @@ func TestCrossPlatformCoverageRuntimeToolSpecFromContractFinalSameLengthAliasMis } // Same-length alias sets with different members must be detected by the // element-wise comparison, not only by the length fast-path. - final := contract.ContractFinalPayload{Identity: &contract.ToolIdentitySpec{Aliases: []string{"dev other"}}} + final := contract.ContractFinalPayload{Identity: &contract.ToolIdentitySpec{ + ProductID: "dev", Name: "create_thing", CanonicalPath: "dev.create_thing", + CLIPath: "dev create", PrimaryCLIPath: "dev create", + Aliases: []string{"dev other"}, + }} _, err := runtimeToolSpecFromContractFinal(entry, final, runtimeSchemaMetadataSources{}) if err == nil || !strings.Contains(err.Error(), "aliases") { t.Fatalf("same-length alias mismatch error = %v, want aliases mismatch", err) diff --git a/internal/cli/runtime_schema_coverage_more_test.go b/internal/cli/runtime_schema_coverage_more_test.go index db542de9..f3933cab 100644 --- a/internal/cli/runtime_schema_coverage_more_test.go +++ b/internal/cli/runtime_schema_coverage_more_test.go @@ -87,6 +87,11 @@ func TestCrossPlatformCoverageRuntimeSchemaMetadataLookupEdges(t *testing.T) { leaf := &cobra.Command{Use: "reply"} RegisterRuntimeContractFinal(leaf, contract.ContractFinalPayload{ + Identity: &contract.ToolIdentitySpec{ + ProductID: "sample", Name: "run", CanonicalPath: "sample.run", + CLIPath: "sample run", PrimaryCLIPath: "sample run", + }, + Interface: &contract.InterfaceSpec{ Mode: contract.InterfaceModeMCP, Availability: contract.InterfaceAvailable, diff --git a/internal/cli/schema_cobra_binding.go b/internal/cli/schema_cobra_binding.go index 88dbc6e9..0157f34b 100644 --- a/internal/cli/schema_cobra_binding.go +++ b/internal/cli/schema_cobra_binding.go @@ -884,5 +884,86 @@ func validateCommandRegistryAnnotation(command *cobra.Command, path string, spec return fmt.Errorf("schema command registry %s path %q conflicts with native annotation %s", spec.CanonicalPath, path, nativeCanonical) } } + // ContractFinal.Identity is a pin against the reviewed registry entry. + // Registry remains authoritative; disagreement fails closed at bind time. + if final, ok := contractfinal.RuntimeContractFinal(command); ok { + if final.Identity == nil { + return fmt.Errorf("schema command registry %s path %q has ContractFinal without Identity", spec.CanonicalPath, path) + } + if err := validateContractIdentityAgainstCommandSpec(*final.Identity, spec, path); err != nil { + return err + } + } return nil } + +// validateContractIdentityAgainstCommandSpec requires declared Identity fields +// that map to the reviewed CommandRegistry entry to match exactly. Empty +// optional fields (cli_name/group/source) are allowed and filled from the +// bound entry at assembly; authored identity keys may not drift. +func validateContractIdentityAgainstCommandSpec(id contract.ToolIdentitySpec, spec CommandSpec, path string) error { + productID, toolName, ok := splitManualSchemaCanonicalPath(spec.CanonicalPath) + if !ok { + return fmt.Errorf("schema command registry %s path %q has invalid canonical path", spec.CanonicalPath, path) + } + mismatches := make([]string, 0, 8) + check := func(field, declared, bound string) { + declared = strings.TrimSpace(declared) + bound = strings.TrimSpace(bound) + if declared != bound { + mismatches = append(mismatches, fmt.Sprintf("%s: declared %q, registry %q", field, declared, bound)) + } + } + check("product_id", id.ProductID, productID) + check("name", id.Name, toolName) + check("canonical_path", id.CanonicalPath, spec.CanonicalPath) + primary := strings.TrimSpace(spec.PrimaryCLIPath) + cliPath := strings.TrimSpace(id.CLIPath) + primaryDecl := strings.TrimSpace(id.PrimaryCLIPath) + if cliPath == "" { + cliPath = primaryDecl + } + if primaryDecl == "" { + primaryDecl = cliPath + } + check("cli_path", cliPath, primary) + check("primary_cli_path", primaryDecl, primary) + // Registry decode defaults empty source_product_id to product_id; Identity + // may omit it. Normalize both to "" when equal to product_id. + check("source_product_id", normalizeIdentitySourceProduct(id.SourceProductID, productID), normalizeIdentitySourceProduct(spec.SourceProductID, productID)) + if !stringSlicesEqualAsSet(id.Aliases, spec.Aliases) { + mismatches = append(mismatches, fmt.Sprintf("aliases: declared %v, registry %v", id.Aliases, spec.Aliases)) + } + if len(mismatches) > 0 { + sort.Strings(mismatches) + return fmt.Errorf("schema command registry %s path %q Contract.Identity mismatch: %s", spec.CanonicalPath, path, strings.Join(mismatches, "; ")) + } + return nil +} + +func stringSlicesEqualAsSet(a, b []string) bool { + if len(a) != len(b) { + return false + } + counts := make(map[string]int, len(a)) + for _, v := range a { + counts[strings.TrimSpace(v)]++ + } + for _, v := range b { + k := strings.TrimSpace(v) + counts[k]-- + if counts[k] < 0 { + return false + } + } + return true +} + +func normalizeIdentitySourceProduct(sourceProductID, productID string) string { + sourceProductID = strings.TrimSpace(sourceProductID) + productID = strings.TrimSpace(productID) + if sourceProductID == "" || sourceProductID == productID { + return "" + } + return sourceProductID +} diff --git a/internal/cli/schema_cobra_binding_coverage_more_test.go b/internal/cli/schema_cobra_binding_coverage_more_test.go index 25e03e33..5ba3ee4e 100644 --- a/internal/cli/schema_cobra_binding_coverage_more_test.go +++ b/internal/cli/schema_cobra_binding_coverage_more_test.go @@ -360,4 +360,34 @@ func TestCrossPlatformCoverageCompatibilityPathAndHelperRemainingEdges(t *testin if err := validateCommandRegistryAnnotation(incomplete, "sample run", spec); err == nil || !strings.Contains(err.Error(), "incomplete native") { t.Fatalf("incomplete annotation error = %v", err) } + + // ContractFinal without Identity fails closed once a Contract is declared. + noIdentity := &cobra.Command{Use: "run"} + RegisterRuntimeContractFinal(noIdentity, contract.ContractFinalPayload{Description: "x"}) + t.Cleanup(func() { ClearRuntimeContractFinalForTest(noIdentity) }) + if err := validateCommandRegistryAnnotation(noIdentity, "sample run", spec); err == nil || !strings.Contains(err.Error(), "without Identity") { + t.Fatalf("missing Identity error = %v", err) + } + mismatch := &cobra.Command{Use: "run"} + RegisterRuntimeContractFinal(mismatch, contract.ContractFinalPayload{ + Identity: &contract.ToolIdentitySpec{ + ProductID: "other", Name: "run", CanonicalPath: "other.run", + CLIPath: "sample run", PrimaryCLIPath: "sample run", + }, + }) + t.Cleanup(func() { ClearRuntimeContractFinalForTest(mismatch) }) + if err := validateCommandRegistryAnnotation(mismatch, "sample run", spec); err == nil || !strings.Contains(err.Error(), "Contract.Identity mismatch") { + t.Fatalf("Identity mismatch error = %v", err) + } + aligned := &cobra.Command{Use: "run"} + RegisterRuntimeContractFinal(aligned, contract.ContractFinalPayload{ + Identity: &contract.ToolIdentitySpec{ + ProductID: "sample", Name: "run", CanonicalPath: "sample.run", + CLIPath: "sample run", PrimaryCLIPath: "sample run", + }, + }) + t.Cleanup(func() { ClearRuntimeContractFinalForTest(aligned) }) + if err := validateCommandRegistryAnnotation(aligned, "sample run", spec); err != nil { + t.Fatalf("aligned Identity must pass: %v", err) + } } diff --git a/internal/cli/schema_cross_platform_coverage_remaining_test.go b/internal/cli/schema_cross_platform_coverage_remaining_test.go index 5ea7a680..8596a0f4 100644 --- a/internal/cli/schema_cross_platform_coverage_remaining_test.go +++ b/internal/cli/schema_cross_platform_coverage_remaining_test.go @@ -52,6 +52,11 @@ func TestCrossPlatformCoverageAgentExampleRemainingBranches(t *testing.T) { leaf.Flags().String("name", "", "name") AttachRuntimeSchema(leaf, "sample", "run", "test") RegisterRuntimeContractFinal(leaf, contract.ContractFinalPayload{ + Identity: &contract.ToolIdentitySpec{ + ProductID: "sample", Name: "run", CanonicalPath: "sample.run", + CLIPath: "sample run", PrimaryCLIPath: "sample run", + }, + Selection: &contract.SelectionSpec{Examples: []string{"dws sample alt --name x"}}, }) t.Cleanup(func() { contractfinal.ClearRuntimeContractFinalForTest(leaf) }) @@ -491,6 +496,11 @@ func crossPlatformAgentSelectionBound(t *testing.T, mutate func(*cobra.Command, leaf := &cobra.Command{Use: "run", Run: func(*cobra.Command, []string) {}} AttachRuntimeSchema(leaf, "sample", "run", "test") payload := contract.ContractFinalPayload{ + Identity: &contract.ToolIdentitySpec{ + ProductID: "sample", Name: "run", CanonicalPath: "sample.run", + CLIPath: "sample run", PrimaryCLIPath: "sample run", + }, + Title: "Run", Description: "Run sample", Safety: &contract.SafetySpec{Effect: "read", Risk: "low", Confirmation: "not_required", Idempotency: "idempotent"}, @@ -712,6 +722,11 @@ func TestCrossPlatformCoverageSchemaRuntimeRegistryRemainingBranches(t *testing. t.Cleanup(func() { contract.ClearProductDeclForTest("doc") }) create := root.Commands()[0].Commands()[0] RegisterRuntimeContractFinal(create, contract.ContractFinalPayload{ + Identity: &contract.ToolIdentitySpec{ + ProductID: "doc", Name: "create_document", CanonicalPath: "doc.create_document", + CLIPath: "doc create", PrimaryCLIPath: "doc create", + }, + Title: "Create", Description: "Create", Safety: &contract.SafetySpec{Effect: "write", Risk: "low", Confirmation: "not_required", Idempotency: "non_idempotent"}, Interface: &contract.InterfaceSpec{Mode: "local", Availability: "available", Reason: "test"}, @@ -858,6 +873,11 @@ func TestCrossPlatformCoverageAgentExamplePlanAndTokenizerRemaining(t *testing.T leaf.Flags().String("name", "", "name") AttachRuntimeSchema(leaf, "sample", "run", "test") RegisterRuntimeContractFinal(leaf, contract.ContractFinalPayload{ + Identity: &contract.ToolIdentitySpec{ + ProductID: "sample", Name: "run", CanonicalPath: "sample.run", + CLIPath: "sample run", PrimaryCLIPath: "sample run", + }, + Selection: &contract.SelectionSpec{Examples: []string{"dws sample alt run --name x"}}, }) t.Cleanup(func() { contractfinal.ClearRuntimeContractFinalForTest(leaf) }) diff --git a/internal/cli/schema_cross_platform_coverage_test.go b/internal/cli/schema_cross_platform_coverage_test.go index b841f794..d3e5dcc2 100644 --- a/internal/cli/schema_cross_platform_coverage_test.go +++ b/internal/cli/schema_cross_platform_coverage_test.go @@ -302,6 +302,11 @@ func crossPlatformAgentExampleFixture(t *testing.T, mutate func(*cobra.Command, leaf.Flags().String("name", "", "name") AttachRuntimeSchema(leaf, "sample", "run", "test") payload := contract.ContractFinalPayload{ + Identity: &contract.ToolIdentitySpec{ + ProductID: "sample", Name: "run", CanonicalPath: "sample.run", + CLIPath: "sample run", PrimaryCLIPath: "sample run", + }, + Title: "Run", Description: "Run sample", Safety: &contract.SafetySpec{Effect: "read", Risk: "low", Confirmation: "not_required", Idempotency: "idempotent"}, diff --git a/internal/cli/schema_runtime_registry.go b/internal/cli/schema_runtime_registry.go index 60e90002..2f61ddc0 100644 --- a/internal/cli/schema_runtime_registry.go +++ b/internal/cli/schema_runtime_registry.go @@ -491,25 +491,48 @@ func contractFinalProvenance(identity contract.ToolIdentitySpec, title, descript // validateContractFinalIdentity guards the pass-through contract: on a bound // (managed) leaf, a declared identity must agree with the bound tree entry. // Otherwise the Schema catalog would publish an identity the registry never -// indexed. Non-empty declared fields that differ from the entry fail assembly. +// indexed. Registry-owned keys are compared exactly (including empty aliases); +// optional derived fields (cli_name/group/source) still fail only when +// non-empty and disagreeing. func validateContractFinalIdentity(entry runtimeSchemaEntry, id contract.ToolIdentitySpec, canonicalPath string) error { mismatches := make([]string, 0, 10) - check := func(field, declared, bound string) { + checkExact := func(field, declared, bound string) { + declared = strings.TrimSpace(declared) + bound = strings.TrimSpace(bound) + if declared != bound { + mismatches = append(mismatches, fmt.Sprintf("%s: declared %q, bound %q", field, declared, bound)) + } + } + checkOptional := func(field, declared, bound string) { declared = strings.TrimSpace(declared) if declared != "" && declared != strings.TrimSpace(bound) { mismatches = append(mismatches, fmt.Sprintf("%s: declared %q, bound %q", field, declared, bound)) } } - check("product_id", id.ProductID, entry.ProductID) - check("source_product_id", id.SourceProductID, entry.SourceProductID) - check("name", id.Name, entry.ToolName) - check("cli_name", id.CLIName, entry.CLIName) - check("canonical_path", id.CanonicalPath, canonicalPath) - check("cli_path", id.CLIPath, entry.CLIPath) - check("primary_cli_path", id.PrimaryCLIPath, entry.PrimaryCLIPath) - check("group", id.Group, entry.Group) - check("source", id.Source, entry.Source) - if len(id.Aliases) > 0 && !stringSetsEqual(id.Aliases, entry.Aliases) { + checkExact("product_id", id.ProductID, entry.ProductID) + checkExact("name", id.Name, entry.ToolName) + checkExact("canonical_path", id.CanonicalPath, canonicalPath) + cliPath := strings.TrimSpace(id.CLIPath) + primary := strings.TrimSpace(id.PrimaryCLIPath) + if cliPath == "" { + cliPath = primary + } + if primary == "" { + primary = cliPath + } + checkExact("cli_path", cliPath, entry.CLIPath) + checkExact("primary_cli_path", primary, entry.PrimaryCLIPath) + // Empty / product-equal source_product_id are equivalent (registry decode + // defaults omitted source to product_id; Contract may omit it). + checkExact( + "source_product_id", + normalizeIdentitySourceProduct(id.SourceProductID, entry.ProductID), + normalizeIdentitySourceProduct(entry.SourceProductID, entry.ProductID), + ) + checkOptional("cli_name", id.CLIName, entry.CLIName) + checkOptional("group", id.Group, entry.Group) + checkOptional("source", id.Source, entry.Source) + if !stringSetsEqual(id.Aliases, entry.Aliases) { mismatches = append(mismatches, fmt.Sprintf("aliases: declared %v, bound %v", id.Aliases, entry.Aliases)) } if len(mismatches) > 0 { diff --git a/internal/cli/schema_runtime_registry_contract_test.go b/internal/cli/schema_runtime_registry_contract_test.go index 60a10acb..1129b5e6 100644 --- a/internal/cli/schema_runtime_registry_contract_test.go +++ b/internal/cli/schema_runtime_registry_contract_test.go @@ -139,6 +139,11 @@ func TestCrossPlatformCoverageAssembleSchemaRegistryFailClosedMissingProductDecl leaf := &cobra.Command{Use: "run", Short: "Run", Run: func(*cobra.Command, []string) {}} AttachRuntimeSchema(leaf, "orphan", "run", "test") RegisterRuntimeContractFinal(leaf, contract.ContractFinalPayload{ + Identity: &contract.ToolIdentitySpec{ + ProductID: "orphan", Name: "run", CanonicalPath: "orphan.run", + CLIPath: "orphan run", PrimaryCLIPath: "orphan run", + }, + Title: "Orphan run", Description: "Has ContractFinal but no ProductDecl", Selection: &contract.SelectionSpec{AgentSummary: "orphan leaf"}, @@ -189,6 +194,11 @@ func TestAssembleSchemaRegistryRequiresContractFinalAndProductDecl(t *testing.T) leaf := &cobra.Command{Use: "run", Short: "Run sample", Long: "Run the sample tool", Run: func(*cobra.Command, []string) {}} AttachRuntimeSchema(leaf, "sample", "run", "test") RegisterRuntimeContractFinal(leaf, contract.ContractFinalPayload{ + Identity: &contract.ToolIdentitySpec{ + ProductID: "sample", Name: "run", CanonicalPath: "sample.run", + CLIPath: "sample run", PrimaryCLIPath: "sample run", + }, + Title: "Sample run", Description: "Declared sample tool", Safety: &contract.SafetySpec{ @@ -319,6 +329,11 @@ func assembleContractFinalTextTool(t *testing.T, short, long, declaredDescriptio } AttachRuntimeSchema(leaf, "sample", "run", "test") RegisterRuntimeContractFinal(leaf, contract.ContractFinalPayload{ + Identity: &contract.ToolIdentitySpec{ + ProductID: "sample", Name: "run", CanonicalPath: "sample.run", + CLIPath: "sample run", PrimaryCLIPath: "sample run", + }, + Title: "Declared title", Description: declaredDescription, Safety: &contract.SafetySpec{ diff --git a/internal/corecmd/contract_decl.go b/internal/corecmd/contract_decl.go index 8ab6be4b..2b28de08 100644 --- a/internal/corecmd/contract_decl.go +++ b/internal/corecmd/contract_decl.go @@ -55,6 +55,10 @@ type ContractDecl struct { // only fail later, opaquely, in generated artifacts. Failing at construction // keeps the error next to the authoring mistake and prevents silent drift // between cobra prose (Short/Long/Example) and the published Contract values. +// +// Identity is required on every declared Contract as a pin/self-description +// against the reviewed CommandRegistry. Registry remains the identity +// authority; binder/assembly reject any declared Identity that disagrees. func validateContractDecl(spec Spec) { if spec.Contract.empty() { return @@ -85,11 +89,40 @@ func validateContractDecl(spec Spec) { strings.TrimSpace(iface.Reason) == "" { missing = append(missing, "Contract.Interface.Reason") } + id := spec.Contract.Identity + productID := strings.TrimSpace(id.ProductID) + name := strings.TrimSpace(id.Name) + canonical := strings.TrimSpace(id.CanonicalPath) + cliPath := strings.TrimSpace(id.CLIPath) + primary := strings.TrimSpace(id.PrimaryCLIPath) + if productID == "" { + missing = append(missing, "Contract.Identity.ProductID") + } + if name == "" { + missing = append(missing, "Contract.Identity.Name") + } + if canonical == "" { + missing = append(missing, "Contract.Identity.CanonicalPath") + } + if cliPath == "" && primary == "" { + missing = append(missing, "Contract.Identity.CLIPath") + } if len(missing) > 0 { panic(fmt.Sprintf( "command %q declares Contract but is missing %s: a declared Contract is the final source and must carry the full reviewed prose (no hints fallback)", spec.Use, strings.Join(missing, ", "))) } + wantCanonical := productID + "." + name + if canonical != wantCanonical { + panic(fmt.Sprintf( + "command %q Contract.Identity.CanonicalPath %q must equal ProductID.Name %q", + spec.Use, canonical, wantCanonical)) + } + if cliPath != "" && primary != "" && cliPath != primary { + panic(fmt.Sprintf( + "command %q Contract.Identity.CLIPath %q and PrimaryCLIPath %q must agree on the primary leaf path", + spec.Use, cliPath, primary)) + } } // Empty reports whether no ContractDecl field was authored. diff --git a/internal/corecmd/contract_decl_test.go b/internal/corecmd/contract_decl_test.go index f9f6d46e..cb3a10e6 100644 --- a/internal/corecmd/contract_decl_test.go +++ b/internal/corecmd/contract_decl_test.go @@ -120,6 +120,14 @@ func TestNewCommandFallsBackToDeclaredDescriptionWithoutLong(t *testing.T) { Confirmation: "not_required", Idempotency: "idempotent", }, Contract: ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "dev", + Name: "create_thing", + CanonicalPath: "dev.create_thing", + CLIPath: "dev create", + PrimaryCLIPath: "dev create", + }, + Title: "Create Title", Description: "Create Desc", Interface: &contract.InterfaceSpec{ @@ -171,6 +179,11 @@ func TestCrossPlatformCoverageNewCommandPanicsOnPartialContractDecl(t *testing.T Interface: &contract.InterfaceSpec{Mode: "composite", Availability: "available"}, Selection: contract.SelectionSpec{AgentSummary: "s", UseWhen: []string{"u"}, AvoidWhen: []string{"a"}, Examples: []string{"dws x"}}, }, "Contract.Interface.Reason"}, + {"missing identity", ContractDecl{ + Description: "d", + Interface: &contract.InterfaceSpec{Mode: "mcp", Availability: "available", Ref: &contract.InterfaceRefSpec{ProductID: "dev", RPCName: "get_thing"}}, + Selection: contract.SelectionSpec{AgentSummary: "s", UseWhen: []string{"u"}, AvoidWhen: []string{"a"}, Examples: []string{"dws x"}}, + }, "Contract.Identity"}, } { t.Run(tc.name, func(t *testing.T) { defer func() { @@ -194,6 +207,10 @@ func TestCrossPlatformCoverageNewCommandPanicsOnPartialContractDecl(t *testing.T func TestNewCommandDerivesHelpExampleFromDeclaredSelection(t *testing.T) { decl := ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "dev", Name: "create_thing", CanonicalPath: "dev.create_thing", + CLIPath: "dev create", PrimaryCLIPath: "dev create", + }, Description: "desc", Interface: &contract.InterfaceSpec{Mode: "mcp", Availability: "available", Ref: &contract.InterfaceRefSpec{ProductID: "dev", RPCName: "create_thing"}}, Selection: contract.SelectionSpec{ @@ -232,6 +249,10 @@ func TestNewCommandDerivesHelpExampleFromDeclaredSelection(t *testing.T) { func TestNewCommandSafetySpecPassThrough(t *testing.T) { decl := func() ContractDecl { return ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "dev", Name: "create_thing", CanonicalPath: "dev.create_thing", + CLIPath: "dev create", PrimaryCLIPath: "dev create", + }, Description: "desc", Interface: &contract.InterfaceSpec{Mode: "mcp", Availability: "available", Ref: &contract.InterfaceRefSpec{ProductID: "dev", RPCName: "op"}}, Selection: contract.SelectionSpec{ diff --git a/internal/corecmd/corecmd.go b/internal/corecmd/corecmd.go index 965678dd..1f0dadcd 100644 --- a/internal/corecmd/corecmd.go +++ b/internal/corecmd/corecmd.go @@ -1273,7 +1273,9 @@ func AttachContract(cmd *cobra.Command, safety contract.SafetySpec, decl Contrac copied.Reviewed = nil payload.Selection = &copied } - if id := decl.Identity; strings.TrimSpace(id.ProductID) != "" || strings.TrimSpace(id.Name) != "" { + if id := decl.Identity; strings.TrimSpace(id.ProductID) != "" || strings.TrimSpace(id.Name) != "" || + strings.TrimSpace(id.CanonicalPath) != "" || strings.TrimSpace(id.CLIPath) != "" || + strings.TrimSpace(id.PrimaryCLIPath) != "" { copied := id copied.ProductID = strings.TrimSpace(id.ProductID) copied.SourceProductID = strings.TrimSpace(id.SourceProductID) @@ -1282,8 +1284,17 @@ func AttachContract(cmd *cobra.Command, safety contract.SafetySpec, decl Contrac copied.CanonicalPath = strings.TrimSpace(id.CanonicalPath) copied.CLIPath = strings.TrimSpace(id.CLIPath) copied.PrimaryCLIPath = strings.TrimSpace(id.PrimaryCLIPath) + if copied.CLIPath == "" { + copied.CLIPath = copied.PrimaryCLIPath + } + if copied.PrimaryCLIPath == "" { + copied.PrimaryCLIPath = copied.CLIPath + } copied.Group = strings.TrimSpace(id.Group) copied.Source = strings.TrimSpace(id.Source) + if len(id.Aliases) > 0 { + copied.Aliases = append([]string(nil), id.Aliases...) + } payload.Identity = &copied } if len(decl.Parameters) > 0 { diff --git a/internal/corecmd/corecmd_test.go b/internal/corecmd/corecmd_test.go index 5c87ed5a..8c034df3 100644 --- a/internal/corecmd/corecmd_test.go +++ b/internal/corecmd/corecmd_test.go @@ -1598,6 +1598,14 @@ func TestCrossPlatformCoverageEmbedContractCobraProjection(t *testing.T) { }, Safety: testWriteSafety(), Contract: ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "dev", + Name: "create_thing", + CanonicalPath: "dev.create_thing", + CLIPath: "dev create", + PrimaryCLIPath: "dev create", + }, + Description: "desc", Interface: &contract.InterfaceSpec{Mode: "mcp", Availability: "available", Ref: &contract.InterfaceRefSpec{ProductID: "dev", RPCName: "op"}}, Selection: contract.SelectionSpec{ @@ -1642,6 +1650,10 @@ func TestCrossPlatformCoverageAttachContractNilAndEmptyGuards(t *testing.T) { func TestCrossPlatformCoverageAttachContractOverwritesLegacySelectionSources(t *testing.T) { cmd := newTestCommand() AttachContract(cmd, testWriteSafety(), ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "dev", Name: "create_thing", CanonicalPath: "dev.create_thing", + CLIPath: "dev create", PrimaryCLIPath: "dev create", + }, Description: "Declared description for attach coverage", Interface: &contract.InterfaceSpec{Mode: "mcp", Availability: "available", Ref: &contract.InterfaceRefSpec{ProductID: "dev", RPCName: "op"}}, Parameters: []contract.ParamDecl{{Name: "mode", Property: "mode", InterfaceType: "string"}}, diff --git a/internal/helpers/aisearch.go b/internal/helpers/aisearch.go index e9205cab..6746e0ac 100644 --- a/internal/helpers/aisearch.go +++ b/internal/helpers/aisearch.go @@ -246,6 +246,13 @@ func newAisearchCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "aisearch", + Name: "enterprise_person_search", + CanonicalPath: "aisearch.enterprise_person_search", + CLIPath: "aisearch person", + PrimaryCLIPath: "aisearch person", + }, Description: "企业内找人:按姓名/部门/职位/职责/上下级/手机号/工号筛选", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -301,6 +308,13 @@ func newAisearchCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "aisearch", + Name: "search_enterprise", + CanonicalPath: "aisearch.search_enterprise", + CLIPath: "aisearch enterprise", + PrimaryCLIPath: "aisearch enterprise", + }, Description: "搜索企业内部知识与相关内容(文档/IM/日历/待办/纪要/日志/邮件等)", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -358,6 +372,13 @@ func newAisearchCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "aisearch", + Name: "search_enterprise_behavior", + CanonicalPath: "aisearch.search_enterprise_behavior", + CLIPath: "aisearch behavior", + PrimaryCLIPath: "aisearch behavior", + }, Description: "搜索发送/创建/分享/编辑/接收等明确行为记录", Interface: &contract.InterfaceSpec{ Mode: "mcp", diff --git a/internal/helpers/aitable.go b/internal/helpers/aitable.go index 25e7a974..f67d7c20 100644 --- a/internal/helpers/aitable.go +++ b/internal/helpers/aitable.go @@ -993,6 +993,13 @@ func newAitableCommand() *cobra.Command { DeclareLeafMetadata(baseGetPrimaryDocIdCmd, LeafSpec{ Safety: aitableSafetyRead(), Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "aitable", + Name: "base_get_primary_doc_id", + CanonicalPath: "aitable.base_get_primary_doc_id", + CLIPath: "aitable base get-primary-doc-id", + PrimaryCLIPath: "aitable base get-primary-doc-id", + }, Description: "获取某记录主键文档 ID。", Interface: aitableMCPInterface("get_base_primary_doc_id"), Selection: contract.SelectionSpec{ @@ -1029,6 +1036,13 @@ AI 表格访问地址可按 baseId 拼接为:https://alidocs.dingtalk.com/i/no DeclareLeafMetadata(baseListCmd, LeafSpec{ Safety: aitableSafetyRead(), Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "aitable", + Name: "base_list", + CanonicalPath: "aitable.base_list", + CLIPath: "aitable base list", + PrimaryCLIPath: "aitable base list", + }, Description: "列出最近访问的 AI 表格 Base。", Interface: aitableMCPInterface("list_bases"), Selection: contract.SelectionSpec{ @@ -1069,6 +1083,13 @@ AI 表格访问地址可按 baseId 拼接为:https://alidocs.dingtalk.com/i/no DeclareLeafMetadata(baseSearchCmd, LeafSpec{ Safety: aitableSafetyRead(), Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "aitable", + Name: "base_search", + CanonicalPath: "aitable.base_search", + CLIPath: "aitable base search", + PrimaryCLIPath: "aitable base search", + }, Description: "按名称搜索 AI 表格 Base(优先于仅最近访问的 list)。", Interface: aitableMCPInterface("search_bases"), Selection: contract.SelectionSpec{ @@ -1099,6 +1120,13 @@ AI 表格访问地址可按 baseId 拼接为:https://alidocs.dingtalk.com/i/no DeclareLeafMetadata(baseGetCmd, LeafSpec{ Safety: aitableSafetyRead(), Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "aitable", + Name: "base_get", + CanonicalPath: "aitable.base_get", + CLIPath: "aitable base get", + PrimaryCLIPath: "aitable base get", + }, Description: "获取 Base 信息及 tables 目录。", Interface: aitableMCPInterface("get_base"), Selection: contract.SelectionSpec{ @@ -1137,6 +1165,13 @@ MCP 层会进一步兼容同字段传入的标准节点 URL,并在创建前解 DeclareLeafMetadata(baseCreateCmd, LeafSpec{ Safety: aitableSafetyWrite(), Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "aitable", + Name: "base_create", + CanonicalPath: "aitable.base_create", + CLIPath: "aitable base create", + PrimaryCLIPath: "aitable base create", + }, Description: "创建 AI 表格 Base。", Interface: aitableMCPInterface("create_base"), Selection: contract.SelectionSpec{ @@ -1177,6 +1212,13 @@ MCP 层会进一步兼容同字段传入的标准节点 URL,并在创建前解 DeclareLeafMetadata(baseUpdateCmd, LeafSpec{ Safety: aitableSafetyWrite(), Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "aitable", + Name: "base_update", + CanonicalPath: "aitable.base_update", + CLIPath: "aitable base update", + PrimaryCLIPath: "aitable base update", + }, Description: "更新 Base 名称。", Interface: aitableMCPInterface("update_base"), Selection: contract.SelectionSpec{ @@ -1214,6 +1256,13 @@ MCP 层会进一步兼容同字段传入的标准节点 URL,并在创建前解 DeclareLeafMetadata(baseDeleteCmd, LeafSpec{ Safety: aitableSafetyDestructive(), Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "aitable", + Name: "base_delete", + CanonicalPath: "aitable.base_delete", + CLIPath: "aitable base delete", + PrimaryCLIPath: "aitable base delete", + }, Description: "删除 AI 表格 Base(不可逆,需确认)。", Interface: aitableMCPInterface("delete_base"), Selection: contract.SelectionSpec{ @@ -1256,6 +1305,13 @@ MCP 层不会会自动解析 URL,必须直接传入 dentryUuid 以避免报错 DeclareLeafMetadata(baseCopyCmd, LeafSpec{ Safety: aitableSafetyWrite(), Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "aitable", + Name: "base_copy", + CanonicalPath: "aitable.base_copy", + CLIPath: "aitable base copy", + PrimaryCLIPath: "aitable base copy", + }, Description: "复制整个 Base 到目标文件夹(可仅结构)。", Interface: aitableMCPInterface("copy_base"), Selection: contract.SelectionSpec{ @@ -1301,6 +1357,13 @@ MCP 层不会会自动解析 URL,必须直接传入 dentryUuid 以避免报错 DeclareLeafMetadata(tableGetCmd, LeafSpec{ Safety: aitableSafetyRead(), Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "aitable", + Name: "table_get", + CanonicalPath: "aitable.table_get", + CLIPath: "aitable table get", + PrimaryCLIPath: "aitable table get", + }, Description: "获取数据表结构(字段+视图目录)。", Interface: aitableMCPInterface("get_tables"), Selection: contract.SelectionSpec{ @@ -1393,6 +1456,13 @@ config 结构参考: DeclareLeafMetadata(tableCreateCmd, LeafSpec{ Safety: aitableSafetyWrite(), Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "aitable", + Name: "table_create", + CanonicalPath: "aitable.table_create", + CLIPath: "aitable table create", + PrimaryCLIPath: "aitable table create", + }, Description: "在 Base 下创建数据表(可带 fields,空数组会补标题列)。", Interface: aitableMCPInterface("create_table"), Selection: contract.SelectionSpec{ @@ -1456,6 +1526,13 @@ config 结构参考: DeclareLeafMetadata(tableUpdateCmd, LeafSpec{ Safety: aitableSafetyWrite(), Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "aitable", + Name: "table_update", + CanonicalPath: "aitable.table_update", + CLIPath: "aitable table update", + PrimaryCLIPath: "aitable table update", + }, Description: "重命名数据表。", Interface: aitableMCPInterface("update_table"), Selection: contract.SelectionSpec{ @@ -1502,6 +1579,13 @@ config 结构参考: DeclareLeafMetadata(tableDeleteCmd, LeafSpec{ Safety: aitableSafetyDestructive(), Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "aitable", + Name: "table_delete", + CanonicalPath: "aitable.table_delete", + CLIPath: "aitable table delete", + PrimaryCLIPath: "aitable table delete", + }, Description: "删除数据表(不可逆,需确认)。", Interface: aitableMCPInterface("delete_table"), Selection: contract.SelectionSpec{ @@ -1552,6 +1636,13 @@ config 结构参考: DeclareLeafMetadata(fieldGetCmd, LeafSpec{ Safety: aitableSafetyRead(), Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "aitable", + Name: "field_get", + CanonicalPath: "aitable.field_get", + CLIPath: "aitable field get", + PrimaryCLIPath: "aitable field get", + }, Description: "获取字段完整配置。", Interface: aitableMCPInterface("get_fields"), Selection: contract.SelectionSpec{ @@ -1664,6 +1755,13 @@ config 结构参考: DeclareLeafMetadata(fieldCreateCmd, LeafSpec{ Safety: aitableSafetyWrite(), Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "aitable", + Name: "field_create", + CanonicalPath: "aitable.field_create", + CLIPath: "aitable field create", + PrimaryCLIPath: "aitable field create", + }, Description: "创建字段(单字段或批量,单次最多 15 个)。", Interface: aitableMCPInterface("create_fields"), Selection: contract.SelectionSpec{ @@ -1731,6 +1829,13 @@ newFieldName、config、aiConfig 至少传入一项。 DeclareLeafMetadata(fieldUpdateCmd, LeafSpec{ Safety: aitableSafetyWrite(), Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "aitable", + Name: "field_update", + CanonicalPath: "aitable.field_update", + CLIPath: "aitable field update", + PrimaryCLIPath: "aitable field update", + }, Description: "更新字段名或配置(不可变更字段类型)。", Interface: aitableMCPInterface("update_field"), Selection: contract.SelectionSpec{ @@ -1784,6 +1889,13 @@ newFieldName、config、aiConfig 至少传入一项。 DeclareLeafMetadata(fieldSearchOptionsCmd, LeafSpec{ Safety: aitableSafetyRead(), Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "aitable", + Name: "field_search_options", + CanonicalPath: "aitable.field_search_options", + CLIPath: "aitable field search-options", + PrimaryCLIPath: "aitable field search-options", + }, Description: "搜索单选/多选字段的选项。", Interface: aitableMCPInterface("search_field_options"), Selection: contract.SelectionSpec{ @@ -1826,6 +1938,13 @@ newFieldName、config、aiConfig 至少传入一项。 DeclareLeafMetadata(fieldDeleteCmd, LeafSpec{ Safety: aitableSafetyDestructive(), Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "aitable", + Name: "field_delete", + CanonicalPath: "aitable.field_delete", + CLIPath: "aitable field delete", + PrimaryCLIPath: "aitable field delete", + }, Description: "删除字段(不可逆,需确认)。", Interface: aitableMCPInterface("delete_field"), Selection: contract.SelectionSpec{ @@ -1947,6 +2066,14 @@ newFieldName、config、aiConfig 至少传入一项。 DeclareLeafMetadata(recordQueryCmd, LeafSpec{ Safety: aitableSafetyRead(), Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "aitable", + Name: "query_records", + CanonicalPath: "aitable.query_records", + CLIPath: "aitable record query", + PrimaryCLIPath: "aitable record query", + Aliases: []string{"aitable record list"}, + }, Description: "查询/搜索记录(filters/sort/分页/--all;cells 键为 fieldId)。", Interface: aitableMCPInterface("query_records"), Selection: contract.SelectionSpec{ @@ -2047,6 +2174,13 @@ CLI 会自动从文件中读取内容作为 --records 的值。这样可以避 DeclareLeafMetadata(recordCreateCmd, LeafSpec{ Safety: aitableSafetyWrite(), Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "aitable", + Name: "record_create", + CanonicalPath: "aitable.record_create", + CLIPath: "aitable record create", + PrimaryCLIPath: "aitable record create", + }, Description: "新增记录(cells 的 key 必须是 fieldId)。", Interface: aitableMCPInterface("create_records"), Selection: contract.SelectionSpec{ @@ -2118,6 +2252,13 @@ Windows 用户注意:如果 --records JSON 很长,请使用 --records-file DeclareLeafMetadata(recordUpdateCmd, LeafSpec{ Safety: aitableSafetyWrite(), Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "aitable", + Name: "record_update", + CanonicalPath: "aitable.record_update", + CLIPath: "aitable record update", + PrimaryCLIPath: "aitable record update", + }, Description: "更新已有记录字段(先 query 拿 recordId;只传需改字段)。", Interface: aitableMCPInterface("update_records"), Selection: contract.SelectionSpec{ @@ -2157,6 +2298,13 @@ Windows 用户注意:如果 --records JSON 很长,请使用 --records-file DeclareLeafMetadata(recordDeleteCmd, LeafSpec{ Safety: aitableSafetyDestructive(), Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "aitable", + Name: "record_delete", + CanonicalPath: "aitable.record_delete", + CLIPath: "aitable record delete", + PrimaryCLIPath: "aitable record delete", + }, Description: "删除记录(不可逆,需确认)。", Interface: aitableMCPInterface("delete_records"), Selection: contract.SelectionSpec{ @@ -2229,6 +2377,13 @@ CLI 行为:客户端把 --record-ids 拆开后构造 [{recordId, cells}, ...] DeclareLeafMetadata(recordBatchUpdateCmd, LeafSpec{ Safety: aitableSafetyWrite(), Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "aitable", + Name: "record_batch_update", + CanonicalPath: "aitable.record_batch_update", + CLIPath: "aitable record batch-update", + PrimaryCLIPath: "aitable record batch-update", + }, Description: "把同一份 cells 批量应用到多条 recordIds。", Interface: aitableCompositeInterface("Reviewed composite wrapper: the CLI expands record IDs and shared cells into the pinned aitable/update_records request, so it is not a direct parameter-equivalent RPC projection."), Selection: contract.SelectionSpec{ @@ -2282,6 +2437,13 @@ CLI 行为:客户端把 --record-ids 拆开后构造 [{recordId, cells}, ...] DeclareLeafMetadata(recordQueryEmptyCmd, LeafSpec{ Safety: aitableSafetyRead(), Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "aitable", + Name: "record_query_empty", + CanonicalPath: "aitable.record_query_empty", + CLIPath: "aitable record query-empty", + PrimaryCLIPath: "aitable record query-empty", + }, Description: "查询完全未填用户字段的空行。", Interface: aitableHelperMCPInterface("query_empty_records"), Selection: contract.SelectionSpec{ @@ -2344,6 +2506,13 @@ CLI 行为:客户端把 --record-ids 拆开后构造 [{recordId, cells}, ...] DeclareLeafMetadata(recordHistoryListCmd, LeafSpec{ Safety: aitableSafetyRead(), Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "aitable", + Name: "record_history_list", + CanonicalPath: "aitable.record_history_list", + CLIPath: "aitable record history-list", + PrimaryCLIPath: "aitable record history-list", + }, Description: "查询单条记录变更历史。", Interface: aitableHelperMCPInterface("query_record_history"), Selection: contract.SelectionSpec{ @@ -2395,6 +2564,13 @@ CLI 行为:客户端把 --record-ids 拆开后构造 [{recordId, cells}, ...] DeclareLeafMetadata(recordShareUrlCmd, LeafSpec{ Safety: aitableSafetyRead(), Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "aitable", + Name: "record_share_url", + CanonicalPath: "aitable.record_share_url", + CLIPath: "aitable record share-url", + PrimaryCLIPath: "aitable record share-url", + }, Description: "批量获取记录分享链接(最多 20)。", Interface: aitableHelperMCPInterface("get_record_share_url"), Selection: contract.SelectionSpec{ @@ -2459,6 +2635,13 @@ Windows 用户注意:如果 --records JSON 很长,请使用 --records-file DeclareLeafMetadata(recordUpsertCmd, LeafSpec{ Safety: aitableSafetyWrite(), Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "aitable", + Name: "record_upsert", + CanonicalPath: "aitable.record_upsert", + CLIPath: "aitable record upsert", + PrimaryCLIPath: "aitable record upsert", + }, Description: "批量创建或更新(有 recordId 更新,无则创建)。", Interface: aitableHelperMCPInterface("record_upsert"), Selection: contract.SelectionSpec{ @@ -2499,6 +2682,13 @@ Windows 用户注意:如果 --records JSON 很长,请使用 --records-file DeclareLeafMetadata(recordPrimaryDocGetCmd, LeafSpec{ Safety: aitableSafetyRead(), Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "aitable", + Name: "record_primary_doc_get", + CanonicalPath: "aitable.record_primary_doc_get", + CLIPath: "aitable record primary-doc-get", + PrimaryCLIPath: "aitable record primary-doc-get", + }, Description: "查询记录主键文档 nodeId。", Interface: aitableHelperMCPInterface("get_primary_doc"), Selection: contract.SelectionSpec{ @@ -2537,6 +2727,13 @@ fieldId 必须是 primaryDoc 类型的字段。`, DeclareLeafMetadata(recordPrimaryDocCreateCmd, LeafSpec{ Safety: aitableSafetyWrite(), Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "aitable", + Name: "record_primary_doc_create", + CanonicalPath: "aitable.record_primary_doc_create", + CLIPath: "aitable record primary-doc-create", + PrimaryCLIPath: "aitable record primary-doc-create", + }, Description: "为记录创建主键文档(幂等;field 须 primaryDoc 类型)。", Interface: aitableHelperMCPInterface("create_primary_doc"), Selection: contract.SelectionSpec{ @@ -2579,6 +2776,13 @@ fieldId 必须是 primaryDoc 类型的字段。`, DeclareLeafMetadata(templateSearchCmd, LeafSpec{ Safety: aitableSafetyRead(), Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "aitable", + Name: "template_search", + CanonicalPath: "aitable.template_search", + CLIPath: "aitable template search", + PrimaryCLIPath: "aitable template search", + }, Description: "搜索 AI 表格模板。", Interface: aitableMCPInterface("search_templates"), Selection: contract.SelectionSpec{ @@ -2645,6 +2849,13 @@ fieldId 必须是 primaryDoc 类型的字段。`, DeclareLeafMetadata(attachmentUploadCmd, LeafSpec{ Safety: aitableSafetyWrite(), Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "aitable", + Name: "attachment_upload", + CanonicalPath: "aitable.attachment_upload", + CLIPath: "aitable attachment upload", + PrimaryCLIPath: "aitable attachment upload", + }, Description: "准备 AI 表格附件上传凭证(不要用钉盘 drive)。", Interface: aitableMCPInterface("prepare_attachment_upload"), Selection: contract.SelectionSpec{ @@ -2709,6 +2920,13 @@ fieldId 必须是 primaryDoc 类型的字段。`, DeclareLeafMetadata(viewGetCardCmd, LeafSpec{ Safety: aitableSafetyRead(), Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "aitable", + Name: "view_get_card", + CanonicalPath: "aitable.view_get_card", + CLIPath: "aitable view get card", + PrimaryCLIPath: "aitable view get card", + }, Description: "读取卡片视图配置", Interface: aitableMCPInterface("get_views"), Selection: contract.SelectionSpec{ @@ -2736,6 +2954,13 @@ fieldId 必须是 primaryDoc 类型的字段。`, DeclareLeafMetadata(viewGetTimebarCmd, LeafSpec{ Safety: aitableSafetyRead(), Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "aitable", + Name: "view_get_timebar", + CanonicalPath: "aitable.view_get_timebar", + CLIPath: "aitable view get timebar", + PrimaryCLIPath: "aitable view get timebar", + }, Description: "读取时间条配置", Interface: aitableMCPInterface("get_views"), Selection: contract.SelectionSpec{ @@ -2763,6 +2988,13 @@ fieldId 必须是 primaryDoc 类型的字段。`, DeclareLeafMetadata(viewGetAggregateCmd, LeafSpec{ Safety: aitableSafetyRead(), Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "aitable", + Name: "view_get_aggregate", + CanonicalPath: "aitable.view_get_aggregate", + CLIPath: "aitable view get aggregate", + PrimaryCLIPath: "aitable view get aggregate", + }, Description: "读取视图聚合配置", Interface: aitableMCPInterface("get_views"), Selection: contract.SelectionSpec{ @@ -2790,6 +3022,13 @@ fieldId 必须是 primaryDoc 类型的字段。`, DeclareLeafMetadata(viewGetFilterCmd, LeafSpec{ Safety: aitableSafetyRead(), Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "aitable", + Name: "view_get_filter", + CanonicalPath: "aitable.view_get_filter", + CLIPath: "aitable view get filter", + PrimaryCLIPath: "aitable view get filter", + }, Description: "读取视图筛选", Interface: aitableMCPInterface("get_views"), Selection: contract.SelectionSpec{ @@ -2817,6 +3056,13 @@ fieldId 必须是 primaryDoc 类型的字段。`, DeclareLeafMetadata(viewGetSortCmd, LeafSpec{ Safety: aitableSafetyRead(), Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "aitable", + Name: "view_get_sort", + CanonicalPath: "aitable.view_get_sort", + CLIPath: "aitable view get sort", + PrimaryCLIPath: "aitable view get sort", + }, Description: "读取视图排序", Interface: aitableMCPInterface("get_views"), Selection: contract.SelectionSpec{ @@ -2844,6 +3090,13 @@ fieldId 必须是 primaryDoc 类型的字段。`, DeclareLeafMetadata(viewGetGroupCmd, LeafSpec{ Safety: aitableSafetyRead(), Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "aitable", + Name: "view_get_group", + CanonicalPath: "aitable.view_get_group", + CLIPath: "aitable view get group", + PrimaryCLIPath: "aitable view get group", + }, Description: "读取视图分组", Interface: aitableMCPInterface("get_views"), Selection: contract.SelectionSpec{ @@ -2871,6 +3124,13 @@ fieldId 必须是 primaryDoc 类型的字段。`, DeclareLeafMetadata(viewGetVisibleFieldsCmd, LeafSpec{ Safety: aitableSafetyRead(), Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "aitable", + Name: "view_get_visible_fields", + CanonicalPath: "aitable.view_get_visible_fields", + CLIPath: "aitable view get visible-fields", + PrimaryCLIPath: "aitable view get visible-fields", + }, Description: "读取可见字段及顺序", Interface: aitableMCPInterface("get_views"), Selection: contract.SelectionSpec{ @@ -2898,6 +3158,13 @@ fieldId 必须是 primaryDoc 类型的字段。`, DeclareLeafMetadata(viewGetFieldWidthsCmd, LeafSpec{ Safety: aitableSafetyRead(), Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "aitable", + Name: "view_get_field_widths", + CanonicalPath: "aitable.view_get_field_widths", + CLIPath: "aitable view get field-widths", + PrimaryCLIPath: "aitable view get field-widths", + }, Description: "读取 Grid 列宽", Interface: aitableMCPInterface("get_views"), Selection: contract.SelectionSpec{ @@ -2966,6 +3233,13 @@ fieldId 必须是 primaryDoc 类型的字段。`, DeclareLeafMetadata(viewCreateCmd, LeafSpec{ Safety: aitableSafetyWrite(), Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "aitable", + Name: "view_create", + CanonicalPath: "aitable.view_create", + CLIPath: "aitable view create", + PrimaryCLIPath: "aitable view create", + }, Description: "创建视图(Grid/Kanban/Gantt/Calendar/Gallery/FormDesigner)。", Interface: aitableMCPInterface("create_view"), Selection: contract.SelectionSpec{ @@ -3071,6 +3345,13 @@ typed flag 与 --json 同时存在时,typed flag 优先。--no-cover 与 --cov DeclareLeafMetadata(viewUpdateCardCmd, LeafSpec{ Safety: aitableSafetyWrite(), Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "aitable", + Name: "view_update_card", + CanonicalPath: "aitable.view_update_card", + CLIPath: "aitable view update card", + PrimaryCLIPath: "aitable view update card", + }, Description: "更新卡片视图配置", Interface: aitableCompositeInterface("The CLI performs an aitable/get_views preflight, locally transforms the requested configuration, and then calls aitable/update_view; the two-call workflow has no single direct MCP interface."), Selection: contract.SelectionSpec{ @@ -3125,6 +3406,13 @@ colorConfigs (JSON 数组) / officialHoliday (bool)。`, DeclareLeafMetadata(viewUpdateTimebarCmd, LeafSpec{ Safety: aitableSafetyWrite(), Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "aitable", + Name: "view_update_timebar", + CanonicalPath: "aitable.view_update_timebar", + CLIPath: "aitable view update timebar", + PrimaryCLIPath: "aitable view update timebar", + }, Description: "更新时间条配置", Interface: aitableCompositeInterface("The CLI performs an aitable/get_views preflight, locally transforms the requested configuration, and then calls aitable/update_view; the two-call workflow has no single direct MCP interface."), Selection: contract.SelectionSpec{ @@ -3186,6 +3474,13 @@ colorConfigs (JSON 数组) / officialHoliday (bool)。`, DeclareLeafMetadata(viewUpdateAggregateCmd, LeafSpec{ Safety: aitableSafetyWrite(), Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "aitable", + Name: "view_update_aggregate", + CanonicalPath: "aitable.view_update_aggregate", + CLIPath: "aitable view update aggregate", + PrimaryCLIPath: "aitable view update aggregate", + }, Description: "更新视图聚合配置", Interface: aitableCompositeInterface("The CLI performs an aitable/get_views preflight, locally transforms the requested configuration, and then calls aitable/update_view; the two-call workflow has no single direct MCP interface."), Selection: contract.SelectionSpec{ @@ -3231,6 +3526,13 @@ colorConfigs (JSON 数组) / officialHoliday (bool)。`, DeclareLeafMetadata(viewUpdateFieldWidthsCmd, LeafSpec{ Safety: aitableSafetyWrite(), Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "aitable", + Name: "view_update_field_widths", + CanonicalPath: "aitable.view_update_field_widths", + CLIPath: "aitable view update field-widths", + PrimaryCLIPath: "aitable view update field-widths", + }, Description: "更新 Grid 列宽", Interface: aitableCompositeInterface("The CLI performs an aitable/get_views preflight, locally transforms the requested configuration, and then calls aitable/update_view; the two-call workflow has no single direct MCP interface."), Selection: contract.SelectionSpec{ @@ -3289,6 +3591,13 @@ colorConfigs (JSON 数组) / officialHoliday (bool)。`, DeclareLeafMetadata(viewUpdateVisibleFieldsCmd, LeafSpec{ Safety: aitableSafetyWrite(), Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "aitable", + Name: "view_update_visible_fields", + CanonicalPath: "aitable.view_update_visible_fields", + CLIPath: "aitable view update visible-fields", + PrimaryCLIPath: "aitable view update visible-fields", + }, Description: "更新可见字段列表与顺序", Interface: aitableMCPInterface("update_view"), Selection: contract.SelectionSpec{ @@ -3319,6 +3628,13 @@ colorConfigs (JSON 数组) / officialHoliday (bool)。`, DeclareLeafMetadata(viewUpdateFilterCmd, LeafSpec{ Safety: aitableSafetyWrite(), Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "aitable", + Name: "view_update_filter", + CanonicalPath: "aitable.view_update_filter", + CLIPath: "aitable view update filter", + PrimaryCLIPath: "aitable view update filter", + }, Description: "更新视图筛选", Interface: aitableMCPInterface("update_view"), Selection: contract.SelectionSpec{ @@ -3347,6 +3663,13 @@ colorConfigs (JSON 数组) / officialHoliday (bool)。`, DeclareLeafMetadata(viewUpdateSortCmd, LeafSpec{ Safety: aitableSafetyWrite(), Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "aitable", + Name: "view_update_sort", + CanonicalPath: "aitable.view_update_sort", + CLIPath: "aitable view update sort", + PrimaryCLIPath: "aitable view update sort", + }, Description: "更新视图排序", Interface: aitableMCPInterface("update_view"), Selection: contract.SelectionSpec{ @@ -3375,6 +3698,13 @@ colorConfigs (JSON 数组) / officialHoliday (bool)。`, DeclareLeafMetadata(viewUpdateGroupCmd, LeafSpec{ Safety: aitableSafetyWrite(), Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "aitable", + Name: "view_update_group", + CanonicalPath: "aitable.view_update_group", + CLIPath: "aitable view update group", + PrimaryCLIPath: "aitable view update group", + }, Description: "更新视图分组", Interface: aitableMCPInterface("update_view"), Selection: contract.SelectionSpec{ @@ -3410,6 +3740,13 @@ colorConfigs (JSON 数组) / officialHoliday (bool)。`, DeclareLeafMetadata(viewUpdateNameCmd, LeafSpec{ Safety: aitableSafetyWrite(), Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "aitable", + Name: "view_update_name", + CanonicalPath: "aitable.view_update_name", + CLIPath: "aitable view update name", + PrimaryCLIPath: "aitable view update name", + }, Description: "重命名视图", Interface: aitableMCPInterface("update_view"), Selection: contract.SelectionSpec{ @@ -3467,6 +3804,13 @@ locked 为 true 表示视图已锁定,false 表示未锁定。`, DeclareLeafMetadata(viewGetLockCmd, LeafSpec{ Safety: aitableSafetyRead(), Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "aitable", + Name: "view_get_lock", + CanonicalPath: "aitable.view_get_lock", + CLIPath: "aitable view get lock", + PrimaryCLIPath: "aitable view get lock", + }, Description: "读取视图锁状态", Interface: aitableHelperMCPInterface("get_view_lock_status"), Selection: contract.SelectionSpec{ @@ -3502,6 +3846,13 @@ locked 为 true 表示视图已锁定,false 表示未锁定。`, DeclareLeafMetadata(viewLockCmd, LeafSpec{ Safety: aitableSafetyWrite(), Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "aitable", + Name: "view_lock", + CanonicalPath: "aitable.view_lock", + CLIPath: "aitable view lock", + PrimaryCLIPath: "aitable view lock", + }, Description: "锁定或管理视图锁。", Interface: aitableHelperMCPInterface("lock_or_unlock_view"), Selection: contract.SelectionSpec{ @@ -3531,6 +3882,13 @@ locked 为 true 表示视图已锁定,false 表示未锁定。`, DeclareLeafMetadata(viewGetFrozenColsCmd, LeafSpec{ Safety: aitableSafetyRead(), Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "aitable", + Name: "view_get_frozen_cols", + CanonicalPath: "aitable.view_get_frozen_cols", + CLIPath: "aitable view get frozen-cols", + PrimaryCLIPath: "aitable view get frozen-cols", + }, Description: "读取冻结列", Interface: aitableHelperMCPInterface("get_frozen_columns_of_view"), Selection: contract.SelectionSpec{ @@ -3572,6 +3930,13 @@ locked 为 true 表示视图已锁定,false 表示未锁定。`, DeclareLeafMetadata(viewUpdateFrozenColsCmd, LeafSpec{ Safety: aitableSafetyWrite(), Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "aitable", + Name: "view_update_frozen_cols", + CanonicalPath: "aitable.view_update_frozen_cols", + CLIPath: "aitable view update frozen-cols", + PrimaryCLIPath: "aitable view update frozen-cols", + }, Description: "更新冻结列", Interface: aitableHelperMCPInterface("set_frozen_columns_of_view"), Selection: contract.SelectionSpec{ @@ -3601,6 +3966,13 @@ locked 为 true 表示视图已锁定,false 表示未锁定。`, DeclareLeafMetadata(viewGetRowHeightCmd, LeafSpec{ Safety: aitableSafetyRead(), Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "aitable", + Name: "view_get_row_height", + CanonicalPath: "aitable.view_get_row_height", + CLIPath: "aitable view get row-height", + PrimaryCLIPath: "aitable view get row-height", + }, Description: "读取行高", Interface: aitableHelperMCPInterface("get_cell_height_of_view"), Selection: contract.SelectionSpec{ @@ -3642,6 +4014,13 @@ locked 为 true 表示视图已锁定,false 表示未锁定。`, DeclareLeafMetadata(viewUpdateRowHeightCmd, LeafSpec{ Safety: aitableSafetyWrite(), Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "aitable", + Name: "view_update_row_height", + CanonicalPath: "aitable.view_update_row_height", + CLIPath: "aitable view update row-height", + PrimaryCLIPath: "aitable view update row-height", + }, Description: "更新行高", Interface: aitableHelperMCPInterface("set_cell_height_of_view"), Selection: contract.SelectionSpec{ @@ -3667,6 +4046,13 @@ locked 为 true 表示视图已锁定,false 表示未锁定。`, DeclareLeafMetadata(viewGetFillColorRuleCmd, LeafSpec{ Safety: aitableSafetyRead(), Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "aitable", + Name: "view_get_fill_color_rule", + CanonicalPath: "aitable.view_get_fill_color_rule", + CLIPath: "aitable view get fill-color-rule", + PrimaryCLIPath: "aitable view get fill-color-rule", + }, Description: "读取填充色规则", Interface: aitableMCPInterface("get_views"), Selection: contract.SelectionSpec{ @@ -3721,6 +4107,13 @@ locked 为 true 表示视图已锁定,false 表示未锁定。`, DeclareLeafMetadata(viewUpdateFillColorRuleCmd, LeafSpec{ Safety: aitableSafetyWrite(), Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "aitable", + Name: "view_update_fill_color_rule", + CanonicalPath: "aitable.view_update_fill_color_rule", + CLIPath: "aitable view update fill-color-rule", + PrimaryCLIPath: "aitable view update fill-color-rule", + }, Description: "更新填充色规则", Interface: aitableMCPInterface("set_view_fill_color_rule"), Selection: contract.SelectionSpec{ @@ -3765,6 +4158,13 @@ locked 为 true 表示视图已锁定,false 表示未锁定。`, DeclareLeafMetadata(viewDuplicateCmd, LeafSpec{ Safety: aitableSafetyWrite(), Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "aitable", + Name: "view_duplicate", + CanonicalPath: "aitable.view_duplicate", + CLIPath: "aitable view duplicate", + PrimaryCLIPath: "aitable view duplicate", + }, Description: "复制视图。", Interface: aitableHelperMCPInterface("duplicate_view"), Selection: contract.SelectionSpec{ @@ -3821,6 +4221,13 @@ locked 为 true 表示视图已锁定,false 表示未锁定。`, DeclareLeafMetadata(viewDeleteCmd, LeafSpec{ Safety: aitableSafetyDestructive(), Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "aitable", + Name: "view_delete", + CanonicalPath: "aitable.view_delete", + CLIPath: "aitable view delete", + PrimaryCLIPath: "aitable view delete", + }, Description: "删除视图(不可删最后一个/锁定视图;需确认)。", Interface: aitableMCPInterface("delete_view"), Selection: contract.SelectionSpec{ @@ -3860,6 +4267,13 @@ locked 为 true 表示视图已锁定,false 表示未锁定。`, DeclareLeafMetadata(formListCmd, LeafSpec{ Safety: aitableSafetyRead(), Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "aitable", + Name: "form_list", + CanonicalPath: "aitable.form_list", + CLIPath: "aitable form list", + PrimaryCLIPath: "aitable form list", + }, Description: "列出表单视图。", Interface: aitableCompositeInterface("Reviewed unpinned remote adapter: this executable CLI wrapper calls a remote helper that is absent from the pinned MCP metadata snapshot; no single pinned semantically equivalent interface_ref can represent the command."), Selection: contract.SelectionSpec{ @@ -3898,6 +4312,13 @@ locked 为 true 表示视图已锁定,false 表示未锁定。`, DeclareLeafMetadata(formCreateCmd, LeafSpec{ Safety: aitableSafetyWrite(), Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "aitable", + Name: "form_create", + CanonicalPath: "aitable.form_create", + CLIPath: "aitable form create", + PrimaryCLIPath: "aitable form create", + }, Description: "创建表单视图(推荐路径;也可用 view create FormDesigner)。", Interface: aitableCompositeInterface("Reviewed composite wrapper: the CLI constrains pinned aitable/create_view to FormDesigner and applies form-specific argument semantics, so it is not a direct parameter-equivalent RPC projection."), Selection: contract.SelectionSpec{ @@ -3953,6 +4374,13 @@ locked 为 true 表示视图已锁定,false 表示未锁定。`, DeclareLeafMetadata(formGetCmd, LeafSpec{ Safety: aitableSafetyRead(), Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "aitable", + Name: "form_get", + CanonicalPath: "aitable.form_get", + CLIPath: "aitable form get", + PrimaryCLIPath: "aitable form get", + }, Description: "按 viewId 获取表单详情。", Interface: aitableCompositeInterface("Reviewed unpinned remote adapter: this executable CLI wrapper calls a remote helper that is absent from the pinned MCP metadata snapshot; no single pinned semantically equivalent interface_ref can represent the command."), Selection: contract.SelectionSpec{ @@ -3990,6 +4418,13 @@ locked 为 true 表示视图已锁定,false 表示未锁定。`, DeclareLeafMetadata(formDeleteCmd, LeafSpec{ Safety: aitableSafetyDestructive(), Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "aitable", + Name: "form_delete", + CanonicalPath: "aitable.form_delete", + CLIPath: "aitable form delete", + PrimaryCLIPath: "aitable form delete", + }, Description: "删除表单(不可逆,需确认)。", Interface: aitableCompositeInterface("Reviewed unpinned remote adapter: this executable CLI wrapper calls a remote helper that is absent from the pinned MCP metadata snapshot; no single pinned semantically equivalent interface_ref can represent the command."), Selection: contract.SelectionSpec{ @@ -4040,6 +4475,13 @@ locked 为 true 表示视图已锁定,false 表示未锁定。`, DeclareLeafMetadata(formUpdateCmd, LeafSpec{ Safety: aitableSafetyWrite(), Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "aitable", + Name: "form_update", + CanonicalPath: "aitable.form_update", + CLIPath: "aitable form update", + PrimaryCLIPath: "aitable form update", + }, Description: "更新表单 title/name/description。", Interface: aitableCompositeInterface("Reviewed unpinned remote adapter: this executable CLI wrapper calls a remote helper that is absent from the pinned MCP metadata snapshot; no single pinned semantically equivalent interface_ref can represent the command."), Selection: contract.SelectionSpec{ @@ -4069,6 +4511,13 @@ locked 为 true 表示视图已锁定,false 表示未锁定。`, DeclareLeafMetadata(formQuestionsCreateCmd, LeafSpec{ Safety: aitableSafetyWrite(), Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "aitable", + Name: "form_questions_create", + CanonicalPath: "aitable.form_questions_create", + CLIPath: "aitable form questions create", + PrimaryCLIPath: "aitable form questions create", + }, Description: "在表单侧创建题目(等价 field create)。", Interface: aitableCompositeInterface("Reviewed composite wrapper: the CLI converts single-question flags or batch JSON into the pinned aitable/create_fields request, so it is not a direct parameter-equivalent RPC projection."), Selection: contract.SelectionSpec{ @@ -4091,6 +4540,13 @@ locked 为 true 表示视图已锁定,false 表示未锁定。`, DeclareLeafMetadata(formQuestionsDeleteCmd, LeafSpec{ Safety: aitableSafetyWriteConfirm(), Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "aitable", + Name: "form_questions_delete", + CanonicalPath: "aitable.form_questions_delete", + CLIPath: "aitable form questions delete", + PrimaryCLIPath: "aitable form questions delete", + }, Description: "删除表单题目(等价 field delete,需确认语义)。", Interface: aitableMCPInterface("delete_field"), Selection: contract.SelectionSpec{ @@ -4127,6 +4583,13 @@ locked 为 true 表示视图已锁定,false 表示未锁定。`, DeclareLeafMetadata(formFieldListCmd, LeafSpec{ Safety: aitableSafetyRead(), Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "aitable", + Name: "form_field_list", + CanonicalPath: "aitable.form_field_list", + CLIPath: "aitable form field list", + PrimaryCLIPath: "aitable form field list", + }, Description: "列出表单字段/题目。", Interface: aitableCompositeInterface("Reviewed unpinned remote adapter: this executable CLI wrapper calls a remote helper that is absent from the pinned MCP metadata snapshot; no single pinned semantically equivalent interface_ref can represent the command."), Selection: contract.SelectionSpec{ @@ -4171,6 +4634,13 @@ locked 为 true 表示视图已锁定,false 表示未锁定。`, DeclareLeafMetadata(formFieldUpdateCmd, LeafSpec{ Safety: aitableSafetyWrite(), Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "aitable", + Name: "form_field_update", + CanonicalPath: "aitable.form_field_update", + CLIPath: "aitable form field update", + PrimaryCLIPath: "aitable form field update", + }, Description: "更新表单字段展示属性。", Interface: aitableCompositeInterface("Reviewed unpinned remote adapter: this executable CLI wrapper calls a remote helper that is absent from the pinned MCP metadata snapshot; no single pinned semantically equivalent interface_ref can represent the command."), Selection: contract.SelectionSpec{ @@ -4213,6 +4683,13 @@ locked 为 true 表示视图已锁定,false 表示未锁定。`, Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "aitable", + Name: "form_field_hide", + CanonicalPath: "aitable.form_field_hide", + CLIPath: "aitable form field hide", + PrimaryCLIPath: "aitable form field hide", + }, Description: "切换表单中字段的隐藏/显示。", Interface: aitableCompositeInterface("Reviewed unpinned remote adapter: this executable CLI wrapper calls a remote helper that is absent from the pinned MCP metadata snapshot; no single pinned semantically equivalent interface_ref can represent the command."), Selection: contract.SelectionSpec{ @@ -4249,6 +4726,13 @@ locked 为 true 表示视图已锁定,false 表示未锁定。`, DeclareLeafMetadata(formShareGetCmd, LeafSpec{ Safety: aitableSafetyRead(), Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "aitable", + Name: "form_share_get", + CanonicalPath: "aitable.form_share_get", + CLIPath: "aitable form share get", + PrimaryCLIPath: "aitable form share get", + }, Description: "获取表单分享配置。", Interface: aitableCompositeInterface("Reviewed unpinned remote adapter: this executable CLI wrapper calls a remote helper that is absent from the pinned MCP metadata snapshot; no single pinned semantically equivalent interface_ref can represent the command."), Selection: contract.SelectionSpec{ @@ -4286,6 +4770,13 @@ locked 为 true 表示视图已锁定,false 表示未锁定。`, DeclareLeafMetadata(formShareUpdateCmd, LeafSpec{ Safety: aitableSafetyWrite(), Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "aitable", + Name: "form_share_update", + CanonicalPath: "aitable.form_share_update", + CLIPath: "aitable form share update", + PrimaryCLIPath: "aitable form share update", + }, Description: "更新表单分享配置。", Interface: aitableCompositeInterface("Reviewed unpinned remote adapter: this executable CLI wrapper calls a remote helper that is absent from the pinned MCP metadata snapshot; no single pinned semantically equivalent interface_ref can represent the command."), Selection: contract.SelectionSpec{ @@ -4346,6 +4837,13 @@ valid=false 仍表示 DSL 校验或发布未通过,必须读取 issues 修正 Confirmation: "not_required", Idempotency: "non_idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "aitable", + Name: "workflow_create", + CanonicalPath: "aitable.workflow_create", + CLIPath: "aitable workflow create", + PrimaryCLIPath: "aitable workflow create", + }, Description: "创建并发布 AI 表格自动化工作流。", Interface: aitableCompositeInterface("Reviewed unpinned remote adapter: this executable CLI wrapper calls a remote helper that is absent from the pinned MCP metadata snapshot; no single pinned semantically equivalent interface_ref can represent the command."), Selection: contract.SelectionSpec{ @@ -4399,6 +4897,13 @@ valid=false 仍表示 DSL 校验或发布未通过,必须读取 issues 修正 DeclareLeafMetadata(workflowUpdateCmd, LeafSpec{ Safety: aitableSafetyWrite(), Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "aitable", + Name: "workflow_update", + CanonicalPath: "aitable.workflow_update", + CLIPath: "aitable workflow update", + PrimaryCLIPath: "aitable workflow update", + }, Description: "用完整 DSL 更新并发布已有 AI 表格自动化工作流。", Interface: aitableCompositeInterface("Reviewed unpinned remote adapter: this executable CLI wrapper calls a remote helper that is absent from the pinned MCP metadata snapshot; no single pinned semantically equivalent interface_ref can represent the command."), Selection: contract.SelectionSpec{ @@ -4441,6 +4946,13 @@ valid=false 仍表示 DSL 校验或发布未通过,必须读取 issues 修正 DeclareLeafMetadata(workflowEnableCmd, LeafSpec{ Safety: aitableSafetyWrite(), Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "aitable", + Name: "workflow_enable", + CanonicalPath: "aitable.workflow_enable", + CLIPath: "aitable workflow enable", + PrimaryCLIPath: "aitable workflow enable", + }, Description: "启用工作流。", Interface: aitableHelperMCPInterface("enable_workflow"), Selection: contract.SelectionSpec{ @@ -4482,6 +4994,13 @@ valid=false 仍表示 DSL 校验或发布未通过,必须读取 issues 修正 Confirmation: "user_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "aitable", + Name: "workflow_disable", + CanonicalPath: "aitable.workflow_disable", + CLIPath: "aitable workflow disable", + PrimaryCLIPath: "aitable workflow disable", + }, Description: "禁用工作流(高危,需确认;status 变 STOP)。", Interface: aitableHelperMCPInterface("disable_workflow"), Selection: contract.SelectionSpec{ @@ -4517,6 +5036,13 @@ valid=false 仍表示 DSL 校验或发布未通过,必须读取 issues 修正 DeclareLeafMetadata(workflowGetCmd, LeafSpec{ Safety: aitableSafetyRead(), Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "aitable", + Name: "workflow_get", + CanonicalPath: "aitable.workflow_get", + CLIPath: "aitable workflow get", + PrimaryCLIPath: "aitable workflow get", + }, Description: "获取工作流详情(含 flowSchema)。", Interface: aitableHelperMCPInterface("get_workflow"), Selection: contract.SelectionSpec{ @@ -4562,6 +5088,13 @@ valid=false 仍表示 DSL 校验或发布未通过,必须读取 issues 修正 DeclareLeafMetadata(workflowListCmd, LeafSpec{ Safety: aitableSafetyRead(), Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "aitable", + Name: "workflow_list", + CanonicalPath: "aitable.workflow_list", + CLIPath: "aitable workflow list", + PrimaryCLIPath: "aitable workflow list", + }, Description: "列出 Base 下自动化工作流。", Interface: aitableHelperMCPInterface("list_workflows"), Selection: contract.SelectionSpec{ @@ -4590,6 +5123,13 @@ valid=false 仍表示 DSL 校验或发布未通过,必须读取 issues 修正 DeclareLeafMetadata(dashboardConfigExampleCmd, LeafSpec{ Safety: aitableSafetyRead(), Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "aitable", + Name: "dashboard_config_example", + CanonicalPath: "aitable.dashboard_config_example", + CLIPath: "aitable dashboard config-example", + PrimaryCLIPath: "aitable dashboard config-example", + }, Description: "查看仪表盘配置模板。", Interface: aitableMCPInterface("get_dashboard_config_example"), Selection: contract.SelectionSpec{ @@ -4625,6 +5165,13 @@ valid=false 仍表示 DSL 校验或发布未通过,必须读取 issues 修正 DeclareLeafMetadata(dashboardGetCmd, LeafSpec{ Safety: aitableSafetyRead(), Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "aitable", + Name: "dashboard_get", + CanonicalPath: "aitable.dashboard_get", + CLIPath: "aitable dashboard get", + PrimaryCLIPath: "aitable dashboard get", + }, Description: "获取仪表盘及 charts 列表。", Interface: aitableMCPInterface("get_dashboard"), Selection: contract.SelectionSpec{ @@ -4675,6 +5222,13 @@ valid=false 仍表示 DSL 校验或发布未通过,必须读取 issues 修正 DeclareLeafMetadata(dashboardCreateCmd, LeafSpec{ Safety: aitableSafetyWrite(), Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "aitable", + Name: "dashboard_create", + CanonicalPath: "aitable.dashboard_create", + CLIPath: "aitable dashboard create", + PrimaryCLIPath: "aitable dashboard create", + }, Description: "创建仪表盘。", Interface: aitableMCPInterface("create_dashboard"), Selection: contract.SelectionSpec{ @@ -4733,6 +5287,13 @@ valid=false 仍表示 DSL 校验或发布未通过,必须读取 issues 修正 DeclareLeafMetadata(dashboardUpdateCmd, LeafSpec{ Safety: aitableSafetyWrite(), Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "aitable", + Name: "dashboard_update", + CanonicalPath: "aitable.dashboard_update", + CLIPath: "aitable dashboard update", + PrimaryCLIPath: "aitable dashboard update", + }, Description: "更新仪表盘。", Interface: aitableMCPInterface("update_dashboard"), Selection: contract.SelectionSpec{ @@ -4776,6 +5337,13 @@ valid=false 仍表示 DSL 校验或发布未通过,必须读取 issues 修正 DeclareLeafMetadata(dashboardDeleteCmd, LeafSpec{ Safety: aitableSafetyDestructive(), Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "aitable", + Name: "dashboard_delete", + CanonicalPath: "aitable.dashboard_delete", + CLIPath: "aitable dashboard delete", + PrimaryCLIPath: "aitable dashboard delete", + }, Description: "删除仪表盘(需确认)。", Interface: aitableMCPInterface("delete_dashboard"), Selection: contract.SelectionSpec{ @@ -4815,6 +5383,13 @@ layout 数组里每项含图表的新位置(row/col/width/height)。`, DeclareLeafMetadata(dashboardArrangeCmd, LeafSpec{ Safety: aitableSafetyWrite(), Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "aitable", + Name: "dashboard_arrange", + CanonicalPath: "aitable.dashboard_arrange", + CLIPath: "aitable dashboard arrange", + PrimaryCLIPath: "aitable dashboard arrange", + }, Description: "调整仪表盘布局。", Interface: aitableHelperMCPInterface("align_dashboard"), Selection: contract.SelectionSpec{ @@ -4853,6 +5428,13 @@ layout 数组里每项含图表的新位置(row/col/width/height)。`, DeclareLeafMetadata(dashboardShareGetCmd, LeafSpec{ Safety: aitableSafetyRead(), Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "aitable", + Name: "dashboard_share_get", + CanonicalPath: "aitable.dashboard_share_get", + CLIPath: "aitable dashboard share get", + PrimaryCLIPath: "aitable dashboard share get", + }, Description: "查询仪表盘分享配置(可能 404,按可重试处理)。", Interface: aitableMCPInterface("get_dashboard_share"), Selection: contract.SelectionSpec{ @@ -4903,6 +5485,13 @@ layout 数组里每项含图表的新位置(row/col/width/height)。`, DeclareLeafMetadata(dashboardShareUpdateCmd, LeafSpec{ Safety: aitableSafetyWrite(), Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "aitable", + Name: "dashboard_share_update", + CanonicalPath: "aitable.dashboard_share_update", + CLIPath: "aitable dashboard share update", + PrimaryCLIPath: "aitable dashboard share update", + }, Description: "更新仪表盘分享配置。", Interface: aitableMCPInterface("update_dashboard_share"), Selection: contract.SelectionSpec{ @@ -4931,6 +5520,13 @@ layout 数组里每项含图表的新位置(row/col/width/height)。`, DeclareLeafMetadata(chartWidgetsExampleCmd, LeafSpec{ Safety: aitableSafetyRead(), Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "aitable", + Name: "chart_widgets_example", + CanonicalPath: "aitable.chart_widgets_example", + CLIPath: "aitable chart widgets-example", + PrimaryCLIPath: "aitable chart widgets-example", + }, Description: "查看图表 widgets 配置模板。", Interface: aitableMCPInterface("get_dashboard_widgets_example"), Selection: contract.SelectionSpec{ @@ -4968,6 +5564,13 @@ layout 数组里每项含图表的新位置(row/col/width/height)。`, DeclareLeafMetadata(chartGetCmd, LeafSpec{ Safety: aitableSafetyRead(), Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "aitable", + Name: "chart_get", + CanonicalPath: "aitable.chart_get", + CLIPath: "aitable chart get", + PrimaryCLIPath: "aitable chart get", + }, Description: "获取图表详情。", Interface: aitableMCPInterface("get_chart"), Selection: contract.SelectionSpec{ @@ -5013,6 +5616,13 @@ layout 数组里每项含图表的新位置(row/col/width/height)。`, DeclareLeafMetadata(chartCreateCmd, LeafSpec{ Safety: aitableSafetyWrite(), Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "aitable", + Name: "chart_create", + CanonicalPath: "aitable.chart_create", + CLIPath: "aitable chart create", + PrimaryCLIPath: "aitable chart create", + }, Description: "创建图表。", Interface: aitableMCPInterface("create_chart"), Selection: contract.SelectionSpec{ @@ -5061,6 +5671,13 @@ layout 数组里每项含图表的新位置(row/col/width/height)。`, DeclareLeafMetadata(chartUpdateCmd, LeafSpec{ Safety: aitableSafetyWrite(), Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "aitable", + Name: "chart_update", + CanonicalPath: "aitable.chart_update", + CLIPath: "aitable chart update", + PrimaryCLIPath: "aitable chart update", + }, Description: "更新图表。", Interface: aitableMCPInterface("update_chart"), Selection: contract.SelectionSpec{ @@ -5107,6 +5724,13 @@ layout 数组里每项含图表的新位置(row/col/width/height)。`, DeclareLeafMetadata(chartDeleteCmd, LeafSpec{ Safety: aitableSafetyDestructive(), Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "aitable", + Name: "chart_delete", + CanonicalPath: "aitable.chart_delete", + CLIPath: "aitable chart delete", + PrimaryCLIPath: "aitable chart delete", + }, Description: "删除图表(需确认)。", Interface: aitableMCPInterface("delete_chart"), Selection: contract.SelectionSpec{ @@ -5146,6 +5770,13 @@ layout 数组里每项含图表的新位置(row/col/width/height)。`, DeclareLeafMetadata(chartShareGetCmd, LeafSpec{ Safety: aitableSafetyRead(), Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "aitable", + Name: "chart_share_get", + CanonicalPath: "aitable.chart_share_get", + CLIPath: "aitable chart share get", + PrimaryCLIPath: "aitable chart share get", + }, Description: "获取图表分享配置(稳定返回 enabled)。", Interface: aitableMCPInterface("get_chart_share"), Selection: contract.SelectionSpec{ @@ -5197,6 +5828,13 @@ layout 数组里每项含图表的新位置(row/col/width/height)。`, DeclareLeafMetadata(chartShareUpdateCmd, LeafSpec{ Safety: aitableSafetyWrite(), Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "aitable", + Name: "chart_share_update", + CanonicalPath: "aitable.chart_share_update", + CLIPath: "aitable chart share update", + PrimaryCLIPath: "aitable chart share update", + }, Description: "更新图表分享配置。", Interface: aitableMCPInterface("update_chart_share"), Selection: contract.SelectionSpec{ @@ -5294,6 +5932,13 @@ export-format 可选值:excel、attachment、excel_and_attachment、excel_with DeclareLeafMetadata(exportDataCmd, LeafSpec{ Safety: aitableSafetyRead(), Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "aitable", + Name: "export_data", + CanonicalPath: "aitable.export_data", + CLIPath: "aitable export data", + PrimaryCLIPath: "aitable export data", + }, Description: "导出数据(异步:可能返回 taskId 需继续轮询)。", Interface: aitableMCPInterface("export_data"), Selection: contract.SelectionSpec{ @@ -5335,6 +5980,13 @@ export-format 可选值:excel、attachment、excel_and_attachment、excel_with DeclareLeafMetadata(advpermEnableCmd, LeafSpec{ Safety: aitableSafetyWrite(), Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "aitable", + Name: "advperm_enable", + CanonicalPath: "aitable.advperm_enable", + CLIPath: "aitable advperm enable", + PrimaryCLIPath: "aitable advperm enable", + }, Description: "开启 Base 高级权限总开关。", Interface: aitableHelperMCPInterface("set_advanced_permission"), Selection: contract.SelectionSpec{ @@ -5373,6 +6025,13 @@ message: "the current user must be a manager (administrator) of this base to man Confirmation: "user_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "aitable", + Name: "advperm_disable", + CanonicalPath: "aitable.advperm_disable", + CLIPath: "aitable advperm disable", + PrimaryCLIPath: "aitable advperm disable", + }, Description: "关闭高级权限总开关(高危,需确认;全员回退默认权限)。", Interface: aitableHelperMCPInterface("set_advanced_permission"), Selection: contract.SelectionSpec{ @@ -5407,6 +6066,13 @@ subRoles[].display.* 提供人类可读标签(authLevelLabel / targetTypeLabel DeclareLeafMetadata(advpermRoleListCmd, LeafSpec{ Safety: aitableSafetyRead(), Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "aitable", + Name: "advperm_role_list", + CanonicalPath: "aitable.advperm_role_list", + CLIPath: "aitable advperm role-list", + PrimaryCLIPath: "aitable advperm role-list", + }, Description: "列出 Base 下全部角色(含系统角色与自定义)。", Interface: aitableHelperMCPInterface("list_roles"), Selection: contract.SelectionSpec{ @@ -5441,6 +6107,13 @@ subRoles[].display.* 提供人类可读标签(authLevelLabel / targetTypeLabel DeclareLeafMetadata(advpermRoleGetCmd, LeafSpec{ Safety: aitableSafetyRead(), Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "aitable", + Name: "advperm_role_get", + CanonicalPath: "aitable.advperm_role_get", + CLIPath: "aitable advperm role-get", + PrimaryCLIPath: "aitable advperm role-get", + }, Description: "获取单角色完整配置(含 subRoles)。", Interface: aitableHelperMCPInterface("get_role"), Selection: contract.SelectionSpec{ @@ -5498,6 +6171,13 @@ subRoles[].display.* 提供人类可读标签(authLevelLabel / targetTypeLabel DeclareLeafMetadata(advpermRoleCreateCmd, LeafSpec{ Safety: aitableSafetyWrite(), Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "aitable", + Name: "advperm_role_create", + CanonicalPath: "aitable.advperm_role_create", + CLIPath: "aitable advperm role-create", + PrimaryCLIPath: "aitable advperm role-create", + }, Description: "创建自定义角色(可选同时指定 sub-roles)。", Interface: aitableHelperMCPInterface("create_role"), Selection: contract.SelectionSpec{ @@ -5558,6 +6238,13 @@ role-get 自行 merge)。 DeclareLeafMetadata(advpermRoleUpdateCmd, LeafSpec{ Safety: aitableSafetyWrite(), Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "aitable", + Name: "advperm_role_update", + CanonicalPath: "aitable.advperm_role_update", + CLIPath: "aitable advperm role-update", + PrimaryCLIPath: "aitable advperm role-update", + }, Description: "增量更新自定义角色(PATCH)。", Interface: aitableHelperMCPInterface("patch_role"), Selection: contract.SelectionSpec{ @@ -5599,6 +6286,13 @@ role-get 自行 merge)。 DeclareLeafMetadata(advpermRoleDeleteCmd, LeafSpec{ Safety: aitableSafetyDestructive(), Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "aitable", + Name: "advperm_role_delete", + CanonicalPath: "aitable.advperm_role_delete", + CLIPath: "aitable advperm role-delete", + PrimaryCLIPath: "aitable advperm role-delete", + }, Description: "删除自定义角色(需确认;系统角色禁删;需管理员)。", Interface: aitableHelperMCPInterface("delete_role"), Selection: contract.SelectionSpec{ @@ -5649,6 +6343,13 @@ role-get 自行 merge)。 DeclareLeafMetadata(importUploadCmd, LeafSpec{ Safety: aitableSafetyWrite(), Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "aitable", + Name: "import_upload", + CanonicalPath: "aitable.import_upload", + CLIPath: "aitable import upload", + PrimaryCLIPath: "aitable import upload", + }, Description: "申请导入文件上传凭证。", Interface: aitableMCPInterface("prepare_import_upload"), Selection: contract.SelectionSpec{ @@ -5713,6 +6414,13 @@ role-get 自行 merge)。 DeclareLeafMetadata(importDataCmd, LeafSpec{ Safety: aitableSafetyWrite(), Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "aitable", + Name: "import_data", + CanonicalPath: "aitable.import_data", + CLIPath: "aitable import data", + PrimaryCLIPath: "aitable import data", + }, Description: "触发数据导入。", Interface: aitableMCPInterface("import_data"), Selection: contract.SelectionSpec{ @@ -5765,6 +6473,13 @@ role-get 自行 merge)。 DeclareLeafMetadata(sectionCreateCmd, LeafSpec{ Safety: aitableSafetyWrite(), Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "aitable", + Name: "section_create", + CanonicalPath: "aitable.section_create", + CLIPath: "aitable section create", + PrimaryCLIPath: "aitable section create", + }, Description: "在 Base 导航树创建文件夹。", Interface: aitableHelperMCPInterface("create_section"), Selection: contract.SelectionSpec{ @@ -5803,6 +6518,13 @@ role-get 自行 merge)。 DeclareLeafMetadata(sectionRenameCmd, LeafSpec{ Safety: aitableSafetyWrite(), Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "aitable", + Name: "section_rename", + CanonicalPath: "aitable.section_rename", + CLIPath: "aitable section rename", + PrimaryCLIPath: "aitable section rename", + }, Description: "重命名文件夹。", Interface: aitableHelperMCPInterface("rename_section"), Selection: contract.SelectionSpec{ @@ -5840,6 +6562,13 @@ role-get 自行 merge)。 DeclareLeafMetadata(sectionDeleteCmd, LeafSpec{ Safety: aitableSafetyWrite(), Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "aitable", + Name: "section_delete", + CanonicalPath: "aitable.section_delete", + CLIPath: "aitable section delete", + PrimaryCLIPath: "aitable section delete", + }, Description: "删除文件夹(运行时无 confirmDelete;调用前自行确认)。", Interface: aitableHelperMCPInterface("delete_section"), Selection: contract.SelectionSpec{ @@ -5882,6 +6611,13 @@ role-get 自行 merge)。 DeclareLeafMetadata(sectionReorderCmd, LeafSpec{ Safety: aitableSafetyWrite(), Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "aitable", + Name: "section_reorder", + CanonicalPath: "aitable.section_reorder", + CLIPath: "aitable section reorder", + PrimaryCLIPath: "aitable section reorder", + }, Description: "在当前父文件夹下调整文件夹顺序。", Interface: aitableHelperMCPInterface("reorder_section"), Selection: contract.SelectionSpec{ @@ -5915,6 +6651,13 @@ parentSectionId 为空串表示该文件夹在 Base 根目录下。`, DeclareLeafMetadata(sectionListEmptyCmd, LeafSpec{ Safety: aitableSafetyRead(), Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "aitable", + Name: "section_list_empty", + CanonicalPath: "aitable.section_list_empty", + CLIPath: "aitable section list-empty", + PrimaryCLIPath: "aitable section list-empty", + }, Description: "列出空文件夹。", Interface: aitableHelperMCPInterface("list_empty_sections"), Selection: contract.SelectionSpec{ @@ -5949,6 +6692,13 @@ parentSectionId 为空串表示该节点在 Base 根目录下。 DeclareLeafMetadata(sectionListNodesCmd, LeafSpec{ Safety: aitableSafetyRead(), Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "aitable", + Name: "section_list_nodes", + CanonicalPath: "aitable.section_list_nodes", + CLIPath: "aitable section list-nodes", + PrimaryCLIPath: "aitable section list-nodes", + }, Description: "列出 Base 导航全部节点。", Interface: aitableHelperMCPInterface("list_nsheet_nodes"), Selection: contract.SelectionSpec{ @@ -5998,6 +6748,13 @@ parentSectionId 为空串表示该节点在 Base 根目录下。 DeclareLeafMetadata(sectionMoveNodeCmd, LeafSpec{ Safety: aitableSafetyWrite(), Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "aitable", + Name: "section_move_node", + CanonicalPath: "aitable.section_move_node", + CLIPath: "aitable section move-node", + PrimaryCLIPath: "aitable section move-node", + }, Description: "移动导航节点到新父文件夹。", Interface: aitableHelperMCPInterface("move_nsheet_node"), Selection: contract.SelectionSpec{ @@ -6073,6 +6830,13 @@ parentSectionId 为空串表示该节点在 Base 根目录下。 DeclareLeafMetadata(tableListCmd, LeafSpec{ Safety: aitableSafetyRead(), Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "aitable", + Name: "table_list", + CanonicalPath: "aitable.table_list", + CLIPath: "aitable table list", + PrimaryCLIPath: "aitable table list", + }, Description: "获取数据表(table get 别名)。", Interface: aitableMCPInterface("get_tables"), Selection: contract.SelectionSpec{ @@ -6136,6 +6900,13 @@ parentSectionId 为空串表示该节点在 Base 根目录下。 DeclareLeafMetadata(fieldListCmd, LeafSpec{ Safety: aitableSafetyRead(), Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "aitable", + Name: "field_list", + CanonicalPath: "aitable.field_list", + CLIPath: "aitable field list", + PrimaryCLIPath: "aitable field list", + }, Description: "获取字段信息(field get 别名)。", Interface: aitableMCPInterface("get_fields"), Selection: contract.SelectionSpec{ @@ -6286,6 +7057,13 @@ parentSectionId 为空串表示该节点在 Base 根目录下。 DeclareLeafMetadata(recordGetCmd, LeafSpec{ Safety: aitableSafetyRead(), Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "aitable", + Name: "record_get", + CanonicalPath: "aitable.record_get", + CLIPath: "aitable record get", + PrimaryCLIPath: "aitable record get", + }, Description: "按 recordIds 批量取记录(最多 100)。", Interface: aitableMCPInterface("query_records"), Selection: contract.SelectionSpec{ @@ -6426,6 +7204,13 @@ parentSectionId 为空串表示该节点在 Base 根目录下。 DeclareLeafMetadata(viewListCmd, LeafSpec{ Safety: aitableSafetyRead(), Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "aitable", + Name: "view_list", + CanonicalPath: "aitable.view_list", + CLIPath: "aitable view list", + PrimaryCLIPath: "aitable view list", + }, Description: "列出或获取视图配置。", Interface: aitableMCPInterface("get_views"), Selection: contract.SelectionSpec{ @@ -6703,6 +7488,13 @@ parentSectionId 为空串表示该节点在 Base 根目录下。 DeclareLeafMetadata(searchAliasCmd, LeafSpec{ Safety: aitableSafetyRead(), Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "aitable", + Name: "search", + CanonicalPath: "aitable.search", + CLIPath: "aitable search", + PrimaryCLIPath: "aitable search", + }, Description: "搜索 Base(search 别名)。", Interface: aitableMCPInterface("search_bases"), Selection: contract.SelectionSpec{ @@ -6731,6 +7523,13 @@ parentSectionId 为空串表示该节点在 Base 根目录下。 DeclareLeafMetadata(listAliasCmd, LeafSpec{ Safety: aitableSafetyRead(), Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "aitable", + Name: "list", + CanonicalPath: "aitable.list", + CLIPath: "aitable list", + PrimaryCLIPath: "aitable list", + }, Description: "列出最近 Base(list 别名)。", Interface: aitableMCPInterface("list_bases"), Selection: contract.SelectionSpec{ @@ -6758,6 +7557,13 @@ parentSectionId 为空串表示该节点在 Base 根目录下。 DeclareLeafMetadata(createAliasCmd, LeafSpec{ Safety: aitableSafetyWrite(), Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "aitable", + Name: "create", + CanonicalPath: "aitable.create", + CLIPath: "aitable create", + PrimaryCLIPath: "aitable create", + }, Description: "创建 AI 表格 Base(create 别名入口)。", Interface: aitableMCPInterface("create_base"), Selection: contract.SelectionSpec{ @@ -6789,6 +7595,13 @@ parentSectionId 为空串表示该节点在 Base 根目录下。 DeclareLeafMetadata(infoAliasCmd, LeafSpec{ Safety: aitableSafetyRead(), Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "aitable", + Name: "info", + CanonicalPath: "aitable.info", + CLIPath: "aitable info", + PrimaryCLIPath: "aitable info", + }, Description: "获取 Base 信息(info 别名)。", Interface: aitableMCPInterface("get_base"), Selection: contract.SelectionSpec{ diff --git a/internal/helpers/aitable_schema_test.go b/internal/helpers/aitable_schema_test.go index 78bbea9e..d13f59c6 100644 --- a/internal/helpers/aitable_schema_test.go +++ b/internal/helpers/aitable_schema_test.go @@ -29,6 +29,10 @@ import ( func TestDeclareLeafMetadataRejectsExecutionSurface(t *testing.T) { cmd := &cobra.Command{Use: "x", Short: "x"} schema := LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "dev", Name: "create_thing", CanonicalPath: "dev.create_thing", + CLIPath: "dev create", PrimaryCLIPath: "dev create", + }, Description: "d", Interface: &contract.InterfaceSpec{Mode: "mcp", Availability: "available", Ref: &contract.InterfaceRefSpec{ProductID: "p", RPCName: "t"}}, Selection: contract.SelectionSpec{ @@ -71,6 +75,14 @@ func TestDeclareLeafMetadataDoesNotRewriteRunE(t *testing.T) { DeclareLeafMetadata(cmd, LeafSpec{ Safety: aitableSafetyRead(), Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "dev", + Name: "create_thing", + CanonicalPath: "dev.create_thing", + CLIPath: "dev create", + PrimaryCLIPath: "dev create", + }, + Description: "d", Interface: aitableMCPInterface("tool"), Selection: contract.SelectionSpec{ diff --git a/internal/helpers/attendance.go b/internal/helpers/attendance.go index 699fe842..b8fbcb41 100644 --- a/internal/helpers/attendance.go +++ b/internal/helpers/attendance.go @@ -578,6 +578,13 @@ func newAttendanceCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "attendance", + Name: "get_user_attendance_record", + CanonicalPath: "attendance.get_user_attendance_record", + CLIPath: "attendance record get", + PrimaryCLIPath: "attendance record get", + }, Description: "查询个人考勤详情", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -671,6 +678,13 @@ func newAttendanceCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "attendance", + Name: "check_result", + CanonicalPath: "attendance.check_result", + CLIPath: "attendance check result", + PrimaryCLIPath: "attendance check result", + }, Description: "查询打卡结果", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -741,6 +755,13 @@ func newAttendanceCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "attendance", + Name: "check_record", + CanonicalPath: "attendance.check_record", + CLIPath: "attendance check record", + PrimaryCLIPath: "attendance check record", + }, Description: "查询打卡记录", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -874,6 +895,13 @@ func newAttendanceCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "attendance", + Name: "approve_list", + CanonicalPath: "attendance.approve_list", + CLIPath: "attendance approve list", + PrimaryCLIPath: "attendance approve list", + }, Description: "查询考勤相关审批单记录", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -933,6 +961,13 @@ func newAttendanceCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "attendance", + Name: "approve_templates", + CanonicalPath: "attendance.approve_templates", + CLIPath: "attendance approve templates", + PrimaryCLIPath: "attendance approve templates", + }, Description: "查询考勤审批模板和提交入口", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -1000,6 +1035,13 @@ func newAttendanceCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "attendance", + Name: "batch_get_employee_shifts", + CanonicalPath: "attendance.batch_get_employee_shifts", + CLIPath: "attendance shift list", + PrimaryCLIPath: "attendance shift list", + }, Description: "批量查询员工班次信息", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -1072,6 +1114,13 @@ func newAttendanceCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "attendance", + Name: "class_search", + CanonicalPath: "attendance.class_search", + CLIPath: "attendance class search", + PrimaryCLIPath: "attendance class search", + }, Description: "查询班次定义列表", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -1116,6 +1165,13 @@ func newAttendanceCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "attendance", + Name: "class_get", + CanonicalPath: "attendance.class_get", + CLIPath: "attendance class get", + PrimaryCLIPath: "attendance class get", + }, Description: "查询单个班次定义详情", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -1219,6 +1275,13 @@ checkTime 字段统一使用 "HH:mm" 格式(如 "09:00"),CLI 自动转换 Confirmation: "user_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "attendance", + Name: "class_create", + CanonicalPath: "attendance.class_create", + CLIPath: "attendance class create", + PrimaryCLIPath: "attendance class create", + }, Description: "创建班次定义", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -1321,6 +1384,13 @@ checkTime 字段统一使用 "HH:mm" 格式(如 "09:00"),CLI 自动转换 Confirmation: "user_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "attendance", + Name: "class_update", + CanonicalPath: "attendance.class_update", + CLIPath: "attendance class update", + PrimaryCLIPath: "attendance class update", + }, Description: "更新班次定义", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -1370,6 +1440,13 @@ checkTime 字段统一使用 "HH:mm" 格式(如 "09:00"),CLI 自动转换 Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "attendance", + Name: "adjustment_get", + CanonicalPath: "attendance.adjustment_get", + CLIPath: "attendance adjustment get", + PrimaryCLIPath: "attendance adjustment get", + }, Description: "查询单个补卡规则详情", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -1428,6 +1505,13 @@ checkTime 字段统一使用 "HH:mm" 格式(如 "09:00"),CLI 自动转换 Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "attendance", + Name: "adjustment_search", + CanonicalPath: "attendance.adjustment_search", + CLIPath: "attendance adjustment search", + PrimaryCLIPath: "attendance adjustment search", + }, Description: "查询补卡规则列表", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -1481,6 +1565,13 @@ checkTime 字段统一使用 "HH:mm" 格式(如 "09:00"),CLI 自动转换 Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "attendance", + Name: "overtime_get", + CanonicalPath: "attendance.overtime_get", + CLIPath: "attendance overtime get", + PrimaryCLIPath: "attendance overtime get", + }, Description: "查询单个加班规则详情", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -1539,6 +1630,13 @@ checkTime 字段统一使用 "HH:mm" 格式(如 "09:00"),CLI 自动转换 Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "attendance", + Name: "overtime_search", + CanonicalPath: "attendance.overtime_search", + CLIPath: "attendance overtime search", + PrimaryCLIPath: "attendance overtime search", + }, Description: "查询加班规则列表", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -1635,6 +1733,13 @@ CLI 会在未传筛选条件时补齐默认查询字段,在未传分页参数 Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "attendance", + Name: "group_search", + CanonicalPath: "attendance.group_search", + CLIPath: "attendance group search", + PrimaryCLIPath: "attendance group search", + }, Description: "查询考勤组列表", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -1684,6 +1789,13 @@ CLI 会在未传筛选条件时补齐默认查询字段,在未传分页参数 Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "attendance", + Name: "group_get", + CanonicalPath: "attendance.group_get", + CLIPath: "attendance group get", + PrimaryCLIPath: "attendance group get", + }, Description: "查询考勤组完整详情", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -1742,6 +1854,13 @@ CLI 会在未传筛选条件时补齐默认查询字段,在未传分页参数 Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "attendance", + Name: "group_filtered_get", + CanonicalPath: "attendance.group_filtered_get", + CLIPath: "attendance group filtered-get", + PrimaryCLIPath: "attendance group filtered-get", + }, Description: "查询考勤组指定字段子集", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -1821,6 +1940,13 @@ CLI 会在未传筛选条件时补齐默认查询字段,在未传分页参数 Confirmation: "user_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "attendance", + Name: "group_update_members", + CanonicalPath: "attendance.group_update_members", + CLIPath: "attendance group update-members", + PrimaryCLIPath: "attendance group update-members", + }, Description: "增删考勤组成员", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -2066,6 +2192,13 @@ CLI 会在未传筛选条件时补齐默认查询字段,在未传分页参数 Confirmation: "user_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "attendance", + Name: "group_create", + CanonicalPath: "attendance.group_create", + CLIPath: "attendance group create", + PrimaryCLIPath: "attendance group create", + }, Description: "创建考勤组", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -2277,6 +2410,13 @@ CLI 会在未传筛选条件时补齐默认查询字段,在未传分页参数 Confirmation: "user_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "attendance", + Name: "group_update", + CanonicalPath: "attendance.group_update", + CLIPath: "attendance group update", + PrimaryCLIPath: "attendance group update", + }, Description: "更新考勤组配置", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -2334,6 +2474,13 @@ statsType 统计类型支持:week(周统计)、month(月统计)。`, Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "attendance", + Name: "get_attendance_summary", + CanonicalPath: "attendance.get_attendance_summary", + CLIPath: "attendance summary", + PrimaryCLIPath: "attendance summary", + }, Description: "查询个人考勤统计摘要", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -2395,6 +2542,13 @@ statsType 统计类型支持:week(周统计)、month(月统计)。`, Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "attendance", + Name: "query_attendance_group_or_rules", + CanonicalPath: "attendance.query_attendance_group_or_rules", + CLIPath: "attendance rules", + PrimaryCLIPath: "attendance rules", + }, Description: "查询考勤组与考勤规则", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -2533,6 +2687,13 @@ statsType 统计类型支持:week(周统计)、month(月统计)。`, Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "attendance", + Name: "selfsetting_get", + CanonicalPath: "attendance.selfsetting_get", + CLIPath: "attendance selfsetting get", + PrimaryCLIPath: "attendance selfsetting get", + }, Description: "查询个人考勤设置", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -2636,6 +2797,13 @@ statsType 统计类型支持:week(周统计)、month(月统计)。`, Confirmation: "user_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "attendance", + Name: "selfsetting_save", + CanonicalPath: "attendance.selfsetting_save", + CLIPath: "attendance selfsetting save", + PrimaryCLIPath: "attendance selfsetting save", + }, Description: "更新个人考勤设置", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -2708,6 +2876,13 @@ statsType 统计类型支持:week(周统计)、month(月统计)。`, Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "attendance", + Name: "globalsetting_get", + CanonicalPath: "attendance.globalsetting_get", + CLIPath: "attendance globalsetting get", + PrimaryCLIPath: "attendance globalsetting get", + }, Description: "查询企业全局考勤设置", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -2793,6 +2968,13 @@ statsType 统计类型支持:week(周统计)、month(月统计)。`, Confirmation: "user_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "attendance", + Name: "globalsetting_save", + CanonicalPath: "attendance.globalsetting_save", + CLIPath: "attendance globalsetting save", + PrimaryCLIPath: "attendance globalsetting save", + }, Description: "更新企业全局考勤设置", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -2846,6 +3028,13 @@ statsType 统计类型支持:week(周统计)、month(月统计)。`, Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "attendance", + Name: "report_columns", + CanonicalPath: "attendance.report_columns", + CLIPath: "attendance report columns", + PrimaryCLIPath: "attendance report columns", + }, Description: "查询可查看的考勤报表字段", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -2919,6 +3108,13 @@ statsType 统计类型支持:week(周统计)、month(月统计)。`, Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "attendance", + Name: "report_query_data", + CanonicalPath: "attendance.report_query_data", + CLIPath: "attendance report query-data", + PrimaryCLIPath: "attendance report query-data", + }, Description: "查询考勤报表数据", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -2991,6 +3187,13 @@ statsType 统计类型支持:week(周统计)、month(月统计)。`, Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "attendance", + Name: "report_query_leave", + CanonicalPath: "attendance.report_query_leave", + CLIPath: "attendance report query-leave", + PrimaryCLIPath: "attendance report query-leave", + }, Description: "查询假期报表数据", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -3050,6 +3253,13 @@ statsType 统计类型支持:week(周统计)、month(月统计)。`, Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "attendance", + Name: "vacation_types", + CanonicalPath: "attendance.vacation_types", + CLIPath: "attendance vacation types", + PrimaryCLIPath: "attendance vacation types", + }, Description: "查询可用假期类型", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -3106,6 +3316,13 @@ statsType 统计类型支持:week(周统计)、month(月统计)。`, Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "attendance", + Name: "vacation_balance", + CanonicalPath: "attendance.vacation_balance", + CLIPath: "attendance vacation balance", + PrimaryCLIPath: "attendance vacation balance", + }, Description: "查询员工假期余额", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -3169,6 +3386,13 @@ statsType 统计类型支持:week(周统计)、month(月统计)。`, Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "attendance", + Name: "vacation_records", + CanonicalPath: "attendance.vacation_records", + CLIPath: "attendance vacation records", + PrimaryCLIPath: "attendance vacation records", + }, Description: "查询假期余额变更记录", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -3364,6 +3588,13 @@ statsType 统计类型支持:week(周统计)、month(月统计)。`, Confirmation: "user_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "attendance", + Name: "vacation_update_type", + CanonicalPath: "attendance.vacation_update_type", + CLIPath: "attendance vacation update-type", + PrimaryCLIPath: "attendance vacation update-type", + }, Description: "更新假期类型规则", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -3461,6 +3692,13 @@ statsType 统计类型支持:week(周统计)、month(月统计)。`, Confirmation: "user_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "attendance", + Name: "vacation_save_balance", + CanonicalPath: "attendance.vacation_save_balance", + CLIPath: "attendance vacation save-balance", + PrimaryCLIPath: "attendance vacation save-balance", + }, Description: "调整员工假期余额", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -3624,6 +3862,13 @@ statsType 统计类型支持:week(周统计)、month(月统计)。`, Confirmation: "user_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "attendance", + Name: "schedule_import", + CanonicalPath: "attendance.schedule_import", + CLIPath: "attendance schedule import", + PrimaryCLIPath: "attendance schedule import", + }, Description: "导入排班制考勤组排班记录", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -3711,6 +3956,13 @@ statsType 统计类型支持:week(周统计)、month(月统计)。`, Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "attendance", + Name: "schedule_get", + CanonicalPath: "attendance.schedule_get", + CLIPath: "attendance schedule get", + PrimaryCLIPath: "attendance schedule get", + }, Description: "查询员工排班记录", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -4035,6 +4287,13 @@ statsType 统计类型支持:week(周统计)、month(月统计)。`, Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "attendance", + Name: "checkin_records", + CanonicalPath: "attendance.checkin_records", + CLIPath: "attendance checkin records", + PrimaryCLIPath: "attendance checkin records", + }, Description: "查询打卡流水记录", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -4155,6 +4414,13 @@ statsType 统计类型支持:week(周统计)、month(月统计)。`, Confirmation: "user_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "attendance", + Name: "boss_check", + CanonicalPath: "attendance.boss_check", + CLIPath: "attendance boss-check", + PrimaryCLIPath: "attendance boss-check", + }, Description: "管理员修正员工打卡结果", Interface: &contract.InterfaceSpec{ Mode: "composite", diff --git a/internal/helpers/calendar.go b/internal/helpers/calendar.go index 5ddf5a12..894c7fc3 100644 --- a/internal/helpers/calendar.go +++ b/internal/helpers/calendar.go @@ -318,6 +318,13 @@ func newCalendarCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "calendar", + Name: "list_calendar_events", + CanonicalPath: "calendar.list_calendar_events", + CLIPath: "calendar event list", + PrimaryCLIPath: "calendar event list", + }, Description: "查询当前用户日程列表", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -366,6 +373,13 @@ func newCalendarCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "calendar", + Name: "get_calendar_detail", + CanonicalPath: "calendar.get_calendar_detail", + CLIPath: "calendar event get", + PrimaryCLIPath: "calendar event get", + }, Description: "查询日程详情", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -475,6 +489,13 @@ func newCalendarCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "calendar", + Name: "create_calendar_event", + CanonicalPath: "calendar.create_calendar_event", + CLIPath: "calendar event create", + PrimaryCLIPath: "calendar event create", + }, Description: "创建日程", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -567,6 +588,13 @@ func newCalendarCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "calendar", + Name: "update_calendar_event", + CanonicalPath: "calendar.update_calendar_event", + CLIPath: "calendar event update", + PrimaryCLIPath: "calendar event update", + }, Description: "修改日程", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -619,6 +647,13 @@ func newCalendarCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "calendar", + Name: "delete_calendar_event", + CanonicalPath: "calendar.delete_calendar_event", + CLIPath: "calendar event delete", + PrimaryCLIPath: "calendar event delete", + }, Description: "删除指定日程", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -673,6 +708,13 @@ func newCalendarCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "calendar", + Name: "list_suggested_event_times", + CanonicalPath: "calendar.list_suggested_event_times", + CLIPath: "calendar event suggest", + PrimaryCLIPath: "calendar event suggest", + }, Description: "建议日程时间", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -740,6 +782,13 @@ func newCalendarCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "calendar", + Name: "respond", + CanonicalPath: "calendar.respond", + CLIPath: "calendar event respond", + PrimaryCLIPath: "calendar event respond", + }, Description: "响应日程", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -800,6 +849,13 @@ func newCalendarCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "calendar", + Name: "get_calendar_participants", + CanonicalPath: "calendar.get_calendar_participants", + CLIPath: "calendar attendee list", + PrimaryCLIPath: "calendar attendee list", + }, Description: "获取日程参与人", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -855,6 +911,13 @@ func newCalendarCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "calendar", + Name: "add_calendar_participant", + CanonicalPath: "calendar.add_calendar_participant", + CLIPath: "calendar attendee add", + PrimaryCLIPath: "calendar attendee add", + }, Description: "添加日程参与人", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -913,6 +976,13 @@ func newCalendarCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "calendar", + Name: "remove_calendar_participant", + CanonicalPath: "calendar.remove_calendar_participant", + CLIPath: "calendar attendee delete", + PrimaryCLIPath: "calendar attendee delete", + }, Description: "删除日程参与人", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -1068,6 +1138,13 @@ func newCalendarCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "calendar", + Name: "query_available_meeting_room", + CanonicalPath: "calendar.query_available_meeting_room", + CLIPath: "calendar room search", + PrimaryCLIPath: "calendar room search", + }, Description: "查询空闲或按名搜索会议室", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -1127,6 +1204,13 @@ func newCalendarCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "calendar", + Name: "add_meeting_room", + CanonicalPath: "calendar.add_meeting_room", + CLIPath: "calendar room add", + PrimaryCLIPath: "calendar room add", + }, Description: "为日程预订会议室", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -1183,6 +1267,13 @@ func newCalendarCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "calendar", + Name: "delete_meeting_room", + CanonicalPath: "calendar.delete_meeting_room", + CLIPath: "calendar room delete", + PrimaryCLIPath: "calendar room delete", + }, Description: "移除日程中的会议室", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -1230,6 +1321,13 @@ func newCalendarCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "calendar", + Name: "list_meeting_room_groups", + CanonicalPath: "calendar.list_meeting_room_groups", + CLIPath: "calendar room list-groups", + PrimaryCLIPath: "calendar room list-groups", + }, Description: "查询会议室分组列表", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -1313,6 +1411,13 @@ func newCalendarCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "calendar", + Name: "query_busy_status", + CanonicalPath: "calendar.query_busy_status", + CLIPath: "calendar busy search", + PrimaryCLIPath: "calendar busy search", + }, Description: "查询用户或会议室闲忙", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -1390,6 +1495,13 @@ func newCalendarCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "calendar", + Name: "add_attachments", + CanonicalPath: "calendar.add_attachments", + CLIPath: "calendar attachment add", + PrimaryCLIPath: "calendar attachment add", + }, Description: "为日程添加附件", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -1434,6 +1546,13 @@ func newCalendarCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "calendar", + Name: "list_acls", + CanonicalPath: "calendar.list_acls", + CLIPath: "calendar acl list", + PrimaryCLIPath: "calendar acl list", + }, Description: "查询主日历访问控制列表", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -1519,6 +1638,13 @@ func newCalendarCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "calendar", + Name: "list_calendars", + CanonicalPath: "calendar.list_calendars", + CLIPath: "calendar book list", + PrimaryCLIPath: "calendar book list", + }, Description: "查询用户日历列表", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -1557,6 +1683,13 @@ func newCalendarCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "calendar", + Name: "get_calendar", + CanonicalPath: "calendar.get_calendar", + CLIPath: "calendar book get", + PrimaryCLIPath: "calendar book get", + }, Description: "查询指定日历信息", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -1601,6 +1734,13 @@ func newCalendarCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "calendar", + Name: "search_calendar", + CanonicalPath: "calendar.search_calendar", + CLIPath: "calendar book search", + PrimaryCLIPath: "calendar book search", + }, Description: "搜索日历本列表", Interface: &contract.InterfaceSpec{ Mode: "mcp", diff --git a/internal/helpers/chat.go b/internal/helpers/chat.go index 3485ae2a..48a21c11 100644 --- a/internal/helpers/chat.go +++ b/internal/helpers/chat.go @@ -1243,6 +1243,13 @@ func newChatCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "chat", + Name: "create_group_conversation", + CanonicalPath: "chat.create_group_conversation", + CLIPath: "chat group create", + PrimaryCLIPath: "chat group create", + }, Description: "创建群聊并可指定群名与初始成员", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -1304,6 +1311,13 @@ func newChatCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "chat", + Name: "search_groups", + CanonicalPath: "chat.search_groups", + CLIPath: "chat search", + PrimaryCLIPath: "chat search", + }, Description: "按关键词搜索群聊并拿到 openConversationId", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -1372,6 +1386,13 @@ func newChatCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "chat", + Name: "add_robot_to_group", + CanonicalPath: "chat.add_robot_to_group", + CLIPath: "chat group members add-bot", + PrimaryCLIPath: "chat group members add-bot", + }, Description: "把企业机器人拉进我有管理权限的群", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -1414,6 +1435,13 @@ func newChatCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "chat", + Name: "update_group_name", + CanonicalPath: "chat.update_group_name", + CLIPath: "chat group rename", + PrimaryCLIPath: "chat group rename", + }, Description: "修改指定群聊的名称", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -1459,6 +1487,13 @@ func newChatCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "chat", + Name: "add_group_member", + CanonicalPath: "chat.add_group_member", + CLIPath: "chat group members add", + PrimaryCLIPath: "chat group members add", + }, Description: "向指定群聊添加成员", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -1507,6 +1542,13 @@ func newChatCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "chat", + Name: "remove_group_member", + CanonicalPath: "chat.remove_group_member", + CLIPath: "chat group members remove", + PrimaryCLIPath: "chat group members remove", + }, Description: "从指定群聊移除成员", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -1609,6 +1651,13 @@ func newChatCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "chat", + Name: "list_conversation_message_v2", + CanonicalPath: "chat.list_conversation_message_v2", + CLIPath: "chat message list", + PrimaryCLIPath: "chat message list", + }, Description: "分页读取指定会话消息及其引用上下文", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -1680,6 +1729,13 @@ func newChatCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "chat", + Name: "list_individual_chat_message", + CanonicalPath: "chat.list_individual_chat_message", + CLIPath: "chat message list-direct", + PrimaryCLIPath: "chat message list-direct", + }, Description: "读取与指定用户的单聊消息记录", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -1947,6 +2003,13 @@ func newChatCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "chat", + Name: "send_personal_message", + CanonicalPath: "chat.send_personal_message", + CLIPath: "chat message send", + PrimaryCLIPath: "chat message send", + }, Description: "以当前用户身份发送群聊或单聊消息", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -2072,6 +2135,13 @@ func newChatCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "chat", + Name: "send_robot_message", + CanonicalPath: "chat.send_robot_message", + CLIPath: "chat message send-by-bot", + PrimaryCLIPath: "chat message send-by-bot", + }, Description: "以应用机器人身份发送群消息或批量单聊", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -2127,6 +2197,13 @@ func newChatCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "chat", + Name: "recall_robot_message", + CanonicalPath: "chat.recall_robot_message", + CLIPath: "chat message recall-by-bot", + PrimaryCLIPath: "chat message recall-by-bot", + }, Description: "撤回指定机器人发送的消息", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -2212,6 +2289,13 @@ func newChatCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "chat", + Name: "send_message_by_custom_robot", + CanonicalPath: "chat.send_message_by_custom_robot", + CLIPath: "chat message send-by-webhook", + PrimaryCLIPath: "chat message send-by-webhook", + }, Description: "用自定义机器人 Webhook 向群发送消息", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -2273,6 +2357,13 @@ func newChatCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "chat", + Name: "list_topic_replies", + CanonicalPath: "chat.list_topic_replies", + CLIPath: "chat message list-topic-replies", + PrimaryCLIPath: "chat message list-topic-replies", + }, Description: "分页读取指定话题的回复", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -2321,6 +2412,13 @@ func newChatCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "chat", + Name: "search_messages_by_time_range", + CanonicalPath: "chat.search_messages_by_time_range", + CLIPath: "chat message list-all", + PrimaryCLIPath: "chat message list-all", + }, Description: "按时间范围搜索跨会话消息并保留权益指引", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -2399,6 +2497,13 @@ func newChatCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "chat", + Name: "search_messages_by_sender", + CanonicalPath: "chat.search_messages_by_sender", + CLIPath: "chat message list-by-sender", + PrimaryCLIPath: "chat message list-by-sender", + }, Description: "按发送者和时间范围查询消息", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -2464,6 +2569,13 @@ func newChatCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "chat", + Name: "search_at_me_message", + CanonicalPath: "chat.search_at_me_message", + CLIPath: "chat message list-mentions", + PrimaryCLIPath: "chat message list-mentions", + }, Description: "查询指定时间范围内提及当前用户的消息", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -2507,6 +2619,13 @@ func newChatCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "chat", + Name: "list_special_focus_messages", + CanonicalPath: "chat.list_special_focus_messages", + CLIPath: "chat message list-focused", + PrimaryCLIPath: "chat message list-focused", + }, Description: "列出当前用户特别关注的消息", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -2548,6 +2667,13 @@ func newChatCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "chat", + Name: "list_top_conversations", + CanonicalPath: "chat.list_top_conversations", + CLIPath: "chat list-top-conversations", + PrimaryCLIPath: "chat list-top-conversations", + }, Description: "列出当前用户置顶的会话", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -2586,6 +2712,13 @@ func newChatCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "chat", + Name: "unread_message_conversation_list", + CanonicalPath: "chat.unread_message_conversation_list", + CLIPath: "chat message list-unread-conversations", + PrimaryCLIPath: "chat message list-unread-conversations", + }, Description: "列出当前用户存在未读消息的会话", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -2649,6 +2782,13 @@ func newChatCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "chat", + Name: "search_messages_by_keyword", + CanonicalPath: "chat.search_messages_by_keyword", + CLIPath: "chat message search", + PrimaryCLIPath: "chat message search", + }, Description: "按关键词和时间范围搜索消息", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -2790,6 +2930,13 @@ func newChatCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "chat", + Name: "search_messages", + CanonicalPath: "chat.search_messages", + CLIPath: "chat message search-advanced", + PrimaryCLIPath: "chat message search-advanced", + }, Description: "按时间、关键词、发送者、@ 或会话等多维度搜索消息", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -2843,6 +2990,13 @@ func newChatCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "chat", + Name: "query_message_send_status", + CanonicalPath: "chat.query_message_send_status", + CLIPath: "chat message query-send-status", + PrimaryCLIPath: "chat message query-send-status", + }, Description: "查询异步消息发送任务的状态", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -2886,6 +3040,13 @@ func newChatCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "chat", + Name: "recall_message", + CanonicalPath: "chat.recall_message", + CLIPath: "chat message recall", + PrimaryCLIPath: "chat message recall", + }, Description: "撤回当前用户已发送的单条消息", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -2973,6 +3134,13 @@ func newChatCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "chat", + Name: "edit_message", + CanonicalPath: "chat.edit_message", + CLIPath: "chat message edit", + PrimaryCLIPath: "chat message edit", + }, Description: "编辑当前用户已发送消息的 Markdown 内容", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -3037,6 +3205,13 @@ func newChatCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "chat", + Name: "query_msg_read_status", + CanonicalPath: "chat.query_msg_read_status", + CLIPath: "chat message read-status", + PrimaryCLIPath: "chat message read-status", + }, Description: "查询指定消息的已读状态和人员", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -3072,6 +3247,13 @@ func newChatCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "chat", + Name: "search_common_groups", + CanonicalPath: "chat.search_common_groups", + CLIPath: "chat search-common", + PrimaryCLIPath: "chat search-common", + }, Description: "查询指定人员共同所在的群聊", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -3136,6 +3318,13 @@ func newChatCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "chat", + Name: "search_my_robots", + CanonicalPath: "chat.search_my_robots", + CLIPath: "chat bot search", + PrimaryCLIPath: "chat bot search", + }, Description: "搜索我创建的企业机器人并提取 robot-code", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -3566,6 +3755,13 @@ func newChatCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "chat", + Name: "get_conversation_info", + CanonicalPath: "chat.get_conversation_info", + CLIPath: "chat conversation-info", + PrimaryCLIPath: "chat conversation-info", + }, Description: "获取群聊或单聊会话的详细信息", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -3656,6 +3852,13 @@ func newChatCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "chat", + Name: "list_user_define_conv_categories", + CanonicalPath: "chat.list_user_define_conv_categories", + CLIPath: "chat category list", + PrimaryCLIPath: "chat category list", + }, Description: "列出当前用户的自定义会话分组", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -3693,6 +3896,13 @@ func newChatCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "chat", + Name: "list_conversations_by_category", + CanonicalPath: "chat.list_conversations_by_category", + CLIPath: "chat category list-conversations", + PrimaryCLIPath: "chat category list-conversations", + }, Description: "列出指定会话分组中的会话", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -3841,6 +4051,13 @@ func newChatCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "chat", + Name: "list_conv_categories_by_conv", + CanonicalPath: "chat.list_conv_categories_by_conv", + CLIPath: "chat category list-by-conv", + PrimaryCLIPath: "chat category list-by-conv", + }, Description: "查询指定会话所属的自定义会话分组", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -3886,6 +4103,13 @@ func newChatCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "chat", + Name: "get_conv_categories_info", + CanonicalPath: "chat.get_conv_categories_info", + CLIPath: "chat category batch-info", + PrimaryCLIPath: "chat category batch-info", + }, Description: "按分组 ID 批量获取自定义会话分组详情", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -3924,6 +4148,13 @@ func newChatCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "chat", + Name: "get_conv_info_by_group_id", + CanonicalPath: "chat.get_conv_info_by_group_id", + CLIPath: "chat group get-by-group-id", + PrimaryCLIPath: "chat group get-by-group-id", + }, Description: "把数字群号解析为群聊信息", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -3965,6 +4196,13 @@ func newChatCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "chat", + Name: "list_messages_by_ids", + CanonicalPath: "chat.list_messages_by_ids", + CLIPath: "chat message list-by-ids", + PrimaryCLIPath: "chat message list-by-ids", + }, Description: "按消息 ID 批量获取消息详情", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -4010,6 +4248,13 @@ func newChatCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "chat", + Name: "add_emoji_reaction", + CanonicalPath: "chat.add_emoji_reaction", + CLIPath: "chat message add-emoji", + PrimaryCLIPath: "chat message add-emoji", + }, Description: "给指定消息添加表情回应", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -4064,6 +4309,13 @@ func newChatCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "chat", + Name: "remove_emoji_reaction", + CanonicalPath: "chat.remove_emoji_reaction", + CLIPath: "chat message remove-emoji", + PrimaryCLIPath: "chat message remove-emoji", + }, Description: "移除指定消息上的表情回应", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -4120,6 +4372,13 @@ func newChatCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "chat", + Name: "add_text_emotion", + CanonicalPath: "chat.add_text_emotion", + CLIPath: "chat message add-text-emotion", + PrimaryCLIPath: "chat message add-text-emotion", + }, Description: "给指定消息添加已定义的文字表情", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -4178,6 +4437,13 @@ func newChatCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "chat", + Name: "remove_text_emotion", + CanonicalPath: "chat.remove_text_emotion", + CLIPath: "chat message remove-text-emotion", + PrimaryCLIPath: "chat message remove-text-emotion", + }, Description: "移除指定消息上的文字表情回应", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -4234,6 +4500,13 @@ func newChatCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "chat", + Name: "update_text_emotion", + CanonicalPath: "chat.update_text_emotion", + CLIPath: "chat message update-text-emotion", + PrimaryCLIPath: "chat message update-text-emotion", + }, Description: "把消息上已有的文字表情原地替换为新的文字表情", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -4306,6 +4579,13 @@ func newChatCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "chat", + Name: "create_text_emotion", + CanonicalPath: "chat.create_text_emotion", + CLIPath: "chat message create-text-emotion", + PrimaryCLIPath: "chat message create-text-emotion", + }, Description: "创建可用于消息回应的文字表情", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -4370,6 +4650,13 @@ flow-status 取值:1=处理中(PROCESSING),2=输入中(INPUTTING),3=完成 Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "chat", + Name: "create_and_send_card", + CanonicalPath: "chat.create_and_send_card", + CLIPath: "chat message send-card", + PrimaryCLIPath: "chat message send-card", + }, Description: "创建并向群聊或单聊发送互动卡片", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -4421,6 +4708,13 @@ flow-status 取值:1=处理中(PROCESSING),2=输入中(INPUTTING),3=完成 Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "chat", + Name: "update_streaming_card", + CanonicalPath: "chat.update_streaming_card", + CLIPath: "chat message update-card", + PrimaryCLIPath: "chat message update-card", + }, Description: "更新已发送流式卡片的内容和状态", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -4560,6 +4854,13 @@ flow-status 取值:1=处理中(PROCESSING),2=输入中(INPUTTING),3=完成 Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "chat", + Name: "download_media", + CanonicalPath: "chat.download_media", + CLIPath: "chat message download-media", + PrimaryCLIPath: "chat message download-media", + }, Description: "下载消息中的媒体资源到本地", DryRun: &contract.DryRunSpec{PreviewKind: "plan", RemoteReads: false}, Interface: &contract.InterfaceSpec{ @@ -4644,6 +4945,13 @@ flow-status 取值:1=处理中(PROCESSING),2=输入中(INPUTTING),3=完成 Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "chat", + Name: "transfer_group_owner", + CanonicalPath: "chat.transfer_group_owner", + CLIPath: "chat group transfer-owner", + PrimaryCLIPath: "chat group transfer-owner", + }, Description: "把群主身份转让给指定群成员", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -4696,6 +5004,13 @@ flow-status 取值:1=处理中(PROCESSING),2=输入中(INPUTTING),3=完成 Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "chat", + Name: "get_group_invite_url", + CanonicalPath: "chat.get_group_invite_url", + CLIPath: "chat group invite-url", + PrimaryCLIPath: "chat group invite-url", + }, Description: "获取指定群聊的邀请链接", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -4743,6 +5058,13 @@ flow-status 取值:1=处理中(PROCESSING),2=输入中(INPUTTING),3=完成 Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "chat", + Name: "update_notification_off", + CanonicalPath: "chat.update_notification_off", + CLIPath: "chat mute", + PrimaryCLIPath: "chat mute", + }, Description: "开启或关闭指定会话的免打扰", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -4791,6 +5113,13 @@ flow-status 取值:1=处理中(PROCESSING),2=输入中(INPUTTING),3=完成 Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "chat", + Name: "quit_group", + CanonicalPath: "chat.quit_group", + CLIPath: "chat group quit", + PrimaryCLIPath: "chat group quit", + }, Description: "当前用户退出群聊,群本身保留", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -4840,6 +5169,13 @@ flow-status 取值:1=处理中(PROCESSING),2=输入中(INPUTTING),3=完成 Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "chat", + Name: "update_group_icon", + CanonicalPath: "chat.update_group_icon", + CLIPath: "chat group update-icon", + PrimaryCLIPath: "chat group update-icon", + }, Description: "使用真实媒体 ID 更新群头像", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -4909,6 +5245,13 @@ flow-status 取值:1=处理中(PROCESSING),2=输入中(INPUTTING),3=完成 Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "chat", + Name: "update_group_settings", + CanonicalPath: "chat.update_group_settings", + CLIPath: "chat group update-settings", + PrimaryCLIPath: "chat group update-settings", + }, Description: "更新指定群聊的一项设置开关", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -4988,6 +5331,13 @@ flow-status 取值:1=处理中(PROCESSING),2=输入中(INPUTTING),3=完成 Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "chat", + Name: "reply_personal_message", + CanonicalPath: "chat.reply_personal_message", + CLIPath: "chat message reply", + PrimaryCLIPath: "chat message reply", + }, Description: "引用指定消息发送个人回复", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -5051,6 +5401,13 @@ flow-status 取值:1=处理中(PROCESSING),2=输入中(INPUTTING),3=完成 Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "chat", + Name: "forward_message", + CanonicalPath: "chat.forward_message", + CLIPath: "chat message forward", + PrimaryCLIPath: "chat message forward", + }, Description: "把一条已有消息转发到另一个会话", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -5108,6 +5465,13 @@ flow-status 取值:1=处理中(PROCESSING),2=输入中(INPUTTING),3=完成 Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "chat", + Name: "set_top_conversation", + CanonicalPath: "chat.set_top_conversation", + CLIPath: "chat set-top", + PrimaryCLIPath: "chat set-top", + }, Description: "设置或取消指定会话置顶", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -5152,6 +5516,13 @@ flow-status 取值:1=处理中(PROCESSING),2=输入中(INPUTTING),3=完成 Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "chat", + Name: "get_group_mute_config", + CanonicalPath: "chat.get_group_mute_config", + CLIPath: "chat group get-mute-config", + PrimaryCLIPath: "chat group get-mute-config", + }, Description: "查询群用户禁言配置(禁言黑名单/全员禁言白名单)", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -5196,6 +5567,13 @@ flow-status 取值:1=处理中(PROCESSING),2=输入中(INPUTTING),3=完成 Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "chat", + Name: "set_group_mute", + CanonicalPath: "chat.set_group_mute", + CLIPath: "chat group-mute", + PrimaryCLIPath: "chat group-mute", + }, Description: "开启或关闭群聊全员禁言", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -5284,6 +5662,13 @@ flow-status 取值:1=处理中(PROCESSING),2=输入中(INPUTTING),3=完成 Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "chat", + Name: "set_group_member_mute_list", + CanonicalPath: "chat.set_group_member_mute_list", + CLIPath: "chat group-mute-member", + PrimaryCLIPath: "chat group-mute-member", + }, Description: "禁言或解除禁言指定群成员", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -5357,6 +5742,13 @@ flow-status 取值:1=处理中(PROCESSING),2=输入中(INPUTTING),3=完成 Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "chat", + Name: "update_conv_member_roles", + CanonicalPath: "chat.update_conv_member_roles", + CLIPath: "chat group set-admin", + PrimaryCLIPath: "chat group set-admin", + }, Description: "设置或取消群管理员角色", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -5464,6 +5856,13 @@ flow-status 取值:1=处理中(PROCESSING),2=输入中(INPUTTING),3=完成 Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "chat", + Name: "list_custom_group_roles", + CanonicalPath: "chat.list_custom_group_roles", + CLIPath: "chat group-role list", + PrimaryCLIPath: "chat group-role list", + }, Description: "列出群聊中的自定义角色", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -5504,6 +5903,13 @@ flow-status 取值:1=处理中(PROCESSING),2=输入中(INPUTTING),3=完成 Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "chat", + Name: "add_custom_group_role", + CanonicalPath: "chat.add_custom_group_role", + CLIPath: "chat group-role add", + PrimaryCLIPath: "chat group-role add", + }, Description: "在群聊中创建自定义角色", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -5547,6 +5953,13 @@ flow-status 取值:1=处理中(PROCESSING),2=输入中(INPUTTING),3=完成 Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "chat", + Name: "update_custom_group_role", + CanonicalPath: "chat.update_custom_group_role", + CLIPath: "chat group-role update", + PrimaryCLIPath: "chat group-role update", + }, Description: "更新群聊自定义角色的名称", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -5592,6 +6005,13 @@ flow-status 取值:1=处理中(PROCESSING),2=输入中(INPUTTING),3=完成 Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "chat", + Name: "remove_custom_group_role", + CanonicalPath: "chat.remove_custom_group_role", + CLIPath: "chat group-role remove", + PrimaryCLIPath: "chat group-role remove", + }, Description: "删除群聊中的自定义角色", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -5648,6 +6068,13 @@ flow-status 取值:1=处理中(PROCESSING),2=输入中(INPUTTING),3=完成 Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "chat", + Name: "set_custom_user_roles", + CanonicalPath: "chat.set_custom_user_roles", + CLIPath: "chat group-role set-user", + PrimaryCLIPath: "chat group-role set-user", + }, Description: "为指定群成员设置自定义角色", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -5706,6 +6133,13 @@ flow-status 取值:1=处理中(PROCESSING),2=输入中(INPUTTING),3=完成 Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "chat", + Name: "remove_custom_user_roles", + CanonicalPath: "chat.remove_custom_user_roles", + CLIPath: "chat group-role remove-user", + PrimaryCLIPath: "chat group-role remove-user", + }, Description: "取消指定成员的一个或多个自定义角色", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -5762,6 +6196,13 @@ flow-status 取值:1=处理中(PROCESSING),2=输入中(INPUTTING),3=完成 Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "chat", + Name: "query_custom_user_roles", + CanonicalPath: "chat.query_custom_user_roles", + CLIPath: "chat group-role query-user", + PrimaryCLIPath: "chat group-role query-user", + }, Description: "查询指定群成员的自定义角色", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -5819,6 +6260,13 @@ flow-status 取值:1=处理中(PROCESSING),2=输入中(INPUTTING),3=完成 Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "chat", + Name: "list_group_bots", + CanonicalPath: "chat.list_group_bots", + CLIPath: "chat group bots", + PrimaryCLIPath: "chat group bots", + }, Description: "列出群内机器人", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -5862,6 +6310,13 @@ flow-status 取值:1=处理中(PROCESSING),2=输入中(INPUTTING),3=完成 Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "chat", + Name: "remove_robot_in_group", + CanonicalPath: "chat.remove_robot_in_group", + CLIPath: "chat group members remove-bot", + PrimaryCLIPath: "chat group members remove-bot", + }, Description: "从群内移除指定机器人", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -5928,6 +6383,13 @@ flow-status 取值:1=处理中(PROCESSING),2=输入中(INPUTTING),3=完成 Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "chat", + Name: "search_bots", + CanonicalPath: "chat.search_bots", + CLIPath: "chat bot find", + PrimaryCLIPath: "chat bot find", + }, Description: "按关键词搜索企业机器人并拿到 openDingTalkId", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -5975,6 +6437,13 @@ flow-status 取值:1=处理中(PROCESSING),2=输入中(INPUTTING),3=完成 Confirmation: "user_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "chat", + Name: "dismiss_group", + CanonicalPath: "chat.dismiss_group", + CLIPath: "chat group dismiss", + PrimaryCLIPath: "chat group dismiss", + }, Description: "永久解散指定群聊(不可恢复,仅群主)", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -6034,6 +6503,13 @@ flow-status 取值:1=处理中(PROCESSING),2=输入中(INPUTTING),3=完成 Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "chat", + Name: "update_show_history_msg_option", + CanonicalPath: "chat.update_show_history_msg_option", + CLIPath: "chat group set-history", + PrimaryCLIPath: "chat group set-history", + }, Description: "设置新成员可见的群历史消息范围", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -6088,6 +6564,13 @@ flow-status 取值:1=处理中(PROCESSING),2=输入中(INPUTTING),3=完成 Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "chat", + Name: "combine_forward_messages", + CanonicalPath: "chat.combine_forward_messages", + CLIPath: "chat message combine-forward", + PrimaryCLIPath: "chat message combine-forward", + }, Description: "把多条消息合并转发到目标会话", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -6149,6 +6632,13 @@ flow-status 取值:1=处理中(PROCESSING),2=输入中(INPUTTING),3=完成 Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "chat", + Name: "forward_topic", + CanonicalPath: "chat.forward_topic", + CLIPath: "chat message forward-topic", + PrimaryCLIPath: "chat message forward-topic", + }, Description: "把一个话题消息转发到目标会话", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -6205,6 +6695,13 @@ flow-status 取值:1=处理中(PROCESSING),2=输入中(INPUTTING),3=完成 Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "chat", + Name: "set_pin_message", + CanonicalPath: "chat.set_pin_message", + CLIPath: "chat message set-pin-msg", + PrimaryCLIPath: "chat message set-pin-msg", + }, Description: "把指定消息设为会话置顶消息", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -6252,6 +6749,13 @@ flow-status 取值:1=处理中(PROCESSING),2=输入中(INPUTTING),3=完成 Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "chat", + Name: "unset_pin_message", + CanonicalPath: "chat.unset_pin_message", + CLIPath: "chat message unset-pin-msg", + PrimaryCLIPath: "chat message unset-pin-msg", + }, Description: "取消指定消息的会话置顶", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -6307,6 +6811,13 @@ flow-status 取值:1=处理中(PROCESSING),2=输入中(INPUTTING),3=完成 Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "chat", + Name: "list_pin_messages", + CanonicalPath: "chat.list_pin_messages", + CLIPath: "chat message list-pin-msg", + PrimaryCLIPath: "chat message list-pin-msg", + }, Description: "列出指定会话中的置顶消息", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -6354,6 +6865,13 @@ flow-status 取值:1=处理中(PROCESSING),2=输入中(INPUTTING),3=完成 Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "chat", + Name: "add_message_favorite", + CanonicalPath: "chat.add_message_favorite", + CLIPath: "chat message add-favorite", + PrimaryCLIPath: "chat message add-favorite", + }, Description: "将指定会话中的一条消息加入当前用户的收藏。", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -6396,6 +6914,13 @@ flow-status 取值:1=处理中(PROCESSING),2=输入中(INPUTTING),3=完成 Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "chat", + Name: "remove_message_favorite", + CanonicalPath: "chat.remove_message_favorite", + CLIPath: "chat message remove-favorite", + PrimaryCLIPath: "chat message remove-favorite", + }, Description: "取消当前用户对指定消息的收藏标记,不删除原消息。", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -6446,6 +6971,13 @@ flow-status 取值:1=处理中(PROCESSING),2=输入中(INPUTTING),3=完成 Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "chat", + Name: "list_message_favorites", + CanonicalPath: "chat.list_message_favorites", + CLIPath: "chat message list-favorites", + PrimaryCLIPath: "chat message list-favorites", + }, Description: "分页查询当前用户收藏的消息列表。", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -6500,6 +7032,13 @@ flow-status 取值:1=处理中(PROCESSING),2=输入中(INPUTTING),3=完成 Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "chat", + Name: "list_owned_or_admin_groups", + CanonicalPath: "chat.list_owned_or_admin_groups", + CLIPath: "chat group list-my-groups", + PrimaryCLIPath: "chat group list-my-groups", + }, Description: "列出当前用户创建或管理的群聊", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -6865,6 +7404,13 @@ status 可选值: Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "chat", + Name: "update_group_nick", + CanonicalPath: "chat.update_group_nick", + CLIPath: "chat group update-nick", + PrimaryCLIPath: "chat group update-nick", + }, Description: "设置或清除当前用户在指定群内的昵称", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -7242,6 +7788,13 @@ status 可选值: Confirmation: "user_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "chat", + Name: "upgrade_group_to_external", + CanonicalPath: "chat.upgrade_group_to_external", + CLIPath: "chat group upgrade-to-external", + PrimaryCLIPath: "chat group upgrade-to-external", + }, Description: "不可逆地把已有普通群升级为外部群", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -7303,6 +7856,13 @@ status 可选值: Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "chat", + Name: "create_smart_conv_category", + CanonicalPath: "chat.create_smart_conv_category", + CLIPath: "chat category create-smart", + PrimaryCLIPath: "chat category create-smart", + }, Description: "按名称、成员或关键词创建智能会话分组", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -7418,6 +7978,13 @@ pl_PL, sv_SE, fi_FI, cs_CZ, ar_SA, tl_PH, he_IL, nl_NL, lo_LA, it_IT`, Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "chat", + Name: "batch_query_group_chat_settings", + CanonicalPath: "chat.batch_query_group_chat_settings", + CLIPath: "chat group user-settings query", + PrimaryCLIPath: "chat group user-settings query", + }, Description: "批量查询当前用户自己的群会话设置(置顶/免打扰/群昵称/群备注)", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -7470,6 +8037,13 @@ pl_PL, sv_SE, fi_FI, cs_CZ, ar_SA, tl_PH, he_IL, nl_NL, lo_LA, it_IT`, Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "chat", + Name: "batch_update_group_chat_settings", + CanonicalPath: "chat.batch_update_group_chat_settings", + CLIPath: "chat group user-settings set", + PrimaryCLIPath: "chat group user-settings set", + }, Description: "批量更新当前用户自己的群会话设置(置顶/免打扰/群昵称/群备注)", Interface: &contract.InterfaceSpec{ Mode: "composite", diff --git a/internal/helpers/cmdcore_phase2_coverage_test.go b/internal/helpers/cmdcore_phase2_coverage_test.go index 9e70de13..3d432b09 100644 --- a/internal/helpers/cmdcore_phase2_coverage_test.go +++ b/internal/helpers/cmdcore_phase2_coverage_test.go @@ -31,6 +31,10 @@ import ( // corecmd.AttachContract's declaration completeness rules (test fixture). func contractCoverageSchema(desc string) LeafContract { return LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "dev", Name: "create_thing", CanonicalPath: "dev.create_thing", + CLIPath: "dev create", PrimaryCLIPath: "dev create", + }, Description: desc, Interface: &contract.InterfaceSpec{ Mode: "composite", diff --git a/internal/helpers/connect_daemon.go b/internal/helpers/connect_daemon.go index 8f834c66..daa5213e 100644 --- a/internal/helpers/connect_daemon.go +++ b/internal/helpers/connect_daemon.go @@ -684,6 +684,13 @@ func newDevAppRobotConnectStatusCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "dev", + Name: "connect_status", + CanonicalPath: "dev.connect_status", + CLIPath: "dev connect status", + PrimaryCLIPath: "dev connect status", + }, Description: "查看后台连接器守护进程状态", Interface: &contract.InterfaceSpec{ Mode: "local", @@ -727,6 +734,13 @@ func newDevAppRobotConnectStopCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "dev", + Name: "connect_stop", + CanonicalPath: "dev.connect_stop", + CLIPath: "dev connect stop", + PrimaryCLIPath: "dev connect stop", + }, Description: "优雅停止后台连接器守护进程", Interface: &contract.InterfaceSpec{ Mode: "local", diff --git a/internal/helpers/contact.go b/internal/helpers/contact.go index 8fd0366f..5d4c5885 100644 --- a/internal/helpers/contact.go +++ b/internal/helpers/contact.go @@ -438,6 +438,13 @@ func newContactCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "contact", + Name: "get_current_user_profile", + CanonicalPath: "contact.get_current_user_profile", + CLIPath: "contact user get-self", + PrimaryCLIPath: "contact user get-self", + }, Description: "获取当前登录用户资料与 userId", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -473,6 +480,13 @@ func newContactCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "contact", + Name: "list_my_followings", + CanonicalPath: "contact.list_my_followings", + CLIPath: "contact relation list-my-followings", + PrimaryCLIPath: "contact relation list-my-followings", + }, Description: "获取当前用户的特别关注列表", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -509,6 +523,13 @@ func newContactCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "contact", + Name: "search_contact_by_key_word", + CanonicalPath: "contact.search_contact_by_key_word", + CLIPath: "contact user search", + PrimaryCLIPath: "contact user search", + }, Description: "按关键词搜索好友和同事,提取 userId/openDingTalkId", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -550,6 +571,13 @@ func newContactCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "contact", + Name: "search_user_by_mobile", + CanonicalPath: "contact.search_user_by_mobile", + CLIPath: "contact user search-mobile", + PrimaryCLIPath: "contact user search-mobile", + }, Description: "按手机号搜索用户", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -607,6 +635,13 @@ func newContactCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "contact", + Name: "get_user_info_by_user_ids", + CanonicalPath: "contact.get_user_info_by_user_ids", + CLIPath: "contact user get", + PrimaryCLIPath: "contact user get", + }, Description: "按 userId 批量获取员工详情(部门/主管等,受可见性限制)", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -743,6 +778,13 @@ func newContactCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "contact", + Name: "search_dept_by_keyword", + CanonicalPath: "contact.search_dept_by_keyword", + CLIPath: "contact dept search", + PrimaryCLIPath: "contact dept search", + }, Description: "按关键词搜索部门", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -779,6 +821,13 @@ func newContactCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "contact", + Name: "get_sub_depts_by_dept_id", + CanonicalPath: "contact.get_sub_depts_by_dept_id", + CLIPath: "contact dept list-children", + PrimaryCLIPath: "contact dept list-children", + }, Description: "列出指定部门的直属子部门", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -818,6 +867,13 @@ func newContactCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "contact", + Name: "get_dept_info_by_dept_id", + CanonicalPath: "contact.get_dept_info_by_dept_id", + CLIPath: "contact dept get-info", + PrimaryCLIPath: "contact dept get-info", + }, Description: "获取指定部门详情", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -867,6 +923,13 @@ func newContactCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "contact", + Name: "get_dept_members_by_deptId", + CanonicalPath: "contact.get_dept_members_by_deptId", + CLIPath: "contact dept list-members", + PrimaryCLIPath: "contact dept list-members", + }, Description: "查看部门成员(逗号分隔 deptId)", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -923,6 +986,13 @@ func newContactCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "contact", + Name: "list_authorized_roster_fields", + CanonicalPath: "contact.list_authorized_roster_fields", + CLIPath: "contact user profile fields", + PrimaryCLIPath: "contact user profile fields", + }, Description: "查询当前用户有权查看的花名册字段", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -981,6 +1051,13 @@ contact user profile fields 获取可用字段列表。 Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "contact", + Name: "get_authorized_emp_rosterInfo", + CanonicalPath: "contact.get_authorized_emp_rosterInfo", + CLIPath: "contact user profile get", + PrimaryCLIPath: "contact user profile get", + }, Description: "按字段 code 查询指定员工花名册字段值", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -1095,6 +1172,13 @@ contact user profile fields 获取可用字段列表。 Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "contact", + Name: "query_dismission_employee_list", + CanonicalPath: "contact.query_dismission_employee_list", + CLIPath: "contact user dismission search", + PrimaryCLIPath: "contact user dismission search", + }, Description: "查询离职员工列表", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -1174,6 +1258,13 @@ contact user profile fields 获取可用字段列表。 Confirmation: "not_required", Idempotency: "non_idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "contact", + Name: "add_employee", + CanonicalPath: "contact.add_employee", + CLIPath: "contact user invite", + PrimaryCLIPath: "contact user invite", + }, Description: "按手机号邀请一名员工加入当前企业", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -1203,6 +1294,13 @@ contact user profile fields 获取可用字段列表。 Confirmation: "user_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "contact", + Name: "employee_update", + CanonicalPath: "contact.employee_update", + CLIPath: "contact user update", + PrimaryCLIPath: "contact user update", + }, Description: "修改指定员工的企业内姓名、所属部门或直属主管", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -1232,6 +1330,13 @@ contact user profile fields 获取可用字段列表。 Confirmation: "user_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "contact", + Name: "self_user_profile_update", + CanonicalPath: "contact.self_user_profile_update", + CLIPath: "contact user update-self", + PrimaryCLIPath: "contact user update-self", + }, Description: "更新当前登录用户自己的昵称或头像", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -1298,6 +1403,13 @@ contact user profile fields 获取可用字段列表。 Confirmation: "user_required", Idempotency: "non_idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "contact", + Name: "department_create", + CanonicalPath: "contact.department_create", + CLIPath: "contact dept create", + PrimaryCLIPath: "contact dept create", + }, Description: "在当前企业的根部门或指定父部门下创建部门", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -1327,6 +1439,13 @@ contact user profile fields 获取可用字段列表。 Confirmation: "user_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "contact", + Name: "department_update", + CanonicalPath: "contact.department_update", + CLIPath: "contact dept update", + PrimaryCLIPath: "contact dept update", + }, Description: "更新指定部门的名称,并可调整父部门", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -1415,6 +1534,13 @@ contact user profile fields 获取可用字段列表。 Confirmation: "not_required", Idempotency: "non_idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "contact", + Name: "org_create", + CanonicalPath: "contact.org_create", + CLIPath: "contact org create", + PrimaryCLIPath: "contact org create", + }, Description: "创建一个新的钉钉企业组织", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -1499,6 +1625,13 @@ contact user profile fields 获取可用字段列表。 Confirmation: "not_required", Idempotency: "non_idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "contact", + Name: "exclusive_account_create", + CanonicalPath: "contact.exclusive_account_create", + CLIPath: "contact account create", + PrimaryCLIPath: "contact account create", + }, Description: "为当前企业创建专属登录账号", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -1534,6 +1667,13 @@ contact user profile fields 获取可用字段列表。 Confirmation: "user_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "contact", + Name: "exclusive_account_user_update", + CanonicalPath: "contact.exclusive_account_user_update", + CLIPath: "contact account update", + PrimaryCLIPath: "contact account update", + }, Description: "更新企业专属账号的组织信息或个人资料", Interface: &contract.InterfaceSpec{ Mode: "composite", diff --git a/internal/helpers/devapp.go b/internal/helpers/devapp.go index fa199323..84dd7f10 100644 --- a/internal/helpers/devapp.go +++ b/internal/helpers/devapp.go @@ -270,6 +270,13 @@ func newDevAppEventListCommand(runner executor.Runner) *cobra.Command { {Name: "keyword", Usage: "事件搜索关键词,支持按事件码或事件名称模糊匹配", Bind: "keyword", Trim: true, OmitEmpty: true}, }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "dev", + Name: "list_dev_app_events", + CanonicalPath: "dev.list_dev_app_events", + CLIPath: "dev app event list", + PrimaryCLIPath: "dev app event list", + }, Description: "查询应用已订阅的事件列表", DryRun: devAppDryRun, Interface: devAppCompositeInterface(), @@ -299,6 +306,13 @@ func newDevAppEventSubscribeCommand(runner executor.Runner) *cobra.Command { {Name: "event-codes", Usage: "事件码,多个用逗号或分号分隔", Bind: "eventCodes", Trim: true, Required: true, RequiredHint: "--event-codes 为必填", Transform: transformDevAppListParam}, }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "dev", + Name: "subscribe_dev_app_events", + CanonicalPath: "dev.subscribe_dev_app_events", + CLIPath: "dev app event subscribe", + PrimaryCLIPath: "dev app event subscribe", + }, Description: "订阅应用事件回调", DryRun: devAppDryRun, Interface: devAppCompositeInterface(), @@ -328,6 +342,13 @@ func newDevAppEventUnsubscribeCommand(runner executor.Runner) *cobra.Command { {Name: "event-codes", Usage: "事件码,多个用逗号或分号分隔", Bind: "eventCodes", Trim: true, Required: true, RequiredHint: "--event-codes 为必填", Transform: transformDevAppListParam}, }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "dev", + Name: "unsubscribe_dev_app_events", + CanonicalPath: "dev.unsubscribe_dev_app_events", + CLIPath: "dev app event unsubscribe", + PrimaryCLIPath: "dev app event unsubscribe", + }, Description: "取消订阅应用事件", DryRun: devAppDryRun, Interface: devAppCompositeInterface(), @@ -362,6 +383,13 @@ func newDevAppListCommand(runner executor.Runner) *cobra.Command { {Name: "sort-order", Usage: "排序方向 asc 或 desc", Bind: "sortOrder", Trim: true, OmitEmpty: true}, }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "dev", + Name: "list_dev_app", + CanonicalPath: "dev.list_dev_app", + CLIPath: "dev app list", + PrimaryCLIPath: "dev app list", + }, Description: "查询开放平台企业内部应用列表", DryRun: devAppDryRun, Interface: devAppCompositeInterface(), @@ -398,6 +426,13 @@ func newDevAppGetCommand(runner executor.Runner) *cobra.Command { return nil }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "dev", + Name: "get_dev_app", + CanonicalPath: "dev.get_dev_app", + CLIPath: "dev app get", + PrimaryCLIPath: "dev app get", + }, Description: "查询开放平台企业内部应用详情", DryRun: devAppDryRun, Interface: devAppCompositeInterface(), @@ -431,6 +466,13 @@ func newDevAppCreateCommand(runner executor.Runner) *cobra.Command { {Name: "icon-media-id", Usage: "应用图标 mediaId", Bind: "iconMediaId", Trim: true, OmitEmpty: true}, }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "dev", + Name: "create_dev_app", + CanonicalPath: "dev.create_dev_app", + CLIPath: "dev app create", + PrimaryCLIPath: "dev app create", + }, Description: "创建开放平台企业内部应用", DryRun: devAppDryRun, Interface: devAppCompositeInterface(), @@ -471,6 +513,13 @@ func newDevAppUpdateCommand(runner executor.Runner) *cobra.Command { return nil }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "dev", + Name: "update_dev_app", + CanonicalPath: "dev.update_dev_app", + CLIPath: "dev app update", + PrimaryCLIPath: "dev app update", + }, Description: "修改开放平台企业内部应用基础信息", DryRun: devAppDryRun, Interface: devAppCompositeInterface(), @@ -497,6 +546,13 @@ func newDevAppCredentialsGetCommand(runner executor.Runner) *cobra.Command { {Name: "unified-app-id", Usage: "开放平台统一应用 ID(必填)", Bind: "unifiedAppId", Trim: true, Required: true, RequiredHint: "--unified-app-id 为必填"}, }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "dev", + Name: "get_dev_app_credentials", + CanonicalPath: "dev.get_dev_app_credentials", + CLIPath: "dev app credentials get", + PrimaryCLIPath: "dev app credentials get", + }, Description: "读取开放平台应用凭证", DryRun: devAppDryRun, Interface: devAppCompositeInterface(), @@ -524,6 +580,13 @@ func newDevAppDisableCommand(runner executor.Runner) *cobra.Command { {Name: "unified-app-id", Usage: "开放平台统一应用 ID(必填)", Bind: "unifiedAppId", Trim: true, Required: true, RequiredHint: "--unified-app-id 为必填"}, }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "dev", + Name: "disable_dev_app", + CanonicalPath: "dev.disable_dev_app", + CLIPath: "dev app disable", + PrimaryCLIPath: "dev app disable", + }, Description: "停用开放平台企业内部应用", DryRun: devAppDryRun, Interface: devAppCompositeInterface(), @@ -551,6 +614,13 @@ func newDevAppEnableCommand(runner executor.Runner) *cobra.Command { {Name: "unified-app-id", Usage: "开放平台统一应用 ID(必填)", Bind: "unifiedAppId", Trim: true, Required: true, RequiredHint: "--unified-app-id 为必填"}, }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "dev", + Name: "enable_dev_app", + CanonicalPath: "dev.enable_dev_app", + CLIPath: "dev app enable", + PrimaryCLIPath: "dev app enable", + }, Description: "启用开放平台企业内部应用", DryRun: devAppDryRun, Interface: devAppCompositeInterface(), @@ -590,6 +660,13 @@ func newDevAppDeleteCommand(runner executor.Runner) *cobra.Command { {Name: "confirm-name", Usage: "二次确认:必须与被删应用的名称一致(不可逆操作的防误删)", Bind: "confirmName", Trim: true, OmitEmpty: true}, }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "dev", + Name: "delete_dev_app", + CanonicalPath: "dev.delete_dev_app", + CLIPath: "dev app delete", + PrimaryCLIPath: "dev app delete", + }, Description: "删除开放平台企业内部应用(不可逆,需 --confirm-name 二次确认)", DryRun: devAppDryRun, Interface: devAppCompositeInterface(), @@ -684,6 +761,13 @@ func newDevAppWebappGetCommand(runner executor.Runner) *cobra.Command { {Name: "unified-app-id", Usage: "开放平台统一应用 ID(必填)", Bind: "unifiedAppId", Trim: true, Required: true, RequiredHint: "--unified-app-id 为必填"}, }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "dev", + Name: "get_extension_webapp_config", + CanonicalPath: "dev.get_extension_webapp_config", + CLIPath: "dev app webapp get", + PrimaryCLIPath: "dev app webapp get", + }, Description: "查询网页应用配置", DryRun: devAppDryRun, Interface: devAppCompositeInterface(), @@ -724,6 +808,13 @@ func newDevAppWebappConfigCommand(runner executor.Runner) *cobra.Command { return nil }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "dev", + Name: "set_extension_webapp_config", + CanonicalPath: "dev.set_extension_webapp_config", + CLIPath: "dev app webapp config", + PrimaryCLIPath: "dev app webapp config", + }, Description: "配置网页应用能力", DryRun: devAppDryRun, Interface: devAppCompositeInterface(), @@ -756,6 +847,13 @@ func newDevAppPermissionListCommand(runner executor.Runner) *cobra.Command { {Name: "api-status", Usage: "开发者后台 apiStatus 过滤", Bind: "apiStatus", Trim: true, OmitEmpty: true}, }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "dev", + Name: "list_dev_app_permissions", + CanonicalPath: "dev.list_dev_app_permissions", + CLIPath: "dev app permission list", + PrimaryCLIPath: "dev app permission list", + }, Description: "查询开放平台应用权限列表", DryRun: devAppDryRun, Interface: devAppCompositeInterface(), @@ -788,6 +886,13 @@ func newDevAppPermissionAddCommand(runner executor.Runner) *cobra.Command { {Name: "scope-values", Usage: "权限点 scopeValue,多个用逗号或分号分隔", Bind: "scopeValues", Trim: true, Required: true, RequiredHint: "--scope-values 为必填", Transform: transformDevAppScopeValues}, }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "dev", + Name: "apply_dev_app_permissions", + CanonicalPath: "dev.apply_dev_app_permissions", + CLIPath: "dev app permission add", + PrimaryCLIPath: "dev app permission add", + }, Description: "申请开放平台应用权限点", DryRun: devAppDryRun, Interface: devAppCompositeInterface(), @@ -817,6 +922,13 @@ func newDevAppPermissionRemoveCommand(runner executor.Runner) *cobra.Command { {Name: "scope-values", Usage: "待取消权限点 scopeValue,多个用逗号或分号分隔", Bind: "scopeValues", Trim: true, Required: true, RequiredHint: "--scope-values 为必填", Transform: transformDevAppScopeValues}, }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "dev", + Name: "remove_dev_app_permissions", + CanonicalPath: "dev.remove_dev_app_permissions", + CLIPath: "dev app permission remove", + PrimaryCLIPath: "dev app permission remove", + }, Description: "取消开放平台应用权限点", DryRun: devAppDryRun, Interface: devAppCompositeInterface(), @@ -843,6 +955,13 @@ func newDevAppMemberListCommand(runner executor.Runner) *cobra.Command { {Name: "unified-app-id", Usage: "开放平台统一应用 ID(必填)", Bind: "unifiedAppId", Trim: true, Required: true, RequiredHint: "--unified-app-id 为必填"}, }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "dev", + Name: "list_dev_app_members", + CanonicalPath: "dev.list_dev_app_members", + CLIPath: "dev app member list", + PrimaryCLIPath: "dev app member list", + }, Description: "查询开放平台应用成员", DryRun: devAppDryRun, Interface: devAppCompositeInterface(), @@ -881,6 +1000,13 @@ func newDevAppMemberAddCommand(runner executor.Runner) *cobra.Command { return nil }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "dev", + Name: "add_dev_app_members", + CanonicalPath: "dev.add_dev_app_members", + CLIPath: "dev app member add", + PrimaryCLIPath: "dev app member add", + }, Description: "添加开放平台应用成员", DryRun: devAppDryRun, Interface: devAppCompositeInterface(), @@ -919,6 +1045,13 @@ func newDevAppMemberRemoveCommand(runner executor.Runner) *cobra.Command { return nil }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "dev", + Name: "remove_dev_app_members", + CanonicalPath: "dev.remove_dev_app_members", + CLIPath: "dev app member remove", + PrimaryCLIPath: "dev app member remove", + }, Description: "移除开放平台应用成员", DryRun: devAppDryRun, Interface: devAppCompositeInterface(), @@ -960,6 +1093,13 @@ func newDevAppSecurityConfigCommand(runner executor.Runner) *cobra.Command { return nil }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "dev", + Name: "update_dev_app_security_config", + CanonicalPath: "dev.update_dev_app_security_config", + CLIPath: "dev app security config", + PrimaryCLIPath: "dev app security config", + }, Description: "更新开放平台应用安全配置", DryRun: devAppDryRun, Interface: devAppCompositeInterface(), @@ -1000,6 +1140,13 @@ func newDevAppRobotSubmitCommand(runner executor.Runner) *cobra.Command { {Name: "task-id", Usage: "失败重试时传入原 taskId;为空时服务端自动生成", Bind: "taskId", Trim: true, OmitEmpty: true}, }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "dev", + Name: "submit_robot_create_task", + CanonicalPath: "dev.submit_robot_create_task", + CLIPath: "dev app robot submit", + PrimaryCLIPath: "dev app robot submit", + }, Description: "异步提交钉钉智能体机器人创建任务(支持失败重试)", DryRun: devAppDryRun, Interface: devAppCompositeInterface(), @@ -1041,6 +1188,13 @@ func newDevAppRobotResultCommand(runner executor.Runner) *cobra.Command { {Name: "task-id", Usage: "提交创建任务时返回的 taskId (必填)", Bind: "taskId", Trim: true, Required: true, RequiredHint: "--task-id 为必填"}, }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "dev", + Name: "query_robot_create_result", + CanonicalPath: "dev.query_robot_create_result", + CLIPath: "dev app robot result", + PrimaryCLIPath: "dev app robot result", + }, Description: "查询机器人异步创建任务结果", DryRun: devAppDryRun, Interface: devAppCompositeInterface(), @@ -1067,6 +1221,13 @@ func newDevAppRobotConfigGetCommand(runner executor.Runner) *cobra.Command { {Name: "unified-app-id", Usage: "开放平台统一应用 ID(必填)", Bind: "unifiedAppId", Trim: true, Required: true, RequiredHint: "--unified-app-id 为必填"}, }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "dev", + Name: "get_extension_robot_config", + CanonicalPath: "dev.get_extension_robot_config", + CLIPath: "dev app robot get", + PrimaryCLIPath: "dev app robot get", + }, Description: "查询现有应用的机器人配置", DryRun: devAppDryRun, Interface: devAppCompositeInterface(), @@ -1117,6 +1278,13 @@ func newDevAppRobotConfigCommand(runner executor.Runner) *cobra.Command { {Name: "i18n-description", Usage: "机器人描述国际化 JSON", Bind: "i18nDescription", Trim: true, OmitEmpty: true}, }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "dev", + Name: "set_extension_robot_config", + CanonicalPath: "dev.set_extension_robot_config", + CLIPath: "dev app robot config", + PrimaryCLIPath: "dev app robot config", + }, Description: "创建或更新现有应用的机器人配置(upsert)", DryRun: devAppDryRun, Interface: devAppCompositeInterface(), @@ -1160,6 +1328,13 @@ func newDevAppRobotEnableCommand(runner executor.Runner) *cobra.Command { {Name: "unified-app-id", Usage: "开放平台统一应用 ID(必填)", Bind: "unifiedAppId", Trim: true, Required: true, RequiredHint: "--unified-app-id 为必填"}, }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "dev", + Name: "enable_dev_app_robot", + CanonicalPath: "dev.enable_dev_app_robot", + CLIPath: "dev app robot enable", + PrimaryCLIPath: "dev app robot enable", + }, Description: "启用现有应用机器人能力(纯启用,无需配置字段)", DryRun: devAppDryRun, Interface: devAppCompositeInterface(), @@ -1188,6 +1363,13 @@ func newDevAppRobotOfflineCommand(runner executor.Runner) *cobra.Command { {Name: "unified-app-id", Usage: "开放平台统一应用 ID(必填)", Bind: "unifiedAppId", Trim: true, Required: true, RequiredHint: "--unified-app-id 为必填"}, }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "dev", + Name: "disable_dev_app_robot", + CanonicalPath: "dev.disable_dev_app_robot", + CLIPath: "dev app robot disable", + PrimaryCLIPath: "dev app robot disable", + }, Description: "停用现有应用的机器人能力", DryRun: devAppDryRun, Interface: devAppCompositeInterface(), @@ -1303,6 +1485,13 @@ func newDevAppVersionCreateCommand(runner executor.Runner) *cobra.Command { {Name: "desc", Usage: "版本描述", Bind: "desc", Trim: true, OmitEmpty: true}, }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "dev", + Name: "create_dev_app_version", + CanonicalPath: "dev.create_dev_app_version", + CLIPath: "dev app version create", + PrimaryCLIPath: "dev app version create", + }, Description: "基于当前配置创建应用新版本", DryRun: devAppDryRun, Interface: devAppCompositeInterface(), @@ -1329,6 +1518,13 @@ func newDevAppVersionListCommand(runner executor.Runner) *cobra.Command { {Name: "unified-app-id", Usage: "开放平台统一应用 ID(必填)", Bind: "unifiedAppId", Trim: true, Required: true, RequiredHint: "--unified-app-id 为必填"}, }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "dev", + Name: "list_dev_app_versions", + CanonicalPath: "dev.list_dev_app_versions", + CLIPath: "dev app version list", + PrimaryCLIPath: "dev app version list", + }, Description: "分页查询应用版本列表", DryRun: devAppDryRun, Interface: devAppCompositeInterface(), @@ -1356,6 +1552,13 @@ func newDevAppVersionGetCommand(runner executor.Runner) *cobra.Command { {Name: "version-id", Usage: "版本 ID (必填)", Bind: "versionId", Trim: true, Required: true, RequiredHint: "--version-id 为必填"}, }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "dev", + Name: "get_dev_app_version_detail", + CanonicalPath: "dev.get_dev_app_version_detail", + CLIPath: "dev app version get", + PrimaryCLIPath: "dev app version get", + }, Description: "查询指定版本详情", DryRun: devAppDryRun, Interface: devAppCompositeInterface(), @@ -1405,6 +1608,13 @@ func newDevAppVersionPublishCommand(runner executor.Runner) *cobra.Command { }, ConstParams: map[string]any{"precheckOnly": false}, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "dev", + Name: "publish_dev_app_version", + CanonicalPath: "dev.publish_dev_app_version", + CLIPath: "dev app version publish", + PrimaryCLIPath: "dev app version publish", + }, Description: "发布指定版本(含高敏权限需 --confirmed-sensitive)", DryRun: devAppDryRun, Interface: devAppCompositeInterface(), @@ -1432,6 +1642,13 @@ func newDevAppVersionStatusCommand(runner executor.Runner) *cobra.Command { {Name: "version-id", Usage: "版本 ID (必填)", Bind: "versionId", Trim: true, Required: true, RequiredHint: "--version-id 为必填"}, }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "dev", + Name: "get_dev_app_version_status", + CanonicalPath: "dev.get_dev_app_version_status", + CLIPath: "dev app version status", + PrimaryCLIPath: "dev app version status", + }, Description: "查询版本发布/审批状态", DryRun: devAppDryRun, Interface: devAppCompositeInterface(), diff --git a/internal/helpers/devdoc.go b/internal/helpers/devdoc.go index dcdcc00b..b158a05b 100644 --- a/internal/helpers/devdoc.go +++ b/internal/helpers/devdoc.go @@ -91,6 +91,13 @@ func newDevdocArticleSearchCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "devdoc", + Name: "search_open_platform_docs_rag", + CanonicalPath: "devdoc.search_open_platform_docs_rag", + CLIPath: "devdoc article search", + PrimaryCLIPath: "devdoc article search", + }, Description: "搜索钉钉开放平台开发文档,返回资料与链接(不生成分析答案)", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -168,6 +175,13 @@ func newDevDocSearchCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "dev", + Name: "search_open_platform_docs_rag", + CanonicalPath: "dev.search_open_platform_docs_rag", + CLIPath: "dev doc search", + PrimaryCLIPath: "dev doc search", + }, Description: "通过 dev 兼容入口搜索开放平台文档", Interface: &contract.InterfaceSpec{ Mode: "mcp", diff --git a/internal/helpers/ding.go b/internal/helpers/ding.go index 0da63760..79cda622 100644 --- a/internal/helpers/ding.go +++ b/internal/helpers/ding.go @@ -88,6 +88,13 @@ func newDingCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "ding", + Name: "send_ding_message", + CanonicalPath: "ding.send_ding_message", + CLIPath: "ding message send", + PrimaryCLIPath: "ding message send", + }, Description: "以企业机器人发送应用内/短信/电话 DING", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -143,6 +150,13 @@ func newDingCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "ding", + Name: "recall_ding_message", + CanonicalPath: "ding.recall_ding_message", + CLIPath: "ding message recall", + PrimaryCLIPath: "ding message recall", + }, Description: "撤回已发送的机器人 DING", Interface: &contract.InterfaceSpec{ Mode: "mcp", diff --git a/internal/helpers/doc.go b/internal/helpers/doc.go index b046f1c7..84039abf 100644 --- a/internal/helpers/doc.go +++ b/internal/helpers/doc.go @@ -902,6 +902,13 @@ func newDocCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "doc", + Name: "search_documents", + CanonicalPath: "doc.search_documents", + CLIPath: "doc search", + PrimaryCLIPath: "doc search", + }, Description: "搜索文档(不传关键词返回最近访问)", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -968,6 +975,13 @@ func newDocCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "doc", + Name: "list_nodes", + CanonicalPath: "doc.list_nodes", + CLIPath: "doc list", + PrimaryCLIPath: "doc list", + }, Description: "兼容入口:遍历文件夹或知识库的直接子节点;目录浏览能力已迁移到 drive/wiki。", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -1012,6 +1026,13 @@ func newDocCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "doc", + Name: "get_document_info", + CanonicalPath: "doc.get_document_info", + CLIPath: "doc info", + PrimaryCLIPath: "doc info", + }, Description: "获取文档元信息(标题/类型/创建者/权限等)", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -1112,6 +1133,13 @@ func newDocCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "doc", + Name: "get_document_content", + CanonicalPath: "doc.get_document_content", + CLIPath: "doc read", + PrimaryCLIPath: "doc read", + }, Description: "读取完整文档内容,或按 outline/range/section/tags 获取 JSONML fragment", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -1238,6 +1266,13 @@ func newDocCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "doc", + Name: "create_document", + CanonicalPath: "doc.create_document", + CLIPath: "doc create", + PrimaryCLIPath: "doc create", + }, Description: "创建一篇新的在线文档", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -1368,6 +1403,13 @@ WARNING: --mode overwrite 为破坏性写入,会清空原文档全部内容。 Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "doc", + Name: "update_document", + CanonicalPath: "doc.update_document", + CLIPath: "doc update", + PrimaryCLIPath: "doc update", + }, Description: "更新文档内容(追加 / 覆盖;覆盖需 --yes)", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -1447,6 +1489,13 @@ WARNING: --mode overwrite 为破坏性写入,会清空原文档全部内容。 Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "doc", + Name: "create_file", + CanonicalPath: "doc.create_file", + CLIPath: "doc file create", + PrimaryCLIPath: "doc file create", + }, Description: "创建文件(文档/表格/脑图/白板/多维表/文件夹等)", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -1503,6 +1552,13 @@ WARNING: --mode overwrite 为破坏性写入,会清空原文档全部内容。 Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "doc", + Name: "create_folder", + CanonicalPath: "doc.create_folder", + CLIPath: "doc folder create", + PrimaryCLIPath: "doc folder create", + }, Description: "创建文件夹", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -1544,6 +1600,13 @@ WARNING: --mode overwrite 为破坏性写入,会清空原文档全部内容。 Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "doc", + Name: "upload", + CanonicalPath: "doc.upload", + CLIPath: "doc upload", + PrimaryCLIPath: "doc upload", + }, Description: "兼容入口:上传本地文件到钉盘或文档空间;文件上传能力已迁移到 drive。", DryRun: &contract.DryRunSpec{PreviewKind: "plan", RemoteReads: false}, Interface: &contract.InterfaceSpec{ @@ -1585,6 +1648,13 @@ WARNING: --mode overwrite 为破坏性写入,会清空原文档全部内容。 Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "doc", + Name: "download_file", + CanonicalPath: "doc.download_file", + CLIPath: "doc download", + PrimaryCLIPath: "doc download", + }, Description: "兼容入口:下载钉盘或文档空间已有文件;文件下载能力已迁移到 drive。", DryRun: &contract.DryRunSpec{PreviewKind: "plan", RemoteReads: false}, Interface: &contract.InterfaceSpec{ @@ -1657,6 +1727,13 @@ WARNING: --mode overwrite 为破坏性写入,会清空原文档全部内容。 Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "doc", + Name: "list_document_blocks", + CanonicalPath: "doc.list_document_blocks", + CLIPath: "doc block list", + PrimaryCLIPath: "doc block list", + }, Description: "查询文档一级块元素列表", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -1785,6 +1862,13 @@ WARNING: --mode overwrite 为破坏性写入,会清空原文档全部内容。 Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "doc", + Name: "insert_document_block", + CanonicalPath: "doc.insert_document_block", + CLIPath: "doc block insert", + PrimaryCLIPath: "doc block insert", + }, Description: "向文档插入块元素", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -1870,6 +1954,13 @@ WARNING: --mode overwrite 为破坏性写入,会清空原文档全部内容。 Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "doc", + Name: "update_document_block", + CanonicalPath: "doc.update_document_block", + CLIPath: "doc block update", + PrimaryCLIPath: "doc block update", + }, Description: "更新文档中的指定块", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -1917,6 +2008,13 @@ WARNING: --mode overwrite 为破坏性写入,会清空原文档全部内容。 Confirmation: "user_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "doc", + Name: "delete_document_block", + CanonicalPath: "doc.delete_document_block", + CLIPath: "doc block delete", + PrimaryCLIPath: "doc block delete", + }, Description: "删除块元素(不可逆)", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -1958,6 +2056,13 @@ WARNING: --mode overwrite 为破坏性写入,会清空原文档全部内容。 Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "doc", + Name: "copy_document", + CanonicalPath: "doc.copy_document", + CLIPath: "doc copy", + PrimaryCLIPath: "doc copy", + }, Description: "兼容入口:复制文档或文件;文件复制能力已迁移到 drive。", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -2007,6 +2112,13 @@ WARNING: --mode overwrite 为破坏性写入,会清空原文档全部内容。 Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "doc", + Name: "move_document", + CanonicalPath: "doc.move_document", + CLIPath: "doc move", + PrimaryCLIPath: "doc move", + }, Description: "兼容入口:移动文档或文件;文件移动能力已迁移到 drive。", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -2062,6 +2174,13 @@ WARNING: --mode overwrite 为破坏性写入,会清空原文档全部内容。 Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "doc", + Name: "rename_document", + CanonicalPath: "doc.rename_document", + CLIPath: "doc rename", + PrimaryCLIPath: "doc rename", + }, Description: "兼容入口:重命名文档或文件;文件重命名能力已迁移到 drive。", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -2115,6 +2234,13 @@ WARNING: --mode overwrite 为破坏性写入,会清空原文档全部内容。 Confirmation: "user_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "doc", + Name: "delete_document", + CanonicalPath: "doc.delete_document", + CLIPath: "doc delete", + PrimaryCLIPath: "doc delete", + }, Description: "兼容入口:将文档或文件移入回收站;文件删除能力已迁移到 drive。", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -2369,6 +2495,13 @@ resourceId 需通过 dws doc block list 获取:查询目标文档的块列表 Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "doc", + Name: "download_doc_attachment", + CanonicalPath: "doc.download_doc_attachment", + CLIPath: "doc media download", + PrimaryCLIPath: "doc media download", + }, Description: "获取文档附件的临时下载链接", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -2417,6 +2550,13 @@ resourceId 需通过 dws doc block list 获取:查询目标文档的块列表 Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "doc", + Name: "media_insert", + CanonicalPath: "doc.media_insert", + CLIPath: "doc media insert", + PrimaryCLIPath: "doc media insert", + }, Description: "上传本地文件并作为附件插入文档", DryRun: &contract.DryRunSpec{PreviewKind: "plan", RemoteReads: false}, Interface: &contract.InterfaceSpec{ @@ -2518,6 +2658,13 @@ resourceId 需通过 dws doc block list 获取:查询目标文档的块列表 Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "doc", + Name: "list_comments", + CanonicalPath: "doc.list_comments", + CLIPath: "doc comment list", + PrimaryCLIPath: "doc comment list", + }, Description: "查询文档评论列表", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -2592,6 +2739,13 @@ resourceId 需通过 dws doc block list 获取:查询目标文档的块列表 Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "doc", + Name: "create_comment", + CanonicalPath: "doc.create_comment", + CLIPath: "doc comment create", + PrimaryCLIPath: "doc comment create", + }, Description: "创建文档评论", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -2680,6 +2834,13 @@ commentKey可从 dws doc comment create 或 dws doc comment list 返回结果中 Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "doc", + Name: "reply_comment", + CanonicalPath: "doc.reply_comment", + CLIPath: "doc comment reply", + PrimaryCLIPath: "doc comment reply", + }, Description: "回复文档评论", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -2750,6 +2911,13 @@ commentKey可从 dws doc comment create 或 dws doc comment list 返回结果中 Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "doc", + Name: "update_comment", + CanonicalPath: "doc.update_comment", + CLIPath: "doc comment update", + PrimaryCLIPath: "doc comment update", + }, Description: "更新指定文档评论的文字内容和可选 @用户/@群。", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -2806,6 +2974,13 @@ commentKey可从 dws doc comment create 或 dws doc comment list 返回结果中 Confirmation: "user_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "doc", + Name: "delete_comment", + CanonicalPath: "doc.delete_comment", + CLIPath: "doc comment delete", + PrimaryCLIPath: "doc comment delete", + }, Description: "永久删除指定文档中的一条评论", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -2877,6 +3052,13 @@ commentKey可从 dws doc comment create 或 dws doc comment list 返回结果中 Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "doc", + Name: "create_inline_comment", + CanonicalPath: "doc.create_inline_comment", + CLIPath: "doc comment create-inline", + PrimaryCLIPath: "doc comment create-inline", + }, Description: "在文档选中文本范围创建划词评论", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -2984,6 +3166,13 @@ commentKey可从 dws doc comment create 或 dws doc comment list 返回结果中 Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "doc", + Name: "add_permission", + CanonicalPath: "doc.add_permission", + CLIPath: "doc permission add", + PrimaryCLIPath: "doc permission add", + }, Description: "兼容入口:为文档空间节点添加协作成员权限;文件管理权限命令已迁移到 drive。", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -3063,6 +3252,13 @@ commentKey可从 dws doc comment create 或 dws doc comment list 返回结果中 Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "doc", + Name: "update_permission", + CanonicalPath: "doc.update_permission", + CLIPath: "doc permission update", + PrimaryCLIPath: "doc permission update", + }, Description: "兼容入口:更新文档空间节点的协作成员角色;文件权限命令已迁移到 drive。", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -3134,6 +3330,13 @@ commentKey可从 dws doc comment create 或 dws doc comment list 返回结果中 Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "doc", + Name: "list_permission", + CanonicalPath: "doc.list_permission", + CLIPath: "doc permission list", + PrimaryCLIPath: "doc permission list", + }, Description: "兼容入口:查询文档空间节点的协作者权限;文件权限命令已迁移到 drive。", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -3205,6 +3408,13 @@ commentKey可从 dws doc comment create 或 dws doc comment list 返回结果中 Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "doc", + Name: "remove_permission", + CanonicalPath: "doc.remove_permission", + CLIPath: "doc permission remove", + PrimaryCLIPath: "doc permission remove", + }, Description: "兼容入口:移除文档空间节点的协作成员权限;文件权限命令已迁移到 drive。", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -3446,6 +3656,13 @@ CLI 内部自动完成全部流程: Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "doc", + Name: "query_export_job", + CanonicalPath: "doc.query_export_job", + CLIPath: "doc export get", + PrimaryCLIPath: "doc export get", + }, Description: "查询文档导出任务结果", DryRun: &contract.DryRunSpec{PreviewKind: "plan", RemoteReads: false}, Interface: &contract.InterfaceSpec{ @@ -3545,6 +3762,13 @@ CLI 内部自动完成全部流程: Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "doc", + Name: "import_get", + CanonicalPath: "doc.import_get", + CLIPath: "doc import get", + PrimaryCLIPath: "doc import get", + }, Description: "根据 taskId 查询文档导入任务的执行结果", DryRun: &contract.DryRunSpec{PreviewKind: "plan", RemoteReads: false}, Interface: &contract.InterfaceSpec{ @@ -3591,6 +3815,13 @@ CLI 内部自动完成全部流程: Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "doc", + Name: "version_save", + CanonicalPath: "doc.version_save", + CLIPath: "doc version save", + PrimaryCLIPath: "doc version save", + }, Description: "手动保存文档版本快照", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -3634,6 +3865,13 @@ CLI 内部自动完成全部流程: Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "doc", + Name: "version_list", + CanonicalPath: "doc.version_list", + CLIPath: "doc version list", + PrimaryCLIPath: "doc version list", + }, Description: "查看文档历史版本列表", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -3695,6 +3933,13 @@ CLI 内部自动完成全部流程: DeclareLeafMetadata(versionRevertCmd, LeafSpec{ Safety: versionRevertSafety, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "doc", + Name: "version_revert", + CanonicalPath: "doc.version_revert", + CLIPath: "doc version revert", + PrimaryCLIPath: "doc version revert", + }, Description: "将文档回滚到指定历史版本", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -3762,6 +4007,13 @@ CLI 内部自动完成全部流程: Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "doc", + Name: "template_list", + CanonicalPath: "doc.template_list", + CLIPath: "doc template list", + PrimaryCLIPath: "doc template list", + }, Description: "获取当前用户可用的文档模板列表", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -3819,6 +4071,13 @@ CLI 内部自动完成全部流程: Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "doc", + Name: "template_search", + CanonicalPath: "doc.template_search", + CLIPath: "doc template search", + PrimaryCLIPath: "doc template search", + }, Description: "根据关键词搜索文档模板", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -3877,6 +4136,13 @@ CLI 内部自动完成全部流程: Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "doc", + Name: "template_apply", + CanonicalPath: "doc.template_apply", + CLIPath: "doc template apply", + PrimaryCLIPath: "doc template apply", + }, Description: "使用指定模板创建新文档", Interface: &contract.InterfaceSpec{ Mode: "composite", diff --git a/internal/helpers/doc_style.go b/internal/helpers/doc_style.go index 529d8201..109a3d56 100644 --- a/internal/helpers/doc_style.go +++ b/internal/helpers/doc_style.go @@ -55,6 +55,13 @@ func newDocStyleCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "doc", + Name: "style_cover_set", + CanonicalPath: "doc.style_cover_set", + CLIPath: "doc style cover set", + PrimaryCLIPath: "doc style cover set", + }, Description: "设置钉钉文档顶部封面图(外链或本地图片上传)", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -81,6 +88,13 @@ func newDocStyleCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "doc", + Name: "style_cover_clear", + CanonicalPath: "doc.style_cover_clear", + CLIPath: "doc style cover clear", + PrimaryCLIPath: "doc style cover clear", + }, Description: "移除钉钉文档封面", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -114,6 +128,13 @@ func newDocStyleCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "doc", + Name: "style_background_set", + CanonicalPath: "doc.style_background_set", + CLIPath: "doc style background set", + PrimaryCLIPath: "doc style background set", + }, Description: "设置钉钉文档背景纯色(#RRGGBB)", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -140,6 +161,13 @@ func newDocStyleCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "doc", + Name: "style_background_clear", + CanonicalPath: "doc.style_background_clear", + CLIPath: "doc style background clear", + PrimaryCLIPath: "doc style background clear", + }, Description: "清除钉钉文档背景", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -167,6 +195,13 @@ func newDocStyleCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "doc", + Name: "get_document_style", + CanonicalPath: "doc.get_document_style", + CLIPath: "doc style get", + PrimaryCLIPath: "doc style get", + }, Description: "读取文档当前封面与背景配置(只读)", Interface: &contract.InterfaceSpec{ Mode: "composite", diff --git a/internal/helpers/drive.go b/internal/helpers/drive.go index 189cc2a6..5922a7d0 100644 --- a/internal/helpers/drive.go +++ b/internal/helpers/drive.go @@ -464,6 +464,13 @@ func newDriveCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "drive", + Name: "list_files", + CanonicalPath: "drive.list_files", + CLIPath: "drive list", + PrimaryCLIPath: "drive list", + }, Description: "获取文件/文件夹列表", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -516,6 +523,13 @@ func newDriveCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "drive", + Name: "get_file_info", + CanonicalPath: "drive.get_file_info", + CLIPath: "drive info", + PrimaryCLIPath: "drive info", + }, Description: "获取文件元数据信息", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -616,6 +630,13 @@ func newDriveCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "drive", + Name: "download_file", + CanonicalPath: "drive.download_file", + CLIPath: "drive download", + PrimaryCLIPath: "drive download", + }, Description: "下载钉盘或文档空间文件到本地", DryRun: &contract.DryRunSpec{PreviewKind: "plan", RemoteReads: false}, Interface: &contract.InterfaceSpec{ @@ -717,6 +738,13 @@ func newDriveCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "drive", + Name: "download_file_version", + CanonicalPath: "drive.download_file_version", + CLIPath: "drive download-version", + PrimaryCLIPath: "drive download-version", + }, Description: "下载钉盘普通文件的指定历史版本到本地(两步下载:取签名 URL 后 HTTP GET)", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -767,6 +795,13 @@ func newDriveCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "drive", + Name: "create_folder", + CanonicalPath: "drive.create_folder", + CLIPath: "drive mkdir", + PrimaryCLIPath: "drive mkdir", + }, Description: "创建文件夹", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -832,6 +867,13 @@ func newDriveCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "drive", + Name: "get_upload_info", + CanonicalPath: "drive.get_upload_info", + CLIPath: "drive upload-info", + PrimaryCLIPath: "drive upload-info", + }, Description: "获取文件上传信息", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -888,6 +930,13 @@ func newDriveCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "drive", + Name: "commit_upload", + CanonicalPath: "drive.commit_upload", + CLIPath: "drive commit", + PrimaryCLIPath: "drive commit", + }, Description: "提交文件上传", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -986,6 +1035,13 @@ func newDriveCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "drive", + Name: "upload", + CanonicalPath: "drive.upload", + CLIPath: "drive upload", + PrimaryCLIPath: "drive upload", + }, Description: "上传本地文件到钉盘或文档空间,或按节点 ID 确认覆盖已有文件", DryRun: &contract.DryRunSpec{PreviewKind: "plan", RemoteReads: false}, Interface: &contract.InterfaceSpec{ @@ -1066,6 +1122,13 @@ func newDriveCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "drive", + Name: "list_spaces", + CanonicalPath: "drive.list_spaces", + CLIPath: "drive list-spaces", + PrimaryCLIPath: "drive list-spaces", + }, Description: "兼容查询钉盘空间列表", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -1226,6 +1289,13 @@ func newDriveCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "drive", + Name: "search_files", + CanonicalPath: "drive.search_files", + CLIPath: "drive search", + PrimaryCLIPath: "drive search", + }, Description: "全局搜索文件,默认同时搜索钉盘和文档空间,合并返回结果", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -1311,6 +1381,13 @@ func newDriveCommand() *cobra.Command { Confirmation: "user_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "drive", + Name: "delete_document", + CanonicalPath: "drive.delete_document", + CLIPath: "drive delete", + PrimaryCLIPath: "drive delete", + }, Description: "将钉盘中的文件或文件夹移入回收站", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -1370,6 +1447,13 @@ func newDriveCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "drive", + Name: "copy_document", + CanonicalPath: "drive.copy_document", + CLIPath: "drive copy", + PrimaryCLIPath: "drive copy", + }, Description: "将文件或文档复制到目标文件夹或知识库(保留原位置;默认「我的文档」)", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -1440,6 +1524,13 @@ func newDriveCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "drive", + Name: "move_document", + CanonicalPath: "drive.move_document", + CLIPath: "drive move", + PrimaryCLIPath: "drive move", + }, Description: "将文件或文档移动到目标文件夹或知识库(原位置不再保留)", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -1510,6 +1601,13 @@ func newDriveCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "drive", + Name: "rename_document", + CanonicalPath: "drive.rename_document", + CLIPath: "drive rename", + PrimaryCLIPath: "drive rename", + }, Description: "安全重命名文档空间中的文档、文件或文件夹,并按节点真实扩展名避免双后缀", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -1559,6 +1657,13 @@ func newDriveCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "drive", + Name: "get_node_stats", + CanonicalPath: "drive.get_node_stats", + CLIPath: "drive stats", + PrimaryCLIPath: "drive stats", + }, Description: "读取指定钉盘或文档空间节点的阅读、编辑、评论、点赞、预览与下载等统计。", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -1615,6 +1720,13 @@ func newDriveCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "non_idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "drive", + Name: "create_shortcut", + CanonicalPath: "drive.create_shortcut", + CLIPath: "drive shortcut", + PrimaryCLIPath: "drive shortcut", + }, Description: "为钉盘或文档空间中的现有节点创建快捷方式。", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -1691,6 +1803,13 @@ func newDriveCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "drive", + Name: "add_permission", + CanonicalPath: "drive.add_permission", + CLIPath: "drive permission add", + PrimaryCLIPath: "drive permission add", + }, Description: "为文档空间节点添加协作成员并授予指定角色", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -1761,6 +1880,13 @@ func newDriveCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "drive", + Name: "permission_update", + CanonicalPath: "drive.permission_update", + CLIPath: "drive permission update", + PrimaryCLIPath: "drive permission update", + }, Description: "更新文档空间节点已有协作者的权限角色", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -1826,6 +1952,13 @@ func newDriveCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "drive", + Name: "list_permission", + CanonicalPath: "drive.list_permission", + CLIPath: "drive permission list", + PrimaryCLIPath: "drive permission list", + }, Description: "查询文档空间节点的协作者列表", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -1886,6 +2019,13 @@ func newDriveCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "drive", + Name: "permission_remove", + CanonicalPath: "drive.permission_remove", + CLIPath: "drive permission remove", + PrimaryCLIPath: "drive permission remove", + }, Description: "从文档空间节点移除协作成员的权限", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -2010,6 +2150,13 @@ func newDriveCommand() *cobra.Command { Confirmation: "user_required", Idempotency: "non_idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "drive", + Name: "transfer_owner", + CanonicalPath: "drive.transfer_owner", + CLIPath: "drive permission transfer-owner", + PrimaryCLIPath: "drive permission transfer-owner", + }, Description: "转交文档或知识库所有者给指定用户(不可逆)", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -2048,6 +2195,13 @@ func newDriveCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "drive", + Name: "query_permission_apply_info", + CanonicalPath: "drive.query_permission_apply_info", + CLIPath: "drive permission apply-info", + PrimaryCLIPath: "drive permission apply-info", + }, Description: "查询节点可申请的权限角色列表与审批人列表", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -2104,6 +2258,13 @@ func newDriveCommand() *cobra.Command { Confirmation: "user_required", Idempotency: "non_idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "drive", + Name: "apply_permission", + CanonicalPath: "drive.apply_permission", + CLIPath: "drive permission apply", + PrimaryCLIPath: "drive permission apply", + }, Description: "向审批人发起文档权限申请(会真实通知审批人)", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -2183,6 +2344,13 @@ func newDriveCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "drive", + Name: "recycle_list", + CanonicalPath: "drive.recycle_list", + CLIPath: "drive recycle list", + PrimaryCLIPath: "drive recycle list", + }, Description: "查看回收站文件列表", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -2227,6 +2395,13 @@ func newDriveCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "drive", + Name: "recycle_restore", + CanonicalPath: "drive.recycle_restore", + CLIPath: "drive recycle restore", + PrimaryCLIPath: "drive recycle restore", + }, Description: "还原回收站中的文件", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -2323,6 +2498,13 @@ func newDriveCommand() *cobra.Command { return err }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "drive", + Name: "publish_set", + CanonicalPath: "drive.publish_set", + CLIPath: "drive publish set", + PrimaryCLIPath: "drive publish set", + }, Description: "开启文件的互联网公开发布", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -2375,6 +2557,13 @@ func newDriveCommand() *cobra.Command { return err }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "drive", + Name: "publish_unset", + CanonicalPath: "drive.publish_unset", + CLIPath: "drive publish unset", + PrimaryCLIPath: "drive publish unset", + }, Description: "关闭文件的互联网公开发布", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -2416,6 +2605,13 @@ func newDriveCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "drive", + Name: "publish_get", + CanonicalPath: "drive.publish_get", + CLIPath: "drive publish get", + PrimaryCLIPath: "drive publish get", + }, Description: "查询文件当前是否处于互联网公开发布状态", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -2518,6 +2714,13 @@ func newDriveCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "drive", + Name: "recent", + CanonicalPath: "drive.recent", + CLIPath: "drive recent", + PrimaryCLIPath: "drive recent", + }, Description: "获取当前用户最近访问或编辑过的文档列表", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -2576,6 +2779,13 @@ func newDriveCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "drive", + Name: "mark_star", + CanonicalPath: "drive.mark_star", + CLIPath: "drive star add", + PrimaryCLIPath: "drive star add", + }, Description: "收藏文档/文件到当前用户收藏列表", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -2610,6 +2820,13 @@ func newDriveCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "drive", + Name: "unmark_star", + CanonicalPath: "drive.unmark_star", + CLIPath: "drive star remove", + PrimaryCLIPath: "drive star remove", + }, Description: "将文档/文件从当前用户收藏列表移除", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -2659,6 +2876,13 @@ func newDriveCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "drive", + Name: "get_star_list", + CanonicalPath: "drive.get_star_list", + CLIPath: "drive star list", + PrimaryCLIPath: "drive star list", + }, Description: "获取当前用户的收藏列表,支持分页与按内容类型筛选", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -2703,6 +2927,13 @@ func newDriveCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "drive", + Name: "get_cover", + CanonicalPath: "drive.get_cover", + CLIPath: "drive cover", + PrimaryCLIPath: "drive cover", + }, Description: "获取节点封面图片地址(文档首图/图片缩略图/类型图标)", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -2747,6 +2978,13 @@ func newDriveCommand() *cobra.Command { Confirmation: "user_required", Idempotency: "non_idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "drive", + Name: "revert_file_version", + CanonicalPath: "drive.revert_file_version", + CLIPath: "drive revert", + PrimaryCLIPath: "drive revert", + }, Description: "回滚普通文件到指定历史版本(生成新最新版本,历史不丢失)", Interface: &contract.InterfaceSpec{ Mode: "composite", diff --git a/internal/helpers/hrbrain.go b/internal/helpers/hrbrain.go index 541f0596..79a7e42b 100644 --- a/internal/helpers/hrbrain.go +++ b/internal/helpers/hrbrain.go @@ -87,6 +87,13 @@ func newHrbrainCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "hrbrain", + Name: "list_talent_pools", + CanonicalPath: "hrbrain.list_talent_pools", + CLIPath: "hrbrain talent-pool list", + PrimaryCLIPath: "hrbrain talent-pool list", + }, Description: "查询人才池列表,支持按名称关键词、类型、创建人、标签筛选", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -142,6 +149,13 @@ func newHrbrainCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "hrbrain", + Name: "get_talent_pool_detail", + CanonicalPath: "hrbrain.get_talent_pool_detail", + CLIPath: "hrbrain talent-pool detail", + PrimaryCLIPath: "hrbrain talent-pool detail", + }, Description: "根据人才池编码获取人才池详细信息", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -185,6 +199,13 @@ func newHrbrainCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "hrbrain", + Name: "list_pool_employees", + CanonicalPath: "hrbrain.list_pool_employees", + CLIPath: "hrbrain talent-pool employees", + PrimaryCLIPath: "hrbrain talent-pool employees", + }, Description: "查询指定人才池内的人员列表", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -237,6 +258,13 @@ func newHrbrainCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "hrbrain", + Name: "get_profile_metadata", + CanonicalPath: "hrbrain.get_profile_metadata", + CLIPath: "hrbrain profile metadata", + PrimaryCLIPath: "hrbrain profile metadata", + }, Description: "查询员工档案元数据结构,用于构造档案数据查询参数", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -287,6 +315,13 @@ func newHrbrainCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "hrbrain", + Name: "query_profile_data", + CanonicalPath: "hrbrain.query_profile_data", + CLIPath: "hrbrain profile query", + PrimaryCLIPath: "hrbrain profile query", + }, Description: "按模块批量查询员工档案数据", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -336,6 +371,13 @@ func newHrbrainCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "hrbrain", + Name: "get_profile_label", + CanonicalPath: "hrbrain.get_profile_label", + CLIPath: "hrbrain profile labels", + PrimaryCLIPath: "hrbrain profile labels", + }, Description: "根据员工工号列表获取员工标签", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -376,6 +418,13 @@ func newHrbrainCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "hrbrain", + Name: "get_employee_career", + CanonicalPath: "hrbrain.get_employee_career", + CLIPath: "hrbrain profile career", + PrimaryCLIPath: "hrbrain profile career", + }, Description: "查询员工在公司内的职业历程", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -414,6 +463,13 @@ func newHrbrainCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "hrbrain", + Name: "get_employee_performance", + CanonicalPath: "hrbrain.get_employee_performance", + CLIPath: "hrbrain profile performance", + PrimaryCLIPath: "hrbrain profile performance", + }, Description: "查询员工绩效记录", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -476,6 +532,13 @@ func newHrbrainCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "hrbrain", + Name: "search_employees", + CanonicalPath: "hrbrain.search_employees", + CLIPath: "hrbrain search employees", + PrimaryCLIPath: "hrbrain search employees", + }, Description: "按关键词、部门、职务、职级、人才池等条件搜索员工", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -560,6 +623,13 @@ func newHrbrainCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "hrbrain", + Name: "search_employees_structured", + CanonicalPath: "hrbrain.search_employees_structured", + CLIPath: "hrbrain search employees-structured", + PrimaryCLIPath: "hrbrain search employees-structured", + }, Description: "使用高级条件表达式(originJson)搜索员工", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -605,6 +675,13 @@ func newHrbrainCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "hrbrain", + Name: "get_search_fields", + CanonicalPath: "hrbrain.get_search_fields", + CLIPath: "hrbrain search fields", + PrimaryCLIPath: "hrbrain search fields", + }, Description: "获取当前操作人有权限使用的高级搜索字段与操作符列表", Interface: &contract.InterfaceSpec{ Mode: "composite", diff --git a/internal/helpers/leaf_test.go b/internal/helpers/leaf_test.go index 6a788583..d883cd5b 100644 --- a/internal/helpers/leaf_test.go +++ b/internal/helpers/leaf_test.go @@ -415,6 +415,14 @@ func TestDeclareLeafMetadataInstallsConfirmSafetyForUserRequired(t *testing.T) { }, Validate: func(*cobra.Command, []string) error { return nil }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "dev", + Name: "create_thing", + CanonicalPath: "dev.create_thing", + CLIPath: "dev create", + PrimaryCLIPath: "dev create", + }, + Description: "test delete", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -482,6 +490,14 @@ func TestDeclareLeafMetadataDefersConfirmUntilCallTool(t *testing.T) { Confirmation: "user_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "dev", + Name: "create_thing", + CanonicalPath: "dev.create_thing", + CLIPath: "dev create", + PrimaryCLIPath: "dev create", + }, + Description: "test delete", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -546,6 +562,14 @@ func TestDeclareLeafMetadataValidateRunsBeforeConfirmSafety(t *testing.T) { return nil }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "dev", + Name: "create_thing", + CanonicalPath: "dev.create_thing", + CLIPath: "dev create", + PrimaryCLIPath: "dev create", + }, + Description: "test mutate", Interface: &contract.InterfaceSpec{ Mode: "composite", diff --git a/internal/helpers/live.go b/internal/helpers/live.go index 0bb75869..9e6266ab 100644 --- a/internal/helpers/live.go +++ b/internal/helpers/live.go @@ -43,6 +43,13 @@ func newLiveCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "live", + Name: "get_my_lives", + CanonicalPath: "live.get_my_lives", + CLIPath: "live stream list", + PrimaryCLIPath: "live stream list", + }, Description: "查看当前用户发起的直播列表与基础统计", Interface: &contract.InterfaceSpec{ Mode: "mcp", diff --git a/internal/helpers/mail.go b/internal/helpers/mail.go index 143d11aa..78f0eeee 100644 --- a/internal/helpers/mail.go +++ b/internal/helpers/mail.go @@ -142,6 +142,13 @@ func newMailCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "mail", + Name: "list_user_mailboxes", + CanonicalPath: "mail.list_user_mailboxes", + CLIPath: "mail mailbox list", + PrimaryCLIPath: "mail mailbox list", + }, Description: "列出当前登录用户自己的可用邮箱", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -264,6 +271,13 @@ func newMailCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "mail", + Name: "search_emails", + CanonicalPath: "mail.search_emails", + CLIPath: "mail message search", + PrimaryCLIPath: "mail message search", + }, Description: "用 KQL 搜索邮件,返回 ID 与元信息而非完整正文", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -329,6 +343,13 @@ func newMailCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "mail", + Name: "list_emails", + CanonicalPath: "mail.list_emails", + CLIPath: "mail message list", + PrimaryCLIPath: "mail message list", + }, Description: "列出收件箱或指定文件夹中的邮件(无需手写 KQL)", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -380,6 +401,13 @@ func newMailCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "mail", + Name: "get_email_by_message_id", + CanonicalPath: "mail.get_email_by_message_id", + CLIPath: "mail message get", + PrimaryCLIPath: "mail message get", + }, Description: "获取指定邮件的完整正文和元数据", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -464,6 +492,13 @@ func newMailCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "mail", + Name: "send_email", + CanonicalPath: "mail.send_email", + CLIPath: "mail message send", + PrimaryCLIPath: "mail message send", + }, Description: "以指定邮箱地址发送一封邮件", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -526,6 +561,13 @@ func newMailCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "mail", + Name: "list_folders", + CanonicalPath: "mail.list_folders", + CLIPath: "mail folder list", + PrimaryCLIPath: "mail folder list", + }, Description: "列出指定邮箱的系统和自定义文件夹", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -585,6 +627,13 @@ func newMailCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "mail", + Name: "create_mail_folder", + CanonicalPath: "mail.create_mail_folder", + CLIPath: "mail folder create", + PrimaryCLIPath: "mail folder create", + }, Description: "创建自定义邮件文件夹", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -630,6 +679,13 @@ func newMailCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "mail", + Name: "delete_mail_folder", + CanonicalPath: "mail.delete_mail_folder", + CLIPath: "mail folder delete", + PrimaryCLIPath: "mail folder delete", + }, Description: "删除指定邮箱下的邮件文件夹", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -679,6 +735,13 @@ func newMailCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "mail", + Name: "update_mail_folder", + CanonicalPath: "mail.update_mail_folder", + CLIPath: "mail folder update", + PrimaryCLIPath: "mail folder update", + }, Description: "重命名指定邮件文件夹", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -745,6 +808,13 @@ func newMailCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "mail", + Name: "list_tags", + CanonicalPath: "mail.list_tags", + CLIPath: "mail tag list", + PrimaryCLIPath: "mail tag list", + }, Description: "列出指定邮箱可用的邮件标签", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -956,6 +1026,13 @@ func newMailCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "mail", + Name: "get_thread", + CanonicalPath: "mail.get_thread", + CLIPath: "mail thread get", + PrimaryCLIPath: "mail thread get", + }, Description: "获取指定邮件会话的详情", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -1256,6 +1333,13 @@ internetMessageId 来源:message send / draft send / message reply / message r Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "mail", + Name: "create_reply_draft", + CanonicalPath: "mail.create_reply_draft", + CLIPath: "mail message reply", + PrimaryCLIPath: "mail message reply", + }, Description: "创建仅回复原发件人的邮件草稿", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -1329,6 +1413,13 @@ internetMessageId 来源:message send / draft send / message reply / message r Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "mail", + Name: "create_replyall_draft", + CanonicalPath: "mail.create_replyall_draft", + CLIPath: "mail message reply-all", + PrimaryCLIPath: "mail message reply-all", + }, Description: "创建回复原邮件全部参与者的草稿", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -1403,6 +1494,13 @@ internetMessageId 来源:message send / draft send / message reply / message r Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "mail", + Name: "create_forward_draft", + CanonicalPath: "mail.create_forward_draft", + CLIPath: "mail message forward", + PrimaryCLIPath: "mail message forward", + }, Description: "基于已有邮件创建转发草稿", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -1450,6 +1548,13 @@ internetMessageId 来源:message send / draft send / message reply / message r Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "mail", + Name: "batch_move_message", + CanonicalPath: "mail.batch_move_message", + CLIPath: "mail message batch-move", + PrimaryCLIPath: "mail message batch-move", + }, Description: "把多封邮件批量移动到指定文件夹", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -1492,6 +1597,13 @@ internetMessageId 来源:message send / draft send / message reply / message r Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "mail", + Name: "batch_delete_message", + CanonicalPath: "mail.batch_delete_message", + CLIPath: "mail message batch-delete", + PrimaryCLIPath: "mail message batch-delete", + }, Description: "批量删除邮件(可移入已删除或按类型删除)", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -1680,6 +1792,13 @@ internetMessageId 来源:message send / draft send / message reply / message r Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "mail", + Name: "create_draft", + CanonicalPath: "mail.create_draft", + CLIPath: "mail draft create", + PrimaryCLIPath: "mail draft create", + }, Description: "创建邮件草稿但不发送", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -1763,6 +1882,13 @@ internetMessageId 来源:message send / draft send / message reply / message r Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "mail", + Name: "update_draft", + CanonicalPath: "mail.update_draft", + CLIPath: "mail draft update", + PrimaryCLIPath: "mail draft update", + }, Description: "更新已有邮件草稿的内容", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -1815,6 +1941,13 @@ internetMessageId 来源:message send / draft send / message reply / message r Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "mail", + Name: "list_mail_attachments", + CanonicalPath: "mail.list_mail_attachments", + CLIPath: "mail attachment list", + PrimaryCLIPath: "mail attachment list", + }, Description: "列出指定邮件的全部附件元数据", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -1873,6 +2006,13 @@ internetMessageId 来源:message send / draft send / message reply / message r Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "mail", + Name: "create_download_session", + CanonicalPath: "mail.create_download_session", + CLIPath: "mail attachment download", + PrimaryCLIPath: "mail attachment download", + }, Description: "把指定邮件附件下载到本地文件", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -2116,6 +2256,13 @@ internetMessageId 来源:message send / draft send / message reply / message r Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "mail", + Name: "send_draft", + CanonicalPath: "mail.send_draft", + CLIPath: "mail draft send", + PrimaryCLIPath: "mail draft send", + }, Description: "发送草稿箱中已有的邮件草稿", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -2209,6 +2356,13 @@ user 对象字段: Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "mail", + Name: "search_mail_users", + CanonicalPath: "mail.search_mail_users", + CLIPath: "mail user search", + PrimaryCLIPath: "mail user search", + }, Description: "按姓名、工号或关键词搜索企业邮箱用户", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -2287,6 +2441,13 @@ user 对象字段: Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "mail", + Name: "create_user_message_template", + CanonicalPath: "mail.create_user_message_template", + CLIPath: "mail template create", + PrimaryCLIPath: "mail template create", + }, Description: "创建可复用的邮件模板", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -2353,6 +2514,13 @@ user 对象字段: Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "mail", + Name: "list_user_message_templates", + CanonicalPath: "mail.list_user_message_templates", + CLIPath: "mail template list", + PrimaryCLIPath: "mail template list", + }, Description: "分页列出当前邮箱的邮件模板", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -2404,6 +2572,13 @@ user 对象字段: Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "mail", + Name: "get_user_message_template", + CanonicalPath: "mail.get_user_message_template", + CLIPath: "mail template get", + PrimaryCLIPath: "mail template get", + }, Description: "获取指定邮件模板的完整内容", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -2476,6 +2651,13 @@ user 对象字段: Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "mail", + Name: "update_user_message_template", + CanonicalPath: "mail.update_user_message_template", + CLIPath: "mail template update", + PrimaryCLIPath: "mail template update", + }, Description: "更新已有邮件模板的内容", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -2533,6 +2715,13 @@ user 对象字段: Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "mail", + Name: "delete_user_message_template", + CanonicalPath: "mail.delete_user_message_template", + CLIPath: "mail template delete", + PrimaryCLIPath: "mail template delete", + }, Description: "删除指定邮件模板", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -2595,6 +2784,13 @@ user 对象字段: Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "mail", + Name: "create_user_mail_contact", + CanonicalPath: "mail.create_user_mail_contact", + CLIPath: "mail contact create", + PrimaryCLIPath: "mail contact create", + }, Description: "创建个人邮件联系人", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -2652,6 +2848,13 @@ user 对象字段: Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "mail", + Name: "list_user_mail_contacts", + CanonicalPath: "mail.list_user_mail_contacts", + CLIPath: "mail contact list", + PrimaryCLIPath: "mail contact list", + }, Description: "分页列出个人保存的邮件联系人", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -2717,6 +2920,13 @@ user 对象字段: Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "mail", + Name: "update_user_mail_contact", + CanonicalPath: "mail.update_user_mail_contact", + CLIPath: "mail contact update", + PrimaryCLIPath: "mail contact update", + }, Description: "更新个人邮件联系人的资料", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -2764,6 +2974,13 @@ user 对象字段: Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "mail", + Name: "batch_delete_user_mail_contacts", + CanonicalPath: "mail.batch_delete_user_mail_contacts", + CLIPath: "mail contact batch-delete", + PrimaryCLIPath: "mail contact batch-delete", + }, Description: "批量删除个人邮件联系人", Interface: &contract.InterfaceSpec{ Mode: "mcp", diff --git a/internal/helpers/markdown.go b/internal/helpers/markdown.go index 6665433f..940a012f 100644 --- a/internal/helpers/markdown.go +++ b/internal/helpers/markdown.go @@ -91,6 +91,13 @@ func newMarkdownFetchCmd() *cobra.Command { Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "markdown", + Name: "fetch", + CanonicalPath: "markdown.fetch", + CLIPath: "markdown fetch", + PrimaryCLIPath: "markdown fetch", + }, Description: "从钉盘或文档空间安全获取原生 Markdown 内容", DryRun: &contract.DryRunSpec{PreviewKind: "plan", RemoteReads: false}, Interface: &contract.InterfaceSpec{ @@ -246,6 +253,13 @@ func newMarkdownCreateCmd() *cobra.Command { Confirmation: "not_required", Idempotency: "non_idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "markdown", + Name: "create", + CanonicalPath: "markdown.create", + CLIPath: "markdown create", + PrimaryCLIPath: "markdown create", + }, Description: "在钉盘或文档空间创建原生 Markdown 文件", DryRun: &contract.DryRunSpec{PreviewKind: "plan", RemoteReads: false}, Interface: &contract.InterfaceSpec{ @@ -413,6 +427,13 @@ func newMarkdownOverwriteCmd() *cobra.Command { Confirmation: "user_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "markdown", + Name: "overwrite", + CanonicalPath: "markdown.overwrite", + CLIPath: "markdown overwrite", + PrimaryCLIPath: "markdown overwrite", + }, Description: "预览并全量覆盖钉盘或文档空间中的原生 Markdown 文件", DryRun: &contract.DryRunSpec{PreviewKind: "plan", RemoteReads: false}, Interface: &contract.InterfaceSpec{ @@ -581,6 +602,13 @@ func newMarkdownPatchCmd() *cobra.Command { Confirmation: "user_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "markdown", + Name: "patch", + CanonicalPath: "markdown.patch", + CLIPath: "markdown patch", + PrimaryCLIPath: "markdown patch", + }, Description: "预览并以字面量或 RE2 正则局部替换远程 Markdown 文本", DryRun: &contract.DryRunSpec{PreviewKind: "plan", RemoteReads: false}, Interface: &contract.InterfaceSpec{ diff --git a/internal/helpers/minutes.go b/internal/helpers/minutes.go index 02b840a0..c14bffef 100644 --- a/internal/helpers/minutes.go +++ b/internal/helpers/minutes.go @@ -47,6 +47,13 @@ func newMinutesCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "minutes", + Name: "list_by_keyword_and_time_range", + CanonicalPath: "minutes.list_by_keyword_and_time_range", + CLIPath: "minutes list mine", + PrimaryCLIPath: "minutes list mine", + }, Description: "查询当前用户自己创建的听记列表,支持分页、关键字和时间范围筛选。", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -86,6 +93,13 @@ func newMinutesCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "minutes", + Name: "list_shared_minutes", + CanonicalPath: "minutes.list_shared_minutes", + CLIPath: "minutes list shared", + PrimaryCLIPath: "minutes list shared", + }, Description: "查询他人共享给当前用户的听记列表,支持分页、关键字和时间范围筛选。", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -129,6 +143,13 @@ func newMinutesCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "minutes", + Name: "list_accessible_minutes", + CanonicalPath: "minutes.list_accessible_minutes", + CLIPath: "minutes list all", + PrimaryCLIPath: "minutes list all", + }, Description: "查询当前用户有权限访问的全部听记,包括自己创建和他人共享的听记,并支持分页、关键字和时间范围筛选。", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -174,6 +195,13 @@ func newMinutesCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "minutes", + Name: "get_minutes_basic_info", + CanonicalPath: "minutes.get_minutes_basic_info", + CLIPath: "minutes get info", + PrimaryCLIPath: "minutes get info", + }, Description: "获取指定听记的基础元数据信息。", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -213,6 +241,13 @@ func newMinutesCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "minutes", + Name: "get_minutes_ai_summary", + CanonicalPath: "minutes.get_minutes_ai_summary", + CLIPath: "minutes get summary", + PrimaryCLIPath: "minutes get summary", + }, Description: "获取由 AI 对听记转写原文进行结构化提炼生成的摘要,返回 Markdown 格式。", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -256,6 +291,13 @@ func newMinutesCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "minutes", + Name: "get_minutes_keywords", + CanonicalPath: "minutes.get_minutes_keywords", + CLIPath: "minutes get keywords", + PrimaryCLIPath: "minutes get keywords", + }, Description: "获取指定听记的关键字列表。", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -314,6 +356,13 @@ func newMinutesCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "minutes", + Name: "get_minutes_transcription", + CanonicalPath: "minutes.get_minutes_transcription", + CLIPath: "minutes get transcription", + PrimaryCLIPath: "minutes get transcription", + }, Description: "获取指定听记的语音转写原文。", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -357,6 +406,13 @@ func newMinutesCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "minutes", + Name: "list_minutes_todos", + CanonicalPath: "minutes.list_minutes_todos", + CLIPath: "minutes get todos", + PrimaryCLIPath: "minutes get todos", + }, Description: "查询指定听记中由系统提取的待办事项列表。", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -411,6 +467,13 @@ func newMinutesCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "minutes", + Name: "query_minutes_audio_url", + CanonicalPath: "minutes.query_minutes_audio_url", + CLIPath: "minutes get audio", + PrimaryCLIPath: "minutes get audio", + }, Description: "查询听记的音频/视频文件地址(OSS 链接)。", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -452,6 +515,13 @@ func newMinutesCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "minutes", + Name: "batch_get_minutes_details", + CanonicalPath: "minutes.batch_get_minutes_details", + CLIPath: "minutes get batch", + PrimaryCLIPath: "minutes get batch", + }, Description: "根据 taskUuid 列表批量查询听记详情。", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -495,6 +565,13 @@ func newMinutesCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "minutes", + Name: "update_minutes_title", + CanonicalPath: "minutes.update_minutes_title", + CLIPath: "minutes update title", + PrimaryCLIPath: "minutes update title", + }, Description: "修改指定听记的标题。", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -602,6 +679,13 @@ func newMinutesCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "minutes", + Name: "record_start", + CanonicalPath: "minutes.record_start", + CLIPath: "minutes record start", + PrimaryCLIPath: "minutes record start", + }, Description: "发起听记并开始录音。", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -645,6 +729,13 @@ func newMinutesCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "minutes", + Name: "record_pause", + CanonicalPath: "minutes.record_pause", + CLIPath: "minutes record pause", + PrimaryCLIPath: "minutes record pause", + }, Description: "暂停正在进行的听记录音。", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -691,6 +782,13 @@ func newMinutesCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "minutes", + Name: "record_resume", + CanonicalPath: "minutes.record_resume", + CLIPath: "minutes record resume", + PrimaryCLIPath: "minutes record resume", + }, Description: "恢复已暂停的听记录音。", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -737,6 +835,13 @@ func newMinutesCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "minutes", + Name: "record_stop", + CanonicalPath: "minutes.record_stop", + CLIPath: "minutes record stop", + PrimaryCLIPath: "minutes record stop", + }, Description: "结束正在进行的听记录音。", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -799,6 +904,13 @@ func newMinutesCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "minutes", + Name: "update_minutes_summary", + CanonicalPath: "minutes.update_minutes_summary", + CLIPath: "minutes update summary", + PrimaryCLIPath: "minutes update summary", + }, Description: "用传入的摘要文本全量覆盖听记的纪要内容,不触发 AI 重新生成。", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -852,6 +964,13 @@ func newMinutesCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "minutes", + Name: "create_mind_graph", + CanonicalPath: "minutes.create_mind_graph", + CLIPath: "minutes mind-graph create", + PrimaryCLIPath: "minutes mind-graph create", + }, Description: "触发创建听记思维导图任务。触发成功后,可通过 query_mind_graph_status 轮询任务状态。", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -901,6 +1020,13 @@ func newMinutesCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "minutes", + Name: "query_mind_graph_status", + CanonicalPath: "minutes.query_mind_graph_status", + CLIPath: "minutes mind-graph status", + PrimaryCLIPath: "minutes mind-graph status", + }, Description: "查询指定听记的思维导图生成状态。", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -962,6 +1088,13 @@ func newMinutesCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "minutes", + Name: "replace_speaker", + CanonicalPath: "minutes.replace_speaker", + CLIPath: "minutes speaker replace", + PrimaryCLIPath: "minutes speaker replace", + }, Description: "批量替换听记转写中指定发言人,将源发言人(speakerNick)精确匹配的所有段落替换为目标发言人。", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -1019,6 +1152,13 @@ func newMinutesCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "minutes", + Name: "create_speaker_summary", + CanonicalPath: "minutes.create_speaker_summary", + CLIPath: "minutes speaker summary create", + PrimaryCLIPath: "minutes speaker summary create", + }, Description: "触发创建发言人的段落总结任务,将听记中每位发言人的所有发言内容汇总总结。", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -1067,6 +1207,13 @@ func newMinutesCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "minutes", + Name: "get_speaker_summary", + CanonicalPath: "minutes.get_speaker_summary", + CLIPath: "minutes speaker summary get", + PrimaryCLIPath: "minutes speaker summary get", + }, Description: "查询发言人段落总结任务的结果,返回每位发言人的发言汇总。", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -1119,6 +1266,13 @@ func newMinutesCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "minutes", + Name: "add_personal_hot_word", + CanonicalPath: "minutes.add_personal_hot_word", + CLIPath: "minutes hot-word add", + PrimaryCLIPath: "minutes hot-word add", + }, Description: "添加听记个人热词,用于优化语音识别中专有名词、人名等的识别准确率。", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -1158,6 +1312,13 @@ func newMinutesCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "minutes", + Name: "list_my_hotwords", + CanonicalPath: "minutes.list_my_hotwords", + CLIPath: "minutes hot-word list", + PrimaryCLIPath: "minutes hot-word list", + }, Description: "查询当前用户配置的所有听记热词列表。", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -1199,6 +1360,13 @@ func newMinutesCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "minutes", + Name: "replace_minutes_text", + CanonicalPath: "minutes.replace_minutes_text", + CLIPath: "minutes replace-text", + PrimaryCLIPath: "minutes replace-text", + }, Description: "把听记中所有出现的原文字替换为目标文字,包括转写段落和纪要摘要中出现的原文字都会被替换。", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -1299,6 +1467,13 @@ func newMinutesCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "minutes", + Name: "create_upload_session", + CanonicalPath: "minutes.create_upload_session", + CLIPath: "minutes upload create", + PrimaryCLIPath: "minutes upload create", + }, Description: "创建文件上传会话,获取预签名上传URL。", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -1358,6 +1533,13 @@ func newMinutesCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "minutes", + Name: "complete_upload_session", + CanonicalPath: "minutes.complete_upload_session", + CLIPath: "minutes upload complete", + PrimaryCLIPath: "minutes upload complete", + }, Description: "文件上传完成后,创建听记。", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -1403,6 +1585,13 @@ func newMinutesCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "minutes", + Name: "cancel_upload_session", + CanonicalPath: "minutes.cancel_upload_session", + CLIPath: "minutes upload cancel", + PrimaryCLIPath: "minutes upload cancel", + }, Description: "取消 create 创建的上传会话,传入要取消的会话 ID。", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -1502,6 +1691,13 @@ func newMinutesCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "minutes", + Name: "add_member_permission", + CanonicalPath: "minutes.add_member_permission", + CLIPath: "minutes permission add", + PrimaryCLIPath: "minutes permission add", + }, Description: "批量给多个听记增加成员,并设置成员的权限。", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -1570,6 +1766,13 @@ func newMinutesCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "minutes", + Name: "remove_member_permission", + CanonicalPath: "minutes.remove_member_permission", + CLIPath: "minutes permission remove", + PrimaryCLIPath: "minutes permission remove", + }, Description: "批量移除多个听记的成员权限。移除后,对应成员将失去对这些听记的访问权限。", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -1630,6 +1833,13 @@ func newMinutesCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "minutes", + Name: "query_user_tag_list", + CanonicalPath: "minutes.query_user_tag_list", + CLIPath: "minutes tag list", + PrimaryCLIPath: "minutes tag list", + }, Description: "查询当前用户的听记标签或分组列表。", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -1682,6 +1892,13 @@ func newMinutesCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "minutes", + Name: "query_minutes_by_tag_id", + CanonicalPath: "minutes.query_minutes_by_tag_id", + CLIPath: "minutes tag query", + PrimaryCLIPath: "minutes tag query", + }, Description: "根据用户的标签或分组 ID 查询该标签下的听记列表。", Interface: &contract.InterfaceSpec{ Mode: "mcp", diff --git a/internal/helpers/oa.go b/internal/helpers/oa.go index 518741ea..5263143e 100644 --- a/internal/helpers/oa.go +++ b/internal/helpers/oa.go @@ -84,6 +84,13 @@ func newOaCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "oa", + Name: "list_pending_approvals", + CanonicalPath: "oa.list_pending_approvals", + CLIPath: "oa approval list-pending", + PrimaryCLIPath: "oa approval list-pending", + }, Description: "查询当前用户待处理的审批单列表", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -130,6 +137,13 @@ func newOaCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "oa", + Name: "get_processInstance_detail", + CanonicalPath: "oa.get_processInstance_detail", + CLIPath: "oa approval detail", + PrimaryCLIPath: "oa approval detail", + }, Description: "获取指定审批实例的详情信息", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -180,6 +194,13 @@ func newOaCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "oa", + Name: "approve_processInstance", + CanonicalPath: "oa.approve_processInstance", + CLIPath: "oa approval approve", + PrimaryCLIPath: "oa approval approve", + }, Description: "同意审批", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -229,6 +250,13 @@ func newOaCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "oa", + Name: "reject_processInstance", + CanonicalPath: "oa.reject_processInstance", + CLIPath: "oa approval reject", + PrimaryCLIPath: "oa approval reject", + }, Description: "拒绝审批", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -278,6 +306,13 @@ func newOaCommand() *cobra.Command { Confirmation: "user_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "oa", + Name: "revoke_processInstance", + CanonicalPath: "oa.revoke_processInstance", + CLIPath: "oa approval revoke", + PrimaryCLIPath: "oa approval revoke", + }, Description: "撤销当前用户已发起的审批实例", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -318,6 +353,13 @@ func newOaCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "oa", + Name: "get_processInstance_records", + CanonicalPath: "oa.get_processInstance_records", + CLIPath: "oa approval records", + PrimaryCLIPath: "oa approval records", + }, Description: "获取审批操作记录", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -378,6 +420,13 @@ func newOaCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "oa", + Name: "list_initiated_instances", + CanonicalPath: "oa.list_initiated_instances", + CLIPath: "oa approval list-initiated", + PrimaryCLIPath: "oa approval list-initiated", + }, Description: "查询当前用户已发起的审批实例列表", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -424,6 +473,13 @@ func newOaCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "oa", + Name: "list_pending_tasks", + CanonicalPath: "oa.list_pending_tasks", + CLIPath: "oa approval tasks", + PrimaryCLIPath: "oa approval tasks", + }, Description: "查询待我审批的任务Id", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -467,6 +523,13 @@ func newOaCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "oa", + Name: "list_user_visible_process", + CanonicalPath: "oa.list_user_visible_process", + CLIPath: "oa approval list-forms", + PrimaryCLIPath: "oa approval list-forms", + }, Description: "获取当前用户可见的审批表单列表", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -546,6 +609,13 @@ func newOaCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "oa", + Name: "get_done_tasks", + CanonicalPath: "oa.get_done_tasks", + CLIPath: "oa approval list-executed", + PrimaryCLIPath: "oa approval list-executed", + }, Description: "获取员工已处理任务列表", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -594,6 +664,13 @@ func newOaCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "oa", + Name: "get_submitted_instances", + CanonicalPath: "oa.get_submitted_instances", + CLIPath: "oa approval list-submitted", + PrimaryCLIPath: "oa approval list-submitted", + }, Description: "获取已提交实例列表", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -642,6 +719,13 @@ func newOaCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "oa", + Name: "get_noticed_instances", + CanonicalPath: "oa.get_noticed_instances", + CLIPath: "oa approval list-cc", + PrimaryCLIPath: "oa approval list-cc", + }, Description: "获取抄送用户的列表", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -693,6 +777,13 @@ func newOaCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "oa", + Name: "redirect_task", + CanonicalPath: "oa.redirect_task", + CLIPath: "oa approval redirect-task", + PrimaryCLIPath: "oa approval redirect-task", + }, Description: "转交审批任务", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -739,6 +830,13 @@ func newOaCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "oa", + Name: "dingflow_comments", + CanonicalPath: "oa.dingflow_comments", + CLIPath: "oa approval oa-comments", + PrimaryCLIPath: "oa approval oa-comments", + }, Description: "用户添加审批评论", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -792,6 +890,13 @@ func newOaCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "oa", + Name: "oa_cc_noticer", + CanonicalPath: "oa.oa_cc_noticer", + CLIPath: "oa approval oa-cc-noticer", + PrimaryCLIPath: "oa approval oa-cc-noticer", + }, Description: "抄送审批人", Interface: &contract.InterfaceSpec{ Mode: "mcp", diff --git a/internal/helpers/remaining_unit_coverage_test.go b/internal/helpers/remaining_unit_coverage_test.go index e07a6be8..d7c7e578 100644 --- a/internal/helpers/remaining_unit_coverage_test.go +++ b/internal/helpers/remaining_unit_coverage_test.go @@ -287,6 +287,14 @@ func TestSheetMutationGuardRejectsPipedYesEvenWithContractConfirmSafety(t *testi Confirmation: "user_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "dev", + Name: "create_thing", + CanonicalPath: "dev.create_thing", + CLIPath: "dev create", + PrimaryCLIPath: "dev create", + }, + Description: "test sheet delete", Interface: &contract.InterfaceSpec{ Mode: "composite", diff --git a/internal/helpers/report.go b/internal/helpers/report.go index 9199c6ce..fffbb505 100644 --- a/internal/helpers/report.go +++ b/internal/helpers/report.go @@ -101,6 +101,13 @@ func newReportCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "report", + Name: "get_available_report_templates", + CanonicalPath: "report.get_available_report_templates", + CLIPath: "report template list", + PrimaryCLIPath: "report template list", + }, Description: "获取当前员工可使用的日志模版列表", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -131,6 +138,14 @@ func newReportCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "report", + Name: "get_template_details_by_name", + CanonicalPath: "report.get_template_details_by_name", + CLIPath: "report template get", + PrimaryCLIPath: "report template get", + Aliases: []string{"report template detail"}, + }, Description: "按名称获取日志模版字段定义", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -179,6 +194,14 @@ func newReportCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "report", + Name: "get_report_entry_details", + CanonicalPath: "report.get_report_entry_details", + CLIPath: "report entry get", + PrimaryCLIPath: "report entry get", + Aliases: []string{"report detail"}, + }, Description: "获取指定一篇日志的详情信息", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -217,6 +240,14 @@ func newReportCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "report", + Name: "get_report_statistics_by_id", + CanonicalPath: "report.get_report_statistics_by_id", + CLIPath: "report entry stats", + PrimaryCLIPath: "report entry stats", + Aliases: []string{"report stats"}, + }, Description: "获取指定日志的统计数据", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -265,6 +296,14 @@ func newReportCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "report", + Name: "create_report", + CanonicalPath: "report.create_report", + CLIPath: "report entry submit", + PrimaryCLIPath: "report entry submit", + Aliases: []string{"report create"}, + }, Description: "按模版提交一份新日报", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -315,6 +354,14 @@ func newReportCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "report", + Name: "get_received_report_list", + CanonicalPath: "report.get_received_report_list", + CLIPath: "report inbox list", + PrimaryCLIPath: "report inbox list", + Aliases: []string{"report list"}, + }, Description: "查询当前人收到的日志列表", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -357,6 +404,14 @@ func newReportCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "report", + Name: "get_send_report_list", + CanonicalPath: "report.get_send_report_list", + CLIPath: "report outbox list", + PrimaryCLIPath: "report outbox list", + Aliases: []string{"report created", "report sent"}, + }, Description: "查询当前人创建的日志详情列表", Interface: &contract.InterfaceSpec{ Mode: "mcp", diff --git a/internal/helpers/sheet.go b/internal/helpers/sheet.go index e25d8e95..ec16acf6 100644 --- a/internal/helpers/sheet.go +++ b/internal/helpers/sheet.go @@ -134,6 +134,13 @@ func newSheetCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "sheet", + Name: "submit_export_job", + CanonicalPath: "sheet.submit_export_job", + CLIPath: "sheet export", + PrimaryCLIPath: "sheet export", + }, Description: "一站式导出 axls 为 xlsx(内部提交+轮询,可选下载)。", DryRun: &contract.DryRunSpec{PreviewKind: "plan", RemoteReads: false}, Interface: &contract.InterfaceSpec{ @@ -164,6 +171,13 @@ func newSheetCommand() *cobra.Command { Confirmation: "user_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "sheet", + Name: "batch_update", + CanonicalPath: "sheet.batch_update", + CLIPath: "sheet batch-update", + PrimaryCLIPath: "sheet batch-update", + }, Description: "批量打包多个写操作原子执行(可含清除/删除,需确认后加 --yes)。", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -185,6 +199,13 @@ func newSheetCommand() *cobra.Command { Confirmation: "user_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "sheet", + Name: "range_batch_clear", + CanonicalPath: "sheet.range_batch_clear", + CLIPath: "sheet range batch-clear", + PrimaryCLIPath: "sheet range batch-clear", + }, Description: "批量清除多个区域(原子事务,需确认后加 --yes)。", Interface: &contract.InterfaceSpec{ Mode: "composite", diff --git a/internal/helpers/sheet_chart.go b/internal/helpers/sheet_chart.go index 6c6a9d84..312e52d2 100644 --- a/internal/helpers/sheet_chart.go +++ b/internal/helpers/sheet_chart.go @@ -155,6 +155,13 @@ func newChartCmd() *cobra.Command { Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "sheet", + Name: "chart_list", + CanonicalPath: "sheet.chart_list", + CLIPath: "sheet chart list", + PrimaryCLIPath: "sheet chart list", + }, Description: "列出工作表浮动图表。", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -250,6 +257,13 @@ position.col 使用列字母表示法(如 "A"、"AA"),不支持数字形 Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "sheet", + Name: "chart_create", + CanonicalPath: "sheet.chart_create", + CLIPath: "sheet chart create", + PrimaryCLIPath: "sheet chart create", + }, Description: "创建浮动图表。", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -327,6 +341,13 @@ position.col 使用列字母表示法(如 "A"、"AA"),不支持数字形 Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "sheet", + Name: "chart_update", + CanonicalPath: "sheet.chart_update", + CLIPath: "sheet chart update", + PrimaryCLIPath: "sheet chart update", + }, Description: "更新浮动图表属性。", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -370,6 +391,13 @@ chart-id 可通过 chart list 获取。`, Confirmation: "user_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "sheet", + Name: "chart_delete", + CanonicalPath: "sheet.chart_delete", + CLIPath: "sheet chart delete", + PrimaryCLIPath: "sheet chart delete", + }, Description: "删除浮动图表(需确认后加 --yes)。", Interface: &contract.InterfaceSpec{ Mode: "composite", diff --git a/internal/helpers/sheet_comment.go b/internal/helpers/sheet_comment.go index 5e4d02a8..dc6f0710 100644 --- a/internal/helpers/sheet_comment.go +++ b/internal/helpers/sheet_comment.go @@ -49,6 +49,13 @@ func newSheetCommentCmd() *cobra.Command { Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "sheet", + Name: "list_sheet_comments", + CanonicalPath: "sheet.list_sheet_comments", + CLIPath: "sheet comment list", + PrimaryCLIPath: "sheet comment list", + }, Description: "查询表格单元格评论列表,支持分页与按解决状态过滤", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -101,6 +108,13 @@ func newSheetCommentCmd() *cobra.Command { Confirmation: "not_required", Idempotency: "non_idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "sheet", + Name: "create_sheet_comment", + CanonicalPath: "sheet.create_sheet_comment", + CLIPath: "sheet comment create", + PrimaryCLIPath: "sheet comment create", + }, Description: "在指定单元格上创建评论,可 @ 用户", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -154,6 +168,13 @@ func newSheetCommentCmd() *cobra.Command { Confirmation: "not_required", Idempotency: "non_idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "sheet", + Name: "reply_sheet_comment", + CanonicalPath: "sheet.reply_sheet_comment", + CLIPath: "sheet comment reply", + PrimaryCLIPath: "sheet comment reply", + }, Description: "回复指定单元格评论,支持表情贴图回复", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -199,6 +220,13 @@ func newSheetCommentCmd() *cobra.Command { Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "sheet", + Name: "update_sheet_comment", + CanonicalPath: "sheet.update_sheet_comment", + CLIPath: "sheet comment update", + PrimaryCLIPath: "sheet comment update", + }, Description: "更新单元格评论内容", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -242,6 +270,13 @@ func newSheetCommentCmd() *cobra.Command { Confirmation: "user_required", Idempotency: "non_idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "sheet", + Name: "delete_sheet_comment", + CanonicalPath: "sheet.delete_sheet_comment", + CLIPath: "sheet comment delete", + PrimaryCLIPath: "sheet comment delete", + }, Description: "删除单元格评论(不可恢复)", Interface: &contract.InterfaceSpec{ Mode: "composite", diff --git a/internal/helpers/sheet_cond_format.go b/internal/helpers/sheet_cond_format.go index 12b03449..21c911fe 100644 --- a/internal/helpers/sheet_cond_format.go +++ b/internal/helpers/sheet_cond_format.go @@ -44,6 +44,13 @@ sheetId 支持传入工作表 ID 或工作表名称,可通过 sheet list 获 Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "sheet", + Name: "get_cond_format", + CanonicalPath: "sheet.get_cond_format", + CLIPath: "sheet cond-format list", + PrimaryCLIPath: "sheet cond-format list", + }, Description: "列出工作表条件格式规则。", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -189,6 +196,13 @@ sheetId 支持传入工作表 ID 或工作表名称,可通过 sheet list 获 Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "sheet", + Name: "create_cond_format", + CanonicalPath: "sheet.create_cond_format", + CLIPath: "sheet cond-format create", + PrimaryCLIPath: "sheet cond-format create", + }, Description: "创建条件格式规则。", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -298,6 +312,13 @@ ruleId 可通过 cond-format list 获取。`, Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "sheet", + Name: "update_cond_format", + CanonicalPath: "sheet.update_cond_format", + CLIPath: "sheet cond-format update", + PrimaryCLIPath: "sheet cond-format update", + }, Description: "更新已有条件格式规则。", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -353,6 +374,13 @@ ruleId 可通过 cond-format list 获取。`, Confirmation: "user_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "sheet", + Name: "delete_cond_format", + CanonicalPath: "sheet.delete_cond_format", + CLIPath: "sheet cond-format delete", + PrimaryCLIPath: "sheet cond-format delete", + }, Description: "删除条件格式规则(需确认后加 --yes)。", Interface: &contract.InterfaceSpec{ Mode: "mcp", diff --git a/internal/helpers/sheet_data.go b/internal/helpers/sheet_data.go index 00234d56..26cc904a 100644 --- a/internal/helpers/sheet_data.go +++ b/internal/helpers/sheet_data.go @@ -81,6 +81,13 @@ sheetId 支持传入工作表 ID 或工作表名称,可通过 sheet list 获 Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "sheet", + Name: "find_cells", + CanonicalPath: "sheet.find_cells", + CLIPath: "sheet find", + PrimaryCLIPath: "sheet find", + }, Description: "在工作表中搜索单元格(支持精确匹配/正则/搜公式)。", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -170,6 +177,13 @@ sheetId 支持传入工作表 ID 或工作表名称,可通过 sheet list 获 Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "sheet", + Name: "replace_all", + CanonicalPath: "sheet.replace_all", + CLIPath: "sheet replace", + PrimaryCLIPath: "sheet replace", + }, Description: "全局查找替换文本(服务端原子操作)。", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -237,6 +251,13 @@ sheetId 支持传入工作表 ID 或工作表名称,可通过 sheet list 获 Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "sheet", + Name: "append_rows", + CanonicalPath: "sheet.append_rows", + CLIPath: "sheet append", + PrimaryCLIPath: "sheet append", + }, Description: "在工作表数据末尾追加带值的数据行。", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -319,6 +340,13 @@ range update 与合并区域冲突时返回 MERGED_CELLS_CONFLICT 的行为。 Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "sheet", + Name: "set_range_from_csv", + CanonicalPath: "sheet.set_range_from_csv", + CLIPath: "sheet csv-put", + PrimaryCLIPath: "sheet csv-put", + }, Description: "将 CSV 纯值写入起始单元格(可自动扩容;大批量纯值首选)。", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -396,6 +424,13 @@ dws sheet info --node NODE_ID --sheet-id SHEET_ID --format json,并读取 merg Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "sheet", + Name: "get_range_as_csv", + CanonicalPath: "sheet.get_range_as_csv", + CLIPath: "sheet csv-get", + PrimaryCLIPath: "sheet csv-get", + }, Description: "以 CSV 文本读取指定区域。", Interface: &contract.InterfaceSpec{ Mode: "mcp", diff --git a/internal/helpers/sheet_dimension.go b/internal/helpers/sheet_dimension.go index a091f7d8..3ae07ec8 100644 --- a/internal/helpers/sheet_dimension.go +++ b/internal/helpers/sheet_dimension.go @@ -65,6 +65,13 @@ func newDimensionCmds() []*cobra.Command { Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "sheet", + Name: "insert_dimension", + CanonicalPath: "sheet.insert_dimension", + CLIPath: "sheet insert-dimension", + PrimaryCLIPath: "sheet insert-dimension", + }, Description: "在指定位置之前插入空行或空列。", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -153,6 +160,13 @@ func newDimensionCmds() []*cobra.Command { Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "sheet", + Name: "move_dimension", + CanonicalPath: "sheet.move_dimension", + CLIPath: "sheet move-dimension", + PrimaryCLIPath: "sheet move-dimension", + }, Description: "移动连续行或列到目标索引(保留格式)。", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -219,6 +233,13 @@ func newDimensionCmds() []*cobra.Command { Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "sheet", + Name: "add_dimension", + CanonicalPath: "sheet.add_dimension", + CLIPath: "sheet add-dimension", + PrimaryCLIPath: "sheet add-dimension", + }, Description: "在工作表末尾追加空行或空列。", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -288,6 +309,13 @@ rangeAddress 也支持带工作表前缀的写法,如 Sheet1!A1:B3,此时将 Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "sheet", + Name: "merge_cells", + CanonicalPath: "sheet.merge_cells", + CLIPath: "sheet merge-cells", + PrimaryCLIPath: "sheet merge-cells", + }, Description: "合并指定区域单元格(默认 mergeAll,可按行/列合并)。", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -340,6 +368,13 @@ sheetId 支持传入工作表 ID 或工作表名称,可通过 sheet list 获 Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "sheet", + Name: "unmerge_range", + CanonicalPath: "sheet.unmerge_range", + CLIPath: "sheet unmerge-cells", + PrimaryCLIPath: "sheet unmerge-cells", + }, Description: "取消指定范围内的合并单元格。", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -415,6 +450,13 @@ sheetId 支持传入工作表 ID 或工作表名称,可通过 sheet list 获 Confirmation: "user_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "sheet", + Name: "delete_dimension", + CanonicalPath: "sheet.delete_dimension", + CLIPath: "sheet delete-dimension", + PrimaryCLIPath: "sheet delete-dimension", + }, Description: "删除指定位置起的连续行或列(需确认后加 --yes)。", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -514,6 +556,13 @@ sheetId 支持传入工作表 ID 或工作表名称,可通过 sheet list 获 Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "sheet", + Name: "update_dimension", + CanonicalPath: "sheet.update_dimension", + CLIPath: "sheet update-dimension", + PrimaryCLIPath: "sheet update-dimension", + }, Description: "更新连续行/列的显隐或行高/列宽。", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -586,6 +635,13 @@ sheetId 支持传入工作表 ID 或工作表名称,可通过 sheet list 获 Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "sheet", + Name: "group_dimension", + CanonicalPath: "sheet.group_dimension", + CLIPath: "sheet group-dimension", + PrimaryCLIPath: "sheet group-dimension", + }, Description: "为连续整行或整列创建分组(可展开/折叠)。", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -638,6 +694,13 @@ sheetId 支持传入工作表 ID 或工作表名称,可通过 sheet list 获 Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "sheet", + Name: "ungroup_dimension", + CanonicalPath: "sheet.ungroup_dimension", + CLIPath: "sheet ungroup-dimension", + PrimaryCLIPath: "sheet ungroup-dimension", + }, Description: "取消指定连续行/列分组。", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -719,6 +782,13 @@ sheetId 支持传入工作表 ID 或工作表名称,可通过 sheet list 获 Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "sheet", + Name: "set_dropdown_lists", + CanonicalPath: "sheet.set_dropdown_lists", + CLIPath: "sheet set-dropdown", + PrimaryCLIPath: "sheet set-dropdown", + }, Description: "为指定范围设置下拉列表(可多选、可带颜色)。", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -776,6 +846,13 @@ sheetId 支持传入工作表 ID 或工作表名称,可通过 sheet list 获 Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "sheet", + Name: "get_dropdown_lists", + CanonicalPath: "sheet.get_dropdown_lists", + CLIPath: "sheet get-dropdown", + PrimaryCLIPath: "sheet get-dropdown", + }, Description: "查询指定范围的下拉列表配置。", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -826,6 +903,13 @@ sheetId 支持传入工作表 ID 或工作表名称,可通过 sheet list 获 Confirmation: "user_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "sheet", + Name: "delete_dropdown_lists", + CanonicalPath: "sheet.delete_dropdown_lists", + CLIPath: "sheet delete-dropdown", + PrimaryCLIPath: "sheet delete-dropdown", + }, Description: "删除指定范围的下拉列表(需确认后加 --yes;不清除已填值)。", Interface: &contract.InterfaceSpec{ Mode: "mcp", diff --git a/internal/helpers/sheet_filter_view.go b/internal/helpers/sheet_filter_view.go index 3381e773..75428354 100644 --- a/internal/helpers/sheet_filter_view.go +++ b/internal/helpers/sheet_filter_view.go @@ -188,6 +188,13 @@ func newFilterCmd() *cobra.Command { Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "sheet", + Name: "get_filter", + CanonicalPath: "sheet.get_filter", + CLIPath: "sheet filter get", + PrimaryCLIPath: "sheet filter get", + }, Description: "获取工作表全局筛选信息。", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -248,6 +255,13 @@ func newFilterCmd() *cobra.Command { Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "sheet", + Name: "create_filter", + CanonicalPath: "sheet.create_filter", + CLIPath: "sheet filter create", + PrimaryCLIPath: "sheet filter create", + }, Description: "创建全局筛选(每表仅一个;range 须含表头)。", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -291,6 +305,13 @@ func newFilterCmd() *cobra.Command { Confirmation: "user_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "sheet", + Name: "delete_filter", + CanonicalPath: "sheet.delete_filter", + CLIPath: "sheet filter delete", + PrimaryCLIPath: "sheet filter delete", + }, Description: "删除全局筛选(需确认后加 --yes)。", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -350,6 +371,13 @@ func newFilterCmd() *cobra.Command { Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "sheet", + Name: "update_filter", + CanonicalPath: "sheet.update_filter", + CLIPath: "sheet filter update", + PrimaryCLIPath: "sheet filter update", + }, Description: "批量更新全局筛选多列条件。", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -399,6 +427,13 @@ func newFilterCmd() *cobra.Command { Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "sheet", + Name: "filter_clear_criteria", + CanonicalPath: "sheet.filter_clear_criteria", + CLIPath: "sheet filter clear-criteria", + PrimaryCLIPath: "sheet filter clear-criteria", + }, Description: "清除全局筛选中某一列条件(不删筛选本身)。", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -451,6 +486,13 @@ func newFilterCmd() *cobra.Command { Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "sheet", + Name: "sort_filter", + CanonicalPath: "sheet.sort_filter", + CLIPath: "sheet filter sort", + PrimaryCLIPath: "sheet filter sort", + }, Description: "在全局筛选范围内按列排序(会改物理顺序)。", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -515,6 +557,13 @@ sheetId 支持传入工作表 ID 或工作表名称,可通过 sheet list 获 Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "sheet", + Name: "get_filter_views", + CanonicalPath: "sheet.get_filter_views", + CLIPath: "sheet filter-view list", + PrimaryCLIPath: "sheet filter-view list", + }, Description: "列出工作表全部筛选视图概要。", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -590,6 +639,13 @@ sheetId 支持传入工作表 ID 或工作表名称,可通过 sheet list 获 Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "sheet", + Name: "create_filter_view", + CanonicalPath: "sheet.create_filter_view", + CLIPath: "sheet filter-view create", + PrimaryCLIPath: "sheet filter-view create", + }, Description: "创建个人筛选视图(可同时带 criteria)。", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -678,6 +734,13 @@ filterViewId 可通过 filter-view list 获取。 Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "sheet", + Name: "update_filter_view", + CanonicalPath: "sheet.update_filter_view", + CLIPath: "sheet filter-view update", + PrimaryCLIPath: "sheet filter-view update", + }, Description: "更新筛选视图名称、范围和/或多列条件。", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -734,6 +797,13 @@ filterViewId 可通过 filter-view list 获取。`, Confirmation: "user_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "sheet", + Name: "delete_filter_view", + CanonicalPath: "sheet.delete_filter_view", + CLIPath: "sheet filter-view delete", + PrimaryCLIPath: "sheet filter-view delete", + }, Description: "删除整个筛选视图(需确认后加 --yes)。", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -842,6 +912,13 @@ condition 类型支持的 operator(必须使用 kebab-case 格式): Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "sheet", + Name: "filter_view_update_criteria", + CanonicalPath: "sheet.filter_view_update_criteria", + CLIPath: "sheet filter-view update-criteria", + PrimaryCLIPath: "sheet filter-view update-criteria", + }, Description: "设置或更新筛选视图的单列条件。", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -907,6 +984,13 @@ filterViewId 可通过 filter-view list 获取。 Confirmation: "user_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "sheet", + Name: "filter_view_delete_criteria", + CanonicalPath: "sheet.filter_view_delete_criteria", + CLIPath: "sheet filter-view delete-criteria", + PrimaryCLIPath: "sheet filter-view delete-criteria", + }, Description: "清除筛选视图某列条件(需确认后加 --yes;保留视图)。", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -952,6 +1036,13 @@ filterViewId 可通过 filter-view list 获取。`, Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "sheet", + Name: "filter_view_info", + CanonicalPath: "sheet.filter_view_info", + CLIPath: "sheet filter-view info", + PrimaryCLIPath: "sheet filter-view info", + }, Description: "获取单个筛选视图完整配置(含 criteria)。", DryRun: &contract.DryRunSpec{PreviewKind: "plan", RemoteReads: false}, Interface: &contract.InterfaceSpec{ @@ -999,6 +1090,13 @@ filterViewId 可通过 filter-view list 获取。`, Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "sheet", + Name: "filter_view_list_criteria", + CanonicalPath: "sheet.filter_view_list_criteria", + CLIPath: "sheet filter-view list-criteria", + PrimaryCLIPath: "sheet filter-view list-criteria", + }, Description: "列出筛选视图已设置的全部列条件。", DryRun: &contract.DryRunSpec{PreviewKind: "plan", RemoteReads: false}, Interface: &contract.InterfaceSpec{ @@ -1052,6 +1150,13 @@ filterViewId 可通过 filter-view list 获取。`, Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "sheet", + Name: "filter_view_get_criteria", + CanonicalPath: "sheet.filter_view_get_criteria", + CLIPath: "sheet filter-view get-criteria", + PrimaryCLIPath: "sheet filter-view get-criteria", + }, Description: "获取筛选视图指定列的条件详情。", DryRun: &contract.DryRunSpec{PreviewKind: "plan", RemoteReads: false}, Interface: &contract.InterfaceSpec{ diff --git a/internal/helpers/sheet_float_image.go b/internal/helpers/sheet_float_image.go index a288321b..99cf85f5 100644 --- a/internal/helpers/sheet_float_image.go +++ b/internal/helpers/sheet_float_image.go @@ -82,6 +82,13 @@ func newFloatImageCmds() []*cobra.Command { Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "sheet", + Name: "create_float_image", + CanonicalPath: "sheet.create_float_image", + CLIPath: "sheet create-float-image", + PrimaryCLIPath: "sheet create-float-image", + }, Description: "创建浮动图片(src 必须来自 media-upload 的 resourceUrl)。", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -130,6 +137,13 @@ floatImageId 可通过 list-float-images 获取。`, Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "sheet", + Name: "get_float_image", + CanonicalPath: "sheet.get_float_image", + CLIPath: "sheet get-float-image", + PrimaryCLIPath: "sheet get-float-image", + }, Description: "获取单张浮动图片详情。", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -171,6 +185,13 @@ floatImageId 可通过 list-float-images 获取。`, Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "sheet", + Name: "list_float_images", + CanonicalPath: "sheet.list_float_images", + CLIPath: "sheet list-float-images", + PrimaryCLIPath: "sheet list-float-images", + }, Description: "列出工作表全部浮动图片。", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -268,6 +289,13 @@ floatImageId 可通过 list-float-images 获取。`, Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "sheet", + Name: "update_float_image", + CanonicalPath: "sheet.update_float_image", + CLIPath: "sheet update-float-image", + PrimaryCLIPath: "sheet update-float-image", + }, Description: "更新浮动图片锚点、尺寸、偏移或资源路径。", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -317,6 +345,13 @@ floatImageId 可通过 list-float-images 获取。`, Confirmation: "user_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "sheet", + Name: "delete_float_image", + CanonicalPath: "sheet.delete_float_image", + CLIPath: "sheet delete-float-image", + PrimaryCLIPath: "sheet delete-float-image", + }, Description: "删除浮动图片(需确认后加 --yes)。", Interface: &contract.InterfaceSpec{ Mode: "mcp", diff --git a/internal/helpers/sheet_formula_verify.go b/internal/helpers/sheet_formula_verify.go index 059abfd1..50f98c71 100644 --- a/internal/helpers/sheet_formula_verify.go +++ b/internal/helpers/sheet_formula_verify.go @@ -67,6 +67,13 @@ func newSheetFormulaVerifyCmd() *cobra.Command { Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "sheet", + Name: "formula_verify", + CanonicalPath: "sheet.formula_verify", + CLIPath: "sheet formula-verify", + PrimaryCLIPath: "sheet formula-verify", + }, Description: "扫描表格公式单元格并按错误类型聚合返回错误数量与位置", Interface: &contract.InterfaceSpec{ Mode: "composite", diff --git a/internal/helpers/sheet_import.go b/internal/helpers/sheet_import.go index 20694ac6..d07c58ac 100644 --- a/internal/helpers/sheet_import.go +++ b/internal/helpers/sheet_import.go @@ -79,6 +79,13 @@ func newSheetImportCmdWithConfig(cfg importFlowConfig) *cobra.Command { Confirmation: "not_required", Idempotency: "non_idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "sheet", + Name: "import", + CanonicalPath: "sheet.import", + CLIPath: "sheet import create", + PrimaryCLIPath: "sheet import create", + }, Description: "将本地 xlsx/xls 文件导入为新的钉钉在线电子表格。", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -123,6 +130,13 @@ func newSheetImportCmdWithConfig(cfg importFlowConfig) *cobra.Command { Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "sheet", + Name: "import_get", + CanonicalPath: "sheet.import_get", + CLIPath: "sheet import get", + PrimaryCLIPath: "sheet import get", + }, Description: "根据 taskId 查询表格导入任务结果。", Interface: &contract.InterfaceSpec{ Mode: "composite", diff --git a/internal/helpers/sheet_media.go b/internal/helpers/sheet_media.go index b74cbb43..d7a988c3 100644 --- a/internal/helpers/sheet_media.go +++ b/internal/helpers/sheet_media.go @@ -292,6 +292,13 @@ func newMediaCmds() []*cobra.Command { Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "sheet", + Name: "media_upload", + CanonicalPath: "sheet.media_upload", + CLIPath: "sheet media-upload", + PrimaryCLIPath: "sheet media-upload", + }, Description: "上传附件到表格并返回 resourceUrl(浮动图片前置步骤)。", DryRun: &contract.DryRunSpec{PreviewKind: "plan", RemoteReads: false}, Interface: &contract.InterfaceSpec{ @@ -345,6 +352,13 @@ func newMediaCmds() []*cobra.Command { Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "sheet", + Name: "write_image", + CanonicalPath: "sheet.write_image", + CLIPath: "sheet write-image", + PrimaryCLIPath: "sheet write-image", + }, Description: "上传图片并写入指定单元格(占单元格内容)。", DryRun: &contract.DryRunSpec{PreviewKind: "plan", RemoteReads: false}, Interface: &contract.InterfaceSpec{ diff --git a/internal/helpers/sheet_pivot_table.go b/internal/helpers/sheet_pivot_table.go index 9201a581..ac1a07bc 100644 --- a/internal/helpers/sheet_pivot_table.go +++ b/internal/helpers/sheet_pivot_table.go @@ -165,6 +165,13 @@ func newPivotTableCmd() *cobra.Command { Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "sheet", + Name: "list_pivot_tables", + CanonicalPath: "sheet.list_pivot_tables", + CLIPath: "sheet pivot-table list", + PrimaryCLIPath: "sheet pivot-table list", + }, Description: "列出或获取透视表信息。", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -224,6 +231,13 @@ func newPivotTableCmd() *cobra.Command { Confirmation: "not_required", Idempotency: "non_idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "sheet", + Name: "create_pivot_table", + CanonicalPath: "sheet.create_pivot_table", + CLIPath: "sheet pivot-table create", + PrimaryCLIPath: "sheet pivot-table create", + }, Description: "创建原生透视表。", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -275,6 +289,13 @@ func newPivotTableCmd() *cobra.Command { Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "sheet", + Name: "update_pivot_table", + CanonicalPath: "sheet.update_pivot_table", + CLIPath: "sheet pivot-table update", + PrimaryCLIPath: "sheet pivot-table update", + }, Description: "更新透视表配置。", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -320,6 +341,13 @@ func newPivotTableCmd() *cobra.Command { Confirmation: "user_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "sheet", + Name: "delete_pivot_table", + CanonicalPath: "sheet.delete_pivot_table", + CLIPath: "sheet pivot-table delete", + PrimaryCLIPath: "sheet pivot-table delete", + }, Description: "删除透视表(需确认后加 --yes)。", Interface: &contract.InterfaceSpec{ Mode: "composite", diff --git a/internal/helpers/sheet_range_ops.go b/internal/helpers/sheet_range_ops.go index 294e3e58..9d3aeb1c 100644 --- a/internal/helpers/sheet_range_ops.go +++ b/internal/helpers/sheet_range_ops.go @@ -76,6 +76,13 @@ dws sheet info --node NODE_ID --sheet-id SHEET_ID --format json,并读取 merg Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "sheet", + Name: "range_read", + CanonicalPath: "sheet.range_read", + CLIPath: "sheet range read", + PrimaryCLIPath: "sheet range read", + }, Description: "读取工作表指定范围的单元格数据(可取格式化值/原始值/公式)。", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -238,6 +245,13 @@ dws sheet info --node NODE_ID --sheet-id SHEET_ID --format json,并读取 merg Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "sheet", + Name: "range_update", + CanonicalPath: "sheet.range_update", + CLIPath: "sheet range update", + PrimaryCLIPath: "sheet range update", + }, Description: "更新指定区域单元格(值/公式/超链接等 object 协议);少量或含公式时使用。", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -301,6 +315,13 @@ dws sheet info --node NODE_ID --sheet-id SHEET_ID --format json,并读取 merg Confirmation: "user_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "sheet", + Name: "clear_range", + CanonicalPath: "sheet.clear_range", + CLIPath: "sheet range clear", + PrimaryCLIPath: "sheet range clear", + }, Description: "清除指定范围的内容、格式或全部(需确认后加 --yes)。", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -367,6 +388,13 @@ column 使用字母列名(如 "A"、"B"、"AA"),表示排序的目标列 Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "sheet", + Name: "sort_range", + CanonicalPath: "sheet.sort_range", + CLIPath: "sheet range sort", + PrimaryCLIPath: "sheet range sort", + }, Description: "对指定区域排序(改变物理行序)。", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -428,6 +456,13 @@ column 使用字母列名(如 "A"、"B"、"AA"),表示排序的目标列 Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "sheet", + Name: "fill_range", + CanonicalPath: "sheet.fill_range", + CLIPath: "sheet range fill", + PrimaryCLIPath: "sheet range fill", + }, Description: "按源区域对目标区域做自动填充(复制或序列)。", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -494,6 +529,13 @@ column 使用字母列名(如 "A"、"B"、"AA"),表示排序的目标列 Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "sheet", + Name: "range_copy_to", + CanonicalPath: "sheet.range_copy_to", + CLIPath: "sheet range copy-to", + PrimaryCLIPath: "sheet range copy-to", + }, Description: "将源范围复制到目标位置。", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -558,6 +600,13 @@ column 使用字母列名(如 "A"、"B"、"AA"),表示排序的目标列 Confirmation: "user_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "sheet", + Name: "range_move_to", + CanonicalPath: "sheet.range_move_to", + CLIPath: "sheet range move-to", + PrimaryCLIPath: "sheet range move-to", + }, Description: "将源范围移动到目标位置(需确认后加 --yes)。", Interface: &contract.InterfaceSpec{ Mode: "mcp", diff --git a/internal/helpers/sheet_style.go b/internal/helpers/sheet_style.go index 71b077fd..ce4fbeff 100644 --- a/internal/helpers/sheet_style.go +++ b/internal/helpers/sheet_style.go @@ -363,6 +363,13 @@ func newRangeSetStyleCmd() *cobra.Command { Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "sheet", + Name: "range_set_style", + CanonicalPath: "sheet.range_set_style", + CLIPath: "sheet range set-style", + PrimaryCLIPath: "sheet range set-style", + }, Description: "为指定范围统一设置背景、字体、对齐、换行或数字格式。", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -586,6 +593,13 @@ func newRangeBatchSetStyleCmd() *cobra.Command { Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "sheet", + Name: "range_batch_set_style", + CanonicalPath: "sheet.range_batch_set_style", + CLIPath: "sheet range batch-set-style", + PrimaryCLIPath: "sheet range batch-set-style", + }, Description: "按 JSON 配置文件顺序批量设置多个区域样式。", Interface: &contract.InterfaceSpec{ Mode: "composite", diff --git a/internal/helpers/sheet_table.go b/internal/helpers/sheet_table.go index ac0c3cea..aea9b123 100644 --- a/internal/helpers/sheet_table.go +++ b/internal/helpers/sheet_table.go @@ -63,6 +63,14 @@ func newTableCmds() []*cobra.Command { Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "sheet", + Name: "table_get", + CanonicalPath: "sheet.table_get", + CLIPath: "sheet table-get", + PrimaryCLIPath: "sheet table-get", + Aliases: []string{"sheet table-read"}, + }, Description: "读取结构化 table 区域数据。", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -132,6 +140,14 @@ func newTableCmds() []*cobra.Command { Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "sheet", + Name: "table_put", + CanonicalPath: "sheet.table_put", + CLIPath: "sheet table-put", + PrimaryCLIPath: "sheet table-put", + Aliases: []string{"sheet table-write"}, + }, Description: "写入一个或多个结构化 table。", Interface: &contract.InterfaceSpec{ Mode: "composite", diff --git a/internal/helpers/sheet_template.go b/internal/helpers/sheet_template.go index 4141edd7..ee0de5dd 100644 --- a/internal/helpers/sheet_template.go +++ b/internal/helpers/sheet_template.go @@ -43,6 +43,13 @@ func newSheetTemplateCmd() *cobra.Command { Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "sheet", + Name: "template_list", + CanonicalPath: "sheet.template_list", + CLIPath: "sheet template list", + PrimaryCLIPath: "sheet template list", + }, Description: "分页列出可用表格模板。", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -97,6 +104,13 @@ func newSheetTemplateCmd() *cobra.Command { Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "sheet", + Name: "template_search", + CanonicalPath: "sheet.template_search", + CLIPath: "sheet template search", + PrimaryCLIPath: "sheet template search", + }, Description: "按关键词搜索表格模板。", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -152,6 +166,13 @@ func newSheetTemplateCmd() *cobra.Command { Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "sheet", + Name: "template_apply", + CanonicalPath: "sheet.template_apply", + CLIPath: "sheet template apply", + PrimaryCLIPath: "sheet template apply", + }, Description: "应用模板创建新的电子表格文档。", Interface: &contract.InterfaceSpec{ Mode: "composite", diff --git a/internal/helpers/sheet_version.go b/internal/helpers/sheet_version.go index 3aaf1f0e..58e00bfb 100644 --- a/internal/helpers/sheet_version.go +++ b/internal/helpers/sheet_version.go @@ -35,6 +35,13 @@ func newSheetVersionCmd() *cobra.Command { Confirmation: "not_required", Idempotency: "non_idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "sheet", + Name: "version_save", + CanonicalPath: "sheet.version_save", + CLIPath: "sheet version save", + PrimaryCLIPath: "sheet version save", + }, Description: "手动保存表格版本快照", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -78,6 +85,13 @@ func newSheetVersionCmd() *cobra.Command { Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "sheet", + Name: "version_list", + CanonicalPath: "sheet.version_list", + CLIPath: "sheet version list", + PrimaryCLIPath: "sheet version list", + }, Description: "查看表格历史版本列表", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -121,6 +135,13 @@ func newSheetVersionCmd() *cobra.Command { Confirmation: "user_required", Idempotency: "non_idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "sheet", + Name: "version_revert", + CanonicalPath: "sheet.version_revert", + CLIPath: "sheet version revert", + PrimaryCLIPath: "sheet version revert", + }, Description: "回滚表格到指定历史版本", Interface: &contract.InterfaceSpec{ Mode: "composite", diff --git a/internal/helpers/sheet_workbook.go b/internal/helpers/sheet_workbook.go index 3a5602f2..f8d8a422 100644 --- a/internal/helpers/sheet_workbook.go +++ b/internal/helpers/sheet_workbook.go @@ -36,6 +36,13 @@ func newWorkbookCmds() []*cobra.Command { Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "sheet", + Name: "create_workspace_sheet", + CanonicalPath: "sheet.create_workspace_sheet", + CLIPath: "sheet create", + PrimaryCLIPath: "sheet create", + }, Description: "创建钉钉在线电子表格文档(axls),返回 nodeId。", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -85,6 +92,13 @@ nodeId 支持传入文档链接 URL 或文档 ID(dentryUuid),系统自动 Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "sheet", + Name: "get_all_sheets", + CanonicalPath: "sheet.get_all_sheets", + CLIPath: "sheet list", + PrimaryCLIPath: "sheet list", + }, Description: "列出电子表格文档内全部工作表的 ID 与名称。", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -144,6 +158,13 @@ sheetId 支持传入工作表 ID 或工作表名称,可通过 sheet list 获 Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "sheet", + Name: "info", + CanonicalPath: "sheet.info", + CLIPath: "sheet info", + PrimaryCLIPath: "sheet info", + }, Description: "获取指定工作表详情(行列数、非空范围、合并区等)。", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -186,6 +207,13 @@ sheetId 支持传入工作表 ID 或工作表名称,可通过 sheet list 获 Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "sheet", + Name: "create_sheet", + CanonicalPath: "sheet.create_sheet", + CLIPath: "sheet new", + PrimaryCLIPath: "sheet new", + }, Description: "在已有电子表格文档中新建工作表(Sheet 页签)。", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -300,6 +328,13 @@ sheetId 支持传入工作表 ID 或工作表名称,可通过 sheet list 获 Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "sheet", + Name: "update_sheet", + CanonicalPath: "sheet.update_sheet", + CLIPath: "sheet update", + PrimaryCLIPath: "sheet update", + }, Description: "更新工作表属性:名称、位置、隐藏、标签色、冻结行列。", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -374,6 +409,13 @@ name 不能包含 / \ ? * [ ] : 等特殊字符,最长 100 字符。`, Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "sheet", + Name: "copy_sheet", + CanonicalPath: "sheet.copy_sheet", + CLIPath: "sheet copy", + PrimaryCLIPath: "sheet copy", + }, Description: "在同一文档内复制工作表(含数据与格式)。", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -420,6 +462,13 @@ name 不能包含 / \ ? * [ ] : 等特殊字符,最长 100 字符。`, Confirmation: "user_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "sheet", + Name: "delete_sheet", + CanonicalPath: "sheet.delete_sheet", + CLIPath: "sheet delete-sheet", + PrimaryCLIPath: "sheet delete-sheet", + }, Description: "删除指定工作表(不可逆,需确认后加 --yes)。", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -465,6 +514,13 @@ name 不能包含 / \ ? * [ ] : 等特殊字符,最长 100 字符。`, Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "sheet", + Name: "show_gridline", + CanonicalPath: "sheet.show_gridline", + CLIPath: "sheet show-gridline", + PrimaryCLIPath: "sheet show-gridline", + }, Description: "显示工作表网格线。", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -510,6 +566,13 @@ name 不能包含 / \ ? * [ ] : 等特殊字符,最长 100 字符。`, Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "sheet", + Name: "hide_gridline", + CanonicalPath: "sheet.hide_gridline", + CLIPath: "sheet hide-gridline", + PrimaryCLIPath: "sheet hide-gridline", + }, Description: "隐藏工作表网格线。", Interface: &contract.InterfaceSpec{ Mode: "composite", diff --git a/internal/helpers/todo.go b/internal/helpers/todo.go index ca83e44c..5c62d390 100644 --- a/internal/helpers/todo.go +++ b/internal/helpers/todo.go @@ -127,6 +127,13 @@ func newTodoCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "todo", + Name: "create_personal_todo", + CanonicalPath: "todo.create_personal_todo", + CLIPath: "todo task create", + PrimaryCLIPath: "todo task create", + }, Description: "创建个人待办", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -215,6 +222,13 @@ func newTodoCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "todo", + Name: "create_personal_sub_todo", + CanonicalPath: "todo.create_personal_sub_todo", + CLIPath: "todo task create-sub", + PrimaryCLIPath: "todo task create-sub", + }, Description: "创建个人子待办", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -281,6 +295,13 @@ func newTodoCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "todo", + Name: "get_user_todos_in_current_org", + CanonicalPath: "todo.get_user_todos_in_current_org", + CLIPath: "todo task list", + PrimaryCLIPath: "todo task list", + }, Description: "查询当前组织待办,或通过 --query-all 跨组织查询全部待办", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -373,6 +394,13 @@ func newTodoCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "todo", + Name: "update_todo_task", + CanonicalPath: "todo.update_todo_task", + CLIPath: "todo task update", + PrimaryCLIPath: "todo task update", + }, Description: "修改整个待办任务", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -430,6 +458,13 @@ func newTodoCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "todo", + Name: "update_todo_done_status", + CanonicalPath: "todo.update_todo_done_status", + CLIPath: "todo task done", + PrimaryCLIPath: "todo task done", + }, Description: "修改执行者的待办完成状态", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -506,6 +541,13 @@ reset-reminder 写入的提醒规则。提醒写命令的成功响应只能作 Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "todo", + Name: "get_todo_detail", + CanonicalPath: "todo.get_todo_detail", + CLIPath: "todo task get", + PrimaryCLIPath: "todo task get", + }, Description: "查询待办详情", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -552,6 +594,13 @@ reset-reminder 写入的提醒规则。提醒写命令的成功响应只能作 Confirmation: "user_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "todo", + Name: "delete_todo", + CanonicalPath: "todo.delete_todo", + CLIPath: "todo task delete", + PrimaryCLIPath: "todo task delete", + }, Description: "删除待办", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -596,6 +645,13 @@ reset-reminder 写入的提醒规则。提醒写命令的成功响应只能作 Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "todo", + Name: "add_task_executors", + CanonicalPath: "todo.add_task_executors", + CLIPath: "todo task add-executor", + PrimaryCLIPath: "todo task add-executor", + }, Description: "添加待办执行人", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -647,6 +703,13 @@ reset-reminder 写入的提醒规则。提醒写命令的成功响应只能作 Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "todo", + Name: "remove_task_executors", + CanonicalPath: "todo.remove_task_executors", + CLIPath: "todo task remove-executor", + PrimaryCLIPath: "todo task remove-executor", + }, Description: "移除待办执行人", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -697,6 +760,13 @@ reset-reminder 写入的提醒规则。提醒写命令的成功响应只能作 Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "todo", + Name: "add_task_participants", + CanonicalPath: "todo.add_task_participants", + CLIPath: "todo task add-participant", + PrimaryCLIPath: "todo task add-participant", + }, Description: "添加待办参与人", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -748,6 +818,13 @@ reset-reminder 写入的提醒规则。提醒写命令的成功响应只能作 Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "todo", + Name: "remove_task_participants", + CanonicalPath: "todo.remove_task_participants", + CLIPath: "todo task remove-participant", + PrimaryCLIPath: "todo task remove-participant", + }, Description: "移除待办参与人", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -828,6 +905,13 @@ reset-reminder 写入的提醒规则。提醒写命令的成功响应只能作 Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "todo", + Name: "add_todo_reminder", + CanonicalPath: "todo.add_todo_reminder", + CLIPath: "todo task add-reminder", + PrimaryCLIPath: "todo task add-reminder", + }, Description: "写入一条待办提醒规则(上游不支持规则读回)", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -895,6 +979,13 @@ reset-reminder 写入的提醒规则。提醒写命令的成功响应只能作 Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "todo", + Name: "reset_todo_reminder", + CanonicalPath: "todo.reset_todo_reminder", + CLIPath: "todo task reset-reminder", + PrimaryCLIPath: "todo task reset-reminder", + }, Description: "整体替换或清除待办提醒规则(上游不支持规则读回)", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -979,6 +1070,13 @@ reset-reminder 写入的提醒规则。提醒写命令的成功响应只能作 Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "todo", + Name: "add_todo_attachment", + CanonicalPath: "todo.add_todo_attachment", + CLIPath: "todo task add-attachment", + PrimaryCLIPath: "todo task add-attachment", + }, Description: "上传待办附件", DryRun: &contract.DryRunSpec{PreviewKind: "plan", RemoteReads: false}, Interface: &contract.InterfaceSpec{ @@ -1032,6 +1130,13 @@ reset-reminder 写入的提醒规则。提醒写命令的成功响应只能作 Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "todo", + Name: "list_todo_attachment", + CanonicalPath: "todo.list_todo_attachment", + CLIPath: "todo task list-attachment", + PrimaryCLIPath: "todo task list-attachment", + }, Description: "查询待办附件列表", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -1194,6 +1299,13 @@ reset-reminder 写入的提醒规则。提醒写命令的成功响应只能作 Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "todo", + Name: "add_todo_comment", + CanonicalPath: "todo.add_todo_comment", + CLIPath: "todo comment add", + PrimaryCLIPath: "todo comment add", + }, Description: "给待办添加评论", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -1239,6 +1351,13 @@ reset-reminder 写入的提醒规则。提醒写命令的成功响应只能作 Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "todo", + Name: "list_todo_comment", + CanonicalPath: "todo.list_todo_comment", + CLIPath: "todo comment list", + PrimaryCLIPath: "todo comment list", + }, Description: "获取待办评论列表", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -1287,6 +1406,13 @@ reset-reminder 写入的提醒规则。提醒写命令的成功响应只能作 Confirmation: "user_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "todo", + Name: "delete_todo_comment", + CanonicalPath: "todo.delete_todo_comment", + CLIPath: "todo comment delete", + PrimaryCLIPath: "todo comment delete", + }, Description: "删除待办评论", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -1350,6 +1476,13 @@ reset-reminder 写入的提醒规则。提醒写命令的成功响应只能作 Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "todo", + Name: "tag_todo", + CanonicalPath: "todo.tag_todo", + CLIPath: "todo tag add", + PrimaryCLIPath: "todo tag add", + }, Description: "把一个或多个现有标签添加到指定待办", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -1396,6 +1529,13 @@ reset-reminder 写入的提醒规则。提醒写命令的成功响应只能作 Confirmation: "user_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "todo", + Name: "delete_todo_tag", + CanonicalPath: "todo.delete_todo_tag", + CLIPath: "todo tag delete", + PrimaryCLIPath: "todo tag delete", + }, Description: "不可逆地删除当前用户的一个或多个待办标签", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -1448,6 +1588,13 @@ reset-reminder 写入的提醒规则。提醒写命令的成功响应只能作 Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "todo", + Name: "update_todo_tag", + CanonicalPath: "todo.update_todo_tag", + CLIPath: "todo tag update", + PrimaryCLIPath: "todo tag update", + }, Description: "批量更新已有待办标签的名称等定义", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -1480,6 +1627,13 @@ reset-reminder 写入的提醒规则。提醒写命令的成功响应只能作 Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "todo", + Name: "list_todo_tags", + CanonicalPath: "todo.list_todo_tags", + CLIPath: "todo tag list", + PrimaryCLIPath: "todo tag list", + }, Description: "列出当前用户可用的待办标签及其 code", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -1520,6 +1674,13 @@ reset-reminder 写入的提醒规则。提醒写命令的成功响应只能作 Confirmation: "not_required", Idempotency: "non_idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "todo", + Name: "create_todo_tag", + CanonicalPath: "todo.create_todo_tag", + CLIPath: "todo tag create", + PrimaryCLIPath: "todo tag create", + }, Description: "为当前用户创建一个新的待办标签", Interface: &contract.InterfaceSpec{ Mode: "composite", diff --git a/internal/helpers/wiki.go b/internal/helpers/wiki.go index a0ed7d2b..1e74249f 100644 --- a/internal/helpers/wiki.go +++ b/internal/helpers/wiki.go @@ -196,6 +196,13 @@ func newWikiCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "wiki", + Name: "create_wikiSpace", + CanonicalPath: "wiki.create_wikiSpace", + CLIPath: "wiki space create", + PrimaryCLIPath: "wiki space create", + }, Description: "创建一个新的钉钉文档知识库(WikiSpace)", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -244,6 +251,13 @@ func newWikiCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "wiki", + Name: "get_wikiSpace", + CanonicalPath: "wiki.get_wikiSpace", + CLIPath: "wiki space get", + PrimaryCLIPath: "wiki space get", + }, Description: "获取指定知识库的详细信息,包括名称、描述、创建者、创建时间、成员数量等", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -317,6 +331,13 @@ func newWikiCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "wiki", + Name: "list_wikiSpaces", + CanonicalPath: "wiki.list_wikiSpaces", + CLIPath: "wiki space list", + PrimaryCLIPath: "wiki space list", + }, Description: "列出当前用户可访问的知识库或钉盘空间", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -377,6 +398,13 @@ func newWikiCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "wiki", + Name: "search_wikiSpaces", + CanonicalPath: "wiki.search_wikiSpaces", + CLIPath: "wiki space search", + PrimaryCLIPath: "wiki space search", + }, Description: "根据关键词搜索当前用户有权限访问的知识库列表,匹配知识库名称和描述", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -452,6 +480,13 @@ func newWikiCommand() *cobra.Command { Confirmation: "user_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "wiki", + Name: "delete_wikiSpace", + CanonicalPath: "wiki.delete_wikiSpace", + CLIPath: "wiki space delete", + PrimaryCLIPath: "wiki space delete", + }, Description: "将指定知识库移入回收站", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -536,6 +571,13 @@ func newWikiCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "wiki", + Name: "add_member", + CanonicalPath: "wiki.add_member", + CLIPath: "wiki member add", + PrimaryCLIPath: "wiki member add", + }, Description: "为指定知识库添加一个或多个成员,并授予指定角色", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -612,6 +654,13 @@ func newWikiCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "wiki", + Name: "update_member", + CanonicalPath: "wiki.update_member", + CLIPath: "wiki member update", + PrimaryCLIPath: "wiki member update", + }, Description: "更新指定知识库已有成员的角色", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -679,6 +728,13 @@ ORG 类型授权不会出现在查询结果中。`, Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "wiki", + Name: "list_member", + CanonicalPath: "wiki.list_member", + CLIPath: "wiki member list", + PrimaryCLIPath: "wiki member list", + }, Description: "查询指定知识库的成员列表,返回每位成员的 userId、姓名、角色等信息", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -742,6 +798,13 @@ ORG 类型授权不会出现在查询结果中。`, Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "wiki", + Name: "remove_member", + CanonicalPath: "wiki.remove_member", + CLIPath: "wiki member remove", + PrimaryCLIPath: "wiki member remove", + }, Description: "从指定知识库中移除一个或多个成员(仅支持 USER 类型)", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -830,6 +893,13 @@ ORG 类型授权不会出现在查询结果中。`, Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "wiki", + Name: "list_nodes", + CanonicalPath: "wiki.list_nodes", + CLIPath: "wiki node list", + PrimaryCLIPath: "wiki node list", + }, Description: "列出指定知识库下的直接子节点(文档、文件夹、表格等)", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -909,6 +979,13 @@ ORG 类型授权不会出现在查询结果中。`, Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "wiki", + Name: "create_file", + CanonicalPath: "wiki.create_file", + CLIPath: "wiki node create", + PrimaryCLIPath: "wiki node create", + }, Description: "在指定知识库中创建文档、文件夹或其他类型的节点", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -976,6 +1053,13 @@ ORG 类型授权不会出现在查询结果中。`, Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "wiki", + Name: "node_copy", + CanonicalPath: "wiki.node_copy", + CLIPath: "wiki node copy", + PrimaryCLIPath: "wiki node copy", + }, Description: "将知识库中的节点复制到指定位置", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -1041,6 +1125,13 @@ ORG 类型授权不会出现在查询结果中。`, Confirmation: "not_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "wiki", + Name: "node_move", + CanonicalPath: "wiki.node_move", + CLIPath: "wiki node move", + PrimaryCLIPath: "wiki node move", + }, Description: "将知识库中的节点移动到指定位置", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -1094,6 +1185,13 @@ ORG 类型授权不会出现在查询结果中。`, Confirmation: "user_required", Idempotency: "unknown", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "wiki", + Name: "delete_document", + CanonicalPath: "wiki.delete_document", + CLIPath: "wiki node delete", + PrimaryCLIPath: "wiki node delete", + }, Description: "将知识库中的节点移入回收站", Interface: &contract.InterfaceSpec{ Mode: "mcp", @@ -1158,6 +1256,13 @@ ORG 类型授权不会出现在查询结果中。`, Confirmation: "not_required", Idempotency: "idempotent", }, Contract: LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "wiki", + Name: "node_search", + CanonicalPath: "wiki.node_search", + CLIPath: "wiki node search", + PrimaryCLIPath: "wiki node search", + }, Description: "在指定知识库内搜索文档/文件夹/表格等节点", Interface: &contract.InterfaceSpec{ Mode: "mcp", diff --git a/internal/pat/browser_policy.go b/internal/pat/browser_policy.go index 70c223df..ce519e82 100644 --- a/internal/pat/browser_policy.go +++ b/internal/pat/browser_policy.go @@ -232,6 +232,13 @@ func newBrowserPolicyCommand() *cobra.Command { Confirmation: "not_required", Idempotency: "unknown", }, Contract: helpers.LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "pat", + Name: "browser_policy", + CanonicalPath: "pat.browser_policy", + CLIPath: "pat browser-policy", + PrimaryCLIPath: "pat browser-policy", + }, Description: "配置 PAT 授权流程是否允许打开本地浏览器", Interface: &contract.InterfaceSpec{ Mode: "local", diff --git a/internal/pat/chmod.go b/internal/pat/chmod.go index d854c35b..5a1920e1 100644 --- a/internal/pat/chmod.go +++ b/internal/pat/chmod.go @@ -446,6 +446,13 @@ agentCode 配置: return nil }, Contract: helpers.LeafContract{ + Identity: contract.ToolIdentitySpec{ + ProductID: "pat", + Name: "batch_grant", + CanonicalPath: "pat.batch_grant", + CLIPath: "pat chmod", + PrimaryCLIPath: "pat chmod", + }, Description: "预览或执行 PAT 批量行为授权(支持 dryRun / pending flow)", Interface: &contract.InterfaceSpec{ Mode: "mcp", diff --git a/internal/shortcut/aitable/aitable.go b/internal/shortcut/aitable/aitable.go index 88e7086a..faecef3e 100644 --- a/internal/shortcut/aitable/aitable.go +++ b/internal/shortcut/aitable/aitable.go @@ -76,6 +76,13 @@ var BaseList = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "aitable", + Name: "shortcut_base_list", + CanonicalPath: "aitable.shortcut_base_list", + CLIPath: "aitable +base-list", + PrimaryCLIPath: "aitable +base-list", + }, Description: "获取当前用户可访问的 AI 表格 Base 列表(最近访问,支持游标分页)", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -189,6 +196,13 @@ var BaseSearch = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "aitable", + Name: "shortcut_base_search", + CanonicalPath: "aitable.shortcut_base_search", + CLIPath: "aitable +base-search", + PrimaryCLIPath: "aitable +base-search", + }, Description: "按名称关键词搜索 AI 表格 Base", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -234,6 +248,13 @@ var BaseGet = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "aitable", + Name: "shortcut_base_get", + CanonicalPath: "aitable.shortcut_base_get", + CLIPath: "aitable +base-get", + PrimaryCLIPath: "aitable +base-get", + }, Description: "获取指定 Base 的目录信息(tables / dashboards summary)", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -368,6 +389,13 @@ var TableGet = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "aitable", + Name: "shortcut_table_get", + CanonicalPath: "aitable.shortcut_table_get", + CLIPath: "aitable +table-get", + PrimaryCLIPath: "aitable +table-get", + }, Description: "批量获取指定数据表的表级信息、字段目录与视图目录", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -476,6 +504,13 @@ var FieldGet = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "aitable", + Name: "shortcut_field_get", + CanonicalPath: "aitable.shortcut_field_get", + CLIPath: "aitable +field-get", + PrimaryCLIPath: "aitable +field-get", + }, Description: "批量获取字段详情(含类型相关完整配置)", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -593,6 +628,13 @@ var RecordQuery = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "aitable", + Name: "shortcut_record_query", + CanonicalPath: "aitable.shortcut_record_query", + CLIPath: "aitable +record-query", + PrimaryCLIPath: "aitable +record-query", + }, Description: "查询表格记录(按 ID 取 / 条件筛选 / 关键词 / 分页)", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -720,6 +762,13 @@ var RecordQueryEmpty = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "aitable", + Name: "shortcut_record_query_empty", + CanonicalPath: "aitable.shortcut_record_query_empty", + CLIPath: "aitable +record-query-empty", + PrimaryCLIPath: "aitable +record-query-empty", + }, Description: "扫描并过滤出完全没填用户字段的空行", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -768,6 +817,13 @@ var RecordHistoryList = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "aitable", + Name: "shortcut_record_history_list", + CanonicalPath: "aitable.shortcut_record_history_list", + CLIPath: "aitable +record-history-list", + PrimaryCLIPath: "aitable +record-history-list", + }, Description: "按 recordId 查询单条记录的变更历史", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -818,6 +874,13 @@ var RecordShareURL = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "aitable", + Name: "shortcut_record_share_url", + CanonicalPath: "aitable.shortcut_record_share_url", + CLIPath: "aitable +record-share-url", + PrimaryCLIPath: "aitable +record-share-url", + }, Description: "按 recordId 批量获取记录分享链接,单次最多 20 条", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -943,6 +1006,13 @@ var TemplateSearch = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "aitable", + Name: "shortcut_template_search", + CanonicalPath: "aitable.shortcut_template_search", + CLIPath: "aitable +template-search", + PrimaryCLIPath: "aitable +template-search", + }, Description: "按名称关键词搜索 AI 表格模板", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -1090,6 +1160,13 @@ var ViewGet = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "aitable", + Name: "shortcut_view_get", + CanonicalPath: "aitable.shortcut_view_get", + CLIPath: "aitable +view-get", + PrimaryCLIPath: "aitable +view-get", + }, Description: "获取视图完整信息(列顺序、筛选、排序、分组等)", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -1301,6 +1378,13 @@ var ViewGetLock = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "aitable", + Name: "shortcut_view_get_lock", + CanonicalPath: "aitable.shortcut_view_get_lock", + CLIPath: "aitable +view-get-lock", + PrimaryCLIPath: "aitable +view-get-lock", + }, Description: "获取视图锁定状态", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -1371,6 +1455,13 @@ var ViewGetFrozenCols = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "aitable", + Name: "shortcut_view_get_frozen_cols", + CanonicalPath: "aitable.shortcut_view_get_frozen_cols", + CLIPath: "aitable +view-get-frozen-cols", + PrimaryCLIPath: "aitable +view-get-frozen-cols", + }, Description: "获取视图当前冻结的左侧列数", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -1437,6 +1528,13 @@ var ViewGetRowHeight = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "aitable", + Name: "shortcut_view_get_row_height", + CanonicalPath: "aitable.shortcut_view_get_row_height", + CLIPath: "aitable +view-get-row-height", + PrimaryCLIPath: "aitable +view-get-row-height", + }, Description: "获取视图单元格行高(像素)", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -1537,6 +1635,13 @@ var FormList = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "aitable", + Name: "shortcut_form_list", + CanonicalPath: "aitable.shortcut_form_list", + CLIPath: "aitable +form-list", + PrimaryCLIPath: "aitable +form-list", + }, Description: "列出指定数据表下的所有表单视图", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -1701,6 +1806,13 @@ var FormFieldList = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "aitable", + Name: "shortcut_form_field_list", + CanonicalPath: "aitable.shortcut_form_field_list", + CLIPath: "aitable +form-field-list", + PrimaryCLIPath: "aitable +form-field-list", + }, Description: "列出表单视图当前可见的字段及其配置", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -1803,6 +1915,13 @@ var FormShareGet = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "aitable", + Name: "shortcut_form_share_get", + CanonicalPath: "aitable.shortcut_form_share_get", + CLIPath: "aitable +form-share-get", + PrimaryCLIPath: "aitable +form-share-get", + }, Description: "读取视图当前的分享表单配置", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -2038,6 +2157,13 @@ var DashboardConfigExample = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "aitable", + Name: "shortcut_dashboard_config_example", + CanonicalPath: "aitable.shortcut_dashboard_config_example", + CLIPath: "aitable +dashboard-config-example", + PrimaryCLIPath: "aitable +dashboard-config-example", + }, Description: "获取 dashboard config 的结构示例", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -2070,6 +2196,13 @@ var DashboardGet = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "aitable", + Name: "shortcut_dashboard_get", + CanonicalPath: "aitable.shortcut_dashboard_get", + CLIPath: "aitable +dashboard-get", + PrimaryCLIPath: "aitable +dashboard-get", + }, Description: "获取指定 dashboard 的详细信息(含 charts summary)", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -2252,6 +2385,13 @@ var ChartWidgetsExample = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "aitable", + Name: "shortcut_chart_widgets_example", + CanonicalPath: "aitable.shortcut_chart_widgets_example", + CLIPath: "aitable +chart-widgets-example", + PrimaryCLIPath: "aitable +chart-widgets-example", + }, Description: "获取所有图表类型的 widget config 示例", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -2284,6 +2424,13 @@ var ChartGet = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "aitable", + Name: "shortcut_chart_get", + CanonicalPath: "aitable.shortcut_chart_get", + CLIPath: "aitable +chart-get", + PrimaryCLIPath: "aitable +chart-get", + }, Description: "获取指定 chart 的详细信息", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -2619,6 +2766,13 @@ var RoleList = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "aitable", + Name: "shortcut_role_list", + CanonicalPath: "aitable.shortcut_role_list", + CLIPath: "aitable +role-list", + PrimaryCLIPath: "aitable +role-list", + }, Description: "列出指定 Base 下的全部角色", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -2877,6 +3031,13 @@ var SectionListEmpty = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "aitable", + Name: "shortcut_section_list_empty", + CanonicalPath: "aitable.shortcut_section_list_empty", + CLIPath: "aitable +section-list-empty", + PrimaryCLIPath: "aitable +section-list-empty", + }, Description: "列出指定 Base 下所有没有子节点的空文件夹", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -2912,6 +3073,13 @@ var SectionListNodes = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "aitable", + Name: "shortcut_section_list_nodes", + CanonicalPath: "aitable.shortcut_section_list_nodes", + CLIPath: "aitable +section-list-nodes", + PrimaryCLIPath: "aitable +section-list-nodes", + }, Description: "列出指定 Base 当前版本下的全部 nsheet 节点", Interface: &contract.InterfaceSpec{ Mode: "composite", diff --git a/internal/shortcut/attendance/attendance.go b/internal/shortcut/attendance/attendance.go index a85c208a..067f922c 100644 --- a/internal/shortcut/attendance/attendance.go +++ b/internal/shortcut/attendance/attendance.go @@ -176,6 +176,13 @@ var CheckResult = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "attendance", + Name: "shortcut_check_result", + CanonicalPath: "attendance.shortcut_check_result", + CLIPath: "attendance +check-result", + PrimaryCLIPath: "attendance +check-result", + }, Description: "查询用户打卡结果(迟到/早退/缺卡等)", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -231,6 +238,13 @@ var CheckRecord = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "attendance", + Name: "shortcut_check_record", + CanonicalPath: "attendance.shortcut_check_record", + CLIPath: "attendance +check-record", + PrimaryCLIPath: "attendance +check-record", + }, Description: "查询用户打卡流水(打卡时间/地点/定位方式)", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -284,6 +298,13 @@ var ListApprove = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "attendance", + Name: "shortcut_list_approve", + CanonicalPath: "attendance.shortcut_list_approve", + CLIPath: "attendance +list-approve", + PrimaryCLIPath: "attendance +list-approve", + }, Description: "查询用户考勤审批单(补卡/加班/请假/出差外出)", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -349,6 +370,13 @@ var GetApproveTemplate = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "attendance", + Name: "shortcut_get_approve_template", + CanonicalPath: "attendance.shortcut_get_approve_template", + CLIPath: "attendance +get-approve-template", + PrimaryCLIPath: "attendance +get-approve-template", + }, Description: "查询补卡/请假/加班/外出/出差审批提交链接", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -401,6 +429,13 @@ var GetSchedule = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "attendance", + Name: "shortcut_get_schedule", + CanonicalPath: "attendance.shortcut_get_schedule", + CLIPath: "attendance +get-schedule", + PrimaryCLIPath: "attendance +get-schedule", + }, Description: "获取指定用户一段时间内的排班记录", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -502,6 +537,13 @@ var SearchClass = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "attendance", + Name: "shortcut_search_class", + CanonicalPath: "attendance.shortcut_search_class", + CLIPath: "attendance +search-class", + PrimaryCLIPath: "attendance +search-class", + }, Description: "查询当前用户可管理的班次详情列表", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -733,6 +775,13 @@ var GetAdjustmentRule = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "attendance", + Name: "shortcut_get_adjustment_rule", + CanonicalPath: "attendance.shortcut_get_adjustment_rule", + CLIPath: "attendance +get-adjustment-rule", + PrimaryCLIPath: "attendance +get-adjustment-rule", + }, Description: "根据补卡规则主键 ID 查询补卡规则详情", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -770,6 +819,13 @@ var SearchAdjustmentRule = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "attendance", + Name: "shortcut_search_adjustment_rule", + CanonicalPath: "attendance.shortcut_search_adjustment_rule", + CLIPath: "attendance +search-adjustment-rule", + PrimaryCLIPath: "attendance +search-adjustment-rule", + }, Description: "查询当前用户可管理的补卡规则列表", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -865,6 +921,13 @@ var GetOvertimeRule = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "attendance", + Name: "shortcut_get_overtime_rule", + CanonicalPath: "attendance.shortcut_get_overtime_rule", + CLIPath: "attendance +get-overtime-rule", + PrimaryCLIPath: "attendance +get-overtime-rule", + }, Description: "根据加班规则主键 ID 查询加班规则详情", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -902,6 +965,13 @@ var SearchOvertimeRule = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "attendance", + Name: "shortcut_search_overtime_rule", + CanonicalPath: "attendance.shortcut_search_overtime_rule", + CLIPath: "attendance +search-overtime-rule", + PrimaryCLIPath: "attendance +search-overtime-rule", + }, Description: "查询当前用户可管理的加班规则列表", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -962,6 +1032,13 @@ var SearchGroup = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "attendance", + Name: "shortcut_search_group", + CanonicalPath: "attendance.shortcut_search_group", + CLIPath: "attendance +search-group", + PrimaryCLIPath: "attendance +search-group", + }, Description: "查询当前用户可管理的考勤组列表", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -1271,6 +1348,13 @@ var GetSummary = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "attendance", + Name: "shortcut_get_summary", + CanonicalPath: "attendance.shortcut_get_summary", + CLIPath: "attendance +get-summary", + PrimaryCLIPath: "attendance +get-summary", + }, Description: "查询某个人的考勤统计摘要(周/月)", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -1321,6 +1405,13 @@ var GetSelfSetting = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "attendance", + Name: "shortcut_get_self_setting", + CanonicalPath: "attendance.shortcut_get_self_setting", + CLIPath: "attendance +get-self-setting", + PrimaryCLIPath: "attendance +get-self-setting", + }, Description: "查询个人规则设置(打卡提醒/极速打卡/缺卡提醒等)", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -1402,6 +1493,13 @@ var QueryReportData = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "attendance", + Name: "shortcut_query_report_data", + CanonicalPath: "attendance.shortcut_query_report_data", + CLIPath: "attendance +query-report-data", + PrimaryCLIPath: "attendance +query-report-data", + }, Description: "根据字段查询考勤报表数据(仅管理员)", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -1504,6 +1602,13 @@ var ListLeaveTypes = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "attendance", + Name: "shortcut_list_leave_types", + CanonicalPath: "attendance.shortcut_list_leave_types", + CLIPath: "attendance +list-leave-types", + PrimaryCLIPath: "attendance +list-leave-types", + }, Description: "查询当前用户可用的假期规则列表", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -1564,6 +1669,13 @@ var GetLeaveRecords = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "attendance", + Name: "shortcut_get_leave_records", + CanonicalPath: "attendance.shortcut_get_leave_records", + CLIPath: "attendance +get-leave-records", + PrimaryCLIPath: "attendance +get-leave-records", + }, Description: "查询指定员工的假期余额变更记录", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -1740,6 +1852,13 @@ var GetCheckinRecord = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "attendance", + Name: "shortcut_get_checkin_record", + CanonicalPath: "attendance.shortcut_get_checkin_record", + CLIPath: "attendance +get-checkin-record", + PrimaryCLIPath: "attendance +get-checkin-record", + }, Description: "查询指定员工一段时间内的签到记录", Interface: &contract.InterfaceSpec{ Mode: "composite", diff --git a/internal/shortcut/calendar/calendar.go b/internal/shortcut/calendar/calendar.go index 1944df3b..21ba0220 100644 --- a/internal/shortcut/calendar/calendar.go +++ b/internal/shortcut/calendar/calendar.go @@ -54,6 +54,13 @@ var EventList = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "calendar", + Name: "shortcut_agenda", + CanonicalPath: "calendar.shortcut_agenda", + CLIPath: "calendar +agenda", + PrimaryCLIPath: "calendar +agenda", + }, Description: "查询日程列表(不传时间默认查询今天)", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -216,6 +223,13 @@ var AttendeeList = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "calendar", + Name: "shortcut_attendee_list", + CanonicalPath: "calendar.shortcut_attendee_list", + CLIPath: "calendar +attendee-list", + PrimaryCLIPath: "calendar +attendee-list", + }, Description: "查看日程参会人", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -331,6 +345,13 @@ var RoomSearch = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "calendar", + Name: "shortcut_room_search", + CanonicalPath: "calendar.shortcut_room_search", + CLIPath: "calendar +room-search", + PrimaryCLIPath: "calendar +room-search", + }, Description: "按名称模糊搜索会议室(不检查可用性)", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -504,6 +525,13 @@ var RoomGroups = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "calendar", + Name: "shortcut_room_groups", + CanonicalPath: "calendar.shortcut_room_groups", + CLIPath: "calendar +room-groups", + PrimaryCLIPath: "calendar +room-groups", + }, Description: "会议室分组列表", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -620,6 +648,13 @@ var BusySearch = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "calendar", + Name: "shortcut_freebusy", + CanonicalPath: "calendar.shortcut_freebusy", + CLIPath: "calendar +freebusy", + PrimaryCLIPath: "calendar +freebusy", + }, Description: "查询用户 / 会议室闲忙状态(--users 与 --rooms 至少其一)", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -691,6 +726,13 @@ var BookList = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "calendar", + Name: "shortcut_book_list", + CanonicalPath: "calendar.shortcut_book_list", + CLIPath: "calendar +book-list", + PrimaryCLIPath: "calendar +book-list", + }, Description: "查询用户的日历本列表", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -755,6 +797,13 @@ var BookSearch = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "calendar", + Name: "shortcut_book_search", + CanonicalPath: "calendar.shortcut_book_search", + CLIPath: "calendar +book-search", + PrimaryCLIPath: "calendar +book-search", + }, Description: "按名称模糊搜索日历本", Interface: &contract.InterfaceSpec{ Mode: "composite", diff --git a/internal/shortcut/chat/chat_bot.go b/internal/shortcut/chat/chat_bot.go index b8f04004..68d1d150 100644 --- a/internal/shortcut/chat/chat_bot.go +++ b/internal/shortcut/chat/chat_bot.go @@ -32,6 +32,13 @@ var BotSearch = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "chat", + Name: "shortcut_bot_search", + CanonicalPath: "chat.shortcut_bot_search", + CLIPath: "chat +bot-search", + PrimaryCLIPath: "chat +bot-search", + }, Description: "搜索当前用户自己创建的机器人", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -144,6 +151,13 @@ var BotFind = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "chat", + Name: "shortcut_bot_find", + CanonicalPath: "chat.shortcut_bot_find", + CLIPath: "chat +bot-find", + PrimaryCLIPath: "chat +bot-find", + }, Description: "搜索全部可用机器人(含他人/官方,返回 openDingTalkId 可发单聊)", Interface: &contract.InterfaceSpec{ Mode: "composite", diff --git a/internal/shortcut/chat/chat_conversation.go b/internal/shortcut/chat/chat_conversation.go index ed63588b..fd0ca9b7 100644 --- a/internal/shortcut/chat/chat_conversation.go +++ b/internal/shortcut/chat/chat_conversation.go @@ -39,6 +39,13 @@ var ConversationInfo = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "chat", + Name: "shortcut_conversation_info", + CanonicalPath: "chat.shortcut_conversation_info", + CLIPath: "chat +conversation-info", + PrimaryCLIPath: "chat +conversation-info", + }, Description: "获取会话信息(群聊传 --group,单聊传 --open-dingtalk-id)", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -246,6 +253,13 @@ var ConversationClearAllRedPoint = shortcut.Shortcut{ Confirmation: "user_required", Idempotency: "unknown", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "chat", + Name: "shortcut_conversation_clear_all_red_point", + CanonicalPath: "chat.shortcut_conversation_clear_all_red_point", + CLIPath: "chat +conversation-clear-all-red-point", + PrimaryCLIPath: "chat +conversation-clear-all-red-point", + }, Description: "清除所有会话红点(全部已读)", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -278,6 +292,13 @@ var ConversationList = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "chat", + Name: "shortcut_conversation_list", + CanonicalPath: "chat.shortcut_conversation_list", + CLIPath: "chat +conversation-list", + PrimaryCLIPath: "chat +conversation-list", + }, Description: "分页获取当前用户的全部会话列表(单聊+群聊)", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -393,6 +414,13 @@ var ConversationListTop = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "chat", + Name: "shortcut_conversation_list_top", + CanonicalPath: "chat.shortcut_conversation_list_top", + CLIPath: "chat +conversation-list-top", + PrimaryCLIPath: "chat +conversation-list-top", + }, Description: "拉取置顶会话列表,可只看群聊或单聊", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -647,6 +675,13 @@ var CategoryList = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "chat", + Name: "shortcut_category_list", + CanonicalPath: "chat.shortcut_category_list", + CLIPath: "chat +category-list", + PrimaryCLIPath: "chat +category-list", + }, Description: "获取用户自定义会话分组", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -849,6 +884,13 @@ var CategoryCreate = shortcut.Shortcut{ Confirmation: "user_required", Idempotency: "unknown", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "chat", + Name: "shortcut_category_create", + CanonicalPath: "chat.shortcut_category_create", + CLIPath: "chat +category-create", + PrimaryCLIPath: "chat +category-create", + }, Description: "创建用户自定义会话分组", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -894,6 +936,13 @@ var CategoryDelete = shortcut.Shortcut{ Confirmation: "user_required", Idempotency: "unknown", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "chat", + Name: "shortcut_category_delete", + CanonicalPath: "chat.shortcut_category_delete", + CLIPath: "chat +category-delete", + PrimaryCLIPath: "chat +category-delete", + }, Description: "删除用户自定义会话分组", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -929,6 +978,13 @@ var CategoryRename = shortcut.Shortcut{ Confirmation: "user_required", Idempotency: "unknown", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "chat", + Name: "shortcut_category_rename", + CanonicalPath: "chat.shortcut_category_rename", + CLIPath: "chat +category-rename", + PrimaryCLIPath: "chat +category-rename", + }, Description: "更新用户自定义会话分组的名称", Interface: &contract.InterfaceSpec{ Mode: "composite", diff --git a/internal/shortcut/chat/chat_group.go b/internal/shortcut/chat/chat_group.go index a189b803..3f6fdb6a 100644 --- a/internal/shortcut/chat/chat_group.go +++ b/internal/shortcut/chat/chat_group.go @@ -38,6 +38,13 @@ var ChatSearch = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "chat", + Name: "shortcut_chat_search", + CanonicalPath: "chat.shortcut_chat_search", + CLIPath: "chat +chat-search", + PrimaryCLIPath: "chat +chat-search", + }, Description: "按关键词搜索群聊", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -147,6 +154,13 @@ var ChatInviteURL = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "chat", + Name: "shortcut_chat_invite_url", + CanonicalPath: "chat.shortcut_chat_invite_url", + CLIPath: "chat +chat-invite-url", + PrimaryCLIPath: "chat +chat-invite-url", + }, Description: "获取群邀请链接", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -251,6 +265,13 @@ var ChatDismiss = shortcut.Shortcut{ Confirmation: "user_required", Idempotency: "unknown", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "chat", + Name: "shortcut_chat_dismiss", + CanonicalPath: "chat.shortcut_chat_dismiss", + CLIPath: "chat +chat-dismiss", + PrimaryCLIPath: "chat +chat-dismiss", + }, Description: "解散群聊(不可逆,需群主权限)", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -286,6 +307,13 @@ var ChatSetHistory = shortcut.Shortcut{ Confirmation: "user_required", Idempotency: "unknown", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "chat", + Name: "shortcut_chat_set_history", + CanonicalPath: "chat.shortcut_chat_set_history", + CLIPath: "chat +chat-set-history", + PrimaryCLIPath: "chat +chat-set-history", + }, Description: "设置新成员入群可查看历史消息范围", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -325,6 +353,13 @@ var ChatUpdateNick = shortcut.Shortcut{ Confirmation: "user_required", Idempotency: "unknown", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "chat", + Name: "shortcut_chat_update_nick", + CanonicalPath: "chat.shortcut_chat_update_nick", + CLIPath: "chat +chat-update-nick", + PrimaryCLIPath: "chat +chat-update-nick", + }, Description: "设置当前用户在群内的群昵称", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -364,6 +399,13 @@ var ChatUpdateAlias = shortcut.Shortcut{ Confirmation: "user_required", Idempotency: "unknown", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "chat", + Name: "shortcut_chat_update_alias", + CanonicalPath: "chat.shortcut_chat_update_alias", + CLIPath: "chat +chat-update-alias", + PrimaryCLIPath: "chat +chat-update-alias", + }, Description: "设置群备注(仅自己可见)", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -403,6 +445,13 @@ var ChatListMine = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "chat", + Name: "shortcut_chat_list_mine", + CanonicalPath: "chat.shortcut_chat_list_mine", + CLIPath: "chat +chat-list-mine", + PrimaryCLIPath: "chat +chat-list-mine", + }, Description: "拉取我创建/管理的群", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -490,6 +539,13 @@ var ChatListAll = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "chat", + Name: "shortcut_chat_list_all", + CanonicalPath: "chat.shortcut_chat_list_all", + CLIPath: "chat +chat-list-all", + PrimaryCLIPath: "chat +chat-list-all", + }, Description: "分页拉取我加入的所有群列表", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -608,6 +664,13 @@ var ChatListJoinRequests = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "chat", + Name: "shortcut_chat_list_join_requests", + CanonicalPath: "chat.shortcut_chat_list_join_requests", + CLIPath: "chat +chat-list-join-requests", + PrimaryCLIPath: "chat +chat-list-join-requests", + }, Description: "分页拉取入群验证记录", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -721,6 +784,13 @@ var ChatBots = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "chat", + Name: "shortcut_chat_bots", + CanonicalPath: "chat.shortcut_chat_bots", + CLIPath: "chat +chat-bots", + PrimaryCLIPath: "chat +chat-bots", + }, Description: "查看群内所有机器人", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -808,6 +878,13 @@ var ChatSetAdmin = shortcut.Shortcut{ Confirmation: "user_required", Idempotency: "unknown", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "chat", + Name: "shortcut_chat_set_admin", + CanonicalPath: "chat.shortcut_chat_set_admin", + CLIPath: "chat +chat-set-admin", + PrimaryCLIPath: "chat +chat-set-admin", + }, Description: "设置 / 取消群管理员", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -856,6 +933,13 @@ var ChatMute = shortcut.Shortcut{ Confirmation: "user_required", Idempotency: "unknown", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "chat", + Name: "shortcut_chat_mute", + CanonicalPath: "chat.shortcut_chat_mute", + CLIPath: "chat +chat-mute", + PrimaryCLIPath: "chat +chat-mute", + }, Description: "全员禁言 / 取消全员禁言", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -1067,6 +1151,13 @@ var ChatRoleList = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "chat", + Name: "shortcut_chat_role_list", + CanonicalPath: "chat.shortcut_chat_role_list", + CLIPath: "chat +chat-role-list", + PrimaryCLIPath: "chat +chat-role-list", + }, Description: "拉取会话的群身份列表", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -1134,6 +1225,13 @@ var ChatRoleAdd = shortcut.Shortcut{ Confirmation: "user_required", Idempotency: "unknown", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "chat", + Name: "shortcut_chat_role_add", + CanonicalPath: "chat.shortcut_chat_role_add", + CLIPath: "chat +chat-role-add", + PrimaryCLIPath: "chat +chat-role-add", + }, Description: "添加群身份", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -1173,6 +1271,13 @@ var ChatRoleUpdate = shortcut.Shortcut{ Confirmation: "user_required", Idempotency: "unknown", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "chat", + Name: "shortcut_chat_role_update", + CanonicalPath: "chat.shortcut_chat_role_update", + CLIPath: "chat +chat-role-update", + PrimaryCLIPath: "chat +chat-role-update", + }, Description: "更新群身份名称", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -1235,6 +1340,13 @@ var ChatRoleSetUser = shortcut.Shortcut{ Confirmation: "user_required", Idempotency: "unknown", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "chat", + Name: "shortcut_chat_role_set_user", + CanonicalPath: "chat.shortcut_chat_role_set_user", + CLIPath: "chat +chat-role-set-user", + PrimaryCLIPath: "chat +chat-role-set-user", + }, Description: "设置用户的群身份(覆盖该用户的全部群身份)", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -1311,6 +1423,13 @@ var ChatRoleQueryUser = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "chat", + Name: "shortcut_chat_role_query_user", + CanonicalPath: "chat.shortcut_chat_role_query_user", + CLIPath: "chat +chat-role-query-user", + PrimaryCLIPath: "chat +chat-role-query-user", + }, Description: "查询群成员的群身份", Interface: &contract.InterfaceSpec{ Mode: "composite", diff --git a/internal/shortcut/chat/chat_message.go b/internal/shortcut/chat/chat_message.go index a12e9e6e..5a578901 100644 --- a/internal/shortcut/chat/chat_message.go +++ b/internal/shortcut/chat/chat_message.go @@ -118,6 +118,13 @@ var MessagesSendByWebhook = shortcut.Shortcut{ Confirmation: "user_required", Idempotency: "unknown", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "chat", + Name: "shortcut_messages_send_by_webhook", + CanonicalPath: "chat.shortcut_messages_send_by_webhook", + CLIPath: "chat +messages-send-by-webhook", + PrimaryCLIPath: "chat +messages-send-by-webhook", + }, Description: "自定义机器人 Webhook 发送群消息", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -407,6 +414,13 @@ var MessagesListDirect = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "chat", + Name: "shortcut_messages_list_direct", + CanonicalPath: "chat.shortcut_messages_list_direct", + CLIPath: "chat +messages-list-direct", + PrimaryCLIPath: "chat +messages-list-direct", + }, Description: "拉取单聊会话消息", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -477,6 +491,13 @@ var MessagesListUnreadConversations = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "chat", + Name: "shortcut_messages_list_unread_conversations", + CanonicalPath: "chat.shortcut_messages_list_unread_conversations", + CLIPath: "chat +messages-list-unread-conversations", + PrimaryCLIPath: "chat +messages-list-unread-conversations", + }, Description: "获取有未读消息的会话列表", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -590,6 +611,13 @@ var MessagesMget = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "chat", + Name: "shortcut_messages_mget", + CanonicalPath: "chat.shortcut_messages_mget", + CLIPath: "chat +messages-mget", + PrimaryCLIPath: "chat +messages-mget", + }, Description: "根据消息 ID 批量查询消息(最多 50 条)", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -912,6 +940,13 @@ var MessagesQuerySendStatus = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "chat", + Name: "shortcut_messages_query_send_status", + CanonicalPath: "chat.shortcut_messages_query_send_status", + CLIPath: "chat +messages-query-send-status", + PrimaryCLIPath: "chat +messages-query-send-status", + }, Description: "查询消息发送状态", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -947,6 +982,13 @@ var MessagesReadStatus = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "chat", + Name: "shortcut_messages_read_status", + CanonicalPath: "chat.shortcut_messages_read_status", + CLIPath: "chat +messages-read-status", + PrimaryCLIPath: "chat +messages-read-status", + }, Description: "查询消息的已读/未读状态", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -1133,6 +1175,13 @@ var MessagesSendCard = shortcut.Shortcut{ Confirmation: "user_required", Idempotency: "unknown", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "chat", + Name: "shortcut_messages_send_card", + CanonicalPath: "chat.shortcut_messages_send_card", + CLIPath: "chat +messages-send-card", + PrimaryCLIPath: "chat +messages-send-card", + }, Description: "创建流式卡片,可在同一次调用中写入内容并结束", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -1320,6 +1369,13 @@ var MessagesUpdateCard = shortcut.Shortcut{ Confirmation: "user_required", Idempotency: "unknown", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "chat", + Name: "shortcut_messages_update_card", + CanonicalPath: "chat.shortcut_messages_update_card", + CLIPath: "chat +messages-update-card", + PrimaryCLIPath: "chat +messages-update-card", + }, Description: "流式更新卡片内容(最后一次 --flow-status 应为 3)", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -1520,6 +1576,13 @@ var MessagesListPin = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "chat", + Name: "shortcut_messages_list_pin", + CanonicalPath: "chat.shortcut_messages_list_pin", + CLIPath: "chat +messages-list-pin", + PrimaryCLIPath: "chat +messages-list-pin", + }, Description: "拉取会话中钉住的消息列表", Interface: &contract.InterfaceSpec{ Mode: "composite", diff --git a/internal/shortcut/chat/unified_send.go b/internal/shortcut/chat/unified_send.go index a29daf09..a29987eb 100644 --- a/internal/shortcut/chat/unified_send.go +++ b/internal/shortcut/chat/unified_send.go @@ -38,6 +38,13 @@ var MessagesSend = shortcut.Shortcut{ Confirmation: "user_required", Idempotency: "unknown", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "chat", + Name: "shortcut_messages_send", + CanonicalPath: "chat.shortcut_messages_send", + CLIPath: "chat +messages-send", + PrimaryCLIPath: "chat +messages-send", + }, Description: "统一发送文本、Markdown、当前用户文件或已有 mediaId 图片", Interface: &contract.InterfaceSpec{ Mode: "composite", diff --git a/internal/shortcut/contact/contact.go b/internal/shortcut/contact/contact.go index f6aca587..df7ad96e 100644 --- a/internal/shortcut/contact/contact.go +++ b/internal/shortcut/contact/contact.go @@ -37,6 +37,13 @@ var ListFollowings = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "contact", + Name: "shortcut_list_followings", + CanonicalPath: "contact.shortcut_list_followings", + CLIPath: "contact +list-followings", + PrimaryCLIPath: "contact +list-followings", + }, Description: "获取当前用户的特别关注列表", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -112,6 +119,13 @@ var SearchUser = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "contact", + Name: "shortcut_search_user", + CanonicalPath: "contact.shortcut_search_user", + CLIPath: "contact +search-user", + PrimaryCLIPath: "contact +search-user", + }, Description: "按关键词搜索通讯录用户", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -184,6 +198,13 @@ var SearchMobile = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "contact", + Name: "shortcut_search_mobile", + CanonicalPath: "contact.shortcut_search_mobile", + CLIPath: "contact +search-mobile", + PrimaryCLIPath: "contact +search-mobile", + }, Description: "按手机号搜索通讯录用户", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -229,6 +250,13 @@ var ListRoles = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "contact", + Name: "shortcut_list_roles", + CanonicalPath: "contact.shortcut_list_roles", + CLIPath: "contact +list-roles", + PrimaryCLIPath: "contact +list-roles", + }, Description: "获取企业所有角色(标签)列表", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -364,6 +392,13 @@ var ListRoleMembers = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "contact", + Name: "shortcut_list_role_members", + CanonicalPath: "contact.shortcut_list_role_members", + CLIPath: "contact +list-role-members", + PrimaryCLIPath: "contact +list-role-members", + }, Description: "查询角色下的成员列表", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -481,6 +516,13 @@ var ListSubDepts = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "contact", + Name: "shortcut_list_sub_depts", + CanonicalPath: "contact.shortcut_list_sub_depts", + CLIPath: "contact +list-sub-depts", + PrimaryCLIPath: "contact +list-sub-depts", + }, Description: "查看指定部门的子部门", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -589,6 +631,13 @@ var ListDeptMembers = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "contact", + Name: "shortcut_list_dept_members", + CanonicalPath: "contact.shortcut_list_dept_members", + CLIPath: "contact +list-dept-members", + PrimaryCLIPath: "contact +list-dept-members", + }, Description: "查看部门成员(仅本部门,不含下级)", Interface: &contract.InterfaceSpec{ Mode: "composite", diff --git a/internal/shortcut/devapp/devapp.go b/internal/shortcut/devapp/devapp.go index a013d81d..cee5ed31 100644 --- a/internal/shortcut/devapp/devapp.go +++ b/internal/shortcut/devapp/devapp.go @@ -72,6 +72,13 @@ var ListApp = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "devapp", + Name: "shortcut_list", + CanonicalPath: "devapp.shortcut_list", + CLIPath: "devapp +list", + PrimaryCLIPath: "devapp +list", + }, Description: "查询开放平台企业内部应用列表", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -222,6 +229,13 @@ var GetApp = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "devapp", + Name: "shortcut_get", + CanonicalPath: "devapp.shortcut_get", + CLIPath: "devapp +get", + PrimaryCLIPath: "devapp +get", + }, Description: "查询开放平台企业内部应用详情", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -256,6 +270,13 @@ var CreateApp = shortcut.Shortcut{ Confirmation: "user_required", Idempotency: "unknown", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "devapp", + Name: "shortcut_create", + CanonicalPath: "devapp.shortcut_create", + CLIPath: "devapp +create", + PrimaryCLIPath: "devapp +create", + }, Description: "创建开放平台企业内部应用", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -299,6 +320,13 @@ var UpdateApp = shortcut.Shortcut{ Confirmation: "user_required", Idempotency: "unknown", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "devapp", + Name: "shortcut_update", + CanonicalPath: "devapp.shortcut_update", + CLIPath: "devapp +update", + PrimaryCLIPath: "devapp +update", + }, Description: "修改开放平台企业内部应用基础信息", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -346,6 +374,13 @@ var DeleteApp = shortcut.Shortcut{ Confirmation: "user_required", Idempotency: "unknown", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "devapp", + Name: "shortcut_delete", + CanonicalPath: "devapp.shortcut_delete", + CLIPath: "devapp +delete", + PrimaryCLIPath: "devapp +delete", + }, Description: "删除开放平台企业内部应用(不可逆)", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -380,6 +415,13 @@ var EnableApp = shortcut.Shortcut{ Confirmation: "user_required", Idempotency: "unknown", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "devapp", + Name: "shortcut_enable", + CanonicalPath: "devapp.shortcut_enable", + CLIPath: "devapp +enable", + PrimaryCLIPath: "devapp +enable", + }, Description: "启用开放平台企业内部应用", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -414,6 +456,13 @@ var DisableApp = shortcut.Shortcut{ Confirmation: "user_required", Idempotency: "unknown", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "devapp", + Name: "shortcut_disable", + CanonicalPath: "devapp.shortcut_disable", + CLIPath: "devapp +disable", + PrimaryCLIPath: "devapp +disable", + }, Description: "停用开放平台企业内部应用", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -468,6 +517,13 @@ var WebappGet = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "devapp", + Name: "shortcut_webapp_get", + CanonicalPath: "devapp.shortcut_webapp_get", + CLIPath: "devapp +webapp-get", + PrimaryCLIPath: "devapp +webapp-get", + }, Description: "查询网页应用配置", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -502,6 +558,13 @@ var WebappConfig = shortcut.Shortcut{ Confirmation: "user_required", Idempotency: "unknown", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "devapp", + Name: "shortcut_webapp_config", + CanonicalPath: "devapp.shortcut_webapp_config", + CLIPath: "devapp +webapp-config", + PrimaryCLIPath: "devapp +webapp-config", + }, Description: "配置网页应用能力", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -557,6 +620,13 @@ var PermissionList = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "devapp", + Name: "shortcut_permission_list", + CanonicalPath: "devapp.shortcut_permission_list", + CLIPath: "devapp +permission-list", + PrimaryCLIPath: "devapp +permission-list", + }, Description: "查询开放平台应用权限列表", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -735,6 +805,13 @@ var MemberList = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "devapp", + Name: "shortcut_member_list", + CanonicalPath: "devapp.shortcut_member_list", + CLIPath: "devapp +member-list", + PrimaryCLIPath: "devapp +member-list", + }, Description: "查询开放平台应用成员", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -769,6 +846,13 @@ var MemberAdd = shortcut.Shortcut{ Confirmation: "user_required", Idempotency: "unknown", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "devapp", + Name: "shortcut_member_add", + CanonicalPath: "devapp.shortcut_member_add", + CLIPath: "devapp +member-add", + PrimaryCLIPath: "devapp +member-add", + }, Description: "添加开放平台应用成员", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -810,6 +894,13 @@ var MemberRemove = shortcut.Shortcut{ Confirmation: "user_required", Idempotency: "unknown", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "devapp", + Name: "shortcut_member_remove", + CanonicalPath: "devapp.shortcut_member_remove", + CLIPath: "devapp +member-remove", + PrimaryCLIPath: "devapp +member-remove", + }, Description: "移除开放平台应用成员", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -888,6 +979,13 @@ var RobotGet = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "devapp", + Name: "shortcut_robot_get", + CanonicalPath: "devapp.shortcut_robot_get", + CLIPath: "devapp +robot-get", + PrimaryCLIPath: "devapp +robot-get", + }, Description: "查询现有应用的机器人配置", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -1016,6 +1114,13 @@ var EventList = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "devapp", + Name: "shortcut_event_list", + CanonicalPath: "devapp.shortcut_event_list", + CLIPath: "devapp +event-list", + PrimaryCLIPath: "devapp +event-list", + }, Description: "查询应用已订阅的事件列表", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -1200,6 +1305,13 @@ var VersionList = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "devapp", + Name: "shortcut_version_list", + CanonicalPath: "devapp.shortcut_version_list", + CLIPath: "devapp +version-list", + PrimaryCLIPath: "devapp +version-list", + }, Description: "分页查询应用版本列表", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -1312,6 +1424,13 @@ var VersionGet = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "devapp", + Name: "shortcut_version_get", + CanonicalPath: "devapp.shortcut_version_get", + CLIPath: "devapp +version-get", + PrimaryCLIPath: "devapp +version-get", + }, Description: "查询指定版本详情", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -1352,6 +1471,13 @@ var VersionCheckApproval = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "devapp", + Name: "shortcut_version_check_approval", + CanonicalPath: "devapp.shortcut_version_check_approval", + CLIPath: "devapp +version-check-approval", + PrimaryCLIPath: "devapp +version-check-approval", + }, Description: "预检版本发布是否需要审批(不实际发布)", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -1423,6 +1549,13 @@ var VersionStatus = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "devapp", + Name: "shortcut_version_status", + CanonicalPath: "devapp.shortcut_version_status", + CLIPath: "devapp +version-status", + PrimaryCLIPath: "devapp +version-status", + }, Description: "查询版本发布/审批状态", Interface: &contract.InterfaceSpec{ Mode: "composite", diff --git a/internal/shortcut/ding/ding.go b/internal/shortcut/ding/ding.go index 10cc217d..e5e3bb2b 100644 --- a/internal/shortcut/ding/ding.go +++ b/internal/shortcut/ding/ding.go @@ -30,6 +30,13 @@ var List = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "ding", + Name: "shortcut_list", + CanonicalPath: "ding.shortcut_list", + CLIPath: "ding +list", + PrimaryCLIPath: "ding +list", + }, Description: "查询 DING 消息列表", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -69,6 +76,13 @@ var ReceiverStatus = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "ding", + Name: "shortcut_receiver_status", + CanonicalPath: "ding.shortcut_receiver_status", + CLIPath: "ding +receiver-status", + PrimaryCLIPath: "ding +receiver-status", + }, Description: "查询 DING 消息接收人已读状态", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -100,6 +114,13 @@ var SendPersonal = shortcut.Shortcut{ Confirmation: "user_required", Idempotency: "unknown", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "ding", + Name: "shortcut_send_personal", + CanonicalPath: "ding.shortcut_send_personal", + CLIPath: "ding +send-personal", + PrimaryCLIPath: "ding +send-personal", + }, Description: "以本人身份发送 DING 给指定人", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -164,6 +185,13 @@ var RecallPersonal = shortcut.Shortcut{ Confirmation: "user_required", Idempotency: "unknown", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "ding", + Name: "shortcut_recall_personal", + CanonicalPath: "ding.shortcut_recall_personal", + CLIPath: "ding +recall-personal", + PrimaryCLIPath: "ding +recall-personal", + }, Description: "撤回本人发起的 DING", Interface: &contract.InterfaceSpec{ Mode: "composite", diff --git a/internal/shortcut/doc/doc.go b/internal/shortcut/doc/doc.go index ae326a3f..7feee9e8 100644 --- a/internal/shortcut/doc/doc.go +++ b/internal/shortcut/doc/doc.go @@ -41,6 +41,13 @@ var Search = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "doc", + Name: "shortcut_search", + CanonicalPath: "doc.shortcut_search", + CLIPath: "doc +search", + PrimaryCLIPath: "doc +search", + }, Description: "按关键词搜索有权限的文档 (不传则返回最近访问)", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -206,6 +213,13 @@ var List = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "doc", + Name: "shortcut_list", + CanonicalPath: "doc.shortcut_list", + CLIPath: "doc +list", + PrimaryCLIPath: "doc +list", + }, Description: "列出文件夹或知识库下的直接子节点", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -299,6 +313,13 @@ var Copy = shortcut.Shortcut{ Confirmation: "user_required", Idempotency: "unknown", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "doc", + Name: "shortcut_copy", + CanonicalPath: "doc.shortcut_copy", + CLIPath: "doc +copy", + PrimaryCLIPath: "doc +copy", + }, Description: "复制文档/文件到指定文件夹或知识库", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -342,6 +363,13 @@ var Move = shortcut.Shortcut{ Confirmation: "user_required", Idempotency: "unknown", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "doc", + Name: "shortcut_move", + CanonicalPath: "doc.shortcut_move", + CLIPath: "doc +move", + PrimaryCLIPath: "doc +move", + }, Description: "移动文档/文件到指定文件夹或知识库", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -393,6 +421,13 @@ var CommentList = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "doc", + Name: "shortcut_comment_list", + CanonicalPath: "doc.shortcut_comment_list", + CLIPath: "doc +comment-list", + PrimaryCLIPath: "doc +comment-list", + }, Description: "查询文档评论列表", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -447,6 +482,13 @@ var CommentCreate = shortcut.Shortcut{ Confirmation: "user_required", Idempotency: "unknown", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "doc", + Name: "shortcut_comment_create", + CanonicalPath: "doc.shortcut_comment_create", + CLIPath: "doc +comment-create", + PrimaryCLIPath: "doc +comment-create", + }, Description: "在文档上创建一条评论", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -490,6 +532,13 @@ var CommentReply = shortcut.Shortcut{ Confirmation: "user_required", Idempotency: "unknown", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "doc", + Name: "shortcut_comment_reply", + CanonicalPath: "doc.shortcut_comment_reply", + CLIPath: "doc +comment-reply", + PrimaryCLIPath: "doc +comment-reply", + }, Description: "回复文档中的一条评论", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -578,6 +627,13 @@ var ExportSubmit = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "doc", + Name: "shortcut_export_submit", + CanonicalPath: "doc.shortcut_export_submit", + CLIPath: "doc +export-submit", + PrimaryCLIPath: "doc +export-submit", + }, Description: "提交在线文档导出任务 (docx/markdown/pdf),返回 jobId", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -620,6 +676,13 @@ var ExportGet = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "doc", + Name: "shortcut_export_get", + CanonicalPath: "doc.shortcut_export_get", + CLIPath: "doc +export-get", + PrimaryCLIPath: "doc +export-get", + }, Description: "根据 jobId 查询文档导出任务结果", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -656,6 +719,13 @@ var VersionSave = shortcut.Shortcut{ Confirmation: "user_required", Idempotency: "unknown", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "doc", + Name: "shortcut_version_save", + CanonicalPath: "doc.shortcut_version_save", + CLIPath: "doc +version-save", + PrimaryCLIPath: "doc +version-save", + }, Description: "手动保存文档版本快照", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -690,6 +760,13 @@ var VersionList = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "doc", + Name: "shortcut_version_list", + CanonicalPath: "doc.shortcut_version_list", + CLIPath: "doc +version-list", + PrimaryCLIPath: "doc +version-list", + }, Description: "查看文档历史版本列表", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -733,6 +810,13 @@ var VersionRevert = shortcut.Shortcut{ Confirmation: "user_required", Idempotency: "unknown", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "doc", + Name: "shortcut_version_revert", + CanonicalPath: "doc.shortcut_version_revert", + CLIPath: "doc +version-revert", + PrimaryCLIPath: "doc +version-revert", + }, Description: "回滚文档到指定历史版本", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -773,6 +857,13 @@ var TemplateList = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "doc", + Name: "shortcut_template_list", + CanonicalPath: "doc.shortcut_template_list", + CLIPath: "doc +template-list", + PrimaryCLIPath: "doc +template-list", + }, Description: "获取文档模板列表", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -819,6 +910,13 @@ var TemplateSearch = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "doc", + Name: "shortcut_template_search", + CanonicalPath: "doc.shortcut_template_search", + CLIPath: "doc +template-search", + PrimaryCLIPath: "doc +template-search", + }, Description: "根据关键词搜索文档模板", Interface: &contract.InterfaceSpec{ Mode: "composite", diff --git a/internal/shortcut/drive/drive.go b/internal/shortcut/drive/drive.go index 290a62d2..c259d60e 100644 --- a/internal/shortcut/drive/drive.go +++ b/internal/shortcut/drive/drive.go @@ -147,6 +147,13 @@ var Info = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "drive", + Name: "shortcut_info", + CanonicalPath: "drive.shortcut_info", + CLIPath: "drive +info", + PrimaryCLIPath: "drive +info", + }, Description: "获取钉盘文件/文件夹元数据", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -213,6 +220,13 @@ var Search = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "drive", + Name: "shortcut_search", + CanonicalPath: "drive.shortcut_search", + CLIPath: "drive +search", + PrimaryCLIPath: "drive +search", + }, Description: "搜索钉盘文件", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -365,6 +379,13 @@ var SearchDocs = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "drive", + Name: "shortcut_search_docs", + CanonicalPath: "drive.shortcut_search_docs", + CLIPath: "drive +search-docs", + PrimaryCLIPath: "drive +search-docs", + }, Description: "搜索文档空间文档", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -466,6 +487,13 @@ var Copy = shortcut.Shortcut{ Confirmation: "user_required", Idempotency: "unknown", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "drive", + Name: "shortcut_copy", + CanonicalPath: "drive.shortcut_copy", + CLIPath: "drive +copy", + PrimaryCLIPath: "drive +copy", + }, Description: "复制文件/文档到指定位置", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -510,6 +538,13 @@ var Move = shortcut.Shortcut{ Confirmation: "user_required", Idempotency: "unknown", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "drive", + Name: "shortcut_move", + CanonicalPath: "drive.shortcut_move", + CLIPath: "drive +move", + PrimaryCLIPath: "drive +move", + }, Description: "移动文件/文档到指定位置", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -559,6 +594,13 @@ var Recent = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "drive", + Name: "shortcut_recent", + CanonicalPath: "drive.shortcut_recent", + CLIPath: "drive +recent", + PrimaryCLIPath: "drive +recent", + }, Description: "获取最近访问/编辑的文档列表", Interface: &contract.InterfaceSpec{ Mode: "composite", diff --git a/internal/shortcut/mail/mail.go b/internal/shortcut/mail/mail.go index 274f50c8..525505ce 100644 --- a/internal/shortcut/mail/mail.go +++ b/internal/shortcut/mail/mail.go @@ -56,6 +56,13 @@ var ThreadList = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "mail", + Name: "shortcut_thread_list", + CanonicalPath: "mail.shortcut_thread_list", + CLIPath: "mail +thread-list", + PrimaryCLIPath: "mail +thread-list", + }, Description: "列出指定邮箱文件夹下的邮件会话(thread)", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -193,6 +200,13 @@ var FolderList = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "mail", + Name: "shortcut_folder_list", + CanonicalPath: "mail.shortcut_folder_list", + CLIPath: "mail +folder-list", + PrimaryCLIPath: "mail +folder-list", + }, Description: "列出顶层文件夹或指定父文件夹下的子文件夹", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -309,6 +323,13 @@ var TagList = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "mail", + Name: "shortcut_tag_list", + CanonicalPath: "mail.shortcut_tag_list", + CLIPath: "mail +tag-list", + PrimaryCLIPath: "mail +tag-list", + }, Description: "列出指定邮箱下的所有邮件标签", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -420,6 +441,13 @@ var UserSearch = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "mail", + Name: "shortcut_user_search", + CanonicalPath: "mail.shortcut_user_search", + CLIPath: "mail +user-search", + PrimaryCLIPath: "mail +user-search", + }, Description: "按关键词或工号搜索邮箱用户(仅企业邮箱)", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -560,6 +588,13 @@ var TemplateList = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "mail", + Name: "shortcut_template_list", + CanonicalPath: "mail.shortcut_template_list", + CLIPath: "mail +template-list", + PrimaryCLIPath: "mail +template-list", + }, Description: "列出指定邮箱的所有邮件模板", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -679,6 +714,13 @@ var ContactList = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "mail", + Name: "shortcut_contact_list", + CanonicalPath: "mail.shortcut_contact_list", + CLIPath: "mail +contact-list", + PrimaryCLIPath: "mail +contact-list", + }, Description: "列出指定邮箱的所有邮件联系人", Interface: &contract.InterfaceSpec{ Mode: "composite", diff --git a/internal/shortcut/minutes/minutes.go b/internal/shortcut/minutes/minutes.go index f02caf4f..f324640c 100644 --- a/internal/shortcut/minutes/minutes.go +++ b/internal/shortcut/minutes/minutes.go @@ -40,6 +40,13 @@ var ListMine = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "minutes", + Name: "shortcut_list_mine", + CanonicalPath: "minutes.shortcut_list_mine", + CLIPath: "minutes +list-mine", + PrimaryCLIPath: "minutes +list-mine", + }, Description: "查询我创建的听记列表", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -76,6 +83,13 @@ var ListShared = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "minutes", + Name: "shortcut_list_shared", + CanonicalPath: "minutes.shortcut_list_shared", + CLIPath: "minutes +list-shared", + PrimaryCLIPath: "minutes +list-shared", + }, Description: "查询他人共享给我的听记列表", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -112,6 +126,13 @@ var ListAll = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "minutes", + Name: "shortcut_list_all", + CanonicalPath: "minutes.shortcut_list_all", + CLIPath: "minutes +list-all", + PrimaryCLIPath: "minutes +list-all", + }, Description: "查询我有权限访问的所有听记列表", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -259,6 +280,13 @@ var RecordStart = shortcut.Shortcut{ Confirmation: "user_required", Idempotency: "unknown", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "minutes", + Name: "shortcut_record_start", + CanonicalPath: "minutes.shortcut_record_start", + CLIPath: "minutes +record-start", + PrimaryCLIPath: "minutes +record-start", + }, Description: "发起听记(开始录音)", Interface: &contract.InterfaceSpec{ Mode: "composite", diff --git a/internal/shortcut/oa/oa.go b/internal/shortcut/oa/oa.go index b3efbae0..80d1590d 100644 --- a/internal/shortcut/oa/oa.go +++ b/internal/shortcut/oa/oa.go @@ -34,6 +34,13 @@ var ListPending = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "oa", + Name: "shortcut_list_pending", + CanonicalPath: "oa.shortcut_list_pending", + CLIPath: "oa +list-pending", + PrimaryCLIPath: "oa +list-pending", + }, Description: "查询待我处理的审批(时间范围为 epoch 毫秒)", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -118,6 +125,13 @@ var ListForms = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "oa", + Name: "shortcut_list_forms", + CanonicalPath: "oa.shortcut_list_forms", + CLIPath: "oa +list-forms", + PrimaryCLIPath: "oa +list-forms", + }, Description: "获取当前用户可见的审批表单列表", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -237,6 +251,13 @@ var SearchForms = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "oa", + Name: "shortcut_search_forms", + CanonicalPath: "oa.shortcut_search_forms", + CLIPath: "oa +search-forms", + PrimaryCLIPath: "oa +search-forms", + }, Description: "按关键字模糊搜索当前用户可见的审批表单", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -299,6 +320,13 @@ var ListExecuted = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "oa", + Name: "shortcut_list_executed", + CanonicalPath: "oa.shortcut_list_executed", + CLIPath: "oa +list-executed", + PrimaryCLIPath: "oa +list-executed", + }, Description: "获取当前用户已经处理过的审批单列表", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -420,6 +448,13 @@ var ListSubmitted = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "oa", + Name: "shortcut_list_submitted", + CanonicalPath: "oa.shortcut_list_submitted", + CLIPath: "oa +list-submitted", + PrimaryCLIPath: "oa +list-submitted", + }, Description: "获取当前用户已发起的审批单列表", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -489,6 +524,13 @@ var ListCc = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "oa", + Name: "shortcut_list_cc", + CanonicalPath: "oa.shortcut_list_cc", + CLIPath: "oa +list-cc", + PrimaryCLIPath: "oa +list-cc", + }, Description: "获取抄送当前用户的审批单列表", Interface: &contract.InterfaceSpec{ Mode: "composite", diff --git a/internal/shortcut/report/report.go b/internal/shortcut/report/report.go index ddacc3b3..28aa7938 100644 --- a/internal/shortcut/report/report.go +++ b/internal/shortcut/report/report.go @@ -54,6 +54,13 @@ var InboxList = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "report", + Name: "shortcut_inbox_list", + CanonicalPath: "report.shortcut_inbox_list", + CLIPath: "report +inbox-list", + PrimaryCLIPath: "report +inbox-list", + }, Description: "列出我收到的日报(按时间范围分页)", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -198,6 +205,13 @@ var OutboxList = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "report", + Name: "shortcut_outbox_list", + CanonicalPath: "report.shortcut_outbox_list", + CLIPath: "report +outbox-list", + PrimaryCLIPath: "report +outbox-list", + }, Description: "列出我发出的日报(可选时间/模版名过滤)", Interface: &contract.InterfaceSpec{ Mode: "composite", diff --git a/internal/shortcut/sheet/sheet.go b/internal/shortcut/sheet/sheet.go index 620a1e6a..8f67cbc0 100644 --- a/internal/shortcut/sheet/sheet.go +++ b/internal/shortcut/sheet/sheet.go @@ -38,6 +38,13 @@ var ListSheets = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "sheet", + Name: "shortcut_list_sheets", + CanonicalPath: "sheet.shortcut_list_sheets", + CLIPath: "sheet +list-sheets", + PrimaryCLIPath: "sheet +list-sheets", + }, Description: "获取表格文档中全部工作表列表", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -161,6 +168,13 @@ var Read = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "sheet", + Name: "shortcut_read", + CanonicalPath: "sheet.shortcut_read", + CLIPath: "sheet +read", + PrimaryCLIPath: "sheet +read", + }, Description: "读取工作表指定范围的结构化单元格数据", Interface: &contract.InterfaceSpec{ Mode: "composite", diff --git a/internal/shortcut/shortcut_test.go b/internal/shortcut/shortcut_test.go index d8aa3bb4..4c55756f 100644 --- a/internal/shortcut/shortcut_test.go +++ b/internal/shortcut/shortcut_test.go @@ -530,6 +530,14 @@ func TestLiveMountExplicitSafetyDrivesRuntimeAndContractFinal(t *testing.T) { Service: "chat", Command: "+send", Risk: RiskRead, Safety: explicit, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "dev", + Name: "create_thing", + CanonicalPath: "dev.create_thing", + CLIPath: "dev create", + PrimaryCLIPath: "dev create", + }, + Description: "发送消息", Interface: &contract.InterfaceSpec{ Mode: "mcp", diff --git a/internal/shortcut/smart/assign.go b/internal/shortcut/smart/assign.go index b8b975c9..d64e6cf0 100644 --- a/internal/shortcut/smart/assign.go +++ b/internal/shortcut/smart/assign.go @@ -39,6 +39,13 @@ var Assign = shortcut.Shortcut{ Confirmation: "user_required", Idempotency: "unknown", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "todo", + Name: "shortcut_assign", + CanonicalPath: "todo.shortcut_assign", + CLIPath: "todo +assign", + PrimaryCLIPath: "todo +assign", + }, Description: "按姓名给某人创建并指派一条待办(自动解析 userId)", Interface: &contract.InterfaceSpec{ Mode: "composite", diff --git a/internal/shortcut/smart/assign_multi.go b/internal/shortcut/smart/assign_multi.go index a0ed8bbc..50d7aa5f 100644 --- a/internal/shortcut/smart/assign_multi.go +++ b/internal/shortcut/smart/assign_multi.go @@ -55,6 +55,13 @@ var AssignMulti = shortcut.Shortcut{ Confirmation: "user_required", Idempotency: "unknown", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "todo", + Name: "shortcut_assign_multi", + CanonicalPath: "todo.shortcut_assign_multi", + CLIPath: "todo +assign-multi", + PrimaryCLIPath: "todo +assign-multi", + }, Description: "把一条待办按姓名一次性指派给多个人(自动把每个姓名解析成 userId)", Interface: &contract.InterfaceSpec{ Mode: "composite", diff --git a/internal/shortcut/smart/at_me.go b/internal/shortcut/smart/at_me.go index 784d333e..e5c86b73 100644 --- a/internal/shortcut/smart/at_me.go +++ b/internal/shortcut/smart/at_me.go @@ -62,6 +62,13 @@ var AtMe = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "chat", + Name: "shortcut_at_me", + CanonicalPath: "chat.shortcut_at_me", + CLIPath: "chat +at-me", + PrimaryCLIPath: "chat +at-me", + }, Description: "查最近 @我 的消息(自动算时间窗,投影发送人/时间/内容/会话)", Interface: &contract.InterfaceSpec{ Mode: "composite", diff --git a/internal/shortcut/smart/book.go b/internal/shortcut/smart/book.go index 5b569974..ca27df7d 100644 --- a/internal/shortcut/smart/book.go +++ b/internal/shortcut/smart/book.go @@ -51,6 +51,13 @@ var Book = shortcut.Shortcut{ Confirmation: "user_required", Idempotency: "unknown", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "calendar", + Name: "shortcut_book", + CanonicalPath: "calendar.shortcut_book", + CLIPath: "calendar +book", + PrimaryCLIPath: "calendar +book", + }, Description: "创建日程,并可按姓名邀请参会人(自动解析 userId,失败自动回滚删除日程)", Interface: &contract.InterfaceSpec{ Mode: "composite", diff --git a/internal/shortcut/smart/broadcast.go b/internal/shortcut/smart/broadcast.go index d68445aa..2e9cc1e4 100644 --- a/internal/shortcut/smart/broadcast.go +++ b/internal/shortcut/smart/broadcast.go @@ -48,6 +48,13 @@ var Broadcast = shortcut.Shortcut{ Confirmation: "user_required", Idempotency: "unknown", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "chat", + Name: "shortcut_broadcast", + CanonicalPath: "chat.shortcut_broadcast", + CLIPath: "chat +broadcast", + PrimaryCLIPath: "chat +broadcast", + }, Description: "按姓名逐一给多个人群发同一条单聊消息(自动解析 userId、逐个发送)", Interface: &contract.InterfaceSpec{ Mode: "composite", diff --git a/internal/shortcut/smart/by_mobile.go b/internal/shortcut/smart/by_mobile.go index 6b88f894..c126decb 100644 --- a/internal/shortcut/smart/by_mobile.go +++ b/internal/shortcut/smart/by_mobile.go @@ -46,6 +46,13 @@ var ByMobile = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "contact", + Name: "shortcut_by_mobile", + CanonicalPath: "contact.shortcut_by_mobile", + CLIPath: "contact +by-mobile", + PrimaryCLIPath: "contact +by-mobile", + }, Description: "按手机号查询某人的完整资料(自动解析 userId 后取详情)", Interface: &contract.InterfaceSpec{ Mode: "composite", diff --git a/internal/shortcut/smart/cancel_event.go b/internal/shortcut/smart/cancel_event.go index de526f93..9d0337dd 100644 --- a/internal/shortcut/smart/cancel_event.go +++ b/internal/shortcut/smart/cancel_event.go @@ -53,6 +53,13 @@ var CancelEvent = shortcut.Shortcut{ Confirmation: "user_required", Idempotency: "unknown", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "calendar", + Name: "shortcut_cancel_event", + CanonicalPath: "calendar.shortcut_cancel_event", + CLIPath: "calendar +cancel-event", + PrimaryCLIPath: "calendar +cancel-event", + }, Description: "取消(删除)一个已有日程(删除前先确认它真实存在)", Interface: &contract.InterfaceSpec{ Mode: "composite", diff --git a/internal/shortcut/smart/chat_messages.go b/internal/shortcut/smart/chat_messages.go index 1b03277f..1d36a424 100644 --- a/internal/shortcut/smart/chat_messages.go +++ b/internal/shortcut/smart/chat_messages.go @@ -67,6 +67,13 @@ var ChatMessages = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "chat", + Name: "shortcut_chat_messages", + CanonicalPath: "chat.shortcut_chat_messages", + CLIPath: "chat +chat-messages", + PrimaryCLIPath: "chat +chat-messages", + }, Description: "拉取某个会话(群聊或单聊)的消息列表并投影出发言人/文本/时间", Interface: &contract.InterfaceSpec{ Mode: "composite", diff --git a/internal/shortcut/smart/conflicts.go b/internal/shortcut/smart/conflicts.go index 3e7e4c19..2aacda13 100644 --- a/internal/shortcut/smart/conflicts.go +++ b/internal/shortcut/smart/conflicts.go @@ -49,6 +49,13 @@ var Conflicts = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "calendar", + Name: "shortcut_conflicts", + CanonicalPath: "calendar.shortcut_conflicts", + CLIPath: "calendar +conflicts", + PrimaryCLIPath: "calendar +conflicts", + }, Description: "检测我某天日程的时间冲突(重叠/双重预订,默认今天)", Interface: &contract.InterfaceSpec{ Mode: "composite", diff --git a/internal/shortcut/smart/created_todos.go b/internal/shortcut/smart/created_todos.go index 7d189f13..4f9cba6e 100644 --- a/internal/shortcut/smart/created_todos.go +++ b/internal/shortcut/smart/created_todos.go @@ -54,6 +54,13 @@ var CreatedTodos = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "todo", + Name: "shortcut_created_todos", + CanonicalPath: "todo.shortcut_created_todos", + CLIPath: "todo +created-todos", + PrimaryCLIPath: "todo +created-todos", + }, Description: "列出我创建的待办(我作为创建人 creator 发起的待办,而非分配给我执行的)", Interface: &contract.InterfaceSpec{ Mode: "composite", diff --git a/internal/shortcut/smart/dept_members.go b/internal/shortcut/smart/dept_members.go index 320c8295..0408e223 100644 --- a/internal/shortcut/smart/dept_members.go +++ b/internal/shortcut/smart/dept_members.go @@ -58,6 +58,13 @@ var DeptMembers = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "contact", + Name: "shortcut_dept_members", + CanonicalPath: "contact.shortcut_dept_members", + CLIPath: "contact +dept-members", + PrimaryCLIPath: "contact +dept-members", + }, Description: "按部门名列出部门成员(自动解析 deptId)", Interface: &contract.InterfaceSpec{ Mode: "composite", diff --git a/internal/shortcut/smart/dm.go b/internal/shortcut/smart/dm.go index 01ef513f..2d6a6194 100644 --- a/internal/shortcut/smart/dm.go +++ b/internal/shortcut/smart/dm.go @@ -47,6 +47,13 @@ var DM = shortcut.Shortcut{ Confirmation: "user_required", Idempotency: "unknown", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "chat", + Name: "shortcut_dm", + CanonicalPath: "chat.shortcut_dm", + CLIPath: "chat +dm", + PrimaryCLIPath: "chat +dm", + }, Description: "按姓名直接给某人发单聊消息(自动解析 userId)", Interface: &contract.InterfaceSpec{ Mode: "composite", diff --git a/internal/shortcut/smart/doc_append.go b/internal/shortcut/smart/doc_append.go index 4f1a5708..eb6ca1da 100644 --- a/internal/shortcut/smart/doc_append.go +++ b/internal/shortcut/smart/doc_append.go @@ -49,6 +49,13 @@ var DocAppend = shortcut.Shortcut{ Confirmation: "user_required", Idempotency: "unknown", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "doc", + Name: "shortcut_doc_append", + CanonicalPath: "doc.shortcut_doc_append", + CLIPath: "doc +doc-append", + PrimaryCLIPath: "doc +doc-append", + }, Description: "在文档末尾追加一段文本(安全追加,不改动原有内容)", Interface: &contract.InterfaceSpec{ Mode: "composite", diff --git a/internal/shortcut/smart/find_doc.go b/internal/shortcut/smart/find_doc.go index c1ca17ed..5c950ec5 100644 --- a/internal/shortcut/smart/find_doc.go +++ b/internal/shortcut/smart/find_doc.go @@ -54,6 +54,13 @@ var FindDoc = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "doc", + Name: "shortcut_find_doc", + CanonicalPath: "doc.shortcut_find_doc", + CLIPath: "doc +find-doc", + PrimaryCLIPath: "doc +find-doc", + }, Description: "按关键词搜索云文档并投影关键字段(只读)", Interface: &contract.InterfaceSpec{ Mode: "composite", diff --git a/internal/shortcut/smart/find_file.go b/internal/shortcut/smart/find_file.go index ac4f3d18..2a92325f 100644 --- a/internal/shortcut/smart/find_file.go +++ b/internal/shortcut/smart/find_file.go @@ -53,6 +53,13 @@ var FindFile = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "drive", + Name: "shortcut_find_file", + CanonicalPath: "drive.shortcut_find_file", + CLIPath: "drive +find-file", + PrimaryCLIPath: "drive +find-file", + }, Description: "按名称关键词搜索钉盘文件并投影关键字段(只读)", Interface: &contract.InterfaceSpec{ Mode: "composite", diff --git a/internal/shortcut/smart/find_mail_user.go b/internal/shortcut/smart/find_mail_user.go index 434cdcbd..98d2be5f 100644 --- a/internal/shortcut/smart/find_mail_user.go +++ b/internal/shortcut/smart/find_mail_user.go @@ -63,6 +63,13 @@ var FindMailUser = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "mail", + Name: "shortcut_find_mail_user", + CanonicalPath: "mail.shortcut_find_mail_user", + CLIPath: "mail +find-mail-user", + PrimaryCLIPath: "mail +find-mail-user", + }, Description: "按关键词搜索邮箱联系人并投影列表(姓名/昵称/邮箱/工号等)", Interface: &contract.InterfaceSpec{ Mode: "composite", diff --git a/internal/shortcut/smart/find_record.go b/internal/shortcut/smart/find_record.go index c3be8d8f..f2de74d1 100644 --- a/internal/shortcut/smart/find_record.go +++ b/internal/shortcut/smart/find_record.go @@ -49,6 +49,13 @@ var FindRecord = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "aitable", + Name: "shortcut_find_record", + CanonicalPath: "aitable.shortcut_find_record", + CLIPath: "aitable +find-record", + PrimaryCLIPath: "aitable +find-record", + }, Description: "在指定多维表里按关键词查记录(只读)", Interface: &contract.InterfaceSpec{ Mode: "composite", diff --git a/internal/shortcut/smart/free_slots.go b/internal/shortcut/smart/free_slots.go index 276e15f9..cdad5b1b 100644 --- a/internal/shortcut/smart/free_slots.go +++ b/internal/shortcut/smart/free_slots.go @@ -50,6 +50,13 @@ var FreeSlots = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "calendar", + Name: "shortcut_free_slots", + CanonicalPath: "calendar.shortcut_free_slots", + CLIPath: "calendar +free-slots", + PrimaryCLIPath: "calendar +free-slots", + }, Description: "找我某天工作时段内的空闲时间段(默认今天 09:00-18:00)", Interface: &contract.InterfaceSpec{ Mode: "composite", diff --git a/internal/shortcut/smart/freebusy.go b/internal/shortcut/smart/freebusy.go index 4a874aaa..dac45a48 100644 --- a/internal/shortcut/smart/freebusy.go +++ b/internal/shortcut/smart/freebusy.go @@ -44,6 +44,13 @@ var FreeBusy = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "calendar", + Name: "shortcut_free", + CanonicalPath: "calendar.shortcut_free", + CLIPath: "calendar +free", + PrimaryCLIPath: "calendar +free", + }, Description: "按姓名查询某人在指定时间段内的忙闲状态(自动解析 userId)", Interface: &contract.InterfaceSpec{ Mode: "composite", diff --git a/internal/shortcut/smart/group_members.go b/internal/shortcut/smart/group_members.go index 0f219365..e9cecd10 100644 --- a/internal/shortcut/smart/group_members.go +++ b/internal/shortcut/smart/group_members.go @@ -51,6 +51,13 @@ var GroupMembers = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "chat", + Name: "shortcut_group_members", + CanonicalPath: "chat.shortcut_group_members", + CLIPath: "chat +group-members", + PrimaryCLIPath: "chat +group-members", + }, Description: "按群名列出群成员(自动搜群解析 openConversationId)", Interface: &contract.InterfaceSpec{ Mode: "composite", diff --git a/internal/shortcut/smart/invite.go b/internal/shortcut/smart/invite.go index df1e8d3e..6fb007df 100644 --- a/internal/shortcut/smart/invite.go +++ b/internal/shortcut/smart/invite.go @@ -44,6 +44,13 @@ var Invite = shortcut.Shortcut{ Confirmation: "user_required", Idempotency: "unknown", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "calendar", + Name: "shortcut_invite", + CanonicalPath: "calendar.shortcut_invite", + CLIPath: "calendar +invite", + PrimaryCLIPath: "calendar +invite", + }, Description: "按姓名把参会人加入已有日程(自动解析 userId 后批量添加)", Interface: &contract.InterfaceSpec{ Mode: "composite", diff --git a/internal/shortcut/smart/list_tables.go b/internal/shortcut/smart/list_tables.go index 174dd1ce..eeb64eef 100644 --- a/internal/shortcut/smart/list_tables.go +++ b/internal/shortcut/smart/list_tables.go @@ -51,6 +51,13 @@ var ListTables = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "aitable", + Name: "shortcut_list_tables", + CanonicalPath: "aitable.shortcut_list_tables", + CLIPath: "aitable +list-tables", + PrimaryCLIPath: "aitable +list-tables", + }, Description: "列出某个多维表(base)里的所有数据表(只读,投影 tableId/tableName)", Interface: &contract.InterfaceSpec{ Mode: "composite", diff --git a/internal/shortcut/smart/lookup.go b/internal/shortcut/smart/lookup.go index ee389030..d9a18017 100644 --- a/internal/shortcut/smart/lookup.go +++ b/internal/shortcut/smart/lookup.go @@ -39,6 +39,13 @@ var Lookup = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "contact", + Name: "shortcut_lookup", + CanonicalPath: "contact.shortcut_lookup", + CLIPath: "contact +lookup", + PrimaryCLIPath: "contact +lookup", + }, Description: "按姓名查询某人的完整资料(自动解析 userId 后取详情)", Interface: &contract.InterfaceSpec{ Mode: "composite", diff --git a/internal/shortcut/smart/minutes_detail.go b/internal/shortcut/smart/minutes_detail.go index b0688fb4..60cc2c36 100644 --- a/internal/shortcut/smart/minutes_detail.go +++ b/internal/shortcut/smart/minutes_detail.go @@ -54,6 +54,13 @@ var MinutesDetail = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "minutes", + Name: "shortcut_detail", + CanonicalPath: "minutes.shortcut_detail", + CLIPath: "minutes +detail", + PrimaryCLIPath: "minutes +detail", + }, Description: "一条命令聚合取一条妙记(听记)的多项产物(基础信息/摘要/关键词/逐字稿/待办)", Interface: &contract.InterfaceSpec{ Mode: "composite", diff --git a/internal/shortcut/smart/minutes_search.go b/internal/shortcut/smart/minutes_search.go index 6c569b3e..c6e57915 100644 --- a/internal/shortcut/smart/minutes_search.go +++ b/internal/shortcut/smart/minutes_search.go @@ -48,6 +48,13 @@ var MinutesSearch = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "minutes", + Name: "shortcut_minutes_search", + CanonicalPath: "minutes.shortcut_minutes_search", + CLIPath: "minutes +minutes-search", + PrimaryCLIPath: "minutes +minutes-search", + }, Description: "按关键词搜索我的妙记并投影列表", Interface: &contract.InterfaceSpec{ Mode: "composite", diff --git a/internal/shortcut/smart/my_attendance.go b/internal/shortcut/smart/my_attendance.go index 0b98175b..1c445d14 100644 --- a/internal/shortcut/smart/my_attendance.go +++ b/internal/shortcut/smart/my_attendance.go @@ -54,6 +54,13 @@ var MyAttendance = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "attendance", + Name: "shortcut_my_attendance", + CanonicalPath: "attendance.shortcut_my_attendance", + CLIPath: "attendance +my-attendance", + PrimaryCLIPath: "attendance +my-attendance", + }, Description: "查我今天的考勤打卡记录(打卡流水,自动解析当前用户)", Interface: &contract.InterfaceSpec{ Mode: "composite", diff --git a/internal/shortcut/smart/my_free.go b/internal/shortcut/smart/my_free.go index 9c09d3bd..0ae772aa 100644 --- a/internal/shortcut/smart/my_free.go +++ b/internal/shortcut/smart/my_free.go @@ -52,6 +52,13 @@ var MyFree = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "calendar", + Name: "shortcut_my_free", + CanonicalPath: "calendar.shortcut_my_free", + CLIPath: "calendar +my-free", + PrimaryCLIPath: "calendar +my-free", + }, Description: "查我自己在某时间段的忙闲(默认今天,无需输入姓名)", Interface: &contract.InterfaceSpec{ Mode: "composite", diff --git a/internal/shortcut/smart/my_groups.go b/internal/shortcut/smart/my_groups.go index d3e308c5..3aec3bc7 100644 --- a/internal/shortcut/smart/my_groups.go +++ b/internal/shortcut/smart/my_groups.go @@ -54,6 +54,13 @@ var MyGroups = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "chat", + Name: "shortcut_my_groups", + CanonicalPath: "chat.shortcut_my_groups", + CLIPath: "chat +my-groups", + PrimaryCLIPath: "chat +my-groups", + }, Description: "列出我加入的群,可按类型过滤并投影关键字段", Interface: &contract.InterfaceSpec{ Mode: "composite", diff --git a/internal/shortcut/smart/my_initiated.go b/internal/shortcut/smart/my_initiated.go index 28faceef..195fb6a9 100644 --- a/internal/shortcut/smart/my_initiated.go +++ b/internal/shortcut/smart/my_initiated.go @@ -63,6 +63,13 @@ var MyInitiated = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "oa", + Name: "shortcut_my_initiated", + CanonicalPath: "oa.shortcut_my_initiated", + CLIPath: "oa +my-initiated", + PrimaryCLIPath: "oa +my-initiated", + }, Description: "列出我发起(提交)的审批单据", Interface: &contract.InterfaceSpec{ Mode: "composite", diff --git a/internal/shortcut/smart/next_event.go b/internal/shortcut/smart/next_event.go index 04d9ef15..a31b133d 100644 --- a/internal/shortcut/smart/next_event.go +++ b/internal/shortcut/smart/next_event.go @@ -49,6 +49,13 @@ var NextEvent = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "calendar", + Name: "shortcut_next_event", + CanonicalPath: "calendar.shortcut_next_event", + CLIPath: "calendar +next-event", + PrimaryCLIPath: "calendar +next-event", + }, Description: "查看接下来最近的一个日程(默认扫描未来 7 天)", Interface: &contract.InterfaceSpec{ Mode: "composite", diff --git a/internal/shortcut/smart/org.go b/internal/shortcut/smart/org.go index 521e5795..4e20d9ca 100644 --- a/internal/shortcut/smart/org.go +++ b/internal/shortcut/smart/org.go @@ -49,6 +49,13 @@ var Org = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "contact", + Name: "shortcut_org", + CanonicalPath: "contact.shortcut_org", + CLIPath: "contact +org", + PrimaryCLIPath: "contact +org", + }, Description: "按姓名查某人所在部门的详情(自动解析 userId 与 deptId)", Interface: &contract.InterfaceSpec{ Mode: "composite", diff --git a/internal/shortcut/smart/overdue.go b/internal/shortcut/smart/overdue.go index 658874b8..c5b5d1ba 100644 --- a/internal/shortcut/smart/overdue.go +++ b/internal/shortcut/smart/overdue.go @@ -55,6 +55,13 @@ var Overdue = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "todo", + Name: "shortcut_overdue", + CanonicalPath: "todo.shortcut_overdue", + CLIPath: "todo +overdue", + PrimaryCLIPath: "todo +overdue", + }, Description: "列出我已过期未完成的待办", Interface: &contract.InterfaceSpec{ Mode: "composite", diff --git a/internal/shortcut/smart/recent_mail.go b/internal/shortcut/smart/recent_mail.go index 9ae864fd..c5b920ed 100644 --- a/internal/shortcut/smart/recent_mail.go +++ b/internal/shortcut/smart/recent_mail.go @@ -63,6 +63,13 @@ var RecentMail = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "mail", + Name: "shortcut_recent_mail", + CanonicalPath: "mail.shortcut_recent_mail", + CLIPath: "mail +recent-mail", + PrimaryCLIPath: "mail +recent-mail", + }, Description: "列出收件箱近期邮件会话并投影列表(主题/发件人/时间/threadId)", Interface: &contract.InterfaceSpec{ Mode: "composite", diff --git a/internal/shortcut/smart/record_share_links.go b/internal/shortcut/smart/record_share_links.go index 637aaa02..fe8e7010 100644 --- a/internal/shortcut/smart/record_share_links.go +++ b/internal/shortcut/smart/record_share_links.go @@ -53,6 +53,13 @@ var RecordShareLinks = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "aitable", + Name: "shortcut_record_share_links", + CanonicalPath: "aitable.shortcut_record_share_links", + CLIPath: "aitable +record-share-links", + PrimaryCLIPath: "aitable +record-share-links", + }, Description: "批量(可 >20 条)获取多维表记录分享链接:去重+分片+合并", Interface: &contract.InterfaceSpec{ Mode: "composite", diff --git a/internal/shortcut/smart/remind.go b/internal/shortcut/smart/remind.go index 3894c633..d5a8639b 100644 --- a/internal/shortcut/smart/remind.go +++ b/internal/shortcut/smart/remind.go @@ -47,6 +47,13 @@ var Remind = shortcut.Shortcut{ Confirmation: "user_required", Idempotency: "unknown", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "todo", + Name: "shortcut_remind", + CanonicalPath: "todo.shortcut_remind", + CLIPath: "todo +remind", + PrimaryCLIPath: "todo +remind", + }, Description: "给自己创建一条带可选截止时间的待办", Interface: &contract.InterfaceSpec{ Mode: "composite", diff --git a/internal/shortcut/smart/replace_batch.go b/internal/shortcut/smart/replace_batch.go index 579f4d27..964f0353 100644 --- a/internal/shortcut/smart/replace_batch.go +++ b/internal/shortcut/smart/replace_batch.go @@ -51,6 +51,13 @@ var ReplaceBatch = shortcut.Shortcut{ Confirmation: "user_required", Idempotency: "unknown", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "minutes", + Name: "shortcut_replace_batch", + CanonicalPath: "minutes.shortcut_replace_batch", + CLIPath: "minutes +replace-batch", + PrimaryCLIPath: "minutes +replace-batch", + }, Description: "对一条妙记(听记)批量执行多组文字替换(原文=>替换)", Interface: &contract.InterfaceSpec{ Mode: "composite", diff --git a/internal/shortcut/smart/reschedule.go b/internal/shortcut/smart/reschedule.go index d905fdf1..1b779676 100644 --- a/internal/shortcut/smart/reschedule.go +++ b/internal/shortcut/smart/reschedule.go @@ -49,6 +49,13 @@ var Reschedule = shortcut.Shortcut{ Confirmation: "user_required", Idempotency: "unknown", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "calendar", + Name: "shortcut_reschedule", + CanonicalPath: "calendar.shortcut_reschedule", + CLIPath: "calendar +reschedule", + PrimaryCLIPath: "calendar +reschedule", + }, Description: "改一个已有日程的时间(只动开始/结束时间,其他字段不变)", Interface: &contract.InterfaceSpec{ Mode: "composite", diff --git a/internal/shortcut/smart/resolve_base.go b/internal/shortcut/smart/resolve_base.go index 64c17910..0a45580d 100644 --- a/internal/shortcut/smart/resolve_base.go +++ b/internal/shortcut/smart/resolve_base.go @@ -51,6 +51,13 @@ var ResolveBase = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "aitable", + Name: "shortcut_resolve_base", + CanonicalPath: "aitable.shortcut_resolve_base", + CLIPath: "aitable +resolve-base", + PrimaryCLIPath: "aitable +resolve-base", + }, Description: "按名称搜索多维表 Base 并解析出唯一 baseId(只读)", Interface: &contract.InterfaceSpec{ Mode: "composite", diff --git a/internal/shortcut/smart/resolve_dept.go b/internal/shortcut/smart/resolve_dept.go index cdf9294c..ae7ffab4 100644 --- a/internal/shortcut/smart/resolve_dept.go +++ b/internal/shortcut/smart/resolve_dept.go @@ -57,6 +57,13 @@ var ResolveDept = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "contact", + Name: "shortcut_resolve_dept", + CanonicalPath: "contact.shortcut_resolve_dept", + CLIPath: "contact +resolve-dept", + PrimaryCLIPath: "contact +resolve-dept", + }, Description: "按名称搜索部门并解析出唯一 deptId(只读)", Interface: &contract.InterfaceSpec{ Mode: "composite", diff --git a/internal/shortcut/smart/resolve_table.go b/internal/shortcut/smart/resolve_table.go index 1ac2757a..df4f3fe7 100644 --- a/internal/shortcut/smart/resolve_table.go +++ b/internal/shortcut/smart/resolve_table.go @@ -59,6 +59,13 @@ var ResolveTable = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "aitable", + Name: "shortcut_resolve_table", + CanonicalPath: "aitable.shortcut_resolve_table", + CLIPath: "aitable +resolve-table", + PrimaryCLIPath: "aitable +resolve-table", + }, Description: "在某个多维表 Base 内按名称解析出唯一的数据表 tableId(只读)", Interface: &contract.InterfaceSpec{ Mode: "composite", diff --git a/internal/shortcut/smart/search_mail.go b/internal/shortcut/smart/search_mail.go index 62d1c782..a6d824e2 100644 --- a/internal/shortcut/smart/search_mail.go +++ b/internal/shortcut/smart/search_mail.go @@ -55,6 +55,13 @@ var SearchMail = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "mail", + Name: "shortcut_search_mail", + CanonicalPath: "mail.shortcut_search_mail", + CLIPath: "mail +search-mail", + PrimaryCLIPath: "mail +search-mail", + }, Description: "按 KQL 关键词搜索邮件并投影列表(主题/发件人/时间/messageId)", Interface: &contract.InterfaceSpec{ Mode: "composite", diff --git a/internal/shortcut/smart/search_msg.go b/internal/shortcut/smart/search_msg.go index b4ee511d..37248b64 100644 --- a/internal/shortcut/smart/search_msg.go +++ b/internal/shortcut/smart/search_msg.go @@ -47,6 +47,13 @@ var SearchMsg = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "chat", + Name: "shortcut_search_msg", + CanonicalPath: "chat.shortcut_search_msg", + CLIPath: "chat +search-msg", + PrimaryCLIPath: "chat +search-msg", + }, Description: "多维搜索消息,可全量翻页并批量富化详情", Interface: &contract.InterfaceSpec{ Mode: "composite", diff --git a/internal/shortcut/smart/send_to_group.go b/internal/shortcut/smart/send_to_group.go index 3be75d6d..5fc7ae31 100644 --- a/internal/shortcut/smart/send_to_group.go +++ b/internal/shortcut/smart/send_to_group.go @@ -50,6 +50,13 @@ var SendToGroup = shortcut.Shortcut{ Confirmation: "user_required", Idempotency: "unknown", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "chat", + Name: "shortcut_send_to_group", + CanonicalPath: "chat.shortcut_send_to_group", + CLIPath: "chat +send-to-group", + PrimaryCLIPath: "chat +send-to-group", + }, Description: "按群名直接给群发消息(自动搜群解析 openConversationId)", Interface: &contract.InterfaceSpec{ Mode: "composite", diff --git a/internal/shortcut/smart/share_doc.go b/internal/shortcut/smart/share_doc.go index 0b0759e3..0c539ed1 100644 --- a/internal/shortcut/smart/share_doc.go +++ b/internal/shortcut/smart/share_doc.go @@ -47,6 +47,13 @@ var ShareDoc = shortcut.Shortcut{ Confirmation: "user_required", Idempotency: "unknown", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "doc", + Name: "shortcut_share_doc", + CanonicalPath: "doc.shortcut_share_doc", + CLIPath: "doc +share-doc", + PrimaryCLIPath: "doc +share-doc", + }, Description: "按姓名把文档链接私信发给某人(自动解析 userId)", Interface: &contract.InterfaceSpec{ Mode: "composite", diff --git a/internal/shortcut/smart/suggest_time.go b/internal/shortcut/smart/suggest_time.go index 20725ac0..eeb2b56f 100644 --- a/internal/shortcut/smart/suggest_time.go +++ b/internal/shortcut/smart/suggest_time.go @@ -46,6 +46,13 @@ var SuggestTime = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "calendar", + Name: "shortcut_suggest_time", + CanonicalPath: "calendar.shortcut_suggest_time", + CLIPath: "calendar +suggest-time", + PrimaryCLIPath: "calendar +suggest-time", + }, Description: "按姓名解析多位参与者,推荐大家都有空的可开会时间段(自动解析 userId)", Interface: &contract.InterfaceSpec{ Mode: "composite", diff --git a/internal/shortcut/smart/team.go b/internal/shortcut/smart/team.go index 32d7cbe9..81a70417 100644 --- a/internal/shortcut/smart/team.go +++ b/internal/shortcut/smart/team.go @@ -51,6 +51,13 @@ var Team = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "contact", + Name: "shortcut_team", + CanonicalPath: "contact.shortcut_team", + CLIPath: "contact +team", + PrimaryCLIPath: "contact +team", + }, Description: "按姓名列出某人所在部门的成员(自动解析 userId 与 deptId)", Interface: &contract.InterfaceSpec{ Mode: "composite", diff --git a/internal/shortcut/smart/this_month_attendance.go b/internal/shortcut/smart/this_month_attendance.go index 02fd5288..3363e6f8 100644 --- a/internal/shortcut/smart/this_month_attendance.go +++ b/internal/shortcut/smart/this_month_attendance.go @@ -54,6 +54,13 @@ var ThisMonthAttendance = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "attendance", + Name: "shortcut_this_month", + CanonicalPath: "attendance.shortcut_this_month", + CLIPath: "attendance +this-month", + PrimaryCLIPath: "attendance +this-month", + }, Description: "查我本月的考勤打卡记录(打卡流水,自动解析当前用户)", Interface: &contract.InterfaceSpec{ Mode: "composite", diff --git a/internal/shortcut/smart/thread_replies.go b/internal/shortcut/smart/thread_replies.go index c15a1cc2..4c196cc7 100644 --- a/internal/shortcut/smart/thread_replies.go +++ b/internal/shortcut/smart/thread_replies.go @@ -51,6 +51,13 @@ var ThreadReplies = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "chat", + Name: "shortcut_thread_replies", + CanonicalPath: "chat.shortcut_thread_replies", + CLIPath: "chat +thread-replies", + PrimaryCLIPath: "chat +thread-replies", + }, Description: "拉取某条话题消息的全部回复并投影出发言人/文本/时间", Interface: &contract.InterfaceSpec{ Mode: "composite", diff --git a/internal/shortcut/smart/today.go b/internal/shortcut/smart/today.go index 1c7c0fcc..638f97b8 100644 --- a/internal/shortcut/smart/today.go +++ b/internal/shortcut/smart/today.go @@ -46,6 +46,13 @@ var Today = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "calendar", + Name: "shortcut_today", + CanonicalPath: "calendar.shortcut_today", + CLIPath: "calendar +today", + PrimaryCLIPath: "calendar +today", + }, Description: "列出我今天的日程(自动计算今天的起止时间,无需手动填时间范围)", Interface: &contract.InterfaceSpec{ Mode: "composite", diff --git a/internal/shortcut/smart/todo_done.go b/internal/shortcut/smart/todo_done.go index 70b2fecd..c9f21eb2 100644 --- a/internal/shortcut/smart/todo_done.go +++ b/internal/shortcut/smart/todo_done.go @@ -53,6 +53,13 @@ var TodoDone = shortcut.Shortcut{ Confirmation: "user_required", Idempotency: "unknown", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "todo", + Name: "shortcut_todo_done", + CanonicalPath: "todo.shortcut_todo_done", + CLIPath: "todo +todo-done", + PrimaryCLIPath: "todo +todo-done", + }, Description: "按标题关键词把我的某条待办标记完成(自动定位 taskId)", Interface: &contract.InterfaceSpec{ Mode: "composite", diff --git a/internal/shortcut/smart/tomorrow.go b/internal/shortcut/smart/tomorrow.go index 4272967b..b4eea779 100644 --- a/internal/shortcut/smart/tomorrow.go +++ b/internal/shortcut/smart/tomorrow.go @@ -45,6 +45,13 @@ var Tomorrow = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "calendar", + Name: "shortcut_tomorrow", + CanonicalPath: "calendar.shortcut_tomorrow", + CLIPath: "calendar +tomorrow", + PrimaryCLIPath: "calendar +tomorrow", + }, Description: "列出我明天的日程(自动计算明天的起止时间,无需手动填时间范围)", Interface: &contract.InterfaceSpec{ Mode: "composite", diff --git a/internal/shortcut/smart/unread_chats.go b/internal/shortcut/smart/unread_chats.go index 9fc42ead..c08c3c77 100644 --- a/internal/shortcut/smart/unread_chats.go +++ b/internal/shortcut/smart/unread_chats.go @@ -58,6 +58,13 @@ var UnreadChats = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "chat", + Name: "shortcut_unread_chats", + CanonicalPath: "chat.shortcut_unread_chats", + CLIPath: "chat +unread-chats", + PrimaryCLIPath: "chat +unread-chats", + }, Description: "列出我有未读消息的会话(投影会话名/未读数/会话ID)", Interface: &contract.InterfaceSpec{ Mode: "composite", diff --git a/internal/shortcut/smart/unread_mail.go b/internal/shortcut/smart/unread_mail.go index 5e76dd9a..e72a91fa 100644 --- a/internal/shortcut/smart/unread_mail.go +++ b/internal/shortcut/smart/unread_mail.go @@ -55,6 +55,13 @@ var UnreadMail = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "mail", + Name: "shortcut_unread_mail", + CanonicalPath: "mail.shortcut_unread_mail", + CLIPath: "mail +unread-mail", + PrimaryCLIPath: "mail +unread-mail", + }, Description: "列出未读邮件并投影列表(主题/发件人/时间/messageId)", Interface: &contract.InterfaceSpec{ Mode: "composite", diff --git a/internal/shortcut/smart/week.go b/internal/shortcut/smart/week.go index ffa153d5..afa4cccf 100644 --- a/internal/shortcut/smart/week.go +++ b/internal/shortcut/smart/week.go @@ -51,6 +51,13 @@ var Week = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "calendar", + Name: "shortcut_week", + CanonicalPath: "calendar.shortcut_week", + CLIPath: "calendar +week", + PrimaryCLIPath: "calendar +week", + }, Description: "列出我本周的日程(自动按周一为周首计算本周起止时间,无需手动填时间范围)", Interface: &contract.InterfaceSpec{ Mode: "composite", diff --git a/internal/shortcut/smart/whoami.go b/internal/shortcut/smart/whoami.go index feac7944..aee9d7e9 100644 --- a/internal/shortcut/smart/whoami.go +++ b/internal/shortcut/smart/whoami.go @@ -42,6 +42,13 @@ var Whoami = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "contact", + Name: "shortcut_me", + CanonicalPath: "contact.shortcut_me", + CLIPath: "contact +me", + PrimaryCLIPath: "contact +me", + }, Description: "查看我自己的通讯录资料(姓名/userId/手机/部门/组织,干净投影)", Interface: &contract.InterfaceSpec{ Mode: "composite", diff --git a/internal/shortcut/todo/todo.go b/internal/shortcut/todo/todo.go index a24d00de..ac8981cd 100644 --- a/internal/shortcut/todo/todo.go +++ b/internal/shortcut/todo/todo.go @@ -40,6 +40,13 @@ var GetMyTasks = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "todo", + Name: "shortcut_get_my_tasks", + CanonicalPath: "todo.shortcut_get_my_tasks", + CLIPath: "todo +get-my-tasks", + PrimaryCLIPath: "todo +get-my-tasks", + }, Description: "查询当前组织下我的待办列表", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -146,6 +153,13 @@ var ListSub = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "todo", + Name: "shortcut_list_sub", + CanonicalPath: "todo.shortcut_list_sub", + CLIPath: "todo +list-sub", + PrimaryCLIPath: "todo +list-sub", + }, Description: "查询子待办列表", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -256,6 +270,13 @@ var Get = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "todo", + Name: "shortcut_get", + CanonicalPath: "todo.shortcut_get", + CLIPath: "todo +get", + PrimaryCLIPath: "todo +get", + }, Description: "查询待办详情", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -299,6 +320,13 @@ var ListAttachment = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "todo", + Name: "shortcut_list_attachment", + CanonicalPath: "todo.shortcut_list_attachment", + CLIPath: "todo +list-attachment", + PrimaryCLIPath: "todo +list-attachment", + }, Description: "查询待办任务的附件列表", Interface: &contract.InterfaceSpec{ Mode: "composite", @@ -411,6 +439,13 @@ var ListComment = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "todo", + Name: "shortcut_list_comment", + CanonicalPath: "todo.shortcut_list_comment", + CLIPath: "todo +list-comment", + PrimaryCLIPath: "todo +list-comment", + }, Description: "查询待办评论列表", Interface: &contract.InterfaceSpec{ Mode: "composite", diff --git a/internal/shortcut/wiki/wiki.go b/internal/shortcut/wiki/wiki.go index 29078f7c..4e8d0990 100644 --- a/internal/shortcut/wiki/wiki.go +++ b/internal/shortcut/wiki/wiki.go @@ -139,6 +139,13 @@ var SpaceSearch = shortcut.Shortcut{ Confirmation: "not_required", Idempotency: "idempotent", }, Contract: corecmd.ContractDecl{ + Identity: contract.ToolIdentitySpec{ + ProductID: "wiki", + Name: "shortcut_space_search", + CanonicalPath: "wiki.shortcut_space_search", + CLIPath: "wiki +space-search", + PrimaryCLIPath: "wiki +space-search", + }, Description: "搜索知识库", Interface: &contract.InterfaceSpec{ Mode: "composite",