@attentionform/astra-mcp-server 0.2.0 → 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.
@@ -0,0 +1,10 @@
1
+ import { type DocumentAST, type DocxParser } from '@attentionform/astra-engine';
2
+ /**
3
+ * Give a serialization fork the live numbering, including its original part
4
+ * metadata. The engine uses the source hashes to retain untouched bytes and
5
+ * the root attributes/extra children when definitions really have changed.
6
+ * Clone every numbering element and source record so fork serialization cannot
7
+ * change the session. Pass only numbering/relationships on purpose: the bare
8
+ * rezip path reads only those fields and must not receive other live AST data.
9
+ */
10
+ export declare function adoptForkNumbering(fork: DocxParser, ast: DocumentAST): void;
@@ -160,6 +160,7 @@ export declare function hashDocumentXml(xml: string): string;
160
160
  * for the save path (which does not go through executeBatch).
161
161
  */
162
162
  export declare function countPendingRevisionsInParser(parser: {
163
+ countPackageRevisions?: () => number;
163
164
  getDocumentDom?: () => unknown;
164
165
  getDom?: () => unknown;
165
166
  }): number;
@@ -68,4 +68,6 @@ export declare function handleInspectDocument(store: McpSessionStore, input: unk
68
68
  remedy?: string;
69
69
  /** Compact summary of the session style guide (absent when none attached). */
70
70
  styleGuide?: StyleGuideSummary;
71
+ comments?: unknown;
72
+ revisions?: unknown;
71
73
  } | McpErrorShape>;
@@ -57,6 +57,13 @@ export interface SanitizeDocumentOk {
57
57
  piiCoverage: typeof PII_COVERAGE;
58
58
  piiNote: string;
59
59
  acceptedRevisions: number;
60
+ unresolvedRevisions: {
61
+ kind: string;
62
+ count: number;
63
+ reason: string;
64
+ part: string;
65
+ }[];
66
+ revisionByKind: Record<string, number>;
60
67
  strippedComments: number;
61
68
  strippedMacros: string[];
62
69
  macroParts: string[];
@@ -24,6 +24,8 @@ export declare function handleSearchContent(store: McpSessionStore, input: unkno
24
24
  cells?: string[];
25
25
  }>;
26
26
  hint?: string;
27
+ /** True when more than 50 items matched and the list was cut at 50. */
28
+ truncated?: boolean;
27
29
  } | McpErrorShape>;
