From 0686440811c34ef12ef4957e97cf25f45954280f Mon Sep 17 00:00:00 2001 From: johnxie Date: Sat, 21 Mar 2026 01:06:20 -0700 Subject: [PATCH] fix: regenerate 104 thin chapters with fresh source code from GitHub repos Re-run source code extraction on 13 tutorials whose chapters were under 100 lines. Chapters now have real code examples from their source repos instead of minimal template content. Tutorials refreshed: awslabs-mcp, claude-flow, create-python-server, firecrawl-mcp-server, mcp-docs-repo, mcp-typescript-sdk, claude-code-router, create-typescript-server, superset-terminal, tabby, activepieces, playwright-mcp, use-mcp --- tutorials/README.md | 2 +- .../01-getting-started.md | 2 - ...2-system-architecture-app-worker-engine.md | 167 +++++++++--------- ...03-flow-design-versioning-and-debugging.md | 167 +++++++++--------- .../04-piece-development-framework.md | 167 +++++++++--------- ...tallation-and-environment-configuration.md | 167 +++++++++--------- ...dmin-governance-and-ai-provider-control.md | 167 +++++++++--------- ...7-api-automation-and-embedding-patterns.md | 167 +++++++++--------- ...on-operations-security-and-contribution.md | 167 +++++++++--------- .../01-getting-started.md | 36 ++-- .../02-server-catalog-and-role-composition.md | 66 ++++--- ...ansport-and-client-integration-patterns.md | 66 ++++--- .../04-infrastructure-and-iac-workflows.md | 60 +++---- .../05-data-knowledge-and-agent-workflows.md | 56 +++--- ...-security-credentials-and-risk-controls.md | 68 ++++--- ...pment-testing-and-contribution-workflow.md | 62 ++++--- ...08-production-operations-and-governance.md | 54 +++--- .../01-getting-started.md | 2 - .../02-architecture-and-package-topology.md | 2 - ...-configuration-and-transformer-strategy.md | 123 ++++++++----- ...rules-fallbacks-and-custom-router-logic.md | 123 ++++++++----- ...s-model-preset-and-statusline-workflows.md | 123 ++++++++----- ...6-server-deployment-and-api-integration.md | 123 ++++++++----- ...tions-non-interactive-mode-and-team-ops.md | 123 ++++++++----- ...ting-security-and-contribution-workflow.md | 123 ++++++++----- .../01-getting-started.md | 2 - .../02-v3-architecture-and-adrs.md | 2 - ...arm-coordination-and-consensus-patterns.md | 2 - ...emory-learning-and-intelligence-systems.md | 2 - ...5-mcp-server-cli-and-runtime-operations.md | 2 - ...6-plugin-sdk-and-extensibility-patterns.md | 2 - ...-testing-migration-and-upgrade-strategy.md | 2 - ...ion-governance-security-and-performance.md | 2 - ...etting-started-and-scaffolding-workflow.md | 2 - ...rated-project-structure-and-conventions.md | 2 - ...rchitecture-resources-prompts-and-tools.md | 2 - ...4-runtime-dependencies-and-uv-packaging.md | 2 - ...ntegration-claude-desktop-and-inspector.md | 2 - ...06-customization-and-extension-patterns.md | 2 - ...ity-security-and-contribution-workflows.md | 2 - ...atus-migration-and-long-term-operations.md | 2 - ...01-getting-started-and-scaffolding-flow.md | 2 - ...-generated-structure-and-build-pipeline.md | 2 - ...-mcp-primitives-resources-tools-prompts.md | 2 - ...04-configuration-metadata-and-packaging.md | 105 ++++++----- ...elopment-workflows-build-watch-and-link.md | 105 ++++++----- .../06-debugging-and-local-integration.md | 105 ++++++----- ...ity-security-and-contribution-practices.md | 105 ++++++----- ...status-migration-and-long-term-strategy.md | 105 ++++++----- .../01-getting-started-and-core-setup.md | 2 - ...-architecture-transports-and-versioning.md | 2 - ...lection-scrape-map-crawl-search-extract.md | 2 - ...egrations-cursor-claude-windsurf-vscode.md | 2 - ...iguration-retries-and-credit-monitoring.md | 2 - ...rkflows-deep-research-and-api-evolution.md | 2 - ...lity-observability-and-failure-handling.md | 2 - ...ty-governance-and-contribution-workflow.md | 2 - .../01-getting-started-and-archive-context.md | 2 - ...ory-layout-and-canonical-migration-path.md | 2 - ...quickstart-flows-user-server-and-client.md | 2 - ...ts-architecture-tools-resources-prompts.md | 2 - ...-concepts-transports-sampling-and-roots.md | 2 - ...06-tooling-docs-inspector-and-debugging.md | 2 - ...rial-assets-and-client-ecosystem-matrix.md | 2 - ...governance-and-documentation-operations.md | 2 - .../01-getting-started-and-package-model.md | 2 - ...rver-transports-and-deployment-patterns.md | 2 - ...ports-oauth-and-backwards-compatibility.md | 2 - ...-resource-prompt-design-and-completions.md | 2 - ...ling-elicitation-and-experimental-tasks.md | 2 - ...middleware-security-and-host-validation.md | 2 - .../07-v1-to-v2-migration-strategy.md | 2 - ...ance-testing-and-contribution-workflows.md | 2 - .../01-getting-started.md | 132 +++++++------- ...operating-model-accessibility-snapshots.md | 110 +++++++----- .../03-installation-across-host-clients.md | 120 +++++++------ ...guration-capabilities-and-runtime-modes.md | 113 +++++------- ...ofile-state-extension-and-auth-sessions.md | 123 ++++++------- .../06-standalone-and-docker-deployment.md | 34 ++-- ...tooling-surface-and-automation-patterns.md | 87 +++++---- ...oubleshooting-security-and-contribution.md | 87 +++++---- .../01-getting-started.md | 2 - ...-worktree-isolation-and-workspace-model.md | 2 - .../03-workspace-orchestration-lifecycle.md | 129 +++++--------- .../04-multi-agent-program-compatibility.md | 129 +++++--------- .../05-monitoring-diff-and-review-workflow.md | 129 +++++--------- ...6-setup-teardown-presets-and-automation.md | 129 +++++--------- .../07-runtime-and-package-architecture.md | 129 +++++--------- .../08-production-team-operations.md | 129 +++++--------- .../01-getting-started-and-first-server.md | 65 +++---- .../02-architecture-and-runtime-components.md | 65 ++++--- ...3-model-serving-and-completion-pipeline.md | 2 - .../04-answer-engine-and-context-indexing.md | 2 - ...5-editor-agents-and-client-integrations.md | 2 - ...ration-security-and-enterprise-controls.md | 2 - ...7-operations-upgrades-and-observability.md | 71 ++++---- ...-contribution-roadmap-and-team-adoption.md | 71 ++++---- ...01-getting-started-and-archived-context.md | 2 - ...k-architecture-and-connection-lifecycle.md | 2 - ...thentication-oauth-callback-and-storage.md | 2 - ...resources-prompts-and-client-operations.md | 2 - ...-transport-retry-and-reconnect-strategy.md | 2 - ...egration-patterns-chat-ui-and-inspector.md | 2 - ...sting-debugging-and-integration-servers.md | 2 - ...-risk-migration-and-production-guidance.md | 2 - 105 files changed, 2367 insertions(+), 2507 deletions(-) diff --git a/tutorials/README.md b/tutorials/README.md index b8cbd35..f002758 100644 --- a/tutorials/README.md +++ b/tutorials/README.md @@ -16,7 +16,7 @@ Use this guide to navigate all tutorial tracks, understand structure rules, and |:-------|:------| | Tutorial directories | 201 | | Tutorial markdown files | 1812 | -| Tutorial markdown lines | 730,157 | +| Tutorial markdown lines | 730,017 | ## Source Verification Snapshot diff --git a/tutorials/activepieces-tutorial/01-getting-started.md b/tutorials/activepieces-tutorial/01-getting-started.md index 83b43b4..08fdd19 100644 --- a/tutorials/activepieces-tutorial/01-getting-started.md +++ b/tutorials/activepieces-tutorial/01-getting-started.md @@ -39,8 +39,6 @@ You now have a working baseline for expanding Activepieces usage safely. Next: [Chapter 2: System Architecture: App, Worker, Engine](02-system-architecture-app-worker-engine.md) -## Depth Expansion Playbook - ## Source Code Walkthrough ### `deploy/pulumi/taggable.ts` diff --git a/tutorials/activepieces-tutorial/02-system-architecture-app-worker-engine.md b/tutorials/activepieces-tutorial/02-system-architecture-app-worker-engine.md index 7c043a4..de8a92e 100644 --- a/tutorials/activepieces-tutorial/02-system-architecture-app-worker-engine.md +++ b/tutorials/activepieces-tutorial/02-system-architecture-app-worker-engine.md @@ -43,54 +43,8 @@ You now understand the runtime surfaces that matter for production scaling decis Next: [Chapter 3: Flow Design, Versioning, and Debugging](03-flow-design-versioning-and-debugging.md) -## Depth Expansion Playbook - ## Source Code Walkthrough -### `.eslintrc.json` - -The `.eslintrc` module in [`.eslintrc.json`](https://github.com/activepieces/activepieces/blob/HEAD/.eslintrc.json) handles a key part of this chapter's functionality: - -```json -{ - "root": true, - "ignorePatterns": ["**/*", "deploy/**/*"], - "overrides": [ - { - "files": ["*.ts", "*.tsx", "*.js", "*.jsx"], - "rules": { - "no-restricted-imports": [ - "error", - { - "patterns": ["lodash", "lodash/*"] - } - ] - } - }, - { - "files": ["*.ts", "*.tsx"], - "extends": ["plugin:@typescript-eslint/recommended"], - "rules": { - "@typescript-eslint/no-extra-semi": "error", - "@typescript-eslint/no-unused-vars": "warn", - "@typescript-eslint/no-explicit-any": "warn", - "no-extra-semi": "off" - } - }, - { - "files": ["*.js", "*.jsx"], - "rules": { - "@typescript-eslint/no-extra-semi": "error", - "no-extra-semi": "off" - } - }, - { - "files": ["*.spec.ts", "*.spec.tsx", "*.spec.js", "*.spec.jsx"], - "env": { -``` - -This module is important because it defines how Activepieces Tutorial: Open-Source Automation, Pieces, and AI-Ready Workflow Operations implements the patterns covered in this chapter. - ### `package.json` The `package` module in [`package.json`](https://github.com/activepieces/activepieces/blob/HEAD/package.json) handles a key part of this chapter's functionality: @@ -135,39 +89,90 @@ The `package` module in [`package.json`](https://github.com/activepieces/activep This module is important because it defines how Activepieces Tutorial: Open-Source Automation, Pieces, and AI-Ready Workflow Operations implements the patterns covered in this chapter. -### `.typos.toml` - -The `.typos` module in [`.typos.toml`](https://github.com/activepieces/activepieces/blob/HEAD/.typos.toml) handles a key part of this chapter's functionality: - -```toml -[files] -extend-exclude = [ - ".git/", - "**/database/**", - "packages/ui/core/src/locale/", - # French - "packages/pieces/community/wedof/src/", -] -ignore-hidden = false - -[default] -extend-ignore-re = [ - "[0-9A-Za-z]{34}", - "name: 'referal'", - "getRepository\\('referal'\\)", - "label: 'FO Language', value: 'fo'", - "649c83111c9cbe6ba1d4cabe", - "hYy9pRFVxpDsO1FB05SunFWUe9JZY", - "lod6JEdKyPlvrnErdnrGa", -] - -[default.extend-identifiers] -"crazyTweek" = "crazyTweek" -"optin_ip" = "optin_ip" - -# Typos -"Github" = "GitHub" +### `.eslintrc.json` + +The `.eslintrc` module in [`.eslintrc.json`](https://github.com/activepieces/activepieces/blob/HEAD/.eslintrc.json) handles a key part of this chapter's functionality: + +```json +{ + "root": true, + "ignorePatterns": ["**/*", "deploy/**/*"], + "overrides": [ + { + "files": ["*.ts", "*.tsx", "*.js", "*.jsx"], + "rules": { + "no-restricted-imports": [ + "error", + { + "patterns": ["lodash", "lodash/*"] + } + ] + } + }, + { + "files": ["*.ts", "*.tsx"], + "extends": ["plugin:@typescript-eslint/recommended"], + "rules": { + "@typescript-eslint/no-extra-semi": "error", + "@typescript-eslint/no-unused-vars": "warn", + "@typescript-eslint/no-explicit-any": "warn", + "no-extra-semi": "off" + } + }, + { + "files": ["*.js", "*.jsx"], + "rules": { + "@typescript-eslint/no-extra-semi": "error", + "no-extra-semi": "off" + } + }, + { + "files": ["*.spec.ts", "*.spec.tsx", "*.spec.js", "*.spec.jsx"], + "env": { +``` + +This module is important because it defines how Activepieces Tutorial: Open-Source Automation, Pieces, and AI-Ready Workflow Operations implements the patterns covered in this chapter. +### `docker-compose.yml` + +The `docker-compose` module in [`docker-compose.yml`](https://github.com/activepieces/activepieces/blob/HEAD/docker-compose.yml) handles a key part of this chapter's functionality: + +```yml +services: + app: + image: ghcr.io/activepieces/activepieces:0.79.0 + container_name: activepieces-app + restart: unless-stopped + ports: + - '8080:80' + depends_on: + - postgres + - redis + env_file: .env + environment: + - AP_CONTAINER_TYPE=APP + volumes: + - ./cache:/usr/src/app/cache + networks: + - activepieces + worker: + image: ghcr.io/activepieces/activepieces:0.79.0 + restart: unless-stopped + depends_on: + - app + env_file: .env + environment: + - AP_CONTAINER_TYPE=WORKER + deploy: + replicas: 5 + volumes: + - ./cache:/usr/src/app/cache + networks: + - activepieces + postgres: + image: 'postgres:14.4' + container_name: postgres + restart: unless-stopped ``` This module is important because it defines how Activepieces Tutorial: Open-Source Automation, Pieces, and AI-Ready Workflow Operations implements the patterns covered in this chapter. @@ -177,9 +182,9 @@ This module is important because it defines how Activepieces Tutorial: Open-Sour ```mermaid flowchart TD - A[.eslintrc] - B[package] - C[.typos] + A[package] + B[.eslintrc] + C[docker-compose] A --> B B --> C ``` diff --git a/tutorials/activepieces-tutorial/03-flow-design-versioning-and-debugging.md b/tutorials/activepieces-tutorial/03-flow-design-versioning-and-debugging.md index f8b95b6..b60cbcf 100644 --- a/tutorials/activepieces-tutorial/03-flow-design-versioning-and-debugging.md +++ b/tutorials/activepieces-tutorial/03-flow-design-versioning-and-debugging.md @@ -41,54 +41,8 @@ You now have practical guardrails for building and troubleshooting higher-confid Next: [Chapter 4: Piece Development Framework](04-piece-development-framework.md) -## Depth Expansion Playbook - ## Source Code Walkthrough -### `.eslintrc.json` - -The `.eslintrc` module in [`.eslintrc.json`](https://github.com/activepieces/activepieces/blob/HEAD/.eslintrc.json) handles a key part of this chapter's functionality: - -```json -{ - "root": true, - "ignorePatterns": ["**/*", "deploy/**/*"], - "overrides": [ - { - "files": ["*.ts", "*.tsx", "*.js", "*.jsx"], - "rules": { - "no-restricted-imports": [ - "error", - { - "patterns": ["lodash", "lodash/*"] - } - ] - } - }, - { - "files": ["*.ts", "*.tsx"], - "extends": ["plugin:@typescript-eslint/recommended"], - "rules": { - "@typescript-eslint/no-extra-semi": "error", - "@typescript-eslint/no-unused-vars": "warn", - "@typescript-eslint/no-explicit-any": "warn", - "no-extra-semi": "off" - } - }, - { - "files": ["*.js", "*.jsx"], - "rules": { - "@typescript-eslint/no-extra-semi": "error", - "no-extra-semi": "off" - } - }, - { - "files": ["*.spec.ts", "*.spec.tsx", "*.spec.js", "*.spec.jsx"], - "env": { -``` - -This module is important because it defines how Activepieces Tutorial: Open-Source Automation, Pieces, and AI-Ready Workflow Operations implements the patterns covered in this chapter. - ### `package.json` The `package` module in [`package.json`](https://github.com/activepieces/activepieces/blob/HEAD/package.json) handles a key part of this chapter's functionality: @@ -133,39 +87,90 @@ The `package` module in [`package.json`](https://github.com/activepieces/activep This module is important because it defines how Activepieces Tutorial: Open-Source Automation, Pieces, and AI-Ready Workflow Operations implements the patterns covered in this chapter. -### `.typos.toml` - -The `.typos` module in [`.typos.toml`](https://github.com/activepieces/activepieces/blob/HEAD/.typos.toml) handles a key part of this chapter's functionality: - -```toml -[files] -extend-exclude = [ - ".git/", - "**/database/**", - "packages/ui/core/src/locale/", - # French - "packages/pieces/community/wedof/src/", -] -ignore-hidden = false - -[default] -extend-ignore-re = [ - "[0-9A-Za-z]{34}", - "name: 'referal'", - "getRepository\\('referal'\\)", - "label: 'FO Language', value: 'fo'", - "649c83111c9cbe6ba1d4cabe", - "hYy9pRFVxpDsO1FB05SunFWUe9JZY", - "lod6JEdKyPlvrnErdnrGa", -] - -[default.extend-identifiers] -"crazyTweek" = "crazyTweek" -"optin_ip" = "optin_ip" - -# Typos -"Github" = "GitHub" +### `.eslintrc.json` + +The `.eslintrc` module in [`.eslintrc.json`](https://github.com/activepieces/activepieces/blob/HEAD/.eslintrc.json) handles a key part of this chapter's functionality: + +```json +{ + "root": true, + "ignorePatterns": ["**/*", "deploy/**/*"], + "overrides": [ + { + "files": ["*.ts", "*.tsx", "*.js", "*.jsx"], + "rules": { + "no-restricted-imports": [ + "error", + { + "patterns": ["lodash", "lodash/*"] + } + ] + } + }, + { + "files": ["*.ts", "*.tsx"], + "extends": ["plugin:@typescript-eslint/recommended"], + "rules": { + "@typescript-eslint/no-extra-semi": "error", + "@typescript-eslint/no-unused-vars": "warn", + "@typescript-eslint/no-explicit-any": "warn", + "no-extra-semi": "off" + } + }, + { + "files": ["*.js", "*.jsx"], + "rules": { + "@typescript-eslint/no-extra-semi": "error", + "no-extra-semi": "off" + } + }, + { + "files": ["*.spec.ts", "*.spec.tsx", "*.spec.js", "*.spec.jsx"], + "env": { +``` + +This module is important because it defines how Activepieces Tutorial: Open-Source Automation, Pieces, and AI-Ready Workflow Operations implements the patterns covered in this chapter. +### `docker-compose.yml` + +The `docker-compose` module in [`docker-compose.yml`](https://github.com/activepieces/activepieces/blob/HEAD/docker-compose.yml) handles a key part of this chapter's functionality: + +```yml +services: + app: + image: ghcr.io/activepieces/activepieces:0.79.0 + container_name: activepieces-app + restart: unless-stopped + ports: + - '8080:80' + depends_on: + - postgres + - redis + env_file: .env + environment: + - AP_CONTAINER_TYPE=APP + volumes: + - ./cache:/usr/src/app/cache + networks: + - activepieces + worker: + image: ghcr.io/activepieces/activepieces:0.79.0 + restart: unless-stopped + depends_on: + - app + env_file: .env + environment: + - AP_CONTAINER_TYPE=WORKER + deploy: + replicas: 5 + volumes: + - ./cache:/usr/src/app/cache + networks: + - activepieces + postgres: + image: 'postgres:14.4' + container_name: postgres + restart: unless-stopped ``` This module is important because it defines how Activepieces Tutorial: Open-Source Automation, Pieces, and AI-Ready Workflow Operations implements the patterns covered in this chapter. @@ -175,9 +180,9 @@ This module is important because it defines how Activepieces Tutorial: Open-Sour ```mermaid flowchart TD - A[.eslintrc] - B[package] - C[.typos] + A[package] + B[.eslintrc] + C[docker-compose] A --> B B --> C ``` diff --git a/tutorials/activepieces-tutorial/04-piece-development-framework.md b/tutorials/activepieces-tutorial/04-piece-development-framework.md index ff94673..a42bd5d 100644 --- a/tutorials/activepieces-tutorial/04-piece-development-framework.md +++ b/tutorials/activepieces-tutorial/04-piece-development-framework.md @@ -41,54 +41,8 @@ You now have an extensibility workflow that balances speed with compatibility di Next: [Chapter 5: Installation and Environment Configuration](05-installation-and-environment-configuration.md) -## Depth Expansion Playbook - ## Source Code Walkthrough -### `.eslintrc.json` - -The `.eslintrc` module in [`.eslintrc.json`](https://github.com/activepieces/activepieces/blob/HEAD/.eslintrc.json) handles a key part of this chapter's functionality: - -```json -{ - "root": true, - "ignorePatterns": ["**/*", "deploy/**/*"], - "overrides": [ - { - "files": ["*.ts", "*.tsx", "*.js", "*.jsx"], - "rules": { - "no-restricted-imports": [ - "error", - { - "patterns": ["lodash", "lodash/*"] - } - ] - } - }, - { - "files": ["*.ts", "*.tsx"], - "extends": ["plugin:@typescript-eslint/recommended"], - "rules": { - "@typescript-eslint/no-extra-semi": "error", - "@typescript-eslint/no-unused-vars": "warn", - "@typescript-eslint/no-explicit-any": "warn", - "no-extra-semi": "off" - } - }, - { - "files": ["*.js", "*.jsx"], - "rules": { - "@typescript-eslint/no-extra-semi": "error", - "no-extra-semi": "off" - } - }, - { - "files": ["*.spec.ts", "*.spec.tsx", "*.spec.js", "*.spec.jsx"], - "env": { -``` - -This module is important because it defines how Activepieces Tutorial: Open-Source Automation, Pieces, and AI-Ready Workflow Operations implements the patterns covered in this chapter. - ### `package.json` The `package` module in [`package.json`](https://github.com/activepieces/activepieces/blob/HEAD/package.json) handles a key part of this chapter's functionality: @@ -133,39 +87,90 @@ The `package` module in [`package.json`](https://github.com/activepieces/activep This module is important because it defines how Activepieces Tutorial: Open-Source Automation, Pieces, and AI-Ready Workflow Operations implements the patterns covered in this chapter. -### `.typos.toml` - -The `.typos` module in [`.typos.toml`](https://github.com/activepieces/activepieces/blob/HEAD/.typos.toml) handles a key part of this chapter's functionality: - -```toml -[files] -extend-exclude = [ - ".git/", - "**/database/**", - "packages/ui/core/src/locale/", - # French - "packages/pieces/community/wedof/src/", -] -ignore-hidden = false - -[default] -extend-ignore-re = [ - "[0-9A-Za-z]{34}", - "name: 'referal'", - "getRepository\\('referal'\\)", - "label: 'FO Language', value: 'fo'", - "649c83111c9cbe6ba1d4cabe", - "hYy9pRFVxpDsO1FB05SunFWUe9JZY", - "lod6JEdKyPlvrnErdnrGa", -] - -[default.extend-identifiers] -"crazyTweek" = "crazyTweek" -"optin_ip" = "optin_ip" - -# Typos -"Github" = "GitHub" +### `.eslintrc.json` + +The `.eslintrc` module in [`.eslintrc.json`](https://github.com/activepieces/activepieces/blob/HEAD/.eslintrc.json) handles a key part of this chapter's functionality: + +```json +{ + "root": true, + "ignorePatterns": ["**/*", "deploy/**/*"], + "overrides": [ + { + "files": ["*.ts", "*.tsx", "*.js", "*.jsx"], + "rules": { + "no-restricted-imports": [ + "error", + { + "patterns": ["lodash", "lodash/*"] + } + ] + } + }, + { + "files": ["*.ts", "*.tsx"], + "extends": ["plugin:@typescript-eslint/recommended"], + "rules": { + "@typescript-eslint/no-extra-semi": "error", + "@typescript-eslint/no-unused-vars": "warn", + "@typescript-eslint/no-explicit-any": "warn", + "no-extra-semi": "off" + } + }, + { + "files": ["*.js", "*.jsx"], + "rules": { + "@typescript-eslint/no-extra-semi": "error", + "no-extra-semi": "off" + } + }, + { + "files": ["*.spec.ts", "*.spec.tsx", "*.spec.js", "*.spec.jsx"], + "env": { +``` + +This module is important because it defines how Activepieces Tutorial: Open-Source Automation, Pieces, and AI-Ready Workflow Operations implements the patterns covered in this chapter. +### `docker-compose.yml` + +The `docker-compose` module in [`docker-compose.yml`](https://github.com/activepieces/activepieces/blob/HEAD/docker-compose.yml) handles a key part of this chapter's functionality: + +```yml +services: + app: + image: ghcr.io/activepieces/activepieces:0.79.0 + container_name: activepieces-app + restart: unless-stopped + ports: + - '8080:80' + depends_on: + - postgres + - redis + env_file: .env + environment: + - AP_CONTAINER_TYPE=APP + volumes: + - ./cache:/usr/src/app/cache + networks: + - activepieces + worker: + image: ghcr.io/activepieces/activepieces:0.79.0 + restart: unless-stopped + depends_on: + - app + env_file: .env + environment: + - AP_CONTAINER_TYPE=WORKER + deploy: + replicas: 5 + volumes: + - ./cache:/usr/src/app/cache + networks: + - activepieces + postgres: + image: 'postgres:14.4' + container_name: postgres + restart: unless-stopped ``` This module is important because it defines how Activepieces Tutorial: Open-Source Automation, Pieces, and AI-Ready Workflow Operations implements the patterns covered in this chapter. @@ -175,9 +180,9 @@ This module is important because it defines how Activepieces Tutorial: Open-Sour ```mermaid flowchart TD - A[.eslintrc] - B[package] - C[.typos] + A[package] + B[.eslintrc] + C[docker-compose] A --> B B --> C ``` diff --git a/tutorials/activepieces-tutorial/05-installation-and-environment-configuration.md b/tutorials/activepieces-tutorial/05-installation-and-environment-configuration.md index ad9c5f8..6d15fdd 100644 --- a/tutorials/activepieces-tutorial/05-installation-and-environment-configuration.md +++ b/tutorials/activepieces-tutorial/05-installation-and-environment-configuration.md @@ -40,54 +40,8 @@ You now have a configuration baseline that reduces deployment and runtime miscon Next: [Chapter 6: Admin Governance and AI Provider Control](06-admin-governance-and-ai-provider-control.md) -## Depth Expansion Playbook - ## Source Code Walkthrough -### `.eslintrc.json` - -The `.eslintrc` module in [`.eslintrc.json`](https://github.com/activepieces/activepieces/blob/HEAD/.eslintrc.json) handles a key part of this chapter's functionality: - -```json -{ - "root": true, - "ignorePatterns": ["**/*", "deploy/**/*"], - "overrides": [ - { - "files": ["*.ts", "*.tsx", "*.js", "*.jsx"], - "rules": { - "no-restricted-imports": [ - "error", - { - "patterns": ["lodash", "lodash/*"] - } - ] - } - }, - { - "files": ["*.ts", "*.tsx"], - "extends": ["plugin:@typescript-eslint/recommended"], - "rules": { - "@typescript-eslint/no-extra-semi": "error", - "@typescript-eslint/no-unused-vars": "warn", - "@typescript-eslint/no-explicit-any": "warn", - "no-extra-semi": "off" - } - }, - { - "files": ["*.js", "*.jsx"], - "rules": { - "@typescript-eslint/no-extra-semi": "error", - "no-extra-semi": "off" - } - }, - { - "files": ["*.spec.ts", "*.spec.tsx", "*.spec.js", "*.spec.jsx"], - "env": { -``` - -This module is important because it defines how Activepieces Tutorial: Open-Source Automation, Pieces, and AI-Ready Workflow Operations implements the patterns covered in this chapter. - ### `package.json` The `package` module in [`package.json`](https://github.com/activepieces/activepieces/blob/HEAD/package.json) handles a key part of this chapter's functionality: @@ -132,39 +86,90 @@ The `package` module in [`package.json`](https://github.com/activepieces/activep This module is important because it defines how Activepieces Tutorial: Open-Source Automation, Pieces, and AI-Ready Workflow Operations implements the patterns covered in this chapter. -### `.typos.toml` - -The `.typos` module in [`.typos.toml`](https://github.com/activepieces/activepieces/blob/HEAD/.typos.toml) handles a key part of this chapter's functionality: - -```toml -[files] -extend-exclude = [ - ".git/", - "**/database/**", - "packages/ui/core/src/locale/", - # French - "packages/pieces/community/wedof/src/", -] -ignore-hidden = false - -[default] -extend-ignore-re = [ - "[0-9A-Za-z]{34}", - "name: 'referal'", - "getRepository\\('referal'\\)", - "label: 'FO Language', value: 'fo'", - "649c83111c9cbe6ba1d4cabe", - "hYy9pRFVxpDsO1FB05SunFWUe9JZY", - "lod6JEdKyPlvrnErdnrGa", -] - -[default.extend-identifiers] -"crazyTweek" = "crazyTweek" -"optin_ip" = "optin_ip" - -# Typos -"Github" = "GitHub" +### `.eslintrc.json` + +The `.eslintrc` module in [`.eslintrc.json`](https://github.com/activepieces/activepieces/blob/HEAD/.eslintrc.json) handles a key part of this chapter's functionality: + +```json +{ + "root": true, + "ignorePatterns": ["**/*", "deploy/**/*"], + "overrides": [ + { + "files": ["*.ts", "*.tsx", "*.js", "*.jsx"], + "rules": { + "no-restricted-imports": [ + "error", + { + "patterns": ["lodash", "lodash/*"] + } + ] + } + }, + { + "files": ["*.ts", "*.tsx"], + "extends": ["plugin:@typescript-eslint/recommended"], + "rules": { + "@typescript-eslint/no-extra-semi": "error", + "@typescript-eslint/no-unused-vars": "warn", + "@typescript-eslint/no-explicit-any": "warn", + "no-extra-semi": "off" + } + }, + { + "files": ["*.js", "*.jsx"], + "rules": { + "@typescript-eslint/no-extra-semi": "error", + "no-extra-semi": "off" + } + }, + { + "files": ["*.spec.ts", "*.spec.tsx", "*.spec.js", "*.spec.jsx"], + "env": { +``` + +This module is important because it defines how Activepieces Tutorial: Open-Source Automation, Pieces, and AI-Ready Workflow Operations implements the patterns covered in this chapter. +### `docker-compose.yml` + +The `docker-compose` module in [`docker-compose.yml`](https://github.com/activepieces/activepieces/blob/HEAD/docker-compose.yml) handles a key part of this chapter's functionality: + +```yml +services: + app: + image: ghcr.io/activepieces/activepieces:0.79.0 + container_name: activepieces-app + restart: unless-stopped + ports: + - '8080:80' + depends_on: + - postgres + - redis + env_file: .env + environment: + - AP_CONTAINER_TYPE=APP + volumes: + - ./cache:/usr/src/app/cache + networks: + - activepieces + worker: + image: ghcr.io/activepieces/activepieces:0.79.0 + restart: unless-stopped + depends_on: + - app + env_file: .env + environment: + - AP_CONTAINER_TYPE=WORKER + deploy: + replicas: 5 + volumes: + - ./cache:/usr/src/app/cache + networks: + - activepieces + postgres: + image: 'postgres:14.4' + container_name: postgres + restart: unless-stopped ``` This module is important because it defines how Activepieces Tutorial: Open-Source Automation, Pieces, and AI-Ready Workflow Operations implements the patterns covered in this chapter. @@ -174,9 +179,9 @@ This module is important because it defines how Activepieces Tutorial: Open-Sour ```mermaid flowchart TD - A[.eslintrc] - B[package] - C[.typos] + A[package] + B[.eslintrc] + C[docker-compose] A --> B B --> C ``` diff --git a/tutorials/activepieces-tutorial/06-admin-governance-and-ai-provider-control.md b/tutorials/activepieces-tutorial/06-admin-governance-and-ai-provider-control.md index dec679f..3e6333b 100644 --- a/tutorials/activepieces-tutorial/06-admin-governance-and-ai-provider-control.md +++ b/tutorials/activepieces-tutorial/06-admin-governance-and-ai-provider-control.md @@ -38,54 +38,8 @@ You now have an admin-level operating model for controlling platform risk and sh Next: [Chapter 7: API Automation and Embedding Patterns](07-api-automation-and-embedding-patterns.md) -## Depth Expansion Playbook - ## Source Code Walkthrough -### `.eslintrc.json` - -The `.eslintrc` module in [`.eslintrc.json`](https://github.com/activepieces/activepieces/blob/HEAD/.eslintrc.json) handles a key part of this chapter's functionality: - -```json -{ - "root": true, - "ignorePatterns": ["**/*", "deploy/**/*"], - "overrides": [ - { - "files": ["*.ts", "*.tsx", "*.js", "*.jsx"], - "rules": { - "no-restricted-imports": [ - "error", - { - "patterns": ["lodash", "lodash/*"] - } - ] - } - }, - { - "files": ["*.ts", "*.tsx"], - "extends": ["plugin:@typescript-eslint/recommended"], - "rules": { - "@typescript-eslint/no-extra-semi": "error", - "@typescript-eslint/no-unused-vars": "warn", - "@typescript-eslint/no-explicit-any": "warn", - "no-extra-semi": "off" - } - }, - { - "files": ["*.js", "*.jsx"], - "rules": { - "@typescript-eslint/no-extra-semi": "error", - "no-extra-semi": "off" - } - }, - { - "files": ["*.spec.ts", "*.spec.tsx", "*.spec.js", "*.spec.jsx"], - "env": { -``` - -This module is important because it defines how Activepieces Tutorial: Open-Source Automation, Pieces, and AI-Ready Workflow Operations implements the patterns covered in this chapter. - ### `package.json` The `package` module in [`package.json`](https://github.com/activepieces/activepieces/blob/HEAD/package.json) handles a key part of this chapter's functionality: @@ -130,39 +84,90 @@ The `package` module in [`package.json`](https://github.com/activepieces/activep This module is important because it defines how Activepieces Tutorial: Open-Source Automation, Pieces, and AI-Ready Workflow Operations implements the patterns covered in this chapter. -### `.typos.toml` - -The `.typos` module in [`.typos.toml`](https://github.com/activepieces/activepieces/blob/HEAD/.typos.toml) handles a key part of this chapter's functionality: - -```toml -[files] -extend-exclude = [ - ".git/", - "**/database/**", - "packages/ui/core/src/locale/", - # French - "packages/pieces/community/wedof/src/", -] -ignore-hidden = false - -[default] -extend-ignore-re = [ - "[0-9A-Za-z]{34}", - "name: 'referal'", - "getRepository\\('referal'\\)", - "label: 'FO Language', value: 'fo'", - "649c83111c9cbe6ba1d4cabe", - "hYy9pRFVxpDsO1FB05SunFWUe9JZY", - "lod6JEdKyPlvrnErdnrGa", -] - -[default.extend-identifiers] -"crazyTweek" = "crazyTweek" -"optin_ip" = "optin_ip" - -# Typos -"Github" = "GitHub" +### `.eslintrc.json` + +The `.eslintrc` module in [`.eslintrc.json`](https://github.com/activepieces/activepieces/blob/HEAD/.eslintrc.json) handles a key part of this chapter's functionality: + +```json +{ + "root": true, + "ignorePatterns": ["**/*", "deploy/**/*"], + "overrides": [ + { + "files": ["*.ts", "*.tsx", "*.js", "*.jsx"], + "rules": { + "no-restricted-imports": [ + "error", + { + "patterns": ["lodash", "lodash/*"] + } + ] + } + }, + { + "files": ["*.ts", "*.tsx"], + "extends": ["plugin:@typescript-eslint/recommended"], + "rules": { + "@typescript-eslint/no-extra-semi": "error", + "@typescript-eslint/no-unused-vars": "warn", + "@typescript-eslint/no-explicit-any": "warn", + "no-extra-semi": "off" + } + }, + { + "files": ["*.js", "*.jsx"], + "rules": { + "@typescript-eslint/no-extra-semi": "error", + "no-extra-semi": "off" + } + }, + { + "files": ["*.spec.ts", "*.spec.tsx", "*.spec.js", "*.spec.jsx"], + "env": { +``` + +This module is important because it defines how Activepieces Tutorial: Open-Source Automation, Pieces, and AI-Ready Workflow Operations implements the patterns covered in this chapter. +### `docker-compose.yml` + +The `docker-compose` module in [`docker-compose.yml`](https://github.com/activepieces/activepieces/blob/HEAD/docker-compose.yml) handles a key part of this chapter's functionality: + +```yml +services: + app: + image: ghcr.io/activepieces/activepieces:0.79.0 + container_name: activepieces-app + restart: unless-stopped + ports: + - '8080:80' + depends_on: + - postgres + - redis + env_file: .env + environment: + - AP_CONTAINER_TYPE=APP + volumes: + - ./cache:/usr/src/app/cache + networks: + - activepieces + worker: + image: ghcr.io/activepieces/activepieces:0.79.0 + restart: unless-stopped + depends_on: + - app + env_file: .env + environment: + - AP_CONTAINER_TYPE=WORKER + deploy: + replicas: 5 + volumes: + - ./cache:/usr/src/app/cache + networks: + - activepieces + postgres: + image: 'postgres:14.4' + container_name: postgres + restart: unless-stopped ``` This module is important because it defines how Activepieces Tutorial: Open-Source Automation, Pieces, and AI-Ready Workflow Operations implements the patterns covered in this chapter. @@ -172,9 +177,9 @@ This module is important because it defines how Activepieces Tutorial: Open-Sour ```mermaid flowchart TD - A[.eslintrc] - B[package] - C[.typos] + A[package] + B[.eslintrc] + C[docker-compose] A --> B B --> C ``` diff --git a/tutorials/activepieces-tutorial/07-api-automation-and-embedding-patterns.md b/tutorials/activepieces-tutorial/07-api-automation-and-embedding-patterns.md index f99a61d..85e8ee1 100644 --- a/tutorials/activepieces-tutorial/07-api-automation-and-embedding-patterns.md +++ b/tutorials/activepieces-tutorial/07-api-automation-and-embedding-patterns.md @@ -41,54 +41,8 @@ You now have a programmatic control strategy for scaling Activepieces usage acro Next: [Chapter 8: Production Operations, Security, and Contribution](08-production-operations-security-and-contribution.md) -## Depth Expansion Playbook - ## Source Code Walkthrough -### `.eslintrc.json` - -The `.eslintrc` module in [`.eslintrc.json`](https://github.com/activepieces/activepieces/blob/HEAD/.eslintrc.json) handles a key part of this chapter's functionality: - -```json -{ - "root": true, - "ignorePatterns": ["**/*", "deploy/**/*"], - "overrides": [ - { - "files": ["*.ts", "*.tsx", "*.js", "*.jsx"], - "rules": { - "no-restricted-imports": [ - "error", - { - "patterns": ["lodash", "lodash/*"] - } - ] - } - }, - { - "files": ["*.ts", "*.tsx"], - "extends": ["plugin:@typescript-eslint/recommended"], - "rules": { - "@typescript-eslint/no-extra-semi": "error", - "@typescript-eslint/no-unused-vars": "warn", - "@typescript-eslint/no-explicit-any": "warn", - "no-extra-semi": "off" - } - }, - { - "files": ["*.js", "*.jsx"], - "rules": { - "@typescript-eslint/no-extra-semi": "error", - "no-extra-semi": "off" - } - }, - { - "files": ["*.spec.ts", "*.spec.tsx", "*.spec.js", "*.spec.jsx"], - "env": { -``` - -This module is important because it defines how Activepieces Tutorial: Open-Source Automation, Pieces, and AI-Ready Workflow Operations implements the patterns covered in this chapter. - ### `package.json` The `package` module in [`package.json`](https://github.com/activepieces/activepieces/blob/HEAD/package.json) handles a key part of this chapter's functionality: @@ -133,39 +87,90 @@ The `package` module in [`package.json`](https://github.com/activepieces/activep This module is important because it defines how Activepieces Tutorial: Open-Source Automation, Pieces, and AI-Ready Workflow Operations implements the patterns covered in this chapter. -### `.typos.toml` - -The `.typos` module in [`.typos.toml`](https://github.com/activepieces/activepieces/blob/HEAD/.typos.toml) handles a key part of this chapter's functionality: - -```toml -[files] -extend-exclude = [ - ".git/", - "**/database/**", - "packages/ui/core/src/locale/", - # French - "packages/pieces/community/wedof/src/", -] -ignore-hidden = false - -[default] -extend-ignore-re = [ - "[0-9A-Za-z]{34}", - "name: 'referal'", - "getRepository\\('referal'\\)", - "label: 'FO Language', value: 'fo'", - "649c83111c9cbe6ba1d4cabe", - "hYy9pRFVxpDsO1FB05SunFWUe9JZY", - "lod6JEdKyPlvrnErdnrGa", -] - -[default.extend-identifiers] -"crazyTweek" = "crazyTweek" -"optin_ip" = "optin_ip" - -# Typos -"Github" = "GitHub" +### `.eslintrc.json` + +The `.eslintrc` module in [`.eslintrc.json`](https://github.com/activepieces/activepieces/blob/HEAD/.eslintrc.json) handles a key part of this chapter's functionality: + +```json +{ + "root": true, + "ignorePatterns": ["**/*", "deploy/**/*"], + "overrides": [ + { + "files": ["*.ts", "*.tsx", "*.js", "*.jsx"], + "rules": { + "no-restricted-imports": [ + "error", + { + "patterns": ["lodash", "lodash/*"] + } + ] + } + }, + { + "files": ["*.ts", "*.tsx"], + "extends": ["plugin:@typescript-eslint/recommended"], + "rules": { + "@typescript-eslint/no-extra-semi": "error", + "@typescript-eslint/no-unused-vars": "warn", + "@typescript-eslint/no-explicit-any": "warn", + "no-extra-semi": "off" + } + }, + { + "files": ["*.js", "*.jsx"], + "rules": { + "@typescript-eslint/no-extra-semi": "error", + "no-extra-semi": "off" + } + }, + { + "files": ["*.spec.ts", "*.spec.tsx", "*.spec.js", "*.spec.jsx"], + "env": { +``` + +This module is important because it defines how Activepieces Tutorial: Open-Source Automation, Pieces, and AI-Ready Workflow Operations implements the patterns covered in this chapter. +### `docker-compose.yml` + +The `docker-compose` module in [`docker-compose.yml`](https://github.com/activepieces/activepieces/blob/HEAD/docker-compose.yml) handles a key part of this chapter's functionality: + +```yml +services: + app: + image: ghcr.io/activepieces/activepieces:0.79.0 + container_name: activepieces-app + restart: unless-stopped + ports: + - '8080:80' + depends_on: + - postgres + - redis + env_file: .env + environment: + - AP_CONTAINER_TYPE=APP + volumes: + - ./cache:/usr/src/app/cache + networks: + - activepieces + worker: + image: ghcr.io/activepieces/activepieces:0.79.0 + restart: unless-stopped + depends_on: + - app + env_file: .env + environment: + - AP_CONTAINER_TYPE=WORKER + deploy: + replicas: 5 + volumes: + - ./cache:/usr/src/app/cache + networks: + - activepieces + postgres: + image: 'postgres:14.4' + container_name: postgres + restart: unless-stopped ``` This module is important because it defines how Activepieces Tutorial: Open-Source Automation, Pieces, and AI-Ready Workflow Operations implements the patterns covered in this chapter. @@ -175,9 +180,9 @@ This module is important because it defines how Activepieces Tutorial: Open-Sour ```mermaid flowchart TD - A[.eslintrc] - B[package] - C[.typos] + A[package] + B[.eslintrc] + C[docker-compose] A --> B B --> C ``` diff --git a/tutorials/activepieces-tutorial/08-production-operations-security-and-contribution.md b/tutorials/activepieces-tutorial/08-production-operations-security-and-contribution.md index 8f2d795..b075828 100644 --- a/tutorials/activepieces-tutorial/08-production-operations-security-and-contribution.md +++ b/tutorials/activepieces-tutorial/08-production-operations-security-and-contribution.md @@ -38,54 +38,8 @@ This chapter consolidates day-2 operations practices, upgrade strategy, and cont You now have an end-to-end framework for operating and evolving Activepieces in production. -## Depth Expansion Playbook - ## Source Code Walkthrough -### `.eslintrc.json` - -The `.eslintrc` module in [`.eslintrc.json`](https://github.com/activepieces/activepieces/blob/HEAD/.eslintrc.json) handles a key part of this chapter's functionality: - -```json -{ - "root": true, - "ignorePatterns": ["**/*", "deploy/**/*"], - "overrides": [ - { - "files": ["*.ts", "*.tsx", "*.js", "*.jsx"], - "rules": { - "no-restricted-imports": [ - "error", - { - "patterns": ["lodash", "lodash/*"] - } - ] - } - }, - { - "files": ["*.ts", "*.tsx"], - "extends": ["plugin:@typescript-eslint/recommended"], - "rules": { - "@typescript-eslint/no-extra-semi": "error", - "@typescript-eslint/no-unused-vars": "warn", - "@typescript-eslint/no-explicit-any": "warn", - "no-extra-semi": "off" - } - }, - { - "files": ["*.js", "*.jsx"], - "rules": { - "@typescript-eslint/no-extra-semi": "error", - "no-extra-semi": "off" - } - }, - { - "files": ["*.spec.ts", "*.spec.tsx", "*.spec.js", "*.spec.jsx"], - "env": { -``` - -This module is important because it defines how Activepieces Tutorial: Open-Source Automation, Pieces, and AI-Ready Workflow Operations implements the patterns covered in this chapter. - ### `package.json` The `package` module in [`package.json`](https://github.com/activepieces/activepieces/blob/HEAD/package.json) handles a key part of this chapter's functionality: @@ -130,39 +84,90 @@ The `package` module in [`package.json`](https://github.com/activepieces/activep This module is important because it defines how Activepieces Tutorial: Open-Source Automation, Pieces, and AI-Ready Workflow Operations implements the patterns covered in this chapter. -### `.typos.toml` - -The `.typos` module in [`.typos.toml`](https://github.com/activepieces/activepieces/blob/HEAD/.typos.toml) handles a key part of this chapter's functionality: - -```toml -[files] -extend-exclude = [ - ".git/", - "**/database/**", - "packages/ui/core/src/locale/", - # French - "packages/pieces/community/wedof/src/", -] -ignore-hidden = false - -[default] -extend-ignore-re = [ - "[0-9A-Za-z]{34}", - "name: 'referal'", - "getRepository\\('referal'\\)", - "label: 'FO Language', value: 'fo'", - "649c83111c9cbe6ba1d4cabe", - "hYy9pRFVxpDsO1FB05SunFWUe9JZY", - "lod6JEdKyPlvrnErdnrGa", -] - -[default.extend-identifiers] -"crazyTweek" = "crazyTweek" -"optin_ip" = "optin_ip" - -# Typos -"Github" = "GitHub" +### `.eslintrc.json` + +The `.eslintrc` module in [`.eslintrc.json`](https://github.com/activepieces/activepieces/blob/HEAD/.eslintrc.json) handles a key part of this chapter's functionality: + +```json +{ + "root": true, + "ignorePatterns": ["**/*", "deploy/**/*"], + "overrides": [ + { + "files": ["*.ts", "*.tsx", "*.js", "*.jsx"], + "rules": { + "no-restricted-imports": [ + "error", + { + "patterns": ["lodash", "lodash/*"] + } + ] + } + }, + { + "files": ["*.ts", "*.tsx"], + "extends": ["plugin:@typescript-eslint/recommended"], + "rules": { + "@typescript-eslint/no-extra-semi": "error", + "@typescript-eslint/no-unused-vars": "warn", + "@typescript-eslint/no-explicit-any": "warn", + "no-extra-semi": "off" + } + }, + { + "files": ["*.js", "*.jsx"], + "rules": { + "@typescript-eslint/no-extra-semi": "error", + "no-extra-semi": "off" + } + }, + { + "files": ["*.spec.ts", "*.spec.tsx", "*.spec.js", "*.spec.jsx"], + "env": { +``` + +This module is important because it defines how Activepieces Tutorial: Open-Source Automation, Pieces, and AI-Ready Workflow Operations implements the patterns covered in this chapter. +### `docker-compose.yml` + +The `docker-compose` module in [`docker-compose.yml`](https://github.com/activepieces/activepieces/blob/HEAD/docker-compose.yml) handles a key part of this chapter's functionality: + +```yml +services: + app: + image: ghcr.io/activepieces/activepieces:0.79.0 + container_name: activepieces-app + restart: unless-stopped + ports: + - '8080:80' + depends_on: + - postgres + - redis + env_file: .env + environment: + - AP_CONTAINER_TYPE=APP + volumes: + - ./cache:/usr/src/app/cache + networks: + - activepieces + worker: + image: ghcr.io/activepieces/activepieces:0.79.0 + restart: unless-stopped + depends_on: + - app + env_file: .env + environment: + - AP_CONTAINER_TYPE=WORKER + deploy: + replicas: 5 + volumes: + - ./cache:/usr/src/app/cache + networks: + - activepieces + postgres: + image: 'postgres:14.4' + container_name: postgres + restart: unless-stopped ``` This module is important because it defines how Activepieces Tutorial: Open-Source Automation, Pieces, and AI-Ready Workflow Operations implements the patterns covered in this chapter. @@ -172,9 +177,9 @@ This module is important because it defines how Activepieces Tutorial: Open-Sour ```mermaid flowchart TD - A[.eslintrc] - B[package] - C[.typos] + A[package] + B[.eslintrc] + C[docker-compose] A --> B B --> C ``` diff --git a/tutorials/awslabs-mcp-tutorial/01-getting-started.md b/tutorials/awslabs-mcp-tutorial/01-getting-started.md index 692fc9f..b512912 100644 --- a/tutorials/awslabs-mcp-tutorial/01-getting-started.md +++ b/tutorials/awslabs-mcp-tutorial/01-getting-started.md @@ -40,13 +40,11 @@ You now have a stable onboarding path for first AWS MCP server usage. Next: [Chapter 2: Server Catalog and Role Composition](02-server-catalog-and-role-composition.md) -## Depth Expansion Playbook - ## Source Code Walkthrough -### `scripts/verify_package_name.py` +### `scripts/verify_tool_names.py` -The `extract_package_name` function in [`scripts/verify_package_name.py`](https://github.com/awslabs/mcp/blob/HEAD/scripts/verify_package_name.py) handles a key part of this chapter's functionality: +The `extract_package_name` function in [`scripts/verify_tool_names.py`](https://github.com/awslabs/mcp/blob/HEAD/scripts/verify_tool_names.py) handles a key part of this chapter's functionality: ```py @@ -60,27 +58,27 @@ def extract_package_name(pyproject_path: Path) -> str: except (FileNotFoundError, KeyError) as e: raise ValueError(f'Failed to extract package name from {pyproject_path}: {e}') except Exception as e: - # Handle both tomllib.TOMLDecodeError and tomli.TOMLDecodeError if 'TOML' in str(type(e).__name__): raise ValueError(f'Failed to parse TOML file {pyproject_path}: {e}') else: raise ValueError(f'Failed to extract package name from {pyproject_path}: {e}') -def extract_dependencies(pyproject_path: Path) -> List[str]: - """Extract dependency names from pyproject.toml file.""" - try: - with open(pyproject_path, 'rb') as f: - data = tomllib.load(f) - dependencies = data.get('project', {}).get('dependencies', []) - # Extract just the package names (remove version constraints) - dep_names = [] - for dep in dependencies: - # Remove version constraints (>=, ==, etc.) and extract just the package name - dep_name = re.split(r'[>= str: + """Convert package name to the format used in fully qualified tool names. + + Examples: + awslabs.git-repo-research-mcp-server -> git_repo_research_mcp_server + awslabs.nova-canvas-mcp-server -> nova_canvas_mcp_server + """ + # Remove 'awslabs.' prefix if present + if package_name.startswith('awslabs.'): + package_name = package_name[8:] + + # Replace hyphens with underscores + return package_name.replace('-', '_') + + ``` This function is important because it defines how awslabs/mcp Tutorial: Operating a Large-Scale MCP Server Ecosystem for AWS Workloads implements the patterns covered in this chapter. diff --git a/tutorials/awslabs-mcp-tutorial/02-server-catalog-and-role-composition.md b/tutorials/awslabs-mcp-tutorial/02-server-catalog-and-role-composition.md index 81cec56..dc87830 100644 --- a/tutorials/awslabs-mcp-tutorial/02-server-catalog-and-role-composition.md +++ b/tutorials/awslabs-mcp-tutorial/02-server-catalog-and-role-composition.md @@ -36,46 +36,44 @@ You now have a strategy for selecting servers without overwhelming client contex Next: [Chapter 3: Transport and Client Integration Patterns](03-transport-and-client-integration-patterns.md) -## Depth Expansion Playbook - ## Source Code Walkthrough -### `scripts/verify_package_name.py` +### `scripts/verify_tool_names.py` -The `extract_dependencies` function in [`scripts/verify_package_name.py`](https://github.com/awslabs/mcp/blob/HEAD/scripts/verify_package_name.py) handles a key part of this chapter's functionality: +The `convert_package_name_to_server_format` function in [`scripts/verify_tool_names.py`](https://github.com/awslabs/mcp/blob/HEAD/scripts/verify_tool_names.py) handles a key part of this chapter's functionality: ```py -def extract_dependencies(pyproject_path: Path) -> List[str]: - """Extract dependency names from pyproject.toml file.""" - try: - with open(pyproject_path, 'rb') as f: - data = tomllib.load(f) - dependencies = data.get('project', {}).get('dependencies', []) - # Extract just the package names (remove version constraints) - dep_names = [] - for dep in dependencies: - # Remove version constraints (>=, ==, etc.) and extract just the package name - dep_name = re.split(r'[>= List[str]: - """Extract package names from Base64 encoded or URL-encoded JSON config.""" - try: - # First, try to URL decode in case it's URL-encoded - try: - config_b64 = urllib.parse.unquote(config_b64) - except (ValueError, UnicodeDecodeError): - pass # If URL decoding fails, use original string +def convert_package_name_to_server_format(package_name: str) -> str: + """Convert package name to the format used in fully qualified tool names. + + Examples: + awslabs.git-repo-research-mcp-server -> git_repo_research_mcp_server + awslabs.nova-canvas-mcp-server -> nova_canvas_mcp_server + """ + # Remove 'awslabs.' prefix if present + if package_name.startswith('awslabs.'): + package_name = package_name[8:] + + # Replace hyphens with underscores + return package_name.replace('-', '_') + + +def calculate_fully_qualified_name(server_name: str, tool_name: str) -> str: + """Calculate the fully qualified tool name as used by MCP clients. + + Format: awslabs___ + + Examples: + awslabs + git_repo_research_mcp_server + ___ + search_repos_on_github + = awslabsgit_repo_research_mcp_server___search_repos_on_github + """ + return f'awslabs{server_name}___{tool_name}' + + +def find_tool_decorators(file_path: Path) -> List[Tuple[str, int]]: + """Find all tool definitions in a Python file and extract tool names. ``` @@ -86,5 +84,5 @@ This function is important because it defines how awslabs/mcp Tutorial: Operatin ```mermaid flowchart TD - A[extract_dependencies] + A[convert_package_name_to_server_format] ``` diff --git a/tutorials/awslabs-mcp-tutorial/03-transport-and-client-integration-patterns.md b/tutorials/awslabs-mcp-tutorial/03-transport-and-client-integration-patterns.md index bd9a4b8..e444df2 100644 --- a/tutorials/awslabs-mcp-tutorial/03-transport-and-client-integration-patterns.md +++ b/tutorials/awslabs-mcp-tutorial/03-transport-and-client-integration-patterns.md @@ -36,47 +36,45 @@ You now have a repeatable integration pattern for client configuration and trans Next: [Chapter 4: Infrastructure and IaC Workflows](04-infrastructure-and-iac-workflows.md) -## Depth Expansion Playbook - ## Source Code Walkthrough -### `scripts/verify_package_name.py` +### `scripts/verify_tool_names.py` -The `extract_package_from_base64_config` function in [`scripts/verify_package_name.py`](https://github.com/awslabs/mcp/blob/HEAD/scripts/verify_package_name.py) handles a key part of this chapter's functionality: +The `calculate_fully_qualified_name` function in [`scripts/verify_tool_names.py`](https://github.com/awslabs/mcp/blob/HEAD/scripts/verify_tool_names.py) handles a key part of this chapter's functionality: ```py -def extract_package_from_base64_config(config_b64: str) -> List[str]: - """Extract package names from Base64 encoded or URL-encoded JSON config.""" +def calculate_fully_qualified_name(server_name: str, tool_name: str) -> str: + """Calculate the fully qualified tool name as used by MCP clients. + + Format: awslabs___ + + Examples: + awslabs + git_repo_research_mcp_server + ___ + search_repos_on_github + = awslabsgit_repo_research_mcp_server___search_repos_on_github + """ + return f'awslabs{server_name}___{tool_name}' + + +def find_tool_decorators(file_path: Path) -> List[Tuple[str, int]]: + """Find all tool definitions in a Python file and extract tool names. + + Supports all tool registration patterns: + - Pattern 1: @mcp.tool(name='tool_name') + - Pattern 2: @mcp.tool() (uses function name) + - Pattern 3: app.tool('tool_name')(function) + - Pattern 4: mcp.tool()(function) (uses function name) + - Pattern 5: self.mcp.tool(name='tool_name')(function) + - Pattern 6: @.tool(name='tool_name') + + Returns: + List of tuples: (tool_name, line_number) + """ try: - # First, try to URL decode in case it's URL-encoded - try: - config_b64 = urllib.parse.unquote(config_b64) - except (ValueError, UnicodeDecodeError): - pass # If URL decoding fails, use original string - - # Try to parse as JSON directly first (for URL-encoded JSON) - try: - config = json.loads(config_b64) - except json.JSONDecodeError: - # If not JSON, try Base64 decoding - config_json = base64.b64decode(config_b64).decode('utf-8') - config = json.loads(config_json) - - # Look for package names in the config - package_names = [] - - # Check command field - handle both formats: - # Format 1: {"command": "uvx", "args": ["package@version"]} - # Format 2: {"command": "uvx package@version"} - if 'command' in config: - command = config['command'] - if command in ['uvx', 'uv']: - # Format 1: check args array - if 'args' in config and config['args']: - for arg in config['args']: - # Only consider it a package if it has @ and doesn't look like a URL or connection string + with open(file_path, 'r', encoding='utf-8') as f: + content = f.read() + except (FileNotFoundError, UnicodeDecodeError): ``` This function is important because it defines how awslabs/mcp Tutorial: Operating a Large-Scale MCP Server Ecosystem for AWS Workloads implements the patterns covered in this chapter. @@ -86,5 +84,5 @@ This function is important because it defines how awslabs/mcp Tutorial: Operatin ```mermaid flowchart TD - A[extract_package_from_base64_config] + A[calculate_fully_qualified_name] ``` diff --git a/tutorials/awslabs-mcp-tutorial/04-infrastructure-and-iac-workflows.md b/tutorials/awslabs-mcp-tutorial/04-infrastructure-and-iac-workflows.md index 8b180bb..82b421d 100644 --- a/tutorials/awslabs-mcp-tutorial/04-infrastructure-and-iac-workflows.md +++ b/tutorials/awslabs-mcp-tutorial/04-infrastructure-and-iac-workflows.md @@ -36,47 +36,45 @@ You now understand how to use IaC-focused MCP servers without weakening deployme Next: [Chapter 5: Data, Knowledge, and Agent Workflows](05-data-knowledge-and-agent-workflows.md) -## Depth Expansion Playbook - ## Source Code Walkthrough -### `scripts/verify_package_name.py` +### `scripts/verify_tool_names.py` -The `find_package_references_in_readme` function in [`scripts/verify_package_name.py`](https://github.com/awslabs/mcp/blob/HEAD/scripts/verify_package_name.py) handles a key part of this chapter's functionality: +The `find_tool_decorators` function in [`scripts/verify_tool_names.py`](https://github.com/awslabs/mcp/blob/HEAD/scripts/verify_tool_names.py) handles a key part of this chapter's functionality: ```py -def find_package_references_in_readme( - readme_path: Path, dependencies: List[str] = None, verbose: bool = False -) -> List[Tuple[str, int]]: - """Find all package name references in the README file with line numbers.""" +def find_tool_decorators(file_path: Path) -> List[Tuple[str, int]]: + """Find all tool definitions in a Python file and extract tool names. + + Supports all tool registration patterns: + - Pattern 1: @mcp.tool(name='tool_name') + - Pattern 2: @mcp.tool() (uses function name) + - Pattern 3: app.tool('tool_name')(function) + - Pattern 4: mcp.tool()(function) (uses function name) + - Pattern 5: self.mcp.tool(name='tool_name')(function) + - Pattern 6: @.tool(name='tool_name') + + Returns: + List of tuples: (tool_name, line_number) + """ try: - with open(readme_path, 'r', encoding='utf-8') as f: - lines = f.readlines() - content = ''.join(lines) - except FileNotFoundError: + with open(file_path, 'r', encoding='utf-8') as f: + content = f.read() + except (FileNotFoundError, UnicodeDecodeError): return [] - # More specific patterns for package references in installation instructions - patterns = [ - # uvx/uv tool run patterns with @version - r'uvx\s+([a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+)', - r'uv\s+tool\s+run\s+--from\s+([a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+)', - # pip install patterns - r'pip\s+install\s+([a-zA-Z0-9._-]+)', - # JSON configuration patterns with @version - r'"([a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+)"', - # Package names in JSON config (without version) - r'"([a-zA-Z0-9._-]+)"\s*:\s*{[^}]*"command"\s*:\s*"uvx"', - # Docker image patterns (only match actual image names, not command args) - r'docker\s+run[^"]*"([a-zA-Z0-9._/-]+)"\s*:', - # Cursor installation links - handled via Base64 config extraction - # r'cursor\.com/en/install-mcp\?name=([a-zA-Z0-9._-]+)', # Removed: name often contains display names - # VS Code installation links (name parameter in URL) - only match package-like names - r'vscode\.dev/redirect/mcp/install\?name=([a-zA-Z0-9._-]+)', - ] + tools = [] + + try: + tree = ast.parse(content, filename=str(file_path)) + except SyntaxError: + # If we can't parse the file, skip it + return [] + for node in ast.walk(tree): + # PATTERN 1 & 2 & 6: Decorator patterns ``` This function is important because it defines how awslabs/mcp Tutorial: Operating a Large-Scale MCP Server Ecosystem for AWS Workloads implements the patterns covered in this chapter. @@ -86,5 +84,5 @@ This function is important because it defines how awslabs/mcp Tutorial: Operatin ```mermaid flowchart TD - A[find_package_references_in_readme] + A[find_tool_decorators] ``` diff --git a/tutorials/awslabs-mcp-tutorial/05-data-knowledge-and-agent-workflows.md b/tutorials/awslabs-mcp-tutorial/05-data-knowledge-and-agent-workflows.md index 095c049..e154f40 100644 --- a/tutorials/awslabs-mcp-tutorial/05-data-knowledge-and-agent-workflows.md +++ b/tutorials/awslabs-mcp-tutorial/05-data-knowledge-and-agent-workflows.md @@ -36,47 +36,45 @@ You now have a context-first approach for data and knowledge enriched MCP workfl Next: [Chapter 6: Security, Credentials, and Risk Controls](06-security-credentials-and-risk-controls.md) -## Depth Expansion Playbook - ## Source Code Walkthrough -### `scripts/verify_package_name.py` +### `scripts/verify_tool_names.py` -The `verify_package_name_consistency` function in [`scripts/verify_package_name.py`](https://github.com/awslabs/mcp/blob/HEAD/scripts/verify_package_name.py) handles a key part of this chapter's functionality: +The `find_all_tools_in_package` function in [`scripts/verify_tool_names.py`](https://github.com/awslabs/mcp/blob/HEAD/scripts/verify_tool_names.py) handles a key part of this chapter's functionality: ```py -def verify_package_name_consistency( - package_name: str, references: List[Tuple[str, int]] -) -> Tuple[bool, List[str]]: - """Verify that package references match the actual package name.""" - # Extract just the package name part (without version) - base_package_name = package_name.split('@')[0] if '@' in package_name else package_name +def find_all_tools_in_package(package_dir: Path) -> List[Tuple[str, Path, int]]: + """Find all tool definitions in a package directory. + + Returns: + List of tuples: (tool_name, file_path, line_number) + """ + all_tools = [] - issues = [] + # Search for Python files in the package + for python_file in package_dir.rglob('*.py'): + # Skip test files and virtual environments + if ( + 'test' in str(python_file) + or '.venv' in str(python_file) + or '__pycache__' in str(python_file) + ): + continue - for ref, line_num in references: - # Extract package name from reference (remove version if present) - ref_package = ref.split('@')[0] if '@' in ref else ref + tools = find_tool_decorators(python_file) + for tool_name, line_number in tools: + all_tools.append((tool_name, python_file, line_number)) - if ref_package != base_package_name: - issues.append( - f"Package name mismatch: found '{ref_package}' but expected '{base_package_name}' (line {line_num})" - ) + return all_tools - return len(issues) == 0, issues +def validate_tool_name(tool_name: str) -> Tuple[List[str], List[str]]: + """Validate a tool name against naming conventions. -def main(): - """Main function to verify package name consistency.""" - parser = argparse.ArgumentParser( - description='Verify that README files correctly reference package names from pyproject.toml' - ) - parser.add_argument( - 'package_dir', help='Path to the package directory (e.g., src/amazon-neptune-mcp-server)' - ) - parser.add_argument('--verbose', '-v', action='store_true', help='Enable verbose output') + Returns: + Tuple of (errors, warnings) ``` This function is important because it defines how awslabs/mcp Tutorial: Operating a Large-Scale MCP Server Ecosystem for AWS Workloads implements the patterns covered in this chapter. @@ -86,5 +84,5 @@ This function is important because it defines how awslabs/mcp Tutorial: Operatin ```mermaid flowchart TD - A[verify_package_name_consistency] + A[find_all_tools_in_package] ``` diff --git a/tutorials/awslabs-mcp-tutorial/06-security-credentials-and-risk-controls.md b/tutorials/awslabs-mcp-tutorial/06-security-credentials-and-risk-controls.md index dc134a8..30eb13b 100644 --- a/tutorials/awslabs-mcp-tutorial/06-security-credentials-and-risk-controls.md +++ b/tutorials/awslabs-mcp-tutorial/06-security-credentials-and-risk-controls.md @@ -36,47 +36,45 @@ You now have a practical risk-control framework for production MCP usage on AWS. Next: [Chapter 7: Development, Testing, and Contribution Workflow](07-development-testing-and-contribution-workflow.md) -## Depth Expansion Playbook - ## Source Code Walkthrough -### `scripts/verify_package_name.py` +### `scripts/verify_tool_names.py` -The `main` function in [`scripts/verify_package_name.py`](https://github.com/awslabs/mcp/blob/HEAD/scripts/verify_package_name.py) handles a key part of this chapter's functionality: +The `validate_tool_name` function in [`scripts/verify_tool_names.py`](https://github.com/awslabs/mcp/blob/HEAD/scripts/verify_tool_names.py) handles a key part of this chapter's functionality: ```py -def main(): - """Main function to verify package name consistency.""" - parser = argparse.ArgumentParser( - description='Verify that README files correctly reference package names from pyproject.toml' - ) - parser.add_argument( - 'package_dir', help='Path to the package directory (e.g., src/amazon-neptune-mcp-server)' - ) - parser.add_argument('--verbose', '-v', action='store_true', help='Enable verbose output') - - args = parser.parse_args() - - package_dir = Path(args.package_dir) - pyproject_path = package_dir / 'pyproject.toml' - readme_path = package_dir / 'README.md' - - if not package_dir.exists(): - print(f"Error: Package directory '{package_dir}' does not exist", file=sys.stderr) - sys.exit(1) - - if not pyproject_path.exists(): - print(f"Error: pyproject.toml not found in '{package_dir}'", file=sys.stderr) - sys.exit(1) - - if not readme_path.exists(): - print(f"Warning: README.md not found in '{package_dir}'", file=sys.stderr) - sys.exit(0) - - try: - # Extract package name from pyproject.toml +def validate_tool_name(tool_name: str) -> Tuple[List[str], List[str]]: + """Validate a tool name against naming conventions. + + Returns: + Tuple of (errors, warnings) + - errors: Critical validation failures (will fail the build) + - warnings: Style recommendations (informational only) + """ + errors = [] + warnings = [] + + # Check if name is empty + if not tool_name: + errors.append('Tool name cannot be empty') + return errors, warnings + + # Check length (MCP SEP-986: tool names should be 1-64 characters) + if len(tool_name) > MAX_TOOL_NAME_LENGTH: + errors.append( + f"Tool name '{tool_name}' ({len(tool_name)} chars) exceeds the {MAX_TOOL_NAME_LENGTH} " + f'character limit specified in MCP SEP-986. Please shorten the tool name.' + ) + + # Check if name matches the valid pattern + if not VALID_TOOL_NAME_PATTERN.match(tool_name): + if tool_name[0].isdigit(): + errors.append(f"Tool name '{tool_name}' cannot start with a number") + elif not tool_name[0].isalpha(): + errors.append(f"Tool name '{tool_name}' must start with a letter") + else: ``` This function is important because it defines how awslabs/mcp Tutorial: Operating a Large-Scale MCP Server Ecosystem for AWS Workloads implements the patterns covered in this chapter. @@ -86,5 +84,5 @@ This function is important because it defines how awslabs/mcp Tutorial: Operatin ```mermaid flowchart TD - A[main] + A[validate_tool_name] ``` diff --git a/tutorials/awslabs-mcp-tutorial/07-development-testing-and-contribution-workflow.md b/tutorials/awslabs-mcp-tutorial/07-development-testing-and-contribution-workflow.md index f56ad45..28e4295 100644 --- a/tutorials/awslabs-mcp-tutorial/07-development-testing-and-contribution-workflow.md +++ b/tutorials/awslabs-mcp-tutorial/07-development-testing-and-contribution-workflow.md @@ -36,47 +36,45 @@ You now have a reliable workflow for shipping server changes in the `awslabs/mcp Next: [Chapter 8: Production Operations and Governance](08-production-operations-and-governance.md) -## Depth Expansion Playbook - ## Source Code Walkthrough ### `scripts/verify_tool_names.py` -The `extract_package_name` function in [`scripts/verify_tool_names.py`](https://github.com/awslabs/mcp/blob/HEAD/scripts/verify_tool_names.py) handles a key part of this chapter's functionality: +The `validate_tool_names` function in [`scripts/verify_tool_names.py`](https://github.com/awslabs/mcp/blob/HEAD/scripts/verify_tool_names.py) handles a key part of this chapter's functionality: ```py -def extract_package_name(pyproject_path: Path) -> str: - """Extract the package name from pyproject.toml file.""" - try: - with open(pyproject_path, 'rb') as f: - data = tomllib.load(f) - return data['project']['name'] - except (FileNotFoundError, KeyError) as e: - raise ValueError(f'Failed to extract package name from {pyproject_path}: {e}') - except Exception as e: - if 'TOML' in str(type(e).__name__): - raise ValueError(f'Failed to parse TOML file {pyproject_path}: {e}') - else: - raise ValueError(f'Failed to extract package name from {pyproject_path}: {e}') - - -def convert_package_name_to_server_format(package_name: str) -> str: - """Convert package name to the format used in fully qualified tool names. +def validate_tool_names( + package_name: str, tools: List[Tuple[str, Path, int]], verbose: bool = False +) -> Tuple[bool, List[str], List[str]]: + """Validate all tool names in a package. - Examples: - awslabs.git-repo-research-mcp-server -> git_repo_research_mcp_server - awslabs.nova-canvas-mcp-server -> nova_canvas_mcp_server + Returns: + Tuple of (is_valid, list_of_errors, list_of_warnings) + - is_valid: True if no errors (warnings don't fail validation) + - list_of_errors: Critical issues that fail the build + - list_of_warnings: Recommendations that don't fail the build """ - # Remove 'awslabs.' prefix if present - if package_name.startswith('awslabs.'): - package_name = package_name[8:] - - # Replace hyphens with underscores - return package_name.replace('-', '_') - - + errors = [] + warnings = [] + + for tool_name, file_path, line_number in tools: + # Validate tool name (length, characters, conventions) + naming_errors, naming_warnings = validate_tool_name(tool_name) + for error in naming_errors: + errors.append(f'{file_path}:{line_number} - {error}') + for warning in naming_warnings: + warnings.append(f'{file_path}:{line_number} - {warning}') + + if verbose: + status = '✓' if not naming_errors else '✗' + style_note = '' + if naming_warnings: + style_note = ' (non-snake_case)' + print(f' {status} {tool_name} ({len(tool_name)} chars){style_note}') + + return len(errors) == 0, errors, warnings ``` This function is important because it defines how awslabs/mcp Tutorial: Operating a Large-Scale MCP Server Ecosystem for AWS Workloads implements the patterns covered in this chapter. @@ -86,5 +84,5 @@ This function is important because it defines how awslabs/mcp Tutorial: Operatin ```mermaid flowchart TD - A[extract_package_name] + A[validate_tool_names] ``` diff --git a/tutorials/awslabs-mcp-tutorial/08-production-operations-and-governance.md b/tutorials/awslabs-mcp-tutorial/08-production-operations-and-governance.md index b2859a3..1356036 100644 --- a/tutorials/awslabs-mcp-tutorial/08-production-operations-and-governance.md +++ b/tutorials/awslabs-mcp-tutorial/08-production-operations-and-governance.md @@ -38,46 +38,44 @@ This chapter closes with production operating patterns for long-term reliability You now have an end-to-end model for operating AWS MCP servers with stronger governance and maintainability. -## Depth Expansion Playbook - ## Source Code Walkthrough ### `scripts/verify_tool_names.py` -The `convert_package_name_to_server_format` function in [`scripts/verify_tool_names.py`](https://github.com/awslabs/mcp/blob/HEAD/scripts/verify_tool_names.py) handles a key part of this chapter's functionality: +The `main` function in [`scripts/verify_tool_names.py`](https://github.com/awslabs/mcp/blob/HEAD/scripts/verify_tool_names.py) handles a key part of this chapter's functionality: ```py -def convert_package_name_to_server_format(package_name: str) -> str: - """Convert package name to the format used in fully qualified tool names. - - Examples: - awslabs.git-repo-research-mcp-server -> git_repo_research_mcp_server - awslabs.nova-canvas-mcp-server -> nova_canvas_mcp_server - """ - # Remove 'awslabs.' prefix if present - if package_name.startswith('awslabs.'): - package_name = package_name[8:] - - # Replace hyphens with underscores - return package_name.replace('-', '_') - +def main(): + """Main function to verify tool name conventions.""" + parser = argparse.ArgumentParser( + description='Verify that MCP tool names follow naming conventions and length limits' + ) + parser.add_argument( + 'package_dir', + help='Path to the package directory (e.g., src/git-repo-research-mcp-server)', + ) + parser.add_argument('--verbose', '-v', action='store_true', help='Enable verbose output') -def calculate_fully_qualified_name(server_name: str, tool_name: str) -> str: - """Calculate the fully qualified tool name as used by MCP clients. + args = parser.parse_args() - Format: awslabs___ + package_dir = Path(args.package_dir) + pyproject_path = package_dir / 'pyproject.toml' - Examples: - awslabs + git_repo_research_mcp_server + ___ + search_repos_on_github - = awslabsgit_repo_research_mcp_server___search_repos_on_github - """ - return f'awslabs{server_name}___{tool_name}' + if not package_dir.exists(): + print(f"Error: Package directory '{package_dir}' does not exist", file=sys.stderr) + sys.exit(1) + if not pyproject_path.exists(): + print(f"Error: pyproject.toml not found in '{package_dir}'", file=sys.stderr) + sys.exit(1) -def find_tool_decorators(file_path: Path) -> List[Tuple[str, int]]: - """Find all tool definitions in a Python file and extract tool names. + try: + # Extract package name from pyproject.toml + package_name = extract_package_name(pyproject_path) + if args.verbose: + print(f'Package name from pyproject.toml: {package_name}') ``` @@ -88,5 +86,5 @@ This function is important because it defines how awslabs/mcp Tutorial: Operatin ```mermaid flowchart TD - A[convert_package_name_to_server_format] + A[main] ``` diff --git a/tutorials/claude-code-router-tutorial/01-getting-started.md b/tutorials/claude-code-router-tutorial/01-getting-started.md index 422b4b7..52bfc9c 100644 --- a/tutorials/claude-code-router-tutorial/01-getting-started.md +++ b/tutorials/claude-code-router-tutorial/01-getting-started.md @@ -46,8 +46,6 @@ You now have a working CCR baseline for deeper routing configuration. Next: [Chapter 2: Architecture and Package Topology](02-architecture-and-package-topology.md) -## Depth Expansion Playbook - ## Source Code Walkthrough ### `custom-router.example.js` diff --git a/tutorials/claude-code-router-tutorial/02-architecture-and-package-topology.md b/tutorials/claude-code-router-tutorial/02-architecture-and-package-topology.md index 2360157..7fe10e5 100644 --- a/tutorials/claude-code-router-tutorial/02-architecture-and-package-topology.md +++ b/tutorials/claude-code-router-tutorial/02-architecture-and-package-topology.md @@ -40,8 +40,6 @@ You now have a clear component model for reasoning about CCR behavior. Next: [Chapter 3: Provider Configuration and Transformer Strategy](03-provider-configuration-and-transformer-strategy.md) -## Depth Expansion Playbook - ## Source Code Walkthrough ### `docs/src/docusaurus.d.ts` diff --git a/tutorials/claude-code-router-tutorial/03-provider-configuration-and-transformer-strategy.md b/tutorials/claude-code-router-tutorial/03-provider-configuration-and-transformer-strategy.md index 5fe5ce7..707aa7c 100644 --- a/tutorials/claude-code-router-tutorial/03-provider-configuration-and-transformer-strategy.md +++ b/tutorials/claude-code-router-tutorial/03-provider-configuration-and-transformer-strategy.md @@ -42,10 +42,79 @@ You now have a stable foundation for provider onboarding and transformer managem Next: [Chapter 4: Routing Rules, Fallbacks, and Custom Router Logic](04-routing-rules-fallbacks-and-custom-router-logic.md) -## Depth Expansion Playbook - ## Source Code Walkthrough +### `docs/sidebars.ts` + +The `sidebars` module in [`docs/sidebars.ts`](https://github.com/musistudio/claude-code-router/blob/HEAD/docs/sidebars.ts) handles a key part of this chapter's functionality: + +```ts +import type { SidebarsConfig } from '@docusaurus/plugin-content-docs'; + +const sidebars: SidebarsConfig = { + tutorialSidebar: [ + { + type: 'category', + label: 'CLI', + link: { + type: 'generated-index', + title: 'Claude Code Router CLI', + description: 'Command-line tool usage guide', + slug: 'category/cli', + }, + items: [ + 'cli/intro', + 'cli/installation', + 'cli/quick-start', + { + type: 'category', + label: 'Commands', + link: { + type: 'generated-index', + title: 'CLI Commands', + description: 'Complete command reference', + slug: 'category/cli-commands', + }, + items: [ + 'cli/commands/start', + 'cli/commands/model', + 'cli/commands/status', + 'cli/commands/statusline', + 'cli/commands/preset', + 'cli/commands/other', + ], + }, +``` + +This module is important because it defines how Claude Code Router Tutorial: Multi-Provider Routing and Control Plane for Claude Code implements the patterns covered in this chapter. + +### `tsconfig.base.json` + +The `tsconfig.base` module in [`tsconfig.base.json`](https://github.com/musistudio/claude-code-router/blob/HEAD/tsconfig.base.json) handles a key part of this chapter's functionality: + +```json +{ + "compilerOptions": { + "target": "ES2022", + "module": "CommonJS", + "strict": true, + "esModuleInterop": true, + "skipLibCheck": true, + "forceConsistentCasingInFileNames": true, + "resolveJsonModule": true, + "moduleResolution": "node", + "noImplicitAny": true, + "allowSyntheticDefaultImports": true, + "sourceMap": true, + "declaration": true, + "typeRoots": ["./node_modules/@types", "./packages/*/node_modules/@types"] + } +} + +``` + +This module is important because it defines how Claude Code Router Tutorial: Multi-Provider Routing and Control Plane for Claude Code implements the patterns covered in this chapter. + ### `package.json` The `package` module in [`package.json`](https://github.com/musistudio/claude-code-router/blob/HEAD/package.json) handles a key part of this chapter's functionality: @@ -90,56 +159,14 @@ The `package` module in [`package.json`](https://github.com/musistudio/claude-co This module is important because it defines how Claude Code Router Tutorial: Multi-Provider Routing and Control Plane for Claude Code implements the patterns covered in this chapter. -### `examples/preset-manifest-example.json` - -The `preset-manifest-example` module in [`examples/preset-manifest-example.json`](https://github.com/musistudio/claude-code-router/blob/HEAD/examples/preset-manifest-example.json) handles a key part of this chapter's functionality: - -```json -{ - "name": "multi-provider-example", - "version": "1.0.0", - "description": "多Provider配置示例 - 支持OpenAI和DeepSeek切换", - "author": "CCR Team", - "keywords": ["openai", "deepseek", "multi-provider"], - "ccrVersion": "2.0.0", - "Providers": [ - { - "name": "openai", - "api_base_url": "https://api.openai.com/v1", - "models": ["gpt-4o", "gpt-4o-mini", "gpt-3.5-turbo"] - }, - { - "name": "deepseek", - "api_base_url": "https://api.deepseek.com", - "models": ["deepseek-v3", "deepseek-chat"] - } - ], - "schema": [ - { - "id": "primaryProvider", - "type": "select", - "label": "主要Provider", - "prompt": "选择您主要使用的LLM提供商", - "options": { - "type": "providers" - }, - "required": true, - "defaultValue": "openai" - }, - { - "id": "apiKey", - "type": "password", - "label": "API Key", -``` - -This module is important because it defines how Claude Code Router Tutorial: Multi-Provider Routing and Control Plane for Claude Code implements the patterns covered in this chapter. - ## How These Components Connect ```mermaid flowchart TD - A[package] - B[preset-manifest-example] + A[sidebars] + B[tsconfig.base] + C[package] A --> B + B --> C ``` diff --git a/tutorials/claude-code-router-tutorial/04-routing-rules-fallbacks-and-custom-router-logic.md b/tutorials/claude-code-router-tutorial/04-routing-rules-fallbacks-and-custom-router-logic.md index 281bab4..59d00af 100644 --- a/tutorials/claude-code-router-tutorial/04-routing-rules-fallbacks-and-custom-router-logic.md +++ b/tutorials/claude-code-router-tutorial/04-routing-rules-fallbacks-and-custom-router-logic.md @@ -40,10 +40,79 @@ You now know how to build robust routing logic with graceful degradation paths. Next: [Chapter 5: CLI Operations: Model, Preset, and Statusline Workflows](05-cli-operations-model-preset-and-statusline-workflows.md) -## Depth Expansion Playbook - ## Source Code Walkthrough +### `docs/sidebars.ts` + +The `sidebars` module in [`docs/sidebars.ts`](https://github.com/musistudio/claude-code-router/blob/HEAD/docs/sidebars.ts) handles a key part of this chapter's functionality: + +```ts +import type { SidebarsConfig } from '@docusaurus/plugin-content-docs'; + +const sidebars: SidebarsConfig = { + tutorialSidebar: [ + { + type: 'category', + label: 'CLI', + link: { + type: 'generated-index', + title: 'Claude Code Router CLI', + description: 'Command-line tool usage guide', + slug: 'category/cli', + }, + items: [ + 'cli/intro', + 'cli/installation', + 'cli/quick-start', + { + type: 'category', + label: 'Commands', + link: { + type: 'generated-index', + title: 'CLI Commands', + description: 'Complete command reference', + slug: 'category/cli-commands', + }, + items: [ + 'cli/commands/start', + 'cli/commands/model', + 'cli/commands/status', + 'cli/commands/statusline', + 'cli/commands/preset', + 'cli/commands/other', + ], + }, +``` + +This module is important because it defines how Claude Code Router Tutorial: Multi-Provider Routing and Control Plane for Claude Code implements the patterns covered in this chapter. + +### `tsconfig.base.json` + +The `tsconfig.base` module in [`tsconfig.base.json`](https://github.com/musistudio/claude-code-router/blob/HEAD/tsconfig.base.json) handles a key part of this chapter's functionality: + +```json +{ + "compilerOptions": { + "target": "ES2022", + "module": "CommonJS", + "strict": true, + "esModuleInterop": true, + "skipLibCheck": true, + "forceConsistentCasingInFileNames": true, + "resolveJsonModule": true, + "moduleResolution": "node", + "noImplicitAny": true, + "allowSyntheticDefaultImports": true, + "sourceMap": true, + "declaration": true, + "typeRoots": ["./node_modules/@types", "./packages/*/node_modules/@types"] + } +} + +``` + +This module is important because it defines how Claude Code Router Tutorial: Multi-Provider Routing and Control Plane for Claude Code implements the patterns covered in this chapter. + ### `package.json` The `package` module in [`package.json`](https://github.com/musistudio/claude-code-router/blob/HEAD/package.json) handles a key part of this chapter's functionality: @@ -88,56 +157,14 @@ The `package` module in [`package.json`](https://github.com/musistudio/claude-co This module is important because it defines how Claude Code Router Tutorial: Multi-Provider Routing and Control Plane for Claude Code implements the patterns covered in this chapter. -### `examples/preset-manifest-example.json` - -The `preset-manifest-example` module in [`examples/preset-manifest-example.json`](https://github.com/musistudio/claude-code-router/blob/HEAD/examples/preset-manifest-example.json) handles a key part of this chapter's functionality: - -```json -{ - "name": "multi-provider-example", - "version": "1.0.0", - "description": "多Provider配置示例 - 支持OpenAI和DeepSeek切换", - "author": "CCR Team", - "keywords": ["openai", "deepseek", "multi-provider"], - "ccrVersion": "2.0.0", - "Providers": [ - { - "name": "openai", - "api_base_url": "https://api.openai.com/v1", - "models": ["gpt-4o", "gpt-4o-mini", "gpt-3.5-turbo"] - }, - { - "name": "deepseek", - "api_base_url": "https://api.deepseek.com", - "models": ["deepseek-v3", "deepseek-chat"] - } - ], - "schema": [ - { - "id": "primaryProvider", - "type": "select", - "label": "主要Provider", - "prompt": "选择您主要使用的LLM提供商", - "options": { - "type": "providers" - }, - "required": true, - "defaultValue": "openai" - }, - { - "id": "apiKey", - "type": "password", - "label": "API Key", -``` - -This module is important because it defines how Claude Code Router Tutorial: Multi-Provider Routing and Control Plane for Claude Code implements the patterns covered in this chapter. - ## How These Components Connect ```mermaid flowchart TD - A[package] - B[preset-manifest-example] + A[sidebars] + B[tsconfig.base] + C[package] A --> B + B --> C ``` diff --git a/tutorials/claude-code-router-tutorial/05-cli-operations-model-preset-and-statusline-workflows.md b/tutorials/claude-code-router-tutorial/05-cli-operations-model-preset-and-statusline-workflows.md index b9b4399..5e6f89f 100644 --- a/tutorials/claude-code-router-tutorial/05-cli-operations-model-preset-and-statusline-workflows.md +++ b/tutorials/claude-code-router-tutorial/05-cli-operations-model-preset-and-statusline-workflows.md @@ -42,10 +42,79 @@ You now have practical CLI patterns for faster CCR operations and team portabili Next: [Chapter 6: Server Deployment and API Integration](06-server-deployment-and-api-integration.md) -## Depth Expansion Playbook - ## Source Code Walkthrough +### `docs/sidebars.ts` + +The `sidebars` module in [`docs/sidebars.ts`](https://github.com/musistudio/claude-code-router/blob/HEAD/docs/sidebars.ts) handles a key part of this chapter's functionality: + +```ts +import type { SidebarsConfig } from '@docusaurus/plugin-content-docs'; + +const sidebars: SidebarsConfig = { + tutorialSidebar: [ + { + type: 'category', + label: 'CLI', + link: { + type: 'generated-index', + title: 'Claude Code Router CLI', + description: 'Command-line tool usage guide', + slug: 'category/cli', + }, + items: [ + 'cli/intro', + 'cli/installation', + 'cli/quick-start', + { + type: 'category', + label: 'Commands', + link: { + type: 'generated-index', + title: 'CLI Commands', + description: 'Complete command reference', + slug: 'category/cli-commands', + }, + items: [ + 'cli/commands/start', + 'cli/commands/model', + 'cli/commands/status', + 'cli/commands/statusline', + 'cli/commands/preset', + 'cli/commands/other', + ], + }, +``` + +This module is important because it defines how Claude Code Router Tutorial: Multi-Provider Routing and Control Plane for Claude Code implements the patterns covered in this chapter. + +### `tsconfig.base.json` + +The `tsconfig.base` module in [`tsconfig.base.json`](https://github.com/musistudio/claude-code-router/blob/HEAD/tsconfig.base.json) handles a key part of this chapter's functionality: + +```json +{ + "compilerOptions": { + "target": "ES2022", + "module": "CommonJS", + "strict": true, + "esModuleInterop": true, + "skipLibCheck": true, + "forceConsistentCasingInFileNames": true, + "resolveJsonModule": true, + "moduleResolution": "node", + "noImplicitAny": true, + "allowSyntheticDefaultImports": true, + "sourceMap": true, + "declaration": true, + "typeRoots": ["./node_modules/@types", "./packages/*/node_modules/@types"] + } +} + +``` + +This module is important because it defines how Claude Code Router Tutorial: Multi-Provider Routing and Control Plane for Claude Code implements the patterns covered in this chapter. + ### `package.json` The `package` module in [`package.json`](https://github.com/musistudio/claude-code-router/blob/HEAD/package.json) handles a key part of this chapter's functionality: @@ -90,56 +159,14 @@ The `package` module in [`package.json`](https://github.com/musistudio/claude-co This module is important because it defines how Claude Code Router Tutorial: Multi-Provider Routing and Control Plane for Claude Code implements the patterns covered in this chapter. -### `examples/preset-manifest-example.json` - -The `preset-manifest-example` module in [`examples/preset-manifest-example.json`](https://github.com/musistudio/claude-code-router/blob/HEAD/examples/preset-manifest-example.json) handles a key part of this chapter's functionality: - -```json -{ - "name": "multi-provider-example", - "version": "1.0.0", - "description": "多Provider配置示例 - 支持OpenAI和DeepSeek切换", - "author": "CCR Team", - "keywords": ["openai", "deepseek", "multi-provider"], - "ccrVersion": "2.0.0", - "Providers": [ - { - "name": "openai", - "api_base_url": "https://api.openai.com/v1", - "models": ["gpt-4o", "gpt-4o-mini", "gpt-3.5-turbo"] - }, - { - "name": "deepseek", - "api_base_url": "https://api.deepseek.com", - "models": ["deepseek-v3", "deepseek-chat"] - } - ], - "schema": [ - { - "id": "primaryProvider", - "type": "select", - "label": "主要Provider", - "prompt": "选择您主要使用的LLM提供商", - "options": { - "type": "providers" - }, - "required": true, - "defaultValue": "openai" - }, - { - "id": "apiKey", - "type": "password", - "label": "API Key", -``` - -This module is important because it defines how Claude Code Router Tutorial: Multi-Provider Routing and Control Plane for Claude Code implements the patterns covered in this chapter. - ## How These Components Connect ```mermaid flowchart TD - A[package] - B[preset-manifest-example] + A[sidebars] + B[tsconfig.base] + C[package] A --> B + B --> C ``` diff --git a/tutorials/claude-code-router-tutorial/06-server-deployment-and-api-integration.md b/tutorials/claude-code-router-tutorial/06-server-deployment-and-api-integration.md index d6492a5..5da4b46 100644 --- a/tutorials/claude-code-router-tutorial/06-server-deployment-and-api-integration.md +++ b/tutorials/claude-code-router-tutorial/06-server-deployment-and-api-integration.md @@ -41,10 +41,79 @@ You now have a baseline for running CCR as an operational service. Next: [Chapter 7: GitHub Actions, Non-Interactive Mode, and Team Ops](07-github-actions-non-interactive-mode-and-team-ops.md) -## Depth Expansion Playbook - ## Source Code Walkthrough +### `docs/sidebars.ts` + +The `sidebars` module in [`docs/sidebars.ts`](https://github.com/musistudio/claude-code-router/blob/HEAD/docs/sidebars.ts) handles a key part of this chapter's functionality: + +```ts +import type { SidebarsConfig } from '@docusaurus/plugin-content-docs'; + +const sidebars: SidebarsConfig = { + tutorialSidebar: [ + { + type: 'category', + label: 'CLI', + link: { + type: 'generated-index', + title: 'Claude Code Router CLI', + description: 'Command-line tool usage guide', + slug: 'category/cli', + }, + items: [ + 'cli/intro', + 'cli/installation', + 'cli/quick-start', + { + type: 'category', + label: 'Commands', + link: { + type: 'generated-index', + title: 'CLI Commands', + description: 'Complete command reference', + slug: 'category/cli-commands', + }, + items: [ + 'cli/commands/start', + 'cli/commands/model', + 'cli/commands/status', + 'cli/commands/statusline', + 'cli/commands/preset', + 'cli/commands/other', + ], + }, +``` + +This module is important because it defines how Claude Code Router Tutorial: Multi-Provider Routing and Control Plane for Claude Code implements the patterns covered in this chapter. + +### `tsconfig.base.json` + +The `tsconfig.base` module in [`tsconfig.base.json`](https://github.com/musistudio/claude-code-router/blob/HEAD/tsconfig.base.json) handles a key part of this chapter's functionality: + +```json +{ + "compilerOptions": { + "target": "ES2022", + "module": "CommonJS", + "strict": true, + "esModuleInterop": true, + "skipLibCheck": true, + "forceConsistentCasingInFileNames": true, + "resolveJsonModule": true, + "moduleResolution": "node", + "noImplicitAny": true, + "allowSyntheticDefaultImports": true, + "sourceMap": true, + "declaration": true, + "typeRoots": ["./node_modules/@types", "./packages/*/node_modules/@types"] + } +} + +``` + +This module is important because it defines how Claude Code Router Tutorial: Multi-Provider Routing and Control Plane for Claude Code implements the patterns covered in this chapter. + ### `package.json` The `package` module in [`package.json`](https://github.com/musistudio/claude-code-router/blob/HEAD/package.json) handles a key part of this chapter's functionality: @@ -89,56 +158,14 @@ The `package` module in [`package.json`](https://github.com/musistudio/claude-co This module is important because it defines how Claude Code Router Tutorial: Multi-Provider Routing and Control Plane for Claude Code implements the patterns covered in this chapter. -### `examples/preset-manifest-example.json` - -The `preset-manifest-example` module in [`examples/preset-manifest-example.json`](https://github.com/musistudio/claude-code-router/blob/HEAD/examples/preset-manifest-example.json) handles a key part of this chapter's functionality: - -```json -{ - "name": "multi-provider-example", - "version": "1.0.0", - "description": "多Provider配置示例 - 支持OpenAI和DeepSeek切换", - "author": "CCR Team", - "keywords": ["openai", "deepseek", "multi-provider"], - "ccrVersion": "2.0.0", - "Providers": [ - { - "name": "openai", - "api_base_url": "https://api.openai.com/v1", - "models": ["gpt-4o", "gpt-4o-mini", "gpt-3.5-turbo"] - }, - { - "name": "deepseek", - "api_base_url": "https://api.deepseek.com", - "models": ["deepseek-v3", "deepseek-chat"] - } - ], - "schema": [ - { - "id": "primaryProvider", - "type": "select", - "label": "主要Provider", - "prompt": "选择您主要使用的LLM提供商", - "options": { - "type": "providers" - }, - "required": true, - "defaultValue": "openai" - }, - { - "id": "apiKey", - "type": "password", - "label": "API Key", -``` - -This module is important because it defines how Claude Code Router Tutorial: Multi-Provider Routing and Control Plane for Claude Code implements the patterns covered in this chapter. - ## How These Components Connect ```mermaid flowchart TD - A[package] - B[preset-manifest-example] + A[sidebars] + B[tsconfig.base] + C[package] A --> B + B --> C ``` diff --git a/tutorials/claude-code-router-tutorial/07-github-actions-non-interactive-mode-and-team-ops.md b/tutorials/claude-code-router-tutorial/07-github-actions-non-interactive-mode-and-team-ops.md index 3dd3dbe..7c46af8 100644 --- a/tutorials/claude-code-router-tutorial/07-github-actions-non-interactive-mode-and-team-ops.md +++ b/tutorials/claude-code-router-tutorial/07-github-actions-non-interactive-mode-and-team-ops.md @@ -39,10 +39,79 @@ You now have patterns for running CCR in automated and team-scale workflows. Next: [Chapter 8: Troubleshooting, Security, and Contribution Workflow](08-troubleshooting-security-and-contribution-workflow.md) -## Depth Expansion Playbook - ## Source Code Walkthrough +### `docs/sidebars.ts` + +The `sidebars` module in [`docs/sidebars.ts`](https://github.com/musistudio/claude-code-router/blob/HEAD/docs/sidebars.ts) handles a key part of this chapter's functionality: + +```ts +import type { SidebarsConfig } from '@docusaurus/plugin-content-docs'; + +const sidebars: SidebarsConfig = { + tutorialSidebar: [ + { + type: 'category', + label: 'CLI', + link: { + type: 'generated-index', + title: 'Claude Code Router CLI', + description: 'Command-line tool usage guide', + slug: 'category/cli', + }, + items: [ + 'cli/intro', + 'cli/installation', + 'cli/quick-start', + { + type: 'category', + label: 'Commands', + link: { + type: 'generated-index', + title: 'CLI Commands', + description: 'Complete command reference', + slug: 'category/cli-commands', + }, + items: [ + 'cli/commands/start', + 'cli/commands/model', + 'cli/commands/status', + 'cli/commands/statusline', + 'cli/commands/preset', + 'cli/commands/other', + ], + }, +``` + +This module is important because it defines how Claude Code Router Tutorial: Multi-Provider Routing and Control Plane for Claude Code implements the patterns covered in this chapter. + +### `tsconfig.base.json` + +The `tsconfig.base` module in [`tsconfig.base.json`](https://github.com/musistudio/claude-code-router/blob/HEAD/tsconfig.base.json) handles a key part of this chapter's functionality: + +```json +{ + "compilerOptions": { + "target": "ES2022", + "module": "CommonJS", + "strict": true, + "esModuleInterop": true, + "skipLibCheck": true, + "forceConsistentCasingInFileNames": true, + "resolveJsonModule": true, + "moduleResolution": "node", + "noImplicitAny": true, + "allowSyntheticDefaultImports": true, + "sourceMap": true, + "declaration": true, + "typeRoots": ["./node_modules/@types", "./packages/*/node_modules/@types"] + } +} + +``` + +This module is important because it defines how Claude Code Router Tutorial: Multi-Provider Routing and Control Plane for Claude Code implements the patterns covered in this chapter. + ### `package.json` The `package` module in [`package.json`](https://github.com/musistudio/claude-code-router/blob/HEAD/package.json) handles a key part of this chapter's functionality: @@ -87,56 +156,14 @@ The `package` module in [`package.json`](https://github.com/musistudio/claude-co This module is important because it defines how Claude Code Router Tutorial: Multi-Provider Routing and Control Plane for Claude Code implements the patterns covered in this chapter. -### `examples/preset-manifest-example.json` - -The `preset-manifest-example` module in [`examples/preset-manifest-example.json`](https://github.com/musistudio/claude-code-router/blob/HEAD/examples/preset-manifest-example.json) handles a key part of this chapter's functionality: - -```json -{ - "name": "multi-provider-example", - "version": "1.0.0", - "description": "多Provider配置示例 - 支持OpenAI和DeepSeek切换", - "author": "CCR Team", - "keywords": ["openai", "deepseek", "multi-provider"], - "ccrVersion": "2.0.0", - "Providers": [ - { - "name": "openai", - "api_base_url": "https://api.openai.com/v1", - "models": ["gpt-4o", "gpt-4o-mini", "gpt-3.5-turbo"] - }, - { - "name": "deepseek", - "api_base_url": "https://api.deepseek.com", - "models": ["deepseek-v3", "deepseek-chat"] - } - ], - "schema": [ - { - "id": "primaryProvider", - "type": "select", - "label": "主要Provider", - "prompt": "选择您主要使用的LLM提供商", - "options": { - "type": "providers" - }, - "required": true, - "defaultValue": "openai" - }, - { - "id": "apiKey", - "type": "password", - "label": "API Key", -``` - -This module is important because it defines how Claude Code Router Tutorial: Multi-Provider Routing and Control Plane for Claude Code implements the patterns covered in this chapter. - ## How These Components Connect ```mermaid flowchart TD - A[package] - B[preset-manifest-example] + A[sidebars] + B[tsconfig.base] + C[package] A --> B + B --> C ``` diff --git a/tutorials/claude-code-router-tutorial/08-troubleshooting-security-and-contribution-workflow.md b/tutorials/claude-code-router-tutorial/08-troubleshooting-security-and-contribution-workflow.md index 0014148..9250a24 100644 --- a/tutorials/claude-code-router-tutorial/08-troubleshooting-security-and-contribution-workflow.md +++ b/tutorials/claude-code-router-tutorial/08-troubleshooting-security-and-contribution-workflow.md @@ -44,10 +44,79 @@ Next steps: - add tested fallback chains for critical scenarios - run a weekly config and log review for drift detection -## Depth Expansion Playbook - ## Source Code Walkthrough +### `docs/sidebars.ts` + +The `sidebars` module in [`docs/sidebars.ts`](https://github.com/musistudio/claude-code-router/blob/HEAD/docs/sidebars.ts) handles a key part of this chapter's functionality: + +```ts +import type { SidebarsConfig } from '@docusaurus/plugin-content-docs'; + +const sidebars: SidebarsConfig = { + tutorialSidebar: [ + { + type: 'category', + label: 'CLI', + link: { + type: 'generated-index', + title: 'Claude Code Router CLI', + description: 'Command-line tool usage guide', + slug: 'category/cli', + }, + items: [ + 'cli/intro', + 'cli/installation', + 'cli/quick-start', + { + type: 'category', + label: 'Commands', + link: { + type: 'generated-index', + title: 'CLI Commands', + description: 'Complete command reference', + slug: 'category/cli-commands', + }, + items: [ + 'cli/commands/start', + 'cli/commands/model', + 'cli/commands/status', + 'cli/commands/statusline', + 'cli/commands/preset', + 'cli/commands/other', + ], + }, +``` + +This module is important because it defines how Claude Code Router Tutorial: Multi-Provider Routing and Control Plane for Claude Code implements the patterns covered in this chapter. + +### `tsconfig.base.json` + +The `tsconfig.base` module in [`tsconfig.base.json`](https://github.com/musistudio/claude-code-router/blob/HEAD/tsconfig.base.json) handles a key part of this chapter's functionality: + +```json +{ + "compilerOptions": { + "target": "ES2022", + "module": "CommonJS", + "strict": true, + "esModuleInterop": true, + "skipLibCheck": true, + "forceConsistentCasingInFileNames": true, + "resolveJsonModule": true, + "moduleResolution": "node", + "noImplicitAny": true, + "allowSyntheticDefaultImports": true, + "sourceMap": true, + "declaration": true, + "typeRoots": ["./node_modules/@types", "./packages/*/node_modules/@types"] + } +} + +``` + +This module is important because it defines how Claude Code Router Tutorial: Multi-Provider Routing and Control Plane for Claude Code implements the patterns covered in this chapter. + ### `package.json` The `package` module in [`package.json`](https://github.com/musistudio/claude-code-router/blob/HEAD/package.json) handles a key part of this chapter's functionality: @@ -92,56 +161,14 @@ The `package` module in [`package.json`](https://github.com/musistudio/claude-co This module is important because it defines how Claude Code Router Tutorial: Multi-Provider Routing and Control Plane for Claude Code implements the patterns covered in this chapter. -### `examples/preset-manifest-example.json` - -The `preset-manifest-example` module in [`examples/preset-manifest-example.json`](https://github.com/musistudio/claude-code-router/blob/HEAD/examples/preset-manifest-example.json) handles a key part of this chapter's functionality: - -```json -{ - "name": "multi-provider-example", - "version": "1.0.0", - "description": "多Provider配置示例 - 支持OpenAI和DeepSeek切换", - "author": "CCR Team", - "keywords": ["openai", "deepseek", "multi-provider"], - "ccrVersion": "2.0.0", - "Providers": [ - { - "name": "openai", - "api_base_url": "https://api.openai.com/v1", - "models": ["gpt-4o", "gpt-4o-mini", "gpt-3.5-turbo"] - }, - { - "name": "deepseek", - "api_base_url": "https://api.deepseek.com", - "models": ["deepseek-v3", "deepseek-chat"] - } - ], - "schema": [ - { - "id": "primaryProvider", - "type": "select", - "label": "主要Provider", - "prompt": "选择您主要使用的LLM提供商", - "options": { - "type": "providers" - }, - "required": true, - "defaultValue": "openai" - }, - { - "id": "apiKey", - "type": "password", - "label": "API Key", -``` - -This module is important because it defines how Claude Code Router Tutorial: Multi-Provider Routing and Control Plane for Claude Code implements the patterns covered in this chapter. - ## How These Components Connect ```mermaid flowchart TD - A[package] - B[preset-manifest-example] + A[sidebars] + B[tsconfig.base] + C[package] A --> B + B --> C ``` diff --git a/tutorials/claude-flow-tutorial/01-getting-started.md b/tutorials/claude-flow-tutorial/01-getting-started.md index fc40c74..aecba3a 100644 --- a/tutorials/claude-flow-tutorial/01-getting-started.md +++ b/tutorials/claude-flow-tutorial/01-getting-started.md @@ -40,8 +40,6 @@ You now have a practical bootstrap path and a clearer operating model for early Next: [Chapter 2: V3 Architecture and ADRs](02-v3-architecture-and-adrs.md) -## Depth Expansion Playbook - ## Source Code Walkthrough ### `v3/index.ts` diff --git a/tutorials/claude-flow-tutorial/02-v3-architecture-and-adrs.md b/tutorials/claude-flow-tutorial/02-v3-architecture-and-adrs.md index 823a040..22496a4 100644 --- a/tutorials/claude-flow-tutorial/02-v3-architecture-and-adrs.md +++ b/tutorials/claude-flow-tutorial/02-v3-architecture-and-adrs.md @@ -36,8 +36,6 @@ You now have a grounded model of how V3 is structured and how ADRs shape impleme Next: [Chapter 3: Swarm Coordination and Consensus Patterns](03-swarm-coordination-and-consensus-patterns.md) -## Depth Expansion Playbook - ## Source Code Walkthrough ### `v3/index.ts` diff --git a/tutorials/claude-flow-tutorial/03-swarm-coordination-and-consensus-patterns.md b/tutorials/claude-flow-tutorial/03-swarm-coordination-and-consensus-patterns.md index 1098ade..2506bb0 100644 --- a/tutorials/claude-flow-tutorial/03-swarm-coordination-and-consensus-patterns.md +++ b/tutorials/claude-flow-tutorial/03-swarm-coordination-and-consensus-patterns.md @@ -36,8 +36,6 @@ You can now design swarm coordination with clearer topology and consensus tradeo Next: [Chapter 4: Memory, Learning, and Intelligence Systems](04-memory-learning-and-intelligence-systems.md) -## Depth Expansion Playbook - ## Source Code Walkthrough ### `v3/swarm.config.ts` diff --git a/tutorials/claude-flow-tutorial/04-memory-learning-and-intelligence-systems.md b/tutorials/claude-flow-tutorial/04-memory-learning-and-intelligence-systems.md index 904385e..063e90e 100644 --- a/tutorials/claude-flow-tutorial/04-memory-learning-and-intelligence-systems.md +++ b/tutorials/claude-flow-tutorial/04-memory-learning-and-intelligence-systems.md @@ -36,8 +36,6 @@ You now have a practical framework for adopting memory and learning features inc Next: [Chapter 5: MCP Server, CLI, and Runtime Operations](05-mcp-server-cli-and-runtime-operations.md) -## Depth Expansion Playbook - ## Source Code Walkthrough ### `v3/swarm.config.ts` diff --git a/tutorials/claude-flow-tutorial/05-mcp-server-cli-and-runtime-operations.md b/tutorials/claude-flow-tutorial/05-mcp-server-cli-and-runtime-operations.md index 8e247f0..6ee84b9 100644 --- a/tutorials/claude-flow-tutorial/05-mcp-server-cli-and-runtime-operations.md +++ b/tutorials/claude-flow-tutorial/05-mcp-server-cli-and-runtime-operations.md @@ -36,8 +36,6 @@ You now have a clearer mental model for running MCP/CLI surfaces without operati Next: [Chapter 6: Plugin SDK and Extensibility Patterns](06-plugin-sdk-and-extensibility-patterns.md) -## Depth Expansion Playbook - ## Source Code Walkthrough ### `v3/swarm.config.ts` diff --git a/tutorials/claude-flow-tutorial/06-plugin-sdk-and-extensibility-patterns.md b/tutorials/claude-flow-tutorial/06-plugin-sdk-and-extensibility-patterns.md index a8cd479..a98807f 100644 --- a/tutorials/claude-flow-tutorial/06-plugin-sdk-and-extensibility-patterns.md +++ b/tutorials/claude-flow-tutorial/06-plugin-sdk-and-extensibility-patterns.md @@ -36,8 +36,6 @@ You can now extend Claude Flow with better modularity and lower operational risk Next: [Chapter 7: Testing, Migration, and Upgrade Strategy](07-testing-migration-and-upgrade-strategy.md) -## Depth Expansion Playbook - ## Source Code Walkthrough ### `v3/swarm.config.ts` diff --git a/tutorials/claude-flow-tutorial/07-testing-migration-and-upgrade-strategy.md b/tutorials/claude-flow-tutorial/07-testing-migration-and-upgrade-strategy.md index 9151b6a..6d24038 100644 --- a/tutorials/claude-flow-tutorial/07-testing-migration-and-upgrade-strategy.md +++ b/tutorials/claude-flow-tutorial/07-testing-migration-and-upgrade-strategy.md @@ -36,8 +36,6 @@ You now have a testing and migration strategy that reduces upgrade surprises. Next: [Chapter 8: Production Governance, Security, and Performance](08-production-governance-security-and-performance.md) -## Depth Expansion Playbook - ## Source Code Walkthrough ### `v3/swarm.config.ts` diff --git a/tutorials/claude-flow-tutorial/08-production-governance-security-and-performance.md b/tutorials/claude-flow-tutorial/08-production-governance-security-and-performance.md index e35c876..85900ac 100644 --- a/tutorials/claude-flow-tutorial/08-production-governance-security-and-performance.md +++ b/tutorials/claude-flow-tutorial/08-production-governance-security-and-performance.md @@ -38,8 +38,6 @@ This chapter consolidates operational controls for security posture, performance You now have an end-to-end operational framework for adopting Claude Flow with stronger reliability and governance discipline. -## Depth Expansion Playbook - ## Source Code Walkthrough ### `v3/swarm.config.ts` diff --git a/tutorials/create-python-server-tutorial/01-getting-started-and-scaffolding-workflow.md b/tutorials/create-python-server-tutorial/01-getting-started-and-scaffolding-workflow.md index 9f27e93..27814cb 100644 --- a/tutorials/create-python-server-tutorial/01-getting-started-and-scaffolding-workflow.md +++ b/tutorials/create-python-server-tutorial/01-getting-started-and-scaffolding-workflow.md @@ -38,8 +38,6 @@ You now have a reproducible baseline for generating MCP Python server projects. Next: [Chapter 2: Generated Project Structure and Conventions](02-generated-project-structure-and-conventions.md) -## Depth Expansion Playbook - ## Source Code Walkthrough ### `src/create_mcp_server/__init__.py` diff --git a/tutorials/create-python-server-tutorial/02-generated-project-structure-and-conventions.md b/tutorials/create-python-server-tutorial/02-generated-project-structure-and-conventions.md index 3d53206..18fecf2 100644 --- a/tutorials/create-python-server-tutorial/02-generated-project-structure-and-conventions.md +++ b/tutorials/create-python-server-tutorial/02-generated-project-structure-and-conventions.md @@ -39,8 +39,6 @@ You now have a structural map for generated MCP Python server projects. Next: [Chapter 3: Template Server Architecture: Resources, Prompts, and Tools](03-template-server-architecture-resources-prompts-and-tools.md) -## Depth Expansion Playbook - ## Source Code Walkthrough ### `src/create_mcp_server/__init__.py` diff --git a/tutorials/create-python-server-tutorial/03-template-server-architecture-resources-prompts-and-tools.md b/tutorials/create-python-server-tutorial/03-template-server-architecture-resources-prompts-and-tools.md index 55c3c3a..9a60e29 100644 --- a/tutorials/create-python-server-tutorial/03-template-server-architecture-resources-prompts-and-tools.md +++ b/tutorials/create-python-server-tutorial/03-template-server-architecture-resources-prompts-and-tools.md @@ -37,8 +37,6 @@ You now have a concrete mental model for generated MCP primitive handlers. Next: [Chapter 4: Runtime, Dependencies, and uv Packaging](04-runtime-dependencies-and-uv-packaging.md) -## Depth Expansion Playbook - ## Source Code Walkthrough ### `src/create_mcp_server/__init__.py` diff --git a/tutorials/create-python-server-tutorial/04-runtime-dependencies-and-uv-packaging.md b/tutorials/create-python-server-tutorial/04-runtime-dependencies-and-uv-packaging.md index ac8a32f..8129f10 100644 --- a/tutorials/create-python-server-tutorial/04-runtime-dependencies-and-uv-packaging.md +++ b/tutorials/create-python-server-tutorial/04-runtime-dependencies-and-uv-packaging.md @@ -37,8 +37,6 @@ You now have a consistent runtime and packaging model for generated MCP servers. Next: [Chapter 5: Local Integration: Claude Desktop and Inspector](05-local-integration-claude-desktop-and-inspector.md) -## Depth Expansion Playbook - ## Source Code Walkthrough ### `src/create_mcp_server/__init__.py` diff --git a/tutorials/create-python-server-tutorial/05-local-integration-claude-desktop-and-inspector.md b/tutorials/create-python-server-tutorial/05-local-integration-claude-desktop-and-inspector.md index eeeb7bc..30f09ba 100644 --- a/tutorials/create-python-server-tutorial/05-local-integration-claude-desktop-and-inspector.md +++ b/tutorials/create-python-server-tutorial/05-local-integration-claude-desktop-and-inspector.md @@ -38,8 +38,6 @@ You now have a working local integration and debugging strategy for scaffolded s Next: [Chapter 6: Customization and Extension Patterns](06-customization-and-extension-patterns.md) -## Depth Expansion Playbook - ## Source Code Walkthrough ### `src/create_mcp_server/__init__.py` diff --git a/tutorials/create-python-server-tutorial/06-customization-and-extension-patterns.md b/tutorials/create-python-server-tutorial/06-customization-and-extension-patterns.md index 62eb47b..83923a4 100644 --- a/tutorials/create-python-server-tutorial/06-customization-and-extension-patterns.md +++ b/tutorials/create-python-server-tutorial/06-customization-and-extension-patterns.md @@ -38,8 +38,6 @@ You now have an extension model for safely evolving generated MCP servers. Next: [Chapter 7: Quality, Security, and Contribution Workflows](07-quality-security-and-contribution-workflows.md) -## Depth Expansion Playbook - ## Source Code Walkthrough ### `src/create_mcp_server/__init__.py` diff --git a/tutorials/create-python-server-tutorial/07-quality-security-and-contribution-workflows.md b/tutorials/create-python-server-tutorial/07-quality-security-and-contribution-workflows.md index 2e9a52e..252ac0f 100644 --- a/tutorials/create-python-server-tutorial/07-quality-security-and-contribution-workflows.md +++ b/tutorials/create-python-server-tutorial/07-quality-security-and-contribution-workflows.md @@ -31,8 +31,6 @@ You now have a governance model for secure and maintainable scaffold-derived pro Next: [Chapter 8: Archived Status, Migration, and Long-Term Operations](08-archived-status-migration-and-long-term-operations.md) -## Depth Expansion Playbook - ## Source Code Walkthrough ### `src/create_mcp_server/__init__.py` diff --git a/tutorials/create-python-server-tutorial/08-archived-status-migration-and-long-term-operations.md b/tutorials/create-python-server-tutorial/08-archived-status-migration-and-long-term-operations.md index c0dd8dd..1804050 100644 --- a/tutorials/create-python-server-tutorial/08-archived-status-migration-and-long-term-operations.md +++ b/tutorials/create-python-server-tutorial/08-archived-status-migration-and-long-term-operations.md @@ -41,8 +41,6 @@ You now have a long-term operating model for scaffold-derived Python MCP service Return to the [Create Python Server Tutorial index](README.md). -## Depth Expansion Playbook - ## Source Code Walkthrough ### `src/create_mcp_server/__init__.py` diff --git a/tutorials/create-typescript-server-tutorial/01-getting-started-and-scaffolding-flow.md b/tutorials/create-typescript-server-tutorial/01-getting-started-and-scaffolding-flow.md index 9c0c558..31dd12a 100644 --- a/tutorials/create-typescript-server-tutorial/01-getting-started-and-scaffolding-flow.md +++ b/tutorials/create-typescript-server-tutorial/01-getting-started-and-scaffolding-flow.md @@ -38,8 +38,6 @@ You now have a reliable baseline for generating TypeScript MCP servers. Next: [Chapter 2: Generated Structure and Build Pipeline](02-generated-structure-and-build-pipeline.md) -## Depth Expansion Playbook - ## Source Code Walkthrough ### `src/index.ts` diff --git a/tutorials/create-typescript-server-tutorial/02-generated-structure-and-build-pipeline.md b/tutorials/create-typescript-server-tutorial/02-generated-structure-and-build-pipeline.md index 8472cb8..f841622 100644 --- a/tutorials/create-typescript-server-tutorial/02-generated-structure-and-build-pipeline.md +++ b/tutorials/create-typescript-server-tutorial/02-generated-structure-and-build-pipeline.md @@ -31,8 +31,6 @@ You now have structural and build-level orientation for generated projects. Next: [Chapter 3: Template MCP Primitives: Resources, Tools, Prompts](03-template-mcp-primitives-resources-tools-prompts.md) -## Depth Expansion Playbook - ## Source Code Walkthrough ### `src/index.ts` diff --git a/tutorials/create-typescript-server-tutorial/03-template-mcp-primitives-resources-tools-prompts.md b/tutorials/create-typescript-server-tutorial/03-template-mcp-primitives-resources-tools-prompts.md index 91df0b3..d9bc0f2 100644 --- a/tutorials/create-typescript-server-tutorial/03-template-mcp-primitives-resources-tools-prompts.md +++ b/tutorials/create-typescript-server-tutorial/03-template-mcp-primitives-resources-tools-prompts.md @@ -31,8 +31,6 @@ You now have a primitive-level model for evolving generated TypeScript server co Next: [Chapter 4: Configuration, Metadata, and Packaging](04-configuration-metadata-and-packaging.md) -## Depth Expansion Playbook - ## Source Code Walkthrough ### `src/index.ts` diff --git a/tutorials/create-typescript-server-tutorial/04-configuration-metadata-and-packaging.md b/tutorials/create-typescript-server-tutorial/04-configuration-metadata-and-packaging.md index 4bf9c11..437d3f9 100644 --- a/tutorials/create-typescript-server-tutorial/04-configuration-metadata-and-packaging.md +++ b/tutorials/create-typescript-server-tutorial/04-configuration-metadata-and-packaging.md @@ -31,54 +31,8 @@ You now have a packaging and metadata strategy for generated MCP TypeScript serv Next: [Chapter 5: Development Workflows: Build, Watch, and Link](05-development-workflows-build-watch-and-link.md) -## Depth Expansion Playbook - ## Source Code Walkthrough -### `package.json` - -The `package` module in [`package.json`](https://github.com/modelcontextprotocol/create-typescript-server/blob/HEAD/package.json) handles a key part of this chapter's functionality: - -```json -{ - "name": "@modelcontextprotocol/create-server", - "version": "0.3.1", - "description": "CLI tool to create new MCP servers", - "license": "MIT", - "author": "Anthropic, PBC (https://anthropic.com)", - "homepage": "https://modelcontextprotocol.io", - "bugs": "https://github.com/modelcontextprotocol/create-typescript-server/issues", - "type": "module", - "bin": { - "create-mcp-server": "build/index.js" - }, - "files": [ - "build", - "template" - ], - "scripts": { - "build": "tsc && shx chmod +x build/index.js", - "prepare": "npm run build", - "watch": "tsc --watch" - }, - "dependencies": { - "@modelcontextprotocol/sdk": "0.6.0", - "chalk": "^5.3.0", - "commander": "^12.0.0", - "ejs": "^3.1.9", - "inquirer": "^9.2.15", - "ora": "^8.0.1" - }, - "devDependencies": { - "@types/ejs": "^3.1.5", - "@types/inquirer": "^9.0.7", - "@types/node": "^20.11.24", - "shx": "^0.3.4", - "typescript": "^5.3.3" -``` - -This module is important because it defines how Create TypeScript Server Tutorial: Scaffold MCP Servers with TypeScript Templates implements the patterns covered in this chapter. - ### `src/index.ts` The `index` module in [`src/index.ts`](https://github.com/modelcontextprotocol/create-typescript-server/blob/HEAD/src/index.ts) handles a key part of this chapter's functionality: @@ -123,9 +77,9 @@ async function updateClaudeConfig(name: string, directory: string) { This module is important because it defines how Create TypeScript Server Tutorial: Scaffold MCP Servers with TypeScript Templates implements the patterns covered in this chapter. -### `template/tsconfig.json` +### `tsconfig.json` -The `tsconfig` module in [`template/tsconfig.json`](https://github.com/modelcontextprotocol/create-typescript-server/blob/HEAD/template/tsconfig.json) handles a key part of this chapter's functionality: +The `tsconfig` module in [`tsconfig.json`](https://github.com/modelcontextprotocol/create-typescript-server/blob/HEAD/tsconfig.json) handles a key part of this chapter's functionality: ```json { @@ -138,24 +92,69 @@ The `tsconfig` module in [`template/tsconfig.json`](https://github.com/modelcont "strict": true, "esModuleInterop": true, "skipLibCheck": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "resolveJsonModule": true }, "include": ["src/**/*"], - "exclude": ["node_modules"] + "exclude": ["node_modules", "**/*.spec.ts"] } ``` This module is important because it defines how Create TypeScript Server Tutorial: Scaffold MCP Servers with TypeScript Templates implements the patterns covered in this chapter. +### `package.json` + +The `package` module in [`package.json`](https://github.com/modelcontextprotocol/create-typescript-server/blob/HEAD/package.json) handles a key part of this chapter's functionality: + +```json +{ + "name": "@modelcontextprotocol/create-server", + "version": "0.3.1", + "description": "CLI tool to create new MCP servers", + "license": "MIT", + "author": "Anthropic, PBC (https://anthropic.com)", + "homepage": "https://modelcontextprotocol.io", + "bugs": "https://github.com/modelcontextprotocol/create-typescript-server/issues", + "type": "module", + "bin": { + "create-mcp-server": "build/index.js" + }, + "files": [ + "build", + "template" + ], + "scripts": { + "build": "tsc && shx chmod +x build/index.js", + "prepare": "npm run build", + "watch": "tsc --watch" + }, + "dependencies": { + "@modelcontextprotocol/sdk": "0.6.0", + "chalk": "^5.3.0", + "commander": "^12.0.0", + "ejs": "^3.1.9", + "inquirer": "^9.2.15", + "ora": "^8.0.1" + }, + "devDependencies": { + "@types/ejs": "^3.1.5", + "@types/inquirer": "^9.0.7", + "@types/node": "^20.11.24", + "shx": "^0.3.4", + "typescript": "^5.3.3" +``` + +This module is important because it defines how Create TypeScript Server Tutorial: Scaffold MCP Servers with TypeScript Templates implements the patterns covered in this chapter. + ## How These Components Connect ```mermaid flowchart TD - A[package] - B[index] - C[tsconfig] + A[index] + B[tsconfig] + C[package] A --> B B --> C ``` diff --git a/tutorials/create-typescript-server-tutorial/05-development-workflows-build-watch-and-link.md b/tutorials/create-typescript-server-tutorial/05-development-workflows-build-watch-and-link.md index b62e050..87c36d4 100644 --- a/tutorials/create-typescript-server-tutorial/05-development-workflows-build-watch-and-link.md +++ b/tutorials/create-typescript-server-tutorial/05-development-workflows-build-watch-and-link.md @@ -37,54 +37,8 @@ You now have a repeatable development loop for generated server projects. Next: [Chapter 6: Debugging and Local Integration](06-debugging-and-local-integration.md) -## Depth Expansion Playbook - ## Source Code Walkthrough -### `package.json` - -The `package` module in [`package.json`](https://github.com/modelcontextprotocol/create-typescript-server/blob/HEAD/package.json) handles a key part of this chapter's functionality: - -```json -{ - "name": "@modelcontextprotocol/create-server", - "version": "0.3.1", - "description": "CLI tool to create new MCP servers", - "license": "MIT", - "author": "Anthropic, PBC (https://anthropic.com)", - "homepage": "https://modelcontextprotocol.io", - "bugs": "https://github.com/modelcontextprotocol/create-typescript-server/issues", - "type": "module", - "bin": { - "create-mcp-server": "build/index.js" - }, - "files": [ - "build", - "template" - ], - "scripts": { - "build": "tsc && shx chmod +x build/index.js", - "prepare": "npm run build", - "watch": "tsc --watch" - }, - "dependencies": { - "@modelcontextprotocol/sdk": "0.6.0", - "chalk": "^5.3.0", - "commander": "^12.0.0", - "ejs": "^3.1.9", - "inquirer": "^9.2.15", - "ora": "^8.0.1" - }, - "devDependencies": { - "@types/ejs": "^3.1.5", - "@types/inquirer": "^9.0.7", - "@types/node": "^20.11.24", - "shx": "^0.3.4", - "typescript": "^5.3.3" -``` - -This module is important because it defines how Create TypeScript Server Tutorial: Scaffold MCP Servers with TypeScript Templates implements the patterns covered in this chapter. - ### `src/index.ts` The `index` module in [`src/index.ts`](https://github.com/modelcontextprotocol/create-typescript-server/blob/HEAD/src/index.ts) handles a key part of this chapter's functionality: @@ -129,9 +83,9 @@ async function updateClaudeConfig(name: string, directory: string) { This module is important because it defines how Create TypeScript Server Tutorial: Scaffold MCP Servers with TypeScript Templates implements the patterns covered in this chapter. -### `template/tsconfig.json` +### `tsconfig.json` -The `tsconfig` module in [`template/tsconfig.json`](https://github.com/modelcontextprotocol/create-typescript-server/blob/HEAD/template/tsconfig.json) handles a key part of this chapter's functionality: +The `tsconfig` module in [`tsconfig.json`](https://github.com/modelcontextprotocol/create-typescript-server/blob/HEAD/tsconfig.json) handles a key part of this chapter's functionality: ```json { @@ -144,24 +98,69 @@ The `tsconfig` module in [`template/tsconfig.json`](https://github.com/modelcont "strict": true, "esModuleInterop": true, "skipLibCheck": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "resolveJsonModule": true }, "include": ["src/**/*"], - "exclude": ["node_modules"] + "exclude": ["node_modules", "**/*.spec.ts"] } ``` This module is important because it defines how Create TypeScript Server Tutorial: Scaffold MCP Servers with TypeScript Templates implements the patterns covered in this chapter. +### `package.json` + +The `package` module in [`package.json`](https://github.com/modelcontextprotocol/create-typescript-server/blob/HEAD/package.json) handles a key part of this chapter's functionality: + +```json +{ + "name": "@modelcontextprotocol/create-server", + "version": "0.3.1", + "description": "CLI tool to create new MCP servers", + "license": "MIT", + "author": "Anthropic, PBC (https://anthropic.com)", + "homepage": "https://modelcontextprotocol.io", + "bugs": "https://github.com/modelcontextprotocol/create-typescript-server/issues", + "type": "module", + "bin": { + "create-mcp-server": "build/index.js" + }, + "files": [ + "build", + "template" + ], + "scripts": { + "build": "tsc && shx chmod +x build/index.js", + "prepare": "npm run build", + "watch": "tsc --watch" + }, + "dependencies": { + "@modelcontextprotocol/sdk": "0.6.0", + "chalk": "^5.3.0", + "commander": "^12.0.0", + "ejs": "^3.1.9", + "inquirer": "^9.2.15", + "ora": "^8.0.1" + }, + "devDependencies": { + "@types/ejs": "^3.1.5", + "@types/inquirer": "^9.0.7", + "@types/node": "^20.11.24", + "shx": "^0.3.4", + "typescript": "^5.3.3" +``` + +This module is important because it defines how Create TypeScript Server Tutorial: Scaffold MCP Servers with TypeScript Templates implements the patterns covered in this chapter. + ## How These Components Connect ```mermaid flowchart TD - A[package] - B[index] - C[tsconfig] + A[index] + B[tsconfig] + C[package] A --> B B --> C ``` diff --git a/tutorials/create-typescript-server-tutorial/06-debugging-and-local-integration.md b/tutorials/create-typescript-server-tutorial/06-debugging-and-local-integration.md index c91c9d1..6e0859b 100644 --- a/tutorials/create-typescript-server-tutorial/06-debugging-and-local-integration.md +++ b/tutorials/create-typescript-server-tutorial/06-debugging-and-local-integration.md @@ -31,54 +31,8 @@ You now have a debugging and local-validation strategy for scaffolded TypeScript Next: [Chapter 7: Quality, Security, and Contribution Practices](07-quality-security-and-contribution-practices.md) -## Depth Expansion Playbook - ## Source Code Walkthrough -### `package.json` - -The `package` module in [`package.json`](https://github.com/modelcontextprotocol/create-typescript-server/blob/HEAD/package.json) handles a key part of this chapter's functionality: - -```json -{ - "name": "@modelcontextprotocol/create-server", - "version": "0.3.1", - "description": "CLI tool to create new MCP servers", - "license": "MIT", - "author": "Anthropic, PBC (https://anthropic.com)", - "homepage": "https://modelcontextprotocol.io", - "bugs": "https://github.com/modelcontextprotocol/create-typescript-server/issues", - "type": "module", - "bin": { - "create-mcp-server": "build/index.js" - }, - "files": [ - "build", - "template" - ], - "scripts": { - "build": "tsc && shx chmod +x build/index.js", - "prepare": "npm run build", - "watch": "tsc --watch" - }, - "dependencies": { - "@modelcontextprotocol/sdk": "0.6.0", - "chalk": "^5.3.0", - "commander": "^12.0.0", - "ejs": "^3.1.9", - "inquirer": "^9.2.15", - "ora": "^8.0.1" - }, - "devDependencies": { - "@types/ejs": "^3.1.5", - "@types/inquirer": "^9.0.7", - "@types/node": "^20.11.24", - "shx": "^0.3.4", - "typescript": "^5.3.3" -``` - -This module is important because it defines how Create TypeScript Server Tutorial: Scaffold MCP Servers with TypeScript Templates implements the patterns covered in this chapter. - ### `src/index.ts` The `index` module in [`src/index.ts`](https://github.com/modelcontextprotocol/create-typescript-server/blob/HEAD/src/index.ts) handles a key part of this chapter's functionality: @@ -123,9 +77,9 @@ async function updateClaudeConfig(name: string, directory: string) { This module is important because it defines how Create TypeScript Server Tutorial: Scaffold MCP Servers with TypeScript Templates implements the patterns covered in this chapter. -### `template/tsconfig.json` +### `tsconfig.json` -The `tsconfig` module in [`template/tsconfig.json`](https://github.com/modelcontextprotocol/create-typescript-server/blob/HEAD/template/tsconfig.json) handles a key part of this chapter's functionality: +The `tsconfig` module in [`tsconfig.json`](https://github.com/modelcontextprotocol/create-typescript-server/blob/HEAD/tsconfig.json) handles a key part of this chapter's functionality: ```json { @@ -138,24 +92,69 @@ The `tsconfig` module in [`template/tsconfig.json`](https://github.com/modelcont "strict": true, "esModuleInterop": true, "skipLibCheck": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "resolveJsonModule": true }, "include": ["src/**/*"], - "exclude": ["node_modules"] + "exclude": ["node_modules", "**/*.spec.ts"] } ``` This module is important because it defines how Create TypeScript Server Tutorial: Scaffold MCP Servers with TypeScript Templates implements the patterns covered in this chapter. +### `package.json` + +The `package` module in [`package.json`](https://github.com/modelcontextprotocol/create-typescript-server/blob/HEAD/package.json) handles a key part of this chapter's functionality: + +```json +{ + "name": "@modelcontextprotocol/create-server", + "version": "0.3.1", + "description": "CLI tool to create new MCP servers", + "license": "MIT", + "author": "Anthropic, PBC (https://anthropic.com)", + "homepage": "https://modelcontextprotocol.io", + "bugs": "https://github.com/modelcontextprotocol/create-typescript-server/issues", + "type": "module", + "bin": { + "create-mcp-server": "build/index.js" + }, + "files": [ + "build", + "template" + ], + "scripts": { + "build": "tsc && shx chmod +x build/index.js", + "prepare": "npm run build", + "watch": "tsc --watch" + }, + "dependencies": { + "@modelcontextprotocol/sdk": "0.6.0", + "chalk": "^5.3.0", + "commander": "^12.0.0", + "ejs": "^3.1.9", + "inquirer": "^9.2.15", + "ora": "^8.0.1" + }, + "devDependencies": { + "@types/ejs": "^3.1.5", + "@types/inquirer": "^9.0.7", + "@types/node": "^20.11.24", + "shx": "^0.3.4", + "typescript": "^5.3.3" +``` + +This module is important because it defines how Create TypeScript Server Tutorial: Scaffold MCP Servers with TypeScript Templates implements the patterns covered in this chapter. + ## How These Components Connect ```mermaid flowchart TD - A[package] - B[index] - C[tsconfig] + A[index] + B[tsconfig] + C[package] A --> B B --> C ``` diff --git a/tutorials/create-typescript-server-tutorial/07-quality-security-and-contribution-practices.md b/tutorials/create-typescript-server-tutorial/07-quality-security-and-contribution-practices.md index 397c442..7d7557f 100644 --- a/tutorials/create-typescript-server-tutorial/07-quality-security-and-contribution-practices.md +++ b/tutorials/create-typescript-server-tutorial/07-quality-security-and-contribution-practices.md @@ -31,54 +31,8 @@ You now have a governance baseline for secure and maintainable scaffold-derived Next: [Chapter 8: Archived Status, Migration, and Long-Term Strategy](08-archived-status-migration-and-long-term-strategy.md) -## Depth Expansion Playbook - ## Source Code Walkthrough -### `package.json` - -The `package` module in [`package.json`](https://github.com/modelcontextprotocol/create-typescript-server/blob/HEAD/package.json) handles a key part of this chapter's functionality: - -```json -{ - "name": "@modelcontextprotocol/create-server", - "version": "0.3.1", - "description": "CLI tool to create new MCP servers", - "license": "MIT", - "author": "Anthropic, PBC (https://anthropic.com)", - "homepage": "https://modelcontextprotocol.io", - "bugs": "https://github.com/modelcontextprotocol/create-typescript-server/issues", - "type": "module", - "bin": { - "create-mcp-server": "build/index.js" - }, - "files": [ - "build", - "template" - ], - "scripts": { - "build": "tsc && shx chmod +x build/index.js", - "prepare": "npm run build", - "watch": "tsc --watch" - }, - "dependencies": { - "@modelcontextprotocol/sdk": "0.6.0", - "chalk": "^5.3.0", - "commander": "^12.0.0", - "ejs": "^3.1.9", - "inquirer": "^9.2.15", - "ora": "^8.0.1" - }, - "devDependencies": { - "@types/ejs": "^3.1.5", - "@types/inquirer": "^9.0.7", - "@types/node": "^20.11.24", - "shx": "^0.3.4", - "typescript": "^5.3.3" -``` - -This module is important because it defines how Create TypeScript Server Tutorial: Scaffold MCP Servers with TypeScript Templates implements the patterns covered in this chapter. - ### `src/index.ts` The `index` module in [`src/index.ts`](https://github.com/modelcontextprotocol/create-typescript-server/blob/HEAD/src/index.ts) handles a key part of this chapter's functionality: @@ -123,9 +77,9 @@ async function updateClaudeConfig(name: string, directory: string) { This module is important because it defines how Create TypeScript Server Tutorial: Scaffold MCP Servers with TypeScript Templates implements the patterns covered in this chapter. -### `template/tsconfig.json` +### `tsconfig.json` -The `tsconfig` module in [`template/tsconfig.json`](https://github.com/modelcontextprotocol/create-typescript-server/blob/HEAD/template/tsconfig.json) handles a key part of this chapter's functionality: +The `tsconfig` module in [`tsconfig.json`](https://github.com/modelcontextprotocol/create-typescript-server/blob/HEAD/tsconfig.json) handles a key part of this chapter's functionality: ```json { @@ -138,24 +92,69 @@ The `tsconfig` module in [`template/tsconfig.json`](https://github.com/modelcont "strict": true, "esModuleInterop": true, "skipLibCheck": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "resolveJsonModule": true }, "include": ["src/**/*"], - "exclude": ["node_modules"] + "exclude": ["node_modules", "**/*.spec.ts"] } ``` This module is important because it defines how Create TypeScript Server Tutorial: Scaffold MCP Servers with TypeScript Templates implements the patterns covered in this chapter. +### `package.json` + +The `package` module in [`package.json`](https://github.com/modelcontextprotocol/create-typescript-server/blob/HEAD/package.json) handles a key part of this chapter's functionality: + +```json +{ + "name": "@modelcontextprotocol/create-server", + "version": "0.3.1", + "description": "CLI tool to create new MCP servers", + "license": "MIT", + "author": "Anthropic, PBC (https://anthropic.com)", + "homepage": "https://modelcontextprotocol.io", + "bugs": "https://github.com/modelcontextprotocol/create-typescript-server/issues", + "type": "module", + "bin": { + "create-mcp-server": "build/index.js" + }, + "files": [ + "build", + "template" + ], + "scripts": { + "build": "tsc && shx chmod +x build/index.js", + "prepare": "npm run build", + "watch": "tsc --watch" + }, + "dependencies": { + "@modelcontextprotocol/sdk": "0.6.0", + "chalk": "^5.3.0", + "commander": "^12.0.0", + "ejs": "^3.1.9", + "inquirer": "^9.2.15", + "ora": "^8.0.1" + }, + "devDependencies": { + "@types/ejs": "^3.1.5", + "@types/inquirer": "^9.0.7", + "@types/node": "^20.11.24", + "shx": "^0.3.4", + "typescript": "^5.3.3" +``` + +This module is important because it defines how Create TypeScript Server Tutorial: Scaffold MCP Servers with TypeScript Templates implements the patterns covered in this chapter. + ## How These Components Connect ```mermaid flowchart TD - A[package] - B[index] - C[tsconfig] + A[index] + B[tsconfig] + C[package] A --> B B --> C ``` diff --git a/tutorials/create-typescript-server-tutorial/08-archived-status-migration-and-long-term-strategy.md b/tutorials/create-typescript-server-tutorial/08-archived-status-migration-and-long-term-strategy.md index 594a564..7392b4b 100644 --- a/tutorials/create-typescript-server-tutorial/08-archived-status-migration-and-long-term-strategy.md +++ b/tutorials/create-typescript-server-tutorial/08-archived-status-migration-and-long-term-strategy.md @@ -41,54 +41,8 @@ You now have a pragmatic long-term strategy for scaffold-based TypeScript MCP se Return to the [Create TypeScript Server Tutorial index](README.md). -## Depth Expansion Playbook - ## Source Code Walkthrough -### `package.json` - -The `package` module in [`package.json`](https://github.com/modelcontextprotocol/create-typescript-server/blob/HEAD/package.json) handles a key part of this chapter's functionality: - -```json -{ - "name": "@modelcontextprotocol/create-server", - "version": "0.3.1", - "description": "CLI tool to create new MCP servers", - "license": "MIT", - "author": "Anthropic, PBC (https://anthropic.com)", - "homepage": "https://modelcontextprotocol.io", - "bugs": "https://github.com/modelcontextprotocol/create-typescript-server/issues", - "type": "module", - "bin": { - "create-mcp-server": "build/index.js" - }, - "files": [ - "build", - "template" - ], - "scripts": { - "build": "tsc && shx chmod +x build/index.js", - "prepare": "npm run build", - "watch": "tsc --watch" - }, - "dependencies": { - "@modelcontextprotocol/sdk": "0.6.0", - "chalk": "^5.3.0", - "commander": "^12.0.0", - "ejs": "^3.1.9", - "inquirer": "^9.2.15", - "ora": "^8.0.1" - }, - "devDependencies": { - "@types/ejs": "^3.1.5", - "@types/inquirer": "^9.0.7", - "@types/node": "^20.11.24", - "shx": "^0.3.4", - "typescript": "^5.3.3" -``` - -This module is important because it defines how Create TypeScript Server Tutorial: Scaffold MCP Servers with TypeScript Templates implements the patterns covered in this chapter. - ### `src/index.ts` The `index` module in [`src/index.ts`](https://github.com/modelcontextprotocol/create-typescript-server/blob/HEAD/src/index.ts) handles a key part of this chapter's functionality: @@ -133,9 +87,9 @@ async function updateClaudeConfig(name: string, directory: string) { This module is important because it defines how Create TypeScript Server Tutorial: Scaffold MCP Servers with TypeScript Templates implements the patterns covered in this chapter. -### `template/tsconfig.json` +### `tsconfig.json` -The `tsconfig` module in [`template/tsconfig.json`](https://github.com/modelcontextprotocol/create-typescript-server/blob/HEAD/template/tsconfig.json) handles a key part of this chapter's functionality: +The `tsconfig` module in [`tsconfig.json`](https://github.com/modelcontextprotocol/create-typescript-server/blob/HEAD/tsconfig.json) handles a key part of this chapter's functionality: ```json { @@ -148,24 +102,69 @@ The `tsconfig` module in [`template/tsconfig.json`](https://github.com/modelcont "strict": true, "esModuleInterop": true, "skipLibCheck": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "resolveJsonModule": true }, "include": ["src/**/*"], - "exclude": ["node_modules"] + "exclude": ["node_modules", "**/*.spec.ts"] } ``` This module is important because it defines how Create TypeScript Server Tutorial: Scaffold MCP Servers with TypeScript Templates implements the patterns covered in this chapter. +### `package.json` + +The `package` module in [`package.json`](https://github.com/modelcontextprotocol/create-typescript-server/blob/HEAD/package.json) handles a key part of this chapter's functionality: + +```json +{ + "name": "@modelcontextprotocol/create-server", + "version": "0.3.1", + "description": "CLI tool to create new MCP servers", + "license": "MIT", + "author": "Anthropic, PBC (https://anthropic.com)", + "homepage": "https://modelcontextprotocol.io", + "bugs": "https://github.com/modelcontextprotocol/create-typescript-server/issues", + "type": "module", + "bin": { + "create-mcp-server": "build/index.js" + }, + "files": [ + "build", + "template" + ], + "scripts": { + "build": "tsc && shx chmod +x build/index.js", + "prepare": "npm run build", + "watch": "tsc --watch" + }, + "dependencies": { + "@modelcontextprotocol/sdk": "0.6.0", + "chalk": "^5.3.0", + "commander": "^12.0.0", + "ejs": "^3.1.9", + "inquirer": "^9.2.15", + "ora": "^8.0.1" + }, + "devDependencies": { + "@types/ejs": "^3.1.5", + "@types/inquirer": "^9.0.7", + "@types/node": "^20.11.24", + "shx": "^0.3.4", + "typescript": "^5.3.3" +``` + +This module is important because it defines how Create TypeScript Server Tutorial: Scaffold MCP Servers with TypeScript Templates implements the patterns covered in this chapter. + ## How These Components Connect ```mermaid flowchart TD - A[package] - B[index] - C[tsconfig] + A[index] + B[tsconfig] + C[package] A --> B B --> C ``` diff --git a/tutorials/firecrawl-mcp-server-tutorial/01-getting-started-and-core-setup.md b/tutorials/firecrawl-mcp-server-tutorial/01-getting-started-and-core-setup.md index 5211012..9cd5166 100644 --- a/tutorials/firecrawl-mcp-server-tutorial/01-getting-started-and-core-setup.md +++ b/tutorials/firecrawl-mcp-server-tutorial/01-getting-started-and-core-setup.md @@ -42,8 +42,6 @@ You now have a working Firecrawl MCP baseline. Next: [Chapter 2: Architecture, Transports, and Versioning](02-architecture-transports-and-versioning.md) -## Depth Expansion Playbook - ## Source Code Walkthrough ### `src/types/fastmcp.d.ts` diff --git a/tutorials/firecrawl-mcp-server-tutorial/02-architecture-transports-and-versioning.md b/tutorials/firecrawl-mcp-server-tutorial/02-architecture-transports-and-versioning.md index f3138a5..48992dd 100644 --- a/tutorials/firecrawl-mcp-server-tutorial/02-architecture-transports-and-versioning.md +++ b/tutorials/firecrawl-mcp-server-tutorial/02-architecture-transports-and-versioning.md @@ -43,8 +43,6 @@ You now understand the transport and version boundaries that shape deployment ar Next: [Chapter 3: Tool Selection: Scrape, Map, Crawl, Search, Extract](03-tool-selection-scrape-map-crawl-search-extract.md) -## Depth Expansion Playbook - ## Source Code Walkthrough ### `src/types/fastmcp.d.ts` diff --git a/tutorials/firecrawl-mcp-server-tutorial/03-tool-selection-scrape-map-crawl-search-extract.md b/tutorials/firecrawl-mcp-server-tutorial/03-tool-selection-scrape-map-crawl-search-extract.md index 13a564c..3bb18e9 100644 --- a/tutorials/firecrawl-mcp-server-tutorial/03-tool-selection-scrape-map-crawl-search-extract.md +++ b/tutorials/firecrawl-mcp-server-tutorial/03-tool-selection-scrape-map-crawl-search-extract.md @@ -40,8 +40,6 @@ You now have a decision framework for tool selection that balances depth, cost, Next: [Chapter 4: Client Integrations: Cursor, Claude, Windsurf, VS Code](04-client-integrations-cursor-claude-windsurf-vscode.md) -## Depth Expansion Playbook - ## Source Code Walkthrough ### `src/types/fastmcp.d.ts` diff --git a/tutorials/firecrawl-mcp-server-tutorial/04-client-integrations-cursor-claude-windsurf-vscode.md b/tutorials/firecrawl-mcp-server-tutorial/04-client-integrations-cursor-claude-windsurf-vscode.md index e843f47..e70cfa0 100644 --- a/tutorials/firecrawl-mcp-server-tutorial/04-client-integrations-cursor-claude-windsurf-vscode.md +++ b/tutorials/firecrawl-mcp-server-tutorial/04-client-integrations-cursor-claude-windsurf-vscode.md @@ -38,8 +38,6 @@ You now have a cross-client setup model for consistent Firecrawl MCP usage. Next: [Chapter 5: Configuration, Retries, and Credit Monitoring](05-configuration-retries-and-credit-monitoring.md) -## Depth Expansion Playbook - ## Source Code Walkthrough ### `src/index.ts` diff --git a/tutorials/firecrawl-mcp-server-tutorial/05-configuration-retries-and-credit-monitoring.md b/tutorials/firecrawl-mcp-server-tutorial/05-configuration-retries-and-credit-monitoring.md index e05125f..bb3c735 100644 --- a/tutorials/firecrawl-mcp-server-tutorial/05-configuration-retries-and-credit-monitoring.md +++ b/tutorials/firecrawl-mcp-server-tutorial/05-configuration-retries-and-credit-monitoring.md @@ -39,8 +39,6 @@ You now know which controls matter most for resilient Firecrawl MCP operations. Next: [Chapter 6: Batch Workflows, Deep Research, and API Evolution](06-batch-workflows-deep-research-and-api-evolution.md) -## Depth Expansion Playbook - ## Source Code Walkthrough ### `src/index.ts` diff --git a/tutorials/firecrawl-mcp-server-tutorial/06-batch-workflows-deep-research-and-api-evolution.md b/tutorials/firecrawl-mcp-server-tutorial/06-batch-workflows-deep-research-and-api-evolution.md index 05b8f8c..1114e04 100644 --- a/tutorials/firecrawl-mcp-server-tutorial/06-batch-workflows-deep-research-and-api-evolution.md +++ b/tutorials/firecrawl-mcp-server-tutorial/06-batch-workflows-deep-research-and-api-evolution.md @@ -37,8 +37,6 @@ You now have a migration-aware perspective on batch and advanced Firecrawl MCP u Next: [Chapter 7: Reliability, Observability, and Failure Handling](07-reliability-observability-and-failure-handling.md) -## Depth Expansion Playbook - ## Source Code Walkthrough ### `src/index.ts` diff --git a/tutorials/firecrawl-mcp-server-tutorial/07-reliability-observability-and-failure-handling.md b/tutorials/firecrawl-mcp-server-tutorial/07-reliability-observability-and-failure-handling.md index dafb11a..e345cdf 100644 --- a/tutorials/firecrawl-mcp-server-tutorial/07-reliability-observability-and-failure-handling.md +++ b/tutorials/firecrawl-mcp-server-tutorial/07-reliability-observability-and-failure-handling.md @@ -37,8 +37,6 @@ You now have a reliability checklist for sustained Firecrawl MCP operations. Next: [Chapter 8: Security, Governance, and Contribution Workflow](08-security-governance-and-contribution-workflow.md) -## Depth Expansion Playbook - ## Source Code Walkthrough ### `src/index.ts` diff --git a/tutorials/firecrawl-mcp-server-tutorial/08-security-governance-and-contribution-workflow.md b/tutorials/firecrawl-mcp-server-tutorial/08-security-governance-and-contribution-workflow.md index 5eadbf2..225d118 100644 --- a/tutorials/firecrawl-mcp-server-tutorial/08-security-governance-and-contribution-workflow.md +++ b/tutorials/firecrawl-mcp-server-tutorial/08-security-governance-and-contribution-workflow.md @@ -39,8 +39,6 @@ You now have an end-to-end model for adopting and operating Firecrawl MCP Server Next: combine this with [MCP Chrome](../mcp-chrome-tutorial/) and [MCP Inspector](../mcp-inspector-tutorial/) for full browsing-data toolchains. -## Depth Expansion Playbook - ## Source Code Walkthrough ### `src/index.ts` diff --git a/tutorials/mcp-docs-repo-tutorial/01-getting-started-and-archive-context.md b/tutorials/mcp-docs-repo-tutorial/01-getting-started-and-archive-context.md index 0c12684..4629cce 100644 --- a/tutorials/mcp-docs-repo-tutorial/01-getting-started-and-archive-context.md +++ b/tutorials/mcp-docs-repo-tutorial/01-getting-started-and-archive-context.md @@ -31,8 +31,6 @@ You now have a clear scope boundary for using archived docs safely. Next: [Chapter 2: Repository Layout and Canonical Migration Path](02-repository-layout-and-canonical-migration-path.md) -## Depth Expansion Playbook - ## Source Code Walkthrough ### `docs.json` diff --git a/tutorials/mcp-docs-repo-tutorial/02-repository-layout-and-canonical-migration-path.md b/tutorials/mcp-docs-repo-tutorial/02-repository-layout-and-canonical-migration-path.md index 856af72..577f561 100644 --- a/tutorials/mcp-docs-repo-tutorial/02-repository-layout-and-canonical-migration-path.md +++ b/tutorials/mcp-docs-repo-tutorial/02-repository-layout-and-canonical-migration-path.md @@ -41,8 +41,6 @@ You now have a migration-aware map of archived docs content. Next: [Chapter 3: Quickstart Flows: User, Server, and Client](03-quickstart-flows-user-server-and-client.md) -## Depth Expansion Playbook - ## Source Code Walkthrough ### `docs.json` diff --git a/tutorials/mcp-docs-repo-tutorial/03-quickstart-flows-user-server-and-client.md b/tutorials/mcp-docs-repo-tutorial/03-quickstart-flows-user-server-and-client.md index 73602e7..04b7258 100644 --- a/tutorials/mcp-docs-repo-tutorial/03-quickstart-flows-user-server-and-client.md +++ b/tutorials/mcp-docs-repo-tutorial/03-quickstart-flows-user-server-and-client.md @@ -32,8 +32,6 @@ You now have a quickstart-oriented onboarding map for archived MCP docs. Next: [Chapter 4: Core Concepts: Architecture, Tools, Resources, Prompts](04-core-concepts-architecture-tools-resources-prompts.md) -## Depth Expansion Playbook - ## Source Code Walkthrough ### `docs.json` diff --git a/tutorials/mcp-docs-repo-tutorial/04-core-concepts-architecture-tools-resources-prompts.md b/tutorials/mcp-docs-repo-tutorial/04-core-concepts-architecture-tools-resources-prompts.md index f4a4fe8..6efcd69 100644 --- a/tutorials/mcp-docs-repo-tutorial/04-core-concepts-architecture-tools-resources-prompts.md +++ b/tutorials/mcp-docs-repo-tutorial/04-core-concepts-architecture-tools-resources-prompts.md @@ -33,8 +33,6 @@ You now have a concept-level baseline for MCP system reasoning. Next: [Chapter 5: Advanced Concepts: Transports, Sampling, and Roots](05-advanced-concepts-transports-sampling-and-roots.md) -## Depth Expansion Playbook - ## Source Code Walkthrough ### `docs.json` diff --git a/tutorials/mcp-docs-repo-tutorial/05-advanced-concepts-transports-sampling-and-roots.md b/tutorials/mcp-docs-repo-tutorial/05-advanced-concepts-transports-sampling-and-roots.md index 0146291..e6aeb0f 100644 --- a/tutorials/mcp-docs-repo-tutorial/05-advanced-concepts-transports-sampling-and-roots.md +++ b/tutorials/mcp-docs-repo-tutorial/05-advanced-concepts-transports-sampling-and-roots.md @@ -32,8 +32,6 @@ You now have an advanced concept map for transport and context-design decisions. Next: [Chapter 6: Tooling Docs: Inspector and Debugging](06-tooling-docs-inspector-and-debugging.md) -## Depth Expansion Playbook - ## Source Code Walkthrough ### `docs.json` diff --git a/tutorials/mcp-docs-repo-tutorial/06-tooling-docs-inspector-and-debugging.md b/tutorials/mcp-docs-repo-tutorial/06-tooling-docs-inspector-and-debugging.md index 79c04f4..2cf0622 100644 --- a/tutorials/mcp-docs-repo-tutorial/06-tooling-docs-inspector-and-debugging.md +++ b/tutorials/mcp-docs-repo-tutorial/06-tooling-docs-inspector-and-debugging.md @@ -31,8 +31,6 @@ You now have a tooling-oriented debugging model grounded in MCP documentation gu Next: [Chapter 7: Tutorial Assets and Client Ecosystem Matrix](07-tutorial-assets-and-client-ecosystem-matrix.md) -## Depth Expansion Playbook - ## Source Code Walkthrough ### `docs.json` diff --git a/tutorials/mcp-docs-repo-tutorial/07-tutorial-assets-and-client-ecosystem-matrix.md b/tutorials/mcp-docs-repo-tutorial/07-tutorial-assets-and-client-ecosystem-matrix.md index 64702c3..3bec71e 100644 --- a/tutorials/mcp-docs-repo-tutorial/07-tutorial-assets-and-client-ecosystem-matrix.md +++ b/tutorials/mcp-docs-repo-tutorial/07-tutorial-assets-and-client-ecosystem-matrix.md @@ -32,8 +32,6 @@ You now have a framework for using archived ecosystem docs in planning and valid Next: [Chapter 8: Contribution Governance and Documentation Operations](08-contribution-governance-and-documentation-operations.md) -## Depth Expansion Playbook - ## Source Code Walkthrough ### `docs.json` diff --git a/tutorials/mcp-docs-repo-tutorial/08-contribution-governance-and-documentation-operations.md b/tutorials/mcp-docs-repo-tutorial/08-contribution-governance-and-documentation-operations.md index 750548a..fd492d5 100644 --- a/tutorials/mcp-docs-repo-tutorial/08-contribution-governance-and-documentation-operations.md +++ b/tutorials/mcp-docs-repo-tutorial/08-contribution-governance-and-documentation-operations.md @@ -31,8 +31,6 @@ You now have a governance model for documentation operations across archived and Return to the [MCP Docs Repo Tutorial index](README.md). -## Depth Expansion Playbook - ## Source Code Walkthrough ### `docs.json` diff --git a/tutorials/mcp-typescript-sdk-tutorial/01-getting-started-and-package-model.md b/tutorials/mcp-typescript-sdk-tutorial/01-getting-started-and-package-model.md index 8676fb1..fef8b54 100644 --- a/tutorials/mcp-typescript-sdk-tutorial/01-getting-started-and-package-model.md +++ b/tutorials/mcp-typescript-sdk-tutorial/01-getting-started-and-package-model.md @@ -52,8 +52,6 @@ You now have a stable package and runtime baseline for SDK work. Next: [Chapter 2: Server Transports and Deployment Patterns](02-server-transports-and-deployment-patterns.md) -## Depth Expansion Playbook - ## Source Code Walkthrough ### `scripts/cli.ts` diff --git a/tutorials/mcp-typescript-sdk-tutorial/02-server-transports-and-deployment-patterns.md b/tutorials/mcp-typescript-sdk-tutorial/02-server-transports-and-deployment-patterns.md index 9b7868a..fcbd05e 100644 --- a/tutorials/mcp-typescript-sdk-tutorial/02-server-transports-and-deployment-patterns.md +++ b/tutorials/mcp-typescript-sdk-tutorial/02-server-transports-and-deployment-patterns.md @@ -46,8 +46,6 @@ You now have a transport-first architecture model for server implementation. Next: [Chapter 3: Client Transports, OAuth, and Backwards Compatibility](03-client-transports-oauth-and-backwards-compatibility.md) -## Depth Expansion Playbook - ## Source Code Walkthrough ### `scripts/cli.ts` diff --git a/tutorials/mcp-typescript-sdk-tutorial/03-client-transports-oauth-and-backwards-compatibility.md b/tutorials/mcp-typescript-sdk-tutorial/03-client-transports-oauth-and-backwards-compatibility.md index 70e39d3..7650f53 100644 --- a/tutorials/mcp-typescript-sdk-tutorial/03-client-transports-oauth-and-backwards-compatibility.md +++ b/tutorials/mcp-typescript-sdk-tutorial/03-client-transports-oauth-and-backwards-compatibility.md @@ -39,8 +39,6 @@ You now have a stronger strategy for client transport and auth compatibility. Next: [Chapter 4: Tool, Resource, Prompt Design and Completions](04-tool-resource-prompt-design-and-completions.md) -## Depth Expansion Playbook - ## Source Code Walkthrough ### `scripts/sync-snippets.ts` diff --git a/tutorials/mcp-typescript-sdk-tutorial/04-tool-resource-prompt-design-and-completions.md b/tutorials/mcp-typescript-sdk-tutorial/04-tool-resource-prompt-design-and-completions.md index c37e109..8da1223 100644 --- a/tutorials/mcp-typescript-sdk-tutorial/04-tool-resource-prompt-design-and-completions.md +++ b/tutorials/mcp-typescript-sdk-tutorial/04-tool-resource-prompt-design-and-completions.md @@ -40,8 +40,6 @@ You now have clearer interface design standards for MCP server surfaces. Next: [Chapter 5: Sampling, Elicitation, and Experimental Tasks](05-sampling-elicitation-and-experimental-tasks.md) -## Depth Expansion Playbook - ## Source Code Walkthrough ### `scripts/sync-snippets.ts` diff --git a/tutorials/mcp-typescript-sdk-tutorial/05-sampling-elicitation-and-experimental-tasks.md b/tutorials/mcp-typescript-sdk-tutorial/05-sampling-elicitation-and-experimental-tasks.md index 9670204..5931112 100644 --- a/tutorials/mcp-typescript-sdk-tutorial/05-sampling-elicitation-and-experimental-tasks.md +++ b/tutorials/mcp-typescript-sdk-tutorial/05-sampling-elicitation-and-experimental-tasks.md @@ -39,8 +39,6 @@ You now understand when and how to use advanced capability flows without overexp Next: [Chapter 6: Middleware, Security, and Host Validation](06-middleware-security-and-host-validation.md) -## Depth Expansion Playbook - ## Source Code Walkthrough ### `scripts/sync-snippets.ts` diff --git a/tutorials/mcp-typescript-sdk-tutorial/06-middleware-security-and-host-validation.md b/tutorials/mcp-typescript-sdk-tutorial/06-middleware-security-and-host-validation.md index 825c1b1..10f751e 100644 --- a/tutorials/mcp-typescript-sdk-tutorial/06-middleware-security-and-host-validation.md +++ b/tutorials/mcp-typescript-sdk-tutorial/06-middleware-security-and-host-validation.md @@ -41,8 +41,6 @@ You now have concrete controls for hardening local and remote server exposure. Next: [Chapter 7: v1 to v2 Migration Strategy](07-v1-to-v2-migration-strategy.md) -## Depth Expansion Playbook - ## Source Code Walkthrough ### `scripts/sync-snippets.ts` diff --git a/tutorials/mcp-typescript-sdk-tutorial/07-v1-to-v2-migration-strategy.md b/tutorials/mcp-typescript-sdk-tutorial/07-v1-to-v2-migration-strategy.md index 4dec5c3..beeb2ed 100644 --- a/tutorials/mcp-typescript-sdk-tutorial/07-v1-to-v2-migration-strategy.md +++ b/tutorials/mcp-typescript-sdk-tutorial/07-v1-to-v2-migration-strategy.md @@ -40,8 +40,6 @@ You now have a phased migration plan that reduces production breakage risk. Next: [Chapter 8: Conformance Testing and Contribution Workflows](08-conformance-testing-and-contribution-workflows.md) -## Depth Expansion Playbook - ## Source Code Walkthrough ### `scripts/sync-snippets.ts` diff --git a/tutorials/mcp-typescript-sdk-tutorial/08-conformance-testing-and-contribution-workflows.md b/tutorials/mcp-typescript-sdk-tutorial/08-conformance-testing-and-contribution-workflows.md index dd79c7a..fa450f1 100644 --- a/tutorials/mcp-typescript-sdk-tutorial/08-conformance-testing-and-contribution-workflows.md +++ b/tutorials/mcp-typescript-sdk-tutorial/08-conformance-testing-and-contribution-workflows.md @@ -39,8 +39,6 @@ You now have a production-aligned approach for maintaining and extending MCP Typ Next: Continue with [MCP Use Tutorial](../mcp-use-tutorial/) -## Depth Expansion Playbook - ## Source Code Walkthrough ### `scripts/sync-snippets.ts` diff --git a/tutorials/playwright-mcp-tutorial/01-getting-started.md b/tutorials/playwright-mcp-tutorial/01-getting-started.md index 0ae9b99..85dcd36 100644 --- a/tutorials/playwright-mcp-tutorial/01-getting-started.md +++ b/tutorials/playwright-mcp-tutorial/01-getting-started.md @@ -50,88 +50,86 @@ You now have Playwright MCP connected and executing basic browser tasks. Next: [Chapter 2: Operating Model: Accessibility Snapshots](02-operating-model-accessibility-snapshots.md) -## Depth Expansion Playbook - ## Source Code Walkthrough -### `roll.js` +### `packages/playwright-mcp/update-readme.js` -The `copyConfig` function in [`roll.js`](https://github.com/microsoft/playwright-mcp/blob/HEAD/roll.js) handles a key part of this chapter's functionality: +The `capabilityTitle` function in [`packages/playwright-mcp/update-readme.js`](https://github.com/microsoft/playwright-mcp/blob/HEAD/packages/playwright-mcp/update-readme.js) handles a key part of this chapter's functionality: ```js -const { execSync } = require('child_process'); - -function copyConfig() { - const src = path.join(__dirname, '..', 'playwright', 'packages', 'playwright-core', 'src', 'tools', 'mcp', 'config.d.ts'); - const dst = path.join(__dirname, 'packages', 'playwright-mcp', 'config.d.ts'); - let content = fs.readFileSync(src, 'utf-8'); - content = content.replace( - "import type * as playwright from 'playwright-core';", - "import type * as playwright from 'playwright';" - ); - fs.writeFileSync(dst, content); - console.log(`Copied config.d.ts from ${src} to ${dst}`); +const toolsByCapability = {}; +for (const capability of Object.keys(capabilities)) { + const title = capabilityTitle(capability); + let tools = browserTools.filter(tool => tool.capability === capability && !tool.skillOnly); + tools = (toolsByCapability[title] || []).concat(tools); + toolsByCapability[title] = tools; +} +for (const [, tools] of Object.entries(toolsByCapability)) + tools.sort((a, b) => a.schema.name.localeCompare(b.schema.name)); + +/** + * @param {string} capability + * @returns {string} + */ +function capabilityTitle(capability) { + const title = capabilities[capability]; + return capability.startsWith('core') ? title : `${title} (opt-in via --caps=${capability})`; } -function updatePlaywrightVersion(version) { - const packagesDir = path.join(__dirname, 'packages'); - const files = [path.join(__dirname, 'package.json')]; - for (const entry of fs.readdirSync(packagesDir, { withFileTypes: true })) { - const pkgJson = path.join(packagesDir, entry.name, 'package.json'); - if (fs.existsSync(pkgJson)) - files.push(pkgJson); - } - - for (const file of files) { - const json = JSON.parse(fs.readFileSync(file, 'utf-8')); - let updated = false; - for (const section of ['dependencies', 'devDependencies']) { - for (const pkg of ['@playwright/test', 'playwright', 'playwright-core']) { - if (json[section]?.[pkg]) { - json[section][pkg] = version; - updated = true; - } +/** + * @param {any} tool + * @returns {string[]} + */ +function formatToolForReadme(tool) { + const lines = /** @type {string[]} */ ([]); + lines.push(``); + lines.push(``); + lines.push(`- **${tool.name}**`); + lines.push(` - Title: ${tool.title}`); + lines.push(` - Description: ${tool.description}`); + + const inputSchema = /** @type {any} */ (tool.inputSchema ? tool.inputSchema.toJSONSchema() : {}); ``` This function is important because it defines how Playwright MCP Tutorial: Browser Automation for Coding Agents Through MCP implements the patterns covered in this chapter. -### `roll.js` +### `packages/playwright-mcp/update-readme.js` -The `updatePlaywrightVersion` function in [`roll.js`](https://github.com/microsoft/playwright-mcp/blob/HEAD/roll.js) handles a key part of this chapter's functionality: +The `formatToolForReadme` function in [`packages/playwright-mcp/update-readme.js`](https://github.com/microsoft/playwright-mcp/blob/HEAD/packages/playwright-mcp/update-readme.js) handles a key part of this chapter's functionality: ```js -} - -function updatePlaywrightVersion(version) { - const packagesDir = path.join(__dirname, 'packages'); - const files = [path.join(__dirname, 'package.json')]; - for (const entry of fs.readdirSync(packagesDir, { withFileTypes: true })) { - const pkgJson = path.join(packagesDir, entry.name, 'package.json'); - if (fs.existsSync(pkgJson)) - files.push(pkgJson); + * @returns {string[]} + */ +function formatToolForReadme(tool) { + const lines = /** @type {string[]} */ ([]); + lines.push(``); + lines.push(``); + lines.push(`- **${tool.name}**`); + lines.push(` - Title: ${tool.title}`); + lines.push(` - Description: ${tool.description}`); + + const inputSchema = /** @type {any} */ (tool.inputSchema ? tool.inputSchema.toJSONSchema() : {}); + const requiredParams = inputSchema.required || []; + if (inputSchema.properties && Object.keys(inputSchema.properties).length) { + lines.push(` - Parameters:`); + Object.entries(inputSchema.properties).forEach(([name, param]) => { + const optional = !requiredParams.includes(name); + const meta = /** @type {string[]} */ ([]); + if (param.type) + meta.push(param.type); + if (optional) + meta.push('optional'); + lines.push(` - \`${name}\` ${meta.length ? `(${meta.join(', ')})` : ''}: ${param.description}`); + }); + } else { + lines.push(` - Parameters: None`); } - - for (const file of files) { - const json = JSON.parse(fs.readFileSync(file, 'utf-8')); - let updated = false; - for (const section of ['dependencies', 'devDependencies']) { - for (const pkg of ['@playwright/test', 'playwright', 'playwright-core']) { - if (json[section]?.[pkg]) { - json[section][pkg] = version; - updated = true; - } - } - } - if (updated) { - fs.writeFileSync(file, JSON.stringify(json, null, 2) + '\n'); - console.log(`Updated ${file}`); - } - } - - execSync('npm install', { cwd: __dirname, stdio: 'inherit' }); + lines.push(` - Read-only: **${tool.type === 'readOnly'}**`); + lines.push(''); + return lines; } -function doRoll(version) { +/** ``` This function is important because it defines how Playwright MCP Tutorial: Browser Automation for Coding Agents Through MCP implements the patterns covered in this chapter. @@ -141,7 +139,7 @@ This function is important because it defines how Playwright MCP Tutorial: Brows ```mermaid flowchart TD - A[copyConfig] - B[updatePlaywrightVersion] + A[capabilityTitle] + B[formatToolForReadme] A --> B ``` diff --git a/tutorials/playwright-mcp-tutorial/02-operating-model-accessibility-snapshots.md b/tutorials/playwright-mcp-tutorial/02-operating-model-accessibility-snapshots.md index 3575944..2952e53 100644 --- a/tutorials/playwright-mcp-tutorial/02-operating-model-accessibility-snapshots.md +++ b/tutorials/playwright-mcp-tutorial/02-operating-model-accessibility-snapshots.md @@ -43,72 +43,86 @@ You now have the core interaction model for deterministic browser automation. Next: [Chapter 3: Installation Across Host Clients](03-installation-across-host-clients.md) -## Depth Expansion Playbook - ## Source Code Walkthrough -### `roll.js` +### `packages/playwright-mcp/update-readme.js` -The `doRoll` function in [`roll.js`](https://github.com/microsoft/playwright-mcp/blob/HEAD/roll.js) handles a key part of this chapter's functionality: +The `updateSection` function in [`packages/playwright-mcp/update-readme.js`](https://github.com/microsoft/playwright-mcp/blob/HEAD/packages/playwright-mcp/update-readme.js) handles a key part of this chapter's functionality: ```js + * @returns {Promise} + */ +async function updateSection(content, startMarker, endMarker, generatedLines) { + const startMarkerIndex = content.indexOf(startMarker); + const endMarkerIndex = content.indexOf(endMarker); + if (startMarkerIndex === -1 || endMarkerIndex === -1) + throw new Error('Markers for generated section not found in README'); + + return [ + content.slice(0, startMarkerIndex + startMarker.length), + '', + generatedLines.join('\n'), + '', + content.slice(endMarkerIndex), + ].join('\n'); } -function doRoll(version) { - updatePlaywrightVersion(version); - copyConfig(); - // update readme - execSync('npm run lint', { cwd: __dirname, stdio: 'inherit' }); -} - -let version = process.argv[2]; -if (!version) { - version = execSync('npm info playwright@next version', { encoding: 'utf-8' }).trim(); - console.log(`Using next playwright version: ${version}`); -} -doRoll(version); - +/** + * @param {string} content + * @returns {Promise} + */ +async function updateTools(content) { + console.log('Loading tool information from compiled modules...'); + + const generatedLines = /** @type {string[]} */ ([]); + for (const [capability, tools] of Object.entries(toolsByCapability)) { + console.log('Updating tools for capability:', capability); + generatedLines.push(`
\n${capability}`); + generatedLines.push(''); + for (const tool of tools) + generatedLines.push(...formatToolForReadme(tool.schema)); + generatedLines.push(`
`); ``` This function is important because it defines how Playwright MCP Tutorial: Browser Automation for Coding Agents Through MCP implements the patterns covered in this chapter. ### `packages/playwright-mcp/update-readme.js` -The `capabilityTitle` function in [`packages/playwright-mcp/update-readme.js`](https://github.com/microsoft/playwright-mcp/blob/HEAD/packages/playwright-mcp/update-readme.js) handles a key part of this chapter's functionality: +The `updateTools` function in [`packages/playwright-mcp/update-readme.js`](https://github.com/microsoft/playwright-mcp/blob/HEAD/packages/playwright-mcp/update-readme.js) handles a key part of this chapter's functionality: ```js -const toolsByCapability = {}; -for (const capability of Object.keys(capabilities)) { - const title = capabilityTitle(capability); - let tools = browserTools.filter(tool => tool.capability === capability && !tool.skillOnly); - tools = (toolsByCapability[title] || []).concat(tools); - toolsByCapability[title] = tools; -} -for (const [, tools] of Object.entries(toolsByCapability)) - tools.sort((a, b) => a.schema.name.localeCompare(b.schema.name)); - -/** - * @param {string} capability - * @returns {string} + * @returns {Promise} */ -function capabilityTitle(capability) { - const title = capabilities[capability]; - return capability.startsWith('core') ? title : `${title} (opt-in via --caps=${capability})`; +async function updateTools(content) { + console.log('Loading tool information from compiled modules...'); + + const generatedLines = /** @type {string[]} */ ([]); + for (const [capability, tools] of Object.entries(toolsByCapability)) { + console.log('Updating tools for capability:', capability); + generatedLines.push(`
\n${capability}`); + generatedLines.push(''); + for (const tool of tools) + generatedLines.push(...formatToolForReadme(tool.schema)); + generatedLines.push(`
`); + generatedLines.push(''); + } + + const startMarker = ``; + const endMarker = ``; + return updateSection(content, startMarker, endMarker, generatedLines); } /** - * @param {any} tool - * @returns {string[]} + * @param {string} content + * @returns {Promise} */ -function formatToolForReadme(tool) { - const lines = /** @type {string[]} */ ([]); - lines.push(``); - lines.push(``); - lines.push(`- **${tool.name}**`); - lines.push(` - Title: ${tool.title}`); - lines.push(` - Description: ${tool.description}`); - - const inputSchema = /** @type {any} */ (tool.inputSchema ? tool.inputSchema.toJSONSchema() : {}); +async function updateOptions(content) { + console.log('Listing options...'); + execSync('node cli.js --help > help.txt'); + const output = fs.readFileSync('help.txt'); + fs.unlinkSync('help.txt'); + const lines = output.toString().split('\n'); + const firstLine = lines.findIndex(line => line.includes('--version')); ``` This function is important because it defines how Playwright MCP Tutorial: Browser Automation for Coding Agents Through MCP implements the patterns covered in this chapter. @@ -118,7 +132,7 @@ This function is important because it defines how Playwright MCP Tutorial: Brows ```mermaid flowchart TD - A[doRoll] - B[capabilityTitle] + A[updateSection] + B[updateTools] A --> B ``` diff --git a/tutorials/playwright-mcp-tutorial/03-installation-across-host-clients.md b/tutorials/playwright-mcp-tutorial/03-installation-across-host-clients.md index e1223f3..86dc37f 100644 --- a/tutorials/playwright-mcp-tutorial/03-installation-across-host-clients.md +++ b/tutorials/playwright-mcp-tutorial/03-installation-across-host-clients.md @@ -41,88 +41,86 @@ You now have a host-portable installation strategy for Playwright MCP. Next: [Chapter 4: Configuration, Capabilities, and Runtime Modes](04-configuration-capabilities-and-runtime-modes.md) -## Depth Expansion Playbook - ## Source Code Walkthrough ### `packages/playwright-mcp/update-readme.js` -The `formatToolForReadme` function in [`packages/playwright-mcp/update-readme.js`](https://github.com/microsoft/playwright-mcp/blob/HEAD/packages/playwright-mcp/update-readme.js) handles a key part of this chapter's functionality: +The `updateOptions` function in [`packages/playwright-mcp/update-readme.js`](https://github.com/microsoft/playwright-mcp/blob/HEAD/packages/playwright-mcp/update-readme.js) handles a key part of this chapter's functionality: ```js - * @returns {string[]} + * @returns {Promise} */ -function formatToolForReadme(tool) { - const lines = /** @type {string[]} */ ([]); - lines.push(``); - lines.push(``); - lines.push(`- **${tool.name}**`); - lines.push(` - Title: ${tool.title}`); - lines.push(` - Description: ${tool.description}`); - - const inputSchema = /** @type {any} */ (tool.inputSchema ? tool.inputSchema.toJSONSchema() : {}); - const requiredParams = inputSchema.required || []; - if (inputSchema.properties && Object.keys(inputSchema.properties).length) { - lines.push(` - Parameters:`); - Object.entries(inputSchema.properties).forEach(([name, param]) => { - const optional = !requiredParams.includes(name); - const meta = /** @type {string[]} */ ([]); - if (param.type) - meta.push(param.type); - if (optional) - meta.push('optional'); - lines.push(` - \`${name}\` ${meta.length ? `(${meta.join(', ')})` : ''}: ${param.description}`); - }); - } else { - lines.push(` - Parameters: None`); +async function updateOptions(content) { + console.log('Listing options...'); + execSync('node cli.js --help > help.txt'); + const output = fs.readFileSync('help.txt'); + fs.unlinkSync('help.txt'); + const lines = output.toString().split('\n'); + const firstLine = lines.findIndex(line => line.includes('--version')); + lines.splice(0, firstLine + 1); + const lastLine = lines.findIndex(line => line.includes('--help')); + lines.splice(lastLine); + + /** + * @type {{ name: string, value: string }[]} + */ + const options = []; + for (let line of lines) { + if (line.startsWith(' --')) { + const l = line.substring(' --'.length); + const gapIndex = l.indexOf(' '); + const name = l.substring(0, gapIndex).trim(); + const value = l.substring(gapIndex).trim(); + options.push({ name, value }); + } else { + const value = line.trim(); + options[options.length - 1].value += ' ' + value; + } } - lines.push(` - Read-only: **${tool.type === 'readOnly'}**`); - lines.push(''); - return lines; -} -/** + const table = []; + table.push(`| Option | Description |`); ``` This function is important because it defines how Playwright MCP Tutorial: Browser Automation for Coding Agents Through MCP implements the patterns covered in this chapter. ### `packages/playwright-mcp/update-readme.js` -The `updateSection` function in [`packages/playwright-mcp/update-readme.js`](https://github.com/microsoft/playwright-mcp/blob/HEAD/packages/playwright-mcp/update-readme.js) handles a key part of this chapter's functionality: +The `updateConfig` function in [`packages/playwright-mcp/update-readme.js`](https://github.com/microsoft/playwright-mcp/blob/HEAD/packages/playwright-mcp/update-readme.js) handles a key part of this chapter's functionality: ```js * @returns {Promise} */ -async function updateSection(content, startMarker, endMarker, generatedLines) { - const startMarkerIndex = content.indexOf(startMarker); - const endMarkerIndex = content.indexOf(endMarker); - if (startMarkerIndex === -1 || endMarkerIndex === -1) - throw new Error('Markers for generated section not found in README'); - - return [ - content.slice(0, startMarkerIndex + startMarker.length), - '', - generatedLines.join('\n'), - '', - content.slice(endMarkerIndex), - ].join('\n'); +async function updateConfig(content) { + console.log('Updating config schema from config.d.ts...'); + const configPath = path.join(__dirname, 'config.d.ts'); + const configContent = await fs.promises.readFile(configPath, 'utf-8'); + + // Extract the Config type definition + const configTypeMatch = configContent.match(/export type Config = (\{[\s\S]*?\n\});/); + if (!configTypeMatch) + throw new Error('Config type not found in config.d.ts'); + + const configType = configTypeMatch[1]; // Use capture group to get just the object definition + + const startMarker = ``; + const endMarker = ``; + return updateSection(content, startMarker, endMarker, [ + '```typescript', + configType, + '```', + ]); } /** - * @param {string} content - * @returns {Promise} + * @param {string} filePath */ -async function updateTools(content) { - console.log('Loading tool information from compiled modules...'); - - const generatedLines = /** @type {string[]} */ ([]); - for (const [capability, tools] of Object.entries(toolsByCapability)) { - console.log('Updating tools for capability:', capability); - generatedLines.push(`
\n${capability}`); - generatedLines.push(''); - for (const tool of tools) - generatedLines.push(...formatToolForReadme(tool.schema)); - generatedLines.push(`
`); +async function copyToPackage(filePath) { + await fs.promises.copyFile(path.join(__dirname, '../../', filePath), path.join(__dirname, filePath)); + console.log(`${filePath} copied successfully`); +} + +async function updateReadme() { ``` This function is important because it defines how Playwright MCP Tutorial: Browser Automation for Coding Agents Through MCP implements the patterns covered in this chapter. @@ -132,7 +130,7 @@ This function is important because it defines how Playwright MCP Tutorial: Brows ```mermaid flowchart TD - A[formatToolForReadme] - B[updateSection] + A[updateOptions] + B[updateConfig] A --> B ``` diff --git a/tutorials/playwright-mcp-tutorial/04-configuration-capabilities-and-runtime-modes.md b/tutorials/playwright-mcp-tutorial/04-configuration-capabilities-and-runtime-modes.md index eeb265d..c67f9bf 100644 --- a/tutorials/playwright-mcp-tutorial/04-configuration-capabilities-and-runtime-modes.md +++ b/tutorials/playwright-mcp-tutorial/04-configuration-capabilities-and-runtime-modes.md @@ -40,88 +40,67 @@ You now know which configuration levers matter most for stable operation. Next: [Chapter 5: Profile State, Extension, and Auth Sessions](05-profile-state-extension-and-auth-sessions.md) -## Depth Expansion Playbook - ## Source Code Walkthrough ### `packages/playwright-mcp/update-readme.js` -The `updateTools` function in [`packages/playwright-mcp/update-readme.js`](https://github.com/microsoft/playwright-mcp/blob/HEAD/packages/playwright-mcp/update-readme.js) handles a key part of this chapter's functionality: +The `copyToPackage` function in [`packages/playwright-mcp/update-readme.js`](https://github.com/microsoft/playwright-mcp/blob/HEAD/packages/playwright-mcp/update-readme.js) handles a key part of this chapter's functionality: ```js - * @returns {Promise} + * @param {string} filePath */ -async function updateTools(content) { - console.log('Loading tool information from compiled modules...'); - - const generatedLines = /** @type {string[]} */ ([]); - for (const [capability, tools] of Object.entries(toolsByCapability)) { - console.log('Updating tools for capability:', capability); - generatedLines.push(`
\n${capability}`); - generatedLines.push(''); - for (const tool of tools) - generatedLines.push(...formatToolForReadme(tool.schema)); - generatedLines.push(`
`); - generatedLines.push(''); - } - - const startMarker = ``; - const endMarker = ``; - return updateSection(content, startMarker, endMarker, generatedLines); +async function copyToPackage(filePath) { + await fs.promises.copyFile(path.join(__dirname, '../../', filePath), path.join(__dirname, filePath)); + console.log(`${filePath} copied successfully`); } -/** - * @param {string} content - * @returns {Promise} - */ -async function updateOptions(content) { - console.log('Listing options...'); - execSync('node cli.js --help > help.txt'); - const output = fs.readFileSync('help.txt'); - fs.unlinkSync('help.txt'); - const lines = output.toString().split('\n'); - const firstLine = lines.findIndex(line => line.includes('--version')); +async function updateReadme() { + const readmePath = path.join(__dirname, '../../README.md'); + const readmeContent = await fs.promises.readFile(readmePath, 'utf-8'); + const withTools = await updateTools(readmeContent); + const withOptions = await updateOptions(withTools); + const withConfig = await updateConfig(withOptions); + await fs.promises.writeFile(readmePath, withConfig, 'utf-8'); + console.log('README updated successfully'); + + await copyToPackage('README.md'); + await copyToPackage('LICENSE'); +} + +updateReadme().catch(err => { + console.error('Error updating README:', err); + process.exit(1); +}); + ``` This function is important because it defines how Playwright MCP Tutorial: Browser Automation for Coding Agents Through MCP implements the patterns covered in this chapter. ### `packages/playwright-mcp/update-readme.js` -The `updateOptions` function in [`packages/playwright-mcp/update-readme.js`](https://github.com/microsoft/playwright-mcp/blob/HEAD/packages/playwright-mcp/update-readme.js) handles a key part of this chapter's functionality: +The `updateReadme` function in [`packages/playwright-mcp/update-readme.js`](https://github.com/microsoft/playwright-mcp/blob/HEAD/packages/playwright-mcp/update-readme.js) handles a key part of this chapter's functionality: ```js - * @returns {Promise} - */ -async function updateOptions(content) { - console.log('Listing options...'); - execSync('node cli.js --help > help.txt'); - const output = fs.readFileSync('help.txt'); - fs.unlinkSync('help.txt'); - const lines = output.toString().split('\n'); - const firstLine = lines.findIndex(line => line.includes('--version')); - lines.splice(0, firstLine + 1); - const lastLine = lines.findIndex(line => line.includes('--help')); - lines.splice(lastLine); - - /** - * @type {{ name: string, value: string }[]} - */ - const options = []; - for (let line of lines) { - if (line.startsWith(' --')) { - const l = line.substring(' --'.length); - const gapIndex = l.indexOf(' '); - const name = l.substring(0, gapIndex).trim(); - const value = l.substring(gapIndex).trim(); - options.push({ name, value }); - } else { - const value = line.trim(); - options[options.length - 1].value += ' ' + value; - } - } - - const table = []; - table.push(`| Option | Description |`); +} + +async function updateReadme() { + const readmePath = path.join(__dirname, '../../README.md'); + const readmeContent = await fs.promises.readFile(readmePath, 'utf-8'); + const withTools = await updateTools(readmeContent); + const withOptions = await updateOptions(withTools); + const withConfig = await updateConfig(withOptions); + await fs.promises.writeFile(readmePath, withConfig, 'utf-8'); + console.log('README updated successfully'); + + await copyToPackage('README.md'); + await copyToPackage('LICENSE'); +} + +updateReadme().catch(err => { + console.error('Error updating README:', err); + process.exit(1); +}); + ``` This function is important because it defines how Playwright MCP Tutorial: Browser Automation for Coding Agents Through MCP implements the patterns covered in this chapter. @@ -131,7 +110,7 @@ This function is important because it defines how Playwright MCP Tutorial: Brows ```mermaid flowchart TD - A[updateTools] - B[updateOptions] + A[copyToPackage] + B[updateReadme] A --> B ``` diff --git a/tutorials/playwright-mcp-tutorial/05-profile-state-extension-and-auth-sessions.md b/tutorials/playwright-mcp-tutorial/05-profile-state-extension-and-auth-sessions.md index b5c286a..d0394c7 100644 --- a/tutorials/playwright-mcp-tutorial/05-profile-state-extension-and-auth-sessions.md +++ b/tutorials/playwright-mcp-tutorial/05-profile-state-extension-and-auth-sessions.md @@ -40,81 +40,86 @@ You now have a practical model for handling auth/session continuity in browser a Next: [Chapter 6: Standalone and Docker Deployment](06-standalone-and-docker-deployment.md) -## Depth Expansion Playbook - ## Source Code Walkthrough -### `packages/playwright-mcp/update-readme.js` +### `roll.js` -The `updateConfig` function in [`packages/playwright-mcp/update-readme.js`](https://github.com/microsoft/playwright-mcp/blob/HEAD/packages/playwright-mcp/update-readme.js) handles a key part of this chapter's functionality: +The `copyConfig` function in [`roll.js`](https://github.com/microsoft/playwright-mcp/blob/HEAD/roll.js) handles a key part of this chapter's functionality: ```js - * @returns {Promise} - */ -async function updateConfig(content) { - console.log('Updating config schema from config.d.ts...'); - const configPath = path.join(__dirname, 'config.d.ts'); - const configContent = await fs.promises.readFile(configPath, 'utf-8'); - - // Extract the Config type definition - const configTypeMatch = configContent.match(/export type Config = (\{[\s\S]*?\n\});/); - if (!configTypeMatch) - throw new Error('Config type not found in config.d.ts'); - - const configType = configTypeMatch[1]; // Use capture group to get just the object definition - - const startMarker = ``; - const endMarker = ``; - return updateSection(content, startMarker, endMarker, [ - '```typescript', - configType, - '```', - ]); -} - -/** - * @param {string} filePath - */ -async function copyToPackage(filePath) { - await fs.promises.copyFile(path.join(__dirname, '../../', filePath), path.join(__dirname, filePath)); - console.log(`${filePath} copied successfully`); +const { execSync } = require('child_process'); + +function copyConfig() { + const src = path.join(__dirname, '..', 'playwright', 'packages', 'playwright-core', 'src', 'tools', 'mcp', 'config.d.ts'); + const dst = path.join(__dirname, 'packages', 'playwright-mcp', 'config.d.ts'); + let content = fs.readFileSync(src, 'utf-8'); + content = content.replace( + "import type * as playwright from 'playwright-core';", + "import type * as playwright from 'playwright';" + ); + fs.writeFileSync(dst, content); + console.log(`Copied config.d.ts from ${src} to ${dst}`); } -async function updateReadme() { +function updatePlaywrightVersion(version) { + const packagesDir = path.join(__dirname, 'packages'); + const files = [path.join(__dirname, 'package.json')]; + for (const entry of fs.readdirSync(packagesDir, { withFileTypes: true })) { + const pkgJson = path.join(packagesDir, entry.name, 'package.json'); + if (fs.existsSync(pkgJson)) + files.push(pkgJson); + } + + for (const file of files) { + const json = JSON.parse(fs.readFileSync(file, 'utf-8')); + let updated = false; + for (const section of ['dependencies', 'devDependencies']) { + for (const pkg of ['@playwright/test', 'playwright', 'playwright-core']) { + if (json[section]?.[pkg]) { + json[section][pkg] = version; + updated = true; + } ``` This function is important because it defines how Playwright MCP Tutorial: Browser Automation for Coding Agents Through MCP implements the patterns covered in this chapter. -### `packages/playwright-mcp/update-readme.js` +### `roll.js` -The `copyToPackage` function in [`packages/playwright-mcp/update-readme.js`](https://github.com/microsoft/playwright-mcp/blob/HEAD/packages/playwright-mcp/update-readme.js) handles a key part of this chapter's functionality: +The `updatePlaywrightVersion` function in [`roll.js`](https://github.com/microsoft/playwright-mcp/blob/HEAD/roll.js) handles a key part of this chapter's functionality: ```js - * @param {string} filePath - */ -async function copyToPackage(filePath) { - await fs.promises.copyFile(path.join(__dirname, '../../', filePath), path.join(__dirname, filePath)); - console.log(`${filePath} copied successfully`); } -async function updateReadme() { - const readmePath = path.join(__dirname, '../../README.md'); - const readmeContent = await fs.promises.readFile(readmePath, 'utf-8'); - const withTools = await updateTools(readmeContent); - const withOptions = await updateOptions(withTools); - const withConfig = await updateConfig(withOptions); - await fs.promises.writeFile(readmePath, withConfig, 'utf-8'); - console.log('README updated successfully'); - - await copyToPackage('README.md'); - await copyToPackage('LICENSE'); +function updatePlaywrightVersion(version) { + const packagesDir = path.join(__dirname, 'packages'); + const files = [path.join(__dirname, 'package.json')]; + for (const entry of fs.readdirSync(packagesDir, { withFileTypes: true })) { + const pkgJson = path.join(packagesDir, entry.name, 'package.json'); + if (fs.existsSync(pkgJson)) + files.push(pkgJson); + } + + for (const file of files) { + const json = JSON.parse(fs.readFileSync(file, 'utf-8')); + let updated = false; + for (const section of ['dependencies', 'devDependencies']) { + for (const pkg of ['@playwright/test', 'playwright', 'playwright-core']) { + if (json[section]?.[pkg]) { + json[section][pkg] = version; + updated = true; + } + } + } + if (updated) { + fs.writeFileSync(file, JSON.stringify(json, null, 2) + '\n'); + console.log(`Updated ${file}`); + } + } + + execSync('npm install', { cwd: __dirname, stdio: 'inherit' }); } -updateReadme().catch(err => { - console.error('Error updating README:', err); - process.exit(1); -}); - +function doRoll(version) { ``` This function is important because it defines how Playwright MCP Tutorial: Browser Automation for Coding Agents Through MCP implements the patterns covered in this chapter. @@ -124,7 +129,7 @@ This function is important because it defines how Playwright MCP Tutorial: Brows ```mermaid flowchart TD - A[updateConfig] - B[copyToPackage] + A[copyConfig] + B[updatePlaywrightVersion] A --> B ``` diff --git a/tutorials/playwright-mcp-tutorial/06-standalone-and-docker-deployment.md b/tutorials/playwright-mcp-tutorial/06-standalone-and-docker-deployment.md index 6637e9a..b1290bd 100644 --- a/tutorials/playwright-mcp-tutorial/06-standalone-and-docker-deployment.md +++ b/tutorials/playwright-mcp-tutorial/06-standalone-and-docker-deployment.md @@ -40,34 +40,28 @@ You now have options for scaling Playwright MCP beyond default client-managed ex Next: [Chapter 7: Tooling Surface and Automation Patterns](07-tooling-surface-and-automation-patterns.md) -## Depth Expansion Playbook - ## Source Code Walkthrough -### `packages/playwright-mcp/update-readme.js` +### `roll.js` -The `updateReadme` function in [`packages/playwright-mcp/update-readme.js`](https://github.com/microsoft/playwright-mcp/blob/HEAD/packages/playwright-mcp/update-readme.js) handles a key part of this chapter's functionality: +The `doRoll` function in [`roll.js`](https://github.com/microsoft/playwright-mcp/blob/HEAD/roll.js) handles a key part of this chapter's functionality: ```js } -async function updateReadme() { - const readmePath = path.join(__dirname, '../../README.md'); - const readmeContent = await fs.promises.readFile(readmePath, 'utf-8'); - const withTools = await updateTools(readmeContent); - const withOptions = await updateOptions(withTools); - const withConfig = await updateConfig(withOptions); - await fs.promises.writeFile(readmePath, withConfig, 'utf-8'); - console.log('README updated successfully'); - - await copyToPackage('README.md'); - await copyToPackage('LICENSE'); +function doRoll(version) { + updatePlaywrightVersion(version); + copyConfig(); + // update readme + execSync('npm run lint', { cwd: __dirname, stdio: 'inherit' }); } -updateReadme().catch(err => { - console.error('Error updating README:', err); - process.exit(1); -}); +let version = process.argv[2]; +if (!version) { + version = execSync('npm info playwright@next version', { encoding: 'utf-8' }).trim(); + console.log(`Using next playwright version: ${version}`); +} +doRoll(version); ``` @@ -92,7 +86,7 @@ This function is important because it defines how Playwright MCP Tutorial: Brows ```mermaid flowchart TD - A[updateReadme] + A[doRoll] B[createConnection] A --> B ``` diff --git a/tutorials/playwright-mcp-tutorial/07-tooling-surface-and-automation-patterns.md b/tutorials/playwright-mcp-tutorial/07-tooling-surface-and-automation-patterns.md index a86aed9..2f1cec3 100644 --- a/tutorials/playwright-mcp-tutorial/07-tooling-surface-and-automation-patterns.md +++ b/tutorials/playwright-mcp-tutorial/07-tooling-surface-and-automation-patterns.md @@ -40,51 +40,8 @@ You now have a repeatable pattern for stable browser automation loops in agent w Next: [Chapter 8: Troubleshooting, Security, and Contribution](08-troubleshooting-security-and-contribution.md) -## Depth Expansion Playbook - ## Source Code Walkthrough -### `packages/extension/src/background.ts` - -The `TabShareExtension` class in [`packages/extension/src/background.ts`](https://github.com/microsoft/playwright-mcp/blob/HEAD/packages/extension/src/background.ts) handles a key part of this chapter's functionality: - -```ts -}; - -class TabShareExtension { - private _activeConnection: RelayConnection | undefined; - private _connectedTabId: number | null = null; - private _pendingTabSelection = new Map(); - - constructor() { - chrome.tabs.onRemoved.addListener(this._onTabRemoved.bind(this)); - chrome.tabs.onUpdated.addListener(this._onTabUpdated.bind(this)); - chrome.tabs.onActivated.addListener(this._onTabActivated.bind(this)); - chrome.runtime.onMessage.addListener(this._onMessage.bind(this)); - chrome.action.onClicked.addListener(this._onActionClicked.bind(this)); - } - - // Promise-based message handling is not supported in Chrome: https://issues.chromium.org/issues/40753031 - private _onMessage(message: PageMessage, sender: chrome.runtime.MessageSender, sendResponse: (response: any) => void) { - switch (message.type) { - case 'connectToMCPRelay': - this._connectToRelay(sender.tab!.id!, message.mcpRelayUrl).then( - () => sendResponse({ success: true }), - (error: any) => sendResponse({ success: false, error: error.message })); - return true; - case 'getTabs': - this._getTabs().then( - tabs => sendResponse({ success: true, tabs, currentTabId: sender.tab?.id }), - (error: any) => sendResponse({ success: false, error: error.message })); - return true; - case 'connectToTab': - const tabId = message.tabId || sender.tab?.id!; - const windowId = message.windowId || sender.tab?.windowId!; - this._connectTab(sender.tab!.id!, tabId, windowId, message.mcpRelayUrl!).then( -``` - -This class is important because it defines how Playwright MCP Tutorial: Browser Automation for Coding Agents Through MCP implements the patterns covered in this chapter. - ### `packages/extension/src/ui/tabItem.tsx` The `TabInfo` interface in [`packages/extension/src/ui/tabItem.tsx`](https://github.com/microsoft/playwright-mcp/blob/HEAD/packages/extension/src/ui/tabItem.tsx) handles a key part of this chapter's functionality: @@ -126,12 +83,52 @@ export const TabItem: React.FC = ({ This interface is important because it defines how Playwright MCP Tutorial: Browser Automation for Coding Agents Through MCP implements the patterns covered in this chapter. +### `packages/extension/src/ui/tabItem.tsx` + +The `TabItemProps` interface in [`packages/extension/src/ui/tabItem.tsx`](https://github.com/microsoft/playwright-mcp/blob/HEAD/packages/extension/src/ui/tabItem.tsx) handles a key part of this chapter's functionality: + +```tsx + + +export interface TabItemProps { + tab: TabInfo; + onClick?: () => void; + button?: React.ReactNode; +} + +export const TabItem: React.FC = ({ + tab, + onClick, + button +}) => { + return ( +
+ '} + alt='' + className='tab-favicon' + /> +
+
+ {tab.title || 'Untitled'} +
+
{tab.url}
+
+ {button} +
+ ); +}; + +``` + +This interface is important because it defines how Playwright MCP Tutorial: Browser Automation for Coding Agents Through MCP implements the patterns covered in this chapter. + ## How These Components Connect ```mermaid flowchart TD - A[TabShareExtension] - B[TabInfo] + A[TabInfo] + B[TabItemProps] A --> B ``` diff --git a/tutorials/playwright-mcp-tutorial/08-troubleshooting-security-and-contribution.md b/tutorials/playwright-mcp-tutorial/08-troubleshooting-security-and-contribution.md index a16cc33..79c5724 100644 --- a/tutorials/playwright-mcp-tutorial/08-troubleshooting-security-and-contribution.md +++ b/tutorials/playwright-mcp-tutorial/08-troubleshooting-security-and-contribution.md @@ -44,50 +44,8 @@ Next steps: - build one deterministic snapshot-first browser workflow and reuse it - audit session and credential handling before broad rollout -## Depth Expansion Playbook - ## Source Code Walkthrough -### `packages/extension/src/ui/tabItem.tsx` - -The `TabItemProps` interface in [`packages/extension/src/ui/tabItem.tsx`](https://github.com/microsoft/playwright-mcp/blob/HEAD/packages/extension/src/ui/tabItem.tsx) handles a key part of this chapter's functionality: - -```tsx - - -export interface TabItemProps { - tab: TabInfo; - onClick?: () => void; - button?: React.ReactNode; -} - -export const TabItem: React.FC = ({ - tab, - onClick, - button -}) => { - return ( -
- '} - alt='' - className='tab-favicon' - /> -
-
- {tab.title || 'Untitled'} -
-
{tab.url}
-
- {button} -
- ); -}; - -``` - -This interface is important because it defines how Playwright MCP Tutorial: Browser Automation for Coding Agents Through MCP implements the patterns covered in this chapter. - ### `packages/extension/src/ui/status.tsx` The `ConnectionStatus` interface in [`packages/extension/src/ui/status.tsx`](https://github.com/microsoft/playwright-mcp/blob/HEAD/packages/extension/src/ui/status.tsx) handles a key part of this chapter's functionality: @@ -129,12 +87,53 @@ const StatusApp: React.FC = () => { This interface is important because it defines how Playwright MCP Tutorial: Browser Automation for Coding Agents Through MCP implements the patterns covered in this chapter. +### `packages/extension/src/background.ts` + +The `TabShareExtension` class in [`packages/extension/src/background.ts`](https://github.com/microsoft/playwright-mcp/blob/HEAD/packages/extension/src/background.ts) handles a key part of this chapter's functionality: + +```ts +}; + +class TabShareExtension { + private _activeConnection: RelayConnection | undefined; + private _connectedTabId: number | null = null; + private _pendingTabSelection = new Map(); + + constructor() { + chrome.tabs.onRemoved.addListener(this._onTabRemoved.bind(this)); + chrome.tabs.onUpdated.addListener(this._onTabUpdated.bind(this)); + chrome.tabs.onActivated.addListener(this._onTabActivated.bind(this)); + chrome.runtime.onMessage.addListener(this._onMessage.bind(this)); + chrome.action.onClicked.addListener(this._onActionClicked.bind(this)); + } + + // Promise-based message handling is not supported in Chrome: https://issues.chromium.org/issues/40753031 + private _onMessage(message: PageMessage, sender: chrome.runtime.MessageSender, sendResponse: (response: any) => void) { + switch (message.type) { + case 'connectToMCPRelay': + this._connectToRelay(sender.tab!.id!, message.mcpRelayUrl).then( + () => sendResponse({ success: true }), + (error: any) => sendResponse({ success: false, error: error.message })); + return true; + case 'getTabs': + this._getTabs().then( + tabs => sendResponse({ success: true, tabs, currentTabId: sender.tab?.id }), + (error: any) => sendResponse({ success: false, error: error.message })); + return true; + case 'connectToTab': + const tabId = message.tabId || sender.tab?.id!; + const windowId = message.windowId || sender.tab?.windowId!; + this._connectTab(sender.tab!.id!, tabId, windowId, message.mcpRelayUrl!).then( +``` + +This class is important because it defines how Playwright MCP Tutorial: Browser Automation for Coding Agents Through MCP implements the patterns covered in this chapter. + ## How These Components Connect ```mermaid flowchart TD - A[TabItemProps] - B[ConnectionStatus] + A[ConnectionStatus] + B[TabShareExtension] A --> B ``` diff --git a/tutorials/superset-terminal-tutorial/01-getting-started.md b/tutorials/superset-terminal-tutorial/01-getting-started.md index be59415..86eb905 100644 --- a/tutorials/superset-terminal-tutorial/01-getting-started.md +++ b/tutorials/superset-terminal-tutorial/01-getting-started.md @@ -35,8 +35,6 @@ You now have a running Superset baseline for workspace-based agent orchestration Next: [Chapter 2: Worktree Isolation and Workspace Model](02-worktree-isolation-and-workspace-model.md) -## Depth Expansion Playbook - ## Source Code Walkthrough ### `apps/desktop/runtime-dependencies.ts` diff --git a/tutorials/superset-terminal-tutorial/02-worktree-isolation-and-workspace-model.md b/tutorials/superset-terminal-tutorial/02-worktree-isolation-and-workspace-model.md index bfd938e..902e68a 100644 --- a/tutorials/superset-terminal-tutorial/02-worktree-isolation-and-workspace-model.md +++ b/tutorials/superset-terminal-tutorial/02-worktree-isolation-and-workspace-model.md @@ -30,8 +30,6 @@ You now understand how Superset prevents multi-agent interference through worksp Next: [Chapter 3: Workspace Orchestration Lifecycle](03-workspace-orchestration-lifecycle.md) -## Depth Expansion Playbook - ## Source Code Walkthrough ### `apps/desktop/runtime-dependencies.ts` diff --git a/tutorials/superset-terminal-tutorial/03-workspace-orchestration-lifecycle.md b/tutorials/superset-terminal-tutorial/03-workspace-orchestration-lifecycle.md index ec67125..29aa558 100644 --- a/tutorials/superset-terminal-tutorial/03-workspace-orchestration-lifecycle.md +++ b/tutorials/superset-terminal-tutorial/03-workspace-orchestration-lifecycle.md @@ -32,50 +32,55 @@ You now have a concrete lifecycle model for Superset workspace management. Next: [Chapter 4: Multi-Agent Program Compatibility](04-multi-agent-program-compatibility.md) -## Depth Expansion Playbook - ## Source Code Walkthrough -### `package.json` +### `bunfig.toml` -The `package` module in [`package.json`](https://github.com/superset-sh/superset/blob/HEAD/package.json) handles a key part of this chapter's functionality: +The `bunfig` module in [`bunfig.toml`](https://github.com/superset-sh/superset/blob/HEAD/bunfig.toml) handles a key part of this chapter's functionality: + +```toml +[install] +linker = "isolated" # Prevent hoisting from resolving `path-scurry@2` to `lru-cache@6` (missing `LRUCache`), which breaks the `@superset/desktop` postinstall native rebuild. + +``` + +This module is important because it defines how Superset Terminal Tutorial: Command Center for Parallel Coding Agents implements the patterns covered in this chapter. + +### `.codex/config.toml` + +The `config` module in [`.codex/config.toml`](https://github.com/superset-sh/superset/blob/HEAD/.codex/config.toml) handles a key part of this chapter's functionality: + +```toml +[mcp_servers.superset] +type = "sse" +url = "https://api.superset.sh/api/agent/mcp" + +[mcp_servers.expo-mcp] +type = "sse" +url = "https://mcp.expo.dev/mcp" +enabled = false + +[mcp_servers.maestro] +command = "maestro" +args = ["mcp"] + +[mcp_servers.neon] +type = "sse" +url = "https://mcp.neon.tech/mcp" + +[mcp_servers.linear] +type = "sse" +url = "https://mcp.linear.app/mcp" + +[mcp_servers.sentry] +type = "sse" +url = "https://mcp.sentry.dev/mcp" + + +[mcp_servers.desktop-automation] +command = "bun" +args = ["run", "packages/desktop-mcp/src/bin.ts"] -```json -{ - "name": "@superset/repo", - "version": "0.0.0", - "repository": { - "type": "git" - }, - "devDependencies": { - "@biomejs/biome": "2.4.2", - "dotenv-cli": "^11.0.0", - "sherif": "^1.10.0", - "turbo": "^2.8.7" - }, - "description": "Superset Monorepo", - "homepage": "https://superset.sh", - "license": "Elastic-2.0", - "packageManager": "bun@1.3.6", - "private": true, - "scripts": { - "dev": "turbo run dev dev:caddy --filter=@superset/api --filter=@superset/web --filter=@superset/desktop --filter=electric-proxy --filter=//", - "dev:all": "turbo dev", - "dev:caddy": "dotenv -- caddy run --config Caddyfile", - "dev:docs": "turbo dev --filter=@superset/docs", - "dev:marketing": "turbo dev --filter=@superset/marketing --filter=@superset/docs", - "build": "turbo build --filter=@superset/desktop", - "test": "turbo test", - "lint": "./scripts/lint.sh", - "check:desktop-git-env": "./scripts/check-desktop-git-env.sh", - "lint:fix": "bunx @biomejs/biome@2.4.2 migrate --write && bunx @biomejs/biome@2.4.2 check --write --unsafe .", - "format": "bunx @biomejs/biome@2.4.2 format --write .", - "format:check": "bunx @biomejs/biome@2.4.2 format .", - "typecheck": "turbo typecheck", - "ui-add": "turbo run ui-add", - "postinstall": "./scripts/postinstall.sh", - "clean": "git clean -xdf node_modules", - "clean:workspaces": "turbo clean", ``` This module is important because it defines how Superset Terminal Tutorial: Command Center for Parallel Coding Agents implements the patterns covered in this chapter. @@ -124,52 +129,14 @@ The `.mcp` module in [`.mcp.json`](https://github.com/superset-sh/superset/blob/ This module is important because it defines how Superset Terminal Tutorial: Command Center for Parallel Coding Agents implements the patterns covered in this chapter. -### `.mastracode/mcp.json` - -The `mcp` module in [`.mastracode/mcp.json`](https://github.com/superset-sh/superset/blob/HEAD/.mastracode/mcp.json) handles a key part of this chapter's functionality: - -```json -{ - "mcpServers": { - "superset": { - "command": "npx", - "args": ["-y", "mcp-remote", "https://api.superset.sh/api/agent/mcp"] - }, - "maestro": { - "command": "maestro", - "args": ["mcp"] - }, - "neon": { - "command": "npx", - "args": ["-y", "mcp-remote", "https://mcp.neon.tech/mcp"] - }, - "linear": { - "command": "npx", - "args": ["-y", "mcp-remote", "https://mcp.linear.app/mcp"] - }, - "sentry": { - "command": "npx", - "args": ["-y", "mcp-remote", "https://mcp.sentry.dev/mcp"] - }, - "desktop-automation": { - "command": "bun", - "args": ["run", "packages/desktop-mcp/src/bin.ts"] - } - } -} - -``` - -This module is important because it defines how Superset Terminal Tutorial: Command Center for Parallel Coding Agents implements the patterns covered in this chapter. - ## How These Components Connect ```mermaid flowchart TD - A[package] - B[.mcp] - C[mcp] + A[bunfig] + B[config] + C[.mcp] A --> B B --> C ``` diff --git a/tutorials/superset-terminal-tutorial/04-multi-agent-program-compatibility.md b/tutorials/superset-terminal-tutorial/04-multi-agent-program-compatibility.md index cacea89..d9ec584 100644 --- a/tutorials/superset-terminal-tutorial/04-multi-agent-program-compatibility.md +++ b/tutorials/superset-terminal-tutorial/04-multi-agent-program-compatibility.md @@ -30,50 +30,55 @@ You now know how Superset functions as a universal orchestrator for heterogeneou Next: [Chapter 5: Monitoring, Diff, and Review Workflow](05-monitoring-diff-and-review-workflow.md) -## Depth Expansion Playbook - ## Source Code Walkthrough -### `package.json` +### `bunfig.toml` -The `package` module in [`package.json`](https://github.com/superset-sh/superset/blob/HEAD/package.json) handles a key part of this chapter's functionality: +The `bunfig` module in [`bunfig.toml`](https://github.com/superset-sh/superset/blob/HEAD/bunfig.toml) handles a key part of this chapter's functionality: + +```toml +[install] +linker = "isolated" # Prevent hoisting from resolving `path-scurry@2` to `lru-cache@6` (missing `LRUCache`), which breaks the `@superset/desktop` postinstall native rebuild. + +``` + +This module is important because it defines how Superset Terminal Tutorial: Command Center for Parallel Coding Agents implements the patterns covered in this chapter. + +### `.codex/config.toml` + +The `config` module in [`.codex/config.toml`](https://github.com/superset-sh/superset/blob/HEAD/.codex/config.toml) handles a key part of this chapter's functionality: + +```toml +[mcp_servers.superset] +type = "sse" +url = "https://api.superset.sh/api/agent/mcp" + +[mcp_servers.expo-mcp] +type = "sse" +url = "https://mcp.expo.dev/mcp" +enabled = false + +[mcp_servers.maestro] +command = "maestro" +args = ["mcp"] + +[mcp_servers.neon] +type = "sse" +url = "https://mcp.neon.tech/mcp" + +[mcp_servers.linear] +type = "sse" +url = "https://mcp.linear.app/mcp" + +[mcp_servers.sentry] +type = "sse" +url = "https://mcp.sentry.dev/mcp" + + +[mcp_servers.desktop-automation] +command = "bun" +args = ["run", "packages/desktop-mcp/src/bin.ts"] -```json -{ - "name": "@superset/repo", - "version": "0.0.0", - "repository": { - "type": "git" - }, - "devDependencies": { - "@biomejs/biome": "2.4.2", - "dotenv-cli": "^11.0.0", - "sherif": "^1.10.0", - "turbo": "^2.8.7" - }, - "description": "Superset Monorepo", - "homepage": "https://superset.sh", - "license": "Elastic-2.0", - "packageManager": "bun@1.3.6", - "private": true, - "scripts": { - "dev": "turbo run dev dev:caddy --filter=@superset/api --filter=@superset/web --filter=@superset/desktop --filter=electric-proxy --filter=//", - "dev:all": "turbo dev", - "dev:caddy": "dotenv -- caddy run --config Caddyfile", - "dev:docs": "turbo dev --filter=@superset/docs", - "dev:marketing": "turbo dev --filter=@superset/marketing --filter=@superset/docs", - "build": "turbo build --filter=@superset/desktop", - "test": "turbo test", - "lint": "./scripts/lint.sh", - "check:desktop-git-env": "./scripts/check-desktop-git-env.sh", - "lint:fix": "bunx @biomejs/biome@2.4.2 migrate --write && bunx @biomejs/biome@2.4.2 check --write --unsafe .", - "format": "bunx @biomejs/biome@2.4.2 format --write .", - "format:check": "bunx @biomejs/biome@2.4.2 format .", - "typecheck": "turbo typecheck", - "ui-add": "turbo run ui-add", - "postinstall": "./scripts/postinstall.sh", - "clean": "git clean -xdf node_modules", - "clean:workspaces": "turbo clean", ``` This module is important because it defines how Superset Terminal Tutorial: Command Center for Parallel Coding Agents implements the patterns covered in this chapter. @@ -122,52 +127,14 @@ The `.mcp` module in [`.mcp.json`](https://github.com/superset-sh/superset/blob/ This module is important because it defines how Superset Terminal Tutorial: Command Center for Parallel Coding Agents implements the patterns covered in this chapter. -### `.mastracode/mcp.json` - -The `mcp` module in [`.mastracode/mcp.json`](https://github.com/superset-sh/superset/blob/HEAD/.mastracode/mcp.json) handles a key part of this chapter's functionality: - -```json -{ - "mcpServers": { - "superset": { - "command": "npx", - "args": ["-y", "mcp-remote", "https://api.superset.sh/api/agent/mcp"] - }, - "maestro": { - "command": "maestro", - "args": ["mcp"] - }, - "neon": { - "command": "npx", - "args": ["-y", "mcp-remote", "https://mcp.neon.tech/mcp"] - }, - "linear": { - "command": "npx", - "args": ["-y", "mcp-remote", "https://mcp.linear.app/mcp"] - }, - "sentry": { - "command": "npx", - "args": ["-y", "mcp-remote", "https://mcp.sentry.dev/mcp"] - }, - "desktop-automation": { - "command": "bun", - "args": ["run", "packages/desktop-mcp/src/bin.ts"] - } - } -} - -``` - -This module is important because it defines how Superset Terminal Tutorial: Command Center for Parallel Coding Agents implements the patterns covered in this chapter. - ## How These Components Connect ```mermaid flowchart TD - A[package] - B[.mcp] - C[mcp] + A[bunfig] + B[config] + C[.mcp] A --> B B --> C ``` diff --git a/tutorials/superset-terminal-tutorial/05-monitoring-diff-and-review-workflow.md b/tutorials/superset-terminal-tutorial/05-monitoring-diff-and-review-workflow.md index f14769b..622b894 100644 --- a/tutorials/superset-terminal-tutorial/05-monitoring-diff-and-review-workflow.md +++ b/tutorials/superset-terminal-tutorial/05-monitoring-diff-and-review-workflow.md @@ -29,50 +29,55 @@ You now have a review-first flow for safely scaling agent throughput. Next: [Chapter 6: Setup/Teardown Presets and Automation](06-setup-teardown-presets-and-automation.md) -## Depth Expansion Playbook - ## Source Code Walkthrough -### `package.json` +### `bunfig.toml` -The `package` module in [`package.json`](https://github.com/superset-sh/superset/blob/HEAD/package.json) handles a key part of this chapter's functionality: +The `bunfig` module in [`bunfig.toml`](https://github.com/superset-sh/superset/blob/HEAD/bunfig.toml) handles a key part of this chapter's functionality: + +```toml +[install] +linker = "isolated" # Prevent hoisting from resolving `path-scurry@2` to `lru-cache@6` (missing `LRUCache`), which breaks the `@superset/desktop` postinstall native rebuild. + +``` + +This module is important because it defines how Superset Terminal Tutorial: Command Center for Parallel Coding Agents implements the patterns covered in this chapter. + +### `.codex/config.toml` + +The `config` module in [`.codex/config.toml`](https://github.com/superset-sh/superset/blob/HEAD/.codex/config.toml) handles a key part of this chapter's functionality: + +```toml +[mcp_servers.superset] +type = "sse" +url = "https://api.superset.sh/api/agent/mcp" + +[mcp_servers.expo-mcp] +type = "sse" +url = "https://mcp.expo.dev/mcp" +enabled = false + +[mcp_servers.maestro] +command = "maestro" +args = ["mcp"] + +[mcp_servers.neon] +type = "sse" +url = "https://mcp.neon.tech/mcp" + +[mcp_servers.linear] +type = "sse" +url = "https://mcp.linear.app/mcp" + +[mcp_servers.sentry] +type = "sse" +url = "https://mcp.sentry.dev/mcp" + + +[mcp_servers.desktop-automation] +command = "bun" +args = ["run", "packages/desktop-mcp/src/bin.ts"] -```json -{ - "name": "@superset/repo", - "version": "0.0.0", - "repository": { - "type": "git" - }, - "devDependencies": { - "@biomejs/biome": "2.4.2", - "dotenv-cli": "^11.0.0", - "sherif": "^1.10.0", - "turbo": "^2.8.7" - }, - "description": "Superset Monorepo", - "homepage": "https://superset.sh", - "license": "Elastic-2.0", - "packageManager": "bun@1.3.6", - "private": true, - "scripts": { - "dev": "turbo run dev dev:caddy --filter=@superset/api --filter=@superset/web --filter=@superset/desktop --filter=electric-proxy --filter=//", - "dev:all": "turbo dev", - "dev:caddy": "dotenv -- caddy run --config Caddyfile", - "dev:docs": "turbo dev --filter=@superset/docs", - "dev:marketing": "turbo dev --filter=@superset/marketing --filter=@superset/docs", - "build": "turbo build --filter=@superset/desktop", - "test": "turbo test", - "lint": "./scripts/lint.sh", - "check:desktop-git-env": "./scripts/check-desktop-git-env.sh", - "lint:fix": "bunx @biomejs/biome@2.4.2 migrate --write && bunx @biomejs/biome@2.4.2 check --write --unsafe .", - "format": "bunx @biomejs/biome@2.4.2 format --write .", - "format:check": "bunx @biomejs/biome@2.4.2 format .", - "typecheck": "turbo typecheck", - "ui-add": "turbo run ui-add", - "postinstall": "./scripts/postinstall.sh", - "clean": "git clean -xdf node_modules", - "clean:workspaces": "turbo clean", ``` This module is important because it defines how Superset Terminal Tutorial: Command Center for Parallel Coding Agents implements the patterns covered in this chapter. @@ -121,52 +126,14 @@ The `.mcp` module in [`.mcp.json`](https://github.com/superset-sh/superset/blob/ This module is important because it defines how Superset Terminal Tutorial: Command Center for Parallel Coding Agents implements the patterns covered in this chapter. -### `.mastracode/mcp.json` - -The `mcp` module in [`.mastracode/mcp.json`](https://github.com/superset-sh/superset/blob/HEAD/.mastracode/mcp.json) handles a key part of this chapter's functionality: - -```json -{ - "mcpServers": { - "superset": { - "command": "npx", - "args": ["-y", "mcp-remote", "https://api.superset.sh/api/agent/mcp"] - }, - "maestro": { - "command": "maestro", - "args": ["mcp"] - }, - "neon": { - "command": "npx", - "args": ["-y", "mcp-remote", "https://mcp.neon.tech/mcp"] - }, - "linear": { - "command": "npx", - "args": ["-y", "mcp-remote", "https://mcp.linear.app/mcp"] - }, - "sentry": { - "command": "npx", - "args": ["-y", "mcp-remote", "https://mcp.sentry.dev/mcp"] - }, - "desktop-automation": { - "command": "bun", - "args": ["run", "packages/desktop-mcp/src/bin.ts"] - } - } -} - -``` - -This module is important because it defines how Superset Terminal Tutorial: Command Center for Parallel Coding Agents implements the patterns covered in this chapter. - ## How These Components Connect ```mermaid flowchart TD - A[package] - B[.mcp] - C[mcp] + A[bunfig] + B[config] + C[.mcp] A --> B B --> C ``` diff --git a/tutorials/superset-terminal-tutorial/06-setup-teardown-presets-and-automation.md b/tutorials/superset-terminal-tutorial/06-setup-teardown-presets-and-automation.md index 81bdafd..ed16166 100644 --- a/tutorials/superset-terminal-tutorial/06-setup-teardown-presets-and-automation.md +++ b/tutorials/superset-terminal-tutorial/06-setup-teardown-presets-and-automation.md @@ -35,50 +35,55 @@ You now understand how to standardize workspace initialization and cleanup workf Next: [Chapter 7: Runtime and Package Architecture](07-runtime-and-package-architecture.md) -## Depth Expansion Playbook - ## Source Code Walkthrough -### `package.json` +### `bunfig.toml` -The `package` module in [`package.json`](https://github.com/superset-sh/superset/blob/HEAD/package.json) handles a key part of this chapter's functionality: +The `bunfig` module in [`bunfig.toml`](https://github.com/superset-sh/superset/blob/HEAD/bunfig.toml) handles a key part of this chapter's functionality: + +```toml +[install] +linker = "isolated" # Prevent hoisting from resolving `path-scurry@2` to `lru-cache@6` (missing `LRUCache`), which breaks the `@superset/desktop` postinstall native rebuild. + +``` + +This module is important because it defines how Superset Terminal Tutorial: Command Center for Parallel Coding Agents implements the patterns covered in this chapter. + +### `.codex/config.toml` + +The `config` module in [`.codex/config.toml`](https://github.com/superset-sh/superset/blob/HEAD/.codex/config.toml) handles a key part of this chapter's functionality: + +```toml +[mcp_servers.superset] +type = "sse" +url = "https://api.superset.sh/api/agent/mcp" + +[mcp_servers.expo-mcp] +type = "sse" +url = "https://mcp.expo.dev/mcp" +enabled = false + +[mcp_servers.maestro] +command = "maestro" +args = ["mcp"] + +[mcp_servers.neon] +type = "sse" +url = "https://mcp.neon.tech/mcp" + +[mcp_servers.linear] +type = "sse" +url = "https://mcp.linear.app/mcp" + +[mcp_servers.sentry] +type = "sse" +url = "https://mcp.sentry.dev/mcp" + + +[mcp_servers.desktop-automation] +command = "bun" +args = ["run", "packages/desktop-mcp/src/bin.ts"] -```json -{ - "name": "@superset/repo", - "version": "0.0.0", - "repository": { - "type": "git" - }, - "devDependencies": { - "@biomejs/biome": "2.4.2", - "dotenv-cli": "^11.0.0", - "sherif": "^1.10.0", - "turbo": "^2.8.7" - }, - "description": "Superset Monorepo", - "homepage": "https://superset.sh", - "license": "Elastic-2.0", - "packageManager": "bun@1.3.6", - "private": true, - "scripts": { - "dev": "turbo run dev dev:caddy --filter=@superset/api --filter=@superset/web --filter=@superset/desktop --filter=electric-proxy --filter=//", - "dev:all": "turbo dev", - "dev:caddy": "dotenv -- caddy run --config Caddyfile", - "dev:docs": "turbo dev --filter=@superset/docs", - "dev:marketing": "turbo dev --filter=@superset/marketing --filter=@superset/docs", - "build": "turbo build --filter=@superset/desktop", - "test": "turbo test", - "lint": "./scripts/lint.sh", - "check:desktop-git-env": "./scripts/check-desktop-git-env.sh", - "lint:fix": "bunx @biomejs/biome@2.4.2 migrate --write && bunx @biomejs/biome@2.4.2 check --write --unsafe .", - "format": "bunx @biomejs/biome@2.4.2 format --write .", - "format:check": "bunx @biomejs/biome@2.4.2 format .", - "typecheck": "turbo typecheck", - "ui-add": "turbo run ui-add", - "postinstall": "./scripts/postinstall.sh", - "clean": "git clean -xdf node_modules", - "clean:workspaces": "turbo clean", ``` This module is important because it defines how Superset Terminal Tutorial: Command Center for Parallel Coding Agents implements the patterns covered in this chapter. @@ -127,52 +132,14 @@ The `.mcp` module in [`.mcp.json`](https://github.com/superset-sh/superset/blob/ This module is important because it defines how Superset Terminal Tutorial: Command Center for Parallel Coding Agents implements the patterns covered in this chapter. -### `.mastracode/mcp.json` - -The `mcp` module in [`.mastracode/mcp.json`](https://github.com/superset-sh/superset/blob/HEAD/.mastracode/mcp.json) handles a key part of this chapter's functionality: - -```json -{ - "mcpServers": { - "superset": { - "command": "npx", - "args": ["-y", "mcp-remote", "https://api.superset.sh/api/agent/mcp"] - }, - "maestro": { - "command": "maestro", - "args": ["mcp"] - }, - "neon": { - "command": "npx", - "args": ["-y", "mcp-remote", "https://mcp.neon.tech/mcp"] - }, - "linear": { - "command": "npx", - "args": ["-y", "mcp-remote", "https://mcp.linear.app/mcp"] - }, - "sentry": { - "command": "npx", - "args": ["-y", "mcp-remote", "https://mcp.sentry.dev/mcp"] - }, - "desktop-automation": { - "command": "bun", - "args": ["run", "packages/desktop-mcp/src/bin.ts"] - } - } -} - -``` - -This module is important because it defines how Superset Terminal Tutorial: Command Center for Parallel Coding Agents implements the patterns covered in this chapter. - ## How These Components Connect ```mermaid flowchart TD - A[package] - B[.mcp] - C[mcp] + A[bunfig] + B[config] + C[.mcp] A --> B B --> C ``` diff --git a/tutorials/superset-terminal-tutorial/07-runtime-and-package-architecture.md b/tutorials/superset-terminal-tutorial/07-runtime-and-package-architecture.md index 2e02766..8014d78 100644 --- a/tutorials/superset-terminal-tutorial/07-runtime-and-package-architecture.md +++ b/tutorials/superset-terminal-tutorial/07-runtime-and-package-architecture.md @@ -32,50 +32,55 @@ You now have a contributor-level map of Superset runtime boundaries. Next: [Chapter 8: Production Team Operations](08-production-team-operations.md) -## Depth Expansion Playbook - ## Source Code Walkthrough -### `package.json` +### `bunfig.toml` -The `package` module in [`package.json`](https://github.com/superset-sh/superset/blob/HEAD/package.json) handles a key part of this chapter's functionality: +The `bunfig` module in [`bunfig.toml`](https://github.com/superset-sh/superset/blob/HEAD/bunfig.toml) handles a key part of this chapter's functionality: + +```toml +[install] +linker = "isolated" # Prevent hoisting from resolving `path-scurry@2` to `lru-cache@6` (missing `LRUCache`), which breaks the `@superset/desktop` postinstall native rebuild. + +``` + +This module is important because it defines how Superset Terminal Tutorial: Command Center for Parallel Coding Agents implements the patterns covered in this chapter. + +### `.codex/config.toml` + +The `config` module in [`.codex/config.toml`](https://github.com/superset-sh/superset/blob/HEAD/.codex/config.toml) handles a key part of this chapter's functionality: + +```toml +[mcp_servers.superset] +type = "sse" +url = "https://api.superset.sh/api/agent/mcp" + +[mcp_servers.expo-mcp] +type = "sse" +url = "https://mcp.expo.dev/mcp" +enabled = false + +[mcp_servers.maestro] +command = "maestro" +args = ["mcp"] + +[mcp_servers.neon] +type = "sse" +url = "https://mcp.neon.tech/mcp" + +[mcp_servers.linear] +type = "sse" +url = "https://mcp.linear.app/mcp" + +[mcp_servers.sentry] +type = "sse" +url = "https://mcp.sentry.dev/mcp" + + +[mcp_servers.desktop-automation] +command = "bun" +args = ["run", "packages/desktop-mcp/src/bin.ts"] -```json -{ - "name": "@superset/repo", - "version": "0.0.0", - "repository": { - "type": "git" - }, - "devDependencies": { - "@biomejs/biome": "2.4.2", - "dotenv-cli": "^11.0.0", - "sherif": "^1.10.0", - "turbo": "^2.8.7" - }, - "description": "Superset Monorepo", - "homepage": "https://superset.sh", - "license": "Elastic-2.0", - "packageManager": "bun@1.3.6", - "private": true, - "scripts": { - "dev": "turbo run dev dev:caddy --filter=@superset/api --filter=@superset/web --filter=@superset/desktop --filter=electric-proxy --filter=//", - "dev:all": "turbo dev", - "dev:caddy": "dotenv -- caddy run --config Caddyfile", - "dev:docs": "turbo dev --filter=@superset/docs", - "dev:marketing": "turbo dev --filter=@superset/marketing --filter=@superset/docs", - "build": "turbo build --filter=@superset/desktop", - "test": "turbo test", - "lint": "./scripts/lint.sh", - "check:desktop-git-env": "./scripts/check-desktop-git-env.sh", - "lint:fix": "bunx @biomejs/biome@2.4.2 migrate --write && bunx @biomejs/biome@2.4.2 check --write --unsafe .", - "format": "bunx @biomejs/biome@2.4.2 format --write .", - "format:check": "bunx @biomejs/biome@2.4.2 format .", - "typecheck": "turbo typecheck", - "ui-add": "turbo run ui-add", - "postinstall": "./scripts/postinstall.sh", - "clean": "git clean -xdf node_modules", - "clean:workspaces": "turbo clean", ``` This module is important because it defines how Superset Terminal Tutorial: Command Center for Parallel Coding Agents implements the patterns covered in this chapter. @@ -124,52 +129,14 @@ The `.mcp` module in [`.mcp.json`](https://github.com/superset-sh/superset/blob/ This module is important because it defines how Superset Terminal Tutorial: Command Center for Parallel Coding Agents implements the patterns covered in this chapter. -### `.mastracode/mcp.json` - -The `mcp` module in [`.mastracode/mcp.json`](https://github.com/superset-sh/superset/blob/HEAD/.mastracode/mcp.json) handles a key part of this chapter's functionality: - -```json -{ - "mcpServers": { - "superset": { - "command": "npx", - "args": ["-y", "mcp-remote", "https://api.superset.sh/api/agent/mcp"] - }, - "maestro": { - "command": "maestro", - "args": ["mcp"] - }, - "neon": { - "command": "npx", - "args": ["-y", "mcp-remote", "https://mcp.neon.tech/mcp"] - }, - "linear": { - "command": "npx", - "args": ["-y", "mcp-remote", "https://mcp.linear.app/mcp"] - }, - "sentry": { - "command": "npx", - "args": ["-y", "mcp-remote", "https://mcp.sentry.dev/mcp"] - }, - "desktop-automation": { - "command": "bun", - "args": ["run", "packages/desktop-mcp/src/bin.ts"] - } - } -} - -``` - -This module is important because it defines how Superset Terminal Tutorial: Command Center for Parallel Coding Agents implements the patterns covered in this chapter. - ## How These Components Connect ```mermaid flowchart TD - A[package] - B[.mcp] - C[mcp] + A[bunfig] + B[config] + C[.mcp] A --> B B --> C ``` diff --git a/tutorials/superset-terminal-tutorial/08-production-team-operations.md b/tutorials/superset-terminal-tutorial/08-production-team-operations.md index d13e745..8dc2e28 100644 --- a/tutorials/superset-terminal-tutorial/08-production-team-operations.md +++ b/tutorials/superset-terminal-tutorial/08-production-team-operations.md @@ -30,50 +30,55 @@ Team adoption of Superset needs explicit standards for workspace ownership, qual You now have an operations baseline for running Superset as a team-scale multi-agent command center. -## Depth Expansion Playbook - ## Source Code Walkthrough -### `package.json` +### `bunfig.toml` -The `package` module in [`package.json`](https://github.com/superset-sh/superset/blob/HEAD/package.json) handles a key part of this chapter's functionality: +The `bunfig` module in [`bunfig.toml`](https://github.com/superset-sh/superset/blob/HEAD/bunfig.toml) handles a key part of this chapter's functionality: + +```toml +[install] +linker = "isolated" # Prevent hoisting from resolving `path-scurry@2` to `lru-cache@6` (missing `LRUCache`), which breaks the `@superset/desktop` postinstall native rebuild. + +``` + +This module is important because it defines how Superset Terminal Tutorial: Command Center for Parallel Coding Agents implements the patterns covered in this chapter. + +### `.codex/config.toml` + +The `config` module in [`.codex/config.toml`](https://github.com/superset-sh/superset/blob/HEAD/.codex/config.toml) handles a key part of this chapter's functionality: + +```toml +[mcp_servers.superset] +type = "sse" +url = "https://api.superset.sh/api/agent/mcp" + +[mcp_servers.expo-mcp] +type = "sse" +url = "https://mcp.expo.dev/mcp" +enabled = false + +[mcp_servers.maestro] +command = "maestro" +args = ["mcp"] + +[mcp_servers.neon] +type = "sse" +url = "https://mcp.neon.tech/mcp" + +[mcp_servers.linear] +type = "sse" +url = "https://mcp.linear.app/mcp" + +[mcp_servers.sentry] +type = "sse" +url = "https://mcp.sentry.dev/mcp" + + +[mcp_servers.desktop-automation] +command = "bun" +args = ["run", "packages/desktop-mcp/src/bin.ts"] -```json -{ - "name": "@superset/repo", - "version": "0.0.0", - "repository": { - "type": "git" - }, - "devDependencies": { - "@biomejs/biome": "2.4.2", - "dotenv-cli": "^11.0.0", - "sherif": "^1.10.0", - "turbo": "^2.8.7" - }, - "description": "Superset Monorepo", - "homepage": "https://superset.sh", - "license": "Elastic-2.0", - "packageManager": "bun@1.3.6", - "private": true, - "scripts": { - "dev": "turbo run dev dev:caddy --filter=@superset/api --filter=@superset/web --filter=@superset/desktop --filter=electric-proxy --filter=//", - "dev:all": "turbo dev", - "dev:caddy": "dotenv -- caddy run --config Caddyfile", - "dev:docs": "turbo dev --filter=@superset/docs", - "dev:marketing": "turbo dev --filter=@superset/marketing --filter=@superset/docs", - "build": "turbo build --filter=@superset/desktop", - "test": "turbo test", - "lint": "./scripts/lint.sh", - "check:desktop-git-env": "./scripts/check-desktop-git-env.sh", - "lint:fix": "bunx @biomejs/biome@2.4.2 migrate --write && bunx @biomejs/biome@2.4.2 check --write --unsafe .", - "format": "bunx @biomejs/biome@2.4.2 format --write .", - "format:check": "bunx @biomejs/biome@2.4.2 format .", - "typecheck": "turbo typecheck", - "ui-add": "turbo run ui-add", - "postinstall": "./scripts/postinstall.sh", - "clean": "git clean -xdf node_modules", - "clean:workspaces": "turbo clean", ``` This module is important because it defines how Superset Terminal Tutorial: Command Center for Parallel Coding Agents implements the patterns covered in this chapter. @@ -122,52 +127,14 @@ The `.mcp` module in [`.mcp.json`](https://github.com/superset-sh/superset/blob/ This module is important because it defines how Superset Terminal Tutorial: Command Center for Parallel Coding Agents implements the patterns covered in this chapter. -### `.mastracode/mcp.json` - -The `mcp` module in [`.mastracode/mcp.json`](https://github.com/superset-sh/superset/blob/HEAD/.mastracode/mcp.json) handles a key part of this chapter's functionality: - -```json -{ - "mcpServers": { - "superset": { - "command": "npx", - "args": ["-y", "mcp-remote", "https://api.superset.sh/api/agent/mcp"] - }, - "maestro": { - "command": "maestro", - "args": ["mcp"] - }, - "neon": { - "command": "npx", - "args": ["-y", "mcp-remote", "https://mcp.neon.tech/mcp"] - }, - "linear": { - "command": "npx", - "args": ["-y", "mcp-remote", "https://mcp.linear.app/mcp"] - }, - "sentry": { - "command": "npx", - "args": ["-y", "mcp-remote", "https://mcp.sentry.dev/mcp"] - }, - "desktop-automation": { - "command": "bun", - "args": ["run", "packages/desktop-mcp/src/bin.ts"] - } - } -} - -``` - -This module is important because it defines how Superset Terminal Tutorial: Command Center for Parallel Coding Agents implements the patterns covered in this chapter. - ## How These Components Connect ```mermaid flowchart TD - A[package] - B[.mcp] - C[mcp] + A[bunfig] + B[config] + C[.mcp] A --> B B --> C ``` diff --git a/tutorials/tabby-tutorial/01-getting-started-and-first-server.md b/tutorials/tabby-tutorial/01-getting-started-and-first-server.md index d7ddc72..00e2600 100644 --- a/tutorials/tabby-tutorial/01-getting-started-and-first-server.md +++ b/tutorials/tabby-tutorial/01-getting-started-and-first-server.md @@ -73,55 +73,38 @@ You now have a working Tabby deployment with at least one connected editor clien Next: [Chapter 2: Architecture and Runtime Components](02-architecture-and-runtime-components.md) -## Depth Expansion Playbook - ## Source Code Walkthrough -### `website/docusaurus.config.js` - -The `tailwind` function in [`website/docusaurus.config.js`](https://github.com/TabbyML/tabby/blob/HEAD/website/docusaurus.config.js) handles a key part of this chapter's functionality: - -```js - - plugins: [ - async function tailwind(context, options) { - return { - name: "docusaurus-tailwindcss", - configurePostCss(postcssOptions) { - // Appends TailwindCSS and AutoPrefixer. - postcssOptions.plugins.push(require("tailwindcss")); - postcssOptions.plugins.push(require("autoprefixer")); - return postcssOptions; - }, - }; - }, - [ - "posthog-docusaurus", - { - apiKey: "phc_aBzNGHzlOy2C8n1BBDtH7d4qQsIw9d8T0unVlnKfdxB", - appUrl: "https://app.posthog.com", - enableInDevelopment: false, - }, - ], - [ - '@docusaurus/plugin-client-redirects', - { - redirects: [ - { - to: '/blog/2024/02/05/create-tabby-extension-with-language-server-protocol', - from: '/blog/running-tabby-as-a-language-server' - }, - { - to: '/blog/2023/09/05/deploy-tabby-to-huggingface-space', - from: '/blog/deploy-tabby-to-huggingface-space.md', +### `rules/use-schema-result.yml` + +The `severity` interface in [`rules/use-schema-result.yml`](https://github.com/TabbyML/tabby/blob/HEAD/rules/use-schema-result.yml) handles a key part of this chapter's functionality: + +```yml +id: use-schema-result +message: Use schema::Result as API interface +severity: error +language: rust +files: +- ./ee/tabby-schema/src/** +ignores: +- ./ee/tabby-schema/src/lib.rs +- ./ee/tabby-schema/src/dao.rs +rule: + any: + - pattern: anyhow + not: + inside: + kind: enum_variant + stopBy: end + - pattern: FieldResult ``` -This function is important because it defines how Tabby Tutorial: Self-Hosted AI Coding Assistant Architecture and Operations implements the patterns covered in this chapter. +This interface is important because it defines how Tabby Tutorial: Self-Hosted AI Coding Assistant Architecture and Operations implements the patterns covered in this chapter. ## How These Components Connect ```mermaid flowchart TD - A[tailwind] + A[severity] ``` diff --git a/tutorials/tabby-tutorial/02-architecture-and-runtime-components.md b/tutorials/tabby-tutorial/02-architecture-and-runtime-components.md index 03c29c9..0add7d4 100644 --- a/tutorials/tabby-tutorial/02-architecture-and-runtime-components.md +++ b/tutorials/tabby-tutorial/02-architecture-and-runtime-components.md @@ -76,40 +76,53 @@ You now have a structural map for where behavior lives and how requests move acr Next: [Chapter 3: Model Serving and Completion Pipeline](03-model-serving-and-completion-pipeline.md) -## Depth Expansion Playbook - ## Source Code Walkthrough -### `rules/use-schema-result.yml` - -The `severity` interface in [`rules/use-schema-result.yml`](https://github.com/TabbyML/tabby/blob/HEAD/rules/use-schema-result.yml) handles a key part of this chapter's functionality: - -```yml -id: use-schema-result -message: Use schema::Result as API interface -severity: error -language: rust -files: -- ./ee/tabby-schema/src/** -ignores: -- ./ee/tabby-schema/src/lib.rs -- ./ee/tabby-schema/src/dao.rs -rule: - any: - - pattern: anyhow - not: - inside: - kind: enum_variant - stopBy: end - - pattern: FieldResult +### `website/docusaurus.config.js` + +The `tailwind` function in [`website/docusaurus.config.js`](https://github.com/TabbyML/tabby/blob/HEAD/website/docusaurus.config.js) handles a key part of this chapter's functionality: + +```js + + plugins: [ + async function tailwind(context, options) { + return { + name: "docusaurus-tailwindcss", + configurePostCss(postcssOptions) { + // Appends TailwindCSS and AutoPrefixer. + postcssOptions.plugins.push(require("tailwindcss")); + postcssOptions.plugins.push(require("autoprefixer")); + return postcssOptions; + }, + }; + }, + [ + "posthog-docusaurus", + { + apiKey: "phc_aBzNGHzlOy2C8n1BBDtH7d4qQsIw9d8T0unVlnKfdxB", + appUrl: "https://app.posthog.com", + enableInDevelopment: false, + }, + ], + [ + '@docusaurus/plugin-client-redirects', + { + redirects: [ + { + to: '/blog/2024/02/05/create-tabby-extension-with-language-server-protocol', + from: '/blog/running-tabby-as-a-language-server' + }, + { + to: '/blog/2023/09/05/deploy-tabby-to-huggingface-space', + from: '/blog/deploy-tabby-to-huggingface-space.md', ``` -This interface is important because it defines how Tabby Tutorial: Self-Hosted AI Coding Assistant Architecture and Operations implements the patterns covered in this chapter. +This function is important because it defines how Tabby Tutorial: Self-Hosted AI Coding Assistant Architecture and Operations implements the patterns covered in this chapter. ## How These Components Connect ```mermaid flowchart TD - A[severity] + A[tailwind] ``` diff --git a/tutorials/tabby-tutorial/03-model-serving-and-completion-pipeline.md b/tutorials/tabby-tutorial/03-model-serving-and-completion-pipeline.md index 03eaad6..122ebb0 100644 --- a/tutorials/tabby-tutorial/03-model-serving-and-completion-pipeline.md +++ b/tutorials/tabby-tutorial/03-model-serving-and-completion-pipeline.md @@ -72,8 +72,6 @@ You now understand how model role separation drives both quality and operational Next: [Chapter 4: Answer Engine and Context Indexing](04-answer-engine-and-context-indexing.md) -## Depth Expansion Playbook - ## Source Code Walkthrough ### `python/tabby/trainer.py` diff --git a/tutorials/tabby-tutorial/04-answer-engine-and-context-indexing.md b/tutorials/tabby-tutorial/04-answer-engine-and-context-indexing.md index 20d9d90..57a3c07 100644 --- a/tutorials/tabby-tutorial/04-answer-engine-and-context-indexing.md +++ b/tutorials/tabby-tutorial/04-answer-engine-and-context-indexing.md @@ -61,8 +61,6 @@ You now have a practical model for operating Tabby as a context-grounded assista Next: [Chapter 5: Editor Agents and Client Integrations](05-editor-agents-and-client-integrations.md) -## Depth Expansion Playbook - ## Source Code Walkthrough ### `python/tabby/trainer.py` diff --git a/tutorials/tabby-tutorial/05-editor-agents-and-client-integrations.md b/tutorials/tabby-tutorial/05-editor-agents-and-client-integrations.md index fe52e26..999c3e0 100644 --- a/tutorials/tabby-tutorial/05-editor-agents-and-client-integrations.md +++ b/tutorials/tabby-tutorial/05-editor-agents-and-client-integrations.md @@ -61,8 +61,6 @@ You now know how to integrate Tabby clients beyond default setup paths and keep Next: [Chapter 6: Configuration, Security, and Enterprise Controls](06-configuration-security-and-enterprise-controls.md) -## Depth Expansion Playbook - ## Source Code Walkthrough ### `python/tabby/trainer.py` diff --git a/tutorials/tabby-tutorial/06-configuration-security-and-enterprise-controls.md b/tutorials/tabby-tutorial/06-configuration-security-and-enterprise-controls.md index e893ca4..bc0d198 100644 --- a/tutorials/tabby-tutorial/06-configuration-security-and-enterprise-controls.md +++ b/tutorials/tabby-tutorial/06-configuration-security-and-enterprise-controls.md @@ -64,8 +64,6 @@ You now have a concrete security checklist for moving Tabby into shared environm Next: [Chapter 7: Operations, Upgrades, and Observability](07-operations-upgrades-and-observability.md) -## Depth Expansion Playbook - ## Source Code Walkthrough ### `python/tabby/trainer.py` diff --git a/tutorials/tabby-tutorial/07-operations-upgrades-and-observability.md b/tutorials/tabby-tutorial/07-operations-upgrades-and-observability.md index b45acc9..7b52bd2 100644 --- a/tutorials/tabby-tutorial/07-operations-upgrades-and-observability.md +++ b/tutorials/tabby-tutorial/07-operations-upgrades-and-observability.md @@ -54,37 +54,48 @@ You now have a practical operations frame for safely evolving Tabby over time. Next: [Chapter 8: Contribution, Roadmap, and Team Adoption](08-contribution-roadmap-and-team-adoption.md) -## Depth Expansion Playbook - ## Source Code Walkthrough -### `.changie.yaml` - -The `.changie` module in [`.changie.yaml`](https://github.com/TabbyML/tabby/blob/HEAD/.changie.yaml) handles a key part of this chapter's functionality: - -```yaml -changesDir: .changes -unreleasedDir: unreleased -headerPath: header.tpl.md -changelogPath: CHANGELOG.md -versionExt: md -versionFormat: '## {{.Version}} ({{.Time.Format "2006-01-02"}})' -kindFormat: '### {{.Kind}}' -changeFormat: '* {{.Body}}' -kinds: -- label: Notice - auto: minor -- label: Features - auto: minor -- label: Fixed and Improvements - auto: patch -newlines: - afterChangelogHeader: 1 - afterKind: 1 - afterChangelogVersion: 1 - beforeKind: 1 - endOfVersion: 1 -envPrefix: CHANGIE_ +### `Cargo.toml` + +The `Cargo` module in [`Cargo.toml`](https://github.com/TabbyML/tabby/blob/HEAD/Cargo.toml) handles a key part of this chapter's functionality: + +```toml +[workspace] +resolver = "1" +members = [ + "crates/tabby", + "crates/tabby-common", + "crates/tabby-download", + "crates/tabby-git", + "crates/tabby-inference", + "crates/tabby-index", + "crates/tabby-crawler", + + "crates/aim-downloader", + "crates/http-api-bindings", + "crates/llama-cpp-server", + "crates/ollama-api-bindings", + "crates/tabby-index-cli", + "crates/hash-ids", + "crates/sqlx-migrate-validate", + + "ee/tabby-webserver", + "ee/tabby-db", + "ee/tabby-db-macros", + "ee/tabby-schema", +] + +[workspace.package] +version = "0.33.0-dev.0" +edition = "2021" +authors = ["TabbyML Team"] +homepage = "https://github.com/TabbyML/tabby" + +[workspace.dependencies] +cached = "0.49.3" +lazy_static = "1.4.0" +serde = { version = "1.0", features = ["derive"] } ``` This module is important because it defines how Tabby Tutorial: Self-Hosted AI Coding Assistant Architecture and Operations implements the patterns covered in this chapter. @@ -94,5 +105,5 @@ This module is important because it defines how Tabby Tutorial: Self-Hosted AI C ```mermaid flowchart TD - A[.changie] + A[Cargo] ``` diff --git a/tutorials/tabby-tutorial/08-contribution-roadmap-and-team-adoption.md b/tutorials/tabby-tutorial/08-contribution-roadmap-and-team-adoption.md index c574a08..f107d5a 100644 --- a/tutorials/tabby-tutorial/08-contribution-roadmap-and-team-adoption.md +++ b/tutorials/tabby-tutorial/08-contribution-roadmap-and-team-adoption.md @@ -52,37 +52,48 @@ You now have a full lifecycle mental model for adopting, operating, and extendin Next: pick a related implementation track such as [Continue](../continue-tutorial/) or [OpenCode](../opencode-tutorial/). -## Depth Expansion Playbook - ## Source Code Walkthrough -### `.changie.yaml` - -The `.changie` module in [`.changie.yaml`](https://github.com/TabbyML/tabby/blob/HEAD/.changie.yaml) handles a key part of this chapter's functionality: - -```yaml -changesDir: .changes -unreleasedDir: unreleased -headerPath: header.tpl.md -changelogPath: CHANGELOG.md -versionExt: md -versionFormat: '## {{.Version}} ({{.Time.Format "2006-01-02"}})' -kindFormat: '### {{.Kind}}' -changeFormat: '* {{.Body}}' -kinds: -- label: Notice - auto: minor -- label: Features - auto: minor -- label: Fixed and Improvements - auto: patch -newlines: - afterChangelogHeader: 1 - afterKind: 1 - afterChangelogVersion: 1 - beforeKind: 1 - endOfVersion: 1 -envPrefix: CHANGIE_ +### `Cargo.toml` + +The `Cargo` module in [`Cargo.toml`](https://github.com/TabbyML/tabby/blob/HEAD/Cargo.toml) handles a key part of this chapter's functionality: + +```toml +[workspace] +resolver = "1" +members = [ + "crates/tabby", + "crates/tabby-common", + "crates/tabby-download", + "crates/tabby-git", + "crates/tabby-inference", + "crates/tabby-index", + "crates/tabby-crawler", + + "crates/aim-downloader", + "crates/http-api-bindings", + "crates/llama-cpp-server", + "crates/ollama-api-bindings", + "crates/tabby-index-cli", + "crates/hash-ids", + "crates/sqlx-migrate-validate", + + "ee/tabby-webserver", + "ee/tabby-db", + "ee/tabby-db-macros", + "ee/tabby-schema", +] + +[workspace.package] +version = "0.33.0-dev.0" +edition = "2021" +authors = ["TabbyML Team"] +homepage = "https://github.com/TabbyML/tabby" + +[workspace.dependencies] +cached = "0.49.3" +lazy_static = "1.4.0" +serde = { version = "1.0", features = ["derive"] } ``` This module is important because it defines how Tabby Tutorial: Self-Hosted AI Coding Assistant Architecture and Operations implements the patterns covered in this chapter. @@ -92,5 +103,5 @@ This module is important because it defines how Tabby Tutorial: Self-Hosted AI C ```mermaid flowchart TD - A[.changie] + A[Cargo] ``` diff --git a/tutorials/use-mcp-tutorial/01-getting-started-and-archived-context.md b/tutorials/use-mcp-tutorial/01-getting-started-and-archived-context.md index 0a1a7a6..e182eb8 100644 --- a/tutorials/use-mcp-tutorial/01-getting-started-and-archived-context.md +++ b/tutorials/use-mcp-tutorial/01-getting-started-and-archived-context.md @@ -39,8 +39,6 @@ You now have a setup and risk baseline for evaluating `use-mcp` usage. Next: [Chapter 2: Hook Architecture and Connection Lifecycle](02-hook-architecture-and-connection-lifecycle.md) -## Depth Expansion Playbook - ## Source Code Walkthrough ### `src/auth/browser-provider.ts` diff --git a/tutorials/use-mcp-tutorial/02-hook-architecture-and-connection-lifecycle.md b/tutorials/use-mcp-tutorial/02-hook-architecture-and-connection-lifecycle.md index 01a1a06..a257af2 100644 --- a/tutorials/use-mcp-tutorial/02-hook-architecture-and-connection-lifecycle.md +++ b/tutorials/use-mcp-tutorial/02-hook-architecture-and-connection-lifecycle.md @@ -40,8 +40,6 @@ You now have a lifecycle model for robust hook-driven MCP client UX. Next: [Chapter 3: Authentication, OAuth Callback, and Storage](03-authentication-oauth-callback-and-storage.md) -## Depth Expansion Playbook - ## Source Code Walkthrough ### `src/auth/browser-provider.ts` diff --git a/tutorials/use-mcp-tutorial/03-authentication-oauth-callback-and-storage.md b/tutorials/use-mcp-tutorial/03-authentication-oauth-callback-and-storage.md index 6f37031..ec3070b 100644 --- a/tutorials/use-mcp-tutorial/03-authentication-oauth-callback-and-storage.md +++ b/tutorials/use-mcp-tutorial/03-authentication-oauth-callback-and-storage.md @@ -38,8 +38,6 @@ You now have a safer OAuth and auth-state handling model for React MCP clients. Next: [Chapter 4: Tools, Resources, Prompts, and Client Operations](04-tools-resources-prompts-and-client-operations.md) -## Depth Expansion Playbook - ## Source Code Walkthrough ### `src/auth/callback.ts` diff --git a/tutorials/use-mcp-tutorial/04-tools-resources-prompts-and-client-operations.md b/tutorials/use-mcp-tutorial/04-tools-resources-prompts-and-client-operations.md index f124ad9..db9639b 100644 --- a/tutorials/use-mcp-tutorial/04-tools-resources-prompts-and-client-operations.md +++ b/tutorials/use-mcp-tutorial/04-tools-resources-prompts-and-client-operations.md @@ -39,8 +39,6 @@ You now have an operations model for integrating MCP capabilities into React wor Next: [Chapter 5: Transport, Retry, and Reconnect Strategy](05-transport-retry-and-reconnect-strategy.md) -## Depth Expansion Playbook - ## Source Code Walkthrough ### `src/auth/types.ts` diff --git a/tutorials/use-mcp-tutorial/05-transport-retry-and-reconnect-strategy.md b/tutorials/use-mcp-tutorial/05-transport-retry-and-reconnect-strategy.md index 502e107..c2cc18e 100644 --- a/tutorials/use-mcp-tutorial/05-transport-retry-and-reconnect-strategy.md +++ b/tutorials/use-mcp-tutorial/05-transport-retry-and-reconnect-strategy.md @@ -38,8 +38,6 @@ You now have a practical resilience model for browser-based MCP client sessions. Next: [Chapter 6: React Integration Patterns: Chat UI and Inspector](06-react-integration-patterns-chat-ui-and-inspector.md) -## Depth Expansion Playbook - ## Source Code Walkthrough ### `examples/chat-ui/api/index.ts` diff --git a/tutorials/use-mcp-tutorial/06-react-integration-patterns-chat-ui-and-inspector.md b/tutorials/use-mcp-tutorial/06-react-integration-patterns-chat-ui-and-inspector.md index 9acd4c7..17fc7c3 100644 --- a/tutorials/use-mcp-tutorial/06-react-integration-patterns-chat-ui-and-inspector.md +++ b/tutorials/use-mcp-tutorial/06-react-integration-patterns-chat-ui-and-inspector.md @@ -39,8 +39,6 @@ You now have an example-driven component architecture model for MCP-enabled Reac Next: [Chapter 7: Testing, Debugging, and Integration Servers](07-testing-debugging-and-integration-servers.md) -## Depth Expansion Playbook - ## Source Code Walkthrough ### `examples/chat-ui/scripts/update-models.ts` diff --git a/tutorials/use-mcp-tutorial/07-testing-debugging-and-integration-servers.md b/tutorials/use-mcp-tutorial/07-testing-debugging-and-integration-servers.md index aa5c5be..6a2a8df 100644 --- a/tutorials/use-mcp-tutorial/07-testing-debugging-and-integration-servers.md +++ b/tutorials/use-mcp-tutorial/07-testing-debugging-and-integration-servers.md @@ -38,8 +38,6 @@ You now have a repeatable verification framework for `use-mcp` integrations. Next: [Chapter 8: Maintenance Risk, Migration, and Production Guidance](08-maintenance-risk-migration-and-production-guidance.md) -## Depth Expansion Playbook - ## Source Code Walkthrough ### `examples/chat-ui/scripts/update-models.ts` diff --git a/tutorials/use-mcp-tutorial/08-maintenance-risk-migration-and-production-guidance.md b/tutorials/use-mcp-tutorial/08-maintenance-risk-migration-and-production-guidance.md index c1e645d..f8d6644 100644 --- a/tutorials/use-mcp-tutorial/08-maintenance-risk-migration-and-production-guidance.md +++ b/tutorials/use-mcp-tutorial/08-maintenance-risk-migration-and-production-guidance.md @@ -41,8 +41,6 @@ You now have a pragmatic operating and migration strategy for `use-mcp` deployme Return to the [use-mcp Tutorial index](README.md). -## Depth Expansion Playbook - ## Source Code Walkthrough ### `examples/chat-ui/scripts/update-models.ts`