@n24q02m/workspace 0.0.0-stage → 0.6.0-beta.1

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 (331) hide show
  1. package/LICENSE +202 -0
  2. package/NOTICE +46 -0
  3. package/README.md +342 -2
  4. package/bin/cli.mjs +144 -0
  5. package/build/src/auth/account-context.d.ts +3 -0
  6. package/build/src/auth/account-context.d.ts.map +1 -0
  7. package/build/src/auth/account-context.js +17 -0
  8. package/build/src/auth/account-context.js.map +1 -0
  9. package/build/src/auth/account-context.test.d.ts +2 -0
  10. package/build/src/auth/account-context.test.d.ts.map +1 -0
  11. package/build/src/auth/account-context.test.js +30 -0
  12. package/build/src/auth/account-context.test.js.map +1 -0
  13. package/build/src/auth/account-store.d.ts +87 -0
  14. package/build/src/auth/account-store.d.ts.map +1 -0
  15. package/build/src/auth/account-store.js +187 -0
  16. package/build/src/auth/account-store.js.map +1 -0
  17. package/build/src/auth/account-store.test.d.ts +2 -0
  18. package/build/src/auth/account-store.test.d.ts.map +1 -0
  19. package/build/src/auth/account-store.test.js +264 -0
  20. package/build/src/auth/account-store.test.js.map +1 -0
  21. package/build/src/auth/add-account.d.ts +12 -0
  22. package/build/src/auth/add-account.d.ts.map +1 -0
  23. package/build/src/auth/add-account.js +95 -0
  24. package/build/src/auth/add-account.js.map +1 -0
  25. package/build/src/auth/add-account.test.d.ts +2 -0
  26. package/build/src/auth/add-account.test.d.ts.map +1 -0
  27. package/build/src/auth/add-account.test.js +155 -0
  28. package/build/src/auth/add-account.test.js.map +1 -0
  29. package/build/src/auth/cli-auth.d.ts +2 -0
  30. package/build/src/auth/cli-auth.d.ts.map +1 -0
  31. package/build/src/auth/cli-auth.js +47 -0
  32. package/build/src/auth/cli-auth.js.map +1 -0
  33. package/build/src/auth/cli-auth.test.d.ts +2 -0
  34. package/build/src/auth/cli-auth.test.d.ts.map +1 -0
  35. package/build/src/auth/cli-auth.test.js +78 -0
  36. package/build/src/auth/cli-auth.test.js.map +1 -0
  37. package/build/src/auth/consent-server.d.ts +43 -0
  38. package/build/src/auth/consent-server.d.ts.map +1 -0
  39. package/build/src/auth/consent-server.js +56 -0
  40. package/build/src/auth/consent-server.js.map +1 -0
  41. package/build/src/auth/credential-state.d.ts +7 -0
  42. package/build/src/auth/credential-state.d.ts.map +1 -0
  43. package/build/src/auth/credential-state.js +64 -0
  44. package/build/src/auth/credential-state.js.map +1 -0
  45. package/build/src/auth/credential-state.test.d.ts +2 -0
  46. package/build/src/auth/credential-state.test.d.ts.map +1 -0
  47. package/build/src/auth/credential-state.test.js +142 -0
  48. package/build/src/auth/credential-state.test.js.map +1 -0
  49. package/build/src/auth/loopback-consent.d.ts +23 -0
  50. package/build/src/auth/loopback-consent.d.ts.map +1 -0
  51. package/build/src/auth/loopback-consent.js +145 -0
  52. package/build/src/auth/loopback-consent.js.map +1 -0
  53. package/build/src/auth/loopback-consent.test.d.ts +2 -0
  54. package/build/src/auth/loopback-consent.test.d.ts.map +1 -0
  55. package/build/src/auth/loopback-consent.test.js +131 -0
  56. package/build/src/auth/loopback-consent.test.js.map +1 -0
  57. package/build/src/auth/oauth-setup.d.ts +10 -0
  58. package/build/src/auth/oauth-setup.d.ts.map +1 -0
  59. package/build/src/auth/oauth-setup.js +92 -0
  60. package/build/src/auth/oauth-setup.js.map +1 -0
  61. package/build/src/auth/oauth-setup.test.d.ts +2 -0
  62. package/build/src/auth/oauth-setup.test.d.ts.map +1 -0
  63. package/build/src/auth/oauth-setup.test.js +164 -0
  64. package/build/src/auth/oauth-setup.test.js.map +1 -0
  65. package/build/src/auth/subject-context.d.ts +2 -0
  66. package/build/src/auth/subject-context.d.ts.map +1 -0
  67. package/build/src/auth/subject-context.js +16 -0
  68. package/build/src/auth/subject-context.js.map +1 -0
  69. package/build/src/auth/subject-context.test.d.ts +2 -0
  70. package/build/src/auth/subject-context.test.d.ts.map +1 -0
  71. package/build/src/auth/subject-context.test.js +34 -0
  72. package/build/src/auth/subject-context.test.js.map +1 -0
  73. package/build/src/auth/workspace-auth.d.ts +47 -0
  74. package/build/src/auth/workspace-auth.d.ts.map +1 -0
  75. package/build/src/auth/workspace-auth.js +123 -0
  76. package/build/src/auth/workspace-auth.js.map +1 -0
  77. package/build/src/auth/workspace-auth.test.d.ts +2 -0
  78. package/build/src/auth/workspace-auth.test.d.ts.map +1 -0
  79. package/build/src/auth/workspace-auth.test.js +242 -0
  80. package/build/src/auth/workspace-auth.test.js.map +1 -0
  81. package/build/src/constants.d.ts +6 -0
  82. package/build/src/constants.d.ts.map +1 -0
  83. package/build/src/constants.js +11 -0
  84. package/build/src/constants.js.map +1 -0
  85. package/build/src/create-server.d.ts +13 -0
  86. package/build/src/create-server.d.ts.map +1 -0
  87. package/build/src/create-server.js +34 -0
  88. package/build/src/create-server.js.map +1 -0
  89. package/build/src/create-server.test.d.ts +2 -0
  90. package/build/src/create-server.test.d.ts.map +1 -0
  91. package/build/src/create-server.test.js +13 -0
  92. package/build/src/create-server.test.js.map +1 -0
  93. package/build/src/docs/calendar.md +15 -0
  94. package/build/src/docs/chat.md +15 -0
  95. package/build/src/docs/config.md +117 -0
  96. package/build/src/docs/docs.md +36 -0
  97. package/build/src/docs/drive.md +15 -0
  98. package/build/src/docs/forms.md +119 -0
  99. package/build/src/docs/gmail.md +18 -0
  100. package/build/src/docs/overview.md +52 -0
  101. package/build/src/docs/people.md +10 -0
  102. package/build/src/docs/sheets.md +10 -0
  103. package/build/src/docs/slides.md +26 -0
  104. package/build/src/docs/tasks.md +13 -0
  105. package/build/src/docs/time.md +11 -0
  106. package/build/src/init-server.d.ts +10 -0
  107. package/build/src/init-server.d.ts.map +1 -0
  108. package/build/src/init-server.js +13 -0
  109. package/build/src/init-server.js.map +1 -0
  110. package/build/src/init-server.test.d.ts +2 -0
  111. package/build/src/init-server.test.d.ts.map +1 -0
  112. package/build/src/init-server.test.js +15 -0
  113. package/build/src/init-server.test.js.map +1 -0
  114. package/build/src/main.d.ts +33 -0
  115. package/build/src/main.d.ts.map +1 -0
  116. package/build/src/main.js +120 -0
  117. package/build/src/main.js.map +1 -0
  118. package/build/src/main.test.d.ts +2 -0
  119. package/build/src/main.test.d.ts.map +1 -0
  120. package/build/src/main.test.js +204 -0
  121. package/build/src/main.test.js.map +1 -0
  122. package/build/src/services/FormsService.d.ts +89 -0
  123. package/build/src/services/FormsService.d.ts.map +1 -0
  124. package/build/src/services/FormsService.js +140 -0
  125. package/build/src/services/FormsService.js.map +1 -0
  126. package/build/src/services/FormsService.test.d.ts +2 -0
  127. package/build/src/services/FormsService.test.d.ts.map +1 -0
  128. package/build/src/services/FormsService.test.js +173 -0
  129. package/build/src/services/FormsService.test.js.map +1 -0
  130. package/build/src/tools/config.d.ts +19 -0
  131. package/build/src/tools/config.d.ts.map +1 -0
  132. package/build/src/tools/config.js +100 -0
  133. package/build/src/tools/config.js.map +1 -0
  134. package/build/src/tools/config.test.d.ts +2 -0
  135. package/build/src/tools/config.test.d.ts.map +1 -0
  136. package/build/src/tools/config.test.js +201 -0
  137. package/build/src/tools/config.test.js.map +1 -0
  138. package/build/src/tools/domains/calendar.d.ts +3 -0
  139. package/build/src/tools/domains/calendar.d.ts.map +1 -0
  140. package/build/src/tools/domains/calendar.js +14 -0
  141. package/build/src/tools/domains/calendar.js.map +1 -0
  142. package/build/src/tools/domains/chat.d.ts +3 -0
  143. package/build/src/tools/domains/chat.d.ts.map +1 -0
  144. package/build/src/tools/domains/chat.js +16 -0
  145. package/build/src/tools/domains/chat.js.map +1 -0
  146. package/build/src/tools/domains/docs.d.ts +8 -0
  147. package/build/src/tools/domains/docs.d.ts.map +1 -0
  148. package/build/src/tools/domains/docs.js +11 -0
  149. package/build/src/tools/domains/docs.js.map +1 -0
  150. package/build/src/tools/domains/docs.test.d.ts +2 -0
  151. package/build/src/tools/domains/docs.test.d.ts.map +1 -0
  152. package/build/src/tools/domains/docs.test.js +111 -0
  153. package/build/src/tools/domains/docs.test.js.map +1 -0
  154. package/build/src/tools/domains/drive.d.ts +3 -0
  155. package/build/src/tools/domains/drive.d.ts.map +1 -0
  156. package/build/src/tools/domains/drive.js +14 -0
  157. package/build/src/tools/domains/drive.js.map +1 -0
  158. package/build/src/tools/domains/factory.d.ts +24 -0
  159. package/build/src/tools/domains/factory.d.ts.map +1 -0
  160. package/build/src/tools/domains/factory.js +43 -0
  161. package/build/src/tools/domains/factory.js.map +1 -0
  162. package/build/src/tools/domains/factory.test.d.ts +2 -0
  163. package/build/src/tools/domains/factory.test.d.ts.map +1 -0
  164. package/build/src/tools/domains/factory.test.js +48 -0
  165. package/build/src/tools/domains/factory.test.js.map +1 -0
  166. package/build/src/tools/domains/forms.d.ts +9 -0
  167. package/build/src/tools/domains/forms.d.ts.map +1 -0
  168. package/build/src/tools/domains/forms.js +12 -0
  169. package/build/src/tools/domains/forms.js.map +1 -0
  170. package/build/src/tools/domains/forms.test.d.ts +2 -0
  171. package/build/src/tools/domains/forms.test.d.ts.map +1 -0
  172. package/build/src/tools/domains/forms.test.js +93 -0
  173. package/build/src/tools/domains/forms.test.js.map +1 -0
  174. package/build/src/tools/domains/gmail.d.ts +3 -0
  175. package/build/src/tools/domains/gmail.d.ts.map +1 -0
  176. package/build/src/tools/domains/gmail.js +17 -0
  177. package/build/src/tools/domains/gmail.js.map +1 -0
  178. package/build/src/tools/domains/index.d.ts +20 -0
  179. package/build/src/tools/domains/index.d.ts.map +1 -0
  180. package/build/src/tools/domains/index.js +230 -0
  181. package/build/src/tools/domains/index.js.map +1 -0
  182. package/build/src/tools/domains/people.d.ts +3 -0
  183. package/build/src/tools/domains/people.d.ts.map +1 -0
  184. package/build/src/tools/domains/people.js +5 -0
  185. package/build/src/tools/domains/people.js.map +1 -0
  186. package/build/src/tools/domains/sheets.d.ts +3 -0
  187. package/build/src/tools/domains/sheets.d.ts.map +1 -0
  188. package/build/src/tools/domains/sheets.js +5 -0
  189. package/build/src/tools/domains/sheets.js.map +1 -0
  190. package/build/src/tools/domains/slides.d.ts +3 -0
  191. package/build/src/tools/domains/slides.d.ts.map +1 -0
  192. package/build/src/tools/domains/slides.js +25 -0
  193. package/build/src/tools/domains/slides.js.map +1 -0
  194. package/build/src/tools/domains/tasks.d.ts +3 -0
  195. package/build/src/tools/domains/tasks.d.ts.map +1 -0
  196. package/build/src/tools/domains/tasks.js +14 -0
  197. package/build/src/tools/domains/tasks.js.map +1 -0
  198. package/build/src/tools/domains/time.d.ts +3 -0
  199. package/build/src/tools/domains/time.d.ts.map +1 -0
  200. package/build/src/tools/domains/time.js +6 -0
  201. package/build/src/tools/domains/time.js.map +1 -0
  202. package/build/src/tools/helpers/errors.d.ts +48 -0
  203. package/build/src/tools/helpers/errors.d.ts.map +1 -0
  204. package/build/src/tools/helpers/errors.js +290 -0
  205. package/build/src/tools/helpers/errors.js.map +1 -0
  206. package/build/src/tools/helpers/errors.test.d.ts +2 -0
  207. package/build/src/tools/helpers/errors.test.d.ts.map +1 -0
  208. package/build/src/tools/helpers/errors.test.js +220 -0
  209. package/build/src/tools/helpers/errors.test.js.map +1 -0
  210. package/build/src/tools/registry.d.ts +14 -0
  211. package/build/src/tools/registry.d.ts.map +1 -0
  212. package/build/src/tools/registry.js +276 -0
  213. package/build/src/tools/registry.js.map +1 -0
  214. package/build/src/tools/registry.test.d.ts +2 -0
  215. package/build/src/tools/registry.test.d.ts.map +1 -0
  216. package/build/src/tools/registry.test.js +321 -0
  217. package/build/src/tools/registry.test.js.map +1 -0
  218. package/build/src/transports/http.d.ts +7 -0
  219. package/build/src/transports/http.d.ts.map +1 -0
  220. package/build/src/transports/http.js +56 -0
  221. package/build/src/transports/http.js.map +1 -0
  222. package/build/src/transports/http.test.d.ts +2 -0
  223. package/build/src/transports/http.test.d.ts.map +1 -0
  224. package/build/src/transports/http.test.js +76 -0
  225. package/build/src/transports/http.test.js.map +1 -0
  226. package/build/src/vendored/auth/AuthManager.d.ts +7 -0
  227. package/build/src/vendored/auth/AuthManager.d.ts.map +1 -0
  228. package/build/src/vendored/auth/AuthManager.js +11 -0
  229. package/build/src/vendored/auth/AuthManager.js.map +1 -0
  230. package/build/src/vendored/services/CalendarService.d.ts +164 -0
  231. package/build/src/vendored/services/CalendarService.d.ts.map +1 -0
  232. package/build/src/vendored/services/CalendarService.js +726 -0
  233. package/build/src/vendored/services/CalendarService.js.map +1 -0
  234. package/build/src/vendored/services/CalendarValidation.d.ts +9 -0
  235. package/build/src/vendored/services/CalendarValidation.d.ts.map +1 -0
  236. package/build/src/vendored/services/CalendarValidation.js +125 -0
  237. package/build/src/vendored/services/CalendarValidation.js.map +1 -0
  238. package/build/src/vendored/services/ChatService.d.ts +90 -0
  239. package/build/src/vendored/services/ChatService.d.ts.map +1 -0
  240. package/build/src/vendored/services/ChatService.js +451 -0
  241. package/build/src/vendored/services/ChatService.js.map +1 -0
  242. package/build/src/vendored/services/DocsService.d.ts +109 -0
  243. package/build/src/vendored/services/DocsService.d.ts.map +1 -0
  244. package/build/src/vendored/services/DocsService.js +663 -0
  245. package/build/src/vendored/services/DocsService.js.map +1 -0
  246. package/build/src/vendored/services/DocsService.test.d.ts +2 -0
  247. package/build/src/vendored/services/DocsService.test.d.ts.map +1 -0
  248. package/build/src/vendored/services/DocsService.test.js +77 -0
  249. package/build/src/vendored/services/DocsService.test.js.map +1 -0
  250. package/build/src/vendored/services/DriveService.d.ts +117 -0
  251. package/build/src/vendored/services/DriveService.d.ts.map +1 -0
  252. package/build/src/vendored/services/DriveService.js +527 -0
  253. package/build/src/vendored/services/DriveService.js.map +1 -0
  254. package/build/src/vendored/services/DriveService.test.d.ts +2 -0
  255. package/build/src/vendored/services/DriveService.test.d.ts.map +1 -0
  256. package/build/src/vendored/services/DriveService.test.js +115 -0
  257. package/build/src/vendored/services/DriveService.test.js.map +1 -0
  258. package/build/src/vendored/services/GmailService.d.ts +137 -0
  259. package/build/src/vendored/services/GmailService.d.ts.map +1 -0
  260. package/build/src/vendored/services/GmailService.js +681 -0
  261. package/build/src/vendored/services/GmailService.js.map +1 -0
  262. package/build/src/vendored/services/PeopleService.d.ts +42 -0
  263. package/build/src/vendored/services/PeopleService.d.ts.map +1 -0
  264. package/build/src/vendored/services/PeopleService.js +168 -0
  265. package/build/src/vendored/services/PeopleService.js.map +1 -0
  266. package/build/src/vendored/services/SheetsService.d.ts +52 -0
  267. package/build/src/vendored/services/SheetsService.d.ts.map +1 -0
  268. package/build/src/vendored/services/SheetsService.js +262 -0
  269. package/build/src/vendored/services/SheetsService.js.map +1 -0
  270. package/build/src/vendored/services/SheetsService.test.d.ts +2 -0
  271. package/build/src/vendored/services/SheetsService.test.d.ts.map +1 -0
  272. package/build/src/vendored/services/SheetsService.test.js +104 -0
  273. package/build/src/vendored/services/SheetsService.test.js.map +1 -0
  274. package/build/src/vendored/services/SlidesService.d.ts +167 -0
  275. package/build/src/vendored/services/SlidesService.d.ts.map +1 -0
  276. package/build/src/vendored/services/SlidesService.js +887 -0
  277. package/build/src/vendored/services/SlidesService.js.map +1 -0
  278. package/build/src/vendored/services/TasksService.d.ts +97 -0
  279. package/build/src/vendored/services/TasksService.d.ts.map +1 -0
  280. package/build/src/vendored/services/TasksService.js +234 -0
  281. package/build/src/vendored/services/TasksService.js.map +1 -0
  282. package/build/src/vendored/services/TimeService.d.ts +29 -0
  283. package/build/src/vendored/services/TimeService.d.ts.map +1 -0
  284. package/build/src/vendored/services/TimeService.js +71 -0
  285. package/build/src/vendored/services/TimeService.js.map +1 -0
  286. package/build/src/vendored/utils/DriveQueryBuilder.d.ts +15 -0
  287. package/build/src/vendored/utils/DriveQueryBuilder.d.ts.map +1 -0
  288. package/build/src/vendored/utils/DriveQueryBuilder.js +17 -0
  289. package/build/src/vendored/utils/DriveQueryBuilder.js.map +1 -0
  290. package/build/src/vendored/utils/GaxiosConfig.d.ts +9 -0
  291. package/build/src/vendored/utils/GaxiosConfig.d.ts.map +1 -0
  292. package/build/src/vendored/utils/GaxiosConfig.js +30 -0
  293. package/build/src/vendored/utils/GaxiosConfig.js.map +1 -0
  294. package/build/src/vendored/utils/IdUtils.d.ts +13 -0
  295. package/build/src/vendored/utils/IdUtils.d.ts.map +1 -0
  296. package/build/src/vendored/utils/IdUtils.js +29 -0
  297. package/build/src/vendored/utils/IdUtils.js.map +1 -0
  298. package/build/src/vendored/utils/MimeHelper.d.ts +64 -0
  299. package/build/src/vendored/utils/MimeHelper.d.ts.map +1 -0
  300. package/build/src/vendored/utils/MimeHelper.js +174 -0
  301. package/build/src/vendored/utils/MimeHelper.js.map +1 -0
  302. package/build/src/vendored/utils/MimeHelper.test.d.ts +2 -0
  303. package/build/src/vendored/utils/MimeHelper.test.d.ts.map +1 -0
  304. package/build/src/vendored/utils/MimeHelper.test.js +47 -0
  305. package/build/src/vendored/utils/MimeHelper.test.js.map +1 -0
  306. package/build/src/vendored/utils/constants.d.ts +9 -0
  307. package/build/src/vendored/utils/constants.d.ts.map +1 -0
  308. package/build/src/vendored/utils/constants.js +9 -0
  309. package/build/src/vendored/utils/constants.js.map +1 -0
  310. package/build/src/vendored/utils/logger.d.ts +3 -0
  311. package/build/src/vendored/utils/logger.d.ts.map +1 -0
  312. package/build/src/vendored/utils/logger.js +15 -0
  313. package/build/src/vendored/utils/logger.js.map +1 -0
  314. package/build/src/vendored/utils/paths.d.ts +2 -0
  315. package/build/src/vendored/utils/paths.d.ts.map +1 -0
  316. package/build/src/vendored/utils/paths.js +19 -0
  317. package/build/src/vendored/utils/paths.js.map +1 -0
  318. package/build/src/vendored/utils/validation.d.ts +100 -0
  319. package/build/src/vendored/utils/validation.d.ts.map +1 -0
  320. package/build/src/vendored/utils/validation.js +161 -0
  321. package/build/src/vendored/utils/validation.js.map +1 -0
  322. package/build/src/version.d.ts +2 -0
  323. package/build/src/version.d.ts.map +1 -0
  324. package/build/src/version.js +29 -0
  325. package/build/src/version.js.map +1 -0
  326. package/build/src/version.test.d.ts +2 -0
  327. package/build/src/version.test.d.ts.map +1 -0
  328. package/build/src/version.test.js +19 -0
  329. package/build/src/version.test.js.map +1 -0
  330. package/build/tsconfig.tsbuildinfo +1 -0
  331. package/package.json +69 -4
