@mrrlin-dev/mcp 0.4.153 → 0.4.154

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.
Files changed (2) hide show
  1. package/dist/bin.cjs +559 -23
  2. package/package.json +1 -1
package/dist/bin.cjs CHANGED
@@ -60540,6 +60540,27 @@ var COMPACT_OPT_IN = {
60540
60540
  [mcpToolNames.listTaskEvents]: "task-events"
60541
60541
  };
60542
60542
 
60543
+ // src/tool-error-envelope.ts
60544
+ function buildToolError(error51) {
60545
+ const payload = {
60546
+ error: {
60547
+ code: error51.code,
60548
+ message: error51.message,
60549
+ ...error51.violations !== void 0 ? { violations: error51.violations } : {}
60550
+ }
60551
+ };
60552
+ return {
60553
+ isError: true,
60554
+ content: [
60555
+ {
60556
+ type: "text",
60557
+ text: JSON.stringify(payload, null, 2)
60558
+ }
60559
+ ],
60560
+ structuredContent: payload
60561
+ };
60562
+ }
60563
+
60543
60564
  // src/tools.ts
60544
60565
  registerAsyncTool(consensusDescriptor);
60545
60566
  registerAsyncTool(deliverableConsensusDescriptor);
@@ -60937,14 +60958,7 @@ function structuredOk(value) {
60937
60958
  structuredContent: { data: value }
60938
60959
  };
60939
60960
  }
