@frontmcp/skills 1.0.0-beta.9 → 1.0.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 +2 -2
- package/catalog/TEMPLATE.md +69 -0
- package/catalog/frontmcp-config/SKILL.md +38 -22
- package/catalog/frontmcp-config/examples/configure-auth/multi-app-auth.md +87 -0
- package/catalog/frontmcp-config/examples/configure-auth/public-mode-setup.md +63 -0
- package/catalog/frontmcp-config/examples/configure-auth/remote-oauth-with-vault.md +76 -0
- package/catalog/frontmcp-config/examples/configure-auth-modes/local-self-signed-tokens.md +77 -0
- package/catalog/frontmcp-config/examples/configure-auth-modes/remote-enterprise-oauth.md +73 -0
- package/catalog/frontmcp-config/examples/configure-auth-modes/transparent-jwt-validation.md +64 -0
- package/catalog/frontmcp-config/examples/configure-elicitation/basic-confirmation-gate.md +83 -0
- package/catalog/frontmcp-config/examples/configure-elicitation/distributed-elicitation-redis.md +87 -0
- package/catalog/frontmcp-config/examples/configure-http/cors-restricted-origins.md +52 -0
- package/catalog/frontmcp-config/examples/configure-http/entry-path-reverse-proxy.md +72 -0
- package/catalog/frontmcp-config/examples/configure-http/unix-socket-local.md +64 -0
- package/catalog/frontmcp-config/examples/configure-session/multi-server-key-prefix.md +68 -0
- package/catalog/frontmcp-config/examples/configure-session/redis-session-store.md +52 -0
- package/catalog/frontmcp-config/examples/configure-session/vercel-kv-session.md +52 -0
- package/catalog/frontmcp-config/examples/configure-throttle/distributed-redis-throttle.md +94 -0
- package/catalog/frontmcp-config/examples/configure-throttle/per-tool-rate-limit.md +92 -0
- package/catalog/frontmcp-config/examples/configure-throttle/server-level-rate-limit.md +83 -0
- package/catalog/frontmcp-config/examples/configure-throttle-guard-config/full-guard-config.md +99 -0
- package/catalog/frontmcp-config/examples/configure-throttle-guard-config/minimal-guard-config.md +55 -0
- package/catalog/frontmcp-config/examples/configure-transport/custom-protocol-flags.md +74 -0
- package/catalog/frontmcp-config/examples/configure-transport/distributed-sessions-redis.md +86 -0
- package/catalog/frontmcp-config/examples/configure-transport/stateless-serverless.md +69 -0
- package/catalog/frontmcp-config/examples/configure-transport-protocol-presets/legacy-preset-nodejs.md +65 -0
- package/catalog/frontmcp-config/examples/configure-transport-protocol-presets/stateless-api-serverless.md +69 -0
- package/catalog/frontmcp-config/references/configure-auth-modes.md +15 -0
- package/catalog/frontmcp-config/references/configure-auth.md +15 -0
- package/catalog/frontmcp-config/references/configure-elicitation.md +14 -0
- package/catalog/frontmcp-config/references/configure-http.md +15 -0
- package/catalog/frontmcp-config/references/configure-session.md +15 -0
- package/catalog/frontmcp-config/references/configure-throttle-guard-config.md +14 -0
- package/catalog/frontmcp-config/references/configure-throttle.md +15 -0
- package/catalog/frontmcp-config/references/configure-transport-protocol-presets.md +14 -0
- package/catalog/frontmcp-config/references/configure-transport.md +15 -0
- package/catalog/frontmcp-config/references/setup-redis.md +10 -0
- package/catalog/frontmcp-config/references/setup-sqlite.md +10 -0
- package/catalog/frontmcp-deployment/SKILL.md +40 -12
- package/catalog/frontmcp-deployment/examples/build-for-browser/browser-build-with-custom-entry.md +43 -0
- package/catalog/frontmcp-deployment/examples/build-for-browser/browser-crypto-and-storage.md +85 -0
- package/catalog/frontmcp-deployment/examples/build-for-browser/react-provider-setup.md +61 -0
- package/catalog/frontmcp-deployment/examples/build-for-cli/cli-binary-build.md +66 -0
- package/catalog/frontmcp-deployment/examples/build-for-cli/unix-socket-daemon.md +76 -0
- package/catalog/frontmcp-deployment/examples/build-for-sdk/connect-openai.md +78 -0
- package/catalog/frontmcp-deployment/examples/build-for-sdk/create-flat-config.md +85 -0
- package/catalog/frontmcp-deployment/examples/build-for-sdk/multi-platform-connect.md +104 -0
- package/catalog/frontmcp-deployment/examples/deploy-to-cloudflare/basic-worker-deploy.md +82 -0
- package/catalog/frontmcp-deployment/examples/deploy-to-cloudflare/worker-custom-domain.md +97 -0
- package/catalog/frontmcp-deployment/examples/deploy-to-cloudflare/worker-with-kv-storage.md +92 -0
- package/catalog/frontmcp-deployment/examples/deploy-to-lambda/cdk-deployment.md +92 -0
- package/catalog/frontmcp-deployment/examples/deploy-to-lambda/lambda-handler-with-cors.md +113 -0
- package/catalog/frontmcp-deployment/examples/deploy-to-lambda/sam-template-basic.md +100 -0
- package/catalog/frontmcp-deployment/examples/deploy-to-node/docker-compose-with-redis.md +101 -0
- package/catalog/frontmcp-deployment/examples/deploy-to-node/pm2-with-nginx.md +79 -0
- package/catalog/frontmcp-deployment/examples/deploy-to-node/resource-limits.md +92 -0
- package/catalog/frontmcp-deployment/examples/deploy-to-node-dockerfile/basic-multistage-dockerfile.md +63 -0
- package/catalog/frontmcp-deployment/examples/deploy-to-node-dockerfile/secure-nonroot-dockerfile.md +89 -0
- package/catalog/frontmcp-deployment/examples/deploy-to-vercel/vercel-mcp-endpoint-test.md +69 -0
- package/catalog/frontmcp-deployment/examples/deploy-to-vercel/vercel-with-kv.md +82 -0
- package/catalog/frontmcp-deployment/examples/deploy-to-vercel/vercel-with-skills-cache.md +90 -0
- package/catalog/frontmcp-deployment/examples/deploy-to-vercel-config/minimal-vercel-config.md +49 -0
- package/catalog/frontmcp-deployment/examples/deploy-to-vercel-config/vercel-config-with-security-headers.md +92 -0
- package/catalog/frontmcp-deployment/references/build-for-browser.md +15 -0
- package/catalog/frontmcp-deployment/references/build-for-cli.md +65 -3
- package/catalog/frontmcp-deployment/references/build-for-sdk.md +15 -0
- package/catalog/frontmcp-deployment/references/deploy-to-cloudflare.md +15 -0
- package/catalog/frontmcp-deployment/references/deploy-to-lambda.md +18 -3
- package/catalog/frontmcp-deployment/references/deploy-to-node-dockerfile.md +16 -2
- package/catalog/frontmcp-deployment/references/deploy-to-node.md +19 -4
- package/catalog/frontmcp-deployment/references/deploy-to-vercel-config.md +14 -0
- package/catalog/frontmcp-deployment/references/deploy-to-vercel.md +15 -0
- package/catalog/frontmcp-development/SKILL.md +25 -17
- package/catalog/frontmcp-development/examples/create-adapter/basic-api-adapter.md +92 -0
- package/catalog/frontmcp-development/examples/create-adapter/namespaced-adapter.md +124 -0
- package/catalog/frontmcp-development/examples/create-agent/basic-agent-with-tools.md +121 -0
- package/catalog/frontmcp-development/examples/create-agent/custom-multi-pass-agent.md +95 -0
- package/catalog/frontmcp-development/examples/create-agent/nested-agents-with-swarm.md +111 -0
- package/catalog/frontmcp-development/examples/create-agent-llm-config/anthropic-config.md +81 -0
- package/catalog/frontmcp-development/examples/create-agent-llm-config/openai-config.md +80 -0
- package/catalog/frontmcp-development/examples/create-job/basic-report-job.md +87 -0
- package/catalog/frontmcp-development/examples/create-job/job-with-permissions.md +117 -0
- package/catalog/frontmcp-development/examples/create-job/job-with-retry.md +88 -0
- package/catalog/frontmcp-development/examples/create-plugin/basic-plugin-with-provider.md +69 -0
- package/catalog/frontmcp-development/examples/create-plugin/configurable-dynamic-plugin.md +178 -0
- package/catalog/frontmcp-development/examples/create-plugin/plugin-with-context-extension.md +107 -0
- package/catalog/frontmcp-development/examples/create-plugin-hooks/basic-logging-plugin.md +69 -0
- package/catalog/frontmcp-development/examples/create-plugin-hooks/caching-with-around.md +80 -0
- package/catalog/frontmcp-development/examples/create-plugin-hooks/tool-level-hooks-and-stage-replacement.md +100 -0
- package/catalog/frontmcp-development/examples/create-prompt/basic-prompt.md +72 -0
- package/catalog/frontmcp-development/examples/create-prompt/dynamic-rag-prompt.md +92 -0
- package/catalog/frontmcp-development/examples/create-prompt/multi-turn-debug-session.md +86 -0
- package/catalog/frontmcp-development/examples/create-provider/basic-database-provider.md +113 -0
- package/catalog/frontmcp-development/examples/create-provider/config-and-api-providers.md +107 -0
- package/catalog/frontmcp-development/examples/create-resource/basic-static-resource.md +72 -0
- package/catalog/frontmcp-development/examples/create-resource/binary-and-multi-content.md +111 -0
- package/catalog/frontmcp-development/examples/create-resource/parameterized-template.md +84 -0
- package/catalog/frontmcp-development/examples/create-skill/basic-inline-skill.md +96 -0
- package/catalog/frontmcp-development/examples/create-skill/directory-based-skill.md +115 -0
- package/catalog/frontmcp-development/examples/create-skill/parameterized-skill.md +96 -0
- package/catalog/frontmcp-development/examples/create-skill-with-tools/basic-tool-orchestration.md +76 -0
- package/catalog/frontmcp-development/examples/create-skill-with-tools/directory-skill-with-tools.md +149 -0
- package/catalog/frontmcp-development/examples/create-skill-with-tools/incident-response-skill.md +92 -0
- package/catalog/frontmcp-development/examples/create-tool/basic-class-tool.md +62 -0
- package/catalog/frontmcp-development/examples/create-tool/tool-with-di-and-errors.md +84 -0
- package/catalog/frontmcp-development/examples/create-tool/tool-with-rate-limiting-and-progress.md +93 -0
- package/catalog/frontmcp-development/examples/create-tool-annotations/destructive-delete-tool.md +94 -0
- package/catalog/frontmcp-development/examples/create-tool-annotations/readonly-query-tool.md +60 -0
- package/catalog/frontmcp-development/examples/create-tool-output-schema-types/primitive-and-media-outputs.md +104 -0
- package/catalog/frontmcp-development/examples/create-tool-output-schema-types/zod-raw-shape-output.md +63 -0
- package/catalog/frontmcp-development/examples/create-tool-output-schema-types/zod-schema-advanced-output.md +103 -0
- package/catalog/frontmcp-development/examples/create-workflow/basic-deploy-pipeline.md +91 -0
- package/catalog/frontmcp-development/examples/create-workflow/parallel-validation-pipeline.md +90 -0
- package/catalog/frontmcp-development/examples/create-workflow/webhook-triggered-workflow.md +136 -0
- package/catalog/frontmcp-development/examples/decorators-guide/agent-skill-job-workflow.md +145 -0
- package/catalog/frontmcp-development/examples/decorators-guide/basic-server-with-app-and-tools.md +124 -0
- package/catalog/frontmcp-development/examples/decorators-guide/multi-app-with-plugins-and-providers.md +149 -0
- package/catalog/frontmcp-development/examples/official-adapters/authenticated-adapter-with-polling.md +84 -0
- package/catalog/frontmcp-development/examples/official-adapters/basic-openapi-adapter.md +54 -0
- package/catalog/frontmcp-development/examples/official-adapters/multi-api-hub-with-inline-spec.md +130 -0
- package/catalog/frontmcp-development/examples/official-plugins/cache-and-feature-flags.md +117 -0
- package/catalog/frontmcp-development/examples/official-plugins/production-multi-plugin-setup.md +147 -0
- package/catalog/frontmcp-development/examples/official-plugins/remember-plugin-session-memory.md +104 -0
- package/catalog/frontmcp-development/references/create-adapter.md +14 -0
- package/catalog/frontmcp-development/references/create-agent-llm-config.md +14 -0
- package/catalog/frontmcp-development/references/create-agent.md +15 -0
- package/catalog/frontmcp-development/references/create-job.md +15 -0
- package/catalog/frontmcp-development/references/create-plugin-hooks.md +51 -0
- package/catalog/frontmcp-development/references/create-plugin.md +186 -11
- package/catalog/frontmcp-development/references/create-prompt.md +17 -0
- package/catalog/frontmcp-development/references/create-provider.md +14 -0
- package/catalog/frontmcp-development/references/create-resource.md +127 -0
- package/catalog/frontmcp-development/references/create-skill-with-tools.md +126 -7
- package/catalog/frontmcp-development/references/create-skill.md +57 -12
- package/catalog/frontmcp-development/references/create-tool-annotations.md +14 -0
- package/catalog/frontmcp-development/references/create-tool-output-schema-types.md +15 -0
- package/catalog/frontmcp-development/references/create-tool.md +205 -1
- package/catalog/frontmcp-development/references/create-workflow.md +15 -0
- package/catalog/frontmcp-development/references/decorators-guide.md +155 -78
- package/catalog/frontmcp-development/references/official-adapters.md +31 -16
- package/catalog/frontmcp-development/references/official-plugins.md +62 -28
- package/catalog/frontmcp-extensibility/SKILL.md +103 -0
- package/catalog/frontmcp-extensibility/examples/vectoriadb/product-catalog-search.md +175 -0
- package/catalog/frontmcp-extensibility/examples/vectoriadb/semantic-search-with-persistence.md +138 -0
- package/catalog/frontmcp-extensibility/examples/vectoriadb/tfidf-keyword-search.md +103 -0
- package/catalog/frontmcp-extensibility/references/vectoriadb.md +299 -0
- package/catalog/frontmcp-guides/SKILL.md +7 -4
- package/catalog/frontmcp-guides/examples/example-knowledge-base/agent-and-plugin.md +160 -0
- package/catalog/frontmcp-guides/examples/example-knowledge-base/multi-app-composition.md +92 -0
- package/catalog/frontmcp-guides/examples/example-knowledge-base/vector-search-and-resources.md +135 -0
- package/catalog/frontmcp-guides/examples/example-task-manager/auth-and-crud-tools.md +135 -0
- package/catalog/frontmcp-guides/examples/example-task-manager/authenticated-e2e-tests.md +148 -0
- package/catalog/frontmcp-guides/examples/example-task-manager/redis-provider-with-di.md +129 -0
- package/catalog/frontmcp-guides/examples/example-weather-api/server-and-app-setup.md +75 -0
- package/catalog/frontmcp-guides/examples/example-weather-api/unit-and-e2e-tests.md +142 -0
- package/catalog/frontmcp-guides/examples/example-weather-api/weather-tool-with-schemas.md +74 -0
- package/catalog/frontmcp-guides/references/example-knowledge-base.md +15 -0
- package/catalog/frontmcp-guides/references/example-task-manager.md +30 -21
- package/catalog/frontmcp-guides/references/example-weather-api.md +18 -6
- package/catalog/frontmcp-observability/SKILL.md +144 -0
- package/catalog/frontmcp-observability/examples/structured-logging/stdout-logging.md +71 -0
- package/catalog/frontmcp-observability/examples/structured-logging/winston-integration.md +70 -0
- package/catalog/frontmcp-observability/examples/telemetry-api/agent-nested-tracing.md +86 -0
- package/catalog/frontmcp-observability/examples/telemetry-api/plugin-telemetry.md +93 -0
- package/catalog/frontmcp-observability/examples/telemetry-api/tool-custom-spans.md +72 -0
- package/catalog/frontmcp-observability/examples/testing-observability/test-custom-spans.md +90 -0
- package/catalog/frontmcp-observability/examples/testing-observability/test-log-correlation.md +104 -0
- package/catalog/frontmcp-observability/examples/tracing-setup/basic-tracing.md +82 -0
- package/catalog/frontmcp-observability/examples/tracing-setup/production-tracing.md +73 -0
- package/catalog/frontmcp-observability/examples/vendor-integrations/coralogix-setup.md +74 -0
- package/catalog/frontmcp-observability/references/structured-logging.md +114 -0
- package/catalog/frontmcp-observability/references/telemetry-api.md +155 -0
- package/catalog/frontmcp-observability/references/testing-observability.md +169 -0
- package/catalog/frontmcp-observability/references/tracing-setup.md +146 -0
- package/catalog/frontmcp-observability/references/vendor-integrations.md +164 -0
- package/catalog/frontmcp-production-readiness/SKILL.md +99 -0
- package/catalog/frontmcp-production-readiness/examples/common-checklist/caching-and-performance.md +102 -0
- package/catalog/frontmcp-production-readiness/examples/common-checklist/observability-setup.md +104 -0
- package/catalog/frontmcp-production-readiness/examples/common-checklist/security-hardening.md +95 -0
- package/catalog/frontmcp-production-readiness/examples/health-readiness-endpoints/basic-health-setup.md +81 -0
- package/catalog/frontmcp-production-readiness/examples/health-readiness-endpoints/custom-probes.md +136 -0
- package/catalog/frontmcp-production-readiness/examples/production-browser/browser-bundle-config.md +93 -0
- package/catalog/frontmcp-production-readiness/examples/production-browser/cross-platform-crypto.md +116 -0
- package/catalog/frontmcp-production-readiness/examples/production-browser/security-and-performance.md +128 -0
- package/catalog/frontmcp-production-readiness/examples/production-cli-binary/binary-build-config.md +109 -0
- package/catalog/frontmcp-production-readiness/examples/production-cli-binary/stdio-transport-error-handling.md +132 -0
- package/catalog/frontmcp-production-readiness/examples/production-cli-daemon/daemon-socket-config.md +82 -0
- package/catalog/frontmcp-production-readiness/examples/production-cli-daemon/graceful-shutdown-cleanup.md +107 -0
- package/catalog/frontmcp-production-readiness/examples/production-cli-daemon/security-and-permissions.md +119 -0
- package/catalog/frontmcp-production-readiness/examples/production-cloudflare/durable-objects-state.md +124 -0
- package/catalog/frontmcp-production-readiness/examples/production-cloudflare/workers-runtime-constraints.md +103 -0
- package/catalog/frontmcp-production-readiness/examples/production-cloudflare/wrangler-config.md +89 -0
- package/catalog/frontmcp-production-readiness/examples/production-lambda/cold-start-connection-reuse.md +122 -0
- package/catalog/frontmcp-production-readiness/examples/production-lambda/sam-template.md +107 -0
- package/catalog/frontmcp-production-readiness/examples/production-lambda/scaling-and-monitoring.md +138 -0
- package/catalog/frontmcp-production-readiness/examples/production-node-sdk/basic-sdk-lifecycle.md +85 -0
- package/catalog/frontmcp-production-readiness/examples/production-node-sdk/multi-instance-cleanup.md +110 -0
- package/catalog/frontmcp-production-readiness/examples/production-node-sdk/package-json-config.md +107 -0
- package/catalog/frontmcp-production-readiness/examples/production-node-server/docker-multi-stage.md +103 -0
- package/catalog/frontmcp-production-readiness/examples/production-node-server/graceful-shutdown.md +87 -0
- package/catalog/frontmcp-production-readiness/examples/production-node-server/redis-session-scaling.md +97 -0
- package/catalog/frontmcp-production-readiness/examples/production-vercel/cold-start-optimization.md +104 -0
- package/catalog/frontmcp-production-readiness/examples/production-vercel/stateless-serverless-design.md +91 -0
- package/catalog/frontmcp-production-readiness/examples/production-vercel/vercel-edge-config.md +78 -0
- package/catalog/frontmcp-production-readiness/references/common-checklist.md +175 -0
- package/catalog/frontmcp-production-readiness/references/health-readiness-endpoints.md +198 -0
- package/catalog/frontmcp-production-readiness/references/production-browser.md +56 -0
- package/catalog/frontmcp-production-readiness/references/production-cli-binary.md +71 -0
- package/catalog/frontmcp-production-readiness/references/production-cli-daemon.md +71 -0
- package/catalog/frontmcp-production-readiness/references/production-cloudflare.md +62 -0
- package/catalog/frontmcp-production-readiness/references/production-lambda.md +63 -0
- package/catalog/frontmcp-production-readiness/references/production-node-sdk.md +76 -0
- package/catalog/frontmcp-production-readiness/references/production-node-server.md +71 -0
- package/catalog/frontmcp-production-readiness/references/production-vercel.md +62 -0
- package/catalog/frontmcp-setup/SKILL.md +19 -14
- package/catalog/frontmcp-setup/examples/frontmcp-skills-usage/bundle-presets-scaffolding.md +61 -0
- package/catalog/frontmcp-setup/examples/frontmcp-skills-usage/install-and-search-skills.md +83 -0
- package/catalog/frontmcp-setup/examples/multi-app-composition/local-apps-with-shared-tools.md +87 -0
- package/catalog/frontmcp-setup/examples/multi-app-composition/per-app-auth-and-isolation.md +88 -0
- package/catalog/frontmcp-setup/examples/multi-app-composition/remote-and-esm-apps.md +81 -0
- package/catalog/frontmcp-setup/examples/nx-workflow/build-test-affected.md +77 -0
- package/catalog/frontmcp-setup/examples/nx-workflow/multi-server-deployment.md +93 -0
- package/catalog/frontmcp-setup/examples/nx-workflow/scaffold-and-generate.md +62 -0
- package/catalog/frontmcp-setup/examples/project-structure-nx/nx-generator-scaffolding.md +73 -0
- package/catalog/frontmcp-setup/examples/project-structure-nx/nx-workspace-with-apps.md +85 -0
- package/catalog/frontmcp-setup/examples/project-structure-nx/shared-library-usage.md +89 -0
- package/catalog/frontmcp-setup/examples/project-structure-standalone/dev-workflow-commands.md +64 -0
- package/catalog/frontmcp-setup/examples/project-structure-standalone/feature-folder-organization.md +111 -0
- package/catalog/frontmcp-setup/examples/project-structure-standalone/minimal-standalone-layout.md +73 -0
- package/catalog/frontmcp-setup/examples/readme-guide/node-server-readme.md +89 -0
- package/catalog/frontmcp-setup/examples/readme-guide/vercel-deployment-readme.md +90 -0
- package/catalog/frontmcp-setup/examples/setup-project/basic-node-server.md +99 -0
- package/catalog/frontmcp-setup/examples/setup-project/cli-scaffold-with-flags.md +77 -0
- package/catalog/frontmcp-setup/examples/setup-project/vercel-serverless-server.md +89 -0
- package/catalog/frontmcp-setup/examples/setup-redis/docker-redis-local-dev.md +88 -0
- package/catalog/frontmcp-setup/examples/setup-redis/hybrid-vercel-kv-with-pubsub.md +78 -0
- package/catalog/frontmcp-setup/examples/setup-redis/vercel-kv-serverless.md +78 -0
- package/catalog/frontmcp-setup/examples/setup-sqlite/basic-sqlite-setup.md +75 -0
- package/catalog/frontmcp-setup/examples/setup-sqlite/encrypted-sqlite-storage.md +55 -0
- package/catalog/frontmcp-setup/examples/setup-sqlite/unix-socket-daemon.md +70 -0
- package/catalog/frontmcp-setup/references/frontmcp-skills-usage.md +33 -9
- package/catalog/frontmcp-setup/references/multi-app-composition.md +15 -0
- package/catalog/frontmcp-setup/references/nx-workflow.md +15 -0
- package/catalog/frontmcp-setup/references/project-structure-nx.md +15 -0
- package/catalog/frontmcp-setup/references/project-structure-standalone.md +15 -0
- package/catalog/frontmcp-setup/references/readme-guide.md +235 -0
- package/catalog/frontmcp-setup/references/setup-project.md +16 -1
- package/catalog/frontmcp-setup/references/setup-redis.md +15 -0
- package/catalog/frontmcp-setup/references/setup-sqlite.md +15 -0
- package/catalog/frontmcp-testing/SKILL.md +41 -27
- package/catalog/frontmcp-testing/examples/setup-testing/fixture-based-e2e-test.md +70 -0
- package/catalog/frontmcp-testing/examples/setup-testing/jest-config-with-coverage.md +59 -0
- package/catalog/frontmcp-testing/examples/setup-testing/unit-test-tool-resource-prompt.md +115 -0
- package/catalog/frontmcp-testing/examples/test-auth/oauth-flow-test.md +78 -0
- package/catalog/frontmcp-testing/examples/test-auth/role-based-access-test.md +88 -0
- package/catalog/frontmcp-testing/examples/test-auth/token-factory-test.md +71 -0
- package/catalog/frontmcp-testing/examples/test-browser-build/browser-bundle-validation.md +58 -0
- package/catalog/frontmcp-testing/examples/test-browser-build/playwright-browser-test.md +69 -0
- package/catalog/frontmcp-testing/examples/test-cli-binary/binary-startup-test.md +77 -0
- package/catalog/frontmcp-testing/examples/test-cli-binary/js-bundle-import-test.md +56 -0
- package/catalog/frontmcp-testing/examples/test-direct-client/basic-create-test.md +74 -0
- package/catalog/frontmcp-testing/examples/test-direct-client/openai-claude-format-test.md +79 -0
- package/catalog/frontmcp-testing/examples/test-e2e-handler/basic-e2e-test.md +67 -0
- package/catalog/frontmcp-testing/examples/test-e2e-handler/manual-client-with-transport.md +72 -0
- package/catalog/frontmcp-testing/examples/test-e2e-handler/tool-call-and-error-e2e.md +73 -0
- package/catalog/frontmcp-testing/examples/test-tool-unit/basic-tool-test.md +69 -0
- package/catalog/frontmcp-testing/examples/test-tool-unit/schema-validation-test.md +82 -0
- package/catalog/frontmcp-testing/examples/test-tool-unit/tool-error-handling-test.md +92 -0
- package/catalog/frontmcp-testing/references/setup-testing.md +17 -0
- package/catalog/frontmcp-testing/references/test-auth.md +15 -0
- package/catalog/frontmcp-testing/references/test-browser-build.md +14 -0
- package/catalog/frontmcp-testing/references/test-cli-binary.md +14 -0
- package/catalog/frontmcp-testing/references/test-direct-client.md +14 -0
- package/catalog/frontmcp-testing/references/test-e2e-handler.md +15 -0
- package/catalog/frontmcp-testing/references/test-tool-unit.md +15 -0
- package/catalog/skills-manifest.json +2849 -32
- package/package.json +2 -2
- package/src/index.d.ts +1 -1
- package/src/index.js.map +1 -1
- package/src/loader.js +0 -1
- package/src/loader.js.map +1 -1
- package/src/manifest.d.ts +36 -1
- package/src/manifest.js +6 -1
- package/src/manifest.js.map +1 -1
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: custom-multi-pass-agent
|
|
3
|
+
reference: create-agent
|
|
4
|
+
level: intermediate
|
|
5
|
+
description: 'An agent that overrides `execute()` to perform multi-pass LLM reasoning with `this.completion()`.'
|
|
6
|
+
tags: [development, security, agent, custom, multi, pass]
|
|
7
|
+
features:
|
|
8
|
+
- 'Overriding `execute()` for custom multi-pass orchestration instead of the default agent loop'
|
|
9
|
+
- 'Using `this.completion()` to make individual LLM calls with full control over prompts'
|
|
10
|
+
- 'Using `this.mark(stage)` to track execution stages (security-pass, quality-pass, synthesis)'
|
|
11
|
+
- 'Defining `outputSchema` with Zod to validate and type-check the structured return value'
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
# Custom Multi-Pass Agent with Structured Output
|
|
15
|
+
|
|
16
|
+
An agent that overrides `execute()` to perform multi-pass LLM reasoning with `this.completion()`.
|
|
17
|
+
|
|
18
|
+
## Code
|
|
19
|
+
|
|
20
|
+
```typescript
|
|
21
|
+
// src/apps/review/agents/structured-reviewer.agent.ts
|
|
22
|
+
import { Agent, AgentContext } from '@frontmcp/sdk';
|
|
23
|
+
import { z } from 'zod';
|
|
24
|
+
|
|
25
|
+
@Agent({
|
|
26
|
+
name: 'structured_reviewer',
|
|
27
|
+
description: 'Reviews code with a structured multi-pass approach',
|
|
28
|
+
llm: {
|
|
29
|
+
provider: 'anthropic',
|
|
30
|
+
model: 'claude-sonnet-4-20250514',
|
|
31
|
+
apiKey: { env: 'ANTHROPIC_API_KEY' },
|
|
32
|
+
},
|
|
33
|
+
inputSchema: {
|
|
34
|
+
code: z.string().describe('Source code to review'),
|
|
35
|
+
},
|
|
36
|
+
outputSchema: {
|
|
37
|
+
issues: z.array(
|
|
38
|
+
z.object({
|
|
39
|
+
severity: z.enum(['error', 'warning', 'info']),
|
|
40
|
+
line: z.number(),
|
|
41
|
+
message: z.string(),
|
|
42
|
+
}),
|
|
43
|
+
),
|
|
44
|
+
summary: z.string(),
|
|
45
|
+
},
|
|
46
|
+
})
|
|
47
|
+
class StructuredReviewerAgent extends AgentContext {
|
|
48
|
+
async execute(input: { code: string }) {
|
|
49
|
+
this.mark('security-pass');
|
|
50
|
+
const securityReview = await this.completion({
|
|
51
|
+
messages: [{ role: 'user', content: `Review this code for security issues:\n${input.code}` }],
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
this.mark('quality-pass');
|
|
55
|
+
const qualityReview = await this.completion({
|
|
56
|
+
messages: [{ role: 'user', content: `Review this code for quality issues:\n${input.code}` }],
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
this.mark('synthesis');
|
|
60
|
+
const finalReview = await this.completion({
|
|
61
|
+
messages: [
|
|
62
|
+
{
|
|
63
|
+
role: 'user',
|
|
64
|
+
content: `Combine these reviews into a structured JSON report with "issues" (array of {severity, line, message}) and "summary" (string):\nSecurity: ${securityReview.content}\nQuality: ${qualityReview.content}`,
|
|
65
|
+
},
|
|
66
|
+
],
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
return JSON.parse(finalReview.content);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
```typescript
|
|
75
|
+
// src/apps/review/index.ts
|
|
76
|
+
import { App } from '@frontmcp/sdk';
|
|
77
|
+
|
|
78
|
+
@App({
|
|
79
|
+
name: 'review-app',
|
|
80
|
+
agents: [StructuredReviewerAgent],
|
|
81
|
+
})
|
|
82
|
+
class ReviewApp {}
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
## What This Demonstrates
|
|
86
|
+
|
|
87
|
+
- Overriding `execute()` for custom multi-pass orchestration instead of the default agent loop
|
|
88
|
+
- Using `this.completion()` to make individual LLM calls with full control over prompts
|
|
89
|
+
- Using `this.mark(stage)` to track execution stages (security-pass, quality-pass, synthesis)
|
|
90
|
+
- Defining `outputSchema` with Zod to validate and type-check the structured return value
|
|
91
|
+
|
|
92
|
+
## Related
|
|
93
|
+
|
|
94
|
+
- See `create-agent` for streaming with `streamCompletion()`, sub-agents, and swarm handoff
|
|
95
|
+
- See `create-agent-llm-config` for provider-specific options like `maxTokens` and `temperature`
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: nested-agents-with-swarm
|
|
3
|
+
reference: create-agent
|
|
4
|
+
level: advanced
|
|
5
|
+
description: 'Composing specialized sub-agents and configuring swarm-based handoff between agents.'
|
|
6
|
+
tags: [development, agent, nested, agents, swarm]
|
|
7
|
+
features:
|
|
8
|
+
- "Configuring `swarm` with `role: 'coordinator'` for the triage agent and `role: 'specialist'` for domain agents"
|
|
9
|
+
- 'Defining `handoff` rules with `agent` name and `condition` for declarative LLM-driven routing'
|
|
10
|
+
- 'Specialist agents can hand back to the triage agent when a request falls outside their scope'
|
|
11
|
+
- 'Each agent has its own `llm` config, `tools`, and `systemInstructions` for specialization'
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
# Nested Sub-Agents and Swarm Handoff
|
|
15
|
+
|
|
16
|
+
Composing specialized sub-agents and configuring swarm-based handoff between agents.
|
|
17
|
+
|
|
18
|
+
## Code
|
|
19
|
+
|
|
20
|
+
```typescript
|
|
21
|
+
// src/apps/support/agents/billing.agent.ts
|
|
22
|
+
import { Agent, AgentContext, Tool, ToolContext } from '@frontmcp/sdk';
|
|
23
|
+
import { z } from 'zod';
|
|
24
|
+
|
|
25
|
+
@Tool({
|
|
26
|
+
name: 'lookup_invoice',
|
|
27
|
+
description: 'Look up an invoice by ID',
|
|
28
|
+
inputSchema: { invoiceId: z.string() },
|
|
29
|
+
})
|
|
30
|
+
class LookupInvoiceTool extends ToolContext {
|
|
31
|
+
async execute(input: { invoiceId: string }) {
|
|
32
|
+
return { id: input.invoiceId, amount: 99.99, status: 'paid' };
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
@Agent({
|
|
37
|
+
name: 'billing_agent',
|
|
38
|
+
description: 'Handles billing and payment inquiries',
|
|
39
|
+
llm: { provider: 'anthropic', model: 'claude-sonnet-4-20250514', apiKey: { env: 'ANTHROPIC_API_KEY' } },
|
|
40
|
+
tools: [LookupInvoiceTool],
|
|
41
|
+
swarm: {
|
|
42
|
+
role: 'specialist',
|
|
43
|
+
handoff: [{ agent: 'triage_agent', condition: 'Request is outside billing scope' }],
|
|
44
|
+
},
|
|
45
|
+
})
|
|
46
|
+
class BillingAgent extends AgentContext {}
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
```typescript
|
|
50
|
+
// src/apps/support/agents/technical.agent.ts
|
|
51
|
+
import { Agent, AgentContext } from '@frontmcp/sdk';
|
|
52
|
+
|
|
53
|
+
@Agent({
|
|
54
|
+
name: 'technical_agent',
|
|
55
|
+
description: 'Handles technical support issues',
|
|
56
|
+
llm: { provider: 'anthropic', model: 'claude-sonnet-4-20250514', apiKey: { env: 'ANTHROPIC_API_KEY' } },
|
|
57
|
+
systemInstructions: 'You are a technical support specialist. Diagnose issues and provide solutions.',
|
|
58
|
+
swarm: {
|
|
59
|
+
role: 'specialist',
|
|
60
|
+
handoff: [{ agent: 'triage_agent', condition: 'Request is outside technical scope' }],
|
|
61
|
+
},
|
|
62
|
+
})
|
|
63
|
+
class TechnicalAgent extends AgentContext {}
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
```typescript
|
|
67
|
+
// src/apps/support/agents/triage.agent.ts
|
|
68
|
+
import { Agent, AgentContext } from '@frontmcp/sdk';
|
|
69
|
+
import { z } from 'zod';
|
|
70
|
+
|
|
71
|
+
@Agent({
|
|
72
|
+
name: 'triage_agent',
|
|
73
|
+
description: 'Triages incoming requests and hands off to specialists',
|
|
74
|
+
llm: { provider: 'anthropic', model: 'claude-sonnet-4-20250514', apiKey: { env: 'ANTHROPIC_API_KEY' } },
|
|
75
|
+
inputSchema: {
|
|
76
|
+
request: z.string().describe('The incoming user request'),
|
|
77
|
+
},
|
|
78
|
+
swarm: {
|
|
79
|
+
role: 'coordinator',
|
|
80
|
+
handoff: [
|
|
81
|
+
{ agent: 'billing_agent', condition: 'Request is about billing or payments' },
|
|
82
|
+
{ agent: 'technical_agent', condition: 'Request is about technical issues' },
|
|
83
|
+
],
|
|
84
|
+
},
|
|
85
|
+
systemInstructions: 'Analyze the request and hand off to the appropriate specialist agent.',
|
|
86
|
+
})
|
|
87
|
+
class TriageAgent extends AgentContext {}
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
```typescript
|
|
91
|
+
// src/apps/support/index.ts
|
|
92
|
+
import { App } from '@frontmcp/sdk';
|
|
93
|
+
|
|
94
|
+
@App({
|
|
95
|
+
name: 'support-app',
|
|
96
|
+
agents: [TriageAgent, BillingAgent, TechnicalAgent],
|
|
97
|
+
})
|
|
98
|
+
class SupportApp {}
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
## What This Demonstrates
|
|
102
|
+
|
|
103
|
+
- Configuring `swarm` with `role: 'coordinator'` for the triage agent and `role: 'specialist'` for domain agents
|
|
104
|
+
- Defining `handoff` rules with `agent` name and `condition` for declarative LLM-driven routing
|
|
105
|
+
- Specialist agents can hand back to the triage agent when a request falls outside their scope
|
|
106
|
+
- Each agent has its own `llm` config, `tools`, and `systemInstructions` for specialization
|
|
107
|
+
|
|
108
|
+
## Related
|
|
109
|
+
|
|
110
|
+
- See `create-agent` for exported tools, function-style builder, providers, and rate limiting
|
|
111
|
+
- See `create-agent-llm-config` for using different LLM providers per agent
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: anthropic-config
|
|
3
|
+
reference: create-agent-llm-config
|
|
4
|
+
level: basic
|
|
5
|
+
description: 'Configuring an agent with the Anthropic provider and common model options.'
|
|
6
|
+
tags: [development, anthropic, llm, agent, config]
|
|
7
|
+
features:
|
|
8
|
+
- "Setting `provider: 'anthropic'` with a supported model (`claude-sonnet-4-20250514` or `claude-opus-4-20250514`)"
|
|
9
|
+
- "Using `{ env: 'ANTHROPIC_API_KEY' }` to read the API key from an environment variable"
|
|
10
|
+
- 'Setting `maxTokens` at the LLM config level and overriding per-call via `this.completion()` options'
|
|
11
|
+
- 'Passing `temperature` as a per-call option for controlling response creativity'
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
# Anthropic LLM Configuration
|
|
15
|
+
|
|
16
|
+
Configuring an agent with the Anthropic provider and common model options.
|
|
17
|
+
|
|
18
|
+
## Code
|
|
19
|
+
|
|
20
|
+
```typescript
|
|
21
|
+
// src/apps/main/agents/summarizer.agent.ts
|
|
22
|
+
import { Agent, AgentContext } from '@frontmcp/sdk';
|
|
23
|
+
import { z } from 'zod';
|
|
24
|
+
|
|
25
|
+
@Agent({
|
|
26
|
+
name: 'summarizer',
|
|
27
|
+
description: 'Summarizes text using Anthropic Claude',
|
|
28
|
+
llm: {
|
|
29
|
+
provider: 'anthropic',
|
|
30
|
+
model: 'claude-sonnet-4-20250514',
|
|
31
|
+
apiKey: { env: 'ANTHROPIC_API_KEY' },
|
|
32
|
+
maxTokens: 4096,
|
|
33
|
+
},
|
|
34
|
+
inputSchema: {
|
|
35
|
+
text: z.string().describe('Text to summarize'),
|
|
36
|
+
},
|
|
37
|
+
})
|
|
38
|
+
class SummarizerAgent extends AgentContext {
|
|
39
|
+
async execute(input: { text: string }) {
|
|
40
|
+
const result = await this.completion(
|
|
41
|
+
{
|
|
42
|
+
messages: [{ role: 'user', content: `Summarize this text:\n${input.text}` }],
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
maxTokens: 500,
|
|
46
|
+
temperature: 0.3,
|
|
47
|
+
},
|
|
48
|
+
);
|
|
49
|
+
|
|
50
|
+
return result.content;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
```typescript
|
|
56
|
+
// For the most capable model:
|
|
57
|
+
@Agent({
|
|
58
|
+
name: 'complex_reasoner',
|
|
59
|
+
description: 'Handles complex reasoning tasks',
|
|
60
|
+
llm: {
|
|
61
|
+
provider: 'anthropic',
|
|
62
|
+
model: 'claude-opus-4-20250514',
|
|
63
|
+
apiKey: { env: 'ANTHROPIC_API_KEY' },
|
|
64
|
+
maxTokens: 4096,
|
|
65
|
+
},
|
|
66
|
+
// ...
|
|
67
|
+
})
|
|
68
|
+
class ComplexReasonerAgent extends AgentContext {}
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
## What This Demonstrates
|
|
72
|
+
|
|
73
|
+
- Setting `provider: 'anthropic'` with a supported model (`claude-sonnet-4-20250514` or `claude-opus-4-20250514`)
|
|
74
|
+
- Using `{ env: 'ANTHROPIC_API_KEY' }` to read the API key from an environment variable
|
|
75
|
+
- Setting `maxTokens` at the LLM config level and overriding per-call via `this.completion()` options
|
|
76
|
+
- Passing `temperature` as a per-call option for controlling response creativity
|
|
77
|
+
|
|
78
|
+
## Related
|
|
79
|
+
|
|
80
|
+
- See `create-agent-llm-config` for all supported providers and the common models table
|
|
81
|
+
- See `create-agent` for full agent patterns including inner tools and swarm configuration
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: openai-config
|
|
3
|
+
reference: create-agent-llm-config
|
|
4
|
+
level: basic
|
|
5
|
+
description: 'Configuring an agent with the OpenAI provider and different model options.'
|
|
6
|
+
tags: [development, openai, llm, agent, config]
|
|
7
|
+
features:
|
|
8
|
+
- "Setting `provider: 'openai'` with `gpt-4o` for general purpose or `gpt-4o-mini` for cost-effective tasks"
|
|
9
|
+
- "The API key pattern `{ env: 'OPENAI_API_KEY' }` works the same across all providers"
|
|
10
|
+
- 'Combining LLM config with inner tools -- the agent uses OpenAI to reason about tool invocations'
|
|
11
|
+
- 'Choosing the right model for the task: `gpt-4o` for complex workflows, `gpt-4o-mini` for fast classification'
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
# OpenAI LLM Configuration
|
|
15
|
+
|
|
16
|
+
Configuring an agent with the OpenAI provider and different model options.
|
|
17
|
+
|
|
18
|
+
## Code
|
|
19
|
+
|
|
20
|
+
```typescript
|
|
21
|
+
// src/apps/main/agents/data-pipeline.agent.ts
|
|
22
|
+
import { Agent, AgentContext, Tool, ToolContext } from '@frontmcp/sdk';
|
|
23
|
+
import { z } from 'zod';
|
|
24
|
+
|
|
25
|
+
@Tool({
|
|
26
|
+
name: 'extract_data',
|
|
27
|
+
description: 'Extract data from a source',
|
|
28
|
+
inputSchema: { source: z.string() },
|
|
29
|
+
})
|
|
30
|
+
class ExtractTool extends ToolContext {
|
|
31
|
+
async execute(input: { source: string }) {
|
|
32
|
+
return { data: `extracted from ${input.source}` };
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
@Agent({
|
|
37
|
+
name: 'data_pipeline',
|
|
38
|
+
description: 'Data processing pipeline agent',
|
|
39
|
+
llm: {
|
|
40
|
+
provider: 'openai',
|
|
41
|
+
model: 'gpt-4o',
|
|
42
|
+
apiKey: { env: 'OPENAI_API_KEY' },
|
|
43
|
+
maxTokens: 4096,
|
|
44
|
+
},
|
|
45
|
+
inputSchema: {
|
|
46
|
+
source: z.string().describe('Data source to process'),
|
|
47
|
+
},
|
|
48
|
+
tools: [ExtractTool],
|
|
49
|
+
systemInstructions: 'You are a data processing agent. Extract and transform data from the given source.',
|
|
50
|
+
})
|
|
51
|
+
class DataPipelineAgent extends AgentContext {}
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
```typescript
|
|
55
|
+
// For a cost-effective model:
|
|
56
|
+
@Agent({
|
|
57
|
+
name: 'quick_classifier',
|
|
58
|
+
description: 'Fast classification of incoming requests',
|
|
59
|
+
llm: {
|
|
60
|
+
provider: 'openai',
|
|
61
|
+
model: 'gpt-4o-mini',
|
|
62
|
+
apiKey: { env: 'OPENAI_API_KEY' },
|
|
63
|
+
maxTokens: 1024,
|
|
64
|
+
},
|
|
65
|
+
// ...
|
|
66
|
+
})
|
|
67
|
+
class QuickClassifierAgent extends AgentContext {}
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
## What This Demonstrates
|
|
71
|
+
|
|
72
|
+
- Setting `provider: 'openai'` with `gpt-4o` for general purpose or `gpt-4o-mini` for cost-effective tasks
|
|
73
|
+
- The API key pattern `{ env: 'OPENAI_API_KEY' }` works the same across all providers
|
|
74
|
+
- Combining LLM config with inner tools -- the agent uses OpenAI to reason about tool invocations
|
|
75
|
+
- Choosing the right model for the task: `gpt-4o` for complex workflows, `gpt-4o-mini` for fast classification
|
|
76
|
+
|
|
77
|
+
## Related
|
|
78
|
+
|
|
79
|
+
- See `create-agent-llm-config` for the complete common models table and API key source options
|
|
80
|
+
- See `create-agent` for sub-agents using different providers for specialized tasks
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: basic-report-job
|
|
3
|
+
reference: create-job
|
|
4
|
+
level: basic
|
|
5
|
+
description: 'A minimal job that generates a report with progress tracking and structured output.'
|
|
6
|
+
tags: [development, job, report]
|
|
7
|
+
features:
|
|
8
|
+
- 'Defining a job with `@Job` decorator including `inputSchema`, `outputSchema`, and `timeout`'
|
|
9
|
+
- 'Reporting progress at each stage using `this.progress(pct, total, message)`'
|
|
10
|
+
- 'Using `this.log()` for persistent, queryable log entries'
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# Basic Report Generation Job
|
|
14
|
+
|
|
15
|
+
A minimal job that generates a report with progress tracking and structured output.
|
|
16
|
+
|
|
17
|
+
## Code
|
|
18
|
+
|
|
19
|
+
```typescript
|
|
20
|
+
// src/jobs/generate-report.job.ts
|
|
21
|
+
import { Job, JobContext } from '@frontmcp/sdk';
|
|
22
|
+
import { z } from 'zod';
|
|
23
|
+
|
|
24
|
+
@Job({
|
|
25
|
+
name: 'generate-report',
|
|
26
|
+
description: 'Generate a PDF report from data',
|
|
27
|
+
inputSchema: {
|
|
28
|
+
reportType: z.enum(['sales', 'inventory', 'users']).describe('Type of report'),
|
|
29
|
+
dateRange: z.object({
|
|
30
|
+
from: z.string().describe('Start date (ISO 8601)'),
|
|
31
|
+
to: z.string().describe('End date (ISO 8601)'),
|
|
32
|
+
}),
|
|
33
|
+
format: z.enum(['pdf', 'csv']).default('pdf').describe('Output format'),
|
|
34
|
+
},
|
|
35
|
+
outputSchema: {
|
|
36
|
+
url: z.string().url(),
|
|
37
|
+
pageCount: z.number().int(),
|
|
38
|
+
generatedAt: z.string(),
|
|
39
|
+
},
|
|
40
|
+
timeout: 120000,
|
|
41
|
+
})
|
|
42
|
+
class GenerateReportJob extends JobContext {
|
|
43
|
+
async execute(input: {
|
|
44
|
+
reportType: 'sales' | 'inventory' | 'users';
|
|
45
|
+
dateRange: { from: string; to: string };
|
|
46
|
+
format: 'pdf' | 'csv';
|
|
47
|
+
}) {
|
|
48
|
+
this.log(`Starting ${input.reportType} report generation`);
|
|
49
|
+
|
|
50
|
+
this.progress(10, 100, 'Fetching data');
|
|
51
|
+
const data = await this.fetchReportData(input.reportType, input.dateRange);
|
|
52
|
+
|
|
53
|
+
this.progress(50, 100, 'Generating document');
|
|
54
|
+
const document = await this.buildDocument(data, input.format);
|
|
55
|
+
|
|
56
|
+
this.progress(90, 100, 'Uploading');
|
|
57
|
+
const url = await this.uploadDocument(document);
|
|
58
|
+
|
|
59
|
+
this.progress(100, 100, 'Complete');
|
|
60
|
+
return {
|
|
61
|
+
url,
|
|
62
|
+
pageCount: document.pages,
|
|
63
|
+
generatedAt: new Date().toISOString(),
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
private async fetchReportData(type: string, range: { from: string; to: string }) {
|
|
68
|
+
return { rows: [], count: 0 };
|
|
69
|
+
}
|
|
70
|
+
private async buildDocument(data: unknown, format: string) {
|
|
71
|
+
return { pages: 5, buffer: Buffer.alloc(0) };
|
|
72
|
+
}
|
|
73
|
+
private async uploadDocument(doc: { buffer: Buffer }) {
|
|
74
|
+
return 'https://storage.example.com/reports/report-001.pdf';
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## What This Demonstrates
|
|
80
|
+
|
|
81
|
+
- Defining a job with `@Job` decorator including `inputSchema`, `outputSchema`, and `timeout`
|
|
82
|
+
- Reporting progress at each stage using `this.progress(pct, total, message)`
|
|
83
|
+
- Using `this.log()` for persistent, queryable log entries
|
|
84
|
+
|
|
85
|
+
## Related
|
|
86
|
+
|
|
87
|
+
- See `create-job` for the full API reference including retry policies and permissions
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: job-with-permissions
|
|
3
|
+
reference: create-job
|
|
4
|
+
level: advanced
|
|
5
|
+
description: 'A data export job with declarative permission controls, plus a function-style job for simple tasks.'
|
|
6
|
+
tags: [development, redis, job, permissions]
|
|
7
|
+
features:
|
|
8
|
+
- 'Declarative `permissions` with `actions`, `roles`, `scopes`, and a custom `predicate`'
|
|
9
|
+
- 'Using `tags` and `labels` for categorization and filtering'
|
|
10
|
+
- 'The `job()` function builder for simple jobs that need no class'
|
|
11
|
+
- 'Full server registration with `jobs.enabled: true` and a Redis store'
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
# Job with Permissions, Tags, and Function Builder
|
|
15
|
+
|
|
16
|
+
A data export job with declarative permission controls, plus a function-style job for simple tasks.
|
|
17
|
+
|
|
18
|
+
## Code
|
|
19
|
+
|
|
20
|
+
```typescript
|
|
21
|
+
// src/jobs/data-export.job.ts
|
|
22
|
+
import { Job, JobContext, job } from '@frontmcp/sdk';
|
|
23
|
+
import { z } from 'zod';
|
|
24
|
+
|
|
25
|
+
@Job({
|
|
26
|
+
name: 'data-export',
|
|
27
|
+
description: 'Export data to external storage',
|
|
28
|
+
inputSchema: {
|
|
29
|
+
dataset: z.string(),
|
|
30
|
+
destination: z.string().url(),
|
|
31
|
+
},
|
|
32
|
+
outputSchema: {
|
|
33
|
+
exportedRows: z.number().int(),
|
|
34
|
+
location: z.string().url(),
|
|
35
|
+
},
|
|
36
|
+
tags: ['export', 'data'],
|
|
37
|
+
labels: { team: 'data-engineering', priority: 'high' },
|
|
38
|
+
permissions: {
|
|
39
|
+
actions: ['create', 'read', 'execute', 'list'],
|
|
40
|
+
roles: ['admin', 'data-engineer'],
|
|
41
|
+
scopes: ['jobs:write', 'data:export'],
|
|
42
|
+
predicate: (ctx) => ctx.user?.department === 'engineering',
|
|
43
|
+
},
|
|
44
|
+
})
|
|
45
|
+
class DataExportJob extends JobContext {
|
|
46
|
+
async execute(input: { dataset: string; destination: string }) {
|
|
47
|
+
this.log(`Exporting dataset: ${input.dataset}`);
|
|
48
|
+
const rows = await this.exportData(input.dataset, input.destination);
|
|
49
|
+
return { exportedRows: rows, location: input.destination };
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
private async exportData(dataset: string, destination: string) {
|
|
53
|
+
return 1000;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
// Function-style job for simple tasks
|
|
58
|
+
const CleanupTempFiles = job({
|
|
59
|
+
name: 'cleanup-temp-files',
|
|
60
|
+
description: 'Remove temporary files older than the specified age',
|
|
61
|
+
inputSchema: {
|
|
62
|
+
directory: z.string().describe('Directory to clean'),
|
|
63
|
+
maxAgeDays: z.number().int().min(1).default(7),
|
|
64
|
+
},
|
|
65
|
+
outputSchema: {
|
|
66
|
+
deleted: z.number().int(),
|
|
67
|
+
freedBytes: z.number().int(),
|
|
68
|
+
},
|
|
69
|
+
})((input, ctx) => {
|
|
70
|
+
ctx.log(`Cleaning ${input.directory}, max age: ${input.maxAgeDays} days`);
|
|
71
|
+
ctx.progress(0, 100, 'Scanning directory');
|
|
72
|
+
|
|
73
|
+
// ... scan and delete logic ...
|
|
74
|
+
|
|
75
|
+
ctx.progress(100, 100, 'Cleanup complete');
|
|
76
|
+
return { deleted: 42, freedBytes: 1024000 };
|
|
77
|
+
});
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
```typescript
|
|
81
|
+
// src/server.ts
|
|
82
|
+
import { FrontMcp, App } from '@frontmcp/sdk';
|
|
83
|
+
|
|
84
|
+
@App({
|
|
85
|
+
name: 'data-app',
|
|
86
|
+
jobs: [DataExportJob, CleanupTempFiles],
|
|
87
|
+
})
|
|
88
|
+
class DataApp {}
|
|
89
|
+
|
|
90
|
+
@FrontMcp({
|
|
91
|
+
info: { name: 'data-server', version: '1.0.0' },
|
|
92
|
+
apps: [DataApp],
|
|
93
|
+
jobs: {
|
|
94
|
+
enabled: true,
|
|
95
|
+
store: {
|
|
96
|
+
redis: {
|
|
97
|
+
provider: 'redis',
|
|
98
|
+
host: 'localhost',
|
|
99
|
+
port: 6379,
|
|
100
|
+
keyPrefix: 'mcp:jobs:',
|
|
101
|
+
},
|
|
102
|
+
},
|
|
103
|
+
},
|
|
104
|
+
})
|
|
105
|
+
class DataServer {}
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
## What This Demonstrates
|
|
109
|
+
|
|
110
|
+
- Declarative `permissions` with `actions`, `roles`, `scopes`, and a custom `predicate`
|
|
111
|
+
- Using `tags` and `labels` for categorization and filtering
|
|
112
|
+
- The `job()` function builder for simple jobs that need no class
|
|
113
|
+
- Full server registration with `jobs.enabled: true` and a Redis store
|
|
114
|
+
|
|
115
|
+
## Related
|
|
116
|
+
|
|
117
|
+
- See `create-job` for the complete permissions reference and all job registration options
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: job-with-retry
|
|
3
|
+
reference: create-job
|
|
4
|
+
level: intermediate
|
|
5
|
+
description: 'A job that syncs data from an external API with automatic retry, exponential backoff, and batch progress tracking.'
|
|
6
|
+
tags: [development, job, retry]
|
|
7
|
+
features:
|
|
8
|
+
- 'Configuring `retry` with `maxAttempts`, `backoffMs`, `backoffMultiplier`, and `maxBackoffMs`'
|
|
9
|
+
- 'Using `this.attempt` to log retry context (1-based attempt counter)'
|
|
10
|
+
- 'Using `this.fail()` to abort execution and trigger the retry flow'
|
|
11
|
+
- 'Combining batch processing with `this.progress()` for granular tracking'
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
# Job with Retry Policy and Batch Processing
|
|
15
|
+
|
|
16
|
+
A job that syncs data from an external API with automatic retry, exponential backoff, and batch progress tracking.
|
|
17
|
+
|
|
18
|
+
## Code
|
|
19
|
+
|
|
20
|
+
```typescript
|
|
21
|
+
// src/jobs/sync-external-api.job.ts
|
|
22
|
+
import { Job, JobContext } from '@frontmcp/sdk';
|
|
23
|
+
import { z } from 'zod';
|
|
24
|
+
|
|
25
|
+
@Job({
|
|
26
|
+
name: 'sync-external-api',
|
|
27
|
+
description: 'Synchronize data from an external API',
|
|
28
|
+
inputSchema: {
|
|
29
|
+
endpoint: z.string().url().describe('API endpoint to sync from'),
|
|
30
|
+
batchSize: z.number().int().min(1).max(1000).default(100),
|
|
31
|
+
},
|
|
32
|
+
outputSchema: {
|
|
33
|
+
synced: z.number().int(),
|
|
34
|
+
errors: z.number().int(),
|
|
35
|
+
},
|
|
36
|
+
timeout: 600000, // 10 minutes
|
|
37
|
+
retry: {
|
|
38
|
+
maxAttempts: 5,
|
|
39
|
+
backoffMs: 2000,
|
|
40
|
+
backoffMultiplier: 2,
|
|
41
|
+
maxBackoffMs: 60000,
|
|
42
|
+
},
|
|
43
|
+
})
|
|
44
|
+
class SyncExternalApiJob extends JobContext {
|
|
45
|
+
async execute(input: { endpoint: string; batchSize: number }) {
|
|
46
|
+
this.log(`Attempt ${this.attempt}: syncing from ${input.endpoint}`);
|
|
47
|
+
|
|
48
|
+
const response = await this.fetch(input.endpoint);
|
|
49
|
+
if (!response.ok) {
|
|
50
|
+
this.fail(new Error(`API returned ${response.status}`));
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
const data = await response.json();
|
|
54
|
+
let synced = 0;
|
|
55
|
+
let errors = 0;
|
|
56
|
+
|
|
57
|
+
for (let i = 0; i < data.items.length; i += input.batchSize) {
|
|
58
|
+
const batch = data.items.slice(i, i + input.batchSize);
|
|
59
|
+
this.progress(i, data.items.length, `Processing batch ${Math.floor(i / input.batchSize) + 1}`);
|
|
60
|
+
|
|
61
|
+
try {
|
|
62
|
+
await this.processBatch(batch);
|
|
63
|
+
synced += batch.length;
|
|
64
|
+
} catch (err) {
|
|
65
|
+
errors += batch.length;
|
|
66
|
+
this.log(`Batch error: ${err}`);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
return { synced, errors };
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
private async processBatch(batch: unknown[]) {
|
|
74
|
+
// process batch
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## What This Demonstrates
|
|
80
|
+
|
|
81
|
+
- Configuring `retry` with `maxAttempts`, `backoffMs`, `backoffMultiplier`, and `maxBackoffMs`
|
|
82
|
+
- Using `this.attempt` to log retry context (1-based attempt counter)
|
|
83
|
+
- Using `this.fail()` to abort execution and trigger the retry flow
|
|
84
|
+
- Combining batch processing with `this.progress()` for granular tracking
|
|
85
|
+
|
|
86
|
+
## Related
|
|
87
|
+
|
|
88
|
+
- See `create-job` for the full retry policy reference and backoff schedule
|