@squadrules/mcp 5.23.8 → 5.23.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (29) hide show
  1. package/dist/.tsbuildinfo +1 -1
  2. package/dist/embed-docs/mem/adapter-migration.md +1 -1
  3. package/dist/embed-docs/mem/author-adapter.md +1 -1
  4. package/dist/embed-docs/mem/bulk-insert-adapters-via-cli.md +1 -1
  5. package/dist/embed-docs/mem/challenge-type-guide.md +1 -1
  6. package/dist/embed-docs/mem/critic-loop-guide.md +1 -1
  7. package/dist/embed-docs/mem/critic-loop.md +1 -1
  8. package/dist/embed-docs/mem/protocol-linking-guide.md +1 -1
  9. package/dist/embed-docs/mem/refine-search.md +1 -1
  10. package/dist/resources/embedded-mcp-resources.js +8 -8
  11. package/dist/resources/embedded-mcp-resources.js.map +1 -1
  12. package/dist/runtime-lock.json +75 -75
  13. package/dist/ui/assets/{AccountPage-BIxZuuA9.js → AccountPage-CGpZOxo-.js} +1 -1
  14. package/dist/ui/assets/{ErrorAlert-CpqG3xN8.js → ErrorAlert-C-zfyHDh.js} +1 -1
  15. package/dist/ui/assets/{HomePage-DUe1teex.js → HomePage-DAitg4eR.js} +1 -1
  16. package/dist/ui/assets/{NotFoundPage-SqExcDrY.js → NotFoundPage-CH1gy7aw.js} +1 -1
  17. package/dist/ui/assets/{ProtocolDetailPage-D0MUL2RS.js → ProtocolDetailPage-BqrPnyek.js} +1 -1
  18. package/dist/ui/assets/{ProtocolEditPage-BuJz36eu.js → ProtocolEditPage-LZL1K94r.js} +1 -1
  19. package/dist/ui/assets/{RunGuidedPage-X_E_E42Y.js → RunGuidedPage-CPa8Jamx.js} +1 -1
  20. package/dist/ui/assets/{RunsPage-CGw60oRy.js → RunsPage-D_92VkG5.js} +1 -1
  21. package/dist/ui/assets/{SkillBundlePage-BbVG7AK1.js → SkillBundlePage-BSx9xdVD.js} +1 -1
  22. package/dist/ui/assets/{SpaceSelect-LrJMAMEk.js → SpaceSelect-BRqyRXZF.js} +1 -1
  23. package/dist/ui/assets/{SquadrulesPage-HJ-SjQ5u.js → SquadrulesPage-kWO1131j.js} +1 -1
  24. package/dist/ui/assets/{StepFlowGraph-509IoD3J.js → StepFlowGraph-vYNHOiqf.js} +1 -1
  25. package/dist/ui/assets/{export-skill-zip-DRU_W5EX.js → export-skill-zip-rkzrXXa3.js} +1 -1
  26. package/dist/ui/assets/{index-B57aGilw.js → index-8YIRj1uJ.js} +3 -3
  27. package/dist/ui/assets/{vendor-DEls6f-c.js → vendor-Bef0enSO.js} +18 -18
  28. package/dist/ui/index.html +2 -2
  29. package/package.json +3 -3
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@squadrules/mcp",
3
- "version": "5.23.8",
3
+ "version": "5.23.10",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@squadrules/mcp",
9
- "version": "5.23.8",
9
+ "version": "5.23.10",
10
10
  "license": "MIT",
11
11
  "dependencies": {
12
12
  "@exodus/bytes": "^1.16.0",
@@ -18,7 +18,7 @@
18
18
  "@napi-rs/keyring": "^2.1.0",
19
19
  "@prometheus-io/client": "^0.16.1",
20
20
  "@qdrant/js-client-rest": "^1.19.0",
21
- "@tanstack/react-query": "5.108.2",
21
+ "@tanstack/react-query": "5.108.4",
22
22
  "@tiptap/core": "3.35.0",
23
23
  "@tiptap/extension-bubble-menu": "3.35.0",
24
24
  "@tiptap/extension-floating-menu": "3.35.0",
@@ -82,7 +82,7 @@
82
82
  "jest": "^30.5.2",
83
83
  "js-yaml": "^5.4.3",
84
84
  "jsdom": "31.0.1",
85
- "knip": "6.47.0",
85
+ "knip": "6.48.0",
86
86
  "markdownlint-cli2": "0.24.2",
87
87
  "pino-pretty": "^13.2.0",
88
88
  "playwright": "1.65.1",
@@ -2526,9 +2526,9 @@
2526
2526
  }
2527
2527
  },
2528
2528
  "node_modules/@lancedb/lancedb": {
2529
- "version": "0.42.0-beta.21",
2530
- "resolved": "https://registry.npmjs.org/@lancedb/lancedb/-/lancedb-0.42.0-beta.21.tgz",
2531
- "integrity": "sha512-AgXb75xQHfQlO+zEaoBm3E7Q9WCcwaThN9s4FuOcY+jYvLPp79vh5YdFSankjXrTvrkK1sy+zuoSUjlPf3Do6Q==",
2529
+ "version": "0.42.0-beta.26",
2530
+ "resolved": "https://registry.npmjs.org/@lancedb/lancedb/-/lancedb-0.42.0-beta.26.tgz",
2531
+ "integrity": "sha512-lir5WUFdMlTPoegz7wDSeklJ5ENzfYP6FAgVWgGA/Z7acoc7Sp6nmyDWIjRQ76d6TVhefbIkc2jTCbM37lUY0g==",
2532
2532
  "cpu": [
2533
2533
  "x64",
2534
2534
  "arm64"
@@ -2548,13 +2548,13 @@
2548
2548
  },
2549
2549
  "optionalDependencies": {
2550
2550
  "@huggingface/transformers": "4.3.2",
2551
- "@lancedb/lancedb-darwin-arm64": "0.42.0-beta.21",
2552
- "@lancedb/lancedb-linux-arm64-gnu": "0.42.0-beta.21",
2553
- "@lancedb/lancedb-linux-arm64-musl": "0.42.0-beta.21",
2554
- "@lancedb/lancedb-linux-x64-gnu": "0.42.0-beta.21",
2555
- "@lancedb/lancedb-linux-x64-musl": "0.42.0-beta.21",
2556
- "@lancedb/lancedb-win32-arm64-msvc": "0.42.0-beta.21",
2557
- "@lancedb/lancedb-win32-x64-msvc": "0.42.0-beta.21",
2551
+ "@lancedb/lancedb-darwin-arm64": "0.42.0-beta.26",
2552
+ "@lancedb/lancedb-linux-arm64-gnu": "0.42.0-beta.26",
2553
+ "@lancedb/lancedb-linux-arm64-musl": "0.42.0-beta.26",
2554
+ "@lancedb/lancedb-linux-x64-gnu": "0.42.0-beta.26",
2555
+ "@lancedb/lancedb-linux-x64-musl": "0.42.0-beta.26",
2556
+ "@lancedb/lancedb-win32-arm64-msvc": "0.42.0-beta.26",
2557
+ "@lancedb/lancedb-win32-x64-msvc": "0.42.0-beta.26",
2558
2558
  "openai": "4.29.2"
2559
2559
  },
2560
2560
  "peerDependencies": {
@@ -2568,9 +2568,9 @@
2568
2568
  }
2569
2569
  },
2570
2570
  "node_modules/@lancedb/lancedb-darwin-arm64": {
2571
- "version": "0.42.0-beta.21",
2572
- "resolved": "https://registry.npmjs.org/@lancedb/lancedb-darwin-arm64/-/lancedb-darwin-arm64-0.42.0-beta.21.tgz",
2573
- "integrity": "sha512-648ifk7zyA2qIfHFKo7wx5weMU1QwvTJ3xVQWl02LyLYEpGYhzBcjFvGrKXb51jsZY6CEe5kIdapUUcAGtqMvQ==",
2571
+ "version": "0.42.0-beta.26",
2572
+ "resolved": "https://registry.npmjs.org/@lancedb/lancedb-darwin-arm64/-/lancedb-darwin-arm64-0.42.0-beta.26.tgz",
2573
+ "integrity": "sha512-cvtkAPvgnbrXu15v9VAMMbEkT0dAz9AUjF0WixeN7MHQJw1I3GYoznhz1eeErdV5R7BSfe2eqzLE9fRpkYeHGg==",
2574
2574
  "cpu": [
2575
2575
  "arm64"
2576
2576
  ],
@@ -2584,9 +2584,9 @@
2584
2584
  }
2585
2585
  },
2586
2586
  "node_modules/@lancedb/lancedb-linux-arm64-gnu": {
2587
- "version": "0.42.0-beta.21",
2588
- "resolved": "https://registry.npmjs.org/@lancedb/lancedb-linux-arm64-gnu/-/lancedb-linux-arm64-gnu-0.42.0-beta.21.tgz",
2589
- "integrity": "sha512-VqhspTl0AepKCPG453zYdV0f0qA9j9RiKKc2p5cwVSDVcRsLD1PPeQdYa5n0wnTp6N5yynPPmwVyvCmLlgKM7w==",
2587
+ "version": "0.42.0-beta.26",
2588
+ "resolved": "https://registry.npmjs.org/@lancedb/lancedb-linux-arm64-gnu/-/lancedb-linux-arm64-gnu-0.42.0-beta.26.tgz",
2589
+ "integrity": "sha512-e+YbRgLYPu4eyJgTT7u/nr7Mt8pyd5xUYj75JAYwo43iBNxVcutZBKpd5wPACCNG0UD1I5uYfAAGLl59OedguQ==",
2590
2590
  "cpu": [
2591
2591
  "arm64"
2592
2592
  ],
@@ -2603,9 +2603,9 @@
2603
2603
  }
2604
2604
  },
2605
2605
  "node_modules/@lancedb/lancedb-linux-arm64-musl": {
2606
- "version": "0.42.0-beta.21",
2607
- "resolved": "https://registry.npmjs.org/@lancedb/lancedb-linux-arm64-musl/-/lancedb-linux-arm64-musl-0.42.0-beta.21.tgz",
2608
- "integrity": "sha512-YYlFRa6MjU/64CFLvRgJYIdhb0jaAqEnpeb6Fx+v/bf5Lau5lTqbhfA54L13wp3WjuQ8Y2QyZfeXcfFlofGLAg==",
2606
+ "version": "0.42.0-beta.26",
2607
+ "resolved": "https://registry.npmjs.org/@lancedb/lancedb-linux-arm64-musl/-/lancedb-linux-arm64-musl-0.42.0-beta.26.tgz",
2608
+ "integrity": "sha512-1jSbsykcXs4DGGSKF/GKvwmQwk6lT0W3+48d7U4OtpDESX1A4u6WvYilC9wjgXQb25/3GpJNtVOaIcPHBDc7Kg==",
2609
2609
  "cpu": [
2610
2610
  "arm64"
2611
2611
  ],
@@ -2622,9 +2622,9 @@
2622
2622
  }
2623
2623
  },
2624
2624
  "node_modules/@lancedb/lancedb-linux-x64-gnu": {
2625
- "version": "0.42.0-beta.21",
2626
- "resolved": "https://registry.npmjs.org/@lancedb/lancedb-linux-x64-gnu/-/lancedb-linux-x64-gnu-0.42.0-beta.21.tgz",
2627
- "integrity": "sha512-M225tYdpBLAjVartlNbvFn27qxy9/x5vYet27sgwypK2UkFKqEbTHjSqmYZ2wmWrY0xCgjxK54n6XnQXWTAgZw==",
2625
+ "version": "0.42.0-beta.26",
2626
+ "resolved": "https://registry.npmjs.org/@lancedb/lancedb-linux-x64-gnu/-/lancedb-linux-x64-gnu-0.42.0-beta.26.tgz",
2627
+ "integrity": "sha512-R9RCI4iKQ7ebNTTqBnpRK0KpAELKG0CE2Xb5BuM54QRFq/t+hNVn8KBw/qgs4k98kUYu4g9uIjpOdLDha+vvxg==",
2628
2628
  "cpu": [
2629
2629
  "x64"
2630
2630
  ],
@@ -2641,9 +2641,9 @@
2641
2641
  }
2642
2642
  },
2643
2643
  "node_modules/@lancedb/lancedb-linux-x64-musl": {
2644
- "version": "0.42.0-beta.21",
2645
- "resolved": "https://registry.npmjs.org/@lancedb/lancedb-linux-x64-musl/-/lancedb-linux-x64-musl-0.42.0-beta.21.tgz",
2646
- "integrity": "sha512-IxgROErhokZj3iUa6r1MtN+20QbZVCx7rCdjNQlbIiRM6qGgv1CLqtC/1dSpKi/RtRURLR9OqqGfwbwaUbakBw==",
2644
+ "version": "0.42.0-beta.26",
2645
+ "resolved": "https://registry.npmjs.org/@lancedb/lancedb-linux-x64-musl/-/lancedb-linux-x64-musl-0.42.0-beta.26.tgz",
2646
+ "integrity": "sha512-UzFmEZAnNQQH0o/Wh64+eT50cq59n2LBbSJsL6VDtptYVDHmBCNJuBzucv1AWFFmEEYj2O3yWt2LiM3xP3PyKQ==",
2647
2647
  "cpu": [
2648
2648
  "x64"
2649
2649
  ],
@@ -2660,9 +2660,9 @@
2660
2660
  }
2661
2661
  },
2662
2662
  "node_modules/@lancedb/lancedb-win32-arm64-msvc": {
2663
- "version": "0.42.0-beta.21",
2664
- "resolved": "https://registry.npmjs.org/@lancedb/lancedb-win32-arm64-msvc/-/lancedb-win32-arm64-msvc-0.42.0-beta.21.tgz",
2665
- "integrity": "sha512-N/e2ce7BvC+yWCk6n4CcoGmCJ/NKb8sWwZctCRyUs4qEd+bGtIOgg9ha31GS7sVp329pE/8M0GNV/nUO/rE4zg==",
2663
+ "version": "0.42.0-beta.26",
2664
+ "resolved": "https://registry.npmjs.org/@lancedb/lancedb-win32-arm64-msvc/-/lancedb-win32-arm64-msvc-0.42.0-beta.26.tgz",
2665
+ "integrity": "sha512-0ydYMYt95drvZ2kG0g6E6wWmJlK+hYgHTrD5dwUd6ElfEiwBnG3jX9MYjUkjs+42kmr/YZW2gLY1tBHTl9LTTw==",
2666
2666
  "cpu": [
2667
2667
  "arm64"
2668
2668
  ],
@@ -2676,9 +2676,9 @@
2676
2676
  }
2677
2677
  },