28
30
  export declare function handleExecuteBatch(store: McpSessionStore, input: unknown): Promise<{
29
31
  ok: true;
@@ -39,8 +41,30 @@ export declare function handleExecuteBatch(store: McpSessionStore, input: unknow
39
41
  results: BatchOpCreatedIds[];
40
42
  /** R-1: pending tracked revisions (w:ins + w:del) remaining after the batch. */
41
43
  revisionsPending: number;
42
- /** R-1: accept remedy, present only when revisionsPending > 0. */
44
+ revisionResolution?: {
45
+ resolved: number;
46
+ resolvedIds: number[];
47
+ byKind: Record<string, number>;
48
+ unresolved: {
49
+ kind: string;
50
+ count: number;
51
+ reason: string;
52
+ part: string;
53
+ }[];
54
+ removedNodeIds?: string[];
55
+ idsMayHaveChanged?: boolean;
56
+ /** Bookmarks, comment ids and links affected when a deleted or moved paragraph was removed. */
57
+ removedBookmarks?: string[];
58
+ removedComments?: number[];
59
+ staleLinks?: {
60
+ bookmark: string;
61
+ count: number;
62
+ }[];
63
+ };
64
+ /** R-1: remedy, present only when revisionsPending > 0. Names acceptAll only when running it can still help. */
43
65
  revisionsRemedy?: string;
66
+ /** FX-07: how many of revisionsPending the resolution in this batch could not resolve. Absent when none. */
67
+ revisionsUnresolved?: number;
44
68
  /** R-14: advisory chart stale body refs (same shape [{nodeId, preview}]). Additive, never a failure. */
45
69
  possiblyStaleBodyRefs: {
46
70
  nodeId: string;
@@ -7,6 +7,9 @@ export interface ToolDefinition {
7
7
  }
8
8
  export declare function getToolDefinitions(): ToolDefinition[];
9
9
  export declare function buildStamp(version: string): string;
10
+ /** The SDK defaults to inlining repeated Zod nodes. Use shared definitions for
11
+ * the published catalog while keeping the same Zod schemas for call validation. */
12
+ export declare function compactToolSchema(schema: unknown): Record<string, unknown>;
10
13
  export declare function generateSchemasToDir(targetDir: string, version?: string): {
11
14
  written: string[];
12
15
  count: number;
@@ -22,11 +22,24 @@ export declare const InspectDocumentSchema: z.ZodObject<{
22
22
  aroundNode: z.ZodOptional<z.ZodString>;
23
23
  window: z.ZodOptional<z.ZodNumber>;
24
24
  maxTokens: z.ZodOptional<z.ZodNumber>;
25
+ include: z.ZodOptional<z.ZodArray<z.ZodEnum<{
26
+ comments: "comments";
27
+ revisions: "revisions";
28
+ }>>>;
29
+ reviewOffset: z.ZodOptional<z.ZodNumber>;
30
+ reviewLimit: z.ZodOptional<z.ZodNumber>;
31
+ commentId: z.ZodOptional<z.ZodNumber>;
32
+ revisionId: z.ZodOptional<z.ZodNumber>;
25
33
  }, z.core.$strict>;
26
34
  export declare const SearchContentSchema: z.ZodObject<{
27
35
  sessionId: z.ZodString;
28
36
  query: z.ZodString;
29
37
  regex: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
38
+ scope: z.ZodOptional<z.ZodEnum<{
39
+ comments: "comments";
40
+ body: "body";
41
+ all: "all";
42
+ }>>;
30
43
  }, z.core.$strict>;
31
44
  export declare const ExecuteBatchSchema: z.ZodObject<{
32
45
  sessionId: z.ZodString;
@@ -77,8 +90,8 @@ export declare const ExecuteBatchSchema: z.ZodObject<{
77
90
  widthEmu: z.ZodOptional<z.ZodNumber>;
78
91
  heightEmu: z.ZodOptional<z.ZodNumber>;
79
92
  chartType: z.ZodOptional<z.ZodEnum<{
80
- line: "line";
81
93
  area: "area";
94
+ line: "line";
82
95
  bar: "bar";
83
96
  column: "column";
84
97
  columnStacked: "columnStacked";
@@ -557,8 +570,8 @@ export declare const ExecuteBatchSchema: z.ZodObject<{
557
570
  }>>;
558
571
  target: z.ZodOptional<z.ZodString>;
559
572
  chartType: z.ZodOptional<z.ZodEnum<{
560
- line: "line";
561
573
  area: "area";
574
+ line: "line";
562
575
  bar: "bar";
563
576
  column: "column";
564
577
  columnStacked: "columnStacked";
@@ -598,8 +611,8 @@ export declare const ExecuteBatchSchema: z.ZodObject<{
598
611
  b: "b";
599
612
  tr: "tr";
600
613
  t: "t";
601
- none: "none";
602
614
  r: "r";
615
+ none: "none";
603
616
  l: "l";
604
617
  }>>;
605
618
  overlay: z.ZodOptional<z.ZodBoolean>;
@@ -820,24 +833,31 @@ export declare const ExecuteBatchSchema: z.ZodObject<{
820
833
  }, z.core.$strict>, z.ZodObject<{
821
834
  action: z.ZodLiteral<"comment">;
822
835
  operation: z.ZodEnum<{
836
+ delete: "delete";
823
837
  insert: "insert";
824
838
  reply: "reply";
839
+ resolve: "resolve";
840
+ unresolve: "unresolve";
825
841
  }>;
826
842
  target: z.ZodString;
827
- text: z.ZodString;
843
+ text: z.ZodOptional<z.ZodString>;
828
844
  author: z.ZodOptional<z.ZodString>;
829
845
  date: z.ZodOptional<z.ZodString>;
830
846
  expectedVersion: z.ZodOptional<z.ZodNumber>;
831
847
  }, z.core.$strict>, z.ZodObject<{
832
848
  action: z.ZodLiteral<"trackedChange">;
833
849
  operation: z.ZodEnum<{
850
+ accept: "accept";
851
+ reject: "reject";
834
852
  delete: "delete";
835
853
  insert: "insert";
836
854
  acceptAll: "acceptAll";
837
855
  rejectAll: "rejectAll";
838
856
  }>;
857
+ ids: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
839
858
  target: z.ZodOptional<z.ZodString>;
840
859
  text: z.ZodOptional<z.ZodString>;
860
+ occurrence: z.ZodOptional<z.ZodNumber>;
841
861
  author: z.ZodOptional<z.ZodString>;
842
862
  date: z.ZodOptional<z.ZodString>;
843
863
  expectedVersion: z.ZodOptional<z.ZodNumber>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@attentionform/astra-mcp-server",
3
- "version": "0.2.0",
3
+ "version": "0.3.0",
4
4
  "description": "Official Model Context Protocol (MCP) server for ASTra document IDE",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -41,8 +41,8 @@
41
41
  "adm-zip-gate": "node ../../scripts/check-adm-zip-imports.mjs"
42
42
  },
43
43
  "dependencies": {
44
- "@attentionform/astra-engine": "^0.2.0",
45
- "@attentionform/ooxml-validator": "^0.2.0",
44
+ "@attentionform/astra-engine": "^0.3.0",
45
+ "@attentionform/ooxml-validator": "^0.3.0",
46
46
  "@modelcontextprotocol/sdk": "^1.32.2",
47
47
  "@xmldom/xmldom": "0.8.15",
48
48
  "adm-zip": "0.6.1",