From 2e72095f11ba43e21fd727e5dbdde6eebd81738a Mon Sep 17 00:00:00 2001 From: yia-mw-agent Date: Fri, 30 Oct 2026 18:48:50 +0000 Subject: [PATCH 1/2] feat: add the Claude marketplace entry and hosted-game setup Adds a one-plugin Claude marketplace for the hosted Tic Tac Toe game, direct URL setup for Claude and ChatGPT on the web, data-handling notes, the Apache-2.0 license, and the release input the SDK's publish tooling reads. --- .claude-plugin/marketplace.json | 20 ++ LICENSE | 202 ++++++++++++++++++ README.md | 38 +++- docs/tic-tac-toe-data-handling.md | 29 +++ package.json | 4 +- .../.claude-plugin/plugin.json | 18 ++ plugins/saga-tic-tac-toe/.mcp.json | 8 + plugins/saga-tic-tac-toe/LICENSE | 202 ++++++++++++++++++ plugins/saga-tic-tac-toe/README.md | 16 ++ .../skills/play-tic-tac-toe/SKILL.md | 17 ++ saga-publication.json | 67 ++++++ scripts/stage-publication.mjs | 22 ++ 12 files changed, 640 insertions(+), 3 deletions(-) create mode 100644 .claude-plugin/marketplace.json create mode 100644 LICENSE create mode 100644 docs/tic-tac-toe-data-handling.md create mode 100644 plugins/saga-tic-tac-toe/.claude-plugin/plugin.json create mode 100644 plugins/saga-tic-tac-toe/.mcp.json create mode 100644 plugins/saga-tic-tac-toe/LICENSE create mode 100644 plugins/saga-tic-tac-toe/README.md create mode 100644 plugins/saga-tic-tac-toe/skills/play-tic-tac-toe/SKILL.md create mode 100644 saga-publication.json create mode 100644 scripts/stage-publication.mjs diff --git a/.claude-plugin/marketplace.json b/.claude-plugin/marketplace.json new file mode 100644 index 0000000..f4e12e0 --- /dev/null +++ b/.claude-plugin/marketplace.json @@ -0,0 +1,20 @@ +{ + "name": "saga-a2ui-examples", + "owner": { + "name": "MachineWisdom", + "url": "https://saga-ai.dev/" + }, + "metadata": { + "description": "Hosted SAGA A2UI example applications for Claude." + }, + "plugins": [ + { + "name": "saga-tic-tac-toe", + "source": "./plugins/saga-tic-tac-toe", + "description": "Play tic-tac-toe against Claude on a board inside the conversation. Uses the hosted example at https://examples.saga-ai.dev/tic-tac-toe/mcp.", + "category": "games", + "homepage": "https://github.com/MachineWisdomAI/saga-a2ui-examples", + "license": "Apache-2.0" + } + ] +} diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..d645695 --- /dev/null +++ b/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/README.md b/README.md index 1720947..669ceed 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,41 @@ Hosted SAGA A2UI example applications and Claude plugin marketplace. ## Tic Tac Toe (`apps/tic-tac-toe`) -A game of tic-tac-toe between a person (X) and an AI assistant (O), served as a Cloudflare Worker at `https://examples.saga-ai.dev/tic-tac-toe/mcp` once deployed. It offers four MCP tools: `new_game`, `show_game`, `get_game` and `play_move`. Games need no account and keep no transcript; anyone holding a game's unguessable ID can play either side. +A game of tic-tac-toe between a person (X) and an AI assistant (O), served as a Cloudflare Worker at `https://examples.saga-ai.dev/tic-tac-toe/mcp`. It offers four MCP tools: `new_game`, `show_game`, `get_game` and `play_move`. Games need no account and keep no transcript; anyone holding a game's unguessable ID can play either side. + +### Use the hosted game + +The game runs at **`https://examples.saga-ai.dev/tic-tac-toe/mcp`**. It needs no account or sign-in. What it stores, and for how long, is in [data handling](docs/tic-tac-toe-data-handling.md). Both hosts need access to custom MCP connections on the web; a managed workspace may need an administrator to enable it. + +**Claude, through the marketplace.** In Claude Code, add this repository's marketplace and install the plugin, which adds the endpoint above and a short skill: + +```text +/plugin marketplace add MachineWisdomAI/saga-a2ui-examples +/plugin install saga-tic-tac-toe@saga-a2ui-examples +``` + +The marketplace is [`.claude-plugin/marketplace.json`](.claude-plugin/marketplace.json); the plugin is [`plugins/saga-tic-tac-toe`](plugins/saga-tic-tac-toe). Its `.claude-plugin/plugin.json` and `.mcp.json` are the files `saga publish prepare --target claude` produces from [`saga-publication.json`](saga-publication.json); no second packager is used. The plugin is not a Claude Desktop extension, and installing it in Claude Code is not a claim about Claude on the web, which uses the direct setup below. + +**Claude on the web, direct URL.** Open **Customize → Connectors → Add custom connector**, name it **SAGA Tic Tac Toe**, enter the endpoint, and choose **No sign-in** when offered. Connect it, enable it from the connectors menu in a new chat and ask Claude to start a game. + +**ChatGPT on the web, direct URL.** Open **Plugins → + → Add custom MCP server**, name it **SAGA Tic Tac Toe**, enter the endpoint, and choose **No authentication**. Add and connect it, then select it in a new chat and ask to start a game. This is manual custom-MCP setup; directory approval is not required and is not claimed. + +What has been observed on the hosts (a record of limits, not a guarantee): + +- Claude on the web, with the direct connector: a game was played to a nine-move draw and the final card showed correctly, with the SAGA dragon and the credit, in the light and dark appearances. The first display of a card sometimes failed and recovered with the host's retry button; one card also failed to display after a turn. Claude's connector list showed a placeholder letter, not the dragon, beside the connector. +- ChatGPT on the web, with a custom plugin: the dragon uploaded for the plugin showed beside its mention and tool row, and a completed game reopened correctly in the light theme. After switching to the dark theme, an older card did not load in a reopened chat, and a new card was still loading when last observed. First-load reliability is not established on either host. +- The Claude marketplace installation itself has not yet been verified on a current Claude surface. + +### Publication preparation + +`saga-publication.json` is the release input for the SDK's `saga publish` tooling, with the publisher `MachineWisdom`. After `npm run build:view`, `npm run stage:publication` writes the two built view files it names (`new-game.html`, `show-game.html`) into `.stage/publication`, and the tooling, run from the pinned SDK revision, checks the live endpoint against them: + +```sh +npx tsx scripts/saga.ts publish check --target chatgpt --release /path/to/saga-publication.json +npx tsx scripts/saga.ts publish check --target claude --release /path/to/saga-publication.json +``` + +For this deployment the ChatGPT check is `ready`. The Claude check reports only what the Claude directory submission asks for and this repository does not hold: a review contact and carousel screenshots. They are not needed for the marketplace plugin or for direct setup, and no external directory submission is made. Checks and prepared files establish neither installation nor distribution; the registry state of the SDK packages is separate (see Release constraint). ### Where the code comes from @@ -51,4 +85,4 @@ The game needs `@saga-a2ui/react-mcp-stack` `0.11.0-rc.1`, which is **not yet pu ### Deployment -Not part of this change. `wrangler.jsonc` declares the Custom Domain route `examples.saga-ai.dev` (Cloudflare provisions DNS and TLS) and the Worker answers only the exact path `/tic-tac-toe/mcp` plus its icon files. Deploying, host checks and marketplace installation are separate steps. +Deploying is a separate, deliberate step; changing the marketplace or documentation deploys nothing. `wrangler.jsonc` declares the Custom Domain route `examples.saga-ai.dev` (Cloudflare provisions DNS and TLS) and the Worker answers only the exact path `/tic-tac-toe/mcp` plus its icon files. Deploying, host checks and marketplace installation are separate steps. diff --git a/docs/tic-tac-toe-data-handling.md b/docs/tic-tac-toe-data-handling.md new file mode 100644 index 0000000..7abd736 --- /dev/null +++ b/docs/tic-tac-toe-data-handling.md @@ -0,0 +1,29 @@ +# Tic Tac Toe: data handling + +This describes the hosted Tic Tac Toe example at `https://examples.saga-ai.dev/tic-tac-toe/mcp`, operated by MachineWisdom. The source that runs it is in this repository, so you can check each statement against [`apps/tic-tac-toe`](../apps/tic-tac-toe). + +## What it stores + +- **A game, and nothing else.** Creating a game stores its identifier, the nine squares, whose turn it is, the move number, how the game stands and the time it expires. One Cloudflare Durable Object holds each game in its own SQLite storage. +- **For 24 hours.** A game expires 24 hours after it was created. Playing, reading or reopening it never extends that. After the expiry the server reports the game unavailable, and a scheduled cleanup deletes the game's storage and the cleanup schedule itself. +- **Under an unguessable identifier.** Anyone who has a game's identifier can read it and play either side. Do not share it where you do not want others to join. + +## What it does not store + +- No account, sign-in, name, email address or other personal information. The game needs none, and the connector asks for no authentication. +- No conversation, prompt or transcript. The server receives only the tool calls the assistant or the board makes: start a game, show or read a game by its identifier, and play a square. +- No analytics, advertising or tracking of its own. The application writes no request log and does not use cookies. + +## Who else handles a request + +- **Your assistant's host (Claude or ChatGPT)** sends the tool calls and shows the board. Its handling of your conversation is governed by that host's terms and privacy policy, not by this one. +- **Cloudflare** hosts the Worker and its storage. Like any host, it processes requests (such as network addresses) to deliver and protect the service, under [Cloudflare's privacy policy](https://www.cloudflare.com/privacypolicy/). +- **The board** is one self-contained page: its script, styles and dragon artwork are inside it. Choosing "Built with saga a2ui" asks the host to open `https://saga-ai.dev/`. + +## Terms of use + +This is a free demonstration, provided as is and without warranty, under the [Apache License 2.0](../LICENSE). It may change or stop at any time, and its games are disposable. It is not meant for sensitive use. + +## Questions + +Open an issue in [this repository](https://github.com/MachineWisdomAI/saga-a2ui-examples/issues). diff --git a/package.json b/package.json index a273a18..f1313b4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,7 @@ { "name": "saga-a2ui-examples", "private": true, + "license": "Apache-2.0", "description": "Hosted SAGA A2UI example applications", "type": "module", "scripts": { @@ -12,7 +13,8 @@ "test:browser": "npm run build:view && playwright test", "check": "node scripts/check-icons.mjs && npm run typecheck && vitest run && npm run test:browser && npm run build", "pin:update": "node scripts/stage-sdk-source.mjs --update", - "qualify:sdk": "node scripts/qualify-sdk-packages.mjs" + "qualify:sdk": "node scripts/qualify-sdk-packages.mjs", + "stage:publication": "node scripts/stage-publication.mjs" }, "dependencies": { "@modelcontextprotocol/server": "2.3.1", diff --git a/plugins/saga-tic-tac-toe/.claude-plugin/plugin.json b/plugins/saga-tic-tac-toe/.claude-plugin/plugin.json new file mode 100644 index 0000000..e146dc7 --- /dev/null +++ b/plugins/saga-tic-tac-toe/.claude-plugin/plugin.json @@ -0,0 +1,18 @@ +{ + "name": "saga-tic-tac-toe", + "version": "0.1.0", + "description": "Play tic-tac-toe against your AI assistant on a board inside the conversation. A hosted SAGA A2UI example.", + "author": { + "name": "MachineWisdom", + "url": "https://saga-ai.dev/" + }, + "homepage": "https://github.com/MachineWisdomAI/saga-a2ui-examples", + "repository": "https://github.com/MachineWisdomAI/saga-a2ui-examples", + "license": "Apache-2.0", + "keywords": [ + "tic-tac-toe", + "game", + "saga-a2ui", + "example" + ] +} diff --git a/plugins/saga-tic-tac-toe/.mcp.json b/plugins/saga-tic-tac-toe/.mcp.json new file mode 100644 index 0000000..8d34d7f --- /dev/null +++ b/plugins/saga-tic-tac-toe/.mcp.json @@ -0,0 +1,8 @@ +{ + "mcpServers": { + "saga-tic-tac-toe": { + "type": "http", + "url": "https://examples.saga-ai.dev/tic-tac-toe/mcp" + } + } +} diff --git a/plugins/saga-tic-tac-toe/LICENSE b/plugins/saga-tic-tac-toe/LICENSE new file mode 100644 index 0000000..d645695 --- /dev/null +++ b/plugins/saga-tic-tac-toe/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/plugins/saga-tic-tac-toe/README.md b/plugins/saga-tic-tac-toe/README.md new file mode 100644 index 0000000..0ad9a9f --- /dev/null +++ b/plugins/saga-tic-tac-toe/README.md @@ -0,0 +1,16 @@ +# SAGA Tic Tac Toe (Claude plugin) + +Plays tic-tac-toe with you inside a Claude conversation: you click X on a board card, and Claude plays O. The plugin adds the hosted game's remote MCP server, `https://examples.saga-ai.dev/tic-tac-toe/mcp`, and a short skill that tells Claude how to play. It needs no account or sign-in with the game. + +```text +/plugin marketplace add MachineWisdomAI/saga-a2ui-examples +/plugin install saga-tic-tac-toe@saga-a2ui-examples +``` + +Then ask Claude to start a game of tic-tac-toe. + +- The server, its four tools and the board are the [Tic Tac Toe example](https://github.com/MachineWisdomAI/saga-a2ui-examples/tree/main/apps/tic-tac-toe), built with [SAGA A2UI](https://github.com/MachineWisdomAI/saga-a2ui). +- What the server stores and for how long: [data handling](https://github.com/MachineWisdomAI/saga-a2ui-examples/blob/main/docs/tic-tac-toe-data-handling.md). +- To connect without the plugin, add the same URL as a custom connector; see the [repository README](https://github.com/MachineWisdomAI/saga-a2ui-examples#use-the-hosted-game). + +`.claude-plugin/plugin.json` and `.mcp.json` are the files `saga publish prepare --target claude` writes for this plugin; the README, skill and license are written here. Licensed under Apache-2.0. diff --git a/plugins/saga-tic-tac-toe/skills/play-tic-tac-toe/SKILL.md b/plugins/saga-tic-tac-toe/skills/play-tic-tac-toe/SKILL.md new file mode 100644 index 0000000..3970bf1 --- /dev/null +++ b/plugins/saga-tic-tac-toe/skills/play-tic-tac-toe/SKILL.md @@ -0,0 +1,17 @@ +--- +name: play-tic-tac-toe +description: Play tic-tac-toe with the person against SAGA Tic Tac Toe's tools. Use when the person asks to start, continue, show or take a turn in a tic-tac-toe game. +--- + +# Play tic-tac-toe + +The person plays X and moves first. You play O. The game is kept by the SAGA Tic Tac Toe connector's tools; do not track the board yourself. + +1. To start, call `new_game`. It shows the board. Tell the person to click a square. +2. A click on the board places X for the person and tells you in the conversation. Placing X yourself is only for a move the person tells you in words. +3. On your turn, read the board with `get_game` if it is not in your context, choose an empty square (0 to 8, row by row from the top left) and call `play_move` with the game's `gameId`, that square, and `expectedMoveNumber` set to the game's current `moveNumber`. +4. If `play_move` reports a refusal, nothing changed: the result carries the current game. Read it and choose again. +5. To show a game's board again, call `show_game` with its `gameId`. If the board does not appear, try `show_game` once more before reporting a problem. +6. When the game ends, say who won or that it was a draw. Offer `new_game` for another. + +A game is named by an unguessable ID and expires 24 hours after it was created. Nothing about the person is stored. Anyone who has a game's ID can play either side, so do not post it where others can read it. diff --git a/saga-publication.json b/saga-publication.json new file mode 100644 index 0000000..dbabaa8 --- /dev/null +++ b/saga-publication.json @@ -0,0 +1,67 @@ +{ + "format": "saga-publication/1", + "name": "saga-tic-tac-toe", + "version": "0.1.0", + "description": "Play tic-tac-toe against your AI assistant on a board inside the conversation. A hosted SAGA A2UI example.", + "publisher": { + "name": "MachineWisdom", + "url": "https://saga-ai.dev/" + }, + "homepage": "https://github.com/MachineWisdomAI/saga-a2ui-examples", + "repository": "https://github.com/MachineWisdomAI/saga-a2ui-examples", + "license": "Apache-2.0", + "keywords": ["tic-tac-toe", "game", "saga-a2ui", "example"], + "listing": { + "displayName": "SAGA Tic Tac Toe", + "shortDescription": "Play tic-tac-toe in chat", + "longDescription": "A game of tic-tac-toe between you (X) and your assistant (O), on a board shown inside the conversation. Click a square to move; the assistant answers by playing the same game. It needs no account. A game is kept for 24 hours under an unguessable identifier and nothing else about you is stored. A free example built with SAGA A2UI.", + "category": "Games", + "capabilities": ["Start a game", "Show a game", "Read a game", "Play a move"], + "websiteURL": "https://github.com/MachineWisdomAI/saga-a2ui-examples", + "supportURL": "https://github.com/MachineWisdomAI/saga-a2ui-examples/issues", + "privacyPolicyURL": "https://github.com/MachineWisdomAI/saga-a2ui-examples/blob/main/docs/tic-tac-toe-data-handling.md", + "termsOfServiceURL": "https://github.com/MachineWisdomAI/saga-a2ui-examples/blob/main/docs/tic-tac-toe-data-handling.md#terms-of-use", + "defaultPrompt": ["Start a game of tic-tac-toe with me"], + "brandColor": "#0e9f4f", + "brandColorDark": "#39ff88" + }, + "claude": { + "connector": { + "name": "SAGA Tic Tac Toe", + "oneLiner": "Play tic-tac-toe against Claude on a board inside the conversation.", + "description": "A game of tic-tac-toe between you (X) and Claude (O). The board appears inside the conversation: click a square to move, and Claude answers by playing the same game. No account is needed. A game is kept for 24 hours under an unguessable identifier and nothing else about you is stored. A free example built with SAGA A2UI.", + "categories": ["Games"], + "slug": "saga-tic-tac-toe", + "documentationURL": "https://github.com/MachineWisdomAI/saga-a2ui-examples#use-the-hosted-game", + "privacyPolicyURL": "https://github.com/MachineWisdomAI/saga-a2ui-examples/blob/main/docs/tic-tac-toe-data-handling.md", + "support": { "url": "https://github.com/MachineWisdomAI/saga-a2ui-examples/issues" }, + "icon": "apps/tic-tac-toe/public/tic-tac-toe/icons/logo-light.png", + "useCases": { + "primary": ["Play a game of tic-tac-toe with Claude."], + "prerequisites": "Nothing: no account, sign-in or other setup beyond adding the connector.", + "access": "read-write" + }, + "authentication": { "mode": "none" }, + "dataHandling": { + "apiOwnership": "first-party", + "personalHealthData": false, + "sponsoredContent": false + }, + "allowedLinkUris": ["https://saga-ai.dev"] + }, + "pluginBundle": { + "repository": "https://github.com/MachineWisdomAI/saga-a2ui-examples", + "skills": ["plugins/saga-tic-tac-toe/skills/play-tic-tac-toe"], + "readme": "plugins/saga-tic-tac-toe/README.md", + "license": "LICENSE" + } + }, + "build": { + "directory": ".stage/publication", + "views": ["new-game.html", "show-game.html"] + }, + "endpoint": { + "url": "https://examples.saga-ai.dev/tic-tac-toe/mcp", + "expectedServer": { "name": "saga-tic-tac-toe", "version": "0.0.0" } + } +} diff --git a/scripts/stage-publication.mjs b/scripts/stage-publication.mjs new file mode 100644 index 0000000..ed6d79c --- /dev/null +++ b/scripts/stage-publication.mjs @@ -0,0 +1,22 @@ +import fs from 'node:fs'; +import path from 'node:path'; +import { root } from './sdk-archive.mjs'; + +// Writes the build directory that `saga publish check|prepare` reads (README: "Publish +// preparation"). The Worker serves the one built board page under two view addresses, +// `new-game.html` and `show-game.html` (prepareBoardViews in the staged game); the publish +// tooling compares the served bytes with files of those names, so both are copies of the page +// `npm run build:view` built. Run after it: +// +// npm run build:view && npm run stage:publication + +const built = path.join(root, '.stage', 'view', 'index.html'); +if (!fs.existsSync(built)) + throw new Error('Run `npm run build:view` first: .stage/view/index.html is missing.'); + +const out = path.join(root, '.stage', 'publication'); +fs.rmSync(out, { recursive: true, force: true }); +fs.mkdirSync(out, { recursive: true }); +for (const name of ['new-game.html', 'show-game.html']) + fs.copyFileSync(built, path.join(out, name)); +console.log(`Wrote new-game.html and show-game.html to ${path.relative(root, out)}.`); From bf3f6af1d4d688d1699695fce40917df0cb188a2 Mon Sep 17 00:00:00 2001 From: yia-mw-agent Date: Fri, 30 Oct 2026 18:53:07 +0000 Subject: [PATCH 2/2] docs: record the web marketplace path and further host observations --- README.md | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 669ceed..1bec5bf 100644 --- a/README.md +++ b/README.md @@ -10,14 +10,14 @@ A game of tic-tac-toe between a person (X) and an AI assistant (O), served as a The game runs at **`https://examples.saga-ai.dev/tic-tac-toe/mcp`**. It needs no account or sign-in. What it stores, and for how long, is in [data handling](docs/tic-tac-toe-data-handling.md). Both hosts need access to custom MCP connections on the web; a managed workspace may need an administrator to enable it. -**Claude, through the marketplace.** In Claude Code, add this repository's marketplace and install the plugin, which adds the endpoint above and a short skill: +**Claude, through the marketplace.** On Claude on the web, open **Customize → Plugins → Add plugin → Add marketplace → Add from a repository**, enter `MachineWisdomAI/saga-a2ui-examples` (a GitHub owner/repo or a Git URL) and choose **Sync**, then install **saga-tic-tac-toe**. In Claude Code, the equivalent commands are: ```text /plugin marketplace add MachineWisdomAI/saga-a2ui-examples /plugin install saga-tic-tac-toe@saga-a2ui-examples ``` -The marketplace is [`.claude-plugin/marketplace.json`](.claude-plugin/marketplace.json); the plugin is [`plugins/saga-tic-tac-toe`](plugins/saga-tic-tac-toe). Its `.claude-plugin/plugin.json` and `.mcp.json` are the files `saga publish prepare --target claude` produces from [`saga-publication.json`](saga-publication.json); no second packager is used. The plugin is not a Claude Desktop extension, and installing it in Claude Code is not a claim about Claude on the web, which uses the direct setup below. +Installing adds the endpoint above and a short skill. The marketplace is [`.claude-plugin/marketplace.json`](.claude-plugin/marketplace.json); the plugin is [`plugins/saga-tic-tac-toe`](plugins/saga-tic-tac-toe). Its `.claude-plugin/plugin.json` and `.mcp.json` are the files `saga publish prepare --target claude` produces from [`saga-publication.json`](saga-publication.json); no second packager is used. The plugin is not a Claude Desktop extension. **Claude on the web, direct URL.** Open **Customize → Connectors → Add custom connector**, name it **SAGA Tic Tac Toe**, enter the endpoint, and choose **No sign-in** when offered. Connect it, enable it from the connectors menu in a new chat and ask Claude to start a game. @@ -25,9 +25,10 @@ The marketplace is [`.claude-plugin/marketplace.json`](.claude-plugin/marketplac What has been observed on the hosts (a record of limits, not a guarantee): -- Claude on the web, with the direct connector: a game was played to a nine-move draw and the final card showed correctly, with the SAGA dragon and the credit, in the light and dark appearances. The first display of a card sometimes failed and recovered with the host's retry button; one card also failed to display after a turn. Claude's connector list showed a placeholder letter, not the dragon, beside the connector. -- ChatGPT on the web, with a custom plugin: the dragon uploaded for the plugin showed beside its mention and tool row, and a completed game reopened correctly in the light theme. After switching to the dark theme, an older card did not load in a reopened chat, and a new card was still loading when last observed. First-load reliability is not established on either host. -- The Claude marketplace installation itself has not yet been verified on a current Claude surface. +- Claude on the web, with the direct connector: a game was played to a nine-move draw and the final card showed correctly, with the SAGA dragon and the credit, in the light and dark appearances. The first display of a card sometimes failed and recovered with the host's retry button; one card also failed to display after a turn. A click on the board puts the person's move in the message box, and **Send** is then required. Claude's connector list showed a placeholder letter, not the dragon, beside the connector. +- ChatGPT on the web, with a custom plugin using the uploaded dragon: the dragon showed in the card and, separately, beside the plugin mention and tool row in both themes, and a completed game reopened correctly. A card in the dark theme timed out once and one **Try again** recovered it; a click on the board then sent the person's move automatically, the assistant played O, and the card updated. An older card did not load in a chat reopened after switching theme. +- Claude on the web offers adding a marketplace from a GitHub repository (the path above), so the marketplace is not limited to Claude Desktop. Installing this marketplace's plugin from the merged repository, and playing through it, is checked separately. +- First-load reliability is not established on either host. ### Publication preparation