@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.
- package/LICENSE +202 -0
- package/NOTICE +46 -0
- package/README.md +342 -2
- package/bin/cli.mjs +144 -0
- package/build/src/auth/account-context.d.ts +3 -0
- package/build/src/auth/account-context.d.ts.map +1 -0
- package/build/src/auth/account-context.js +17 -0
- package/build/src/auth/account-context.js.map +1 -0
- package/build/src/auth/account-context.test.d.ts +2 -0
- package/build/src/auth/account-context.test.d.ts.map +1 -0
- package/build/src/auth/account-context.test.js +30 -0
- package/build/src/auth/account-context.test.js.map +1 -0
- package/build/src/auth/account-store.d.ts +87 -0
- package/build/src/auth/account-store.d.ts.map +1 -0
- package/build/src/auth/account-store.js +187 -0
- package/build/src/auth/account-store.js.map +1 -0
- package/build/src/auth/account-store.test.d.ts +2 -0
- package/build/src/auth/account-store.test.d.ts.map +1 -0
- package/build/src/auth/account-store.test.js +264 -0
- package/build/src/auth/account-store.test.js.map +1 -0
- package/build/src/auth/add-account.d.ts +12 -0
- package/build/src/auth/add-account.d.ts.map +1 -0
- package/build/src/auth/add-account.js +95 -0
- package/build/src/auth/add-account.js.map +1 -0
- package/build/src/auth/add-account.test.d.ts +2 -0
- package/build/src/auth/add-account.test.d.ts.map +1 -0
- package/build/src/auth/add-account.test.js +155 -0
- package/build/src/auth/add-account.test.js.map +1 -0
- package/build/src/auth/cli-auth.d.ts +2 -0
- package/build/src/auth/cli-auth.d.ts.map +1 -0
- package/build/src/auth/cli-auth.js +47 -0
- package/build/src/auth/cli-auth.js.map +1 -0
- package/build/src/auth/cli-auth.test.d.ts +2 -0
- package/build/src/auth/cli-auth.test.d.ts.map +1 -0
- package/build/src/auth/cli-auth.test.js +78 -0
- package/build/src/auth/cli-auth.test.js.map +1 -0
- package/build/src/auth/consent-server.d.ts +43 -0
- package/build/src/auth/consent-server.d.ts.map +1 -0
- package/build/src/auth/consent-server.js +56 -0
- package/build/src/auth/consent-server.js.map +1 -0
- package/build/src/auth/credential-state.d.ts +7 -0
- package/build/src/auth/credential-state.d.ts.map +1 -0
- package/build/src/auth/credential-state.js +64 -0
- package/build/src/auth/credential-state.js.map +1 -0
- package/build/src/auth/credential-state.test.d.ts +2 -0
- package/build/src/auth/credential-state.test.d.ts.map +1 -0
- package/build/src/auth/credential-state.test.js +142 -0
- package/build/src/auth/credential-state.test.js.map +1 -0
- package/build/src/auth/loopback-consent.d.ts +23 -0
- package/build/src/auth/loopback-consent.d.ts.map +1 -0
- package/build/src/auth/loopback-consent.js +145 -0
- package/build/src/auth/loopback-consent.js.map +1 -0
- package/build/src/auth/loopback-consent.test.d.ts +2 -0
- package/build/src/auth/loopback-consent.test.d.ts.map +1 -0
- package/build/src/auth/loopback-consent.test.js +131 -0
- package/build/src/auth/loopback-consent.test.js.map +1 -0
- package/build/src/auth/oauth-setup.d.ts +10 -0
- package/build/src/auth/oauth-setup.d.ts.map +1 -0
- package/build/src/auth/oauth-setup.js +92 -0
- package/build/src/auth/oauth-setup.js.map +1 -0
- package/build/src/auth/oauth-setup.test.d.ts +2 -0
- package/build/src/auth/oauth-setup.test.d.ts.map +1 -0
- package/build/src/auth/oauth-setup.test.js +164 -0
- package/build/src/auth/oauth-setup.test.js.map +1 -0
- package/build/src/auth/subject-context.d.ts +2 -0
- package/build/src/auth/subject-context.d.ts.map +1 -0
- package/build/src/auth/subject-context.js +16 -0
- package/build/src/auth/subject-context.js.map +1 -0
- package/build/src/auth/subject-context.test.d.ts +2 -0
- package/build/src/auth/subject-context.test.d.ts.map +1 -0
- package/build/src/auth/subject-context.test.js +34 -0
- package/build/src/auth/subject-context.test.js.map +1 -0
- package/build/src/auth/workspace-auth.d.ts +47 -0
- package/build/src/auth/workspace-auth.d.ts.map +1 -0
- package/build/src/auth/workspace-auth.js +123 -0
- package/build/src/auth/workspace-auth.js.map +1 -0
- package/build/src/auth/workspace-auth.test.d.ts +2 -0
- package/build/src/auth/workspace-auth.test.d.ts.map +1 -0
- package/build/src/auth/workspace-auth.test.js +242 -0
- package/build/src/auth/workspace-auth.test.js.map +1 -0
- package/build/src/constants.d.ts +6 -0
- package/build/src/constants.d.ts.map +1 -0
- package/build/src/constants.js +11 -0
- package/build/src/constants.js.map +1 -0
- package/build/src/create-server.d.ts +13 -0
- package/build/src/create-server.d.ts.map +1 -0
- package/build/src/create-server.js +34 -0
- package/build/src/create-server.js.map +1 -0
- package/build/src/create-server.test.d.ts +2 -0
- package/build/src/create-server.test.d.ts.map +1 -0
- package/build/src/create-server.test.js +13 -0
- package/build/src/create-server.test.js.map +1 -0
- package/build/src/docs/calendar.md +15 -0
- package/build/src/docs/chat.md +15 -0
- package/build/src/docs/config.md +117 -0
- package/build/src/docs/docs.md +36 -0
- package/build/src/docs/drive.md +15 -0
- package/build/src/docs/forms.md +119 -0
- package/build/src/docs/gmail.md +18 -0
- package/build/src/docs/overview.md +52 -0
- package/build/src/docs/people.md +10 -0
- package/build/src/docs/sheets.md +10 -0
- package/build/src/docs/slides.md +26 -0
- package/build/src/docs/tasks.md +13 -0
- package/build/src/docs/time.md +11 -0
- package/build/src/init-server.d.ts +10 -0
- package/build/src/init-server.d.ts.map +1 -0
- package/build/src/init-server.js +13 -0
- package/build/src/init-server.js.map +1 -0
- package/build/src/init-server.test.d.ts +2 -0
- package/build/src/init-server.test.d.ts.map +1 -0
- package/build/src/init-server.test.js +15 -0
- package/build/src/init-server.test.js.map +1 -0
- package/build/src/main.d.ts +33 -0
- package/build/src/main.d.ts.map +1 -0
- package/build/src/main.js +120 -0
- package/build/src/main.js.map +1 -0
- package/build/src/main.test.d.ts +2 -0
- package/build/src/main.test.d.ts.map +1 -0
- package/build/src/main.test.js +204 -0
- package/build/src/main.test.js.map +1 -0
- package/build/src/services/FormsService.d.ts +89 -0
- package/build/src/services/FormsService.d.ts.map +1 -0
- package/build/src/services/FormsService.js +140 -0
- package/build/src/services/FormsService.js.map +1 -0
- package/build/src/services/FormsService.test.d.ts +2 -0
- package/build/src/services/FormsService.test.d.ts.map +1 -0
- package/build/src/services/FormsService.test.js +173 -0
- package/build/src/services/FormsService.test.js.map +1 -0
- package/build/src/tools/config.d.ts +19 -0
- package/build/src/tools/config.d.ts.map +1 -0
- package/build/src/tools/config.js +100 -0
- package/build/src/tools/config.js.map +1 -0
- package/build/src/tools/config.test.d.ts +2 -0
- package/build/src/tools/config.test.d.ts.map +1 -0
- package/build/src/tools/config.test.js +201 -0
- package/build/src/tools/config.test.js.map +1 -0
- package/build/src/tools/domains/calendar.d.ts +3 -0
- package/build/src/tools/domains/calendar.d.ts.map +1 -0
- package/build/src/tools/domains/calendar.js +14 -0
- package/build/src/tools/domains/calendar.js.map +1 -0
- package/build/src/tools/domains/chat.d.ts +3 -0
- package/build/src/tools/domains/chat.d.ts.map +1 -0
- package/build/src/tools/domains/chat.js +16 -0
- package/build/src/tools/domains/chat.js.map +1 -0
- package/build/src/tools/domains/docs.d.ts +8 -0
- package/build/src/tools/domains/docs.d.ts.map +1 -0
- package/build/src/tools/domains/docs.js +11 -0
- package/build/src/tools/domains/docs.js.map +1 -0
- package/build/src/tools/domains/docs.test.d.ts +2 -0
- package/build/src/tools/domains/docs.test.d.ts.map +1 -0
- package/build/src/tools/domains/docs.test.js +111 -0
- package/build/src/tools/domains/docs.test.js.map +1 -0
- package/build/src/tools/domains/drive.d.ts +3 -0
- package/build/src/tools/domains/drive.d.ts.map +1 -0
- package/build/src/tools/domains/drive.js +14 -0
- package/build/src/tools/domains/drive.js.map +1 -0
- package/build/src/tools/domains/factory.d.ts +24 -0
- package/build/src/tools/domains/factory.d.ts.map +1 -0
- package/build/src/tools/domains/factory.js +43 -0
- package/build/src/tools/domains/factory.js.map +1 -0
- package/build/src/tools/domains/factory.test.d.ts +2 -0
- package/build/src/tools/domains/factory.test.d.ts.map +1 -0
- package/build/src/tools/domains/factory.test.js +48 -0
- package/build/src/tools/domains/factory.test.js.map +1 -0
- package/build/src/tools/domains/forms.d.ts +9 -0
- package/build/src/tools/domains/forms.d.ts.map +1 -0
- package/build/src/tools/domains/forms.js +12 -0
- package/build/src/tools/domains/forms.js.map +1 -0
- package/build/src/tools/domains/forms.test.d.ts +2 -0
- package/build/src/tools/domains/forms.test.d.ts.map +1 -0
- package/build/src/tools/domains/forms.test.js +93 -0
- package/build/src/tools/domains/forms.test.js.map +1 -0
- package/build/src/tools/domains/gmail.d.ts +3 -0
- package/build/src/tools/domains/gmail.d.ts.map +1 -0
- package/build/src/tools/domains/gmail.js +17 -0
- package/build/src/tools/domains/gmail.js.map +1 -0
- package/build/src/tools/domains/index.d.ts +20 -0
- package/build/src/tools/domains/index.d.ts.map +1 -0
- package/build/src/tools/domains/index.js +230 -0
- package/build/src/tools/domains/index.js.map +1 -0
- package/build/src/tools/domains/people.d.ts +3 -0
- package/build/src/tools/domains/people.d.ts.map +1 -0
- package/build/src/tools/domains/people.js +5 -0
- package/build/src/tools/domains/people.js.map +1 -0
- package/build/src/tools/domains/sheets.d.ts +3 -0
- package/build/src/tools/domains/sheets.d.ts.map +1 -0
- package/build/src/tools/domains/sheets.js +5 -0
- package/build/src/tools/domains/sheets.js.map +1 -0
- package/build/src/tools/domains/slides.d.ts +3 -0
- package/build/src/tools/domains/slides.d.ts.map +1 -0
- package/build/src/tools/domains/slides.js +25 -0
- package/build/src/tools/domains/slides.js.map +1 -0
- package/build/src/tools/domains/tasks.d.ts +3 -0
- package/build/src/tools/domains/tasks.d.ts.map +1 -0
- package/build/src/tools/domains/tasks.js +14 -0
- package/build/src/tools/domains/tasks.js.map +1 -0
- package/build/src/tools/domains/time.d.ts +3 -0
- package/build/src/tools/domains/time.d.ts.map +1 -0
- package/build/src/tools/domains/time.js +6 -0
- package/build/src/tools/domains/time.js.map +1 -0
- package/build/src/tools/helpers/errors.d.ts +48 -0
- package/build/src/tools/helpers/errors.d.ts.map +1 -0
- package/build/src/tools/helpers/errors.js +290 -0
- package/build/src/tools/helpers/errors.js.map +1 -0
- package/build/src/tools/helpers/errors.test.d.ts +2 -0
- package/build/src/tools/helpers/errors.test.d.ts.map +1 -0
- package/build/src/tools/helpers/errors.test.js +220 -0
- package/build/src/tools/helpers/errors.test.js.map +1 -0
- package/build/src/tools/registry.d.ts +14 -0
- package/build/src/tools/registry.d.ts.map +1 -0
- package/build/src/tools/registry.js +276 -0
- package/build/src/tools/registry.js.map +1 -0
- package/build/src/tools/registry.test.d.ts +2 -0
- package/build/src/tools/registry.test.d.ts.map +1 -0
- package/build/src/tools/registry.test.js +321 -0
- package/build/src/tools/registry.test.js.map +1 -0
- package/build/src/transports/http.d.ts +7 -0
- package/build/src/transports/http.d.ts.map +1 -0
- package/build/src/transports/http.js +56 -0
- package/build/src/transports/http.js.map +1 -0
- package/build/src/transports/http.test.d.ts +2 -0
- package/build/src/transports/http.test.d.ts.map +1 -0
- package/build/src/transports/http.test.js +76 -0
- package/build/src/transports/http.test.js.map +1 -0
- package/build/src/vendored/auth/AuthManager.d.ts +7 -0
- package/build/src/vendored/auth/AuthManager.d.ts.map +1 -0
- package/build/src/vendored/auth/AuthManager.js +11 -0
- package/build/src/vendored/auth/AuthManager.js.map +1 -0
- package/build/src/vendored/services/CalendarService.d.ts +164 -0
- package/build/src/vendored/services/CalendarService.d.ts.map +1 -0
- package/build/src/vendored/services/CalendarService.js +726 -0
- package/build/src/vendored/services/CalendarService.js.map +1 -0
- package/build/src/vendored/services/CalendarValidation.d.ts +9 -0
- package/build/src/vendored/services/CalendarValidation.d.ts.map +1 -0
- package/build/src/vendored/services/CalendarValidation.js +125 -0
- package/build/src/vendored/services/CalendarValidation.js.map +1 -0
- package/build/src/vendored/services/ChatService.d.ts +90 -0
- package/build/src/vendored/services/ChatService.d.ts.map +1 -0
- package/build/src/vendored/services/ChatService.js +451 -0
- package/build/src/vendored/services/ChatService.js.map +1 -0
- package/build/src/vendored/services/DocsService.d.ts +109 -0
- package/build/src/vendored/services/DocsService.d.ts.map +1 -0
- package/build/src/vendored/services/DocsService.js +663 -0
- package/build/src/vendored/services/DocsService.js.map +1 -0
- package/build/src/vendored/services/DocsService.test.d.ts +2 -0
- package/build/src/vendored/services/DocsService.test.d.ts.map +1 -0
- package/build/src/vendored/services/DocsService.test.js +77 -0
- package/build/src/vendored/services/DocsService.test.js.map +1 -0
- package/build/src/vendored/services/DriveService.d.ts +117 -0
- package/build/src/vendored/services/DriveService.d.ts.map +1 -0
- package/build/src/vendored/services/DriveService.js +527 -0
- package/build/src/vendored/services/DriveService.js.map +1 -0
- package/build/src/vendored/services/DriveService.test.d.ts +2 -0
- package/build/src/vendored/services/DriveService.test.d.ts.map +1 -0
- package/build/src/vendored/services/DriveService.test.js +115 -0
- package/build/src/vendored/services/DriveService.test.js.map +1 -0
- package/build/src/vendored/services/GmailService.d.ts +137 -0
- package/build/src/vendored/services/GmailService.d.ts.map +1 -0
- package/build/src/vendored/services/GmailService.js +681 -0
- package/build/src/vendored/services/GmailService.js.map +1 -0
- package/build/src/vendored/services/PeopleService.d.ts +42 -0
- package/build/src/vendored/services/PeopleService.d.ts.map +1 -0
- package/build/src/vendored/services/PeopleService.js +168 -0
- package/build/src/vendored/services/PeopleService.js.map +1 -0
- package/build/src/vendored/services/SheetsService.d.ts +52 -0
- package/build/src/vendored/services/SheetsService.d.ts.map +1 -0
- package/build/src/vendored/services/SheetsService.js +262 -0
- package/build/src/vendored/services/SheetsService.js.map +1 -0
- package/build/src/vendored/services/SheetsService.test.d.ts +2 -0
- package/build/src/vendored/services/SheetsService.test.d.ts.map +1 -0
- package/build/src/vendored/services/SheetsService.test.js +104 -0
- package/build/src/vendored/services/SheetsService.test.js.map +1 -0
- package/build/src/vendored/services/SlidesService.d.ts +167 -0
- package/build/src/vendored/services/SlidesService.d.ts.map +1 -0
- package/build/src/vendored/services/SlidesService.js +887 -0
- package/build/src/vendored/services/SlidesService.js.map +1 -0
- package/build/src/vendored/services/TasksService.d.ts +97 -0
- package/build/src/vendored/services/TasksService.d.ts.map +1 -0
- package/build/src/vendored/services/TasksService.js +234 -0
- package/build/src/vendored/services/TasksService.js.map +1 -0
- package/build/src/vendored/services/TimeService.d.ts +29 -0
- package/build/src/vendored/services/TimeService.d.ts.map +1 -0
- package/build/src/vendored/services/TimeService.js +71 -0
- package/build/src/vendored/services/TimeService.js.map +1 -0
- package/build/src/vendored/utils/DriveQueryBuilder.d.ts +15 -0
- package/build/src/vendored/utils/DriveQueryBuilder.d.ts.map +1 -0
- package/build/src/vendored/utils/DriveQueryBuilder.js +17 -0
- package/build/src/vendored/utils/DriveQueryBuilder.js.map +1 -0
- package/build/src/vendored/utils/GaxiosConfig.d.ts +9 -0
- package/build/src/vendored/utils/GaxiosConfig.d.ts.map +1 -0
- package/build/src/vendored/utils/GaxiosConfig.js +30 -0
- package/build/src/vendored/utils/GaxiosConfig.js.map +1 -0
- package/build/src/vendored/utils/IdUtils.d.ts +13 -0
- package/build/src/vendored/utils/IdUtils.d.ts.map +1 -0
- package/build/src/vendored/utils/IdUtils.js +29 -0
- package/build/src/vendored/utils/IdUtils.js.map +1 -0
- package/build/src/vendored/utils/MimeHelper.d.ts +64 -0
- package/build/src/vendored/utils/MimeHelper.d.ts.map +1 -0
- package/build/src/vendored/utils/MimeHelper.js +174 -0
- package/build/src/vendored/utils/MimeHelper.js.map +1 -0
- package/build/src/vendored/utils/MimeHelper.test.d.ts +2 -0
- package/build/src/vendored/utils/MimeHelper.test.d.ts.map +1 -0
- package/build/src/vendored/utils/MimeHelper.test.js +47 -0
- package/build/src/vendored/utils/MimeHelper.test.js.map +1 -0
- package/build/src/vendored/utils/constants.d.ts +9 -0
- package/build/src/vendored/utils/constants.d.ts.map +1 -0
- package/build/src/vendored/utils/constants.js +9 -0
- package/build/src/vendored/utils/constants.js.map +1 -0
- package/build/src/vendored/utils/logger.d.ts +3 -0
- package/build/src/vendored/utils/logger.d.ts.map +1 -0
- package/build/src/vendored/utils/logger.js +15 -0
- package/build/src/vendored/utils/logger.js.map +1 -0
- package/build/src/vendored/utils/paths.d.ts +2 -0
- package/build/src/vendored/utils/paths.d.ts.map +1 -0
- package/build/src/vendored/utils/paths.js +19 -0
- package/build/src/vendored/utils/paths.js.map +1 -0
- package/build/src/vendored/utils/validation.d.ts +100 -0
- package/build/src/vendored/utils/validation.d.ts.map +1 -0
- package/build/src/vendored/utils/validation.js +161 -0
- package/build/src/vendored/utils/validation.js.map +1 -0
- package/build/src/version.d.ts +2 -0
- package/build/src/version.d.ts.map +1 -0
- package/build/src/version.js +29 -0
- package/build/src/version.js.map +1 -0
- package/build/src/version.test.d.ts +2 -0
- package/build/src/version.test.d.ts.map +1 -0
- package/build/src/version.test.js +19 -0
- package/build/src/version.test.js.map +1 -0
- package/build/tsconfig.tsbuildinfo +1 -0
- package/package.json +69 -4
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
# forms
|
|
2
|
+
|
|
3
|
+
Google Forms operations, dispatched by `action` to `FormsService`. That service is
|
|
4
|
+
ours rather than vendored upstream code -- `gemini-cli-extensions/workspace` has no
|
|
5
|
+
Forms coverage -- so it lives in `src/services/`, outside the vendored boundary
|
|
6
|
+
described in `NOTICE`.
|
|
7
|
+
|
|
8
|
+
## account
|
|
9
|
+
|
|
10
|
+
- account (optional): email of the Google account to use; defaults to the primary account.
|
|
11
|
+
|
|
12
|
+
List what is configured, and which one is primary, with
|
|
13
|
+
`config(action="account_list")`. Naming an account that is not configured is an
|
|
14
|
+
error -- the call is never silently rerouted to the primary.
|
|
15
|
+
|
|
16
|
+
### Scopes
|
|
17
|
+
|
|
18
|
+
Forms uses two scopes, both already on this server's consent screen: `forms.body`
|
|
19
|
+
(`create`, `get`, `batchUpdate`) and `forms.responses.readonly` (`listResponses`,
|
|
20
|
+
`getResponse`). Nothing new is requested here.
|
|
21
|
+
|
|
22
|
+
Google accepts `https://www.googleapis.com/auth/drive` in place of either one --
|
|
23
|
+
a form is a Drive file, and every Forms method this tool calls lists `drive` among
|
|
24
|
+
its alternatives. This server has requested full `drive` since its first release,
|
|
25
|
+
which is *before* the two Forms scopes were added, so an account authorized back
|
|
26
|
+
then should still work without re-consenting.
|
|
27
|
+
|
|
28
|
+
That matters because Google never widens a token it has already issued. If an
|
|
29
|
+
account's grant somehow covers neither `drive` nor the Forms scopes -- Google lets
|
|
30
|
+
a user withhold individual restricted scopes at the consent screen -- the first
|
|
31
|
+
Forms call returns HTTP 403, usually reading `Request had insufficient
|
|
32
|
+
authentication scopes`. That is not a bug in this tool, and retrying will not clear
|
|
33
|
+
it.
|
|
34
|
+
|
|
35
|
+
Fix it by re-authorizing that one account:
|
|
36
|
+
|
|
37
|
+
1. `config(action="account_add")`
|
|
38
|
+
2. Open the URL it returns and sign in as **the same account**.
|
|
39
|
+
|
|
40
|
+
The consent screen is forced (`prompt=consent`), so the new token carries the
|
|
41
|
+
current scope set, and the account's stored record is replaced in place -- it keeps
|
|
42
|
+
its position and stays primary if it was primary. There is no need to
|
|
43
|
+
`account_remove` first, and doing so would leave you with nothing if you then
|
|
44
|
+
abandoned the consent screen.
|
|
45
|
+
|
|
46
|
+
## Actions
|
|
47
|
+
|
|
48
|
+
| Action | Required params | Optional params | Description |
|
|
49
|
+
| --- | --- | --- | --- |
|
|
50
|
+
| `create` | `title` | `documentTitle` | Create a new, empty form. The API copies **only** the title and `documentTitle`; questions, description and settings are rejected on create and must follow in a `batchUpdate`. Returns `formId`, `title`, `responderUri`. |
|
|
51
|
+
| `get` | `formId` | -- | The full form definition: info, items, `responderUri`, `revisionId`, and `linkedSheetId` if responses are also collecting into a Sheet. |
|
|
52
|
+
| `batchUpdate` | `formId`, `requests` | -- | Apply Forms API update requests -- the only way to add or change questions, the description, or settings after creation. Returns the API's `replies`. |
|
|
53
|
+
| `listResponses` | `formId` | `pageSize`, `pageToken`, `filter` | Submitted responses, newest page first. `filter` supports `timestamp > <RFC3339>` and `timestamp >= <RFC3339>`, e.g. `timestamp > 2026-01-01T00:00:00Z`. Returns `{responses, nextPageToken?}`; `responses` is `[]` when there are none. |
|
|
54
|
+
| `getResponse` | `formId`, `responseId` | -- | One submitted response. |
|
|
55
|
+
|
|
56
|
+
## formId
|
|
57
|
+
|
|
58
|
+
Accepts the ID on its own, or the editor URL
|
|
59
|
+
`https://docs.google.com/forms/d/<formId>/edit`.
|
|
60
|
+
|
|
61
|
+
The public responder link, `https://docs.google.com/forms/d/e/<responderId>/viewform`,
|
|
62
|
+
carries a **different** identifier that the API does not accept. Passing one is
|
|
63
|
+
refused by name rather than sent on to fail as an opaque 404. A `forms.gle/...`
|
|
64
|
+
short link cannot be resolved without following it -- open the form and copy the
|
|
65
|
+
editor URL instead.
|
|
66
|
+
|
|
67
|
+
## What this tool cannot do
|
|
68
|
+
|
|
69
|
+
These are missing from the Google Forms API itself, not omitted here:
|
|
70
|
+
|
|
71
|
+
- **List your forms.** The API has no list method. Use the `drive` tool:
|
|
72
|
+
`{"action": "search", "query": "mimeType='application/vnd.google-apps.form'"}`.
|
|
73
|
+
- **Delete a form.** Per the API's own description, "a form is created in Drive, and
|
|
74
|
+
deleting a form or changing its access protections is done via the Drive API" --
|
|
75
|
+
so trash it with `drive(action="trashFile", fileId="<id from the drive search>")`.
|
|
76
|
+
- **Rename the Drive file.** `documentTitle` can be set on `create` but cannot be
|
|
77
|
+
changed by `batchUpdate`; renaming goes through `drive(action="renameFile")`.
|
|
78
|
+
`batchUpdate` can still change the `title` respondents see.
|
|
79
|
+
- **Write, edit or delete a response.** `forms.responses` is read-only in the API;
|
|
80
|
+
responses exist only because a respondent submitted the form. `forms.responses.readonly`
|
|
81
|
+
is therefore the whole surface, not a restriction chosen here.
|
|
82
|
+
- **Subscribe to new responses** (`forms.watches`). It needs a Cloud Pub/Sub topic,
|
|
83
|
+
which this server does not provision.
|
|
84
|
+
- **Publish or unpublish** (`forms.setPublishSettings`). Not exposed by this tool.
|
|
85
|
+
Forms created here take the API default -- published, accepting responses.
|
|
86
|
+
|
|
87
|
+
If a form has a linked response Sheet, `get` returns its `linkedSheetId`, and the
|
|
88
|
+
`sheets` tool reads bulk responses from it more cheaply than paging `listResponses`.
|
|
89
|
+
|
|
90
|
+
## Result shape
|
|
91
|
+
|
|
92
|
+
Every action returns `{content: [{type: "text", text}]}` with `text` holding the
|
|
93
|
+
JSON payload. Failures are **not** returned as a successful-looking result: the
|
|
94
|
+
error propagates and the tool layer renders it as `isError: true` with a sanitized
|
|
95
|
+
message, so a caller can tell a failure from data.
|
|
96
|
+
|
|
97
|
+
## Examples
|
|
98
|
+
|
|
99
|
+
```json
|
|
100
|
+
{ "action": "create", "title": "Team retro" }
|
|
101
|
+
{ "action": "get", "formId": "https://docs.google.com/forms/d/1AbCdEf.../edit" }
|
|
102
|
+
{
|
|
103
|
+
"action": "batchUpdate",
|
|
104
|
+
"formId": "1AbCdEf...",
|
|
105
|
+
"requests": [
|
|
106
|
+
{
|
|
107
|
+
"createItem": {
|
|
108
|
+
"item": {
|
|
109
|
+
"title": "What went well?",
|
|
110
|
+
"questionItem": { "question": { "required": true, "textQuestion": { "paragraph": true } } }
|
|
111
|
+
},
|
|
112
|
+
"location": { "index": 0 }
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
]
|
|
116
|
+
}
|
|
117
|
+
{ "action": "listResponses", "formId": "1AbCdEf...", "filter": "timestamp > 2026-07-01T00:00:00Z" }
|
|
118
|
+
{ "action": "getResponse", "formId": "1AbCdEf...", "responseId": "ACYDBNi..." }
|
|
119
|
+
```
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# Gmail Tool
|
|
2
|
+
|
|
3
|
+
## Actions
|
|
4
|
+
- search
|
|
5
|
+
- get
|
|
6
|
+
- downloadAttachment
|
|
7
|
+
- modify
|
|
8
|
+
- batchModify
|
|
9
|
+
- modifyThread
|
|
10
|
+
- send
|
|
11
|
+
- createDraft
|
|
12
|
+
- sendDraft
|
|
13
|
+
- listLabels
|
|
14
|
+
- createLabel
|
|
15
|
+
|
|
16
|
+
## Parameters
|
|
17
|
+
|
|
18
|
+
- account (optional): email of the Google account to use; defaults to the primary account.
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# workspace tools
|
|
2
|
+
|
|
3
|
+
One composite tool per Google Workspace service, plus two infra tools.
|
|
4
|
+
|
|
5
|
+
- **docs** -- Google Docs (get/write text, create, suggestions, replace, format).
|
|
6
|
+
- **drive** -- files and folders (find, create, search, trash, rename, move, comments, download).
|
|
7
|
+
- **calendar** -- calendars and events (list, create, update, delete, respond, find free time).
|
|
8
|
+
- **gmail** -- mail (search, read, send, drafts, labels, modify messages and threads).
|
|
9
|
+
- **sheets** -- spreadsheets (text, ranges, metadata).
|
|
10
|
+
- **slides** -- presentations (text, slides, shapes, images, tables, speaker notes).
|
|
11
|
+
- **tasks** -- task lists and tasks (list, create, update, complete, delete).
|
|
12
|
+
- **chat** -- Google Chat spaces, messages and DMs.
|
|
13
|
+
- **people** -- contacts and profiles (own profile, user profile, relations).
|
|
14
|
+
- **forms** -- Google Forms (create, read, edit questions, read responses).
|
|
15
|
+
- **time** -- local date/time/timezone helpers. Needs no Google account.
|
|
16
|
+
- **config** -- server configuration, credential state, and the Google accounts this server can act as.
|
|
17
|
+
- **help** -- full documentation for a topic.
|
|
18
|
+
|
|
19
|
+
`help(topic="<name>")` returns the full document for any domain tool above, for
|
|
20
|
+
`config`, or for `overview`. The same documents are exposed as MCP resources
|
|
21
|
+
under `workspace://docs/<name>`.
|
|
22
|
+
|
|
23
|
+
## Multi-account
|
|
24
|
+
|
|
25
|
+
Every domain tool takes `account="<email>"`, choosing which Google account the
|
|
26
|
+
call acts as. Omit it and the call runs against the primary account. Manage the
|
|
27
|
+
set of accounts with `config`: `account_add`, `account_list`, `account_remove`,
|
|
28
|
+
`account_set_default` -- see `help(topic="config")`.
|
|
29
|
+
|
|
30
|
+
Naming an account that is not configured is an error that names it; the call is
|
|
31
|
+
never silently rerouted to the primary. `time` accepts `account` for signature
|
|
32
|
+
parity only -- it needs no Google account.
|
|
33
|
+
|
|
34
|
+
## Multi-user
|
|
35
|
+
|
|
36
|
+
Served over HTTP, the server separates callers as well as accounts. The two are
|
|
37
|
+
nested axes, not two words for one thing:
|
|
38
|
+
|
|
39
|
+
- **User** -- who is calling. Taken from the `sub` claim of the token that
|
|
40
|
+
authenticated the request. Every `sub` gets its own credential store, encrypted
|
|
41
|
+
under its own key, so one deployment serves several people without any of them
|
|
42
|
+
reaching another's credentials.
|
|
43
|
+
- **Account** -- which Google account a call acts as, chosen with `account=`.
|
|
44
|
+
Accounts live *inside* one user's store.
|
|
45
|
+
|
|
46
|
+
So `account_list` answers "which Google accounts have I connected", never "which
|
|
47
|
+
accounts does this deployment know about". Two users who each connect
|
|
48
|
+
`shared@example.com` end up with two independent records, and a `primary` set by
|
|
49
|
+
one is not a `primary` for the other.
|
|
50
|
+
|
|
51
|
+
In stdio there is one user by construction -- whoever is at the machine -- so only
|
|
52
|
+
the inner axis is visible. The account behaviour is identical in both.
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# Slides Tool
|
|
2
|
+
|
|
3
|
+
## Actions
|
|
4
|
+
- getText
|
|
5
|
+
- getMetadata
|
|
6
|
+
- getImages
|
|
7
|
+
- create
|
|
8
|
+
- addSlide
|
|
9
|
+
- deleteSlide
|
|
10
|
+
- duplicateSlide
|
|
11
|
+
- reorderSlides
|
|
12
|
+
- getSpeakerNotes
|
|
13
|
+
- updateSpeakerNotes
|
|
14
|
+
- replaceAllText
|
|
15
|
+
- insertText
|
|
16
|
+
- deleteText
|
|
17
|
+
- addShape
|
|
18
|
+
- addImage
|
|
19
|
+
- addTable
|
|
20
|
+
- updateTextStyle
|
|
21
|
+
- updateShapeProperties
|
|
22
|
+
- getSlideThumbnail
|
|
23
|
+
|
|
24
|
+
## Parameters
|
|
25
|
+
|
|
26
|
+
- account (optional): email of the Google account to use; defaults to the primary account.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# Time Tool — Full Documentation
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
Local date/time/timezone helpers. No Google account required.
|
|
5
|
+
|
|
6
|
+
## Actions
|
|
7
|
+
- **getCurrentDate** — the current date.
|
|
8
|
+
- **getCurrentTime** — the current time.
|
|
9
|
+
- **getTimeZone** — the system timezone.
|
|
10
|
+
|
|
11
|
+
The `account` param is accepted for signature parity but ignored (time needs no account).
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Better Workspace MCP Server -- Entry point
|
|
3
|
+
*
|
|
4
|
+
* Transport selection (M1):
|
|
5
|
+
* - stdio (default): one-shot Google OAuth setup on first run, MCP SDK
|
|
6
|
+
* StdioServerTransport directly. Single-account.
|
|
7
|
+
* - http: Milestone 3 (not yet implemented).
|
|
8
|
+
*/
|
|
9
|
+
export declare function initServer(): Promise<void>;
|
|
10
|
+
//# sourceMappingURL=init-server.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"init-server.d.ts","sourceRoot":"","sources":["../../src/init-server.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,wBAAsB,UAAU,kBAG/B"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Better Workspace MCP Server -- Entry point
|
|
3
|
+
*
|
|
4
|
+
* Transport selection (M1):
|
|
5
|
+
* - stdio (default): one-shot Google OAuth setup on first run, MCP SDK
|
|
6
|
+
* StdioServerTransport directly. Single-account.
|
|
7
|
+
* - http: Milestone 3 (not yet implemented).
|
|
8
|
+
*/
|
|
9
|
+
export async function initServer() {
|
|
10
|
+
const { startServer, getTransportMode } = await import('./main.js');
|
|
11
|
+
await startServer(getTransportMode());
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=init-server.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"init-server.js","sourceRoot":"","sources":["../../src/init-server.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,MAAM,CAAC,KAAK,UAAU,UAAU;IAC9B,MAAM,EAAE,WAAW,EAAE,gBAAgB,EAAE,GAAG,MAAM,MAAM,CAAC,WAAW,CAAC,CAAA;IACnE,MAAM,WAAW,CAAC,gBAAgB,EAAE,CAAC,CAAA;AACvC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"init-server.test.d.ts","sourceRoot":"","sources":["../../src/init-server.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { describe, expect, it, vi } from 'vitest';
|
|
2
|
+
vi.mock('./main.js', () => ({
|
|
3
|
+
startServer: vi.fn(),
|
|
4
|
+
getTransportMode: vi.fn(() => 'stdio')
|
|
5
|
+
}));
|
|
6
|
+
import { initServer } from './init-server.js';
|
|
7
|
+
import { getTransportMode, startServer } from './main.js';
|
|
8
|
+
describe('initServer', () => {
|
|
9
|
+
it('dynamically imports main and starts the server with the resolved transport mode', async () => {
|
|
10
|
+
await initServer();
|
|
11
|
+
expect(getTransportMode).toHaveBeenCalledOnce();
|
|
12
|
+
expect(startServer).toHaveBeenCalledWith('stdio');
|
|
13
|
+
});
|
|
14
|
+
});
|
|
15
|
+
//# sourceMappingURL=init-server.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"init-server.test.js","sourceRoot":"","sources":["../../src/init-server.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAA;AAEjD,EAAE,CAAC,IAAI,CAAC,WAAW,EAAE,GAAG,EAAE,CAAC,CAAC;IAC1B,WAAW,EAAE,EAAE,CAAC,EAAE,EAAE;IACpB,gBAAgB,EAAE,EAAE,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC;CACvC,CAAC,CAAC,CAAA;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAC7C,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AAEzD,QAAQ,CAAC,YAAY,EAAE,GAAG,EAAE;IAC1B,EAAE,CAAC,iFAAiF,EAAE,KAAK,IAAI,EAAE;QAC/F,MAAM,UAAU,EAAE,CAAA;QAElB,MAAM,CAAC,gBAAgB,CAAC,CAAC,oBAAoB,EAAE,CAAA;QAC/C,MAAM,CAAC,WAAW,CAAC,CAAC,oBAAoB,CAAC,OAAO,CAAC,CAAA;IACnD,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Unified entry point for Better Workspace MCP
|
|
3
|
+
*
|
|
4
|
+
* The console script is built with hull `buildCli`:
|
|
5
|
+
* - bare argv or flag-prefixed argv (`--http`) starts the server (`serve`).
|
|
6
|
+
* - `auth [--user <namespace>]` adds a Google account from the host (src/auth/cli-auth.ts).
|
|
7
|
+
* - `config`, `status`, `logout`, `doctor`, `token` are hull built-ins over the same store.
|
|
8
|
+
*
|
|
9
|
+
* TRANSPORT_MODE selects the transport:
|
|
10
|
+
* - "stdio" (default): Local mode. First run opens the Google consent flow on loopback,
|
|
11
|
+
* then the MCP SDK StdioServerTransport serves directly (no daemon proxy hop).
|
|
12
|
+
* - "http": Remote mode. hull `runHttpServer` with bearer-token auth (multi-user); each user
|
|
13
|
+
* has a credential namespace (src/transports/http.ts).
|
|
14
|
+
*/
|
|
15
|
+
/**
|
|
16
|
+
* Checks if the current module is the main entry point.
|
|
17
|
+
*/
|
|
18
|
+
export declare function isMain(importMetaUrl: string): boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Validates and returns the transport mode from the environment.
|
|
21
|
+
*/
|
|
22
|
+
export declare function getTransportMode(env?: NodeJS.ProcessEnv, argv?: string[]): string;
|
|
23
|
+
/**
|
|
24
|
+
* Starts the server for the specified mode.
|
|
25
|
+
*/
|
|
26
|
+
export declare function startServer(mode: string): Promise<void>;
|
|
27
|
+
export declare const mode: string;
|
|
28
|
+
/**
|
|
29
|
+
* Bootstrap function to start the server with error handling.
|
|
30
|
+
*/
|
|
31
|
+
export declare function bootstrap(selectedMode?: string): Promise<void>;
|
|
32
|
+
export declare function runCli(argv: string[]): Promise<void>;
|
|
33
|
+
//# sourceMappingURL=main.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../src/main.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAeH;;GAEG;AACH,wBAAgB,MAAM,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAkBrD;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,GAAE,MAAM,CAAC,UAAwB,EAAE,IAAI,GAAE,MAAM,EAAiB,GAAG,MAAM,CAG5G;AAED;;GAEG;AACH,wBAAsB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CA8B7D;AAGD,eAAO,MAAM,IAAI,QAAqB,CAAA;AAEtC;;GAEG;AACH,wBAAsB,SAAS,CAAC,YAAY,GAAE,MAAa,iBAO1D;AAGD,wBAAgB,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAkBpD"}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Unified entry point for Better Workspace MCP
|
|
3
|
+
*
|
|
4
|
+
* The console script is built with hull `buildCli`:
|
|
5
|
+
* - bare argv or flag-prefixed argv (`--http`) starts the server (`serve`).
|
|
6
|
+
* - `auth [--user <namespace>]` adds a Google account from the host (src/auth/cli-auth.ts).
|
|
7
|
+
* - `config`, `status`, `logout`, `doctor`, `token` are hull built-ins over the same store.
|
|
8
|
+
*
|
|
9
|
+
* TRANSPORT_MODE selects the transport:
|
|
10
|
+
* - "stdio" (default): Local mode. First run opens the Google consent flow on loopback,
|
|
11
|
+
* then the MCP SDK StdioServerTransport serves directly (no daemon proxy hop).
|
|
12
|
+
* - "http": Remote mode. hull `runHttpServer` with bearer-token auth (multi-user); each user
|
|
13
|
+
* has a credential namespace (src/transports/http.ts).
|
|
14
|
+
*/
|
|
15
|
+
import { realpathSync } from 'node:fs';
|
|
16
|
+
import { fileURLToPath } from 'node:url';
|
|
17
|
+
import { Server } from '@modelcontextprotocol/sdk/server/index.js';
|
|
18
|
+
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
19
|
+
import { buildCli } from '@n24q02m/hull';
|
|
20
|
+
import { authCommand } from './auth/cli-auth.js';
|
|
21
|
+
import { getState, resolveCredentialState } from './auth/credential-state.js';
|
|
22
|
+
import { runOAuthSetup } from './auth/oauth-setup.js';
|
|
23
|
+
import { SERVER_NAME, STORE_PLUGIN } from './constants.js';
|
|
24
|
+
import { registerTools } from './tools/registry.js';
|
|
25
|
+
import { startHttp } from './transports/http.js';
|
|
26
|
+
import { getPackageVersion } from './version.js';
|
|
27
|
+
/**
|
|
28
|
+
* Checks if the current module is the main entry point.
|
|
29
|
+
*/
|
|
30
|
+
export function isMain(importMetaUrl) {
|
|
31
|
+
const entrypoint = process.argv[1];
|
|
32
|
+
if (!entrypoint)
|
|
33
|
+
return false;
|
|
34
|
+
try {
|
|
35
|
+
const mainPath = realpathSync(fileURLToPath(importMetaUrl));
|
|
36
|
+
const entryPath = realpathSync(entrypoint);
|
|
37
|
+
if (process.platform === 'win32') {
|
|
38
|
+
// Normalize slashes and casing for Windows
|
|
39
|
+
const normalize = (p) => p.replace(/\\/g, '/').toLowerCase();
|
|
40
|
+
return normalize(mainPath) === normalize(entryPath);
|
|
41
|
+
}
|
|
42
|
+
return mainPath === entryPath;
|
|
43
|
+
}
|
|
44
|
+
catch {
|
|
45
|
+
return false;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Validates and returns the transport mode from the environment.
|
|
50
|
+
*/
|
|
51
|
+
export function getTransportMode(env = process.env, argv = process.argv) {
|
|
52
|
+
const isHttp = argv.includes('--http') || env.MCP_TRANSPORT === 'http' || env.TRANSPORT_MODE === 'http';
|
|
53
|
+
return isHttp ? 'http' : 'stdio';
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Starts the server for the specified mode.
|
|
57
|
+
*/
|
|
58
|
+
export async function startServer(mode) {
|
|
59
|
+
if (process.env.BETTER_WORKSPACE_MCP_BOOTSTRAPPED) {
|
|
60
|
+
console.error(`[${SERVER_NAME}] Startup aborted: server already running in this process tree.`);
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
process.env.BETTER_WORKSPACE_MCP_BOOTSTRAPPED = 'true';
|
|
64
|
+
if (mode === 'http') {
|
|
65
|
+
// Remote users are served by the bearer-auth users file, not by a Google consent screen.
|
|
66
|
+
await startHttp();
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
// Stdio mode: no static token env var. Google tokens persist to disk via credential-state,
|
|
70
|
+
// so only the FIRST run needs the browser step; later starts resolve straight to 'configured'.
|
|
71
|
+
await resolveCredentialState();
|
|
72
|
+
if (getState() !== 'configured') {
|
|
73
|
+
await runOAuthSetup(); // opens browser, persists Google tokens
|
|
74
|
+
await resolveCredentialState(); // -> 'configured'
|
|
75
|
+
}
|
|
76
|
+
const server = new Server({ name: SERVER_NAME, version: getPackageVersion() }, { capabilities: { tools: {}, resources: {} } });
|
|
77
|
+
registerTools(server); // NO client factory (single-account M1)
|
|
78
|
+
const transport = new StdioServerTransport();
|
|
79
|
+
await server.connect(transport);
|
|
80
|
+
console.error(`[${SERVER_NAME}] stdio mode ready (v${getPackageVersion()})`);
|
|
81
|
+
}
|
|
82
|
+
// Global state for the selected mode
|
|
83
|
+
export const mode = getTransportMode();
|
|
84
|
+
/**
|
|
85
|
+
* Bootstrap function to start the server with error handling.
|
|
86
|
+
*/
|
|
87
|
+
export async function bootstrap(selectedMode = mode) {
|
|
88
|
+
try {
|
|
89
|
+
await startServer(selectedMode);
|
|
90
|
+
}
|
|
91
|
+
catch (error) {
|
|
92
|
+
console.error('Failed to start server:', error instanceof Error ? error.message : String(error));
|
|
93
|
+
process.exit(1);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
// Builds the console-script CLI and runs it. Exported so the entry wiring is testable.
|
|
97
|
+
export function runCli(argv) {
|
|
98
|
+
const cli = buildCli(SERVER_NAME, {
|
|
99
|
+
serve: () => bootstrap(),
|
|
100
|
+
extra: {
|
|
101
|
+
auth: authCommand,
|
|
102
|
+
// Hull's built-in `relay` is not part of this server; refuse it with a pointer to `auth`.
|
|
103
|
+
relay: async () => {
|
|
104
|
+
console.error('relay was removed; run `workspace auth` (see README)');
|
|
105
|
+
return 2;
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
version: getPackageVersion(),
|
|
109
|
+
// Credentials are stored under STORE_PLUGIN, so `config`/`status` must read the same slug.
|
|
110
|
+
pluginName: STORE_PLUGIN
|
|
111
|
+
});
|
|
112
|
+
return cli(argv).then((code) => {
|
|
113
|
+
process.exitCode = code;
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
// Only run the CLI when this file is the entry point, and not inside the test environment.
|
|
117
|
+
if (isMain(import.meta.url) && process.env.NODE_ENV !== 'test') {
|
|
118
|
+
runCli(process.argv.slice(2));
|
|
119
|
+
}
|
|
120
|
+
//# sourceMappingURL=main.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"main.js","sourceRoot":"","sources":["../../src/main.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AACtC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AACxC,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAA;AAClE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAA;AAChF,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AAChD,OAAO,EAAE,QAAQ,EAAE,sBAAsB,EAAE,MAAM,4BA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