@vheins/local-memory-mcp 0.18.11 → 0.18.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -81,8 +81,8 @@ function loadServerInstructions() {
81
81
  // src/mcp/capabilities.ts
82
82
  var __dirname2 = path2.dirname(fileURLToPath2(import.meta.url));
83
83
  var pkgVersion = "0.1.0";
84
- if ("0.18.11") {
85
- pkgVersion = "0.18.11";
84
+ if ("0.18.13") {
85
+ pkgVersion = "0.18.13";
86
86
  } else {
87
87
  let searchDir = __dirname2;
88
88
  for (let i = 0; i < 5; i++) {
@@ -672,7 +672,7 @@ var MigrationManager = class {
672
672
  HAVING cnt > 1
673
673
  `);
674
674
  if (dupRows.length > 0) {
675
- console.log(`Found ${dupRows.length} duplicate task_code(s). Deduplicating by suffix...`);
675
+ logger.info(`Found ${dupRows.length} duplicate task_code(s). Deduplicating by suffix...`);
676
676
  for (const dup of dupRows) {
677
677
  const rows = this.all(
678
678
  `SELECT id, task_code, created_at FROM tasks
@@ -686,7 +686,7 @@ var MigrationManager = class {
686
686
  const newCode = `${dup.task_code}-${i + 1}`;
687
687
  this.run("UPDATE tasks SET task_code = ? WHERE id = ?", newCode, rows[i].id);
688
688
  }
689
- console.log(` Deduplicated ${dup.task_code}: kept 1 (${rows[0].id}), renamed ${rows.length - 1} rows`);
689
+ logger.info(` Deduplicated ${dup.task_code}: kept 1 (${rows[0].id}), renamed ${rows.length - 1} rows`);
690
690
  }
691
691
  }
692
692
  this.exec(`CREATE UNIQUE INDEX IF NOT EXISTS idx_tasks_code_owner_repo ON tasks(owner, repo, task_code);`);
@@ -1323,7 +1323,7 @@ var MemoryEntity = class extends BaseEntity {
1323
1323
  let sql = "SELECT * FROM memories WHERE code = ?";
1324
1324
  const params = [code];
1325
1325
  if (owner && repo) {
1326
- sql += " AND owner = ? AND repo = ?";
1326
+ sql += " AND ((owner = ? AND repo = ?) OR is_global = 1)";
1327
1327
  params.push(owner, repo);
1328
1328
  }
1329
1329
  const row = this.get(sql, params);
@@ -1523,9 +1523,11 @@ var MemoryEntity = class extends BaseEntity {
1523
1523
  incrementHitCounts(ids) {
1524
1524
  if (!ids || ids.length === 0) return;
1525
1525
  const now = (/* @__PURE__ */ new Date()).toISOString();
1526
- for (const id of ids) {
1527
- this.run("UPDATE memories SET hit_count = hit_count + 1, last_used_at = ? WHERE id = ?", [now, id]);
1528
- }
1526
+ const placeholders = ids.map(() => "?").join(",");
1527
+ this.run(`UPDATE memories SET hit_count = hit_count + 1, last_used_at = ? WHERE id IN (${placeholders})`, [
1528
+ now,
1529
+ ...ids
1530
+ ]);
1529
1531
  }
1530
1532
  incrementRecallCount(id) {
1531
1533
  this.run("UPDATE memories SET recall_count = recall_count + 1, last_used_at = ? WHERE id = ?", [
@@ -1559,7 +1561,7 @@ var MemoryEntity = class extends BaseEntity {
1559
1561
  );
1560
1562
  }
1561
1563
  listMemoriesForDashboard(options) {
1562
- const {
1564
+ let {
1563
1565
  owner,
1564
1566
  repo,
1565
1567
  type,
@@ -1573,6 +1575,17 @@ var MemoryEntity = class extends BaseEntity {
1573
1575
  sortBy = "created_at",
1574
1576
  sortOrder = "DESC"
1575
1577
  } = options;
1578
+ const ALLOWED_SORT_COLUMNS = /* @__PURE__ */ new Set([
1579
+ "created_at",
1580
+ "updated_at",
1581
+ "importance",
1582
+ "hit_count",
1583
+ "title",
1584
+ "recall_rate"
1585
+ ]);
1586
+ if (!ALLOWED_SORT_COLUMNS.has(sortBy)) {
1587
+ sortBy = "created_at";
1588
+ }
1576
1589
  const where = ["1=1"];
1577
1590
  const params = [];
1578
1591
  if (owner) {
@@ -1616,7 +1629,7 @@ var MemoryEntity = class extends BaseEntity {
1616
1629
  ...this.rowToMemoryEntry(row),
1617
1630
  recall_rate: row.recall_rate || 0
1618
1631
  }));
1619
- return { items, memories: items, total, limit, offset };
1632
+ return { items, total, limit, offset };
1620
1633
  }
1621
1634
  };
1622
1635
 
@@ -2479,34 +2492,45 @@ var SystemEntity = class extends BaseEntity {
2479
2492
  const pendingHandoffsByRepo = Object.fromEntries(pendingHandoffRows.map((row) => [row.repo, row.count]));
2480
2493
  const unassignedHandoffsByRepo = Object.fromEntries(unassignedHandoffRows.map((row) => [row.repo, row.count]));
2481
2494
  const staleClaimsByRepo = Object.fromEntries(staleClaimRows.map((row) => [row.repo, row.count]));
2482
- const repoOwnerFilter = owner ? " AND owner = ?" : "";
2495
+ const ownerWhere = owner ? " WHERE owner = ?" : "";
2496
+ const memoryCountRows = this.all(
2497
+ `SELECT repo, COUNT(*) as count FROM memories${ownerWhere} GROUP BY repo`,
2498
+ ownerParams
2499
+ );
2500
+ const memoryCountByRepo = Object.fromEntries(memoryCountRows.map((r) => [r.repo, r.count]));
2501
+ const taskAggRows = this.all(
2502
+ `SELECT repo, status, COUNT(*) as count FROM tasks${ownerWhere} GROUP BY repo, status`,
2503
+ ownerParams
2504
+ );
2505
+ const taskCountsByRepo = {};
2506
+ for (const row of taskAggRows) {
2507
+ if (!taskCountsByRepo[row.repo]) {
2508
+ taskCountsByRepo[row.repo] = { total: 0, byStatus: {} };
2509
+ }
2510
+ taskCountsByRepo[row.repo].total += row.count;
2511
+ taskCountsByRepo[row.repo].byStatus[row.status] = row.count;
2512
+ }
2513
+ const lastActivityRows = this.all(
2514
+ `SELECT repo, MAX(updated_at) as last FROM (
2515
+ SELECT repo, updated_at FROM memories${ownerWhere}
2516
+ UNION ALL
2517
+ SELECT repo, updated_at FROM tasks${ownerWhere}
2518
+ ) GROUP BY repo`,
2519
+ owner ? [owner, owner] : []
2520
+ );
2521
+ const lastActivityByRepo = Object.fromEntries(lastActivityRows.map((r) => [r.repo, r.last]));
2483
2522
  return repos.map((repo) => {
2484
- const memoryCountRow = this.get(
2485
- `SELECT COUNT(*) as count FROM memories WHERE repo = ?${repoOwnerFilter}`,
2486
- owner ? [repo, owner] : [repo]
2487
- );
2488
- const lastActivityRow = this.get(
2489
- `SELECT MAX(created_at) as last FROM (SELECT created_at FROM memories WHERE repo = ?${repoOwnerFilter} UNION ALL SELECT created_at FROM tasks WHERE repo = ?${repoOwnerFilter} UNION ALL SELECT created_at FROM action_log WHERE repo = ?${repoOwnerFilter})`,
2490
- owner ? [repo, owner, repo, owner, repo, owner] : [repo, repo, repo]
2491
- );
2492
- const taskStatusRows = this.all(
2493
- `SELECT status, COUNT(*) as count FROM tasks WHERE repo = ?${repoOwnerFilter} GROUP BY status`,
2494
- owner ? [repo, owner] : [repo]
2495
- );
2496
- const taskStatusMap = {};
2497
- taskStatusRows.forEach((r) => {
2498
- taskStatusMap[r.status] = r.count;
2499
- });
2500
- const taskCount = taskStatusRows.reduce((sum, r) => sum + r.count, 0);
2523
+ const memCount = memoryCountByRepo[repo] ?? 0;
2524
+ const taskInfo = taskCountsByRepo[repo] ?? { total: 0, byStatus: {} };
2501
2525
  return {
2502
2526
  repo,
2503
- memoryCount: memoryCountRow?.count ?? 0,
2504
- taskCount,
2505
- inProgressCount: taskStatusMap["in_progress"] ?? 0,
2506
- pendingCount: taskStatusMap["pending"] ?? 0,
2507
- blockedCount: taskStatusMap["blocked"] ?? 0,
2508
- backlogCount: taskStatusMap["backlog"] ?? 0,
2509
- lastActivity: lastActivityRow?.last ?? null,
2527
+ memoryCount: memCount,
2528
+ taskCount: taskInfo.total,
2529
+ inProgressCount: taskInfo.byStatus["in_progress"] ?? 0,
2530
+ pendingCount: taskInfo.byStatus["pending"] ?? 0,
2531
+ blockedCount: taskInfo.byStatus["blocked"] ?? 0,
2532
+ backlogCount: taskInfo.byStatus["backlog"] ?? 0,
2533
+ lastActivity: lastActivityByRepo[repo] ?? null,
2510
2534
  activeClaims: activeClaimsByRepo[repo] ?? 0,
2511
2535
  pendingHandoffs: pendingHandoffsByRepo[repo] ?? 0,
2512
2536
  unassignedHandoffs: unassignedHandoffsByRepo[repo] ?? 0,
@@ -2766,7 +2790,7 @@ var StandardEntity = class extends BaseEntity {
2766
2790
  let sql = "SELECT * FROM coding_standards WHERE code = ?";
2767
2791
  const params = [code];
2768
2792
  if (owner && repo) {
2769
- sql += " AND owner = ? AND repo = ?";
2793
+ sql += " AND ((owner = ? AND repo = ?) OR is_global = 1)";
2770
2794
  params.push(owner, repo);
2771
2795
  }
2772
2796
  const row = this.get(sql, params);
@@ -3586,512 +3610,8 @@ function inferOwnerFromSession(session) {
3586
3610
  return void 0;
3587
3611
  }
3588
3612
 
3589
- // src/mcp/tools/schemas.ts
3590
- import { z } from "zod";
3591
- var MemoryScopeSchema = z.object({
3592
- owner: z.string().min(1),
3593
- repo: z.string().min(1).transform(normalizeRepo),
3594
- branch: z.string().optional(),
3595
- folder: z.string().optional(),
3596
- language: z.string().optional()
3597
- });
3598
- var MemoryTypeSchema = z.enum(["code_fact", "decision", "mistake", "pattern", "task_archive"]);
3599
- var SingleMemorySchema = z.object({
3600
- code: z.string().max(20).optional(),
3601
- type: MemoryTypeSchema,
3602
- title: z.string().min(3).max(255),
3603
- content: z.string().min(10),
3604
- importance: z.number().min(1).max(5),
3605
- agent: z.string().min(1),
3606
- role: z.string().optional().default("unknown"),
3607
- model: z.string().min(1),
3608
- scope: MemoryScopeSchema,
3609
- ttlDays: z.number().min(1).optional(),
3610
- supersedes: z.string().optional(),
3611
- tags: z.array(z.string()).optional(),
3612
- metadata: z.record(z.string(), z.any()).optional(),
3613
- is_global: z.boolean().default(false)
3614
- });
3615
- var SingleStandardSchema = z.object({
3616
- name: z.string().min(3).max(255),
3617
- content: z.string().min(10),
3618
- parent_id: z.string().optional(),
3619
- context: z.string().optional(),
3620
- version: z.string().optional(),
3621
- language: z.string().optional(),
3622
- stack: z.array(z.string()).optional(),
3623
- is_global: z.boolean().optional(),
3624
- tags: z.array(z.string().min(1)).min(1),
3625
- metadata: z.record(z.string(), z.any()).refine((value) => Object.keys(value).length > 0, {
3626
- message: "metadata must contain at least one key"
3627
- }),
3628
- agent: z.string().optional(),
3629
- model: z.string().optional()
3630
- });
3631
- var MemoryStoreSchema = z.object({
3632
- code: z.string().max(20).optional(),
3633
- type: MemoryTypeSchema.optional(),
3634
- title: z.string().min(3).max(255).optional(),
3635
- content: z.string().min(10).optional(),
3636
- importance: z.number().min(1).max(5).optional(),
3637
- agent: z.string().min(1).optional(),
3638
- role: z.string().optional().default("unknown"),
3639
- model: z.string().min(1).optional(),
3640
- scope: MemoryScopeSchema.optional(),
3641
- ttlDays: z.number().min(1).optional(),
3642
- supersedes: z.string().optional(),
3643
- tags: z.array(z.string()).optional(),
3644
- metadata: z.record(z.string(), z.any()).optional(),
3645
- is_global: z.boolean().default(false),
3646
- structured: z.boolean().default(false),
3647
- memories: z.array(SingleMemorySchema).min(1).optional()
3648
- }).refine(
3649
- (data) => {
3650
- if (data.memories) return true;
3651
- return !!(data.type && data.title && data.content && data.importance && data.agent && data.model && data.scope);
3652
- },
3653
- {
3654
- message: "Either 'memories' array or single memory fields (type, title, content, importance, agent, model, scope) must be provided"
3655
- }
3656
- );
3657
- var MemoryUpdateSchema = z.object({
3658
- id: z.string().uuid().optional(),
3659
- code: z.string().max(20).optional(),
3660
- owner: z.string().min(1),
3661
- repo: z.string().min(1).transform(normalizeRepo),
3662
- type: MemoryTypeSchema.optional(),
3663
- title: z.string().min(3).max(255).optional(),
3664
- content: z.string().min(10).optional(),
3665
- importance: z.number().min(1).max(5).optional(),
3666
- agent: z.string().optional(),
3667
- role: z.string().optional(),
3668
- status: z.enum(["active", "archived"]).optional(),
3669
- supersedes: z.string().optional(),
3670
- tags: z.array(z.string()).optional(),
3671
- metadata: z.record(z.string(), z.any()).optional(),
3672
- is_global: z.boolean().optional(),
3673
- completed_at: z.string().optional(),
3674
- structured: z.boolean().default(false)
3675
- }).refine((data) => data.id !== void 0 || data.code !== void 0, {
3676
- message: "Either id or code must be provided"
3677
- }).refine(
3678
- (data) => data.type !== void 0 || data.content !== void 0 || data.title !== void 0 || data.importance !== void 0 || data.status !== void 0 || data.supersedes !== void 0 || data.tags !== void 0 || data.metadata !== void 0 || data.is_global !== void 0 || data.agent !== void 0 || data.role !== void 0 || data.completed_at !== void 0,
3679
- { message: "At least one field must be provided for update" }
3680
- );
3681
- var MemorySearchSchema = z.object({
3682
- query: z.string().min(3),
3683
- prompt: z.string().optional(),
3684
- owner: z.string().min(1),
3685
- repo: z.string().min(1).transform(normalizeRepo),
3686
- types: z.array(MemoryTypeSchema).optional(),
3687
- minImportance: z.number().min(1).max(5).optional(),
3688
- limit: z.number().min(1).max(100).default(5),
3689
- offset: z.number().min(0).default(0),
3690
- includeRecap: z.boolean().default(false),
3691
- current_file_path: z.string().optional(),
3692
- include_archived: z.boolean().default(false),
3693
- current_tags: z.array(z.string()).optional(),
3694
- scope: MemoryScopeSchema.partial().optional(),
3695
- structured: z.boolean().default(false)
3696
- });
3697
- var MemoryAcknowledgeSchema = z.object({
3698
- memory_id: z.string().uuid().optional(),
3699
- code: z.string().max(20).optional(),
3700
- owner: z.string().min(1),
3701
- repo: z.string().min(1).transform(normalizeRepo),
3702
- status: z.enum(["used", "irrelevant", "contradictory"]),
3703
- application_context: z.string().min(10).optional(),
3704
- structured: z.boolean().default(false)
3705
- }).refine((data) => data.memory_id !== void 0 || data.code !== void 0, {
3706
- message: "Either memory_id or code must be provided"
3707
- });
3708
- var MemoryRecapSchema = z.object({
3709
- owner: z.string().min(1),
3710
- repo: z.string().min(1).transform(normalizeRepo),
3711
- limit: z.number().min(1).max(50).default(20),
3712
- offset: z.number().min(0).default(0),
3713
- structured: z.boolean().default(false)
3714
- });
3715
- var MemoryDeleteSchema = z.object({
3716
- owner: z.string().min(1),
3717
- repo: z.string().min(1).transform(normalizeRepo),
3718
- id: z.string().uuid().optional(),
3719
- ids: z.array(z.string().uuid()).min(1).optional(),
3720
- code: z.string().max(20).optional(),
3721
- codes: z.array(z.string().max(20)).min(1).optional(),
3722
- structured: z.boolean().default(false)
3723
- }).refine(
3724
- (data) => data.id !== void 0 || data.ids !== void 0 || data.code !== void 0 || data.codes !== void 0,
3725
- {
3726
- message: "Either 'id', 'ids', 'code', or 'codes' must be provided for deletion"
3727
- }
3728
- );
3729
- var MemorySummarizeSchema = z.object({
3730
- owner: z.string().min(1),
3731
- repo: z.string().min(1).transform(normalizeRepo),
3732
- signals: z.array(z.string().max(200)).min(1),
3733
- structured: z.boolean().default(false)
3734
- });
3735
- var MemorySynthesizeSchema = z.object({
3736
- owner: z.string().min(1),
3737
- repo: z.string().min(1).transform(normalizeRepo).optional(),
3738
- objective: z.string().min(5),
3739
- current_file_path: z.string().optional(),
3740
- include_summary: z.boolean().default(true),
3741
- include_tasks: z.boolean().default(true),
3742
- use_tools: z.boolean().default(true),
3743
- max_iterations: z.number().int().min(1).max(5).default(3),
3744
- max_tokens: z.number().int().min(128).max(4e3).default(1200),
3745
- structured: z.boolean().default(false)
3746
- });
3747
- var TaskStatusSchema = z.enum(["backlog", "pending", "in_progress", "completed", "canceled", "blocked"]);
3748
- var TaskPrioritySchema = z.number().min(1).max(5);
3749
- var TaskMetadataSchema = z.record(z.string(), z.any()).optional().superRefine((metadata, ctx) => {
3750
- if (!metadata) return;
3751
- if (metadata.required_skills !== void 0) {
3752
- if (!Array.isArray(metadata.required_skills)) {
3753
- ctx.addIssue({
3754
- code: z.ZodIssueCode.custom,
3755
- message: "metadata.required_skills must be an array of strings",
3756
- path: ["metadata", "required_skills"]
3757
- });
3758
- } else if (metadata.required_skills.length === 0) {
3759
- ctx.addIssue({
3760
- code: z.ZodIssueCode.custom,
3761
- message: "metadata.required_skills must not be empty when present",
3762
- path: ["metadata", "required_skills"]
3763
- });
3764
- } else if (!metadata.required_skills.every((s) => typeof s === "string" && s.length > 0)) {
3765
- ctx.addIssue({
3766
- code: z.ZodIssueCode.custom,
3767
- message: "metadata.required_skills must be an array of non-empty strings",
3768
- path: ["metadata", "required_skills"]
3769
- });
3770
- }
3771
- }
3772
- if (metadata.fsm_gates !== void 0) {
3773
- if (!Array.isArray(metadata.fsm_gates)) {
3774
- ctx.addIssue({
3775
- code: z.ZodIssueCode.custom,
3776
- message: "metadata.fsm_gates must be an array of strings",
3777
- path: ["metadata", "fsm_gates"]
3778
- });
3779
- } else if (metadata.fsm_gates.length === 0) {
3780
- ctx.addIssue({
3781
- code: z.ZodIssueCode.custom,
3782
- message: "metadata.fsm_gates must not be empty when present",
3783
- path: ["metadata", "fsm_gates"]
3784
- });
3785
- } else if (!metadata.fsm_gates.every((s) => typeof s === "string" && s.length > 0)) {
3786
- ctx.addIssue({
3787
- code: z.ZodIssueCode.custom,
3788
- message: "metadata.fsm_gates must be an array of non-empty strings",
3789
- path: ["metadata", "fsm_gates"]
3790
- });
3791
- }
3792
- }
3793
- });
3794
- var SingleTaskCreateSchema = z.object({
3795
- task_code: z.string().min(1).optional(),
3796
- phase: z.string().min(1),
3797
- title: z.string().min(3).max(100),
3798
- description: z.string().min(1),
3799
- status: TaskStatusSchema.default("backlog"),
3800
- priority: TaskPrioritySchema.default(3),
3801
- agent: z.string().optional(),
3802
- role: z.string().optional(),
3803
- doc_path: z.string().optional(),
3804
- tags: z.array(z.string()).optional(),
3805
- suggested_skills: z.array(z.string()).optional(),
3806
- metadata: TaskMetadataSchema,
3807
- parent_id: z.string().optional(),
3808
- depends_on: z.string().optional(),
3809
- est_tokens: z.number().int().min(0).optional()
3810
- });
3811
- var TaskCreateSchema = z.object({
3812
- owner: z.string().min(1),
3813
- repo: z.string().min(1).transform(normalizeRepo),
3814
- // Allow single task fields at top level (backward compatibility & single use)
3815
- task_code: z.string().min(1).optional(),
3816
- phase: z.string().min(1).optional(),
3817
- title: z.string().min(3).max(100).optional(),
3818
- description: z.string().min(1).optional(),
3819
- status: TaskStatusSchema.optional(),
3820
- priority: TaskPrioritySchema.optional(),
3821
- agent: z.string().optional(),
3822
- role: z.string().optional(),
3823
- doc_path: z.string().optional(),
3824
- tags: z.array(z.string()).optional(),
3825
- suggested_skills: z.array(z.string()).optional(),
3826
- metadata: z.record(z.string(), z.any()).optional(),
3827
- parent_id: z.string().optional(),
3828
- depends_on: z.string().optional(),
3829
- est_tokens: z.number().int().min(0).optional(),
3830
- // Allow bulk tasks
3831
- tasks: z.array(SingleTaskCreateSchema).min(1).optional(),
3832
- structured: z.boolean().default(false)
3833
- }).refine(
3834
- (data) => {
3835
- if (data.tasks) return true;
3836
- return !!(data.phase && data.title && data.description);
3837
- },
3838
- { message: "Either 'tasks' array or single task fields (phase, title, description) must be provided" }
3839
- );
3840
- var TaskCreateInteractiveSchema = SingleTaskCreateSchema.partial().extend({
3841
- owner: z.string().optional().default(""),
3842
- repo: z.string().min(1).transform(normalizeRepo).optional(),
3843
- structured: z.boolean().default(false)
3844
- });
3845
- var TaskUpdateSchema = z.object({
3846
- owner: z.string().min(1),
3847
- repo: z.string().min(1).transform(normalizeRepo),
3848
- id: z.string().uuid().optional(),
3849
- ids: z.array(z.string().uuid()).min(1).optional(),
3850
- task_code: z.string().optional(),
3851
- phase: z.string().optional(),
3852
- title: z.string().min(3).max(100).optional(),
3853
- description: z.string().optional(),
3854
- status: TaskStatusSchema.optional(),
3855
- priority: TaskPrioritySchema.optional(),
3856
- agent: z.string().min(1, "agent name is required").optional(),
3857
- role: z.string().min(1, "agent role is required").optional(),
3858
- model: z.string().optional(),
3859
- comment: z.string().min(1).optional(),
3860
- doc_path: z.string().optional(),
3861
- tags: z.array(z.string()).optional(),
3862
- metadata: z.record(z.string(), z.any()).optional(),
3863
- suggested_skills: z.array(z.string()).optional(),
3864
- parent_id: z.string().optional(),
3865
- depends_on: z.string().optional(),
3866
- est_tokens: z.number().int().min(0).optional(),
3867
- commit_id: z.string().optional(),
3868
- changed_files: z.array(z.string()).optional(),
3869
- force: z.boolean().optional(),
3870
- structured: z.boolean().default(false)
3871
- }).refine((data) => data.id !== void 0 || data.ids !== void 0 || data.task_code !== void 0, {
3872
- message: "Either 'id', 'ids', or 'task_code' must be provided for update"
3873
- }).refine((data) => Object.keys(data).length > 2, {
3874
- message: "At least one field besides repo and id/ids must be provided for update"
3875
- });
3876
- var TaskStatusValues = TaskStatusSchema.options;
3877
- var TaskStatusListSchema = z.string().refine(
3878
- (val) => {
3879
- if (val === "all") return true;
3880
- const parts = val.split(",").map((s) => s.trim()).filter(Boolean);
3881
- if (parts.length === 0) return false;
3882
- return parts.every((p) => TaskStatusValues.includes(p));
3883
- },
3884
- { message: "status must be 'all' or a comma-separated list of valid TaskStatus values" }
3885
- );
3886
- var TaskListSchema = z.object({
3887
- owner: z.string().min(1),
3888
- repo: z.string().min(1).transform(normalizeRepo),
3889
- status: TaskStatusListSchema.default("backlog,pending,in_progress,blocked"),
3890
- phase: z.string().optional(),
3891
- query: z.string().optional(),
3892
- limit: z.number().min(1).max(100).default(15),
3893
- offset: z.number().min(0).default(0),
3894
- structured: z.boolean().default(false)
3895
- });
3896
- var TaskSearchSchema = z.object({
3897
- owner: z.string().min(1),
3898
- repo: z.string().min(1).transform(normalizeRepo),
3899
- query: z.string().min(1),
3900
- status: z.string().optional(),
3901
- phase: z.string().optional(),
3902
- priority: z.number().min(1).max(5).optional(),
3903
- limit: z.number().min(1).max(100).default(10),
3904
- offset: z.number().min(0).default(0),
3905
- structured: z.boolean().default(false)
3906
- });
3907
- var TaskDeleteSchema = z.object({
3908
- owner: z.string().min(1),
3909
- repo: z.string().min(1).transform(normalizeRepo),
3910
- id: z.string().uuid().optional(),
3911
- ids: z.array(z.string().uuid()).min(1).optional(),
3912
- task_code: z.string().optional(),
3913
- structured: z.boolean().default(false)
3914
- }).refine((data) => data.id !== void 0 || data.ids !== void 0 || data.task_code !== void 0, {
3915
- message: "Either 'id', 'ids', or 'task_code' must be provided for deletion"
3916
- });
3917
- var MemoryDetailSchema = z.object({
3918
- id: z.string().uuid().optional(),
3919
- code: z.string().max(20).optional(),
3920
- owner: z.string().min(1),
3921
- repo: z.string().min(1).transform(normalizeRepo),
3922
- structured: z.boolean().default(false)
3923
- }).refine((data) => data.id !== void 0 || data.code !== void 0, {
3924
- message: "Either id or code must be provided"
3925
- });
3926
- var StandardDetailSchema = z.object({
3927
- id: z.string().uuid().optional(),
3928
- code: z.string().max(20).optional(),
3929
- owner: z.string().min(1),
3930
- repo: z.string().min(1).transform(normalizeRepo),
3931
- structured: z.boolean().default(false)
3932
- }).refine((data) => data.id !== void 0 || data.code !== void 0, {
3933
- message: "Either id or code must be provided"
3934
- });
3935
- var StandardDeleteSchema = z.object({
3936
- owner: z.string().min(1),
3937
- repo: z.string().min(1).transform(normalizeRepo),
3938
- id: z.string().uuid().optional(),
3939
- ids: z.array(z.string().uuid()).min(1).optional(),
3940
- code: z.string().max(20).optional(),
3941
- codes: z.array(z.string().max(20)).min(1).optional(),
3942
- structured: z.boolean().default(false)
3943
- }).refine(
3944
- (data) => data.id !== void 0 || data.ids !== void 0 || data.code !== void 0 || data.codes !== void 0,
3945
- {
3946
- message: "Either 'id', 'ids', 'code', or 'codes' must be provided for deletion"
3947
- }
3948
- );
3949
- var TaskGetSchema = z.object({
3950
- owner: z.string().min(1),
3951
- repo: z.string().min(1).transform(normalizeRepo),
3952
- id: z.string().uuid().optional(),
3953
- task_code: z.string().optional(),
3954
- structured: z.boolean().default(false)
3955
- }).refine((data) => data.id !== void 0 || data.task_code !== void 0, {
3956
- message: "Either id or task_code must be provided"
3957
- });
3958
- var HandoffStatusSchema = z.enum(["pending", "accepted", "rejected", "expired"]);
3959
- var HandoffCreateSchema = z.object({
3960
- owner: z.string().min(1),
3961
- repo: z.string().min(1).transform(normalizeRepo),
3962
- from_agent: z.string().min(1),
3963
- to_agent: z.string().min(1).optional(),
3964
- task_id: z.string().uuid().optional(),
3965
- task_code: z.string().optional(),
3966
- summary: z.string().min(1),
3967
- context: z.record(z.string(), z.any()).optional(),
3968
- expires_at: z.string().optional(),
3969
- structured: z.boolean().default(false)
3970
- }).refine((data) => !(data.task_id && data.task_code), {
3971
- message: "Provide either task_id or task_code, not both"
3972
- }).refine(
3973
- (data) => data.to_agent || data.task_id || data.task_code || data.context?.next_steps || data.context?.blockers || data.context?.remaining_work,
3974
- {
3975
- message: "Handoffs must identify a target agent, linked task, next_steps, blockers, or remaining_work. Do not create pending handoffs for completed-work summaries."
3976
- }
3977
- );
3978
- var HandoffUpdateSchema = z.object({
3979
- id: z.string().uuid(),
3980
- status: HandoffStatusSchema,
3981
- structured: z.boolean().default(false)
3982
- });
3983
- var HandoffListSchema = z.object({
3984
- owner: z.string().min(1),
3985
- repo: z.string().min(1).transform(normalizeRepo),
3986
- status: HandoffStatusSchema.optional(),
3987
- from_agent: z.string().min(1).optional(),
3988
- to_agent: z.string().min(1).optional(),
3989
- limit: z.number().min(1).max(100).default(20),
3990
- offset: z.number().min(0).default(0),
3991
- structured: z.boolean().default(false)
3992
- });
3993
- var TaskClaimSchema = z.object({
3994
- owner: z.string().min(1),
3995
- repo: z.string().min(1).transform(normalizeRepo),
3996
- task_id: z.string().uuid().optional(),
3997
- task_code: z.string().optional(),
3998
- agent: z.string().min(1),
3999
- role: z.string().optional(),
4000
- metadata: z.record(z.string(), z.any()).optional(),
4001
- structured: z.boolean().default(false)
4002
- }).refine((data) => data.task_id !== void 0 || data.task_code !== void 0, {
4003
- message: "Either task_id or task_code must be provided"
4004
- }).refine((data) => !(data.task_id && data.task_code), {
4005
- message: "Provide either task_id or task_code, not both"
4006
- });
4007
- var ClaimListSchema = z.object({
4008
- owner: z.string().min(1),
4009
- repo: z.string().min(1).transform(normalizeRepo),
4010
- agent: z.string().min(1).optional(),
4011
- active_only: z.boolean().default(true),
4012
- limit: z.number().min(1).max(100).default(20),
4013
- offset: z.number().min(0).default(0),
4014
- structured: z.boolean().default(false)
4015
- });
4016
- var ClaimReleaseSchema = z.object({
4017
- owner: z.string().min(1),
4018
- repo: z.string().min(1).transform(normalizeRepo),
4019
- task_id: z.string().uuid().optional(),
4020
- task_code: z.string().optional(),
4021
- agent: z.string().min(1).optional(),
4022
- structured: z.boolean().default(false)
4023
- }).refine((data) => data.task_id !== void 0 || data.task_code !== void 0, {
4024
- message: "Either task_id or task_code must be provided"
4025
- }).refine((data) => !(data.task_id && data.task_code), {
4026
- message: "Provide either task_id or task_code, not both"
4027
- });
4028
- var StandardStoreSchema = z.object({
4029
- name: z.string().min(3).max(255).optional(),
4030
- content: z.string().min(10).optional(),
4031
- parent_id: z.string().optional(),
4032
- context: z.string().optional(),
4033
- version: z.string().optional(),
4034
- language: z.string().optional(),
4035
- stack: z.array(z.string()).optional(),
4036
- owner: z.string().min(1),
4037
- repo: z.string().transform(normalizeRepo).optional(),
4038
- is_global: z.boolean().optional(),
4039
- tags: z.array(z.string().min(1)).min(1).optional(),
4040
- metadata: z.record(z.string(), z.any()).refine((value) => Object.keys(value).length > 0, { message: "metadata must contain at least one key" }).optional(),
4041
- agent: z.string().optional(),
4042
- model: z.string().optional(),
4043
- structured: z.boolean().default(false),
4044
- standards: z.array(SingleStandardSchema).min(1).optional()
4045
- }).refine(
4046
- (data) => {
4047
- if (data.standards) return true;
4048
- return !!(data.name && data.content && data.tags && data.metadata);
4049
- },
4050
- { message: "Either 'standards' array or single standard fields (name, content, tags, metadata) must be provided" }
4051
- ).refine((data) => data.is_global !== false || !!data.repo, {
4052
- message: "repo is required for repo-specific standards"
4053
- });
4054
- var StandardUpdateSchema = z.object({
4055
- id: z.string().uuid().optional(),
4056
- code: z.string().max(20).optional(),
4057
- name: z.string().min(3).max(255).optional(),
4058
- content: z.string().min(10).optional(),
4059
- parent_id: z.string().nullable().optional(),
4060
- context: z.string().optional(),
4061
- version: z.string().optional(),
4062
- language: z.string().optional(),
4063
- stack: z.array(z.string().min(1)).min(1).optional(),
4064
- owner: z.string().min(1),
4065
- repo: z.string().transform(normalizeRepo),
4066
- is_global: z.boolean().optional(),
4067
- tags: z.array(z.string().min(1)).min(1).optional(),
4068
- metadata: z.record(z.string(), z.any()).refine((value) => Object.keys(value).length > 0, { message: "metadata must contain at least one key" }).optional(),
4069
- agent: z.string().optional(),
4070
- model: z.string().optional(),
4071
- structured: z.boolean().default(false)
4072
- }).refine((data) => data.id !== void 0 || data.code !== void 0, {
4073
- message: "Either id or code must be provided"
4074
- }).refine(
4075
- (data) => data.name !== void 0 || data.content !== void 0 || data.parent_id !== void 0 || data.context !== void 0 || data.version !== void 0 || data.language !== void 0 || data.stack !== void 0 || data.repo !== void 0 || data.is_global !== void 0 || data.tags !== void 0 || data.metadata !== void 0 || data.agent !== void 0 || data.model !== void 0,
4076
- { message: "At least one field must be provided for update" }
4077
- ).refine((data) => data.is_global !== false || !!data.repo, {
4078
- message: "repo is required for repo-specific standards"
4079
- });
4080
- var StandardSearchSchema = z.object({
4081
- query: z.string().optional(),
4082
- stack: z.array(z.string()).optional(),
4083
- tags: z.array(z.string()).optional(),
4084
- language: z.string().optional(),
4085
- context: z.string().optional(),
4086
- version: z.string().optional(),
4087
- owner: z.string().optional().default(""),
4088
- repo: z.string().transform(normalizeRepo).optional(),
4089
- is_global: z.boolean().optional(),
4090
- limit: z.number().min(1).max(100).default(20),
4091
- offset: z.number().min(0).default(0),
4092
- structured: z.boolean().default(false)
4093
- });
4094
- var TOOL_DEFINITIONS = [
3613
+ // src/mcp/tools/definitions/memory.ts
3614
+ var MEMORY_TOOL_DEFINITIONS = [
4095
3615
  {
4096
3616
  name: "memory-synthesize",
4097
3617
  title: "Memory Synthesize",
@@ -4144,113 +3664,32 @@ var TOOL_DEFINITIONS = [
4144
3664
  required: ["repo", "objective", "answer", "iterations", "toolCalls"]
4145
3665
  }
4146
3666
  },
4147
- {
4148
- name: "task-create-interactive",
4149
- title: "Interactive Task Create",
4150
- description: "Create a task with MCP elicitation fallback for any missing required fields. Best when an agent knows a task is needed but still needs user confirmation for repo, title, or phase.",
4151
- annotations: {
4152
- readOnlyHint: false,
4153
- idempotentHint: false,
4154
- destructiveHint: false,
4155
- openWorldHint: false
4156
- },
4157
- inputSchema: {
4158
- type: "object",
4159
- properties: {
4160
- owner: { type: "string", description: "Organization/namespace (e.g., GitHub org or username)" },
4161
- repo: {
4162
- type: "string",
4163
- description: "Repository name. Optional when it can be inferred from MCP roots or elicited from the user."
4164
- },
4165
- task_code: { type: "string" },
4166
- phase: { type: "string" },
4167
- title: { type: "string", minLength: 3, maxLength: 100 },
4168
- description: {
4169
- type: "string",
4170
- minLength: 1,
4171
- description: "Detailed description. MUST follow format: 1. Context & Analysis, 2. Step & Implementation, 3. Acceptance & Verification"
4172
- },
4173
- status: { type: "string", enum: ["backlog", "pending"], default: "backlog" },
4174
- priority: {
4175
- type: "number",
4176
- minimum: 1,
4177
- maximum: 5,
4178
- default: 3,
4179
- description: "Task priority where 1=Low, 2=Normal, 3=Medium, 4=High, 5=Critical."
4180
- },
4181
- agent: { type: "string" },
4182
- role: { type: "string" },
4183
- doc_path: { type: "string" },
4184
- structured: { type: "boolean", default: false, description: "If true, returns structured JSON result." }
4185
- }
4186
- },
4187
- outputSchema: {
4188
- type: "object",
4189
- properties: {
4190
- repo: { type: "string" },
4191
- task_code: { type: "string" },
4192
- phase: { type: "string" },
4193
- title: { type: "string" },
4194
- status: { type: "string" },
4195
- priority: { type: "number" }
4196
- },
4197
- required: ["repo", "task_code", "phase", "title", "status", "priority"]
4198
- }
4199
- },
4200
3667
  {
4201
3668
  name: "memory-detail",
4202
3669
  title: "Memory Detail",
4203
3670
  description: "Fetch full details of a specific memory by ID or short code. Use after memory-recap or memory-search when a pointer row is relevant and full content is needed.",
4204
3671
  inputSchema: {
4205
3672
  type: "object",
4206
- properties: {
4207
- id: { type: "string", format: "uuid", description: "Memory entry ID. Optional if code is provided." },
4208
- code: { type: "string", description: "Short memory code. Optional if id is provided." },
4209
- owner: {
4210
- type: "string",
4211
- description: "Organization/namespace (e.g., GitHub org or username). Required when using code."
3673
+ oneOf: [
3674
+ {
3675
+ title: "By ID",
3676
+ required: ["id"],
3677
+ properties: {
3678
+ id: { type: "string", format: "uuid", description: "Memory entry ID." },
3679
+ structured: { type: "boolean", default: false, description: "If true, returns structured JSON details." }
3680
+ }
4212
3681
  },
4213
- repo: { type: "string", description: "Repository/project name. Required when using code." },
4214
- structured: { type: "boolean", default: false, description: "If true, returns structured JSON details." }
4215
- }
4216
- }
4217
- },
4218
- {
4219
- name: "standard-detail",
4220
- title: "Standard Detail",
4221
- description: "Fetch full details of a specific coding standard by ID or short code. Use after standard-search when a result is relevant and full guidance is needed.",
4222
- inputSchema: {
4223
- type: "object",
4224
- properties: {
4225
- id: { type: "string", format: "uuid", description: "Coding standard ID. Optional if code is provided." },
4226
- code: { type: "string", description: "Short standard code (e.g. 'A3KPQ2'). Optional if id is provided." },
4227
- owner: {
4228
- type: "string",
4229
- description: "Organization/namespace (e.g., GitHub org or username). Required when using code."
4230
- },
4231
- repo: { type: "string", description: "Repository/project name. Required when using code." },
4232
- structured: { type: "boolean", default: false, description: "If true, returns structured JSON details." }
4233
- }
4234
- }
4235
- },
4236
- {
4237
- name: "task-detail",
4238
- title: "Task Detail",
4239
- description: "Fetch full details of a specific task by ID or task code. Use this when you have a task ID or code and need to read the full description and comments.",
4240
- inputSchema: {
4241
- type: "object",
4242
- properties: {
4243
- owner: { type: "string", description: "Organization/namespace (e.g., GitHub org or username)" },
4244
- repo: { type: "string", description: "Repository name" },
4245
- id: { type: "string", format: "uuid", description: "Task ID (optional if task_code is provided)" },
4246
- task_code: { type: "string", description: "Task code (e.g. TASK-001) (optional if id is provided)" },
4247
- structured: {
4248
- type: "boolean",
4249
- default: false,
4250
- description: "If true, returns structured JSON without the text content details."
4251
- }
4252
- },
4253
- required: ["repo", "owner"]
3682
+ {
3683
+ title: "By code",
3684
+ required: ["code", "owner", "repo"],
3685
+ properties: {
3686
+ code: { type: "string", description: "Short memory code." },
3687
+ owner: { type: "string", description: "Organization/namespace (e.g., GitHub org or username)." },
3688
+ repo: { type: "string", description: "Repository/project name." },
3689
+ structured: { type: "boolean", default: false, description: "If true, returns structured JSON details." }
3690
+ }
3691
+ }
3692
+ ]
4254
3693
  }
4255
3694
  },
4256
3695
  {
@@ -4265,118 +3704,133 @@ var TOOL_DEFINITIONS = [
4265
3704
  },
4266
3705
  inputSchema: {
4267
3706
  type: "object",
4268
- properties: {
4269
- type: {
4270
- type: "string",
4271
- enum: ["code_fact", "decision", "mistake", "pattern", "task_archive"],
4272
- description: "Type of durable knowledge being stored. Coordination types such as file_claim are intentionally unsupported."
4273
- },
4274
- title: {
4275
- type: "string",
4276
- minLength: 3,
4277
- maxLength: 100,
4278
- description: "Short human-readable title for the memory. Do not embed bracketed metadata like agent/role/date prefixes here."
4279
- },
4280
- content: {
4281
- type: "string",
4282
- minLength: 10,
4283
- description: "The memory content"
4284
- },
4285
- importance: {
4286
- type: "number",
4287
- minimum: 1,
4288
- maximum: 5,
4289
- description: "Importance score (1-5)"
4290
- },
4291
- agent: {
4292
- type: "string",
4293
- description: "Name of the agent creating this memory"
4294
- },
4295
- role: {
4296
- type: "string",
4297
- description: "Role of the agent creating this memory"
4298
- },
4299
- model: {
4300
- type: "string",
4301
- description: "AI model used by the agent"
4302
- },
4303
- scope: {
4304
- type: "object",
3707
+ oneOf: [
3708
+ {
3709
+ title: "Single memory",
3710
+ required: ["type", "title", "content", "importance", "agent", "model", "scope"],
4305
3711
  properties: {
4306
- owner: { type: "string", description: "Organization/namespace (e.g., GitHub org or username)" },
4307
- repo: { type: "string", description: "Repository/project name" },
4308
- branch: { type: "string", description: "Git branch this memory relates to" },
4309
- folder: { type: "string", description: "Subdirectory within the repo" },
4310
- language: { type: "string", description: "Programming language (e.g., 'typescript', 'python')" }
4311
- },
4312
- required: ["owner", "repo"]
4313
- },
4314
- tags: {
4315
- type: "array",
4316
- items: { type: "string" },
4317
- description: "Technology stack tags (e.g., ['filament', 'laravel'])"
4318
- },
4319
- metadata: {
4320
- type: "object",
4321
- description: "Structured metadata for non-title context such as source agent, claim fields, or timestamps"
4322
- },
4323
- is_global: {
4324
- type: "boolean",
4325
- description: "If true, this memory is shared across all repositories"
4326
- },
4327
- ttlDays: {
4328
- type: "number",
4329
- minimum: 1,
4330
- description: "Time-to-live in days. After this period, the memory expires."
4331
- },
4332
- supersedes: {
4333
- type: "string",
4334
- description: "Optional memory ID (UUID) or memory code to supersede. Resolved before storing."
4335
- },
4336
- memories: {
4337
- type: "array",
4338
- items: {
4339
- type: "object",
4340
- properties: {
4341
- type: {
4342
- type: "string",
4343
- enum: ["code_fact", "decision", "mistake", "pattern", "task_archive"],
4344
- description: "Type of durable knowledge being stored"
3712
+ type: {
3713
+ type: "string",
3714
+ enum: ["code_fact", "decision", "mistake", "pattern", "task_archive"],
3715
+ description: "Type of durable knowledge being stored. Coordination types such as file_claim are intentionally unsupported."
3716
+ },
3717
+ title: {
3718
+ type: "string",
3719
+ minLength: 3,
3720
+ maxLength: 100,
3721
+ description: "Short human-readable title for the memory. Do not embed bracketed metadata like agent/role/date prefixes here."
3722
+ },
3723
+ content: {
3724
+ type: "string",
3725
+ minLength: 10,
3726
+ description: "The memory content"
3727
+ },
3728
+ importance: {
3729
+ type: "number",
3730
+ minimum: 1,
3731
+ maximum: 5,
3732
+ description: "Importance score (1-5)"
3733
+ },
3734
+ agent: {
3735
+ type: "string",
3736
+ description: "Name of the agent creating this memory"
3737
+ },
3738
+ role: {
3739
+ type: "string",
3740
+ description: "Role of the agent creating this memory"
3741
+ },
3742
+ model: {
3743
+ type: "string",
3744
+ description: "AI model used by the agent"
3745
+ },
3746
+ scope: {
3747
+ type: "object",
3748
+ properties: {
3749
+ owner: { type: "string", description: "Organization/namespace (e.g., GitHub org or username)" },
3750
+ repo: { type: "string", description: "Repository/project name" },
3751
+ branch: { type: "string", description: "Git branch this memory relates to" },
3752
+ folder: { type: "string", description: "Subdirectory within the repo" },
3753
+ language: { type: "string", description: "Programming language (e.g., 'typescript', 'python')" }
4345
3754
  },
4346
- title: { type: "string", minLength: 3, maxLength: 100, description: "Short human-readable title" },
4347
- content: { type: "string", minLength: 10, description: "The memory content" },
4348
- importance: { type: "number", minimum: 1, maximum: 5, description: "Importance score (1-5)" },
4349
- agent: { type: "string", description: "Name of the agent creating this memory" },
4350
- role: { type: "string", default: "unknown", description: "Role of the agent creating this memory" },
4351
- model: { type: "string", description: "AI model used by the agent" },
4352
- scope: {
3755
+ required: ["owner", "repo"]
3756
+ },
3757
+ code: { type: "string", maxLength: 20, description: "Optional custom code. Auto-generated if omitted." },
3758
+ tags: {
3759
+ type: "array",
3760
+ items: { type: "string" },
3761
+ description: "Technology stack tags (e.g., ['filament', 'laravel'])"
3762
+ },
3763
+ metadata: {
3764
+ type: "object",
3765
+ description: "Structured metadata for non-title context such as source agent, claim fields, or timestamps"
3766
+ },
3767
+ is_global: { type: "boolean", description: "If true, this memory is shared across all repositories" },
3768
+ ttlDays: {
3769
+ type: "number",
3770
+ minimum: 1,
3771
+ description: "Time-to-live in days. After this period, the memory expires."
3772
+ },
3773
+ supersedes: {
3774
+ type: "string",
3775
+ description: "Optional memory ID (UUID) or memory code to supersede. Resolved before storing."
3776
+ },
3777
+ structured: {
3778
+ type: "boolean",
3779
+ default: false,
3780
+ description: "If true, returns structured JSON of the stored memory."
3781
+ }
3782
+ }
3783
+ },
3784
+ {
3785
+ title: "Bulk memories",
3786
+ required: ["memories"],
3787
+ properties: {
3788
+ memories: {
3789
+ type: "array",
3790
+ items: {
4353
3791
  type: "object",
4354
3792
  properties: {
4355
- owner: { type: "string", description: "Organization/namespace (e.g., GitHub org or username)" },
4356
- repo: { type: "string", description: "Repository/project name" },
4357
- branch: { type: "string", description: "Git branch this memory relates to" },
4358
- folder: { type: "string", description: "Subdirectory within the repo" },
4359
- language: { type: "string", description: "Programming language" }
3793
+ type: {
3794
+ type: "string",
3795
+ enum: ["code_fact", "decision", "mistake", "pattern", "task_archive"],
3796
+ description: "Type of durable knowledge being stored"
3797
+ },
3798
+ title: { type: "string", minLength: 3, maxLength: 100, description: "Short human-readable title" },
3799
+ content: { type: "string", minLength: 10, description: "The memory content" },
3800
+ importance: { type: "number", minimum: 1, maximum: 5, description: "Importance score (1-5)" },
3801
+ agent: { type: "string", description: "Name of the agent creating this memory" },
3802
+ role: { type: "string", default: "unknown", description: "Role of the agent creating this memory" },
3803
+ model: { type: "string", description: "AI model used by the agent" },
3804
+ scope: {
3805
+ type: "object",
3806
+ properties: {
3807
+ owner: { type: "string", description: "Organization/namespace (e.g., GitHub org or username)" },
3808
+ repo: { type: "string", description: "Repository/project name" },
3809
+ branch: { type: "string", description: "Git branch this memory relates to" },
3810
+ folder: { type: "string", description: "Subdirectory within the repo" },
3811
+ language: { type: "string", description: "Programming language" }
3812
+ },
3813
+ required: ["owner", "repo"]
3814
+ },
3815
+ code: { type: "string", description: "Optional custom code. Auto-generated if omitted." },
3816
+ ttlDays: { type: "number", minimum: 1, description: "Time-to-live in days" },
3817
+ supersedes: { type: "string", description: "UUID or code of a memory this entry replaces" },
3818
+ tags: { type: "array", items: { type: "string" }, description: "Technology stack tags" },
3819
+ metadata: { type: "object", description: "Structured metadata for non-title context" },
3820
+ is_global: { type: "boolean", default: false, description: "If true, shared across all repositories" }
4360
3821
  },
4361
- required: ["owner", "repo"]
3822
+ required: ["type", "title", "content", "importance", "agent", "model", "scope"]
4362
3823
  },
4363
- code: { type: "string", description: "Optional custom code. Auto-generated if omitted." },
4364
- ttlDays: { type: "number", minimum: 1, description: "Time-to-live in days" },
4365
- supersedes: { type: "string", description: "UUID or code of a memory this entry replaces" },
4366
- tags: { type: "array", items: { type: "string" }, description: "Technology stack tags" },
4367
- metadata: { type: "object", description: "Structured metadata for non-title context" },
4368
- is_global: { type: "boolean", default: false, description: "If true, shared across all repositories" }
3824
+ description: "Array of memories for bulk creation"
4369
3825
  },
4370
- required: ["type", "title", "content", "importance", "agent", "model", "scope"]
4371
- },
4372
- description: "Array of memories for bulk creation"
4373
- },
4374
- structured: {
4375
- type: "boolean",
4376
- default: false,
4377
- description: "If true, returns structured JSON of the stored memory."
3826
+ structured: {
3827
+ type: "boolean",
3828
+ default: false,
3829
+ description: "If true, returns structured JSON of the stored memory."
3830
+ }
3831
+ }
4378
3832
  }
4379
- }
3833
+ ]
4380
3834
  },
4381
3835
  outputSchema: {
4382
3836
  type: "object",
@@ -4435,30 +3889,60 @@ var TOOL_DEFINITIONS = [
4435
3889
  },
4436
3890
  inputSchema: {
4437
3891
  type: "object",
4438
- properties: {
4439
- id: { type: "string", format: "uuid", description: "Memory entry ID. Optional if code is provided." },
4440
- code: { type: "string", maxLength: 20, description: "Short memory code. Optional if id is provided." },
4441
- type: {
4442
- type: "string",
4443
- enum: ["code_fact", "decision", "mistake", "pattern", "task_archive"]
3892
+ oneOf: [
3893
+ {
3894
+ title: "By ID",
3895
+ required: ["owner", "repo", "id"],
3896
+ properties: {
3897
+ owner: { type: "string", description: "Organization/namespace (e.g., GitHub org or username)" },
3898
+ repo: { type: "string", description: "Repository name" },
3899
+ id: { type: "string", format: "uuid", description: "Memory entry ID." },
3900
+ type: { type: "string", enum: ["code_fact", "decision", "mistake", "pattern", "task_archive"] },
3901
+ title: { type: "string", minLength: 3, maxLength: 100 },
3902
+ content: { type: "string", minLength: 10 },
3903
+ importance: { type: "number", minimum: 1, maximum: 5 },
3904
+ agent: { type: "string" },
3905
+ role: { type: "string" },
3906
+ status: { type: "string", enum: ["active", "archived"] },
3907
+ supersedes: { type: "string" },
3908
+ tags: { type: "array", items: { type: "string" } },
3909
+ metadata: { type: "object" },
3910
+ is_global: { type: "boolean" },
3911
+ completed_at: { type: "string" },
3912
+ structured: {
3913
+ type: "boolean",
3914
+ default: false,
3915
+ description: "If true, returns structured JSON of the updated memory."
3916
+ }
3917
+ }
4444
3918
  },
4445
- title: { type: "string", minLength: 3, maxLength: 100 },
4446
- content: { type: "string", minLength: 10 },
4447
- importance: { type: "number", minimum: 1, maximum: 5 },
4448
- agent: { type: "string" },
4449
- role: { type: "string" },
4450
- status: { type: "string", enum: ["active", "archived"] },
4451
- supersedes: { type: "string" },
4452
- tags: { type: "array", items: { type: "string" } },
4453
- metadata: { type: "object" },
4454
- is_global: { type: "boolean" },
4455
- completed_at: { type: "string" },
4456
- structured: {
4457
- type: "boolean",
4458
- default: false,
4459
- description: "If true, returns structured JSON of the updated memory."
3919
+ {
3920
+ title: "By code",
3921
+ required: ["owner", "repo", "code"],
3922
+ properties: {
3923
+ owner: { type: "string", description: "Organization/namespace (e.g., GitHub org or username)" },
3924
+ repo: { type: "string", description: "Repository name" },
3925
+ code: { type: "string", maxLength: 20, description: "Short memory code." },
3926
+ type: { type: "string", enum: ["code_fact", "decision", "mistake", "pattern", "task_archive"] },
3927
+ title: { type: "string", minLength: 3, maxLength: 100 },
3928
+ content: { type: "string", minLength: 10 },
3929
+ importance: { type: "number", minimum: 1, maximum: 5 },
3930
+ agent: { type: "string" },
3931
+ role: { type: "string" },
3932
+ status: { type: "string", enum: ["active", "archived"] },
3933
+ supersedes: { type: "string" },
3934
+ tags: { type: "array", items: { type: "string" } },
3935
+ metadata: { type: "object" },
3936
+ is_global: { type: "boolean" },
3937
+ completed_at: { type: "string" },
3938
+ structured: {
3939
+ type: "boolean",
3940
+ default: false,
3941
+ description: "If true, returns structured JSON of the updated memory."
3942
+ }
3943
+ }
4460
3944
  }
4461
- }
3945
+ ]
4462
3946
  },
4463
3947
  outputSchema: {
4464
3948
  type: "object",
@@ -4612,73 +4096,58 @@ var TOOL_DEFINITIONS = [
4612
4096
  },
4613
4097
  inputSchema: {
4614
4098
  type: "object",
4615
- properties: {
4616
- repo: { type: "string", description: "Repository name (optional for single id)" },
4617
- id: { type: "string", format: "uuid", description: "Memory entry ID to delete. Optional if code is provided." },
4618
- ids: {
4619
- type: "array",
4620
- items: { type: "string", format: "uuid" },
4621
- minItems: 1,
4622
- description: "Array of memory IDs to delete"
4623
- },
4624
- code: { type: "string", maxLength: 20, description: "Short memory code. Optional if id is provided." },
4625
- codes: {
4626
- type: "array",
4627
- items: { type: "string", maxLength: 20 },
4628
- minItems: 1,
4629
- description: "Array of memory codes to delete"
4630
- },
4631
- structured: { type: "boolean", default: false, description: "If true, returns structured JSON result." }
4632
- }
4633
- },
4634
- outputSchema: {
4635
- type: "object",
4636
- properties: {
4637
- success: { type: "boolean" },
4638
- id: { type: "string" },
4639
- code: { type: "string" },
4640
- ids: { type: "array", items: { type: "string" } },
4641
- codes: { type: "array", items: { type: "string" } },
4642
- repo: { type: "string" },
4643
- deletedCount: { type: "number" }
4644
- },
4645
- required: ["success"]
4646
- }
4647
- },
4648
- {
4649
- name: "standard-delete",
4650
- title: "Standard Delete",
4651
- description: "Delete one or more coding standards. Supports single 'id' or bulk 'ids'.",
4652
- annotations: {
4653
- readOnlyHint: false,
4654
- idempotentHint: false,
4655
- destructiveHint: true,
4656
- openWorldHint: false
4657
- },
4658
- inputSchema: {
4659
- type: "object",
4660
- properties: {
4661
- repo: { type: "string", description: "Repository name (optional for single id)" },
4662
- id: {
4663
- type: "string",
4664
- format: "uuid",
4665
- description: "Coding standard ID to delete. Optional if code is provided."
4099
+ oneOf: [
4100
+ {
4101
+ title: "By single ID",
4102
+ required: ["owner", "repo", "id"],
4103
+ properties: {
4104
+ owner: { type: "string", description: "Organization/namespace (e.g., GitHub org or username)" },
4105
+ repo: { type: "string", description: "Repository name." },
4106
+ id: { type: "string", format: "uuid", description: "Memory entry ID to delete." },
4107
+ structured: { type: "boolean", default: false, description: "If true, returns structured JSON result." }
4108
+ }
4666
4109
  },
4667
- ids: {
4668
- type: "array",
4669
- items: { type: "string", format: "uuid" },
4670
- minItems: 1,
4671
- description: "Array of coding standard IDs to delete"
4110
+ {
4111
+ title: "By bulk IDs",
4112
+ required: ["owner", "repo", "ids"],
4113
+ properties: {
4114
+ owner: { type: "string", description: "Organization/namespace (e.g., GitHub org or username)" },
4115
+ repo: { type: "string", description: "Repository name." },
4116
+ ids: {
4117
+ type: "array",
4118
+ items: { type: "string", format: "uuid" },
4119
+ minItems: 1,
4120
+ description: "Array of memory IDs to delete"
4121
+ },
4122
+ structured: { type: "boolean", default: false, description: "If true, returns structured JSON result." }
4123
+ }
4672
4124
  },
4673
- code: { type: "string", maxLength: 20, description: "Short standard code. Optional if id is provided." },
4674
- codes: {
4675
- type: "array",
4676
- items: { type: "string", maxLength: 20 },
4677
- minItems: 1,
4678
- description: "Array of standard codes to delete"
4125
+ {
4126
+ title: "By single code",
4127
+ required: ["owner", "repo", "code"],
4128
+ properties: {
4129
+ owner: { type: "string", description: "Organization/namespace (e.g., GitHub org or username)" },
4130
+ repo: { type: "string", description: "Repository name." },
4131
+ code: { type: "string", maxLength: 20, description: "Short memory code." },
4132
+ structured: { type: "boolean", default: false, description: "If true, returns structured JSON result." }
4133
+ }
4679
4134
  },
4680
- structured: { type: "boolean", default: false, description: "If true, returns structured JSON result." }
4681
- }
4135
+ {
4136
+ title: "By bulk codes",
4137
+ required: ["owner", "repo", "codes"],
4138
+ properties: {
4139
+ owner: { type: "string", description: "Organization/namespace (e.g., GitHub org or username)" },
4140
+ repo: { type: "string", description: "Repository name." },
4141
+ codes: {
4142
+ type: "array",
4143
+ items: { type: "string", maxLength: 20 },
4144
+ minItems: 1,
4145
+ description: "Array of memory codes to delete"
4146
+ },
4147
+ structured: { type: "boolean", default: false, description: "If true, returns structured JSON result." }
4148
+ }
4149
+ }
4150
+ ]
4682
4151
  },
4683
4152
  outputSchema: {
4684
4153
  type: "object",
@@ -4741,31 +4210,146 @@ var TOOL_DEFINITIONS = [
4741
4210
  stats: {
4742
4211
  type: "object",
4743
4212
  properties: {
4744
- byType: {
4745
- type: "object",
4746
- description: "Count of active memories per type (e.g. { decision: 3, code_fact: 7 })"
4213
+ byType: {
4214
+ type: "object",
4215
+ description: "Count of active memories per type (e.g. { decision: 3, code_fact: 7 })"
4216
+ }
4217
+ },
4218
+ required: ["byType"]
4219
+ },
4220
+ top: {
4221
+ type: "object",
4222
+ properties: {
4223
+ columns: {
4224
+ type: "array",
4225
+ items: { type: "string" },
4226
+ description: "Column names: [id, code, title, type, importance]"
4227
+ },
4228
+ rows: {
4229
+ type: "array",
4230
+ items: { type: "array" },
4231
+ description: "Each row: [id, code, title, type, importance]. Fetch full content via memory-detail"
4232
+ }
4233
+ },
4234
+ required: ["columns", "rows"]
4235
+ }
4236
+ },
4237
+ required: ["schema", "repo", "count", "total", "offset", "limit", "stats", "top"]
4238
+ }
4239
+ }
4240
+ ];
4241
+
4242
+ // src/mcp/tools/definitions/task.ts
4243
+ var TASK_TOOL_DEFINITIONS = [
4244
+ {
4245
+ name: "task-create-interactive",
4246
+ title: "Interactive Task Create",
4247
+ description: "Create a task with MCP elicitation fallback for any missing required fields. Best when an agent knows a task is needed but still needs user confirmation for repo, title, or phase.",
4248
+ annotations: {
4249
+ readOnlyHint: false,
4250
+ idempotentHint: false,
4251
+ destructiveHint: false,
4252
+ openWorldHint: false
4253
+ },
4254
+ inputSchema: {
4255
+ type: "object",
4256
+ properties: {
4257
+ owner: { type: "string", description: "Organization/namespace (e.g., GitHub org or username)" },
4258
+ repo: {
4259
+ type: "string",
4260
+ description: "Repository name. Optional when it can be inferred from MCP roots or elicited from the user."
4261
+ },
4262
+ task_code: { type: "string" },
4263
+ phase: { type: "string" },
4264
+ title: { type: "string", minLength: 3, maxLength: 100 },
4265
+ description: {
4266
+ type: "string",
4267
+ minLength: 1,
4268
+ description: "Detailed description. MUST follow format: 1. Context & Analysis, 2. Step & Implementation, 3. Acceptance & Verification"
4269
+ },
4270
+ status: { type: "string", enum: ["backlog", "pending"], default: "backlog" },
4271
+ priority: {
4272
+ type: "number",
4273
+ minimum: 1,
4274
+ maximum: 5,
4275
+ default: 3,
4276
+ description: "Task priority where 1=Low, 2=Normal, 3=Medium, 4=High, 5=Critical."
4277
+ },
4278
+ agent: { type: "string" },
4279
+ role: { type: "string" },
4280
+ doc_path: { type: "string" },
4281
+ structured: { type: "boolean", default: false, description: "If true, returns structured JSON result." }
4282
+ },
4283
+ required: ["owner"]
4284
+ },
4285
+ outputSchema: {
4286
+ type: "object",
4287
+ properties: {
4288
+ repo: { type: "string" },
4289
+ task_code: { type: "string" },
4290
+ phase: { type: "string" },
4291
+ title: { type: "string" },
4292
+ status: { type: "string" },
4293
+ priority: { type: "number" }
4294
+ },
4295
+ required: ["repo", "task_code", "phase", "title", "status", "priority"]
4296
+ }
4297
+ },
4298
+ {
4299
+ name: "task-detail",
4300
+ title: "Task Detail",
4301
+ 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.",
4302
+ inputSchema: {
4303
+ type: "object",
4304
+ oneOf: [
4305
+ {
4306
+ title: "By ID",
4307
+ required: ["owner", "repo", "id"],
4308
+ properties: {
4309
+ owner: { type: "string", description: "Organization/namespace (e.g., GitHub org or username)" },
4310
+ repo: { type: "string", description: "Repository name" },
4311
+ id: { type: "string", format: "uuid", description: "Task ID" },
4312
+ structured: {
4313
+ type: "boolean",
4314
+ default: false,
4315
+ description: "If true, returns structured JSON without the text content details."
4316
+ }
4317
+ }
4318
+ },
4319
+ {
4320
+ title: "By task_code",
4321
+ required: ["owner", "repo", "task_code"],
4322
+ properties: {
4323
+ owner: { type: "string", description: "Organization/namespace (e.g., GitHub org or username)" },
4324
+ repo: { type: "string", description: "Repository name" },
4325
+ task_code: { type: "string", description: "Task code (e.g. TASK-001)" },
4326
+ structured: {
4327
+ type: "boolean",
4328
+ default: false,
4329
+ description: "If true, returns structured JSON without the text content details."
4747
4330
  }
4748
- },
4749
- required: ["byType"]
4331
+ }
4750
4332
  },
4751
- top: {
4752
- type: "object",
4333
+ {
4334
+ title: "By task_codes",
4335
+ required: ["owner", "repo", "task_codes"],
4753
4336
  properties: {
4754
- columns: {
4337
+ owner: { type: "string", description: "Organization/namespace (e.g., GitHub org or username)" },
4338
+ repo: { type: "string", description: "Repository name" },
4339
+ task_codes: {
4755
4340
  type: "array",
4756
4341
  items: { type: "string" },
4757
- description: "Column names: [id, code, title, type, importance]"
4342
+ minItems: 1,
4343
+ description: "Array of task codes (e.g. TASK-001)"
4758
4344
  },
4759
- rows: {
4760
- type: "array",
4761
- items: { type: "array" },
4762
- description: "Each row: [id, code, title, type, importance]. Fetch full content via memory-detail"
4345
+ structured: {
4346
+ type: "boolean",
4347
+ default: false,
4348
+ description: "If true, returns structured JSON without the text content details."
4763
4349
  }
4764
- },
4765
- required: ["columns", "rows"]
4350
+ }
4766
4351
  }
4767
- },
4768
- required: ["schema", "repo", "count", "total", "offset", "limit", "stats", "top"]
4352
+ ]
4769
4353
  }
4770
4354
  },
4771
4355
  {
@@ -4892,68 +4476,269 @@ var TOOL_DEFINITIONS = [
4892
4476
  },
4893
4477
  inputSchema: {
4894
4478
  type: "object",
4895
- properties: {
4896
- owner: { type: "string", description: "Organization/namespace (e.g., GitHub org or username)" },
4897
- repo: { type: "string", description: "Repository name" },
4898
- id: { type: "string", format: "uuid", description: "Task ID (for single update)" },
4899
- ids: { type: "array", items: { type: "string", format: "uuid" }, description: "Task IDs (for bulk update)" },
4900
- task_code: { type: "string" },
4901
- phase: { type: "string" },
4902
- title: { type: "string", minLength: 3, maxLength: 100 },
4903
- description: {
4904
- type: "string",
4905
- description: "Detailed description. MUST follow format: 1. Context & Analysis, 2. Step & Implementation, 3. Acceptance & Verification"
4906
- },
4907
- status: {
4908
- type: "string",
4909
- enum: ["backlog", "pending", "in_progress", "completed", "canceled", "blocked"],
4910
- description: "New status. Transitions from 'backlog', 'pending' or 'blocked' to 'completed' are NOT allowed."
4911
- },
4912
- priority: {
4913
- type: "number",
4914
- minimum: 1,
4915
- maximum: 5,
4916
- description: "Task priority where 1=Low, 2=Normal, 3=Medium, 4=High, 5=Critical."
4917
- },
4918
- agent: { type: "string" },
4919
- role: { type: "string" },
4920
- model: { type: "string" },
4921
- comment: {
4922
- type: "string",
4923
- description: "REQUIRED when changing task status. Explain WHY the status is changing (e.g., 'Starting implementation', 'Blocked by missing API docs', 'Verified fix')."
4924
- },
4925
- doc_path: { type: "string" },
4926
- tags: { type: "array", items: { type: "string" } },
4927
- metadata: { type: "object" },
4928
- parent_id: {
4929
- type: "string",
4930
- description: "Optional parent task ID (UUID) or parent task code (e.g. TASK-001). Resolved to UUID before storing."
4931
- },
4932
- depends_on: {
4933
- type: "string",
4934
- description: "Optional task ID (UUID) or task code (e.g. TASK-001). Resolved to UUID before storing."
4935
- },
4936
- est_tokens: {
4937
- type: "number",
4938
- minimum: 0,
4939
- description: "Estimated total tokens actually used for this task. Required when status changes to 'completed'."
4940
- },
4941
- commit_id: {
4942
- type: "string",
4943
- description: "Git commit hash. Recommended when status changes to 'completed' for traceability."
4479
+ oneOf: [
4480
+ {
4481
+ title: "By ID",
4482
+ required: ["owner", "repo", "id"],
4483
+ properties: {
4484
+ owner: { type: "string", description: "Organization/namespace (e.g., GitHub org or username)" },
4485
+ repo: { type: "string", description: "Repository name" },
4486
+ id: { type: "string", format: "uuid", description: "Task ID (for single update)" },
4487
+ phase: { type: "string" },
4488
+ title: { type: "string", minLength: 3, maxLength: 100 },
4489
+ description: {
4490
+ type: "string",
4491
+ description: "Detailed description. MUST follow format: 1. Context & Analysis, 2. Step & Implementation, 3. Acceptance & Verification"
4492
+ },
4493
+ status: {
4494
+ type: "string",
4495
+ enum: ["backlog", "pending", "in_progress", "completed", "canceled", "blocked"],
4496
+ description: "New status. Transitions from 'backlog', 'pending' or 'blocked' to 'completed' are NOT allowed."
4497
+ },
4498
+ priority: {
4499
+ type: "number",
4500
+ minimum: 1,
4501
+ maximum: 5,
4502
+ description: "Task priority where 1=Low, 2=Normal, 3=Medium, 4=High, 5=Critical."
4503
+ },
4504
+ agent: { type: "string" },
4505
+ role: { type: "string" },
4506
+ model: { type: "string" },
4507
+ comment: {
4508
+ type: "string",
4509
+ description: "REQUIRED when changing task status. Explain WHY the status is changing (e.g., 'Starting implementation', 'Blocked by missing API docs', 'Verified fix')."
4510
+ },
4511
+ doc_path: { type: "string" },
4512
+ tags: { type: "array", items: { type: "string" } },
4513
+ metadata: { type: "object" },
4514
+ parent_id: {
4515
+ type: "string",
4516
+ description: "Optional parent task ID (UUID) or parent task code (e.g. TASK-001). Resolved to UUID before storing."
4517
+ },
4518
+ depends_on: {
4519
+ type: "string",
4520
+ description: "Optional task ID (UUID) or task code (e.g. TASK-001). Resolved to UUID before storing."
4521
+ },
4522
+ est_tokens: {
4523
+ type: "number",
4524
+ minimum: 0,
4525
+ description: "Estimated total tokens actually used for this task. Required when status changes to 'completed'."
4526
+ },
4527
+ commit_id: {
4528
+ type: "string",
4529
+ description: "Git commit hash. Recommended when status changes to 'completed' for traceability."
4530
+ },
4531
+ changed_files: {
4532
+ type: "array",
4533
+ items: { type: "string" },
4534
+ description: "List of files changed. Recommended when status changes to 'completed' for traceability."
4535
+ },
4536
+ force: {
4537
+ type: "boolean",
4538
+ description: "If true, bypasses status transition validation (e.g. pending -> completed)."
4539
+ },
4540
+ structured: { type: "boolean", default: false, description: "If true, returns structured JSON result." }
4541
+ }
4944
4542
  },
4945
- changed_files: {
4946
- type: "array",
4947
- items: { type: "string" },
4948
- description: "List of files changed. Recommended when status changes to 'completed' for traceability."
4543
+ {
4544
+ title: "By IDs",
4545
+ required: ["owner", "repo", "ids"],
4546
+ properties: {
4547
+ owner: { type: "string", description: "Organization/namespace (e.g., GitHub org or username)" },
4548
+ repo: { type: "string", description: "Repository name" },
4549
+ ids: {
4550
+ type: "array",
4551
+ items: { type: "string", format: "uuid" },
4552
+ description: "Task IDs (for bulk update)"
4553
+ },
4554
+ phase: { type: "string" },
4555
+ title: { type: "string", minLength: 3, maxLength: 100 },
4556
+ description: {
4557
+ type: "string",
4558
+ description: "Detailed description. MUST follow format: 1. Context & Analysis, 2. Step & Implementation, 3. Acceptance & Verification"
4559
+ },
4560
+ status: {
4561
+ type: "string",
4562
+ enum: ["backlog", "pending", "in_progress", "completed", "canceled", "blocked"],
4563
+ description: "New status. Transitions from 'backlog', 'pending' or 'blocked' to 'completed' are NOT allowed."
4564
+ },
4565
+ priority: {
4566
+ type: "number",
4567
+ minimum: 1,
4568
+ maximum: 5,
4569
+ description: "Task priority where 1=Low, 2=Normal, 3=Medium, 4=High, 5=Critical."
4570
+ },
4571
+ agent: { type: "string" },
4572
+ role: { type: "string" },
4573
+ model: { type: "string" },
4574
+ comment: {
4575
+ type: "string",
4576
+ description: "REQUIRED when changing task status. Explain WHY the status is changing (e.g., 'Starting implementation', 'Blocked by missing API docs', 'Verified fix')."
4577
+ },
4578
+ doc_path: { type: "string" },
4579
+ tags: { type: "array", items: { type: "string" } },
4580
+ metadata: { type: "object" },
4581
+ parent_id: {
4582
+ type: "string",
4583
+ description: "Optional parent task ID (UUID) or parent task code (e.g. TASK-001). Resolved to UUID before storing."
4584
+ },
4585
+ depends_on: {
4586
+ type: "string",
4587
+ description: "Optional task ID (UUID) or task code (e.g. TASK-001). Resolved to UUID before storing."
4588
+ },
4589
+ est_tokens: {
4590
+ type: "number",
4591
+ minimum: 0,
4592
+ description: "Estimated total tokens actually used for this task. Required when status changes to 'completed'."
4593
+ },
4594
+ commit_id: {
4595
+ type: "string",
4596
+ description: "Git commit hash. Recommended when status changes to 'completed' for traceability."
4597
+ },
4598
+ changed_files: {
4599
+ type: "array",
4600
+ items: { type: "string" },
4601
+ description: "List of files changed. Recommended when status changes to 'completed' for traceability."
4602
+ },
4603
+ force: {
4604
+ type: "boolean",
4605
+ description: "If true, bypasses status transition validation (e.g. pending -> completed)."
4606
+ },
4607
+ structured: { type: "boolean", default: false, description: "If true, returns structured JSON result." }
4608
+ }
4949
4609
  },
4950
- force: {
4951
- type: "boolean",
4952
- description: "If true, bypasses status transition validation (e.g. pending -> completed)."
4610
+ {
4611
+ title: "By task_code",
4612
+ required: ["owner", "repo", "task_code"],
4613
+ properties: {
4614
+ owner: { type: "string", description: "Organization/namespace (e.g., GitHub org or username)" },
4615
+ repo: { type: "string", description: "Repository name" },
4616
+ task_code: { type: "string" },
4617
+ phase: { type: "string" },
4618
+ title: { type: "string", minLength: 3, maxLength: 100 },
4619
+ description: {
4620
+ type: "string",
4621
+ description: "Detailed description. MUST follow format: 1. Context & Analysis, 2. Step & Implementation, 3. Acceptance & Verification"
4622
+ },
4623
+ status: {
4624
+ type: "string",
4625
+ enum: ["backlog", "pending", "in_progress", "completed", "canceled", "blocked"],
4626
+ description: "New status. Transitions from 'backlog', 'pending' or 'blocked' to 'completed' are NOT allowed."
4627
+ },
4628
+ priority: {
4629
+ type: "number",
4630
+ minimum: 1,
4631
+ maximum: 5,
4632
+ description: "Task priority where 1=Low, 2=Normal, 3=Medium, 4=High, 5=Critical."
4633
+ },
4634
+ agent: { type: "string" },
4635
+ role: { type: "string" },
4636
+ model: { type: "string" },
4637
+ comment: {
4638
+ type: "string",
4639
+ description: "REQUIRED when changing task status. Explain WHY the status is changing (e.g., 'Starting implementation', 'Blocked by missing API docs', 'Verified fix')."
4640
+ },
4641
+ doc_path: { type: "string" },
4642
+ tags: { type: "array", items: { type: "string" } },
4643
+ metadata: { type: "object" },
4644
+ parent_id: {
4645
+ type: "string",
4646
+ description: "Optional parent task ID (UUID) or parent task code (e.g. TASK-001). Resolved to UUID before storing."
4647
+ },
4648
+ depends_on: {
4649
+ type: "string",
4650
+ description: "Optional task ID (UUID) or task code (e.g. TASK-001). Resolved to UUID before storing."
4651
+ },
4652
+ est_tokens: {
4653
+ type: "number",
4654
+ minimum: 0,
4655
+ description: "Estimated total tokens actually used for this task. Required when status changes to 'completed'."
4656
+ },
4657
+ commit_id: {
4658
+ type: "string",
4659
+ description: "Git commit hash. Recommended when status changes to 'completed' for traceability."
4660
+ },
4661
+ changed_files: {
4662
+ type: "array",
4663
+ items: { type: "string" },
4664
+ description: "List of files changed. Recommended when status changes to 'completed' for traceability."
4665
+ },
4666
+ force: {
4667
+ type: "boolean",
4668
+ description: "If true, bypasses status transition validation (e.g. pending -> completed)."
4669
+ },
4670
+ structured: { type: "boolean", default: false, description: "If true, returns structured JSON result." }
4671
+ }
4953
4672
  },
4954
- structured: { type: "boolean", default: false, description: "If true, returns structured JSON result." }
4955
- },
4956
- required: ["repo", "owner"]
4673
+ {
4674
+ title: "By task_codes",
4675
+ required: ["owner", "repo", "task_codes"],
4676
+ properties: {
4677
+ owner: { type: "string", description: "Organization/namespace (e.g., GitHub org or username)" },
4678
+ repo: { type: "string", description: "Repository name" },
4679
+ task_codes: {
4680
+ type: "array",
4681
+ items: { type: "string" },
4682
+ minItems: 1,
4683
+ description: "Array of task codes (e.g. TASK-001)"
4684
+ },
4685
+ phase: { type: "string" },
4686
+ title: { type: "string", minLength: 3, maxLength: 100 },
4687
+ description: {
4688
+ type: "string",
4689
+ description: "Detailed description. MUST follow format: 1. Context & Analysis, 2. Step & Implementation, 3. Acceptance & Verification"
4690
+ },
4691
+ status: {
4692
+ type: "string",
4693
+ enum: ["backlog", "pending", "in_progress", "completed", "canceled", "blocked"],
4694
+ description: "New status. Transitions from 'backlog', 'pending' or 'blocked' to 'completed' are NOT allowed."
4695
+ },
4696
+ priority: {
4697
+ type: "number",
4698
+ minimum: 1,
4699
+ maximum: 5,
4700
+ description: "Task priority where 1=Low, 2=Normal, 3=Medium, 4=High, 5=Critical."
4701
+ },
4702
+ agent: { type: "string" },
4703
+ role: { type: "string" },
4704
+ model: { type: "string" },
4705
+ comment: {
4706
+ type: "string",
4707
+ description: "REQUIRED when changing task status. Explain WHY the status is changing (e.g., 'Starting implementation', 'Blocked by missing API docs', 'Verified fix')."
4708
+ },
4709
+ doc_path: { type: "string" },
4710
+ tags: { type: "array", items: { type: "string" } },
4711
+ metadata: { type: "object" },
4712
+ parent_id: {
4713
+ type: "string",
4714
+ description: "Optional parent task ID (UUID) or parent task code (e.g. TASK-001). Resolved to UUID before storing."
4715
+ },
4716
+ depends_on: {
4717
+ type: "string",
4718
+ description: "Optional task ID (UUID) or task code (e.g. TASK-001). Resolved to UUID before storing."
4719
+ },
4720
+ est_tokens: {
4721
+ type: "number",
4722
+ minimum: 0,
4723
+ description: "Estimated total tokens actually used for this task. Required when status changes to 'completed'."
4724
+ },
4725
+ commit_id: {
4726
+ type: "string",
4727
+ description: "Git commit hash. Recommended when status changes to 'completed' for traceability."
4728
+ },
4729
+ changed_files: {
4730
+ type: "array",
4731
+ items: { type: "string" },
4732
+ description: "List of files changed. Recommended when status changes to 'completed' for traceability."
4733
+ },
4734
+ force: {
4735
+ type: "boolean",
4736
+ description: "If true, bypasses status transition validation (e.g. pending -> completed)."
4737
+ },
4738
+ structured: { type: "boolean", default: false, description: "If true, returns structured JSON result." }
4739
+ }
4740
+ }
4741
+ ]
4957
4742
  },
4958
4743
  outputSchema: {
4959
4744
  type: "object",
@@ -4985,19 +4770,57 @@ var TOOL_DEFINITIONS = [
4985
4770
  },
4986
4771
  inputSchema: {
4987
4772
  type: "object",
4988
- properties: {
4989
- owner: { type: "string", description: "Organization/namespace (e.g., GitHub org or username)" },
4990
- repo: { type: "string", description: "Repository name" },
4991
- id: {
4992
- type: "string",
4993
- format: "uuid",
4994
- description: "Task ID (for single deletion). Optional if task_code is provided."
4773
+ oneOf: [
4774
+ {
4775
+ title: "By ID",
4776
+ required: ["owner", "repo", "id"],
4777
+ properties: {
4778
+ owner: { type: "string", description: "Organization/namespace (e.g., GitHub org or username)" },
4779
+ repo: { type: "string", description: "Repository name" },
4780
+ id: { type: "string", format: "uuid", description: "Task ID (for single deletion)" },
4781
+ structured: { type: "boolean", default: false, description: "If true, returns structured JSON result." }
4782
+ }
4995
4783
  },
4996
- ids: { type: "array", items: { type: "string", format: "uuid" }, description: "Task IDs (for bulk deletion)" },
4997
- task_code: { type: "string", description: "Task code (e.g. TASK-001). Optional if id is provided." },
4998
- structured: { type: "boolean", default: false, description: "If true, returns structured JSON result." }
4999
- },
5000
- required: ["repo", "owner"]
4784
+ {
4785
+ title: "By IDs",
4786
+ required: ["owner", "repo", "ids"],
4787
+ properties: {
4788
+ owner: { type: "string", description: "Organization/namespace (e.g., GitHub org or username)" },
4789
+ repo: { type: "string", description: "Repository name" },
4790
+ ids: {
4791
+ type: "array",
4792
+ items: { type: "string", format: "uuid" },
4793
+ description: "Task IDs (for bulk deletion)"
4794
+ },
4795
+ structured: { type: "boolean", default: false, description: "If true, returns structured JSON result." }
4796
+ }
4797
+ },
4798
+ {
4799
+ title: "By task_code",
4800
+ required: ["owner", "repo", "task_code"],
4801
+ properties: {
4802
+ owner: { type: "string", description: "Organization/namespace (e.g., GitHub org or username)" },
4803
+ repo: { type: "string", description: "Repository name" },
4804
+ task_code: { type: "string", description: "Task code (e.g. TASK-001)" },
4805
+ structured: { type: "boolean", default: false, description: "If true, returns structured JSON result." }
4806
+ }
4807
+ },
4808
+ {
4809
+ title: "By task_codes",
4810
+ required: ["owner", "repo", "task_codes"],
4811
+ properties: {
4812
+ owner: { type: "string", description: "Organization/namespace (e.g., GitHub org or username)" },
4813
+ repo: { type: "string", description: "Repository name" },
4814
+ task_codes: {
4815
+ type: "array",
4816
+ items: { type: "string" },
4817
+ minItems: 1,
4818
+ description: "Array of task codes (e.g. TASK-001)"
4819
+ },
4820
+ structured: { type: "boolean", default: false, description: "If true, returns structured JSON result." }
4821
+ }
4822
+ }
4823
+ ]
5001
4824
  },
5002
4825
  outputSchema: {
5003
4826
  type: "object",
@@ -5145,7 +4968,11 @@ var TOOL_DEFINITIONS = [
5145
4968
  },
5146
4969
  required: ["schema", "query", "count", "total", "offset", "limit", "results"]
5147
4970
  }
5148
- },
4971
+ }
4972
+ ];
4973
+
4974
+ // src/mcp/tools/definitions/handoff.ts
4975
+ var HANDOFF_TOOL_DEFINITIONS = [
5149
4976
  {
5150
4977
  name: "handoff-create",
5151
4978
  title: "Handoff Create",
@@ -5401,6 +5228,117 @@ var TOOL_DEFINITIONS = [
5401
5228
  },
5402
5229
  required: ["success", "repo", "task_id"]
5403
5230
  }
5231
+ }
5232
+ ];
5233
+
5234
+ // src/mcp/tools/definitions/standard.ts
5235
+ var STANDARD_TOOL_DEFINITIONS = [
5236
+ {
5237
+ name: "standard-detail",
5238
+ title: "Standard Detail",
5239
+ 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.",
5240
+ inputSchema: {
5241
+ type: "object",
5242
+ oneOf: [
5243
+ {
5244
+ title: "By ID",
5245
+ required: ["id"],
5246
+ properties: {
5247
+ id: { type: "string", format: "uuid", description: "Coding standard ID." },
5248
+ structured: { type: "boolean", default: false, description: "If true, returns structured JSON details." }
5249
+ }
5250
+ },
5251
+ {
5252
+ title: "By code",
5253
+ required: ["code", "owner", "repo"],
5254
+ properties: {
5255
+ code: { type: "string", description: "Short standard code (e.g. 'A3KPQ2')." },
5256
+ owner: { type: "string", description: "Organization/namespace (e.g., GitHub org or username)." },
5257
+ repo: { type: "string", description: "Repository/project name." },
5258
+ structured: { type: "boolean", default: false, description: "If true, returns structured JSON details." }
5259
+ }
5260
+ }
5261
+ ]
5262
+ }
5263
+ },
5264
+ {
5265
+ name: "standard-delete",
5266
+ title: "Standard Delete",
5267
+ description: "Delete one or more coding standards. Supports single 'id' or bulk 'ids'.",
5268
+ annotations: {
5269
+ readOnlyHint: false,
5270
+ idempotentHint: false,
5271
+ destructiveHint: true,
5272
+ openWorldHint: false
5273
+ },
5274
+ inputSchema: {
5275
+ type: "object",
5276
+ oneOf: [
5277
+ {
5278
+ title: "By single ID",
5279
+ required: ["owner", "repo", "id"],
5280
+ properties: {
5281
+ owner: { type: "string", description: "Organization/namespace (e.g., GitHub org or username)" },
5282
+ repo: { type: "string", description: "Repository name." },
5283
+ id: { type: "string", format: "uuid", description: "Coding standard ID to delete." },
5284
+ structured: { type: "boolean", default: false, description: "If true, returns structured JSON result." }
5285
+ }
5286
+ },
5287
+ {
5288
+ title: "By bulk IDs",
5289
+ required: ["owner", "repo", "ids"],
5290
+ properties: {
5291
+ owner: { type: "string", description: "Organization/namespace (e.g., GitHub org or username)" },
5292
+ repo: { type: "string", description: "Repository name." },
5293
+ ids: {
5294
+ type: "array",
5295
+ items: { type: "string", format: "uuid" },
5296
+ minItems: 1,
5297
+ description: "Array of coding standard IDs to delete"
5298
+ },
5299
+ structured: { type: "boolean", default: false, description: "If true, returns structured JSON result." }
5300
+ }
5301
+ },
5302
+ {
5303
+ title: "By single code",
5304
+ required: ["owner", "repo", "code"],
5305
+ properties: {
5306
+ owner: { type: "string", description: "Organization/namespace (e.g., GitHub org or username)" },
5307
+ repo: { type: "string", description: "Repository name." },
5308
+ code: { type: "string", maxLength: 20, description: "Short standard code." },
5309
+ structured: { type: "boolean", default: false, description: "If true, returns structured JSON result." }
5310
+ }
5311
+ },
5312
+ {
5313
+ title: "By bulk codes",
5314
+ required: ["owner", "repo", "codes"],
5315
+ properties: {
5316
+ owner: { type: "string", description: "Organization/namespace (e.g., GitHub org or username)" },
5317
+ repo: { type: "string", description: "Repository name." },
5318
+ codes: {
5319
+ type: "array",
5320
+ items: { type: "string", maxLength: 20 },
5321
+ minItems: 1,
5322
+ description: "Array of standard codes to delete"
5323
+ },
5324
+ structured: { type: "boolean", default: false, description: "If true, returns structured JSON result." }
5325
+ }
5326
+ }
5327
+ ]
5328
+ },
5329
+ outputSchema: {
5330
+ type: "object",
5331
+ properties: {
5332
+ success: { type: "boolean" },
5333
+ id: { type: "string" },
5334
+ code: { type: "string" },
5335
+ ids: { type: "array", items: { type: "string" } },
5336
+ codes: { type: "array", items: { type: "string" } },
5337
+ repo: { type: "string" },
5338
+ deletedCount: { type: "number" }
5339
+ },
5340
+ required: ["success"]
5341
+ }
5404
5342
  },
5405
5343
  {
5406
5344
  name: "standard-store",
@@ -5534,24 +5472,54 @@ var TOOL_DEFINITIONS = [
5534
5472
  },
5535
5473
  inputSchema: {
5536
5474
  type: "object",
5537
- properties: {
5538
- id: { type: "string", format: "uuid", description: "Standard ID to update. Optional if code is provided." },
5539
- code: { type: "string", maxLength: 20, description: "Short standard code. Optional if id is provided." },
5540
- name: { type: "string", minLength: 3, maxLength: 255 },
5541
- content: { type: "string", minLength: 10 },
5542
- parent_id: { type: "string", nullable: true },
5543
- context: { type: "string" },
5544
- version: { type: "string" },
5545
- language: { type: "string" },
5546
- stack: { type: "array", items: { type: "string" } },
5547
- repo: { type: "string" },
5548
- is_global: { type: "boolean" },
5549
- tags: { type: "array", items: { type: "string" } },
5550
- metadata: { type: "object" },
5551
- agent: { type: "string" },
5552
- model: { type: "string" },
5553
- structured: { type: "boolean", default: false }
5554
- }
5475
+ oneOf: [
5476
+ {
5477
+ title: "By ID",
5478
+ required: ["owner", "repo", "id"],
5479
+ properties: {
5480
+ owner: { type: "string", description: "Organization/namespace (e.g., GitHub org or username)" },
5481
+ repo: { type: "string", description: "Repository name" },
5482
+ id: { type: "string", format: "uuid", description: "Standard ID to update." },
5483
+ code: { type: "string", maxLength: 20, description: "Short standard code." },
5484
+ name: { type: "string", minLength: 3, maxLength: 255 },
5485
+ content: { type: "string", minLength: 10 },
5486
+ parent_id: { type: "string", nullable: true },
5487
+ context: { type: "string" },
5488
+ version: { type: "string" },
5489
+ language: { type: "string" },
5490
+ stack: { type: "array", items: { type: "string" } },
5491
+ is_global: { type: "boolean" },
5492
+ tags: { type: "array", items: { type: "string" } },
5493
+ metadata: { type: "object" },
5494
+ agent: { type: "string" },
5495
+ model: { type: "string" },
5496
+ structured: { type: "boolean", default: false }
5497
+ }
5498
+ },
5499
+ {
5500
+ title: "By code",
5501
+ required: ["owner", "repo", "code"],
5502
+ properties: {
5503
+ owner: { type: "string", description: "Organization/namespace (e.g., GitHub org or username)" },
5504
+ repo: { type: "string", description: "Repository name" },
5505
+ code: { type: "string", maxLength: 20, description: "Short standard code." },
5506
+ id: { type: "string", format: "uuid", description: "Standard ID." },
5507
+ name: { type: "string", minLength: 3, maxLength: 255 },
5508
+ content: { type: "string", minLength: 10 },
5509
+ parent_id: { type: "string", nullable: true },
5510
+ context: { type: "string" },
5511
+ version: { type: "string" },
5512
+ language: { type: "string" },
5513
+ stack: { type: "array", items: { type: "string" } },
5514
+ is_global: { type: "boolean" },
5515
+ tags: { type: "array", items: { type: "string" } },
5516
+ metadata: { type: "object" },
5517
+ agent: { type: "string" },
5518
+ model: { type: "string" },
5519
+ structured: { type: "boolean", default: false }
5520
+ }
5521
+ }
5522
+ ]
5555
5523
  },
5556
5524
  outputSchema: {
5557
5525
  type: "object",
@@ -5627,6 +5595,14 @@ var TOOL_DEFINITIONS = [
5627
5595
  }
5628
5596
  ];
5629
5597
 
5598
+ // src/mcp/tools/definitions/index.ts
5599
+ var TOOL_DEFINITIONS = [
5600
+ ...MEMORY_TOOL_DEFINITIONS,
5601
+ ...TASK_TOOL_DEFINITIONS,
5602
+ ...HANDOFF_TOOL_DEFINITIONS,
5603
+ ...STANDARD_TOOL_DEFINITIONS
5604
+ ];
5605
+
5630
5606
  // src/mcp/utils/pagination.ts
5631
5607
  function encodeCursor(offset) {
5632
5608
  return Buffer.from(String(offset), "utf8").toString("base64");
@@ -6153,30 +6129,30 @@ async function completePromptArgument(name, argName, value, contextArguments, da
6153
6129
  import { randomUUID as randomUUID2 } from "crypto";
6154
6130
 
6155
6131
  // src/mcp/utils/mcp-response.ts
6156
- import { z as z2 } from "zod";
6157
- var McpAnnotationsSchema = z2.object({
6158
- audience: z2.array(z2.enum(["user", "assistant"])).optional(),
6159
- priority: z2.number().min(0).max(1).optional(),
6160
- lastModified: z2.string().optional()
6132
+ import { z } from "zod";
6133
+ var McpAnnotationsSchema = z.object({
6134
+ audience: z.array(z.enum(["user", "assistant"])).optional(),
6135
+ priority: z.number().min(0).max(1).optional(),
6136
+ lastModified: z.string().optional()
6161
6137
  }).strict().optional();
6162
- var McpContentSchema = z2.discriminatedUnion("type", [
6163
- z2.object({
6164
- type: z2.literal("text"),
6165
- text: z2.string(),
6138
+ var McpContentSchema = z.discriminatedUnion("type", [
6139
+ z.object({
6140
+ type: z.literal("text"),
6141
+ text: z.string(),
6166
6142
  annotations: McpAnnotationsSchema
6167
6143
  }),
6168
- z2.object({
6169
- type: z2.literal("image"),
6170
- data: z2.string(),
6171
- mimeType: z2.string(),
6144
+ z.object({
6145
+ type: z.literal("image"),
6146
+ data: z.string(),
6147
+ mimeType: z.string(),
6172
6148
  annotations: McpAnnotationsSchema
6173
6149
  }),
6174
- z2.object({
6175
- type: z2.literal("resource"),
6176
- resource: z2.object({
6177
- uri: z2.string(),
6178
- mimeType: z2.string().optional(),
6179
- text: z2.string().optional(),
6150
+ z.object({
6151
+ type: z.literal("resource"),
6152
+ resource: z.object({
6153
+ uri: z.string(),
6154
+ mimeType: z.string().optional(),
6155
+ text: z.string().optional(),
6180
6156
  annotations: McpAnnotationsSchema
6181
6157
  })
6182
6158
  })
@@ -6258,6 +6234,529 @@ function getPrimaryTextContent(response) {
6258
6234
  return textItem?.type === "text" ? textItem.text : "";
6259
6235
  }
6260
6236
 
6237
+ // src/mcp/tools/schemas/shared.ts
6238
+ import { z as z2 } from "zod";
6239
+ var MemoryScopeSchema = z2.object({
6240
+ owner: z2.string().min(1),
6241
+ repo: z2.string().min(1).transform(normalizeRepo),
6242
+ branch: z2.string().optional(),
6243
+ folder: z2.string().optional(),
6244
+ language: z2.string().optional()
6245
+ });
6246
+ var MemoryTypeSchema = z2.enum(["code_fact", "decision", "mistake", "pattern", "task_archive"]);
6247
+ var TaskStatusSchema = z2.enum(["backlog", "pending", "in_progress", "completed", "canceled", "blocked"]);
6248
+ var TaskPrioritySchema = z2.number().min(1).max(5);
6249
+ var HandoffStatusSchema = z2.enum(["pending", "accepted", "rejected", "expired"]);
6250
+ var SingleMemorySchema = z2.object({
6251
+ code: z2.string().max(20).optional(),
6252
+ type: MemoryTypeSchema,
6253
+ title: z2.string().min(3).max(255),
6254
+ content: z2.string().min(10),
6255
+ importance: z2.number().min(1).max(5),
6256
+ agent: z2.string().min(1),
6257
+ role: z2.string().optional().default("unknown"),
6258
+ model: z2.string().min(1),
6259
+ scope: MemoryScopeSchema,
6260
+ ttlDays: z2.number().min(1).optional(),
6261
+ supersedes: z2.string().optional(),
6262
+ tags: z2.array(z2.string()).optional(),
6263
+ metadata: z2.record(z2.string(), z2.unknown()).optional(),
6264
+ is_global: z2.boolean().default(false)
6265
+ });
6266
+ var SingleStandardSchema = z2.object({
6267
+ name: z2.string().min(3).max(255),
6268
+ content: z2.string().min(10),
6269
+ parent_id: z2.string().optional(),
6270
+ context: z2.string().optional(),
6271
+ version: z2.string().optional(),
6272
+ language: z2.string().optional(),
6273
+ stack: z2.array(z2.string()).optional(),
6274
+ is_global: z2.boolean().optional(),
6275
+ tags: z2.array(z2.string().min(1)).min(1),
6276
+ metadata: z2.record(z2.string(), z2.unknown()).refine((value) => Object.keys(value).length > 0, {
6277
+ message: "metadata must contain at least one key"
6278
+ }),
6279
+ agent: z2.string().optional(),
6280
+ model: z2.string().optional()
6281
+ });
6282
+ var TaskStatusValues = TaskStatusSchema.options;
6283
+
6284
+ // src/mcp/tools/schemas/memory.ts
6285
+ import { z as z3 } from "zod";
6286
+ var MemoryStoreSchema = z3.object({
6287
+ code: z3.string().max(20).optional(),
6288
+ type: MemoryTypeSchema.optional(),
6289
+ title: z3.string().min(3).max(255).optional(),
6290
+ content: z3.string().min(10).optional(),
6291
+ importance: z3.number().min(1).max(5).optional(),
6292
+ agent: z3.string().min(1).optional(),
6293
+ role: z3.string().optional().default("unknown"),
6294
+ model: z3.string().min(1).optional(),
6295
+ scope: MemoryScopeSchema.optional(),
6296
+ ttlDays: z3.number().min(1).optional(),
6297
+ supersedes: z3.string().optional(),
6298
+ tags: z3.array(z3.string()).optional(),
6299
+ metadata: z3.record(z3.string(), z3.unknown()).optional(),
6300
+ is_global: z3.boolean().default(false),
6301
+ structured: z3.boolean().default(false),
6302
+ memories: z3.array(SingleMemorySchema).min(1).optional()
6303
+ }).refine(
6304
+ (data) => {
6305
+ if (data.memories) return true;
6306
+ return !!(data.type && data.title && data.content && data.importance && data.agent && data.model && data.scope);
6307
+ },
6308
+ {
6309
+ message: "Either 'memories' array or single memory fields (type, title, content, importance, agent, model, scope) must be provided"
6310
+ }
6311
+ );
6312
+ var MemoryUpdateSchema = z3.object({
6313
+ id: z3.string().uuid().optional(),
6314
+ code: z3.string().max(20).optional(),
6315
+ owner: z3.string().min(1),
6316
+ repo: z3.string().min(1).transform(normalizeRepo),
6317
+ type: MemoryTypeSchema.optional(),
6318
+ title: z3.string().min(3).max(255).optional(),
6319
+ content: z3.string().min(10).optional(),
6320
+ importance: z3.number().min(1).max(5).optional(),
6321
+ agent: z3.string().optional(),
6322
+ role: z3.string().optional(),
6323
+ status: z3.enum(["active", "archived"]).optional(),
6324
+ supersedes: z3.string().optional(),
6325
+ tags: z3.array(z3.string()).optional(),
6326
+ metadata: z3.record(z3.string(), z3.unknown()).optional(),
6327
+ is_global: z3.boolean().optional(),
6328
+ completed_at: z3.string().optional(),
6329
+ structured: z3.boolean().default(false)
6330
+ }).refine((data) => data.id !== void 0 || data.code !== void 0, {
6331
+ message: "Either id or code must be provided"
6332
+ }).refine(
6333
+ (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,
6334
+ { message: "At least one field must be provided for update" }
6335
+ );
6336
+ var MemorySearchSchema = z3.object({
6337
+ query: z3.string().min(3),
6338
+ prompt: z3.string().optional(),
6339
+ owner: z3.string().min(1),
6340
+ repo: z3.string().min(1).transform(normalizeRepo),
6341
+ types: z3.array(MemoryTypeSchema).optional(),
6342
+ minImportance: z3.number().min(1).max(5).optional(),
6343
+ limit: z3.number().min(1).max(100).default(5),
6344
+ offset: z3.number().min(0).default(0),
6345
+ includeRecap: z3.boolean().default(false),
6346
+ current_file_path: z3.string().optional(),
6347
+ include_archived: z3.boolean().default(false),
6348
+ current_tags: z3.array(z3.string()).optional(),
6349
+ scope: MemoryScopeSchema.partial().optional(),
6350
+ structured: z3.boolean().default(false)
6351
+ });
6352
+ var MemoryAcknowledgeSchema = z3.object({
6353
+ memory_id: z3.string().uuid().optional(),
6354
+ code: z3.string().max(20).optional(),
6355
+ owner: z3.string().min(1),
6356
+ repo: z3.string().min(1).transform(normalizeRepo),
6357
+ status: z3.enum(["used", "irrelevant", "contradictory"]),
6358
+ application_context: z3.string().min(10).optional(),
6359
+ structured: z3.boolean().default(false)
6360
+ }).refine((data) => data.memory_id !== void 0 || data.code !== void 0, {
6361
+ message: "Either memory_id or code must be provided"
6362
+ });
6363
+ var MemoryRecapSchema = z3.object({
6364
+ owner: z3.string().min(1),
6365
+ repo: z3.string().min(1).transform(normalizeRepo),
6366
+ limit: z3.number().min(1).max(50).default(20),
6367
+ offset: z3.number().min(0).default(0),
6368
+ structured: z3.boolean().default(false)
6369
+ });
6370
+ var MemoryDeleteSchema = z3.object({
6371
+ owner: z3.string().min(1),
6372
+ repo: z3.string().min(1).transform(normalizeRepo),
6373
+ id: z3.string().uuid().optional(),
6374
+ ids: z3.array(z3.string().uuid()).min(1).optional(),
6375
+ code: z3.string().max(20).optional(),
6376
+ codes: z3.array(z3.string().max(20)).min(1).optional(),
6377
+ structured: z3.boolean().default(false)
6378
+ }).refine(
6379
+ (data) => data.id !== void 0 || data.ids !== void 0 || data.code !== void 0 || data.codes !== void 0,
6380
+ {
6381
+ message: "Either 'id', 'ids', 'code', or 'codes' must be provided for deletion"
6382
+ }
6383
+ );
6384
+ var MemoryDetailSchema = z3.object({
6385
+ id: z3.string().uuid().optional(),
6386
+ code: z3.string().max(20).optional(),
6387
+ owner: z3.string().min(1),
6388
+ repo: z3.string().min(1).transform(normalizeRepo),
6389
+ structured: z3.boolean().default(false)
6390
+ }).refine((data) => data.id !== void 0 || data.code !== void 0, {
6391
+ message: "Either id or code must be provided"
6392
+ });
6393
+ var MemorySummarizeSchema = z3.object({
6394
+ owner: z3.string().min(1),
6395
+ repo: z3.string().min(1).transform(normalizeRepo),
6396
+ signals: z3.array(z3.string().max(200)).min(1),
6397
+ structured: z3.boolean().default(false)
6398
+ });
6399
+ var MemorySynthesizeSchema = z3.object({
6400
+ owner: z3.string().min(1),
6401
+ repo: z3.string().min(1).transform(normalizeRepo).optional(),
6402
+ objective: z3.string().min(5),
6403
+ current_file_path: z3.string().optional(),
6404
+ include_summary: z3.boolean().default(true),
6405
+ include_tasks: z3.boolean().default(true),
6406
+ use_tools: z3.boolean().default(true),
6407
+ max_iterations: z3.number().int().min(1).max(5).default(3),
6408
+ max_tokens: z3.number().int().min(128).max(4e3).default(1200),
6409
+ structured: z3.boolean().default(false)
6410
+ });
6411
+
6412
+ // src/mcp/tools/schemas/task.ts
6413
+ import { z as z4 } from "zod";
6414
+ var TaskMetadataSchema = z4.record(z4.string(), z4.unknown()).optional().superRefine((metadata, ctx) => {
6415
+ if (!metadata) return;
6416
+ if (metadata.required_skills !== void 0) {
6417
+ if (!Array.isArray(metadata.required_skills)) {
6418
+ ctx.addIssue({
6419
+ code: z4.ZodIssueCode.custom,
6420
+ message: "metadata.required_skills must be an array of strings",
6421
+ path: ["metadata", "required_skills"]
6422
+ });
6423
+ } else if (metadata.required_skills.length === 0) {
6424
+ ctx.addIssue({
6425
+ code: z4.ZodIssueCode.custom,
6426
+ message: "metadata.required_skills must not be empty when present",
6427
+ path: ["metadata", "required_skills"]
6428
+ });
6429
+ } else if (!metadata.required_skills.every((s) => typeof s === "string" && s.length > 0)) {
6430
+ ctx.addIssue({
6431
+ code: z4.ZodIssueCode.custom,
6432
+ message: "metadata.required_skills must be an array of non-empty strings",
6433
+ path: ["metadata", "required_skills"]
6434
+ });
6435
+ }
6436
+ }
6437
+ if (metadata.fsm_gates !== void 0) {
6438
+ if (!Array.isArray(metadata.fsm_gates)) {
6439
+ ctx.addIssue({
6440
+ code: z4.ZodIssueCode.custom,
6441
+ message: "metadata.fsm_gates must be an array of strings",
6442
+ path: ["metadata", "fsm_gates"]
6443
+ });
6444
+ } else if (metadata.fsm_gates.length === 0) {
6445
+ ctx.addIssue({
6446
+ code: z4.ZodIssueCode.custom,
6447
+ message: "metadata.fsm_gates must not be empty when present",
6448
+ path: ["metadata", "fsm_gates"]
6449
+ });
6450
+ } else if (!metadata.fsm_gates.every((s) => typeof s === "string" && s.length > 0)) {
6451
+ ctx.addIssue({
6452
+ code: z4.ZodIssueCode.custom,
6453
+ message: "metadata.fsm_gates must be an array of non-empty strings",
6454
+ path: ["metadata", "fsm_gates"]
6455
+ });
6456
+ }
6457
+ }
6458
+ });
6459
+ var SingleTaskCreateSchema = z4.object({
6460
+ task_code: z4.string().min(1).optional(),
6461
+ phase: z4.string().min(1),
6462
+ title: z4.string().min(3).max(100),
6463
+ description: z4.string().min(1),
6464
+ status: TaskStatusSchema.default("backlog"),
6465
+ priority: TaskPrioritySchema.default(3),
6466
+ agent: z4.string().optional(),
6467
+ role: z4.string().optional(),
6468
+ doc_path: z4.string().optional(),
6469
+ tags: z4.array(z4.string()).optional(),
6470
+ suggested_skills: z4.array(z4.string()).optional(),
6471
+ metadata: TaskMetadataSchema,
6472
+ parent_id: z4.string().optional(),
6473
+ depends_on: z4.string().optional(),
6474
+ est_tokens: z4.number().int().min(0).optional()
6475
+ });
6476
+ var TaskStatusListSchema = z4.string().refine(
6477
+ (val) => {
6478
+ if (val === "all") return true;
6479
+ const parts = val.split(",").map((s) => s.trim()).filter(Boolean);
6480
+ if (parts.length === 0) return false;
6481
+ return parts.every((p) => TaskStatusValues.includes(p));
6482
+ },
6483
+ { message: "status must be 'all' or a comma-separated list of valid TaskStatus values" }
6484
+ );
6485
+ var TaskCreateSchema = z4.object({
6486
+ owner: z4.string().min(1),
6487
+ repo: z4.string().min(1).transform(normalizeRepo),
6488
+ // Allow single task fields at top level (backward compatibility & single use)
6489
+ task_code: z4.string().min(1).optional(),
6490
+ phase: z4.string().min(1).optional(),
6491
+ title: z4.string().min(3).max(100).optional(),
6492
+ description: z4.string().min(1).optional(),
6493
+ status: TaskStatusSchema.optional(),
6494
+ priority: TaskPrioritySchema.optional(),
6495
+ agent: z4.string().optional(),
6496
+ role: z4.string().optional(),
6497
+ doc_path: z4.string().optional(),
6498
+ tags: z4.array(z4.string()).optional(),
6499
+ suggested_skills: z4.array(z4.string()).optional(),
6500
+ metadata: z4.record(z4.string(), z4.unknown()).optional(),
6501
+ parent_id: z4.string().optional(),
6502
+ depends_on: z4.string().optional(),
6503
+ est_tokens: z4.number().int().min(0).optional(),
6504
+ // Allow bulk tasks
6505
+ tasks: z4.array(SingleTaskCreateSchema).min(1).optional(),
6506
+ structured: z4.boolean().default(false)
6507
+ }).refine(
6508
+ (data) => {
6509
+ if (data.tasks) return true;
6510
+ return !!(data.phase && data.title && data.description);
6511
+ },
6512
+ { message: "Either 'tasks' array or single task fields (phase, title, description) must be provided" }
6513
+ );
6514
+ var TaskCreateInteractiveSchema = SingleTaskCreateSchema.partial().extend({
6515
+ owner: z4.string().optional().default(""),
6516
+ repo: z4.string().min(1).transform(normalizeRepo).optional(),
6517
+ structured: z4.boolean().default(false)
6518
+ });
6519
+ var TaskUpdateSchema = z4.object({
6520
+ owner: z4.string().min(1),
6521
+ repo: z4.string().min(1).transform(normalizeRepo),
6522
+ id: z4.string().uuid().optional(),
6523
+ ids: z4.array(z4.string().uuid()).min(1).optional(),
6524
+ task_code: z4.string().optional(),
6525
+ task_codes: z4.array(z4.string().min(1)).min(1).optional(),
6526
+ phase: z4.string().optional(),
6527
+ title: z4.string().min(3).max(100).optional(),
6528
+ description: z4.string().optional(),
6529
+ status: TaskStatusSchema.optional(),
6530
+ priority: TaskPrioritySchema.optional(),
6531
+ agent: z4.string().min(1, "agent name is required").optional(),
6532
+ role: z4.string().min(1, "agent role is required").optional(),
6533
+ model: z4.string().optional(),
6534
+ comment: z4.string().min(1).optional(),
6535
+ doc_path: z4.string().optional(),
6536
+ tags: z4.array(z4.string()).optional(),
6537
+ metadata: z4.record(z4.string(), z4.unknown()).optional(),
6538
+ suggested_skills: z4.array(z4.string()).optional(),
6539
+ parent_id: z4.string().optional(),
6540
+ depends_on: z4.string().optional(),
6541
+ est_tokens: z4.number().int().min(0).optional(),
6542
+ commit_id: z4.string().optional(),
6543
+ changed_files: z4.array(z4.string()).optional(),
6544
+ force: z4.boolean().optional(),
6545
+ structured: z4.boolean().default(false)
6546
+ }).refine(
6547
+ (data) => data.id !== void 0 || data.ids !== void 0 || data.task_code !== void 0 || data.task_codes !== void 0,
6548
+ { message: "Either 'id', 'ids', 'task_code', or 'task_codes' must be provided for update" }
6549
+ ).refine((data) => Object.keys(data).length > 2, {
6550
+ message: "At least one field besides repo and id/ids must be provided for update"
6551
+ });
6552
+ var TaskListSchema = z4.object({
6553
+ owner: z4.string().min(1),
6554
+ repo: z4.string().min(1).transform(normalizeRepo),
6555
+ status: TaskStatusListSchema.default("backlog,pending,in_progress,blocked"),
6556
+ phase: z4.string().optional(),
6557
+ query: z4.string().optional(),
6558
+ limit: z4.number().min(1).max(100).default(15),
6559
+ offset: z4.number().min(0).default(0),
6560
+ structured: z4.boolean().default(false)
6561
+ });
6562
+ var TaskSearchSchema = z4.object({
6563
+ owner: z4.string().min(1),
6564
+ repo: z4.string().min(1).transform(normalizeRepo),
6565
+ query: z4.string().min(1),
6566
+ status: z4.string().optional(),
6567
+ phase: z4.string().optional(),
6568
+ priority: z4.number().min(1).max(5).optional(),
6569
+ limit: z4.number().min(1).max(100).default(10),
6570
+ offset: z4.number().min(0).default(0),
6571
+ structured: z4.boolean().default(false)
6572
+ });
6573
+ var TaskDeleteSchema = z4.object({
6574
+ owner: z4.string().min(1),
6575
+ repo: z4.string().min(1).transform(normalizeRepo),
6576
+ id: z4.string().uuid().optional(),
6577
+ ids: z4.array(z4.string().uuid()).min(1).optional(),
6578
+ task_code: z4.string().optional(),
6579
+ task_codes: z4.array(z4.string().min(1)).min(1).optional(),
6580
+ structured: z4.boolean().default(false)
6581
+ }).refine(
6582
+ (data) => data.id !== void 0 || data.ids !== void 0 || data.task_code !== void 0 || data.task_codes !== void 0,
6583
+ { message: "Either 'id', 'ids', 'task_code', or 'task_codes' must be provided for deletion" }
6584
+ );
6585
+ var TaskGetSchema = z4.object({
6586
+ owner: z4.string().min(1),
6587
+ repo: z4.string().min(1).transform(normalizeRepo),
6588
+ id: z4.string().uuid().optional(),
6589
+ task_code: z4.string().optional(),
6590
+ task_codes: z4.array(z4.string().min(1)).min(1).optional(),
6591
+ structured: z4.boolean().default(false)
6592
+ }).refine((data) => data.id !== void 0 || data.task_code !== void 0 || data.task_codes !== void 0, {
6593
+ message: "Either 'id', 'task_code', or 'task_codes' must be provided"
6594
+ });
6595
+
6596
+ // src/mcp/tools/schemas/handoff.ts
6597
+ import { z as z5 } from "zod";
6598
+ var HandoffCreateSchema = z5.object({
6599
+ owner: z5.string().min(1),
6600
+ repo: z5.string().min(1).transform(normalizeRepo),
6601
+ from_agent: z5.string().min(1),
6602
+ to_agent: z5.string().min(1).optional(),
6603
+ task_id: z5.string().uuid().optional(),
6604
+ task_code: z5.string().optional(),
6605
+ summary: z5.string().min(1),
6606
+ context: z5.record(z5.string(), z5.unknown()).optional(),
6607
+ expires_at: z5.string().optional(),
6608
+ structured: z5.boolean().default(false)
6609
+ }).refine((data) => !(data.task_id && data.task_code), {
6610
+ message: "Provide either task_id or task_code, not both"
6611
+ }).refine(
6612
+ (data) => data.to_agent || data.task_id || data.task_code || data.context?.next_steps || data.context?.blockers || data.context?.remaining_work,
6613
+ {
6614
+ message: "Handoffs must identify a target agent, linked task, next_steps, blockers, or remaining_work. Do not create pending handoffs for completed-work summaries."
6615
+ }
6616
+ );
6617
+ var HandoffUpdateSchema = z5.object({
6618
+ id: z5.string().uuid(),
6619
+ status: HandoffStatusSchema,
6620
+ structured: z5.boolean().default(false)
6621
+ });
6622
+ var HandoffListSchema = z5.object({
6623
+ owner: z5.string().min(1),
6624
+ repo: z5.string().min(1).transform(normalizeRepo),
6625
+ status: HandoffStatusSchema.optional(),
6626
+ from_agent: z5.string().min(1).optional(),
6627
+ to_agent: z5.string().min(1).optional(),
6628
+ limit: z5.number().min(1).max(100).default(20),
6629
+ offset: z5.number().min(0).default(0),
6630
+ structured: z5.boolean().default(false)
6631
+ });
6632
+ var TaskClaimSchema = z5.object({
6633
+ owner: z5.string().min(1),
6634
+ repo: z5.string().min(1).transform(normalizeRepo),
6635
+ task_id: z5.string().uuid().optional(),
6636
+ task_code: z5.string().optional(),
6637
+ agent: z5.string().min(1),
6638
+ role: z5.string().optional(),
6639
+ metadata: z5.record(z5.string(), z5.unknown()).optional(),
6640
+ structured: z5.boolean().default(false)
6641
+ }).refine((data) => data.task_id !== void 0 || data.task_code !== void 0, {
6642
+ message: "Either task_id or task_code must be provided"
6643
+ }).refine((data) => !(data.task_id && data.task_code), {
6644
+ message: "Provide either task_id or task_code, not both"
6645
+ });
6646
+ var ClaimListSchema = z5.object({
6647
+ owner: z5.string().min(1),
6648
+ repo: z5.string().min(1).transform(normalizeRepo),
6649
+ agent: z5.string().min(1).optional(),
6650
+ active_only: z5.boolean().default(true),
6651
+ limit: z5.number().min(1).max(100).default(20),
6652
+ offset: z5.number().min(0).default(0),
6653
+ structured: z5.boolean().default(false)
6654
+ });
6655
+ var ClaimReleaseSchema = z5.object({
6656
+ owner: z5.string().min(1),
6657
+ repo: z5.string().min(1).transform(normalizeRepo),
6658
+ task_id: z5.string().uuid().optional(),
6659
+ task_code: z5.string().optional(),
6660
+ agent: z5.string().min(1).optional(),
6661
+ structured: z5.boolean().default(false)
6662
+ }).refine((data) => data.task_id !== void 0 || data.task_code !== void 0, {
6663
+ message: "Either task_id or task_code must be provided"
6664
+ }).refine((data) => !(data.task_id && data.task_code), {
6665
+ message: "Provide either task_id or task_code, not both"
6666
+ });
6667
+
6668
+ // src/mcp/tools/schemas/standard.ts
6669
+ import { z as z6 } from "zod";
6670
+ var StandardStoreSchema = z6.object({
6671
+ name: z6.string().min(3).max(255).optional(),
6672
+ content: z6.string().min(10).optional(),
6673
+ parent_id: z6.string().optional(),
6674
+ context: z6.string().optional(),
6675
+ version: z6.string().optional(),
6676
+ language: z6.string().optional(),
6677
+ stack: z6.array(z6.string()).optional(),
6678
+ owner: z6.string().min(1),
6679
+ repo: z6.string().transform(normalizeRepo).optional(),
6680
+ is_global: z6.boolean().optional(),
6681
+ tags: z6.array(z6.string().min(1)).min(1).optional(),
6682
+ metadata: z6.record(z6.string(), z6.unknown()).refine((value) => Object.keys(value).length > 0, { message: "metadata must contain at least one key" }).optional(),
6683
+ agent: z6.string().optional(),
6684
+ model: z6.string().optional(),
6685
+ structured: z6.boolean().default(false),
6686
+ standards: z6.array(SingleStandardSchema).min(1).optional()
6687
+ }).refine(
6688
+ (data) => {
6689
+ if (data.standards) return true;
6690
+ return !!(data.name && data.content && data.tags && data.metadata);
6691
+ },
6692
+ { message: "Either 'standards' array or single standard fields (name, content, tags, metadata) must be provided" }
6693
+ ).refine((data) => data.is_global !== false || !!data.repo, {
6694
+ message: "repo is required for repo-specific standards"
6695
+ });
6696
+ var StandardUpdateSchema = z6.object({
6697
+ id: z6.string().uuid().optional(),
6698
+ code: z6.string().max(20).optional(),
6699
+ name: z6.string().min(3).max(255).optional(),
6700
+ content: z6.string().min(10).optional(),
6701
+ parent_id: z6.string().nullable().optional(),
6702
+ context: z6.string().optional(),
6703
+ version: z6.string().optional(),
6704
+ language: z6.string().optional(),
6705
+ stack: z6.array(z6.string().min(1)).min(1).optional(),
6706
+ owner: z6.string().min(1),
6707
+ repo: z6.string().transform(normalizeRepo),
6708
+ is_global: z6.boolean().optional(),
6709
+ tags: z6.array(z6.string().min(1)).min(1).optional(),
6710
+ metadata: z6.record(z6.string(), z6.unknown()).refine((value) => Object.keys(value).length > 0, { message: "metadata must contain at least one key" }).optional(),
6711
+ agent: z6.string().optional(),
6712
+ model: z6.string().optional(),
6713
+ structured: z6.boolean().default(false)
6714
+ }).refine((data) => data.id !== void 0 || data.code !== void 0, {
6715
+ message: "Either id or code must be provided"
6716
+ }).refine(
6717
+ (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,
6718
+ { message: "At least one field must be provided for update" }
6719
+ ).refine((data) => data.is_global !== false || !!data.repo, {
6720
+ message: "repo is required for repo-specific standards"
6721
+ });
6722
+ var StandardSearchSchema = z6.object({
6723
+ query: z6.string().optional(),
6724
+ stack: z6.array(z6.string()).optional(),
6725
+ tags: z6.array(z6.string()).optional(),
6726
+ language: z6.string().optional(),
6727
+ context: z6.string().optional(),
6728
+ version: z6.string().optional(),
6729
+ owner: z6.string().optional().default(""),
6730
+ repo: z6.string().transform(normalizeRepo).optional(),
6731
+ is_global: z6.boolean().optional(),
6732
+ limit: z6.number().min(1).max(100).default(20),
6733
+ offset: z6.number().min(0).default(0),
6734
+ structured: z6.boolean().default(false)
6735
+ });
6736
+ var StandardDeleteSchema = z6.object({
6737
+ owner: z6.string().min(1),
6738
+ repo: z6.string().min(1).transform(normalizeRepo),
6739
+ id: z6.string().uuid().optional(),
6740
+ ids: z6.array(z6.string().uuid()).min(1).optional(),
6741
+ code: z6.string().max(20).optional(),
6742
+ codes: z6.array(z6.string().max(20)).min(1).optional(),
6743
+ structured: z6.boolean().default(false)
6744
+ }).refine(
6745
+ (data) => data.id !== void 0 || data.ids !== void 0 || data.code !== void 0 || data.codes !== void 0,
6746
+ {
6747
+ message: "Either 'id', 'ids', 'code', or 'codes' must be provided for deletion"
6748
+ }
6749
+ );
6750
+ var StandardDetailSchema = z6.object({
6751
+ id: z6.string().uuid().optional(),
6752
+ code: z6.string().max(20).optional(),
6753
+ owner: z6.string().min(1),
6754
+ repo: z6.string().min(1).transform(normalizeRepo),
6755
+ structured: z6.boolean().default(false)
6756
+ }).refine((data) => data.id !== void 0 || data.code !== void 0, {
6757
+ message: "Either id or code must be provided"
6758
+ });
6759
+
6261
6760
  // src/mcp/tools/handoff.manage.ts
6262
6761
  function buildHandoffListSummary(repo, count, status, fromAgent, toAgent) {
6263
6762
  const parts = [`Found ${count} handoff${count === 1 ? "" : "s"} in repo "${repo}".`];
@@ -6570,28 +7069,6 @@ export {
6570
7069
  normalizeRepo,
6571
7070
  SQLiteStore,
6572
7071
  RealVectorStore,
6573
- MemoryStoreSchema,
6574
- MemoryUpdateSchema,
6575
- MemorySearchSchema,
6576
- MemoryAcknowledgeSchema,
6577
- MemoryRecapSchema,
6578
- MemoryDeleteSchema,
6579
- MemorySummarizeSchema,
6580
- MemorySynthesizeSchema,
6581
- TaskStatusSchema,
6582
- TaskCreateSchema,
6583
- TaskCreateInteractiveSchema,
6584
- TaskUpdateSchema,
6585
- TaskListSchema,
6586
- TaskSearchSchema,
6587
- TaskDeleteSchema,
6588
- MemoryDetailSchema,
6589
- StandardDetailSchema,
6590
- StandardDeleteSchema,
6591
- TaskGetSchema,
6592
- StandardStoreSchema,
6593
- StandardUpdateSchema,
6594
- StandardSearchSchema,
6595
7072
  TOOL_DEFINITIONS,
6596
7073
  encodeCursor,
6597
7074
  decodeCursor,
@@ -6614,6 +7091,28 @@ export {
6614
7091
  completePromptArgument,
6615
7092
  createMcpResponse,
6616
7093
  getPrimaryTextContent,
7094
+ TaskStatusSchema,
7095
+ MemoryStoreSchema,
7096
+ MemoryUpdateSchema,
7097
+ MemorySearchSchema,
7098
+ MemoryAcknowledgeSchema,
7099
+ MemoryRecapSchema,
7100
+ MemoryDeleteSchema,
7101
+ MemoryDetailSchema,
7102
+ MemorySummarizeSchema,
7103
+ MemorySynthesizeSchema,
7104
+ TaskCreateSchema,
7105
+ TaskCreateInteractiveSchema,
7106
+ TaskUpdateSchema,
7107
+ TaskListSchema,
7108
+ TaskSearchSchema,
7109
+ TaskDeleteSchema,
7110
+ TaskGetSchema,
7111
+ StandardStoreSchema,
7112
+ StandardUpdateSchema,
7113
+ StandardSearchSchema,
7114
+ StandardDeleteSchema,
7115
+ StandardDetailSchema,
6617
7116
  handleHandoffCreate,
6618
7117
  handleHandoffList,
6619
7118
  handleHandoffUpdate,