@rockhopper-co/mcp-server 2.1.35-staging.58c396e → 2.1.37-staging.afa1439
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/dist/lib.d.ts +8 -1
- package/dist/lib.d.ts.map +1 -1
- package/dist/lib.js +6 -0
- package/dist/lib.js.map +1 -1
- package/dist/not-ready.d.ts +33 -1
- package/dist/not-ready.d.ts.map +1 -1
- package/dist/not-ready.js +48 -4
- package/dist/not-ready.js.map +1 -1
- package/dist/resources/changes.d.ts.map +1 -1
- package/dist/resources/changes.js +7 -1
- package/dist/resources/changes.js.map +1 -1
- package/dist/resources/orchestration-guide.md +7 -0
- package/dist/resources/versions.d.ts.map +1 -1
- package/dist/resources/versions.js +6 -0
- package/dist/resources/versions.js.map +1 -1
- package/dist/server.d.ts +16 -1
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +27 -4
- package/dist/server.js.map +1 -1
- package/dist/tool-telemetry.d.ts +98 -0
- package/dist/tool-telemetry.d.ts.map +1 -0
- package/dist/tool-telemetry.js +96 -0
- package/dist/tool-telemetry.js.map +1 -0
- package/dist/tools/get-versions.d.ts.map +1 -1
- package/dist/tools/get-versions.js +15 -4
- package/dist/tools/get-versions.js.map +1 -1
- package/dist/tools/search.d.ts.map +1 -1
- package/dist/tools/search.js +15 -1
- package/dist/tools/search.js.map +1 -1
- package/package.json +1 -1
package/dist/lib.d.ts
CHANGED
|
@@ -13,6 +13,12 @@
|
|
|
13
13
|
*
|
|
14
14
|
* Stable API surface (semver-bound):
|
|
15
15
|
* - `createServer(apiClient, options?): McpServer`
|
|
16
|
+
* - `ToolTelemetrySink` (ENG-2823) — where a HOST wants one structured line
|
|
17
|
+
* per tool call to go. The stdio surface omits it and keeps the local
|
|
18
|
+
* file, because stdout is the transport there; the gateway supplies its
|
|
19
|
+
* request logger so the line reaches CloudWatch. The package never picks
|
|
20
|
+
* a destination, and the event's key set is fixed so no host can widen it
|
|
21
|
+
* into arguments or content.
|
|
16
22
|
* - `grantsWriteTools(scope)` — the write allow-list (ENG-2208), exported so
|
|
17
23
|
* the gateway asks the same question instead of writing a second copy of
|
|
18
24
|
* the rule that would drift from this one.
|
|
@@ -24,7 +30,8 @@
|
|
|
24
30
|
* - `ApiClient` (class) and `ApiClientConfig` (interface)
|
|
25
31
|
* - All `types` (Team, EnrolledFile, FileVersion, ...)
|
|
26
32
|
*/
|
|
27
|
-
export { createServer } from './server.js';
|
|
33
|
+
export { createServer, type CreateServerOptions } from './server.js';
|
|
34
|
+
export { type ToolOutcome, type ToolTelemetryEvent, type ToolTelemetrySink, } from './tool-telemetry.js';
|
|
28
35
|
export { grantsWriteTools, resolveCapabilities, registeredToolsForCapabilities, PAT_CAPABILITIES, PENDING_WRITE_TOOLS, WRITE_TOOLS_BY_CAPABILITY, type PatCapability, type RegisterToolsOptions, } from './tools/index.js';
|
|
29
36
|
export { ApiClient, type ApiClientConfig } from './api-client.js';
|
|
30
37
|
export * from './types.js';
|
package/dist/lib.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lib.d.ts","sourceRoot":"","sources":["../src/lib.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"lib.d.ts","sourceRoot":"","sources":["../src/lib.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAEH,OAAO,EAAE,YAAY,EAAE,KAAK,mBAAmB,EAAE,MAAM,aAAa,CAAC;AACrE,OAAO,EACL,KAAK,WAAW,EAChB,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,GACvB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,gBAAgB,EAChB,mBAAmB,EACnB,8BAA8B,EAC9B,gBAAgB,EAChB,mBAAmB,EACnB,yBAAyB,EACzB,KAAK,aAAa,EAClB,KAAK,oBAAoB,GAC1B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,SAAS,EAAE,KAAK,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClE,cAAc,YAAY,CAAC"}
|
package/dist/lib.js
CHANGED
|
@@ -13,6 +13,12 @@
|
|
|
13
13
|
*
|
|
14
14
|
* Stable API surface (semver-bound):
|
|
15
15
|
* - `createServer(apiClient, options?): McpServer`
|
|
16
|
+
* - `ToolTelemetrySink` (ENG-2823) — where a HOST wants one structured line
|
|
17
|
+
* per tool call to go. The stdio surface omits it and keeps the local
|
|
18
|
+
* file, because stdout is the transport there; the gateway supplies its
|
|
19
|
+
* request logger so the line reaches CloudWatch. The package never picks
|
|
20
|
+
* a destination, and the event's key set is fixed so no host can widen it
|
|
21
|
+
* into arguments or content.
|
|
16
22
|
* - `grantsWriteTools(scope)` — the write allow-list (ENG-2208), exported so
|
|
17
23
|
* the gateway asks the same question instead of writing a second copy of
|
|
18
24
|
* the rule that would drift from this one.
|
package/dist/lib.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lib.js","sourceRoot":"","sources":["../src/lib.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"lib.js","sourceRoot":"","sources":["../src/lib.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAEH,OAAO,EAAE,YAAY,EAA4B,MAAM,aAAa,CAAC;AAMrE,OAAO,EACL,gBAAgB,EAChB,mBAAmB,EACnB,8BAA8B,EAC9B,gBAAgB,EAChB,mBAAmB,EACnB,yBAAyB,GAG1B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,SAAS,EAAwB,MAAM,iBAAiB,CAAC;AAClE,cAAc,YAAY,CAAC"}
|
package/dist/not-ready.d.ts
CHANGED
|
@@ -32,7 +32,14 @@ export type NotReadyReason =
|
|
|
32
32
|
* an unknown completeness state is not permission to serve rows. This is the
|
|
33
33
|
* one reason that is NOT a statement about the file.
|
|
34
34
|
*/
|
|
35
|
-
| 'completeness_unknown'
|
|
35
|
+
| 'completeness_unknown'
|
|
36
|
+
/**
|
|
37
|
+
* ENG-2824 — the file is enrolled but its initial read has not landed yet.
|
|
38
|
+
* Distinct from `change_history_incomplete`, which is a FOLD rewriting an
|
|
39
|
+
* existing window: here there is no window and no version, because enrolment
|
|
40
|
+
* saves the file row before it writes Initial 1.0.0 / Live 0.0.0.
|
|
41
|
+
*/
|
|
42
|
+
| 'enrollment_incomplete';
|
|
36
43
|
/** Grep marker; also the first token of every refusal an assistant sees. */
|
|
37
44
|
export declare const NOT_READY_MARKER = "CHANGE_HISTORY_NOT_READY";
|
|
38
45
|
/** Poll hint when the backend gave none — mirrors the backend's own default. */
|
|
@@ -68,6 +75,31 @@ export interface NotReadyToolResult {
|
|
|
68
75
|
* wrong inference explicitly, and a JSON object to branch on.
|
|
69
76
|
*/
|
|
70
77
|
export declare function notReadyToolResult(err: unknown): NotReadyToolResult;
|
|
78
|
+
/**
|
|
79
|
+
* ENG-2824 — throws {@link ChangeHistoryNotReadyError} when the file's initial
|
|
80
|
+
* read has not landed, judged by its version list being EMPTY.
|
|
81
|
+
*
|
|
82
|
+
* Why the version list is the right signal, and why the existing probe cannot
|
|
83
|
+
* be it. `assertChangeHistoryComplete` asks the commit-diff QUEUE, and the
|
|
84
|
+
* enrolment write enqueues no fold at all — `initial` is named among the
|
|
85
|
+
* never-enqueued classes in `backend/src/queue/commit-diff-fold-status.sql.ts`
|
|
86
|
+
* ("the never-enqueued classes (initial, …) are all correctly reported as
|
|
87
|
+
* nothing pending"). So during the ~90 seconds a workbook is being read for
|
|
88
|
+
* the first time the probe answers `foldPending: false` truthfully, and every
|
|
89
|
+
* change-history surface reads that as permission to serve an empty list.
|
|
90
|
+
*
|
|
91
|
+
* The backend already treats "row exists, zero versions" as enrolment that has
|
|
92
|
+
* not finished: `enrolled-files.service.ts` short-circuits a repeat POST only
|
|
93
|
+
* when the row has "at least one saved FileVersion", and calls a versionless
|
|
94
|
+
* row a "half-enrolled stub" on the Google path. Enrolment saves the file row
|
|
95
|
+
* first and Initial 1.0.0 / Live 0.0.0 after, on BOTH platform paths, so there
|
|
96
|
+
* is no enrolled-and-complete file with zero versions.
|
|
97
|
+
*
|
|
98
|
+
* Existence is not being inferred here: `FileUserAccessGuard` denies an unknown
|
|
99
|
+
* or unauthorised id outright, so a 200 carrying an empty array means the file
|
|
100
|
+
* is ours and is still being read — not that it might not exist.
|
|
101
|
+
*/
|
|
102
|
+
export declare function assertEnrollmentComplete(fileMsId: string, versions: readonly unknown[]): void;
|
|
71
103
|
/** The completeness probe this module needs from the API client. */
|
|
72
104
|
export interface CompletenessProbe {
|
|
73
105
|
getFoldStatus(fileMsId: string): Promise<{
|
package/dist/not-ready.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"not-ready.d.ts","sourceRoot":"","sources":["../src/not-ready.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,oDAAoD;AACpD,MAAM,MAAM,cAAc;AACxB,2EAA2E;AACzE,2BAA2B;AAC7B,6EAA6E;GAC3E,iBAAiB;AACnB;;;;GAIG;GACD,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"not-ready.d.ts","sourceRoot":"","sources":["../src/not-ready.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,oDAAoD;AACpD,MAAM,MAAM,cAAc;AACxB,2EAA2E;AACzE,2BAA2B;AAC7B,6EAA6E;GAC3E,iBAAiB;AACnB;;;;GAIG;GACD,sBAAsB;AACxB;;;;;GAKG;GACD,uBAAuB,CAAC;AAE5B,4EAA4E;AAC5E,eAAO,MAAM,gBAAgB,6BAA6B,CAAC;AAE3D,gFAAgF;AAChF,eAAO,MAAM,2BAA2B,KAAK,CAAC;AAE9C,qBAAa,0BAA2B,SAAQ,KAAK;IACnD,2EAA2E;IAC3E,QAAQ,CAAC,QAAQ,EAAG,IAAI,CAAU;IAClC,QAAQ,CAAC,MAAM,EAAE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15 +87,25 @@ export function notReadyToolResult(err) {
|
|
|
87
87
|
retryAfterSeconds: e.retryAfterSeconds,
|
|
88
88
|
fileMsId: e.fileMsId,
|
|
89
89
|
};
|
|
90
|
+
// ENG-2824 — the enrolment case is not a change-history statement, and
|
|
91
|
+
// saying "computing this file's change history" over a file whose bytes
|
|
92
|
+
// have not been read yet invites exactly the wrong follow-up ("so it has
|
|
93
|
+
// no versions"). Name the state the caller is actually in.
|
|
94
|
+
const body = e.reason === 'enrollment_incomplete'
|
|
95
|
+
? `Rockhopper is still reading this workbook for the first time, so no ` +
|
|
96
|
+
`versions and no changes can be served yet.\n` +
|
|
97
|
+
`Do NOT say the file has no versions, no history or no changes, that ` +
|
|
98
|
+
`it is empty, or that enrolment failed — none of that is known.\n`
|
|
99
|
+
: `Rockhopper has not finished computing this file's change history, ` +
|
|
100
|
+
`so no rows can be served.\n` +
|
|
101
|
+
`Do NOT say there are no changes, that nothing changed, or that the ` +
|
|
102
|
+
`history is empty — none of that is known.\n`;
|
|
90
103
|
return {
|
|
91
104
|
content: [
|
|
92
105
|
{
|
|
93
106
|
type: 'text',
|
|
94
107
|
text: `${NOT_READY_MARKER} — this is NOT a result and NOT an empty result.\n` +
|
|
95
|
-
|
|
96
|
-
`so no rows can be served.\n` +
|
|
97
|
-
`Do NOT say there are no changes, that nothing changed, or that the ` +
|
|
98
|
-
`history is empty — none of that is known.\n` +
|
|
108
|
+
body +
|
|
99
109
|
`Retry in ${e.retryAfterSeconds} seconds.\n` +
|
|
100
110
|
JSON.stringify(payload),
|
|
101
111
|
},
|
|
@@ -103,6 +113,40 @@ export function notReadyToolResult(err) {
|
|
|
103
113
|
isError: true,
|
|
104
114
|
};
|
|
105
115
|
}
|
|
116
|
+
/**
|
|
117
|
+
* ENG-2824 — throws {@link ChangeHistoryNotReadyError} when the file's initial
|
|
118
|
+
* read has not landed, judged by its version list being EMPTY.
|
|
119
|
+
*
|
|
120
|
+
* Why the version list is the right signal, and why the existing probe cannot
|
|
121
|
+
* be it. `assertChangeHistoryComplete` asks the commit-diff QUEUE, and the
|
|
122
|
+
* enrolment write enqueues no fold at all — `initial` is named among the
|
|
123
|
+
* never-enqueued classes in `backend/src/queue/commit-diff-fold-status.sql.ts`
|
|
124
|
+
* ("the never-enqueued classes (initial, …) are all correctly reported as
|
|
125
|
+
* nothing pending"). So during the ~90 seconds a workbook is being read for
|
|
126
|
+
* the first time the probe answers `foldPending: false` truthfully, and every
|
|
127
|
+
* change-history surface reads that as permission to serve an empty list.
|
|
128
|
+
*
|
|
129
|
+
* The backend already treats "row exists, zero versions" as enrolment that has
|
|
130
|
+
* not finished: `enrolled-files.service.ts` short-circuits a repeat POST only
|
|
131
|
+
* when the row has "at least one saved FileVersion", and calls a versionless
|
|
132
|
+
* row a "half-enrolled stub" on the Google path. Enrolment saves the file row
|
|
133
|
+
* first and Initial 1.0.0 / Live 0.0.0 after, on BOTH platform paths, so there
|
|
134
|
+
* is no enrolled-and-complete file with zero versions.
|
|
135
|
+
*
|
|
136
|
+
* Existence is not being inferred here: `FileUserAccessGuard` denies an unknown
|
|
137
|
+
* or unauthorised id outright, so a 200 carrying an empty array means the file
|
|
138
|
+
* is ours and is still being read — not that it might not exist.
|
|
139
|
+
*/
|
|
140
|
+
export function assertEnrollmentComplete(fileMsId, versions) {
|
|
141
|
+
if (versions.length > 0)
|
|
142
|
+
return;
|
|
143
|
+
throw new ChangeHistoryNotReadyError({
|
|
144
|
+
reason: 'enrollment_incomplete',
|
|
145
|
+
fileMsId,
|
|
146
|
+
detail: 'the file is enrolled but has no versions yet, so its initial read has ' +
|
|
147
|
+
'not finished',
|
|
148
|
+
});
|
|
149
|
+
}
|
|
106
150
|
/**
|
|
107
151
|
* Throws {@link ChangeHistoryNotReadyError} unless the file's change history is
|
|
108
152
|
* complete.
|
package/dist/not-ready.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"not-ready.js","sourceRoot":"","sources":["../src/not-ready.ts"],"names":[],"mappings":"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MAAM,EACJ,qCAAqC;gBACrC,CAAC,MAAM,CAAC,mBAAmB,IAAI,IAAI;oBACjC,CAAC,CAAC,EAAE;oBACJ,CAAC,CAAC,gBAAgB,MAAM,CAAC,mBAAmB,EAAE,CAAC;SACpD,CAAC,CAAC;IACL,CAAC;AACH,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"changes.d.ts","sourceRoot":"","sources":["../../src/resources/changes.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"changes.d.ts","sourceRoot":"","sources":["../../src/resources/changes.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAMlD,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,SAAS,EACjB,GAAG,EAAE,SAAS,GACb,IAAI,CAmDN"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ResourceTemplate } from '@modelcontextprotocol/server';
|
|
2
|
-
import { assertChangeHistoryComplete } from '../not-ready.js';
|
|
2
|
+
import { assertChangeHistoryComplete, assertEnrollmentComplete, } from '../not-ready.js';
|
|
3
3
|
export function registerChangeResources(server, api) {
|
|
4
4
|
// KI-078 (ENG-1381): template only, no per-file expansion into resources/list.
|
|
5
5
|
// Previously this enumerated only files with `hasUncommittedChanges === true` —
|
|
@@ -23,6 +23,12 @@ export function registerChangeResources(server, api) {
|
|
|
23
23
|
// empty change set.
|
|
24
24
|
await assertChangeHistoryComplete(api, fileMsId);
|
|
25
25
|
const page = await api.getUnattributedChangesPaginated(fileMsId);
|
|
26
|
+
// ENG-2824 — the fold probe above cannot see a file that is still being
|
|
27
|
+
// read for the first time (enrolment enqueues no fold), so an empty
|
|
28
|
+
// envelope is checked against the version list before it is served.
|
|
29
|
+
if (page.totalCount === 0) {
|
|
30
|
+
assertEnrollmentComplete(fileMsId, await api.getFileVersions(fileMsId));
|
|
31
|
+
}
|
|
26
32
|
return {
|
|
27
33
|
contents: [
|
|
28
34
|
{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"changes.js","sourceRoot":"","sources":["../../src/resources/changes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAGhE,OAAO,
|
|
1
|
+
{"version":3,"file":"changes.js","sourceRoot":"","sources":["../../src/resources/changes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAGhE,OAAO,EACL,2BAA2B,EAC3B,wBAAwB,GACzB,MAAM,iBAAiB,CAAC;AAEzB,MAAM,UAAU,uBAAuB,CACrC,MAAiB,EACjB,GAAc;IAEd,+EAA+E;IAC/E,gFAAgF;IAChF,+DAA+D;IAC/D,MAAM,CAAC,gBAAgB,CACrB,sBAAsB,EACtB,IAAI,gBAAgB,CAAC,uCAAuC,EAAE;QAC5D,IAAI,EAAE,SAAS;KAChB,CAAC,EACF;QACE,KAAK,EAAE,sBAAsB;QAC7B,WAAW,EACT,uEAAuE;QACzE,QAAQ,EAAE,kBAAkB;KAC7B,EACD,KAAK,EAAE,GAAG,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE;QAC1B,mEAAmE;QACnE,uEAAuE;QACvE,8DAA8D;QAC9D,8DAA8D;QAC9D,iEAAiE;QACjE,gBAAgB;QAChB,wEAAwE;QACxE,yEAAyE;QACzE,qEAAqE;QACrE,oBAAoB;QACpB,MAAM,2BAA2B,CAAC,GAAG,EAAE,QAAkB,CAAC,CAAC;QAE3D,MAAM,IAAI,GAAG,MAAM,GAAG,CAAC,+BAA+B,CACpD,QAAkB,CACnB,CAAC;QACF,wEAAwE;QACxE,oEAAoE;QACpE,oEAAoE;QACpE,IAAI,IAAI,CAAC,UAAU,KAAK,CAAC,EAAE,CAAC;YAC1B,wBAAwB,CACtB,QAAkB,EAClB,MAAM,GAAG,CAAC,eAAe,CAAC,QAAkB,CAAC,CAC9C,CAAC;QACJ,CAAC;QACD,OAAO;YACL,QAAQ,EAAE;gBACR;oBACE,GAAG,EAAE,GAAG,CAAC,IAAI;oBACb,QAAQ,EAAE,kBAAkB;oBAC5B,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;iBACpC;aACF;SACF,CAAC;IACJ,CAAC,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -111,6 +111,13 @@ A refusal means **nothing is known yet**. It is not an empty history, not zero c
|
|
|
111
111
|
and not evidence that the file is unmodified. Wait `retryAfterSeconds` and ask again;
|
|
112
112
|
never answer a user's question about what changed from a not-ready response.
|
|
113
113
|
|
|
114
|
+
**Right after `enroll_file`, expect it.** Rockhopper reads the workbook for the first
|
|
115
|
+
time after the file row exists, so for roughly the first minute `get_file_versions`,
|
|
116
|
+
`get_unattributed_changes` and both resources refuse with
|
|
117
|
+
`"reason": "enrollment_incomplete"`. That is the enrolment still running, not a failure
|
|
118
|
+
and not a file without history — do not tell the user the workbook has no versions,
|
|
119
|
+
and do not re-enrol it. Wait `retryAfterSeconds` and ask again.
|
|
120
|
+
|
|
114
121
|
## 4. Commenting workflow
|
|
115
122
|
|
|
116
123
|
Comments are scoped to a version. The default version is the latest **committed** one.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"versions.d.ts","sourceRoot":"","sources":["../../src/resources/versions.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"versions.d.ts","sourceRoot":"","sources":["../../src/resources/versions.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAGlD,wBAAgB,wBAAwB,CACtC,MAAM,EAAE,SAAS,EACjB,GAAG,EAAE,SAAS,GACb,IAAI,CAsDN"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ResourceTemplate } from '@modelcontextprotocol/server';
|
|
2
|
+
import { assertEnrollmentComplete } from '../not-ready.js';
|
|
2
3
|
export function registerVersionResources(server, api) {
|
|
3
4
|
// KI-078 (ENG-1381): template only, no per-file expansion into resources/list.
|
|
4
5
|
server.registerResource('file-versions', new ResourceTemplate('rockhopper://files/{fileMsId}/versions', {
|
|
@@ -9,6 +10,11 @@ export function registerVersionResources(server, api) {
|
|
|
9
10
|
mimeType: 'application/json',
|
|
10
11
|
}, async (uri, { fileMsId }) => {
|
|
11
12
|
const versions = await api.getFileVersions(fileMsId);
|
|
13
|
+
// ENG-2824 — a resource read has no `isError` channel, so the
|
|
14
|
+
// freshly-enrolled state THROWS here for the same reason the change
|
|
15
|
+
// resource does: `[]` rendered as JSON is indistinguishable from a file
|
|
16
|
+
// that genuinely has no versions, and no enrolled file ever does.
|
|
17
|
+
assertEnrollmentComplete(fileMsId, versions);
|
|
12
18
|
return {
|
|
13
19
|
contents: [
|
|
14
20
|
{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"versions.js","sourceRoot":"","sources":["../../src/resources/versions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"versions.js","sourceRoot":"","sources":["../../src/resources/versions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAGhE,OAAO,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;AAE3D,MAAM,UAAU,wBAAwB,CACtC,MAAiB,EACjB,GAAc;I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AAC;iBACvC;aACF;SACF,CAAC;IACJ,CAAC,CACF,CAAC;AACJ,CAAC"}
|
package/dist/server.d.ts
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
import { McpServer } from '@modelcontextprotocol/server';
|
|
2
2
|
import { ApiClient } from './api-client.js';
|
|
3
3
|
import { type RegisterToolsOptions } from './tools/index.js';
|
|
4
|
-
|
|
4
|
+
import { type ToolTelemetrySink } from './tool-telemetry.js';
|
|
5
|
+
/**
|
|
6
|
+
* ENG-2823 — everything `registerTools` needs, plus where this HOST wants tool
|
|
7
|
+
* telemetry to go. Separate from `RegisterToolsOptions` because the sink is
|
|
8
|
+
* not a registration input: it changes nothing about which tools exist.
|
|
9
|
+
*/
|
|
10
|
+
export interface CreateServerOptions extends RegisterToolsOptions {
|
|
11
|
+
/**
|
|
12
|
+
* Optional per-call telemetry destination. Omitted on the stdio surface,
|
|
13
|
+
* whose only writable destination is the local file (stdout is the
|
|
14
|
+
* transport). The gateway supplies its request logger, which is stdout and
|
|
15
|
+
* therefore CloudWatch.
|
|
16
|
+
*/
|
|
17
|
+
telemetry?: ToolTelemetrySink;
|
|
18
|
+
}
|
|
19
|
+
export declare function createServer(apiClient: ApiClient, options?: CreateServerOptions): McpServer;
|
|
5
20
|
//# sourceMappingURL=server.d.ts.map
|
package/dist/server.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAK5C,OAAO,EAGL,KAAK,oBAAoB,EAC1B,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAK5C,OAAO,EAGL,KAAK,oBAAoB,EAC1B,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAIL,KAAK,iBAAiB,EACvB,MAAM,qBAAqB,CAAC;AAqH7B;;;;GAIG;AACH,MAAM,WAAW,mBAAoB,SAAQ,oBAAoB;IAC/D;;;;;OAKG;IACH,SAAS,CAAC,EAAE,iBAAiB,CAAC;CAC/B;AAED,wBAAgB,YAAY,CAC1B,SAAS,EAAE,SAAS,EACpB,OAAO,CAAC,EAAE,mBAAmB,GAC5B,SAAS,CA6BX"}
|
package/dist/server.js
CHANGED
|
@@ -5,6 +5,7 @@ import { registerPrompts } from './prompts/index.js';
|
|
|
5
5
|
import { registerResources } from './resources/index.js';
|
|
6
6
|
import { registerTools, resolveCapabilities, } from './tools/index.js';
|
|
7
7
|
import { buildInstructions } from './instructions.js';
|
|
8
|
+
import { classifyToolResult, describeError, emitToolTelemetry, } from './tool-telemetry.js';
|
|
8
9
|
/**
|
|
9
10
|
* Phase 1.1 / KI-226 + Phase 1.5 / KI-225 — wrap every tool handler once.
|
|
10
11
|
* Intercepting `registerTool` here (vs. wrapping each of the ~16 handlers)
|
|
@@ -20,7 +21,7 @@ import { buildInstructions } from './instructions.js';
|
|
|
20
21
|
* `ToolCallback` union. On a handler throw we log then re-throw — behavior
|
|
21
22
|
* (the error surfacing to the SDK) is preserved.
|
|
22
23
|
*/
|
|
23
|
-
function installCorrelationScope(server) {
|
|
24
|
+
function installCorrelationScope(server, telemetry) {
|
|
24
25
|
const baseRegisterTool = server.registerTool.bind(server);
|
|
25
26
|
server.registerTool = ((name, config, cb) => {
|
|
26
27
|
const handler = cb;
|
|
@@ -28,11 +29,33 @@ function installCorrelationScope(server) {
|
|
|
28
29
|
const start = Date.now();
|
|
29
30
|
try {
|
|
30
31
|
const result = await handler(...args);
|
|
31
|
-
|
|
32
|
+
// ENG-2823: an MCP tool refuses by RETURNING `isError`, never by
|
|
33
|
+
// throwing, so this branch is where every refusal lands. Reporting
|
|
34
|
+
// it as `ok` made a refused enrolment and a successful one the same
|
|
35
|
+
// line — see `tool-telemetry.ts`.
|
|
36
|
+
const outcome = classifyToolResult(result);
|
|
37
|
+
const durationMs = Date.now() - start;
|
|
38
|
+
log.info({ event: 'tool_call', tool: name, durationMs, outcome }, 'tool_call');
|
|
39
|
+
emitToolTelemetry(telemetry, {
|
|
40
|
+
event: 'tool_call',
|
|
41
|
+
tool: name,
|
|
42
|
+
outcome,
|
|
43
|
+
durationMs,
|
|
44
|
+
});
|
|
32
45
|
return result;
|
|
33
46
|
}
|
|
34
47
|
catch (err) {
|
|
35
|
-
|
|
48
|
+
const durationMs = Date.now() - start;
|
|
49
|
+
log.error({ event: 'tool_call_failed', tool: name, durationMs, err }, 'tool_call_failed');
|
|
50
|
+
// The sink gets the error's TYPE and status, never `err` itself —
|
|
51
|
+
// the local file may carry the message, a collected log may not.
|
|
52
|
+
emitToolTelemetry(telemetry, {
|
|
53
|
+
event: 'tool_call',
|
|
54
|
+
tool: name,
|
|
55
|
+
outcome: 'failed',
|
|
56
|
+
durationMs,
|
|
57
|
+
...describeError(err),
|
|
58
|
+
});
|
|
36
59
|
throw err;
|
|
37
60
|
}
|
|
38
61
|
});
|
|
@@ -98,7 +121,7 @@ export function createServer(apiClient, options) {
|
|
|
98
121
|
// no cache path, so this cannot change what a 2025 client sees.
|
|
99
122
|
cacheHints: CACHE_HINTS,
|
|
100
123
|
});
|
|
101
|
-
installCorrelationScope(server);
|
|
124
|
+
installCorrelationScope(server, options?.telemetry);
|
|
102
125
|
registerResources(server, apiClient);
|
|
103
126
|
registerTools(server, apiClient, options);
|
|
104
127
|
registerPrompts(server, apiClient);
|
package/dist/server.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAEzD,OAAO,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EnC,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ENG-2823 — one structured line per tool call, for a log an OPERATOR reads.
|
|
3
|
+
*
|
|
4
|
+
* The package already timed every tool call and already knew its name
|
|
5
|
+
* (`installCorrelationScope`). Two things stopped that from being usable
|
|
6
|
+
* telemetry:
|
|
7
|
+
*
|
|
8
|
+
* 1. **The outcome was wrong.** An MCP tool refuses by RETURNING
|
|
9
|
+
* `{ isError: true }`; it does not throw. Every handler in this package
|
|
10
|
+
* catches internally and returns that shape, so the catch branch was the
|
|
11
|
+
* only thing filing anything but `ok` — and a refused enrolment looked
|
|
12
|
+
* identical in the logs to a successful one. ENG-2816 closed
|
|
13
|
+
* `search_drive_files` enrolment for four days with a deterministic refusal
|
|
14
|
+
* on every call, and nothing in CloudWatch could show it.
|
|
15
|
+
*
|
|
16
|
+
* 2. **The line went nowhere collectable.** `logger.ts` writes to a local
|
|
17
|
+
* rotating file, because stdout IS the stdio transport on a customer's
|
|
18
|
+
* laptop. That constraint is real and unchanged. Inside an ECS container
|
|
19
|
+
* the same file is ephemeral disk nothing collects, and the container dies
|
|
20
|
+
* with it.
|
|
21
|
+
*
|
|
22
|
+
* The sink resolves both without touching the stdio constraint: the FILE line
|
|
23
|
+
* stays exactly where it was, and a host that has somewhere better to put it —
|
|
24
|
+
* the gateway, whose stdout is CloudWatch — supplies a function. The package
|
|
25
|
+
* never chooses a destination.
|
|
26
|
+
*
|
|
27
|
+
* REDACTION — the whole reason this is a typed event and not a free-form
|
|
28
|
+
* object. KI-1350 put JWTs and full SharePoint paths into span descriptions;
|
|
29
|
+
* this is the same surface. The event carries a fixed key set, and every value
|
|
30
|
+
* in it is either a literal from this file or a tool name from our own
|
|
31
|
+
* registration:
|
|
32
|
+
*
|
|
33
|
+
* - `tool` — our identifier, e.g. `enroll_file`. Never an argument.
|
|
34
|
+
* - `outcome` — one of three literals.
|
|
35
|
+
* - `durationMs` — a number.
|
|
36
|
+
* - `errorName` / `status` — the error's CONSTRUCTOR name and its numeric
|
|
37
|
+
* HTTP status, on the failure path only.
|
|
38
|
+
*
|
|
39
|
+
* Deliberately absent, and each for a reason rather than by omission:
|
|
40
|
+
* arguments (a query string, a file name, a path, a token all arrive there),
|
|
41
|
+
* result content (cell values), and the error MESSAGE. The message is the
|
|
42
|
+
* tempting one — it is what a human wants — and it is uncontrolled text from
|
|
43
|
+
* an upstream we do not own, which has already been observed carrying a file
|
|
44
|
+
* path. The status code is the diagnostic half of a message with none of the
|
|
45
|
+
* content: 403, 404, 429 and 502 each say what to do next.
|
|
46
|
+
*
|
|
47
|
+
* File names and ids are NOT emitted here even though they are the most useful
|
|
48
|
+
* signal, because this line is per-call and high-volume; the correlation id
|
|
49
|
+
* already stitches a call to the backend's own request log, which records the
|
|
50
|
+
* file under the backend's access controls.
|
|
51
|
+
*/
|
|
52
|
+
/** Three outcomes, because "did it work" has three answers, not two. */
|
|
53
|
+
export type ToolOutcome =
|
|
54
|
+
/** The handler returned a result and did not set `isError`. */
|
|
55
|
+
'ok'
|
|
56
|
+
/**
|
|
57
|
+
* The handler returned `isError: true` — a refusal, a scope denial, a
|
|
58
|
+
* not-ready answer. The call WORKED and the answer was no. This is the value
|
|
59
|
+
* that did not exist before, and its absence is the whole defect.
|
|
60
|
+
*/
|
|
61
|
+
| 'refused'
|
|
62
|
+
/** The handler threw: a bug, or an upstream that could not be reached. */
|
|
63
|
+
| 'failed';
|
|
64
|
+
export interface ToolTelemetryEvent {
|
|
65
|
+
readonly event: 'tool_call';
|
|
66
|
+
readonly tool: string;
|
|
67
|
+
readonly outcome: ToolOutcome;
|
|
68
|
+
readonly durationMs: number;
|
|
69
|
+
/** Failure path only — the error's constructor name, never its message. */
|
|
70
|
+
readonly errorName?: string;
|
|
71
|
+
/** Failure path only — a numeric HTTP status when the error carries one. */
|
|
72
|
+
readonly status?: number;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Where a host wants tool telemetry to go. Synchronous and returns nothing:
|
|
76
|
+
* a sink that made the caller wait would put a log transport on the latency
|
|
77
|
+
* path of every tool call.
|
|
78
|
+
*/
|
|
79
|
+
export type ToolTelemetrySink = (event: ToolTelemetryEvent) => void;
|
|
80
|
+
/**
|
|
81
|
+
* `isError` off a tool result, without trusting its shape. The SDK types the
|
|
82
|
+
* return as a union with an index signature, and a handler that returns
|
|
83
|
+
* something unexpected must not be reported as a refusal on the strength of a
|
|
84
|
+
* truthy field — only the literal `true` counts.
|
|
85
|
+
*/
|
|
86
|
+
export declare function classifyToolResult(result: unknown): ToolOutcome;
|
|
87
|
+
/** The two safe facts an error carries. Neither is its message. */
|
|
88
|
+
export declare function describeError(err: unknown): {
|
|
89
|
+
errorName?: string;
|
|
90
|
+
status?: number;
|
|
91
|
+
};
|
|
92
|
+
/**
|
|
93
|
+
* Hand the event to the sink without ever letting the sink affect the call.
|
|
94
|
+
* A log transport that is down, misconfigured or mid-rotation must not turn a
|
|
95
|
+
* working tool into a failed one — the reverse of what telemetry is for.
|
|
96
|
+
*/
|
|
97
|
+
export declare function emitToolTelemetry(sink: ToolTelemetrySink | undefined, event: ToolTelemetryEvent): void;
|
|
98
|
+
//# sourceMappingURL=tool-telemetry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool-telemetry.d.ts","sourceRoot":"","sources":["../src/tool-telemetry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkDG;AAEH,wEAAwE;AACxE,MAAM,MAAM,WAAW;AACrB,+DAA+D;AAC7D,IAAI;AACN;;;;GAIG;GACD,SAAS;AACX,0EAA0E;GACxE,QAAQ,CAAC;AAEb,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,KAAK,EAAE,WAAW,CAAC;IAC5B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,WAAW,CAAC;IAC9B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,2EAA2E;IAC3E,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,4EAA4E;IAC5E,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED;;;;GAIG;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,KAAK,EAAE,kBAAkB,KAAK,IAAI,CAAC;AAEpE;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,OAAO,GAAG,WAAW,CAG/D;AAED,mEAAmE;AACnE,wBAAgB,aAAa,CAAC,GAAG,EAAE,OAAO,GAAG;IAC3C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAaA;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,iBAAiB,GAAG,SAAS,EACnC,KAAK,EAAE,kBAAkB,GACxB,IAAI,CAQN"}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ENG-2823 — one structured line per tool call, for a log an OPERATOR reads.
|
|
3
|
+
*
|
|
4
|
+
* The package already timed every tool call and already knew its name
|
|
5
|
+
* (`installCorrelationScope`). Two things stopped that from being usable
|
|
6
|
+
* telemetry:
|
|
7
|
+
*
|
|
8
|
+
* 1. **The outcome was wrong.** An MCP tool refuses by RETURNING
|
|
9
|
+
* `{ isError: true }`; it does not throw. Every handler in this package
|
|
10
|
+
* catches internally and returns that shape, so the catch branch was the
|
|
11
|
+
* only thing filing anything but `ok` — and a refused enrolment looked
|
|
12
|
+
* identical in the logs to a successful one. ENG-2816 closed
|
|
13
|
+
* `search_drive_files` enrolment for four days with a deterministic refusal
|
|
14
|
+
* on every call, and nothing in CloudWatch could show it.
|
|
15
|
+
*
|
|
16
|
+
* 2. **The line went nowhere collectable.** `logger.ts` writes to a local
|
|
17
|
+
* rotating file, because stdout IS the stdio transport on a customer's
|
|
18
|
+
* laptop. That constraint is real and unchanged. Inside an ECS container
|
|
19
|
+
* the same file is ephemeral disk nothing collects, and the container dies
|
|
20
|
+
* with it.
|
|
21
|
+
*
|
|
22
|
+
* The sink resolves both without touching the stdio constraint: the FILE line
|
|
23
|
+
* stays exactly where it was, and a host that has somewhere better to put it —
|
|
24
|
+
* the gateway, whose stdout is CloudWatch — supplies a function. The package
|
|
25
|
+
* never chooses a destination.
|
|
26
|
+
*
|
|
27
|
+
* REDACTION — the whole reason this is a typed event and not a free-form
|
|
28
|
+
* object. KI-1350 put JWTs and full SharePoint paths into span descriptions;
|
|
29
|
+
* this is the same surface. The event carries a fixed key set, and every value
|
|
30
|
+
* in it is either a literal from this file or a tool name from our own
|
|
31
|
+
* registration:
|
|
32
|
+
*
|
|
33
|
+
* - `tool` — our identifier, e.g. `enroll_file`. Never an argument.
|
|
34
|
+
* - `outcome` — one of three literals.
|
|
35
|
+
* - `durationMs` — a number.
|
|
36
|
+
* - `errorName` / `status` — the error's CONSTRUCTOR name and its numeric
|
|
37
|
+
* HTTP status, on the failure path only.
|
|
38
|
+
*
|
|
39
|
+
* Deliberately absent, and each for a reason rather than by omission:
|
|
40
|
+
* arguments (a query string, a file name, a path, a token all arrive there),
|
|
41
|
+
* result content (cell values), and the error MESSAGE. The message is the
|
|
42
|
+
* tempting one — it is what a human wants — and it is uncontrolled text from
|
|
43
|
+
* an upstream we do not own, which has already been observed carrying a file
|
|
44
|
+
* path. The status code is the diagnostic half of a message with none of the
|
|
45
|
+
* content: 403, 404, 429 and 502 each say what to do next.
|
|
46
|
+
*
|
|
47
|
+
* File names and ids are NOT emitted here even though they are the most useful
|
|
48
|
+
* signal, because this line is per-call and high-volume; the correlation id
|
|
49
|
+
* already stitches a call to the backend's own request log, which records the
|
|
50
|
+
* file under the backend's access controls.
|
|
51
|
+
*/
|
|
52
|
+
/**
|
|
53
|
+
* `isError` off a tool result, without trusting its shape. The SDK types the
|
|
54
|
+
* return as a union with an index signature, and a handler that returns
|
|
55
|
+
* something unexpected must not be reported as a refusal on the strength of a
|
|
56
|
+
* truthy field — only the literal `true` counts.
|
|
57
|
+
*/
|
|
58
|
+
export function classifyToolResult(result) {
|
|
59
|
+
const isError = result?.isError;
|
|
60
|
+
return isError === true ? 'refused' : 'ok';
|
|
61
|
+
}
|
|
62
|
+
/** The two safe facts an error carries. Neither is its message. */
|
|
63
|
+
export function describeError(err) {
|
|
64
|
+
const out = {};
|
|
65
|
+
if (err instanceof Error) {
|
|
66
|
+
// A subclass that never assigns `this.name` inherits the literal 'Error',
|
|
67
|
+
// which names nothing. Fall through to the constructor in that one case
|
|
68
|
+
// rather than always preferring it: the classes that DO set `name` (the
|
|
69
|
+
// not-ready error, the API client's) mean it deliberately.
|
|
70
|
+
out.errorName =
|
|
71
|
+
err.name === 'Error' ? (err.constructor?.name ?? 'Error') : err.name;
|
|
72
|
+
}
|
|
73
|
+
else if (err != null)
|
|
74
|
+
out.errorName = typeof err;
|
|
75
|
+
const status = err?.status;
|
|
76
|
+
if (typeof status === 'number')
|
|
77
|
+
out.status = status;
|
|
78
|
+
return out;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Hand the event to the sink without ever letting the sink affect the call.
|
|
82
|
+
* A log transport that is down, misconfigured or mid-rotation must not turn a
|
|
83
|
+
* working tool into a failed one — the reverse of what telemetry is for.
|
|
84
|
+
*/
|
|
85
|
+
export function emitToolTelemetry(sink, event) {
|
|
86
|
+
if (!sink)
|
|
87
|
+
return;
|
|
88
|
+
try {
|
|
89
|
+
sink(event);
|
|
90
|
+
}
|
|
91
|
+
catch {
|
|
92
|
+
// Deliberately swallowed, and deliberately not re-logged: the thing that
|
|
93
|
+
// would carry the report is the thing that just failed.
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
//# sourceMappingURL=tool-telemetry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool-telemetry.js","sourceRoot":"","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oot":"","sources":["../../src/tools/get-versions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAE9D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"get-versions.d.ts","sourceRoot":"","sources":["../../src/tools/get-versions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAE9D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAQlD,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,SAAS,EACjB,GAAG,EAAE,SAAS,GACb,IAAI,CA+EN"}
|
|
@@ -1,10 +1,17 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { formatVersion } from '../version-format.js';
|
|
3
|
+
import { assertEnrollmentComplete, isNotReady, notReadyToolResult, } from '../not-ready.js';
|
|
3
4
|
export function registerGetVersionsTool(server, api) {
|
|
4
5
|
server.registerTool('get_file_versions', {
|
|
5
6
|
title: 'Get File Versions',
|
|
6
7
|
description: 'Get the version history for a specific enrolled file. ' +
|
|
7
|
-
'Returns all version snapshots with semver numbering, timestamps, and attribution.'
|
|
8
|
+
'Returns all version snapshots with semver numbering, timestamps, and attribution. ' +
|
|
9
|
+
// ENG-2824 — the same contract the change-history tools carry, for the
|
|
10
|
+
// same reason: a just-enrolled file has no versions YET, and that is
|
|
11
|
+
// not the same fact as a file having none.
|
|
12
|
+
'Answers CHANGE_HISTORY_NOT_READY (isError) while Rockhopper is still ' +
|
|
13
|
+
'reading a newly enrolled workbook. That is NOT "no versions" — retry ' +
|
|
14
|
+
'after the stated interval instead of reporting an absence.',
|
|
8
15
|
inputSchema: z.object({
|
|
9
16
|
fileMsId: z.string().describe('Platform ID of the enrolled file'),
|
|
10
17
|
}),
|
|
@@ -15,6 +22,10 @@ export function registerGetVersionsTool(server, api) {
|
|
|
15
22
|
}, async ({ fileMsId }) => {
|
|
16
23
|
try {
|
|
17
24
|
const versions = await api.getFileVersions(fileMsId);
|
|
25
|
+
// ENG-2824: refuse BEFORE formatting. An enrolled file always carries
|
|
26
|
+
// Initial 1.0.0 + Live 0.0.0 once its initial read lands, so an empty
|
|
27
|
+
// list is the not-ready state, never an answer.
|
|
28
|
+
assertEnrollmentComplete(fileMsId, versions);
|
|
18
29
|
const summary = versions
|
|
19
30
|
.map((v) => {
|
|
20
31
|
// ENG-2750 — a negative-semver discard marker renders as what it
|
|
@@ -44,14 +55,14 @@ export function registerGetVersionsTool(server, api) {
|
|
|
44
55
|
content: [
|
|
45
56
|
{
|
|
46
57
|
type: 'text',
|
|
47
|
-
text: versions.length
|
|
48
|
-
? `${versions.length} version(s):\n\n${summary}`
|
|
49
|
-
: 'No versions found for this file.',
|
|
58
|
+
text: `${versions.length} version(s):\n\n${summary}`,
|
|
50
59
|
},
|
|
51
60
|
],
|
|
52
61
|
};
|
|
53
62
|
}
|
|
54
63
|
catch (error) {
|
|
64
|
+
if (isNotReady(error))
|
|
65
|
+
return notReadyToolResult(error);
|
|
55
66
|
return {
|
|
56
67
|
content: [
|
|
57
68
|
{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-versions.js","sourceRoot":"","sources":["../../src/tools/get-versions.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"get-versions.js","sourceRoot":"","sources":["../../src/tools/get-versions.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EACL,wBAAwB,EACxB,UAAU,EACV,kBAAkB,GACnB,MAAM,iBAAiB,CAAC;AAEzB,MAAM,UAAU,uBAAuB,CACrC,MAAiB,EACjB,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d.ts","sourceRoot":"","sources":["../../src/tools/search.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAE9D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAQlD,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,SAAS,EACjB,GAAG,EAAE,SAAS,GACb,IAAI,CAkQN"}
|
package/dist/tools/search.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { assertChangeHistoryComplete, isNotReady, notReadyToolResult, } from '../not-ready.js';
|
|
2
|
+
import { assertChangeHistoryComplete, assertEnrollmentComplete, isNotReady, notReadyToolResult, } from '../not-ready.js';
|
|
3
3
|
export function registerSearchTool(server, api) {
|
|
4
4
|
server.registerTool('search_files', {
|
|
5
5
|
title: 'Search Files',
|
|
@@ -120,6 +120,14 @@ export function registerSearchTool(server, api) {
|
|
|
120
120
|
// returned 9 rows clean. This is the practical workaround when the
|
|
121
121
|
// caller already knows which sheet to drill into.
|
|
122
122
|
const changes = await api.getUnattributedChangesBySheet(fileMsId, sheetName);
|
|
123
|
+
// ENG-2824: an empty answer is the only ambiguous one, so it is the
|
|
124
|
+
// only one that pays for the version read. A file still being read
|
|
125
|
+
// for the first time has no versions and no parsed cells, and the
|
|
126
|
+
// fold probe above cannot see that state — enrolment enqueues no
|
|
127
|
+
// fold. See `assertEnrollmentComplete`.
|
|
128
|
+
if (changes.length === 0) {
|
|
129
|
+
assertEnrollmentComplete(fileMsId, await api.getFileVersions(fileMsId));
|
|
130
|
+
}
|
|
123
131
|
const body = formatChangeRows(changes);
|
|
124
132
|
return {
|
|
125
133
|
content: [
|
|
@@ -139,6 +147,12 @@ export function registerSearchTool(server, api) {
|
|
|
139
147
|
const MAX_DISPLAYED = 200;
|
|
140
148
|
const page = await api.getUnattributedChangesPaginated(fileMsId, cursor);
|
|
141
149
|
if (page.changes.length === 0) {
|
|
150
|
+
// ENG-2824 — same rule as the sheet mode above. `totalCount === 0`
|
|
151
|
+
// over a file whose initial read has not landed is a premature
|
|
152
|
+
// absence, not a fact about the workbook.
|
|
153
|
+
if (page.totalCount === 0) {
|
|
154
|
+
assertEnrollmentComplete(fileMsId, await api.getFileVersions(fileMsId));
|
|
155
|
+
}
|
|
142
156
|
return {
|
|
143
157
|
content: [
|
|
144
158
|
{
|
package/dist/tools/search.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search.js","sourceRoot":"","sources":["../../src/tools/search.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EACL,2BAA2B,EAC3B,UAAU,EACV,kBAAkB,GACnB,MAAM,iBAAiB,CAAC;AAEzB,MAAM,UAAU,kBAAkB,CAChC,MAAiB,EACjB,GAAc;IAEd,MAAM,CAAC,YAAY,CACjB,cAAc,EACd;QACE,KAAK,EAAE,cAAc;QACrB,WAAW,EACT,iEAAiE;YACjE,iEAAiE;YACjE,sDAAsD;YACtD,8DAA8D;YAC9D,sEAAsE;YACtE,uEAAuE;YACvE,mEAAmE;YACnE,qEAAqE;YACrE,qDAAqD;YACrD,uEAAuE;YACvE,kEAAkE;YAClE,qEAAqE;YACrE,oEAAoE;YACpE,sEAAsE;YACtE,oBAAoB;YACpB,sEAAsE;YACtE,sEAAsE;YACtE,uEAAuE;YACvE,uEAAuE;QACzE,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC;YACpB,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,cAAc,CAAC;YAC1C,OAAO,EAAE,CAAC;iBACP,IAAI,CAAC,CAAC,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,KAAK,CAAC,CAAC;iBAC7C,QAAQ,EAAE;iBACV,QAAQ,CACP,2DAA2D;gBACzD,+DAA+D;gBAC/D,qDAAqD,CACxD;SACJ,CAAC;QACF,WAAW,EAAE;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AAG,CAAC,CAAC,KAAK,CAAC,CAAC;AACvC,CAAC"}
|
|
1
|
+
{"version":3,"file":"search.js","sourceRoot":"","sources":["../../src/tools/search.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EACL,2BAA2B,EAC3B,wBAAwB,EACxB,UAAU,EACV,kBAAkB,GACnB,MAAM,iBAAiB,CAAC;AAEzB,MAAM,UAAU,kBAAkB,CAChC,MAAiB,EACjB,GAAc;IAEd,MAAM,CAAC,YAAY,CACjB,cAAc,EACd;QACE,KAAK,EAAE,cAAc;QACrB,WAAW,EACT,iEAAiE;YACjE,iEAAiE;YACjE,sDAAsD;YACtD,8DAA8D;YAC9D,sEAAsE;YACtE,uEAAuE;YACvE,mEAAmE;YACnE,qEAAqE;YACrE,qDAAqD;YACrD,uEAAuE;YACvE,kEAAkE;YAClE,qEAAqE;YACrE,oEAAoE;YACpE,sEAAsE;YACtE,oBAAoB;YACpB,sEAAsE;YACtE,sEAAsE;YACtE,uEAAuE;YACvE,uEAAuE;QACzE,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC;YACpB,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,cAAc,CAAC;YAC1C,OAAO,EAAE,CAAC;iBACP,IAAI,CAAC,CAAC,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,KAAK,CAAC,CAAC;iBAC7C,QAAQ,EAAE;iBACV,QAAQ,CACP,2DAA2D;gBACzD,+DAA+D;gBAC/D,qDAAqD,CACxD;SACJ,CAAC;QACF,WAAW,EAAE;YACX,YAAY,EAAE,IAAI;YAClB,aAAa,EAAE,KAAK;SACrB;KACF,EACD,KAAK,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,EAAE;QAC3B,IAAI,CAAC;YACH,MAAM,KAAK,GAAG,MAAM,GAAG,CAAC,iBAAiB,CAAC;gBACxC,MAAM,EAAE,KAAK;gBACb,OAAO;aACR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AE,CAAC;SAChC,GAAG,CAAC,CAAC,CAAC,SAAS,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC,CAAC;SACnD,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC;AACvC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rockhopper-co/mcp-server",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.37-staging.afa1439",
|
|
4
4
|
"description": "Rockhopper MCP server — expose file metadata, versions, reviews, and comments to AI tools",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|