60940
- function structuredErr(error51) {
60941
- const payload = error51.violations ? { code: error51.code, message: error51.message, violations: error51.violations } : { code: error51.code, message: error51.message };
60942
- return {
60943
- content: [{ text: JSON.stringify({ error: payload }, null, 2), type: "text" }],
60944
- isError: true,
60945
- structuredContent: { error: error51 }
60946
- };
60947
- }
60961
+ var structuredErr = buildToolError;
60948
60962
  function classifyClientError(fallbackCode, fallbackMessage, raw) {
60949
60963
  if (raw instanceof MrrlinApiError) {
60950
60964
  return {
@@ -64019,7 +64033,7 @@ Do NOT derail the current task - if the operator has an in-flight question, answ
64019
64033
  }
64020
64034
 
64021
64035
  // src/_generated/version.ts
64022
- var PKG_VERSION = "0.4.153";
64036
+ var PKG_VERSION = "0.4.154";
64023
64037
 
64024
64038
  // src/bridge-allowed-origins.ts
64025
64039
  var DEFAULT_DIRECTOR_BRIDGE_ALLOWED_ORIGINS = [
@@ -81376,6 +81390,526 @@ var StdioServerTransport = class {
81376
81390
  }
81377
81391
  };
81378
81392
 
81393
+ // src/tool-registry.ts
81394
+ var toolRegistry = {
81395
+ // Read operations (22 tools): RO=true, D=false, ID=true, OW=false
81396
+ [mcpToolNames.getProject]: {
81397
+ name: mcpToolNames.getProject,
81398
+ operationClass: "read",
81399
+ annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
81400
+ rationale: "Reads project configuration and state.",
81401
+ compensation: null
81402
+ },
81403
+ [mcpToolNames.getProjectSnapshot]: {
81404
+ name: mcpToolNames.getProjectSnapshot,
81405
+ operationClass: "read",
81406
+ annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
81407
+ rationale: "Reads the complete project snapshot.",
81408
+ compensation: null
81409
+ },
81410
+ [mcpToolNames.listProjects]: {
81411
+ name: mcpToolNames.listProjects,
81412
+ operationClass: "read",
81413
+ annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
81414
+ rationale: "Lists all accessible projects.",
81415
+ compensation: null
81416
+ },
81417
+ [mcpToolNames.getTask]: {
81418
+ name: mcpToolNames.getTask,
81419
+ operationClass: "read",
81420
+ annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
81421
+ rationale: "Reads a task record by ID.",
81422
+ compensation: null
81423
+ },
81424
+ [mcpToolNames.listTasks]: {
81425
+ name: mcpToolNames.listTasks,
81426
+ operationClass: "read",
81427
+ annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
81428
+ rationale: "Lists tasks matching query filters.",
81429
+ compensation: null
81430
+ },
81431
+ [mcpToolNames.listPlans]: {
81432
+ name: mcpToolNames.listPlans,
81433
+ operationClass: "read",
81434
+ annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
81435
+ rationale: "Lists project plans.",
81436
+ compensation: null
81437
+ },
81438
+ [mcpToolNames.listTaskDependencies]: {
81439
+ name: mcpToolNames.listTaskDependencies,
81440
+ operationClass: "read",
81441
+ annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
81442
+ rationale: "Reads task dependency relationships.",
81443
+ compensation: null
81444
+ },
81445
+ [mcpToolNames.listTaskEvents]: {
81446
+ name: mcpToolNames.listTaskEvents,
81447
+ operationClass: "read",
81448
+ annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
81449
+ rationale: "Reads task audit and lifecycle events.",
81450
+ compensation: null
81451
+ },
81452
+ [mcpToolNames.listTaxonomy]: {
81453
+ name: mcpToolNames.listTaxonomy,
81454
+ operationClass: "read",
81455
+ annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
81456
+ rationale: "Reads project taxonomy categories and tags.",
81457
+ compensation: null
81458
+ },
81459
+ [mcpToolNames.listProjectMembers]: {
81460
+ name: mcpToolNames.listProjectMembers,
81461
+ operationClass: "read",
81462
+ annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
81463
+ rationale: "Lists members and roles in the project.",
81464
+ compensation: null
81465
+ },
81466
+ [mcpToolNames.getWikiPage]: {
81467
+ name: mcpToolNames.getWikiPage,
81468
+ operationClass: "read",
81469
+ annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
81470
+ rationale: "Reads a wiki documentation page.",
81471
+ compensation: null
81472
+ },
81473
+ [mcpToolNames.listWikiPages]: {
81474
+ name: mcpToolNames.listWikiPages,
81475
+ operationClass: "read",
81476
+ annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
81477
+ rationale: "Lists wiki pages in the project.",
81478
+ compensation: null
81479
+ },
81480
+ [mcpToolNames.searchWikiPages]: {
81481
+ name: mcpToolNames.searchWikiPages,
81482
+ operationClass: "read",
81483
+ annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
81484
+ rationale: "Performs full-text search across wiki pages.",
81485
+ compensation: null
81486
+ },
81487
+ [mcpToolNames.searchKnowledge]: {
81488
+ name: mcpToolNames.searchKnowledge,
81489
+ operationClass: "read",
81490
+ annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
81491
+ rationale: "Searches external and indexed project knowledge.",
81492
+ compensation: null
81493
+ },
81494
+ [mcpToolNames.getExecutionRun]: {
81495
+ name: mcpToolNames.getExecutionRun,
81496
+ operationClass: "read",
81497
+ annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
81498
+ rationale: "Reads execution run details and status.",
81499
+ compensation: null
81500
+ },
81501
+ [mcpToolNames.listExecutionRuns]: {
81502
+ name: mcpToolNames.listExecutionRuns,
81503
+ operationClass: "read",
81504
+ annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
81505
+ rationale: "Lists execution runs for tasks.",
81506
+ compensation: null
81507
+ },
81508
+ [mcpToolNames.listExecutionArtifacts]: {
81509
+ name: mcpToolNames.listExecutionArtifacts,
81510
+ operationClass: "read",
81511
+ annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
81512
+ rationale: "Lists artifacts attached to execution runs.",
81513
+ compensation: null
81514
+ },
81515
+ [mcpToolNames.getProjectSchedulerPolicy]: {
81516
+ name: mcpToolNames.getProjectSchedulerPolicy,
81517
+ operationClass: "read",
81518
+ annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
81519
+ rationale: "Reads scheduler concurrency and execution policy.",
81520
+ compensation: null
81521
+ },
81522
+ [mcpToolNames.getSchedulerPendingTasks]: {
81523
+ name: mcpToolNames.getSchedulerPendingTasks,
81524
+ operationClass: "read",
81525
+ annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
81526
+ rationale: "Reads runnable tasks pending execution.",
81527
+ compensation: null
81528
+ },
81529
+ [mcpToolNames.listInboxItems]: {
81530
+ name: mcpToolNames.listInboxItems,
81531
+ operationClass: "read",
81532
+ annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
81533
+ rationale: "Lists operator inbox items and approval proposals.",
81534
+ compensation: null
81535
+ },
81536
+ [mcpToolNames.listArtifactFiles]: {
81537
+ name: mcpToolNames.listArtifactFiles,
81538
+ operationClass: "read",
81539
+ annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
81540
+ rationale: "Lists artifact files and metadata.",
81541
+ compensation: null
81542
+ },
81543
+ [mcpToolNames.retrieveContext]: {
81544
+ name: mcpToolNames.retrieveContext,
81545
+ operationClass: "read",
81546
+ annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
81547
+ rationale: "Rehydrates a compact mrrlin:// context handle into a full record.",
81548
+ compensation: null
81549
+ },
81550
+ // Reversible mutations (8 tools)
81551
+ [mcpToolNames.createPlan]: {
81552
+ name: mcpToolNames.createPlan,
81553
+ operationClass: "reversible_mutation",
81554
+ annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: false },
81555
+ rationale: "Creates a new plan within the project.",
81556
+ compensation: "archive_plan"
81557
+ },
81558
+ [mcpToolNames.updatePlan]: {
81559
+ name: mcpToolNames.updatePlan,
81560
+ operationClass: "reversible_mutation",
81561
+ annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: false, openWorldHint: false },
81562
+ rationale: "Modifies plan title, status, or description.",
81563
+ compensation: "update_plan"
81564
+ },
81565
+ [mcpToolNames.archivePlan]: {
81566
+ name: mcpToolNames.archivePlan,
81567
+ operationClass: "reversible_mutation",
81568
+ annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: false, openWorldHint: false },
81569
+ rationale: "Soft-deletes or archives an existing plan.",
81570
+ compensation: "update_plan"
81571
+ },
81572
+ [mcpToolNames.createTaxonomyEntry]: {
81573
+ name: mcpToolNames.createTaxonomyEntry,
81574
+ operationClass: "reversible_mutation",
81575
+ annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: false },
81576
+ rationale: "Adds a category or tag to project taxonomy.",
81577
+ compensation: "delete_taxonomy_entry"
81578
+ },
81579
+ [mcpToolNames.renameTaxonomyEntry]: {
81580
+ name: mcpToolNames.renameTaxonomyEntry,
81581
+ operationClass: "reversible_mutation",
81582
+ annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: false, openWorldHint: false },
81583
+ rationale: "Renames an existing taxonomy tag or category.",
81584
+ compensation: "rename_taxonomy_entry"
81585
+ },
81586
+ [mcpToolNames.deleteTaxonomyEntry]: {
81587
+ name: mcpToolNames.deleteTaxonomyEntry,
81588
+ operationClass: "reversible_mutation",
81589
+ annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: false, openWorldHint: false },
81590
+ rationale: "Removes a category or tag from project taxonomy.",
81591
+ compensation: "create_taxonomy_entry"
81592
+ },
81593
+ [mcpToolNames.createTaskDependency]: {
81594
+ name: mcpToolNames.createTaskDependency,
81595
+ operationClass: "reversible_mutation",
81596
+ annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: false },
81597
+ rationale: "Creates a dependency relationship between tasks.",
81598
+ compensation: "delete_task_dependency"
81599
+ },
81600
+ [mcpToolNames.registerLocalCheckout]: {
81601
+ name: mcpToolNames.registerLocalCheckout,
81602
+ operationClass: "reversible_mutation",
81603
+ annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: false, openWorldHint: true },
81604
+ rationale: "Registers or updates a local working tree checkout for the project.",
81605
+ compensation: null
81606
+ },
81607
+ // Irreversible mutations (36 tools)
81608
+ [mcpToolNames.createTask]: {
81609
+ name: mcpToolNames.createTask,
81610
+ operationClass: "irreversible_mutation",
81611
+ annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: false, openWorldHint: true },
81612
+ rationale: "Creates a new task in the project.",
81613
+ compensation: "archive_task"
81614
+ },
81615
+ [mcpToolNames.proposeTask]: {
81616
+ name: mcpToolNames.proposeTask,
81617
+ operationClass: "irreversible_mutation",
81618
+ annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: false },
81619
+ rationale: "Creates an uncommitted proposal or inbox proposal for a task.",
81620
+ compensation: null
81621
+ },
81622
+ [mcpToolNames.updateTask]: {
81623
+ name: mcpToolNames.updateTask,
81624
+ operationClass: "irreversible_mutation",
81625
+ annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: false, openWorldHint: true },
81626
+ rationale: "Updates mutable task fields, status, or priority.",
81627
+ compensation: null
81628
+ },
81629
+ [mcpToolNames.archiveTask]: {
81630
+ name: mcpToolNames.archiveTask,
81631
+ operationClass: "irreversible_mutation",
81632
+ annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: false, openWorldHint: true },
81633
+ rationale: "Archives a task and cascades dependent state.",
81634
+ compensation: "unarchive_task"
81635
+ },
81636
+ [mcpToolNames.unarchiveTask]: {
81637
+ name: mcpToolNames.unarchiveTask,
81638
+ operationClass: "irreversible_mutation",
81639
+ annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: false, openWorldHint: true },
81640
+ rationale: "Restores an archived task without undoing cascaded execution state.",
81641
+ compensation: "archive_task"
81642
+ },
81643
+ [mcpToolNames.takeOverTask]: {
81644
+ name: mcpToolNames.takeOverTask,
81645
+ operationClass: "irreversible_mutation",
81646
+ annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: false, openWorldHint: true },
81647
+ rationale: "Reassigns task execution or claims exclusive worker ownership.",
81648
+ compensation: null
81649
+ },
81650
+ [mcpToolNames.closeTaskAsWontDo]: {
81651
+ name: mcpToolNames.closeTaskAsWontDo,
81652
+ operationClass: "irreversible_mutation",
81653
+ annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: false },
81654
+ rationale: "Creates an operator approval question proposing to close task as wont-do.",
81655
+ compensation: null
81656
+ },
81657
+ [mcpToolNames.resetDirectorThread]: {
81658
+ name: mcpToolNames.resetDirectorThread,
81659
+ operationClass: "irreversible_mutation",
81660
+ annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: false, openWorldHint: false },
81661
+ rationale: "Resets the active director conversation thread and session state.",
81662
+ compensation: null
81663
+ },
81664
+ [mcpToolNames.deleteTaskDependency]: {
81665
+ name: mcpToolNames.deleteTaskDependency,
81666
+ operationClass: "irreversible_mutation",
81667
+ annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: false, openWorldHint: true },
81668
+ rationale: "Removes an existing dependency edge between tasks.",
81669
+ compensation: "create_task_dependency"
81670
+ },
81671
+ [mcpToolNames.appendTaskEvent]: {
81672
+ name: mcpToolNames.appendTaskEvent,
81673
+ operationClass: "irreversible_mutation",
81674
+ annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: false },
81675
+ rationale: "Appends an immutable audit event to the task event stream.",
81676
+ compensation: null
81677
+ },
81678
+ [mcpToolNames.addProjectMember]: {
81679
+ name: mcpToolNames.addProjectMember,
81680
+ operationClass: "irreversible_mutation",
81681
+ annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: false, openWorldHint: true },
81682
+ rationale: "Grants project access and assigns a member role.",
81683
+ compensation: "remove_project_member"
81684
+ },
81685
+ [mcpToolNames.removeProjectMember]: {
81686
+ name: mcpToolNames.removeProjectMember,
81687
+ operationClass: "irreversible_mutation",
81688
+ annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: false, openWorldHint: true },
81689
+ rationale: "Revokes project access for an existing member.",
81690
+ compensation: "add_project_member"
81691
+ },
81692
+ [mcpToolNames.createWikiPage]: {
81693
+ name: mcpToolNames.createWikiPage,
81694
+ operationClass: "irreversible_mutation",
81695
+ annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: false, openWorldHint: true },
81696
+ rationale: "Creates a new wiki documentation or specification page.",
81697
+ compensation: null
81698
+ },
81699
+ [mcpToolNames.updateWikiPage]: {
81700
+ name: mcpToolNames.updateWikiPage,
81701
+ operationClass: "irreversible_mutation",
81702
+ annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: false, openWorldHint: true },
81703
+ rationale: "Overwrites or edits existing wiki page content and revision.",
81704
+ compensation: null
81705
+ },
81706
+ [mcpToolNames.markSpecReady]: {
81707
+ name: mcpToolNames.markSpecReady,
81708
+ operationClass: "irreversible_mutation",
81709
+ annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: false, openWorldHint: true },
81710
+ rationale: "Transitions a task specification to ready status, enabling downstream execution.",
81711
+ compensation: null
81712
+ },
81713
+ [mcpToolNames.runSpecConsensus]: {
81714
+ name: mcpToolNames.runSpecConsensus,
81715
+ operationClass: "irreversible_mutation",
81716
+ annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: false, openWorldHint: true },
81717
+ rationale: "Dispatches specification consensus review across arbiter agents.",
81718
+ compensation: null
81719
+ },
81720
+ [mcpToolNames.runCodeReviewerGate]: {
81721
+ name: mcpToolNames.runCodeReviewerGate,
81722
+ operationClass: "irreversible_mutation",
81723
+ annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: false, openWorldHint: true },
81724
+ rationale: "Dispatches code review gate inspection for an execution run or PR.",
81725
+ compensation: null
81726
+ },
81727
+ [mcpToolNames.runDecisionConsensus]: {
81728
+ name: mcpToolNames.runDecisionConsensus,
81729
+ operationClass: "irreversible_mutation",
81730
+ annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: true },
81731
+ rationale: "Executes multi-model consensus round consuming external model tokens.",
81732
+ compensation: null
81733
+ },
81734
+ [mcpToolNames.createExecutionRun]: {
81735
+ name: mcpToolNames.createExecutionRun,
81736
+ operationClass: "irreversible_mutation",
81737
+ annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: false, openWorldHint: true },
81738
+ rationale: "Spawns a new execution run with allocated runtime environment.",
81739
+ compensation: null
81740
+ },
81741
+ [mcpToolNames.updateExecutionRun]: {
81742
+ name: mcpToolNames.updateExecutionRun,
81743
+ operationClass: "irreversible_mutation",
81744
+ annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: false, openWorldHint: true },
81745
+ rationale: "Updates execution run status, heartbeat, or completion metrics.",
81746
+ compensation: null
81747
+ },
81748
+ [mcpToolNames.appendExecutionArtifact]: {
81749
+ name: mcpToolNames.appendExecutionArtifact,
81750
+ operationClass: "irreversible_mutation",
81751
+ annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: false, openWorldHint: false },
81752
+ rationale: "Appends behaviorally significant artifact or log to execution run.",
81753
+ compensation: null
81754
+ },
81755
+ [mcpToolNames.recordProducedUrl]: {
81756
+ name: mcpToolNames.recordProducedUrl,
81757
+ operationClass: "irreversible_mutation",
81758
+ annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: false },
81759
+ rationale: "Records a verified deployment or preview URL for a run.",
81760
+ compensation: null
81761
+ },
81762
+ [mcpToolNames.updateTaskState]: {
81763
+ name: mcpToolNames.updateTaskState,
81764
+ operationClass: "irreversible_mutation",
81765
+ annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: false, openWorldHint: false },
81766
+ rationale: "Applies director internal state updates to the task.",
81767
+ compensation: null
81768
+ },
81769
+ [mcpToolNames.reclaimExecutionRunLease]: {
81770
+ name: mcpToolNames.reclaimExecutionRunLease,
81771
+ operationClass: "irreversible_mutation",
81772
+ annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: false, openWorldHint: true },
81773
+ rationale: "Reclaims an expired execution lease from an inactive runner.",
81774
+ compensation: null
81775
+ },
81776
+ [mcpToolNames.restartExecutionRun]: {
81777
+ name: mcpToolNames.restartExecutionRun,
81778
+ operationClass: "irreversible_mutation",
81779
+ annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: false, openWorldHint: true },
81780
+ rationale: "Restarts an interrupted or failed execution run.",
81781
+ compensation: null
81782
+ },
81783
+ [mcpToolNames.stopExecutionRun]: {
81784
+ name: mcpToolNames.stopExecutionRun,
81785
+ operationClass: "irreversible_mutation",
81786
+ annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: false, openWorldHint: true },
81787
+ rationale: "Signals immediate cancellation and termination of an active run.",
81788
+ compensation: null
81789
+ },
81790
+ [mcpToolNames.resolveHandoff]: {
81791
+ name: mcpToolNames.resolveHandoff,
81792
+ operationClass: "irreversible_mutation",
81793
+ annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: false, openWorldHint: true },
81794
+ rationale: "Resolves or responds to an inter-agent handoff proposal.",
81795
+ compensation: null
81796
+ },
81797
+ [mcpToolNames.upsertProjectSchedulerPolicy]: {
81798
+ name: mcpToolNames.upsertProjectSchedulerPolicy,
81799
+ operationClass: "irreversible_mutation",
81800
+ annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: false, openWorldHint: true },
81801
+ rationale: "Updates project task concurrency and execution scheduling limits.",
81802
+ compensation: null
81803
+ },
81804
+ [mcpToolNames.wakeDirector]: {
81805
+ name: mcpToolNames.wakeDirector,
81806
+ operationClass: "irreversible_mutation",
81807
+ annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: false, openWorldHint: true },
81808
+ rationale: "Dispatches a wake notification to the project director service.",
81809
+ compensation: null
81810
+ },
81811
+ [mcpToolNames.createInboxItem]: {
81812
+ name: mcpToolNames.createInboxItem,
81813
+ operationClass: "irreversible_mutation",
81814
+ annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: false },
81815
+ rationale: "Creates a new operator inbox notification, question, or approval proposal.",
81816
+ compensation: null
81817
+ },
81818
+ [mcpToolNames.decideInboxItem]: {
81819
+ name: mcpToolNames.decideInboxItem,
81820
+ operationClass: "irreversible_mutation",
81821
+ annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: false, openWorldHint: true },
81822
+ rationale: "Records an operator decision on an inbox item, triggering gated side effects.",
81823
+ compensation: null
81824
+ },
81825
+ [mcpToolNames.uploadArtifact]: {
81826
+ name: mcpToolNames.uploadArtifact,
81827
+ operationClass: "irreversible_mutation",
81828
+ annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: false, openWorldHint: true },
81829
+ rationale: "Uploads an artifact payload to storage.",
81830
+ compensation: null
81831
+ },
81832
+ [mcpToolNames.deliverFile]: {
81833
+ name: mcpToolNames.deliverFile,
81834
+ operationClass: "irreversible_mutation",
81835
+ annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: false, openWorldHint: true },
81836
+ rationale: "Delivers an artifact file via configured capability transport.",
81837
+ compensation: null
81838
+ },
81839
+ [mcpToolNames.initLocalRepo]: {
81840
+ name: mcpToolNames.initLocalRepo,
81841
+ operationClass: "irreversible_mutation",
81842
+ annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: false, openWorldHint: true },
81843
+ rationale: "Initializes a local git repository checkout with operator consent.",
81844
+ compensation: null
81845
+ },
81846
+ [mcpToolNames.setProjectCodeHost]: {
81847
+ name: mcpToolNames.setProjectCodeHost,
81848
+ operationClass: "irreversible_mutation",
81849
+ annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: false, openWorldHint: true },
81850
+ rationale: "Configures the external repository hosting provider and credentials.",
81851
+ compensation: null
81852
+ },
81853
+ [mcpToolNames.applyLocalRun]: {
81854
+ name: mcpToolNames.applyLocalRun,
81855
+ operationClass: "irreversible_mutation",
81856
+ annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: false, openWorldHint: true },
81857
+ rationale: "Lands completed run changes onto the default branch checkout.",
81858
+ compensation: null
81859
+ }
81860
+ };
81861
+ function assertToolContractCoverage(publicNames, registry3, schemaMap, toolMap) {
81862
+ const publicNamesSet = /* @__PURE__ */ new Set();
81863
+ const duplicates = [];
81864
+ for (const name of publicNames) {
81865
+ if (publicNamesSet.has(name)) {
81866
+ duplicates.push(name);
81867
+ }
81868
+ publicNamesSet.add(name);
81869
+ }
81870
+ if (duplicates.length > 0) {
81871
+ throw new Error(`Duplicate public tool wire names detected: ${duplicates.sort().join(", ")}`);
81872
+ }
81873
+ const registryKeys = Object.keys(registry3);
81874
+ const schemaKeys = Object.keys(schemaMap);
81875
+ const toolKeys = Object.keys(toolMap);
81876
+ const registrySet = new Set(registryKeys);
81877
+ const schemaSet = new Set(schemaKeys);
81878
+ const toolSet = new Set(toolKeys);
81879
+ const allNames = Array.from(/* @__PURE__ */ new Set([...publicNames, ...registryKeys, ...schemaKeys, ...toolKeys])).sort();
81880
+ const missingFromPublic = allNames.filter((n) => !publicNamesSet.has(n));
81881
+ const missingFromRegistry = allNames.filter((n) => !registrySet.has(n));
81882
+ const missingFromSchemas = allNames.filter((n) => !schemaSet.has(n));
81883
+ const missingFromTools = allNames.filter((n) => !toolSet.has(n));
81884
+ if (missingFromRegistry.length > 0 || missingFromSchemas.length > 0 || missingFromTools.length > 0 || missingFromPublic.length > 0) {
81885
+ const details = [
81886
+ missingFromPublic.length ? `missing from public names: [${missingFromPublic.join(", ")}]` : null,
81887
+ missingFromRegistry.length ? `missing from registry: [${missingFromRegistry.join(", ")}]` : null,
81888
+ missingFromSchemas.length ? `missing from schemas: [${missingFromSchemas.join(", ")}]` : null,
81889
+ missingFromTools.length ? `missing from tool map: [${missingFromTools.join(", ")}]` : null
81890
+ ].filter(Boolean).join("; ");
81891
+ throw new Error(`Tool contract inventory mismatch: ${details}`);
81892
+ }
81893
+ const mismatchedToolNames = [];
81894
+ for (const [key, tool] of Object.entries(toolMap)) {
81895
+ if (tool.name !== key) {
81896
+ mismatchedToolNames.push(`key '${key}' !== tool.name '${tool.name}'`);
81897
+ }
81898
+ }
81899
+ if (mismatchedToolNames.length > 0) {
81900
+ throw new Error(`Instantiated tool name mismatch: ${mismatchedToolNames.sort().join(", ")}`);
81901
+ }
81902
+ const mismatchedSchemas = [];
81903
+ for (const [key, tool] of Object.entries(toolMap)) {
81904
+ if (tool.inputSchema !== schemaMap[key]) {
81905
+ mismatchedSchemas.push(key);
81906
+ }
81907
+ }
81908
+ if (mismatchedSchemas.length > 0) {
81909
+ throw new Error(`Instantiated tool inputSchema mismatch: ${mismatchedSchemas.sort().join(", ")}`);
81910
+ }
81911
+ }
81912
+
81379
81913
  // src/server.ts
