Docker images / prepare-release (push) Successful in 11s
Docker images / backend-test (push) Successful in 10m21s
Docker images / frontend-image (push) Successful in 2m8s
Docker images / updater-image (push) Successful in 38s
Docker images / netflow-agent-image (push) Successful in 32s
Docker images / backend-image (push) Successful in 1m59s
Docker images / publish-release (push) Successful in 12s
Docker images / notify-webhook (push) Successful in 2s
25 lines
1.8 KiB
TypeScript
25 lines
1.8 KiB
TypeScript
import assert from "node:assert/strict"
|
|
import { test } from "node:test"
|
|
import { mcpOperationDescriptorSchema } from "@mmapp/contracts/mcp"
|
|
import type { add } from "./actions.js"
|
|
import { registerServerPollAction } from "./server-poll-registration.js"
|
|
import { findMcpService } from "./service-registry.js"
|
|
|
|
test("registration exposes one actual global write plan and fixed nondiagnostic service", async () => {
|
|
const calls: Parameters<typeof add>[] = []
|
|
registerServerPollAction(((...args: Parameters<typeof add>) => { calls.push(args) }) as typeof add)
|
|
assert.equal(calls.length, 1)
|
|
const [id, tool, description, section, permission, effect, scope, schema, handlers] = calls[0]
|
|
assert.doesNotMatch(description, /8 на владельца|128 на приложение/)
|
|
assert.match(description, /pollStorageUsage/)
|
|
assert.equal(mcpOperationDescriptorSchema.shape.title.safeParse(description).success, true)
|
|
assert.equal(id, "servers.poll"); assert.equal(tool, "mm_server_poll_plan"); assert.equal(section, "servers")
|
|
assert.equal(permission, "mm:servers:write"); assert.equal(effect, "write"); assert.equal(scope, "global"); assert.equal(handlers.version, 1)
|
|
assert(handlers.prepare); assert(handlers.target); assert.equal(handlers.read, undefined)
|
|
assert(schema.safeParse({ serverId: 1 }).success)
|
|
for (const input of [{ serverId: 1, identity: {} }, { serverId: 1, sql: "SELECT 1" }, { serverId: 1, receiptId: "forged" }, { serverId: 0 }]) assert(!schema.safeParse(input).success)
|
|
const service = findMcpService(id); assert(service); assert.equal(service.cancellableDiagnostic, undefined)
|
|
for (const method of ["current", "execute", "verify", "reconcile"] as const) assert.equal(typeof service[method], "function")
|
|
assert.equal(await service.verify!({}, {}), false)
|
|
})
|