pi-harness-runtime 1.1.464 → 1.1.466
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/CHANGELOG.md +85 -0
- package/harness/honcho-init.ts +136 -1
- package/harness/mcp-connector.ts +507 -0
- package/index.ts +186 -5
- package/package.json +1 -1
- package/packages/agent-policy/package.json +1 -1
- package/packages/auth/package.json +1 -1
- package/packages/autonomous-runtime/package.json +1 -1
- package/packages/checkpoint/package.json +1 -1
- package/packages/clipboard/package.json +1 -1
- package/packages/codex-watcher/package.json +1 -1
- package/packages/config-capture/package.json +1 -1
- package/packages/contracts/package.json +1 -1
- package/packages/cookie-sanitizer/package.json +1 -1
- package/packages/evaluation-engine/package.json +1 -1
- package/packages/event-bus/package.json +1 -1
- package/packages/event-store/package.json +1 -1
- package/packages/experience-replay/package.json +1 -1
- package/packages/file-copy-helper/package.json +1 -1
- package/packages/intent-analyzer/package.json +1 -1
- package/packages/jev-judge/package.json +1 -1
- package/packages/knowledge-retrieval/package.json +1 -1
- package/packages/learning-engine/package.json +1 -1
- package/packages/logging/package.json +1 -1
- package/packages/memory-engine/package.json +1 -1
- package/packages/notification/package.json +1 -1
- package/packages/paperclip-integration/package.json +1 -1
- package/packages/performance-optimizer/package.json +1 -1
- package/packages/privilege-broker/package.json +1 -1
- package/packages/prompt-compiler/package.json +1 -1
- package/packages/providers/package.json +1 -1
- package/packages/qdrant-skills/package.json +1 -1
- package/packages/quota-manager/package.json +1 -1
- package/packages/relay/package.json +1 -1
- package/packages/skill-mcp-client/package.json +1 -1
- package/packages/skills/package.json +1 -1
- package/packages/todo-bd-sync/package.json +1 -1
- package/packages/token-estimation/package.json +1 -1
- package/packages/tooling-preference/package.json +1 -1
- package/packages/trajectory/package.json +1 -1
- package/packages/tui/package.json +1 -1
- package/packages/two-phase-review/package.json +1 -1
- package/packages/types/package.json +1 -1
- package/packages/webmcp-tester/package.json +1 -1
- package/packages/wiki/package.json +1 -1
- package/packages/write-review/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,91 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
### [1.1.466](https://github.com/ManotLuijiu/pi-harness-runtime/compare/v1.1.448...v1.1.466) (2026-11-07)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* **delegation:** a child is only a child when it really ran ([ac4e678](https://github.com/ManotLuijiu/pi-harness-runtime/commit/ac4e6782d7d4bc4941e458425c8a9f38a51fc9d4))
|
|
11
|
+
* **delegation:** the scope of a request is measured before it is judged ([684b6a5](https://github.com/ManotLuijiu/pi-harness-runtime/commit/684b6a55184f63d3be24c48dcecfb0b13410dc15))
|
|
12
|
+
* **honcho:** the memory service speaks the native MCP of Pi ([f9f740c](https://github.com/ManotLuijiu/pi-harness-runtime/commit/f9f740c12869bae4c4380afbe8c76e12388bb744))
|
|
13
|
+
* **jev:** the evaluation of a choice sees what the options mean ([f0c207e](https://github.com/ManotLuijiu/pi-harness-runtime/commit/f0c207e074701e6b7dab0965170ec39453d9d502))
|
|
14
|
+
* **jev:** the pending question carries the ask and the answer ([a792133](https://github.com/ManotLuijiu/pi-harness-runtime/commit/a792133e517fb8c12d3363e98942f3af30270f27))
|
|
15
|
+
* **jev:** the pending question counts down to the decision ([d0cc171](https://github.com/ManotLuijiu/pi-harness-runtime/commit/d0cc171223986b2d32c670b6c1c74712fe0a4ad8))
|
|
16
|
+
* **keys:** the key files are repaired when their permissions are unsafe ([e9c2c26](https://github.com/ManotLuijiu/pi-harness-runtime/commit/e9c2c26b287665b56ed749de269737e8403bb8af))
|
|
17
|
+
* **mcp:** the harness connects the registered servers when nobody else does ([7fef951](https://github.com/ManotLuijiu/pi-harness-runtime/commit/7fef95137ad4664df57f045cd91b7d233315b0bc))
|
|
18
|
+
* **merge:** a manual run can leave the merge to the pull request event ([b3d1950](https://github.com/ManotLuijiu/pi-harness-runtime/commit/b3d1950b5941c78ccd56951acdafd1d4afbe1bff))
|
|
19
|
+
* **phase:** the agent owns the todo list and the harness says so ([c489370](https://github.com/ManotLuijiu/pi-harness-runtime/commit/c489370bd7926aece8cb1a77aa20ca2d2672f1fb))
|
|
20
|
+
* **review:** the review starts on its own when the implementation is done ([04f51f5](https://github.com/ManotLuijiu/pi-harness-runtime/commit/04f51f599cd3222b6c74dd8fadb1373bd72d9bd7))
|
|
21
|
+
* **status:** the status line names the phase, the progress and the children ([0167bf3](https://github.com/ManotLuijiu/pi-harness-runtime/commit/0167bf396a0b987c1d44f3b869351976a951dd65))
|
|
22
|
+
* **test:** the task waits for the final tier of the validation plan ([fa147db](https://github.com/ManotLuijiu/pi-harness-runtime/commit/fa147dbf7d50d56e6ea48c6d8fbb4fcb190caf8a))
|
|
23
|
+
* **validation:** a large job starts with a measured pilot ([425964b](https://github.com/ManotLuijiu/pi-harness-runtime/commit/425964b04a3d4fa02adfabed47ff62c5ec2b9c28))
|
|
24
|
+
* **validation:** the size of a job is a fact, not a phrase ([8aa6c11](https://github.com/ManotLuijiu/pi-harness-runtime/commit/8aa6c119565d0f8412dc8aeafa6b295d47d3f093))
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
### Bug Fixes
|
|
28
|
+
|
|
29
|
+
* **ci:** every run of a required check counts, and the worst one decides ([da9e0da](https://github.com/ManotLuijiu/pi-harness-runtime/commit/da9e0da6b0ca29cb320764fd5fc1b8a8dee8b1e0))
|
|
30
|
+
* **ci:** the newest attempt of a run decides, not the attempt that failed ([9d7adcc](https://github.com/ManotLuijiu/pi-harness-runtime/commit/9d7adcc31cbacc517c3c1a9bcd3956be94c908ef))
|
|
31
|
+
* **honcho:** the report names the state of the MCP server, not the registration ([762f4d5](https://github.com/ManotLuijiu/pi-harness-runtime/commit/762f4d59e4eabcab9a1c21a61aa522c3267621b3))
|
|
32
|
+
* **hooks:** a tag is checked through the commit behind it ([c823e8e](https://github.com/ManotLuijiu/pi-harness-runtime/commit/c823e8e1f6973c62b5449a97c101759a4d5cbba5))
|
|
33
|
+
* **jev:** a session switch ends the wait of the old session ([ca03d39](https://github.com/ManotLuijiu/pi-harness-runtime/commit/ca03d399c0d4a1b2dd428ac39836ab53c0e51ab6))
|
|
34
|
+
* **jev:** the alternatives of a question are parsed without a quadratic pattern ([63016a3](https://github.com/ManotLuijiu/pi-harness-runtime/commit/63016a3f0488acb801990dd46770c00d382b5858))
|
|
35
|
+
* **jev:** the facts of an option survive the wording of the agent ([5a6250c](https://github.com/ManotLuijiu/pi-harness-runtime/commit/5a6250c07aa8d965bc6ae242cccbf519477598f8))
|
|
36
|
+
* **keys:** the key directory is audited as a tree ([081cc75](https://github.com/ManotLuijiu/pi-harness-runtime/commit/081cc75ac8ceff36b0d619c3f76371dc08459d3c))
|
|
37
|
+
* **merge:** the boolean input is read as a boolean ([971b716](https://github.com/ManotLuijiu/pi-harness-runtime/commit/971b7169a43db382dbdeb6bb9bab02ab56e0351c))
|
|
38
|
+
* **merge:** the manual job needs the right of the merge ([7ba685e](https://github.com/ManotLuijiu/pi-harness-runtime/commit/7ba685ec43d815f90aa35b742579e87e76c69209))
|
|
39
|
+
* **merge:** the merge of the pull request is the GraphQL mutation ([972bab4](https://github.com/ManotLuijiu/pi-harness-runtime/commit/972bab4b0f7faf1b0047f3bb767ef6db3de4b2fa))
|
|
40
|
+
* **merge:** the workflow merges the pull request the gates cleared ([d7639ec](https://github.com/ManotLuijiu/pi-harness-runtime/commit/d7639ec9b83723510acb4a5c4e23d5d6167c3af6))
|
|
41
|
+
* **release:** a manual release keeps the version of its manifest ([122e661](https://github.com/ManotLuijiu/pi-harness-runtime/commit/122e661ea48cb8aff14c71dbd0221a4cf0ba4c8e))
|
|
42
|
+
* **release:** the alignment names the reason of a failure ([5814dd0](https://github.com/ManotLuijiu/pi-harness-runtime/commit/5814dd0b780f5839cf8011ed0cbbbb31e7eb0418))
|
|
43
|
+
* **release:** the channels of the package name the release ([a7a273f](https://github.com/ManotLuijiu/pi-harness-runtime/commit/a7a273ffe8398e2b5b07ef1c321777de41792c6e))
|
|
44
|
+
* **release:** the release publishes and leaves the channels alone ([5871746](https://github.com/ManotLuijiu/pi-harness-runtime/commit/5871746589c1281d855dbeb591b02419fa43f22e))
|
|
45
|
+
* **release:** the release pull request names the version of its branch ([a846e83](https://github.com/ManotLuijiu/pi-harness-runtime/commit/a846e83e6de6e529f4bca05e869db0b5eebb37c5))
|
|
46
|
+
* **release:** the release scans the tree of the commit it publishes ([7d47a0b](https://github.com/ManotLuijiu/pi-harness-runtime/commit/7d47a0b5406480a1e1d3a52623a76aabd1e2d0ba))
|
|
47
|
+
|
|
48
|
+
### [1.1.465](https://github.com/ManotLuijiu/pi-harness-runtime/compare/v1.1.448...v1.1.465) (2026-11-07)
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
### Features
|
|
52
|
+
|
|
53
|
+
* **delegation:** a child is only a child when it really ran ([ac4e678](https://github.com/ManotLuijiu/pi-harness-runtime/commit/ac4e6782d7d4bc4941e458425c8a9f38a51fc9d4))
|
|
54
|
+
* **delegation:** the scope of a request is measured before it is judged ([684b6a5](https://github.com/ManotLuijiu/pi-harness-runtime/commit/684b6a55184f63d3be24c48dcecfb0b13410dc15))
|
|
55
|
+
* **honcho:** the memory service speaks the native MCP of Pi ([f9f740c](https://github.com/ManotLuijiu/pi-harness-runtime/commit/f9f740c12869bae4c4380afbe8c76e12388bb744))
|
|
56
|
+
* **jev:** the evaluation of a choice sees what the options mean ([f0c207e](https://github.com/ManotLuijiu/pi-harness-runtime/commit/f0c207e074701e6b7dab0965170ec39453d9d502))
|
|
57
|
+
* **jev:** the pending question carries the ask and the answer ([a792133](https://github.com/ManotLuijiu/pi-harness-runtime/commit/a792133e517fb8c12d3363e98942f3af30270f27))
|
|
58
|
+
* **jev:** the pending question counts down to the decision ([d0cc171](https://github.com/ManotLuijiu/pi-harness-runtime/commit/d0cc171223986b2d32c670b6c1c74712fe0a4ad8))
|
|
59
|
+
* **keys:** the key files are repaired when their permissions are unsafe ([e9c2c26](https://github.com/ManotLuijiu/pi-harness-runtime/commit/e9c2c26b287665b56ed749de269737e8403bb8af))
|
|
60
|
+
* **merge:** a manual run can leave the merge to the pull request event ([b3d1950](https://github.com/ManotLuijiu/pi-harness-runtime/commit/b3d1950b5941c78ccd56951acdafd1d4afbe1bff))
|
|
61
|
+
* **phase:** the agent owns the todo list and the harness says so ([c489370](https://github.com/ManotLuijiu/pi-harness-runtime/commit/c489370bd7926aece8cb1a77aa20ca2d2672f1fb))
|
|
62
|
+
* **review:** the review starts on its own when the implementation is done ([04f51f5](https://github.com/ManotLuijiu/pi-harness-runtime/commit/04f51f599cd3222b6c74dd8fadb1373bd72d9bd7))
|
|
63
|
+
* **status:** the status line names the phase, the progress and the children ([0167bf3](https://github.com/ManotLuijiu/pi-harness-runtime/commit/0167bf396a0b987c1d44f3b869351976a951dd65))
|
|
64
|
+
* **test:** the task waits for the final tier of the validation plan ([fa147db](https://github.com/ManotLuijiu/pi-harness-runtime/commit/fa147dbf7d50d56e6ea48c6d8fbb4fcb190caf8a))
|
|
65
|
+
* **validation:** a large job starts with a measured pilot ([425964b](https://github.com/ManotLuijiu/pi-harness-runtime/commit/425964b04a3d4fa02adfabed47ff62c5ec2b9c28))
|
|
66
|
+
* **validation:** the size of a job is a fact, not a phrase ([8aa6c11](https://github.com/ManotLuijiu/pi-harness-runtime/commit/8aa6c119565d0f8412dc8aeafa6b295d47d3f093))
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
### Bug Fixes
|
|
70
|
+
|
|
71
|
+
* **ci:** every run of a required check counts, and the worst one decides ([da9e0da](https://github.com/ManotLuijiu/pi-harness-runtime/commit/da9e0da6b0ca29cb320764fd5fc1b8a8dee8b1e0))
|
|
72
|
+
* **ci:** the newest attempt of a run decides, not the attempt that failed ([9d7adcc](https://github.com/ManotLuijiu/pi-harness-runtime/commit/9d7adcc31cbacc517c3c1a9bcd3956be94c908ef))
|
|
73
|
+
* **honcho:** the report names the state of the MCP server, not the registration ([762f4d5](https://github.com/ManotLuijiu/pi-harness-runtime/commit/762f4d59e4eabcab9a1c21a61aa522c3267621b3))
|
|
74
|
+
* **hooks:** a tag is checked through the commit behind it ([c823e8e](https://github.com/ManotLuijiu/pi-harness-runtime/commit/c823e8e1f6973c62b5449a97c101759a4d5cbba5))
|
|
75
|
+
* **jev:** a session switch ends the wait of the old session ([ca03d39](https://github.com/ManotLuijiu/pi-harness-runtime/commit/ca03d399c0d4a1b2dd428ac39836ab53c0e51ab6))
|
|
76
|
+
* **jev:** the alternatives of a question are parsed without a quadratic pattern ([63016a3](https://github.com/ManotLuijiu/pi-harness-runtime/commit/63016a3f0488acb801990dd46770c00d382b5858))
|
|
77
|
+
* **jev:** the facts of an option survive the wording of the agent ([5a6250c](https://github.com/ManotLuijiu/pi-harness-runtime/commit/5a6250c07aa8d965bc6ae242cccbf519477598f8))
|
|
78
|
+
* **keys:** the key directory is audited as a tree ([081cc75](https://github.com/ManotLuijiu/pi-harness-runtime/commit/081cc75ac8ceff36b0d619c3f76371dc08459d3c))
|
|
79
|
+
* **merge:** the boolean input is read as a boolean ([971b716](https://github.com/ManotLuijiu/pi-harness-runtime/commit/971b7169a43db382dbdeb6bb9bab02ab56e0351c))
|
|
80
|
+
* **merge:** the manual job needs the right of the merge ([7ba685e](https://github.com/ManotLuijiu/pi-harness-runtime/commit/7ba685ec43d815f90aa35b742579e87e76c69209))
|
|
81
|
+
* **merge:** the merge of the pull request is the GraphQL mutation ([972bab4](https://github.com/ManotLuijiu/pi-harness-runtime/commit/972bab4b0f7faf1b0047f3bb767ef6db3de4b2fa))
|
|
82
|
+
* **merge:** the workflow merges the pull request the gates cleared ([d7639ec](https://github.com/ManotLuijiu/pi-harness-runtime/commit/d7639ec9b83723510acb4a5c4e23d5d6167c3af6))
|
|
83
|
+
* **release:** a manual release keeps the version of its manifest ([122e661](https://github.com/ManotLuijiu/pi-harness-runtime/commit/122e661ea48cb8aff14c71dbd0221a4cf0ba4c8e))
|
|
84
|
+
* **release:** the alignment names the reason of a failure ([5814dd0](https://github.com/ManotLuijiu/pi-harness-runtime/commit/5814dd0b780f5839cf8011ed0cbbbb31e7eb0418))
|
|
85
|
+
* **release:** the channels of the package name the release ([a7a273f](https://github.com/ManotLuijiu/pi-harness-runtime/commit/a7a273ffe8398e2b5b07ef1c321777de41792c6e))
|
|
86
|
+
* **release:** the release publishes and leaves the channels alone ([5871746](https://github.com/ManotLuijiu/pi-harness-runtime/commit/5871746589c1281d855dbeb591b02419fa43f22e))
|
|
87
|
+
* **release:** the release pull request names the version of its branch ([a846e83](https://github.com/ManotLuijiu/pi-harness-runtime/commit/a846e83e6de6e529f4bca05e869db0b5eebb37c5))
|
|
88
|
+
* **release:** the release scans the tree of the commit it publishes ([7d47a0b](https://github.com/ManotLuijiu/pi-harness-runtime/commit/7d47a0b5406480a1e1d3a52623a76aabd1e2d0ba))
|
|
89
|
+
|
|
5
90
|
### [1.1.464](https://github.com/ManotLuijiu/pi-harness-runtime/compare/v1.1.448...v1.1.464) (2026-11-07)
|
|
6
91
|
|
|
7
92
|
|
package/harness/honcho-init.ts
CHANGED
|
@@ -145,6 +145,15 @@ export type HonchoMcpClientFactory = (
|
|
|
145
145
|
export interface HonchoMcpRegistrar {
|
|
146
146
|
registerMcpServer?: (name: string, config: unknown) => void;
|
|
147
147
|
unregisterMcpServer?: (name: string) => void;
|
|
148
|
+
/**
|
|
149
|
+
* The tools the session has.
|
|
150
|
+
*
|
|
151
|
+
* The registration of a server is a declaration: the tools of the server
|
|
152
|
+
* reach the model only when an MCP connector connected it. The runtime
|
|
153
|
+
* that reports the tools is the only one that can tell the difference
|
|
154
|
+
* between a registered server and a connected one.
|
|
155
|
+
*/
|
|
156
|
+
getAllTools?: () => Array<{ name?: unknown }>;
|
|
148
157
|
}
|
|
149
158
|
|
|
150
159
|
// ---------------------------------------------------------------------------
|
|
@@ -155,7 +164,28 @@ export interface HonchoMcpRegistrar {
|
|
|
155
164
|
const HONCHO_MCP_URL = "https://mcp.honcho.dev";
|
|
156
165
|
|
|
157
166
|
/** The name of the Honcho MCP server in Pi. */
|
|
158
|
-
const HONCHO_SERVER_NAME = "honcho";
|
|
167
|
+
export const HONCHO_SERVER_NAME = "honcho";
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
* The prefix of the names of the tools of the Honcho server.
|
|
171
|
+
*
|
|
172
|
+
* The tools of an MCP server are named `mcp__<server>__<tool>`, and the
|
|
173
|
+
* namespace of a server replaces a dash with an underscore. The name is the
|
|
174
|
+
* evidence that a connector connected the server: a registration alone
|
|
175
|
+
* creates no tool.
|
|
176
|
+
*/
|
|
177
|
+
export const HONCHO_MCP_TOOL_PREFIX = "mcp__honcho__";
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* What the session knows about the MCP server of Honcho.
|
|
181
|
+
*
|
|
182
|
+
* - "not_registered": the registration was refused, so there is no server.
|
|
183
|
+
* - "registered": Pi knows the server, but no connector connected it, so
|
|
184
|
+
* the model has no Honcho tools.
|
|
185
|
+
* - "connected": the tools of the server are in the session, so the model can
|
|
186
|
+
* call them.
|
|
187
|
+
*/
|
|
188
|
+
export type HonchoMcpState = "not_registered" | "registered" | "connected";
|
|
159
189
|
|
|
160
190
|
/**
|
|
161
191
|
* Pi's native MCP client library.
|
|
@@ -1068,6 +1098,111 @@ export function registerHonchoMcpServer(
|
|
|
1068
1098
|
}
|
|
1069
1099
|
}
|
|
1070
1100
|
|
|
1101
|
+
/**
|
|
1102
|
+
* The names of the Honcho tools that the session has.
|
|
1103
|
+
*
|
|
1104
|
+
* The tools of an MCP server are named `mcp__<server>__<tool>`, so the name
|
|
1105
|
+
* of a tool tells which server it belongs to. A runtime that cannot report
|
|
1106
|
+
* the tools reports none: the harness must not guess a connection it did
|
|
1107
|
+
* not see.
|
|
1108
|
+
*
|
|
1109
|
+
* @param pi The extension API of Pi
|
|
1110
|
+
* @returns The names of the Honcho tools of the session
|
|
1111
|
+
*/
|
|
1112
|
+
export function honchoMcpTools(
|
|
1113
|
+
pi: HonchoMcpRegistrar | undefined | null
|
|
1114
|
+
): string[] {
|
|
1115
|
+
if (!pi || typeof pi.getAllTools !== "function") return [];
|
|
1116
|
+
let tools: Array<{ name?: unknown }>;
|
|
1117
|
+
try {
|
|
1118
|
+
tools = pi.getAllTools();
|
|
1119
|
+
} catch {
|
|
1120
|
+
// A runtime that refuses to answer has no tools to report.
|
|
1121
|
+
return [];
|
|
1122
|
+
}
|
|
1123
|
+
if (!Array.isArray(tools)) return [];
|
|
1124
|
+
const names: string[] = [];
|
|
1125
|
+
for (const tool of tools) {
|
|
1126
|
+
const name = typeof tool?.name === "string" ? tool.name : "";
|
|
1127
|
+
if (name.startsWith(HONCHO_MCP_TOOL_PREFIX) && !names.includes(name)) {
|
|
1128
|
+
names.push(name);
|
|
1129
|
+
}
|
|
1130
|
+
}
|
|
1131
|
+
return names;
|
|
1132
|
+
}
|
|
1133
|
+
|
|
1134
|
+
/**
|
|
1135
|
+
* The state of the MCP server of Honcho in this session.
|
|
1136
|
+
*
|
|
1137
|
+
* The state is read from the session, not from the registration: a
|
|
1138
|
+
* registration that Pi accepted says that Pi knows the server, and nothing
|
|
1139
|
+
* about a connection.
|
|
1140
|
+
*
|
|
1141
|
+
* @param pi The extension API of Pi
|
|
1142
|
+
* @param registered Whether Pi accepted the registration
|
|
1143
|
+
* @returns The state of the server
|
|
1144
|
+
*/
|
|
1145
|
+
export function honchoMcpState(
|
|
1146
|
+
pi: HonchoMcpRegistrar | undefined | null,
|
|
1147
|
+
registered: boolean
|
|
1148
|
+
): HonchoMcpState {
|
|
1149
|
+
if (!registered) return "not_registered";
|
|
1150
|
+
return honchoMcpTools(pi).length > 0 ? "connected" : "registered";
|
|
1151
|
+
}
|
|
1152
|
+
|
|
1153
|
+
/** The report of the MCP server of Honcho in the startup. */
|
|
1154
|
+
export interface HonchoMcpReport {
|
|
1155
|
+
/** The short text of the report. */
|
|
1156
|
+
text: string;
|
|
1157
|
+
/** The severity of the report. */
|
|
1158
|
+
status: "ok" | "warn";
|
|
1159
|
+
/** The lines that explain the report. */
|
|
1160
|
+
details: string[];
|
|
1161
|
+
}
|
|
1162
|
+
|
|
1163
|
+
/**
|
|
1164
|
+
* The report of the MCP server of Honcho.
|
|
1165
|
+
*
|
|
1166
|
+
* The report names the state that the session shows. It never claims a
|
|
1167
|
+
* connection that did not happen: a registered server without tools is
|
|
1168
|
+
* reported as registered, and the report says that the tools reach the
|
|
1169
|
+
* model only while an MCP connector is active.
|
|
1170
|
+
*
|
|
1171
|
+
* @param state The state of the server in the session
|
|
1172
|
+
* @param reason The cause of a refused registration, already redacted
|
|
1173
|
+
* @returns The report of the startup
|
|
1174
|
+
*/
|
|
1175
|
+
export function honchoMcpReport(
|
|
1176
|
+
state: HonchoMcpState,
|
|
1177
|
+
reason?: string
|
|
1178
|
+
): HonchoMcpReport {
|
|
1179
|
+
if (state === "connected") {
|
|
1180
|
+
return { text: "MCP connected", status: "ok", details: [] };
|
|
1181
|
+
}
|
|
1182
|
+
if (state === "registered") {
|
|
1183
|
+
return {
|
|
1184
|
+
text: "MCP registered, not connected",
|
|
1185
|
+
status: "warn",
|
|
1186
|
+
details: [
|
|
1187
|
+
...(reason
|
|
1188
|
+
? [`The connection failed: ${reason}`]
|
|
1189
|
+
: []),
|
|
1190
|
+
"The Honcho server is registered with Pi.",
|
|
1191
|
+
"Its tools reach the model only while an MCP connector is active.",
|
|
1192
|
+
"Check /mcp for the connection state.",
|
|
1193
|
+
],
|
|
1194
|
+
};
|
|
1195
|
+
}
|
|
1196
|
+
return {
|
|
1197
|
+
text: "native MCP tools not registered",
|
|
1198
|
+
status: "warn",
|
|
1199
|
+
details: [
|
|
1200
|
+
`The registration failed: ${reason ?? "the reason was not reported"}`,
|
|
1201
|
+
"Check /tmp/pi-harness.log for the Honcho reason.",
|
|
1202
|
+
],
|
|
1203
|
+
};
|
|
1204
|
+
}
|
|
1205
|
+
|
|
1071
1206
|
// ---------------------------------------------------------------------------
|
|
1072
1207
|
// Initialization
|
|
1073
1208
|
// ---------------------------------------------------------------------------
|