runline 0.11.6 → 0.13.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.
Files changed (256) hide show
  1. package/dist/commands/actions.js +3 -1
  2. package/dist/core/engine.js +3 -0
  3. package/dist/index.d.ts +1 -1
  4. package/dist/plugin/api.d.ts +2 -1
  5. package/dist/plugin/types.d.ts +2 -0
  6. package/dist/plugins/_shared/googleSchemas.js +23 -0
  7. package/dist/plugins/actionNetwork/src/index.js +23 -0
  8. package/dist/plugins/activeCampaign/src/index.js +48 -0
  9. package/dist/plugins/adalo/src/index.js +5 -0
  10. package/dist/plugins/affinity/src/index.js +16 -0
  11. package/dist/plugins/agileCrm/src/index.js +15 -0
  12. package/dist/plugins/airtable/src/index.js +10 -0
  13. package/dist/plugins/airtop/src/index.js +24 -0
  14. package/dist/plugins/apiTemplateIo/src/index.js +4 -0
  15. package/dist/plugins/asana/src/index.js +22 -0
  16. package/dist/plugins/autopilot/src/index.js +11 -0
  17. package/dist/plugins/bambooHr/src/index.js +11 -0
  18. package/dist/plugins/bannerbear/src/index.js +4 -0
  19. package/dist/plugins/baserow/src/index.js +8 -0
  20. package/dist/plugins/beeminder/src/index.js +18 -0
  21. package/dist/plugins/bitly/src/index.js +3 -0
  22. package/dist/plugins/bitwarden/src/index.js +19 -0
  23. package/dist/plugins/box/src/index.js +11 -0
  24. package/dist/plugins/brandfetch/src/index.js +5 -0
  25. package/dist/plugins/brevo/src/index.js +15 -0
  26. package/dist/plugins/bubble/src/index.js +5 -0
  27. package/dist/plugins/chargebee/src/index.js +5 -0
  28. package/dist/plugins/circleci/src/index.js +3 -0
  29. package/dist/plugins/ciscoWebex/src/index.js +10 -0
  30. package/dist/plugins/clearbit/src/index.js +3 -0
  31. package/dist/plugins/clickup/src/index.js +61 -0
  32. package/dist/plugins/clockify/src/index.js +25 -0
  33. package/dist/plugins/cloudflare/src/index.js +4 -0
  34. package/dist/plugins/cockpit/src/index.js +5 -0
  35. package/dist/plugins/coda/src/index.js +18 -0
  36. package/dist/plugins/coingecko/src/index.js +10 -0
  37. package/dist/plugins/contentful/src/index.js +7 -0
  38. package/dist/plugins/convertkit/src/index.js +16 -0
  39. package/dist/plugins/copper/src/index.js +7 -0
  40. package/dist/plugins/cortex/src/index.js +4 -0
  41. package/dist/plugins/currents/src/index.js +22 -0
  42. package/dist/plugins/customerIo/src/index.js +9 -0
  43. package/dist/plugins/databricks/src/index.js +34 -0
  44. package/dist/plugins/deepl/src/index.js +2 -0
  45. package/dist/plugins/demio/src/index.js +4 -0
  46. package/dist/plugins/dhl/src/index.js +1 -0
  47. package/dist/plugins/discord/src/index.js +13 -0
  48. package/dist/plugins/discourse/src/index.js +16 -0
  49. package/dist/plugins/disqus/src/index.js +4 -0
  50. package/dist/plugins/docker/src/index.js +5 -0
  51. package/dist/plugins/drift/src/index.js +5 -0
  52. package/dist/plugins/dropbox/src/index.js +9 -0
  53. package/dist/plugins/dropcontact/src/index.js +2 -0
  54. package/dist/plugins/egoi/src/index.js +4 -0
  55. package/dist/plugins/elasticsearch/src/index.js +9 -0
  56. package/dist/plugins/emelia/src/index.js +9 -0
  57. package/dist/plugins/erpnext/src/index.js +5 -0
  58. package/dist/plugins/facebookGraph/src/index.js +1 -0
  59. package/dist/plugins/freshdesk/src/index.js +10 -0
  60. package/dist/plugins/freshservice/src/index.js +7 -0
  61. package/dist/plugins/freshworksCrm/src/index.js +7 -0
  62. package/dist/plugins/getresponse/src/index.js +5 -0
  63. package/dist/plugins/ghost/src/index.js +5 -0
  64. package/dist/plugins/github/src/index.js +37 -0
  65. package/dist/plugins/gitlab/src/index.js +17 -0
  66. package/dist/plugins/gmail/src/index.js +200 -184
  67. package/dist/plugins/gong/src/index.js +4 -0
  68. package/dist/plugins/googleAppsScript/src/index.js +98 -43
  69. package/dist/plugins/googleCalendar/src/index.js +329 -250
  70. package/dist/plugins/googleContacts/src/index.js +144 -145
  71. package/dist/plugins/googleDocs/src/documents.js +31 -38
  72. package/dist/plugins/googleDocs/src/formatting.js +51 -47
  73. package/dist/plugins/googleDocs/src/images.js +23 -26
  74. package/dist/plugins/googleDocs/src/shared.js +55 -0
  75. package/dist/plugins/googleDocs/src/structure.js +111 -123
  76. package/dist/plugins/googleDocs/src/tables.js +103 -154
  77. package/dist/plugins/googleDocs/src/tabs.js +27 -23
  78. package/dist/plugins/googleDocs/src/text.js +106 -136
  79. package/dist/plugins/googleDrive/src/index.js +461 -408
  80. package/dist/plugins/googleImage/src/index.js +14 -16
  81. package/dist/plugins/googleSheets/src/index.js +527 -339
  82. package/dist/plugins/googleSlides/src/index.js +92 -72
  83. package/dist/plugins/googleTasks/src/index.js +94 -92
  84. package/dist/plugins/gotify/src/index.js +3 -0
  85. package/dist/plugins/gotowebinar/src/index.js +20 -0
  86. package/dist/plugins/grafana/src/index.js +17 -0
  87. package/dist/plugins/graphql/src/index.js +2 -0
  88. package/dist/plugins/grist/src/index.js +4 -0
  89. package/dist/plugins/hackernews/src/index.js +6 -0
  90. package/dist/plugins/halopsa/src/index.js +5 -0
  91. package/dist/plugins/harvest/src/index.js +14 -0
  92. package/dist/plugins/helpscout/src/index.js +13 -0
  93. package/dist/plugins/highlevel/src/index.js +17 -0
  94. package/dist/plugins/homeAssistant/src/index.js +13 -0
  95. package/dist/plugins/hubspot/src/index.js +14 -0
  96. package/dist/plugins/humanticAi/src/index.js +3 -0
  97. package/dist/plugins/hunter/src/index.js +3 -0
  98. package/dist/plugins/intercom/src/index.js +10 -0
  99. package/dist/plugins/iterable/src/index.js +6 -0
  100. package/dist/plugins/jenkins/src/index.js +11 -0
  101. package/dist/plugins/jira/src/index.js +16 -0
  102. package/dist/plugins/keap/src/index.js +28 -0
  103. package/dist/plugins/kobotoolbox/src/index.js +17 -0
  104. package/dist/plugins/lemlist/src/index.js +15 -0
  105. package/dist/plugins/linear/src/attachments.js +6 -0
  106. package/dist/plugins/linear/src/comments.js +5 -0
  107. package/dist/plugins/linear/src/cycles.js +2 -0
  108. package/dist/plugins/linear/src/initiatives.js +5 -0
  109. package/dist/plugins/linear/src/issues.js +14 -0
  110. package/dist/plugins/linear/src/labels.js +5 -0
  111. package/dist/plugins/linear/src/organization.js +1 -0
  112. package/dist/plugins/linear/src/projects.js +11 -0
  113. package/dist/plugins/linear/src/shared.js +2 -0
  114. package/dist/plugins/linear/src/states.js +2 -0
  115. package/dist/plugins/linear/src/teams.js +3 -0
  116. package/dist/plugins/linear/src/users.js +2 -0
  117. package/dist/plugins/linear/src/views.js +4 -0
  118. package/dist/plugins/linear/src/webhooks.js +4 -0
  119. package/dist/plugins/lingvanex/src/index.js +1 -0
  120. package/dist/plugins/linkedin/src/index.js +1 -0
  121. package/dist/plugins/lonescale/src/index.js +4 -0
  122. package/dist/plugins/magento/src/index.js +15 -0
  123. package/dist/plugins/mailcheck/src/index.js +1 -0
  124. package/dist/plugins/mailchimp/src/index.js +14 -0
  125. package/dist/plugins/mailerlite/src/index.js +4 -0
  126. package/dist/plugins/mailgun/src/index.js +1 -0
  127. package/dist/plugins/mailjet/src/index.js +3 -0
  128. package/dist/plugins/mandrill/src/index.js +2 -0
  129. package/dist/plugins/marketstack/src/index.js +3 -0
  130. package/dist/plugins/matrix/src/index.js +10 -0
  131. package/dist/plugins/mattermost/src/index.js +19 -0
  132. package/dist/plugins/mautic/src/index.js +20 -0
  133. package/dist/plugins/medium/src/index.js +3 -0
  134. package/dist/plugins/messagebird/src/index.js +2 -0
  135. package/dist/plugins/metabase/src/index.js +10 -0
  136. package/dist/plugins/microsoftCalendar/src/index.js +2 -0
  137. package/dist/plugins/microsoftFiles/src/index.js +5 -0
  138. package/dist/plugins/microsoftMail/src/index.js +4 -0
  139. package/dist/plugins/misp/src/index.js +44 -0
  140. package/dist/plugins/mocean/src/index.js +2 -0
  141. package/dist/plugins/monday/src/index.js +18 -0
  142. package/dist/plugins/monicaCrm/src/index.js +5 -0
  143. package/dist/plugins/msg91/src/index.js +1 -0
  144. package/dist/plugins/nasa/src/index.js +7 -0
  145. package/dist/plugins/netlify/src/index.js +7 -0
  146. package/dist/plugins/netscalerAdc/src/index.js +3 -0
  147. package/dist/plugins/nextcloud/src/index.js +13 -0
  148. package/dist/plugins/nocodb/src/index.js +5 -0
  149. package/dist/plugins/node/src/index.js +38 -0
  150. package/dist/plugins/notion/src/index.js +14 -0
  151. package/dist/plugins/npm/src/index.js +5 -0
  152. package/dist/plugins/odoo/src/index.js +6 -0
  153. package/dist/plugins/okta/src/index.js +5 -0
  154. package/dist/plugins/oneSimpleApi/src/index.js +10 -0
  155. package/dist/plugins/onfleet/src/index.js +24 -0
  156. package/dist/plugins/openThesaurus/src/index.js +1 -0
  157. package/dist/plugins/openai/src/index.js +1 -0
  158. package/dist/plugins/openweathermap/src/index.js +2 -0
  159. package/dist/plugins/oura/src/index.js +2 -0
  160. package/dist/plugins/paddle/src/index.js +9 -0
  161. package/dist/plugins/pagerduty/src/index.js +9 -0
  162. package/dist/plugins/parallel/src/index.js +1 -0
  163. package/dist/plugins/paypal/src/index.js +4 -0
  164. package/dist/plugins/peekalink/src/index.js +2 -0
  165. package/dist/plugins/phantombuster/src/index.js +5 -0
  166. package/dist/plugins/philipsHue/src/index.js +4 -0
  167. package/dist/plugins/pipedrive/src/index.js +14 -0
  168. package/dist/plugins/plivo/src/index.js +3 -0
  169. package/dist/plugins/postbin/src/index.js +6 -0
  170. package/dist/plugins/posthog/src/index.js +5 -0
  171. package/dist/plugins/profitwell/src/index.js +2 -0
  172. package/dist/plugins/pushbullet/src/index.js +4 -0
  173. package/dist/plugins/pushcut/src/index.js +1 -0
  174. package/dist/plugins/pushover/src/index.js +1 -0
  175. package/dist/plugins/quickbase/src/index.js +8 -0
  176. package/dist/plugins/quickbooks/src/index.js +5 -0
  177. package/dist/plugins/quickchart/src/index.js +1 -0
  178. package/dist/plugins/raindrop/src/index.js +13 -0
  179. package/dist/plugins/recraft/src/index.js +1 -0
  180. package/dist/plugins/reddit/src/index.js +10 -0
  181. package/dist/plugins/replicate/src/index.js +1 -0
  182. package/dist/plugins/rocketchat/src/index.js +1 -0
  183. package/dist/plugins/rundeck/src/index.js +2 -0
  184. package/dist/plugins/salesforce/src/metadata.js +4 -0
  185. package/dist/plugins/salesforce/src/query.js +5 -0
  186. package/dist/plugins/salesforce/src/sobjects.js +12 -0
  187. package/dist/plugins/salesmate/src/index.js +5 -0
  188. package/dist/plugins/securityScorecard/src/index.js +14 -0
  189. package/dist/plugins/segment/src/index.js +4 -0
  190. package/dist/plugins/sendgrid/src/index.js +10 -0
  191. package/dist/plugins/sendy/src/index.js +6 -0
  192. package/dist/plugins/sentry/src/index.js +24 -0
  193. package/dist/plugins/servicenow/src/index.js +10 -0
  194. package/dist/plugins/shiftLabs/src/index.js +6 -0
  195. package/dist/plugins/shiftLabs/src/issues.js +4 -0
  196. package/dist/plugins/shiftLabs/src/pages.js +10 -0
  197. package/dist/plugins/shiftLabs/src/shared.js +2 -0
  198. package/dist/plugins/shiftLabs/src/transcription.js +203 -0
  199. package/dist/plugins/shopify/src/index.js +10 -0
  200. package/dist/plugins/signl4/src/index.js +2 -0
  201. package/dist/plugins/slack/src/index.js +38 -0
  202. package/dist/plugins/sms77/src/index.js +2 -0
  203. package/dist/plugins/splunk/src/index.js +16 -0
  204. package/dist/plugins/spotify/src/index.js +30 -0
  205. package/dist/plugins/stackby/src/index.js +4 -0
  206. package/dist/plugins/steel/src/browser.js +7 -0
  207. package/dist/plugins/steel/src/captchas.js +3 -0
  208. package/dist/plugins/steel/src/credentials.js +4 -0
  209. package/dist/plugins/steel/src/extensions.js +5 -0
  210. package/dist/plugins/steel/src/files.js +10 -0
  211. package/dist/plugins/steel/src/profiles.js +4 -0
  212. package/dist/plugins/steel/src/sessions.js +11 -0
  213. package/dist/plugins/storyblok/src/index.js +7 -0
  214. package/dist/plugins/strapi/src/index.js +5 -0
  215. package/dist/plugins/strava/src/index.js +6 -0
  216. package/dist/plugins/stripe/src/index.js +20 -0
  217. package/dist/plugins/supabase/src/index.js +5 -0
  218. package/dist/plugins/syncromsp/src/index.js +20 -0
  219. package/dist/plugins/tapfiliate/src/index.js +11 -0
  220. package/dist/plugins/telegram/src/index.js +21 -0
  221. package/dist/plugins/thehive/src/index.js +23 -0
  222. package/dist/plugins/thehiveProject/src/index.js +31 -0
  223. package/dist/plugins/todoist/src/index.js +31 -0
  224. package/dist/plugins/together/src/index.js +1 -0
  225. package/dist/plugins/travisci/src/index.js +5 -0
  226. package/dist/plugins/trello/src/index.js +37 -0
  227. package/dist/plugins/twake/src/index.js +1 -0
  228. package/dist/plugins/twilio/src/index.js +2 -0
  229. package/dist/plugins/twist/src/index.js +22 -0
  230. package/dist/plugins/twitter/src/index.js +8 -0
  231. package/dist/plugins/unleashedSoftware/src/index.js +3 -0
  232. package/dist/plugins/uplead/src/index.js +2 -0
  233. package/dist/plugins/uproc/src/index.js +1 -0
  234. package/dist/plugins/uptimerobot/src/index.js +22 -0
  235. package/dist/plugins/urlscanio/src/index.js +3 -0
  236. package/dist/plugins/vercel/src/account.js +1 -0
  237. package/dist/plugins/vercel/src/deployments.js +5 -0
  238. package/dist/plugins/vercel/src/env.js +4 -0
  239. package/dist/plugins/vercel/src/projects.js +2 -0
  240. package/dist/plugins/vercel/src/shared.js +1 -0
  241. package/dist/plugins/vero/src/index.js +6 -0
  242. package/dist/plugins/vonage/src/index.js +1 -0
  243. package/dist/plugins/wekan/src/index.js +24 -0
  244. package/dist/plugins/woocommerce/src/index.js +5 -0
  245. package/dist/plugins/wordpress/src/index.js +10 -0
  246. package/dist/plugins/xai/src/index.js +1 -0
  247. package/dist/plugins/xero/src/index.js +8 -0
  248. package/dist/plugins/yourls/src/index.js +3 -0
  249. package/dist/plugins/zammad/src/index.js +12 -0
  250. package/dist/plugins/zendesk/src/index.js +18 -0
  251. package/dist/plugins/zoho/src/index.js +6 -0
  252. package/dist/plugins/zoom/src/index.js +5 -0
  253. package/dist/plugins/zulip/src/index.js +15 -0
  254. package/dist/sdk.d.ts +2 -1
  255. package/dist/sdk.js +1 -0
  256. package/package.json +1 -1
