revise 3.0.0 → 3.1.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.
@@ -20,6 +20,7 @@
20
20
  "read",
21
21
  "grep",
22
22
  "search",
23
+ "replace-all",
23
24
  "replace-text",
24
25
  "call",
25
26
  "tools",
@@ -148,10 +149,10 @@
148
149
  },
149
150
  {
150
151
  "if": {
151
- "$ref": "#/$defs/is-replace-text"
152
+ "$ref": "#/$defs/is-replace-all"
152
153
  },
153
154
  "then": {
154
- "$ref": "#/$defs/dataOf-replace-text"
155
+ "$ref": "#/$defs/dataOf-replace-all"
155
156
  }
156
157
  },
157
158
  {
@@ -572,10 +573,11 @@
572
573
  },
573
574
  "required": ["data"]
574
575
  },
575
- "is-replace-text": {
576
+ "is-replace-all": {
576
577
  "properties": {
577
578
  "command": {
578
- "const": "replace-text"
579
+ "enum": ["replace-all", "replace-text"],
580
+ "description": "replace-text is the 3.0 name, reported when a command is run under it."
579
581
  },
580
582
  "data": {
581
583
  "type": "object"
@@ -966,6 +968,25 @@
966
968
  }
967
969
  }
968
970
  },
971
+ "view": {
972
+ "enum": ["tracked", "accepted", "original"],
973
+ "description": "How pending tracked changes read: tracked shows them, accepted and original as if every one were accepted or rejected."
974
+ },
975
+ "grepMatch": {
976
+ "type": "object",
977
+ "required": ["text", "change", "changeId"],
978
+ "properties": {
979
+ "text": {
980
+ "type": "string"
981
+ },
982
+ "change": {
983
+ "enum": ["inserted", "deleted", null]
984
+ },
985
+ "changeId": {
986
+ "type": ["string", "null"]
987
+ }
988
+ }
989
+ },
969
990
  "dataOf-grep": {
970
991
  "properties": {
971
992
  "data": {
@@ -975,6 +996,7 @@
975
996
  "pattern",
976
997
  "regex",
977
998
  "ignoreCase",
999
+ "view",
978
1000
  "matchCount",
979
1001
  "blocks"
980
1002
  ],
@@ -991,6 +1013,9 @@
991
1013
  "ignoreCase": {
992
1014
  "type": "boolean"
993
1015
  },
1016
+ "view": {
1017
+ "$ref": "#/$defs/view"
1018
+ },
994
1019
  "matchCount": {
995
1020
  "$ref": "#/$defs/count"
996
1021
  },
@@ -998,7 +1023,13 @@
998
1023
  "type": "array",
999
1024
  "items": {
1000
1025
  "type": "object",
1001
- "required": ["blockId", "blockIndex", "matchCount", "text"],
1026
+ "required": [
1027
+ "blockId",
1028
+ "blockIndex",
1029
+ "matchCount",
1030
+ "text",
1031
+ "matches"
1032
+ ],
1002
1033
  "properties": {
1003
1034
  "blockId": {
1004
1035
  "type": "string"
@@ -1011,6 +1042,12 @@
1011
1042
  },
1012
1043
  "text": {
1013
1044
  "type": "string"
1045
+ },
1046
+ "matches": {
1047
+ "type": "array",
1048
+ "items": {
1049
+ "$ref": "#/$defs/grepMatch"
1050
+ }
1014
1051
  }
1015
1052
  }
1016
1053
  }
@@ -1057,12 +1094,47 @@
1057
1094
  },
1058
1095
  "result": {
1059
1096
  "description": "The tool's own result; see revise tools <name>."
1097
+ },
1098
+ "view": {
1099
+ "$ref": "#/$defs/view",
1100
+ "description": "read and search: the view html and matches show. Absent for other tools."
1101
+ },
1102
+ "viewMatches": {
1103
+ "description": "search: blocks the search tool can't see in this view. Tracked: matches inside deleted text. Original: every match in the original text (no search_result_id).",
1104
+ "type": "array",
1105
+ "items": {
1106
+ "type": "object",
1107
+ "required": [
1108
+ "query",
1109
+ "blockId",
1110
+ "blockIndex",
1111
+ "text",
1112
+ "changeIds"
1113
+ ],
1114
+ "properties": {
1115
+ "query": {
1116
+ "type": "string"
1117
+ },
1118
+ "blockId": {
1119
+ "type": "string"
1120
+ },
1121
+ "blockIndex": {
1122
+ "$ref": "#/$defs/count"
1123
+ },
1124
+ "text": {
1125
+ "type": "string"
1126
+ },
1127
+ "changeIds": {
1128
+ "$ref": "#/$defs/strings"
1129
+ }
1130
+ }
1131
+ }
1060
1132
  }
1061
1133
  }
1062
1134
  }
