mirror of
https://github.com/aljazceru/opencode.git
synced 2025-12-24 03:04:21 +01:00
wip: cloud
This commit is contained in:
30
bun.lock
30
bun.lock
@@ -8,7 +8,7 @@
|
|||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"prettier": "3.5.3",
|
"prettier": "3.5.3",
|
||||||
"sst": "3.17.11",
|
"sst": "3.17.12",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
"cloud/app": {
|
"cloud/app": {
|
||||||
@@ -495,7 +495,7 @@
|
|||||||
|
|
||||||
"@hey-api/json-schema-ref-parser": ["@hey-api/json-schema-ref-parser@1.0.6", "", { "dependencies": { "@jsdevtools/ono": "^7.1.3", "@types/json-schema": "^7.0.15", "js-yaml": "^4.1.0", "lodash": "^4.17.21" } }, "sha512-yktiFZoWPtEW8QKS65eqKwA5MTKp88CyiL8q72WynrBs/73SAaxlSWlA2zW/DZlywZ5hX1OYzrCC0wFdvO9c2w=="],
|
"@hey-api/json-schema-ref-parser": ["@hey-api/json-schema-ref-parser@1.0.6", "", { "dependencies": { "@jsdevtools/ono": "^7.1.3", "@types/json-schema": "^7.0.15", "js-yaml": "^4.1.0", "lodash": "^4.17.21" } }, "sha512-yktiFZoWPtEW8QKS65eqKwA5MTKp88CyiL8q72WynrBs/73SAaxlSWlA2zW/DZlywZ5hX1OYzrCC0wFdvO9c2w=="],
|
||||||
|
|
||||||
"@hey-api/openapi-ts": ["@hey-api/openapi-ts@0.80.1", "", { "dependencies": { "@hey-api/json-schema-ref-parser": "1.0.6", "ansi-colors": "4.1.3", "c12": "2.0.1", "color-support": "1.1.3", "commander": "13.0.0", "handlebars": "4.7.8", "open": "10.1.2", "semver": "7.7.2" }, "peerDependencies": { "typescript": "^5.5.3" }, "bin": { "openapi-ts": "bin/index.cjs" } }, "sha512-AC478kg36vmmrseLZNFonZ/cmXXmDzW5yWz4PVg1S8ebJsRtVRJ/QU+mtnXfzf9avN2P0pz/AO4WAe4jyFY2gA=="],
|
"@hey-api/openapi-ts": ["@hey-api/openapi-ts@0.81.0", "", { "dependencies": { "@hey-api/json-schema-ref-parser": "1.0.6", "ansi-colors": "4.1.3", "c12": "2.0.1", "color-support": "1.1.3", "commander": "13.0.0", "handlebars": "4.7.8", "js-yaml": "4.1.0", "open": "10.1.2", "semver": "7.7.2" }, "peerDependencies": { "typescript": "^5.5.3" }, "bin": { "openapi-ts": "bin/index.cjs" } }, "sha512-PoJukNBkUfHOoMDpN33bBETX49TUhy7Hu8Sa0jslOvFndvZ5VjQr4Nl/Dzjb9LG1Lp5HjybyTJMA6a1zYk/q6A=="],
|
||||||
|
|
||||||
"@hono/zod-validator": ["@hono/zod-validator@0.4.2", "", { "peerDependencies": { "hono": ">=3.9.0", "zod": "^3.19.1" } }, "sha512-1rrlBg+EpDPhzOV4hT9pxr5+xDVmKuz6YJl+la7VCwK6ass5ldyKm5fD+umJdV2zhHD6jROoCCv8NbTwyfhT0g=="],
|
"@hono/zod-validator": ["@hono/zod-validator@0.4.2", "", { "peerDependencies": { "hono": ">=3.9.0", "zod": "^3.19.1" } }, "sha512-1rrlBg+EpDPhzOV4hT9pxr5+xDVmKuz6YJl+la7VCwK6ass5ldyKm5fD+umJdV2zhHD6jROoCCv8NbTwyfhT0g=="],
|
||||||
|
|
||||||
@@ -1531,7 +1531,7 @@
|
|||||||
|
|
||||||
"end-of-stream": ["end-of-stream@1.4.5", "", { "dependencies": { "once": "^1.4.0" } }, "sha512-ooEGc6HP26xXq/N+GCGOT0JKCLDGrq2bQUZrQ7gyrJiZANJ/8YDTxTpQBXGMn+WbIQXNVpyWymm7KYVICQnyOg=="],
|
"end-of-stream": ["end-of-stream@1.4.5", "", { "dependencies": { "once": "^1.4.0" } }, "sha512-ooEGc6HP26xXq/N+GCGOT0JKCLDGrq2bQUZrQ7gyrJiZANJ/8YDTxTpQBXGMn+WbIQXNVpyWymm7KYVICQnyOg=="],
|
||||||
|
|
||||||
"entities": ["entities@6.0.1", "", {}, "sha512-aN97NXWF6AWBTahfVOIrB/NShkzi5H7F9r1s9mD3cDj4Ko5f2qhhVoYMibXF7GlLveb/D2ioWay8lxI97Ven3g=="],
|
"entities": ["entities@4.5.0", "", {}, "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw=="],
|
||||||
|
|
||||||
"env-paths": ["env-paths@3.0.0", "", {}, "sha512-dtJUTepzMW3Lm/NPxRf3wP4642UWhjL2sQxc+ym2YMj1m/H2zDNQOlezafzkHwn6sMstjHTwG6iQQsctDW/b1A=="],
|
"env-paths": ["env-paths@3.0.0", "", {}, "sha512-dtJUTepzMW3Lm/NPxRf3wP4642UWhjL2sQxc+ym2YMj1m/H2zDNQOlezafzkHwn6sMstjHTwG6iQQsctDW/b1A=="],
|
||||||
|
|
||||||
@@ -2675,23 +2675,23 @@
|
|||||||
|
|
||||||
"ssri": ["ssri@10.0.6", "", { "dependencies": { "minipass": "^7.0.3" } }, "sha512-MGrFH9Z4NP9Iyhqn16sDtBpRRNJ0Y2hNa6D65h736fVSaPCHr4DM4sWUNvVaSuC+0OBGhwsrydQwmgfg5LncqQ=="],
|
"ssri": ["ssri@10.0.6", "", { "dependencies": { "minipass": "^7.0.3" } }, "sha512-MGrFH9Z4NP9Iyhqn16sDtBpRRNJ0Y2hNa6D65h736fVSaPCHr4DM4sWUNvVaSuC+0OBGhwsrydQwmgfg5LncqQ=="],
|
||||||
|
|
||||||
"sst": ["sst@3.17.11", "", { "dependencies": { "aws-sdk": "2.1692.0", "aws4fetch": "1.0.18", "jose": "5.2.3", "opencontrol": "0.0.6", "openid-client": "5.6.4" }, "optionalDependencies": { "sst-darwin-arm64": "3.17.11", "sst-darwin-x64": "3.17.11", "sst-linux-arm64": "3.17.11", "sst-linux-x64": "3.17.11", "sst-linux-x86": "3.17.11", "sst-win32-arm64": "3.17.11", "sst-win32-x64": "3.17.11", "sst-win32-x86": "3.17.11" }, "bin": { "sst": "bin/sst.mjs" } }, "sha512-Hwl14L55ZmgAX2ZtBSBoe5BpClSlZ/LNPgB/yqQpX2eaWME5dmW+Qmrm1HHGLft8JD85pJd6P2i7wuFkMrS/qA=="],
|
"sst": ["sst@3.17.12", "", { "dependencies": { "aws-sdk": "2.1692.0", "aws4fetch": "1.0.18", "jose": "5.2.3", "opencontrol": "0.0.6", "openid-client": "5.6.4" }, "optionalDependencies": { "sst-darwin-arm64": "3.17.12", "sst-darwin-x64": "3.17.12", "sst-linux-arm64": "3.17.12", "sst-linux-x64": "3.17.12", "sst-linux-x86": "3.17.12", "sst-win32-arm64": "3.17.12", "sst-win32-x64": "3.17.12", "sst-win32-x86": "3.17.12" }, "bin": { "sst": "bin/sst.mjs" } }, "sha512-UwUbucNZRLp9GHgPAwkat1sBsNGaJfHsLXZHCMKsolCW7CEuugJfvBl2vOyJrhKP4N+Xnv1QFh0BGsOmN0kQeA=="],
|
||||||
|
|
||||||
"sst-darwin-arm64": ["sst-darwin-arm64@3.17.11", "", { "os": "darwin", "cpu": "arm64" }, "sha512-c3A0MIJ+fb2T6gjUvDvt3Pakx9QSqJduO3gb48kVlE0NPApTau16CXzEyyoVKZNFxGFakuGUjFtTJfrfmTiwbA=="],
|
"sst-darwin-arm64": ["sst-darwin-arm64@3.17.12", "", { "os": "darwin", "cpu": "arm64" }, "sha512-9Oky2ZmJoeEN97ALWtFRt3kvSIZLjYoQoOtJvTaNQJTFi/9OsUE/6I5zdedf5GhMKCT1JvY+Ngpv3U3Y6SEYOg=="],
|
||||||
|
|
||||||
"sst-darwin-x64": ["sst-darwin-x64@3.17.11", "", { "os": "darwin", "cpu": "x64" }, "sha512-ctKPvmN4E52sN23EpTcuDQPXYkic8iY9Piy6b3ie9g1voPxs0h36XrRIckbYq5enSeby2Gk4BeI7OaZlj8B90A=="],
|
"sst-darwin-x64": ["sst-darwin-x64@3.17.12", "", { "os": "darwin", "cpu": "x64" }, "sha512-n6tWCjFF9Pb+QzxXJmuTGfQ4GW96Nf6ATtb7Wpa+9RDLRHrEBdOjXAp7osr7MB9djPRkt4942nwUZ7wX/EULpg=="],
|
||||||
|
|
||||||
"sst-linux-arm64": ["sst-linux-arm64@3.17.11", "", { "os": "linux", "cpu": "arm64" }, "sha512-LdXpUDT5A5g6W0YkON15ySwmTDMbhXkbVxCk6YqB4eus5iEL4pniV/qImPsHcl5od2bWbPosjeDFLnGogxwPLA=="],
|
"sst-linux-arm64": ["sst-linux-arm64@3.17.12", "", { "os": "linux", "cpu": "arm64" }, "sha512-iMflBzQWhF5kmRdXu402dwVpQI9LfFR3yFok3HUTV0ema5Pq2kPphEatEEw1dyG2ZXCBLeKN+T3Ujjfer+ddRA=="],
|
||||||
|
|
||||||
"sst-linux-x64": ["sst-linux-x64@3.17.11", "", { "os": "linux", "cpu": "x64" }, "sha512-UU7ZK4qlb19Bc6G3Tj8BL0lYhKRBkdVul3gsCHc8D07gjHrDYP1JZcRPteq/Ij7zLlLBzNilwhpBNhDcRqJ2BA=="],
|
"sst-linux-x64": ["sst-linux-x64@3.17.12", "", { "os": "linux", "cpu": "x64" }, "sha512-89rZXs3IfGrY9yiDNuLfcJvHnAUX1gRVeB+lqQ1M2sbJD2iMpN+fx93owcApAndtZYzYNfQYEZ/xYwI6HFfu4w=="],
|
||||||
|
|
||||||
"sst-linux-x86": ["sst-linux-x86@3.17.11", "", { "os": "linux", "cpu": "none" }, "sha512-q/Y+trzKVT9pc/kIYkgnISQqv69y/6T6IM1/fBgq3ZWbb9TBpLrW848vFS0PThH23QrcuV1U+2e6a9IgU67LHg=="],
|
"sst-linux-x86": ["sst-linux-x86@3.17.12", "", { "os": "linux", "cpu": "none" }, "sha512-Zc2nd2syaq/DfNxtDcn4NOh8RBCaCZ1qsjLFpvGGfMMRnGiWjofuE6eFX3fhchGL3uvaqwlENvtzj4UC/MF5wQ=="],
|
||||||
|
|
||||||
"sst-win32-arm64": ["sst-win32-arm64@3.17.11", "", { "os": "win32", "cpu": "arm64" }, "sha512-lTIepV7/0GqUTbpTIAYs3KZegRzvb+xYEwkJwEFL7eCKKUGnrGPo13858PHeKmYdGRWa4tbeOsviRYaoXrWCDw=="],
|
"sst-win32-arm64": ["sst-win32-arm64@3.17.12", "", { "os": "win32", "cpu": "arm64" }, "sha512-Bb7M6PoImmGeyzJu75QbNHBs0mDp21DsKFyMucn2dwxYwahuFPjjMbG+tlziWtxcNgdZMdEcy9jR8ot1jAIh0Q=="],
|
||||||
|
|
||||||
"sst-win32-x64": ["sst-win32-x64@3.17.11", "", { "os": "win32", "cpu": "x64" }, "sha512-CLZTwqRDUGWShaR02Nd1VMGG9G/a50NY0rjh/WopaTFj2SoEot/vZil4LkVWqma4rOdNX+ABJ4//O92VQSHkQQ=="],
|
"sst-win32-x64": ["sst-win32-x64@3.17.12", "", { "os": "win32", "cpu": "x64" }, "sha512-7f41o1WhxdcuLhHijoavkX5O3L/Pnma6zCoL3kG6f9Njc6Zyj8Oha2fQz6Tesb/Qt8deG04WU4bL3FmxgNHU6g=="],
|
||||||
|
|
||||||
"sst-win32-x86": ["sst-win32-x86@3.17.11", "", { "os": "win32", "cpu": "none" }, "sha512-KQKeU/6m7AUu9LFg71wMn6612aY+ZHwmUsTRdGPOt6zDr1oGJAFUy8lXtbqx6txpdKgDzixHDT6aLXvnf9DR0Q=="],
|
"sst-win32-x86": ["sst-win32-x86@3.17.12", "", { "os": "win32", "cpu": "none" }, "sha512-AfsNJQMTlefHitaVRWh5Uf3AaICIaomFbSo5qDbibgkvhbppCxgMFpW0IxiWySjWrCN5hMMkxdxlZP9IHqqxjQ=="],
|
||||||
|
|
||||||
"stack-trace": ["stack-trace@0.0.10", "", {}, "sha512-KGzahc7puUKkzyMt+IqAep+TVNbKP+k2Lmwhub39m1AsTSkaDutx56aDCo+HLDzf/D26BIHTJWNiTG1KAJiQCg=="],
|
"stack-trace": ["stack-trace@0.0.10", "", {}, "sha512-KGzahc7puUKkzyMt+IqAep+TVNbKP+k2Lmwhub39m1AsTSkaDutx56aDCo+HLDzf/D26BIHTJWNiTG1KAJiQCg=="],
|
||||||
|
|
||||||
@@ -3117,8 +3117,6 @@
|
|||||||
|
|
||||||
"@openauthjs/solid/@openauthjs/openauth": ["@openauthjs/openauth@0.4.2", "", { "dependencies": { "@standard-schema/spec": "1.0.0-beta.3", "aws4fetch": "1.0.20", "jose": "5.9.6" }, "peerDependencies": { "arctic": "^2.2.2", "hono": "^4.0.0" } }, "sha512-8+Bia559iffrZXfQ0LWXrVVVriochS88pDtB8indyQ1S+40MQgDBu8aBzKt+fgSrTmoQGCTT+wlOXgbjc9qIcw=="],
|
"@openauthjs/solid/@openauthjs/openauth": ["@openauthjs/openauth@0.4.2", "", { "dependencies": { "@standard-schema/spec": "1.0.0-beta.3", "aws4fetch": "1.0.20", "jose": "5.9.6" }, "peerDependencies": { "arctic": "^2.2.2", "hono": "^4.0.0" } }, "sha512-8+Bia559iffrZXfQ0LWXrVVVriochS88pDtB8indyQ1S+40MQgDBu8aBzKt+fgSrTmoQGCTT+wlOXgbjc9qIcw=="],
|
||||||
|
|
||||||
"@opencode-ai/sdk/@hey-api/openapi-ts": ["@hey-api/openapi-ts@0.81.0", "", { "dependencies": { "@hey-api/json-schema-ref-parser": "1.0.6", "ansi-colors": "4.1.3", "c12": "2.0.1", "color-support": "1.1.3", "commander": "13.0.0", "handlebars": "4.7.8", "js-yaml": "4.1.0", "open": "10.1.2", "semver": "7.7.2" }, "peerDependencies": { "typescript": "^5.5.3" }, "bin": { "openapi-ts": "bin/index.cjs" } }, "sha512-PoJukNBkUfHOoMDpN33bBETX49TUhy7Hu8Sa0jslOvFndvZ5VjQr4Nl/Dzjb9LG1Lp5HjybyTJMA6a1zYk/q6A=="],
|
|
||||||
|
|
||||||
"@opentelemetry/instrumentation-grpc/@opentelemetry/semantic-conventions": ["@opentelemetry/semantic-conventions@1.27.0", "", {}, "sha512-sAay1RrB+ONOem0OZanAR1ZI/k7yDpnOQSQmTMuGImUQb2y8EbSaCJ94FQluM74xoU03vlb2d2U90hZluL6nQg=="],
|
"@opentelemetry/instrumentation-grpc/@opentelemetry/semantic-conventions": ["@opentelemetry/semantic-conventions@1.27.0", "", {}, "sha512-sAay1RrB+ONOem0OZanAR1ZI/k7yDpnOQSQmTMuGImUQb2y8EbSaCJ94FQluM74xoU03vlb2d2U90hZluL6nQg=="],
|
||||||
|
|
||||||
"@oslojs/jwt/@oslojs/encoding": ["@oslojs/encoding@0.4.1", "", {}, "sha512-hkjo6MuIK/kQR5CrGNdAPZhS01ZCXuWDRJ187zh6qqF2+yMHZpD9fAYpX8q2bOO6Ryhl3XpCT6kUX76N8hhm4Q=="],
|
"@oslojs/jwt/@oslojs/encoding": ["@oslojs/encoding@0.4.1", "", {}, "sha512-hkjo6MuIK/kQR5CrGNdAPZhS01ZCXuWDRJ187zh6qqF2+yMHZpD9fAYpX8q2bOO6Ryhl3XpCT6kUX76N8hhm4Q=="],
|
||||||
@@ -3161,8 +3159,6 @@
|
|||||||
|
|
||||||
"@vinxi/server-components/magicast": ["magicast@0.2.11", "", { "dependencies": { "@babel/parser": "^7.22.16", "@babel/types": "^7.22.17", "recast": "^0.23.4" } }, "sha512-6saXbRDA1HMkqbsvHOU6HBjCVgZT460qheRkLhJQHWAbhXoWESI3Kn/dGGXyKs15FFKR85jsUqFx2sMK0wy/5g=="],
|
"@vinxi/server-components/magicast": ["magicast@0.2.11", "", { "dependencies": { "@babel/parser": "^7.22.16", "@babel/types": "^7.22.17", "recast": "^0.23.4" } }, "sha512-6saXbRDA1HMkqbsvHOU6HBjCVgZT460qheRkLhJQHWAbhXoWESI3Kn/dGGXyKs15FFKR85jsUqFx2sMK0wy/5g=="],
|
||||||
|
|
||||||
"@vue/compiler-core/entities": ["entities@4.5.0", "", {}, "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw=="],
|
|
||||||
|
|
||||||
"@vue/compiler-core/estree-walker": ["estree-walker@2.0.2", "", {}, "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w=="],
|
"@vue/compiler-core/estree-walker": ["estree-walker@2.0.2", "", {}, "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w=="],
|
||||||
|
|
||||||
"@vue/compiler-sfc/estree-walker": ["estree-walker@2.0.2", "", {}, "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w=="],
|
"@vue/compiler-sfc/estree-walker": ["estree-walker@2.0.2", "", {}, "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w=="],
|
||||||
@@ -3309,6 +3305,8 @@
|
|||||||
|
|
||||||
"parse-json/@babel/code-frame": ["@babel/code-frame@7.27.1", "", { "dependencies": { "@babel/helper-validator-identifier": "^7.27.1", "js-tokens": "^4.0.0", "picocolors": "^1.1.1" } }, "sha512-cjQ7ZlQ0Mv3b47hABuTevyTuYN4i+loJKGeV9flcCgIK37cCXRh+L1bd3iBHlynerhQ7BhCkn2BPbQUL+rGqFg=="],
|
"parse-json/@babel/code-frame": ["@babel/code-frame@7.27.1", "", { "dependencies": { "@babel/helper-validator-identifier": "^7.27.1", "js-tokens": "^4.0.0", "picocolors": "^1.1.1" } }, "sha512-cjQ7ZlQ0Mv3b47hABuTevyTuYN4i+loJKGeV9flcCgIK37cCXRh+L1bd3iBHlynerhQ7BhCkn2BPbQUL+rGqFg=="],
|
||||||
|
|
||||||
|
"parse5/entities": ["entities@6.0.1", "", {}, "sha512-aN97NXWF6AWBTahfVOIrB/NShkzi5H7F9r1s9mD3cDj4Ko5f2qhhVoYMibXF7GlLveb/D2ioWay8lxI97Ven3g=="],
|
||||||
|
|
||||||
"path-scurry/lru-cache": ["lru-cache@10.4.3", "", {}, "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ=="],
|
"path-scurry/lru-cache": ["lru-cache@10.4.3", "", {}, "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ=="],
|
||||||
|
|
||||||
"pkg-types/pathe": ["pathe@2.0.3", "", {}, "sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w=="],
|
"pkg-types/pathe": ["pathe@2.0.3", "", {}, "sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w=="],
|
||||||
|
|||||||
@@ -5,5 +5,18 @@ export default defineConfig({
|
|||||||
server: {
|
server: {
|
||||||
allowedHosts: true,
|
allowedHosts: true,
|
||||||
},
|
},
|
||||||
|
build: {
|
||||||
|
rollupOptions: {
|
||||||
|
external: ["cloudflare:workers"],
|
||||||
|
},
|
||||||
|
minify: false,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
server: {
|
||||||
|
compatibilityDate: "2024-09-19",
|
||||||
|
preset: "cloudflare_module",
|
||||||
|
cloudflare: {
|
||||||
|
nodeCompat: true,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|||||||
1
cloud/app/src/global.d.ts
vendored
1
cloud/app/src/global.d.ts
vendored
@@ -1 +1,2 @@
|
|||||||
/// <reference types="@solidjs/start/env" />
|
/// <reference types="@solidjs/start/env" />
|
||||||
|
declare module "cloudflare:workers"
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import { redirect } from "@solidjs/router"
|
import { redirect } from "@solidjs/router"
|
||||||
import type { APIEvent } from "@solidjs/start/server"
|
import type { APIEvent } from "@solidjs/start/server"
|
||||||
import { AuthClient, useAuthSession } from "~/context/auth"
|
import { AuthClient } from "~/context/auth"
|
||||||
|
import { useAuthSession } from "~/context/auth.session"
|
||||||
|
|
||||||
export async function GET(input: APIEvent) {
|
export async function GET(input: APIEvent) {
|
||||||
const url = new URL(input.request.url)
|
const url = new URL(input.request.url)
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { Resource } from "sst"
|
import { Resource } from "@opencode/cloud-core/util/resource.js"
|
||||||
import { Billing } from "@opencode/cloud-core/billing.js"
|
import { Billing } from "@opencode/cloud-core/billing.js"
|
||||||
import type { APIEvent } from "@solidjs/start/server"
|
import type { APIEvent } from "@solidjs/start/server"
|
||||||
import { Database, eq, sql } from "@opencode/cloud-core/drizzle/index.js"
|
import { Database, eq, sql } from "@opencode/cloud-core/drizzle/index.js"
|
||||||
|
|||||||
@@ -31,8 +31,6 @@ const isLoggedIn = query(async () => {
|
|||||||
return false
|
return false
|
||||||
}, "isLoggedIn")
|
}, "isLoggedIn")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
export default function Home() {
|
export default function Home() {
|
||||||
createAsync(() => isLoggedIn(), {
|
createAsync(() => isLoggedIn(), {
|
||||||
deferStream: true,
|
deferStream: true,
|
||||||
@@ -83,7 +81,9 @@ export default function Home() {
|
|||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div data-slot="right">
|
<div data-slot="right">
|
||||||
<a href="/auth/authorize" target="_self">Login</a>
|
<a href="/auth/authorize" target="_self">
|
||||||
|
Login
|
||||||
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
import { Resource } from "sst"
|
|
||||||
import { Billing } from "@opencode/cloud-core/billing.js"
|
import { Billing } from "@opencode/cloud-core/billing.js"
|
||||||
import type { APIEvent } from "@solidjs/start/server"
|
import type { APIEvent } from "@solidjs/start/server"
|
||||||
import { Database, eq, sql } from "@opencode/cloud-core/drizzle/index.js"
|
import { Database, eq, sql } from "@opencode/cloud-core/drizzle/index.js"
|
||||||
@@ -6,6 +5,7 @@ import { BillingTable, PaymentTable } from "@opencode/cloud-core/schema/billing.
|
|||||||
import { Identifier } from "@opencode/cloud-core/identifier.js"
|
import { Identifier } from "@opencode/cloud-core/identifier.js"
|
||||||
import { centsToMicroCents } from "@opencode/cloud-core/util/price.js"
|
import { centsToMicroCents } from "@opencode/cloud-core/util/price.js"
|
||||||
import { Actor } from "@opencode/cloud-core/actor.js"
|
import { Actor } from "@opencode/cloud-core/actor.js"
|
||||||
|
import { Resource } from "@opencode/cloud-core/util/resource.js"
|
||||||
|
|
||||||
export async function POST(input: APIEvent) {
|
export async function POST(input: APIEvent) {
|
||||||
const body = await Billing.stripe().webhooks.constructEventAsync(
|
const body = await Billing.stripe().webhooks.constructEventAsync(
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { defineConfig } from "drizzle-kit"
|
import { defineConfig } from "drizzle-kit"
|
||||||
import { Resource } from "sst"
|
import { Resource } from "./src/util/resource"
|
||||||
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
out: "./migrations/",
|
out: "./migrations/",
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
import { Resource } from "sst"
|
|
||||||
import { Stripe } from "stripe"
|
import { Stripe } from "stripe"
|
||||||
import { Database, eq, sql } from "./drizzle"
|
import { Database, eq, sql } from "./drizzle"
|
||||||
import { BillingTable, PaymentTable, UsageTable } from "./schema/billing.sql"
|
import { BillingTable, PaymentTable, UsageTable } from "./schema/billing.sql"
|
||||||
@@ -8,6 +7,7 @@ import { z } from "zod"
|
|||||||
import { Identifier } from "./identifier"
|
import { Identifier } from "./identifier"
|
||||||
import { centsToMicroCents } from "./util/price"
|
import { centsToMicroCents } from "./util/price"
|
||||||
import { User } from "./user"
|
import { User } from "./user"
|
||||||
|
import { Resource } from "./util/resource"
|
||||||
|
|
||||||
export namespace Billing {
|
export namespace Billing {
|
||||||
export const stripe = () =>
|
export const stripe = () =>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { drizzle } from "drizzle-orm/postgres-js"
|
import { drizzle } from "drizzle-orm/postgres-js"
|
||||||
import { Resource } from "sst"
|
import { Resource } from "../util/resource"
|
||||||
export * from "drizzle-orm"
|
export * from "drizzle-orm"
|
||||||
import postgres from "postgres"
|
import postgres from "postgres"
|
||||||
|
|
||||||
|
|||||||
14
cloud/core/src/util/resource.ts
Normal file
14
cloud/core/src/util/resource.ts
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
import { env } from "cloudflare:workers";
|
||||||
|
|
||||||
|
export const Resource = new Proxy(
|
||||||
|
{},
|
||||||
|
{
|
||||||
|
get(_target, prop: string) {
|
||||||
|
if (prop in env) {
|
||||||
|
const value = env[prop];
|
||||||
|
return typeof value === "string" ? JSON.parse(value) : value;
|
||||||
|
}
|
||||||
|
throw new Error(`"${prop}" is not linked in your sst.config.ts`);
|
||||||
|
},
|
||||||
|
}
|
||||||
|
) as Record<string, any>;
|
||||||
@@ -1,4 +1,3 @@
|
|||||||
import { Resource } from "sst"
|
|
||||||
import { z } from "zod"
|
import { z } from "zod"
|
||||||
import { issuer } from "@openauthjs/openauth"
|
import { issuer } from "@openauthjs/openauth"
|
||||||
import type { Theme } from "@openauthjs/openauth/ui/theme"
|
import type { Theme } from "@openauthjs/openauth/ui/theme"
|
||||||
@@ -10,6 +9,7 @@ import { CloudflareStorage } from "@openauthjs/openauth/storage/cloudflare"
|
|||||||
import { Account } from "@opencode/cloud-core/account.js"
|
import { Account } from "@opencode/cloud-core/account.js"
|
||||||
import { Workspace } from "@opencode/cloud-core/workspace.js"
|
import { Workspace } from "@opencode/cloud-core/workspace.js"
|
||||||
import { Actor } from "@opencode/cloud-core/actor.js"
|
import { Actor } from "@opencode/cloud-core/actor.js"
|
||||||
|
import { Resource } from "@opencode/cloud-core/util/resource.js"
|
||||||
|
|
||||||
type Env = {
|
type Env = {
|
||||||
AuthStorage: KVNamespace
|
AuthStorage: KVNamespace
|
||||||
@@ -28,8 +28,8 @@ export const subjects = createSubjects({
|
|||||||
|
|
||||||
const MY_THEME: Theme = {
|
const MY_THEME: Theme = {
|
||||||
...THEME_OPENAUTH,
|
...THEME_OPENAUTH,
|
||||||
logo: "https://opencode.ai/favicon.svg"
|
logo: "https://opencode.ai/favicon.svg",
|
||||||
};
|
}
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
async fetch(request: Request, env: Env, ctx: ExecutionContext) {
|
async fetch(request: Request, env: Env, ctx: ExecutionContext) {
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import { Hono, MiddlewareHandler } from "hono"
|
|||||||
import { cors } from "hono/cors"
|
import { cors } from "hono/cors"
|
||||||
import { HTTPException } from "hono/http-exception"
|
import { HTTPException } from "hono/http-exception"
|
||||||
import { zValidator } from "@hono/zod-validator"
|
import { zValidator } from "@hono/zod-validator"
|
||||||
import { Resource } from "sst"
|
import { Resource } from "@opencode/cloud-core/util/resource.js"
|
||||||
import { type ProviderMetadata, type LanguageModelUsage, generateText, streamText } from "ai"
|
import { type ProviderMetadata, type LanguageModelUsage, generateText, streamText } from "ai"
|
||||||
import { createAnthropic } from "@ai-sdk/anthropic"
|
import { createAnthropic } from "@ai-sdk/anthropic"
|
||||||
import { createOpenAI } from "@ai-sdk/openai"
|
import { createOpenAI } from "@ai-sdk/openai"
|
||||||
|
|||||||
4
cloud/function/sst-env.d.ts
vendored
4
cloud/function/sst-env.d.ts
vendored
@@ -14,6 +14,10 @@ declare module "sst" {
|
|||||||
"type": "sst.sst.Linkable"
|
"type": "sst.sst.Linkable"
|
||||||
"value": string
|
"value": string
|
||||||
}
|
}
|
||||||
|
"Console": {
|
||||||
|
"type": "sst.cloudflare.SolidStart"
|
||||||
|
"url": string
|
||||||
|
}
|
||||||
"DATABASE_PASSWORD": {
|
"DATABASE_PASSWORD": {
|
||||||
"type": "sst.sst.Secret"
|
"type": "sst.sst.Secret"
|
||||||
"value": string
|
"value": string
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import { WebhookEndpoint } from "pulumi-stripe"
|
import { WebhookEndpoint } from "pulumi-stripe"
|
||||||
import { domain } from "./stage"
|
import { domain } from "./stage"
|
||||||
import { web } from "./app"
|
|
||||||
|
|
||||||
////////////////
|
////////////////
|
||||||
// DATABASE
|
// DATABASE
|
||||||
@@ -106,23 +105,9 @@ export const gateway = new sst.cloudflare.Worker("GatewayApi", {
|
|||||||
// CONSOLE
|
// CONSOLE
|
||||||
////////////////
|
////////////////
|
||||||
|
|
||||||
/*
|
export const console = new sst.cloudflare.x.SolidStart("Console", {
|
||||||
export const console = new sst.cloudflare.x.StaticSite("Console", {
|
|
||||||
domain: `console.${domain}`,
|
domain: `console.${domain}`,
|
||||||
path: "cloud/web",
|
path: "cloud/app",
|
||||||
build: {
|
|
||||||
command: "bun run build",
|
|
||||||
output: "dist/client",
|
|
||||||
},
|
|
||||||
environment: {
|
|
||||||
VITE_DOCS_URL: web.url.apply((url) => url!),
|
|
||||||
VITE_API_URL: gateway.url.apply((url) => url!),
|
|
||||||
VITE_AUTH_URL: auth.url.apply((url) => url!),
|
|
||||||
},
|
|
||||||
})
|
|
||||||
*/
|
|
||||||
|
|
||||||
new sst.x.DevCommand("Solid", {
|
|
||||||
link: [
|
link: [
|
||||||
database,
|
database,
|
||||||
AUTH_API_URL,
|
AUTH_API_URL,
|
||||||
@@ -132,11 +117,19 @@ new sst.x.DevCommand("Solid", {
|
|||||||
OPENAI_API_KEY,
|
OPENAI_API_KEY,
|
||||||
ZHIPU_API_KEY,
|
ZHIPU_API_KEY,
|
||||||
],
|
],
|
||||||
dev: {
|
|
||||||
directory: "cloud/app",
|
|
||||||
command: "bun dev",
|
|
||||||
},
|
|
||||||
environment: {
|
environment: {
|
||||||
|
//VITE_DOCS_URL: web.url.apply((url) => url!),
|
||||||
|
//VITE_API_URL: gateway.url.apply((url) => url!),
|
||||||
VITE_AUTH_URL: auth.url.apply((url) => url!),
|
VITE_AUTH_URL: auth.url.apply((url) => url!),
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
//new sst.x.DevCommand("Solid", {
|
||||||
|
// dev: {
|
||||||
|
// directory: "cloud/app",
|
||||||
|
// command: "bun dev",
|
||||||
|
// },
|
||||||
|
// environment: {
|
||||||
|
// VITE_AUTH_URL: auth.url.apply((url) => url!),
|
||||||
|
// },
|
||||||
|
//})
|
||||||
|
|||||||
@@ -33,7 +33,7 @@
|
|||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"prettier": "3.5.3",
|
"prettier": "3.5.3",
|
||||||
"sst": "3.17.11"
|
"sst": "3.17.12"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
|
|||||||
4
packages/function/sst-env.d.ts
vendored
4
packages/function/sst-env.d.ts
vendored
@@ -14,6 +14,10 @@ declare module "sst" {
|
|||||||
"type": "sst.sst.Linkable"
|
"type": "sst.sst.Linkable"
|
||||||
"value": string
|
"value": string
|
||||||
}
|
}
|
||||||
|
"Console": {
|
||||||
|
"type": "sst.cloudflare.SolidStart"
|
||||||
|
"url": string
|
||||||
|
}
|
||||||
"DATABASE_PASSWORD": {
|
"DATABASE_PASSWORD": {
|
||||||
"type": "sst.sst.Secret"
|
"type": "sst.sst.Secret"
|
||||||
"value": string
|
"value": string
|
||||||
|
|||||||
4
sst-env.d.ts
vendored
4
sst-env.d.ts
vendored
@@ -28,6 +28,10 @@ declare module "sst" {
|
|||||||
"name": string
|
"name": string
|
||||||
"type": "sst.cloudflare.Bucket"
|
"type": "sst.cloudflare.Bucket"
|
||||||
}
|
}
|
||||||
|
"Console": {
|
||||||
|
"type": "sst.cloudflare.SolidStart"
|
||||||
|
"url": string
|
||||||
|
}
|
||||||
"DATABASE_PASSWORD": {
|
"DATABASE_PASSWORD": {
|
||||||
"type": "sst.sst.Secret"
|
"type": "sst.sst.Secret"
|
||||||
"value": string
|
"value": string
|
||||||
|
|||||||
Reference in New Issue
Block a user