glasspane-mcp 1.15.0 → 1.16.0

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 CHANGED
@@ -40,4 +40,15 @@ MCP 客户端配置:
40
40
  已捆绑内联,包内不存在指向源码仓库的 `file:` 依赖;`schemas/` 是 kernel schema
41
41
  的发布副本,每次 `npm run bundle` 重新同步。
42
42
 
43
+ 两个入口,各自是什么就按什么用 / two entries, each with one job:
44
+
45
+ | specifier | file | 行为 / behaviour |
46
+ | --- | --- | --- |
47
+ | `glasspane-mcp`(`exports["."]`) | `dist/index.js` | 就是 `glasspane-mcp` 命令本体:import 它即开始跑 stdio 会话,接管该进程的 stdin/stdout。它是程序,不是库——宿主不要 import 它。 |
48
+ | `glasspane-mcp/stdio-session`(`exports["./stdio-session"]`) | `dist/stdio-session.js` | 同一个会话的库形态(`parseArgs`、`startStdioServer`、`USAGE`、`tooLargeResponse`):import 时既不读 stdin 也不写 stdout,只有你调用 `startStdioServer()` 才接管。要嵌进自己的进程就用这一条。 |
49
+
50
+ `exports["."]` 与 `bin["glasspane-mcp"]` 指向同一个文件是刻意的:命令必须无条件运行,
51
+ `argv[1]`/`require.main` 那类"自我判断要不要跑"的守卫曾在 19 个版本里把发布包变成 0
52
+ 字节。所以运行与否由你选哪个 specifier 决定,而不是由文件猜。
53
+
43
54
  License: MIT.
@@ -66,6 +66,15 @@ export type TrailProvenance = "in-order" | "late" | "late-inferred";
66
66
  * that cannot say (a wiring that has not read the field yet).
67
67
  */
68
68
  export type LateArrivalAttribution = "echoed-id" | "arrival-order" | "unknown";
69
+ /**
70
+ * The mechanism an `arrival-order` attribution names, in one sentence with no verdict in
71
+ * it. Written here because this is the layer that knows it, and put beside every surface
72
+ * that shows one of those frames: the trail's own
73
+ * {@link TRAIL_PROVENANCE_NOTES `late-inferred`} note is built from this text, and
74
+ * `dispatch.ts`'s late-reply log line says the same words for the ids it names, so the
75
+ * two surfaces cannot one day describe two different mechanisms.
76
+ */
77
+ export declare const ARRIVAL_ORDER_MECHANISM: string;
69
78
  /**
70
79
  * The sentence the surface that shows the trail puts beside one id. Written here
71
80
  * because this is the layer that knows the mechanism; the tool layer renders it.
@@ -120,8 +129,6 @@ export declare class EvidenceAuditSession {
120
129
  * would have to remember to delete. `test/engine-client.test.mjs` pins both.
121
130
  */
122
131
  provenanceOf(id: string): TrailProvenance | null;
123
- /** The ids currently filed as inferred; see {@link TrailProvenance}. */
124
- inferredIds(): string[];
125
132
  /**
126
133
  * The trail's generation number. Every {@link restart} bumps it.
127
134
  *
@@ -26,7 +26,7 @@ export declare const MCP_PROTOCOL_VERSION: "2025-06-18";
26
26
  export declare const SUPPORTED_PROTOCOL_VERSIONS: readonly string[];
27
27
  export declare const SERVER_INFO: {
28
28
  readonly name: "glasspane-mcp";
29
- readonly version: "1.15.0";
29
+ readonly version: "1.16.0";
30
30
  };
31
31
  export declare const PARSE_ERROR = -32700;
32
32
  export declare const INVALID_REQUEST = -32600;
@@ -60,8 +60,53 @@ export declare const ENGINE_SOCKET_ENV = "GLASSPANE_ENGINE_SOCK";
60
60
  * Single source all the same: the CLI argument parser in index.ts and the
61
61
  * reconnecting transport both resolve the path through this function, so an env
62
62
  * override cannot be honoured on one side only.
63
+ *
64
+ * A **blank** override is not an override. `GLASSPANE_ENGINE_SOCK=""` — which is
65
+ * what `export FOO=` and a launcher that means "unset" actually put in the
66
+ * environment — is not nullish, so honouring it literally sends `""` to
67
+ * `net.connect`. Measured on the delivered artifact: `gp_probe_status` answered
68
+ * `GP_E_ENGINE_UNREACHABLE` carrying Node's internals ("Port should be >= 0 and <
69
+ * 65536. Received type string ('')"), and the remedy fell back to the generic
70
+ * "restart the daemon" wording, i.e. the answer *invented a daemon fault* out of a
71
+ * variable the shell was never given. Empty-and-whitespace-only reads as "no name
72
+ * here", which is what the fallback guess is for; the CLI flag spelling of the same
73
+ * empty value is refused instead, because there an operator is naming a socket in
74
+ * this command line and dropping it silently would connect them to one they did not
75
+ * choose (`index.ts`, `http-gateway-cli.ts`).
63
76
  */
64
77
  export declare function defaultSocketPath(): string;
78
+ /**
79
+ * The env override that actually names a socket, or `null` when it names nothing.
80
+ *
81
+ * `true`-for-blank is written as "returns the value or `null`" rather than as a
82
+ * `boolean` predicate because the caller has to carry the value onward, and a
83
+ * `boolean` helper leaves TypeScript unable to see that the surviving case is a
84
+ * string — the shape of this decision is not something a caller should be cast
85
+ * around.
86
+ *
87
+ * The value is *not* trimmed on the way out: a real path may contain spaces, and
88
+ * `/tmp/ a.sock` is somebody's socket. This only decides whether the value says
89
+ * anything at all. It is the single spelling of that rule so the env override and
90
+ * the CLI flag check (`refuseEmptySocketPath`) cannot drift into disagreeing about
91
+ * what "no socket named" means.
92
+ */
93
+ export declare function socketOverride(value: string | undefined): string | null;
94
+ /**
95
+ * Refuse a `--socket-path` that names nothing, as the usage error it is.
96
+ *
97
+ * The opposite of the env rule above, deliberately: a variable somebody exported
98
+ * can only say "no name here", and the fallback guess is what answers that; a flag
99
+ * on this command line is an operator *naming a socket*, and dropping the name they
100
+ * typed would leave this process bridging a daemon they did not choose. And `""` is
101
+ * not merely a path that does not exist — `net.connect("")` fails its own argument
102
+ * validation ("Port should be >= 0 and < 65536. Received type string ('')"), which
103
+ * arrives dressed as `GP_E_ENGINE_UNREACHABLE` with generic restart wording.
104
+ *
105
+ * Only the truly empty value is refused. A path of spaces is a path (`/tmp/ .sock`
106
+ * exists on a POSIX filesystem), and the honest answer for one that does not exist
107
+ * is the ENOENT this shell already reports, not a usage error invented here.
108
+ */
109
+ export declare function refuseEmptySocketPath(value: string, flag: string): void;
65
110
  /** Fallback deadline for a method missing from the table below. */
66
111
  export declare const ENGINE_TIMEOUT_MS = 10000;
67
112
  /**