ontrackd 0.0.1 → 0.11.1
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.
- package/LICENSE +14 -0
- package/README.md +133 -2
- package/dist/cli/build.d.ts +1 -0
- package/dist/cli/build.js +172 -0
- package/dist/cli/build.js.map +1 -0
- package/dist/cli/cloud.d.ts +20 -0
- package/dist/cli/cloud.js +395 -0
- package/dist/cli/cloud.js.map +1 -0
- package/dist/cli/feedback.d.ts +4 -0
- package/dist/cli/feedback.js +90 -0
- package/dist/cli/feedback.js.map +1 -0
- package/dist/cli/hugo.d.ts +1 -0
- package/dist/cli/hugo.js +396 -0
- package/dist/cli/hugo.js.map +1 -0
- package/dist/cli/init.d.ts +8 -0
- package/dist/cli/init.js +346 -0
- package/dist/cli/init.js.map +1 -0
- package/dist/cli/invite.d.ts +2 -0
- package/dist/cli/invite.js +65 -0
- package/dist/cli/invite.js.map +1 -0
- package/dist/cli/link.d.ts +20 -0
- package/dist/cli/link.js +287 -0
- package/dist/cli/link.js.map +1 -0
- package/dist/cli/pull.d.ts +31 -0
- package/dist/cli/pull.js +273 -0
- package/dist/cli/pull.js.map +1 -0
- package/dist/cli/push.d.ts +9 -0
- package/dist/cli/push.js +57 -0
- package/dist/cli/push.js.map +1 -0
- package/dist/cli/remote.d.ts +1 -0
- package/dist/cli/remote.js +114 -0
- package/dist/cli/remote.js.map +1 -0
- package/dist/cli/serve.d.ts +1 -0
- package/dist/cli/serve.js +178 -0
- package/dist/cli/serve.js.map +1 -0
- package/dist/cli/sidecar.d.ts +9 -0
- package/dist/cli/sidecar.js +23 -0
- package/dist/cli/sidecar.js.map +1 -0
- package/dist/core/anchorId.d.ts +42 -0
- package/dist/core/anchorId.js +50 -0
- package/dist/core/anchorId.js.map +1 -0
- package/dist/core/apiKind.d.ts +42 -0
- package/dist/core/apiKind.js +83 -0
- package/dist/core/apiKind.js.map +1 -0
- package/dist/core/astroAnchors.d.ts +39 -0
- package/dist/core/astroAnchors.js +217 -0
- package/dist/core/astroAnchors.js.map +1 -0
- package/dist/core/attachmentTypes.d.ts +74 -0
- package/dist/core/attachmentTypes.js +199 -0
- package/dist/core/attachmentTypes.js.map +1 -0
- package/dist/core/elementHints.d.ts +40 -0
- package/dist/core/elementHints.js +116 -0
- package/dist/core/elementHints.js.map +1 -0
- package/dist/core/exportTaskDoc.d.ts +81 -0
- package/dist/core/exportTaskDoc.js +828 -0
- package/dist/core/exportTaskDoc.js.map +1 -0
- package/dist/core/feedbackTypes.d.ts +241 -0
- package/dist/core/feedbackTypes.js +2 -0
- package/dist/core/feedbackTypes.js.map +1 -0
- package/dist/core/fingerprint.d.ts +12 -0
- package/dist/core/fingerprint.js +24 -0
- package/dist/core/fingerprint.js.map +1 -0
- package/dist/core/htmlAnchors.d.ts +18 -0
- package/dist/core/htmlAnchors.js +157 -0
- package/dist/core/htmlAnchors.js.map +1 -0
- package/dist/core/imageSniff.d.ts +7 -0
- package/dist/core/imageSniff.js +12 -0
- package/dist/core/imageSniff.js.map +1 -0
- package/dist/core/ordering.d.ts +16 -0
- package/dist/core/ordering.js +10 -0
- package/dist/core/ordering.js.map +1 -0
- package/dist/core/oxcAst.d.ts +39 -0
- package/dist/core/oxcAst.js +147 -0
- package/dist/core/oxcAst.js.map +1 -0
- package/dist/core/pageUrl.d.ts +10 -0
- package/dist/core/pageUrl.js +27 -0
- package/dist/core/pageUrl.js.map +1 -0
- package/dist/core/participants.d.ts +14 -0
- package/dist/core/participants.js +38 -0
- package/dist/core/participants.js.map +1 -0
- package/dist/core/ports.d.ts +86 -0
- package/dist/core/ports.js +2 -0
- package/dist/core/ports.js.map +1 -0
- package/dist/core/projectSecret.d.ts +9 -0
- package/dist/core/projectSecret.js +57 -0
- package/dist/core/projectSecret.js.map +1 -0
- package/dist/core/recipe.d.ts +117 -0
- package/dist/core/recipe.js +181 -0
- package/dist/core/recipe.js.map +1 -0
- package/dist/core/recordingSummary.d.ts +12 -0
- package/dist/core/recordingSummary.js +150 -0
- package/dist/core/recordingSummary.js.map +1 -0
- package/dist/core/resolveAnchors.d.ts +70 -0
- package/dist/core/resolveAnchors.js +101 -0
- package/dist/core/resolveAnchors.js.map +1 -0
- package/dist/core/scriptImport.d.ts +10 -0
- package/dist/core/scriptImport.js +18 -0
- package/dist/core/scriptImport.js.map +1 -0
- package/dist/core/sourceAnchors.d.ts +62 -0
- package/dist/core/sourceAnchors.js +82 -0
- package/dist/core/sourceAnchors.js.map +1 -0
- package/dist/core/sourceContext.d.ts +62 -0
- package/dist/core/sourceContext.js +182 -0
- package/dist/core/sourceContext.js.map +1 -0
- package/dist/core/sourcePath.d.ts +2 -0
- package/dist/core/sourcePath.js +11 -0
- package/dist/core/sourcePath.js.map +1 -0
- package/dist/core/staleness.d.ts +118 -0
- package/dist/core/staleness.js +155 -0
- package/dist/core/staleness.js.map +1 -0
- package/dist/core/styleOrigin.d.ts +98 -0
- package/dist/core/styleOrigin.js +142 -0
- package/dist/core/styleOrigin.js.map +1 -0
- package/dist/core/svelteAnchors.d.ts +18 -0
- package/dist/core/svelteAnchors.js +125 -0
- package/dist/core/svelteAnchors.js.map +1 -0
- package/dist/core/taskFiles.d.ts +31 -0
- package/dist/core/taskFiles.js +55 -0
- package/dist/core/taskFiles.js.map +1 -0
- package/dist/core/untrusted.d.ts +57 -0
- package/dist/core/untrusted.js +268 -0
- package/dist/core/untrusted.js.map +1 -0
- package/dist/core/vueAnchors.d.ts +21 -0
- package/dist/core/vueAnchors.js +130 -0
- package/dist/core/vueAnchors.js.map +1 -0
- package/dist/expo/app/Avatar.d.ts +6 -0
- package/dist/expo/app/Avatar.js +12 -0
- package/dist/expo/app/Avatar.js.map +1 -0
- package/dist/expo/app/Bars.d.ts +9 -0
- package/dist/expo/app/Bars.js +38 -0
- package/dist/expo/app/Bars.js.map +1 -0
- package/dist/expo/app/CommentThreadSheet.d.ts +35 -0
- package/dist/expo/app/CommentThreadSheet.js +200 -0
- package/dist/expo/app/CommentThreadSheet.js.map +1 -0
- package/dist/expo/app/CommentsSheet.d.ts +22 -0
- package/dist/expo/app/CommentsSheet.js +76 -0
- package/dist/expo/app/CommentsSheet.js.map +1 -0
- package/dist/expo/app/Files.d.ts +16 -0
- package/dist/expo/app/Files.js +62 -0
- package/dist/expo/app/Files.js.map +1 -0
- package/dist/expo/app/Highlight.d.ts +5 -0
- package/dist/expo/app/Highlight.js +12 -0
- package/dist/expo/app/Highlight.js.map +1 -0
- package/dist/expo/app/Icon.d.ts +9 -0
- package/dist/expo/app/Icon.js +22 -0
- package/dist/expo/app/Icon.js.map +1 -0
- package/dist/expo/app/MarkerPins.d.ts +10 -0
- package/dist/expo/app/MarkerPins.js +70 -0
- package/dist/expo/app/MarkerPins.js.map +1 -0
- package/dist/expo/app/Provider.d.ts +13 -0
- package/dist/expo/app/Provider.js +597 -0
- package/dist/expo/app/Provider.js.map +1 -0
- package/dist/expo/app/Sheet.d.ts +53 -0
- package/dist/expo/app/Sheet.js +106 -0
- package/dist/expo/app/Sheet.js.map +1 -0
- package/dist/expo/app/Toolbar.d.ts +26 -0
- package/dist/expo/app/Toolbar.js +71 -0
- package/dist/expo/app/Toolbar.js.map +1 -0
- package/dist/expo/app/adapter.d.ts +55 -0
- package/dist/expo/app/adapter.js +145 -0
- package/dist/expo/app/adapter.js.map +1 -0
- package/dist/expo/app/api.d.ts +68 -0
- package/dist/expo/app/api.js +86 -0
- package/dist/expo/app/api.js.map +1 -0
- package/dist/expo/app/assets/attach.png +0 -0
- package/dist/expo/app/assets/close.png +0 -0
- package/dist/expo/app/assets/comment.png +0 -0
- package/dist/expo/app/assets/edit.png +0 -0
- package/dist/expo/app/assets/file.png +0 -0
- package/dist/expo/app/assets/narrow.png +0 -0
- package/dist/expo/app/assets/panel.png +0 -0
- package/dist/expo/app/assets/pins.png +0 -0
- package/dist/expo/app/assets/pinsOff.png +0 -0
- package/dist/expo/app/assets/remove.png +0 -0
- package/dist/expo/app/assets/reopen.png +0 -0
- package/dist/expo/app/assets/resolve.png +0 -0
- package/dist/expo/app/assets/send.png +0 -0
- package/dist/expo/app/assets/widen.png +0 -0
- package/dist/expo/app/attachments.d.ts +93 -0
- package/dist/expo/app/attachments.js +181 -0
- package/dist/expo/app/attachments.js.map +1 -0
- package/dist/expo/app/cloudApi.d.ts +63 -0
- package/dist/expo/app/cloudApi.js +330 -0
- package/dist/expo/app/cloudApi.js.map +1 -0
- package/dist/expo/app/cloudAuth.d.ts +20 -0
- package/dist/expo/app/cloudAuth.js +71 -0
- package/dist/expo/app/cloudAuth.js.map +1 -0
- package/dist/expo/app/cloudHttp.d.ts +20 -0
- package/dist/expo/app/cloudHttp.js +46 -0
- package/dist/expo/app/cloudHttp.js.map +1 -0
- package/dist/expo/app/cloudSession.d.ts +30 -0
- package/dist/expo/app/cloudSession.js +72 -0
- package/dist/expo/app/cloudSession.js.map +1 -0
- package/dist/expo/app/comments.d.ts +20 -0
- package/dist/expo/app/comments.js +131 -0
- package/dist/expo/app/comments.js.map +1 -0
- package/dist/expo/app/devMenuNone.d.ts +5 -0
- package/dist/expo/app/devMenuNone.js +3 -0
- package/dist/expo/app/devMenuNone.js.map +1 -0
- package/dist/expo/app/devServerNone.d.ts +4 -0
- package/dist/expo/app/devServerNone.js +4 -0
- package/dist/expo/app/devServerNone.js.map +1 -0
- package/dist/expo/app/embeddedConfig.d.ts +1 -0
- package/dist/expo/app/embeddedConfig.js +12 -0
- package/dist/expo/app/embeddedConfig.js.map +1 -0
- package/dist/expo/app/embeddedConfigCloud.d.ts +2 -0
- package/dist/expo/app/embeddedConfigCloud.js +8 -0
- package/dist/expo/app/embeddedConfigCloud.js.map +1 -0
- package/dist/expo/app/embeddedConfigNone.d.ts +2 -0
- package/dist/expo/app/embeddedConfigNone.js +3 -0
- package/dist/expo/app/embeddedConfigNone.js.map +1 -0
- package/dist/expo/app/expo.d.ts +4 -0
- package/dist/expo/app/expo.js +35 -0
- package/dist/expo/app/expo.js.map +1 -0
- package/dist/expo/app/expoGo.d.ts +4 -0
- package/dist/expo/app/expoGo.js +33 -0
- package/dist/expo/app/expoGo.js.map +1 -0
- package/dist/expo/app/expoPickers.d.ts +11 -0
- package/dist/expo/app/expoPickers.js +91 -0
- package/dist/expo/app/expoPickers.js.map +1 -0
- package/dist/expo/app/expoRandom.d.ts +6 -0
- package/dist/expo/app/expoRandom.js +21 -0
- package/dist/expo/app/expoRandom.js.map +1 -0
- package/dist/expo/app/idle.d.ts +4 -0
- package/dist/expo/app/idle.js +7 -0
- package/dist/expo/app/idle.js.map +1 -0
- package/dist/expo/app/index.d.ts +3 -0
- package/dist/expo/app/index.js +3 -0
- package/dist/expo/app/index.js.map +1 -0
- package/dist/expo/app/interactions.d.ts +38 -0
- package/dist/expo/app/interactions.js +40 -0
- package/dist/expo/app/interactions.js.map +1 -0
- package/dist/expo/app/markers.d.ts +28 -0
- package/dist/expo/app/markers.js +187 -0
- package/dist/expo/app/markers.js.map +1 -0
- package/dist/expo/app/movedAnchors.d.ts +46 -0
- package/dist/expo/app/movedAnchors.js +39 -0
- package/dist/expo/app/movedAnchors.js.map +1 -0
- package/dist/expo/app/native.d.ts +12 -0
- package/dist/expo/app/native.js +78 -0
- package/dist/expo/app/native.js.map +1 -0
- package/dist/expo/app/panel.d.ts +27 -0
- package/dist/expo/app/panel.js +37 -0
- package/dist/expo/app/panel.js.map +1 -0
- package/dist/expo/app/payload.d.ts +43 -0
- package/dist/expo/app/payload.js +22 -0
- package/dist/expo/app/payload.js.map +1 -0
- package/dist/expo/app/pick.d.ts +14 -0
- package/dist/expo/app/pick.js +124 -0
- package/dist/expo/app/pick.js.map +1 -0
- package/dist/expo/app/pickerNone.d.ts +1 -0
- package/dist/expo/app/pickerNone.js +2 -0
- package/dist/expo/app/pickerNone.js.map +1 -0
- package/dist/expo/app/placement.d.ts +53 -0
- package/dist/expo/app/placement.js +100 -0
- package/dist/expo/app/placement.js.map +1 -0
- package/dist/expo/app/random.d.ts +13 -0
- package/dist/expo/app/random.js +56 -0
- package/dist/expo/app/random.js.map +1 -0
- package/dist/expo/app/reactNative.d.ts +2 -0
- package/dist/expo/app/reactNative.js +3 -0
- package/dist/expo/app/reactNative.js.map +1 -0
- package/dist/expo/app/runtimeConfig.d.ts +30 -0
- package/dist/expo/app/runtimeConfig.js +104 -0
- package/dist/expo/app/runtimeConfig.js.map +1 -0
- package/dist/expo/app/sheetMotion.d.ts +22 -0
- package/dist/expo/app/sheetMotion.js +39 -0
- package/dist/expo/app/sheetMotion.js.map +1 -0
- package/dist/expo/app/signIn.d.ts +32 -0
- package/dist/expo/app/signIn.js +28 -0
- package/dist/expo/app/signIn.js.map +1 -0
- package/dist/expo/app/state.d.ts +45 -0
- package/dist/expo/app/state.js +32 -0
- package/dist/expo/app/state.js.map +1 -0
- package/dist/expo/app/theme.d.ts +15 -0
- package/dist/expo/app/theme.js +9 -0
- package/dist/expo/app/theme.js.map +1 -0
- package/dist/expo/app/types.d.ts +87 -0
- package/dist/expo/app/types.js +2 -0
- package/dist/expo/app/types.js.map +1 -0
- package/dist/expo/app/useCloudReviewer.d.ts +75 -0
- package/dist/expo/app/useCloudReviewer.js +211 -0
- package/dist/expo/app/useCloudReviewer.js.map +1 -0
- package/dist/expo/app/useComments.d.ts +64 -0
- package/dist/expo/app/useComments.js +156 -0
- package/dist/expo/app/useComments.js.map +1 -0
- package/dist/expo/app/useUploads.d.ts +32 -0
- package/dist/expo/app/useUploads.js +106 -0
- package/dist/expo/app/useUploads.js.map +1 -0
- package/dist/expo/expoGoMetro.cjs +83 -0
- package/dist/expo/expoMetro.cjs +86 -0
- package/dist/expo/metro.cjs +304 -0
- package/dist/expo/metroBuild.d.ts +22 -0
- package/dist/expo/metroBuild.js +169 -0
- package/dist/expo/metroBuild.js.map +1 -0
- package/dist/expo/middleware.d.ts +11 -0
- package/dist/expo/middleware.js +26 -0
- package/dist/expo/middleware.js.map +1 -0
- package/dist/expo/mode.d.ts +20 -0
- package/dist/expo/mode.js +37 -0
- package/dist/expo/mode.js.map +1 -0
- package/dist/expo/publicConfig.d.ts +37 -0
- package/dist/expo/publicConfig.js +87 -0
- package/dist/expo/publicConfig.js.map +1 -0
- package/dist/expo/transform.d.ts +22 -0
- package/dist/expo/transform.js +38 -0
- package/dist/expo/transform.js.map +1 -0
- package/dist/expo/transformer.cjs +73 -0
- package/dist/index.d.ts +21 -0
- package/dist/index.js +17 -0
- package/dist/index.js.map +1 -0
- package/dist/integration/apiRoutes.d.ts +2 -0
- package/dist/integration/apiRoutes.js +3 -0
- package/dist/integration/apiRoutes.js.map +1 -0
- package/dist/integration/buildCredentials.d.ts +12 -0
- package/dist/integration/buildCredentials.js +97 -0
- package/dist/integration/buildCredentials.js.map +1 -0
- package/dist/integration/buildSession.d.ts +8 -0
- package/dist/integration/buildSession.js +96 -0
- package/dist/integration/buildSession.js.map +1 -0
- package/dist/integration/bundleCheck.d.ts +43 -0
- package/dist/integration/bundleCheck.js +111 -0
- package/dist/integration/bundleCheck.js.map +1 -0
- package/dist/integration/commentPull.d.ts +134 -0
- package/dist/integration/commentPull.js +260 -0
- package/dist/integration/commentPull.js.map +1 -0
- package/dist/integration/configuredApi.d.ts +7 -0
- package/dist/integration/configuredApi.js +24 -0
- package/dist/integration/configuredApi.js.map +1 -0
- package/dist/integration/devCloud.d.ts +27 -0
- package/dist/integration/devCloud.js +56 -0
- package/dist/integration/devCloud.js.map +1 -0
- package/dist/integration/devReviewLinks.d.ts +2 -0
- package/dist/integration/devReviewLinks.js +10 -0
- package/dist/integration/devReviewLinks.js.map +1 -0
- package/dist/integration/gitBranch.d.ts +19 -0
- package/dist/integration/gitBranch.js +56 -0
- package/dist/integration/gitBranch.js.map +1 -0
- package/dist/integration/importPlan.d.ts +19 -0
- package/dist/integration/importPlan.js +90 -0
- package/dist/integration/importPlan.js.map +1 -0
- package/dist/integration/index.d.ts +14 -0
- package/dist/integration/index.js +13 -0
- package/dist/integration/index.js.map +1 -0
- package/dist/integration/manifest.d.ts +120 -0
- package/dist/integration/manifest.js +147 -0
- package/dist/integration/manifest.js.map +1 -0
- package/dist/integration/manifestParts.d.ts +29 -0
- package/dist/integration/manifestParts.js +65 -0
- package/dist/integration/manifestParts.js.map +1 -0
- package/dist/integration/manifestSink.d.ts +75 -0
- package/dist/integration/manifestSink.js +157 -0
- package/dist/integration/manifestSink.js.map +1 -0
- package/dist/integration/manifestUpload.d.ts +64 -0
- package/dist/integration/manifestUpload.js +177 -0
- package/dist/integration/manifestUpload.js.map +1 -0
- package/dist/integration/middleware.d.ts +55 -0
- package/dist/integration/middleware.js +379 -0
- package/dist/integration/middleware.js.map +1 -0
- package/dist/integration/nextStyles.d.ts +4 -0
- package/dist/integration/nextStyles.js +121 -0
- package/dist/integration/nextStyles.js.map +1 -0
- package/dist/integration/requestGuards.d.ts +71 -0
- package/dist/integration/requestGuards.js +255 -0
- package/dist/integration/requestGuards.js.map +1 -0
- package/dist/integration/sharedBuild.d.ts +71 -0
- package/dist/integration/sharedBuild.js +105 -0
- package/dist/integration/sharedBuild.js.map +1 -0
- package/dist/integration/sharedInject.d.ts +88 -0
- package/dist/integration/sharedInject.js +164 -0
- package/dist/integration/sharedInject.js.map +1 -0
- package/dist/integration/sidecarProcess.d.ts +26 -0
- package/dist/integration/sidecarProcess.js +137 -0
- package/dist/integration/sidecarProcess.js.map +1 -0
- package/dist/integration/styleCollector.d.ts +49 -0
- package/dist/integration/styleCollector.js +220 -0
- package/dist/integration/styleCollector.js.map +1 -0
- package/dist/integration/transform.d.ts +24 -0
- package/dist/integration/transform.js +36 -0
- package/dist/integration/transform.js.map +1 -0
- package/dist/integration/tunnelClient.d.ts +44 -0
- package/dist/integration/tunnelClient.js +148 -0
- package/dist/integration/tunnelClient.js.map +1 -0
- package/dist/integration/tunnelProtocol.d.ts +152 -0
- package/dist/integration/tunnelProtocol.js +110 -0
- package/dist/integration/tunnelProtocol.js.map +1 -0
- package/dist/mcp/cli.d.ts +2 -0
- package/dist/mcp/cli.js +327 -0
- package/dist/mcp/cli.js.map +1 -0
- package/dist/mcp/cloudRefresh.d.ts +36 -0
- package/dist/mcp/cloudRefresh.js +52 -0
- package/dist/mcp/cloudRefresh.js.map +1 -0
- package/dist/mcp/context.d.ts +7 -0
- package/dist/mcp/context.js +18 -0
- package/dist/mcp/context.js.map +1 -0
- package/dist/mcp/files.d.ts +66 -0
- package/dist/mcp/files.js +157 -0
- package/dist/mcp/files.js.map +1 -0
- package/dist/mcp/search.d.ts +3 -0
- package/dist/mcp/search.js +9 -0
- package/dist/mcp/search.js.map +1 -0
- package/dist/mcp/server.d.ts +50 -0
- package/dist/mcp/server.js +555 -0
- package/dist/mcp/server.js.map +1 -0
- package/dist/overlay/anchors.d.ts +130 -0
- package/dist/overlay/anchors.js +365 -0
- package/dist/overlay/anchors.js.map +1 -0
- package/dist/overlay/api.d.ts +150 -0
- package/dist/overlay/api.js +259 -0
- package/dist/overlay/api.js.map +1 -0
- package/dist/overlay/attachments.d.ts +60 -0
- package/dist/overlay/attachments.js +163 -0
- package/dist/overlay/attachments.js.map +1 -0
- package/dist/overlay/browser.d.ts +1 -0
- package/dist/overlay/browser.js +203 -0
- package/dist/overlay/browser.js.map +1 -0
- package/dist/overlay/chip.d.ts +27 -0
- package/dist/overlay/chip.js +31 -0
- package/dist/overlay/chip.js.map +1 -0
- package/dist/overlay/compact.d.ts +11 -0
- package/dist/overlay/compact.js +21 -0
- package/dist/overlay/compact.js.map +1 -0
- package/dist/overlay/cssScope.d.ts +46 -0
- package/dist/overlay/cssScope.js +180 -0
- package/dist/overlay/cssScope.js.map +1 -0
- package/dist/overlay/cursor.d.ts +2 -0
- package/dist/overlay/cursor.js +68 -0
- package/dist/overlay/cursor.js.map +1 -0
- package/dist/overlay/devBrowser.d.ts +1 -0
- package/dist/overlay/devBrowser.js +18 -0
- package/dist/overlay/devBrowser.js.map +1 -0
- package/dist/overlay/devReview.d.ts +4 -0
- package/dist/overlay/devReview.js +18 -0
- package/dist/overlay/devReview.js.map +1 -0
- package/dist/overlay/directReviewer.d.ts +149 -0
- package/dist/overlay/directReviewer.js +448 -0
- package/dist/overlay/directReviewer.js.map +1 -0
- package/dist/overlay/elementDescription.d.ts +10 -0
- package/dist/overlay/elementDescription.js +251 -0
- package/dist/overlay/elementDescription.js.map +1 -0
- package/dist/overlay/icons.d.ts +8 -0
- package/dist/overlay/icons.js +36 -0
- package/dist/overlay/icons.js.map +1 -0
- package/dist/overlay/identity.d.ts +48 -0
- package/dist/overlay/identity.js +125 -0
- package/dist/overlay/identity.js.map +1 -0
- package/dist/overlay/localMachine.d.ts +23 -0
- package/dist/overlay/localMachine.js +40 -0
- package/dist/overlay/localMachine.js.map +1 -0
- package/dist/overlay/magicLink.d.ts +10 -0
- package/dist/overlay/magicLink.js +87 -0
- package/dist/overlay/magicLink.js.map +1 -0
- package/dist/overlay/modern-screenshot.js +1676 -0
- package/dist/overlay/movedAnchors.d.ts +30 -0
- package/dist/overlay/movedAnchors.js +128 -0
- package/dist/overlay/movedAnchors.js.map +1 -0
- package/dist/overlay/notificationGroups.d.ts +2 -0
- package/dist/overlay/notificationGroups.js +41 -0
- package/dist/overlay/notificationGroups.js.map +1 -0
- package/dist/overlay/permissions.d.ts +10 -0
- package/dist/overlay/permissions.js +9 -0
- package/dist/overlay/permissions.js.map +1 -0
- package/dist/overlay/pinGroups.d.ts +16 -0
- package/dist/overlay/pinGroups.js +17 -0
- package/dist/overlay/pinGroups.js.map +1 -0
- package/dist/overlay/presence.d.ts +50 -0
- package/dist/overlay/presence.js +258 -0
- package/dist/overlay/presence.js.map +1 -0
- package/dist/overlay/projectChannel.d.ts +11 -0
- package/dist/overlay/projectChannel.js +111 -0
- package/dist/overlay/projectChannel.js.map +1 -0
- package/dist/overlay/recorder.d.ts +56 -0
- package/dist/overlay/recorder.js +130 -0
- package/dist/overlay/recorder.js.map +1 -0
- package/dist/overlay/reviewMode.d.ts +21 -0
- package/dist/overlay/reviewMode.js +59 -0
- package/dist/overlay/reviewMode.js.map +1 -0
- package/dist/overlay/reviewerAuth.d.ts +131 -0
- package/dist/overlay/reviewerAuth.js +279 -0
- package/dist/overlay/reviewerAuth.js.map +1 -0
- package/dist/overlay/route.d.ts +18 -0
- package/dist/overlay/route.js +56 -0
- package/dist/overlay/route.js.map +1 -0
- package/dist/overlay/rrweb-record.js +63 -0
- package/dist/overlay/runtime.d.ts +1 -0
- package/dist/overlay/runtime.js +4857 -0
- package/dist/overlay/runtime.js.map +1 -0
- package/dist/overlay/session.d.ts +32 -0
- package/dist/overlay/session.js +76 -0
- package/dist/overlay/session.js.map +1 -0
- package/dist/overlay/sharedMode.d.ts +38 -0
- package/dist/overlay/sharedMode.js +37 -0
- package/dist/overlay/sharedMode.js.map +1 -0
- package/dist/overlay/sheet.d.ts +73 -0
- package/dist/overlay/sheet.js +278 -0
- package/dist/overlay/sheet.js.map +1 -0
- package/dist/overlay/snapshot.d.ts +26 -0
- package/dist/overlay/snapshot.js +185 -0
- package/dist/overlay/snapshot.js.map +1 -0
- package/dist/overlay/state.d.ts +63 -0
- package/dist/overlay/state.js +241 -0
- package/dist/overlay/state.js.map +1 -0
- package/dist/overlay/steps.d.ts +22 -0
- package/dist/overlay/steps.js +34 -0
- package/dist/overlay/steps.js.map +1 -0
- package/dist/overlay/styles.d.ts +7 -0
- package/dist/overlay/styles.js +1449 -0
- package/dist/overlay/styles.js.map +1 -0
- package/dist/overlay/trace.d.ts +19 -0
- package/dist/overlay/trace.js +29 -0
- package/dist/overlay/trace.js.map +1 -0
- package/dist/overlay/upload.d.ts +35 -0
- package/dist/overlay/upload.js +99 -0
- package/dist/overlay/upload.js.map +1 -0
- package/dist/plugin/astro.d.ts +31 -0
- package/dist/plugin/astro.js +22 -0
- package/dist/plugin/astro.js.map +1 -0
- package/dist/plugin/eleventy.d.ts +44 -0
- package/dist/plugin/eleventy.js +186 -0
- package/dist/plugin/eleventy.js.map +1 -0
- package/dist/plugin/next-loader.cjs +11 -0
- package/dist/plugin/next.d.ts +29 -0
- package/dist/plugin/next.js +176 -0
- package/dist/plugin/next.js.map +1 -0
- package/dist/plugin/nextOverlay.d.ts +2 -0
- package/dist/plugin/nextOverlay.js +22 -0
- package/dist/plugin/nextOverlay.js.map +1 -0
- package/dist/plugin/nextTransform.d.ts +19 -0
- package/dist/plugin/nextTransform.js +29 -0
- package/dist/plugin/nextTransform.js.map +1 -0
- package/dist/plugin/rsbuild.d.ts +25 -0
- package/dist/plugin/rsbuild.js +56 -0
- package/dist/plugin/rsbuild.js.map +1 -0
- package/dist/plugin/vite.d.ts +40 -0
- package/dist/plugin/vite.js +585 -0
- package/dist/plugin/vite.js.map +1 -0
- package/dist/plugin/webpack.d.ts +69 -0
- package/dist/plugin/webpack.js +192 -0
- package/dist/plugin/webpack.js.map +1 -0
- package/dist/remote/account.d.ts +41 -0
- package/dist/remote/account.js +177 -0
- package/dist/remote/account.js.map +1 -0
- package/dist/remote/base64url.d.ts +14 -0
- package/dist/remote/base64url.js +71 -0
- package/dist/remote/base64url.js.map +1 -0
- package/dist/remote/branchLabel.d.ts +12 -0
- package/dist/remote/branchLabel.js +20 -0
- package/dist/remote/branchLabel.js.map +1 -0
- package/dist/remote/client.d.ts +340 -0
- package/dist/remote/client.js +424 -0
- package/dist/remote/client.js.map +1 -0
- package/dist/remote/cloudApi.d.ts +72 -0
- package/dist/remote/cloudApi.js +72 -0
- package/dist/remote/cloudApi.js.map +1 -0
- package/dist/remote/codec.d.ts +54 -0
- package/dist/remote/codec.js +62 -0
- package/dist/remote/codec.js.map +1 -0
- package/dist/remote/config.d.ts +30 -0
- package/dist/remote/config.js +112 -0
- package/dist/remote/config.js.map +1 -0
- package/dist/remote/content-schema.d.ts +428 -0
- package/dist/remote/content-schema.js +209 -0
- package/dist/remote/content-schema.js.map +1 -0
- package/dist/remote/content.d.ts +44 -0
- package/dist/remote/content.js +75 -0
- package/dist/remote/content.js.map +1 -0
- package/dist/remote/envelope.d.ts +76 -0
- package/dist/remote/envelope.js +109 -0
- package/dist/remote/envelope.js.map +1 -0
- package/dist/remote/errors.d.ts +55 -0
- package/dist/remote/errors.js +63 -0
- package/dist/remote/errors.js.map +1 -0
- package/dist/remote/ids.d.ts +8 -0
- package/dist/remote/ids.js +25 -0
- package/dist/remote/ids.js.map +1 -0
- package/dist/remote/index.d.ts +7 -0
- package/dist/remote/index.js +8 -0
- package/dist/remote/index.js.map +1 -0
- package/dist/remote/keys.d.ts +62 -0
- package/dist/remote/keys.js +162 -0
- package/dist/remote/keys.js.map +1 -0
- package/dist/remote/localAnchors.d.ts +4 -0
- package/dist/remote/localAnchors.js +23 -0
- package/dist/remote/localAnchors.js.map +1 -0
- package/dist/remote/mapping.d.ts +11 -0
- package/dist/remote/mapping.js +22 -0
- package/dist/remote/mapping.js.map +1 -0
- package/dist/remote/presence.d.ts +63 -0
- package/dist/remote/presence.js +143 -0
- package/dist/remote/presence.js.map +1 -0
- package/dist/remote/realtime.d.ts +142 -0
- package/dist/remote/realtime.js +326 -0
- package/dist/remote/realtime.js.map +1 -0
- package/dist/remote/store.d.ts +183 -0
- package/dist/remote/store.js +907 -0
- package/dist/remote/store.js.map +1 -0
- package/dist/remote/sync.d.ts +113 -0
- package/dist/remote/sync.js +370 -0
- package/dist/remote/sync.js.map +1 -0
- package/dist/remote/types.d.ts +99 -0
- package/dist/remote/types.js +6 -0
- package/dist/remote/types.js.map +1 -0
- package/dist/setup/agents.d.ts +23 -0
- package/dist/setup/agents.js +80 -0
- package/dist/setup/agents.js.map +1 -0
- package/dist/setup/configure.d.ts +27 -0
- package/dist/setup/configure.js +201 -0
- package/dist/setup/configure.js.map +1 -0
- package/dist/setup/connect.d.ts +60 -0
- package/dist/setup/connect.js +244 -0
- package/dist/setup/connect.js.map +1 -0
- package/dist/setup/detect.d.ts +67 -0
- package/dist/setup/detect.js +168 -0
- package/dist/setup/detect.js.map +1 -0
- package/dist/setup/frameworks.d.ts +41 -0
- package/dist/setup/frameworks.js +81 -0
- package/dist/setup/frameworks.js.map +1 -0
- package/dist/sidecar/cli.d.ts +1 -0
- package/dist/sidecar/cli.js +70 -0
- package/dist/sidecar/cli.js.map +1 -0
- package/dist/sidecar/cloudSync.d.ts +33 -0
- package/dist/sidecar/cloudSync.js +139 -0
- package/dist/sidecar/cloudSync.js.map +1 -0
- package/dist/sidecar/commentFiles.d.ts +59 -0
- package/dist/sidecar/commentFiles.js +217 -0
- package/dist/sidecar/commentFiles.js.map +1 -0
- package/dist/sidecar/cssAttribution.d.ts +26 -0
- package/dist/sidecar/cssAttribution.js +114 -0
- package/dist/sidecar/cssAttribution.js.map +1 -0
- package/dist/sidecar/exportTasks.d.ts +38 -0
- package/dist/sidecar/exportTasks.js +249 -0
- package/dist/sidecar/exportTasks.js.map +1 -0
- package/dist/sidecar/http.d.ts +20 -0
- package/dist/sidecar/http.js +904 -0
- package/dist/sidecar/http.js.map +1 -0
- package/dist/sidecar/inviteTarget.d.ts +4 -0
- package/dist/sidecar/inviteTarget.js +32 -0
- package/dist/sidecar/inviteTarget.js.map +1 -0
- package/dist/sidecar/presence.d.ts +4 -0
- package/dist/sidecar/presence.js +92 -0
- package/dist/sidecar/presence.js.map +1 -0
- package/dist/storage/cliSession.d.ts +8 -0
- package/dist/storage/cliSession.js +41 -0
- package/dist/storage/cliSession.js.map +1 -0
- package/dist/storage/devStyleMap.d.ts +12 -0
- package/dist/storage/devStyleMap.js +31 -0
- package/dist/storage/devStyleMap.js.map +1 -0
- package/dist/storage/fileCache.d.ts +34 -0
- package/dist/storage/fileCache.js +122 -0
- package/dist/storage/fileCache.js.map +1 -0
- package/dist/storage/localAttachments.d.ts +82 -0
- package/dist/storage/localAttachments.js +276 -0
- package/dist/storage/localAttachments.js.map +1 -0
- package/dist/storage/localComments.d.ts +31 -0
- package/dist/storage/localComments.js +159 -0
- package/dist/storage/localComments.js.map +1 -0
- package/dist/storage/localCredentials.d.ts +74 -0
- package/dist/storage/localCredentials.js +210 -0
- package/dist/storage/localCredentials.js.map +1 -0
- package/dist/storage/localParticipants.d.ts +33 -0
- package/dist/storage/localParticipants.js +110 -0
- package/dist/storage/localParticipants.js.map +1 -0
- package/dist/storage/localRecipe.d.ts +22 -0
- package/dist/storage/localRecipe.js +46 -0
- package/dist/storage/localRecipe.js.map +1 -0
- package/dist/storage/localScreenshots.d.ts +23 -0
- package/dist/storage/localScreenshots.js +55 -0
- package/dist/storage/localScreenshots.js.map +1 -0
- package/dist/storage/localSource.d.ts +31 -0
- package/dist/storage/localSource.js +175 -0
- package/dist/storage/localSource.js.map +1 -0
- package/dist/storage/pulledComments.d.ts +81 -0
- package/dist/storage/pulledComments.js +107 -0
- package/dist/storage/pulledComments.js.map +1 -0
- package/dist/storage/remoteRecipe.d.ts +7 -0
- package/dist/storage/remoteRecipe.js +85 -0
- package/dist/storage/remoteRecipe.js.map +1 -0
- package/dist/storage/savedRemote.d.ts +2 -0
- package/dist/storage/savedRemote.js +22 -0
- package/dist/storage/savedRemote.js.map +1 -0
- package/dist/storage/sidecarAccess.d.ts +7 -0
- package/dist/storage/sidecarAccess.js +68 -0
- package/dist/storage/sidecarAccess.js.map +1 -0
- package/package.json +306 -4
|
@@ -0,0 +1,904 @@
|
|
|
1
|
+
import { createServer } from 'node:http';
|
|
2
|
+
import { randomBytes, timingSafeEqual } from 'node:crypto';
|
|
3
|
+
import { saveSidecarAccess, removeSidecarAccess, sweepSidecarAccess, sidecarAccessPath } from '../storage/sidecarAccess.js';
|
|
4
|
+
import { readFile, realpath, unlink } from 'node:fs/promises';
|
|
5
|
+
import { ATTACHMENTS, MAX_ATTACHMENT_BYTES, contentDisposition, servedType } from '../core/attachmentTypes.js';
|
|
6
|
+
import { attachmentFile, claimUploads, listAttachments, removeAttachments, removeUpload, saveUpload, sweepUploads, withLocalAttachments } from '../storage/localAttachments.js';
|
|
7
|
+
import { generateAndWriteTaskDoc } from './exportTasks.js';
|
|
8
|
+
import { clientIpFrom } from '../storage/localParticipants.js';
|
|
9
|
+
import { listPulled, pulledFreshness, setPulledStatus } from '../storage/pulledComments.js';
|
|
10
|
+
import { pushCommentStatus } from '../integration/commentPull.js';
|
|
11
|
+
import { configuredApi } from '../integration/configuredApi.js';
|
|
12
|
+
import { serveBranch, serveOverlayAsset } from '../integration/middleware.js';
|
|
13
|
+
import { cachedDevCloud } from '../integration/devCloud.js';
|
|
14
|
+
import { publicRuntimeConfig } from '../expo/publicConfig.js';
|
|
15
|
+
import { resolveSecret } from '../storage/localCredentials.js';
|
|
16
|
+
import { createCloudSync } from './cloudSync.js';
|
|
17
|
+
import { RemoteCommentStore, isRemoteStore } from '../remote/store.js';
|
|
18
|
+
import { inviteTarget, preferDevOrigin } from './inviteTarget.js';
|
|
19
|
+
import { ApiError, ProjectKey } from '../remote/index.js';
|
|
20
|
+
import { readRemoteConfig, ensureRemoteGitignored, isCloudConfig } from '../remote/config.js';
|
|
21
|
+
import { maxLocalScreenshotBytes, removeLocalScreenshot, saveLocalScreenshot } from '../storage/localScreenshots.js';
|
|
22
|
+
import { BodyTooLarge, crossSiteRefusal, isLoopbackAppOrigin, maxJsonBodyBytes, maxSourceRadius, readLimitedBody, servableSource } from '../integration/requestGuards.js';
|
|
23
|
+
import { commentContentSchema, replyContentSchema, schemaIssues } from '../remote/content-schema.js';
|
|
24
|
+
import { withSafePaths } from '../core/untrusted.js';
|
|
25
|
+
import { sniffImage } from '../core/imageSniff.js';
|
|
26
|
+
import { commentFiles, DownloadBudget, filesForTasks } from './commentFiles.js';
|
|
27
|
+
import { MAX_INLINE_IMAGES, markInline } from '../core/taskFiles.js';
|
|
28
|
+
import { pruneCache, removeCached } from '../storage/fileCache.js';
|
|
29
|
+
/** Session instrumentation, local to this machine like everything else under .feedback. */
|
|
30
|
+
const tracePath = '.feedback/session-trace.jsonl';
|
|
31
|
+
const maxTraceChars = 2 * 1024 * 1024;
|
|
32
|
+
/**
|
|
33
|
+
* The dev server's origin, learned from whichever request arrives first.
|
|
34
|
+
*
|
|
35
|
+
* The sidecar outlives the dev server and is reached through it, so it cannot know this at
|
|
36
|
+
* startup. Export needs it to read compiled stylesheets back; without it CSS rules are
|
|
37
|
+
* reported unresolved rather than guessed at.
|
|
38
|
+
*/
|
|
39
|
+
let appOrigin = null;
|
|
40
|
+
export const knownAppOrigin = () => appOrigin;
|
|
41
|
+
/**
|
|
42
|
+
* Pushes a status change to the cloud, when this project is linked to one.
|
|
43
|
+
*
|
|
44
|
+
* **Where the API base comes from matters.** The first version read it from this process's
|
|
45
|
+
* environment, and this process is the sidecar - spawned by the dev server, which a developer
|
|
46
|
+
* starts with `npm run dev` and no variables. So write-back silently did nothing, recorded
|
|
47
|
+
* "not linked", and the reviewer's screen never moved: the exact shape in FINDINGS §1, found by
|
|
48
|
+
* a test asserting the cloud row rather than the tool's own reply.
|
|
49
|
+
*
|
|
50
|
+
* The credentials file is the right source. It records `cloudOrigin` precisely so a machine
|
|
51
|
+
* pointed at two deployments cannot mix them, and it is written by whatever linked the project.
|
|
52
|
+
* The environment still wins where it is set, for CI and for pointing at a different deployment
|
|
53
|
+
* without editing the cache.
|
|
54
|
+
*/
|
|
55
|
+
function cloudStatusPush(projectRoot) {
|
|
56
|
+
return async (commentId, status) => {
|
|
57
|
+
const { projectId, secret } = await resolveSecret(projectRoot);
|
|
58
|
+
if (!projectId || !secret) {
|
|
59
|
+
return { ok: false, reason: 'this machine holds no project secret, so the cloud was not told' };
|
|
60
|
+
}
|
|
61
|
+
// Use a trimmed override or the saved origin; missing configuration has an actionable error.
|
|
62
|
+
let apiBase;
|
|
63
|
+
try {
|
|
64
|
+
apiBase = await configuredApi(projectRoot, process.env);
|
|
65
|
+
}
|
|
66
|
+
catch (error) {
|
|
67
|
+
return { ok: false, reason: error instanceof Error ? error.message : String(error) };
|
|
68
|
+
}
|
|
69
|
+
return pushCommentStatus({ apiBase, projectId, secret, commentId, status });
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Every comment this machine knows about: written locally, and pulled from the cloud.
|
|
74
|
+
*
|
|
75
|
+
* Merged on read rather than by copying pulled comments into the local store, because the
|
|
76
|
+
* sidecar being the only writer of that store is what makes it safe without locking. `pull` is
|
|
77
|
+
* a separate process and often runs while this one is up.
|
|
78
|
+
*
|
|
79
|
+
* Local first, so a comment left in the dev server appears above one fetched from a preview.
|
|
80
|
+
* Ids cannot collide - the cloud's are minted there and the local store's here - but a pulled
|
|
81
|
+
* comment is skipped if its id is already present, because a duplicate in a work order is two
|
|
82
|
+
* tasks for one request.
|
|
83
|
+
*/
|
|
84
|
+
async function allComments(store, projectRoot) {
|
|
85
|
+
const local = await store.list();
|
|
86
|
+
if (isRemoteStore(store))
|
|
87
|
+
return local;
|
|
88
|
+
const known = new Set(local.map((comment) => comment.id));
|
|
89
|
+
// A comment written here and synced comes back through a pull carrying its local id as its
|
|
90
|
+
// import key. The local one is the original on this machine, so the pulled copy is skipped.
|
|
91
|
+
const pulled = (await listPulled(projectRoot)).filter((comment) => !known.has(comment.id) && !(comment.importKey && known.has(comment.importKey)));
|
|
92
|
+
return [...local, ...pulled];
|
|
93
|
+
}
|
|
94
|
+
/** With its task, a comment's cached copies go. A status already changed is not undone by a folder that will not go: the next start tidies it. */
|
|
95
|
+
const dropCopies = (projectRoot, id) => removeCached(projectRoot, id).catch((error) => {
|
|
96
|
+
console.warn(`[feedback] could not remove a comment's cached files: ${error instanceof Error ? error.message : String(error)}`);
|
|
97
|
+
});
|
|
98
|
+
/** How many images the caller will send inline: 0 to MAX_INLINE_IMAGES. */
|
|
99
|
+
const inlineOf = (value) => (typeof value === 'number' && Number.isInteger(value) ? Math.min(MAX_INLINE_IMAGES, Math.max(0, value)) : 0);
|
|
100
|
+
/** Header naming the project a request belongs to, so it cannot land in the wrong store. */
|
|
101
|
+
export const projectRootHeader = 'x-feedback-project-root';
|
|
102
|
+
export async function startSidecar({ projectRoot, port, buildId, comments: store, participants, source, loadDevCloud, }) {
|
|
103
|
+
const canonicalRoot = await canonical(projectRoot);
|
|
104
|
+
// Linked projects mirror what is written here to the cloud; see cloudSync.ts. Once at start,
|
|
105
|
+
// to send anything written while the sidecar was down.
|
|
106
|
+
const remoteConfig = await readRemoteConfig(projectRoot);
|
|
107
|
+
let resolveReady = () => { };
|
|
108
|
+
let rejectReady = (_error) => { };
|
|
109
|
+
const ready = remoteConfig ? new Promise((resolve, reject) => { resolveReady = resolve; rejectReady = reject; }) : Promise.resolve();
|
|
110
|
+
void ready.catch(() => { });
|
|
111
|
+
const sync = remoteConfig ? { schedule() { }, async noteDeleted(_id) { }, async flush() { return { ok: true, sent: 0 }; } }
|
|
112
|
+
: createCloudSync(projectRoot, store);
|
|
113
|
+
sync.schedule();
|
|
114
|
+
// Unclaimed local uploads: none outlives a restart (no draft does), the rest go after their hour.
|
|
115
|
+
if (!remoteConfig) {
|
|
116
|
+
// Never the reason the sidecar does not start: a folder it cannot sweep is swept next time.
|
|
117
|
+
await sweepUploads(projectRoot, { all: true }).catch((error) => {
|
|
118
|
+
console.warn(`[feedback] could not remove unclaimed uploads: ${error instanceof Error ? error.message : String(error)}`);
|
|
119
|
+
});
|
|
120
|
+
setInterval(() => { void sweepUploads(projectRoot).catch(() => { }); }, 10 * 60_000).unref();
|
|
121
|
+
}
|
|
122
|
+
// Copies of Cloud files whose comments are no longer open here go (fileCache.ts). Never the reason
|
|
123
|
+
// the sidecar does not start; a Cloud-mode store is read once it is ready.
|
|
124
|
+
const tidyCache = async () => {
|
|
125
|
+
const open = (await allComments(store, projectRoot)).filter((comment) => comment.status === 'open').map((comment) => comment.id);
|
|
126
|
+
await pruneCache(projectRoot, new Set(open));
|
|
127
|
+
};
|
|
128
|
+
const tidyFailed = (error) => console.warn(`[feedback] could not tidy cached files: ${error instanceof Error ? error.message : String(error)}`);
|
|
129
|
+
if (remoteConfig)
|
|
130
|
+
void ready.then(tidyCache).catch(tidyFailed);
|
|
131
|
+
else
|
|
132
|
+
await tidyCache().catch(tidyFailed);
|
|
133
|
+
const cloudAnswer = loadDevCloud
|
|
134
|
+
? cachedDevCloud(projectRoot, 60_000, loadDevCloud)
|
|
135
|
+
: cachedDevCloud(projectRoot);
|
|
136
|
+
const accessToken = randomBytes(32).toString('hex');
|
|
137
|
+
let devOrigin = null;
|
|
138
|
+
const server = createServer(async (request, response) => {
|
|
139
|
+
try {
|
|
140
|
+
const pathname = new URL(request.url ?? '/', 'http://127.0.0.1').pathname;
|
|
141
|
+
if (pathname === '/__fb' || pathname.startsWith('/__fb/')) {
|
|
142
|
+
response.setHeader('Cache-Control', 'no-store');
|
|
143
|
+
const listenerPort = request.socket.localPort;
|
|
144
|
+
if (![`127.0.0.1:${listenerPort}`, `localhost:${listenerPort}`, `[::1]:${listenerPort}`].includes(request.headers.host ?? '')) {
|
|
145
|
+
sendJson(response, 403, { error: 'Invalid sidecar Host' });
|
|
146
|
+
return;
|
|
147
|
+
}
|
|
148
|
+
// Remote mode holds decrypted comments and writes as the developer, so every route but
|
|
149
|
+
// health needs the per-listener bearer. The dev-server proxy attaches it only for the
|
|
150
|
+
// developer's own loopback browser.
|
|
151
|
+
if ((remoteConfig && pathname !== '/__fb/health') || pathname === '/__fb/remote' || pathname.startsWith('/__fb/remote/')) {
|
|
152
|
+
const received = Buffer.from(request.headers.authorization ?? '');
|
|
153
|
+
const expected = Buffer.from(`Bearer ${accessToken}`);
|
|
154
|
+
if (received.length !== expected.length || !timingSafeEqual(received, expected)) {
|
|
155
|
+
sendJson(response, 401, { error: 'Sidecar authorization required' });
|
|
156
|
+
return;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
const refusal = crossSiteRefusal(request, pathname, listenerPort);
|
|
160
|
+
if (refusal) {
|
|
161
|
+
sendJson(response, refusal.status, { error: refusal.error });
|
|
162
|
+
return;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
await ready;
|
|
166
|
+
// A port is not an identity. Ports get reused, and a sidecar for another project
|
|
167
|
+
// answering happily would quietly write someone else's comments into this store.
|
|
168
|
+
const claimed = request.headers[projectRootHeader];
|
|
169
|
+
if (typeof claimed === 'string' && (await canonical(claimed)) !== canonicalRoot) {
|
|
170
|
+
sendJson(response, 409, {
|
|
171
|
+
error: 'This sidecar serves a different project',
|
|
172
|
+
projectRoot,
|
|
173
|
+
});
|
|
174
|
+
return;
|
|
175
|
+
}
|
|
176
|
+
if (remoteConfig && pathname === '/__fb/shutdown' && request.method === 'POST') {
|
|
177
|
+
await removeSidecarAccess(projectRoot, listenerPort, accessToken);
|
|
178
|
+
}
|
|
179
|
+
// Invite links and CSS attribution only ever use a loopback dev origin.
|
|
180
|
+
const forwardedOrigin = request.headers['x-feedback-app-origin'];
|
|
181
|
+
if (typeof forwardedOrigin === 'string' && isLoopbackAppOrigin(forwardedOrigin))
|
|
182
|
+
devOrigin = preferDevOrigin(devOrigin, forwardedOrigin);
|
|
183
|
+
// Whether this page runs the cloud widget (devCloud.ts), and the branch its comments are labelled with.
|
|
184
|
+
if (request.method === 'GET' && pathname === '/__fb/cloud') {
|
|
185
|
+
sendJson(response, 200, remoteConfig ? { cloud: null } : await cloudAnswer());
|
|
186
|
+
return;
|
|
187
|
+
}
|
|
188
|
+
if (request.method === 'GET' && pathname === '/__fb/config') {
|
|
189
|
+
const answer = remoteConfig ? { cloud: null } : await cloudAnswer();
|
|
190
|
+
if (answer.notice) {
|
|
191
|
+
sendJson(response, 503, { error: 'ontrackd: cloud runtime configuration unavailable.' });
|
|
192
|
+
return;
|
|
193
|
+
}
|
|
194
|
+
const cloud = answer.cloud;
|
|
195
|
+
sendJson(response, 200, cloud
|
|
196
|
+
? publicRuntimeConfig({ mode: 'cloud', projectId: cloud.projectId }, {
|
|
197
|
+
apiBase: cloud.apiBase,
|
|
198
|
+
sessionId: cloud.sessionId,
|
|
199
|
+
buildId,
|
|
200
|
+
})
|
|
201
|
+
: { mode: 'local' });
|
|
202
|
+
return;
|
|
203
|
+
}
|
|
204
|
+
if (request.method === 'GET' && pathname === '/__fb/branch') {
|
|
205
|
+
await serveBranch(projectRoot, response);
|
|
206
|
+
return;
|
|
207
|
+
}
|
|
208
|
+
if (pathname === '/__fb/remote/presence' && isRemoteStore(store)) {
|
|
209
|
+
const { handlePresence } = await import('./presence.js');
|
|
210
|
+
await handlePresence(request, response, store);
|
|
211
|
+
return;
|
|
212
|
+
}
|
|
213
|
+
await handleRequest(request, response, store, participants, source, projectRoot, buildId, sync, devOrigin);
|
|
214
|
+
}
|
|
215
|
+
catch (error) {
|
|
216
|
+
if (error instanceof BodyTooLarge) {
|
|
217
|
+
response.setHeader('Connection', 'close');
|
|
218
|
+
sendJson(response, 413, { error: error.message });
|
|
219
|
+
return;
|
|
220
|
+
}
|
|
221
|
+
sendJson(response, 500, {
|
|
222
|
+
error: error instanceof Error ? error.message : 'Internal server error',
|
|
223
|
+
});
|
|
224
|
+
}
|
|
225
|
+
});
|
|
226
|
+
await new Promise((resolve, reject) => {
|
|
227
|
+
server.once('error', reject);
|
|
228
|
+
server.listen(port, '127.0.0.1', () => {
|
|
229
|
+
server.off('error', reject);
|
|
230
|
+
resolve();
|
|
231
|
+
});
|
|
232
|
+
});
|
|
233
|
+
const listenerPort = server.address().port;
|
|
234
|
+
if (remoteConfig) {
|
|
235
|
+
try {
|
|
236
|
+
ensureRemoteGitignored(projectRoot);
|
|
237
|
+
await sweepSidecarAccess(projectRoot, listenerPort);
|
|
238
|
+
await saveSidecarAccess(projectRoot, listenerPort, accessToken);
|
|
239
|
+
const closeListener = server.close.bind(server);
|
|
240
|
+
server.close = (callback) => {
|
|
241
|
+
closeListener((error) => {
|
|
242
|
+
void removeSidecarAccess(projectRoot, listenerPort, accessToken).then(() => callback?.(error), (cleanupError) => callback?.(cleanupError));
|
|
243
|
+
});
|
|
244
|
+
return server;
|
|
245
|
+
};
|
|
246
|
+
// Claim the listening port before opening the journal: a losing startup must never write it.
|
|
247
|
+
const remoteStore = await RemoteCommentStore.open(projectRoot, remoteConfig, source);
|
|
248
|
+
store = remoteStore;
|
|
249
|
+
const closeServer = server.close.bind(server);
|
|
250
|
+
server.close = (callback) => {
|
|
251
|
+
remoteStore.presenceCleanup?.();
|
|
252
|
+
closeServer((error) => {
|
|
253
|
+
void remoteStore.close().then(() => callback?.(error), (cleanupError) => callback?.(cleanupError));
|
|
254
|
+
});
|
|
255
|
+
return server;
|
|
256
|
+
};
|
|
257
|
+
remoteStore.start();
|
|
258
|
+
resolveReady();
|
|
259
|
+
}
|
|
260
|
+
catch (error) {
|
|
261
|
+
rejectReady(error);
|
|
262
|
+
server.closeAllConnections();
|
|
263
|
+
server.close();
|
|
264
|
+
throw error;
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
else {
|
|
268
|
+
// A remote sidecar that died on this port left its access file, and the dev-server proxy
|
|
269
|
+
// reads that file as "this sidecar is remote". This listener owns the port, so it is stale.
|
|
270
|
+
await unlink(sidecarAccessPath(projectRoot, listenerPort)).catch(() => { });
|
|
271
|
+
}
|
|
272
|
+
return server;
|
|
273
|
+
}
|
|
274
|
+
async function handleRequest(request, response, store, participants, source, projectRoot, buildId, sync, devOrigin = null) {
|
|
275
|
+
const url = new URL(request.url ?? '/', 'http://127.0.0.1');
|
|
276
|
+
const method = request.method ?? 'GET';
|
|
277
|
+
// The overlay's own modules, for builders with no middleware of their own to serve them. Next
|
|
278
|
+
// is one: its dev server takes rewrites, not middleware, so it points /__feedback here.
|
|
279
|
+
if (method === 'GET' && url.pathname.startsWith('/__feedback/')) {
|
|
280
|
+
await serveOverlayAsset(url.pathname.slice('/__feedback/'.length), response).catch(() => {
|
|
281
|
+
response.statusCode = 404;
|
|
282
|
+
response.end('Not found');
|
|
283
|
+
});
|
|
284
|
+
return;
|
|
285
|
+
}
|
|
286
|
+
if (method === 'GET' && url.pathname === '/__fb/health') {
|
|
287
|
+
// Needed for CLI attachment, plugin port recovery and MCP project isolation. The Host guard
|
|
288
|
+
// above rejects foreign domains before disclosing this local ownership metadata.
|
|
289
|
+
sendJson(response, 200, { ok: true, projectRoot, buildId });
|
|
290
|
+
return;
|
|
291
|
+
}
|
|
292
|
+
// Lets a newer plugin retire a sidecar left over from a previous build.
|
|
293
|
+
if (method === 'POST' && url.pathname === '/__fb/shutdown') {
|
|
294
|
+
sendJson(response, 200, { ok: true });
|
|
295
|
+
response.on('finish', () => setTimeout(() => process.exit(0), 20));
|
|
296
|
+
return;
|
|
297
|
+
}
|
|
298
|
+
// Who is this? Called once when the overlay boots.
|
|
299
|
+
if (method === 'POST' && url.pathname === '/__fb/identify') {
|
|
300
|
+
const body = await readJson(request);
|
|
301
|
+
const ip = clientIpFrom(request.headers, request.socket.remoteAddress ?? undefined);
|
|
302
|
+
const id = typeof body.id === 'string' ? body.id : null;
|
|
303
|
+
const found = await participants.identify(id, ip);
|
|
304
|
+
sendJson(response, 200, {
|
|
305
|
+
participant: found.participant,
|
|
306
|
+
matchedBy: found.matchedBy,
|
|
307
|
+
// An IP match is a guess, so the overlay confirms the name rather than assuming it.
|
|
308
|
+
needsConfirmation: found.matchedBy === 'ip',
|
|
309
|
+
});
|
|
310
|
+
return;
|
|
311
|
+
}
|
|
312
|
+
if (method === 'POST' && url.pathname === '/__fb/participants') {
|
|
313
|
+
const body = await readJson(request);
|
|
314
|
+
const name = stringValue(body.name).trim();
|
|
315
|
+
const id = stringValue(body.id).trim();
|
|
316
|
+
if (!name || !id) {
|
|
317
|
+
sendJson(response, 400, { error: 'Expected id and name' });
|
|
318
|
+
return;
|
|
319
|
+
}
|
|
320
|
+
const ip = clientIpFrom(request.headers, request.socket.remoteAddress ?? undefined);
|
|
321
|
+
sendJson(response, 200, { participant: await participants.save({ id, name, ip }) });
|
|
322
|
+
return;
|
|
323
|
+
}
|
|
324
|
+
if (method === 'GET' && url.pathname === '/__fb/participants') {
|
|
325
|
+
sendJson(response, 200, { participants: await participants.list() });
|
|
326
|
+
return;
|
|
327
|
+
}
|
|
328
|
+
if (method === 'GET' && url.pathname === '/__fb/comments') {
|
|
329
|
+
const comments = await allComments(store, projectRoot);
|
|
330
|
+
sendJson(response, 200, {
|
|
331
|
+
comments: isRemoteStore(store) ? comments : await withLocalAttachments(projectRoot, comments),
|
|
332
|
+
// Whether the composer offers the paperclip: never for a Standalone session, end-to-end encrypted.
|
|
333
|
+
attachments: !isRemoteStore(store) || store.attachmentsAvailable,
|
|
334
|
+
...(isRemoteStore(store) ? { remote: store.status() } : {}),
|
|
335
|
+
});
|
|
336
|
+
return;
|
|
337
|
+
}
|
|
338
|
+
if (method === 'POST' && url.pathname === '/__fb/remote/invite' && isRemoteStore(store)) {
|
|
339
|
+
if (typeof request.headers[projectRootHeader] !== 'string') {
|
|
340
|
+
sendJson(response, 403, { error: 'Invite management requires the project root header' });
|
|
341
|
+
return;
|
|
342
|
+
}
|
|
343
|
+
const input = await readJson(request);
|
|
344
|
+
try {
|
|
345
|
+
if (input.action === 'list')
|
|
346
|
+
sendJson(response, 200, { participants: await store.api.listParticipants(store.config.sessionId) });
|
|
347
|
+
else if (input.action === 'revoke') {
|
|
348
|
+
if (typeof input.participantId !== 'string')
|
|
349
|
+
throw new Error('Expected participant ID');
|
|
350
|
+
sendJson(response, 200, { participant: await store.api.revokeParticipant(store.config.sessionId, input.participantId) });
|
|
351
|
+
}
|
|
352
|
+
else if (input.action === 'create') {
|
|
353
|
+
const preview = inviteTarget(input.previewUrl, devOrigin);
|
|
354
|
+
const created = await store.api.createInvite(store.config.sessionId, { displayName: input.displayName, origin: preview.origin, ttlDays: input.ttlDays });
|
|
355
|
+
// Cloud links carry no content key: Cloud reviewers write plaintext (contract section 16).
|
|
356
|
+
const fb = isCloudConfig(store.config) ? created.token : `${created.token}.${await ProjectKey.parsePortable(store.config.portableKey).key.exportReviewerKey()}`;
|
|
357
|
+
preview.hash = new URLSearchParams({ fb, name: created.participant.displayName }).toString();
|
|
358
|
+
response.setHeader('Cache-Control', 'no-store');
|
|
359
|
+
sendJson(response, 201, { link: preview.href, participant: created.participant });
|
|
360
|
+
}
|
|
361
|
+
else
|
|
362
|
+
throw new Error('Expected create, list or revoke');
|
|
363
|
+
}
|
|
364
|
+
catch (error) {
|
|
365
|
+
sendJson(response, error instanceof ApiError ? error.status : 400, { error: error instanceof ApiError ? `Invite API: ${error.code}` : error instanceof Error ? error.message : 'Invite failed' });
|
|
366
|
+
}
|
|
367
|
+
return;
|
|
368
|
+
}
|
|
369
|
+
if (url.pathname === '/__fb/remote/queue' && isRemoteStore(store)) {
|
|
370
|
+
if (method === 'POST') {
|
|
371
|
+
const { action, id } = await readJson(request);
|
|
372
|
+
try {
|
|
373
|
+
if (action !== 'retry-all' && typeof id !== 'string')
|
|
374
|
+
throw new Error('Expected queue operation ID');
|
|
375
|
+
if (action === 'discard')
|
|
376
|
+
await store.discard(id);
|
|
377
|
+
else if (action === 'rebase')
|
|
378
|
+
await store.rebase(id);
|
|
379
|
+
else if (action === 'retry')
|
|
380
|
+
await store.retry(id);
|
|
381
|
+
else if (action === 'retry-all')
|
|
382
|
+
await store.retry();
|
|
383
|
+
else
|
|
384
|
+
throw new Error('Expected discard, rebase, retry or retry-all');
|
|
385
|
+
}
|
|
386
|
+
catch (error) {
|
|
387
|
+
sendJson(response, 409, { error: error instanceof Error ? error.message : 'Queue recovery failed' });
|
|
388
|
+
return;
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
else if (method !== 'GET') {
|
|
392
|
+
sendJson(response, 405, { error: 'Method not allowed' });
|
|
393
|
+
return;
|
|
394
|
+
}
|
|
395
|
+
sendJson(response, 200, { queue: store.queueEntries() });
|
|
396
|
+
return;
|
|
397
|
+
}
|
|
398
|
+
const actorHeader = request.headers['x-feedback-participant-id'];
|
|
399
|
+
const actorId = typeof actorHeader === 'string' && actorHeader.length <= 128 ? actorHeader : undefined;
|
|
400
|
+
const forwardedOrigin = request.headers['x-feedback-app-origin'];
|
|
401
|
+
if (typeof forwardedOrigin === 'string' && isLoopbackAppOrigin(forwardedOrigin))
|
|
402
|
+
appOrigin = forwardedOrigin;
|
|
403
|
+
if (method === 'POST' && url.pathname === '/__fb/trace') {
|
|
404
|
+
const body = await readJson(request);
|
|
405
|
+
const events = Array.isArray(body.events) ? body.events : [];
|
|
406
|
+
// Appended by rewriting: the file is a session's worth of small events, and a
|
|
407
|
+
// read-modify-write keeps this off the SourceReader port, which has no append.
|
|
408
|
+
const existing = (await source.readFile(tracePath)) ?? '';
|
|
409
|
+
const lines = events.map((event) => JSON.stringify(event)).join('\n');
|
|
410
|
+
// Bounded: the oldest events go first, at a line boundary.
|
|
411
|
+
let trace = existing + lines + '\n';
|
|
412
|
+
if (trace.length > maxTraceChars)
|
|
413
|
+
trace = trace.slice(trace.indexOf('\n', trace.length - maxTraceChars) + 1);
|
|
414
|
+
await source.writeArtefact(tracePath, trace);
|
|
415
|
+
sendJson(response, 202, { accepted: events.length });
|
|
416
|
+
return;
|
|
417
|
+
}
|
|
418
|
+
// Files for a message being written (spec: Attachments): raw bytes, checked as the Worker checks them.
|
|
419
|
+
if (method === 'POST' && url.pathname === '/__fb/uploads') {
|
|
420
|
+
const name = url.searchParams.get('name') ?? '';
|
|
421
|
+
if ([...name].length < 1 || [...name].length > 255) {
|
|
422
|
+
sendJson(response, 400, { error: 'Expected the file name', reason: 'attachment_name' });
|
|
423
|
+
return;
|
|
424
|
+
}
|
|
425
|
+
const bytes = await readBytes(request, MAX_ATTACHMENT_BYTES);
|
|
426
|
+
if (!bytes) {
|
|
427
|
+
response.setHeader('Connection', 'close');
|
|
428
|
+
sendJson(response, 413, { error: 'Over 10 MB', reason: 'attachment_size', limit: MAX_ATTACHMENT_BYTES });
|
|
429
|
+
return;
|
|
430
|
+
}
|
|
431
|
+
if (isRemoteStore(store)) {
|
|
432
|
+
const answer = await store.uploadAttachment(name, bytes);
|
|
433
|
+
sendJson(response, answer.status, answer.body);
|
|
434
|
+
return;
|
|
435
|
+
}
|
|
436
|
+
const saved = await saveUpload(projectRoot, name, bytes);
|
|
437
|
+
if ('status' in saved) {
|
|
438
|
+
const { status, ...refusal } = saved;
|
|
439
|
+
sendJson(response, status, refusal);
|
|
440
|
+
return;
|
|
441
|
+
}
|
|
442
|
+
sendJson(response, 201, { id: saved.id, name: saved.name, mime: saved.mime, kind: saved.kind, bytes: saved.bytes,
|
|
443
|
+
...(saved.width === null ? {} : { width: saved.width, height: saved.height }) });
|
|
444
|
+
return;
|
|
445
|
+
}
|
|
446
|
+
const uploadMatch = /^\/__fb\/uploads\/([^/]+)$/.exec(url.pathname);
|
|
447
|
+
if (uploadMatch && method === 'DELETE') {
|
|
448
|
+
const id = decodeURIComponent(uploadMatch[1]);
|
|
449
|
+
const removed = isRemoteStore(store) ? await store.removeUpload(id) : await removeUpload(projectRoot, id);
|
|
450
|
+
sendJson(response, removed ? 204 : 404, removed ? null : { error: 'No such upload' });
|
|
451
|
+
return;
|
|
452
|
+
}
|
|
453
|
+
const fileMatch = /^\/__fb\/attachments\/([^/]+)\/([^/]+)$/.exec(url.pathname);
|
|
454
|
+
if (fileMatch && method === 'GET') {
|
|
455
|
+
const [comment, id] = [decodeURIComponent(fileMatch[1]), decodeURIComponent(fileMatch[2])];
|
|
456
|
+
let found = null;
|
|
457
|
+
if (isRemoteStore(store))
|
|
458
|
+
found = await store.attachmentBytes(comment, id);
|
|
459
|
+
else {
|
|
460
|
+
const local = await attachmentFile(projectRoot, comment, id);
|
|
461
|
+
const bytes = local ? await readFile(local.path).catch(() => null) : null;
|
|
462
|
+
found = local && bytes ? { bytes, attachment: local.attachment } : null;
|
|
463
|
+
}
|
|
464
|
+
if (!found) {
|
|
465
|
+
sendJson(response, 404, { error: 'No such file' });
|
|
466
|
+
return;
|
|
467
|
+
}
|
|
468
|
+
sendFile(response, found.bytes, found.attachment);
|
|
469
|
+
return;
|
|
470
|
+
}
|
|
471
|
+
if (method === 'POST' && url.pathname === '/__fb/comments') {
|
|
472
|
+
const body = await readJson(request);
|
|
473
|
+
// Content schema as in remote mode; recorded paths that are not ordinary project files are cleared.
|
|
474
|
+
const input = withSafePaths({
|
|
475
|
+
author: stringValue(body.author, 'anonymous'),
|
|
476
|
+
authorId: stringValue(body.authorId) || null,
|
|
477
|
+
body: stringValue(body.body),
|
|
478
|
+
anchor: body.anchor,
|
|
479
|
+
leafAnchor: body.leafAnchor ?? null,
|
|
480
|
+
anchorChain: Array.isArray(body.anchorChain) ? body.anchorChain : undefined,
|
|
481
|
+
insideSelection: Array.isArray(body.insideSelection) ? body.insideSelection : undefined,
|
|
482
|
+
cssScope: body.cssScope && Array.isArray(body.cssScope.rules) ? body.cssScope : undefined,
|
|
483
|
+
// Counted in the page at the moment of the click. It cannot be recovered later:
|
|
484
|
+
// reopening the app may render a different number of rows.
|
|
485
|
+
scope: body.scope && typeof body.scope.instancesOnPage === 'number' ? body.scope : undefined,
|
|
486
|
+
pinOffset: body.pinOffset ?? undefined,
|
|
487
|
+
context: body.context,
|
|
488
|
+
});
|
|
489
|
+
const issues = ingestIssues(commentContentSchema, input);
|
|
490
|
+
if (issues.length > 0) {
|
|
491
|
+
sendJson(response, 400, { error: `Invalid comment: ${issues.slice(0, 5).join('; ')}` });
|
|
492
|
+
return;
|
|
493
|
+
}
|
|
494
|
+
const attachmentIds = attachmentIdsOf(body.attachmentIds);
|
|
495
|
+
if (!attachmentIds) {
|
|
496
|
+
sendJson(response, 400, { error: `Invalid attachmentIds: at most ${ATTACHMENTS.maxFilesPerMessage} distinct upload IDs` });
|
|
497
|
+
return;
|
|
498
|
+
}
|
|
499
|
+
if (attachmentIds.length && isRemoteStore(store) && !store.attachmentsAvailable) {
|
|
500
|
+
sendJson(response, 403, { error: 'Files cannot be attached to an end-to-end encrypted review', reason: 'attachments_unavailable' });
|
|
501
|
+
return;
|
|
502
|
+
}
|
|
503
|
+
let comment;
|
|
504
|
+
if (isRemoteStore(store))
|
|
505
|
+
comment = await store.create(input, { attachmentIds });
|
|
506
|
+
else if (attachmentIds.length === 0)
|
|
507
|
+
comment = await store.create(input);
|
|
508
|
+
else {
|
|
509
|
+
// All or nothing, as in Cloud: an upload that is gone refuses the message before it is written.
|
|
510
|
+
const local = store;
|
|
511
|
+
const claimed = await claimUploads(projectRoot, attachmentIds, async () => {
|
|
512
|
+
const created = await local.create(input);
|
|
513
|
+
return { value: created, comment: created.id, replyId: null, undo: () => local.remove(created.id) };
|
|
514
|
+
});
|
|
515
|
+
if ('unavailable' in claimed) {
|
|
516
|
+
refuseUnavailable(response, claimed.unavailable);
|
|
517
|
+
return;
|
|
518
|
+
}
|
|
519
|
+
comment = claimed.value;
|
|
520
|
+
}
|
|
521
|
+
sendJson(response, 201, { comment: isRemoteStore(store) ? comment : (await withLocalAttachments(projectRoot, [comment]))[0] });
|
|
522
|
+
sync.schedule();
|
|
523
|
+
return;
|
|
524
|
+
}
|
|
525
|
+
// The picture of the commented element, sent by the overlay right after the comment exists.
|
|
526
|
+
const screenshotMatch = /^\/__fb\/comments\/([^/]+)\/screenshot$/.exec(url.pathname);
|
|
527
|
+
if (screenshotMatch && method === 'POST') {
|
|
528
|
+
const id = decodeURIComponent(screenshotMatch[1]);
|
|
529
|
+
if (!(await store.list()).some((comment) => comment.id === id)) {
|
|
530
|
+
sendJson(response, 404, { error: 'Comment not found' });
|
|
531
|
+
return;
|
|
532
|
+
}
|
|
533
|
+
const bytes = await readBytes(request, maxLocalScreenshotBytes);
|
|
534
|
+
const saved = bytes
|
|
535
|
+
? await saveLocalScreenshot(projectRoot, id, bytes, {
|
|
536
|
+
width: Math.trunc(Number(url.searchParams.get('w'))) || 0,
|
|
537
|
+
height: Math.trunc(Number(url.searchParams.get('h'))) || 0,
|
|
538
|
+
incomplete: url.searchParams.getAll('incomplete').slice(0, 5).map((note) => note.slice(0, 120)),
|
|
539
|
+
})
|
|
540
|
+
: { status: 413, error: 'too large' };
|
|
541
|
+
sendJson(response, saved.status, saved.error ? { error: saved.error } : { stored: true, path: saved.path });
|
|
542
|
+
// A Cloud project also gets it, for the dashboard, once the comment is acknowledged.
|
|
543
|
+
const mime = bytes ? sniffImage(bytes) : null;
|
|
544
|
+
if (!saved.error && bytes && mime && isRemoteStore(store) && isCloudConfig(store.config)) {
|
|
545
|
+
void store.uploadScreenshot(id, { bytes, mime, width: Math.trunc(Number(url.searchParams.get('w'))) || 0,
|
|
546
|
+
height: Math.trunc(Number(url.searchParams.get('h'))) || 0,
|
|
547
|
+
incomplete: url.searchParams.getAll('incomplete').slice(0, 5).map((note) => note.slice(0, 120)) });
|
|
548
|
+
}
|
|
549
|
+
return;
|
|
550
|
+
}
|
|
551
|
+
// A task's files for an agent (spec: MCP files and comment history): local originals by their
|
|
552
|
+
// path; Cloud ones fetched into .feedback/cache/attachments/ (commentFiles.ts). Fetched only here,
|
|
553
|
+
// when asked, never on a background pull. `inline`: how many images the caller will send inline.
|
|
554
|
+
// 404 `Comment not found` only when no comment has that id here: the MCP tells it apart from a
|
|
555
|
+
// sidecar without this route. Any other failure answers 500 with its cause.
|
|
556
|
+
const filesMatch = /^\/__fb\/comments\/([^/]+)\/files$/.exec(url.pathname);
|
|
557
|
+
if (filesMatch && method === 'POST') {
|
|
558
|
+
let id;
|
|
559
|
+
let body;
|
|
560
|
+
try {
|
|
561
|
+
id = decodeURIComponent(filesMatch[1]);
|
|
562
|
+
}
|
|
563
|
+
catch {
|
|
564
|
+
sendJson(response, 400, { error: 'Malformed comment id' });
|
|
565
|
+
return;
|
|
566
|
+
}
|
|
567
|
+
try {
|
|
568
|
+
body = await readJson(request);
|
|
569
|
+
}
|
|
570
|
+
catch (error) {
|
|
571
|
+
if (error instanceof BodyTooLarge)
|
|
572
|
+
throw error;
|
|
573
|
+
sendJson(response, 400, { error: 'Expected a JSON body' });
|
|
574
|
+
return;
|
|
575
|
+
}
|
|
576
|
+
const inline = body !== null && typeof body === 'object' ? body.inline : undefined;
|
|
577
|
+
let files;
|
|
578
|
+
try {
|
|
579
|
+
files = await commentFiles({ projectRoot, store }, id, { download: true });
|
|
580
|
+
}
|
|
581
|
+
catch (error) {
|
|
582
|
+
sendJson(response, 500, { error: `Could not list this comment's files: ${error instanceof Error ? error.message : String(error)}` });
|
|
583
|
+
return;
|
|
584
|
+
}
|
|
585
|
+
if (!files) {
|
|
586
|
+
sendJson(response, 404, { error: 'Comment not found' });
|
|
587
|
+
return;
|
|
588
|
+
}
|
|
589
|
+
markInline([files], inlineOf(inline));
|
|
590
|
+
sendJson(response, 200, { files });
|
|
591
|
+
return;
|
|
592
|
+
}
|
|
593
|
+
const commentMatch = /^\/__fb\/comments\/([^/]+)$/.exec(url.pathname);
|
|
594
|
+
if (commentMatch && method === 'PATCH') {
|
|
595
|
+
const patch = await readJson(request);
|
|
596
|
+
const refusal = await refuseEdit(store, commentMatch[1], patch);
|
|
597
|
+
if (refusal) {
|
|
598
|
+
sendJson(response, refusal.status, { error: refusal.error });
|
|
599
|
+
return;
|
|
600
|
+
}
|
|
601
|
+
const comment = isRemoteStore(store) ? await store.update(commentMatch[1], patch, actorId) : await store.update(commentMatch[1], patch);
|
|
602
|
+
if (comment) {
|
|
603
|
+
// Resolved, here or by an agent: the copies of its Cloud files go. Local originals stay with the comment.
|
|
604
|
+
if (comment.status === 'resolved')
|
|
605
|
+
await dropCopies(projectRoot, commentMatch[1]);
|
|
606
|
+
sendJson(response, 200, { comment: isRemoteStore(store) ? comment : (await withLocalAttachments(projectRoot, [comment]))[0] });
|
|
607
|
+
sync.schedule();
|
|
608
|
+
return;
|
|
609
|
+
}
|
|
610
|
+
if (isRemoteStore(store)) {
|
|
611
|
+
sendJson(response, 404, { error: 'Comment not found' });
|
|
612
|
+
return;
|
|
613
|
+
}
|
|
614
|
+
// Not in the local store: it may be a pulled one. Resolving it is recorded on this machine
|
|
615
|
+
// only - see `setPulledStatus` - so an agent that has just implemented a change can close
|
|
616
|
+
// it rather than meeting a 404 at the last step of the loop.
|
|
617
|
+
const pulled = (await listPulled(projectRoot)).find((entry) => entry.id === commentMatch[1]);
|
|
618
|
+
if (pulled && (patch.status === 'open' || patch.status === 'resolved')) {
|
|
619
|
+
const record = await setPulledStatus(projectRoot, pulled.id, patch.status, cloudStatusPush(projectRoot));
|
|
620
|
+
if (patch.status === 'resolved')
|
|
621
|
+
await dropCopies(projectRoot, pulled.id);
|
|
622
|
+
// `synced` is reported rather than kept quiet. A comment closed here and open on the
|
|
623
|
+
// reviewer's screen is a divergence they cannot see and the developer would not think to
|
|
624
|
+
// look for; the next pull retries it, and until then the caller knows.
|
|
625
|
+
sendJson(response, 200, {
|
|
626
|
+
comment: { ...pulled, status: patch.status },
|
|
627
|
+
synced: record.synced,
|
|
628
|
+
...(record.reason ? { syncError: record.reason } : {}),
|
|
629
|
+
});
|
|
630
|
+
return;
|
|
631
|
+
}
|
|
632
|
+
if (pulled) {
|
|
633
|
+
sendJson(response, 422, {
|
|
634
|
+
error: 'This comment came from the cloud. It can be resolved here, but not edited - '
|
|
635
|
+
+ 'editing someone else\'s words is theirs to do, in the app they left them in.',
|
|
636
|
+
});
|
|
637
|
+
return;
|
|
638
|
+
}
|
|
639
|
+
sendJson(response, 404, { error: 'Comment not found' });
|
|
640
|
+
return;
|
|
641
|
+
}
|
|
642
|
+
if (commentMatch && method === 'DELETE') {
|
|
643
|
+
const removed = isRemoteStore(store) ? await store.remove(commentMatch[1], actorId) : await store.remove(commentMatch[1]);
|
|
644
|
+
// The picture goes before the answer: a client that reads the folder once told the comment is
|
|
645
|
+
// gone must not still find it there.
|
|
646
|
+
if (removed) {
|
|
647
|
+
await removeLocalScreenshot(projectRoot, commentMatch[1]);
|
|
648
|
+
await dropCopies(projectRoot, commentMatch[1]);
|
|
649
|
+
// Its files, its replies' included, go with it.
|
|
650
|
+
if (!isRemoteStore(store))
|
|
651
|
+
await removeAttachments(projectRoot, commentMatch[1]);
|
|
652
|
+
}
|
|
653
|
+
sendJson(response, removed ? 204 : 404, removed ? null : { error: 'Comment not found' });
|
|
654
|
+
if (removed)
|
|
655
|
+
await sync.noteDeleted(commentMatch[1]);
|
|
656
|
+
return;
|
|
657
|
+
}
|
|
658
|
+
const replyMatch = /^\/__fb\/comments\/([^/]+)\/replies\/([^/]+)$/.exec(url.pathname);
|
|
659
|
+
if (replyMatch && method === 'DELETE' && isRemoteStore(store)) {
|
|
660
|
+
const removed = await store.removeReply(replyMatch[1], replyMatch[2], actorId);
|
|
661
|
+
sendJson(response, removed ? 204 : 404, removed ? null : { error: 'Reply not found' });
|
|
662
|
+
return;
|
|
663
|
+
}
|
|
664
|
+
if (replyMatch && method === 'PATCH') {
|
|
665
|
+
const patch = await readJson(request);
|
|
666
|
+
const refusal = await refuseEdit(store, replyMatch[1], patch);
|
|
667
|
+
if (refusal) {
|
|
668
|
+
sendJson(response, refusal.status, { error: refusal.error });
|
|
669
|
+
return;
|
|
670
|
+
}
|
|
671
|
+
const reply = isRemoteStore(store)
|
|
672
|
+
? await store.updateReply(replyMatch[1], replyMatch[2], { body: stringValue(patch.body) }, actorId)
|
|
673
|
+
: await store.updateReply(replyMatch[1], replyMatch[2], { body: stringValue(patch.body) });
|
|
674
|
+
const shown = reply && !isRemoteStore(store)
|
|
675
|
+
? { ...reply, attachments: (await listAttachments(projectRoot, replyMatch[1])).filter((file) => file.replyId === reply.id) } : reply;
|
|
676
|
+
sendJson(response, reply ? 200 : 404, reply ? { reply: shown } : { error: 'Reply not found' });
|
|
677
|
+
if (reply)
|
|
678
|
+
sync.schedule();
|
|
679
|
+
return;
|
|
680
|
+
}
|
|
681
|
+
const repliesMatch = /^\/__fb\/comments\/([^/]+)\/replies$/.exec(url.pathname);
|
|
682
|
+
if (repliesMatch && method === 'POST') {
|
|
683
|
+
const body = await readJson(request);
|
|
684
|
+
const input = withSafePaths({
|
|
685
|
+
author: stringValue(body.author, 'anonymous'),
|
|
686
|
+
authorId: stringValue(body.authorId) || null,
|
|
687
|
+
body: stringValue(body.body),
|
|
688
|
+
anchor: body.anchor,
|
|
689
|
+
});
|
|
690
|
+
const issues = ingestIssues(replyContentSchema, input);
|
|
691
|
+
if (issues.length > 0) {
|
|
692
|
+
sendJson(response, 400, { error: `Invalid reply: ${issues.slice(0, 5).join('; ')}` });
|
|
693
|
+
return;
|
|
694
|
+
}
|
|
695
|
+
const attachmentIds = attachmentIdsOf(body.attachmentIds);
|
|
696
|
+
if (!attachmentIds) {
|
|
697
|
+
sendJson(response, 400, { error: `Invalid attachmentIds: at most ${ATTACHMENTS.maxFilesPerMessage} distinct upload IDs` });
|
|
698
|
+
return;
|
|
699
|
+
}
|
|
700
|
+
if (attachmentIds.length && isRemoteStore(store) && !store.attachmentsAvailable) {
|
|
701
|
+
sendJson(response, 403, { error: 'Files cannot be attached to an end-to-end encrypted review', reason: 'attachments_unavailable' });
|
|
702
|
+
return;
|
|
703
|
+
}
|
|
704
|
+
const commentId = repliesMatch[1];
|
|
705
|
+
let reply;
|
|
706
|
+
let attachments = [];
|
|
707
|
+
if (isRemoteStore(store))
|
|
708
|
+
reply = await store.addReply(commentId, input, { attachmentIds });
|
|
709
|
+
else if (attachmentIds.length === 0)
|
|
710
|
+
reply = await store.addReply(commentId, input);
|
|
711
|
+
else {
|
|
712
|
+
const local = store;
|
|
713
|
+
const claimed = await claimUploads(projectRoot, attachmentIds, async () => {
|
|
714
|
+
const added = await local.addReply(commentId, input);
|
|
715
|
+
return added && { value: added, comment: commentId, replyId: added.id,
|
|
716
|
+
// The local store can take a reply back; a store that cannot keeps it, as before.
|
|
717
|
+
undo: async () => { await local.removeReply?.(commentId, added.id); } };
|
|
718
|
+
});
|
|
719
|
+
if ('unavailable' in claimed) {
|
|
720
|
+
refuseUnavailable(response, claimed.unavailable);
|
|
721
|
+
return;
|
|
722
|
+
}
|
|
723
|
+
reply = claimed.value;
|
|
724
|
+
attachments = claimed.attachments;
|
|
725
|
+
}
|
|
726
|
+
sendJson(response, reply ? 201 : 404, reply ? { reply: isRemoteStore(store) ? reply : { ...reply, attachments } } : { error: 'Comment not found' });
|
|
727
|
+
if (reply)
|
|
728
|
+
sync.schedule();
|
|
729
|
+
return;
|
|
730
|
+
}
|
|
731
|
+
if (method === 'POST' && url.pathname === '/__fb/export') {
|
|
732
|
+
const body = await readJson(request);
|
|
733
|
+
// With `files` (the MCP asking for tasks), each task's Cloud files are fetched and the first
|
|
734
|
+
// `files.inline` images marked to send inline; without it (the overlay's export), only what is
|
|
735
|
+
// already on this machine is listed, and nothing goes to the network.
|
|
736
|
+
const withFiles = body.files !== null && typeof body.files === 'object';
|
|
737
|
+
const result = await generateAndWriteTaskDoc(source, await allComments(store, projectRoot), {
|
|
738
|
+
commentIds: Array.isArray(body.commentIds) ? body.commentIds : undefined,
|
|
739
|
+
route: typeof body.route === 'string' ? body.route : null,
|
|
740
|
+
appDirectory: typeof body.appDirectory === 'string' && body.appDirectory ? body.appDirectory : null,
|
|
741
|
+
freshness: await pulledFreshness(projectRoot),
|
|
742
|
+
// Downloads within one budget for the whole export (a cold cache could otherwise outlast the
|
|
743
|
+
// MCP call); the files past it are listed, to fetch per task with get_feedback_context.
|
|
744
|
+
filesFor: (ids) => filesForTasks({ projectRoot, store }, ids, withFiles
|
|
745
|
+
? { download: true, inline: inlineOf(body.files.inline), budget: new DownloadBudget() } : { download: false }),
|
|
746
|
+
});
|
|
747
|
+
sendJson(response, 200, result);
|
|
748
|
+
return;
|
|
749
|
+
}
|
|
750
|
+
if (method === 'GET' && url.pathname === '/__fb/source') {
|
|
751
|
+
const file = url.searchParams.get('file');
|
|
752
|
+
const line = Number(url.searchParams.get('line') ?? 0);
|
|
753
|
+
const requested = Number(url.searchParams.get('radius') ?? 5);
|
|
754
|
+
const radius = Math.min(maxSourceRadius, Math.max(0, Number.isFinite(requested) ? Math.trunc(requested) : 5));
|
|
755
|
+
if (!file || !Number.isFinite(line) || line < 1) {
|
|
756
|
+
sendJson(response, 400, { error: 'Expected file and line query params' });
|
|
757
|
+
return;
|
|
758
|
+
}
|
|
759
|
+
// Source files of the app only: never .feedback, dotfiles such as .env, or node_modules.
|
|
760
|
+
if (!(await servableSource(projectRoot, file))) {
|
|
761
|
+
sendJson(response, 404, { error: 'Source not found' });
|
|
762
|
+
return;
|
|
763
|
+
}
|
|
764
|
+
const excerpt = await sourceExcerpt(source, file, line, radius);
|
|
765
|
+
sendJson(response, excerpt ? 200 : 404, excerpt ?? { error: 'Source not found' });
|
|
766
|
+
return;
|
|
767
|
+
}
|
|
768
|
+
sendJson(response, 404, { error: 'Not found' });
|
|
769
|
+
}
|
|
770
|
+
async function sourceExcerpt(source, file, line, radius) {
|
|
771
|
+
// The traversal guard now lives in the reader, which refuses anything outside the
|
|
772
|
+
// project root and returns null rather than throwing.
|
|
773
|
+
const code = await source.readFile(file);
|
|
774
|
+
if (code === null) {
|
|
775
|
+
return null;
|
|
776
|
+
}
|
|
777
|
+
const lines = code.split(/\r?\n/);
|
|
778
|
+
const start = Math.max(1, line - radius);
|
|
779
|
+
const end = Math.min(lines.length, line + radius);
|
|
780
|
+
return {
|
|
781
|
+
file,
|
|
782
|
+
start,
|
|
783
|
+
end,
|
|
784
|
+
lines: lines.slice(start - 1, end).map((text, index) => ({
|
|
785
|
+
line: start + index,
|
|
786
|
+
text,
|
|
787
|
+
})),
|
|
788
|
+
};
|
|
789
|
+
}
|
|
790
|
+
/** Resolves symlinks so /tmp and /private/tmp are recognised as the same place. */
|
|
791
|
+
async function canonical(target) {
|
|
792
|
+
try {
|
|
793
|
+
return await realpath(target);
|
|
794
|
+
}
|
|
795
|
+
catch {
|
|
796
|
+
return target;
|
|
797
|
+
}
|
|
798
|
+
}
|
|
799
|
+
/** The raw body, or null past the limit - read no further than that, whatever is sent. */
|
|
800
|
+
async function readBytes(request, limit) {
|
|
801
|
+
const chunks = [];
|
|
802
|
+
let size = 0;
|
|
803
|
+
for await (const chunk of request) {
|
|
804
|
+
const buffer = Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk);
|
|
805
|
+
size += buffer.length;
|
|
806
|
+
if (size > limit) {
|
|
807
|
+
request.destroy();
|
|
808
|
+
return null;
|
|
809
|
+
}
|
|
810
|
+
chunks.push(buffer);
|
|
811
|
+
}
|
|
812
|
+
return new Uint8Array(Buffer.concat(chunks));
|
|
813
|
+
}
|
|
814
|
+
async function readJson(request) {
|
|
815
|
+
const body = await readLimitedBody(request, maxJsonBodyBytes);
|
|
816
|
+
if (body.length === 0) {
|
|
817
|
+
return {};
|
|
818
|
+
}
|
|
819
|
+
return JSON.parse(body.toString('utf8'));
|
|
820
|
+
}
|
|
821
|
+
/**
|
|
822
|
+
* What a local comment or reply may not be stored with: any field it carries must have the
|
|
823
|
+
* content schema's type and bounds (so `context.route` must be a path), and it must have an
|
|
824
|
+
* anchor object, which every reader dereferences. Missing optional detail stays accepted, as the
|
|
825
|
+
* local store always has.
|
|
826
|
+
*/
|
|
827
|
+
function ingestIssues(schema, input) {
|
|
828
|
+
const anchor = typeof input.anchor === 'object' && input.anchor !== null && !Array.isArray(input.anchor) ? [] : ['anchor: must be an object'];
|
|
829
|
+
return [...anchor, ...schemaIssues(schema, { ...input, v: 1, authorName: input.author }).filter((issue) => !issue.endsWith(': is required'))];
|
|
830
|
+
}
|
|
831
|
+
function stringValue(value, fallback = '') {
|
|
832
|
+
return typeof value === 'string' ? value : fallback;
|
|
833
|
+
}
|
|
834
|
+
/** A new message's `attachmentIds`: absent is none; anything but up to five distinct short strings is refused (null). */
|
|
835
|
+
function attachmentIdsOf(value) {
|
|
836
|
+
if (value === undefined)
|
|
837
|
+
return [];
|
|
838
|
+
if (!Array.isArray(value) || value.length > ATTACHMENTS.maxFilesPerMessage || new Set(value).size !== value.length
|
|
839
|
+
|| value.some((id) => typeof id !== 'string' || id.length > 64))
|
|
840
|
+
return null;
|
|
841
|
+
return value;
|
|
842
|
+
}
|
|
843
|
+
/** A message naming an upload that is not (or no longer) here: nothing was written. */
|
|
844
|
+
function refuseUnavailable(response, id) {
|
|
845
|
+
sendJson(response, 409, { error: 'An attached file is no longer available: add it again', reason: 'attachment_unavailable', id });
|
|
846
|
+
}
|
|
847
|
+
/** A file's bytes as Cloud serves them: inert, private, a download unless it is an image. */
|
|
848
|
+
function sendFile(response, bytes, attachment) {
|
|
849
|
+
response.statusCode = 200;
|
|
850
|
+
response.setHeader('content-type', servedType(attachment.mime));
|
|
851
|
+
response.setHeader('content-length', String(bytes.byteLength));
|
|
852
|
+
response.setHeader('content-disposition', contentDisposition(attachment.kind, attachment.name));
|
|
853
|
+
response.setHeader('x-content-type-options', 'nosniff');
|
|
854
|
+
response.setHeader('content-security-policy', "default-src 'none'; sandbox");
|
|
855
|
+
response.setHeader('cross-origin-resource-policy', 'same-origin');
|
|
856
|
+
response.setHeader('cache-control', 'private, no-store');
|
|
857
|
+
response.end(bytes);
|
|
858
|
+
}
|
|
859
|
+
function sendJson(response, statusCode, body) {
|
|
860
|
+
response.statusCode = statusCode;
|
|
861
|
+
if (statusCode === 204) {
|
|
862
|
+
response.end();
|
|
863
|
+
return;
|
|
864
|
+
}
|
|
865
|
+
response.setHeader('content-type', 'application/json; charset=utf-8');
|
|
866
|
+
response.end(JSON.stringify(body));
|
|
867
|
+
}
|
|
868
|
+
/**
|
|
869
|
+
* Whether an edit should be refused, and why.
|
|
870
|
+
*
|
|
871
|
+
* A resolved comment is the record of what an agent was actually asked to do. Rewriting it
|
|
872
|
+
* afterwards makes that record a lie, so the rule lives here rather than only in the overlay
|
|
873
|
+
* that hides the control: this route is reachable from the MCP server and from any script.
|
|
874
|
+
*
|
|
875
|
+
* Replies follow the comment they belong to. Freezing a comment while leaving its replies
|
|
876
|
+
* writable would freeze nothing.
|
|
877
|
+
*
|
|
878
|
+
* Note this is the only rule enforced here. Who may edit is not: the sidecar matches
|
|
879
|
+
* participants by IP and already treats that as a guess, so it cannot tell one caller from
|
|
880
|
+
* another. The overlay shows the control on your own messages only, which stops you
|
|
881
|
+
* clobbering a colleague's words - it is not a boundary.
|
|
882
|
+
*/
|
|
883
|
+
async function refuseEdit(store, commentId, patch) {
|
|
884
|
+
const editsBody = typeof patch.body === 'string';
|
|
885
|
+
if (!editsBody) {
|
|
886
|
+
return null;
|
|
887
|
+
}
|
|
888
|
+
// Refused whatever the status: allowing it would be "reopen and rewrite" in one call,
|
|
889
|
+
// which is the rule below with an extra step.
|
|
890
|
+
if (patch.status !== undefined) {
|
|
891
|
+
return { status: 400, error: 'Change the body or the status, not both in one call' };
|
|
892
|
+
}
|
|
893
|
+
const comments = await store.list();
|
|
894
|
+
const comment = comments.find((item) => item.id === commentId);
|
|
895
|
+
if (comment?.status === 'resolved') {
|
|
896
|
+
// 423, not the 409 this would otherwise deserve: 409 is already spoken for between the
|
|
897
|
+
// dev-server middleware and the sidecar, where it means "this port belongs to another
|
|
898
|
+
// project, revive and retry". A 409 here is swallowed by that retry and never reaches
|
|
899
|
+
// the caller.
|
|
900
|
+
return { status: 423, error: 'This comment is resolved. Reopen it before editing.' };
|
|
901
|
+
}
|
|
902
|
+
return null;
|
|
903
|
+
}
|
|
904
|
+
//# sourceMappingURL=http.js.map
|