@vheins/local-memory-mcp 0.18.11 → 0.18.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -81,8 +81,8 @@ function loadServerInstructions() {
81
81
  // src/mcp/capabilities.ts
82
82
  var __dirname2 = path2.dirname(fileURLToPath2(import.meta.url));
83
83
  var pkgVersion = "0.1.0";
84
- if ("0.18.11") {
85
- pkgVersion = "0.18.11";
84
+ if ("0.18.12") {
85
+ pkgVersion = "0.18.12";
86
86
  } else {
87
87
  let searchDir = __dirname2;
88
88
  for (let i = 0; i < 5; i++) {
@@ -3586,511 +3586,7 @@ function inferOwnerFromSession(session) {
3586
3586
  return void 0;
3587
3587
  }
3588
3588
 
3589
- // src/mcp/tools/schemas.ts
3590
- import { z } from "zod";
3591
- var MemoryScopeSchema = z.object({
3592
- owner: z.string().min(1),
3593
- repo: z.string().min(1).transform(normalizeRepo),
3594
- branch: z.string().optional(),
3595
- folder: z.string().optional(),
3596
- language: z.string().optional()
3597
- });
3598
- var MemoryTypeSchema = z.enum(["code_fact", "decision", "mistake", "pattern", "task_archive"]);
3599
- var SingleMemorySchema = z.object({
3600
- code: z.string().max(20).optional(),
3601
- type: MemoryTypeSchema,
3602
- title: z.string().min(3).max(255),
3603
- content: z.string().min(10),
3604
- importance: z.number().min(1).max(5),
3605
- agent: z.string().min(1),
3606
- role: z.string().optional().default("unknown"),
3607
- model: z.string().min(1),
3608
- scope: MemoryScopeSchema,
3609
- ttlDays: z.number().min(1).optional(),
3610
- supersedes: z.string().optional(),
3611
- tags: z.array(z.string()).optional(),
3612
- metadata: z.record(z.string(), z.any()).optional(),
3613
- is_global: z.boolean().default(false)
3614
- });
3615
- var SingleStandardSchema = z.object({
3616
- name: z.string().min(3).max(255),
3617
- content: z.string().min(10),
3618
- parent_id: z.string().optional(),
3619
- context: z.string().optional(),
3620
- version: z.string().optional(),
3621
- language: z.string().optional(),
3622
- stack: z.array(z.string()).optional(),
3623
- is_global: z.boolean().optional(),
3624
- tags: z.array(z.string().min(1)).min(1),
3625
- metadata: z.record(z.string(), z.any()).refine((value) => Object.keys(value).length > 0, {
3626
- message: "metadata must contain at least one key"
3627
- }),
3628
- agent: z.string().optional(),
3629
- model: z.string().optional()
3630
- });
3631
- var MemoryStoreSchema = z.object({
3632
- code: z.string().max(20).optional(),
3633
- type: MemoryTypeSchema.optional(),
3634
- title: z.string().min(3).max(255).optional(),
3635
- content: z.string().min(10).optional(),
3636
- importance: z.number().min(1).max(5).optional(),
3637
- agent: z.string().min(1).optional(),
3638
- role: z.string().optional().default("unknown"),
3639
- model: z.string().min(1).optional(),
3640
- scope: MemoryScopeSchema.optional(),
3641
- ttlDays: z.number().min(1).optional(),
3642
- supersedes: z.string().optional(),
3643
- tags: z.array(z.string()).optional(),
3644
- metadata: z.record(z.string(), z.any()).optional(),
3645
- is_global: z.boolean().default(false),
3646
- structured: z.boolean().default(false),
3647
- memories: z.array(SingleMemorySchema).min(1).optional()
3648
- }).refine(
3649
- (data) => {
3650
- if (data.memories) return true;
3651
- return !!(data.type && data.title && data.content && data.importance && data.agent && data.model && data.scope);
3652
- },
3653
- {
3654
- message: "Either 'memories' array or single memory fields (type, title, content, importance, agent, model, scope) must be provided"
3655
- }
3656
- );
3657
- var MemoryUpdateSchema = z.object({
3658
- id: z.string().uuid().optional(),
3659
- code: z.string().max(20).optional(),
3660
- owner: z.string().min(1),
3661
- repo: z.string().min(1).transform(normalizeRepo),
3662
- type: MemoryTypeSchema.optional(),
3663
- title: z.string().min(3).max(255).optional(),
3664
- content: z.string().min(10).optional(),
3665
- importance: z.number().min(1).max(5).optional(),
3666
- agent: z.string().optional(),
3667
- role: z.string().optional(),
3668
- status: z.enum(["active", "archived"]).optional(),
3669
- supersedes: z.string().optional(),
3670
- tags: z.array(z.string()).optional(),
3671
- metadata: z.record(z.string(), z.any()).optional(),
3672
- is_global: z.boolean().optional(),
3673
- completed_at: z.string().optional(),
3674
- structured: z.boolean().default(false)
3675
- }).refine((data) => data.id !== void 0 || data.code !== void 0, {
3676
- message: "Either id or code must be provided"
3677
- }).refine(
3678
- (data) => data.type !== void 0 || data.content !== void 0 || data.title !== void 0 || data.importance !== void 0 || data.status !== void 0 || data.supersedes !== void 0 || data.tags !== void 0 || data.metadata !== void 0 || data.is_global !== void 0 || data.agent !== void 0 || data.role !== void 0 || data.completed_at !== void 0,
3679
- { message: "At least one field must be provided for update" }
3680
- );
3681
- var MemorySearchSchema = z.object({
3682
- query: z.string().min(3),
3683
- prompt: z.string().optional(),
3684
- owner: z.string().min(1),
3685
- repo: z.string().min(1).transform(normalizeRepo),
3686
- types: z.array(MemoryTypeSchema).optional(),
3687
- minImportance: z.number().min(1).max(5).optional(),
3688
- limit: z.number().min(1).max(100).default(5),
3689
- offset: z.number().min(0).default(0),
3690
- includeRecap: z.boolean().default(false),
3691
- current_file_path: z.string().optional(),
3692
- include_archived: z.boolean().default(false),
3693
- current_tags: z.array(z.string()).optional(),
3694
- scope: MemoryScopeSchema.partial().optional(),
3695
- structured: z.boolean().default(false)
3696
- });
3697
- var MemoryAcknowledgeSchema = z.object({
3698
- memory_id: z.string().uuid().optional(),
3699
- code: z.string().max(20).optional(),
3700
- owner: z.string().min(1),
3701
- repo: z.string().min(1).transform(normalizeRepo),
3702
- status: z.enum(["used", "irrelevant", "contradictory"]),
3703
- application_context: z.string().min(10).optional(),
3704
- structured: z.boolean().default(false)
3705
- }).refine((data) => data.memory_id !== void 0 || data.code !== void 0, {
3706
- message: "Either memory_id or code must be provided"
3707
- });
3708
- var MemoryRecapSchema = z.object({
3709
- owner: z.string().min(1),
3710
- repo: z.string().min(1).transform(normalizeRepo),
3711
- limit: z.number().min(1).max(50).default(20),
3712
- offset: z.number().min(0).default(0),
3713
- structured: z.boolean().default(false)
3714
- });
3715
- var MemoryDeleteSchema = z.object({
3716
- owner: z.string().min(1),
3717
- repo: z.string().min(1).transform(normalizeRepo),
3718
- id: z.string().uuid().optional(),
3719
- ids: z.array(z.string().uuid()).min(1).optional(),
3720
- code: z.string().max(20).optional(),
3721
- codes: z.array(z.string().max(20)).min(1).optional(),
3722
- structured: z.boolean().default(false)
3723
- }).refine(
3724
- (data) => data.id !== void 0 || data.ids !== void 0 || data.code !== void 0 || data.codes !== void 0,
3725
- {
3726
- message: "Either 'id', 'ids', 'code', or 'codes' must be provided for deletion"
3727
- }
3728
- );
3729
- var MemorySummarizeSchema = z.object({
3730
- owner: z.string().min(1),
3731
- repo: z.string().min(1).transform(normalizeRepo),
3732
- signals: z.array(z.string().max(200)).min(1),
3733
- structured: z.boolean().default(false)
3734
- });
3735
- var MemorySynthesizeSchema = z.object({
3736
- owner: z.string().min(1),
3737
- repo: z.string().min(1).transform(normalizeRepo).optional(),
3738
- objective: z.string().min(5),
3739
- current_file_path: z.string().optional(),
3740
- include_summary: z.boolean().default(true),
3741
- include_tasks: z.boolean().default(true),
3742
- use_tools: z.boolean().default(true),
3743
- max_iterations: z.number().int().min(1).max(5).default(3),
3744
- max_tokens: z.number().int().min(128).max(4e3).default(1200),
3745
- structured: z.boolean().default(false)
3746
- });
3747
- var TaskStatusSchema = z.enum(["backlog", "pending", "in_progress", "completed", "canceled", "blocked"]);
3748
- var TaskPrioritySchema = z.number().min(1).max(5);
3749
- var TaskMetadataSchema = z.record(z.string(), z.any()).optional().superRefine((metadata, ctx) => {
3750
- if (!metadata) return;
3751
- if (metadata.required_skills !== void 0) {
3752
- if (!Array.isArray(metadata.required_skills)) {
3753
- ctx.addIssue({
3754
- code: z.ZodIssueCode.custom,
3755
- message: "metadata.required_skills must be an array of strings",
3756
- path: ["metadata", "required_skills"]
3757
- });
3758
- } else if (metadata.required_skills.length === 0) {
3759
- ctx.addIssue({
3760
- code: z.ZodIssueCode.custom,
3761
- message: "metadata.required_skills must not be empty when present",
3762
- path: ["metadata", "required_skills"]
3763
- });
3764
- } else if (!metadata.required_skills.every((s) => typeof s === "string" && s.length > 0)) {
3765
- ctx.addIssue({
3766
- code: z.ZodIssueCode.custom,
3767
- message: "metadata.required_skills must be an array of non-empty strings",
3768
- path: ["metadata", "required_skills"]
3769
- });
3770
- }
3771
- }
3772
- if (metadata.fsm_gates !== void 0) {
3773
- if (!Array.isArray(metadata.fsm_gates)) {
3774
- ctx.addIssue({
3775
- code: z.ZodIssueCode.custom,
3776
- message: "metadata.fsm_gates must be an array of strings",
3777
- path: ["metadata", "fsm_gates"]
3778
- });
3779
- } else if (metadata.fsm_gates.length === 0) {
3780
- ctx.addIssue({
3781
- code: z.ZodIssueCode.custom,
3782
- message: "metadata.fsm_gates must not be empty when present",
3783
- path: ["metadata", "fsm_gates"]
3784
- });
3785
- } else if (!metadata.fsm_gates.every((s) => typeof s === "string" && s.length > 0)) {
3786
- ctx.addIssue({
3787
- code: z.ZodIssueCode.custom,
3788
- message: "metadata.fsm_gates must be an array of non-empty strings",
3789
- path: ["metadata", "fsm_gates"]
3790
- });
3791
- }
3792
- }
3793
- });
3794
- var SingleTaskCreateSchema = z.object({
3795
- task_code: z.string().min(1).optional(),
3796
- phase: z.string().min(1),
3797
- title: z.string().min(3).max(100),
3798
- description: z.string().min(1),
3799
- status: TaskStatusSchema.default("backlog"),
3800
- priority: TaskPrioritySchema.default(3),
3801
- agent: z.string().optional(),
3802
- role: z.string().optional(),
3803
- doc_path: z.string().optional(),
3804
- tags: z.array(z.string()).optional(),
3805
- suggested_skills: z.array(z.string()).optional(),
3806
- metadata: TaskMetadataSchema,
3807
- parent_id: z.string().optional(),
3808
- depends_on: z.string().optional(),
3809
- est_tokens: z.number().int().min(0).optional()
3810
- });
3811
- var TaskCreateSchema = z.object({
3812
- owner: z.string().min(1),
3813
- repo: z.string().min(1).transform(normalizeRepo),
3814
- // Allow single task fields at top level (backward compatibility & single use)
3815
- task_code: z.string().min(1).optional(),
3816
- phase: z.string().min(1).optional(),
3817
- title: z.string().min(3).max(100).optional(),
3818
- description: z.string().min(1).optional(),
3819
- status: TaskStatusSchema.optional(),
3820
- priority: TaskPrioritySchema.optional(),
3821
- agent: z.string().optional(),
3822
- role: z.string().optional(),
3823
- doc_path: z.string().optional(),
3824
- tags: z.array(z.string()).optional(),
3825
- suggested_skills: z.array(z.string()).optional(),
3826
- metadata: z.record(z.string(), z.any()).optional(),
3827
- parent_id: z.string().optional(),
3828
- depends_on: z.string().optional(),
3829
- est_tokens: z.number().int().min(0).optional(),
3830
- // Allow bulk tasks
3831
- tasks: z.array(SingleTaskCreateSchema).min(1).optional(),
3832
- structured: z.boolean().default(false)
3833
- }).refine(
3834
- (data) => {
3835
- if (data.tasks) return true;
3836
- return !!(data.phase && data.title && data.description);
3837
- },
3838
- { message: "Either 'tasks' array or single task fields (phase, title, description) must be provided" }
3839
- );
3840
- var TaskCreateInteractiveSchema = SingleTaskCreateSchema.partial().extend({
3841
- owner: z.string().optional().default(""),
3842
- repo: z.string().min(1).transform(normalizeRepo).optional(),
3843
- structured: z.boolean().default(false)
3844
- });
3845
- var TaskUpdateSchema = z.object({
3846
- owner: z.string().min(1),
3847
- repo: z.string().min(1).transform(normalizeRepo),
3848
- id: z.string().uuid().optional(),
3849
- ids: z.array(z.string().uuid()).min(1).optional(),
3850
- task_code: z.string().optional(),
3851
- phase: z.string().optional(),
3852
- title: z.string().min(3).max(100).optional(),
3853
- description: z.string().optional(),
3854
- status: TaskStatusSchema.optional(),
3855
- priority: TaskPrioritySchema.optional(),
3856
- agent: z.string().min(1, "agent name is required").optional(),
3857
- role: z.string().min(1, "agent role is required").optional(),
3858
- model: z.string().optional(),
3859
- comment: z.string().min(1).optional(),
3860
- doc_path: z.string().optional(),
3861
- tags: z.array(z.string()).optional(),
3862
- metadata: z.record(z.string(), z.any()).optional(),
3863
- suggested_skills: z.array(z.string()).optional(),
3864
- parent_id: z.string().optional(),
3865
- depends_on: z.string().optional(),
3866
- est_tokens: z.number().int().min(0).optional(),
3867
- commit_id: z.string().optional(),
3868
- changed_files: z.array(z.string()).optional(),
3869
- force: z.boolean().optional(),
3870
- structured: z.boolean().default(false)
3871
- }).refine((data) => data.id !== void 0 || data.ids !== void 0 || data.task_code !== void 0, {
3872
- message: "Either 'id', 'ids', or 'task_code' must be provided for update"
3873
- }).refine((data) => Object.keys(data).length > 2, {
3874
- message: "At least one field besides repo and id/ids must be provided for update"
3875
- });
3876
- var TaskStatusValues = TaskStatusSchema.options;
3877
- var TaskStatusListSchema = z.string().refine(
3878
- (val) => {
3879
- if (val === "all") return true;
3880
- const parts = val.split(",").map((s) => s.trim()).filter(Boolean);
3881
- if (parts.length === 0) return false;
3882
- return parts.every((p) => TaskStatusValues.includes(p));
3883
- },
3884
- { message: "status must be 'all' or a comma-separated list of valid TaskStatus values" }
3885
- );
3886
- var TaskListSchema = z.object({
3887
- owner: z.string().min(1),
3888
- repo: z.string().min(1).transform(normalizeRepo),
3889
- status: TaskStatusListSchema.default("backlog,pending,in_progress,blocked"),
3890
- phase: z.string().optional(),
3891
- query: z.string().optional(),
3892
- limit: z.number().min(1).max(100).default(15),
3893
- offset: z.number().min(0).default(0),
3894
- structured: z.boolean().default(false)
3895
- });
3896
- var TaskSearchSchema = z.object({
3897
- owner: z.string().min(1),
3898
- repo: z.string().min(1).transform(normalizeRepo),
3899
- query: z.string().min(1),
3900
- status: z.string().optional(),
3901
- phase: z.string().optional(),
3902
- priority: z.number().min(1).max(5).optional(),
3903
- limit: z.number().min(1).max(100).default(10),
3904
- offset: z.number().min(0).default(0),
3905
- structured: z.boolean().default(false)
3906
- });
3907
- var TaskDeleteSchema = z.object({
3908
- owner: z.string().min(1),
3909
- repo: z.string().min(1).transform(normalizeRepo),
3910
- id: z.string().uuid().optional(),
3911
- ids: z.array(z.string().uuid()).min(1).optional(),
3912
- task_code: z.string().optional(),
3913
- structured: z.boolean().default(false)
3914
- }).refine((data) => data.id !== void 0 || data.ids !== void 0 || data.task_code !== void 0, {
3915
- message: "Either 'id', 'ids', or 'task_code' must be provided for deletion"
3916
- });
3917
- var MemoryDetailSchema = z.object({
3918
- id: z.string().uuid().optional(),
3919
- code: z.string().max(20).optional(),
3920
- owner: z.string().min(1),
3921
- repo: z.string().min(1).transform(normalizeRepo),
3922
- structured: z.boolean().default(false)
3923
- }).refine((data) => data.id !== void 0 || data.code !== void 0, {
3924
- message: "Either id or code must be provided"
3925
- });
3926
- var StandardDetailSchema = z.object({
3927
- id: z.string().uuid().optional(),
3928
- code: z.string().max(20).optional(),
3929
- owner: z.string().min(1),
3930
- repo: z.string().min(1).transform(normalizeRepo),
3931
- structured: z.boolean().default(false)
3932
- }).refine((data) => data.id !== void 0 || data.code !== void 0, {
3933
- message: "Either id or code must be provided"
3934
- });
3935
- var StandardDeleteSchema = z.object({
3936
- owner: z.string().min(1),
3937
- repo: z.string().min(1).transform(normalizeRepo),
3938
- id: z.string().uuid().optional(),
3939
- ids: z.array(z.string().uuid()).min(1).optional(),
3940
- code: z.string().max(20).optional(),
3941
- codes: z.array(z.string().max(20)).min(1).optional(),
3942
- structured: z.boolean().default(false)
3943
- }).refine(
3944
- (data) => data.id !== void 0 || data.ids !== void 0 || data.code !== void 0 || data.codes !== void 0,
3945
- {
3946
- message: "Either 'id', 'ids', 'code', or 'codes' must be provided for deletion"
3947
- }
3948
- );
3949
- var TaskGetSchema = z.object({
3950
- owner: z.string().min(1),
3951
- repo: z.string().min(1).transform(normalizeRepo),
3952
- id: z.string().uuid().optional(),
3953
- task_code: z.string().optional(),
3954
- structured: z.boolean().default(false)
3955
- }).refine((data) => data.id !== void 0 || data.task_code !== void 0, {
3956
- message: "Either id or task_code must be provided"
3957
- });
3958
- var HandoffStatusSchema = z.enum(["pending", "accepted", "rejected", "expired"]);
3959
- var HandoffCreateSchema = z.object({
3960
- owner: z.string().min(1),
3961
- repo: z.string().min(1).transform(normalizeRepo),
3962
- from_agent: z.string().min(1),
3963
- to_agent: z.string().min(1).optional(),
3964
- task_id: z.string().uuid().optional(),
3965
- task_code: z.string().optional(),
3966
- summary: z.string().min(1),
3967
- context: z.record(z.string(), z.any()).optional(),
3968
- expires_at: z.string().optional(),
3969
- structured: z.boolean().default(false)
3970
- }).refine((data) => !(data.task_id && data.task_code), {
3971
- message: "Provide either task_id or task_code, not both"
3972
- }).refine(
3973
- (data) => data.to_agent || data.task_id || data.task_code || data.context?.next_steps || data.context?.blockers || data.context?.remaining_work,
3974
- {
3975
- message: "Handoffs must identify a target agent, linked task, next_steps, blockers, or remaining_work. Do not create pending handoffs for completed-work summaries."
3976
- }
3977
- );
3978
- var HandoffUpdateSchema = z.object({
3979
- id: z.string().uuid(),
3980
- status: HandoffStatusSchema,
3981
- structured: z.boolean().default(false)
3982
- });
3983
- var HandoffListSchema = z.object({
3984
- owner: z.string().min(1),
3985
- repo: z.string().min(1).transform(normalizeRepo),
3986
- status: HandoffStatusSchema.optional(),
3987
- from_agent: z.string().min(1).optional(),
3988
- to_agent: z.string().min(1).optional(),
3989
- limit: z.number().min(1).max(100).default(20),
3990
- offset: z.number().min(0).default(0),
3991
- structured: z.boolean().default(false)
3992
- });
3993
- var TaskClaimSchema = z.object({
3994
- owner: z.string().min(1),
3995
- repo: z.string().min(1).transform(normalizeRepo),
3996
- task_id: z.string().uuid().optional(),
3997
- task_code: z.string().optional(),
3998
- agent: z.string().min(1),
3999
- role: z.string().optional(),
4000
- metadata: z.record(z.string(), z.any()).optional(),
4001
- structured: z.boolean().default(false)
4002
- }).refine((data) => data.task_id !== void 0 || data.task_code !== void 0, {
4003
- message: "Either task_id or task_code must be provided"
4004
- }).refine((data) => !(data.task_id && data.task_code), {
4005
- message: "Provide either task_id or task_code, not both"
4006
- });
4007
- var ClaimListSchema = z.object({
4008
- owner: z.string().min(1),
4009
- repo: z.string().min(1).transform(normalizeRepo),
4010
- agent: z.string().min(1).optional(),
4011
- active_only: z.boolean().default(true),
4012
- limit: z.number().min(1).max(100).default(20),
4013
- offset: z.number().min(0).default(0),
4014
- structured: z.boolean().default(false)
4015
- });
4016
- var ClaimReleaseSchema = z.object({
4017
- owner: z.string().min(1),
4018
- repo: z.string().min(1).transform(normalizeRepo),
4019
- task_id: z.string().uuid().optional(),
4020
- task_code: z.string().optional(),
4021
- agent: z.string().min(1).optional(),
4022
- structured: z.boolean().default(false)
4023
- }).refine((data) => data.task_id !== void 0 || data.task_code !== void 0, {
4024
- message: "Either task_id or task_code must be provided"
4025
- }).refine((data) => !(data.task_id && data.task_code), {
4026
- message: "Provide either task_id or task_code, not both"
4027
- });
4028
- var StandardStoreSchema = z.object({
4029
- name: z.string().min(3).max(255).optional(),
4030
- content: z.string().min(10).optional(),
4031
- parent_id: z.string().optional(),
4032
- context: z.string().optional(),
4033
- version: z.string().optional(),
4034
- language: z.string().optional(),
4035
- stack: z.array(z.string()).optional(),
4036
- owner: z.string().min(1),
4037
- repo: z.string().transform(normalizeRepo).optional(),
4038
- is_global: z.boolean().optional(),
4039
- tags: z.array(z.string().min(1)).min(1).optional(),
4040
- metadata: z.record(z.string(), z.any()).refine((value) => Object.keys(value).length > 0, { message: "metadata must contain at least one key" }).optional(),
4041
- agent: z.string().optional(),
4042
- model: z.string().optional(),
4043
- structured: z.boolean().default(false),
4044
- standards: z.array(SingleStandardSchema).min(1).optional()
4045
- }).refine(
4046
- (data) => {
4047
- if (data.standards) return true;
4048
- return !!(data.name && data.content && data.tags && data.metadata);
4049
- },
4050
- { message: "Either 'standards' array or single standard fields (name, content, tags, metadata) must be provided" }
4051
- ).refine((data) => data.is_global !== false || !!data.repo, {
4052
- message: "repo is required for repo-specific standards"
4053
- });
4054
- var StandardUpdateSchema = z.object({
4055
- id: z.string().uuid().optional(),
4056
- code: z.string().max(20).optional(),
4057
- name: z.string().min(3).max(255).optional(),
4058
- content: z.string().min(10).optional(),
4059
- parent_id: z.string().nullable().optional(),
4060
- context: z.string().optional(),
4061
- version: z.string().optional(),
4062
- language: z.string().optional(),
4063
- stack: z.array(z.string().min(1)).min(1).optional(),
4064
- owner: z.string().min(1),
4065
- repo: z.string().transform(normalizeRepo),
4066
- is_global: z.boolean().optional(),
4067
- tags: z.array(z.string().min(1)).min(1).optional(),
4068
- metadata: z.record(z.string(), z.any()).refine((value) => Object.keys(value).length > 0, { message: "metadata must contain at least one key" }).optional(),
4069
- agent: z.string().optional(),
4070
- model: z.string().optional(),
4071
- structured: z.boolean().default(false)
4072
- }).refine((data) => data.id !== void 0 || data.code !== void 0, {
4073
- message: "Either id or code must be provided"
4074
- }).refine(
4075
- (data) => data.name !== void 0 || data.content !== void 0 || data.parent_id !== void 0 || data.context !== void 0 || data.version !== void 0 || data.language !== void 0 || data.stack !== void 0 || data.repo !== void 0 || data.is_global !== void 0 || data.tags !== void 0 || data.metadata !== void 0 || data.agent !== void 0 || data.model !== void 0,
4076
- { message: "At least one field must be provided for update" }
4077
- ).refine((data) => data.is_global !== false || !!data.repo, {
4078
- message: "repo is required for repo-specific standards"
4079
- });
4080
- var StandardSearchSchema = z.object({
4081
- query: z.string().optional(),
4082
- stack: z.array(z.string()).optional(),
4083
- tags: z.array(z.string()).optional(),
4084
- language: z.string().optional(),
4085
- context: z.string().optional(),
4086
- version: z.string().optional(),
4087
- owner: z.string().optional().default(""),
4088
- repo: z.string().transform(normalizeRepo).optional(),
4089
- is_global: z.boolean().optional(),
4090
- limit: z.number().min(1).max(100).default(20),
4091
- offset: z.number().min(0).default(0),
4092
- structured: z.boolean().default(false)
4093
- });
3589
+ // src/mcp/tools/tool-definitions.ts
4094
3590
  var TOOL_DEFINITIONS = [
4095
3591
  {
4096
3592
  name: "memory-synthesize",
@@ -4182,7 +3678,8 @@ var TOOL_DEFINITIONS = [
4182
3678
  role: { type: "string" },
4183
3679
  doc_path: { type: "string" },
4184
3680
  structured: { type: "boolean", default: false, description: "If true, returns structured JSON result." }
4185
- }
3681
+ },
3682
+ required: ["owner"]
4186
3683
  },
4187
3684
  outputSchema: {
4188
3685
  type: "object",
@@ -4203,16 +3700,26 @@ var TOOL_DEFINITIONS = [
4203
3700
  description: "Fetch full details of a specific memory by ID or short code. Use after memory-recap or memory-search when a pointer row is relevant and full content is needed.",
4204
3701
  inputSchema: {
4205
3702
  type: "object",
4206
- properties: {
4207
- id: { type: "string", format: "uuid", description: "Memory entry ID. Optional if code is provided." },
4208
- code: { type: "string", description: "Short memory code. Optional if id is provided." },
4209
- owner: {
4210
- type: "string",
4211
- description: "Organization/namespace (e.g., GitHub org or username). Required when using code."
3703
+ oneOf: [
3704
+ {
3705
+ title: "By ID",
3706
+ required: ["id"],
3707
+ properties: {
3708
+ id: { type: "string", format: "uuid", description: "Memory entry ID." },
3709
+ structured: { type: "boolean", default: false, description: "If true, returns structured JSON details." }
3710
+ }
4212
3711
  },
4213
- repo: { type: "string", description: "Repository/project name. Required when using code." },
4214
- structured: { type: "boolean", default: false, description: "If true, returns structured JSON details." }
4215
- }
3712
+ {
3713
+ title: "By code",
3714
+ required: ["code", "owner", "repo"],
3715
+ properties: {
3716
+ code: { type: "string", description: "Short memory code." },
3717
+ owner: { type: "string", description: "Organization/namespace (e.g., GitHub org or username)." },
3718
+ repo: { type: "string", description: "Repository/project name." },
3719
+ structured: { type: "boolean", default: false, description: "If true, returns structured JSON details." }
3720
+ }
3721
+ }
3722
+ ]
4216
3723
  }
4217
3724
  },
4218
3725
  {
@@ -4221,16 +3728,26 @@ var TOOL_DEFINITIONS = [
4221
3728
  description: "Fetch full details of a specific coding standard by ID or short code. Use after standard-search when a result is relevant and full guidance is needed.",
4222
3729
  inputSchema: {
4223
3730
  type: "object",
4224
- properties: {
4225
- id: { type: "string", format: "uuid", description: "Coding standard ID. Optional if code is provided." },
4226
- code: { type: "string", description: "Short standard code (e.g. 'A3KPQ2'). Optional if id is provided." },
4227
- owner: {
4228
- type: "string",
4229
- description: "Organization/namespace (e.g., GitHub org or username). Required when using code."
3731
+ oneOf: [
3732
+ {
3733
+ title: "By ID",
3734
+ required: ["id"],
3735
+ properties: {
3736
+ id: { type: "string", format: "uuid", description: "Coding standard ID." },
3737
+ structured: { type: "boolean", default: false, description: "If true, returns structured JSON details." }
3738
+ }
4230
3739
  },
4231
- repo: { type: "string", description: "Repository/project name. Required when using code." },
4232
- structured: { type: "boolean", default: false, description: "If true, returns structured JSON details." }
4233
- }
3740
+ {
3741
+ title: "By code",
3742
+ required: ["code", "owner", "repo"],
3743
+ properties: {
3744
+ code: { type: "string", description: "Short standard code (e.g. 'A3KPQ2')." },
3745
+ owner: { type: "string", description: "Organization/namespace (e.g., GitHub org or username)." },
3746
+ repo: { type: "string", description: "Repository/project name." },
3747
+ structured: { type: "boolean", default: false, description: "If true, returns structured JSON details." }
3748
+ }
3749
+ }
3750
+ ]
4234
3751
  }
4235
3752
  },
4236
3753
  {
@@ -4239,18 +3756,55 @@ var TOOL_DEFINITIONS = [
4239
3756
  description: "Fetch full details of a specific task by ID or task code. Use this when you have a task ID or code and need to read the full description and comments.",
4240
3757
  inputSchema: {
4241
3758
  type: "object",
4242
- properties: {
4243
- owner: { type: "string", description: "Organization/namespace (e.g., GitHub org or username)" },
4244
- repo: { type: "string", description: "Repository name" },
4245
- id: { type: "string", format: "uuid", description: "Task ID (optional if task_code is provided)" },
4246
- task_code: { type: "string", description: "Task code (e.g. TASK-001) (optional if id is provided)" },
4247
- structured: {
4248
- type: "boolean",
4249
- default: false,
4250
- description: "If true, returns structured JSON without the text content details."
3759
+ oneOf: [
3760
+ {
3761
+ title: "By ID",
3762
+ required: ["owner", "repo", "id"],
3763
+ properties: {
3764
+ owner: { type: "string", description: "Organization/namespace (e.g., GitHub org or username)" },
3765
+ repo: { type: "string", description: "Repository name" },
3766
+ id: { type: "string", format: "uuid", description: "Task ID" },
3767
+ structured: {
3768
+ type: "boolean",
3769
+ default: false,
3770
+ description: "If true, returns structured JSON without the text content details."
3771
+ }
3772
+ }
3773
+ },
3774
+ {
3775
+ title: "By task_code",
3776
+ required: ["owner", "repo", "task_code"],
3777
+ properties: {
3778
+ owner: { type: "string", description: "Organization/namespace (e.g., GitHub org or username)" },
3779
+ repo: { type: "string", description: "Repository name" },
3780
+ task_code: { type: "string", description: "Task code (e.g. TASK-001)" },
3781
+ structured: {
3782
+ type: "boolean",
3783
+ default: false,
3784
+ description: "If true, returns structured JSON without the text content details."
3785
+ }
3786
+ }
3787
+ },
3788
+ {
3789
+ title: "By task_codes",
3790
+ required: ["owner", "repo", "task_codes"],
3791
+ properties: {
3792
+ owner: { type: "string", description: "Organization/namespace (e.g., GitHub org or username)" },
3793
+ repo: { type: "string", description: "Repository name" },
3794
+ task_codes: {
3795
+ type: "array",
3796
+ items: { type: "string" },
3797
+ minItems: 1,
3798
+ description: "Array of task codes (e.g. TASK-001)"
3799
+ },
3800
+ structured: {
3801
+ type: "boolean",
3802
+ default: false,
3803
+ description: "If true, returns structured JSON without the text content details."
3804
+ }
3805
+ }
4251
3806
  }
4252
- },
4253
- required: ["repo", "owner"]
3807
+ ]
4254
3808
  }
4255
3809
  },
4256
3810
  {
@@ -4265,118 +3819,133 @@ var TOOL_DEFINITIONS = [
4265
3819
  },
4266
3820
  inputSchema: {
4267
3821
  type: "object",
4268
- properties: {
4269
- type: {
4270
- type: "string",
4271
- enum: ["code_fact", "decision", "mistake", "pattern", "task_archive"],
4272
- description: "Type of durable knowledge being stored. Coordination types such as file_claim are intentionally unsupported."
4273
- },
4274
- title: {
4275
- type: "string",
4276
- minLength: 3,
4277
- maxLength: 100,
4278
- description: "Short human-readable title for the memory. Do not embed bracketed metadata like agent/role/date prefixes here."
4279
- },
4280
- content: {
4281
- type: "string",
4282
- minLength: 10,
4283
- description: "The memory content"
4284
- },
4285
- importance: {
4286
- type: "number",
4287
- minimum: 1,
4288
- maximum: 5,
4289
- description: "Importance score (1-5)"
4290
- },
4291
- agent: {
4292
- type: "string",
4293
- description: "Name of the agent creating this memory"
4294
- },
4295
- role: {
4296
- type: "string",
4297
- description: "Role of the agent creating this memory"
4298
- },
4299
- model: {
4300
- type: "string",
4301
- description: "AI model used by the agent"
4302
- },
4303
- scope: {
4304
- type: "object",
3822
+ oneOf: [
3823
+ {
3824
+ title: "Single memory",
3825
+ required: ["type", "title", "content", "importance", "agent", "model", "scope"],
4305
3826
  properties: {
4306
- owner: { type: "string", description: "Organization/namespace (e.g., GitHub org or username)" },
4307
- repo: { type: "string", description: "Repository/project name" },
4308
- branch: { type: "string", description: "Git branch this memory relates to" },
4309
- folder: { type: "string", description: "Subdirectory within the repo" },
4310
- language: { type: "string", description: "Programming language (e.g., 'typescript', 'python')" }
4311
- },
4312
- required: ["owner", "repo"]
4313
- },
4314
- tags: {
4315
- type: "array",
4316
- items: { type: "string" },
4317
- description: "Technology stack tags (e.g., ['filament', 'laravel'])"
4318
- },
4319
- metadata: {
4320
- type: "object",
4321
- description: "Structured metadata for non-title context such as source agent, claim fields, or timestamps"
4322
- },
4323
- is_global: {
4324
- type: "boolean",
4325
- description: "If true, this memory is shared across all repositories"
4326
- },
4327
- ttlDays: {
4328
- type: "number",
4329
- minimum: 1,
4330
- description: "Time-to-live in days. After this period, the memory expires."
4331
- },
4332
- supersedes: {
4333
- type: "string",
4334
- description: "Optional memory ID (UUID) or memory code to supersede. Resolved before storing."
4335
- },
4336
- memories: {
4337
- type: "array",
4338
- items: {
4339
- type: "object",
4340
- properties: {
4341
- type: {
4342
- type: "string",
4343
- enum: ["code_fact", "decision", "mistake", "pattern", "task_archive"],
4344
- description: "Type of durable knowledge being stored"
3827
+ type: {
3828
+ type: "string",
3829
+ enum: ["code_fact", "decision", "mistake", "pattern", "task_archive"],
3830
+ description: "Type of durable knowledge being stored. Coordination types such as file_claim are intentionally unsupported."
3831
+ },
3832
+ title: {
3833
+ type: "string",
3834
+ minLength: 3,
3835
+ maxLength: 100,
3836
+ description: "Short human-readable title for the memory. Do not embed bracketed metadata like agent/role/date prefixes here."
3837
+ },
3838
+ content: {
3839
+ type: "string",
3840
+ minLength: 10,
3841
+ description: "The memory content"
3842
+ },
3843
+ importance: {
3844
+ type: "number",
3845
+ minimum: 1,
3846
+ maximum: 5,
3847
+ description: "Importance score (1-5)"
3848
+ },
3849
+ agent: {
3850
+ type: "string",
3851
+ description: "Name of the agent creating this memory"
3852
+ },
3853
+ role: {
3854
+ type: "string",
3855
+ description: "Role of the agent creating this memory"
3856
+ },
3857
+ model: {
3858
+ type: "string",
3859
+ description: "AI model used by the agent"
3860
+ },
3861
+ scope: {
3862
+ type: "object",
3863
+ properties: {
3864
+ owner: { type: "string", description: "Organization/namespace (e.g., GitHub org or username)" },
3865
+ repo: { type: "string", description: "Repository/project name" },
3866
+ branch: { type: "string", description: "Git branch this memory relates to" },
3867
+ folder: { type: "string", description: "Subdirectory within the repo" },
3868
+ language: { type: "string", description: "Programming language (e.g., 'typescript', 'python')" }
4345
3869
  },
4346
- title: { type: "string", minLength: 3, maxLength: 100, description: "Short human-readable title" },
4347
- content: { type: "string", minLength: 10, description: "The memory content" },
4348
- importance: { type: "number", minimum: 1, maximum: 5, description: "Importance score (1-5)" },
4349
- agent: { type: "string", description: "Name of the agent creating this memory" },
4350
- role: { type: "string", default: "unknown", description: "Role of the agent creating this memory" },
4351
- model: { type: "string", description: "AI model used by the agent" },
4352
- scope: {
3870
+ required: ["owner", "repo"]
3871
+ },
3872
+ code: { type: "string", maxLength: 20, description: "Optional custom code. Auto-generated if omitted." },
3873
+ tags: {
3874
+ type: "array",
3875
+ items: { type: "string" },
3876
+ description: "Technology stack tags (e.g., ['filament', 'laravel'])"
3877
+ },
3878
+ metadata: {
3879
+ type: "object",
3880
+ description: "Structured metadata for non-title context such as source agent, claim fields, or timestamps"
3881
+ },
3882
+ is_global: { type: "boolean", description: "If true, this memory is shared across all repositories" },
3883
+ ttlDays: {
3884
+ type: "number",
3885
+ minimum: 1,
3886
+ description: "Time-to-live in days. After this period, the memory expires."
3887
+ },
3888
+ supersedes: {
3889
+ type: "string",
3890
+ description: "Optional memory ID (UUID) or memory code to supersede. Resolved before storing."
3891
+ },
3892
+ structured: {
3893
+ type: "boolean",
3894
+ default: false,
3895
+ description: "If true, returns structured JSON of the stored memory."
3896
+ }
3897
+ }
3898
+ },
3899
+ {
3900
+ title: "Bulk memories",
3901
+ required: ["memories"],
3902
+ properties: {
3903
+ memories: {
3904
+ type: "array",
3905
+ items: {
4353
3906
  type: "object",
4354
3907
  properties: {
4355
- owner: { type: "string", description: "Organization/namespace (e.g., GitHub org or username)" },
4356
- repo: { type: "string", description: "Repository/project name" },
4357
- branch: { type: "string", description: "Git branch this memory relates to" },
4358
- folder: { type: "string", description: "Subdirectory within the repo" },
4359
- language: { type: "string", description: "Programming language" }
3908
+ type: {
3909
+ type: "string",
3910
+ enum: ["code_fact", "decision", "mistake", "pattern", "task_archive"],
3911
+ description: "Type of durable knowledge being stored"
3912
+ },
3913
+ title: { type: "string", minLength: 3, maxLength: 100, description: "Short human-readable title" },
3914
+ content: { type: "string", minLength: 10, description: "The memory content" },
3915
+ importance: { type: "number", minimum: 1, maximum: 5, description: "Importance score (1-5)" },
3916
+ agent: { type: "string", description: "Name of the agent creating this memory" },
3917
+ role: { type: "string", default: "unknown", description: "Role of the agent creating this memory" },
3918
+ model: { type: "string", description: "AI model used by the agent" },
3919
+ scope: {
3920
+ type: "object",
3921
+ properties: {
3922
+ owner: { type: "string", description: "Organization/namespace (e.g., GitHub org or username)" },
3923
+ repo: { type: "string", description: "Repository/project name" },
3924
+ branch: { type: "string", description: "Git branch this memory relates to" },
3925
+ folder: { type: "string", description: "Subdirectory within the repo" },
3926
+ language: { type: "string", description: "Programming language" }
3927
+ },
3928
+ required: ["owner", "repo"]
3929
+ },
3930
+ code: { type: "string", description: "Optional custom code. Auto-generated if omitted." },
3931
+ ttlDays: { type: "number", minimum: 1, description: "Time-to-live in days" },
3932
+ supersedes: { type: "string", description: "UUID or code of a memory this entry replaces" },
3933
+ tags: { type: "array", items: { type: "string" }, description: "Technology stack tags" },
3934
+ metadata: { type: "object", description: "Structured metadata for non-title context" },
3935
+ is_global: { type: "boolean", default: false, description: "If true, shared across all repositories" }
4360
3936
  },
4361
- required: ["owner", "repo"]
3937
+ required: ["type", "title", "content", "importance", "agent", "model", "scope"]
4362
3938
  },
4363
- code: { type: "string", description: "Optional custom code. Auto-generated if omitted." },
4364
- ttlDays: { type: "number", minimum: 1, description: "Time-to-live in days" },
4365
- supersedes: { type: "string", description: "UUID or code of a memory this entry replaces" },
4366
- tags: { type: "array", items: { type: "string" }, description: "Technology stack tags" },
4367
- metadata: { type: "object", description: "Structured metadata for non-title context" },
4368
- is_global: { type: "boolean", default: false, description: "If true, shared across all repositories" }
3939
+ description: "Array of memories for bulk creation"
4369
3940
  },
4370
- required: ["type", "title", "content", "importance", "agent", "model", "scope"]
4371
- },
4372
- description: "Array of memories for bulk creation"
4373
- },
4374
- structured: {
4375
- type: "boolean",
4376
- default: false,
4377
- description: "If true, returns structured JSON of the stored memory."
3941
+ structured: {
3942
+ type: "boolean",
3943
+ default: false,
3944
+ description: "If true, returns structured JSON of the stored memory."
3945
+ }
3946
+ }
4378
3947
  }
4379
- }
3948
+ ]
4380
3949
  },
4381
3950
  outputSchema: {
4382
3951
  type: "object",
@@ -4435,30 +4004,60 @@ var TOOL_DEFINITIONS = [
4435
4004
  },
4436
4005
  inputSchema: {
4437
4006
  type: "object",
4438
- properties: {
4439
- id: { type: "string", format: "uuid", description: "Memory entry ID. Optional if code is provided." },
4440
- code: { type: "string", maxLength: 20, description: "Short memory code. Optional if id is provided." },
4441
- type: {
4442
- type: "string",
4443
- enum: ["code_fact", "decision", "mistake", "pattern", "task_archive"]
4007
+ oneOf: [
4008
+ {
4009
+ title: "By ID",
4010
+ required: ["owner", "repo", "id"],
4011
+ properties: {
4012
+ owner: { type: "string", description: "Organization/namespace (e.g., GitHub org or username)" },
4013
+ repo: { type: "string", description: "Repository name" },
4014
+ id: { type: "string", format: "uuid", description: "Memory entry ID." },
4015
+ type: { type: "string", enum: ["code_fact", "decision", "mistake", "pattern", "task_archive"] },
4016
+ title: { type: "string", minLength: 3, maxLength: 100 },
4017
+ content: { type: "string", minLength: 10 },
4018
+ importance: { type: "number", minimum: 1, maximum: 5 },
4019
+ agent: { type: "string" },
4020
+ role: { type: "string" },
4021
+ status: { type: "string", enum: ["active", "archived"] },
4022
+ supersedes: { type: "string" },
4023
+ tags: { type: "array", items: { type: "string" } },
4024
+ metadata: { type: "object" },
4025
+ is_global: { type: "boolean" },
4026
+ completed_at: { type: "string" },
4027
+ structured: {
4028
+ type: "boolean",
4029
+ default: false,
4030
+ description: "If true, returns structured JSON of the updated memory."
4031
+ }
4032
+ }
4444
4033
  },
4445
- title: { type: "string", minLength: 3, maxLength: 100 },
4446
- content: { type: "string", minLength: 10 },
4447
- importance: { type: "number", minimum: 1, maximum: 5 },
4448
- agent: { type: "string" },
4449
- role: { type: "string" },
4450
- status: { type: "string", enum: ["active", "archived"] },
4451
- supersedes: { type: "string" },
4452
- tags: { type: "array", items: { type: "string" } },
4453
- metadata: { type: "object" },
4454
- is_global: { type: "boolean" },
4455
- completed_at: { type: "string" },
4456
- structured: {
4457
- type: "boolean",
4458
- default: false,
4459
- description: "If true, returns structured JSON of the updated memory."
4034
+ {
4035
+ title: "By code",
4036
+ required: ["owner", "repo", "code"],
4037
+ properties: {
4038
+ owner: { type: "string", description: "Organization/namespace (e.g., GitHub org or username)" },
4039
+ repo: { type: "string", description: "Repository name" },
4040
+ code: { type: "string", maxLength: 20, description: "Short memory code." },
4041
+ type: { type: "string", enum: ["code_fact", "decision", "mistake", "pattern", "task_archive"] },
4042
+ title: { type: "string", minLength: 3, maxLength: 100 },
4043
+ content: { type: "string", minLength: 10 },
4044
+ importance: { type: "number", minimum: 1, maximum: 5 },
4045
+ agent: { type: "string" },
4046
+ role: { type: "string" },
4047
+ status: { type: "string", enum: ["active", "archived"] },
4048
+ supersedes: { type: "string" },
4049
+ tags: { type: "array", items: { type: "string" } },
4050
+ metadata: { type: "object" },
4051
+ is_global: { type: "boolean" },
4052
+ completed_at: { type: "string" },
4053
+ structured: {
4054
+ type: "boolean",
4055
+ default: false,
4056
+ description: "If true, returns structured JSON of the updated memory."
4057
+ }
4058
+ }
4460
4059
  }
4461
- }
4060
+ ]
4462
4061
  },
4463
4062
  outputSchema: {
4464
4063
  type: "object",
@@ -4612,24 +4211,58 @@ var TOOL_DEFINITIONS = [
4612
4211
  },
4613
4212
  inputSchema: {
4614
4213
  type: "object",
4615
- properties: {
4616
- repo: { type: "string", description: "Repository name (optional for single id)" },
4617
- id: { type: "string", format: "uuid", description: "Memory entry ID to delete. Optional if code is provided." },
4618
- ids: {
4619
- type: "array",
4620
- items: { type: "string", format: "uuid" },
4621
- minItems: 1,
4622
- description: "Array of memory IDs to delete"
4214
+ oneOf: [
4215
+ {
4216
+ title: "By single ID",
4217
+ required: ["owner", "repo", "id"],
4218
+ properties: {
4219
+ owner: { type: "string", description: "Organization/namespace (e.g., GitHub org or username)" },
4220
+ repo: { type: "string", description: "Repository name." },
4221
+ id: { type: "string", format: "uuid", description: "Memory entry ID to delete." },
4222
+ structured: { type: "boolean", default: false, description: "If true, returns structured JSON result." }
4223
+ }
4623
4224
  },
4624
- code: { type: "string", maxLength: 20, description: "Short memory code. Optional if id is provided." },
4625
- codes: {
4626
- type: "array",
4627
- items: { type: "string", maxLength: 20 },
4628
- minItems: 1,
4629
- description: "Array of memory codes to delete"
4225
+ {
4226
+ title: "By bulk IDs",
4227
+ required: ["owner", "repo", "ids"],
4228
+ properties: {
4229
+ owner: { type: "string", description: "Organization/namespace (e.g., GitHub org or username)" },
4230
+ repo: { type: "string", description: "Repository name." },
4231
+ ids: {
4232
+ type: "array",
4233
+ items: { type: "string", format: "uuid" },
4234
+ minItems: 1,
4235
+ description: "Array of memory IDs to delete"
4236
+ },
4237
+ structured: { type: "boolean", default: false, description: "If true, returns structured JSON result." }
4238
+ }
4630
4239
  },
4631
- structured: { type: "boolean", default: false, description: "If true, returns structured JSON result." }
4632
- }
4240
+ {
4241
+ title: "By single code",
4242
+ required: ["owner", "repo", "code"],
4243
+ properties: {
4244
+ owner: { type: "string", description: "Organization/namespace (e.g., GitHub org or username)" },
4245
+ repo: { type: "string", description: "Repository name." },
4246
+ code: { type: "string", maxLength: 20, description: "Short memory code." },
4247
+ structured: { type: "boolean", default: false, description: "If true, returns structured JSON result." }
4248
+ }
4249
+ },
4250
+ {
4251
+ title: "By bulk codes",
4252
+ required: ["owner", "repo", "codes"],
4253
+ properties: {
4254
+ owner: { type: "string", description: "Organization/namespace (e.g., GitHub org or username)" },
4255
+ repo: { type: "string", description: "Repository name." },
4256
+ codes: {
4257
+ type: "array",
4258
+ items: { type: "string", maxLength: 20 },
4259
+ minItems: 1,
4260
+ description: "Array of memory codes to delete"
4261
+ },
4262
+ structured: { type: "boolean", default: false, description: "If true, returns structured JSON result." }
4263
+ }
4264
+ }
4265
+ ]
4633
4266
  },
4634
4267
  outputSchema: {
4635
4268
  type: "object",
@@ -4657,28 +4290,58 @@ var TOOL_DEFINITIONS = [
4657
4290
  },
4658
4291
  inputSchema: {
4659
4292
  type: "object",
4660
- properties: {
4661
- repo: { type: "string", description: "Repository name (optional for single id)" },
4662
- id: {
4663
- type: "string",
4664
- format: "uuid",
4665
- description: "Coding standard ID to delete. Optional if code is provided."
4293
+ oneOf: [
4294
+ {
4295
+ title: "By single ID",
4296
+ required: ["owner", "repo", "id"],
4297
+ properties: {
4298
+ owner: { type: "string", description: "Organization/namespace (e.g., GitHub org or username)" },
4299
+ repo: { type: "string", description: "Repository name." },
4300
+ id: { type: "string", format: "uuid", description: "Coding standard ID to delete." },
4301
+ structured: { type: "boolean", default: false, description: "If true, returns structured JSON result." }
4302
+ }
4666
4303
  },
4667
- ids: {
4668
- type: "array",
4669
- items: { type: "string", format: "uuid" },
4670
- minItems: 1,
4671
- description: "Array of coding standard IDs to delete"
4304
+ {
4305
+ title: "By bulk IDs",
4306
+ required: ["owner", "repo", "ids"],
4307
+ properties: {
4308
+ owner: { type: "string", description: "Organization/namespace (e.g., GitHub org or username)" },
4309
+ repo: { type: "string", description: "Repository name." },
4310
+ ids: {
4311
+ type: "array",
4312
+ items: { type: "string", format: "uuid" },
4313
+ minItems: 1,
4314
+ description: "Array of coding standard IDs to delete"
4315
+ },
4316
+ structured: { type: "boolean", default: false, description: "If true, returns structured JSON result." }
4317
+ }
4672
4318
  },
4673
- code: { type: "string", maxLength: 20, description: "Short standard code. Optional if id is provided." },
4674
- codes: {
4675
- type: "array",
4676
- items: { type: "string", maxLength: 20 },
4677
- minItems: 1,
4678
- description: "Array of standard codes to delete"
4319
+ {
4320
+ title: "By single code",
4321
+ required: ["owner", "repo", "code"],
4322
+ properties: {
4323
+ owner: { type: "string", description: "Organization/namespace (e.g., GitHub org or username)" },
4324
+ repo: { type: "string", description: "Repository name." },
4325
+ code: { type: "string", maxLength: 20, description: "Short standard code." },
4326
+ structured: { type: "boolean", default: false, description: "If true, returns structured JSON result." }
4327
+ }
4679
4328
  },
4680
- structured: { type: "boolean", default: false, description: "If true, returns structured JSON result." }
4681
- }
4329
+ {
4330
+ title: "By bulk codes",
4331
+ required: ["owner", "repo", "codes"],
4332
+ properties: {
4333
+ owner: { type: "string", description: "Organization/namespace (e.g., GitHub org or username)" },
4334
+ repo: { type: "string", description: "Repository name." },
4335
+ codes: {
4336
+ type: "array",
4337
+ items: { type: "string", maxLength: 20 },
4338
+ minItems: 1,
4339
+ description: "Array of standard codes to delete"
4340
+ },
4341
+ structured: { type: "boolean", default: false, description: "If true, returns structured JSON result." }
4342
+ }
4343
+ }
4344
+ ]
4682
4345
  },
4683
4346
  outputSchema: {
4684
4347
  type: "object",
@@ -4892,68 +4555,269 @@ var TOOL_DEFINITIONS = [
4892
4555
  },
4893
4556
  inputSchema: {
4894
4557
  type: "object",
4895
- properties: {
4896
- owner: { type: "string", description: "Organization/namespace (e.g., GitHub org or username)" },
4897
- repo: { type: "string", description: "Repository name" },
4898
- id: { type: "string", format: "uuid", description: "Task ID (for single update)" },
4899
- ids: { type: "array", items: { type: "string", format: "uuid" }, description: "Task IDs (for bulk update)" },
4900
- task_code: { type: "string" },
4901
- phase: { type: "string" },
4902
- title: { type: "string", minLength: 3, maxLength: 100 },
4903
- description: {
4904
- type: "string",
4905
- description: "Detailed description. MUST follow format: 1. Context & Analysis, 2. Step & Implementation, 3. Acceptance & Verification"
4906
- },
4907
- status: {
4908
- type: "string",
4909
- enum: ["backlog", "pending", "in_progress", "completed", "canceled", "blocked"],
4910
- description: "New status. Transitions from 'backlog', 'pending' or 'blocked' to 'completed' are NOT allowed."
4911
- },
4912
- priority: {
4913
- type: "number",
4914
- minimum: 1,
4915
- maximum: 5,
4916
- description: "Task priority where 1=Low, 2=Normal, 3=Medium, 4=High, 5=Critical."
4917
- },
4918
- agent: { type: "string" },
4919
- role: { type: "string" },
4920
- model: { type: "string" },
4921
- comment: {
4922
- type: "string",
4923
- description: "REQUIRED when changing task status. Explain WHY the status is changing (e.g., 'Starting implementation', 'Blocked by missing API docs', 'Verified fix')."
4924
- },
4925
- doc_path: { type: "string" },
4926
- tags: { type: "array", items: { type: "string" } },
4927
- metadata: { type: "object" },
4928
- parent_id: {
4929
- type: "string",
4930
- description: "Optional parent task ID (UUID) or parent task code (e.g. TASK-001). Resolved to UUID before storing."
4931
- },
4932
- depends_on: {
4933
- type: "string",
4934
- description: "Optional task ID (UUID) or task code (e.g. TASK-001). Resolved to UUID before storing."
4935
- },
4936
- est_tokens: {
4937
- type: "number",
4938
- minimum: 0,
4939
- description: "Estimated total tokens actually used for this task. Required when status changes to 'completed'."
4940
- },
4941
- commit_id: {
4942
- type: "string",
4943
- description: "Git commit hash. Recommended when status changes to 'completed' for traceability."
4558
+ oneOf: [
4559
+ {
4560
+ title: "By ID",
4561
+ required: ["owner", "repo", "id"],
4562
+ properties: {
4563
+ owner: { type: "string", description: "Organization/namespace (e.g., GitHub org or username)" },
4564
+ repo: { type: "string", description: "Repository name" },
4565
+ id: { type: "string", format: "uuid", description: "Task ID (for single update)" },
4566
+ phase: { type: "string" },
4567
+ title: { type: "string", minLength: 3, maxLength: 100 },
4568
+ description: {
4569
+ type: "string",
4570
+ description: "Detailed description. MUST follow format: 1. Context & Analysis, 2. Step & Implementation, 3. Acceptance & Verification"
4571
+ },
4572
+ status: {
4573
+ type: "string",
4574
+ enum: ["backlog", "pending", "in_progress", "completed", "canceled", "blocked"],
4575
+ description: "New status. Transitions from 'backlog', 'pending' or 'blocked' to 'completed' are NOT allowed."
4576
+ },
4577
+ priority: {
4578
+ type: "number",
4579
+ minimum: 1,
4580
+ maximum: 5,
4581
+ description: "Task priority where 1=Low, 2=Normal, 3=Medium, 4=High, 5=Critical."
4582
+ },
4583
+ agent: { type: "string" },
4584
+ role: { type: "string" },
4585
+ model: { type: "string" },
4586
+ comment: {
4587
+ type: "string",
4588
+ description: "REQUIRED when changing task status. Explain WHY the status is changing (e.g., 'Starting implementation', 'Blocked by missing API docs', 'Verified fix')."
4589
+ },
4590
+ doc_path: { type: "string" },
4591
+ tags: { type: "array", items: { type: "string" } },
4592
+ metadata: { type: "object" },
4593
+ parent_id: {
4594
+ type: "string",
4595
+ description: "Optional parent task ID (UUID) or parent task code (e.g. TASK-001). Resolved to UUID before storing."
4596
+ },
4597
+ depends_on: {
4598
+ type: "string",
4599
+ description: "Optional task ID (UUID) or task code (e.g. TASK-001). Resolved to UUID before storing."
4600
+ },
4601
+ est_tokens: {
4602
+ type: "number",
4603
+ minimum: 0,
4604
+ description: "Estimated total tokens actually used for this task. Required when status changes to 'completed'."
4605
+ },
4606
+ commit_id: {
4607
+ type: "string",
4608
+ description: "Git commit hash. Recommended when status changes to 'completed' for traceability."
4609
+ },
4610
+ changed_files: {
4611
+ type: "array",
4612
+ items: { type: "string" },
4613
+ description: "List of files changed. Recommended when status changes to 'completed' for traceability."
4614
+ },
4615
+ force: {
4616
+ type: "boolean",
4617
+ description: "If true, bypasses status transition validation (e.g. pending -> completed)."
4618
+ },
4619
+ structured: { type: "boolean", default: false, description: "If true, returns structured JSON result." }
4620
+ }
4944
4621
  },
4945
- changed_files: {
4946
- type: "array",
4947
- items: { type: "string" },
4948
- description: "List of files changed. Recommended when status changes to 'completed' for traceability."
4622
+ {
4623
+ title: "By IDs",
4624
+ required: ["owner", "repo", "ids"],
4625
+ properties: {
4626
+ owner: { type: "string", description: "Organization/namespace (e.g., GitHub org or username)" },
4627
+ repo: { type: "string", description: "Repository name" },
4628
+ ids: {
4629
+ type: "array",
4630
+ items: { type: "string", format: "uuid" },
4631
+ description: "Task IDs (for bulk update)"
4632
+ },
4633
+ phase: { type: "string" },
4634
+ title: { type: "string", minLength: 3, maxLength: 100 },
4635
+ description: {
4636
+ type: "string",
4637
+ description: "Detailed description. MUST follow format: 1. Context & Analysis, 2. Step & Implementation, 3. Acceptance & Verification"
4638
+ },
4639
+ status: {
4640
+ type: "string",
4641
+ enum: ["backlog", "pending", "in_progress", "completed", "canceled", "blocked"],
4642
+ description: "New status. Transitions from 'backlog', 'pending' or 'blocked' to 'completed' are NOT allowed."
4643
+ },
4644
+ priority: {
4645
+ type: "number",
4646
+ minimum: 1,
4647
+ maximum: 5,
4648
+ description: "Task priority where 1=Low, 2=Normal, 3=Medium, 4=High, 5=Critical."
4649
+ },
4650
+ agent: { type: "string" },
4651
+ role: { type: "string" },
4652
+ model: { type: "string" },
4653
+ comment: {
4654
+ type: "string",
4655
+ description: "REQUIRED when changing task status. Explain WHY the status is changing (e.g., 'Starting implementation', 'Blocked by missing API docs', 'Verified fix')."
4656
+ },
4657
+ doc_path: { type: "string" },
4658
+ tags: { type: "array", items: { type: "string" } },
4659
+ metadata: { type: "object" },
4660
+ parent_id: {
4661
+ type: "string",
4662
+ description: "Optional parent task ID (UUID) or parent task code (e.g. TASK-001). Resolved to UUID before storing."
4663
+ },
4664
+ depends_on: {
4665
+ type: "string",
4666
+ description: "Optional task ID (UUID) or task code (e.g. TASK-001). Resolved to UUID before storing."
4667
+ },
4668
+ est_tokens: {
4669
+ type: "number",
4670
+ minimum: 0,
4671
+ description: "Estimated total tokens actually used for this task. Required when status changes to 'completed'."
4672
+ },
4673
+ commit_id: {
4674
+ type: "string",
4675
+ description: "Git commit hash. Recommended when status changes to 'completed' for traceability."
4676
+ },
4677
+ changed_files: {
4678
+ type: "array",
4679
+ items: { type: "string" },
4680
+ description: "List of files changed. Recommended when status changes to 'completed' for traceability."
4681
+ },
4682
+ force: {
4683
+ type: "boolean",
4684
+ description: "If true, bypasses status transition validation (e.g. pending -> completed)."
4685
+ },
4686
+ structured: { type: "boolean", default: false, description: "If true, returns structured JSON result." }
4687
+ }
4949
4688
  },
4950
- force: {
4951
- type: "boolean",
4952
- description: "If true, bypasses status transition validation (e.g. pending -> completed)."
4689
+ {
4690
+ title: "By task_code",
4691
+ required: ["owner", "repo", "task_code"],
4692
+ properties: {
4693
+ owner: { type: "string", description: "Organization/namespace (e.g., GitHub org or username)" },
4694
+ repo: { type: "string", description: "Repository name" },
4695
+ task_code: { type: "string" },
4696
+ phase: { type: "string" },
4697
+ title: { type: "string", minLength: 3, maxLength: 100 },
4698
+ description: {
4699
+ type: "string",
4700
+ description: "Detailed description. MUST follow format: 1. Context & Analysis, 2. Step & Implementation, 3. Acceptance & Verification"
4701
+ },
4702
+ status: {
4703
+ type: "string",
4704
+ enum: ["backlog", "pending", "in_progress", "completed", "canceled", "blocked"],
4705
+ description: "New status. Transitions from 'backlog', 'pending' or 'blocked' to 'completed' are NOT allowed."
4706
+ },
4707
+ priority: {
4708
+ type: "number",
4709
+ minimum: 1,
4710
+ maximum: 5,
4711
+ description: "Task priority where 1=Low, 2=Normal, 3=Medium, 4=High, 5=Critical."
4712
+ },
4713
+ agent: { type: "string" },
4714
+ role: { type: "string" },
4715
+ model: { type: "string" },
4716
+ comment: {
4717
+ type: "string",
4718
+ description: "REQUIRED when changing task status. Explain WHY the status is changing (e.g., 'Starting implementation', 'Blocked by missing API docs', 'Verified fix')."
4719
+ },
4720
+ doc_path: { type: "string" },
4721
+ tags: { type: "array", items: { type: "string" } },
4722
+ metadata: { type: "object" },
4723
+ parent_id: {
4724
+ type: "string",
4725
+ description: "Optional parent task ID (UUID) or parent task code (e.g. TASK-001). Resolved to UUID before storing."
4726
+ },
4727
+ depends_on: {
4728
+ type: "string",
4729
+ description: "Optional task ID (UUID) or task code (e.g. TASK-001). Resolved to UUID before storing."
4730
+ },
4731
+ est_tokens: {
4732
+ type: "number",
4733
+ minimum: 0,
4734
+ description: "Estimated total tokens actually used for this task. Required when status changes to 'completed'."
4735
+ },
4736
+ commit_id: {
4737
+ type: "string",
4738
+ description: "Git commit hash. Recommended when status changes to 'completed' for traceability."
4739
+ },
4740
+ changed_files: {
4741
+ type: "array",
4742
+ items: { type: "string" },
4743
+ description: "List of files changed. Recommended when status changes to 'completed' for traceability."
4744
+ },
4745
+ force: {
4746
+ type: "boolean",
4747
+ description: "If true, bypasses status transition validation (e.g. pending -> completed)."
4748
+ },
4749
+ structured: { type: "boolean", default: false, description: "If true, returns structured JSON result." }
4750
+ }
4953
4751
  },
4954
- structured: { type: "boolean", default: false, description: "If true, returns structured JSON result." }
4955
- },
4956
- required: ["repo", "owner"]
4752
+ {
4753
+ title: "By task_codes",
4754
+ required: ["owner", "repo", "task_codes"],
4755
+ properties: {
4756
+ owner: { type: "string", description: "Organization/namespace (e.g., GitHub org or username)" },
4757
+ repo: { type: "string", description: "Repository name" },
4758
+ task_codes: {
4759
+ type: "array",
4760
+ items: { type: "string" },
4761
+ minItems: 1,
4762
+ description: "Array of task codes (e.g. TASK-001)"
4763
+ },
4764
+ phase: { type: "string" },
4765
+ title: { type: "string", minLength: 3, maxLength: 100 },
4766
+ description: {
4767
+ type: "string",
4768
+ description: "Detailed description. MUST follow format: 1. Context & Analysis, 2. Step & Implementation, 3. Acceptance & Verification"
4769
+ },
4770
+ status: {
4771
+ type: "string",
4772
+ enum: ["backlog", "pending", "in_progress", "completed", "canceled", "blocked"],
4773
+ description: "New status. Transitions from 'backlog', 'pending' or 'blocked' to 'completed' are NOT allowed."
4774
+ },
4775
+ priority: {
4776
+ type: "number",
4777
+ minimum: 1,
4778
+ maximum: 5,
4779
+ description: "Task priority where 1=Low, 2=Normal, 3=Medium, 4=High, 5=Critical."
4780
+ },
4781
+ agent: { type: "string" },
4782
+ role: { type: "string" },
4783
+ model: { type: "string" },
4784
+ comment: {
4785
+ type: "string",
4786
+ description: "REQUIRED when changing task status. Explain WHY the status is changing (e.g., 'Starting implementation', 'Blocked by missing API docs', 'Verified fix')."
4787
+ },
4788
+ doc_path: { type: "string" },
4789
+ tags: { type: "array", items: { type: "string" } },
4790
+ metadata: { type: "object" },
4791
+ parent_id: {
4792
+ type: "string",
4793
+ description: "Optional parent task ID (UUID) or parent task code (e.g. TASK-001). Resolved to UUID before storing."
4794
+ },
4795
+ depends_on: {
4796
+ type: "string",
4797
+ description: "Optional task ID (UUID) or task code (e.g. TASK-001). Resolved to UUID before storing."
4798
+ },
4799
+ est_tokens: {
4800
+ type: "number",
4801
+ minimum: 0,
4802
+ description: "Estimated total tokens actually used for this task. Required when status changes to 'completed'."
4803
+ },
4804
+ commit_id: {
4805
+ type: "string",
4806
+ description: "Git commit hash. Recommended when status changes to 'completed' for traceability."
4807
+ },
4808
+ changed_files: {
4809
+ type: "array",
4810
+ items: { type: "string" },
4811
+ description: "List of files changed. Recommended when status changes to 'completed' for traceability."
4812
+ },
4813
+ force: {
4814
+ type: "boolean",
4815
+ description: "If true, bypasses status transition validation (e.g. pending -> completed)."
4816
+ },
4817
+ structured: { type: "boolean", default: false, description: "If true, returns structured JSON result." }
4818
+ }
4819
+ }
4820
+ ]
4957
4821
  },
4958
4822
  outputSchema: {
4959
4823
  type: "object",
@@ -4985,19 +4849,57 @@ var TOOL_DEFINITIONS = [
4985
4849
  },
4986
4850
  inputSchema: {
4987
4851
  type: "object",
4988
- properties: {
4989
- owner: { type: "string", description: "Organization/namespace (e.g., GitHub org or username)" },
4990
- repo: { type: "string", description: "Repository name" },
4991
- id: {
4992
- type: "string",
4993
- format: "uuid",
4994
- description: "Task ID (for single deletion). Optional if task_code is provided."
4852
+ oneOf: [
4853
+ {
4854
+ title: "By ID",
4855
+ required: ["owner", "repo", "id"],
4856
+ properties: {
4857
+ owner: { type: "string", description: "Organization/namespace (e.g., GitHub org or username)" },
4858
+ repo: { type: "string", description: "Repository name" },
4859
+ id: { type: "string", format: "uuid", description: "Task ID (for single deletion)" },
4860
+ structured: { type: "boolean", default: false, description: "If true, returns structured JSON result." }
4861
+ }
4995
4862
  },
4996
- ids: { type: "array", items: { type: "string", format: "uuid" }, description: "Task IDs (for bulk deletion)" },
4997
- task_code: { type: "string", description: "Task code (e.g. TASK-001). Optional if id is provided." },
4998
- structured: { type: "boolean", default: false, description: "If true, returns structured JSON result." }
4999
- },
5000
- required: ["repo", "owner"]
4863
+ {
4864
+ title: "By IDs",
4865
+ required: ["owner", "repo", "ids"],
4866
+ properties: {
4867
+ owner: { type: "string", description: "Organization/namespace (e.g., GitHub org or username)" },
4868
+ repo: { type: "string", description: "Repository name" },
4869
+ ids: {
4870
+ type: "array",
4871
+ items: { type: "string", format: "uuid" },
4872
+ description: "Task IDs (for bulk deletion)"
4873
+ },
4874
+ structured: { type: "boolean", default: false, description: "If true, returns structured JSON result." }
4875
+ }
4876
+ },
4877
+ {
4878
+ title: "By task_code",
4879
+ required: ["owner", "repo", "task_code"],
4880
+ properties: {
4881
+ owner: { type: "string", description: "Organization/namespace (e.g., GitHub org or username)" },
4882
+ repo: { type: "string", description: "Repository name" },
4883
+ task_code: { type: "string", description: "Task code (e.g. TASK-001)" },
4884
+ structured: { type: "boolean", default: false, description: "If true, returns structured JSON result." }
4885
+ }
4886
+ },
4887
+ {
4888
+ title: "By task_codes",
4889
+ required: ["owner", "repo", "task_codes"],
4890
+ properties: {
4891
+ owner: { type: "string", description: "Organization/namespace (e.g., GitHub org or username)" },
4892
+ repo: { type: "string", description: "Repository name" },
4893
+ task_codes: {
4894
+ type: "array",
4895
+ items: { type: "string" },
4896
+ minItems: 1,
4897
+ description: "Array of task codes (e.g. TASK-001)"
4898
+ },
4899
+ structured: { type: "boolean", default: false, description: "If true, returns structured JSON result." }
4900
+ }
4901
+ }
4902
+ ]
5001
4903
  },
5002
4904
  outputSchema: {
5003
4905
  type: "object",
@@ -5534,24 +5436,54 @@ var TOOL_DEFINITIONS = [
5534
5436
  },
5535
5437
  inputSchema: {
5536
5438
  type: "object",
5537
- properties: {
5538
- id: { type: "string", format: "uuid", description: "Standard ID to update. Optional if code is provided." },
5539
- code: { type: "string", maxLength: 20, description: "Short standard code. Optional if id is provided." },
5540
- name: { type: "string", minLength: 3, maxLength: 255 },
5541
- content: { type: "string", minLength: 10 },
5542
- parent_id: { type: "string", nullable: true },
5543
- context: { type: "string" },
5544
- version: { type: "string" },
5545
- language: { type: "string" },
5546
- stack: { type: "array", items: { type: "string" } },
5547
- repo: { type: "string" },
5548
- is_global: { type: "boolean" },
5549
- tags: { type: "array", items: { type: "string" } },
5550
- metadata: { type: "object" },
5551
- agent: { type: "string" },
5552
- model: { type: "string" },
5553
- structured: { type: "boolean", default: false }
5554
- }
5439
+ oneOf: [
5440
+ {
5441
+ title: "By ID",
5442
+ required: ["owner", "repo", "id"],
5443
+ properties: {
5444
+ owner: { type: "string", description: "Organization/namespace (e.g., GitHub org or username)" },
5445
+ repo: { type: "string", description: "Repository name" },
5446
+ id: { type: "string", format: "uuid", description: "Standard ID to update." },
5447
+ code: { type: "string", maxLength: 20, description: "Short standard code." },
5448
+ name: { type: "string", minLength: 3, maxLength: 255 },
5449
+ content: { type: "string", minLength: 10 },
5450
+ parent_id: { type: "string", nullable: true },
5451
+ context: { type: "string" },
5452
+ version: { type: "string" },
5453
+ language: { type: "string" },
5454
+ stack: { type: "array", items: { type: "string" } },
5455
+ is_global: { type: "boolean" },
5456
+ tags: { type: "array", items: { type: "string" } },
5457
+ metadata: { type: "object" },
5458
+ agent: { type: "string" },
5459
+ model: { type: "string" },
5460
+ structured: { type: "boolean", default: false }
5461
+ }
5462
+ },
5463
+ {
5464
+ title: "By code",
5465
+ required: ["owner", "repo", "code"],
5466
+ properties: {
5467
+ owner: { type: "string", description: "Organization/namespace (e.g., GitHub org or username)" },
5468
+ repo: { type: "string", description: "Repository name" },
5469
+ code: { type: "string", maxLength: 20, description: "Short standard code." },
5470
+ id: { type: "string", format: "uuid", description: "Standard ID." },
5471
+ name: { type: "string", minLength: 3, maxLength: 255 },
5472
+ content: { type: "string", minLength: 10 },
5473
+ parent_id: { type: "string", nullable: true },
5474
+ context: { type: "string" },
5475
+ version: { type: "string" },
5476
+ language: { type: "string" },
5477
+ stack: { type: "array", items: { type: "string" } },
5478
+ is_global: { type: "boolean" },
5479
+ tags: { type: "array", items: { type: "string" } },
5480
+ metadata: { type: "object" },
5481
+ agent: { type: "string" },
5482
+ model: { type: "string" },
5483
+ structured: { type: "boolean", default: false }
5484
+ }
5485
+ }
5486
+ ]
5555
5487
  },
5556
5488
  outputSchema: {
5557
5489
  type: "object",
@@ -6153,30 +6085,30 @@ async function completePromptArgument(name, argName, value, contextArguments, da
6153
6085
  import { randomUUID as randomUUID2 } from "crypto";
6154
6086
 
6155
6087
  // src/mcp/utils/mcp-response.ts
6156
- import { z as z2 } from "zod";
6157
- var McpAnnotationsSchema = z2.object({
6158
- audience: z2.array(z2.enum(["user", "assistant"])).optional(),
6159
- priority: z2.number().min(0).max(1).optional(),
6160
- lastModified: z2.string().optional()
6088
+ import { z } from "zod";
6089
+ var McpAnnotationsSchema = z.object({
6090
+ audience: z.array(z.enum(["user", "assistant"])).optional(),
6091
+ priority: z.number().min(0).max(1).optional(),
6092
+ lastModified: z.string().optional()
6161
6093
  }).strict().optional();
6162
- var McpContentSchema = z2.discriminatedUnion("type", [
6163
- z2.object({
6164
- type: z2.literal("text"),
6165
- text: z2.string(),
6094
+ var McpContentSchema = z.discriminatedUnion("type", [
6095
+ z.object({
6096
+ type: z.literal("text"),
6097
+ text: z.string(),
6166
6098
  annotations: McpAnnotationsSchema
6167
6099
  }),
6168
- z2.object({
6169
- type: z2.literal("image"),
6170
- data: z2.string(),
6171
- mimeType: z2.string(),
6100
+ z.object({
6101
+ type: z.literal("image"),
6102
+ data: z.string(),
6103
+ mimeType: z.string(),
6172
6104
  annotations: McpAnnotationsSchema
6173
6105
  }),
6174
- z2.object({
6175
- type: z2.literal("resource"),
6176
- resource: z2.object({
6177
- uri: z2.string(),
6178
- mimeType: z2.string().optional(),
6179
- text: z2.string().optional(),
6106
+ z.object({
6107
+ type: z.literal("resource"),
6108
+ resource: z.object({
6109
+ uri: z.string(),
6110
+ mimeType: z.string().optional(),
6111
+ text: z.string().optional(),
6180
6112
  annotations: McpAnnotationsSchema
6181
6113
  })
6182
6114
  })
@@ -6258,6 +6190,529 @@ function getPrimaryTextContent(response) {
6258
6190
  return textItem?.type === "text" ? textItem.text : "";
6259
6191
  }
6260
6192
 
6193
+ // src/mcp/tools/schemas/shared.ts
6194
+ import { z as z2 } from "zod";
6195
+ var MemoryScopeSchema = z2.object({
6196
+ owner: z2.string().min(1),
6197
+ repo: z2.string().min(1).transform(normalizeRepo),
6198
+ branch: z2.string().optional(),
6199
+ folder: z2.string().optional(),
6200
+ language: z2.string().optional()
6201
+ });
6202
+ var MemoryTypeSchema = z2.enum(["code_fact", "decision", "mistake", "pattern", "task_archive"]);
6203
+ var TaskStatusSchema = z2.enum(["backlog", "pending", "in_progress", "completed", "canceled", "blocked"]);
6204
+ var TaskPrioritySchema = z2.number().min(1).max(5);
6205
+ var HandoffStatusSchema = z2.enum(["pending", "accepted", "rejected", "expired"]);
6206
+ var SingleMemorySchema = z2.object({
6207
+ code: z2.string().max(20).optional(),
6208
+ type: MemoryTypeSchema,
6209
+ title: z2.string().min(3).max(255),
6210
+ content: z2.string().min(10),
6211
+ importance: z2.number().min(1).max(5),
6212
+ agent: z2.string().min(1),
6213
+ role: z2.string().optional().default("unknown"),
6214
+ model: z2.string().min(1),
6215
+ scope: MemoryScopeSchema,
6216
+ ttlDays: z2.number().min(1).optional(),
6217
+ supersedes: z2.string().optional(),
6218
+ tags: z2.array(z2.string()).optional(),
6219
+ metadata: z2.record(z2.string(), z2.any()).optional(),
6220
+ is_global: z2.boolean().default(false)
6221
+ });
6222
+ var SingleStandardSchema = z2.object({
6223
+ name: z2.string().min(3).max(255),
6224
+ content: z2.string().min(10),
6225
+ parent_id: z2.string().optional(),
6226
+ context: z2.string().optional(),
6227
+ version: z2.string().optional(),
6228
+ language: z2.string().optional(),
6229
+ stack: z2.array(z2.string()).optional(),
6230
+ is_global: z2.boolean().optional(),
6231
+ tags: z2.array(z2.string().min(1)).min(1),
6232
+ metadata: z2.record(z2.string(), z2.any()).refine((value) => Object.keys(value).length > 0, {
6233
+ message: "metadata must contain at least one key"
6234
+ }),
6235
+ agent: z2.string().optional(),
6236
+ model: z2.string().optional()
6237
+ });
6238
+ var TaskStatusValues = TaskStatusSchema.options;
6239
+
6240
+ // src/mcp/tools/schemas/memory.ts
6241
+ import { z as z3 } from "zod";
6242
+ var MemoryStoreSchema = z3.object({
6243
+ code: z3.string().max(20).optional(),
6244
+ type: MemoryTypeSchema.optional(),
6245
+ title: z3.string().min(3).max(255).optional(),
6246
+ content: z3.string().min(10).optional(),
6247
+ importance: z3.number().min(1).max(5).optional(),
6248
+ agent: z3.string().min(1).optional(),
6249
+ role: z3.string().optional().default("unknown"),
6250
+ model: z3.string().min(1).optional(),
6251
+ scope: MemoryScopeSchema.optional(),
6252
+ ttlDays: z3.number().min(1).optional(),
6253
+ supersedes: z3.string().optional(),
6254
+ tags: z3.array(z3.string()).optional(),
6255
+ metadata: z3.record(z3.string(), z3.any()).optional(),
6256
+ is_global: z3.boolean().default(false),
6257
+ structured: z3.boolean().default(false),
6258
+ memories: z3.array(SingleMemorySchema).min(1).optional()
6259
+ }).refine(
6260
+ (data) => {
6261
+ if (data.memories) return true;
6262
+ return !!(data.type && data.title && data.content && data.importance && data.agent && data.model && data.scope);
6263
+ },
6264
+ {
6265
+ message: "Either 'memories' array or single memory fields (type, title, content, importance, agent, model, scope) must be provided"
6266
+ }
6267
+ );
6268
+ var MemoryUpdateSchema = z3.object({
6269
+ id: z3.string().uuid().optional(),
6270
+ code: z3.string().max(20).optional(),
6271
+ owner: z3.string().min(1),
6272
+ repo: z3.string().min(1).transform(normalizeRepo),
6273
+ type: MemoryTypeSchema.optional(),
6274
+ title: z3.string().min(3).max(255).optional(),
6275
+ content: z3.string().min(10).optional(),
6276
+ importance: z3.number().min(1).max(5).optional(),
6277
+ agent: z3.string().optional(),
6278
+ role: z3.string().optional(),
6279
+ status: z3.enum(["active", "archived"]).optional(),
6280
+ supersedes: z3.string().optional(),
6281
+ tags: z3.array(z3.string()).optional(),
6282
+ metadata: z3.record(z3.string(), z3.any()).optional(),
6283
+ is_global: z3.boolean().optional(),
6284
+ completed_at: z3.string().optional(),
6285
+ structured: z3.boolean().default(false)
6286
+ }).refine((data) => data.id !== void 0 || data.code !== void 0, {
6287
+ message: "Either id or code must be provided"
6288
+ }).refine(
6289
+ (data) => data.type !== void 0 || data.content !== void 0 || data.title !== void 0 || data.importance !== void 0 || data.status !== void 0 || data.supersedes !== void 0 || data.tags !== void 0 || data.metadata !== void 0 || data.is_global !== void 0 || data.agent !== void 0 || data.role !== void 0 || data.completed_at !== void 0,
6290
+ { message: "At least one field must be provided for update" }
6291
+ );
6292
+ var MemorySearchSchema = z3.object({
6293
+ query: z3.string().min(3),
6294
+ prompt: z3.string().optional(),
6295
+ owner: z3.string().min(1),
6296
+ repo: z3.string().min(1).transform(normalizeRepo),
6297
+ types: z3.array(MemoryTypeSchema).optional(),
6298
+ minImportance: z3.number().min(1).max(5).optional(),
6299
+ limit: z3.number().min(1).max(100).default(5),
6300
+ offset: z3.number().min(0).default(0),
6301
+ includeRecap: z3.boolean().default(false),
6302
+ current_file_path: z3.string().optional(),
6303
+ include_archived: z3.boolean().default(false),
6304
+ current_tags: z3.array(z3.string()).optional(),
6305
+ scope: MemoryScopeSchema.partial().optional(),
6306
+ structured: z3.boolean().default(false)
6307
+ });
6308
+ var MemoryAcknowledgeSchema = z3.object({
6309
+ memory_id: z3.string().uuid().optional(),
6310
+ code: z3.string().max(20).optional(),
6311
+ owner: z3.string().min(1),
6312
+ repo: z3.string().min(1).transform(normalizeRepo),
6313
+ status: z3.enum(["used", "irrelevant", "contradictory"]),
6314
+ application_context: z3.string().min(10).optional(),
6315
+ structured: z3.boolean().default(false)
6316
+ }).refine((data) => data.memory_id !== void 0 || data.code !== void 0, {
6317
+ message: "Either memory_id or code must be provided"
6318
+ });
6319
+ var MemoryRecapSchema = z3.object({
6320
+ owner: z3.string().min(1),
6321
+ repo: z3.string().min(1).transform(normalizeRepo),
6322
+ limit: z3.number().min(1).max(50).default(20),
6323
+ offset: z3.number().min(0).default(0),
6324
+ structured: z3.boolean().default(false)
6325
+ });
6326
+ var MemoryDeleteSchema = z3.object({
6327
+ owner: z3.string().min(1),
6328
+ repo: z3.string().min(1).transform(normalizeRepo),
6329
+ id: z3.string().uuid().optional(),
6330
+ ids: z3.array(z3.string().uuid()).min(1).optional(),
6331
+ code: z3.string().max(20).optional(),
6332
+ codes: z3.array(z3.string().max(20)).min(1).optional(),
6333
+ structured: z3.boolean().default(false)
6334
+ }).refine(
6335
+ (data) => data.id !== void 0 || data.ids !== void 0 || data.code !== void 0 || data.codes !== void 0,
6336
+ {
6337
+ message: "Either 'id', 'ids', 'code', or 'codes' must be provided for deletion"
6338
+ }
6339
+ );
6340
+ var MemoryDetailSchema = z3.object({
6341
+ id: z3.string().uuid().optional(),
6342
+ code: z3.string().max(20).optional(),
6343
+ owner: z3.string().min(1),
6344
+ repo: z3.string().min(1).transform(normalizeRepo),
6345
+ structured: z3.boolean().default(false)
6346
+ }).refine((data) => data.id !== void 0 || data.code !== void 0, {
6347
+ message: "Either id or code must be provided"
6348
+ });
6349
+ var MemorySummarizeSchema = z3.object({
6350
+ owner: z3.string().min(1),
6351
+ repo: z3.string().min(1).transform(normalizeRepo),
6352
+ signals: z3.array(z3.string().max(200)).min(1),
6353
+ structured: z3.boolean().default(false)
6354
+ });
6355
+ var MemorySynthesizeSchema = z3.object({
6356
+ owner: z3.string().min(1),
6357
+ repo: z3.string().min(1).transform(normalizeRepo).optional(),
6358
+ objective: z3.string().min(5),
6359
+ current_file_path: z3.string().optional(),
6360
+ include_summary: z3.boolean().default(true),
6361
+ include_tasks: z3.boolean().default(true),
6362
+ use_tools: z3.boolean().default(true),
6363
+ max_iterations: z3.number().int().min(1).max(5).default(3),
6364
+ max_tokens: z3.number().int().min(128).max(4e3).default(1200),
6365
+ structured: z3.boolean().default(false)
6366
+ });
6367
+
6368
+ // src/mcp/tools/schemas/task.ts
6369
+ import { z as z4 } from "zod";
6370
+ var TaskMetadataSchema = z4.record(z4.string(), z4.any()).optional().superRefine((metadata, ctx) => {
6371
+ if (!metadata) return;
6372
+ if (metadata.required_skills !== void 0) {
6373
+ if (!Array.isArray(metadata.required_skills)) {
6374
+ ctx.addIssue({
6375
+ code: z4.ZodIssueCode.custom,
6376
+ message: "metadata.required_skills must be an array of strings",
6377
+ path: ["metadata", "required_skills"]
6378
+ });
6379
+ } else if (metadata.required_skills.length === 0) {
6380
+ ctx.addIssue({
6381
+ code: z4.ZodIssueCode.custom,
6382
+ message: "metadata.required_skills must not be empty when present",
6383
+ path: ["metadata", "required_skills"]
6384
+ });
6385
+ } else if (!metadata.required_skills.every((s) => typeof s === "string" && s.length > 0)) {
6386
+ ctx.addIssue({
6387
+ code: z4.ZodIssueCode.custom,
6388
+ message: "metadata.required_skills must be an array of non-empty strings",
6389
+ path: ["metadata", "required_skills"]
6390
+ });
6391
+ }
6392
+ }
6393
+ if (metadata.fsm_gates !== void 0) {
6394
+ if (!Array.isArray(metadata.fsm_gates)) {
6395
+ ctx.addIssue({
6396
+ code: z4.ZodIssueCode.custom,
6397
+ message: "metadata.fsm_gates must be an array of strings",
6398
+ path: ["metadata", "fsm_gates"]
6399
+ });
6400
+ } else if (metadata.fsm_gates.length === 0) {
6401
+ ctx.addIssue({
6402
+ code: z4.ZodIssueCode.custom,
6403
+ message: "metadata.fsm_gates must not be empty when present",
6404
+ path: ["metadata", "fsm_gates"]
6405
+ });
6406
+ } else if (!metadata.fsm_gates.every((s) => typeof s === "string" && s.length > 0)) {
6407
+ ctx.addIssue({
6408
+ code: z4.ZodIssueCode.custom,
6409
+ message: "metadata.fsm_gates must be an array of non-empty strings",
6410
+ path: ["metadata", "fsm_gates"]
6411
+ });
6412
+ }
6413
+ }
6414
+ });
6415
+ var SingleTaskCreateSchema = z4.object({
6416
+ task_code: z4.string().min(1).optional(),
6417
+ phase: z4.string().min(1),
6418
+ title: z4.string().min(3).max(100),
6419
+ description: z4.string().min(1),
6420
+ status: TaskStatusSchema.default("backlog"),
6421
+ priority: TaskPrioritySchema.default(3),
6422
+ agent: z4.string().optional(),
6423
+ role: z4.string().optional(),
6424
+ doc_path: z4.string().optional(),
6425
+ tags: z4.array(z4.string()).optional(),
6426
+ suggested_skills: z4.array(z4.string()).optional(),
6427
+ metadata: TaskMetadataSchema,
6428
+ parent_id: z4.string().optional(),
6429
+ depends_on: z4.string().optional(),
6430
+ est_tokens: z4.number().int().min(0).optional()
6431
+ });
6432
+ var TaskStatusListSchema = z4.string().refine(
6433
+ (val) => {
6434
+ if (val === "all") return true;
6435
+ const parts = val.split(",").map((s) => s.trim()).filter(Boolean);
6436
+ if (parts.length === 0) return false;
6437
+ return parts.every((p) => TaskStatusValues.includes(p));
6438
+ },
6439
+ { message: "status must be 'all' or a comma-separated list of valid TaskStatus values" }
6440
+ );
6441
+ var TaskCreateSchema = z4.object({
6442
+ owner: z4.string().min(1),
6443
+ repo: z4.string().min(1).transform(normalizeRepo),
6444
+ // Allow single task fields at top level (backward compatibility & single use)
6445
+ task_code: z4.string().min(1).optional(),
6446
+ phase: z4.string().min(1).optional(),
6447
+ title: z4.string().min(3).max(100).optional(),
6448
+ description: z4.string().min(1).optional(),
6449
+ status: TaskStatusSchema.optional(),
6450
+ priority: TaskPrioritySchema.optional(),
6451
+ agent: z4.string().optional(),
6452
+ role: z4.string().optional(),
6453
+ doc_path: z4.string().optional(),
6454
+ tags: z4.array(z4.string()).optional(),
6455
+ suggested_skills: z4.array(z4.string()).optional(),
6456
+ metadata: z4.record(z4.string(), z4.any()).optional(),
6457
+ parent_id: z4.string().optional(),
6458
+ depends_on: z4.string().optional(),
6459
+ est_tokens: z4.number().int().min(0).optional(),
6460
+ // Allow bulk tasks
6461
+ tasks: z4.array(SingleTaskCreateSchema).min(1).optional(),
6462
+ structured: z4.boolean().default(false)
6463
+ }).refine(
6464
+ (data) => {
6465
+ if (data.tasks) return true;
6466
+ return !!(data.phase && data.title && data.description);
6467
+ },
6468
+ { message: "Either 'tasks' array or single task fields (phase, title, description) must be provided" }
6469
+ );
6470
+ var TaskCreateInteractiveSchema = SingleTaskCreateSchema.partial().extend({
6471
+ owner: z4.string().optional().default(""),
6472
+ repo: z4.string().min(1).transform(normalizeRepo).optional(),
6473
+ structured: z4.boolean().default(false)
6474
+ });
6475
+ var TaskUpdateSchema = z4.object({
6476
+ owner: z4.string().min(1),
6477
+ repo: z4.string().min(1).transform(normalizeRepo),
6478
+ id: z4.string().uuid().optional(),
6479
+ ids: z4.array(z4.string().uuid()).min(1).optional(),
6480
+ task_code: z4.string().optional(),
6481
+ task_codes: z4.array(z4.string().min(1)).min(1).optional(),
6482
+ phase: z4.string().optional(),
6483
+ title: z4.string().min(3).max(100).optional(),
6484
+ description: z4.string().optional(),
6485
+ status: TaskStatusSchema.optional(),
6486
+ priority: TaskPrioritySchema.optional(),
6487
+ agent: z4.string().min(1, "agent name is required").optional(),
6488
+ role: z4.string().min(1, "agent role is required").optional(),
6489
+ model: z4.string().optional(),
6490
+ comment: z4.string().min(1).optional(),
6491
+ doc_path: z4.string().optional(),
6492
+ tags: z4.array(z4.string()).optional(),
6493
+ metadata: z4.record(z4.string(), z4.any()).optional(),
6494
+ suggested_skills: z4.array(z4.string()).optional(),
6495
+ parent_id: z4.string().optional(),
6496
+ depends_on: z4.string().optional(),
6497
+ est_tokens: z4.number().int().min(0).optional(),
6498
+ commit_id: z4.string().optional(),
6499
+ changed_files: z4.array(z4.string()).optional(),
6500
+ force: z4.boolean().optional(),
6501
+ structured: z4.boolean().default(false)
6502
+ }).refine(
6503
+ (data) => data.id !== void 0 || data.ids !== void 0 || data.task_code !== void 0 || data.task_codes !== void 0,
6504
+ { message: "Either 'id', 'ids', 'task_code', or 'task_codes' must be provided for update" }
6505
+ ).refine((data) => Object.keys(data).length > 2, {
6506
+ message: "At least one field besides repo and id/ids must be provided for update"
6507
+ });
6508
+ var TaskListSchema = z4.object({
6509
+ owner: z4.string().min(1),
6510
+ repo: z4.string().min(1).transform(normalizeRepo),
6511
+ status: TaskStatusListSchema.default("backlog,pending,in_progress,blocked"),
6512
+ phase: z4.string().optional(),
6513
+ query: z4.string().optional(),
6514
+ limit: z4.number().min(1).max(100).default(15),
6515
+ offset: z4.number().min(0).default(0),
6516
+ structured: z4.boolean().default(false)
6517
+ });
6518
+ var TaskSearchSchema = z4.object({
6519
+ owner: z4.string().min(1),
6520
+ repo: z4.string().min(1).transform(normalizeRepo),
6521
+ query: z4.string().min(1),
6522
+ status: z4.string().optional(),
6523
+ phase: z4.string().optional(),
6524
+ priority: z4.number().min(1).max(5).optional(),
6525
+ limit: z4.number().min(1).max(100).default(10),
6526
+ offset: z4.number().min(0).default(0),
6527
+ structured: z4.boolean().default(false)
6528
+ });
6529
+ var TaskDeleteSchema = z4.object({
6530
+ owner: z4.string().min(1),
6531
+ repo: z4.string().min(1).transform(normalizeRepo),
6532
+ id: z4.string().uuid().optional(),
6533
+ ids: z4.array(z4.string().uuid()).min(1).optional(),
6534
+ task_code: z4.string().optional(),
6535
+ task_codes: z4.array(z4.string().min(1)).min(1).optional(),
6536
+ structured: z4.boolean().default(false)
6537
+ }).refine(
6538
+ (data) => data.id !== void 0 || data.ids !== void 0 || data.task_code !== void 0 || data.task_codes !== void 0,
6539
+ { message: "Either 'id', 'ids', 'task_code', or 'task_codes' must be provided for deletion" }
6540
+ );
6541
+ var TaskGetSchema = z4.object({
6542
+ owner: z4.string().min(1),
6543
+ repo: z4.string().min(1).transform(normalizeRepo),
6544
+ id: z4.string().uuid().optional(),
6545
+ task_code: z4.string().optional(),
6546
+ task_codes: z4.array(z4.string().min(1)).min(1).optional(),
6547
+ structured: z4.boolean().default(false)
6548
+ }).refine((data) => data.id !== void 0 || data.task_code !== void 0 || data.task_codes !== void 0, {
6549
+ message: "Either 'id', 'task_code', or 'task_codes' must be provided"
6550
+ });
6551
+
6552
+ // src/mcp/tools/schemas/handoff.ts
6553
+ import { z as z5 } from "zod";
6554
+ var HandoffCreateSchema = z5.object({
6555
+ owner: z5.string().min(1),
6556
+ repo: z5.string().min(1).transform(normalizeRepo),
6557
+ from_agent: z5.string().min(1),
6558
+ to_agent: z5.string().min(1).optional(),
6559
+ task_id: z5.string().uuid().optional(),
6560
+ task_code: z5.string().optional(),
6561
+ summary: z5.string().min(1),
6562
+ context: z5.record(z5.string(), z5.any()).optional(),
6563
+ expires_at: z5.string().optional(),
6564
+ structured: z5.boolean().default(false)
6565
+ }).refine((data) => !(data.task_id && data.task_code), {
6566
+ message: "Provide either task_id or task_code, not both"
6567
+ }).refine(
6568
+ (data) => data.to_agent || data.task_id || data.task_code || data.context?.next_steps || data.context?.blockers || data.context?.remaining_work,
6569
+ {
6570
+ message: "Handoffs must identify a target agent, linked task, next_steps, blockers, or remaining_work. Do not create pending handoffs for completed-work summaries."
6571
+ }
6572
+ );
6573
+ var HandoffUpdateSchema = z5.object({
6574
+ id: z5.string().uuid(),
6575
+ status: HandoffStatusSchema,
6576
+ structured: z5.boolean().default(false)
6577
+ });
6578
+ var HandoffListSchema = z5.object({
6579
+ owner: z5.string().min(1),
6580
+ repo: z5.string().min(1).transform(normalizeRepo),
6581
+ status: HandoffStatusSchema.optional(),
6582
+ from_agent: z5.string().min(1).optional(),
6583
+ to_agent: z5.string().min(1).optional(),
6584
+ limit: z5.number().min(1).max(100).default(20),
6585
+ offset: z5.number().min(0).default(0),
6586
+ structured: z5.boolean().default(false)
6587
+ });
6588
+ var TaskClaimSchema = z5.object({
6589
+ owner: z5.string().min(1),
6590
+ repo: z5.string().min(1).transform(normalizeRepo),
6591
+ task_id: z5.string().uuid().optional(),
6592
+ task_code: z5.string().optional(),
6593
+ agent: z5.string().min(1),
6594
+ role: z5.string().optional(),
6595
+ metadata: z5.record(z5.string(), z5.any()).optional(),
6596
+ structured: z5.boolean().default(false)
6597
+ }).refine((data) => data.task_id !== void 0 || data.task_code !== void 0, {
6598
+ message: "Either task_id or task_code must be provided"
6599
+ }).refine((data) => !(data.task_id && data.task_code), {
6600
+ message: "Provide either task_id or task_code, not both"
6601
+ });
6602
+ var ClaimListSchema = z5.object({
6603
+ owner: z5.string().min(1),
6604
+ repo: z5.string().min(1).transform(normalizeRepo),
6605
+ agent: z5.string().min(1).optional(),
6606
+ active_only: z5.boolean().default(true),
6607
+ limit: z5.number().min(1).max(100).default(20),
6608
+ offset: z5.number().min(0).default(0),
6609
+ structured: z5.boolean().default(false)
6610
+ });
6611
+ var ClaimReleaseSchema = z5.object({
6612
+ owner: z5.string().min(1),
6613
+ repo: z5.string().min(1).transform(normalizeRepo),
6614
+ task_id: z5.string().uuid().optional(),
6615
+ task_code: z5.string().optional(),
6616
+ agent: z5.string().min(1).optional(),
6617
+ structured: z5.boolean().default(false)
6618
+ }).refine((data) => data.task_id !== void 0 || data.task_code !== void 0, {
6619
+ message: "Either task_id or task_code must be provided"
6620
+ }).refine((data) => !(data.task_id && data.task_code), {
6621
+ message: "Provide either task_id or task_code, not both"
6622
+ });
6623
+
6624
+ // src/mcp/tools/schemas/standard.ts
6625
+ import { z as z6 } from "zod";
6626
+ var StandardStoreSchema = z6.object({
6627
+ name: z6.string().min(3).max(255).optional(),
6628
+ content: z6.string().min(10).optional(),
6629
+ parent_id: z6.string().optional(),
6630
+ context: z6.string().optional(),
6631
+ version: z6.string().optional(),
6632
+ language: z6.string().optional(),
6633
+ stack: z6.array(z6.string()).optional(),
6634
+ owner: z6.string().min(1),
6635
+ repo: z6.string().transform(normalizeRepo).optional(),
6636
+ is_global: z6.boolean().optional(),
6637
+ tags: z6.array(z6.string().min(1)).min(1).optional(),
6638
+ metadata: z6.record(z6.string(), z6.any()).refine((value) => Object.keys(value).length > 0, { message: "metadata must contain at least one key" }).optional(),
6639
+ agent: z6.string().optional(),
6640
+ model: z6.string().optional(),
6641
+ structured: z6.boolean().default(false),
6642
+ standards: z6.array(SingleStandardSchema).min(1).optional()
6643
+ }).refine(
6644
+ (data) => {
6645
+ if (data.standards) return true;
6646
+ return !!(data.name && data.content && data.tags && data.metadata);
6647
+ },
6648
+ { message: "Either 'standards' array or single standard fields (name, content, tags, metadata) must be provided" }
6649
+ ).refine((data) => data.is_global !== false || !!data.repo, {
6650
+ message: "repo is required for repo-specific standards"
6651
+ });
6652
+ var StandardUpdateSchema = z6.object({
6653
+ id: z6.string().uuid().optional(),
6654
+ code: z6.string().max(20).optional(),
6655
+ name: z6.string().min(3).max(255).optional(),
6656
+ content: z6.string().min(10).optional(),
6657
+ parent_id: z6.string().nullable().optional(),
6658
+ context: z6.string().optional(),
6659
+ version: z6.string().optional(),
6660
+ language: z6.string().optional(),
6661
+ stack: z6.array(z6.string().min(1)).min(1).optional(),
6662
+ owner: z6.string().min(1),
6663
+ repo: z6.string().transform(normalizeRepo),
6664
+ is_global: z6.boolean().optional(),
6665
+ tags: z6.array(z6.string().min(1)).min(1).optional(),
6666
+ metadata: z6.record(z6.string(), z6.any()).refine((value) => Object.keys(value).length > 0, { message: "metadata must contain at least one key" }).optional(),
6667
+ agent: z6.string().optional(),
6668
+ model: z6.string().optional(),
6669
+ structured: z6.boolean().default(false)
6670
+ }).refine((data) => data.id !== void 0 || data.code !== void 0, {
6671
+ message: "Either id or code must be provided"
6672
+ }).refine(
6673
+ (data) => data.name !== void 0 || data.content !== void 0 || data.parent_id !== void 0 || data.context !== void 0 || data.version !== void 0 || data.language !== void 0 || data.stack !== void 0 || data.repo !== void 0 || data.is_global !== void 0 || data.tags !== void 0 || data.metadata !== void 0 || data.agent !== void 0 || data.model !== void 0,
6674
+ { message: "At least one field must be provided for update" }
6675
+ ).refine((data) => data.is_global !== false || !!data.repo, {
6676
+ message: "repo is required for repo-specific standards"
6677
+ });
6678
+ var StandardSearchSchema = z6.object({
6679
+ query: z6.string().optional(),
6680
+ stack: z6.array(z6.string()).optional(),
6681
+ tags: z6.array(z6.string()).optional(),
6682
+ language: z6.string().optional(),
6683
+ context: z6.string().optional(),
6684
+ version: z6.string().optional(),
6685
+ owner: z6.string().optional().default(""),
6686
+ repo: z6.string().transform(normalizeRepo).optional(),
6687
+ is_global: z6.boolean().optional(),
6688
+ limit: z6.number().min(1).max(100).default(20),
6689
+ offset: z6.number().min(0).default(0),
6690
+ structured: z6.boolean().default(false)
6691
+ });
6692
+ var StandardDeleteSchema = z6.object({
6693
+ owner: z6.string().min(1),
6694
+ repo: z6.string().min(1).transform(normalizeRepo),
6695
+ id: z6.string().uuid().optional(),
6696
+ ids: z6.array(z6.string().uuid()).min(1).optional(),
6697
+ code: z6.string().max(20).optional(),
6698
+ codes: z6.array(z6.string().max(20)).min(1).optional(),
6699
+ structured: z6.boolean().default(false)
6700
+ }).refine(
6701
+ (data) => data.id !== void 0 || data.ids !== void 0 || data.code !== void 0 || data.codes !== void 0,
6702
+ {
6703
+ message: "Either 'id', 'ids', 'code', or 'codes' must be provided for deletion"
6704
+ }
6705
+ );
6706
+ var StandardDetailSchema = z6.object({
6707
+ id: z6.string().uuid().optional(),
6708
+ code: z6.string().max(20).optional(),
6709
+ owner: z6.string().min(1),
6710
+ repo: z6.string().min(1).transform(normalizeRepo),
6711
+ structured: z6.boolean().default(false)
6712
+ }).refine((data) => data.id !== void 0 || data.code !== void 0, {
6713
+ message: "Either id or code must be provided"
6714
+ });
6715
+
6261
6716
  // src/mcp/tools/handoff.manage.ts
6262
6717
  function buildHandoffListSummary(repo, count, status, fromAgent, toAgent) {
6263
6718
  const parts = [`Found ${count} handoff${count === 1 ? "" : "s"} in repo "${repo}".`];
@@ -6570,28 +7025,6 @@ export {
6570
7025
  normalizeRepo,
6571
7026
  SQLiteStore,
6572
7027
  RealVectorStore,
6573
- MemoryStoreSchema,
6574
- MemoryUpdateSchema,
6575
- MemorySearchSchema,
6576
- MemoryAcknowledgeSchema,
6577
- MemoryRecapSchema,
6578
- MemoryDeleteSchema,
6579
- MemorySummarizeSchema,
6580
- MemorySynthesizeSchema,
6581
- TaskStatusSchema,
6582
- TaskCreateSchema,
6583
- TaskCreateInteractiveSchema,
6584
- TaskUpdateSchema,
6585
- TaskListSchema,
6586
- TaskSearchSchema,
6587
- TaskDeleteSchema,
6588
- MemoryDetailSchema,
6589
- StandardDetailSchema,
6590
- StandardDeleteSchema,
6591
- TaskGetSchema,
6592
- StandardStoreSchema,
6593
- StandardUpdateSchema,
6594
- StandardSearchSchema,
6595
7028
  TOOL_DEFINITIONS,
6596
7029
  encodeCursor,
6597
7030
  decodeCursor,
@@ -6614,6 +7047,28 @@ export {
6614
7047
  completePromptArgument,
6615
7048
  createMcpResponse,
6616
7049
  getPrimaryTextContent,
7050
+ TaskStatusSchema,
7051
+ MemoryStoreSchema,
7052
+ MemoryUpdateSchema,
7053
+ MemorySearchSchema,
7054
+ MemoryAcknowledgeSchema,
7055
+ MemoryRecapSchema,
7056
+ MemoryDeleteSchema,
7057
+ MemoryDetailSchema,
7058
+ MemorySummarizeSchema,
7059
+ MemorySynthesizeSchema,
7060
+ TaskCreateSchema,
7061
+ TaskCreateInteractiveSchema,
7062
+ TaskUpdateSchema,
7063
+ TaskListSchema,
7064
+ TaskSearchSchema,
7065
+ TaskDeleteSchema,
7066
+ TaskGetSchema,
7067
+ StandardStoreSchema,
7068
+ StandardUpdateSchema,
7069
+ StandardSearchSchema,
7070
+ StandardDeleteSchema,
7071
+ StandardDetailSchema,
6617
7072
  handleHandoffCreate,
6618
7073
  handleHandoffList,
6619
7074
  handleHandoffUpdate,