@brightbeamai/chap-coordinator-mcp 0.2.12 → 0.2.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.
- package/README.md +36 -3
- package/dist/cli.cjs +302 -14725
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +291 -14715
- package/dist/cli.js.map +1 -1
- package/dist/index.cjs +280 -14699
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +287 -14712
- package/dist/index.js.map +1 -1
- package/dist/schemas.cjs +228 -134
- package/dist/schemas.cjs.map +1 -1
- package/dist/schemas.d.cts +6 -3
- package/dist/schemas.d.ts +6 -3
- package/dist/schemas.js +228 -134
- package/dist/schemas.js.map +1 -1
- package/dist/tools.cjs +39 -39
- package/dist/tools.cjs.map +1 -1
- package/dist/tools.d.cts +5 -4
- package/dist/tools.d.ts +5 -4
- package/dist/tools.js +39 -39
- package/dist/tools.js.map +1 -1
- package/package.json +5 -3
package/dist/schemas.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/schemas.ts"],"sourcesContent":["/**\n * @brightbeamai/chap-coordinator-mcp/schemas\n *\n * JSON Schema definitions for each CHAP method, used as the\n * inputSchema for the corresponding MCP tool. Each schema describes\n * the params object that the CHAP envelope would carry; the tool\n * handler wraps the params in a JSON-RPC 2.0 envelope before dispatch.\n *\n * These schemas are tuned for MCP UX: the descriptions are what an\n * LLM client sees when deciding whether to call the tool, so they're\n * written for that audience as well as for validation.\n *\n * Aligned with CHAP 0.2 (see profiles/*.md) and MCP 2025-11-25.\n */\n\nexport interface JsonSchema {\n type?: string;\n description?: string;\n properties?: Record<string, JsonSchema>;\n required?: string[];\n enum?: string[];\n items?: JsonSchema;\n additionalProperties?: boolean | JsonSchema;\n oneOf?: JsonSchema[];\n default?: unknown;\n /** JSON Schema `pattern`, used where a string has a fixed wire shape. */\n pattern?: string;\n}\n\n// Common reusable fragments.\nconst PARTICIPANT_URI: JsonSchema = {\n type: \"string\",\n description: \"Participant URI, e.g. 'human:alice@example.org' or 'agent:bot@local'.\",\n};\n\nconst WORKSPACE_ID: JsonSchema = {\n type: \"string\",\n description: \"Workspace identifier, e.g. 'wsp_techcorp_support'.\",\n};\n\nconst TASK_ID: JsonSchema = {\n type: \"string\",\n description: \"Task identifier returned by chap.task.create.\",\n};\n\nconst ROUTING_HINTS: JsonSchema = {\n type: \"object\",\n description: \"Optional signals for the routing/1.0 profile.\",\n properties: {\n criticality: { type: \"string\", enum: [\"low\", \"medium\", \"high\", \"critical\"] },\n deadline: { type: \"string\", description: \"ISO 8601 timestamp.\" },\n risk_tier: { type: \"string\" },\n max_cost_usd: { type: \"number\" },\n },\n additionalProperties: true,\n};\n\n// ============================================================\n// Core\n// ============================================================\n\nexport const SCHEMAS: Record<string, JsonSchema> = {\n \"chap.workspace.create\": {\n type: \"object\",\n properties: {\n workspace: { ...WORKSPACE_ID, description: \"Workspace id to create. If omitted, one is generated.\" },\n profiles: {\n type: \"array\",\n items: { type: \"string\" },\n description: \"Profile identifiers to enable, e.g. ['core/1.0', 'review/1.0'].\",\n },\n mode: { type: \"string\", enum: [\"shadow\", \"trial\", \"production\"], default: \"trial\" },\n mode_ceiling: { type: \"string\", enum: [\"shadow\", \"trial\", \"production\"], default: \"production\" },\n },\n additionalProperties: false,\n },\n\n \"chap.workspace.describe\": {\n type: \"object\",\n properties: { workspace: WORKSPACE_ID },\n required: [\"workspace\"],\n },\n\n \"chap.workspace.set_profiles\": {\n type: \"object\",\n properties: {\n workspace: WORKSPACE_ID,\n profiles: { type: \"array\", items: { type: \"string\" } },\n },\n required: [\"workspace\", \"profiles\"],\n },\n\n \"chap.participant.join\": {\n type: \"object\",\n properties: {\n workspace: WORKSPACE_ID,\n from: PARTICIPANT_URI,\n type: { type: \"string\", enum: [\"human\", \"agent\", \"service\", \"group\", \"workspace\"] },\n role: { type: \"string\", description: \"Operator-defined role, e.g. 'reviewer' or 'drafter'.\" },\n display_name: { type: \"string\" },\n },\n required: [\"workspace\", \"from\", \"type\"],\n },\n\n \"chap.participant.leave\": {\n type: \"object\",\n properties: { workspace: WORKSPACE_ID, from: PARTICIPANT_URI },\n required: [\"workspace\", \"from\"],\n },\n\n \"chap.task.create\": {\n type: \"object\",\n properties: {\n workspace: WORKSPACE_ID,\n from: { ...PARTICIPANT_URI, description: \"Delegator URI.\" },\n kind: { type: \"string\", description: \"Task kind, e.g. 'draft_response' or 'review'.\" },\n assignee: { ...PARTICIPANT_URI, description: \"Who the task is assigned to. Must be a workspace member.\" },\n input: { type: \"object\", description: \"Task-specific input payload.\", additionalProperties: true },\n routing_hints: ROUTING_HINTS,\n mode: { type: \"string\", enum: [\"shadow\", \"trial\", \"production\"] },\n },\n required: [\"workspace\", \"from\", \"kind\", \"assignee\", \"input\"],\n },\n\n \"chap.task.update\": {\n type: \"object\",\n properties: {\n workspace: WORKSPACE_ID,\n from: PARTICIPANT_URI,\n task_id: TASK_ID,\n state: { type: \"string\", enum: [\"in_progress\", \"review_requested\", \"declined\", \"paused\", \"cancelled\", \"completed\"] },\n progress_note: { type: \"string\" },\n },\n required: [\"workspace\", \"from\", \"task_id\", \"state\"],\n },\n\n \"chap.task.complete\": {\n type: \"object\",\n properties: {\n workspace: WORKSPACE_ID,\n from: PARTICIPANT_URI,\n task_id: TASK_ID,\n output: { description: \"The task's output artefact. Pass as a JSON object or array, not a JSON-encoded string.\" },\n confidence: { type: \"number\", description: \"Self-reported confidence (0-1), where supported.\" },\n routing_hints: ROUTING_HINTS,\n },\n required: [\"workspace\", \"from\", \"task_id\"],\n },\n\n \"chap.audit.read\": {\n type: \"object\",\n properties: {\n workspace: WORKSPACE_ID,\n range: {\n type: \"object\",\n properties: {\n from_seq: { type: \"integer\", description: \"Start sequence number (inclusive).\" },\n to_seq: { type: \"integer\", description: \"End sequence number (exclusive).\" },\n },\n },\n filter: {\n type: \"object\",\n properties: {\n method: { type: \"string\" },\n from: { type: \"string\" },\n task_id: { type: \"string\" },\n },\n },\n },\n required: [\"workspace\"],\n },\n\n // ============================================================\n // review/1.0\n // ============================================================\n\n \"chap.review.request\": {\n type: \"object\",\n properties: {\n workspace: WORKSPACE_ID,\n from: PARTICIPANT_URI,\n task_id: TASK_ID,\n to: {\n oneOf: [PARTICIPANT_URI, { type: \"array\", items: PARTICIPANT_URI }],\n description: \"One or more reviewers. A single URI string, or a JSON array of URI strings (not a JSON-encoded string).\",\n },\n rule: {\n type: \"string\",\n enum: [\"any_one_approves\", \"all_approve\", \"quorum:2\", \"quorum:3\"],\n default: \"any_one_approves\",\n },\n artefact: { description: \"The draft being submitted for review. Pass as a JSON object or array, not a JSON-encoded string.\" },\n deadline: { type: \"string\" },\n },\n required: [\"workspace\", \"from\", \"task_id\", \"to\", \"artefact\"],\n },\n\n \"chap.decide.approve\": {\n type: \"object\",\n properties: {\n workspace: WORKSPACE_ID, from: PARTICIPANT_URI, task_id: TASK_ID,\n approved_artefact_digest: {\n type: \"string\",\n pattern: \"^sha256:[0-9a-f]{64}$\",\n description: \"Optional. SHA-256 over the JCS canonicalisation of the artefact under review, as `sha256:<hex>`. Binds the decision to the exact content reviewed; refused with -32074 on mismatch.\",\n },\n comment: { type: \"string\" },\n tags: { type: \"array\", items: { type: \"string\" } },\n },\n required: [\"workspace\", \"from\", \"task_id\"],\n },\n\n \"chap.decide.reject\": {\n type: \"object\",\n properties: {\n workspace: WORKSPACE_ID, from: PARTICIPANT_URI, task_id: TASK_ID,\n approved_artefact_digest: {\n type: \"string\",\n pattern: \"^sha256:[0-9a-f]{64}$\",\n description: \"Optional. SHA-256 over the JCS canonicalisation of the artefact under review, as `sha256:<hex>`. Binds the decision to the exact content reviewed; refused with -32074 on mismatch.\",\n },\n comment: { type: \"string\" },\n tags: { type: \"array\", items: { type: \"string\" } },\n request_revision: { type: \"boolean\", description: \"If true, task returns to in_progress instead of declined.\" },\n },\n required: [\"workspace\", \"from\", \"task_id\"],\n },\n\n \"chap.decide.override\": {\n type: \"object\",\n properties: {\n approved_artefact_digest: {\n type: \"string\",\n pattern: \"^sha256:[0-9a-f]{64}$\",\n description: \"Optional. SHA-256 over the JCS canonicalisation of the artefact under review, as `sha256:<hex>`. Binds the decision to the exact content reviewed; refused with -32074 on mismatch.\",\n },\n workspace: WORKSPACE_ID, from: PARTICIPANT_URI, task_id: TASK_ID,\n diff: {\n type: \"array\",\n description: \"RFC 6902 JSON Patch operations applied to the artefact under review.\",\n items: {\n type: \"object\",\n properties: {\n op: { type: \"string\", enum: [\"add\", \"replace\", \"remove\", \"copy\", \"move\", \"test\"] },\n path: { type: \"string\" },\n value: {},\n from: { type: \"string\" },\n },\n required: [\"op\", \"path\"],\n },\n },\n rationale: { type: \"string\", description: \"Why the override was applied. Required for the structured-override audit trail.\" },\n tags: { type: \"array\", items: { type: \"string\" } },\n policy_refs: { type: \"array\", items: { type: \"string\" } },\n logical_id: { type: \"string\" },\n intent_preserved: { type: \"boolean\" },\n },\n required: [\"workspace\", \"from\", \"task_id\", \"diff\", \"rationale\"],\n },\n\n \"chap.abstain.declare\": {\n type: \"object\",\n properties: {\n workspace: WORKSPACE_ID, from: PARTICIPANT_URI, task_id: TASK_ID,\n reason: { type: \"string\" },\n category: { type: \"string\", enum: [\"conflict_of_interest\", \"insufficient_context\", \"out_of_scope\", \"other\"] },\n },\n required: [\"workspace\", \"from\", \"task_id\", \"reason\"],\n },\n\n \"chap.escalate.raise\": {\n type: \"object\",\n properties: {\n workspace: WORKSPACE_ID, from: PARTICIPANT_URI,\n original_task_id: TASK_ID,\n new_task: {\n type: \"object\",\n properties: {\n kind: { type: \"string\" },\n assignee: PARTICIPANT_URI,\n input: { type: \"object\", additionalProperties: true },\n },\n required: [\"assignee\"],\n },\n },\n required: [\"workspace\", \"from\", \"original_task_id\", \"new_task\"],\n },\n\n // ============================================================\n // whisper/1.0\n // ============================================================\n\n \"chap.whisper.ask\": {\n type: \"object\",\n properties: {\n workspace: WORKSPACE_ID, from: PARTICIPANT_URI, task_id: TASK_ID,\n to: { type: \"array\", items: PARTICIPANT_URI, description: \"Who is being asked.\" },\n question: { type: \"string\" },\n options: {\n type: \"array\",\n items: { type: \"object\", properties: { id: { type: \"string\" }, label: { type: \"string\" }}, required: [\"id\"] },\n description: \"Optional multiple-choice options. If present, answer_option must be one of these ids.\",\n },\n deadline_ms: { type: \"integer\", description: \"Time-to-live in milliseconds from now.\" },\n default_if_lapsed: { description: \"Value applied if the whisper lapses without an answer.\" },\n urgency: { type: \"string\", enum: [\"low\", \"medium\", \"high\"], default: \"low\" },\n },\n required: [\"workspace\", \"from\", \"task_id\", \"to\", \"question\", \"deadline_ms\", \"default_if_lapsed\"],\n },\n\n \"chap.whisper.answer\": {\n type: \"object\",\n properties: {\n workspace: WORKSPACE_ID, from: PARTICIPANT_URI,\n whisper_id: { type: \"string\" },\n answer_option: { type: \"string\", description: \"Option id (required when the whisper has options).\" },\n answer: { type: \"string\", description: \"Free-text answer (when no options).\" },\n comment: { type: \"string\" },\n },\n required: [\"workspace\", \"from\", \"whisper_id\"],\n },\n\n // ============================================================\n // deliberation/1.0\n // ============================================================\n\n \"chap.deliberate.open\": {\n type: \"object\",\n properties: {\n workspace: WORKSPACE_ID, from: PARTICIPANT_URI,\n to: { type: \"array\", items: PARTICIPANT_URI, description: \"Deliberation participants.\" },\n task_id: TASK_ID,\n rule: {\n type: \"string\",\n description: \"Voting rule. Examples: any_one_approves, all_approve, quorum:N, weighted_vote:T, weighted_vote_with_veto:T.\",\n },\n question: { type: \"string\" },\n weights: { type: \"object\", additionalProperties: { type: \"number\" }, description: \"Voter -> weight map (for weighted rules).\" },\n veto: { type: \"object\", additionalProperties: { type: \"boolean\" }, description: \"Voter -> can-veto map.\" },\n deadline: { type: \"string\" },\n },\n required: [\"workspace\", \"from\", \"to\", \"rule\"],\n },\n\n \"chap.deliberate.comment\": {\n type: \"object\",\n properties: {\n workspace: WORKSPACE_ID, from: PARTICIPANT_URI,\n deliberation_id: { type: \"string\" },\n comment: { type: \"string\" },\n },\n required: [\"workspace\", \"from\", \"deliberation_id\", \"comment\"],\n },\n\n \"chap.deliberate.vote\": {\n type: \"object\",\n properties: {\n workspace: WORKSPACE_ID, from: PARTICIPANT_URI,\n deliberation_id: { type: \"string\" },\n vote: { type: \"string\", enum: [\"yea\", \"nay\", \"abstain\"] },\n weight: { type: \"number\" },\n comment: { type: \"string\" },\n veto_invoked: { type: \"boolean\" },\n },\n required: [\"workspace\", \"from\", \"deliberation_id\", \"vote\"],\n },\n\n \"chap.deliberate.close\": {\n type: \"object\",\n properties: {\n workspace: WORKSPACE_ID, from: PARTICIPANT_URI,\n deliberation_id: { type: \"string\" },\n },\n required: [\"workspace\", \"from\", \"deliberation_id\"],\n },\n\n // ============================================================\n // handoff/1.0\n // ============================================================\n\n \"chap.handoff.propose\": {\n type: \"object\",\n properties: {\n workspace: WORKSPACE_ID, from: PARTICIPANT_URI,\n to: { type: \"string\", description: \"Recipient (URI or 'group:...').\" },\n tasks: {\n type: \"array\",\n items: {\n type: \"object\",\n properties: {\n task_id: TASK_ID,\n title: { type: \"string\" },\n status_summary: { type: \"string\" },\n next_action: { type: \"string\" },\n blockers: { type: \"array\", items: { type: \"string\" }},\n },\n required: [\"task_id\"],\n },\n },\n summary: { type: \"string\" },\n context_links: { type: \"array\", items: { type: \"string\" }},\n },\n required: [\"workspace\", \"from\", \"to\", \"tasks\"],\n },\n\n \"chap.handoff.accept\": {\n type: \"object\",\n properties: {\n workspace: WORKSPACE_ID, from: PARTICIPANT_URI,\n handoff_id: { type: \"string\" },\n accepted_task_ids: { type: \"array\", items: TASK_ID, description: \"If omitted, all proposed tasks are accepted.\" },\n comment: { type: \"string\" },\n },\n required: [\"workspace\", \"from\", \"handoff_id\"],\n },\n\n \"chap.handoff.decline\": {\n type: \"object\",\n properties: {\n workspace: WORKSPACE_ID, from: PARTICIPANT_URI,\n handoff_id: { type: \"string\" },\n reason: { type: \"string\" },\n suggested_target: PARTICIPANT_URI,\n },\n required: [\"workspace\", \"from\", \"handoff_id\"],\n },\n\n // ============================================================\n // control/1.0\n // ============================================================\n\n \"chap.control.pause\": {\n type: \"object\",\n properties: {\n workspace: WORKSPACE_ID, from: PARTICIPANT_URI,\n scope: { type: \"string\", enum: [\"task\", \"participant\", \"workspace\"], default: \"task\" },\n task_id: TASK_ID,\n participant_uri: PARTICIPANT_URI,\n in_flight_policy: { type: \"string\", enum: [\"allow_to_complete\", \"interrupt\"] },\n reason: { type: \"string\" },\n },\n required: [\"workspace\", \"from\"],\n },\n\n \"chap.control.resume\": {\n type: \"object\",\n properties: {\n workspace: WORKSPACE_ID, from: PARTICIPANT_URI,\n scope: { type: \"string\", enum: [\"task\", \"participant\", \"workspace\"], default: \"task\" },\n task_id: TASK_ID,\n participant_uri: PARTICIPANT_URI,\n },\n required: [\"workspace\", \"from\"],\n },\n\n \"chap.control.cancel\": {\n type: \"object\",\n properties: {\n workspace: WORKSPACE_ID, from: PARTICIPANT_URI,\n task_id: TASK_ID,\n reason: { type: \"string\" },\n },\n required: [\"workspace\", \"from\", \"task_id\"],\n },\n\n \"chap.control.snapshot\": {\n type: \"object\",\n properties: {\n workspace: WORKSPACE_ID, from: PARTICIPANT_URI,\n label: { type: \"string\" },\n include: { type: \"array\", items: { type: \"string\" }, description: \"Aspects to snapshot, e.g. ['members', 'open_tasks', 'mode_ceiling'].\" },\n },\n required: [\"workspace\", \"from\"],\n },\n\n \"chap.control.rollback\": {\n type: \"object\",\n properties: {\n workspace: WORKSPACE_ID, from: PARTICIPANT_URI,\n to_snapshot_artefact_id: { type: \"string\" },\n what_to_restore: { type: \"array\", items: { type: \"string\" }},\n reason: { type: \"string\" },\n },\n required: [\"workspace\", \"from\", \"to_snapshot_artefact_id\"],\n },\n\n \"chap.control.supersede\": {\n type: \"object\",\n properties: {\n workspace: WORKSPACE_ID, from: PARTICIPANT_URI,\n task_id: TASK_ID,\n successor_task: {\n type: \"object\",\n properties: {\n kind: { type: \"string\" },\n assignee: PARTICIPANT_URI,\n input: { type: \"object\", additionalProperties: true },\n },\n required: [\"kind\"],\n },\n reason: { type: \"string\" },\n },\n required: [\"workspace\", \"from\", \"task_id\", \"successor_task\"],\n },\n\n \"chap.control.set_mode_ceiling\": {\n type: \"object\",\n properties: {\n workspace: WORKSPACE_ID, from: PARTICIPANT_URI,\n new_ceiling: { type: \"string\", enum: [\"shadow\", \"trial\", \"production\"] },\n reason: { type: \"string\" },\n },\n required: [\"workspace\", \"from\", \"new_ceiling\"],\n },\n\n // ============================================================\n // routing/1.0\n // ============================================================\n\n \"chap.task.route\": {\n type: \"object\",\n properties: {\n workspace: WORKSPACE_ID, from: PARTICIPANT_URI,\n task_id: TASK_ID,\n candidates: { type: \"array\", items: PARTICIPANT_URI, description: \"Candidate assignees.\" },\n },\n required: [\"workspace\", \"from\", \"task_id\", \"candidates\"],\n },\n\n \"chap.review.depth\": {\n type: \"object\",\n properties: {\n workspace: WORKSPACE_ID, from: PARTICIPANT_URI,\n task_id: TASK_ID,\n artefact_routing_hints: {\n type: \"object\",\n description: \"Per-artefact signals like confidence, model_id, cost_consumed_usd.\",\n additionalProperties: true,\n },\n },\n required: [\"workspace\", \"from\", \"task_id\"],\n },\n\n \"chap.escalate.auto\": {\n type: \"object\",\n properties: {\n workspace: WORKSPACE_ID, from: PARTICIPANT_URI,\n task_id: TASK_ID,\n default_escalation_target: PARTICIPANT_URI,\n },\n required: [\"workspace\", \"from\", \"task_id\"],\n },\n\n // ============================================================\n // security-signed/1.0\n // ============================================================\n\n \"chap.participant.rotate_key\": {\n type: \"object\",\n properties: {\n workspace: WORKSPACE_ID, from: PARTICIPANT_URI,\n old_kid: { type: \"string\" },\n new_jwk: { type: \"object\", additionalProperties: true },\n },\n required: [\"workspace\", \"from\", \"old_kid\", \"new_jwk\"],\n },\n\n \"chap.participant.revoke_key\": {\n type: \"object\",\n properties: {\n workspace: WORKSPACE_ID, from: PARTICIPANT_URI,\n target_uri: PARTICIPANT_URI,\n kid: { type: \"string\" },\n reason: { type: \"string\" },\n },\n required: [\"workspace\", \"from\", \"target_uri\", \"kid\"],\n },\n\n // ============================================================\n // audit-scitt/1.0\n // ============================================================\n\n \"chap.audit.submit_to_scitt\": {\n type: \"object\",\n properties: {\n workspace: WORKSPACE_ID, from: PARTICIPANT_URI,\n range: {\n type: \"object\",\n properties: {\n from_seq: { type: \"integer\" },\n to_seq: { type: \"integer\" },\n },\n },\n issuer: { type: \"string\" },\n },\n required: [\"workspace\"],\n },\n\n \"chap.audit.verify_receipt\": {\n type: \"object\",\n properties: {\n workspace: WORKSPACE_ID, from: PARTICIPANT_URI,\n receipt: { type: \"object\", additionalProperties: true },\n },\n required: [\"workspace\", \"receipt\"],\n },\n\n \"chap.audit.verify_chain\": {\n type: \"object\",\n properties: { workspace: WORKSPACE_ID, from: PARTICIPANT_URI },\n required: [\"workspace\"],\n },\n};\n\n/** Methods that map to MCP tools. Currently: all 39 CHAP methods. */\nexport const TOOL_NAMES = Object.keys(SCHEMAS);\n\n/** Get the JSON Schema for a tool, or null if not a known CHAP method. */\nexport function schemaFor(toolName: string): JsonSchema | null {\n return SCHEMAS[toolName] ?? null;\n}\n\n/** Map an MCP tool name back to its CHAP method name. */\nexport function methodForTool(toolName: string): string | null {\n if (!toolName.startsWith(\"chap.\")) return null;\n return toolName.slice(\"chap.\".length);\n}\n\n// ============================================================\n// Stringified-JSON coercion\n// ============================================================\n//\n// LLM MCP clients (Claude Desktop, Cursor, and others) frequently\n// serialise structured tool arguments as JSON-encoded *strings* rather\n// than as native JSON objects/arrays. For example, an `artefact` that\n// should arrive as { \"draft\": \"...\" } arrives as the string\n// \"{\\\"draft\\\": \\\"...\\\"}\", and a `to` that should be [\"human:me@local\"]\n// arrives as \"[\\\"human:me@local\\\"]\".\n//\n// The CHAP protocol core is deliberately strict: it stores artefacts\n// and applies JSON Patches against whatever it receives. A stringified\n// object therefore (a) pollutes the audit log with the wrong type and\n// (b) makes object-path patches in decide.override impossible, because\n// there is no object to traverse.\n//\n// We fix this at the adapter boundary, leaving the protocol core\n// untouched. Before an argument is wrapped in a CHAP envelope, any\n// string value whose schema admits a non-string type is JSON-parsed\n// when (and only when) it parses cleanly to a type the schema allows.\n// Plain strings that the schema accepts as strings (participant URIs,\n// task ids, rationales) are never touched, so a bare \"human:me@local\"\n// passed to a string|array `to` field is preserved as-is.\n\n/** True if the schema admits `object` as a value type. */\nfunction admitsType(schema: JsonSchema | undefined, t: \"object\" | \"array\"): boolean {\n if (!schema) return false;\n if (schema.type === t) return true;\n if (schema.oneOf) return schema.oneOf.some((s) => admitsType(s, t));\n // A field declared with neither `type` nor `oneOf` (e.g. `output`,\n // `artefact`) is an opaque payload: it admits any JSON value, so we\n // allow coercion to both object and array for it.\n if (schema.type === undefined && !schema.oneOf && !schema.enum) return true;\n return false;\n}\n\n/**\n * Coerce a single argument value against its parameter schema. Returns\n * the parsed value when the string is stringified JSON the schema\n * accepts; otherwise returns the value unchanged.\n */\nfunction coerceValue(value: unknown, schema: JsonSchema | undefined): unknown {\n if (typeof value !== \"string\") return value;\n const trimmed = value.trim();\n if (trimmed.length === 0) return value;\n const looksLikeObject = trimmed.startsWith(\"{\");\n const looksLikeArray = trimmed.startsWith(\"[\");\n if (!looksLikeObject && !looksLikeArray) return value;\n\n const wantObject = looksLikeObject && admitsType(schema, \"object\");\n const wantArray = looksLikeArray && admitsType(schema, \"array\");\n if (!wantObject && !wantArray) return value;\n\n try {\n const parsed = JSON.parse(value);\n // Only accept the parse if its type is one the schema admits. This\n // guards against, say, a string that happens to start with \"[\" but\n // is meant to be a literal string in a string-only field.\n if (Array.isArray(parsed) && admitsType(schema, \"array\")) return parsed;\n if (parsed !== null && typeof parsed === \"object\" && !Array.isArray(parsed)\n && admitsType(schema, \"object\")) return parsed;\n return value;\n } catch {\n // Not valid JSON: leave it for the coordinator to validate/reject.\n return value;\n }\n}\n\n/**\n * Normalise the arguments object for a tool call, coercing any\n * stringified-JSON values whose parameter schema admits a structured\n * type. Unknown keys (not in the schema) are passed through untouched.\n *\n * This is a pure function: it returns a new object and does not mutate\n * its input. Coordinator dispatch sees correctly-typed params, so the\n * audit log records the right shapes and decide.override patches apply\n * against real objects.\n */\nexport function coerceToolArgs(\n toolName: string,\n args: Record<string, unknown>,\n): Record<string, unknown> {\n const schema = schemaFor(toolName);\n const props = schema?.properties;\n if (!props) return args;\n const out: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(args)) {\n out[key] = coerceValue(value, props[key]);\n }\n return out;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA8BA,IAAM,kBAA8B;AAAA,EAClC,MAAM;AAAA,EACN,aAAa;AACf;AAEA,IAAM,eAA2B;AAAA,EAC/B,MAAM;AAAA,EACN,aAAa;AACf;AAEA,IAAM,UAAsB;AAAA,EAC1B,MAAM;AAAA,EACN,aAAa;AACf;AAEA,IAAM,gBAA4B;AAAA,EAChC,MAAM;AAAA,EACN,aAAa;AAAA,EACb,YAAY;AAAA,IACV,aAAa,EAAE,MAAM,UAAU,MAAM,CAAC,OAAO,UAAU,QAAQ,UAAU,EAAE;AAAA,IAC3E,UAAa,EAAE,MAAM,UAAU,aAAa,sBAAsB;AAAA,IAClE,WAAa,EAAE,MAAM,SAAS;AAAA,IAC9B,cAAc,EAAE,MAAM,SAAS;AAAA,EACjC;AAAA,EACA,sBAAsB;AACxB;AAMO,IAAM,UAAsC;AAAA,EACjD,yBAAyB;AAAA,IACvB,MAAM;AAAA,IACN,YAAY;AAAA,MACV,WAAW,EAAE,GAAG,cAAc,aAAa,wDAAwD;AAAA,MACnG,UAAU;AAAA,QACR,MAAM;AAAA,QACN,OAAO,EAAE,MAAM,SAAS;AAAA,QACxB,aAAa;AAAA,MACf;AAAA,MACA,MAAc,EAAE,MAAM,UAAU,MAAM,CAAC,UAAU,SAAS,YAAY,GAAG,SAAS,QAAQ;AAAA,MAC1F,cAAc,EAAE,MAAM,UAAU,MAAM,CAAC,UAA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S,YAAY,OAAgB,QAAyC;AAC5E,MAAI,OAAO,UAAU,SAAU,QAAO;AACtC,QAAM,UAAU,MAAM,KAAK;AAC3B,MAAI,QAAQ,WAAW,EAAG,QAAO;AACjC,QAAM,kBAAkB,QAAQ,WAAW,GAAG;AAC9C,QAAM,iBAAkB,QAAQ,WAAW,GAAG;AAC9C,MAAI,CAAC,mBAAmB,CAAC,eAAgB,QAAO;AAEhD,QAAM,aAAa,mBAAmB,WAAW,QAAQ,QAAQ;AACjE,QAAM,YAAa,kBAAmB,WAAW,QAAQ,OAAO;AAChE,MAAI,CAAC,cAAc,CAAC,UAAW,QAAO;AAEtC,MAAI;AACF,UAAM,SAAS,KAAK,MAAM,KAAK;AAI/B,QAAI,MAAM,QAAQ,MAAM,KAAK,WAAW,QAAQ,OAAO,EAAG,QAAO;AACjE,QAAI,WAAW,QAAQ,OAAO,WAAW,YAAY,CAAC,MAAM,QAAQ,MAAM,KACnE,WAAW,QAAQ,QAAQ,EAAG,QAAO;AAC5C,WAAO;AAAA,EACT,QAAQ;AAEN,WAAO;AAAA,EACT;AACF;AAYO,SAAS,eACd,UACA,MACyB;AACzB,QAAM,SAAS,UAAU,QAAQ;AACjC,QAAM,QAAQ,QAAQ;AACtB,MAAI,CAAC,MAAO,QAAO;AACnB,QAAM,MAA+B,CAAC;AACtC,aAAW,CAAC,KAAK,KAAK,KAAK,OAAO,QAAQ,IAAI,GAAG;AAC/C,QAAI,GAAG,IAAI,YAAY,OAAO,MAAM,GAAG,CAAC;AAAA,EAC1C;AACA,SAAO;AACT;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../src/schemas.ts"],"sourcesContent":["/**\n * @brightbeamai/chap-coordinator-mcp/schemas\n *\n * JSON Schema definitions for each CHAP method, used as the\n * inputSchema for the corresponding MCP tool. Each schema describes\n * the params object that the CHAP envelope would carry; the tool\n * handler wraps the params in a JSON-RPC 2.0 envelope before dispatch.\n *\n * A description here is what an MCP client reads before deciding\n * whether and how to call the tool, so each one states what the\n * coordinator does with the parameter, and names the error code where\n * a constraint is enforced. A parameter that is recorded but not acted\n * on says so; describing an intention the code does not implement is\n * worse than saying nothing.\n *\n * Aligned with CHAP 0.2 (see profiles/*.md) and MCP 2025-11-25.\n */\n\nexport interface JsonSchema {\n type?: string;\n description?: string;\n properties?: Record<string, JsonSchema>;\n required?: string[];\n enum?: string[];\n items?: JsonSchema;\n additionalProperties?: boolean | JsonSchema;\n oneOf?: JsonSchema[];\n default?: unknown;\n /** JSON Schema `pattern`, used where a string has a fixed wire shape. */\n pattern?: string;\n}\n\n// Common reusable fragments.\nconst PARTICIPANT_URI: JsonSchema = {\n type: \"string\",\n description: \"Participant URI, e.g. 'human:alice@example.org' or 'agent:bot@local'.\",\n};\n\nconst WORKSPACE_ID: JsonSchema = {\n type: \"string\",\n description: \"Workspace identifier, e.g. 'wsp_techcorp_support'.\",\n};\n\nconst TASK_ID: JsonSchema = {\n type: \"string\",\n description: \"Task identifier returned by chap.task.create.\",\n};\n\n/**\n * SPECIFICATION.md S7: a number in a CHAP envelope must be an integer.\n * Fractional values travel as decimal strings, so that canonicalisation and\n * therefore the audit hash are identical across implementations. A JSON number\n * with a fractional part is refused at ingress with -32602, so any parameter\n * that is conceptually fractional is declared here as a string.\n */\nconst decimalStringNote = (example: string) =>\n `Written as a decimal string, e.g. \"${example}\". CHAP canonicalisation accepts integers only, so a JSON number with a fractional part is refused with -32602.`;\n\nconst ROUTING_HINTS: JsonSchema = {\n type: \"object\",\n description: \"Signals recorded on the task and read by the routing/1.0 methods: task.route, review.depth and escalate.auto. Recording a hint has no effect on its own; it is consulted only when one of those methods is called.\",\n properties: {\n criticality: {\n type: \"string\",\n enum: [\"low\", \"medium\", \"high\", \"critical\"],\n description: \"How costly a wrong answer would be. The default review-depth policy reads it: 'critical' gives a full review, and 'high' with confidence below 0.7 does the same. The default assignee policy does not read it.\",\n },\n deadline: { type: \"string\", description: \"When the work is needed by, as an ISO 8601 timestamp. Recorded on the task; the coordinator does not act on it.\" },\n risk_tier: { type: \"string\", description: \"Operator-defined risk band, e.g. 'regulated' or 'internal'. No built-in policy reads it; it is available to an operator-supplied routing policy.\" },\n max_cost_usd: { type: \"string\", description: `Budget ceiling for this task in US dollars. ${decimalStringNote(\"12.50\")} No built-in policy reads it.` },\n },\n additionalProperties: true,\n};\n\n/** Free-text justification attached to a decision and kept in the audit log. */\nconst COMMENT: JsonSchema = {\n type: \"string\",\n description: \"The reviewer's note on this decision. Recorded in the audit entry for the decision.\",\n};\n\n/** Workspace-defined labels carried on a decision. */\nconst TAGS: JsonSchema = {\n type: \"array\",\n items: { type: \"string\" },\n description: \"Workspace-defined labels for this decision, e.g. ['tone', 'unsupported-claim']. Recorded in the audit entry. chap.audit.read does not filter on tags, so grouping by tag is done by the reader.\",\n};\n\n/** Binds a decision to the exact artefact the reviewer saw. */\nconst ARTEFACT_DIGEST: JsonSchema = {\n type: \"string\",\n pattern: \"^sha256:[0-9a-f]{64}$\",\n description: \"Optional. SHA-256 over the JCS canonicalisation of the artefact under review, in the form `sha256:<hex>`. When present it binds the decision to the exact content reviewed, and a mismatch is refused with -32074.\",\n};\n\n/** Applies to `output` and `artefact`, which are opaque JSON payloads. */\nconst STRUCTURED_PAYLOAD_NOTE =\n \"Pass a JSON object or array. A JSON-encoded string is parsed back to the structured value before dispatch, so patches in chap.decide.override apply against a real object.\";\n\n// ============================================================\n// Core\n// ============================================================\n\nexport const SCHEMAS: Record<string, JsonSchema> = {\n \"chap.workspace.create\": {\n type: \"object\",\n properties: {\n workspace: { ...WORKSPACE_ID, description: \"Workspace id to create. If omitted, one is generated.\" },\n profiles: {\n type: \"array\",\n items: { type: \"string\" },\n description: \"Profile identifiers to enable, e.g. ['core/1.0', 'review/1.0']. Recorded on the workspace. Two profiles change behaviour by being present: modes/1.0, under which a trial-mode task requires review, and audit-scitt/1.0, which turns on the hash-linked chain.\",\n },\n mode: {\n type: \"string\",\n enum: [\"shadow\", \"trial\", \"production\"],\n default: \"trial\",\n description: \"Default mode for tasks created here. Under modes/1.0 a trial-mode task has review_required set to true whatever the caller passes. 'shadow' and 'production' are recorded on the task and carry no further behaviour in this implementation.\",\n },\n mode_ceiling: {\n type: \"string\",\n enum: [\"shadow\", \"trial\", \"production\"],\n default: \"production\",\n description: \"Highest mode a task in this workspace may request. A task.create above the ceiling is refused with -32040. The ceiling can be changed afterwards with chap.control.set_mode_ceiling.\",\n },\n },\n additionalProperties: false,\n },\n\n \"chap.workspace.describe\": {\n type: \"object\",\n properties: { workspace: WORKSPACE_ID },\n required: [\"workspace\"],\n },\n\n \"chap.workspace.set_profiles\": {\n type: \"object\",\n properties: {\n workspace: WORKSPACE_ID,\n profiles: {\n type: \"array\",\n items: { type: \"string\" },\n description: \"The complete profile set to enable, replacing the current one. Adding audit-scitt/1.0 to a workspace that already has entries leaves those entries unchained and outside chain verification.\",\n },\n },\n required: [\"workspace\", \"profiles\"],\n },\n\n \"chap.participant.join\": {\n type: \"object\",\n properties: {\n workspace: WORKSPACE_ID,\n from: PARTICIPANT_URI,\n type: {\n type: \"string\",\n enum: [\"human\", \"agent\", \"service\", \"group\", \"workspace\"],\n description: \"The kind of participant. Only members of type 'human' are eligible for the review that chap.task.complete opens on a task marked review_required, and a completion with no eligible human is refused with -32011.\",\n },\n role: { type: \"string\", description: \"Operator-defined role, e.g. 'reviewer' or 'drafter'. One value is read by the coordinator: 'admin' permits revoking another member's key.\" },\n display_name: { type: \"string\", description: \"Human-readable name for interfaces. Not used in authorisation.\" },\n },\n required: [\"workspace\", \"from\", \"type\"],\n },\n\n \"chap.participant.leave\": {\n type: \"object\",\n properties: { workspace: WORKSPACE_ID, from: PARTICIPANT_URI },\n required: [\"workspace\", \"from\"],\n },\n\n \"chap.task.create\": {\n type: \"object\",\n properties: {\n workspace: WORKSPACE_ID,\n from: { ...PARTICIPANT_URI, description: \"The delegator. Must be a workspace member.\" },\n kind: { type: \"string\", description: \"Task kind, e.g. 'draft_response' or 'review'. Free text; the coordinator records it without interpreting it.\" },\n assignee: { ...PARTICIPANT_URI, description: \"Who the task is assigned to. Must be a workspace member, and must not be paused: assigning to a paused member is refused with -32063.\" },\n input: { type: \"object\", description: \"Task-specific input payload.\", additionalProperties: true },\n routing_hints: ROUTING_HINTS,\n mode: {\n type: \"string\",\n enum: [\"shadow\", \"trial\", \"production\"],\n description: \"Mode for this task, defaulting to the workspace mode. A mode above the workspace ceiling is refused with -32040.\",\n },\n review_required: {\n type: \"boolean\",\n description: \"When true, chap.task.complete opens a review instead of completing: the output becomes the artefact under review, and the task reaches 'completed' only on a reviewer decision. chap.task.update cannot complete such a task. Under modes/1.0 a trial-mode task has this set to true whatever is passed here.\",\n },\n deadline: { type: \"string\", description: \"When the task is due, as an ISO 8601 timestamp. Recorded on the task; the coordinator does not act on it.\" },\n idempotency_key: {\n type: \"string\",\n description: \"Caller-chosen key for safe retries. A second create carrying a key already seen in this workspace returns the original task and records nothing further. The workspace retains the 10,000 most recent keys.\",\n },\n },\n required: [\"workspace\", \"from\", \"kind\", \"assignee\", \"input\"],\n },\n\n \"chap.task.update\": {\n type: \"object\",\n properties: {\n workspace: WORKSPACE_ID,\n from: PARTICIPANT_URI,\n task_id: TASK_ID,\n state: {\n type: \"string\",\n enum: [\"in_progress\", \"review_requested\", \"declined\", \"paused\", \"cancelled\", \"completed\"],\n 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.\",\n },\n progress_note: { type: \"string\", description: \"Short note on what changed, kept in the task's history.\" },\n },\n required: [\"workspace\", \"from\", \"task_id\", \"state\"],\n },\n\n \"chap.task.complete\": {\n type: \"object\",\n properties: {\n workspace: WORKSPACE_ID,\n from: PARTICIPANT_URI,\n task_id: TASK_ID,\n output: { description: `The task's output artefact. ${STRUCTURED_PAYLOAD_NOTE}` },\n confidence: { type: \"string\", description: `Self-reported confidence in the output, between 0 and 1. ${decimalStringNote(\"0.86\")}` },\n routing_hints: ROUTING_HINTS,\n },\n required: [\"workspace\", \"from\", \"task_id\"],\n },\n\n \"chap.audit.read\": {\n type: \"object\",\n properties: {\n workspace: WORKSPACE_ID,\n range: {\n type: \"object\",\n description: \"Sequence window to return. Omit for the whole log.\",\n properties: {\n from_seq: { type: \"integer\", description: \"Start sequence number, inclusive.\" },\n to_seq: { type: \"integer\", description: \"End sequence number, exclusive.\" },\n },\n },\n filter: {\n type: \"object\",\n description: \"Narrows the entries returned. Conditions combine with AND, and are applied within the sequence window rather than before it.\",\n properties: {\n method: { type: \"string\", description: \"Return only entries for this CHAP method, e.g. 'decide.override'. Matched in full, without the 'chap.' tool-name prefix.\" },\n from: { type: \"string\", description: \"Return only entries whose actor is this participant URI.\" },\n task_id: { type: \"string\", description: \"Return only entries about this task.\" },\n },\n },\n },\n required: [\"workspace\"],\n },\n\n // ============================================================\n // review/1.0\n // ============================================================\n\n \"chap.review.request\": {\n type: \"object\",\n properties: {\n workspace: WORKSPACE_ID,\n from: PARTICIPANT_URI,\n task_id: TASK_ID,\n to: {\n oneOf: [PARTICIPANT_URI, { type: \"array\", items: PARTICIPANT_URI }],\n description: \"One or more reviewers, as a single URI string or an array of URI strings. Only a workspace member can go on to decide, so a review addressed elsewhere cannot be closed by its recipient.\",\n },\n rule: {\n type: \"string\",\n enum: [\"any_one_approves\", \"all_approve\", \"quorum:2\", \"quorum:3\"],\n default: \"any_one_approves\",\n description: \"How many of the addressed reviewers must approve before the task completes. quorum:N is accepted for any N of 1 or more. The rule is fixed once the review is open: a later request naming a different one is refused with -32014. Omitting it on a later request leaves the rule alone, which is how reviewers are added to an open review.\",\n },\n artefact: { description: `The draft being submitted for review. ${STRUCTURED_PAYLOAD_NOTE} Re-requesting with the same artefact widens the reviewer set; a different artefact on an open review is refused with -32014.` },\n deadline: { type: \"string\", description: \"When the review is needed by, as an ISO 8601 timestamp. Recorded on the review; the coordinator does not act on it.\" },\n },\n required: [\"workspace\", \"from\", \"task_id\", \"to\", \"artefact\"],\n },\n\n \"chap.decide.approve\": {\n type: \"object\",\n properties: {\n workspace: WORKSPACE_ID, from: PARTICIPANT_URI, task_id: TASK_ID,\n approved_artefact_digest: ARTEFACT_DIGEST,\n comment: COMMENT,\n tags: TAGS,\n },\n required: [\"workspace\", \"from\", \"task_id\"],\n },\n\n \"chap.decide.reject\": {\n type: \"object\",\n properties: {\n workspace: WORKSPACE_ID, from: PARTICIPANT_URI, task_id: TASK_ID,\n approved_artefact_digest: ARTEFACT_DIGEST,\n comment: COMMENT,\n tags: TAGS,\n request_revision: { type: \"boolean\", description: \"When true the task returns to 'in_progress' rather than 'declined', so the assignee can revise and resubmit.\" },\n },\n required: [\"workspace\", \"from\", \"task_id\"],\n },\n\n \"chap.decide.override\": {\n type: \"object\",\n properties: {\n approved_artefact_digest: ARTEFACT_DIGEST,\n workspace: WORKSPACE_ID, from: PARTICIPANT_URI, task_id: TASK_ID,\n diff: {\n type: \"array\",\n description: \"RFC 6902 JSON Patch operations applied to the artefact under review. The patched artefact becomes the task output; a patch that does not apply is refused with -32012.\",\n items: {\n type: \"object\",\n properties: {\n op: { type: \"string\", enum: [\"add\", \"replace\", \"remove\", \"copy\", \"move\", \"test\"], description: \"The patch operation to apply.\" },\n path: { type: \"string\", description: \"JSON Pointer into the artefact, e.g. '/body' or '/items/0/severity'.\" },\n value: { description: \"The new value, for add, replace and test.\" },\n from: { type: \"string\", description: \"Source JSON Pointer, for copy and move.\" },\n },\n required: [\"op\", \"path\"],\n },\n },\n rationale: { type: \"string\", description: \"Why the correction was made. Required on every override and recorded in the audit entry, since the diff shows what changed but not why.\" },\n tags: TAGS,\n policy_refs: {\n type: \"array\",\n items: { type: \"string\" },\n description: \"Identifiers of the policies or guidelines this correction applies, e.g. ['policy:no-delivery-promises']. Recorded in the audit entry.\",\n },\n logical_id: {\n type: \"string\",\n description: \"Caller-chosen identifier for the item being decided, stable across revisions and overrides of the same underlying content. Recorded in the audit entry.\",\n },\n intent_preserved: {\n type: \"boolean\",\n description: \"True when the edit refines the decision the draft was making, false when it substitutes a different one. Recorded in the audit entry.\",\n },\n },\n required: [\"workspace\", \"from\", \"task_id\", \"diff\", \"rationale\"],\n },\n\n \"chap.abstain.declare\": {\n type: \"object\",\n properties: {\n workspace: WORKSPACE_ID, from: PARTICIPANT_URI, task_id: TASK_ID,\n reason: { type: \"string\", description: \"Why this reviewer is standing aside. Recorded in the audit entry.\" },\n category: {\n type: \"string\",\n enum: [\"conflict_of_interest\", \"insufficient_context\", \"out_of_scope\", \"other\"],\n description: \"The kind of abstention. Recorded in the audit entry.\",\n },\n },\n required: [\"workspace\", \"from\", \"task_id\", \"reason\"],\n },\n\n \"chap.escalate.raise\": {\n type: \"object\",\n properties: {\n workspace: WORKSPACE_ID, from: PARTICIPANT_URI,\n original_task_id: { ...TASK_ID, description: \"The task being escalated. It moves to 'escalated' and is linked to the successor. A completed, cancelled or superseded task cannot be escalated.\" },\n new_task: {\n type: \"object\",\n description: \"The successor task to open for the escalation target.\",\n properties: {\n kind: { type: \"string\", description: \"Task kind for the successor. Defaults to the original's kind.\" },\n assignee: { ...PARTICIPANT_URI, description: \"Who the escalation goes to. Must be a workspace member.\" },\n 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.\" },\n },\n required: [\"assignee\"],\n },\n },\n required: [\"workspace\", \"from\", \"original_task_id\", \"new_task\"],\n },\n\n // ============================================================\n // whisper/1.0\n // ============================================================\n\n \"chap.whisper.ask\": {\n type: \"object\",\n properties: {\n workspace: WORKSPACE_ID, from: PARTICIPANT_URI, task_id: TASK_ID,\n to: { type: \"array\", items: PARTICIPANT_URI, description: \"Who is being asked.\" },\n question: { type: \"string\", description: \"The question being put. A whisper is answered on its own, without the recipient opening the task.\" },\n options: {\n type: \"array\",\n items: {\n type: \"object\",\n properties: {\n id: { type: \"string\", description: \"Stable identifier that an answer refers to.\" },\n label: { type: \"string\", description: \"What the option says to the person answering.\" },\n },\n required: [\"id\"],\n },\n description: \"Multiple-choice options. When present, an answer must name one of these ids in answer_option; any other id is refused with -32022.\",\n },\n deadline_ms: { type: \"integer\", description: \"How long the whisper stays open, in milliseconds from now. Once it passes, the whisper lapses and default_if_lapsed is applied.\" },\n default_if_lapsed: { description: \"The value applied if the deadline passes with no answer. Required, so that a lapsed whisper still has a defined outcome.\" },\n urgency: {\n type: \"string\",\n enum: [\"low\", \"medium\", \"high\"],\n default: \"low\",\n description: \"How urgent the question is. Recorded and passed on to the client; it does not change the deadline or the lapse behaviour.\",\n },\n },\n required: [\"workspace\", \"from\", \"task_id\", \"to\", \"question\", \"deadline_ms\", \"default_if_lapsed\"],\n },\n\n \"chap.whisper.answer\": {\n type: \"object\",\n properties: {\n workspace: WORKSPACE_ID, from: PARTICIPANT_URI,\n whisper_id: { type: \"string\", description: \"Identifier returned by chap.whisper.ask. A whisper that has already been answered is refused with -32020, and one past its deadline with -32021.\" },\n answer_option: { type: \"string\", description: \"The id of the chosen option. Required when the whisper carried options.\" },\n answer: { type: \"string\", description: \"Free-text answer, for a whisper with no options.\" },\n comment: { type: \"string\", description: \"Anything else the answerer wants recorded alongside the answer.\" },\n },\n required: [\"workspace\", \"from\", \"whisper_id\"],\n },\n\n // ============================================================\n // deliberation/1.0\n // ============================================================\n\n \"chap.deliberate.open\": {\n type: \"object\",\n properties: {\n workspace: WORKSPACE_ID, from: PARTICIPANT_URI,\n to: { type: \"array\", items: PARTICIPANT_URI, description: \"The participants entitled to vote. A vote from anyone else is refused with -32030.\" },\n task_id: TASK_ID,\n rule: {\n type: \"string\",\n description: \"How the outcome is decided when the deliberation closes: any_one_approves, all_approve, quorum:N, weighted_vote:T or weighted_vote_with_veto:T. An unrecognised rule is refused at open with -32033.\",\n },\n question: { type: \"string\", description: \"What the group is deciding. State it so that a yea or a nay is unambiguous.\" },\n weights: { type: \"object\", additionalProperties: { type: \"integer\" }, description: \"Voter to weight map, read by the weighted rules. A voter with no entry counts as 1. Weights must be integers: a JSON number with a fractional part is refused with -32602.\" },\n veto: { type: \"object\", additionalProperties: { type: \"boolean\" }, description: \"Voter to can-veto map. A veto is honoured only under weighted_vote_with_veto, and only from a voter listed true here.\" },\n deadline: { type: \"string\", description: \"When voting is intended to close, as an ISO 8601 timestamp. Recorded on the deliberation; closing is done by chap.deliberate.close and the coordinator does not close on the deadline.\" },\n },\n required: [\"workspace\", \"from\", \"to\", \"rule\"],\n },\n\n \"chap.deliberate.comment\": {\n type: \"object\",\n properties: {\n workspace: WORKSPACE_ID, from: PARTICIPANT_URI,\n deliberation_id: { type: \"string\", description: \"Identifier returned by chap.deliberate.open. A closed deliberation is refused with -32032.\" },\n comment: { type: \"string\", description: \"The contribution to record. Comments are kept with the deliberation and in the audit log, so the reasoning survives the vote.\" },\n },\n required: [\"workspace\", \"from\", \"deliberation_id\", \"comment\"],\n },\n\n \"chap.deliberate.vote\": {\n type: \"object\",\n properties: {\n workspace: WORKSPACE_ID, from: PARTICIPANT_URI,\n deliberation_id: { type: \"string\", description: \"Identifier returned by chap.deliberate.open. A closed deliberation is refused with -32032, and a second vote from the same voter with -32031.\" },\n vote: { type: \"string\", enum: [\"yea\", \"nay\", \"abstain\"], description: \"This voter's position. An abstention is recorded but counts as neither a yea nor a nay, so under all_approve or quorum:N it withholds the approval those rules need.\" },\n weight: { type: \"integer\", description: \"Recorded with the vote. The tally uses the weights map given at chap.deliberate.open, not this value.\" },\n comment: { type: \"string\", description: \"Why the vote went this way. Recorded with it.\" },\n veto_invoked: { type: \"boolean\", description: \"Blocks the outcome regardless of the tally. Honoured only under weighted_vote_with_veto, and only when the voter is listed true in the veto map given at open.\" },\n },\n required: [\"workspace\", \"from\", \"deliberation_id\", \"vote\"],\n },\n\n \"chap.deliberate.close\": {\n type: \"object\",\n properties: {\n workspace: WORKSPACE_ID, from: PARTICIPANT_URI,\n deliberation_id: { type: \"string\", description: \"Identifier returned by chap.deliberate.open. Closing computes the outcome from the votes cast; closing an already closed deliberation returns the outcome unchanged.\" },\n },\n required: [\"workspace\", \"from\", \"deliberation_id\"],\n },\n\n // ============================================================\n // handoff/1.0\n // ============================================================\n\n \"chap.handoff.propose\": {\n type: \"object\",\n properties: {\n workspace: WORKSPACE_ID, from: PARTICIPANT_URI,\n to: { type: \"string\", description: \"Recipient, as a participant URI or a group URI such as 'group:support-team'. A recipient who is not a workspace member is refused with -32052.\" },\n tasks: {\n type: \"array\",\n description: \"The work being handed over, one entry per task. Every task must currently be assigned to the proposer; otherwise the proposal is refused with -32050.\",\n items: {\n type: \"object\",\n properties: {\n task_id: TASK_ID,\n title: { type: \"string\", description: \"Short label for the task.\" },\n status_summary: { type: \"string\", description: \"Where the work has reached, and what has already been tried.\" },\n next_action: { type: \"string\", description: \"What the recipient should do first.\" },\n blockers: { type: \"array\", items: { type: \"string\" }, description: \"What is preventing progress, if anything.\" },\n },\n required: [\"task_id\"],\n },\n },\n summary: { type: \"string\", description: \"Covering note for the handover as a whole, above the per-task detail.\" },\n context_links: { type: \"array\", items: { type: \"string\" }, description: \"URLs to threads, tickets or documents the recipient will need.\" },\n },\n required: [\"workspace\", \"from\", \"to\", \"tasks\"],\n },\n\n \"chap.handoff.accept\": {\n type: \"object\",\n properties: {\n workspace: WORKSPACE_ID, from: PARTICIPANT_URI,\n handoff_id: { type: \"string\", description: \"Identifier returned by chap.handoff.propose. A handoff already accepted or declined is refused with -32051.\" },\n accepted_task_ids: { type: \"array\", items: TASK_ID, description: \"Which of the proposed tasks are being accepted. If omitted, all of them are.\" },\n comment: { type: \"string\", description: \"Anything the recipient wants recorded when taking the work on.\" },\n },\n required: [\"workspace\", \"from\", \"handoff_id\"],\n },\n\n \"chap.handoff.decline\": {\n type: \"object\",\n properties: {\n workspace: WORKSPACE_ID, from: PARTICIPANT_URI,\n handoff_id: { type: \"string\", description: \"Identifier returned by chap.handoff.propose. A handoff already accepted or declined is refused with -32051.\" },\n reason: { type: \"string\", description: \"Why the handover is refused. Recorded so the proposer can route it elsewhere.\" },\n suggested_target: { ...PARTICIPANT_URI, description: \"Who should take it instead, if the decliner knows.\" },\n },\n required: [\"workspace\", \"from\", \"handoff_id\"],\n },\n\n // ============================================================\n // control/1.0\n // ============================================================\n\n \"chap.control.pause\": {\n type: \"object\",\n properties: {\n workspace: WORKSPACE_ID, from: PARTICIPANT_URI,\n scope: {\n type: \"string\",\n enum: [\"task\", \"participant\", \"workspace\"],\n default: \"task\",\n description: \"What the pause applies to. 'task' moves one task to 'paused'; a task that is completed, declined, cancelled or superseded is refused with -32061. 'participant' stops new tasks being assigned to that member and leaves their existing work running. 'workspace' refuses every method except workspace.create, workspace.describe, control.resume, audit.read, participant.join and participant.leave.\",\n },\n task_id: TASK_ID,\n participant_uri: { ...PARTICIPANT_URI, description: \"Whose work to pause, when scope is 'participant'. Must be a workspace member.\" },\n in_flight_policy: {\n type: \"string\",\n enum: [\"allow_to_complete\", \"interrupt\"],\n description: \"Recorded with the request, and echoed back when scope is 'participant'. The coordinator does not act on it: under either value, work already under way is left alone.\",\n },\n reason: { type: \"string\", description: \"Why the pause was applied. Recorded in the audit entry.\" },\n },\n required: [\"workspace\", \"from\"],\n },\n\n \"chap.control.resume\": {\n type: \"object\",\n properties: {\n workspace: WORKSPACE_ID, from: PARTICIPANT_URI,\n scope: {\n type: \"string\",\n enum: [\"task\", \"participant\", \"workspace\"],\n default: \"task\",\n description: \"What the resume applies to. 'task' returns a paused task to 'in_progress'; 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.\",\n },\n task_id: TASK_ID,\n participant_uri: { ...PARTICIPANT_URI, description: \"Whose work to resume, when scope is 'participant'. Must be a workspace member.\" },\n },\n required: [\"workspace\", \"from\"],\n },\n\n \"chap.control.cancel\": {\n type: \"object\",\n properties: {\n workspace: WORKSPACE_ID, from: PARTICIPANT_URI,\n task_id: { ...TASK_ID, description: \"The task to cancel. A task that is completed, declined, cancelled or superseded is refused with -32061.\" },\n reason: { type: \"string\", description: \"Why the task was cancelled. Recorded in the audit entry.\" },\n },\n required: [\"workspace\", \"from\", \"task_id\"],\n },\n\n \"chap.control.snapshot\": {\n type: \"object\",\n properties: {\n workspace: WORKSPACE_ID, from: PARTICIPANT_URI,\n label: { type: \"string\", description: \"Name for this snapshot, recorded on the artefact. chap.control.rollback identifies a snapshot by its artefact id, not by label.\" },\n include: { type: \"array\", items: { type: \"string\" }, description: \"Which aspects of the workspace to capture. Recognised values are 'members', 'open_tasks', 'mode_ceiling', 'policy' and 'audit'. Defaults to members, open_tasks and mode_ceiling.\" },\n },\n required: [\"workspace\", \"from\"],\n },\n\n \"chap.control.rollback\": {\n type: \"object\",\n properties: {\n workspace: WORKSPACE_ID, from: PARTICIPANT_URI,\n to_snapshot_artefact_id: { type: \"string\", description: \"Artefact id returned by chap.control.snapshot. An id with no matching snapshot is refused with -32062.\" },\n what_to_restore: { type: \"array\", items: { type: \"string\" }, description: \"Which captured aspects to apply. Only 'mode_ceiling' and 'members' are restored; the others are held in the snapshot and not reapplied. Restoring members resets role and scopes on members still present, and does not re-add members who have left. Defaults to the snapshot's include list.\" },\n reason: { type: \"string\", description: \"Why the rollback was performed. The rollback is itself an audit entry; earlier entries are not rewritten.\" },\n },\n required: [\"workspace\", \"from\", \"to_snapshot_artefact_id\"],\n },\n\n \"chap.control.supersede\": {\n type: \"object\",\n properties: {\n workspace: WORKSPACE_ID, from: PARTICIPANT_URI,\n task_id: { ...TASK_ID, description: \"The task being replaced. It moves to 'superseded' and is linked to the successor rather than deleted.\" },\n successor_task: {\n type: \"object\",\n description: \"The replacement task.\",\n properties: {\n kind: { type: \"string\", description: \"Task kind for the successor. Required.\" },\n assignee: { ...PARTICIPANT_URI, description: \"Who takes the replacement on. Defaults to the superseded task's assignee, and must be a workspace member.\" },\n input: { type: \"object\", additionalProperties: true, description: \"Input payload for the successor. Defaults to an empty object.\" },\n },\n required: [\"kind\"],\n },\n reason: { type: \"string\", description: \"Why the original is being replaced. Recorded in the audit entry.\" },\n },\n required: [\"workspace\", \"from\", \"task_id\", \"successor_task\"],\n },\n\n \"chap.control.set_mode_ceiling\": {\n type: \"object\",\n properties: {\n workspace: WORKSPACE_ID, from: PARTICIPANT_URI,\n new_ceiling: {\n type: \"string\",\n enum: [\"shadow\", \"trial\", \"production\"],\n description: \"The highest mode tasks in this workspace may request from now on. Existing tasks keep the mode they were created with. Where the coordinator is configured to enforce step-up authentication this method is one of the privileged ones and a call without step-up is refused with -32402.\",\n },\n reason: { type: \"string\", description: \"Why the ceiling is being changed. Recorded in the audit entry.\" },\n },\n required: [\"workspace\", \"from\", \"new_ceiling\"],\n },\n\n // ============================================================\n // routing/1.0\n // ============================================================\n\n \"chap.task.route\": {\n type: \"object\",\n properties: {\n workspace: WORKSPACE_ID, from: PARTICIPANT_URI,\n task_id: TASK_ID,\n candidates: { type: \"array\", items: PARTICIPANT_URI, description: \"Candidate assignees. An empty list is refused with -32513. Candidates that are not workspace members are dropped, and if none remain the call is refused with -32510. The default policy selects the first remaining candidate; an operator-supplied routing policy may select on any basis.\" },\n },\n required: [\"workspace\", \"from\", \"task_id\", \"candidates\"],\n },\n\n \"chap.review.depth\": {\n type: \"object\",\n properties: {\n workspace: WORKSPACE_ID, from: PARTICIPANT_URI,\n task_id: TASK_ID,\n artefact_routing_hints: {\n type: \"object\",\n description: \"Per-artefact signals such as confidence, model_id and cost_consumed_usd, merged over the task's routing_hints for this call. The default policy reads criticality and confidence. If the merged set is empty the call is refused with -32514. Fractional values are written as decimal strings, e.g. \\\"confidence\\\": \\\"0.86\\\".\",\n additionalProperties: true,\n },\n },\n required: [\"workspace\", \"from\", \"task_id\"],\n },\n\n \"chap.escalate.auto\": {\n type: \"object\",\n properties: {\n workspace: WORKSPACE_ID, from: PARTICIPANT_URI,\n task_id: TASK_ID,\n default_escalation_target: { ...PARTICIPANT_URI, description: \"Who to escalate to when the policy decides to escalate and names no target of its own. It must be a workspace member or a group URI; if the policy escalates with no usable target the call is refused with -32516.\" },\n },\n required: [\"workspace\", \"from\", \"task_id\"],\n },\n\n // ============================================================\n // security-signed/1.0\n // ============================================================\n\n \"chap.participant.rotate_key\": {\n type: \"object\",\n properties: {\n workspace: WORKSPACE_ID, from: PARTICIPANT_URI,\n old_kid: { type: \"string\", description: \"Key id being retired. It is given a valid_until timestamp and stays in the member's key history, so signatures made before the rotation still verify. A key id that is unknown is refused with -32071, and one already revoked with -32072.\" },\n new_jwk: { type: \"object\", additionalProperties: true, description: \"The replacement public key as a JWK. It must carry a 'kid'. Whether the request itself has to be signed with the old key is decided at dispatch, and only where the coordinator is configured to require signatures.\" },\n },\n required: [\"workspace\", \"from\", \"old_kid\", \"new_jwk\"],\n },\n\n \"chap.participant.revoke_key\": {\n type: \"object\",\n properties: {\n workspace: WORKSPACE_ID, from: PARTICIPANT_URI,\n target_uri: { ...PARTICIPANT_URI, description: \"Whose key is being revoked. Revoking another member's key requires the caller to hold the role 'admin'; otherwise the call is refused with -32011.\" },\n kid: { type: \"string\", description: \"Key id to revoke. It is marked revoked with a timestamp and a reason, and signatures presented with it are refused from then on. A key id that is unknown is refused with -32071.\" },\n reason: { type: \"string\", description: \"Why the key was revoked, e.g. 'laptop lost'. Recorded on the key and in the audit entry.\" },\n },\n required: [\"workspace\", \"from\", \"target_uri\", \"kid\"],\n },\n\n // ============================================================\n // audit-scitt/1.0\n // ============================================================\n\n \"chap.audit.submit_to_scitt\": {\n type: \"object\",\n properties: {\n workspace: WORKSPACE_ID, from: PARTICIPANT_URI,\n range: {\n type: \"object\",\n description: \"Sequence window to anchor. Omit to submit the whole chain.\",\n properties: {\n from_seq: { type: \"integer\", description: \"Start sequence number, inclusive.\" },\n to_seq: { type: \"integer\", description: \"End sequence number, exclusive.\" },\n },\n },\n issuer: { type: \"string\", description: \"Issuer identifier placed on each SCITT signed statement, naming who vouches for the chain. Defaults to 'service:coordinator'. Where no submitter is configured the statements are returned unsigned for the deployment to submit out of band.\" },\n },\n required: [\"workspace\"],\n },\n\n \"chap.audit.verify_receipt\": {\n type: \"object\",\n properties: {\n workspace: WORKSPACE_ID, from: PARTICIPANT_URI,\n receipt: { type: \"object\", additionalProperties: true, description: \"The SCITT receipt to check, as returned by the transparency service. Verification is delegated to a hook supplied by the deployment, and fails closed with -32082 where no hook is configured.\" },\n },\n required: [\"workspace\", \"receipt\"],\n },\n\n \"chap.audit.verify_chain\": {\n type: \"object\",\n properties: { workspace: WORKSPACE_ID, from: PARTICIPANT_URI },\n required: [\"workspace\"],\n },\n};\n\n/** Methods that map to MCP tools. Currently: all 39 CHAP methods. */\nexport const TOOL_NAMES = Object.keys(SCHEMAS);\n\n/** Get the JSON Schema for a tool, or null if not a known CHAP method. */\nexport function schemaFor(toolName: string): JsonSchema | null {\n return SCHEMAS[toolName] ?? null;\n}\n\n/** Map an MCP tool name back to its CHAP method name. */\nexport function methodForTool(toolName: string): string | null {\n if (!toolName.startsWith(\"chap.\")) return null;\n return toolName.slice(\"chap.\".length);\n}\n\n// ============================================================\n// Stringified-JSON coercion\n// ============================================================\n//\n// LLM MCP clients (Claude Desktop, Cursor, and others) frequently\n// serialise structured tool arguments as JSON-encoded *strings* rather\n// than as native JSON objects/arrays. For example, an `artefact` that\n// should arrive as { \"draft\": \"...\" } arrives as the string\n// \"{\\\"draft\\\": \\\"...\\\"}\", and a `to` that should be [\"human:me@local\"]\n// arrives as \"[\\\"human:me@local\\\"]\".\n//\n// The CHAP protocol core is deliberately strict: it stores artefacts\n// and applies JSON Patches against whatever it receives. A stringified\n// object therefore (a) pollutes the audit log with the wrong type and\n// (b) makes object-path patches in decide.override impossible, because\n// there is no object to traverse.\n//\n// We fix this at the adapter boundary, leaving the protocol core\n// untouched. Before an argument is wrapped in a CHAP envelope, any\n// string value whose schema admits a non-string type is JSON-parsed\n// when (and only when) it parses cleanly to a type the schema allows.\n// Plain strings that the schema accepts as strings (participant URIs,\n// task ids, rationales) are never touched, so a bare \"human:me@local\"\n// passed to a string|array `to` field is preserved as-is.\n\n/** True if the schema admits `object` as a value type. */\nfunction admitsType(schema: JsonSchema | undefined, t: \"object\" | \"array\"): boolean {\n if (!schema) return false;\n if (schema.type === t) return true;\n if (schema.oneOf) return schema.oneOf.some((s) => admitsType(s, t));\n // A field declared with neither `type` nor `oneOf` (e.g. `output`,\n // `artefact`) is an opaque payload: it admits any JSON value, so we\n // allow coercion to both object and array for it.\n if (schema.type === undefined && !schema.oneOf && !schema.enum) return true;\n return false;\n}\n\n/**\n * Coerce a single argument value against its parameter schema. Returns\n * the parsed value when the string is stringified JSON the schema\n * accepts; otherwise returns the value unchanged.\n */\nfunction coerceValue(value: unknown, schema: JsonSchema | undefined): unknown {\n if (typeof value !== \"string\") return value;\n const trimmed = value.trim();\n if (trimmed.length === 0) return value;\n const looksLikeObject = trimmed.startsWith(\"{\");\n const looksLikeArray = trimmed.startsWith(\"[\");\n if (!looksLikeObject && !looksLikeArray) return value;\n\n const wantObject = looksLikeObject && admitsType(schema, \"object\");\n const wantArray = looksLikeArray && admitsType(schema, \"array\");\n if (!wantObject && !wantArray) return value;\n\n try {\n const parsed = JSON.parse(value);\n // Only accept the parse if its type is one the schema admits. This\n // guards against, say, a string that happens to start with \"[\" but\n // is meant to be a literal string in a string-only field.\n if (Array.isArray(parsed) && admitsType(schema, \"array\")) return parsed;\n if (parsed !== null && typeof parsed === \"object\" && !Array.isArray(parsed)\n && admitsType(schema, \"object\")) return parsed;\n return value;\n } catch {\n // Not valid JSON: leave it for the coordinator to validate/reject.\n return value;\n }\n}\n\n/**\n * Normalise the arguments object for a tool call, coercing any\n * stringified-JSON values whose parameter schema admits a structured\n * type. Unknown keys (not in the schema) are passed through untouched.\n *\n * This is a pure function: it returns a new object and does not mutate\n * its input. Coordinator dispatch sees correctly-typed params, so the\n * audit log records the right shapes and decide.override patches apply\n * against real objects.\n */\nexport function coerceToolArgs(\n toolName: string,\n args: Record<string, unknown>,\n): Record<string, unknown> {\n const schema = schemaFor(toolName);\n const props = schema?.properties;\n if (!props) return args;\n const out: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(args)) {\n out[key] = coerceValue(value, props[key]);\n }\n return out;\n}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,QAAM,SAAS,UAAU,QAAQ;AACjC,QAAM,QAAQ,QAAQ;AACtB,MAAI,CAAC,MAAO,QAAO;AACnB,QAAM,MAA+B,CAAC;AACtC,aAAW,CAAC,KAAK,KAAK,KAAK,OAAO,QAAQ,IAAI,GAAG;AAC/C,QAAI,GAAG,IAAI,YAAY,OAAO,MAAM,GAAG,CAAC;AAAA,EAC1C;AACA,SAAO;AACT;","names":[]}
|
package/dist/schemas.d.cts
CHANGED
|
@@ -6,9 +6,12 @@
|
|
|
6
6
|
* the params object that the CHAP envelope would carry; the tool
|
|
7
7
|
* handler wraps the params in a JSON-RPC 2.0 envelope before dispatch.
|
|
8
8
|
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
9
|
+
* A description here is what an MCP client reads before deciding
|
|
10
|
+
* whether and how to call the tool, so each one states what the
|
|
11
|
+
* coordinator does with the parameter, and names the error code where
|
|
12
|
+
* a constraint is enforced. A parameter that is recorded but not acted
|
|
13
|
+
* on says so; describing an intention the code does not implement is
|
|
14
|
+
* worse than saying nothing.
|
|
12
15
|
*
|
|
13
16
|
* Aligned with CHAP 0.2 (see profiles/*.md) and MCP 2025-11-25.
|
|
14
17
|
*/
|
package/dist/schemas.d.ts
CHANGED
|
@@ -6,9 +6,12 @@
|
|
|
6
6
|
* the params object that the CHAP envelope would carry; the tool
|
|
7
7
|
* handler wraps the params in a JSON-RPC 2.0 envelope before dispatch.
|
|
8
8
|
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
9
|
+
* A description here is what an MCP client reads before deciding
|
|
10
|
+
* whether and how to call the tool, so each one states what the
|
|
11
|
+
* coordinator does with the parameter, and names the error code where
|
|
12
|
+
* a constraint is enforced. A parameter that is recorded but not acted
|
|
13
|
+
* on says so; describing an intention the code does not implement is
|
|
14
|
+
* worse than saying nothing.
|
|
12
15
|
*
|
|
13
16
|
* Aligned with CHAP 0.2 (see profiles/*.md) and MCP 2025-11-25.
|
|
14
17
|
*/
|