gsd-pi 2.70.1-dev.3591dcf → 2.70.1-dev.3e19108

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 (86) hide show
  1. package/dist/resources/extensions/claude-code-cli/stream-adapter.js +2 -0
  2. package/dist/resources/extensions/gsd/auto-start.js +3 -11
  3. package/dist/resources/extensions/gsd/bootstrap/register-hooks.js +4 -0
  4. package/dist/resources/extensions/gsd/guided-flow.js +12 -10
  5. package/dist/resources/extensions/gsd/init-wizard.js +3 -11
  6. package/dist/resources/extensions/gsd/prompts/discuss.md +31 -13
  7. package/dist/resources/extensions/gsd/tools/workflow-tool-executors.js +34 -0
  8. package/dist/resources/extensions/gsd/workflow-mcp-auto-prep.js +56 -0
  9. package/dist/resources/extensions/gsd/workflow-mcp.js +1 -1
  10. package/dist/web/standalone/.next/BUILD_ID +1 -1
  11. package/dist/web/standalone/.next/app-path-routes-manifest.json +17 -17
  12. package/dist/web/standalone/.next/build-manifest.json +3 -3
  13. package/dist/web/standalone/.next/prerender-manifest.json +3 -3
  14. package/dist/web/standalone/.next/react-loadable-manifest.json +1 -1
  15. package/dist/web/standalone/.next/required-server-files.json +1 -1
  16. package/dist/web/standalone/.next/server/app/_global-error.html +1 -1
  17. package/dist/web/standalone/.next/server/app/_global-error.rsc +1 -1
  18. package/dist/web/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  19. package/dist/web/standalone/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  20. package/dist/web/standalone/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  21. package/dist/web/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  22. package/dist/web/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  23. package/dist/web/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  24. package/dist/web/standalone/.next/server/app/_not-found.html +1 -1
  25. package/dist/web/standalone/.next/server/app/_not-found.rsc +1 -1
  26. package/dist/web/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +1 -1
  27. package/dist/web/standalone/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  28. package/dist/web/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +1 -1
  29. package/dist/web/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  30. package/dist/web/standalone/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  31. package/dist/web/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  32. package/dist/web/standalone/.next/server/app/index.html +1 -1
  33. package/dist/web/standalone/.next/server/app/index.rsc +1 -1
  34. package/dist/web/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +1 -1
  35. package/dist/web/standalone/.next/server/app/index.segments/_full.segment.rsc +1 -1
  36. package/dist/web/standalone/.next/server/app/index.segments/_head.segment.rsc +1 -1
  37. package/dist/web/standalone/.next/server/app/index.segments/_index.segment.rsc +1 -1
  38. package/dist/web/standalone/.next/server/app/index.segments/_tree.segment.rsc +1 -1
  39. package/dist/web/standalone/.next/server/app-paths-manifest.json +17 -17
  40. package/dist/web/standalone/.next/server/middleware-build-manifest.js +1 -1
  41. package/dist/web/standalone/.next/server/middleware-react-loadable-manifest.js +1 -1
  42. package/dist/web/standalone/.next/server/pages/404.html +1 -1
  43. package/dist/web/standalone/.next/server/pages/500.html +1 -1
  44. package/dist/web/standalone/.next/server/server-reference-manifest.json +1 -1
  45. package/dist/web/standalone/.next/static/chunks/2826.dd3dc8bbd3025fa5.js +9 -0
  46. package/dist/web/standalone/.next/static/chunks/{webpack-6e4d7e9a4f57bed4.js → webpack-b868033a5834586d.js} +1 -1
  47. package/dist/web/standalone/server.js +1 -1
  48. package/package.json +1 -1
  49. package/packages/mcp-server/dist/env-writer.d.ts +39 -0
  50. package/packages/mcp-server/dist/env-writer.d.ts.map +1 -0
  51. package/packages/mcp-server/dist/env-writer.js +158 -0
  52. package/packages/mcp-server/dist/env-writer.js.map +1 -0
  53. package/packages/mcp-server/dist/server.d.ts +11 -2
  54. package/packages/mcp-server/dist/server.d.ts.map +1 -1
  55. package/packages/mcp-server/dist/server.js +102 -2
  56. package/packages/mcp-server/dist/server.js.map +1 -1
  57. package/packages/mcp-server/src/env-writer.test.ts +280 -0
  58. package/packages/mcp-server/src/env-writer.ts +183 -0
  59. package/packages/mcp-server/src/secure-env-collect.test.ts +265 -0
  60. package/packages/mcp-server/src/server.ts +137 -3
  61. package/packages/pi-coding-agent/dist/core/chat-controller-ordering.test.d.ts +2 -0
  62. package/packages/pi-coding-agent/dist/core/chat-controller-ordering.test.d.ts.map +1 -0
  63. package/packages/pi-coding-agent/dist/core/chat-controller-ordering.test.js +133 -0
  64. package/packages/pi-coding-agent/dist/core/chat-controller-ordering.test.js.map +1 -0
  65. package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.d.ts.map +1 -1
  66. package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.js +58 -21
  67. package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.js.map +1 -1
  68. package/packages/pi-coding-agent/src/core/chat-controller-ordering.test.ts +152 -0
  69. package/packages/pi-coding-agent/src/modes/interactive/controllers/chat-controller.ts +83 -27
  70. package/src/resources/extensions/claude-code-cli/stream-adapter.ts +2 -0
  71. package/src/resources/extensions/claude-code-cli/tests/stream-adapter.test.ts +33 -0
  72. package/src/resources/extensions/gsd/auto-start.ts +3 -13
  73. package/src/resources/extensions/gsd/bootstrap/register-hooks.ts +4 -0
  74. package/src/resources/extensions/gsd/guided-flow.ts +12 -9
  75. package/src/resources/extensions/gsd/init-wizard.ts +3 -13
  76. package/src/resources/extensions/gsd/prompts/discuss.md +31 -13
  77. package/src/resources/extensions/gsd/tests/discuss-incremental-persistence.test.ts +9 -0
  78. package/src/resources/extensions/gsd/tests/workflow-mcp-auto-prep.test.ts +76 -0
  79. package/src/resources/extensions/gsd/tests/workflow-mcp.test.ts +155 -1
  80. package/src/resources/extensions/gsd/tests/workflow-tool-executors.test.ts +22 -0
  81. package/src/resources/extensions/gsd/tools/workflow-tool-executors.ts +60 -25
  82. package/src/resources/extensions/gsd/workflow-mcp-auto-prep.ts +76 -0
  83. package/src/resources/extensions/gsd/workflow-mcp.ts +1 -1
  84. package/dist/web/standalone/.next/static/chunks/2826.821e01b07d92e948.js +0 -9
  85. /package/dist/web/standalone/.next/static/{KdlODhIktLmeRKpLpHdKb → cHCEWiRJM5bXJa9HkP1QU}/_buildManifest.js +0 -0
  86. /package/dist/web/standalone/.next/static/{KdlODhIktLmeRKpLpHdKb → cHCEWiRJM5bXJa9HkP1QU}/_ssgManifest.js +0 -0