1063
1135
  }
1064
1136
  },
1065
- "dataOf-replace-text": {
1137
+ "dataOf-replace-all": {
1066
1138
  "properties": {
1067
1139
  "data": {
1068
1140
  "type": "object",
@@ -1072,6 +1144,8 @@
1072
1144
  "replace",
1073
1145
  "matchedBlockIds",
1074
1146
  "replacedOccurrences",
1147
+ "regions",
1148
+ "nearMisses",
1075
1149
  "changeIds",
1076
1150
  "failures",
1077
1151
  "saved",
@@ -1094,6 +1168,31 @@
1094
1168
  "replacedOccurrences": {
1095
1169
  "$ref": "#/$defs/count"
1096
1170
  },
1171
+ "regions": {
1172
+ "type": "object",
1173
+ "description": "Occurrences replaced per part of the document; parts with none are left out.",
1174
+ "properties": {
1175
+ "body": { "$ref": "#/$defs/count" },
1176
+ "header": { "$ref": "#/$defs/count" },
1177
+ "footer": { "$ref": "#/$defs/count" },
1178
+ "footnote": { "$ref": "#/$defs/count" },
1179
+ "endnote": { "$ref": "#/$defs/count" }
1180
+ },
1181
+ "additionalProperties": false
1182
+ },
1183
+ "nearMisses": {
1184
+ "type": "array",
1185
+ "description": "Text that looser matching would have replaced: other capitalization (--ignore-case) or other quotes and spaces (without --exact).",
1186
+ "items": {
1187
+ "type": "object",
1188
+ "required": ["text", "count", "reason"],
1189
+ "properties": {
1190
+ "text": { "type": "string" },
1191
+ "count": { "$ref": "#/$defs/count" },
1192
+ "reason": { "enum": ["case", "characters"] }
1193
+ }
1194
+ }
1195
+ },
1097
1196
  "changeIds": {
1098
1197
  "$ref": "#/$defs/strings"
1099
1198
  },
@@ -1204,6 +1303,9 @@
1204
1303
  "section": {
1205
1304
  "type": ["string", "null"]
1206
1305
  },
1306
+ "blocks": {
1307
+ "type": ["string", "null"]
1308
+ },
1207
1309
  "trackedChangeCount": {
1208
1310
  "$ref": "#/$defs/count"
1209
1311
  },
@@ -1505,6 +1607,9 @@
1505
1607
  "final": {
1506
1608
  "type": "boolean"
1507
1609
  },
1610
+ "view": {
1611
+ "$ref": "#/$defs/view"
1612
+ },
1508
1613
  "trackedChangeCount": {
1509
1614
  "type": ["integer", "null"],
1510
1615
  "minimum": 0,
@@ -1719,6 +1824,9 @@
1719
1824
  },
1720
1825
  "final": {
1721
1826
  "type": "boolean"
1827
+ },
1828
+ "view": {
1829
+ "$ref": "#/$defs/view"
1722
1830
  }
1723
1831
  }
1724
1832
  }