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,181 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What the work order says, as data.
|
|
3
|
+
*
|
|
4
|
+
* ## Why this is separate from the code that renders it
|
|
5
|
+
*
|
|
6
|
+
* Almost all of a work order is our prose: the instructions to the agent, how scope is
|
|
7
|
+
* explained, how a stale anchor is worded. Measured on a real document, **82% of the non-blank
|
|
8
|
+
* lines are text and rules; 18% need the source tree.** The 82% is also exactly the part worth
|
|
9
|
+
* improving as we learn what agents actually do with it.
|
|
10
|
+
*
|
|
11
|
+
* Splitting it out lets that part be served by the cloud and improved for everyone, without
|
|
12
|
+
* anyone reinstalling the package. The rendering stays local, because rendering needs the
|
|
13
|
+
* source: excerpts, component spans, imports, design tokens. None of that is in the cloud and
|
|
14
|
+
* none of it should be.
|
|
15
|
+
*
|
|
16
|
+
* What the cloud does hold is the manifest - `manifest_entry` carries `file`, `line` and
|
|
17
|
+
* `component` in plain columns, because resolving an opaque id is what a manifest is for. The
|
|
18
|
+
* boundary is not "the cloud never sees a path"; it is that **the page never carries one**, so
|
|
19
|
+
* anyone holding a preview link cannot read the file tree. An earlier version of this comment
|
|
20
|
+
* claimed the stronger thing, which was never true of the manifest.
|
|
21
|
+
*
|
|
22
|
+
* ## Data, never code
|
|
23
|
+
*
|
|
24
|
+
* A recipe carries **text keyed by a fact, and numbers**. The conditions stay in the package:
|
|
25
|
+
* `if (facts.hasThreads)` is code and ships with the release. A recipe cannot decide to read a
|
|
26
|
+
* different file, or run anything, because there is nothing in it that could.
|
|
27
|
+
*
|
|
28
|
+
* The honest limit of that: a brand-new condition needs a package release, because the local
|
|
29
|
+
* code has to compute the fact. Rewording, reordering, dropping an instruction and tuning how
|
|
30
|
+
* much source is quoted are all free. Given where the 82% sits, that covers the cases we
|
|
31
|
+
* actually iterate on.
|
|
32
|
+
*/
|
|
33
|
+
/**
|
|
34
|
+
* The recipe that ships with the package.
|
|
35
|
+
*
|
|
36
|
+
* Extracted verbatim from what the renderer used to hold inline, so introducing this changed no
|
|
37
|
+
* output. It is also the floor: an unreachable cloud, a malformed download or a purely local
|
|
38
|
+
* project all land here, and all of them produce exactly the document they produced before.
|
|
39
|
+
*/
|
|
40
|
+
export const bundledRecipe = {
|
|
41
|
+
version: 1,
|
|
42
|
+
instructions: {
|
|
43
|
+
always: [
|
|
44
|
+
'Implement only the feedback tasks below.',
|
|
45
|
+
'Every line you need is listed in the Read Plan. Open those ranges directly; do not search the repository for the components named here.',
|
|
46
|
+
'`Current request` is the reviewer\'s own wording, not a written specification. Read it as intent and decide the concrete change yourself.',
|
|
47
|
+
'Implement each task in the file named under **Where to change it**. You may also change any file listed under **Inside the selection**: those components render inside the element the reviewer pointed at, so going into them follows their selection downward rather than exploring the repository.',
|
|
48
|
+
'Do not change files outside those. Do not settle for a wider edit in a permitted file either: measured agents that could not reach the right file produced confident changes to shared wrappers and icon factories, altering every element passing through them to fix the one the reviewer clicked.',
|
|
49
|
+
'If the change belongs outside that set, return no diff and say where it belongs, naming the file and the rule or symbol. This is a real outcome, not a failure: some changes live in stylesheets or theme mixins, which carry no source anchors and can never appear in the list above. A developer reading "belongs in Actions.scss, the .zoom-out-button rule" can act on it immediately; a diff that approximates it in a permitted file wastes their time and changes more than was asked.',
|
|
50
|
+
'Do not change product copy, data, or content unless a task asks for it.',
|
|
51
|
+
'Keep the listed comment IDs available so they can be resolved after implementation.',
|
|
52
|
+
],
|
|
53
|
+
when: {
|
|
54
|
+
staleCount: [
|
|
55
|
+
'{taskWord} marked **Stale anchor**. Those comments were left against a build of different code, and the line numbers resolve against the working tree rather than against what the reviewer saw. Read the excerpt before changing anything, and if it is not the element the comment describes, say so and make no change.',
|
|
56
|
+
],
|
|
57
|
+
hasThreads: [
|
|
58
|
+
'Where `Thread history` is present, only `Current request` is live. Earlier messages explain how the request evolved and must not become separate tasks.',
|
|
59
|
+
],
|
|
60
|
+
hasLeafMismatch: [
|
|
61
|
+
'`Clicked leaf` is where the reviewer first pointed before widening their selection. It is provenance. Make the change at `Current anchor`.',
|
|
62
|
+
],
|
|
63
|
+
cssUnavailable: [
|
|
64
|
+
// `{cssNotice}` is the reason-specific sentence from `notices.cssUnavailable`. Kept as a
|
|
65
|
+
// placeholder rather than emitted by the renderer so that where it appears is the
|
|
66
|
+
// recipe's decision, like everything else in this list.
|
|
67
|
+
'{cssNotice}',
|
|
68
|
+
'`Styles` lists the selectors the reviewer\'s browser matched. Those marked "source file unknown" have no file against them. That is a gap in this tool, not an ambiguity in the code: do not go looking for those rules, and do not treat a missing file as licence to guess. If a task needs one of them changed, say which selector and what the change is, and leave it to the developer.',
|
|
69
|
+
],
|
|
70
|
+
hasStyles: [
|
|
71
|
+
'`Styles` lists the CSS rules that were styling the element, with the number of elements each one matched. A class is shared by construction and usually more widely than a component, so a rule matching several elements is governed by the reviewer\'s scope answer exactly as a shared JSX definition is. Where that answer forbids a rule, it says so on the rule itself.',
|
|
72
|
+
'Each rule says where it comes from, and that decides where a change goes: a project stylesheet is edited; a utility class, a package\'s rule or an inline style is changed at the anchor instead; CSS-in-JS lives in the component\'s JavaScript. Where the preview\'s build recorded its styles, the file is the one the reviewer was looking at; otherwise it was traced against the working tree as it stands now. A rule that does not exist where it is said to be is stale, not a puzzle: say so rather than finding the nearest similar rule.',
|
|
73
|
+
],
|
|
74
|
+
hasScopeDirection: [
|
|
75
|
+
'`Scope` says how many elements an anchor covered on the page when the comment was left. It is a snapshot of one page state, not a property of the code: a list of three today can be a list of forty tomorrow.',
|
|
76
|
+
'Where `Scope` gives a direction, it came from the reviewer, who was asked whether they meant the one element they clicked or all of them. Follow it. There is no general rule here: measured agents edited the shared definition when the reviewer meant one, and scoped to a single instance when the reviewer meant all. Only the reviewer knows which.',
|
|
77
|
+
],
|
|
78
|
+
},
|
|
79
|
+
},
|
|
80
|
+
notices: {
|
|
81
|
+
staleAnchor: {
|
|
82
|
+
lead: '**Stale anchor: {parts}.** The line numbers below still resolve, but they resolve against the working tree as it stands now, not against what the reviewer saw. Read the excerpt and check it matches what the comment describes. If it does not, say so and make no change: the reviewer is describing code that has since moved, and finding the nearest similar element is how the wrong thing gets edited confidently.',
|
|
83
|
+
gone: '{files} no longer has the line this comment was left on',
|
|
84
|
+
moved: 'the code around {places} has changed since the build the reviewer was looking at',
|
|
85
|
+
unknown: 'this build recorded no fingerprint for these anchors, so whether the code has moved cannot be checked',
|
|
86
|
+
followed: '**Anchor followed:** {moves}. The code moved since the reviewer saw it - lines were added or removed above it - and the element itself is unchanged, matched exactly. The line numbers below are the current ones and can be used as they are.',
|
|
87
|
+
},
|
|
88
|
+
cssUnavailable: {
|
|
89
|
+
'no-app-origin': '**CSS attribution is unavailable for comments from a deployed preview.** Stylesheets are read back through the running dev server, and a comment left on a preview never reaches it, so no selector below could be traced to a source file. This is a limitation of the tool, not a property of these selectors.',
|
|
90
|
+
'no-stylesheets-reachable': '**CSS attribution is unavailable: no stylesheet could be read back.** The project has stylesheets, but none of them could be fetched from the app origin - which is what a deployed preview looks like from here, since the read depends on a dev-server route. No selector below could be traced to a source file, and that is a limitation of the tool rather than a property of these selectors.',
|
|
91
|
+
'no-style-files': '**CSS attribution is unavailable: no stylesheet files were found in this project.** There is nothing to trace these selectors against, so no source file is named below.',
|
|
92
|
+
},
|
|
93
|
+
},
|
|
94
|
+
limits: {
|
|
95
|
+
wholeComponentLimit: 140,
|
|
96
|
+
referenceSpanCap: 120,
|
|
97
|
+
elementPadding: 6,
|
|
98
|
+
headLines: 30,
|
|
99
|
+
},
|
|
100
|
+
};
|
|
101
|
+
/**
|
|
102
|
+
* Substitutes `{name}` from a set of values.
|
|
103
|
+
*
|
|
104
|
+
* The only transformation a recipe undergoes. An unknown placeholder is left as it is rather
|
|
105
|
+
* than blanked: a visible `{oops}` in the output is a bug someone reports, and an empty gap is a
|
|
106
|
+
* sentence that quietly stops making sense.
|
|
107
|
+
*/
|
|
108
|
+
export function fill(template, values) {
|
|
109
|
+
return template.replace(/\{(\w+)\}/g, (whole, key) => key in values ? String(values[key]) : whole);
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Checks a downloaded recipe before anything uses it.
|
|
113
|
+
*
|
|
114
|
+
* Structural, and deliberately strict about the parts whose absence would be invisible. A
|
|
115
|
+
* recipe missing `instructions.always` renders a work order with no instructions at all - which
|
|
116
|
+
* looks like a shorter document rather than a broken one, and an agent would follow it happily
|
|
117
|
+
* into the wrong file.
|
|
118
|
+
*
|
|
119
|
+
* Refusing is safe because there is always somewhere to fall back to.
|
|
120
|
+
*/
|
|
121
|
+
export function checkRecipe(value) {
|
|
122
|
+
const recipe = value;
|
|
123
|
+
if (!recipe || typeof recipe !== 'object')
|
|
124
|
+
return { ok: false, reason: 'not an object' };
|
|
125
|
+
if (!Number.isSafeInteger(recipe.version) || recipe.version < 1)
|
|
126
|
+
return { ok: false, reason: 'no version (expected a positive integer)' };
|
|
127
|
+
const always = recipe.instructions?.always;
|
|
128
|
+
if (!Array.isArray(always) || always.length === 0 || !always.every((line) => typeof line === 'string')) {
|
|
129
|
+
return { ok: false, reason: 'instructions.always must be a non-empty list of strings' };
|
|
130
|
+
}
|
|
131
|
+
const when = recipe.instructions?.when;
|
|
132
|
+
if (!when || typeof when !== 'object' || Array.isArray(when))
|
|
133
|
+
return { ok: false, reason: 'instructions.when is missing' };
|
|
134
|
+
for (const [fact, lines] of Object.entries(when)) {
|
|
135
|
+
if (!Array.isArray(lines) || !lines.every((line) => typeof line === 'string')) {
|
|
136
|
+
return { ok: false, reason: `instructions.when.${fact} must be a list of strings` };
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
const stale = recipe.notices?.staleAnchor;
|
|
140
|
+
for (const key of ['lead', 'gone', 'moved', 'unknown', 'followed']) {
|
|
141
|
+
if (typeof stale?.[key] !== 'string')
|
|
142
|
+
return { ok: false, reason: `notices.staleAnchor.${key} is missing` };
|
|
143
|
+
}
|
|
144
|
+
if (!recipe.notices?.cssUnavailable || typeof recipe.notices.cssUnavailable !== 'object'
|
|
145
|
+
|| Array.isArray(recipe.notices.cssUnavailable)
|
|
146
|
+
|| !Object.values(recipe.notices.cssUnavailable).every((notice) => typeof notice === 'string')) {
|
|
147
|
+
return { ok: false, reason: 'notices.cssUnavailable is missing' };
|
|
148
|
+
}
|
|
149
|
+
const limits = recipe.limits;
|
|
150
|
+
for (const key of ['wholeComponentLimit', 'referenceSpanCap', 'elementPadding', 'headLines']) {
|
|
151
|
+
const n = limits?.[key];
|
|
152
|
+
// Bounded, not merely numeric. A `wholeComponentLimit` of 100000 would quote whole files
|
|
153
|
+
// into the read plan, and the failure would be a work order too large to be useful rather
|
|
154
|
+
// than an error anyone sees.
|
|
155
|
+
if (typeof n !== 'number' || !Number.isFinite(n) || n < 1 || n > 1000) {
|
|
156
|
+
return { ok: false, reason: `limits.${key} must be a number between 1 and 1000` };
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
return { ok: true, recipe };
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* The recipe to render with, given whatever was cached.
|
|
163
|
+
*
|
|
164
|
+
* Falls back rather than failing, and says which it used. An export that stops because our
|
|
165
|
+
* server is unreachable would make our downtime someone else's outage, over text that barely
|
|
166
|
+
* changes.
|
|
167
|
+
*/
|
|
168
|
+
export function resolveRecipe(cached) {
|
|
169
|
+
if (cached === null || cached === undefined)
|
|
170
|
+
return { recipe: bundledRecipe, source: 'bundled' };
|
|
171
|
+
const checked = checkRecipe(cached);
|
|
172
|
+
if (!checked.ok)
|
|
173
|
+
return { recipe: bundledRecipe, source: 'bundled', reason: checked.reason };
|
|
174
|
+
// An older recipe than the one we ship is not used. It would be a downgrade for anyone who
|
|
175
|
+
// updated the package, and the cache can outlive several releases.
|
|
176
|
+
if (checked.recipe.version < bundledRecipe.version) {
|
|
177
|
+
return { recipe: bundledRecipe, source: 'bundled', reason: 'the cached recipe is older than the bundled one' };
|
|
178
|
+
}
|
|
179
|
+
return { recipe: checked.recipe, source: 'cloud' };
|
|
180
|
+
}
|
|
181
|
+
//# sourceMappingURL=recipe.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"recipe.js","sourceRoot":"","sources":["../../src/core/recipe.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAqCH;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,aAAa,GAAW;IACnC,OAAO,EAAE,CAAC;IACV,YAAY,EAAE;QACZ,MAAM,EAAE;YACN,0CAA0C;YAC1C,yIAAyI;YACzI,2IAA2I;YAC3I,uSAAuS;YACvS,sSAAsS;YACtS,geAAge;YAChe,yEAAyE;YACzE,qFAAqF;SACtF;QACD,IAAI,EAAE;YACJ,UAAU,EAAE;gBACV,4TAA4T;aAC7T;YACD,UAAU,EAAE;gBACV,yJAAyJ;aAC1J;YACD,eAAe,EAAE;gBACf,4IAA4I;aAC7I;YACD,cAAc,EAAE;gBACd,yFAAyF;gBACzF,kFAAkF;gBAClF,wDAAwD;gBACxD,aAAa;gBACb,8XAA8X;aAC/X;YAC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AAC;IAEjG,MAAM,OAAO,GAAG,WAAW,CAAC,MAAM,CAAC,CAAC;IACpC,IAAI,CAAC,OAAO,CAAC,EAAE;QAAE,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,CAAC;IAE7F,2FAA2F;IAC3F,mEAAmE;IACnE,IAAI,OAAO,CAAC,MAAM,CAAC,OAAO,GAAG,aAAa,CAAC,OAAO,EAAE,CAAC;QACnD,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,iDAAiD,EAAE,CAAC;IACjH,CAAC;IAED,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC;AACrD,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A recording's steps as text for an agent (an rrweb recording a reviewer attached): clicks, the fields
|
|
3
|
+
* typed in, route changes and scrolls, with the time of each. It never carries a value a person typed
|
|
4
|
+
* (an input event's `text`, an element's `value`), and says only what the page's own markup named: the
|
|
5
|
+
* recording is the reviewer's data, so everything it holds is cut short and made one line. Pure.
|
|
6
|
+
*/
|
|
7
|
+
export declare const MAX_SUMMARY_LINES = 40;
|
|
8
|
+
/**
|
|
9
|
+
* `events` are the recording's, already known to be objects with a numeric `type` and `timestamp`
|
|
10
|
+
* (the Worker checked that); anything else inside them is read defensively. At most MAX_SUMMARY_LINES.
|
|
11
|
+
*/
|
|
12
|
+
export declare function summarizeRecording(events: unknown[], durationMs: number): string[];
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import { inlineText } from './untrusted.js';
|
|
2
|
+
/**
|
|
3
|
+
* A recording's steps as text for an agent (an rrweb recording a reviewer attached): clicks, the fields
|
|
4
|
+
* typed in, route changes and scrolls, with the time of each. It never carries a value a person typed
|
|
5
|
+
* (an input event's `text`, an element's `value`), and says only what the page's own markup named: the
|
|
6
|
+
* recording is the reviewer's data, so everything it holds is cut short and made one line. Pure.
|
|
7
|
+
*/
|
|
8
|
+
export const MAX_SUMMARY_LINES = 40;
|
|
9
|
+
/** The most a scroll must move, in pixels, to be a step. */
|
|
10
|
+
const SIGNIFICANT_SCROLL = 200;
|
|
11
|
+
/** Events this close together are one gesture: a scroll, typing in a field. */
|
|
12
|
+
const GESTURE_MS = 600;
|
|
13
|
+
const record = (value) => (typeof value === 'object' && value !== null && !Array.isArray(value) ? value : {});
|
|
14
|
+
const text = (value) => (typeof value === 'string' ? value : '');
|
|
15
|
+
const FIELDS = new Set(['input', 'textarea', 'select', 'option']);
|
|
16
|
+
/** The visible words under a node, shallowest first, a few of them: never a field's own content. */
|
|
17
|
+
function wordsUnder(node, budget = 80, depth = 0) {
|
|
18
|
+
if (depth > 6 || budget <= 0)
|
|
19
|
+
return '';
|
|
20
|
+
if (node.type === 3)
|
|
21
|
+
return text(node.textContent).trim().slice(0, budget);
|
|
22
|
+
if (node.type !== 2 || FIELDS.has(text(node.tagName).toLowerCase()) || ['script', 'style'].includes(text(node.tagName).toLowerCase()))
|
|
23
|
+
return '';
|
|
24
|
+
let out = '';
|
|
25
|
+
for (const child of node.childNodes ?? []) {
|
|
26
|
+
const found = wordsUnder(child, budget - out.length, depth + 1);
|
|
27
|
+
if (found)
|
|
28
|
+
out = `${out} ${found}`.trim();
|
|
29
|
+
if (out.length >= budget)
|
|
30
|
+
break;
|
|
31
|
+
}
|
|
32
|
+
return out;
|
|
33
|
+
}
|
|
34
|
+
/** A selector-like name: `button#save.primary`, from the tag, id and the first two classes. */
|
|
35
|
+
function selectorOf(element) {
|
|
36
|
+
const id = text(element.attributes.id).match(/^[\w-]{1,40}$/)?.[0];
|
|
37
|
+
const classes = text(element.attributes.class).split(/\s+/).filter((name) => /^[\w-]{1,30}$/.test(name)).slice(0, 2);
|
|
38
|
+
return `${element.tag}${id ? `#${id}` : ''}${classes.map((name) => `.${name}`).join('')}`;
|
|
39
|
+
}
|
|
40
|
+
/** How a person would name a field: its label, name, placeholder or id; never its value. */
|
|
41
|
+
function fieldOf(element) {
|
|
42
|
+
const named = ['aria-label', 'name', 'placeholder', 'id'].map((key) => text(element.attributes[key]).trim()).find(Boolean);
|
|
43
|
+
const type = text(element.attributes.type);
|
|
44
|
+
return `${element.tag}${type && element.tag === 'input' ? `[type=${inlineText(type, 20)}]` : ''}${named ? ` "${inlineText(named, 40)}"` : ''}`;
|
|
45
|
+
}
|
|
46
|
+
function clickOf(element) {
|
|
47
|
+
const words = element.text ? ` "${inlineText(element.text, 50)}"` : '';
|
|
48
|
+
return FIELDS.has(element.tag) ? fieldOf(element) : `${selectorOf(element)}${words}`;
|
|
49
|
+
}
|
|
50
|
+
const clock = (ms) => `${Math.floor(ms / 60000)}:${String(Math.floor(ms / 1000) % 60).padStart(2, '0')}`;
|
|
51
|
+
const pathOf = (href) => { try {
|
|
52
|
+
return new URL(text(href), 'http://page.invalid').pathname.slice(0, 120) || '/';
|
|
53
|
+
}
|
|
54
|
+
catch {
|
|
55
|
+
return null;
|
|
56
|
+
} };
|
|
57
|
+
/**
|
|
58
|
+
* `events` are the recording's, already known to be objects with a numeric `type` and `timestamp`
|
|
59
|
+
* (the Worker checked that); anything else inside them is read defensively. At most MAX_SUMMARY_LINES.
|
|
60
|
+
*/
|
|
61
|
+
export function summarizeRecording(events, durationMs) {
|
|
62
|
+
const nodes = new Map();
|
|
63
|
+
const remember = (node) => {
|
|
64
|
+
if (!node || typeof node !== 'object')
|
|
65
|
+
return;
|
|
66
|
+
if (node.type === 2 && typeof node.id === 'number') {
|
|
67
|
+
nodes.set(node.id, { tag: inlineText(text(node.tagName).toLowerCase(), 20) || 'element', attributes: record(node.attributes), text: wordsUnder(node) });
|
|
68
|
+
}
|
|
69
|
+
for (const child of Array.isArray(node.childNodes) ? node.childNodes : [])
|
|
70
|
+
remember(child);
|
|
71
|
+
};
|
|
72
|
+
const steps = [];
|
|
73
|
+
let start = Infinity;
|
|
74
|
+
for (const event of events)
|
|
75
|
+
start = Math.min(start, Number(record(event).timestamp));
|
|
76
|
+
let route = null;
|
|
77
|
+
let scroll = null;
|
|
78
|
+
let typed = null;
|
|
79
|
+
const at = (timestamp) => `[${clock(timestamp - start)}]`;
|
|
80
|
+
const flushScroll = () => {
|
|
81
|
+
if (scroll && Math.abs(scroll.to - scroll.from) >= SIGNIFICANT_SCROLL)
|
|
82
|
+
steps.push(`${at(scroll.at)} scroll ${scroll.to > scroll.from ? 'down' : 'up'} ${Math.round(Math.abs(scroll.to - scroll.from))}px`);
|
|
83
|
+
scroll = null;
|
|
84
|
+
};
|
|
85
|
+
const navigate = (timestamp, href) => {
|
|
86
|
+
const next = pathOf(href);
|
|
87
|
+
if (next !== null && next !== route) {
|
|
88
|
+
steps.push(`${at(timestamp)} ${route === null ? 'page' : 'go to'} ${inlineText(next, 120)}`);
|
|
89
|
+
route = next;
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
for (const raw of events) {
|
|
93
|
+
const event = record(raw);
|
|
94
|
+
const when = Number(event.timestamp);
|
|
95
|
+
const data = record(event.data);
|
|
96
|
+
if (event.type === 2) {
|
|
97
|
+
remember(data.node);
|
|
98
|
+
continue;
|
|
99
|
+
}
|
|
100
|
+
if (event.type === 4) {
|
|
101
|
+
navigate(when, data.href);
|
|
102
|
+
continue;
|
|
103
|
+
}
|
|
104
|
+
// A route change the overlay noted: pushState and hash changes make no Meta event of their own.
|
|
105
|
+
if (event.type === 5 && data.tag === 'route') {
|
|
106
|
+
navigate(when, record(data.payload).href);
|
|
107
|
+
continue;
|
|
108
|
+
}
|
|
109
|
+
if (event.type !== 3)
|
|
110
|
+
continue;
|
|
111
|
+
if (data.source === 0) {
|
|
112
|
+
for (const add of Array.isArray(data.adds) ? data.adds : [])
|
|
113
|
+
remember(record(add).node);
|
|
114
|
+
continue;
|
|
115
|
+
}
|
|
116
|
+
if (data.source === 3) {
|
|
117
|
+
const y = Number(data.y) || 0;
|
|
118
|
+
if (scroll && when - scroll.last <= GESTURE_MS) {
|
|
119
|
+
scroll.to = y;
|
|
120
|
+
scroll.last = when;
|
|
121
|
+
}
|
|
122
|
+
else {
|
|
123
|
+
flushScroll();
|
|
124
|
+
scroll = { at: when, from: y, to: y, last: when };
|
|
125
|
+
}
|
|
126
|
+
continue;
|
|
127
|
+
}
|
|
128
|
+
flushScroll();
|
|
129
|
+
if (data.source === 2 && (data.type === 2 || data.type === 4)) {
|
|
130
|
+
const target = nodes.get(Number(data.id));
|
|
131
|
+
steps.push(`${at(when)} ${data.type === 4 ? 'double-click' : 'click'} ${target ? clickOf(target) : 'an element that was not on the page at the start'}`);
|
|
132
|
+
typed = null;
|
|
133
|
+
}
|
|
134
|
+
else if (data.source === 5) {
|
|
135
|
+
const id = Number(data.id);
|
|
136
|
+
// One line for a run of typing in one field; its text is never read.
|
|
137
|
+
if (!typed || typed.id !== id || when - typed.last > GESTURE_MS * 5) {
|
|
138
|
+
const target = nodes.get(id);
|
|
139
|
+
steps.push(`${at(when)} type in ${target ? fieldOf(target) : 'a field'} (value not shown)`);
|
|
140
|
+
}
|
|
141
|
+
typed = { id, last: when };
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
flushScroll();
|
|
145
|
+
const head = `Recording: ${clock(durationMs)} long, ${events.length} events, ${steps.length} step${steps.length === 1 ? '' : 's'}.`;
|
|
146
|
+
if (steps.length <= MAX_SUMMARY_LINES - 1)
|
|
147
|
+
return [head, ...steps];
|
|
148
|
+
return [head, ...steps.slice(0, MAX_SUMMARY_LINES - 2), `… ${steps.length - (MAX_SUMMARY_LINES - 2)} more steps not shown.`];
|
|
149
|
+
}
|
|
150
|
+
//# sourceMappingURL=recordingSummary.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"recordingSummary.js","sourceRoot":"","sources":["../../src/core/recordingSummary.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAE5C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,IAAI,CAAC,YAAY,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,SAAS,oBAAoB,CAAC,CAAC;YAC9F,CAAC;YACD,KAAK,GAAG,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;QAC7B,CAAC;IACH,CAAC;IACD,WAAW,EAAE,CAAC;IACd,MAAM,IAAI,GAAG,cAAc,KAAK,CAAC,UAAU,CAAC,UAAU,MAAM,CAAC,MAAM,YAAY,KAAK,CAAC,MAAM,QAAQ,KAAK,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC;IACpI,IAAI,KAAK,CAAC,MAAM,IAAI,iBAAiB,GAAG,CAAC;QAAE,OAAO,CAAC,IAAI,EAAE,GAAG,KAAK,CAAC,CAAC;IACnE,OAAO,CAAC,IAAI,EAAE,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,iBAAiB,GAAG,CAAC,CAAC,EAAE,KAAK,KAAK,CAAC,MAAM,GAAG,CAAC,iBAAiB,GAAG,CAAC,CAAC,wBAAwB,CAAC,CAAC;AAC/H,CAAC"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import type { Comment } from './feedbackTypes.js';
|
|
2
|
+
/**
|
|
3
|
+
* Turns the opaque ids in a comment back into source locations.
|
|
4
|
+
*
|
|
5
|
+
* A comment made against a shared build carries ids and nothing else: the browser never had
|
|
6
|
+
* a path to record. This runs on the developer's machine, where the manifest — or the repo
|
|
7
|
+
* and the secret — can say what each id meant. Everything downstream of here, the read plan
|
|
8
|
+
* included, sees ordinary anchors and does not need to know which mode the comment came
|
|
9
|
+
* from.
|
|
10
|
+
*/
|
|
11
|
+
export type AnchorLocation = {
|
|
12
|
+
file: string;
|
|
13
|
+
line: number;
|
|
14
|
+
column: number;
|
|
15
|
+
component: string | null;
|
|
16
|
+
};
|
|
17
|
+
/** Anything that can say where an id came from: a manifest, or a recomputed index. */
|
|
18
|
+
export type AnchorIndex = {
|
|
19
|
+
lookup(id: string): AnchorLocation | undefined;
|
|
20
|
+
};
|
|
21
|
+
export declare function indexFrom(entries: (AnchorLocation & {
|
|
22
|
+
id: string;
|
|
23
|
+
})[]): AnchorIndex;
|
|
24
|
+
/** A manifest, as far as resolution needs to know. Structural, so core stays free of the sink. */
|
|
25
|
+
export type ResolvableManifest = {
|
|
26
|
+
buildId: string;
|
|
27
|
+
secret: string;
|
|
28
|
+
branch?: string | null;
|
|
29
|
+
entries: (AnchorLocation & {
|
|
30
|
+
id: string;
|
|
31
|
+
})[];
|
|
32
|
+
};
|
|
33
|
+
export type IndexResult = {
|
|
34
|
+
ok: true;
|
|
35
|
+
index: AnchorIndex;
|
|
36
|
+
} | {
|
|
37
|
+
ok: false;
|
|
38
|
+
reason: 'secret-rotated';
|
|
39
|
+
message: string;
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* Builds a lookup from a manifest, refusing outright if the secret has changed.
|
|
43
|
+
*
|
|
44
|
+
* A rotated secret and stale code produce the same symptom - nothing resolves - and they
|
|
45
|
+
* need opposite responses. Stale means the code moved and the developer should look at the
|
|
46
|
+
* file. Rotated means every id in this manifest was computed from a key that does not
|
|
47
|
+
* exist, the file is dead, and no amount of looking at code will help; they need to re-link
|
|
48
|
+
* the project and rebuild.
|
|
49
|
+
*
|
|
50
|
+
* So this refuses the whole manifest rather than letting every lookup miss. Reporting
|
|
51
|
+
* forty-one unresolvable anchors when the real answer is "your secret changed" sends someone
|
|
52
|
+
* to the wrong place for an afternoon.
|
|
53
|
+
*
|
|
54
|
+
* Note this is not branch-aware and must not become so. Branch filters which comments are
|
|
55
|
+
* shown; it takes no part in turning an id into a location.
|
|
56
|
+
*/
|
|
57
|
+
export declare function indexFromManifest(manifest: ResolvableManifest, secret: string): IndexResult;
|
|
58
|
+
export type Resolution = {
|
|
59
|
+
comment: Comment;
|
|
60
|
+
/** Ids with no entry: the build is gone, or the comment predates a secret rotation. */
|
|
61
|
+
unresolved: string[];
|
|
62
|
+
};
|
|
63
|
+
/**
|
|
64
|
+
* Resolves every anchor on a comment, and reports what it could not.
|
|
65
|
+
*
|
|
66
|
+
* An unresolved id is left as it is rather than dropped or guessed at. A comment that points
|
|
67
|
+
* nowhere is a thing the reviewer can be told about; a comment silently pointed at the wrong
|
|
68
|
+
* line is not, and this tool's whole claim is that it names the right lines.
|
|
69
|
+
*/
|
|
70
|
+
export declare function resolveComment(comment: Comment, index: AnchorIndex): Resolution;
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { secretFingerprint } from './anchorId.js';
|
|
2
|
+
export function indexFrom(entries) {
|
|
3
|
+
const map = new Map(entries.map((entry) => [entry.id, entry]));
|
|
4
|
+
return { lookup: (id) => map.get(id) };
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Builds a lookup from a manifest, refusing outright if the secret has changed.
|
|
8
|
+
*
|
|
9
|
+
* A rotated secret and stale code produce the same symptom - nothing resolves - and they
|
|
10
|
+
* need opposite responses. Stale means the code moved and the developer should look at the
|
|
11
|
+
* file. Rotated means every id in this manifest was computed from a key that does not
|
|
12
|
+
* exist, the file is dead, and no amount of looking at code will help; they need to re-link
|
|
13
|
+
* the project and rebuild.
|
|
14
|
+
*
|
|
15
|
+
* So this refuses the whole manifest rather than letting every lookup miss. Reporting
|
|
16
|
+
* forty-one unresolvable anchors when the real answer is "your secret changed" sends someone
|
|
17
|
+
* to the wrong place for an afternoon.
|
|
18
|
+
*
|
|
19
|
+
* Note this is not branch-aware and must not become so. Branch filters which comments are
|
|
20
|
+
* shown; it takes no part in turning an id into a location.
|
|
21
|
+
*/
|
|
22
|
+
export function indexFromManifest(manifest, secret) {
|
|
23
|
+
const expected = secretFingerprint(secret);
|
|
24
|
+
if (manifest.secret !== expected) {
|
|
25
|
+
return {
|
|
26
|
+
ok: false,
|
|
27
|
+
reason: 'secret-rotated',
|
|
28
|
+
message: `feedback: the project secret has changed since build ${manifest.buildId} was made.\n` +
|
|
29
|
+
' Every anchor id in that build was derived from the old secret, so none of them can ' +
|
|
30
|
+
'be resolved and the manifest is dead. This is not stale code: the file has not moved.\n' +
|
|
31
|
+
' Re-link the project to pick up the current secret, then rebuild. Comments made ' +
|
|
32
|
+
'against the old build cannot be resolved at all and will need replacing.',
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
return { ok: true, index: indexFrom(manifest.entries) };
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Resolves every anchor on a comment, and reports what it could not.
|
|
39
|
+
*
|
|
40
|
+
* An unresolved id is left as it is rather than dropped or guessed at. A comment that points
|
|
41
|
+
* nowhere is a thing the reviewer can be told about; a comment silently pointed at the wrong
|
|
42
|
+
* line is not, and this tool's whole claim is that it names the right lines.
|
|
43
|
+
*/
|
|
44
|
+
export function resolveComment(comment, index) {
|
|
45
|
+
const unresolved = [];
|
|
46
|
+
const resolveOne = (anchor) => {
|
|
47
|
+
if (!anchor.id) {
|
|
48
|
+
return anchor;
|
|
49
|
+
}
|
|
50
|
+
const found = index.lookup(anchor.id);
|
|
51
|
+
if (!found) {
|
|
52
|
+
unresolved.push(anchor.id);
|
|
53
|
+
return anchor;
|
|
54
|
+
}
|
|
55
|
+
return {
|
|
56
|
+
...anchor,
|
|
57
|
+
file: found.file,
|
|
58
|
+
line: found.line,
|
|
59
|
+
column: found.column,
|
|
60
|
+
componentName: anchor.componentName ?? found.component,
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
const resolved = {
|
|
64
|
+
...comment,
|
|
65
|
+
anchor: resolveOne(comment.anchor),
|
|
66
|
+
leafAnchor: comment.leafAnchor ? resolveOne(comment.leafAnchor) : comment.leafAnchor,
|
|
67
|
+
anchorChain: comment.anchorChain?.map(resolveOne),
|
|
68
|
+
// Holds ids rather than paths when the page was a shared build. De-duplicated after
|
|
69
|
+
// resolution, because several ids in one file are one file to the agent.
|
|
70
|
+
insideSelection: comment.insideSelection
|
|
71
|
+
? resolveInside(comment.insideSelection, index, unresolved)
|
|
72
|
+
: comment.insideSelection,
|
|
73
|
+
replies: comment.replies.map((reply) => ({ ...reply, anchor: resolveOne(reply.anchor) })),
|
|
74
|
+
};
|
|
75
|
+
return { comment: resolved, unresolved: [...new Set(unresolved)] };
|
|
76
|
+
}
|
|
77
|
+
function resolveInside(values, index, unresolved) {
|
|
78
|
+
const files = [];
|
|
79
|
+
const seen = new Set();
|
|
80
|
+
for (const value of values) {
|
|
81
|
+
// A path already: a local-mode comment, left alone.
|
|
82
|
+
if (value.includes('/') || value.includes('.')) {
|
|
83
|
+
if (!seen.has(value)) {
|
|
84
|
+
seen.add(value);
|
|
85
|
+
files.push(value);
|
|
86
|
+
}
|
|
87
|
+
continue;
|
|
88
|
+
}
|
|
89
|
+
const found = index.lookup(value);
|
|
90
|
+
if (!found) {
|
|
91
|
+
unresolved.push(value);
|
|
92
|
+
continue;
|
|
93
|
+
}
|
|
94
|
+
if (!seen.has(found.file)) {
|
|
95
|
+
seen.add(found.file);
|
|
96
|
+
files.push(found.file);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
return files;
|
|
100
|
+
}
|
|
101
|
+
//# sourceMappingURL=resolveAnchors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolveAnchors.js","sourceRoot":"","sources":["../../src/core/resolveAnchors.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAwBlD,MAAM,UAAU,SAAS,CAAC,OAA4C;IACpE,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC;IAC/D,OAAO,EAAE,MAAM,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC;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YACpB,CAAC;YACD,SAAS;QACX,CAAC;QAED,MAAM,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAClC,IAAI,CAAC,KAAK,EAAE,CAAC;YACX,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YACvB,SAAS;QACX,CAAC;QACD,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;YAC1B,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;YACrB,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QACzB,CAAC;IACH,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Adds an import to a single-file component (Vue, Svelte), for pages not built from an index.html.
|
|
3
|
+
*
|
|
4
|
+
* A component is not JavaScript until its framework has compiled it, so the import goes inside
|
|
5
|
+
* its `<script>`: straight after the opening tag, on the same line, so no line in the file moves
|
|
6
|
+
* and every anchor stamped from it stays true. The component's own script is the one at the start
|
|
7
|
+
* of a line; a `<script>` written inside the markup (a JSON-LD block in `<svelte:head>`) is not
|
|
8
|
+
* it. A component with no script gets one at the end, after everything else.
|
|
9
|
+
*/
|
|
10
|
+
export declare function withScriptImport(code: string, statement: string, emptyScript?: string): string;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Adds an import to a single-file component (Vue, Svelte), for pages not built from an index.html.
|
|
3
|
+
*
|
|
4
|
+
* A component is not JavaScript until its framework has compiled it, so the import goes inside
|
|
5
|
+
* its `<script>`: straight after the opening tag, on the same line, so no line in the file moves
|
|
6
|
+
* and every anchor stamped from it stays true. The component's own script is the one at the start
|
|
7
|
+
* of a line; a `<script>` written inside the markup (a JSON-LD block in `<svelte:head>`) is not
|
|
8
|
+
* it. A component with no script gets one at the end, after everything else.
|
|
9
|
+
*/
|
|
10
|
+
export function withScriptImport(code, statement, emptyScript = '<script>') {
|
|
11
|
+
const script = /^<script\b(?![^>]*\bsrc=)[^>]*>/m.exec(code) ?? /<script\b(?![^>]*\bsrc=)[^>]*>/i.exec(code);
|
|
12
|
+
if (script) {
|
|
13
|
+
const at = script.index + script[0].length;
|
|
14
|
+
return `${code.slice(0, at)}${statement}${code.slice(at)}`;
|
|
15
|
+
}
|
|
16
|
+
return `${code}\n${emptyScript}${statement}</script>\n`;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=scriptImport.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scriptImport.js","sourceRoot":"","sources":["../../src/core/scriptImport.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,MAAM,UAAU,gBAAgB,CAAC,IAAY,EAAE,SAAiB,EAAE,WAAW,GAAG,UAAU;IACxF,MAAM,MAAM,GAAG,kCAAkC,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,iCAAiC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC7G,IAAI,MAAM,EAAE,CAAC;QACX,MAAM,EAAE,GAAG,MAAM,CAAC,KAAK,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;QAC3C,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,EAAE,CAAC;IAC7D,CAAC;IACD,OAAO,GAAG,IAAI,KAAK,WAAW,GAAG,SAAS,aAAa,CAAC;AAC1D,CAAC"}
|