2678
2678
  "node_modules/@lancedb/lancedb-win32-x64-msvc": {
2679
- "version": "0.42.0-beta.21",
2680
- "resolved": "https://registry.npmjs.org/@lancedb/lancedb-win32-x64-msvc/-/lancedb-win32-x64-msvc-0.42.0-beta.21.tgz",
2681
- "integrity": "sha512-ajxVZrQSyiJP2vXUWzP0ewVOWafjfj0MQ07BgBIXHWo4RrpjVFbJ2mg8l//2uKMfT5+JzS837pcMfIm8/gPzsg==",
2679
+ "version": "0.42.0-beta.26",
2680
+ "resolved": "https://registry.npmjs.org/@lancedb/lancedb-win32-x64-msvc/-/lancedb-win32-x64-msvc-0.42.0-beta.26.tgz",
2681
+ "integrity": "sha512-1SO7Jk9x+GVoH1Xpj47laAk+WAgLfYNnRnSoLelT3Px9rnh7Q1UzRfAjMPx25o6phBUY+JCUQB/y59XD0sLteg==",
2682
2682
  "cpu": [
2683
2683
  "x64"
2684
2684
  ],
@@ -4245,21 +4245,21 @@
4245
4245
  }
4246
4246
  },
4247
4247
  "node_modules/@redis/bloom": {
4248
- "version": "6.3.1",
4249
- "resolved": "https://registry.npmjs.org/@redis/bloom/-/bloom-6.3.1.tgz",
4250
- "integrity": "sha512-dpF9j2yJDoPzSCaZn0MSB3xzmnXQVJeTSAWJcQVcgbmluwhpFeemmII0cF1t+WYfoVS+shEFq79+MmUItgzJLg==",
4248
+ "version": "6.4.0",
4249
+ "resolved": "https://registry.npmjs.org/@redis/bloom/-/bloom-6.4.0.tgz",
4250
+ "integrity": "sha512-haBv1OKeJoKxoAxwKEHPDKdoZaLIuWAKNr4VFRF2C3Rjjn7Ese5fijEW6295rMBIyddZfuIOcvH1aZ/yKzy8vQ==",
4251
4251
  "license": "MIT",
4252
4252
  "engines": {
4253
4253
  "node": ">= 20.0.0"
4254
4254
  },
4255
4255
  "peerDependencies": {
4256
- "@redis/client": "^6.3.1"
4256
+ "@redis/client": "^6.4.0"
4257
4257
  }
4258
4258
  },
4259
4259
  "node_modules/@redis/client": {
4260
- "version": "6.3.1",
4261
- "resolved": "https://registry.npmjs.org/@redis/client/-/client-6.3.1.tgz",
4262
- "integrity": "sha512-masbfVKULdoAofwddepZxRhWa4w6zvBHn6TRn90TRPrRkVIlGCur3pFqwWaCbMxtYI9twepkz63e/T/tEH8GjA==",
4260
+ "version": "6.4.0",
4261
+ "resolved": "https://registry.npmjs.org/@redis/client/-/client-6.4.0.tgz",
4262
+ "integrity": "sha512-XEFSX0W1BUVFwtWC41vk5P/U5CqvacBWypFbmYHdF1gJeIYWWmEzsM2R5mPb+65SdODFQk7xuuMPFP6s1t9nhw==",
4263
4263
  "license": "MIT",
4264
4264
  "engines": {
4265
4265
  "node": ">= 20.0.0"
@@ -4278,39 +4278,39 @@
4278
4278
  }
4279
4279
  },
4280
4280
  "node_modules/@redis/json": {
4281
- "version": "6.3.1",
4282
- "resolved": "https://registry.npmjs.org/@redis/json/-/json-6.3.1.tgz",
4283
- "integrity": "sha512-fMz4kUwJzEftcU9EMaqsjZcUwzpTQLOYRqhQsAD6uKvZWeamblK13ZhgO5SzVSZVk31jmwLeTRpU5GAl5egfUw==",
4281
+ "version": "6.4.0",
4282
+ "resolved": "https://registry.npmjs.org/@redis/json/-/json-6.4.0.tgz",
4283
+ "integrity": "sha512-Dtxn3c2u5H5r3MA6kMrFI6iSOo4BIwibwkep94BMBD5ba1Eik1UYIwInX9lZ10RdUT4+BD7ZS9lAoORBvXUEYg==",
4284
4284
  "license": "MIT",
4285
4285
  "engines": {
4286
4286
  "node": ">= 20.0.0"
4287
4287
  },
4288
4288
  "peerDependencies": {
4289
- "@redis/client": "^6.3.1"
4289
+ "@redis/client": "^6.4.0"
4290
4290
  }
4291
4291
  },
4292
4292
  "node_modules/@redis/search": {
4293
- "version": "6.3.1",
4294
- "resolved": "https://registry.npmjs.org/@redis/search/-/search-6.3.1.tgz",
4295
- "integrity": "sha512-T67pvPUpW82VrZLvihO8O2DFMC7eY2oMAzMzapCbiPZn7mdWqHMEIlohYim12gIawT5kn6qT/Cvmm4WulKB+kQ==",
4293
+ "version": "6.4.0",
4294
+ "resolved": "https://registry.npmjs.org/@redis/search/-/search-6.4.0.tgz",
4295
+ "integrity": "sha512-B4L2OD5BMwbOYewQ9KGJfukLUkRQz1gc91TEOxz76KLeJsLbHB0XXa7sKMNoB3JURPWvhuY0PE04fHQVYZPZKg==",
4296
4296
  "license": "MIT",
4297
4297
  "engines": {
4298
4298
  "node": ">= 20.0.0"
4299
4299
  },
4300
4300
  "peerDependencies": {
4301
- "@redis/client": "^6.3.1"
4301
+ "@redis/client": "^6.4.0"
4302
4302
  }
4303
4303
  },
4304
4304
  "node_modules/@redis/time-series": {
4305
- "version": "6.3.1",
4306
- "resolved": "https://registry.npmjs.org/@redis/time-series/-/time-series-6.3.1.tgz",
4307
- "integrity": "sha512-MNDgrm+i63M/1a+XA+HcDsScwt4uBh/fGGJ84swTQZTFK5K5wMmxdlTRa4ZgmNJzjxMaszW/ipPScMUGV3aAMg==",
4305
+ "version": "6.4.0",
4306
+ "resolved": "https://registry.npmjs.org/@redis/time-series/-/time-series-6.4.0.tgz",
4307
+ "integrity": "sha512-5QpeIlX/r0h0//JfJ8h4/Il9i0SGHhnOkdcocOhFDp0pb8VgVCEkxeCkUx8IR3g3rlq+uiPIf4NCueveHS9Vbw==",
4308
4308
  "license": "MIT",
4309
4309
  "engines": {
4310
4310
  "node": ">= 20.0.0"
4311
4311
  },
4312
4312
  "peerDependencies": {
4313
- "@redis/client": "^6.3.1"
4313
+ "@redis/client": "^6.4.0"
4314
4314
  }
4315
4315
  },
4316
4316
  "node_modules/@remix-run/route-pattern": {
@@ -5052,9 +5052,9 @@
5052
5052
  }
5053
5053
  },
5054
5054
  "node_modules/@tanstack/query-core": {
5055
- "version": "5.108.2",
5056
- "resolved": "https://registry.npmjs.org/@tanstack/query-core/-/query-core-5.108.2.tgz",
5057
- "integrity": "sha512-0l+0xDKqn71hfJBKaAvFP/X7WYM0TbscEk6nK1pHaWQUWUEA+WJD0VlT8wF+HIJANMV9B/DouPWwDnX3w/l9BA==",
5055
+ "version": "5.108.4",
5056
+ "resolved": "https://registry.npmjs.org/@tanstack/query-core/-/query-core-5.108.4.tgz",
5057
+ "integrity": "sha512-2Ks5dlLWz4eXJrthOyG0qW3SLt3xx0RrQmAmN0rnmogiaaOYuWiAe6HAm9KE2b2v8nig+vraNz8fsfZ6fF6zFg==",
5058
5058
  "license": "MIT",
5059
5059
  "funding": {
5060
5060
  "type": "github",
@@ -5062,12 +5062,12 @@
5062
5062
  }
5063
5063
  },
5064
5064
  "node_modules/@tanstack/react-query": {
5065
- "version": "5.108.2",
5066
- "resolved": "https://registry.npmjs.org/@tanstack/react-query/-/react-query-5.108.2.tgz",
5067
- "integrity": "sha512-wV6hEjVGTfh9rvu3uREYW0hgBfS9klDejGelhPY575jD5jg6qbAb1nzT7hR1Q+wemR66ZjtE5p9pAGUwqK8zbg==",
5065
+ "version": "5.108.4",
5066
+ "resolved": "https://registry.npmjs.org/@tanstack/react-query/-/react-query-5.108.4.tgz",
5067
+ "integrity": "sha512-GlTa94kfEKTVsbzXe58rFA3GZ0ZE7N1aFtbZAfOS3XxMv8YNn4C+8rsz40LorHLazdm5PsqCroWaYAR+ZkMXMQ==",
5068
5068
  "license": "MIT",
5069
5069
  "dependencies": {
5070
- "@tanstack/query-core": "5.108.2"
5070
+ "@tanstack/query-core": "5.108.4"
5071
5071
  },
5072
5072
  "funding": {
5073
5073
  "type": "github",
@@ -11521,9 +11521,9 @@
11521
11521
  }
11522
11522
  },