@@ -1,10 +1,65 @@
1
+ import * as t from "typebox";
1
2
  import { googleAccessToken } from "../../_shared/googleAuth.js";
3
+ import { RawGoogleObject } from "../../_shared/googleSchemas.js";
2
4
  export const SCOPES = [
3
5
  "https://www.googleapis.com/auth/documents",
4
6
  "https://www.googleapis.com/auth/drive.file",
5
7
  ];
6
8
  export const DOCS_BASE = "https://docs.googleapis.com/v1";
7
9
  export const DRIVE_BASE = "https://www.googleapis.com/drive/v3";
10
+ export const STRICT_OBJECT = { additionalProperties: false };
11
+ export const DocumentInput = {
12
+ document: t.String({ minLength: 1, description: "Document ID or URL" }),
13
+ };
14
+ export const SegmentInput = {
15
+ segmentId: t.Optional(t.String({ description: 'Segment ID, or "body" for the main body' })),
16
+ tabId: t.Optional(t.String({ minLength: 1 })),
17
+ };
18
+ export const RangeInput = {
19
+ startIndex: t.Integer({ minimum: 0 }),
20
+ endIndex: t.Integer({ minimum: 0 }),
21
+ ...SegmentInput,
22
+ };
23
+ export const TableLocationInput = {
24
+ tableStartIndex: t.Integer({ minimum: 0 }),
25
+ rowIndex: t.Integer({ minimum: 0 }),
26
+ columnIndex: t.Integer({ minimum: 0 }),
27
+ ...SegmentInput,
28
+ };
29
+ export const LocationInput = {
30
+ locationKind: t.Optional(t.Union([t.Literal("location"), t.Literal("endOfSegmentLocation")])),
31
+ index: t.Optional(t.Integer({ minimum: 0 })),
32
+ ...SegmentInput,
33
+ };
34
+ export const LOCATION_REQUIREMENT = [
35
+ {
36
+ required: ["index"],
37
+ not: {
38
+ required: ["locationKind"],
39
+ properties: { locationKind: { const: "endOfSegmentLocation" } },
40
+ },
41
+ },
42
+ {
43
+ required: ["locationKind"],
44
+ properties: { locationKind: { const: "endOfSegmentLocation" } },
45
+ not: { required: ["index"] },
46
+ },
47
+ ];
48
+ export const HexColor = t.String({
49
+ pattern: "^#?(?:[0-9a-fA-F]{3}|[0-9a-fA-F]{6})$",
50
+ });
51
+ export const PositivePoints = t.Number({ minimum: 0 });
52
+ export const WriteControl = t.Object({
53
+ requiredRevisionId: t.Optional(t.String({ minLength: 1 })),
54
+ targetRevisionId: t.Optional(t.String({ minLength: 1 })),
55
+ }, {
56
+ additionalProperties: false,
57
+ oneOf: [
58
+ { required: ["requiredRevisionId"] },
59
+ { required: ["targetRevisionId"] },
60
+ ],
61
+ });
62
+ export { RawGoogleObject };
8
63
  export async function accessToken(ctx) {
9
64
  return googleAccessToken(ctx, "googleDocs", SCOPES);
10
65
  }
