@vheins/local-memory-mcp 0.18.10 → 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.10") {
85
- pkgVersion = "0.18.10";
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++) {
@@ -2480,7 +2480,6 @@ var SystemEntity = class extends BaseEntity {
2480
2480
  const unassignedHandoffsByRepo = Object.fromEntries(unassignedHandoffRows.map((row) => [row.repo, row.count]));
2481
2481
  const staleClaimsByRepo = Object.fromEntries(staleClaimRows.map((row) => [row.repo, row.count]));
2482
2482
  const repoOwnerFilter = owner ? " AND owner = ?" : "";
2483
- const repoOwnerParams = owner ? [owner] : [];
2484
2483
  return repos.map((repo) => {
2485
2484
  const memoryCountRow = this.get(
2486
2485
  `SELECT COUNT(*) as count FROM memories WHERE repo = ?${repoOwnerFilter}`,
@@ -3587,511 +3586,7 @@ function inferOwnerFromSession(session) {
3587
3586
  return void 0;
3588
3587
  }
3589
3588
 
3590
- // src/mcp/tools/schemas.ts
3591
- import { z } from "zod";
3592
- var MemoryScopeSchema = z.object({
3593
- owner: z.string().min(1),
3594
- repo: z.string().min(1).transform(normalizeRepo),
3595
- branch: z.string().optional(),
3596
- folder: z.string().optional(),
3597
- language: z.string().optional()
3598
- });
3599
- var MemoryTypeSchema = z.enum(["code_fact", "decision", "mistake", "pattern", "task_archive"]);
3600
- var SingleMemorySchema = z.object({
3601
- code: z.string().max(20).optional(),
3602
- type: MemoryTypeSchema,
3603
- title: z.string().min(3).max(255),
3604
- content: z.string().min(10),
3605
- importance: z.number().min(1).max(5),
3606
- agent: z.string().min(1),
3607
- role: z.string().optional().default("unknown"),
3608
- model: z.string().min(1),
3609
- scope: MemoryScopeSchema,
3610
- ttlDays: z.number().min(1).optional(),
3611
- supersedes: z.string().optional(),
3612
- tags: z.array(z.string()).optional(),
3613
- metadata: z.record(z.string(), z.any()).optional(),
3614
- is_global: z.boolean().default(false)
3615
- });
3616
- var SingleStandardSchema = z.object({
3617
- name: z.string().min(3).max(255),
3618
- content: z.string().min(10),
3619
- parent_id: z.string().optional(),
3620
- context: z.string().optional(),
3621
- version: z.string().optional(),
3622
- language: z.string().optional(),
3623
- stack: z.array(z.string()).optional(),
3624
- is_global: z.boolean().optional(),
3625
- tags: z.array(z.string().min(1)).min(1),
3626
- metadata: z.record(z.string(), z.any()).refine((value) => Object.keys(value).length > 0, {
3627
- message: "metadata must contain at least one key"
3628
- }),
3629
- agent: z.string().optional(),
3630
- model: z.string().optional()
3631
- });
3632
- var MemoryStoreSchema = z.object({
3633
- code: z.string().max(20).optional(),
3634
- type: MemoryTypeSchema.optional(),
3635
- title: z.string().min(3).max(255).optional(),
3636
- content: z.string().min(10).optional(),
3637
- importance: z.number().min(1).max(5).optional(),
3638
- agent: z.string().min(1).optional(),
3639
- role: z.string().optional().default("unknown"),
3640
- model: z.string().min(1).optional(),
3641
- scope: MemoryScopeSchema.optional(),
3642
- ttlDays: z.number().min(1).optional(),
3643
- supersedes: z.string().optional(),
3644
- tags: z.array(z.string()).optional(),
3645
- metadata: z.record(z.string(), z.any()).optional(),
3646
- is_global: z.boolean().default(false),
3647
- structured: z.boolean().default(false),
3648
- memories: z.array(SingleMemorySchema).min(1).optional()
3649
- }).refine(
3650
- (data) => {
3651
- if (data.memories) return true;
3652
- return !!(data.type && data.title && data.content && data.importance && data.agent && data.model && data.scope);
3653
- },
3654
- {
3655
- message: "Either 'memories' array or single memory fields (type, title, content, importance, agent, model, scope) must be provided"
3656
- }
3657
- );
3658
- var MemoryUpdateSchema = z.object({
3659
- id: z.string().uuid().optional(),
3660
- code: z.string().max(20).optional(),
3661
- owner: z.string().min(1),
3662
- repo: z.string().min(1).transform(normalizeRepo),
3663
- type: MemoryTypeSchema.optional(),
3664
- title: z.string().min(3).max(255).optional(),
3665
- content: z.string().min(10).optional(),
3666
- importance: z.number().min(1).max(5).optional(),
3667
- agent: z.string().optional(),
3668
- role: z.string().optional(),
3669
- status: z.enum(["active", "archived"]).optional(),
3670
- supersedes: z.string().optional(),
3671
- tags: z.array(z.string()).optional(),
3672
- metadata: z.record(z.string(), z.any()).optional(),
3673
- is_global: z.boolean().optional(),
3674
- completed_at: z.string().optional(),
3675
- structured: z.boolean().default(false)
3676
- }).refine((data) => data.id !== void 0 || data.code !== void 0, {
3677
- message: "Either id or code must be provided"
3678
- }).refine(
3679
- (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,
3680
- { message: "At least one field must be provided for update" }
3681
- );
3682
- var MemorySearchSchema = z.object({
3683
- query: z.string().min(3),
3684
- prompt: z.string().optional(),
3685
- owner: z.string().min(1),
3686
- repo: z.string().min(1).transform(normalizeRepo),
3687
- types: z.array(MemoryTypeSchema).optional(),
3688
- minImportance: z.number().min(1).max(5).optional(),
3689
- limit: z.number().min(1).max(100).default(5),
3690
- offset: z.number().min(0).default(0),
3691
- includeRecap: z.boolean().default(false),
3692
- current_file_path: z.string().optional(),
3693
- include_archived: z.boolean().default(false),
3694
- current_tags: z.array(z.string()).optional(),
3695
- scope: MemoryScopeSchema.partial().optional(),
3696
- structured: z.boolean().default(false)
3697
- });
3698
- var MemoryAcknowledgeSchema = z.object({
3699
- memory_id: z.string().uuid().optional(),
3700
- code: z.string().max(20).optional(),
3701
- owner: z.string().min(1),
3702
- repo: z.string().min(1).transform(normalizeRepo),
3703
- status: z.enum(["used", "irrelevant", "contradictory"]),
3704
- application_context: z.string().min(10).optional(),
3705
- structured: z.boolean().default(false)
3706
- }).refine((data) => data.memory_id !== void 0 || data.code !== void 0, {
3707
- message: "Either memory_id or code must be provided"
3708
- });
3709
- var MemoryRecapSchema = z.object({
3710
- owner: z.string().min(1),
3711
- repo: z.string().min(1).transform(normalizeRepo),
3712
- limit: z.number().min(1).max(50).default(20),
3713
- offset: z.number().min(0).default(0),
3714
- structured: z.boolean().default(false)
3715
- });
3716
- var MemoryDeleteSchema = z.object({
3717
- owner: z.string().min(1),
3718
- repo: z.string().min(1).transform(normalizeRepo),
3719
- id: z.string().uuid().optional(),
3720
- ids: z.array(z.string().uuid()).min(1).optional(),
3721
- code: z.string().max(20).optional(),
3722
- codes: z.array(z.string().max(20)).min(1).optional(),
3723
- structured: z.boolean().default(false)
3724
- }).refine(
3725
- (data) => data.id !== void 0 || data.ids !== void 0 || data.code !== void 0 || data.codes !== void 0,
3726
- {
3727
- message: "Either 'id', 'ids', 'code', or 'codes' must be provided for deletion"
3728
- }
3729
- );
3730
- var MemorySummarizeSchema = z.object({
3731
- owner: z.string().min(1),
3732
- repo: z.string().min(1).transform(normalizeRepo),
3733
- signals: z.array(z.string().max(200)).min(1),
3734
- structured: z.boolean().default(false)
3735
- });
3736
- var MemorySynthesizeSchema = z.object({
3737
- owner: z.string().min(1),
3738
- repo: z.string().min(1).transform(normalizeRepo).optional(),
3739
- objective: z.string().min(5),
3740
- current_file_path: z.string().optional(),
3741
- include_summary: z.boolean().default(true),
3742
- include_tasks: z.boolean().default(true),
3743
- use_tools: z.boolean().default(true),
3744
- max_iterations: z.number().int().min(1).max(5).default(3),
3745
- max_tokens: z.number().int().min(128).max(4e3).default(1200),
3746
- structured: z.boolean().default(false)
3747
- });
3748
- var TaskStatusSchema = z.enum(["backlog", "pending", "in_progress", "completed", "canceled", "blocked"]);
3749
- var TaskPrioritySchema = z.number().min(1).max(5);
3750
- var TaskMetadataSchema = z.record(z.string(), z.any()).optional().superRefine((metadata, ctx) => {
3751
- if (!metadata) return;
3752
- if (metadata.required_skills !== void 0) {
3753
- if (!Array.isArray(metadata.required_skills)) {
3754
- ctx.addIssue({
3755
- code: z.ZodIssueCode.custom,
3756
- message: "metadata.required_skills must be an array of strings",
3757
- path: ["metadata", "required_skills"]
3758
- });
3759
- } else if (metadata.required_skills.length === 0) {
3760
- ctx.addIssue({
3761
- code: z.ZodIssueCode.custom,
3762
- message: "metadata.required_skills must not be empty when present",
3763
- path: ["metadata", "required_skills"]
3764
- });
3765
- } else if (!metadata.required_skills.every((s) => typeof s === "string" && s.length > 0)) {
3766
- ctx.addIssue({
3767
- code: z.ZodIssueCode.custom,
3768
- message: "metadata.required_skills must be an array of non-empty strings",
3769
- path: ["metadata", "required_skills"]
3770
- });
3771
- }
3772
- }
3773
- if (metadata.fsm_gates !== void 0) {
3774
- if (!Array.isArray(metadata.fsm_gates)) {
3775
- ctx.addIssue({
3776
- code: z.ZodIssueCode.custom,
3777
- message: "metadata.fsm_gates must be an array of strings",
3778
- path: ["metadata", "fsm_gates"]
3779
- });
3780
- } else if (metadata.fsm_gates.length === 0) {
3781
- ctx.addIssue({
3782
- code: z.ZodIssueCode.custom,
3783
- message: "metadata.fsm_gates must not be empty when present",
3784
- path: ["metadata", "fsm_gates"]
3785
- });
3786
- } else if (!metadata.fsm_gates.every((s) => typeof s === "string" && s.length > 0)) {
3787
- ctx.addIssue({
3788
- code: z.ZodIssueCode.custom,
3789
- message: "metadata.fsm_gates must be an array of non-empty strings",
3790
- path: ["metadata", "fsm_gates"]
3791
- });
3792
- }
3793
- }
3794
- });
3795
- var SingleTaskCreateSchema = z.object({
3796
- task_code: z.string().min(1).optional(),
3797
- phase: z.string().min(1),
3798
- title: z.string().min(3).max(100),
3799
- description: z.string().min(1),
3800
- status: TaskStatusSchema.default("backlog"),
3801
- priority: TaskPrioritySchema.default(3),
3802
- agent: z.string().optional(),
3803
- role: z.string().optional(),
3804
- doc_path: z.string().optional(),
3805
- tags: z.array(z.string()).optional(),
3806
- suggested_skills: z.array(z.string()).optional(),
3807
- metadata: TaskMetadataSchema,
3808
- parent_id: z.string().optional(),
3809
- depends_on: z.string().optional(),
3810
- est_tokens: z.number().int().min(0).optional()
3811
- });
3812
- var TaskCreateSchema = z.object({
3813
- owner: z.string().min(1),
3814
- repo: z.string().min(1).transform(normalizeRepo),
3815
- // Allow single task fields at top level (backward compatibility & single use)
3816
- task_code: z.string().min(1).optional(),
3817
- phase: z.string().min(1).optional(),
3818
- title: z.string().min(3).max(100).optional(),
3819
- description: z.string().min(1).optional(),
3820
- status: TaskStatusSchema.optional(),
3821
- priority: TaskPrioritySchema.optional(),
3822
- agent: z.string().optional(),
3823
- role: z.string().optional(),
3824
- doc_path: z.string().optional(),
3825
- tags: z.array(z.string()).optional(),
3826
- suggested_skills: z.array(z.string()).optional(),
3827
- metadata: z.record(z.string(), z.any()).optional(),
3828
- parent_id: z.string().optional(),
3829
- depends_on: z.string().optional(),
3830
- est_tokens: z.number().int().min(0).optional(),
3831
- // Allow bulk tasks
3832
- tasks: z.array(SingleTaskCreateSchema).min(1).optional(),
3833
- structured: z.boolean().default(false)
3834
- }).refine(
3835
- (data) => {
3836
- if (data.tasks) return true;
3837
- return !!(data.phase && data.title && data.description);
3838
- },
3839
- { message: "Either 'tasks' array or single task fields (phase, title, description) must be provided" }
3840
- );
3841
- var TaskCreateInteractiveSchema = SingleTaskCreateSchema.partial().extend({
3842
- owner: z.string().optional().default(""),
3843
- repo: z.string().min(1).transform(normalizeRepo).optional(),
3844
- structured: z.boolean().default(false)
3845
- });
3846
- var TaskUpdateSchema = z.object({
3847
- owner: z.string().min(1),
3848
- repo: z.string().min(1).transform(normalizeRepo),
3849
- id: z.string().uuid().optional(),
3850
- ids: z.array(z.string().uuid()).min(1).optional(),
3851
- task_code: z.string().optional(),
3852
- phase: z.string().optional(),
3853
- title: z.string().min(3).max(100).optional(),
3854
- description: z.string().optional(),
3855
- status: TaskStatusSchema.optional(),
3856
- priority: TaskPrioritySchema.optional(),
3857
- agent: z.string().min(1, "agent name is required").optional(),
3858
- role: z.string().min(1, "agent role is required").optional(),
3859
- model: z.string().optional(),
3860
- comment: z.string().min(1).optional(),
3861
- doc_path: z.string().optional(),
3862
- tags: z.array(z.string()).optional(),
3863
- metadata: z.record(z.string(), z.any()).optional(),
3864
- suggested_skills: z.array(z.string()).optional(),
3865
- parent_id: z.string().optional(),
3866
- depends_on: z.string().optional(),
3867
- est_tokens: z.number().int().min(0).optional(),
3868
- commit_id: z.string().optional(),
3869
- changed_files: z.array(z.string()).optional(),
3870
- force: z.boolean().optional(),
3871
- structured: z.boolean().default(false)
3872
- }).refine((data) => data.id !== void 0 || data.ids !== void 0 || data.task_code !== void 0, {
3873
- message: "Either 'id', 'ids', or 'task_code' must be provided for update"
3874
- }).refine((data) => Object.keys(data).length > 2, {
3875
- message: "At least one field besides repo and id/ids must be provided for update"
3876
- });
3877
- var TaskStatusValues = TaskStatusSchema.options;
3878
- var TaskStatusListSchema = z.string().refine(
3879
- (val) => {
3880
- if (val === "all") return true;
3881
- const parts = val.split(",").map((s) => s.trim()).filter(Boolean);
3882
- if (parts.length === 0) return false;
3883
- return parts.every((p) => TaskStatusValues.includes(p));
3884
- },
3885
- { message: "status must be 'all' or a comma-separated list of valid TaskStatus values" }
3886
- );
3887
- var TaskListSchema = z.object({
3888
- owner: z.string().min(1),
3889
- repo: z.string().min(1).transform(normalizeRepo),
3890
- status: TaskStatusListSchema.default("backlog,pending,in_progress,blocked"),
3891
- phase: z.string().optional(),
3892
- query: z.string().optional(),
3893
- limit: z.number().min(1).max(100).default(15),
3894
- offset: z.number().min(0).default(0),
3895
- structured: z.boolean().default(false)
3896
- });
3897
- var TaskSearchSchema = z.object({
3898
- owner: z.string().min(1),
3899
- repo: z.string().min(1).transform(normalizeRepo),
3900
- query: z.string().min(1),
3901
- status: z.string().optional(),
3902
- phase: z.string().optional(),
3903
- priority: z.number().min(1).max(5).optional(),
3904
- limit: z.number().min(1).max(100).default(10),
3905
- offset: z.number().min(0).default(0),
3906
- structured: z.boolean().default(false)
3907
- });
3908
- var TaskDeleteSchema = z.object({
3909
- owner: z.string().min(1),
3910
- repo: z.string().min(1).transform(normalizeRepo),
3911
- id: z.string().uuid().optional(),
3912
- ids: z.array(z.string().uuid()).min(1).optional(),
3913
- task_code: z.string().optional(),
3914
- structured: z.boolean().default(false)
3915
- }).refine((data) => data.id !== void 0 || data.ids !== void 0 || data.task_code !== void 0, {
3916
- message: "Either 'id', 'ids', or 'task_code' must be provided for deletion"
3917
- });
3918
- var MemoryDetailSchema = z.object({
3919
- id: z.string().uuid().optional(),
3920
- code: z.string().max(20).optional(),
3921
- owner: z.string().min(1),
3922
- repo: z.string().min(1).transform(normalizeRepo),
3923
- structured: z.boolean().default(false)
3924
- }).refine((data) => data.id !== void 0 || data.code !== void 0, {
3925
- message: "Either id or code must be provided"
3926
- });
3927
- var StandardDetailSchema = z.object({
3928
- id: z.string().uuid().optional(),
3929
- code: z.string().max(20).optional(),
3930
- owner: z.string().min(1),
3931
- repo: z.string().min(1).transform(normalizeRepo),
3932
- structured: z.boolean().default(false)
3933
- }).refine((data) => data.id !== void 0 || data.code !== void 0, {
3934
- message: "Either id or code must be provided"
3935
- });
3936
- var StandardDeleteSchema = z.object({
3937
- owner: z.string().min(1),
3938
- repo: z.string().min(1).transform(normalizeRepo),
3939
- id: z.string().uuid().optional(),
3940
- ids: z.array(z.string().uuid()).min(1).optional(),
3941
- code: z.string().max(20).optional(),
3942
- codes: z.array(z.string().max(20)).min(1).optional(),
3943
- structured: z.boolean().default(false)
3944
- }).refine(
3945
- (data) => data.id !== void 0 || data.ids !== void 0 || data.code !== void 0 || data.codes !== void 0,
3946
- {
3947
- message: "Either 'id', 'ids', 'code', or 'codes' must be provided for deletion"
3948
- }
3949
- );
3950
- var TaskGetSchema = z.object({
3951
- owner: z.string().min(1),
3952
- repo: z.string().min(1).transform(normalizeRepo),
3953
- id: z.string().uuid().optional(),
3954
- task_code: z.string().optional(),
3955
- structured: z.boolean().default(false)
3956
- }).refine((data) => data.id !== void 0 || data.task_code !== void 0, {
3957
- message: "Either id or task_code must be provided"
3958
- });
3959
- var HandoffStatusSchema = z.enum(["pending", "accepted", "rejected", "expired"]);
3960
- var HandoffCreateSchema = z.object({
3961
- owner: z.string().min(1),
3962
- repo: z.string().min(1).transform(normalizeRepo),
3963
- from_agent: z.string().min(1),
3964
- to_agent: z.string().min(1).optional(),
3965
- task_id: z.string().uuid().optional(),
3966
- task_code: z.string().optional(),
3967
- summary: z.string().min(1),
3968
- context: z.record(z.string(), z.any()).optional(),
3969
- expires_at: z.string().optional(),
3970
- structured: z.boolean().default(false)
3971
- }).refine((data) => !(data.task_id && data.task_code), {
3972
- message: "Provide either task_id or task_code, not both"
3973
- }).refine(
3974
- (data) => data.to_agent || data.task_id || data.task_code || data.context?.next_steps || data.context?.blockers || data.context?.remaining_work,
3975
- {
3976
- message: "Handoffs must identify a target agent, linked task, next_steps, blockers, or remaining_work. Do not create pending handoffs for completed-work summaries."
3977
- }
3978
- );
3979
- var HandoffUpdateSchema = z.object({
3980
- id: z.string().uuid(),
3981
- status: HandoffStatusSchema,
3982
- structured: z.boolean().default(false)
3983
- });
3984
- var HandoffListSchema = z.object({
3985
- owner: z.string().min(1),
3986
- repo: z.string().min(1).transform(normalizeRepo),
3987
- status: HandoffStatusSchema.optional(),
3988
- from_agent: z.string().min(1).optional(),
3989
- to_agent: z.string().min(1).optional(),
3990
- limit: z.number().min(1).max(100).default(20),
3991
- offset: z.number().min(0).default(0),
3992
- structured: z.boolean().default(false)
3993
- });
3994
- var TaskClaimSchema = z.object({
3995
- owner: z.string().min(1),
3996
- repo: z.string().min(1).transform(normalizeRepo),
3997
- task_id: z.string().uuid().optional(),
3998
- task_code: z.string().optional(),
3999
- agent: z.string().min(1),
4000
- role: z.string().optional(),
4001
- metadata: z.record(z.string(), z.any()).optional(),
4002
- structured: z.boolean().default(false)
4003
- }).refine((data) => data.task_id !== void 0 || data.task_code !== void 0, {
4004
- message: "Either task_id or task_code must be provided"
4005
- }).refine((data) => !(data.task_id && data.task_code), {
4006
- message: "Provide either task_id or task_code, not both"
4007
- });
4008
- var ClaimListSchema = z.object({
4009
- owner: z.string().min(1),
4010
- repo: z.string().min(1).transform(normalizeRepo),
4011
- agent: z.string().min(1).optional(),
4012
- active_only: z.boolean().default(true),
4013
- limit: z.number().min(1).max(100).default(20),
4014
- offset: z.number().min(0).default(0),
4015
- structured: z.boolean().default(false)
4016
- });
4017
- var ClaimReleaseSchema = z.object({
4018
- owner: z.string().min(1),
4019
- repo: z.string().min(1).transform(normalizeRepo),
4020
- task_id: z.string().uuid().optional(),
4021
- task_code: z.string().optional(),
4022
- agent: z.string().min(1).optional(),
4023
- structured: z.boolean().default(false)
4024
- }).refine((data) => data.task_id !== void 0 || data.task_code !== void 0, {
4025
- message: "Either task_id or task_code must be provided"
4026
- }).refine((data) => !(data.task_id && data.task_code), {
4027
- message: "Provide either task_id or task_code, not both"
4028
- });
4029
- var StandardStoreSchema = z.object({
4030
- name: z.string().min(3).max(255).optional(),
4031
- content: z.string().min(10).optional(),
4032
- parent_id: z.string().optional(),
4033
- context: z.string().optional(),
4034
- version: z.string().optional(),
4035
- language: z.string().optional(),
4036
- stack: z.array(z.string()).optional(),
4037
- owner: z.string().min(1),
4038
- repo: z.string().transform(normalizeRepo).optional(),
4039
- is_global: z.boolean().optional(),
4040
- tags: z.array(z.string().min(1)).min(1).optional(),
4041
- metadata: z.record(z.string(), z.any()).refine((value) => Object.keys(value).length > 0, { message: "metadata must contain at least one key" }).optional(),
4042
- agent: z.string().optional(),
4043
- model: z.string().optional(),
4044
- structured: z.boolean().default(false),
4045
- standards: z.array(SingleStandardSchema).min(1).optional()
4046
- }).refine(
4047
- (data) => {
4048
- if (data.standards) return true;
4049
- return !!(data.name && data.content && data.tags && data.metadata);
4050
- },
4051
- { message: "Either 'standards' array or single standard fields (name, content, tags, metadata) must be provided" }
4052
- ).refine((data) => data.is_global !== false || !!data.repo, {
4053
- message: "repo is required for repo-specific standards"
4054
- });
4055
- var StandardUpdateSchema = z.object({
4056
- id: z.string().uuid().optional(),
4057
- code: z.string().max(20).optional(),
4058
- name: z.string().min(3).max(255).optional(),
4059
- content: z.string().min(10).optional(),
4060
- parent_id: z.string().nullable().optional(),
4061
- context: z.string().optional(),
4062
- version: z.string().optional(),
4063
- language: z.string().optional(),
4064
- stack: z.array(z.string().min(1)).min(1).optional(),
4065
- owner: z.string().min(1),
4066
- repo: z.string().transform(normalizeRepo),
4067
- is_global: z.boolean().optional(),
4068
- tags: z.array(z.string().min(1)).min(1).optional(),
4069
- metadata: z.record(z.string(), z.any()).refine((value) => Object.keys(value).length > 0, { message: "metadata must contain at least one key" }).optional(),
4070
- agent: z.string().optional(),
4071
- model: z.string().optional(),
4072
- structured: z.boolean().default(false)
4073
- }).refine((data) => data.id !== void 0 || data.code !== void 0, {
4074
- message: "Either id or code must be provided"
4075
- }).refine(
4076
- (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,
4077
- { message: "At least one field must be provided for update" }
4078
- ).refine((data) => data.is_global !== false || !!data.repo, {
4079
- message: "repo is required for repo-specific standards"
4080
- });
4081
- var StandardSearchSchema = z.object({
4082
- query: z.string().optional(),
4083
- stack: z.array(z.string()).optional(),
4084
- tags: z.array(z.string()).optional(),
4085
- language: z.string().optional(),
4086
- context: z.string().optional(),
4087
- version: z.string().optional(),
4088
- owner: z.string().optional().default(""),
4089
- repo: z.string().transform(normalizeRepo).optional(),
4090
- is_global: z.boolean().optional(),
4091
- limit: z.number().min(1).max(100).default(20),
4092
- offset: z.number().min(0).default(0),
4093
- structured: z.boolean().default(false)
4094
- });
3589
+ // src/mcp/tools/tool-definitions.ts
4095
3590
  var TOOL_DEFINITIONS = [
4096
3591
  {
4097
3592
  name: "memory-synthesize",
@@ -4183,7 +3678,8 @@ var TOOL_DEFINITIONS = [
4183
3678
  role: { type: "string" },
4184
3679
  doc_path: { type: "string" },
4185
3680
  structured: { type: "boolean", default: false, description: "If true, returns structured JSON result." }
4186
- }
3681
+ },
3682
+ required: ["owner"]
4187
3683
  },
4188
3684
  outputSchema: {
4189
3685
  type: "object",
@@ -4204,11 +3700,26 @@ var TOOL_DEFINITIONS = [
4204
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.",
4205
3701
  inputSchema: {
4206
3702
  type: "object",
4207
- properties: {
4208
- id: { type: "string", format: "uuid", description: "Memory entry ID. Optional if code is provided." },
4209
- code: { type: "string", description: "Short memory code. Optional if id is provided." },
4210
- structured: { type: "boolean", default: false, description: "If true, returns structured JSON details." }
4211
- }
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
+ }
3711
+ },
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
+ ]
4212
3723
  }
4213
3724
  },
4214
3725
  {
@@ -4217,11 +3728,26 @@ var TOOL_DEFINITIONS = [
4217
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.",
4218
3729
  inputSchema: {
4219
3730
  type: "object",
4220
- properties: {
4221
- id: { type: "string", format: "uuid", description: "Coding standard ID. Optional if code is provided." },
4222
- code: { type: "string", description: "Short standard code (e.g. 'A3KPQ2'). Optional if id is provided." },
4223
- structured: { type: "boolean", default: false, description: "If true, returns structured JSON details." }
4224
- }
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
+ }
3739
+ },
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
+ ]
4225
3751
  }
4226
3752
  },
4227
3753
  {
@@ -4230,18 +3756,55 @@ var TOOL_DEFINITIONS = [
4230
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.",
4231
3757
  inputSchema: {
4232
3758
  type: "object",
4233
- properties: {
4234
- owner: { type: "string", description: "Organization/namespace (e.g., GitHub org or username)" },
4235
- repo: { type: "string", description: "Repository name" },
4236
- id: { type: "string", format: "uuid", description: "Task ID (optional if task_code is provided)" },
4237
- task_code: { type: "string", description: "Task code (e.g. TASK-001) (optional if id is provided)" },
4238
- structured: {
4239
- type: "boolean",
4240
- default: false,
4241
- 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
+ }
4242
3806
  }
4243
- },
4244
- required: ["repo", "owner"]
3807
+ ]
4245
3808
  }
4246
3809
  },
4247
3810
  {
@@ -4256,118 +3819,133 @@ var TOOL_DEFINITIONS = [
4256
3819
  },
4257
3820
  inputSchema: {
4258
3821
  type: "object",
4259
- properties: {
4260
- type: {
4261
- type: "string",
4262
- enum: ["code_fact", "decision", "mistake", "pattern", "task_archive"],
4263
- description: "Type of durable knowledge being stored. Coordination types such as file_claim are intentionally unsupported."
4264
- },
4265
- title: {
4266
- type: "string",
4267
- minLength: 3,
4268
- maxLength: 100,
4269
- description: "Short human-readable title for the memory. Do not embed bracketed metadata like agent/role/date prefixes here."
4270
- },
4271
- content: {
4272
- type: "string",
4273
- minLength: 10,
4274
- description: "The memory content"
4275
- },
4276
- importance: {
4277
- type: "number",
4278
- minimum: 1,
4279
- maximum: 5,
4280
- description: "Importance score (1-5)"
4281
- },
4282
- agent: {
4283
- type: "string",
4284
- description: "Name of the agent creating this memory"
4285
- },
4286
- role: {
4287
- type: "string",
4288
- description: "Role of the agent creating this memory"
4289
- },
4290
- model: {
4291
- type: "string",
4292
- description: "AI model used by the agent"
4293
- },
4294
- scope: {
4295
- type: "object",
3822
+ oneOf: [
3823
+ {
3824
+ title: "Single memory",
3825
+ required: ["type", "title", "content", "importance", "agent", "model", "scope"],
4296
3826
  properties: {
4297
- owner: { type: "string", description: "Organization/namespace (e.g., GitHub org or username)" },
4298
- repo: { type: "string", description: "Repository/project name" },
4299
- branch: { type: "string", description: "Git branch this memory relates to" },
4300
- folder: { type: "string", description: "Subdirectory within the repo" },
4301
- language: { type: "string", description: "Programming language (e.g., 'typescript', 'python')" }
4302
- },
4303
- required: ["owner", "repo"]
4304
- },
4305
- tags: {
4306
- type: "array",
4307
- items: { type: "string" },
4308
- description: "Technology stack tags (e.g., ['filament', 'laravel'])"
4309
- },
4310
- metadata: {
4311
- type: "object",
4312
- description: "Structured metadata for non-title context such as source agent, claim fields, or timestamps"
4313
- },
4314
- is_global: {
4315
- type: "boolean",
4316
- description: "If true, this memory is shared across all repositories"
4317
- },
4318
- ttlDays: {
4319
- type: "number",
4320
- minimum: 1,
4321
- description: "Time-to-live in days. After this period, the memory expires."
4322
- },
4323
- supersedes: {
4324
- type: "string",
4325
- description: "Optional memory ID (UUID) or memory code to supersede. Resolved before storing."
4326
- },
4327
- memories: {
4328
- type: "array",
4329
- items: {
4330
- type: "object",
4331
- properties: {
4332
- type: {
4333
- type: "string",
4334
- enum: ["code_fact", "decision", "mistake", "pattern", "task_archive"],
4335
- 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')" }
4336
3869
  },
4337
- title: { type: "string", minLength: 3, maxLength: 100, description: "Short human-readable title" },
4338
- content: { type: "string", minLength: 10, description: "The memory content" },
4339
- importance: { type: "number", minimum: 1, maximum: 5, description: "Importance score (1-5)" },
4340
- agent: { type: "string", description: "Name of the agent creating this memory" },
4341
- role: { type: "string", default: "unknown", description: "Role of the agent creating this memory" },
4342
- model: { type: "string", description: "AI model used by the agent" },
4343
- 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: {
4344
3906
  type: "object",
4345
3907
  properties: {
4346
- owner: { type: "string", description: "Organization/namespace (e.g., GitHub org or username)" },
4347
- repo: { type: "string", description: "Repository/project name" },
4348
- branch: { type: "string", description: "Git branch this memory relates to" },
4349
- folder: { type: "string", description: "Subdirectory within the repo" },
4350
- 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" }
4351
3936
  },
4352
- required: ["owner", "repo"]
3937
+ required: ["type", "title", "content", "importance", "agent", "model", "scope"]
4353
3938
  },
4354
- code: { type: "string", description: "Optional custom code. Auto-generated if omitted." },
4355
- ttlDays: { type: "number", minimum: 1, description: "Time-to-live in days" },
4356
- supersedes: { type: "string", description: "UUID or code of a memory this entry replaces" },
4357
- tags: { type: "array", items: { type: "string" }, description: "Technology stack tags" },
4358
- metadata: { type: "object", description: "Structured metadata for non-title context" },
4359
- is_global: { type: "boolean", default: false, description: "If true, shared across all repositories" }
3939
+ description: "Array of memories for bulk creation"
4360
3940
  },
4361
- required: ["type", "title", "content", "importance", "agent", "model", "scope"]
4362
- },
4363
- description: "Array of memories for bulk creation"
4364
- },
4365
- structured: {
4366
- type: "boolean",
4367
- default: false,
4368
- 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
+ }
4369
3947
  }
4370
- }
3948
+ ]
4371
3949
  },
4372
3950
  outputSchema: {
4373
3951
  type: "object",
@@ -4426,30 +4004,60 @@ var TOOL_DEFINITIONS = [
4426
4004
  },
4427
4005
  inputSchema: {
4428
4006
  type: "object",
4429
- properties: {
4430
- id: { type: "string", format: "uuid", description: "Memory entry ID. Optional if code is provided." },
4431
- code: { type: "string", maxLength: 20, description: "Short memory code. Optional if id is provided." },
4432
- type: {
4433
- type: "string",
4434
- 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
+ }
4435
4033
  },
4436
- title: { type: "string", minLength: 3, maxLength: 100 },
4437
- content: { type: "string", minLength: 10 },
4438
- importance: { type: "number", minimum: 1, maximum: 5 },
4439
- agent: { type: "string" },
4440
- role: { type: "string" },
4441
- status: { type: "string", enum: ["active", "archived"] },
4442
- supersedes: { type: "string" },
4443
- tags: { type: "array", items: { type: "string" } },
4444
- metadata: { type: "object" },
4445
- is_global: { type: "boolean" },
4446
- completed_at: { type: "string" },
4447
- structured: {
4448
- type: "boolean",
4449
- default: false,
4450
- 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
+ }
4451
4059
  }
4452
- }
4060
+ ]
4453
4061
  },
4454
4062
  outputSchema: {
4455
4063
  type: "object",
@@ -4603,24 +4211,58 @@ var TOOL_DEFINITIONS = [
4603
4211
  },
4604
4212
  inputSchema: {
4605
4213
  type: "object",
4606
- properties: {
4607
- repo: { type: "string", description: "Repository name (optional for single id)" },
4608
- id: { type: "string", format: "uuid", description: "Memory entry ID to delete. Optional if code is provided." },
4609
- ids: {
4610
- type: "array",
4611
- items: { type: "string", format: "uuid" },
4612
- minItems: 1,
4613
- 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
+ }
4614
4224
  },
4615
- code: { type: "string", maxLength: 20, description: "Short memory code. Optional if id is provided." },
4616
- codes: {
4617
- type: "array",
4618
- items: { type: "string", maxLength: 20 },
4619
- minItems: 1,
4620
- 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
+ }
4621
4239
  },
4622
- structured: { type: "boolean", default: false, description: "If true, returns structured JSON result." }
4623
- }
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
+ ]
4624
4266
  },
