@alwith/module-chat 0.1.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/LICENSE +94 -0
- package/README.md +54 -0
- package/THIRD_PARTY_NOTICES.md +43 -0
- package/dist/activity-host.d.ts +32 -0
- package/dist/activity-host.js +1 -0
- package/dist/approval/choice-elicitation-form.d.ts +15 -0
- package/dist/approval/choice-elicitation-form.js +1 -0
- package/dist/approval/choice-schema.d.ts +18 -0
- package/dist/approval/choice-schema.js +1 -0
- package/dist/approval/permission-options.d.ts +7 -0
- package/dist/approval/permission-options.js +1 -0
- package/dist/approval/permission-view.d.ts +19 -0
- package/dist/approval/permission-view.js +1 -0
- package/dist/approval/schema-elicitation-form.d.ts +29 -0
- package/dist/approval/schema-elicitation-form.js +1 -0
- package/dist/approval/url-elicitation-card.d.ts +8 -0
- package/dist/approval/url-elicitation-card.js +1 -0
- package/dist/codex/activity-group.d.ts +15 -0
- package/dist/codex/activity-group.js +6 -0
- package/dist/codex/assistant-message.d.ts +43 -0
- package/dist/codex/assistant-message.js +2 -0
- package/dist/codex/disclosure-state.d.ts +2 -0
- package/dist/codex/disclosure-state.js +1 -0
- package/dist/codex/edited-files-card.d.ts +15 -0
- package/dist/codex/edited-files-card.js +2 -0
- package/dist/codex/markdown-renderer.d.ts +11 -0
- package/dist/codex/markdown-renderer.js +6 -0
- package/dist/codex/markdown.css +760 -0
- package/dist/codex/navigation-audio.d.ts +18 -0
- package/dist/codex/navigation-audio.js +1 -0
- package/dist/codex/navigation-instruments.d.ts +54 -0
- package/dist/codex/navigation-instruments.js +1 -0
- package/dist/codex/navigation-preview.d.ts +8 -0
- package/dist/codex/navigation-preview.js +1 -0
- package/dist/codex/navigation-rail.css +216 -0
- package/dist/codex/navigation-rail.d.ts +25 -0
- package/dist/codex/navigation-rail.js +1 -0
- package/dist/codex/patch-view.d.ts +8 -0
- package/dist/codex/patch-view.js +2 -0
- package/dist/codex/plan.d.ts +4 -0
- package/dist/codex/plan.js +1 -0
- package/dist/codex/styles.css +1238 -0
- package/dist/codex/terminal-output.d.ts +3 -0
- package/dist/codex/terminal-output.js +1 -0
- package/dist/codex/thread-virtualizer.d.ts +52 -0
- package/dist/codex/thread-virtualizer.js +1 -0
- package/dist/codex/user-message.d.ts +30 -0
- package/dist/codex/user-message.js +1 -0
- package/dist/codex/virtualized-turn-list.d.ts +16 -0
- package/dist/codex/virtualized-turn-list.js +1 -0
- package/dist/composer/completion-filter.d.ts +12 -0
- package/dist/composer/completion-filter.js +1 -0
- package/dist/composer/completion-menu.d.ts +21 -0
- package/dist/composer/completion-menu.js +3 -0
- package/dist/composer/completion-trigger.d.ts +8 -0
- package/dist/composer/completion-trigger.js +3 -0
- package/dist/composer/effort-slider.d.ts +10 -0
- package/dist/composer/effort-slider.js +1 -0
- package/dist/composer/menu-radio.d.ts +15 -0
- package/dist/composer/menu-radio.js +1 -0
- package/dist/composer/model-select.d.ts +56 -0
- package/dist/composer/model-select.js +1 -0
- package/dist/composer/permission-mode-select.d.ts +13 -0
- package/dist/composer/permission-mode-select.js +1 -0
- package/dist/composer/prompt-input-attachments.d.ts +16 -0
- package/dist/composer/prompt-input-attachments.js +1 -0
- package/dist/composer/prompt-input-clipboard.d.ts +10 -0
- package/dist/composer/prompt-input-clipboard.js +1 -0
- package/dist/composer/prompt-input-context.d.ts +59 -0
- package/dist/composer/prompt-input-context.js +1 -0
- package/dist/composer/prompt-input-textarea.d.ts +13 -0
- package/dist/composer/prompt-input-textarea.js +3 -0
- package/dist/composer/prompt-input.d.ts +44 -0
- package/dist/composer/prompt-input.js +1 -0
- package/dist/image-lightbox.d.ts +5 -0
- package/dist/image-lightbox.js +1 -0
- package/dist/image-preview-dialog.d.ts +14 -0
- package/dist/image-preview-dialog.js +1 -0
- package/dist/lib/code-highlighter.d.ts +27 -0
- package/dist/lib/code-highlighter.js +1 -0
- package/dist/lib/code-highlighter.worker.d.ts +1 -0
- package/dist/lib/code-highlighter.worker.js +1 -0
- package/dist/lib/fuzzy.d.ts +11 -0
- package/dist/lib/fuzzy.js +1 -0
- package/dist/lib/group-blocks.d.ts +5 -0
- package/dist/lib/group-blocks.js +1 -0
- package/dist/lib/image-encode.d.ts +1 -0
- package/dist/lib/image-encode.js +1 -0
- package/dist/lib/limits.d.ts +5 -0
- package/dist/lib/limits.js +1 -0
- package/dist/lib/markdown-parser.d.ts +34 -0
- package/dist/lib/markdown-parser.js +1 -0
- package/dist/lib/markdown-parser.worker.d.ts +1 -0
- package/dist/lib/markdown-parser.worker.js +1 -0
- package/dist/lib/markdown-rules.d.ts +9 -0
- package/dist/lib/markdown-rules.js +1 -0
- package/dist/lib/pointer-centered-zoom.d.ts +13 -0
- package/dist/lib/pointer-centered-zoom.js +1 -0
- package/dist/lib/prepare-prompt-files.d.ts +7 -0
- package/dist/lib/prepare-prompt-files.js +1 -0
- package/dist/lib/stream-entry.d.ts +28 -0
- package/dist/lib/stream-entry.js +0 -0
- package/dist/lib/stream-style.d.ts +15 -0
- package/dist/lib/stream-style.js +2 -0
- package/dist/lib/streaming-markdown.d.ts +4 -0
- package/dist/lib/streaming-markdown.js +2 -0
- package/dist/locales.d.ts +489 -0
- package/dist/locales.js +1 -0
- package/dist/search/chat-search.d.ts +19 -0
- package/dist/search/chat-search.js +1 -0
- package/dist/search/dom-matches.d.ts +1 -0
- package/dist/search/dom-matches.js +1 -0
- package/dist/search/find-bar.d.ts +14 -0
- package/dist/search/find-bar.js +1 -0
- package/dist/search/literal-matches.d.ts +12 -0
- package/dist/search/literal-matches.js +1 -0
- package/dist/types.d.ts +139 -0
- package/dist/types.js +0 -0
- package/dist/ui/badge.d.ts +7 -0
- package/dist/ui/badge.js +1 -0
- package/dist/ui/button.d.ts +8 -0
- package/dist/ui/button.js +1 -0
- package/dist/ui/card.d.ts +11 -0
- package/dist/ui/card.js +1 -0
- package/dist/ui/checkbox.d.ts +3 -0
- package/dist/ui/checkbox.js +1 -0
- package/dist/ui/dialog.d.ts +17 -0
- package/dist/ui/dialog.js +1 -0
- package/dist/ui/dropdown-menu.d.ts +29 -0
- package/dist/ui/dropdown-menu.js +1 -0
- package/dist/ui/field.d.ts +24 -0
- package/dist/ui/field.js +1 -0
- package/dist/ui/hover-card.d.ts +5 -0
- package/dist/ui/hover-card.js +1 -0
- package/dist/ui/input-group-textarea.d.ts +2 -0
- package/dist/ui/input-group-textarea.js +1 -0
- package/dist/ui/input-group.d.ts +17 -0
- package/dist/ui/input-group.js +1 -0
- package/dist/ui/input.d.ts +3 -0
- package/dist/ui/input.js +1 -0
- package/dist/ui/label.d.ts +3 -0
- package/dist/ui/label.js +1 -0
- package/dist/ui/radio-group.d.ts +5 -0
- package/dist/ui/radio-group.js +1 -0
- package/dist/ui/separator.d.ts +3 -0
- package/dist/ui/separator.js +1 -0
- package/dist/ui/switch.d.ts +5 -0
- package/dist/ui/switch.js +1 -0
- package/dist/ui/textarea.d.ts +3 -0
- package/dist/ui/textarea.js +1 -0
- package/dist/ui/tooltip.d.ts +6 -0
- package/dist/ui/tooltip.js +1 -0
- package/licenses/Apache-2.0.txt +191 -0
- package/licenses/_agentclientprotocol_sdk-LICENSE +191 -0
- package/licenses/_base-ui_react-LICENSE +21 -0
- package/licenses/_floating-ui_dom-LICENSE +20 -0
- package/licenses/ai-elements-notice.txt +13 -0
- package/licenses/ansi_up-LICENSE +22 -0
- package/licenses/class-variance-authority-LICENSE +190 -0
- package/licenses/cn-LICENSE +21 -0
- package/licenses/diff2html-LICENSE.md +14 -0
- package/licenses/entities-LICENSE +11 -0
- package/licenses/highlight.js-LICENSE +29 -0
- package/licenses/katex-LICENSE +21 -0
- package/licenses/lucide-react-LICENSE +43 -0
- package/licenses/marked-LICENSE +44 -0
- package/licenses/marked-linkify-it-LICENSE +21 -0
- package/licenses/react-LICENSE +21 -0
- package/licenses/react-dom-LICENSE +21 -0
- package/licenses/shadcn-ui-MIT.txt +21 -0
- package/package.json +314 -0
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { NavigationInstrument, NavigationSoundMode } from "./navigation-instruments.js";
|
|
2
|
+
export interface NavigationTokenPair {
|
|
3
|
+
inputTokens: number;
|
|
4
|
+
outputTokens: number;
|
|
5
|
+
}
|
|
6
|
+
export declare function preloadThreadUserMessageNavigationInstrument(instrument: NavigationInstrument): void;
|
|
7
|
+
export declare function armThreadUserMessageNavigationAudio(): void;
|
|
8
|
+
export declare function installThreadUserMessageNavigationAudioUnlock(): () => void;
|
|
9
|
+
export declare function playThreadUserMessageNavigationSequence(fromIndex: number, toIndex: number, tokenPairs: NavigationTokenPair[], instrument: NavigationInstrument, mode: NavigationSoundMode): void;
|
|
10
|
+
export declare function playThreadUserMessageNavigationNote(itemIndex: number, itemCount: number, inputTokens: number, outputTokens: number, instrument: NavigationInstrument, mode: NavigationSoundMode): void;
|
|
11
|
+
export declare function navigationMidiNote(itemIndex: number, itemCount: number, inputTokens: number, outputTokens: number, mode: NavigationSoundMode): number;
|
|
12
|
+
export declare function automaticNavigationMidiNote(inputTokens: number, outputTokens: number): number;
|
|
13
|
+
export declare function pianoKeyMidiNote(itemIndex: number, itemCount: number): number;
|
|
14
|
+
export declare function pianoKeyFrequency(itemIndex: number, itemCount: number): number;
|
|
15
|
+
export declare function itemPianoKeyIndex(itemIndex: number, itemCount: number): number;
|
|
16
|
+
export declare function navigationPianoKeyIndexes(itemCount: number): number[];
|
|
17
|
+
export declare function getNavigationAudioContextState(): AudioContextState | undefined;
|
|
18
|
+
export declare function getNavigationInstrumentReady(instrument: NavigationInstrument): Promise<void>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{CacheStorage as O,Soundfont as y}from"smplr";var h=4,I=21,d=88,c=[39,41,43,44,46,48,50],_=0.035,w=0.16,S=88,U=50,m="acoustic_grand_piano",C="MusyngKite",D="FluidR3_GM",p=[0,2,4,5,7,9,11],L=2,k=5,l=globalThis;if(l.__alwithThreadUserMessageNavigationAudio?.version!==h)l.__alwithThreadUserMessageNavigationAudio={version:h,context:null,storage:O("alwith-thread-navigation-instruments"),players:new Map,nextNoteTime:0,unlockConsumerCount:0};var i=l.__alwithThreadUserMessageNavigationAudio;function g(){if(i.context===null)i.context=new AudioContext;return i.context}function u(){let e=g();if(e.state==="running"){i.nextNoteTime=e.currentTime;return}e.resume().then(()=>{i.nextNoteTime=e.currentTime},(t)=>{if(t instanceof DOMException&&t.name==="NotAllowedError")return;console.error("Failed to unlock thread navigation audio",t)})}function F(e){let t=g();return y(t,{instrument:e,kit:e===m?C:D,storage:i.storage,volume:U})}function T(e){let t=i.players.get(e);if(t!==void 0)return t;let n=F(e),r={player:n,ready:n.ready};return i.players.set(e,r),r}function b(e){T(e).ready.catch((t)=>{console.error(`Failed to load navigation instrument "${e}"`,t)})}function q(){u()}function G(){if(i.unlockConsumerCount===0)window.addEventListener("pointerdown",u,{capture:!0}),window.addEventListener("keydown",u,{capture:!0});return i.unlockConsumerCount++,()=>{if(i.unlockConsumerCount--,i.unlockConsumerCount===0)window.removeEventListener("pointerdown",u,{capture:!0}),window.removeEventListener("keydown",u,{capture:!0})}}function H(e,t,n,r,o){if(o==="none")return;let a=Math.sign(t-e),s=Math.abs(t-e),E=Array.from({length:s},(Y,M)=>{let N=e+a*(M+1),f=n[N];return v(N,n.length,f.inputTokens,f.outputTokens,o)});A(r,E)}function J(e,t,n,r,o,a){if(a==="none")return;A(o,[v(e,t,n,r,a)])}function v(e,t,n,r,o){if(o==="none")throw Error("navigationMidiNote: 声音已关闭,不该求音符");if(o==="auto")return K(n,r);return x(e,t)}function K(e,t){let n=Math.imul(e,5)+Math.imul(t,3)>>>0,r=(Math.imul(e,11)^Math.imul(t,13))>>>0,o=n%p.length;return 12*(L+r%k+1)+p[o]}function x(e,t){return I+R(e,t)}function X(e,t){return V(x(e,t))}function R(e,t){if(t<=d)return P(t)[t-e-1];return Math.round((t-e-1)/(t-1)*(d-1))}function P(e){if(e<=c.length)return c.slice(0,e);let t=new Set(c),n=c[0]-1,r=c[c.length-1]+1;while(t.size<e&&(n>=0||r<d)){if(n>=0&&t.size<e)t.add(n--);if(r<d&&t.size<e)t.add(r++)}for(let o=0;t.size<e&&o<d;o++)t.add(o);return[...t].sort((o,a)=>o-a)}function V(e){return 440*2**((e-69)/12)}function A(e,t){let n=g();if(n.state!=="running")return;let{player:r,ready:o}=T(e);o.then(()=>{let a=Math.max(n.currentTime,i.nextNoteTime);for(let s=0;s<t.length;s++)r.start({note:t[s],time:a+s*_,duration:w,velocity:S});i.nextNoteTime=a+t.length*_}).catch((a)=>{console.error(`Failed to play navigation instrument "${e}"`,a)})}function j(){return i.context?.state}function B(e){return T(e).ready}export{q as armThreadUserMessageNavigationAudio,K as automaticNavigationMidiNote,j as getNavigationAudioContextState,B as getNavigationInstrumentReady,G as installThreadUserMessageNavigationAudioUnlock,R as itemPianoKeyIndex,v as navigationMidiNote,P as navigationPianoKeyIndexes,X as pianoKeyFrequency,x as pianoKeyMidiNote,J as playThreadUserMessageNavigationNote,H as playThreadUserMessageNavigationSequence,b as preloadThreadUserMessageNavigationInstrument};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
export declare const NAVIGATION_INSTRUMENT_GROUPS: readonly [{
|
|
2
|
+
readonly id: "piano";
|
|
3
|
+
readonly instruments: readonly ["acoustic_grand_piano", "bright_acoustic_piano", "electric_grand_piano", "honkytonk_piano", "electric_piano_1", "electric_piano_2", "harpsichord", "clavinet"];
|
|
4
|
+
}, {
|
|
5
|
+
readonly id: "chromaticPercussion";
|
|
6
|
+
readonly instruments: readonly ["celesta", "glockenspiel", "music_box", "vibraphone", "marimba", "xylophone", "tubular_bells", "dulcimer"];
|
|
7
|
+
}, {
|
|
8
|
+
readonly id: "organ";
|
|
9
|
+
readonly instruments: readonly ["drawbar_organ", "percussive_organ", "rock_organ", "church_organ", "reed_organ", "accordion", "harmonica", "tango_accordion"];
|
|
10
|
+
}, {
|
|
11
|
+
readonly id: "guitar";
|
|
12
|
+
readonly instruments: readonly ["acoustic_guitar_nylon", "acoustic_guitar_steel", "electric_guitar_jazz", "electric_guitar_clean", "electric_guitar_muted", "overdriven_guitar", "distortion_guitar", "guitar_harmonics"];
|
|
13
|
+
}, {
|
|
14
|
+
readonly id: "bass";
|
|
15
|
+
readonly instruments: readonly ["acoustic_bass", "electric_bass_finger", "electric_bass_pick", "fretless_bass", "slap_bass_1", "slap_bass_2", "synth_bass_1", "synth_bass_2"];
|
|
16
|
+
}, {
|
|
17
|
+
readonly id: "strings";
|
|
18
|
+
readonly instruments: readonly ["violin", "viola", "cello", "contrabass", "tremolo_strings", "pizzicato_strings", "orchestral_harp", "timpani"];
|
|
19
|
+
}, {
|
|
20
|
+
readonly id: "ensemble";
|
|
21
|
+
readonly instruments: readonly ["string_ensemble_1", "string_ensemble_2", "synth_strings_1", "synth_strings_2", "choir_aahs", "voice_oohs", "synth_choir", "orchestra_hit"];
|
|
22
|
+
}, {
|
|
23
|
+
readonly id: "brass";
|
|
24
|
+
readonly instruments: readonly ["trumpet", "trombone", "tuba", "muted_trumpet", "french_horn", "brass_section", "synth_brass_1", "synth_brass_2"];
|
|
25
|
+
}, {
|
|
26
|
+
readonly id: "reed";
|
|
27
|
+
readonly instruments: readonly ["soprano_sax", "alto_sax", "tenor_sax", "baritone_sax", "oboe", "english_horn", "bassoon", "clarinet"];
|
|
28
|
+
}, {
|
|
29
|
+
readonly id: "pipe";
|
|
30
|
+
readonly instruments: readonly ["piccolo", "flute", "recorder", "pan_flute", "blown_bottle", "shakuhachi", "whistle", "ocarina"];
|
|
31
|
+
}, {
|
|
32
|
+
readonly id: "synthLead";
|
|
33
|
+
readonly instruments: readonly ["lead_1_square", "lead_2_sawtooth", "lead_3_calliope", "lead_4_chiff", "lead_5_charang", "lead_6_voice", "lead_7_fifths", "lead_8_bass__lead"];
|
|
34
|
+
}, {
|
|
35
|
+
readonly id: "synthPad";
|
|
36
|
+
readonly instruments: readonly ["pad_1_new_age", "pad_2_warm", "pad_3_polysynth", "pad_4_choir", "pad_5_bowed", "pad_6_metallic", "pad_7_halo", "pad_8_sweep"];
|
|
37
|
+
}, {
|
|
38
|
+
readonly id: "synthEffects";
|
|
39
|
+
readonly instruments: readonly ["fx_1_rain", "fx_2_soundtrack", "fx_3_crystal", "fx_4_atmosphere", "fx_5_brightness", "fx_6_goblins", "fx_7_echoes", "fx_8_scifi"];
|
|
40
|
+
}, {
|
|
41
|
+
readonly id: "ethnic";
|
|
42
|
+
readonly instruments: readonly ["sitar", "banjo", "shamisen", "koto", "kalimba", "bagpipe", "fiddle", "shanai"];
|
|
43
|
+
}, {
|
|
44
|
+
readonly id: "percussive";
|
|
45
|
+
readonly instruments: readonly ["tinkle_bell", "agogo", "steel_drums", "woodblock", "taiko_drum", "melodic_tom", "synth_drum", "reverse_cymbal"];
|
|
46
|
+
}, {
|
|
47
|
+
readonly id: "soundEffects";
|
|
48
|
+
readonly instruments: readonly ["guitar_fret_noise", "breath_noise", "seashore", "bird_tweet", "telephone_ring", "helicopter", "applause", "gunshot"];
|
|
49
|
+
}];
|
|
50
|
+
export declare const NAVIGATION_INSTRUMENT_IDS: ("acoustic_grand_piano" | "bright_acoustic_piano" | "electric_grand_piano" | "honkytonk_piano" | "electric_piano_1" | "electric_piano_2" | "harpsichord" | "clavinet" | "celesta" | "glockenspiel" | "music_box" | "vibraphone" | "marimba" | "xylophone" | "tubular_bells" | "dulcimer" | "drawbar_organ" | "percussive_organ" | "rock_organ" | "church_organ" | "reed_organ" | "accordion" | "harmonica" | "tango_accordion" | "acoustic_guitar_nylon" | "acoustic_guitar_steel" | "electric_guitar_jazz" | "electric_guitar_clean" | "electric_guitar_muted" | "overdriven_guitar" | "distortion_guitar" | "guitar_harmonics" | "acoustic_bass" | "electric_bass_finger" | "electric_bass_pick" | "fretless_bass" | "slap_bass_1" | "slap_bass_2" | "synth_bass_1" | "synth_bass_2" | "violin" | "viola" | "cello" | "contrabass" | "tremolo_strings" | "pizzicato_strings" | "orchestral_harp" | "timpani" | "string_ensemble_1" | "string_ensemble_2" | "synth_strings_1" | "synth_strings_2" | "choir_aahs" | "voice_oohs" | "synth_choir" | "orchestra_hit" | "trumpet" | "trombone" | "tuba" | "muted_trumpet" | "french_horn" | "brass_section" | "synth_brass_1" | "synth_brass_2" | "soprano_sax" | "alto_sax" | "tenor_sax" | "baritone_sax" | "oboe" | "english_horn" | "bassoon" | "clarinet" | "piccolo" | "flute" | "recorder" | "pan_flute" | "blown_bottle" | "shakuhachi" | "whistle" | "ocarina" | "lead_1_square" | "lead_2_sawtooth" | "lead_3_calliope" | "lead_4_chiff" | "lead_5_charang" | "lead_6_voice" | "lead_7_fifths" | "lead_8_bass__lead" | "pad_1_new_age" | "pad_2_warm" | "pad_3_polysynth" | "pad_4_choir" | "pad_5_bowed" | "pad_6_metallic" | "pad_7_halo" | "pad_8_sweep" | "fx_1_rain" | "fx_2_soundtrack" | "fx_3_crystal" | "fx_4_atmosphere" | "fx_5_brightness" | "fx_6_goblins" | "fx_7_echoes" | "fx_8_scifi" | "sitar" | "banjo" | "shamisen" | "koto" | "kalimba" | "bagpipe" | "fiddle" | "shanai" | "tinkle_bell" | "agogo" | "steel_drums" | "woodblock" | "taiko_drum" | "melodic_tom" | "synth_drum" | "reverse_cymbal" | "guitar_fret_noise" | "breath_noise" | "seashore" | "bird_tweet" | "telephone_ring" | "helicopter" | "applause" | "gunshot")[];
|
|
51
|
+
export type NavigationInstrument = (typeof NAVIGATION_INSTRUMENT_IDS)[number];
|
|
52
|
+
export declare const NAVIGATION_SOUND_MODES: readonly ["none", "scale", "auto"];
|
|
53
|
+
export type NavigationSoundMode = (typeof NAVIGATION_SOUND_MODES)[number];
|
|
54
|
+
export declare function navigationInstrumentLabel(instrument: NavigationInstrument): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var t=[{id:"piano",instruments:["acoustic_grand_piano","bright_acoustic_piano","electric_grand_piano","honkytonk_piano","electric_piano_1","electric_piano_2","harpsichord","clavinet"]},{id:"chromaticPercussion",instruments:["celesta","glockenspiel","music_box","vibraphone","marimba","xylophone","tubular_bells","dulcimer"]},{id:"organ",instruments:["drawbar_organ","percussive_organ","rock_organ","church_organ","reed_organ","accordion","harmonica","tango_accordion"]},{id:"guitar",instruments:["acoustic_guitar_nylon","acoustic_guitar_steel","electric_guitar_jazz","electric_guitar_clean","electric_guitar_muted","overdriven_guitar","distortion_guitar","guitar_harmonics"]},{id:"bass",instruments:["acoustic_bass","electric_bass_finger","electric_bass_pick","fretless_bass","slap_bass_1","slap_bass_2","synth_bass_1","synth_bass_2"]},{id:"strings",instruments:["violin","viola","cello","contrabass","tremolo_strings","pizzicato_strings","orchestral_harp","timpani"]},{id:"ensemble",instruments:["string_ensemble_1","string_ensemble_2","synth_strings_1","synth_strings_2","choir_aahs","voice_oohs","synth_choir","orchestra_hit"]},{id:"brass",instruments:["trumpet","trombone","tuba","muted_trumpet","french_horn","brass_section","synth_brass_1","synth_brass_2"]},{id:"reed",instruments:["soprano_sax","alto_sax","tenor_sax","baritone_sax","oboe","english_horn","bassoon","clarinet"]},{id:"pipe",instruments:["piccolo","flute","recorder","pan_flute","blown_bottle","shakuhachi","whistle","ocarina"]},{id:"synthLead",instruments:["lead_1_square","lead_2_sawtooth","lead_3_calliope","lead_4_chiff","lead_5_charang","lead_6_voice","lead_7_fifths","lead_8_bass__lead"]},{id:"synthPad",instruments:["pad_1_new_age","pad_2_warm","pad_3_polysynth","pad_4_choir","pad_5_bowed","pad_6_metallic","pad_7_halo","pad_8_sweep"]},{id:"synthEffects",instruments:["fx_1_rain","fx_2_soundtrack","fx_3_crystal","fx_4_atmosphere","fx_5_brightness","fx_6_goblins","fx_7_echoes","fx_8_scifi"]},{id:"ethnic",instruments:["sitar","banjo","shamisen","koto","kalimba","bagpipe","fiddle","shanai"]},{id:"percussive",instruments:["tinkle_bell","agogo","steel_drums","woodblock","taiko_drum","melodic_tom","synth_drum","reverse_cymbal"]},{id:"soundEffects",instruments:["guitar_fret_noise","breath_noise","seashore","bird_tweet","telephone_ring","helicopter","applause","gunshot"]}],a=t.flatMap((e)=>e.instruments),_=["none","scale","auto"];function i(e){return e.replace("__"," / ").replaceAll("_"," ").replace(/^fx /,"FX ").replace(/^./,(s)=>s.toUpperCase())}export{t as NAVIGATION_INSTRUMENT_GROUPS,a as NAVIGATION_INSTRUMENT_IDS,_ as NAVIGATION_SOUND_MODES,i as navigationInstrumentLabel};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { PreviewCard } from "@base-ui/react/preview-card";
|
|
2
|
+
import type { ReactElement, ReactNode } from "react";
|
|
3
|
+
export declare function NavigationPreview({ open, onOpenChange, trigger, children, ...position }: {
|
|
4
|
+
open: boolean;
|
|
5
|
+
onOpenChange: (open: boolean) => void;
|
|
6
|
+
trigger: ReactElement;
|
|
7
|
+
children: ReactNode;
|
|
8
|
+
} & Pick<PreviewCard.Positioner.Props, "align" | "alignOffset" | "side" | "sideOffset">): import("react").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as r,jsxs as l}from"react/jsx-runtime";import{PreviewCard as e}from"@base-ui/react/preview-card";function c({open:o,onOpenChange:a,trigger:i,children:n,...s}){return l(e.Root,{open:o,onOpenChange:a,children:[r(e.Trigger,{render:i,delay:700,closeDelay:100}),r(e.Portal,{children:r(e.Positioner,{...s,className:"isolate z-50",children:r(e.Popup,{"data-slot":"codex-hover-card",className:"m-0 outline-hidden",children:n})})})]})}export{c as NavigationPreview};
|
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
.thread-user-message-navigation {
|
|
2
|
+
animation: thread-user-message-navigation-enter 150ms cubic-bezier(0.23, 1, 0.32, 1) both;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.thread-user-message-navigation-rail-list {
|
|
6
|
+
--edge-fade-distance: 2.5rem;
|
|
7
|
+
display: flex;
|
|
8
|
+
max-height: min(70vh, 40rem);
|
|
9
|
+
flex-direction: column;
|
|
10
|
+
overflow-y: auto;
|
|
11
|
+
overscroll-behavior: contain;
|
|
12
|
+
scrollbar-width: none;
|
|
13
|
+
mask: linear-gradient(
|
|
14
|
+
to bottom in oklch,
|
|
15
|
+
oklch(60% 0 0 / 0),
|
|
16
|
+
oklch(85% 0 0) var(--top-fade) calc(100% - var(--bottom-fade)),
|
|
17
|
+
oklch(60% 0 0 / 0)
|
|
18
|
+
);
|
|
19
|
+
animation-name: thread-user-message-navigation-edge-fade;
|
|
20
|
+
animation-timing-function: linear;
|
|
21
|
+
animation-fill-mode: both;
|
|
22
|
+
animation-timeline: scroll(self y);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.thread-user-message-navigation-rail-list::-webkit-scrollbar {
|
|
26
|
+
display: none;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.thread-user-message-navigation-row {
|
|
30
|
+
display: flex;
|
|
31
|
+
width: 36px;
|
|
32
|
+
height: 10px;
|
|
33
|
+
flex-shrink: 0;
|
|
34
|
+
align-items: center;
|
|
35
|
+
cursor: default;
|
|
36
|
+
outline: none;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.thread-user-message-navigation-marker {
|
|
40
|
+
--marker-progress: 0;
|
|
41
|
+
width: 26px;
|
|
42
|
+
height: 2px;
|
|
43
|
+
background-color: var(--muted-foreground);
|
|
44
|
+
opacity: 0.4;
|
|
45
|
+
transform: scaleX(calc(0.2308 + 0.7692 * var(--marker-progress)));
|
|
46
|
+
transform-origin: left;
|
|
47
|
+
transition: transform 160ms
|
|
48
|
+
linear(0, 0.398 10%, 0.682 20%, 0.843 30%, 0.925 40%, 0.972 50%, 1.004 60%, 1.008 70%, 1.003 80%, 1);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.thread-user-message-navigation-marker:dir(rtl) {
|
|
52
|
+
transform-origin: right;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
:is(
|
|
56
|
+
.thread-user-message-navigation-row:has(+ .thread-user-message-navigation-row[data-scrub-target]),
|
|
57
|
+
.thread-user-message-navigation-row[data-scrub-target] + .thread-user-message-navigation-row
|
|
58
|
+
)
|
|
59
|
+
.thread-user-message-navigation-marker {
|
|
60
|
+
--marker-progress: 0.7;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
:is(
|
|
64
|
+
.thread-user-message-navigation-row:has(
|
|
65
|
+
+ .thread-user-message-navigation-row + .thread-user-message-navigation-row[data-scrub-target]
|
|
66
|
+
),
|
|
67
|
+
.thread-user-message-navigation-row[data-scrub-target]
|
|
68
|
+
+ .thread-user-message-navigation-row
|
|
69
|
+
+ .thread-user-message-navigation-row
|
|
70
|
+
)
|
|
71
|
+
.thread-user-message-navigation-marker {
|
|
72
|
+
--marker-progress: 0.4;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
:is(
|
|
76
|
+
.thread-user-message-navigation-row:has(
|
|
77
|
+
+ .thread-user-message-navigation-row
|
|
78
|
+
+ .thread-user-message-navigation-row
|
|
79
|
+
+ .thread-user-message-navigation-row[data-scrub-target]
|
|
80
|
+
),
|
|
81
|
+
.thread-user-message-navigation-row[data-scrub-target]
|
|
82
|
+
+ .thread-user-message-navigation-row
|
|
83
|
+
+ .thread-user-message-navigation-row
|
|
84
|
+
+ .thread-user-message-navigation-row
|
|
85
|
+
)
|
|
86
|
+
.thread-user-message-navigation-marker {
|
|
87
|
+
--marker-progress: 0.2;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.thread-user-message-navigation-row[aria-current="true"] .thread-user-message-navigation-marker {
|
|
91
|
+
background-color: var(--foreground);
|
|
92
|
+
opacity: 0.6;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
:is(.thread-user-message-navigation-row:focus-visible, .thread-user-message-navigation-row[data-scrub-target])
|
|
96
|
+
.thread-user-message-navigation-marker {
|
|
97
|
+
--marker-progress: 1;
|
|
98
|
+
background-color: var(--foreground);
|
|
99
|
+
opacity: 1;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.thread-user-message-navigation-rail-list[data-scrubbing] .thread-user-message-navigation-marker {
|
|
103
|
+
transition-duration: 0s;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.thread-user-message-navigation-rail-list[data-scrubbing]
|
|
107
|
+
.thread-user-message-navigation-row[aria-current="true"]:not([data-scrub-target])
|
|
108
|
+
.thread-user-message-navigation-marker {
|
|
109
|
+
background-color: var(--muted-foreground);
|
|
110
|
+
opacity: 0.4;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
@media (hover: hover) and (pointer: fine) {
|
|
114
|
+
.thread-user-message-navigation-rail-list:not([data-scrubbing]):hover
|
|
115
|
+
.thread-user-message-navigation-row[aria-current="true"]:not(:hover):not(:focus-visible)
|
|
116
|
+
.thread-user-message-navigation-marker {
|
|
117
|
+
background-color: var(--muted-foreground);
|
|
118
|
+
opacity: 0.4;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
:is(
|
|
122
|
+
.thread-user-message-navigation-rail-list:not([data-scrubbing])
|
|
123
|
+
.thread-user-message-navigation-row:has(+ .thread-user-message-navigation-row:hover),
|
|
124
|
+
.thread-user-message-navigation-rail-list:not([data-scrubbing])
|
|
125
|
+
.thread-user-message-navigation-row:hover
|
|
126
|
+
+ .thread-user-message-navigation-row
|
|
127
|
+
)
|
|
128
|
+
.thread-user-message-navigation-marker {
|
|
129
|
+
--marker-progress: 0.7;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
:is(
|
|
133
|
+
.thread-user-message-navigation-rail-list:not([data-scrubbing])
|
|
134
|
+
.thread-user-message-navigation-row:has(
|
|
135
|
+
+ .thread-user-message-navigation-row + .thread-user-message-navigation-row:hover
|
|
136
|
+
),
|
|
137
|
+
.thread-user-message-navigation-rail-list:not([data-scrubbing])
|
|
138
|
+
.thread-user-message-navigation-row:hover
|
|
139
|
+
+ .thread-user-message-navigation-row
|
|
140
|
+
+ .thread-user-message-navigation-row
|
|
141
|
+
)
|
|
142
|
+
.thread-user-message-navigation-marker {
|
|
143
|
+
--marker-progress: 0.4;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
:is(
|
|
147
|
+
.thread-user-message-navigation-rail-list:not([data-scrubbing])
|
|
148
|
+
.thread-user-message-navigation-row:has(
|
|
149
|
+
+ .thread-user-message-navigation-row
|
|
150
|
+
+ .thread-user-message-navigation-row
|
|
151
|
+
+ .thread-user-message-navigation-row:hover
|
|
152
|
+
),
|
|
153
|
+
.thread-user-message-navigation-rail-list:not([data-scrubbing])
|
|
154
|
+
.thread-user-message-navigation-row:hover
|
|
155
|
+
+ .thread-user-message-navigation-row
|
|
156
|
+
+ .thread-user-message-navigation-row
|
|
157
|
+
+ .thread-user-message-navigation-row
|
|
158
|
+
)
|
|
159
|
+
.thread-user-message-navigation-marker {
|
|
160
|
+
--marker-progress: 0.2;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
.thread-user-message-navigation-rail-list:not([data-scrubbing])
|
|
164
|
+
.thread-user-message-navigation-row:hover
|
|
165
|
+
.thread-user-message-navigation-marker {
|
|
166
|
+
--marker-progress: 1;
|
|
167
|
+
background-color: var(--foreground);
|
|
168
|
+
opacity: 1;
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
@media (prefers-reduced-motion: reduce) {
|
|
173
|
+
.thread-user-message-navigation {
|
|
174
|
+
animation-duration: 0s;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
.thread-user-message-navigation-marker {
|
|
178
|
+
transition-duration: 0s;
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
@keyframes thread-user-message-navigation-enter {
|
|
183
|
+
from {
|
|
184
|
+
opacity: 0;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
to {
|
|
188
|
+
opacity: 1;
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
@keyframes thread-user-message-navigation-edge-fade {
|
|
193
|
+
0%,
|
|
194
|
+
1% {
|
|
195
|
+
--top-fade: 0;
|
|
196
|
+
--bottom-fade: var(--edge-fade-distance);
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
99%,
|
|
200
|
+
100% {
|
|
201
|
+
--top-fade: var(--edge-fade-distance);
|
|
202
|
+
--bottom-fade: 0;
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
@property --top-fade {
|
|
207
|
+
syntax: "<length>";
|
|
208
|
+
inherits: false;
|
|
209
|
+
initial-value: 0;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
@property --bottom-fade {
|
|
213
|
+
syntax: "<length>";
|
|
214
|
+
inherits: false;
|
|
215
|
+
initial-value: 0;
|
|
216
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import "./navigation-rail.css";
|
|
2
|
+
export interface NavigationRailAudio {
|
|
3
|
+
installUnlock: () => () => void;
|
|
4
|
+
preload: () => void;
|
|
5
|
+
playSequence: (from: number, to: number, tokens: Array<{
|
|
6
|
+
inputTokens: number;
|
|
7
|
+
outputTokens: number;
|
|
8
|
+
}>) => void;
|
|
9
|
+
}
|
|
10
|
+
export interface ThreadUserMessageNavigationItem {
|
|
11
|
+
id: string;
|
|
12
|
+
turnKey: string;
|
|
13
|
+
label: string;
|
|
14
|
+
response: string;
|
|
15
|
+
inputTokens: number;
|
|
16
|
+
outputTokens: number;
|
|
17
|
+
}
|
|
18
|
+
export declare function ThreadUserMessageNavigationRail({ audio, beforeReveal, ensureItemMounted, items, scrollRoot, targetTopMarginPx }: {
|
|
19
|
+
audio: NavigationRailAudio;
|
|
20
|
+
beforeReveal: () => void;
|
|
21
|
+
ensureItemMounted?: (item: ThreadUserMessageNavigationItem) => Promise<void>;
|
|
22
|
+
items: ThreadUserMessageNavigationItem[];
|
|
23
|
+
scrollRoot: HTMLElement | null;
|
|
24
|
+
targetTopMarginPx?: number;
|
|
25
|
+
}): import("react").JSX.Element | null;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as g,jsxs as ee}from"react/jsx-runtime";import{useCallback as te,useEffect as C,useMemo as z,useRef as b,useState as N}from"react";import{NavigationPreview as ne}from"./navigation-preview.js";import"./navigation-rail.css";var re=4,ie=10;function de({audio:O,beforeReveal:k,ensureItemMounted:f,items:a,scrollRoot:u,targetTopMarginPx:A=16}){let[W,Y]=N(()=>new Set(a.length===0?[]:[a[a.length-1].id])),[p,h]=N(null),[B,P]=N(null),[U,w]=N(!1),[_,Q]=N(()=>new Set),{installUnlock:H,preload:L,playSequence:R}=O,M=b(null),I=b(null),T=b(!1),x=b(null),S=b(0),y=z(()=>a.map((e)=>e.id).join("\x00"),[a]),E=b(a);E.current=a;let G=b({itemIdsKey:y,scrollRoot:u}),K=G.current;if(K.itemIdsKey!==y||K.scrollRoot!==u)S.current+=1,G.current={itemIdsKey:y,scrollRoot:u};let m=z(()=>f===void 0?a.filter((e)=>_.has(e.id)):a,[f,a,_]),D=z(()=>m.map((e)=>({inputTokens:e.inputTokens,outputTokens:e.outputTokens})),[m]);C(()=>H(),[H]),C(()=>()=>{S.current+=1},[]),C(()=>{h(null),w(!1),P(null),I.current=null,T.current=!1,x.current=null},[y,u]),C(()=>{L()},[L]),C(()=>{if(u===null)return;let e=new Set,t=new Map,c=()=>{let r=new Set(t.values()),i=E.current.filter((s)=>r.has(s.id)).map((s)=>s.id),n=i.findIndex((s)=>e.has(s));if(n===-1)return;let l=n;for(let s=n+1;s<i.length;s++)if(e.has(i[s]))l=s;Y((s)=>{let j=new Set(i.slice(n,l+1));if(s.size===j.size&&[...s].every((Z)=>j.has(Z)))return s;return j})},d=new IntersectionObserver((r)=>{for(let i of r){let n=t.get(i.target);if(i.isIntersecting)e.add(n);else e.delete(n)}c()},{root:u,rootMargin:`-${A}px 0px 0px 0px`}),v=()=>{let r=new Set,i=new Set;for(let n of E.current){let l=u.querySelector(`[data-content-search-unit-key="${CSS.escape(n.id)}"]`);if(l===null)continue;if(r.add(n.id),i.add(l),t.has(l))continue;t.set(l,n.id),d.observe(l)}for(let n of t.keys()){if(i.has(n))continue;d.unobserve(n),e.delete(t.get(n)),t.delete(n)}Q((n)=>{if(n.size===r.size&&[...n].every((l)=>r.has(l)))return n;return r})};v();let o=new MutationObserver(v);return o.observe(u,{childList:!0,subtree:!0}),()=>{o.disconnect(),d.disconnect()}},[y,u,A]);let F=te(async(e)=>{if(u===null)throw Error("Thread user-message navigation scroll root is missing");let t=S.current+1;if(S.current=t,k(),f!==void 0){await f(e);return}let c=u.querySelector(`[data-content-search-unit-key="${CSS.escape(e.id)}"]`);if(c===null)throw Error(`Thread user-message navigation target is missing: ${e.id}`);if(S.current!==t)return;c.scrollIntoView({behavior:"instant",block:"start"})},[k,f,u]);if(m.length<re)return null;let q=M.current,X=p===null||q===null||!q.contains(p.button)?0:se(q,p.button),J=(e)=>{let t=e?.closest("[data-thread-user-message-navigation-item-id]"),c=M.current;if(t===void 0||t===null||!c.contains(t))return null;let d=t.dataset.threadUserMessageNavigationItemId,v=m.findIndex((o)=>o.id===d);return{button:t,item:m[v],index:v}},V=(e)=>{let t=I.current;if(t===null||t.pointerId!==e.pointerId)return;if(I.current=null,P(null),t.captureTarget.hasPointerCapture(e.pointerId))t.captureTarget.releasePointerCapture(e.pointerId)};return g("nav",{"aria-label":"User messages",className:"thread-user-message-navigation absolute start-4 top-1/2 z-20 -translate-y-1/2",children:g(ne,{open:U,onOpenChange:w,side:"inline-end",sideOffset:0,align:"center",alignOffset:X,trigger:g("div",{ref:M,"data-thread-user-message-navigation-rail-list":!0,"data-scrubbing":B===null?void 0:"",className:"thread-user-message-navigation-rail-list",onPointerEnter:()=>{x.current=null},onPointerDown:(e)=>{if(e.button!==0)return;let t=J(e.target instanceof Element?e.target:null);if(t===null)return;T.current=!1,I.current={pointerId:e.pointerId,itemId:t.item.id,itemIndex:t.index,captureTarget:t.button},t.button.setPointerCapture(e.pointerId),P(t.item.id),h(t),w(!0)},onPointerMove:(e)=>{let t=I.current;if(t===null){let r=J(e.target instanceof Element?e.target:null);if(r!==null){let i=x.current;if(i!==null&&i!==r.index)R(i,r.index,D);x.current=r.index,h(r)}return}if(t.pointerId!==e.pointerId)return;let c=e.currentTarget.getBoundingClientRect(),d=Math.max(0,Math.min(m.length-1,Math.floor((e.clientY-c.top+e.currentTarget.scrollTop)/ie))),o={button:e.currentTarget.querySelectorAll("[data-thread-user-message-navigation-item-id]")[d],item:m[d],index:d};if(o.item.id===t.itemId)return;R(t.itemIndex,o.index,D),x.current=o.index,I.current={...t,itemId:o.item.id,itemIndex:o.index},T.current=!0,P(o.item.id),h(o),F(o.item)},onPointerUp:V,onPointerCancel:V,onLostPointerCapture:V,onPointerLeave:()=>{if(x.current=null,I.current===null&&!U)h(null)},children:g("div",{className:"flex flex-col",children:m.map((e,t)=>g("button",{type:"button","data-thread-user-message-navigation-item-id":e.id,"data-scrub-target":B===e.id?"":void 0,"aria-current":W.has(e.id)?"true":void 0,"aria-label":`Jump to user message ${t+1}`,className:"thread-user-message-navigation-row",onClick:(c)=>{if(T.current){T.current=!1;return}let d={button:c.currentTarget,item:e,index:t};h(d),w(!0),F(e)},onFocus:(c)=>{h({button:c.currentTarget,item:e,index:t}),w(!0)},children:g("span",{className:"flex h-0.5 w-[30px] items-center",children:g("span",{className:"thread-user-message-navigation-marker"})})},e.id))})}),children:p!==null&&ee("div",{className:"bg-popover/95 text-popover-foreground ring-border w-80 max-w-[calc(100vw-1rem)] overflow-hidden rounded-xl p-2 text-sm leading-5 shadow-xl ring-[0.5px] backdrop-blur-sm",children:[g("div",{className:"min-w-0 truncate font-medium",children:p.item.label}),p.item.response.length>0&&g("div",{className:"text-muted-foreground mt-1 line-clamp-3",children:p.item.response})]})})})}function se(O,k){let f=O.getBoundingClientRect(),a=k.getBoundingClientRect();return a.top+a.height/2-(f.top+f.height/2)}export{de as ThreadUserMessageNavigationRail};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{jsx as s}from"react/jsx-runtime";import{html as n}from"diff2html";import{ColorSchemeType as r}from"diff2html/lib/types";import{useMemo as a}from"react";function p(e){let t=0,i=0;for(let o of e.split(`
|
|
2
|
+
`)){if(o.startsWith("+++")||o.startsWith("---"))continue;if(o.startsWith("+"))t+=1;else if(o.startsWith("-"))i+=1}return{additions:t,deletions:i}}function h({patch:e,theme:t}){let i=a(()=>n(e,{drawFileList:!1,outputFormat:"line-by-line",matching:"lines",colorScheme:t==="dark"?r.DARK:r.LIGHT}),[e,t]);return s("div",{className:"codex-patch-view",dangerouslySetInnerHTML:{__html:i}})}export{h as PatchView,p as patchStats};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsxs as e,jsx as s}from"react/jsx-runtime";import{CheckCircleIcon as t,CircleIcon as i,LoaderIcon as l}from"lucide-react";function p({entries:n}){let d=n.filter((a)=>a.status==="completed").length,c=n.find((a)=>a.status==="in_progress");return e("div",{className:"codex-plan",children:[e("div",{className:"codex-plan-summary",children:[e("span",{children:[d,"/",n.length]}),c!==void 0&&e("span",{className:"codex-plan-active",children:["· ",c.content]})]}),s("div",{className:"codex-plan-entries",children:n.map((a)=>e("div",{className:"codex-plan-entry","data-status":a.status,children:[a.status==="completed"&&s(t,{"aria-hidden":"true"}),a.status==="in_progress"&&s(l,{className:"codex-plan-spinner","aria-hidden":"true"}),a.status==="pending"&&s(i,{"aria-hidden":"true"}),s("span",{children:a.content})]},a.content))})]})}export{p as CodexPlan};
|