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
package/dist/mcp/cli.js
ADDED
|
@@ -0,0 +1,327 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { existsSync, readdirSync, readFileSync } from 'node:fs';
|
|
3
|
+
import path from 'node:path';
|
|
4
|
+
import { startOrAttachSidecar } from '../integration/sidecarProcess.js';
|
|
5
|
+
import { packageNames } from '../setup/detect.js';
|
|
6
|
+
import { startStdioMcpServer } from './server.js';
|
|
7
|
+
const argv = process.argv.slice(2);
|
|
8
|
+
const command = argv[0] === 'init' ? 'init' : 'serve';
|
|
9
|
+
const options = parseFlags(argv);
|
|
10
|
+
// Repeatable: one --root per app. With none, the directory it was started in.
|
|
11
|
+
const roots = (options.roots.length > 0 ? options.roots : [process.cwd()]).map((root) => path.resolve(root));
|
|
12
|
+
const port = Number(options.port ?? 7331);
|
|
13
|
+
if (command === 'init') {
|
|
14
|
+
process.exitCode = printConfigSnippet(roots[0]);
|
|
15
|
+
}
|
|
16
|
+
else {
|
|
17
|
+
// Attaching (or starting, if the dev server is not up yet) keeps a single owner of each
|
|
18
|
+
// store. Nothing may be written to stdout before the transport connects: stdout is the
|
|
19
|
+
// MCP channel, so diagnostics go to stderr.
|
|
20
|
+
//
|
|
21
|
+
// One sidecar per app, and that part is not optional: an anchor is a path inside one app,
|
|
22
|
+
// and each app's store and source tree are its own. What one server removes is the need for
|
|
23
|
+
// one config entry per app.
|
|
24
|
+
const base = process.cwd();
|
|
25
|
+
const projects = [];
|
|
26
|
+
for (const root of roots) {
|
|
27
|
+
const sidecar = await startOrAttachSidecar({ projectRoot: root, port });
|
|
28
|
+
process.stderr.write(`[feedback] MCP bridging ${root} to sidecar on :${sidecar.port}\n`);
|
|
29
|
+
projects.push({
|
|
30
|
+
name: appDirectoryFor(base, root) ?? path.basename(root),
|
|
31
|
+
root,
|
|
32
|
+
sidecarUrl: `http://127.0.0.1:${sidecar.port}`,
|
|
33
|
+
appDirectory: appDirectoryFor(base, root),
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
await startStdioMcpServer({ projects });
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Where an app sits from where the agent is working, or null when it is the same place.
|
|
40
|
+
*
|
|
41
|
+
* The client starts this process in its own working directory - for an agent at a monorepo's
|
|
42
|
+
* root, that is the root - so this is the prefix that turns an app-relative `src/Hero.tsx` into
|
|
43
|
+
* a path the agent can open. Outside the working directory entirely, the absolute path is the
|
|
44
|
+
* only one that resolves.
|
|
45
|
+
*/
|
|
46
|
+
function appDirectoryFor(base, root) {
|
|
47
|
+
const relative = path.relative(base, root);
|
|
48
|
+
if (!relative)
|
|
49
|
+
return null;
|
|
50
|
+
if (relative.startsWith('..') || path.isAbsolute(relative))
|
|
51
|
+
return root.split(path.sep).join('/');
|
|
52
|
+
return relative.split(path.sep).join('/');
|
|
53
|
+
}
|
|
54
|
+
function parseFlags(args) {
|
|
55
|
+
const flags = { roots: [] };
|
|
56
|
+
for (let index = 0; index < args.length; index += 1) {
|
|
57
|
+
const arg = args[index];
|
|
58
|
+
if (!arg?.startsWith('--'))
|
|
59
|
+
continue;
|
|
60
|
+
const value = args[index + 1] ?? '';
|
|
61
|
+
index += 1;
|
|
62
|
+
// Collected rather than overwritten: the last --root used to win silently, so a second app
|
|
63
|
+
// passed on the command line was dropped with no sign that it had been.
|
|
64
|
+
if (arg === '--root')
|
|
65
|
+
flags.roots.push(value);
|
|
66
|
+
else if (arg === '--port')
|
|
67
|
+
flags.port = value;
|
|
68
|
+
}
|
|
69
|
+
return flags;
|
|
70
|
+
}
|
|
71
|
+
/** The nearest directory at or above `from` containing any of `names`, and which one it held. */
|
|
72
|
+
function findUp(from, names) {
|
|
73
|
+
let dir = from;
|
|
74
|
+
for (;;) {
|
|
75
|
+
for (const name of names) {
|
|
76
|
+
if (existsSync(path.join(dir, name)))
|
|
77
|
+
return { dir, name };
|
|
78
|
+
}
|
|
79
|
+
const parent = path.dirname(dir);
|
|
80
|
+
if (parent === dir)
|
|
81
|
+
return null;
|
|
82
|
+
dir = parent;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
/** Which package manager owns this project, read from its lockfile. */
|
|
86
|
+
function detectManager(root) {
|
|
87
|
+
const found = findUp(root, ['pnpm-lock.yaml', 'yarn.lock', 'bun.lockb', 'bun.lock', 'package-lock.json']);
|
|
88
|
+
if (found?.name === 'pnpm-lock.yaml')
|
|
89
|
+
return 'pnpm';
|
|
90
|
+
if (found?.name === 'yarn.lock')
|
|
91
|
+
return 'yarn';
|
|
92
|
+
if (found?.name === 'bun.lockb' || found?.name === 'bun.lock')
|
|
93
|
+
return 'bun';
|
|
94
|
+
return 'npm';
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* The installed server, as a path through `node_modules` rather than to where it really lives.
|
|
98
|
+
*
|
|
99
|
+
* pnpm keeps packages under `node_modules/.pnpm/ontrackd@<version>/` and links them into
|
|
100
|
+
* place. Resolving that link gives a path with the version in it, which works until the next
|
|
101
|
+
* upgrade and then points at a missing directory - a config that breaks weeks
|
|
102
|
+
* after it was written, on a command nobody changed. Walking up and checking for the linked
|
|
103
|
+
* path, without following it, gives one that survives upgrades under every manager.
|
|
104
|
+
*
|
|
105
|
+
* Walking up rather than looking in `root` alone: npm and yarn workspaces hoist to the repo
|
|
106
|
+
* root, pnpm links into each app. Either way the nearest one is the one Node would load.
|
|
107
|
+
*/
|
|
108
|
+
function findInstalledCli(root) {
|
|
109
|
+
const found = findUp(root, packageNames.map((name) => path.join('node_modules', ...name.split('/'), 'dist', 'mcp', 'cli.js')));
|
|
110
|
+
if (found)
|
|
111
|
+
return path.join(found.dir, found.name);
|
|
112
|
+
// An app that installed only @ontrackd/expo: pnpm does not link the core into it, but the
|
|
113
|
+
// wrapper's bin is a stable path that forwards the arguments and stdio to the core's server.
|
|
114
|
+
const viaExpo = findUp(root, [path.join('node_modules', '@ontrackd', 'expo', 'bin', 'feedback-mcp.js')]);
|
|
115
|
+
return viaExpo ? path.join(viaExpo.dir, viaExpo.name) : null;
|
|
116
|
+
}
|
|
117
|
+
/** Whether the package.json at `dir` lists `name` in any of its dependency groups. */
|
|
118
|
+
function declares(dir, name) {
|
|
119
|
+
try {
|
|
120
|
+
const manifest = JSON.parse(readFileSync(path.join(dir, 'package.json'), 'utf8'));
|
|
121
|
+
return ['dependencies', 'devDependencies', 'optionalDependencies'].some((group) => Boolean(manifest[group]?.[name]));
|
|
122
|
+
}
|
|
123
|
+
catch {
|
|
124
|
+
return false;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
/** Whether a package.json at `dir` lists the plugin, through the core or the Expo wrapper. */
|
|
128
|
+
function declaresPlugin(dir) {
|
|
129
|
+
return packageNames.some((name) => declares(dir, name)) || declares(dir, '@ontrackd/expo');
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* The apps under a monorepo root that use the plugin.
|
|
133
|
+
*
|
|
134
|
+
* Read from each app's package.json rather than from where the package is installed. pnpm
|
|
135
|
+
* links it into each app, but npm and yarn workspaces hoist it to the root, so an app that
|
|
136
|
+
* uses it may have no copy of its own - the declaration is the one fact every manager agrees
|
|
137
|
+
* on. Three levels down covers `apps/web`, `packages/*` and `apps/client/web`; node_modules and
|
|
138
|
+
* dot-directories are skipped, or a hoisted dependency's own package.json would be read as one
|
|
139
|
+
* of the apps.
|
|
140
|
+
*/
|
|
141
|
+
function findApps(root, depth = 3) {
|
|
142
|
+
const found = [];
|
|
143
|
+
const walk = (dir, left) => {
|
|
144
|
+
if (left === 0)
|
|
145
|
+
return;
|
|
146
|
+
let entries = [];
|
|
147
|
+
try {
|
|
148
|
+
entries = readdirSync(dir, { withFileTypes: true })
|
|
149
|
+
.filter((entry) => entry.isDirectory() && entry.name !== 'node_modules' && !entry.name.startsWith('.'))
|
|
150
|
+
.map((entry) => path.join(dir, entry.name));
|
|
151
|
+
}
|
|
152
|
+
catch {
|
|
153
|
+
return;
|
|
154
|
+
}
|
|
155
|
+
for (const child of entries) {
|
|
156
|
+
if (existsSync(path.join(child, 'package.json')) && declaresPlugin(child))
|
|
157
|
+
found.push(child);
|
|
158
|
+
walk(child, left - 1);
|
|
159
|
+
}
|
|
160
|
+
};
|
|
161
|
+
walk(root, depth);
|
|
162
|
+
return found.sort();
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* A function rather than a module-level const, on purpose.
|
|
166
|
+
*
|
|
167
|
+
* This file does its work at the top level, above these declarations, and calls
|
|
168
|
+
* `printConfigSnippet` from there. Functions are hoisted and consts are not, so as a const this
|
|
169
|
+
* was still in its temporal dead zone when the refusal path read it - and that path threw
|
|
170
|
+
* `Cannot access 'installCommand' before initialization`. It exited 1 as a crash, which is the
|
|
171
|
+
* same code a deliberate refusal returns, so a check on the exit code alone passed. Only the
|
|
172
|
+
* check on what the message said noticed.
|
|
173
|
+
*/
|
|
174
|
+
function installCommand(manager, root) {
|
|
175
|
+
// Expo apps install the wrapper, which brings the core and the native modules with it.
|
|
176
|
+
if (declares(root, 'expo'))
|
|
177
|
+
return 'npx expo install @ontrackd/expo';
|
|
178
|
+
switch (manager) {
|
|
179
|
+
case 'pnpm': return 'pnpm add -D ontrackd';
|
|
180
|
+
case 'yarn': return 'yarn add -D ontrackd';
|
|
181
|
+
case 'bun': return 'bun add -d ontrackd';
|
|
182
|
+
default: return 'npm install -D ontrackd';
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* Prints the MCP configuration for this project, and returns an exit code.
|
|
187
|
+
*
|
|
188
|
+
* It used to print `npx -y --package @ontrackd/feedback feedback-mcp`. npx resolves through the
|
|
189
|
+
* registry, and the package is private: in a repository whose `.npmrc` carries
|
|
190
|
+
* `_authToken=${NPM_TOKEN}` - which is every repository consuming it - an unset variable
|
|
191
|
+
* becomes an empty token that overrides the working one in `~/.npmrc`, and the fetch is a 404.
|
|
192
|
+
* The client registered the server and then reported CONNECTION_CLOSED. Nothing in the suite
|
|
193
|
+
* could see it, because the suite started the server directly and never ran what this printed.
|
|
194
|
+
*
|
|
195
|
+
* So the config runs the copy already installed: no network, no token, and the version the
|
|
196
|
+
* project pinned rather than whatever the registry serves today.
|
|
197
|
+
*/
|
|
198
|
+
/**
|
|
199
|
+
* The monorepo an app sits in, if any.
|
|
200
|
+
*
|
|
201
|
+
* `init` is most naturally run from inside an app - with pnpm that is where the bin is linked -
|
|
202
|
+
* so looking only downwards would print a one-app command in a repository with two, and the
|
|
203
|
+
* second app would be found the way it was the first time: by someone noticing it was missing.
|
|
204
|
+
*/
|
|
205
|
+
function workspaceAbove(app) {
|
|
206
|
+
let dir = path.dirname(app);
|
|
207
|
+
for (;;) {
|
|
208
|
+
if (existsSync(path.join(dir, 'pnpm-workspace.yaml')))
|
|
209
|
+
return dir;
|
|
210
|
+
try {
|
|
211
|
+
const manifest = JSON.parse(readFileSync(path.join(dir, 'package.json'), 'utf8'));
|
|
212
|
+
if (manifest.workspaces)
|
|
213
|
+
return dir;
|
|
214
|
+
}
|
|
215
|
+
catch {
|
|
216
|
+
// No package.json here, or not one that parses; keep going up.
|
|
217
|
+
}
|
|
218
|
+
const parent = path.dirname(dir);
|
|
219
|
+
if (parent === dir)
|
|
220
|
+
return null;
|
|
221
|
+
dir = parent;
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
function printConfigSnippet(root) {
|
|
225
|
+
const manager = detectManager(root);
|
|
226
|
+
/*
|
|
227
|
+
* A monorepo root, run from the top: one command covering every app that uses the plugin.
|
|
228
|
+
*
|
|
229
|
+
* Two apps used to mean running this in each and adding two entries to the client's config,
|
|
230
|
+
* because --root took one value. Only when the root itself does not declare the plugin - run
|
|
231
|
+
* inside an app, the app is the answer and this is the single-app path below.
|
|
232
|
+
*/
|
|
233
|
+
const workspace = declaresPlugin(root) ? workspaceAbove(root) : null;
|
|
234
|
+
const siblings = workspace ? findApps(workspace) : [];
|
|
235
|
+
const base = siblings.length > 1 ? workspace : root;
|
|
236
|
+
const apps = siblings.length > 1 ? siblings : declaresPlugin(root) ? [] : findApps(root);
|
|
237
|
+
if (apps.length > 0) {
|
|
238
|
+
// Any app's copy will do - it is the same package - and walking up from one finds it
|
|
239
|
+
// whether pnpm linked it into the app or a workspace hoisted it to the root.
|
|
240
|
+
const cli = apps.map(findInstalledCli).find(Boolean) ?? null;
|
|
241
|
+
if (!cli) {
|
|
242
|
+
process.stderr.write([
|
|
243
|
+
`feedback: ${apps.length} app${apps.length === 1 ? '' : 's'} here list ontrackd or @ontrackd/expo, but it is not installed.`,
|
|
244
|
+
'',
|
|
245
|
+
` ${manager} install`,
|
|
246
|
+
'',
|
|
247
|
+
'Then run this again.',
|
|
248
|
+
'',
|
|
249
|
+
].join('\n'));
|
|
250
|
+
return 1;
|
|
251
|
+
}
|
|
252
|
+
const rootArgs = apps.flatMap((app) => ['--root', app]);
|
|
253
|
+
const config = { mcpServers: { feedback: { command: 'node', args: [cli, ...rootArgs] } } };
|
|
254
|
+
const named = apps.map((app) => path.relative(base, app).split(path.sep).join('/'));
|
|
255
|
+
process.stdout.write([
|
|
256
|
+
`Found ${apps.length} app${apps.length === 1 ? '' : 's'} using the plugin: ${named.join(', ')}.`,
|
|
257
|
+
'One server covers all of them. Runs the installed copy, so it needs no network and no token.',
|
|
258
|
+
'',
|
|
259
|
+
'Claude Code:',
|
|
260
|
+
'',
|
|
261
|
+
` claude mcp add feedback -- node ${cli} ${rootArgs.join(' ')}`,
|
|
262
|
+
'',
|
|
263
|
+
'Any other client - Cursor reads .cursor/mcp.json:',
|
|
264
|
+
'',
|
|
265
|
+
JSON.stringify(config, null, 2),
|
|
266
|
+
'',
|
|
267
|
+
'Each tool takes an optional `project` to narrow it to one app. Work orders say which',
|
|
268
|
+
'directory their paths are in, so they can be followed from the repository root.',
|
|
269
|
+
// Paths are shown relative to where the server starts, and a client starts it where
|
|
270
|
+
// it was added - so added from inside one app, the others would print as absolute paths.
|
|
271
|
+
...(base === root ? [] : [
|
|
272
|
+
'',
|
|
273
|
+
`Run the claude command from ${base}, so paths read as ${named[0]}/src/...`,
|
|
274
|
+
`Only this app instead: node ${findInstalledCli(root) ?? cli} --root ${root}`,
|
|
275
|
+
]),
|
|
276
|
+
'',
|
|
277
|
+
].join('\n'));
|
|
278
|
+
return 0;
|
|
279
|
+
}
|
|
280
|
+
const cli = findInstalledCli(root);
|
|
281
|
+
if (!cli) {
|
|
282
|
+
// Yarn Plug'n'Play has no node_modules, so there is no file to point at - but yarn itself
|
|
283
|
+
// can run the bin. Said separately, because "not installed" would be false.
|
|
284
|
+
if (findUp(root, ['.pnp.cjs'])) {
|
|
285
|
+
process.stdout.write([
|
|
286
|
+
'This project uses Yarn Plug\'n\'Play, which has no node_modules to point at.',
|
|
287
|
+
'Use yarn to start the server instead:',
|
|
288
|
+
'',
|
|
289
|
+
` claude mcp add feedback -- yarn --cwd ${root} feedback-mcp --root ${root}`,
|
|
290
|
+
'',
|
|
291
|
+
].join('\n'));
|
|
292
|
+
return 0;
|
|
293
|
+
}
|
|
294
|
+
// Refused rather than falling back to npx. The fallback is the thing that broke: printing
|
|
295
|
+
// it here would hand over a command known to fail in exactly the projects that need this.
|
|
296
|
+
process.stderr.write([
|
|
297
|
+
`feedback: ${declares(root, 'expo') ? '@ontrackd/expo' : 'ontrackd'} is not installed in ${root}.`,
|
|
298
|
+
'',
|
|
299
|
+
'The MCP server runs from the installed copy, so install it first:',
|
|
300
|
+
'',
|
|
301
|
+
` ${installCommand(manager, root)}`,
|
|
302
|
+
'',
|
|
303
|
+
'Then run this again.',
|
|
304
|
+
'',
|
|
305
|
+
].join('\n'));
|
|
306
|
+
return 1;
|
|
307
|
+
}
|
|
308
|
+
const args = [cli, '--root', root];
|
|
309
|
+
const config = { mcpServers: { feedback: { command: 'node', args } } };
|
|
310
|
+
process.stdout.write([
|
|
311
|
+
`Runs the copy installed in this project (${manager}), so it needs no network and no token.`,
|
|
312
|
+
'',
|
|
313
|
+
'Claude Code:',
|
|
314
|
+
'',
|
|
315
|
+
` claude mcp add feedback -- node ${cli} --root ${root}`,
|
|
316
|
+
'',
|
|
317
|
+
'Any other client - Cursor reads .cursor/mcp.json:',
|
|
318
|
+
'',
|
|
319
|
+
JSON.stringify(config, null, 2),
|
|
320
|
+
'',
|
|
321
|
+
'Upgrading the package keeps this working: the path goes through node_modules, not to a',
|
|
322
|
+
'versioned directory.',
|
|
323
|
+
'',
|
|
324
|
+
].join('\n'));
|
|
325
|
+
return 0;
|
|
326
|
+
}
|
|
327
|
+
//# sourceMappingURL=cli.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../../src/mcp/cli.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAChE,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AACxE,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,mBAAmB,EAAmB,MAA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sBAAsB;QACtB,EAAE;KACH,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IACd,OAAO,CAAC,CAAC;AACX,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The agent fetches the cloud's comments itself.
|
|
3
|
+
*
|
|
4
|
+
* Comments left on previews live in the cloud. They used to reach the agent only after a person
|
|
5
|
+
* ran `feedback pull`, and the MCP server's answer to an empty list was to tell the agent to ask
|
|
6
|
+
* them to - an agent-first product whose agent had to wait on a terminal. Now every read tool
|
|
7
|
+
* refreshes first, through the same `pull`, when the project has a secret.
|
|
8
|
+
*
|
|
9
|
+
* Not on every call: an agent lists, searches and asks for a work order in quick succession, and
|
|
10
|
+
* each fetch is a signed request with manifests. One per project per interval, and calls made at
|
|
11
|
+
* once share it. A failure is reported in the tool's answer, never thrown - the comments already
|
|
12
|
+
* on this machine are still worth showing - and is not retried until the interval has passed.
|
|
13
|
+
*/
|
|
14
|
+
export type CloudRefreshResult = {
|
|
15
|
+
fetched: boolean;
|
|
16
|
+
note?: string;
|
|
17
|
+
};
|
|
18
|
+
type Options = {
|
|
19
|
+
/** The same off switch as the sidecar's cloud mirror: FEEDBACK_CLOUD_SYNC=0 keeps a linked app local. */
|
|
20
|
+
enabled?: () => boolean;
|
|
21
|
+
/** Whether the project has a secret to sign with; no secret, no fetch. */
|
|
22
|
+
hasSecret?: (root: string) => Promise<boolean>;
|
|
23
|
+
/** One fetch; `message` is what to tell the agent when it fails. */
|
|
24
|
+
pull?: (root: string) => Promise<{
|
|
25
|
+
ok: true;
|
|
26
|
+
} | {
|
|
27
|
+
ok: false;
|
|
28
|
+
message: string;
|
|
29
|
+
}>;
|
|
30
|
+
now?: () => number;
|
|
31
|
+
minIntervalMs?: number;
|
|
32
|
+
};
|
|
33
|
+
export declare const noSecretNote: string;
|
|
34
|
+
export declare const cloudOffNote = "Comments from previews are not fetched: FEEDBACK_CLOUD_SYNC=0 keeps this app local.";
|
|
35
|
+
export declare function createCloudRefresh(options?: Options): (root: string) => Promise<CloudRefreshResult>;
|
|
36
|
+
export {};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { pull } from '../cli/pull.js';
|
|
2
|
+
import { resolveSecret } from '../storage/localCredentials.js';
|
|
3
|
+
export const noSecretNote = 'Comments from previews are not included: this app has no project secret. Add FEEDBACK_SECRET to '
|
|
4
|
+
+ '.env.local in the app (from the project\'s Setup tab on the dashboard) and they are fetched here.';
|
|
5
|
+
export const cloudOffNote = 'Comments from previews are not fetched: FEEDBACK_CLOUD_SYNC=0 keeps this app local.';
|
|
6
|
+
export function createCloudRefresh(options = {}) {
|
|
7
|
+
const enabled = options.enabled ?? (() => process.env.FEEDBACK_CLOUD_SYNC !== '0');
|
|
8
|
+
const hasSecret = options.hasSecret ?? (async (root) => Boolean((await resolveSecret(root)).secret));
|
|
9
|
+
const fetchOnce = options.pull ?? quietPull;
|
|
10
|
+
const now = options.now ?? Date.now;
|
|
11
|
+
const minIntervalMs = options.minIntervalMs ?? 20_000;
|
|
12
|
+
const last = new Map();
|
|
13
|
+
const running = new Map();
|
|
14
|
+
return async function refresh(root) {
|
|
15
|
+
const previous = last.get(root);
|
|
16
|
+
if (previous && now() - previous.at < minIntervalMs) {
|
|
17
|
+
// Within the interval: a success needs no repeating, and a failure is reported again without a retry.
|
|
18
|
+
return previous.result.fetched ? { fetched: false } : previous.result;
|
|
19
|
+
}
|
|
20
|
+
const inFlight = running.get(root);
|
|
21
|
+
if (inFlight)
|
|
22
|
+
return inFlight;
|
|
23
|
+
const work = (async () => {
|
|
24
|
+
if (!enabled())
|
|
25
|
+
return { fetched: false, note: cloudOffNote };
|
|
26
|
+
if (!(await hasSecret(root)))
|
|
27
|
+
return { fetched: false, note: noSecretNote };
|
|
28
|
+
const outcome = await fetchOnce(root).catch((error) => ({
|
|
29
|
+
ok: false, message: error instanceof Error ? error.message : String(error),
|
|
30
|
+
}));
|
|
31
|
+
return outcome.ok
|
|
32
|
+
? { fetched: true }
|
|
33
|
+
: { fetched: false, note: `Could not fetch new comments from the cloud, so this shows what this machine already had. ${outcome.message}` };
|
|
34
|
+
})();
|
|
35
|
+
running.set(root, work);
|
|
36
|
+
try {
|
|
37
|
+
const result = await work;
|
|
38
|
+
last.set(root, { at: now(), result });
|
|
39
|
+
return result;
|
|
40
|
+
}
|
|
41
|
+
finally {
|
|
42
|
+
running.delete(root);
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
/** `feedback pull` with its messages kept: stdout is the MCP protocol, so nothing may reach it. */
|
|
47
|
+
async function quietPull(root) {
|
|
48
|
+
const said = [];
|
|
49
|
+
const code = await pull([root], process.env, fetch, { out: () => { }, err: (text) => said.push(text) });
|
|
50
|
+
return code === 0 ? { ok: true } : { ok: false, message: said.join('').trim().replace(/^feedback: /, '') };
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=cloudRefresh.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cloudRefresh.js","sourceRoot":"","sources":["../../src/mcp/cloudRefresh.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AACtC,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AA4B/D,MAAM,CAAC,MAAM,YAAY,GACvB,kGAAkG;MAChG,mGAAmG,CAAC;AAExG,MAAM,CAAC,MAAM,YAAY,GAAG,qFAAqF,CAAC;AAElH,MAAM,UAAU,kBAAkB,CAAC,UAAmB,EAAE;IACtD,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,IAAI,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,mBAAmB,KAAK,GAAG,CAAC,CAAC;IACnF,MAAM,SAAS,GAAG,OAAO,CAAC,SAAS,IAAI,CAAC,KAAK,EAAE,IAAY,EAAE,EAAE,CAAC,OAAO,CAAC,CAAC,MAAM,aAAa,CAAC,IAAI,CAAC,CAAC,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OAAO,CAAC,aAAa,EAAE,EAAE,CAAC,EAAE,CAAC;AAC7G,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** Report only identifiers from the sidecar's saved remote configuration, never its key. */
|
|
2
|
+
export declare function savedRemoteContext(root: string, env?: NodeJS.ProcessEnv): Promise<{
|
|
3
|
+
projectId: string | null;
|
|
4
|
+
sessionId: string | null;
|
|
5
|
+
branchId: string | null;
|
|
6
|
+
plan: "cloud" | "standalone";
|
|
7
|
+
} | null>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { readSavedRemote } from '../storage/savedRemote.js';
|
|
2
|
+
/** Report only identifiers from the sidecar's saved remote configuration, never its key. */
|
|
3
|
+
export async function savedRemoteContext(root, env = process.env) {
|
|
4
|
+
const remote = await readSavedRemote(root) ?? {};
|
|
5
|
+
if (!Object.keys(remote).length && !env.FEEDBACK_PROJECT_KEY && !env.FEEDBACK_SESSION_ID)
|
|
6
|
+
return null;
|
|
7
|
+
const id = (value) => typeof value === 'string' && value ? value : null;
|
|
8
|
+
// A key override may select a different project. Do not report the saved project's ID then.
|
|
9
|
+
const sameProject = !env.FEEDBACK_PROJECT_KEY || env.FEEDBACK_PROJECT_KEY === remote.portableKey;
|
|
10
|
+
return {
|
|
11
|
+
projectId: id(env.FEEDBACK_PROJECT_ID) ?? (sameProject ? id(remote.projectId) : null),
|
|
12
|
+
sessionId: id(env.FEEDBACK_SESSION_ID) ?? id(remote.sessionId),
|
|
13
|
+
branchId: id(remote.branchId),
|
|
14
|
+
// Cloud comments are also on the team's dashboard; Standalone ones only in this session.
|
|
15
|
+
plan: remote.plan === 'cloud' ? 'cloud' : 'standalone',
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../src/mcp/context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAE5D,4FAA4F;AAC5F,MAAM,CAAC,KAAK,UAAU,kBAAkB,CAAC,IAAY,EAAE,MAAyB,OAAO,CAAC,GAAG;IACzF,MAAM,MAAM,GAAG,MAAM,eAAe,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;IACjD,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,MAAM,IAAI,CAAC,GAAG,CAAC,oBAAoB,IAAI,CAAC,GAAG,CAAC,mBAAmB;QAAE,OAAO,IAAI,CAAC;IACtG,MAAM,EAAE,GAAG,CAAC,KAAc,EAAE,EAAE,CAAC,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC;IACjF,4FAA4F;IAC5F,MAAM,WAAW,GAAG,CAAC,GAAG,CAAC,oBAAoB,IAAI,GAAG,CAAC,oBAAoB,KAAK,MAAM,CAAC,WAAW,CAAC;IACjG,OAAO;QACL,SAAS,EAAE,EAAE,CAAC,GAAG,CAAC,mBAAmB,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;QACrF,SAAS,EAAE,EAAE,CAAC,GAAG,CAAC,mBAAmB,CAAC,IAAI,EAAE,CAAC,MAAM,CAAC,SAAS,CAAC;QAC9D,QAAQ,EAAE,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC;QAC7B,yFAAyF;QACzF,IAAI,EAAE,MAAM,CAAC,IAAI,KAAK,OAAO,CAAC,CAAC,CAAC,OAAgB,CAAC,CAAC,CAAC,YAAqB;KACzE,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { type TaskFile } from '../core/taskFiles.js';
|
|
2
|
+
/**
|
|
3
|
+
* A work order's or a task's images, as MCP image content (spec: MCP files and comment history). Only
|
|
4
|
+
* what the sidecar marked inline (at most 10 an answer, each task's element screenshot first), only a
|
|
5
|
+
* file whose real path is inside the app's .feedback/ folder, and only bytes that are an allowed image:
|
|
6
|
+
* the sidecar names the path, this process decides what it sends, and holds its own limits whatever the
|
|
7
|
+
* sidecar marked. Each image follows a line saying whose it is, and that it is the reviewer's data.
|
|
8
|
+
*/
|
|
9
|
+
export type McpContent = {
|
|
10
|
+
type: 'text';
|
|
11
|
+
text: string;
|
|
12
|
+
} | {
|
|
13
|
+
type: 'image';
|
|
14
|
+
data: string;
|
|
15
|
+
mimeType: string;
|
|
16
|
+
};
|
|
17
|
+
/** The most base64 one image may be: an agent's model refuses larger images (5 MiB of base64). */
|
|
18
|
+
export declare const MAX_IMAGE_BASE64: number;
|
|
19
|
+
/** The raw bytes that encode to at most MAX_IMAGE_BASE64. */
|
|
20
|
+
export declare const MAX_IMAGE_BYTES: number;
|
|
21
|
+
/** The most base64 all the images of one answer may be, across apps. */
|
|
22
|
+
export declare const MAX_ANSWER_BASE64: number;
|
|
23
|
+
/** What an answer may still carry: images, and base64 characters. */
|
|
24
|
+
export type ImageLimit = {
|
|
25
|
+
images: number;
|
|
26
|
+
base64: number;
|
|
27
|
+
};
|
|
28
|
+
export declare const answerLimit: () => ImageLimit;
|
|
29
|
+
/** One marked image, read and re-typed by its bytes; null when it may not be sent, or is over `maxBase64`. */
|
|
30
|
+
export declare function inlineImage(root: string, file: TaskFile, maxBase64?: number): Promise<{
|
|
31
|
+
data: string;
|
|
32
|
+
mimeType: string;
|
|
33
|
+
} | null>;
|
|
34
|
+
/** How many images of these tasks the sidecar marked inline. */
|
|
35
|
+
export declare const inlineCount: (files: Record<string, TaskFile[]>) => number;
|
|
36
|
+
/**
|
|
37
|
+
* The marked images of these tasks, within `limit`: past its image count an image is listed by path
|
|
38
|
+
* only, past its base64 (or one image's own limit) it could not be attached. Answers the content and
|
|
39
|
+
* what it used, for the next app's share.
|
|
40
|
+
*/
|
|
41
|
+
export declare function imageContent(project: {
|
|
42
|
+
root: string;
|
|
43
|
+
appDirectory: string | null;
|
|
44
|
+
}, files: Record<string, TaskFile[]>, limit?: ImageLimit): Promise<{
|
|
45
|
+
content: McpContent[];
|
|
46
|
+
images: number;
|
|
47
|
+
base64: number;
|
|
48
|
+
}>;
|
|
49
|
+
/** The most recordings one answer summarizes; the rest are listed by path. */
|
|
50
|
+
export declare const MAX_RECORDING_SUMMARIES = 10;
|
|
51
|
+
/**
|
|
52
|
+
* A recording's steps as text (core/recordingSummary.ts), never its JSON: read as an image is, from inside
|
|
53
|
+
* .feedback/, inflated under a hard cap and checked for the contract's shape. Null when it cannot be read.
|
|
54
|
+
*/
|
|
55
|
+
export declare function recordingSteps(root: string, file: TaskFile): Promise<string[] | null>;
|
|
56
|
+
/**
|
|
57
|
+
* Each recording of these tasks as a line saying whose it is, and that it is the reviewer's data, then its steps
|
|
58
|
+
* as text. Past MAX_RECORDING_SUMMARIES a recording is listed by path only; one that cannot be read says so.
|
|
59
|
+
*/
|
|
60
|
+
export declare function recordingContent(project: {
|
|
61
|
+
root: string;
|
|
62
|
+
appDirectory: string | null;
|
|
63
|
+
}, files: Record<string, TaskFile[]>, summarized?: number): Promise<{
|
|
64
|
+
content: McpContent[];
|
|
65
|
+
summarized: number;
|
|
66
|
+
}>;
|