81380
81914
  function redactUrlForLog(value) {
81381
81915
  try {
@@ -81477,12 +82011,19 @@ function zodInputToJsonSchema(schema) {
81477
82011
  function createMrrlinMcpServer(options = {}) {
81478
82012
  const resolved = resolveServerOptions(options);
81479
82013
  const tools = createMrrlinTools(resolved);
82014
+ assertToolContractCoverage(
82015
+ Object.values(mcpToolNames),
82016
+ toolRegistry,
82017
+ mcpToolInputSchemas,
82018
+ tools
82019
+ );
81480
82020
  const server = new Server(
81481
82021
  { name: options.name ?? "@mrrlin-dev/mcp", version: options.version ?? "0.1.0" },
81482
82022
  { capabilities: { tools: {} } }
81483
82023
  );
81484
82024
  server.setRequestHandler(ListToolsRequestSchema, async () => ({
81485
82025
  tools: Object.values(tools).map((tool) => ({
82026
+ annotations: toolRegistry[tool.name].annotations,
81486
82027
  description: tool.description,
81487
82028
  inputSchema: zodInputToJsonSchema(tool.inputSchema),
81488
82029
  name: tool.name
@@ -81491,24 +82032,19 @@ function createMrrlinMcpServer(options = {}) {
81491
82032
  server.setRequestHandler(CallToolRequestSchema, async (request) => {
81492
82033
  const name = request.params.name;
81493
82034
  const tool = tools[name];
81494
- if (!tool) {
81495
- return {
81496
- content: [{ text: JSON.stringify({ error: { code: "UNKNOWN_TOOL", message: `Unknown MCP tool: ${name}` } }), type: "text" }],
81497
- isError: true
81498
- };
82035
+ if (!Object.prototype.hasOwnProperty.call(tools, name) || !tool) {
82036
+ return buildToolError({
82037
+ code: "UNKNOWN_TOOL",
82038
+ message: `Unknown MCP tool: ${name}`
82039
+ });
81499
82040
  }
81500
82041
  const schema = mcpToolInputSchemas[name];
81501
82042
  const parsed = schema.safeParse(request.params.arguments ?? {});
81502
82043
  if (!parsed.success) {
81503
- return {
81504
- content: [
81505
- {
81506
- text: JSON.stringify({ error: { code: "VALIDATION_FAILED", message: parsed.error.message } }),
81507
- type: "text"
81508
- }
81509
- ],
81510
- isError: true
81511
- };
82044
+ return buildToolError({
82045
+ code: "VALIDATION_FAILED",
82046
+ message: parsed.error.message
82047
+ });
81512
82048
  }
81513
82049
  return tool.invoke(parsed.data);
81514
82050
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mrrlin-dev/mcp",
3
- "version": "0.4.153",
3
+ "version": "0.4.154",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "mrrlin-mcp": "dist/bin.cjs"