4625
4267
  outputSchema: {
4626
4268
  type: "object",
@@ -4648,28 +4290,58 @@ var TOOL_DEFINITIONS = [
4648
4290
  },
4649
4291
  inputSchema: {
4650
4292
  type: "object",
4651
- properties: {
4652
- repo: { type: "string", description: "Repository name (optional for single id)" },
4653
- id: {
4654
- type: "string",
4655
- format: "uuid",
4656
- 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
+ }
4657
4303
  },
4658
- ids: {
4659
- type: "array",
4660
- items: { type: "string", format: "uuid" },
4661
- minItems: 1,
4662
- 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
+ }
4663
4318
  },
4664
- code: { type: "string", maxLength: 20, description: "Short standard code. Optional if id is provided." },
4665
- codes: {
4666
- type: "array",
4667
- items: { type: "string", maxLength: 20 },
4668
- minItems: 1,
4669
- 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
+ }
4670
4328
  },
4671
- structured: { type: "boolean", default: false, description: "If true, returns structured JSON result." }
4672
- }
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
+ ]
4673
4345
  },
4674
4346
  outputSchema: {
4675
4347
  type: "object",
@@ -4883,68 +4555,269 @@ var TOOL_DEFINITIONS = [
4883
4555
  },
4884
4556
  inputSchema: {
4885
4557
  type: "object",
4886
- properties: {
4887
- owner: { type: "string", description: "Organization/namespace (e.g., GitHub org or username)" },
4888
- repo: { type: "string", description: "Repository name" },
4889
- id: { type: "string", format: "uuid", description: "Task ID (for single update)" },
4890
- ids: { type: "array", items: { type: "string", format: "uuid" }, description: "Task IDs (for bulk update)" },
4891
- task_code: { type: "string" },
4892
- phase: { type: "string" },
4893
- title: { type: "string", minLength: 3, maxLength: 100 },
4894
- description: {
4895
- type: "string",
4896
- description: "Detailed description. MUST follow format: 1. Context & Analysis, 2. Step & Implementation, 3. Acceptance & Verification"
4897
- },
4898
- status: {
4899
- type: "string",
4900
- enum: ["backlog", "pending", "in_progress", "completed", "canceled", "blocked"],
4901
- description: "New status. Transitions from 'backlog', 'pending' or 'blocked' to 'completed' are NOT allowed."
4902
- },
4903
- priority: {
4904
- type: "number",
4905
- minimum: 1,
4906
- maximum: 5,
4907
- description: "Task priority where 1=Low, 2=Normal, 3=Medium, 4=High, 5=Critical."
4908
- },
4909
- agent: { type: "string" },
4910
- role: { type: "string" },
4911
- model: { type: "string" },
4912
- comment: {
4913
- type: "string",
4914
- description: "REQUIRED when changing task status. Explain WHY the status is changing (e.g., 'Starting implementation', 'Blocked by missing API docs', 'Verified fix')."
4915
- },
4916
- doc_path: { type: "string" },
4917
- tags: { type: "array", items: { type: "string" } },
4918
- metadata: { type: "object" },
4919
- parent_id: {
4920
- type: "string",
4921
- description: "Optional parent task ID (UUID) or parent task code (e.g. TASK-001). Resolved to UUID before storing."
4922
- },
4923
- depends_on: {
4924
- type: "string",
4925
- description: "Optional task ID (UUID) or task code (e.g. TASK-001). Resolved to UUID before storing."
4926
- },
4927
- est_tokens: {
4928
- type: "number",
4929
- minimum: 0,
4930
- description: "Estimated total tokens actually used for this task. Required when status changes to 'completed'."
4931
- },
4932
- commit_id: {
4933
- type: "string",
4934
- 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
+ }
4935
4621
  },
4936
- changed_files: {
4937
- type: "array",
4938
- items: { type: "string" },
4939
- 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
+ }
4940
4688
  },
4941
- force: {
4942
- type: "boolean",
4943
- 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
+ }
4944
4751
  },
