@brightbeamai/chap-coordinator-mcp 0.2.13 → 0.3.1
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.
- package/README.md +2 -2
- package/dist/cli.cjs +150 -39
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +150 -39
- package/dist/cli.js.map +1 -1
- package/dist/index.cjs +151 -38
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +150 -38
- package/dist/index.js.map +1 -1
- package/dist/schemas.cjs +17 -9
- package/dist/schemas.cjs.map +1 -1
- package/dist/schemas.d.cts +1 -1
- package/dist/schemas.d.ts +1 -1
- package/dist/schemas.js +17 -9
- package/dist/schemas.js.map +1 -1
- package/dist/tools.cjs +118 -21
- package/dist/tools.cjs.map +1 -1
- package/dist/tools.d.cts +46 -6
- package/dist/tools.d.ts +46 -6
- package/dist/tools.js +117 -21
- package/dist/tools.js.map +1 -1
- package/package.json +4 -4
package/dist/index.cjs
CHANGED
|
@@ -29,6 +29,7 @@ __export(src_exports, {
|
|
|
29
29
|
SCHEMAS: () => SCHEMAS,
|
|
30
30
|
SUPPORTED_PROTOCOL_VERSIONS: () => SUPPORTED_PROTOCOL_VERSIONS,
|
|
31
31
|
ServerDiscoverRequestSchema: () => ServerDiscoverRequestSchema,
|
|
32
|
+
TOOL_ANNOTATIONS: () => TOOL_ANNOTATIONS,
|
|
32
33
|
TOOL_DESCRIPTIONS: () => TOOL_DESCRIPTIONS,
|
|
33
34
|
TOOL_NAMES: () => TOOL_NAMES,
|
|
34
35
|
UNSUPPORTED_PROTOCOL_VERSION: () => UNSUPPORTED_PROTOCOL_VERSION,
|
|
@@ -184,8 +185,8 @@ var SCHEMAS = {
|
|
|
184
185
|
task_id: TASK_ID,
|
|
185
186
|
state: {
|
|
186
187
|
type: "string",
|
|
187
|
-
enum: ["in_progress", "
|
|
188
|
-
description: "The state to move the task to. Only the transitions in SPECIFICATION.md 8.1 are legal from the task's current state; others are refused with -32602. A task marked review_required cannot be moved to 'completed' here: submit the output with chap.task.complete, which opens the review."
|
|
188
|
+
enum: ["in_progress", "declined", "cancelled", "completed"],
|
|
189
|
+
description: "The state to move the task to. Only the transitions in SPECIFICATION.md 8.1 are legal from the task's current state; others are refused with -32602. A review opens with chap.review.request, or with chap.task.complete on a task that requires one, so 'review_requested' is not a target here. A task marked review_required cannot be moved to 'completed' here: submit the output with chap.task.complete, which opens the review."
|
|
189
190
|
},
|
|
190
191
|
progress_note: { type: "string", description: "Short note on what changed, kept in the task's history." }
|
|
191
192
|
},
|
|
@@ -221,7 +222,12 @@ var SCHEMAS = {
|
|
|
221
222
|
properties: {
|
|
222
223
|
method: { type: "string", description: "Return only entries for this CHAP method, e.g. 'decide.override'. Matched in full, without the 'chap.' tool-name prefix." },
|
|
223
224
|
from: { type: "string", description: "Return only entries whose actor is this participant URI." },
|
|
224
|
-
task_id: { type: "string", description: "Return only entries about this task." }
|
|
225
|
+
task_id: { type: "string", description: "Return only entries about this task." },
|
|
226
|
+
outcome: {
|
|
227
|
+
type: "string",
|
|
228
|
+
enum: ["accepted", "refused"],
|
|
229
|
+
description: "Return only accepted calls, or only the refused attempts the coordinator recorded. Omit for both."
|
|
230
|
+
}
|
|
225
231
|
}
|
|
226
232
|
}
|
|
227
233
|
},
|
|
@@ -341,8 +347,9 @@ var SCHEMAS = {
|
|
|
341
347
|
description: "The successor task to open for the escalation target.",
|
|
342
348
|
properties: {
|
|
343
349
|
kind: { type: "string", description: "Task kind for the successor. Defaults to the original's kind." },
|
|
344
|
-
assignee: { ...PARTICIPANT_URI, description: "Who the escalation goes to. Must be a workspace member." },
|
|
345
|
-
input: { type: "object", additionalProperties: true, description: "Input payload for the successor. It defaults to an empty object rather than the original's input, so anything the new assignee needs has to be restated here." }
|
|
350
|
+
assignee: { ...PARTICIPANT_URI, description: "Who the escalation goes to. Must be a workspace member who is not paused: a paused assignee is refused with -32063." },
|
|
351
|
+
input: { type: "object", additionalProperties: true, description: "Input payload for the successor. It defaults to an empty object rather than the original's input, so anything the new assignee needs has to be restated here." },
|
|
352
|
+
mode: { type: "string", enum: ["shadow", "trial", "production"], description: "Mode for the successor, defaulting to the original's. A mode above the workspace's current ceiling is refused with -32040, so after the ceiling is lowered a task is escalated by naming a mode within it." }
|
|
346
353
|
},
|
|
347
354
|
required: ["assignee"]
|
|
348
355
|
}
|
|
@@ -533,7 +540,7 @@ var SCHEMAS = {
|
|
|
533
540
|
type: "string",
|
|
534
541
|
enum: ["task", "participant", "workspace"],
|
|
535
542
|
default: "task",
|
|
536
|
-
description: "What the resume applies to. 'task' returns a paused task to
|
|
543
|
+
description: "What the resume applies to. 'task' returns a paused task to the state it held at the pause; a task that is not paused is refused with -32061. 'participant' allows that member to be assigned tasks again. 'workspace' returns the workspace to active."
|
|
537
544
|
},
|
|
538
545
|
task_id: TASK_ID,
|
|
539
546
|
participant_uri: { ...PARTICIPANT_URI, description: "Whose work to resume, when scope is 'participant'. Must be a workspace member." }
|
|
@@ -582,8 +589,10 @@ var SCHEMAS = {
|
|
|
582
589
|
description: "The replacement task.",
|
|
583
590
|
properties: {
|
|
584
591
|
kind: { type: "string", description: "Task kind for the successor. Required." },
|
|
585
|
-
assignee: { ...PARTICIPANT_URI, description: "Who takes the replacement on. Defaults to the superseded task's assignee, and must be a workspace member." },
|
|
586
|
-
input: { type: "object", additionalProperties: true, description: "Input payload for the successor. Defaults to an empty object." }
|
|
592
|
+
assignee: { ...PARTICIPANT_URI, description: "Who takes the replacement on. Defaults to the superseded task's assignee, and must be a workspace member who is not paused." },
|
|
593
|
+
input: { type: "object", additionalProperties: true, description: "Input payload for the successor. Defaults to an empty object." },
|
|
594
|
+
mode: { type: "string", enum: ["shadow", "trial", "production"], description: "Mode for the successor, defaulting to the superseded task's. A mode above the workspace's current ceiling is refused with -32040." },
|
|
595
|
+
review_required: { type: "boolean", description: "Whether completing the successor needs a reviewer decision. A successor of a task that requires review requires it whatever is passed here, and under modes/1.0 so does a trial-mode successor." }
|
|
587
596
|
},
|
|
588
597
|
required: ["kind"]
|
|
589
598
|
},
|
|
@@ -614,7 +623,7 @@ var SCHEMAS = {
|
|
|
614
623
|
workspace: WORKSPACE_ID,
|
|
615
624
|
from: PARTICIPANT_URI,
|
|
616
625
|
task_id: TASK_ID,
|
|
617
|
-
candidates: { type: "array", items: PARTICIPANT_URI, description: "Candidate assignees. An empty list is refused with -32513.
|
|
626
|
+
candidates: { type: "array", items: PARTICIPANT_URI, description: "Candidate assignees. An empty list is refused with -32513. The default policy takes the first candidate that is a workspace member and is not paused, and refuses the call with -32510 when there is none. An operator-supplied routing policy may select on any basis; a choice that is not a member is refused with -32510, and one who is paused with -32063." }
|
|
618
627
|
},
|
|
619
628
|
required: ["workspace", "from", "task_id", "candidates"]
|
|
620
629
|
},
|
|
@@ -751,52 +760,147 @@ var TOOL_DESCRIPTIONS = {
|
|
|
751
760
|
// Core
|
|
752
761
|
"chap.workspace.create": "Create a workspace: the container for the participants, tasks and audit log of one piece of collaborative work. Returns the workspace id, which every later call carries.",
|
|
753
762
|
"chap.workspace.describe": "Report the current state of a workspace: its members, enabled profiles, audit length, and task and override counts.",
|
|
754
|
-
"chap.workspace.set_profiles": "Replace the set of profiles enabled on a workspace. Enabling audit-scitt/1.0 on a workspace that already has entries leaves
|
|
763
|
+
"chap.workspace.set_profiles": "Replace the whole set of profiles enabled on a workspace. The list is not merged: any profile absent from it is dropped, so send the complete set you want. Enabling audit-scitt/1.0 on a workspace that already has entries starts the chain from that point and leaves the earlier entries permanently outside it, which chap.audit.verify_chain then reports as not_evaluated. Prefer setting profiles at chap.workspace.create, where no entries exist yet to strand.",
|
|
755
764
|
"chap.participant.join": "Add a participant to a workspace. The type given, human, agent, service, group or workspace, decides whether they are eligible to review work that requires it.",
|
|
756
|
-
"chap.participant.leave": "Remove a participant from a workspace. Entries they have already written stay in the audit log.",
|
|
757
|
-
"chap.task.create": "Create a task: a unit of work assigned to one participant. Set review_required to make
|
|
765
|
+
"chap.participant.leave": "Remove a participant from a workspace. Entries they have already written stay in the audit log and their past signatures still verify, so leaving is not a way to withdraw a decision. They can no longer be assigned tasks or act as a reviewer, and returning means a fresh chap.participant.join.",
|
|
766
|
+
"chap.task.create": "Create a task: a unit of work assigned to one participant. Set review_required to make completion depend on a reviewer decision rather than on the assignee. Returns a task_id that the rest of the lifecycle takes. Supplying idempotency_key is what makes a retry safe: a repeat carrying a key already seen returns the original task, while a repeat without one creates a second task. Assigning to a paused member is refused.",
|
|
758
767
|
"chap.task.update": "Move a task to a new state. Only the transitions in the specification's lifecycle table are accepted, and a task that requires review cannot be completed here.",
|
|
759
768
|
"chap.task.complete": "Submit a task's output. A task that requires review does not complete: the output is held as the artefact under review, the task moves to review_requested, and a reviewer decision completes it. Any other task completes immediately.",
|
|
760
|
-
"chap.audit.read": "Read entries from a workspace's audit log, optionally within a sequence range and filtered by method, sender or
|
|
769
|
+
"chap.audit.read": "Read entries from a workspace's audit log, optionally within a sequence range and filtered by method, sender, task or outcome. This is the query surface for everything the workspace has recorded, decisions and overrides included. An accepted call is under 'envelope'. A refused attempt the coordinator recorded, such as a decision by someone the review was not addressed to, is under 'request' with an 'outcome' giving the error code, and it did not take effect. Reads only: it records nothing, so it never appears in its own output. Entries come back as recorded, without aggregation, so grouping them, by tag for instance, is the reader's job.",
|
|
761
770
|
// review/1.0
|
|
762
771
|
"chap.review.request": "Open a review on a task and address it to one or more reviewers. They then call chap.decide.approve, chap.decide.reject, chap.decide.override or chap.abstain.declare. Repeating the request with the same artefact adds reviewers to the open review.",
|
|
763
|
-
"chap.decide.approve": "Approve the artefact under review. The task completes once the review's rule is satisfied.",
|
|
764
|
-
"chap.decide.reject": "Reject the artefact under review. The task is declined, or returns to in_progress
|
|
772
|
+
"chap.decide.approve": "Approve the artefact under review as it stands. Only a reviewer the review was addressed to may decide, and anyone else is refused with -32011. The task completes once the review's rule is satisfied, so under all_approve or quorum:N an approval may leave the review open awaiting others. Use chap.decide.override instead to accept a corrected version.",
|
|
773
|
+
"chap.decide.reject": "Reject the artefact under review. The task is declined, or returns to in_progress when request_revision is set, which is the choice between ending the work and sending it back. Only a reviewer the review was addressed to may decide. Use chap.decide.override instead to correct the artefact and accept it rather than refuse it.",
|
|
765
774
|
"chap.decide.override": "Correct the artefact under review with an RFC 6902 JSON Patch and accept the result. The patch, the rationale and any tags are recorded together, so the audit log holds what was changed and why, rather than only that the work was not accepted as written.",
|
|
766
|
-
"chap.abstain.declare": "Stand aside from a review,
|
|
767
|
-
"chap.escalate.raise": "Hand a task upwards. The original moves to escalated and is linked to a new task
|
|
775
|
+
"chap.abstain.declare": "Stand aside from a review this participant cannot decide, for example on a conflict of interest or for want of context. Use it in place of chap.decide.reject, which judges the work; abstaining judges nothing and leaves the artefact intact. It requires an open review addressed to the caller and answers -32010 otherwise. The task moves to abstained, which is not terminal: chap.escalate.raise or a fresh chap.review.request can still carry it forward.",
|
|
776
|
+
"chap.escalate.raise": "Hand a task upwards, where the current holder can act but should not decide alone. The original moves to escalated and is linked to a new task for whoever takes it on. Use chap.handoff.propose to pass work sideways without that link, and chap.control.supersede to replace a task outright. The successor starts with an empty input unless one is supplied, so restate whatever the new assignee needs. A completed, cancelled or superseded task cannot be escalated. The successor takes the mode new_task.mode names, or else the original's, and requires review when the original did, or when it is a trial task under modes/1.0. A paused assignee is refused with -32063, and a mode above the workspace's current ceiling with -32040; after the ceiling is lowered, name a mode within it.",
|
|
768
777
|
// whisper/1.0
|
|
769
778
|
"chap.whisper.ask": "Put one question to one or more participants, with a deadline and a default. If the deadline passes unanswered the default applies, so a task is never blocked waiting on a reply.",
|
|
770
|
-
"chap.whisper.answer": "Answer an open whisper. Where the question carried options, the answer must name one of
|
|
779
|
+
"chap.whisper.answer": "Answer an open whisper. Where the question carried options, the answer must name one of their ids and any other value is refused with -32022. A whisper already answered is refused with -32020 and one past its deadline with -32021, in which case the default supplied at chap.whisper.ask has already been applied.",
|
|
771
780
|
// deliberation/1.0
|
|
772
|
-
"chap.deliberate.open": "Open a
|
|
773
|
-
"chap.deliberate.comment": "Record a comment on an open deliberation, so the reasoning
|
|
774
|
-
"chap.deliberate.vote": "Cast a yea, nay or abstain in an open deliberation. Each participant votes once.",
|
|
775
|
-
"chap.deliberate.close": "Close a deliberation and compute its outcome from the votes cast under its rule.",
|
|
781
|
+
"chap.deliberate.open": "Open a group decision among several participants under a stated voting rule: any_one_approves, all_approve, quorum:N, weighted_vote:T or weighted_vote_with_veto:T. Use it where several people must weigh in on one question; chap.review.request is the tool for judging one participant's output. Returns a deliberation_id that the comment, vote and close tools all take. The participant list, rule, weights and veto map are fixed at open, so the terms are settled before anyone votes. No outcome exists until chap.deliberate.close computes one.",
|
|
782
|
+
"chap.deliberate.comment": "Record a comment on an open deliberation, so the reasoning behind a vote survives alongside the tally. Comments carry no weight in the outcome and may be added by any participant at any point before chap.deliberate.close.",
|
|
783
|
+
"chap.deliberate.vote": "Cast a yea, nay or abstain in an open deliberation. Each participant votes once and a second attempt answers -32031, so a vote cannot be revised. An abstention is recorded but counts as neither side, which under all_approve or quorum:N withholds the approval those rules need. The tally is computed later, by chap.deliberate.close.",
|
|
784
|
+
"chap.deliberate.close": "Close a deliberation and compute its outcome from the votes cast under its rule. Closing is final: further comments and votes are refused with -32032. Calling it again on a closed deliberation returns the same outcome and changes nothing, so a retry is safe. Votes never cast are simply absent from the tally rather than counted as abstentions.",
|
|
776
785
|
// handoff/1.0
|
|
777
786
|
"chap.handoff.propose": "Propose handing one or more tasks to another participant or a group, with the context needed to pick them up. Every task must currently be assigned to the proposer.",
|
|
778
|
-
"chap.handoff.accept": "Accept a proposed handoff. The accepted tasks are reassigned to the accepting participant.",
|
|
779
|
-
"chap.handoff.decline": "Decline a proposed handoff
|
|
787
|
+
"chap.handoff.accept": "Accept a proposed handoff. The accepted tasks are reassigned to the accepting participant, which is the point at which responsibility actually moves. Omitting accepted_task_ids accepts all of them. Accepting resolves the proposal for good: a later accept or decline on the same handoff answers -32051. A paused participant cannot accept and is refused with -32063.",
|
|
788
|
+
"chap.handoff.decline": "Decline a proposed handoff. The tasks stay with the proposer and nothing is reassigned, which is the difference from chap.handoff.accept. Declining resolves the proposal for good: a later accept or decline on the same handoff answers -32051, and trying again means a fresh proposal. The reason is recorded so the proposer can route the work elsewhere.",
|
|
780
789
|
// control/1.0
|
|
781
790
|
"chap.control.pause": "Pause work. Scoped to a task it moves that task to paused; to a participant it stops new tasks being assigned to them; to the workspace it refuses every method except describing, reading the audit log, joining, leaving and resuming.",
|
|
782
|
-
"chap.control.resume": "Resume work paused at the same scope: a task returns to
|
|
791
|
+
"chap.control.resume": "Resume work paused at the same scope: a task returns to the state it held at the pause, a participant can be assigned tasks again, a workspace returns to active.",
|
|
783
792
|
"chap.control.cancel": "Cancel a task. Cancelled is terminal, and a task that has already settled cannot be cancelled.",
|
|
784
|
-
"chap.control.snapshot": "Capture the workspace state as an artefact
|
|
793
|
+
"chap.control.snapshot": "Capture the workspace state as an artefact before a change you may want to undo. Returns a snapshot artefact id, which is the only thing chap.control.rollback accepts as a target; the label is for a human reading the log and cannot be used to select it. Taking a snapshot changes nothing. Note that a rollback restores only the mode ceiling and member roles, so a snapshot is a narrow safety net rather than a general undo.",
|
|
785
794
|
"chap.control.rollback": "Restore workspace state from a snapshot. The mode ceiling and member roles are restored; the rollback is appended to the audit log rather than rewriting it.",
|
|
786
|
-
"chap.control.supersede": "Replace a task with a successor in one call. The original moves to superseded and stays linked to its replacement.",
|
|
795
|
+
"chap.control.supersede": "Replace a task with a successor in one call. The original moves to superseded and stays linked to its replacement. The successor requires review when the original did, whatever its own review_required says, and a paused assignee is refused with -32063.",
|
|
787
796
|
"chap.control.set_mode_ceiling": "Set the highest operating mode tasks in this workspace may request. A task above the ceiling is refused.",
|
|
788
797
|
// routing/1.0
|
|
789
|
-
"chap.task.route": "Choose an assignee for a task from a list of candidates and record a route_decision artefact naming the policy, the candidate chosen
|
|
798
|
+
"chap.task.route": "Choose an assignee for a task from a list of candidates and reassign the task to the one selected. Use it where the choice itself belongs on the record: it writes a route_decision artefact naming the policy, the candidate chosen and the alternatives passed over, none of which is captured by setting assignee directly on chap.task.create. The default policy takes the first candidate that is a workspace member and is not paused. An operator-supplied policy may choose on any basis, and the call is refused with -32510 when its choice is not a member, or with -32063 when its choice is paused.",
|
|
790
799
|
"chap.review.depth": "Decide how much review a task warrants, skip, spot_check or full, from its routing hints. Records a route_decision artefact giving the rule that produced the answer.",
|
|
791
|
-
"chap.escalate.auto": "Evaluate a task's routing hints against the escalation policy and report whether it should be escalated, and to whom.
|
|
800
|
+
"chap.escalate.auto": "Evaluate a task's routing hints against the escalation policy and report whether it should be escalated, and to whom. It decides only: a route_decision artefact is recorded but the task does not move, so act on the answer with chap.escalate.raise. The default policy escalates on criticality critical, or high with confidence below 0.6.",
|
|
792
801
|
// security-signed/1.0
|
|
793
802
|
"chap.participant.rotate_key": "Retire a participant's signing key and register its replacement. The old key stays in the key history with a valid_until timestamp, so envelopes it signed still verify.",
|
|
794
803
|
"chap.participant.revoke_key": "Revoke a signing key, for example after a device is lost. Signatures presented with it are refused from then on. Revoking another participant's key requires the admin role.",
|
|
795
804
|
// audit-scitt/1.0
|
|
796
805
|
"chap.audit.submit_to_scitt": "Build COSE_Sign1-shaped statements for a range of audit entries and submit them to the configured SCITT transparency service. Where none is configured the statements are returned for submission out of band.",
|
|
797
|
-
"chap.audit.verify_receipt": "
|
|
806
|
+
"chap.audit.verify_receipt": "Check a receipt returned by an external SCITT transparency service, confirming that service logged the statement. This is the external half of verification; chap.audit.verify_chain checks the local prev-hash chain instead, and the two answer different questions. Verification is delegated to a hook the deployment supplies and fails closed with -32082 when none is configured, so a missing verifier can never read as a pass. Reads only: nothing is recorded.",
|
|
798
807
|
"chap.audit.verify_chain": "Replay a workspace's prev-hash chain. Only status verified with ok true means the log was checked and is intact. Status not_evaluated with ok false means part of the log was never checked, so its integrity is unknown and must not be reported as verified; entries_unchecked says how much. An error means the chain is broken or absent."
|
|
799
808
|
};
|
|
809
|
+
var READ_ONLY = /* @__PURE__ */ new Set([
|
|
810
|
+
"chap.workspace.describe",
|
|
811
|
+
"chap.audit.read",
|
|
812
|
+
"chap.audit.verify_chain",
|
|
813
|
+
"chap.audit.verify_receipt",
|
|
814
|
+
// Submitting reads the chain and sends it onward. It changes nothing here,
|
|
815
|
+
// which is what readOnlyHint claims; openWorldHint carries the fact that it
|
|
816
|
+
// reaches a service outside this coordinator.
|
|
817
|
+
"chap.audit.submit_to_scitt"
|
|
818
|
+
]);
|
|
819
|
+
var DESTRUCTIVE = /* @__PURE__ */ new Set([
|
|
820
|
+
"chap.workspace.set_profiles",
|
|
821
|
+
// replaces the profile set; can strand entries outside the chain
|
|
822
|
+
"chap.participant.leave",
|
|
823
|
+
// removes a member
|
|
824
|
+
"chap.participant.revoke_key",
|
|
825
|
+
// invalidates a key from then on
|
|
826
|
+
"chap.control.cancel",
|
|
827
|
+
// cancelled is terminal
|
|
828
|
+
"chap.control.supersede",
|
|
829
|
+
// superseded is terminal
|
|
830
|
+
"chap.control.rollback"
|
|
831
|
+
// overwrites the mode ceiling and member roles
|
|
832
|
+
]);
|
|
833
|
+
var IDEMPOTENT = /* @__PURE__ */ new Set([
|
|
834
|
+
"chap.workspace.describe",
|
|
835
|
+
"chap.audit.read",
|
|
836
|
+
"chap.audit.verify_chain",
|
|
837
|
+
"chap.audit.verify_receipt",
|
|
838
|
+
"chap.participant.join",
|
|
839
|
+
// a re-join is additive and adds no duplicate member
|
|
840
|
+
"chap.participant.leave",
|
|
841
|
+
// leaving twice leaves the same absence
|
|
842
|
+
"chap.control.pause",
|
|
843
|
+
// pausing an already paused target changes nothing
|
|
844
|
+
"chap.control.set_mode_ceiling",
|
|
845
|
+
// setting the ceiling it already has changes nothing
|
|
846
|
+
"chap.deliberate.close"
|
|
847
|
+
// returns the same outcome, recomputing nothing
|
|
848
|
+
]);
|
|
849
|
+
var OPEN_WORLD = /* @__PURE__ */ new Set([
|
|
850
|
+
"chap.audit.submit_to_scitt",
|
|
851
|
+
"chap.audit.verify_receipt"
|
|
852
|
+
]);
|
|
853
|
+
var TITLES = {
|
|
854
|
+
"chap.workspace.create": "Create workspace",
|
|
855
|
+
"chap.workspace.describe": "Describe workspace",
|
|
856
|
+
"chap.workspace.set_profiles": "Replace workspace profiles",
|
|
857
|
+
"chap.participant.join": "Add participant",
|
|
858
|
+
"chap.participant.leave": "Remove participant",
|
|
859
|
+
"chap.task.create": "Create task",
|
|
860
|
+
"chap.task.update": "Change task state",
|
|
861
|
+
"chap.task.complete": "Submit task output",
|
|
862
|
+
"chap.audit.read": "Read audit log",
|
|
863
|
+
"chap.review.request": "Request review",
|
|
864
|
+
"chap.decide.approve": "Approve",
|
|
865
|
+
"chap.decide.reject": "Reject",
|
|
866
|
+
"chap.decide.override": "Override with a correction",
|
|
867
|
+
"chap.abstain.declare": "Abstain from review",
|
|
868
|
+
"chap.escalate.raise": "Escalate task",
|
|
869
|
+
"chap.whisper.ask": "Ask a whisper",
|
|
870
|
+
"chap.whisper.answer": "Answer a whisper",
|
|
871
|
+
"chap.deliberate.open": "Open deliberation",
|
|
872
|
+
"chap.deliberate.comment": "Comment on deliberation",
|
|
873
|
+
"chap.deliberate.vote": "Vote in deliberation",
|
|
874
|
+
"chap.deliberate.close": "Close deliberation",
|
|
875
|
+
"chap.handoff.propose": "Propose handoff",
|
|
876
|
+
"chap.handoff.accept": "Accept handoff",
|
|
877
|
+
"chap.handoff.decline": "Decline handoff",
|
|
878
|
+
"chap.control.pause": "Pause work",
|
|
879
|
+
"chap.control.resume": "Resume work",
|
|
880
|
+
"chap.control.cancel": "Cancel task",
|
|
881
|
+
"chap.control.snapshot": "Snapshot workspace",
|
|
882
|
+
"chap.control.rollback": "Roll back to snapshot",
|
|
883
|
+
"chap.control.supersede": "Supersede task",
|
|
884
|
+
"chap.control.set_mode_ceiling": "Set mode ceiling",
|
|
885
|
+
"chap.task.route": "Route task to an assignee",
|
|
886
|
+
"chap.review.depth": "Decide review depth",
|
|
887
|
+
"chap.escalate.auto": "Evaluate auto-escalation",
|
|
888
|
+
"chap.participant.rotate_key": "Rotate signing key",
|
|
889
|
+
"chap.participant.revoke_key": "Revoke signing key",
|
|
890
|
+
"chap.audit.submit_to_scitt": "Anchor audit log in SCITT",
|
|
891
|
+
"chap.audit.verify_receipt": "Verify SCITT receipt",
|
|
892
|
+
"chap.audit.verify_chain": "Verify audit chain"
|
|
893
|
+
};
|
|
894
|
+
var TOOL_ANNOTATIONS = Object.fromEntries(
|
|
895
|
+
Object.keys(TOOL_DESCRIPTIONS).map((name) => [name, {
|
|
896
|
+
title: TITLES[name] ?? name,
|
|
897
|
+
readOnlyHint: READ_ONLY.has(name),
|
|
898
|
+
// Meaningful only when readOnlyHint is false, per the specification.
|
|
899
|
+
destructiveHint: DESTRUCTIVE.has(name),
|
|
900
|
+
idempotentHint: IDEMPOTENT.has(name),
|
|
901
|
+
openWorldHint: OPEN_WORLD.has(name)
|
|
902
|
+
}])
|
|
903
|
+
);
|
|
800
904
|
|
|
801
905
|
// src/envelope.ts
|
|
802
906
|
var import_types = require("@modelcontextprotocol/sdk/types.js");
|
|
@@ -859,7 +963,7 @@ var ServerDiscoverRequestSchema = import_zod.z.object({
|
|
|
859
963
|
function makeChapMcpServer(coord, options = {}) {
|
|
860
964
|
const serverInfo = {
|
|
861
965
|
name: options.name ?? "chap",
|
|
862
|
-
version: options.version ?? "0.
|
|
966
|
+
version: options.version ?? "0.3.1"
|
|
863
967
|
};
|
|
864
968
|
const server = new import_server.Server(
|
|
865
969
|
serverInfo,
|
|
@@ -872,12 +976,20 @@ function makeChapMcpServer(coord, options = {}) {
|
|
|
872
976
|
let counter = 0;
|
|
873
977
|
const nextId = options.envelopeIdFactory ?? (() => `mcp-${++counter}`);
|
|
874
978
|
const filter = options.toolFilter ?? (() => true);
|
|
875
|
-
const enabledTools = TOOL_NAMES.filter((name) => filter(name) && methodForTool(name) !== null).map((name) =>
|
|
876
|
-
name
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
979
|
+
const enabledTools = TOOL_NAMES.filter((name) => filter(name) && methodForTool(name) !== null).map((name) => {
|
|
980
|
+
const ann = TOOL_ANNOTATIONS[name];
|
|
981
|
+
return {
|
|
982
|
+
name,
|
|
983
|
+
// The title was the tool name, which told a reader nothing they could
|
|
984
|
+
// not already see. The annotation carries a readable one.
|
|
985
|
+
title: ann?.title ?? name,
|
|
986
|
+
description: TOOL_DESCRIPTIONS[name] ?? `CHAP method ${methodForTool(name)}.`,
|
|
987
|
+
inputSchema: SCHEMAS[name],
|
|
988
|
+
// Behavioural hints. Without these a client has only the prose to go
|
|
989
|
+
// on when deciding whether a call is safe to make or to retry.
|
|
990
|
+
...ann ? { annotations: ann } : {}
|
|
991
|
+
};
|
|
992
|
+
});
|
|
881
993
|
server.setRequestHandler(import_types2.ListToolsRequestSchema, async (request) => {
|
|
882
994
|
const era = classifyEnvelope(request.params);
|
|
883
995
|
if (era === "legacy") return { tools: enabledTools };
|
|
@@ -897,7 +1009,7 @@ function makeChapMcpServer(coord, options = {}) {
|
|
|
897
1009
|
resultType: "complete",
|
|
898
1010
|
supportedVersions: SUPPORTED_PROTOCOL_VERSIONS,
|
|
899
1011
|
capabilities: { tools: {} },
|
|
900
|
-
instructions: "CHAP Coordinator exposed as MCP tools. Every
|
|
1012
|
+
instructions: "CHAP Coordinator exposed as MCP tools. Every accepted call that changes state is recorded on the CHAP audit log, as is a member's refused attempt at a governed action. Governed methods enforce membership and review rules server-side.",
|
|
901
1013
|
ttlMs: LIST_TTL_MS,
|
|
902
1014
|
cacheScope: "public",
|
|
903
1015
|
_meta: { [META_SERVER_INFO]: serverInfo }
|
|
@@ -981,6 +1093,7 @@ function dispatchToolCall(coord, toolName, args, envelopeId = "mcp-call") {
|
|
|
981
1093
|
SCHEMAS,
|
|
982
1094
|
SUPPORTED_PROTOCOL_VERSIONS,
|
|
983
1095
|
ServerDiscoverRequestSchema,
|
|
1096
|
+
TOOL_ANNOTATIONS,
|
|
984
1097
|
TOOL_DESCRIPTIONS,
|
|
985
1098
|
TOOL_NAMES,
|
|
986
1099
|
UNSUPPORTED_PROTOCOL_VERSION,
|