11523
11523
  "node_modules/i18next": {
11524
- "version": "27.2.3",
11525
- "resolved": "https://registry.npmjs.org/i18next/-/i18next-27.2.3.tgz",
11526
- "integrity": "sha512-14wcQLAu5Aykwk4scBGl8tosKYth4S2PQDcusbES/bUsQ7X7DbcPygMzCe298U/NcAvDpqr+CX6oygbQoyLBRA==",
11524
+ "version": "27.2.5",
11525
+ "resolved": "https://registry.npmjs.org/i18next/-/i18next-27.2.5.tgz",
11526
+ "integrity": "sha512-hzw6DP/OV8u9LPLFRNLxoDbehhbEeMwpjQanJv5sRLsYUVYsgqftUSRfWJUbQN5lodGIiFjV9e+lA6M2UILt2g==",
11527
11527
  "funding": [
11528
11528
  {
11529
11529
  "type": "individual",
@@ -13125,9 +13125,9 @@
13125
13125
  "dev": true
13126
13126
  },
13127
13127
  "node_modules/knip": {
13128
- "version": "6.47.0",
13129
- "resolved": "https://registry.npmjs.org/knip/-/knip-6.47.0.tgz",
13130
- "integrity": "sha512-nYmQnk0YqDXIJrYViJz88c8xw3tBDkpuAmofo58EkVPnKr6DnRKYtf6oIqcGVHZvXDE+gtmFuYx277/QsWng+A==",
13128
+ "version": "6.48.0",
13129
+ "resolved": "https://registry.npmjs.org/knip/-/knip-6.48.0.tgz",
13130
+ "integrity": "sha512-v+Gfp6uiOeXaaj+Khk2Z7/fTTZYWLnDwxZapQUyy8WoQFLYXiUHXqRdFJTwRnrKNA1gPXTPi5NGTKKLXyImVrg==",
13131
13131
  "dev": true,
13132
13132
  "funding": [
13133
13133
  {
@@ -16653,16 +16653,16 @@
16653
16653
  }
16654
16654
  },
16655
16655
  "node_modules/redis": {
16656
- "version": "6.3.1",
16657
- "resolved": "https://registry.npmjs.org/redis/-/redis-6.3.1.tgz",
16658
- "integrity": "sha512-mV96ZKxQ4CGn3SyEGaY0Lb9YA443mdVey3c+mdr0NAUaBxiOZGoYCWX8PoM55kictSOmxlJRtZJxIsmZm3jL+w==",
16656
+ "version": "6.4.0",
16657
+ "resolved": "https://registry.npmjs.org/redis/-/redis-6.4.0.tgz",
16658
+ "integrity": "sha512-8Xk9zRovBNDzIO3xRi036QFgijIZKeIPjQJ5VhgxV8nxkxDP5GlE5se71G1I4TnUTojbCtmfKzXpioxlDhHJvg==",
16659
16659
  "license": "MIT",
16660
16660
  "dependencies": {
16661
- "@redis/bloom": "6.3.1",
16662
- "@redis/client": "6.3.1",
16663
- "@redis/json": "6.3.1",
16664
- "@redis/search": "6.3.1",
16665
- "@redis/time-series": "6.3.1"
16661
+ "@redis/bloom": "6.4.0",
16662
+ "@redis/client": "6.4.0",
16663
+ "@redis/json": "6.4.0",
16664
+ "@redis/search": "6.4.0",
16665
+ "@redis/time-series": "6.4.0"
16666
16666
  },
16667
16667
  "engines": {
16668
16668
  "node": ">= 20.0.0"
@@ -1 +1 @@
1
- import{h as e,v as t}from"./vendor-DEls6f-c.js";import{t as n}from"./api-BgTb-tmJ.js";import{n as r,r as i,t as a}from"./index-B57aGilw.js";import{t as o}from"./react-C1iE8mnY.js";async function s(){let e=await n(`/api/me`);if(!e.ok){let t=await e.json().catch(()=>({})),n=Error(t.message??e.statusText);throw n.statusCode=e.status,n}return e.json()}function c(){return e({queryKey:[`me`],queryFn:s,retry:!1})}var l=o(),u={light:`account.themeOptionLight`,dark:`account.themeOptionDark`};function d(e){if(e.name&&e.name.trim().length>0)return e.name;let t=[e.given_name,e.family_name].filter(e=>typeof e==`string`&&e.trim().length>0);return t.length>0?t.join(` `):e.preferred_username&&e.preferred_username.length>0?e.preferred_username:e.sub}function f(){let{t:e}=t(),{data:n,isLoading:o,isError:s}=c(),{preference:f,setPreference:p}=i();return o?(0,l.jsx)(`p`,{className:`text-[var(--color-text-muted)]`,children:e(`account.loading`)}):s||!n?(0,l.jsxs)(`div`,{children:[(0,l.jsx)(`h1`,{className:`text-[var(--color-text-heading)] text-2xl font-semibold mb-4`,children:e(`account.title`)}),(0,l.jsx)(`p`,{className:`text-[var(--color-text-muted)]`,children:e(`account.notSignedIn`)}),(0,l.jsx)(`a`,{href:`/auth/callback`,className:`mt-4 min-h-[44px] min-w-[44px] inline-flex items-center justify-center px-4 py-2 rounded-[var(--radius-md)] font-medium bg-[var(--color-primary)] text-white no-underline hover:bg-[var(--color-primary-hover)] focus-visible:outline focus-visible:outline-2 focus-visible:outline-[var(--color-focus-ring)] focus-visible:outline-offset-2`,children:e(`account.signIn`)})]}):(0,l.jsxs)(`div`,{children:[(0,l.jsx)(`h1`,{className:`text-[var(--color-text-heading)] text-2xl font-semibold mb-6`,children:e(`account.title`)}),(0,l.jsx)(`p`,{className:`text-[var(--color-text-muted)] mb-6`,children:e(`account.intro`)}),(0,l.jsxs)(`div`,{className:`rounded-[var(--radius-md)] border border-[var(--color-border)] bg-[var(--color-surface-elevated)] p-6`,children:[(0,l.jsxs)(`div`,{className:`mb-6 rounded-[var(--radius-md)] border border-[var(--color-border)] bg-[var(--color-surface)] p-4`,children:[(0,l.jsx)(`h2`,{className:`mb-1 text-base font-semibold text-[var(--color-text-heading)]`,children:e(`account.themeTitle`)}),(0,l.jsx)(`p`,{className:`mb-3 text-sm text-[var(--color-text-muted)]`,children:e(`account.themeDescription`)}),(0,l.jsx)(`label`,{htmlFor:`account-theme-preference`,className:`sr-only`,children:e(`account.themePreferenceLabel`)}),(0,l.jsxs)(`select`,{id:`account-theme-preference`,value:f,onChange:e=>{let t=e.target.value;r(t)&&p(t)},className:`min-h-[44px] w-full max-w-xs rounded-[var(--radius-md)] border border-[var(--color-border)] bg-[var(--color-surface)] px-3 py-2 text-[var(--color-text)] focus-visible:outline focus-visible:outline-2 focus-visible:outline-[var(--color-focus-ring)] focus-visible:outline-offset-2`,children:[(0,l.jsx)(`option`,{value:`system`,children:e(`account.themeOptionSystem`)}),a.map(t=>(0,l.jsx)(`option`,{value:t,children:e(u[t])},t))]})]}),(0,l.jsxs)(`div`,{className:`mb-4`,children:[(0,l.jsx)(`span`,{className:`block text-xs uppercase tracking-wider text-[var(--color-text-muted)] mb-1`,children:e(`account.name`)}),(0,l.jsx)(`span`,{className:`text-[var(--color-text-heading)]`,children:d(n)})]}),n.preferred_username&&n.preferred_username!==d(n)&&(0,l.jsxs)(`div`,{className:`mb-4`,children:[(0,l.jsx)(`span`,{className:`block text-xs uppercase tracking-wider text-[var(--color-text-muted)] mb-1`,children:e(`account.username`)}),(0,l.jsx)(`span`,{className:`text-[var(--color-text-heading)]`,children:n.preferred_username})]}),n.email&&(0,l.jsxs)(`div`,{className:`mb-4`,children:[(0,l.jsx)(`span`,{className:`block text-xs uppercase tracking-wider text-[var(--color-text-muted)] mb-1`,children:e(`account.email`)}),(0,l.jsxs)(`span`,{className:`text-[var(--color-text-heading)]`,children:[n.email,n.email_verified===!0?` (${e(`account.emailVerified`)})`:``]})]}),(0,l.jsxs)(`div`,{className:`mb-4`,children:[(0,l.jsx)(`span`,{className:`block text-xs uppercase tracking-wider text-[var(--color-text-muted)] mb-1`,children:e(`account.accountType`)}),(0,l.jsx)(`span`,{className:`text-[var(--color-text-heading)]`,children:n.account_label})]}),(0,l.jsxs)(`div`,{className:`mb-4`,children:[(0,l.jsx)(`span`,{className:`block text-xs uppercase tracking-wider text-[var(--color-text-muted)] mb-1`,children:e(`account.realm`)}),(0,l.jsx)(`span`,{className:`text-[var(--color-text-heading)]`,children:n.realm})]}),n.identity_provider&&(0,l.jsxs)(`div`,{className:`mb-4`,children:[(0,l.jsx)(`span`,{className:`block text-xs uppercase tracking-wider text-[var(--color-text-muted)] mb-1`,children:e(`account.identityProvider`)}),(0,l.jsx)(`span`,{className:`text-[var(--color-text-heading)]`,children:n.identity_provider})]}),n.groups.length>0&&(0,l.jsxs)(`div`,{className:`mb-4`,children:[(0,l.jsx)(`span`,{className:`block text-xs uppercase tracking-wider text-[var(--color-text-muted)] mb-1`,children:e(`account.groups`)}),(0,l.jsx)(`ul`,{className:`list-disc list-inside text-[var(--color-text-heading)] space-y-1`,children:n.groups.map(e=>(0,l.jsx)(`li`,{children:e},e))})]}),(0,l.jsx)(`div`,{className:`mt-6 flex gap-2 flex-wrap`,children:(0,l.jsx)(`a`,{href:`/auth/logout`,className:`min-h-[44px] min-w-[44px] inline-flex items-center justify-center px-4 py-2 rounded-[var(--radius-md)] font-medium border border-[var(--color-border)] text-[var(--color-text)] bg-transparent no-underline hover:bg-[var(--color-surface-elevated)] focus-visible:outline focus-visible:outline-2 focus-visible:outline-[var(--color-focus-ring)] focus-visible:outline-offset-2`,children:e(`account.logOut`)})})]})]})}export{f as AccountPage};
1
+ import{h as e,v as t}from"./vendor-Bef0enSO.js";import{t as n}from"./api-BgTb-tmJ.js";import{n as r,r as i,t as a}from"./index-8YIRj1uJ.js";import{t as o}from"./react-C1iE8mnY.js";async function s(){let e=await n(`/api/me`);if(!e.ok){let t=await e.json().catch(()=>({})),n=Error(t.message??e.statusText);throw n.statusCode=e.status,n}return e.json()}function c(){return e({queryKey:[`me`],queryFn:s,retry:!1})}var l=o(),u={light:`account.themeOptionLight`,dark:`account.themeOptionDark`};function d(e){if(e.name&&e.name.trim().length>0)return e.name;let t=[e.given_name,e.family_name].filter(e=>typeof e==`string`&&e.trim().length>0);return t.length>0?t.join(` `):e.preferred_username&&e.preferred_username.length>0?e.preferred_username:e.sub}function f(){let{t:e}=t(),{data:n,isLoading:o,isError:s}=c(),{preference:f,setPreference:p}=i();return o?(0,l.jsx)(`p`,{className:`text-[var(--color-text-muted)]`,children:e(`account.loading`)}):s||!n?(0,l.jsxs)(`div`,{children:[(0,l.jsx)(`h1`,{className:`text-[var(--color-text-heading)] text-2xl font-semibold mb-4`,children:e(`account.title`)}),(0,l.jsx)(`p`,{className:`text-[var(--color-text-muted)]`,children:e(`account.notSignedIn`)}),(0,l.jsx)(`a`,{href:`/auth/callback`,className:`mt-4 min-h-[44px] min-w-[44px] inline-flex items-center justify-center px-4 py-2 rounded-[var(--radius-md)] font-medium bg-[var(--color-primary)] text-white no-underline hover:bg-[var(--color-primary-hover)] focus-visible:outline focus-visible:outline-2 focus-visible:outline-[var(--color-focus-ring)] focus-visible:outline-offset-2`,children:e(`account.signIn`)})]}):(0,l.jsxs)(`div`,{children:[(0,l.jsx)(`h1`,{className:`text-[var(--color-text-heading)] text-2xl font-semibold mb-6`,children:e(`account.title`)}),(0,l.jsx)(`p`,{className:`text-[var(--color-text-muted)] mb-6`,children:e(`account.intro`)}),(0,l.jsxs)(`div`,{className:`rounded-[var(--radius-md)] border border-[var(--color-border)] bg-[var(--color-surface-elevated)] p-6`,children:[(0,l.jsxs)(`div`,{className:`mb-6 rounded-[var(--radius-md)] border border-[var(--color-border)] bg-[var(--color-surface)] p-4`,children:[(0,l.jsx)(`h2`,{className:`mb-1 text-base font-semibold text-[var(--color-text-heading)]`,children:e(`account.themeTitle`)}),(0,l.jsx)(`p`,{className:`mb-3 text-sm text-[var(--color-text-muted)]`,children:e(`account.themeDescription`)}),(0,l.jsx)(`label`,{htmlFor:`account-theme-preference`,className:`sr-only`,children:e(`account.themePreferenceLabel`)}),(0,l.jsxs)(`select`,{id:`account-theme-preference`,value:f,onChange:e=>{let t=e.target.value;r(t)&&p(t)},className:`min-h-[44px] w-full max-w-xs rounded-[var(--radius-md)] border border-[var(--color-border)] bg-[var(--color-surface)] px-3 py-2 text-[var(--color-text)] focus-visible:outline focus-visible:outline-2 focus-visible:outline-[var(--color-focus-ring)] focus-visible:outline-offset-2`,children:[(0,l.jsx)(`option`,{value:`system`,children:e(`account.themeOptionSystem`)}),a.map(t=>(0,l.jsx)(`option`,{value:t,children:e(u[t])},t))]})]}),(0,l.jsxs)(`div`,{className:`mb-4`,children:[(0,l.jsx)(`span`,{className:`block text-xs uppercase tracking-wider text-[var(--color-text-muted)] mb-1`,children:e(`account.name`)}),(0,l.jsx)(`span`,{className:`text-[var(--color-text-heading)]`,children:d(n)})]}),n.preferred_username&&n.preferred_username!==d(n)&&(0,l.jsxs)(`div`,{className:`mb-4`,children:[(0,l.jsx)(`span`,{className:`block text-xs uppercase tracking-wider text-[var(--color-text-muted)] mb-1`,children:e(`account.username`)}),(0,l.jsx)(`span`,{className:`text-[var(--color-text-heading)]`,children:n.preferred_username})]}),n.email&&(0,l.jsxs)(`div`,{className:`mb-4`,children:[(0,l.jsx)(`span`,{className:`block text-xs uppercase tracking-wider text-[var(--color-text-muted)] mb-1`,children:e(`account.email`)}),(0,l.jsxs)(`span`,{className:`text-[var(--color-text-heading)]`,children:[n.email,n.email_verified===!0?` (${e(`account.emailVerified`)})`:``]})]}),(0,l.jsxs)(`div`,{className:`mb-4`,children:[(0,l.jsx)(`span`,{className:`block text-xs uppercase tracking-wider text-[var(--color-text-muted)] mb-1`,children:e(`account.accountType`)}),(0,l.jsx)(`span`,{className:`text-[var(--color-text-heading)]`,children:n.account_label})]}),(0,l.jsxs)(`div`,{className:`mb-4`,children:[(0,l.jsx)(`span`,{className:`block text-xs uppercase tracking-wider text-[var(--color-text-muted)] mb-1`,children:e(`account.realm`)}),(0,l.jsx)(`span`,{className:`text-[var(--color-text-heading)]`,children:n.realm})]}),n.identity_provider&&(0,l.jsxs)(`div`,{className:`mb-4`,children:[(0,l.jsx)(`span`,{className:`block text-xs uppercase tracking-wider text-[var(--color-text-muted)] mb-1`,children:e(`account.identityProvider`)}),(0,l.jsx)(`span`,{className:`text-[var(--color-text-heading)]`,children:n.identity_provider})]}),n.groups.length>0&&(0,l.jsxs)(`div`,{className:`mb-4`,children:[(0,l.jsx)(`span`,{className:`block text-xs uppercase tracking-wider text-[var(--color-text-muted)] mb-1`,children:e(`account.groups`)}),(0,l.jsx)(`ul`,{className:`list-disc list-inside text-[var(--color-text-heading)] space-y-1`,children:n.groups.map(e=>(0,l.jsx)(`li`,{children:e},e))})]}),(0,l.jsx)(`div`,{className:`mt-6 flex gap-2 flex-wrap`,children:(0,l.jsx)(`a`,{href:`/auth/logout`,className:`min-h-[44px] min-w-[44px] inline-flex items-center justify-center px-4 py-2 rounded-[var(--radius-md)] font-medium border border-[var(--color-border)] text-[var(--color-text)] bg-transparent no-underline hover:bg-[var(--color-surface-elevated)] focus-visible:outline focus-visible:outline-2 focus-visible:outline-[var(--color-focus-ring)] focus-visible:outline-offset-2`,children:e(`account.logOut`)})})]})]})}export{f as AccountPage};
@@ -1 +1 @@
1
- import{a as e,v as t}from"./vendor-DEls6f-c.js";import{t as n}from"./react-C1iE8mnY.js";var r=n();function i({message:n,nextAction:i,onRetry:a,showGoBack:o=!0,supportLink:s}){let{t:c}=t();return(0,r.jsxs)(`div`,{className:`p-4 rounded-[var(--radius-md)] border border-[var(--color-error)] bg-[var(--color-error-bg)]`,role:`alert`,children:[(0,r.jsx)(`h2`,{className:`text-base font-semibold text-[var(--color-error)] mb-2`,children:c(`error.title`)}),(0,r.jsx)(`p`,{className:`text-[var(--color-text)]`,children:n}),i&&(0,r.jsx)(`p`,{className:`mt-4 pt-4 border-t border-[var(--color-border)] font-medium`,children:i}),(0,r.jsxs)(`div`,{className:`flex flex-wrap gap-2 mt-4`,children:[a&&(0,r.jsx)(`button`,{type:`button`,onClick:a,className:`min-h-[44px] min-w-[44px] px-4 py-2 rounded-[var(--radius-md)] font-medium bg-[var(--color-primary)] text-white border-0 cursor-pointer hover:bg-[var(--color-primary-hover)] focus-visible:outline focus-visible:outline-2 focus-visible:outline-[var(--color-focus-ring)] focus-visible:outline-offset-2`,children:c(`error.retry`)}),o&&(0,r.jsx)(e,{to:`/`,className:`min-h-[44px] min-w-[44px] inline-flex items-center justify-center px-4 py-2 rounded-[var(--radius-md)] font-medium border border-[var(--color-border)] text-[var(--color-text)] no-underline hover:bg-[var(--color-surface-elevated)] focus-visible:outline focus-visible:outline-2 focus-visible:outline-[var(--color-focus-ring)] focus-visible:outline-offset-2`,children:c(`error.goBack`)}),s&&(0,r.jsx)(`a`,{href:s,target:`_blank`,rel:`noopener noreferrer`,className:`min-h-[44px] min-w-[44px] inline-flex items-center justify-center px-4 py-2 rounded-[var(--radius-md)] font-medium border border-[var(--color-border)] text-[var(--color-text)] no-underline hover:bg-[var(--color-surface-elevated)] focus-visible:outline focus-visible:outline-2 focus-visible:outline-[var(--color-focus-ring)] focus-visible:outline-offset-2`,children:c(`error.support`)})]})]})}export{i as t};
1
+ import{a as e,v as t}from"./vendor-Bef0enSO.js";import{t as n}from"./react-C1iE8mnY.js";var r=n();function i({message:n,nextAction:i,onRetry:a,showGoBack:o=!0,supportLink:s}){let{t:c}=t();return(0,r.jsxs)(`div`,{className:`p-4 rounded-[var(--radius-md)] border border-[var(--color-error)] bg-[var(--color-error-bg)]`,role:`alert`,children:[(0,r.jsx)(`h2`,{className:`text-base font-semibold text-[var(--color-error)] mb-2`,children:c(`error.title`)}),(0,r.jsx)(`p`,{className:`text-[var(--color-text)]`,children:n}),i&&(0,r.jsx)(`p`,{className:`mt-4 pt-4 border-t border-[var(--color-border)] font-medium`,children:i}),(0,r.jsxs)(`div`,{className:`flex flex-wrap gap-2 mt-4`,children:[a&&(0,r.jsx)(`button`,{type:`button`,onClick:a,className:`min-h-[44px] min-w-[44px] px-4 py-2 rounded-[var(--radius-md)] font-medium bg-[var(--color-primary)] text-white border-0 cursor-pointer hover:bg-[var(--color-primary-hover)] focus-visible:outline focus-visible:outline-2 focus-visible:outline-[var(--color-focus-ring)] focus-visible:outline-offset-2`,children:c(`error.retry`)}),o&&(0,r.jsx)(e,{to:`/`,className:`min-h-[44px] min-w-[44px] inline-flex items-center justify-center px-4 py-2 rounded-[var(--radius-md)] font-medium border border-[var(--color-border)] text-[var(--color-text)] no-underline hover:bg-[var(--color-surface-elevated)] focus-visible:outline focus-visible:outline-2 focus-visible:outline-[var(--color-focus-ring)] focus-visible:outline-offset-2`,children:c(`error.goBack`)}),s&&(0,r.jsx)(`a`,{href:s,target:`_blank`,rel:`noopener noreferrer`,className:`min-h-[44px] min-w-[44px] inline-flex items-center justify-center px-4 py-2 rounded-[var(--radius-md)] font-medium border border-[var(--color-border)] text-[var(--color-text)] no-underline hover:bg-[var(--color-surface-elevated)] focus-visible:outline focus-visible:outline-2 focus-visible:outline-[var(--color-focus-ring)] focus-visible:outline-offset-2`,children:c(`error.support`)})]})]})}export{i as t};
@@ -1 +1 @@
1
- import{a as e,f as t,v as n}from"./vendor-DEls6f-c.js";import{n as r,r as i}from"./SpaceSelect-LrJMAMEk.js";import{t as a}from"./SurfaceCard-DJ6PVBPM.js";import{t as o}from"./react-C1iE8mnY.js";var s=o();function c(){let{t:o}=n(),c=t(),{data:l,isLoading:u,isError:d}=i(),f=e=>{e.preventDefault();let t=e.currentTarget.querySelector(`input[name="q"]`)?.value?.trim()??``;c(t?`/squadrules?q=${encodeURIComponent(t)}`:`/squadrules`)},p=l?.spaces??[],m=u||d||p.length===0;return(0,s.jsxs)(`div`,{children:[(0,s.jsx)(`h1`,{className:`text-[var(--color-text-heading)] text-2xl font-semibold mb-1`,children:o(`home.title`)}),(0,s.jsx)(`p`,{className:`text-sm text-[var(--color-text-muted)] mb-6`,children:o(`home.tagline`)}),(0,s.jsx)(a,{title:o(`home.findCardTitle`),subtitle:o(`home.findCardSubtitle`),className:`mb-6`,children:(0,s.jsxs)(`form`,{onSubmit:f,className:`grid gap-3 md:grid-cols-[1fr_auto] md:items-end`,"aria-label":o(`home.searchLabel`),children:[(0,s.jsxs)(`div`,{children:[(0,s.jsx)(`label`,{htmlFor:`home-search-query`,className:`block font-medium text-[var(--color-text-heading)] mb-2`,children:o(`home.searchLabel`)}),(0,s.jsx)(`input`,{id:`home-search-query`,name:`q`,type:`search`,autoComplete:`off`,placeholder:o(`home.searchPlaceholder`),"aria-describedby":`home-search-hint`,className:`w-full min-h-[44px] px-4 py-2 border border-[var(--color-border)] rounded-[var(--radius-md)] text-[var(--color-text)] bg-[var(--color-surface)] focus-visible:outline focus-visible:outline-2 focus-visible:outline-[var(--color-focus-ring)] focus-visible:outline-offset-2`}),(0,s.jsx)(`p`,{id:`home-search-hint`,className:`text-sm text-[var(--color-text-muted)] mt-2`,children:o(`home.searchHint`)})]}),(0,s.jsxs)(`div`,{className:`flex flex-wrap gap-2 md:flex-col md:items-stretch`,children:[(0,s.jsx)(`button`,{type:`submit`,className:`min-h-[44px] min-w-[44px] inline-flex items-center justify-center px-4 py-2 rounded-[var(--radius-md)] font-medium bg-[var(--color-primary)] text-white border-0 cursor-pointer hover:bg-[var(--color-primary-hover)] focus-visible:outline focus-visible:outline-2 focus-visible:outline-[var(--color-focus-ring)] focus-visible:outline-offset-2`,children:o(`squadrules.search`)}),(0,s.jsx)(e,{to:`/squadrules`,className:`min-h-[44px] min-w-[44px] inline-flex items-center justify-center px-4 py-2 rounded-[var(--radius-md)] font-medium border border-[var(--color-border)] bg-[var(--color-surface)] text-[var(--color-text)] no-underline hover:bg-[var(--color-surface-elevated)] focus-visible:outline focus-visible:outline-2 focus-visible:outline-[var(--color-focus-ring)] focus-visible:outline-offset-2`,children:o(`home.goToBrowse`)})]})]})}),(0,s.jsxs)(`div`,{className:`grid gap-4 md:grid-cols-3 mb-6`,children:[(0,s.jsx)(a,{title:o(`home.cardBrowseTitle`),subtitle:o(`home.cardBrowseSubtitle`),children:(0,s.jsx)(e,{to:`/squadrules`,className:`min-h-[44px] min-w-[44px] inline-flex items-center justify-center px-4 py-2 rounded-[var(--radius-md)] font-medium bg-[var(--color-primary)] text-white no-underline hover:bg-[var(--color-primary-hover)] focus-visible:outline focus-visible:outline-2 focus-visible:outline-[var(--color-focus-ring)] focus-visible:outline-offset-2`,children:o(`home.cardBrowseCta`)})}),(0,s.jsx)(a,{title:o(`home.cardCreateTitle`),subtitle:o(`home.cardCreateSubtitle`),children:(0,s.jsx)(e,{to:`/protocols/new`,className:`min-h-[44px] min-w-[44px] inline-flex items-center justify-center px-4 py-2 rounded-[var(--radius-md)] font-medium border border-[var(--color-border)] bg-[var(--color-surface)] text-[var(--color-text)] no-underline hover:bg-[var(--color-surface-elevated)] focus-visible:outline focus-visible:outline-2 focus-visible:outline-[var(--color-focus-ring)] focus-visible:outline-offset-2`,children:o(`home.cardCreateCta`)})}),(0,s.jsx)(a,{title:o(`home.cardRunsTitle`),subtitle:o(`home.cardRunsSubtitle`),children:(0,s.jsx)(e,{to:`/runs`,className:`min-h-[44px] min-w-[44px] inline-flex items-center justify-center px-4 py-2 rounded-[var(--radius-md)] font-medium border border-[var(--color-border)] bg-[var(--color-surface)] text-[var(--color-text)] no-underline hover:bg-[var(--color-surface-elevated)] focus-visible:outline focus-visible:outline-2 focus-visible:outline-[var(--color-focus-ring)] focus-visible:outline-offset-2`,children:o(`home.cardRunsCta`)})})]}),(0,s.jsxs)(`section`,{"aria-labelledby":`home-stats-heading`,children:[(0,s.jsx)(`h2`,{id:`home-stats-heading`,className:`text-lg font-semibold text-[var(--color-text-heading)] mb-2`,children:o(`home.spacesHeading`)}),(0,s.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-2 lg:grid-cols-3`,"aria-label":o(`home.statsLabel`),children:[m&&p.length===0?(0,s.jsxs)(`div`,{className:`rounded-[var(--radius-md)] border border-[var(--color-border)] bg-[var(--color-surface-elevated)] p-4`,children:[(0,s.jsx)(`span`,{className:`text-2xl font-semibold text-[var(--color-text-heading)]`,children:`—`}),(0,s.jsx)(`span`,{className:`block text-xs uppercase tracking-wide text-[var(--color-text-muted)] mt-1`,children:o(`home.stats.spacesLabel`)}),(0,s.jsx)(`span`,{className:`block text-sm text-[var(--color-text-muted)] mt-2`,children:o(`home.stats.protocolCount`,{count:0})})]}):null,p.map(e=>(0,s.jsxs)(`div`,{className:`rounded-[var(--radius-md)] border border-[var(--color-border)] bg-[var(--color-surface-elevated)] p-4`,children:[(0,s.jsx)(`div`,{className:`text-2xl font-semibold text-[var(--color-text-heading)]`,children:u?`—`:e.adapter_count}),(0,s.jsxs)(`div`,{className:`mt-1 flex flex-wrap items-center gap-2`,children:[(0,s.jsx)(`span`,{className:`text-xs uppercase tracking-wide text-[var(--color-text-muted)]`,children:e.name}),(0,s.jsx)(r,{type:e.type})]}),(0,s.jsx)(`div`,{className:`mt-2 text-sm text-[var(--color-text-muted)]`,children:u?`—`:o(`home.stats.protocolCount`,{count:e.adapter_count})})]},e.space_id))]})]})]})}export{c as HomePage};
1
+ import{a as e,f as t,v as n}from"./vendor-Bef0enSO.js";import{n as r,r as i}from"./SpaceSelect-BRqyRXZF.js";import{t as a}from"./SurfaceCard-DJ6PVBPM.js";import{t as o}from"./react-C1iE8mnY.js";var s=o();function c(){let{t:o}=n(),c=t(),{data:l,isLoading:u,isError:d}=i(),f=e=>{e.preventDefault();let t=e.currentTarget.querySelector(`input[name="q"]`)?.value?.trim()??``;c(t?`/squadrules?q=${encodeURIComponent(t)}`:`/squadrules`)},p=l?.spaces??[],m=u||d||p.length===0;return(0,s.jsxs)(`div`,{children:[(0,s.jsx)(`h1`,{className:`text-[var(--color-text-heading)] text-2xl font-semibold mb-1`,children:o(`home.title`)}),(0,s.jsx)(`p`,{className:`text-sm text-[var(--color-text-muted)] mb-6`,children:o(`home.tagline`)}),(0,s.jsx)(a,{title:o(`home.findCardTitle`),subtitle:o(`home.findCardSubtitle`),className:`mb-6`,children:(0,s.jsxs)(`form`,{onSubmit:f,className:`grid gap-3 md:grid-cols-[1fr_auto] md:items-end`,"aria-label":o(`home.searchLabel`),children:[(0,s.jsxs)(`div`,{children:[(0,s.jsx)(`label`,{htmlFor:`home-search-query`,className:`block font-medium text-[var(--color-text-heading)] mb-2`,children:o(`home.searchLabel`)}),(0,s.jsx)(`input`,{id:`home-search-query`,name:`q`,type:`search`,autoComplete:`off`,placeholder:o(`home.searchPlaceholder`),"aria-describedby":`home-search-hint`,className:`w-full min-h-[44px] px-4 py-2 border border-[var(--color-border)] rounded-[var(--radius-md)] text-[var(--color-text)] bg-[var(--color-surface)] focus-visible:outline focus-visible:outline-2 focus-visible:outline-[var(--color-focus-ring)] focus-visible:outline-offset-2`}),(0,s.jsx)(`p`,{id:`home-search-hint`,className:`text-sm text-[var(--color-text-muted)] mt-2`,children:o(`home.searchHint`)})]}),(0,s.jsxs)(`div`,{className:`flex flex-wrap gap-2 md:flex-col md:items-stretch`,children:[(0,s.jsx)(`button`,{type:`submit`,className:`min-h-[44px] min-w-[44px] inline-flex items-center justify-center px-4 py-2 rounded-[var(--radius-md)] font-medium bg-[var(--color-primary)] text-white border-0 cursor-pointer hover:bg-[var(--color-primary-hover)] focus-visible:outline focus-visible:outline-2 focus-visible:outline-[var(--color-focus-ring)] focus-visible:outline-offset-2`,children:o(`squadrules.search`)}),(0,s.jsx)(e,{to:`/squadrules`,className:`min-h-[44px] min-w-[44px] inline-flex items-center justify-center px-4 py-2 rounded-[var(--radius-md)] font-medium border border-[var(--color-border)] bg-[var(--color-surface)] text-[var(--color-text)] no-underline hover:bg-[var(--color-surface-elevated)] focus-visible:outline focus-visible:outline-2 focus-visible:outline-[var(--color-focus-ring)] focus-visible:outline-offset-2`,children:o(`home.goToBrowse`)})]})]})}),(0,s.jsxs)(`div`,{className:`grid gap-4 md:grid-cols-3 mb-6`,children:[(0,s.jsx)(a,{title:o(`home.cardBrowseTitle`),subtitle:o(`home.cardBrowseSubtitle`),children:(0,s.jsx)(e,{to:`/squadrules`,className:`min-h-[44px] min-w-[44px] inline-flex items-center justify-center px-4 py-2 rounded-[var(--radius-md)] font-medium bg-[var(--color-primary)] text-white no-underline hover:bg-[var(--color-primary-hover)] focus-visible:outline focus-visible:outline-2 focus-visible:outline-[var(--color-focus-ring)] focus-visible:outline-offset-2`,children:o(`home.cardBrowseCta`)})}),(0,s.jsx)(a,{title:o(`home.cardCreateTitle`),subtitle:o(`home.cardCreateSubtitle`),children:(0,s.jsx)(e,{to:`/protocols/new`,className:`min-h-[44px] min-w-[44px] inline-flex items-center justify-center px-4 py-2 rounded-[var(--radius-md)] font-medium border border-[var(--color-border)] bg-[var(--color-surface)] text-[var(--color-text)] no-underline hover:bg-[var(--color-surface-elevated)] focus-visible:outline focus-visible:outline-2 focus-visible:outline-[var(--color-focus-ring)] focus-visible:outline-offset-2`,children:o(`home.cardCreateCta`)})}),(0,s.jsx)(a,{title:o(`home.cardRunsTitle`),subtitle:o(`home.cardRunsSubtitle`),children:(0,s.jsx)(e,{to:`/runs`,className:`min-h-[44px] min-w-[44px] inline-flex items-center justify-center px-4 py-2 rounded-[var(--radius-md)] font-medium border border-[var(--color-border)] bg-[var(--color-surface)] text-[var(--color-text)] no-underline hover:bg-[var(--color-surface-elevated)] focus-visible:outline focus-visible:outline-2 focus-visible:outline-[var(--color-focus-ring)] focus-visible:outline-offset-2`,children:o(`home.cardRunsCta`)})})]}),(0,s.jsxs)(`section`,{"aria-labelledby":`home-stats-heading`,children:[(0,s.jsx)(`h2`,{id:`home-stats-heading`,className:`text-lg font-semibold text-[var(--color-text-heading)] mb-2`,children:o(`home.spacesHeading`)}),(0,s.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-2 lg:grid-cols-3`,"aria-label":o(`home.statsLabel`),children:[m&&p.length===0?(0,s.jsxs)(`div`,{className:`rounded-[var(--radius-md)] border border-[var(--color-border)] bg-[var(--color-surface-elevated)] p-4`,children:[(0,s.jsx)(`span`,{className:`text-2xl font-semibold text-[var(--color-text-heading)]`,children:`—`}),(0,s.jsx)(`span`,{className:`block text-xs uppercase tracking-wide text-[var(--color-text-muted)] mt-1`,children:o(`home.stats.spacesLabel`)}),(0,s.jsx)(`span`,{className:`block text-sm text-[var(--color-text-muted)] mt-2`,children:o(`home.stats.protocolCount`,{count:0})})]}):null,p.map(e=>(0,s.jsxs)(`div`,{className:`rounded-[var(--radius-md)] border border-[var(--color-border)] bg-[var(--color-surface-elevated)] p-4`,children:[(0,s.jsx)(`div`,{className:`text-2xl font-semibold text-[var(--color-text-heading)]`,children:u?`—`:e.adapter_count}),(0,s.jsxs)(`div`,{className:`mt-1 flex flex-wrap items-center gap-2`,children:[(0,s.jsx)(`span`,{className:`text-xs uppercase tracking-wide text-[var(--color-text-muted)]`,children:e.name}),(0,s.jsx)(r,{type:e.type})]}),(0,s.jsx)(`div`,{className:`mt-2 text-sm text-[var(--color-text-muted)]`,children:u?`—`:o(`home.stats.protocolCount`,{count:e.adapter_count})})]},e.space_id))]})]})]})}export{c as HomePage};
@@ -1 +1 @@
1
- import{v as e}from"./vendor-DEls6f-c.js";import{t}from"./ErrorAlert-CpqG3xN8.js";import{t as n}from"./react-C1iE8mnY.js";var r=n();function i(){let{t:n}=e();return(0,r.jsxs)(`div`,{children:[(0,r.jsx)(`h1`,{className:`text-[var(--color-text-heading)] text-2xl font-semibold mb-4`,children:n(`notFound.title`)}),(0,r.jsx)(t,{message:n(`notFound.message`),showGoBack:!0})]})}export{i as NotFoundPage};
1
+ import{v as e}from"./vendor-Bef0enSO.js";import{t}from"./ErrorAlert-C-zfyHDh.js";import{t as n}from"./react-C1iE8mnY.js";var r=n();function i(){let{t:n}=e();return(0,r.jsxs)(`div`,{children:[(0,r.jsx)(`h1`,{className:`text-[var(--color-text-heading)] text-2xl font-semibold mb-4`,children:n(`notFound.title`)}),(0,r.jsx)(t,{message:n(`notFound.message`),showGoBack:!0})]})}export{i as NotFoundPage};
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{i as t,t as n}from"./react-C1iE8mnY.js";import{a as r,p as i,v as a}from"./vendor-DEls6f-c.js";import{a as o,n as s,r as c,s as l,t as u}from"./export-skill-zip-DRU_W5EX.js";import{n as d}from"./ChallengeCard-BJf8kp0k.js";import{n as f,t as p}from"./StepFlowGraph-509IoD3J.js";import{t as m}from"./SurfaceCard-DJ6PVBPM.js";var h=e(t(),1),g=n();function _({value:e,label:t,className:n}){let{t:r}=a(),[i,o]=(0,h.useState)(!1),s=(0,h.useCallback)(async()=>{try{await navigator.clipboard.writeText(e),o(!0),setTimeout(()=>o(!1),2e3)}catch{}},[e]);return(0,g.jsx)(`button`,{type:`button`,onClick:s,className:n,"aria-label":i?r(`run.copied`):t,title:t,children:r(i?`run.copied`:`run.copy`)})}function v(e){return e.body.replace(/\n```json\s*[\s\S]*?```\s*$/g,``).trim()}function y(){let{t:e}=a(),{uri:t}=i(),{data:n,isLoading:y,isError:b,error:x}=l(t?decodeURIComponent(t):void 0,!0),[S,C]=(0,h.useState)(!1),[w,T]=(0,h.useState)(null);if(y&&!n)return(0,g.jsx)(`p`,{className:`text-[var(--color-text-muted)]`,children:e(`protocol.loading`)});if(b||!n)return(0,g.jsxs)(`div`,{role:`alert`,className:`p-4 rounded-[var(--radius-md)] bg-[var(--color-error-bg)] text-[var(--color-error)]`,children:[x instanceof Error?x.message:e(`protocol.notFound`),(0,g.jsx)(r,{to:`/`,className:`block mt-2 text-[var(--color-primary)] underline hover:no-underline focus-visible:outline focus-visible:outline-2 focus-visible:outline-[var(--color-focus-ring)] focus-visible:outline-offset-2`,children:e(`notFound.goHome`)})]});let{title:E,steps:D,triggers:O,completion:k}=o(n.content),A=E.replace(/[^a-zA-Z0-9]+/g,`-`).replace(/^-|-$/g,``)||`protocol`,j=()=>{let e=new Blob([n.content],{type:`text/markdown;charset=utf-8`}),t=URL.createObjectURL(e),r=document.createElement(`a`);r.href=t,r.download=`${A}.md`,r.click(),URL.revokeObjectURL(t)},M=async()=>{if(n?.uri){T(null),C(!0);try{let{blob:e,skill_bundle_manifest:t}=await u(n.uri),r=s(t,A);c(e,r)}catch(e){T(e instanceof Error?e.message:String(e))}finally{C(!1)}}},N=`min-h-[44px] min-w-[44px] inline-flex items-center justify-center px-4 py-2 rounded-[var(--radius-md)] font-medium border border-[var(--color-border)] text-[var(--color-text)] bg-[var(--color-surface)] no-underline hover:bg-[var(--color-surface-elevated)] focus-visible:outline focus-visible:outline-2 focus-visible:outline-[var(--color-focus-ring)] focus-visible:outline-offset-2`;return(0,g.jsxs)(`div`,{children:[(0,g.jsx)(`h1`,{className:`text-[var(--color-text-heading)] text-2xl font-semibold mb-1`,children:E}),(0,g.jsxs)(`div`,{className:`mb-4 flex flex-wrap items-center gap-2`,children:[(0,g.jsxs)(`p`,{className:`text-sm text-[var(--color-text-muted)] m-0`,children:[(0,g.jsxs)(`span`,{className:`sr-only`,children:[e(`protocol.uri`),`: `]}),(0,g.jsx)(`code`,{className:`break-all rounded bg-[var(--color-surface-elevated)] px-2 py-0.5 text-xs`,children:n.uri}),(0,g.jsxs)(`span`,{className:`ml-2`,children:[`· `,e(`protocol.readOnly`)]}),n.space_name!=null&&n.space_name.length>0?(0,g.jsxs)(`span`,{className:`ml-2 block w-full sm:inline sm:w-auto`,children:[`· `,e(`protocol.spaceLabel`),`: `,n.space_name]}):null]}),(0,g.jsx)(_,{value:n.uri,label:e(`protocol.copyUri`),className:`min-h-[44px] min-w-[44px] inline-flex items-center justify-center px-3 py-1.5 text-sm font-medium rounded-[var(--radius-md)] border border-[var(--color-border)] text-[var(--color-text)] bg-[var(--color-surface)] hover:bg-[var(--color-surface-elevated)] focus-visible:outline focus-visible:outline-2 focus-visible:outline-[var(--color-focus-ring)] focus-visible:outline-offset-2`})]}),(0,g.jsxs)(`div`,{className:`mb-6 flex flex-wrap gap-2`,children:[(0,g.jsx)(r,{to:`/protocols/${encodeURIComponent(n.uri)}/run`,className:`min-h-[44px] min-w-[44px] inline-flex items-center justify-center px-4 py-2 rounded-[var(--radius-md)] font-medium bg-[var(--color-primary)] text-white no-underline hover:bg-[var(--color-primary-hover)] focus-visible:outline focus-visible:outline-2 focus-visible:outline-[var(--color-focus-ring)] focus-visible:outline-offset-2`,children:e(`protocol.runGuided`)}),(0,g.jsx)(r,{to:`/protocols/${encodeURIComponent(n.uri)}/edit`,className:N,children:e(`protocol.edit`)}),(0,g.jsx)(r,{to:`/protocols/new`,className:N,children:e(`protocol.duplicate`)})]}),(0,g.jsxs)(`div`,{className:`mb-6 grid gap-4 xl:grid-cols-[1.6fr_1fr]`,children:[(0,g.jsx)(m,{title:e(`protocol.howToUse`),subtitle:e(`protocol.howToUseInProduct`),children:(0,g.jsxs)(`p`,{className:`text-sm text-[var(--color-text-muted)] m-0`,children:[e(`protocol.howToUseCopy`),` `,(0,g.jsx)(`a`,{href:`https://github.com/SquadRules/mcp#readme`,target:`_blank`,rel:`noopener noreferrer`,className:`text-[var(--color-primary)] underline hover:no-underline focus-visible:outline focus-visible:outline-2 focus-visible:outline-[var(--color-focus-ring)] focus-visible:outline-offset-2`,children:e(`protocol.docsLink`)})]})}),(0,g.jsx)(m,{title:e(`protocol.exportCardTitle`),subtitle:e(`protocol.exportCardSubtitle`),children:(0,g.jsxs)(`div`,{className:`w-full max-w-[22rem] rounded-[var(--radius-md)] border border-[var(--color-border)] bg-[var(--color-surface)] p-3`,children:[(0,g.jsx)(`div`,{className:`mb-2 text-sm font-medium text-[var(--color-text-heading)]`,children:e(`protocol.download`)}),(0,g.jsxs)(`button`,{type:`button`,onClick:j,className:`flex min-h-[44px] w-full items-center justify-between rounded-[var(--radius-md)] px-3 text-left text-sm text-[var(--color-text)] hover:bg-[var(--color-surface-elevated)]`,children:[(0,g.jsx)(`span`,{children:e(`protocol.downloadAsMarkdown`)}),(0,g.jsx)(`span`,{className:`text-[var(--color-text-muted)]`,children:`.md`})]}),(0,g.jsxs)(`button`,{type:`button`,onClick:()=>void M(),disabled:S,className:`mt-1 flex min-h-[44px] w-full items-center justify-between rounded-[var(--radius-md)] px-3 text-left text-sm text-[var(--color-text)] hover:bg-[var(--color-surface-elevated)] disabled:opacity-60`,children:[(0,g.jsx)(`span`,{children:e(`protocol.downloadAsSkill`)}),(0,g.jsx)(`span`,{className:`text-[var(--color-text-muted)]`,children:`.zip`})]}),w?(0,g.jsx)(`p`,{className:`mt-2 text-xs text-[var(--color-error)] m-0`,role:`alert`,children:w}):null,(0,g.jsxs)(r,{to:`/protocols/${encodeURIComponent(n.uri)}/skill`,className:`mt-1 flex min-h-[44px] w-full items-center justify-between rounded-[var(--radius-md)] px-3 text-left text-sm text-[var(--color-text)] no-underline hover:bg-[var(--color-surface-elevated)]`,children:[(0,g.jsx)(`span`,{children:e(`protocol.editAsSkill`)}),(0,g.jsx)(`span`,{className:`text-[var(--color-text-muted)]`,children:`bundle`})]}),(0,g.jsx)(`p`,{className:`mt-3 text-xs leading-5 text-[var(--color-text-muted)] m-0`,children:e(`protocol.exportFooter`)})]})})]}),(0,g.jsxs)(`section`,{className:`mb-6`,"aria-labelledby":`flow-heading`,children:[(0,g.jsx)(`h2`,{id:`flow-heading`,className:`mb-2 text-lg font-semibold text-[var(--color-text-heading)]`,children:e(`protocol.stepFlow`)}),(0,g.jsx)(p,{steps:D.map(e=>({label:e.label}))})]}),(0,g.jsxs)(`section`,{"aria-labelledby":`steps-heading`,className:`mb-6`,children:[(0,g.jsx)(`h2`,{id:`steps-heading`,className:`mb-2 text-lg font-semibold text-[var(--color-text-heading)]`,children:e(`protocol.steps`)}),(0,g.jsx)(`ul`,{className:`m-0 list-none divide-y divide-[var(--color-border)] rounded-[var(--radius-md)] border border-[var(--color-border)] bg-[var(--color-surface-elevated)] p-0`,children:D.map((e,t)=>{let n=v(e);return(0,g.jsxs)(`li`,{className:`p-4`,children:[(0,g.jsxs)(`strong`,{className:`block text-[var(--color-text-heading)]`,children:[t+1,`. `,e.label]}),(0,g.jsx)(`div`,{className:`mt-1 text-sm text-[var(--color-text-muted)] break-words`,children:e.summary}),(0,g.jsx)(`div`,{className:`mt-3`,children:(0,g.jsx)(d,{type:e.type,payload:e.challengePayload})}),n?(0,g.jsx)(`div`,{className:`mt-3 border-t border-[var(--color-border)] pt-3`,children:(0,g.jsx)(f,{content:n})}):null]},t)})})]}),(O||k)&&(0,g.jsxs)(`div`,{className:`grid gap-4 lg:grid-cols-2`,children:[O?(0,g.jsx)(m,{title:e(`protocol.triggers`),children:(0,g.jsx)(`div`,{className:`max-w-none text-sm text-[var(--color-text)]`,children:(0,g.jsx)(f,{content:O})})}):null,k?(0,g.jsx)(m,{title:e(`protocol.completion`),children:(0,g.jsx)(`div`,{className:`max-w-none text-sm text-[var(--color-text)]`,children:(0,g.jsx)(f,{content:k})})}):null]})]})}export{y as ProtocolDetailPage};
1
+ import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{i as t,t as n}from"./react-C1iE8mnY.js";import{a as r,p as i,v as a}from"./vendor-Bef0enSO.js";import{a as o,n as s,r as c,s as l,t as u}from"./export-skill-zip-rkzrXXa3.js";import{n as d}from"./ChallengeCard-BJf8kp0k.js";import{n as f,t as p}from"./StepFlowGraph-vYNHOiqf.js";import{t as m}from"./SurfaceCard-DJ6PVBPM.js";var h=e(t(),1),g=n();function _({value:e,label:t,className:n}){let{t:r}=a(),[i,o]=(0,h.useState)(!1),s=(0,h.useCallback)(async()=>{try{await navigator.clipboard.writeText(e),o(!0),setTimeout(()=>o(!1),2e3)}catch{}},[e]);return(0,g.jsx)(`button`,{type:`button`,onClick:s,className:n,"aria-label":i?r(`run.copied`):t,title:t,children:r(i?`run.copied`:`run.copy`)})}function v(e){return e.body.replace(/\n```json\s*[\s\S]*?```\s*$/g,``).trim()}function y(){let{t:e}=a(),{uri:t}=i(),{data:n,isLoading:y,isError:b,error:x}=l(t?decodeURIComponent(t):void 0,!0),[S,C]=(0,h.useState)(!1),[w,T]=(0,h.useState)(null);if(y&&!n)return(0,g.jsx)(`p`,{className:`text-[var(--color-text-muted)]`,children:e(`protocol.loading`)});if(b||!n)return(0,g.jsxs)(`div`,{role:`alert`,className:`p-4 rounded-[var(--radius-md)] bg-[var(--color-error-bg)] text-[var(--color-error)]`,children:[x instanceof Error?x.message:e(`protocol.notFound`),(0,g.jsx)(r,{to:`/`,className:`block mt-2 text-[var(--color-primary)] underline hover:no-underline focus-visible:outline focus-visible:outline-2 focus-visible:outline-[var(--color-focus-ring)] focus-visible:outline-offset-2`,children:e(`notFound.goHome`)})]});let{title:E,steps:D,triggers:O,completion:k}=o(n.content),A=E.replace(/[^a-zA-Z0-9]+/g,`-`).replace(/^-|-$/g,``)||`protocol`,j=()=>{let e=new Blob([n.content],{type:`text/markdown;charset=utf-8`}),t=URL.createObjectURL(e),r=document.createElement(`a`);r.href=t,r.download=`${A}.md`,r.click(),URL.revokeObjectURL(t)},M=async()=>{if(n?.uri){T(null),C(!0);try{let{blob:e,skill_bundle_manifest:t}=await u(n.uri),r=s(t,A);c(e,r)}catch(e){T(e instanceof Error?e.message:String(e))}finally{C(!1)}}},N=`min-h-[44px] min-w-[44px] inline-flex items-center justify-center px-4 py-2 rounded-[var(--radius-md)] font-medium border border-[var(--color-border)] text-[var(--color-text)] bg-[var(--color-surface)] no-underline hover:bg-[var(--color-surface-elevated)] focus-visible:outline focus-visible:outline-2 focus-visible:outline-[var(--color-focus-ring)] focus-visible:outline-offset-2`;return(0,g.jsxs)(`div`,{children:[(0,g.jsx)(`h1`,{className:`text-[var(--color-text-heading)] text-2xl font-semibold mb-1`,children:E}),(0,g.jsxs)(`div`,{className:`mb-4 flex flex-wrap items-center gap-2`,children:[(0,g.jsxs)(`p`,{className:`text-sm text-[var(--color-text-muted)] m-0`,children:[(0,g.jsxs)(`span`,{className:`sr-only`,children:[e(`protocol.uri`),`: `]}),(0,g.jsx)(`code`,{className:`break-all rounded bg-[var(--color-surface-elevated)] px-2 py-0.5 text-xs`,children:n.uri}),(0,g.jsxs)(`span`,{className:`ml-2`,children:[`· `,e(`protocol.readOnly`)]}),n.space_name!=null&&n.space_name.length>0?(0,g.jsxs)(`span`,{className:`ml-2 block w-full sm:inline sm:w-auto`,children:[`· `,e(`protocol.spaceLabel`),`: `,n.space_name]}):null]}),(0,g.jsx)(_,{value:n.uri,label:e(`protocol.copyUri`),className:`min-h-[44px] min-w-[44px] inline-flex items-center justify-center px-3 py-1.5 text-sm font-medium rounded-[var(--radius-md)] border border-[var(--color-border)] text-[var(--color-text)] bg-[var(--color-surface)] hover:bg-[var(--color-surface-elevated)] focus-visible:outline focus-visible:outline-2 focus-visible:outline-[var(--color-focus-ring)] focus-visible:outline-offset-2`})]}),(0,g.jsxs)(`div`,{className:`mb-6 flex flex-wrap gap-2`,children:[(0,g.jsx)(r,{to:`/protocols/${encodeURIComponent(n.uri)}/run`,className:`min-h-[44px] min-w-[44px] inline-flex items-center justify-center px-4 py-2 rounded-[var(--radius-md)] font-medium bg-[var(--color-primary)] text-white no-underline hover:bg-[var(--color-primary-hover)] focus-visible:outline focus-visible:outline-2 focus-visible:outline-[var(--color-focus-ring)] focus-visible:outline-offset-2`,children:e(`protocol.runGuided`)}),(0,g.jsx)(r,{to:`/protocols/${encodeURIComponent(n.uri)}/edit`,className:N,children:e(`protocol.edit`)}),(0,g.jsx)(r,{to:`/protocols/new`,className:N,children:e(`protocol.duplicate`)})]}),(0,g.jsxs)(`div`,{className:`mb-6 grid gap-4 xl:grid-cols-[1.6fr_1fr]`,children:[(0,g.jsx)(m,{title:e(`protocol.howToUse`),subtitle:e(`protocol.howToUseInProduct`),children:(0,g.jsxs)(`p`,{className:`text-sm text-[var(--color-text-muted)] m-0`,children:[e(`protocol.howToUseCopy`),` `,(0,g.jsx)(`a`,{href:`https://github.com/SquadRules/mcp#readme`,target:`_blank`,rel:`noopener noreferrer`,className:`text-[var(--color-primary)] underline hover:no-underline focus-visible:outline focus-visible:outline-2 focus-visible:outline-[var(--color-focus-ring)] focus-visible:outline-offset-2`,children:e(`protocol.docsLink`)})]})}),(0,g.jsx)(m,{title:e(`protocol.exportCardTitle`),subtitle:e(`protocol.exportCardSubtitle`),children:(0,g.jsxs)(`div`,{className:`w-full max-w-[22rem] rounded-[var(--radius-md)] border border-[var(--color-border)] bg-[var(--color-surface)] p-3`,children:[(0,g.jsx)(`div`,{className:`mb-2 text-sm font-medium text-[var(--color-text-heading)]`,children:e(`protocol.download`)}),(0,g.jsxs)(`button`,{type:`button`,onClick:j,className:`flex min-h-[44px] w-full items-center justify-between rounded-[var(--radius-md)] px-3 text-left text-sm text-[var(--color-text)] hover:bg-[var(--color-surface-elevated)]`,children:[(0,g.jsx)(`span`,{children:e(`protocol.downloadAsMarkdown`)}),(0,g.jsx)(`span`,{className:`text-[var(--color-text-muted)]`,children:`.md`})]}),(0,g.jsxs)(`button`,{type:`button`,onClick:()=>void M(),disabled:S,className:`mt-1 flex min-h-[44px] w-full items-center justify-between rounded-[var(--radius-md)] px-3 text-left text-sm text-[var(--color-text)] hover:bg-[var(--color-surface-elevated)] disabled:opacity-60`,children:[(0,g.jsx)(`span`,{children:e(`protocol.downloadAsSkill`)}),(0,g.jsx)(`span`,{className:`text-[var(--color-text-muted)]`,children:`.zip`})]}),w?(0,g.jsx)(`p`,{className:`mt-2 text-xs text-[var(--color-error)] m-0`,role:`alert`,children:w}):null,(0,g.jsxs)(r,{to:`/protocols/${encodeURIComponent(n.uri)}/skill`,className:`mt-1 flex min-h-[44px] w-full items-center justify-between rounded-[var(--radius-md)] px-3 text-left text-sm text-[var(--color-text)] no-underline hover:bg-[var(--color-surface-elevated)]`,children:[(0,g.jsx)(`span`,{children:e(`protocol.editAsSkill`)}),(0,g.jsx)(`span`,{className:`text-[var(--color-text-muted)]`,children:`bundle`})]}),(0,g.jsx)(`p`,{className:`mt-3 text-xs leading-5 text-[var(--color-text-muted)] m-0`,children:e(`protocol.exportFooter`)})]})})]}),(0,g.jsxs)(`section`,{className:`mb-6`,"aria-labelledby":`flow-heading`,children:[(0,g.jsx)(`h2`,{id:`flow-heading`,className:`mb-2 text-lg font-semibold text-[var(--color-text-heading)]`,children:e(`protocol.stepFlow`)}),(0,g.jsx)(p,{steps:D.map(e=>({label:e.label}))})]}),(0,g.jsxs)(`section`,{"aria-labelledby":`steps-heading`,className:`mb-6`,children:[(0,g.jsx)(`h2`,{id:`steps-heading`,className:`mb-2 text-lg font-semibold text-[var(--color-text-heading)]`,children:e(`protocol.steps`)}),(0,g.jsx)(`ul`,{className:`m-0 list-none divide-y divide-[var(--color-border)] rounded-[var(--radius-md)] border border-[var(--color-border)] bg-[var(--color-surface-elevated)] p-0`,children:D.map((e,t)=>{let n=v(e);return(0,g.jsxs)(`li`,{className:`p-4`,children:[(0,g.jsxs)(`strong`,{className:`block text-[var(--color-text-heading)]`,children:[t+1,`. `,e.label]}),(0,g.jsx)(`div`,{className:`mt-1 text-sm text-[var(--color-text-muted)] break-words`,children:e.summary}),(0,g.jsx)(`div`,{className:`mt-3`,children:(0,g.jsx)(d,{type:e.type,payload:e.challengePayload})}),n?(0,g.jsx)(`div`,{className:`mt-3 border-t border-[var(--color-border)] pt-3`,children:(0,g.jsx)(f,{content:n})}):null]},t)})})]}),(O||k)&&(0,g.jsxs)(`div`,{className:`grid gap-4 lg:grid-cols-2`,children:[O?(0,g.jsx)(m,{title:e(`protocol.triggers`),children:(0,g.jsx)(`div`,{className:`max-w-none text-sm text-[var(--color-text)]`,children:(0,g.jsx)(f,{content:O})})}):null,k?(0,g.jsx)(m,{title:e(`protocol.completion`),children:(0,g.jsx)(`div`,{className:`max-w-none text-sm text-[var(--color-text)]`,children:(0,g.jsx)(f,{content:k})})}):null]})]})}export{y as ProtocolDetailPage};
@@ -1,4 +1,4 @@
1
- import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{i as t,t as n}from"./react-C1iE8mnY.js";import{a as r,f as i,p as a,t as o,v as s}from"./vendor-DEls6f-c.js";import{a as c,i as l,n as u,o as d,r as f,s as p,t as m}from"./export-skill-zip-DRU_W5EX.js";import{t as h}from"./api-BgTb-tmJ.js";import{t as g}from"./RichTextEditor-B6msD7tF.js";import{r as _,t as v}from"./SpaceSelect-LrJMAMEk.js";import{t as y}from"./SurfaceCard-DJ6PVBPM.js";import{t as b}from"./ChallengeCard-BJf8kp0k.js";var x=e(t(),1),S=o().min(1,`Protocol content is required`).refine(e=>e.includes(`# `),`Protocol must have an H1 title`).refine(e=>/(^|\n)##\s+Activation Patterns\b/i.test(e),`Include an "Activation Patterns" section (H2)`).refine(e=>/(^|\n)##\s+Reward Signal\b/i.test(e),`Include a "Reward Signal" section (H2)`),C={label:`Step`,bodyMarkdown:`What the user or agent does in this step.`,type:`comment`,comment:{min_length:10}},w=[`shell`,`forward`,`user_input`,`comment`],T=/^squadrules:\/\/adapter\/[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,E=n();function D({t:e,fileInputRef:t,onUpload:n,isNew:i,decodedUri:a}){return(0,E.jsx)(y,{className:`mb-8`,title:e(`protocolEdit.importCardTitle`),subtitle:e(`protocolEdit.uploadHint`),children:(0,E.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,E.jsx)(`input`,{ref:t,type:`file`,accept:`.md,text/markdown`,onChange:n,className:`sr-only`,id:`protocol-upload`,"aria-label":e(`protocolEdit.upload`)}),(0,E.jsx)(`button`,{type:`button`,onClick:()=>t.current?.click(),className:`min-h-[44px] min-w-[44px] inline-flex items-center justify-center rounded-[var(--radius-md)] border border-[var(--color-border)] bg-[var(--color-surface)] px-4 py-2 text-sm font-medium text-[var(--color-text)] hover:bg-[var(--color-surface-elevated)] focus-visible:outline focus-visible:outline-2 focus-visible:outline-[var(--color-focus-ring)] focus-visible:outline-offset-2`,children:e(`protocolEdit.upload`)}),!i&&a&&(0,E.jsx)(r,{to:`/protocols/${encodeURIComponent(a)}/skill`,className:`min-h-[44px] min-w-[44px] inline-flex items-center justify-center rounded-[var(--radius-md)] border border-[var(--color-border)] bg-[var(--color-surface)] px-4 py-2 text-sm font-medium text-[var(--color-text)] no-underline hover:bg-[var(--color-surface-elevated)] focus-visible:outline focus-visible:outline-2 focus-visible:outline-[var(--color-focus-ring)] focus-visible:outline-offset-2`,children:e(`protocol.editAsSkill`)})]})})}function O({t:e,preview:t,skillFolderSlug:n,isNew:i,decodedUri:a}){let[o,s]=(0,x.useState)(!1),[c,l]=(0,x.useState)(null);return(0,E.jsxs)(`div`,{className:`space-y-4`,"aria-label":e(`protocolEdit.previewLabel`),children:[(0,E.jsxs)(y,{title:e(`protocolEdit.previewRenderedTitle`),subtitle:e(`protocolEdit.previewRenderedSubtitle`),children:[(0,E.jsx)(`div`,{className:`text-lg font-semibold text-[var(--color-text-heading)]`,children:t.title}),(0,E.jsx)(`div`,{className:`mt-3 space-y-3`,children:t.steps.length===0?(0,E.jsx)(`div`,{className:`text-sm text-[var(--color-text-muted)]`,children:e(`protocolEdit.previewNoSteps`)}):t.steps.slice(0,20).map((t,n)=>(0,E.jsxs)(`div`,{className:`rounded-[var(--radius-sm)] border border-[var(--color-border)] bg-[var(--color-surface)] p-3`,children:[(0,E.jsx)(`div`,{className:`font-medium text-[var(--color-text-heading)]`,children:e(`protocolEdit.previewStepLine`,{n:n+1,label:t.label})}),(0,E.jsx)(`div`,{className:`mt-1 text-sm text-[var(--color-text-muted)]`,children:b[t.type]??t.type})]},`${t.label}:${n}`))}),(0,E.jsxs)(`div`,{className:`mt-4 border-t border-[var(--color-border)] pt-4 text-sm text-[var(--color-text-muted)]`,children:[(0,E.jsxs)(`div`,{children:[(0,E.jsxs)(`strong`,{className:`text-[var(--color-text-heading)]`,children:[e(`protocol.triggers`),`:`]}),` `,t.triggers?e(`protocolEdit.present`):e(`protocolEdit.missing`)]}),(0,E.jsxs)(`div`,{className:`mt-1`,children:[(0,E.jsxs)(`strong`,{className:`text-[var(--color-text-heading)]`,children:[e(`protocol.completion`),`:`]}),` `,t.completion?e(`protocolEdit.present`):e(`protocolEdit.missing`)]})]})]}),!i&&a?(0,E.jsxs)(y,{title:e(`protocolEdit.skillShortcutTitle`),subtitle:e(`protocolEdit.skillShortcutSubtitle`),children:[(0,E.jsxs)(`div`,{className:`rounded-[var(--radius-md)] border border-[var(--color-border)] bg-[var(--color-surface)] p-3`,children:[(0,E.jsxs)(`div`,{className:`font-medium text-[var(--color-text-heading)]`,children:[n,`-skill/`]}),(0,E.jsxs)(`div`,{className:`mt-2 font-mono text-sm text-[var(--color-text-muted)]`,children:[`Skill.md`,(0,E.jsx)(`br`,{}),`references/`,(0,E.jsx)(`br`,{}),`\xA0\xA0SQUADRULES.md`]})]}),(0,E.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-2`,children:[(0,E.jsx)(r,{to:`/protocols/${encodeURIComponent(a)}/skill`,className:`min-h-[44px] min-w-[44px] inline-flex items-center justify-center rounded-[var(--radius-md)] border border-[var(--color-border)] bg-[var(--color-surface)] px-4 py-2 text-sm font-medium text-[var(--color-text)] no-underline hover:bg-[var(--color-surface-elevated)] focus-visible:outline focus-visible:outline-2 focus-visible:outline-[var(--color-focus-ring)] focus-visible:outline-offset-2`,children:e(`protocol.editAsSkill`)}),(0,E.jsx)(`button`,{type:`button`,disabled:o,onClick:()=>{(async()=>{if(a){l(null),s(!0);try{let{blob:e,skill_bundle_manifest:t}=await m(a),r=u(t,n);f(e,r)}catch(e){l(e instanceof Error?e.message:String(e))}finally{s(!1)}}})()},className:`min-h-[44px] min-w-[44px] inline-flex items-center justify-center rounded-[var(--radius-md)] bg-[var(--color-primary)] px-4 py-2 text-sm font-medium text-white hover:bg-[var(--color-primary-hover)] focus-visible:outline focus-visible:outline-2 focus-visible:outline-[var(--color-focus-ring)] focus-visible:outline-offset-2 disabled:opacity-60`,children:e(`protocol.downloadAsSkill`)}),c?(0,E.jsx)(`p`,{className:`mt-2 m-0 text-xs text-[var(--color-error)]`,role:`alert`,children:c}):null]})]}):null]})}function k({t:e,isNew:t,spaces:n,spacesLoading:r,targetSpace:i,setTargetSpace:a,forkSourceUri:o,setForkSourceUri:s,moveSpace:c,setMoveSpace:l}){return(0,E.jsx)(`section`,{className:`mb-8 space-y-5 rounded-[var(--radius-md)] border border-[var(--color-border)] bg-[var(--color-surface-elevated)] p-5`,children:t?(0,E.jsxs)(E.Fragment,{children:[(0,E.jsxs)(`div`,{children:[(0,E.jsx)(`label`,{htmlFor:`protocol-target-space`,className:`mb-2 block font-medium text-[var(--color-text-heading)]`,children:e(`protocolEdit.targetSpaceLabel`)}),(0,E.jsx)(v,{id:`protocol-target-space`,spaces:n,value:i,onChange:a,disabled:r}),(0,E.jsx)(`p`,{className:`mt-2 text-sm text-[var(--color-text-muted)]`,children:e(`protocolEdit.targetSpaceHint`)})]}),(0,E.jsxs)(`div`,{children:[(0,E.jsx)(`label`,{htmlFor:`protocol-fork-source`,className:`mb-2 block font-medium text-[var(--color-text-heading)]`,children:e(`protocolEdit.forkSourceLabel`)}),(0,E.jsx)(`input`,{id:`protocol-fork-source`,type:`text`,value:o,onChange:e=>s(e.target.value),placeholder:e(`protocolEdit.forkSourcePlaceholder`),autoComplete:`off`,className:`min-h-[44px] w-full max-w-2xl rounded-[var(--radius-md)] border border-[var(--color-border)] bg-[var(--color-surface)] px-4 py-3 text-sm text-[var(--color-text)] focus-visible:outline focus-visible:outline-2 focus-visible:outline-[var(--color-focus-ring)] focus-visible:outline-offset-2`}),(0,E.jsx)(`p`,{className:`mt-2 text-sm text-[var(--color-text-muted)]`,children:e(`protocolEdit.forkSourceHint`)})]})]}):(0,E.jsxs)(`div`,{children:[(0,E.jsx)(`label`,{htmlFor:`protocol-move-space`,className:`mb-2 block font-medium text-[var(--color-text-heading)]`,children:e(`protocolEdit.moveSpaceLabel`)}),(0,E.jsx)(v,{id:`protocol-move-space`,spaces:n,value:c,onChange:l,disabled:r}),(0,E.jsx)(`p`,{className:`mt-2 text-sm text-[var(--color-text-muted)]`,children:e(`protocolEdit.moveSpaceHint`)})]})})}var A=[`bash`,`sh`,`python3`,`python`,`node`],j=`min-h-[44px] w-full rounded-[var(--radius-md)] border border-[var(--color-border)] bg-[var(--color-surface)] px-4 py-3 text-sm text-[var(--color-text)] focus-visible:outline focus-visible:outline-2 focus-visible:outline-[var(--color-focus-ring)] focus-visible:outline-offset-2`,M=`min-h-[44px] w-full rounded-[var(--radius-md)] border border-[var(--color-border)] bg-[var(--color-surface-elevated)] px-4 py-3 text-sm text-[var(--color-text)] focus-visible:outline focus-visible:outline-2 focus-visible:outline-[var(--color-focus-ring)] focus-visible:outline-offset-2`;function N({t:e,step:t,index:n,stepsLength:r,uploadKey:i,challengeTypeLabel:a,setStep:o,removeStep:s}){return(0,E.jsxs)(`div`,{className:`rounded-[var(--radius-md)] border border-[var(--color-border)] bg-[var(--color-surface-elevated)] p-5 space-y-5`,children:[(0,E.jsxs)(`div`,{className:`mb-4 flex flex-wrap items-center justify-between gap-2`,children:[(0,E.jsxs)(`div`,{children:[(0,E.jsx)(`div`,{className:`text-sm font-medium text-[var(--color-text-heading)]`,children:e(`protocolEdit.stepHeading`,{n:n+1})}),(0,E.jsx)(`div`,{className:`text-sm text-[var(--color-text-muted)]`,children:e(`protocolEdit.stepEditorHint`)})]}),(0,E.jsx)(`button`,{type:`button`,onClick:()=>s(n),disabled:r<=1,className:`min-h-[44px] min-w-[44px] inline-flex items-center justify-center rounded-[var(--radius-md)] border border-[var(--color-border)] bg-[var(--color-surface)] px-4 py-2 text-sm font-medium text-[var(--color-text)] hover:bg-[var(--color-surface-elevated)] focus-visible:outline focus-visible:outline-2 focus-visible:outline-[var(--color-focus-ring)] focus-visible:outline-offset-2 disabled:opacity-50`,children:e(`protocolEdit.removeStep`)})]}),(0,E.jsxs)(`div`,{children:[(0,E.jsx)(`label`,{className:`mb-2 block font-medium text-[var(--color-text-heading)]`,children:e(`protocolEdit.stepLabel`)}),(0,E.jsx)(`input`,{type:`text`,value:t.label,onChange:e=>o(n,{label:e.target.value}),className:j})]}),(0,E.jsxs)(`div`,{children:[(0,E.jsx)(`div`,{className:`mb-2 font-medium text-[var(--color-text-heading)]`,children:e(`protocolEdit.challengeType`)}),(0,E.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:w.map(e=>(0,E.jsx)(`button`,{type:`button`,"aria-pressed":t.type===e,onClick:()=>o(n,{type:e,shell:e===`shell`?{cmd:t.shell?.cmd??``,timeout_seconds:t.shell?.timeout_seconds??30,interpreter:t.shell?.interpreter,workdir:t.shell?.workdir,flags:t.shell?.flags??[],args:t.shell?.args??[]}:void 0,forward:e===`forward`?{target:t.forward?.target??``}:void 0,user_input:e===`user_input`?{prompt:t.user_input?.prompt??``}:void 0,comment:e===`comment`?{min_length:t.comment?.min_length??10}:void 0}),className:`min-h-[44px] rounded-[var(--radius-md)] px-4 text-sm font-medium ${t.type===e?`bg-[var(--color-primary)] text-white`:`border border-[var(--color-border)] bg-[var(--color-surface)] text-[var(--color-text)]`}`,children:a[e]},e))})]}),(0,E.jsx)(`div`,{children:(0,E.jsx)(g,{label:e(`protocolEdit.stepContent`),value:t.bodyMarkdown,onChange:e=>o(n,{bodyMarkdown:e}),contentKey:i})}),(0,E.jsxs)(`div`,{className:`rounded-[var(--radius-md)] border border-[var(--color-border)] bg-[var(--color-surface)] p-4`,children:[(0,E.jsx)(`div`,{className:`mb-3 text-sm font-medium text-[var(--color-text-heading)]`,children:`Challenge fields`}),(0,E.jsxs)(`div`,{className:`grid grid-cols-1 gap-3 sm:grid-cols-2`,children:[t.type===`shell`&&(0,E.jsxs)(E.Fragment,{children:[(0,E.jsxs)(`div`,{children:[(0,E.jsx)(`label`,{className:`mb-2 block text-sm font-medium text-[var(--color-text-heading)]`,children:e(`protocolEdit.shellCmd`)}),(0,E.jsx)(`input`,{type:`text`,value:t.shell?.cmd??``,onChange:e=>o(n,{shell:{cmd:e.target.value,timeout_seconds:t.shell?.timeout_seconds??30,interpreter:t.shell?.interpreter,workdir:t.shell?.workdir,flags:t.shell?.flags??[],args:t.shell?.args??[]}}),className:M})]}),(0,E.jsxs)(`div`,{children:[(0,E.jsx)(`label`,{className:`mb-2 block text-sm font-medium text-[var(--color-text-heading)]`,children:e(`protocolEdit.shellTimeout`)}),(0,E.jsx)(`input`,{type:`number`,min:1,value:t.shell?.timeout_seconds??30,onChange:e=>o(n,{shell:{cmd:t.shell?.cmd??``,timeout_seconds:Math.max(1,Number(e.target.value)||30),interpreter:t.shell?.interpreter,workdir:t.shell?.workdir,flags:t.shell?.flags??[],args:t.shell?.args??[]}}),className:M})]}),(0,E.jsxs)(`div`,{children:[(0,E.jsx)(`label`,{className:`mb-2 block text-sm font-medium text-[var(--color-text-heading)]`,children:e(`protocolEdit.shellInterpreter`)}),(0,E.jsxs)(`select`,{required:!0,value:t.shell?.interpreter??``,onChange:e=>o(n,{shell:{cmd:t.shell?.cmd??``,timeout_seconds:t.shell?.timeout_seconds??30,interpreter:e.target.value||void 0,workdir:t.shell?.workdir,flags:t.shell?.flags??[],args:t.shell?.args??[]}}),className:M,children:[(0,E.jsx)(`option`,{value:``,children:e(`protocolEdit.shellInterpreterPlaceholder`)}),A.map(e=>(0,E.jsx)(`option`,{value:e,children:e},e))]}),(0,E.jsx)(`p`,{className:`mt-2 text-xs text-[var(--color-text-muted)]`,children:e(`protocolEdit.shellInterpreterHint`)})]}),(0,E.jsxs)(`div`,{children:[(0,E.jsx)(`label`,{className:`mb-2 block text-sm font-medium text-[var(--color-text-heading)]`,children:e(`protocolEdit.shellWorkdir`)}),(0,E.jsx)(`input`,{type:`text`,value:t.shell?.workdir??``,onChange:e=>o(n,{shell:{cmd:t.shell?.cmd??``,timeout_seconds:t.shell?.timeout_seconds??30,interpreter:t.shell?.interpreter,workdir:e.target.value||void 0,flags:t.shell?.flags??[],args:t.shell?.args??[]}}),className:M})]}),(0,E.jsxs)(`div`,{className:`sm:col-span-2`,children:[(0,E.jsx)(`label`,{className:`mb-2 block text-sm font-medium text-[var(--color-text-heading)]`,children:e(`protocolEdit.shellFlags`)}),(0,E.jsx)(`textarea`,{rows:3,value:(t.shell?.flags??[]).join(`
1
+ import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{i as t,t as n}from"./react-C1iE8mnY.js";import{a as r,f as i,p as a,t as o,v as s}from"./vendor-Bef0enSO.js";import{a as c,i as l,n as u,o as d,r as f,s as p,t as m}from"./export-skill-zip-rkzrXXa3.js";import{t as h}from"./api-BgTb-tmJ.js";import{t as g}from"./RichTextEditor-B6msD7tF.js";import{r as _,t as v}from"./SpaceSelect-BRqyRXZF.js";import{t as y}from"./SurfaceCard-DJ6PVBPM.js";import{t as b}from"./ChallengeCard-BJf8kp0k.js";var x=e(t(),1),S=o().min(1,`Protocol content is required`).refine(e=>e.includes(`# `),`Protocol must have an H1 title`).refine(e=>/(^|\n)##\s+Activation Patterns\b/i.test(e),`Include an "Activation Patterns" section (H2)`).refine(e=>/(^|\n)##\s+Reward Signal\b/i.test(e),`Include a "Reward Signal" section (H2)`),C={label:`Step`,bodyMarkdown:`What the user or agent does in this step.`,type:`comment`,comment:{min_length:10}},w=[`shell`,`forward`,`user_input`,`comment`],T=/^squadrules:\/\/adapter\/[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,E=n();function D({t:e,fileInputRef:t,onUpload:n,isNew:i,decodedUri:a}){return(0,E.jsx)(y,{className:`mb-8`,title:e(`protocolEdit.importCardTitle`),subtitle:e(`protocolEdit.uploadHint`),children:(0,E.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,E.jsx)(`input`,{ref:t,type:`file`,accept:`.md,text/markdown`,onChange:n,className:`sr-only`,id:`protocol-upload`,"aria-label":e(`protocolEdit.upload`)}),(0,E.jsx)(`button`,{type:`button`,onClick:()=>t.current?.click(),className:`min-h-[44px] min-w-[44px] inline-flex items-center justify-center rounded-[var(--radius-md)] border border-[var(--color-border)] bg-[var(--color-surface)] px-4 py-2 text-sm font-medium text-[var(--color-text)] hover:bg-[var(--color-surface-elevated)] focus-visible:outline focus-visible:outline-2 focus-visible:outline-[var(--color-focus-ring)] focus-visible:outline-offset-2`,children:e(`protocolEdit.upload`)}),!i&&a&&(0,E.jsx)(r,{to:`/protocols/${encodeURIComponent(a)}/skill`,className:`min-h-[44px] min-w-[44px] inline-flex items-center justify-center rounded-[var(--radius-md)] border border-[var(--color-border)] bg-[var(--color-surface)] px-4 py-2 text-sm font-medium text-[var(--color-text)] no-underline hover:bg-[var(--color-surface-elevated)] focus-visible:outline focus-visible:outline-2 focus-visible:outline-[var(--color-focus-ring)] focus-visible:outline-offset-2`,children:e(`protocol.editAsSkill`)})]})})}function O({t:e,preview:t,skillFolderSlug:n,isNew:i,decodedUri:a}){let[o,s]=(0,x.useState)(!1),[c,l]=(0,x.useState)(null);return(0,E.jsxs)(`div`,{className:`space-y-4`,"aria-label":e(`protocolEdit.previewLabel`),children:[(0,E.jsxs)(y,{title:e(`protocolEdit.previewRenderedTitle`),subtitle:e(`protocolEdit.previewRenderedSubtitle`),children:[(0,E.jsx)(`div`,{className:`text-lg font-semibold text-[var(--color-text-heading)]`,children:t.title}),(0,E.jsx)(`div`,{className:`mt-3 space-y-3`,children:t.steps.length===0?(0,E.jsx)(`div`,{className:`text-sm text-[var(--color-text-muted)]`,children:e(`protocolEdit.previewNoSteps`)}):t.steps.slice(0,20).map((t,n)=>(0,E.jsxs)(`div`,{className:`rounded-[var(--radius-sm)] border border-[var(--color-border)] bg-[var(--color-surface)] p-3`,children:[(0,E.jsx)(`div`,{className:`font-medium text-[var(--color-text-heading)]`,children:e(`protocolEdit.previewStepLine`,{n:n+1,label:t.label})}),(0,E.jsx)(`div`,{className:`mt-1 text-sm text-[var(--color-text-muted)]`,children:b[t.type]??t.type})]},`${t.label}:${n}`))}),(0,E.jsxs)(`div`,{className:`mt-4 border-t border-[var(--color-border)] pt-4 text-sm text-[var(--color-text-muted)]`,children:[(0,E.jsxs)(`div`,{children:[(0,E.jsxs)(`strong`,{className:`text-[var(--color-text-heading)]`,children:[e(`protocol.triggers`),`:`]}),` `,t.triggers?e(`protocolEdit.present`):e(`protocolEdit.missing`)]}),(0,E.jsxs)(`div`,{className:`mt-1`,children:[(0,E.jsxs)(`strong`,{className:`text-[var(--color-text-heading)]`,children:[e(`protocol.completion`),`:`]}),` `,t.completion?e(`protocolEdit.present`):e(`protocolEdit.missing`)]})]})]}),!i&&a?(0,E.jsxs)(y,{title:e(`protocolEdit.skillShortcutTitle`),subtitle:e(`protocolEdit.skillShortcutSubtitle`),children:[(0,E.jsxs)(`div`,{className:`rounded-[var(--radius-md)] border border-[var(--color-border)] bg-[var(--color-surface)] p-3`,children:[(0,E.jsxs)(`div`,{className:`font-medium text-[var(--color-text-heading)]`,children:[n,`-skill/`]}),(0,E.jsxs)(`div`,{className:`mt-2 font-mono text-sm text-[var(--color-text-muted)]`,children:[`Skill.md`,(0,E.jsx)(`br`,{}),`references/`,(0,E.jsx)(`br`,{}),`\xA0\xA0SQUADRULES.md`]})]}),(0,E.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-2`,children:[(0,E.jsx)(r,{to:`/protocols/${encodeURIComponent(a)}/skill`,className:`min-h-[44px] min-w-[44px] inline-flex items-center justify-center rounded-[var(--radius-md)] border border-[var(--color-border)] bg-[var(--color-surface)] px-4 py-2 text-sm font-medium text-[var(--color-text)] no-underline hover:bg-[var(--color-surface-elevated)] focus-visible:outline focus-visible:outline-2 focus-visible:outline-[var(--color-focus-ring)] focus-visible:outline-offset-2`,children:e(`protocol.editAsSkill`)}),(0,E.jsx)(`button`,{type:`button`,disabled:o,onClick:()=>{(async()=>{if(a){l(null),s(!0);try{let{blob:e,skill_bundle_manifest:t}=await m(a),r=u(t,n);f(e,r)}catch(e){l(e instanceof Error?e.message:String(e))}finally{s(!1)}}})()},className:`min-h-[44px] min-w-[44px] inline-flex items-center justify-center rounded-[var(--radius-md)] bg-[var(--color-primary)] px-4 py-2 text-sm font-medium text-white hover:bg-[var(--color-primary-hover)] focus-visible:outline focus-visible:outline-2 focus-visible:outline-[var(--color-focus-ring)] focus-visible:outline-offset-2 disabled:opacity-60`,children:e(`protocol.downloadAsSkill`)}),c?(0,E.jsx)(`p`,{className:`mt-2 m-0 text-xs text-[var(--color-error)]`,role:`alert`,children:c}):null]})]}):null]})}function k({t:e,isNew:t,spaces:n,spacesLoading:r,targetSpace:i,setTargetSpace:a,forkSourceUri:o,setForkSourceUri:s,moveSpace:c,setMoveSpace:l}){return(0,E.jsx)(`section`,{className:`mb-8 space-y-5 rounded-[var(--radius-md)] border border-[var(--color-border)] bg-[var(--color-surface-elevated)] p-5`,children:t?(0,E.jsxs)(E.Fragment,{children:[(0,E.jsxs)(`div`,{children:[(0,E.jsx)(`label`,{htmlFor:`protocol-target-space`,className:`mb-2 block font-medium text-[var(--color-text-heading)]`,children:e(`protocolEdit.targetSpaceLabel`)}),(0,E.jsx)(v,{id:`protocol-target-space`,spaces:n,value:i,onChange:a,disabled:r}),(0,E.jsx)(`p`,{className:`mt-2 text-sm text-[var(--color-text-muted)]`,children:e(`protocolEdit.targetSpaceHint`)})]}),(0,E.jsxs)(`div`,{children:[(0,E.jsx)(`label`,{htmlFor:`protocol-fork-source`,className:`mb-2 block font-medium text-[var(--color-text-heading)]`,children:e(`protocolEdit.forkSourceLabel`)}),(0,E.jsx)(`input`,{id:`protocol-fork-source`,type:`text`,value:o,onChange:e=>s(e.target.value),placeholder:e(`protocolEdit.forkSourcePlaceholder`),autoComplete:`off`,className:`min-h-[44px] w-full max-w-2xl rounded-[var(--radius-md)] border border-[var(--color-border)] bg-[var(--color-surface)] px-4 py-3 text-sm text-[var(--color-text)] focus-visible:outline focus-visible:outline-2 focus-visible:outline-[var(--color-focus-ring)] focus-visible:outline-offset-2`}),(0,E.jsx)(`p`,{className:`mt-2 text-sm text-[var(--color-text-muted)]`,children:e(`protocolEdit.forkSourceHint`)})]})]}):(0,E.jsxs)(`div`,{children:[(0,E.jsx)(`label`,{htmlFor:`protocol-move-space`,className:`mb-2 block font-medium text-[var(--color-text-heading)]`,children:e(`protocolEdit.moveSpaceLabel`)}),(0,E.jsx)(v,{id:`protocol-move-space`,spaces:n,value:c,onChange:l,disabled:r}),(0,E.jsx)(`p`,{className:`mt-2 text-sm text-[var(--color-text-muted)]`,children:e(`protocolEdit.moveSpaceHint`)})]})})}var A=[`bash`,`sh`,`python3`,`python`,`node`],j=`min-h-[44px] w-full rounded-[var(--radius-md)] border border-[var(--color-border)] bg-[var(--color-surface)] px-4 py-3 text-sm text-[var(--color-text)] focus-visible:outline focus-visible:outline-2 focus-visible:outline-[var(--color-focus-ring)] focus-visible:outline-offset-2`,M=`min-h-[44px] w-full rounded-[var(--radius-md)] border border-[var(--color-border)] bg-[var(--color-surface-elevated)] px-4 py-3 text-sm text-[var(--color-text)] focus-visible:outline focus-visible:outline-2 focus-visible:outline-[var(--color-focus-ring)] focus-visible:outline-offset-2`;function N({t:e,step:t,index:n,stepsLength:r,uploadKey:i,challengeTypeLabel:a,setStep:o,removeStep:s}){return(0,E.jsxs)(`div`,{className:`rounded-[var(--radius-md)] border border-[var(--color-border)] bg-[var(--color-surface-elevated)] p-5 space-y-5`,children:[(0,E.jsxs)(`div`,{className:`mb-4 flex flex-wrap items-center justify-between gap-2`,children:[(0,E.jsxs)(`div`,{children:[(0,E.jsx)(`div`,{className:`text-sm font-medium text-[var(--color-text-heading)]`,children:e(`protocolEdit.stepHeading`,{n:n+1})}),(0,E.jsx)(`div`,{className:`text-sm text-[var(--color-text-muted)]`,children:e(`protocolEdit.stepEditorHint`)})]}),(0,E.jsx)(`button`,{type:`button`,onClick:()=>s(n),disabled:r<=1,className:`min-h-[44px] min-w-[44px] inline-flex items-center justify-center rounded-[var(--radius-md)] border border-[var(--color-border)] bg-[var(--color-surface)] px-4 py-2 text-sm font-medium text-[var(--color-text)] hover:bg-[var(--color-surface-elevated)] focus-visible:outline focus-visible:outline-2 focus-visible:outline-[var(--color-focus-ring)] focus-visible:outline-offset-2 disabled:opacity-50`,children:e(`protocolEdit.removeStep`)})]}),(0,E.jsxs)(`div`,{children:[(0,E.jsx)(`label`,{className:`mb-2 block font-medium text-[var(--color-text-heading)]`,children:e(`protocolEdit.stepLabel`)}),(0,E.jsx)(`input`,{type:`text`,value:t.label,onChange:e=>o(n,{label:e.target.value}),className:j})]}),(0,E.jsxs)(`div`,{children:[(0,E.jsx)(`div`,{className:`mb-2 font-medium text-[var(--color-text-heading)]`,children:e(`protocolEdit.challengeType`)}),(0,E.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:w.map(e=>(0,E.jsx)(`button`,{type:`button`,"aria-pressed":t.type===e,onClick:()=>o(n,{type:e,shell:e===`shell`?{cmd:t.shell?.cmd??``,timeout_seconds:t.shell?.timeout_seconds??30,interpreter:t.shell?.interpreter,workdir:t.shell?.workdir,flags:t.shell?.flags??[],args:t.shell?.args??[]}:void 0,forward:e===`forward`?{target:t.forward?.target??``}:void 0,user_input:e===`user_input`?{prompt:t.user_input?.prompt??``}:void 0,comment:e===`comment`?{min_length:t.comment?.min_length??10}:void 0}),className:`min-h-[44px] rounded-[var(--radius-md)] px-4 text-sm font-medium ${t.type===e?`bg-[var(--color-primary)] text-white`:`border border-[var(--color-border)] bg-[var(--color-surface)] text-[var(--color-text)]`}`,children:a[e]},e))})]}),(0,E.jsx)(`div`,{children:(0,E.jsx)(g,{label:e(`protocolEdit.stepContent`),value:t.bodyMarkdown,onChange:e=>o(n,{bodyMarkdown:e}),contentKey:i})}),(0,E.jsxs)(`div`,{className:`rounded-[var(--radius-md)] border border-[var(--color-border)] bg-[var(--color-surface)] p-4`,children:[(0,E.jsx)(`div`,{className:`mb-3 text-sm font-medium text-[var(--color-text-heading)]`,children:`Challenge fields`}),(0,E.jsxs)(`div`,{className:`grid grid-cols-1 gap-3 sm:grid-cols-2`,children:[t.type===`shell`&&(0,E.jsxs)(E.Fragment,{children:[(0,E.jsxs)(`div`,{children:[(0,E.jsx)(`label`,{className:`mb-2 block text-sm font-medium text-[var(--color-text-heading)]`,children:e(`protocolEdit.shellCmd`)}),(0,E.jsx)(`input`,{type:`text`,value:t.shell?.cmd??``,onChange:e=>o(n,{shell:{cmd:e.target.value,timeout_seconds:t.shell?.timeout_seconds??30,interpreter:t.shell?.interpreter,workdir:t.shell?.workdir,flags:t.shell?.flags??[],args:t.shell?.args??[]}}),className:M})]}),(0,E.jsxs)(`div`,{children:[(0,E.jsx)(`label`,{className:`mb-2 block text-sm font-medium text-[var(--color-text-heading)]`,children:e(`protocolEdit.shellTimeout`)}),(0,E.jsx)(`input`,{type:`number`,min:1,value:t.shell?.timeout_seconds??30,onChange:e=>o(n,{shell:{cmd:t.shell?.cmd??``,timeout_seconds:Math.max(1,Number(e.target.value)||30),interpreter:t.shell?.interpreter,workdir:t.shell?.workdir,flags:t.shell?.flags??[],args:t.shell?.args??[]}}),className:M})]}),(0,E.jsxs)(`div`,{children:[(0,E.jsx)(`label`,{className:`mb-2 block text-sm font-medium text-[var(--color-text-heading)]`,children:e(`protocolEdit.shellInterpreter`)}),(0,E.jsxs)(`select`,{required:!0,value:t.shell?.interpreter??``,onChange:e=>o(n,{shell:{cmd:t.shell?.cmd??``,timeout_seconds:t.shell?.timeout_seconds??30,interpreter:e.target.value||void 0,workdir:t.shell?.workdir,flags:t.shell?.flags??[],args:t.shell?.args??[]}}),className:M,children:[(0,E.jsx)(`option`,{value:``,children:e(`protocolEdit.shellInterpreterPlaceholder`)}),A.map(e=>(0,E.jsx)(`option`,{value:e,children:e},e))]}),(0,E.jsx)(`p`,{className:`mt-2 text-xs text-[var(--color-text-muted)]`,children:e(`protocolEdit.shellInterpreterHint`)})]}),(0,E.jsxs)(`div`,{children:[(0,E.jsx)(`label`,{className:`mb-2 block text-sm font-medium text-[var(--color-text-heading)]`,children:e(`protocolEdit.shellWorkdir`)}),(0,E.jsx)(`input`,{type:`text`,value:t.shell?.workdir??``,onChange:e=>o(n,{shell:{cmd:t.shell?.cmd??``,timeout_seconds:t.shell?.timeout_seconds??30,interpreter:t.shell?.interpreter,workdir:e.target.value||void 0,flags:t.shell?.flags??[],args:t.shell?.args??[]}}),className:M})]}),(0,E.jsxs)(`div`,{className:`sm:col-span-2`,children:[(0,E.jsx)(`label`,{className:`mb-2 block text-sm font-medium text-[var(--color-text-heading)]`,children:e(`protocolEdit.shellFlags`)}),(0,E.jsx)(`textarea`,{rows:3,value:(t.shell?.flags??[]).join(`
2
2
  `),onChange:e=>o(n,{shell:{cmd:t.shell?.cmd??``,timeout_seconds:t.shell?.timeout_seconds??30,interpreter:t.shell?.interpreter,workdir:t.shell?.workdir,flags:e.target.value.split(`
3
3
  `).map(e=>e.trim()).filter(Boolean),args:t.shell?.args??[]}}),className:`w-full rounded-[var(--radius-md)] border border-[var(--color-border)] bg-[var(--color-surface-elevated)] px-4 py-3 text-sm text-[var(--color-text)] focus-visible:outline focus-visible:outline-2 focus-visible:outline-[var(--color-focus-ring)] focus-visible:outline-offset-2`})]}),(0,E.jsxs)(`div`,{className:`sm:col-span-2`,children:[(0,E.jsx)(`label`,{className:`mb-2 block text-sm font-medium text-[var(--color-text-heading)]`,children:e(`protocolEdit.shellArgs`)}),(0,E.jsx)(`textarea`,{rows:3,value:(t.shell?.args??[]).join(`
4
4
  `),onChange:e=>o(n,{shell:{cmd:t.shell?.cmd??``,timeout_seconds:t.shell?.timeout_seconds??30,interpreter:t.shell?.interpreter,workdir:t.shell?.workdir,flags:t.shell?.flags??[],args:e.target.value.split(`