@@ -1 +1 @@
1
- (()=>{"use strict";var e,a,c,f,d,b,t,r,o,n={},i={};function l(e){var a=i[e];if(void 0!==a)return a.exports;var c=i[e]={exports:{}},f=!0;try{n[e].call(c.exports,c,c.exports,l),f=!1}finally{f&&delete i[e]}return c.exports}l.m=n,e=[],l.O=(a,c,f,d)=>{if(c){d=d||0;for(var b=e.length;b>0&&e[b-1][2]>d;b--)e[b]=e[b-1];e[b]=[c,f,d];return}for(var t=1/0,b=0;b<e.length;b++){for(var[c,f,d]=e[b],r=!0,o=0;o<c.length;o++)(!1&d||t>=d)&&Object.keys(l.O).every(e=>l.O[e](c[o]))?c.splice(o--,1):(r=!1,d<t&&(t=d));if(r){e.splice(b--,1);var n=f();void 0!==n&&(a=n)}}return a},l.n=e=>{var a=e&&e.__esModule?()=>e.default:()=>e;return l.d(a,{a:a}),a},c=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,l.t=function(e,f){if(1&f&&(e=this(e)),8&f||"object"==typeof e&&e&&(4&f&&e.__esModule||16&f&&"function"==typeof e.then))return e;var d=Object.create(null);l.r(d);var b={};a=a||[null,c({}),c([]),c(c)];for(var t=2&f&&e;"object"==typeof t&&!~a.indexOf(t);t=c(t))Object.getOwnPropertyNames(t).forEach(a=>b[a]=()=>e[a]);return b.default=()=>e,l.d(d,b),d},l.d=(e,a)=>{for(var c in a)l.o(a,c)&&!l.o(e,c)&&Object.defineProperty(e,c,{enumerable:!0,get:a[c]})},l.f={},l.e=e=>Promise.all(Object.keys(l.f).reduce((a,c)=>(l.f[c](e,a),a),[])),l.u=e=>4986===e?"static/chunks/4986-c2fc8845ce785303.js":"static/chunks/"+(({535:"4ca0cff5",1290:"cee15710",1630:"53c1bd3f",2577:"d1c28714",3879:"cfdf2ac7",3888:"e868780c",4763:"4402d2ac",4814:"799ebd4e",6079:"363642f4",6666:"570e4624",6814:"7d29de82",7442:"92e53eb0",8835:"ce16f5a9",9312:"1cd6e1d3"})[e]||e)+"."+({10:"6cf001c181ce1098",34:"ce581867cf95e24b",36:"b4a553bf2106f6d3",194:"76dbdc07cdc2311d",214:"f6bba63dfa159e01",252:"a9e22657cbf67b42",327:"8ecab0b86d52b597",376:"9e742ff6919b2b54",392:"3cad93691f1b7360",400:"59979e0d3ae126e4",425:"9a3434a28926566a",535:"07efe2bc8f09d72e",541:"cfa15b606745131a",579:"33fc87fb95163c6a",583:"b3efc73cb21097e2",624:"2dd909fbfce98c5e",640:"5bf1e25d0bddf875",698:"e0dda03fd303b96b",794:"06b1ae4fc9cc10a9",816:"f909c891b91aa79f",830:"e49b226c07876df4",840:"a9c535f8868cc4bd",862:"fe3b86ecfb9c0716",893:"c469257bbbbca4f5",966:"57e4cd93c2368d34",968:"237f19aca13543fe",1078:"02294b2934d5bf21",1142:"8248bfb76c695146",1161:"06b33878b495da50",1184:"e80a999422621ed9",1188:"1d4ce94ddc297119",1198:"2a5c215f01a8b74d",1215:"88ed89521e915107",1219:"e27b0bd10b029e40",1247:"64e212daa5bb3925",1248:"36af3903f037c1f5",1274:"ce6906b1fe2e04b8",1280:"1651bb5167170457",1290:"869cef5f741d40c2",1335:"716cc5924662708e",1365:"d7391145ca7f8791",1379:"03e1e0f31bdaa2cc",1410:"77acea37535dbbef",1413:"117c5958c59cc695",1453:"3c24c777a3deca2d",1456:"217c3832b3e76b7f",1501:"549af2c91a889a08",1534:"918a25b2e3daab22",1556:"96abc9ff91b0c383",1583:"03a06dbdde85ac56",1595:"ee61519fde230f60",1630:"2911e2bac119d910",1642:"8c00543baa1aef54",1656:"a9efc78185a5a85f",1664:"6d5b5e3112b66906",1898:"e07b2b1c5e789b06",1932:"b0aea9b52cabe5e8",1977:"a06c8e8d2198f765",2008:"71ee9230ad78df21",2013:"598558c40e51e107",2031:"3877441c49bff5cd",2041:"00f4fa0ab26c6ba5",2062:"4a0ab3400fea0e34",2107:"c627112b02b9e1c8",2130:"441ae0f68863efeb",2160:"e38d781fd5c4cde0",2179:"1bf5fe315e6e132c",2215:"9d2d6fbe90ffcc80",2278:"0b14de1cb2041bfd",2349:"ca15d465c4260b4b",2374:"7560cc5c4b8ed6b0",2397:"0e4dce0a557ac7cf",2403:"3dda71b6482dce3b",2485:"3188870375e9fbee",2489:"fcc70bd67329a70e",2501:"4e65b56602faa956",2503:"bb9d3528c3c7ccae",2504:"159b28843e61aae9",2577:"f52cffdd449a2d14",2614:"8349e4b407470a30",2710:"fe0656d4ebae4d30",2728:"5fed9ac13dfcd1d1",2735:"5a3e65a580bd5af9",2747:"1d85d388314f2904",2765:"2c6d9772af50feed",2783:"e8bbf2c794ef9750",2812:"dcd8179a6b1d76c9",2826:"821e01b07d92e948",2839:"c9a657d5b4031a19",2895:"0339e755e79ee794",2937:"7e724516d5e6ce42",2954:"7d8daeae6410d4a4",2957:"2dd93db1a16e96b0",2964:"1a0e15f7327680a2",3072:"b6da96c10080c967",3074:"911584369786c26c",3077:"bf82c0c332cc9fec",3082:"159e4ab8f0572597",3095:"8cd478c42cee505a",3111:"1cf85db2faeb20cc",3175:"538ce7aec634bddb",3186:"3665756f8aae3eb7",3194:"5a331fb5e3dc34e9",3229:"5e91f7d0b135266b",3274:"858f7f9216c8b074",3286:"196c508356bb0b66",3288:"f23c8a5183e6b910",3290:"b5ba2646ad49c9fd",3304:"16305e84f4ff6598",3313:"471138e5504646a9",3324:"85e21e3313d0901c",3392:"460f5a753531f501",3419:"78b520dab7e2f96d",3437:"0ad1ecc8c5b8a679",3476:"246c30b47bded3b7",3483:"fc2a0b1185dbaa5d",3492:"ca55498822ad7796",3526:"24826331ab265b39",3606:"e5c833cdda239583",3633:"2526b2d018636ff0",3782:"8d7b66d0e37dbe76",3787:"78ebe68a043f50ce",3860:"be5b243bf7d6618c",3873:"72a9a21509f713f7",3879:"f50abf4e93e943ea",3888:"abc48b70a10fc2d6",3942:"085da8d58242eeab",3979:"cea8623f6e9f83ea",4053:"90d71fcbe4ffd852",4080:"08a21dae9e93c547",4163:"c6ebefdd9aa5c358",4174:"b6ff75dd91a2a32e",4223:"c10556cd92fc8018",4242:"3a66c58375424a5b",4275:"8f2e531757c2a813",4295:"6c0f4838b0c9c69d",4309:"a887a10e84c44f9e",4350:"b9d80827e8eee01a",4357:"ac4f251cdac34fbe",4358:"f89b14cf7a988731",4370:"ac13b62c811f7ede",4417:"0b5ee948c3518db3",4447:"5bad7871be61ca73",4474:"053807fa34066566",4539:"559c223da16b0282",4540:"03df20c499bca840",4553:"ce3eab65a260353e",4567:"7dc81a6e1c7df565",4583:"2a5df6eb3a6ea30b",4593:"676ac488744e1af5",4608:"1ff246d6b4c771f8",4634:"0332a56fdb8e26c0",4650:"61aec912b756287b",4659:"0b14de1cb2041bfd",4678:"867dfae26694be02",4763:"d0d1b1777a45e0b2",4801:"17596dbc1818c262",4814:"ccb85c56e9216a38",4823:"907850963b2bcb70",4829:"402ec60139d36417",4846:"c563765de65a34c7",4900:"b723a916eafdf743",4903:"004f583a12223dac",4963:"0f6678151a159143",4969:"1cb10af9489ea295",4976:"8870319ffbd1c31f",5005:"73745d7fcae6989e",5025:"b597364f0cf8b85a",5061:"025d30c3123eeaf6",5136:"ac897c2a56ee392f",5183:"2e5c895a2be76262",5269:"2e771096652dc113",5320:"00f00028b9163a43",5326:"adc4bf49a22f4e67",5331:"4d5d42e5253dbee2",5347:"3192e0021174aaa8",5375:"ebc026e6140b52f1",5424:"4d62f7ee887cd8b9",5482:"0907421e6bf5eeec",5491:"5cc285c4b84dac30",5498:"117ef4b6035a90c5",5518:"6c3dc9afe81a566b",5520:"eab85d7487e77510",5553:"75df19e3cc1246d6",5575:"3d90c643343a1329",5645:"0b86853ae26d9ee3",5670:"2a1b27a6fdb7aa6b",5690:"d30877807cf5c7eb",5712:"574fca2d5f06483a",5728:"8ef773d61765855e",5750:"aa57d25b74640d23",5755:"00015c284ed6fb39",5920:"9db223329ee9e11a",5922:"ce56021f8cc6ebbc",5937:"0827b5b3eb831ff0",5968:"63d5869783fad06f",5997:"226c07d9e6c496e0",6046:"00d36aea7fd5b147",6079:"cf8b455e0d94b478",6089:"2dd351186ec85cc3",6099:"43e6595fcf24fc33",6110:"5ce3f75fced27aaf",6144:"f967a8228bcdf663",6155:"19719cff570d6559",6166:"ecd82a9dcb484b97",6290:"e14cf4fc52dd4539",6293:"5914fa73a9f7e777",6311:"5b9c1f74df9a8f67",6331:"758f2f66b92cada9",6339:"bc9301cc22898be0",6360:"ff0a9063773daeeb",6402:"a0070d7688ed986b",6412:"089ee787a294d10b",6455:"12b78a2660d609eb",6563:"5d618b608750f4dc",6572:"ca2463823b9b01a0",6580:"75d53830b434451f",6588:"0fbca957af7d9e6a",6647:"584c5d5cd8dfdb5a",6666:"a82467c542429379",6686:"796c782c33ab8ca9",6701:"bff0efb979f71a17",6704:"f280f0ad0f5d8644",6729:"77a5381ac8f5c9ae",6741:"06fdaf122961074e",6814:"30ff86a90cbfd921",6846:"91283f709c40802c",6859:"bacad166ee995fe0",6887:"6c81234d73740fb9",6927:"aa3914b5fb0d14d4",6931:"3c90e9fe0f7f1e66",6938:"0ccf683bd8aa8410",6948:"2719ed8731963209",6959:"5a803faf27f88e9f",7021:"b71240b1d5f6fbe4",7040:"0b14de1cb2041bfd",7041:"174bf29bd837f06d",7082:"fc816f91214026d7",7113:"39704408fef3d26e",7130:"8d24694735826c22",7142:"dbd2cf8141eece5e",7152:"c7b7f1f5e9622f21",7227:"a6b2f01487bb3d9d",7258:"6cbe24c3bcb63d1d",7425:"8b47c8e398a12dd8",7442:"097194be4a0e7d55",7455:"71d54397710b923c",7465:"867e8ff655666413",7524:"9528295a19a5837a",7525:"f433aaf1fe40c90a",7557:"bdc743175125b3d8",7610:"b1439345dbcf285d",7625:"ab66bd50d2fb61a4",7635:"166d83de1d29e758",7636:"bf91320a9ff695af",7785:"1402a4110c300764",7799:"40b047a634f96a24",7819:"3c56f48c0dc5ad5d",7844:"2bb29faa262f313e",7846:"c9705c044ab8f87a",7884:"390ae2efbbf230c4",7889:"af3e581842f34c28",7921:"c361f794cc208e06",7977:"80e4daa080a79c39",8113:"907baefc7227cfb8",8132:"74491162f08af899",8192:"5918d83ac6a0e2dc",8243:"1450514f8390977e",8257:"dd8f651f1a43fee2",8288:"9bd1d26060cb00a1",8318:"81c7ac586fcbb728",8406:"955ccfbb4b70b8c3",8430:"b1f802dcffa41626",8432:"bd66ac287c569996",8457:"b61d96d8d30215fc",8496:"046efd6301dd804f",8545:"be0c9eea6aae5971",8555:"ab3ee6358f1d64da",8656:"2ceb4e5ff5df2fca",8670:"90ede75068758e82",8704:"a1003918da6654da",8773:"614f1f4f0f845c5e",8835:"5c7821b201f35593",8848:"7c6e47cca9f0059a",8921:"fb24a4d4d4d3265b",8947:"31d3d834d8281fd9",8977:"01b9c429327004e9",9005:"33cf91e617920d4f",9006:"11537833945ec4b8",9015:"c4e40321a6503a1b",9136:"191be42a2fee842c",9178:"48a90097ee3f0b0c",9186:"3af6fcd13ab752fa",9189:"3e9d29bf275ec462",9220:"bc767ebb5adb9f49",9224:"401f9320ee58570b",9240:"d38ddbe94e0bf128",9267:"fbfd65ea31e7448c",9294:"a20485f3282321b3",9302:"726b065f2df0323a",9312:"8121a74b2042bff3",9377:"f9db706e76f04afe",9382:"bc0e11ecc88dd62c",9421:"a5c1dbcfbfdd8f52",9448:"2668b3cd408e86de",9466:"c9d8f45d14235087",9521:"e1240eb862eb32dc",9547:"7729788fff21926f",9565:"8de0671f99d12abe",9569:"2f36b2b1c2f838d7",9605:"dfac539f89cea7a2",9615:"3b62c13af671f714",9648:"8235b6fea7087b3a",9666:"a515fa6d89a71f1c",9680:"d5ceac8967e0b6a8",9690:"7773c72f0eff6dec",9841:"422321143547591a",9842:"3b71b65b30d8ef2a",9996:"18b7bca2f0ab222e"})[e]+".js",l.miniCssF=e=>"static/css/659eccb5db697b76.css",l.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),l.o=(e,a)=>Object.prototype.hasOwnProperty.call(e,a),f={},l.l=(e,a,c,d)=>{if(f[e])return void f[e].push(a);if(void 0!==c)for(var b,t,r=document.getElementsByTagName("script"),o=0;o<r.length;o++){var n=r[o];if(n.getAttribute("src")==e||n.getAttribute("data-webpack")=="_N_E:"+c){b=n;break}}b||(t=!0,(b=document.createElement("script")).charset="utf-8",b.timeout=120,l.nc&&b.setAttribute("nonce",l.nc),b.setAttribute("data-webpack","_N_E:"+c),b.src=l.tu(e)),f[e]=[a];var i=(a,c)=>{b.onerror=b.onload=null,clearTimeout(s);var d=f[e];if(delete f[e],b.parentNode&&b.parentNode.removeChild(b),d&&d.forEach(e=>e(c)),a)return a(c)},s=setTimeout(i.bind(null,void 0,{type:"timeout",target:b}),12e4);b.onerror=i.bind(null,b.onerror),b.onload=i.bind(null,b.onload),t&&document.head.appendChild(b)},l.r=e=>{"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},l.tt=()=>(void 0===d&&(d={createScriptURL:e=>e},"u">typeof trustedTypes&&trustedTypes.createPolicy&&(d=trustedTypes.createPolicy("nextjs#bundler",d))),d),l.tu=e=>l.tt().createScriptURL(e),l.p="/_next/",b={8068:0},l.f.miniCss=(e,a)=>{if(b[e])a.push(b[e]);else 0!==b[e]&&({1838:1})[e]&&a.push(b[e]=new Promise((a,c)=>{var f=l.miniCssF(e),d=l.p+f;if(((e,a)=>{for(var c=document.getElementsByTagName("link"),f=0;f<c.length;f++){var d=c[f],b=d.getAttribute("data-href")||d.getAttribute("href");if("stylesheet"===d.rel&&(b===e||b===a))return d}for(var t=document.getElementsByTagName("style"),f=0;f<t.length;f++){var d=t[f],b=d.getAttribute("data-href");if(b===e||b===a)return d}})(f,d))return a();((e,a,c,f)=>{var d=document.createElement("link");d.rel="stylesheet",d.type="text/css",d.onerror=d.onload=b=>{if(d.onerror=d.onload=null,"load"===b.type)c();else{var t=b&&("load"===b.type?"missing":b.type),r=b&&b.target&&b.target.href||a,o=Error("Loading CSS chunk "+e+" failed.\n("+r+")");o.code="CSS_CHUNK_LOAD_FAILED",o.type=t,o.request=r,d.parentNode.removeChild(d),f(o)}},d.href=a;if("function"==typeof _N_E_STYLE_LOAD){var b=d.href,t=d.onload,r=d.onerror;_N_E_STYLE_LOAD(0===b.indexOf(window.location.origin)?new URL(b).pathname:b).then(function(){t&&t.call(d,{type:"load"})},function(){r&&r.call(d,{})})}else document.head.appendChild(d)})(e,d,a,c)}).then(()=>{b[e]=0},a=>{throw delete b[e],a}))},t={8068:0,2557:0,7513:0},l.f.j=(e,a)=>{var c=l.o(t,e)?t[e]:void 0;if(0!==c)if(c)a.push(c[2]);else if(/^(1838|2557|7513|8068)$/.test(e))t[e]=0;else{var f=new Promise((a,f)=>c=t[e]=[a,f]);a.push(c[2]=f);var d=l.p+l.u(e),b=Error();l.l(d,a=>{if(l.o(t,e)&&(0!==(c=t[e])&&(t[e]=void 0),c)){var f=a&&("load"===a.type?"missing":a.type),d=a&&a.target&&a.target.src;b.message="Loading chunk "+e+" failed.\n("+f+": "+d+")",b.name="ChunkLoadError",b.type=f,b.request=d,c[1](b)}},"chunk-"+e,e)}},l.O.j=e=>0===t[e],r=(e,a)=>{var c,f,[d,b,r]=a,o=0;if(d.some(e=>0!==t[e])){for(c in b)l.o(b,c)&&(l.m[c]=b[c]);if(r)var n=r(l)}for(e&&e(a);o<d.length;o++)f=d[o],l.o(t,f)&&t[f]&&t[f][0](),t[f]=0;return l.O(n)},(o=self.webpackChunk_N_E=self.webpackChunk_N_E||[]).forEach(r.bind(null,0)),o.push=r.bind(null,o.push.bind(o)),l.nc=void 0})();
1
+ (()=>{"use strict";var e,a,f,c,d,b,t,r,o,n={},i={};function l(e){var a=i[e];if(void 0!==a)return a.exports;var f=i[e]={exports:{}},c=!0;try{n[e].call(f.exports,f,f.exports,l),c=!1}finally{c&&delete i[e]}return f.exports}l.m=n,e=[],l.O=(a,f,c,d)=>{if(f){d=d||0;for(var b=e.length;b>0&&e[b-1][2]>d;b--)e[b]=e[b-1];e[b]=[f,c,d];return}for(var t=1/0,b=0;b<e.length;b++){for(var[f,c,d]=e[b],r=!0,o=0;o<f.length;o++)(!1&d||t>=d)&&Object.keys(l.O).every(e=>l.O[e](f[o]))?f.splice(o--,1):(r=!1,d<t&&(t=d));if(r){e.splice(b--,1);var n=c();void 0!==n&&(a=n)}}return a},l.n=e=>{var a=e&&e.__esModule?()=>e.default:()=>e;return l.d(a,{a:a}),a},f=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,l.t=function(e,c){if(1&c&&(e=this(e)),8&c||"object"==typeof e&&e&&(4&c&&e.__esModule||16&c&&"function"==typeof e.then))return e;var d=Object.create(null);l.r(d);var b={};a=a||[null,f({}),f([]),f(f)];for(var t=2&c&&e;"object"==typeof t&&!~a.indexOf(t);t=f(t))Object.getOwnPropertyNames(t).forEach(a=>b[a]=()=>e[a]);return b.default=()=>e,l.d(d,b),d},l.d=(e,a)=>{for(var f in a)l.o(a,f)&&!l.o(e,f)&&Object.defineProperty(e,f,{enumerable:!0,get:a[f]})},l.f={},l.e=e=>Promise.all(Object.keys(l.f).reduce((a,f)=>(l.f[f](e,a),a),[])),l.u=e=>4986===e?"static/chunks/4986-c2fc8845ce785303.js":"static/chunks/"+(({535:"4ca0cff5",1290:"cee15710",1630:"53c1bd3f",2577:"d1c28714",3879:"cfdf2ac7",3888:"e868780c",4763:"4402d2ac",4814:"799ebd4e",6079:"363642f4",6666:"570e4624",6814:"7d29de82",7442:"92e53eb0",8835:"ce16f5a9",9312:"1cd6e1d3"})[e]||e)+"."+({10:"6cf001c181ce1098",34:"ce581867cf95e24b",36:"b4a553bf2106f6d3",194:"76dbdc07cdc2311d",214:"f6bba63dfa159e01",252:"a9e22657cbf67b42",327:"8ecab0b86d52b597",376:"9e742ff6919b2b54",392:"3cad93691f1b7360",400:"59979e0d3ae126e4",425:"9a3434a28926566a",535:"07efe2bc8f09d72e",541:"cfa15b606745131a",579:"33fc87fb95163c6a",583:"b3efc73cb21097e2",624:"2dd909fbfce98c5e",640:"5bf1e25d0bddf875",698:"e0dda03fd303b96b",794:"06b1ae4fc9cc10a9",816:"f909c891b91aa79f",830:"e49b226c07876df4",840:"a9c535f8868cc4bd",862:"fe3b86ecfb9c0716",893:"c469257bbbbca4f5",966:"57e4cd93c2368d34",968:"237f19aca13543fe",1078:"02294b2934d5bf21",1142:"8248bfb76c695146",1161:"06b33878b495da50",1184:"e80a999422621ed9",1188:"1d4ce94ddc297119",1198:"2a5c215f01a8b74d",1215:"88ed89521e915107",1219:"e27b0bd10b029e40",1247:"64e212daa5bb3925",1248:"36af3903f037c1f5",1274:"ce6906b1fe2e04b8",1280:"1651bb5167170457",1290:"869cef5f741d40c2",1335:"716cc5924662708e",1365:"d7391145ca7f8791",1379:"03e1e0f31bdaa2cc",1410:"77acea37535dbbef",1413:"117c5958c59cc695",1453:"3c24c777a3deca2d",1456:"217c3832b3e76b7f",1501:"549af2c91a889a08",1534:"918a25b2e3daab22",1556:"96abc9ff91b0c383",1583:"03a06dbdde85ac56",1595:"ee61519fde230f60",1630:"2911e2bac119d910",1642:"8c00543baa1aef54",1656:"a9efc78185a5a85f",1664:"6d5b5e3112b66906",1898:"e07b2b1c5e789b06",1932:"b0aea9b52cabe5e8",1977:"a06c8e8d2198f765",2008:"71ee9230ad78df21",2013:"598558c40e51e107",2031:"3877441c49bff5cd",2041:"00f4fa0ab26c6ba5",2062:"4a0ab3400fea0e34",2107:"c627112b02b9e1c8",2130:"441ae0f68863efeb",2160:"e38d781fd5c4cde0",2179:"1bf5fe315e6e132c",2215:"9d2d6fbe90ffcc80",2278:"0b14de1cb2041bfd",2349:"ca15d465c4260b4b",2374:"7560cc5c4b8ed6b0",2397:"0e4dce0a557ac7cf",2403:"3dda71b6482dce3b",2485:"3188870375e9fbee",2489:"fcc70bd67329a70e",2501:"4e65b56602faa956",2503:"bb9d3528c3c7ccae",2504:"159b28843e61aae9",2577:"f52cffdd449a2d14",2614:"8349e4b407470a30",2710:"fe0656d4ebae4d30",2728:"5fed9ac13dfcd1d1",2735:"5a3e65a580bd5af9",2747:"1d85d388314f2904",2765:"2c6d9772af50feed",2783:"e8bbf2c794ef9750",2812:"dcd8179a6b1d76c9",2826:"dd3dc8bbd3025fa5",2839:"c9a657d5b4031a19",2895:"0339e755e79ee794",2937:"7e724516d5e6ce42",2954:"7d8daeae6410d4a4",2957:"2dd93db1a16e96b0",2964:"1a0e15f7327680a2",3072:"b6da96c10080c967",3074:"911584369786c26c",3077:"bf82c0c332cc9fec",3082:"159e4ab8f0572597",3095:"8cd478c42cee505a",3111:"1cf85db2faeb20cc",3175:"538ce7aec634bddb",3186:"3665756f8aae3eb7",3194:"5a331fb5e3dc34e9",3229:"5e91f7d0b135266b",3274:"858f7f9216c8b074",3286:"196c508356bb0b66",3288:"f23c8a5183e6b910",3290:"b5ba2646ad49c9fd",3304:"16305e84f4ff6598",3313:"471138e5504646a9",3324:"85e21e3313d0901c",3392:"460f5a753531f501",3419:"78b520dab7e2f96d",3437:"0ad1ecc8c5b8a679",3476:"246c30b47bded3b7",3483:"fc2a0b1185dbaa5d",3492:"ca55498822ad7796",3526:"24826331ab265b39",3606:"e5c833cdda239583",3633:"2526b2d018636ff0",3782:"8d7b66d0e37dbe76",3787:"78ebe68a043f50ce",3860:"be5b243bf7d6618c",3873:"72a9a21509f713f7",3879:"f50abf4e93e943ea",3888:"abc48b70a10fc2d6",3942:"085da8d58242eeab",3979:"cea8623f6e9f83ea",4053:"90d71fcbe4ffd852",4080:"08a21dae9e93c547",4163:"c6ebefdd9aa5c358",4174:"b6ff75dd91a2a32e",4223:"c10556cd92fc8018",4242:"3a66c58375424a5b",4275:"8f2e531757c2a813",4295:"6c0f4838b0c9c69d",4309:"a887a10e84c44f9e",4350:"b9d80827e8eee01a",4357:"ac4f251cdac34fbe",4358:"f89b14cf7a988731",4370:"ac13b62c811f7ede",4417:"0b5ee948c3518db3",4447:"5bad7871be61ca73",4474:"053807fa34066566",4539:"559c223da16b0282",4540:"03df20c499bca840",4553:"ce3eab65a260353e",4567:"7dc81a6e1c7df565",4583:"2a5df6eb3a6ea30b",4593:"676ac488744e1af5",4608:"1ff246d6b4c771f8",4634:"0332a56fdb8e26c0",4650:"61aec912b756287b",4659:"0b14de1cb2041bfd",4678:"867dfae26694be02",4763:"d0d1b1777a45e0b2",4801:"17596dbc1818c262",4814:"ccb85c56e9216a38",4823:"907850963b2bcb70",4829:"402ec60139d36417",4846:"c563765de65a34c7",4900:"b723a916eafdf743",4903:"004f583a12223dac",4963:"0f6678151a159143",4969:"1cb10af9489ea295",4976:"8870319ffbd1c31f",5005:"73745d7fcae6989e",5025:"b597364f0cf8b85a",5061:"025d30c3123eeaf6",5136:"ac897c2a56ee392f",5183:"2e5c895a2be76262",5269:"2e771096652dc113",5320:"00f00028b9163a43",5326:"adc4bf49a22f4e67",5331:"4d5d42e5253dbee2",5347:"3192e0021174aaa8",5375:"ebc026e6140b52f1",5424:"4d62f7ee887cd8b9",5482:"0907421e6bf5eeec",5491:"5cc285c4b84dac30",5498:"117ef4b6035a90c5",5518:"6c3dc9afe81a566b",5520:"eab85d7487e77510",5553:"75df19e3cc1246d6",5575:"3d90c643343a1329",5645:"0b86853ae26d9ee3",5670:"2a1b27a6fdb7aa6b",5690:"d30877807cf5c7eb",5712:"574fca2d5f06483a",5728:"8ef773d61765855e",5750:"aa57d25b74640d23",5755:"00015c284ed6fb39",5920:"9db223329ee9e11a",5922:"ce56021f8cc6ebbc",5937:"0827b5b3eb831ff0",5968:"63d5869783fad06f",5997:"226c07d9e6c496e0",6046:"00d36aea7fd5b147",6079:"cf8b455e0d94b478",6089:"2dd351186ec85cc3",6099:"43e6595fcf24fc33",6110:"5ce3f75fced27aaf",6144:"f967a8228bcdf663",6155:"19719cff570d6559",6166:"ecd82a9dcb484b97",6290:"e14cf4fc52dd4539",6293:"5914fa73a9f7e777",6311:"5b9c1f74df9a8f67",6331:"758f2f66b92cada9",6339:"bc9301cc22898be0",6360:"ff0a9063773daeeb",6402:"a0070d7688ed986b",6412:"089ee787a294d10b",6455:"12b78a2660d609eb",6563:"5d618b608750f4dc",6572:"ca2463823b9b01a0",6580:"75d53830b434451f",6588:"0fbca957af7d9e6a",6647:"584c5d5cd8dfdb5a",6666:"a82467c542429379",6686:"796c782c33ab8ca9",6701:"bff0efb979f71a17",6704:"f280f0ad0f5d8644",6729:"77a5381ac8f5c9ae",6741:"06fdaf122961074e",6814:"30ff86a90cbfd921",6846:"91283f709c40802c",6859:"bacad166ee995fe0",6887:"6c81234d73740fb9",6927:"aa3914b5fb0d14d4",6931:"3c90e9fe0f7f1e66",6938:"0ccf683bd8aa8410",6948:"2719ed8731963209",6959:"5a803faf27f88e9f",7021:"b71240b1d5f6fbe4",7040:"0b14de1cb2041bfd",7041:"174bf29bd837f06d",7082:"fc816f91214026d7",7113:"39704408fef3d26e",7130:"8d24694735826c22",7142:"dbd2cf8141eece5e",7152:"c7b7f1f5e9622f21",7227:"a6b2f01487bb3d9d",7258:"6cbe24c3bcb63d1d",7425:"8b47c8e398a12dd8",7442:"097194be4a0e7d55",7455:"71d54397710b923c",7465:"867e8ff655666413",7524:"9528295a19a5837a",7525:"f433aaf1fe40c90a",7557:"bdc743175125b3d8",7610:"b1439345dbcf285d",7625:"ab66bd50d2fb61a4",7635:"166d83de1d29e758",7636:"bf91320a9ff695af",7785:"1402a4110c300764",7799:"40b047a634f96a24",7819:"3c56f48c0dc5ad5d",7844:"2bb29faa262f313e",7846:"c9705c044ab8f87a",7884:"390ae2efbbf230c4",7889:"af3e581842f34c28",7921:"c361f794cc208e06",7977:"80e4daa080a79c39",8113:"907baefc7227cfb8",8132:"74491162f08af899",8192:"5918d83ac6a0e2dc",8243:"1450514f8390977e",8257:"dd8f651f1a43fee2",8288:"9bd1d26060cb00a1",8318:"81c7ac586fcbb728",8406:"955ccfbb4b70b8c3",8430:"b1f802dcffa41626",8432:"bd66ac287c569996",8457:"b61d96d8d30215fc",8496:"046efd6301dd804f",8545:"be0c9eea6aae5971",8555:"ab3ee6358f1d64da",8656:"2ceb4e5ff5df2fca",8670:"90ede75068758e82",8704:"a1003918da6654da",8773:"614f1f4f0f845c5e",8835:"5c7821b201f35593",8848:"7c6e47cca9f0059a",8921:"fb24a4d4d4d3265b",8947:"31d3d834d8281fd9",8977:"01b9c429327004e9",9005:"33cf91e617920d4f",9006:"11537833945ec4b8",9015:"c4e40321a6503a1b",9136:"191be42a2fee842c",9178:"48a90097ee3f0b0c",9186:"3af6fcd13ab752fa",9189:"3e9d29bf275ec462",9220:"bc767ebb5adb9f49",9224:"401f9320ee58570b",9240:"d38ddbe94e0bf128",9267:"fbfd65ea31e7448c",9294:"a20485f3282321b3",9302:"726b065f2df0323a",9312:"8121a74b2042bff3",9377:"f9db706e76f04afe",9382:"bc0e11ecc88dd62c",9421:"a5c1dbcfbfdd8f52",9448:"2668b3cd408e86de",9466:"c9d8f45d14235087",9521:"e1240eb862eb32dc",9547:"7729788fff21926f",9565:"8de0671f99d12abe",9569:"2f36b2b1c2f838d7",9605:"dfac539f89cea7a2",9615:"3b62c13af671f714",9648:"8235b6fea7087b3a",9666:"a515fa6d89a71f1c",9680:"d5ceac8967e0b6a8",9690:"7773c72f0eff6dec",9841:"422321143547591a",9842:"3b71b65b30d8ef2a",9996:"18b7bca2f0ab222e"})[e]+".js",l.miniCssF=e=>"static/css/659eccb5db697b76.css",l.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),l.o=(e,a)=>Object.prototype.hasOwnProperty.call(e,a),c={},l.l=(e,a,f,d)=>{if(c[e])return void c[e].push(a);if(void 0!==f)for(var b,t,r=document.getElementsByTagName("script"),o=0;o<r.length;o++){var n=r[o];if(n.getAttribute("src")==e||n.getAttribute("data-webpack")=="_N_E:"+f){b=n;break}}b||(t=!0,(b=document.createElement("script")).charset="utf-8",b.timeout=120,l.nc&&b.setAttribute("nonce",l.nc),b.setAttribute("data-webpack","_N_E:"+f),b.src=l.tu(e)),c[e]=[a];var i=(a,f)=>{b.onerror=b.onload=null,clearTimeout(s);var d=c[e];if(delete c[e],b.parentNode&&b.parentNode.removeChild(b),d&&d.forEach(e=>e(f)),a)return a(f)},s=setTimeout(i.bind(null,void 0,{type:"timeout",target:b}),12e4);b.onerror=i.bind(null,b.onerror),b.onload=i.bind(null,b.onload),t&&document.head.appendChild(b)},l.r=e=>{"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},l.tt=()=>(void 0===d&&(d={createScriptURL:e=>e},"u">typeof trustedTypes&&trustedTypes.createPolicy&&(d=trustedTypes.createPolicy("nextjs#bundler",d))),d),l.tu=e=>l.tt().createScriptURL(e),l.p="/_next/",b={8068:0},l.f.miniCss=(e,a)=>{if(b[e])a.push(b[e]);else 0!==b[e]&&({1838:1})[e]&&a.push(b[e]=new Promise((a,f)=>{var c=l.miniCssF(e),d=l.p+c;if(((e,a)=>{for(var f=document.getElementsByTagName("link"),c=0;c<f.length;c++){var d=f[c],b=d.getAttribute("data-href")||d.getAttribute("href");if("stylesheet"===d.rel&&(b===e||b===a))return d}for(var t=document.getElementsByTagName("style"),c=0;c<t.length;c++){var d=t[c],b=d.getAttribute("data-href");if(b===e||b===a)return d}})(c,d))return a();((e,a,f,c)=>{var d=document.createElement("link");d.rel="stylesheet",d.type="text/css",d.onerror=d.onload=b=>{if(d.onerror=d.onload=null,"load"===b.type)f();else{var t=b&&("load"===b.type?"missing":b.type),r=b&&b.target&&b.target.href||a,o=Error("Loading CSS chunk "+e+" failed.\n("+r+")");o.code="CSS_CHUNK_LOAD_FAILED",o.type=t,o.request=r,d.parentNode.removeChild(d),c(o)}},d.href=a;if("function"==typeof _N_E_STYLE_LOAD){var b=d.href,t=d.onload,r=d.onerror;_N_E_STYLE_LOAD(0===b.indexOf(window.location.origin)?new URL(b).pathname:b).then(function(){t&&t.call(d,{type:"load"})},function(){r&&r.call(d,{})})}else document.head.appendChild(d)})(e,d,a,f)}).then(()=>{b[e]=0},a=>{throw delete b[e],a}))},t={8068:0,2557:0,7513:0},l.f.j=(e,a)=>{var f=l.o(t,e)?t[e]:void 0;if(0!==f)if(f)a.push(f[2]);else if(/^(1838|2557|7513|8068)$/.test(e))t[e]=0;else{var c=new Promise((a,c)=>f=t[e]=[a,c]);a.push(f[2]=c);var d=l.p+l.u(e),b=Error();l.l(d,a=>{if(l.o(t,e)&&(0!==(f=t[e])&&(t[e]=void 0),f)){var c=a&&("load"===a.type?"missing":a.type),d=a&&a.target&&a.target.src;b.message="Loading chunk "+e+" failed.\n("+c+": "+d+")",b.name="ChunkLoadError",b.type=c,b.request=d,f[1](b)}},"chunk-"+e,e)}},l.O.j=e=>0===t[e],r=(e,a)=>{var f,c,[d,b,r]=a,o=0;if(d.some(e=>0!==t[e])){for(f in b)l.o(b,f)&&(l.m[f]=b[f]);if(r)var n=r(l)}for(e&&e(a);o<d.length;o++)c=d[o],l.o(t,c)&&t[c]&&t[c][0](),t[c]=0;return l.O(n)},(o=self.webpackChunk_N_E=self.webpackChunk_N_E||[]).forEach(r.bind(null,0)),o.push=r.bind(null,o.push.bind(o)),l.nc=void 0})();
@@ -15,7 +15,7 @@ const currentPort = parseInt(process.env.PORT, 10) || 3000
15
15
  const hostname = process.env.HOSTNAME || '0.0.0.0'
16
16
 
17
17
  let keepAliveTimeout = parseInt(process.env.KEEP_ALIVE_TIMEOUT, 10)
18
- const nextConfig = {"env":{},"typescript":{"ignoreBuildErrors":true},"typedRoutes":false,"distDir":"./.next","cleanDistDir":true,"assetPrefix":"","cacheMaxMemorySize":52428800,"configOrigin":"next.config.mjs","useFileSystemPublicRoutes":true,"generateEtags":true,"pageExtensions":["tsx","ts","jsx","js"],"poweredByHeader":true,"compress":true,"images":{"deviceSizes":[640,750,828,1080,1200,1920,2048,3840],"imageSizes":[32,48,64,96,128,256,384],"path":"/_next/image","loader":"default","loaderFile":"","domains":[],"disableStaticImages":false,"minimumCacheTTL":14400,"formats":["image/webp"],"maximumRedirects":3,"maximumResponseBody":50000000,"dangerouslyAllowLocalIP":false,"dangerouslyAllowSVG":false,"contentSecurityPolicy":"script-src 'none'; frame-src 'none'; sandbox;","contentDispositionType":"attachment","localPatterns":[{"pathname":"**","search":""}],"remotePatterns":[],"qualities":[75],"unoptimized":true,"customCacheHandler":false},"devIndicators":{"position":"bottom-left"},"onDemandEntries":{"maxInactiveAge":60000,"pagesBufferLength":5},"basePath":"","sassOptions":{},"trailingSlash":false,"i18n":null,"productionBrowserSourceMaps":false,"excludeDefaultMomentLocales":true,"reactProductionProfiling":false,"reactStrictMode":null,"reactMaxHeadersLength":6000,"httpAgentOptions":{"keepAlive":true},"logging":{"serverFunctions":true,"browserToTerminal":"warn"},"compiler":{},"expireTime":31536000,"staticPageGenerationTimeout":60,"output":"standalone","modularizeImports":{"@mui/icons-material":{"transform":"@mui/icons-material/{{member}}"},"lodash":{"transform":"lodash/{{member}}"}},"outputFileTracingRoot":"/__w/gsd-2/gsd-2","cacheComponents":false,"cacheLife":{"default":{"stale":300,"revalidate":900,"expire":4294967294},"seconds":{"stale":30,"revalidate":1,"expire":60},"minutes":{"stale":300,"revalidate":60,"expire":3600},"hours":{"stale":300,"revalidate":3600,"expire":86400},"days":{"stale":300,"revalidate":86400,"expire":604800},"weeks":{"stale":300,"revalidate":604800,"expire":2592000},"max":{"stale":300,"revalidate":2592000,"expire":31536000}},"cacheHandlers":{},"experimental":{"appNewScrollHandler":false,"useSkewCookie":false,"cssChunking":true,"multiZoneDraftMode":false,"appNavFailHandling":false,"prerenderEarlyExit":true,"serverMinification":true,"linkNoTouchStart":false,"caseSensitiveRoutes":false,"cachedNavigations":false,"partialFallbacks":false,"dynamicOnHover":false,"varyParams":false,"prefetchInlining":false,"preloadEntriesOnStart":true,"clientRouterFilter":true,"clientRouterFilterRedirects":false,"fetchCacheKeyPrefix":"","proxyPrefetch":"flexible","optimisticClientCache":true,"manualClientBasePath":false,"cpus":9,"memoryBasedWorkersCount":false,"imgOptConcurrency":null,"imgOptTimeoutInSeconds":7,"imgOptMaxInputPixels":268402689,"imgOptSequentialRead":null,"imgOptSkipMetadata":null,"isrFlushToDisk":true,"workerThreads":false,"optimizeCss":false,"nextScriptWorkers":false,"scrollRestoration":false,"externalDir":false,"disableOptimizedLoading":false,"gzipSize":true,"craCompat":false,"esmExternals":true,"fullySpecified":false,"swcTraceProfiling":false,"forceSwcTransforms":false,"largePageDataBytes":128000,"typedEnv":false,"parallelServerCompiles":false,"parallelServerBuildTraces":false,"ppr":false,"authInterrupts":false,"webpackMemoryOptimizations":false,"optimizeServerReact":true,"strictRouteTypes":false,"viewTransition":false,"removeUncaughtErrorAndRejectionListeners":false,"validateRSCRequestHeaders":false,"staleTimes":{"dynamic":0,"static":300},"reactDebugChannel":true,"serverComponentsHmrCache":true,"staticGenerationMaxConcurrency":8,"staticGenerationMinPagesPerWorker":25,"transitionIndicator":false,"gestureTransition":false,"inlineCss":false,"useCache":false,"globalNotFound":false,"browserDebugInfoInTerminal":"warn","lockDistDir":true,"proxyClientMaxBodySize":10485760,"hideLogsAfterAbort":false,"mcpServer":true,"turbopackFileSystemCacheForDev":true,"turbopackFileSystemCacheForBuild":false,"turbopackInferModuleSideEffects":true,"turbopackPluginRuntimeStrategy":"childProcesses","optimizePackageImports":["lucide-react","date-fns","lodash-es","ramda","antd","react-bootstrap","ahooks","@ant-design/icons","@headlessui/react","@headlessui-float/react","@heroicons/react/20/solid","@heroicons/react/24/solid","@heroicons/react/24/outline","@visx/visx","@tremor/react","rxjs","@mui/material","@mui/icons-material","recharts","react-use","effect","@effect/schema","@effect/platform","@effect/platform-node","@effect/platform-browser","@effect/platform-bun","@effect/sql","@effect/sql-mssql","@effect/sql-mysql2","@effect/sql-pg","@effect/sql-sqlite-node","@effect/sql-sqlite-bun","@effect/sql-sqlite-wasm","@effect/sql-sqlite-react-native","@effect/rpc","@effect/rpc-http","@effect/typeclass","@effect/experimental","@effect/opentelemetry","@material-ui/core","@material-ui/icons","@tabler/icons-react","mui-core","react-icons/ai","react-icons/bi","react-icons/bs","react-icons/cg","react-icons/ci","react-icons/di","react-icons/fa","react-icons/fa6","react-icons/fc","react-icons/fi","react-icons/gi","react-icons/go","react-icons/gr","react-icons/hi","react-icons/hi2","react-icons/im","react-icons/io","react-icons/io5","react-icons/lia","react-icons/lib","react-icons/lu","react-icons/md","react-icons/pi","react-icons/ri","react-icons/rx","react-icons/si","react-icons/sl","react-icons/tb","react-icons/tfi","react-icons/ti","react-icons/vsc","react-icons/wi"],"trustHostHeader":false,"isExperimentalCompile":false},"htmlLimitedBots":"[\\w-]+-Google|Google-[\\w-]+|Chrome-Lighthouse|Slurp|DuckDuckBot|baiduspider|yandex|sogou|bitlybot|tumblr|vkShare|quora link preview|redditbot|ia_archiver|Bingbot|BingPreview|applebot|facebookexternalhit|facebookcatalog|Twitterbot|LinkedInBot|Slackbot|Discordbot|WhatsApp|SkypeUriPreview|Yeti|googleweblight","bundlePagesRouterDependencies":false,"configFileName":"next.config.mjs","serverExternalPackages":["@gsd/native","node-pty"],"turbopack":{"root":"/__w/gsd-2/gsd-2"},"distDirRoot":".next"}
18
+ const nextConfig = {"env":{},"typescript":{"ignoreBuildErrors":true},"typedRoutes":false,"distDir":"./.next","cleanDistDir":true,"assetPrefix":"","cacheMaxMemorySize":52428800,"configOrigin":"next.config.mjs","useFileSystemPublicRoutes":true,"generateEtags":true,"pageExtensions":["tsx","ts","jsx","js"],"poweredByHeader":true,"compress":true,"images":{"deviceSizes":[640,750,828,1080,1200,1920,2048,3840],"imageSizes":[32,48,64,96,128,256,384],"path":"/_next/image","loader":"default","loaderFile":"","domains":[],"disableStaticImages":false,"minimumCacheTTL":14400,"formats":["image/webp"],"maximumRedirects":3,"maximumResponseBody":50000000,"dangerouslyAllowLocalIP":false,"dangerouslyAllowSVG":false,"contentSecurityPolicy":"script-src 'none'; frame-src 'none'; sandbox;","contentDispositionType":"attachment","localPatterns":[{"pathname":"**","search":""}],"remotePatterns":[],"qualities":[75],"unoptimized":true,"customCacheHandler":false},"devIndicators":{"position":"bottom-left"},"onDemandEntries":{"maxInactiveAge":60000,"pagesBufferLength":5},"basePath":"","sassOptions":{},"trailingSlash":false,"i18n":null,"productionBrowserSourceMaps":false,"excludeDefaultMomentLocales":true,"reactProductionProfiling":false,"reactStrictMode":null,"reactMaxHeadersLength":6000,"httpAgentOptions":{"keepAlive":true},"logging":{"serverFunctions":true,"browserToTerminal":"warn"},"compiler":{},"expireTime":31536000,"staticPageGenerationTimeout":60,"output":"standalone","modularizeImports":{"@mui/icons-material":{"transform":"@mui/icons-material/{{member}}"},"lodash":{"transform":"lodash/{{member}}"}},"outputFileTracingRoot":"/__w/gsd-2/gsd-2","cacheComponents":false,"cacheLife":{"default":{"stale":300,"revalidate":900,"expire":4294967294},"seconds":{"stale":30,"revalidate":1,"expire":60},"minutes":{"stale":300,"revalidate":60,"expire":3600},"hours":{"stale":300,"revalidate":3600,"expire":86400},"days":{"stale":300,"revalidate":86400,"expire":604800},"weeks":{"stale":300,"revalidate":604800,"expire":2592000},"max":{"stale":300,"revalidate":2592000,"expire":31536000}},"cacheHandlers":{},"experimental":{"appNewScrollHandler":false,"useSkewCookie":false,"cssChunking":true,"multiZoneDraftMode":false,"appNavFailHandling":false,"prerenderEarlyExit":true,"serverMinification":true,"linkNoTouchStart":false,"caseSensitiveRoutes":false,"cachedNavigations":false,"partialFallbacks":false,"dynamicOnHover":false,"varyParams":false,"prefetchInlining":false,"preloadEntriesOnStart":true,"clientRouterFilter":true,"clientRouterFilterRedirects":false,"fetchCacheKeyPrefix":"","proxyPrefetch":"flexible","optimisticClientCache":true,"manualClientBasePath":false,"cpus":5,"memoryBasedWorkersCount":false,"imgOptConcurrency":null,"imgOptTimeoutInSeconds":7,"imgOptMaxInputPixels":268402689,"imgOptSequentialRead":null,"imgOptSkipMetadata":null,"isrFlushToDisk":true,"workerThreads":false,"optimizeCss":false,"nextScriptWorkers":false,"scrollRestoration":false,"externalDir":false,"disableOptimizedLoading":false,"gzipSize":true,"craCompat":false,"esmExternals":true,"fullySpecified":false,"swcTraceProfiling":false,"forceSwcTransforms":false,"largePageDataBytes":128000,"typedEnv":false,"parallelServerCompiles":false,"parallelServerBuildTraces":false,"ppr":false,"authInterrupts":false,"webpackMemoryOptimizations":false,"optimizeServerReact":true,"strictRouteTypes":false,"viewTransition":false,"removeUncaughtErrorAndRejectionListeners":false,"validateRSCRequestHeaders":false,"staleTimes":{"dynamic":0,"static":300},"reactDebugChannel":true,"serverComponentsHmrCache":true,"staticGenerationMaxConcurrency":8,"staticGenerationMinPagesPerWorker":25,"transitionIndicator":false,"gestureTransition":false,"inlineCss":false,"useCache":false,"globalNotFound":false,"browserDebugInfoInTerminal":"warn","lockDistDir":true,"proxyClientMaxBodySize":10485760,"hideLogsAfterAbort":false,"mcpServer":true,"turbopackFileSystemCacheForDev":true,"turbopackFileSystemCacheForBuild":false,"turbopackInferModuleSideEffects":true,"turbopackPluginRuntimeStrategy":"childProcesses","optimizePackageImports":["lucide-react","date-fns","lodash-es","ramda","antd","react-bootstrap","ahooks","@ant-design/icons","@headlessui/react","@headlessui-float/react","@heroicons/react/20/solid","@heroicons/react/24/solid","@heroicons/react/24/outline","@visx/visx","@tremor/react","rxjs","@mui/material","@mui/icons-material","recharts","react-use","effect","@effect/schema","@effect/platform","@effect/platform-node","@effect/platform-browser","@effect/platform-bun","@effect/sql","@effect/sql-mssql","@effect/sql-mysql2","@effect/sql-pg","@effect/sql-sqlite-node","@effect/sql-sqlite-bun","@effect/sql-sqlite-wasm","@effect/sql-sqlite-react-native","@effect/rpc","@effect/rpc-http","@effect/typeclass","@effect/experimental","@effect/opentelemetry","@material-ui/core","@material-ui/icons","@tabler/icons-react","mui-core","react-icons/ai","react-icons/bi","react-icons/bs","react-icons/cg","react-icons/ci","react-icons/di","react-icons/fa","react-icons/fa6","react-icons/fc","react-icons/fi","react-icons/gi","react-icons/go","react-icons/gr","react-icons/hi","react-icons/hi2","react-icons/im","react-icons/io","react-icons/io5","react-icons/lia","react-icons/lib","react-icons/lu","react-icons/md","react-icons/pi","react-icons/ri","react-icons/rx","react-icons/si","react-icons/sl","react-icons/tb","react-icons/tfi","react-icons/ti","react-icons/vsc","react-icons/wi"],"trustHostHeader":false,"isExperimentalCompile":false},"htmlLimitedBots":"[\\w-]+-Google|Google-[\\w-]+|Chrome-Lighthouse|Slurp|DuckDuckBot|baiduspider|yandex|sogou|bitlybot|tumblr|vkShare|quora link preview|redditbot|ia_archiver|Bingbot|BingPreview|applebot|facebookexternalhit|facebookcatalog|Twitterbot|LinkedInBot|Slackbot|Discordbot|WhatsApp|SkypeUriPreview|Yeti|googleweblight","bundlePagesRouterDependencies":false,"configFileName":"next.config.mjs","serverExternalPackages":["@gsd/native","node-pty"],"turbopack":{"root":"/__w/gsd-2/gsd-2"},"distDirRoot":".next"}
19
19
 
20
20
  process.env.__NEXT_PRIVATE_STANDALONE_CONFIG = JSON.stringify(nextConfig)
21
21
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gsd-pi",
3
- "version": "2.70.1-dev.3591dcf",
3
+ "version": "2.70.1-dev.3e19108",
4
4
  "description": "GSD — Get Shit Done coding agent",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -0,0 +1,39 @@
1
+ /**
2
+ * Check which keys already exist in a .env file or process.env.
3
+ * Returns the subset of `keys` that are already set.
4
+ */
5
+ export declare function checkExistingEnvKeys(keys: string[], envFilePath: string): Promise<string[]>;
6
+ /**
7
+ * Detect the write destination based on project files in basePath.
8
+ * Priority: vercel.json → convex/ dir → fallback "dotenv".
9
+ */
10
+ export declare function detectDestination(basePath: string): "dotenv" | "vercel" | "convex";
11
+ /**
12
+ * Write a single key=value pair to a .env file.
13
+ * Updates existing keys in-place, appends new ones at the end.
14
+ */
15
+ export declare function writeEnvKey(filePath: string, key: string, value: string): Promise<void>;
16
+ export declare function isSafeEnvVarKey(key: string): boolean;
17
+ export declare function isSupportedDeploymentEnvironment(env: string): boolean;
18
+ export declare function shellEscapeSingle(value: string): string;
19
+ interface ApplyResult {
20
+ applied: string[];
21
+ errors: string[];
22
+ }
23
+ /**
24
+ * Apply collected secrets to the target destination.
25
+ * Dotenv writes are handled directly; vercel/convex shell out via execFn.
26
+ */
27
+ export declare function applySecrets(provided: Array<{
28
+ key: string;
29
+ value: string;
30
+ }>, destination: "dotenv" | "vercel" | "convex", opts: {
31
+ envFilePath: string;
32
+ environment?: string;
33
+ execFn?: (cmd: string, args: string[]) => Promise<{
34
+ code: number;
35
+ stderr: string;
36
+ }>;
37
+ }): Promise<ApplyResult>;
38
+ export {};
39
+ //# sourceMappingURL=env-writer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"env-writer.d.ts","sourceRoot":"","sources":["../src/env-writer.ts"],"names":[],"mappings":"AAeA;;;GAGG;AACH,wBAAsB,oBAAoB,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAiBjG;AAMD;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,QAAQ,GAAG,QAAQ,GAAG,QAAQ,CAalF;AAMD;;;GAGG;AACH,wBAAsB,WAAW,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAoB7F;AAMD,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAEpD;AAED,wBAAgB,gCAAgC,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAErE;AAMD,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAEvD;AAMD,UAAU,WAAW;IACnB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB;AAED;;;GAGG;AACH,wBAAsB,YAAY,CAChC,QAAQ,EAAE,KAAK,CAAC;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC,EAC/C,WAAW,EAAE,QAAQ,GAAG,QAAQ,GAAG,QAAQ,EAC3C,IAAI,EAAE;IACJ,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,OAAO,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CACrF,GACA,OAAO,CAAC,WAAW,CAAC,CAkDtB"}
@@ -0,0 +1,158 @@
1
+ // @gsd-build/mcp-server — Environment variable write utilities
2
+ // Copyright (c) 2026 Jeremy McSpadden <jeremy@fluxlabs.net>
3
+ //
4
+ // Shared helpers for writing env vars to .env files, detecting project
5
+ // destinations, and checking existing keys. Used by secure_env_collect
6
+ // MCP tool. No TUI dependencies — pure filesystem + process.env operations.
7
+ import { readFile, writeFile } from "node:fs/promises";
8
+ import { existsSync, statSync } from "node:fs";
9
+ import { resolve } from "node:path";
10
+ // ---------------------------------------------------------------------------
11
+ // checkExistingEnvKeys
12
+ // ---------------------------------------------------------------------------
13
+ /**
14
+ * Check which keys already exist in a .env file or process.env.
15
+ * Returns the subset of `keys` that are already set.
16
+ */
17
+ export async function checkExistingEnvKeys(keys, envFilePath) {
18
+ let fileContent = "";
19
+ try {
20
+ fileContent = await readFile(envFilePath, "utf8");
21
+ }
22
+ catch {
23
+ // ENOENT or other read error — proceed with empty content
24
+ }
25
+ const existing = [];
26
+ for (const key of keys) {
27
+ const escaped = key.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
28
+ const regex = new RegExp(`^${escaped}\\s*=`, "m");
29
+ if (regex.test(fileContent) || key in process.env) {
30
+ existing.push(key);
31
+ }
32
+ }
33
+ return existing;
34
+ }
35
+ // ---------------------------------------------------------------------------
36
+ // detectDestination
37
+ // ---------------------------------------------------------------------------
38
+ /**
39
+ * Detect the write destination based on project files in basePath.
40
+ * Priority: vercel.json → convex/ dir → fallback "dotenv".
41
+ */
42
+ export function detectDestination(basePath) {
43
+ if (existsSync(resolve(basePath, "vercel.json"))) {
44
+ return "vercel";
45
+ }
46
+ const convexPath = resolve(basePath, "convex");
47
+ try {
48
+ if (existsSync(convexPath) && statSync(convexPath).isDirectory()) {
49
+ return "convex";
50
+ }
51
+ }
52
+ catch {
53
+ // stat error — treat as not found
54
+ }
55
+ return "dotenv";
56
+ }
57
+ // ---------------------------------------------------------------------------
58
+ // writeEnvKey
59
+ // ---------------------------------------------------------------------------
60
+ /**
61
+ * Write a single key=value pair to a .env file.
62
+ * Updates existing keys in-place, appends new ones at the end.
63
+ */
64
+ export async function writeEnvKey(filePath, key, value) {
65
+ if (typeof value !== "string") {
66
+ throw new TypeError(`writeEnvKey expects a string value for key "${key}", got ${typeof value}`);
67
+ }
68
+ let content = "";
69
+ try {
70
+ content = await readFile(filePath, "utf8");
71
+ }
72
+ catch {
73
+ content = "";
74
+ }
75
+ const escaped = value.replace(/\\/g, "\\\\").replace(/\n/g, "\\n").replace(/\r/g, "");
76
+ const line = `${key}=${escaped}`;
77
+ const regex = new RegExp(`^${key.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}\\s*=.*$`, "m");
78
+ if (regex.test(content)) {
79
+ content = content.replace(regex, line);
80
+ }
81
+ else {
82
+ if (content.length > 0 && !content.endsWith("\n"))
83
+ content += "\n";
84
+ content += `${line}\n`;
85
+ }
86
+ await writeFile(filePath, content, "utf8");
87
+ }
88
+ // ---------------------------------------------------------------------------
89
+ // Validation helpers
90
+ // ---------------------------------------------------------------------------
91
+ export function isSafeEnvVarKey(key) {
92
+ return /^[A-Za-z_][A-Za-z0-9_]*$/.test(key);
93
+ }
94
+ export function isSupportedDeploymentEnvironment(env) {
95
+ return env === "development" || env === "preview" || env === "production";
96
+ }
97
+ // ---------------------------------------------------------------------------
98
+ // Shell helpers (for vercel/convex CLI)
99
+ // ---------------------------------------------------------------------------
100
+ export function shellEscapeSingle(value) {
101
+ return `'${value.replace(/'/g, `'\\''`)}'`;
102
+ }
103
+ /**
104
+ * Apply collected secrets to the target destination.
105
+ * Dotenv writes are handled directly; vercel/convex shell out via execFn.
106
+ */
107
+ export async function applySecrets(provided, destination, opts) {
108
+ const applied = [];
109
+ const errors = [];
110
+ if (destination === "dotenv") {
111
+ for (const { key, value } of provided) {
112
+ try {
113
+ await writeEnvKey(opts.envFilePath, key, value);
114
+ applied.push(key);
115
+ // Hydrate process.env so the current session sees the new value
116
+ process.env[key] = value;
117
+ }
118
+ catch (err) {
119
+ const msg = err instanceof Error ? err.message : String(err);
120
+ errors.push(`${key}: ${msg}`);
121
+ }
122
+ }
123
+ }
124
+ if ((destination === "vercel" || destination === "convex") && opts.execFn) {
125
+ const env = opts.environment ?? "development";
126
+ if (!isSupportedDeploymentEnvironment(env)) {
127
+ errors.push(`environment: unsupported target environment "${env}"`);
128
+ return { applied, errors };
129
+ }
130
+ for (const { key, value } of provided) {
131
+ if (!isSafeEnvVarKey(key)) {
132
+ errors.push(`${key}: invalid environment variable name`);
133
+ continue;
134
+ }
135
+ const cmd = destination === "vercel"
136
+ ? `printf %s ${shellEscapeSingle(value)} | vercel env add ${key} ${env}`
137
+ : "";
138
+ try {
139
+ const result = destination === "vercel"
140
+ ? await opts.execFn("sh", ["-c", cmd])
141
+ : await opts.execFn("npx", ["convex", "env", "set", key, value]);
142
+ if (result.code !== 0) {
143
+ errors.push(`${key}: ${result.stderr.slice(0, 200)}`);
144
+ }
145
+ else {
146
+ applied.push(key);
147
+ process.env[key] = value;
148
+ }
149
+ }
150
+ catch (err) {
151
+ const msg = err instanceof Error ? err.message : String(err);
152
+ errors.push(`${key}: ${msg}`);
153
+ }
154
+ }
155
+ }
156
+ return { applied, errors };
157
+ }
158
+ //# sourceMappingURL=env-writer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"env-writer.js","sourceRoot":"","sources":["../src/env-writer.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,4DAA4D;AAC5D,EAAE;AACF,uEAAuE;AACvE,uEAAuE;AACvE,4EAA4E;AAE5E,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC/C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,8EAA8E;AAC9E,uBAAuB;AACvB,8EAA8E;AAE9E;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,oBAAoB,CAAC,IAAc,EAAE,WAAmB;IAC5E,IAAI,WAAW,GAAG,EAAE,CAAC;IACrB,IAAI,CAAC;QACH,WAAW,GAAG,MAAM,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;IACpD,CAAC;IAAC,MAAM,CAAC;QACP,0DAA0D;IAC5D,CAAC;IAED,MAAM,QAAQ,GAAa,EAAE,CAAC;IAC9B,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;QACvB,MAAM,OAAO,GAAG,GAAG,CAAC,OAAO,CAAC,qBAAqB,EAAE,MAAM,CAAC,CAAC;QAC3D,MAAM,KAAK,GAAG,I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AAC;AAC7B,CAAC","sourcesContent":["// @gsd-build/mcp-server — Environment variable write utilities\n// Copyright (c) 2026 Jeremy McSpadden <jeremy@fluxlabs.net>\n//\n// Shared helpers for writing env vars to .env files, detecting project\n// destinations, and checking existing keys. Used by secure_env_collect\n// MCP tool. No TUI dependencies — pure filesystem + process.env operations.\n\nimport { readFile, writeFile } from \"node:fs/promises\";\nimport { existsSync, statSync } from \"node:fs\";\nimport { resolve } from \"node:path\";\n\n// ---------------------------------------------------------------------------\n// checkExistingEnvKeys\n// ---------------------------------------------------------------------------\n\n/**\n * Check which keys already exist in a .env file or process.env.\n * Returns the subset of `keys` that are already set.\n */\nexport async function checkExistingEnvKeys(keys: string[], envFilePath: string): Promise<string[]> {\n let fileContent = \"\";\n try {\n fileContent = await readFile(envFilePath, \"utf8\");\n } catch {\n // ENOENT or other read error — proceed with empty content\n }\n\n const existing: string[] = [];\n for (const key of keys) {\n const escaped = key.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\");\n const regex = new RegExp(`^${escaped}\\\\s*=`, \"m\");\n if (regex.test(fileContent) || key in process.env) {\n existing.push(key);\n }\n }\n return existing;\n}\n\n// ---------------------------------------------------------------------------\n// detectDestination\n// ---------------------------------------------------------------------------\n\n/**\n * Detect the write destination based on project files in basePath.\n * Priority: vercel.json → convex/ dir → fallback \"dotenv\".\n */\nexport function detectDestination(basePath: string): \"dotenv\" | \"vercel\" | \"convex\" {\n if (existsSync(resolve(basePath, \"vercel.json\"))) {\n return \"vercel\";\n }\n const convexPath = resolve(basePath, \"convex\");\n try {\n if (existsSync(convexPath) && statSync(convexPath).isDirectory()) {\n return \"convex\";\n }\n } catch {\n // stat error — treat as not found\n }\n return \"dotenv\";\n}\n\n// ---------------------------------------------------------------------------\n// writeEnvKey\n// ---------------------------------------------------------------------------\n\n/**\n * Write a single key=value pair to a .env file.\n * Updates existing keys in-place, appends new ones at the end.\n */\nexport async function writeEnvKey(filePath: string, key: string, value: string): Promise<void> {\n if (typeof value !== \"string\") {\n throw new TypeError(`writeEnvKey expects a string value for key \"${key}\", got ${typeof value}`);\n }\n let content = \"\";\n try {\n content = await readFile(filePath, \"utf8\");\n } catch {\n content = \"\";\n }\n const escaped = value.replace(/\\\\/g, \"\\\\\\\\\").replace(/\\n/g, \"\\\\n\").replace(/\\r/g, \"\");\n const line = `${key}=${escaped}`;\n const regex = new RegExp(`^${key.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\")}\\\\s*=.*$`, \"m\");\n if (regex.test(content)) {\n content = content.replace(regex, line);\n } else {\n if (content.length > 0 && !content.endsWith(\"\\n\")) content += \"\\n\";\n content += `${line}\\n`;\n }\n await writeFile(filePath, content, \"utf8\");\n}\n\n// ---------------------------------------------------------------------------\n// Validation helpers\n// ---------------------------------------------------------------------------\n\nexport function isSafeEnvVarKey(key: string): boolean {\n return /^[A-Za-z_][A-Za-z0-9_]*$/.test(key);\n}\n\nexport function isSupportedDeploymentEnvironment(env: string): boolean {\n return env === \"development\" || env === \"preview\" || env === \"production\";\n}\n\n// ---------------------------------------------------------------------------\n// Shell helpers (for vercel/convex CLI)\n// ---------------------------------------------------------------------------\n\nexport function shellEscapeSingle(value: string): string {\n return `'${value.replace(/'/g, `'\\\\''`)}'`;\n}\n\n// ---------------------------------------------------------------------------\n// applySecrets\n// ---------------------------------------------------------------------------\n\ninterface ApplyResult {\n applied: string[];\n errors: string[];\n}\n\n/**\n * Apply collected secrets to the target destination.\n * Dotenv writes are handled directly; vercel/convex shell out via execFn.\n */\nexport async function applySecrets(\n provided: Array<{ key: string; value: string }>,\n destination: \"dotenv\" | \"vercel\" | \"convex\",\n opts: {\n envFilePath: string;\n environment?: string;\n execFn?: (cmd: string, args: string[]) => Promise<{ code: number; stderr: string }>;\n },\n): Promise<ApplyResult> {\n const applied: string[] = [];\n const errors: string[] = [];\n\n if (destination === \"dotenv\") {\n for (const { key, value } of provided) {\n try {\n await writeEnvKey(opts.envFilePath, key, value);\n applied.push(key);\n // Hydrate process.env so the current session sees the new value\n process.env[key] = value;\n } catch (err: unknown) {\n const msg = err instanceof Error ? err.message : String(err);\n errors.push(`${key}: ${msg}`);\n }\n }\n }\n\n if ((destination === \"vercel\" || destination === \"convex\") && opts.execFn) {\n const env = opts.environment ?? \"development\";\n if (!isSupportedDeploymentEnvironment(env)) {\n errors.push(`environment: unsupported target environment \"${env}\"`);\n return { applied, errors };\n }\n for (const { key, value } of provided) {\n if (!isSafeEnvVarKey(key)) {\n errors.push(`${key}: invalid environment variable name`);\n continue;\n }\n const cmd = destination === \"vercel\"\n ? `printf %s ${shellEscapeSingle(value)} | vercel env add ${key} ${env}`\n : \"\";\n try {\n const result = destination === \"vercel\"\n ? await opts.execFn(\"sh\", [\"-c\", cmd])\n : await opts.execFn(\"npx\", [\"convex\", \"env\", \"set\", key, value]);\n if (result.code !== 0) {\n errors.push(`${key}: ${result.stderr.slice(0, 200)}`);\n } else {\n applied.push(key);\n process.env[key] = value;\n }\n } catch (err: unknown) {\n const msg = err instanceof Error ? err.message : String(err);\n errors.push(`${key}: ${msg}`);\n }\n }\n }\n\n return { applied, errors };\n}\n"]}
@@ -2,7 +2,7 @@
2
2
  * MCP Server — registers GSD orchestration, project-state, and workflow tools.
3
3
  *
4
4
  * Session tools (6): gsd_execute, gsd_status, gsd_result, gsd_cancel, gsd_query, gsd_resolve_blocker
5
- * Interactive tools (1): ask_user_questions via MCP form elicitation
5
+ * Interactive tools (2): ask_user_questions, secure_env_collect via MCP form elicitation
6
6
  * Read-only tools (6): gsd_progress, gsd_roadmap, gsd_history, gsd_doctor, gsd_captures, gsd_knowledge
7
7
  * Workflow tools (29): headless-safe planning, metadata persistence, replanning, completion, validation, reassessment, gate result, status, and journal tools
8
8
  *
@@ -11,10 +11,19 @@
11
11
  * src/mcp-server.ts in the main package).
12
12
  */
13
13
  import type { SessionManager } from './session-manager.js';
14
+ interface ElicitRequestFormParams {
15
+ mode?: 'form';
16
+ message: string;
17
+ requestedSchema: {
18
+ type: 'object';
19
+ properties: Record<string, Record<string, unknown>>;
20
+ required?: string[];
21
+ };
22
+ }
14
23
  interface McpServerInstance {
15
24
  tool(name: string, description: string, params: Record<string, unknown>, handler: (args: Record<string, unknown>) => Promise<unknown>): unknown;
16
25
  server: {
17
- elicitInput(params: AskUserQuestionsElicitRequest, options?: unknown): Promise<AskUserQuestionsElicitResult>;
26
+ elicitInput(params: AskUserQuestionsElicitRequest | ElicitRequestFormParams, options?: unknown): Promise<AskUserQuestionsElicitResult>;
18
27
  };
19
28
  connect(transport: unknown): Promise<void>;
20
29
  close(): Promise<void>;
@@ -1 +1 @@
1
- {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAKH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAkG3D,UAAU,iBAAiB;IACzB,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,EAAE,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,OAAO,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC;IAChJ,MAAM,EAAE;QACN,WAAW,CACT,MAAM,EAAE,6BAA6B,EACrC,OAAO,CAAC,EAAE,OAAO,GAChB,OAAO,CAAC,4BAA4B,CAAC,CAAC;KAC1C,CAAC;IACF,OAAO,CAAC,SAAS,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3C,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACxB;AAED,UAAU,qBAAqB;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,UAAU,eAAe;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACj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ACf,IAAI,EAAE,QAAQ,CAAC;QACf,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;QACpD,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;KACrB,CAAC;CACH;AAiCD,wBAAgB,kCAAkC,CAAC,SAAS,EAAE,eAAe,EAAE,GAAG,6BAA6B,CAiD9G;AAED,wBAAgB,kCAAkC,CAChD,SAAS,EAAE,eAAe,EAAE,EAC5B,MAAM,EAAE,4BAA4B,GACnC,MAAM,CAkBR;AAMD;;;;;GAKG;AACH,wBAAsB,eAAe,CAAC,cAAc,EAAE,cAAc,GAAG,OAAO,CAAC;IAC7E,MAAM,EAAE,iBAAiB,CAAC;CAC3B,CAAC,CAwbD"}
@@ -2,7 +2,7 @@
2
2
  * MCP Server — registers GSD orchestration, project-state, and workflow tools.
3
3
  *
4
4
  * Session tools (6): gsd_execute, gsd_status, gsd_result, gsd_cancel, gsd_query, gsd_resolve_blocker
5
- * Interactive tools (1): ask_user_questions via MCP form elicitation
5
+ * Interactive tools (2): ask_user_questions, secure_env_collect via MCP form elicitation
6
6
  * Read-only tools (6): gsd_progress, gsd_roadmap, gsd_history, gsd_doctor, gsd_captures, gsd_knowledge
7
7
  * Workflow tools (29): headless-safe planning, metadata persistence, replanning, completion, validation, reassessment, gate result, status, and journal tools
8
8
  *
@@ -20,6 +20,7 @@ import { readCaptures } from './readers/captures.js';
20
20
  import { readKnowledge } from './readers/knowledge.js';
21
21
  import { runDoctorLite } from './readers/doctor-lite.js';
22
22
  import { registerWorkflowTools } from './workflow-tools.js';
23
+ import { applySecrets, checkExistingEnvKeys, detectDestination } from './env-writer.js';
23
24
  // ---------------------------------------------------------------------------
24
25
  // Constants
25
26
  // ---------------------------------------------------------------------------
@@ -192,7 +193,7 @@ export async function createMcpServer(sessionManager) {
192
193
  // Dynamic import — same workaround as src/mcp-server.ts
193
194
  const mcpMod = await import(`${MCP_PKG}/server/mcp.js`);
194
195
  const McpServer = mcpMod.McpServer;
195
- const server = new McpServer({ name: SERVER_NAME, version: SERVER_VERSION }, { capabilities: { tools: {} } });
196
+ const server = new McpServer({ name: SERVER_NAME, version: SERVER_VERSION }, { capabilities: { tools: {}, elicitation: {} } });
196
197
  // -----------------------------------------------------------------------
197
198
  // gsd_execute — start a new GSD auto-mode session
198
199
  // -----------------------------------------------------------------------
@@ -339,6 +340,105 @@ export async function createMcpServer(sessionManager) {
339
340
  return errorContent(err instanceof Error ? err.message : String(err));
340
341
  }
341
342
  });
343
+ // -----------------------------------------------------------------------
344
+ // secure_env_collect — collect secrets via MCP form elicitation
345
+ // -----------------------------------------------------------------------
346
+ server.tool('secure_env_collect', 'Collect environment variables securely via form input. Values are written directly to .env (or Vercel/Convex) and NEVER appear in tool output — only key names and applied/skipped status are returned. Use this instead of asking users to manually edit .env files or paste secrets into chat.', {
347
+ projectDir: z.string().describe('Absolute path to the project directory'),
348
+ keys: z.array(z.object({
349
+ key: z.string().describe('Env var name, e.g. OPENAI_API_KEY'),
350
+ hint: z.string().optional().describe('Format hint shown to user, e.g. "starts with sk-"'),
351
+ guidance: z.array(z.string()).optional().describe('Step-by-step instructions for obtaining this key'),
352
+ })).min(1).describe('Environment variables to collect'),
353
+ destination: z.enum(['dotenv', 'vercel', 'convex']).optional().describe('Where to write secrets. Auto-detected from project files if omitted.'),
354
+ envFilePath: z.string().optional().describe('Path to .env file (dotenv only). Defaults to .env in projectDir.'),
355
+ environment: z.enum(['development', 'preview', 'production']).optional().describe('Target environment (vercel/convex only)'),
356
+ }, async (args) => {
357
+ const { projectDir, keys, destination, envFilePath, environment } = args;
358
+ try {
359
+ const resolvedProjectDir = resolve(projectDir);
360
+ const resolvedEnvPath = resolve(resolvedProjectDir, envFilePath ?? '.env');
361
+ // (1) Check which keys already exist
362
+ const allKeyNames = keys.map((k) => k.key);
363
+ const existingKeys = await checkExistingEnvKeys(allKeyNames, resolvedEnvPath);
364
+ const existingSet = new Set(existingKeys);
365
+ const pendingKeys = keys.filter((k) => !existingSet.has(k.key));
366
+ // If all keys already exist, return immediately
367
+ if (pendingKeys.length === 0) {
368
+ const lines = existingKeys.map((k) => `• ${k}: already set`);
369
+ return textContent(`All ${existingKeys.length} key(s) already set.\n${lines.join('\n')}`);
370
+ }
371
+ // (2) Build elicitation form — one string field per pending key
372
+ const properties = {};
373
+ const required = [];
374
+ for (const item of pendingKeys) {
375
+ const descParts = [];
376
+ if (item.hint)
377
+ descParts.push(`Format: ${item.hint}`);
378
+ if (item.guidance && item.guidance.length > 0) {
379
+ descParts.push('How to get this:');
380
+ item.guidance.forEach((step, i) => descParts.push(`${i + 1}. ${step}`));
381
+ }
382
+ descParts.push('Leave empty to skip.');
383
+ properties[item.key] = {
384
+ type: 'string',
385
+ title: item.key,
386
+ description: descParts.join('\n'),
387
+ };
388
+ // Don't mark as required — empty string = skip
389
+ }
390
+ // (3) Elicit input from the MCP client
391
+ const elicitation = await server.server.elicitInput({
392
+ message: `Enter values for ${pendingKeys.length} environment variable(s). Values are written directly to the project and never shown to the AI.`,
393
+ requestedSchema: {
394
+ type: 'object',
395
+ properties,
396
+ required,
397
+ },
398
+ });
399
+ if (elicitation.action !== 'accept' || !elicitation.content) {
400
+ return textContent('secure_env_collect was cancelled by user.');
401
+ }
402
+ // (4) Separate provided vs skipped from form response
403
+ const provided = [];
404
+ const skipped = [];
405
+ for (const item of pendingKeys) {
406
+ const raw = elicitation.content[item.key];
407
+ const value = typeof raw === 'string' ? raw.trim() : '';
408
+ if (value.length > 0) {
409
+ provided.push({ key: item.key, value });
410
+ }
411
+ else {
412
+ skipped.push(item.key);
413
+ }
414
+ }
415
+ // (5) Auto-detect destination if not specified
416
+ const resolvedDestination = destination ?? detectDestination(resolvedProjectDir);
417
+ // (6) Write secrets to destination
418
+ const { applied, errors } = await applySecrets(provided, resolvedDestination, {
419
+ envFilePath: resolvedEnvPath,
420
+ environment,
421
+ });
422
+ // (7) Build result — NEVER include secret values
423
+ const lines = [
424
+ `destination: ${resolvedDestination}${!destination ? ' (auto-detected)' : ''}${environment ? ` (${environment})` : ''}`,
425
+ ];
426
+ for (const k of applied)
427
+ lines.push(`✓ ${k}: applied`);
428
+ for (const k of skipped)
429
+ lines.push(`• ${k}: skipped`);
430
+ for (const k of existingKeys)
431
+ lines.push(`• ${k}: already set`);
432
+ for (const e of errors)
433
+ lines.push(`✗ ${e}`);
434
+ return errors.length > 0 && applied.length === 0
435
+ ? errorContent(lines.join('\n'))
436
+ : textContent(lines.join('\n'));
437
+ }
438
+ catch (err) {
439
+ return errorContent(err instanceof Error ? err.message : String(err));
440
+ }
441
+ });
342
442
  // =======================================================================
343
443
  // READ-ONLY TOOLS — no session required, pure filesystem reads
344
444
  // =======================================================================