@headless-lms/server 0.1.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/_virtual/_rolldown/runtime.js +5 -0
- package/dist/app/community-mail.d.ts +26 -0
- package/dist/app/community-mail.js +96 -0
- package/dist/app/community-mail.js.map +1 -0
- package/dist/app/container.d.ts +22 -14
- package/dist/app/container.js +186 -62
- package/dist/app/container.js.map +1 -1
- package/dist/app/mcp-endpoints.d.ts +13 -0
- package/dist/app/mcp-endpoints.js +25 -0
- package/dist/app/mcp-endpoints.js.map +1 -0
- package/dist/http/config.d.ts +2 -1
- package/dist/http/errors.d.ts +14 -0
- package/dist/http/errors.js +147 -0
- package/dist/http/errors.js.map +1 -0
- package/dist/http/mcp/catalogue.d.ts +37 -0
- package/dist/http/mcp/catalogue.js +69 -0
- package/dist/http/mcp/catalogue.js.map +1 -0
- package/dist/http/mcp/challenge.d.ts +7 -0
- package/dist/http/mcp/challenge.js +35 -0
- package/dist/http/mcp/challenge.js.map +1 -0
- package/dist/http/mcp/input-schema.d.ts +7 -0
- package/dist/http/mcp/input-schema.js +28 -0
- package/dist/http/mcp/input-schema.js.map +1 -0
- package/dist/http/mcp/route.d.ts +8 -0
- package/dist/http/mcp/route.js +75 -0
- package/dist/http/mcp/route.js.map +1 -0
- package/dist/http/mcp/server.d.ts +8 -0
- package/dist/http/mcp/server.js +31 -0
- package/dist/http/mcp/server.js.map +1 -0
- package/dist/http/mcp/test-support.d.ts +55 -0
- package/dist/http/mcp/test-support.js +151 -0
- package/dist/http/mcp/test-support.js.map +1 -0
- package/dist/http/mcp/tool.d.ts +48 -0
- package/dist/http/mcp/tool.js +58 -0
- package/dist/http/mcp/tool.js.map +1 -0
- package/dist/http/mcp/tools/automations.d.ts +6 -0
- package/dist/http/mcp/tools/automations.js +120 -0
- package/dist/http/mcp/tools/automations.js.map +1 -0
- package/dist/http/mcp/tools/catalog.d.ts +6 -0
- package/dist/http/mcp/tools/catalog.js +200 -0
- package/dist/http/mcp/tools/catalog.js.map +1 -0
- package/dist/http/mcp/tools/comments.d.ts +6 -0
- package/dist/http/mcp/tools/comments.js +70 -0
- package/dist/http/mcp/tools/comments.js.map +1 -0
- package/dist/http/mcp/tools/communities.d.ts +6 -0
- package/dist/http/mcp/tools/communities.js +175 -0
- package/dist/http/mcp/tools/communities.js.map +1 -0
- package/dist/http/mcp/tools/community-members.d.ts +6 -0
- package/dist/http/mcp/tools/community-members.js +89 -0
- package/dist/http/mcp/tools/community-members.js.map +1 -0
- package/dist/http/mcp/tools/community-moderation.d.ts +6 -0
- package/dist/http/mcp/tools/community-moderation.js +144 -0
- package/dist/http/mcp/tools/community-moderation.js.map +1 -0
- package/dist/http/mcp/tools/courses.d.ts +6 -0
- package/dist/http/mcp/tools/courses.js +121 -0
- package/dist/http/mcp/tools/courses.js.map +1 -0
- package/dist/http/mcp/tools/index.d.ts +6 -0
- package/dist/http/mcp/tools/index.js +23 -0
- package/dist/http/mcp/tools/index.js.map +1 -0
- package/dist/http/mcp/tools/people.d.ts +6 -0
- package/dist/http/mcp/tools/people.js +145 -0
- package/dist/http/mcp/tools/people.js.map +1 -0
- package/dist/http/plugins/auth.js +13 -5
- package/dist/http/plugins/auth.js.map +1 -1
- package/dist/http/plugins/error-handler.d.ts +3 -2
- package/dist/http/plugins/error-handler.js +52 -57
- package/dist/http/plugins/error-handler.js.map +1 -1
- package/dist/http/plugins/openapi.js +70 -20
- package/dist/http/plugins/openapi.js.map +1 -1
- package/dist/http/routes/access.d.ts +7 -0
- package/dist/http/routes/access.js +140 -0
- package/dist/http/routes/access.js.map +1 -0
- package/dist/http/routes/activities.js +97 -20
- package/dist/http/routes/activities.js.map +1 -1
- package/dist/http/routes/assets.js +60 -51
- package/dist/http/routes/assets.js.map +1 -1
- package/dist/http/routes/automations.js +64 -20
- package/dist/http/routes/automations.js.map +1 -1
- package/dist/http/routes/bundles.d.ts +7 -0
- package/dist/http/routes/bundles.js +181 -0
- package/dist/http/routes/bundles.js.map +1 -0
- package/dist/http/routes/communities.d.ts +7 -0
- package/dist/http/routes/communities.js +462 -0
- package/dist/http/routes/communities.js.map +1 -0
- package/dist/http/routes/community-moderation.d.ts +7 -0
- package/dist/http/routes/community-moderation.js +425 -0
- package/dist/http/routes/community-moderation.js.map +1 -0
- package/dist/http/routes/course-analytics.d.ts +7 -0
- package/dist/http/routes/course-analytics.js +60 -0
- package/dist/http/routes/course-analytics.js.map +1 -0
- package/dist/http/routes/courses.js +38 -23
- package/dist/http/routes/courses.js.map +1 -1
- package/dist/http/routes/dashboard.js +17 -8
- package/dist/http/routes/dashboard.js.map +1 -1
- package/dist/http/routes/discussion.js +35 -27
- package/dist/http/routes/discussion.js.map +1 -1
- package/dist/http/routes/downloads.js +58 -40
- package/dist/http/routes/downloads.js.map +1 -1
- package/dist/http/routes/entitlements.js +16 -7
- package/dist/http/routes/entitlements.js.map +1 -1
- package/dist/http/routes/integrations.js +38 -41
- package/dist/http/routes/integrations.js.map +1 -1
- package/dist/http/routes/member/actor.d.ts +14 -0
- package/dist/http/routes/member/actor.js +11 -0
- package/dist/http/routes/member/actor.js.map +1 -0
- package/dist/http/routes/member/assets.d.ts +7 -0
- package/dist/http/routes/member/assets.js +79 -0
- package/dist/http/routes/member/assets.js.map +1 -0
- package/dist/http/routes/member/chats.d.ts +7 -0
- package/dist/http/routes/member/chats.js +456 -0
- package/dist/http/routes/member/chats.js.map +1 -0
- package/dist/http/routes/member/comments.d.ts +7 -0
- package/dist/http/routes/member/comments.js +187 -0
- package/dist/http/routes/member/comments.js.map +1 -0
- package/dist/http/routes/member/community.d.ts +7 -0
- package/dist/http/routes/member/community.js +288 -0
- package/dist/http/routes/member/community.js.map +1 -0
- package/dist/http/routes/member/courses.d.ts +7 -0
- package/dist/http/routes/member/courses.js +101 -0
- package/dist/http/routes/member/courses.js.map +1 -0
- package/dist/http/routes/member/downloads.d.ts +7 -0
- package/dist/http/routes/member/downloads.js +56 -0
- package/dist/http/routes/member/downloads.js.map +1 -0
- package/dist/http/routes/member/files.d.ts +7 -0
- package/dist/http/routes/member/files.js +184 -0
- package/dist/http/routes/member/files.js.map +1 -0
- package/dist/http/routes/member/index.d.ts +7 -0
- package/dist/http/routes/member/index.js +31 -0
- package/dist/http/routes/member/index.js.map +1 -0
- package/dist/http/routes/member/notifications.d.ts +7 -0
- package/dist/http/routes/member/notifications.js +101 -0
- package/dist/http/routes/member/notifications.js.map +1 -0
- package/dist/http/routes/member/org.d.ts +7 -0
- package/dist/http/routes/member/org.js +56 -0
- package/dist/http/routes/member/org.js.map +1 -0
- package/dist/http/routes/member/posts.d.ts +7 -0
- package/dist/http/routes/member/posts.js +612 -0
- package/dist/http/routes/member/posts.js.map +1 -0
- package/dist/http/routes/member/profile.d.ts +7 -0
- package/dist/http/routes/member/profile.js +48 -0
- package/dist/http/routes/member/profile.js.map +1 -0
- package/dist/http/routes/member/progress.d.ts +7 -0
- package/dist/http/routes/member/progress.js +60 -0
- package/dist/http/routes/member/progress.js.map +1 -0
- package/dist/http/routes/organizations.js +49 -24
- package/dist/http/routes/organizations.js.map +1 -1
- package/dist/http/routes/students.js +43 -37
- package/dist/http/routes/students.js.map +1 -1
- package/dist/http/routes/webhooks.d.ts +7 -0
- package/dist/http/routes/webhooks.js +167 -0
- package/dist/http/routes/webhooks.js.map +1 -0
- package/dist/http/routes.js +14 -2
- package/dist/http/routes.js.map +1 -1
- package/dist/http/schemas/access.d.ts +146 -0
- package/dist/http/schemas/access.js +36 -0
- package/dist/http/schemas/access.js.map +1 -0
- package/dist/http/schemas/activities.d.ts +36 -1
- package/dist/http/schemas/activities.js +9 -4
- package/dist/http/schemas/activities.js.map +1 -1
- package/dist/http/schemas/assets.d.ts +76 -73
- package/dist/http/schemas/assets.js +23 -13
- package/dist/http/schemas/assets.js.map +1 -1
- package/dist/http/schemas/automations.d.ts +85 -8
- package/dist/http/schemas/automations.js +13 -2
- package/dist/http/schemas/automations.js.map +1 -1
- package/dist/http/schemas/bundles.d.ts +63 -0
- package/dist/http/schemas/bundles.js +23 -0
- package/dist/http/schemas/bundles.js.map +1 -0
- package/dist/http/schemas/chats.d.ts +386 -0
- package/dist/http/schemas/chats.js +58 -0
- package/dist/http/schemas/chats.js.map +1 -0
- package/dist/http/schemas/community.d.ts +537 -0
- package/dist/http/schemas/community.js +129 -0
- package/dist/http/schemas/community.js.map +1 -0
- package/dist/http/schemas/content.d.ts +22 -13
- package/dist/http/schemas/content.js +11 -9
- package/dist/http/schemas/content.js.map +1 -1
- package/dist/http/schemas/course-analytics.d.ts +29 -0
- package/dist/http/schemas/course-analytics.js +21 -0
- package/dist/http/schemas/course-analytics.js.map +1 -0
- package/dist/http/schemas/dashboard.js.map +1 -1
- package/dist/http/schemas/discussion.d.ts +85 -23
- package/dist/http/schemas/discussion.js +12 -11
- package/dist/http/schemas/discussion.js.map +1 -1
- package/dist/http/schemas/downloads.d.ts +13 -5
- package/dist/http/schemas/downloads.js +14 -11
- package/dist/http/schemas/downloads.js.map +1 -1
- package/dist/http/schemas/entitlements.d.ts +14 -6
- package/dist/http/schemas/entitlements.js +8 -6
- package/dist/http/schemas/entitlements.js.map +1 -1
- package/dist/http/schemas/files.d.ts +45 -0
- package/dist/http/schemas/files.js +25 -0
- package/dist/http/schemas/files.js.map +1 -0
- package/dist/http/schemas/index.d.ts +19 -10
- package/dist/http/schemas/index.js +19 -10
- package/dist/http/schemas/integrations.d.ts +4 -4
- package/dist/http/schemas/integrations.js.map +1 -1
- package/dist/http/schemas/invites.d.ts +4 -0
- package/dist/http/schemas/invites.js +3 -1
- package/dist/http/schemas/invites.js.map +1 -1
- package/dist/http/schemas/{learn.d.ts → member.d.ts} +42 -19
- package/dist/http/schemas/{learn.js → member.js} +17 -13
- package/dist/http/schemas/member.js.map +1 -0
- package/dist/http/schemas/members.d.ts +39 -6
- package/dist/http/schemas/members.js +17 -3
- package/dist/http/schemas/members.js.map +1 -1
- package/dist/http/schemas/notifications.d.ts +227 -0
- package/dist/http/schemas/notifications.js +44 -0
- package/dist/http/schemas/notifications.js.map +1 -0
- package/dist/http/schemas/organizations.js.map +1 -1
- package/dist/http/schemas/posts.d.ts +316 -0
- package/dist/http/schemas/posts.js +47 -0
- package/dist/http/schemas/posts.js.map +1 -0
- package/dist/http/schemas/profile.d.ts +23 -0
- package/dist/http/schemas/profile.js +15 -0
- package/dist/http/schemas/profile.js.map +1 -0
- package/dist/http/schemas/settings.js.map +1 -1
- package/dist/http/schemas/shared.d.ts +26 -1
- package/dist/http/schemas/shared.js +22 -3
- package/dist/http/schemas/shared.js.map +1 -1
- package/dist/http/schemas/students.d.ts +32 -10
- package/dist/http/schemas/students.js +19 -6
- package/dist/http/schemas/students.js.map +1 -1
- package/dist/http/scope.d.ts +2 -1
- package/dist/http/scope.js +20 -4
- package/dist/http/scope.js.map +1 -1
- package/dist/http/server.js +10 -3
- package/dist/http/server.js.map +1 -1
- package/dist/http/web-bridge.d.ts +1 -1
- package/dist/http/web-bridge.js +2 -2
- package/dist/http/web-bridge.js.map +1 -1
- package/dist/http/well-known.d.ts +7 -0
- package/dist/http/well-known.js +22 -0
- package/dist/http/well-known.js.map +1 -0
- package/dist/index.d.ts +3 -2
- package/dist/index.js +4 -2
- package/dist/index.js.map +1 -1
- package/dist/node_modules/.pnpm/@jridgewell_sourcemap-codec@1.5.5/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.js +78 -0
- package/dist/node_modules/.pnpm/@jridgewell_sourcemap-codec@1.5.5/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.js.map +1 -0
- package/dist/node_modules/.pnpm/@vitest_expect@2.1.9/node_modules/@vitest/expect/dist/index.js +1267 -0
- package/dist/node_modules/.pnpm/@vitest_expect@2.1.9/node_modules/@vitest/expect/dist/index.js.map +1 -0
- package/dist/node_modules/.pnpm/@vitest_pretty-format@2.1.9/node_modules/@vitest/pretty-format/dist/index.js +814 -0
- package/dist/node_modules/.pnpm/@vitest_pretty-format@2.1.9/node_modules/@vitest/pretty-format/dist/index.js.map +1 -0
- package/dist/node_modules/.pnpm/@vitest_runner@2.1.9/node_modules/@vitest/runner/dist/chunk-tasks.js +43 -0
- package/dist/node_modules/.pnpm/@vitest_runner@2.1.9/node_modules/@vitest/runner/dist/chunk-tasks.js.map +1 -0
- package/dist/node_modules/.pnpm/@vitest_runner@2.1.9/node_modules/@vitest/runner/dist/index.js +527 -0
- package/dist/node_modules/.pnpm/@vitest_runner@2.1.9/node_modules/@vitest/runner/dist/index.js.map +1 -0
- package/dist/node_modules/.pnpm/@vitest_runner@2.1.9/node_modules/@vitest/runner/dist/utils.js +2 -0
- package/dist/node_modules/.pnpm/@vitest_snapshot@2.1.9/node_modules/@vitest/snapshot/dist/index.js +1737 -0
- package/dist/node_modules/.pnpm/@vitest_snapshot@2.1.9/node_modules/@vitest/snapshot/dist/index.js.map +1 -0
- package/dist/node_modules/.pnpm/@vitest_spy@2.1.9/node_modules/@vitest/spy/dist/index.js +137 -0
- package/dist/node_modules/.pnpm/@vitest_spy@2.1.9/node_modules/@vitest/spy/dist/index.js.map +1 -0
- package/dist/node_modules/.pnpm/@vitest_utils@2.1.9/node_modules/@vitest/utils/dist/chunk-_commonjsHelpers.js +118 -0
- package/dist/node_modules/.pnpm/@vitest_utils@2.1.9/node_modules/@vitest/utils/dist/chunk-_commonjsHelpers.js.map +1 -0
- package/dist/node_modules/.pnpm/@vitest_utils@2.1.9/node_modules/@vitest/utils/dist/diff.js +1222 -0
- package/dist/node_modules/.pnpm/@vitest_utils@2.1.9/node_modules/@vitest/utils/dist/diff.js.map +1 -0
- package/dist/node_modules/.pnpm/@vitest_utils@2.1.9/node_modules/@vitest/utils/dist/error.js +91 -0
- package/dist/node_modules/.pnpm/@vitest_utils@2.1.9/node_modules/@vitest/utils/dist/error.js.map +1 -0
- package/dist/node_modules/.pnpm/@vitest_utils@2.1.9/node_modules/@vitest/utils/dist/helpers.js +113 -0
- package/dist/node_modules/.pnpm/@vitest_utils@2.1.9/node_modules/@vitest/utils/dist/helpers.js.map +1 -0
- package/dist/node_modules/.pnpm/@vitest_utils@2.1.9/node_modules/@vitest/utils/dist/index.js +449 -0
- package/dist/node_modules/.pnpm/@vitest_utils@2.1.9/node_modules/@vitest/utils/dist/index.js.map +1 -0
- package/dist/node_modules/.pnpm/@vitest_utils@2.1.9/node_modules/@vitest/utils/dist/source-map.js +163 -0
- package/dist/node_modules/.pnpm/@vitest_utils@2.1.9/node_modules/@vitest/utils/dist/source-map.js.map +1 -0
- package/dist/node_modules/.pnpm/chai@5.3.3/node_modules/chai/index.js +3187 -0
- package/dist/node_modules/.pnpm/chai@5.3.3/node_modules/chai/index.js.map +1 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/arguments.js +11 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/arguments.js.map +1 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/array.js +16 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/array.js.map +1 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/bigint.js +11 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/bigint.js.map +1 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/class.js +15 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/class.js.map +1 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/date.js +13 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/date.js.map +1 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/error.js +34 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/error.js.map +1 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/function.js +12 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/function.js.map +1 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/helpers.js +122 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/helpers.js.map +1 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/html.js +39 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/html.js.map +1 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/index.js +99 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/index.js.map +1 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/map.js +25 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/map.js.map +1 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/number.js +14 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/number.js.map +1 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/object.js +21 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/object.js.map +1 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/promise.js +6 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/promise.js.map +1 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/regexp.js +12 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/regexp.js.map +1 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/set.js +18 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/set.js.map +1 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/string.js +24 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/string.js.map +1 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/symbol.js +9 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/symbol.js.map +1 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/typedarray.js +30 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/typedarray.js.map +1 -0
- package/dist/node_modules/.pnpm/magic-string@0.30.21/node_modules/magic-string/dist/magic-string.es.js +939 -0
- package/dist/node_modules/.pnpm/magic-string@0.30.21/node_modules/magic-string/dist/magic-string.es.js.map +1 -0
- package/dist/node_modules/.pnpm/pathe@1.1.2/node_modules/pathe/dist/shared/pathe.ff20891b.js +82 -0
- package/dist/node_modules/.pnpm/pathe@1.1.2/node_modules/pathe/dist/shared/pathe.ff20891b.js.map +1 -0
- package/dist/node_modules/.pnpm/tinyrainbow@1.2.0/node_modules/tinyrainbow/dist/chunk-BVHSVHOK.js +82 -0
- package/dist/node_modules/.pnpm/tinyrainbow@1.2.0/node_modules/tinyrainbow/dist/chunk-BVHSVHOK.js.map +1 -0
- package/dist/node_modules/.pnpm/tinyrainbow@1.2.0/node_modules/tinyrainbow/dist/node.js +8 -0
- package/dist/node_modules/.pnpm/tinyrainbow@1.2.0/node_modules/tinyrainbow/dist/node.js.map +1 -0
- package/dist/node_modules/.pnpm/tinyspy@3.0.2/node_modules/tinyspy/dist/index.js +83 -0
- package/dist/node_modules/.pnpm/tinyspy@3.0.2/node_modules/tinyspy/dist/index.js.map +1 -0
- package/dist/node_modules/.pnpm/vitest@2.1.9_@types_node@22.20.0_jsdom@25.0.1_lightningcss@1.32.0/node_modules/vitest/dist/chunks/_commonjsHelpers.BFTU3MAI.js +9 -0
- package/dist/node_modules/.pnpm/vitest@2.1.9_@types_node@22.20.0_jsdom@25.0.1_lightningcss@1.32.0/node_modules/vitest/dist/chunks/_commonjsHelpers.BFTU3MAI.js.map +1 -0
- package/dist/node_modules/.pnpm/vitest@2.1.9_@types_node@22.20.0_jsdom@25.0.1_lightningcss@1.32.0/node_modules/vitest/dist/chunks/date.W2xKR2qe.js +51 -0
- package/dist/node_modules/.pnpm/vitest@2.1.9_@types_node@22.20.0_jsdom@25.0.1_lightningcss@1.32.0/node_modules/vitest/dist/chunks/date.W2xKR2qe.js.map +1 -0
- package/dist/node_modules/.pnpm/vitest@2.1.9_@types_node@22.20.0_jsdom@25.0.1_lightningcss@1.32.0/node_modules/vitest/dist/chunks/utils.C8RiOc4B.js +48 -0
- package/dist/node_modules/.pnpm/vitest@2.1.9_@types_node@22.20.0_jsdom@25.0.1_lightningcss@1.32.0/node_modules/vitest/dist/chunks/utils.C8RiOc4B.js.map +1 -0
- package/dist/node_modules/.pnpm/vitest@2.1.9_@types_node@22.20.0_jsdom@25.0.1_lightningcss@1.32.0/node_modules/vitest/dist/chunks/vi.DgezovHB.js +2426 -0
- package/dist/node_modules/.pnpm/vitest@2.1.9_@types_node@22.20.0_jsdom@25.0.1_lightningcss@1.32.0/node_modules/vitest/dist/chunks/vi.DgezovHB.js.map +1 -0
- package/dist/packages/server/package.js +6 -0
- package/dist/packages/server/package.js.map +1 -0
- package/package.json +9 -7
- package/dist/app/notifications.d.ts +0 -7
- package/dist/app/notifications.js +0 -23
- package/dist/app/notifications.js.map +0 -1
- package/dist/http/routes/learn/assets.d.ts +0 -8
- package/dist/http/routes/learn/assets.js +0 -32
- package/dist/http/routes/learn/assets.js.map +0 -1
- package/dist/http/routes/learn/comments.d.ts +0 -7
- package/dist/http/routes/learn/comments.js +0 -175
- package/dist/http/routes/learn/comments.js.map +0 -1
- package/dist/http/routes/learn/courses.d.ts +0 -7
- package/dist/http/routes/learn/courses.js +0 -75
- package/dist/http/routes/learn/courses.js.map +0 -1
- package/dist/http/routes/learn/downloads.d.ts +0 -7
- package/dist/http/routes/learn/downloads.js +0 -76
- package/dist/http/routes/learn/downloads.js.map +0 -1
- package/dist/http/routes/learn/index.d.ts +0 -7
- package/dist/http/routes/learn/index.js +0 -19
- package/dist/http/routes/learn/index.js.map +0 -1
- package/dist/http/routes/learn/org.d.ts +0 -7
- package/dist/http/routes/learn/org.js +0 -50
- package/dist/http/routes/learn/org.js.map +0 -1
- package/dist/http/routes/learn/progress.d.ts +0 -7
- package/dist/http/routes/learn/progress.js +0 -63
- package/dist/http/routes/learn/progress.js.map +0 -1
- package/dist/http/schemas/learn.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"catalog.js","names":[],"sources":["../../../../src/http/mcp/tools/catalog.ts"],"sourcesContent":["import {\n AddBundleItem,\n AddDownloadAsset,\n AssetsPage,\n AssetsQuery,\n BundleIdParam,\n BundleItemParams,\n BundlesQuery,\n CreateBundle,\n CreateDownload,\n DownloadAssetParams,\n DownloadIdParam,\n DownloadsQuery,\n RenameDownloadAsset,\n ReorderDownloadAssets,\n UpdateBundle,\n UpdateDownload,\n} from '../../schemas/index.js';\nimport { actor, defineTool, type Tool } from '../tool.js';\n\nexport const catalogTools: Tool[] = [\n defineTool({\n name: 'list_downloads',\n title: 'List downloads',\n description:\n 'Search and page through downloads: file collections a student can be granted. Filter by status or category.',\n scope: 'downloads:read',\n kind: 'read',\n idempotent: true,\n openWorld: false,\n input: DownloadsQuery,\n call: (input, { container, scope }) => container.content.listDownloads(scope.orgId, input),\n }),\n defineTool({\n name: 'list_download_files',\n title: 'List download files',\n description: 'The files of a download, in order, with their display names.',\n scope: 'downloads:read',\n kind: 'read',\n idempotent: true,\n openWorld: false,\n input: DownloadIdParam,\n call: ({ downloadId }, { container, scope }) =>\n container.content.listDownloadAssets(scope.orgId, downloadId),\n }),\n defineTool({\n name: 'create_download',\n title: 'Create download',\n description:\n 'Create a draft download. Add files with add_download_file and publish it with update_download.',\n scope: 'downloads:write',\n kind: 'write',\n idempotent: false,\n openWorld: false,\n input: CreateDownload,\n call: (input, { container, scope }) => container.content.createDownload(scope.orgId, input),\n }),\n defineTool({\n name: 'update_download',\n title: 'Update download',\n description:\n 'Change a download title, description, category or cover image, or publish and unpublish it with status. Fields left out stay as they are.',\n scope: 'downloads:write',\n kind: 'write',\n idempotent: true,\n openWorld: false,\n input: UpdateDownload.extend(DownloadIdParam.shape),\n call: ({ downloadId, ...patch }, { container, scope }) =>\n container.content.updateDownload(scope.orgId, downloadId, patch),\n }),\n defineTool({\n name: 'add_download_file',\n title: 'Add file to download',\n description: 'Add an uploaded file to the end of a download. Find file ids with list_media.',\n scope: 'downloads:write',\n kind: 'write',\n idempotent: false,\n openWorld: false,\n input: AddDownloadAsset.extend(DownloadIdParam.shape),\n call: ({ downloadId, ...file }, { container, scope }) =>\n container.content.addDownloadAsset(scope.orgId, downloadId, file),\n }),\n defineTool({\n name: 'rename_download_file',\n title: 'Rename download file',\n description: 'Set the name a file shows under in a download. null shows the file name.',\n scope: 'downloads:write',\n kind: 'write',\n idempotent: true,\n openWorld: false,\n input: RenameDownloadAsset.extend(DownloadAssetParams.shape),\n call: ({ downloadId, assetId, displayName }, { container, scope }) =>\n container.content.renameDownloadAsset(scope.orgId, downloadId, assetId, displayName),\n }),\n defineTool({\n name: 'reorder_download_files',\n title: 'Reorder download files',\n description:\n 'Set the file order of a download. Pass every file id of the download in the new order.',\n scope: 'downloads:write',\n kind: 'write',\n idempotent: true,\n openWorld: false,\n input: ReorderDownloadAssets.extend(DownloadIdParam.shape),\n call: ({ downloadId, assetIds }, { container, scope }) =>\n container.content.reorderDownloadAssets(scope.orgId, downloadId, assetIds),\n }),\n defineTool({\n name: 'remove_download_file',\n title: 'Remove file from download',\n description: 'Take a file out of a download. The uploaded file itself is kept.',\n scope: 'downloads:write',\n kind: 'destructive',\n idempotent: true,\n openWorld: false,\n input: DownloadAssetParams,\n call: ({ downloadId, assetId }, { container, scope }) =>\n container.content.removeDownloadAsset(scope.orgId, downloadId, assetId),\n }),\n defineTool({\n name: 'delete_download',\n title: 'Delete download',\n description: 'Permanently delete a download. The uploaded files are kept.',\n scope: 'downloads:delete',\n kind: 'destructive',\n idempotent: true,\n openWorld: false,\n input: DownloadIdParam,\n call: ({ downloadId }, { container, scope }) =>\n container.content.removeDownload(scope.orgId, downloadId, actor(scope)),\n }),\n defineTool({\n name: 'list_bundles',\n title: 'List bundles',\n description:\n 'Search and page through bundles: sets of courses, downloads and communities granted together.',\n scope: 'bundles:read',\n kind: 'read',\n idempotent: true,\n openWorld: false,\n input: BundlesQuery,\n call: (input, { container, scope }) => container.content.listBundles(scope.orgId, input),\n }),\n defineTool({\n name: 'list_bundle_items',\n title: 'List bundle items',\n description: 'The courses, downloads and communities in a bundle.',\n scope: 'bundles:read',\n kind: 'read',\n idempotent: true,\n openWorld: false,\n input: BundleIdParam,\n call: ({ bundleId }, { container, scope }) =>\n container.content.listBundleItems(scope.orgId, bundleId),\n }),\n defineTool({\n name: 'create_bundle',\n title: 'Create bundle',\n description:\n 'Create a bundle, optionally with the course, download and community ids it starts with.',\n scope: 'bundles:write',\n kind: 'write',\n idempotent: false,\n openWorld: false,\n input: CreateBundle,\n call: (input, { container, scope }) => container.content.createBundle(scope.orgId, input),\n }),\n defineTool({\n name: 'rename_bundle',\n title: 'Rename bundle',\n description: 'Rename a bundle.',\n scope: 'bundles:write',\n kind: 'write',\n idempotent: true,\n openWorld: false,\n input: UpdateBundle.extend(BundleIdParam.shape),\n call: ({ bundleId, ...patch }, { container, scope }) =>\n container.content.updateBundle(scope.orgId, bundleId, patch),\n }),\n defineTool({\n name: 'add_bundle_item',\n title: 'Add to bundle',\n description: 'Add a course, download or community to a bundle. Returns the bundle items.',\n scope: 'bundles:write',\n kind: 'write',\n idempotent: false,\n openWorld: false,\n input: AddBundleItem.extend(BundleIdParam.shape),\n call: ({ bundleId, contentId }, { container, scope }) =>\n container.content.addBundleItem(scope.orgId, bundleId, contentId),\n }),\n defineTool({\n name: 'remove_bundle_item',\n title: 'Remove from bundle',\n description:\n 'Take a course, download or community out of a bundle. Returns the remaining items.',\n scope: 'bundles:write',\n kind: 'destructive',\n idempotent: true,\n openWorld: false,\n input: BundleItemParams,\n call: ({ bundleId, contentId }, { container, scope }) =>\n container.content.removeBundleItem(scope.orgId, bundleId, contentId),\n }),\n defineTool({\n name: 'delete_bundle',\n title: 'Delete bundle',\n description: 'Permanently delete a bundle. Its courses, downloads and communities are kept.',\n scope: 'bundles:delete',\n kind: 'destructive',\n idempotent: true,\n openWorld: false,\n input: BundleIdParam,\n call: ({ bundleId }, { container, scope }) =>\n container.content.deleteBundle(scope.orgId, bundleId),\n }),\n defineTool({\n name: 'list_media',\n title: 'List media',\n description:\n 'Search and page through uploaded files, to use in downloads or as cover images of courses, downloads and communities. Uploading is done in the admin app.',\n scope: 'media:read',\n kind: 'read',\n idempotent: true,\n openWorld: false,\n input: AssetsQuery,\n output: AssetsPage,\n call: (input, { container, scope }) => container.assets.list(scope.orgId, input),\n }),\n];\n"],"mappings":";;;;;;AAoBA,MAAa,eAAuB;CAClC,WAAW;EACT,MAAM;EACN,OAAO;EACP,aACE;EACF,OAAO;EACP,MAAM;EACN,YAAY;EACZ,WAAW;EACX,OAAO;EACP,OAAO,OAAO,EAAE,WAAW,YAAY,UAAU,QAAQ,cAAc,MAAM,OAAO,KAAK;CAC3F,CAAC;CACD,WAAW;EACT,MAAM;EACN,OAAO;EACP,aAAa;EACb,OAAO;EACP,MAAM;EACN,YAAY;EACZ,WAAW;EACX,OAAO;EACP,OAAO,EAAE,cAAc,EAAE,WAAW,YAClC,UAAU,QAAQ,mBAAmB,MAAM,OAAO,UAAU;CAChE,CAAC;CACD,WAAW;EACT,MAAM;EACN,OAAO;EACP,aACE;EACF,OAAO;EACP,MAAM;EACN,YAAY;EACZ,WAAW;EACX,OAAO;EACP,OAAO,OAAO,EAAE,WAAW,YAAY,UAAU,QAAQ,eAAe,MAAM,OAAO,KAAK;CAC5F,CAAC;CACD,WAAW;EACT,MAAM;EACN,OAAO;EACP,aACE;EACF,OAAO;EACP,MAAM;EACN,YAAY;EACZ,WAAW;EACX,OAAO,eAAe,OAAO,gBAAgB,KAAK;EAClD,OAAO,EAAE,YAAY,GAAG,S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;EACN,OAAO;EACP,aAAa;EACb,OAAO;EACP,MAAM;EACN,YAAY;EACZ,WAAW;EACX,OAAO;EACP,OAAO,EAAE,YAAY,EAAE,WAAW,YAChC,UAAU,QAAQ,aAAa,MAAM,OAAO,QAAQ;CACxD,CAAC;CACD,WAAW;EACT,MAAM;EACN,OAAO;EACP,aACE;EACF,OAAO;EACP,MAAM;EACN,YAAY;EACZ,WAAW;EACX,OAAO;EACP,QAAQ;EACR,OAAO,OAAO,EAAE,WAAW,YAAY,UAAU,OAAO,KAAK,MAAM,OAAO,KAAK;CACjF,CAAC;AACH"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { CommentIdParam, CommentsQuery, DiscussionActivityParam, ReplyToComment } from "../../schemas/discussion.js";
|
|
2
|
+
import "../../schemas/index.js";
|
|
3
|
+
import { actor, defineTool } from "../tool.js";
|
|
4
|
+
//#region src/http/mcp/tools/comments.ts
|
|
5
|
+
const commentTools = [
|
|
6
|
+
defineTool({
|
|
7
|
+
name: "list_comments",
|
|
8
|
+
title: "List comments",
|
|
9
|
+
description: "The comment moderation queue. Filter by status, reported, course, activity or author. Each comment carries its activityId and parentId.",
|
|
10
|
+
scope: "comments:read",
|
|
11
|
+
kind: "read",
|
|
12
|
+
idempotent: true,
|
|
13
|
+
openWorld: false,
|
|
14
|
+
input: CommentsQuery,
|
|
15
|
+
call: (input, { container, scope }) => container.discussion.listComments(scope.orgId, input)
|
|
16
|
+
}),
|
|
17
|
+
defineTool({
|
|
18
|
+
name: "publish_comment",
|
|
19
|
+
title: "Publish comment",
|
|
20
|
+
description: "Publish a comment: approves one waiting for review, or restores a removed one.",
|
|
21
|
+
scope: "comments:moderate",
|
|
22
|
+
kind: "write",
|
|
23
|
+
idempotent: true,
|
|
24
|
+
openWorld: false,
|
|
25
|
+
input: CommentIdParam,
|
|
26
|
+
call: ({ commentId }, { container, scope }) => container.discussion.publish(scope.orgId, commentId, actor(scope), null)
|
|
27
|
+
}),
|
|
28
|
+
defineTool({
|
|
29
|
+
name: "dismiss_comment_reports",
|
|
30
|
+
title: "Dismiss comment reports",
|
|
31
|
+
description: "Mark the reports on a comment as resolved. The comment's status does not change.",
|
|
32
|
+
scope: "comments:moderate",
|
|
33
|
+
kind: "write",
|
|
34
|
+
idempotent: true,
|
|
35
|
+
openWorld: false,
|
|
36
|
+
input: CommentIdParam,
|
|
37
|
+
call: ({ commentId }, { container, scope }) => container.discussion.resolveReports(scope.orgId, commentId, actor(scope), null)
|
|
38
|
+
}),
|
|
39
|
+
defineTool({
|
|
40
|
+
name: "reply_to_comment",
|
|
41
|
+
title: "Reply to comment",
|
|
42
|
+
description: "Reply to a published top-level comment as yourself. Pass its activityId and its id. To answer a reply, reply to its parentId.",
|
|
43
|
+
scope: "comments:moderate",
|
|
44
|
+
kind: "write",
|
|
45
|
+
idempotent: false,
|
|
46
|
+
openWorld: false,
|
|
47
|
+
input: ReplyToComment.extend(CommentIdParam.shape).extend(DiscussionActivityParam.shape),
|
|
48
|
+
call: ({ activityId, commentId, body }, { container, scope }) => container.discussion.postComment(scope.orgId, {
|
|
49
|
+
actor: actor(scope),
|
|
50
|
+
activityId,
|
|
51
|
+
parentId: commentId,
|
|
52
|
+
body
|
|
53
|
+
})
|
|
54
|
+
}),
|
|
55
|
+
defineTool({
|
|
56
|
+
name: "remove_comment",
|
|
57
|
+
title: "Remove comment",
|
|
58
|
+
description: "Take a comment down.",
|
|
59
|
+
scope: "comments:moderate",
|
|
60
|
+
kind: "destructive",
|
|
61
|
+
idempotent: true,
|
|
62
|
+
openWorld: false,
|
|
63
|
+
input: CommentIdParam,
|
|
64
|
+
call: ({ commentId }, { container, scope }) => container.discussion.remove(scope.orgId, commentId, actor(scope), null)
|
|
65
|
+
})
|
|
66
|
+
];
|
|
67
|
+
//#endregion
|
|
68
|
+
export { commentTools };
|
|
69
|
+
|
|
70
|
+
//# sourceMappingURL=comments.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"comments.js","names":[],"sources":["../../../../src/http/mcp/tools/comments.ts"],"sourcesContent":["import {\n CommentIdParam,\n CommentsQuery,\n DiscussionActivityParam,\n ReplyToComment,\n} from '../../schemas/index.js';\nimport { actor, defineTool, type Tool } from '../tool.js';\n\nexport const commentTools: Tool[] = [\n defineTool({\n name: 'list_comments',\n title: 'List comments',\n description:\n 'The comment moderation queue. Filter by status, reported, course, activity or author. Each comment carries its activityId and parentId.',\n scope: 'comments:read',\n kind: 'read',\n idempotent: true,\n openWorld: false,\n input: CommentsQuery,\n call: (input, { container, scope }) => container.discussion.listComments(scope.orgId, input),\n }),\n defineTool({\n name: 'publish_comment',\n title: 'Publish comment',\n description: 'Publish a comment: approves one waiting for review, or restores a removed one.',\n scope: 'comments:moderate',\n kind: 'write',\n idempotent: true,\n openWorld: false,\n input: CommentIdParam,\n call: ({ commentId }, { container, scope }) =>\n container.discussion.publish(scope.orgId, commentId, actor(scope), null),\n }),\n defineTool({\n name: 'dismiss_comment_reports',\n title: 'Dismiss comment reports',\n description: \"Mark the reports on a comment as resolved. The comment's status does not change.\",\n scope: 'comments:moderate',\n kind: 'write',\n idempotent: true,\n openWorld: false,\n input: CommentIdParam,\n call: ({ commentId }, { container, scope }) =>\n container.discussion.resolveReports(scope.orgId, commentId, actor(scope), null),\n }),\n defineTool({\n name: 'reply_to_comment',\n title: 'Reply to comment',\n description:\n 'Reply to a published top-level comment as yourself. Pass its activityId and its id. To answer a reply, reply to its parentId.',\n scope: 'comments:moderate',\n kind: 'write',\n idempotent: false,\n openWorld: false,\n input: ReplyToComment.extend(CommentIdParam.shape).extend(DiscussionActivityParam.shape),\n call: ({ activityId, commentId, body }, { container, scope }) =>\n container.discussion.postComment(scope.orgId, {\n actor: actor(scope),\n activityId,\n parentId: commentId,\n body,\n }),\n }),\n defineTool({\n name: 'remove_comment',\n title: 'Remove comment',\n description: 'Take a comment down.',\n scope: 'comments:moderate',\n kind: 'destructive',\n idempotent: true,\n openWorld: false,\n input: CommentIdParam,\n call: ({ commentId }, { container, scope }) =>\n container.discussion.remove(scope.orgId, commentId, actor(scope), null),\n }),\n];\n"],"mappings":";;;;AAQA,MAAa,eAAuB;CAClC,WAAW;EACT,MAAM;EACN,OAAO;EACP,aACE;EACF,OAAO;EACP,MAAM;EACN,YAAY;EACZ,WAAW;EACX,OAAO;EACP,OAAO,OAAO,EAAE,WAAW,YAAY,UAAU,WAAW,aAAa,MAAM,OAAO,KAAK;CAC7F,CAAC;CACD,WAAW;EACT,MAAM;EACN,OAAO;EACP,aAAa;EACb,OAAO;EACP,MAAM;EACN,YAAY;EACZ,WAAW;EACX,OAAO;EACP,OAAO,EAAE,aAAa,EAAE,WAAW,YACjC,UAAU,WAAW,QAAQ,MAAM,OAAO,WAAW,MAAM,KAAK,GAAG,IAAI;CAC3E,CAAC;CACD,WAAW;EACT,MAAM;EACN,OAAO;EACP,aAAa;EACb,OAAO;EACP,MAAM;EACN,YAAY;EACZ,WAAW;EACX,OAAO;EACP,OAAO,EAAE,aAAa,EAAE,WAAW,YACjC,UAAU,WAAW,eAAe,MAAM,OAAO,WAAW,MAAM,KAAK,GAAG,IAAI;CAClF,CAAC;CACD,WAAW;EACT,MAAM;EACN,OAAO;EACP,aACE;EACF,OAAO;EACP,MAAM;EACN,YAAY;EACZ,WAAW;EACX,OAAO,eAAe,OAAO,eAAe,KAAK,CAAC,CAAC,OAAO,wBAAwB,KAAK;EACvF,OAAO,EAAE,YAAY,WAAW,QAAQ,EAAE,WAAW,YACnD,UAAU,WAAW,YAAY,MAAM,OAAO;GAC5C,OAAO,MAAM,KAAK;GAClB;GACA,UAAU;GACV;EACF,CAAC;CACL,CAAC;CACD,WAAW;EACT,MAAM;EACN,OAAO;EACP,aAAa;EACb,OAAO;EACP,MAAM;EACN,YAAY;EACZ,WAAW;EACX,OAAO;EACP,OAAO,EAAE,aAAa,EAAE,WAAW,YACjC,UAAU,WAAW,OAAO,MAAM,OAAO,WAAW,MAAM,KAAK,GAAG,IAAI;CAC1E,CAAC;AACH"}
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
import { CommunitiesQuery, CommunityIdParam, CommunitySpaceParam, CreateCommunity, CreateSpace, OrderedIds, PatchDmSettings, SetSpaceTopics, SpaceLinkBody, SpaceLinkParam, UpdateCommunity, UpdateSpace } from "../../schemas/community.js";
|
|
2
|
+
import "../../schemas/index.js";
|
|
3
|
+
import { actor, defineTool } from "../tool.js";
|
|
4
|
+
//#region src/http/mcp/tools/communities.ts
|
|
5
|
+
const communityTools = [
|
|
6
|
+
defineTool({
|
|
7
|
+
name: "list_communities",
|
|
8
|
+
title: "List communities",
|
|
9
|
+
description: "Search and page through the communities, drafts included, each with its status and direct-message settings. Filter by status, search by title.",
|
|
10
|
+
scope: "communities:read",
|
|
11
|
+
kind: "read",
|
|
12
|
+
idempotent: true,
|
|
13
|
+
openWorld: false,
|
|
14
|
+
input: CommunitiesQuery,
|
|
15
|
+
call: (input, { container, scope }) => container.content.listCommunities(scope.orgId, input)
|
|
16
|
+
}),
|
|
17
|
+
defineTool({
|
|
18
|
+
name: "list_spaces",
|
|
19
|
+
title: "List spaces",
|
|
20
|
+
description: "The spaces of a community, in order, each with its access rule, topics and links.",
|
|
21
|
+
scope: "communities:read",
|
|
22
|
+
kind: "read",
|
|
23
|
+
idempotent: true,
|
|
24
|
+
openWorld: false,
|
|
25
|
+
input: CommunityIdParam,
|
|
26
|
+
call: ({ communityId }, { container, scope }) => container.content.listSpaces(scope.orgId, communityId)
|
|
27
|
+
}),
|
|
28
|
+
defineTool({
|
|
29
|
+
name: "create_community",
|
|
30
|
+
title: "Create community",
|
|
31
|
+
description: "Create a draft community with the default direct-message settings and no spaces. Add spaces with create_space and publish it with update_community.",
|
|
32
|
+
scope: "communities:write",
|
|
33
|
+
kind: "write",
|
|
34
|
+
idempotent: false,
|
|
35
|
+
openWorld: false,
|
|
36
|
+
input: CreateCommunity,
|
|
37
|
+
call: (input, { container, scope }) => container.content.createCommunity(scope.orgId, input, actor(scope))
|
|
38
|
+
}),
|
|
39
|
+
defineTool({
|
|
40
|
+
name: "update_community",
|
|
41
|
+
title: "Update community",
|
|
42
|
+
description: "Change a community title, description or cover image, or publish and unpublish it with status. The cover must be a ready image from list_media; null clears it. Fields left out stay as they are.",
|
|
43
|
+
scope: "communities:write",
|
|
44
|
+
kind: "write",
|
|
45
|
+
idempotent: true,
|
|
46
|
+
openWorld: false,
|
|
47
|
+
input: UpdateCommunity.extend(CommunityIdParam.shape),
|
|
48
|
+
call: ({ communityId, ...input }, { container, scope }) => container.content.updateCommunity(scope.orgId, communityId, input, actor(scope))
|
|
49
|
+
}),
|
|
50
|
+
defineTool({
|
|
51
|
+
name: "update_community_messaging",
|
|
52
|
+
title: "Update community messaging",
|
|
53
|
+
description: "Change the direct-message settings of a community: who may message whom from now on. Settings left out stay as they are.",
|
|
54
|
+
scope: "communities:write",
|
|
55
|
+
kind: "write",
|
|
56
|
+
idempotent: true,
|
|
57
|
+
openWorld: false,
|
|
58
|
+
input: PatchDmSettings.extend(CommunityIdParam.shape),
|
|
59
|
+
call: ({ communityId, ...input }, { container, scope }) => container.content.patchDmSettings(scope.orgId, communityId, input, actor(scope))
|
|
60
|
+
}),
|
|
61
|
+
defineTool({
|
|
62
|
+
name: "create_space",
|
|
63
|
+
title: "Create space",
|
|
64
|
+
description: "Add a space at the end of a community. Its access rule decides who can open it: all members, by request or by invite. A space open to all members cannot have a capacity.",
|
|
65
|
+
scope: "communities:write",
|
|
66
|
+
kind: "write",
|
|
67
|
+
idempotent: false,
|
|
68
|
+
openWorld: false,
|
|
69
|
+
input: CreateSpace.extend(CommunityIdParam.shape),
|
|
70
|
+
call: ({ communityId, ...input }, { container, scope }) => container.content.createSpace(scope.orgId, communityId, input, actor(scope))
|
|
71
|
+
}),
|
|
72
|
+
defineTool({
|
|
73
|
+
name: "update_space",
|
|
74
|
+
title: "Update space",
|
|
75
|
+
description: "Change a space name, description, access rule, capacity or settings. settings merges into the current settings. Fields left out stay as they are.",
|
|
76
|
+
scope: "communities:write",
|
|
77
|
+
kind: "write",
|
|
78
|
+
idempotent: true,
|
|
79
|
+
openWorld: false,
|
|
80
|
+
input: UpdateSpace.extend(CommunitySpaceParam.shape),
|
|
81
|
+
call: ({ communityId, spaceId, ...input }, { container, scope }) => container.content.updateSpace(scope.orgId, communityId, spaceId, input, actor(scope))
|
|
82
|
+
}),
|
|
83
|
+
defineTool({
|
|
84
|
+
name: "reorder_spaces",
|
|
85
|
+
title: "Reorder spaces",
|
|
86
|
+
description: "Set the space order of a community. Pass every space id of the community in the new order.",
|
|
87
|
+
scope: "communities:write",
|
|
88
|
+
kind: "write",
|
|
89
|
+
idempotent: true,
|
|
90
|
+
openWorld: false,
|
|
91
|
+
input: OrderedIds.extend(CommunityIdParam.shape),
|
|
92
|
+
call: ({ communityId, ids }, { container, scope }) => container.content.reorderSpaces(scope.orgId, communityId, ids, actor(scope))
|
|
93
|
+
}),
|
|
94
|
+
defineTool({
|
|
95
|
+
name: "set_space_topics",
|
|
96
|
+
title: "Set space topics",
|
|
97
|
+
description: "Replace the topics of a space. An entry with an id keeps and renames that topic, one without adds a topic, and a topic left out is deleted. A topic that posts use cannot be deleted.",
|
|
98
|
+
scope: "communities:write",
|
|
99
|
+
kind: "write",
|
|
100
|
+
idempotent: true,
|
|
101
|
+
openWorld: false,
|
|
102
|
+
input: SetSpaceTopics.extend(CommunitySpaceParam.shape),
|
|
103
|
+
call: ({ communityId, spaceId, ...input }, { container, scope }) => container.content.setSpaceTopics(scope.orgId, communityId, spaceId, input, actor(scope))
|
|
104
|
+
}),
|
|
105
|
+
defineTool({
|
|
106
|
+
name: "add_space_link",
|
|
107
|
+
title: "Add space link",
|
|
108
|
+
description: "Link a course, download or community into a space, after its other links. Returns the space.",
|
|
109
|
+
scope: "communities:write",
|
|
110
|
+
kind: "write",
|
|
111
|
+
idempotent: false,
|
|
112
|
+
openWorld: false,
|
|
113
|
+
input: SpaceLinkBody.extend(CommunitySpaceParam.shape),
|
|
114
|
+
call: ({ communityId, spaceId, contentId }, { container, scope }) => container.content.addSpaceLink(scope.orgId, communityId, spaceId, contentId, actor(scope))
|
|
115
|
+
}),
|
|
116
|
+
defineTool({
|
|
117
|
+
name: "reorder_space_links",
|
|
118
|
+
title: "Reorder space links",
|
|
119
|
+
description: "Set the link order of a space. Pass every link id of the space in the new order.",
|
|
120
|
+
scope: "communities:write",
|
|
121
|
+
kind: "write",
|
|
122
|
+
idempotent: true,
|
|
123
|
+
openWorld: false,
|
|
124
|
+
input: OrderedIds.extend(CommunitySpaceParam.shape),
|
|
125
|
+
call: ({ communityId, spaceId, ids }, { container, scope }) => container.content.reorderSpaceLinks(scope.orgId, communityId, spaceId, ids, actor(scope))
|
|
126
|
+
}),
|
|
127
|
+
defineTool({
|
|
128
|
+
name: "remove_space_link",
|
|
129
|
+
title: "Remove space link",
|
|
130
|
+
description: "Take a link out of a space. The linked content itself is kept. Returns the space.",
|
|
131
|
+
scope: "communities:write",
|
|
132
|
+
kind: "destructive",
|
|
133
|
+
idempotent: true,
|
|
134
|
+
openWorld: false,
|
|
135
|
+
input: SpaceLinkParam,
|
|
136
|
+
call: ({ communityId, spaceId, linkId }, { container, scope }) => container.content.removeSpaceLink(scope.orgId, communityId, spaceId, linkId, actor(scope))
|
|
137
|
+
}),
|
|
138
|
+
defineTool({
|
|
139
|
+
name: "delete_space",
|
|
140
|
+
title: "Delete space",
|
|
141
|
+
description: "Permanently delete a space with its posts, comments and members.",
|
|
142
|
+
scope: "communities:delete",
|
|
143
|
+
kind: "destructive",
|
|
144
|
+
idempotent: true,
|
|
145
|
+
openWorld: false,
|
|
146
|
+
input: CommunitySpaceParam,
|
|
147
|
+
call: ({ communityId, spaceId }, { container, scope }) => container.content.deleteSpace(scope.orgId, communityId, spaceId, actor(scope))
|
|
148
|
+
}),
|
|
149
|
+
defineTool({
|
|
150
|
+
name: "delete_community",
|
|
151
|
+
title: "Delete community",
|
|
152
|
+
description: "Permanently delete a community with its spaces. Links to it from other spaces are removed.",
|
|
153
|
+
scope: "communities:delete",
|
|
154
|
+
kind: "destructive",
|
|
155
|
+
idempotent: true,
|
|
156
|
+
openWorld: false,
|
|
157
|
+
input: CommunityIdParam,
|
|
158
|
+
call: ({ communityId }, { container, scope }) => container.content.deleteCommunity(scope.orgId, communityId, actor(scope))
|
|
159
|
+
}),
|
|
160
|
+
defineTool({
|
|
161
|
+
name: "get_community_analytics",
|
|
162
|
+
title: "Get community analytics",
|
|
163
|
+
description: "Membership, activity and moderation counts for one community.",
|
|
164
|
+
scope: "analytics:read",
|
|
165
|
+
kind: "read",
|
|
166
|
+
idempotent: true,
|
|
167
|
+
openWorld: false,
|
|
168
|
+
input: CommunityIdParam,
|
|
169
|
+
call: ({ communityId }, { container, scope }) => container.reporting.admin.communityAnalytics(scope.orgId, communityId)
|
|
170
|
+
})
|
|
171
|
+
];
|
|
172
|
+
//#endregion
|
|
173
|
+
export { communityTools };
|
|
174
|
+
|
|
175
|
+
//# sourceMappingURL=communities.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"communities.js","names":[],"sources":["../../../../src/http/mcp/tools/communities.ts"],"sourcesContent":["import {\n CommunitiesQuery,\n CommunityIdParam,\n CommunitySpaceParam,\n CreateCommunity,\n CreateSpace,\n OrderedIds,\n PatchDmSettings,\n SetSpaceTopics,\n SpaceLinkBody,\n SpaceLinkParam,\n UpdateCommunity,\n UpdateSpace,\n} from '../../schemas/index.js';\nimport { actor, defineTool, type Tool } from '../tool.js';\n\nexport const communityTools: Tool[] = [\n defineTool({\n name: 'list_communities',\n title: 'List communities',\n description:\n 'Search and page through the communities, drafts included, each with its status and direct-message settings. Filter by status, search by title.',\n scope: 'communities:read',\n kind: 'read',\n idempotent: true,\n openWorld: false,\n input: CommunitiesQuery,\n call: (input, { container, scope }) => container.content.listCommunities(scope.orgId, input),\n }),\n defineTool({\n name: 'list_spaces',\n title: 'List spaces',\n description:\n 'The spaces of a community, in order, each with its access rule, topics and links.',\n scope: 'communities:read',\n kind: 'read',\n idempotent: true,\n openWorld: false,\n input: CommunityIdParam,\n call: ({ communityId }, { container, scope }) =>\n container.content.listSpaces(scope.orgId, communityId),\n }),\n defineTool({\n name: 'create_community',\n title: 'Create community',\n description:\n 'Create a draft community with the default direct-message settings and no spaces. Add spaces with create_space and publish it with update_community.',\n scope: 'communities:write',\n kind: 'write',\n idempotent: false,\n openWorld: false,\n input: CreateCommunity,\n call: (input, { container, scope }) =>\n container.content.createCommunity(scope.orgId, input, actor(scope)),\n }),\n defineTool({\n name: 'update_community',\n title: 'Update community',\n description:\n 'Change a community title, description or cover image, or publish and unpublish it with status. The cover must be a ready image from list_media; null clears it. Fields left out stay as they are.',\n scope: 'communities:write',\n kind: 'write',\n idempotent: true,\n openWorld: false,\n input: UpdateCommunity.extend(CommunityIdParam.shape),\n call: ({ communityId, ...input }, { container, scope }) =>\n container.content.updateCommunity(scope.orgId, communityId, input, actor(scope)),\n }),\n defineTool({\n name: 'update_community_messaging',\n title: 'Update community messaging',\n description:\n 'Change the direct-message settings of a community: who may message whom from now on. Settings left out stay as they are.',\n scope: 'communities:write',\n kind: 'write',\n idempotent: true,\n openWorld: false,\n input: PatchDmSettings.extend(CommunityIdParam.shape),\n call: ({ communityId, ...input }, { container, scope }) =>\n container.content.patchDmSettings(scope.orgId, communityId, input, actor(scope)),\n }),\n defineTool({\n name: 'create_space',\n title: 'Create space',\n description:\n 'Add a space at the end of a community. Its access rule decides who can open it: all members, by request or by invite. A space open to all members cannot have a capacity.',\n scope: 'communities:write',\n kind: 'write',\n idempotent: false,\n openWorld: false,\n input: CreateSpace.extend(CommunityIdParam.shape),\n call: ({ communityId, ...input }, { container, scope }) =>\n container.content.createSpace(scope.orgId, communityId, input, actor(scope)),\n }),\n defineTool({\n name: 'update_space',\n title: 'Update space',\n description:\n 'Change a space name, description, access rule, capacity or settings. settings merges into the current settings. Fields left out stay as they are.',\n scope: 'communities:write',\n kind: 'write',\n idempotent: true,\n openWorld: false,\n input: UpdateSpace.extend(CommunitySpaceParam.shape),\n call: ({ communityId, spaceId, ...input }, { container, scope }) =>\n container.content.updateSpace(scope.orgId, communityId, spaceId, input, actor(scope)),\n }),\n defineTool({\n name: 'reorder_spaces',\n title: 'Reorder spaces',\n description:\n 'Set the space order of a community. Pass every space id of the community in the new order.',\n scope: 'communities:write',\n kind: 'write',\n idempotent: true,\n openWorld: false,\n input: OrderedIds.extend(CommunityIdParam.shape),\n call: ({ communityId, ids }, { container, scope }) =>\n container.content.reorderSpaces(scope.orgId, communityId, ids, actor(scope)),\n }),\n defineTool({\n name: 'set_space_topics',\n title: 'Set space topics',\n description:\n 'Replace the topics of a space. An entry with an id keeps and renames that topic, one without adds a topic, and a topic left out is deleted. A topic that posts use cannot be deleted.',\n scope: 'communities:write',\n kind: 'write',\n idempotent: true,\n openWorld: false,\n input: SetSpaceTopics.extend(CommunitySpaceParam.shape),\n call: ({ communityId, spaceId, ...input }, { container, scope }) =>\n container.content.setSpaceTopics(scope.orgId, communityId, spaceId, input, actor(scope)),\n }),\n defineTool({\n name: 'add_space_link',\n title: 'Add space link',\n description:\n 'Link a course, download or community into a space, after its other links. Returns the space.',\n scope: 'communities:write',\n kind: 'write',\n idempotent: false,\n openWorld: false,\n input: SpaceLinkBody.extend(CommunitySpaceParam.shape),\n call: ({ communityId, spaceId, contentId }, { container, scope }) =>\n container.content.addSpaceLink(scope.orgId, communityId, spaceId, contentId, actor(scope)),\n }),\n defineTool({\n name: 'reorder_space_links',\n title: 'Reorder space links',\n description: 'Set the link order of a space. Pass every link id of the space in the new order.',\n scope: 'communities:write',\n kind: 'write',\n idempotent: true,\n openWorld: false,\n input: OrderedIds.extend(CommunitySpaceParam.shape),\n call: ({ communityId, spaceId, ids }, { container, scope }) =>\n container.content.reorderSpaceLinks(scope.orgId, communityId, spaceId, ids, actor(scope)),\n }),\n defineTool({\n name: 'remove_space_link',\n title: 'Remove space link',\n description:\n 'Take a link out of a space. The linked content itself is kept. Returns the space.',\n scope: 'communities:write',\n kind: 'destructive',\n idempotent: true,\n openWorld: false,\n input: SpaceLinkParam,\n call: ({ communityId, spaceId, linkId }, { container, scope }) =>\n container.content.removeSpaceLink(scope.orgId, communityId, spaceId, linkId, actor(scope)),\n }),\n defineTool({\n name: 'delete_space',\n title: 'Delete space',\n description: 'Permanently delete a space with its posts, comments and members.',\n scope: 'communities:delete',\n kind: 'destructive',\n idempotent: true,\n openWorld: false,\n input: CommunitySpaceParam,\n call: ({ communityId, spaceId }, { container, scope }) =>\n container.content.deleteSpace(scope.orgId, communityId, spaceId, actor(scope)),\n }),\n defineTool({\n name: 'delete_community',\n title: 'Delete community',\n description:\n 'Permanently delete a community with its spaces. Links to it from other spaces are removed.',\n scope: 'communities:delete',\n kind: 'destructive',\n idempotent: true,\n openWorld: false,\n input: CommunityIdParam,\n call: ({ communityId }, { container, scope }) =>\n container.content.deleteCommunity(scope.orgId, communityId, actor(scope)),\n }),\n defineTool({\n name: 'get_community_analytics',\n title: 'Get community analytics',\n description: 'Membership, activity and moderation counts for one community.',\n scope: 'analytics:read',\n kind: 'read',\n idempotent: true,\n openWorld: false,\n input: CommunityIdParam,\n call: ({ communityId }, { container, scope }) =>\n container.reporting.admin.communityAnalytics(scope.orgId, communityId),\n }),\n];\n"],"mappings":";;;;AAgBA,MAAa,iBAAyB;CACpC,WAAW;EACT,MAAM;EACN,OAAO;EACP,aACE;EACF,OAAO;EACP,MAAM;EACN,YAAY;EACZ,WAAW;EACX,OAAO;EACP,OAAO,OAAO,EAAE,WAAW,YAAY,UAAU,QAAQ,gBAAgB,MAAM,OAAO,KAAK;CAC7F,CAAC;CACD,WAAW;EACT,MAAM;EACN,OAAO;EACP,aACE;EACF,OAAO;EACP,MAAM;EACN,YAAY;EACZ,WAAW;EACX,OAAO;EACP,OAAO,EAAE,eAAe,EAAE,WAAW,YACnC,UAAU,QAAQ,WAAW,MAAM,OAAO,WAAW;CACzD,CAAC;CACD,WAAW;EACT,MAAM;EACN,OAAO;EACP,aACE;EACF,OAAO;EACP,MAAM;EACN,YAAY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P,aAAa;EACb,OAAO;EACP,MAAM;EACN,YAAY;EACZ,WAAW;EACX,OAAO;EACP,OAAO,EAAE,aAAa,WAAW,EAAE,WAAW,YAC5C,UAAU,QAAQ,YAAY,MAAM,OAAO,aAAa,SAAS,MAAM,KAAK,CAAC;CACjF,CAAC;CACD,WAAW;EACT,MAAM;EACN,OAAO;EACP,aACE;EACF,OAAO;EACP,MAAM;EACN,YAAY;EACZ,WAAW;EACX,OAAO;EACP,OAAO,EAAE,eAAe,EAAE,WAAW,YACnC,UAAU,QAAQ,gBAAgB,MAAM,OAAO,aAAa,MAAM,KAAK,CAAC;CAC5E,CAAC;CACD,WAAW;EACT,MAAM;EACN,OAAO;EACP,aAAa;EACb,OAAO;EACP,MAAM;EACN,YAAY;EACZ,WAAW;EACX,OAAO;EACP,OAAO,EAAE,eAAe,EAAE,WAAW,YACnC,UAAU,UAAU,MAAM,mBAAmB,MAAM,OAAO,WAAW;CACzE,CAAC;AACH"}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { PageQuery } from "../../schemas/shared.js";
|
|
2
|
+
import { CommunityIdParam, CommunityMembersQuery, CommunitySpaceParam, SpaceMemberParam } from "../../schemas/community.js";
|
|
3
|
+
import { OrgUserBody } from "../../schemas/chats.js";
|
|
4
|
+
import "../../schemas/index.js";
|
|
5
|
+
import { actor, defineTool } from "../tool.js";
|
|
6
|
+
//#region src/http/mcp/tools/community-members.ts
|
|
7
|
+
const communityMemberTools = [
|
|
8
|
+
defineTool({
|
|
9
|
+
name: "list_community_members",
|
|
10
|
+
title: "List community members",
|
|
11
|
+
description: "Page through everyone with active access to a community, granted directly or through a bundle. Search by name or email.",
|
|
12
|
+
scope: "community_members:read",
|
|
13
|
+
kind: "read",
|
|
14
|
+
idempotent: true,
|
|
15
|
+
openWorld: false,
|
|
16
|
+
input: CommunityMembersQuery.extend(CommunityIdParam.shape),
|
|
17
|
+
call: ({ communityId, ...query }, { container, scope }) => container.reporting.admin.communityMembers(scope.orgId, communityId, query)
|
|
18
|
+
}),
|
|
19
|
+
defineTool({
|
|
20
|
+
name: "list_space_members",
|
|
21
|
+
title: "List space members",
|
|
22
|
+
description: "Page through a space's members, its open requests to join and its open invitations.",
|
|
23
|
+
scope: "community_members:read",
|
|
24
|
+
kind: "read",
|
|
25
|
+
idempotent: true,
|
|
26
|
+
openWorld: false,
|
|
27
|
+
input: PageQuery.extend(CommunitySpaceParam.shape),
|
|
28
|
+
call: ({ communityId, spaceId, ...page }, { container, scope }) => container.entitlements.listSpaceMembers(scope.orgId, actor(scope), communityId, spaceId, page)
|
|
29
|
+
}),
|
|
30
|
+
defineTool({
|
|
31
|
+
name: "add_space_member",
|
|
32
|
+
title: "Add space member",
|
|
33
|
+
description: "Place a member of the community straight into a space, with no request or invitation. Not for a space open to all members, or one that is full.",
|
|
34
|
+
scope: "community_members:write",
|
|
35
|
+
kind: "write",
|
|
36
|
+
idempotent: false,
|
|
37
|
+
openWorld: false,
|
|
38
|
+
input: OrgUserBody.extend(CommunitySpaceParam.shape),
|
|
39
|
+
call: ({ communityId, spaceId, orgUserId }, { container, scope }) => container.entitlements.addSpaceMember(scope.orgId, actor(scope), communityId, spaceId, orgUserId)
|
|
40
|
+
}),
|
|
41
|
+
defineTool({
|
|
42
|
+
name: "invite_space_member",
|
|
43
|
+
title: "Invite space member",
|
|
44
|
+
description: "Invite a member of the community into an invite-only space. They are notified and join when they accept.",
|
|
45
|
+
scope: "community_members:write",
|
|
46
|
+
kind: "write",
|
|
47
|
+
idempotent: false,
|
|
48
|
+
openWorld: true,
|
|
49
|
+
input: OrgUserBody.extend(CommunitySpaceParam.shape),
|
|
50
|
+
call: ({ communityId, spaceId, orgUserId }, { container, scope }) => container.entitlements.invite(scope.orgId, actor(scope), communityId, spaceId, orgUserId)
|
|
51
|
+
}),
|
|
52
|
+
defineTool({
|
|
53
|
+
name: "approve_space_request",
|
|
54
|
+
title: "Approve space request",
|
|
55
|
+
description: "Approve a person's request to join a space. Not when the space is full.",
|
|
56
|
+
scope: "community_members:write",
|
|
57
|
+
kind: "write",
|
|
58
|
+
idempotent: true,
|
|
59
|
+
openWorld: false,
|
|
60
|
+
input: SpaceMemberParam,
|
|
61
|
+
call: ({ communityId, spaceId, orgUserId }, { container, scope }) => container.entitlements.approve(scope.orgId, actor(scope), communityId, spaceId, orgUserId)
|
|
62
|
+
}),
|
|
63
|
+
defineTool({
|
|
64
|
+
name: "decline_space_request",
|
|
65
|
+
title: "Decline space request",
|
|
66
|
+
description: "Decline a person's request to join a space.",
|
|
67
|
+
scope: "community_members:write",
|
|
68
|
+
kind: "write",
|
|
69
|
+
idempotent: true,
|
|
70
|
+
openWorld: false,
|
|
71
|
+
input: SpaceMemberParam,
|
|
72
|
+
call: ({ communityId, spaceId, orgUserId }, { container, scope }) => container.entitlements.decline(scope.orgId, actor(scope), communityId, spaceId, orgUserId)
|
|
73
|
+
}),
|
|
74
|
+
defineTool({
|
|
75
|
+
name: "remove_space_member",
|
|
76
|
+
title: "Remove space member",
|
|
77
|
+
description: "Remove a person from a space, whether they are a member, asked to join or were invited. Their access to the community stays. Not for a space open to all members.",
|
|
78
|
+
scope: "community_members:write",
|
|
79
|
+
kind: "destructive",
|
|
80
|
+
idempotent: true,
|
|
81
|
+
openWorld: false,
|
|
82
|
+
input: SpaceMemberParam,
|
|
83
|
+
call: ({ communityId, spaceId, orgUserId }, { container, scope }) => container.entitlements.remove(scope.orgId, actor(scope), communityId, spaceId, orgUserId)
|
|
84
|
+
})
|
|
85
|
+
];
|
|
86
|
+
//#endregion
|
|
87
|
+
export { communityMemberTools };
|
|
88
|
+
|
|
89
|
+
//# sourceMappingURL=community-members.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"community-members.js","names":[],"sources":["../../../../src/http/mcp/tools/community-members.ts"],"sourcesContent":["import {\n CommunityIdParam,\n CommunityMembersQuery,\n CommunitySpaceParam,\n OrgUserBody,\n PageQuery,\n SpaceMemberParam,\n} from '../../schemas/index.js';\nimport { actor, defineTool, type Tool } from '../tool.js';\n\nexport const communityMemberTools: Tool[] = [\n defineTool({\n name: 'list_community_members',\n title: 'List community members',\n description:\n 'Page through everyone with active access to a community, granted directly or through a bundle. Search by name or email.',\n scope: 'community_members:read',\n kind: 'read',\n idempotent: true,\n openWorld: false,\n input: CommunityMembersQuery.extend(CommunityIdParam.shape),\n call: ({ communityId, ...query }, { container, scope }) =>\n container.reporting.admin.communityMembers(scope.orgId, communityId, query),\n }),\n defineTool({\n name: 'list_space_members',\n title: 'List space members',\n description:\n \"Page through a space's members, its open requests to join and its open invitations.\",\n scope: 'community_members:read',\n kind: 'read',\n idempotent: true,\n openWorld: false,\n input: PageQuery.extend(CommunitySpaceParam.shape),\n call: ({ communityId, spaceId, ...page }, { container, scope }) =>\n container.entitlements.listSpaceMembers(\n scope.orgId,\n actor(scope),\n communityId,\n spaceId,\n page,\n ),\n }),\n defineTool({\n name: 'add_space_member',\n title: 'Add space member',\n description:\n 'Place a member of the community straight into a space, with no request or invitation. Not for a space open to all members, or one that is full.',\n scope: 'community_members:write',\n kind: 'write',\n idempotent: false,\n openWorld: false,\n input: OrgUserBody.extend(CommunitySpaceParam.shape),\n call: ({ communityId, spaceId, orgUserId }, { container, scope }) =>\n container.entitlements.addSpaceMember(\n scope.orgId,\n actor(scope),\n communityId,\n spaceId,\n orgUserId,\n ),\n }),\n defineTool({\n name: 'invite_space_member',\n title: 'Invite space member',\n description:\n 'Invite a member of the community into an invite-only space. They are notified and join when they accept.',\n scope: 'community_members:write',\n kind: 'write',\n idempotent: false,\n openWorld: true,\n input: OrgUserBody.extend(CommunitySpaceParam.shape),\n call: ({ communityId, spaceId, orgUserId }, { container, scope }) =>\n container.entitlements.invite(scope.orgId, actor(scope), communityId, spaceId, orgUserId),\n }),\n defineTool({\n name: 'approve_space_request',\n title: 'Approve space request',\n description: \"Approve a person's request to join a space. Not when the space is full.\",\n scope: 'community_members:write',\n kind: 'write',\n idempotent: true,\n openWorld: false,\n input: SpaceMemberParam,\n call: ({ communityId, spaceId, orgUserId }, { container, scope }) =>\n container.entitlements.approve(scope.orgId, actor(scope), communityId, spaceId, orgUserId),\n }),\n defineTool({\n name: 'decline_space_request',\n title: 'Decline space request',\n description: \"Decline a person's request to join a space.\",\n scope: 'community_members:write',\n kind: 'write',\n idempotent: true,\n openWorld: false,\n input: SpaceMemberParam,\n call: ({ communityId, spaceId, orgUserId }, { container, scope }) =>\n container.entitlements.decline(scope.orgId, actor(scope), communityId, spaceId, orgUserId),\n }),\n defineTool({\n name: 'remove_space_member',\n title: 'Remove space member',\n description:\n 'Remove a person from a space, whether they are a member, asked to join or were invited. Their access to the community stays. Not for a space open to all members.',\n scope: 'community_members:write',\n kind: 'destructive',\n idempotent: true,\n openWorld: false,\n input: SpaceMemberParam,\n call: ({ communityId, spaceId, orgUserId }, { container, scope }) =>\n container.entitlements.remove(scope.orgId, actor(scope), communityId, spaceId, orgUserId),\n }),\n];\n"],"mappings":";;;;;;AAUA,MAAa,uBAA+B;CAC1C,WAAW;EACT,MAAM;EACN,OAAO;EACP,aACE;EACF,OAAO;EACP,MAAM;EACN,YAAY;EACZ,WAAW;EACX,OAAO,sBAAsB,OAAO,iBAAiB,KAAK;EAC1D,OAAO,EAAE,aAAa,GAAG,SAAS,EAAE,WAAW,YAC7C,UAAU,UAAU,MAAM,iBAAiB,MAAM,OAAO,aAAa,KAAK;CAC9E,CAAC;CACD,WAAW;EACT,MAAM;EACN,OAAO;EACP,aACE;EACF,OAAO;EACP,MAAM;EACN,YAAY;EACZ,WAAW;EACX,OAAO,UAAU,OAAO,oBAAoB,KAAK;EACjD,OAAO,EAAE,aAAa,SAAS,GAAG,QAAQ,EAAE,WAAW,YACrD,UAAU,aAAa,iBACrB,MAAM,OACN,MAAM,KAAK,GACX,aACA,SACA,IACF;CACJ,CAAC;CACD,WAAW;EACT,MAAM;EACN,OAAO;EACP,aACE;EACF,OAAO;EACP,MAAM;EACN,YAAY;EACZ,WAAW;EACX,OAAO,YAAY,OAAO,oBAAoB,KAAK;EACnD,OAAO,EAAE,aAAa,SAAS,aAAa,EAAE,WAAW,YACvD,UAAU,aAAa,eACrB,MAAM,OACN,MAAM,KAAK,GACX,aACA,SACA,SACF;CACJ,CAAC;CACD,WAAW;EACT,MAAM;EACN,OAAO;EACP,aACE;EACF,OAAO;EACP,MAAM;EACN,YAAY;EACZ,WAAW;EACX,OAAO,YAAY,OAAO,oBAAoB,KAAK;EACnD,OAAO,EAAE,aAAa,SAAS,aAAa,EAAE,WAAW,YACvD,UAAU,aAAa,OAAO,MAAM,OAAO,MAAM,KAAK,GAAG,aAAa,SAAS,SAAS;CAC5F,CAAC;CACD,WAAW;EACT,MAAM;EACN,OAAO;EACP,aAAa;EACb,OAAO;EACP,MAAM;EACN,YAAY;EACZ,WAAW;EACX,OAAO;EACP,OAAO,EAAE,aAAa,SAAS,aAAa,EAAE,WAAW,YACvD,UAAU,aAAa,QAAQ,MAAM,OAAO,MAAM,KAAK,GAAG,aAAa,SAAS,SAAS;CAC7F,CAAC;CACD,WAAW;EACT,MAAM;EACN,OAAO;EACP,aAAa;EACb,OAAO;EACP,MAAM;EACN,YAAY;EACZ,WAAW;EACX,OAAO;EACP,OAAO,EAAE,aAAa,SAAS,aAAa,EAAE,WAAW,YACvD,UAAU,aAAa,QAAQ,MAAM,OAAO,MAAM,KAAK,GAAG,aAAa,SAAS,SAAS;CAC7F,CAAC;CACD,WAAW;EACT,MAAM;EACN,OAAO;EACP,aACE;EACF,OAAO;EACP,MAAM;EACN,YAAY;EACZ,WAAW;EACX,OAAO;EACP,OAAO,EAAE,aAAa,SAAS,aAAa,EAAE,WAAW,YACvD,UAAU,aAAa,OAAO,MAAM,OAAO,MAAM,KAAK,GAAG,aAAa,SAAS,SAAS;CAC5F,CAAC;AACH"}
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import { CommunityChatParam, CommunityCommentParam, CommunityIdParam, CommunityMessageParam, CommunityPostParam, CommunitySpaceParam } from "../../schemas/community.js";
|
|
2
|
+
import { ResolvePostFlags } from "../../schemas/posts.js";
|
|
3
|
+
import { ResolveMessageFlags } from "../../schemas/chats.js";
|
|
4
|
+
import "../../schemas/index.js";
|
|
5
|
+
import { actor, defineTool } from "../tool.js";
|
|
6
|
+
//#region src/http/mcp/tools/community-moderation.ts
|
|
7
|
+
const communityModerationTools = [
|
|
8
|
+
defineTool({
|
|
9
|
+
name: "get_space_moderation_queue",
|
|
10
|
+
title: "Get space moderation queue",
|
|
11
|
+
description: "The posts awaiting review in a space and the open flags on its posts and comments. Each list holds at most the 100 oldest; working the queue brings in the next ones.",
|
|
12
|
+
scope: "community_moderation:read",
|
|
13
|
+
kind: "read",
|
|
14
|
+
idempotent: true,
|
|
15
|
+
openWorld: false,
|
|
16
|
+
input: CommunitySpaceParam,
|
|
17
|
+
call: ({ communityId, spaceId }, { container, scope }) => container.posts.moderationQueue(scope.orgId, actor(scope), communityId, spaceId)
|
|
18
|
+
}),
|
|
19
|
+
defineTool({
|
|
20
|
+
name: "get_message_moderation_queue",
|
|
21
|
+
title: "Get message moderation queue",
|
|
22
|
+
description: "The messages in a community's chats with open flags, with the flags and the chat each is in. Holds at most the 100 oldest open flags.",
|
|
23
|
+
scope: "community_moderation:read",
|
|
24
|
+
kind: "read",
|
|
25
|
+
idempotent: true,
|
|
26
|
+
openWorld: false,
|
|
27
|
+
input: CommunityIdParam,
|
|
28
|
+
call: ({ communityId }, { container, scope }) => container.chats.messageQueue(scope.orgId, actor(scope), communityId)
|
|
29
|
+
}),
|
|
30
|
+
defineTool({
|
|
31
|
+
name: "approve_post",
|
|
32
|
+
title: "Approve post",
|
|
33
|
+
description: "Publish a post that is awaiting review.",
|
|
34
|
+
scope: "community_moderation:write",
|
|
35
|
+
kind: "write",
|
|
36
|
+
idempotent: true,
|
|
37
|
+
openWorld: false,
|
|
38
|
+
input: CommunityPostParam,
|
|
39
|
+
call: ({ communityId, postId }, { container, scope }) => container.posts.approve(scope.orgId, postId, actor(scope), communityId)
|
|
40
|
+
}),
|
|
41
|
+
defineTool({
|
|
42
|
+
name: "dismiss_post_flags",
|
|
43
|
+
title: "Dismiss post flags",
|
|
44
|
+
description: "Close every open flag on a post and leave it up.",
|
|
45
|
+
scope: "community_moderation:write",
|
|
46
|
+
kind: "write",
|
|
47
|
+
idempotent: true,
|
|
48
|
+
openWorld: false,
|
|
49
|
+
input: ResolvePostFlags.extend(CommunityPostParam.shape),
|
|
50
|
+
call: ({ communityId, postId, resolution }, { container, scope }) => container.posts.resolveFlags(scope.orgId, postId, actor(scope), resolution, communityId)
|
|
51
|
+
}),
|
|
52
|
+
defineTool({
|
|
53
|
+
name: "remove_post",
|
|
54
|
+
title: "Remove post",
|
|
55
|
+
description: "Take a published or pending post down and resolve its open flags as removed. restore_post brings it back.",
|
|
56
|
+
scope: "community_moderation:write",
|
|
57
|
+
kind: "destructive",
|
|
58
|
+
idempotent: true,
|
|
59
|
+
openWorld: false,
|
|
60
|
+
input: CommunityPostParam,
|
|
61
|
+
call: ({ communityId, postId }, { container, scope }) => container.posts.remove(scope.orgId, postId, actor(scope), communityId)
|
|
62
|
+
}),
|
|
63
|
+
defineTool({
|
|
64
|
+
name: "restore_post",
|
|
65
|
+
title: "Restore post",
|
|
66
|
+
description: "Put a removed post back up.",
|
|
67
|
+
scope: "community_moderation:write",
|
|
68
|
+
kind: "write",
|
|
69
|
+
idempotent: true,
|
|
70
|
+
openWorld: false,
|
|
71
|
+
input: CommunityPostParam,
|
|
72
|
+
call: ({ communityId, postId }, { container, scope }) => container.posts.restore(scope.orgId, postId, actor(scope), communityId)
|
|
73
|
+
}),
|
|
74
|
+
defineTool({
|
|
75
|
+
name: "dismiss_post_comment_flags",
|
|
76
|
+
title: "Dismiss post comment flags",
|
|
77
|
+
description: "Close every open flag on a comment on a post and leave it up.",
|
|
78
|
+
scope: "community_moderation:write",
|
|
79
|
+
kind: "write",
|
|
80
|
+
idempotent: true,
|
|
81
|
+
openWorld: false,
|
|
82
|
+
input: CommunityCommentParam,
|
|
83
|
+
call: ({ communityId, commentId }, { container, scope }) => container.discussion.resolveReports(scope.orgId, commentId, actor(scope), communityId)
|
|
84
|
+
}),
|
|
85
|
+
defineTool({
|
|
86
|
+
name: "remove_post_comment",
|
|
87
|
+
title: "Remove post comment",
|
|
88
|
+
description: "Hide a comment on a post and resolve its open flags as removed. restore_post_comment brings it back.",
|
|
89
|
+
scope: "community_moderation:write",
|
|
90
|
+
kind: "destructive",
|
|
91
|
+
idempotent: true,
|
|
92
|
+
openWorld: false,
|
|
93
|
+
input: CommunityCommentParam,
|
|
94
|
+
call: ({ communityId, commentId }, { container, scope }) => container.discussion.remove(scope.orgId, commentId, actor(scope), communityId)
|
|
95
|
+
}),
|
|
96
|
+
defineTool({
|
|
97
|
+
name: "restore_post_comment",
|
|
98
|
+
title: "Restore post comment",
|
|
99
|
+
description: "Publish a removed comment on a post again.",
|
|
100
|
+
scope: "community_moderation:write",
|
|
101
|
+
kind: "write",
|
|
102
|
+
idempotent: true,
|
|
103
|
+
openWorld: false,
|
|
104
|
+
input: CommunityCommentParam,
|
|
105
|
+
call: ({ communityId, commentId }, { container, scope }) => container.discussion.restore(scope.orgId, commentId, actor(scope), communityId)
|
|
106
|
+
}),
|
|
107
|
+
defineTool({
|
|
108
|
+
name: "dismiss_message_flags",
|
|
109
|
+
title: "Dismiss message flags",
|
|
110
|
+
description: "Close every open flag on a chat message and leave it up.",
|
|
111
|
+
scope: "community_moderation:write",
|
|
112
|
+
kind: "write",
|
|
113
|
+
idempotent: true,
|
|
114
|
+
openWorld: false,
|
|
115
|
+
input: ResolveMessageFlags.extend(CommunityMessageParam.shape),
|
|
116
|
+
call: ({ communityId, messageId, resolution }, { container, scope }) => container.chats.resolveMessageFlags(scope.orgId, actor(scope), messageId, resolution, communityId)
|
|
117
|
+
}),
|
|
118
|
+
defineTool({
|
|
119
|
+
name: "lock_chat",
|
|
120
|
+
title: "Lock chat",
|
|
121
|
+
description: "Stop everyone sending or editing messages in a chat until it is unlocked. Its open message flags are resolved as locked.",
|
|
122
|
+
scope: "community_moderation:write",
|
|
123
|
+
kind: "destructive",
|
|
124
|
+
idempotent: true,
|
|
125
|
+
openWorld: false,
|
|
126
|
+
input: CommunityChatParam,
|
|
127
|
+
call: ({ communityId, chatId }, { container, scope }) => container.chats.lock(scope.orgId, actor(scope), chatId, communityId)
|
|
128
|
+
}),
|
|
129
|
+
defineTool({
|
|
130
|
+
name: "unlock_chat",
|
|
131
|
+
title: "Unlock chat",
|
|
132
|
+
description: "Let the participants of a locked chat send messages again.",
|
|
133
|
+
scope: "community_moderation:write",
|
|
134
|
+
kind: "write",
|
|
135
|
+
idempotent: true,
|
|
136
|
+
openWorld: false,
|
|
137
|
+
input: CommunityChatParam,
|
|
138
|
+
call: ({ communityId, chatId }, { container, scope }) => container.chats.unlock(scope.orgId, actor(scope), chatId, communityId)
|
|
139
|
+
})
|
|
140
|
+
];
|
|
141
|
+
//#endregion
|
|
142
|
+
export { communityModerationTools };
|
|
143
|
+
|
|
144
|
+
//# sourceMappingURL=community-moderation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"community-moderation.js","names":[],"sources":["../../../../src/http/mcp/tools/community-moderation.ts"],"sourcesContent":["import {\n CommunityChatParam,\n CommunityCommentParam,\n CommunityIdParam,\n CommunityMessageParam,\n CommunityPostParam,\n CommunitySpaceParam,\n ResolveMessageFlags,\n ResolvePostFlags,\n} from '../../schemas/index.js';\nimport { actor, defineTool, type Tool } from '../tool.js';\n\nexport const communityModerationTools: Tool[] = [\n defineTool({\n name: 'get_space_moderation_queue',\n title: 'Get space moderation queue',\n description:\n 'The posts awaiting review in a space and the open flags on its posts and comments. Each list holds at most the 100 oldest; working the queue brings in the next ones.',\n scope: 'community_moderation:read',\n kind: 'read',\n idempotent: true,\n openWorld: false,\n input: CommunitySpaceParam,\n call: ({ communityId, spaceId }, { container, scope }) =>\n container.posts.moderationQueue(scope.orgId, actor(scope), communityId, spaceId),\n }),\n defineTool({\n name: 'get_message_moderation_queue',\n title: 'Get message moderation queue',\n description:\n \"The messages in a community's chats with open flags, with the flags and the chat each is in. Holds at most the 100 oldest open flags.\",\n scope: 'community_moderation:read',\n kind: 'read',\n idempotent: true,\n openWorld: false,\n input: CommunityIdParam,\n call: ({ communityId }, { container, scope }) =>\n container.chats.messageQueue(scope.orgId, actor(scope), communityId),\n }),\n defineTool({\n name: 'approve_post',\n title: 'Approve post',\n description: 'Publish a post that is awaiting review.',\n scope: 'community_moderation:write',\n kind: 'write',\n idempotent: true,\n openWorld: false,\n input: CommunityPostParam,\n call: ({ communityId, postId }, { container, scope }) =>\n container.posts.approve(scope.orgId, postId, actor(scope), communityId),\n }),\n defineTool({\n name: 'dismiss_post_flags',\n title: 'Dismiss post flags',\n description: 'Close every open flag on a post and leave it up.',\n scope: 'community_moderation:write',\n kind: 'write',\n idempotent: true,\n openWorld: false,\n input: ResolvePostFlags.extend(CommunityPostParam.shape),\n call: ({ communityId, postId, resolution }, { container, scope }) =>\n container.posts.resolveFlags(scope.orgId, postId, actor(scope), resolution, communityId),\n }),\n defineTool({\n name: 'remove_post',\n title: 'Remove post',\n description:\n 'Take a published or pending post down and resolve its open flags as removed. restore_post brings it back.',\n scope: 'community_moderation:write',\n kind: 'destructive',\n idempotent: true,\n openWorld: false,\n input: CommunityPostParam,\n call: ({ communityId, postId }, { container, scope }) =>\n container.posts.remove(scope.orgId, postId, actor(scope), communityId),\n }),\n defineTool({\n name: 'restore_post',\n title: 'Restore post',\n description: 'Put a removed post back up.',\n scope: 'community_moderation:write',\n kind: 'write',\n idempotent: true,\n openWorld: false,\n input: CommunityPostParam,\n call: ({ communityId, postId }, { container, scope }) =>\n container.posts.restore(scope.orgId, postId, actor(scope), communityId),\n }),\n defineTool({\n name: 'dismiss_post_comment_flags',\n title: 'Dismiss post comment flags',\n description: 'Close every open flag on a comment on a post and leave it up.',\n scope: 'community_moderation:write',\n kind: 'write',\n idempotent: true,\n openWorld: false,\n input: CommunityCommentParam,\n call: ({ communityId, commentId }, { container, scope }) =>\n container.discussion.resolveReports(scope.orgId, commentId, actor(scope), communityId),\n }),\n defineTool({\n name: 'remove_post_comment',\n title: 'Remove post comment',\n description:\n 'Hide a comment on a post and resolve its open flags as removed. restore_post_comment brings it back.',\n scope: 'community_moderation:write',\n kind: 'destructive',\n idempotent: true,\n openWorld: false,\n input: CommunityCommentParam,\n call: ({ communityId, commentId }, { container, scope }) =>\n container.discussion.remove(scope.orgId, commentId, actor(scope), communityId),\n }),\n defineTool({\n name: 'restore_post_comment',\n title: 'Restore post comment',\n description: 'Publish a removed comment on a post again.',\n scope: 'community_moderation:write',\n kind: 'write',\n idempotent: true,\n openWorld: false,\n input: CommunityCommentParam,\n call: ({ communityId, commentId }, { container, scope }) =>\n container.discussion.restore(scope.orgId, commentId, actor(scope), communityId),\n }),\n defineTool({\n name: 'dismiss_message_flags',\n title: 'Dismiss message flags',\n description: 'Close every open flag on a chat message and leave it up.',\n scope: 'community_moderation:write',\n kind: 'write',\n idempotent: true,\n openWorld: false,\n input: ResolveMessageFlags.extend(CommunityMessageParam.shape),\n call: ({ communityId, messageId, resolution }, { container, scope }) =>\n container.chats.resolveMessageFlags(\n scope.orgId,\n actor(scope),\n messageId,\n resolution,\n communityId,\n ),\n }),\n defineTool({\n name: 'lock_chat',\n title: 'Lock chat',\n description:\n 'Stop everyone sending or editing messages in a chat until it is unlocked. Its open message flags are resolved as locked.',\n scope: 'community_moderation:write',\n kind: 'destructive',\n idempotent: true,\n openWorld: false,\n input: CommunityChatParam,\n call: ({ communityId, chatId }, { container, scope }) =>\n container.chats.lock(scope.orgId, actor(scope), chatId, communityId),\n }),\n defineTool({\n name: 'unlock_chat',\n title: 'Unlock chat',\n description: 'Let the participants of a locked chat send messages again.',\n scope: 'community_moderation:write',\n kind: 'write',\n idempotent: true,\n openWorld: false,\n input: CommunityChatParam,\n call: ({ communityId, chatId }, { container, scope }) =>\n container.chats.unlock(scope.orgId, actor(scope), chatId, communityId),\n }),\n];\n"],"mappings":";;;;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