@lostgradient/cinder 0.16.1 → 0.19.0
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/CHANGELOG.md +203 -0
- package/README.md +33 -11
- package/components.json +54 -102
- package/dist/_internal/chart/chart-utilities.d.ts +1 -0
- package/dist/cli/index.js +64 -11
- package/dist/cli/mcp-dependencies.d.ts +4 -0
- package/dist/cli/types.d.ts +1 -0
- package/dist/components/approval-card/approval-card.css +1 -6
- package/dist/components/approval-card/index.js +171 -64
- package/dist/components/area-chart/index.js +40 -6
- package/dist/components/bar-chart/index.js +132 -83
- package/dist/components/code-block/index.js +133 -17
- package/dist/components/combobox/combobox.schema.js +14 -1
- package/dist/components/combobox/combobox.svelte.d.ts +12 -12
- package/dist/components/combobox/combobox.types.d.ts +11 -5
- package/dist/components/combobox/index.js +94 -16
- package/dist/components/command-menu/command-menu.css +9 -0
- package/dist/components/command-menu/index.js +7 -2
- package/dist/components/diff-statistics/diff-statistics.svelte.d.ts +3 -3
- package/dist/components/event-stream-viewer/index.js +3 -2
- package/dist/components/file-upload/file-upload.schema.js +5 -1
- package/dist/components/file-upload/file-upload.types.d.ts +2 -0
- package/dist/components/file-upload/index.js +37 -27
- package/dist/components/invocation-rule-builder/index.d.ts +1 -1
- package/dist/components/invocation-rule-builder/index.js +3656 -389
- package/dist/components/invocation-rule-builder/invocation-rule-builder.css +22 -0
- package/dist/components/invocation-rule-builder/invocation-rule-builder.schema.d.ts +2 -2
- package/dist/components/invocation-rule-builder/invocation-rule-builder.schema.js +309 -193
- package/dist/components/invocation-rule-builder/invocation-rule-builder.svelte.d.ts +3 -2
- package/dist/components/invocation-rule-builder/invocation-rule-builder.types.d.ts +98 -31
- package/dist/components/json-editor/index.d.ts +5 -0
- package/dist/components/json-editor/index.js +329 -0
- package/dist/components/json-editor/json-editor-enhancement.d.ts +7 -0
- package/dist/components/json-editor/json-editor-enhancement.js +201 -0
- package/dist/components/json-editor/json-editor.css +117 -0
- package/dist/components/{diff-viewer/diff-viewer.schema.js → json-editor/json-editor.schema.js} +40 -48
- package/dist/components/json-editor/json-editor.svelte.d.ts +21 -0
- package/dist/components/json-editor/json-editor.types.d.ts +27 -0
- package/dist/components/{diff-viewer/diff-viewer.variables.js → json-editor/json-editor.variables.js} +4 -4
- package/dist/components/json-schema-editor/index.js +2041 -4165
- package/dist/components/json-schema-editor/json-schema-editor-state.svelte.d.ts +17 -1
- package/dist/components/json-schema-editor/json-schema-editor-types.d.ts +8 -1
- package/dist/components/json-schema-editor/json-schema-editor.css +35 -0
- package/dist/components/json-schema-editor/json-schema-editor.svelte.d.ts +0 -1
- package/dist/components/json-schema-editor/json-schema-validator.d.ts +9 -4
- package/dist/components/line-chart/index.js +40 -6
- package/dist/components/matrix-chart/index.js +40 -6
- package/dist/components/payload-inspector/index.js +10 -2
- package/dist/components/payload-inspector/payload-inspector.schema.js +11 -1
- package/dist/components/payload-inspector/payload-inspector.types.d.ts +20 -0
- package/dist/components/run-step-timeline/index.js +160 -111
- package/dist/components/run-step-timeline/run-step-timeline.css +46 -0
- package/dist/components/run-step-timeline/run-step-timeline.schema.js +26 -1
- package/dist/components/run-step-timeline/run-step-timeline.types.d.ts +22 -2
- package/dist/components/schedule-builder/index.js +165 -93
- package/dist/components/schedule-builder/schedule-builder.schema.js +8 -1
- package/dist/components/schedule-builder/schedule-builder.svelte.d.ts +1 -1
- package/dist/components/schedule-builder/schedule-builder.types.d.ts +12 -0
- package/dist/components/schema-form/index.d.ts +1 -1
- package/dist/components/schema-form/index.js +107 -25
- package/dist/components/schema-form/schema-form.schema.js +9 -1
- package/dist/components/schema-form/schema-form.svelte.d.ts +1 -1
- package/dist/components/schema-form/schema-form.types.d.ts +8 -0
- package/dist/components/sidebar/index.js +93 -42
- package/dist/components/sidebar/sidebar.css +7 -16
- package/dist/components/sidebar/sidebar.schema.js +8 -9
- package/dist/components/sidebar/sidebar.types.d.ts +14 -12
- package/dist/components/source-diff-viewer/source-diff-viewer.svelte.d.ts +2 -2
- package/dist/components/spectrogram/index.js +40 -6
- package/dist/components/spectrum-chart/index.js +40 -6
- package/dist/components/status-dot/index.js +3 -2
- package/dist/components/tabs/tabs.css +2 -0
- package/dist/components/textarea/textarea.svelte.d.ts +1 -1
- package/dist/components/toast-region/index.js +2 -2
- package/dist/components/toast-region/toast-region.css +1 -1
- package/dist/components/waveform/index.js +40 -6
- package/dist/highlighters/shiki/default.d.ts +5 -0
- package/dist/highlighters/shiki/default.js +278 -0
- package/dist/highlighters/shiki/index.d.ts +54 -5
- package/dist/highlighters/shiki/index.js +102 -16
- package/dist/index.d.ts +4 -4
- package/dist/index.js +15642 -16181
- package/dist/server/components/access-gate/index.js +2 -5
- package/dist/server/components/approval-card/index.js +3 -3
- package/dist/server/components/area-chart/index.js +3 -3
- package/dist/server/components/bar-chart/index.js +3 -3
- package/dist/server/components/combobox/index.js +5 -3
- package/dist/server/components/command-menu/index.js +1 -1
- package/dist/server/components/context-menu/index.js +5 -5
- package/dist/server/components/data-table/index.js +2 -2
- package/dist/server/components/diff-statistics/index.js +3 -5
- package/dist/server/components/dropdown/index.js +6 -7
- package/dist/server/components/event-stream-viewer/index.js +2 -2
- package/dist/server/components/file-upload/index.js +2 -3
- package/dist/server/components/icons/index.js +17 -26
- package/dist/server/components/inline-loading/index.js +1 -1
- package/dist/server/components/invocation-rule-builder/index.js +15 -2
- package/dist/server/components/json-editor/index.js +13 -0
- package/dist/server/components/json-editor/json-editor-enhancement.js +150 -0
- package/dist/server/components/json-schema-editor/index.js +4 -16
- package/dist/server/components/line-chart/index.js +3 -3
- package/dist/server/components/matrix-chart/index.js +2 -2
- package/dist/server/components/menu-bar/index.js +4 -4
- package/dist/server/components/payload-inspector/index.js +2 -2
- package/dist/server/components/run-step-timeline/index.js +2 -2
- package/dist/server/components/schedule-builder/index.js +3 -3
- package/dist/server/components/schema-form/index.js +1 -1
- package/dist/server/components/selection-popover/index.js +3 -5
- package/dist/server/components/sidebar/index.js +1 -1
- package/dist/server/components/spectrogram/index.js +2 -2
- package/dist/server/components/spectrum-chart/index.js +2 -2
- package/dist/server/components/status-dot/index.js +2 -2
- package/dist/server/components/surface/index.js +3 -5
- package/dist/server/components/table/index.js +2 -2
- package/dist/server/components/tabs/index.js +5 -5
- package/dist/server/components/toast-region/index.js +1 -1
- package/dist/server/components/toolbar/index.js +2 -3
- package/dist/server/components/waveform/index.js +2 -2
- package/dist/server/highlighters/shiki/default.js +39 -0
- package/dist/server/highlighters/shiki/index.js +9 -97
- package/dist/server/index.js +110 -119
- package/dist/server/{index.server-7yfz2t73.js → index.server-003t81xk.js} +1 -1
- package/dist/server/{index.server-gwgm8gqg.js → index.server-032p855q.js} +4 -4
- package/dist/server/{index.server-npxtkwjp.js → index.server-0gg1njz4.js} +3 -2
- package/dist/server/{index.server-c5qv3p61.js → index.server-0hjcds3y.js} +93 -47
- package/dist/server/{index.server-tf2n3ccm.js → index.server-1vfhzhkj.js} +1 -1
- package/dist/server/{index.server-bf7d81b4.js → index.server-20km2ga0.js} +17 -19
- package/dist/server/{index.server-jz5yxwde.js → index.server-4cbqjf14.js} +16 -7
- package/dist/server/{index.server-g5jgq3jp.js → index.server-62593nnh.js} +41 -7
- package/dist/server/{index.server-aqethy0w.js → index.server-66nm5gd5.js} +102 -26
- package/dist/server/{index.server-m0ezemav.js → index.server-6mnbznbt.js} +4 -2
- package/dist/server/{index.server-1nq8h5yb.js → index.server-6vbpz6dd.js} +40 -6
- package/dist/server/{index.server-796hb0r8.js → index.server-7qak74fg.js} +1 -1
- package/dist/server/{index.server-5exh7rmw.js → index.server-7ygdwxre.js} +57 -5
- package/dist/server/{index.server-q1d48s9t.js → index.server-8c6cck0y.js} +6 -4
- package/dist/server/{index.server-m8ya4p7w.js → index.server-8grn4zd3.js} +74 -14
- package/dist/server/{index.server-ep81fn23.js → index.server-9eccb2fc.js} +2 -2
- package/dist/server/{index.server-zncgb7mw.js → index.server-9nac5z11.js} +92 -49
- package/dist/server/index.server-c9gtmre4.js +178 -0
- package/dist/server/{index.server-nt304e00.js → index.server-dx58qant.js} +1 -1
- package/dist/server/{index.server-zh3r8vfd.js → index.server-fhrqsg97.js} +1 -1
- package/dist/server/{index.server-dq0k0qf6.js → index.server-geq56xaz.js} +10 -10
- package/dist/server/{index.server-51sxnete.js → index.server-hxveaqg1.js} +10 -10
- package/dist/server/{index.server-tez36va4.js → index.server-kvn6cj65.js} +1 -1
- package/dist/server/{index.server-s5g7reqp.js → index.server-mewms9dg.js} +2 -2
- package/dist/server/index.server-mm728d0w.js +20 -0
- package/dist/server/{index.server-5mc2vsy0.js → index.server-n0rbn5yf.js} +4 -2
- package/dist/server/{index.server-qv0kkre4.js → index.server-ng8y854r.js} +188 -107
- package/dist/server/{index.server-wasj5rbh.js → index.server-q5gvb174.js} +4 -4
- package/dist/server/{index.server-x1dha7bk.js → index.server-rnddtcb3.js} +4 -2
- package/dist/server/{index.server-7zpzspk6.js → index.server-s4wm4g2a.js} +30 -2
- package/dist/server/index.server-szgghcdh.js +887 -0
- package/dist/server/index.server-v73af5rk.js +111 -0
- package/dist/server/{index.server-thcda9ny.js → index.server-vd302sxz.js} +11 -4
- package/dist/server/{index.server-3sq9d73w.js → index.server-vz9hqkdq.js} +2 -2
- package/dist/server/{index.server-mvjzcna5.js → index.server-wg6ddzpa.js} +42 -20
- package/dist/server/{index.server-qke3ekjt.js → index.server-ww54rv4y.js} +1 -1
- package/dist/server/index.server-x4a15jpm.js +9 -0
- package/dist/server/{index.server-67q8dmbp.js → index.server-y2ncgt7p.js} +1 -1
- package/dist/server/{index.server-4x91gzy1.js → index.server-yqhww50r.js} +4 -4
- package/dist/server/{index.server-7798gc22.js → index.server-zfx4magq.js} +4 -2
- package/dist/utilities/json-highlight.d.ts +2 -0
- package/package.json +63 -288
- package/src/_internal/chart/chart-utilities.ts +74 -5
- package/src/components/approval-card/approval-card-actions.svelte +12 -28
- package/src/components/approval-card/approval-card.css +1 -6
- package/src/components/bar-chart/bar-chart.examples.json +1 -1
- package/src/components/bar-chart/bar-chart.svelte +3 -1
- package/src/components/code-block/code-block-default-highlighter.ts +2 -2
- package/src/components/combobox/combobox.schema.json +13 -0
- package/src/components/combobox/combobox.schema.ts +13 -0
- package/src/components/combobox/combobox.svelte +100 -14
- package/src/components/combobox/combobox.types.ts +11 -5
- package/src/components/command-menu/command-menu.css +9 -0
- package/src/components/command-menu/command-menu.svelte +9 -2
- package/src/components/file-upload/file-upload.schema.json +4 -0
- package/src/components/file-upload/file-upload.schema.ts +4 -0
- package/src/components/file-upload/file-upload.svelte +3 -3
- package/src/components/file-upload/file-upload.types.ts +2 -0
- package/src/components/invocation-rule-builder/index.ts +1 -0
- package/src/components/invocation-rule-builder/invocation-rule-builder.css +22 -0
- package/src/components/invocation-rule-builder/invocation-rule-builder.examples.json +6 -0
- package/src/components/invocation-rule-builder/invocation-rule-builder.schema.json +70 -7
- package/src/components/invocation-rule-builder/invocation-rule-builder.schema.ts +5 -250
- package/src/components/invocation-rule-builder/invocation-rule-builder.svelte +136 -99
- package/src/components/invocation-rule-builder/invocation-rule-builder.types.ts +145 -62
- package/src/components/json-editor/index.ts +6 -0
- package/src/components/json-editor/json-editor-enhancement.ts +48 -0
- package/src/components/json-editor/json-editor.css +117 -0
- package/src/components/json-editor/json-editor.examples.json +13 -0
- package/src/components/json-editor/json-editor.schema.json +61 -0
- package/src/components/json-editor/json-editor.schema.ts +67 -0
- package/src/components/json-editor/json-editor.svelte +164 -0
- package/src/components/json-editor/json-editor.types.ts +31 -0
- package/src/components/json-schema-editor/diff-view.svelte +26 -8
- package/src/components/json-schema-editor/form-view.svelte +1 -1
- package/src/components/json-schema-editor/json-schema-editor-state.svelte.ts +163 -56
- package/src/components/json-schema-editor/json-schema-editor-types.ts +8 -1
- package/src/components/json-schema-editor/json-schema-editor.css +35 -0
- package/src/components/json-schema-editor/json-schema-validator.ts +59 -25
- package/src/components/json-schema-editor/json-view.svelte +52 -18
- package/src/components/payload-inspector/payload-inspector.schema.json +8 -0
- package/src/components/payload-inspector/payload-inspector.schema.ts +10 -0
- package/src/components/payload-inspector/payload-inspector.svelte +2 -2
- package/src/components/payload-inspector/payload-inspector.types.ts +20 -0
- package/src/components/run-step-timeline/run-step-timeline.css +46 -0
- package/src/components/run-step-timeline/run-step-timeline.examples.json +3 -3
- package/src/components/run-step-timeline/run-step-timeline.schema.json +24 -0
- package/src/components/run-step-timeline/run-step-timeline.schema.ts +26 -0
- package/src/components/run-step-timeline/run-step-timeline.svelte +41 -4
- package/src/components/run-step-timeline/run-step-timeline.types.ts +22 -1
- package/src/components/run-step-timeline/run-step-timeline.utilities.ts +9 -1
- package/src/components/schedule-builder/schedule-builder.schema.json +7 -0
- package/src/components/schedule-builder/schedule-builder.schema.ts +8 -0
- package/src/components/schedule-builder/schedule-builder.svelte +94 -22
- package/src/components/schedule-builder/schedule-builder.types.ts +12 -0
- package/src/components/schema-form/index.ts +1 -0
- package/src/components/schema-form/schema-form-body.svelte +94 -17
- package/src/components/schema-form/schema-form.examples.json +1 -1
- package/src/components/schema-form/schema-form.schema.json +5 -0
- package/src/components/schema-form/schema-form.schema.ts +6 -0
- package/src/components/schema-form/schema-form.svelte +4 -0
- package/src/components/schema-form/schema-form.types.ts +9 -0
- package/src/components/side-navigation/side-navigation.examples.json +1 -1
- package/src/components/sidebar/sidebar.css +7 -16
- package/src/components/sidebar/sidebar.examples.json +3 -3
- package/src/components/sidebar/sidebar.schema.json +7 -8
- package/src/components/sidebar/sidebar.schema.ts +8 -8
- package/src/components/sidebar/sidebar.svelte +65 -27
- package/src/components/sidebar/sidebar.types.ts +14 -12
- package/src/components/status-dot/status-dot.svelte +6 -1
- package/src/components/tabs/tabs.css +2 -0
- package/src/components/toast-region/toast-region.css +1 -1
- package/src/components/toast-region/toast-region.examples.json +1 -1
- package/src/components/toast-region/toast-region.svelte +2 -2
- package/src/highlighters/shiki/default.ts +46 -0
- package/src/highlighters/shiki/index.ts +232 -23
- package/src/index.ts +5 -7
- package/src/styles/components.css +1 -1
- package/src/utilities/change-tracker.svelte.ts +1 -1
- package/src/utilities/json-highlight.ts +5 -0
- package/dist/commentary/anchor-decorations.d.ts +0 -86
- package/dist/commentary/anchor-decorations.js +0 -490
- package/dist/commentary/anchoring.d.ts +0 -93
- package/dist/commentary/anchoring.js +0 -157
- package/dist/commentary/comments/index.d.ts +0 -12
- package/dist/commentary/comments/index.js +0 -14
- package/dist/commentary/comments/mentions.d.ts +0 -43
- package/dist/commentary/comments/mentions.js +0 -65
- package/dist/commentary/comments/reanchor.d.ts +0 -86
- package/dist/commentary/comments/reanchor.js +0 -220
- package/dist/commentary/comments/types.d.ts +0 -260
- package/dist/commentary/comments/types.js +0 -83
- package/dist/commentary/comments/updates.d.ts +0 -102
- package/dist/commentary/comments/updates.js +0 -226
- package/dist/commentary/export/comments-export.d.ts +0 -42
- package/dist/commentary/export/comments-export.js +0 -258
- package/dist/commentary/export/index.d.ts +0 -12
- package/dist/commentary/export/index.js +0 -12
- package/dist/commentary/export/markdown-summary.d.ts +0 -31
- package/dist/commentary/export/markdown-summary.js +0 -218
- package/dist/commentary/export/types.d.ts +0 -162
- package/dist/commentary/export/types.js +0 -7
- package/dist/commentary/export/unified-diff.d.ts +0 -28
- package/dist/commentary/export/unified-diff.js +0 -250
- package/dist/commentary/index.d.ts +0 -6
- package/dist/commentary/index.js +0 -6
- package/dist/commentary/session/index.d.ts +0 -12
- package/dist/commentary/session/index.js +0 -14
- package/dist/commentary/session/persistence.d.ts +0 -92
- package/dist/commentary/session/persistence.js +0 -253
- package/dist/commentary/session/types.d.ts +0 -208
- package/dist/commentary/session/types.js +0 -26
- package/dist/commentary/session/updates.d.ts +0 -155
- package/dist/commentary/session/updates.js +0 -362
- package/dist/commentary/shared/anchor-types.d.ts +0 -116
- package/dist/commentary/shared/anchor-types.js +0 -9
- package/dist/components/diff-viewer/diff-controller.svelte.d.ts +0 -75
- package/dist/components/diff-viewer/diff-front-matter.svelte.d.ts +0 -28
- package/dist/components/diff-viewer/diff-line.svelte.d.ts +0 -22
- package/dist/components/diff-viewer/diff-summary-bar.svelte.d.ts +0 -13
- package/dist/components/diff-viewer/diff-toolbar.svelte.d.ts +0 -36
- package/dist/components/diff-viewer/diff-viewer.svelte.d.ts +0 -22
- package/dist/components/diff-viewer/diff-viewer.types.d.ts +0 -53
- package/dist/components/diff-viewer/front-matter-header.svelte.d.ts +0 -26
- package/dist/components/diff-viewer/index.d.ts +0 -4
- package/dist/components/diff-viewer/index.js +0 -2848
- package/dist/components/markdown-editor/editor-skeleton.svelte.d.ts +0 -10
- package/dist/components/markdown-editor/editor-toolbar/editor-toolbar.svelte.d.ts +0 -37
- package/dist/components/markdown-editor/editor-toolbar/index.d.ts +0 -11
- package/dist/components/markdown-editor/editor-toolbar/link-popover.svelte.d.ts +0 -30
- package/dist/components/markdown-editor/editor-toolbar/toolbar-button.svelte.d.ts +0 -19
- package/dist/components/markdown-editor/editor-toolbar/toolbar-dropdown.svelte.d.ts +0 -24
- package/dist/components/markdown-editor/editor-toolbar/toolbar-separator.svelte.d.ts +0 -7
- package/dist/components/markdown-editor/editor-toolbar/types.d.ts +0 -13
- package/dist/components/markdown-editor/index.css +0 -61
- package/dist/components/markdown-editor/index.d.ts +0 -4
- package/dist/components/markdown-editor/index.js +0 -7494
- package/dist/components/markdown-editor/markdown-editor.schema.d.ts +0 -3
- package/dist/components/markdown-editor/markdown-editor.schema.js +0 -177
- package/dist/components/markdown-editor/markdown-editor.svelte.d.ts +0 -29
- package/dist/components/markdown-editor/markdown-editor.types.d.ts +0 -100
- package/dist/components/markdown-editor/markdown-editor.variables.d.ts +0 -2
- package/dist/components/markdown-editor/markdown-editor.variables.js +0 -61
- package/dist/components/review-editor/comment-composer.svelte.d.ts +0 -37
- package/dist/components/review-editor/comment-list.svelte.d.ts +0 -19
- package/dist/components/review-editor/comment-sidebar.svelte.d.ts +0 -22
- package/dist/components/review-editor/export-actions.svelte.d.ts +0 -18
- package/dist/components/review-editor/focus-navigation.d.ts +0 -105
- package/dist/components/review-editor/front-matter-fields.svelte.d.ts +0 -10
- package/dist/components/review-editor/index.d.ts +0 -20
- package/dist/components/review-editor/index.js +0 -14731
- package/dist/components/review-editor/live-region.svelte.d.ts +0 -23
- package/dist/components/review-editor/review-editor-anchors.svelte.d.ts +0 -96
- package/dist/components/review-editor/review-editor-controls.svelte.d.ts +0 -41
- package/dist/components/review-editor/review-editor-exports.d.ts +0 -80
- package/dist/components/review-editor/review-editor-front-matter.d.ts +0 -28
- package/dist/components/review-editor/review-editor-impl.svelte.d.ts +0 -31
- package/dist/components/review-editor/review-editor-selection-geometry.d.ts +0 -10
- package/dist/components/review-editor/review-editor-selection-types.d.ts +0 -62
- package/dist/components/review-editor/review-editor-selection.svelte.d.ts +0 -50
- package/dist/components/review-editor/review-editor-state.svelte.d.ts +0 -77
- package/dist/components/review-editor/review-editor-threads.svelte.d.ts +0 -137
- package/dist/components/review-editor/review-editor.css +0 -273
- package/dist/components/review-editor/review-editor.schema.d.ts +0 -3
- package/dist/components/review-editor/review-editor.schema.js +0 -143
- package/dist/components/review-editor/review-editor.svelte.d.ts +0 -19
- package/dist/components/review-editor/review-editor.types.d.ts +0 -77
- package/dist/components/review-editor/review-editor.variables.d.ts +0 -2
- package/dist/components/review-editor/review-editor.variables.js +0 -61
- package/dist/components/review-editor/thread-popover.svelte.d.ts +0 -32
- package/dist/diff/index.d.ts +0 -2
- package/dist/diff/index.js +0 -1
- package/dist/diff/line-diff.d.ts +0 -84
- package/dist/diff/line-diff.js +0 -372
- package/dist/diff/types.d.ts +0 -1
- package/dist/diff/types.js +0 -1
- package/dist/editor/attach.d.ts +0 -30
- package/dist/editor/attach.js +0 -86
- package/dist/editor/bridge.d.ts +0 -110
- package/dist/editor/bridge.js +0 -260
- package/dist/editor/clipboard.d.ts +0 -19
- package/dist/editor/clipboard.js +0 -189
- package/dist/editor/commands.d.ts +0 -167
- package/dist/editor/commands.js +0 -728
- package/dist/editor/component-runtime.d.ts +0 -21
- package/dist/editor/component-runtime.js +0 -20
- package/dist/editor/editor.d.ts +0 -23
- package/dist/editor/editor.js +0 -256
- package/dist/editor/index.d.ts +0 -30
- package/dist/editor/index.js +0 -42
- package/dist/editor/keymap-plugin.d.ts +0 -56
- package/dist/editor/keymap-plugin.js +0 -157
- package/dist/editor/link-input-rule.d.ts +0 -4
- package/dist/editor/link-input-rule.js +0 -26
- package/dist/editor/milkdown-plugin-runtime.d.ts +0 -20
- package/dist/editor/milkdown-plugin-runtime.js +0 -43
- package/dist/editor/placeholder-security.d.ts +0 -22
- package/dist/editor/placeholder-security.js +0 -36
- package/dist/editor/placeholder.d.ts +0 -14
- package/dist/editor/placeholder.js +0 -56
- package/dist/editor/sanitize-html.d.ts +0 -32
- package/dist/editor/sanitize-html.js +0 -111
- package/dist/editor/template-completion-plugin.d.ts +0 -159
- package/dist/editor/template-completion-plugin.js +0 -615
- package/dist/editor/template-invalid-decoration-plugin.d.ts +0 -73
- package/dist/editor/template-invalid-decoration-plugin.js +0 -155
- package/dist/editor/template-placeholders.d.ts +0 -96
- package/dist/editor/template-placeholders.js +0 -355
- package/dist/editor/template-position-utilities.d.ts +0 -34
- package/dist/editor/template-position-utilities.js +0 -63
- package/dist/editor/template-render.d.ts +0 -37
- package/dist/editor/template-render.js +0 -45
- package/dist/editor/test-utilities.d.ts +0 -49
- package/dist/editor/test-utilities.js +0 -93
- package/dist/editor/types.d.ts +0 -234
- package/dist/editor/types.js +0 -8
- package/dist/markdown/diff/compute.d.ts +0 -28
- package/dist/markdown/diff/compute.js +0 -250
- package/dist/markdown/diff/frontmatter.d.ts +0 -66
- package/dist/markdown/diff/frontmatter.js +0 -135
- package/dist/markdown/diff/index.d.ts +0 -27
- package/dist/markdown/diff/index.js +0 -28
- package/dist/markdown/diff/line-diff.d.ts +0 -2
- package/dist/markdown/diff/line-diff.js +0 -1
- package/dist/markdown/diff/positions.d.ts +0 -66
- package/dist/markdown/diff/positions.js +0 -147
- package/dist/markdown/diff/types.d.ts +0 -78
- package/dist/markdown/diff/types.js +0 -7
- package/dist/markdown/index.d.ts +0 -2
- package/dist/markdown/index.js +0 -8
- package/dist/markdown/pipeline/ast.d.ts +0 -302
- package/dist/markdown/pipeline/ast.js +0 -417
- package/dist/markdown/pipeline/errors.d.ts +0 -37
- package/dist/markdown/pipeline/errors.js +0 -49
- package/dist/markdown/pipeline/frontmatter.d.ts +0 -127
- package/dist/markdown/pipeline/frontmatter.js +0 -438
- package/dist/markdown/pipeline/index.d.ts +0 -37
- package/dist/markdown/pipeline/index.js +0 -40
- package/dist/markdown/pipeline/parser.d.ts +0 -65
- package/dist/markdown/pipeline/parser.js +0 -106
- package/dist/markdown/pipeline/serializer.d.ts +0 -67
- package/dist/markdown/pipeline/serializer.js +0 -78
- package/dist/markdown/pipeline/strip-positions.d.ts +0 -20
- package/dist/markdown/pipeline/strip-positions.js +0 -28
- package/dist/markdown/pipeline/types.d.ts +0 -116
- package/dist/markdown/pipeline/types.js +0 -8
- package/dist/markdown/rendering/extract-code-blocks.d.ts +0 -16
- package/dist/markdown/rendering/extract-code-blocks.js +0 -27
- package/dist/markdown/rendering/highlighter.d.ts +0 -109
- package/dist/markdown/rendering/highlighter.js +0 -251
- package/dist/markdown/rendering/index.d.ts +0 -41
- package/dist/markdown/rendering/index.js +0 -46
- package/dist/markdown/rendering/mermaid-cache.d.ts +0 -55
- package/dist/markdown/rendering/mermaid-cache.js +0 -123
- package/dist/markdown/rendering/rehype-shiki-sync.d.ts +0 -57
- package/dist/markdown/rendering/rehype-shiki-sync.js +0 -354
- package/dist/markdown/rendering/render-async.d.ts +0 -43
- package/dist/markdown/rendering/render-async.js +0 -114
- package/dist/markdown/rendering/render-streaming.d.ts +0 -33
- package/dist/markdown/rendering/render-streaming.js +0 -123
- package/dist/markdown/rendering/render-worker.d.ts +0 -19
- package/dist/markdown/rendering/render-worker.js +0 -35
- package/dist/markdown/rendering/render.d.ts +0 -123
- package/dist/markdown/rendering/render.js +0 -477
- package/dist/markdown/rendering/sanitize-schema.d.ts +0 -24
- package/dist/markdown/rendering/sanitize-schema.js +0 -105
- package/dist/markdown/rendering/transform-urls.d.ts +0 -37
- package/dist/markdown/rendering/transform-urls.js +0 -51
- package/dist/markdown/rendering/types.d.ts +0 -51
- package/dist/markdown/rendering/types.js +0 -8
- package/dist/markdown/rendering/worker-dom-shim.d.ts +0 -87
- package/dist/markdown/rendering/worker-dom-shim.js +0 -50
- package/dist/markdown/utilities/safe-url.d.ts +0 -100
- package/dist/markdown/utilities/safe-url.js +0 -236
- package/dist/markdown/utilities/sort-keys.d.ts +0 -19
- package/dist/markdown/utilities/sort-keys.js +0 -33
- package/dist/server/commentary/anchor-decorations.js +0 -490
- package/dist/server/commentary/anchoring.js +0 -157
- package/dist/server/commentary/comments/index.js +0 -14
- package/dist/server/commentary/comments/mentions.js +0 -65
- package/dist/server/commentary/comments/reanchor.js +0 -220
- package/dist/server/commentary/comments/types.js +0 -83
- package/dist/server/commentary/comments/updates.js +0 -226
- package/dist/server/commentary/export/comments-export.js +0 -258
- package/dist/server/commentary/export/index.js +0 -12
- package/dist/server/commentary/export/markdown-summary.js +0 -218
- package/dist/server/commentary/export/types.js +0 -7
- package/dist/server/commentary/export/unified-diff.js +0 -250
- package/dist/server/commentary/index.js +0 -6
- package/dist/server/commentary/session/index.js +0 -14
- package/dist/server/commentary/session/persistence.js +0 -253
- package/dist/server/commentary/session/types.js +0 -26
- package/dist/server/commentary/session/updates.js +0 -362
- package/dist/server/commentary/shared/anchor-types.js +0 -9
- package/dist/server/components/diff-viewer/index.js +0 -33
- package/dist/server/components/markdown-editor/index.js +0 -52
- package/dist/server/components/review-editor/index.js +0 -3493
- package/dist/server/diff/index.js +0 -1
- package/dist/server/diff/line-diff.js +0 -372
- package/dist/server/diff/types.js +0 -1
- package/dist/server/editor/attach.js +0 -86
- package/dist/server/editor/bridge.js +0 -260
- package/dist/server/editor/clipboard.js +0 -189
- package/dist/server/editor/commands.js +0 -728
- package/dist/server/editor/component-runtime.js +0 -20
- package/dist/server/editor/editor.js +0 -256
- package/dist/server/editor/index.js +0 -42
- package/dist/server/editor/keymap-plugin.js +0 -157
- package/dist/server/editor/link-input-rule.js +0 -26
- package/dist/server/editor/milkdown-plugin-runtime.js +0 -43
- package/dist/server/editor/placeholder-security.js +0 -36
- package/dist/server/editor/placeholder.js +0 -56
- package/dist/server/editor/sanitize-html.js +0 -111
- package/dist/server/editor/template-completion-plugin.js +0 -615
- package/dist/server/editor/template-invalid-decoration-plugin.js +0 -155
- package/dist/server/editor/template-placeholders.js +0 -355
- package/dist/server/editor/template-position-utilities.js +0 -63
- package/dist/server/editor/template-render.js +0 -45
- package/dist/server/editor/test-utilities.js +0 -93
- package/dist/server/editor/types.js +0 -8
- package/dist/server/index.server-25wmev4e.js +0 -2
- package/dist/server/index.server-2c56kqws.js +0 -187
- package/dist/server/index.server-45n4s30n.js +0 -35
- package/dist/server/index.server-4jkqgp17.js +0 -1026
- package/dist/server/index.server-8nm871y8.js +0 -176
- package/dist/server/index.server-d04aj37r.js +0 -62
- package/dist/server/index.server-dg19y3m7.js +0 -9
- package/dist/server/index.server-g3726bja.js +0 -9
- package/dist/server/index.server-gyzmkrnz.js +0 -2
- package/dist/server/index.server-jp19145t.js +0 -9
- package/dist/server/index.server-n4jxy52q.js +0 -2
- package/dist/server/index.server-sghkqw5x.js +0 -421
- package/dist/server/index.server-w6am2dxc.js +0 -12
- package/dist/server/index.server-x66zvjfc.js +0 -1163
- package/dist/server/index.server-zdhv33ph.js +0 -124
- package/dist/server/index.server-zke5zt13.js +0 -9
- package/dist/server/markdown/diff/compute.js +0 -250
- package/dist/server/markdown/diff/frontmatter.js +0 -135
- package/dist/server/markdown/diff/index.js +0 -28
- package/dist/server/markdown/diff/line-diff.js +0 -1
- package/dist/server/markdown/diff/positions.js +0 -147
- package/dist/server/markdown/diff/types.js +0 -7
- package/dist/server/markdown/index.js +0 -8
- package/dist/server/markdown/pipeline/ast.js +0 -417
- package/dist/server/markdown/pipeline/errors.js +0 -49
- package/dist/server/markdown/pipeline/frontmatter.js +0 -438
- package/dist/server/markdown/pipeline/index.js +0 -40
- package/dist/server/markdown/pipeline/parser.js +0 -106
- package/dist/server/markdown/pipeline/serializer.js +0 -78
- package/dist/server/markdown/pipeline/strip-positions.js +0 -28
- package/dist/server/markdown/pipeline/types.js +0 -8
- package/dist/server/markdown/rendering/extract-code-blocks.js +0 -27
- package/dist/server/markdown/rendering/highlighter.js +0 -251
- package/dist/server/markdown/rendering/index.js +0 -46
- package/dist/server/markdown/rendering/mermaid-cache.js +0 -123
- package/dist/server/markdown/rendering/rehype-shiki-sync.js +0 -354
- package/dist/server/markdown/rendering/render-async.js +0 -114
- package/dist/server/markdown/rendering/render-streaming.js +0 -123
- package/dist/server/markdown/rendering/render-worker.js +0 -35
- package/dist/server/markdown/rendering/render.js +0 -477
- package/dist/server/markdown/rendering/sanitize-schema.js +0 -105
- package/dist/server/markdown/rendering/transform-urls.js +0 -51
- package/dist/server/markdown/rendering/types.js +0 -8
- package/dist/server/markdown/rendering/worker-dom-shim.js +0 -50
- package/dist/server/markdown/utilities/safe-url.js +0 -236
- package/dist/server/markdown/utilities/sort-keys.js +0 -33
- package/src/components/diff-viewer/diff-controller.svelte.ts +0 -250
- package/src/components/diff-viewer/diff-front-matter.svelte +0 -52
- package/src/components/diff-viewer/diff-line.svelte +0 -340
- package/src/components/diff-viewer/diff-summary-bar.svelte +0 -106
- package/src/components/diff-viewer/diff-toolbar.svelte +0 -182
- package/src/components/diff-viewer/diff-viewer.examples.json +0 -25
- package/src/components/diff-viewer/diff-viewer.schema.json +0 -61
- package/src/components/diff-viewer/diff-viewer.schema.ts +0 -70
- package/src/components/diff-viewer/diff-viewer.svelte +0 -400
- package/src/components/diff-viewer/diff-viewer.types.ts +0 -56
- package/src/components/diff-viewer/front-matter-header.svelte +0 -137
- package/src/components/diff-viewer/index.ts +0 -5
- package/src/components/markdown-editor/editor-skeleton.svelte +0 -85
- package/src/components/markdown-editor/editor-toolbar/editor-toolbar.svelte +0 -318
- package/src/components/markdown-editor/editor-toolbar/index.ts +0 -18
- package/src/components/markdown-editor/editor-toolbar/link-popover.svelte +0 -314
- package/src/components/markdown-editor/editor-toolbar/toolbar-button.svelte +0 -97
- package/src/components/markdown-editor/editor-toolbar/toolbar-dropdown.svelte +0 -106
- package/src/components/markdown-editor/editor-toolbar/toolbar-separator.svelte +0 -30
- package/src/components/markdown-editor/editor-toolbar/types.ts +0 -15
- package/src/components/markdown-editor/index.ts +0 -10
- package/src/components/markdown-editor/markdown-editor.examples.json +0 -19
- package/src/components/markdown-editor/markdown-editor.schema.json +0 -111
- package/src/components/markdown-editor/markdown-editor.schema.ts +0 -122
- package/src/components/markdown-editor/markdown-editor.svelte +0 -872
- package/src/components/markdown-editor/markdown-editor.types.ts +0 -124
- package/src/components/markdown-editor/markdown-editor.variables.json +0 -1
- package/src/components/markdown-editor/markdown-editor.variables.ts +0 -3
- package/src/components/markdown-editor/prosemirror.css +0 -76
- package/src/components/review-editor/comment-composer.svelte +0 -271
- package/src/components/review-editor/comment-list.svelte +0 -311
- package/src/components/review-editor/comment-sidebar.svelte +0 -449
- package/src/components/review-editor/export-actions.svelte +0 -188
- package/src/components/review-editor/focus-navigation.ts +0 -220
- package/src/components/review-editor/front-matter-fields.svelte +0 -159
- package/src/components/review-editor/index.ts +0 -59
- package/src/components/review-editor/live-region.svelte +0 -109
- package/src/components/review-editor/review-editor-anchors.svelte.ts +0 -219
- package/src/components/review-editor/review-editor-controls.svelte +0 -201
- package/src/components/review-editor/review-editor-exports.ts +0 -145
- package/src/components/review-editor/review-editor-front-matter.ts +0 -237
- package/src/components/review-editor/review-editor-impl.svelte +0 -1509
- package/src/components/review-editor/review-editor-selection-geometry.ts +0 -31
- package/src/components/review-editor/review-editor-selection-types.ts +0 -68
- package/src/components/review-editor/review-editor-selection.svelte.ts +0 -292
- package/src/components/review-editor/review-editor-state.svelte.ts +0 -117
- package/src/components/review-editor/review-editor-threads.svelte.ts +0 -435
- package/src/components/review-editor/review-editor.css +0 -273
- package/src/components/review-editor/review-editor.examples.json +0 -19
- package/src/components/review-editor/review-editor.schema.json +0 -83
- package/src/components/review-editor/review-editor.schema.ts +0 -88
- package/src/components/review-editor/review-editor.svelte +0 -18
- package/src/components/review-editor/review-editor.types.ts +0 -92
- package/src/components/review-editor/review-editor.variables.json +0 -1
- package/src/components/review-editor/review-editor.variables.ts +0 -3
- package/src/components/review-editor/thread-popover.svelte +0 -261
- /package/dist/components/{review-editor/review-editor.css.d.ts → json-editor/json-editor.css.d.ts} +0 -0
- /package/dist/components/{diff-viewer/diff-viewer.schema.d.ts → json-editor/json-editor.schema.d.ts} +0 -0
- /package/dist/components/{diff-viewer/diff-viewer.variables.d.ts → json-editor/json-editor.variables.d.ts} +0 -0
- /package/src/components/{diff-viewer/diff-viewer.variables.json → json-editor/json-editor.variables.json} +0 -0
- /package/src/components/{diff-viewer/diff-viewer.variables.ts → json-editor/json-editor.variables.ts} +0 -0
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Generate LLM-optimized exports of comment threads.
|
|
3
|
-
*
|
|
4
|
-
* Provides two export formats:
|
|
5
|
-
* 1. Markdown: Human and LLM readable format with blockquotes for highlighted text
|
|
6
|
-
* 2. JSON: Structured format for programmatic consumption
|
|
7
|
-
*
|
|
8
|
-
* Both formats support:
|
|
9
|
-
* - Text-anchored comments (with highlighted text and location)
|
|
10
|
-
* - Document-level comments (general feedback on the entire document)
|
|
11
|
-
*/
|
|
12
|
-
import type { ReviewState } from '../comments/types.js';
|
|
13
|
-
import type { CommentsExportOptions, CommentsExportResult, CommentsJSONOptions, CommentsJSONResult } from './types.js';
|
|
14
|
-
/**
|
|
15
|
-
* Generate an LLM-optimized Markdown export of comment threads.
|
|
16
|
-
*
|
|
17
|
-
* Supports both text-anchored comments (with blockquoted selections) and
|
|
18
|
-
* document-level comments (general feedback on the entire document).
|
|
19
|
-
*
|
|
20
|
-
* @param state - The current review state
|
|
21
|
-
* @param options - Configuration options for export generation
|
|
22
|
-
* @returns CommentsExportResult with Markdown string and statistics
|
|
23
|
-
*
|
|
24
|
-
* @example
|
|
25
|
-
* ```typescript
|
|
26
|
-
* const result = generateCommentsExport(state);
|
|
27
|
-
* // Send result.markdown to an LLM for analysis
|
|
28
|
-
* console.log(`Exported ${result.stats.commentCount} comments`);
|
|
29
|
-
* ```
|
|
30
|
-
*/
|
|
31
|
-
export declare function generateCommentsExport(state: ReviewState, options?: CommentsExportOptions): CommentsExportResult;
|
|
32
|
-
/**
|
|
33
|
-
* Generate a JSON export of comment threads.
|
|
34
|
-
*
|
|
35
|
-
* Provides a structured format for programmatic consumption, with separate
|
|
36
|
-
* handling for text-anchored and document-level comments.
|
|
37
|
-
*
|
|
38
|
-
* @param state - The current review state
|
|
39
|
-
* @param options - Configuration options for export generation
|
|
40
|
-
* @returns CommentsJSONResult with JSON string, data object, and statistics
|
|
41
|
-
*/
|
|
42
|
-
export declare function generateCommentsJSON(state: ReviewState, options?: CommentsJSONOptions): CommentsJSONResult;
|
|
@@ -1,258 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Generate LLM-optimized exports of comment threads.
|
|
3
|
-
*
|
|
4
|
-
* Provides two export formats:
|
|
5
|
-
* 1. Markdown: Human and LLM readable format with blockquotes for highlighted text
|
|
6
|
-
* 2. JSON: Structured format for programmatic consumption
|
|
7
|
-
*
|
|
8
|
-
* Both formats support:
|
|
9
|
-
* - Text-anchored comments (with highlighted text and location)
|
|
10
|
-
* - Document-level comments (general feedback on the entire document)
|
|
11
|
-
*/
|
|
12
|
-
/**
|
|
13
|
-
* Check if an anchor is a document-level anchor.
|
|
14
|
-
* Duplicated from comments/types to avoid circular dependency.
|
|
15
|
-
*/
|
|
16
|
-
function isDocumentAnchor(anchor) {
|
|
17
|
-
return anchor.type === 'document';
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* Generate an LLM-optimized Markdown export of comment threads.
|
|
21
|
-
*
|
|
22
|
-
* Supports both text-anchored comments (with blockquoted selections) and
|
|
23
|
-
* document-level comments (general feedback on the entire document).
|
|
24
|
-
*
|
|
25
|
-
* @param state - The current review state
|
|
26
|
-
* @param options - Configuration options for export generation
|
|
27
|
-
* @returns CommentsExportResult with Markdown string and statistics
|
|
28
|
-
*
|
|
29
|
-
* @example
|
|
30
|
-
* ```typescript
|
|
31
|
-
* const result = generateCommentsExport(state);
|
|
32
|
-
* // Send result.markdown to an LLM for analysis
|
|
33
|
-
* console.log(`Exported ${result.stats.commentCount} comments`);
|
|
34
|
-
* ```
|
|
35
|
-
*/
|
|
36
|
-
export function generateCommentsExport(state, options = {}) {
|
|
37
|
-
const { includeTimestamps = true, includeAuthorIds = true } = options;
|
|
38
|
-
// Filter to threads with visible (non-deleted) comments
|
|
39
|
-
const threads = state.threads.filter((thread) => {
|
|
40
|
-
return thread.comments.some((comment) => !comment.deletedAt);
|
|
41
|
-
});
|
|
42
|
-
if (threads.length === 0) {
|
|
43
|
-
return {
|
|
44
|
-
markdown: '# Comments\n\nNo comments to export.',
|
|
45
|
-
stats: {
|
|
46
|
-
threadCount: 0,
|
|
47
|
-
commentCount: 0,
|
|
48
|
-
documentCommentCount: 0,
|
|
49
|
-
},
|
|
50
|
-
};
|
|
51
|
-
}
|
|
52
|
-
// Separate document-level and text-anchored threads
|
|
53
|
-
const documentThreads = threads.filter((t) => isDocumentAnchor(t.anchor));
|
|
54
|
-
const textThreads = threads.filter((t) => !isDocumentAnchor(t.anchor));
|
|
55
|
-
const lines = [];
|
|
56
|
-
let totalCommentCount = 0;
|
|
57
|
-
let documentCommentCount = 0;
|
|
58
|
-
// Header with brief explanation for LLM
|
|
59
|
-
lines.push('# Review Comments\n');
|
|
60
|
-
// Document-level comments first
|
|
61
|
-
if (documentThreads.length > 0) {
|
|
62
|
-
lines.push('## Document-Level Comments\n');
|
|
63
|
-
lines.push('General feedback about the entire document:\n');
|
|
64
|
-
for (const thread of documentThreads) {
|
|
65
|
-
const visibleComments = thread.comments.filter((c) => !c.deletedAt);
|
|
66
|
-
if (visibleComments.length === 0)
|
|
67
|
-
continue;
|
|
68
|
-
documentCommentCount += visibleComments.length;
|
|
69
|
-
totalCommentCount += visibleComments.length;
|
|
70
|
-
lines.push(formatDocumentThread(visibleComments, { includeTimestamps, includeAuthorIds }));
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
// Text-anchored comments
|
|
74
|
-
if (textThreads.length > 0) {
|
|
75
|
-
if (documentThreads.length > 0) {
|
|
76
|
-
lines.push('## Text-Anchored Comments\n');
|
|
77
|
-
}
|
|
78
|
-
lines.push('Comments on specific text selections:\n');
|
|
79
|
-
// Sort text threads by position (line number or offset)
|
|
80
|
-
const sortedThreads = textThreads.toSorted((a, b) => {
|
|
81
|
-
const lineA = a.anchor.originalPosition?.line ?? a.anchor.lastKnownOffset ?? 0;
|
|
82
|
-
const lineB = b.anchor.originalPosition?.line ?? b.anchor.lastKnownOffset ?? 0;
|
|
83
|
-
return lineA - lineB;
|
|
84
|
-
});
|
|
85
|
-
for (const thread of sortedThreads) {
|
|
86
|
-
const visibleComments = thread.comments.filter((c) => !c.deletedAt);
|
|
87
|
-
if (visibleComments.length === 0)
|
|
88
|
-
continue;
|
|
89
|
-
totalCommentCount += visibleComments.length;
|
|
90
|
-
// Generate thread entry
|
|
91
|
-
lines.push(formatThread(thread, visibleComments, { includeTimestamps, includeAuthorIds }));
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
// Add summary at the end
|
|
95
|
-
lines.push('---\n');
|
|
96
|
-
lines.push(`**Total threads:** ${threads.length}`);
|
|
97
|
-
lines.push(`**Total comments:** ${totalCommentCount}`);
|
|
98
|
-
if (documentCommentCount > 0) {
|
|
99
|
-
lines.push(`**Document-level comments:** ${documentCommentCount}`);
|
|
100
|
-
}
|
|
101
|
-
return {
|
|
102
|
-
markdown: lines.join('\n'),
|
|
103
|
-
stats: {
|
|
104
|
-
threadCount: threads.length,
|
|
105
|
-
commentCount: totalCommentCount,
|
|
106
|
-
documentCommentCount,
|
|
107
|
-
},
|
|
108
|
-
};
|
|
109
|
-
}
|
|
110
|
-
/**
|
|
111
|
-
* Generate a JSON export of comment threads.
|
|
112
|
-
*
|
|
113
|
-
* Provides a structured format for programmatic consumption, with separate
|
|
114
|
-
* handling for text-anchored and document-level comments.
|
|
115
|
-
*
|
|
116
|
-
* @param state - The current review state
|
|
117
|
-
* @param options - Configuration options for export generation
|
|
118
|
-
* @returns CommentsJSONResult with JSON string, data object, and statistics
|
|
119
|
-
*/
|
|
120
|
-
export function generateCommentsJSON(state, options = {}) {
|
|
121
|
-
const { includeTimestamps = true, includeAuthorIds = true } = options;
|
|
122
|
-
// Filter to threads with visible (non-deleted) comments
|
|
123
|
-
const threads = state.threads.filter((thread) => {
|
|
124
|
-
return thread.comments.some((comment) => !comment.deletedAt);
|
|
125
|
-
});
|
|
126
|
-
const exportedThreads = [];
|
|
127
|
-
let totalCommentCount = 0;
|
|
128
|
-
let documentThreadCount = 0;
|
|
129
|
-
for (const thread of threads) {
|
|
130
|
-
const visibleComments = thread.comments.filter((c) => !c.deletedAt);
|
|
131
|
-
if (visibleComments.length === 0)
|
|
132
|
-
continue;
|
|
133
|
-
totalCommentCount += visibleComments.length;
|
|
134
|
-
const isDocument = isDocumentAnchor(thread.anchor);
|
|
135
|
-
if (isDocument)
|
|
136
|
-
documentThreadCount++;
|
|
137
|
-
const exportedComments = visibleComments.map((comment) => {
|
|
138
|
-
const exported = {
|
|
139
|
-
id: comment.id,
|
|
140
|
-
body: comment.body,
|
|
141
|
-
};
|
|
142
|
-
if (includeAuthorIds)
|
|
143
|
-
exported.authorId = comment.authorId;
|
|
144
|
-
if (includeTimestamps) {
|
|
145
|
-
exported.createdAt = comment.createdAt;
|
|
146
|
-
if (comment.editedAt)
|
|
147
|
-
exported.updatedAt = comment.editedAt;
|
|
148
|
-
}
|
|
149
|
-
return exported;
|
|
150
|
-
});
|
|
151
|
-
const exportedThread = {
|
|
152
|
-
id: thread.id,
|
|
153
|
-
type: isDocument ? 'document' : 'text',
|
|
154
|
-
comments: exportedComments,
|
|
155
|
-
};
|
|
156
|
-
// Add selection info for text-anchored threads
|
|
157
|
-
if (!isDocument) {
|
|
158
|
-
const selection = {
|
|
159
|
-
text: thread.anchor.quote,
|
|
160
|
-
from: thread.anchor.lastKnownOffset ?? 0,
|
|
161
|
-
to: (thread.anchor.lastKnownOffset ?? 0) + thread.anchor.quote.length,
|
|
162
|
-
};
|
|
163
|
-
if (thread.anchor.originalPosition) {
|
|
164
|
-
selection.line = thread.anchor.originalPosition.line;
|
|
165
|
-
selection.column = thread.anchor.originalPosition.column;
|
|
166
|
-
}
|
|
167
|
-
exportedThread.selection = selection;
|
|
168
|
-
}
|
|
169
|
-
exportedThreads.push(exportedThread);
|
|
170
|
-
}
|
|
171
|
-
const data = { threads: exportedThreads };
|
|
172
|
-
return {
|
|
173
|
-
json: JSON.stringify(data, null, 2),
|
|
174
|
-
data,
|
|
175
|
-
stats: {
|
|
176
|
-
threadCount: exportedThreads.length,
|
|
177
|
-
commentCount: totalCommentCount,
|
|
178
|
-
documentThreadCount,
|
|
179
|
-
},
|
|
180
|
-
};
|
|
181
|
-
}
|
|
182
|
-
/**
|
|
183
|
-
* Format a single text-anchored thread with all its visible comments.
|
|
184
|
-
* Uses blockquotes for the highlighted text per plan requirements.
|
|
185
|
-
*/
|
|
186
|
-
function formatThread(thread, visibleComments, options) {
|
|
187
|
-
const lines = [];
|
|
188
|
-
const { anchor } = thread;
|
|
189
|
-
// Header with location information
|
|
190
|
-
const locationInfo = formatLocation(anchor);
|
|
191
|
-
lines.push(`### ${locationInfo}\n`);
|
|
192
|
-
// Highlighted text using blockquote (per plan requirements)
|
|
193
|
-
if (anchor.quote) {
|
|
194
|
-
// Split quote into lines and blockquote each
|
|
195
|
-
const quoteLines = anchor.quote.split('\n');
|
|
196
|
-
for (const quoteLine of quoteLines) {
|
|
197
|
-
lines.push(`> ${quoteLine}`);
|
|
198
|
-
}
|
|
199
|
-
lines.push('');
|
|
200
|
-
}
|
|
201
|
-
// Position details for precise reference
|
|
202
|
-
if (anchor.originalPosition) {
|
|
203
|
-
const { line, column } = anchor.originalPosition;
|
|
204
|
-
const range = anchor.lastKnownOffset !== undefined ? `offset ${anchor.lastKnownOffset}` : '';
|
|
205
|
-
lines.push(`*Position: Line ${line}, Column ${column}${range ? ` (${range})` : ''}*\n`);
|
|
206
|
-
}
|
|
207
|
-
// Comments section
|
|
208
|
-
for (const comment of visibleComments) {
|
|
209
|
-
const author = options.includeAuthorIds ? comment.authorId : 'Reviewer';
|
|
210
|
-
const timestamp = options.includeTimestamps ? formatTimestamp(comment.createdAt) : '';
|
|
211
|
-
lines.push(`**${author}**${timestamp}:`);
|
|
212
|
-
lines.push(comment.body);
|
|
213
|
-
lines.push('');
|
|
214
|
-
}
|
|
215
|
-
lines.push('---\n');
|
|
216
|
-
return lines.join('\n');
|
|
217
|
-
}
|
|
218
|
-
/**
|
|
219
|
-
* Format a document-level thread (general feedback, no highlighted text).
|
|
220
|
-
*/
|
|
221
|
-
function formatDocumentThread(visibleComments, options) {
|
|
222
|
-
const lines = [];
|
|
223
|
-
for (const comment of visibleComments) {
|
|
224
|
-
const author = options.includeAuthorIds ? comment.authorId : 'Reviewer';
|
|
225
|
-
const timestamp = options.includeTimestamps ? formatTimestamp(comment.createdAt) : '';
|
|
226
|
-
lines.push(`**${author}**${timestamp}:`);
|
|
227
|
-
lines.push(comment.body);
|
|
228
|
-
lines.push('');
|
|
229
|
-
}
|
|
230
|
-
lines.push('---\n');
|
|
231
|
-
return lines.join('\n');
|
|
232
|
-
}
|
|
233
|
-
/**
|
|
234
|
-
* Format location information for a thread.
|
|
235
|
-
*/
|
|
236
|
-
function formatLocation(anchor) {
|
|
237
|
-
if (anchor.originalPosition) {
|
|
238
|
-
const { line, column } = anchor.originalPosition;
|
|
239
|
-
return `Comment at Line ${line}:${column}`;
|
|
240
|
-
}
|
|
241
|
-
if (anchor.lastKnownOffset !== undefined) {
|
|
242
|
-
return `Comment at offset ${anchor.lastKnownOffset}`;
|
|
243
|
-
}
|
|
244
|
-
return 'Comment (location unknown)';
|
|
245
|
-
}
|
|
246
|
-
/**
|
|
247
|
-
* Format a timestamp for display.
|
|
248
|
-
*/
|
|
249
|
-
function formatTimestamp(isoString) {
|
|
250
|
-
try {
|
|
251
|
-
const date = new Date(isoString);
|
|
252
|
-
// Use a short format that's still parseable
|
|
253
|
-
return ` (${date.toISOString().split('T')[0]})`;
|
|
254
|
-
}
|
|
255
|
-
catch {
|
|
256
|
-
return '';
|
|
257
|
-
}
|
|
258
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Export utilities for the ReviewEditor.
|
|
3
|
-
*
|
|
4
|
-
* Provides functions to generate LLM-friendly summaries and
|
|
5
|
-
* Git-compatible unified diffs from review state.
|
|
6
|
-
*
|
|
7
|
-
* @module
|
|
8
|
-
*/
|
|
9
|
-
export { generateCommentsExport, generateCommentsJSON } from './comments-export.js';
|
|
10
|
-
export { generateMarkdownSummary } from './markdown-summary.js';
|
|
11
|
-
export { generateUnifiedDiff } from './unified-diff.js';
|
|
12
|
-
export type { CommentsExportOptions, CommentsExportResult, CommentsJSONOptions, CommentsJSONResult, ExportedComment, ExportedSelection, ExportedThread, MarkdownSummaryOptions, MarkdownSummaryResult, UnifiedDiffOptions, UnifiedDiffResult, } from './types.js';
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Export utilities for the ReviewEditor.
|
|
3
|
-
*
|
|
4
|
-
* Provides functions to generate LLM-friendly summaries and
|
|
5
|
-
* Git-compatible unified diffs from review state.
|
|
6
|
-
*
|
|
7
|
-
* @module
|
|
8
|
-
*/
|
|
9
|
-
// Pure functions (for direct use/testing)
|
|
10
|
-
export { generateCommentsExport, generateCommentsJSON } from './comments-export.js';
|
|
11
|
-
export { generateMarkdownSummary } from './markdown-summary.js';
|
|
12
|
-
export { generateUnifiedDiff } from './unified-diff.js';
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Generate LLM-optimized Markdown summary from ReviewState.
|
|
3
|
-
*
|
|
4
|
-
* Produces a structured Markdown document that an LLM can parse
|
|
5
|
-
* to understand what feedback was given and what actions to take.
|
|
6
|
-
*
|
|
7
|
-
* Design principles:
|
|
8
|
-
* - Action-oriented: Organize by "what to do" not "what data exists"
|
|
9
|
-
* - Minimal noise: No timestamps, author IDs, or statistics by default
|
|
10
|
-
* - Clear structure: Direct edits vs comments requiring action
|
|
11
|
-
*/
|
|
12
|
-
import type { ReviewState } from '../comments/types.js';
|
|
13
|
-
import type { MarkdownSummaryOptions, MarkdownSummaryResult } from './types.js';
|
|
14
|
-
/**
|
|
15
|
-
* Generate an LLM-optimized Markdown summary from review state.
|
|
16
|
-
*
|
|
17
|
-
* The output is structured for actionability:
|
|
18
|
-
* - "Changes Made" shows direct edits already applied to the document
|
|
19
|
-
* - "Feedback" shows comments on specific text that need attention
|
|
20
|
-
*
|
|
21
|
-
* @param state - The current review state
|
|
22
|
-
* @param options - Configuration options for summary generation
|
|
23
|
-
* @returns MarkdownSummaryResult with Markdown string and statistics
|
|
24
|
-
*
|
|
25
|
-
* @example
|
|
26
|
-
* ```typescript
|
|
27
|
-
* const result = generateMarkdownSummary(state);
|
|
28
|
-
* // Send result.markdown to an LLM for revision
|
|
29
|
-
* ```
|
|
30
|
-
*/
|
|
31
|
-
export declare function generateMarkdownSummary(state: ReviewState, options?: MarkdownSummaryOptions): MarkdownSummaryResult;
|
|
@@ -1,218 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Generate LLM-optimized Markdown summary from ReviewState.
|
|
3
|
-
*
|
|
4
|
-
* Produces a structured Markdown document that an LLM can parse
|
|
5
|
-
* to understand what feedback was given and what actions to take.
|
|
6
|
-
*
|
|
7
|
-
* Design principles:
|
|
8
|
-
* - Action-oriented: Organize by "what to do" not "what data exists"
|
|
9
|
-
* - Minimal noise: No timestamps, author IDs, or statistics by default
|
|
10
|
-
* - Clear structure: Direct edits vs comments requiring action
|
|
11
|
-
*/
|
|
12
|
-
import { computeLineDiff } from '../../markdown/diff/line-diff.js';
|
|
13
|
-
/**
|
|
14
|
-
* Generate an LLM-optimized Markdown summary from review state.
|
|
15
|
-
*
|
|
16
|
-
* The output is structured for actionability:
|
|
17
|
-
* - "Changes Made" shows direct edits already applied to the document
|
|
18
|
-
* - "Feedback" shows comments on specific text that need attention
|
|
19
|
-
*
|
|
20
|
-
* @param state - The current review state
|
|
21
|
-
* @param options - Configuration options for summary generation
|
|
22
|
-
* @returns MarkdownSummaryResult with Markdown string and statistics
|
|
23
|
-
*
|
|
24
|
-
* @example
|
|
25
|
-
* ```typescript
|
|
26
|
-
* const result = generateMarkdownSummary(state);
|
|
27
|
-
* // Send result.markdown to an LLM for revision
|
|
28
|
-
* ```
|
|
29
|
-
*/
|
|
30
|
-
export function generateMarkdownSummary(state, options = {}) {
|
|
31
|
-
const {
|
|
32
|
-
// Defaults optimized for LLM consumption - minimal noise
|
|
33
|
-
includeTimestamps = false, includeAuthorIds = false, contextLines = 2, } = options;
|
|
34
|
-
const sections = [];
|
|
35
|
-
let changeCount = 0;
|
|
36
|
-
let threadCount = 0;
|
|
37
|
-
// Document Changes Section
|
|
38
|
-
const original = state.original ?? '';
|
|
39
|
-
const current = state.content;
|
|
40
|
-
if (original !== current) {
|
|
41
|
-
const changesSection = generateChangesSection(original, current, contextLines);
|
|
42
|
-
if (changesSection.markdown) {
|
|
43
|
-
sections.push(changesSection.markdown);
|
|
44
|
-
changeCount = changesSection.changeCount;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
// Comment Threads Section - only include threads with visible (non-deleted) comments
|
|
48
|
-
const visibleThreads = state.threads.filter((thread) => {
|
|
49
|
-
return thread.comments.some((comment) => !comment.deletedAt);
|
|
50
|
-
});
|
|
51
|
-
if (visibleThreads.length > 0) {
|
|
52
|
-
const threadsSection = generateThreadsSection(visibleThreads, {
|
|
53
|
-
includeTimestamps,
|
|
54
|
-
includeAuthorIds,
|
|
55
|
-
});
|
|
56
|
-
sections.push(threadsSection.markdown);
|
|
57
|
-
threadCount = threadsSection.threadCount;
|
|
58
|
-
}
|
|
59
|
-
// Build final output
|
|
60
|
-
let markdown;
|
|
61
|
-
if (sections.length === 0) {
|
|
62
|
-
markdown = 'No changes or feedback to report.';
|
|
63
|
-
}
|
|
64
|
-
else {
|
|
65
|
-
markdown = sections.join('\n');
|
|
66
|
-
}
|
|
67
|
-
return {
|
|
68
|
-
markdown,
|
|
69
|
-
stats: {
|
|
70
|
-
changeCount,
|
|
71
|
-
threadCount,
|
|
72
|
-
},
|
|
73
|
-
};
|
|
74
|
-
}
|
|
75
|
-
/**
|
|
76
|
-
* Generate the document changes section.
|
|
77
|
-
*/
|
|
78
|
-
function generateChangesSection(original, current, contextLines) {
|
|
79
|
-
const lineDiffs = computeLineDiff(original, current);
|
|
80
|
-
// Find change ranges
|
|
81
|
-
const changeRanges = [];
|
|
82
|
-
let currentRange = null;
|
|
83
|
-
for (let i = 0; i < lineDiffs.length; i++) {
|
|
84
|
-
const diff = lineDiffs[i];
|
|
85
|
-
if (!diff)
|
|
86
|
-
continue;
|
|
87
|
-
const isChange = diff.type !== 'same';
|
|
88
|
-
if (isChange) {
|
|
89
|
-
if (currentRange === null) {
|
|
90
|
-
currentRange = { start: i, end: i };
|
|
91
|
-
}
|
|
92
|
-
else {
|
|
93
|
-
currentRange.end = i;
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
else if (currentRange !== null) {
|
|
97
|
-
// Check if we should merge with next change (within context distance)
|
|
98
|
-
const nextChangeIndex = lineDiffs.findIndex((d, idx) => idx > i && d.type !== 'same');
|
|
99
|
-
if (nextChangeIndex !== -1 && nextChangeIndex - currentRange.end <= contextLines * 2 + 1) {
|
|
100
|
-
// Continue the current range
|
|
101
|
-
continue;
|
|
102
|
-
}
|
|
103
|
-
changeRanges.push(currentRange);
|
|
104
|
-
currentRange = null;
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
if (currentRange !== null) {
|
|
108
|
-
changeRanges.push(currentRange);
|
|
109
|
-
}
|
|
110
|
-
if (changeRanges.length === 0) {
|
|
111
|
-
return { markdown: '', changeCount: 0 };
|
|
112
|
-
}
|
|
113
|
-
const lines = ['## Changes Made\n'];
|
|
114
|
-
lines.push('The following edits were made to the document:\n');
|
|
115
|
-
let changeCount = 0;
|
|
116
|
-
for (const range of changeRanges) {
|
|
117
|
-
// Add context before
|
|
118
|
-
const contextStart = Math.max(0, range.start - contextLines);
|
|
119
|
-
const contextEnd = Math.min(lineDiffs.length - 1, range.end + contextLines);
|
|
120
|
-
// Calculate original line number (1-based)
|
|
121
|
-
let originalLineNumber = 1;
|
|
122
|
-
for (let i = 0; i < contextStart; i++) {
|
|
123
|
-
const diff = lineDiffs[i];
|
|
124
|
-
if (!diff)
|
|
125
|
-
continue;
|
|
126
|
-
if (diff.type === 'same' || diff.type === 'removed' || diff.type === 'modified') {
|
|
127
|
-
originalLineNumber++;
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
const startOriginalLine = originalLineNumber;
|
|
131
|
-
// Calculate end line number by counting only lines that exist in the original
|
|
132
|
-
let originalLinesInDisplayRange = 0;
|
|
133
|
-
for (let i = contextStart; i <= contextEnd; i++) {
|
|
134
|
-
const diff = lineDiffs[i];
|
|
135
|
-
if (!diff)
|
|
136
|
-
continue;
|
|
137
|
-
if (diff.type === 'same' || diff.type === 'removed' || diff.type === 'modified') {
|
|
138
|
-
originalLinesInDisplayRange++;
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
const endOriginalLine = originalLinesInDisplayRange > 0
|
|
142
|
-
? startOriginalLine + originalLinesInDisplayRange - 1
|
|
143
|
-
: startOriginalLine;
|
|
144
|
-
lines.push(`### Lines ${startOriginalLine}-${endOriginalLine}\n`);
|
|
145
|
-
lines.push('```diff');
|
|
146
|
-
for (let i = contextStart; i <= contextEnd; i++) {
|
|
147
|
-
const diff = lineDiffs[i];
|
|
148
|
-
if (!diff)
|
|
149
|
-
continue;
|
|
150
|
-
switch (diff.type) {
|
|
151
|
-
case 'same':
|
|
152
|
-
lines.push(` ${diff.text}`);
|
|
153
|
-
break;
|
|
154
|
-
case 'added':
|
|
155
|
-
lines.push(`+${diff.text}`);
|
|
156
|
-
changeCount++;
|
|
157
|
-
break;
|
|
158
|
-
case 'removed':
|
|
159
|
-
lines.push(`-${diff.text}`);
|
|
160
|
-
changeCount++;
|
|
161
|
-
break;
|
|
162
|
-
case 'modified':
|
|
163
|
-
lines.push(`-${diff.oldText}`);
|
|
164
|
-
lines.push(`+${diff.newText}`);
|
|
165
|
-
changeCount++;
|
|
166
|
-
break;
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
lines.push('```\n');
|
|
170
|
-
}
|
|
171
|
-
return { markdown: lines.join('\n'), changeCount };
|
|
172
|
-
}
|
|
173
|
-
/**
|
|
174
|
-
* Generate the comment threads section.
|
|
175
|
-
*/
|
|
176
|
-
function generateThreadsSection(threads, options) {
|
|
177
|
-
const lines = ['## Feedback\n'];
|
|
178
|
-
lines.push('The following comments were made and may require action:\n');
|
|
179
|
-
for (const thread of threads) {
|
|
180
|
-
const visibleComments = thread.comments.filter((c) => !c.deletedAt);
|
|
181
|
-
if (visibleComments.length === 0)
|
|
182
|
-
continue;
|
|
183
|
-
// Show what text the comment is about
|
|
184
|
-
const quote = thread.anchor.quote;
|
|
185
|
-
if (quote) {
|
|
186
|
-
lines.push(`### On "${truncate(quote, 60)}"\n`);
|
|
187
|
-
}
|
|
188
|
-
else {
|
|
189
|
-
// Document-level comment
|
|
190
|
-
lines.push(`### Document-level feedback\n`);
|
|
191
|
-
}
|
|
192
|
-
for (const comment of visibleComments) {
|
|
193
|
-
let prefix = '';
|
|
194
|
-
if (options.includeAuthorIds) {
|
|
195
|
-
prefix = `**${comment.authorId}:** `;
|
|
196
|
-
}
|
|
197
|
-
if (options.includeTimestamps) {
|
|
198
|
-
prefix += `(${comment.createdAt}) `;
|
|
199
|
-
}
|
|
200
|
-
// Format comment body as blockquote
|
|
201
|
-
const bodyLines = comment.body.split('\n');
|
|
202
|
-
lines.push(`${prefix}> ${bodyLines.join('\n> ')}`);
|
|
203
|
-
lines.push('');
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
return {
|
|
207
|
-
markdown: lines.join('\n'),
|
|
208
|
-
threadCount: threads.length,
|
|
209
|
-
};
|
|
210
|
-
}
|
|
211
|
-
/**
|
|
212
|
-
* Truncate text to a maximum length.
|
|
213
|
-
*/
|
|
214
|
-
function truncate(text, maxLength) {
|
|
215
|
-
if (text.length <= maxLength)
|
|
216
|
-
return text;
|
|
217
|
-
return text.slice(0, maxLength - 3) + '...';
|
|
218
|
-
}
|