@@ -1,4 +1,5 @@
1
- import { buildLocation, compact, extractDocumentId, location, runBatchUpdate, } from "./shared.js";
1
+ import * as t from "typebox";
2
+ import { buildLocation, compact, DocumentInput, extractDocumentId, LOCATION_REQUIREMENT, LocationInput, location, PositivePoints, RangeInput, runBatchUpdate, SegmentInput, STRICT_OBJECT, } from "./shared.js";
2
3
  function range(p) {
3
4
  return compact({
4
5
  segmentId: p.segmentId && p.segmentId !== "body" ? p.segmentId : "",
@@ -12,14 +13,9 @@ function point(value) {
12
13
  }
13
14
  export function registerStructureActions(rl) {
14
15
  rl.registerAction("document.insertPageBreak", {
16
+ access: "write",
15
17
  description: "Insert a page break at an index or at the end of a segment.",
16
- inputSchema: {
17
- document: { type: "string", required: true },
18
- locationKind: { type: "string", required: false },
19
- index: { type: "number", required: false },
20
- segmentId: { type: "string", required: false },
21
- tabId: { type: "string", required: false },
22
- },
18
+ inputSchema: t.Object({ ...DocumentInput, ...LocationInput }, { ...STRICT_OBJECT, anyOf: LOCATION_REQUIREMENT }),
23
19
  async execute(input, ctx) {
24
20
  const p = (input ?? {});
25
21
  const documentId = extractDocumentId(p.document);
@@ -30,15 +26,13 @@ export function registerStructureActions(rl) {
30
26
  },
31
27
  });
32
28
  rl.registerAction("document.createNamedRange", {
29
+ access: "write",
33
30
  description: "Create a named range over a span of text (useful for later programmatic edits).",
34
- inputSchema: {
35
- document: { type: "string", required: true },
36
- name: { type: "string", required: true },
37
- startIndex: { type: "number", required: true },
38
- endIndex: { type: "number", required: true },
39
- segmentId: { type: "string", required: false },
40
- tabId: { type: "string", required: false },
41
- },
31
+ inputSchema: t.Object({
32
+ ...DocumentInput,
33
+ name: t.String({ minLength: 1 }),
34
+ ...RangeInput,
35
+ }, STRICT_OBJECT),
42
36
  async execute(input, ctx) {
43
37
  const p = (input ?? {});
44
38
  const documentId = extractDocumentId(p.document);
@@ -51,17 +45,17 @@ export function registerStructureActions(rl) {
51
45
  },
52
46
  });
53
47
  rl.registerAction("document.deleteNamedRange", {
48
+ access: "write",
54
49
  description: "Delete named range(s). Pass one of `namedRangeId` or `name`; the latter deletes every range sharing that name.",
55
- inputSchema: {
56
- document: { type: "string", required: true },
57
- namedRangeId: { type: "string", required: false },
58
- name: { type: "string", required: false },
59
- tabIds: {
60
- type: "array",
61
- required: false,
62
- description: "Optional tab IDs for tabsCriteria.",
63
- },
64
- },
50
+ inputSchema: t.Object({
51
+ ...DocumentInput,
52
+ namedRangeId: t.Optional(t.String({ minLength: 1 })),
53
+ name: t.Optional(t.String({ minLength: 1 })),
54
+ tabIds: t.Optional(t.Array(t.String({ minLength: 1 }), { minItems: 1 })),
55
+ }, {
56
+ ...STRICT_OBJECT,
57
+ oneOf: [{ required: ["namedRangeId"] }, { required: ["name"] }],
58
+ }),
65
59
  async execute(input, ctx) {
66
60
  const p = (input ?? {});
67
61
  const documentId = extractDocumentId(p.document);
@@ -77,14 +71,9 @@ export function registerStructureActions(rl) {
77
71
  },
78
72
  });
79
73
  rl.registerAction("document.createHeader", {
74
+ access: "write",
80
75
  description: "Create a DEFAULT header attached to a SectionBreak.",
81
- inputSchema: {
82
- document: { type: "string", required: true },
83
- locationKind: { type: "string", required: false },
84
- index: { type: "number", required: false },
85
- segmentId: { type: "string", required: false },
86
- tabId: { type: "string", required: false },
87
- },
76
+ inputSchema: t.Object({ ...DocumentInput, ...LocationInput }, { ...STRICT_OBJECT, anyOf: LOCATION_REQUIREMENT }),
88
77
  async execute(input, ctx) {
89
78
  const p = (input ?? {});
90
79
  const documentId = extractDocumentId(p.document);
@@ -106,11 +95,13 @@ export function registerStructureActions(rl) {
106
95
  },
107
96
  });
108
97
  rl.registerAction("document.deleteHeader", {
98
+ access: "write",
109
99
  description: "Delete a header by ID.",
110
- inputSchema: {
111
- document: { type: "string", required: true },
112
- headerId: { type: "string", required: true },
113
- },
100
+ inputSchema: t.Object({
101
+ ...DocumentInput,
102
+ headerId: t.String({ minLength: 1 }),
103
+ tabId: t.Optional(t.String({ minLength: 1 })),
104
+ }, STRICT_OBJECT),
114
105
  async execute(input, ctx) {
115
106
  const p = (input ?? {});
116
107
  const documentId = extractDocumentId(p.document);
@@ -120,14 +111,9 @@ export function registerStructureActions(rl) {
120
111
  },
121
112
  });
122
113
  rl.registerAction("document.createFooter", {
114
+ access: "write",
123
115
  description: "Create a DEFAULT footer attached to a SectionBreak.",
124
- inputSchema: {
125
- document: { type: "string", required: true },
126
- locationKind: { type: "string", required: false },
127
- index: { type: "number", required: false },
128
- segmentId: { type: "string", required: false },
129
- tabId: { type: "string", required: false },
130
- },
116
+ inputSchema: t.Object({ ...DocumentInput, ...LocationInput }, { ...STRICT_OBJECT, anyOf: LOCATION_REQUIREMENT }),
131
117
  async execute(input, ctx) {
132
118
  const p = (input ?? {});
133
119
  const documentId = extractDocumentId(p.document);
@@ -149,11 +135,13 @@ export function registerStructureActions(rl) {
149
135
  },
150
136
  });
151
137
  rl.registerAction("document.deleteFooter", {
138
+ access: "write",
152
139
  description: "Delete a footer by ID.",
153
- inputSchema: {
154
- document: { type: "string", required: true },
155
- footerId: { type: "string", required: true },
156
- },
140
+ inputSchema: t.Object({
141
+ ...DocumentInput,
142
+ footerId: t.String({ minLength: 1 }),
143
+ tabId: t.Optional(t.String({ minLength: 1 })),
144
+ }, STRICT_OBJECT),
157
145
  async execute(input, ctx) {
158
146
  const p = (input ?? {});
159
147
  const documentId = extractDocumentId(p.document);
@@ -163,12 +151,13 @@ export function registerStructureActions(rl) {
163
151
  },
164
152
  });
165
153
  rl.registerAction("document.deletePositionedObject", {
154
+ access: "write",
166
155
  description: "Delete a positioned object (inline image, floating image, etc.) by its objectId.",
167
- inputSchema: {
168
- document: { type: "string", required: true },
169
- objectId: { type: "string", required: true },
170
- tabId: { type: "string", required: false },
171
- },
156
+ inputSchema: t.Object({
157
+ ...DocumentInput,
158
+ objectId: t.String({ minLength: 1 }),
159
+ tabId: t.Optional(t.String({ minLength: 1 })),
160
+ }, STRICT_OBJECT),
172
161
  async execute(input, ctx) {
173
162
  const p = (input ?? {});
174
163
  const documentId = extractDocumentId(p.document);
@@ -181,18 +170,9 @@ export function registerStructureActions(rl) {
181
170
  },
182
171
  });
183
172
  rl.registerAction("document.createFootnote", {
173
+ access: "write",
184
174
  description: "Create a footnote reference at a location or at the end of the document body.",
185
- inputSchema: {
186
- document: { type: "string", required: true },
187
- locationKind: {
188
- type: "string",
189
- required: false,
190
- description: "location (default; requires index) | endOfSegmentLocation",
191
- },
192
- index: { type: "number", required: false },
193
- segmentId: { type: "string", required: false },
194
- tabId: { type: "string", required: false },
195
- },
175
+ inputSchema: t.Object({ ...DocumentInput, ...LocationInput }, { ...STRICT_OBJECT, anyOf: LOCATION_REQUIREMENT }),
196
176
  async execute(input, ctx) {
197
177
  const p = (input ?? {});
198
178
  const documentId = extractDocumentId(p.document);
@@ -203,18 +183,21 @@ export function registerStructureActions(rl) {
203
183
  },
204
184
  });
205
185
  rl.registerAction("document.replaceNamedRangeContent", {
186
+ access: "write",
206
187
  description: "Replace the content of a named range by ID or name with text.",
207
- inputSchema: {
208
- document: { type: "string", required: true },
209
- text: { type: "string", required: true },
210
- namedRangeId: { type: "string", required: false },
211
- namedRangeName: { type: "string", required: false },
212
- tabIds: {
213
- type: "array",
214
- required: false,
215
- description: "Optional tab IDs for tabsCriteria.",
216
- },
217
- },
188
+ inputSchema: t.Object({
189
+ ...DocumentInput,
190
+ text: t.String(),
191
+ namedRangeId: t.Optional(t.String({ minLength: 1 })),
192
+ namedRangeName: t.Optional(t.String({ minLength: 1 })),
193
+ tabIds: t.Optional(t.Array(t.String({ minLength: 1 }), { minItems: 1 })),
194
+ }, {
195
+ ...STRICT_OBJECT,
196
+ oneOf: [
197
+ { required: ["namedRangeId"] },
198
+ { required: ["namedRangeName"] },
199
+ ],
200
+ }),
218
201
  async execute(input, ctx) {
219
202
  const p = (input ?? {});
220
203
  const documentId = extractDocumentId(p.document);
@@ -234,33 +217,30 @@ export function registerStructureActions(rl) {
234
217
  },
235
218
  });
236
219
  rl.registerAction("document.updateSectionStyle", {
220
+ access: "write",
237
221
  description: "Update section style over a range, such as margins or column properties.",
238
- inputSchema: {
239
- document: { type: "string", required: true },
240
- startIndex: { type: "number", required: true },
241
- endIndex: { type: "number", required: true },
242
- marginTopPt: { type: "number", required: false },
243
- marginBottomPt: { type: "number", required: false },
244
- marginLeftPt: { type: "number", required: false },
245
- marginRightPt: { type: "number", required: false },
246
- columnSeparatorStyle: {
247
- type: "string",
248
- required: false,
249
- description: "NONE | BETWEEN_EACH_COLUMN",
250
- },
251
- contentDirection: {
252
- type: "string",
253
- required: false,
254
- description: "LEFT_TO_RIGHT | RIGHT_TO_LEFT",
255
- },
256
- fields: {
257
- type: "string",
258
- required: false,
259
- description: "Field mask. Defaults to fields implied by supplied properties.",
260
- },
261
- segmentId: { type: "string", required: false },
262
- tabId: { type: "string", required: false },
263
- },
222
+ inputSchema: t.Object({
223
+ ...DocumentInput,
224
+ ...RangeInput,
225
+ marginTopPt: t.Optional(PositivePoints),
226
+ marginBottomPt: t.Optional(PositivePoints),
227
+ marginLeftPt: t.Optional(PositivePoints),
228
+ marginRightPt: t.Optional(PositivePoints),
229
+ columnSeparatorStyle: t.Optional(t.Union([t.Literal("NONE"), t.Literal("BETWEEN_EACH_COLUMN")])),
230
+ contentDirection: t.Optional(t.Union([t.Literal("LEFT_TO_RIGHT"), t.Literal("RIGHT_TO_LEFT")])),
231
+ fields: t.Optional(t.String({ minLength: 1 })),
232
+ }, {
233
+ ...STRICT_OBJECT,
234
+ anyOf: [
235
+ { required: ["marginTopPt"] },
236
+ { required: ["marginBottomPt"] },
237
+ { required: ["marginLeftPt"] },
238
+ { required: ["marginRightPt"] },
239
+ { required: ["columnSeparatorStyle"] },
240
+ { required: ["contentDirection"] },
241
+ { required: ["fields"] },
242
+ ],
243
+ }),
264
244
  async execute(input, ctx) {
265
245
  const p = (input ?? {});
266
246
  const documentId = extractDocumentId(p.document);
@@ -303,18 +283,14 @@ export function registerStructureActions(rl) {
303
283
  },
304
284
  });
305
285
  rl.registerAction("document.insertSectionBreak", {
286
+ access: "write",
306
287
  description: "Insert a section break at the given location.",
307
- inputSchema: {
308
- document: { type: "string", required: true },
309
- index: { type: "number", required: true },
310
- sectionType: {
311
- type: "string",
312
- required: false,
313
- description: "CONTINUOUS | NEXT_PAGE. Default CONTINUOUS.",
314
- },
315
- segmentId: { type: "string", required: false },
316
- tabId: { type: "string", required: false },
317
- },
288
+ inputSchema: t.Object({
289
+ ...DocumentInput,
290
+ index: t.Integer({ minimum: 0 }),
291
+ sectionType: t.Optional(t.Union([t.Literal("CONTINUOUS"), t.Literal("NEXT_PAGE")])),
292
+ ...SegmentInput,
293
+ }, STRICT_OBJECT),
318
294
  async execute(input, ctx) {
319
295
  const p = (input ?? {});
320
296
  const documentId = extractDocumentId(p.document);
@@ -329,18 +305,30 @@ export function registerStructureActions(rl) {
329
305
  },
330
306
  });
331
307
  rl.registerAction("document.updateDocumentStyle", {
308
+ access: "write",
332
309
  description: "Update document-level style (page size, margins, page numbers, default direction).",
333
- inputSchema: {
334
- document: { type: "string", required: true },
335
- pageMarginTopPt: { type: "number", required: false },
336
- pageMarginBottomPt: { type: "number", required: false },
337
- pageMarginLeftPt: { type: "number", required: false },
338
- pageMarginRightPt: { type: "number", required: false },
339
- pageSizeWidthPt: { type: "number", required: false },
340
- pageSizeHeightPt: { type: "number", required: false },
341
- useCustomHeaderFooterMargins: { type: "boolean", required: false },
342
- tabId: { type: "string", required: false },
343
- },
310
+ inputSchema: t.Object({
311
+ ...DocumentInput,
312
+ pageMarginTopPt: t.Optional(PositivePoints),
313
+ pageMarginBottomPt: t.Optional(PositivePoints),
314
+ pageMarginLeftPt: t.Optional(PositivePoints),
315
+ pageMarginRightPt: t.Optional(PositivePoints),
316
+ pageSizeWidthPt: t.Optional(PositivePoints),
317
+ pageSizeHeightPt: t.Optional(PositivePoints),
318
+ useCustomHeaderFooterMargins: t.Optional(t.Boolean()),
319
+ tabId: t.Optional(t.String({ minLength: 1 })),
320
+ }, {
321
+ ...STRICT_OBJECT,
322
+ anyOf: [
323
+ { required: ["pageMarginTopPt"] },
324
+ { required: ["pageMarginBottomPt"] },
325
+ { required: ["pageMarginLeftPt"] },
326
+ { required: ["pageMarginRightPt"] },
327
+ { required: ["pageSizeWidthPt"] },
328
+ { required: ["pageSizeHeightPt"] },
329
+ { required: ["useCustomHeaderFooterMargins"] },
330
+ ],
331
+ }),
344
332
  async execute(input, ctx) {
345
333
  const p = (input ?? {});
346
334
  const documentId = extractDocumentId(p.document);