package/LICENSE ADDED
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
package/NOTICE ADDED
@@ -0,0 +1,46 @@
1
+ workspace (https://github.com/n24q02m/workspace)
2
+ Copyright 2026 n24q02m
3
+
4
+ This product includes software developed by Google LLC and contributors
5
+ (gemini-cli-extensions/workspace, Apache-2.0), vendored under src/vendored/ (services + utils).
6
+
7
+ `scripts/sync-upstream.mjs` pulls a newer upstream revision over the vendored tree. It READS THE TWO
8
+ LISTS BELOW to decide what it may overwrite, so the lists are the contract, not documentation of it:
9
+ edit them in the same commit that forks or unforks a file. The script refuses to run if either list
10
+ is unparseable or names a file that is not on disk -- an empty list would otherwise read as
11
+ "nothing is protected" and overwrite every fork in silence.
12
+
13
+ ## Files intentionally forked from upstream
14
+
15
+ These no longer match gemini-cli-extensions/workspace byte-for-byte. `sync-upstream.mjs` reports them
16
+ as CONFLICT and leaves them alone; whoever syncs merges them by hand:
17
+
18
+ - src/vendored/services/DriveService.ts — SECURITY: Prevent path traversal in relative localPath
19
+ - src/vendored/services/CalendarService.ts — PERFORMANCE: Using Date.parse() instead of new Date().getTime() skips object allocation and reduces GC pressure
20
+ - src/vendored/utils/MimeHelper.ts — the multipart boundary suffix could be empty
21
+ (`.substring(7)` on a short `Math.random().toString(36)`, e.g. 0.5 -> "0.i"), so two messages
22
+ built in the same millisecond collided on their boundary. Now a randomUUID-derived suffix.
23
+ - src/vendored/services/CalendarValidation.ts — optimization: Date.parse vs new Date().getTime()
24
+ - src/vendored/services/SheetsService.ts — getText read N tabs in N `values.get` calls; now one
25
+ `values.batchGet` with a per-range fallback that preserves partial success. Sheet names are
26
+ also quote-escaped so a tab named `It's here` yields a parseable A1 range.
27
+ - src/vendored/utils/MimeHelper.ts — the multipart boundary suffix could be empty
28
+ (`.substring(7)` on a short `Math.random().toString(36)`, e.g. 0.5 -> "0.i"), so two messages
29
+ built in the same millisecond collided on their boundary. Now a randomUUID-derived suffix.
30
+ - src/vendored/utils/validation.ts — optimization: Date.parse vs new Date().getTime()
31
+
32
+ ## Files that replace an upstream file (ours, never synced)
33
+
34
+ Upstream has files at these paths too, but ours share nothing with them beyond the name: they are
35
+ shims that decouple the vendored services from gemini-cli's own infrastructure. Overwriting one with
36
+ its upstream namesake does not produce a merge conflict, it produces a build that pulls gemini-cli
37
+ back in -- so `sync-upstream.mjs` never copies over them and never reports them:
38
+
39
+ - src/vendored/utils/paths.ts — this server's own config/cache locations, not gemini-cli's.
40
+ - src/vendored/utils/logger.ts — logs to stderr, since stdout is the MCP transport. Line prefix
41
+ is `[workspace]`, renamed together with the repo (drift: ours, not an upstream change).
42
+ - src/vendored/auth/AuthManager.ts — reads `currentAccount()` and delegates to `WorkspaceAuth`,
43
+ where upstream reads gemini-cli's credential files.
44
+
45
+ Tests covering the forked behaviour live next to each file (`*.test.ts`); they are ours, not
46
+ upstream's, and `src/vendored/**` stays excluded from the coverage gate.
package/README.md CHANGED
@@ -1,3 +1,343 @@
1
- # Temporary Holding Version
1
+ <h1 align="center">workspace</h1>
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ <p align="center">
4
+ <strong>Google Workspace MCP — Docs, Drive, Calendar, Gmail, Sheets, Slides, Tasks, Chat, People, Forms</strong>
5
+ </p>
6
+
7
+ > **ARCHIVED 2026-09-13** — This repository is no longer maintained. Use the official Google Workspace APIs instead of this MCP server. Existing installations keep working but receive no updates or support.
8
+
9
+ <p align="center">
10
+ <a href="https://mcp.n24q02m.com/get-started/modes-overview/"><img alt="Mode: stdio · http remote oauth" src="https://img.shields.io/badge/mode-stdio_%C2%B7_http--remote--oauth-5C6BC0"></a>
11
+ <a href="https://github.com/n24q02m/workspace/actions/workflows/ci.yml"><img alt="CI" src="https://github.com/n24q02m/workspace/actions/workflows/ci.yml/badge.svg"></a>
12
+ <a href="https://github.com/n24q02m/workspace/actions/workflows/cd.yml"><img alt="CD" src="https://github.com/n24q02m/workspace/actions/workflows/cd.yml/badge.svg"></a>
13
+ <a href="https://codecov.io/gh/n24q02m/workspace"><img alt="codecov" src="https://codecov.io/gh/n24q02m/workspace/graph/badge.svg"></a>
14
+ <a href="https://github.com/n24q02m/workspace/releases/latest"><img alt="Latest release" src="https://img.shields.io/github/v/release/n24q02m/workspace?display_name=tag&sort=semver"></a>
15
+ <a href="https://github.com/python-semantic-release/python-semantic-release"><img alt="semantic-release" src="https://img.shields.io/badge/semantic--release-e10079?logo=semantic-release&logoColor=white"></a>
16
+ <a href="LICENSE"><img alt="License: Apache-2.0" src="https://img.shields.io/github/license/n24q02m/workspace"></a>
17
+ </p>
18
+
19
+ <p align="center">
20
+ <a href="https://mcp.n24q02m.com">Docs</a> ·
21
+ <a href="#install">Install</a> ·
22
+ <a href="#quick-start">Quick start</a> ·
23
+ <a href="https://github.com/n24q02m/workspace/discussions">Community</a>
24
+ </p>
25
+
26
+ <!-- BEGIN: AUTO-GENERATED-CROSS-PROMO -->
27
+ <details>
28
+ <summary><strong>Sister projects from n24q02m</strong> (click to expand)</summary>
29
+
30
+ | Project | Tagline | Tag |
31
+ |---|---|---|
32
+ | [agent-chat-plugin](https://github.com/n24q02m/agent-chat-plugin) | Peer AI agents chat in a shared folder — no human relay, no orchestrator, wor... | Tooling |
33
+ | [better-code-review-graph](https://github.com/n24q02m/better-code-review-graph) | Knowledge graph for token-efficient code reviews -- semantic search and call-... | MCP |
34
+ | [better-drive](https://github.com/n24q02m/better-drive) | 2-way Google Drive sync with .driveignore filter — rclone engine, Windows tray | Tooling |
35
+ | [better-email-mcp](https://github.com/n24q02m/better-email-mcp) | IMAP/SMTP email for AI agents -- read, send, organize folders, and manage att... | MCP |
36
+ | [better-godot-mcp](https://github.com/n24q02m/better-godot-mcp) | Composite MCP server for Godot Engine -- 17 composite tools for AI-assisted g... | MCP |
37
+ | [better-notion-mcp](https://github.com/n24q02m/better-notion-mcp) | Markdown-first Notion for AI agents -- pages, databases, blocks, and comments... | MCP |
38
+ | [better-semantic-release](https://github.com/n24q02m/better-semantic-release) | Drop-in python-semantic-release fork with built-in release-safety guards (orp... | Tooling |
39
+ | [better-telegram-mcp](https://github.com/n24q02m/better-telegram-mcp) | Telegram for AI agents -- messages, chats, media, and contacts across both bo... | MCP |
40
+ | [better-workspace-mcp](https://github.com/n24q02m/better-workspace-mcp) | Google Workspace MCP server (Docs/Drive/Calendar/Gmail/Sheets/Slides/Tasks/Ch... | MCP |
41
+ | [claude-plugins](https://github.com/n24q02m/claude-plugins) | Claude Code plugin marketplace for the n24q02m MCP servers -- install web sea... | Marketplace |
42
+ | [imagine-mcp](https://github.com/n24q02m/imagine-mcp) | Image and video understanding + generation for AI agents -- across Gemini, Op... | MCP |
43
+ | [jules-task-archiver](https://github.com/n24q02m/jules-task-archiver) | Chrome Extension for bulk operations on Jules tasks via batchexecute API -- a... | Tooling |
44
+ | [mcp-core](https://github.com/n24q02m/mcp-core) | Shared foundation for building MCP servers -- Streamable HTTP transport, OAut... | MCP |
45
+ | [mnemo-mcp](https://github.com/n24q02m/mnemo-mcp) | Persistent AI memory with hybrid search and embedded sync. Open, free, unlimi... | MCP |
46
+ | [qwen3-embed](https://github.com/n24q02m/qwen3-embed) | Lightweight Qwen3 text embedding and reranking via ONNX Runtime and GGUF | Library |
47
+ | [skret](https://github.com/n24q02m/skret) | Secrets without the server. | CLI |
48
+ | [tacet](https://github.com/n24q02m/tacet) | A self-distilling neuro-symbolic cascade that amortises LLM cost across knowl... | Tooling |
49
+ | [web-core](https://github.com/n24q02m/web-core) | Shared web infrastructure package for search, scraping, HTTP security, and st... | Library |
50
+ | [wet-mcp](https://github.com/n24q02m/wet-mcp) | Open-source MCP server for AI agents: web search, content extraction, and lib... | MCP |
51
+
52
+ </details>
53
+ <!-- END: AUTO-GENERATED-CROSS-PROMO -->
54
+
55
+ ## Table of contents
56
+
57
+ - [Install](#install)
58
+ - [Remote (HTTP mode)](#remote-http-mode)
59
+ - [Tools](#tools)
60
+ - [Quick start](#quick-start)
61
+ - [Multi-account](#multi-account)
62
+ - [Documentation](#documentation)
63
+ - [Deployment](#deployment)
64
+ - [Handover](docs/HANDOVER.md)
65
+ - [Contributing](#contributing)
66
+ - [License](#license)
67
+
68
+ ## Install
69
+
70
+ The server runs in two modes: **stdio** (default, single-user, one Google OAuth
71
+ client of your own) and **HTTP** (multi-user, per-user bearer tokens). For
72
+ stdio, add it to your MCP client config:
73
+
74
+ ```jsonc
75
+ {
76
+ "mcpServers": {
77
+ "workspace": {
78
+ "command": "npx",
79
+ "args": ["--yes", "@n24q02m/workspace@latest"],
80
+ "env": {
81
+ "GOOGLE_OAUTH_CLIENT_ID": "<your-client-id>.apps.googleusercontent.com",
82
+ "GOOGLE_OAUTH_CLIENT_SECRET": "<your-client-secret>"
83
+ }
84
+ }
85
+ }
86
+ }
87
+ ```
88
+
89
+ The package is `@n24q02m/workspace` (formerly `@n24q02m/better-workspace-mcp`;
90
+ old package receives one final release then freezes). The MCP Registry id stays
91
+ `io.github.n24q02m/better-workspace-mcp`, and the legacy `better-workspace-mcp`
92
+ command is kept as an alias of `workspace`.
93
+
94
+ Those two values come from an OAuth 2.0 client of type **Desktop app**, created in
95
+ the [Google Cloud Console](https://console.cloud.google.com/apis/credentials)
96
+ under APIs & Services → Credentials. Desktop is the right type because the server
97
+ receives the consent redirect on a
98
+ [loopback address](https://developers.google.com/identity/protocols/oauth2/native-app),
99
+ not on a public URL. Enable the Workspace APIs you plan to call on the same
100
+ project, and add yourself as a test user while the consent screen is unpublished.
101
+
102
+ The first run opens the Google consent screen in your browser; the refresh token
103
+ is stored encrypted on your machine under `~/.better-workspace/` (a legacy
104
+ `~/.better-workspace-mcp/` is read as a fallback), so later runs start without asking again.
105
+
106
+ The same server can also serve several people over HTTP -- see
107
+ [Remote (HTTP mode)](#remote-http-mode).
108
+
109
+ **Install with an AI agent** -- paste this to your AI coding agent:
110
+
111
+ > Install MCP server `workspace` following the steps at
112
+ > https://raw.githubusercontent.com/n24q02m/claude-plugins/main/plugins/better-workspace-mcp/setup-with-agent.md
113
+
114
+ ## Remote (HTTP mode)
115
+
116
+ Besides stdio, the server runs as a multi-user HTTP service. Each request carries a
117
+ bearer token from a users file (`WORKSPACE_USERS_FILE`), and each user's Google
118
+ credentials are kept in their own bucket, keyed by that user's namespace, so one
119
+ deployment serves several people without them sharing an account. Google consent for
120
+ an HTTP account runs on the host, with `workspace auth --user <namespace>`.
121
+
122
+ Point your MCP client at the host you deployed it on:
123
+
124
+ ```jsonc
125
+ {
126
+ "mcpServers": {
127
+ "workspace": {
128
+ "type": "http",
129
+ "url": "https://<your-host>/mcp"
130
+ }
131
+ }
132
+ }
133
+ ```
134
+
135
+ ### Modes
136
+
137
+ Two, and only two. There is no proxy or daemon mode: stdio speaks the MCP stdio
138
+ transport directly, with no HTTP hop inside it.
139
+
140
+ | Mode | Selected by | Serves | Google OAuth client |
141
+ | --- | --- | --- | --- |
142
+ | `stdio` | the default | one user, on their own machine | **Desktop app** |
143
+ | `http` | `--http`, `MCP_TRANSPORT=http`, or `TRANSPORT_MODE=http` | several users, one credential bucket per user namespace | **Web application** |
144
+
145
+ ### Two OAuth clients, not one
146
+
147
+ Google binds redirect URIs to the *type* of the OAuth client, so the two modes
148
+ cannot share one. stdio uses a **Desktop** client, which may redirect to any
149
+ loopback port. HTTP uses a **Web** client. Keep the two credentials under separate
150
+ names: pointing `GOOGLE_OAUTH_CLIENT_ID`/`_SECRET` at the Web client on a machine
151
+ that also runs stdio breaks every stdio install. That is why
152
+ `docker-compose.http.yml` reads the Web pair as `GOOGLE_OAUTH_WEB_CLIENT_ID`/`_SECRET`
153
+ and renames it on the way into the container.
154
+
155
+ ### Environment
156
+
157
+ | Variable | Required | What it does |
158
+ | --- | --- | --- |
159
+ | `GOOGLE_OAUTH_CLIENT_ID` | yes | Web client id. The server refuses to start without it. |
160
+ | `GOOGLE_OAUTH_CLIENT_SECRET` | yes | Web client secret. Same. |
161
+ | `CREDENTIAL_SECRET` | yes | Derives the encryption key of each user's credential store. The server refuses to start without it, rather than fail in the middle of a user's consent. |
162
+ | `WORKSPACE_USERS_FILE` | yes in HTTP | Users file that maps each bearer token to a user namespace (hull `multi` auth). Unset uses hull's default location. |
163
+ | `PORT` | no | Listen port. `0` (the default) asks the OS for a free one. |
164
+ | `HOST` | no | Bind address. Defaults to loopback, so a container needs `0.0.0.0`. |
165
+
166
+ Credentials are stored on local disk under `~/.better-workspace/`, which is the data volume in the container. A legacy `~/.better-workspace-mcp/` is read as a fallback.
167
+
168
+ `docker-compose.http.yml` in this repo is these variables written out as a
169
+ runnable overlay.
170
+
171
+ ## Tools
172
+
173
+ One composite tool per Workspace domain, plus `config` and `help`:
174
+
175
+ | Tool | What it covers |
176
+ | --- | --- |
177
+ | `docs` | Google Docs -- `getText`, `create`, `writeText`, `getSuggestions`, `replaceText`, `formatText` |
178
+ | `drive` | Files and folders -- `search`, `findFolder`, `createFolder`, `moveFile`, `renameFile`, `trashFile`, `downloadFile`, `getComments` |
179
+ | `calendar` | Events -- `listCalendars`, `listEvents`, `getEvent`, `createEvent`, `updateEvent`, `deleteEvent`, `respondToEvent`, `findFreeTime` |
180
+ | `gmail` | Mail -- `search`, `get`, `send`, `createDraft`, `sendDraft`, `modify`, `batchModify`, `modifyThread`, `downloadAttachment`, `listLabels`, `createLabel` |
181
+ | `sheets` | Spreadsheets, read-only -- `getText`, `getRange`, `getMetadata` |
182
+ | `slides` | Presentations -- 19 actions covering slides, text, shapes, images, tables, and speaker notes |
183
+ | `tasks` | Task lists and tasks -- `listTaskLists`, `listTasks`, `createTask`, `updateTask`, `completeTask`, `deleteTask` |
184
+ | `chat` | Google Chat -- `listSpaces`, `findSpaceByName`, `setUpSpace`, `getMessages`, `listThreads`, `sendMessage`, `sendDm`, `findDmByEmail` |
185
+ | `people` | Profile lookups -- `getMe`, `getUserProfile`, `getUserRelations` |
186
+ | `forms` | Forms -- `create`, `get`, `batchUpdate`, `listResponses`, `getResponse` |
187
+ | `time` | Local date/time/timezone helpers (no Google account needed) |
188
+ | `config` | Credential state and account management |
189
+ | `help` | Full documentation for any tool |
190
+
191
+ Questions are added to a form with `forms(action="batchUpdate")`, not at `create`;
192
+ responses are read-only, because the Forms API cannot write one. Listing or
193
+ deleting forms goes through `drive`.
194
+
195
+ ## Quick start
196
+
197
+ Check that the credentials landed, with the `config` tool. Before the first
198
+ consent this reports `awaiting_setup`; afterwards it names the account the server
199
+ is acting as:
200
+
201
+ ```json
202
+ { "action": "status" }
203
+ ```
204
+
205
+ Then call a domain tool. On `docs`, `create` returns the new document's ID, which
206
+ `getText` reads back:
207
+
208
+ ```json
209
+ { "action": "create", "title": "Notes", "content": "First line." }
210
+ { "action": "getText", "documentId": "<id-from-create>" }
211
+ ```
212
+
213
+ `time`, `config`, and `help` need no Google account, so they answer even before
214
+ consent -- `time` is the quickest check that the server is wired up at all:
215
+
216
+ ```json
217
+ { "action": "getCurrentTime" }
218
+ ```
219
+
220
+ To act as a second Google account, see [Multi-account](#multi-account).
221
+
222
+ ## Multi-account
223
+
224
+ Every domain tool takes an `account` parameter -- the email of the Google account
225
+ the call acts as. Omit it and the call runs against the primary account.
226
+
227
+ ```json
228
+ { "action": "search", "query": "is:unread", "account": "work@example.com" }
229
+ { "action": "search", "query": "is:unread" }
230
+ ```
231
+
232
+ Those two `gmail` calls read two different mailboxes: the first `work@example.com`,
233
+ the second whichever account is primary.
234
+
235
+ Accounts are managed through the `config` tool:
236
+
237
+ | Call | Effect |
238
+ | --- | --- |
239
+ | `config(action="account_add")` | In stdio, returns a URL to open; completing the Google consent there adds one more account. Over HTTP it returns the `workspace auth --user <namespace>` command to run on the host. |
240
+ | `config(action="account_list")` | The configured accounts and which one is primary. |
241
+ | `config(action="account_remove", account="<email>")` | Forget one account. |
242
+ | `config(action="account_set_default", account="<email>")` | Make one account the primary. |
243
+
244
+ The first account authorized becomes the primary. Removing the primary promotes
245
+ one of the remaining accounts; removing the last one puts the server back to
246
+ awaiting setup. Naming an account that is not configured is an error that names
247
+ it -- the call is never rerouted to the primary, because a silent fallback would
248
+ act on the wrong mailbox.
249
+
250
+ `account_add` chooses its flow by transport. In stdio it starts a temporary loopback
251
+ consent server and returns the URL. Over HTTP it does not serve consent; it returns
252
+ the `workspace auth --user <namespace>` command for the host.
253
+
254
+ `value="primary"` is stdio only; remote callers change the default with
255
+ `account_set_default`.
256
+
257
+ ### Coming from an earlier single-account build
258
+
259
+ Credentials stored by a build from before multi-account support are one flat blob
260
+ of tokens. The first run afterwards adopts that blob into the multi-account layout
261
+ under the account's email. The email comes from the stored `id_token` when it is
262
+ present -- no network needed, and that is the usual case. Otherwise the server asks
263
+ Google's userinfo endpoint, which needs network access and a token that is still
264
+ valid or refreshable.
265
+
266
+ If neither works, the server reports itself as awaiting setup and opens the browser
267
+ OAuth flow even though the stored token may still be fine. Completing that consent
268
+ works, and nothing is discarded: the account you just authorized is stored and
269
+ becomes the primary, while the old tokens are carried across under the key
270
+ `(unidentified)` rather than being overwritten. `config(action="account_list")` then
271
+ shows two entries:
272
+
273
+ ```json
274
+ { "accounts": ["(unidentified)", "you@example.com"], "primary": "you@example.com" }
275
+ ```
276
+
277
+ Nothing routes to `(unidentified)`: it is never promoted to primary while a real
278
+ account remains, and no call reaches it unless you name it explicitly. It is there
279
+ so a credential whose owner could not be determined is not silently thrown away.
280
+ Remove it once the re-authorized account is working:
281
+
282
+ ```json
283
+ { "action": "account_remove", "account": "(unidentified)" }
284
+ ```
285
+
286
+ After a successful adoption -- the usual case -- `config(action="account_list")`
287
+ shows exactly one account, and it is the primary.
288
+
289
+ ### Forms scopes and re-consent
290
+
291
+ The consent screen has requested the Google Forms scopes since before the `forms`
292
+ tool existed, so it arrived without a second trip through consent.
293
+
294
+ Accounts authorized *before* those scopes were added are covered too, but by a
295
+ different route: Google accepts `https://www.googleapis.com/auth/drive` in place of
296
+ the Forms scopes for every Forms method this server calls, and full `drive` has
297
+ been on the consent screen since the first release. Google never widens a token it
298
+ has already issued, so if a grant covers neither -- a user may withhold individual
299
+ restricted scopes at the consent screen -- the first `forms` call returns a 403
300
+ (`Request had insufficient authentication scopes`). Re-authorize just that account
301
+ with `config(action="account_add")`, signing in as the same account; the record is
302
+ replaced in place, so nothing else changes.
303
+
304
+ ## Documentation
305
+
306
+ Full docs at **[mcp.n24q02m.com/servers/better-workspace-mcp/](https://mcp.n24q02m.com/servers/better-workspace-mcp/)**:
307
+
308
+ - [Setup](https://mcp.n24q02m.com/servers/better-workspace-mcp/setup/) -- plugin install, Docker stdio, and Docker HTTP methods
309
+ - [Modes overview](https://mcp.n24q02m.com/get-started/modes-overview/) -- stdio (default) and HTTP (multi-user, bearer tokens)
310
+ - [Multi-user setup](https://mcp.n24q02m.com/get-started/multi-user/) -- the per-namespace credential model behind [Remote (HTTP mode)](#remote-http-mode)
311
+
312
+ Every tool also documents itself at runtime: call `help` for the full reference on
313
+ any of them, including the exact parameters each action takes.
314
+
315
+ ## Deployment
316
+
317
+ No hosted endpoint is operated for this server. The supported paths are the
318
+ stdio install above and a self-hosted HTTP deployment of your own.
319
+
320
+ To self-host HTTP mode, run the compose overlay from this repository:
321
+
322
+ ```sh
323
+ docker compose -f docker-compose.yml -f docker-compose.http.yml up
324
+ ```
325
+
326
+ It builds the `http` image locally and publishes it on host loopback only, at
327
+ `GOOGLE_OAUTH_WEB_CLIENT_ID`, `GOOGLE_OAUTH_WEB_CLIENT_SECRET`,
328
+ `CREDENTIAL_SECRET`, and `WORKSPACE_USERS_FILE` through your shell or an
329
+ `.env` file (see [Environment](#environment)). The users file maps each
330
+ bearer token to a user namespace; accounts are added on the host with
331
+ `workspace auth --user <namespace>`. For use beyond the local machine, put
332
+ your own TLS reverse proxy on the same host in front of it.
333
+
334
+ Each release also publishes multi-arch container images to Docker Hub and
335
+ GHCR; their default stage is the `http` server.
336
+
337
+ ## Contributing
338
+
339
+ See [CONTRIBUTING.md](CONTRIBUTING.md).
340
+
341
+ ## License
342
+
343
+ [Apache-2.0](LICENSE) © n24q02m