4945
- structured: { type: "boolean", default: false, description: "If true, returns structured JSON result." }
4946
- },
4947
- 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
+ ]
4948
4821
  },
4949
4822
  outputSchema: {
4950
4823
  type: "object",
@@ -4976,19 +4849,57 @@ var TOOL_DEFINITIONS = [
4976
4849
  },
4977
4850
  inputSchema: {
4978
4851
  type: "object",
4979
- properties: {
4980
- owner: { type: "string", description: "Organization/namespace (e.g., GitHub org or username)" },
4981
- repo: { type: "string", description: "Repository name" },
4982
- id: {
4983
- type: "string",
4984
- format: "uuid",
4985
- 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
+ }
4986
4862
  },
4987
- ids: { type: "array", items: { type: "string", format: "uuid" }, description: "Task IDs (for bulk deletion)" },
4988
- task_code: { type: "string", description: "Task code (e.g. TASK-001). Optional if id is provided." },
4989
- structured: { type: "boolean", default: false, description: "If true, returns structured JSON result." }
4990
- },
4991
- 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
+ ]
4992
4903
  },
4993
4904
  outputSchema: {
4994
4905
  type: "object",
@@ -5525,24 +5436,54 @@ var TOOL_DEFINITIONS = [
5525
5436
  },
5526
5437
  inputSchema: {
5527
5438
  type: "object",
5528
- properties: {
5529
- id: { type: "string", format: "uuid", description: "Standard ID to update. Optional if code is provided." },
5530
- code: { type: "string", maxLength: 20, description: "Short standard code. Optional if id is provided." },
5531
- name: { type: "string", minLength: 3, maxLength: 255 },
5532
- content: { type: "string", minLength: 10 },
5533
- parent_id: { type: "string", nullable: true },
5534
- context: { type: "string" },
5535
- version: { type: "string" },
5536
- language: { type: "string" },
5537
- stack: { type: "array", items: { type: "string" } },
5538
- repo: { type: "string" },
5539
- is_global: { type: "boolean" },
5540
- tags: { type: "array", items: { type: "string" } },
5541
- metadata: { type: "object" },
5542
- agent: { type: "string" },
5543
- model: { type: "string" },
5544
- structured: { type: "boolean", default: false }
5545
- }
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
+ ]
5546
5487
  },
