@rockhopper-co/mcp-server 2.1.73-staging.2ddffad → 2.1.75
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/api-client.d.ts +28 -1
- package/dist/api-client.d.ts.map +1 -1
- package/dist/api-client.js +32 -1
- package/dist/api-client.js.map +1 -1
- package/dist/document-changes.d.ts +101 -0
- package/dist/document-changes.d.ts.map +1 -0
- package/dist/document-changes.js +206 -0
- package/dist/document-changes.js.map +1 -0
- package/dist/no-change-rows-recorded.d.ts +94 -0
- package/dist/no-change-rows-recorded.d.ts.map +1 -0
- package/dist/no-change-rows-recorded.js +134 -0
- package/dist/no-change-rows-recorded.js.map +1 -0
- package/dist/resources/orchestration-guide.md +23 -4
- package/dist/tools/document-changes-read.d.ts +28 -0
- package/dist/tools/document-changes-read.d.ts.map +1 -0
- package/dist/tools/document-changes-read.js +46 -0
- package/dist/tools/document-changes-read.js.map +1 -0
- package/dist/tools/drive-search.contract.d.ts.map +1 -1
- package/dist/tools/drive-search.contract.js +5 -4
- package/dist/tools/drive-search.contract.js.map +1 -1
- package/dist/tools/search.d.ts.map +1 -1
- package/dist/tools/search.js +41 -3
- package/dist/tools/search.js.map +1 -1
- package/dist/tools/write-versions.d.ts.map +1 -1
- package/dist/tools/write-versions.js +19 -0
- package/dist/tools/write-versions.js.map +1 -1
- package/dist/types.d.ts +76 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/zod-schemas.d.ts +30 -0
- package/dist/zod-schemas.d.ts.map +1 -1
- package/dist/zod-schemas.js +38 -0
- package/dist/zod-schemas.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ENG-5410 — "there is nothing that looks" is a different answer from "we
|
|
3
|
+
* looked and found nothing", and `create_version` / `discard_changes` printed
|
|
4
|
+
* the second when they meant the first.
|
|
5
|
+
*
|
|
6
|
+
* Both tools short-circuit on `hasUncommittedChanges` and report *"File X has
|
|
7
|
+
* no uncommitted changes to commit."* Nothing ever SETS that flag for a native
|
|
8
|
+
* Google Doc or a Google Slides deck — there is no add-on for either host, so
|
|
9
|
+
* no producer can write a change row — which makes that sentence a false
|
|
10
|
+
* statement about a file the customer may have just edited, delivered
|
|
11
|
+
* confidently, in the direction that makes them STOP looking. Same class as
|
|
12
|
+
* ENG-1748 one tool over: a plausible zero is the most dangerous thing a tool
|
|
13
|
+
* can return, because unlike a refusal it does not look like a non-answer.
|
|
14
|
+
*
|
|
15
|
+
* ## This is ENG-5073's state, widened — NOT a second vocabulary
|
|
16
|
+
*
|
|
17
|
+
* The backend already grew this exact claim for `POST /file-versions`
|
|
18
|
+
* (`CreateVersionNoOpReason.NO_CHANGE_ROWS_RECORDED`, backend #3041): the third
|
|
19
|
+
* member of a set that already had "we looked and found nothing" and "we tried
|
|
20
|
+
* to look and could not". The MCP tools never reach it, because they refuse on
|
|
21
|
+
* the client side before the request is made. The CLAIM and the SENTENCE below
|
|
22
|
+
* are that reason's, not a new phrasing of one fact — a second hand-written
|
|
23
|
+
* wording is how two surfaces describing one file drift apart.
|
|
24
|
+
*
|
|
25
|
+
* ## The predicate is keyed on `fileType`, and EVERY UNKNOWN ARM ANSWERS TRUE
|
|
26
|
+
*
|
|
27
|
+
* That direction is the whole safety property, and it is ENG-5073's arm for
|
|
28
|
+
* arm. `true` — "this file does record a change-by-change list" — is what this
|
|
29
|
+
* tool did before the predicate existed, so an unrecognised `fileType` (an
|
|
30
|
+
* older backend's value, a hand-built fixture, a type added after this package
|
|
31
|
+
* was published) keeps today's behaviour instead of acquiring a NEW NEGATIVE
|
|
32
|
+
* CLAIM about a file it cannot name. Guessing "not recorded" would put this
|
|
33
|
+
* sentence in front of a customer whose spreadsheet is fully tracked, which is
|
|
34
|
+
* the same false statement pointed the other way.
|
|
35
|
+
*
|
|
36
|
+
* It matters that this package ships to customers on their own upgrade
|
|
37
|
+
* schedule: a stale second copy of a server-side rule refuses work the server
|
|
38
|
+
* would have taken, invisibly (the ENG-2200 lesson, recorded at
|
|
39
|
+
* `api-client.ts!searchDriveFiles`). Answering TRUE on anything unfamiliar is
|
|
40
|
+
* what keeps that failure impossible here.
|
|
41
|
+
*
|
|
42
|
+
* ## Microsoft `.docx` and `.pptx` are deliberately NOT here
|
|
43
|
+
*
|
|
44
|
+
* They have `paragraph-capture` and `presentation-capture` (ENG-4843), so they
|
|
45
|
+
* genuinely set the flag and these tools work for them today. Reading document
|
|
46
|
+
* CATEGORY alone would answer "not recorded" for a `.docx` and re-break what
|
|
47
|
+
* ENG-4843 fixed; reading PROVIDER alone would answer it for a Google Sheet,
|
|
48
|
+
* which has an add-on and a full cell ledger. Nothing here is "Google files are
|
|
49
|
+
* lesser" — the spreadsheet answer is TRUE on both providers. The backend needs
|
|
50
|
+
* two axes to say that; this package gets it from one `fileType` string, which
|
|
51
|
+
* already encodes both.
|
|
52
|
+
*/
|
|
53
|
+
/**
|
|
54
|
+
* The backend's machine-readable reason, matched by name so the two surfaces
|
|
55
|
+
* are greppable together. Also the first token of the refusal a model sees.
|
|
56
|
+
*/
|
|
57
|
+
export const NO_CHANGE_ROWS_RECORDED_CODE = 'NO_CHANGE_ROWS_RECORDED';
|
|
58
|
+
/**
|
|
59
|
+
* The `fileType` values for which no change-by-change list exists, and never
|
|
60
|
+
* will without a capture lane that does not exist yet (out of scope on
|
|
61
|
+
* ENG-5410, tracked separately).
|
|
62
|
+
*
|
|
63
|
+
* Exhaustive over `EnrolledFileType`'s FALSE arms as of backend `2d5acca3`:
|
|
64
|
+
* the enum's other six members — `microsoft_xlsx`, `microsoft_xlsm`,
|
|
65
|
+
* `microsoft_pptx`, `microsoft_docx`, `gdrive_xlsx`, `gsheet_native` — all
|
|
66
|
+
* record rows. A member added later is unknown here and answers TRUE, per the
|
|
67
|
+
* safety direction above.
|
|
68
|
+
*/
|
|
69
|
+
const FILE_TYPES_WITHOUT_CHANGE_ROWS = new Set([
|
|
70
|
+
'google_doc',
|
|
71
|
+
'google_slides',
|
|
72
|
+
]);
|
|
73
|
+
/**
|
|
74
|
+
* Does Rockhopper record a change-by-change list for this file, or only its
|
|
75
|
+
* versions and the comparison between two of them?
|
|
76
|
+
*
|
|
77
|
+
* Mirrors the backend's `enrolledFileRecordsChangeRows`, including its unknown
|
|
78
|
+
* arms, so the two cannot disagree about one file.
|
|
79
|
+
*/
|
|
80
|
+
export function recordsChangeRows(fileType) {
|
|
81
|
+
if (fileType == null)
|
|
82
|
+
return true;
|
|
83
|
+
return !FILE_TYPES_WITHOUT_CHANGE_ROWS.has(fileType);
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* The lead clause per action, so the sentence names the write the caller
|
|
87
|
+
* actually attempted rather than a generic one.
|
|
88
|
+
*/
|
|
89
|
+
const LEAD = {
|
|
90
|
+
commit: 'No new version was created',
|
|
91
|
+
discard: 'Nothing was discarded',
|
|
92
|
+
};
|
|
93
|
+
/**
|
|
94
|
+
* The tool answer for a write there is no recorded change to make.
|
|
95
|
+
*
|
|
96
|
+
* The customer-facing sentence is ENG-5073's, with only the trailing verb
|
|
97
|
+
* varying by action. What it deliberately does NOT do: name another vendor,
|
|
98
|
+
* describe a capture mechanism or cadence, hedge, or claim a search of the file
|
|
99
|
+
* happened. What it deliberately KEEPS is the statement of what Rockhopper DOES
|
|
100
|
+
* store — that is a commitment the customer is entitled to, and cutting it
|
|
101
|
+
* swings back into the ENG-4533 / ENG-4580 defect of copy that quietly
|
|
102
|
+
* overclaims.
|
|
103
|
+
*
|
|
104
|
+
* The three lines around it are addressed to the CLIENT, not the customer, and
|
|
105
|
+
* are the same three defences `cellHistoryUnavailableToolResult` uses, because
|
|
106
|
+
* one is not enough against a model that wants to be helpful: `isError`, prose
|
|
107
|
+
* that names the wrong inference explicitly, and a JSON object to branch on.
|
|
108
|
+
*/
|
|
109
|
+
export function noChangeRowsRecordedToolResult(fileName, fileType, action) {
|
|
110
|
+
const payload = {
|
|
111
|
+
status: 'no_change_rows_recorded',
|
|
112
|
+
code: NO_CHANGE_ROWS_RECORDED_CODE,
|
|
113
|
+
fileName,
|
|
114
|
+
fileType: fileType ?? null,
|
|
115
|
+
action,
|
|
116
|
+
};
|
|
117
|
+
return {
|
|
118
|
+
content: [
|
|
119
|
+
{
|
|
120
|
+
type: 'text',
|
|
121
|
+
text: `${NO_CHANGE_ROWS_RECORDED_CODE} — this is NOT a finding about the file.\n` +
|
|
122
|
+
`${LEAD[action]}: Rockhopper records this file's versions and the ` +
|
|
123
|
+
`comparison between them, not a change-by-change list, so there is ` +
|
|
124
|
+
`no recorded change here to ${action}.\n` +
|
|
125
|
+
`Do NOT say "${fileName}" is unchanged, has no changes, or is ` +
|
|
126
|
+
`already committed — none of that is known.\n` +
|
|
127
|
+
`Retrying will not change this answer.\n` +
|
|
128
|
+
JSON.stringify(payload),
|
|
129
|
+
},
|
|
130
|
+
],
|
|
131
|
+
isError: true,
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
//# sourceMappingURL=no-change-rows-recorded.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"no-change-rows-recorded.js","sourceRoot":"","sources":["../src/no-change-rows-recorded.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmDG;AAEH;;;GAGG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG,yBAAyB,CAAC;AAEtE;;;;;;;;;;GAUG;AACH,MAAM,8BAA8B,GAAwB,IAAI,GAAG,CAAC;IAClE,YAAY;IACZ,eAAe;CAChB,CAAC,CAAC;AAEH;;;;;;GAMG;AACH,MAAM,UAAU,iBAAiB,CAC/B,QAAmC;IAEnC,IAAI,QAAQ,IAAI,IAAI;QAAE,OAAO,IAAI,CAAC;IAClC,OAAO,CAAC,8BAA8B,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AACvD,CAAC;AAYD;;;GAGG;AACH,MAAM,IAAI,GAA8C;IACtD,MAAM,EAAE,4BAA4B;IACpC,OAAO,EAAE,uBAAuB;CACjC,CAAC;AAEF;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,8BAA8B,CAC5C,QAAgB,EAChB,QAAmC,EACnC,MAAuB;IAEvB,MAAM,OAAO,GAAG;QACd,MAAM,EAAE,yBAAyB;QACjC,IAAI,EAAE,4BAA4B;QAClC,QAAQ;QACR,QAAQ,EAAE,QAAQ,IAAI,IAAI;QAC1B,MAAM;KACP,CAAC;IACF,OAAO;QACL,OAAO,EAAE;YACP;gBACE,IAAI,EAAE,MAAM;gBACZ,IAAI,EACF,GAAG,4BAA4B,4CAA4C;oBAC3E,GAAG,IAAI,CAAC,MAAM,CAAC,oDAAoD;oBACnE,oEAAoE;oBACpE,8BAA8B,MAAM,KAAK;oBACzC,eAAe,QAAQ,wCAAwC;oBAC/D,8CAA8C;oBAC9C,yCAAyC;oBACzC,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC;aAC1B;SACF;QACD,OAAO,EAAE,IAAI;KACd,CAAC;AACJ,CAAC"}
|
|
@@ -100,7 +100,26 @@ Standard sequence to inspect a file:
|
|
|
100
100
|
- File contents at a specific version → `get_cell_history(fileMsId, sheet, cellAddress)`.
|
|
101
101
|
- Comments → `get_file_comments(fileMsId)`. Filters to the latest live version by default.
|
|
102
102
|
- Reviews → `get_reviews(versionId)`. Pass a `versionId` from step 2.
|
|
103
|
-
- Uncommitted changes → `get_unattributed_changes(fileMsId)` (only useful if `hasUncommittedChanges === true`).
|
|
103
|
+
- Uncommitted changes → `get_unattributed_changes(fileMsId)` (only useful if `hasUncommittedChanges === true`). Answers cell changes for a workbook, paragraph changes for a Word document, and shape changes for a deck.
|
|
104
|
+
|
|
105
|
+
### `DOCUMENT_CHANGES_UNAVAILABLE` — also never report it as "no changes"
|
|
106
|
+
|
|
107
|
+
`get_unattributed_changes` refuses with `{"status":"unavailable", "reason": …}` and
|
|
108
|
+
`isError: true` when it cannot produce a change list for a file at all. Unlike
|
|
109
|
+
`CHANGE_HISTORY_NOT_READY`, **retrying will not change the answer** — the payload carries
|
|
110
|
+
no `retryAfterSeconds` for that reason.
|
|
111
|
+
|
|
112
|
+
The `reason` says what to do next:
|
|
113
|
+
|
|
114
|
+
| `reason` | What it means | Next step |
|
|
115
|
+
|---|---|---|
|
|
116
|
+
| `no_capture_lane` | Rockhopper does not track a change-by-change list for this kind of file. It still has versions and comments. | Offer a version comparison instead. |
|
|
117
|
+
| `sheet_filter_not_applicable` | A `sheetName` was passed for a file with no worksheets. | Call again without `sheetName`. |
|
|
118
|
+
| `window_withheld` | The change list is not available for this file right now. | Offer a version comparison instead. |
|
|
119
|
+
| `unknown_file_type` | This connection does not recognise the file's type. | Ask the user what the file is. |
|
|
120
|
+
|
|
121
|
+
Say the change list is unavailable. Never say the file is unchanged, has no changes, or
|
|
122
|
+
is clean — none of that is known on any of these answers.
|
|
104
123
|
|
|
105
124
|
### `CHANGE_HISTORY_NOT_READY` — never report it as "no changes"
|
|
106
125
|
|
|
@@ -161,17 +180,17 @@ Rules:
|
|
|
161
180
|
Two distinct concepts. Tools work with one or the other; do not mix.
|
|
162
181
|
|
|
163
182
|
- **Committed history** — version snapshots created by `create_version`. Surfaced by `get_file_versions`, `get_cell_history`. Immutable.
|
|
164
|
-
- **Uncommitted changes** —
|
|
183
|
+
- **Uncommitted changes** — edits the user has made since the last `create_version`: cells in a workbook, paragraphs in a Word document, shapes in a deck. Surfaced by `get_unattributed_changes`. Mutable; consumed by the next `create_version` or `discard_changes` call.
|
|
165
184
|
|
|
166
185
|
Note: on files served from the change ledger (most Microsoft files), `get_cell_history` also includes live edits not yet captured by a committed version — those entries carry the literal versionId `uncommitted`. On files still served from the legacy store, only committed values appear; use `get_unattributed_changes` for pending edits there.
|
|
167
186
|
|
|
168
187
|
## 8. Cross-cloud differences
|
|
169
188
|
|
|
170
|
-
Rockhopper supports both Microsoft files (M365 / OneDrive, SharePoint) and Google
|
|
189
|
+
Rockhopper supports both Microsoft files (M365 / OneDrive, SharePoint) and Google Drive files. Tool calls work across both, but the identifiers carry different meanings:
|
|
171
190
|
|
|
172
191
|
| Field | Microsoft | Google |
|
|
173
192
|
|-------|------------------|----------------|
|
|
174
|
-
| `fileType` | `microsoft_xlsx`, `microsoft_xlsm`, `microsoft_pptx`, `microsoft_docx` | `gdrive_xlsx` (a workbook stored in Drive), `gsheet_native` (a Google Sheet) |
|
|
193
|
+
| `fileType` | `microsoft_xlsx`, `microsoft_xlsm`, `microsoft_pptx`, `microsoft_docx` | `gdrive_xlsx` (a workbook stored in Drive), `gsheet_native` (a Google Sheet), `google_doc`, `google_slides` |
|
|
175
194
|
| `driveMsId` | OneDrive / SharePoint drive ID | **always `null`** — Drive has no drive-ID concept |
|
|
176
195
|
| `platformId` (= `fileMsId`) | Microsoft graph file ID | Google Drive file ID |
|
|
177
196
|
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { ApiClient } from '../api-client.js';
|
|
2
|
+
/**
|
|
3
|
+
* ENG-5397 — the document (Word paragraph / PowerPoint shape) read behind
|
|
4
|
+
* `get_unattributed_changes`.
|
|
5
|
+
*
|
|
6
|
+
* Its own module so `search.ts` keeps the ROUTING and this keeps the document
|
|
7
|
+
* lane's rules; the vocabulary and the renderer live one file over in
|
|
8
|
+
* `document-changes.ts`.
|
|
9
|
+
*
|
|
10
|
+
* EVERY EXIT IS EITHER REAL ROWS OR A NAMED REFUSAL. None is an empty list
|
|
11
|
+
* dressed as a finding, which is the defect this ticket closes.
|
|
12
|
+
*/
|
|
13
|
+
/** The tool-result shape, mirroring the SDK's open-bag `CallToolResult`. */
|
|
14
|
+
interface ToolResult {
|
|
15
|
+
[key: string]: unknown;
|
|
16
|
+
content: Array<{
|
|
17
|
+
type: 'text';
|
|
18
|
+
text: string;
|
|
19
|
+
}>;
|
|
20
|
+
}
|
|
21
|
+
export declare function readDocumentChanges(api: ApiClient, ctx: {
|
|
22
|
+
fileMsId: string;
|
|
23
|
+
sheetName?: string;
|
|
24
|
+
fileType: string;
|
|
25
|
+
fileName: string;
|
|
26
|
+
}): Promise<ToolResult>;
|
|
27
|
+
export {};
|
|
28
|
+
//# sourceMappingURL=document-changes-read.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"document-changes-read.d.ts","sourceRoot":"","sources":["../../src/tools/document-changes-read.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAQlD;;;;;;;;;;GAUG;AAEH,4EAA4E;AAC5E,UAAU,UAAU;IAClB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;IACvB,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAChD;AAED,wBAAsB,mBAAmB,CACvC,GAAG,EAAE,SAAS,EACd,GAAG,EAAE;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;CAClB,GACA,OAAO,CAAC,UAAU,CAAC,CAgDrB"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { assertEnrollmentComplete } from '../not-ready.js';
|
|
2
|
+
import { documentChangesUnavailableToolResult, formatDocumentChanges, hasCaptureLane, } from '../document-changes.js';
|
|
3
|
+
export async function readDocumentChanges(api, ctx) {
|
|
4
|
+
const { fileMsId, fileName } = ctx;
|
|
5
|
+
// A worksheet filter over a file with no worksheets. Refusing beats quietly
|
|
6
|
+
// dropping it: the caller asked to narrow the read and would otherwise be
|
|
7
|
+
// handed the WHOLE file's changes believing they were one sheet's.
|
|
8
|
+
if (ctx.sheetName) {
|
|
9
|
+
return documentChangesUnavailableToolResult({
|
|
10
|
+
reason: 'sheet_filter_not_applicable',
|
|
11
|
+
fileMsId,
|
|
12
|
+
fileName,
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
// Google Docs and Slides have no capture lane, so their change log holds
|
|
16
|
+
// zero rows permanently — asserted backend-side in
|
|
17
|
+
// `google-document-lane.capability.spec.ts`. A structural, permanent zero
|
|
18
|
+
// rendered as "no changes" is a wrong answer that never becomes right, so it
|
|
19
|
+
// is refused BEFORE the read rather than after an honest-looking empty one.
|
|
20
|
+
if (!hasCaptureLane(ctx.fileType)) {
|
|
21
|
+
return documentChangesUnavailableToolResult({
|
|
22
|
+
reason: 'no_capture_lane',
|
|
23
|
+
fileMsId,
|
|
24
|
+
fileName,
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
// ENG-2824 — the same enrolment gate the spreadsheet lane applies. A file
|
|
28
|
+
// whose first read has not landed has no versions, and an empty window over
|
|
29
|
+
// it is a premature absence rather than a fact about the document.
|
|
30
|
+
assertEnrollmentComplete(fileMsId, await api.getFileVersions(fileMsId));
|
|
31
|
+
const response = await api.getDocumentChanges(fileMsId);
|
|
32
|
+
// The one field that separates a withheld window from an empty one. The
|
|
33
|
+
// backend's own DTO says a client MUST render the two differently.
|
|
34
|
+
if (response.declineReason !== null) {
|
|
35
|
+
return documentChangesUnavailableToolResult({
|
|
36
|
+
reason: 'window_withheld',
|
|
37
|
+
fileMsId,
|
|
38
|
+
fileName,
|
|
39
|
+
declineReason: response.declineReason,
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
return {
|
|
43
|
+
content: [{ type: 'text', text: formatDocumentChanges(response, fileName) }],
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=document-changes-read.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"document-changes-read.js","sourceRoot":"","sources":["../../src/tools/document-changes-read.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EACL,oCAAoC,EACpC,qBAAqB,EACrB,cAAc,GACf,MAAM,wBAAwB,CAAC;A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ot":"","sources":["../../src/tools/drive-search.contract.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AAC5E,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAEL,KAAK,SAAS,EACd,KAAK,kBAAkB,EACxB,MAAM,oBAAoB,CAAC;AAE5B,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;iBAgEpC,CAAC;AAEH,eAAO,MAAM,wBAAwB,
|
|
1
|
+
{"version":3,"file":"drive-search.contract.d.ts","sourceRoot":"","sources":["../../src/tools/drive-search.contract.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AAC5E,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAEL,KAAK,SAAS,EACd,KAAK,kBAAkB,EACxB,MAAM,oBAAoB,CAAC;AAE5B,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;iBAgEpC,CAAC;AAEH,eAAO,MAAM,wBAAwB,QAsBoC,CAAC;AAE1E,eAAO,MAAM,wBAAwB;;;CAI3B,CAAC;AAEX,8EAA8E;AAC9E,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,kBAAkB,CAAC;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAClC;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,iBAAiB;;;;;;EAWnD;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,cAAc,CAAC,SAAS,EAAE,SAAS,GAAG,MAAM,CAE3D;AA4BD,wEAAwE;AACxE,wBAAgB,gBAAgB,CAAC,UAAU,EAAE,SAAS,SAAS,EAAE,GAAG,MAAM,CAIzE;AAED,0EAA0E;AAC1E,wBAAgB,kBAAkB,CAChC,UAAU,EAAE,SAAS,SAAS,EAAE,EAChC,KAAK,EAAE,MAAM,GACZ,MAAM,CAUR;AA6BD;;;;;;;;;GASG;AACH,wBAAgB,gBAAgB,CAC9B,UAAU,EAAE,SAAS,SAAS,EAAE,GAC/B,IAAI,CAAC,uBAAuB,EAAE,MAAM,CAAC,CAuCvC;AAED,oEAAoE;AACpE,eAAO,MAAM,cAAc,SAAS,CAAC;AAErC;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,SAAS,EAAE,SAAS;;;;;;EAuDnD;AAED,iEAAiE;AACjE,wBAAgB,cAAc;;;;;;EAS7B;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,eAAe,CAAC,UAAU,CAAC,EAAE,SAAS,SAAS,EAAE;;;;;;EAehE;AAED;;;;;;;;;GASG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM;;;;;;EAW7C;AAED;;;;;;;;GAQG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CAUtD;AAED,iFAAiF;AACjF,wBAAgB,sBAAsB;;;;;;EASrC;AAED,yEAAyE;AACzE,eAAO,MAAM,qBAAqB,QAIqC,CAAC;AAExE;;;;;;;;;;;GAWG;AAEH,4DAA4D;AAC5D,eAAO,MAAM,eAAe,QAQ+B,CAAC;AAE5D,4EAA4E;AAC5E,eAAO,MAAM,iBAAiB,QAMU,CAAC;AAEzC,wEAAwE;AACxE,wBAAgB,aAAa,CAAC,YAAY,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAS7E"}
|
|
@@ -65,11 +65,12 @@ export const DRIVE_SEARCH_INPUT_SCHEMA = z.object({
|
|
|
65
65
|
.describe('The `confirm_token` from the answer whose list the user picked from. ' +
|
|
66
66
|
'Pass it back exactly as it was given.'),
|
|
67
67
|
});
|
|
68
|
-
export const DRIVE_SEARCH_DESCRIPTION = "Find a
|
|
68
|
+
export const DRIVE_SEARCH_DESCRIPTION = "Find a file in the user's own file storage — their OneDrive and " +
|
|
69
69
|
'SharePoint, or their Google Drive — including files Rockhopper has never ' +
|
|
70
|
-
'seen.
|
|
70
|
+
'seen. Workbooks, Word documents and PowerPoint decks. ' +
|
|
71
|
+
'Set `provider` to say which; ask the user rather than guessing. ' +
|
|
71
72
|
'Each candidate comes back marked as already in Rockhopper or not. ' +
|
|
72
|
-
'USE THIS when the user names a
|
|
73
|
+
'USE THIS when the user names a file that `search_files` and ' +
|
|
73
74
|
'`list_files` cannot find: those two see only files already added to ' +
|
|
74
75
|
'Rockhopper, so "no match" there means "never added", not "no such file". ' +
|
|
75
76
|
'YOU MUST CONFIRM THE FILE WITH THE USER before enrolling it. Show them the ' +
|
|
@@ -81,7 +82,7 @@ export const DRIVE_SEARCH_DESCRIPTION = "Find a spreadsheet in the user's own fi
|
|
|
81
82
|
'Read the outcome rather than assuming: `declined` means the user saw the ' +
|
|
82
83
|
'candidates and rejected them, `dismissed` means the prompt closed with no ' +
|
|
83
84
|
'answer at all — put the list to them yourself and do not search again — ' +
|
|
84
|
-
'and `link_supplied` means they pasted the
|
|
85
|
+
'and `link_supplied` means they pasted the file address, which goes to ' +
|
|
85
86
|
'`enroll_file` as `url` on its own. ' +
|
|
86
87
|
'Searching is capped per session, so search deliberately rather than ' +
|
|
87
88
|
'browsing. Each provider needs its own connected account — if the one you ' +
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"drive-search.contract.js","sourceRoot":"","sources":["../../src/tools/drive-search.contract.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,2BAA2B,GAG5B,MAAM,oBAAoB,CAAC;AAE5B,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,CAAC,MAAM,CAAC;IAChD,KAAK,EAAE,CAAC;SACL,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CACP,oEAAoE;QAClE,kEAAkE,CACrE;IACH,KAAK,EAAE,CAAC;SACL,IAAI,CAAC,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;SAC1B,QAAQ,EAAE;SACV,QAAQ,CACP,uEAAuE;QACrE,sEAAsE;QACtE,+DAA+D;QAC/D,oBAAoB,CACvB;IACH,QAAQ,EAAE,CAAC;SACR,IAAI,CAAC,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC;SAC7B,QAAQ,EAAE;SACV,QAAQ,CACP,qEAAqE;QACnE,qEAAqE;QACrE,kEAAkE;QAClE,mEAAmE;QACnE,gCAAgC,CACnC;IACH,KAAK,EAAE,CAAC;SACL,MAAM,EAAE;SACR,GAAG,EAAE;SACL,GAAG,CAAC,CAAC,CAAC;SACN,GAAG,CAAC,EAAE,CAAC;SACP,QAAQ,EAAE;SACV,QAAQ,CAAC,wDAAwD,CAAC;IACrE;;;;;;;;;;;OAWG;IACH,aAAa,EAAE,CAAC;SACb,MAAM,EAAE;SACR,GAAG,EAAE;SACL,QAAQ,EAAE;SACV,QAAQ,CACP,8DAA8D;QAC5D,oEAAoE;QACpE,sEAAsE;QACtE,sDAAsD;QACtD,sDAAsD,CACzD;IACH,aAAa,EAAE,CAAC;SACb,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CACP,uEAAuE;QACrE,uCAAuC,CAC1C;CACJ,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,wBAAwB,GACnC,
|
|
1
|
+
{"version":3,"file":"drive-search.contract.js","sourceRoot":"","sources":["../../src/tools/drive-search.contract.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,2BAA2B,GAG5B,MAAM,oBAAoB,CAAC;AAE5B,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,CAAC,MAAM,CAAC;IAChD,KAAK,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C;AAE5D,4EAA4E;AAC5E,MAAM,CAAC,MAAM,iBAAiB,GAC5B,yEAAyE;IACzE,4EAA4E;IAC5E,yEAAyE;IACzE,wEAAwE;IACxE,wEAAwE;IACxE,sCAAsC,CAAC;AAEzC,wEAAwE;AACxE,MAAM,UAAU,aAAa,CAAC,YAAoB,EAAE,SAAiB;IACnE,OAAO,CACL,oEAAoE;QACpE,+DAA+D;QAC/D,8BAA8B,SAAS,QAAQ,YAAY,MAAM;QACjE,0EAA0E;QAC1E,0EAA0E;QAC1E,wDAAwD,CACzD,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search.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;
|
|
1
|
+
{"version":3,"file":"search.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;AAalD,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,SAAS,EACjB,GAAG,EAAE,SAAS,GACb,IAAI,CAyTN"}
|
package/dist/tools/search.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { assertChangeHistoryComplete, assertEnrollmentComplete, isNotReady, notReadyToolResult, } from '../not-ready.js';
|
|
3
|
+
import { changeModelForFileType, documentChangesUnavailableToolResult, } from '../document-changes.js';
|
|
4
|
+
import { readDocumentChanges } from './document-changes-read.js';
|
|
3
5
|
export function registerSearchTool(server, api) {
|
|
4
6
|
server.registerTool('search_files', {
|
|
5
7
|
title: 'Search Files',
|
|
@@ -93,17 +95,29 @@ export function registerSearchTool(server, api) {
|
|
|
93
95
|
});
|
|
94
96
|
server.registerTool('get_unattributed_changes', {
|
|
95
97
|
title: 'Get Unattributed Changes',
|
|
96
|
-
description: 'Get
|
|
97
|
-
'
|
|
98
|
+
description: 'Get the changes made since the last saved version. Works on ' +
|
|
99
|
+
'workbooks, Word documents and PowerPoint decks. ' +
|
|
100
|
+
// ENG-5397 — the shape of the answer differs by file kind, and a
|
|
101
|
+
// caller that assumes cells will mis-describe a document.
|
|
102
|
+
'A workbook answers with cell changes; a Word document answers with ' +
|
|
103
|
+
'paragraph changes; a deck answers with shape changes, each naming ' +
|
|
104
|
+
'the slide it is on. ' +
|
|
105
|
+
'Two modes for a workbook: (1) provide `sheetName` to get ' +
|
|
98
106
|
'every change on a single worksheet (no pagination — bounded by ' +
|
|
99
107
|
'sheet size); (2) omit `sheetName` for the file-wide cursor-paginated ' +
|
|
100
108
|
'view (rows are capped per response with a summary line; pass `cursor` ' +
|
|
101
109
|
'returned by the previous call to fetch the next page). ' +
|
|
110
|
+
'`sheetName` and `cursor` apply to workbooks only. ' +
|
|
102
111
|
// Plan 02 ruling 5 — "No unattributed changes" is a factual claim, and
|
|
103
112
|
// it is only made after completeness is proven.
|
|
104
113
|
'Answers CHANGE_HISTORY_NOT_READY (isError) while Rockhopper is still ' +
|
|
105
114
|
"computing this file's changes. That is NOT \"no changes\" — retry " +
|
|
106
|
-
'after the stated interval instead of reporting an absence.'
|
|
115
|
+
'after the stated interval instead of reporting an absence. ' +
|
|
116
|
+
// ENG-5397 — the refusal this tool used to answer as an empty list.
|
|
117
|
+
'Answers DOCUMENT_CHANGES_UNAVAILABLE (isError) when a change list ' +
|
|
118
|
+
'cannot be produced for this file at all. That is also NOT "no ' +
|
|
119
|
+
'changes": say the list is unavailable and offer to compare two ' +
|
|
120
|
+
'versions instead. Never report a file as unchanged on either answer.',
|
|
107
121
|
inputSchema: z.object({
|
|
108
122
|
fileMsId: z.string().describe('Platform ID of the enrolled file'),
|
|
109
123
|
sheetName: z
|
|
@@ -126,6 +140,30 @@ export function registerSearchTool(server, api) {
|
|
|
126
140
|
},
|
|
127
141
|
}, async ({ fileMsId, sheetName, cursor }) => {
|
|
128
142
|
try {
|
|
143
|
+
// ENG-5397 — WHICH CHANGE MODEL, before which reader. The two lanes
|
|
144
|
+
// below are spreadsheet-only: `unattributed_change` requires a
|
|
145
|
+
// `sheetName` and the sheet route also filters `changeType = 'cell'`,
|
|
146
|
+
// so a Word document or a deck returned `[]` from them by
|
|
147
|
+
// construction and the tool printed "No unattributed changes found".
|
|
148
|
+
// Routing on the file's own type is what makes an absence mean
|
|
149
|
+
// something.
|
|
150
|
+
const file = await api.getEnrolledFile(fileMsId);
|
|
151
|
+
const model = changeModelForFileType(file.fileType);
|
|
152
|
+
if (model === null) {
|
|
153
|
+
return documentChangesUnavailableToolResult({
|
|
154
|
+
reason: 'unknown_file_type',
|
|
155
|
+
fileMsId,
|
|
156
|
+
fileName: file.name,
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
if (model !== 'spreadsheet') {
|
|
160
|
+
return await readDocumentChanges(api, {
|
|
161
|
+
fileMsId,
|
|
162
|
+
sheetName,
|
|
163
|
+
fileType: file.fileType,
|
|
164
|
+
fileName: file.name,
|
|
165
|
+
});
|
|
166
|
+
}
|
|
129
167
|
// Plan 02 ruling 5 (STRICT): gate BOTH modes. The commit-diff fold
|
|
130
168
|
// retracts and rewrites the uncommitted window, so a pending fold
|
|
131
169
|
// means this list is mid-rewrite in either shape.
|
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,wBAAwB,EACxB,UAAU,EACV,kBAAkB,GACnB,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"search.js","sourceRoot":"","sources":["../../src/tools/search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C,CAAC,GAAG,CAAC,CAAC,CAAC;IAC9D,CAAC;IACD,OAAO,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"write-versions.d.ts","sourceRoot":"","sources":["../../src/tools/write-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":"write-versions.d.ts","sourceRoot":"","sources":["../../src/tools/write-versions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAE9D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAuBlD,wBAAgB,yBAAyB,CACvC,MAAM,EAAE,SAAS,EACjB,GAAG,EAAE,SAAS,GACb,IAAI,CAmLN"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { formatVersion } from '../version-format.js';
|
|
3
|
+
import { noChangeRowsRecordedToolResult, recordsChangeRows, } from '../no-change-rows-recorded.js';
|
|
3
4
|
function bumpVersion(major, minor, patch, type) {
|
|
4
5
|
switch (type) {
|
|
5
6
|
case 'major':
|
|
@@ -37,6 +38,13 @@ export function registerWriteVersionTools(server, api) {
|
|
|
37
38
|
try {
|
|
38
39
|
const file = await api.getEnrolledFile(fileMsId);
|
|
39
40
|
if (!file.hasUncommittedChanges) {
|
|
41
|
+
// ENG-5410 — nested INSIDE the existing refusal on purpose, mirroring
|
|
42
|
+
// ENG-5073's permissive-only rule: a file whose flag is set still
|
|
43
|
+
// proceeds, so this can only ever change the WORDS of a refusal that
|
|
44
|
+
// was already happening, never turn a working write into a refusal.
|
|
45
|
+
if (!recordsChangeRows(file.fileType)) {
|
|
46
|
+
return noChangeRowsRecordedToolResult(file.name, file.fileType, 'commit');
|
|
47
|
+
}
|
|
40
48
|
return {
|
|
41
49
|
content: [
|
|
42
50
|
{
|
|
@@ -109,6 +117,17 @@ export function registerWriteVersionTools(server, api) {
|
|
|
109
117
|
try {
|
|
110
118
|
const file = await api.getEnrolledFile(fileMsId);
|
|
111
119
|
if (!file.hasUncommittedChanges) {
|
|
120
|
+
// ENG-5410 — the create leg's twin, same predicate, same nesting.
|
|
121
|
+
// The BACKEND discard leg switches its equivalent refusal on a
|
|
122
|
+
// broader gate (`DiscardNoOpReason.NO_CHANGE_DETECTION_FOR_DOCUMENT_
|
|
123
|
+
// TYPE`, ENG-3654, which also admits a `.docx` and a `.pptx`). That
|
|
124
|
+
// gate is deliberately NOT copied here: a Microsoft document sets the
|
|
125
|
+
// flag and never reaches this branch, so widening the predicate would
|
|
126
|
+
// buy nothing and put a new negative claim one regression away from a
|
|
127
|
+
// file type ENG-4843 fixed.
|
|
128
|
+
if (!recordsChangeRows(file.fileType)) {
|
|
129
|
+
return noChangeRowsRecordedToolResult(file.name, file.fileType, 'discard');
|
|
130
|
+
}
|
|
112
131
|
return {
|
|
113
132
|
content: [
|
|
114
133
|
{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"write-versions.js","sourceRoot":"","sources":["../../src/tools/write-versions.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"write-versions.js","sourceRoot":"","sources":["../../src/tools/write-vers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OAAO,EAAE;oBACP;wBACE,IAAI,EAAE,MAAM;wBACZ,IAAI,EACF,0BAA0B,IAAI,CAAC,IAAI,MAAM;4BACzC,YAAY,WAAW,GAAG;qBAC7B;iBACF;aACF,CAAC;QACJ,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO;gBACL,OAAO,EAAE;oBACP;wBACE,IAAI,EAAE,MAAM;wBACZ,IAAI,EAAE,8BAA8B,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE;qBAC7F;iBACF;gBACD,OAAO,EAAE,IAAI;aACd,CAAC;QACJ,CAAC;IACH,CAAC,CACF,CAAC;AACJ,CAAC"}
|
package/dist/types.d.ts
CHANGED
|
@@ -476,6 +476,82 @@ export interface PaginatedUnattributedResponse {
|
|
|
476
476
|
snapshotId: string;
|
|
477
477
|
snapshotCreatedAt: string;
|
|
478
478
|
}
|
|
479
|
+
/**
|
|
480
|
+
* ENG-5397 — one paragraph (Word) or shape (PowerPoint) change, mirroring the
|
|
481
|
+
* backend's `DocumentChangeRowDto`
|
|
482
|
+
* (`backend/src/resources/cell-change-events/dto/document-changes-query.dto.ts`).
|
|
483
|
+
*
|
|
484
|
+
* Mirrored rather than imported for the reason every type in this file is: the
|
|
485
|
+
* package ships to customers over npm and cannot depend on the backend tree.
|
|
486
|
+
* Only the fields this client RENDERS are typed; the rest of the row is carried
|
|
487
|
+
* through by the schema's passthrough and ignored.
|
|
488
|
+
*/
|
|
489
|
+
export interface DocumentChangeRow {
|
|
490
|
+
/** The ledger event id — a stable key for the CHANGE. */
|
|
491
|
+
eventId: string;
|
|
492
|
+
/** `block` for a Word paragraph, `shape` for a PowerPoint shape. */
|
|
493
|
+
kind: string;
|
|
494
|
+
/**
|
|
495
|
+
* The containing slide's OPAQUE provider id, on a shape row. Null for a
|
|
496
|
+
* paragraph, which has no container.
|
|
497
|
+
*
|
|
498
|
+
* NOT A SLIDE NUMBER, and it must never be rendered as one: it is stable
|
|
499
|
+
* across a deck edit and carries no position. The backend's own contract says
|
|
500
|
+
* so, because `containerOrdinal` is null on every row either lane writes.
|
|
501
|
+
*/
|
|
502
|
+
containerProviderId: string | null;
|
|
503
|
+
/**
|
|
504
|
+
* The unit's OWN provider id — `w14:paraId` for a paragraph, the
|
|
505
|
+
* slide-namespaced shape id for a shape. Written on every row. This is the
|
|
506
|
+
* identity a caller follows across reads: `eventId` keys the CHANGE, this
|
|
507
|
+
* keys the THING that changed.
|
|
508
|
+
*/
|
|
509
|
+
anchorProviderId: string | null;
|
|
510
|
+
/** A human label for the unit where one is persisted — a shape name. */
|
|
511
|
+
anchorLabel: string | null;
|
|
512
|
+
/** The ledger's own event type: `block_edit`, `shape_insert`, and so on. */
|
|
513
|
+
changeKind: string;
|
|
514
|
+
/** The editor to PRESENT — null where the evidence is not an authorship claim. */
|
|
515
|
+
editorPlatformId: string | null;
|
|
516
|
+
occurredAt: string | null;
|
|
517
|
+
firstObservedAt: string;
|
|
518
|
+
/**
|
|
519
|
+
* The text before and after. BOTH SIDES ARE STORED — David ruled it on
|
|
520
|
+
* 2026-09-09 (*"update word (all text types) and powerpoint to store the
|
|
521
|
+
* values in the ledger"*) and ENG-4511 shipped it, so a row carries the words
|
|
522
|
+
* and not merely the fact that something moved.
|
|
523
|
+
*/
|
|
524
|
+
fromValue: {
|
|
525
|
+
v?: unknown;
|
|
526
|
+
f?: unknown;
|
|
527
|
+
} | null;
|
|
528
|
+
toValue: {
|
|
529
|
+
v?: unknown;
|
|
530
|
+
f?: unknown;
|
|
531
|
+
} | null;
|
|
532
|
+
/** True when THIS ROW's text was capped; the list's own cap is on the envelope. */
|
|
533
|
+
truncated: boolean;
|
|
534
|
+
}
|
|
535
|
+
/**
|
|
536
|
+
* `GET /cell-change-events/document-changes?fileMsId=…` — the document change
|
|
537
|
+
* lane, the read this client had no call for at all before ENG-5397.
|
|
538
|
+
*/
|
|
539
|
+
export interface DocumentChangesResponse {
|
|
540
|
+
rows: DocumentChangeRow[];
|
|
541
|
+
/** True when more servable rows exist than one page returns. No cursor exists. */
|
|
542
|
+
truncated: boolean;
|
|
543
|
+
/**
|
|
544
|
+
* Why the window was WITHHELD, or null when it was served.
|
|
545
|
+
*
|
|
546
|
+
* NON-NULL MEANS `rows` IS EMPTY BY REFUSAL, NOT BY ABSENCE, and the two must
|
|
547
|
+
* render differently — the backend's own DTO says a client MUST do this, and
|
|
548
|
+
* rendering a withheld window as "nothing changed" is the plausible zero this
|
|
549
|
+
* whole read exists to avoid.
|
|
550
|
+
*/
|
|
551
|
+
declineReason: string | null;
|
|
552
|
+
/** The window's opening boundary — the last committed version's creation time. */
|
|
553
|
+
windowStart: string;
|
|
554
|
+
}
|
|
479
555
|
/**
|
|
480
556
|
* KI-096: matches the backend's `?format=mcp` projection on cell-history
|
|
481
557
|
* (`GET /file-versions/file/:fileMsId/cell-history?format=mcp`, added by
|