sigrank 1.0.42 → 1.0.44

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/bin/sigrank.mjs CHANGED
@@ -26,10 +26,19 @@ function flag(name, fallback = undefined) {
26
26
  return fallback;
27
27
  }
28
28
 
29
- function printStandard() {
29
+ async function printStandard() {
30
+ const { TTEOP_PROTOCOL_VERSION, TTEOP_SPEC_VERSION } = await import(
31
+ "../tools/standard-record.mjs"
32
+ );
33
+
30
34
  const payload = {
31
35
  spec: SPEC,
32
- status: "proposed_open_standard",
36
+ spec_status: "legacy_alias",
37
+ protocol: {
38
+ name: "TTEOP",
39
+ version: TTEOP_PROTOCOL_VERSION,
40
+ authority: TTEOP_SPEC_VERSION,
41
+ },
33
42
  architecture: {
34
43
  brand: "SignalAF",
35
44
  governance: "MO§ES™",
@@ -59,6 +68,9 @@ function printStandard() {
59
68
  }
60
69
 
61
70
  process.stdout.write(`Upsilon measurement engine · compatibility spec ${SPEC}\n`);
71
+ process.stdout.write(
72
+ `Protocol authority: TTEOP ${TTEOP_PROTOCOL_VERSION} (${TTEOP_SPEC_VERSION})\n`,
73
+ );
62
74
  process.stdout.write(`Upsilon measures. SigRank is the public proof surface.\n\n`);
63
75
  process.stdout.write(`Scope: ${payload.scope}\n`);
64
76
  process.stdout.write(`Primitives: input / output / cache_write / cache_read\n`);
@@ -136,7 +148,7 @@ async function exportStandardRecord() {
136
148
  }
137
149
 
138
150
  if (cmd === "standard") {
139
- printStandard();
151
+ await printStandard();
140
152
  } else if (cmd === "export" && args.includes("--standard")) {
141
153
  exportStandardRecord().catch((err) => {
142
154
  process.stderr.write(`[sigrank] ${err?.message || err}\n`);
package/index.mjs CHANGED
@@ -22,18 +22,8 @@
22
22
  * Token-only — no transcript content.
23
23
  */
24
24
 
25
- import { Server } from "@modelcontextprotocol/sdk/server/index.js";
26
- import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
27
- import {
28
- CallToolRequestSchema,
29
- ListToolsRequestSchema,
30
- ListPromptsRequestSchema,
31
- GetPromptRequestSchema,
32
- ListResourcesRequestSchema,
33
- ReadResourceRequestSchema,
34
- McpError,
35
- ErrorCode,
36
- } from "@modelcontextprotocol/sdk/types.js";
25
+ import { serveStdio } from "@modelcontextprotocol/server/stdio";
26
+ import { Server, ProtocolError, ProtocolErrorCode } from "@modelcontextprotocol/server";
37
27
  import { TOOLS, callTool } from "./tools.mjs";
38
28
  import { runCli } from "./cli.mjs";
39
29
  import { readFileSync } from "node:fs";
@@ -74,21 +64,25 @@ function installMcpCrashHandlers() {
74
64
  });
75
65
  }
76
66
 
77
- async function startMcpServer() {
78
- installMcpCrashHandlers();
67
+ // One factory builds a server instance per connection. serveStdio owns the
68
+ // era decision: a `server/discover` probe with the modern envelope pins the
69
+ // connection to protocol revision 2026-07-28; an `initialize` opening serves
70
+ // the 2025-era protocol unchanged (legacy: 'serve' — retained deliberately;
71
+ // see docs/PROTOCOL-COMPATIBILITY.md). The same handlers back both eras.
72
+ function buildServer() {
79
73
  const server = new Server(
80
74
  { name: "sigrank", version: serverVersion() },
81
75
  { capabilities: { tools: { listChanged: false }, prompts: { listChanged: false }, resources: { listChanged: false } } },
82
76
  );
83
- server.setRequestHandler(ListToolsRequestSchema, async () => ({
77
+ server.setRequestHandler('tools/list', async () => ({
84
78
  tools: TOOLS,
85
79
  }));
86
- server.setRequestHandler(CallToolRequestSchema, async (req) => {
80
+ server.setRequestHandler('tools/call', async (req) => {
87
81
  // Unknown tool name = a client/host bug → JSON-RPC -32602 protocol error, per the MCP
88
82
  // spec. isError results (below) are reserved for tools that ran and failed.
89
83
  if (!TOOLS.some((t) => t.name === req.params.name)) {
90
- throw new McpError(
91
- ErrorCode.InvalidParams,
84
+ throw new ProtocolError(
85
+ ProtocolErrorCode.InvalidParams,
92
86
  `Unknown tool: ${req.params.name}`,
93
87
  );
94
88
  }
@@ -134,10 +128,10 @@ async function startMcpServer() {
134
128
  },
135
129
  ];
136
130
 
137
- server.setRequestHandler(ListPromptsRequestSchema, async () => ({
131
+ server.setRequestHandler('prompts/list', async () => ({
138
132
  prompts: PROMPTS,
139
133
  }));
140
- server.setRequestHandler(GetPromptRequestSchema, async (req) => {
134
+ server.setRequestHandler('prompts/get', async (req) => {
141
135
  const name = req.params.name;
142
136
  const args = req.params.arguments || {};
143
137
  if (name === "check-my-efficiency") {
@@ -190,7 +184,7 @@ async function startMcpServer() {
190
184
  ],
191
185
  };
192
186
  }
193
- throw new McpError(ErrorCode.InvalidParams, `Unknown prompt: ${name}`);
187
+ throw new ProtocolError(ProtocolErrorCode.InvalidParams, `Unknown prompt: ${name}`);
194
188
  });
195
189
 
196
190
  // --- Resources: static context agents can read without calling a tool ---
@@ -240,14 +234,14 @@ async function startMcpServer() {
240
234
  "sigrank://data-policy": "./resources/data-policy.md",
241
235
  };
242
236
 
243
- server.setRequestHandler(ListResourcesRequestSchema, async () => ({
237
+ server.setRequestHandler('resources/list', async () => ({
244
238
  resources: RESOURCES,
245
239
  }));
246
- server.setRequestHandler(ReadResourceRequestSchema, async (req) => {
240
+ server.setRequestHandler('resources/read', async (req) => {
247
241
  const uri = req.params.uri;
248
242
  const file = RESOURCE_FILES[uri];
249
243
  if (!file) {
250
- throw new McpError(ErrorCode.InvalidParams, `Unknown resource: ${uri}`);
244
+ throw new ProtocolError(ProtocolErrorCode.InvalidParams, `Unknown resource: ${uri}`);
251
245
  }
252
246
  const content = readFileSync(new URL(file, import.meta.url), "utf8");
253
247
  return {
@@ -261,7 +255,15 @@ async function startMcpServer() {
261
255
  };
262
256
  });
263
257
 
264
- await server.connect(new StdioServerTransport());
258
+ return server;
259
+ }
260
+
261
+ function startMcpServer() {
262
+ installMcpCrashHandlers();
263
+ serveStdio(() => buildServer(), {
264
+ onerror: (e) =>
265
+ process.stderr.write(`[sigrank-mcp] stdio transport: ${e.message}\n`),
266
+ });
265
267
  }
266
268
 
267
269
  // Route:
package/manifest.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "$schema": "https://raw.githubusercontent.com/anthropics/mcpb/main/schemas/mcpb-manifest-v0.4.schema.json",
3
3
  "manifest_version": "0.4",
4
4
  "name": "sigrank",
5
- "version": "1.0.41",
5
+ "version": "1.0.43",
6
6
  "description": "Ranks AI coding operators by token cascade efficiency (Yield = cache_read \u00d7 output / input\u00b2). 25 tools including SigRank Standard record, yield calculation, local token usage pulls, signed submission, and tokscale-powered analytics (market share, developer profiles, model trends, cost analysis, device profiles, MCP usage, competitive intelligence). Privacy-first: runs locally, only four token counts leave the machine.",
7
7
  "author": {
8
8
  "name": "SunrisesIllNeverSee",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sigrank",
3
- "version": "1.0.42",
3
+ "version": "1.0.44",
4
4
  "author": "SunrisesIllNeverSee (https://github.com/SunrisesIllNeverSee)",
5
5
  "description": "Upsilon measurement engine distributed through the sigrank CLI/MCP compatibility package, with SigRank public leaderboard tools.",
6
6
  "mcpName": "io.github.SunrisesIllNeverSee/sigrank-mcp",
@@ -20,16 +20,13 @@
20
20
  },
21
21
  "main": "index.mjs",
22
22
  "engines": {
23
- "node": ">=18"
23
+ "node": ">=20"
24
24
  },
25
25
  "scripts": {
26
26
  "start": "node index.mjs",
27
- "test": "node test.mjs && node --test __tests__/sign.test.mjs __tests__/cascade.test.mjs __tests__/badges.test.mjs __tests__/tui-input.test.mjs __tests__/standard-record.test.mjs __tests__/standard-cli.test.mjs __tests__/product-architecture.test.mjs __tests__/tteop-delegation.test.mjs",
27
+ "test": "node test.mjs && node --test __tests__/sign.test.mjs __tests__/cascade.test.mjs __tests__/badges.test.mjs __tests__/tui-input.test.mjs __tests__/standard-record.test.mjs __tests__/standard-cli.test.mjs __tests__/product-architecture.test.mjs __tests__/tteop-delegation.test.mjs __tests__/mcp-stdio.test.mjs",
28
28
  "test:packaged": "node scripts/packed-artifact-smoke.mjs",
29
- "sync:platforms": "node scripts/sync-platforms.mjs",
30
- "sync:spine": "node scripts/sync-spine.mjs",
31
- "spine:check": "node scripts/sync-spine.mjs --check",
32
- "spine:diff": "node scripts/sync-spine.mjs --dry-run"
29
+ "sync:platforms": "node scripts/sync-platforms.mjs"
33
30
  },
34
31
  "files": [
35
32
  "bin/",
@@ -84,10 +81,10 @@
84
81
  "on-device"
85
82
  ],
86
83
  "dependencies": {
87
- "@modelcontextprotocol/sdk": "^1.0.0",
88
84
  "token-cascade": "^0.2.1",
89
85
  "ccusage": "^20.0.19",
90
- "tokscale": "^4.7.0"
86
+ "tokscale": "^4.7.0",
87
+ "@modelcontextprotocol/server": "^2.3.0"
91
88
  },
92
89
  "devDependencies": {
93
90
  "@resvg/resvg-js": "^2.6.2",