5547
5488
  outputSchema: {
5548
5489
  type: "object",
@@ -6144,30 +6085,30 @@ async function completePromptArgument(name, argName, value, contextArguments, da
6144
6085
  import { randomUUID as randomUUID2 } from "crypto";
6145
6086
 
6146
6087
  // src/mcp/utils/mcp-response.ts
6147
- import { z as z2 } from "zod";
6148
- var McpAnnotationsSchema = z2.object({
6149
- audience: z2.array(z2.enum(["user", "assistant"])).optional(),
6150
- priority: z2.number().min(0).max(1).optional(),
6151
- 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()
6152
6093
  }).strict().optional();
6153
- var McpContentSchema = z2.discriminatedUnion("type", [
6154
- z2.object({
6155
- type: z2.literal("text"),
6156
- text: z2.string(),
6094
+ var McpContentSchema = z.discriminatedUnion("type", [
6095
+ z.object({
6096
+ type: z.literal("text"),
6097
+ text: z.string(),
6157
6098
  annotations: McpAnnotationsSchema
6158
6099
  }),
6159
- z2.object({
6160
- type: z2.literal("image"),
6161
- data: z2.string(),
6162
- mimeType: z2.string(),
6100
+ z.object({
6101
+ type: z.literal("image"),
6102
+ data: z.string(),
6103
+ mimeType: z.string(),
6163
6104
  annotations: McpAnnotationsSchema
6164
6105
  }),
6165
- z2.object({
6166
- type: z2.literal("resource"),
6167
- resource: z2.object({
6168
- uri: z2.string(),
6169
- mimeType: z2.string().optional(),
6170
- 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(),
6171
6112
  annotations: McpAnnotationsSchema
6172
6113
  })
6173
6114
  })
@@ -6249,6 +6190,529 @@ function getPrimaryTextContent(response) {
6249
6190
  return textItem?.type === "text" ? textItem.text : "";
6250
6191
  }
6251
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
+
6252
6716
  // src/mcp/tools/handoff.manage.ts
6253
6717
  function buildHandoffListSummary(repo, count, status, fromAgent, toAgent) {
6254
6718
  const parts = [`Found ${count} handoff${count === 1 ? "" : "s"} in repo "${repo}".`];
@@ -6561,28 +7025,6 @@ export {
6561
7025
  normalizeRepo,
6562
7026
  SQLiteStore,
6563
7027
  RealVectorStore,
6564
- MemoryStoreSchema,
6565
- MemoryUpdateSchema,
6566
- MemorySearchSchema,
6567
- MemoryAcknowledgeSchema,
6568
- MemoryRecapSchema,
6569
- MemoryDeleteSchema,
6570
- MemorySummarizeSchema,
6571
- MemorySynthesizeSchema,
6572
- TaskStatusSchema,
6573
- TaskCreateSchema,
6574
- TaskCreateInteractiveSchema,
6575
- TaskUpdateSchema,
6576
- TaskListSchema,
6577
- TaskSearchSchema,
6578
- TaskDeleteSchema,
6579
- MemoryDetailSchema,
6580
- StandardDetailSchema,
6581
- StandardDeleteSchema,
6582
- TaskGetSchema,
6583
- StandardStoreSchema,
6584
- StandardUpdateSchema,
6585
- StandardSearchSchema,
6586
7028
  TOOL_DEFINITIONS,
6587
7029
  encodeCursor,
6588
7030
  decodeCursor,
@@ -6605,6 +7047,28 @@ export {
6605
7047
  completePromptArgument,
6606
7048
  createMcpResponse,
6607
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,
6608
7072
  handleHandoffCreate,
6609
7073
  handleHandoffList,
6610
7074
  handleHandoffUpdate,