@tryvira/mcp 0.1.107 → 0.1.109
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 +16 -5
- package/dist/cli.js +57 -34
- package/dist/index.js +1 -1
- package/package.json +4 -3
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# @tryvira/mcp 0.1.
|
|
1
|
+
# @tryvira/mcp 0.1.109
|
|
2
2
|
|
|
3
3
|
An MCP server for connecting MCP-compatible applications to Vira's governed AI
|
|
4
4
|
behavior and runtime APIs. The package is MIT licensed.
|
|
@@ -138,7 +138,7 @@ identifiers, not the API key:
|
|
|
138
138
|
"servers": {
|
|
139
139
|
"vira": {
|
|
140
140
|
"type": "local",
|
|
141
|
-
"command": ["npx", "-y", "@tryvira/mcp@0.1.
|
|
141
|
+
"command": ["npx", "-y", "@tryvira/mcp@0.1.109"],
|
|
142
142
|
"environment": {
|
|
143
143
|
"VIRA_API_URL": "https://api.tryvira.xyz",
|
|
144
144
|
"VIRA_API_KEY": "{file:~/.config/vira/api-key}",
|
|
@@ -155,9 +155,20 @@ identifiers, not the API key:
|
|
|
155
155
|
Do not pass `VIRA_API_URL={env:VIRA_API_URL}` to `opencode mcp add` unless that
|
|
156
156
|
variable is present in the background service environment. An unresolved
|
|
157
157
|
OpenCode `{env:...}` reference becomes an empty string, which makes this
|
|
158
|
-
launcher fail closed with `VIRA_API_URL_REQUIRED`. After saving the config,
|
|
159
|
-
|
|
160
|
-
|
|
158
|
+
launcher fail closed with `VIRA_API_URL_REQUIRED`. After saving the config,
|
|
159
|
+
verify the active configuration and normal service registry:
|
|
160
|
+
|
|
161
|
+
```bash
|
|
162
|
+
opencode debug config
|
|
163
|
+
opencode mcp list
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
The global `--standalone` mode is an isolated diagnostic process and may not
|
|
167
|
+
reuse the background service's global MCP registry; do not use
|
|
168
|
+
`opencode --standalone mcp list` as proof that a `--global` server was added.
|
|
169
|
+
If the normal list is stale, restart the OpenCode service and run the two
|
|
170
|
+
commands again. The `debug config` output must contain `mcp.servers.vira` before
|
|
171
|
+
investigating the MCP package itself.
|
|
161
172
|
|
|
162
173
|
See the [MCP guide](https://github.com/hrpering/tryvira/blob/main/docs/reference/mcp.md)
|
|
163
174
|
and [tool catalog](https://github.com/hrpering/tryvira/blob/main/docs/reference/mcp-tools.md)
|
package/dist/cli.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
// src/cli.ts
|
|
3
|
+
// packages/mcp/src/cli.ts
|
|
4
4
|
import { McpServer } from "@modelcontextprotocol/server";
|
|
5
5
|
import { serveStdio } from "@modelcontextprotocol/server/stdio";
|
|
6
6
|
import { ViraClient, viraHttpRequest } from "@tryvira/sdk";
|
|
7
7
|
import { z } from "zod";
|
|
8
8
|
|
|
9
|
-
// src/local-observability.ts
|
|
9
|
+
// packages/mcp/src/local-observability.ts
|
|
10
10
|
async function observeMcpStdioCall(observer, run) {
|
|
11
11
|
if (!observer) return run();
|
|
12
12
|
const started = performance.now();
|
|
@@ -41,7 +41,7 @@ function createMcpStderrObserver(enabled) {
|
|
|
41
41
|
};
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
// src/tool-registry.ts
|
|
44
|
+
// packages/mcp/src/tool-registry.ts
|
|
45
45
|
var read = (permissionClass = "integration.read") => ({ permissionClass, requiredRoles: [permissionClass], effectType: "read", scopePolicy: "environment", approvalRequirement: "none" });
|
|
46
46
|
var effectful = (permissionClass, approvalRequirement = "server", aliases = []) => ({ permissionClass, requiredRoles: [permissionClass, ...aliases], effectType: "effectful", scopePolicy: "environment", approvalRequirement });
|
|
47
47
|
var registry = /* @__PURE__ */ Object.create(null);
|
|
@@ -50,6 +50,9 @@ var add = (names, authority) => names.forEach((name) => {
|
|
|
50
50
|
});
|
|
51
51
|
var generatedReadTools = ["list_task_runs", "list_strategy_executions", "search_runtime_traces", "get_ai_system", "list_system_connections", "list_inventory", "get_connection", "get_connection_health", "list_teach_analyses", "get_teach_analysis", "get_evaluation", "list_conversation_archive", "list_teach_runs", "get_teach_run_recommendation", "get_task_run_evidence", "get_improvement_proposal", "list_compound_task_plans", "get_compound_task_plan", "get_behavior_program"];
|
|
52
52
|
add(generatedReadTools, read());
|
|
53
|
+
add(["inspect_department_optimization_dataset"], effectful("integration.write", "server"));
|
|
54
|
+
add(["get_discovery_dispatch", "get_discovery_worker_health", "get_feature_credit_preview", "list_reusable_evaluation_datasets", "get_reusable_evaluation_dataset"], read());
|
|
55
|
+
add(["queue_discovery_dispatch"], effectful("discovery.write", "server", ["studio.write"]));
|
|
53
56
|
add(["get_scope", "list_capabilities", "get_job", "list_inbox", "read_notification_updates", "get_conflict_inspection", "get_optimization_run", "list_semantic_tasks", "list_behavior_points", "list_behavior_programs", "list_behavior_strategies", "get_behavior_strategy", "get_behavior_program", "get_task_run", "list_task_run_events", "get_strategy_execution", "get_strategy_execution_trace", "get_ai_usage_reconciliation", "list_ai_systems", "get_ai_system", "list_system_connections", "get_connection", "get_connection_health", "list_inventory", "list_connection_inventory", "list_discovery_candidates", "get_signal_mapping", "get_pack_revision", "get_pack_revision_diff", "list_packs", "get_pack", "diagnose_pack", "list_evaluations", "get_teach_analysis", "get_teach_run_recommendation", "get_evaluation", "get_evaluation_comparison", "get_evaluation_plan", "get_improvement_proposal", "search_runtime_traces"], read());
|
|
54
57
|
add(["list_organization_units", "list_organization_unit_members", "list_project_organization_units", "list_organization_billing_admins", "list_ai_system_unit_grants", "get_ai_credit_wallet", "list_ai_credit_budgets", "list_ai_usage_receipts", "get_ai_usage_summary", "list_notification_destinations"], read());
|
|
55
58
|
registry.preview_organization_unit_archive = { permissionClass: "integration.read", requiredRoles: ["workspace.owner"], effectType: "read", scopePolicy: "environment", approvalRequirement: "none" };
|
|
@@ -81,6 +84,7 @@ add(["review_comparative_finding", "edit_improvement_proposal", "transition_beha
|
|
|
81
84
|
add(["create_release"], effectful("release.approve", "human"));
|
|
82
85
|
add(["retire_program_pointer"], effectful("release.approve", "human"));
|
|
83
86
|
add(["create_signal_discovery_proposal", "review_signal_discovery_proposal", "materialize_signal_discovery", "create_signal_mapping", "review_signal_mapping", "review_discovery_candidate"], effectful("discovery.write"));
|
|
87
|
+
add(["create_department_discovery_draft"], effectful("discovery.write", "server", ["studio.write"]));
|
|
84
88
|
add(["revoke_signal_mapping"], effectful("discovery.write", "human", ["studio.write"]));
|
|
85
89
|
add(["bind_pack_signal_mappings"], effectful("discovery.write", "human", ["studio.write"]));
|
|
86
90
|
add(["create_observation"], effectful("observation.write"));
|
|
@@ -97,7 +101,7 @@ var MCP_TOOL_REGISTRY = Object.freeze(registry);
|
|
|
97
101
|
var getMcpToolAuthority = (tool) => Object.hasOwn(MCP_TOOL_REGISTRY, tool) ? MCP_TOOL_REGISTRY[tool] : void 0;
|
|
98
102
|
var isKnownMcpTool = (tool) => Boolean(getMcpToolAuthority(tool));
|
|
99
103
|
|
|
100
|
-
// src/public-tool-catalog.ts
|
|
104
|
+
// packages/mcp/src/public-tool-catalog.ts
|
|
101
105
|
var coreTools = Object.freeze([
|
|
102
106
|
{ name: "get_scope", description: "Read the immutable scope configured for this MCP session.", inputSchema: { type: "object", properties: { organizationId: { type: "string" }, projectId: { type: "string" }, environmentId: { type: "string" } }, required: ["organizationId", "projectId", "environmentId"] } },
|
|
103
107
|
{ name: "list_capabilities", description: "Show coarse role-based product capability groups and the canonical Control API operation inventory. Role eligibility is a hint; it is not per-operation availability or authorization.", inputSchema: { type: "object", properties: { organizationId: { type: "string" }, projectId: { type: "string" }, environmentId: { type: "string" }, surface: { type: "string" } }, required: ["organizationId", "projectId", "environmentId"] } },
|
|
@@ -107,7 +111,7 @@ var coreTools = Object.freeze([
|
|
|
107
111
|
{ name: "revoke_ai_system_unit_access", description: "Revoke an AI System unit access grant. Workspace owner permission is required.", effectful: true, inputSchema: { type: "object", properties: { organizationId: { type: "string" }, projectId: { type: "string" }, environmentId: { type: "string" }, aiSystemId: { type: "string" }, unitId: { type: "string" } }, required: ["organizationId", "projectId", "environmentId", "aiSystemId", "unitId"] } },
|
|
108
112
|
{ name: "list_organization_billing_admins", description: "List organization Billing Admin memberships. Workspace owner permission is required.", inputSchema: { type: "object", properties: { organizationId: { type: "string" }, projectId: { type: "string" }, environmentId: { type: "string" } }, required: ["organizationId", "projectId", "environmentId"] } },
|
|
109
113
|
{ name: "set_organization_billing_admin", description: "Grant or revoke an organization Billing Admin membership. Workspace owner permission is required.", effectful: true, inputSchema: { type: "object", properties: { organizationId: { type: "string" }, projectId: { type: "string" }, environmentId: { type: "string" }, actorId: { type: "string" }, status: { type: "string", enum: ["ACTIVE", "REVOKED"] } }, required: ["organizationId", "projectId", "environmentId", "actorId", "status"] } },
|
|
110
|
-
{ name: "get_ai_credit_wallet", description: "Read
|
|
114
|
+
{ name: "get_ai_credit_wallet", description: "Read organization wallet and verified funding lots, including expiry-aware spendable credits. Set includeCommercial for approved agreement and receivable summaries. Organization owner or Billing Admin authority required.", inputSchema: { type: "object", properties: { organizationId: { type: "string" }, projectId: { type: "string" }, environmentId: { type: "string" }, includeCommercial: { type: "boolean" } }, required: ["organizationId", "projectId", "environmentId"] } },
|
|
111
115
|
{ name: "get_ai_usage_summary", description: "Read monthly provider cost and customer credits by provider/model, optionally filtered to an organization unit. Owners and Billing Admins may read organization data; a Department Admin sees only their active unit.", inputSchema: { type: "object", properties: { organizationId: { type: "string" }, projectId: { type: "string" }, environmentId: { type: "string" }, organizationUnitId: { type: "string", minLength: 1 } }, required: ["organizationId", "projectId", "environmentId"] } },
|
|
112
116
|
{ name: "list_ai_usage_receipts", description: "Read rated provider usage receipts, optionally filtered to an organization unit. Owners and Billing Admins may read organization data; a Department Admin sees only their active unit.", inputSchema: { type: "object", properties: { organizationId: { type: "string" }, projectId: { type: "string" }, environmentId: { type: "string" }, organizationUnitId: { type: "string", minLength: 1 }, limit: { type: "integer", minimum: 1, maximum: 500 } }, required: ["organizationId", "projectId", "environmentId"] } },
|
|
113
117
|
{ name: "list_ai_credit_budgets", description: "Read organization AI credit budget caps and consumed or reserved usage. Organization billing admin permission is required.", inputSchema: { type: "object", properties: { organizationId: { type: "string" }, projectId: { type: "string" }, environmentId: { type: "string" } }, required: ["organizationId", "projectId", "environmentId"] } },
|
|
@@ -142,7 +146,11 @@ var coreTools = Object.freeze([
|
|
|
142
146
|
{ name: "activate_behavior_strategy", description: "Activate a validated scoped Behavior Strategy revision.", effectful: true, inputSchema: { type: "object", properties: { organizationId: { type: "string" }, projectId: { type: "string" }, environmentId: { type: "string" }, strategyId: { type: "string" } }, required: ["organizationId", "projectId", "environmentId", "strategyId"] } },
|
|
143
147
|
{ name: "submit_teach_evidence", description: "Submit scoped evidence to the Teach lifecycle.", effectful: true, inputSchema: { type: "object", properties: { organizationId: { type: "string" }, projectId: { type: "string" }, environmentId: { type: "string" }, id: { type: "string" }, source: { type: "string" }, content: { type: "string" }, consent: { type: "boolean" } }, required: ["organizationId", "projectId", "environmentId", "id", "content", "consent"] } },
|
|
144
148
|
{ name: "get_teach_behavior_set", description: "Read a provider-backed Teach run behavior set and its completeness; review is required before evaluation or release.", effectful: false, inputSchema: { type: "object", properties: { teachRunId: { type: "string" } }, required: ["teachRunId"] } },
|
|
145
|
-
{ name: "accept_teach_recommendation", description: "Accept a complete Teach behavior graph for
|
|
149
|
+
{ name: "accept_teach_recommendation", description: "Accept a complete Teach behavior graph for review. Supply the exact base Pack ID and digest if no source Pack is pinned. Never publishes directly.", effectful: true, inputSchema: { type: "object", properties: { teachRunId: { type: "string" }, actorId: { type: "string" }, basePackId: { type: "string", minLength: 1 }, basePackDigest: { type: "string", pattern: "^[a-f0-9]{64}$" } }, required: ["teachRunId"] } },
|
|
150
|
+
{ name: "get_teach_run_recommendation", description: "Read the exact persisted Teach recommendation and review state.", effectful: false, inputSchema: { type: "object", properties: { teachRunId: { type: "string" } }, required: ["teachRunId"] } },
|
|
151
|
+
{ name: "reject_teach_recommendation", description: "Reject a persisted Teach recommendation with an explicit reviewer reason.", effectful: true, inputSchema: { type: "object", properties: { teachRunId: { type: "string" }, reason: { type: "string", minLength: 1 } }, required: ["teachRunId", "reason"] } },
|
|
152
|
+
{ name: "edit_teach_recommendation", description: "Save changed behavior content as an immutable Teach revision; never publish.", effectful: true, inputSchema: { type: "object", properties: { teachRunId: { type: "string" }, revisionId: { type: "string", minLength: 1 }, reason: { type: "string", minLength: 1 }, behaviorSet: { type: "object", additionalProperties: true } }, required: ["teachRunId", "revisionId", "reason", "behaviorSet"] } },
|
|
153
|
+
{ name: "create_department_discovery_draft", description: "Create an isolated non-executable department draft from approved semantic task evidence. Never grants runtime authority.", effectful: true, inputSchema: { type: "object", properties: { organizationId: { type: "string" }, projectId: { type: "string" }, environmentId: { type: "string" }, key: { type: "string", minLength: 1 }, candidateId: { type: "string", minLength: 1 }, aiSystemId: { type: "string", minLength: 1 }, evidenceIds: { type: "array", items: { type: "string", minLength: 1 }, minItems: 1, maxItems: 200 } }, required: ["organizationId", "projectId", "environmentId", "key", "candidateId", "aiSystemId", "evidenceIds"] } },
|
|
146
154
|
{ name: "create_teach_proposal", description: "Create a reviewed Teach proposal from admitted evidence.", effectful: true, inputSchema: { type: "object", properties: { organizationId: { type: "string" }, projectId: { type: "string" }, environmentId: { type: "string" }, evidenceId: { type: "string" }, controlPointId: { type: "string" }, summary: { type: "string" } }, required: ["organizationId", "projectId", "environmentId", "evidenceId", "controlPointId", "summary"] } },
|
|
147
155
|
{ name: "transition_teach_proposal", description: "Review, evaluate, or promote a Teach proposal.", effectful: true, inputSchema: { type: "object", properties: { organizationId: { type: "string" }, projectId: { type: "string" }, environmentId: { type: "string" }, proposalId: { type: "string" }, transition: { type: "string" }, decision: { type: "string" }, score: { type: "number" }, evaluationId: { type: "string" } }, required: ["organizationId", "projectId", "environmentId", "proposalId", "transition"] } },
|
|
148
156
|
{ name: "create_release", description: "Create a scoped release using either provider-backed evaluation or explicit manual approval with step-up evidence. Optionally set aiSystemId (or manifest.aiSystemId) to bind the release to an AI System; it must match the linked evaluation and the caller needs release.approve on that System.", effectful: true, inputSchema: { type: "object", properties: { organizationId: { type: "string" }, projectId: { type: "string" }, environmentId: { type: "string" }, releaseId: { type: "string" }, artifactId: { type: "string" }, evaluationId: { type: "string" }, aiSystemId: { type: "string" }, manifest: { type: "object", properties: { aiSystemId: { type: "string" } }, additionalProperties: true }, manualApproval: { type: "object", properties: { reason: { type: "string" } }, required: ["reason"] }, stepUp: { type: "object", properties: { id: { type: "string" }, assertion: { type: "string" }, purpose: { type: "string" } }, required: ["id", "assertion", "purpose"] } }, required: ["organizationId", "projectId", "environmentId", "artifactId"] } },
|
|
@@ -191,14 +199,14 @@ var coreTools = Object.freeze([
|
|
|
191
199
|
{ name: "record_user_feedback", description: "Record scoped user feedback for an observed AI interaction. Supply a stable eventId so retries are idempotent.", effectful: true, inputSchema: { type: "object", properties: { organizationId: { type: "string" }, projectId: { type: "string" }, environmentId: { type: "string" }, event: { type: "object" } }, required: ["organizationId", "projectId", "environmentId", "event"] } },
|
|
192
200
|
{ name: "record_business_outcome", description: "Record a scoped business outcome for an observed AI interaction. Supply a stable eventId so retries are idempotent.", effectful: true, inputSchema: { type: "object", properties: { organizationId: { type: "string" }, projectId: { type: "string" }, environmentId: { type: "string" }, event: { type: "object" } }, required: ["organizationId", "projectId", "environmentId", "event"] } },
|
|
193
201
|
{ name: "observe", description: "Submit an observation using a stable eventId. conversation.output events derive the canonical eventId from conversationId and requestId so OpenCode and MCP retries share one identity.", effectful: true, inputSchema: { type: "object", properties: { event: { type: "object", required: ["type"] }, idempotencyKey: { type: "string" } }, required: ["event"] } },
|
|
194
|
-
{ name: "start_evaluation", description: "Start a scoped evaluation. Use assertions for a manual evaluation, or planId + evaluationPolicy + comparisonPlan for a provider-backed execution bound to a sealed evaluation plan. Optionally set aiSystemId (or targetArtifact.aiSystemId) to persist AI System attribution; the caller needs evaluation.write on that System.", effectful: true, inputSchema: { type: "object", properties: { organizationId: { type: "string" }, projectId: { type: "string" }, environmentId: { type: "string" }, id: { type: "string" }, aiSystemId: { type: "string" }, planId: { type: "string" }, evaluationPolicy: { type: "object" }, comparisonPlan: { type: "object", properties: { arms: { type: "array", items: { type: "string" } } }, required: ["arms"] }, targetArtifact: { oneOf: [{ type: "string" }, { type: "object", properties: { aiSystemId: { type: "string" } }, additionalProperties: true }] }, dataset: { type: "array", items: { type: "object", additionalProperties: true } }, assertions: { type: "array", items: { type: "boolean" } }, threshold: { type: "number" } }, required: ["organizationId", "projectId", "environmentId", "id", "dataset"] } },
|
|
195
|
-
{ name: "create_evaluation_plan", description: "Create an immutable OFF/current-on evaluation plan for a scoped behavior target.", effectful: true, inputSchema: { type: "object", properties: { organizationId: { type: "string" }, projectId: { type: "string" }, environmentId: { type: "string" }, id: { type: "string" }, suiteId: { type: "string" }, suiteVersion: { type: "string" }, suiteDigest: { type: "string" }, datasetSnapshotDigest: { type: "string" }, evaluationPolicyDigest: { type: "string" }, arms: { type: "array" } }, required: ["organizationId", "projectId", "environmentId", "id", "suiteId", "suiteVersion", "suiteDigest", "datasetSnapshotDigest", "evaluationPolicyDigest", "arms"] } },
|
|
202
|
+
{ name: "start_evaluation", description: "Start a scoped evaluation. Use wholePackEvaluation:true with packId, packDigest, aiSystemId and input-only dataset cases containing id, programId, input and rubric for complete normal-Pack quality coverage. For native Program evaluations, modelSelection may select an approved generation/judge pair without changing defaults; canonical policy evidence is still required. Use assertions for a manual evaluation, or planId + evaluationPolicy + comparisonPlan for a provider-backed execution bound to a sealed evaluation plan. Optionally set aiSystemId (or targetArtifact.aiSystemId) to persist AI System attribution; the caller needs evaluation.write on that System.", effectful: true, inputSchema: { type: "object", properties: { organizationId: { type: "string" }, projectId: { type: "string" }, environmentId: { type: "string" }, id: { type: "string" }, aiSystemId: { type: "string" }, wholePackEvaluation: { type: "boolean" }, packId: { type: "string" }, packDigest: { type: "string" }, modelSelection: { type: "object", required: ["generation", "judge"], additionalProperties: false, properties: { generation: { type: "object", required: ["providerId", "modelId"], additionalProperties: false, properties: { providerId: { type: "string" }, modelId: { type: "string" } } }, judge: { type: "object", required: ["providerId", "modelId"], additionalProperties: false, properties: { providerId: { type: "string" }, modelId: { type: "string" } } } } }, planId: { type: "string" }, evaluationPolicy: { type: "object" }, comparisonPlan: { type: "object", properties: { arms: { type: "array", items: { type: "string" } } }, required: ["arms"] }, targetArtifact: { oneOf: [{ type: "string" }, { type: "object", properties: { aiSystemId: { type: "string" } }, additionalProperties: true }] }, dataset: { type: "array", items: { type: "object", additionalProperties: true } }, assertions: { type: "array", items: { type: "boolean" } }, threshold: { type: "number" } }, required: ["organizationId", "projectId", "environmentId", "id", "dataset"] } },
|
|
203
|
+
{ name: "create_evaluation_plan", description: "Create an immutable OFF/current-on evaluation plan for a scoped behavior target. Optional modelSelection pins two approved models for this evaluation only.", effectful: true, inputSchema: { type: "object", properties: { organizationId: { type: "string" }, projectId: { type: "string" }, environmentId: { type: "string" }, aiSystemId: { type: "string" }, benchmarkKind: { type: "string", enum: ["BASELINE", "CANDIDATE", "CANONICAL_OFF_ON"] }, modelSelection: { type: "object", required: ["generation", "judge"], additionalProperties: false, properties: { generation: { type: "object", required: ["providerId", "modelId"], additionalProperties: false, properties: { providerId: { type: "string" }, modelId: { type: "string" } } }, judge: { type: "object", required: ["providerId", "modelId"], additionalProperties: false, properties: { providerId: { type: "string" }, modelId: { type: "string" } } } } }, id: { type: "string" }, suiteId: { type: "string" }, suiteVersion: { type: "string" }, suiteDigest: { type: "string" }, datasetSnapshotDigest: { type: "string" }, evaluationPolicyDigest: { type: "string" }, arms: { type: "array" } }, required: ["organizationId", "projectId", "environmentId", "id", "suiteId", "suiteVersion", "suiteDigest", "datasetSnapshotDigest", "evaluationPolicyDigest", "arms"] } },
|
|
196
204
|
{ name: "seal_evaluation_plan", description: "Seal an evaluation plan so its suite, dataset, and execution arms cannot drift.", effectful: true, inputSchema: { type: "object", properties: { organizationId: { type: "string" }, projectId: { type: "string" }, environmentId: { type: "string" }, planId: { type: "string" } }, required: ["organizationId", "projectId", "environmentId", "planId"] } },
|
|
197
205
|
{ name: "create_improvement_proposal", description: "Create a Teach improvement proposal from a completed comparative evaluation.", effectful: true, inputSchema: { type: "object", properties: { organizationId: { type: "string" }, projectId: { type: "string" }, environmentId: { type: "string" }, evaluationId: { type: "string" }, id: { type: "string" }, basePackId: { type: "string" }, basePackDigest: { type: "string" }, behaviorSet: { type: "object" } }, required: ["organizationId", "projectId", "environmentId", "evaluationId", "id", "basePackId", "basePackDigest"] } },
|
|
198
206
|
{ name: "review_improvement_proposal", description: "Review a Teach improvement proposal without mutating canonical runtime state.", effectful: true, inputSchema: { type: "object", properties: { organizationId: { type: "string" }, projectId: { type: "string" }, environmentId: { type: "string" }, proposalId: { type: "string" }, action: { type: "string" } }, required: ["organizationId", "projectId", "environmentId", "proposalId", "action"] } },
|
|
199
207
|
{ name: "create_behavior_revision_candidate", description: "Create an immutable behavior revision candidate from a reviewed Teach improvement proposal.", effectful: true, inputSchema: { type: "object", properties: { organizationId: { type: "string" }, projectId: { type: "string" }, environmentId: { type: "string" }, id: { type: "string" }, sourceTeachProposalId: { type: "string" }, parentRevisionId: { type: "string" }, parentRevisionDigest: { type: "string" }, changeSet: { type: "object" } }, required: ["organizationId", "projectId", "environmentId", "id", "sourceTeachProposalId", "parentRevisionId", "parentRevisionDigest", "changeSet"] } },
|
|
200
|
-
{ name: "evaluate_behavior_revision_candidate", description: "Evaluate exactly one immutable Behavior Revision Candidate with provider-backed dataset assertions. It does not evaluate or release the parent Pack.", effectful: true, inputSchema: { type: "object", properties: { organizationId: { type: "string" }, projectId: { type: "string" }, environmentId: { type: "string" }, candidateId: { type: "string" }, dataset: { type: "array", items: { type: "object", additionalProperties: true } },
|
|
201
|
-
{ name: "accept_behavior_revision_candidate", description: "
|
|
208
|
+
{ name: "evaluate_behavior_revision_candidate", description: "Evaluate exactly one immutable Behavior Revision Candidate with provider-backed dataset assertions. It does not evaluate or release the parent Pack.", effectful: true, inputSchema: { type: "object", properties: { organizationId: { type: "string" }, projectId: { type: "string" }, environmentId: { type: "string" }, candidateId: { type: "string" }, evaluationId: { type: "string" }, dataset: { type: "array", items: { type: "object", additionalProperties: true } }, modelSelection: { type: "object", required: ["generation", "judge"], additionalProperties: false, properties: { generation: { type: "object", required: ["providerId", "modelId"], additionalProperties: false, properties: { providerId: { type: "string" }, modelId: { type: "string" } } }, judge: { type: "object", required: ["providerId", "modelId"], additionalProperties: false, properties: { providerId: { type: "string" }, modelId: { type: "string" } } } } } }, required: ["organizationId", "projectId", "environmentId", "candidateId", "dataset"] } },
|
|
209
|
+
{ name: "accept_behavior_revision_candidate", description: "Record explicit human acceptance of an immutable candidate. For manual approval supply manualApproval=true, confirm=true, reason, and expectedCandidateDigest. Otherwise supply candidateEvaluationId for a passed evaluation. Manual approval neither evaluates nor publishes.", effectful: true, inputSchema: { type: "object", properties: { organizationId: { type: "string" }, projectId: { type: "string" }, environmentId: { type: "string" }, candidateId: { type: "string" }, candidateEvaluationId: { type: "string" }, manualApproval: { type: "boolean" }, confirm: { type: "boolean" }, reason: { type: "string", minLength: 1, maxLength: 1e3 }, expectedCandidateDigest: { type: "string", pattern: "^[a-f0-9]{64}$" } }, required: ["organizationId", "projectId", "environmentId", "candidateId"] } },
|
|
202
210
|
{ name: "create_pack_revision", description: "Create a draft Pack Revision from an accepted behavior candidate.", effectful: true, inputSchema: { type: "object", properties: { organizationId: { type: "string" }, projectId: { type: "string" }, environmentId: { type: "string" }, id: { type: "string" }, packKey: { type: "string" }, version: { type: "string" }, behaviorRevisionCandidateId: { type: "string" } }, required: ["organizationId", "projectId", "environmentId", "id", "packKey", "version", "behaviorRevisionCandidateId"] } },
|
|
203
211
|
{ name: "transition_pack_revision", description: "Validate, request approval, approve, or release a governed Pack Revision.", effectful: true, inputSchema: { type: "object", properties: { organizationId: { type: "string" }, projectId: { type: "string" }, environmentId: { type: "string" }, revisionId: { type: "string" }, transition: { type: "string" } }, required: ["organizationId", "projectId", "environmentId", "revisionId", "transition"] } },
|
|
204
212
|
{ name: "materialize_pack_revision", description: "Materialize an approved Pack Revision into canonical runtime state.", effectful: true, inputSchema: { type: "object", properties: { organizationId: { type: "string" }, projectId: { type: "string" }, environmentId: { type: "string" }, revisionId: { type: "string" }, packId: { type: "string" }, variables: { type: "object" } }, required: ["organizationId", "projectId", "environmentId", "revisionId", "packId"] } },
|
|
@@ -213,8 +221,8 @@ var coreTools = Object.freeze([
|
|
|
213
221
|
{ name: "import_pack", description: "Import and validate a scoped behavior pack.", effectful: true, inputSchema: { type: "object", properties: { organizationId: { type: "string" }, projectId: { type: "string" }, environmentId: { type: "string" }, manifest: { type: "object" }, objects: { type: "object" }, archiveBase64: { type: "string" }, fileName: { type: "string" } }, required: ["organizationId", "projectId", "environmentId", "manifest"] } },
|
|
214
222
|
{ name: "install_pack", description: "Install a scoped behavior pack.", effectful: true, inputSchema: { type: "object", properties: { organizationId: { type: "string" }, projectId: { type: "string" }, environmentId: { type: "string" }, packId: { type: "string" }, variables: { type: "object" } }, required: ["organizationId", "projectId", "environmentId", "packId"] } },
|
|
215
223
|
{ name: "evaluate_pack", description: "Evaluate one imported/installed Pack in its Pack lifecycle with server-owned execution. Use before Pack approval/release; it is not the candidate evaluator.", effectful: true, inputSchema: { type: "object", properties: { organizationId: { type: "string" }, projectId: { type: "string" }, environmentId: { type: "string" }, packId: { type: "string" }, evaluation: { type: "object" } }, required: ["organizationId", "projectId", "environmentId", "packId", "evaluation"] } },
|
|
216
|
-
{ name: "approve_pack", description: "Approve a scoped behavior pack.", effectful: true, inputSchema: { type: "object", properties: { organizationId: { type: "string" }, projectId: { type: "string" }, environmentId: { type: "string" }, packId: { type: "string" } }, required: ["organizationId", "projectId", "environmentId", "packId"] } },
|
|
217
|
-
{ name: "release_pack", description: "
|
|
224
|
+
{ name: "approve_pack", description: "Approve a scoped behavior pack manually or after evaluation.", effectful: true, inputSchema: { type: "object", properties: { organizationId: { type: "string" }, projectId: { type: "string" }, environmentId: { type: "string" }, packId: { type: "string" }, expectedPackDigest: { type: "string", pattern: "^[a-f0-9]{64}$", description: "Digest of the reviewed Pack returned by get_pack." }, manualApproval: { type: "boolean", description: "True only for explicit human-approved publication without quality evaluation." }, reason: { type: "string", minLength: 1, maxLength: 1e3, description: "Human approval reason, required for manual approval." } }, required: ["organizationId", "projectId", "environmentId", "packId"] } },
|
|
225
|
+
{ name: "release_pack", description: "Publish an approved scoped behavior pack.", effectful: true, inputSchema: { type: "object", properties: { organizationId: { type: "string" }, projectId: { type: "string" }, environmentId: { type: "string" }, packId: { type: "string" }, expectedPackDigest: { type: "string", pattern: "^[a-f0-9]{64}$", description: "Digest of the approved Pack returned by approve_pack." } }, required: ["organizationId", "projectId", "environmentId", "packId"] } },
|
|
218
226
|
{ name: "preview_pack_upgrade", description: "Preview a scoped behavior pack upgrade.", effectful: true, inputSchema: { type: "object", properties: { organizationId: { type: "string" }, projectId: { type: "string" }, environmentId: { type: "string" }, packId: { type: "string" }, incoming: { type: "object" } }, required: ["organizationId", "projectId", "environmentId", "packId", "incoming"] } },
|
|
219
227
|
{ name: "get_evaluation", description: "Read evaluation status, case results, receipts, and provenance.", inputSchema: { type: "object", properties: { organizationId: { type: "string" }, projectId: { type: "string" }, environmentId: { type: "string" }, evaluationId: { type: "string" } }, required: ["organizationId", "projectId", "environmentId", "evaluationId"] } },
|
|
220
228
|
{ name: "get_evaluation_comparison", description: "Read the arms, findings, and comparison for one evaluation.", inputSchema: { type: "object", properties: { organizationId: { type: "string" }, projectId: { type: "string" }, environmentId: { type: "string" }, evaluationId: { type: "string" } }, required: ["organizationId", "projectId", "environmentId", "evaluationId"] } }
|
|
@@ -280,6 +288,10 @@ var MCP_PUBLIC_CORE_TOOL_NAMES = Object.freeze([
|
|
|
280
288
|
"get_teach_behavior_set",
|
|
281
289
|
"create_teach_proposal",
|
|
282
290
|
"accept_teach_recommendation",
|
|
291
|
+
"get_teach_run_recommendation",
|
|
292
|
+
"reject_teach_recommendation",
|
|
293
|
+
"edit_teach_recommendation",
|
|
294
|
+
"create_department_discovery_draft",
|
|
283
295
|
"start_evaluation",
|
|
284
296
|
"create_improvement_proposal",
|
|
285
297
|
"create_behavior_revision_candidate",
|
|
@@ -372,14 +384,14 @@ var lifecycleGuidance = {
|
|
|
372
384
|
list_semantic_tasks: "Use before authoring or routing to inspect the registered intent catalog. Prefer list_behavior_points when you need behavior authorities.",
|
|
373
385
|
list_behavior_points: "Use to inspect canonical BehaviorPoints and their task links. Prefer get_behavior_strategy for strategy details and resolve_runtime only after choosing one point.",
|
|
374
386
|
list_capabilities: "Use before a write or runtime call to check what this credential can access on a public surface; it never grants capability.",
|
|
375
|
-
import_pack: "Use to validate and create a Pack draft. It does not install or release; continue with install_pack,
|
|
387
|
+
import_pack: "Use to validate and create a Pack draft. It does not install or release; continue with install_pack, approve_pack, then release_pack; optionally evaluate_pack before approval.",
|
|
376
388
|
get_pack: "Use to inspect one Pack manifest, digest, status, conflicts, and materialization metadata. It is read-only.",
|
|
377
389
|
list_packs: "Use to find scoped Pack drafts and releases; use get_pack for one Pack\u2019s full detail.",
|
|
378
390
|
list_evaluations: "Use to inspect evaluation records and statuses; use start_evaluation to run one and get_evaluation for full provenance.",
|
|
379
391
|
get_evaluation: "Use to read one evaluation\u2019s status, provenance, score, and receipts; it never starts or approves an evaluation.",
|
|
380
392
|
retire_program_pointer: "RETIRE ACTIVE POINTER: first inspect the current pointer and version, then retire only the exact pointer version reviewed by the human. This removes the active pointer but preserves retirement history; it cannot be undone through this operation. Requires release.approve and explicit confirm=true.",
|
|
381
393
|
mark_inbox_read: "Use after list_inbox returns a notificationId that the current actor has reviewed. On success the notification is marked read; repeated calls for the same notification are safe and do not create a new notification.",
|
|
382
|
-
serve_behavior_projection: "RUNTIME PROJECTION: use after get_scope/list_capabilities, Pack install,
|
|
394
|
+
serve_behavior_projection: "RUNTIME PROJECTION: use after get_scope/list_capabilities, Pack install, approval, release, and a verified promotion pointer confirm that the requested Behavior Program is active. The response contains the projected behavior and an execution receipt. Do not use this tool for authoring, classification, candidate evaluation, model calls, or host actions; it does not call the model or execute tools. Use compile_behavior_capsule for pre-model context, resolve_runtime/executeRuntime for enforcement, and evaluate_behavior_revision_candidate for unreleased candidate testing."
|
|
383
395
|
};
|
|
384
396
|
var enrichTool = (tool) => {
|
|
385
397
|
const required2 = requiredInputs(tool);
|
|
@@ -396,7 +408,7 @@ var descriptionOverrides = {
|
|
|
396
408
|
list_ai_systems: "AI SYSTEM READ: list AI Systems connected in the authenticated scope. Use before creating a connection or to find a system to inspect; use get_connection_health and list_connection_inventory for connection diagnostics.",
|
|
397
409
|
list_behavior_points: "AUTHORITY READ: inspect canonical BehaviorPoints and task links. Pagination and search are optional. Use resolve_runtime only after selecting one point.",
|
|
398
410
|
list_capabilities: "ACCESS READ: use before a write, runtime, or lifecycle call to inspect this credential\u2019s allowed capabilities. Omit surface to receive the full scoped report; provide surface to filter it. The result lists permitted operations/roles and public surfaces, never grants authority, and get_scope is the alternative when you only need tenant identity.",
|
|
399
|
-
import_pack: "PACK AUTHORING: validate and create a Pack draft from a manifest or archive. Only manifest plus authenticated scope are required; objects/archiveBase64/fileName are alternatives. Continue install \u2192
|
|
411
|
+
import_pack: "PACK AUTHORING: validate and create a Pack draft from a manifest or archive. Only manifest plus authenticated scope are required; objects/archiveBase64/fileName are alternatives. Continue install \u2192 human approval \u2192 release, or optionally evaluate before approval.",
|
|
400
412
|
list_packs: "PACK READ: find scoped Pack drafts and releases. Pagination, status, and search are optional; use get_pack for full detail and never infer release from list membership alone.",
|
|
401
413
|
get_pack: "PACK DETAIL READ: inspect one Pack\u2019s canonical manifest, digest, status, conflicts, and materialization metadata. Read-only; it never installs, evaluates, approves, or releases.",
|
|
402
414
|
list_evaluations: "EVALUATION READ: list scoped evaluation records. Pagination and status are optional; use start_evaluation to run one and get_evaluation for full provenance.",
|
|
@@ -406,10 +418,10 @@ var descriptionOverrides = {
|
|
|
406
418
|
resolve_runtime: "ROUTING 2/3: resolve one already-selected BehaviorPoint into released runtime authority. It does not classify text or execute; use resolve_task_run/start_task_run for TaskRun execution.",
|
|
407
419
|
resolve_task_run: "ROUTING 2/3 FOR TASKRUN: preview server-owned AUTO mode and the SINGLE/STRATEGY/COMPOUND/HYBRID child plan. It never executes; call start_task_run after inspection.",
|
|
408
420
|
start_evaluation: "EVALUATION ENTRYPOINT: start a standalone dataset/evaluation-plan run, including comparative execution. Use evaluate_pack for an imported Pack and evaluate_behavior_revision_candidate for one immutable candidate.",
|
|
409
|
-
evaluate_pack: "PACK LIFECYCLE EVALUATION: evaluate one imported/installed Pack before approve_pack/release_pack. It is not start_evaluation and not evaluate_behavior_revision_candidate.",
|
|
421
|
+
evaluate_pack: "PACK LIFECYCLE EVALUATION: optionally evaluate one imported/installed Pack before approve_pack/release_pack. It is not start_evaluation and not evaluate_behavior_revision_candidate.",
|
|
410
422
|
evaluate_behavior_revision_candidate: "CANDIDATE EVALUATION ONLY: execute a real dataset against exactly one immutable candidate. It does not evaluate/release the parent Pack or grant human approval.",
|
|
411
|
-
approve_pack: "PACK APPROVAL:
|
|
412
|
-
release_pack: "PACK FINAL STEP:
|
|
423
|
+
approve_pack: "PACK APPROVAL: inspect the installed Pack and obtain human approval. Set manualApproval=true and reason for manual publication without quality evaluation, or omit manualApproval for passed evaluation approval. Supply expectedPackDigest from get_pack. Native policy safety gates still apply. For a Pack Revision use transition_pack_revision approve.",
|
|
424
|
+
release_pack: "PACK FINAL STEP: publish an already manually or evaluation-approved installed Pack. Supply expectedPackDigest from the approved Pack returned by approve_pack. Runtime authority and artifact verification still apply. For a Pack Revision use transition_pack_revision release.",
|
|
413
425
|
transition_pack_revision: "PACK REVISION STATE MACHINE: validate, request approval, approve, release, or reject a Pack Revision. Do not substitute approve_pack/release_pack; those operate on imported Pack records."
|
|
414
426
|
};
|
|
415
427
|
var MCP_TOOL_OUTPUT_CONTRACT = Object.freeze({ $schema: "https://json-schema.org/draft/2020-12/schema", type: "object", additionalProperties: false, properties: { result: {} }, required: ["result"] });
|
|
@@ -443,7 +455,7 @@ function unwrapMcpClientResponse(value) {
|
|
|
443
455
|
return value;
|
|
444
456
|
}
|
|
445
457
|
|
|
446
|
-
// src/taskrun-host-dispatch.ts
|
|
458
|
+
// packages/mcp/src/taskrun-host-dispatch.ts
|
|
447
459
|
var id = (v) => typeof v === "string" && v.length > 0 && v.length <= 500 && v === v.trim();
|
|
448
460
|
var obj = (v) => !!v && typeof v === "object" && !Array.isArray(v);
|
|
449
461
|
function buildMcpTaskRunHostDispatch(args, scope2) {
|
|
@@ -458,7 +470,7 @@ function assertMcpTaskRunHostQueued(value) {
|
|
|
458
470
|
return { status: "QUEUED", invocationId: value.invocationId, clientExecutionAllowed: false };
|
|
459
471
|
}
|
|
460
472
|
|
|
461
|
-
//
|
|
473
|
+
// contracts/observation-event-identity.ts
|
|
462
474
|
function requiredIdentityPart(value, code) {
|
|
463
475
|
if (typeof value !== "string" || !value.trim() || value !== value.trim()) throw new Error(code);
|
|
464
476
|
return value;
|
|
@@ -470,7 +482,7 @@ function createConversationOutputObservationIdentity(input2) {
|
|
|
470
482
|
return Object.freeze({ conversationId, requestId, eventId, idempotencyKey: `conversation.output:${eventId}` });
|
|
471
483
|
}
|
|
472
484
|
|
|
473
|
-
//
|
|
485
|
+
// contracts/external-host-commercial-v1.ts
|
|
474
486
|
var externalHostCommercialEvidence = Object.freeze({
|
|
475
487
|
schemaVersion: 1,
|
|
476
488
|
chargeClass: "byok",
|
|
@@ -530,7 +542,7 @@ function normalizeExternalHostCommercialPayload(eventType, value) {
|
|
|
530
542
|
return { ...value, commercial: externalHostCommercialEvidence };
|
|
531
543
|
}
|
|
532
544
|
|
|
533
|
-
// src/observation.ts
|
|
545
|
+
// packages/mcp/src/observation.ts
|
|
534
546
|
function normalizeMcpObservationEvent(value) {
|
|
535
547
|
if (value.eventType !== "conversation.output") {
|
|
536
548
|
const eventId = typeof value.eventId === "string" ? value.eventId.trim() : "";
|
|
@@ -549,7 +561,7 @@ function normalizeMcpObservationEvent(value) {
|
|
|
549
561
|
return { event: { ...value, eventId: identity.eventId }, idempotencyKey: identity.idempotencyKey };
|
|
550
562
|
}
|
|
551
563
|
|
|
552
|
-
// src/authority-request.ts
|
|
564
|
+
// packages/mcp/src/authority-request.ts
|
|
553
565
|
import { randomUUID } from "node:crypto";
|
|
554
566
|
function newMcpAuthorizationKey(tool) {
|
|
555
567
|
if (typeof tool !== "string" || !/^[a-z][a-z0-9_]{0,127}$/.test(tool)) throw new Error("MCP_AUTHORITY_TOOL_INVALID");
|
|
@@ -574,7 +586,7 @@ function assertMcpAuthorityDecisionReceipt(value) {
|
|
|
574
586
|
return value.decisionDigest;
|
|
575
587
|
}
|
|
576
588
|
|
|
577
|
-
// src/control-operation-boundary.ts
|
|
589
|
+
// packages/mcp/src/control-operation-boundary.ts
|
|
578
590
|
var REGISTERED_MCP_CONTROL_OPERATIONS = Object.freeze([
|
|
579
591
|
"DELETE /v1/ai-systems/{systemId}/unit-grants/{unitId}",
|
|
580
592
|
"DELETE /v1/behavior-points/{pointId}",
|
|
@@ -582,9 +594,12 @@ var REGISTERED_MCP_CONTROL_OPERATIONS = Object.freeze([
|
|
|
582
594
|
"DELETE /v1/semantic-tasks/{taskId}",
|
|
583
595
|
"GET /v1/ai-systems",
|
|
584
596
|
"GET /v1/ai-systems/{systemId}",
|
|
597
|
+
"GET /v1/ai-systems/{systemId}/ai-credit-preview/{feature}",
|
|
585
598
|
"GET /v1/ai-systems/{systemId}/clone-cutover/route",
|
|
586
599
|
"GET /v1/ai-systems/{systemId}/clone-cutover/route/live",
|
|
587
600
|
"GET /v1/ai-systems/{systemId}/connections",
|
|
601
|
+
"GET /v1/ai-systems/{systemId}/evaluation-datasets",
|
|
602
|
+
"GET /v1/ai-systems/{systemId}/evaluation-datasets/{datasetId}",
|
|
588
603
|
"GET /v1/ai-systems/{systemId}/inventory",
|
|
589
604
|
"GET /v1/ai-systems/{systemId}/ownership-transfer/readiness",
|
|
590
605
|
"GET /v1/ai-systems/{systemId}/unit-grants",
|
|
@@ -609,6 +624,8 @@ var REGISTERED_MCP_CONTROL_OPERATIONS = Object.freeze([
|
|
|
609
624
|
"GET /v1/connections/{connectionId}",
|
|
610
625
|
"GET /v1/connections/{connectionId}/health",
|
|
611
626
|
"GET /v1/discovery/candidates",
|
|
627
|
+
"GET /v1/discovery/observations/{eventId}/dispatch",
|
|
628
|
+
"GET /v1/discovery/worker-health",
|
|
612
629
|
"GET /v1/evaluations",
|
|
613
630
|
"GET /v1/evaluations/native-revision-source/{candidatePackId}",
|
|
614
631
|
"GET /v1/evaluations/{evaluationId}",
|
|
@@ -688,8 +705,10 @@ var REGISTERED_MCP_CONTROL_OPERATIONS = Object.freeze([
|
|
|
688
705
|
"POST /v1/conflicts/inspect",
|
|
689
706
|
"POST /v1/conflicts/{inspectionId}/resolve",
|
|
690
707
|
"POST /v1/connections/{connectionId}/test",
|
|
708
|
+
"POST /v1/discovery/candidates/semantic_task/{key}/department-draft",
|
|
691
709
|
"POST /v1/discovery/candidates/{kind}/{key}/publish",
|
|
692
710
|
"POST /v1/discovery/candidates/{kind}/{key}/review",
|
|
711
|
+
"POST /v1/discovery/observations/{eventId}/dispatch",
|
|
693
712
|
"POST /v1/evaluation-plans",
|
|
694
713
|
"POST /v1/evaluations",
|
|
695
714
|
"POST /v1/evaluations/native-revision-comparison",
|
|
@@ -706,6 +725,7 @@ var REGISTERED_MCP_CONTROL_OPERATIONS = Object.freeze([
|
|
|
706
725
|
"POST /v1/observations/batch",
|
|
707
726
|
"POST /v1/observations/sdk",
|
|
708
727
|
"POST /v1/optimization/dataset-freeze",
|
|
728
|
+
"POST /v1/optimization/dataset-inspect",
|
|
709
729
|
"POST /v1/optimization/dataset-options",
|
|
710
730
|
"POST /v1/optimization/execute",
|
|
711
731
|
"POST /v1/optimization/execute-frozen",
|
|
@@ -759,13 +779,15 @@ var REGISTERED_MCP_CONTROL_OPERATIONS = Object.freeze([
|
|
|
759
779
|
"POST /v1/teach/evidence",
|
|
760
780
|
"POST /v1/teach/proposals",
|
|
761
781
|
"POST /v1/teach/proposals/{proposalId}/request-changes",
|
|
762
|
-
"POST /v1/teach/runs/{teachRunId}/recommendation/accept"
|
|
782
|
+
"POST /v1/teach/runs/{teachRunId}/recommendation/accept",
|
|
783
|
+
"POST /v1/teach/runs/{teachRunId}/recommendation/edit",
|
|
784
|
+
"POST /v1/teach/runs/{teachRunId}/recommendation/reject"
|
|
763
785
|
]);
|
|
764
786
|
var deniedRegardlessOfContract = (path, method) => path === "/v1/notification-destinations" || path.startsWith("/v1/notification-destinations/") || method !== "GET" && /^\/v1\/observations\/(?:supersessions|backfills)(?:\/|$)/.test(path) || // These mutations require exact human/owner workflows, not a generic
|
|
765
787
|
// model-authored request with a coarse write_control_api permission.
|
|
766
788
|
method !== "GET" && // High-impact changes require dedicated tools, explicit human approval,
|
|
767
789
|
// and version/receipt fences rather than a generic MCP write envelope.
|
|
768
|
-
(method === "DELETE" || /^\/v1\/(?:releases|promotions|deployments)(?:\/|$)/.test(path) || /^\/v1\/ai-systems\/[^/]+\/clone-cutover(?:\/|$)/.test(path) || /^\/v1\/(?:packs|pack-revisions|behavior-revision-candidates)\/[^/]+\/(?:release|approve|promote|accept|materialize|install)(?:\/|$)/.test(path) || /^\/v1\/teach\/proposals\/[^/]+\/(?:promote|approve)(?:\/|$)/.test(path) || /^\/v1\/runtime\/actions(?:\/|$)/.test(path) || /^\/v1\/(?:organization-units|organization\/billing-admins|projects\/[^/]+\/organization-units)(?:\/|$)/.test(path) || /^\/v1\/ai-systems\/[^/]+\/unit-grants(?:\/|$)/.test(path) || /^\/v1\/billing(?:\/|$)/.test(path) || /^\/v1\/runtime\/actions\/approvals(?:\/|$)/.test(path) || /^\/v1\/promotions\/program-pointers\/[^/]+\/retire$/.test(path));
|
|
790
|
+
(method === "DELETE" || /^\/v1\/teach\/runs\/[^/]+\/recommendation\/(?:accept|reject|edit)$/.test(path) || /^\/v1\/discovery\/candidates\/semantic_task\/[^/]+\/department-draft$/.test(path) || /^\/v1\/(?:releases|promotions|deployments)(?:\/|$)/.test(path) || /^\/v1\/ai-systems\/[^/]+\/clone-cutover(?:\/|$)/.test(path) || /^\/v1\/(?:packs|pack-revisions|behavior-revision-candidates)\/[^/]+\/(?:release|approve|promote|accept|materialize|install)(?:\/|$)/.test(path) || /^\/v1\/teach\/proposals\/[^/]+\/(?:promote|approve)(?:\/|$)/.test(path) || /^\/v1\/runtime\/actions(?:\/|$)/.test(path) || /^\/v1\/(?:organization-units|organization\/billing-admins|projects\/[^/]+\/organization-units)(?:\/|$)/.test(path) || /^\/v1\/ai-systems\/[^/]+\/unit-grants(?:\/|$)/.test(path) || /^\/v1\/billing(?:\/|$)/.test(path) || /^\/v1\/runtime\/actions\/approvals(?:\/|$)/.test(path) || /^\/v1\/promotions\/program-pointers\/[^/]+\/retire$/.test(path));
|
|
769
791
|
var canonicalSegment = (value) => {
|
|
770
792
|
if (typeof value !== "string" || !value.trim() || value !== value.trim() || value.length > 512 || value === "." || value === ".." || /[/?#\\%\u0000]/.test(value))
|
|
771
793
|
throw new Error("MCP_CONTROL_PATH_PARAMETER_INVALID");
|
|
@@ -842,7 +864,7 @@ function bindStdioMcpQuery(scope2, value) {
|
|
|
842
864
|
return result;
|
|
843
865
|
}
|
|
844
866
|
|
|
845
|
-
// src/cli.ts
|
|
867
|
+
// packages/mcp/src/cli.ts
|
|
846
868
|
var required = (key) => {
|
|
847
869
|
const value = process.env[key]?.trim();
|
|
848
870
|
if (!value) throw new Error(`${key}_REQUIRED`);
|
|
@@ -988,7 +1010,7 @@ var fullTools = [
|
|
|
988
1010
|
{ name: "revoke_ai_system_unit_access", description: "Revoke an AI System unit access grant. Requires workspace owner permission and human approval.", inputSchema: input({ aiSystemId: z.string().min(1), unitId: z.string().min(1) }), effectful: true, run: async (args) => (await viraHttpRequest(`${baseUrl}/v1/ai-systems/${encodeURIComponent(String(args.aiSystemId))}/unit-grants/${encodeURIComponent(String(args.unitId))}`, { ...mcpHttpOptions, method: "DELETE", body: { ...scope }, idempotencyKey: newMcpMutationKey("revoke_ai_system_unit_access") })).body },
|
|
989
1011
|
{ name: "list_organization_billing_admins", description: "List organization Billing Admin memberships. Workspace owner permission is required.", inputSchema: input(), run: () => readFromApi("/v1/organization/billing-admins") },
|
|
990
1012
|
{ name: "set_organization_billing_admin", description: "Grant or revoke an organization Billing Admin membership. Workspace owner permission is required.", inputSchema: input({ actorId: z.string().min(1), status: z.enum(["ACTIVE", "REVOKED"]) }), effectful: true, run: async (args) => (await viraHttpRequest(`${baseUrl}/v1/organization/billing-admins/${encodeURIComponent(String(args.actorId))}`, { ...mcpHttpOptions, method: "POST", body: { ...scope, status: args.status }, idempotencyKey: newMcpMutationKey("set_organization_billing_admin") })).body },
|
|
991
|
-
{ name: "get_ai_credit_wallet", description: "Read
|
|
1013
|
+
{ name: "get_ai_credit_wallet", description: "Read organization wallet and verified funding lots, including expiry-aware spendable credits. Set includeCommercial for approved agreement and receivable summaries. Organization owner or Billing Admin authority required.", inputSchema: input({ includeCommercial: z.boolean().optional() }), run: (args) => readFromApi("/v1/billing/credits", { includeCommercial: args.includeCommercial === true ? "true" : void 0 }) },
|
|
992
1014
|
{ name: "list_ai_credit_budgets", description: "Read organization, department, project, and AI System budget caps with consumed and reserved credits. Organization billing admin permission is required.", inputSchema: input(), run: () => readFromApi("/v1/billing/credits/budgets") },
|
|
993
1015
|
{ name: "reserve_ai_credits", description: "Reserve an approved upper bound before a managed AI provider call. Requires organization Billing Admin permission and explicit human approval.", inputSchema: input({ amountMicrocredits: z.number().int().positive(), periodStart: z.string(), periodEnd: z.string(), idempotencyKey: z.string().min(1), aiSystemId: z.string().optional() }), effectful: true, run: (args) => client.reserveAICredits({ organizationId: scope.organizationId, projectId: scope.projectId, environmentId: scope.environmentId, amountMicrocredits: Number(args.amountMicrocredits), periodStart: String(args.periodStart), periodEnd: String(args.periodEnd), idempotencyKey: String(args.idempotencyKey), aiSystemId: args.aiSystemId }) },
|
|
994
1016
|
{ name: "release_ai_credit_reservation", description: "Release an unused AI credit reservation before any usage receipt is recorded. Requires explicit human approval.", inputSchema: input({ reservationId: z.string().min(1), idempotencyKey: z.string().min(1).optional() }), effectful: true, run: (args) => client.releaseAICreditReservation(String(args.reservationId), { idempotencyKey: typeof args.idempotencyKey === "string" ? args.idempotencyKey : void 0 }) },
|
|
@@ -1059,10 +1081,10 @@ var fullTools = [
|
|
|
1059
1081
|
} },
|
|
1060
1082
|
{ name: "list_packs", description: "List Behavior Packs with bounded cursor pagination.", inputSchema: input(pageFields), run: (args) => listFromApi("/v1/packs", args) },
|
|
1061
1083
|
{ name: "get_pack", description: "Read one scoped Behavior Pack including its manifest and materialization metadata.", inputSchema: input({ packId: z.string().min(1) }), run: (args) => client.getPack(String(args.packId)) },
|
|
1062
|
-
{ name: "list_evaluations", description: "List scoped evaluations with bounded pagination and optional status filter.", inputSchema: input({ ...pageFields, status: z.string().optional() }), run: (args) => client.listEvaluations(args) },
|
|
1084
|
+
{ name: "list_evaluations", description: "List scoped evaluations with server-side search, bounded pagination and optional status filter.", inputSchema: input({ ...pageFields, status: z.string().optional(), search: z.string().max(200).optional() }), run: (args) => client.listEvaluations(args) },
|
|
1063
1085
|
{ name: "import_pack", description: "Import a versioned Pack draft; release remains separately governed.", inputSchema: importPackSchema, effectful: true, run: (args) => client.importPack(args) },
|
|
1064
1086
|
{ name: "install_pack", description: "Install and materialize an approved Pack using direct variables.", inputSchema: input({ packId: z.string().min(1), variables: z.record(z.string(), z.unknown()).optional() }), effectful: true, run: (args) => client.installPack(String(args.packId), args.variables ?? {}) },
|
|
1065
|
-
{ name: "release_pack", description: "
|
|
1087
|
+
{ name: "release_pack", description: "Publish an approved Pack.", inputSchema: input({ packId: z.string().min(1), expectedPackDigest: z.string().optional() }), effectful: true, run: (args) => client.releasePack(String(args.packId), { expectedPackDigest: args.expectedPackDigest }) },
|
|
1066
1088
|
{ name: "preview_pack_upgrade", description: "Preview a scoped Behavior Pack upgrade without applying it.", inputSchema: input({ packId: z.string().min(1), incoming: z.record(z.string(), z.unknown()) }), effectful: true, run: (args) => client.previewPackUpgrade(String(args.packId), args.incoming) },
|
|
1067
1089
|
{ name: "get_strategy_execution_trace", description: "Read persisted Strategy execution trace and receipts.", inputSchema: input({ executionId: z.string().min(1) }), run: (args) => client.getStrategyExecutionTrace(String(args.executionId)) },
|
|
1068
1090
|
{ name: "get_ai_usage_reconciliation", description: "Read exact Strategy provider-request and rated-credit evidence in the authenticated department; does not settle or mutate usage.", inputSchema: input({ executionId: z.string().min(1) }), run: (args) => client.getAIUsageReconciliation(String(args.executionId)) },
|
|
@@ -1126,7 +1148,8 @@ var fullTools = [
|
|
|
1126
1148
|
{ name: "get_teach_analysis", description: "Read Teach analysis status and result.", inputSchema: input({ analysisId: z.string().min(1) }), run: (args) => client.getTeachAnalysis(String(args.analysisId)) },
|
|
1127
1149
|
{ name: "get_teach_run_recommendation", description: "Read a Teach recommendation.", inputSchema: input({ teachRunId: z.string().min(1) }), run: (args) => client.getTeachRunRecommendation(String(args.teachRunId)) },
|
|
1128
1150
|
{ name: "get_teach_behavior_set", description: "Read the complete provider-backed Teach behavior set before review.", inputSchema: input({ teachRunId: z.string().min(1) }), run: (args) => readFromApi(`/v1/teach/runs/${encodeURIComponent(String(args.teachRunId))}/behavior-set`) },
|
|
1129
|
-
{ name: "accept_teach_recommendation", description: "Accept a Teach recommendation for
|
|
1151
|
+
{ name: "accept_teach_recommendation", description: "Accept a Teach recommendation for review.", inputSchema: input({ teachRunId: z.string().min(1), actorId: z.string().min(1).optional(), basePackId: z.string().min(1).optional(), basePackDigest: z.string().regex(/^[a-f0-9]{64}$/).optional() }), effectful: true, run: (args) => client.acceptTeachRecommendation(String(args.teachRunId), typeof args.actorId === "string" ? args.actorId : void 0, { basePackId: typeof args.basePackId === "string" ? args.basePackId : void 0, basePackDigest: typeof args.basePackDigest === "string" ? args.basePackDigest : void 0 }) },
|
|
1152
|
+
{ name: "create_department_discovery_draft", description: "Create a review-only semantic draft.", inputSchema: input({ key: z.string().min(1), candidateId: z.string().min(1), aiSystemId: z.string().min(1), evidenceIds: z.array(z.string().min(1)).min(1).max(200) }), effectful: true, run: (args) => client.createDepartmentDiscoveryDraft(String(args.key), { candidateId: String(args.candidateId), aiSystemId: String(args.aiSystemId), evidenceIds: args.evidenceIds }) },
|
|
1130
1153
|
{ name: "reject_teach_recommendation", description: "Reject a Teach recommendation with a reason.", inputSchema: input({ teachRunId: z.string().min(1), reason: z.string().min(1) }), effectful: true, run: (args) => client.rejectTeachRecommendation(String(args.teachRunId), String(args.reason)) },
|
|
1131
1154
|
{ name: "edit_teach_recommendation", description: "Edit a Teach recommendation as a new immutable revision.", inputSchema: input({ teachRunId: z.string().min(1), revisionId: z.string().min(1), reason: z.string().min(1), behaviorSet: z.record(z.string(), z.unknown()) }), effectful: true, run: (args) => client.editTeachRecommendation(String(args.teachRunId), { revisionId: String(args.revisionId), reason: String(args.reason), behaviorSet: args.behaviorSet }) },
|
|
1132
1155
|
{ name: "request_teach_proposal_changes", description: "Request changes to a Teach proposal.", inputSchema: input({ proposalId: z.string().min(1), feedback: z.string().min(1) }), effectful: true, run: (args) => client.requestTeachProposalChanges(String(args.proposalId), String(args.feedback)) },
|
|
@@ -1143,7 +1166,7 @@ var fullTools = [
|
|
|
1143
1166
|
{ name: "create_behavior_revision_candidate", description: "Create an immutable behavior revision candidate.", inputSchema: input({ candidate: z.record(z.string(), z.unknown()) }), effectful: true, run: (args) => client.createBehaviorRevisionCandidate(args.candidate) },
|
|
1144
1167
|
{ name: "evaluate_behavior_revision_candidate", description: "Evaluate exactly one immutable Behavior Revision Candidate with a real dataset. It does not evaluate or release the parent Pack.", inputSchema: input({ candidateId: z.string().min(1), evaluation: z.record(z.string(), z.unknown()) }), effectful: true, run: (args) => client.evaluateBehaviorRevisionCandidate(String(args.candidateId), args.evaluation) },
|
|
1145
1168
|
{ name: "transition_behavior_revision_candidate", description: "Accept, reject, or promote a candidate revision.", inputSchema: input({ candidateId: z.string().min(1), transition: z.enum(["evaluate", "accept", "reject", "pack"]), input: z.record(z.string(), z.unknown()).optional() }), effectful: true, run: (args) => client.transitionBehaviorRevisionCandidate(String(args.candidateId), args.transition, args.input ?? {}) },
|
|
1146
|
-
{ name: "accept_behavior_revision_candidate", description: "
|
|
1169
|
+
{ name: "accept_behavior_revision_candidate", description: "Record explicit manual or evaluated candidate acceptance.", inputSchema: input({ candidateId: z.string().min(1), candidateEvaluationId: z.string().optional(), manualApproval: z.boolean().optional(), confirm: z.boolean().optional(), reason: z.string().optional(), expectedCandidateDigest: z.string().optional() }), effectful: true, run: (args) => client.transitionBehaviorRevisionCandidate(String(args.candidateId), "accept", { ...args.manualApproval === true ? { manualApproval: true, confirm: args.confirm, reason: args.reason, expectedCandidateDigest: args.expectedCandidateDigest, ...args.candidateEvaluationId === void 0 ? {} : { candidateEvaluationId: args.candidateEvaluationId } } : { candidateEvaluationId: args.candidateEvaluationId } }) },
|
|
1147
1170
|
{ name: "create_pack_revision", description: "Create a Pack Revision from an accepted candidate.", inputSchema: input({ revision: z.record(z.string(), z.unknown()) }), effectful: true, run: (args) => client.createPackRevision(args.revision) },
|
|
1148
1171
|
{ name: "get_pack_revision", description: "Read Pack Revision status and lineage.", inputSchema: input({ revisionId: z.string().min(1) }), run: (args) => client.getPackRevision(String(args.revisionId)) },
|
|
1149
1172
|
{ name: "get_pack_revision_diff", description: "Read Pack Revision diff.", inputSchema: input({ revisionId: z.string().min(1) }), run: (args) => client.getPackRevisionDiff(String(args.revisionId)) },
|
|
@@ -1152,7 +1175,7 @@ var fullTools = [
|
|
|
1152
1175
|
{ name: "bind_pack_signal_mappings", description: "Bind declared Pack Signal mappings to an AI System and connection.", inputSchema: input({ packId: z.string().min(1), aiSystemId: z.string().min(1), connectionId: z.string().min(1), approve: z.boolean().optional() }), effectful: true, run: (args) => client.bindPackSignalMappings(String(args.packId), { aiSystemId: String(args.aiSystemId), connectionId: String(args.connectionId), approve: args.approve === true }) },
|
|
1153
1176
|
{ name: "diagnose_pack", description: "Diagnose a Pack without changing authority.", inputSchema: input({ packId: z.string().min(1), runtimeBindings: z.array(z.string()).optional(), knownVerifiers: z.array(z.string()).optional() }), run: (args) => client.diagnosePack(String(args.packId), { runtimeBindings: args.runtimeBindings, knownVerifiers: args.knownVerifiers }) },
|
|
1154
1177
|
{ name: "evaluate_pack", description: "Evaluate one imported/installed Pack in its Pack lifecycle with server-owned execution. Use before Pack approval/release; it is not the candidate evaluator.", inputSchema: input({ packId: z.string().min(1), evaluation: z.record(z.string(), z.unknown()) }), effectful: true, run: (args) => client.evaluatePack(String(args.packId), args.evaluation) },
|
|
1155
|
-
{ name: "approve_pack", description: "Approve
|
|
1178
|
+
{ name: "approve_pack", description: "Approve an installed Pack manually or after evaluation.", inputSchema: input({ packId: z.string().min(1), manualApproval: z.boolean().optional(), reason: z.string().optional(), expectedPackDigest: z.string().optional() }), effectful: true, run: (args) => client.approvePack(String(args.packId), { manualApproval: args.manualApproval === true, reason: args.reason, expectedPackDigest: args.expectedPackDigest }) },
|
|
1156
1179
|
{ name: "compile_behavior_capsule", description: "Compile a Behavior Program capsule.", inputSchema: input({ programId: z.string().min(1), input: z.string().min(1), selection: z.record(z.string(), z.unknown()).optional(), candidates: z.array(z.unknown()).optional() }), effectful: true, run: (args) => client.compileBehaviorCapsule(args) },
|
|
1157
1180
|
{ name: "serve_behavior_projection", description: "Serve the active behavior projection for verification. Use only after get_scope/list_capabilities, Pack install, evaluation, approval, release, and a verified promotion pointer confirm that the requested Behavior Program is active. Do not use this tool to create, install, evaluate, approve, or release a Pack, to classify input, to call the model, or to execute a host action; it does not call the model or execute tools. Use compile_behavior_capsule when you need pre-model context, resolve_runtime/executeRuntime when you need enforcement, and evaluate_behavior_revision_candidate when testing an unreleased candidate.", inputSchema: input({ input: z.string().min(1), provider: z.string().min(1), programId: z.string().optional() }), effectful: true, run: (args) => client.serveBehaviorProjection(args) },
|
|
1158
1181
|
{ name: "create_release", description: "Create a governed release for an approved immutable artifact.", inputSchema: input({ release: z.record(z.string(), z.unknown()) }), effectful: true, run: (args) => client.createRelease(args.release) },
|
|
@@ -1182,7 +1205,7 @@ var authorize = async (tool, args) => {
|
|
|
1182
1205
|
})).body;
|
|
1183
1206
|
assertMcpAuthorityDecisionReceipt(decision);
|
|
1184
1207
|
};
|
|
1185
|
-
var server = new McpServer({ name: process.env.VIRA_MCP_SERVER_NAME ?? "vira", version: "0.1.
|
|
1208
|
+
var server = new McpServer({ name: process.env.VIRA_MCP_SERVER_NAME ?? "vira", version: "0.1.109" }, { capabilities: { tools: {} } });
|
|
1186
1209
|
var stdioObserver = createMcpStderrObserver(process.env.VIRA_MCP_LOCAL_DIAGNOSTICS === "true");
|
|
1187
1210
|
for (const tool of tools) {
|
|
1188
1211
|
server.registerTool(tool.name, { description: tool.description, inputSchema: tool.inputSchema, outputSchema: z.fromJSONSchema(MCP_PUBLIC_TOOL_CATALOG.find((item) => item.name === tool.name).outputSchema), annotations: tool.annotations }, async (raw) => observeMcpStdioCall(stdioObserver, async () => {
|
package/dist/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tryvira/mcp",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.109",
|
|
4
4
|
"mcpName": "io.github.hrpering/vira",
|
|
5
5
|
"description": "Vira MCP client and npx-ready JSON-RPC launcher.",
|
|
6
6
|
"keywords": [
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
45
|
"@modelcontextprotocol/server": "^2.4.0",
|
|
46
|
-
"@tryvira/sdk": "^0.1.
|
|
46
|
+
"@tryvira/sdk": "^0.1.110",
|
|
47
47
|
"zod": "^4.2.0"
|
|
48
48
|
},
|
|
49
49
|
"scripts": {
|
|
@@ -53,5 +53,6 @@
|
|
|
53
53
|
"prepublishOnly": "npm run pack:check && npm run public:surface:smoke",
|
|
54
54
|
"publish:public": "npm run pack:check && npm run public:surface:smoke && npm publish --access public"
|
|
55
55
|
},
|
|
56
|
-
"license": "MIT"
|
|
56
|
+
"license": "MIT",
|
|
57
|
+
"gitHead": "def3fd5193cedfd38504f231b00727b0fb34dea0"
|
|
57
58
|
}
|