@attentionform/astra-mcp-server 0.2.1 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +120 -52
- package/README.md +14 -8
- package/dist/index.js +3682 -1997
- package/dist/lib/mcp/diff.d.ts +1 -0
- package/dist/lib/mcp/handlers/open-inspect.d.ts +2 -0
- package/dist/lib/mcp/handlers/parity.d.ts +7 -0
- package/dist/lib/mcp/handlers/search-batch.d.ts +25 -1
- package/dist/lib/mcp/schema-dump.d.ts +3 -0
- package/dist/lib/mcp/schemas.d.ts +24 -4
- package/package.json +3 -3
package/LICENSE
CHANGED
|
@@ -7,12 +7,10 @@ License text copyright (c) 2017 MariaDB Corporation Ab, All Rights Reserved.
|
|
|
7
7
|
|
|
8
8
|
Parameters
|
|
9
9
|
|
|
10
|
-
Licensor: Attentionform, the publisher of ASTra,
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
attentionform.com, together with its successors and
|
|
15
|
-
assigns.
|
|
10
|
+
Licensor: Attentionform, the publisher of ASTra, identified by
|
|
11
|
+
the GitHub organization github.com/Attentionform and
|
|
12
|
+
the domain attentionform.com, together with its
|
|
13
|
+
successors and assigns.
|
|
16
14
|
|
|
17
15
|
Licensed Work: ASTra: the engine, command-line tool, MCP server and
|
|
18
16
|
OOXML validator in this repository, in each version
|
|
@@ -32,15 +30,23 @@ Additional Use Grant: You may make production use of the Licensed Work, free of
|
|
|
32
30
|
use requires a commercial license from the Licensor.
|
|
33
31
|
|
|
34
32
|
"Individual Use" means use by a natural person on his or
|
|
35
|
-
her own account, including as a freelancer or consultant
|
|
36
|
-
|
|
37
|
-
no employees
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
Licensed Work
|
|
43
|
-
|
|
33
|
+
her own account, including as a freelancer or consultant.
|
|
34
|
+
It includes use through a business entity only if the
|
|
35
|
+
entity has no employees and, together with its affiliates,
|
|
36
|
+
is within both limits of Small Business Use, tested in the
|
|
37
|
+
same way. Contractors engaged for a specific project are
|
|
38
|
+
not employees. Individual Use does not include use for the
|
|
39
|
+
internal operations of an employer or of a client. Running
|
|
40
|
+
the Licensed Work as a continuing service or pipeline for
|
|
41
|
+
the internal operations of another organization is that
|
|
42
|
+
organization's use, on whatever systems it runs, unless it
|
|
43
|
+
is part of a product or service of Your own described in
|
|
44
|
+
the paragraph on products below. Using the Licensed Work
|
|
45
|
+
to prepare documents or other deliverables for clients,
|
|
46
|
+
one job at a time, is Individual Use. A sole
|
|
47
|
+
proprietorship with no employees is the natural person
|
|
48
|
+
who owns it, and its use is Individual Use. Individual
|
|
49
|
+
Use never includes a Competing Offering.
|
|
44
50
|
|
|
45
51
|
"Educational and Research Use" means use by an accredited
|
|
46
52
|
school, college or university, or by its students and
|
|
@@ -72,49 +78,111 @@ Additional Use Grant: You may make production use of the Licensed Work, free of
|
|
|
72
78
|
Any organization that is not described in Individual Use,
|
|
73
79
|
Educational and Research Use, Non-Profit Use or
|
|
74
80
|
Public-Sector Use, including a company, partnership or
|
|
75
|
-
other business with employees and any
|
|
76
|
-
government-controlled enterprise, is a
|
|
77
|
-
Organization". Production use by or for a
|
|
78
|
-
Organization requires a commercial license
|
|
79
|
-
Small Business Use.
|
|
81
|
+
other business (with or without employees) and any
|
|
82
|
+
state-owned or government-controlled enterprise, is a
|
|
83
|
+
"For-Profit Organization". Production use by or for a
|
|
84
|
+
For-Profit Organization requires a commercial license
|
|
85
|
+
unless it is Small Business Use.
|
|
80
86
|
|
|
81
87
|
"Small Business Use" means use by a For-Profit
|
|
82
|
-
Organization that,
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
or that has not yet completed a
|
|
86
|
-
reasonably expects to meet both limits in
|
|
87
|
-
The people working
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
or
|
|
88
|
+
Organization that, counting its affiliates together with
|
|
89
|
+
it, had in its last completed fiscal year both (a) total
|
|
90
|
+
gross revenue below USD 1,000,000 and (b) fewer than 10
|
|
91
|
+
people working for it, or that has not yet completed a
|
|
92
|
+
fiscal year and reasonably expects to meet both limits in
|
|
93
|
+
its first one. The people working
|
|
94
|
+
for it are its employees, its owners and partners who work
|
|
95
|
+
in it, and the individuals who work for it on a regular
|
|
96
|
+
basis as contractors, counted as individuals and not as
|
|
97
|
+
companies. Revenue in another currency is converted into
|
|
98
|
+
US dollars at the exchange rate on the last day of the
|
|
99
|
+
fiscal year. An "affiliate" is any entity that controls,
|
|
100
|
+
is controlled by, or is under common control with another
|
|
101
|
+
entity. "Control" means owning more than 50% of the voting
|
|
102
|
+
interests of an entity, or having the power, by contract
|
|
103
|
+
or otherwise, to direct its management or policies.
|
|
104
|
+
Customary minority-investor rights, such as a board seat
|
|
105
|
+
or consent rights over a financing or a sale of the
|
|
106
|
+
company, held with 50% or less of the voting interests,
|
|
107
|
+
are not control, and companies that share only such an
|
|
108
|
+
investor are not under common control.
|
|
109
|
+
Entities that are controlled by the same person, or by
|
|
110
|
+
persons acting together, are under common control. An
|
|
111
|
+
arrangement whose main purpose is to bring an organization
|
|
112
|
+
within a category above, or to keep it under the limits of
|
|
113
|
+
Small Business Use, is disregarded.
|
|
114
|
+
|
|
115
|
+
Small Business Use includes using the Licensed Work as a
|
|
116
|
+
component of a product or service of Your own that has
|
|
117
|
+
substantial functionality beyond that of the Licensed
|
|
118
|
+
Work. Individual Use includes this only if Your business,
|
|
119
|
+
together with its affiliates, is within both limits of
|
|
120
|
+
Small Business Use, tested in the same way. A business
|
|
121
|
+
includes a sole proprietorship. A natural person's own
|
|
122
|
+
work, such as preparing reports or documents for
|
|
123
|
+
themselves or for clients, is not offering a product or
|
|
124
|
+
service to others, and these limits do not apply to it.
|
|
125
|
+
Your customers and users may use the Licensed Work only
|
|
126
|
+
as part of that product or service. If the Licensed Work
|
|
127
|
+
is not delivered as part of Your product, for example
|
|
128
|
+
because users install it themselves, each user's use of
|
|
129
|
+
it is governed by that user's own category. A product or
|
|
130
|
+
service includes software that You make available free
|
|
131
|
+
of charge.
|
|
132
|
+
|
|
133
|
+
No category above includes a Competing Offering, which
|
|
134
|
+
always requires a commercial license. A "Competing
|
|
135
|
+
Offering" is a product or service offered to third parties
|
|
136
|
+
whose value consists mainly of the functionality of the
|
|
137
|
+
Licensed Work. It includes hosting the Licensed Work as a
|
|
138
|
+
service for others; making the operations, commands, API
|
|
139
|
+
or tools of the Licensed Work available to third parties
|
|
140
|
+
as a service in itself, directly or through a thin
|
|
141
|
+
interface, for example through a public API or MCP
|
|
142
|
+
endpoint whose main purpose is access to the Licensed
|
|
143
|
+
Work; a desktop, web or other editor or application whose
|
|
144
|
+
value is mainly the document functionality of the
|
|
145
|
+
Licensed Work; and selling the Licensed Work, or a
|
|
146
|
+
product or service whose value is mainly the Licensed
|
|
147
|
+
Work, whether or not under another name. A product or
|
|
148
|
+
service is a Competing Offering if (a) most of what its
|
|
149
|
+
customers pay for, or use it for, is the document
|
|
150
|
+
functionality of the Licensed Work; (b) little of it
|
|
151
|
+
would remain without the Licensed Work, where an
|
|
152
|
+
interface, login, billing, prompts or similar layers
|
|
153
|
+
around the operations of the Licensed Work are not
|
|
154
|
+
features of its own; or (c) its main purpose is to let
|
|
155
|
+
third parties reach the operations, commands, API or
|
|
156
|
+
tools of the Licensed Work. A product or service that
|
|
157
|
+
uses the Licensed Work to implement substantial features
|
|
158
|
+
of its own is not a Competing Offering. This includes an
|
|
159
|
+
AI agent or an agent platform that uses the Licensed Work
|
|
160
|
+
as one of its tools: it is a product of Your own under
|
|
161
|
+
the paragraph above, and it needs a commercial license
|
|
162
|
+
once the limits of Small Business Use are reached.
|
|
163
|
+
|
|
164
|
+
You may copy, modify and redistribute the Licensed Work
|
|
165
|
+
free of charge, modified or not, provided that every copy
|
|
166
|
+
keeps this License and the copyright and license notices.
|
|
107
167
|
|
|
108
168
|
If You stop qualifying for a category above, You may
|
|
109
|
-
continue Your existing use for 90 days
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
of
|
|
169
|
+
continue Your existing use for 90 days, and must then
|
|
170
|
+
obtain a commercial license or stop. For Small Business
|
|
171
|
+
Use, You stop qualifying on the first day after the
|
|
172
|
+
fiscal year in which You passed a limit. This does not
|
|
173
|
+
apply to an organization that stopped qualifying because
|
|
174
|
+
of an arrangement that is disregarded above.
|
|
175
|
+
|
|
176
|
+
"Production use" means any use of the Licensed Work other
|
|
177
|
+
than non-production use, including making it part of a
|
|
178
|
+
product or service that You provide to others.
|
|
115
179
|
Non-production use (including evaluation, development,
|
|
116
180
|
testing and demonstration) is permitted by this License
|
|
117
|
-
without any category.
|
|
181
|
+
without any category. Use is not non-production use merely
|
|
182
|
+
because it is called a pilot, test or staging use:
|
|
183
|
+
processing an organization's real documents as part of its
|
|
184
|
+
regular operations is production use, however the
|
|
185
|
+
environment is named. Documents and other output that You
|
|
118
186
|
create with the Licensed Work belong to You, and this
|
|
119
187
|
License places no restriction on them.
|
|
120
188
|
|
package/README.md
CHANGED
|
@@ -132,7 +132,7 @@ Opens a `.docx` file into an isolated in-memory editing session.
|
|
|
132
132
|
|---|---|:---:|---|
|
|
133
133
|
| `path` | `string` | Yes | Absolute path to `.docx` file inside an allowed directory. |
|
|
134
134
|
| `sessionId` | `string` | No | Server-minted session id (deprecated to supply; test-only). |
|
|
135
|
-
| `summaryOnly` | `boolean` | No |
|
|
135
|
+
| `summaryOnly` | `boolean` | No | Omitted or `true` returns a compact summary; `false` includes the full structural summary and styles XML. |
|
|
136
136
|
| `allowMacros` | `boolean` | No | Preserve macro parts byte-for-byte. |
|
|
137
137
|
| `stripMacros` | `boolean` | No | Strip macro parts upon loading. |
|
|
138
138
|
| `author` | `string` | No | Default author for tracked changes and comments in this session that do not name one (falls back to the server's `ASTRA_AUTHOR`, then `ASTra`). An operation's own `author` wins. |
|
|
@@ -152,11 +152,16 @@ Inspects document structure using Token-Optimized Outline Notation (TOON).
|
|
|
152
152
|
| `fidelity` | `string` | No | `"compact"` (default), `"standard"`, or `"full"`. |
|
|
153
153
|
| `sectionId` | `string` | No | Restrict outline to a specific section. |
|
|
154
154
|
| `maxTextLength` | `number` | No | Truncate run text at character limit. |
|
|
155
|
-
| `offset` | `number` | No | Pagination start row (default: 0). |
|
|
156
|
-
| `limit` | `number` | No | Maximum rows to return (default: 50, max: 200). |
|
|
155
|
+
| `offset` | `number` | No | Pagination start row for document nodes only (default: 0). An offset past the last node is rejected. |
|
|
156
|
+
| `limit` | `number` | No | Maximum node rows to return (default: 50, max: 200). |
|
|
157
157
|
| `aroundNode` | `string` | No | Node ID to center the inspection window around. |
|
|
158
158
|
| `window` | `number` | No | Half-width of rows around `aroundNode` (default: 5). |
|
|
159
159
|
| `maxTokens` | `number` | No | Token budget cutoff on clean row boundary (200–8000). |
|
|
160
|
+
| `include` | `array` | No | Optional review records to include: `["comments"]`, `["revisions"]`, or both. |
|
|
161
|
+
| `reviewOffset` | `number` | No | Start record for the `include` lists (default: 0). Pages comments and revisions without moving the node window. |
|
|
162
|
+
| `reviewLimit` | `number` | No | Records per `include` list (default: 50; values above 50 are clamped to 50). |
|
|
163
|
+
| `commentId` | `number` | No | Specific comment ID to inspect. Needs `include:["comments"]`. |
|
|
164
|
+
| `revisionId` | `number` | No | Specific tracked revision ID to inspect. Needs `include:["revisions"]`. |
|
|
160
165
|
|
|
161
166
|
**Returns:** `{ ok: true, sessionId, revision, fidelity, palette, toonText, rowCount }`
|
|
162
167
|
|
|
@@ -171,8 +176,9 @@ Fast text search returning matching stable node IDs and text snippets.
|
|
|
171
176
|
| `sessionId` | `string` | Yes | Active session identifier. |
|
|
172
177
|
| `query` | `string` | Yes | Search query string (1–500 characters). |
|
|
173
178
|
| `regex` | `boolean` | No | Treat query as regular expression (default: `false`). |
|
|
179
|
+
| `scope` | `string` | No | Search scope: `"body"` (default), `"comments"`, or `"all"`. |
|
|
174
180
|
|
|
175
|
-
**Returns:** `{ ok: true, sessionId, matches: [{ id, preview, cells? }] }`. A table hit lists `cells`, up to five cell addresses such as `t_001:r3c1`, that you can pass as the `target` of `replace`, `style`, `namedStyle`, `clearFormat`, `hyperlink`, `bookmark` or `comment`. Cell addresses are `<tableId>:r<row>c<col>`, 1-based as `inspect_document` prints the grid (add `:p<n>` for a cell with several paragraphs).
|
|
181
|
+
**Returns:** `{ ok: true, sessionId, matches: [{ id, preview, cells? }], truncated? }`. At most 50 matches are returned; `truncated: true` says more exist. A table hit lists `cells`, up to five cell addresses such as `t_001:r3c1`, that you can pass as the `target` of `replace`, `style`, `namedStyle`, `clearFormat`, `hyperlink`, `bookmark` or `comment`. Cell addresses are `<tableId>:r<row>c<col>`, 1-based as `inspect_document` prints the grid (add `:p<n>` for a cell with several paragraphs).
|
|
176
182
|
|
|
177
183
|
---
|
|
178
184
|
|
|
@@ -190,7 +196,7 @@ Executes an atomic array of typed operations with schema validation and rollback
|
|
|
190
196
|
| `allowedDir` | `string` | No | Jail directory for image `filePath` reads. |
|
|
191
197
|
| `styleGuide` | `string` | No | Per-batch style guide override (name or `.md` path). |
|
|
192
198
|
|
|
193
|
-
**Returns:** `{ ok: true, sessionId, appliedCount, revision, createdNodeIds }`
|
|
199
|
+
**Returns:** `{ ok: true, sessionId, appliedCount, revision, createdNodeIds, revisionsPending, revisionsUnresolved?, revisionsRemedy?, revisionResolution? }`. `revisionsPending` counts every revision element left (a move counts as each of its markers). After a `trackedChange` that left revisions it could not resolve, `revisionsUnresolved` counts them and `revisionsRemedy` lists kind, node and reason instead of repeating `acceptAll`. `revisionResolution` also lists `removedBookmarks`, `removedComments` and `staleLinks` when a removed paragraph carried them.
|
|
194
200
|
|
|
195
201
|
---
|
|
196
202
|
|
|
@@ -404,7 +410,7 @@ Token-cheap document census returning word, paragraph, table, image, and page co
|
|
|
404
410
|
---
|
|
405
411
|
|
|
406
412
|
### `sanitize_document`
|
|
407
|
-
Scrub metadata, revision IDs, authors,
|
|
413
|
+
Scrub metadata, revision IDs, authors, and PII from a document session. Tracked changes and comments are kept, with the text of every tracked deletion, unless you pass `acceptAllRevisions` or `stripComments`. The CLI presets (bare `sanitize`, `--client-safe`, `--metadata-only`, `--redact-pii`) turn both on; this tool does not. The CLI flags `--keep-revisions` and `--keep-comments` give a CLI run the same keep behaviour as this tool's default.
|
|
408
414
|
|
|
409
415
|
**Parameters:**
|
|
410
416
|
| Parameter | Type | Required | Description |
|
|
@@ -415,8 +421,8 @@ Scrub metadata, revision IDs, authors, comments, and PII from a document session
|
|
|
415
421
|
| `purgeAuthors` | `boolean` | No | Strip author identity metadata. |
|
|
416
422
|
| `purgeExif` | `boolean` | No | Strip metadata and EXIF profiles from embedded images. |
|
|
417
423
|
| `purgePII` | `boolean` | No | Redact potential PII patterns from text and comments. |
|
|
418
|
-
| `acceptAllRevisions` | `boolean` | No | Accept all tracked changes before scrubbing. |
|
|
419
|
-
| `stripComments` | `boolean` | No | Remove all comments and comment
|
|
424
|
+
| `acceptAllRevisions` | `boolean` | No | Accept all tracked changes before scrubbing. Refuses with `E_VALIDATION` (no file) when revision markup remains that cannot be resolved, or when a comment thread of a deleted paragraph is also anchored outside it (add `stripComments`). Comments of accepted deleted paragraphs are removed. |
|
|
425
|
+
| `stripComments` | `boolean` | No | Remove all comments, comment references and every comment part (including comment IDs and timestamps). |
|
|
420
426
|
| `replacementAuthor` | `string` | No | Author replacement string (≤ 256 chars). |
|
|
421
427
|
| `allowMacros` | `boolean` | No | Preserve macro parts byte-for-byte during scrub. |
|
|
422
428
|
| `stripMacros` | `boolean` | No | Strip macro parts during scrub. |
|