@openchamber/web 1.0.3 → 1.0.5
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/dist/assets/{MonacoDiffViewer-BsVn1wGg.js → MonacoDiffViewer-DjQ3gWyc.js} +1 -1
- package/dist/assets/{ToolOutputDialog-BLz2cnk4.js → ToolOutputDialog-uun3dDkb.js} +1 -1
- package/dist/assets/{index-BNR6aFOq.js → index-CMbNRGFL.js} +2 -2
- package/dist/assets/main-DvzQhmuw.js +59 -0
- package/dist/index.html +1 -1
- package/package.json +1 -1
- package/dist/assets/main-Di3gaYl_.js +0 -59
|
@@ -1 +1 @@
|
|
|
1
|
-
import{F as n,j as A,bK as F}from"./vendor-.pnpm-B1ce5n1Z.js";import{u as b}from"./main-Di3gaYl_.js";import"./index-BNR6aFOq.js";const y="openchamber-flexoki-light",B="openchamber-flexoki-dark";let p=null;const h=()=>{if(typeof window>"u")return null;const o=window;return o.monaco?.editor?.defineTheme?o.monaco:null},v={base:"vs-dark",inherit:!0,rules:[{token:"",foreground:"CECDC3"},{token:"source",foreground:"CECDC3"},{token:"comment",foreground:"878580"},{token:"comment.block",foreground:"878580"},{token:"comment.line",foreground:"878580"},{token:"comment.block.documentation",foreground:"575653"},{token:"string",foreground:"3AA99F"},{token:"string.quoted",foreground:"3AA99F"},{token:"string.template",foreground:"3AA99F"},{token:"string.regexp",foreground:"3AA99F"},{token:"string.escape",foreground:"CECDC3"},{token:"constant.character.escape",foreground:"CECDC3"},{token:"number",foreground:"8B7EC8"},{token:"number.hex",foreground:"8B7EC8"},{token:"number.float",foreground:"8B7EC8"},{token:"constant.numeric",foreground:"8B7EC8"},{token:"constant.language",foreground:"D0A215"},{token:"constant.language.boolean",foreground:"D0A215"},{token:"constant.language.null",foreground:"D0A215"},{token:"keyword",foreground:"4385BE"},{token:"keyword.control",foreground:"4385BE"},{token:"keyword.other",foreground:"4385BE"},{token:"keyword.control.import",foreground:"D14D41"},{token:"keyword.control.from",foreground:"D14D41"},{token:"keyword.control.export",foreground:"D14D41"},{token:"keyword.control.exception",foreground:"CE5D97"},{token:"keyword.control.trycatch",foreground:"CE5D97"},{token:"keyword.operator",foreground:"D14D41"},{token:"operator",foreground:"D14D41"},{token:"storage",foreground:"4385BE"},{token:"storage.type",foreground:"4385BE"},{token:"storage.modifier",foreground:"4385BE"},{token:"entity.name.function",foreground:"DA702C",fontStyle:"bold"},{token:"support.function",foreground:"DA702C",fontStyle:"bold"},{token:"meta.function-call",foreground:"DA702C"},{token:"entity.name.function.method",foreground:"879A39"},{token:"entity.name.class",foreground:"DA702C"},{token:"entity.name.type.class",foreground:"DA702C"},{token:"support.class",foreground:"DA702C"},{token:"entity.name.type",foreground:"D0A215"},{token:"entity.name.type.interface",foreground:"D0A215"},{token:"support.type",foreground:"D0A215"},{token:"entity.name.type.struct",foreground:"DA702C"},{token:"entity.name.type.enum",foreground:"DA702C"},{token:"entity.name.type.parameter",foreground:"DA702C"},{token:"variable",foreground:"CECDC3"},{token:"variable.other",foreground:"CECDC3"},{token:"variable.parameter",foreground:"CECDC3"},{token:"variable.other.object",foreground:"879A39"},{token:"variable.other.readwrite.alias",foreground:"879A39"},{token:"variable.language",foreground:"CE5D97"},{token:"variable.language.this",foreground:"CE5D97"},{token:"variable.language.super",foreground:"CE5D97"},{token:"variable.other.property",foreground:"4385BE"},{token:"support.variable.property",foreground:"4385BE"},{token:"variable.other.constant",foreground:"CECDC3"},{token:"meta.object-literal.key",foreground:"DA702C"},{token:"support.type.property-name",foreground:"DA702C"},{token:"entity.name.tag",foreground:"4385BE"},{token:"tag",foreground:"4385BE"},{token:"support.class.component",foreground:"CE5D97"},{token:"entity.other.attribute-name",foreground:"D0A215"},{token:"entity.name.namespace",foreground:"D0A215"},{token:"entity.name.module",foreground:"D14D41"},{token:"meta.decorator",foreground:"D0A215"},{token:"entity.name.function.decorator",foreground:"D0A215"},{token:"entity.name.label",foreground:"CE5D97"},{token:"meta.preprocessor",foreground:"CE5D97"},{token:"entity.name.function.preprocessor",foreground:"4385BE"},{token:"punctuation",foreground:"878580"},{token:"delimiter",foreground:"878580"},{token:"delimiter.bracket",foreground:"878580"},{token:"markup.heading",foreground:"D0A215"},{token:"markup.bold",foreground:"D0A215",fontStyle:"bold"},{token:"markup.italic",foreground:"3AA99F",fontStyle:"italic"},{token:"markup.underline.link",foreground:"4385BE"},{token:"markup.inline.raw",foreground:"3AA99F"},{token:"invalid",foreground:"D14D41"},{token:"invalid.illegal",foreground:"D14D41"},{token:"string.key.json",foreground:"DA702C"},{token:"string.value.json",foreground:"3AA99F"},{token:"support.type.property-name.css",foreground:"CECDC3"},{token:"support.constant.property-value.css",foreground:"3AA99F"},{token:"type",foreground:"D0A215"},{token:"type.identifier",foreground:"D0A215"},{token:"identifier",foreground:"CECDC3"}],colors:{"editor.background":"#100F0F","editor.foreground":"#CECDC3","editor.lineHighlightBackground":"#1C1B1A","editor.selectionBackground":"#CECDC333","editor.selectionHighlightBackground":"#CECDC333","editor.inactiveSelectionBackground":"#282726","editor.findMatchBackground":"#AD8301","editor.findMatchHighlightBackground":"#AD8301cc","editor.hoverHighlightBackground":"#343331","editor.rangeHighlightBackground":"#403E3C","editorCursor.foreground":"#CECDC3","editorLineNumber.foreground":"#403E3C","editorLineNumber.activeForeground":"#CECDC3","editorGutter.background":"#100F0F","editorGutter.modifiedBackground":"#3AA99F","editorGutter.addedBackground":"#879A39","editorGutter.deletedBackground":"#D14D41","diffEditor.insertedTextBackground":"#66800B25","diffEditor.removedTextBackground":"#AF302925","diffEditor.insertedLineBackground":"#66800B15","diffEditor.removedLineBackground":"#AF302915","diffEditor.insertedTextBorder":"#00000000","diffEditor.removedTextBorder":"#00000000","editorBracketMatch.background":"#282726","editorBracketMatch.border":"#343331","editorWhitespace.foreground":"#403E3C","editorIndentGuide.background1":"#343331","editorIndentGuide.activeBackground1":"#575653","editorWidget.background":"#1C1B1A","editorWidget.border":"#343331","editorSuggestWidget.background":"#100F0F","editorSuggestWidget.border":"#343331","editorSuggestWidget.foreground":"#CECDC3","editorSuggestWidget.selectedBackground":"#343331","editorHoverWidget.background":"#282726","editorHoverWidget.border":"#343331","editorInlayHint.foreground":"#878580","editorInlayHint.background":"#343331","editorError.foreground":"#D14D41","editorWarning.foreground":"#DA702C","editorInfo.foreground":"#4385BE","input.background":"#1C1B1A","input.foreground":"#CECDC3","input.border":"#343331","input.placeholderForeground":"#878580","dropdown.background":"#1C1B1A","dropdown.foreground":"#CECDC3","dropdown.border":"#343331","dropdown.listBackground":"#100F0F",focusBorder:"#343331","scrollbarSlider.background":"#34333180","scrollbarSlider.hoverBackground":"#403E3C","scrollbarSlider.activeBackground":"#575653"}},w={base:"vs",inherit:!0,rules:[{token:"",foreground:"100F0F"},{token:"source",foreground:"100F0F"},{token:"comment",foreground:"6F6E69"},{token:"comment.block",foreground:"6F6E69"},{token:"comment.line",foreground:"6F6E69"},{token:"comment.block.documentation",foreground:"B7B5AC"},{token:"string",foreground:"24837B"},{token:"string.quoted",foreground:"24837B"},{token:"string.template",foreground:"24837B"},{token:"string.regexp",foreground:"24837B"},{token:"string.escape",foreground:"100F0F"},{token:"constant.character.escape",foreground:"100F0F"},{token:"number",foreground:"5E409D"},{token:"number.hex",foreground:"5E409D"},{token:"number.float",foreground:"5E409D"},{token:"constant.numeric",foreground:"5E409D"},{token:"constant.language",foreground:"AD8301"},{token:"constant.language.boolean",foreground:"AD8301"},{token:"constant.language.null",foreground:"AD8301"},{token:"keyword",foreground:"205EA6"},{token:"keyword.control",foreground:"205EA6"},{token:"keyword.other",foreground:"205EA6"},{token:"keyword.control.import",foreground:"AF3029"},{token:"keyword.control.from",foreground:"AF3029"},{token:"keyword.control.export",foreground:"AF3029"},{token:"keyword.control.exception",foreground:"A02F6F"},{token:"keyword.control.trycatch",foreground:"A02F6F"},{token:"keyword.operator",foreground:"AF3029"},{token:"operator",foreground:"AF3029"},{token:"storage",foreground:"205EA6"},{token:"storage.type",foreground:"205EA6"},{token:"storage.modifier",foreground:"205EA6"},{token:"entity.name.function",foreground:"BC5215",fontStyle:"bold"},{token:"support.function",foreground:"BC5215",fontStyle:"bold"},{token:"meta.function-call",foreground:"BC5215"},{token:"entity.name.function.method",foreground:"66800B"},{token:"entity.name.class",foreground:"BC5215"},{token:"entity.name.type.class",foreground:"BC5215"},{token:"support.class",foreground:"BC5215"},{token:"entity.name.type",foreground:"AD8301"},{token:"entity.name.type.interface",foreground:"AD8301"},{token:"support.type",foreground:"AD8301"},{token:"entity.name.type.struct",foreground:"BC5215"},{token:"entity.name.type.enum",foreground:"BC5215"},{token:"entity.name.type.parameter",foreground:"BC5215"},{token:"variable",foreground:"100F0F"},{token:"variable.other",foreground:"100F0F"},{token:"variable.parameter",foreground:"100F0F"},{token:"variable.other.object",foreground:"66800B"},{token:"variable.other.readwrite.alias",foreground:"66800B"},{token:"variable.language",foreground:"A02F6F"},{token:"variable.language.this",foreground:"A02F6F"},{token:"variable.language.super",foreground:"A02F6F"},{token:"variable.other.property",foreground:"205EA6"},{token:"support.variable.property",foreground:"205EA6"},{token:"variable.other.constant",foreground:"100F0F"},{token:"meta.object-literal.key",foreground:"BC5215"},{token:"support.type.property-name",foreground:"BC5215"},{token:"entity.name.tag",foreground:"205EA6"},{token:"tag",foreground:"205EA6"},{token:"support.class.component",foreground:"A02F6F"},{token:"entity.other.attribute-name",foreground:"AD8301"},{token:"entity.name.namespace",foreground:"AD8301"},{token:"entity.name.module",foreground:"AF3029"},{token:"meta.decorator",foreground:"AD8301"},{token:"entity.name.function.decorator",foreground:"AD8301"},{token:"entity.name.label",foreground:"A02F6F"},{token:"meta.preprocessor",foreground:"A02F6F"},{token:"entity.name.function.preprocessor",foreground:"205EA6"},{token:"punctuation",foreground:"6F6E69"},{token:"delimiter",foreground:"6F6E69"},{token:"delimiter.bracket",foreground:"6F6E69"},{token:"markup.heading",foreground:"AD8301"},{token:"markup.bold",foreground:"AD8301",fontStyle:"bold"},{token:"markup.italic",foreground:"24837B",fontStyle:"italic"},{token:"markup.underline.link",foreground:"205EA6"},{token:"markup.inline.raw",foreground:"24837B"},{token:"invalid",foreground:"AF3029"},{token:"invalid.illegal",foreground:"AF3029"},{token:"string.key.json",foreground:"BC5215"},{token:"string.value.json",foreground:"24837B"},{token:"support.type.property-name.css",foreground:"100F0F"},{token:"support.constant.property-value.css",foreground:"24837B"},{token:"type",foreground:"AD8301"},{token:"type.identifier",foreground:"AD8301"},{token:"identifier",foreground:"100F0F"}],colors:{"editor.background":"#FFFCF0","editor.foreground":"#100F0F","editor.lineHighlightBackground":"#F2F0E5","editor.selectionBackground":"#100F0F44","editor.selectionHighlightBackground":"#100F0F44","editor.inactiveSelectionBackground":"#E6E4D9","editor.findMatchBackground":"#D0A215","editor.findMatchHighlightBackground":"#D0A215cc","editor.hoverHighlightBackground":"#DAD8CE","editor.rangeHighlightBackground":"#CECDC3","editorCursor.foreground":"#100F0F","editorLineNumber.foreground":"#CECDC3","editorLineNumber.activeForeground":"#100F0F","editorGutter.background":"#FFFCF0","editorGutter.modifiedBackground":"#24837B","editorGutter.addedBackground":"#66800B","editorGutter.deletedBackground":"#AF3029","diffEditor.insertedTextBackground":"#66800B25","diffEditor.removedTextBackground":"#AF302925","diffEditor.insertedLineBackground":"#66800B15","diffEditor.removedLineBackground":"#AF302915","diffEditor.insertedTextBorder":"#00000000","diffEditor.removedTextBorder":"#00000000","editorBracketMatch.background":"#E6E4D9","editorBracketMatch.border":"#DAD8CE","editorWhitespace.foreground":"#CECDC3","editorIndentGuide.background1":"#DAD8CE","editorIndentGuide.activeBackground1":"#B7B5AC","editorWidget.background":"#F2F0E5","editorWidget.border":"#DAD8CE","editorSuggestWidget.background":"#FFFCF0","editorSuggestWidget.border":"#DAD8CE","editorSuggestWidget.foreground":"#100F0F","editorSuggestWidget.selectedBackground":"#DAD8CE","editorHoverWidget.background":"#E6E4D9","editorHoverWidget.border":"#DAD8CE","editorInlayHint.foreground":"#6F6E69","editorInlayHint.background":"#DAD8CE","editorError.foreground":"#AF3029","editorWarning.foreground":"#BC5215","editorInfo.foreground":"#205EA6","input.background":"#F2F0E5","input.foreground":"#100F0F","input.border":"#DAD8CE","input.placeholderForeground":"#6F6E69","dropdown.background":"#F2F0E5","dropdown.foreground":"#100F0F","dropdown.border":"#DAD8CE","dropdown.listBackground":"#FFFCF0",focusBorder:"#DAD8CE","scrollbarSlider.background":"#DAD8CE80","scrollbarSlider.hoverBackground":"#CECDC3","scrollbarSlider.activeBackground":"#B7B5AC"}},C=o=>o.metadata.variant==="dark"?B:y,m=(o,c)=>{const d=c??h();if(!d)return;const r=C(o);if(p===r)return;const a=o.metadata.variant==="dark"?v:w;d.editor.defineTheme(r,a),p=r},M=({original:o,modified:c,language:d,renderSideBySide:r,allowResponsive:a=!1,readOnly:k=!0,showLineNumbers:s=!0})=>{const{currentTheme:t}=b(),g=n.useRef(null),f=n.useMemo(()=>C(t),[t]),D=n.useCallback(e=>{m(t,e)},[t]),E=n.useMemo(()=>({readOnly:k,renderSideBySide:r,automaticLayout:!0,minimap:{enabled:!1},wordWrap:"off",lineNumbers:s?"on":"off",renderIndicators:!1,scrollBeyondLastLine:!1,renderLineHighlight:"none",selectionHighlight:!1,occurrencesHighlight:"off",roundedSelection:!1,contextmenu:!1,folding:!1,glyphMargin:!1,renderMarginRevertIcon:!1,scrollbar:{vertical:"visible",horizontal:"visible",verticalScrollbarSize:6,horizontalScrollbarSize:6,useShadows:!1},hover:{enabled:!1},overviewRulerLanes:1,useInlineViewWhenSpaceIsLimited:a}),[a,k,r,s]);return n.useEffect(()=>{if(typeof window>"u")return;const e=window.monaco;e?.editor?.setTheme&&(m(t),e.editor.setTheme(f))},[t,f]),n.useEffect(()=>{const e=g.current;if(!e)return;const i=e.getOriginalEditor(),l=e.getModifiedEditor(),u={hover:{enabled:!1},quickSuggestions:!1,parameterHints:{enabled:!1},suggestOnTriggerCharacters:!1};i.updateOptions(u),l.updateOptions(u)},[f,k,r]),n.useEffect(()=>()=>{const e=g.current;if(e)try{e.dispose?.()}catch(i){console.warn("Error disposing DiffEditor:",i)}g.current=null},[]),typeof window>"u"?null:A.jsx(F,{original:o,modified:c,originalLanguage:d,modifiedLanguage:d,theme:f,options:E,beforeMount:D,onMount:e=>{g.current=e;const i=e.getOriginalEditor(),l=e.getModifiedEditor(),u={hover:{enabled:!1},quickSuggestions:!1,parameterHints:{enabled:!1},suggestOnTriggerCharacters:!1};i.updateOptions(u),l.updateOptions(u)},loading:null,className:"monaco-diff-wrapper"})};export{M as MonacoDiffViewer};
|
|
1
|
+
import{F as n,j as A,bK as F}from"./vendor-.pnpm-B1ce5n1Z.js";import{u as b}from"./main-DvzQhmuw.js";import"./index-CMbNRGFL.js";const y="openchamber-flexoki-light",B="openchamber-flexoki-dark";let p=null;const h=()=>{if(typeof window>"u")return null;const o=window;return o.monaco?.editor?.defineTheme?o.monaco:null},v={base:"vs-dark",inherit:!0,rules:[{token:"",foreground:"CECDC3"},{token:"source",foreground:"CECDC3"},{token:"comment",foreground:"878580"},{token:"comment.block",foreground:"878580"},{token:"comment.line",foreground:"878580"},{token:"comment.block.documentation",foreground:"575653"},{token:"string",foreground:"3AA99F"},{token:"string.quoted",foreground:"3AA99F"},{token:"string.template",foreground:"3AA99F"},{token:"string.regexp",foreground:"3AA99F"},{token:"string.escape",foreground:"CECDC3"},{token:"constant.character.escape",foreground:"CECDC3"},{token:"number",foreground:"8B7EC8"},{token:"number.hex",foreground:"8B7EC8"},{token:"number.float",foreground:"8B7EC8"},{token:"constant.numeric",foreground:"8B7EC8"},{token:"constant.language",foreground:"D0A215"},{token:"constant.language.boolean",foreground:"D0A215"},{token:"constant.language.null",foreground:"D0A215"},{token:"keyword",foreground:"4385BE"},{token:"keyword.control",foreground:"4385BE"},{token:"keyword.other",foreground:"4385BE"},{token:"keyword.control.import",foreground:"D14D41"},{token:"keyword.control.from",foreground:"D14D41"},{token:"keyword.control.export",foreground:"D14D41"},{token:"keyword.control.exception",foreground:"CE5D97"},{token:"keyword.control.trycatch",foreground:"CE5D97"},{token:"keyword.operator",foreground:"D14D41"},{token:"operator",foreground:"D14D41"},{token:"storage",foreground:"4385BE"},{token:"storage.type",foreground:"4385BE"},{token:"storage.modifier",foreground:"4385BE"},{token:"entity.name.function",foreground:"DA702C",fontStyle:"bold"},{token:"support.function",foreground:"DA702C",fontStyle:"bold"},{token:"meta.function-call",foreground:"DA702C"},{token:"entity.name.function.method",foreground:"879A39"},{token:"entity.name.class",foreground:"DA702C"},{token:"entity.name.type.class",foreground:"DA702C"},{token:"support.class",foreground:"DA702C"},{token:"entity.name.type",foreground:"D0A215"},{token:"entity.name.type.interface",foreground:"D0A215"},{token:"support.type",foreground:"D0A215"},{token:"entity.name.type.struct",foreground:"DA702C"},{token:"entity.name.type.enum",foreground:"DA702C"},{token:"entity.name.type.parameter",foreground:"DA702C"},{token:"variable",foreground:"CECDC3"},{token:"variable.other",foreground:"CECDC3"},{token:"variable.parameter",foreground:"CECDC3"},{token:"variable.other.object",foreground:"879A39"},{token:"variable.other.readwrite.alias",foreground:"879A39"},{token:"variable.language",foreground:"CE5D97"},{token:"variable.language.this",foreground:"CE5D97"},{token:"variable.language.super",foreground:"CE5D97"},{token:"variable.other.property",foreground:"4385BE"},{token:"support.variable.property",foreground:"4385BE"},{token:"variable.other.constant",foreground:"CECDC3"},{token:"meta.object-literal.key",foreground:"DA702C"},{token:"support.type.property-name",foreground:"DA702C"},{token:"entity.name.tag",foreground:"4385BE"},{token:"tag",foreground:"4385BE"},{token:"support.class.component",foreground:"CE5D97"},{token:"entity.other.attribute-name",foreground:"D0A215"},{token:"entity.name.namespace",foreground:"D0A215"},{token:"entity.name.module",foreground:"D14D41"},{token:"meta.decorator",foreground:"D0A215"},{token:"entity.name.function.decorator",foreground:"D0A215"},{token:"entity.name.label",foreground:"CE5D97"},{token:"meta.preprocessor",foreground:"CE5D97"},{token:"entity.name.function.preprocessor",foreground:"4385BE"},{token:"punctuation",foreground:"878580"},{token:"delimiter",foreground:"878580"},{token:"delimiter.bracket",foreground:"878580"},{token:"markup.heading",foreground:"D0A215"},{token:"markup.bold",foreground:"D0A215",fontStyle:"bold"},{token:"markup.italic",foreground:"3AA99F",fontStyle:"italic"},{token:"markup.underline.link",foreground:"4385BE"},{token:"markup.inline.raw",foreground:"3AA99F"},{token:"invalid",foreground:"D14D41"},{token:"invalid.illegal",foreground:"D14D41"},{token:"string.key.json",foreground:"DA702C"},{token:"string.value.json",foreground:"3AA99F"},{token:"support.type.property-name.css",foreground:"CECDC3"},{token:"support.constant.property-value.css",foreground:"3AA99F"},{token:"type",foreground:"D0A215"},{token:"type.identifier",foreground:"D0A215"},{token:"identifier",foreground:"CECDC3"}],colors:{"editor.background":"#100F0F","editor.foreground":"#CECDC3","editor.lineHighlightBackground":"#1C1B1A","editor.selectionBackground":"#CECDC333","editor.selectionHighlightBackground":"#CECDC333","editor.inactiveSelectionBackground":"#282726","editor.findMatchBackground":"#AD8301","editor.findMatchHighlightBackground":"#AD8301cc","editor.hoverHighlightBackground":"#343331","editor.rangeHighlightBackground":"#403E3C","editorCursor.foreground":"#CECDC3","editorLineNumber.foreground":"#403E3C","editorLineNumber.activeForeground":"#CECDC3","editorGutter.background":"#100F0F","editorGutter.modifiedBackground":"#3AA99F","editorGutter.addedBackground":"#879A39","editorGutter.deletedBackground":"#D14D41","diffEditor.insertedTextBackground":"#66800B25","diffEditor.removedTextBackground":"#AF302925","diffEditor.insertedLineBackground":"#66800B15","diffEditor.removedLineBackground":"#AF302915","diffEditor.insertedTextBorder":"#00000000","diffEditor.removedTextBorder":"#00000000","editorBracketMatch.background":"#282726","editorBracketMatch.border":"#343331","editorWhitespace.foreground":"#403E3C","editorIndentGuide.background1":"#343331","editorIndentGuide.activeBackground1":"#575653","editorWidget.background":"#1C1B1A","editorWidget.border":"#343331","editorSuggestWidget.background":"#100F0F","editorSuggestWidget.border":"#343331","editorSuggestWidget.foreground":"#CECDC3","editorSuggestWidget.selectedBackground":"#343331","editorHoverWidget.background":"#282726","editorHoverWidget.border":"#343331","editorInlayHint.foreground":"#878580","editorInlayHint.background":"#343331","editorError.foreground":"#D14D41","editorWarning.foreground":"#DA702C","editorInfo.foreground":"#4385BE","input.background":"#1C1B1A","input.foreground":"#CECDC3","input.border":"#343331","input.placeholderForeground":"#878580","dropdown.background":"#1C1B1A","dropdown.foreground":"#CECDC3","dropdown.border":"#343331","dropdown.listBackground":"#100F0F",focusBorder:"#343331","scrollbarSlider.background":"#34333180","scrollbarSlider.hoverBackground":"#403E3C","scrollbarSlider.activeBackground":"#575653"}},w={base:"vs",inherit:!0,rules:[{token:"",foreground:"100F0F"},{token:"source",foreground:"100F0F"},{token:"comment",foreground:"6F6E69"},{token:"comment.block",foreground:"6F6E69"},{token:"comment.line",foreground:"6F6E69"},{token:"comment.block.documentation",foreground:"B7B5AC"},{token:"string",foreground:"24837B"},{token:"string.quoted",foreground:"24837B"},{token:"string.template",foreground:"24837B"},{token:"string.regexp",foreground:"24837B"},{token:"string.escape",foreground:"100F0F"},{token:"constant.character.escape",foreground:"100F0F"},{token:"number",foreground:"5E409D"},{token:"number.hex",foreground:"5E409D"},{token:"number.float",foreground:"5E409D"},{token:"constant.numeric",foreground:"5E409D"},{token:"constant.language",foreground:"AD8301"},{token:"constant.language.boolean",foreground:"AD8301"},{token:"constant.language.null",foreground:"AD8301"},{token:"keyword",foreground:"205EA6"},{token:"keyword.control",foreground:"205EA6"},{token:"keyword.other",foreground:"205EA6"},{token:"keyword.control.import",foreground:"AF3029"},{token:"keyword.control.from",foreground:"AF3029"},{token:"keyword.control.export",foreground:"AF3029"},{token:"keyword.control.exception",foreground:"A02F6F"},{token:"keyword.control.trycatch",foreground:"A02F6F"},{token:"keyword.operator",foreground:"AF3029"},{token:"operator",foreground:"AF3029"},{token:"storage",foreground:"205EA6"},{token:"storage.type",foreground:"205EA6"},{token:"storage.modifier",foreground:"205EA6"},{token:"entity.name.function",foreground:"BC5215",fontStyle:"bold"},{token:"support.function",foreground:"BC5215",fontStyle:"bold"},{token:"meta.function-call",foreground:"BC5215"},{token:"entity.name.function.method",foreground:"66800B"},{token:"entity.name.class",foreground:"BC5215"},{token:"entity.name.type.class",foreground:"BC5215"},{token:"support.class",foreground:"BC5215"},{token:"entity.name.type",foreground:"AD8301"},{token:"entity.name.type.interface",foreground:"AD8301"},{token:"support.type",foreground:"AD8301"},{token:"entity.name.type.struct",foreground:"BC5215"},{token:"entity.name.type.enum",foreground:"BC5215"},{token:"entity.name.type.parameter",foreground:"BC5215"},{token:"variable",foreground:"100F0F"},{token:"variable.other",foreground:"100F0F"},{token:"variable.parameter",foreground:"100F0F"},{token:"variable.other.object",foreground:"66800B"},{token:"variable.other.readwrite.alias",foreground:"66800B"},{token:"variable.language",foreground:"A02F6F"},{token:"variable.language.this",foreground:"A02F6F"},{token:"variable.language.super",foreground:"A02F6F"},{token:"variable.other.property",foreground:"205EA6"},{token:"support.variable.property",foreground:"205EA6"},{token:"variable.other.constant",foreground:"100F0F"},{token:"meta.object-literal.key",foreground:"BC5215"},{token:"support.type.property-name",foreground:"BC5215"},{token:"entity.name.tag",foreground:"205EA6"},{token:"tag",foreground:"205EA6"},{token:"support.class.component",foreground:"A02F6F"},{token:"entity.other.attribute-name",foreground:"AD8301"},{token:"entity.name.namespace",foreground:"AD8301"},{token:"entity.name.module",foreground:"AF3029"},{token:"meta.decorator",foreground:"AD8301"},{token:"entity.name.function.decorator",foreground:"AD8301"},{token:"entity.name.label",foreground:"A02F6F"},{token:"meta.preprocessor",foreground:"A02F6F"},{token:"entity.name.function.preprocessor",foreground:"205EA6"},{token:"punctuation",foreground:"6F6E69"},{token:"delimiter",foreground:"6F6E69"},{token:"delimiter.bracket",foreground:"6F6E69"},{token:"markup.heading",foreground:"AD8301"},{token:"markup.bold",foreground:"AD8301",fontStyle:"bold"},{token:"markup.italic",foreground:"24837B",fontStyle:"italic"},{token:"markup.underline.link",foreground:"205EA6"},{token:"markup.inline.raw",foreground:"24837B"},{token:"invalid",foreground:"AF3029"},{token:"invalid.illegal",foreground:"AF3029"},{token:"string.key.json",foreground:"BC5215"},{token:"string.value.json",foreground:"24837B"},{token:"support.type.property-name.css",foreground:"100F0F"},{token:"support.constant.property-value.css",foreground:"24837B"},{token:"type",foreground:"AD8301"},{token:"type.identifier",foreground:"AD8301"},{token:"identifier",foreground:"100F0F"}],colors:{"editor.background":"#FFFCF0","editor.foreground":"#100F0F","editor.lineHighlightBackground":"#F2F0E5","editor.selectionBackground":"#100F0F44","editor.selectionHighlightBackground":"#100F0F44","editor.inactiveSelectionBackground":"#E6E4D9","editor.findMatchBackground":"#D0A215","editor.findMatchHighlightBackground":"#D0A215cc","editor.hoverHighlightBackground":"#DAD8CE","editor.rangeHighlightBackground":"#CECDC3","editorCursor.foreground":"#100F0F","editorLineNumber.foreground":"#CECDC3","editorLineNumber.activeForeground":"#100F0F","editorGutter.background":"#FFFCF0","editorGutter.modifiedBackground":"#24837B","editorGutter.addedBackground":"#66800B","editorGutter.deletedBackground":"#AF3029","diffEditor.insertedTextBackground":"#66800B25","diffEditor.removedTextBackground":"#AF302925","diffEditor.insertedLineBackground":"#66800B15","diffEditor.removedLineBackground":"#AF302915","diffEditor.insertedTextBorder":"#00000000","diffEditor.removedTextBorder":"#00000000","editorBracketMatch.background":"#E6E4D9","editorBracketMatch.border":"#DAD8CE","editorWhitespace.foreground":"#CECDC3","editorIndentGuide.background1":"#DAD8CE","editorIndentGuide.activeBackground1":"#B7B5AC","editorWidget.background":"#F2F0E5","editorWidget.border":"#DAD8CE","editorSuggestWidget.background":"#FFFCF0","editorSuggestWidget.border":"#DAD8CE","editorSuggestWidget.foreground":"#100F0F","editorSuggestWidget.selectedBackground":"#DAD8CE","editorHoverWidget.background":"#E6E4D9","editorHoverWidget.border":"#DAD8CE","editorInlayHint.foreground":"#6F6E69","editorInlayHint.background":"#DAD8CE","editorError.foreground":"#AF3029","editorWarning.foreground":"#BC5215","editorInfo.foreground":"#205EA6","input.background":"#F2F0E5","input.foreground":"#100F0F","input.border":"#DAD8CE","input.placeholderForeground":"#6F6E69","dropdown.background":"#F2F0E5","dropdown.foreground":"#100F0F","dropdown.border":"#DAD8CE","dropdown.listBackground":"#FFFCF0",focusBorder:"#DAD8CE","scrollbarSlider.background":"#DAD8CE80","scrollbarSlider.hoverBackground":"#CECDC3","scrollbarSlider.activeBackground":"#B7B5AC"}},C=o=>o.metadata.variant==="dark"?B:y,m=(o,c)=>{const d=c??h();if(!d)return;const r=C(o);if(p===r)return;const a=o.metadata.variant==="dark"?v:w;d.editor.defineTheme(r,a),p=r},M=({original:o,modified:c,language:d,renderSideBySide:r,allowResponsive:a=!1,readOnly:k=!0,showLineNumbers:s=!0})=>{const{currentTheme:t}=b(),g=n.useRef(null),f=n.useMemo(()=>C(t),[t]),D=n.useCallback(e=>{m(t,e)},[t]),E=n.useMemo(()=>({readOnly:k,renderSideBySide:r,automaticLayout:!0,minimap:{enabled:!1},wordWrap:"off",lineNumbers:s?"on":"off",renderIndicators:!1,scrollBeyondLastLine:!1,renderLineHighlight:"none",selectionHighlight:!1,occurrencesHighlight:"off",roundedSelection:!1,contextmenu:!1,folding:!1,glyphMargin:!1,renderMarginRevertIcon:!1,scrollbar:{vertical:"visible",horizontal:"visible",verticalScrollbarSize:6,horizontalScrollbarSize:6,useShadows:!1},hover:{enabled:!1},overviewRulerLanes:1,useInlineViewWhenSpaceIsLimited:a}),[a,k,r,s]);return n.useEffect(()=>{if(typeof window>"u")return;const e=window.monaco;e?.editor?.setTheme&&(m(t),e.editor.setTheme(f))},[t,f]),n.useEffect(()=>{const e=g.current;if(!e)return;const i=e.getOriginalEditor(),l=e.getModifiedEditor(),u={hover:{enabled:!1},quickSuggestions:!1,parameterHints:{enabled:!1},suggestOnTriggerCharacters:!1};i.updateOptions(u),l.updateOptions(u)},[f,k,r]),n.useEffect(()=>()=>{const e=g.current;if(e)try{e.dispose?.()}catch(i){console.warn("Error disposing DiffEditor:",i)}g.current=null},[]),typeof window>"u"?null:A.jsx(F,{original:o,modified:c,originalLanguage:d,modifiedLanguage:d,theme:f,options:E,beforeMount:D,onMount:e=>{g.current=e;const i=e.getOriginalEditor(),l=e.getModifiedEditor(),u={hover:{enabled:!1},quickSuggestions:!1,parameterHints:{enabled:!1},suggestOnTriggerCharacters:!1};i.updateOptions(u),l.updateOptions(u)},loading:null,className:"monaco-diff-wrapper"})};export{M as MonacoDiffViewer};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{h as S,j as e,b3 as v,bg as m,b9 as P,a9 as T,aR as _,al as C,aT as w,Q as D,aI as O,aw as j,bd as F,be as I,bf as W,W as z}from"./vendor-.pnpm-B1ce5n1Z.js";import{D as R,a as $,c as h,b as H,t as u,g as b,f as B,p as Q,r as V,d as E,e as G,h as A,i as U}from"./main-
|
|
1
|
+
import{h as S,j as e,b3 as v,bg as m,b9 as P,a9 as T,aR as _,al as C,aT as w,Q as D,aI as O,aw as j,bd as F,be as I,bf as W,W as z}from"./vendor-.pnpm-B1ce5n1Z.js";import{D as R,a as $,c as h,b as H,t as u,g as b,f as B,p as Q,r as V,d as E,e as G,h as A,i as U}from"./main-DvzQhmuw.js";import"./index-CMbNRGFL.js";const q=r=>{const o="h-3.5 w-3.5 flex-shrink-0",t=r.toLowerCase();return t==="reasoning"?e.jsx(T,{className:o}):t==="image-preview"?e.jsx(_,{className:o}):t==="edit"||t==="multiedit"||t==="str_replace"||t==="str_replace_based_edit_tool"?e.jsx(C,{className:o}):t==="write"||t==="create"||t==="file_write"?e.jsx(w,{className:o}):t==="read"||t==="view"||t==="file_read"||t==="cat"?e.jsx(w,{className:o}):t==="bash"||t==="shell"||t==="cmd"||t==="terminal"?e.jsx(D,{className:o}):t==="list"||t==="ls"||t==="dir"||t==="list_files"?e.jsx(O,{className:o}):t==="search"||t==="grep"||t==="find"||t==="ripgrep"?e.jsx(j,{className:o}):t==="glob"?e.jsx(F,{className:o}):t==="fetch"||t==="curl"||t==="wget"||t==="webfetch"?e.jsx(I,{className:o}):t==="web-search"||t==="websearch"||t==="search_web"||t==="google"||t==="bing"||t==="duckduckgo"?e.jsx(j,{className:o}):t==="todowrite"||t==="todoread"?e.jsx(W,{className:o}):t.startsWith("git")?e.jsx(z,{className:o}):e.jsx(v,{className:o})},Y=({popup:r,onOpenChange:o,syntaxTheme:t,isMobile:f})=>{const[y,N]=S.useState(f?"unified":"side-by-side");return e.jsx(R,{open:r.open,onOpenChange:o,children:e.jsxs($,{className:h("overflow-hidden flex flex-col min-h-0 pt-3 pb-4 px-4 gap-1","[&>button]:top-1.5",f?"w-[95vw] max-w-[95vw]":"max-w-5xl",f?"[&>button]:right-1":"[&>button]:top-2.5 [&>button]:right-4"),style:{maxHeight:"90vh"},children:[e.jsx("div",{className:"flex-shrink-0 pb-1",children:e.jsxs("div",{className:"flex items-start gap-2 text-foreground typography-ui-header font-semibold",children:[r.metadata?.tool?q(r.metadata.tool):e.jsx(v,{className:"h-3.5 w-3.5 text-foreground flex-shrink-0"}),e.jsx("span",{className:"break-words flex-1 leading-tight",children:r.title}),r.isDiff&&e.jsx(H,{mode:y,onModeChange:N,className:"mr-8 flex-shrink-0"})]})}),e.jsx("div",{className:"flex-1 min-h-0 rounded-xl border border-border/30 bg-muted/10 overflow-hidden",children:e.jsxs("div",{className:"h-full max-h-[75vh] overflow-y-auto px-3 pr-4",children:[r.metadata?.input&&typeof r.metadata.input=="object"&&Object.keys(r.metadata.input).length>0&&r.metadata?.tool!=="todowrite"&&r.metadata?.tool!=="todoread"?(()=>{const s=r.metadata,g=s.input,a=i=>{const n=g[i];return typeof n=="string"?n:typeof n=="number"?String(n):null};return e.jsxs("div",{className:"border-b border-border/20 p-4 -mx-3",children:[e.jsx("div",{className:"typography-markdown font-medium text-muted-foreground mb-2 px-3",children:s.tool==="bash"?"Command:":s.tool==="task"?"Task Details:":"Input:"}),s.tool==="bash"&&a("command")?e.jsx("div",{className:"bg-muted/30 rounded-xl border border-border/20 mx-3",children:e.jsx(m,{style:t,language:"bash",PreTag:"div",customStyle:u.getPopupStyles(),wrapLongLines:!0,children:a("command")})}):s.tool==="task"&&a("prompt")?e.jsxs("pre",{className:"bg-muted/30 p-3 rounded-xl border border-border/20 font-mono whitespace-pre-wrap text-foreground/90 mx-3",style:u.getPopupStyles(),children:[a("description")?`Task: ${a("description")}
|
|
2
2
|
`:"",a("subagent_type")?`Agent Type: ${a("subagent_type")}
|
|
3
3
|
`:"",`Instructions:
|
|
4
4
|
${a("prompt")}`]}):s.tool==="write"&&a("content")?e.jsx("div",{className:"bg-muted/30 rounded-xl border border-border/20 mx-3",children:e.jsx(m,{style:t,language:b(a("filePath")||a("file_path")||"")||"text",PreTag:"div",customStyle:u.getPopupStyles(),wrapLongLines:!0,children:a("content")})}):e.jsx("pre",{className:"bg-muted/30 p-3 rounded-xl border border-border/20 font-mono whitespace-pre-wrap text-foreground/90 mx-3",style:u.getPopupStyles(),children:B(g,s.tool)})]})})():null,r.isDiff?y==="unified"?e.jsx("div",{className:"typography-markdown",children:Q(r.content).map((s,g)=>e.jsxs("div",{className:"border-b border-border/20 last:border-b-0",children:[e.jsx("div",{className:h("bg-muted/20 px-3 py-2 font-medium text-muted-foreground border-b border-border/10 sticky top-0 z-10 break-words -mx-3",f?"typography-micro":"typography-markdown"),children:`${s.file} (line ${s.oldStart})`}),e.jsx("div",{children:s.lines.map((a,i)=>e.jsxs("div",{className:h("typography-markdown font-mono px-3 py-0.5 flex",a.type==="context"&&"bg-transparent",a.type==="removed"&&"bg-transparent",a.type==="added"&&"bg-transparent"),style:{lineHeight:"1.1",...a.type==="removed"?{backgroundColor:"var(--tools-edit-removed-bg)"}:a.type==="added"?{backgroundColor:"var(--tools-edit-added-bg)"}:{}},children:[e.jsx("span",{className:"text-muted-foreground/60 w-10 flex-shrink-0 text-right pr-3 self-start select-none",children:a.lineNumber||""}),e.jsx("div",{className:"flex-1 min-w-0",children:(()=>{const n=typeof r.metadata?.input=="object"&&r.metadata.input!==null?r.metadata.input.file_path||r.metadata.input.filePath:null,d=typeof n=="string"?n:"",l=typeof s=="object"&&s!==null&&"file"in s?s.file:null,x=d||(typeof l=="string"?l:"")||"";return e.jsx(m,{style:t,language:b(x)||"text",PreTag:"div",wrapLines:!0,wrapLongLines:!0,customStyle:{margin:0,padding:0,fontSize:"inherit",background:"transparent !important",borderRadius:0,overflow:"visible",whiteSpace:"pre-wrap",wordBreak:"break-all",overflowWrap:"anywhere"},codeTagProps:{style:{background:"transparent !important"}},children:a.content})})()})]},i))})]},g))}):r.diffHunks?e.jsx("div",{className:"typography-markdown",children:r.diffHunks.map((s,g)=>e.jsxs("div",{className:"border-b border-border/20 last:border-b-0",children:[e.jsx("div",{className:h("bg-muted/20 px-3 py-2 font-medium text-muted-foreground border-b border-border/10 sticky top-0 z-10 break-words -mx-3",f?"typography-micro":"typography-markdown"),children:`${s.file} (line ${s.oldStart})`}),e.jsx("div",{children:s.lines.map((a,i)=>e.jsxs("div",{className:"grid grid-cols-2 divide-x divide-border/20",children:[e.jsx("div",{className:h("typography-markdown font-mono px-3 py-0.5 overflow-hidden",a.leftLine.type==="context"&&"bg-transparent",a.leftLine.type==="empty"&&"bg-transparent"),style:{lineHeight:"1.1",...a.leftLine.type==="removed"?{backgroundColor:"var(--tools-edit-removed-bg)"}:{}},children:e.jsxs("div",{className:"flex",children:[e.jsx("span",{className:"text-muted-foreground/60 w-10 flex-shrink-0 text-right pr-3 self-start select-none",children:a.leftLine.lineNumber||""}),e.jsx("div",{className:"flex-1 min-w-0",children:a.leftLine.content&&e.jsx(m,{style:t,language:(()=>{const n=r.metadata?.input,d=typeof n=="object"&&n!==null?n:{},l=d.file_path||d.filePath,c=s.file;return b(typeof l=="string"?l:c)||"text"})(),PreTag:"div",wrapLines:!0,wrapLongLines:!0,customStyle:{margin:0,padding:0,fontSize:"inherit",background:"transparent !important",borderRadius:0,overflow:"visible",whiteSpace:"pre-wrap",wordBreak:"break-all",overflowWrap:"anywhere"},codeTagProps:{style:{background:"transparent !important"}},children:a.leftLine.content})})]})}),e.jsx("div",{className:h("typography-markdown font-mono px-3 py-0.5 overflow-hidden",a.rightLine.type==="context"&&"bg-transparent",a.rightLine.type==="empty"&&"bg-transparent"),style:{lineHeight:"1.1",...a.rightLine.type==="added"?{backgroundColor:"var(--tools-edit-added-bg)"}:{}},children:e.jsxs("div",{className:"flex",children:[e.jsx("span",{className:"text-muted-foreground/60 w-10 flex-shrink-0 text-right pr-3 self-start select-none",children:a.rightLine.lineNumber||""}),e.jsx("div",{className:"flex-1 min-w-0",children:a.rightLine.content&&e.jsx(m,{style:t,language:(()=>{const n=r.metadata?.input,d=typeof n=="object"&&n!==null?n:{},l=d.file_path||d.filePath,c=s.file;return b(typeof l=="string"?l:c)||"text"})(),PreTag:"div",wrapLines:!0,wrapLongLines:!0,customStyle:{margin:0,padding:0,fontSize:"inherit",background:"transparent !important",borderRadius:0,overflow:"visible",whiteSpace:"pre-wrap",wordBreak:"break-all",overflowWrap:"anywhere"},codeTagProps:{style:{background:"transparent !important"}},children:a.rightLine.content})})]})})]},i))})]},g))}):null:r.image?e.jsx("div",{className:"p-4",children:e.jsxs("div",{className:"flex flex-col items-center gap-3",children:[e.jsx("div",{className:"max-h-[70vh] overflow-hidden rounded-2xl border border-border/40 bg-muted/10",children:e.jsx("img",{src:r.image.url,alt:r.image.filename||r.title||"Image preview",className:"block h-full max-h-[70vh] w-auto max-w-full object-contain",loading:"lazy"})}),r.image.filename&&e.jsx("span",{className:"typography-meta text-muted-foreground text-center",children:r.image.filename})]})}):r.content?e.jsx("div",{className:"p-4",children:(()=>{const s=r.metadata?.tool;if(s==="todowrite"||s==="todoread")return V(r.content)||e.jsx(m,{style:t,language:"json",PreTag:"div",wrapLongLines:!0,customStyle:u.getPopupContainerStyles(),codeTagProps:{style:{background:"transparent !important"}},children:r.content});if(s==="list")return E(r.content)||e.jsx("pre",{className:"typography-markdown bg-muted/30 p-2 rounded-xl border border-border/20 font-mono whitespace-pre-wrap",children:r.content});if(s==="grep")return G(r.content,f)||e.jsx("pre",{className:"typography-markdown bg-muted/30 p-2 rounded-xl border border-border/20 font-mono whitespace-pre-wrap",children:r.content});if(s==="glob")return A(r.content,f)||e.jsx("pre",{className:"typography-markdown bg-muted/30 p-2 rounded-xl border border-border/20 font-mono whitespace-pre-wrap",children:r.content});if(s==="task"||s==="reasoning")return e.jsx("div",{className:s==="reasoning"?"text-muted-foreground/70":"",style:{fontSize:"var(--text-meta)"},children:e.jsx(P,{mode:"static",className:"streamdown-content streamdown-tool",children:r.content})});if(s==="web-search"||s==="websearch"||s==="search_web")return U(r.content)||e.jsx(m,{style:t,language:"text",PreTag:"div",wrapLongLines:!0,customStyle:u.getPopupContainerStyles(),codeTagProps:{style:{background:"transparent !important"}},children:r.content});if(s==="read"){const g=r.content.split(`
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/main-
|
|
2
|
-
import{_ as F}from"./vendor-.pnpm-B1ce5n1Z.js";(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const n of document.querySelectorAll('link[rel="modulepreload"]'))o(n);new MutationObserver(n=>{for(const a of n)if(a.type==="childList")for(const l of a.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&o(l)}).observe(document,{childList:!0,subtree:!0});function r(n){const a={};return n.integrity&&(a.integrity=n.integrity),n.referrerPolicy&&(a.referrerPolicy=n.referrerPolicy),n.crossOrigin==="use-credentials"?a.credentials="include":n.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function o(n){if(n.ep)return;n.ep=!0;const a=r(n);fetch(n.href,a)}})();async function x(t){const e=await fetch("/api/terminal/create",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({cwd:t.cwd,cols:t.cols||80,rows:t.rows||24})});if(!e.ok){const r=await e.json().catch(()=>({error:"Failed to create terminal"}));throw new Error(r.error||"Failed to create terminal session")}return e.json()}function $(t,e,r,o={}){const{maxRetries:n=3,initialRetryDelay:a=1e3,maxRetryDelay:l=8e3,connectionTimeout:P=1e4}=o;let c=null,d=0,w=null,y=null,m=!1,g=!1,u=!1;const T=()=>{w&&(clearTimeout(w),w=null),y&&(clearTimeout(y),y=null)},E=()=>{m=!0,T(),c&&(c.close(),c=null)},j=()=>{if(!(m||u)){if(c&&c.readyState!==EventSource.CLOSED){console.warn("Attempted to create duplicate EventSource, skipping");return}g=!1,c=new EventSource(`/api/terminal/${t}/stream`),y=setTimeout(()=>{!g&&c?.readyState!==EventSource.OPEN&&(console.error("Terminal connection timeout"),c?.close(),b(new Error("Connection timeout"),!1))},P),c.onopen=()=>{g||(g=!0,d=0,T(),e({type:"connected"}))},c.onmessage=h=>{try{const f=JSON.parse(h.data);f.type==="exit"&&(u=!0,E()),e(f)}catch(f){console.error("Failed to parse terminal event:",f),r?.(f,!1)}},c.onerror=h=>{console.error("Terminal stream error:",h,"readyState:",c?.readyState),T();const f=u||c?.readyState===EventSource.CLOSED;c?.close(),c=null,u||b(new Error("Terminal stream connection error"),f)}}},b=(h,f)=>{if(!(m||u))if(d<n&&!f){d++;const k=Math.min(a*Math.pow(2,d-1),l);console.log(`Reconnecting to terminal stream (attempt ${d}/${n}) in ${k}ms`),e({type:"reconnecting",attempt:d,maxAttempts:n}),w=setTimeout(()=>{!m&&!u&&j()},k)}else console.error(`Terminal connection failed after ${d} attempts`),r?.(h,!0),E()};return j(),E}async function C(t,e){const r=await fetch(`/api/terminal/${t}/input`,{method:"POST",headers:{"Content-Type":"text/plain"},body:e});if(!r.ok){const o=await r.json().catch(()=>({error:"Failed to send input"}));throw new Error(o.error||"Failed to send terminal input")}}async function N(t,e,r){const o=await fetch(`/api/terminal/${t}/resize`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({cols:e,rows:r})});if(!o.ok){const n=await o.json().catch(()=>({error:"Failed to resize terminal"}));throw new Error(n.error||"Failed to resize terminal")}}async function G(t){const e=await fetch(`/api/terminal/${t}`,{method:"DELETE"});if(!e.ok){const r=await e.json().catch(()=>({error:"Failed to close terminal"}));throw new Error(r.error||"Failed to close terminal")}}const I=t=>{const e=t?.retry;return{maxRetries:e?.maxRetries??3,initialRetryDelay:e?.initialDelayMs??1e3,maxRetryDelay:e?.maxDelayMs??8e3,connectionTimeout:t?.connectionTimeoutMs??1e4}},A=()=>({async createSession(t){return x(t)},connect(t,e,r){const o=$(t,e.onEvent,e.onError,I(r));return{close:()=>o()}},async sendInput(t,e){await C(t,e)},async resize(t){await N(t.sessionId,t.cols,t.rows)},async close(t){await G(t)}}),v=()=>{if(typeof window>"u")return"";const t=window.__OPENCHAMBER_DESKTOP_SERVER__?.origin;return t||window.location.origin},s="/api/git";function i(t,e,r){const o=new URL(t,v());if(e&&o.searchParams.set("directory",e),r)for(const[n,a]of Object.entries(r))a!==void 0&&o.searchParams.set(n,String(a));return o.toString()}async function D(t){const e=await fetch(i(`${s}/check`,t));if(!e.ok)throw new Error(`Failed to check git repository: ${e.statusText}`);return(await e.json()).isGitRepository}async function R(t){const e=await fetch(i(`${s}/status`,t));if(!e.ok)throw new Error(`Failed to get git status: ${e.statusText}`);return e.json()}async function _(t,e){const{path:r,staged:o,contextLines:n}=e;if(!r)throw new Error("path is required to fetch git diff");const a=await fetch(i(`${s}/diff`,t,{path:r,staged:o?"true":void 0,context:n}));if(!a.ok)throw new Error(`Failed to get git diff: ${a.statusText}`);return a.json()}async function J(t,e){const{path:r,staged:o}=e;if(!r)throw new Error("path is required to fetch git file diff");const n=await fetch(i(`${s}/file-diff`,t,{path:r,staged:o?"true":void 0}));if(!n.ok)throw new Error(`Failed to get git file diff: ${n.statusText}`);return n.json()}async function L(t,e){if(!e)throw new Error("path is required to revert git changes");const r=await fetch(i(`${s}/revert`,t),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:e})});if(!r.ok){const o=await r.json().catch(()=>({error:r.statusText}));throw new Error(o.error||"Failed to revert git changes")}}async function W(t){if(!t)return!1;const e=await fetch(i(`${s}/worktree-type`,t));if(!e.ok)throw new Error(`Failed to detect worktree type: ${e.statusText}`);return!!(await e.json()).linked}async function B(t){const e=await fetch(i(`${s}/branches`,t));if(!e.ok)throw new Error(`Failed to get branches: ${e.statusText}`);return e.json()}async function q(t,e){if(!e?.branch)throw new Error("branch is required to delete a branch");const r=await fetch(i(`${s}/branches`,t),{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!r.ok){const o=await r.json().catch(()=>({error:r.statusText}));throw new Error(o.error||"Failed to delete branch")}return r.json()}async function M(t,e){if(!e?.branch)throw new Error("branch is required to delete remote branch");const r=await fetch(i(`${s}/remote-branches`,t),{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!r.ok){const o=await r.json().catch(()=>({error:r.statusText}));throw new Error(o.error||"Failed to delete remote branch")}return r.json()}async function z(t,e){if(!Array.isArray(e)||e.length===0)throw new Error("No files provided to generate commit message");const r=await fetch(i(`${s}/commit-message`,t),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({files:e})});if(!r.ok){const l=await r.json().catch(()=>({error:r.statusText}));throw new Error(l.error||"Failed to generate commit message")}const o=await r.json();if(!o?.message||typeof o.message!="object")throw new Error("Malformed commit generation response");const n=typeof o.message.subject=="string"&&o.message.subject.trim().length>0?o.message.subject.trim():"",a=Array.isArray(o.message.highlights)?o.message.highlights.filter(l=>typeof l=="string"&&l.trim().length>0).map(l=>l.trim()):[];return{message:{subject:n,highlights:a}}}async function U(t){const e=await fetch(i(`${s}/worktrees`,t));if(!e.ok){const r=await e.json().catch(()=>({error:e.statusText}));throw new Error(r.error||"Failed to list worktrees")}return e.json()}async function H(t,e){if(!e?.path||!e?.branch)throw new Error("path and branch are required to add a worktree");const r=await fetch(i(`${s}/worktrees`,t),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!r.ok){const o=await r.json().catch(()=>({error:r.statusText}));throw new Error(o.error||"Failed to add worktree")}return r.json()}async function K(t,e){if(!e?.path)throw new Error("path is required to remove a worktree");const r=await fetch(i(`${s}/worktrees`,t),{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!r.ok){const o=await r.json().catch(()=>({error:r.statusText}));throw new Error(o.error||"Failed to remove worktree")}return r.json()}async function V(t){const e=await fetch(i(`${s}/ignore-openchamber`,t),{method:"POST"});if(!e.ok){const r=await e.json().catch(()=>({error:e.statusText}));throw new Error(r.error||"Failed to update git ignore")}}async function Q(t,e,r={}){const o=await fetch(i(`${s}/commit`,t),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:e,addAll:r.addAll??!1,files:r.files})});if(!o.ok){const n=await o.json().catch(()=>({error:o.statusText}));throw new Error(n.error||"Failed to create commit")}return o.json()}async function X(t,e={}){const r=await fetch(i(`${s}/push`,t),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!r.ok){const o=await r.json().catch(()=>({error:r.statusText}));throw new Error(o.error||"Failed to push")}return r.json()}async function Y(t,e={}){const r=await fetch(i(`${s}/pull`,t),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!r.ok){const o=await r.json().catch(()=>({error:r.statusText}));throw new Error(o.error||"Failed to pull")}return r.json()}async function Z(t,e={}){const r=await fetch(i(`${s}/fetch`,t),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!r.ok){const o=await r.json().catch(()=>({error:r.statusText}));throw new Error(o.error||"Failed to fetch")}return r.json()}async function ee(t,e){const r=await fetch(i(`${s}/checkout`,t),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({branch:e})});if(!r.ok){const o=await r.json().catch(()=>({error:r.statusText}));throw new Error(o.error||"Failed to checkout branch")}return r.json()}async function te(t,e,r){const o=await fetch(i(`${s}/branches`,t),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:e,startPoint:r})});if(!o.ok){const n=await o.json().catch(()=>({error:o.statusText}));throw new Error(n.error||"Failed to create branch")}return o.json()}async function re(t,e={}){const r=await fetch(i(`${s}/log`,t,{maxCount:e.maxCount,from:e.from,to:e.to,file:e.file}));if(!r.ok)throw new Error(`Failed to get git log: ${r.statusText}`);return r.json()}async function oe(t,e){const r=await fetch(i(`${s}/commit-files`,t,{hash:e}));if(!r.ok)throw new Error(`Failed to get commit files: ${r.statusText}`);return r.json()}async function ne(){const t=await fetch(i(`${s}/identities`,void 0));if(!t.ok)throw new Error(`Failed to get git identities: ${t.statusText}`);return t.json()}async function se(t){const e=await fetch(i(`${s}/identities`,void 0),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(!e.ok){const r=await e.json().catch(()=>({error:e.statusText}));throw new Error(r.error||"Failed to create git identity")}return e.json()}async function ie(t,e){const r=await fetch(i(`${s}/identities/${t}`,void 0),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!r.ok){const o=await r.json().catch(()=>({error:r.statusText}));throw new Error(o.error||"Failed to update git identity")}return r.json()}async function ae(t){const e=await fetch(i(`${s}/identities/${t}`,void 0),{method:"DELETE"});if(!e.ok){const r=await e.json().catch(()=>({error:e.statusText}));throw new Error(r.error||"Failed to delete git identity")}}async function ce(t){if(!t)return null;const e=await fetch(i(`${s}/current-identity`,t));if(!e.ok)throw new Error(`Failed to get current git identity: ${e.statusText}`);const r=await e.json();return r?{userName:r.userName??null,userEmail:r.userEmail??null,sshCommand:r.sshCommand??null}:null}async function le(t,e){const r=await fetch(i(`${s}/set-identity`,t),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({profileId:e})});if(!r.ok){const o=await r.json().catch(()=>({error:r.statusText}));throw new Error(o.error||"Failed to set git identity")}return r.json()}const fe=()=>({checkIsGitRepository:D,getGitStatus:R,getGitDiff:_,getGitFileDiff:J,revertGitFile:L,isLinkedWorktree:W,getGitBranches:B,deleteGitBranch:q,deleteRemoteBranch:M,generateCommitMessage:z,listGitWorktrees:U,addGitWorktree:H,removeGitWorktree:K,ensureOpenChamberIgnored:V,createGitCommit(t,e,r){return Q(t,e,r)},gitPush:X,gitPull:Y,gitFetch:Z,checkoutBranch:ee,createBranch:te,getGitLog(t,e){return re(t,e)},getCommitFiles:oe,getCurrentGitIdentity:ce,setGitIdentity:le,getGitIdentities:ne,createGitIdentity:se,updateGitIdentity:ie,deleteGitIdentity:ae}),p=t=>t.replace(/\\/g,"/"),de=()=>({async listDirectory(t){const e=p(t),r=await fetch("/api/fs/list",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:e})});if(!r.ok){const o=await r.json().catch(()=>({error:r.statusText}));throw new Error(o.error||"Failed to list directory")}return r.json()},async search(t){const e=await fetch("/api/fs/search",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({directory:p(t.directory),query:t.query,maxResults:t.maxResults})});if(!e.ok){const o=await e.json().catch(()=>({error:e.statusText}));throw new Error(o.error||"Failed to search files")}const r=await e.json();return Array.isArray(r)?r.filter(o=>!!o&&typeof o=="object"&&typeof o.path=="string").map(o=>({path:p(o.path),score:o.score,preview:o.preview})):[]},async createDirectory(t){const e=p(t),r=await fetch("/api/fs/mkdir",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:e})});if(!r.ok){const n=await r.json().catch(()=>({error:r.statusText}));throw new Error(n.error||"Failed to create directory")}const o=await r.json();return{success:!!o?.success,path:typeof o?.path=="string"?p(o.path):e}}}),S="/api/config/settings",ue="/api/config/reload",O=t=>!t||typeof t!="object"?{}:t,he=()=>({async load(){const t=await fetch(S,{method:"GET",headers:{Accept:"application/json"}});if(!t.ok)throw new Error(`Failed to load settings: ${t.statusText}`);return{settings:O(await t.json().catch(()=>({}))),source:"web"}},async save(t){const e=await fetch(S,{method:"PUT",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify(t)});if(!e.ok){const o=await e.json().catch(()=>({error:e.statusText}));throw new Error(o.error||"Failed to save settings")}return O(await e.json().catch(()=>({})))},async restartOpenCode(){const t=await fetch(ue,{method:"POST"});if(!t.ok){const e=await t.json().catch(()=>({error:t.statusText}));throw new Error(e.error||"Failed to restart OpenCode")}return{restarted:!0}}}),pe=()=>({async requestDirectoryAccess(t){return{success:!0,path:t.path}},async startAccessingDirectory(t){return{success:!0}},async stopAccessingDirectory(t){return{success:!0}}}),we=async t=>{if(typeof Notification>"u")return console.info("Notifications not supported in this environment",t),!1;if(await Notification.requestPermission()!=="granted")return console.warn("Notification permission not granted"),!1;try{return new Notification(t?.title??"OpenChamber",{body:t?.body,tag:t?.tag}),!0}catch(r){return console.warn("Failed to send notification",r),!1}},ye=()=>({async notifyAgentCompletion(t){return we(t)},canNotify:()=>typeof Notification<"u"?Notification.permission==="granted":!1}),me=()=>({async getAvailableTools(){const t=await fetch("/api/experimental/tool/ids");if(!t.ok)throw new Error(`Tools API returned ${t.status} ${t.statusText}`);const e=await t.json();if(!Array.isArray(e))throw new Error("Tools API returned invalid data format");return e.filter(r=>typeof r=="string"&&r!=="invalid").sort()}}),ge=()=>({runtime:{platform:"web",isDesktop:!1,label:"web"},terminal:A(),git:fe(),files:de(),settings:he(),permissions:pe(),notifications:ye(),tools:me()});window.__OPENCHAMBER_RUNTIME_APIS__=ge();F(()=>import("./main-Di3gaYl_.js").then(t=>t.m),__vite__mapDeps([0,1,2,3]));export{M as a,ae as b,D as c,q as d,se as e,ce as f,R as g,ne as h,V as i,X as j,H as k,U as l,K as r,ie as u};
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/main-DvzQhmuw.js","assets/vendor-.pnpm-B1ce5n1Z.js","assets/vendor--B3aGWKBE.css","assets/main-BEJ2XliY.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{_ as F}from"./vendor-.pnpm-B1ce5n1Z.js";(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const n of document.querySelectorAll('link[rel="modulepreload"]'))o(n);new MutationObserver(n=>{for(const a of n)if(a.type==="childList")for(const l of a.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&o(l)}).observe(document,{childList:!0,subtree:!0});function r(n){const a={};return n.integrity&&(a.integrity=n.integrity),n.referrerPolicy&&(a.referrerPolicy=n.referrerPolicy),n.crossOrigin==="use-credentials"?a.credentials="include":n.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function o(n){if(n.ep)return;n.ep=!0;const a=r(n);fetch(n.href,a)}})();async function x(t){const e=await fetch("/api/terminal/create",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({cwd:t.cwd,cols:t.cols||80,rows:t.rows||24})});if(!e.ok){const r=await e.json().catch(()=>({error:"Failed to create terminal"}));throw new Error(r.error||"Failed to create terminal session")}return e.json()}function $(t,e,r,o={}){const{maxRetries:n=3,initialRetryDelay:a=1e3,maxRetryDelay:l=8e3,connectionTimeout:P=1e4}=o;let c=null,d=0,w=null,y=null,m=!1,g=!1,u=!1;const T=()=>{w&&(clearTimeout(w),w=null),y&&(clearTimeout(y),y=null)},E=()=>{m=!0,T(),c&&(c.close(),c=null)},j=()=>{if(!(m||u)){if(c&&c.readyState!==EventSource.CLOSED){console.warn("Attempted to create duplicate EventSource, skipping");return}g=!1,c=new EventSource(`/api/terminal/${t}/stream`),y=setTimeout(()=>{!g&&c?.readyState!==EventSource.OPEN&&(console.error("Terminal connection timeout"),c?.close(),b(new Error("Connection timeout"),!1))},P),c.onopen=()=>{g||(g=!0,d=0,T(),e({type:"connected"}))},c.onmessage=h=>{try{const f=JSON.parse(h.data);f.type==="exit"&&(u=!0,E()),e(f)}catch(f){console.error("Failed to parse terminal event:",f),r?.(f,!1)}},c.onerror=h=>{console.error("Terminal stream error:",h,"readyState:",c?.readyState),T();const f=u||c?.readyState===EventSource.CLOSED;c?.close(),c=null,u||b(new Error("Terminal stream connection error"),f)}}},b=(h,f)=>{if(!(m||u))if(d<n&&!f){d++;const k=Math.min(a*Math.pow(2,d-1),l);console.log(`Reconnecting to terminal stream (attempt ${d}/${n}) in ${k}ms`),e({type:"reconnecting",attempt:d,maxAttempts:n}),w=setTimeout(()=>{!m&&!u&&j()},k)}else console.error(`Terminal connection failed after ${d} attempts`),r?.(h,!0),E()};return j(),E}async function C(t,e){const r=await fetch(`/api/terminal/${t}/input`,{method:"POST",headers:{"Content-Type":"text/plain"},body:e});if(!r.ok){const o=await r.json().catch(()=>({error:"Failed to send input"}));throw new Error(o.error||"Failed to send terminal input")}}async function N(t,e,r){const o=await fetch(`/api/terminal/${t}/resize`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({cols:e,rows:r})});if(!o.ok){const n=await o.json().catch(()=>({error:"Failed to resize terminal"}));throw new Error(n.error||"Failed to resize terminal")}}async function G(t){const e=await fetch(`/api/terminal/${t}`,{method:"DELETE"});if(!e.ok){const r=await e.json().catch(()=>({error:"Failed to close terminal"}));throw new Error(r.error||"Failed to close terminal")}}const I=t=>{const e=t?.retry;return{maxRetries:e?.maxRetries??3,initialRetryDelay:e?.initialDelayMs??1e3,maxRetryDelay:e?.maxDelayMs??8e3,connectionTimeout:t?.connectionTimeoutMs??1e4}},A=()=>({async createSession(t){return x(t)},connect(t,e,r){const o=$(t,e.onEvent,e.onError,I(r));return{close:()=>o()}},async sendInput(t,e){await C(t,e)},async resize(t){await N(t.sessionId,t.cols,t.rows)},async close(t){await G(t)}}),v=()=>{if(typeof window>"u")return"";const t=window.__OPENCHAMBER_DESKTOP_SERVER__?.origin;return t||window.location.origin},s="/api/git";function i(t,e,r){const o=new URL(t,v());if(e&&o.searchParams.set("directory",e),r)for(const[n,a]of Object.entries(r))a!==void 0&&o.searchParams.set(n,String(a));return o.toString()}async function D(t){const e=await fetch(i(`${s}/check`,t));if(!e.ok)throw new Error(`Failed to check git repository: ${e.statusText}`);return(await e.json()).isGitRepository}async function R(t){const e=await fetch(i(`${s}/status`,t));if(!e.ok)throw new Error(`Failed to get git status: ${e.statusText}`);return e.json()}async function _(t,e){const{path:r,staged:o,contextLines:n}=e;if(!r)throw new Error("path is required to fetch git diff");const a=await fetch(i(`${s}/diff`,t,{path:r,staged:o?"true":void 0,context:n}));if(!a.ok)throw new Error(`Failed to get git diff: ${a.statusText}`);return a.json()}async function J(t,e){const{path:r,staged:o}=e;if(!r)throw new Error("path is required to fetch git file diff");const n=await fetch(i(`${s}/file-diff`,t,{path:r,staged:o?"true":void 0}));if(!n.ok)throw new Error(`Failed to get git file diff: ${n.statusText}`);return n.json()}async function L(t,e){if(!e)throw new Error("path is required to revert git changes");const r=await fetch(i(`${s}/revert`,t),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:e})});if(!r.ok){const o=await r.json().catch(()=>({error:r.statusText}));throw new Error(o.error||"Failed to revert git changes")}}async function W(t){if(!t)return!1;const e=await fetch(i(`${s}/worktree-type`,t));if(!e.ok)throw new Error(`Failed to detect worktree type: ${e.statusText}`);return!!(await e.json()).linked}async function B(t){const e=await fetch(i(`${s}/branches`,t));if(!e.ok)throw new Error(`Failed to get branches: ${e.statusText}`);return e.json()}async function q(t,e){if(!e?.branch)throw new Error("branch is required to delete a branch");const r=await fetch(i(`${s}/branches`,t),{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!r.ok){const o=await r.json().catch(()=>({error:r.statusText}));throw new Error(o.error||"Failed to delete branch")}return r.json()}async function M(t,e){if(!e?.branch)throw new Error("branch is required to delete remote branch");const r=await fetch(i(`${s}/remote-branches`,t),{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!r.ok){const o=await r.json().catch(()=>({error:r.statusText}));throw new Error(o.error||"Failed to delete remote branch")}return r.json()}async function z(t,e){if(!Array.isArray(e)||e.length===0)throw new Error("No files provided to generate commit message");const r=await fetch(i(`${s}/commit-message`,t),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({files:e})});if(!r.ok){const l=await r.json().catch(()=>({error:r.statusText}));throw new Error(l.error||"Failed to generate commit message")}const o=await r.json();if(!o?.message||typeof o.message!="object")throw new Error("Malformed commit generation response");const n=typeof o.message.subject=="string"&&o.message.subject.trim().length>0?o.message.subject.trim():"",a=Array.isArray(o.message.highlights)?o.message.highlights.filter(l=>typeof l=="string"&&l.trim().length>0).map(l=>l.trim()):[];return{message:{subject:n,highlights:a}}}async function U(t){const e=await fetch(i(`${s}/worktrees`,t));if(!e.ok){const r=await e.json().catch(()=>({error:e.statusText}));throw new Error(r.error||"Failed to list worktrees")}return e.json()}async function H(t,e){if(!e?.path||!e?.branch)throw new Error("path and branch are required to add a worktree");const r=await fetch(i(`${s}/worktrees`,t),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!r.ok){const o=await r.json().catch(()=>({error:r.statusText}));throw new Error(o.error||"Failed to add worktree")}return r.json()}async function K(t,e){if(!e?.path)throw new Error("path is required to remove a worktree");const r=await fetch(i(`${s}/worktrees`,t),{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!r.ok){const o=await r.json().catch(()=>({error:r.statusText}));throw new Error(o.error||"Failed to remove worktree")}return r.json()}async function V(t){const e=await fetch(i(`${s}/ignore-openchamber`,t),{method:"POST"});if(!e.ok){const r=await e.json().catch(()=>({error:e.statusText}));throw new Error(r.error||"Failed to update git ignore")}}async function Q(t,e,r={}){const o=await fetch(i(`${s}/commit`,t),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:e,addAll:r.addAll??!1,files:r.files})});if(!o.ok){const n=await o.json().catch(()=>({error:o.statusText}));throw new Error(n.error||"Failed to create commit")}return o.json()}async function X(t,e={}){const r=await fetch(i(`${s}/push`,t),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!r.ok){const o=await r.json().catch(()=>({error:r.statusText}));throw new Error(o.error||"Failed to push")}return r.json()}async function Y(t,e={}){const r=await fetch(i(`${s}/pull`,t),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!r.ok){const o=await r.json().catch(()=>({error:r.statusText}));throw new Error(o.error||"Failed to pull")}return r.json()}async function Z(t,e={}){const r=await fetch(i(`${s}/fetch`,t),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!r.ok){const o=await r.json().catch(()=>({error:r.statusText}));throw new Error(o.error||"Failed to fetch")}return r.json()}async function ee(t,e){const r=await fetch(i(`${s}/checkout`,t),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({branch:e})});if(!r.ok){const o=await r.json().catch(()=>({error:r.statusText}));throw new Error(o.error||"Failed to checkout branch")}return r.json()}async function te(t,e,r){const o=await fetch(i(`${s}/branches`,t),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:e,startPoint:r})});if(!o.ok){const n=await o.json().catch(()=>({error:o.statusText}));throw new Error(n.error||"Failed to create branch")}return o.json()}async function re(t,e={}){const r=await fetch(i(`${s}/log`,t,{maxCount:e.maxCount,from:e.from,to:e.to,file:e.file}));if(!r.ok)throw new Error(`Failed to get git log: ${r.statusText}`);return r.json()}async function oe(t,e){const r=await fetch(i(`${s}/commit-files`,t,{hash:e}));if(!r.ok)throw new Error(`Failed to get commit files: ${r.statusText}`);return r.json()}async function ne(){const t=await fetch(i(`${s}/identities`,void 0));if(!t.ok)throw new Error(`Failed to get git identities: ${t.statusText}`);return t.json()}async function se(t){const e=await fetch(i(`${s}/identities`,void 0),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(!e.ok){const r=await e.json().catch(()=>({error:e.statusText}));throw new Error(r.error||"Failed to create git identity")}return e.json()}async function ie(t,e){const r=await fetch(i(`${s}/identities/${t}`,void 0),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!r.ok){const o=await r.json().catch(()=>({error:r.statusText}));throw new Error(o.error||"Failed to update git identity")}return r.json()}async function ae(t){const e=await fetch(i(`${s}/identities/${t}`,void 0),{method:"DELETE"});if(!e.ok){const r=await e.json().catch(()=>({error:e.statusText}));throw new Error(r.error||"Failed to delete git identity")}}async function ce(t){if(!t)return null;const e=await fetch(i(`${s}/current-identity`,t));if(!e.ok)throw new Error(`Failed to get current git identity: ${e.statusText}`);const r=await e.json();return r?{userName:r.userName??null,userEmail:r.userEmail??null,sshCommand:r.sshCommand??null}:null}async function le(t,e){const r=await fetch(i(`${s}/set-identity`,t),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({profileId:e})});if(!r.ok){const o=await r.json().catch(()=>({error:r.statusText}));throw new Error(o.error||"Failed to set git identity")}return r.json()}const fe=()=>({checkIsGitRepository:D,getGitStatus:R,getGitDiff:_,getGitFileDiff:J,revertGitFile:L,isLinkedWorktree:W,getGitBranches:B,deleteGitBranch:q,deleteRemoteBranch:M,generateCommitMessage:z,listGitWorktrees:U,addGitWorktree:H,removeGitWorktree:K,ensureOpenChamberIgnored:V,createGitCommit(t,e,r){return Q(t,e,r)},gitPush:X,gitPull:Y,gitFetch:Z,checkoutBranch:ee,createBranch:te,getGitLog(t,e){return re(t,e)},getCommitFiles:oe,getCurrentGitIdentity:ce,setGitIdentity:le,getGitIdentities:ne,createGitIdentity:se,updateGitIdentity:ie,deleteGitIdentity:ae}),p=t=>t.replace(/\\/g,"/"),de=()=>({async listDirectory(t){const e=p(t),r=await fetch("/api/fs/list",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:e})});if(!r.ok){const o=await r.json().catch(()=>({error:r.statusText}));throw new Error(o.error||"Failed to list directory")}return r.json()},async search(t){const e=await fetch("/api/fs/search",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({directory:p(t.directory),query:t.query,maxResults:t.maxResults})});if(!e.ok){const o=await e.json().catch(()=>({error:e.statusText}));throw new Error(o.error||"Failed to search files")}const r=await e.json();return Array.isArray(r)?r.filter(o=>!!o&&typeof o=="object"&&typeof o.path=="string").map(o=>({path:p(o.path),score:o.score,preview:o.preview})):[]},async createDirectory(t){const e=p(t),r=await fetch("/api/fs/mkdir",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:e})});if(!r.ok){const n=await r.json().catch(()=>({error:r.statusText}));throw new Error(n.error||"Failed to create directory")}const o=await r.json();return{success:!!o?.success,path:typeof o?.path=="string"?p(o.path):e}}}),S="/api/config/settings",ue="/api/config/reload",O=t=>!t||typeof t!="object"?{}:t,he=()=>({async load(){const t=await fetch(S,{method:"GET",headers:{Accept:"application/json"}});if(!t.ok)throw new Error(`Failed to load settings: ${t.statusText}`);return{settings:O(await t.json().catch(()=>({}))),source:"web"}},async save(t){const e=await fetch(S,{method:"PUT",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify(t)});if(!e.ok){const o=await e.json().catch(()=>({error:e.statusText}));throw new Error(o.error||"Failed to save settings")}return O(await e.json().catch(()=>({})))},async restartOpenCode(){const t=await fetch(ue,{method:"POST"});if(!t.ok){const e=await t.json().catch(()=>({error:t.statusText}));throw new Error(e.error||"Failed to restart OpenCode")}return{restarted:!0}}}),pe=()=>({async requestDirectoryAccess(t){return{success:!0,path:t.path}},async startAccessingDirectory(t){return{success:!0}},async stopAccessingDirectory(t){return{success:!0}}}),we=async t=>{if(typeof Notification>"u")return console.info("Notifications not supported in this environment",t),!1;if(await Notification.requestPermission()!=="granted")return console.warn("Notification permission not granted"),!1;try{return new Notification(t?.title??"OpenChamber",{body:t?.body,tag:t?.tag}),!0}catch(r){return console.warn("Failed to send notification",r),!1}},ye=()=>({async notifyAgentCompletion(t){return we(t)},canNotify:()=>typeof Notification<"u"?Notification.permission==="granted":!1}),me=()=>({async getAvailableTools(){const t=await fetch("/api/experimental/tool/ids");if(!t.ok)throw new Error(`Tools API returned ${t.status} ${t.statusText}`);const e=await t.json();if(!Array.isArray(e))throw new Error("Tools API returned invalid data format");return e.filter(r=>typeof r=="string"&&r!=="invalid").sort()}}),ge=()=>({runtime:{platform:"web",isDesktop:!1,label:"web"},terminal:A(),git:fe(),files:de(),settings:he(),permissions:pe(),notifications:ye(),tools:me()});window.__OPENCHAMBER_RUNTIME_APIS__=ge();F(()=>import("./main-DvzQhmuw.js").then(t=>t.m),__vite__mapDeps([0,1,2,3]));export{M as a,ae as b,D as c,q as d,se as e,ce as f,R as g,ne as h,V as i,X as j,H as k,U as l,K as r,ie as u};
|